summaryrefslogtreecommitdiff
path: root/spec/mspec/Gemfile.lock
blob: cd39906044ef923cc7267dd15d458c15b123bbcf (plain)
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
GEM
  remote: https://rubygems.org/
  specs:
    diff-lcs (1.4.4)
    rake (12.3.3)
    rspec (3.10.0)
      rspec-core (~> 3.10.0)
      rspec-expectations (~> 3.10.0)
      rspec-mocks (~> 3.10.0)
    rspec-core (3.10.1)
      rspec-support (~> 3.10.0)
    rspec-expectations (3.10.1)
      diff-lcs (>= 1.2.0, < 2.0)
      rspec-support (~> 3.10.0)
    rspec-mocks (3.10.2)
      diff-lcs (>= 1.2.0, < 2.0)
      rspec-support (~> 3.10.0)
    rspec-support (3.10.2)

PLATFORMS
  java
  ruby

DEPENDENCIES
  rake (~> 12.3)
  rspec (~> 3.0)
binit654
-rw-r--r--.gitignore399
-rw-r--r--COPYING.ja6
-rw-r--r--ChangeLog54523
-rw-r--r--KNOWNBUGS.rb5
-rw-r--r--LEGAL192
-rw-r--r--Makefile.in203
-rw-r--r--NEWS793
-rw-r--r--README10
-rw-r--r--README.EXT469
-rw-r--r--README.EXT.ja539
-rw-r--r--README.ja27
-rw-r--r--ToDo14
-rw-r--r--array.c2768
-rw-r--r--bcc32/Makefile.sub205
-rw-r--r--bcc32/README.bcc3225
-rwxr-xr-xbcc32/configure.bat13
-rwxr-xr-xbcc32/mkexports.rb39
-rw-r--r--bcc32/setup.mak18
-rw-r--r--benchmark/bm_app_answer.rb15
-rw-r--r--benchmark/bm_app_erb.rb26
-rw-r--r--benchmark/bm_app_factorial.rb11
-rw-r--r--benchmark/bm_app_fib.rb10
-rw-r--r--benchmark/bm_app_mandelbrot.rb23
-rw-r--r--benchmark/bm_app_pentomino.rb259
-rw-r--r--benchmark/bm_app_raise.rb8
-rw-r--r--benchmark/bm_app_strconcat.rb5
-rw-r--r--benchmark/bm_app_tak.rb13
-rw-r--r--benchmark/bm_app_tarai.rb10
-rw-r--r--benchmark/bm_app_uri.rb8
-rw-r--r--benchmark/bm_io_file_create.rb13
-rw-r--r--benchmark/bm_io_file_read.rb15
-rw-r--r--benchmark/bm_io_file_write.rb14
-rw-r--r--benchmark/bm_loop_for.rb3
-rw-r--r--benchmark/bm_loop_generator.rb14
-rw-r--r--benchmark/bm_loop_times.rb1
-rw-r--r--benchmark/bm_loop_whileloop.rb4
-rw-r--r--benchmark/bm_loop_whileloop2.rb4
-rw-r--r--benchmark/bm_so_ackermann.rb19
-rw-r--r--benchmark/bm_so_array.rb23
-rw-r--r--benchmark/bm_so_binary_trees.rb57
-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.rb45
-rw-r--r--benchmark/bm_so_fasta.rb81
-rw-r--r--benchmark/bm_so_k_nucleotide.rb48
-rw-r--r--benchmark/bm_so_lists.rb47
-rw-r--r--benchmark/bm_so_mandelbrot.rb57
-rw-r--r--benchmark/bm_so_matrix.rb48
-rw-r--r--benchmark/bm_so_meteor_contest.rb564
-rw-r--r--benchmark/bm_so_nbody.rb148
-rw-r--r--benchmark/bm_so_nested_loop.rb24
-rw-r--r--benchmark/bm_so_nsieve.rb35
-rw-r--r--benchmark/bm_so_nsieve_bits.rb42
-rw-r--r--benchmark/bm_so_object.rb56
-rw-r--r--benchmark/bm_so_partial_sums.rb31
-rw-r--r--benchmark/bm_so_pidigits.rb92
-rw-r--r--benchmark/bm_so_random.rb20
-rw-r--r--benchmark/bm_so_reverse_complement.rb30
-rw-r--r--benchmark/bm_so_sieve.rb24
-rw-r--r--benchmark/bm_so_spectralnorm.rb50
-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_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_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_vm2_array.rb5
-rw-r--r--benchmark/bm_vm2_case.rb14
-rw-r--r--benchmark/bm_vm2_eval.rb6
-rw-r--r--benchmark/bm_vm2_method.rb9
-rw-r--r--benchmark/bm_vm2_mutex.rb9
-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_regexp.rb6
-rw-r--r--benchmark/bm_vm2_send.rb12
-rw-r--r--benchmark/bm_vm2_super.rb20
-rw-r--r--benchmark/bm_vm2_unif1.rb8
-rw-r--r--benchmark/bm_vm2_zsuper.rb20
-rwxr-xr-xbenchmark/bm_vm3_gc.rb7
-rw-r--r--benchmark/bm_vm3_thread_create_join.rb6
-rw-r--r--benchmark/bm_vm3_thread_mutex.rb18
-rw-r--r--benchmark/bmx_temp.rb9
-rw-r--r--benchmark/driver.rb253
-rw-r--r--benchmark/make_fasta_output.rb19
-rw-r--r--benchmark/other-lang/ack.pl11
-rw-r--r--benchmark/other-lang/ack.py16
-rw-r--r--benchmark/other-lang/ack.rb12
-rw-r--r--benchmark/other-lang/ack.scm7
-rw-r--r--benchmark/other-lang/eval.rb66
-rw-r--r--benchmark/other-lang/fact.pl13
-rw-r--r--benchmark/other-lang/fact.py18
-rw-r--r--benchmark/other-lang/fact.rb13
-rw-r--r--benchmark/other-lang/fact.scm8
-rw-r--r--benchmark/other-lang/fib.pl11
-rw-r--r--benchmark/other-lang/fib.py7
-rw-r--r--benchmark/other-lang/fib.rb9
-rw-r--r--benchmark/other-lang/fib.scm7
-rw-r--r--benchmark/other-lang/loop.pl3
-rw-r--r--benchmark/other-lang/loop.py2
-rw-r--r--benchmark/other-lang/loop.rb4
-rw-r--r--benchmark/other-lang/loop.scm1
-rw-r--r--benchmark/other-lang/loop2.rb1
-rw-r--r--benchmark/other-lang/tak.pl11
-rw-r--r--benchmark/other-lang/tak.py8
-rw-r--r--benchmark/other-lang/tak.rb13
-rw-r--r--benchmark/other-lang/tak.scm10
-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/report.rb81
-rw-r--r--benchmark/run.rb127
-rw-r--r--benchmark/runc.rb29
-rw-r--r--benchmark/wc.input.base25
-rw-r--r--bignum.c2300
-rwxr-xr-xbin/erb64
-rwxr-xr-xbin/gem25
-rw-r--r--[-rwxr-xr-x]bin/irb5
-rwxr-xr-xbin/rake31
-rw-r--r--[-rwxr-xr-x]bin/rdoc57
-rwxr-xr-xbin/ri48
-rwxr-xr-xbin/testrb15
-rw-r--r--blockinlining.c464
-rw-r--r--bootstraptest/pending.rb39
-rw-r--r--bootstraptest/runner.rb363
-rw-r--r--bootstraptest/test_attr.rb36
-rw-r--r--bootstraptest/test_autoload.rb78
-rw-r--r--bootstraptest/test_block.rb567
-rw-r--r--bootstraptest/test_class.rb152
-rw-r--r--bootstraptest/test_eval.rb301
-rw-r--r--bootstraptest/test_exception.rb404
-rw-r--r--bootstraptest/test_finalizer.rb8
-rw-r--r--bootstraptest/test_flip.rb1
-rw-r--r--bootstraptest/test_flow.rb504
-rw-r--r--bootstraptest/test_fork.rb28
-rw-r--r--bootstraptest/test_io.rb100
-rw-r--r--bootstraptest/test_jump.rb261
-rw-r--r--bootstraptest/test_literal.rb194
-rw-r--r--bootstraptest/test_load.rb27
-rw-r--r--bootstraptest/test_marshal.rb5
-rw-r--r--bootstraptest/test_massign.rb183
-rw-r--r--bootstraptest/test_method.rb1153
-rw-r--r--bootstraptest/test_objectspace.rb34
-rw-r--r--bootstraptest/test_proc.rb431
-rw-r--r--bootstraptest/test_struct.rb5
-rw-r--r--bootstraptest/test_syntax.rb830
-rw-r--r--bootstraptest/test_thread.rb387
-rw-r--r--class.c788
-rw-r--r--common.mk719
-rw-r--r--compar.c88
-rw-r--r--compile.c5415
-rw-r--r--complex.c2006
-rw-r--r--config.guess1459
-rw-r--r--config.sub1537
-rw-r--r--configure.in2050
-rw-r--r--cont.c1050
-rw-r--r--cygwin/GNUmakefile.in27
-rw-r--r--debug.c164
-rw-r--r--debug.h36
-rw-r--r--defines.h273
-rw-r--r--defs/keywords53
-rw-r--r--defs/known_errors.def122
-rw-r--r--defs/lex.c.src53
-rw-r--r--defs/opt_insn_unif.def29
-rw-r--r--defs/opt_operand.def59
-rw-r--r--dir.c860
-rw-r--r--distruby.rb59
-rw-r--r--djgpp/GNUmakefile.in2
-rw-r--r--djgpp/README.djgpp21
-rw-r--r--djgpp/config.hin114
-rw-r--r--djgpp/config.sed128
-rwxr-xr-xdjgpp/configure.bat20
-rw-r--r--djgpp/mkver.sed1
-rw-r--r--dln.c493
-rw-r--r--dln.h11
-rw-r--r--dmyencoding.c2
-rw-r--r--dmyext.c2
-rw-r--r--doc/ChangeLog-YARV6917
-rw-r--r--doc/NEWS-1.8.0837
-rw-r--r--doc/NEWS-1.8.7635
-rw-r--r--doc/NEWS-1.9.1420
-rw-r--r--doc/forwardable.rd1
-rw-r--r--doc/forwardable.rd.ja1
-rw-r--r--doc/images/boottime-classes.pngbin28677 -> 0 bytes-rw-r--r--doc/irb/irb-tools.rd.ja1
-rw-r--r--doc/irb/irb.rd1
-rw-r--r--doc/irb/irb.rd.ja1
-rw-r--r--doc/shell.rd1
-rw-r--r--doc/shell.rd.ja1
-rw-r--r--enc/Makefile.in63
-rw-r--r--enc/ascii.c93
-rw-r--r--enc/big5.c216
-rw-r--r--enc/cp949.c219
-rw-r--r--enc/depend143
-rw-r--r--enc/emacs_mule.c340
-rw-r--r--enc/encdb.c25
-rw-r--r--enc/euc_jp.c388
-rw-r--r--enc/euc_kr.c192
-rw-r--r--enc/euc_tw.c234
-rw-r--r--enc/gb18030.c596
-rw-r--r--enc/gb2312.c13
-rw-r--r--enc/gbk.c222
-rw-r--r--enc/iso_2022_jp.h24
-rw-r--r--enc/iso_8859_1.c285
-rw-r--r--enc/iso_8859_10.c244
-rw-r--r--enc/iso_8859_11.c111
-rw-r--r--enc/iso_8859_13.c243
-rw-r--r--enc/iso_8859_14.c246
-rw-r--r--enc/iso_8859_15.c240
-rw-r--r--enc/iso_8859_16.c242
-rw-r--r--enc/iso_8859_2.c250
-rw-r--r--enc/iso_8859_3.c240
-rw-r--r--enc/iso_8859_4.c242
-rw-r--r--enc/iso_8859_5.c230
-rw-r--r--enc/iso_8859_6.c107
-rw-r--r--enc/iso_8859_7.c237
-rw-r--r--enc/iso_8859_8.c107
-rw-r--r--enc/iso_8859_9.c243
-rw-r--r--enc/koi8_r.c219
-rw-r--r--enc/koi8_u.c221
-rw-r--r--enc/make_encmake.rb50
-rw-r--r--enc/prelude.rb6
-rw-r--r--enc/shift_jis.c399
-rw-r--r--enc/trans/CP/CP932UDA%UCS.src1912
-rw-r--r--enc/trans/CP/CP932VDC@IBM%UCS.src420
-rw-r--r--enc/trans/CP/CP932VDC@NEC_IBM%UCS.src406
-rw-r--r--enc/trans/CP/UCS%CP932UDA.src1912
-rw-r--r--enc/trans/CP/UCS%CP932VDC@IBM.src420
-rw-r--r--enc/trans/CP/UCS%CP932VDC@NEC_IBM.src406
-rw-r--r--enc/trans/GB/GB12345%UCS.src7618
-rw-r--r--enc/trans/GB/GB2312%UCS.src7535
-rw-r--r--enc/trans/GB/UCS%GB12345.src7620
-rw-r--r--enc/trans/GB/UCS%GB2312.src7531
-rw-r--r--enc/trans/JIS/JISX0201-KANA%UCS.src127
-rw-r--r--enc/trans/JIS/JISX0208@1990%UCS.src6972
-rw-r--r--enc/trans/JIS/JISX0208@MS%UCS.src6893
-rw-r--r--enc/trans/JIS/JISX0208UDC%UCS.src954
-rw-r--r--enc/trans/JIS/JISX0208VDC@NEC%UCS.src97
-rw-r--r--enc/trans/JIS/JISX0212%UCS.src6167
-rw-r--r--enc/trans/JIS/JISX0212@MS%UCS.src6081
-rw-r--r--enc/trans/JIS/JISX0212UDC%UCS.src954
-rw-r--r--enc/trans/JIS/JISX0212VDC@IBM%UCS.src120
-rw-r--r--enc/trans/JIS/UCS%JISX0201-KANA.src127
-rw-r--r--enc/trans/JIS/UCS%JISX0208@1990.src6974
-rw-r--r--enc/trans/JIS/UCS%JISX0208@MS.src6894
-rw-r--r--enc/trans/JIS/UCS%JISX0208UDC.src955
-rw-r--r--enc/trans/JIS/UCS%JISX0208VDC@NEC.src98
-rw-r--r--enc/trans/JIS/UCS%JISX0212.src6170
-rw-r--r--enc/trans/JIS/UCS%JISX0212@MS.src6082
-rw-r--r--enc/trans/JIS/UCS%JISX0212UDC.src955
-rw-r--r--enc/trans/JIS/UCS%JISX0212VDC@IBM.src121
-rw-r--r--enc/trans/big5-tbl.rb13705
-rw-r--r--enc/trans/big5.trans16
-rw-r--r--enc/trans/chinese.trans30
-rw-r--r--enc/trans/cp850-tbl.rb130
-rw-r--r--enc/trans/cp852-tbl.rb130
-rw-r--r--enc/trans/cp855-tbl.rb130
-rw-r--r--enc/trans/cp949-tbl.rb8831
-rw-r--r--enc/trans/escape.trans94
-rw-r--r--enc/trans/euckr-tbl.rb8228
-rw-r--r--enc/trans/gb18030-tbl.rb63330
-rw-r--r--enc/trans/gb18030.trans84
-rw-r--r--enc/trans/gbk-tbl.rb21793
-rw-r--r--enc/trans/gbk.trans16
-rw-r--r--enc/trans/ibm437-tbl.rb130
-rw-r--r--enc/trans/ibm775-tbl.rb130
-rw-r--r--enc/trans/ibm852-tbl.rb130
-rw-r--r--enc/trans/ibm855-tbl.rb130
-rw-r--r--enc/trans/ibm857-tbl.rb127
-rw-r--r--enc/trans/ibm860-tbl.rb130
-rw-r--r--enc/trans/ibm861-tbl.rb130
-rw-r--r--enc/trans/ibm862-tbl.rb130
-rw-r--r--enc/trans/ibm863-tbl.rb130
-rw-r--r--enc/trans/ibm865-tbl.rb130
-rw-r--r--enc/trans/ibm866-tbl.rb130
-rw-r--r--enc/trans/ibm869-tbl.rb121
-rw-r--r--enc/trans/iso-8859-1-tbl.rb98
-rw-r--r--enc/trans/iso-8859-10-tbl.rb98
-rw-r--r--enc/trans/iso-8859-11-tbl.rb90
-rw-r--r--enc/trans/iso-8859-13-tbl.rb98
-rw-r--r--enc/trans/iso-8859-14-tbl.rb98
-rw-r--r--enc/trans/iso-8859-15-tbl.rb98
-rw-r--r--enc/trans/iso-8859-2-tbl.rb98
-rw-r--r--enc/trans/iso-8859-3-tbl.rb91
-rw-r--r--enc/trans/iso-8859-4-tbl.rb98
-rw-r--r--enc/trans/iso-8859-5-tbl.rb98
-rw-r--r--enc/trans/iso-8859-6-tbl.rb53
-rw-r--r--enc/trans/iso-8859-7-tbl.rb95
-rw-r--r--enc/trans/iso-8859-8-tbl.rb62
-rw-r--r--enc/trans/iso-8859-9-tbl.rb98
-rw-r--r--enc/trans/iso2022.trans438
-rw-r--r--enc/trans/japanese.trans98
-rw-r--r--enc/trans/japanese_euc.trans46
-rw-r--r--enc/trans/japanese_sjis.trans34
-rw-r--r--enc/trans/koi8-r-tbl.rb130
-rw-r--r--enc/trans/koi8-u-tbl.rb130
-rw-r--r--enc/trans/korean.trans19
-rw-r--r--enc/trans/maccroatian-tbl.rb129
-rw-r--r--enc/trans/maccyrillic-tbl.rb130
-rw-r--r--enc/trans/macgreek-tbl.rb129
-rw-r--r--enc/trans/maciceland-tbl.rb129
-rw-r--r--enc/trans/macroman-tbl.rb129
-rw-r--r--enc/trans/macromania-tbl.rb129
-rw-r--r--enc/trans/macturkish-tbl.rb128
-rw-r--r--enc/trans/macukraine-tbl.rb130
-rw-r--r--enc/trans/newline.trans131
-rw-r--r--enc/trans/single_byte.trans91
-rw-r--r--enc/trans/tis-620-tbl.rb89
-rw-r--r--enc/trans/transdb.c18
-rw-r--r--enc/trans/utf8_mac-tbl.rb945
-rw-r--r--enc/trans/utf8_mac.trans242
-rw-r--r--enc/trans/utf_16_32.trans369
-rw-r--r--enc/trans/windows-1250-tbl.rb125
-rw-r--r--enc/trans/windows-1251-tbl.rb129
-rw-r--r--enc/trans/windows-1252-tbl.rb125
-rw-r--r--enc/trans/windows-1253-tbl.rb113
-rw-r--r--enc/trans/windows-1254-tbl.rb123
-rw-r--r--enc/trans/windows-1255-tbl.rb141
-rw-r--r--enc/trans/windows-1256-tbl.rb130
-rw-r--r--enc/trans/windows-1257-tbl.rb118
-rw-r--r--enc/trans/windows-874-tbl.rb99
-rw-r--r--enc/unicode.c11359
-rw-r--r--enc/us_ascii.c31
-rw-r--r--enc/utf_16be.c258
-rw-r--r--enc/utf_16le.c249
-rw-r--r--enc/utf_32be.c195
-rw-r--r--enc/utf_32le.c194
-rw-r--r--enc/utf_7.h5
-rw-r--r--enc/utf_8.c455
-rw-r--r--enc/windows_1251.c208
-rw-r--r--encoding.c1449
-rw-r--r--enum.c836
-rw-r--r--enumerator.c664
-rw-r--r--env.h60
-rw-r--r--error.c1049
-rw-r--r--eval.c13464
-rw-r--r--eval_error.c272
-rw-r--r--eval_intern.h232
-rw-r--r--eval_jump.c152
-rw-r--r--ext/.document65
-rw-r--r--ext/Setup6
-rw-r--r--ext/Setup.atheos5
-rw-r--r--ext/Setup.dj34
-rw-r--r--ext/Setup.emx5
-rw-r--r--ext/Setup.nt5
-rw-r--r--ext/Setup.x6834
-rw-r--r--ext/Win32API/.cvsignore3
-rw-r--r--ext/Win32API/Win32API.c215
-rw-r--r--ext/Win32API/depend1
-rw-r--r--ext/Win32API/extconf.rb6
-rw-r--r--ext/Win32API/getch.rb5
-rw-r--r--ext/Win32API/lib/win32/registry.rb831
-rw-r--r--ext/Win32API/lib/win32/resolv.rb366
-rw-r--r--ext/Win32API/point.rb18
-rw-r--r--ext/bigdecimal/.cvsignore1
-rw-r--r--ext/bigdecimal/bigdecimal.c300
-rw-r--r--ext/bigdecimal/bigdecimal.h8
-rw-r--r--ext/bigdecimal/lib/bigdecimal/jacobian.rb2
-rw-r--r--ext/bigdecimal/lib/bigdecimal/ludcmp.rb2
-rw-r--r--ext/bigdecimal/lib/bigdecimal/math.rb8
-rw-r--r--ext/bigdecimal/lib/bigdecimal/newton.rb4
-rw-r--r--ext/bigdecimal/lib/bigdecimal/util.rb12
-rw-r--r--ext/continuation/continuation.c8
-rw-r--r--ext/continuation/extconf.rb3
-rw-r--r--ext/coverage/coverage.c101
-rw-r--r--ext/coverage/extconf.rb2
-rw-r--r--ext/curses/.cvsignore1
-rw-r--r--ext/curses/curses.c855
-rw-r--r--ext/curses/extconf.rb13
-rw-r--r--ext/curses/view.rb10
-rw-r--r--ext/dbm/.cvsignore1
-rw-r--r--ext/dbm/dbm.c282
-rw-r--r--ext/dbm/extconf.rb2
-rw-r--r--ext/digest/.cvsignore1
-rw-r--r--ext/digest/bubblebabble/.cvsignore1
-rw-r--r--ext/digest/defs.h14
-rw-r--r--ext/digest/digest.c6
-rw-r--r--ext/digest/extconf.rb2
-rw-r--r--ext/digest/lib/digest.rb2
-rw-r--r--ext/digest/lib/digest/hmac.rb274
-rw-r--r--ext/digest/lib/md5.rb23
-rw-r--r--ext/digest/lib/sha1.rb23
-rw-r--r--ext/digest/md5/.cvsignore1
-rw-r--r--ext/digest/md5/md5.c2
-rw-r--r--ext/digest/md5/md5init.c4
-rw-r--r--ext/digest/rmd160/.cvsignore1
-rw-r--r--ext/digest/rmd160/rmd160init.c4
-rw-r--r--ext/digest/sha1/.cvsignore1
-rw-r--r--ext/digest/sha1/sha1init.c4
-rw-r--r--ext/digest/sha2/.cvsignore1
-rw-r--r--ext/digest/sha2/sha2init.c4
-rw-r--r--ext/dl/.cvsignore2
-rw-r--r--ext/dl/callback/depend15
-rw-r--r--ext/dl/callback/extconf.rb14
-rw-r--r--ext/dl/callback/mkcallback.rb238
-rw-r--r--ext/dl/cfunc.c532
-rw-r--r--ext/dl/cptr.c491
-rw-r--r--ext/dl/depend47
-rw-r--r--ext/dl/dl.c804
-rw-r--r--ext/dl/dl.def59
-rw-r--r--ext/dl/dl.h397
-rw-r--r--ext/dl/doc/dl.txt266
-rw-r--r--ext/dl/extconf.rb198
-rw-r--r--ext/dl/h2rb500
-rw-r--r--ext/dl/handle.c357
-rw-r--r--ext/dl/install.rb49
-rw-r--r--ext/dl/lib/dl/callback.rb69
-rw-r--r--ext/dl/lib/dl/cparser.rb109
-rw-r--r--ext/dl/lib/dl/func.rb151
-rw-r--r--ext/dl/lib/dl/import.rb422
-rw-r--r--ext/dl/lib/dl/pack.rb128
-rw-r--r--ext/dl/lib/dl/stack.rb116
-rw-r--r--ext/dl/lib/dl/struct.rb346
-rw-r--r--ext/dl/lib/dl/types.rb273
-rw-r--r--ext/dl/lib/dl/value.rb112
-rw-r--r--ext/dl/lib/dl/win32.rb25
-rw-r--r--ext/dl/mkcall.rb62
-rw-r--r--ext/dl/mkcallback.rb56
-rw-r--r--ext/dl/mkcbtable.rb18
-rw-r--r--ext/dl/ptr.c1058
-rw-r--r--ext/dl/sample/c++sample.C35
-rw-r--r--ext/dl/sample/c++sample.rb60
-rw-r--r--ext/dl/sample/drives.rb70
-rw-r--r--ext/dl/sample/getch.rb5
-rw-r--r--ext/dl/sample/libc.rb69
-rw-r--r--ext/dl/sample/msgbox.rb19
-rw-r--r--ext/dl/sample/msgbox2.rb18
-rw-r--r--ext/dl/sample/stream.rb87
-rw-r--r--ext/dl/sym.c993
-rw-r--r--ext/dl/test/libtest.def28
-rw-r--r--ext/dl/test/test.c247
-rw-r--r--ext/dl/test/test.rb306
-rw-r--r--ext/dl/type.rb115
-rw-r--r--ext/dl/win32/extconf.rb3
-rw-r--r--ext/dl/win32/lib/Win32API.rb30
-rw-r--r--ext/dl/win32/lib/win32/registry.rb839
-rw-r--r--ext/dl/win32/lib/win32/resolv.rb379
-rw-r--r--ext/dl/win32/lib/win32/sspi.rb330
-rw-r--r--ext/etc/etc.c210
-rw-r--r--ext/etc/extconf.rb15
-rw-r--r--ext/extmk.rb151
-rw-r--r--ext/fcntl/.cvsignore1
-rw-r--r--ext/fiber/extconf.rb3
-rw-r--r--ext/fiber/fiber.c8
-rw-r--r--ext/gdbm/.cvsignore1
-rw-r--r--ext/gdbm/gdbm.c399
-rw-r--r--ext/iconv/.cvsignore1
-rw-r--r--ext/iconv/charset_alias.rb4
-rw-r--r--ext/iconv/depend2
-rw-r--r--ext/iconv/extconf.rb2
-rw-r--r--ext/iconv/iconv.c774
-rw-r--r--ext/iconv/mkwrapper.rb53
-rw-r--r--ext/io/nonblock/extconf.rb8
-rw-r--r--ext/io/nonblock/nonblock.c108
-rw-r--r--ext/io/wait/.cvsignore1
-rw-r--r--ext/io/wait/extconf.rb5
-rw-r--r--ext/io/wait/lib/nonblock.rb23
-rw-r--r--ext/io/wait/wait.c134
-rw-r--r--ext/json/ext/generator/extconf.rb9
-rw-r--r--ext/json/ext/generator/generator.c919
-rw-r--r--ext/json/ext/generator/unicode.c182
-rw-r--r--ext/json/ext/generator/unicode.h53
-rw-r--r--ext/json/ext/parser/extconf.rb9
-rw-r--r--ext/json/ext/parser/parser.c1805
-rw-r--r--ext/json/ext/parser/parser.rl662
-rw-r--r--ext/json/ext/parser/unicode.c154
-rw-r--r--ext/json/ext/parser/unicode.h58
-rw-r--r--ext/json/extconf.rb3
-rwxr-xr-xext/json/lib/json.rb297
-rw-r--r--ext/json/lib/json/Array.xpm21
-rw-r--r--ext/json/lib/json/FalseClass.xpm21
-rw-r--r--ext/json/lib/json/Hash.xpm21
-rw-r--r--ext/json/lib/json/Key.xpm73
-rw-r--r--ext/json/lib/json/NilClass.xpm21
-rw-r--r--ext/json/lib/json/Numeric.xpm28
-rw-r--r--ext/json/lib/json/String.xpm96
-rw-r--r--ext/json/lib/json/TrueClass.xpm21
-rw-r--r--ext/json/lib/json/add/core.rb135
-rw-r--r--ext/json/lib/json/add/rails.rb58
-rwxr-xr-xext/json/lib/json/common.rb354
-rwxr-xr-xext/json/lib/json/editor.rb1371
-rw-r--r--ext/json/lib/json/ext.rb15
-rw-r--r--ext/json/lib/json/json.xpm1499
-rw-r--r--ext/json/lib/json/version.rb9
-rw-r--r--ext/mathn/complex/complex.c7
-rw-r--r--ext/mathn/complex/extconf.rb3
-rw-r--r--ext/mathn/rational/extconf.rb3
-rw-r--r--ext/mathn/rational/rational.c7
-rw-r--r--ext/nkf/.cvsignore1
-rw-r--r--ext/nkf/lib/kconv.rb275
-rw-r--r--ext/nkf/nkf-utf8/config.h77
-rw-r--r--ext/nkf/nkf-utf8/nkf.c9473
-rw-r--r--ext/nkf/nkf-utf8/nkf.h192
-rw-r--r--ext/nkf/nkf-utf8/utf8tbl.c1472
-rw-r--r--ext/nkf/nkf-utf8/utf8tbl.h27
-rw-r--r--ext/nkf/nkf.c394
-rw-r--r--ext/objspace/extconf.rb2
-rw-r--r--ext/objspace/objspace.c552
-rw-r--r--ext/openssl/extconf.rb5
-rw-r--r--ext/openssl/lib/net/ftptls.rb53
-rw-r--r--ext/openssl/lib/net/telnets.rb251
-rw-r--r--ext/openssl/lib/openssl.rb5
-rw-r--r--ext/openssl/lib/openssl/buffering.rb110
-rw-r--r--ext/openssl/lib/openssl/pkcs7.rb25
-rw-r--r--ext/openssl/lib/openssl/ssl-internal.rb177
-rw-r--r--ext/openssl/lib/openssl/ssl.rb180
-rw-r--r--ext/openssl/lib/openssl/x509-internal.rb153
-rw-r--r--ext/openssl/lib/openssl/x509.rb155
-rw-r--r--ext/openssl/openssl_missing.h27
-rw-r--r--ext/openssl/ossl.c40
-rw-r--r--ext/openssl/ossl.h15
-rw-r--r--ext/openssl/ossl_asn1.c82
-rw-r--r--ext/openssl/ossl_bn.c74
-rw-r--r--ext/openssl/ossl_cipher.c61
-rw-r--r--ext/openssl/ossl_config.c27
-rw-r--r--ext/openssl/ossl_digest.c6
-rw-r--r--ext/openssl/ossl_engine.c16
-rw-r--r--ext/openssl/ossl_hmac.c32
-rw-r--r--ext/openssl/ossl_ns_spki.c8
-rw-r--r--ext/openssl/ossl_ocsp.c26
-rw-r--r--ext/openssl/ossl_pkcs12.c8
-rw-r--r--ext/openssl/ossl_pkcs5.c16
-rw-r--r--ext/openssl/ossl_pkcs7.c12
-rw-r--r--ext/openssl/ossl_pkey.c8
-rw-r--r--ext/openssl/ossl_pkey_dh.c14
-rw-r--r--ext/openssl/ossl_pkey_dsa.c29
-rw-r--r--ext/openssl/ossl_pkey_ec.c31
-rw-r--r--ext/openssl/ossl_pkey_rsa.c44
-rw-r--r--ext/openssl/ossl_rand.c4
-rw-r--r--ext/openssl/ossl_ssl.c278
-rw-r--r--ext/openssl/ossl_ssl_session.c10
-rw-r--r--ext/openssl/ossl_version.h2
-rw-r--r--ext/openssl/ossl_x509attr.c17
-rw-r--r--ext/openssl/ossl_x509cert.c14
-rw-r--r--ext/openssl/ossl_x509crl.c10
-rw-r--r--ext/openssl/ossl_x509ext.c25
-rw-r--r--ext/openssl/ossl_x509name.c15
-rw-r--r--ext/openssl/ossl_x509req.c12
-rw-r--r--ext/openssl/ossl_x509store.c1
-rw-r--r--ext/pty/.cvsignore1
-rw-r--r--ext/pty/depend2
-rw-r--r--ext/pty/expect_sample.rb8
-rw-r--r--ext/pty/extconf.rb6
-rw-r--r--ext/pty/pty.c566
-rw-r--r--ext/pty/script.rb2
-rw-r--r--ext/purelib.rb9
-rw-r--r--ext/racc/cparse/.cvsignore1
-rw-r--r--ext/racc/cparse/README10
-rw-r--r--ext/racc/cparse/cparse.c70
-rw-r--r--ext/racc/cparse/extconf.rb1
-rw-r--r--ext/readline/.cvsignore1
-rw-r--r--ext/readline/README68
-rw-r--r--ext/readline/README.ja444
-rw-r--r--ext/readline/extconf.rb35
-rw-r--r--ext/readline/readline.c1128
-rw-r--r--ext/ripper/.cvsignore8
-rw-r--r--ext/ripper/README30
-rw-r--r--ext/ripper/depend41
-rw-r--r--ext/ripper/eventids2.c278
-rw-r--r--ext/ripper/extconf.rb22
-rw-r--r--ext/ripper/lib/ripper.rb4
-rw-r--r--ext/ripper/lib/ripper/core.rb70
-rw-r--r--ext/ripper/lib/ripper/filter.rb70
-rw-r--r--ext/ripper/lib/ripper/lexer.rb179
-rw-r--r--ext/ripper/lib/ripper/sexp.rb99
-rwxr-xr-xext/ripper/tools/generate-param-macros.rb14
-rwxr-xr-xext/ripper/tools/generate.rb152
-rwxr-xr-xext/ripper/tools/preproc.rb91
-rwxr-xr-xext/ripper/tools/strip.rb12
-rw-r--r--ext/sdbm/.cvsignore1
-rw-r--r--ext/sdbm/_sdbm.c106
-rw-r--r--ext/sdbm/init.c357
-rw-r--r--ext/sdbm/sdbm.h2
-rw-r--r--ext/socket/.cvsignore2
-rw-r--r--ext/socket/addrinfo.h8
-rw-r--r--ext/socket/ancdata.c1808
-rw-r--r--ext/socket/basicsocket.c723
-rw-r--r--ext/socket/constants.c146
-rw-r--r--ext/socket/depend28
-rw-r--r--ext/socket/extconf.rb87
-rw-r--r--ext/socket/getaddrinfo.c50
-rw-r--r--ext/socket/getnameinfo.c26
-rw-r--r--ext/socket/init.c558
-rw-r--r--ext/socket/ipsocket.c248
-rw-r--r--ext/socket/lib/socket.rb729
-rw-r--r--ext/socket/mkconstants.rb683
-rw-r--r--ext/socket/option.c688
-rw-r--r--ext/socket/raddrinfo.c2171
-rw-r--r--ext/socket/rubysocket.h278
-rw-r--r--ext/socket/socket.c4340
-rw-r--r--ext/socket/sockport.h18
-rw-r--r--ext/socket/sockssocket.c56
-rw-r--r--ext/socket/tcpserver.c142
-rw-r--r--ext/socket/tcpsocket.c67
-rw-r--r--ext/socket/udpsocket.c260
-rw-r--r--ext/socket/unixserver.c151
-rw-r--r--ext/socket/unixsocket.c505
-rw-r--r--ext/stringio/.cvsignore1
-rw-r--r--ext/stringio/README1
-rw-r--r--ext/stringio/depend5
-rw-r--r--ext/stringio/stringio.c691
-rw-r--r--ext/strscan/.cvsignore1
-rw-r--r--ext/strscan/depend3
-rw-r--r--ext/strscan/strscan.c162
-rw-r--r--ext/syck/.cvsignore1
-rw-r--r--ext/syck/bytecode.c7
-rw-r--r--ext/syck/emitter.c81
-rw-r--r--ext/syck/handler.c17
-rw-r--r--ext/syck/implicit.c18
-rw-r--r--ext/syck/node.c15
-rw-r--r--ext/syck/rubyext.c357
-rw-r--r--ext/syck/syck.c44
-rw-r--r--ext/syck/syck.h70
-rw-r--r--ext/syck/token.c7
-rw-r--r--ext/syck/yaml2byte.c18
-rw-r--r--ext/syslog/.cvsignore1
-rw-r--r--ext/syslog/syslog.c16
-rw-r--r--ext/syslog/test.rb164
-rw-r--r--ext/thread/extconf.rb9
-rw-r--r--ext/thread/lib/thread.rb5
-rw-r--r--ext/thread/thread.c1182
-rw-r--r--ext/tk/.cvsignore2
-rw-r--r--ext/tk/ChangeLog.tkextlib25
-rw-r--r--ext/tk/MANUAL_tcltklib.eng8
-rw-r--r--ext/tk/MANUAL_tcltklib.eucj9
-rw-r--r--ext/tk/README.ActiveTcl13
-rw-r--r--ext/tk/README.tcltklib43
-rw-r--r--ext/tk/config_list.in36
-rw-r--r--ext/tk/depend4
-rw-r--r--ext/tk/extconf.rb1155
-rw-r--r--ext/tk/lib/multi-tk.rb638
-rw-r--r--ext/tk/lib/remote-tk.rb34
-rw-r--r--ext/tk/lib/tcltk.rb20
-rw-r--r--ext/tk/lib/tk.rb681
-rw-r--r--ext/tk/lib/tk/autoload.rb492
-rw-r--r--ext/tk/lib/tk/bindtag.rb2
-rw-r--r--ext/tk/lib/tk/busy.rb118
-rw-r--r--ext/tk/lib/tk/button.rb5
-rw-r--r--ext/tk/lib/tk/canvas.rb75
-rw-r--r--ext/tk/lib/tk/canvastag.rb33
-rw-r--r--ext/tk/lib/tk/checkbutton.rb8
-rw-r--r--ext/tk/lib/tk/composite.rb48
-rw-r--r--ext/tk/lib/tk/console.rb6
-rw-r--r--ext/tk/lib/tk/dialog.rb30
-rw-r--r--ext/tk/lib/tk/encodedstr.rb6
-rw-r--r--ext/tk/lib/tk/entry.rb5
-rw-r--r--ext/tk/lib/tk/event.rb222
-rw-r--r--ext/tk/lib/tk/font.rb139
-rw-r--r--ext/tk/lib/tk/fontchooser.rb166
-rw-r--r--ext/tk/lib/tk/frame.rb5
-rw-r--r--ext/tk/lib/tk/grid.rb34
-rw-r--r--ext/tk/lib/tk/image.rb6
-rw-r--r--ext/tk/lib/tk/itemconfig.rb151
-rw-r--r--ext/tk/lib/tk/itemfont.rb36
-rw-r--r--ext/tk/lib/tk/kinput.rb6
-rw-r--r--ext/tk/lib/tk/label.rb5
-rw-r--r--ext/tk/lib/tk/labelframe.rb6
-rw-r--r--ext/tk/lib/tk/listbox.rb38
-rw-r--r--ext/tk/lib/tk/macpkg.rb4
-rw-r--r--ext/tk/lib/tk/menu.rb117
-rw-r--r--ext/tk/lib/tk/menubar.rb44
-rw-r--r--ext/tk/lib/tk/menuspec.rb235
-rw-r--r--ext/tk/lib/tk/message.rb6
-rw-r--r--ext/tk/lib/tk/mngfocus.rb4
-rw-r--r--ext/tk/lib/tk/msgcat.rb58
-rw-r--r--ext/tk/lib/tk/namespace.rb28
-rw-r--r--ext/tk/lib/tk/optiondb.rb48
-rw-r--r--ext/tk/lib/tk/optionobj.rb18
-rw-r--r--ext/tk/lib/tk/palette.rb4
-rw-r--r--ext/tk/lib/tk/panedwindow.rb44
-rw-r--r--ext/tk/lib/tk/place.rb12
-rw-r--r--ext/tk/lib/tk/radiobutton.rb8
-rw-r--r--ext/tk/lib/tk/root.rb10
-rw-r--r--ext/tk/lib/tk/scale.rb13
-rw-r--r--ext/tk/lib/tk/scrollbar.rb22
-rw-r--r--ext/tk/lib/tk/selection.rb6
-rw-r--r--ext/tk/lib/tk/spinbox.rb45
-rw-r--r--ext/tk/lib/tk/text.rb168
-rw-r--r--ext/tk/lib/tk/textimage.rb10
-rw-r--r--ext/tk/lib/tk/textmark.rb12
-rw-r--r--ext/tk/lib/tk/texttag.rb27
-rw-r--r--ext/tk/lib/tk/textwindow.rb20
-rw-r--r--ext/tk/lib/tk/timer.rb40
-rw-r--r--ext/tk/lib/tk/toplevel.rb22
-rw-r--r--ext/tk/lib/tk/ttk_selector.rb94
-rw-r--r--ext/tk/lib/tk/validation.rb28
-rw-r--r--ext/tk/lib/tk/variable.rb140
-rw-r--r--ext/tk/lib/tk/virtevent.rb10
-rw-r--r--ext/tk/lib/tk/winfo.rb10
-rw-r--r--ext/tk/lib/tk/winpkg.rb11
-rw-r--r--ext/tk/lib/tk/wm.rb10
-rw-r--r--ext/tk/lib/tk/xim.rb4
-rw-r--r--ext/tk/lib/tkextlib/ICONS/icons.rb8
-rw-r--r--ext/tk/lib/tkextlib/ICONS/setup.rb4
-rw-r--r--ext/tk/lib/tkextlib/SUPPORT_STATUS24
-rw-r--r--ext/tk/lib/tkextlib/blt.rb2
-rw-r--r--ext/tk/lib/tkextlib/blt/barchart.rb6
-rw-r--r--ext/tk/lib/tkextlib/blt/bitmap.rb2
-rw-r--r--ext/tk/lib/tkextlib/blt/busy.rb1
-rw-r--r--ext/tk/lib/tkextlib/blt/component.rb173
-rw-r--r--ext/tk/lib/tkextlib/blt/container.rb2
-rw-r--r--ext/tk/lib/tkextlib/blt/dragdrop.rb23
-rw-r--r--ext/tk/lib/tkextlib/blt/graph.rb4
-rw-r--r--ext/tk/lib/tkextlib/blt/htext.rb3
-rw-r--r--ext/tk/lib/tkextlib/blt/setup.rb4
-rw-r--r--ext/tk/lib/tkextlib/blt/stripchart.rb6
-rw-r--r--ext/tk/lib/tkextlib/blt/table.rb15
-rw-r--r--ext/tk/lib/tkextlib/blt/tabnotebook.rb93
-rw-r--r--ext/tk/lib/tkextlib/blt/tabset.rb110
-rw-r--r--ext/tk/lib/tkextlib/blt/ted.rb5
-rw-r--r--ext/tk/lib/tkextlib/blt/tile.rb4
-rw-r--r--ext/tk/lib/tkextlib/blt/tree.rb56
-rw-r--r--ext/tk/lib/tkextlib/blt/treeview.rb61
-rw-r--r--ext/tk/lib/tkextlib/blt/unix_dnd.rb8
-rw-r--r--ext/tk/lib/tkextlib/blt/vector.rb4
-rw-r--r--ext/tk/lib/tkextlib/blt/watch.rb2
-rw-r--r--ext/tk/lib/tkextlib/blt/winop.rb12
-rw-r--r--ext/tk/lib/tkextlib/bwidget.rb2
-rw-r--r--ext/tk/lib/tkextlib/bwidget/arrowbutton.rb2
-rw-r--r--ext/tk/lib/tkextlib/bwidget/button.rb2
-rw-r--r--ext/tk/lib/tkextlib/bwidget/buttonbox.rb2
-rw-r--r--ext/tk/lib/tkextlib/bwidget/combobox.rb13
-rw-r--r--ext/tk/lib/tkextlib/bwidget/dialog.rb18
-rw-r--r--ext/tk/lib/tkextlib/bwidget/entry.rb2
-rw-r--r--ext/tk/lib/tkextlib/bwidget/label.rb2
-rw-r--r--ext/tk/lib/tkextlib/bwidget/labelentry.rb2
-rw-r--r--ext/tk/lib/tkextlib/bwidget/labelframe.rb2
-rw-r--r--ext/tk/lib/tkextlib/bwidget/listbox.rb27
-rw-r--r--ext/tk/lib/tkextlib/bwidget/mainframe.rb6
-rw-r--r--ext/tk/lib/tkextlib/bwidget/messagedlg.rb4
-rw-r--r--ext/tk/lib/tkextlib/bwidget/notebook.rb8
-rw-r--r--ext/tk/lib/tkextlib/bwidget/pagesmanager.rb2
-rw-r--r--ext/tk/lib/tkextlib/bwidget/panedwindow.rb7
-rw-r--r--ext/tk/lib/tkextlib/bwidget/panelframe.rb14
-rw-r--r--ext/tk/lib/tkextlib/bwidget/passwddlg.rb8
-rw-r--r--ext/tk/lib/tkextlib/bwidget/progressbar.rb2
-rw-r--r--ext/tk/lib/tkextlib/bwidget/progressdlg.rb2
-rw-r--r--ext/tk/lib/tkextlib/bwidget/scrollableframe.rb2
-rw-r--r--ext/tk/lib/tkextlib/bwidget/scrolledwindow.rb12
-rw-r--r--ext/tk/lib/tkextlib/bwidget/scrollview.rb2
-rw-r--r--ext/tk/lib/tkextlib/bwidget/selectcolor.rb6
-rw-r--r--ext/tk/lib/tkextlib/bwidget/selectfont.rb9
-rw-r--r--ext/tk/lib/tkextlib/bwidget/separator.rb2
-rw-r--r--ext/tk/lib/tkextlib/bwidget/setup.rb4
-rw-r--r--ext/tk/lib/tkextlib/bwidget/spinbox.rb2
-rw-r--r--ext/tk/lib/tkextlib/bwidget/statusbar.rb18
-rw-r--r--ext/tk/lib/tkextlib/bwidget/titleframe.rb2
-rw-r--r--ext/tk/lib/tkextlib/bwidget/tree.rb81
-rw-r--r--ext/tk/lib/tkextlib/itcl/incr_tcl.rb4
-rw-r--r--ext/tk/lib/tkextlib/itcl/setup.rb4
-rw-r--r--ext/tk/lib/tkextlib/itk/incr_tk.rb10
-rw-r--r--ext/tk/lib/tkextlib/itk/setup.rb4
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/buttonbox.rb5
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/calendar.rb4
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/canvasprintbox.rb2
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/canvasprintdialog.rb2
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/checkbox.rb5
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/combobox.rb2
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/dateentry.rb2
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/datefield.rb2
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/dialog.rb2
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/dialogshell.rb5
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/disjointlistbox.rb2
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/entryfield.rb18
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/extbutton.rb2
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/extfileselectionbox.rb4
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/extfileselectiondialog.rb2
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/feedback.rb2
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/fileselectionbox.rb4
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/fileselectiondialog.rb2
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/finddialog.rb4
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/hierarchy.rb22
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/hyperhelp.rb2
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/labeledframe.rb2
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/labeledwidget.rb2
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/mainwindow.rb2
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/menubar.rb5
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/messagebox.rb5
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/messagedialog.rb2
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/notebook.rb5
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/optionmenu.rb2
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/panedwindow.rb5
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/promptdialog.rb2
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/pushbutton.rb2
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/radiobox.rb5
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/scopedobject.rb2
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/scrolledcanvas.rb12
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/scrolledframe.rb2
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/scrolledhtml.rb2
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/scrolledlistbox.rb4
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/scrolledtext.rb64
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/scrolledwidget.rb2
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/selectionbox.rb2
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/selectiondialog.rb2
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/setup.rb4
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/shell.rb2
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/spindate.rb2
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/spinint.rb2
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/spinner.rb18
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/spintime.rb2
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/tabnotebook.rb5
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/tabset.rb17
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/timeentry.rb2
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/timefield.rb2
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/toolbar.rb4
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/watch.rb4
-rwxr-xr-xext/tk/lib/tkextlib/pkg_checker.rb4
-rw-r--r--ext/tk/lib/tkextlib/setup.rb8
-rw-r--r--ext/tk/lib/tkextlib/tcllib.rb29
-rw-r--r--ext/tk/lib/tkextlib/tcllib/autoscroll.rb24
-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.rb12
-rw-r--r--ext/tk/lib/tkextlib/tcllib/cursor.rb14
-rw-r--r--ext/tk/lib/tkextlib/tcllib/dateentry.rb62
-rw-r--r--ext/tk/lib/tkextlib/tcllib/datefield.rb12
-rw-r--r--ext/tk/lib/tkextlib/tcllib/diagrams.rb224
-rw-r--r--ext/tk/lib/tkextlib/tcllib/dialog.rb2
-rw-r--r--ext/tk/lib/tkextlib/tcllib/getstring.rb4
-rw-r--r--ext/tk/lib/tkextlib/tcllib/ico.rb46
-rw-r--r--ext/tk/lib/tkextlib/tcllib/ip_entry.rb15
-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.rb10
-rw-r--r--ext/tk/lib/tkextlib/tcllib/plotchart.rb708
-rw-r--r--ext/tk/lib/tkextlib/tcllib/ruler.rb2
-rw-r--r--ext/tk/lib/tkextlib/tcllib/screenruler.rb2
-rw-r--r--ext/tk/lib/tkextlib/tcllib/scrolledwindow.rb57
-rw-r--r--ext/tk/lib/tkextlib/tcllib/scrollwin.rb2
-rw-r--r--ext/tk/lib/tkextlib/tcllib/setup.rb4
-rw-r--r--ext/tk/lib/tkextlib/tcllib/statusbar.rb79
-rw-r--r--ext/tk/lib/tkextlib/tcllib/superframe.rb2
-rw-r--r--ext/tk/lib/tkextlib/tcllib/swaplist.rb10
-rw-r--r--ext/tk/lib/tkextlib/tcllib/tablelist.rb7
-rw-r--r--ext/tk/lib/tkextlib/tcllib/tablelist_core.rb328
-rw-r--r--ext/tk/lib/tkextlib/tcllib/tablelist_tile.rb20
-rw-r--r--ext/tk/lib/tkextlib/tcllib/tkpiechart.rb22
-rw-r--r--ext/tk/lib/tkextlib/tcllib/toolbar.rb175
-rw-r--r--ext/tk/lib/tkextlib/tcllib/tooltip.rb13
-rw-r--r--ext/tk/lib/tkextlib/tcllib/widget.rb34
-rw-r--r--ext/tk/lib/tkextlib/tclx/setup.rb4
-rw-r--r--ext/tk/lib/tkextlib/tile.rb76
-rw-r--r--ext/tk/lib/tkextlib/tile/dialog.rb6
-rw-r--r--ext/tk/lib/tkextlib/tile/setup.rb4
-rw-r--r--ext/tk/lib/tkextlib/tile/sizegrip.rb11
-rw-r--r--ext/tk/lib/tkextlib/tile/style.rb46
-rw-r--r--ext/tk/lib/tkextlib/tile/tbutton.rb9
-rw-r--r--ext/tk/lib/tkextlib/tile/tcheckbutton.rb12
-rw-r--r--ext/tk/lib/tkextlib/tile/tcombobox.rb9
-rw-r--r--ext/tk/lib/tkextlib/tile/tentry.rb9
-rw-r--r--ext/tk/lib/tkextlib/tile/tframe.rb9
-rw-r--r--ext/tk/lib/tkextlib/tile/tlabel.rb9
-rw-r--r--ext/tk/lib/tkextlib/tile/tlabelframe.rb12
-rw-r--r--ext/tk/lib/tkextlib/tile/tmenubutton.rb12
-rw-r--r--ext/tk/lib/tkextlib/tile/tnotebook.rb22
-rw-r--r--ext/tk/lib/tkextlib/tile/tpaned.rb46
-rw-r--r--ext/tk/lib/tkextlib/tile/tprogressbar.rb9
-rw-r--r--ext/tk/lib/tkextlib/tile/tradiobutton.rb12
-rw-r--r--ext/tk/lib/tkextlib/tile/treeview.rb110
-rw-r--r--ext/tk/lib/tkextlib/tile/tscale.rb13
-rw-r--r--ext/tk/lib/tkextlib/tile/tscrollbar.rb21
-rw-r--r--ext/tk/lib/tkextlib/tile/tseparator.rb9
-rw-r--r--ext/tk/lib/tkextlib/tile/tspinbox.rb107
-rw-r--r--ext/tk/lib/tkextlib/tile/tsquare.rb2
-rw-r--r--ext/tk/lib/tkextlib/tkDND/setup.rb4
-rw-r--r--ext/tk/lib/tkextlib/tkDND/tkdnd.rb52
-rw-r--r--ext/tk/lib/tkextlib/tkHTML/htmlwidget.rb8
-rw-r--r--ext/tk/lib/tkextlib/tkHTML/setup.rb4
-rw-r--r--ext/tk/lib/tkextlib/tkimg/setup.rb4
-rw-r--r--ext/tk/lib/tkextlib/tktable/setup.rb4
-rw-r--r--ext/tk/lib/tkextlib/tktable/tktable.rb125
-rw-r--r--ext/tk/lib/tkextlib/tktrans/setup.rb4
-rw-r--r--ext/tk/lib/tkextlib/treectrl/setup.rb4
-rw-r--r--ext/tk/lib/tkextlib/treectrl/tktreectrl.rb241
-rw-r--r--ext/tk/lib/tkextlib/trofs/setup.rb4
-rw-r--r--ext/tk/lib/tkextlib/version.rb2
-rw-r--r--ext/tk/lib/tkextlib/vu/bargraph.rb10
-rw-r--r--ext/tk/lib/tkextlib/vu/charts.rb2
-rw-r--r--ext/tk/lib/tkextlib/vu/dial.rb2
-rw-r--r--ext/tk/lib/tkextlib/vu/pie.rb8
-rw-r--r--ext/tk/lib/tkextlib/vu/setup.rb4
-rw-r--r--ext/tk/lib/tkextlib/vu/spinbox.rb2
-rw-r--r--ext/tk/lib/tkextlib/winico/setup.rb4
-rw-r--r--ext/tk/lib/tkextlib/winico/winico.rb32
-rw-r--r--ext/tk/old-extconf.rb440
-rw-r--r--ext/tk/sample/24hr_clock.rb130
-rw-r--r--ext/tk/sample/binding_sample.rb8
-rw-r--r--ext/tk/sample/bindtag_sample.rb38
-rw-r--r--ext/tk/sample/binstr_usage.rb2
-rw-r--r--ext/tk/sample/cd_timer.rb16
-rw-r--r--ext/tk/sample/cmd_res_test.rb2
-rw-r--r--ext/tk/sample/demos-en/anilabel.rb14
-rw-r--r--ext/tk/sample/demos-en/aniwave.rb10
-rw-r--r--ext/tk/sample/demos-en/arrow.rb66
-rw-r--r--ext/tk/sample/demos-en/bind.rb34
-rw-r--r--ext/tk/sample/demos-en/bitmap.rb8
-rw-r--r--ext/tk/sample/demos-en/button.rb10
-rw-r--r--ext/tk/sample/demos-en/check.rb10
-rw-r--r--ext/tk/sample/demos-en/check2.rb34
-rw-r--r--ext/tk/sample/demos-en/clrpick.rb8
-rw-r--r--ext/tk/sample/demos-en/colors.rb2
-rw-r--r--ext/tk/sample/demos-en/combo.rb40
-rw-r--r--ext/tk/sample/demos-en/cscroll.rb26
-rw-r--r--ext/tk/sample/demos-en/ctext.rb44
-rw-r--r--ext/tk/sample/demos-en/entry1.rb6
-rw-r--r--ext/tk/sample/demos-en/entry2.rb4
-rw-r--r--ext/tk/sample/demos-en/entry3.rb28
-rw-r--r--ext/tk/sample/demos-en/filebox.rb32
-rw-r--r--ext/tk/sample/demos-en/floor.rb550
-rw-r--r--ext/tk/sample/demos-en/floor2.rb550
-rw-r--r--ext/tk/sample/demos-en/form.rb6
-rw-r--r--ext/tk/sample/demos-en/goldberg.rb402
-rw-r--r--ext/tk/sample/demos-en/icon.rb4
-rw-r--r--ext/tk/sample/demos-en/image1.rb2
-rw-r--r--ext/tk/sample/demos-en/image2.rb6
-rw-r--r--ext/tk/sample/demos-en/image3.rb16
-rw-r--r--ext/tk/sample/demos-en/items.rb86
-rw-r--r--ext/tk/sample/demos-en/knightstour.rb32
-rw-r--r--ext/tk/sample/demos-en/label.rb16
-rw-r--r--ext/tk/sample/demos-en/labelframe.rb14
-rw-r--r--ext/tk/sample/demos-en/mclist.rb56
-rw-r--r--ext/tk/sample/demos-en/menu.rb48
-rw-r--r--ext/tk/sample/demos-en/menu84.rb60
-rw-r--r--ext/tk/sample/demos-en/menubu.rb4
-rw-r--r--ext/tk/sample/demos-en/msgbox.rb24
-rw-r--r--ext/tk/sample/demos-en/msgbox2.rb28
-rw-r--r--ext/tk/sample/demos-en/paned1.rb8
-rw-r--r--ext/tk/sample/demos-en/paned2.rb46
-rw-r--r--ext/tk/sample/demos-en/pendulum.rb32
-rw-r--r--ext/tk/sample/demos-en/plot.rb30
-rw-r--r--ext/tk/sample/demos-en/puzzle.rb6
-rw-r--r--ext/tk/sample/demos-en/radio.rb12
-rw-r--r--ext/tk/sample/demos-en/radio2.rb28
-rw-r--r--ext/tk/sample/demos-en/radio3.rb50
-rw-r--r--ext/tk/sample/demos-en/ruler.rb36
-rw-r--r--ext/tk/sample/demos-en/sayings.rb8
-rw-r--r--ext/tk/sample/demos-en/search.rb32
-rw-r--r--ext/tk/sample/demos-en/spin.rb16
-rw-r--r--ext/tk/sample/demos-en/states.rb22
-rw-r--r--ext/tk/sample/demos-en/style.rb38
-rw-r--r--ext/tk/sample/demos-en/text.rb6
-rw-r--r--ext/tk/sample/demos-en/textpeer.rb8
-rw-r--r--ext/tk/sample/demos-en/toolbar.rb34
-rw-r--r--ext/tk/sample/demos-en/tree.rb26
-rw-r--r--ext/tk/sample/demos-en/ttkbut.rb48
-rw-r--r--ext/tk/sample/demos-en/ttkmenu.rb18
-rw-r--r--ext/tk/sample/demos-en/ttknote.rb22
-rw-r--r--ext/tk/sample/demos-en/ttkpane.rb46
-rw-r--r--ext/tk/sample/demos-en/ttkprogress.rb22
-rw-r--r--ext/tk/sample/demos-en/twind.rb60
-rw-r--r--ext/tk/sample/demos-en/twind2.rb130
-rw-r--r--ext/tk/sample/demos-en/unicodeout.rb40
-rw-r--r--ext/tk/sample/demos-en/widget7
-rw-r--r--ext/tk/sample/demos-jp/anilabel.rb14
-rw-r--r--ext/tk/sample/demos-jp/aniwave.rb10
-rw-r--r--ext/tk/sample/demos-jp/arrow.rb62
-rw-r--r--ext/tk/sample/demos-jp/bind.rb26
-rw-r--r--ext/tk/sample/demos-jp/bitmap.rb6
-rw-r--r--ext/tk/sample/demos-jp/button.rb2
-rw-r--r--ext/tk/sample/demos-jp/check.rb4
-rw-r--r--ext/tk/sample/demos-jp/check2.rb34
-rw-r--r--ext/tk/sample/demos-jp/clrpick.rb6
-rw-r--r--ext/tk/sample/demos-jp/colors.rb2
-rw-r--r--ext/tk/sample/demos-jp/combo.rb40
-rw-r--r--ext/tk/sample/demos-jp/cscroll.rb24
-rw-r--r--ext/tk/sample/demos-jp/ctext.rb38
-rw-r--r--ext/tk/sample/demos-jp/entry1.rb2
-rw-r--r--ext/tk/sample/demos-jp/entry2.rb2
-rw-r--r--ext/tk/sample/demos-jp/entry3.rb36
-rw-r--r--ext/tk/sample/demos-jp/filebox.rb32
-rw-r--r--ext/tk/sample/demos-jp/floor.rb546
-rw-r--r--ext/tk/sample/demos-jp/floor2.rb546
-rw-r--r--ext/tk/sample/demos-jp/form.rb2
-rw-r--r--ext/tk/sample/demos-jp/goldberg.rb408
-rw-r--r--ext/tk/sample/demos-jp/icon.rb2
-rw-r--r--ext/tk/sample/demos-jp/image1.rb2
-rw-r--r--ext/tk/sample/demos-jp/image2.rb2
-rw-r--r--ext/tk/sample/demos-jp/image3.rb16
-rw-r--r--ext/tk/sample/demos-jp/items.rb80
-rw-r--r--ext/tk/sample/demos-jp/knightstour.rb32
-rw-r--r--ext/tk/sample/demos-jp/label.rb6
-rw-r--r--ext/tk/sample/demos-jp/labelframe.rb22
-rw-r--r--ext/tk/sample/demos-jp/mclist.rb56
-rw-r--r--ext/tk/sample/demos-jp/menu.rb48
-rw-r--r--ext/tk/sample/demos-jp/menu84.rb58
-rw-r--r--ext/tk/sample/demos-jp/menu8x.rb56
-rw-r--r--ext/tk/sample/demos-jp/menubu.rb4
-rw-r--r--ext/tk/sample/demos-jp/msgbox.rb24
-rw-r--r--ext/tk/sample/demos-jp/msgbox2.rb30
-rw-r--r--ext/tk/sample/demos-jp/paned1.rb8
-rw-r--r--ext/tk/sample/demos-jp/paned2.rb48
-rw-r--r--ext/tk/sample/demos-jp/pendulum.rb32
-rw-r--r--ext/tk/sample/demos-jp/plot.rb24
-rw-r--r--ext/tk/sample/demos-jp/puzzle.rb8
-rw-r--r--ext/tk/sample/demos-jp/radio.rb2
-rw-r--r--ext/tk/sample/demos-jp/radio2.rb28
-rw-r--r--ext/tk/sample/demos-jp/radio3.rb50
-rw-r--r--ext/tk/sample/demos-jp/ruler.rb32
-rw-r--r--ext/tk/sample/demos-jp/sayings.rb8
-rw-r--r--ext/tk/sample/demos-jp/search.rb34
-rw-r--r--ext/tk/sample/demos-jp/spin.rb18
-rw-r--r--ext/tk/sample/demos-jp/states.rb2
-rw-r--r--ext/tk/sample/demos-jp/style.rb38
-rw-r--r--ext/tk/sample/demos-jp/text.rb2
-rw-r--r--ext/tk/sample/demos-jp/textpeer.rb12
-rw-r--r--ext/tk/sample/demos-jp/toolbar.rb32
-rw-r--r--ext/tk/sample/demos-jp/tree.rb26
-rw-r--r--ext/tk/sample/demos-jp/ttkbut.rb48
-rw-r--r--ext/tk/sample/demos-jp/ttkmenu.rb18
-rw-r--r--ext/tk/sample/demos-jp/ttknote.rb22
-rw-r--r--ext/tk/sample/demos-jp/ttkpane.rb48
-rw-r--r--ext/tk/sample/demos-jp/ttkprogress.rb22
-rw-r--r--ext/tk/sample/demos-jp/twind.rb58
-rw-r--r--ext/tk/sample/demos-jp/twind2.rb108
-rw-r--r--ext/tk/sample/demos-jp/unicodeout.rb38
-rw-r--r--ext/tk/sample/demos-jp/widget31
-rw-r--r--ext/tk/sample/editable_listbox.rb135
-rw-r--r--ext/tk/sample/encstr_usage.rb4
-rw-r--r--ext/tk/sample/figmemo_sample.rb96
-rw-r--r--ext/tk/sample/irbtk.rb4
-rw-r--r--ext/tk/sample/irbtkw.rbw16
-rw-r--r--ext/tk/sample/menubar1.rb20
-rw-r--r--ext/tk/sample/menubar2.rb24
-rw-r--r--ext/tk/sample/menubar3.rb72
-rw-r--r--ext/tk/sample/msgs_rb/README2
-rw-r--r--ext/tk/sample/multi-ip_sample.rb7
-rw-r--r--ext/tk/sample/multi-ip_sample2.rb2
-rw-r--r--ext/tk/sample/optobj_sample.rb30
-rw-r--r--ext/tk/sample/propagate.rb2
-rw-r--r--ext/tk/sample/remote-ip_sample.rb10
-rw-r--r--ext/tk/sample/remote-ip_sample2.rb20
-rw-r--r--ext/tk/sample/safe-tk.rb57
-rw-r--r--ext/tk/sample/scrollframe.rb28
-rw-r--r--ext/tk/sample/tcltklib/sample1.rb2
-rw-r--r--ext/tk/sample/tcltklib/sample2.rb104
-rw-r--r--ext/tk/sample/tkalignbox.rb102
-rw-r--r--ext/tk/sample/tkballoonhelp.rb104
-rw-r--r--ext/tk/sample/tkbiff.rb6
-rw-r--r--ext/tk/sample/tkbrowse.rb2
-rw-r--r--ext/tk/sample/tkcombobox.rb133
-rw-r--r--ext/tk/sample/tkdialog.rb2
-rw-r--r--ext/tk/sample/tkextlib/ICONS/viewIcons.rb38
-rw-r--r--ext/tk/sample/tkextlib/blt/barchart5.rb22
-rw-r--r--ext/tk/sample/tkextlib/blt/calendar.rb54
-rw-r--r--ext/tk/sample/tkextlib/blt/graph6.rb4056
-rw-r--r--ext/tk/sample/tkextlib/blt/graph7.rb8
-rw-r--r--ext/tk/sample/tkextlib/blt/graph7a.rb10
-rw-r--r--ext/tk/sample/tkextlib/blt/graph7b.rb8
-rw-r--r--ext/tk/sample/tkextlib/blt/graph7c.rb8
-rw-r--r--ext/tk/sample/tkextlib/blt/pareto.rb34
-rw-r--r--ext/tk/sample/tkextlib/blt/plot1b.rb2
-rw-r--r--ext/tk/sample/tkextlib/blt/winop1.rb8
-rw-r--r--ext/tk/sample/tkextlib/blt/winop2.rb2
-rw-r--r--ext/tk/sample/tkextlib/bwidget/basic.rb96
-rw-r--r--ext/tk/sample/tkextlib/bwidget/demo.rb84
-rw-r--r--ext/tk/sample/tkextlib/bwidget/dnd.rb16
-rw-r--r--ext/tk/sample/tkextlib/bwidget/manager.rb28
-rw-r--r--ext/tk/sample/tkextlib/bwidget/select.rb56
-rw-r--r--ext/tk/sample/tkextlib/bwidget/tmpldlg.rb162
-rw-r--r--ext/tk/sample/tkextlib/bwidget/tree.rb96
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/calendar.rb8
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/combobox.rb8
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/dialogshell.rb2
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/disjointlistbox.rb2
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/entryfield-1.rb12
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/entryfield-2.rb16
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/entryfield-3.rb10
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/extbutton.rb12
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/extfileselectionbox.rb2
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/fileselectionbox.rb2
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/hierarchy.rb16
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/labeledwidget.rb4
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/mainwindow.rb36
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/menubar.rb66
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/menubar2.rb12
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/messagebox1.rb6
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/messagebox2.rb6
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/messagedialog.rb8
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/notebook.rb2
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/notebook2.rb2
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/optionmenu.rb2
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/panedwindow.rb2
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/panedwindow2.rb2
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/promptdialog.rb2
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/pushbutton.rb4
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/scrolledframe.rb2
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/scrolledhtml.rb2
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/scrolledlistbox.rb6
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/scrolledtext.rb2
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/selectionbox.rb4
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/selectiondialog.rb2
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/shell.rb8
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/spinint.rb2
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/spinner.rb8
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/tabnotebook.rb2
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/tabnotebook2.rb2
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/toolbar.rb32
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/watch.rb2
-rw-r--r--ext/tk/sample/tkextlib/tcllib/datefield.rb4
-rw-r--r--ext/tk/sample/tkextlib/tcllib/plotdemos1.rb22
-rw-r--r--ext/tk/sample/tkextlib/tcllib/plotdemos2.rb8
-rw-r--r--ext/tk/sample/tkextlib/tcllib/plotdemos3.rb20
-rw-r--r--ext/tk/sample/tkextlib/tcllib/xyplot.rb2
-rw-r--r--ext/tk/sample/tkextlib/tile/demo.rb174
-rw-r--r--ext/tk/sample/tkextlib/tile/themes/kroc.rb108
-rw-r--r--ext/tk/sample/tkextlib/tkHTML/hv.rb48
-rw-r--r--ext/tk/sample/tkextlib/tkHTML/ss.rb82
-rw-r--r--ext/tk/sample/tkextlib/tkimg/demo.rb10
-rw-r--r--ext/tk/sample/tkextlib/tktable/basic.rb14
-rw-r--r--ext/tk/sample/tkextlib/tktable/buttons.rb12
-rw-r--r--ext/tk/sample/tkextlib/tktable/command.rb22
-rw-r--r--ext/tk/sample/tkextlib/tktable/debug.rb16
-rw-r--r--ext/tk/sample/tkextlib/tktable/dynarows.rb14
-rw-r--r--ext/tk/sample/tkextlib/tktable/maxsize.rb14
-rw-r--r--ext/tk/sample/tkextlib/tktable/spreadsheet.rb16
-rwxr-xr-x[-rw-r--r--]ext/tk/sample/tkextlib/tktable/tcllogo.gifbin2341 -> 2341 bytes-rw-r--r--ext/tk/sample/tkextlib/tktable/valid.rb12
-rw-r--r--ext/tk/sample/tkextlib/treectrl/bitmaps.rb32
-rw-r--r--ext/tk/sample/tkextlib/treectrl/demo.rb342
-rw-r--r--ext/tk/sample/tkextlib/treectrl/explorer.rb126
-rw-r--r--ext/tk/sample/tkextlib/treectrl/help.rb106
-rw-r--r--ext/tk/sample/tkextlib/treectrl/imovie.rb30
-rw-r--r--ext/tk/sample/tkextlib/treectrl/layout.rb26
-rw-r--r--ext/tk/sample/tkextlib/treectrl/mailwasher.rb100
-rw-r--r--ext/tk/sample/tkextlib/treectrl/outlook-folders.rb52
-rw-r--r--ext/tk/sample/tkextlib/treectrl/outlook-newgroup.rb102
-rw-r--r--ext/tk/sample/tkextlib/treectrl/random.rb68
-rw-r--r--ext/tk/sample/tkextlib/treectrl/www-options.rb72
-rw-r--r--ext/tk/sample/tkextlib/vu/canvItems.rb68
-rw-r--r--ext/tk/sample/tkextlib/vu/canvSticker.rb4
-rw-r--r--ext/tk/sample/tkextlib/vu/canvSticker2.rb4
-rw-r--r--ext/tk/sample/tkextlib/vu/dial_demo.rb62
-rw-r--r--ext/tk/sample/tkextlib/vu/oscilloscope.rb16
-rw-r--r--ext/tk/sample/tkextlib/vu/pie.rb10
-rw-r--r--ext/tk/sample/tkextlib/vu/vu_demo.rb14
-rw-r--r--ext/tk/sample/tkfrom.rb2
-rw-r--r--ext/tk/sample/tkhello.rb2
-rw-r--r--ext/tk/sample/tkmenubutton.rb56
-rw-r--r--ext/tk/sample/tkmsgcat-load_rb.rb16
-rw-r--r--ext/tk/sample/tkmsgcat-load_rb2.rb16
-rw-r--r--ext/tk/sample/tkmsgcat-load_tk.rb22
-rw-r--r--ext/tk/sample/tkmulticolumnlist.rb114
-rw-r--r--ext/tk/sample/tkmultilistbox.rb96
-rw-r--r--ext/tk/sample/tkmultilistframe.rb168
-rw-r--r--ext/tk/sample/tkoptdb-safeTk.rb28
-rw-r--r--ext/tk/sample/tkoptdb.rb32
-rw-r--r--ext/tk/sample/tkrttimer.rb12
-rw-r--r--ext/tk/sample/tktextframe.rb267
-rw-r--r--ext/tk/sample/tktextio.rb56
-rw-r--r--ext/tk/sample/tktimer2.rb8
-rw-r--r--ext/tk/sample/tktimer3.rb8
-rw-r--r--ext/tk/sample/tktree.rb26
-rw-r--r--ext/tk/sample/ttk_wrapper.rb12
-rw-r--r--ext/tk/stubs.c24
-rw-r--r--ext/tk/tcltklib.c1046
-rw-r--r--ext/tk/tkutil/extconf.rb5
-rw-r--r--ext/tk/tkutil/tkutil.c106
-rw-r--r--ext/win32ole/doc/win32ole.rd294
-rw-r--r--ext/win32ole/extconf.rb9
-rw-r--r--ext/win32ole/sample/excel1.rb15
-rw-r--r--ext/win32ole/sample/excel2.rb10
-rw-r--r--ext/win32ole/sample/ieconst.rb2
-rw-r--r--ext/win32ole/sample/ienavi.rb2
-rw-r--r--ext/win32ole/sample/ienavi2.rb40
-rw-r--r--ext/win32ole/sample/oledirs.rb2
-rw-r--r--ext/win32ole/sample/olegen.rb25
-rw-r--r--ext/win32ole/sample/xml.rb36
-rw-r--r--ext/win32ole/tests/oleserver.rb10
-rw-r--r--ext/win32ole/tests/testNIL2VTEMPTY.rb28
-rw-r--r--ext/win32ole/tests/testOLEMETHOD.rb92
-rw-r--r--ext/win32ole/tests/testOLEPARAM.rb65
-rw-r--r--ext/win32ole/tests/testOLETYPE.rb96
-rw-r--r--ext/win32ole/tests/testOLEVARIABLE.rb49
-rw-r--r--ext/win32ole/tests/testVARIANT.rb32
-rw-r--r--ext/win32ole/tests/testWIN32OLE.rb373
-rw-r--r--ext/win32ole/tests/test_ole_methods.rb36
-rw-r--r--ext/win32ole/tests/test_propertyputref.rb19
-rw-r--r--ext/win32ole/tests/test_win32ole_event.rb133
-rw-r--r--ext/win32ole/tests/test_word.rb37
-rw-r--r--ext/win32ole/tests/testall.rb16
-rw-r--r--ext/win32ole/win32ole.c5194
-rw-r--r--ext/zlib/.cvsignore1
-rw-r--r--ext/zlib/doc/zlib.rd6
-rw-r--r--ext/zlib/zlib.c1371
-rw-r--r--file.c2484
-rw-r--r--gc.c3067
-rw-r--r--gc.h75
-rw-r--r--gem_prelude.rb402
-rw-r--r--golf_prelude.rb114
-rw-r--r--goruby.c24
-rw-r--r--hash.c1429
-rw-r--r--ia64.s9
-rw-r--r--id.c49
-rw-r--r--id.h168
-rw-r--r--include/ruby.h34
-rw-r--r--include/ruby/backward/rubyio.h6
-rw-r--r--include/ruby/backward/rubysig.h48
-rw-r--r--include/ruby/backward/st.h6
-rw-r--r--include/ruby/backward/util.h6
-rw-r--r--include/ruby/defines.h288
-rw-r--r--include/ruby/encoding.h303
-rw-r--r--include/ruby/intern.h821
-rw-r--r--include/ruby/io.h176
-rw-r--r--include/ruby/missing.h172
-rw-r--r--include/ruby/oniguruma.h784
-rw-r--r--include/ruby/re.h66
-rw-r--r--include/ruby/regex.h42
-rw-r--r--include/ruby/ruby.h1320
-rw-r--r--include/ruby/st.h119
-rw-r--r--include/ruby/util.h96
-rw-r--r--include/ruby/version.h61
-rw-r--r--include/ruby/vm.h22
-rw-r--r--include/ruby/win32.h563
-rw-r--r--inits.c119
-rw-r--r--insns.def2089
-rw-r--r--[-rwxr-xr-x]install-sh (renamed from tool/install-sh)0
-rwxr-xr-xinstruby.rb411
-rw-r--r--intern.h531
-rw-r--r--io.c8251
-rw-r--r--iseq.c1485
-rw-r--r--iseq.h103
-rw-r--r--keywords42
-rw-r--r--lex.c136
-rw-r--r--lex.c.blt219
-rw-r--r--lib/.document7
-rw-r--r--lib/English.rb10
-rw-r--r--lib/Env.rb18
-rw-r--r--lib/README18
-rw-r--r--lib/base64.rb142
-rw-r--r--lib/benchmark.rb163
-rw-r--r--lib/cgi-lib.rb272
-rw-r--r--lib/cgi.rb2124
-rw-r--r--lib/cgi/.document3
-rw-r--r--lib/cgi/cookie.rb137
-rw-r--r--lib/cgi/core.rb792
-rw-r--r--lib/cgi/html.rb1021
-rw-r--r--lib/cgi/session.rb225
-rw-r--r--lib/cgi/session/pstore.rb58
-rw-r--r--lib/cgi/util.rb181
-rw-r--r--lib/cmath.rb254
-rw-r--r--lib/complex.rb663
-rw-r--r--lib/csv.rb3014
-rw-r--r--lib/date.rb1042
-rw-r--r--lib/date/format.rb321
-rw-r--r--lib/date2.rb5
-rw-r--r--lib/debug.rb124
-rw-r--r--lib/delegate.rb210
-rw-r--r--lib/drb/drb.rb195
-rw-r--r--lib/drb/extserv.rb21
-rw-r--r--lib/drb/extservm.rb12
-rw-r--r--lib/drb/invokemethod.rb4
-rw-r--r--lib/drb/observer.rb20
-rw-r--r--lib/drb/ssl.rb22
-rw-r--r--lib/drb/timeridconv.rb8
-rw-r--r--lib/drb/unix.rb4
-rw-r--r--lib/e2mmap.rb43
-rw-r--r--lib/erb.rb192
-rw-r--r--lib/eregex.rb37
-rw-r--r--lib/fileutils.rb257
-rw-r--r--lib/finalize.rb193
-rw-r--r--lib/find.rb6
-rw-r--r--lib/forwardable.rb186
-rw-r--r--lib/ftools.rb261
-rw-r--r--lib/gauntlet_rubygems.rb50
-rw-r--r--lib/generator.rb418
-rw-r--r--lib/getoptlong.rb102
-rw-r--r--lib/getopts.rb127
-rw-r--r--lib/gserver.rb12
-rw-r--r--lib/importenv.rb33
-rw-r--r--lib/ipaddr.rb21
-rw-r--r--lib/irb.rb32
-rw-r--r--lib/irb/cmd/chws.rb7
-rw-r--r--lib/irb/cmd/fork.rb9
-rw-r--r--lib/irb/cmd/help.rb12
-rw-r--r--lib/irb/cmd/load.rb11
-rw-r--r--lib/irb/cmd/nop.rb9
-rw-r--r--lib/irb/cmd/pushws.rb7
-rw-r--r--lib/irb/cmd/subirb.rb9
-rw-r--r--lib/irb/completion.rb66
-rw-r--r--lib/irb/context.rb63
-rw-r--r--lib/irb/ext/change-ws.rb15
-rw-r--r--lib/irb/ext/history.rb11
-rw-r--r--lib/irb/ext/loader.rb13
-rw-r--r--lib/irb/ext/math-mode.rb7
-rw-r--r--lib/irb/ext/multi-irb.rb23
-rw-r--r--lib/irb/ext/save-history.rb30
-rw-r--r--lib/irb/ext/tracer.rb11
-rw-r--r--lib/irb/ext/use-loader.rb9
-rw-r--r--lib/irb/ext/workspaces.rb7
-rw-r--r--lib/irb/extend-command.rb28
-rw-r--r--lib/irb/frame.rb5
-rw-r--r--lib/irb/help.rb32
-rw-r--r--lib/irb/init.rb75
-rw-r--r--lib/irb/input-method.rb46
-rw-r--r--lib/irb/inspector.rb103
-rw-r--r--lib/irb/lc/error.rb9
-rw-r--r--lib/irb/lc/help-message7
-rw-r--r--lib/irb/lc/ja/encoding_aliases.rb8
-rw-r--r--lib/irb/lc/ja/error.rb30
-rw-r--r--lib/irb/lc/ja/help-message53
-rw-r--r--lib/irb/locale.rb121
-rw-r--r--lib/irb/magic-file.rb36
-rw-r--r--lib/irb/notifier.rb17
-rw-r--r--lib/irb/output-method.rb32
-rw-r--r--lib/irb/ruby-lex.rb121
-rw-r--r--lib/irb/ruby-token.rb25
-rw-r--r--lib/irb/slex.rb41
-rw-r--r--lib/irb/src_encoding.rb4
-rw-r--r--lib/irb/version.rb9
-rw-r--r--lib/irb/workspace.rb21
-rw-r--r--lib/irb/ws-for-case-2.rb7
-rw-r--r--lib/irb/xmp.rb15
-rw-r--r--lib/jcode.rb220
-rw-r--r--lib/logger.rb47
-rw-r--r--lib/mailread.rb62
-rw-r--r--lib/mathn.rb214
-rw-r--r--lib/matrix.rb517
-rw-r--r--lib/minitest/autorun.rb11
-rw-r--r--lib/minitest/mock.rb37
-rw-r--r--lib/minitest/spec.rb114
-rw-r--r--lib/minitest/unit.rb536
-rw-r--r--lib/mkmf.rb722
-rw-r--r--lib/monitor.rb187
-rw-r--r--lib/mutex_m.rb101
-rw-r--r--lib/net/.document8
-rw-r--r--lib/net/ftp.rb325
-rw-r--r--lib/net/http.rb422
-rw-r--r--lib/net/https.rb61
-rw-r--r--lib/net/imap.rb885
-rw-r--r--lib/net/pop.rb111
-rw-r--r--lib/net/protocol.rb42
-rw-r--r--lib/net/smtp.rb116
-rw-r--r--lib/net/telnet.rb213
-rw-r--r--lib/observer.rb33
-rw-r--r--lib/open-uri.rb196
-rw-r--r--lib/open3.rb730
-rw-r--r--lib/optparse.rb168
-rw-r--r--lib/optparse/version.rb10
-rw-r--r--lib/ostruct.rb59
-rw-r--r--lib/parsearg.rb87
-rw-r--r--lib/parsedate.rb53
-rw-r--r--lib/pathname.rb240
-rw-r--r--lib/ping.rb64
-rw-r--r--lib/pp.rb315
-rw-r--r--lib/prettyprint.rb533
-rw-r--r--lib/prime.rb468
-rw-r--r--lib/profile.rb4
-rw-r--r--lib/profiler.rb2
-rw-r--r--lib/pstore.rb382
-rw-r--r--lib/racc/parser.rb5
-rw-r--r--lib/rake.rb2471
-rw-r--r--lib/rake/classic_namespace.rb8
-rw-r--r--lib/rake/clean.rb31
-rw-r--r--lib/rake/gempackagetask.rb95
-rw-r--r--lib/rake/loaders/makefile.rb38
-rw-r--r--lib/rake/packagetask.rb182
-rw-r--r--lib/rake/rake_test_loader.rb5
-rw-r--r--lib/rake/rdoctask.rb207
-rw-r--r--lib/rake/runtest.rb21
-rw-r--r--lib/rake/tasklib.rb21
-rw-r--r--lib/rake/testtask.rb159
-rw-r--r--lib/rake/win32.rb34
-rw-r--r--lib/rational.rb557
-rw-r--r--lib/rbconfig/datadir.rb20
-rw-r--r--lib/rdoc.rb395
-rw-r--r--lib/rdoc/README605
-rw-r--r--lib/rdoc/code_objects.rb580
-rw-r--r--lib/rdoc/diagram.rb225
-rw-r--r--lib/rdoc/dot.rb249
-rw-r--r--lib/rdoc/dot/dot.rb255
-rw-r--r--lib/rdoc/generator.rb1082
-rw-r--r--lib/rdoc/generator/chm.rb113
-rw-r--r--lib/rdoc/generator/chm/chm.rb100
-rw-r--r--lib/rdoc/generator/html.rb445
-rw-r--r--lib/rdoc/generator/html/common.rb24
-rw-r--r--lib/rdoc/generator/html/frameless.rb92
-rw-r--r--lib/rdoc/generator/html/hefss.rb150
-rw-r--r--lib/rdoc/generator/html/html.rb769
-rw-r--r--lib/rdoc/generator/html/kilmer.rb151
-rw-r--r--lib/rdoc/generator/html/kilmerfactory.rb427
-rw-r--r--lib/rdoc/generator/html/one_page_html.rb122
-rw-r--r--lib/rdoc/generator/ri.rb226
-rw-r--r--lib/rdoc/generator/texinfo.rb81
-rw-r--r--lib/rdoc/generator/texinfo/class.texinfo.erb44
-rw-r--r--lib/rdoc/generator/texinfo/file.texinfo.erb6
-rw-r--r--lib/rdoc/generator/texinfo/method.texinfo.erb6
-rw-r--r--lib/rdoc/generator/texinfo/texinfo.erb28
-rw-r--r--lib/rdoc/generator/xml.rb117
-rw-r--r--lib/rdoc/generator/xml/rdf.rb113
-rw-r--r--lib/rdoc/generator/xml/xml.rb123
-rw-r--r--lib/rdoc/generators/chm_generator.rb112
-rw-r--r--lib/rdoc/generators/html_generator.rb1509
-rw-r--r--lib/rdoc/generators/ri_generator.rb268
-rw-r--r--lib/rdoc/generators/template/chm/chm.rb87
-rw-r--r--lib/rdoc/generators/template/html/hefss.rb418
-rw-r--r--lib/rdoc/generators/template/html/html.rb711
-rw-r--r--lib/rdoc/generators/template/html/kilmer.rb435
-rw-r--r--lib/rdoc/generators/template/html/old_html.rb728
-rw-r--r--lib/rdoc/generators/template/html/one_page_html.rb122
-rw-r--r--lib/rdoc/generators/template/xml/rdf.rb112
-rw-r--r--lib/rdoc/generators/template/xml/xml.rb112
-rw-r--r--lib/rdoc/generators/xml_generator.rb130
-rw-r--r--lib/rdoc/known_classes.rb68
-rw-r--r--lib/rdoc/markup.rb378
-rw-r--r--lib/rdoc/markup/.document2
-rw-r--r--lib/rdoc/markup/attribute_manager.rb265
-rw-r--r--lib/rdoc/markup/formatter.rb14
-rw-r--r--lib/rdoc/markup/fragments.rb337
-rw-r--r--lib/rdoc/markup/inline.rb101
-rw-r--r--lib/rdoc/markup/lines.rb152
-rw-r--r--lib/rdoc/markup/preprocess.rb75
-rw-r--r--lib/rdoc/markup/sample/rdoc2latex.rb16
-rw-r--r--lib/rdoc/markup/sample/sample.rb42
-rw-r--r--lib/rdoc/markup/simple_markup.rb476
-rw-r--r--lib/rdoc/markup/simple_markup/fragments.rb328
-rw-r--r--lib/rdoc/markup/simple_markup/inline.rb340
-rw-r--r--lib/rdoc/markup/simple_markup/lines.rb151
-rw-r--r--lib/rdoc/markup/simple_markup/preprocess.rb73
-rw-r--r--lib/rdoc/markup/simple_markup/to_flow.rb188
-rw-r--r--lib/rdoc/markup/simple_markup/to_html.rb289
-rw-r--r--lib/rdoc/markup/simple_markup/to_latex.rb333
-rw-r--r--lib/rdoc/markup/test/AllTests.rb2
-rw-r--r--lib/rdoc/markup/test/TestInline.rb154
-rw-r--r--lib/rdoc/markup/test/TestParse.rb503
-rw-r--r--lib/rdoc/markup/to_flow.rb185
-rw-r--r--lib/rdoc/markup/to_html.rb403
-rw-r--r--lib/rdoc/markup/to_html_crossref.rb148
-rw-r--r--lib/rdoc/markup/to_latex.rb328
-rw-r--r--lib/rdoc/markup/to_test.rb50
-rw-r--r--lib/rdoc/markup/to_texinfo.rb69
-rw-r--r--lib/rdoc/options.rb972
-rw-r--r--lib/rdoc/parser.rb136
-rw-r--r--lib/rdoc/parser/c.rb661
-rw-r--r--lib/rdoc/parser/f95.rb1835
-rw-r--r--lib/rdoc/parser/perl.rb165
-rw-r--r--lib/rdoc/parser/ruby.rb2829
-rw-r--r--lib/rdoc/parser/simple.rb38
-rw-r--r--lib/rdoc/parsers/parse_c.rb773
-rw-r--r--lib/rdoc/parsers/parse_f95.rb1841
-rw-r--r--lib/rdoc/parsers/parse_rb.rb2609
-rw-r--r--lib/rdoc/parsers/parse_simple.rb41
-rw-r--r--lib/rdoc/parsers/parserfactory.rb99
-rw-r--r--lib/rdoc/rdoc.rb289
-rw-r--r--lib/rdoc/ri.rb8
-rw-r--r--lib/rdoc/ri/cache.rb187
-rw-r--r--lib/rdoc/ri/descriptions.rb156
-rw-r--r--lib/rdoc/ri/display.rb392
-rw-r--r--lib/rdoc/ri/driver.rb669
-rw-r--r--lib/rdoc/ri/formatter.rb616
-rw-r--r--lib/rdoc/ri/paths.rb105
-rw-r--r--lib/rdoc/ri/reader.rb106
-rw-r--r--lib/rdoc/ri/ri_cache.rb187
-rw-r--r--lib/rdoc/ri/ri_descriptions.rb154
-rw-r--r--lib/rdoc/ri/ri_display.rb255
-rw-r--r--lib/rdoc/ri/ri_driver.rb143
-rw-r--r--lib/rdoc/ri/ri_formatter.rb672
-rw-r--r--lib/rdoc/ri/ri_options.rb319
-rw-r--r--lib/rdoc/ri/ri_paths.rb101
-rw-r--r--lib/rdoc/ri/ri_reader.rb100
-rw-r--r--lib/rdoc/ri/ri_util.rb75
-rw-r--r--lib/rdoc/ri/ri_writer.rb62
-rw-r--r--lib/rdoc/ri/util.rb79
-rw-r--r--lib/rdoc/ri/writer.rb68
-rw-r--r--lib/rdoc/stats.rb115
-rw-r--r--lib/rdoc/template.rb252
-rw-r--r--lib/rdoc/tokenstream.rb24
-rw-r--r--lib/rdoc/usage.rb210
-rw-r--r--lib/readbytes.rb41
-rw-r--r--lib/resolv.rb96
-rw-r--r--lib/rexml/attlistdecl.rb112
-rw-r--r--lib/rexml/attribute.rb301
-rw-r--r--lib/rexml/cdata.rb96
-rw-r--r--lib/rexml/child.rb164
-rw-r--r--lib/rexml/comment.rb118
-rw-r--r--lib/rexml/doctype.rb37
-rw-r--r--lib/rexml/document.rb215
-rw-r--r--lib/rexml/dtd/attlistdecl.rb14
-rw-r--r--lib/rexml/dtd/dtd.rb82
-rw-r--r--lib/rexml/dtd/elementdecl.rb26
-rw-r--r--lib/rexml/dtd/entitydecl.rb98
-rw-r--r--lib/rexml/dtd/notationdecl.rb64
-rw-r--r--lib/rexml/element.rb175
-rw-r--r--lib/rexml/encoding.rb8
-rw-r--r--lib/rexml/encodings/CP-1252.rb14
-rw-r--r--lib/rexml/encodings/ISO-8859-15.rb8
-rw-r--r--lib/rexml/encodings/UNILE.rb2
-rw-r--r--lib/rexml/encodings/UTF-16.rb2
-rw-r--r--lib/rexml/entity.rb288
-rw-r--r--lib/rexml/formatters/default.rb6
-rw-r--r--lib/rexml/formatters/pretty.rb3
-rw-r--r--lib/rexml/formatters/transitive.rb6
-rw-r--r--lib/rexml/functions.rb46
-rw-r--r--lib/rexml/instruction.rb98
-rw-r--r--lib/rexml/light/node.rb380
-rw-r--r--lib/rexml/namespace.rb78
-rw-r--r--lib/rexml/node.rb64
-rw-r--r--lib/rexml/output.rb24
-rw-r--r--lib/rexml/parent.rb50
-rw-r--r--lib/rexml/parseexception.rb6
-rw-r--r--lib/rexml/parsers/baseparser.rb75
-rw-r--r--lib/rexml/parsers/lightparser.rb84
-rw-r--r--lib/rexml/parsers/pullparser.rb2
-rw-r--r--lib/rexml/parsers/sax2parser.rb403
-rw-r--r--lib/rexml/parsers/streamparser.rb4
-rw-r--r--lib/rexml/parsers/treeparser.rb9
-rw-r--r--lib/rexml/parsers/ultralightparser.rb80
-rw-r--r--lib/rexml/parsers/xpathparser.rb96
-rw-r--r--lib/rexml/quickpath.rb493
-rw-r--r--lib/rexml/rexml.rb17
-rw-r--r--lib/rexml/sax2listener.rb184
-rw-r--r--lib/rexml/source.rb43
-rw-r--r--lib/rexml/streamlistener.rb180
-rw-r--r--lib/rexml/syncenumerator.rb7
-rw-r--r--lib/rexml/text.rb198
-rw-r--r--lib/rexml/validation/relaxng.rb36
-rw-r--r--lib/rexml/validation/validation.rb10
-rw-r--r--lib/rexml/xmldecl.rb116
-rw-r--r--lib/rexml/xmltokens.rb28
-rw-r--r--lib/rexml/xpath.rb117
-rw-r--r--lib/rexml/xpath_parser.rb72
-rw-r--r--lib/rinda/.document3
-rw-r--r--lib/rinda/rinda.rb18
-rw-r--r--lib/rinda/ring.rb22
-rw-r--r--lib/rinda/tuplespace.rb20
-rw-r--r--lib/rss/0.9.rb40
-rw-r--r--lib/rss/1.0.rb48
-rw-r--r--lib/rss/2.0.rb6
-rw-r--r--lib/rss/atom.rb5
-rw-r--r--lib/rss/content/1.0.rb1
-rw-r--r--lib/rss/content/2.0.rb1
-rw-r--r--lib/rss/converter.rb36
-rw-r--r--lib/rss/dublincore.rb16
-rw-r--r--lib/rss/dublincore/1.0.rb1
-rw-r--r--lib/rss/dublincore/2.0.rb1
-rw-r--r--lib/rss/dublincore/atom.rb1
-rw-r--r--lib/rss/image.rb18
-rw-r--r--lib/rss/maker.rb20
-rw-r--r--lib/rss/maker/0.9.rb83
-rw-r--r--lib/rss/maker/1.0.rb11
-rw-r--r--lib/rss/maker/2.0.rb22
-rw-r--r--lib/rss/maker/base.rb101
-rw-r--r--lib/rss/maker/dublincore.rb2
-rw-r--r--lib/rss/maker/entry.rb2
-rw-r--r--lib/rss/maker/feed.rb9
-rw-r--r--lib/rss/maker/image.rb2
-rw-r--r--lib/rss/maker/itunes.rb2
-rw-r--r--lib/rss/maker/taxonomy.rb8
-rw-r--r--lib/rss/maker/trackback.rb2
-rw-r--r--lib/rss/parser.rb77
-rw-r--r--lib/rss/rexmlparser.rb10
-rw-r--r--lib/rss/rss.rb21
-rw-r--r--lib/rss/syndication.rb6
-rw-r--r--lib/rss/taxonomy.rb18
-rw-r--r--lib/rss/trackback.rb36
-rw-r--r--lib/rss/utils.rb4
-rw-r--r--lib/rss/xml-stylesheet.rb4
-rw-r--r--lib/rss/xmlparser.rb14
-rw-r--r--lib/rss/xmlscanner.rb10
-rw-r--r--lib/rubygems.rb1121
-rw-r--r--lib/rubygems/builder.rb90
-rw-r--r--lib/rubygems/command.rb511
-rw-r--r--lib/rubygems/command_manager.rb174
-rw-r--r--lib/rubygems/commands/build_command.rb53
-rw-r--r--lib/rubygems/commands/cert_command.rb86
-rw-r--r--lib/rubygems/commands/check_command.rb80
-rw-r--r--lib/rubygems/commands/cleanup_command.rb106
-rw-r--r--lib/rubygems/commands/contents_command.rb98
-rw-r--r--lib/rubygems/commands/dependency_command.rb188
-rw-r--r--lib/rubygems/commands/environment_command.rb128
-rw-r--r--lib/rubygems/commands/fetch_command.rb62
-rw-r--r--lib/rubygems/commands/generate_index_command.rb133
-rw-r--r--lib/rubygems/commands/help_command.rb172
-rw-r--r--lib/rubygems/commands/install_command.rb174
-rw-r--r--lib/rubygems/commands/list_command.rb35
-rw-r--r--lib/rubygems/commands/lock_command.rb110
-rw-r--r--lib/rubygems/commands/mirror_command.rb111
-rw-r--r--lib/rubygems/commands/outdated_command.rb33
-rw-r--r--lib/rubygems/commands/pristine_command.rb93
-rw-r--r--lib/rubygems/commands/query_command.rb264
-rw-r--r--lib/rubygems/commands/rdoc_command.rb76
-rw-r--r--lib/rubygems/commands/search_command.rb31
-rw-r--r--lib/rubygems/commands/server_command.rb70
-rw-r--r--lib/rubygems/commands/setup_command.rb353
-rw-r--r--lib/rubygems/commands/sources_command.rb157
-rw-r--r--lib/rubygems/commands/specification_command.rb124
-rw-r--r--lib/rubygems/commands/stale_command.rb27
-rw-r--r--lib/rubygems/commands/uninstall_command.rb83
-rw-r--r--lib/rubygems/commands/unpack_command.rb97
-rw-r--r--lib/rubygems/commands/update_command.rb202
-rw-r--r--lib/rubygems/commands/which_command.rb87
-rw-r--r--lib/rubygems/config_file.rb266
-rw-r--r--lib/rubygems/custom_require.rb46
-rw-r--r--lib/rubygems/defaults.rb106
-rw-r--r--lib/rubygems/dependency.rb148
-rw-r--r--lib/rubygems/dependency_installer.rb261
-rw-r--r--lib/rubygems/dependency_list.rb185
-rw-r--r--lib/rubygems/digest/md5.rb13
-rw-r--r--lib/rubygems/digest/sha1.rb11
-rw-r--r--lib/rubygems/digest/sha2.rb11
-rw-r--r--lib/rubygems/doc_manager.rb230
-rw-r--r--lib/rubygems/exceptions.rb82
-rw-r--r--lib/rubygems/ext.rb18
-rw-r--r--lib/rubygems/ext/builder.rb54
-rw-r--r--lib/rubygems/ext/configure_builder.rb25
-rw-r--r--lib/rubygems/ext/ext_conf_builder.rb24
-rw-r--r--lib/rubygems/ext/rake_builder.rb31
-rw-r--r--lib/rubygems/format.rb87
-rw-r--r--lib/rubygems/gem_openssl.rb94
-rw-r--r--lib/rubygems/gem_path_searcher.rb102
-rw-r--r--lib/rubygems/gem_runner.rb78
-rw-r--r--lib/rubygems/indexer.rb712
-rw-r--r--lib/rubygems/indexer/abstract_index_builder.rb88
-rw-r--r--lib/rubygems/indexer/latest_index_builder.rb35
-rw-r--r--lib/rubygems/indexer/marshal_index_builder.rb17
-rw-r--r--lib/rubygems/indexer/master_index_builder.rb54
-rw-r--r--lib/rubygems/indexer/quick_index_builder.rb50
-rw-r--r--lib/rubygems/install_update_options.rb125
-rw-r--r--lib/rubygems/installer.rb589
-rw-r--r--lib/rubygems/local_remote_options.rb135
-rw-r--r--lib/rubygems/old_format.rb152
-rw-r--r--lib/rubygems/package.rb95
-rw-r--r--lib/rubygems/package/f_sync_dir.rb22
-rw-r--r--lib/rubygems/package/tar_header.rb265
-rw-r--r--lib/rubygems/package/tar_input.rb217
-rw-r--r--lib/rubygems/package/tar_output.rb143
-rw-r--r--lib/rubygems/package/tar_reader.rb105
-rw-r--r--lib/rubygems/package/tar_reader/entry.rb140
-rw-r--r--lib/rubygems/package/tar_writer.rb240
-rw-r--r--lib/rubygems/package_task.rb118
-rw-r--r--lib/rubygems/platform.rb180
-rw-r--r--lib/rubygems/remote_fetcher.rb367
-rw-r--r--lib/rubygems/require_paths_builder.rb17
-rw-r--r--lib/rubygems/requirement.rb170
-rw-r--r--lib/rubygems/rubygems_version.rb19
-rw-r--r--lib/rubygems/security.rb786
-rw-r--r--lib/rubygems/server.rb813
-rw-r--r--lib/rubygems/source_index.rb591
-rw-r--r--lib/rubygems/source_info_cache.rb393
-rw-r--r--lib/rubygems/source_info_cache_entry.rb56
-rw-r--r--lib/rubygems/spec_fetcher.rb271
-rw-r--r--lib/rubygems/specification.rb1444
-rw-r--r--lib/rubygems/test_utilities.rb131
-rw-r--r--lib/rubygems/text.rb30
-rw-r--r--lib/rubygems/timer.rb28
-rw-r--r--lib/rubygems/uninstaller.rb262
-rw-r--r--lib/rubygems/user_interaction.rb390
-rw-r--r--lib/rubygems/validator.rb242
-rw-r--r--lib/rubygems/version.rb251
-rw-r--r--lib/rubygems/version_option.rb49
-rw-r--r--lib/rubyunit.rb6
-rw-r--r--lib/runit/assert.rb73
-rw-r--r--lib/runit/cui/testrunner.rb51
-rw-r--r--lib/runit/error.rb9
-rw-r--r--lib/runit/testcase.rb45
-rw-r--r--lib/runit/testresult.rb44
-rw-r--r--lib/runit/testsuite.rb26
-rw-r--r--lib/runit/topublic.rb8
-rw-r--r--lib/scanf.rb27
-rw-r--r--lib/securerandom.rb128
-rw-r--r--lib/set.rb157
-rw-r--r--lib/shell.rb129
-rw-r--r--lib/shell/builtin-command.rb38
-rw-r--r--lib/shell/command-processor.rb142
-rw-r--r--lib/shell/error.rb9
-rw-r--r--lib/shell/filter.rb11
-rw-r--r--lib/shell/process-controller.rb165
-rw-r--r--lib/shell/system-command.rb71
-rw-r--r--lib/shell/version.rb11
-rw-r--r--lib/shellwords.rb32
-rw-r--r--lib/singleton.rb128
-rw-r--r--lib/soap/attachment.rb107
-rw-r--r--lib/soap/baseData.rb942
-rw-r--r--lib/soap/element.rb258
-rw-r--r--lib/soap/encodingstyle/aspDotNetHandler.rb213
-rw-r--r--lib/soap/encodingstyle/handler.rb100
-rw-r--r--lib/soap/encodingstyle/literalHandler.rb226
-rw-r--r--lib/soap/encodingstyle/soapHandler.rb582
-rw-r--r--lib/soap/generator.rb268
-rw-r--r--lib/soap/header/handler.rb57
-rw-r--r--lib/soap/header/handlerset.rb70
-rw-r--r--lib/soap/header/simplehandler.rb44
-rw-r--r--lib/soap/httpconfigloader.rb119
-rw-r--r--lib/soap/mapping.rb10
-rw-r--r--lib/soap/mapping/factory.rb355
-rw-r--r--lib/soap/mapping/mapping.rb381
-rw-r--r--lib/soap/mapping/registry.rb541
-rw-r--r--lib/soap/mapping/rubytypeFactory.rb475
-rw-r--r--lib/soap/mapping/typeMap.rb50
-rw-r--r--lib/soap/mapping/wsdlencodedregistry.rb280
-rw-r--r--lib/soap/mapping/wsdlliteralregistry.rb418
-rw-r--r--lib/soap/marshal.rb59
-rw-r--r--lib/soap/mimemessage.rb240
-rw-r--r--lib/soap/netHttpClient.rb190
-rw-r--r--lib/soap/parser.rb251
-rw-r--r--lib/soap/processor.rb66
-rw-r--r--lib/soap/property.rb333
-rw-r--r--lib/soap/rpc/cgistub.rb206
-rw-r--r--lib/soap/rpc/driver.rb254
-rw-r--r--lib/soap/rpc/element.rb325
-rw-r--r--lib/soap/rpc/httpserver.rb129
-rw-r--r--lib/soap/rpc/proxy.rb497
-rw-r--r--lib/soap/rpc/router.rb594
-rw-r--r--lib/soap/rpc/rpc.rb25
-rw-r--r--lib/soap/rpc/soaplet.rb162
-rw-r--r--lib/soap/rpc/standaloneServer.rb43
-rw-r--r--lib/soap/soap.rb140
-rw-r--r--lib/soap/streamHandler.rb229
-rw-r--r--lib/soap/wsdlDriver.rb575
-rw-r--r--lib/sync.rb223
-rw-r--r--lib/tempfile.rb69
-rw-r--r--lib/test/unit.rb330
-rw-r--r--lib/test/unit/assertionfailederror.rb14
-rw-r--r--lib/test/unit/assertions.rb681
-rw-r--r--lib/test/unit/autorunner.rb220
-rw-r--r--lib/test/unit/collector.rb43
-rw-r--r--lib/test/unit/collector/dir.rb107
-rw-r--r--lib/test/unit/collector/objectspace.rb34
-rw-r--r--lib/test/unit/error.rb56
-rw-r--r--lib/test/unit/failure.rb51
-rw-r--r--lib/test/unit/testcase.rb154
-rw-r--r--lib/test/unit/testresult.rb80
-rw-r--r--lib/test/unit/testsuite.rb76
-rw-r--r--lib/test/unit/ui/console/testrunner.rb127
-rw-r--r--lib/test/unit/ui/fox/testrunner.rb268
-rw-r--r--lib/test/unit/ui/gtk/testrunner.rb416
-rw-r--r--lib/test/unit/ui/gtk2/testrunner.rb465
-rw-r--r--lib/test/unit/ui/testrunnermediator.rb68
-rw-r--r--lib/test/unit/ui/testrunnerutilities.rb46
-rw-r--r--lib/test/unit/ui/tk/testrunner.rb260
-rw-r--r--lib/test/unit/util/backtracefilter.rb40
-rw-r--r--lib/test/unit/util/observable.rb90
-rw-r--r--lib/test/unit/util/procwrapper.rb48
-rw-r--r--lib/thread.rb288
-rw-r--r--lib/thwait.rb27
-rw-r--r--lib/time.rb448
-rw-r--r--lib/timeout.rb70
-rw-r--r--lib/tmpdir.rb15
-rw-r--r--lib/tracer.rb43
-rw-r--r--lib/tsort.rb68
-rw-r--r--lib/ubygems.rb10
-rw-r--r--lib/un.rb111
-rw-r--r--lib/uri.rb4
-rw-r--r--lib/uri/.document7
-rw-r--r--lib/uri/common.rb564
-rw-r--r--lib/uri/ftp.rb36
-rw-r--r--lib/uri/generic.rb133
-rw-r--r--lib/uri/http.rb26
-rw-r--r--lib/uri/ldap.rb6
-rw-r--r--lib/uri/mailto.rb36
-rw-r--r--lib/weakref.rb70
-rw-r--r--lib/webrick/cgi.rb53
-rw-r--r--lib/webrick/config.rb9
-rw-r--r--lib/webrick/httpauth/authenticator.rb10
-rw-r--r--lib/webrick/httpauth/basicauth.rb2
-rw-r--r--lib/webrick/httpauth/digestauth.rb15
-rw-r--r--lib/webrick/httpauth/htpasswd.rb2
-rw-r--r--lib/webrick/httpauth/userdb.rb2
-rw-r--r--lib/webrick/httpproxy.rb252
-rw-r--r--lib/webrick/httprequest.rb91
-rw-r--r--lib/webrick/httpresponse.rb39
-rw-r--r--lib/webrick/httpserver.rb19
-rw-r--r--lib/webrick/httpservlet/abstract.rb2
-rw-r--r--lib/webrick/httpservlet/cgi_runner.rb2
-rw-r--r--lib/webrick/httpservlet/cgihandler.rb34
-rw-r--r--lib/webrick/httpservlet/erbhandler.rb8
-rw-r--r--lib/webrick/httpservlet/filehandler.rb14
-rw-r--r--lib/webrick/httpservlet/prochandler.rb8
-rw-r--r--lib/webrick/httpstatus.rb84
-rw-r--r--lib/webrick/httputils.rb21
-rw-r--r--lib/webrick/log.rb2
-rw-r--r--lib/webrick/server.rb20
-rw-r--r--lib/webrick/ssl.rb6
-rw-r--r--lib/webrick/utils.rb83
-rw-r--r--lib/wsdl/binding.rb65
-rw-r--r--lib/wsdl/data.rb64
-rw-r--r--lib/wsdl/definitions.rb250
-rw-r--r--lib/wsdl/documentation.rb32
-rw-r--r--lib/wsdl/import.rb80
-rw-r--r--lib/wsdl/importer.rb38
-rw-r--r--lib/wsdl/info.rb39
-rw-r--r--lib/wsdl/message.rb54
-rw-r--r--lib/wsdl/operation.rb130
-rw-r--r--lib/wsdl/operationBinding.rb108
-rw-r--r--lib/wsdl/param.rb85
-rw-r--r--lib/wsdl/parser.rb163
-rw-r--r--lib/wsdl/part.rb52
-rw-r--r--lib/wsdl/port.rb84
-rw-r--r--lib/wsdl/portType.rb73
-rw-r--r--lib/wsdl/service.rb61
-rw-r--r--lib/wsdl/soap/address.rb40
-rw-r--r--lib/wsdl/soap/binding.rb49
-rw-r--r--lib/wsdl/soap/body.rb56
-rw-r--r--lib/wsdl/soap/cgiStubCreator.rb76
-rw-r--r--lib/wsdl/soap/classDefCreator.rb314
-rw-r--r--lib/wsdl/soap/classDefCreatorSupport.rb126
-rw-r--r--lib/wsdl/soap/clientSkeltonCreator.rb78
-rw-r--r--lib/wsdl/soap/complexType.rb161
-rw-r--r--lib/wsdl/soap/data.rb42
-rw-r--r--lib/wsdl/soap/definitions.rb149
-rw-r--r--lib/wsdl/soap/driverCreator.rb95
-rw-r--r--lib/wsdl/soap/element.rb28
-rw-r--r--lib/wsdl/soap/fault.rb56
-rw-r--r--lib/wsdl/soap/header.rb86
-rw-r--r--lib/wsdl/soap/headerfault.rb56
-rw-r--r--lib/wsdl/soap/mappingRegistryCreator.rb92
-rw-r--r--lib/wsdl/soap/methodDefCreator.rb228
-rw-r--r--lib/wsdl/soap/operation.rb122
-rw-r--r--lib/wsdl/soap/servantSkeltonCreator.rb67
-rw-r--r--lib/wsdl/soap/standaloneServerStubCreator.rb85
-rw-r--r--lib/wsdl/soap/wsdl2ruby.rb176
-rw-r--r--lib/wsdl/types.rb43
-rw-r--r--lib/wsdl/wsdl.rb23
-rw-r--r--lib/wsdl/xmlSchema/all.rb69
-rw-r--r--lib/wsdl/xmlSchema/annotation.rb34
-rw-r--r--lib/wsdl/xmlSchema/any.rb56
-rw-r--r--lib/wsdl/xmlSchema/attribute.rb127
-rw-r--r--lib/wsdl/xmlSchema/choice.rb69
-rw-r--r--lib/wsdl/xmlSchema/complexContent.rb92
-rw-r--r--lib/wsdl/xmlSchema/complexType.rb139
-rw-r--r--lib/wsdl/xmlSchema/content.rb96
-rw-r--r--lib/wsdl/xmlSchema/data.rb80
-rw-r--r--lib/wsdl/xmlSchema/element.rb154
-rw-r--r--lib/wsdl/xmlSchema/enumeration.rb36
-rw-r--r--lib/wsdl/xmlSchema/import.rb65
-rw-r--r--lib/wsdl/xmlSchema/importer.rb87
-rw-r--r--lib/wsdl/xmlSchema/include.rb54
-rw-r--r--lib/wsdl/xmlSchema/length.rb35
-rw-r--r--lib/wsdl/xmlSchema/parser.rb166
-rw-r--r--lib/wsdl/xmlSchema/pattern.rb36
-rw-r--r--lib/wsdl/xmlSchema/schema.rb143
-rw-r--r--lib/wsdl/xmlSchema/sequence.rb69
-rw-r--r--lib/wsdl/xmlSchema/simpleContent.rb65
-rw-r--r--lib/wsdl/xmlSchema/simpleExtension.rb54
-rw-r--r--lib/wsdl/xmlSchema/simpleRestriction.rb73
-rw-r--r--lib/wsdl/xmlSchema/simpleType.rb73
-rw-r--r--lib/wsdl/xmlSchema/unique.rb34
-rw-r--r--lib/wsdl/xmlSchema/xsd2ruby.rb107
-rw-r--r--lib/xmlrpc/README.rdoc300
-rw-r--r--lib/xmlrpc/base64.rb22
-rw-r--r--lib/xmlrpc/client.rb152
-rw-r--r--lib/xmlrpc/config.rb8
-rw-r--r--lib/xmlrpc/create.rb200
-rw-r--r--lib/xmlrpc/datetime.rb20
-rw-r--r--lib/xmlrpc/httpserver.rb46
-rw-r--r--lib/xmlrpc/marshal.rb6
-rw-r--r--lib/xmlrpc/parser.rb420
-rw-r--r--lib/xmlrpc/server.rb196
-rw-r--r--lib/xmlrpc/utils.rb34
-rw-r--r--lib/xsd/charset.rb187
-rw-r--r--lib/xsd/codegen.rb12
-rw-r--r--lib/xsd/codegen/classdef.rb203
-rw-r--r--lib/xsd/codegen/commentdef.rb34
-rw-r--r--lib/xsd/codegen/gensupport.rb166
-rw-r--r--lib/xsd/codegen/methoddef.rb63
-rw-r--r--lib/xsd/codegen/moduledef.rb191
-rw-r--r--lib/xsd/datatypes.rb1269
-rw-r--r--lib/xsd/datatypes1999.rb20
-rw-r--r--lib/xsd/iconvcharset.rb33
-rw-r--r--lib/xsd/mapping.rb42
-rw-r--r--lib/xsd/namedelements.rb95
-rw-r--r--lib/xsd/ns.rb140
-rw-r--r--lib/xsd/qname.rb78
-rw-r--r--lib/xsd/xmlparser.rb61
-rw-r--r--lib/xsd/xmlparser/parser.rb96
-rw-r--r--lib/xsd/xmlparser/rexmlparser.rb54
-rw-r--r--lib/xsd/xmlparser/xmlparser.rb50
-rw-r--r--lib/xsd/xmlparser/xmlscanner.rb147
-rw-r--r--lib/yaml.rb44
-rw-r--r--lib/yaml/baseemitter.rb427
-rw-r--r--lib/yaml/constants.rb4
-rw-r--r--lib/yaml/dbm.rb4
-rw-r--r--lib/yaml/encoding.rb4
-rw-r--r--lib/yaml/error.rb2
-rw-r--r--lib/yaml/rubytypes.rb46
-rw-r--r--lib/yaml/stream.rb2
-rw-r--r--lib/yaml/stringio.rb2
-rw-r--r--lib/yaml/tag.rb8
-rw-r--r--lib/yaml/types.rb6
-rw-r--r--lib/yaml/yamlnode.rb6
-rw-r--r--load.c737
-rw-r--r--main.c44
-rw-r--r--man/erb.1158
-rw-r--r--man/goruby.139
-rw-r--r--man/irb.1173
-rw-r--r--man/rake.1169
-rw-r--r--man/ri.1180
-rw-r--r--man/ruby.1511
-rw-r--r--marshal.c784
-rw-r--r--math.c542
-rwxr-xr-xmdoc2man.rb465
-rw-r--r--method.h78
-rw-r--r--misc/inf-ruby.el217
-rw-r--r--misc/ruby-electric.el82
-rw-r--r--misc/ruby-mode.el1630
-rw-r--r--misc/ruby-style.el33
-rw-r--r--misc/rubydb3x.el42
-rw-r--r--missing.h142
-rw-r--r--missing/acosh.c19
-rw-r--r--missing/alloca.c5
-rw-r--r--missing/cbrt.c10
-rw-r--r--missing/crypt.c18
-rw-r--r--missing/dup2.c5
-rw-r--r--missing/erf.c12
-rw-r--r--missing/finite.c3
-rw-r--r--missing/flock.c14
-rw-r--r--missing/hypot.c3
-rw-r--r--missing/isinf.c17
-rw-r--r--missing/isnan.c8
-rw-r--r--missing/langinfo.c147
-rw-r--r--missing/lgamma_r.c68
-rw-r--r--missing/memcmp.c9
-rw-r--r--missing/memmove.c17
-rw-r--r--missing/os2.c25
-rw-r--r--missing/strcasecmp.c16
-rw-r--r--missing/strchr.c18
-rw-r--r--missing/strerror.c3
-rw-r--r--missing/strftime.c903
-rw-r--r--missing/strlcat.c73
-rw-r--r--missing/strlcpy.c69
-rw-r--r--missing/strncasecmp.c21
-rw-r--r--missing/strstr.c11
-rw-r--r--missing/strtod.c271
-rw-r--r--missing/strtol.c9
-rw-r--r--missing/strtoul.c184
-rw-r--r--missing/tgamma.c92
-rw-r--r--missing/vsnprintf.c321
-rw-r--r--missing/x68.c40
-rwxr-xr-xmkconfig.rb195
-rw-r--r--node.h373
-rw-r--r--numeric.c1711
-rw-r--r--object.c1600
-rw-r--r--pack.c585
-rw-r--r--parse.y7963
-rw-r--r--prec.c141
-rw-r--r--prelude.rb35
-rw-r--r--proc.c2068
-rw-r--r--process.c3708
-rw-r--r--random.c927
-rw-r--r--range.c716
-rw-r--r--rational.c2130
-rw-r--r--re.c3219
-rw-r--r--re.h42
-rw-r--r--regcomp.c6325
-rw-r--r--regenc.c931
-rw-r--r--regenc.h207
-rw-r--r--regerror.c389
-rw-r--r--regex.c4693
-rw-r--r--regex.h221
-rw-r--r--regexec.c3822
-rw-r--r--regint.h842
-rw-r--r--regparse.c5552
-rw-r--r--regparse.h351
-rw-r--r--regsyntax.c315
-rw-r--r--ruby.1351
-rw-r--r--ruby.c1758
-rw-r--r--ruby.h776
-rw-r--r--rubyio.h91
-rw-r--r--rubysig.h105
-rwxr-xr-xrubytest.rb49
-rwxr-xr-xrunruby.rb71
-rw-r--r--safe.c135
-rw-r--r--sample/README4
-rw-r--r--sample/biorhythm.rb116
-rw-r--r--sample/coverage.rb60
-rw-r--r--sample/dbmtest.rb14
-rw-r--r--sample/drb/darrayc.rb12
-rw-r--r--sample/drb/dhasenc.rb1
-rw-r--r--sample/erb/erb4html.rb60
-rw-r--r--sample/exyacc.rb32
-rw-r--r--sample/from.rb161
-rw-r--r--sample/getopts.test36
-rw-r--r--sample/mine.rb1
-rw-r--r--sample/mrshtest.rb13
-rw-r--r--sample/occur.rb4
-rw-r--r--sample/openssl/cert_store_view.rb911
-rw-r--r--sample/openssl/cipher.rb73
-rw-r--r--sample/openssl/echo_cli.rb21
-rw-r--r--sample/openssl/echo_svr.rb15
-rw-r--r--sample/openssl/gen_csr.rb13
-rw-r--r--sample/openssl/smime_read.rb10
-rw-r--r--sample/openssl/smime_write.rb10
-rw-r--r--sample/openssl/wget.rb17
-rw-r--r--sample/optparse/opttest.rb30
-rw-r--r--sample/rdoc/markup/rdoc2latex.rb15
-rw-r--r--sample/rdoc/markup/sample.rb40
-rw-r--r--sample/regx.rb23
-rw-r--r--sample/ripper/ruby2html.rb112
-rw-r--r--sample/ripper/strip-comment.rb19
-rwxr-xr-xsample/rss/list_description.rb4
-rwxr-xr-xsample/rss/rss_recent.rb4
-rw-r--r--sample/test.rb751
-rw-r--r--signal.c856
-rw-r--r--spec/README30
-rw-r--r--spec/default.mspec22
-rw-r--r--sprintf.c895
-rw-r--r--st.c791
-rw-r--r--st.h72
-rw-r--r--strftime.c1205
-rw-r--r--string.c6430
-rw-r--r--struct.c567
-rw-r--r--symbian/README.SYMBIAN100
-rw-r--r--symbian/configure.bat121
-rw-r--r--symbian/missing-aeabi.c18
-rw-r--r--symbian/missing-pips.c106
-rw-r--r--symbian/pre-build78
-rw-r--r--symbian/setup408
-rw-r--r--template/Doxyfile.tmpl267
-rw-r--r--template/encdb.h.tmpl79
-rw-r--r--template/fake.rb.in15
-rw-r--r--template/id.h.tmpl134
-rw-r--r--template/insns.inc.tmpl20
-rw-r--r--template/insns_info.inc.tmpl95
-rw-r--r--template/known_errors.inc.tmpl14
-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/transdb.h.tmpl59
-rw-r--r--template/vm.inc.tmpl29
-rw-r--r--template/vmtc.inc.tmpl18
-rw-r--r--template/yarvarch.en7
-rw-r--r--template/yarvarch.ja454
-rw-r--r--template/yasmdata.rb.tmpl20
-rw-r--r--test/base64/test_base64.rb99
-rw-r--r--test/bigdecimal/test_bigdecimal.rb694
-rw-r--r--test/cgi/test_cgi_cookie.rb107
-rw-r--r--test/cgi/test_cgi_core.rb363
-rw-r--r--test/cgi/test_cgi_header.rb177
-rw-r--r--test/cgi/test_cgi_modruby.rb145
-rw-r--r--test/cgi/test_cgi_multipart.rb322
-rw-r--r--test/cgi/test_cgi_session.rb173
-rw-r--r--test/cgi/test_cgi_tag_helper.rb341
-rw-r--r--test/cgi/testdata/file1.html10
-rw-r--r--test/cgi/testdata/large.pngbin156414 -> 0 bytes-rw-r--r--test/cgi/testdata/small.pngbin82 -> 0 bytes-rw-r--r--test/csv/line_endings.gzbin59 -> 0 bytes-rw-r--r--test/csv/test_csv.rb1753
-rw-r--r--test/csv/test_csv_parsing.rb192
-rw-r--r--test/csv/test_csv_writing.rb97
-rw-r--r--test/csv/test_data_converters.rb261
-rw-r--r--test/csv/test_encodings.rb256
-rw-r--r--test/csv/test_features.rb267
-rw-r--r--test/csv/test_headers.rb288
-rw-r--r--test/csv/test_interface.rb304
-rw-r--r--test/csv/test_row.rb312
-rw-r--r--test/csv/test_serialization.rb156
-rw-r--r--test/csv/test_table.rb408
-rw-r--r--test/csv/ts_all.rb21
-rw-r--r--test/date/test_date.rb144
-rw-r--r--test/date/test_date_arith.rb286
-rw-r--r--test/date/test_date_attr.rb109
-rw-r--r--test/date/test_date_base.rb435
-rw-r--r--test/date/test_date_compat.rb21
-rw-r--r--test/date/test_date_conv.rb137
-rw-r--r--test/date/test_date_marshal.rb29
-rw-r--r--test/date/test_date_new.rb278
-rw-r--r--test/date/test_date_parse.rb973
-rw-r--r--test/date/test_date_strftime.rb388
-rw-r--r--test/date/test_date_strptime.rb469
-rw-r--r--test/dbm/test_dbm.rb94
-rw-r--r--test/digest/test_digest_hmac.rb3
-rw-r--r--test/dl/test_base.rb87
-rw-r--r--test/dl/test_dl2.rb111
-rw-r--r--test/dl/test_func.rb62
-rw-r--r--test/dl/test_import.rb154
-rw-r--r--test/dl/test_win32.rb54
-rw-r--r--test/drb/drbtest.rb45
-rw-r--r--test/drb/test_acl.rb2
-rw-r--r--test/drb/test_drb.rb38
-rw-r--r--test/drb/ut_large.rb2
-rw-r--r--test/drb/ut_safe1.rb2
-rw-r--r--test/drb/ut_timerholder.rb2
-rw-r--r--test/erb/test_erb.rb60
-rw-r--r--test/erb/test_erb_m17n.rb123
-rw-r--r--test/etc/test_etc.rb101
-rw-r--r--test/fileutils/fileasserts.rb39
-rw-r--r--test/fileutils/test_fileutils.rb54
-rw-r--r--test/gdbm/test_gdbm.rb119
-rw-r--r--test/iconv/test_basic.rb7
-rw-r--r--test/iconv/test_option.rb12
-rw-r--r--test/inlinetest.rb55
-rw-r--r--test/io/nonblock/test_flush.rb28
-rw-r--r--test/json/fixtures/fail1.json1
-rw-r--r--test/json/fixtures/fail10.json1
-rw-r--r--test/json/fixtures/fail11.json1
-rw-r--r--test/json/fixtures/fail12.json1
-rw-r--r--test/json/fixtures/fail13.json1
-rw-r--r--test/json/fixtures/fail14.json1
-rw-r--r--test/json/fixtures/fail18.json1
-rw-r--r--test/json/fixtures/fail19.json1
-rw-r--r--test/json/fixtures/fail2.json1
-rw-r--r--test/json/fixtures/fail20.json1
-rw-r--r--test/json/fixtures/fail21.json1
-rw-r--r--test/json/fixtures/fail22.json1
-rw-r--r--test/json/fixtures/fail23.json1
-rw-r--r--test/json/fixtures/fail24.json1
-rw-r--r--test/json/fixtures/fail25.json1
-rw-r--r--test/json/fixtures/fail27.json2
-rw-r--r--test/json/fixtures/fail28.json2
-rw-r--r--test/json/fixtures/fail3.json1
-rw-r--r--test/json/fixtures/fail4.json1
-rw-r--r--test/json/fixtures/fail5.json1
-rw-r--r--test/json/fixtures/fail6.json1
-rw-r--r--test/json/fixtures/fail7.json1
-rw-r--r--test/json/fixtures/fail8.json1
-rw-r--r--test/json/fixtures/fail9.json1
-rw-r--r--test/json/fixtures/pass1.json56
-rw-r--r--test/json/fixtures/pass15.json1
-rw-r--r--test/json/fixtures/pass16.json1
-rw-r--r--test/json/fixtures/pass17.json1
-rw-r--r--test/json/fixtures/pass2.json1
-rw-r--r--test/json/fixtures/pass26.json1
-rw-r--r--test/json/fixtures/pass3.json6
-rwxr-xr-xtest/json/test_json.rb284
-rwxr-xr-xtest/json/test_json_addition.rb157
-rwxr-xr-xtest/json/test_json_fixtures.rb29
-rw-r--r--test/json/test_json_generate.rb99
-rw-r--r--test/json/test_json_rails.rb114
-rwxr-xr-xtest/json/test_json_unicode.rb58
-rw-r--r--test/logger/test_logger.rb6
-rw-r--r--test/matrix/test_matrix.rb10
-rw-r--r--test/matrix/test_vector.rb10
-rw-r--r--test/minitest/test_mini_mock.rb83
-rw-r--r--test/minitest/test_mini_spec.rb169
-rw-r--r--test/minitest/test_mini_test.rb986
-rw-r--r--test/monitor/test_monitor.rb2
-rw-r--r--test/net/http/test_http.rb320
-rw-r--r--test/net/http/test_httpheader.rb2
-rw-r--r--test/net/http/test_https.rb97
-rw-r--r--test/net/http/test_https_proxy.rb2
-rw-r--r--test/net/http/utils.rb96
-rw-r--r--test/net/imap/cacert.pem62
-rw-r--r--test/net/imap/server.crt12
-rw-r--r--test/net/imap/server.key15
-rw-r--r--test/net/imap/test_imap.rb194
-rw-r--r--test/nkf/test_kconv.rb97
-rw-r--r--test/nkf/test_nkf.rb6
-rw-r--r--test/openssl/ssl_server.rb2
-rw-r--r--test/openssl/test_asn1.rb2
-rw-r--r--test/openssl/test_cipher.rb2
-rw-r--r--test/openssl/test_ec.rb4
-rw-r--r--test/openssl/test_pair.rb109
-rw-r--r--test/openssl/test_pkcs7.rb16
-rw-r--r--test/openssl/test_ssl.rb129
-rw-r--r--test/openssl/test_x509cert.rb36
-rw-r--r--test/openssl/test_x509crl.rb6
-rw-r--r--test/openssl/test_x509store.rb4
-rw-r--r--test/openssl/utils.rb6
-rw-r--r--test/optparse/test_noarg.rb12
-rw-r--r--test/optparse/test_optparse.rb2
-rw-r--r--test/optparse/test_placearg.rb8
-rw-r--r--test/optparse/test_reqarg.rb18
-rw-r--r--test/ostruct/test_ostruct.rb28
-rw-r--r--test/pathname/test_pathname.rb138
-rw-r--r--test/rdoc/binary.datbin1024 -> 0 bytes-rw-r--r--test/rdoc/parsers/test_parse_c.rb261
-rw-r--r--test/rdoc/rdoc_markup_to_html_crossref_reference.rb31
-rw-r--r--test/rdoc/test_attribute_manager.rb76
-rw-r--r--test/rdoc/test_rdoc_info_formatting.rb179
-rw-r--r--test/rdoc/test_rdoc_info_sections.rb139
-rw-r--r--test/rdoc/test_rdoc_markup.rb615
-rw-r--r--test/rdoc/test_rdoc_markup_attribute_manager.rb234
-rw-r--r--test/rdoc/test_rdoc_markup_to_html.rb45
-rw-r--r--test/rdoc/test_rdoc_markup_to_html_crossref.rb299
-rw-r--r--test/rdoc/test_rdoc_parser.rb23
-rw-r--r--test/rdoc/test_rdoc_parser_c.rb287
-rw-r--r--test/rdoc/test_rdoc_parser_perl.rb74
-rw-r--r--test/rdoc/test_rdoc_parser_ruby.rb751
-rw-r--r--test/rdoc/test_rdoc_ri_attribute_formatter.rb44
-rw-r--r--test/rdoc/test_rdoc_ri_default_display.rb301
-rw-r--r--test/rdoc/test_rdoc_ri_driver.rb94
-rw-r--r--test/rdoc/test_rdoc_ri_formatter.rb320
-rw-r--r--test/rdoc/test_rdoc_ri_overstrike_formatter.rb71
-rw-r--r--test/readline/test_readline.rb310
-rw-r--r--test/readline/test_readline_history.rb327
-rw-r--r--test/rinda/test_rinda.rb47
-rw-r--r--test/rinda/test_tuplebag.rb172
-rw-r--r--test/ripper/dummyparser.rb571
-rw-r--r--test/ripper/test_files.rb28
-rw-r--r--test/ripper/test_filter.rb54
-rw-r--r--test/ripper/test_parser_events.rb498
-rw-r--r--test/ripper/test_scanner_events.rb807
-rw-r--r--test/rss/rss-assertions.rb84
-rw-r--r--test/rss/rss-testcase.rb10
-rw-r--r--test/rss/test_1.0.rb90
-rw-r--r--test/rss/test_2.0.rb60
-rw-r--r--test/rss/test_accessor.rb32
-rw-r--r--test/rss/test_atom.rb4
-rw-r--r--test/rss/test_content.rb8
-rw-r--r--test/rss/test_maker_0.9.rb51
-rw-r--r--test/rss/test_maker_1.0.rb76
-rw-r--r--test/rss/test_maker_2.0.rb118
-rw-r--r--test/rss/test_maker_atom_entry.rb26
-rw-r--r--test/rss/test_maker_atom_feed.rb65
-rw-r--r--test/rss/test_maker_content.rb2
-rw-r--r--test/rss/test_maker_dc.rb13
-rw-r--r--test/rss/test_maker_image.rb4
-rw-r--r--test/rss/test_maker_itunes.rb2
-rw-r--r--test/rss/test_maker_sy.rb4
-rw-r--r--test/rss/test_maker_taxo.rb6
-rw-r--r--test/rss/test_maker_trackback.rb2
-rw-r--r--test/rss/test_maker_xml-stylesheet.rb6
-rw-r--r--test/rss/test_parser_1.0.rb19
-rw-r--r--test/rss/test_setup_maker_0.9.rb24
-rw-r--r--test/rss/test_setup_maker_1.0.rb84
-rw-r--r--test/rss/test_setup_maker_2.0.rb42
-rw-r--r--test/rss/test_setup_maker_atom_feed.rb2
-rw-r--r--test/rss/test_syndication.rb36
-rw-r--r--test/rss/test_taxonomy.rb14
-rw-r--r--test/rss/test_to_s.rb56
-rw-r--r--test/rss/test_trackback.rb28
-rw-r--r--test/rss/test_version.rb2
-rw-r--r--test/rss/test_xml-stylesheet.rb12
-rw-r--r--test/ruby/allpairs.rb103
-rw-r--r--test/ruby/beginmainend.rb2
-rw-r--r--test/ruby/enc/test_big5.rb28
-rw-r--r--test/ruby/enc/test_cp949.rb28
-rw-r--r--test/ruby/enc/test_euc_jp.rb24
-rw-r--r--test/ruby/enc/test_euc_kr.rb28
-rw-r--r--test/ruby/enc/test_euc_tw.rb28
-rw-r--r--test/ruby/enc/test_gb18030.rb125
-rw-r--r--test/ruby/enc/test_gbk.rb28
-rw-r--r--test/ruby/enc/test_iso_8859.rb163
-rw-r--r--test/ruby/enc/test_koi8.rb22
-rw-r--r--test/ruby/enc/test_shift_jis.rb27
-rw-r--r--test/ruby/enc/test_utf16.rb384
-rw-r--r--test/ruby/enc/test_utf32.rb93
-rw-r--r--test/ruby/enc/test_windows_1251.rb16
-rw-r--r--test/ruby/endblockwarn.rb (renamed from test/ruby/endblockwarn_rb)0
-rw-r--r--test/ruby/envutil.rb154
-rw-r--r--test/ruby/lbtest.rb48
-rw-r--r--test/ruby/marshaltestlib.rb50
-rw-r--r--test/ruby/sentence.rb668
-rw-r--r--test/ruby/suicide.rb2
-rw-r--r--test/ruby/test_alias.rb64
-rw-r--r--test/ruby/test_argf.rb700
-rw-r--r--test/ruby/test_array.rb543
-rw-r--r--test/ruby/test_assignment.rb702
-rw-r--r--test/ruby/test_basicinstructions.rb628
-rw-r--r--test/ruby/test_beginendblock.rb59
-rw-r--r--test/ruby/test_bignum.rb324
-rw-r--r--test/ruby/test_call.rb4
-rw-r--r--test/ruby/test_case.rb11
-rw-r--r--test/ruby/test_class.rb147
-rw-r--r--test/ruby/test_clone.rb2
-rw-r--r--test/ruby/test_comparable.rb66
-rw-r--r--test/ruby/test_complex.rb1081
-rw-r--r--test/ruby/test_complex2.rb735
-rw-r--r--test/ruby/test_complexrational.rb407
-rw-r--r--test/ruby/test_const.rb27
-rw-r--r--test/ruby/test_continuation.rb81
-rw-r--r--test/ruby/test_defined.rb42
-rw-r--r--test/ruby/test_dir.rb150
-rw-r--r--test/ruby/test_econv.rb889
-rw-r--r--test/ruby/test_encoding.rb71
-rw-r--r--test/ruby/test_enum.rb60
-rw-r--r--test/ruby/test_enumerator.rb39
-rw-r--r--test/ruby/test_env.rb303
-rw-r--r--test/ruby/test_eval.rb326
-rw-r--r--test/ruby/test_exception.rb62
-rw-r--r--test/ruby/test_fiber.rb182
-rw-r--r--test/ruby/test_file.rb160
-rw-r--r--test/ruby/test_file_exhaustive.rb753
-rw-r--r--test/ruby/test_fixnum.rb206
-rw-r--r--test/ruby/test_float.rb353
-rw-r--r--test/ruby/test_fnmatch.rb104
-rw-r--r--test/ruby/test_gc.rb24
-rw-r--r--test/ruby/test_hash.rb289
-rw-r--r--test/ruby/test_integer.rb700
-rw-r--r--test/ruby/test_integer_comb.rb620
-rw-r--r--test/ruby/test_io.rb1437
-rw-r--r--test/ruby/test_io_m17n.rb1709
-rw-r--r--test/ruby/test_iterator.rb110
-rw-r--r--test/ruby/test_lambda.rb68
-rw-r--r--test/ruby/test_literal.rb241
-rw-r--r--test/ruby/test_m17n.rb1322
-rw-r--r--test/ruby/test_m17n_comb.rb1634
-rw-r--r--test/ruby/test_marshal.rb171
-rw-r--r--test/ruby/test_math.rb240
-rw-r--r--test/ruby/test_metaclass.rb167
-rw-r--r--test/ruby/test_method.rb261
-rw-r--r--test/ruby/test_mixed_unicode_escapes.rb25
-rw-r--r--test/ruby/test_module.rb724
-rw-r--r--test/ruby/test_notimp.rb64
-rw-r--r--test/ruby/test_numeric.rb221
-rw-r--r--test/ruby/test_object.rb416
-rw-r--r--test/ruby/test_objectspace.rb31
-rw-r--r--test/ruby/test_optimization.rb140
-rw-r--r--test/ruby/test_pack.rb410
-rw-r--r--test/ruby/test_parse.rb826
-rw-r--r--test/ruby/test_path.rb29
-rw-r--r--test/ruby/test_pipe.rb4
-rw-r--r--test/ruby/test_primitive.rb397
-rw-r--r--test/ruby/test_proc.rb690
-rw-r--r--test/ruby/test_process.rb1129
-rw-r--r--test/ruby/test_rand.rb192
-rw-r--r--test/ruby/test_range.rb262
-rw-r--r--test/ruby/test_rational.rb1029
-rw-r--r--test/ruby/test_rational2.rb1386
-rw-r--r--test/ruby/test_readpartial.rb14
-rw-r--r--test/ruby/test_regexp.rb767
-rw-r--r--test/ruby/test_require.rb247
-rw-r--r--test/ruby/test_rubyoptions.rb294
-rw-r--r--test/ruby/test_settracefunc.rb299
-rw-r--r--test/ruby/test_signal.rb138
-rw-r--r--test/ruby/test_sleep.rb3
-rw-r--r--test/ruby/test_sprintf.rb282
-rw-r--r--test/ruby/test_sprintf_comb.rb553
-rw-r--r--test/ruby/test_string.rb1777
-rw-r--r--test/ruby/test_stringchar.rb10
-rw-r--r--test/ruby/test_struct.rb191
-rw-r--r--test/ruby/test_super.rb14
-rw-r--r--test/ruby/test_symbol.rb45
-rw-r--r--test/ruby/test_system.rb106
-rw-r--r--test/ruby/test_thread.rb529
-rw-r--r--test/ruby/test_time.rb451
-rw-r--r--test/ruby/test_trace.rb34
-rw-r--r--test/ruby/test_transcode.rb1807
-rw-r--r--test/ruby/test_unicode_escape.rb267
-rw-r--r--test/ruby/test_variable.rb39
-rw-r--r--test/ruby/test_whileuntil.rb111
-rw-r--r--test/ruby/test_yield.rb366
-rw-r--r--test/ruby/ut_eof.rb12
-rw-r--r--test/rubygems/bogussources.rb8
-rw-r--r--test/rubygems/data/gem-private_key.pem27
-rw-r--r--test/rubygems/data/gem-public_cert.pem20
-rw-r--r--test/rubygems/fake_certlib/openssl.rb7
-rw-r--r--test/rubygems/functional.rb99
-rw-r--r--test/rubygems/gem_installer_test_case.rb97
-rw-r--r--test/rubygems/gem_package_tar_test_case.rb132
-rw-r--r--test/rubygems/gemutilities.rb580
-rw-r--r--test/rubygems/insure_session.rb51
-rw-r--r--test/rubygems/mockgemui.rb64
-rw-r--r--test/rubygems/private_key.pem27
-rw-r--r--test/rubygems/public_cert.pem20
-rw-r--r--test/rubygems/rubygems_plugin.rb16
-rw-r--r--test/rubygems/simple_gem.rb72
-rw-r--r--test/rubygems/test_config.rb19
-rw-r--r--test/rubygems/test_gem.rb673
-rw-r--r--test/rubygems/test_gem_builder.rb33
-rw-r--r--test/rubygems/test_gem_command.rb185
-rw-r--r--test/rubygems/test_gem_command_manager.rb199
-rw-r--r--test/rubygems/test_gem_commands_build_command.rb74
-rw-r--r--test/rubygems/test_gem_commands_cert_command.rb125
-rw-r--r--test/rubygems/test_gem_commands_check_command.rb24
-rw-r--r--test/rubygems/test_gem_commands_contents_command.rb154
-rw-r--r--test/rubygems/test_gem_commands_dependency_command.rb226
-rw-r--r--test/rubygems/test_gem_commands_environment_command.rb133
-rw-r--r--test/rubygems/test_gem_commands_fetch_command.rb54
-rw-r--r--test/rubygems/test_gem_commands_generate_index_command.rb135
-rw-r--r--test/rubygems/test_gem_commands_install_command.rb264
-rw-r--r--test/rubygems/test_gem_commands_list_command.rb36
-rw-r--r--test/rubygems/test_gem_commands_lock_command.rb68
-rw-r--r--test/rubygems/test_gem_commands_mirror_command.rb60
-rw-r--r--test/rubygems/test_gem_commands_outdated_command.rb42
-rw-r--r--test/rubygems/test_gem_commands_pristine_command.rb108
-rw-r--r--test/rubygems/test_gem_commands_query_command.rb432
-rw-r--r--test/rubygems/test_gem_commands_server_command.rb52
-rw-r--r--test/rubygems/test_gem_commands_sources_command.rb278
-rw-r--r--test/rubygems/test_gem_commands_specification_command.rb140
-rw-r--r--test/rubygems/test_gem_commands_stale_command.rb38
-rw-r--r--test/rubygems/test_gem_commands_uninstall_command.rb62
-rw-r--r--test/rubygems/test_gem_commands_unpack_command.rb115
-rw-r--r--test/rubygems/test_gem_commands_update_command.rb169
-rw-r--r--test/rubygems/test_gem_config_file.rb279
-rw-r--r--test/rubygems/test_gem_dependency.rb190
-rw-r--r--test/rubygems/test_gem_dependency_installer.rb651
-rw-r--r--test/rubygems/test_gem_dependency_list.rb209
-rwxr-xr-xtest/rubygems/test_gem_digest.rb46
-rw-r--r--test/rubygems/test_gem_doc_manager.rb37
-rw-r--r--test/rubygems/test_gem_ext_configure_builder.rb84
-rw-r--r--test/rubygems/test_gem_ext_ext_conf_builder.rb127
-rw-r--r--test/rubygems/test_gem_ext_rake_builder.rb81
-rw-r--r--test/rubygems/test_gem_format.rb67
-rw-r--r--test/rubygems/test_gem_gem_path_searcher.rb67
-rw-r--r--test/rubygems/test_gem_gem_runner.rb45
-rw-r--r--test/rubygems/test_gem_indexer.rb641
-rw-r--r--test/rubygems/test_gem_install_update_options.rb74
-rw-r--r--test/rubygems/test_gem_installer.rb917
-rw-r--r--test/rubygems/test_gem_local_remote_options.rb97
-rw-r--r--test/rubygems/test_gem_package_tar_header.rb137
-rw-r--r--test/rubygems/test_gem_package_tar_input.rb119
-rw-r--r--test/rubygems/test_gem_package_tar_output.rb104
-rw-r--r--test/rubygems/test_gem_package_tar_reader.rb53
-rw-r--r--test/rubygems/test_gem_package_tar_reader_entry.rb116
-rw-r--r--test/rubygems/test_gem_package_tar_writer.rb151
-rw-r--r--test/rubygems/test_gem_package_task.rb70
-rw-r--r--test/rubygems/test_gem_platform.rb245
-rw-r--r--test/rubygems/test_gem_remote_fetcher.rb730
-rw-r--r--test/rubygems/test_gem_requirement.rb222
-rw-r--r--test/rubygems/test_gem_server.rb310
-rw-r--r--test/rubygems/test_gem_source_index.rb469
-rw-r--r--test/rubygems/test_gem_source_info_cache.rb447
-rw-r--r--test/rubygems/test_gem_source_info_cache_entry.rb78
-rw-r--r--test/rubygems/test_gem_spec_fetcher.rb384
-rw-r--r--test/rubygems/test_gem_specification.rb1257
-rw-r--r--test/rubygems/test_gem_stream_ui.rb116
-rw-r--r--test/rubygems/test_gem_uninstaller.rb147
-rw-r--r--test/rubygems/test_gem_validator.rb69
-rw-r--r--test/rubygems/test_gem_version.rb316
-rw-r--r--test/rubygems/test_gem_version_option.rb89
-rw-r--r--test/rubygems/test_kernel.rb65
-rw-r--r--test/runner.rb26
-rw-r--r--test/scanf/data.txt6
-rw-r--r--test/scanf/test_scanf.rb320
-rw-r--r--test/scanf/test_scanfblocks.rb81
-rw-r--r--test/scanf/test_scanfio.rb19
-rw-r--r--test/sdbm/test_sdbm.rb92
-rw-r--r--test/soap/asp.net/hello.wsdl96
-rw-r--r--test/soap/asp.net/test_aspdotnet.rb111
-rw-r--r--test/soap/calc/calc.rb17
-rw-r--r--test/soap/calc/calc2.rb29
-rw-r--r--test/soap/calc/server.cgi13
-rw-r--r--test/soap/calc/server.rb17
-rw-r--r--test/soap/calc/server2.rb20
-rw-r--r--test/soap/calc/test_calc.rb49
-rw-r--r--test/soap/calc/test_calc2.rb53
-rw-r--r--test/soap/calc/test_calc_cgi.rb69
-rw-r--r--test/soap/fault/test_customfault.rb58
-rw-r--r--test/soap/header/server.cgi119
-rw-r--r--test/soap/header/test_authheader.rb240
-rw-r--r--test/soap/header/test_authheader_cgi.rb121
-rw-r--r--test/soap/header/test_simplehandler.rb116
-rw-r--r--test/soap/helloworld/hw_s.rb16
-rw-r--r--test/soap/helloworld/test_helloworld.rb40
-rw-r--r--test/soap/marshal/test_digraph.rb56
-rw-r--r--test/soap/marshal/test_marshal.rb26
-rw-r--r--test/soap/marshal/test_struct.rb47
-rw-r--r--test/soap/ssl/README1
-rw-r--r--test/soap/ssl/ca.cert23
-rw-r--r--test/soap/ssl/client.cert19
-rw-r--r--test/soap/ssl/client.key15
-rw-r--r--test/soap/ssl/server.cert19
-rw-r--r--test/soap/ssl/server.key15
-rw-r--r--test/soap/ssl/sslsvr.rb57
-rw-r--r--test/soap/ssl/subca.cert21
-rw-r--r--test/soap/ssl/test_ssl.rb204
-rw-r--r--test/soap/struct/test_struct.rb77
-rw-r--r--test/soap/swa/test_file.rb73
-rw-r--r--test/soap/test_basetype.rb970
-rw-r--r--test/soap/test_envelopenamespace.rb92
-rw-r--r--test/soap/test_httpconfigloader.rb39
-rw-r--r--test/soap/test_mapping.rb59
-rw-r--r--test/soap/test_no_indent.rb86
-rw-r--r--test/soap/test_property.rb424
-rw-r--r--test/soap/test_soapelement.rb122
-rw-r--r--test/soap/test_streamhandler.rb209
-rw-r--r--test/soap/test_styleuse.rb333
-rw-r--r--test/soap/wsdlDriver/README.txt2
-rw-r--r--test/soap/wsdlDriver/calc.wsdl126
-rw-r--r--test/soap/wsdlDriver/document.wsdl54
-rw-r--r--test/soap/wsdlDriver/echo_version.rb20
-rw-r--r--test/soap/wsdlDriver/simpletype.wsdl63
-rw-r--r--test/soap/wsdlDriver/test_calc.rb100
-rw-r--r--test/soap/wsdlDriver/test_document.rb78
-rw-r--r--test/soap/wsdlDriver/test_simpletype.rb87
-rw-r--r--test/socket/test_addrinfo.rb615
-rw-r--r--test/socket/test_ancdata.rb66
-rw-r--r--test/socket/test_basicsocket.rb88
-rw-r--r--test/socket/test_nonblock.rb123
-rw-r--r--test/socket/test_socket.rb418
-rw-r--r--test/socket/test_sockopt.rb33
-rw-r--r--test/socket/test_tcp.rb42
-rw-r--r--test/socket/test_udp.rb39
-rw-r--r--test/socket/test_unix.rb337
-rw-r--r--test/stringio/test_stringio.rb397
-rw-r--r--test/strscan/test_stringscanner.rb194
-rw-r--r--test/test_delegate.rb32
-rw-r--r--test/test_ipaddr.rb4
-rw-r--r--test/test_open3.rb243
-rw-r--r--test/test_pp.rb180
-rw-r--r--test/test_prettyprint.rb515
-rw-r--r--test/test_prime.rb146
-rw-r--r--test/test_pstore.rb74
-rw-r--r--test/test_pty.rb109
-rw-r--r--test/test_set.rb4
-rw-r--r--test/test_shellwords.rb39
-rw-r--r--test/test_singleton.rb15
-rw-r--r--test/test_syslog.rb166
-rw-r--r--test/test_tempfile.rb35
-rw-r--r--test/test_time.rb389
-rw-r--r--test/test_timeout.rb26
-rw-r--r--test/test_tsort.rb44
-rw-r--r--test/testunit/collector/test_dir.rb406
-rw-r--r--test/testunit/collector/test_objectspace.rb98
-rw-r--r--test/testunit/runit/test_assert.rb402
-rw-r--r--test/testunit/runit/test_testcase.rb91
-rw-r--r--test/testunit/runit/test_testresult.rb144
-rw-r--r--test/testunit/runit/test_testsuite.rb49
-rw-r--r--test/testunit/test_assertions.rb528
-rw-r--r--test/testunit/test_error.rb26
-rw-r--r--test/testunit/test_failure.rb33
-rw-r--r--test/testunit/test_testcase.rb275
-rw-r--r--test/testunit/test_testresult.rb104
-rw-r--r--test/testunit/test_testsuite.rb129
-rw-r--r--test/testunit/util/test_backtracefilter.rb41
-rw-r--r--test/testunit/util/test_observable.rb102
-rw-r--r--test/testunit/util/test_procwrapper.rb36
-rwxr-xr-xtest/thread/lbtest.rb51
-rw-r--r--test/thread/test_thread.rb81
-rw-r--r--test/uri/test_common.rb14
-rw-r--r--test/uri/test_ftp.rb16
-rw-r--r--test/uri/test_generic.rb64
-rw-r--r--test/uri/test_http.rb4
-rw-r--r--test/uri/test_ldap.rb26
-rw-r--r--test/uri/test_mailto.rb26
-rw-r--r--test/uri/test_parser.rb41
-rw-r--r--test/webrick/test_cgi.rb66
-rw-r--r--test/webrick/test_filehandler.rb68
-rw-r--r--test/webrick/test_httpauth.rb24
-rw-r--r--test/webrick/test_httpproxy.rb281
-rw-r--r--test/webrick/test_httprequest.rb83
-rw-r--r--test/webrick/test_httpserver.rb26
-rw-r--r--test/webrick/test_httputils.rb36
-rw-r--r--test/webrick/test_server.rb20
-rw-r--r--test/webrick/test_utils.rb64
-rw-r--r--test/webrick/utils.rb23
-rw-r--r--test/win32ole/err_in_callback.rb9
-rw-r--r--test/win32ole/orig_data.csv5
-rw-r--r--test/win32ole/test_err_in_callback.rb44
-rw-r--r--test/win32ole/test_folderitem2_invokeverb.rb89
-rw-r--r--test/win32ole/test_nil2vtempty.rb36
-rw-r--r--test/win32ole/test_ole_methods.rb36
-rw-r--r--test/win32ole/test_propertyputref.rb30
-rw-r--r--test/win32ole/test_win32ole.rb509
-rw-r--r--test/win32ole/test_win32ole_event.rb334
-rw-r--r--test/win32ole/test_win32ole_method.rb141
-rw-r--r--test/win32ole/test_win32ole_param.rb91
-rw-r--r--test/win32ole/test_win32ole_type.rb249
-rw-r--r--test/win32ole/test_win32ole_typelib.rb110
-rw-r--r--test/win32ole/test_win32ole_variable.rb61
-rw-r--r--test/win32ole/test_win32ole_variant.rb650
-rw-r--r--test/win32ole/test_win32ole_variant_m.rb35
-rw-r--r--test/win32ole/test_win32ole_variant_outarg.rb69
-rw-r--r--test/win32ole/test_word.rb72
-rw-r--r--test/wsdl/any/any.wsdl50
-rw-r--r--test/wsdl/any/expectedDriver.rb54
-rw-r--r--test/wsdl/any/expectedEcho.rb14
-rw-r--r--test/wsdl/any/expectedService.rb52
-rw-r--r--test/wsdl/any/test_any.rb58
-rw-r--r--test/wsdl/axisArray/axisArray.wsdl60
-rw-r--r--test/wsdl/axisArray/itemList.rb27
-rw-r--r--test/wsdl/axisArray/test_axisarray.rb69
-rw-r--r--test/wsdl/datetime/DatetimeService.rb44
-rw-r--r--test/wsdl/datetime/datetime.rb (renamed from test/rubygems/foo/discover.rb)0
-rw-r--r--test/wsdl/datetime/datetime.wsdl45
-rw-r--r--test/wsdl/datetime/datetimeServant.rb21
-rw-r--r--test/wsdl/datetime/test_datetime.rb82
-rw-r--r--test/wsdl/document/document.wsdl74
-rw-r--r--test/wsdl/document/echo.rb92
-rw-r--r--test/wsdl/document/number.wsdl54
-rw-r--r--test/wsdl/document/ping_nosoapaction.wsdl66
-rw-r--r--test/wsdl/document/test_nosoapaction.rb109
-rw-r--r--test/wsdl/document/test_number.rb99
-rw-r--r--test/wsdl/document/test_rpc.rb177
-rw-r--r--test/wsdl/emptycomplextype.wsdl31
-rw-r--r--test/wsdl/map/map.wsdl92
-rw-r--r--test/wsdl/map/map.xml43
-rw-r--r--test/wsdl/map/test_map.rb99
-rw-r--r--test/wsdl/marshal/person.wsdl21
-rw-r--r--test/wsdl/marshal/person_org.rb22
-rw-r--r--test/wsdl/marshal/test_wsdlmarshal.rb80
-rw-r--r--test/wsdl/multiplefault.wsdl68
-rw-r--r--test/wsdl/qualified/lp.rb0
-rw-r--r--test/wsdl/qualified/lp.wsdl47
-rw-r--r--test/wsdl/qualified/lp.xsd26
-rw-r--r--test/wsdl/qualified/np.wsdl50
-rw-r--r--test/wsdl/qualified/test_qualified.rb154
-rw-r--r--test/wsdl/qualified/test_unqualified.rb143
-rw-r--r--test/wsdl/raa/RAA.rb243
-rw-r--r--test/wsdl/raa/RAAServant.rb99
-rw-r--r--test/wsdl/raa/RAAService.rb100
-rw-r--r--test/wsdl/raa/README.txt8
-rw-r--r--test/wsdl/raa/raa.wsdl264
-rw-r--r--test/wsdl/raa/server.rb103
-rw-r--r--test/wsdl/raa/test_raa.rb71
-rw-r--r--test/wsdl/ref/expectedProduct.rb90
-rw-r--r--test/wsdl/ref/product.wsdl86
-rw-r--r--test/wsdl/ref/test_ref.rb54
-rw-r--r--test/wsdl/rpc/echoDriver.rb55
-rw-r--r--test/wsdl/rpc/echo_serviceClient.rb23
-rw-r--r--test/wsdl/rpc/rpc.wsdl75
-rw-r--r--test/wsdl/rpc/test-rpc-lit.wsdl364
-rw-r--r--test/wsdl/rpc/test-rpc-lit12.wsdl455
-rw-r--r--test/wsdl/rpc/test_rpc.rb118
-rw-r--r--test/wsdl/rpc/test_rpc_lit.rb399
-rw-r--r--test/wsdl/simpletype/rpc/expectedClient.rb34
-rw-r--r--test/wsdl/simpletype/rpc/expectedDriver.rb62
-rw-r--r--test/wsdl/simpletype/rpc/expectedEchoVersion.rb23
-rw-r--r--test/wsdl/simpletype/rpc/expectedServant.rb32
-rw-r--r--test/wsdl/simpletype/rpc/expectedService.rb60
-rw-r--r--test/wsdl/simpletype/rpc/rpc.wsdl80
-rw-r--r--test/wsdl/simpletype/rpc/test_rpc.rb62
-rw-r--r--test/wsdl/simpletype/simpletype.wsdl95
-rw-r--r--test/wsdl/simpletype/test_simpletype.rb99
-rw-r--r--test/wsdl/soap/soapbodyparts.wsdl103
-rw-r--r--test/wsdl/soap/test_soapbodyparts.rb79
-rw-r--r--test/wsdl/test_emptycomplextype.rb21
-rw-r--r--test/wsdl/test_fault.rb51
-rw-r--r--test/wsdl/test_multiplefault.rb39
-rw-r--r--test/xmlrpc/test_datetime.rb64
-rw-r--r--test/xmlrpc/test_features.rb6
-rw-r--r--test/xmlrpc/test_marshal.rb6
-rw-r--r--test/xmlrpc/test_parser.rb12
-rw-r--r--test/xmlrpc/test_webrick_server.rb10
-rw-r--r--test/xmlrpc/webrick_testing.rb13
-rw-r--r--test/xsd/codegen/test_classdef.rb214
-rw-r--r--test/xsd/noencoding.xml4
-rw-r--r--test/xsd/test_noencoding.rb32
-rw-r--r--test/xsd/test_xmlschemaparser.rb22
-rw-r--r--test/xsd/test_xsd.rb1511
-rw-r--r--test/xsd/xmlschema.xml12
-rw-r--r--test/yaml/test_yaml.rb120
-rw-r--r--test/yaml/test_yamlstore.rb12
-rw-r--r--test/zlib/test_zlib.rb643
-rw-r--r--thread.c4084
-rw-r--r--thread_pthread.c857
-rw-r--r--thread_pthread.h24
-rw-r--r--thread_win32.c573
-rw-r--r--thread_win32.h33
-rw-r--r--time.c3784
-rw-r--r--timev.h19
-rwxr-xr-xtool/asm_parse.rb51
-rwxr-xr-xtool/build-transcode16
-rwxr-xr-xtool/compile_prelude.rb96
-rwxr-xr-xtool/config.guess1532
-rwxr-xr-xtool/config.sub1658
-rwxr-xr-xtool/eval.rb161
-rw-r--r--tool/file2lastrev.rb92
-rwxr-xr-xtool/generic_erb.rb34
-rwxr-xr-xtool/ifchange48
-rwxr-xr-xtool/insns2vm.rb15
-rw-r--r--tool/instruction.rb1393
-rwxr-xr-xtool/make-snapshot218
-rwxr-xr-xtool/mdoc2man.rb465
-rwxr-xr-xtool/mkconfig.rb226
-rwxr-xr-xtool/node_name.rb4
-rwxr-xr-xtool/parse.rb13
-rwxr-xr-xtool/rbinstall.rb550
-rwxr-xr-xtool/rmdirs11
-rwxr-xr-xtool/rubytest.rb28
-rwxr-xr-xtool/runruby.rb95
-rwxr-xr-xtool/strip-rdoc.rb22
-rwxr-xr-xtool/transcode-tblgen.rb853
-rwxr-xr-xtool/vtlh.rb15
-rwxr-xr-xtool/ytab.sed31
-rw-r--r--transcode.c4211
-rw-r--r--transcode_data.h106
-rw-r--r--util.c565
-rw-r--r--util.h67
-rw-r--r--variable.c1255
-rw-r--r--version.c84
-rw-r--r--version.h73
-rw-r--r--vm.c2088
-rw-r--r--vm_core.h649
-rw-r--r--vm_dump.c613
-rw-r--r--vm_eval.c1520
-rw-r--r--vm_exec.c156
-rw-r--r--vm_exec.h184
-rw-r--r--vm_insnhelper.c1593
-rw-r--r--vm_insnhelper.h195
-rw-r--r--vm_method.c1201
-rw-r--r--vm_opts.h51
-rw-r--r--vms/config.h102
-rw-r--r--vms/vms.h10
-rw-r--r--vms/vmsruby_private.c52
-rw-r--r--vms/vmsruby_private.h7
-rw-r--r--win32/Makefile.sub492
-rw-r--r--win32/README.win3257
-rwxr-xr-xwin32/configure.bat87
-rw-r--r--win32/dir.h12
-rw-r--r--win32/enc-setup.mak10
-rwxr-xr-xwin32/ifchange.bat59
-rwxr-xr-xwin32/mkexports.rb178
-rwxr-xr-xwin32/resource.rb30
-rwxr-xr-xwin32/rm.bat11
-rwxr-xr-xwin32/rmdirs.bat29
-rw-r--r--win32/setup.mak100
-rw-r--r--win32/win32.c2840
-rw-r--r--win32/win32.h556
-rw-r--r--win32/winmain.c4
-rw-r--r--wince/Makefile.sub46
-rw-r--r--wince/README.wince121
-rw-r--r--wince/assert.c11
-rw-r--r--wince/assert.h6
-rwxr-xr-xwince/configure.bat102
-rw-r--r--wince/direct.c54
-rw-r--r--wince/direct.h22
-rw-r--r--wince/errno.c11
-rw-r--r--wince/errno.h55
-rw-r--r--wince/fcntl.h42
-rw-r--r--wince/io.h76
-rw-r--r--wince/io_wce.c230
-rw-r--r--wince/process.h46
-rw-r--r--wince/process_wce.c47
-rw-r--r--wince/setup.mak245
-rw-r--r--wince/signal.h71
-rw-r--r--wince/signal_wce.c26
-rw-r--r--wince/stddef.h5
-rw-r--r--wince/stdio.c36
-rw-r--r--wince/stdlib.c57
-rw-r--r--wince/string_wce.c89
-rw-r--r--wince/sys/stat.c102
-rw-r--r--wince/sys/stat.h68
-rw-r--r--wince/sys/timeb.c25
-rw-r--r--wince/sys/timeb.h26
-rw-r--r--wince/sys/types.h60
-rw-r--r--wince/sys/utime.c44
-rw-r--r--wince/sys/utime.h27
-rw-r--r--wince/time.h63
-rw-r--r--wince/time_wce.c301
-rw-r--r--wince/varargs.h34
-rw-r--r--wince/wince.c583
-rw-r--r--wince/wince.h191
-rw-r--r--wince/wincemain.c19
-rw-r--r--wince/wincon.h7
-rw-r--r--wince/winsock2.c338
-rw-r--r--x68/_dtos18.c250
-rw-r--r--x68/_round.c45
-rw-r--r--x68/fconvert.c81
-rw-r--r--x68/select.c167
2733 files changed, 177511 insertions, 622744 deletions
diff --git a/.cvsignore b/.cvsignore
index 76c9bc0b78..a72211d03f 100644
--- a/.cvsignore
+++ b/.cvsignore
@@ -14,7 +14,6 @@
COPYING.LIB
ChangeLog.pre-alpha
ChangeLog.pre1_1
-ChangeLog-1.8.0
Makefile
README.fat-patch
README.v6
@@ -35,12 +34,9 @@ newdate.rb
newver.rb
parse.c
patches
-patches-master
-pitest.rb
ppack
preview
rbconfig.rb
-rename2.h
repack
riscos
rubicon
diff --git a/.gdbinit b/.gdbinit
deleted file mode 100644
index b153412b44..0000000000
--- a/.gdbinit
+++ /dev/null
@@ -1,654 +0,0 @@
-define rp
- if dummy_gdb_enums.special_consts
- end
- if (VALUE)($arg0) & RUBY_FIXNUM_FLAG
- printf "FIXNUM: %ld\n", (long)($arg0) >> 1
- else
- if ((VALUE)($arg0) & ~(~(VALUE)0<<RUBY_SPECIAL_SHIFT)) == RUBY_SYMBOL_FLAG
- set $id = (($arg0) >> RUBY_SPECIAL_SHIFT)
- if $id == '!' || $id == '+' || $id == '-' || $id == '*' || $id == '/' || $id == '%' || $id == '<' || $id == '>' || $id == '`'
- printf "SYMBOL(:%c)\n", $id
- else
- if $id == idDot2
- echo SYMBOL(:..)\n
- else
- if $id == idDot3
- echo SYMBOL(:...)\n
- else
- if $id == idUPlus
- echo SYMBOL(:+@)\n
- else
- if $id == idUMinus
- echo SYMBOL(:-@)\n
- else
- if $id == idPow
- echo SYMBOL(:**)\n
- else
- if $id == idCmp
- echo SYMBOL(:<=>)\n
- else
- if $id == idLTLT
- echo SYMBOL(:<<)\n
- else
- if $id == idLE
- echo SYMBOL(:<=)\n
- else
- if $id == idGE
- echo SYMBOL(:>=)\n
- else
- if $id == idEq
- echo SYMBOL(:==)\n
- else
- if $id == idEqq
- echo SYMBOL(:===)\n
- else
- if $id == idNeq
- echo SYMBOL(:!=)\n
- else
- if $id == idEqTilde
- echo SYMBOL(:=~)\n
- else
- if $id == idNeqTilde
- echo SYMBOL(:!~)\n
- else
- if $id == idAREF
- echo SYMBOL(:[])\n
- else
- if $id == idASET
- echo SYMBOL(:[]=)\n
- else
- printf "SYMBOL(%ld)\n", $id
- end
- end
- end
- end
- end
- end
- end
- end
- end
- end
- end
- end
- end
- end
- end
- end
- end
- else
- if ($arg0) == RUBY_Qfalse
- echo false\n
- else
- if ($arg0) == RUBY_Qtrue
- echo true\n
- else
- if ($arg0) == RUBY_Qnil
- echo nil\n
- else
- if ($arg0) == RUBY_Qundef
- echo undef\n
- else
- if (VALUE)($arg0) & RUBY_IMMEDIATE_MASK
- echo immediate\n
- else
- set $flags = ((struct RBasic*)($arg0))->flags
- if ($flags & RUBY_T_MASK) == RUBY_T_NONE
- printf "T_NONE: "
- print (struct RBasic *)($arg0)
- else
- if ($flags & RUBY_T_MASK) == RUBY_T_NIL
- printf "T_NIL: "
- print (struct RBasic *)($arg0)
- else
- if ($flags & RUBY_T_MASK) == RUBY_T_OBJECT
- printf "T_OBJECT: "
- print (struct RObject *)($arg0)
- else
- if ($flags & RUBY_T_MASK) == RUBY_T_CLASS
- printf "T_CLASS: "
- print (struct RClass *)($arg0)
- else
- if ($flags & RUBY_T_MASK) == RUBY_T_ICLASS
- printf "T_ICLASS: "
- print (struct RClass *)($arg0)
- else
- if ($flags & RUBY_T_MASK) == RUBY_T_MODULE
- printf "T_MODULE: "
- print (struct RClass *)($arg0)
- else
- if ($flags & RUBY_T_MASK) == RUBY_T_FLOAT
- printf "T_FLOAT: %.16g ", (((struct RFloat*)($arg0))->float_value)
- print (struct RFloat *)($arg0)
- else
- if ($flags & RUBY_T_MASK) == RUBY_T_STRING
- printf "T_STRING: "
- set print address off
- output (char *)(($flags & RUBY_FL_USER1) ? \
- ((struct RString*)($arg0))->as.heap.ptr : \
- ((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 !($flags & RUBY_FL_USER1)
- printf "(embed) "
- else
- if ($flags & RUBY_FL_USER2)
- printf "(shared) "
- end
- if ($flags & RUBY_FL_USER3)
- printf "(assoc) "
- end
- end
- printf "encoding:%d ", ($flags & RUBY_ENCODING_MASK) >> RUBY_ENCODING_SHIFT
- if ($flags & RUBY_ENC_CODERANGE_MASK) == 0
- printf "coderange:unknown "
- else
- if ($flags & RUBY_ENC_CODERANGE_MASK) == RUBY_ENC_CODERANGE_7BIT
- printf "coderange:7bit "
- else
- if ($flags & RUBY_ENC_CODERANGE_MASK) == RUBY_ENC_CODERANGE_VALID
- printf "coderange:valid "
- else
- printf "coderange:broken "
- end
- end
- end
- print (struct RString *)($arg0)
- else
- if ($flags & RUBY_T_MASK) == RUBY_T_REGEXP
- set $regsrc = ((struct RRegexp*)($arg0))->src
- set $rsflags = ((struct RBasic*)$regsrc)->flags
- printf "T_REGEXP: "
- set print address off
- output (char *)(($rsflags & RUBY_FL_USER1) ? \
- ((struct RString*)$regsrc)->as.heap.ptr : \
- ((struct RString*)$regsrc)->as.ary)
- set print address on
- 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
- if $flags & RUBY_FL_USER5
- printf "(literal) "
- end
- if $flags & RUBY_FL_USER4
- printf "(fixed) "
- end
- printf "encoding:%d ", ($flags & RUBY_ENCODING_MASK) >> RUBY_ENCODING_SHIFT
- print (struct RRegexp *)($arg0)
- else
- if ($flags & RUBY_T_MASK) == RUBY_T_ARRAY
- if ($flags & RUBY_FL_USER1)
- set $len = (($flags & (RUBY_FL_USER3|RUBY_FL_USER4)) >> (RUBY_FL_USHIFT+3))
- printf "T_ARRAY: len=%ld ", $len
- printf "(embed) "
- if ($len == 0)
- printf "{(empty)} "
- else
- output/x *((VALUE*)((struct RArray*)($arg0))->as.ary) @ $len
- printf " "
- end
- else
- set $len = ((struct RArray*)($arg0))->as.heap.len
- printf "T_ARRAY: len=%ld ", $len
- if ($flags & RUBY_FL_USER2)
- printf "(shared) shared="
- output/x ((struct RArray*)($arg0))->as.heap.aux.shared
- printf " "
- else
- printf "(ownership) capa=%ld ", ((struct RArray*)($arg0))->as.heap.aux.capa
- end
- if ($len == 0)
- printf "{(empty)} "
- else
- output/x *((VALUE*)((struct RArray*)($arg0))->as.heap.ptr) @ $len
- printf " "
- end
- end
- print (struct RArray *)($arg0)
- else
- if ($flags & RUBY_T_MASK) == RUBY_T_FIXNUM
- printf "T_FIXNUM: "
- print (struct RBasic *)($arg0)
- else
- if ($flags & RUBY_T_MASK) == RUBY_T_HASH
- printf "T_HASH: ",
- 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
- printf "T_STRUCT: len=%ld ", \
- (($flags & (RUBY_FL_USER1|RUBY_FL_USER2)) ? \
- ($flags & (RUBY_FL_USER1|RUBY_FL_USER2)) >> (RUBY_FL_USHIFT+1) : \
- ((struct RStruct *)($arg0))->as.heap.len)
- print (struct RStruct *)($arg0)
- 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
- printf "T_BIGNUM: sign=%d len=%ld ", \
- (($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 "T_RATIONAL: "
- print (struct RRational *)($arg0)
- else
- if ($flags & RUBY_T_MASK) == RUBY_T_COMPLEX
- printf "T_COMPLEX: "
- print (struct RComplex *)($arg0)
- else
- if ($flags & RUBY_T_MASK) == RUBY_T_FILE
- printf "T_FILE: "
- print (struct RFile *)($arg0)
- output *((struct RFile *)($arg0))->fptr
- printf "\n"
- else
- if ($flags & RUBY_T_MASK) == RUBY_T_TRUE
- printf "T_TRUE: "
- print (struct RBasic *)($arg0)
- else
- if ($flags & RUBY_T_MASK) == RUBY_T_FALSE
- printf "T_FALSE: "
- print (struct RBasic *)($arg0)
- else
- if ($flags & RUBY_T_MASK) == RUBY_T_DATA
- printf "T_DATA: "
- print (struct RData *)($arg0)
- else
- if ($flags & RUBY_T_MASK) == RUBY_T_MATCH
- printf "T_MATCH: "
- print (struct RMatch *)($arg0)
- else
- if ($flags & RUBY_T_MASK) == RUBY_T_SYMBOL
- printf "T_SYMBOL: "
- print (struct RBasic *)($arg0)
- else
- if ($flags & RUBY_T_MASK) == RUBY_T_UNDEF
- printf "T_UNDEF: "
- print (struct RBasic *)($arg0)
- else
- if ($flags & RUBY_T_MASK) == RUBY_T_NODE
- printf "T_NODE("
- output (enum node_type)(($flags&RUBY_NODE_TYPEMASK)>>RUBY_NODE_TYPESHIFT)
- printf "): "
- print *(NODE *)($arg0)
- else
- if ($flags & RUBY_T_MASK) == RUBY_T_ZOMBIE
- printf "T_ZOMBIE: "
- print (struct RData *)($arg0)
- else
- printf "unknown: "
- print (struct RBasic *)($arg0)
- end
- end
- end
- end
- end
- end
- end
- end
- end
- end
- end
- end
- end
- end
- end
- end
- end
- end
- end
- end
- end
- end
- end
- end
- end
- end
- end
- end
- end
- end
- end
- end
-end
-document rp
- Print a Ruby's VALUE.
-end
-
-define nd_type
- print (enum node_type)((((NODE*)($arg0))->flags&RUBY_NODE_TYPEMASK)>>RUBY_NODE_TYPESHIFT)
-end
-document nd_type
- Print a Ruby' node type.
-end
-
-define nd_file
- print ((NODE*)($arg0))->nd_file
-end
-document nd_file
- Print the source file name of a node.
-end
-
-define nd_line
- print ((unsigned int)((((NODE*)($arg0))->flags>>RUBY_NODE_LSHIFT)&RUBY_NODE_LMASK))
-end
-document nd_line
- Print the source line number of a node.
-end
-
-# Print members of ruby node.
-
-define nd_head
- printf "u1.node: "
- rp ($arg0).u1.node
-end
-
-define nd_alen
- printf "u2.argc: "
- p ($arg0).u2.argc
-end
-
-define nd_next
- printf "u3.node: "
- rp ($arg0).u3.node
-end
-
-
-define nd_cond
- printf "u1.node: "
- rp ($arg0).u1.node
-end
-
-define nd_body
- printf "u2.node: "
- rp ($arg0).u2.node
-end
-
-define nd_else
- printf "u3.node: "
- rp ($arg0).u3.node
-end
-
-
-define nd_orig
- printf "u3.value: "
- rp ($arg0).u3.value
-end
-
-
-define nd_resq
- printf "u2.node: "
- rp ($arg0).u2.node
-end
-
-define nd_ensr
- printf "u3.node: "
- rp ($arg0).u3.node
-end
-
-
-define nd_1st
- printf "u1.node: "
- rp ($arg0).u1.node
-end
-
-define nd_2nd
- printf "u2.node: "
- rp ($arg0).u2.node
-end
-
-
-define nd_stts
- printf "u1.node: "
- rp ($arg0).u1.node
-end
-
-
-define nd_entry
- printf "u3.entry: "
- p ($arg0).u3.entry
-end
-
-define nd_vid
- printf "u1.id: "
- p ($arg0).u1.id
-end
-
-define nd_cflag
- printf "u2.id: "
- p ($arg0).u2.id
-end
-
-define nd_cval
- printf "u3.value: "
- rp ($arg0).u3.value
-end
-
-
-define nd_cnt
- printf "u3.cnt: "
- p ($arg0).u3.cnt
-end
-
-define nd_tbl
- printf "u1.tbl: "
- p ($arg0).u1.tbl
-end
-
-
-define nd_var
- printf "u1.node: "
- rp ($arg0).u1.node
-end
-
-define nd_ibdy
- printf "u2.node: "
- rp ($arg0).u2.node
-end
-
-define nd_iter
- printf "u3.node: "
- rp ($arg0).u3.node
-end
-
-
-define nd_value
- printf "u2.node: "
- rp ($arg0).u2.node
-end
-
-define nd_aid
- printf "u3.id: "
- p ($arg0).u3.id
-end
-
-
-define nd_lit
- printf "u1.value: "
- rp ($arg0).u1.value
-end
-
-
-define nd_frml
- printf "u1.node: "
- rp ($arg0).u1.node
-end
-
-define nd_rest
- printf "u2.argc: "
- p ($arg0).u2.argc
-end
-
-define nd_opt
- printf "u1.node: "
- rp ($arg0).u1.node
-end
-
-
-define nd_recv
- printf "u1.node: "
- rp ($arg0).u1.node
-end
-
-define nd_mid
- printf "u2.id: "
- p ($arg0).u2.id
-end
-
-define nd_args
- printf "u3.node: "
- rp ($arg0).u3.node
-end
-
-
-define nd_noex
- printf "u1.id: "
- p ($arg0).u1.id
-end
-
-define nd_defn
- printf "u3.node: "
- rp ($arg0).u3.node
-end
-
-
-define nd_old
- printf "u1.id: "
- p ($arg0).u1.id
-end
-
-define nd_new
- printf "u2.id: "
- p ($arg0).u2.id
-end
-
-
-define nd_cfnc
- printf "u1.cfunc: "
- p ($arg0).u1.cfunc
-end
-
-define nd_argc
- printf "u2.argc: "
- p ($arg0).u2.argc
-end
-
-
-define nd_cname
- printf "u1.id: "
- p ($arg0).u1.id
-end
-
-define nd_super
- printf "u3.node: "
- rp ($arg0).u3.node
-end
-
-
-define nd_modl
- printf "u1.id: "
- p ($arg0).u1.id
-end
-
-define nd_clss
- printf "u1.value: "
- rp ($arg0).u1.value
-end
-
-
-define nd_beg
- printf "u1.node: "
- rp ($arg0).u1.node
-end
-
-define nd_end
- printf "u2.node: "
- rp ($arg0).u2.node
-end
-
-define nd_state
- printf "u3.state: "
- p ($arg0).u3.state
-end
-
-define nd_rval
- printf "u2.value: "
- rp ($arg0).u2.value
-end
-
-
-define nd_nth
- printf "u2.argc: "
- p ($arg0).u2.argc
-end
-
-
-define nd_tag
- printf "u1.id: "
- p ($arg0).u1.id
-end
-
-define nd_tval
- printf "u2.value: "
- rp ($arg0).u2.value
-end
-
-define rb_p
- call rb_p($arg0)
-end
-
-define rb_id2name
- call rb_id2name($arg0)
-end
-
-define rb_classname
- call classname($arg0)
- rb_p $
- print *(struct RClass*)($arg0)
-end
-
-define rb_backtrace
- call rb_backtrace()
-end
-
-define iseq
- if dummy_gdb_enums.special_consts
- end
- if ($arg0)->type == ISEQ_ELEMENT_NONE
- echo [none]\n
- end
- if ($arg0)->type == ISEQ_ELEMENT_LABEL
- print *(LABEL*)($arg0)
- end
- if ($arg0)->type == ISEQ_ELEMENT_INSN
- print *(INSN*)($arg0)
- if ((INSN*)($arg0))->insn_id != YARVINSN_jump
- set $i = 0
- set $operand_size = ((INSN*)($arg0))->operand_size
- set $operands = ((INSN*)($arg0))->operands
- while $i < $operand_size
- rp $operands[$i++]
- end
- end
- end
- if ($arg0)->type == ISEQ_ELEMENT_ADJUST
- print *(ADJUST*)($arg0)
- end
-end
diff --git a/.gitignore b/.gitignore
deleted file mode 100644
index ff509d4ffc..0000000000
--- a/.gitignore
+++ /dev/null
@@ -1,399 +0,0 @@
-# /
-*.bak
-*.dylib
-*.inc
-*.orig
-*.rej
-*.sav
-*.swp
-*~
-.*-*
-.*.list
-.*.time
-.DS_Store
-.ccmalloc
-.ext
-.pc
-.ppack
-.svn
-/.git
-/*_prelude.c
-/COPYING.LIB
-/ChangeLog-1.8.0
-/ChangeLog.pre-alpha
-/ChangeLog.pre1_1
-/Doxyfile
-/GNUmakefile
-/Makefile
-/README.atheos
-/README.fat-patch
-/README.v6
-/TAGS
-/archive
-/autom4te*.cache
-/automake
-/beos
-/breakpoints.gdb
-/config.cache
-/config.h
-/config.h.in
-/config.log
-/config.status
-/config.status.lineno
-/configure
-/enc.mk
-/enc/trans/*.c
-/encdb.h
-/ext/win32ole/.document
-/largefile.h
-/lex.c
-/libruby*.*
-/miniprelude.c
-/miniruby
-/newdate.rb
-/newline.c
-/newver.rb
-/parse.c
-/parse.h
-/patches
-/patches-master
-/pitest.rb
-/ppack
-/prelude.c
-/preview
-/rbconfig.rb
-/rename2.h
-/repack
-/revision.h
-/riscos
-/rubicon
-/ruby
-/ruby-man.rd.gz
-/test.rb
-/tmp
-/transdb.h
-/uncommon.mk
-/web
-/y.output
-/y.tab.c
-/yasmdata.rb
-
-# /benchmark/
-/benchmark/bmx_*.rb
-
-# /enc/trans/
-/enc/trans/*.c
-
-# /ext/
-/ext/extinit.c
-/ext/*.log
-
-# /ext/bigdecimal/
-/ext/bigdecimal/*.def
-/ext/bigdecimal/Makefile
-/ext/bigdecimal/bigdecimal.a
-/ext/bigdecimal/extconf.h
-/ext/bigdecimal/mkmf.log
-/ext/bigdecimal/conftest.dSYM
-
-# /ext/continuation/
-/ext/continuation/extconf.h
-/ext/continuation/Makefile
-
-# /ext/coverage/
-/ext/coverage/extconf.h
-/ext/coverage/Makefile
-
-# /ext/curses/
-/ext/curses/*.def
-/ext/curses/Makefile
-/ext/curses/curses.a
-/ext/curses/extconf.h
-/ext/curses/mkmf.log
-/ext/curses/conftest.dSYM
-
-# /ext/dbm/
-/ext/dbm/Makefile
-/ext/dbm/mkmf.log
-/ext/dbm/*.def
-/ext/dbm/extconf.h
-/ext/dbm/conftest.dSYM
-
-# /ext/digest/
-/ext/digest/*.def
-/ext/digest/Makefile
-/ext/digest/digest.a
-/ext/digest/extconf.h
-/ext/digest/mkmf.log
-
-# /ext/digest/bubblebabble/
-/ext/digest/bubblebabble/Makefile
-/ext/digest/bubblebabble/mkmf.log
-/ext/digest/bubblebabble/*.def
-/ext/digest/bubblebabble/extconf.h
-
-# /ext/digest/md5/
-/ext/digest/md5/*.def
-/ext/digest/md5/Makefile
-/ext/digest/md5/extconf.h
-/ext/digest/md5/md5.a
-/ext/digest/md5/mkmf.log
-/ext/digest/md5/conftest.dSYM
-
-# /ext/digest/rmd160/
-/ext/digest/rmd160/*.def
-/ext/digest/rmd160/Makefile
-/ext/digest/rmd160/extconf.h
-/ext/digest/rmd160/mkmf.log
-/ext/digest/rmd160/rmd160.a
-/ext/digest/rmd160/conftest.dSYM
-
-# /ext/digest/sha1/
-/ext/digest/sha1/*.def
-/ext/digest/sha1/Makefile
-/ext/digest/sha1/extconf.h
-/ext/digest/sha1/mkmf.log
-/ext/digest/sha1/sha1.a
-/ext/digest/sha1/conftest.dSYM
-
-# /ext/digest/sha2/
-/ext/digest/sha2/*.def
-/ext/digest/sha2/Makefile
-/ext/digest/sha2/extconf.h
-/ext/digest/sha2/mkmf.log
-/ext/digest/sha2/sha2.a
-
-# /ext/dl/
-/ext/dl/*.def
-/ext/dl/*.func
-/ext/dl/*.o
-/ext/dl/*~
-/ext/dl/Makefile
-/ext/dl/dl.a
-/ext/dl/extconf.h
-/ext/dl/mkmf.log
-/ext/dl/conftest.dSYM
-
-# /ext/dl/callback/
-/ext/dl/callback/*.def
-/ext/dl/callback/*.func
-/ext/dl/callback/*.o
-/ext/dl/callback/*~
-/ext/dl/callback/Makefile
-/ext/dl/callback/callback-*.c
-/ext/dl/callback/callback.a
-/ext/dl/callback/callback.c
-/ext/dl/callback/extconf.h
-/ext/dl/callback/mkmf.log
-/ext/dl/callback/conftest.dSYM
-
-# /ext/dl/win32/
-/ext/dl/win32/Makefile
-
-# /ext/etc/
-/ext/etc/*.def
-/ext/etc/Makefile
-/ext/etc/etc.a
-/ext/etc/extconf.h
-/ext/etc/mkmf.log
-/ext/etc/conftest.dSYM
-
-# /ext/fcntl/
-/ext/fcntl/*.def
-/ext/fcntl/Makefile
-/ext/fcntl/extconf.h
-/ext/fcntl/fcntl.a
-/ext/fcntl/mkmf.log
-
-# /ext/fiber/
-/ext/fiber/extconf.h
-/ext/fiber/Makefile
-
-# /ext/gdbm/
-/ext/gdbm/Makefile
-/ext/gdbm/mkmf.log
-/ext/gdbm/*.def
-/ext/gdbm/extconf.h
-/ext/gdbm/conftest.dSYM
-
-# /ext/iconv/
-/ext/iconv/*.def
-/ext/iconv/Makefile
-/ext/iconv/config.charset
-/ext/iconv/extconf.h
-/ext/iconv/iconv.a
-/ext/iconv/iconv.rb
-/ext/iconv/mkmf.log
-/ext/iconv/conftest.dSYM
-
-# /ext/io/wait/
-/ext/io/wait/Makefile
-/ext/io/wait/extconf.h
-/ext/io/wait/mkmf.log
-/ext/io/wait/wait.a
-
-# /ext/json/
-/ext/json/Makefile
-/ext/json/extconf.h
-
-# /ext/json/ext/generator/
-/ext/json/ext/generator/*.def
-/ext/json/ext/generator/Makefile
-/ext/json/ext/generator/extconf.h
-/ext/json/ext/generator/mkmf.log
-/ext/json/ext/generator/generator.a
-
-# /ext/json/ext/parser/
-/ext/json/ext/parser/*.def
-/ext/json/ext/parser/Makefile
-/ext/json/ext/parser/extconf.h
-/ext/json/ext/parser/mkmf.log
-/ext/json/ext/parser/parser.a
-
-# /ext/mathn/complex/
-/ext/mathn/complex/Makefile
-/ext/mathn/complex/extconf.h
-
-# /ext/mathn/rational/
-/ext/mathn/rational/Makefile
-/ext/mathn/rational/extconf.h
-
-# /ext/nkf/
-/ext/nkf/*.def
-/ext/nkf/Makefile
-/ext/nkf/extconf.h
-/ext/nkf/mkmf.log
-/ext/nkf/nkf.a
-
-# /ext/objspace/
-/ext/objspace/Makefile
-/ext/objspace/extconf.h
-
-# /ext/openssl/
-/ext/openssl/GNUmakefile
-/ext/openssl/Makefile
-/ext/openssl/dep
-/ext/openssl/extconf.h
-/ext/openssl/mkmf.log
-/ext/openssl/openssl.a
-/ext/openssl/conftest.dSYM
-
-# /ext/pty/
-/ext/pty/*.def
-/ext/pty/Makefile
-/ext/pty/extconf.h
-/ext/pty/mkmf.log
-/ext/pty/pty.a
-/ext/pty/conftest.dSYM
-
-# /ext/racc/cparse/
-/ext/racc/cparse/*.def
-/ext/racc/cparse/Makefile
-/ext/racc/cparse/cparse.a
-/ext/racc/cparse/extconf.h
-/ext/racc/cparse/mkmf.log
-/ext/racc/cparse/conftest.dSYM
-
-# /ext/readline/
-/ext/readline/*.def
-/ext/readline/Makefile
-/ext/readline/extconf.h
-/ext/readline/mkmf.log
-/ext/readline/readline.a
-/ext/readline/conftest.dSYM
-
-# /ext/ripper/
-/ext/ripper/Makefile
-/ext/ripper/mkmf.log
-/ext/ripper/eventids1.c
-/ext/ripper/eventids2table.c
-/ext/ripper/ripper.*
-/ext/ripper/ids1
-/ext/ripper/ids2
-/ext/ripper/extconf.h
-/ext/ripper/y.output
-
-# /ext/sdbm/
-/ext/sdbm/*.def
-/ext/sdbm/Makefile
-/ext/sdbm/extconf.h
-/ext/sdbm/mkmf.log
-/ext/sdbm/sdbm.a
-
-# /ext/socket/
-/ext/socket/*.def
-/ext/socket/Makefile
-/ext/socket/constants.h
-/ext/socket/constdefs.h
-/ext/socket/constdefs.c
-/ext/socket/extconf.h
-/ext/socket/mkmf.log
-/ext/socket/socket.a
-/ext/socket/conftest.dSYM
-
-# /ext/stringio/
-/ext/stringio/*.def
-/ext/stringio/Makefile
-/ext/stringio/extconf.h
-/ext/stringio/mkmf.log
-/ext/stringio/stringio.a
-
-# /ext/strscan/
-/ext/strscan/*.def
-/ext/strscan/Makefile
-/ext/strscan/extconf.h
-/ext/strscan/mkmf.log
-/ext/strscan/strscan.a
-
-# /ext/syck/
-/ext/syck/*.def
-/ext/syck/Makefile
-/ext/syck/extconf.h
-/ext/syck/mkmf.log
-/ext/syck/syck.a
-
-# /ext/syslog/
-/ext/syslog/*.def
-/ext/syslog/Makefile
-/ext/syslog/extconf.h
-/ext/syslog/mkmf.log
-/ext/syslog/syslog.a
-/ext/syslog/conftest.dSYM
-
-# /ext/tk/
-/ext/tk/Makefile
-/ext/tk/*.log
-/ext/tk/*.def
-/ext/tk/conftest.dSYM
-/ext/tk/extconf.h
-/ext/tk/config_list
-
-# /ext/tk/tkutil/
-/ext/tk/tkutil/Makefile
-/ext/tk/tkutil/*.log
-/ext/tk/tkutil/*.def
-/ext/tk/tkutil/conftest.dSYM
-/ext/tk/tkutil/extconf.h
-
-# /ext/win32ole/
-/ext/win32ole/Makefile
-/ext/win32ole/mkmf.log
-/ext/win32ole/*.log
-/ext/win32ole/.document
-
-# /ext/zlib/
-/ext/zlib/*.def
-/ext/zlib/Makefile
-/ext/zlib/extconf.h
-/ext/zlib/mkmf.log
-/ext/zlib/zlib.a
-/ext/zlib/conftest.dSYM
-
-# /lib/rexml/
-
-# /spec/
-/spec/mspec
-/spec/rubyspec
-
-# /win32/
-/win32/*.ico
diff --git a/COPYING.ja b/COPYING.ja
index aa2a163848..933cc7cb9a 100644
--- a/COPYING.ja
+++ b/COPYING.ja
@@ -1,6 +1,6 @@
-$BK\%W%m%0%i%`$O%U%j!<%=%U%H%&%'%"$G$9!%(BGPL (the GNU General
-Public License)$B%P!<%8%g%s(B2$B$^$?$O0J2<$K<($9>r7o$GK\%W%m%0%i%`(B
-$B$r:FG[I[$G$-$^$9!%(BGPL$B$K$D$$$F$O(BGPL$B%U%!%$%k$r;2>H$7$F2<$5$$!%(B
+$BK\%W%m%0%i%`$O%U%j!<%=%U%H%&%'%"$G$9!%(BGPL(the GNU General
+Public License)$B$^$?$O0J2<$K<($9>r7o$GK\%W%m%0%i%`$r:FG[I[$G(B
+$B$-$^$9!%(BGPL$B$K$D$$$F$O(BGPL$B%U%!%$%k$r;2>H$7$F2<$5$$!%(B
1. $BJ#@=$O@)8B$J$/<+M3$G$9!%(B
diff --git a/ChangeLog b/ChangeLog
index eae337562e..ed95ddf507 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,7172 +1,43 @@
-Sat Jul 18 07:56:00 2009 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tk/lib/tk.rb: fail to create a widget object for an unknown
- wiget path.
-
-Sat Jul 18 07:06:31 2009 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tk/lib/tk.rb,ext/tk/lib/tk/grid.rb: Bug fix on grid_slaves().
- Extend usage pattern of grid_column()/grid_row().
-
-Sat Jul 18 06:30:35 2009 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * include/ruby/win32.h: include winsock headers in extern "C++" for
- C++ extension libraries.
-
- * include/ruby/missing.h (vsnprintf): workaround for VC++.
- [ruby-core:23096]
-
-Sat Jul 18 00:23:47 2009 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * ext/readline/readline.c (Init_readline): rl_catch_signals does
- not exist on some platform like Mac OS X 10.5.
-
- * ext/readline/extconf.rb: checks existance of rl_catch_signals.
-
-Fri Jul 17 22:37:22 2009 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * ext/socket/socket.c (socket_s_ip_address_list): drop inactive
- adapters.
-
- * test/socket/test_{nonblock,addrinfo,socket}.rb: skip some tests on
- Windows.
- [ruby-core:23051]
-
-Fri Jul 17 22:29:21 2009 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * ext/readline/readline.c (Init_readline): use rl_catch_sigwinch only
- when existing.
-
- * ext/readline/extconf.rb: check existance of rl_catch_sigwinch, and
- workaround for native Win32 readline port.
-
-Fri Jul 17 18:18:23 2009 Tanaka Akira <akr@fsij.org>
-
- * range.c (recursive_hash): extracted from range_hash. reject
- recursive key.
- (range_hash): use recursive_hash.
-
-Fri Jul 17 18:11:32 2009 Tanaka Akira <akr@fsij.org>
-
- * struct.c (recursive_hash): extracted from rb_struct_hash. reject
- recursive key.
- (rb_struct_hash): use recursive_hash.
-
-Fri Jul 17 16:45:22 2009 Tanaka Akira <akr@fsij.org>
-
- * array.c (recursive_hash): reject recursive key.
-
-Fri Jul 17 15:20:53 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * random.c (DIGSPERINT): fix for LP64.
-
- * random.c (fill_random_seed): /dev/urandom is not available on
- DOSISH systems.
-
- * random.c (random_equal): new method Random#==.
-
-Fri Jul 17 13:35:47 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/init.c (rsock_getfamily): return AF_UNSPEC if getsockname
- is failed. [ruby-core:24383]
-
-Fri Jul 17 01:22:57 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * array.c (recursive_join): raise ArgumentError for joining
- recursive array.
-
- * array.c (ary_join_1): ditto.
-
- * test/ruby/test_array.rb (TestArray#test_join2): test updated for
- recursive join.
-
-Thu Jul 16 23:32:16 2009 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tk/extconf.rb,ext/tk/config_list.in: ignore paths which includes
- white space characters on Windows.[ruby-dev:38794]
-
- * ext/tk/lib/tk.rb: works on Cygwin (limitation:: Tk.mainloop works on
- the main thread only).
-
-Thu Jul 16 20:58:18 2009 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-
- * test/win32ole/test_win32ole.rb (test_s_codepage_changed,
- test_s_locale_set, test_s_locale_change): skip test if Japanese
- locale is not installed. [ruby-core:23806]
-
- * test/win32ole/test_win32ole_variant.rb (test_conversion_str2cy):
- dito.
-
-Thu Jul 16 19:02:28 2009 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * ext/socket/lib/socket.rb (Socket.tcp_server_sockets_port0): servers
- is nil if an error occurs before setting it.
-
-Thu Jul 16 18:42:56 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * random.c (fill_random_seed): suppress a warning.
-
-Thu Jul 16 18:30:20 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * hash.c (rb_hash_aset, recursive_hash): rejects recursive hash.
- [ruby-core:22921]
-
-Thu Jul 16 18:28:09 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * id.c (Init_id), vm.c (vm_exec): @#__ThrowState__ is no longer
- used. [ruby-dev:38760]
-
-Thu Jul 16 17:41:28 2009 Koichi Sasada <ko1@atdot.net>
-
- * vm_method.c (rb_alias): fix a case which try non-existing method alias.
-
- * test/ruby/test_alias.rb: add a test.
-
-Thu Jul 16 16:00:23 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * io.c (io_reopen): discards read buffer. [ruby-core:24240]
-
-Thu Jul 16 15:52:25 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * bignum.c (rb_big_new, rb_bigzero_p), range.c (rb_range_values):
- added for random.c.
-
- * random.c (rb_random_t): objectified. [EXPERIMENTAL]
- [ruby-dev:30954]
-
-Thu Jul 16 14:08:44 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * array.c (rb_ary_sample): RDoc update. a patch from Florian
- Frank. [ruby-core:24347]
-
-Thu Jul 16 12:42:10 2009 NARUSE, Yui <naruse@ruby-lang.org>
-
- * ext/readline/readline.c (readline_readline): rl_free_line_state
- before rl_cleanup_after_signal.
-
- * ext/readline/readline.c (Init_readline): set rl_catch_signals and
- rl_catch_signwinch as 0. [ruby-core:21884]
-
-Thu Jul 16 08:59:22 2009 Koichi Sasada <ko1@atdot.net>
-
- * node.h, vm_core.h, variable.c: rename global_entry to rb_global_entry.
-
- * compile.c, insns.def, iseq.c, vm_insnhelper.h: ditto.
-
-Thu Jul 16 08:57:44 2009 Koichi Sasada <ko1@atdot.net>
-
- * vm_method.c: separate clearing cache entry code.
-
-Thu Jul 16 08:56:32 2009 Koichi Sasada <ko1@atdot.net>
-
- * dir.c (push_glob): re-fix GC problem.
-
-Thu Jul 16 08:55:27 2009 Koichi Sasada <ko1@atdot.net>
-
- * common.mk: add method.h.
-
-Thu Jul 16 08:53:26 2009 Koichi Sasada <ko1@atdot.net>
-
- * io.c (argf_free): free data body.
-
-Wed Jul 15 23:46:55 2009 Koichi Sasada <ko1@atdot.net>
-
- * method.h, vm_core.h: add rb_method_entry_t. Remove nodes around
- method management. This change affect some VM control stack structure.
-
- * vm.c, vm_insnhelper.c, vm_method.c, vm_eval.c: ditto. and make some
- refactoring.
-
- * insns.def, class.c, eval.c, proc.c, vm_dump.c : ditto.
-
- * vm_core.h, compile.c (iseq_specialized_instruction): remove
- VM_CALL_SEND_BIT. use another optimization tech for Kernel#send.
-
- * node.h: remove unused node types.
-
- * ext/objspace/objspace.c (count_nodes): ditto.
-
- * gc.c: add mark/free functions for method entry.
-
- * include/ruby/intern.h: remove decl of
- rb_define_notimplement_method_id(). nobody can use it
- because noex is not opend.
-
- * iseq.c (iseq_mark): fix to check ic_method is available.
-
- * iseq.c (rb_iseq_disasm): fix to use rb_method_get_iseq().
-
-Wed Jul 15 23:45:11 2009 Koichi Sasada <ko1@atdot.net>
-
- * dir.c (push_glob): fix GC problem.
-
-Wed Jul 15 17:33:52 2009 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * ext/purelib.rb: translates a fake path to rubygems in $" into
- an alternative in $: so that Kernel.#require does not load
- more rubygems.rb.
- Resolves many failures in test/rubygems/*.
-
- * gem_prelude.rb (Gem.load_full_rubygems_library): supports case
- the rubygems to load is not in $(rubylibprefix).
- (Gem.path_to_full_rubygems_library): new method for the changes in
- purelib.rb and Gem.load_full_rubygems_library.
- (Gem.fake_rubygems_as_loaded): new method.
-
-Wed Jul 15 16:29:35 2009 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/Makefile.sub (LIBPATHFLAG): path is already quoted in mkmf.rb.
-
-Wed Jul 15 06:21:50 2009 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tk/extconf.rb: --with-{tcl,tk}-dir doesn't work.[ruby-dev:38782]
-
-Wed Jul 15 04:22:54 2009 NARUSE, Yui <naruse@ruby-lang.org>
-
- * test/cgi/test_cgi_multipart.rb (CGIMultipartTest#_prepare):
- set tempfile name with literal.
-
-Tue Jul 14 21:53:18 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/io/nonblock: moved from ext/io/wait/lib.
-
-Tue Jul 14 17:29:20 2009 NARUSE, Yui <naruse@ruby-lang.org>
-
- * string.c (rb_str_index_m): return nil if pos is out of string.
- [ruby-core:23660]
-
-Tue Jul 14 16:13:04 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * io.c (rb_io_initialize): check if the descriptor can be accessed
- in the specified open mode. [ruby-dev:38571]
-
-Tue Jul 14 09:26:14 2009 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tk/lib/multi-tk.rb: Long-term-callback support isn't stable yet.
- So, disable the feature and waiting for improvement in the future.
-
-Tue Jul 14 01:28:17 2009 NARUSE, Yui <naruse@ruby-lang.org>
-
- * test/ruby/test_m17n.rb (TestM17N#test_env): the encoding of
- ENV is now locale encoding.
-
-Tue Jul 14 01:24:56 2009 NARUSE, Yui <naruse@ruby-lang.org>
-
- * marshal.c (r_object0): should return real object.
-
-Tue Jul 14 01:06:31 2009 Yusuke Endoh <mame@tsg.ne.jp>
-
- * enumerator.c (yielder_yield_i): use rb_proc_new instead of
- rb_iterate. [ruby-dev:38518]
-
- * README.EXT: rb_iterate is obsolete since 1.9; use rb_block_call
- instead.
-
- * README.EXT.ja: ditto.
-
-Tue Jul 14 00:45:41 2009 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * test/ruby/test_case.rb (TestCase#test_deoptimization):
- test for [ruby-core:23190].
-
-Mon Jul 13 22:49:50 2009 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * lib/prime.rb (Prime#prime_division): now decomposes
- negative integer into a decomposition with element [-1, 1].
-
- * test/test_prime.rb: test for it.
-
-Mon Jul 13 22:28:03 2009 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * io.c (pipe_open): handles leaked on win32 when an error occurs.
-
-Mon Jul 13 20:21:51 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * marshal.c (r_object0): should not shadow outer variable not to
- return Qnil always.
-
-Mon Jul 13 19:41:05 2009 NARUSE, Yui <naruse@ruby-lang.org>
-
- * marshal.c (r_object0): copy instance variables to new regexp.
-
-Mon Jul 13 17:49:11 2009 Koichi Sasada <ko1@atdot.net>
-
- * vm_core.h, compile.c: declare struct iseq_inline_cache_entry.
- Inline cache (IC) entries are no longer GC managed object.
- IC entries are freed when ISeq is freed.
-
- * iseq.c: fix mark, free, memsize functions for above change.
-
- * insns.def: remove rb_gc_write_barrier().
-
- * vm_insnhelper.c (vm_method_search): ditto.
-
- * tool/instruction.rb, template/insns_info.inc.tmpl (insn_iclen):
- added.
-
-Mon Jul 13 13:35:08 2009 Koichi Sasada <ko1@atdot.net>
-
- * insns.def, vm_insnhelper.c (getinstancevariable):
- fix to use inline cache.
-
- * compile.c: fix to skip inline cache entry (IC). IC is added
- automatically by compiler.
-
- * insns.def, vm_insnhelper.h: fix IC positions.
-
- * iseq.c: increment minor_version of ISeq because of above change.
-
-Mon Jul 13 08:01:00 2009 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tk/extconf.rb: New strategy for searching Tcl/Tk libraries.
-
- * ext/tk/*: Support new features of Tcl/Tk8.6b1 and minor bug fixes.
- ( [KNOWN BUG] Ruby/Tk on Ruby 1.9 will not work on Cygwin. )
-
- * ext/tk/*: Unify sources between Ruby 1.8 & 1.9.
- Improve default_widget_set handling.
-
- * ext/tk/*: Multi-TkInterpreter (multi-tk.rb) works on Ruby 1.8 & 1.9.
- ( [KNOWN BUG] On Ruby 1.8, join to a long term Thread on Tk
- callbacks may freeze. On Ruby 1.9, cannot create a second
- master interpreter (creating slaves are OK); supported master
- interpreter is the default master interpreter only. )
-
- * ext/tk/lib/tkextlib/*: Update supported versions of Tk extensions.
- 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
-
-Mon Jul 13 01:18:13 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * time.c (time_timespec): rounds subsecond toward zero.
-
-Sun Jul 12 23:51:39 2009 NARUSE, Yui <naruse@ruby-lang.org>
-
- * hash.c (env_str_new): use rb_locale_str_new instead of
- rb_tainted_str_new. rb_locale_str_new set string locale
- encoding and tainted.
-
-Sun Jul 12 23:56:40 2009 Tadayoshi Funaba <tadf@dotrb.org>
-
- * complex.c: added some shortcuts.
-
- * rational.c: ditto.
-
-Sun Jul 12 23:30:26 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * object.c (rb_to_integer, rb_check_to_integer): return Bignum
- as-is.
-
-Sun Jul 12 21:07:46 2009 Tadayoshi Funaba <tadf@dotrb.org>
-
- * complex.c: use k_exact_{zero,one}_p macro.
-
- * rational.c: ditto.
-
-Sun Jul 12 20:42:58 2009 Tadayoshi Funaba <tadf@dotrb.org>
-
- * numeric.c (fix_divide): added an entry to rational.
-
- * rational.c (rb_rational_reciprocal): added.
-
- * complex.c (f_reciprocal): added.
-
-Sun Jul 12 02:24:42 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * random.c (rand_init): use fixed buffer for small numbers.
-
-Sat Jul 11 14:43:34 2009 NARUSE, Yui <naruse@ruby-lang.org>
-
- * test/ruby/test_io_m17n.rb (test_strip_bom): added.
-
-Sat Jul 11 07:11:59 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/readline/readline.c (readline_attempted_completion_function):
- array length is long.
-
- * ext/readline/readline.c (readline_s_get_filename_quote_characters):
- missing type of self.
-
-Sat Jul 11 02:37:37 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * random.c (limited_rand): expands to long before shift so that
- the result does not overflow.
-
-Sat Jul 11 00:16:27 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * random.c (rand_init): got rid of buffer overflow.
-
-Sat Jul 11 00:11:38 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * array.c (ary_join_1): should recurse for element array.
-
-Fri Jul 10 23:10:11 2009 NARUSE, Yui <naruse@ruby-lang.org>
-
- * io.c (io_strip_bom): ungetbyte third byte when UTF-16LE.
-
-Fri Jul 10 23:04:16 2009 NARUSE, Yui <naruse@ruby-lang.org>
-
- * io.c (io_strip_bom): Fix condition of second byte of
- UTF-16LE/UTF-32LE.
-
-Fri Jul 10 21:45:30 2009 TAKAO Kouji <kouji@takao7.net>
-
- * ext/readline/extconf.rb: checked rl_refresh_line in readline.
-
- * ext/readline/readline.c (readline_s_refresh_line): add new
- method, a patch from Koichiro Ohba. see [ruby-list:45922].
-
-Fri Jul 10 21:00:05 2009 TAKAO Kouji <kouji@takao7.net>
-
- * ext/readline/extconf.rb: checked rl_line_buffer and rl_point in
- readline.
-
- * ext/readline/readline.c (readline_s_get_line_buffer): new method.
- (readline_s_get_point): new method.
-
-Fri Jul 10 16:30:03 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * array.c (recursive_join): use obj to tell if recursion occurs.
- [ruby-core:24150]
-
- * enum.c (enum_join): reverted r23966. [ruby-core:24196]
-
-Fri Jul 10 14:41:34 2009 NARUSE, Yui <naruse@ruby-lang.org>
-
- * marshal.c (r_object0): set encoding only if the encoding
- is not US-ASCII.
-
-Fri Jul 10 14:44:03 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * random.c (struct MT): ruby already assumes int has 32bit a
- least, so no needs to use long.
-
- * random.c (rand_init): copies data to be used really only.
-
-Fri Jul 10 11:41:39 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * include/ruby/ruby.h (rb_obj_{untrust,untrusted,trust}): added
- prototypes. [ruby-dev:38756]
-
-Fri Jul 10 10:25:19 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * vm_insnhelper.c (vm_search_superclass): checks for implici
- argument passing before method search. [ruby-core:24244]
-
-Fri Jul 10 07:22:29 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (parser_data_type): typed.
-
-Thu Jul 9 23:28:48 2009 NARUSE, Yui <naruse@ruby-lang.org>
-
- * include/ruby/io.h (FMODE_STRIP_BOM): new constant.
-
- * io.c (io_encname_bom_p): judge whether the encoding name
- is *-bom or not.
- (parse_mode_enc): drop "-bom".
- (rb_io_modestr_fmode): set FMODE_STRIP_BOM if needed.
- (rb_io_extract_modeenc): ditto.
- (io_strip_bom): strip bom if exists.
- (io_set_encoding_by_bom): set encoding if there is bom.
- Set encoding and strip bom when modeenc string is "r:foo-bom"
- [ruby-dev:37236]
-
-Thu Jul 9 21:56:59 2009 NARUSE, Yui <naruse@ruby-lang.org>
-
- * marshal.c (r_object0): replace \u by u when the regexp is
- made by Ruby 1.8. [ruby-dev:36750]
-
-Wed Jul 8 23:13:54 2009 Tadayoshi Funaba <tadf@dotrb.org>
-
- * complex.c (nucomp_div): omitted zero division check.
-
-Wed Jul 8 21:00:37 2009 Keiju Ishitsuka <keiju@emperor2.pendome>
-
- * lib/irb/inspector.rb: forget svn add.
-
-Wed Jul 8 19:10:22 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * error.c (rb_check_type): rejects typed data.
-
-Wed Jul 8 18:28:04 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * proc.c ({proc,binding,method}_data_type): typed.
-
-Wed Jul 8 16:47:03 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * file.c (rb_file_s_basename): returns new string instead of
- shared string from FilePathStringValue(). [ruby-core:24199]
-
-Wed Jul 8 04:28:16 2009 Eric Hodel <drbrain@segment7.net>
-
- * ext/.document: Update with extensions that appear to have
- documentation. [ruby-core:24181]
-
-Wed Jul 8 04:28:16 2009 Koichi Sasada <ko1@atdot.net>
-
- * include/ruby/ruby.h:
- rename
- "...TypeStruct" and "typed_struct" to
- "TypedData..." and "typeddata", respectively.
- rename
- rb_data_type_t#name to
- rb_data_type_t#wrap_struct_name.
-
- * error.c, gc.c, iseq.c, vm.c: ditto.
-
-Tue Jul 7 20:23:27 2009 Keiju Ishitsuka <keiju@ruby-lang.org>
-
- * bin/irb, lib/irb.rb lib/irb/*: irb-0.9.6, extend inspect-mode
-
-Tue Jul 7 17:00:38 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * gc.c (rb_gc_call_finalizer_at_exit): deal with typed struct like
- as obj_free().
-
- * error.c (rb_typed_struct_is_kind_of): new function to see if the
- given typed struct.
-
- * error.c (rb_check_typed_struct): new function to check typed
- struct.
-
- * include/ruby/ruby.h (Check_TypedStruct, Data_Get_TypedStruct):
- new macro to check typed struct.
-
-Tue Jul 7 13:36:46 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * enum.c (DEFINE_ENUMFUNCS): included function signature.
-
- * enum.c (rb_enum_join): non-nil separator must be convertible to
- String. [ruby-core:24172]
-
-Tue Jul 7 12:47:28 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * enum.c (rb_enum_join): should propagate taint to the return
- value. the change was overridden by r23967. [ruby-core:24176]
-
-Tue Jul 7 11:56:52 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * gc.c (GC_PROF_SET_MALLOC_INFO, GC_PROF_SET_HEAP_INFO): simplified.
-
-Tue Jul 7 10:12:37 2009 NARUSE, Yui <naruse@ruby-lang.org>
-
- * io.c (rb_io_ext_int_to_encs): Set external encoding if
- ext==intern. [ruby-dev:38278]
-
-Mon Jul 6 09:31:50 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * proc.c (make_curry_proc): should propagate lambda-ness.
- [ruby-core:24127]
-
- * proc.c (proc_hash): use long.
-
-Mon Jul 6 09:06:49 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * test/ruby/test_module.rb (TestModule#test_undef): adjust to
- message change.
-
- * test/ruby/test_object.rb (TestObject#test_redefine_method_which_may_case_serious_problem): ditto.
-
- * test/ruby/test_object.rb (TestObject#test_remove_method): ditto.
-
-Mon Jul 6 09:04:45 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * enum.c (enum_join): deals with self recursive objects to get rid
- of infinite recursion. [ruby-core:24150]
-
-Mon Jul 6 08:00:10 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * enum.c (enum_to_a): should propagate taint to the return value.
- [ruby-core:24152]
-
- * enum.c (enum_sort_by): ditto.
-
-Mon Jul 6 00:41:41 2009 Tadayoshi Funaba <tadf@dotrb.org>
-
- * rational.c: edited rdoc.
-
-Sun Jul 5 23:55:57 2009 Tanaka Akira <akr@fsij.org>
-
- * time.c (find_time_t): fix Time.local(2009,2,31) failure on 64bit
- time_t environment.
-
-Sun Jul 5 22:43:13 2009 Tadayoshi Funaba <tadf@dotrb.org>
-
- * complex.c (nucomp_s_polar): now arg is optional.
-
-Sun Jul 5 20:40:35 2009 Tadayoshi Funaba <tadf@dotrb.org>
-
- * complex.c (float_arg): returns PI for -0.0.
-
-Sun Jul 5 14:04:36 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * thread.c (rb_threadptr_exec_event_hooks): new function to
- execute event hooks, with preserving errinfo. [ruby-core:24118]
-
-Sun Jul 5 08:14:38 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * vm_method.c (rb_add_method, remove_method, rb_undef): fixed
- minor grammatical errors in warnings. a patch from Run Pain
- Run Run at [ruby-core:24141].
-
- * vm_method.c (Init_eval_method): registers notimplement_body as a
- mark-object.
-
- * vm_insnhelper.c (vm_yield_setup_block_args): restores the firs
- arg where is overwritten at funcall. [ruby-core:24139]
-
-Sat Jul 4 08:20:03 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * numeric.c (dbl2ival): should raise FloatDomainError on Infinity
- and NaN as 1.8 does. [ruby-dev:38726]
-
-Fri Jul 3 22:48:45 2009 Tanaka Akira <akr@fsij.org>
-
- * time.c (find_time_t): less number of guesses for hh:mm:60.
-
-Fri Jul 3 21:30:14 2009 Tadayoshi Funaba <tadf@dotrb.org>
-
- * complex.c (nucomp_equal_p): removed.
-
-Fri Jul 3 21:07:29 2009 Tadayoshi Funaba <tadf@dotrb.org>
-
- * rational.c: renamed equal_p to eqeq_p.
-
- * complex.c: ditto.
-
- * complex.c (nucomp_equal_p): added.
- Complex(NaN).equal?(Complex(NaN)) should return true.
-
-Fri Jul 3 19:48:40 2009 Tadayoshi Funaba <tadf@dotrb.org>
-
- * complex.c: undef-ed shome methods. [ruby-core:24110]
-
- * complex.c (Numeric#arg): NaN for NaN. [ruby-core:24116]
-
-Fri Jul 3 18:35:06 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * vm_core.h (struct rb_iseq_struct): fixed types.
-
- * vm_core.h (ic_vmstat): VM state version is VALUE.
-
-Fri Jul 3 02:52:20 2009 Tanaka Akira <akr@fsij.org>
-
- * time.c (find_time_t): time guess strategy refined again.
-
-Fri Jul 3 00:36:16 2009 Tanaka Akira <akr@fsij.org>
-
- * time.c (find_time_t): time guess strategy refined.
-
-Thu Jul 2 11:16:25 2009 Shugo Maeda <shugo@ruby-lang.org>
-
- * lib/net/imap.rb: added response to Net::IMAP::ResponseError.
- a patch from Eric Hodel in [ruby-core:24111].
-
-Thu Jul 2 08:04:39 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * time.c (num_exact): rb_check_to_integer() can deal with both of
- Fixnum and Bignum together.
-
-Thu Jul 2 07:53:44 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (parser_yylex): fixed wrong variable.
-
-Thu Jul 2 05:37:38 2009 Tanaka Akira <akr@fsij.org>
-
- * time.c (num_exact): use to_r for T_FLOAT.
-
-Thu Jul 2 05:15:54 2009 Tanaka Akira <akr@fsij.org>
-
- * time.c (quo): return an integer if possible.
-
-Wed Jul 1 21:09:25 2009 Tanaka Akira <akr@fsij.org>
-
- * include/ruby/intern.h (rb_time_num_new): declared.
-
- * time.c (nsec2timev): extracted from time_new_internal.
- (time_new_internal): change argument to VALUE.
- (rb_time_new): follow the argument change.
- (rb_time_nano_new): ditto.
- (rb_time_num_new): new function.
-
- * ext/socket/ancdata.c (ancillary_timestamp): use rb_time_num_new to
- represent struct bintime preciously.
-
-Wed Jul 1 08:46:11 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * marshal.c (w_encoding): encodings need extra depth.
- [ruby-core:24100]
-
-Wed Jul 1 06:47:09 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * enum.c (enum_grep): gets rid of type-punning calls.
-
-Wed Jul 1 06:36:28 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * enum.c (enum_join): add Enumerable#join.
-
- * array.c (ary_join_1): recursive join for Enumerators (and
- objects with #to_a).
-
- * array.c (rb_ary_join): performance tune.
-
-Tue Jun 30 18:19:07 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * hash.c (rb_hash_hash): documentation fix. a patch from
- Marc-Andre Lafortune. [ruby-core:23943]
-
- * object.c (rb_mod_cmp): ditto.
-
- * range.c (range_eq): ditto.
-
- * string.c (rb_str_partition, rb_str_rpartition): ditto.
-
- * struct.c (rb_struct_s_def): ditto.
-
-Tue Jun 30 17:44:24 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * re.c (reg_match_pos): adjust offset based on characters, not
- bytes. [ruby-dev:38722]
-
- * string.c (rb_str_offset): new function.
-
- * string.c (rb_str_index_m): no call to rb_reg_adjust_startpos().
-
-Tue Jun 30 16:57:07 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * tool/rbinstall.rb: renamed to get rid of collision against
- instruction.rb on command line completion of shell.
-
- * tool/mkconfig.rb (RbConfig.expand): get rid of exceptions on
- frozen strings unless really changed.
-
- * tool/file2lastrev.rb: get rid of global variables.
-
- * tool/compile_prelude.rb: use US-ASCII name.
-
-Tue Jun 30 16:46:40 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * insns.def, tool/instruction.rb: fixed types.
-
-Tue Jun 30 11:08:49 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * include/ruby/oniguruma.h, include/ruby/re.h, re.c, regcomp.c,
- regenc.c, regerror.c, regexec.c, regint.h, regparse.c: use long.
-
-Tue Jun 30 11:05:59 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * dln.c (dln_find_1): fixed index overrun.
-
-Tue Jun 30 08:42:34 2009 Eric Hodel <drbrain@segment7.net>
-
- * tool/instruby.rb: summary is required in a .gemspec.
-
-Tue Jun 30 01:35:12 2009 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * tool/strip-rdocs.rb: supports QT style doxy-comments.
-
-Tue Jun 30 01:24:10 2009 Tadayoshi Funaba <tadf@dotrb.org>
-
- * lib/cmath.rb (log2, cbrt): added. [experimental]
-
-Tue Jun 30 01:19:53 2009 Tadayoshi Funaba <tadf@dotrb.org>
-
- * complex.c (nucomp_expt): do not use rb_fexpt.
-
-Mon Jun 29 22:50:10 2009 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * Doxyfile.in: removed. merged into template/Doxyfile.template
-
- * configure.in: new checking for dot and doxygen.
-
- * template/Doxyfile.template: merged with Doxyfile.in.
- configured some options.
-
- * common.mk (capi): use $(DOXYGEN) instead of "doxygen".
- (Doxyfile): removed a duplicate entry in the dependency.
-
-Mon Jun 29 21:01:31 2009 Tadayoshi Funaba <tadf@dotrb.org>
-
- * complex.c (nucomp_expt): checks exactness.
-
-Mon Jun 29 20:29:11 2009 Tadayoshi Funaba <tadf@dotrb.org>
-
- * rational.c (float_to_r): always returns rational.
-
-Mon Jun 29 18:55:55 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * dln.c (dln_find_1): fix for files with dots. [ruby-dev:38588]
-
-Mon Jun 29 17:14:31 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * file.c (file_expand_path): should copy original encoding.
- [ruby-dev:38612]
-
-Sun Jun 28 23:10:55 2009 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * gem_prelude.c (Gem.default_dir): follows the change on
- lib/rubygems/default.rb in r23879
-
-Sun Jun 28 23:32:11 2009 Tadayoshi Funaba <tadf@dotrb.org>
-
- * complex.c (nucomp_div): raises ZeroDivisionError immediately
- when the given second argument is zero.
-
- * rational.c (nurat_fdiv): never raise even if the given second
- argument is zero.
-
- * rational.c (rb_raise_zerodiv): changed the message (zero to 0).
-
-Sun Jun 28 22:25:07 2009 Tadayoshi Funaba <tadf@dotrb.org>
-
- * complex.c (nucomp_expt): convert to a float when the given power
- is a bignum.
-
- * rational.c (nurat_expt): ditto.
-
-Sun Jun 28 21:16:48 2009 Tadayoshi Funaba <tadf@dotrb.org>
-
- * lib/cmath.rb (sqrt): fixed an issue [ruby-list:45852].
-
-Sun Jun 28 19:48:29 2009 Tadayoshi Funaba <tadf@dotrb.org>
-
- * complex.c (nucomp_expt): some improvements.
-
- * rational.c (nurat_expt): ditto.
-
-Sun Jun 28 19:03:46 2009 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * tool/instruby.rb (:gem): registers the bundled version
- of minitest as a gem as rdoc or rake.
- c.f. [ruby-dev:38692].
-
-Sun Jun 28 19:02:07 2009 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * lib/rubygems.rb (ConfigMap[:rubylibprefix]): new entry.
-
- * lib/rubygems/defaults.rb (Gem.default_dir): considers
- "--with-rubylibprefix" configure option.
-
-Sun Jun 28 09:21:00 2009 Tadayoshi Funaba <tadf@dotrb.org>
-
- * complex.c: renamed some static functions.
-
- * rational.c: ditto.
-
-Sat Jun 27 19:06:22 2009 Tadayoshi Funaba <tadf@dotrb.org>
-
- * complex.c (nucomp_addsub): new
-
- * complex.c (nucomp_{add,sub}): use nucomp_addsub.
-
- * complex.c (nucomp_divide): changed the algorithm.
-
- * complex.c (nucomp_abs): added shortcuts.
-
-Sat Jun 27 16:56:33 2009 Tadayoshi Funaba <tadf@dotrb.org>
-
- * rational.c (nurat_cmp): use rb_num_coerce_cmp.
-
-Sat Jun 27 16:45:10 2009 Tadayoshi Funaba <tadf@dotrb.org>
-
- * complex.c: revised rdoc.
-
- * rational.c: ditto.
-
- * numeric.c: ditto.
-
-Sat Jun 27 13:44:48 2009 Kouhei Sutou <kou@cozmixng.org>
-
- * NEWS, lib/rss/maker/base.rb, test/rss/test_maker_2.0.rb: add
- item.guid.permanent_link? and item.guid.permanent_link=.
-
-Sat Jun 27 13:41:00 2009 Kouhei Sutou <kou@cozmixng.org>
-
- * NEWS: rss: 0.2.5 -> 0.2.7.
-
- * lib/rss/rss.rb, test/rss/test_version.rb: 0.2.6 -> 0.2.7.
-
-Sat Jun 27 03:16:56 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * numeric.c (int_chr): use default_internal encoding as default
- destination encoding if set. [ruby-core:23997]
-
-Sat Jun 27 03:09:04 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * io.c (argf_rewind): need to rewind $. and ARGF.lineno.
- [ruby-core:24046]
-
- * io.c (struct argf): refactoring on $. and ARGF.lineno behavior.
-
-Fri Jun 26 21:48:30 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/pty/pty.c (pty_getpty): check dup failure.
-
-Fri Jun 26 17:33:46 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * test/ruby/test_rubyoptions.rb (TestRubyOptions#test_rubyopt):
- test suite add '.' to RUBYLIB. remove checks.
-
- * test/ruby/test_require.rb (TestRequire#test_tainted_loadpath):
- the default tempdir directory /tmp is world writable, so
- SecrurityError would be raised. check removed.
-
-Fri Jun 26 16:32:59 2009 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * common.mk (COMPILE_PRELUDE): need -I. before -rrbconfig.
- [ruby-dev:38714]
-
-Thu Jun 25 18:41:51 2009 Ryan Davis <ryand-ruby@zenspider.com>
-
- * lib/minitest/*.rb: Imported minitest 1.4.2 r5269.
- * test/minitest/*.rb: ditto.
-
-Thu Jun 25 17:58:39 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * io.c (argf_binmode_m): should call rb_io_ascii8bit_binmode() to
- set its encoding to ASCII-8BIT. [ruby-core:24029]
-
-Thu Jun 25 13:04:58 2009 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * instruby.rb: '&' in sed s command's replacement is '\&' in ruby.
- [ruby-dev:38713]
-
-Thu Jun 25 06:50:23 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * io.c (rb_io_each_codepoint): uninitialized local variable enc.
-
-Thu Jun 25 06:25:49 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * enum.c (first_i): wrong condition for no argument #first.
- [ruby-core:24017]
-
-Wed Jun 24 20:19:11 2009 Tanaka Akira <akr@fsij.org>
-
- * time.c (time_s_now): new function. Time.now don't take arguments.
-
-Wed Jun 24 16:08:03 2009 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/resource.rb: CONFIG["TEENY"] is not ruby's version but API's
- one. So need to use RUBY_VERSION instead.
-
-Wed Jun 24 16:07:04 2009 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/mkexports.rb: rbconfig.rb exists at ".".
-
-Wed Jun 24 15:02:29 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (parser_set_encode): show the erred file name instead of
- the file that requires it. [ruby-core:24006]
-
-Wed Jun 24 11:41:20 2009 Akinori MUSHA <knu@iDaemons.org>
-
- * misc/ruby-style.el: It is too late to set c-file-style in
- c-mode-hook (at least on Emacs 23). Call c-set-style instead.
-
-Tue Jun 23 21:28:16 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * file.c (rb_get_path_check): check with given safe level.
-
- * file.c (rb_find_file_ext_safe, rb_find_file_safe): ditto.
-
- * safe.c (rb_insecure_operation): function to raise security
- error.
-
-Tue Jun 23 20:32:43 2009 Yusuke Endoh <mame@tsg.ne.jp>
-
- * gc.c: remove the definition of GC_DEBUG (debugging macro).
-
-Tue Jun 23 16:16:12 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in (ruby_version): defaults revision to 0 when no
- revision.h exists.
-
-Tue Jun 23 16:04:59 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * file.c (rb_find_file_ext, rb_find_file): no needs to expand
- paths with tilde twice.
-
- * load.c (rb_f_load): load the given path directly if not found in
- load_path.
-
- * load.c (search_required): search file in specified safe level.
-
- * load.c (rb_require_safe): path to load is already searched in
- search_required().
-
-Tue Jun 23 12:43:56 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in: remove PACKAGE_* macros generated by autotools.
- [ruby-core:20938]
-
-Tue Jun 23 01:17:38 2009 Tanaka Akira <akr@fsij.org>
-
- * ruby.c (process_options): don't specify .so for encdb here.
- "." is replaced by "_" in load_encoding.
-
- * encoding.c (load_encoding): add .so here.
-
-Mon Jun 22 23:24:22 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * variable.c (rb_generic_ivar_memsize): typo fixed. a patch from
- Kazuhiro NISHIYAMA. [ruby-dev:38700]
-
- * ext/objspace/objspace.c (memsize_of): ditto.
-
-Mon Jun 22 21:21:59 2009 Tanaka Akira <akr@fsij.org>
-
- * io.c: remove __CHECKER__ test.
-
- * dir.c: ditto.
-
- * dln.c: ditto.
-
- * file.c: ditto.
-
- * process.c: ditto.
-
-Mon Jun 22 17:15:38 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * ext/stringio/stringio.c (strio_each_codepoint): new method.
- [ruby-core:23949]
-
- * ext/stringio/stringio.c (strio_each_codepoint): ditto.
-
-Mon Jun 22 16:26:11 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ruby.c (ruby_init_loadpath_safe): removed "." from load_path.
-
-Mon Jun 22 16:14:30 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * compile.c (iseq_set_arguments, iseq_compile_each): internal
- arrays must be hidden. [ruby-dev:38613]
-
- * vm.c (Init_top_self): ditto.
-
-Mon Jun 22 14:41:47 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ruby.c (process_options), enc/prelude.rb: encdb and transdb are
- extension libraries.
-
- * ruby.c (process_options): set progname earlier.
-
-Mon Jun 22 13:50:23 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * io.c (rb_io_fdatasync): new method IO#fdatasync.
-
-Sun Jun 21 22:33:05 2009 Yusuke Endoh <mame@tsg.ne.jp>
-
- * load.c (Init_load): $: must be readonly. [ruby-dev:38690]
-
- * ruby.c (ruby_prog_init): $-W must be readonly. [ruby-dev:38691]
-
-Sun Jun 21 10:47:21 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/fileutils.rb (FileUtils::Entry_#copy_file): open with
- default umask. [ruby-core:23952]
-
-Sun Jun 21 10:46:32 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * transcode.c (enc_arg): default interanl encoding may not be set.
- [ruby-core:23932]
-
-Sat Jun 20 21:11:43 2009 Tadayoshi Funaba <tadf@dotrb.org>
-
- * numeric.c (num_div): don't use num_floor which is actually
- flo_floor.
-
- * numeric.c (num_modulo): don't call '%'.
-
- * numeric.c (num_divmod): use num_modulo.
-
- * numeric.c: defined '%'.
-
- * rational.c (nurat_idiv,nurat_mod,nurat_divmod,nurat_rem): removed.
-
-Sat Jun 20 20:28:44 2009 Tadayoshi Funaba <tadf@dotrb.org>
-
- * complex.c: edited rdoc.
-
- * numeric.c: ditto.
-
-Sat Jun 20 08:56:47 2009 Tadayoshi Funaba <tadf@dotrb.org>
-
- * complex.c: edited rdoc.
-
- * rational.c: ditto.
-
- * numeric.c: ditto.
-
-Sat Jun 20 07:17:52 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/monitor.rb (MonitorMixin::extend_object): should use
- #__send__ instead of #send to avoid possible name conflict.
- [ruby-core:23907]
-
-Sat Jun 20 06:56:31 2009 Tadayoshi Funaba <tadf@dotrb.org>
-
- * complex.c: edited rdoc.
-
- * rational.c: ditto.
-
-Sat Jun 20 05:08:59 2009 Tadayoshi Funaba <tadf@dotrb.org>
-
- * complex.c: edited rdoc.
-
- * rational.c: ditto.
-
-Sat Jun 20 04:30:35 2009 Tadayoshi Funaba <tadf@dotrb.org>
-
- * rational.c (nurat_abs): removed.
-
-Sat Jun 20 03:34:16 2009 Tadayoshi Funaba <tadf@dotrb.org>
-
- * complex.c: added rdoc.
-
-Fri Jun 19 23:43:38 2009 Tadayoshi Funaba <tadf@dotrb.org>
-
- * numeric.c: edited rdoc.
-
-Fri Jun 19 22:58:16 2009 Tadayoshi Funaba <tadf@dotrb.org>
-
- * rational.c: edited rdoc.
-
-Fri Jun 19 22:21:17 2009 Tadayoshi Funaba <tadf@dotrb.org>
-
- * numeric.c: edited rdoc.
-
-Fri Jun 19 21:56:01 2009 Tadayoshi Funaba <tadf@dotrb.org>
-
- * rational.c (nurat_expt): delegates to complex when self is
- negative. bacause Float#** does not produce complex.
-
-Fri Jun 19 21:40:58 2009 Tadayoshi Funaba <tadf@dotrb.org>
-
- * numeric.c: edited rdoc.
-
- * rational.c: ditto.
-
-Fri Jun 19 20:53:54 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * encoding.c (rb_enc_name_list): update RDoc. [ruby-core:23926]
-
-Fri Jun 19 20:44:45 2009 Tadayoshi Funaba <tadf@dotrb.org>
-
- * complex.c: constant COMPLEX_NAME has been removed.
-
- * rational.c: constant RATIONAL_NAME has been removed.
-
-Fri Jun 19 20:39:46 2009 Tadayoshi Funaba <tadf@dotrb.org>
-
- * rational.c: added rdoc. a patch from Run Paint Run Run.
-
-Fri Jun 19 17:04:59 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * numeric.c (flo_cmp): should always return nil for NaN.
-
- * numeric.c (flo_cmp): handle infinite value specially using
- infinite? method internally. [ruby-dev:38681]
-
-Fri Jun 19 09:28:45 2009 Tadayoshi Funaba <tadf@dotrb.org>
-
- * numeric.c (*_numerator,*_denominator): moved to rational.c.
-
- * rational.c (*_numerator,*_denominator): moved from numeric.c.
-
-Fri Jun 19 08:14:07 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * bignum.c (big_lshift, big_rshift): return Bignum always withou
- normalization. [ruby-dev:38679]
-
-Thu Jun 18 22:31:38 2009 Tadayoshi Funaba <tadf@dotrb.org>
-
- * rational.c (nurat_s_convert): calls to_r when the given argument
- is non-integer.
-
- * rational.c (nurat_s_convert): raises TypeError when the given
- argument is nil.
-
- * complex.c (nucomp_s_convert): ditto.
-
-Thu Jun 18 20:32:11 2009 Tadayoshi Funaba <tadf@dotrb.org>
-
- * numeric.c (num_numerator, num_denominator): use
- to_r [ruby-core:23910].
-
-Thu Jun 18 16:21:05 2009 Ryan Davis <ryand-ruby@zenspider.com>
-
- * lib/minitest/*.rb: Imported minitest 1.4.0 r5083.
- * test/minitest/*.rb: ditto.
-
-Thu Jun 18 10:12:49 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * ext/bigdecimal/bigdecimal.c (BigDecimal_to_f): went infinity too
- early. add BASE_FIG margin. [ruby-dev:38673]
-
-Thu Jun 18 01:35:51 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * numeric.c (flo_cmp): Infinity is greater than any bignum
- number. [ruby-dev:38672]
-
- * bignum.c (rb_big_cmp): ditto.
-
-Thu Jun 18 01:29:16 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * file.c (file_expand_path): drive letter is ascii only.
- [ruby-dev:38612]
-
-Thu Jun 18 01:09:27 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in (ridir, RI_BASE_NAME): fixed for path expansion.
- [ruby-core:23876]
-
-Wed Jun 17 23:46:08 2009 Tadayoshi Funaba <tadf@dotrb.org>
-
- * rational.c (nurat_coerce): accepts Complex when the imag is
- exact zero.
-
-Wed Jun 17 21:25:54 2009 Tadayoshi Funaba <tadf@dotrb.org>
-
- * bignum.c (rb_big_fdiv): checks whether the given second argument
- can be converted to float properly.
-
- * numeric.c (fix_fdiv): calls rb_big_fdiv when the given second
- argument is a bignum.
-
- * rational.c (nurat_fdiv): should calculate Float(x/y), not
- Float(x)/Float(y).
-
-Wed Jun 17 16:57:40 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * load.c (rb_f_require): RDoc updated. a patch from Run Paint Run
- Run in [ruby-core:23833].
-
- * load.c (rb_mod_autoload): ditto. [ruby-core:23835]
-
-Wed Jun 17 14:37:18 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * sample/test.rb (valid_syntax?): skips BOM. [ruby-dev:38666]
-
- * test/ruby/test_system.rb (TestSystem#valid_syntax?): ditto.
-
-Wed Jun 17 13:54:18 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * ext/strscan/strscan.c (Init_strscan): remove obsolete
- matchedsize method, use matched_size instead. [ruby-dev:38591]
-
-Wed Jun 17 12:37:37 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * thread.c (ruby_thread_stack_overflow): call rb_exc_raise() on
- stack overflows in the signal handler, if sigaltstack is
- available. On stack overflow (and with sigaltstack), the signal
- handler is more likely to have room to create an exception
- object. [ruby-core:23813]
-
-Wed Jun 17 08:10:38 2009 Koichi Sasada <ko1@atdot.net>
-
- * ext/objspace: added. objspace library extends some methods to
- ObjectSpace module.
-
-Wed Jun 17 08:14:01 2009 Tadayoshi Funaba <tadf@dotrb.org>
-
- * complex.c (nucomp_coerce): accepts Complex instances.
-
- * rational.c (nurat_coerce): accepts Rational
- instances. [ruby-core:23859]
-
-Wed Jun 17 07:36:22 2009 NARUSE, Yui <naruse@ruby-lang.org>
-
- * lib/webrick/httputils.rb (parse_form_data): escape boundary of
- multipart/form-data when embed in regexp.
-
-Wed Jun 17 07:24:26 2009 Koichi Sasada <ko1@atdot.net>
-
- * array.c (rb_ary_memsize): added.
-
- * io.c (rb_io_memsize): added.
-
- * regcomp.c (onig_memsize): added.
-
- * string.c (rb_str_memsize): added.
-
- * transcode.c (rb_transcoding_memsize, rb_econv_memsize): added.
-
- * variable.c (rb_geneic_ivar_memsize): added.
-
-Wed Jun 17 07:04:33 2009 Koichi Sasada <ko1@atdot.net>
-
- * iseq.c (iseq_memsize): added. Use RTypedData instead of RData
- for ISeq.
-
- * vm.c (env_memsize, vm_memsize, thread_memsize): added. Use
- RTypedData instead of RData for Env, VM, Thread.
-
-Wed Jun 17 06:48:28 2009 Koichi Sasada <ko1@atdot.net>
-
- * st.c, include/ruby/st.h (st_memsize): added. This function returns
- the memory usage of st_table.
-
-Wed Jun 17 06:19:06 2009 Koichi Sasada <ko1@atdot.net>
-
- * include/ruby/ruby.h: New structure RTypedData, added.
- This structure incldues more explicit type information for
- T_DATA objects. If RData(obj)->dfree is immediate value `1' on
- T_DATA object obj, obj is needed to be accessed with RTYPEDDATA(obj)
- instead of RDATA(obj). A RTypedData structure points the structure
- rb_typed_data_t. rb_typed_data_t includes information such as the
- type name of this data, mark and free function what RData includes,
- and memsize function show how data consuming the memory size.
- Note that you do not need any change existing T_DATA objects.
- If you use RDataType instead of RData on T_DATA object,
- you can specify explicit type information.
-
- * gc.c (rb_data_typed_object_alloc, rb_objspace_data_type_memsize,
- rb_objspace_data_type_name): added.
-
-Wed Jun 17 06:14:23 2009 Koichi Sasada <ko1@atdot.net>
-
- * gc.c: fix indent.
-
-Wed Jun 17 06:05:03 2009 Koichi Sasada <ko1@atdot.net>
-
- * gc.c (rb_objspace_each_objects): New C API, added.
-
-Wed Jun 17 00:31:30 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * test/ruby/test_argf.rb (TestArgf#test_skip): updated test
- according to clarified behavior.
-
-Tue Jun 16 22:47:37 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * io.c (fptr_finalize): revert last change. [ruby-dev:38648]
-
- * io.c (fptr_finalize): skip close(2) for fd 0,1,2.
-
-Tue Jun 16 20:07:09 2009 NARUSE, Yui <naruse@ruby-lang.org>
-
- * transcode.c (transcode_restartable0): refix can't build with VC9.
-
-Tue Jun 16 16:09:59 2009 TAKANO Mitsuhiro (takano32) <tak@no32.tk>
-
- * parse.y (parser_read_escape, parser_tokadd_escape):
- replace scan_oct as ruby_scan_oct.
-
-Tue Jun 16 06:40:31 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * io.c (fptr_finalize): should close stdin/stdout/stderr when
- closed explicitly. [ruby-core:23853]
-
- * io.c (argf_skip): should close only when current_file is available.
-
-Tue Jun 16 01:50:02 2009 Tanaka Akira <akr@fsij.org>
-
- * vm_eval.c (rb_call0): refine exception message for hidden objects.
-
-Mon Jun 15 22:35:31 2009 Tadayoshi Funaba <tadf@dotrb.org>
-
- * bignum.c (rb_big2db): (-Float::MAX.to_i*2).to_f should return
- -HUGE_VAL (-Infinity).
-
-Mon Jun 15 18:48:41 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * io.c (argf_each_line): should return self. [ruby-core:23852]
-
- * io.c (argf_each_byte, argf_each_char): ditto.
-
-Mon Jun 15 17:48:42 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * gc.c (os_obj_of): invoke garbage collection before iteration, to
- avoid accessing half recycled object references. [ruby-dev:38613]
-
-Mon Jun 15 11:04:30 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * .gdbinit (rp, iseq): load dummy_gdb_enums on demand.
- [ruby-dev:38606]
-
-Sun Jun 14 14:57:57 2009 Koichi Sasada <ko1@atdot.net>
-
- * thread.c, vm_eval.c: add Thread.backtrace.
-
- * test/ruby/test_thread.rb: add a test.
-
-Sun Jun 14 13:58:32 2009 Koichi Sasada <ko1@atdot.net>
-
- * transcode.c (transcode_restartable0): revert last commit because
- this change cause SEGV at test-all.
-
-Sun Jun 14 10:49:18 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * file.c (rb_find_file_ext, rb_find_file): canonicalize absolute
- paths. [ruby-core:23845]
-
- * file.c (rb_file_size): added rdoc. a patch from Run Paint Run
- Run at [ruby-core:23839].
-
-Sun Jun 14 07:53:26 2009 Tadayoshi Funaba <tadf@dotrb.org>
-
- * complex.c (nucomp_fdiv): use fdiv recursively.
-
- * complex.c (nucomp_expt): reduced code.
-
-Sun Jun 14 03:37:09 2009 NARUSE, Yui <naruse@ruby-lang.org>
-
- * enc/trans/utf8_mac.trans: remove wrong optimization.
-
-Sun Jun 14 01:53:00 2009 NARUSE, Yui <naruse@ruby-lang.org>
-
- * transcode.c (transcode_restartable0): can't build with VC9.
-
-Sun Jun 14 01:23:41 2009 Tadayoshi Funaba <tadf@dotrb.org>
-
- * rational.c (nurat_to_f): use fdiv.
-
-Sat Jun 13 15:03:41 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * load.c (load_lock): show backtrace at circular require.
-
- * load.c (rb_provide): assumes us-ascii only.
-
- * load.c (rb_require_safe): FilePathValue() implies rb_str_new4().
-
- * load.c (rb_mod_autoload): try conversion to path like as
- require. [ruby-core:23834]
-
-Sat Jun 13 09:58:26 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * marshal.c (r_ivar): should not set internal encoding ivar as an
- ordinary ivar. [ruby-dev:38596]
-
-Sat Jun 13 07:08:40 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * vm_eval.c (rb_f_local_variables): now returns symbols. a patch from
- Run Paint Run Run at [ruby-core:23828].
-
-Sat Jun 13 07:06:54 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * vm_eval.c (rb_f_catch): updated rdoc about generalized argument,
- and the case without arguments. [ruby-core:23827]
-
-Sat Jun 13 06:50:31 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/net/protocol.rb (Net::BufferedIO#rbuf_fill): TimeoutError is
- obsolete, use Timeout::Error instead. [ruby-core:23821]
-
-Sat Jun 13 06:45:46 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * vm_eval.c (rb_f_throw): fixed rdoc about execption.
- [ruby-core:23824]
-
-Fri Jun 12 14:56:50 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * file.c (file_expand_path): associate the input encoding when
- copying an absolute path. [ruby-dev:38594]
-
-Fri Jun 12 02:41:21 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * string.c (str_replace_shared): shared target must be frozen.
- [ruby-core:23727]
-
-Thu Jun 11 21:05:09 2009 Tadayoshi Funaba <tadf@dotrb.org>
-
- * lib/cmath.rb (exp): omitted redundant function call.
-
-Thu Jun 11 17:49:33 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/bigdecimal/bigdecimal.c (gfCheckVal): never used.
-
- * ext/bigdecimal/bigdecimal.c (VpInit): fixed format modifiers.
-
- * ext/bigdecimal/bigdecimal.c (VPrint): constified.
-
-Thu Jun 11 15:27:17 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/prime.rb: documentation typo fixed. a patch from okkez.
- [ruby-dev:38586]
-
-Wed Jun 10 18:15:17 2009 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * dir.c (dir_s_getwd): directory path's encoding should be filesystem's
- one.
-
- * lib/tmpdir.rb: ditto (but not finished yet.)
-
-Wed Jun 10 06:28:15 2009 Eric Hodel <drbrain@segment7.net>
-
- * lib/rubygems*: Upgrade to RubyGems 1.3.4 r2223.
-
-Tue Jun 9 22:38:09 2009 Tadayoshi Funaba <tadf@dotrb.org>
-
- * lib/cmath.rb (log10): raised exception when the given number is
- a negative real.
-
-Tue Jun 9 15:13:14 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * dir.c (dir_s_glob): fixed rdoc. a patch from Joseph Pecoraro a
- [ruby-core:23767].
-
- * dir.c (sys_warning): get rid of type-punning function cast.
-
- * dir.c (ruby_glob0): get rid of possible overflow.
-
-Tue Jun 9 10:58:48 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * Makefile.in, win32/Makefile.sub (RMALL): need for distclean-rdoc.
-
-Tue Jun 9 01:07:33 2009 Koichi Sasada <ko1@atdot.net>
-
- * thread.c: rename functions which require a parameter
- "rb_thread_t *", the prefix to be rb_threadptr_ instead of
- rb_thread_.
-
- * thread.c (rb_thread_add_event_hook(), rb_thread_remove_event_hook):
- change the parameter type from rb_thread_t * to VALUE.
-
- * eval.c, eval_error.c, eval_intern.h, signal.c, vm_core.h, vm_eval.c:
- ditto.
-
- * include/ruby/intern.h: remove decl of rb_thread_signal_raise() and
- rb_thread_signal_exit().
-
-Mon Jun 8 05:07:41 2009 Koichi Sasada <ko1@atdot.net>
-
- * thread_pthread.c (rb_thread_create_timer_thread): print fatal error
- message to stderr instead of using rb_bug().
-
- * KNOWNBUGS.rb, bootstraptest/test_fork.rb: move a fixed test.
-
-Sun Jun 7 22:44:20 2009 Tadayoshi Funaba <tadf@dotrb.org>
-
- * lib/cmath.rb (log): avoided redundant expression.
-
-Sat Jun 6 02:49:05 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * hash.c (rb_hash_reject_bang): always check frozen status.
- [ruby-core:23715]
-
- * hash.c (rb_hash_update): ditto.
-
- * hash.c (rb_hash_reject_bang): call rb_hash_foreach() directly.
-
- * hash.c (rb_hash_update_i): call st_insert() directly.
-
- * hash.c (rb_hash_update_block_i): ditto.
-
-Fri Jun 5 07:12:32 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/mkmf.rb (#link_command): should dup CONFTEST_C which is
- frozen. ref [ruby-core:23675]. [ruby-core:23702]
-
-Thu Jun 4 02:25:51 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/base64.rb: typo fixed. a patch from okkez. [ruby-dev:38564]
-
-Wed Jun 3 09:03:23 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * enum.c (enum_first): should check negative length.
-
-Tue Jun 2 17:32:40 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * enum.c (first_i): Enumerator#first should consume only what is
- needed. a patch from Marc-Andre Lafortune. [ruby-core:23661]
-
- * enum.c (enum_first): call to_int once for an argument. based on
- a patch from Marc-Andre Lafortune.
-
-Tue Jun 2 13:27:21 2009 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-
- * test/ripper/test_filter.rb: add tests. see [ruby-dev:37856]
-
-Tue Jun 2 07:44:43 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * string.c (rb_str_gsub_bang): modify check at the beginning.
- [ruby-core:23662] ref [ruby-core:23657]
-
- * string.c (rb_str_rstrip_bang): ditto. [ruby-core:23657]
-
- * string.c (rb_str_chop_bang): ditto.
-
- * string.c (rb_str_chomp_bang): ditto.
-
- * string.c (rb_str_reverse_bang): modify check added. [ruby-core:23671]
-
-Mon Jun 1 11:21:29 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * cont.c (cont_capture, fiber_store): reraise transferred error.
-
- * cont.c (fiber_switch): transfers dead fiber error to the previouse
- or root fiber if the current fiber is dead. [ruby-core:23651]
-
-Mon Jun 1 10:41:41 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * include/ruby/intern.h (rb_exc_new2): optimization for literal.
-
-Mon Jun 1 07:20:02 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * ext/bigdecimal/bigdecimal.c (BigDecimal_to_f): returns Inf if
- exp is bigger than DBL_MANT_DIG.
-
-Sun May 31 23:28:00 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/mkmf.rb (create_makefile): checks for duplication of source
- files.
-
-Sun May 31 23:26:36 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * file.c (istrailinggarbage): fixed typo.
-
-Fri May 29 17:10:08 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * struct.c (Init_Struct): made #to_s an alias to #inspect to
- reduce the result of recursive struct. a patch from ujihisa a
- [ruby-dev:38554].
-
-Fri May 29 17:08:23 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * hash.c (Init_Hash): made #to_s an alias to #inspect to reduce
- the result of recursive hash. a patch from ujihisa a
- [ruby-core:23601]. [ruby-dev:38555]
-
-Fri May 29 09:30:00 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * enum.c (collect_all): checks interrupts. [ruby-core:23594]
-
-Thu May 28 07:39:22 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in (THREAD_MODEL): reject unknown value and checks
- pthread.h only when pthread. [ruby-core:23577]
-
-Thu May 28 03:47:46 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * sample/optparse/opttest.rb: typo fixed. [ruby-dev:38544]
-
-Thu May 28 03:43:10 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * time.c (time_strftime): update RDoc according to info from
- Marc-Andre Lafortune in [ruby-core:23575]. [ruby-core:23564]
-
-Thu May 28 02:40:54 2009 Tanaka Akira <akr@fsij.org>
-
- * lib/uri: don't set @parser if it is DEFAULT_PARSER for marshaling
- URI objects between Ruby 1.8 and Ruby 1.9.
- [ruby-dev:38377]
-
-Wed May 27 23:00:38 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (struct parser_params): lex_gets_ptr should be long.
-
-Wed May 27 18:00:15 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * bignum.c (bigand_int): new function to calculate bignum and
- fixnum without allocating internal bignum.
-
- * bignum.c (bigor_int): ditto.
-
- * bignum.c (bigxor_int): ditto.
-
- * bignum.c (bigand_int): even less object allocation.
-
-Wed May 27 14:29:55 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * marshal.c (w_encoding): more compact encoding information for
- US-ASCII and UTF-8. [incompatible] [experimental]
-
- * marshal.c (r_ivar): restore :E encoding information.
-
-Wed May 27 14:08:39 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * st.c (st_insert2): new function with processing new key,
- e.g. copy.
-
- * hash.c (rb_hash_aset): use st_insert2() to reduce redundant
- st_lookup calls.
-
-Wed May 27 02:31:38 2009 NARUSE, Yui <naruse@ruby-lang.org>
-
- * ext/readline/readline.c (readline_getc): the function for
- rl_getc_function must be a byte function.
- so use getbyte method. [ruby-dev:38535]
-
-Tue May 26 14:24:17 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * gc.c: fixed types.
-
- * common.mk (bignum.o, numeric.o): depend on util.h.
-
- * bignum.c, marshal.c: fixed types.
-
- * numeric.c (infinite_value): use ruby_div0.
-
- * include/ruby/util.h (ruby_div0): moved from marshal.c.
-
-Tue May 26 11:01:41 2009 TAKANO Mitsuhiro (takano32) <tak@no32.tk>
-
- * lib/mkmf.rb: use map! to replace strings in $objs array.
-
-Tue May 26 10:12:08 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * bignum.c (bignew_1): inline memory allocation.
-
- * bignum.c (bigtrunc): call rb_big_resize() only when needed.
-
- * bignum.c (bigfixize): declare inline.
-
-Tue May 26 05:39:28 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * include/ruby/ruby.h (FilePathValue): prevent from GC.
-
- * include/ruby/ruby.h (NUM2LONG): added GCC specific optimization.
-
-Tue May 26 03:41:29 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * time.c (rb_gmtime, rb_localtime): gmtime and localtime return
- NULL on error. [ruby-core:23551]
-
-Tue May 26 03:38:37 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * string.c (rb_str_each_char, rb_str_each_codepoint): string
- length must be long.
-
-Mon May 25 13:27:32 2009 TAKANO Mitsuhiro (takano32) <tak@no32.tk>
-
- * lib/mkmf.rb: dont use gsub! method for frozen string.
-
-Mon May 25 11:47:06 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * tool/mkconfig.rb, tool/instruby.rb: removed redundant code.
-
-Mon May 25 09:34:09 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * string.c (rb_str_hash): avoid calling rb_enc_str_asciionly_p().
-
- * string.c (rb_str_replace): avoid redundant calling rb_str_new4().
-
- * string.c (str_replace): factor out replacement from
- rb_str_replace() without type check nor discarding the
- destination contents.
-
-Mon May 25 08:06:52 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * string.c (rb_str_partition): should use the converted result. a
- patch from Marc-Andre Lafortune at [ruby-core:23540].
-
- * string.c (rb_str_rpartition): ditto.
-
-Mon May 25 06:25:38 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * test/ruby/test_hash.rb (TestHash::test_equal2): recursive hashes
- are handled properly now. ref: [ruby-core:23402]
-
- * test/ruby/test_m17n.rb (TestM17N#test_sprintf_p): test fixed
-
-Mon May 25 05:32:19 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/cgi/core.rb (CGI::HTTP_STATUS): typo fixed. a patch from
- Nobuhiro IMAI. [ruby-dev:38538]
-
-Sun May 24 22:48:17 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * thread.c (rb_exec_recursive_paired): new function for proper
- handling of recursive arrays. [EXPERIMENTAL] [ruby-core:23402]
-
- * array.c (rb_ary_equal, rb_ary_eql, rb_ary_cmp): use above.
-
- * hash.c (hash_equal): ditto.
-
-Sun May 24 22:39:33 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * error.c (syserr_initialize): errno is int.
-
-Sun May 24 00:52:54 2009 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * configure.in ($ridir): new configuration. [ruby-core:23520].
- c.f. [ruby-core:23519].
-
- (--with-ridir): new configure option.
-
- * tool/instruby.rb (:doc, :rdoc): uses $ridir instead of
- a fixed path.
-
- * lib/rdoc/ri/paths.rb: follows $ridir.
-
- * Makefile.in: removes RIDATADIR which is no longer used.
-
- * bcc32/Makefile.sub: generates the 'ridir' entry for RbConfig.
- removes RIDATADIR which is no longer used.
-
- * win32/Makefile.sub: ditto.
-
-Sat May 23 23:52:33 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * string.c (rb_str_each_char): return original string.
- [ruby-core:23499]
-
- * string.c (rb_str_each_codepoint): protect string from
- modification.
-
-Sat May 23 21:48:58 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/dl/handle.c (rb_dlhandle_s_sym): added a method to access
- using RTLD_NEXT. [ruby-dev:38152]
-
- * ext/dl/handle.c (Init_dlhandle): added constants DEFAULT and
- NEXT which correspond to RTLD_DEFAULT and RTLD_NEXT.
-
-Sat May 23 18:53:13 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/dl/lib/dl/cparser.rb (DL::CParser#parse_struct_signature):
- splitting with regexp source string is obsolete. a patch from
- Minwoo Lee at [ruby-core:23494].
-
- * ext/dl/cptr.c (rb_dlptr_cmp): return signed value, and restric
- to Fixnum. [ruby-dev:38533]
-
-Fri May 22 23:22:53 2009 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * missing/vsnprintf.c (errno): [BUG] fixes a compilation
- error on SIZEOF_LONG > SIZEOF_INT.
- (BSD_vfprintf): ditto.
-
-Fri May 22 23:20:48 2009 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * spec/default.mspec: follows runruby.rb's move at r23542.
-
-Fri May 22 21:38:55 2009 Yusuke Endoh <mame@tsg.ne.jp>
-
- * NEWS: add Time#to_r.
-
-Fri May 22 20:29:01 2009 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * config.guess: moved into tool/.
-
- * config.sub: ditto.
-
- * install-sh: ditto
-
- * configure.in: follows the moves.
-
- * LEGAL: ditto.
-
-Fri May 22 20:10:18 2009 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * instruby.rb: moved into tool/.
-
- * mkconfig.rb: ditto.
-
- * rubytest.rb: ditto.
-
- * runruby.rb: ditto.
-
- * common.mk: follows the moves.
-
- * configure.in: ditto.
-
- * win32/Makefile.sub: ditto.
-
-Fri May 22 05:09:43 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * array.c (rb_ary_slice_bang): avoid call of rb_scan_args() unless
- it's really necessary.
-
-Thu May 21 22:17:52 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * template/id.h.tmpl, id.h (enum ruby_method_ids): added some IDs.
-
- * debug.c (dummy_gdb_enums): added enum ruby_method_ids.
-
- * .gdbinit (rp): improved output of Symbol.
-
-Thu May 21 21:07:22 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * missing/vsnprintf.c (BSD_vfprintf): support for 'z' modifier.
-
-Thu May 21 18:55:33 2009 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * gem_prelude.rb (Gem.default_dir and misc.): use rubylibprefix.
- follows the chagne in r23368.
-
-Thu May 21 12:07:43 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * include/ruby/ruby.h (RB_EVENT_HOOKS_HAVE_CALLBACK_DATA):
- new macro for compatibility check.
-
-Thu May 21 01:43:40 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * include/ruby/ruby.h (rb_long2int, RARRAY_LENINT): check long to
- cast to int. [ruby-dev:38508]
-
- * struct.c, vm_eval.c, vm_insnhelper.c: use RARRAY_LENINT.
-
-Wed May 20 21:00:27 2009 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * rb_enc_get_index: allows an arbitrary RData as the argument but not
- only what points a rb_encoding.
-
-Wed May 20 20:54:37 2009 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * spec/.gitignore: ignores rubyspec/ and mspec/.
-
-Wed May 20 19:41:44 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * struct.c (rb_struct_new): get rid of too large alloca.
-
- * struct.c (rb_struct_hash): use long.
-
-Wed May 20 18:58:27 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * vm_eval.c, vm_insnhelper.c: argument number is restricted to
- int, and fixed overflow.
-
-Wed May 20 18:34:30 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * enum.c (zip_ary): should use long.
-
- * enumerator.c (inspect_enumerator): should use long.
-
-Wed May 20 09:18:44 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * string.c (rb_str_count): optimized for 1byte string count by
- avoiding tr_setup_table().
-
-Wed May 20 06:25:29 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * encoding.c (rb_enc_fast_mbclen): faster mbclen for strings known
- to be valid.
-
- * string.c (enc_strlen): coderange specified version of
- rb_enc_strlen(). use rb_enc_fast_mbclen() if coderange is 7bit
- or valid.
-
- * string.c (str_gsub): use rb_enc_fast_mbclen().
-
- * string.c (rb_str_reverse, rb_str_split_m, rb_str_each_char,
- scan_once): ditto.
-
-Wed May 20 06:20:05 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/tempfile.rb (Tempfile#unlink): close first for Windows. a
- patch from Florian Frank. [ruby-core:23505]
-
-Wed May 20 00:13:38 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * encoding.c (rb_enc_codepoint_len): combine rb_enc_codepoint()
- and rb_enc_codelen() in one function to reduce calls.
-
- * encoding.c (rb_enc_codepoint): compatibility function.
-
- * sprintf.c (rb_str_format): use rb_enc_codepoint_len().
-
- * string.c (rb_str_inspect, rb_str_upcase_bang,
- rb_str_downcase_bang, rb_str_capitalize_bang,
- rb_str_swapcase_bang, trnext, tr_trans, rb_str_delete_bang,
- rb_str_squeeze_bang, rb_str_count, rb_str_split_m,
- rb_str_each_line, rb_str_each_codepoint, rb_str_lstrip_bang,
- sym_printable): ditto.
-
- * transcode.c (make_econv_exception): use rb_enc_mbc_to_codepoint()
-
-Wed May 20 00:05:52 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * vm_method.c (rb_attr): should preserve encoding info.
- [ruby-dev:38498]
-
-Tue May 19 22:54:35 2009 Yusuke Endoh <mame@tsg.ne.jp>
-
- * time.c (time_minus): always return a Float. [ruby-dev:38446]
-
- * time.c (time_to_r): new method. [ruby-dev:38461]
-
-Tue May 19 13:59:35 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * class.c (clone_method): add cast to remove warning from
- rb_gc_write_barrier().
-
-Tue May 19 13:54:15 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * struct.c (struct_ivar_get): new function to avoid repeated
- rb_intern() calls.
-
- * struct.c (rb_struct_iv_get): use struct_ivar_get()
-
- * struct.c (num_members): ditto.
-
- * struct.c (rb_struct_s_members): ditto.
-
- * class.c (rb_singleton_class): cache symbol to reduce calls to
- rb_intern().
-
-Tue May 19 07:52:05 2009 Tanaka Akira <akr@fsij.org>
-
- * test/test_time.rb: make tests timezone independent.
- reported by zunda. [ruby-dev:38492]
-
-Mon May 18 21:40:11 2009 Tanaka Akira <akr@fsij.org>
-
- * lib/pathname.rb (Pathname#sub): suppress a warning. [ruby-dev:38488]
-
-Sun May 17 23:23:14 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/mkmf.rb (SRC_EXT): should be flat.
- http://twitter.com/_tad_/status/1825862632
-
-Sun May 17 23:05:05 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ruby.c (ruby_init_loadpath_safe): VARIABLE_LIBPATH is always
- defined, see its value instead.
-
-Sun May 17 18:59:45 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * node.h (nd_line): NODE_LMASK is not needed.
-
- * node.h (NOEX_SAFE): made int.
-
-Sun May 17 14:23:08 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * compile.c (rb_parse_in_eval): returns true in true eval, not in
- main. [ruby-dev:38382]
-
- * parse.y (program): inherits dvars in eval or main.
-
-Sun May 17 14:02:56 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ruby.c (ruby_script): sets also VM toplevel program name.
-
- * ruby.c (process_options): no longer needs additional frame.
-
- * vm.c (rb_vm_get_sourceline): should not access out of bound.
-
-Sun May 17 09:47:48 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ruby.c (cmdline_options_init): initialize encodings.
-
- * ruby.c (add_modules, require_libraries, process_sflag):
-
- * ruby.c (process_sflag): not process twice.
-
- * ruby.c (moreswitches): get rid of possible overflow.
-
-Sun May 17 09:31:05 2009 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-
- * ext/win32ole/win32ole.c (foletypelib_name): should return
- encoded name corresponding to WIN32OLE.codepage.
-
-Sun May 17 09:02:56 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ruby.c (ruby_init_loadpath_safe): support for cygwin 1.7. see
- [ruby-core:23241].
- gets rid of possible buffer overflow with realpath().
-
- * ruby.c (set_arg0): get rids of overrun.
-
-Sat May 16 18:38:32 2009 Kouhei Sutou <kou@cozmixng.org>
-
- * lib/rss/parser.rb: add nil check.
-
-Sat May 16 18:36:01 2009 Kouhei Sutou <kou@cozmixng.org>
-
- * test/rss/test_maker_atom_feed.rb: suppress warnings.
-
-Sat May 16 18:33:15 2009 Kouhei Sutou <kou@cozmixng.org>
-
- * NEWS: add RSS::Maker.supported?(version).
-
-Sat May 16 18:26:42 2009 Kouhei Sutou <kou@cozmixng.org>
-
- * lib/rss/parser.rb, test/test_parser_1.0.rb: fix foaf:Image
- element causes parse error even if ignore_unknown_element mode.
-
-Sat May 16 18:14:19 2009 Kouhei Sutou <kou@cozmixng.org>
-
- * lib/rss/maker.rb, lib/rss/maker/0.9.rb,
- test/test_maker_*.rb: add RSS::Maker.supported?
-
-Sat May 16 18:12:39 2009 Kouhei Sutou <kou@cozmixng.org>
-
- * lib/rss/content/*, lib/rss/dublincore/*: fix circular require.
- * test/test_maker_atom_feed.rb,
- test/test_maker_atom_entry.rb: suppress warnings.
-
-Sat May 16 18:07:17 2009 Kouhei Sutou <kou@cozmixng.org>
-
- * lib/rss/maker/feed.rb, test/test_maker_atom_feed.rb:
- remove needless codes.
-
-Sat May 16 18:05:07 2009 Kouhei Sutou <kou@cozmixng.org>
-
- * lib/rss/maker/entry.rb: fix a typo.
-
-Sat May 16 18:02:57 2009 Kouhei Sutou <kou@cozmixng.org>
-
- * lib/rss/maker/feed.rb, test/test_maker_atom_entry.rb,
- test/test_maker_atom_feed.rb: fix duplicated dc:date.
- Reported by Kazuhiro NISHIYAMA. Thanks!!! [ruby-list:46014]
-
-Sat May 16 18:02:16 2009 Kouhei Sutou <kou@cozmixng.org>
-
- * lib/rss/maker/base.rb, lib/rss/maker/1.0.rb, lib/rss/maker/feed.rb,
- test/rss/test_maker_1.0.rb, test/rss/test_maker_atom_feed.rb:
- RSS 1.0 and Atom feed maker treat maker.channel.language as
- maker.channel.dc_language.
-
-Sat May 16 17:57:39 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/dl/lib/dl/callback.rb (DL#remove_callback_internal): ignore
- unbound function. [ruby-dev:38474]
-
-Sat May 16 17:51:11 2009 Kouhei Sutou <kou@cozmixng.org>
-
- * sample/rss/rss_recent.rb, sample/rss/list_description.rb: use
- UTF-8.
-
-Sat May 16 17:47:55 2009 Kouhei Sutou <kou@cozmixng.org>
-
- * lib/rss/rss.rb, test/rss/test_version.rb (RSS::VERSION):
- 0.2.5 -> 0.2.6.
-
-Sat May 16 17:26:04 2009 Narihiro Nakamura <authorNari@gmail.com>
-
- * iseq.c (rb_iseq_clone): use longlife object and insert write barrier.
-
- * vm_insnhelper.c (vm_cref_push): ditto.
-
- * vm_insnhelper.h (COPY_CREF): insert write barrier.
-
-Sat May 16 13:49:24 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * variable.c (rb_autoload_load): gets rid of false warning.
- [ruby-core:23466]
-
-Sat May 16 10:59:54 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * sample/drb/dhasenc.rb: add magic comment for encoding.
-
- * sample/mine.rb: ditto.
-
- * ext/tk/sample/tcltklib/sample1.rb: ditto.
-
-Sat May 16 09:49:05 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (magic_comment_encoding): ignores unused emacs-style
- encoding comment, as like Vim styles. [ruby-core:23470]
-
-Sat May 16 09:30:14 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * defs/keywords (reserved_word): made inline function static.
- [ruby-core:23210]
-
- * parse.y (rb_reserved_word): ordinary function for ripper.
-
-Sat May 16 09:19:16 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (magic_comment_encoding): use rb_compile_warning() to
- show the currently parsing file name. [ruby-core:23469]
-
-Sat May 16 09:03:29 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in (ruby_version): now version.h includes
- include/ruby/version.h, so need to tell to cpp to see
- $(srcdir)/include. [ruby-core:23468]
-
-Fri May 15 17:35:33 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * array.c (rb_ary_shift, rb_ary_shift_m): clears unused elements.
- [ruby-dev:38448]
-
-Fri May 15 15:15:12 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * variable.c (rb_autoload_load): checks if iv_tbl is valid.
- [ruby-dev:38456]
-
-Fri May 15 11:17:48 2009 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/setup.mak (-version-): now version.h includes
- include/ruby/version.h, so need to tell to cpp to check
- $(srcdir)/include.
- reported by KIMURA Koichi at http://www.kt.rim.or.jp/%7ekbk/zakkicho/09/zakkicho0905b.html#D20090514-6
-
-Thu May 14 16:13:32 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/etc/etc.c (etc_getpwuid): use rb_uid_t. [ruby-dev:38443]
-
- * ext/stringio/stringio.c (strio_ungetbyte): encoding should no
- be effective.
-
-Thu May 14 10:17:45 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * sample/test.rb (valid_syntax?): defaults to us-ascii.
-
-Wed May 13 22:34:31 2009 Narihiro Nakamura <authorNari@gmail.com>
-
- * gc.c: add longlife garbage collection. [ruby-dev:38423]
- (NORMAL_HEAPS_USED): new macro.
- (LONGLIFE_ALLOCATE_HEAPS_MIN): ditto.
- (add_longlife_heaps_slot): new function.
- (rb_newobj_from_longlife_heap): ditto.
- (rb_newobj_longlife): ditto.
- (rb_node_newnode_longlife): ditto.
- (rb_gc_write_barrier): ditto.
- (remembered_set_recycle): ditto.
- (rb_gc_mark_remembered_set): ditto.
- (clear_mark_longlife_heaps): ditto.
- (gc_sweep_for_longlife): ditto.
- (assign_heap_slot): new argumnent to longlife heaps slot.
- (add_freelist): ditto.
- (gc_sweep): avoid lonlife heap slot. set longlife_collection
- flag at add heap.
- (rb_gc_force_recycle): avoid mark object and remembered_set
- object.
- (garbage_collect): add longlife collection.
- (rb_gc_start): invoke longlife collection.
- (gc_profile_record_get): for longlife collction profile.
- (gc_profile_result): ditto.
-
- * include/ruby/intern.h (rb_gc_write_barrier): declared.
-
- * include/ruby/ruby.h (FL_REMEMBERED_SET): renamed from FL_RESERVED.
-
- * debug.c (FL_REMEMBERED_SET): ditto.
-
- * insns.def (setinlinecache): insert write barrier.
-
- * vm_insnhelper.c (vm_method_search): ditto.
-
- * set_relation (set_relation): use longlife object.
-
- * vm.c (vm_define_method): ditto.
-
- * vm_core.h (NEW_INLINE_CACHE_ENTRY): ditto.
-
- * vm_method.c (rb_add_method): ditto.
-
- * class.c (rb_add_method): ditto.
-
- * node.h (NEW_NODE_LONGLIFE): new macro.
- (rb_node_newnode_longlife): declared.
-
-Wed May 13 15:23:18 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * include/ruby/version.h: extracted the extensions interface and
- the never-changable info.
-
-Wed May 13 03:20:47 2009 Tanaka Akira <akr@fsij.org>
-
- * time.c (time_init_1): unused variable removed.
-
-Tue May 12 21:03:02 2009 Tanaka Akira <akr@fsij.org>
-
- * time.c: support fixed UTC offset. [ruby-dev:38326]
- (leap_year_v_p): new macro.
- (TIME_FIXOFF_P): new macro.
- (TIME_SET_FIXOFF): new macro.
- (time_init_0): renamed from time_init.
- (time_set_utc_offset): new function.
- (vtm_add_offset): new function.
- (utc_offset_arg): new function.
- (time_init_1): new function.
- (time_init): call time_init_0 or time_init_1 according argc.
- (validate_utc_offset): new function.
- (time_localtime_m): new function.
- (time_fixoff): new function.
- (time_getlocaltime): take optional UTC offset argument.
- (time_get_tm): support fixed UTC offset time.
- (Init_Time): make Time#{initialize,localtime,getlocal} varargs.
-
- * strftime.c (rb_strftime): vtm->zone can be NULL now.
-
-Tue May 12 18:23:40 2009 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * yarvtest: removed because it's outdated.
-
-Mon May 11 21:46:20 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * parse.y: add semicolons to some grammar rules not terminated
- with them. a patch from Dave B in [ruby-core:23422].
-
-Mon May 11 20:08:33 2009 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-
- * io.c (Init_IO): add constant File::NOATIME. [ruby-core:23194]
-
-Mon May 11 13:08:30 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * mkconfig.rb (rubylibdir): use rubylibprefix. [ruby-dev:38426]
-
-Mon May 11 08:37:04 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * ext/bigdecimal/bigdecimal.c (BigDecimal_coerce): support
- coercing into Rational. [ruby-core:23415]
-
-Mon May 11 04:39:45 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/net/smtp.rb (Net::SMTP#check_auth_args): should not change
- number of methods for the sake of compatibility.
-
-Sun May 10 11:36:11 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/dl/cfunc.c (rb_dlcfunc_instance_p): new function to check if
- the argument is an instance of DL::CFunc.
-
- * ext/dl/cptr.c (rb_dlptr_initialize, rb_dlptr_s_malloc): checks
- if DL::CFunc. [ruby-dev:38403].
-
- * ext/dl/lib/dl/cparser.rb (DL::CParser#parse_signature): strips
- spaces. based on a patch from Takashi Tamura in [ruby-dev:38398].
-
- * ext/dl/lib/dl/value.rb (DL::ValueUtil#wrap_arg): block must be
- given if arg is not bound. [ruby-dev:38404]
-
- * ext/dl/cfunc.c (rb_dlcfunc_instance_p): new function to check if
- the argument is an instance of DL::CFunc.
-
-Sat May 9 19:57:00 2009 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-
- * test/ruby/test_float.rb (TestFloat#test_sleep_with_Float): add a
- test. see [ruby-core:23282]
-
-Sat May 9 19:23:46 2009 Tadayoshi Funaba <tadf@dotrb.org>
-
- * lib/date.rb: use subsec instead of nsec.
-
-Sat May 9 12:19:49 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * hash.c: 3rd arguemnt of rb_hash_foreach() is VALUE.
-
- * hash.c (rb_any_hash, recursive_hash): use VALUE for hash.
-
-Sat May 9 11:14:50 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * vm_eval.c (rb_f_catch): gets rid of issue with gcc 4.4. a patch
- from Alexey Froloff in [ruby-core:23398]. [ruby-core:22924]
-
-Fri May 8 19:38:54 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/mkmf.rb (try_link0): removes waste dSYM directories lef
- when debug and universal-binary are enabled.
-
- * lib/mkmf.rb (check_sizeof): fixed wrong recuring result for
- intrinsic types.
-
-Fri May 8 10:14:08 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * Makefile.in, configure.in, win32/Makefile.sub (RUBY_BASE_NAME):
- program base name. [ruby-dev:38241]
-
- * configure.in (--with-soname): base name of shared library.
- [ruby-dev:38290]
-
-Fri May 8 10:07:02 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * array.c (rb_ary_flatten_bang): clears temporary array.
-
-Fri May 8 02:30:14 2009 Akinori MUSHA <knu@iDaemons.org>
-
- * lib/set.rb (SortedSet#add): Do not require each newly added
- element to be Comparable but to respond to <=>. [ruby-dev:38371]
-
-Thu May 7 21:42:51 2009 Yusuke Endoh <mame@tsg.ne.jp>
-
- * test/ruby/test_rubyoptions.rb (test_indentation_check): add a test
- for indentation check. [ruby-dev:38382]
-
-Thu May 7 16:40:09 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * array.c (rb_ary_flatten_bang): returns nil if nothing changed.
- a patch from Marc-Andre Lafortune in [ruby-core:23382].
-
-Thu May 7 14:26:14 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * array.c (rb_ary_sample): negative sample number is invalid.
- [ruby-core:23374]
-
-Thu May 7 14:16:24 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * string.c, include/ruby/encoding.h: fixed types.
-
- * include/ruby/encoding.h (rb_enc_nth): long is used for index.
-
-Thu May 7 14:01:55 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * range.c (r_le): fixed types.
-
- * range.c (range_eql): fixed rdoc.
-
-Thu May 7 13:10:25 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * io.c (pipe_open): should be rb_pid_t.
-
-Wed May 6 16:50:20 2009 Tanaka Akira <akr@fsij.org>
-
- * math.c (math_gamma): use a table for positive small integers.
-
-Wed May 6 09:27:04 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * README.ja: code for THINK_C does not exist already. [Bug #1435]
-
-Wed May 6 05:33:59 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in (CFLAGS, CXXFLAGS): strips extra spaces.
-
-Tue May 5 11:29:07 2009 NARUSE, Yui <naruse@ruby-lang.org>
-
- * tool/ifchange: Fix: arguments which begin with minus sign may
- parsed as options. Because of older systems, don't use --
- but use parentheses.
-
-Tue May 5 10:42:28 2009 NARUSE, Yui <naruse@ruby-lang.org>
-
- * ext/json: Update to JSON 1.1.4.
-
-Tue May 5 07:22:37 2009 NARUSE, Yui <naruse@ruby-lang.org>
-
- * transcode.c: NOMAP is now multibyte direct map.
-
- * transcode.c: remove ASIS.
-
- * transcode_data.h: ditto.
-
- * tool/transcode-tb (ActionMap#generate_info): remove :asis.
-
- * tool/transcode-tb (ActionMap#generate_info): add :nomap0.
-
- * enc/trans/utf8_mac.trans: replace :asis by :nomap0.
-
-Sat May 2 22:53:02 2009 Akinori MUSHA <knu@iDaemons.org>
-
- * lib/set.rb (SortedSet): Fix document. [Bug #1429]
-
-Sat May 2 10:34:29 2009 NARUSE, Yui <naruse@ruby-lang.org>
-
- * enc/trans/utf8_mac-tbl.rb: don't use Unicode escape.
-
- * enc/trans/utf8_mac.trans: follow above.
-
-Sat May 2 09:19:40 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * array.c (Init_Array): made #to_s an alias to #inspect to reduce
- the result of recursive array. a patch from ujihisa at
- [ruby-dev:38362]
-
-Fri May 1 16:50:05 2009 Akinori MUSHA <knu@iDaemons.org>
-
- * lib/set.rb (Set#merge): Only directly use the passed objects
- @hash instance variable when self and the passed object are
- instances of the same class. [Bug #118]
-
-Fri May 1 16:44:11 2009 Akinori MUSHA <knu@iDaemons.org>
-
- * lib/set.rb (SortedSet#add): Do not let an uncomparable object
- in. [Bug #118]
-
-Fri May 1 13:18:01 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval_intern.h (_longjmp): never return. see [ruby-core:23241]
-
-Fri May 1 01:31:19 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/extmk.rb: use RbConfig instead of Config.
-
- * instruby.rb: ditto.
-
- * lib/rubygems.rb: ditto.
-
- * test/rubygems/test_config.rb: ditto.
-
-Thu Apr 30 21:23:30 2009 Tanaka Akira <akr@fsij.org>
-
- * runruby.rb: use RbConfig::CONFIG instead of Config::CONFIG.
-
- * spec/default.mspec: ditto.
-
- * yarvtest/yarvtest.rb: ditto.
-
- * instruby.rb: ditto.
-
- * benchmark/report.rb: ditto.
-
- * benchmark/runc.rb: ditto.
-
- * tool/eval.rb: ditto.
-
- * test/rubygems/test_gem.rb: ditto.
-
- * test/rubygems/test_config.rb: ditto.
-
- * test/rubygems/test_gem_platform.rb: ditto.
-
-Thu Apr 30 18:18:13 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/net/http.rb: documentation typo fixed. [ruby-core:23335]
-
-Thu Apr 30 15:27:49 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * enc/trans/utf8_mac.trans: get rid of a 1.9 feature for cross
- compile.
-
-Thu Apr 30 11:35:30 2009 NARUSE, Yui <naruse@ruby-lang.org>
-
- * encoding.c (rb_filesystem_encoding): Change filesystem_encoding of
- Mac OS X to UTF-8.
-
-Wed Apr 29 21:23:40 2009 NARUSE, Yui <naruse@ruby-lang.org>
-
- * enc/iso_2022_jp.h: add CP50221.
-
- * enc/trans/iso2022.trans: add converter for CP50221.
-
-Wed Apr 29 15:22:26 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * file.c (rb_file_join): recursive array has no meaning as path
- name. [ruby-core:23329]
-
-Tue Apr 28 19:09:45 2009 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-
- * test/test_timeout.rb (TestTimeout#test_timeout): add a test.
-
-Tue Apr 28 07:13:48 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/pp.rb (Struct#pretty_print): coerce to a string since
- anonymous class has name no longer. [ruby-dev:38349]
-
-Mon Apr 27 16:47:12 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in (ruby_version): uses sed instead of grep if the
- result is need, to get rid of GREP_OPTIONS. [ruby-dev:38336]
-
-Mon Apr 27 01:25:11 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/readline/readline.c (readline_getc): use rl_getc_function if
- possible, to get rid of hang up at EOF without a newline.
-
-Sun Apr 26 23:19:32 2009 NARUSE, Yui <naruse@ruby-lang.org>
-
- * enc/trans/utf8_mac.trans: Add converter for UTF8-MAC.
-
- * enc/trans/utf8_mac-tbl.rb: ditto.
-
- * test/ruby/test_econv.rb: tests for above.
-
-Sun Apr 26 22:17:02 2009 NARUSE, Yui <naruse@ruby-lang.org>
-
- * tool/transcode-tb (ActionMap#each_firstbyte):
- if :asis collides other mappings, use another.
-
- * tool/transcode-tb (ActionMap#generate_info):
- add :asis for ASIS.
-
-Sun Apr 26 21:59:43 2009 NARUSE, Yui <naruse@ruby-lang.org>
-
- * transcode.c (ASIS): added for multi byte direct map.
-
- * transcode.c (transcode_restartable0): ditto.
-
-Sun Apr 26 20:33:12 2009 NARUSE, Yui <naruse@ruby-lang.org>
-
- * tool/transcode-tb (ActionMap#generate_node):
- Use ActionMap#gennode instead of generate_node
- because of initialization.
-
-Sun Apr 26 20:21:39 2009 NARUSE, Yui <naruse@ruby-lang.org>
-
- * .gitignore: added.
-
-Sun Apr 26 20:17:24 2009 Tanaka Akira <akr@fsij.org>
-
- * lib/rake.rb: use RbConfig::CONFIG instead of Config::CONFIG.
-
- * lib/rbconfig/datadir.rb: ditto.
-
-Sun Apr 26 19:30:29 2009 Tanaka Akira <akr@fsij.org>
-
- * time.c (time_arg): unused variable removed.
-
-Sun Apr 26 18:35:32 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * io.c (io_reopen): keeps pathv for prep_stdio. [ruby-dev:38131]
-
-Sun Apr 26 15:13:09 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/optparse.rb (OptionParser#parse_in_order): do not make an
- option from non-option argument. [ruby-dev:38333]
-
-Sat Apr 25 19:11:13 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in (ac_cv_func_daemon): use daemon(3) only on *BSD.
-
- * process.c (proc_daemon): double fork to ensure not having ctty.
- [ruby-core:23305]
-
-Sat Apr 25 16:19:48 2009 Tanaka Akira <akr@fsij.org>
-
- * time.c (month_arg): extracted from time_arg.
- (validate_vtm): ditto.
-
-Sat Apr 25 16:03:21 2009 Tanaka Akira <akr@fsij.org>
-
- * time.c (TIME_COPY_GMT): new macro.
- (time_s_at): use TIME_COPY_GMT.
- (time_succ): ditto.
-
-Sat Apr 25 15:54:04 2009 Tanaka Akira <akr@fsij.org>
-
- * time.c (time_mload): use TIME_SET_UTC.
-
-Sat Apr 25 15:47:54 2009 Tanaka Akira <akr@fsij.org>
-
- * time.c (time_get_tm): take time_object instead of gmt.
-
-Sat Apr 25 15:39:44 2009 Tanaka Akira <akr@fsij.org>
-
- * time.c (time_succ): refactored to avoid gmt variable.
- (strftimev): use TIME_UTC_P.
- (time_strftime): ditto.
-
-Sat Apr 25 15:21:33 2009 Tanaka Akira <akr@fsij.org>
-
- * time.c (TIME_UTC_P): new macro.
- (TIME_SET_UTC): ditto.
- (TIME_LOCALTIME_P): ditto.
- (TIME_SET_LOCALTIME): ditto.
- (time_utc_p): use the above macro.
- (time_localtime): ditto.
- (time_localtime): ditto.
- (time_gmtime): ditto.
- (time_to_s): ditto.
- (time_add): ditto.
- (time_sec): ditto.
- (time_min): ditto.
- (time_hour): ditto.
- (time_mday): ditto.
- (time_mon): ditto.
- (time_year): ditto.
- (time_wday): ditto.
- (wday_p): ditto.
- (time_yday): ditto.
- (time_isdst): ditto.
- (time_zone): ditto.
- (time_utc_offset): ditto.
- (time_to_a): ditto.
- (strftimev): ditto.
- (time_strftime): ditto.
- (time_mdump): ditto.
-
-Thu Apr 23 01:30:37 2009 Akinori MUSHA <knu@iDaemons.org>
-
- * ext/zlib/zlib.c (Zlib::GzipFile#path): New method.
-
-Wed Apr 22 20:25:24 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * time.c (time_timespec): check out-of-range. [ruby-core:23282]
- [Bug #1396]
-
-Wed Apr 22 19:33:13 2009 Tanaka Akira <akr@fsij.org>
-
- * lib/time.rb (Time.parse): use year completion in Date._parse.
-
-Wed Apr 22 11:12:15 2009 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * time.c (GMTIME, LOCALTIME): should set result if not have *_r().
-
- * time.c (localtime_with_gmtoff): now always needed tmbuf.
-
-Wed Apr 22 10:38:47 2009 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * dir.c (glob_helper): C99(gcc)-ism.
-
- * time.c (find_time_t): GUESS macro needs the variable named ``result''
- always.
-
-Wed Apr 22 09:27:31 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * time.c (localtime_with_gmtoff): fixed cross function jump.
-
-Wed Apr 22 03:06:56 2009 Tanaka Akira <akr@fsij.org>
-
- * lib/time.rb (Time#rfc2822): pad leading zeros for year.
- (Time#httpdate): ditto.
- (Time#xmlschema): ditto.
-
-Wed Apr 22 02:10:48 2009 Tanaka Akira <akr@fsij.org>
-
- * lib/time.rb (Time#xmlschema): use subsec instead of nsec.
-
-Wed Apr 22 01:27:38 2009 Tanaka Akira <akr@fsij.org>
-
- * time.c (time_arg): use the year argument as-is. [ruby-dev:38194]
-
- * lib/time.rb (Time.parse): interpret small year 0..99 as 1950..2049.
-
-Wed Apr 22 00:32:16 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * time.c (find_time_t): constified.
-
-Wed Apr 22 00:11:19 2009 Tanaka Akira <akr@fsij.org>
-
- * time.c (leap_year_v_p): removed.
-
-Tue Apr 21 23:52:45 2009 Tanaka Akira <akr@fsij.org>
-
- * time.c: remove time_t restriction from Time class.
-
- * timev.h: new file to define struct vtm.
-
- * strftime.c: format struct vtm instead of struct tm.
-
- * ext/syck/rubyext.c (mktime_do): don't use time_t;
-
- [ruby-dev:38191]
-
-Tue Apr 21 09:25:41 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * dir.c (dir_path, dir_each, glob_helper): use readdir_r() if
- available.
-
-Tue Apr 21 09:20:21 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/mkmf.rb (init_mkmf): needs default library path even if
- cross compiling.
-
-Tue Apr 21 07:07:45 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * array.c (rb_ary_push): bypass rb_ary_store().
-
-Tue Apr 21 01:25:16 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * bignum.c (bigsub_int): subtraction without making internal
- bignum values.
-
- * bignum.c (bigadd_int): ditto for addition.
-
- * bignum.c (bigtrunc): declare inline.
-
- * bignum.c (rb_quad_pack): fix condition.
-
-Tue Apr 21 01:13:42 2009 Alexander Zavorine <alexandre.zavorine@nokia.com>
-
- * symbian/setup (config.h): added TIMET2NUM and NUM2TIMET to match
- the change in time.c
-
-Mon Apr 20 20:29:04 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * string.c (rb_str_split_m): faster processing on 7bit strings.
-
- * string.c (ascii_isspace): faster isspace() for 7bit strings.
-
-Sun Apr 19 14:43:18 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval.c (ruby_cleanup): the order of local variables on stack is
- undefined. should use outermost VALUE for ruby_init_stack.
-
- * gc.c (ruby_get_stack_grow_direction, Init_stack): allows volatile
- pointer.
-
- * thread_*.c (ruby_init_stack): ditto.
-
-Sun Apr 19 13:17:25 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * gem_prelude.rb (Gem::QuickLoader#push_gem_version_on_load_path):
- check for requirement if the gem is installed. a patch from
- Kyosuke MOROHASHI at [ruby-dev:38020].
-
-Sun Apr 19 01:39:17 2009 Tanaka Akira <akr@fsij.org>
-
- * process.c (proc_seteuid_m): defined to use rb_f_notimplement if not
- implemented.
- (proc_setegid_m): ditto.
-
-Sun Apr 19 01:03:56 2009 Tanaka Akira <akr@fsij.org>
-
- * process.c (proc_setuid): use rb_f_notimplement if not implemented.
- (proc_setgid): ditto.
-
-Sat Apr 18 23:07:18 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/readline/readline.c: use rb_f_notimplement for methods not
- implemented.
-
- * ext/openssl/ossl_engine.c: ditto.
-
- * ext/openssl/ossl_config.c: ditto.
-
- * ext/openssl/ossl_cipher.c: ditto.
-
- * ext/openssl/ossl_pkcs5.c: ditto.
-
- * ext/openssl/ossl_x509ext.c: ditto.
-
- * ext/socket/socket.c: ditto.
-
- * ext/socket/basicsocket.c: ditto.
-
- * ext/socket/ancdata.c: ditto.
-
- * ext/socket/unixsocket.c: ditto.
-
- * ext/iconv/iconv.c: ditto.
-
-Sat Apr 18 21:07:34 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/curses/curses.c: use rb_f_notimplement for methods not
- implemented.
-
-Fri Apr 17 01:51:17 2009 Tanaka Akira <akr@fsij.org>
-
- * node.h (rb_notimplement_body_p): declared.
-
- * vm_method.c (Init_eval_method): suppress a warning.
-
- * io.c (rb_io_fsync): use rb_f_notimplement if not implemented.
- (rb_io_close_on_exec_p): ditto.
- (rb_io_set_close_on_exec): ditto.
- (rb_io_fcntl): ditto.
- (rb_f_syscall): ditto.
-
- * dir.c (dir_tell): ditto.
- (dir_seek): ditto.
- (dir_s_chroot): ditto.
-
- * process.c (proc_getpgrp): ditto.
- (proc_setpgrp): ditto.
- (proc_getpgid): ditto.
- (proc_setpgid): ditto.
- (proc_setsid): ditto.
- (proc_getpriority): ditto.
- (proc_setpriority): ditto.
- (proc_getrlimit): ditto.
- (proc_setrlimit): ditto.
- (p_sys_setuid): ditto.
- (p_sys_setruid): ditto.
- (p_sys_seteuid): ditto.
- (p_sys_setreuid): ditto.
- (p_sys_setresuid): ditto.
- (p_sys_setgid): ditto.
- (p_sys_setrgid): ditto.
- (p_sys_setegid): ditto.
- (p_sys_setregid): ditto.
- (p_sys_setreuid): ditto.
- (p_sys_setresgid): ditto.
- (p_sys_issetugid): ditto.
- (proc_getgroups): ditto.
- (proc_setgroups): ditto.
- (proc_initgroups): ditto.
- (proc_daemon): ditto.
- (rb_proc_times): ditto.
-
- * file.c (rb_file_s_lchown): ditto.
- (rb_file_s_link): ditto.
- (rb_file_s_symlink): ditto.
- (rb_file_s_readlink): ditto.
- (rb_file_s_truncate): ditto.
- (rb_file_truncate): ditto.
-
-Fri Apr 17 00:53:47 2009 Yusuke Endoh <mame@tsg.ne.jp>
-
- * lib/cgi/core.rb (read_multipart): When path is not defined,
- define local_path as a method always returning nil instead of
- aliasing. This is because StringIO#path no longer exists.
-
-Fri Apr 17 00:45:09 2009 Yusuke Endoh <mame@tsg.ne.jp>
-
- * dir.c (bracket): fix escape handling for range character in bracket
- of fnmatch pattern. e.g., '[a\-c]' should not match 'b'.
-
-Thu Apr 16 23:09:03 2009 Tanaka Akira <akr@fsij.org>
-
- * class.c (rb_define_method_id): use rb_define_notimplement_method_id
- if rb_f_notimplement is given.
- (rb_define_protected_method): ditto.
- (rb_define_private_method): ditto.
- (rb_define_method): use rb_define_method_id.
-
- * include/ruby/intern.h (rb_f_notimplement): declared.
- (rb_define_notimplement_method_id): declared.
-
- * proc.c (method_inspect): show not-implemented.
-
- * vm_method.c (notimplement_body): new variable.
- (rb_notimplement_body_p): new function.
- (rb_method_boundp): return false if not implemented.
- (rb_f_notimplement): new function.
- (rb_define_notimplement_method_id): new function.
-
- * process.c (rb_f_fork): use rb_f_notimplement if not implemented.
-
- * file.c (rb_file_s_lchmod): use rb_f_notimplement if not implemented.
-
-Wed Apr 15 20:24:49 2009 Yusuke Endoh <mame@tsg.ne.jp>
-
- * array.c (rb_ary_flatten): flatten(0) works as Array#dup.
- [ruby-core:23168]
-
- * test/ruby/test_array.rb: add a test for above.
-
-Wed Apr 15 11:53:35 2009 NARUSE, Yui <naruse@ruby-lang.org>
-
- * dir.c (fnmatch_helper): use rb_enc_precise_mbclen and
- fail if bytes are invalid. [ruby-dev:38307]
-
-Tue Apr 14 18:11:26 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * dir.c (bracket): if same in bytes, path is matching.
- [ruby-dev:38305]
-
-Mon Apr 13 17:21:40 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * sprintf.c (rb_str_format): scan coderange incrementally.
-
-Mon Apr 13 11:35:55 2009 NARUSE, Yui <naruse@ruby-lang.org>
-
- * sprintf.c (rb_str_format): optimize previous commit.
- [ruby-list:45954]
-
-Mon Apr 13 10:58:54 2009 NARUSE, Yui <naruse@ruby-lang.org>
-
- * sprintf.c (rb_str_format): check encoding compatibility only on
- real parts.
-
-Sun Apr 12 19:54:56 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * dir.c (bracket, fnmatch_helper): compare bytewise first, to get
- rid of invalid byte sequence. [ruby-dev:38303]
-
-Sat Apr 11 08:45:57 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in (Makefile): phony ruby target needs empty command.
-
-Fri Apr 10 11:32:14 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * common.mk (up): updates timestamp file.
-
-Fri Apr 10 04:54:01 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in (Makefile): info-program needs common.mk.
-
-Fri Apr 10 03:46:44 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in (RUBY_INSTALL_NAME): use --program-transform-name.
-
- * instruby.rb, mkconfig.rb: deal with --program-transform-name
- better. now supports s, y commands and single addressing.
-
-Thu Apr 9 23:59:11 2009 Tanaka Akira <akr@fsij.org>
-
- * configure.in: don't override the rule for ruby.
-
-Wed Apr 8 21:58:12 2009 Yusuke Endoh <mame@tsg.ne.jp>
-
- * string.c (rb_str_dump): buffer length plus one byte for null
- terminator. [ruby-dev:38294]
-
- * test/ruby/test_m17n.rb (test_str_dump): add a test for above.
-
-Wed Apr 8 20:08:16 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * string.c (rb_str_rstrip_bang): should not sign-expand non-ascii.
- [ruby-core:23158]
-
-Wed Apr 8 17:29:29 2009 NARUSE, Yui <naruse@ruby-lang.org>
-
- * string.c (rb_str_chop_bang): reset coderange. [ruby-core:23155]
-
-Wed Apr 8 14:00:04 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/mkmf.rb (what_type?): fixed typo, and refined for member of
- aggregation types.
-
- * lib/mkmf.rb (Logging.postpone): copy postponed output always.
-
-Wed Apr 8 09:45:58 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in (LIBRUBY_SO): removed redundant additional version
- numbers.
-
-Tue Apr 7 13:35:22 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * common.mk (info): shows configured names.
-
- * configure.in (Makefile): works even if RUBY_INSTALL_NAME
- contains macro.
-
- * configure.in (LIBRUBY_DLDFLAGS): compatibility version is
- ruby_version.
-
- * configure.in (RUBY_REPLACE_TYPE): defines type modifier prefix
- for printf.
-
-Tue Apr 7 02:27:49 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in (RUBY_DEFINT): should pass includes to
- AC_CHECK_SIZEOF and RUBY_CHECK_SIZEOF.
-
- * configure.in (CFLAGS, CXXFLAGS): need ARCH_FLAG for universal
- binary.
-
-Tue Apr 7 01:08:21 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * numeric.c (flo_to_s): reduce fragments if no precision lost.
- c.f. [ruby-core:23075]
-
-Mon Apr 6 23:16:08 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in (CFLAGS, CXXFLAGS): override with $cflags and
- $cxxflags if not given. [ruby-core:23130]
-
-Mon Apr 6 19:26:18 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * file.c (utime_failed): refined the error message for EINVAL on
- DOSISH platforms, where it may fail depending on filesystems.
- see [ruby-dev:38277].
-
-Mon Apr 6 16:38:50 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * file.c (sys_fail2, rb_file_s_readlink, BUFCHECK, rmext),
- (rb_file_s_basename): get rid of overflow.
-
-Mon Apr 6 15:11:56 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * numeric.c (int_chr): checks overflow.
-
-Mon Apr 6 10:49:47 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * test/stringio/test_stringio.rb (test_path): StringIO#path is no
- longer defined. [ruby-dev:38254]
-
-Mon Apr 6 10:47:13 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/stringio/stringio.c (strio_path): removed. [ruby-dev:38254]
-
-Sun Apr 5 18:02:54 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * include/ruby/intern.h (rb_fd_resize): does nothing on Win32.
-
-Sat Apr 4 17:05:15 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * include/ruby/intern.h (RB_NUM_COERCE_FUNCS_NEED_OPID): macro to
- check compatibility. [ruby-dev:38162]
-
-Sat Apr 4 07:38:52 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * mkconfig.rb (sitearch): default to arch.
-
-Fri Apr 3 14:02:42 2009 Akinori MUSHA <knu@iDaemons.org>
-
- * lib/irb/completion.rb (IRB::InputCompletor::Operators): Add
- overloadable negative operators.
-
- * lib/irb/ruby-lex.rb (RubyLex#lex_init): Support overloadable
- negative operators.
-
- * lib/irb/ruby-lex.rb (RubyLex#identify_identifier): Minus signs
- need to be escaped in regexp character class.
-
- * misc/ruby-mode.el (ruby-font-lock-keywords, ruby-parse-partial):
- Support overloadable negative operators.
-
-Fri Apr 3 12:45:55 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/extmk.rb: quotes arguments with spaces always.
-
-Thu Apr 2 14:50:06 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/getoptlong.rb: remove unused rdoc/usage from example.
- [ruby-core:23098]
-
-Thu Apr 2 07:42:27 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * win32/Makefile.sub (config.h): updated.
-
-Wed Apr 1 20:37:49 2009 Tanaka Akira <akr@fsij.org>
-
- * configure.in (rb_cv_fork_with_pthread): fail if the child process
- fail.
-
-Wed Apr 1 19:46:46 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/mkmf.rb (create_makefile): support for parallel make. a
- patch from Takuto Matsuu at [ruby-dev:38220].
-
-Wed Apr 1 19:39:25 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in (LIBRUBY_LDSHARED): use $(CC) instead of cc.
- a patch from Wataru Kimura at [ruby-dev:38225].
-
-Wed Apr 1 18:53:51 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * vm_dump.c (rb_vm_bugreport): should not #include inside a
- function, since headers may have declarations.
- c.f. [ruby-core:23095]
-
-Wed Apr 1 18:44:53 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * mkconfig.rb: ignores version numbers in config.status. replaces
- all $$s in program_transform_name.
-
-Wed Apr 1 15:12:21 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * Makefile.in (.c.i): use CPP instead of CC, since gcc -E can'
- work with multiple -arch options.
-
-Wed Apr 1 13:46:20 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * thread.c (rb_thread_fd_select): new function to call select
- using rb_fdset_t.
-
- * io.c (select_internal): use rb_thread_fd_select instead of
- rb_thread_select. based on the patch from Kengo Matsuyama.
- [ruby-dev:38221]
-
-Wed Apr 1 13:16:19 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * process.c (rb_f_sleep): RDoc disambiguation. [ruby-talk:332632]
-
-Tue Mar 31 15:17:37 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in: fixed the help strings for the header and library
- dir switches, and updated to use AS_HELP_STRING. patches from
- Richard Brown, c.f. [ruby-core:23067].
-
-Mon Mar 31 08:18:57 2009 James Edward Gray II <jeg2@ruby-lang.org>
-
- * test/csv/test_interface.rb, test/csv/test_serialization.rb:
- Trying more fixes some failing tests on Windows.
-
-Mon Mar 30 19:04:25 2009 Tanaka Akira <akr@fsij.org>
-
- * .gdbinit (rp): show negative fixnum correctly.
-
-Mon Mar 30 12:12:46 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * vm_eval.c (eval_string_with_cref): replaces the message if
- frozen. [ruby-dev:38208]
-
-Mon Mar 30 01:00:20 2009 James Edward Gray II <jeg2@ruby-lang.org>
-
- * test/csv/test_interface.rb: Trying a fix for some failing tests
- on Windows.
-
-Sun Mar 29 08:59:26 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/pathname.rb (Pathname#relative_path_from): compares path
- components according to system default case-sensitiveness.
- [ruby-core:22829]
-
-Sat Mar 28 11:10:32 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * common.mk (ruby.imp): all symbols in static library need to be
- exported, so that encoding-extensions can be loaded. based on a
- patch from Yutaka Kanemoto <kinpoco AT gmail.com> a
- [ruby-talk:332282].
-
-Sat Mar 28 08:49:47 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * sprintf.c (rb_str_format): checks if named argument given twice.
-
- * sprintf.c (GETNAMEARG): remembers named arg is used, to get rid
- of too many arguments warning.
-
-Sat Mar 28 03:16:59 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/mkmf.rb (link_command, cc_command, cpp_command): should no
- override extout defined in extmk.rb.
-
-Fri Mar 27 12:56:44 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/mkmf.rb (what_type?): checks more restrictively, and
- supports universal binary.
-
-Fri Mar 27 01:33:37 2009 Tanaka Akira <akr@fsij.org>
-
- * time.c (time_cmp): negate the result of reverse comparison.
-
-Fri Mar 27 01:19:50 2009 Tanaka Akira <akr@fsij.org>
-
- * bignum.c (rb_cmpint): FIX2INT may fail on LP64 platforms.
-
-Thu Mar 26 12:22:06 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/yaml/rubytypes.rb (String#is_binary_data?): TAB would be
- usually considered to be included in text data.
-
- * lib/rdoc/parser.rb (RDoc::Parser.binary?): blksize may be nil
- and is irrelevant to whether a file is binary. copied from
- above since TAB and newlines would be usually considered to be
- included in text data.
-
-Thu Mar 26 11:33:13 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/rdoc/ri/paths.rb (RDoc::RI::Paths): considers
- --program-prefix and --program-suffix. reapplied r19923.
-
-Wed Mar 25 07:45:12 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in (target_alias): replaces cpu with universal too.
-
- * configure.in (target): replaces cpu with arch by --with-arch.
-
- * mkconfig.rb (TOPDIR): chops arch in config instead of
- RUBY_PLATFORM which varies on universal_binary.
-
- * mkconfig.rb (MAJOR, MINOR, TEENY): reads from version.h always.
-
-Tue Mar 24 19:23:44 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in (RUBY_CHECK_SIZEOF): need to include $4.
-
-Tue Mar 24 17:08:52 2009 Akinori MUSHA <knu@iDaemons.org>
-
- * io.c (rb_io_inspect): Cannot access fptr->fd if fptr is NULL.
- This fixes a coredump caused by: ruby -e "class X < IO; def
- initialize; end; end; p X.new.inspect"
-
-Mon Mar 23 22:01:00 2009 Tanaka Akira <akr@fsij.org>
-
- * time.c (time_timespec): use NUM2TIMET.
- (time_s_at): ditto.
-
-Mon Mar 23 21:52:26 2009 Akinori MUSHA <knu@iDaemons.org>
-
- * process.c (Init_process): Better patch for eliminating an
- "unused variable".
-
-Mon Mar 23 21:41:14 2009 Akinori MUSHA <knu@iDaemons.org>
-
- * ext/dbm/dbm.c (fdbm_initialize): Make the file variable
- volatile, because FilePathValue() currently does not protect the
- given variable from GC. (Probably it should)
-
- * ext/sdbm/init.c (fsdbm_initialize): Ditto.
-
-Mon Mar 23 19:22:14 2009 Akinori MUSHA <knu@iDaemons.org>
-
- * file.c (rb_file_s_lstat): Back out.
-
-Mon Mar 23 18:54:57 2009 Akinori MUSHA <knu@iDaemons.org>
-
- * file.c (rb_file_s_stat, rb_file_s_lstat): Remove repeated type
- checks.
-
-Mon Mar 23 14:57:48 2009 Narihiro Nakamura <authorNari@gmail.com>
-
- * gc.c (init_heap): set default to heap slots length
- if HEAP_OBJ_LIMIT is larger than HEAP_MIN_SLOTS. [Bug #1310]
- (set_heaps_increment): increment next_heaps_length if
- next_heaps_length and heaps_used are same.
-
-Mon Mar 23 14:32:23 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * win32/win32.c (rb_w32_spawn): use original command if not found.
-
-Mon Mar 23 06:51:16 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * enc/depend (link_so): replaces $(TARGET) with basename of the
- target. [ruby-talk:330286]
-
-Sun Mar 22 14:51:55 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * win32/win32.c (rb_w32_spawn, rb_w32_aspawn): use NULL as
- application name for batch files.
-
-Sat Mar 21 15:54:41 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/openssl/ossl_ssl.c (write_would_block): defined.
- (read_would_block): defined.
- (ossl_start_ssl): add nonblock argument.
- (ossl_ssl_connect): follow ossl_start_ssl change.
- (ossl_ssl_connect_nonblock): new method.
- (ossl_ssl_accept): follow ossl_start_ssl change.
- (ossl_ssl_accept_nonblock): new method.
- (ossl_ssl_read_internal): use write_would_block and
- read_would_block.
- (ossl_ssl_write_internal): ditto.
-
-Sat Mar 21 08:19:52 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * process.c (rb_exec): prints error message only on platforms
- neither close-on-exec nor spawnv is supported.
-
-Sat Mar 21 08:17:41 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * win32/win32.c (rb_w32_spawn, rb_w32_aspawn): omit program name
- if actual program path is found. [ruby-core:22960]
-
-Sat Mar 21 07:25:56 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * io.c (pipe_open): should pass program name even if multiple
- arguments are given. fix for TestProcess::test_argv0.
-
-Sat Mar 21 02:37:07 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/openssl/lib/openssl/buffering.rb
- (OpenSSL::Buffering#write_nonblock): new method.
-
- * ext/openssl/ossl_ssl.c (ossl_ssl_write_nonblock): new method.
- (ossl_ssl_write_internal): defined.
- (ossl_ssl_write): use ossl_ssl_write_internal.
-
-Fri Mar 20 18:25:25 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * win32/win32.c (errmap): added ERROR_MOD_NOT_FOUND.
-
-Fri Mar 20 09:22:59 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in (libprefix): must not append "lib" after $(libdir),
- when load_relative is not used on darwin. a patch from Kenta
- Murata at [ruby-dev:38182].
-
-Thu Mar 19 20:29:40 2009 Tanaka Akira <akr@fsij.org>
-
- * io.c (rb_mWaitReadable): defined.
- (rb_mWaitWritable): defined.
- (io_getpartial): extend IO::WaitReadable on EWOULDBLOCK and EAGAIN.
- (rb_io_write_nonblock): extend IO::WaitWritable on EWOULDBLOCK and
- EAGAIN.
-
- * error.c (make_errno_exc): extracted from rb_sys_fail.
- (rb_mod_sys_fail): new function.
-
- * include/ruby/ruby.h (rb_mod_sys_fail): declared.
- (rb_mWaitReadable): declared.
- (rb_mWaitWritable): declared.
-
- * ext/socket/init.c (rsock_s_recvfrom_nonblock): extend
- IO::WaitReadable on EWOULDBLOCK and EAGAIN.
- (rsock_s_accept_nonblock): extend IO::WaitReadable on EWOULDBLOCK,
- EAGAIN, ECONNABORTED and EPROTO.
-
- * ext/socket/socket.c (sock_connect_nonblock): extend IO::WaitWritable
- on EINPROGRESS.
-
- * ext/socket/ancdata.c (bsock_sendmsg_internal): extend
- IO::WaitWritable on EWOULDBLOCK and EAGAIN.
- (bsock_recvmsg_internal): extend IO::WaitReadable on EWOULDBLOCK and
- EAGAIN.
-
- * ext/openssl/ossl_ssl.c (ossl_ssl_read_internal): raise SSLError
- extended by IO::WaitReadable/IO::WaitWritable on
- SSL_ERROR_WANT_READ/SSL_ERROR_WANT_WRITE.
-
- * ext/openssl/ossl.c (ossl_make_error): extracted from ossl_raise.
- (ossl_exc_new): new function.
-
- * ext/openssl/ossl.h (ossl_exc_new): declared.
-
- * lib/net/protocol.rb (rbuf_fill): rescue IO::WaitReadable and
- IO::WaitWritable.
-
- [ruby-core:22539], [ruby-dev:38140]
-
-Thu Mar 19 18:49:49 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in (RUBY_CHECK_SIZEOF): allows qualified name.
-
- * configure.in (RUBY_REPLACE_TYPE): checks more strictly.
-
- * configure.in (struct stat.st_size, struct stat.st_blocks),
- (struct stat.st_ino): check for size.
-
- * lib/mkmf.rb (check_sizeof): allows qualified name.
-
- * file.c (rb_stat_ino, rb_stat_blocks): check by size.
-
-Wed Mar 18 16:59:48 2009 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-
- * test/test_syslog.rb (TestSyslog#test_open): check
- param after block again. because detect not to call block.
-
-Wed Mar 18 16:54:04 2009 TAKANO Mitsuhiro (takano32) <tak@no32.tk>
-
- * ext/socket/ancdata.c: not use pktinfo.ipi_spec_dst if not defined
- * ext/socket/extconf.rb: define HAVE_IPI_SPEC_DST
-
-Wed Mar 18 16:38:11 2009 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-
- * test/test_syslog.rb (TestSyslog#test_open): check
- block parameter in block. [ruby-dev:38180]
-
-Wed Mar 18 12:48:01 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * error.c (report_bug): rb_bug can be caused by extension
- libraries.
-
-Wed Mar 18 02:41:33 2009 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
-
- * lib/drb/drb.rb (open_server_inaddr_any): fixed multiple network
- families problem. a patch from Charl Matthee at [ruby-core:21033].
-
-Tue Mar 17 21:42:54 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * tool/make-snapshot (package): creates .revision.time and passes
- CHDIR to create prerequisite files.
-
-Tue Mar 17 18:00:55 2009 Akinori MUSHA <knu@iDaemons.org>
-
- * enumerator.c (Enumerator#{each_,}{with_index,with_object}): Fix
- a bug where any parameter but the first one is dropped even if
- multiple values are yielded with. [Bug #1198]
-
-Tue Mar 17 14:25:16 2009 Tanaka Akira <akr@fsij.org>
-
- * lib/pathname.rb (Pathname#sub): set $~ in block.binding.
- [ruby-dev:38173]
-
-Tue Mar 17 13:48:08 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * win32/Makefile.sub (config.h): added RUBY_COREDLL.
-
- * ext/dl/handle.c (rb_dlhandle_initialize): returns msvcrt if libc
- or RUBY_COREDLL is given. [ruby-core:22828]
-
-Tue Mar 17 10:29:22 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * dir.c, dln.c, parse.y, re.c, ruby.c, sprintf.c, strftime.c,
- string.c, util.c, variable.c: use strlcpy, memcpy and snprintf
- instead of strcpy, strncpy and sprintf.
-
-Mon Mar 16 17:15:16 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * test/dl/test_win32.rb (Win32API): enclosed by DL::TestWin32.
- [ruby-core:22827]
-
-Mon Mar 16 16:37:22 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/tk/tcltklib.c (eventloop_sleep, lib_eventloop_core),
- (lib_watchdog_core): tv_usec is not time_t.
-
-Mon Mar 16 12:30:07 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * common.mk (REVISION_H): keeps timestamp of revision.h.
- [ruby-core:22900]
-
- * tool/ifchange, win32/ifchange.bat: extended --timestamp option.
-
-Mon Mar 16 09:28:58 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * Makefile.in, common.mk, win32/Makefile.sub: added preprocessing rules.
-
-Sun Mar 15 12:34:17 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * test/minitest/test_mini_test.rb: fixed tests depending on the
- detail of floating point representation.
-
-Sun Mar 15 12:01:36 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/rubygems/installer.rb (Gem::Installer#shebang): fix for env
- shebang.
-
-Sun Mar 15 11:15:18 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * include/ruby/ruby.h ({RSTRING,RBIGNUM}_EMBED_LEN_MAX): made int.
-
- * include/ruby/ruby.h (OBJ_{TAINTED,UNTRUSTED,FROZEN}): return int.
-
- * include/ruby/encoding.h (ENC_CODERANGE): ditto.
-
-Sun Mar 15 11:11:44 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * string.c (rb_hash_uint, rb_hash_start, rb_hash_end): use VALUE
- rather than unsigned int.
-
-Sun Mar 15 11:00:14 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ruby.c (load_file_internal): stop the timer thread before exec.
-
-Sun Mar 15 09:17:26 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * common.mk (.y.c): use SRC_FILE which contains slashes instead of
- backslashes. [ruby-core:22891]
-
-Sun Mar 15 08:26:16 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * common.mk (srcs-ext): creates ext/dl/callback/callback.c also.
-
-Sun Mar 15 03:29:51 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * process.c (SAVED_GROUP_ID, p_gid_switch): should be rb_gid_t.
-
-Sun Mar 15 02:53:13 2009 Tanaka Akira <akr@fsij.org>
-
- * string.c (rb_str_subpat): accept capture name.
- (rb_str_aref): follow above change.
- (rb_str_aref_m): pass the 2nd argument to rb_str_subpat.
- (rb_str_subpat_set): accept capture name.
- (rb_str_aset): follow above change.
- (rb_str_partition): ditto.
- (rb_str_aset_m): pass the 2nd argument to rb_str_subpat_set.
-
- * include/ruby/intern.h (rb_reg_backref_number): declared.
-
- * re.c (rb_reg_backref_number): defined.
-
- [ruby-core:21057]
-
-Sun Mar 15 02:09:31 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * proc.c (bmcall): should not uninitialized variable. a patch from
- pegacorn at [ruby-dev:38169].
-
-Sat Mar 14 18:25:18 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * util.c (ruby_scan_oct, ruby_scan_hex): use size_t.
-
-Sat Mar 14 18:18:08 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * proc.c (rb_proc_call, rb_node_arity, bmcall, curry): checks
- overflow.
-
- * proc.c (rb_proc_parameters): unnamed_parameters() expects in
- not VALUE.
-
-Sat Mar 14 17:54:19 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * util.c (ruby_each_words): assume no string exceeds INT_MAX.
-
-Sat Mar 14 15:59:04 2009 Tanaka Akira <akr@fsij.org>
-
- * process.c (rb_spawn_internal): use int variable for status.
-
-Sat Mar 14 14:45:51 2009 Tanaka Akira <akr@fsij.org>
-
- * process.c (rb_f_system): use rb_pid_t for pid.
- (rb_spawn_internal): local variable renamed.
-
-Sat Mar 14 14:16:02 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * util.c (ruby_strdup, Balloc, rv_alloc): use size_t.
-
-Sat Mar 14 13:53:11 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * util.c (ruby_qsort): the result of cmp must be signed, so ge
- rid of reuse of a variable.
-
-Sat Mar 14 10:56:13 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * dln.c (init_funcname_len, dln_find_exe_r, dln_find_file_r): use
- size_t.
-
- * file.c (rb_stat_inspect, file_expand_path): ditto.
-
- * util.c (ruby_qsort): ditto.
-
-Sat Mar 14 10:39:13 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/mkmf.rb (CXX_EXT): checks for case-sensitive filesystem with
- FNM_SYSCASE rather than build_os.
-
-Fri Mar 13 23:03:40 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/init.c (wait_connectable0): remove unreachable code.
-
-Fri Mar 13 23:00:02 2009 Tanaka Akira <akr@fsij.org>
-
- * configure.in (RUBY_CHECK_SIZEOF): pass [include] to AC_CHECK_SIZEOF.
-
-Fri Mar 13 20:58:11 2009 Tanaka Akira <akr@fsij.org>
-
- * dln.c (dln_find_1): compare fspace in size_t world.
-
-Fri Mar 13 18:58:04 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in (CFLAGS, CXXFLAGS): moved after warnflags.
-
-Fri Mar 13 18:10:06 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * vm_eval.c (rb_throw_obj): inverted call flow. [ruby-core:22872]
-
-Fri Mar 13 17:04:09 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * include/ruby/ruby.h (bool): not define to get rid of conflict
- against curses.
-
-Fri Mar 13 16:45:33 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/openssl/openssl_missing.h (i2d_of_void): cast for callbacks.
- [ruby-core:22860]
-
- * ext/openssl/ossl_engine.c (ossl_engine_s_by_id): suppress a
- warning.
-
- * ext/openssl/ossl_ssl.c (ossl_sslctx_flush_sessions): time_t may
- be larger than long.
-
- * ext/openssl/ossl_ssl_session.c (ossl_ssl_session_get_time),
- (ossl_ssl_session_get_timeout): use TIMET2NUM() to convert
- time_t.
-
-Fri Mar 13 15:10:43 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/openssl/ossl_x509ext.c (ossl_x509ext_set_value): should use
- OPENSSL_free instead of free. a patch from Charlie Savage at
- [ruby-core:22858].
-
-Fri Mar 13 21:11:51 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * ext/sdbm/_sdbm.c: should include "ruby/defines.h" as well for
- prototypes of compatibility functions on Win32 platform.
- [ruby-core:22870]
-
-Fri Mar 13 10:42:19 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in (AC_HEADER_STDBOOL): added.
-
- * include/ruby/ruby.h (NUM2INT, rb_special_const_p): returns true
- and false instead of Qtrue and Qfalse for platforms where VALUE
- is bigger than int.
-
- * gc.c (gc_stress_set), ext/openssl/ossl_asn1.c (decode_bool): go
- rid of variables named `bool'.
-
-Fri Mar 13 10:16:36 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in (struct stat.st_size): may be huge.
-
-Fri Mar 13 09:30:12 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * bignum.c (bigfixize): zero length Bignum is 0.
-
-Fri Mar 13 09:17:12 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/fileutils.rb (FileUtils#fu_get_gid): stringify group
- argument before making regexp match. [ruby-dev:38155]
-
-Fri Mar 13 08:06:48 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * util.c (rv_strdup): macro to duplicate nul-terminated string.
- [ruby-core:22852]
-
-Thu Mar 12 22:41:41 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/openssl: suppress warnings.
-
- * ext/openssl/ossl.h (OSSL_Debug): don't use gcc extension for
- variadic macro.
-
-Thu Mar 12 22:29:36 2009 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/Makefile.sub (WARNFLAGS): warning 4996 is only in VC++8 or
- later.
-
-Thu Mar 12 22:14:01 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/openssl/ossl_ssl.c (ossl_ssl_def_const): use INT2NUM because
- OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG doesn't fit into Fixnum.
-
-Thu Mar 12 18:16:12 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * array.c, bignum.c, dln.c, error.c, gc.c, io.c, marshal.c,
- numeric.c, pack.c, strftime.c, string.c, thread.c, transcode.c,
- transcode_data.h, util.c, variable.c, vm_dump.c,
- include/ruby/encoding.h, missing/crypt.c, missing/vsnprintf.c:
- suppress VC type warnings. [ruby-core:22726]
-
- * marshal.c (div0), numeric.c (infinite_value): new functions to
- get rid of VC division by 0 warnings.
-
- * st.c: use st_index_t for indexes instead of int.
-
- * vm.c (rb_vm_get_sourceline), vm_insnhelper.c (vm_throw): use
- rb_num_t.
-
-Thu Mar 12 09:30:54 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in (RUBY_CHECK_SIZEOF): if same size type is found, no
- more calculation is needed.
-
- * configure.in (RUBY_DEFINT): falls back to RUBY_CHECK_SIZEOF if
- size is not immediate.
-
-Thu Mar 12 09:24:24 2009 Tanaka Akira <akr@fsij.org>
-
- * transcode_data.h: suppress warnings of overflow.
-
-Thu Mar 12 09:15:14 2009 Tanaka Akira <akr@fsij.org>
-
- * include/ruby/encoding.h: suppress warnings of overflow.
-
-Thu Mar 12 05:49:05 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in (warnflags): added some default flags,
- pointer-arith, write-strings and shorten-64-to-32, but suppress
- unused-parameter and missing-field-initializers, if possible.
-
- * configure.in (RUBY_CHECK_HUGE): checks whether a value range is
- larger than long.
-
- * file.c (rb_stat_blocks): struct stat.st_blocks may be larger
- than long.
-
- * io.c (copy_stream_fallback_body): off_t may be larger than long.
-
- * iseq.c (rb_iseq_disasm): RSTRING_LEN() returns long.
-
- * process.c (rb_f_sleep): time() needs time_t.
-
- * random.c (fill_random_seed): enclosed conditionally used
- variables.
-
- * thread_pthread.c (ruby_init_stack): range of rlim_cur may be
- larger than int.
-
- * missing/vsnprintf.c (BSD_vfprintf): commented out code which has
- no effect at all.
-
-Thu Mar 12 02:10:57 2009 Tanaka Akira <akr@fsij.org>
-
- * configure.in: strip spaces from ruby_version.
- Sun C 5.9 SunOS_i386 Build47_dlight 2007/05/22 generates
- `ruby_version= 1 "." 9 "." 1'.
-
-Thu Mar 12 01:18:09 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * dir.c (dir_seek): use long for seekdir().
-
-Thu Mar 12 01:08:27 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * tool/ytab.sed: replaces backslashes with slash for nmake.
-
-Wed Mar 11 21:23:06 2009 Tanaka Akira <akr@fsij.org>
-
- * time.c (time_mload): don't clear tm_mday.
-
-Wed Mar 11 20:13:38 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/dl/handle.c (rb_dlhandle_sym): RTLD_NEXT is not for symbol
- name. [ruby-dev:38150]
-
-Wed Mar 11 17:26:38 2009 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * ext/dl/win32/lib/Win32API.rb: call by :stdcall as default.
- [ruby-core:22826]
-
-Wed Mar 11 13:27:14 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (stack_type): uses VALUE which is able to be stored
- parser stack.
-
-Wed Mar 11 13:22:41 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * win32/win32.c (init_env): set TMPDIR if none of TMPDIR, TMP,
- TEMP is set.
-
- * win32/win32.c (rb_w32_telldir, rb_w32_seekdir): should use long,
- as defined by SUSv3.
-
-Wed Mar 11 13:03:12 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/dl/handle.c (rb_dlhandle_sym): fixed heap corruption.
- [ruby-core:22822]
-
-Wed Mar 11 06:12:47 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ruby.c (ruby_init_loadpath_safe): expands libpath and removes
- last /lib.
-
-Wed Mar 11 04:47:47 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * time.c (time_to_i, time_hash): time_t may be bigger than long
- and int.
-
- * time.c (time_timeval, rb_time_timeval, obj2nsec, time_strftime),
- (time_mdump, time_mload): suppress warnings.
-
- * win32/Makefile.sub (config.h): added TIMET2NUM and NUM2TIMET.
-
-Wed Mar 11 04:29:52 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * win32/win32.c: suppress warnings. based on a patch from Charlie
- Savage at [ruby-core:22804].
-
-Wed Mar 11 04:22:12 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * signal.c (sig_trap): suppress warnings.
-
-Tue Mar 10 20:07:45 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * win32/Makefile.sub (WARNFLAGS): uses -wd4996 instead of
- CRTDEFFLAGS. cf. [ruby-core:22725]
-
-Tue Mar 10 19:58:52 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * include/ruby/win32.h (strcasecmp, strncasecmp): use _ prefixed
- versions to suppress warnings.
-
- * ext/dl/callback/mkcallback.rb (DLTYPE[FLOAT]): cast to suppress
- warnings. [ruby-core:22792]
-
- * array.c, bignum.c, gc.c, numeric.c, string.c, util.c, insns.def,
- missing/crypt.c, missing/vsnprintf.c, : suppress warnings.
- [ruby-core:22792]
-
-Tue Mar 10 13:45:54 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * win32/Makefile.sub (LDFLAGS): moved -link to TRY_LINK, LINK_SO
- and so on. based on a patch by Charlie Savage at
- [ruby-core:22794]
-
- * win32/Makefile.sub (config.h): passes LDFLAGS to rbconfig.rb so
- that extconf.rb could refer it. [ruby-core:22725]
-
-Tue Mar 10 11:36:32 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * iseq.c (prepare_iseq_build): too few arguments to function
- rb_ary_tmp_new().
-
-Tue Mar 10 10:53:59 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * iseq.c (rb_iseq_compile_with_option): argument may be converted.
-
-Tue Mar 10 04:56:44 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in (MINIRUBY): keep macro into Makefile.
-
- * configure.in (RUBY_CHECK_SIZEOF): fix for fallback.
-
- * configure.in (MANGLED_PATH): defines for RUBYLIB_PREFIX.
-
- * ruby.c (ruby_init_loadpath_safe): uses string as buffer.
-
- * symbian/setup (config_h): defines MANGLED_PATH.
-
-Tue Mar 10 03:48:27 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/dl/callback/depend: fix for parallel build.
-
- * ext/dl/callback/extconf.rb: callback.h is no longer created.
-
- * ext/dl/callback/mkcallback.rb: creates main source first.
-
- * ext/dl/callback/extconf.rb ($distcleanfiles): added callback.c.
-
-Tue Mar 10 00:06:21 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in (load_relative): new option to enable load path
- relative to libruby_so.
-
- * ruby.c (ruby_init_loadpath_safe): added the case using dladdr().
-
-Mon Mar 9 16:49:13 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/rake: updated to rake code to rake-0.8.4 source code base.
-
-Mon Mar 9 16:03:37 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/rubygems/installer.rb (Gem::Installer#initialize): env may
- not be under /usr/bin.
-
- * lib/rubygems/installer.rb (Gem::Installer#shebang): uses /bin/sh
- if shebang has any options, since env shebang trick does no
- work with options.
-
-Mon Mar 9 15:19:55 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * instruby.rb (manpages): use basename to compare and for Tempfile.
-
-Mon Mar 9 14:55:27 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * instruby.rb (default gems): installs default gemspecs.
-
-Mon Mar 9 14:48:08 2009 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/Makefile.sub (OPTFLAGS): simplified. see [ruby-core:22725]
-
-Mon Mar 9 14:33:57 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * instruby.rb: prints names of the directories where files are
- installed to.
-
-Mon Mar 9 02:25:54 2009 Yusuke Endoh <mame@tsg.ne.jp>
-
- * test/ruby/test_proc.rb: add some tests.
-
-Mon Mar 9 01:38:00 2009 Yusuke Endoh <mame@tsg.ne.jp>
-
- * test/ruby/test_enum.rb: add some tests.
-
-Mon Mar 9 01:12:37 2009 Yusuke Endoh <mame@tsg.ne.jp>
-
- * test/ruby/test_object.rb: add a test for Object#method_missing.
-
-Mon Mar 9 01:11:17 2009 Yusuke Endoh <mame@tsg.ne.jp>
-
- * test/ruby/test_file_exhaustive.rb: add tests for File#size and
- File.absolute_path.
-
-Sun Mar 8 23:02:50 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * win32/Makefile.sub (LDFLAGS): always prepends -link.
-
-Sun Mar 8 11:39:57 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in (RUBY_CHECK_SIZEOF): dirty hack to compute multiple
- sizeof, for apple's universal binary.
-
-Sat Mar 7 22:06:03 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in (universal_binary): checks if sizes are same on all
- architectures.
-
-Sat Mar 7 18:45:56 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in: checks if cd really succeeded.
-
-Sat Mar 7 14:24:47 2009 Tanaka Akira <akr@fsij.org>
-
- * configure.in: don't use CONFIG_SHELL for testing shell feature in
- Makefile.
-
-Sat Mar 7 14:07:31 2009 Tanaka Akira <akr@fsij.org>
-
- * configure.in: fix the location of cdcmd.
-
-Sat Mar 7 13:52:01 2009 Tanaka Akira <akr@fsij.org>
-
- * configure.in: the shell which runs configure may be different from
- the shell for make. configure likes bash but Makefile specifies
- SHELL=/bin/sh.
-
-Sat Mar 7 12:31:30 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * test/erb/test_erb.rb: reverted space sensitive test results.
-
- * test/rdoc/test_rdoc_parser_c.rb: ditto.
-
- * test/rdoc/test_rdoc_ri_default_display.rb: ditto.
-
-Fri Mar 6 23:35:59 2009 Tanaka Akira <akr@fsij.org>
-
- * lib/securerandom.rb (SecureRandom.urlsafe_base64): add optional
- argument to add padding.
-
-Fri Mar 6 19:25:40 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in (RUBY_LIB_VERSION_STYLE): sets full or minor style
- not to show RUBY_VERSION_MAJOR and so on.
-
- * version.h (RUBY_LIB_VERSION): makes from RUBY_LIB_VERSION_STYLE.
-
- * configure.in, Makefile.in, win32/Makefile.sub (CHDIR): cd using
- physical directory.
-
- * Makefile.in (update-mspec): split from update-rubyspec.
-
- * win32/Makefile.sub (update-{rubyspec,mspec}): added.
-
-Fri Mar 6 14:28:36 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * Makefile.in, win32/Makefile.sub (INSNS): moved variable
- definition before rule.
-
-Fri Mar 6 13:47:10 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/rake/loaders/makefile.rb (Rake::MakefileLoader#load): deals with
- escaped spaces. incorporated from rake 0.8.4.
-
- * lib/rake/testtask.rb (Rake::TestTask#define): passes each libs
- as each arguments with expanded. incorporated from rake 0.8.4.
-
-Thu Mar 5 18:36:38 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * numeric.c (flo_to_s): keeps enough precision for round trip.
- [ruby-core:22325]
-
-Thu Mar 5 17:42:06 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * array.c (rb_ary_fill): doc for Array#fill misses indication
- about negative value for the start argument. [ruby-core:22497]
-
-Thu Mar 5 16:56:14 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/tmpdir.rb (Dir.tmpdir): not use USERPROFILE, and ignores
- non-existent directory.
-
-Thu Mar 5 14:52:46 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * win32/win32.c (rb_w32_sysinit): initializes version info first.
-
- * win32/win32.c (rb_w32_osid): always define for binary compatibility.
-
-Thu Mar 5 11:52:16 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * win32/Makefile.sub (make_insns_rules): rule to make rules for insns.
-
-Thu Mar 5 11:27:16 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * win32/Makefile.sub (miniruby.exe): workaround for a failure of
- mt.exe on Windows 7 beta. [ruby-talk:330284]
-
-Thu Mar 5 10:32:17 2009 NARUSE, Yui <naruse@ruby-lang.org>
-
- * test/dl/test_base.rb: Add dragonfly to libc and libm switch.
-
-Thu Mar 5 10:29:10 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * string.c (str_eql): extracted from rb_str_equal and rb_str_eql.
-
- * string.c (rb_str_chomp_bang): keeps 7bit coderange.
-
-Thu Mar 5 10:10:40 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * include/ruby/encoding.h (enc_initialized_p): ENC_UNINITIALIZED
- is not defined already.
-
- * include/ruby/encoding.h (ENC_FROM_ENCINDEX): removed because
- depending on a static variable.
-
-Thu Mar 5 04:42:52 2009 Yusuke Endoh <mame@tsg.ne.jp>
-
- * test/ruby/test_array.rb: fix wrong test, and add a test for
- sort_by!.
-
-Thu Mar 5 04:32:38 2009 Yusuke Endoh <mame@tsg.ne.jp>
-
- * test/ruby/test_array.rb: add some tests for coverage.
-
-Thu Mar 5 00:06:37 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * win32/README.win32 (Requirement): added unicows.lib and dll.
-
-Wed Mar 4 23:29:56 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in, win32/configure.bat (--enable-win95): new option
- to enable/disable win95 support.
-
-Wed Mar 4 21:21:51 2009 Yusuke Endoh <mame@tsg.ne.jp>
-
- * lib/thread.rb (SizedQueue#push): fix limit condition.
- [ruby-dev:38135]
-
-Wed Mar 4 20:27:10 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in (mingw): checks if unicows.lib is available.
-
- * include/ruby/win32.h (WIN95): moved to config.h
-
- * win32/Makefile.sub (LIBS): links unicows.lib if available.
-
- * win32/Makefile.sub (config.h): defines WIN95 only if unicows.lib
- is available.
-
- * win32/setup.mak (-unicows-): checks if unicows.lib is available.
-
-Tue Mar 3 17:10:09 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/extmk.rb (extmake): removes object files no longer used and
- files to be removed by old distclean.
-
-Tue Mar 3 16:51:51 2009 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * ext/dl/win32/lib/win32/resolv.rb: get rid of warning.
-
- * ext/dl/lib/dl/func.rb: ditto.
-
-Tue Mar 3 16:25:43 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/extmk.rb (extmake), lib/mkmf.rb (create_makefile): $objs and
- $srcs are always Array or nil now.
-
-Tue Mar 3 15:54:11 2009 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * ext/dl/win32/lib/win32/{registry,resolv}.rb: use dl/import instead
- of Win32API.
-
-Tue Mar 3 15:53:20 2009 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * ext/dl/lib/dl/func.rb (DL::Function.name): delegate to @cfunc.
-
-Tue Mar 3 15:40:38 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/dl/dl.c (rb_dl_init_callbacks): autoloads callbacks.
-
- * ext/dl/callback: split from dl.
-
- * ext/dl/lib/dl/cparser.rb (DL::CParser::parse_signature): fixed
- variable name.
-
- * ext/dl/lib/dl/pack.rb (DL::PackInfo): reduced redundant
- initialization.
-
- * ext/dl/lib/dl/stack.rb (DL::Stack): ditto.
-
- * ext/dl/lib/dl/value.rb (DL::ValueUtil#wrap_arg): NULL for nil.
-
- * test/dl: moved from ext/dl/test.
-
-Tue Mar 3 14:57:28 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * common.mk (main): passes $(MAKE) to mkmain_cmd
-
- * ext/extmk.rb (command_output): uses arguments to invoke make.
-
-Tue Mar 3 01:56:03 2009 Tanaka Akira <akr@fsij.org>
-
- * lib/securerandom.rb (SecureRandom.urlsafe_base64): delete padding.
-
-Mon Mar 2 21:39:08 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/sockport.h (SS_LEN): defined unconditionally.
-
-Mon Mar 2 21:26:42 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/ancdata.c (anc_inspect_socket_creds): suppress warnings.
-
-Mon Mar 2 21:13:42 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/ancdata.c (rsock_discard_cmsg_resource): defined
- unconditionally.
-
-Mon Mar 2 21:06:40 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/raddrinfo.c (addrinfo_mload): don't use "sun" variable
- for Solaris.
-
-Mon Mar 2 21:01:36 2009 Tanaka Akira <akr@fsij.org>
-
- * file.c: include fcntl.h for O_RDONLY on Solaris.
-
-Mon Mar 2 19:43:02 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/uri/common.rb (URI::Parser#escape): escaped string is ascii
- only.
-
- * lib/uri/common.rb (URI::Parser#unescape): converts bytewise.
- [ruby-dev:38005], [ruby-dev:38110]
-
-Mon Mar 2 16:40:11 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * README.EXT, README.EXT.ja (Macros): added HAVE_RUBY_*_H.
-
-Mon Mar 2 12:22:12 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * win32/win32.c (init_env): keeps wide chars as wide chars.
-
-Mon Mar 2 11:01:45 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/dl/dl.h (dlerror): fixed on Windows.
-
- * ext/dl/handle.c (rb_dlhandle_initialize): returns handle to
- libruby if nil is given on Windows as dlopen.
-
- * ext/dl/handle.c (rb_dlhandle_sym): get rid of buffer overrun,
- and try ASCII WINAPI versions too.
-
-Mon Mar 2 10:29:17 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval.c (rb_longjmp), include/ruby/intern.h (ruby_cleanup): fixed
- prototypes.
-
-Mon Mar 2 00:56:45 2009 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
-
- * lib/drb/observer.rb: The module observable uses now a hash to
- store listeners. merged a patch from Alessandro Di Maria in
- [ruby-core:22560].
-
-Sun Mar 1 22:59:41 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/raddrinfo.c: suppress warnings.
-
- * ext/socket/socket.c: ditto.
-
- * ext/socket/unixsocket.c: ditto.
-
-Sun Mar 1 20:57:41 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/ (rsock_getfamily): renamed from rb_sock_getfamily.
-
-Sun Mar 1 19:52:46 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/dl/win32/lib/Win32API.rb (initialize): passes res
- arguments to DL.
-
-Sun Mar 1 19:38:59 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/zlib/zlib.c (zstream_run): suppress a warning. a patch from
- Charlie Savage at [ruby-core:22607].
-
-Sun Mar 1 19:36:18 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * util.c (ruby_dtoa): allocates one more byte to get rid of buffer
- overrun. a patch from Charlie Savage at [ruby-core:22604].
-
-Sun Mar 1 19:10:59 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * common.mk (.y.c): removed extra backslash. [ruby-core:22602]
-
-Sun Mar 1 19:02:03 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/dl/cfunc.c (rb_dlcfunc_call): fix for stdcall and missing
- argument numbers. [ruby-core:22601]
-
- * ext/dl/dl.h (DLSTACK_PROTO0_): added.
-
- * ext/dl/mkcallback.rb (gencallback, gen_callback_file),
- (rb_dl_init_callbacks): omit stdcall functions unless supported.
-
- * lib/rubygems/config_file.rb (SHGetFolderPath): stdcall.
-
-Sun Mar 1 17:27:14 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/bigdecimal/bigdecimal.c (gfDebug): uncommented out.
- [ruby-core:22600]
-
-Sun Mar 1 16:15:31 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * process.c (rb_waitpid): use wait_each() on no waitpid platforms.
- [ruby-dev:38054]
-
-Sun Mar 1 16:01:01 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * process.c (proc_daemon): stops and restarts timer thread because
- daemon(3) implies fork(2). [ruby-dev:38055]
-
-Sun Mar 1 15:45:49 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/ (rsock_make_hostent): renamed from sock_make_hostent.
- (rsock_addrinfo): renamed from sock_addrinfo.
- (rsock_getaddrinfo): renamed from sock_getaddrinfo.
- (rsock_socket): renamed from ruby_socket.
- (rsock_sock_s_socketpair): renamed from sock_s_socketpair.
- (rsock_connect): renamed from ruby_connect.
-
- * ext/socket/socket.c (sock_listen): make it static.
-
-Sun Mar 1 15:29:31 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket: add rsock_ prefix.
-
-Sat Feb 28 21:52:37 2009 Tanaka Akira <akr@fsij.org>
-
- * vm_eval.c (rb_iterate): use volatile to suppress warnings.
-
- * eval.c (ruby_cleanup): ditto.
-
-Sat Feb 28 20:09:40 2009 Tanaka Akira <akr@fsij.org>
-
- * eval_error.c (error_print): use volatile to suppress warnings.
-
- * vm_eval.c (eval_string_with_cref): ditto.
-
- * thread.c (rb_exec_recursive): ditto.
-
- * eval_jump.c (rb_exec_end_proc): ditto.
-
- * eval.c (ruby_exec_node): ditto.
- (rb_longjmp): ditto.
-
-Sat Feb 28 18:28:58 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/ancdata.c (ancillary_unix_rights): check message type.
-
-Sat Feb 28 16:18:39 2009 Tanaka Akira <akr@fsij.org>
-
- * lib/net/http.rb: suppress warnings of non-existing instance variable
- access for SSL.
-
-Sat Feb 28 14:50:47 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/lib/socket.rb (BasicSocket#connect_address): returns ::1
- if the address is IPv4-mapped IPv6 address for 0.0.0.0 for MacOS X.
-
-Sat Feb 28 00:18:40 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/raddrinfo.c: suppress strict-aliasing warning with
- gcc version 4.4.0 20090219 (Red Hat 4.4.0-0.21) on Fedora 11 Alpha.
-
- * ext/socket/socket.c: ditto.
-
- * ext/socket/unixsocket.c: ditto.
-
- * ext/socket/sockport.h (SS_LEN): defined.
- (SET_SS_LEN): ditto.
-
-Fri Feb 27 22:30:18 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/ancdata.c (bsock_recvmsg_internal): close FDs passed by
- SCM_RIGHTS unless :scm_rights=>true is given.
- (discard_cmsg): extracted from rsock_discard_cmsg_resource.
-
-Fri Feb 27 22:14:22 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/openssl/lib/openssl/buffering.rb: define Buffering module under
- OpenSSL. [ruby-dev:37906]
-
-Fri Feb 27 22:09:24 2009 Tanaka Akira <akr@fsij.org>
-
- * lib/test/unit/assertions.rb: don't define assert_not_* if already
- overridden.
-
-Fri Feb 27 22:02:34 2009 Tanaka Akira <akr@fsij.org>
-
- * util.c: fix SEGV by test_time.rb with
- gcc version 4.4.0 20090219 (Red Hat 4.4.0-0.21) on Fedora 11 Alpha.
-
-Fri Feb 27 18:30:51 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * compile.c (cdhash_type, iseq_set_sequence): should not call
- methods of the argument of case, to keep the semantics of
- case/when. [ruby-dev:38079]
-
-Fri Feb 27 18:01:20 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * gc.c (ruby_get_stack_grow_direction): no needs to use thread
- here, and not initialized yet. [ruby-core:22439]
-
-Fri Feb 27 17:45:25 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * file.c (file_load_ok): checks if regular file, except for the
- platform disallows to open directories, e.g. dosish.
- [ruby-dev:38097], [Bug #1221]
-
-Fri Feb 27 14:39:40 2009 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * numeric.c (flo_eq, flo_gt, flo_ge, flo_lt, flo_le, flo_eql): revert
- isnan() checks for VC++6.
-
- * insns.def (opt_lt, opt_gt): ditto.
-
-Fri Feb 27 14:23:09 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/ostruct.rb (modifiable): check if really frozen.
- [ruby-core:22559]
-
-Thu Feb 26 23:14:46 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/lib/socket.rb (BasicSocket#connect_address): new method.
-
-Thu Feb 26 19:29:10 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * hash.c (hash_foreach_iter): fix for prototype.
-
-Thu Feb 26 18:36:09 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * common.mk (INSNS, newline.c, miniprelude.c, prelude.c),
- (node_name.inc, known_errors.inc): unified from Makefile.in and
- win32/Makefile.sub.
-
-Thu Feb 26 13:30:34 2009 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * util.c (valid_filename): use our own implementation of open(),
- close() and unlink().
-
-Thu Feb 26 13:23:20 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * iseq.c (cdhash_each): resurrects internal literals.
-
-Thu Feb 26 10:56:48 2009 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * include/ruby/win32.h (rb_w32_wopen): prototype forgotten.
-
- * io.c (rb_sysopen_internal): shouldn't replace undefined chars in this
- case.
-
-Thu Feb 26 01:34:38 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/mkconstants.rb: more MSG_* constants.
-
-Thu Feb 26 00:21:21 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/option.c (sockopt_level): extracted from sockopt_level_m.
- (sockopt_optname): extracted from sockopt_optname_m.
- (sockopt_data): apply StringValue.
- (sockopt_s_linger): new method.
- (sockopt_linger): new method.
- (inspect_linger): show onoff value if it is neither 0 nor 1.
-
-Wed Feb 25 23:23:03 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/ancdata.c (ancillary_unix_rights): raise
- NotImplementedError if no fd passing feature.
- (ancillary_timestamp): raise NotImplementedError if no timestamp
- feature.
-
-Wed Feb 25 23:18:53 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/ancdata.c (ancillary_s_unix_rights): new method.
-
-Wed Feb 25 23:01:26 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/unixsocket.c (unix_recv_io): prevent FD leak when 2 fd is
- sent on LP64 platform.
-
- * ext/socket/rubysocket.h (rsock_discard_cmsg_resource): declared.
-
- * ext/socket/ancdata.c (rsock_discard_cmsg_resource): renamed from
- discard_cmsg_resource. export it.
-
-Wed Feb 25 17:31:32 2009 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * io.c (sysopen_func, rb_sysopen_internal, rb_sysopen): open file
- by UTF-16'ed filename on Windows.
-
- * io.c (rb_file_open_generic, rb_io_s_sysopen, rb_io_reopen,
- argf_next_argv): follow above change.
-
- * io.c (rb_scan_open_args): no longer need to convert filepath here on
- Windows.
-
- * win32/wio32.c (rb_w32_wopen): new function to open file by UTF-16'ed
- filename.
-
- * win32/win32.c (rb_w32_open): call rb_w32_open().
-
-Wed Feb 25 15:05:35 2009 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/Makefile.sub (config.status): use un.rb as cp instead of
- cmd.exe's copy command.
-
- * lib/mkmf.rb (create_makefile): no longer need to convert path
- separator when copying file.
-
-Wed Feb 25 12:27:59 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * string.c (rb_str_force_encoding): should clear coderange at changing
- encoding. [ruby-core:22437]
-
-Wed Feb 25 12:06:09 2009 <nobu@ruby-lang.org>
-
- * io.c (rb_io_getline_1): enables limit even if rs is given.
- [ruby-core:22434]
-
-Wed Feb 25 02:28:51 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * string.c (rb_str_chomp_bang): coderange may change.
- [ruby-core:22414]
-
-Wed Feb 25 02:17:30 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * string.c (rb_str_delete_bang): should recalculate coderange.
- [ruby-talk:329267]
-
-Wed Feb 25 00:41:21 2009 Akinori MUSHA <knu@iDaemons.org>
-
- * class.c (rb_scan_args): Allow specifying the number of trailing
- mandatory arguments right after the number of optional arguments
- only if the number of leading mandatory arguments is not omitted.
-
- * ext/socket/tcpserver.c (tcp_svr_init): Make use of it.
-
-Wed Feb 25 00:28:25 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * file.c (rb_file_size): new method added. [ruby-core:22088]
-
-Wed Feb 25 00:15:15 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * ext/curses/curses.c (curses_colors): new method added. a patch
- from Alexander Beisig in [ruby-core:22331].
-
- * ext/curses/curses.c (curses_color_pairs): ditto.
-
-Wed Feb 25 00:05:13 2009 Akinori MUSHA <knu@iDaemons.org>
-
- * class.c (rb_scan_args): Revamp rb_scan_args() to compute the
- number of required and optional arguments precisely to prepare
- for a more informative error message.
-
-Tue Feb 24 23:58:52 2009 Akinori MUSHA <knu@iDaemons.org>
-
- * array.c (rb_ary_index, rb_ary_rindex): Emit a warning that a
- given block is unused when an argument is specified.
-
-Tue Feb 24 22:00:37 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/socket.c (sockaddr_obj): convert fe80:1::1 to fe80::1%1.
-
-Tue Feb 24 19:56:11 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/ancdata.c (ancillary_timestamp): support SCM_BINTIME.
-
-Tue Feb 24 19:45:15 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/ancdata.c (ancillary_timestamp): new method.
-
-Tue Feb 24 19:01:05 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * common.mk (main): split from exts and makes main program after
- building exts with miniruby, to get rid of overwriting running
- program. [ruby-core:22339]
-
- * Makefile.in, win32/Makefile.sub (RUNCMD, MKMAIN_CMD): macros to
- run script file.
-
- * ext/extmk.rb (parse_args): added --command-output option which
- creates script file to make main program.
-
-Tue Feb 24 17:58:07 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * common.mk (ripper.c): exec can't work on Windows.
-
- * ext/ripper/depend (.SUFFIXES): nmake doesn't have .y by default.
-
- * Makefile.in (id.h): overwrites unconditionally.
-
-Tue Feb 24 13:13:49 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * missing/vsnprintf.c (BSD_vfprintf): ptrdiff_t may be larger than
- long.
-
-Tue Feb 24 11:21:50 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * signal.c (rb_disable_interrupt, rb_enable_interrupt): see
- USE_TRAP_MASK.
-
-Tue Feb 24 10:49:37 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * process.c (rb_waitpid): last argument was missing.
-
- * process.c (waitall_each): fixed typo. a patch from shinichiro.h
- <shinichiro.hamaji AT gmail.com> at [ruby-dev:38054].
-
-Tue Feb 24 01:53:40 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * numeric.c (flo_eq): remove unnecessary NaN check using isnan().
- comparison regarding NaN is false anyway.
-
- * numeric.c (flo_gt, flo_ge, flo_lt, flo_le, flo_eql): ditto.
-
-Tue Feb 24 01:22:19 2009 Yusuke Endoh <mame@tsg.ne.jp>
-
- * bootstraptest/test_thread.rb: fix for environment where fork is not
- available.
-
-Tue Feb 24 01:19:38 2009 Yusuke Endoh <mame@tsg.ne.jp>
-
- * thread.c (thread_cleanup_func): unlock all locked mutexes even when
- forking. [ruby-core:22269]
-
-Tue Feb 24 00:54:16 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * insns.def (opt_minus): inline float operation.
-
- * insns.def (opt_lt, opt_gt): ditto.
-
-Tue Feb 24 00:24:13 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * range.c (range_each): check #succ only when it is really
- needed. small performance improvement.
-
- * math.c (Need_Float): call rb_to_float() only when it is really
- needed. small performance improvement.
-
-Tue Feb 24 00:19:33 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/pathname.rb (Pathname#foreachline): removed wrongly
- resurrected method. [ruby-dev:38065]
-
-Mon Feb 23 20:39:21 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/ancdata.c (inspect_timespec_as_abstime): new function to
- show struct timespec.
- (ancillary_inspect): use it for SCM_TIMESTAMPNS on GNU/Linux.
-
-Mon Feb 23 20:30:06 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/ancdata.c (inspect_bintime_as_abstime): new function to
- show struct bintime.
- (ancillary_inspect): use it for SCM_BINTIME on FreeBSD.
-
- * ext/socket/mkconstants.rb: define SCM_BINTIME.
-
-Mon Feb 23 20:18:49 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/ancdata.c (inspect_timeval_as_abstime): use time_t
- variable to avoid a warning on environments which use long as
- tv_sec as NetBSD.
-
-Mon Feb 23 15:53:30 2009 Akinori MUSHA <knu@iDaemons.org>
-
- * array.c (rb_ary_index, rb_ary_rindex): We know that argc is not
- zero when we reach here.
-
- * array.c (rb_ary_initialize, rb_ary_index): Shrink a double
- space. (NFC)
-
-Mon Feb 23 14:47:04 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/fileutils.rb (mv): added description for the case of
- different partitions. [ruby-talk:329072]
-
-Mon Feb 23 10:19:41 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * include/ruby/ruby.h (USE_SYMBOL_AS_METHOD_NAME): Module#methods,
- #singleton_methods and so on return Symbols. [ruby-talk:328775]
-
-Mon Feb 23 10:15:35 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * README.EXT, README.EXT.ja: added macros for the Compatibilities.
-
-Mon Feb 23 03:19:37 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/mkconstants.rb: define SO_TIMESTAMPNS and SCM_TIMESTAMPNS
- if available.
-
-Mon Feb 23 02:54:31 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/ancdata.c (ancillary_inspect): use SCM_TIMESTAMP instead
- of SO_TIMESTAMP. SCM_TIMESTAMP != SO_TIMESTAMP on MacOS X.
-
-Mon Feb 23 02:44:42 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/ancdata.c (inspect_timeval_as_abstime): new function.
- (ancillary_inspect): use it for SO_TIMESTAMP.
-
-Mon Feb 23 02:26:44 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/option.c (inspect_timeval_as_interval): renamed from
- inspect_timeval.
-
-Mon Feb 23 02:10:09 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/option.c (inspect_timeval): fix the size test.
-
-Sun Feb 22 22:42:20 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * string.c (tr_trans): should recalculate coderange.
- [ruby-core:22326] (reopened at [ruby-core:22328])
-
-Sun Feb 22 20:09:29 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/option.c (inspect_linger): message refined.
-
-Sun Feb 22 19:28:08 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/init.c (s_recvfrom): use rb_io_wait_readable after
- recvfrom.
-
-Sun Feb 22 18:40:04 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/option.c (inspect_errno): new function.
- (sockopt_inspect): use inspect_errno for SO_ERROR.
-
-Sun Feb 22 15:11:51 2009 Tanaka Akira <akr@fsij.org>
-
- * re.c (Init_Regexp): define Regexp::FIXEDENCODING. [ruby-dev:38066]
-
-Sun Feb 22 14:33:06 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * string.c (tr_trans): should not be affected by the encoding of
- replacement unless actually modified. [ruby-talk:328967]
- [ruby-core:22326]
-
-Sun Feb 22 13:38:44 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/socket/init.c (s_recvfrom_nonblock): handles EAGAIN too.
-
- * ext/socket/init.c (s_accept_nonblock): ditto, and EPROTO depends
- on platforms.
-
-Sun Feb 22 13:03:12 2009 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * eval.c (ruby_options): the evaluator now expects iseq instead of tree.
-
- * ruby.c (ruby_process_options): ditto.
-
-Sun Feb 22 13:03:14 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * Makefile.in (configure): unset PWD to use symlink to building
- directory.
-
- * Makefile.in (up): cd doesn't need LC_TIME, VCS needs.
-
-Sun Feb 22 10:43:57 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * vm_eval.c (method_missing): should not pop cfp if missing method
- is method_missing. [ruby-core:22298]
-
- * vm_eval.c (rb_raise_method_missing): new function to directly
- raise NoMethodError.
-
- * vm_insnhelper.c (vm_call_method): fixed the case method_missing
- is missing.
-
-Sun Feb 22 02:15:40 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/ancdata.c (bsock_recvmsg_internal): handle EMSGSIZE as
- well.
-
-Sun Feb 22 02:03:46 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/ancdata.c (bsock_recvmsg_internal): check max length
- overflow.
-
-Sun Feb 22 01:52:30 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/ancdata.c (bsock_recvmsg_internal): don't call
- discard_cmsg_resource when EMFILE.
-
-Sun Feb 22 01:48:51 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/ancdata.c (bsock_recvmsg_internal): gc when SCM_RIGHTS
- hit the file descriptor limit.
-
-Sun Feb 22 00:51:58 2009 Tanaka Akira <akr@fsij.org>
-
- * io.c (io_getpartial): error message describes what should be
- waited after nonblocking error.
- (rb_io_write_nonblock): ditto.
-
- * ext/socket/init.c (s_recvfrom_nonblock): ditto.
- (s_accept_nonblock): ditto.
-
- * ext/socket/socket.c (sock_connect_nonblock): ditto.
-
- * ext/socket/ancdata.c (bsock_sendmsg_internal): ditto.
- (bsock_recvmsg_internal): ditto.
-
-Sun Feb 22 00:31:42 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/ancdata.c (bsock_recvmsg_internal): check recvmsg error
- earlier.
-
-Fri Feb 20 23:28:11 2009 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * util.c (rv_alloc, freedtoa): use our normal xmalloc()/xfree() because
- couldn't free the returned pointer from ruby_dtoa().
-
- * missing/vsnprintf.c (cvt): receive buffer and use/return it instead
- of returning the pointer returned from BSD__dtoa().
-
- * missing/vsnprintf.c (BSD_vfprintf): pass buf to cvt() as the buffer.
- [ruby-core:22184]
-
-Thu Feb 19 22:59:09 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/ancdata.c (make_io_for_unix_rights): cmsg_len may be
- bigger than msg_controllen on 4.4BSD at least.
- freeze unix_rights array.
-
-Thu Feb 19 22:17:38 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/ancdata.c (bsock_recvmsg_internal): fix exception.
-
-Thu Feb 19 21:13:03 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/ancdata.c (ancillary_unix_rights): method renamed.
-
-Thu Feb 19 15:47:11 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * template/fake.rb.in: extracted from Makefile.in.
-
- * configure.in (fake.rb): prefixed with $(arch)-.
-
-Thu Feb 19 15:39:50 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Mar 9 20:59:24 2009 Shugo Maeda <shugo@ruby-lang.org>
* ext/openssl/ossl_ocsp.c (ossl_ocspbres_verify): OCSP_basic_verify
returns positive value on success, not non-zero. [ruby-core:21762]
+ backported r22440 from trunk.
-Thu Feb 19 15:17:00 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/tmpdir.rb (@@systmpdir): File.expand_path also joins paths.
-
-Thu Feb 19 15:14:25 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/etc/etc.c (etc_each_group): defines only when Etc::Group is
- available.
-
-Thu Feb 19 15:11:40 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval_intern.h (translit_char): moved from ruby.c.
-
- * load.c (load_ext): transliterates file separators and back if
- needed.
-
- * symbian/setup (DLN_NEEDS_ALT_SEPARATOR): defined.
-
-Thu Feb 19 14:48:12 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in, */Makefile.sub (LOAD_RELATIVE): moved from ruby.c
-
-Thu Feb 19 14:39:53 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in (darwin): uses -unexported_symbol option of ld instead
- of objcopy
-
- * configure.in (darwin): makes dylib instead of so.
-
-Thu Feb 19 14:22:02 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/mkmf.rb (create_makefile): added phony targets.
-
- * lib/mkmf.rb (create_makefile): creates target directories before
- copying. [ruby-core:21958]
-
- * lib/mkmf.rb (create_makefile): removes directories in the depth
- order.
-
-Thu Feb 19 13:56:00 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * file.c (rb_home_dir): checks if HAVE_PWD_H. [ruby-dev:38049]
-
-Thu Feb 19 08:45:48 2009 TAKANO Mitsuhiro (takano32) <tak@no32.tk>
-
- * ext/socket/rubysocket.h: add "#include <sys/stat.h>"
-
-Thu Feb 19 03:42:48 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/ancdata.c (ancillary_rights): new method.
- (make_io_for_rights): new function to allocate
- IOs for FDs in SCM_RIGHTS message.
- (bsock_recvmsg_internal): use make_io_for_rights. So the FDs can be
- closed by GC.
-
-Thu Feb 19 03:28:59 2009 Akinori MUSHA <knu@iDaemons.org>
-
- * README.EXT, README.EXT.ja: Improve the document about
- rb_scan_args() even more.
-
-Thu Feb 19 03:12:51 2009 Yusuke Endoh <mame@tsg.ne.jp>
-
- * test/ruby/test_file_exhaustive.rb: skip some tests if euid == 0.
- a patch from Lucas Nussbaum in [ruby-core:22209].
-
-Thu Feb 19 03:00:49 2009 Akinori MUSHA <knu@iDaemons.org>
-
- * README.EXT, README.EXT.ja: Improve the document about
- rb_scan_args().
-
-Wed Feb 18 22:47:01 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/ancdata.c (discard_cmsg_resource): new function to close
- file descriptors in control message.
- (bsock_recvmsg_internal): call discard_cmsg_resource before retrying
- recvmsg.
-
-Wed Feb 18 21:47:37 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/ancdata.c (bsock_recvmsg_internal): prevent misalignment.
-
-Wed Feb 18 21:34:30 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/ancdata.c (bsock_sendmsg_internal): prevent misalignment.
-
-Wed Feb 18 21:09:43 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/ancdata.c (bsock_recvmsg_internal): reduce code on
- environments which have no control message.
-
-Wed Feb 18 20:27:16 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in (OBJCOPY): set ac_cv_prog_ac_ct_OBJCOPY to do nothing
- on cygwin and mingw because symbols are exported by def file.
+Mon Mar 9 10:02:15 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
-Wed Feb 18 15:35:36 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * re.c (match_check): check if MatchData is initialized.
+ [ruby-core:18749]
- * file.c (rb_file_chown): use chown unless HAVE_FCHOWN.
+Mon Mar 9 09:56:34 2009 Shugo Maeda <shugo@ruby-lang.org>
- * io.c (pipe_open): sarg is always used unless HAVE_FORK.
+ * lib/rexml/rexml.rb: incremented Ruby::VERSION. Thanks, Jeremy
+ Kemper. [ruby-core:20113]
-Wed Feb 18 15:23:34 2009 Akinori MUSHA <knu@iDaemons.org>
+Mon Mar 9 09:52:53 2009 Tanaka Akira <akr@fsij.org>
- * bootstraptest/runner.rb: Use RUBY_DESCRIPTION if defined.
+ * io.c (io_getpartial): fflush after read for updating pos in FILE.
+ not portable, I guess. [ruby-core:21561]
-Wed Feb 18 14:33:35 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * array.c (rb_ary_resurrect), string.c (rb_str_resurrect): new
- functions based on [ruby-dev:37983]
-
- * insns.def (putstring, duparray): use rb_{ary,str}_resurrect().
-
- * iseq.c (iseq_data_to_ary): needs to result TS_VALUE.
-
-Wed Feb 18 12:35:31 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * file.c (rb_file_s_extname): fix for spaces before extension.
- [ruby-dev:38044]
-
-Wed Feb 18 12:00:58 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * file.c (file_expand_path): suppress a warning. named magic
- numbers.
-
-Wed Feb 18 10:29:12 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * thread.c (thread_start_func_2): do not delete main thread from
- living_threads. [ruby-core:19385], [ruby-core:22158]
-
-Wed Feb 18 01:05:05 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/openssl: avoid cyclic require.
-
- * ext/openssl/lib/openssl/ssl-internal.rb: renamed from ssl.rb
-
- * ext/openssl/lib/openssl/x509-internal.rb: renamed from x509.rb.
-
- * lib/net/imap.rb: require openssl, instead of openssl/ssl.
-
- * lib/net/pop.rb: require openssl, instead of openssl/ssl.
-
- [ruby-dev:38018]
-
-Wed Feb 18 00:55:47 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/etc/etc.c (Etc::Passwd.each, Etc::Group.each): new methods.
- [ruby-dev:37999]
-
-Tue Feb 17 23:25:01 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/ancdata.c (bsock_sendmsg_internal): make the padding
- removing only on NetBSD.
-
-Tue Feb 17 19:39:04 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/ancdata.c (bsock_sendmsg_internal): should not remove the
- last padding of control messages, basically.
-
-Tue Feb 17 12:50:57 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * string.c (rb_str_shared_replace): no need for
- str_make_independent.
-
-Tue Feb 17 05:41:08 2009 Koichi Sasada <ko1@atdot.net>
-
- * compile.c: fix to add "ensure" codes across "while" clause
- before "return" expression. [ruby-dev:37967]
-
- * bootstraptest/test_flow.rb: add a test.
-
-Tue Feb 17 01:53:35 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/mkconstants.rb: generate rb_define_const directly for
- rdoc.
-
- * ext/.document: add socket/constdefs.c.
-
- * ext/socket/constants.c (sock_define_const): removed.
- (sock_define_uconst): ditto.
- (rb_mSockConst): new static variable.
-
-Mon Feb 16 23:14:51 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/ancdata.c (bsock_sendmsg_internal) [OpenBSD]: don't remove
- the last padding to prevent sendmsg failure in test_udp_server in
- test/socket/test_socket.rb on OpenBSD 4.4.
-
-Mon Feb 16 21:59:32 2009 Alexander Zavorine <alexandre.zavorine@nokia.com>
-
- * symbian/setup: Update Symbian config to match recent changes in missing/alloca.c
-
-Mon Feb 16 17:04:14 2009 Akinori MUSHA <knu@iDaemons.org>
-
- * class.c (rb_scan_args), README.EXT, README.EXT.ja: Add support
- for specifying the number of the trailing mandatory arguments.
- Update the documents accordingly. [ruby-dev:37995]
-
-Mon Feb 16 16:46:14 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * debug.c (set_debug_option): added rtc_error option.
-
- * win32/Makefile.sub (CRTDEFFLAGS): separated from DEFS.
-
- * win32/win32.c (rtc_error_handler): ignores RTC errors unless
- rtc_error debug option is given.
-
- * win32/win32.c (rb_w32_sysinit): suppress useless CRT assertions.
- [ruby-core:22116]
-
-Sun Feb 15 21:43:44 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/ostruct.rb (OpenStruct#new_ostruct_member): checks if frozen.
- [ruby-talk:328195], [ruby-core:22142]
-
-Sun Feb 15 21:22:48 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/test/unit/assertions.rb (Test::Unit::Assertions): aliases
- assert_not_ methods.
-
-Sun Feb 15 16:57:35 2009 Tanaka Akira <akr@fsij.org>
-
- * lib/securerandom.rb (SecureRandom.urlsafe_base64): new method.
-
-Sun Feb 15 14:58:07 2009 Tanaka Akira <akr@fsij.org>
-
- * hash.c (hash_i): use Murmurhash.
-
-Sun Feb 15 11:45:29 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * variable.c (rb_define_hooked_variable): suppress false assertion
- with VC9. [ruby-core:22115]
-
-Sun Feb 15 08:35:33 2009 Tanaka Akira <akr@fsij.org>
-
- * test/test_pp.rb: extract from lib/pp.rb.
-
- * test/test_prettyprint.rb: extract from lib/prettyprint.rb.
-
- * test/test_tsort.rb: extract from lib/tsort.rb.
-
-Sun Feb 15 06:34:22 2009 Tanaka Akira <akr@fsij.org>
-
- * lib/time.rb (Time.parse): raise ArgumentError if Date._parse don't
- extract date information. [ruby-core:20912]
-
-Sun Feb 15 04:48:08 2009 Yusuke Endoh <mame@tsg.ne.jp>
-
- * string.c (rb_hash_uint32, rb_hash_uint, rb_hash_start, rb_hash_end),
- include/ruby/intern.h: add Murmurhash API. [ruby-dev:37784]
-
- * complex.c (nucomp_hash), array.c (rb_ary_hash), time.c (time_hash),
- string.c (rb_str_hash), object.c (rb_obj_hash), range.c
- (range_hash), struct.c (rb_struct_hash), hash.c (rb_any_hash),
- rational.c (nurat_hash): use Murmurhash. [ruby-dev:37784]
-
-Sun Feb 15 03:50:21 2009 Yusuke Endoh <mame@tsg.ne.jp>
-
- * hash.c (rb_hash): always return a fixnum value because a return
- value of rb_hash may be used as a hash value itself and bignums have
- no unique VALUE.
-
- * test/ruby/test_hash.rb: add a test for above.
-
-Sun Feb 15 00:45:41 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * array.c (rb_ary_uniq_bang, rb_ary_uniq): unique by the result of
- given block. [ruby-dev:37998]
-
-Sun Feb 15 00:39:44 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * array.c (ary_resize_capa): should not overwrite outside embedded
- array.
-
-Sat Feb 14 20:18:19 2009 Tanaka Akira <akr@fsij.org>
-
- * test/test_time.rb: extracted from lib/time.rb.
-
-Sat Feb 14 19:20:15 2009 Tanaka Akira <akr@fsij.org>
-
- * lib/pathname.rb: obsolete methods removed.
- [ruby-core:21564]
-
-Sat Feb 14 15:46:01 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/pathname.rb (Pathname#binread): added. [ruby-dev:37952]
-
-Sat Feb 14 13:14:18 2009 TAKANO Mitsuhiro (takano32) <tak@no32.tk>
-
- * iseq.c: remove nil parameter from Proc#parameters
- after rest appeared.
-
-Sat Feb 14 07:23:52 2009 NARUSE, Yui <naruse@ruby-lang.org>
-
- * string.c (rb_external_str_new_with_enc): change evaluation order
- for speed.
-
-Sat Feb 14 02:20:04 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/sockport.h (SET_SA_LEN): cast to void for suppressing a
- warning.
-
-Fri Feb 13 23:37:10 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/dl/win32/lib/Win32API.rb (Win32API#initialize): DL.dlopen
- raises DLError.
-
-Fri Feb 13 21:13:19 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/socket.c (Init_socket): define TCPServer#listen and
- UNIXServer#listen here for rdoc.
-
-Fri Feb 13 20:59:48 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/ancdata.c (extract_ipv6_pktinfo): set sa_len for 4.4BSD.
-
-Fri Feb 13 15:34:18 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * iseq.c (simple_default_value): removed. default values of optional
- parameters are not available still now. [ruby-dev:37980]
-
-Fri Feb 13 15:11:11 2009 Koichi Sasada <ko1@atdot.net>
-
- * vm_eval.c (eval_string_with_cref): use rb_vm_get_ruby_level_next_cfp()
- instead of vm_get_ruby_level_caller_cfp(). checking a upper frame
- is not enough. [ruby-dev:37984]
-
- * proc.c, vm_core.h: declare rb_vm_get_ruby_level_next_cfp()
- on vm_core.h.
-
-Fri Feb 13 15:01:40 2009 Koichi Sasada <ko1@atdot.net>
-
- * cont.c (rb_fiber_alive_p): fix to return true instead of 0.
- [ruby-dev:37991]
-
- * test/ruby/test_fiber.rb: add a test for Fiber#alive?
-
-Fri Feb 13 09:43:19 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in (ac_cv_func_flock): using flock defined in
- win32/win32.c on mingw.
-
-Fri Feb 13 01:45:17 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * compile.c (iseq_set_sequence, compile_dstr_fragments),
- (iseq_compile_each): hides other internal objects.
-
- * compile.c (iseq_compile_each): just freeze xstr.
-
-Fri Feb 13 00:48:42 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * insns.def (defineclass): try to autoload const to be overridden.
-
-Thu Feb 12 23:22:29 2009 Tanaka Akira <akr@fsij.org>
-
- * test/socket/test_socket.rb (test_udp_server): filter out unreachable
- addresses. [ruby-dev:37970]
-
-Thu Feb 12 22:51:18 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * compile.c (hide_obj): OBJ_FREEZE() is not an expression. a patch
- from nagachika <nagachika00 AT gmail.com> at [ruby-dev:37977].
-
- * compile.c (insn_set_sc_state): fixed typo.
-
-Thu Feb 12 12:36:35 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/basicsocket.c (bsock_getpeereid): implemented for Solaris
- using getpeerucred.
-
- * ext/socket/extconf.rb: check ucred.h and getpeerucred.
-
- * ext/socket/rubysocket.h: include ucred.h if available.
-
-Thu Feb 12 19:42:33 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * compile.c (compile_array_, defined_expr, iseq_compile_each): hide
- and freeze internal literal objects, to prevent from modifying.
- [ruby-dev:37959]
-
- * iseq.c (insn_operand_intern): copy internal literal objects.
-
- * insns.def (putstring, duparray): ditto.
-
- * string.c (rb_str_replace): exported.
-
-Thu Feb 12 17:17:51 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/stringio/stringio.c (strio_ungetc): calculates new position
- before reallocation. [Bug#1099]
-
-Thu Feb 12 16:50:27 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in: a patch to build on GNU/kOpenSolaris from Rober
- Millan at [ruby-core:21888].
-
-Thu Feb 12 15:28:04 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * iseq.c (simple_default_value): allow plain strings as default
- values.
-
-Wed Feb 11 18:09:41 2009 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * gc.c (define_final, undefine_final): shouldn't add/remove finalizer
- of frozen objects.
-
- * gc.c (undefine_final): should remove FL_FINALIZE flag.
- [ruby-dev:37964] (also see [ruby-dev:37959])
-
-Wed Feb 11 17:37:41 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/lib/socket.rb (Socket.udp_server_sockets): call the block
- if given. close the sockets when the block exits.
- (Socket.udp_server_loop): use udp_server_sockets in block form.
-
-Wed Feb 11 17:34:16 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/lib/socket.rb (Socket.tcp_server_sockets): call the block
- if given. close the sockets when the block exits.
- (Socket.tcp_server_loop): use tcp_server_sockets in block form.
-
-Wed Feb 11 17:01:52 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/lib/socket.rb (Socket.unix_server_loop): use
- unix_server_socket with a block.
-
-Wed Feb 11 16:54:26 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/lib/socket.rb (Socket.unix_server_socket): close the
- socket when the block exits.
-
-Wed Feb 11 16:50:59 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/lib/socket.rb (Socket.unix_server_socket): call the block
- if given. remove the socket file when the block exits.
-
-Wed Feb 11 16:44:20 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/ancdata.c (ancillary_s_ip_pktinfo): make 3rd argument
- optional.
-
-Wed Feb 11 15:47:10 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * array.c (ary_make_shared): returns shared root array itself, and
- frozen array can be shared.
-
-Wed Feb 11 14:46:16 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * insns.def (setspecial, putstring): fixed typos in rdoc.
-
- * insns.def (toregexp): uses rb_ary_tmp_new(), and clears it after
- used.
-
-Wed Feb 11 14:08:23 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/ancdata.c (anc_inspect_socket_rights): return 1 on
- success. 0 on failure.
- (anc_inspect_passcred_credentials): ditto.
- (anc_inspect_socket_creds): ditto.
- (anc_inspect_socket_creds): ditto.
- (anc_inspect_socket_creds): ditto.
- (anc_inspect_ip_recvdstaddr): ditto.
- (anc_inspect_ip_pktinfo): ditto.
- (anc_inspect_ipv6_pktinfo): ditto.
- (ancillary_inspect): check family.
-
-Wed Feb 11 12:55:07 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/ancdata.c (anc_inspect_ip_pktinfo): make result bit
- succinct.
- (Init_ancdata): fix number of arguments.
-
-Wed Feb 11 11:47:41 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/ipsocket.c (Init_ipsocket): undef getpeereid at IPSocket.
-
-Wed Feb 11 10:16:34 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/extconf.rb: check getpeereid.
-
- * ext/socket/basicsocket.c (bsock_getpeereid): new method.
-
-Wed Feb 11 09:58:59 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/lib/socket.rb (Socket::UDPSource#inspect): fix variable
- name.
-
-Wed Feb 11 00:38:16 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/socket.c (sock_gethostname): use HOST_NAME_MAX.
-
- * ext/socket/raddrinfo.c (make_ipaddr): local variable renamed.
-
-Tue Feb 10 23:44:53 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/init.c (struct recvfrom_arg): use struct
- sockaddr_storage.
- (recvfrom_blocking): follow struct recvfrom_arg change.
- (s_recvfrom): ditto.
- (s_recvfrom_nonblock): use struct sockaddr_storage.
-
- * ext/socket/socket.c (sock_accept): use struct sockaddr_storage.
- (sock_accept_nonblock): ditto.
- (sock_sysaccept): ditto.
-
- * ext/socket/ancdata.c (bsock_recvmsg_internal): use struct
- sockaddr_storage.
-
-Tue Feb 10 23:30:32 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/basicsocket.c (bsock_getpeername): use struct
- sockaddr_storage.
- (bsock_local_address): ditto.
- (bsock_remote_address): ditto.
-
-Tue Feb 10 21:26:33 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/lib/socket.rb (Socket.udp_server_sockets): new method.
- (Socket.udp_server_loop_on): new method.
- (Socket.udp_server_loop): new method
- (Socket.ip_sockets_port0): extracted from tcp_server_sockets_port0.
- (Socket::UDPSource): new class.
-
-Tue Feb 10 21:14:43 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/socket.c (sockaddr_obj): fill pfamily.
-
-Tue Feb 10 21:09:23 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/option.c (sockopt_s_bool): new method.
- (sockopt_bool): new method.
-
-Tue Feb 10 20:58:47 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/option.c (sockopt_family_m): renamed from sockopt_family.
- (sockopt_level_m): renamed from sockopt_level.
- (sockopt_optname_m): renamed from sockopt_optname.
- (inspect_local_peercred): follow the renaming.
- (Init_sockopt): ditto.
-
-Tue Feb 10 20:56:07 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/ancdata.c (anc_inspect_socket_creds): refactored to avoid
- a rb_str_cat2 call.
-
-Tue Feb 10 04:34:38 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in (when): makes parentheses balanced.
-
-Tue Feb 10 01:28:49 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/ancdata.c (ip_cmsg_type_to_sym): renamed from
- cmsg_type_to_sym.
-
-Tue Feb 10 01:22:56 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/option.c (sockopt_inspect): refactored.
-
-Tue Feb 10 01:02:16 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/mkconstants.rb: generate intern_family_noprefix.
-
- * ext/socket/option.c (sockopt_inspect): use intern_family_noprefix
- not to show AF_ prefix.
-
- * ext/socket/ancdata.c (ancillary_inspect): ditto.
-
-Mon Feb 9 23:21:29 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/constants.c (level_arg): use unknown_level_to_int for
- non internet protocol.
- (optname_arg): use only so_optname_to_int for non internet protocol.
- (cmsg_type_arg): use only scm_optname_to_int for non internet
- protocol.
-
- * ext/socket/mkconstants.rb: generate unknown_level_to_int.
- rename iplevel_to_int to ip_level_to_int.
-
-Mon Feb 9 23:04:27 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/mkconstants.rb: rename level_to_int to iplevel_to_int.
- rename intern_level to intern_iplevel.
-
- * ext/socket/constants.c: follow the renaming.
-
- * ext/socket/option.c: ditto.
-
- * ext/socket/ancdata.c: ditto.
-
-Mon Feb 9 22:52:13 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/rubysocket.h (level_arg): add family argument.
- (optname_arg): ditto.
- (cmsg_type_arg): ditto.
- (rb_sock_getfamily): declared.
-
- * ext/socket/constants.c (level_arg): add family argument.
- (optname_arg): ditto.
- (cmsg_type_arg): ditto.
-
- * ext/socket/init.c (rb_sock_getfamily): defined.
-
- * ext/socket/option.c (sockopt_initialize): give family for level_arg
- and optname_arg.
- (sockopt_s_int): ditto.
-
- * ext/socket/basicsocket.c (bsock_setsockopt): ditto.
- (bsock_getsockopt): ditto.
-
- * ext/socket/ancdata.c (ancillary_initialize): ditto.
- (ancillary_s_int): ditto.
- (ancillary_cmsg_is_p): ditto.
- (bsock_sendmsg_internal): ditto.
- (bsock_recvmsg_internal): use rb_sock_getfamily.
-
-Mon Feb 9 21:48:59 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/ancdata.c (ancillary_inspect): show address family.
-
-Mon Feb 9 20:19:36 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/basicsocket.c (bsock_getsockname): use sockaddr_storage.
-
-Mon Feb 9 20:11:55 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/win32ole/win32ole.c (load_conv_function51932): fixed for the
- case IMultiLanguage is not available. [ruby-dev:37950]
-
-Mon Feb 9 20:04:35 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/option.c (inspect_int): return 1/0 on success/failure.
- (inspect_uint): ditto.
- (inspect_linger): ditto.
- (inspect_socktype): ditto.
- (inspect_timeval): ditto.
- (inspect_peercred): ditto.
- (inspect_local_peercred): ditto.
- (sockopt_inspect): refactored.
-
-Mon Feb 9 20:00:26 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/mkconstants.rb: more constants for Solaris.
-
-Mon Feb 9 19:59:18 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/basicsocket.c (bsock_getsockopt): refine address family
- examination.
-
-Mon Feb 9 19:52:32 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/option.c (sockopt_initialize): argument conversion
- reordered.
-
-Mon Feb 9 19:46:22 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/ancdata.c (ancillary_initialize): add family argument.
- (ancdata_new): ditto.
- (ancillary_s_int): ditto.
- (ancillary_family): new function.
- (ancillary_family_m): new method.
- (ancillary_s_ip_pktinfo): follow ancdata_new change.
- (ancillary_s_ipv6_pktinfo): ditto.
- (bsock_recvmsg_internal): examine the socket address family.
-
-Mon Feb 9 11:31:09 2009 NARUSE, Yui <naruse@ruby-lang.org>
-
- * io.c (io_encoding_set): ignore second argument when external and
- internal are same. [ruby-dev:37939]
-
-Mon Feb 9 09:05:12 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/option.c (inspect_local_peercred): check version.
- (sockopt_inspect): suppress warning.
-
-Mon Feb 9 02:04:03 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/option.c (inspect_peercred): struct ucred contains
- effective uid/gid.
-
-Mon Feb 9 00:44:45 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/option.c (sockopt_inspect): add ifdef guard for
- LOCAL_PEERCRED.
-
-Mon Feb 9 00:37:06 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/option.c (inspect_local_peercred): cr_uid is a effective
- uid, not a real uid.
-
-Mon Feb 9 00:30:56 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/extconf.rb: check sys/param.h and sys/ucred.h.
-
- * ext/socket/rubysocket.h: include sys/param.h and sys/ucred.h.
-
- * ext/socket/option.c (inspect_local_peercred): new function to show
- LOCAL_PEERCRED socket option on FreeBSD.
- (sockopt_inspect): show as LOCAL_* socket option if AF_UNIX and level
- is 0.
-
-Mon Feb 9 00:01:47 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/rubysocket.h (sockopt_new): add family argument.
-
- * ext/socket/option.c (sockopt_initialize): add vfamily argument.
- (sockopt_new): add family argument and record it in the object.
- (sockopt_family): new method.
- (sockopt_s_int): add vfamily argument.
- (sockopt_inspect): show family.
-
- * ext/socket/basicsocket.c (bsock_getsockopt): check address family
- using getsockname.
-
-Sun Feb 8 23:37:17 2009 Yusuke Endoh <mame@tsg.ne.jp>
-
- * enumerator.c (enumerator_with_index): receives one argument which
- represents a start offset. [ruby-dev:37921]
-
-Sun Feb 8 23:28:05 2009 Yusuke Endoh <mame@tsg.ne.jp>
-
- * include/ruby/st.h, st.c: order entries by a linked list instead of
- a loop to fix iteration miss when hash is modified during iteration.
- [ruby-dev:37910]
-
-Sun Feb 8 23:22:35 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/option.c (inspect_peercred): new function to show
- SO_PEERCRED socket option on GNU/Linux.
-
-Sun Feb 8 22:44:20 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * include/ruby/backward/rubysig.h (rb_thread_blocking_region_begin),
- (rb_thread_blocking_region_end): marked as deprecated.
-
- * include/ruby/backward/rubysig.h (TRAP_BEG): fix for C++. a
- patch from Aman Gupta at [ruby-core:21934]
-
-Sun Feb 8 21:47:50 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/extconf.rb: check struct cmsgcred.
-
- * ext/socket/ancdata.c (anc_inspect_passcred_credentials): add
- "(ucred)".
- (anc_inspect_socket_creds): show struct cmsgcred too, for FreeBSD.
-
-Sun Feb 8 21:05:35 2009 Tanaka Akira <akr@fsij.org>
-
- * lib/drb/extservm.rb (DRb::ExtServManager#invoke_service_command):
- detach spawned process. [ruby-dev:37936]
-
-Sun Feb 8 20:30:29 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/extconf.rb: check struct sockcred.
-
- * ext/socket/ancdata.c (anc_inspect_socket_creds): new function to
- show SCM_CREDS on NetBSD.
-
-Sun Feb 8 19:05:24 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * include/ruby/backward/rubysig.h: extern "C" was missing.
- [ruby-core:21929]
-
-Sun Feb 8 18:46:15 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/ancdata.c (anc_inspect_passcred_credentials): new
- function to show SCM_CREDENTIALS on GNU/Linux.
-
-Sun Feb 8 18:34:43 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * io.c (rb_io_s_binread): ensures file path. [ruby-dev:37940]
-
-Sun Feb 8 13:52:02 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/raddrinfo.c (init_unix_addrinfo): add socktype argument.
- (addrinfo_initialize): follow init_unix_addrinfo change.
- (addrinfo_s_unix): add optional argument: socktype
-
-Sun Feb 8 13:09:32 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in (RUBY_APPEND_OPTION, RUBY_APPEND_OPTIONS),
- (RUBY_PREPEND_OPTION, RUBY_PREPEND_OPTIONS): add option(s)
- without duplication.
-
- * configure.in (RUBY_DEFINE_IF): changed parameter order, now
- condition comes first.
-
- * configure.in (universal_binary): checks architecture macros, and
- improved thin load paths.
-
-Sun Feb 8 09:41:47 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * runruby.rb: gets extout and arch from rbconfig.rb.
-
-Sat Feb 7 21:26:15 2009 Tanaka Akira <akr@fsij.org>
-
- * test/socket/test_addrinfo.rb (test_family_addrinfo): don't use
- www.ruby-lang.org.
- http://d.hatena.ne.jp/nagachika/20090204/working_for_0f0e
-
-Sat Feb 7 18:02:48 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in (--with-arch): added new option to support
- universal binary. replaced --enable-fat-binary option which
- didn't work actually.
-
- * configure.in (RUBY_FUNC_ATTRIBUTE): added conditional test.
-
- * configure.in (ac_cv_type_getgroups): declared because getgroups()
- fills rest of the buffer with garbage on Rosetta.
-
- * configure.in (alloca): defines only for powerpc, but always
- create empty object to suppress ld warning.
-
- * configure.in (LIBRUBY_DLDFLAGS): set compatibility version with
- TEENY.
-
- * configure.in (CFLAGS, LDFLAGS): separates ARCH_FLAG.
-
- * configure.in (arch): renamed to "universal" from "fat".
-
- * Makefile.in (ARCH_FLAG): added.
-
- * include/ruby/defines.h (WORDS_BIGENDIAN): uses
- AC_APPLE_UNIVERSAL_BUILD.
-
- * missing/alloca.c (alloca): defines only if C_ALLOCA is defined.
-
-Sat Feb 7 12:31:03 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * runruby.rb: added --precommand and --show options.
-
- * runruby.rb: added --cpu option.
-
- * runruby.rb: skips version check in rbconfig.rb.
-
-Sat Feb 7 11:44:06 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/mkmf.rb (have_header): needs dependent headers if trying to
- compile.
-
- * ext/socket/extconf.rb: net/if.h depends on other headers.
-
-Sat Feb 7 04:02:37 2009 Tanaka Akira <akr@fsij.org>
-
- * dir.c (dir_read): don't disable rdoc.
-
-Fri Feb 6 23:28:33 2009 Tanaka Akira <akr@fsij.org>
-
- * io.c (io_fread): use rb_io_wait_readable for retry
- avoid Errno::EINTR on ruby -e 'trap(:CHLD) {}; spawn("sleep 1"); STDIN.read'
-
-Fri Feb 6 22:36:11 2009 Alexander Zavorine <alexandre.zavorine@nokia.com>
-
- * thread_pthread.c (native_thread_create) [__SYMBIAN32__]: reduced pthread stack size.
-
- * thread_pthread.c (thread_timer) [__SYMBIAN32__]: compiled out unsupported yet signal-related functionality.
-
- * io.c (pipe_open) [__SYMBIAN32__]: fixed compile time error.
-
-Fri Feb 6 22:11:46 2009 Alexander Zavorine <alexandre.zavorine@nokia.com>
-
- * include/ruby/defines.h [__SYMBIAN32__]: included <sys/select.h> for fd_set definition
-
-Fri Feb 6 21:58:24 2009 Alexander Zavorine <alexandre.zavorine@nokia.com>
-
- * symbian/missing-pips.c: added a stub for missing PIPS function execl.
-
- * process.c (rb_proc_exec) [__SYMBIAN32__]: removed conditional around execl function call.
-
-Fri Feb 6 20:37:42 2009 Tanaka Akira <akr@fsij.org>
-
- * signal.c (register_sigaltstack): ignore sigaltstack error.
- It fails on OpenBSD 4.4 when pthread library is linked.
-
-Fri Feb 6 18:18:07 2009 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/win32.c (rb_w32_readdir_with_enc): fallback to OS's conversion
- when ASCII-8BIT is passed.
-
-Fri Feb 6 17:19:23 2009 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/{dir.h, win32.c} (rb_w32_readdir_with_enc): new function to
- read entry with specified enc.
-
- * win32/win32.c (readdir_internal): extract from rb_w32_opendir().
-
- * win32/win32.c (opendir_internal): extract from rb_w32_readdir().
-
- * dir.c (dir_read, dir_each): use new READDIR macro instead of readdir()
- to pass enc for special version of readdir, such as above.
-
-Fri Feb 6 12:11:24 2009 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * ruby.c (process_options): set initial default_external before -r.
-
-Fri Feb 6 12:03:47 2009 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * ruby.c (process_options): -K and -E in shebang should be reflect to
- default_external. [ruby-dev:37920]
-
-Fri Feb 6 07:52:57 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/pty/pty.c (chfunc): type fixed.
-
-Fri Feb 6 02:51:59 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * string.c (rb_str_each_codepoint): update RDoc for
- String#codepoints. a patch from Radoslaw Bulat in
- [ruby-core:21835]
-
-Fri Feb 6 01:09:13 2009 Yusuke Endoh <mame@tsg.ne.jp>
-
- * cont.c (cont_mark, cont_capture, cont_restore_1): use #else instead
- of #elif. a patch from NISHIMATSU Takeshi <t_nissie at yahoo.co.jp>
- in [ruby-list:45856].
-
-Thu Feb 5 20:28:27 2009 Tanaka Akira <akr@fsij.org>
-
- * include/ruby/intern.h (rb_run_exec_options_err): renamed from
- rb_run_exec_options.
- (rb_exec_err): renamed from rb_exec.
- (rb_fork_err): renamed from rb_fork.
- (rb_spawn_err): renamed from rb_spawn.
- (rb_run_exec_options): declared with 1.9.1 compatible signature.
- (rb_exec): ditto.
- (rb_fork): ditto.
- (rb_spawn): ditto.
-
- * process.c (rb_run_exec_options_err): renamed from
- rb_run_exec_options.
- (rb_exec_err): renamed from rb_exec.
- (rb_fork_err): renamed from rb_fork.
- (rb_spawn_err): renamed from rb_spawn.
- (rb_run_exec_options): defined.
- (rb_exec): ditto.
- (rb_fork): ditto.
- (rb_spawn): ditto.
-
- * io.c: follow above change.
-
- * ext/pty/pty.c: follow above change.
-
- [ruby-dev:37893]
-
-Thu Feb 5 19:58:40 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket: AddrInfo is renamed to Addrinfo. [ruby-dev:37876]
-
-Thu Feb 5 16:18:13 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in (RUBY_SITE_LIB_PATH, RUBY_VENDOR_LIB_PATH): fix for
- NetBSD.
-
-Thu Feb 5 16:04:29 2009 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/Makefile.sub (config.h): follow recent changes about paths.
-
-Thu Feb 5 14:26:16 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in (MAJOR, MINOR, TEENY): uses RUBY_VERSION_*.
-
- * mkconfig.rb (prefix): uses ruby_version in config.status.
-
-Thu Feb 5 12:24:18 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * array.c (rb_ary_uniq): gets rid of copying.
-
-Thu Feb 5 12:01:53 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * array.c (ary_add_hash): split from ary_make_hash().
-
- * array.c (ary_make_hash): hide a Hash used internally.
-
- * array.c (ary_recycle_hash): clears internally used hash. this
- name came from [ruby-dev:37908].
-
- * array.c (rb_ary_diff, rb_ary_and, rb_ary_or, rb_ary_uniq_bang):
- recycle hashes.
-
-Thu Feb 5 11:21:35 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in (RUBY_LIB_VERSION): added for library version, to
- split from core version. [ruby-dev:37748]
-
- * configure.in (RUBY_LIB_PATH, etc): moved actual version
- dependent stuff to version.c.
-
- * ruby.c (ruby_init_loadpath_safe): ditto.
-
- * version.c (ruby_initial_load_paths): moved initial load path
- version depending on version from ruby.c.
-
- * version.h (RUBY_VERSION_{MAJOR,MINOR,TEENY}): now mean library
- and API version, and reverted to 1.9.1. [ruby-dev:37889]
-
-Thu Feb 5 07:39:33 2009 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-
- * ext/readline/readline.c (Init_readline): remove_history(0) may be
- NULL. [ruby-dev:37891]
-
-Thu Feb 5 03:55:22 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * time.c (LOCALTIME): should call tzset() before localtime_r().
- [ruby-dev:37896]
-
-Thu Feb 5 02:12:35 2009 Alexander Zavorine <alexandre.zavorine@nokia.com>
-
- * symbian/configure.bat: Updated Symbian configuration procedure to
- avoid creating files outside build directory
-
- * symbian/pre-build: ditto
-
- * symbian/setup: ditto
-
- * symbian/rubyu.def: removed
-
-Thu Feb 5 01:44:02 2009 Tanaka Akira <akr@fsij.org>
-
- * transcode.c (make_econv_exception): refine error message for
- undefined conversion. [ruby-core:21828]
-
-Thu Feb 5 01:18:25 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/socket.c (sock_s_socketpair): make 3rd argument optional.
-
- * ext/socket/unixsocket.c (unix_s_socketpair): follow the above
- change.
-
- * ext/socket/rubysocket.h (sock_s_socketpair): ditto.
-
-Thu Feb 5 00:09:39 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/raddrinfo.c (addrinfo_ipv6_to_ipv4): new method.
-
-Wed Feb 4 21:59:31 2009 Tanaka Akira <akr@fsij.org>
-
- * transcode.c (make_econv_exception): show U+XXXX form for undefined
- conversion error from UTF-8.
-
-Wed Feb 4 21:57:37 2009 Tanaka Akira <akr@fsij.org>
-
- * string.c (rb_str_dump): use MBCLEN_CHARFOUND_P properly.
-
-Wed Feb 4 21:55:38 2009 Tanaka Akira <akr@fsij.org>
-
- * bootstraptest/runner.rb: refine success message.
-
-Wed Feb 4 19:10:42 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * Makefile.in (id.h): updates from parse.h.
-
-Wed Feb 4 11:45:06 2009 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/mkexports.rb: shouldn't export DllMain.
- reported at http://pc11.2ch.net/test/read.cgi/tech/1233686068/21
-
-Wed Feb 4 10:12:05 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * missing/vsnprintf.c (BSD_vfprintf): should support 't' format
- modifier to handle PRIdPTRDIFF. thanks for the info from
- Kazuhiro NISHIYAMA. [ruby-core:21807]
-
-Wed Feb 4 01:28:46 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/extconf.rb: fix struct in_pktinfo and struct in6_pktinfo
- detection.
-
-Wed Feb 4 00:32:59 2009 Yusuke Endoh <mame@tsg.ne.jp>
-
- * test/etc/test_etc.rb(test_getpwnam, test_getgrgid, test_getgrnam):
- support an environment that has duplicative entries. a patch from
- Tomoyuki Chikanaga <chikanag at nippon-control-system.co.jp> in
- [ruby-dev:37882].
-
-Wed Feb 4 00:17:52 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/lib/socket.rb (Socket.tcp_server_sockets_port0): skip
- socket creation error.
-
-Tue Feb 3 23:37:08 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ruby.c (load_file_internal): resets EOF flag after parse.
-
-Tue Feb 3 23:13:34 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * vm.c (vm_backtrace): always returns non-nil array if lev is
- negative. [ruby-core:21795]
-
-Tue Feb 3 21:19:06 2009 TAKAO Kouji <kouji@takao7.net>
-
- * ext/readline/extconf.rb: checked rl_set_screen_size and
- rl_get_screen_size.
-
- * ext/readline/readline.c (readline_s_set_screen_size): added
- Readline.set_screen_size.
-
- * ext/readline/readline.c (readline_s_get_screen_size): added
- Readline.get_screen_size.
-
-Tue Feb 3 21:07:19 2009 TAKAO Kouji <kouji@takao7.net>
-
- * ext/readline/readline.c (readline_s_set_completion_proc): set
- default if proc is nil. fix #1095
-
-Tue Feb 3 16:36:06 2009 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-
- * array.c (rb_ary_sort_by_bang): RDoc update.
-
- * NEWS: add Array#sort_by!.
-
-Tue Feb 3 16:23:16 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/lib/socket.rb (Socket.tcp_server_sockets_port0): new
- private function for allocating same port both IPv4 and IPv6.
- (Socket.tcp_server_sockets): use tcp_server_sockets_port0 for port 0.
-
-Tue Feb 3 14:12:10 2009 Shugo Maeda <shugo@ruby-lang.org>
-
- * lib/net/imap.rb: validate data before sending to a server.
- [ruby-core:20320]
-
-Tue Feb 3 12:35:41 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * re.c (match_array): replace match_check().
-
- * re.c (match_values_at): ditto.
-
-Tue Feb 3 12:09:08 2009 Shugo Maeda <shugo@ruby-lang.org>
-
- * lib/net/imap.rb (hmac_md5): should use String#ord to get ascii
- code from the one-character string.
-
-Tue Feb 3 11:25:41 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * load.c (load_lock): warn for circular require. [ruby-core:20794],
- [ruby-core:20797]
-
-Tue Feb 3 08:35:12 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/lib/socket.rb (Socket.tcp_server_sockets): extracted from
- Socket.tcp_server_loop.
- (Socket.accept_loop): ditto.
- (Socket.unix_server_socket): extracted from Socket.unix_server_loop.
- (Socket.unix_server_loop): use Socket.accept_loop.
-
-Tue Feb 3 08:21:05 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * test/ruby/test_readpartial.rb (make_pipe): readpartial does not
- work in text mode.
-
-Tue Feb 3 08:18:26 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * cygwin/GNUmakefile.in (RUBYDEF): uses mkexports.rb on cygwin too.
-
- * win32/mkexports.rb (Exports::Cygwin): added.
-
-Tue Feb 3 08:10:23 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * common.mk (Doxyfile): moved from Makefile.in.
-
- * template/Doxyfile.tmpl: split from Doxyfile.in.
-
-Tue Feb 3 08:01:38 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * win32/win32.c (rb_w32_write): use of cast expressions as lvalues
- is deprecated.
-
-Tue Feb 3 07:57:58 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/socket/extconf.rb (in_pktinfo, in6_pktinfo),
- ext/socket/ancdata.c: defined in w32api/ws2tcpip.h on cygwin but
- cannot compile for some reason.
-
-Tue Feb 3 07:02:11 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * missing/langinfo.c (nl_langinfo_codeset): accepts iso-8859
- fragment. [ruby-core:21757]
-
-Tue Feb 3 07:01:21 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * mkconfig.rb (patchlevel): config.status may not contain
- PATCHLEVEL even if other version numbers exist.
-
-Mon Feb 2 23:43:00 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/raddrinfo.c (Init_addrinfo): add AddrInfo#to_s as an
- alias of AddrInfo#to_sockaddr.
-
- * ext/socket/option.c (Init_sockopt): add Socket::Option#to_s as an
- alias of Socket::Option#data.
-
- [ruby-dev:37873]
-
-Mon Feb 2 21:04:13 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * array.c (rb_ary_sort_by_bang): RDoc update. [ruby-core:21742]
-
-Mon Feb 2 20:49:24 2009 Akinori MUSHA <knu@iDaemons.org>
-
- * enumerator.c: Introduce id_each to save rb_intern() and SYM2ID()
- calls.
-
-Mon Feb 2 19:55:51 2009 Tanaka Akira <akr@fsij.org>
-
- * test/socket/test_addrinfo.rb: use AddrInfo.getaddrinfo to generate
- IPv6 address. AddrInfo.ip generates IPv4 address for IPv4 mapped
- IPv6 address if --with-lookup-order-hack=INET.
- [ruby-dev:37868]
-
-Mon Feb 2 19:17:16 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * doc/NEWS-1.9.1: typo fixed: collect_all -> collect.
- [ruby-core:21706]
-
-Mon Feb 2 17:23:14 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * cygwin/GNUmakefile.in (dir.o, win32.o): depend on win32/dir.h.
-
-Mon Feb 2 17:13:46 2009 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * mkconfig.rb: patchlevel is sometimes minus.
-
- * win32/resource.rb: ditto.
-
-Mon Feb 2 17:11:23 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/ancdata.c (cmsg_type_to_sym): add #ifdef for no IPv6
- environment.
-
-Mon Feb 2 17:05:55 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * file.c (rb_find_file_ext): should not be infected from other
- load paths.
-
-Mon Feb 2 16:33:06 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * dir.c (dir_s_home): new method. [ruby-core:21454]
-
-Mon Feb 2 16:06:10 2009 Tanaka Akira <akr@fsij.org>
-
- * version.h: bump up to 1.9.2 patchlevel -1.
- yugui recommend "-1" strongly.
-
- * lib/rubygems/version.rb: accept negative patchlevel.
-
-Mon Feb 2 14:53:35 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/socket.c (sock_initialize): make 3rd argument, protocol,
- optional.
-
-Mon Feb 2 14:47:53 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * array.c (rb_ary_sort_by_bang): new method. requested in
- [ruby-core:21709]
-
-Mon Feb 2 14:22:56 2009 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * ext/socket/constants.c (cmsg_type_arg): INET6 check.
-
-Mon Feb 2 14:18:20 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/option.c: use INET6 instead of IPV6.
-
-Mon Feb 2 12:47:47 2009 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * ext/socket/{options,raddrinfo}.c: use INET6 instead of AF_INET6 for
- VC++6.
-
-Mon Feb 2 12:41:52 2009 Shugo Maeda <shugo@ruby-lang.org>
-
- * complex.c (f_signbit): regard NaN as a positive value.
- [ruby-dev:37861].
-
-Mon Feb 2 12:39:00 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * sample/test.rb (valid_syntax?), test/ruby/test_system.rb
- (TestSystem::valid_syntax?): use catch and throw instead of
- return inside BEGIN block.
-
-Mon Feb 2 11:45:10 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/rubysocket.h (cmsg_type_arg): declared.
- (Init_ancdata): ditto.
-
- * ext/socket/init.c (Init_socket_init): call Init_ancdata.
-
- * ext/socket/constants.c (cmsg_type_arg): defined.
-
- * ext/socket/depend: add dependency for ancdata.o.
-
- * ext/socket/mkconstants.rb: generate scm_optname_to_int.
- more constants.
-
- * ext/socket/extconf.rb: add ancdata.o.
-
- * ext/socket/ancdata.c: new file. new method
- BasicSocket#{sendmsg,sendmsg_nonblock,recvmsg,recvmsg_nonblock}
-
-Mon Feb 2 10:57:27 2009 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/win32.c, win32/dir.h (open_dir_handle, rb_w32_opendir,
- move_to_next_entry, rb_w32_readdir, check_valid_dir): change backend
- API from A to W.
-
-Mon Feb 2 10:48:38 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/basicsocket.c (bsock_setsockopt): accept Socket::Option
- object.
- (bsock_getsockopt): return Socket::Option object.
-
- * ext/socket/option.c: new file.
-
- * ext/socket/rubysocket.h (rb_cSockOpt): declared.
- (sockopt_new): ditto.
- (Init_sockopt): ditto.
-
- * ext/socket/init.c (Init_socket_init): call Init_sockopt.
-
- * ext/socket/depend: add dependency for option.o
-
- * ext/socket/mkconstants.rb: generate intern_level, intern_so_optname,
- intern_ip_optname, intern_ipv6_optname, intern_tcp_optname,
- intern_udp_optname and intern_scm_optname.
-
- * ext/socket/extconf.rb: add option.o.
-
-Mon Feb 2 09:49:39 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * vm.c (vm_backtrace_each): progname is not available at
- initializing phase.
-
-Mon Feb 2 08:12:50 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/xmlrpc/server.rb (Server#serve): gets rid of hardcoded
- platform names.
-
- * lib/resolv.rb (Resolv::Hosts::DefaultFileName),
- (Resolv::DNS::Config.default_config_hash): tries win32/resolv on
- mswin64 too.
-
- * lib/rubygems/specification.rb (Gem::Specification#ruby_code):
- added mswin64.
-
- * lib/drb/extservm.rb (DRb::ExtServManager#invoke_service_command):
- spawn is better to start a process in background.
-
- * ext/extmk.rb: uses FNM_SYSCASE.
-
- * instruby.rb: installs win32.h on mswin64 platform.
- [ruby-core:21722]
-
-Mon Feb 2 07:36:13 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * vm.c (vm_backtrace_each): now takes an iterator function.
-
- * vm_core.h (rb_make_backtrace, rb_backtrace_each): added
- prototypes.
-
- * vm_dump.c (rb_vm_bugreport), vm_eval.c (rb_backtrace): gets rid
- of allocating objects. [ruby-core:21619]
-
- * vm_eval.c (rb_backtrace_each): new function which iterates over
- each backtrace info.
-
-Mon Feb 2 06:51:36 2009 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * encoding.c (rb_filesystem_encoding): Windows' filesystem encoding is
- sometimes ANSI code page and sometimes OEM code page. we should check
- whether code page is used.
-
-Sun Feb 1 21:27:55 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/raddrinfo.c (addrinfo_ipv4_private_p): new method.
- (addrinfo_ipv4_loopback_p): ditto.
- (addrinfo_ipv4_multicast_p): ditto.
-
-Sun Feb 1 16:10:06 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/optparse.rb (Switch#summarize): strips an equal sign from
- short option, and fills right sides in shorter lines.
- [ruby-talk:326414]
-
-Sun Feb 1 05:19:43 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * variable.c (rb_const_get_0), vm_insnhelper.c (vm_get_ev_const):
- avoids infinite self recursion autoload. [ruby-core:21696]
-
-Sat Jan 31 22:50:38 2009 Tanaka Akira <akr@fsij.org>
-
- * lib/test/unit/assertions.rb (assert_equal): show class in failure
- message if meaningful.
-
-Sat Jan 31 22:38:46 2009 Tanaka Akira <akr@fsij.org>
-
- * lib/resolv.rb (Resolv::DNS#each_address): don't query IPv6 address
- if the host has no global IPv6 address.
-
-Sat Jan 31 22:29:05 2009 Tanaka Akira <akr@fsij.org>
-
- * include/ruby/ruby.h (STR2CSTR): removed.
- (rb_str2cstr): removed.
-
- * object.c (rb_str2cstr): removed.
-
-Sat Jan 31 20:07:59 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/raddrinfo.c (addrinfo_ipv6_unspecified_p): new method.
- (addrinfo_ipv6_loopback_p): ditto.
- (addrinfo_ipv6_multicast_p): ditto.
- (addrinfo_ipv6_linklocal_p): ditto.
- (addrinfo_ipv6_sitelocal_p): ditto.
- (addrinfo_ipv6_v4mapped_p): ditto.
- (addrinfo_ipv6_v4compat_p): ditto.
- (addrinfo_ipv6_mc_nodelocal_p): ditto.
- (addrinfo_ipv6_mc_linklocal_p): ditto.
- (addrinfo_ipv6_mc_sitelocal_p): ditto.
- (addrinfo_ipv6_mc_orglocal_p): ditto.
- (addrinfo_ipv6_mc_global_p): ditto.
-
-Sat Jan 31 19:09:30 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * load.c (rb_require_safe): raises when the path to be loaded is
- tainted. [ruby-dev:37843]
-
-Sat Jan 31 18:08:59 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in (optflags): defaulted to -O3 to get rid of slug of
- gcc 4.3.
-
-Sat Jan 31 18:03:41 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/optparse.rb (List#accept, parse_in_order): n option is no
- longer needed.
-
-Sat Jan 31 14:12:43 2009 Tanaka Akira <akr@fsij.org>
-
- * lib/pathname.rb (Pathname#each_child): new method.
-
-Sat Jan 31 00:07:49 2009 Tanaka Akira <akr@fsij.org>
-
- * lib/test/unit/assertions.rb
- (Test::Unit::Assertions#assert_nothing_raised): suppress warning.
- [ruby-core:21312]
-
-Fri Jan 30 21:49:32 2009 Tanaka Akira <akr@fsij.org>
-
- * lib/pathname.rb (Pathname#realdirpath): new method based on the
- patch in [ruby-dev:36560] by Akinori MUSHA.
- [ruby-dev:36290]
-
-Fri Jan 30 18:04:23 2009 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/win32.c (rb_w32_write): limit write size to 32KB if the file
- seems to be console. [ruby-core:21613]
-
-Fri Jan 30 16:12:32 2009 TAKAO Kouji <kouji@takao7.net>
-
- * ext/curses/curses.c (Init_curses): Curses#crmode and
- Curses#nocrmode changes to the module function.
- fix #916
-
-Fri Jan 30 14:31:14 2009 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * tool/make-snapshot (prereq): remove enc.mk from tarball because
- BSD make checks $(srcdir)/enc.mk and try to run $(builddir)/enc.mk.
-
-Fri Jan 30 14:11:48 2009 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * enc/depend: extract compile rules to each target for nmake.
-
-Fri Jan 30 12:59:49 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * cygwin/GNUmakefile.in (RUBYDEF): depends on makefiles.
-
- * cygwin/GNUmakefile.in (RUBYDEF): adds DATA to non-function symbols
- which is not marked as T.
-
-Fri Jan 30 11:03:31 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/test/unit/assertions.rb (assert_respond_to): gets rid of
- overcounting. [ruby-dev:37703]
-
-Fri Jan 30 02:55:56 2009 Tanaka Akira <akr@fsij.org>
-
- * transcode.c (rb_econv_init_by_convpath_i): make it static.
-
-Thu Jan 29 16:22:41 2009 Shugo Maeda <shugo@ruby-lang.org>
-
- * load.c (rb_feature_provided): should not calculate len by pointer
- subtraction because feature may be a expanded path.
- [ruby-core:21267]
-
-Thu Jan 29 14:12:15 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in (BASERUBY): erases RUBYOPT at the test.
-
- * configure.in (OBJCOPY): not used on Windows.
-
-Thu Jan 29 13:16:11 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/securerandom.rb (SecureRandom.uuid): uses unpacked array
- instead of string, because String#[] returns one length string.
-
-Thu Jan 29 12:29:51 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/rake.rb (FileUtils#rake_system): no longer needs workaround
- on Windows. [ruby-core:21339]
-
- * lib/rake/win32.rb (Rake::Win32#rake_system): ditto.
-
- * lib/rake/win32.rb (Rake::Win32#win32_system_dir): no longer
- needs environment variables other than APPDATA now.
-
- * lib/rake.rb (Rake::Application#standard_system_dir): uses
- platform specific definition on Windows system.
-
-Thu Jan 29 12:18:54 2009 Technorama Ltd. <oss-ruby@technorama.net>
-
- * lib/securerandom.rb: new method SecureRandom#uuid
-
-Thu Jan 29 11:22:19 2009 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * ext/socket/raddrinfo.c (inspect_sockaddr): if defined AF_INET6,
- perhaps can inspect IPv6 addresses if not defined INET6.
-
- * ext/socket/socket.c (socket_s_ip_address_list): support Windows XP
- or later. (Win2k or earlier is still not supported)
-
-Thu Jan 29 00:24:48 2009 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * ext/zlib/zlib.c (zstream_run): previous change didn't resolve the
- problem.
-
-Wed Jan 28 22:51:12 2009 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * ext/zlib/zlib.c (zstream_run): desperately guard the variable.
- [ruby-core:20576]
-
-Wed Jan 28 15:24:11 2009 TAKANO Mitsuhiro (takano32) <tak@no32.tk>
-
- * math.c: SEGV is caused by implicit rb_to_float declaration
- test_complexrational.rb: [BUG] in IA-64 architecture
-
-Tue Jan 27 20:02:07 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/init.c (socks_connect_blocking): moved from
- sockssocket.c. [ruby-dev:37834]
-
- * sockssocket.c (socks_init): don't omit "int" type.
-
-Tue Jan 27 14:41:33 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * cygwin/GNUmakefile.in (RUBYDEF): needs DATA marks to export
- non-function symbols. [ruby-core:21582]
-
- * win32/mkexports.rb (Exports::Mingw#each_export): ditto.
-
-Tue Jan 27 12:59:55 2009 NARUSE, Yui <naruse@ruby-lang.org>
-
- * ext/ripper/depend: use VPATH.
- If a platform doesn't support VPATH, Ruby doesn't support it:
- for example MSYS. [ruby-core:21570]
-
-Tue Jan 27 12:21:17 2009 NARUSE, Yui <naruse@ruby-lang.org>
-
- * ext/ripper/depend: lex.c's correct path is ../../lex.c.
-
-Tue Jan 27 11:09:45 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/mkmf.rb (try_header): checks the header depending on
- platform.
-
- * lib/mkmf.rb (have_header, find_header): use try_header.
-
- * win32/Makefile.sub (try_header): uses try_compile to get rid of
- slow -E option of VC.
-
-Tue Jan 27 11:03:52 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * common.mk (distclean-enc, realclean-enc): do not call clean of
- enc.mk twice or more.
-
- * enc/depend (cleanobjs): added deffile.
-
- * lib/mkmf.rb (create_makefile): removes deffile at clean instead
- of distclean.
-
- * win32/Makefile.sub (miniruby, LIBRUBY_SO): removes lib and exp
- files.
-
- * win32/Makefile.sub (clean, distclean): have moved to common.mk.
-
- * win32/rmdirs.bat: omits `not empty' message.
-
-Tue Jan 27 10:15:33 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * transcode.c (struct rb_transcoding): added ary member for debug.
-
-Tue Jan 27 10:10:14 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * Doxyfile.in (FILE_VERSION_FILTER, INPUT_FILTER): should not use
- ./miniruby directly for cross compiling.
-
-Tue Jan 27 04:02:53 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * ext/ripper/depend: fixed dependency path to lex.c.
- [ruby-core:21570]
-
-Tue Jan 27 03:43:34 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * hash.c (rb_any_hash): fixed performance issues with nil, true,
- false as hash keys. a patch from Matthias Waechter.
- [ruby-core:21568]
-
-Tue Jan 27 03:23:43 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/mkmf.rb (create_makefile): should point correct path to
- ruby.h and defines.h. [ruby-core:21569]
-
-Mon Jan 26 16:00:40 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * array.c (rb_ary_aset): fixed arguments evaluation order.
-
-Mon Jan 26 15:49:42 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/pathname.rb (chop_basename, prepend_prefix): use o option.
-
-Sun Jan 25 16:35:44 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/socket.c (socket_s_ip_address_list): renamed from
- socket_s_list_ip_address. [ruby-dev:37806]
-
-Sun Jan 25 12:17:21 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * cygwin/GNUmakefile.in (RUBYDEF): needs read-only section too.
-
-Sun Jan 25 12:02:56 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * win32/Makefile.sub (clean-ext): condition of EXTS was inverted.
-
-Sun Jan 25 11:50:20 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/mkmf.rb (create_makefile): fixed the variables order because
- converter proc refers the separator.
-
-Sun Jan 25 11:25:10 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * Makefile.in, win32/Makefile.sub (RMDIRS): remove directory and
- parents.
-
- * Makefile.in, win32/Makefile.sub (distclean-rdoc): added to remove
- temporary rdoc.
-
- * Makefile.in, win32/Makefile.sub (clean-ext): skips non-existent
- directories.
-
- * common.mk (clean, distclean): cleans rdoc.
-
- * common.mk (clean-extout): removes extout directory.
-
- * configure.in (RMDIRS, RMALL): added to clean extout.
-
- * lib/fileutils.rb (FileUtils#rmdir): added :parents option.
-
- * lib/mkmf.rb (create_makefile): cleans installed files at clean
- instead of distclean.
-
- * lib/mkmf.rb (create_makefile): added clean-so and clean-rb.
-
- * lib/mkmf.rb (def init_mkmf): added DISTCLEANDIRS.
-
- * lib/un.rb (rmdir): added -p option.
-
- * tool/rmdirs, win32/rmdirs.bat: removes directory and the parents.
-
- * win32/rm.bat: added -r option.
-
-Sun Jan 25 09:09:29 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * dir.c (join_path): use strlcat() to force link.
-
- * dir.c (glob_helper): no strcpy() is needed since len is known.
-
-Sun Jan 25 06:44:58 2009 Technorama Ltd. <oss-ruby@technorama.net>
-
- * ext/openssl/ossl_ssl.c: Server Name Indication support.
- new methods SSLContext#server_name_cb=, SSLSocket#hostname=.
-
- * test/openssl/test_ssl.rb: Tests for above.
-
-Sat Jan 24 08:22:35 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/mkmf.rb (configuration): tools under the top source
- directory are not installed, so unusable outside extmk.rb.
-
-Fri Jan 23 17:24:31 2009 WATANABE Hirofumi <eban@ruby-lang.org>
-
- * golf_prelude.rb (Enumerator#inspect): avoid warning.
-
-Fri Jan 23 15:12:52 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/mkmf.rb (mkintpath): new function which converts native path
- to format acceptable in Makefile.
-
- * lib/mkmf.rb (configuration): leaves PATH_SEPARATOR unchanged.
-
- * lib/mkmf.rb (configuration): converts srcdir, topdir and hdrdir.
- a patch by Alexey Borzenkov <snaury AT gmail.com> at
- [ruby-core:21448].
-
- * lib/mkmf.rb (try_func): got rid of c-mode confusion.
-
-Fri Jan 23 13:26:45 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * signal.c (trap_handler): also accepts symbols. [ruby-dev:37823]
-
-Thu Jan 22 18:14:04 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/mkmf.rb (create_makefile): removes installed files under
- extout at distclean.
-
-Thu Jan 22 17:12:37 2009 Takeyuki FUJIOKA <xibbar@ruby-lang.org>
-
- * lib/cgi/core.rb (CGI.parse): generate only key on params hash
- if request have only key uri parameters.
- (ex. index.cgi?aaa&bbb=1 # params=>{:aaa=>[],:bbb=>["1"]})
-
- * test/cgi/test_cgi_core.rb: fix test for key only params.
-
-Thu Jan 22 16:29:50 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/rubygems/installer.rb (Gem::Installer#initialize): fixed
- typos.
-
- * test/rubygems/test_gem.rb (test_self_dir): removed false
- assertions.
-
- * test/rubygems/test_gem.rb (test_self_set_paths): checks if paths
- are included.
-
- * test/rubygems/test_gem_commands_install_command.rb
- (test_execute_remote): checks diagnostic message too.
-
- * test/rubygems/test_gem_installer.rb (load): uses Gem.ruby.
-
- * test/rubygems/gemutilities.rb (Gem.ruby): initializes from the
- environment variable to run without installation.
-
- * test/rubygems/gemutilities.rb (RubyGemTestCase#util_build_gem):
- creates cache directory.
-
-Thu Jan 22 16:12:51 2009 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * revert previous revision. it's already out-of-date.
-
-Thu Jan 22 15:54:02 2009 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * include/ruby/win32.h, win32/win32.c (rb_w32_is_valid_fd): new function
- to validate fd.
-
- * io.c (rb_io_initialize): check fd with above function.
-
-Thu Jan 22 14:53:29 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * test/ruby/test_process.rb (MANDATORY_ENVS): needs RUBYLIB to run
- tests without install.
-
-Thu Jan 22 12:19:29 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Mar 9 09:04:39 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
* gc.c (define_final): cannot define finalizer for immediate
values. [ruby-core:21500]
* gc.c (define_final): freezes or hides internal values.
-Thu Jan 22 11:33:08 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * thread.c (rb_time_timeval): made a real prototype. a patch from
- Marcus Rueckert <darix AT opensu.se> at [ruby-core:21492].
+Mon Mar 9 08:54:47 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
-Wed Jan 21 21:43:50 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * parse.y (IS_BEG): EXPR_CLASS should be treated like EXPR_BEG.
+ [ruby-core:21453]
- * io.c (rb_io_ungetbyte, rb_io_ungetc): allows nil to reset EOF
- flag with ungetting nothing.
+Wed Feb 25 15:15:52 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ruby.c (load_file_internal): rests EOF flag to make possible to
- load from stdin after reading data.
-
-Wed Jan 21 17:17:18 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * array.c (ary_double_capa): a new function to expand array more
- aggressively. [ruby-core:21460]
-
- * array.c (rb_ary_store): use ary_double_capa().
-
- * array.c (rb_ary_unshift_m): ditto.
+ * node.h (rb_thread_raised_clear): should not clear flags other than
+ raised flags. a patch by Tomoyuki Chikanaga <chikanag AT
+ nippon-control-system.co.jp> at [ruby-dev:37794]. [ruby-dev:37776]
- * array.c (rb_ary_splice): ditto.
-
-Wed Jan 21 15:32:15 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * io.c (rb_io_ungetbyte, rb_io_ungetc): clears EOF flag.
-
-Wed Jan 21 14:41:48 2009 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * array.c (take_items): to_ary() raises ArgumentError if cannot to
- convert to Array. [ruby-dev:37797]
-
-Wed Jan 21 14:32:02 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (debug_lines): calls rb_intern() once.
-
-Wed Jan 21 13:58:17 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * include/ruby/io.h (FMODE_EOF): EOF flag on TTY.
-
- * io.c (io_set_eof): sets EOF flag for TTY.
-
- * io.c (io_seek): clears EOF flag.
-
- * io.c (io_fillbuf): returns EOF if already met EOF. [ruby-dev:37798]
-
- * io.c (io_fillbuf, io_fread, io_getpartial): sets EOF.
-
-Wed Jan 21 08:22:04 2009 Ryan Davis <ryand-ruby@zenspider.com>
-
- * lib/minitest/*.rb: Imported minitest 1.3.1 r4532.
- * test/minitest/*.rb: ditto.
-
-Tue Jan 20 20:16:21 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/socket.c (socket_s_list_ip_address): new method.
- (sockaddr_obj): new function.
-
- * ext/socket/rubysocket.h: include ifaddrs.h, sys/ioctl.h,
- sys/sockio.h, net/if.h if available.
- (addrinfo_new): declared.
-
- * ext/socket/raddrinfo.c (addrinfo_new): exported.
-
- * ext/socket/extconf.rb: check ifaddrs.h, sys/ioctl.h, sys/sockio.h,
- net/if.h and getifaddrs.
-
-Tue Jan 20 20:05:21 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/rubysocket.h (pseudo_AF_FTIP): moved from mkconstants.rb.
-
- * ext/socket/mkconstants.rb: prepend header if -H is not given.
-
-Tue Jan 20 17:50:00 2009 NARUSE, Yui <naruse@ruby-lang.org>
-
- * ext/nkf/nkf-utf8/nkf.c (nkf_buf): use nkf_char.
-
-Tue Jan 20 16:17:12 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * cont.c (ruby_Init_{Continuation_body,Fiber_as_Coroutine}): prefixed
- with ruby_ to export.
-
- * ext/continuation/continuation.c, ext/fiber/fiber.c: ditto.
-
-Tue Jan 20 15:32:29 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * Makefile.in (miniruby): renames and then removes, to get rid of
- EPERM on cygwin and mingw.
-
- * Makefile.in ($(LIBRUBY_SO)): use wildcard option of objcopy.
-
- * configure.in (DLDFLAGS): do not export all symbols.
-
- * cygwin/GNUmakefile.in (RUBYDEF): rejects symbols prefixed with
- Init_.
-
- * win32/mkexports.rb (Exports::Mingw): includes all symbols as
- well as mswin32, except for prefixed with Init_.
-
-Tue Jan 20 13:03:50 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * string.c (hash): fixed the tail bytes handling in the aligned
- access case.
-
-Tue Jan 20 09:26:05 2009 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * ext/nkf/nkf-utf8/nkf.c (nkf_buf_push): maybe a bug.
-
- * ext/nkf/nkf-utf8/nkf.c (options): no need to support help option.
-
-Tue Jan 20 06:48:56 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * array.c (take_items), enum.c (enum_zip): tries to convert to
- array first. [ruby-core:21442]
-
-Tue Jan 20 03:50:37 2009 NARUSE, Yui <naruse@ruby-lang.org>
-
- * ext/nkf/nkf-utf8/nkf.c: Update nkf to 2.0.9.
- revert -s meaning as Shift_JIS, etc.
-
-Tue Jan 20 03:42:32 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * string.c (hash): fixed typo. [ruby-dev:37791]
-
-Tue Jan 20 01:15:27 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/mkconstants.rb (SOMAXCONN): defined.
-
-Mon Jan 19 22:31:35 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/mkconstants.rb: use erb for generating code.
-
-Mon Jan 19 17:33:47 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * string.c (hash): defaulted to MurmurHash 2.0.
-
-Mon Jan 19 17:29:34 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * include/ruby/defines.h (RUBY_ALIAS_FUNCTION_TYPE): added.
-
-Mon Jan 19 17:24:05 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * vm_dump.c (vm_stack_dump_each): used only if debug mode.
-
-Mon Jan 19 16:32:35 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * string.c (hash): added MurmurHash 2.0.
-
-Mon Jan 19 14:31:59 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * thread.c (rb_thread_execute_interrupts): needs
- rb_signal_buff_size to be declared.
-
-Mon Jan 19 13:34:25 2009 Koichi Sasada <ko1@atdot.net>
-
- * ruby.c (require_libraries): reset th->parse_in_eval while
- loading libraries. fixes [ruby-dev:37780]
-
-Mon Jan 19 11:46:39 2009 Koichi Sasada <ko1@atdot.net>
-
- * vm_eval.c, eval.c (rb_f_block_given_p): move definition of
- "iterator?" and "block_given?" to make static.
-
- * vm.c (vm_get_ruby_level_caller_cfp): make it static.
-
- * eval_intern.h, vm_insnhelper.c: move decl. of
- vm_get_ruby_level_caller_cfp()
- from eval_intern.h to vm_insnhelper.c.
-
-Mon Jan 19 11:27:39 2009 Koichi Sasada <ko1@atdot.net>
-
- * vm.c: add a prefix "rb_" to exposed functions
- vm_get_ruby_level_next_cfp(), rb_vm_make_env_object(),
- vm_stack_to_heap(), vm_make_proc(), vm_invoke_proc(),
- vm_get_sourceline(), vm_cref(), vm_localjump_error(),
- vm_make_jump_tag_but_local_jump(), vm_jump_tag_but_local_jump().
- This changes may affect only core because most of renamed functions
- require a pointer of not-exposed struct such as rb_thread_t or NODE.
- In short, they are core functions.
-
- * cont.c, eval.c, eval_intern.h, load.c, proc.c, thread.c,
- vm_core.h, vm_dump.c, vm_eval.c, vm_exec.c, vm_insnhelper.c:
- ditto.
-
-Mon Jan 19 11:22:51 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/socket/rubysocket.h (rb_cUNIXSocket, rb_cUNIXServer),
- (unixpath, unixaddr): UNIX domain sockets depend on sys/un.h.
-
-Mon Jan 19 11:02:30 2009 Koichi Sasada <ko1@atdot.net>
-
- * vm_dump.c: add a prefix "rb_vmdebug_" to
- vm_stack_dump_raw(), vm_stack_dump_raw_current(),
- vm_env_dump_raw(), vm_proc_dump_raw(), vm_stack_dump_th(),
- vm_debug_print_register(), vm_thread_dump_regs(),
- vm_debug_print_pre(), vm_debug_print_post(),
- vm_thread_dump_state().
- This change also may affect core (in fact, user of
- above functions may be only ko1).
-
- * vm_core.h: ditto.
-
- * vm_exec.h (SDR2): remove duplicate definition.
-
-Mon Jan 19 11:00:44 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/socket/raddrinfo.c (addrinfo_ip_port): use AF_INET6 only when
- defined, as well as addrinfo_ipv6_p().
-
-Mon Jan 19 10:43:38 2009 Koichi Sasada <ko1@atdot.net>
-
- * gc.c (garbage_collect_with_gvl): suppress warnings.
-
-Mon Jan 19 10:34:32 2009 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * ext/socket/depend: workaround for nmake. files in depend without
- paths should converted by RULE_SUBST, but mkmf.rb cannot recognize
- macros currently.
-
-Mon Jan 19 09:53:43 2009 Koichi Sasada <ko1@atdot.net>
-
- * iseq.c:
- rename ruby_iseq_disasm_insn() -> rb_iseq_disasm_insn().
- rename ruby_iseq_disasm() -> rb_iseq_disasm().
-
- * compile.c:
- rename ruby_iseq_compile() -> rb_iseq_compile_node().
- rename ruby_iseq_translate_threaded_code() ->
- rb_iseq_translate_threaded_code().
- rename ruby_insns_name_array() -> rb_insns_name_array().
- rename ruby_iseq_build_from_ary() -> rb_iseq_build_from_ary().
-
- * iseq.c, compile.c: remove ruby_insn_make_insn_table() and make
- static function insn_make_insn_table().
-
- * iseq.h, ruby.c, vm.c, vm_core.h, vm_eval.c, vm_dump.c,
- blockinlining.c: ditto.
- Rename strange "ruby_" prefix to "rb_" prefix.
- This changes may affect only core because renamed functions
- require a pointer of rb_iseq_t which is not exposed.
-
-Mon Jan 19 09:21:04 2009 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * ext/socket/mkconstants.rb: define macros with default value in
- constdefs.h if not exist them.
-
- * ext/socket/raddrinfo.c (addrinfo_mdump, addrinfo_mload): support
- UNIX socket only on platforms which support it.
-
-Mon Jan 19 08:56:53 2009 Koichi Sasada <ko1@atdot.net>
-
- * eval.c, vm_eval.c (rb_f_local_variables): move definition from eval.c
- to vm_eval.c because vm_collect_local_variables_in_heap() should
- be static function.
-
- * vm.c (vm_collect_local_variables_in_heap): make it static.
-
-Mon Jan 19 04:06:10 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * iseq.c (rb_iseq_load): renamed from ruby_iseq_load, since it is
- for C extensions or the ruby core. [ruby-core:21407]
-
-Mon Jan 19 03:06:22 2009 NARUSE, Yui <naruse@ruby-lang.org>
-
- * transcode.c (str_transcode0): fix: :xml option doesn't
- work on str.encode([options]) form without default_internal.
-
-Sun Jan 18 16:56:46 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/raddrinfo.c (addrinfo_inspect_sockaddr): new
- method AddrInfo#inspect_sockaddr.
- (inspect_sockaddr): extracted from addrinfo_inspect.
- (addrinfo_inspect): use inspect_sockaddr.
- (Init_addrinfo): define the new method.
-
-Sun Jan 18 16:46:37 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/raddrinfo.c (addrinfo_ip_address): new method
- AddrInfo#ip_address.
- (addrinfo_ip_port): new method AddrInfo#ip_port.
- (Init_addrinfo): define the methods above.
-
-Sun Jan 18 14:29:52 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/unixsocket.c: redundant #ifdef removed.
-
-Sun Jan 18 03:33:23 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/raddrinfo.c (addrinfo_mdump): don't use symbol.
- (addrinfo_mload): ditto.
-
-Sun Jan 18 03:05:20 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/raddrinfo.c (addrinfo_mdump): new method.
- (addrinfo_mload): new method.
- (Init_addrinfo): define the method above.
-
- * ext/socket/constants.c (constant_arg): str_to_int's first argument
- constified.
-
- * ext/socket/mkconstants.rb (gen_name_to_int_decl): generated
- function's first argument constified.
- (gen_name_to_int_func_in_guard): ditto.
- (ipproto_to_int): generated.
-
- * ext/socket/rubysocket.h (IS_IP_FAMILY): moved from raddrinfo.c.
-
-Sun Jan 18 01:37:50 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/socket.c (sock_s_getnameinfo): accept AddrInfo object.
-
- * ext/socket/raddrinfo.c (rb_check_sockaddr_string_type): defined.
-
- * ext/socket/rubysocket.h (rb_check_sockaddr_string_type): declared.
-
-Sat Jan 17 22:01:15 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/lib/socket.rb: new file.
-
-Sat Jan 17 19:33:48 2009 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * configure.in (VCSUP): fixed the cases for git-svn or git.
-
- * win32/Makefile.sub (VCSUP): ditto.
-
- * Makefile.in (up): `cd' is necessary for git and git-svn.
-
-Sat Jan 17 19:16:16 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/mkconstants.rb: generate a header file for generated
- functions.
-
- * ext/socket/rubysocket.h: include constdefs.h. don't declare
- generated functions.
-
- * ext/socket/constants.c: include constdefs.c instead of constants.h.
-
- * ext/socket/depend: dependency updated.
-
-Sat Jan 17 17:58:22 2009 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * lib/irb/xmp.rb: multilingualizes XMP::StringInputMethod.
- [ruby-core:21383].
-
-Sat Jan 17 15:01:22 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/raddrinfo.c (make_inspectname): add a res argument to
- suppress numeric inspectname.
- (init_addrinfo_getaddrinfo): call make_inspectname here.
- (addrinfo_firstonly_new): follow make_inspectname change.
- (addrinfo_list_new): ditto.
- (addrinfo_initialize): follow init_addrinfo_getaddrinfo change.
-
-Sat Jan 17 14:52:27 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/mkconstants.rb: don't cause an error for duplicate names.
-
-Sat Jan 17 12:46:17 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket: split files for each class.
-
- * ext/socket/rubysocket.h: common header.
-
- * ext/socket/basicsocket.c: new file for BasicSocket.
-
- * ext/socket/ipsocket.c: new file for IPSocket.
-
- * ext/socket/tcpsocket.c: new file for TCPSocket.
-
- * ext/socket/tcpserver.c: new file for TCPServer.
-
- * ext/socket/sockssocket.c: new file for SOCKSSocket.
-
- * ext/socket/udpsocket.c: new file for UDPSocket.
-
- * ext/socket/unixsocket.c: new file for UNIXSocket.
-
- * ext/socket/unixserver.c: new file for UNIXServer.
-
- * ext/socket/socket.c: now for Socket.
-
- * ext/socket/raddrinfo.c: new file for AddrInfo and name resolution.
-
- * ext/socket/constants.c: new file for constants.
-
- * ext/socket/init.c: new file for utilities.
-
- * ext/socket/mkconstants.rb: export *_to_int.
-
- * ext/socket/extconf.rb: add new object files.
-
- * ext/socket/depend: add dependencies for new files.
-
- * ext/.document: add new files.
-
-Sat Jan 17 11:12:37 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * cont.c (cont_restore_0): padding size doesn't need to be large
- if alloca is used. suppress warnings.
-
-Sat Jan 17 11:12:21 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * vm_dump.c (vm_stack_dump_each): initialized at declarations.
-
- * vm_dump.c (rb_vm_bugreport): constified to suppress a warning.
-
-Fri Jan 16 22:30:27 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/socket.c: move addrinfo code.
-
-Fri Jan 16 18:51:11 2009 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/Makefile.sub (up): tell nmake that need to run command via
- shell.
-
-Fri Jan 16 18:43:30 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * tool/make-snapshot (package): includes all rules and expand
- configured values from the environment to create *.inc, sets RM
- for ripper.c, and needs chdir if absolute path is given with
- -exported option.
-
-Fri Jan 16 18:26:47 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * include/ruby/ruby.h (VALUE): use unsigned long or long long
- instead of uintptr_t, since many %lx and so on are still used.
-
-Fri Jan 16 17:33:59 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in (Makefile): set VCS and VCSUP to support `git svn'
- and git.
-
- * Makefile.in, win32/Makefile.sub (up): split from common.mk.
-
-Fri Jan 16 12:24:39 2009 Koichi Sasada <ko1@atdot.net>
-
- * thread.c (thread_start_func_2): call ruby_cleanup() if thread is
- main thread. [ruby-dev:37624]
-
-Fri Jan 16 12:27:50 2009 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/Makefile.sub ($(INSNS), node_name.inc, known_errors.inc,
- miniprelude.c, newline.c): if dependencies is newer than targets or
- targets don't exist, try to create targets with BASERUBY. no need to
- detect errors there because the absence of BASERUBY is not abnormal.
- after the try, if the targets still don't exist, copy them from
- $(srcdir).
-
-Fri Jan 16 12:15:07 2009 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * include/ruby/ruby.h (PRI_PTRDIFF_PREFIX): must define as string.
- if not, cause compile error in using PRI?VALUE.
-
- * win32/Makefile.sub (config.h): add SIZEOF_INTPTR_T and
- SIZEOF_UINTPTR_T for SIZEOF_VALUE.
-
-Fri Jan 16 11:51:20 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * symbian/pre-build (COMSPEC): should not overridden.
-
-Fri Jan 16 11:47:56 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (rb_parse_in_main): fixed typo.
-
-Fri Jan 16 11:41:23 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in (RUBY_REPLACE_TYPE): does not define rb_ prefixed
- name if no default type is given.
-
- * configure.in (RUBY_DEFINT): checks size.
-
- * include/ruby/ruby.h (PRI_PTRDIFF_PREFIX, PRI_SIZE_PREFIX):
- assumes usable if PRIdPTR is defined.
-
-Fri Jan 16 02:25:46 2009 Yusuke Endoh <mame@tsg.ne.jp>
-
- * thread.c (rb_thread_execute_interrupts): if signal is already
- buffered, main thread should wait until timer thread delivers it.
-
- * thread.c (timer_thread_function): should defer delivery of a signal
- if main thread does not yet trap a previous one. [ruby-dev:37676]
-
-Fri Jan 16 02:05:55 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/socket.c (addrinfo_s_ip): new method AddrInfo.ip.
-
-Fri Jan 16 01:42:50 2009 Koichi Sasada <ko1@atdot.net>
-
- * thread.c (call_trace_proc): as Matz said ([ruby-core:21183]),
- should skip rb_str_new2() if rb_sourcefile() returns NULL.
- rb_sourcefile() returns NULL if frame is toplevel of Fiber.
- [ruby-core:21161] [Bug #985]
-
-Fri Jan 16 01:09:37 2009 Koichi Sasada <ko1@atdot.net>
-
- * ruby.c (process_options): decrement parse_in_eval to recognize
- parsing main or normal eval script.
-
- * compile.c (rb_parse_in_main): return 1 if parsing main script.
- (if parse_in_eval is negative value, it means main script)
-
- * parse.y (yycompile0): check rb_parse_in_main() to accumulate
- script text. Bug #848 [ruby-core:20450]
-
-Fri Jan 16 00:57:34 2009 Koichi Sasada <ko1@atdot.net>
-
- * lib/debug.rb: as wanabe-san pointed out,
- set_trace_func should be completely final task in debug.rb.
- Bug #847 [ruby-core:20449]
-
-Fri Jan 16 00:27:03 2009 Koichi Sasada <ko1@atdot.net>
-
- * vm.c (rb_vm_inc_const_missing_count, ruby_vm_const_missing_count):
- added.
-
- * vm_insnhelper.h: ditto.
-
- * variable.c (rb_const_get_0), insns.def: Constants should not be
- cached if const_missing is called. [ruby-core:21059] [Bug #967]
-
- * bootstraptest/test_class.rb: add a test.
-
-Fri Jan 16 00:25:09 2009 Koichi Sasada <ko1@atdot.net>
-
- * common.mk: btest-ruby should receive option with OPTS.
-
-Fri Jan 16 00:21:10 2009 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/Makefile.sub ($(INSNS), node_name.inc, known_errors.inc,
- miniprelude.c, newline.c): shouldn't copy when $(srcdir) != ".", too.
- (this is a workaround. we need more strict check.)
-
- * win32/Makefile.sub ($(INSNS)): shouldn't remove BASERUBY.
-
-Fri Jan 16 00:19:55 2009 Koichi Sasada <ko1@atdot.net>
-
- * gc.c (gc_with_gvl): suppress warnings.
-
-Thu Jan 15 20:44:30 2009 Tanaka Akira <akr@fsij.org>
-
- * tool/file2lastrev.rb: RUBY_REVISION must be an integer.
-
-Thu Jan 15 15:55:31 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * encoding.c (enc_set_default_encoding): should not treat US-ASCII
- special here. a patch from Yui NARUSE in [ruby-dev:37769].
- [ruby-dev:37699]
-
-Thu Jan 15 14:27:27 2009 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * LEGAL: Added information for missing/langinfo.c
-
-Thu Jan 15 14:17:57 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * parse.y (stmt): explicit error for "Object::Far += foo 1" just
- as "Object::Far += 1".
-
- * parse.y (command): moved return/break/next from command_call for
- better error message.
-
- * parse.y (call_args): void value check added.
-
-Thu Jan 15 13:10:58 2009 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/Makefile.sub (COMPILERFLAG): for enc/trans/gb18030.c.
-
-Thu Jan 15 13:10:09 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in, win32/Makefile.sub (MISSING): added langinfo on mingw
- and mswin.
-
- * encoding.c (rb_locale_charmap): use environments on mingw and mswin.
-
- * missing/langinfo.c (nl_langinfo_codeset): MS-Windows Japanese
- environment uses Windows-31J derived from Shift_JIS, not EUC-JP.
-
-Thu Jan 15 12:10:39 2009 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/Makefile.sub ($(INSNS), node_name.inc, known_errors.inc,
- miniprelude.c, newline.c): copy only when $(srcdir) != pwd.
-
-Thu Jan 15 11:40:44 2009 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * io.c (pipe_open): revert a part of previous commit. it may be a
- mistake.
-
-Thu Jan 15 10:45:52 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * symbian/README.SYMBIAN: symbian support added. great appreciate
- to <alexandre.zavorine at symbian.com>.
-
-Thu Jan 15 00:06:12 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * enc/trans/gb18030.trans: get rid of a 1.9 feature for cross
- compile. [ruby-core:21345]
-
-Wed Jan 14 23:57:28 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * encoding.c (rb_locale_charmap): fallback to codepage if no
- locale is found. [ruby-core:21110]
-
- * missing/langinfo.c (nl_langinfo_codeset): returns NULL if no
- locale is found.
-
-Wed Jan 14 22:38:30 2009 Tanaka Akira <akr@fsij.org>
-
- * gc.c (negative_size_allocation_error_with_gvl): abolish a warning.
- (negative_size_allocation_error): ditto.
-
- * ext/openssl/ossl.c (ossl_raise): ditto.
-
-Wed Jan 14 20:05:05 2009 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * enc/trans/gb18030.trans, gb18030-tbl.rb:
- new Chinese GB18030 transcoding (from Yoshihiro Kambayashi)
-
- * test/ruby/test_transcode.rb: added tests for the above
- (from Yoshihiro Kambayashi)
-
- * transcode_data.h, transcode.c, tool/transcode_tblgen.rb:
- added support for GB18030-specific 4-byte sequences
- (with Yoshihiro Kambayashi)
-
-Wed Jan 14 16:16:19 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * ext/curses/extconf.rb: check ncursesw earlier than ncurses to
- support UTF-8 strings. non UTF-8 strings should be converted
- explicitly. [ruby-core:21094]
-
-Wed Jan 14 14:42:30 2009 TAKANO Mitsuhiro (takano32) <tak@no32.tk>
-
- * cont.c: fix prototype declare of register_stack_extend
-
-Wed Jan 14 13:19:21 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * win32/win32.c (rb_w32_aspawn): should not escape with caret
- unless using cmd.exe.
-
-Wed Jan 14 13:09:00 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Feb 25 15:05:48 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ext/socket/extconf.rb (gai_strerror): checks if available and if
returns const pointer.
@@ -7174,1287 +45,64 @@ Wed Jan 14 13:09:00 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ext/socket/getaddrinfo.c (gai_strerror): defines only if non
available. [ruby-core:21328]
-Wed Jan 14 12:39:16 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * io.c (rb_io_wait_readable, rb_io_wait_writable): need rb_fd_ptr.
-
- * io.c (appendline): reformed.
-
- * io.c (rb_io_s_pipe): reduced nest of rb_ensure of main block.
-
-Tue Jan 13 22:56:57 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/addrinfo.h (AI_NUMERICSERV): defined.
- (AI_MASK): add AI_NUMERICSERV.
-
- * ext/socket/getaddrinfo.c (getaddrinfo): support AI_NUMERICSERV.
-
-Tue Jan 13 21:45:53 2009 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * lib/ostruct.rb (OpenStruct#inspect): fixed the recursion check.
- Patch by Kornelius Kalnbach. [ruby-core:20992].
-
- * test/ostruct/test_ostruct.rb: test for inspect.
- Patch by Kornelius Kalnbach. [ruby-core:20992].
-
-Tue Jan 13 21:44:30 2009 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * io.c (io_reopen, rb_io_init_copy): should register fptr to pipe_list
- when copying pipe fptr.
-
-Tue Jan 13 21:38:07 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/socket.c (rb_getaddrinfo): use getaddrinfo with GVL if
- getaddrinfo.c/getnameinfo.c is used. They are not thread safe
- because gethostbyname/gethostbyaddr is used.
- (rb_getnameinfo): ditto.
-
- * extconf.rb: define GETADDRINFO_EMU if getaddrinfo.c/getnameinfo.c is
- used.
-
-Tue Jan 13 21:28:14 2009 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * object.c (rb_obj_not_match): rdoc.
- Patch by Kornelius Kalnbach. [ruby-core:20991]
-
-Tue Jan 13 18:21:44 2009 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * io.c (rb_io_close_read): call rb_io_fptr_cleanup() instead of
- fptr_finalize() because the fptr has special finalizer if it is a
- pipe. [ruby-dev:37757] (3)
-
-Tue Jan 13 18:19:49 2009 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * io.c (rb_io_initialize): workaround for Windows. [ruby-dev:37686]
- (also see [ruby-dev:37721])
-
-Tue Jan 13 17:29:02 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * enc/trans/make_transdb.rb (converters): should not depend on the
- hash order for cross compile.
-
-Tue Jan 13 16:39:11 2009 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * include/ruby/intern.h, thread.c, win32/Makefile.sub (rb_fdset_t,
- rb_fd_init, rb_fd_term, rb_fd_zero, rb_fd_set, rb_fd_clr, rb_fd_isset,
- rb_fd_select, rb_fd_ptr, rb_fd_max, HAVE_RB_FD_INIT): new type,
- functions, and macros for Windows.
-
- * win32/win32.c (extract_fd, rb_w32_select): use rb_fdset_t to expand
- fd_array if needed. [ruby-core:19946]
-
- * win32/win32.c (copy_fd): new function for rb_w32_select().
-
-Tue Jan 13 12:31:54 2009 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * tool/file2lastrev.rb (get_revisions): fixes problem with
- svn on cygwin. [ruby-dev:37702].
- Patch by Kouhei Sutou.
-
-Tue Jan 13 11:58:04 2009 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * lib/irb/input-method.rb: IRB did not prompt for MSwin32.
- [ruby-dev:37686].
- Patch by arton <artonx AT yahoo.co.jp>.
-
-Tue Jan 13 12:10:42 2009 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * ext/socket/{getaddrinfo,getnameinfo}.c: need to include ws2tcpip.h
- on Windows.
-
-Tue Jan 13 09:49:49 2009 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * ext/socket/socket.c: removed warning about unused variable 'rai'.
-
-Tue Jan 13 03:07:28 2009 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * instruby.rb: require "tool/mdoc2man.rb" before chdir if needed.
-
-Tue Jan 13 02:54:54 2009 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * ext/socket/extconf.rb: use headers instead of "netdb.h" in checking
- getnameinfo() and getaddrinfo() because Windows doesn't have it.
- [ruby-dev:37757] (1)
-
- * ext/socket/sockport.h (SA_LEN): use sockaddr_in6 when defined AF_INET6
- if INET6 is not defined. winsock2's getaddrinfo() returns
- sockaddr_in6 if ipv6 is available.
-
-Tue Jan 13 02:21:43 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * win32/win32.c (internal_cmd_match): extracted from
- is_internal_cmd.
-
- * win32/win32.c (argv_size, join_argv): escapes redirection, pipe
- and caret punctuations with carets.
-
- * win32/win32.c (rb_w32_aspawn): ditto, and redirections and pipe
- have no meanings.
-
-Tue Jan 13 02:07:38 2009 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tk/lib/tk.rb: use Encoding.find("locale") instead of
- Encoding.locale_charmap
-
-Tue Jan 13 00:57:56 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/socket.c (sock_s_unpack_sockaddr_in): check too short
- sockaddr.
- (sock_s_unpack_sockaddr_un): ditto.
-
-Mon Jan 12 23:55:19 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/socket.c (addrinfo_ip_unpack): new method
- AddrInfo#ip_unpack.
- (addrinfo_unix_path): new method AddrInfo#unix_path.
- (Init_socket): define above methods.
-
-Mon Jan 12 23:31:42 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/socket.c (IS_IP_FAMILY): defined.
- (addrinfo_ip_p): use it.
-
-Mon Jan 12 17:23:05 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/test/unit/assertions.rb (assert_nothing_raised): removes the
- current trace to get rid of an issue of MiniTest::Unit#location.
-
-Mon Jan 12 16:49:20 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * instruby.rb (install): erased a garbage.
-
-Mon Jan 12 16:45:28 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Feb 25 14:57:18 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
* win32/win32.c (open_dir_handle): extracted from rb_w32_opendir.
* win32/win32.c (winnt_stat): gets rid of strange behavior of
GetFileAttributes(). [ruby-core:21269]
-Mon Jan 12 12:43:55 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * instruby.rb (parse_args, install): added --strip option.
-
- * instruby.rb (install_recursive): skips the directory if matched
- to a no_install pattern ending with a file separator.
-
-Mon Jan 12 12:33:56 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/mkconstants.rb: don't use bytesize because 1.9 dependent.
- [ruby-core:21266]
-
-Mon Jan 12 11:59:19 2009 Koichi Sasada <ko1@atdot.net>
-
- * gc.c (ruby_xmalloc, ruby_xrealloc, ruby_xfree):
- enable to use them without GVL.
- if GC is invoked, acquire GVL during GC.
- if NoMemoryError is raised, acquire GVL and raise it.
-
-Mon Jan 12 10:39:19 2009 Koichi Sasada <ko1@atdot.net>
-
- * thread.c: fix comment (terminology: Global VM Lock).
-
- * thread.c (blocking_region_begin, blocking_region_end):
- save and clear th->blocking_region_buffer.
-
- * thread.c (rb_thread_call_with_gvl): check if it has GVL.
-
- * thread.c (ruby_thread_has_gvl_p): added.
-
- * vm_core.h: add decls.
-
-Mon Jan 12 10:21:11 2009 Koichi Sasada <ko1@atdot.net>
-
- * eval.c: remove unused decl.
-
-Sun Jan 11 16:53:14 2009 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+Tue Feb 24 02:44:39 2009 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
* lib/erb.rb (PercentScanner): remove PercentScanner. fixed % after
- %> bug. [ruby-dev:37751] [Bug #997]
+ %> bug. [ruby-dev:37751] [Bug #997]
* test/erb/test_erb.rb: ditto
-Sun Jan 11 09:53:01 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/socket/mkconstants.rb (c_str): get rid of a 1.9 feature for
- cross compile. [ruby-core:21243]
-
-Sun Jan 11 09:47:30 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Feb 24 02:35:29 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
* hash.c (rb_hash_s_create): set nil as the value if assoc length
is not enough. [ruby-core:21249]
-Sat Jan 10 21:17:28 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/mkconstants.rb: don't generate unintended newlines.
-
-Sat Jan 10 20:50:02 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/mkconstants.rb: refactored to nest properly in statically
- and dynamically.
-
-Sat Jan 10 20:26:17 2009 Tanaka Akira <akr@fsij.org>
-
- * version.h: make version string succinct:
- "ruby 1.9.1p5000 (2009-01-10 trunk 21414) [i686-linux]".
-
-Sat Jan 10 19:05:13 2009 Koichi Sasada <ko1@atdot.net>
-
- * cont.c (cont_restore_1): should not be inlined.
-
-Fri Jan 9 21:52:47 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/socket.c (sock_define_const): use INT2NUM.
-
-Fri Jan 9 15:40:07 2009 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * ext/socket/mkconstants.rb: define macro if default_value is passed.
-
-Fri Jan 9 13:20:08 2009 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tk/lib/tk.rb: rescue abnormal Encoding.locale_charmap value.
-
-Fri Jan 9 12:29:46 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * common.mk (test-sample), rubytest.rb: use runruby.rb
+Sun Feb 22 22:08:45 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Jan 9 10:40:52 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * eval.c (stack_extend): streamlined rb_thread_restore_context()
+ to ensure O(1) time. based on a patch by Brent Roman <brent AT
+ mbari.org>.
- * test/ruby/test_process.rb (TestProcess::MANDATORY_ENVS): some
- platforms need environments for shared objects.
+Sun Feb 22 22:03:40 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Jan 8 23:19:38 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/socket.c (bsock_shutdown): accept symbol/string as how.
- (shutdown_how_arg): new function.
-
- * ext/socket/mkconstants.rb: generate shutdown_how_to_int.
-
-Thu Jan 8 23:16:37 2009 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * instruby.rb: easy code contains fewer bugs.
-
-Thu Jan 8 22:59:30 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/mkconstants.rb (gen_name_to_int_func): generate
- name_to_int functions, not only body.
-
-Thu Jan 8 22:44:10 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/socket.c: don't use AI_NUMERICSERV for platforms which
- not define it as old Windows.
- [ruby-dev:37736]
-
-Thu Jan 8 17:32:51 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * instruby.rb: should not depend on a library which does not exist
- in 1.8.
-
-Thu Jan 8 07:52:55 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/socket.c (init_unix_addrinfo): don't return a value.
-
-Thu Jan 8 07:30:52 2009 Tanaka Akira <akr@fsij.org>
-
- * lib/open-uri.rb (OpenURI.redirectable?): reverted https redirection.
-
-Thu Jan 8 00:31:58 2009 Tanaka Akira <akr@fsij.org>
-
- * lib/test/unit/assertions.rb (assert_no_match): don't count up as two
- assertions.
-
-Thu Jan 8 00:26:35 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/socket.c (addrinfo_getnameinfo): use NI_DGRAM if socktype
- is SOCK_DGRAM.
-
-Thu Jan 8 00:16:22 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/socket.c (host_str): add flags_ptr argument to specify
- AI_NUMERICHOST if host is numeric form.
- (port_str): add flags_ptr argument to specify AI_NUMERICSERV if port
- is numeric form.
-
-Wed Jan 7 22:24:12 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/socket.c (rb_cAddrInfo): new class AddrInfo.
- (s_recvfrom): return AddrInfo as address.
- (s_recvfrom_nonblock): ditto.
- (sock_accept): ditto.
- (sock_accept_nonblock): ditto.
- (sock_sysaccept): ditto.
- (bsock_send): accept AddrInfo as address argument.
- (sock_connect): ditto.
- (sock_connect_nonblock): ditto.
- (sock_bind): ditto.
- (sock_s_unpack_sockaddr_in): ditto.
- (sock_s_unpack_sockaddr_un): ditto.
- (bsock_local_address): new method BasicSocket#local_address.
- (bsock_remote_address): new method BasicSocket#remote_address.
- (addrinfo_initialize): new method AddrInfo#initialize.
- (addrinfo_inspect): new method AddrInfo#inspect.
- (addrinfo_afamily): new method AddrInfo#afamily.
- (addrinfo_pfamily): new method AddrInfo#pfamily.
- (addrinfo_socktype): new method AddrInfo#socktype.
- (addrinfo_protocol): new method AddrInfo#protocol.
- (addrinfo_to_sockaddr): new method AddrInfo#to_sockaddr.
- (addrinfo_canonname): new method AddrInfo#canonname.
- (addrinfo_ip_p): new method AddrInfo#ip?.
- (addrinfo_ipv4_p): new method AddrInfo#ipv4?.
- (addrinfo_ipv6_p): new method AddrInfo#ipv6?.
- (addrinfo_unix_p): new method AddrInfo#unix?.
- (addrinfo_getnameinfo): new method AddrInfo#getnameinfo.
- (addrinfo_s_getaddrinfo): new method AddrInfo.getaddrinfo.
- (addrinfo_s_tcp): new method AddrInfo.tcp.
- (addrinfo_s_udp): new method AddrInfo.udp.
- (addrinfo_s_unix): new method AddrInfo.unix.
- (Init_socket): define new class and methods.
- (sock_getaddrinfo): apply socktype hack regardless of ai_flags.
- (addrinfo_new): defined.
- (get_afamily): ditto.
- (fd_socket_addrinfo): ditto.
- (io_socket_addrinfo): ditto.
- (SockAddrStringValue): ditto.
- (SockAddrStringValuePtr): ditto.
- (sockaddr_string_value): ditto.
- (sockaddr_string_value_ptr): ditto.
- (rb_addrinfo_t): ditto.
- (addrinfo_mark): ditto.
- (addrinfo_free): ditto.
- (addrinfo_s_allocate): ditto.
- (IS_ADDRINFO): ditto.
- (check_addrinfo): ditto.
- (get_addrinfo): ditto.
- (alloc_addrinfo): ditto.
- (init_addrinfo): ditto.
- (addrinfo_new): ditto.
- (call_getaddrinfo): ditto.
- (init_addrinfo_getaddrinfo): ditto.
- (make_inspectname): ditto.
- (addrinfo_firstonly_new): ditto.
- (addrinfo_list_new): ditto.
- (init_unix_addrinfo): ditto.
- (ai_get_afamily): ditto.
-
- * ext/socket/mkconstants.rb: generate intern_protocol_family,
- intern_socktype and intern_ipproto.
-
- [ruby-dev:37692]
-
-Wed Jan 7 22:13:03 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * instruby.rb (man, gem): fixed errors.
-
-Wed Jan 7 17:14:40 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * instruby.rb: use installed libraries. [ruby-core:21006]
-
- * instruby.rb (gem), lib/rubygems/defaults.rb (Gem.default_dir):
- use version invariant configuration.
-
-Tue Jan 6 19:09:51 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * cont.c (cont_restore_0): streamlined to ensure O(1) time. based on
+ * eval.c (cc_mark): frees the continuation's stack if its thread
+ is dead to avoid recursive gc that segfaults. [ruby-core:13889]
a patch by Brent Roman <brent AT mbari.org>.
-Tue Jan 6 00:34:25 2009 Tanaka Akira <akr@fsij.org>
-
- * io.c (rb_close_before_exec): more heuristics to detect maximum fd.
-
-Mon Jan 5 17:59:43 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in (cygwin): needs properly implemented nl_langinfo().
- [ruby-core:21110]
-
- * missing/langinfo.c: added as suggested at [ruby-core:21015], from
- http://www.cl.cam.ac.uk/~mgk25/ucs/langinfo.c.
-
- * missing/langinfo.c (nl_langinfo_0): fixed typos for SJIS.
-
-Mon Jan 5 17:38:40 2009 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * encoding.c (rb_locale_charmap): use GetConsoleCP() instead of
- GetACP() because external encoding should be console's one.
-
- * encoding.c (rb_filesystem_encoding): use GetOEMCP() instead of
- GetACP() because VFAT/FAT32 uses OEM CP.
-
-Mon Jan 5 16:26:48 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * encoding.c (rb_filesystem_encoding): use ANSI codepage for file
- system on cygwin.
-
- * encoding.c (rb_locale_charmap): reverted. [ruby-core:21110]
-
-Mon Jan 5 16:15:00 2009 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-
- * ext/curses/curses.c (free_window): use xfree instead of free.
- [ruby-dev:37200]
-
-Mon Jan 5 15:49:45 2009 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-
- * ext/gdbm/gdbm.c (rb_gdbm_fetch): remove needless cast.
-
-Mon Jan 5 12:52:08 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * win32/win32.c (init_env): use user profile folder than personal
- folder.
-
-Mon Jan 5 08:41:13 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * file.c (rb_file_s_stat): need type check for non string values.
- [ruby-dev:37673] fix: #964
-
- * file.c (rb_file_s_size, rb_file_s_atime, rb_file_s_mtime,
- rb_file_s_ctime, rb_f_test): ditto.
+ * eval.c (rb_cont_check): checks for valid continuation instance.
-Mon Jan 5 08:17:56 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * range.c (range_step): should not add up errors on loops.
- [ruby-dev:37691]
-
-Mon Jan 5 07:58:37 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * random.c (rb_f_srand): update RDoc. [ruby-core:21113]
-
-Mon Jan 5 06:39:56 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * range.c (range_max): max value from ... not defined for non
- Integer Numeric end values. [ruby-dev:37690] fix: #974
-
-Sun Jan 4 22:37:19 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/socket.c (rb_getaddrinfo): defined for address lookup without GVL.
- (struct getaddrinfo_arg): defined.
- (nogvl_getaddrinfo): defined.
- (rb_getnameinfo): defined for name lookup without GVL.
- (getnameinfo_arg): defined.
- (nogvl_getnameinfo): defined.
-
-Sun Jan 4 18:10:10 2009 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * enc/trans/gbk.trans, gbk-tbl.rb:
- new Chinese GBK transcoding (from Yoshihiro Kambayashi)
-
- * test/ruby/test_transcode.rb: added tests for the above
- (from Yoshihiro Kambayashi)
-
-Sun Jan 4 17:55:55 2009 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * test/ruby/test_transcode.rb: added tests for GB2312
- (from Yoshihiro Kambayashi)
-
- * enc/trans/chinese.trans: set valid byte patterns for
- GB2312 and GB12345
-
-Sun Jan 4 17:39:39 2009 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * enc/trans/big5.trans, big5-tbl.rb:
- new Chinese Big5 transcoding (from Yoshihiro Kambayashi)
-
- * test/ruby/test_transcode.rb: added tests for the above
- (from Yoshihiro Kambayashi)
-
-Sun Jan 4 17:07:45 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/rubygems.rb (Gem.set_home, Gem.set_paths): should not create
- directories stealthily. [ruby-core:20990]
-
- * lib/rubygems.rb (Gem.find_home): expand_path deals with platform
- dependent environments.
-
- * lib/rdoc/ri/paths.rb (RDoc::HOMEDIR): ditto.
-
- * instruby.rb (gem): creates gem directories at installation.
-
-Sun Jan 4 15:41:37 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * encoding.c (rb_filesystem_encoding, rb_locale_charmap): uses
- codepage on cygwin. [ruby-core:20994]
+ * eval.c (rb_callcc): assigns th->thread before scope_dup() to
+ avoid segfaults if this scope_dup() triggers a gc pass.
+ a patch by Brent Roman <brent AT mbari.org>.
-Sun Jan 4 11:58:43 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun Feb 22 21:43:34 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
* numeric.c (ruby_float_step): extracted from num_step().
* range.c (range_step): uses ruby_float_step() for float range.
[ruby-dev:37691]
-Sun Jan 4 11:11:31 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun Feb 22 00:49:36 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ext/extmk.rb (extmake): does not use both of makefile.rb and
extconf.rb at the same time.
* lib/mkmf.rb (DLLIB): depends on Makefile. [ruby-core:21096]
-Sun Jan 4 09:27:41 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/socket/socket.c (constant_arg): constified.
-
- * ext/socket/socket.c (optname_arg): cygwin does not have
- IPPROTO_IPV6.
-
- * ext/socket/mkconstants.rb (ipv6_optname_to_int): ditto.
-
-Sun Jan 4 04:33:14 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/socket.c: redundant #ifdef removed.
-
-Sun Jan 4 03:30:18 2009 Tanaka Akira <akr@fsij.org>
-
- * io.c (maygvl_copy_stream_wait_read): renamed to add prefix to
- express GVL state.
- (nogvl_copy_stream_wait_write): ditto.
- (nogvl_copy_stream_sendfile): ditto.
- (maygvl_copy_stream_read): ditto.
- (nogvl_copy_stream_write): ditto.
- (nogvl_copy_stream_read_write): ditto.
- (nogvl_copy_stream_func): ditto.
-
-Sun Jan 4 00:30:50 2009 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
-
- * lib/erb.rb: merged r20850, r17881, r16811, r16763, r16748, r15829,
- r15794 and r15698 from ruby_1_8.
-
- * test/erb/test_erb.rb: ditto.
-
-Sat Jan 3 22:24:36 2009 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * common.mk, Makefile.in, win32/Makefile.sub (INSNS): move the macro
- definition from common.mk to {Makefile.in,win32/Makefile.sub}.
- [ruby-dev:37678]
-
-Sat Jan 3 15:30:09 2009 NARUSE, Yui <naruse@ruby-lang.org>
-
- * enc/trans/chinese.trans: added for transcoding EUC-CN and GB12345.
-
- * enc/trans/GB/: ditto.
-
-Sat Jan 3 15:26:30 2009 NARUSE, Yui <naruse@ruby-lang.org>
-
- * enc/trans/euc-cn.c: renamed from gb2312.c because GB2312 is
- the name of a CSS. it's encoding name is "EUC-CN".
-
-Sat Jan 3 03:00:42 2009 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * common.mk, Makefile.in, win32/Makefile.sub ($(INSNS), node_name.inc,
- known_errors.inc, miniprelude.c, newline.c): move rules from common.mk
- to {Makefile.in,win32/Makefile.sub} for nmake.
- [ruby-core:20993]
-
-Fri Jan 2 23:51:41 2009 Yusuke Endoh <mame@tsg.ne.jp>
-
- * test/ruby/test_sleep.rb (test_sleep_5sec): stop gc.
-
-Fri Jan 2 23:36:10 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/socket.c: don't apply socktype hack [ruby-core:184] for
- sock_s_getaddrinfo.
- (sock_getaddrinfo): add socktype_hack argument.
- (sock_addrinfo): call sock_getaddrinfo with socktype_hack.
- (sock_s_getaddrinfo): call sock_getaddrinfo without socktype_hack.
- [ruby-dev:37674]
-
-Fri Jan 2 23:33:38 2009 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * include/ruby/missing.h, sprintf.c: get rid of a warning of VC++.
-
-Fri Jan 2 22:25:46 2009 Yusuke Endoh <mame@tsg.ne.jp>
-
- * process.c: use sigaction instead of sigset. [ruby-core:21021]
-
-Fri Jan 2 22:22:04 2009 Yusuke Endoh <mame@tsg.ne.jp>
-
- * bootstraptest/test_proc.rb: suppress error message.
-
-Fri Jan 2 22:20:46 2009 Yusuke Endoh <mame@tsg.ne.jp>
-
- * test/ruby/test_process.rb (test_wait_and_sigchild): remove debug
- output.
-
-Fri Jan 2 17:45:19 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/mkconstants.rb: rename family_to_str to intern_family.
- it returns ID now.
-
- * ext/socket/socket.c (ipaddr): use intern_family.
-
-Fri Jan 2 17:20:31 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/mkconstants.rb: use ID in the values of
- family_to_str_hash. family_to_str returns a VALUE.
-
- * ext/socket/socket.c (ipaddr): follow family_to_str change.
-
-Fri Jan 2 17:01:51 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/mkconstants.rb: refactored to gather stringizer
- description.
-
-Fri Jan 2 15:30:57 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/mkconstants.rb: make common prefix optional.
-
-Fri Jan 2 14:59:52 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/mkconstants.rb: use hash for family_to_str to avoid
- linear search. lenp argument removed.
-
- * ext/socket/socket.c (ipaddr): call family_to_str without lenp
- argument.
-
-Fri Jan 2 14:33:12 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/mkconstants.rb (gen_int_to_name): don't compare constants
- in preprocessor because the constants may be enum.
-
-Fri Jan 2 14:11:07 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/mkconstants.rb (gen_int_to_name): add lenp argument.
-
- * ext/socket/socket.c (ipaddr): follow argument change.
-
-Fri Jan 2 10:20:24 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/singleton.rb: fix documentation. [ruby-core:21038]
-
-Fri Jan 2 06:43:58 2009 NARUSE, Yui <naruse@ruby-lang.org>
-
- * signal.c (rb_signal_buff_size): defined for check whether signal
- is in the buffer or not.
-
- * thread_pthread.c (thread_timer): don't exit the loop when signal
- is in the buffer. [ruby-dev:37637]
-
-Fri Jan 2 04:40:00 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/mkconstants.rb: check duplicates.
-
-Fri Jan 2 02:39:08 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/socket.c (optname_arg): defined.
- (bsock_setsockopt): use optname_arg.
- (bsock_getsockopt): ditto.
-
- * ext/socket/mkconstants.rb: generate so_optname_to_int,
- ip_optname_to_int, ipv6_optname_to_int, tcp_optname_to_int and
- udp_optname_to_int.
- more constants.
-
-Fri Jan 2 02:08:36 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/socket.c (constant_arg): extracted from family_arg.
- (family_arg): use constant_arg.
- (socktype_arg): ditto.
- (level_arg): ditto.
-
-Fri Jan 2 01:15:11 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/socket.c (level_arg): defined.
- (bsock_setsockopt): use level_arg.
- (bsock_getsockopt): ditto.
-
- * ext/socket/mkconstants.rb: generate level_to_int.
-
-Fri Jan 2 00:58:40 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/socket.c (family_arg): accept symbols as well.
- (socktype_arg): ditto.
-
-Fri Jan 2 00:49:44 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/socket.c (sock_s_getaddrinfo): use socktype_arg.
-
-Fri Jan 2 00:12:27 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/socket.c (family_arg): extracted from
- setup_domain_and_type.
- (socktype_arg): ditto.
- (udp_init): use family_arg.
- (sock_s_gethostbyaddr): ditto.
- (sock_s_getaddrinfo): ditto.
- (sock_s_getnameinfo): ditto.
-
-Thu Jan 1 22:27:55 2009 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * spec/default.mspec: fix for builddir != srcdir
-
- * Makefile.in: ditto.
-
-Thu Jan 1 21:26:05 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/socket.c (sock_s_getnameinfo): use family_to_int.
-
-Thu Jan 1 21:08:34 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/mkconstants.rb: check all alias possibility.
-
-Thu Jan 1 20:59:55 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/mkconstants.rb: more possible aliases.
-
-Thu Jan 1 20:54:02 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/mkconstants.rb: AF_ISO and AF_OSI may be aliased.
-
-Thu Jan 1 20:50:09 2009 URABE Shyouhei <shyouhei@ruby-lang.org>
-
- * process.c (before_exec): it makes no sense for a conditional
- expression to return a void value.
-
-Thu Jan 1 20:47:09 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/socket.c (sock_s_getaddrinfo): use family_to_int.
-
-Thu Jan 1 20:17:47 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/socket.c: include constants.h at top.
-
-Thu Jan 1 19:53:33 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/mkconstants.rb: add valp argument for family_to_int and
- socktype_to_int.
-
- * ext/socket/socket.c (setup_domain_and_type): use valp argument.
-
-Thu Jan 1 19:36:57 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/mkconstants.rb: generate family_to_str.
-
- * ext/socket/socket.c (ipaddr): use family_to_str.
-
-Thu Jan 1 17:37:12 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/mkconstants.rb: generate socktype_to_int.
-
- * ext/socket/socket.c (setup_domain_and_type): use socktype_to_int.
-
-Thu Jan 1 17:26:47 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/socket.c (setup_domain_and_type): initialize ptr.
-
-Thu Jan 1 17:01:50 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/mkconstants.rb: refine family_to_int.
-
-Thu Jan 1 16:48:07 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/mkconstants.rb: generate family_to_int().
-
- * ext/socket/socket.c (setup_domain_and_type): use family_to_int.
-
-Thu Jan 1 15:08:46 2009 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * tool/file2lastrev.rb: supports git repositories which are cloned
- from a git-svn gateway.
- Patch by Hongli Lai. [ruby-core:21020]
-
-Thu Jan 1 16:08:11 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/mkconstants.rb: generate init_constants function.
-
- * ext/socket/socket.c (Init_socket): call init_constants.
-
-Thu Jan 1 16:03:04 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/mkconstants.rb (Socket::AF_INET6): moved from socket.c.
- (Socket::PF_INET6): ditto.
-
-Thu Jan 1 15:27:07 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/mkconstants.rb: use erb.
-
-Thu Jan 1 15:07:56 2009 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/mkconstants.rb: add -o option.
-
- * ext/socket/depend: use mkconstants.rb with -o option.
-
-Thu Jan 1 07:42:36 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/singleton.rb: fix indentation of RDoc text. [ruby-core:21029]
-
-Thu Jan 1 07:16:44 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * Makefile.in (distclean-ext, realclean-ext): use EXTS as default.
-
- * win32/Makefile.sub (distclean-ext, realclean-ext): try to remove ext
- directory.
-
-Thu Jan 1 06:56:28 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * tool/file2lastrev.rb: unset PWD.
-
-Wed Dec 31 23:37:17 2008 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/socket.c (sock_s_socketpair): yield if a block is given.
- (io_call_close): defined.
- (io_close): defined.
- (pair_yield): defined.
-
-Wed Dec 31 19:35:57 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * spec/README: follows the change of directory structure in rubyspec.
-
- * spec/default.mspec: ditto. Also follows change of mspec command.
-
- * Makefile.in: ditto.
-
-Wed Dec 31 17:16:46 2008 Tanaka Akira <akr@fsij.org>
-
- * ext/openssl/ossl_ssl.c (ossl_ssl_read_internal): show openssl error
- code in EWOULDBLOCK error.
-
-Wed Dec 31 15:45:18 2008 Tanaka Akira <akr@fsij.org>
-
- * io.c (copy_stream_body): don't check to_io because
- Zlib::GzipWriter#to_io returns the underlying IO.
-
-Wed Dec 31 14:52:33 2008 Tanaka Akira <akr@fsij.org>
-
- * ext/openssl/ossl_digest.c (GetDigestPtr): use StringValueCStr
- instead of STR2CSTR.
-
- * ext/openssl/ossl_pkey_ec.c (ossl_ec_key_initialize): ditto.
- (ossl_ec_group_initialize): ditto.
-
-Wed Dec 31 14:12:35 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * object.c (rb_to_float): replaced by to_flo definition from
- math.c [ruby-dev:37668]
-
- * math.c (Need_Float): use rb_to_float().
-
-Wed Dec 31 13:49:06 2008 Tanaka Akira <akr@fsij.org>
-
- * ext/openssl/lib/openssl/buffering.rb (Buffering#read_nonblock):
- implemented.
-
- * ext/openssl/ossl_ssl.c (rb_sys_fail_path): removed.
- (fcntl.h): don't include.
- (ossl_ssl_read_internal): defined.
- (ossl_ssl_read): use ossl_ssl_read_internal.
- (ossl_ssl_read_nonblock): use ossl_ssl_read_internal.
- (Init_ossl_ssl): define sysread_nonblock, instead of read_nonblock.
-
-Wed Dec 31 00:27:54 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * object.c (rb_to_float): prohibit conversion from nil to float.
- [ruby-dev:37663]
-
- * pack.c (pack_pack): replace all rb_Float() to rb_to_float().
- [ruby-dev:37663]
-
-Tue Dec 30 21:17:00 2008 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/mkconstants.rb: use sock_define_uconst for INADDR_*
- constants because Socket::INADDR_LOOPBACK should be 0x7f000001
- instead of -0xffffff.
-
- * ext/socket/socket.c (sock_define_uconst): defined.
-
-Tue Dec 30 18:23:10 2008 Ryan Davis <ryand-ruby@zenspider.com>
-
- * lib/minitest/*.rb: Imported minitest 1.3.1 r4506.
- * test/minitest/*.rb: ditto.
-
-Tue Dec 30 17:59:59 2008 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * transcode.c: Minor fixes and tweaks in documentation.
-
-Tue Dec 30 17:03:51 2008 Koichi Sasada <ko1@atdot.net>
-
- * ext/dl/test/test_import.rb: fix a prototype decl.
- pointed out by Takehiro Kubo [ruby-core:20971].
-
-Tue Dec 30 16:56:09 2008 Koichi Sasada <ko1@atdot.net>
-
- * thread.c (rb_thread_blocking_region): add a comment.
-
- * thread.c (rb_thread_call_without_gvl): added as a alias of
- rb_thread_blocking_region().
-
- * thread.c (rb_thread_call_with_gvl): added.
-
- * vm_core.h (rb_thread_t#blocking_region_buffer): added for
- rb_thread_call_with_gvl().
-
-Mon Dec 29 23:41:42 2008 Koichi Sasada <ko1@atdot.net>
-
- * ext/dl/test/test_base.rb: add libc search logic.
- this patch is written by Takehiro Kubo.
- [ruby-core:20963] [Bug #932]
-
- * ext/dl/dl.h: Add ",..." as the last argument.
- this patch is written by Takehiro Kubo.
- Bug #633 [ruby-core:19289]
-
- * ext/dl/lib/dl/stack.rb: add add_padding() to calculate
- alignment. this patch is written by Takehiro Kubo.
- Bug #633 [ruby-core:19289]
-
- * ext/dl/test/test_func.rb: atof()'s return value is double.
- this patch is written by Takehiro Kubo.
- Bug #633 [ruby-core:19289]
-
- * ext/dl/test/test_import.rb:
- - atof()'s return value is double.
- - The types of qsort's second and third argument are size_t.
- - fprintf()'s return value is int.
- this patch is written by Takehiro Kubo.
- Bug #633 [ruby-core:19289]
-
-Mon Dec 29 22:37:17 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * process.c (rb_waitpid): retries waitpid when EINTR.
- [ruby-core:19744].
-
-Mon Dec 29 23:18:52 2008 Tadayoshi Funaba <tadf@dotrb.org>
-
- * bignum.c (rb_cstr_to_inum): changed an error message.
-
- * complex.c (string_to_c_strict): ditto.
-
- * rational.c (string_to_r_strict): ditto.
-
-Mon Dec 29 22:37:57 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * pack.c (pack_pack): template f should not accept non float
- values. [ruby-dev:37656]
-
- * object.c (rb_to_float): new function to type check floats.
-
-Mon Dec 29 22:27:11 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * random.c (rb_f_rand): type check simplified. strings are no
- longer allowed for argument. [ruby-dev:37655]
-
- * test/ruby/test_rand.rb (TestRand::o.to_int): need override
- to_int.
-
-Mon Dec 29 21:22:31 2008 Tadayoshi Funaba <tadf@dotrb.org>
-
- * numeric.c: Infinity.numerator returns self. [experimental]
-
- * numeric.c: Infinity.denominator returns 1. [experimental]
-
-Mon Dec 29 20:57:14 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * man/ri.1: new manpage.
-
-Mon Dec 29 20:45:25 2008 Tadayoshi Funaba <tadf@dotrb.org>
-
- * rational.c: floor, ceil, truncate and round accept an extra
- argument like Float#round. [experimental]
-
-Mon Dec 29 18:24:49 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * Makefile.in (distclean-local): removes Doxyfile and
- run.gdb at distclean'ing.
-
-Mon Dec 29 17:53:24 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * bin/erb: accepts options in more flexible styles.
-
-Mon Dec 29 17:25:17 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * lib/erb.rb (ERB): m17n of ERB. adds rdoc.
- fixes #712. c.f. [ruby-dev:37516].
-
- * lib/erb.rb (ERB::Compiler#compile): recognizes magic comments.
- returns a pair of compiled script and its script encoding.
-
- * lib/erb.rb (ERB#set_eoutvar): make generated scripts return a
- string in correct encoding.
-
- * lib/erb.rb (ERB#def_method): use Kernel#eval for encoding-awareness
- of the evaluated string.
-
- * bin/erb.rb (ERB::Main.run): adds -E and -U options.
- String is no longer Enumerable.
-
- * man/erb.1: new manpage.
-
- * test/erb/test_erb_m17n.rb: new test case for m17n features.
-
-Mon Dec 29 18:02:45 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * ext/io/wait/wait.c (io_nread): returns number of bytes available
- for read. response to feature request #936 in [ruby-core:20917].
-
-Mon Dec 29 17:52:16 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * ext/io/wait/wait.c (io_ready_p): updated to follow RDoc.
-
-Mon Dec 29 16:52:15 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * ext/socket/socket.c (s_recvfrom_nonblock): revert r21162.
-
-Mon Dec 29 16:16:20 2008 Koichi Sasada <ko1@atdot.net>
-
- * vm.c (vm_set_eval_stack, vm_set_main_stack, vm_set_top_stack):
- check stack overflow. [ruby-dev:37646]
-
-Sun Dec 28 18:36:33 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * test/rubygems/test_gem_command.rb
- (test_add_option_overlapping_common_and_local_options):
- follows r21066.
-
-Mon Dec 29 14:50:19 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * Makefile.in (ext-clean): ext-clean always fails.
-
- * ext/dl/ripper/extconf.rb: adds y.output into the clean list.
-
-Mon Dec 29 11:58:39 2008 Koichi Sasada <ko1@atdot.net>
-
- * thread.c (rb_mutex_trylock): return false if Mutex owned
- by current thread. [ruby-core:20943]
-
- * thread.c (rb_mutex_lock): check dead lock (recursive lock) here.
-
- * test/ruby/test_thread.rb: add a test.
-
-Mon Dec 29 10:58:54 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * file.c (rb_get_path): move encoding conversion of file path
- from rb_scan_open_args.
-
- * io.c (rb_scan_open_args): ditto.
-
-Mon Dec 29 07:15:16 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * cont.c: small RDoc fix mentioned from <radek.bulat at gmail.com>
- in [ruby-core:20921].
-
-Mon Dec 29 03:43:25 2008 Koichi Sasada <ko1@atdot.net>
-
- * ruby.c (process_options): set th->base_block only while
- it is needed. [ruby-dev:37634] [Bug #939]
-
- * ruby.c (require_libraries): clear th->base_block before
- require libraries.
-
-Sun Dec 28 21:33:52 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * test/ext/dl/test_base.rb: add BSD's case.
-
-Sun Dec 28 21:09:12 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * ext/dl/lib/dl/import.rb (DL::Importer#sizeof): follows
- a feature change in 1.9.
-
-Sun Dec 28 21:03:07 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * ext/dl/lib/dl/import.rb (DL::Importer#extern): adds filename and
- line number to module_eval'ing for readability of backtrace.
- (DL::Importer#bind): ditto.
-
- * ext/dl/lib/dl/struct.rb (DL::CStructBuilder#create): ditto.
-
-Sun Dec 28 19:11:03 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * win32/Makefile.sub (config.h): do not use snprintf/vsnprintf in
- msvcrt.
-
- * sprintf.c: not force to override snprintf/vsnprintf.
- [ruby-core:20824]
-
-Sun Dec 28 17:21:36 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * test/rubygems/test_ext_configure_builder.rb (test_self_build_fail):
- Extends pattern for FreeBSD's error message.
-
-Sun Dec 28 17:10:13 2008 TAKANO Mitsuhiro (takano32) <tak@no32.tk>
-
- * ext/dl/test/test_dl2.rb: modify strncpy, strcpy, qsort, types.
- Patch by Takehiro Kubo.
- Bug #633 [ruby-core:19289]
- * ext/dl/test/test_base.rb: /lib/libc.so is x86_64 binary in x86_64 architecture.
-
-Sun Dec 28 12:53:10 2008 TAKANO Mitsuhiro (takano32) <tak@no32.tk>
-
- * ext/dl/test/test_base.rb: use libc.dylib when the platform is darwin.
-
-Sun Dec 28 12:24:14 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * thread.c (mutex_free, mutex_unlock): add qualifiers.
-
-Sun Dec 28 10:28:04 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * thread.c (mutex_free): GC thread (main thread) has failed to unlock
- a mutex that is locked by another thread, which makes the mutex
- dangling in keeping_mutexes and causes [BUG] or stuck finally.
- Now unlocking is performed as locking thread.
-
- * thread.c (mutex_unlock, rb_mutex_unlock, rb_mutex_unlock_all):
- mutex_unlock receives a thread.
-
-Sun Dec 28 05:44:44 2008 Ryan Davis <ryand-ruby@zenspider.com>
-
- * lib/minitest/*.rb: Imported minitest 1.3.1 r4505.
- * test/minitest/*.rb: ditto.
-
-Sun Dec 28 00:43:33 2008 Tanaka Akira <akr@fsij.org>
-
- * runruby.rb: refactored to modify ENV as once.
-
-Sat Dec 27 22:41:02 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * test/rdoc/test_rdoc_info_formatting.rb (setup, teardown): uses
- mktmpdir and removes it after the test.
-
- * test/cgi/test_cgi_session.rb (setup, teardown): ditto.
-
-Sat Dec 27 21:46:10 2008 TAKANO Mitsuhiro (takano32) <tak@no32.tk>
-
- * ext/dl/test/test_base.rb: use lib64 when the architecture is x86_64.
-
-Sat Dec 27 20:26:59 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/win32.c (rb_w32_argv_size): if an argument is empty, it's size
- is 2, not 0, because it will be converted to "".
-
-Sat Dec 27 19:40:56 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * process.c (after_exec): needs to reset before restart timer
- thread.
-
- * thread.c (thread_start_func_2): stops timer thread if forked in
- the new thread. [ruby-core:19385]
-
- * thread.c (rb_thread_atfork, rb_thread_atfork_before_exec): DRY.
-
-Sat Dec 27 18:25:09 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * vm_eval.c (rb_f_loop): return enumerator if no block given.
- [ruby-list:45747]
-
-Sat Dec 27 17:08:43 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * .gdbinit (dummy_gdb_enums.special_consts): forces to load debug
- info on Mac OS X.
-
- * .gdbinit (rp): added T_ZOMBIE.
-
-Sat Dec 27 16:18:02 2008 Koichi Sasada <ko1@atdot.net>
-
- * eval.c (rb_frame_callee, rb_frame_caller): rb_frame_callee()
- should return method id on current frame.
- add rb_frame_caller() to get method id on parent frame.
- Bug #884 [ruby-dev:37446]
+Sun Feb 22 00:19:05 2009 Tanaka Akira <akr@fsij.org>
- * eval.c (rb_f_method_name): use rb_frame_caller()
- instead of rb_frame_callee().
+ * eval.c (rb_thread_schedule): Don't change status of threads which
+ don't run next even if select notify readability/writability.
+ [ruby-core:20446]
-Sat Dec 27 15:28:12 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode.c (make_econv_exception): show source and destination
- encoding. [ruby-dev:37285]
-
-Sat Dec 27 15:23:38 2008 Koichi Sasada <ko1@atdot.net>
-
- * vm_insnhelper.c (vm_yield_with_cfunc): rename parameter name
- "blockptr" to "blockargptr".
-
-Sat Dec 27 15:15:56 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * common.mk (revision.h): ignores failure of file2lastrev.
-
-Sat Dec 27 15:02:38 2008 Koichi Sasada <ko1@atdot.net>
-
- * ruby.c (process_options): fix to untouch th->mild_compile_error.
- [ruby-dev:37621], [ruby-dev:37620]
-
-Sat Dec 27 14:48:26 2008 Koichi Sasada <ko1@atdot.net>
-
- * iseq.h, iseq.c (rb_iseq_new_main): add a type ISEQ_TYPE_MAIN.
- [ruby-dev:37619]
-
- * compile.c (rb_dvar_defined, ruby_iseq_compile): ditto.
-
- * iseq.c (iseq_data_to_ary, iseq_load): ditto.
-
- * compile.c (iseq_compile_each): fix to check ip->compile_data.
-
-Sat Dec 27 14:29:33 2008 Tanaka Akira <akr@fsij.org>
-
- * lib/open-uri.rb (OpenURI.redirectable?): permit https redirection.
- patch from Roman Shterenzon. [ruby-core:20485]
-
-Sat Dec 27 13:36:55 2008 Koichi Sasada <ko1@atdot.net>
-
- * eval.c (get_errinfo): return th->errinfo value
- if normal errinfo place (dynamic local variable) is not found.
- fixes Bug #732 [ruby-dev:37046].
-
- * bootstraptest/test_proc.rb: add a test.
-
-Sat Dec 27 13:10:43 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * man/irb.1: adds -v, -h, -E and -U.
-
-Sat Dec 27 11:41:45 2008 Koichi Sasada <ko1@atdot.net>
-
- * vm_insnhelper.c (vm_call_method, vm_call_cfunc): use original id instead of
- calling id when NODE_CFUNC or NODE_BMETHOD.
- fixes Bug #632 [ruby-core:19282].
-
- * vm_eval.c (vm_call0, vm_call_super): ditto.
-
- * vm_method.c (rb_add_method, rb_alias): store original id
- in nd_file field of NODE_METHOD.
-
- * test/stringio/test_stringio.rb: add a test.
-
-Sat Dec 27 09:48:54 2008 Koichi Sasada <ko1@atdot.net>
-
- * vm.c (Init_VM): create and define TOPLEVEL_BINDING at first.
-
- * vm.c (vm_set_main_stack, rb_iseq_eval_main): added.
-
- * parse.y (rb_parser_compile_file): fix to check parse_in_eval flag.
-
- * eval.c (ruby_exec_node): use rb_iseq_eval_main()
- instead of rb_iseq_eval().
-
- * iseq.c (rb_iseq_new_main), vm_core.h: added.
- main script (specified by -e or script name) should be run
- under TOPLEVEL_BINDING using Kernel#eval. Above changes
- simulate Kernel#eval behaviour. [ruby-dev:37240]
-
- * compile.c (make_name_for_block): skip iseq except block type.
- this fix is needed for [ruby-dev:37240], and also fixes
- [ruby-dev:35392].
-
-Sat Dec 27 09:14:17 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * cont.c: rdoc for Fiber. patch by Muhammad Ali.
- [ruby-core:20894]
-
-Sat Dec 27 05:38:59 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * process.c (after_fork): ignores a termination request in the
- parent process. [ruby-dev:37447]
-
-Sat Dec 27 01:52:39 2008 James Edward Gray II <jeg2@ruby-lang.org>
-
- * lib/csv.rb: Using a more robust transcoding scheme to produce
- ASCII compatible inspect() messages. [ruby-dev:37591]
-
-Fri Dec 26 18:04:10 2008 Tanaka Akira <akr@fsij.org>
-
- * io.c (fptr_finalize): don't allocate objects if noraise.
- (finish_writeconv): add noalloc argument to be able to avoid
- object allocation.
- (finish_writeconv_arg): introduced again.
- (finish_writeconv_sync): follow the above change.
-
-Fri Dec 26 17:04:14 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * lib/irb/input-method.rb (IRB::StdioInputMethod#initialize):
- removed a 'p' for debugging.
-
-Fri Dec 26 15:50:45 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Feb 20 20:43:13 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/optparse.rb (OptionParser::List#summarize): gives priority
to latter switches. [ruby-dev:36692]
@@ -8462,5541 +110,230 @@ Fri Dec 26 15:50:45 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/optparse.rb (OptionParser#summarize): do not append
unnecessary line terminator.
-Fri Dec 26 14:01:38 2008 Tanaka Akira <akr@fsij.org>
-
- * io.c (fptr_finalize): close the IO object even if finish_writeconv or
- flush is failed.
- (finish_writeconv): don't raise. return errno or exception.
- (finish_writeconv_arg): removed.
- (finish_writeconv_sync): follow finish_writeconv change.
-
- * transcode.c (rb_econv_make_exception): new function.
-
- * include/ruby/encoding.h (rb_econv_make_exception): declared.
-
-Thu Dec 25 20:57:01 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * transcode.c (str_transcode0): set encoding when String#encode was
- given explicit but the same destination and source encoding.
-
-Thu Dec 25 20:01:50 2008 Tanaka Akira <akr@fsij.org>
-
- * io.c (rb_io_s_pipe): unused variable removed.
-
-Thu Dec 25 19:35:51 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * transcode.c (sym_ignore): remove useless symbol.
-
-Thu Dec 25 18:36:04 2008 Tanaka Akira <akr@fsij.org>
-
- * io.c (pipe_close): removed.
- (pipe_yield): defined.
- (rb_io_s_pipe): use pipe_yield.
-
-Thu Dec 25 17:49:45 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * transcode.c (decorate_convpath): show type of escaping for
- xml_attr_quote or some conversions.
-
-Thu Dec 25 17:06:13 2008 Tanaka Akira <akr@fsij.org>
-
- * io.c (rb_io_initialize): check fd validity. [ruby-dev:36646]
-
-Thu Dec 25 16:23:31 2008 Tanaka Akira <akr@fsij.org>
-
- * io.c (flush_before_seek): check io_fflush result.
- (rb_io_check_readable): ditto.
- (rb_io_flush): ditto.
- (rb_io_fsync): ditto.
- (remain_size): ditto.
- (rb_io_write_nonblock): ditto.
- (finish_writeconv): ditto.
- (fptr_finalize): ditto.
- (io_reopen): ditto.
- (rb_io_reopen): ditto.
- (copy_stream_body): ditto.
-
-Thu Dec 25 15:54:00 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * io.c (io_fflush): flush write buffer without write lock in
- finalizers. [ruby-dev:37572]
-
- * io.c (rb_io_fptr_finalize): clear write lock before finalizing.
-
-Thu Dec 25 15:07:22 2008 Tanaka Akira <akr@fsij.org>
-
- * io.c (fptr_finalize): close the IO object even if close(2) is failed.
-
-Thu Dec 25 14:51:43 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * lib/rdoc/parser.rb (RDoc::Parser.binary?): should read in binary mode.
-
-Thu Dec 25 14:32:23 2008 Koichi Sasada <ko1@atdot.net>
-
- * vm_insnhelper.c (vm_method_search): fix control flow bug.
- (commited at r20981)
-
-Thu Dec 25 13:28:20 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * io.c (rb_io_flush): fsync() after buffer is flushed on win32.
- [ruby-core:20043]
-
-Thu Dec 25 13:13:00 2008 Koichi Sasada <ko1@atdot.net>
-
- * vm_insnhelper.c (vm_method_search): return rb_cObject if there is no
- super class. [ruby-dev:37587]
-
- * bootstraptest/test_method.rb: add tests for above.
-
-Thu Dec 25 12:49:12 2008 Koichi Sasada <ko1@atdot.net>
-
- * proc.c (proc_new): should use proc_dup() if block has Proc.
-
- * vm.c (vm_make_proc_from_block): should use rb_cProc for block.
-
- * vm.c (vm_make_proc): add an assertion.
-
- * bootstraptest/test_proc.rb: add a test.
-
-Thu Dec 25 12:44:27 2008 Koichi Sasada <ko1@atdot.net>
-
- * vm_insnhelper.c (vm_yield_with_cfunc): check block has Proc.
-
-Thu Dec 25 05:53:01 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * template/id.h.tmpl, id.h (ruby_method_ids): not depend on if
- token are defined as macros. [ruby-dev:37553]
-
- * template/id.h.tmpl, id.h (ruby_method_ids_check): enclosed in a
- struct.
-
-Thu Dec 25 01:52:34 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * thread.c (thread_start_func_2): sets native thread key.
-
-Thu Dec 25 01:09:23 2008 TAKAO Kouji <kouji@takao7.net>
-
- * test/readline/test_readline_history.rb: check the encoding that
- is in the Readline::HISTORY.
-
-Thu Dec 25 00:59:06 2008 TAKAO Kouji <kouji@takao7.net>
-
- * test/readline/test_readline_history.rb: did not check the
- encoding that is in the Readline::HISTORY. I will fix it.
-
-Wed Dec 24 22:36:06 2008 Koichi Sasada <ko1@atdot.net>
-
- * error.c, vm_dump.c: change message by rb_bug().
-
-Wed Dec 24 21:57:39 2008 Koichi Sasada <ko1@atdot.net>
-
- * compile.c (iseq_peephole_optimize): fix typo.
-
-Sun Dec 21 13:38:04 2008 Koichi Sasada <ko1@atdot.net>
-
- * vm.c (invoke_block_from_c): fix to point right cfp.
-
- * vm.c (vm_make_proc, vm_make_proc_from_block), vm_core.h:
- remove unused parameter cfp.
-
- * vm_insnhelper.c, proc.c (proc_new): ditto.
-
-Wed Dec 24 20:59:12 2008 Koichi Sasada <ko1@atdot.net>
-
- * error.c (exc_equal): == method should not raise Exception.
- [ruby-dev:37519]
-
- * sample/test.rb: fix test.
-
-Wed Dec 24 20:33:45 2008 Koichi Sasada <ko1@atdot.net>
-
- * vm_insnhelper.c (vm_call_method): use class of method defined
- instead of receiver's class on bmethod. fixes [ruby-core:20786]
-
- * bootstraptest/test_method.rb: add a test for above.
-
- * vm_insnhelper.c (vm_setup_method): remove unused parameter klass.
-
- * vm_insnhelper.h (CALL_METHOD): ditto.
-
- * insns.def, vm_eval.c: ditto.
-
-Wed Dec 24 20:15:50 2008 Koichi Sasada <ko1@atdot.net>
-
- * tool/file2lastrev.rb (get_revisions): fix to ignore end of line.
-
-Wed Dec 24 13:33:38 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in (HAVE_LONG_LONG, HAVE_OFF_T): revised for autoconf
- 2.62 or later.
-
-Wed Dec 24 06:29:32 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in (OBJDUMP, OBJCOPY): autoconf list is not comma
- separated.
-
- * configure.in (AC_HEADER_STDC, AC_CHECK_HEADERS, AC_CHECK_FUNCS):
- removed duplicated checks.
-
-Wed Dec 24 03:21:21 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * misc/ruby-mode.el: added comment to mention newer version
- bundled with Emacs 23 or later. a patch from Phil Hagelberg
- <phil at hagelb.org> in [ruby-core:20838].
-
-Tue Dec 23 23:49:37 2008 Tanaka Akira <akr@fsij.org>
-
- * io.c (rb_io_init_copy): call io_seek only if io_tell succeeds.
-
-Tue Dec 23 22:57:48 2008 Tanaka Akira <akr@fsij.org>
-
- * process.c (rb_fork): don't propagate an error message if error
- buffer not given.
-
-Tue Dec 23 21:55:05 2008 Tanaka Akira <akr@fsij.org>
-
- * process.c (rb_fork): propagate an error message from child to parent.
- (rb_f_exec): show details of error in child process on
- exception.
- (save_redirect_fd): add error message arguments.
- (run_exec_dup2): ditto.
- (run_exec_close): ditto.
- (run_exec_open): ditto.
- (run_exec_dup2_child): ditto.
- (run_exec_pgroup): ditto.
- (run_exec_rlimit): ditto.
- (rb_run_exec_options): ditto.
- (rb_exec): ditto.
- (rb_exec_atfork): ditto.
- (rb_spawn_internal): ditto.
- (rb_spawn): ditto.
- (rb_f_system): follow arguments change.
- (proc_daemon): ditto.
- (rb_f_spawn): show details of error in child process on exception.
-
- * io.c (popen_exec): add error message arguments.
- (pipe_open): show details of error in child process on exception.
-
- * include/ruby/intern.h (rb_run_exec_options): add error message
- arguments.
- (rb_exec): ditto.
- (rb_fork): ditto.
- (rb_spawn): ditto.
-
- * ext/pty/pty.c (chfunc): add error message arguments.
-
-Tue Dec 23 20:28:28 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * io.c: rdoc for File::open and 1.9 feature in file modes.
-
- * transcode.c: rdoc for String#encode
-
-Tue Dec 23 19:51:24 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * win32/win32.c (rb_w32_spawn): deals with quoted commands.
-
-Tue Dec 23 18:44:21 2008 Tanaka Akira <akr@fsij.org>
-
- * strftime.c (rb_strftime): use locale insensitive functions for tr_TR
- locale.
-
-Tue Dec 23 17:38:03 2008 Tanaka Akira <akr@fsij.org>
-
- * lib/test/unit/assertions.rb (assert_equal): show small differences
- for Regexp and Float.
-
-Tue Dec 23 16:49:48 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/win32.c (rb_w32_spawn): support normal commands with arguments.
-
-Tue Dec 23 16:22:41 2008 Tanaka Akira <akr@fsij.org>
-
- * io.c (rb_io_inspect): show fd number if there is no pathname.
-
-Tue Dec 23 15:48:55 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * tool/file2lastrev.rb: shouldn't use single quote in shell's command
- line if you want to support Windows.
-
-Tue Dec 23 15:46:43 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * lib/mathn.rb: Math.sqrt(NaN) should be NaN. [ruby-dev:37537]
-
-Tue Dec 23 15:46:47 2008 Eric Hodel <drbrain@segment7.net>
- * gem_prelude.rb: Match full RubyGems behavior when a gem can't be
- found.
-
-Tue Dec 23 15:36:58 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * tool/file2lastrev.rb: detects vcs directory properly on building
- outside of srcdir. [ruby-dev:37555] [ruby-dev:37561]
-
-Tue Dec 23 15:30:02 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * io.c (pipe_open): need to initialize args.
-
-Tue Dec 23 14:18:14 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * include/ruby/st.h: need to include defines.h because LONG_LONG is
- defined there.
-
-Tue Dec 23 13:52:05 2008 Eric Hodel <drbrain@segment7.net>
-
- * lib/rdoc/parser/c.rb: Don't coalesce adjacent comment blocks.
- [bug#901]
-
-Tue Dec 23 12:00:00 2008 Tanaka Akira <akr@fsij.org>
-
- * io.c (pipe_close): fix coding style. [ruby-dev:37554]
-
-Tue Dec 23 08:10:05 2008 Eric Hodel <drbrain@segment7.net>
-
- * lib/rubygems/installer.rb: Fix documentation. [bug#827]
-
-Tue Dec 23 08:04:58 2008 Eric Hodel <drbrain@segment7.net>
-
- * gem_prelude.rb: Don't remove methods twice. [bug#555]
-
-Tue Dec 23 00:16:48 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * sprintf.c (rb_str_format): fix buffer overflow.
-
-Mon Dec 22 19:31:19 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * common.mk (revision.h): uses tool/file2lastrev.rb to support
- git-svn.
-
- * version.h: changed version string as
- `ruby 1.9.1 (2008-12-22 patchlevel-5000 trunk 20912)
- [i386-darwin9.6.0]'.
-
-Mon Dec 22 16:32:21 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * pack.c (pack_pack): encoding of packed string only from 'm',
- 'M', and 'u' should be US-ASCII. [ruby-dev:37284]
-
- * pack.c (pack_pack): encoding of packed string only from 'U'
- should be UTF-8. also upgrade US-ASCII strings to UTF-8.
-
-Mon Dec 22 15:56:49 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * Doxyfile.in: new file. Template of a configuration file.
- Introduces C-level API reference generation with Doxygen.
+Fri Feb 20 19:35:08 2009 Takeyuki FUJIOKA <xibbar@ruby-lang.org>
- * tool/file2lastrev.rb: wrapper script that abstracts subversion
- and git-svn.
+ * lib/cgi/session.rb: ignore session_id options fixed.[Bug #605]
- * tool/strip-rdoc.rb: filter for preventing doxygen from processing
- rdoc comments.
+Fri Feb 20 18:06:40 2009 James Edward Gray II <jeg2@ruby-lang.org>
- * configure.in: (Doxyfile): Doxyfile is generated together with
- Makefile.
- (PACKAGE): configuration $(PACKAGE) is necessary for $(docdir).
-
- * instruby.rb: adds a new install target 'capi'
-
- * common.mk (capi): new target that generates C API documents with
- Doxygen.
- (install-capi): new target.
- (pre-install-capi): ditto.
- (do-install-capi): ditto.
- (post-install-capi): ditto.
-
-Mon Dec 22 21:31:11 2008 Tanaka Akira <akr@fsij.org>
-
- * numeric.c (int_ord): Integer#ord implemented.
-
-Mon Dec 22 21:26:12 2008 Tanaka Akira <akr@fsij.org>
-
- * io.c (rb_io_s_pipe): IO.pipe can take a block.
- (pipe_close): new function.
-
-Mon Dec 22 21:08:54 2008 Tanaka Akira <akr@fsij.org>
-
- * lib/test/unit/assertions.rb (assert_nothing_raised): increment
- assertion count. [ruby-dev:37480]
-
-Mon Dec 22 19:10:44 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * thread_win32.c (Init_native_thread): need to call
- ruby_thread_set_native() here.
-
-Mon Dec 22 18:00:36 2008 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tk/tcltklib.c: fix wrong flag value.
-
-Mon Dec 22 15:15:58 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/net/protocol.rb (Net::BufferedIO#rbuf_fill): avoid calling
- read_nonblock in rescue. use retry instead.
-
-Mon Dec 22 14:35:59 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * string.c (rb_external_str_new_with_enc): set ASCII-8BIT if
- encoding is US-ASCII and string contains 8bit characters.
-
-Mon Dec 22 12:26:18 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * cygwin/GNUmakefile.in (rubydll.def), win32/mkexports.rb
- (Exports#exports): added VERSION.
-
-Mon Dec 22 12:25:09 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * missing/vsnprintf.c (BSD_vfprintf): fix for test_sprintf_comb.rb, by
- wanabe in [ruby-dev:36935].
-
-Mon Dec 22 12:05:14 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in (mingw): no longer uses snprintf and vsnprintf of
- msvcrt. [Bug#6]
-
- * win32/win32.c (rb_w32_vsnprintf, rb_w32_snprintf): removed.
-
- * win32/Makefile.sub (config.h): vsnprintf exists in VC7 or later.
-
- * win32/mkexports.rb (Exports#initialize): aliases
- rb_w32_vsnprintf and rb_w32_snprintf for binary compatibility.
-
- * sprintf.c (rb_str_format): uses snprintf instead of sprintf.
-
- * numeric.c (flo_to_s, rb_num2long, rb_num2ll): ditto.
-
-Mon Dec 22 10:59:31 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * string.c (rb_str_upto): should return enumerator if called
- without block. [ruby-dev:37526]
-
-Mon Dec 22 09:54:43 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * parse.y (gettable_gen): the encoding of __FILE__ should be
- rb_filesystem_encoding(). [ruby-list:45733]
-
- * parse.y (gettable_gen): __FILE__ should be ASCII-8BIT when
- filesystem encoding is US-ASCII and __FILE__ contains non 7bit
- characters.
-
-Mon Dec 22 02:54:56 2008 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tk/lib/tk.rb: temporary patch for trouble on TkAqua (> Tk8.4.9).
-
- * ext/tk/sample/demos-jp/widget: set encoding to a demo-code string to
- avoid garbled text on the Code Window.
-
-Sun Dec 21 14:55:18 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/optparse.rb (SPLAT_PROC): splat values by hand.
-
-Sun Dec 21 13:50:37 2008 TAKAO Kouji <kouji@takao7.net>
-
- * test/readline/test_readline.rb
- (TestReadline#test_some_characters_methods): checked encoding.
-
-Sun Dec 21 12:23:16 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/optparse.rb (SPLAT_PROC): fix for regexp. [ruby-dev:37514]
-
-Sun Dec 21 10:43:10 2008 TAKANO Mitsuhiro (takano32) <tak@no32.tk>
-
- * sample/test.rb: rescue exception.
-
-Sat Dec 20 18:28:26 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * dln.c (dln_find_1): supplements an extension for executable
- files on DOSish platforms.
-
- * io.c (pipe_open): use rb_w32_aspawn() for array form.
-
- * win32/win32.c (rb_w32_pipe_exec): no longer used.
-
- * win32/win32.c (rb_w32_spawn, rb_w32_aspawn): deals with batch
- files and commands with extensions. [ruby-core:20695]
-
- * win32/win32.c (has_redirection): supports environment variables
- references.
-
-Sat Dec 20 15:34:36 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/rake.rb (Rake::FileList#egrep): change open mode to "rb",
- i.e. default to binary. [ruby-dev:37385]
-
- * lib/rake.rb (Rake::FileList#egrep): allow specifying reading
- encoding, e.g. FileList['*.rb'].egrep(/require/, encoding:
- "ascii-8bit")
-
- * lib/rake.rb (Rake::MultiTask): invoke_prerequisites should be
- private. a patch from okkez in [ruby-dev:37399]
-
-Sat Dec 20 10:59:16 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * lib/irb/locale.rb (IRB::Locale#initialize)
- initializes instance variables to suppress warnings.
- typo fix to ignore LoadError: [ruby-dev:37508]
-
-Fri Dec 19 17:01:35 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * io.c (rb_io_extract_encoding_option): "internal_encoding: nil"
- to specify no-transcoding. and other corner case fixed.
- [ruby-dev:37496]
-
- * hash.c (rb_hash_lookup2): new function to look-up hash with
- default value.
-
-Fri Dec 19 15:51:48 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ruby.c (process_options): get rid of warning on DOSISH.
-
-Fri Dec 19 07:45:37 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * error.c (exc_equal): duck typing equal to make it transitive.
- [ruby-dev:34808]
-
-Thu Dec 18 19:31:54 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * lib/irb/init.rb (IRB.opt_parse): (M17N) adds -U and -E as command
- line options. [ruby-dev:37161]. Fixes #711.
- improved long options.
-
- * lib/irb/init.rb (IRB.set_encoding): new subroutine for IRB.opt_parse
-
- * lib/irb/input-method.rb (IRB::StdioInputMethod): (M17N) regards
- scripts that user types as encoded in the external_encoding.
-
- * lib/irb/input-method.rb (IRB::ReadlineInputMethod): ditto.
-
- * lib/irb/input-method.rb (IRB::FileInputMethod): (M17N) respects
- magic comment.
-
- * lib/irb/help.rb (IRB.print_usage): (M17N) respects magic comment
- in the resource file.
-
- * lib/irb/lc/help-message: adds -U and -E.
-
- * lib/irb/lc/ja/help-message: ditto. re-encoded from ISO-2022-JP into UTF-8.
-
- * lib/irb/lc/ja/encoding_aliases.rb: new file. provides Japanese specific
- character encoding name table for backward compatibility.
-
- * lib/irb/lc/ja/error.rb: re-encoded from ISO-2022-JP into UTF-8.
- magic comment.
-
- * lib/irb/locale.rb: integrated with Ruby 1.9's M17N support.
-
- * lib/irb/magic-file.rb: new file. utility to handle files with magic
- comment and opens in the correct encoding.
-
- * lib/irb/ruby-lex.rb (RubyLex#each_top_level_statement): recovers
- character encoding for a statement after it lexed so that irb can
- eval the statement in correct encoding.
-
- * lib/irb/src_encoding.rb: new file. utility.
-
-Thu Dec 18 21:12:28 2008 Takeyuki FUJIOKA <xibbar@ruby-lang.org>
-
- * lib/cgi/session.rb: fix bug for ignore session_id option.
- report from [ruby-core:18635], [Bug #572]
-
- * lib/cgi/core.rb: use Encoding#find when encoding set.
-
- * test/cgi/test_cgi_session.rb: test for session_id specified.
-
-Thu Dec 18 17:00:56 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * hash.c (rb_hash_aset): string key copying only happen if key is
- an exact instance of String, not a subclass. based on a patch
- from Mike Gold <mike.gold.4433 at gmail.com> in [ruby-talk:322667].
- [incompatible] [ruby-talk:322417]
-
-Thu Dec 18 16:48:12 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/optparse/version.rb: remove variable shadowing to stop
- warning. [ruby-core:20612]
-
- * lib/irb/completion.rb, lib/net/imap.rb, lib/prime.rb,
- lib/rinda/ring.rb, lib/racc/parser.rb,
- lib/shell/command-processor.rb, lib/yaml/yamlnode.rb: ditto.
-
- * lib/racc/parser.rb: remove space before parentheses.
-
- * lib/shell/command-processor.rb, lib/shell/process-controller.rb:
- use parentheses around arguments.
-
- * lib/irb/ext/change-ws.rb, lib/rexml/validation/relaxng.rb,
- lib/yaml/baseemitter.rb: indentation fix.
-
- * lib/matrix.rb: small cosmetic change.
-
-Thu Dec 18 08:15:04 2008 James Edward Gray II <jeg2@ruby-lang.org>
+ Merged 20854 from trunk.
* lib/xmlrpc/server.rb: Restricting method inspection to show only
non-inherited public methods. [ruby-core:20603]
- * lib/xmlrpc/server.rb: Fixing method inspection so it doesn't
+ * lib/xmlrpc/server.rb: Fixing method inspection so it doesn't
trigger XMLRPC::FaultException when used. [ruby-core:20604]
-Wed Dec 17 19:39:44 2008 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/socket.c (unix_recv_io): relax msg_controllen error
- check for x86_64-openbsd4.4.
-
-Wed Dec 17 19:37:30 2008 Tanaka Akira <akr@fsij.org>
-
- * ext/pty/extconf.rb: check util.h for OpenBSD.
-
- * ext/pty/pty.c: include util.h if available. fix variable name.
-
-Wed Dec 17 19:23:28 2008 Keiju Ishitsuka <keiju@ruby-lang.org>
-
- * lib/matrix.rb: shut up warning. [ruby-dev:37481] [Bug #899]
-
-Wed Dec 17 15:44:28 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * array.c (rb_ary_pop_m): use enum ary_take_pos_flags.
-
- * array.c (rb_ary_push_m): add modification check before actual
- operation. [ruby-dev:37440]
-
-Wed Dec 17 15:35:39 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * configure.in (OBJDUMP, OBJCOPY):
- *BSD's ports and MacPorts prefix GNU binutils with 'g'.
-
-Wed Dec 17 11:39:39 2008 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-
- * test/bigdecimal/test_bigdecimal.rb (TestBigDecimal#test_hash):
- shut up warning. see [ruby-dev:37437]
-
-Wed Dec 17 11:01:35 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * string.c (rb_str_hash): gets rid of collisions between different
- encoding strings. [ruby-core:20526]
-
-Wed Dec 17 09:50:19 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * test/ruby/test_metaclass.rb: removed codes for my debugging.
- sorry. [ruby-dev:37470]
-
-Tue Dec 16 22:55:11 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * bin/testrb: set $0.
-
-Tue Dec 16 22:42:16 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * lib/test/unit.rb (Test::Unit.setup_argv): sorry, fixed wrong commit.
-
-Tue Dec 16 22:15:17 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/minitest/unit.rb (MiniTest::Assertions#assert_instance_of):
- should assert by instance_of?, not ===. [ruby-dev:37458]
-
- * lib/minitest/unit.rb (MiniTest::Assertions#assert_instance_of):
- typo fixed.
-
-Tue Dec 16 21:59:29 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * lib/test/unit.rb (Test::Unit.setup_argv): ALT_SEPARATOR support.
-
-Tue Dec 16 21:59:02 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * ext/bigdecimal/bigdecimal.c (VpToString): reverted modification
- (that caused a bug) in r20359. [ruby-dev:37370]
-
- * ext/bigdecimal/bigdecimal.c (BigDecimal_limit): comment update.
- [ruby-dev:37465]
-
-Tue Dec 16 20:34:44 2008 Tanaka Akira <akr@fsij.org>
-
- * ext/pty/pty.c (getDevice): add nomesg argument.
- (get_device_once): add nomesg argument. chmod slave tty to 0600
- if nomesg. more error tests.
- (no_mesg): new function.
- (pty_open): make slave tty's mode 0600.
-
-Tue Dec 16 20:24:20 2008 Tadayoshi Funaba <tadf@dotrb.org>
-
- * lib/date/format.rb (_parse): m17n compliant.
-
-Tue Dec 16 19:48:18 2008 Tanaka Akira <akr@fsij.org>
-
- * ext/pty/extconf.rb: check posix_openpt.
-
- * ext/pty/pty.c (get_device_once): use posix_openpt if available.
-
-Tue Dec 16 19:43:53 2008 Tanaka Akira <akr@fsij.org>
-
- * re.c: use strlcpy for error messages.
-
-Tue Dec 16 16:41:51 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (stmt): returns dispatched result.
-
- * parse.y (primary): also in ripper, saves in_def before restoring.
-
-Tue Dec 16 12:30:56 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in (ac_cv_header_ucontext_h): do not use ucontext.h on Mac
- OS X 10.5 or later. merged from MacPorts.
-
- * configure.in (ac_cv_func_daemon): daemon(3) is deprecated on Mac OS
- X 10.5 or later.
-
-Tue Dec 16 11:37:07 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * ruby.c (set_arg0): use strlcpy() instead of strncpy().
-
- * load.c (rb_feature_p): ditto.
-
- * dln.c (dln_load): ditto.
-
-Tue Dec 16 09:14:28 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * parse.y (block_call): block should not be given to yield.
- [ruby-core:20583]
-
-Mon Dec 15 23:48:39 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * thread.c (sleep_timeval): cast tv_usec to long to shut up
- warnings on OSX. [ruby-dev:37449]
-
-Mon Dec 15 23:34:04 2008 Tanaka Akira <akr@fsij.org>
-
- * ext/pty/pty.c (pty_open): set FMODE_SYNC and FMODE_DUPLEX.
-
-Mon Dec 15 23:29:49 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * ruby.c (process_options): revive global sub, gsub, chop, chomp
- only when auto looping options (-p/-n) is specified.
- [ruby-core:20570]
-
-Mon Dec 15 22:48:11 2008 Tanaka Akira <akr@fsij.org>
-
- * ext/pty/pty.c (pty_open): new method PTY.open.
-
-Mon Dec 15 21:24:01 2008 Tanaka Akira <akr@fsij.org>
-
- * ext/pty/pty.c (get_device_once): use DEVICELEN instead of
- sizeof SlaveName.
-
-Mon Dec 15 21:01:46 2008 Tanaka Akira <akr@fsij.org>
-
- * ext/pty/pty.c (chfunc): make it static.
-
-Mon Dec 15 20:59:10 2008 Tanaka Akira <akr@fsij.org>
-
- * ext/pty/pty.c (child_info): add slavename.
- (chfunc): use slavename.
- (establishShell): set slavename.
-
-Mon Dec 15 20:16:46 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * common.mk (EXTMK_ARGS): shouldn't use ``\"'' because cmd.exe eat
- ''\'' in such quotes.
-
-Mon Dec 15 19:07:31 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/Makefile.sub (config.h): define CANONICALIZATION_FOR_MATHN
- to follow r20683.
-
-Mon Dec 15 18:12:34 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/rake/packagetask.rb (Rake::PackageTask): small document
- update from okkez in [ruby-dev:37443]
-
-Mon Dec 15 16:28:32 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * vm_insnhelper.c (vm_callee_setup_arg_complex): uses cfp from
- blockptr instead of the current cfp. [ruby-core:20544]
-
-Mon Dec 15 14:56:59 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
+Fri Feb 20 01:41:08 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
- * test/ruby/test_metaclass.rb: new test case for metaclass hierarchy.
+ * lib/sync.rb (Sync_m#sync_try_lock): wrong variable name fixed.
+ a patch from [ruby-core:20561]
- * class.c (make_metametaclass): new function. extracted from
- rb_make_metaclass.
+ * lib/sync.rb (Sync_m::Err.Fail): turn off Thread.critical before
+ exit.
- * class.c (rb_make_metaclass): uses make_metametaclass when called for a
- metaclass.
-
- * class.c (rb_singleton_class): creates a meta^(n+2)-class in
- addition to a meta^(n+1)-class when called for a meta^(n)-class.
- This is because the returned meta^(n+1) class must acts as an instance of
- Class, metaclass of Class, ..., meta^(n+1)-class of Class,
- Module, metaclass of Module, ..., meta^(n+1)-class of Module,
- Object, metaclass of Object, ..., meta^(n+2)-class of Object,
- BasicObject, metaclass of BasicObject, ..., meta^(n+2)-class of
- and BasicObject even when Class, Module, Object or BasicObject has
- not have its meta^(i)-class yet.
-
-Mon Dec 15 15:13:22 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * id.h, template/id.h.tmpl (ruby_method_ids): sees YYTOKENTYPE too.
- [ruby-dev:37436]
-
-Mon Dec 15 15:02:24 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * common.mk (EXTMK_ARGS): needs MINIRUBY for cross-compile.
- [ruby-core:20131]
-
-Mon Dec 15 14:39:37 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * vm_eval.c (vm_call0): NODE_ZSUPER supported. [ruby-core:20480]
-
- * vm_eval.c (vm_call_super): uses method_missing().
-
- * vm_eval.c (method_missing): get rid of too large alloca.
-
- * vm_eval.c (rb_call0, method_missing): uses idMethodMissing.
-
- * vm_method.c (rb_add_method, remove_method, rb_undef): uses
- id__send__.
-
- * vm_method.c (Init_eval_method): removed IDs which are defined as
- immediate values.
-
-Mon Dec 15 11:35:27 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * vm.c (vm_backtrace): defaults to script name for C functions.
-
-Mon Dec 15 11:32:18 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ruby.c (rubylib_mangled_path, rubylib_mangled_path2): cannot use
- locale encoding before load path is initialized
-
- * ruby.c (ruby_init_loadpath_safe): ditto.
-
- * ruby.c (process_options): loads encdb so that encodings can be
- loaded, then associates script name and load paths with the
- locale encoding.
-
-Mon Dec 15 10:00:36 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * common.mk (btest-ruby): use RUNRUBY instead of MINIRUBY to load the
- shared library. [Bug #849]
-
-Sun Dec 14 22:31:19 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * bignum.c (bigmul1_karatsuba): remove temporal bignum.
-
- * bignum.c (bigsqr): call bigmul0(x, x) because it is faster than the
- original bigsqr at this point.
-
- * bignum.c (rb_big_pow): a value returned from bigsqr is already
- truncated.
-
-Sun Dec 14 21:13:02 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * bignum.c (bigmul1_karatsuba): fix comment and refactoring.
-
-Sun Dec 14 14:53:41 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * bignum.c (bigmul1_balance, bigmul1_karatsuba): remove all
- rb_gc_force_recycle which causes memory leak.
-
-Sun Dec 14 14:26:11 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * spec/README: directory structure changed
-
-Sun Dec 14 09:14:37 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * reverts r20713.
-
-Sun Dec 14 12:51:48 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * bignum.c (rb_big_mul): faster multiplication by Karatsuba method and
- twice faster square than normal multiplication. [ruby-dev:37392]
-
- * random.c (rb_rand_internal): used by Bignum#*.
-
- * test/ruby/test_bignum.rb: add some tests for above.
-Sun Dec 14 01:35:48 2008 Tanaka Akira <akr@fsij.org>
-
- * process.c (forked_child): new variable.
- (before_exec): don't call rb_thread_stop_timer_thread if
- forked_child.
- (after_exec): reset forked_child after rb_thread_start_timer_thread.
- (rb_fork): set forked_child just after fork in child.
-
- * ext/pty/pty.c (chfunc): extracted from establishShell.
- (establishShell): use rb_fork.
-
- [ruby-dev:37418]
-
-Sat Dec 13 22:17:30 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * common.mk (help): describes more targets.
- based on a patch by Michael Klishin. [ruby-core:20523].
-
-Sat Dec 13 18:34:43 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * string.c (sym_printable): wrong condition for string iteration.
-
-Sat Dec 13 16:04:48 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * encoding.c (default_external): endless recursion during
- loading a locale encoding on some locale.
- fixed by Nobuyoshi Nakada.
-
-Sat Dec 13 15:55:37 2008 TAKAO Kouji <kouji@takao7.net>
-
- * ruby.c (process_options): fixed default_internal is nil.
- (closes #862)
-
-Sat Dec 13 15:52:27 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * string.c (sym_equal): remove documentation error "Otherwise,
- compares them as strings". [ruby-dev:37398]
-
- * string.c (sym_inspect): quote if symbol contains non-printable
- characters. [ruby-dev:37398]
-
-Sat Dec 13 14:24:38 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * test/ruby/enc/test_utf16.rb: feature changed in r20626.
- follows it.
-
-Sat Dec 13 13:41:44 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * test/ruby/test_m17n_comb.rb: feature changed in r20626.
- follows it.
-
-Sat Dec 13 13:03:20 2008 Tadayoshi Funaba <tadf@dotrb.org>
-
- * complex.c: use rb_usascii_str_new2 instead of rb_str_new2.
-
- * rational.c: ditto.
-
-Sat Dec 13 12:48:57 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * test/ruby/test_m17n.rb: feature changed in r20626.
- follows it.
-
-Sat Dec 13 12:38:16 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * lib/minitest/test.rb (MinTest::Unit#location):
- skips user-defined assertions as MiniTest's.
- e.g. for test/ruby/test_m17n.rb.
-
-Sat Dec 13 09:17:33 2008 Ryan Davis <ryand-ruby@zenspider.com>
-
- * lib/minitest/*.rb: Imported minitest 1.3.1 r4503.
- * test/minitest/test_mini_test.rb: ditto.
- * lib/miniunit/autorun.rb: added (as part of r4503).
-
-Sat Dec 13 08:35:14 2008 Tadayoshi Funaba <tadf@dotrb.org>
-
- * complex.c (nucomp_canonicalization): renamed.
-
- * ext/math/complex.c: followed the above change.
-
- * rational.c (nurat_canonicalization): renamed.
-
- * ext/math/rational.c: followed the above change.
-
- * configure.in: defines a new macro.
-
-Sat Dec 13 01:10:03 2008 TAKAO Kouji <kouji@takao7.net>
-
- * ext/readline/readline.c
- (readline_s_get_completion_append_character): uses locale
- encoding but not ASCII-8BIT.
-
-Fri Dec 12 22:12:46 2008 Tadayoshi Funaba <tadf@dotrb.org>
-
- * complex.c, rational.c: do not use RUBY_VERSION_CODE.
-
-Fri Dec 12 21:41:36 2008 TAKAO Kouji <kouji@takao7.net>
-
- * ext/readline/readline.c: r20662 reverted.
-
-Fri Dec 12 19:29:07 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * encoding.c (rb_enc_set_default_external): default_internal can be
- nil, but default_external cannot.
-
- * encoding.c (rb_set_default_internal): adds rdoc.
-
- * encoding.c (enc_find): ditto.
-
-Fri Dec 12 19:24:47 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * common.mk (run, runruby, parse, gdb, gdb-ruby): you can also run
- other scripts than $(srcdir)/test.rb.
-
-Fri Dec 12 19:13:43 2008 TAKAO Kouji <kouji@takao7.net>
-
- * ext/readline/readline.c (readline_readline): changed the message
- of IOError to 'closed stdin' from 'stdin closed' if stdin was
- closed.
-
-Fri Dec 12 19:00:49 2008 TAKAO Kouji <kouji@takao7.net>
-
- * ext/readline/readline.c: used the ExportStringValue macro
- instead of the OutputStringValue macro. removed the
- OutputStringValue macro.
-
-Fri Dec 12 16:23:18 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (yycompile0): ruby_eval_tree_begin is always 0 when
- ruby_eval_tree is 0.
-
-Fri Dec 12 14:09:55 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * encoding.c (enc_get_default_encoding): removed.
- Generalizing rb_default_{external,internal}_encoding seems to be
- difficult.
- default_external cannot be NULL even before detected. [ruby-dev:37390]
-
- * encoding.c (rb_default_external_encoding): has its own
- implementation again.
-
- * encoding.c (rb_default_internal_encoding): ditto.
-
- * gem_prelude.rb: added notice.
-
- * ruby.c (rubylib_mangled_path, rubylib_mangled_path2): uses locale
- encoding but not ASCII-8BIT.
-
- * ruby.c (process_options): refers less to default_external.
-
-Fri Dec 12 11:00:52 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * load.c (rb_feature_p): load path must be expanded.
- [ruby-dev:37388]
-
-Fri Dec 12 10:28:08 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in (rb_version): greps only the line that defines version.
-
- * version.h (RUBY_VERSION_CODE, RUBY_RELEASE_CODE): removed.
-
-Fri Dec 12 10:20:55 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * complex.c, rational.c: do not use RUBY_VERSION_CODE.
-
-Fri Dec 12 10:19:21 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * string.c (rb_string_value_ptr, rb_to_id): do not use a side
- effect expression in RSTRING_PTR.
-
- * string.c (rb_str_split_m): simplified the argument of
- RSTRING_LEN.
-
-Thu Dec 11 23:48:00 2008 Tadayoshi Funaba <tadf@dotrb.org>
-
- * lib/cmath.rb (sqrt): should pass nan to the original method.
-
-Thu Dec 11 21:04:04 2008 Kouhei Sutou <kou@cozmixng.org>
-
- * lib/rss/maker.rb, lib/rss/maker/0.9.rb, lib/rss/maker/base.rb:
- RSS::Maker.[] returns a maker class corresponds to passed version.
-
- * test/rss/test_maker_*.rb: add tests for RSS::Maker.[].
-
-Thu Dec 11 20:05:17 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * encoding.c (rb_enc_aliases_enc_i): skips default internal.
-
-Thu Dec 11 19:31:45 2008 Tanaka Akira <akr@fsij.org>
-
- * lib/test/unit/assertions.rb: extracted from lib/test/unit.rb.
- lib/test/unit/testcase.rb: ditto.
- at asakusa.rb. [ruby-core:20014]
-
-Thu Dec 11 19:23:09 2008 Tanaka Akira <akr@fsij.org>
-
- * test/ruby/test_io.rb (test_dup_many): extracted from test_dup.
- test in ruby subprocess. at asakusa.rb. [ruby-dev:35648]
-
-Thu Dec 11 19:16:30 2008 Tanaka Akira <akr@fsij.org>
-
- * lib/pathname.rb (Pathname#=~): undefed. at asakusa.rb.
- [ruby-core:19690]
-
-Thu Dec 11 13:09:01 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * re.c (reg_enc_error): raise EncodingCompatibilityError for
- encoding incompatibility. [ruby-core:18600]
-
- * re.c (rb_reg_prepare_enc): more consistent error message.
- [ruby-core:18611]
-
-Thu Dec 11 13:36:18 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * encoding.c (enc_set_default_encoding): allowed to set default
- encoding.
-
- * encoding.c (rb_locale_encoding): removed Encoding::LOCALE.
-
- * encoding.c (rb_enc_set_default_external): ditto.
-
- * encoding.c (rb_enc_set_default_internal): ditto.
-
- * encoding.c (rb_enc_set_default_internal): defines internal
- encoding as nil.
-
-Thu Dec 11 11:11:03 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * include/ruby/st.h (size_t): needs stddef.h or stdlib.h.
- [ruby-core:20339]
-
-Thu Dec 11 10:25:25 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * test/ruby/test_bignum.rb (TestBignum#test_convert): remove
- platform dependent call of Process.wait. coverage should be
- accomplished by other method. [ruby-dev:36062]
-
-Thu Dec 11 10:18:35 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/rexml/document.rb (REXML::Document#write): require
- rexml/formatters/transitive if transitive flag is on. a patch
- from akira yamada in [ruby-dev:36230]. fix #553
-
- * lib/rexml/element.rb (REXML::Element#write): ditto.
-
- * lib/rexml/formatters/transitive.rb (REXML::Formatters::Transitive#write_element):
- add hack for IE. [ruby-dev:36230]
-
-Thu Dec 11 02:37:22 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * math.c (domain_check): should not raise EDOM exception for NaN
- value if operand is also NaN. affects acos, asin, acosh, atanh,
- log, log2, log10, sqrt, gamma, lgamma. [ruby-dev:37357]
-
-Thu Dec 11 02:23:51 2008 Tanaka Akira <akr@fsij.org>
-
- * lib/open3.rb (Open3.pipeline_start): return an array of threads if a
- block is not given.
-
-Thu Dec 11 01:48:00 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * ext/bigdecimal/bigdecimal.c (BigDecimal_round): should be round
- to integer. [ruby-dev:37355]
-
- * ext/bigdecimal/bigdecimal.c (BigDecimal_divmod): division should
- be integer. [incompatible] [ruby-dev:37355]
-
-Thu Dec 11 01:21:58 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * thread.c (rb_mutex_unlock): shut up warning. a patch from
- Kazuhiro NISHIYAMA in [ruby-dev:37345]. fix #846
-
-Wed Dec 10 23:58:56 2008 Tadayoshi Funaba <tadf@dotrb.org>
-
- * complex.c: avoided warnings on cpp. [ruby-dev:37344]
-
- * rational.c: ditto.
-
-Wed Dec 10 21:32:02 2008 Kouhei Sutou <kou@cozmixng.org>
-
- * lib/rss/maker.rb (RSS::Maker.[]): add.
- Suggested by Akinori MUSHA. Thanks!!! [ruby-dev:37210]
-
-Wed Dec 10 12:56:32 2008 Akinori MUSHA <knu@iDaemons.org>
-
- * enumerator.c (enumerator_rewind): If the enclosed object
- responds to a "rewind" method, call it; cf. [ruby-dev:37268]
-
-Wed Dec 10 12:46:52 2008 Akinori MUSHA <knu@iDaemons.org>
-
- * enumerator.c (enumerator_next): Fix a typo: s/rewinded/rewound/.
-
- * lib/prime.rb (Prime::OldCompatibility#each): Ditto.
-
-Wed Dec 10 11:25:53 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * re.c (rb_reg_initialize): raise RegexpError when encoding
- is dummy encoding. [ruby-dev:37091]
-
-Wed Dec 10 01:28:16 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * common.mk (win32.obj): depend on headers.
-
-Tue Dec 9 18:35:35 2008 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * enc/trans/single_byte.trans, cp850-tbl.rb, cp852-tbl.rb,
- cp855-tbl.rb, koi8-r-tbl.rb, koi8-u-tbl.rb, tis-620-tbl.rb:
- new single-byte transcodings (from Yoshihiro Kambayashi)
-
- * test/ruby/test_transcode.rb: added tests for the above
- (from Yoshihiro Kambayashi), small cosmetic fixes
-
-Tue Dec 9 13:33:53 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * compile.c (iseq_compile_each), gc.c (assign_heap_slot),
- (gc_mark_children), parse.y (vtable_alloc, vtable_free, vtable_add),
- proc.c (proc_to_s), thread.c (terminate_i, rb_thread_terminate_all),
- (thread_start_func_2, blocking_region_begin, blocking_region_end),
- (rb_thread_kill), thread_pthread.c (native_thread_create),
- (ubf_pthread_cond_signal), vm.c (check_env, thread_free), vm_dump.c
- (vm_env_dump_raw, vm_stack_dump_each, vm_thread_dump_state),
- (vm_call0): use void pointer for %p.
-
- * cont.c (fiber_status), template/insns.inc.tmpl (ruby_vminsn_type),
- vm_insnhelper.h (BOP): ISO C forbids comma at end of enumerator
- list.
-
- * vm_insnhelper.c (check_cfunc): use function pointer.
-
-Tue Dec 9 13:23:55 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * ext/curses/curses.c (curses_use_default_colors): add new
- method. a patch from Giancarlo F Bellido
- <support at coaxialhost.com> in [ruby-core:20434].
-
- * ext/curses/curses.c (curses_tabsize_set): ditto.
-
- * ext/curses/curses.c (curses_tabsize_get): ditto.
-
-Tue Dec 9 12:08:47 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * .gdbinit (rp): fixed typo for T_STRUCT.
-
-Tue Dec 9 11:50:46 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * pack.c (pack_pack): fixed [ruby-dev:37295].
- Array#pack always has returned an US-ASCII string when
- the given format ended with 'u', 'M' or 'm'.
-
-Tue Dec 9 03:21:37 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * mkconfig.rb: fix for continued lines. based on a patch from
- Marcus Rueckert <darix AT opensu.se> at [ruby-core:20420].
-
-Tue Dec 9 00:54:01 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * tool/make-snapshot (package): enc.mk in snapshot is dummy and should
- not deal with objects. [ruby-core:20422]
-
-Tue Dec 9 00:17:50 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * enc/depend (clean-srcs): split out from clean.
-
-Mon Dec 8 23:34:18 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
+Thu Feb 19 18:02:10 2009 Yuki Sonoda (Yugui) <yugui@yugui.jp>
* pack.c (pack_pack): fixed odd act of 'm*', 'M*', and 'P*'.
just ignores '*' in these cases.
[ruby-dev:37289]
-Mon Dec 8 18:31:41 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Feb 19 17:26:11 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
* pack.c (pack_pack): fixed length for odd length string.
[ruby-dev:37283]
-Mon Dec 8 11:28:14 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ruby.c (proc_options): added version, copyright, usage, yydebug,
- syntax to --dump option.
-
-Mon Dec 8 11:15:45 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ruby.c (proc_options): source-encoding option.
-
-Mon Dec 8 10:32:33 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ruby.c (set_option_encoding_once): dry.
-
- * ruby.c (proc_options): checks extra argument for -E/--encoding.
-
-Sun Dec 7 23:47:37 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in (LIBPATHFLAG): use numbered specifier if RPATHFLAG
- is set. [ruby-talk:322136]
-
-Sun Dec 7 23:17:33 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * Makefile.in (LIBRUBY_SO): localizes non-public symbols.
-
- * configure.in (OBJDUMP, OBJCOPY): for dealing with binary files.
-
-Sun Dec 7 17:44:06 2008 Tanaka Akira <akr@fsij.org>
-
- * lib/open3.rb (Open3.capture3): renamed from Open3.poutput3.
- (Open3.capture2): renamed from Open3.poutput2.
- (Open3.capture2e): renamed from Open3.poutput2e.
-
-Sun Dec 7 11:48:04 2008 Tanaka Akira <akr@fsij.org>
-
- * lib/open3.rb (Open3.poutput3): :binmode option implemented.
- (Open3.poutput2): ditto.
- (Open3.poutput2e): ditto.
-
-Sat Dec 6 18:33:16 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * tool/make-snapshot (package): added RM and CP. [ruby-dev:37288]
-
-Sat Dec 6 17:51:35 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * pack.c (pack_pack): 'u0' is not special differently from 'm0'.
-
-Sat Dec 6 14:35:06 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * pack.c (pack_pack): set US-ASCII and CODERANGE_7BIT
- when quoted-printable ('M') and base64 ('m').
- [ruby-dev:37284]
-
- * pack.c (pack_unpack): ditto.
-
-Fri Dec 5 22:56:24 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (rb_make_exception): single argument to raise may be
- string compatible object.
-
-Fri Dec 5 21:45:45 2008 Tadayoshi Funaba <tadf@dotrb.org>
-
- * rational.c (nurat_{to_s,inspect}): performance improvement.
-
-Fri Dec 5 21:42:44 2008 Tadayoshi Funaba <tadf@dotrb.org>
-
- * complex.c: inspect should not depend on to_s.
+Thu Feb 19 17:13:13 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Dec 5 21:18:31 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * eval.c (rb_yield_0): Qundef means no argument. [ruby-Bugs-22525]
- * ext/bigdecimal/bigdecimal.c (BigDecimal_truncate): return
- integer if no optional argument given. [incompatible]
+Wed Feb 18 22:28:00 2009 NAKAMURA Usaku <usa@ruby-lang.org>
- * ext/bigdecimal/bigdecimal.c (BigDecimal_floor): ditto.
+ * win32/win32.c (rb_w32_isatty): check whether fd is valid.
- * ext/bigdecimal/bigdecimal.c (BigDecimal_ceil): ditto.
-
-Fri Dec 5 19:06:04 2008 Tanaka Akira <akr@fsij.org>
-
- * lib/open3.rb (Open3.pipeline_start): new method.
- (Open3.pipeline): ditto.
-
-Fri Dec 5 18:55:25 2008 Tanaka Akira <akr@fsij.org>
-
- * process.c (run_exec_dup2): !save is false if Qnil.
-
-Fri Dec 5 18:07:32 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/win32.c (rb_w32_read, rb_w32_write, rb_w32_isatty): check
- whether fd is valid.
-
-Fri Dec 5 13:05:45 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * iseq.c (rb_iseq_parameters): proc arguments are always optional.
-
- * proc.c (get_proc_iseq, rb_proc_parameters): ditto.
-
-Fri Dec 5 12:38:48 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * compile.c (iseq_set_sequence): uses rb_compile_warning() for
- warning at compilation time.
-
-Fri Dec 5 12:35:46 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * compile.c (ruby_iseq_compile, ruby_iseq_translate_threaded_code),
- (ruby_insns_name_array, ruby_iseq_build_from_ary): prefixed with
- ruby_.
-
- * iseq.c (ruby_iseq_load, ruby_insn_make_insn_table): ditto.
-
-Fri Dec 5 10:01:43 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * string.c (rb_str_cmp_m): fixed rdoc. pointed out by <Thomas
- C. Mitchell AT gmail.com> at [ruby-talk:321967]
-
-Fri Dec 5 07:58:30 2008 Tanaka Akira <akr@fsij.org>
-
- * io.c (io_binwrite): arg.offset should be updated after retry.
-
-Fri Dec 5 03:29:17 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * load.c (rb_get_load_path): returns the load path without
- touching.
-
- * load.c (rb_feature_provided): new function to return the loading
- path in addition to rb_provided().
-
- * load.c (search_required): sets path if loading.
-
- * variable.c (autoload_provided): load paths are expanded to check
- if loading.
-
- * variable.c (autoload_node): keeps autoload mark while loading.
- [ruby-core:20235]
-
- * variable.c (rb_const_get_0): loops while autoload mark is set.
-
-Fri Dec 5 01:37:02 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/win32.c (rb_w32_read): ERROR_BROKEN_PIPE is not a real error
- at this point.
-
- * io.c (pipe_open): use rb_w32_spawn() instead of rb_w32_pipe_exec()
- to use our own redirection scheme.
-
-Fri Dec 5 01:35:08 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * string.c (sym_to_proc): use hidden object.
-
-Fri Dec 5 01:19:21 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * pack.c (pack_pack): propagate taint status from format string to
- result string.
-
-Fri Dec 5 00:34:10 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * process.c (run_exec_dup2): need to sort by reverted order when
- restoring fds.
-
-Fri Dec 5 00:17:18 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * string.c (sym_to_proc): caches Symbol procs, based on a patch from
- Shumpei Akai <admin AT flexfrank.net>. [ruby-dev:37265]
-
-Thu Dec 4 23:29:34 2008 NAKAMURA Usaku <usa@ruby-lang.org>
+Wed Feb 18 22:24:23 2009 NAKAMURA Usaku <usa@ruby-lang.org>
* win32/win32.c (waitpid): fix bug of checking child slot.
* win32/win32.c (FindChildSlotByHandle): new.
-Thu Dec 4 23:24:05 2008 Tanaka Akira <akr@fsij.org>
-
- * lib/open3.rb (Open3.poutput3): new method.
- (Open3.poutput2): ditto.
- (Open3.poutput2e): ditto.
-
-Thu Dec 4 23:02:13 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * spec/default.mspec: follows changes in rubyspec project.
- inherits configurations from ruby.1.9.mspec.
-
-Thu Dec 4 22:13:55 2008 Tadayoshi Funaba <tadf@dotrb.org>
-
- * test/ruby/test_complex.rb: added some tests.
-
- * test/ruby/test_rational.rb: ditto.
-
-Thu Dec 4 19:56:20 2008 Tanaka Akira <akr@fsij.org>
-
- * lib/open3.rb (Open3.popen3): simplified.
- (Open3.popen_run): extracted from Open3.popen3.
- (Open3.popen2): new method.
- (Open3.popen2e): new method.
- (Open3.pipeline_rw): new method.
- (Open3.pipeline_r): new method.
- (Open3.pipeline_w): new method.
- (Open3.pipeline_run): new private method.
-
-Thu Dec 4 19:16:28 2008 Tanaka Akira <akr@fsij.org>
-
- * process.c (check_exec_fds): resolve cascaded child fd reference.
-
-Thu Dec 4 16:58:12 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/rubygems/validator.rb (Gem#remove_leading_dot_dir): make
- this method private. a patch from okkez in [ruby-dev:37245]
-
-Thu Dec 4 16:19:18 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * ext/openssl/ossl_ssl.c (ossl_ssl_read_nonblock):
- OpenSSL::SSL::SSLSocket should implement read_nonblock. a patch
- from Aaron Patterson in [ruby-core:20277]. fix: #814 [ruby-core:20241]
-
-Thu Dec 4 16:16:09 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/gserver.rb: fixed type in sample code. a report from Oleg
- Puchinin.
-
-Thu Dec 4 14:54:32 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/rubygems/local_remote_options.rb (Gem#add_update_sources_option):
- little documentation fix. a patch from okkez. [ruby-dev:37271]
-
-Thu Dec 4 13:56:31 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * ext/curses/curses.c (window_getch): avoid ISPRINT() macro which
- has an issue with OpenSolaris. [ruby-core:20189]
-
- * ext/curses/curses.c (curses_getch): no ISPRINT(). [ruby-core:20294]
-
- * signal.c (ruby_signal): EINVAL from sigaction(2) is not a bug.
-
-Thu Dec 4 11:40:56 2008 Akinori MUSHA <knu@iDaemons.org>
-
- * enumerator.c (inspect_enumerator): Implement #inspect.
- [ruby-dev:37248]-[ruby-dev:37263]
-
-Thu Dec 4 11:38:40 2008 Akinori MUSHA <knu@iDaemons.org>
-
- * vm_method.c (rb_obj_respond_to): Remove a duplicated rdoc
- comment and fix a markup error.
-
-Thu Dec 4 06:04:16 2008 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tk/lib/tk/menu.rb: TkOptionMenubutton.new fails to treat
- 'parent' and 'variable' options on a Hash argument.
-
-Thu Dec 4 05:06:47 2008 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tk/lib/tk.rb: bug fix. use ::RubyVM instead of ::VM
- [ruby-list:45676]
-
- * ext/tk/tcltklib.c: update RELEASE_DATE
-
-Thu Dec 4 01:37:47 2008 Tadayoshi Funaba <tadf@dotrb.org>
-
- * complex.c (nurat_{to_s,inspect}): provides better representation
- for in-finite imag part.
-
-Thu Dec 4 01:22:41 2008 Tadayoshi Funaba <tadf@dotrb.org>
-
- * complex.c (f_signbit): NaN may be signed value.
-
-Wed Dec 3 23:59:32 2008 Tanaka Akira <akr@fsij.org>
-
- * process.c (EXEC_OPTION_DUP2_CHILD): defined.
- (check_exec_redirect_fd): check :in, :out and :err.
- (check_exec_redirect): check [:child, fd].
- (check_exec_fds): validate EXEC_OPTION_DUP2_CHILD array.
- (run_exec_dup2_child): new function.
- (rb_run_exec_options): call run_exec_dup2_child.
-
-Wed Dec 3 22:54:39 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (expr): keyword_not can continue across newline.
- [ruby-core:20252]
-
-Wed Dec 3 22:40:59 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * iseq.c (simple_default_value): returns simplest assignment only.
- [ruby-core:20237]
-
-Wed Dec 3 21:30:06 2008 Tanaka Akira <akr@fsij.org>
-
- * process.c (check_exec_redirect): accept :in, :out, :err as redirect
- target.
-
-Wed Dec 3 21:18:27 2008 Tadayoshi Funaba <tadf@dotrb.org>
-
- * test/ruby/test_rational.rb: revert.
-
-Wed Dec 3 14:48:52 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/tk/tcltklib.c (ip_ruby_cmd, ip_invoke_with_position): must
- not access internal union directly. [ruby-list:45670]
-
-Wed Dec 3 12:24:08 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * io.c (rb_io_getc, rb_io_readchar): documentation correction from
- Emiel van de Laar. [ruby-core:20212]
-
- * ext/stringio/stringio.c (strio_readchar): ditto.
-
-Wed Dec 3 09:26:29 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/rexml/xpath.rb (REXML::XPath.first): apply documentation
- patch from Ken Bloom in [ruby-core:20213].
-
- * lib/rexml/xpath.rb (REXML::XPath.each): ditto.
-
-Wed Dec 3 02:56:34 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * test/ruby/test_rational.rb: add a test.
-
-Wed Dec 3 02:53:24 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * test/ruby/test_range.rb: add a test.
-
-Wed Dec 3 02:26:07 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * test/ruby/test_string.rb: add some tests.
-
-Wed Dec 3 02:04:21 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * ext/pty/pty.c (Init_pty): fix typo.
-
-Tue Dec 2 19:22:13 2008 Tanaka Akira <akr@fsij.org>
-
- * lib/open3.rb (Open3.popen3): merge hash options if given.
-
-Tue Dec 2 15:31:42 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/net/protocol.rb (Net::BufferedIO#rbuf_fill): use
- read_nonblock instead of sysread wrapped by timeout to boost
- performance. a patch from Aaron Patterson in [ruby-core:20191].
- fix #806
-
-Mon Dec 1 23:23:52 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * set 1.9.1-p5000 into version number. [ruby-dev:36998]
-
-Mon Dec 1 15:48:47 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * signal.c (register_sigaltstack): no need to define on non-sigaltstack
- platform.
-
-Mon Dec 1 12:00:45 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * cont.c (rb_fiber_start): calls with exact argument number.
- [ruby-core:20088]
-
-Sun Nov 30 21:41:10 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * man/rake.1: new manual page
-
-Sun Nov 30 18:01:50 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * test/ruby/test_regexp.rb (TestRegexp#test_parse_curly_brace):
- now accepts quantifier on anchors again by r20391.
-
-Sat Nov 29 23:56:44 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * man/irb.1 (EXAMPLES): new section
-
-Sat Nov 29 19:19:32 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * regparse.c (is_invalid_quantifier_target): Perl and old Ruby
- accepts quantifier on anchors. [ruby-core:20161]
-
-Sat Nov 29 18:28:57 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * ext/socket/socket.c (sock_getaddrinfo): should have updated for
- Mac OS X. a patch from Shumpei Akai in [ruby-dev:37234]
-
-Sat Nov 29 00:18:30 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * cont.c (fiber_alloc): separate allocation and initialization.
- allow subclass to override #initialize. [ruby-core:20086]
-
-Fri Nov 28 18:31:21 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * ext/socket/socket.c (sock_s_getaddrinfo): refactored to remove
- code duplication regarding getaddrinfo.
-
-Fri Nov 28 17:52:26 2008 Keiju Ishitsuka <keiju@ruby-lang.org>
+Wed Feb 18 22:17:04 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
- * lib/forwardable.rb: should be usable def_single_delegator for
- Class and Module.
-
-Fri Nov 28 13:19:34 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * iseq.c (simple_default_value): extracts simplest default
- argument value.
-
- * iseq.c (rb_iseq_parameters): returns parameter list.
-
- * proc.c (get_proc_iseq, get_method_iseq): handles ifunc and
- bmethod.
-
- * proc.c (rb_proc_parameters, rb_method_parameters): added
- Proc#parameters and Method#parameters. [ruby-core:19759]
-
-Fri Nov 28 02:18:47 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * ext/bigdecimal/bigdecimal.c (BigDecimal_DoDivmod): bigdecimal
- division (including modulo) should raise ZeroDivisionError as
- integer division. [incompatible]
-
-Fri Nov 28 00:12:00 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * numeric.c (flodivmod): floating point division should raise
- ZeroDivisionError as integer division. [incompatible]
-
-Thu Nov 27 23:54:37 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * gc.c (gc_mark): still needs to check stack depth during GC.
-
- * gc.c (stack_check): ditto.
-
-Thu Nov 27 21:41:29 2008 Tadayoshi Funaba <tadf@dotrb.org>
-
- * strftime.c (rb_strftime): should add padding for %%.
-
-Thu Nov 27 16:32:53 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * signal.c (register_sigaltstack): stores alt stack for debug
- purpose.
-
-Thu Nov 27 16:12:33 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * signal.c (ruby_sigaction_t): added.
-
-Thu Nov 27 15:59:16 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * gc.c (ruby_stack_check): no check if using sigaltstack.
-
- * signal.c (ALT_STACK_SIZE): default minimum size is insufficient
- for method calls.
-
- * signal.c (sigsegv): handles stack overflow if possible.
-
- * thread.c (ruby_thread_stack_overflow): helper function to raise
- sysstack_error.
-
- * thread_pthread.c (ruby_stack_overflowed_p): checks for stack
- overflow.
-
-Thu Nov 27 10:40:52 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * ext/bigdecimal/bigdecimal.c (BigDecimal_div2): should return
- Integer for #div operation.
-
- * ext/bigdecimal/bigdecimal.c (BigDecimal_div2): should raise
- ZeroDivisionError if divisor is zero. [ruby-dev:37207]
-
-Wed Nov 26 23:15:47 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * strftime.c (STRFTIME): use rb_strftime() recursively, instead of
- platform's strftime().
-
-Wed Nov 26 22:46:23 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * ext/bigdecimal/bigdecimal.c (VpException): bigdecimal zero
- division should raise FloatDomainError if mode
- VP_EXCEPTION_ZERODIVIDE is set. [ruby-dev:37204]
+ * pack.c (pack_pack): propagate taint status from format string to
+ result string.
- * ext/bigdecimal/bigdecimal.c (BigDecimal_mode): should handle
- VP_EXCEPTION_ZERODIVIDE.
+Wed Feb 18 22:07:44 2009 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-Wed Nov 26 15:16:07 2008 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+ * ext/gdbm/gdbm.c: do not set members of RSTRING(str) directly.
+ [ruby-dev:37182]
* ext/gdbm/gdbm.c (rb_gdbm_nextkey): fix memory leak.
-Wed Nov 26 03:17:48 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * ext/bigdecimal/bigdecimal.c (BigDecimal_to_r): raise exception
- for nan/inf conversion. [ruby-dev:37187] fix #793
-
- * ext/bigdecimal/bigdecimal.c (BigDecimal_to_i): ditto.
-
-Wed Nov 26 03:00:59 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * ext/bigdecimal/bigdecimal.c (VpAlloc): avoid ALLOCA_N() to avoid
- segmentation fault caused by (insanely) long decimal values.
- [ruby-dev:37189] fix #794
-
- * ext/bigdecimal/bigdecimal.c (BigDecimal_dump, BigDecimal_to_i,
- BigDecimal_to_f, BigDecimal_to_s, BigDecimal_split,
- BigDecimal_inspect): ditto.
-
- * ext/bigdecimal/bigdecimal.c (VpToString): small performance
- improvement.
-
-Wed Nov 26 00:26:30 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * strftime.c (STRFTIME): should add padding for %[xXrR] etc.
- [ruby-dev:37185] fix: #792
-
-Tue Nov 25 16:26:12 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * array.c (rb_ary_times): taint (and untrust) status should be
- inherited by "ary * 0". [ruby-dev:37024]
-
-Tue Nov 25 15:54:07 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * strftime.c (rb_strftime): should not swallow incomplete
- formatter, e.g. "%E". [ruby-dev:37170] fix: #787
-
- * strftime.c (rb_strftime): clear flags before processing unknown
- formatter, e.g. "%i". [ruby-dev:37180]
-
-Tue Nov 25 10:35:29 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * strftime.c (rb_strftime): "%^P" should convert to upper case.
- [ruby-dev:37180]
-
-Tue Nov 25 07:51:18 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * strftime.c (FMT): use "%0d" formatter for zero padding, not "%.d".
- [ruby-dev:37168] fix: #768
-
- * strftime.c (rb_strftime): %s to use zero padding by default.
- [ruby-dev:37180]
-
-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.
-
-Tue Nov 25 03:26:04 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * numeric.c (num_step): treat infinite step specially.
- [ruby-dev:37157] fix: #781.
-
-Tue Nov 25 01:23:25 2008 Tadayoshi Funaba <tadf@dotrb.org>
-
- * lib/date/format.rb (strftime): ignores '_' flag for %[LN].
-
-Tue Nov 25 00:08:22 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * process.c (rb_fork): stops the timer thread during fork.
- [ruby-dev:37117]
-
- * thread.c (rb_thread_start_timer_thread): timer thread needs
- system_working to be set.
-
-Mon Nov 24 23:27:28 2008 Shugo Maeda <shugo@ruby-lang.org>
-
- * strftime.c (rb_strftime): The # flag should work with %a, %A, %b,
- %B, and %h. [ruby-dev:37162]
-
- * test/ruby/test_time.rb (test_strftime): ditto.
-
-Mon Nov 24 23:16:32 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * signal.c (register_sigaltstack): should not add external
- variable (with some cosmetic changes). [ruby-dev:37158]
-
-Mon Nov 24 22:57:25 2008 Shugo Maeda <shugo@ruby-lang.org>
-
- * strftime.c (rb_strftime): A width specifier for %t and %n should
- work. [ruby-dev:37160]
-
- * test/ruby/test_time.rb (test_strftime): ditto.
-
-Mon Nov 24 22:07:07 2008 Shugo Maeda <shugo@ruby-lang.org>
-
- * strftime.c (rb_strftime): The precision of %0N should be 9.
- [ruby-dev:37156]
-
- * test/ruby/test_time.rb (test_strftime): ditto.
-
-Mon Nov 24 21:38:23 2008 Shugo Maeda <shugo@ruby-lang.org>
-
- * strftime.c (rb_strftime): The default precision should be 1, not
- 0. [ruby-dev:37155]
-
- * test/ruby/test_time.rb (test_strftime): ditto.
-
-Mon Nov 24 19:53:47 2008 Tadayoshi Funaba <tadf@dotrb.org>
-
- * lib/date.rb (inspect): changed again.
-
-Mon Nov 24 18:35:00 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/time.rb: r20251 reverted. The patched behavior do not round
- trip. [ruby-core:19988]
-
-Sun Nov 23 16:04:05 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * signal.c (default_handler, Init_signal): compile error if
- USE_SIGALTSTACK is not defined.
-
-Sun Nov 23 00:04:14 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * signal.c (ALT_STACK_SIZE): 4KB is not enough on Mac OS X.
- Uses SIGSTKSZ.
-
-Sat Nov 22 21:29:54 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * test/ruby/test_method.rb (test_default_accessibility): test case for
- [ruby-dev:37124].
+Tue Feb 17 11:58:58 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat Nov 22 18:24:24 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * string.c (str_independent): no independent string points null_str.
+ [ruby-core:20082]
- * file.c (rb_file_world_writable_p): should return nil for non
- world-writable files.
+Mon Feb 16 23:30:24 2009 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-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:
+ * ext/tk/lib/tkextlib/blt.rb, ext/tk/lib/tkextlib/blt/vector.rb:
fix NameError bug.
-Sat Nov 22 03:41:22 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * ext/pty/pty.c (get_device_once): abandon asynchronous exception
- that might cause serious problem if a program terminated early.
- asynchronous exception is a very bad thing anyway. use
- Process.waitpid(pid) or PTY.check(pid) to poll program
- termination. if PTY.check is called with optional second
- argument being true, it raises an exception same as one from
- previous behavior. [incompatible] fix: [ruby-core:19583]
-
-Fri Nov 21 22:24:31 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * ext/curses/curses.c (curses_escdelay_set): support ESCDELAY. a
- patch from Giancarlo F Bellido <support at coaxialhost.com> in
- [ruby-core:19961].
-
-Fri Nov 21 22:17:15 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * ruby.c (usage): -W description updated. [ruby-core:19858]
-
-Fri Nov 21 21:50:54 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * signal.c (register_sigaltstack): use alternative stack for
- SIGSEGV to avoid uncaught stack overflow. based on a patch from
- Hiro Yoshioka <hyoshiok at miraclelinux.com> in [ruby-dev:37134].
- [ruby-dev:36993]
-
-Fri Nov 21 16:06:54 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * vm.c (thread_free): th->vm may be NULL when pthread_create
- failed for ENOMEM. [ruby-dev:37095]
-
-Thu Nov 20 07:33:15 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
+Mon Feb 16 23:08:22 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/logger.rb (Logger): should handle the case that cvs/svn do
- not expand $Id keyword. [ruby-core:19991]
+ * string.c (rb_str_s_alloc, rb_str_replace): use null_str as well as
+ rb_string_value so that extension libraries do not segfault.
+ [ruby-core:19971]
-Thu Nov 20 07:27:36 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * string.c (rb_str_replace): reduced unnecessary malloc and copy.
- * lib/minitest/unit.rb (MiniTest::Assertions#capture_io): adjust
- indentation to shut up warning. [ruby-core:19993]
-
-Wed Nov 19 17:48:05 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * ext/syck/rubyext.c (rb_syck_mktime): return DateTime for a value
- out of range of Time. [ruby-core:19919]
-
-Wed Nov 19 14:14:38 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * node.h (NOEX_MODFUNC): should be include NOEX_PRIVATE.
- [ruby-dev:37124]
-
-Wed Nov 19 03:01:04 2008 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+Mon Feb 16 22:45:41 2009 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
* test/rinda/test_rinda.rb: fixed fails occasionally [ruby-dev:37119].
thanks, shinichiro.h.
-Wed Nov 19 02:39:31 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * error.c (Init_syserr): moved function definition itself from
- template/known_errors.inc.tmpl.
-
-Wed Nov 19 01:10:52 2008 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+Mon Feb 16 22:36:37 2009 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
* lib/drb/drb.rb (DRbConn::alive?): fixed NoMethodError problem
from NaHi [ruby-dev:37110].
-Wed Nov 19 01:05:26 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * cont.c (cont_mark, cont_capture, cont_restore_1): speed up
- continuation by copying only valid YARV stack. [ruby-dev:37106]
-
-Wed Nov 19 00:03:13 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/time.rb: according to RFC2822, -0000 means local time, +0000
- means UTC. a patch from Chun Wang. [ruby-core:19578]
-
-Tue Nov 18 23:02:23 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * proc.c (proc_eq): equivalence check should not done by pointer
- comparison, but should be based on iseq contents. [ruby-dev:37101]
-
-Tue Nov 18 20:30:08 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
+Sun Feb 15 04:21:42 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
* lib/net/ftp.rb (Net::FTP#open_socket): SOCKSsocket is obsolete.
- a patch from Alan Johnson <alan.wayne.johnson at gmail.com> in
+ a patch from Alan Johnson <alan.wayne.johnson at gmail.com> in
[ruby-core:19982].
-Tue Nov 18 16:18:23 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Feb 13 19:18:42 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/logger.rb (ProgName): fixed for svn, based on a patch from
Nobuhiro IMAI at [ruby-dev:37108].
-Tue Nov 18 15:56:55 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
+Sun Feb 15 04:17:40 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
* lib/webrick/httprequest.rb (WEBrick::HTTPRequest#read_request_line):
- use possessive match for path retrieval to avoid huge recursion
+ use non-greedy match for path retrieval to avoid huge recursion
for insanely long path.
-Tue Nov 18 15:50:11 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * re.c (rb_reg_desc): re might be NULL.
-
- * regerror.c (onig_error_code_to_format): message updated.
-
-Tue Nov 18 09:42:11 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/optparse.rb (OptionParser::make_switch): makes default
- conversion to splat. [ruby-list:45645]
-
-Mon Nov 17 18:05:16 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * enc/depend (LIBS): fixed for disable-shared. [ruby-dev:37103]
-
-Mon Nov 17 11:12:24 2008 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
-
- * bin/erb: remove -K option.
-
-Mon Nov 17 02:19:03 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in (LIBRUBYARG_STATIC): fixed for --enable-rpath.
-
-Sat Nov 15 22:46:32 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * re.c (rb_reg_regsub): returns -1 unless ascii as well as
- rb_enc_ascget(). [ruby-dev:37097]
-
-Sat Nov 15 22:23:45 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in (LDSHARED): do not suppress debug info if higher debug
- level is given, on cygwin and mingw.
-
-Fri Nov 14 20:27:46 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * README.EXT, README.EXT.ja, vm_exec.c, vm_insnhelper.c: update
- filenames.
-
-Thu Nov 13 11:31:13 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * thread.c (rb_barrier_wait): gets rid of recursive deadlock.
+Fri Feb 13 19:04:54 2009 Keiju Ishitsuka <keiju@ruby-lang.org>
-Thu Nov 13 06:08:44 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * shell/command-processor.rb: undefined method `top_level_test' in
+ Shell#test. [ruby-list:45634]
- * thread.c (rb_barrier_{new,wait,release,destroy}): use Mutex so that
- circular requires fail with deadlock. [ruby-core:19821]
+Tue Feb 10 20:00:52 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Nov 12 07:16:01 2008 David Flanagan <david@think32>
+ * eval.c (load_lock): makes circular require deadlock.
+ [ruby-core:19821]
- * ruby.c (set_internal_encoding_once): fix typo in error string
+Tue Feb 10 19:40:58 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Nov 12 03:30:59 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * eval.c (rb_feature_p): returns found feature name if loading.
+ [ruby-core:19798]
- * include/ruby/intern.h (rb_{external,locale}_str_new_cstr): optimized
- versions for literal strings.
+ * eval.c (search_required): ditto.
-Wed Nov 12 03:28:41 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Feb 11 23:37:35 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
- * load.c (rb_require_safe): destroys barrier after successfully
- loaded, to get rid of loading same library again. [ruby-core:19798]
-
- * thread.c (rb_barrier_wait): can not wait destroyed barrier.
-
- * thread.c (rb_barrier_destroy): destroys barrier so that no longer
- waited.
-
-Tue Nov 11 23:02:27 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * man/ruby.1 (RUBYOPT): wrote which option can appear.
- (--yydebug): wrote "do not use".
- (--dump): wrote "do not use".
-
-Tue Nov 11 21:22:28 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/uri/generic.rb (URI::Generic#check_path): REL_PATH should a
- symbol. [ruby-core:19805]
-
-Tue Nov 11 20:49:29 2008 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-
- * configure.in: fix SEGV on Mac OS X 10.5.3 with pthread.
- a patch from Wataru Kimura in Bug #193 [ruby-core:17333].
-
-Tue Nov 11 20:39:27 2008 Tadayoshi Funaba <tadf@dotrb.org>
-
- * lib/date.rb (inspect): reverted the previous change.
+ * ext/bigdecimal/bigdecimal.c (VpMidRound): Round method bug
+ pointed by Ryan Platte fixed(Patch to the patch from "NATORI
+ Shin"). [ruby-talk:273360]
+ back ported from 1.9. fix [ruby-core:19791]
-Tue Nov 11 17:35:25 2008 NAKAMURA Usaku <usa@ruby-lang.org>
+Mon Feb 9 17:35:38 2009 NAKAMURA Usaku <usa@ruby-lang.org>
* win32/win32.c (rb_w32_accept): secure fd before accept because if
error causes in securing, cannot restore the state of accepted
socket.
fixed [ruby-core:19728]
-Tue Nov 11 14:40:40 2008 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * test/ruby/test_transcode.rb: unnecessary setup method
- (setup_really_needed?) removed
-
-Tue Nov 11 14:25:25 2008 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * enc/trans/single_byte.trans, macgreek-tbl.rb, macroman-tbl.rb,
- macromania-tbl.rb, macturkish-tbl.rb, macukraine-tbl.rb,
- ibm437-tbl.rb, ibm852-tbl.rb, ibm855-tbl.rb, ibm857-tbl.rb,
- ibm860-tbl.rb, ibm861-tbl.rb, ibm862-tbl.rb, ibm863-tbl.rb,
- ibm865-tbl.rb, ibm866-tbl.rb, ibm869-tbl.rb, ibm775-tbl.rb:
- new single-byte transcodings (from Yoshihiro Kambayashi)
-
- * test/ruby/test_transcode.rb: added tests for the above
- (from Yoshihiro Kambayashi)
-
-Tue Nov 11 13:20:23 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * ext/bigdecimal/bigdecimal.c (BigDecimal_to_r): moved from
- bigdecimal/util, converted into C. [ruby-dev:36805]
-
-Tue Nov 11 07:55:57 2008 Tadayoshi Funaba <tadf@dotrb.org>
-
- * lib/date.rb (inspect): changed the format.
-
-Mon Nov 10 17:34:50 2008 Akinori MUSHA <knu@iDaemons.org>
-
- * test/sdbm/test_sdbm.rb (TestSDBM#test_index): Reflect the method
- name change from #index to #key and remove a duplicated test
- method.
-
-Mon Nov 10 10:50:43 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/delegate.rb (Delegator.delegating_block): should not refer
- DelegateClass specific @delegate_dc_obj. a patch from Erik
- Hollensbe in [ruby-core:19671].
-
-Mon Nov 10 09:54:21 2008 NAKAMURA Usaku <usa@ruby-lang.org>
+Mon Feb 9 13:42:15 2009 NAKAMURA Usaku <usa@ruby-lang.org>
* win32/win32.c (ifs_open_socket): should retry without proto_buffer
if cannot find the suitable protocol. a patch from Heesob Park.
fixed [ruby-core:19713]
-Sun Nov 9 13:04:52 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * struct.c (rb_struct_initialize_m): avoid unnecessary array
- allocation.
-
-Sun Nov 9 04:10:19 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * vm_dump.c (control_frame_dump): suppresses finished method name.
-
-Sun Nov 9 00:30:52 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * thread_pthread.c (thread_timer): checks working flags again.
-
-Sun Nov 9 00:02:01 2008 Takeyuki FUJIOKA <xibbar@ruby-lang.org>
-
- * lib/cgi/session/pstore.rb: fix indentation.
-
-Sat Nov 8 23:47:45 2008 Takeyuki FUJIOKA <xibbar@ruby-lang.org>
-
- * lib/cgi/session.rb (FileStore): use marshalized data.
-
- * test/cgi/session_dir: add a session directory in test.
-
- * test/cgi/test_cgi_session.rb: add a test.
-
-Sat Nov 8 21:57:03 2008 Takeyuki FUJIOKA <xibbar@ruby-lang.org>
-
- * lib/cgi/session.rb: remove debug code.
-
-Sat Nov 8 21:33:53 2008 Takeyuki FUJIOKA <xibbar@ruby-lang.org>
-
- * lib/cgi/session.rb: fix indentation.
+Mon Feb 9 13:40:21 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
-Sat Nov 8 18:11:14 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * ext/stringio/stringio.c (strio_ungetc): should allow ungetc at
+ the top of the buffer. ref #701
- * lib/webrick/httpproxy.rb (WEBrick::HTTPProxyServer#do_CONNECT):
- use #bytesize instead of #size. a patch submitted from
- raspberry lemon in [ruby-core:18571].
+Thu Feb 5 09:38:48 2009 NARUSE, Yui <naruse@ruby-lang.org>
- * lib/webrick/httpauth/digestauth.rb, lib/webrick/httpproxy.rb,
- lib/webrick/httprequest.rb, lib/webrick/httpservlet/cgi_runner.rb,
- lib/webrick/httpservlet/abstract.rb, lib/webrick/httpresponse.rb,
- lib/webrick/httpservlet/cgihandler.rb, lib/webrick/utils.rb: ditto.
+ * ext/nkf/nkf-utf8/nkf.c (h_conv): can't guess UTF-8 input in
+ conversion. [ruby-list:45609]
-Sat Nov 8 17:31:41 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * ext/stringio/stringio.c (strio_ungetc): ungetc position should
- not be changed from 1.8. [ruby-core:19632]
-
-Sat Nov 8 17:15:08 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/optparse.rb (OptionParser#make_switch): 1.9 Symbols respond
- to :match. a patch from keith cascio, <keith at ucla.edu>.
- [ruby-core:19730]
-
-Sat Nov 8 12:10:15 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * ext/gdbm/gdbm.c (fgdbm_index): make #index warn like Hash.
- [ruby-dev:37039]
-
- * ext/sdbm/init.c (Init_sdbm): typo fixed. [ruby-dev:37039]
-
-Sat Nov 8 07:07:48 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * configure.in: detect stdio buffer pointers for uClibc. a patch
- from Brian Candler <B.Candler at pobox.com> in [ruby-core:12020].
- [ruby-core:19713]
-
-Sat Nov 8 06:51:42 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * ext/dbm/dbm.c (fdbm_index): make #index warn like Hash.
-
- * ext/dbm/dbm.c (fdbm_key): new method.
-
- * ext/sdbm/init.c: ditto.
-
-Sat Nov 8 06:20:42 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * ext/curses/curses.c: curses encoding should obey locale.
-
- * ext/curses/curses.c (curses_getch): 1.9 getch should return one
- character string for single byte string. wchar_t support may
- follow in the future.
-
-Sat Nov 8 05:46:50 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * include/ruby/io.h (rb_io_t): added write_lock to serialize.
- [ruby-core:19668]
-
- * gc.c (gc_mark_children): mark write_lock.
-
- * gc.c (rb_gc_call_finalizer_at_exit): Mutex also needs to be
- deferred.
-
- * io.c (io_fflush, io_binwrite, fptr_finalize): serializes writing.
-
-Sat Nov 8 05:31:25 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * safe.c (safe_setter): add warning for $SAFE=3.
-
-Sat Nov 8 01:48:07 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * thread_pthread.c (rb_thread_create_timer_thread): do not wait never
- coming signal if failed to create timer thread.
-
- * thread_pthread.c (native_cond_timedwait): returns error code.
-
- * thread_pthread.c (thread_timer): typo fixed.
-
-Sat Nov 8 01:14:16 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * thread_pthread.c (thread_timer, rb_thread_create_timer_thread):
- handshakes properly.
-
-Fri Nov 7 22:51:49 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * inits.c (rb_call_inits): do not repeat.
-
-Fri Nov 7 22:46:57 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * thread_pthread.c (thread_timer): initializes mutex each time.
-
-Fri Nov 7 21:23:02 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * thread_win32.c (thread_start_func_1): use already gotten stack info.
-
-Fri Nov 7 12:26:00 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/irb.rb (IRB::Irb#eval_input): remove extra @context.prompt_i.
- [ruby-core:19718]
-
-Fri Nov 7 11:55:30 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * nkf.c: update to r1.188. fixes for 16bit environment.
-
-Fri Nov 7 07:43:27 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * thread.c (thread_timer): pthread_cond_timedwait returns ETIMEDOUT
- when timed out.
-
-Fri Nov 7 07:32:55 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/yaml/rubytypes.rb: support Rational and Complex as 1.8
- does. a patch from Hiroshi Moriyama in [ruby-dev:36899].
-
-Fri Nov 7 07:12:06 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * thread_pthread.c (thread_timer): uses pthread_cond_timedwait always
- instead of pthread_kill.
-
-Fri Nov 7 06:58:59 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * string.c (Init_String): remove Symbol#===. [ruby-dev:37026]
-
-Fri Nov 7 04:02:22 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * thread.c (thread_timer): uses timedwait on cygwin.
-
-Fri Nov 7 02:00:12 2008 Shugo Maeda <shugo@ruby-lang.org>
+Thu Feb 5 09:03:21 2009 Shugo Maeda <shugo@ruby-lang.org>
* lib/rexml/entity.rb (unnormalized): do not call
document.record_entity_expansion if document is nil.
see <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=502535>.
- Thanks, Naohisa Goto.
+ Thanks, Naohisa Goto. backported from trunk.
* test/rexml/test_document.rb: ditto.
-Fri Nov 7 01:24:20 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * tool/make-snapshot: binary encoding spec is no longer needed in 1.9.
-
-Thu Nov 6 22:21:23 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * thread.c (rb_thread_stop_timer_thread): terminates timer thread
- immediately.
-
-Thu Nov 6 21:21:46 2008 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-
- * ext/win32ole/win32ole.c (fole_s_connect, fole_initialize,
- folevariant_initialize): check argument type of WIN32OLE.connect,
- WIN32OLE.new, WIN32OLE_VARIANT.new.
-
- * test/win32ole/test_win32ole.rb (test_s_new_exc, test_s_connect_exc):
- ditto.
-
- * test/win32ole/test_win32ole_variant.rb (test_s_new_exc): ditto.
-
- * test/win32ole/test_win32ole_method.rb: add assertion of
- WIN32OLE_METHOD.new.
-
-Tue Nov 4 13:08:01 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * lib/test/unit.rb (Test::Unit.setup_argv): now can specify ``-xname''
- instead of ``-x name''.
-
-Tue Nov 4 08:00:00 2008 TAKANO Mitsuhiro (takano32) <tak@no32.tk>
-
- * test/zlib/test_zlib.rb(test_readchar): compare in same type.
-
-Tue Nov 4 03:28:31 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Feb 5 08:55:24 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
* array.c (rb_ary_join): do not repeat self in a recursive array.
[ruby-dev:37019]
-Tue Nov 4 01:56:46 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * include/ruby/intern.h (rb_mutex_synchronize): fixed prototype.
-
- * thread.c (rb_mutex_synchronize): fixed function name.
-
-Mon Nov 3 16:32:54 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * missing.h: needs RUBY_EXTERN instead of extern for mswin.
-
-Mon Nov 3 13:01:13 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * array.c (rb_ary_take_first_or_last): renamed rb_ary_partial more
- appropriately.
- (ary_take_pos_flags): new enum. makes the fourth argument of
- rb_ary_take_first_or_last more descriptive.
- (rb_ary_partial): renamed rb_ary_partial0 more appropriately.
- takes a new parameter klass for what class to instantiate.
-
-Mon Nov 3 13:00:26 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * range.c (rb_range_beg_len): rb_raise takes C values as arguments.
- [BUG] ranges turned into other value in a message of RangeError.
-
-Mon Nov 3 00:36:44 2008 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-
- * test/win32ole/test_win32ole_event.rb: rename test class.
-
- * test/win32ole/test_win32ole_variant_outarg.rb: add in order
- to use ADO instead of Internet Explorer.
- remove test/win32ole/test_win32ole_variant_with_ie.rb.
-
- * test/win32ole/orig_data.csv: ditto.
-
-Sun Nov 2 23:08:08 2008 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-
- * test/win32ole/test_err_in_callback.rb: add teardown.
-
-Sun Nov 2 22:12:41 2008 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-
- * ext/win32ole/win32ole.c (ole_event_free): invoke IConnectionPoint::Unadvise
- before invoking IConnectionPoint::Release.
-
- * test/win32ole/test_win32ole_event.rb, test/win32ole/err_in_callback.rb,
- test/win32ole/test_err_in_callback.rb: Use ActiveX Data Object
- Library instead of InternetExplorer.
-
-Sun Nov 2 22:06:55 2008 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-
- * win32/Makefile.sub: add RUNRUBYOPT. [ruby-dev:37009]
-
-Sun Nov 2 16:41:52 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/zlib/zlib.c (Init_zlib): defines readbyte instead redefining
- readchar.
-
-Sat Nov 1 07:09:40 2008 Eric Hodel <drbrain@segment7.net>
-
- * gem_prelude.rb: Don't require rubygems/defaults.rb.
-
-Fri Oct 31 21:58:50 2008 Kouhei Sutou <kou@cozmixng.org>
-
- * lib/rss/converter.rb (RSS::Converter): use String#encode.
-
-Fri Oct 31 21:28:14 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * lib/webrick/httpauth/digestauth.rb
- (WEBrick::HTTPAuth::DigestAuth#initialize): fix typo.
-
-Fri Oct 31 18:51:42 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * test/ruby/test_array.rb (test_array_subclass): test for r20076.
-
-Fri Oct 31 18:42:19 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * array.c (ary_partial0): recovers the mistakenly changed feature at r19723.
- Array#[m,n] had returned an Array even for an instance of a
- subclass.
-
-Fri Oct 31 18:05:05 2008 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * enc/trans/single_byte.trans, maccroatioan-tbl.rb,
- maccyrillic-tbl.rb, maciceland-tbl.rb: new single-byte
- transcodings (from Yoshihiro Kambayashi)
-
- * test/ruby/test_transcode.rb: added tests for the above
- (from Yoshihiro Kambayashi)
-
-Fri Oct 31 12:51:25 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
+Wed Feb 4 14:26:58 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
* dir.c (dir_globs): need taint check. reported by steve
<oksteev at gmail.com>
-Fri Oct 31 12:42:45 2008 wanabe <s.wanabe@gmail.com>
-
- * array.c (rb_ary_decrement_share): fix to work recycling
- shared-array without the following. [ruby-dev:36991]
-
- * array.c (ary_make_substitution): don't recycle substitution array.
-
-Fri Oct 31 12:27:52 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * spec/default.mspec: supports that the build directory != srcdir.
-
-Fri Oct 31 11:35:38 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * encoding.c (rb_enc_set_default_internal): no alias "internal" if
- default internal is not set. [ruby-dev:37000]
-
-Fri Oct 31 08:16:14 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ruby.c (process_options): delays setting safe level.
- [ruby-dev:36997]
-
-Thu Oct 30 21:32:15 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * array.c (rb_ary_permutation): hide temporal array.
-
-Thu Oct 30 14:45:45 2008 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * enc/trans/single_byte.trans: refactoring to make it easier
- to add more transcodings (with Yoshihiro Kambayashi)
-
- * enc/trans/iso-8859-1-tbl.rb: new file to avoid having to
- treat ISO-8859-1 as special
-
-Thu Oct 30 14:10:46 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * pack.c (pack_pack): templates a, A, Z should propagate encoding
- of original strings. templates b, B, h, H brings ASCII-8BIT to
- the result.
-
-Thu Oct 30 10:34:20 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ruby.c (moreswitches): splits option string and passes arguments.
-
- * ruby.c (proc_options): checks if allowed in RUBYOPT.
-
- * ruby.c (process_options): allows long style options in RUBYOPT.
-
- * ruby.c (load_file_internal): ditto in shebang. [ruby-dev:36979]
-
-Thu Oct 30 09:31:45 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * encoding.c (rb_locale_encoding): makes an alias for locale.
- [ruby-dev:36976]
-
- * encoding.c (rb_enc_set_default_external): ditto for external.
-
- * encoding.c (rb_enc_set_default_internal): ditto for internal.
-
-Thu Oct 30 03:30:25 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * ruby.c (load_file_internal): should not set script encoding to
- ASCII-8BIT.
-
- * ruby.c (load_file_internal): do not auto convert scripts even
- when default_internal is set. [ruby-core:19579]
-
-Thu Oct 30 02:20:33 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * array.c (rb_ary_sort_bang): remove SEGV when replacing array with
- embedded one during sort. [ruby-dev:36983]
-
- * test/ruby/test_array.rb (test_sort!): add tests for above.
-
-Thu Oct 30 01:44:23 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * test/ruby/test_array.rb: add some tests.
-
-Thu Oct 30 01:32:15 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * array.c (rb_ary_splice): remove redundant check.
-
-Thu Oct 30 01:24:55 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * string.c (rb_str_cmp): fix condition which always returned true
- because ENCODING_GET returns unsigned long.
-
-Thu Oct 30 01:10:32 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * test/ruby/test_array.rb (test_permutation): add a test that replaces
- array during permutation.
-
-Wed Oct 29 23:31:34 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * string.c (rb_str_check_dummy_enc): new function to check dummy
- encoding.
-
- * string.c (rb_str_upcase_bang): case conversion functions should
- not be applicable to strings in dummy encoding. [ruby-dev:36985]
-
-Wed Oct 29 23:57:29 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * array.c (rb_ary_sort_bang): replacing array during sort broke
- invariant of array. [ruby-dev:36983]
-
-Wed Oct 29 21:06:46 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * io.c (rb_io_rewind): should reset fptr->readconv if it's
- available.
-
- * io.c (more_char): clear readconv at EOF.
-
- * test/ruby/test_file.rb: should not read after EOF. use rewind
- instead.
-
-Wed Oct 29 20:45:08 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * test/webrick/utils.rb (start_server): provide a reference to log of
- webrick.
-
- * test/webrick/test_httpproxy.rb, test/webrick/test_httpauth.rb,
- test/webrick/test_cgi.rb, test/webrick/test_httpserver.rb,
- test/webrick/test_server.rb, test/webrick/test_filehandler.rb: use
- webrick log as an assertion message.
-
-Wed Oct 29 16:41:17 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * pack.c (pack_pack): set encoding from packing string and UTF-8 for
- "U". [ruby-core:19590]
-
-Wed Oct 29 15:50:00 2008 TAKANO Mitsuhiro (takano32) <tak@no32.tk>
-
- * complex.c (imp1, imp2): should declare type.
- [BUG] at IA-64
-
-Wed Oct 29 14:36:50 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * common.mk (revision.h): have to be updated daily or by non-trivial
- commits.
-
-Wed Oct 29 13:18:02 2008 Akinori MUSHA <knu@iDaemons.org>
-
- * README, README.ja: Update the portability section.
-
-Wed Oct 29 13:02:17 2008 Akinori MUSHA <knu@iDaemons.org>
-
- * configure.in (rb_cv_lib_xpg4_needed): Drop legacy FreeBSD
- support regarding libxpg4. Those old versions of FreeBSD
- shipped with the library don't have a working pthread library
- anyway.
-
-Wed Oct 29 11:50:57 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in (dln-a-out): cannot make shared library nor work with
- ELF. [ruby-core:19571]
-
-Wed Oct 29 11:00:25 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/win32.c (rb_w32_open): shouldn't seek here.
-
- * win32/win32.c (rb_w32_write): write to the end of the file when
- FAPPEND is specified.
-
-Wed Oct 29 09:30:04 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ruby.c (load_file_internal): cache common interned IDs.
-
-Wed Oct 29 00:43:39 2008 Tadayoshi Funaba <tadf@dotrb.org>
-
- * complex.c: uses macro in declarations.
-
-Wed Oct 29 00:26:00 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/win32.c (rb_w32_open): need to seek to the end of the file when
- O_APPEND is specified.
-
-Wed Oct 29 00:08:05 2008 Tadayoshi Funaba <tadf@dotrb.org>
-
- * math.c (rb_math_{atan2,cos,cosh,hypot,log,sin,sinh,sqrt}): added.
-
- * complex.c: follows the above change.
-
-Tue Oct 28 23:29:06 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * ext/nkf/nkf-utf8/nkf.c (kanji_convert): output unicode chars.
- [ruby-dev:36957]
-
- * ext/nkf/nkf-utf8/nkf.c (numchar_getc): increase buffer size.
- reported and patched at [ruby-dev:36957] by mame.
-
-Tue Oct 28 23:03:46 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * test/ruby/test_proc.rb: filled all patterns for testing
- vm_yield_setup_args.
-
-Tue Oct 28 23:05:35 2008 Tadayoshi Funaba <tadf@dotrb.org>
-
- * complex.c: continues to support canonicalization *unofficially*
- for an odd library mathn for the time being (only 1.9.x).
- since grand mathn must be very very special library for us.
-
- * rational.c: ditto.
-
- * ext/mathn/*/*: follow the above changes.
-
-Tue Oct 28 21:31:55 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * parse.y (parser_yylex): check EOF explicitly.
-
-Tue Oct 28 20:59:12 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * io.c (extract_binmode): new function to extract binmode/textmode
- options from hash.
-
- * io.c (rb_io_extract_modeenc): use above function.
-
- * io.c (rb_io_s_pipe): recognize binmode/textmode options.
-
-Tue Oct 28 20:15:49 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * io.c (make_readconv): now can specify the size of cbuf.
-
- * io.c (read_all, appendline, io_getc, rb_io_ungetc): follow above
- change.
-
-Tue Oct 28 19:00:51 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/win32.c (rb_w32_pipe_exec): internal fds should be always
- binmode.
-
-Tue Oct 28 17:21:18 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * tool/make-snapshot.rb: merged from ruby_1_9_1.
-
-Tue Oct 28 16:56:31 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * gem_prelude.rb: merged from ruby_1_9_1 branch.
- considers --program-suffix and prefix configure options.
-
- * lib/rubygems/defaults.rb: ditto.
-
- * test/rubygems/test_gem.rb (@default_dir_re): ditto.
-
-Tue Oct 28 16:13:36 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * tool/make-snapshot: use String#bytesize.
-
-Tue Oct 28 09:51:48 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * bootstraptest/test_thread.rb: ignore some exceptions.
- [ruby-dev:36951]
-
-Tue Oct 28 09:19:40 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/Makefile.sub (RUNRUBY): now ruby requires something from
- gem_prelude, so need to set library path.
-
-Mon Oct 27 22:29:11 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * vm_insnhelper.c (vm_yield_setup_args): supports optional parameters.
- Fixed [ruby-core:19503].
-
- * vm_insnhelper.c (vm_yield_setup_block_args): a new function. extracted
- from vm_yield_setup_args.
-
- * vm_insnhelper.c (vm_yield_setup_block_args_complex): ditto.
-
- * test/ruby/test_proc.rb: added tests for arguments on a Proc from
- Kernel#proc called.
-
-Mon Oct 27 20:03:05 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * ext/mathn/complex/complex.c: no need to define rb_cComplex because
- it's already defined at $(srcdir)/complex.c.
-
- * ext/mathn/rational/rational.c: no need to define rb_cRational because
- it's already defined at $(srcdir)/rational.c.
-
-Mon Oct 27 15:58:25 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ruby.c (load_file): preserves $.. [ruby-dev:36937]
-
- * io.c (argf_init): initial value of $. should be 0.
- see [ruby-dev:36937].
-
-Mon Oct 27 15:38:38 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * test/minitest/test_mini_test.rb
- (test_assert_raises_triggered_different): the test failed when a
- file path in the backtrace contains something except [\w\/\.],
- e.g. hyphen, Japanese characters or backslash.
-
- * test/minitest/test_mini_test.rb
- (test_assert_raises_triggered_subclass): ditto.
-
-Mon Oct 27 15:32:08 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * test/minitest/test_mini_test.rb: fixed that r19958 made
- test-all fail when the ruby was built at $(srcdir).
-
-Mon Oct 27 12:04:58 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * test/ruby/envutil.rb: reverted the changeset 19948 because it
- concealed unexpected behaviours of ruby.
-
- * test/ruby/test_io.rb: ditto.
-
-Mon Oct 27 12:02:53 2008 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-
- * ext/nkf/nkf.c (rb_nkf_convert): should specify type of variable.
-
-Mon Oct 27 11:34:56 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * test/minitest/test_mini_test.rb (test_filter_backtrace):
- fixed failure on Ruby built at out of $(srcdir).
-
- * test/minitest/test_mini_test.rb (test_Filter_backtrace_unit_starts):
- ditto.
-
-Mon Oct 27 10:02:47 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * io.c (read_all): the 3rd argument maybe Qnil.
-
-Mon Oct 27 01:29:55 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * test/nkf/test_nkf.rb: add a test for [ruby-dev:36909].
-
-Mon Oct 27 01:05:48 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * ext/nkf/nkf.c (rb_nkf_convert): avoid GC.
- reported in [ruby-dev:36909] and patched [ruby-dev:36941] by mame.
-
-Sun Oct 26 21:28:42 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * test/json/test_json.rb: remove dependency on permutation gem.
-
-Sun Oct 26 19:18:36 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * thread.c (blocking_region_{begin,end}): declared as inline.
-
- * util.c (freedtoa): used only when MULTIPLE_THREADS is not defined.
-
- * win32/win32.c (rb_w32_pipe): serial is DWORD.
-
- * ext/etc/etc.c (sGroup): getgrent may not be available.
-
-Sun Oct 26 18:11:40 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/io/wait/{extconf.rb,wait.c}: needs sys/ioctl.h for fcntl on
- cygwin.
-
-Sun Oct 26 18:18:39 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * gem_prelude.rb: disables debug and verbose flags to suppress failure
- messages. interpolation does not occur inside single quotes.
-
-Sun Oct 26 18:42:21 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * test/ruby/envutil.rb (assert_in_out_err): disables builtin rubygems
- to get rid of the interference.
-
- * test/ruby/test_io.rb (ruby): ditto.
-
-Sun Oct 26 13:30:28 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * io.c (read_all): use the given buffer to read when needs readconv.
- based on the patch by wanabe <s.wanabe AT gmail.com> at
- [ruby-dev:36931].
-
-Sun Oct 26 07:57:35 2008 Eric Hodel <drbrain@segment7.net>
-
- * lib/rubygems*: Update to RubyGems 1.3.1 r1909.
-
-Sun Oct 26 07:35:56 2008 Ryan Davis <ryand-ruby@zenspider.com>
-
- * lib/minitest/unit.rb: Imported minitest 1.3.0 r4429.
- * test/minitest/*: ditto.
-
-Sun Oct 26 02:16:29 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * configure.in ($MANTYPE): followed ruby.1, which had moved.
-
- * instruby.rb (:man): ditto.
-
- * mdoc2man.rb: fixed for the case Xr with 2 arguments.
-
-Sun Oct 26 01:42:45 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * man/irb.1: new manual page.
-
-Sun Oct 26 00:11:48 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * man/ruby.1: moved into man/. added some descriptions.
-
- * man/goruby.1: new file.
-
- * instruby.rb (:man): followed ruby.1.
-
-Sat Oct 25 20:05:22 2008 Narihiro Nakamura <authorNari@gmail.com>
-
- * gc.c (gc_profile_result): bug fix. The millisecond is 1/1000.
-
-Sat Oct 25 11:12:40 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * ruby.c (usage): updated the description of -E option.
-
-Sat Oct 25 09:54:10 2008 James Edward Gray II <jeg2@ruby-lang.org>
-
- * lib/csv.rb: Fixed a bug in read_to_char() that would slurp
- whole files if the encoding was invalid. It will now read
- up to 10 bytes ahead to find a valid character boundary or
- give up. [ruby-core:19465]
-
- * test/csv/test_features.rb, test/csv/test_table.rb, test/csv/test_row.rb:
- Loosened some tests to check for a compatible? Encoding instead
- of an exact Encoding. [ruby-core:19470]
-
-Sat Oct 25 07:42:49 2008 Eric Hodel <drbrain@segment7.net>
-
- * lib/rdoc*: Update to RDoc 2.2.2 r192.
-
-Sat Oct 25 04:00:31 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * enc/us_ascii.c (us_ascii_mbc_enc_len): made static. a patch by
- Tadashi Saito <shiba AT mail2.accsnet.ne.jp> at [ruby-dev:36916]
-
- * signal.c (signal_buff): made static. a patch by Tadashi Saito
- <shiba AT mail2.accsnet.ne.jp> at [ruby-dev:36915]
-
- * util.c (freedtoa): made static to get rid of name clash. a patch by
- Tadashi Saito <shiba AT mail2.accsnet.ne.jp> at [ruby-dev:36913]
-
- * util.c (ruby_dtoa): added prefix, ditto.
-
-Sat Oct 25 03:43:25 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (lambda): need to adjust lpar_beg for both of the parser and
- ripper.
-
-Sat Oct 25 01:29:34 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * ext/mathn/rational/rational.c: undef duplicated macro definition
- first to shut up the warning.
-
- * ext/mathn/rational/rational.c (rb_rational_new_mathn): specify
- omitted return value.
-
-Sat Oct 25 00:14:41 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * array.c (rb_ary_sample): fixed sizes and randomness.
-
-Fri Oct 24 23:04:42 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * configure.in (sitedir): considers --program-prefix and
- --program-suffix.
- (vendordir): ditto.
- (rubyhdrdir): ditto.
-
- * mkconfig.rb (CONFIG["rubylibdir"]): ditto.
-
- * win32/Makefile.sub: ditto.
-
- * instruby.rb (:rdoc): ditto.
-
- * lib/rdoc/ri/paths.rb (RDoc::RI::Paths): ditto.
-
-Fri Oct 24 22:59:27 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * test/ruby/test_array.rb (test_sample): add tests for size of
- returned array and randomness.
-
-Fri Oct 24 21:50:21 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * id.h, template/id.h.tmpl (enum ruby_method_ids): reordered.
-
-Fri Oct 24 21:19:45 2008 Keiju Ishitsuka <keiju@ruby-lang.org>
-
- * ext/mathn/rational.c: change several global functions.
-
-Fri Oct 24 21:05:38 2008 Takeyuki FUJIOKA <xibbar@ruby-lang.org>
-
- * lib/cgi/html.rb: allow symbolized key.
-
- * test/cgi/test_cgi_tag_helper.rb: add a test.
-
-Fri Oct 24 20:54:53 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * common.mk (exts): renamed to get rid of the existent directory.
-
-Fri Oct 24 20:45:41 2008 Keiju Ishitsuka <keiju@ruby-lang.org>
-
- * ext/mathn/rational.c: change several global functions to static
- function.
-
-Fri Oct 24 19:57:19 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * string.c (rb_str_dump): should have removed commented out
- unnecessary code. [ruby-cvs:27131]
-
-Fri Oct 24 19:16:36 2008 URABE Shyouhei <shyouhei@ruby-lang.org>
-
- * id.h (enum ruby_method_ids): ISO C forbids comma at end of
- enumerator list.
-
-Fri Oct 24 18:29:00 2008 Keiju Ishitsuka <keiju@ruby-lang.org>
-
- * lib/mathn.rb: moved into ext/mathn/rational/rational.c and
- ext/mathn/complex/complex.c.
- * ext/mathn: new mathn ext-libraries.
-
-Fri Oct 24 18:21:31 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * test/ruby/test_array.rb (TestArray#test_join): should restore
- global variable after the test. [ruby-dev:36896]
-
- * test/ruby/test_hash.rb (TestHash#test_to_s): ditto.
-
-Fri Oct 24 17:43:26 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * parse.y (lambda): need to adjust lpar_beg for ripper as well.
- [ruby-dev:36702]
-
-Fri Oct 24 16:13:12 2008 Takeyuki FUJIOKA <xibbar@ruby-lang.org>
-
- * lib/cgi/core.rb (read_multipart): change field value as String
- from StringIO or Tempfile when multipart parse except file field.
- add files method that can get uploaded files. [ruby-dev:36547]
-
- * test/cgi/test_cgi_multipart.rb: fix the test for core.rb.
-
-Fri Oct 24 14:22:48 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * common.mk (ext): split out the target for extension library.
-
- * common.mk (encs): depends on enc and trans.
-
-Fri Oct 24 10:23:24 2008 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-
- * test/ruby/test_signal.rb (TestSignal#test_exit_action): Thread
- may terminate before sysread. [ruby-dev:36835]
-
-Thu Oct 23 22:06:23 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * distruby.rb: removed. "make dist" uses tool/make-snapshot for the 1.9
- series. distruby.rb has been no longer used.
-
-Thu Oct 23 17:30:29 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * class.c (rb_class_instance_methods): rdoc fixed. [ruby-core:19458]
-
-Thu Oct 23 16:19:33 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/irb/init.rb (IRB.load_modules): catch LoadError explicitly.
- a patch from Daniel Berger <Daniel.Berger at qwest.com> in
- [ruby-core:19451]. fix [ruby-core:19450]
-
-Thu Oct 23 16:16:17 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/socket/socket.c (sock_s_getservbyport): check if the port range.
- [ruby-core:19460]
-
-Thu Oct 23 14:08:07 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/socket/socket.c (sock_s_getservbyname): unuse unnecessary
- object.
-
- * ext/socket/socket.c (sock_s_getservbyport): the port should be
- converted before the proto so that the #to_int of the former cannot
- alter the latter.
-
-Thu Oct 23 10:55:08 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * string.c (rb_str_dump): use \u{ff} escape for UTF-8 encoding
- string.
-
-Thu Oct 23 09:26:22 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * ext/socket/socket.c (sock_s_getservbyport): cast to get rid of
- warning.
-
-Thu Oct 23 08:06:03 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * ext/socket/socket.c (sock_s_getservbyport): port should be
- network byte order. a patch from Dave Thomas in [ruby-core:19454].
-
-Thu Oct 23 01:26:25 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * string.c (rb_str_conv_enc_opts): new function to convert with
- specifying ecflags and ecopts.
-
- * ext/zlib/zlib.c (gzfile_newstr): specify ecflags and ecopts for
- conversion using above function.
-
- * ext/zlib/zlib.c (gzfile_newstr): use own rb_econv_t for dummy
- encoding to handling stateful encoding (e.g. iso-2022-jp).
- [ruby-dev:36857]
-
- * ext/zlib/zlib.c (gzfile_getc): ditto.
-
-Thu Oct 23 01:24:49 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/mkmf.rb (create_tmpsrc): get rid of side effects.
-
-Thu Oct 23 00:10:01 2008 Koichi Sasada <ko1@atdot.net>
-
- * cont.c: separate data structure between rb_fiber_t and
- rb_context_t (rb_fiber_t includes rb_context_t).
- rb_fiber_t has double linked list of fibers in same threads.
-
-Wed Oct 22 17:25:17 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * io.c (pipe_open): remove unnecessary flush before fork.
- a patch from Kazuhiro NISHIYAMA <zn at mbf.nifty.com>
- in [ruby-dev:36840].
-
-Wed Oct 22 16:27:57 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * vm_insnhelper.c (vm_yield_setup_args): should not drop arguments
- corresponding to default parameters.
-
-Wed Oct 22 14:59:30 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * parse.y (f_larglist): should not allow semicolon separated local
- variable declarations if formal argument list is not surrounded
- by parentheses, mostly because semicolon outside of parentheses
- appears to terminate the expression.
-
-Wed Oct 22 14:52:17 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * string.c (rb_external_str_new_with_enc): no implicit strlen call.
- [ruby-dev:36854]
-
- * string.c (rb_external_str_new_cstr): new function to create
- string from external NUL terminated C string.
-
- * string.c (rb_locale_str_new_cstr): ditto.
-
- * ext/readline/readline.c: now use rb_locale_str_new_cstr().
-
- * test/sdbm/test_sdbm.rb (TestSDBM#test_delete_with_block):
- deleted key to the block may be a copy of specified key.
-
- * test/dbm/test_dbm.rb (TestDBM#test_delete_with_block): ditto.
-
-Wed Oct 22 13:16:47 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * re.c (unescape_escaped_nonascii): back out the last change on
- the function. [ruby-dev:36818]
-
-Wed Oct 22 07:09:19 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * ext/zlib/zlib.c (rb_gzreader_ungetc): should be able to unget
- Fixnum.
-
- * ext/stringio/stringio.c (strio_ungetc): should convert unget
- string.
-
- * ext/stringio/stringio.c (strio_ungetbyte): new method.
-
-Wed Oct 22 05:46:25 2008 Koichi Sasada <ko1@atdot.net>
-
- * include/ruby/vm.h: write a comment.
-
- * common.mk: remove vm.h from any rules.
- vm.h is not needed on this version.
-
- * vm_core.h: ditto.
-
-Wed Oct 22 05:39:39 2008 Koichi Sasada <ko1@atdot.net>
-
- * parse.y (arg_concat_gen): concat target node should be NODE_ARRAY.
- [ruby-core:19413]
-
- * bootstraptest/test_method.rb: add tests.
-
-Wed Oct 22 00:29:13 2008 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
-
- * test/rinda/test_rinda.rb (test_core_03_notify): Fixed test failures
- [ruby-dev:36837].
-
-Wed Oct 22 00:22:06 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * string.c (rb_external_str_new_with_enc): wrong condition to
- calculate strlen().
-
- * ext/readline/readline.c: add encoding support.
-
-Tue Oct 21 23:12:24 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * ext/stringio/stringio.c (strio_write): should convert writing
- string to the encoding of the buffer.
-
- * hash.c (rb_any_hash): typo fixed.
-
- * ext/zlib/zlib.c (rb_gzwriter_write): oops, IO string conversion
- need to be done by to_s.
-
-Tue Oct 21 22:38:58 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * io.c (open_key_args): should adjust argc, argv in struct
- foreach_arg.
-
-Tue Oct 21 21:52:00 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * ext/zlib/zlib.c (rb_gzwriter_write): conversion should be done
- using to_str, not to_s.
-
- * ext/zlib/zlib.c (rb_gzwriter_write): need proper conversion
- according to gz encoding.
-
- * ext/zlib/zlib.c (rb_gzreader_ungetc): convert string encoding
- before unget.
-
-Tue Oct 21 21:33:36 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/test/unit.rb (assert_nothing_raised): raise with backtrace.
-
-Tue Oct 21 20:12:19 2008 Tanaka Akira <akr@fsij.org>
-
- * lib/test/unit.rb (assert_nothing_raised): set backtrace.
-
-Tue Oct 21 18:17:42 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * ext/zlib/zlib.c: remove obsolete prototype macros.
-
- * ext/zlib/zlib.c (struct gzfile): add encoding field to gzfile
- structure.
-
- * ext/zlib/zlib.c (rb_gzreader_getc): now works on characters.
-
- * ext/zlib/zlib.c (rb_gzreader_getbyte): new method to retrieve
- single byte.
-
- * ext/zlib/zlib.c (rb_gzreader_readbyte): ditto.
-
- * ext/zlib/zlib.c (rb_gzreader_each_byte): renamed from each_char
-
- * ext/zlib/zlib.c (rb_gzreader_ungetc): allow unget strings.
-
- * ext/zlib/zlib.c (rb_gzreader_ungetbyte): renamed from ungetc.
-
-Tue Oct 21 13:28:42 2008 Shugo Maeda <shugo@ruby-lang.org>
-
- * io.c, include/ruby/intern.h (rb_io_ascii8bit_binmode): externed.
-
- * ext/socket/socket.c (init_sock): use rb_io_ascii8bit_binmode()
- instead of rb_io_binmode().
-
-Tue Oct 21 13:17:39 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * mdoc2man.rb: moved into tools/.
-
- * instruby.rb: followed the change of mdoc2man.
-
-Tue Oct 21 11:34:04 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/iconv/iconv.c (strip_glibc_option, map_charset): check if
- encoding is a string. based on the patch by Hiroshi Moriyama at
- [ruby-dev:36811].
-
- * test/iconv/test_basic.rb (test_invalid_arguments): added tests.
-
-Tue Oct 21 10:40:37 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * io.c (rb_file_open_internal): should initialize fmode before using.
-
-Tue Oct 21 08:56:37 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * regparse.c (parse_char_class): CCV_SB is only for single
- byte. [ruby-dev:36786]
-
-Tue Oct 21 01:49:55 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * io.c (rb_io_extract_modeenc): plain rb/wb should set ASCII-8BIT
- to the external_encoding.
-
- * io.c (rb_file_open_internal): ditto.
-
- * io.c (NEED_WRITECONV): no conversion when the external_encoding
- is ASCII-8BIT.
-
- * io.c (do_writeconv): skip ASCII-8BIT.
-
-Tue Oct 21 00:51:59 2008 Tanaka Akira <akr@fsij.org>
-
- * io.c (rb_io_ascii8bit_binmode): renamed from rb_io_binmode.
- (rb_io_binmode): don't change encoding conversion.
- (rb_io_binmode_m): call rb_io_ascii8bit_binmode.
-
-Mon Oct 20 21:19:00 2008 Takeyuki FUJIOKA <xibbar@ruby-lang.org>
-
- * lib/cgi/core.rb (read_multipart): file's encoding is ascii-8bit
- from file field of multipart form.
-
-Mon Oct 20 20:16:25 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * ext/zlib/zlib.c (Init_zlib): add getbyte as an alias to getc.
- [ruby-dev:36801]
-
-Mon Oct 20 17:31:17 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * error.c (exc_equal): should not compare recursively.
- [ruby-dev:36796]
-
-Mon Oct 20 16:48:43 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * include/ruby/ruby.h (ExportStringValue): new macro to convert
- string in internal encoding to external to export.
-
- * string.c (rb_str_export): new function to do conversion to
- external encoding.
-
- * ext/sdbm/init.c: encoding conversion support.
-
- * ext/dbm/dbm.c: ditto.
-
-Mon Oct 20 15:42:02 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * string.c (rb_locale_str_new): new function to convert string
- from locale to internal encoding.
-
-Mon Oct 20 09:47:13 2008 Tanaka Akira <akr@fsij.org>
-
- * test/runner.rb: search srcdir/test/arg at first to find test/ruby
- directory when "ruby" is specified.
-
-Mon Oct 20 08:20:01 2008 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tk/lib/tk.rb: support Encoding.default_internal.
-
- * ext/tk/tcltklib.c: ditto.
-
- * ext/tk/extconf.rb: improve the strategy for searching Tcl/Tk headers.
-
-Mon Oct 20 00:57:04 2008 Tanaka Akira <akr@fsij.org>
-
- * lib/test/unit.rb (Test::Unit.setup_argv): call given block for
- filtering files.
-
- * test/runner.rb: search srcdir/test/arg, srcdir/arg.
-
- * bin/testrb: show usage if no files given.
-
-Sun Oct 19 21:19:16 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * common.mk (srcs): removed ID_H_TARGET.
-
- * tool/generic_erb.rb: always overwrites if no if-change option.
- sends the result to stdout if no output option.
-
- * template/id.h.tmpl: shows which token differs.
-
-Sun Oct 19 18:15:15 2008 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * enc/trans/single_byte.trans: adding WINDOWS-wwww encodings
- (wwww = 874/1250/1251/1253/1254/1255/1256/1257)
- (contributed by Yoshihiro Kambayashi)
-
- * enc/trans/windows-wwww-tbl.rb: 8 new files
- (contributed by Yoshihiro Kambayashi)
-
- * test/ruby/test_transcode.rb: added test_windows_wwww
- (contributed by Yoshihiro Kambayashi)
-
-Sun Oct 19 07:37:13 2008 Tadayoshi Funaba <tadf@dotrb.org>
-
- * lib/cmath.rb (log2,cbrt,frexp,ldexp,hypot,erf,erfc,gamma,lgamma):
- should be also provided as module function. [ruby-dev:36787]
-
-Sun Oct 19 07:25:08 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * keywords, lex.c.src, opt_insn_unif.def, opt_operand.def: moved rarely changed
- input files for code generators into defs/ directory.
-
- * Makefile.in (lex.c): followed keywords and lex.c.src.
-
- * common.mk (parser.o): followed keywords.
- (INSNS): followed opt_*.def
-
- * tools/instruction.rb: followed opt_*.def.
-
-Sun Oct 19 12:28:01 2008 James Edward Gray II <jeg2@ruby-lang.org>
-
- * test/csv/*: Renamed tc_* files to test_* to fit in within Ruby's
- testing process.
-
-Sun Oct 19 00:15:03 2008 Tanaka Akira <akr@fsij.org>
-
- * lib/test/unit.rb (assert_nothing_thrown): don't intern.
-
-Sat Oct 18 14:40:32 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * numeric.c (num_sadded): remove newly defined singleton method
- that should not exist after exception handling. [ruby-dev:36569]
-
-Sat Oct 18 14:27:49 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * parse.y (opt_block_arg): allow trailing comma after usual
- arguments. not after block argument.
-
-Sat Oct 18 13:30:53 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * string.c (rb_external_str_new): a new function to convert from
- external encoding to internal encoding. if something went
- wrong, it returns a string with the external encoding.
-
- * string.c (rb_external_str_new_with_enc): same as above besides
- you can specify the source encoding.
-
- * ruby.c (ruby_set_argv): use rb_external_str_new()
-
- * ruby.c (set_arg0, ruby_script): ditto.
-
-Sat Oct 18 04:08:18 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/tempfile.rb (Tempfile#initialize): now Tempfile.new takes
- keyword arguments to open(). [ruby-dev:36756]
-
-Sat Oct 18 17:10:10 2008 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * tool/transcode-tblgen.rb: added set_valid_byte_pattern
- to reduce coupling between table generation script and
- specific encodings.
-
- * enc/trans/single_byte.trans: using set_valid_byte_pattern
-
-Sat Oct 18 16:39:39 2008 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * transcode.c: in transcode_search_path, eliminated a warning
- on cygwin about pathlen potentially not being initialized
-
-Sat Oct 18 13:40:27 2008 Tanaka Akira <akr@fsij.org>
-
- * lib/test/unit.rb (assert_nothing_thrown): implemented.
-
-Sat Oct 18 01:33:22 2008 WATANABE Hirofumi <eban@ruby-lang.org>
-
- * common.mk: use added options for generic_erb.rb.
-
-Sat Oct 18 00:47:51 2008 wanabe <s.wanabe@gmail.com>
-
- * array.c: don't recycle shared-array while sort!.
-
-Fri Oct 17 22:04:38 2008 wanabe <s.wanabe@gmail.com>
-
- * array.c: recycle shared-array when it isn't referenced.
-
-Fri Oct 17 20:29:26 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * re.c (rb_reg_initialize_m): specify ARG_ENCODING_NONE instead of
- ARG_ENCODING_FIXED for Regexp.new("", nil, "n"). [ruby-dev:36761]
-
- * test/ruby/test_regexp.rb (TestRegexp#test_initialize): test
- updated.
-
-Fri Oct 17 19:46:20 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * tool/ifchange, win32/ifchange.bat: --timestamp option added.
-
- * tool/generic_erb.rb: --timestamp, --output and --if-change options
- added.
-
-Fri Oct 17 18:33:12 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * array.c (ary_resize_capa): renamed RESIZE_CAPA.
-
-Fri Oct 17 18:16:51 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * test/bigdecimal/test_bigdecimal.rb (TestBigDecimal#test_sqrt_bigdecimal):
- test updated. a patch from TAKANO Mitsuhiro <takano32 at jus.or.jp> in
- [ruby-dev:36736].
-
-Fri Oct 17 18:14:57 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in (uncommon.mk): ignores failures at loading.
-
- * test/rubygems/gemutilities.rb (RubyGemTestCase#build_rake_in):
- get rid of interference with other tests.
-
-Fri Oct 17 18:06:39 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * transcode.c (str_transcode0): String#encode without argument now
- behave as if :undef => :replace, :invalid => :replace specified.
-
- * transcode.c (rb_econv_prepare_opts): should preserve options in
- any case.
-
-Fri Oct 17 11:48:18 2008 Shugo Maeda <shugo@ruby-lang.org>
-
- * ext/socket/socket.c (init_sock): sockets should be binmode.
-
- * test/socket/test_tcp.rb (test_encoding): ditto.
-
-Fri Oct 17 10:26:13 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * tool/insns2vm.rb: remove -Kn option in shebang line because it's
- inconsistent with -Ks commandline option in common.mk.
-
-Fri Oct 17 01:26:09 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode.c (transcode_restartable0): in_pos and out_pos never be
- NULL, now.
-
-Fri Oct 17 00:39:19 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * lib/test/unit.rb: sort the order of executing tests.
-
-Fri Oct 17 00:24:15 2008 Tanaka Akira <akr@fsij.org>
-
- * io.c (rb_io_binmode): reset encoding conversion.
-
-Fri Oct 17 00:16:08 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * io.c (rb_getc, rb_io_fread, rb_io_fwrite, rb_read_pending):
- remove deprecated functions which do not work. [ruby-dev:36697]
-
-Thu Oct 16 23:48:34 2008 Tanaka Akira <akr@fsij.org>
-
- * common.mk (TESTS): removed to re-enable test for minitest.
-
-Thu Oct 16 23:37:11 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * compile.c (iseq_set_sequence): fix memory leak.
-
-Thu Oct 16 23:27:27 2008 Tanaka Akira <akr@fsij.org>
-
- * lib/test/unit.rb (assert_equal): avoid incompatible character
- encodings error.
-
-Thu Oct 16 23:23:27 2008 Tanaka Akira <akr@fsij.org>
-
- * lib/test/unit.rb (assert_equal): failure message changed.
-
-Thu Oct 16 22:52:54 2008 Tanaka Akira <akr@fsij.org>
-
- * lib/test/unit: removed test/unit.
-
- * lib/test/unit.rb: new compatibility layer using minitest.
-
- * bin/testrb: use above.
-
- * test/runner.rb: ditto.
-
-Thu Oct 16 14:34:16 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * common.mk, enc/depend (enc, trans): targets for sources.
-
-Thu Oct 16 14:30:30 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * instruby.rb (lib): installs all files other than README etc.
-
-Thu Oct 16 09:48:03 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * re.c (rb_reg_initialize_m): changed the message to clarify the
- third option argument is now ignored. [ruby-dev:36753]
-
-Thu Oct 16 08:14:39 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * ruby.c (proc_options): no warning when default_external already
- set by -E.
-
- * test/ruby/test_rubyoptions.rb (TestRubyOptions#test_rubyopt):
- put -K after -E to set script encoding.
-
-Thu Oct 16 06:20:36 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * test/ruby/test_transcode.rb (TestTranscode#test_errors):
- String#encode now works without any argument. [ruby-dev:36740]
-
-Wed Oct 15 23:48:22 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * .gdbinit (rp): REGEXP handling fixed.
-
- * string.c (rb_str_rindex_m): need not to call rb_enc_check on
- regexp.
-
- * re.c (unescape_escaped_nonascii): try ASCII-8BIT encoding for
- broken strings.
-
-Wed Oct 15 23:11:10 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/delegate.rb (DelegateClass): restored 1.8 behavior for
- DelegateClass as well. [ruby-dev:36739]
-
-Wed Oct 15 22:19:14 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * array.c (RESIZE_CAPA): check whether len is longer than capacity.
-
- * array.c (rb_ary_compact_bang): resize ary before changing capacity.
- fixed [ruby-dev:36704]
-
-Wed Oct 15 16:57:30 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * version.h (RUBY_DESCRIPTION): remove unnecessary space.
-
-Tue Oct 14 23:18:15 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/delegate.rb (Delegator): simplified and restored 1.8
- behavior. [ruby-dev:35986]
-
-Tue Oct 14 21:50:40 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * common.mk (TESTS): skips minitest by default, since it interferes
- with test/unit.
-
-Tue Oct 14 21:36:29 2008 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-
- * ext/win32ole/win32ole.c (load_conv_function51932): check
- having IMultiLanguage2 or IMultiLanguage. [ruby-dev:36716]
-
- * ext/win32ole/extconf.rb: ditto.
-
-Tue Oct 14 20:45:29 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * io.c (Init_IO): $FILENAME and $* must be read-only. [ruby-dev:36698]
-
- * variable.c (*_getter, *_setter, *_marker): made public.
-
- * include/ruby/ruby.h (rb_gvar_*_{getter,setter,marker}): declared.
-
-Tue Oct 14 20:32:09 2008 Tanaka Akira <akr@fsij.org>
-
- * enc/trans/single_byte.trans (transcode_tblgen_singlebyte): renamed
- from transcode_tblgen_windows.
- (transcode_tblgen_iso8859): use transcode_tblgen_singlebyte.
-
-Tue Oct 14 19:32:14 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * ruby.c (process_options): -U should be allowed in RUBYOPT
- environment variable. [ruby-dev:36720]
-
-Tue Oct 14 14:11:17 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ruby.c (proc_options): -U can be followed by other options.
-
-Tue Oct 14 13:30:30 2008 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * enc/trans/single_byte.trans: added windows-1252
-
- * enc/trans/windows-1252-tbl.rb: new file
- (contributed by Yoshihiro Kambayashi)
-
- * tool/transcode-tblgen.rb: listed windows-1252 as '1byte'
-
- * test/ruby/test_transcode.rb: added test_windows_1252
- (contributed by Yoshihiro Kambayashi)
-
-Tue Oct 14 12:22:32 2008 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-
- * test/ruby/test_variable.rb (TestVariable#test_variable): add
- a test of [ruby-dev:36698].
-
-Tue Oct 14 11:14:29 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * transcode.c (str_transcode0): should not raise error when
- default_internal is not set. [ruby-core:19309]
-
-Tue Oct 14 11:14:26 2008 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+Tue Feb 3 14:35:26 2009 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
* lib/net/pop.rb: check for invalid APOP timestamp. (CVE-2007-1558)
[ruby-dev:36631]
* test/net/pop/test_pop.rb: ditto.
-Tue Oct 14 09:39:32 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * ruby.c (set_internal_encoding_once): check double contradicted
- specification of the encoding from command line.
-
- * ruby.c (set_external_encoding_once): ditto.
-
-Tue Oct 14 08:28:31 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * parse.y (parser_yylex): allow reserved word to be keyword argument.
-
-Mon Oct 13 19:07:52 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * parse.y (token_info_pop): show source filename. [ruby-dev:36710]
-
-Mon Oct 13 08:59:08 2008 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-
- * ext/win32ole/win32ole.c (load_conv_function51932): support
- CP51932 on cygwin and mingw32. thanks to arton.
-
- * test/win32ole/test_win32ole.rb (test_cp51932): ditto.
-
-Mon Oct 13 07:54:00 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * ruby.c (proc_options): add -U command line option to specify
- utf-8 as default_internal.
-
-Mon Oct 13 07:42:57 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * transcode.c (str_transcode0): String#encode() with no encoding
- specified transcode the string into Encoding.default_internal.
- inspired by [ruby-core:19298].
-
-Sun Oct 12 18:00:18 2008 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-
- * ext/win32ole/win32ole.c (set_ole_codepage, ole_cp2encoding,
- ole_wc2mb, ole_vstr2wc, ole_mb2wc): support CP51932 (only mswin32).
-
- * test/win32ole/test_win32ole.rb: ditto.
-
-Sun Oct 12 12:03:38 2008 Koichi Sasada <ko1@atdot.net>
-
- * vm.c, vm_insnhelper.h (ruby_vm_redefined_flag): apply optimization
- patch proposed by Paul Brannan. [ruby-core:19171]
-
-Sun Oct 12 09:46:36 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * strftime.c (rb_strftime): suppressed warnings on cygwin.
-
-Sat Oct 11 19:49:35 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (parser_prepare): use utf-8 encoding directly.
-
-Sat Oct 11 10:20:17 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/mkmf.rb (CLEANINGS): uses escaped form tabs to preventing the
- confusion. [ruby-talk:317345]
-
-Sat Oct 11 08:51:13 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/rake.rb (Rake::Application#standard_exception_handling): removed
- unnecessary SystemExit, and exits with false instead of system
- dependent value. [ruby-talk:317330]
-
-Sat Oct 11 03:54:05 2008 Koichi Sasada <ko1@atdot.net>
-
- * parse.y: optimize 'for' statement when one variable given.
-
- * benchmark/bm_loop_for.rb: added.
-
- * benchmark/bm_loop_times.rb: modified.
-
-Sat Oct 11 12:09:05 2008 James Edward Gray II <jeg2@ruby-lang.org>
-
- * lib/csv/csv.rb: Added support for Encoding::default_internal.
- * lib/csv/csv.rb: Switched to new Hash syntax.
-
-Fri Oct 10 22:16:55 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (comment_at_top): needed for ripper too.
-
-Fri Oct 10 22:07:05 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * include/ruby.h: updated macros for headers. [ruby-core:19275]
-
-Fri Oct 10 19:21:50 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (magic_comment_encoding): warns when ignored.
-
- * parse.y (parser_magic_comment): replaces '-' with '_'.
-
- * parse.y (parser_yylex): allows magic comments indented and the
- second line or later.
-
-Fri Oct 10 17:26:50 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * ext/json/ext/parser/parser.c (JSON_parse_string):
- associate encoding.
-
-Fri Oct 10 10:18:21 2008 Ryan Davis <ryand-ruby@zenspider.com>
-
- * lib/test/*: reverted back to test/unit.
- * test/test/*: ditto
- * lib/minitest/*: Imported minitest 1.3.0 r4333.
-
-Fri Oct 10 03:41:31 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * sprintf.c (rb_str_format): check if codepoint for %c is valid.
- [ruby-dev:36691]
-
-Fri Oct 10 01:55:48 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * encoding.c (enc_names): minor improvement.
-
-Fri Oct 10 00:21:39 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/optparse.rb (ParseError.filter_backtrace): removes internal
- backtrace.
-
-Fri Oct 10 00:11:16 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * transcode.c (rb_econv_add_converter): remove unnecessary NULL check.
-
-Thu Oct 9 23:53:23 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * misc/ruby-style.el (ruby-style-c-mode): buffer may not have file
- name.
-
-Thu Oct 9 23:30:47 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * process.c (run_exec_dup2): fix resource leak.
-
-Thu Oct 9 23:19:02 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * process.c (rb_run_exec_options): fix resource leak.
-
-Thu Oct 9 22:13:58 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * test/ruby/test_module.rb (test_remove_class_variable): add a test
- for Class#remove_class_variable.
-
- * test/ruby/test_object.rb (test_remove_instance_variable): add a test
- for Object#remove_instance_variable.
-
-Thu Oct 9 22:04:38 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * variable.c (rb_mod_remove_cvar): fix r19711.
-
-Thu Oct 9 21:17:50 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * ext/syck/syck.c (syck_lookup_sym): remove reading uninitialized
- variable.
-
-Thu Oct 9 16:34:15 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * ext/json/ext/generator/extconf.rb: fix target.
-
- * ext/json/ext/parser/extconf.rb: ditto.
-
-Thu Oct 9 14:37:59 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * include/ruby/ruby.h: embeds the elements of an array into its
- struct RArray for # of elements <= 3.
-
- * array.c: ditto.
-
- * gc.c (gc_mark_children): following the change of struct RArray.
-
- * ext/tk/tcltklib.c (ip_ruby_cmp): ditto.
-
- * parse.y (coverage): ditto.
+Mon Feb 2 20:03:58 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * proc.c (curry): ditto.
+ * time.c (time_mdump, time_mload): preserves GMT status.
+ [ruby-core:19252]
- * .gdbinit: ditto.
-
-Thu Oct 9 11:29:33 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * encoding.c (Init_Encoding): new instance method Encoding#names,
- returns its name and alias names.
-
- * encoding.c (enc_names): defined for Encoding#names.
-
- * encoding.c (enc_names_i): defined for enc_names.
-
-Thu Oct 9 08:47:38 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * thread.c (rb_thread_wait_fd_rw): should not block by select if
- there's only one thread living. fixed [ruby-dev:36646].
-
-Wed Oct 8 20:59:52 2008 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-
- * ext/win32ole/win32ole.c (ole_init_cp): initialize WIN32OLE.codepage
- according to Encoding.default_internal and
- Encoding.default_external.
-
-Wed Oct 8 17:02:21 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * ext/json/lib/json/pure/generator.rb (utf8_to_json):
- process each unpacked Unicode character.
-
-Wed Oct 8 15:00:22 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * ext/json/lib/json/pure/parser.rb
- (JSON::Pure::Parser#parse_string): force_encoding("UTF-8").
-
-Wed Oct 8 11:56:15 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * lib/test/unit/assertions.rb: assert_nothing_thrown,
- assert_raise, assert_not_equal, assert_no_match, assert_not_nil,
- assert_not_same are coming back as alias.
-
-Wed Oct 8 11:18:12 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Feb 2 11:34:51 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
* variable.c (autoload_delete, autoload_file): should not delete
autoload table, since it may be shared with duplicated modules.
[ruby-core:19181]
-Wed Oct 8 02:38:28 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * encoding.c (rb_default_internal_encoding): merged a patch from
- Michael Selig <michael.selig at fs.com.au> in [ruby-core:18985].
-
- * io.c (rb_io_ext_int_to_encs): ditto.
-
- * ruby.c (proc_options): support default internal encoding in -E
- option.
-
-Wed Oct 8 00:03:39 2008 Tadayoshi Funaba <tadf@dotrb.org>
+Thu Jan 29 11:54:22 2009 Tadayoshi Funaba <tadf@dotrb.org>
* lib/date.rb (today,now): should produce own instances.
[ruby-talk:317020]
-Tue Oct 7 16:43:51 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * ext/json/lib/json/pure/generator.rb (utf8_to_json):
- force_encoding before gsub.
-
-Tue Oct 7 16:35:41 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * ext/json/lib/json/pure/generator.rb (utf8_to_json):
- downcase the result of Unicode escape.
-
-Mon Oct 6 16:44:52 2008 Takeyuki FUJIOKA <xibbar@ruby-lang.org>
-
- * lib/cgi/core.rb (CGI::QueryExtension::initialize_query): fix the
- condition.
-
- * test/cgi/test_cgi_core.rb: bug fix encoding.
- thanks to TAKANO Mitsuhiro <takano32 at jus.or.jp> .
-
- * test/cgi/test_cgi_multipart.rb: temporary comment in.
-
-Mon Oct 6 15:22:08 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * gc.c (gc_mark_children): ignores T_ZOMBIE.
-
-Mon Oct 6 12:45:20 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * test/ruby/test_module.rb (TestModule#_wrap_assertion): add
- definition. is this really needed?
-
- * test/ruby/test_module.rb (TestModule#test_mod_constants): should
- not depend on global Module constants.
-
-Mon Oct 6 12:38:36 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/test/unit/assertions.rb (Test::Assertions#assert_nothing_raised):
- should take optional message argument.
-
-Mon Oct 6 12:18:23 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * string.c (rb_str_comparable): string comparison should be
- transitive. [ruby-dev:36484]
-
- * test/ruby/test_m17n_comb.rb (TestM17NComb#test_str_eq): test
- updated.
-
-Mon Oct 6 09:00:58 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * test/bigdecimal/test_bigdecimal.rb (test_sqrt_bigdecimal): test
- updated. a patch from TAKANO Mitsuhiro <takano32 at jus.or.jp>
- in [ruby-dev:36669].
-
-Sun Oct 5 23:34:28 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/mkmf.rb ($config_h): now always defines for old libraries.
+Wed Jan 28 22:51:55 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun Oct 5 23:06:55 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * vm_method.c (rb_mod_modfunc): method undefined in included module
+ * eval.c (rb_mod_modfunc): method undefined in included module
may not have nd_body. [ruby-core:18738]
-Sun Oct 5 21:28:58 2008 Tadayoshi Funaba <tadf@dotrb.org>
-
- * lib/rational.rb: resolved conflicts of aliases.
-
- * lib/mathn.rb: avoided some warnings.
-
-Sun Oct 5 18:51:50 2008 Tanaka Akira <akr@fsij.org>
-
- * lib/open-uri.rb: remove debug code introduced by previous change.
-
-Sun Oct 5 17:49:35 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * lib/open-uri.rb (OpenURI.open_uri): set encoding to strio.
-
-Sun Oct 5 17:39:21 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * ext/stringio/stringio.c (strio_set_encoding): defined for
- StringIO#set_encoding.
-
-Sun Oct 5 11:24:42 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * eval.c: come back definition of environ.
-
-Sun Oct 5 09:19:49 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * ext/nkf/nkf-utf8/utf8tbl.c: update table.
-
-Sat Oct 4 22:50:14 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * dln.c: Ruby no longer supports VMS.
-
- * error.c: ditto.
-
- * eval.c: ditto.
-
- * eval_intern.h: ditto.
-
- * include/ruby/defines.h: ditto.
-
- * include/ruby/ruby.h: ditto.
-
- * io.c: ditto.
-
- * process.c: ditto.
-
- * ruby.c: ditto.
-
- * vms/config.h: removed.
-
- * vms/vms.h: ditto.
-
- * vms/vmsruby_private.c: ditto.
-
- * vms/vmsruby_private.h: ditto.
-
-Sat Oct 4 22:44:23 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * dln.c: Ruby no longer supports Windows CE.
-
- * eval.c: ditto.
-
- * include/ruby/defines.h: ditto.
-
- * include/ruby/win32.h: ditto.
-
- * ruby.c: ditto.
-
- * strftime.c: ditto.
-
- * win32/Makefile.sub: ditto.
-
- * win32/win32.c: ditto.
-
- * ext/tk/extconf.rb: ditto.
-
- * lib/fileutils.rb: ditto.
-
- * test/fileutils/test_fileutils.rb: ditto.
-
- * wince/*: removed.
-
-Sat Oct 4 22:35:06 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * dln.c: Ruby no longer supports MacOS 9 or before.
-
- * eval.c: ditto.
-
- * eval_intern.h: ditto.
-
- * ext/extmk.rb: ditto.
-
- * ext/tk/sample/tkextlib/treectrl/demo.rb: ditto.
-
- * ext/tk/stubs.c: ditto.
-
- * file.c: ditto.
-
- * hash.c: ditto.
-
- * include/ruby/defines.h: ditto.
-
- * ruby.c: ditto.
-
- * signal.c: ditto.
-
- * vm_core.h: ditto.
-
-Sat Oct 4 22:30:28 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * dln.c: Ruby no longer supports MS-DOS.
-
- * ext/sdbm/_sdbm.c: ditto.
-
- * ext/sdbm/sdbm.h: ditto.
-
- * gc.c: ditto.
-
- * hash.c: ditto.
-
- * include/ruby/defines.h: ditto.
-
- * include/ruby/util.h: ditto.
-
- * io.c: ditto.
-
- * process.c: ditto.
-
- * ruby.c: ditto.
-
- * strftime.c: ditto.
-
- * util.c: ditto.
-
-Sat Oct 4 22:14:15 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * djgpp/GNUmakefile.in: removed. Ruby no longer supports djgpp.
-
- * djgpp/README.djgpp: ditto.
-
- * djgpp/config.hin: ditto.
-
- * djgpp/config.sed: ditto.
-
- * djgpp/configure.bat: ditto.
-
- * djgpp/mkver.sed: ditto.
-
- * ext/Setup.dj: ditto.
-
- * dln.c: removed djgpp supports.
-
- * file.c: ditto.
-
- * gc.c: ditto.
-
- * io.c: ditto.
-
- * process.c: ditto.
-
- * ruby.c: ditto.
-
- * signal.c: ditto.
-
- * util.c: ditto.
-
- * vm_core.h: ditto.
-
- * lib/fileutils.rb: ditto.
-
- * lib/mkmf.rb: ditto.
-
- * ext/socket/socket.c: ditto.
-
- * test/fileutils/test_fileutils.rb: ditto.
-
- * test/ruby/test_env.rb: ditto.
-
- * test/ruby/test_path.rb: ditto.
-
-Sat Oct 4 21:59:39 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * x68/_dtos18.c: removed. Ruby no longer supports human68k.
-
- * x68/_round.c: ditto.
-
- * x68/fconvert.c: ditto.
-
- * x68/select.c: ditto.
-
- * ext/Setup.x68: ditto.
-
- * missing/x68.c: ditto.
-
- * dln.c (dln_find_exe_r): removed human68k supports.
- (dln_find_1): ditto.
-
- * lib/mkmf.rb: ditto.
-
- * ext/extmk.rb (Init_ext): ditto.
-
- * ext/socket/socket.c (init_sock): ditto.
-
- * gc.c (GC_MALLOC_LIMIT): ditto.
- (rb_setjmp, rb_jmpbuf): ditto.
- (mark_current_machine_context): ditto.
-
- * include/ruby/defines.h (PATH_ENV): ditto.
-
- * io.c: ditto.
-
- * process.c: ditto.
-
- * ruby.c: ditto.
-
- * test/ruby/test_env.rb: ditto.
-
- * test/ruby/test_path.rb: ditto.
-
- * LEGAL
-
-Sat Oct 4 19:02:36 2008 Tadayoshi Funaba <tadf@dotrb.org>
-
- * lib/date/format.rb: no need to require the "lib/rational.rb".
-
-Sat Oct 4 19:02:59 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * ext/nkf/nkf.c (rb_nkf_enc_get): don't replicate encoding.
- [ruby-dev:36575]
-
-Sat Oct 4 18:47:22 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * ext/stringio/stringio.c (strio_external_encoding): defined.
-
- * ext/stringio/stringio.c (strio_internal_encoding): defined.
-
- * ext/stringio/stringio.c (Init_stringio): define above.
-
-Sat Oct 4 15:52:17 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * test/mini/test_mini_test.rb: recovered.
- It had been temporarily removed at r19645.
-
- * test/mini/test_mini_mock.rb: ditto.
-
- * test/mini/test_mini_spec.rb: ditto.
-
- * lib/test/**/*: replaced by miniunit.
- miniunit had been temporarily reverted at r19643 but
- now recovered.
-
-Sat Oct 4 15:33:26 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * common.mk (gdb-ruby): new target. it runs ruby under controlled by
- gdb.
-
- * common.mk (dist): accepts RELNAME variable as the second argument of
- make-snapshot.rb.
-
-Sat Oct 4 12:17:46 2008 Keiju Ishitsuka <keiju@ruby-lang.org>
-
- * lib/irb/irb/ext/save-history.rb: change load_history using File.expand_path. see [ruby-dev:36660]. Thanks Kouhei Sutou.
- * lib/irb/irb/context.rb: convert string Symbol of instance variable names in IRB:Context#inspect.
-
-Fri Oct 3 22:43:04 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * ext/dl/extconf.rb ($distcleanfiles): added callback-?.c into
- the distclean list.
-
-Fri Oct 3 19:33:21 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * ext/json/lib/json/pure.rb (module JSON): remove Iconv dependency.
-
- * ext/json/lib/json/pure/generator.rb (utf8_to_json): process as
- binary and remove Iconv dependency.
-
- * ext/json/lib/json/pure/parser.rb (parse_string): ditto.
-
-Fri Oct 3 14:04:05 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/{configure.bat,setup.mak,Makefile.sub): add --program-prefix
- configure option support.
-
-Thu Oct 2 21:22:43 2008 Takeyuki FUJIOKA <xibbar@ruby-lang.org>
-
- * lib/cgi/core.rb (CGI::QueryExtension): delete MorphingBody
- and replace like as 1.8's in multipart reading.
- see [ruby-dev:36443],
- reference from CGIAlt http://cgialt.rubyforge.org/
-
- * test/cgi/test_cgi_multipart.rb : fixed multipart test.
-
-Thu Oct 2 20:46:17 2008 Tanaka Akira <akr@fsij.org>
-
- * string.c (rb_str_sub_bang): fix coderange.
-
-Wed Oct 1 22:54:09 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * lib/rexml/parsers/lightparser.rb, lib/debug.rb: remove unused when
- clauses.
-
-Wed Oct 1 22:43:59 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * lib/xmlrpc, lib/rexml, test/ruby/test_array.rb,
- test/ruby/test_unicode_escape.rb, test/scanf/test_scanf.rb,
- test/rss/rss-assertions.rb: fix indentation to remove warning.
-
-Wed Oct 1 21:36:35 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * gc.c (rb_gc_call_finalizer_at_exit): finalize deferred IO and Data.
-
- * gc.c (rb_gc_call_finalizer_at_exit): defers IO finalization.
- [ruby-dev:36646]
-
-Wed Oct 1 19:11:48 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Jan 28 20:53:27 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
* marshal.c (marshal_dump): fixed for check_dump_arg.
+Tue Jan 27 17:30:11 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
* marshal.c (marshal_dump): initializes dump_arg before any funcall.
[ruby-dev:36648]
-Wed Oct 1 00:54:32 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * string.c (rb_str_split_m): should use rb_str_subseq() which use
- offset and length by bytes. [ruby-dev:36641]
-
-Wed Oct 1 00:29:48 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * test/ruby/test_settracefunc.rb (test_call, test_class): line number
- was changed at r19592.
-
-Wed Oct 1 00:20:38 2008 Tanaka Akira <akr@fsij.org>
-
- * process.c (check_exec_redirect): don't depend on rb_stdout and
- rb_stderr.
-
-Tue Sep 30 23:06:58 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * test/mini/test_mini_test.rb: removed.
- Temporarily removed the tests for miniunit because of
- they depend on the miniunit version of test/unit,
- where test/unit was temporarily reverted to the state
- before importing miniunit.
-
- * test/mini/test_mini_mock.rb: ditto.
-
- * test/mini/test_mini_spec.rb: ditto.
-
-Tue Sep 30 23:04:30 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * lib/test/**/*: recovered.
- Temporarily reverts the changes of lib/test/unit/* in
- r19502 and r19501, in order to release 1.9.0-5.
-
-Tue Sep 30 23:00:05 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * lib/test/unit.rb: removed.
- Temporarily reverts the changes of lib/test/unit/* in
- r19543, r19534 and r19503, in order to release 1.9.0-5.
-
- * lib/test/unit/assertions.rb: ditto.
-
- * lib/test/unit/deprecate.rb: ditto.
-
- * lib/test/unit/error.rb: ditto.
-
- * lib/test/unit/testcase.rb: ditto.
-
-Tue Sep 30 20:17:26 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * io.c (rb_io_extract_modeenc): should honor value of the
- textmode: and binmode: options.
-
-Tue Sep 30 17:04:59 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * test/bigdecimal/test_bigdecimal.rb (test_sqrt_bigdecimal): wrong
- precision specification. a patch from TAKANO Mitsuhiro
- <takano32 at jus.or.jp> in [ruby-dev:36634].
-
-Tue Sep 30 16:53:55 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (stmt): returns non zero. [ruby-dev:36633]
-
-Tue Sep 30 16:52:38 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * sprintf.c (rb_str_format): add %<name>s style named argument
- support. a patch from Yusuke Endoh <mame at tsg.ne.jp>
- in [ruby-dev:35851].
-
- * sprintf.c (rb_str_format): add gettext style named format
- (%{name}) support. inspired by [ruby-dev:35852].
-
- * sprintf.c (GETNAMEARG): should raise KeyError exception when no
- named argument found.
-
- * hash.c (rb_hash_fetch): export fetch function.
-
-Tue Sep 30 13:19:01 2008 Eric Hodel <drbrain@segment7.net>
-
- * test/rubygems/test_gem_installer.rb: remove extra call to setup to
- fix ENV['HOME'] pollution.
-
-Tue Sep 30 13:04:11 2008 Ryan Davis <ryand-ruby@zenspider.com>
-
- * lib/mini/test.rb: Updated to 1.3.0 r4257.
- * test/mini/*: added from r4257.
-
-Tue Sep 30 07:46:07 2008 Eric Hodel <drbrain@segment7.net>
-
- * test/rdoc/test_rdoc_markup_attribute_manager.rb: Test with clean
- SPECIALS.
- * test/rubygems/gemutilities.rb: Restore ENV['HOME'] after test.
- * test/runner.rb: Pass -n argument down to miniunit.
-
-Tue Sep 30 01:02:55 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (token_info_push, token_info_pop): do nothing for evaled
- source.
-
-Tue Sep 30 00:47:43 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/nkf/nkf-utf8/nkf.c: constified.
-
-Mon Sep 29 23:32:25 2008 Tanaka Akira <akr@fsij.org>
-
- * string.c (rb_str_subseq): don't use rb_str_drop_bytes for short
- string.
-
-Mon Sep 29 22:54:29 2008 Tadayoshi Funaba <tadf@dotrb.org>
-
- * lib/mathn.rb: added String#to_[rc]. moved def_canon.
-
-Mon Sep 29 20:41:19 2008 Tanaka Akira <akr@fsij.org>
-
- * string.c (rb_str_subseq): use rb_str_drop_bytes if possible.
-
-Mon Sep 29 20:22:20 2008 Tadayoshi Funaba <tadf@dotrb.org>
-
- * test/date/*.rb: imported additional tests and some adjustments.
-
-Mon Sep 29 20:13:05 2008 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-
- * ext/win32ole/win32ole.c (fev_initialize): initialization
- handler instance variable.
-
- * test/win32ole/test_win32ole_typelib.rb (test_s_typelibs):
- fix the warning of shadowing outer local variable.
-
-Mon Sep 29 19:59:00 2008 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-
- * ext/win32ole/win32ole.c (rescue_callback): use rb_write_error
- instead of fprintf.
-
-Mon Sep 29 01:51:54 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * test/rdoc/test_rdoc_info_formatting.rb (teardown): delete tmpdir for
- test.
-
-Mon Sep 29 00:30:20 2008 Takeyuki Fujioka <xibbar@ruby-lang.org>
-
- * lib/cgi/html.rb (CGI::HtmlExtension::{radio_group, checkbox_group}):
- can specify the false as checked or selected value.
- [ruby-core:18306], [ruby-core:18307]
-
- * test/cgi/test_cgi_tag_helper.rb: add a test.
-
-Sun Sep 28 23:08:38 2008 Takeyuki Fujioka <xibbar@ruby-lang.org>
-
- * lib/cgi/html.rb (CGI::HtmlExtension::popup_menu):
- fix the calls #bytesize on array parameters. [ruby-core:18919]
-
-Sun Sep 28 22:44:26 2008 Takeyuki Fujioka <xibbar@ruby-lang.org>
-
- * lib/cgi/core.rb (CGI::parse): ignore illegal query params.
- [ruby-dev:36618]
-
-Sun Sep 28 22:05:07 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * compile.c (iseq_set_sequence): check duplicated when clause.
- [ruby-dev:36616]
-
-Sun Sep 28 19:04:03 2008 Tadayoshi Funaba <tadf@dotrb.org>
-
- * test/date/*.rb: imported a date test suite ruby 1.9 limited ed.
-
-Sun Sep 28 18:40:49 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/mini/test.rb (MINI_DIR): loaded path is expanded.
-
- * lib/mini/test.rb (assert_match): get rid of confusion of
- ruby-mode.el.
-
-Sun Sep 28 12:36:09 2008 Koichi Sasada <ko1@atdot.net>
-
- * vm_exec.c (vm_exec_core): add an UNLIKELY() hint.
-
- * vm_insnhelper.h (BASIC_OP_UNREDEFINED_P): add a LIKELY() hint.
-
-Sun Sep 28 12:04:18 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * string.c (str_new): sets empty string to coderange 7bit.
- [ruby-core:18993]
-
-Sun Sep 28 09:39:48 2008 Tadayoshi Funaba <tadf@dotrb.org>
-
- * lib/mathn.rb ({Fixnum,Bignum,Float}#**): may produce complex
- value.
-
-Sun Sep 28 09:05:53 2008 James Edward Gray II <jeg2@ruby-lang.org>
-
- * lib/csv/csv.rb: Worked around some minor encoding changes in Ruby
- pointed out by Nobu.
-
-Sun Sep 28 08:37:12 2008 Tadayoshi Funaba <tadf@dotrb.org>
-
- * lib/mathn.rb: a hack to provide canonicalization. This must be
- temporary, but this seems to be not bad for the time being.
-
-Sat Sep 27 06:22:18 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/rake.rb (Module#rake_extension, String#ext, String#pathmap): use
- built-in methods.
-
- * lib/rake.rb (String#pathmap): fixed typo in rdoc.
-
-Sat Sep 27 04:28:41 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * file.c (rmext): preceding dots are not a part of extension.
-
- * file.c (rb_file_s_extname): ditto.
-
-Sat Sep 27 03:15:51 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * vm.c (vm_jump_tag_but_local_jump): exc is not used if val is nil.
-
-Sat Sep 27 03:12:40 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Jan 27 15:17:35 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ext/socket/socket.c (host_str): numeric address should be unsigned.
[ruby-core:18971]
-Fri Sep 26 22:46:58 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (primary, brace_block): fix for line number.
-
- * proc.c (rb_proc_location, rb_method_location): new methods
- {Proc,Method,UnboundMethod}#source_location. [ruby-core:18452]
-
-Fri Sep 26 21:36:33 2008 Koichi Sasada <ko1@atdot.net>
-
- * vm_core.h (RUBY_VM_CHECK_INTS_TH): add an UNLIKELY hint.
-
-Fri Sep 26 19:33:36 2008 Tanaka Akira <akr@fsij.org>
-
- * include/ruby/encoding.h (rb_str_encode): renamed from
- rb_str_transcode. [ruby-dev:36593]
- (rb_econv_has_convpath_p): renamed from rb_transcode_convertible.
-
- * transcode.c: follow the renaming.
-
- * io.c: ditto.
-
-Fri Sep 26 19:01:47 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * test/bigdecimal/test_bigdecimal.rb (test_inspect): fixed CPU bit
- size dependent test. pointed out by TAKANO Mitsuhiro <takano32 AT
- jus.or.jp>.
-
-Fri Sep 26 18:57:33 2008 Akinori MUSHA <knu@iDaemons.org>
-
- * test/pathname/test_pathname.rb: Fix use of deprecated methods.
-
-Fri Sep 26 18:39:59 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * common.mk (dist): nothing is needed to run BASERUBY.
-
- * tool/make-snapshot: new option -archname.
-
-Fri Sep 26 18:24:28 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * misc/ruby-mode.el: safe customizable variables.
-
-Fri Sep 26 17:37:18 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * include/ruby/ruby.h (rb_mPrecision): removed.
- Precision module was temporarily removed at r19430.
-
-Fri Sep 26 17:25:10 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * common.mk (dist): Changed its dependencies and action.
-
-Fri Sep 26 17:07:04 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * error.c (Init_syserr): moved to the template.
- (errno_missing): removed. fixed [ruby-dev:35958].
-
- * defs/known_errors.def: added. extracted from Init_syserr.
-
- * templates/known_errors.inc.tmpl: added. Template for Init_syserr.
- c.f. [ruby-dev:35958].
-
- * tools/generic_erb.rb: added. general purpose mapper which maps
- data+template into source code.
-
- * common.mk (error.$(OBJEXT), incs, known_errors.inc):
- Fixed dependencies.
-
-Fri Sep 26 17:02:04 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * thread.c (thlist_signal): clears the woken thread if nothing woke.
-
- * thread.c (rb_barrier_wait): achieves the lock if no thread was
- waiting yet.
-
-Fri Sep 26 12:04:07 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * ext/curses/curses.c: should include <ruby/io.h>.
-
- * ext/io/wait/wait.c: ditto.
-
- * ext/openssl/ossl.h: ditto.
-
-Fri Sep 26 11:34:08 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * variable.c (rb_define_hooked_variable): cast to get rid of compiler
- warnings.
-
-Fri Sep 26 11:05:41 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * transcode.c, include/ruby/encoding.c (rb_transcode_convertible):
- new function. checking the existence of converter.
-
-Fri Sep 26 10:35:50 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * variable.c (global_variable, struct trace_var): made function
- members more strict.
-
-Fri Sep 26 09:55:06 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * include/ruby{io,sig}.h: moved to include/ruby/backward.
-
-Fri Sep 26 09:47:15 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * include/rubysig.h: old macros for backward compatibility.
-
- * thread.c (BLOCKING_REGION): rewritten using helper functions.
-
-Fri Sep 26 03:03:32 2008 Tanaka Akira <akr@fsij.org>
-
- * vm_eval.c (Init_vm_eval): define module_eval, class_eval and eval
- here for rdoc.
-
-Fri Sep 26 00:40:30 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * range.c (range_inspect): fix SEGV for cyclic range object.
- [ruby-core:18835]
-
-Thu Sep 25 23:59:56 2008 Tanaka Akira <akr@fsij.org>
-
- * common.mk: dependency updated.
-
-Thu Sep 25 21:46:48 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode.c (rb_eUndefinedConversionError): renamed from
- rb_eConversionUndefinedError.
- (rb_eConverterNotFoundError): renamed from rb_eNoConverterError.
-
-Thu Sep 25 21:23:08 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * pack.c (pack_pack, pack_unpack): 'm0' format (base64) complies with
- RFC 4648. It adds no line feed when encoding, and raise ArgumentError
- if the encoded string contains non-alphabet (including CR and LF).
-
- * lib/base64.rb: added. This provides encoding/decoding method for
- Base64 in standard RFC 2045, Base64 in standard RFC 4648 and ``Base 64
- Encoding with URL and Filename SafeAlphabet'' in RFC 4648.
-
- * test_pack.c, test/base64/test_base64.rb: add tests for above.
-
-Thu Sep 25 21:00:32 2008 Koichi Sasada <ko1@atdot.net>
-
- * common.mk: fix btest-* rules [ruby-dev:36528].
- and remove obsolete rules.
-
-Thu Sep 25 20:27:54 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * class.c (rb_make_metaclass): [BUG] Fixed a bus error
- on the case for metaclass of a class which includes a
- module.
-
-Thu Sep 25 19:34:33 2008 Eric Hodel <drbrain@segment7.net>
-
- * test/rubygems/*: Update some new tests to use build_rake_in.
- * test/rubygems/gemutilities.rb: Fix broken merge of rake detection.
-
-Thu Sep 25 19:13:12 2008 Eric Hodel <drbrain@segment7.net>
-
- * lib/rubygems*: Update to RubyGems 1.3.0 r1891.
-
-Thu Sep 25 18:40:42 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * class.c (rb_make_metaclass): Made class of class of class
- from Class into its own eigenclass. Now meta^(n)-class
- hierarchy regresses infinitely, again.
- (This feature was decided on developer-meeting-20080922.)
-
-Thu Sep 25 16:01:07 2008 Jim Weirich <jim@tardis.local>
-
- * lib/rake.rb: Update rake source to version 0.8.3. This
- version includes some fixes for running Rake on windows.
- (1) better APPDATA/HOMExxx/USERPROFILE integration for
- system rakefiles, (2) Better handling of the :ruby command
- when installed in directory containing spaces.
-
-Thu Sep 25 11:22:51 2008 Eric Hodel <drbrain@segment7.net>
-
- * lib/rdoc*: Update to RDoc 2.2.1 r185.
-
-Thu Sep 25 02:08:47 2008 Tanaka Akira <akr@fsij.org>
-
- * io.c (rb_io_mode_enc): make it static.
-
-Thu Sep 25 01:22:39 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/mini/test.rb (Mini::Assertions#assert_raise): fixed typo.
-
-Wed Sep 24 23:39:00 2008 Takeyuki Fujioka <xibbar@ruby-lang.org>
-
- * test/cgi/test_cgi_multipart.rb : revert last change.
- ( deprecated is assert_raises. )
- * test/cgi/test_cgi_core.rb : ditto.
- * test/cgi/test_cgi_header.rb : ditto.
-
-Wed Sep 24 23:12:49 2008 Takeyuki Fujioka <xibbar@ruby-lang.org>
-
- * lib/cgi/core.rb (CGI::new, CGI::{accept_charset,accept_charset=}) :
- accept parameters either in a hash,
- string as a block. add the encoding validation process.
- * test/cgi/test_cgi_core.rb : test for query encoding check.
-
-Wed Sep 24 22:58:18 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * string.c (rb_str_rstrip_bang): raise exception when the encoding of
- the string is dummy.
-
- * string.c (rb_str_rstrip_bang): remove nul characters even if the
- encoding of the string is not single byte optimizable.
- fixed [ruby-core:18844], reported by Michael Selig.
-
-Wed Sep 24 19:01:45 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * string.c (rb_str_rstrip_bang): workaround for VC++8 x64.
-
-Wed Sep 24 17:44:44 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * complex.c (Init_Complex), rational.c (Init_Rational): undefines
- default #allocate methods which call the allocator.
-
-Wed Sep 24 17:02:14 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * complex.c (Init_Complex), rational.c (Init_Rational): ID_ALLOCATOR
- differs from :allocate, and invisible in ruby level.
-
-Wed Sep 24 15:58:52 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * string.c (rb_str_rstrip_bang): removing mixed spaces and nuls at
- the end of strings. [ruby-dev:36497]
-
-Wed Sep 24 15:13:04 2008 Takeyuki Fujioka <xibbar@ruby-lang.org>
-
- * test/cgi/test_cgi_multipart.rb : test for miniunit.
- * test/cgi/test_cgi_core.rb : ditto.
- * test/cgi/test_cgi_header.rb : ditto.
-
-Wed Sep 24 14:38:29 2008 NAKAMURA Usaku <usa@ruby-lang.org>
+Mon Jan 26 11:12:03 2009 NAKAMURA Usaku <usa@ruby-lang.org>
* lib/tmpdir.rb: setup buffer with nul characters instead of spaces.
fixed [ruby-dev:36493]
-Wed Sep 24 11:18:33 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * io.c (rb_io_s_binread): offset argument was wrongly passed to
- internal IO#read call. [ruby-core:18810]
-
-Wed Sep 24 07:38:23 2008 URABE Shyouhei <shyouhei@ruby-lang.org>
-
- * vm_core.h: ruby/ruby.h should be included at the very first
- place in an entire compilation unit, as it includes
- ruby/config.h
-
-Wed Sep 24 06:41:24 2008 Ryan Davis <ryand-ruby@zenspider.com>
-
- * lib/test/*: removed test/unit.
- * lib/test/*: added miniunit.
- * lib/mini/*: ditto.
-
-Wed Sep 24 04:45:35 2008 Koichi Sasada <ko1@atdot.net>
-
- * include/ruby/node.h, node.h: move node.h from include path.
- This change stop to install node.h because of saving ABI
- (node.h will be changed. Extensions should not depends on
- this file).
-
- * blockinlining.c, class.c, compile.c, debug.h, enum.c,
- gc.c, iseq.c, parse.y, ruby.c, signal.c, variable.c,
- vm.c, vm_core.h, vm_dump.c: ditto.
-
- * ext/ripper/depend: ditto.
-
-Wed Sep 24 04:09:13 2008 Koichi Sasada <ko1@atdot.net>
-
- * vm_core.h: remove unused frame values.
-
-Wed Sep 24 04:07:07 2008 Koichi Sasada <ko1@atdot.net>
-
- * signal.c (signal_exec): execute rb_eval_cmd() directly.
-
-Wed Sep 24 03:08:58 2008 Eric Hodel <drbrain@segment7.net>
-
- * lib/uri/mailto.rb: fix indentation.
- * lib/uri/generic.rb: ditto.
- * lib/yaml.rb: ditto.
- * lib/uri/cgi/core.rb: fix indentation and ambiguous argument warning.
-
-Tue Sep 23 23:39:25 2008 James Edward Gray II <jeg2@ruby-lang.org>
-
- * lib/csv/csv.rb: Improved the idea of whitespace and word characters used
- in substitutions during header conversion as suggested by Michael Selig.
-
-Tue Sep 23 21:50:53 2008 Tanaka Akira <akr@fsij.org>
-
- * io.c (io_binwrite): allocate wbuf if nosync.
-
-Tue Sep 23 21:45:02 2008 Tanaka Akira <akr@fsij.org>
-
- * io.c (copy_stream_body): use io_binwrite instead of io_fwrite.
-
-Tue Sep 23 21:31:16 2008 Tadayoshi Funaba <tadf@dotrb.org>
-
- * test/ruby/test_rational2.rb: updated.
-
- * test/ruby/test_complex2.rb: added.
-
- * test/ruby/test_complexrational.rb: added.
-
-Tue Sep 23 21:26:32 2008 Tanaka Akira <akr@fsij.org>
-
- * string.c (rb_str_casecmp): make the ordering consistent with
- String#<=>.
-
-Tue Sep 23 20:52:25 2008 Tanaka Akira <akr@fsij.org>
-
- * io.c (io_binwrite): add nosync argument.
- (do_writeconv): extracted from io_fwrite.
- (io_fwrite): add nosync argument. use do_writeconv.
- (io_write): add nosync argument.
- (io_write_m): new function for IO#write.
- (rb_p): don't append record separator.
-
-Tue Sep 23 20:24:41 2008 Koichi Sasada <ko1@atdot.net>
-
- * signal.c (signal_exec): fix to use rb_proc_call().
-
-Tue Sep 23 20:06:46 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
+Sun Jan 25 00:07:23 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
* lib/rexml/formatters/pretty.rb (REXML::Formatters::Pretty#wrap):
abandon wrapping if the line contains no space. [ruby-dev:36045]
+ fix: #342
-Tue Sep 23 19:38:03 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/win32.c (subtract): check tv_sec. reported by ko1.
-
-Tue Sep 23 19:21:03 2008 Tadayoshi Funaba <tadf@dotrb.org>
-
- * complex.c (nucomp_s_canonicalize_internal): does no apply
- canonicalization rule anymore.
-
- * rational.c (nurat_s_canonicalize_internal(_no_reduce)?): ditto.
-
- * complex.c: removed class method new! and new.
-
- * rational.c: ditto.
-
-Tue Sep 23 19:20:59 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * io.c (rb_io_s_binread): a new method to read binary chunk from a
- file. [ruby-core:18674]
-
- * io.c (open_key_args): wrong permission specified for read-open.
-
-Tue Sep 23 18:24:34 2008 Tanaka Akira <akr@fsij.org>
-
- * hash.c (rb_obj_is_proc): declaration moved for rdoc.
-
-Tue Sep 23 18:07:55 2008 Koichi Sasada <ko1@atdot.net>
-
- * common.mk (io.o): remove dependency for vm_core.h.
-
-Tue Sep 23 17:56:44 2008 Koichi Sasada <ko1@atdot.net>
-
- * thread.c (rb_thread_blocking_region): fix typo in a document.
-
-Tue Sep 23 17:50:35 2008 Koichi Sasada <ko1@atdot.net>
-
- * thread.c (rb_thread_blocking_region): write a document.
-
-Tue Sep 23 17:14:31 2008 Koichi Sasada <ko1@atdot.net>
-
- * thread.c, include/ruby/intern.h (rb_thread_interrupted): added.
-
- * io.c: use VALUE of thead instead of rb_tread_t to check interrupts.
-
-Tue Sep 23 17:05:14 2008 Koichi Sasada <ko1@atdot.net>
-
- * class.c, vm_core.h: move decl of rb_iseq_clone() to class.c.
-
-Tue Sep 23 17:02:47 2008 Tanaka Akira <akr@fsij.org>
-
- * debug.h (ruby_set_debug_option): declared.
-
- * main.c: include debug.h.
-
- * common.mk (main.$(OBJEXT)): dependency updated.
-
-Tue Sep 23 16:59:45 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * hash.c (ENVMATCH, ENVNMATCH): reduced same code.
-
-Tue Sep 23 16:55:11 2008 Koichi Sasada <ko1@atdot.net>
-
- * ruby.h: fix comment and rename macro HAVE_RUBY_MVM_H to
- HAVE_RUBY_VM_H.
-
-Tue Sep 23 16:41:31 2008 Koichi Sasada <ko1@atdot.net>
-
- * include/ruby/node.h, vm_core.h: move definition of
- RUBY_VM_METHOD_NODE to node.h.
-
- * class.c, common.mk: remove useless inclusion.
-
- * compile.h, iseq.h, vm_core.h: rename compile.h to iseq.h.
- move some definitions from vm_core.h to iseq.h.
-
- * compile.c, iseq.c, vm.c: ditto.
-
- * eval.c, compile.c: move some functions for parser
- from eval.c to compile.c.
-
- * eval_intern.h, vm_core.h: move va_init_list() macro to
- vm_core.h.
-
- * iseq.c (rb_iseq_new_top, rb_iseq_first_lineno): added.
-
- * load.c, ruby.c: use rb_iseq_new_top() instead of
- rb_iseq_new() with ISEQ_TYPE_TOP constant directly.
-
- * proc.c: use rb_iseq_first_lineno() instead of accessing
- iseq structure.
-
-Tue Sep 23 16:17:54 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * ext/ripper/eventids2.c (token_to_eventid): supper __ENCODING__
- keyword. [ruby-dev:36478]
-
-Tue Sep 23 15:30:53 2008 Koichi Sasada <ko1@atdot.net>
-
- * common.mk, hash.c: remove unused inclusion.
-
-Tue Sep 23 09:52:07 2008 Koichi Sasada <ko1@atdot.net>
-
- * eval_safe.c, safe.c: rename eval_safe.c to safe.c.
-
- * common.mk, eval.c, safe.c, inits.c: separate safe.c from eval.c and
- make Init_safe().
-
-Tue Sep 23 09:20:00 2008 Koichi Sasada <ko1@atdot.net>
-
- * common.mk: clean up
- - remove blockinlining.$(OBJEXT) to built
- - make ENCODING_H_INCLDUES variable (include/ruby/encoding.h)
- - make VM_CORE_H_INCLUDES variable (vm_core.h)
- - simplify rules.
- - make depends rule to output depend status using gcc -MM.
-
- * include/ruby/mvm.h, include/ruby/vm.h: rename mvm.h to vm.h.
-
- * include/ruby.h: ditto.
-
- * load.c: add inclusion explicitly.
-
- * enumerator.c, object.c, parse.y, thread.c, vm_dump.c:
- remove useless inclusion.
-
- * eval_intern.h: cleanup inclusion.
-
- * vm_core.h: rb_thread_t should be defined in this file.
-
- * vm_evalbody.c, vm_exec.c: rename vm_evalbody.c to vm_exec.c.
-
- * vm.h, vm_exec.h: rename vm.h to vm_exec.h.
-
- * insnhelper.h, vm_insnhelper.h: rename insnhelper.h to vm_insnhelper.h.
-
- * vm.c, vm_insnhelper.c, vm_insnhelper.h:
- - rename vm_eval() to vm_exec_core().
- - rename vm_eval_body() to vm_exec().
- - cleanup include order.
-
- * vm_method.c: fix comment.
-
-Tue Sep 23 09:01:15 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * lib/pathname.rb (each_filename): return Enumerator if no block
- given.
-
- * test/pathname/test_pathname.rb: add a test for above.
-
-Tue Sep 23 08:25:56 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * hash.c (env_aset): allow nil value to remove an entry.
- [ruby-dev:36465]
-
- * test/ruby/test_env.rb (TestEnv#test_aset): test updated.
-
-Tue Sep 23 08:07:07 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * misc/ruby-mode.el (ruby-keyword-end-re): emacs21 support. a
- patch from Hiroshi Moriyama <hiroshi at kvd.biglobe.ne.jp> in
- [ruby-dev:36471].
-
- * misc/ruby-mode.el (ruby-in-ppss-context-p): ditto.
-
- * misc/ruby-mode.el (ruby-here-doc-end-syntax):
-
-Tue Sep 23 02:07:52 2008 TAKAO Kouji <kouji@takao7.net>
-
- * test/readline/test_readline_history.rb
- (Readline::TestHistory#test_each): checked return value.
-
-Tue Sep 23 02:05:34 2008 TAKAO Kouji <kouji@takao7.net>
-
- * ext/readline/readline.c (Init_readline): used remove_history to
- check offset of history if unsupported clear_history.
-
-Mon Sep 22 17:39:25 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/tempfile.rb (Tempfile#open): should return a value from the
- block (if given). [ruby-core:18394]
-
-Mon Sep 22 11:17:51 2008 URABE Shyouhei <shyouhei@ruby-lang.org>
-
- * include/ruby/encoding.h (enum): ISO C forbids comma at end of
- enumerator list
-
-Mon Sep 22 10:15:24 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * LEGAL: updated file names removed and added. [ruby-dev:36426]
-
-Mon Sep 22 02:39:05 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * encoding.c (get_default_external): add description.
-
-Sun Sep 21 21:52:41 2008 Tadayoshi Funaba <tadf@dotrb.org>
-
- * math.c (math_log): should check argc.
-
-Sun Sep 21 21:20:24 2008 Tadayoshi Funaba <tadf@dotrb.org>
-
- * complex.c: added two macros.
-
- * rational.c: ditto.
-
-Sun Sep 21 18:06:38 2008 Tadayoshi Funaba <tadf@dotrb.org>
-
- * complex.c (nucomp_s_convert): checks argc.
-
- * rational.c (nurat_s_convert): ditto.
-
-Sun Sep 21 10:19:04 2008 Tadayoshi Funaba <tadf@dotrb.org>
-
- * complex.c (nucomp_s_canonicalize_internal): checks exactness of
- imag only.
-
- * rational.c (nurat_s_convert): accepts non real value
- (Rational(a,b) as a/b).
-
- * complex.c (nucomp_s_convert): refined.
-
-Sun Sep 21 09:37:57 2008 James Edward Gray II <jeg2@ruby-lang.org>
-
- * lib/csv/csv.rb: Reworked CSV's parser and generator to be m17n. Data
- is now parsed in the Encoding it is in without need for translation.
- * lib/csv/csv.rb: Improved inspect() messages for better IRb support.
- * lib/csv/csv.rb: Fixed header writing bug reported by Dov Murik.
- * lib/csv/csv.rb: Use custom separators in parsing header Strings as
- suggested by Shmulik Regev.
- * lib/csv/csv.rb: Added a :write_headers option for outputting headers.
- * lib/csv/csv.rb: Handle open() calls in binary mode whenever we can to
- workaround a Windows issue where line-ending translation can cause an
- off-by-one error in seeking back to a non-zero starting position after
- auto-discovery for :row_sep as suggested by Robert Battle.
- * lib/csv/csv.rb: Improved the parser to fail faster when fed some forms
- of invalid CSV that can be detected without reading ahead.
- * lib/csv/csv.rb: Added a :field_size_limit option to control CSV's
- lookahead and prevent the parser from biting off more data than
- it can chew.
- * lib/csv/csv.rb: Added readers for CSV attributes: col_sep(), row_sep(),
- quote_char(), field_size_limit(), converters(), unconverted_fields?(),
- headers(), return_headers?(), write_headers?(), header_converters(),
- skip_blanks?(), and force_quotes?().
- * lib/csv/csv.rb: Cleaned up code syntax to be more inline with
- Ruby 1.9 than 1.8.
-
-Sun Sep 21 07:43:16 2008 Tadayoshi Funaba <tadf@dotrb.org>
-
- * complex.c: an instance method image has been removed and
- uses "imag" instead of "image".
-
- * complex.c: two instance method re and im are removed.
-
- * rational.c: follows the above changes.
-
- * include/ruby/ruby.h: ditto.
-
- * gc.c: ditto.
-
- * lib/cmath.rb: ditto.
-
- * lib/mathn.rb: ditto.
-
- * lib/complex.rb: ditto. and provides some obsolete methods.
-
-Sun Sep 21 02:48:45 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * ext/json/ext/parser/parse.c: use ruby_xfree().
-
- * ext/json/ext/parser/parse.rl: ditto.
-
- * ext/json/ext/parser/unicode.c: ditto.
-
-Sun Sep 21 02:40:20 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * ext/json: import JSON v 1.1.3.
-
-Sat Sep 20 11:43:08 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * lib/optparse.rb (summarize): separator "" should output new line.
-
-Sat Sep 20 08:07:34 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * parse.y: strings which contain only US-ASCII don't force to have
- US-ASCII encoding. [ruby-dev:36400]
-
-Sat Sep 20 07:59:31 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * re.c (rb_reg_desc): Regexps of ASCII Compatible encoding may
- contain non-ASCII characters. So in that case its encoding
- must keep original encoding.
-
-Sat Sep 20 07:44:56 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * common.mk: prec.c is removed.
-
-Fri Sep 19 22:37:25 2008 Tadayoshi Funaba <tadf@dotrb.org>
-
- * complex.c: uses f_(in)?exact_p macro.
-
- * rational.c: ditto.
-
- * bignum.c (rb_big_pow): bignum**bignum - should calculate without
- rational.
-
- * lib/complex.rb: should override Math module at most once.
-
- * lib/mathn.rb: requires 'cmath' directly.
-
-Fri Sep 19 20:48:06 2008 Yuki Sonoda <yugui@yugui.jp>
-
- * prec.c: removed. Precision will be redesigned and be back again.
- c.f. [ruby-dev:36352].
-
- * common.mk (COMMON_OBJS): removed prec.o.
-
- * inits.c (rb_call_inits): removed Init_Precision.
-
- * numeric.c (Init_Numeric): removed inclusion of Precision.
- removed #induced_from from each class.
-
- * rational.c: ditto.
-
- * ext/bigdecimal/bigdecimal.c: ditto.
-
- * lib/rdoc/known_classes.rb: removed the entry for Precision.
-
- * test/ruby/test_prec.rb: removed.
-
- * test/ruby/test_integer.rb: removed tests for Precision.
-
- * test/ruby/test_fixnum.rb: ditto.
-
- * test/ruby/test_float.rb: ditto.
-
- * test/ruby/test_rational.rb: ditto.
-
- * test/ruby/test_complex.rb: ditto.
-
- * test/bigdecimal/test_bigdecimal.rb: ditto.
-
-Fri Sep 19 19:43:40 2008 Yuki Sonoda <yugui@yugui.jp>
-
- * common.mk : Reverts the changeset 18994.
- Uses the official repository of rubyspec again.
-
-Fri Sep 19 17:41:56 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * configure.in: applied OS/2 support patch from Brendan Oakley
- <gentux2 at gmail.com> in [ruby-core:18707].
-
-Fri Sep 19 09:29:26 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * dln.c: newer BeOS support. a patch from Pete Goodeve
- <pete.goodeve at computer.org> in [ruby-core:18712].
-
-Fri Sep 19 03:41:25 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * ext/nkf/nkf-utf8/nkf.c: fix memory violation. mentioned by mame [ruby-dev:36373]
-
-Fri Sep 19 01:07:36 2008 Tanaka Akira <akr@fsij.org>
-
- * regexec.c (string_cmp_ic): add text_end argument.
- (slow_search): call enclen with real string end.
- (map_search): add text_end argument.
-
-Thu Sep 18 22:54:39 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * ext/openssl/ossl_pkey_ec.c (ossl_ec_key_to_string): comment out
- fragments of unused code.
-
-Thu Sep 18 22:35:03 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * ext/bigdecimal/bigdecimal.c (VpCtoV): 1E1000...000 is interpreted as
- Infinity. [ruby-dev:36159]
-
- * ext/bigdecimal/bigdecimal.c (VpPower): Infinity ** 1 returns
- Infinity instead of NaN. [ruby-dev:36159]
-
- * test/bigdecimal/test_bigdecimal.rb: add tests for above.
-
-Thu Sep 18 22:20:08 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * error.c (Init_Exception): introduce EncodingError which is a
- superclass for all encoding related exception classes,
- e.g. Encoding::CompatibilityError. [ruby-dev:36371]
-
- * transcode.c (Init_transcode): ditto.
-
-Thu Sep 18 21:57:32 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * string.c (rb_str_comparable): make ascii8bit string to be
- compatible with any other encoding.
-
- * string.c (rb_str_cmp): use rb_str_comparable() instead of
- rb_enc_compatible() since <=> is a comparison anyway.
-
-Thu Sep 18 21:37:14 2008 Tanaka Akira <akr@fsij.org>
-
- * grapheme cluster implementation reverted. [ruby-dev:36375]
-
-Thu Sep 18 20:50:36 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/rake.rb (Rake::Application#standard_exception_handling):
- replaced magic numbers for exit status.
-
-Thu Sep 18 20:37:59 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/optparse.rb (OptionParser::ParseError#set_backtrace): omits
- OptionParser internal backtraces unless debug flag is set.
-
-Thu Sep 18 20:02:48 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * lib/uri/common.rb (unescape): skip '%' to make String#hex work
- correctly.
-
-Thu Sep 18 19:51:11 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * bignum.c (big2str_karatsuba): free internal buffer eagerly.
- a patch from TOYOFUKU Chikanobu <nobu_toyofuku at nifty.com>
- in [ruby-dev:36217].
-
- * bignum.c (rb_big2str0): ditto.
-
-Thu Sep 18 19:43:04 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * st.c (new_size): raise RuntimeError when st_table is too big.
- [ruby-dev:36354]
-
-Thu Sep 18 18:23:23 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode.c (enc_arg): must take pointer argument to avoid GC
- problem. StringValueCStr modifies the argument and it should be
- preserved while the string StringValueCStr returns is used.
- Since the string is used by caller, the modified argument should be
- hold by caller. Actually
- GC.stress = true
- def (o=Object.new).to_str()
- "universal"+"_newline"
- end
- "\u3042".encode(o, "")
- causes curious warning:
- rb_define_const: invalid name `' for constant
-
-Thu Sep 18 17:32:44 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * transcode.c: add "Error" suffix for Encoding exception classes.
- a patch from Tadashi Saito <shiba at mail2.accsnet.ne.jp> in
- [ruby-dev:36346].
-
- * encoding.c (Init_Encoding): rename EncodingCompatibilityError to
- Encoding::CompatibilityError. [ruby-dev:36366]
-
-Thu Sep 18 17:18:35 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * transcode.c (enc_arg): revert last change. too early exception
- raising.
-
- * transcode.c (enc_arg): need not to take pointer argument.
-
-Sun Sep 18 02:22:15 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * test/bigdecimal/test_bigdecimal.rb: add tests to achieve over 90%
- test coverage of bigdecimal.
-
-Wed Sep 17 21:50:14 2008 Tanaka Akira <akr@fsij.org>
-
- * string.c (rb_str_casecmp): don't use rb_enc_codepoint.
-
-Wed Sep 17 19:55:33 2008 Tadayoshi Funaba <tadf@dotrb.org>
-
- * complex.c (nucomp_s_convert): accepts complex
- value (Complex(a,b) as a+bi).
-
-Wed Sep 17 19:16:47 2008 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-
- * test/ruby/test_io.rb (TestIO#test_dup): avoid infinite loop.
- [ruby-dev:36326]
-
- * test/ruby/test_io.rb (TestIO#test_dup): remove needless open.
- [ruby-dev:35957]
-
-Wed Sep 17 17:44:59 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * io.c (rb_io_extract_modeenc): process option mode: and perm: as
- well.
-
- * io.c (open_key_args): move mode: and perm: related code to
- rb_io_extract_modeenc().
-
-Wed Sep 17 13:42:59 2008 Takeyuki Fujioka <xibbar@ruby-lang.org>
-
- * lib/cgi/html.rb (checkbox_group,radio_group): bug fix
- use size instead of bytesize.
-
- * test/cgi/test_cgi_tag_helper.rb: test for checkbox_group,radio_group.
-
-Wed Sep 17 06:58:31 2008 Tadayoshi Funaba <tadf@dotrb.org>
-
- * numeric.c: provides predicate real? instead of scalar?.
-
- * complex.c: follows the above change.
-
- * lib/cmath.rb: ditto.
-
-Wed Sep 17 01:56:27 2008 Tanaka Akira <akr@fsij.org>
-
- * test/ruby/test_io_m17n.rb: use __FILE__ instead of /dev/null.
- [ruby-dev:36327]
-
-Wed Sep 17 01:33:11 2008 Tanaka Akira <akr@fsij.org>
-
- * include/ruby/oniguruma.h (OnigEncodingTypeST): add precise_ret
- argument for mbc_to_code.
- (ONIGENC_MBC_TO_CODE): provide NULL for precise_ret.
- (ONIGENC_MBC_PRECISE_CODEPOINT): defined.
-
- * include/ruby/encoding.h (rb_enc_mbc_precise_codepoint): defined.
-
- * regenc.h (onigenc_single_byte_mbc_to_code): precise_ret argument
- added.
- (onigenc_mbn_mbc_to_code): ditto.
-
- * regenc.c (onigenc_single_byte_mbc_to_code): precise_ret argument
- added.
- (onigenc_mbn_mbc_to_code): ditto.
-
- * string.c (count_utf8_lead_bytes_with_word): removed.
- (str_utf8_nth): removed.
- (str_utf8_offset): removed.
- (str_strlen): UTF-8 codepoint oriented optimization removed.
- (rb_str_substr): ditto.
- (enc_succ_char): use rb_enc_mbc_precise_codepoint.
- (enc_pred_char): ditto.
- (rb_str_succ): ditto.
-
- * encoding.c (rb_enc_ascget): check length with
- rb_enc_mbc_precise_codepoint.
- (rb_enc_codepoint): use rb_enc_mbc_precise_codepoint.
-
- * regexec.c (string_cmp_ic): add text_end argument.
- (match_at): check end of character after exact string matches.
-
- * enc/utf_8.c (grapheme_table): defined for extended grapheme cluster
- boundary.
- (grapheme_cmp): defined.
- (get_grapheme_properties): defined.
- (grapheme_boundary_p): defined.
- (MAX_BYTES_LENGTH): defined.
- (comb_char_enc_len): defined.
- (mbc_to_code0): extracted from mbc_to_code.
- (mbc_to_code): use mbc_to_code0.
- (left_adjust_combchar_head): defined.
- (utf_8): use a extended grapheme cluster as a unit.
-
- * enc/unicode.c (onigenc_unicode_mbc_case_fold): use
- ONIGENC_MBC_PRECISE_CODEPOINT to extract codepoints.
- (onigenc_unicode_get_case_fold_codes_by_str): ditto.
-
- * enc/euc_jp.c (mbc_to_code): follow mbc_to_code field change.
- use onigenc_mbn_mbc_to_code.
-
- * enc/shift_jis.c (mbc_to_code): ditto.
-
- * enc/emacs_mule.c (mbc_to_code): ditto.
-
- * enc/gbk.c (gbk_mbc_to_code): follow mbc_to_code field and
- onigenc_mbn_mbc_to_code change.
-
- * enc/cp949.c (cp949_mbc_to_code): ditto.
-
- * enc/big5.c (big5_mbc_to_code): ditto.
-
- * enc/euc_tw.c (euctw_mbc_to_code): ditto.
-
- * enc/euc_kr.c (euckr_mbc_to_code): ditto.
-
- * enc/gb18030.c (gb18030_mbc_to_code): ditto.
-
- * enc/utf_32be.c (utf32be_mbc_to_code): follow mbc_to_code field
- change.
-
- * enc/utf_16be.c (utf16be_mbc_to_code): ditto.
-
- * enc/utf_32le.c (utf32le_mbc_to_code): ditto.
-
- * enc/utf_16le.c (utf16le_mbc_to_code): ditto.
-
-Wed Sep 17 01:17:12 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * transcode.c (enc_arg): raise exception when unknown encoding is
- given.
-
-Tue Sep 16 22:23:24 2008 Takeyuki Fujioka <xibbar@ruby-lang.org>
-
- * lib/cgi/core.rb (CGI#header): performance improvement.
- From CGIAlt http://cgialt.rubyforge.org/
-
- * test/cgi/test_cgi_header.rb: exception class fixed.
-
-Tue Sep 16 22:21:33 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * string.c (rb_str_concat): fix rdoc. (codepoint is integer)
-
- * string.c (rb_str_each_codepoint): use UINT2NUM.
-
-Tue Sep 16 21:48:55 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * re.c (rb_reg_desc): Regexp#inspect should be US-ASCII.
-
-Tue Sep 16 21:33:22 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * string.c (rb_str_crypt): orthodox crypt() sees only first two bytes
- of salt.
-
-Tue Sep 16 19:18:40 2008 Tadayoshi Funaba <tadf@dotrb.org>
-
- * complex.c (nucomp_marshal_{dump,load}): preserve instance
- variables.
-
- * rational.c (nurat_marshal_{dump,load}): ditto.
-
-Tue Sep 16 18:28:52 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * io.c (rb_io_gets_m): rdoc updated. limit counts in bytes.
- [ruby-core:18617]
-
- * io.c (rb_io_readlines, rb_f_gets): ditto.
-
- * io.c (rb_io_readbyte): rdoc updated. [ruby-core:18617]
-
-Tue Sep 16 11:55:16 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * string.c (rb_str_each_codepoint): add new methods, #codepoints
- and #each_codepoint. a patch from Michael Selig
- <michael.selig at fs.com.au> in [ruby-core:18532].
-
-Tue Sep 16 11:24:44 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * ext/socket/mkconstants.rb: add new constants. a patch from
- IWAMURO Motonori <deenheart+ruby at gmail.com> in [ruby-dev:36309].
-
-Tue Sep 16 09:20:42 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * test/ruby/test_io.rb (TestIO#test_dup): exception should be
- raised from IO#dup.
-
-Tue Sep 16 08:35:29 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * test/ruby/test_io.rb (TestIO#test_dup): this test might fail if
- there are any garbage IO objects.
-
-Tue Sep 16 02:02:56 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * string.c (rb_str_buf_cat_ascii): codepoint is unsigned int.
-
- * string.c (rb_str_concat): ditto.
-
- * string.c (str_cat_char): ditto.
-
- * string.c (prefix_escape): ditto.
-
-Tue Sep 16 01:47:07 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * string.c (single_byte_optimizable): make function inline. based
- on a patch from Michael Selig <michael.selig at fs.com.au> in
- [ruby-core:18532].
-
- * string.c (str_modify_keep_cr): new function act as
- rb_str_modify(), but don't clear coderange
-
- * string.c (rb_str_casecmp): specialized for single byte strings.
-
- * string.c (rb_str_splice): preserve coderange.
-
- * string.c (rb_str_slice_bang, rb_str_reverse_bang,
- rb_str_upcase_bang, rb_str_downcase_bang, tr_trans,
- rb_str_capitalize_bang, rb_str_swapcase_bang,
- rb_str_delete_bang, rb_str_chop_bang, rb_str_chomp_bang,
- rb_str_lstrip_bang, rb_str_rstrip_bang): ditto.
-
- * string.c (rb_str_clear): preset coderange.
-
- * string.c (rb_str_split_m): specialized for splitting with a
- string.
-
-Tue Sep 16 00:57:56 2008 Tanaka Akira <akr@fsij.org>
-
- * re.c (rb_reg_quote): use rb_enc_mbcput to generate ASCII
- incompatible characters properly.
-
-Tue Sep 16 00:51:59 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * encoding.c (Encoding#base_encoding): removed. [ruby-dev:36270]
-
-Tue Sep 16 00:40:56 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode_data.h (STR1_LENGTH): defined.
- (makeSTR1LEN): defined.
-
- * tool/transcode-tblgen.rb: use makeSTR1LEN. generate STR1 for 4 to
- 259 bytes.
-
- * transcode.c (rb_transcoding): new field: output_index.
- (transcode_restartable0): use STR1_LENGTH.
-
-Mon Sep 15 23:52:45 2008 Koichi Sasada <ko1@atdot.net>
-
- * gc.c, include/ruby/ruby.h: rename rb_register_mark_object()
- to rb_gc_register_mark_object().
-
- * eval.c, vm.c: initialize vm->mark_object_ary at
- Init_top_self().
-
- * bignum.c, complex.c, encoding.c, ext/win32ole/win32ole.c,
- io.c, load.c, marshal.c, rational.c, ruby.c, vm.c:
- use rb_gc_register_mark_object() instead of
- rb_global_variable() or rb_gc_register_address().
-
-Mon Sep 15 23:37:15 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode.c (econv_opts): don't use to_sym.
-
-Mon Sep 15 23:28:28 2008 Tanaka Akira <akr@fsij.org>
-
- * encoding.c (rb_enc_get_index): don't return -1.
-
- * io.c (rb_scan_open_args): call FilePathValue before encoding
- conversion.
-
-Mon Sep 15 22:11:07 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * string.c (rb_str_squeeze_bang): specialized for 7bit characters in
- ASCII compatible strings.
-
- * string.c (rb_str_count): ditto.
-
- * string.c (tr_trans): preserve 7bit/valid coderange flag.
-
- * string.c (rb_str_squeeze_bang): preserve previous coderange value.
-
- * string.c (rb_str_lstrip_bang): ditto.
-
- * string.c (rb_str_rstrip_bang): ditto.
-
- * encoding.c (rb_default_external_encoding): preserve
- default_external_encoding in a static variable.
-
- * string.c (single_byte_optimizable): check coderange first, to
- reduce number of calling rb_enc_from_index().
-
-Mon Sep 15 20:57:00 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * lib/matrix.rb (Matrix#eql?): fixed [ruby-dev:36298].
- Reported by an anonymous user.
-
- * lib/matrix.rb (Vector#eql?): ditto.
-
- * (Matrix#compare_by_row_vectors): takes comparison
- strategy as an optional parameter.
-
- * (Vector#compare_by): ditto.
-
-Mon Sep 15 14:34:32 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * encoding.c (RUBY_MAX_CHAR_LEN): defined.
-
- * encoding.c (str_cat_char): use RUBY_MAX_CHAR_LEN.
-
-Mon Sep 15 13:53:33 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * encoding.c (rb_enc_compatible): accept other than strings and
- regexps. [ruby-core:18595]
-
- * encoding.c (rb_enc_get_index): works files and encodings.
-
-Mon Sep 15 13:17:21 2008 Tadayoshi Funaba <tadf@dotrb.org>
-
- * complex.c (nucomp_eql_p): new.
-
- * complex.c (nucomp_hash): should use hash values of the elements.
-
- * rational.c (nurat_hash): ditto.
-
- * hash.c (rb_any_cmp): removed an unused variable.
-
-Mon Sep 15 11:11:04 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode_data.h (rb_transcoder): resetsize_func and resetstate_func
- also returns ssize_t.
-
- * enc/trans/iso2022.trans: follow the type change.
-
-Mon Sep 15 10:28:10 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * test/matrix/test_matrix.rb (setup): typo.
- (test_equality): misdefinition of the expected working.
- Reported by an anonymous user.
- (test_hash): added.
-
- * test/matrix/test_vector.rb: ditto.
-
-Mon Sep 15 03:33:10 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode_data.h: return output functions ssize_t.
-
- * transcode.c (transcode_restartable0): don't need to cast the result
- of output functions.
-
- * enc/trans/newline.trans: follow the type change.
-
- * enc/trans/escape.trans: ditto.
-
- * enc/trans/utf_16_32.trans: ditto.
-
- * enc/trans/iso2022.trans: ditto.
-
- * enc/trans/japanese.trans: ditto.
-
-Mon Sep 15 03:04:29 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode_data.h: output function takes output buffer size.
-
- * transcode.c: give output buffer size for output functions.
-
- * enc/trans/newline.trans: follow the type change.
-
- * enc/trans/escape.trans: ditto.
-
- * enc/trans/utf_16_32.trans: ditto.
-
- * enc/trans/iso2022.trans: ditto.
-
- * enc/trans/japanese.trans: ditto.
-
-Mon Sep 15 02:37:19 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * transcode.c (str_encode): returns duplicated string if nothing
- changed. [ruby-core:18578]
-
-Sun Sep 14 22:09:01 2008 Takeyuki Fujioka <xibbar@ruby-lang.org>
-
- * lib/cgi/core.rb (CGI::parse): performance improvement
-
-Sun Sep 14 18:33:32 2008 Tadayoshi Funaba <tadf@dotrb.org>
-
- * complex.c: trivial changes.
-
-Sun Sep 14 16:15:22 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
+Sun Jan 25 00:02:23 2009 Yuki Sonoda (Yugui) <yugui@yugui.jp>
* lib/matrix.rb (Vector#eql?): typo of the method name as "eqn?".
(Vector#eqn?): removed. Defined by mistake.
@@ -14007,1203 +344,37 @@ Sun Sep 14 16:15:22 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
* test/matrix/test_vector.rb: added.
-Sun Sep 14 16:07:04 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ruby.c (process_options): associates the locale encoding with $0 as
- well as ARGV.
-
-Sun Sep 14 13:48:03 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * object.c (Init_Object): added metameta-class initialization for
- BasicObject, Object, and Module.
- The metameta-classes of them are now the metaclass of Class, as the
- metameta-class of Class is.
-
- * object.c (boot_defmetametaclass): added.
-
-Sun Sep 14 10:10:43 2008 Tadayoshi Funaba <tadf@dotrb.org>
-
- * complex.c (f_{add,mul,sub}): omitted some shortcuts for preserving
- signed zero anyway.
-
- * complex.c (nucomp_negate): new.
-
-Sun Sep 14 04:15:16 2008 Tanaka Akira <akr@fsij.org>
-
- * include/ruby/oniguruma.h (OnigEncodingTypeST): add end argument for
- left_adjust_char_head.
- (ONIGENC_LEFT_ADJUST_CHAR_HEAD): add end argument.
- (onigenc_get_left_adjust_char_head): ditto.
-
- * include/ruby/encoding.h (rb_enc_left_char_head): add end argument.
-
- * regenc.h (onigenc_single_byte_left_adjust_char_head): ditto.
-
- * regenc.c (onigenc_get_right_adjust_char_head): follow the interface
- change.
- (onigenc_get_right_adjust_char_head_with_prev): ditto.
- (onigenc_get_prev_char_head): ditto.
- (onigenc_step_back): ditto.
- (onigenc_get_left_adjust_char_head): ditto.
- (onigenc_single_byte_code_to_mbc): ditto.
-
- * re.c: ditto.
-
- * string.c: ditto.
-
- * io.c: ditto.
-
- * regexec.c: ditto.
-
- * enc/euc_jp.c: ditto.
-
- * enc/cp949.c: ditto.
-
- * enc/shift_jis.c: ditto.
-
- * enc/gbk.c: ditto.
-
- * enc/big5.c: ditto.
-
- * enc/euc_tw.c: ditto.
-
- * enc/euc_kr.c: ditto.
-
- * enc/emacs_mule.c: ditto.
-
- * enc/gb18030.c: ditto.
-
- * enc/utf_8.c: ditto.
-
- * enc/utf_16le.c: ditto.
-
- * enc/utf_16be.c: ditto.
-
- * enc/utf_32le.c: ditto.
-
- * enc/utf_32be.c: ditto.
-
-Sun Sep 14 03:43:27 2008 Tanaka Akira <akr@fsij.org>
+Fri Jan 23 11:49:45 2009 Shugo Maeda <shugo@ruby-lang.org>
- * include/ruby/oniguruma.h (ONIGENC_STEP_BACK): add end argument.
- (onigenc_step_back): ditto.
-
- * regenc.c (onigenc_step_back): add end argument.
-
- * regexec.c: follow the interface change.
-
-Sun Sep 14 03:20:03 2008 Tanaka Akira <akr@fsij.org>
-
- * include/ruby/oniguruma.h (onigenc_get_prev_char_head): add end
- argument.
-
- * include/ruby/encoding.h (rb_enc_prev_char): ditto.
-
- * regenc.c (onigenc_get_prev_char_head): add end argument.
-
- * regparse.c: follow the interface change.
-
- * regexec.c: ditto.
-
- * string.c: ditto.
-
- * parse.y: ditto.
-
-Sun Sep 14 02:04:28 2008 Tanaka Akira <akr@fsij.org>
-
- * include/ruby/oniguruma.h
- (onigenc_get_right_adjust_char_head_with_prev): add end argument.
-
- * regenc.c (onigenc_get_right_adjust_char_head_with_prev): use end
- argument.
-
- * regexec.c (forward_search_range): follow the interface change.
-
-Sun Sep 14 01:38:26 2008 Tanaka Akira <akr@fsij.org>
-
- * include/ruby/oniguruma.h (onigenc_get_right_adjust_char_head): add
- end argument.
-
- * include/ruby/encoding.h (rb_enc_right_char_head): add end argument.
-
- * regenc.c (onigenc_get_right_adjust_char_head): use end argument.
-
- * re.c (rb_reg_adjust_startpos): follow the interface change.
-
- * string.c (rb_str_index): ditto.
-
- * regexec.c (backward_search_range): ditto.
- (onig_search): ditto.
-
-Sun Sep 14 00:43:28 2008 Tanaka Akira <akr@fsij.org>
-
- * ext/ripper/depend (ripper.o): it depends on ruby headers.
-
-Sat Sep 13 19:27:01 2008 Tanaka Akira <akr@fsij.org>
-
- * io.c (io_encoding_set): don't need argc argument.
- (rb_io_s_pipe): update io_encoding_set call.
- (rb_io_set_encoding): ditto.
-
-Sat Sep 13 18:46:41 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode.c (rb_transcoding): align state field.
-
-Sat Sep 13 18:21:09 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode.c (DECORATOR_P): renamed from SUPPLEMENTAL_CONVERSION.
-
-Sat Sep 13 18:05:37 2008 Tanaka Akira <akr@fsij.org>
-
- * io.c (make_writeconv): use rb_enc_name.
- (make_readconv): ditto.
-
- * transcode.c (rb_econv_open_opts): ditto.
- (econv_args): ditto.
- (decorate_convpath): ditto.
- (econv_set_replacement): ditto.
-
-Sat Sep 13 11:15:38 2008 Shugo Maeda <shugo@ruby-lang.org>
+ * NEWS: added an entry for REXML.
* lib/rexml/document.rb: fixed typo.
-Sat Sep 13 10:53:13 2008 Tadayoshi Funaba <tadf@dotrb.org>
-
- * complex.c: refined.
-
- * rational.c: ditto.
-
-Sat Sep 13 03:44:52 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode.c (rb_econv_prepare_opts): raise ArgumentError if
- a broken string is specified as a replacement.
-
-Sat Sep 13 03:31:05 2008 Tanaka Akira <akr@fsij.org>
-
- * iseq.c (iseq_s_compile_file): use rb_file_open_str.
-
- * io.c (rb_file_open_generic): call validate_enc_binmode.
- (rb_file_open_str): call FilePathValue.
-
-Sat Sep 13 02:58:05 2008 Tanaka Akira <akr@fsij.org>
-
- * io.c (validate_enc_binmode): extracted from rb_io_extract_modeenc.
- (rb_io_extract_modeenc): use validate_enc_binmode.
- (io_encoding_set): call validate_enc_binmode.
-
-Sat Sep 13 02:50:34 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode.c (rb_econv_prepare_opts): initialize *opt and return 0
- if opthash is nil.
-
-Sat Sep 13 02:29:19 2008 Tanaka Akira <akr@fsij.org>
-
- * enc/trans/escape.trans: transcoder name renamed to use underscore.
-
- * transcode.c: follow the renaming.
-
-Sat Sep 13 02:12:17 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode.c (rb_econv_init_by_convpath_i): new function.
- (rb_econv_init_by_convpath): new function.
- (econv_init): use rb_econv_init_by_convpath.
-
-Sat Sep 13 01:11:14 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode.c (econv_args): take snamev_p and dnamev_p to prevent
- possible GC problem.
-
-Sat Sep 13 00:38:54 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode.c (enc_arg): take arg as VALUE * to prevent possible GC
- problem.
-
-Fri Sep 12 23:19:41 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode.c (rb_econv_add_transcoder_at): fix loop condition.
-
-Fri Sep 12 22:39:46 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode.c (decorator_names): extracted from rb_econv_open.
- (rb_econv_open): use decorator_names.
- (econv_args): extracted from econv_init.
- (econv_init): use econv_args.
- (decorate_convpath): new function.
- (search_convpath_i): new function.
- (econv_s_search_convpath): new method.
- (Init_transcode): new method defined.
-
-Fri Sep 12 21:55:43 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode.c (rb_econv_t): new field: num_allocated.
- (rb_econv_alloc): extracted from
- rb_econv_open_by_transcoder_entries.
- (rb_econv_add_transcoder_at): extracted from rb_econv_decorate_at
- and generalized
- (rb_econv_open_by_transcoder_entries): use rb_econv_alloc and
- rb_econv_add_transcoder_at.
- (rb_econv_add_converter): extracted from rb_econv_decorate_at.
- (rb_econv_decorate_at): use rb_econv_add_converter.
-
-
-Fri Sep 12 21:22:09 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode.c (rb_econv_t): new field: started.
- (rb_econv_open_by_transcoder_entries): initialize started field.
- (rb_econv_convert): set started field.
- (rb_econv_insert_output): ditto.
- (rb_econv_decorate_at): check started field instead of num_finished.
-
-Fri Sep 12 20:28:59 2008 Tanaka Akira <akr@fsij.org>
-
- * regenc.c (onigenc_single_byte_code_to_mbc): follow OnigEncoding
- change.
-
-Fri Sep 12 20:00:22 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * regparse.c (parse_exp): fix resource leak.
-
-Fri Sep 12 01:21:22 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * ext/syck/node.c (syck_replace_str2): fix wrong check to free ptr.
-
-Thu Sep 11 20:18:24 2008 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-
- * test/win32ole/test_err_in_callback.rb (teardown): get rid
- of infinite loop.
-
-Thu Sep 11 19:12:56 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * include/ruby/oniguruma.h (OnigCodePoint): unsigned long to unsigned int.
-
- * include/ruby/encoding.h (rb_enc_codepoint): ditto.
-
- * encoding.c (rb_enc_codepoint): signed int to unsigned int.
-
- * encoding.c (rb_enc_ascget): ditto.
-
- * string.c (rb_str_casecmp): ditto.
-
- * string.c (enc_succ_alnum_char): ditto.
-
- * string.c (rb_str_inspect): ditto.
-
- * string.c (rb_str_upcase_bang): ditto.
-
- * string.c (rb_str_downcase_bang): ditto.
-
- * string.c (rb_str_capitalize_bang): ditto.
-
- * string.c (rb_str_swapcase_bang): ditto.
-
- * string.c (struct tr): ditto.
-
- * string.c (trnext): ditto.
-
- * string.c (tr_trans): ditto.
-
- * string.c (tr_setup_table): ditto.
-
- * string.c (tr_find): ditto.
-
- * string.c (rb_str_delete_bang): ditto.
-
- * string.c (rb_str_squeeze_bang): ditto.
-
- * string.c (rb_str_count): ditto.
-
- * string.c (rb_str_split_m): ditto.
-
- * string.c (rb_str_each_line): ditto.
-
- * string.c (rb_str_lstrip_bang): ditto.
-
- * string.c (rb_str_rstrip_bang): ditto.
-
- * string.c (rb_str_intern): ditto.
-
- * dir.c (char_casecmp): ditto.
-
- * sprintf.c (rb_str_format): ditto.
-
- * enc/emacs_mule.c (mbc_to_code): to be 32bit clean.
-
- * enc/emacs_mule.c (code_to_mbc): ditto.
-
- * enc/gb18030.c (mbc_to_code): ditto.
-
- * enc/gb18030.c (code_to_mbc): ditto.
-
-Thu Sep 11 19:09:25 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * ext/iconv/iconv.c: add attention for machine independent.
-
-Thu Sep 11 15:23:26 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * bignum.c (bigdivrem): adjust length for division and remainder.
- a patch from TOYOFUKU Chikanobu <nobu_toyofuku at nifty.com> in
- [ruby-dev:36231].
-
-Thu Sep 11 02:59:47 2008 Tanaka Akira <akr@fsij.org>
-
- * io.c (io_binwrite): extracted from io_fwrite.
-
-Thu Sep 11 02:25:34 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode.c (make_encoding): new function.
- (make_encobj): new function.
- (econv_s_asciicompat_encoding): use make_encoding.
- (rb_econv_open_exc): use SUPPLEMENTAL_CONVERSION.
- (econv_convpath): use encoding object in the result.
-
-Thu Sep 11 02:14:38 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode.c (econv_convpath): new method.
-
-Wed Sep 10 23:00:43 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * tool/compile_prelude.rb: print "<internal:prelude>" instead of
- "prelude.rb" on stack trace. [ruby-dev:36129]
-
-Wed Sep 10 21:19:58 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * bignum.c (big2str_karatsuba): remove unnecessary fixnum code. a
- patch from TOYOFUKU Chikanobu <nobu_toyofuku at nifty.com> in
- [ruby-dev:36217].
-
-Wed Sep 10 21:09:32 2008 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-
- * test/win32ole/test_err_in_callback.rb: InternetExplorer should
- be closed.
-
- * test/win32ole/err_in_callback.rb: ditto.
-
-Wed Sep 10 18:25:19 2008 akira yamada <akira@rice.p.arika.org>
-
- * lib/uri/common.rb (URI::Parser): new class.
-
- * lib/uri/mailto.rb, lib/uri/generic.rb: follow the above change.
-
- * test/uri/test_parser.rb: added tests for URI::Parser.
-
-Wed Sep 10 10:35:32 2008 Takeyuki Fujioka <xibbar@ruby-lang.org>
-
- * lib/cgi/cookie.rb (CGI::Cookie#to_s): performance improvement
- from http://jp.rubyist.net/magazine/?0023-Cgirb.
-
-Wed Sep 10 10:12:29 2008 akira yamada <akira@arika.org>
-
- * lib/sync.rb (Sync_m#sync_exclusive): fixed
- typo. [ruby-dev:36233] [RubyForge#11680]
-
-Wed Sep 10 01:57:23 2008 Tanaka Akira <akr@fsij.org>
-
- * tool/transcode-tblgen.rb (StrSet#hash): cache hash value.
- (ActionMap#hash): ditto.
-
-Wed Sep 10 01:26:01 2008 Tanaka Akira <akr@fsij.org>
-
- * include/ruby/encoding.h (econv_after_output): renamed from
- econv_output_followed_by_input.
- (ECONV_AFTER_OUTPUT): renamed from ECONV_OUTPUT_FOLLOWED_BY_INPUT.
-
- * transcode.c: follow the renaming.
-
- * io.c: ditto.
-
-Wed Sep 10 01:16:07 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode.c (get_replacement_character): don't return ASCII
- incompatible replacements.
- (make_replacement): don't convert the result of
- get_replacement_character.
-
-Wed Sep 10 01:05:00 2008 Tanaka Akira <akr@fsij.org>
-
- * enc/trans/newline.trans (rb_universal_newline): swap src_encoding
- and dst_encoding.
-
- * transcode.c (rb_econv_decorate_at): call get_transcoder_entry only
- once.
- (rb_econv_binmode): follow universal_newline change.
-
-Wed Sep 10 00:01:36 2008 Tanaka Akira <akr@fsij.org>
-
- * include/ruby/io.h (rb_io_t): rename field: writeconv_stateless to
- writeconv_asciicompat.
-
- * io.c: follow the renaming.
-
- * gc.c: ditto.
-
-Tue Sep 9 23:55:26 2008 Tanaka Akira <akr@fsij.org>
-
- * io.c (io_fwrite): raise an error if ASCII incompatible string
- written for text mode IO without encoding conversion.
- (rb_io_extract_modeenc): binmode requirement changed.
-
-Tue Sep 9 21:59:48 2008 Takeyuki Fujioka <xibbar@ruby-lang.org>
-
- * lib/cgi*: split cgi.rb into four files. [ruby-dev:36041]
-
-Tue Sep 9 21:17:00 2008 Tanaka Akira <akr@fsij.org>
-
- * include/ruby/encoding.h (ECONV_DECORATOR_MASK): merge
- ECONV_ENCODER_MASK and ECONV_DECORATOR_MASK.
- (ECONV_UNIVERSAL_NEWLINE_DECORATOR): renamed from
- ECONV_UNIVERSAL_NEWLINE_DECODER.
- (ECONV_CRLF_NEWLINE_DECORATOR): renamed from
- ECONV_CRLF_NEWLINE_ENCODER.
- (ECONV_CR_NEWLINE_DECORATOR): renamed from ECONV_CR_NEWLINE_ENCODER.
- (ECONV_XML_TEXT_DECORATOR): renamed from ECONV_XML_TEXT_ENCODER.
- (ECONV_XML_ATTR_CONTENT_DECORATOR): renamed from
- ECONV_XML_ATTR_CONTENT_ENCODER.
- (ECONV_STATEFUL_DECORATOR_MASK): renamed from
- ECONV_STATEFUL_ENCODER_MASK.
- (ECONV_XML_ATTR_QUOTE_DECORATOR): renamed from
- ECONV_XML_ATTR_CONTENT_DECORATOR.
-
- * io.c: follow the renaming.
-
- * transcode.c: ditto.
-
-Tue Sep 9 20:55:55 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode.c (rb_econv_open0): make it static.
- (rb_econv_open): place decorators at last.
-
-Tue Sep 9 20:40:15 2008 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-
- * test/openssl/test_ssl.rb (OpenSSL#test_client_session):
- Debian's openssl 0.9.8g-13 failed at assert(ssl.session_reused?),
- when use default SSLContext. [ruby-dev:36167]
-
-Tue Sep 9 20:34:26 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode.c (rb_econv_t): last_trans_index removed.
- (rb_econv_open_by_transcoder_entries): follow the type change.
- (rb_econv_open0): ditto.
- (rb_econv_decorate_at): ditto.
- (rb_econv_binmode): ditto.
- (rb_econv_insert_output): simplified because there are no decorators
- at last.
-
-Tue Sep 9 20:21:54 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode.c (rb_econv_open): reverse the order of decoders.
-
-Tue Sep 9 20:18:26 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode.c (rb_econv_open0): num_encoders and num_decoders removed.
-
-Tue Sep 9 03:59:13 2008 Tanaka Akira <akr@fsij.org>
-
- * io.c (make_writeconv): useless branch removed.
-
-Tue Sep 9 02:18:20 2008 Tanaka Akira <akr@fsij.org>
-
- * include/ruby/encoding.h (rb_econv_decorate_at_first): declared.
- (rb_econv_decorate_at_last): declared.
-
- * transcode.c (rb_econv_open_by_transcoder_entries): initialize
- replacement_enc. allocate outbuf for the last transcoder.
- (rb_econv_open0): extracted from rb_econv_open.
- (rb_econv_open): use rb_econv_open0 and decorate the result using
- rb_econv_decorate_at_first and rb_econv_decorate_at_last.
- (rb_econv_decorate_at): new function.
- (rb_econv_decorate_at_first): ditto.
- (rb_econv_decorate_at_last): ditto.
- (rb_econv_binmode): fix iteration end condition.
- (econv_init): don't set source_encoding_name and
- destination_encoding_name because they are set in rb_econv_open0.
-
-Tue Sep 9 01:10:54 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode.c (rb_econv_open): make ec a local variable.
-
-Tue Sep 9 00:20:10 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode.c (rb_econv_asciicompat_encoding): check decoder.
-
-Tue Sep 9 00:00:47 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode.c (rb_econv_t): last_error.partial_input removed.
-
-Mon Sep 8 23:24:54 2008 Tanaka Akira <akr@fsij.org>
-
- * include/ruby/encoding.h (rb_econv_asciicompat_encoding): renamed
- from rb_econv_stateless_encoding to apply stateless ASCII
- incompatible encodings such as UTF-16BE.
-
- * io.c (make_writeconv): use rb_econv_asciicompat_encoding.
-
- * transcode_data.h (rb_transcoder_asciicompat_type_t): renamed from
- rb_transcoder_stateful_type_t.
- (rb_transcoder): use rb_transcoder_asciicompat_type_t.
-
- * transcode.c: follow the type change.
- (asciicompat_encoding_i): renamed from stateless_encoding_i.
- (rb_econv_asciicompat_encoding): renamed from
- rb_econv_stateless_encoding.
- (econv_s_asciicompat_encoding): method renamed.
-
- * tool/transcode-tblgen.rb: follow the type change.
-
- * enc/trans/utf_16_32.trans: follow the type change.
- rb_from_UTF_16BE to UTF-8 is asciicompat_decoder.
- rb_from_UTF_16LE to UTF-8 is asciicompat_decoder.
- rb_from_UTF_32BE to UTF-8 is asciicompat_decoder.
- rb_from_UTF_32LE to UTF-8 is asciicompat_decoder.
- UTF-8 to rb_to_UTF_16BE is asciicompat_encoder.
- UTF-8 to rb_to_UTF_16LE is asciicompat_encoder.
- UTF-8 to rb_to_UTF_32BE is asciicompat_encoder.
- UTF-8 to rb_to_UTF_32LE is asciicompat_encoder.
-
- * enc/trans/newline.trans: follow the type change. universal newline
- decoder is asciicompat_converter.
-
- * enc/trans/escape.trans: follow the type change.
-
- * enc/trans/iso2022.trans: ditto.
-
- * enc/trans/japanese.trans: ditto.
-
-Mon Sep 8 23:05:42 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode.c (rb_econv_insert_output): "readagain" part should be
- after replacement.
-
-Mon Sep 8 22:30:03 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * dir.c (dir_initialize): rename option name of Dir.open
- from :external_encoding to :encoding.
-
-Mon Sep 8 22:16:20 2008 Takeyuki FUJIOKA <xibbar@ruby-lang.org>
-
- * lib/cgi.rb : obsolete regex "n" option. [ruby-dev:36130]
-
-Mon Sep 8 18:13:20 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/win32.c (getppid): typo. [ruby-dev:36202]
-
- * process.c (get_ppid): mention the return value on Windows.
-
-Mon Sep 8 18:15:59 2008 Tanaka Akira <akr@fsij.org>
-
- * tool/transcode-tblgen.rb (ArrayCode): less string substitutions.
-
-Mon Sep 8 18:13:13 2008 Tanaka Akira <akr@fsij.org>
-
- * vm.c (rb_mRubyVMFrozenCore): registered for GC.
-
- * re.c (rb_reg_preprocess_dregexp): fix GC problem on MacOS X with
- powerpc-apple-darwin8-gcc-4.0.1 (GCC) 4.0.1 (Apple Computer, Inc.
- build 5367).
-
-Mon Sep 8 18:09:07 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/Makefile.sub (config.h): define SIZE_MAX for VC++6/7.
-
-Mon Sep 8 17:46:09 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/win32.c (filetime_to_unixtime): remove unused variable.
- [ruby-dev:36191]
-
-Mon Sep 8 13:47:39 2008 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-
- * test/ruby/test_io.rb (TestIO#test_dup): add open in block.
- see [ruby-dev:35957].
-
-Mon Sep 8 07:09:42 2008 Tadayoshi Funaba <tadf@dotrb.org>
-
- * complex.c: some adjustments.
-
- * rational.c: ditto.
-
-Mon Sep 8 06:50:29 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in (XLDFLAGS): added --enable-auto-import for cygwin and
- mingw.
-
-Mon Sep 8 02:04:25 2008 Tanaka Akira <akr@fsij.org>
-
- * include/ruby/encoding.h (rb_econv_set_replacement): renamed from
- rb_econv_set_replacemenet.
-
- * transcode.c: follow the renaming.
-
-Mon Sep 8 01:10:41 2008 Tanaka Akira <akr@fsij.org>
-
- * tool/transcode-tblgen.rb (transcode_tblgen): log message refined.
-
-Mon Sep 8 00:58:04 2008 Tadayoshi Funaba <tadf@dotrb.org>
-
- * rational.c: removed unused code.
-
-Mon Sep 8 00:04:09 2008 Tanaka Akira <akr@fsij.org>
-
- * enc/trans/iso2022.trans: upcase to iso-2022-jp.
-
- * enc/emacs_mule.c: ditto.
-
-Sun Sep 7 23:46:36 2008 Tanaka Akira <akr@fsij.org>
-
- * enc/trans/iso2022.trans: stateless-iso-2022-jp is defined to avoid
- undefined conversion error between iso-2022-jp and the corresponding
- stateless encoding.
-
- * enc/emacs_mule.c: replicate emacs-mule as stateless-iso-2022-jp.
-
-Sun Sep 7 20:03:01 2008 Tanaka Akira <akr@fsij.org>
-
- * enc/trans/escape.trans (hexstr): renamed from str1.
-
-Sun Sep 7 19:45:31 2008 Tanaka Akira <akr@fsij.org>
-
- * enc/trans/escape.trans: use transcode_tblgen.
-
- * tool/transcode-tblgen.rb: generate an empty line after str1.
-
-Sun Sep 7 19:16:38 2008 Tanaka Akira <akr@fsij.org>
-
- * tool/transcode-tblgen.rb (ActionMap#str_name): new method to
- generate a name base on string content.
- (ActionMap#gen_str): extracted from generate_info and use str_name.
-
-Sun Sep 7 18:28:05 2008 Tanaka Akira <akr@fsij.org>
-
- * tool/transcode-tblgen.rb (ActionMap#generate_info): use a memo to
- avoid duplication for STR1.
-
-Sun Sep 7 18:10:28 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode_data.h (STR1): defined for a string up to 255 bytes.
- (STR1_BYTEINDEX): defined.
- (makeSTR1): defined.
-
- * tool/transcode-tblgen.rb: generate STR1.
-
- * transcode.c (transcode_restartable0): interpret STR1.
-
- * enc/trans/escape.trans (fun_so_escape_xml_chref): removed. STR1 is
- used instead.
-
-Sun Sep 7 17:54:45 2008 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-
- * configure.in: Mac OS X's crypt(2) is broken with invalid salt.
- [ruby-dev:35899]
- * string.c (rb_str_crypt): ditto.
-
-Sun Sep 7 17:29:49 2008 Tanaka Akira <akr@fsij.org>
-
- * tool/transcode-tblgen.rb: o4 is usable only if the first byte is
- f0-f7.
-
-Sun Sep 7 12:44:26 2008 Tanaka Akira <akr@fsij.org>
-
- * io.c (make_writeconv): choose ASCII compatible encoding as
- intermediate encoding if stateful encoder exists.
-
-Sun Sep 7 12:09:29 2008 Tanaka Akira <akr@fsij.org>
-
- * include/ruby/encoding.h (ECONV_XML_ATTR_CONTENT_ENCODER): defined.
- (ECONV_STATEFUL_ENCODER_MASK): defined.
- (ECONV_XML_ATTR_QUOTE_ENCODER): defined.
- (ECONV_XML_ATTR_ENCODER): removed.
-
- * enc/trans/escape.trans (rb_escape_xml_attr_content): defined.
- (rb_escape_xml_attr_quote): defined.
- (rb_escape_xml_attr): removed.
-
- * io.c (NEED_WRITECONV): writeconv is required if supplemental
- converter is used.
- (make_writeconv): apply stateful encoder in writeconv.
-
- * transcode.c: follow the constant change.
-
-Sun Sep 7 07:24:09 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * misc/*.el: merged the following patches from Nathan Weizenbaum
- <nex342 at gmail.com>. [ruby-core:18424]
-
- * misc/ruby-mode.el: improve here-doc performance.
-
- * misc/ruby-mode.el: don't crash the whole mode if the Subversion
- $ keyword isn't interpolated.
-
- * misc/ruby-mode.el: don't highlight keywords when they're the
- beginning of non-keyword symbols.
-
- * misc/ruby-mode.el, misc/ruby-electric.el: use regexp-opt where
- possible for more efficient regexps.
-
- * misc/*.el: untabify, for internal consistency and consistency
- with standard Emacs elisp files.
-
- * misc/ruby-mode.el: fix a variable-name error.
-
- * misc/emacs-mode.el: don't set case-fold-search globally to nil;
- instead just set it when we need it.
-
-Sun Sep 7 06:31:51 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * file.c (file_expand_path): applied a patch from Nobuhiro Tachino
- in [ruby-dev:35948]. fix #491
-
-Sun Sep 7 03:37:05 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * parse.y (f_block_optarg): allow default for block parameters as
- long as the value is primary. a patch from Eric Mahurin
- <eric.mahurin at gmail.com> in [ruby-core:16880].
-
-Sun Sep 7 01:07:10 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * parse.y (yylex): "1.upto 2 {|i| p i }" should be syntax error.
- [ruby-dev:36008]
-
- * test/ruby/test_parse.rb (TestParse): update a test not to use
- recently fixed inconsistent syntax.
-
-Sun Sep 7 00:37:25 2008 Tanaka Akira <akr@fsij.org>
-
- * include/ruby/encoding.h (ECONV_ERROR_HANDLER_MASK): defined.
- (ECONV_DECODER_MASK): defined.
- (ECONV_ENCODER_MASK): defined.
-
- * io.c (make_writeconv): restrict ecflags for writeconv with
- ECONV_ERROR_HANDLER_MASK.
-
-Sat Sep 6 23:03:41 2008 Tanaka Akira <akr@fsij.org>
-
- * include/ruby/encoding.h (ECONV_XML_TEXT_ENCODER): renamed from
- ECONV_HTML_TEXT_ENCODER.
- (ECONV_XML_ATTR_ENCODER): renamed from ECONV_HTML_ATTR_ENCODER.
-
- * enc/trans/escape.trans: follow the renaming.
-
- * transcode.c: ditto.
-
-Sat Sep 6 21:35:52 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * ext/socket/mkconstants.rb: add some IPV6 constants. [ruby-dev:36175]
-
-Sat Sep 6 20:10:48 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode.c (econv_description): show ECONV_HTML_TEXT_ENCODER and
- ECONV_HTML_ATTR_ENCODER.
-
-Sat Sep 6 20:06:09 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode.c (rb_econv_binmode): check actual transcoders.
-
-Sat Sep 6 19:54:25 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode.c (rb_econv_open): fix last_tc.
-
-Sat Sep 6 19:36:34 2008 Tanaka Akira <akr@fsij.org>
-
- * io.c (rb_io_binmode): clear newline flags in writeconv_pre_ecflags.
-
-Sat Sep 6 18:47:40 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode.c (str_transcode0): check ECONV_HTML_TEXT_ENCODER and
- ECONV_HTML_ATTR_ENCODER.
-
-Sat Sep 6 18:38:47 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode.c (allocate_converted_string): fix overflow condition.
-
-Sat Sep 6 15:06:21 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode.c (sym_html): new variable.
- (sym_text): ditto.
- (sym_attr): ditto.
- (econv_opts): check :html=>:text and :html=>:attr.
- (Init_transcode): initialize the above variables.
-
-Sat Sep 6 14:46:12 2008 Tanaka Akira <akr@fsij.org>
-
- * include/ruby/encoding.h (ECONV_HTML_TEXT_ENCODER): new constant.
- (ECONV_HTML_ATTR_ENCODER): ditto.
-
- * transcode.c (rb_econv_open): check ECONV_HTML_TEXT_ENCODER and
- ECONV_HTML_ATTR_ENCODER.
- (Init_transcode): Encoding::Converter::HTML_TEXT_ENCODER and
- Encoding::Converter::HTML_ATTR_ENCODER defined.
-
-Sat Sep 6 14:15:25 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode.c (struct trans_open_t): defined to pass num_additional.
- (trans_open_i): use struct trans_open_t.
- (rb_econv_open): ditto.
-
-Sat Sep 6 13:43:20 2008 Tanaka Akira <akr@fsij.org>
-
- * enc/trans/escape.trans (fun_so_escape_html_attr): fix return type.
-
-Sat Sep 6 12:43:55 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode.c (rb_econv_open): needless branch removed.
-
-Sat Sep 6 12:38:34 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode.c (rb_econv_open): test condition simplified.
-
-Sat Sep 6 12:25:31 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode.c (stateless_encoding_i): ignore supplemental conversions.
- Encoding::Converter.stateless_encoding("html-attr-escaped") should be
- nil.
-
-Sat Sep 6 12:19:36 2008 Tanaka Akira <akr@fsij.org>
-
- * enc/trans/escape.trans (escape_html_attr_init): new function.
- (fun_so_escape_html_attr): new function.
- (escape_html_attr_finish): new function.
- (rb_escape_html_attr): use them to quote the converted result.
-
-Sat Sep 6 07:54:36 2008 Tadayoshi Funaba <tadf@dotrb.org>
-
- * complex.c: uses f_real_p macro.
-
-Sat Sep 6 07:27:00 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode.c (rb_econv_open): fail for ASCII incompatible with
- newline conversion.
-
-Sat Sep 6 07:24:49 2008 Tanaka Akira <akr@fsij.org>
-
- * io.c (rb_io_extract_modeenc): raise an error for ASCII incompatible
- encoding without binmode.
-
-Sat Sep 6 07:12:42 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * bignum.c (bigdivrem1): optimization by skipping zeros at the
- tail of digits. a patch from TOYOFUKU Chikanobu
- <nobu_toyofuku at nifty.com> in [ruby-dev:36169].
-
-Sat Sep 6 06:28:46 2008 Tanaka Akira <akr@fsij.org>
-
- * enc/trans/escape.trans: new file.
-
-Sat Sep 6 06:23:27 2008 Tanaka Akira <akr@fsij.org>
-
- * tool/transcode-tblgen.rb (StrSet.parse): accept upper case
- hexadecimal digits.
-
-Sat Sep 6 05:37:08 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode.c (output_hex_charref): upcase hexadecimal digits.
-
-Sat Sep 6 05:22:29 2008 Tanaka Akira <akr@fsij.org>
-
- * include/ruby/encoding.h (ECONV_UNDEF_HEX_CHARREF): defined.
-
- * transcode.c (output_hex_charref): new function.
- (rb_econv_convert): call output_hex_charref if
- ECONV_UNDEF_HEX_CHARREF.
- (Init_transcode): Encoding::Converter::UNDEF_HEX_CHARREF added.
-
-Sat Sep 6 03:52:47 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode.c (rb_econv_convert): use ECONV_INVALID_MASK and
- ECONV_UNDEF_MASK.
-
-Sat Sep 6 06:05:09 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * include/ruby/ruby.h (DBL2NUM): renamed from DOUBLE2NUM.
- a patch from Tadashi Saito <shiba at mail2.accsnet.ne.jp>
- in [ruby-dev:36102].
-
-Sat Sep 6 04:44:06 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * proc.c (Init_Proc): add '===' operator to use procs in when
- clause of the case statement. inspired by <http://www.aimred.com/news/developers/2008/08/14/unlocking_the_power_of_case_equality_proc/>.
-
-Sat Sep 6 03:18:17 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode.c (allocate_converted_string): add arguments for a buffer
- allocated by caller.
- (rb_econv_insert_output): provide caller allocated buffer to
- allocate_converted_string.
-
-Sat Sep 6 02:58:53 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode.c (str_transcode_enc_args): local variables renamed.
- (str_transcode0): ditto.
-
-Sat Sep 6 02:23:18 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode.c (econv_s_stateless_encoding): new method.
-
-Sat Sep 6 02:01:59 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode.c (enc_arg): extracted from str_transcode_enc_args.
- (str_transcode_enc_args): use enc_arg.
-
-Fri Sep 5 20:27:17 2008 Tanaka Akira <akr@fsij.org>
-
- * include/ruby/io.h (rb_io_modestr_fmode): renamed from
- rb_io_mode_flags.
- (rb_io_modestr_oflags): renamed from rb_io_mode_modenum.
- (rb_io_oflags_fmode): renamed from rb_io_modenum_flags.
- (rb_io_mode_flags): defined as a macro.
- (rb_io_modenum_flags): ditto.
-
- * io.c: follow the renaming with consistency.
-
- * process.c (check_exec_redirect): call rb_io_modestr_oflags.
-
- * ext/pty/depend: pty.o depends on io.h.
-
-Fri Sep 5 20:12:23 2008 Tanaka Akira <akr@fsij.org>
-
- * enc/trans/newline.trans (universal_newline_finish): new function.
-
-Fri Sep 5 20:07:37 2008 Tanaka Akira <akr@fsij.org>
-
- * include/ruby/io.h (rb_io_mode_modenum): moved from
- include/ruby/intern.h.
-
-Fri Sep 5 19:59:26 2008 Tanaka Akira <akr@fsij.org>
-
- * io.c (MODENUM_MAX): removed.
-
-Fri Sep 5 18:37:52 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * io.c (copy_stream_fallback_body): use read method unless readpartial
- is available. [ruby-dev:36124]
-
-Fri Sep 5 18:16:31 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/iconv/iconv.c (iconv_create): strips glibc style option before
- charset mapping. retries without options if they seemed causing
- error, and warns. [ruby-dev:36147]
-
-Fri Sep 5 03:09:48 2008 Koichi Sasada <ko1@atdot.net>
-
- * iseq.c (iseq_data_to_ary): make it static.
-
- * thread.c (thgroup_enclose): ditto.
-
-Fri Sep 5 02:56:37 2008 Koichi Sasada <ko1@atdot.net>
-
- * vm.c (thread_recycle_stack_slot, thread_recycle_stack_count):
- make it static.
-
-Fri Sep 5 02:40:38 2008 Koichi Sasada <ko1@atdot.net>
-
- * thread.c (rb_thread_critical): removed.
-
-Fri Sep 5 01:22:23 2008 Tanaka Akira <akr@fsij.org>
-
- * io.c (argf_mark): mark p->encs.ecopts.
-
-Fri Sep 5 00:45:07 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode_data.h (rb_transcoder): rename fields:
- from_encoding -> src_encoding, to_encoding -> dst_encoding.
-
- * transcode.c: follow the renaming.
-
-Fri Sep 5 00:22:34 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode.c: variables renamed for consistency.
-
-Fri Sep 5 00:05:27 2008 Tanaka Akira <akr@fsij.org>
-
- * pack.c (encodes): make buff fixed length to avoid SEGV by
- ruby -e '["a"*10000000].pack("m1000000000")'
-
-Thu Sep 4 23:47:05 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * ext/bigdecimal/bigdecimal.c (BigDecimal_mode): set exception mode
- correctly. In spite of BigDecimal.mode(BigDecimal::EXCEPTION_ALL,
- true), BigDecimal.new("NaN") did not raise an exception previously.
-
-Thu Sep 4 23:42:42 2008 Tanaka Akira <akr@fsij.org>
-
- * include/ruby/intern.h (rb_file_open_str): declared.
-
- * io.c (rb_file_open_str): defined.
-
- * ext/zlib/zlib.c (gzfile_s_open): use rb_file_open_str instead of
- rb_file_open.
-
-Thu Sep 4 23:18:55 2008 Tanaka Akira <akr@fsij.org>
-
- * enc/trans/newline.trans: record newline types met in universal
- newline decoder.
-
-Thu Sep 4 23:05:54 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * lib/prime.rb (Prime::OldCompatibility#each): added compatibility to
- Ruby 1.8.7.
- (Prime#each): added more rdocs.
- (Prime#each): remembers the last value of the given block.
-
-Thu Sep 4 21:53:58 2008 Tanaka Akira <akr@fsij.org>
+Fri Jan 23 11:49:45 2009 Shugo Maeda <shugo@ruby-lang.org>
- * transcode.c (econv_init): accept an integer as 3rd argument as well.
-
-Thu Sep 4 21:46:21 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode.c (sym_partial_input): new variable.
- (econv_primitive_convert): accept a hash as 5th argument as well.
-
-Thu Sep 4 21:04:27 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode.c (sym_universal_newline_decoder): new variable.
- (sym_crlf_newline_encoder): ditto.
- (sym_cr_newline_encoder): ditto.
- (econv_opts): check newline converter options.
- (econv_init): make 3rd argument hash/nil only.
-
-Thu Sep 4 21:03:28 2008 Koichi Sasada <ko1@atdot.net>
-
- * vm_dump.c: rename some debug functions.
-
-Thu Sep 4 20:57:54 2008 Koichi Sasada <ko1@atdot.net>
-
- * thread.c (rb_thread_check_trap_pending): added for compatibility.
-
- * ext/tk/tcltklib.c, ext/tk/tkutil/tkutil.c: remove ruby/signal.h
- dependency.
-
-Thu Sep 4 20:30:24 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode_data.h (PType): defined unconditionally.
-
- * transcode.c (PType): don't define here.
-
-Thu Sep 4 20:19:36 2008 Tanaka Akira <akr@fsij.org>
-
- * io.c: variables renamed for consistency.
-
-Thu Sep 4 19:40:50 2008 Narihiro Nakamura <authorNari@gmail.com>
-
- * gc.c (gc_profile_record_get): to static function.
- (gc_profile_result): ditto.
- (gc_profile_report): ditto.
-
-Thu Sep 4 19:20:24 2008 Tanaka Akira <akr@fsij.org>
-
- * include/ruby/io.h (rb_io_enc_t): rename flags to ecflags.
- (rb_io_t): rename writeconv_pre_flags to writeconv_pre_ecflags.
- (MakeOpenFile): follow the renaming.
-
- * io.c: follow the renaming.
-
-Thu Sep 4 19:10:27 2008 Tanaka Akira <akr@fsij.org>
-
- * include/ruby/encoding.h (ECONV_INVALID_IGNORE): removed because
- it tend to cause security problem. If the behaviour is really
- required, ECONV_INVALID_REPLACE with empty string can be used.
- For example, CVE-2006-2313, CVE-2008-1036, [ruby-core:15645],
- http://unicode.org/reports/tr36/
- (ECONV_UNDEF_IGNORE): ditto.
-
- * transcode.c (rb_econv_convert): follow the above change.
- (econv_opts): ditto.
- (Init_transcode): ditto.
-
-Thu Sep 4 13:22:02 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * vm_core.h (struct rb_vm_struct): replaced signal staff with trap
- staff.
-
- * signal.c (signal_buff): per process resource now.
-
- * signal.c (trap_list): moved to VM.
-
- * signal.c (rb_get_next_signal): reverted.
-
- * signal.c (rb_trap_exit): trap_pending_list was no longer used.
-
- * thread.c (timer_thread_function): delivers buffered per-process
- signals to each VMs.
-
- * vm.c (rb_vm_mark): marks trap_list.
-
-Thu Sep 4 13:01:11 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * io.c (struct sysopen_struct, rb_sysopen_internal, rb_sysopen):
- constified.
-
- * io.c: expanded ARGF members macros.
-
-Thu Sep 4 10:43:47 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * tool/transcode-tblgen.rb (citrus_decode_mapsrc): support older 1.8.
-
-Thu Sep 4 10:33:43 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * io.c (argf_next_argv, argf_set_encoding): copy struct wise.
-
-Thu Sep 4 09:46:18 2008 Tanaka Akira <akr@fsij.org>
-
- * io.c (rb_scan_open_args): follow rb_str_transcode change.
-
-Thu Sep 4 08:59:29 2008 Tanaka Akira <akr@fsij.org>
-
- * file.c (rb_find_file): fix GC problem on Debian GNU/Linux (IA64)
- with gcc (GCC) 4.1.2 20061115 (prerelease) (Debian 4.1.1-21).
- There is no register/memory to contain load_path. A register (r35)
- contains &RARRAY_PTR(load_path), (char*)load_path + 32.
-
-Thu Sep 4 03:10:05 2008 Tanaka Akira <akr@fsij.org>
-
- * include/ruby/io.h (rb_io_t): new fields: encs.ecopts and
- writeconv_pre_ecopts.
- (MakeOpenFile): initialize them.
+ * lib/rexml/document.rb: limit entity expansion. Thanks, Luka
+ Treiber, Mitja Kolsek, and Michael Koziarski. backported from
+ trunk r19033, r19317, r19318.
- * include/ruby/encoding.h (rb_str_transcode): take ecopts argument.
- (rb_econv_flags): removed.
- (rb_econv_prepare_opts): declared.
- (rb_econv_open_opts): declared.
+ * lib/rexml/entity.rb: ditto.
- * io.c (make_writeconv): use rb_econv_open_opts.
- (make_readconv): ditto.
- (io_fwrite): follow rb_str_transcode change.
- (rb_io_extract_modeenc): use rb_econv_prepare_opts.
- (rb_file_open_generic): initialize encs.ecopts.
- (rb_file_open_internal): ditto.
- (rb_io_reopen): ditto.
- (argf_ecopts): defined.
- (argf_next_argv): set encs.ecopts.
- (io_encoding_set): use rb_econv_prepare_opts.
- (argf_set_encoding): set argf_ecopts.
+ * test/rexml/test_document.rb: ditto.
- * gc.c (gc_mark_children): mark encs.ecopts and writeconv_pre_ecopts
- in T_FILE.
+Thu Jan 22 15:19:39 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * transcode.c (transcode_loop): take ecopts argument. use
- rb_econv_open_opts.
- (rb_econv_flags): removed.
- (rb_econv_prepare_opts): defined.
- (rb_econv_open_opts): defined.
- (str_transcode0): take ecopts.
- (str_transcode): use rb_econv_prepare_opts.
- (rb_str_transcode): take ecopts.
- (econv_init): accept hash argument.
- (econv_insert_output): follow rb_str_transcode change.
+ * marshal.c (marshal_load): arg.data is no longer a VALUE but a
+ st_table, and freed in load_ensure. pointed out by pegacorn.
+ [ruby-dev:37008]
-Thu Sep 4 01:30:26 2008 Tanaka Akira <akr@fsij.org>
+Thu Jan 22 15:19:39 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * include/ruby/encoding.h (rb_econv_set_replacemenet): declared.
+ * gc.c (rb_mark_set): new function to mark keys.
- * transcode.c (rb_econv_t): new fields: replacement_str,
- replacement_len, replacement_enc and replacement_allocated.
- (get_replacement_character): make len as size_t.
- (rb_econv_open_by_transcoder_entries): initialize the new fields.
- (rb_econv_close): deallocate replacement_str if it allocated.
- (make_replacement): new function.
- (output_replacement_character): use make_replacement.
- (rb_econv_set_replacemenet): defined.
- (econv_get_replacement): new method.
- (econv_set_replacement): new method.
+ * marshal.c (struct dump_arg, struct load_arg): added wrappers to mark
+ data entries. backport from trunk r13527,r13528,r13961,r16533.
+ [ruby-dev:36082]
-Thu Sep 4 01:12:03 2008 NAKAMURA Usaku <usa@ruby-lang.org>
+Wed Jan 21 11:12:55 2009 NAKAMURA Usaku <usa@ruby-lang.org>
* win32/win32.c (filetime_to_timeval): new function, split from
gettimeofday().
@@ -15212,5611 +383,311 @@ Thu Sep 4 01:12:03 2008 NAKAMURA Usaku <usa@ruby-lang.org>
* win32/win32.c (filetime_to_unixtime): ditto. [ruby-dev:36135]
-Thu Sep 4 01:00:57 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * transcode.c (transcode_restartable0): avoid VC++6's bug.
-
-Thu Sep 4 00:26:27 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * io.c (make_writeconv): follow akr's previous commit.
-
-Thu Sep 4 00:09:05 2008 Tanaka Akira <akr@fsij.org>
-
- * include/ruby/encoding.h (rb_econv_option_t): removed. Since
- rb_econv_option_t has only one field, int flags, rb_econv_option_t is
- replaced by int.
-
- * include/ruby/io.h: follow the above change.
-
- * io.c: ditto.
-
- * transcode.c: ditto.
-
-Thu Sep 4 00:04:59 2008 Koichi Sasada <ko1@atdot.net>
-
- * win32/win32.c: fix ruby/signal.h depending codes.
-
-Thu Sep 4 00:01:45 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * test/etc/test_etc.rb (test_getpwuid, test_getgrgid): use
- Process.euid and egid instead of Etc.getlogin to identify current
- user which may be different from a login one (e.g., su command).
-
-Wed Sep 3 23:52:47 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * test/etc/test_etc.rb: check only typical use of
- setpwent/getpwent/endpwent and setgrent/getgrent/endgrent.
-
-Wed Sep 3 23:33:09 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode.c (rb_transcoding): moved from transcode_data.h.
- (TRANSCODING_READBUF): ditto.
- (TRANSCODING_WRITEBUF): ditto.
- (TRANSCODING_STATE_EMBED_MAX): ditto.
- (TRANSCODING_STATE): ditto.
-
-Wed Sep 3 23:03:37 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode_data.h (rb_transcoding): remove stateful field.
- add state field.
- (TRANSCODING_STATE): defined.
- (rb_transcoder): add fields: state_size, state_init_func,
- state_fini_func.
- change rb_transcoding* argument to void*.
-
- * transcode.c (transcode_restartable0): use TRANSCODING_STATE for
- first arguments of transcoder functions.
- (rb_transcoding_open_by_transcoder): initialize state field.
- (rb_transcoding_close): finalize state field.
-
- * tool/transcode-tblgen.rb: provide state size/init/fini.
-
- * enc/trans/newline.trans (universal_newline_init): defined.
- (fun_so_universal_newline): take void* as a state pointer.
- (rb_universal_newline): provide state size/init/fini.
- (rb_crlf_newline): ditto.
- (rb_cr_newline): ditto.
-
- * enc/trans/iso2022.trans (iso2022jp_init): defined.
- (fun_si_iso2022jp_to_eucjp): take void* as a state pointer.
- (fun_so_iso2022jp_to_eucjp): ditto.
- (fun_so_eucjp_to_iso2022jp): ditto.
- (iso2022jp_reset_sequence_size): ditto.
- (finish_eucjp_to_iso2022jp): ditto.
- (rb_ISO_2022_JP_to_EUC_JP): provide state size/init/fini.
- (rb_EUC_JP_to_ISO_2022_JP): ditto.
-
- * enc/trans/utf_16_32.trans (fun_so_from_utf_16be): take void* as a
- state pointer.
- (fun_so_to_utf_16be): ditto.
- (fun_so_from_utf_16le): ditto.
- (fun_so_to_utf_16le): ditto.
- (fun_so_from_utf_32be): ditto.
- (fun_so_to_utf_32be): ditto.
- (fun_so_from_utf_32le): ditto.
- (fun_so_to_utf_32le): ditto.
- (rb_from_UTF_16BE): provide state size/init/fini.
- (rb_to_UTF_16BE): ditto.
- (rb_from_UTF_16LE): ditto.
- (rb_to_UTF_16LE): ditto.
- (rb_from_UTF_32BE): ditto.
- (rb_to_UTF_32BE): ditto.
- (rb_from_UTF_32LE): ditto.
- (rb_to_UTF_32LE): ditto.
-
- * enc/trans/japanese.trans (fun_so_eucjp2sjis): take void* as a state
- pointer.
- (fun_so_sjis2eucjp): ditto.
- (rb_eucjp2sjis): provide state size/init/fini.
- (rb_sjis2eucjp): provide state size/init/fini.
-
-Wed Sep 3 22:31:11 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * lib/mathn.rb (Integer): moved into prime.rb.
- (Prime): ditto.
-
- * lib/prime.rb (Integer): moved from mathn.rb.
- (Integer.each_prime): added.
- (Integer#prime?): added.
- (Prime): moved from mathn.rb.
- Its implementation was rewritten. see [ruby-dev:35863].
- And patched by Keiju ISHITSUKA <keiju@ishitsuka.com>,
- see [ruby-dev:36128].
- (Prime.new): obsolete.
- (Prime.instance): added.
- (Prime.each): added.
- (Prime.int_from_prime_division): added.
- (Prime.prime_division): added.
- (Prime.prime?): added.
- Patch by TOYOFUKU Chikanobu
- <nobu_toyofuku at nifty.com> in [ruby-dev:36067].
- (Prime.cache): removed.
- (Prime.primes): removed.
- (Prime.primes_so_far): removed.
- (Prime#int_from_prime_division): added.
- (Prime#prime_division): added.
- (Prime#prime?): added.
- (Prime#primes): removed.
- (Prime#primes_so_far): removed.
- (Prime::PseudoPrmeGenerator): added.
- (Prime::EratosthenesGenerator): added.
- (Prime::TrialDivisionGenerator): added.
- (Prime::Generator23): added.
- (Prime::TrialDivision): added.
- Extracted from the previous implementation of Prime
- by Keiju ISHITSUKA.
- (Prime::EratosthenesSieve): added.
-
- * lib/.document (prime.rb): added
-
- * lib/README (prime.rb): added
-
- * test/test_prime.rb: added.
-
-Wed Sep 3 21:49:00 2008 David A. Black <dblack@rubypal.com>
-
- * lib/scanf.rb: fixed bug involving matching literal '['
-
- * test/scanf/test_scanf.rb: added test for scanf.rb fix
-
-Wed Sep 3 21:31:59 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode_data.h (WORDINDEX_SHIFT_BITS): defined.
- (WORDINDEX2INFO): defined.
- (INFO2WORDINDEX): defined.
-
- * tool/transcode-tblgen.rb: use WORDINDEX2INFO.
-
- * transcode.c: use INFO2WORDINDEX.
-
-Wed Sep 3 21:19:51 2008 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-
- * golf_prelude.rb: suppress warnings when goruby -v.
-
-Wed Sep 3 21:07:30 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode.c (BL_MIN_BYTE): defined.
- (BL_MAX_BYTE): defined.
- (BL_OFFSET): defined.
- (BL_ACTION): defined.
- (transcode_restartable0): use BL_MIN_BYTE, BL_MAX_BYTE and
- BL_ACTION.
-
-Wed Sep 3 20:58:30 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode.c (BYTE_ADDR): defined.
- (WORD_ADDR): ditto.
- (BL_BASE): use BYTE_ADDR and WORD_ADDR.
- (BL_INFO): use WORD_ADDR.
-
-Wed Sep 3 20:47:31 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode_data.h (rb_transcoder): new field: byte_array_length and
- word_array_length.
-
- * tool/transcode-tblgen.rb (transcode_generated_code): generate
- byte_array_length and word_array_length.
-
-Wed Sep 3 20:34:10 2008 Tanaka Akira <akr@fsij.org>
-
- * tool/transcode-tblgen.rb (ArrayCode): new class.
- (ActionMap#gen_array_code): moved to ArrayCode.
- (ActionMap#numelt_array_code): ditto.
- (ActionMap#array_code_insert_at_last): ditto.
- (TRANSCODE_GENERATED_BYTES_CODE): use ArrayCode.
- (TRANSCODE_GENERATED_WORDS_CODE): ditto.
-
-Wed Sep 3 20:08:35 2008 Tanaka Akira <akr@fsij.org>
-
- * enc/trans/japanese.trans: new file.
-
-Wed Sep 3 20:04:33 2008 Tanaka Akira <akr@fsij.org>
+Wed Jan 21 11:12:55 2009 NAKAMURA Usaku <usa@ruby-lang.org>
- * tool/transcode-tblgen.rb (ActionMap#gen_array_code): extracted from
- generate_lookup_node.
- (ActionMap#numelt_array_code): ditto.
- (ActionMap#array_code_insert_at_last): ditto.
+ * win32/win32.c (gettimeofday): tv_usec is usec, not msec.
+ [ruby-dev:36094]
-Wed Sep 3 20:01:01 2008 Tanaka Akira <akr@fsij.org>
-
- * parse.y (parser_encoding_name): defined.
- (parser_tokadd_mbchar): show encoding in the message of
- "invalid multibyte char" error.
-
-Wed Sep 3 19:28:04 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * vm_insnhelper.c (vm_method_missing): C99.
-
-Wed Sep 3 19:18:12 2008 Koichi Sasada <ko1@atdot.net>
-
- * test/ruby/test_thread.rb: fix test.
- [ruby-dev:35960]
-
-Wed Sep 3 17:48:32 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * enc/trans/make_transdb.rb: check $(srcdir)/enc/trans before
- enc/trans.
-
- * enc/trans/make_transdb.rb: keep names_t.
-
-Wed Sep 3 16:54:46 2008 Koichi Sasada <ko1@atdot.net>
-
- * include/ruby/signal.h: removed.
-
- * common.mk, class.c, eval.c, eval_intern.h, file.c, gc.c, hash.c,
- io.c, process.c, signal.c: vm_core.h: ditto.
- Some unused external global variables are also removed.
- (rb_prohibit_interrupt, rb_trap_immediate, rb_trap_pending,
- rb_thread_critical)
-
- * ext/openssl/ossl_ssl.c, ext/openssl/ossl_x509store.c,
- ext/readline/readline.c, ext/socket/depend,
- ext/socket/socket.c: ditto.
-
-Wed Sep 3 00:23:25 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * vm_insnhelper.c (vm_method_missing): copy arguments to allocated
- memory from machine stack. [ruby-dev:36064]
-
-Tue Sep 2 22:20:26 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode_data.h (base_element): removed.
- (BYTE_LOOKUP): removed.
- (BYTE_LOOKUP_BASE): don't cast.
- (BYTE_LOOKUP_INFO): ditto.
- (PType): unsigned int, instead of uintptr_t.
- (rb_transcoding): change type of next_field, conv_tree_start and
- word_array.
-
- * tool/transcode-tblgen.rb: generate word_array as array of unsigned
- int.
-
- * transcode.c (transcode_restartable0): follow the above type change.
-
-Tue Sep 2 21:22:22 2008 Tanaka Akira <akr@fsij.org>
-
- * tool/transcode-tblgen.rb: add prefix for byte_array and word_array.
-
-Tue Sep 2 20:57:14 2008 Tanaka Akira <akr@fsij.org>
-
- * enc/trans/make_transdb.rb: check foo.c only if foo.trans exists.
-
-Tue Sep 2 19:19:55 2008 Tanaka Akira <akr@fsij.org>
-
- * enc/trans/make_transdb.rb: error message improved.
-
-Tue Sep 2 14:05:50 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * enc/trans/utf_16_32.trans (from_UTF_8): rename from to_UTF_16BE
- because it was not collect.
-
-Tue Sep 2 14:00:54 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * enc/emacs_mule.c (svn:executable): dropped executable bit.
-
- * enc/make_encdb.rb (svn:executable): ditto.
-
-Tue Sep 2 12:58:58 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/Makefile.sub (COMPILERFLAG): new compiler flag to compile
- enc/trans/japanese*.c.
-
-Tue Sep 2 12:37:10 2008 Tanaka Akira <akr@fsij.org>
-
- * enc/trans/japanese_euc.trans: splitted from japanese.trans to avoid
- compiler limitation. reported by usa.
-
- * enc/trans/japanese_sjis.trans: ditto.
-
-Tue Sep 2 12:31:24 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/Makefile.sub (miniruby): new target.
-
-Tue Sep 2 11:47:36 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * marshal.c (struct load_arg): data is now st_table.
-
- * marshal.c (mark_load_arg): marks data and compat_tbl.
-
- * marshal.c (r_object0): no need to check if reentered.
-
- * marshal.c (marshal_load): make the wrapper with mark_load_arg.
-
-Tue Sep 2 10:49:18 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/win32.c (gettimeofday): easier calculation. use the definition
- of the Gregorian calendar.
-
-Tue Sep 2 10:33:12 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * common.mk (distclean-golf): moved golf_prelude.c here from
- distclean-local.
- (GOLFPRELUDE): added.
- (distclean-local): moved golf_prelude.c into distclean-golf.
-
-Tue Sep 2 10:09:17 2008 NAKAMURA Usaku <usa@ruby-lang.org>
+Wed Jan 21 11:12:55 2009 NAKAMURA Usaku <usa@ruby-lang.org>
* win32/win32.c (gettimeofday): calc tv_sec and tv_usec from system
time by myself. [ruby-dev:36084]
-Tue Sep 2 04:00:37 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode_data.h (o3): prevent sign extension on 64bit environment.
- (o4): ditto.
-
-Tue Sep 2 03:26:24 2008 Tanaka Akira <akr@fsij.org>
-
- * tool/transcode-tblgen.rb: comment removed in generated code.
-
-Tue Sep 2 03:16:42 2008 Tanaka Akira <akr@fsij.org>
-
- * tool/transcode-tblgen.rb: define TRANSCODE_TABLE_INFO in generated
- code. use it in rb_transcoder.
-
- * enc/trans/newline.trans: use TRANSCODE_TABLE_INFO.
-
- * enc/trans/iso2022.trans: ditto.
-
- * enc/trans/utf_16_32.trans: ditto.
-
-Tue Sep 2 03:04:33 2008 Tanaka Akira <akr@fsij.org>
-
- * tool/transcode-tblgen.rb: record infos and BYTE_LOOKUPs as index of
- word_array to avoid relocation.
-
- * transcode.c (transcode_restartable0): add word_array to get infos
- and BYTE_LOOKUPs.
-
- * transcode_data.h (BYTE_LOOKUP_INFO): change return type to
- uintptr_t.
-
-Tue Sep 2 02:48:30 2008 Tanaka Akira <akr@fsij.org>
-
- * tool/transcode-tblgen.rb: don't need to cast offsets array.
-
-Tue Sep 2 02:36:20 2008 Tanaka Akira <akr@fsij.org>
-
- * tool/transcode-tblgen.rb: record offsets array as index of
- byte_array to avoid relocation.
-
- * transcode.c (transcode_restartable0): add byte_array to get offsets
- array.
-
- * transcode_data.h (BYTE_LOOKUP_BASE): change return type to
- uintptr_t.
- (rb_transcoder): add fields: byte_array, word_array and word_size.
-
- * enc/trans/newline.trans: follow rb_transcoder change.
-
- * enc/trans/iso2022.trans: ditto.
-
- * enc/trans/utf_16_32.trans: ditto.
-
-Tue Sep 2 02:05:14 2008 Tanaka Akira <akr@fsij.org>
-
- * tool/transcode-tblgen.rb: make infos arrays and BYTE_LOOKUPs into
- single array.
-
-Tue Sep 2 01:47:44 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * common.mk (clean-golf): added.
- (distclean-golf): added.
- (realclean-golf): added.
- (clean): added clean-golf.
- (distclean): added distclean-golf.
- (realclean): added realclean-golf.
-
-Tue Sep 2 01:31:45 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * common.mk (realclean-local): added newline.c.
-
-Tue Sep 2 01:19:15 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode_data.h (BYTE_LOOKUP): change to uintptr_t array.
- (BYTE_LOOKUP_BASE): follow the type change.
- (BYTE_LOOKUP_INFO): ditto.
- (PType): ditto.
- (rb_transcoding): ditto.
-
- * tool/transcode-tblgen.rb: follow the type change.
-
- * transcode.c: ditto.
-
- * enc/trans/newline.trans: ditto.
-
- * enc/trans/iso2022.trans: ditto.
-
- * enc/trans/utf_16_32.trans: ditto.
-
-Mon Sep 1 23:32:46 2008 Tanaka Akira <akr@fsij.org>
+Wed Jan 21 11:12:55 2009 NAKAMURA Usaku <usa@ruby-lang.org>
- * transcode_data.h (BYTE_LOOKUP_BASE): abstract accessor for
- BYTE_LOOKUP.
- (BYTE_LOOKUP_INFO): ditto.
-
- * transcode.c (transcode_restartable0): use BYTE_LOOKUP_BASE and
- BYTE_LOOKUP_INFO.
-
-Mon Sep 1 23:14:25 2008 Tanaka Akira <akr@fsij.org>
-
- * tool/transcode-tblgen.rb: gather infos arrays and BYTE_LOOKUPs.
-
-Mon Sep 1 22:42:54 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * lib/mkmf.rb (distclean): added RM_RF conftest.dSYM.
- Fixes distclean-ext problem on Mac OS X.
- (RM_RF): added.
-
-Mon Sep 1 22:37:06 2008 Shugo Maeda <shugo@ruby-lang.org>
-
- * lib/rexml/document.rb: limit entity expansion. Thanks, Luka
- Treiber, Mitja Kolsek, and Michael Koziarski.
-
- * lib/rexml/entity.rb: ditto.
-
- * test/rexml/test_document.rb: ditto.
-
-Mon Sep 1 22:20:22 2008 Tanaka Akira <akr@fsij.org>
-
- * tool/transcode-tblgen.rb: make offsets arrays into single array.
-
-Mon Sep 1 21:46:18 2008 Tanaka Akira <akr@fsij.org>
-
- * tool/transcode-tblgen.rb: gather offsets arrays at top.
-
-Mon Sep 1 21:09:04 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * ./: removed rubyspec from svn:ignore subversion property.
- rubyspec directory is no longer used.
-
- * spec: added mspec and rubyspec to svn:ignore.
-
-Mon Sep 1 19:37:19 2008 Tanaka Akira <akr@fsij.org>
-
- * tool/transcode-tblgen.rb: ValidEncoding['eucJP-ms'] defined.
- "\xA2\xAF".encode("utf-8", "eucJP-ms") should raise
- Encoding::ConversionUndefined, not Encoding::InvalidByteSequence.
-
-Mon Sep 1 18:27:51 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/win32.c (gettimeofday): shouldn't use mktime(3) because it's
+ * win32/win32.c (gettimeofday): shouldn't use mktime(2) because it's
buggy about handling summer time.
reported by Yoshikawa <yoshixool AT gmail.com> at [ruby-dev:36071]
-Mon Sep 1 17:07:23 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * enc/euc_jp.c (euc-jp-ms): euc-jp-ms is not an alias of EUC-JP
- but eucJP-ms.
-
- * enc/trans/japanese.trans (eucJP-ms): eucJP-ms is the correct
- name of the encoding in Ruby. [ruby-dev:36070]
-
-Mon Sep 1 16:48:50 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/digest/md5/md5init.c (md5), ext/digest/rmd160/rmd160init.c
- (rmd160) ext/digest/sha1/sha1init.c (sha1),
- ext/digest/sha2/sha2init.c (sha256, sha384, sha512): constified.
-
-Mon Sep 1 15:15:40 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * enc/trans/japanese.trans: fix mapping priority.
- IBM extended is prior than NEC selected IBM.
-
-Mon Sep 1 14:44:22 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * tool/transcode-tblgen.rb (transcode_compile_tree): use the first
- mapping when some mappings are given for a character.
- [ruby-dev:36068]
-
- * tool/transcode-tblgen.rb: expandtab.
-
-Mon Sep 1 14:40:18 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * README.EXT (Appendix A): fixed the name of class
- Enumerator. Enumerable::Enumerator was renamed just
- Enumerator at revision 18564.
-
- * README.EXT (Appendix A): ditto.
-
-Mon Sep 1 14:37:58 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * tool/transcode-tblgen.rb: set ERB source filename for error message.
-
-Mon Sep 1 14:37:02 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * enc/depend: transdb.c may not present.
-
-Mon Sep 1 14:25:26 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * enc/trans/japanese.trans: fix Ruby 1.8 compatibility.
-
- * enc/trans/japanese.trans: fix mapping priority. [ruby-dev:36068]
-
-Mon Sep 1 14:24:14 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * test/ruby/test_transcode.rb (test_windows_31j): added.
-
-Mon Sep 1 14:00:04 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * README.EXT (Data-types): fixed for current status.
- (Manipulating Ruby data): mentioned some more functions.
- (Class/module definition): ditto.
- (Global variables shared between C and Ruby):
- fixed prototypes for the getter/setter's of global variables.
- (Appendix A): mentioned some more files.
-
- * README.EXT.ja: ditto.
-
-Mon Sep 1 11:31:49 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/fileutils.rb (copy_stream, fu_copy_stream0, copy_file): use
- IO.copy_stream to get rid of extraneous conversion.
-
-Mon Sep 1 02:55:15 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * strftime.c (rb_strftime): calc timezone offset by myself if system
- doesn't provide timezone info.
-
-Mon Sep 1 02:48:28 2008 Tanaka Akira <akr@fsij.org>
-
- * tool/transcode-tblgen.rb: change "illegal" to "invalid".
-
-Mon Sep 1 02:31:16 2008 Tanaka Akira <akr@fsij.org>
-
- * tool/transcode-tblgen.rb (transcode_generated_code): defined for
- generating table at once.
- (transcode_tblgen): returns an empty string.
- (transcode_generate_node): ditto.
-
- * enc/trans/newline.trans: use transcode_generated_code.
-
- * enc/trans/iso2022.trans: ditto.
-
- * enc/trans/single_byte.trans: ditto.
-
- * enc/trans/utf_16_32.trans: ditto.
-
- * enc/trans/japanese.trans: ditto.
-
- * enc/trans/korean.trans: ditto.
-
-Mon Sep 1 02:10:03 2008 Tanaka Akira <akr@fsij.org>
-
- * tool/transcode-tblgen.rb (citrus_decode_mapsrc): print logging
- message on STDERR.
-
-Mon Sep 1 01:24:09 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * enc/trans/eucjp-tbl.rb: replace by previous Citrus maps.
-
- * enc/trans/sjis-tbl.rb: ditto.
-
-Mon Sep 1 01:18:26 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * tool/transcode-tblgen.rb: add table generator from Citrus maps.
-
- * enc/trans/japanese.trans: use Citrus maps.
-
- * enc/trans/CP: add maps from Citrus.
-
- * enc/trans/JIS: ditto.
-
- * test/ruby/test_transcode.rb: Shift_JIS and EUC-JP doesn't support
- IBM extended characters.
-
-Mon Sep 1 00:19:45 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * common.mk (docs): removed a useless make target.
- tool/makedoc.rb was removed at revision 13919.
-
-Sun Aug 31 20:49:42 2008 Tadayoshi Funaba <tadf@dotrb.org>
-
- * complex.c (numeric_abs2): new.
-
-Sun Aug 31 18:22:04 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/mkmf.rb (have_devel?): checks if the compiler works.
-
-Sun Aug 31 18:02:41 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * Temporarily uses git://github.com/yugui/rubyspec.git
- until specs for 1.9 is merged into
- git://github.com/rubyspec/rubyspec.git.
-
-Sun Aug 31 18:06:49 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode.c (transcode.c): set source_encoding and
- destination_encoding as encoding object.
- (ecerr_source_encoding): new method.
- (ecerr_destination_encoding): ditto.
-
-Sun Aug 31 17:58:59 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/mkmf.rb (Logging.log_open): opens in binary mode to get rid of
- extra CR.
-
- * lib/mkmf.rb (try_func, try_var, have_struct_member),
- (scalar_ptr_type?, scalar_type?): use MAIN_DOES_NOTHING.
-
- * lib/mkmf.rb (MAIN_DOES_NOTHING): defaults to ordinary main.
-
- * win32/Makefile.sub (config): for MAIN_DOES_NOTHING for wince.
-
-Sun Aug 31 17:30:35 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * spec/README (How to run): added.
-
-Sun Aug 31 17:28:25 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * spec/default.mspec (config): added.
-
- * spec/default.mspec (target): replaced the built ruby
- to runruby.rb.
- Improved $LOAD_PATH on running specs.
-
- * spec/default.mspec (flags): ditto.
-
-Sun Aug 31 17:16:07 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode.c (make_econv_exception): rename instance variable names
- for storing encoding names.
- (ecerr_source_encoding_name): method renamed.
- (ecerr_destination_encoding_name): ditto.
-
-Sun Aug 31 16:57:36 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode.c (econv_putback): associate encoding to the result.
-
-Sun Aug 31 16:43:56 2008 Koichi Sasada <ko1@atdot.net>
-
- * include/ruby/intern.h: rename RB_UBF_DFL to
- RUBY_UBF_IO and RUBY_UBF_PROCESS.
- Because there is no default (universal) unblocking function.
-
- * ext/socket/socket.c, file.c, io.c, process.c, thread.c: ditto.
-
-Sun Aug 31 16:42:23 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode.c (econv_insert_output): raise ArgumentError on failure.
-
-Sun Aug 31 16:39:17 2008 Koichi Sasada <ko1@atdot.net>
-
- * bootstraptest/test_thread.rb: add a test.
-
-Sun Aug 31 16:34:41 2008 Tanaka Akira <akr@fsij.org>
-
- * enc/trans/single_byte.trans (us_ascii_map): don't define 8bit bytes.
-
-Sun Aug 31 14:27:27 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode.c (econv_last_error): new method.
-
-Sun Aug 31 14:17:34 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode.c (econv_primitive_convert): make two arguments,
- destination_byteoffset and destination_bytesize, optional.
-
-Sun Aug 31 14:12:06 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode.c (make_econv_exception): error message simplified.
-
-Sun Aug 31 13:47:59 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/coverage/coverage.c (rb_mCoverage): removed unneeded static variable.
-
- * ext/socket/socket.c (unix_recv_io): ditto.
-
- * ext/socket/socket.c (mConst): ditto.
-
-Sun Aug 31 13:45:41 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/openssl/ossl_ocsp.c (ossl_ocspres_initialize): fix for
- initialization of r18168.
-
-Sun Aug 31 13:42:39 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/ripper/eventids2.c (ripper_init_eventids2): use rb_intern_const.
-
- * ext/ripper/tools/generate.rb (generate_eventids1): ditto.
-
- * ext/ripper/tools/generate.rb (generate_eventids2_table): ditto.
-
-Sun Aug 31 12:56:00 2008 Tanaka Akira <akr@fsij.org>
-
- * ext/dl/mkcallback.rb (rb_dl_init_callbacks): fix indent.
-
-Sun Aug 31 11:39:21 2008 Tanaka Akira <akr@fsij.org>
-
- * ext/strscan/strscan.c (strscan_do_scan): fix usecnt decrement.
-
-Sun Aug 31 04:38:47 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode.c (econv_putback): make max argument optional.
-
-Sun Aug 31 04:35:21 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode.c (rb_econv_putback): putback from last byte.
-
-Sun Aug 31 04:27:04 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode.c (econv_putback): renamed from econv_primitive_putback.
-
-Sun Aug 31 04:22:51 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode.c (econv_insert_output): renamed from
- econv_primitive_insert_output.
-
-Sun Aug 31 04:20:46 2008 Tanaka Akira <akr@fsij.org>
-
- * test/ruby/test_econv.rb: follow econv_primitive_errinfo change.
-
-Sun Aug 31 03:44:24 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode.c (econv_primitive_errinfo): 5th element (partial_input)
- removed from result.
-
-Sun Aug 31 01:53:31 2008 Tanaka Akira <akr@fsij.org>
-
- * ext/dl/mkcallback.rb: split callback.h to callback-[0-9].c to reduce
- memory consumption on compilation. [ruby-dev:31898]
-
- * ext/dl/depend: add dependency for callback-[0-9].[co].
-
-Sun Aug 31 01:27:46 2008 Tanaka Akira <akr@fsij.org>
-
- * ext/dl/mkcallback.rb (foreach_proc_entry): extracted.
- (gencallback): ditto.
- (gen_push_proc_ary): ditto.
- (gen_push_addr_ary): ditto.
-
-Sat Aug 30 23:51:01 2008 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
-
- * test/rinda/test_tuplebag.rb (test_has_expires_eh): fix failures
- [ruby-dev:35937].
-
-Sat Aug 30 23:38:00 2008 Tanaka Akira <akr@fsij.org>
-
- * ext/dl/test/test_import.rb: fix character code.
-
- * ext/dl/test/test_func.rb: ditto.
-
-Sat Aug 30 22:23:31 2008 Tadayoshi Funaba <tadf@dotrb.org>
-
- * rational.c: added a static variable for nurat_to_f.
-
-Sat Aug 30 20:05:41 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/win32.c (rb_w32_open, rb_w32_read, rb_w32_write): fallback to
- MSVCRT if text mode is specified. this case will not be used from
- ruby itself.
-
-Sat Aug 30 19:49:38 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/win32.c (rb_w32_read): EOF is not error.
- ref [ruby-dev:36050]
-
-Sat Aug 30 18:17:40 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (struct token_info): constified.
-
- * parse.y (token_info_get_column, token_info_has_nonspaces),
- (token_info_push, token_info_pop): constified.
-
-Sat Aug 30 15:43:03 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * ext/openssl/ossl_config.c (Init_ossl_config): memory leak fixed.
- a patch <shinichiro.hamaji at gmail.com> in [ruby-dev:35880].
-
- * ext/openssl/ossl_x509ext.c (ossl_x509ext_set_value): ditto.
-
- * ext/strscan/strscan.c (strscan_do_scan): ditto.
-
-Sat Aug 30 14:58:32 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/openssl/ossl_x509ext.c (ossl_x509ext_initialize): fix for
- initialization of r18168.
-
-Sat Aug 30 14:47:30 2008 Tanaka Akira <akr@fsij.org>
-
- * ext/dl/mkcallback.rb: fix continuation line detection.
-
-Sat Aug 30 14:39:51 2008 Tanaka Akira <akr@fsij.org>
-
- * ext/dl/mkcallback.rb (rb_dl_init_callbacks): avoid GC problem which
- is caused by 'GC.stress=true; require "dl"'.
-
-Sat Aug 30 11:54:17 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * parse.y (token_info_push): -w warns indentation level mismatch.
- based on a patch from Yukina Yamano presented at RubyKaigi'07.
- See <http://jp.rubyist.net/RubyKaigi2007/Log0609-LT06.html> and
- <http://www.logic-junction.com/products/rubyend.html> (Japanese).
-
-Sat Aug 30 10:46:44 2008 Koichi Sasada <ko1@atdot.net>
-
- * ext/iconv/iconv.c: remove include pragma for "ruby/intern.h".
-
-Sat Aug 30 10:43:03 2008 Koichi Sasada <ko1@atdot.net>
-
- * parse.y: remove include pragma for "ruby/intern.h".
-
-Sat Aug 30 10:41:57 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/rake.rb (Rake::Application#help): fix for OPTIONAL_ARGUMENT and
- multiple short options. [ruby-dev:36051]
-
-Sat Aug 30 08:59:25 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * include/ruby/intern.h (rb_file_s_absolute_path),
- (rb_file_absolute_path): prototyped.
-
-Sat Aug 30 08:09:36 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * encoding.c (enc_compatible_p): use TYPE not BUILTIN_TYPE.
- [ruby-dev:36048]
-
-Sat Aug 30 07:48:48 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * encoding.c (enc_compatible_p): add SPECIAL_CONST_P check.
- [ruby-dev:36048]
-
- * test/ruby/test_m17n.rb (test_compatible): fix test.
-
-Sat Aug 30 02:48:11 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * object.c (rb_obj_freeze): update rdoc to mention RuntimeError
- (not TypeError any longer) would be raised. [ruby-dev:35982]
-
-Sat Aug 30 01:55:30 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * bignum.c (bigdivmod): remove redundant code. a patch from
- TOYOFUKU Chikanobu <nobu_toyofuku at nifty.com> in [ruby-dev:36044].
-
-Sat Aug 30 01:37:20 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/cgi.rb (CGI#initialize): remove unused constants. a patch
- from Takeyuki Fujioka in [ruby-dev:36046].
-
-Fri Aug 29 22:29:41 2008 Tadayoshi Funaba <tadf@dotrb.org>
-
- * complex.c ({nucomp,numeric}_rect): new.
-
- * complex.c: added some aliases
- (::rectangular, ::rect, #rectangular, #rect, #phase,
- #magnitude).
-
- * complex.c (string_to_c_internal): should not strip any null
- bytes.
-
- * rational.c (string_to_r_internal): ditto.
-
- * rational.c (i_gcd): reverted to nurat 0.0.2's one.
-
- * numeric.c: added an alias (#magnitude).
-
- * bignum.c: ditto.
-
- * test/ruby/test_complex.rb: added assertions.
-
- * test/ruby/test_rational.rb: ditto.
-
-Fri Aug 29 19:46:02 2008 Koichi Sasada <ko1@atdot.net>
-
- * gc.c, include/ruby/ruby.h: rename T_DEFERRED to T_ZOMBIE.
-
-Fri Aug 29 18:22:27 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * encoding.c (enc_compatible_p): raise TypeError when argument is not
- String nor Regexp.
-
-Fri Aug 29 18:20:56 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * string.c (rb_str_index_m): only regexp uses byte offset.
-
- * string.c (rb_str_rindex_m): ditto.
-
-Fri Aug 29 16:48:34 2008 Koichi Sasada <ko1@atdot.net>
-
- * vm_insnhelper.c (vm_call_method): copy arguments to allocated
- memory from machine stack. [ruby-dev:36028]
-
- * KNOWNBUGS.rb, bootstraptest/test_method.rb: move fixed test.
-
-Fri Aug 29 12:19:12 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/openssl/ossl_x509attr.c (ossl_x509attr_initialize): fix for
- initialization of r18168.
-
- * ext/openssl/ossl_ocsp.c (ossl_ocspreq_initialize): ditto.
-
- * ext/openssl/ossl_x509name.c (ossl_x509name_initialize): ditto.
-
-Fri Aug 29 11:04:03 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * encoding.c (rb_enc_compatible): ASCII compatible string and US-ASCII
- regexp is compatible. [ruby-dev:36033]
-
- * string.c (rb_str_index_m): second argument is position of character.
- by usa. [ruby-dev:36033]
-
- * string.c (rb_str_rindex_m): ditto.
-
-Fri Aug 29 04:47:49 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/win32.c (rb_w32_read, rb_w32_write): more accurate handling
- of wait result.
-
-Fri Aug 29 02:59:35 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode.c (econv_finish): new method.
-
-Fri Aug 29 02:45:29 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode.c (econv_convert): new method.
-
-Fri Aug 29 02:38:14 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode.c (econv_primitive_convert): accept nil as
- destination_bytesize for unlimited destination size.
-
-Fri Aug 29 02:11:46 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode.c (econv_primitive_convert): accept nil as input for empty
- input.
-
-Fri Aug 29 02:03:56 2008 Shugo Maeda <shugo@ruby-lang.org>
-
- * strftime.c (rb_strftime): supported %s and %P.
-
- * time.c (time_strftime): ditto.
-
- * test/ruby/test_time.rb (test_strftime): ditto.
-
-Fri Aug 29 01:57:58 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode.c (sym_invalid_byte_sequence): new variable.
- (sym_undefined_conversion): ditto.
- (sym_destination_buffer_full): ditto.
- (sym_source_buffer_empty): ditto.
- (sym_finished): ditto.
- (sym_output_followed_by_input): ditto.
- (sym_incomplete_input): ditto.
- (econv_result_to_symbol): use above variables.
- (Init_transcode): initialize above variables.
-
-Fri Aug 29 00:53:40 2008 Shugo Maeda <shugo@ruby-lang.org>
-
- * strftime.c (rb_strftime): fixed a bug of padding.
-
- * test/ruby/test_time.rb: ditto.
-
-Fri Aug 29 00:19:54 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/win32.c (set_pioinfo_extra): use MSVCRT's open() and close().
-
-Fri Aug 29 00:03:13 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * file.c (file_expand_path): check invalid access.
-
-Thu Aug 28 23:55:50 2008 Shugo Maeda <shugo@ruby-lang.org>
-
- * strftime.c (rb_strftime): Time.mktime(2000).strftime("%-S") should
- return "0", not "".
-
- * test/ruby/test_time.rb: ditto.
-
-Thu Aug 28 23:55:22 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * test/ruby/test_time.rb: suppress warning during test.
-
-Thu Aug 28 23:50:47 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * test/ruby/test_time.rb (test_strftime): make test for %a independent
- from local timezone. [ruby-dev:35992]
-
-Thu Aug 28 23:39:49 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * string.c (rb_str_shared_replace): remove corrupt noembed string
- which causes SEGV. [ruby-dev:35989]
-
-Thu Aug 28 23:36:15 2008 Tanaka Akira <akr@fsij.org>
-
- * common.mk: dependency updated.
-
-Thu Aug 28 23:28:57 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * KNOWNBUGS.rb: add a test. see [ruby-dev:36028]
-
-Thu Aug 28 21:43:05 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/win32.c, include/ruby/win32.h (rb_w32_open): overlapped file
- I/O support.
-
- * win32/win32.c, include/ruby/win32.h (rb_w32_pipe): overlapped pipe
- I/O support.
-
- * win32/win32.c (rb_w32_read, rb_w32_write): overlapped I/O support to
- enable canceling I/O.
-
- * thread_win32.c (ubf_handle): remove workaround.
-
-Thu Aug 28 20:22:49 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * vm_insnhelper.c (vm_yield_setup_args): object with to_ary should
- behave like array. a patch from Yusuke Endoh <mame at tsg.ne.jp>
- in [ruby-dev:35988]. [ruby-dev:35977]
-
- * object.c (convert_type): call less rb_intern() less frequently
- by using cache structure.
-
- * vm_method.c (rb_method_node): fail earlier if no method found.
-
-Thu Aug 28 19:04:50 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * bootstraptest/test_io.rb: no need to create real file.
-
-Thu Aug 28 09:26:53 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * test/cgi/test_cgi_multipart.rb: add test for multipart.
- Patch by Takeyuki Fujioka. [ruby-dev:36014]
- From CGIAlt http://cgialt.rubyforge.org/
-
-Thu Aug 28 09:22:01 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * test/cgi/test_cgi_modruby.rb: add test for mod_ruby adaptor.
- Patch by Takeyuki Fujioka. [ruby-dev:36013]
- From CGIAlt http://cgialt.rubyforge.org/
-
-Thu Aug 28 09:17:10 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * test/cgi/test_cgi_header.rb: add test for CGI::Header.
- Patch by Takeyuki Fujioka. [ruby-dev:36010] [ruby-dev:36011]
- From CGIAlt http://cgialt.rubyforge.org/
-
-Thu Aug 28 02:16:49 2008 Tanaka Akira <akr@fsij.org>
-
- * include/ruby/io.h (rb_io_t): refcnt field removed.
- (MakeOpenFile): refcnt initialization removed.
-
- * io.c (rb_io_fptr_finalize): don't check refcnt.
- (rb_io_close_read): don't use refcnt.
-
-Thu Aug 28 00:07:59 2008 Tanaka Akira <akr@fsij.org>
-
- * io.c (rb_io_initialize): don't accept IO object. [ruby-dev:35895]
-
-Wed Aug 27 23:28:51 2008 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-
- * ext/win32ole/win32ole.c (ole_invoke): WIN32OLE#[] and WIN32OLE#[]=
- accepts number argument.
-
- * test/win32ole/test_win32ole.rb: ditto.
-
-Wed Aug 27 14:45:34 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * test/cgi/test_cgi_core.rb: add core test.
- Patch by Takeyuki Fujioka. [ruby-dev:36001] [ruby-dev:36002]
- From CGIAlt http://cgialt.rubyforge.org/
-
-Wed Aug 27 10:34:42 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * lib/cgi.rb (CGI::Cookie): remove delegate.
- Patch by Takeyuki Fujioka. [ruby-dev:35995]
-
- * test/cgi/test_cgi_cookie.rb: added for above.
- Patch by Takeyuki Fujioka. [ruby-dev:35996]
- From CGIAlt http://cgialt.rubyforge.org/
-
-Wed Aug 27 01:13:54 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode.c (transcode_loop): simplified.
-
-Wed Aug 27 01:03:23 2008 Tanaka Akira <akr@fsij.org>
-
- * include/ruby/encoding.h (rb_econv_result_t): enumeration constant:
- econv_incomplete_input.
-
- * io.c (finish_writeconv): check econv_incomplete_input.
-
- * transcode.c (transcode_restartable0): return econv_incomplete_input
- for unexpected end of source buffer.
- (trans_sweep): check econv_incomplete_input.
- (rb_trans_conv): ditto.
- (rb_econv_convert0): ditto.
- (rb_econv_convert): ditto.
- (transcode_loop): ditto.
- (make_econv_exception): change message for econv_incomplete_input.
- (econv_result_to_symbol): return :incomplete_input for
- econv_incomplete_input.
- (ecerr_incomplete_input): new method.
-
-Wed Aug 27 00:05:55 2008 Tanaka Akira <akr@fsij.org>
-
- * include/ruby/io.h (rb_io_t): rename crbuf to cbuf.
-
- * io.c: follow the renaming.
-
-Tue Aug 26 23:52:24 2008 Tanaka Akira <akr@fsij.org>
-
- * include/ruby/encoding.h (rb_econv_elem_t): move to transcode.c
- (rb_econv_t): defined as an incomplete type.
-
- * transcode.c (rb_econv_elem_t): moved from encoding.h.
- (rb_econv_t): complete type defined.
-
-Tue Aug 26 22:44:12 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * time.c (time_asctime): workaround for MSVCRT's bug.
- based on a patch from wanabe <s.wanabe AT gmail.com> at
- [ruby-dev:35831] and a suggestion by KIMURA Koichi
- <kbk AT kt.rim.or.jp> at [ruby-dev:35832]
- fixed [ruby-dev:35555]
-
-Tue Aug 26 21:53:56 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode.c (rb_econv_open): disable newline conversion for ASCII
- incompatible encodings.
- (str_transcode0): don't need disable newline conversion here.
-
-Tue Aug 26 21:44:39 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode.c (rb_econv_binmode): binmode is effective only once.
-
-Tue Aug 26 19:43:59 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * file.c (rb_file_s_expand_path): new class method for class File.
-
- * file.c (file_expand_path): add absolute_path handling (no ~user
- expansion). [ruby-core:18319]
-
-Tue Aug 26 19:27:54 2008 Akinori MUSHA <knu@iDaemons.org>
-
- * test/ruby/test_enum.rb (TestEnumerable#test_each_with_object):
- Add a test for Enumerable#each_with_object.
-
-Tue Aug 26 19:25:44 2008 Akinori MUSHA <knu@iDaemons.org>
-
- * test/ruby/test_enumerator.rb (TestEnumerator#test_with_object):
- Add (back) the test for Enumerator#with_object.
-
-Tue Aug 26 16:16:43 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * test/cgi/test_cgi_tag_helper.rb: add more tests for html3.
- Patch by Takeyuki Fujioka. [ruby-dev:35975]
- From CGIAlt http://cgialt.rubyforge.org/
-
-Tue Aug 26 14:43:10 2008 Akinori MUSHA <knu@iDaemons.org>
-
- * enumerator.c: Activate Enumerator#with_object and add
- Enumerable#each_with_object. [experimental]
-
-Tue Aug 26 14:38:32 2008 Akinori MUSHA <knu@iDaemons.org>
-
- * enumerator.c (enumerator_initialize),
- test/ruby/test_enumerator.rb: Add an ability to generate an
- enumerator from a block. [experimental] [ruby-dev:35903]
-
-Tue Aug 26 13:25:25 2008 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * test/ruby/test_transcode.rb: added test_euc_jp
- (contributed by Yoshihiro Kambayashi)
-
-Tue Aug 26 11:54:15 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * test/cgi/test_cgi_tag_helper.rb: added by Takeyuki Fujioka.
- [ruby-dev:35971]
-
-Tue Aug 26 11:33:30 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * lib/cgi.rb (nOE_element_def): fix error when cascade methods which
- don't have arguments. Patch by Takeyuki Fujioka. [ruby-dev:35964]
-
- * lib/cgi.rb (blockquote): String#collect (this depends on
- String#each) is no longer exists.
- Patch by Takeyuki Fujioka. [ruby-dev:35946]
-
- * lib/cgi.rb (blockquote): ditto.
-
-Tue Aug 26 03:06:48 2008 Tanaka Akira <akr@fsij.org>
-
- * io.c (make_writeconv): copy invalid/undef flags.
-
-Tue Aug 26 02:47:08 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * common.mk (dist): tool/make-snapshot is executable.
-
- * tool/make-snapshot (package): supported release numbers 1.9.0-x.
-
-Tue Aug 26 02:43:50 2008 Tanaka Akira <akr@fsij.org>
-
- * include/ruby/io.h (rb_io_t): new field: writeconv_pre_opts.
-
- * io.c (make_writeconv): initialize writeconv_pre_opts.
- (io_fwrite): use writeconv_pre_opts.
-
-Tue Aug 26 01:48:31 2008 Tanaka Akira <akr@fsij.org>
-
- * io.c: test _WIN32 for CRLF platform. (cygwin defines O_BINARY.)
-
-Tue Aug 26 01:29:26 2008 Tanaka Akira <akr@fsij.org>
-
- * io.c: force CRLF handling if RUBY_TEST_CRLF_ENVIRONMENT is defined.
- This is only for testing.
-
-Tue Aug 26 01:26:31 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode.c (str_transcode0): disable newline conversion for ASCII
- incompatible encoding.
-
-Tue Aug 26 00:55:46 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode.c (str_transcode0): don't short cut for newline conversion.
-
-Tue Aug 26 00:36:01 2008 Tanaka Akira <akr@fsij.org>
-
- * io.c (io_fwrite): add TEXTMODE_NEWLINE_ENCODER to option for
- rb_str_transcode.
-
-Tue Aug 26 00:24:23 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode.c (make_econv_exception): show readagain part for invalid
- byte sequence exception. store the part as an instance variable.
- (ecerr_readagain_bytes): new method to access the readagain part.
-
-Tue Aug 26 00:02:49 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * ext/bigdecimal/bigdecimal.c (VpMult): fix double free.
-
-Mon Aug 25 23:59:36 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode.c (rb_econv_open): make last_tc NULL if there are only
- additional transcoders.
- (econv_description): extracted from rb_econv_open_exc.
- (rb_econv_open_exc): use econv_description.
- (econv_inspect): use econv_description.
-
-Mon Aug 25 23:56:42 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32.c (init_stdhandle): set binmode.
-
-Mon Aug 25 23:38:17 2008 Tadayoshi Funaba <tadf@dotrb.org>
-
- * lib/date/format.rb(strftime): %[LN] can print with given
- arbitrary precision.
-
- * lib/date/format.rb(strftime): optional flags and filed width
- should also affect %[nt].
-
-Mon Aug 25 23:01:17 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * compile.c (defined_expr): default defined? should return
- "expression" without evaluating the expression. [ruby-dev:35967]
-
-Mon Aug 25 22:46:01 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * test/ruby/test_thread.rb (test_status_and_stop_p): reduce the risk
- of race condition.
-
-Mon Aug 25 22:39:57 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * lib/irb/extend-command.rb (def_extend_command): check number of
- arguments. [ruby-dev:35074]
-
- * lib/irb/ext/multi-irb.rb (search): check if a corresponding job is
- found. [ruby-dev:35074]
-
-Mon Aug 25 22:29:13 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * test/ruby/test_io.rb (test_dup): fix typo. see [ruby-dev:35958]
-
-Mon Aug 25 22:02:35 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode.c (rb_econv_open_by_transcoder_entries): initialize
- last_error. num_trans may be zero.
- (rb_econv_convert0): num_trans may be zero.
- (rb_econv_putbackable): ditto.
- (rb_econv_putback): ditto.
- (rb_econv_convert): input_ptr and output_ptr may be NULL.
-
-Mon Aug 25 19:05:27 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * compile.c (defined_expr): should handle NODE_{AND,OR} as
- "expression". [ruby-dev:35951]
-
-Mon Aug 25 17:36:26 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * include/ruby/intern.h (rb_io_ungetbyte): added prototype.
-
- * io.c (rb_io_gets): use rb_io_getline_1 for unget buffer.
-
- * ruby.c (load_file): use rb_io_ungetbyte.
-
- * transcode.c (rb_econv_substr_append): fix for buffer overrun.
-
- * win32/enc-setup.mak (BUILTIN_TRANSOBJS): added.
-
-Mon Aug 25 14:22:21 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * parse.y (YYSTYPE): struct RVarmap has been no longer
- defined.
- see also r11717 by matz.
-
-Mon Aug 25 10:42:18 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * transcode.c (rb_econv_open_exc): constified.
-
-Mon Aug 25 07:10:21 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * enc/emacs_mule.c: fix ctype.
-
-Mon Aug 25 00:52:31 2008 Tanaka Akira <akr@fsij.org>
-
- * configure.in (BUILTIN_TRANSSRCS): defined.
- (BUILTIN_TRANSOBJS): defined.
-
- * enc/Makefile.in (BUILTIN_TRANSES): defined.
-
- * enc/make_encmake.rb (BUILTIN_TRANSES): defined.
-
- * enc/depend: don't generate rules for builtin transcoders.
-
- * common.mk (COMMONOBJS): add BUILTIN_TRANSOBJS.
- (enc.mk): pass BUILTIN_TRANSOBJS.
- (newline.c): new rule.
- (newline.$(OBJEXT)): new rule.
- (srcs): newline.c added.
-
- * Makefile.in (BUILTIN_TRANSSRCS): defined.
- (BUILTIN_TRANSOBJS): defined.
-
- * transcode.c (Init_transcode): call Init_newline.
-
-Mon Aug 25 00:11:02 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode.c (declare_transcoder): arguments order changed.
- (rb_declare_transcoder): call declare_transcoder just once.
-
-Sun Aug 24 19:48:46 2008 Tanaka Akira <akr@fsij.org>
-
- * include/ruby/encoding.h (rb_econv_t): use rb_econv_option_t.
-
- * transcode.c: follow the rb_econv_t change.
-
-Sun Aug 24 19:40:13 2008 Tanaka Akira <akr@fsij.org>
-
- * io.c (rb_io_init_copy): copy encs.
-
-Sun Aug 24 19:17:31 2008 Tanaka Akira <akr@fsij.org>
-
- * io.c (rb_io_open): add an argument: vperm.
- (open_key_args): call rb_io_open with perm.
-
-Sun Aug 24 19:11:07 2008 Tanaka Akira <akr@fsij.org>
-
- * io.c (sym_invalid): removed.
- (sym_undef): removed.
- (sym_ignore): removed.
- (sym_replace): removed.
-
-Sun Aug 24 19:07:17 2008 Tanaka Akira <akr@fsij.org>
-
- * io.c (rb_io_reopen): initialize fptr->encs.opts.
-
-Sun Aug 24 18:37:42 2008 Tanaka Akira <akr@fsij.org>
-
- * io.c (rb_io_s_pipe): accept optional hash.
- (rb_io_set_encoding): ditto.
- (rb_io_extract_modeenc): use rb_econv_opts to initialize
- ecopts.
- (rb_file_open_generic): ditto.
- (rb_file_open_internal): ditto.
- (io_encoding_set): new argument: opt.
- (argf_set_encoding): copy fptr->encs.opts to argf_ecopts.
-
- * transcode.c (rb_econv_opts): accept Qnil for initialization.
-
-Sun Aug 24 18:10:08 2008 Tanaka Akira <akr@fsij.org>
-
- * include/ruby/io.h (rb_io_enc_t): add opts field.
- (FMODE_INVALID_MASK): removed.
- (FMODE_INVALID_IGNORE): ditto.
- (FMODE_INVALID_REPLACE): ditto.
- (FMODE_UNDEF_MASK): ditto.
- (FMODE_UNDEF_IGNORE): ditto.
- (FMODE_UNDEF_REPLACE): ditto.
- (MakeOpenFile): initialize the opts field.
-
- * io.c (make_writeconv): use the opts field.
- (io_fwrite): ditto.
- (make_readconv): ditto.
- (argf_ecopts): new macro.
- (rb_io_extract_modeenc): fill the opts field.
- (argf_next_argv): ditto.
- (rb_file_open_generic): initialize the opts field.
- (rb_file_open_internal): ditto.
- (io_encoding_set): ditto.
- (argf_set_encoding): ditto.
-
-Sun Aug 24 18:02:14 2008 Tanaka Akira <akr@fsij.org>
-
- * io.c (struct argf): use struct rb_io_enc_t.
- (argf_enc): follow the struct argf change.
- (argf_enc2): ditto.
-
-Sun Aug 24 17:36:21 2008 Tanaka Akira <akr@fsij.org>
-
- * include/ruby/encoding.h (rb_str_transcode): make 3rd argument
- rb_econv_option_t*.
-
- * transcode.c (transcode_loop): take rb_econv_option_t* as a argument.
- (str_transcode0): ditto.
- (str_transcode): make rb_econv_option_t and call str_transcode0 with
- it.
- (rb_str_transcode): take rb_econv_option_t*.
-
- * io.c (io_fwrite): follow the rb_str_transcode change.
-
-Sun Aug 24 16:47:32 2008 Tanaka Akira <akr@fsij.org>
-
- * include/ruby/io.h (rb_io_t): make enc and enc2 as struct
- rb_io_enc_t;
-
- * io.c: follow the structure change.
- (convconfig_t): defined by rb_io_enc_t.
-
-Sun Aug 24 16:19:25 2008 Tanaka Akira <akr@fsij.org>
-
- * include/ruby/encoding.h (rb_econv_opts): declared.
-
- * transcode.c (rb_econv_opts): defined.
-
- * io.c (rb_io_extract_modeenc): use rb_econv_opts.
-
-Sun Aug 24 16:06:30 2008 Tanaka Akira <akr@fsij.org>
-
- * include/ruby/encoding.h (rb_econv_option_t): defined.
- (rb_econv_open): 3rd arg changed.
- (rb_econv_open_exc): ditto.
-
- * io.c (make_writeconv): use rb_econv_option_t.
- (make_readconv): ditto.
- (rb_econv_open): take rb_econv_option_t for options.
- (rb_econv_open_exc): ditto.
- (transcode_loop): use rb_econv_option_t.
- (econv_init): use rb_econv_option_t.
-
-Sun Aug 24 15:43:41 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode.c (rb_econv_substr_append): associate dst with destination
- encoding when dst is created.
-
-Sun Aug 24 15:21:28 2008 Tanaka Akira <akr@fsij.org>
-
- * include/ruby/encoding.h (rb_str_transcode): add ecflags argument.
-
- * transcode.c (econv_opts): extracted from str_transcode.
- (str_transcode_enc_args): extracted from str_transcode.
- (str_transcode0): extracted from str_transcode.
- (str_transcode): use econv_opts, str_transcode_enc_args,
- str_transcode0.
- (rb_str_transcode): call str_transcode0.
- (econv_primitive_insert_output): give the additional argument for
- rb_str_transcode.
-
- * io.c (make_writeconv): use invalid/undef flags.
- (io_fwrite): ditto.
- (rb_scan_open_args): give the additional argument for
- rb_str_transcode.
-
-Sun Aug 24 13:27:42 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode.c (str_transcode): check last hash only if 0 < argc.
-
-Sun Aug 24 12:22:15 2008 Tanaka Akira <akr@fsij.org>
-
- * include/ruby/encoding.h (rb_econv_substr_append): renamed from
- rb_econv_string.
- (rb_econv_str_convert): declared.
- (rb_econv_substr_convert): declared.
- (rb_econv_str_append): declared.
-
- * io.c (io_fwrite): use rb_econv_str_convert instead of
- rb_econv_string.
-
- * transcode.c (rb_econv_substr_append): renamed from rb_econv_string.
- (rb_econv_str_append): new function.
- (rb_econv_substr_convert): ditto.
- (rb_econv_str_convert): ditto.
-
-Sun Aug 24 12:15:12 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * lib/net/http.rb (Net::HTTP#urlencode): str[0] returns char in 1.9.
- Patch by Junegunn Choi [ruby-core:18368]
-
-Sun Aug 24 12:02:39 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode.c (rb_econv_open): return NULL on error.
-
-Sun Aug 24 11:40:38 2008 Tanaka Akira <akr@fsij.org>
-
- * include/ruby/encoding.h (rb_econv_open_exc): declared.
-
- * transcode.c (rb_eNoConverter): new exception.
- (rb_econv_open_exc): new function.
- (transcode_loop): use rb_econv_open_exc.
-
- * io.c (make_writeconv): use rb_econv_open_exc.
- (make_readconv): ditto.
-
-Sun Aug 24 11:26:54 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * lib/cgi.rb (CGI::unescapeHTML): consider ISO-8859-1.
- [ruby-dev:35936]
-
-Sun Aug 24 10:55:00 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * enc/emacs_mule.c: support Emacs/Mule internal encoding.
-
-Sun Aug 24 08:03:31 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * strftime.c (daylight, timezone): not provided as dllexport on cygwin,
- right now.
-
-Sun Aug 24 06:39:05 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * lib/cgi.rb (CGI::unescapeHTML): more encoding sensible unescaping.
- [ruby-dev:35936]
-
-Sun Aug 24 04:23:19 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * encoding.c (enc_compatible_p): raise TypeError when argument is Encoding.
-
-Sat Aug 23 23:25:47 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * lib/cgi.rb (CGI#out): remove auto encoding conversion and set
- LANGUAGE. [ruby-dev:35922]
-
-Sat Aug 23 20:01:29 2008 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-
- * test/ruby/test_process.rb (TestProcess#test_rlimit_value):
- add Errno::EINVAL. [ruby-dev:35900]
-
-Sat Aug 23 18:29:29 2008 Tanaka Akira <akr@fsij.org>
-
- * io.c (rb_scan_open_args): use pop_last_hash.
-
-Sat Aug 23 16:59:42 2008 Tanaka Akira <akr@fsij.org>
-
- * include/ruby/io.h (FMODE_INVALID_MASK): defined.
- (FMODE_INVALID_IGNORE): defined.
- (FMODE_INVALID_REPLACE): defined.
- (FMODE_UNDEF_MASK): defined.
- (FMODE_UNDEF_IGNORE): defined.
- (FMODE_UNDEF_REPLACE): defined.
-
- * io.c (sym_invalid): defined.
- (sym_undef): defined.
- (sym_ignore): defined.
- (sym_replace): defined.
- (make_readconv): specify ECONV_INVALID_* and ECONV_UNDEF_* if
- FMODE_INVALID_* and FMODE_UNDEF_* is set.
- (rb_io_extract_modeenc): check {:invalid, :undef} => {:replace,
- :ignore} for FMODE_INVALID_* and FMODE_UNDEF_*.
-
-Sat Aug 23 17:06:57 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * strftime.c (rb_strftime): support more flags.
-
-Sat Aug 23 15:14:10 2008 Koichi Sasada <ko1@atdot.net>
-
- * vm_opts.h: enable "OPT_TRACE_INSTRUCTION" on default.
-
-Sat Aug 23 14:59:32 2008 Tanaka Akira <akr@fsij.org>
-
- * include/ruby/encoding.h (ECONV_INVALID_MASK): defined.
- (ECONV_INVALID_IGNORE): defined.
- (ECONV_INVALID_REPLACE): defined.
- (ECONV_UNDEF_MASK): defined.
- (ECONV_UNDEF_IGNORE): defined.
- (ECONV_UNDEF_REPLACE): defined.
-
- * transcode.c (INVALID_IGNORE): removed.
- (INVALID_REPLACE): removed.
- (UNDEF_IGNORE): removed.
- (UNDEF_REPLACE): removed.
- (rb_econv_convert0): renamed from rb_econv_convert.
- (rb_econv_convert): defined to call rb_econv_convert0 with
- replace/ignore behavior moved from transcode_loop.
- (transcode_loop): replace/ignore behavior removed.
-
-Sat Aug 23 11:23:05 2008 Tanaka Akira <akr@fsij.org>
-
- * io.c (rb_io_extract_modeenc): check :textmode and :binmode in option
- hash.
-
-Sat Aug 23 10:48:56 2008 Tanaka Akira <akr@fsij.org>
-
- * ext/pty/pty.c (pty_getpty): follow rb_io_t's path -> pathv change.
-
-Sat Aug 23 10:42:52 2008 Tanaka Akira <akr@fsij.org>
-
- * io.c (check_pipe_command): extracted from rb_f_open and rb_io_open.
- (rb_f_open): use check_pipe_command.
- (rb_io_open): ditto.
-
-Sat Aug 23 10:13:00 2008 Tanaka Akira <akr@fsij.org>
-
- * io.c (read_all): fptr->enc2 is 0 if no conversion.
- (rb_io_getline_fast): ditto.
- (io_getc): ditto.
-
-Sat Aug 23 09:45:35 2008 Tanaka Akira <akr@fsij.org>
-
- * include/ruby/io.h (rb_io_t): remove path field and add pathv field.
- (MakeOpenFile): initialize pathv as Qnil.
-
- * gc.c: mark pathv field in T_FILE.
-
- * io.c: follow the rb_io_t field change.
-
- * file.c: ditto.
-
- * ext/socket/socket.c: ditto.
-
-Sat Aug 23 01:42:22 2008 Tanaka Akira <akr@fsij.org>
-
- * include/ruby/io.h (FMODE_TEXTMODE): defined.
-
- * include/ruby/encoding.h (rb_econv_t): new field: flags.
- (rb_econv_binmode): declared.
-
- * io.c (io_unread): text mode hack removed.
- (NEED_NEWLINE_DECODER): defined.
- (NEED_NEWLINE_ENCODER): defined.
- (NEED_READCONV): defined.
- (NEED_WRITECONV): defined.
- (TEXTMODE_NEWLINE_ENCODER): defined for windows.
- (make_writeconv): setup converter with TEXTMODE_NEWLINE_ENCODER for
- text mode.
- (io_fwrite): use NEED_WRITECONV. character code conversion is
- disabled if fptr->writeconv_stateless is nil.
- (make_readconv): setup converter with
- ECONV_UNIVERSAL_NEWLINE_DECODER for text mode.
- (read_all): use NEED_READCONV.
- (appendline): use NEED_READCONV.
- (rb_io_getline_1): use NEED_READCONV.
- (io_getc): use NEED_READCONV.
- (rb_io_ungetc): use NEED_READCONV.
- (rb_io_binmode): OS-level text mode test removed. call
- rb_econv_binmode.
- (rb_io_binmode_m): call rb_io_binmode_m with write_io as well.
- (rb_io_flags_mode): return mode string including "t".
- (rb_io_mode_flags): detect "t" for text mode.
- (rb_sysopen): always specify O_BINARY.
-
- * transcode.c (rb_econv_open_by_transcoder_entries): initialize flags.
- (rb_econv_open): if source and destination encoding is
- both empty string, open newline converter. last_tc will be NULL in
- this case.
- (rb_econv_encoding_to_insert_output): last_tc may be NULL now.
- (rb_econv_string): ditto.
- (output_replacement_character): ditto.
- (transcode_loop): ditto.
- (econv_init): ditto.
- (econv_inspect): ditto.
- (rb_econv_binmode): new function.
-
-Fri Aug 22 21:18:40 2008 Tadayoshi Funaba <tadf@dotrb.org>
-
- * complex.c (nucomp_div): now behaves as quo.
-
- * complex.c (nucomp_s_generic_p): has been removed.
-
- * complex.c (nucomp_to_s): adopts new form.
-
- * complex.c (nucomp_inspect): ditto.
-
- * complex.c (string_to_c_internal): ditto and supports polar form.
-
- * complex.c (rb_complex_polar): new.
-
- * rational.c (nurat_to_s): do not canonicalize.
-
- * rational.c (nurat_inspect): adopts new form.
-
- * rational.c (string_to_r_internal): ditto.
-
- * include/ruby/intern.h: added a declaration.
-
- * lib/complex.rb: added an obsolete class method.
-
- * lib/cmath.rb: use scalar? instead of generic?.
-
-Fri Aug 22 20:06:46 2008 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-
- * lib/webrick/server.rb (WEBrick::GenericServer#shutdown):
- rescue Errno::ENOTCONN and close. [ruby-dev:35896]
-
- * test/openssl/test_ssl.rb (OpenSSL#start_server): ditto.
- [ruby-dev:35897]
-
- * lib/net/imap.rb (Net::IMAP#disconnect): ditto. [ruby-dev:35898]
-
-Fri Aug 22 19:58:27 2008 Tadayoshi Funaba <tadf@dotrb.org>
-
- * lib/date.rb: no need to require the "lib/rational.rb" any more.
-
-Fri Aug 22 15:47:38 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * lib/cgi.rb: use bytesize instead of size/length.
-
-Fri Aug 22 14:28:05 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * strftime.c (rb_strftime): supported flags and precision for most
- conversions. [ruby-dev:35906]
-
-Fri Aug 22 14:04:04 2008 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * test/ruby/test_transcode.rb: test_shift_jis:
- fixed comment strings (see r18291)
-
-Fri Aug 22 12:41:47 2008 Tanaka Akira <akr@fsij.org>
-
- * io.c (rb_io_pid): use PIDT2NUM.
-
-Fri Aug 22 11:36:31 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * dir.c (dir_enc_str_new): set US-ASCII to the path
- when the path is 7bit string and encoding is ASCII compatible.
-
- * dir.c (push_glob): set file system encoding when argument encoding
- is US-ASCII.
-
-Fri Aug 22 11:30:38 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * dir.c (dir_enc_str_new): renamed from dir_enc_str.
-
- * dir.c (dir_read): use dir_enc_str_new.
-
- * dir.c (dir_each): ditto.
-
- * dir.c (push_pattern): ditto.
-
-Fri Aug 22 11:29:10 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * common.mk: remove config.h dependency.
-
-Fri Aug 22 10:52:39 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in (gmtime_r): check if reentrant versions are available.
-
- * time.c (IF_HAVE_GMTIME_R, ASCTIME, GMTIME, LOCALTIME): use reentrant
- versions if available.
-
-Fri Aug 22 05:29:17 2008 Tanaka Akira <akr@fsij.org>
-
- * include/ruby/ruby.h (INT2NUM): just use a simple macro on LP64.
- (UINT2NUM): ditto.
-
-Fri Aug 22 05:10:07 2008 Tanaka Akira <akr@fsij.org>
-
- * io.c (rb_file_open_generic): take filename as a VALUE.
- (rb_file_open_internal): ditto.
- (rb_io_open): ditto.
- (rb_file_open): pass filename as a VALUE to rb_file_open_internal.
- (rb_open_file): pass filename as a VALUE to rb_file_open_generic.
- (open_key_args): pass filename as a VALUE to rb_io_open.
-
-Fri Aug 22 04:33:56 2008 Tanaka Akira <akr@fsij.org>
-
- * include/ruby/ruby.h: fix previous change for LP64.
-
-Fri Aug 22 03:19:41 2008 Tanaka Akira <akr@fsij.org>
-
- * include/ruby/ruby.h (NUM2LONG): make it inline function to evaluate
- the argument only once.
- `t = Object.new; def t.*(x) p x; 0 end; p Time.at(0, t)' did print x
- twice.
- (NUM2INT): ditto.
- (NUM2LL): ditto.
- (INT2NUM): make it inline function.
- (LONG2NUM): ditto.
- (UINT2NUM): ditto.
- (ULONG2NUM): ditto.
-
-Fri Aug 22 03:03:22 2008 Tanaka Akira <akr@fsij.org>
-
- * io.c (rb_io_s_sysopen): mode can be a Bignum.
-
-Fri Aug 22 02:57:03 2008 Tanaka Akira <akr@fsij.org>
-
- * io.c (rb_io_extract_modeenc): notify coerced to caller.
- (rb_io_initialize): mode may be a Bignum.
-
-Fri Aug 22 02:42:35 2008 Tanaka Akira <akr@fsij.org>
-
- * io.c (rb_io_extract_modeenc): use rb_check_to_integer to test
- integer.
-
-Fri Aug 22 02:25:04 2008 Tanaka Akira <akr@fsij.org>
-
- * iseq.c (iseq_inspect): don't raise on uninitialized object.
- show real class name.
-
-Fri Aug 22 02:08:58 2008 Tanaka Akira <akr@fsij.org>
-
- * io.c (rb_io_initialize): accept hash argument.
-
-Thu Aug 21 23:51:51 2008 Shugo Maeda <shugo@ruby-lang.org>
-
- * strftime.c (rb_strftime): supported %F and %<precision>N.
- reverted config.h to ruby.h for Windows.
-
- * test/ruby/test_time.rb (TestTime::test_strftime): added tests
- for %F and %N.
-
- * time.c: documented %F and %N.
-
-Thu Aug 21 20:23:26 2008 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-
- * test/ruby/test_m17n_comb.rb (TestM17NComb#test_str_crypt): add
- key and salt to error message.
-
-Thu Aug 21 19:20:25 2008 Tanaka Akira <akr@fsij.org>
-
- * file.c (rb_stat_inspect): don't raise if self is not initialized.
-
-Thu Aug 21 19:17:02 2008 Tanaka Akira <akr@fsij.org>
-
- * process.c (pst_pid): use rb_attr_get to avoid warning on
- Process::Status.allocate.pid.
- (pst_inspect): don't raise if self is not initialized.
-
-Thu Aug 21 19:05:40 2008 Tanaka Akira <akr@fsij.org>
-
- * io.c (io_extract_encoding_option): if internal encoding is not
- specified, enc is external encoding.
-
-Thu Aug 21 14:22:50 2008 Shugo Maeda <shugo@ruby-lang.org>
-
- * strftime.c: include ruby/config.h instead of ruby/ruby.h.
-
- * common.mk: removed the old rule for missing/strftime.c.
-
-Thu Aug 21 09:29:01 2008 Shugo Maeda <shugo@ruby-lang.org>
-
- * strftime.c (rb_strftime): return "UTC" instead of "GMT".
-
- * test/ruby/test_time.rb (test_strftime): ditto.
-
-Thu Aug 21 07:59:04 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * test/iconv/test_option.rb (test_ignore_option): skip if iconv
- doesn't have transliterate.
-
- * test/iconv/test_option.rb (test_translit_option): ditto.
-
-Thu Aug 21 06:12:56 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Jan 20 12:23:38 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/scanf.rb (Scanf::FormatSpecifier#initialize): %i should accept
single digit decimal. [ruby-core:18355]
-Thu Aug 21 06:02:52 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * range.c (range_initialize_copy): Range is now a Struct.
- [ruby-core:18353]
-
- * struct.c (rb_struct_init_copy): made public.
-
-Thu Aug 21 03:09:34 2008 Tanaka Akira <akr@fsij.org>
-
- * io.c (io_extract_encoding_option): enc2 is external encoding if
- external encoding and internal encoding is given.
- (pipe_open): add flags and convconfig argument to initialize
- fptr->{mode,enc,enc2}.
- (pipe_open_v): pass flags and convconfig from caller to pipe_open.
- (pipe_open_s): ditto.
- (pop_last_hash): new function.
- (rb_io_s_popen): use last hash as option to specify code conversion.
- (rb_io_open): specify flags and convconfig arguments for
- pipe_open_s.
- (rb_f_backquote): ditto.
-
-Thu Aug 21 02:27:03 2008 Tanaka Akira <akr@fsij.org>
-
- * io.c (prep_io): local variable renamed.
- (rb_io_fdopen): ditto.
- (prep_stdio): ditto.
-
-Thu Aug 21 01:58:59 2008 Shugo Maeda <shugo@ruby-lang.org>
-
- * configure.in: always check timezone().
-
- * strftime.c (rb_strftime): prefer timezone/altzone rather than
- gettimeofday(). The second argument to gettimeofday() is ignored
- on Solaris.
-
-Thu Aug 21 02:03:08 2008 Tanaka Akira <akr@fsij.org>
-
- * io.c (open_key_args): simplified.
-
-Thu Aug 21 01:57:03 2008 Tanaka Akira <akr@fsij.org>
-
- * io.c (open_key_args): IO.foreach(path, rs, limit) didn't work.
-
-Thu Aug 21 01:31:34 2008 Tanaka Akira <akr@fsij.org>
-
- * io.c (rb_file_sysopen_internal): unused function removed.
- (rb_file_sysopen): ditto.
-
-Thu Aug 21 01:09:26 2008 Tanaka Akira <akr@fsij.org>
-
- * io.c: use mode_t for the 3rd argument, permission, of open(2).
-
-Thu Aug 21 00:51:42 2008 Shugo Maeda <shugo@ruby-lang.org>
-
- * configure.in: removed strftime from AC_REPLACE_FUNCS().
-
- * include/ruby/missing.h: removed prototype for strftime().
-
- * missing/strftime.c: removed.
-
- * time.c (time_to_s): use rb_strftime() instead of strftime(3).
- (time_zone): ditto.
-
-Thu Aug 21 00:49:50 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * strftime.c: win32 support.
-
-Thu Aug 21 00:20:05 2008 Shugo Maeda <shugo@ruby-lang.org>
-
- * strftime.c: new file.
-
- * common.mk (COMMONOBJS): added strftime.$(OBJEXT).
-
- * time.c (time_strftime): do not use strftime(3). supported
- %L(millisecond) and %N(nanosecond).
-
- * test/ruby/test_time.rb: added tests for %L and %N.
-
-Wed Aug 20 23:53:42 2008 Tanaka Akira <akr@fsij.org>
-
- * io.c (io_set_encoding): removed.
- (rb_io_open): set up encoding using new argument opt.
- (open_key_args): call rb_io_open with opt. don't call
- io_set_encoding.
-
-Wed Aug 20 22:30:33 2008 Tanaka Akira <akr@fsij.org>
-
- * io.c (rb_file_open_internal): use rb_io_flags_modenum.
- (rb_io_reopen): use rb_io_flags_modenum and rb_io_modenum_mode.
- (rb_io_stdio_file): ditto.
-
-Wed Aug 20 22:28:15 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * proc.c (proc_new): use the given class.
-
- * vm.c (vm_make_proc): added an argument for the class.
-
-Wed Aug 20 22:24:48 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * enum.c (enum_take): get rid of extraneous iteration.
-
-Wed Aug 20 20:32:49 2008 Tanaka Akira <akr@fsij.org>
-
- * io.c (rb_io_open_with_args): use rb_open_file instead of rb_io_open.
-
-Wed Aug 20 20:16:17 2008 Tanaka Akira <akr@fsij.org>
-
- * io.c (rb_scan_open_args): extracted from rb_open_file.
-
-Wed Aug 20 19:22:32 2008 Tanaka Akira <akr@fsij.org>
-
- * io.c (convconfig_t): new type.
- (rb_io_extract_modeenc): new function.
- (rb_file_open_generic): new function.
- (rb_file_open_internal): use rb_file_open_generic.
- (rb_file_sysopen_internal): use rb_file_open_generic.
- (rb_open_file): use rb_io_extract_modeenc and rb_file_open_generic.
- (rb_io_open): call rb_file_open_internal instead of rb_file_open.
-
-Wed Aug 20 19:15:35 2008 Tanaka Akira <akr@fsij.org>
-
- * io.c (Init_IO): new constants: File::DSYNC, File::RSYNC and
- File::NOFOLLOW.
-
-Wed Aug 20 18:41:11 2008 Tanaka Akira <akr@fsij.org>
-
- * io.c (rb_open_file): don't lookup :mode and :perm in opt. it is
- useless because vmode and perm is overwritten by rb_scan_args
- anyway.
-
-Wed Aug 20 18:37:20 2008 Tanaka Akira <akr@fsij.org>
-
- * io.c (open_key_args): meaningless MEMCPY removed.
-
-Wed Aug 20 18:30:58 2008 Tanaka Akira <akr@fsij.org>
-
- * io.c (prep_io) [cygwin]: use FMODE_BINMODE instead of O_BINARY.
-
-Wed Aug 20 16:39:59 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * array.c (rb_ary_sample): performance improvement for huge array.
-
-Wed Aug 20 12:28:31 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * array.c (rb_ary_sample): get rid of infinite loop. #455
-
-Wed Aug 20 06:09:31 2008 Tanaka Akira <akr@fsij.org>
-
- * include/ruby/io.h (FMODE_TRUNC): value changed because 0x100 is used
- as FMODE_NOREVLOOKUP in socket.c
-
-Wed Aug 20 05:19:40 2008 Tanaka Akira <akr@fsij.org>
-
- * io.c (parse_mode_enc): extracted from mode_enc.
- (io_extract_encoding_option): extracted from io_set_encoding.
-
-Wed Aug 20 04:17:26 2008 Tanaka Akira <akr@fsij.org>
-
- * io.c (rb_io_flags_modenum): make it static.
-
-Wed Aug 20 03:36:45 2008 Tanaka Akira <akr@fsij.org>
-
- * include/ruby/io.h (FMODE_TRUNC): new constant.
-
- * io.c (rb_io_mode_flags): set FMODE_TRUNC for "w".
- (rb_io_modenum_flags): set FMODE_TRUNC for O_TRUNC.
- (rb_io_flags_modenum): new function.
- (rb_io_mode_modenum): just use rb_io_mode_flags and
- rb_io_flags_modenum.
-
-Wed Aug 20 02:36:21 2008 Tanaka Akira <akr@fsij.org>
-
- * io.c (fopen): macro for vms removed. fopen is not used now.
-
-Wed Aug 20 02:27:42 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode.c (rb_econv_open): fix memory leak.
- (rb_econv_close): ditto.
- fixed by shinichiro.h. [ruby-dev:35880]
-
-Tue Aug 19 21:50:43 2008 Tanaka Akira <akr@fsij.org>
-
- * include/ruby/io.h (rb_fopen): declaration removed.
-
- * io.c (rb_fopen): unused function removed.
-
-Tue Aug 19 21:14:22 2008 Tanaka Akira <akr@fsij.org>
-
- * include/ruby/io.h (FMODE_READWRITE): define as
- FMODE_READABLE|FMODE_WRITABLE.
-
-Tue Aug 19 21:13:08 2008 Tanaka Akira <akr@fsij.org>
-
- * io.c (rb_io_flags_mode): use hexadecimal in error message.
- (rb_io_modenum_mode): ditto.
- (rb_io_initialize): ditto.
-
-Tue Aug 19 18:23:40 2008 Tanaka Akira <akr@fsij.org>
-
- * io.c (rb_io_flags_mode): add a prefix 0 to octal in error message.
- (rb_io_modenum_mode): ditto.
-
-Tue Aug 19 18:05:45 2008 Tanaka Akira <akr@fsij.org>
-
- * include/ruby/io.h (FMODE_*): sorted and describe the values in
- hexadecimal.
-
-Tue Aug 19 17:32:30 2008 Tanaka Akira <akr@fsij.org>
-
- * ext/openssl/ossl_x509name.c (ossl_x509name_initialize): store the
- result of d2i_X509_NAME into DATA_PTR(self).
-
-Tue Aug 19 04:54:39 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/rake.rb (FileUtils#ruby): takes care of space containing path.
- [ ruby-Bugs-21591 ]
-
-Tue Aug 19 01:32:37 2008 Tanaka Akira <akr@fsij.org>
-
- * io.c (rb_open_file): encoding in mode string was ignored if perm is
- specified.
-
-Tue Aug 19 01:02:19 2008 Tanaka Akira <akr@fsij.org>
-
- * io.c (rb_open_file): don't access argv[-1] by
- File.allocate.instance_eval { initialize }.
-
-Tue Aug 19 00:56:01 2008 Tanaka Akira <akr@fsij.org>
-
- * re.c (rb_reg_inspect): don't raise for uninitialized Regexp.
-
-Tue Aug 19 00:34:24 2008 Tanaka Akira <akr@fsij.org>
-
- * io.c (rb_io_check_readable): side effect for STDIN removed.
- (rb_io_external_encoding): ditto.
-
-Mon Aug 18 23:27:07 2008 Tanaka Akira <akr@fsij.org>
-
- * io.c (io_ungetbyte): renamed from io_ungetc.
- (rb_io_ungetbyte): new method.
- (rb_io_ungetc): push back into character buffer if enc2 is set.
-
-Mon Aug 18 22:41:46 2008 Tanaka Akira <akr@fsij.org>
-
- * io.c (id_encode): removed.
-
-Mon Aug 18 22:30:07 2008 Tanaka Akira <akr@fsij.org>
-
- * io.c (make_writeconv): if enc and enc2 is set, convert
- string.encoding to enc2.
-
- * include/ruby/io.h: comment changed.
-
-Mon Aug 18 21:02:08 2008 Tanaka Akira <akr@fsij.org>
-
- * include/ruby/io.h (rb_io_t): new fields: writeconv,
- writeconv_stateless and writeconv_initialized.
- (MakeOpenFile): initialize them.
-
- * include/ruby/encoding.h (rb_econv_stateless_encoding): declared.
- (rb_econv_string): declared.
-
- * io.c (make_writeconv): new function.
- (io_fwrite): use econv.
- (make_readconv): fix error message.
- (finish_writeconv): new function.
- (fptr_finalize): call finish_writeconv.
- (clear_writeconv): new function.
- (clear_codeconv): new function to call both clear_readconv and
- clear_writeconv.
- (rb_io_fptr_finalize): call clear_codeconv instead of
- clear_readconv.
- (mode_enc): ditto.
- (io_set_encoding): ditto.
- (argf_next_argv): ditto.
- (io_encoding_set): ditto.
-
- * gc.c (gc_mark_children): mark writeconv_stateless in T_FILE.
-
- * transcode.c (stateless_encoding_i): new function.
- (rb_econv_stateless_encoding): ditto.
- (rb_econv_string): ditto.
-
-Mon Aug 18 17:23:38 2008 Tanaka Akira <akr@fsij.org>
-
- * io.c (clear_readconv): extracted from rb_io_fptr_finalize.
- (mode_enc): call clear_readconv.
- (io_set_encoding): ditto.
- (argf_next_argv): ditto.
- (io_encoding_set): ditto.
-
-Mon Aug 18 16:54:06 2008 Tanaka Akira <akr@fsij.org>
-
- * io.c (mode_enc): modify enc and enc2 consistently.
- (io_set_encoding): ditto.
- (io_encoding_set): ditto.
-
-Mon Aug 18 13:21:38 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode.c (transcode_search_path): prevent infinite loop by
- searching a path for self conversion.
-
-Mon Aug 18 12:45:24 2008 Tanaka Akira <akr@fsij.org>
-
- * io.c (io_enc_str): code conversion removed.
- (io_enc_str_converted): removed because it is identical to
- io_enc_str now.
-
-Mon Aug 18 12:12:29 2008 Tanaka Akira <akr@fsij.org>
-
- * io.c (io_shift_crbuf): add strp argument to append into existing
- string.
- (read_all): use econv if enc2 is set.
- (io_getc): follow the io_shift_crbuf change.
-
-Mon Aug 18 10:35:25 2008 Tanaka Akira <akr@fsij.org>
-
- * io.c (io_enc_str_converted): new function.
- (make_readconv): extracted from io_getc.
- (more_char): ditto.
- (appendline): use econv via make_readconv and more_char for code
- conversion.
- (prepare_getline_args): don't convert record separator.
- (rb_io_getline_1): don't use rb_io_getline_fast if enc2 is set.
- (io_getc): use make_readconv and more_char.
-
-Mon Aug 18 08:27:44 2008 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-
- * common.mk: fix error in uncommon.mk.
-
-Mon Aug 18 06:10:08 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * common.mk: config.h depends config.status.
-
-Mon Aug 18 03:59:43 2008 Tanaka Akira <akr@fsij.org>
-
- * io.c (appendline): appendline cannot check character boundary.
- (rb_io_getline_1): relax limit until character boundary.
-
-Mon Aug 18 02:25:11 2008 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * lib/webrick/cgi.rb (WEBrick::CGI::Socket#eof?): added lacked method.
-
-Sun Aug 17 21:50:22 2008 Tanaka Akira <akr@fsij.org>
-
- * io.c (prepare_getline_args): io.gets(10,nil) should cause TypeError.
-
-Sun Aug 17 15:58:39 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/mkmf.rb: not check config.h.
-
- * lib/mkmf.rb (init_mkmf): add include/ruby/backward to $INCFLAGS.
-
- * include/ruby/backward/{st,util}.h: added for backward compatibility.
- [ruby-dev:35811]
-
-Sun Aug 17 13:40:04 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode.c (econv_primitive_putback): new method.
-
-Sun Aug 17 13:23:53 2008 Tanaka Akira <akr@fsij.org>
-
- * include/ruby/encoding.h (rb_econv_putbackable): declared.
- (rb_econv_putback): ditto.
-
- * transcode.c (rb_econv_putbackable): implemented.
- (rb_econv_putback): ditto.
-
- * io.c (io_getc): put back bytes if possible.
-
-Sun Aug 17 12:00:18 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode.c (make_econv_exception): add several instance variables
- to exception object.
- (ecerr_source_encoding): new method:
- Encoding::ConversionUndefined#source_encoding and
- Encoding::InvalidByteSequence#source_encoding.
- (ecerr_destination_encoding): new method:
- Encoding::ConversionUndefined#destination_encoding and
- Encoding::InvalidByteSequence#destination_encoding.
- (econverr_error_char): new method:
- Encoding::ConversionUndefined#error_char.
- (econverr_error_bytes): new method:
- Encoding::ConversionUndefined#error_bytes.
-
-Sun Aug 17 11:43:18 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * random.c (struct MT): packed Mersenne Twister staffs.
-
- * random.c (struct RandSeed): packed random seed staffs.
-
-Sun Aug 17 08:38:26 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * test/iconv/test_option.rb (test_ignore_option): skip if iconv
- doesn't have transliterate.
-
- * test/iconv/test_option.rb (test_translit_option): ditto.
-
-Sun Aug 17 01:29:46 2008 Tanaka Akira <akr@fsij.org>
-
- * include/ruby/io.h (rb_io_t): new fields: readconv, crbuf, crbuf_off,
- crbuf_len, crbuf_capa.
- (MakeOpenFile): initialize them.
-
- * io.c (io_shift_crbuf): new function.
- (io_getc): use econv.
- (rb_io_fptr_finalize): finalize readconv and crbuf.
-
-Sun Aug 17 00:02:07 2008 Tanaka Akira <akr@fsij.org>
-
- * include/ruby/encoding.h (rb_econv_check_error): declared.
-
- * transcode.c (make_econv_exception): new function.
- (transcode_loop): use make_econv_exception.
- (rb_econv_check_error): defined.
-
-Sat Aug 16 15:23:16 2008 Tanaka Akira <akr@fsij.org>
-
- * include/ruby/encoding.h (rb_econv_elem_t): fields removed: from and
- to.
- (rb_econv_t): new fields: source_encoding_name and
- destination_encoding_name.
-
- * transcode.c (rb_econv_open_by_transcoder_entries): initialize the
- new fields.
- (rb_econv_open): set up the new fields.
- (econv_inspect): use the new fields.
-
-Sat Aug 16 14:22:04 2008 Tanaka Akira <akr@fsij.org>
-
- * include/ruby/encoding.h (rb_econv_t): add fields: in_buf_start,
- in_data_start, in_data_end, in_buf_end and last_trans_index.
- (rb_econv_output): removed.
- (rb_econv_insert_output): declared.
- (rb_econv_encoding_to_insert_output): declared.
-
- * enc/trans/newline.trans (rb_universal_newline): stateful_type
- changed.
-
- * transcode.c (transcode_restartable0): initialize inchar_start,
- tc->recognized_len and next_table at beginning of the loop.
- (rb_econv_open_by_transcoder_entries): initialize new fields.
- (rb_econv_open): setup last_trans_index.
- (trans_sweep): last out_buf_start can be non-NULL now.
- (rb_econv_convert): check last out_buf_start and in_buf_start at
- first.
- (rb_econv_output_with_destination_encoding): removed.
- (econv_just_convert): removed.
- (rb_econv_output): removed.
- (econv_primitive_output): method removed.
- (rb_econv_encoding_to_insert_output): new function.
- (allocate_converted_string): new function.
- (rb_econv_insert_output): new function.
- (econv_primitive_insert_output): new method.
- (output_replacement_character): use rb_econv_insert_output. unused
- arguments removed.
-
-Sat Aug 16 09:20:18 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * include/ruby/ruby.h (rb_intern_const): tiny optimization.
-
- * include/ruby/ruby.h (SSIZET2NUM, NUM2SSIZET, SSIZE_MAX, SSIZE_MIN):
- macros for ssize_t.
-
-Sat Aug 16 08:11:04 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode_data.h (rb_transcoder_stateful_type_t): defined.
- (rb_transcoder): add field: stateful_type.
-
- * tool/transcode-tblgen.rb: generate stateful_type field as
- stateless_converter.
-
- * enc/trans/iso2022.trans: follow rb_transcoder change.
-
- * enc/trans/newline.trans: ditto.
-
- * enc/trans/utf_16_32.trans: ditto.
-
-Fri Aug 15 23:07:48 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode.c (econv_just_convert): extracted from rb_econv_output.
- (rb_econv_output): use econv_just_convert.
- (econv_primitive_output): new method.
-
-Fri Aug 15 19:57:01 2008 Tanaka Akira <akr@fsij.org>
-
- * include/ruby/encoding.h (rb_econv_output): add str_encoding
- argument.
-
- * transcode.c (get_replacement_character): add repl_enc_ptr argument.
- (rb_econv_output_with_destination_encoding): renamed from
- rb_econv_output and make it static.
- (rb_econv_output): convert str and call
- rb_econv_output_with_destination_encoding.
- (output_replacement_character): follow above interface change.
-
-Fri Aug 15 19:33:57 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * string.c (rb_str_drop_bytes): use memmove.
-
-Fri Aug 15 18:33:22 2008 Tanaka Akira <akr@fsij.org>
-
- * include/ruby/encoding.h (rb_econv_t): add error_tc in last_error.
-
- * transcode.c (rb_econv_convert): fill error_tc.
-
-Fri Aug 15 18:10:49 2008 Tanaka Akira <akr@fsij.org>
-
- * include/ruby/encoding.h (rb_econv_t): new field: last_error.
-
- * transcode.c (rb_trans_conv): new argument: result_position_ptr.
- (rb_econv_convert): fill last_error.
- (econv_result_to_symbol): extracted from econv_primitive_convert.
- (econv_primitive_errinfo): new method.
-
-Fri Aug 15 17:39:05 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * common.mk (parse.{c,h}): creates in the dependency order.
-
-Fri Aug 15 16:59:30 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * vm_core.h (exec_event_hooks): skips RubyVM::FrozenCore.
-
- * vm.c (Init_VM): get rid of SEGV in a trace proc.
-
-Fri Aug 15 09:33:48 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode.c (conv_init): check empty name.
-
-Fri Aug 15 09:03:54 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode.c (econv_init): don't create dummy encoding if
- rb_econv_open is failed.
- (make_dummy_encoding): new function extracted from make_encoding.
- (make_encoding): removed.
-
-Fri Aug 15 01:07:16 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * common.mk ({$(srcdir)}.y.c): escape backslash.
-
-Fri Aug 15 01:05:39 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode.c (econv_primitive_convert): set destination_buffer
- encoding.
-
-Fri Aug 15 00:52:40 2008 Tanaka Akira <akr@fsij.org>
-
- * include/ruby/encoding.h (rb_econv_output): declared.
-
- * transcode_data.h (rb_transcoder): add resetsize_func field.
-
- * enc/trans/iso2022.trans (iso2022jp_reset_sequence_size): defined.
- (rb_EUC_JP_to_ISO_2022_JP): provide resetsize_func.
-
- * tool/transcode-tblgen.rb: set NULL for resetsize_func.
-
- * transcode.c (rb_econv_output): new function for inserting output.
- (output_replacement_character): use rb_econv_output.
- (transcode_loop): check return value of
- output_replacement_character.
-
-Thu Aug 14 23:47:21 2008 Tanaka Akira <akr@fsij.org>
-
- * include/ruby/encoding.h (ECONV_UNIVERSAL_NEWLINE_DECODER): defined.
- (ECONV_CRLF_NEWLINE_ENCODER): ditto.
- (ECONV_CR_NEWLINE_ENCODER): ditto.
- (ECONV_PARTIAL_INPUT): ditto.
- (ECONV_OUTPUT_FOLLOWED_BY_INPUT): ditto.
-
- * transcode.c: use ECONV_* defined as above.
-
-Thu Aug 14 23:35:21 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode.c: local variable renamed.
-
-Thu Aug 14 23:22:24 2008 Tanaka Akira <akr@fsij.org>
-
- * include/ruby/encoding.h (rb_econv_result_t): moved from
- transcode_data.h.
- (rb_econv_elem_t): ditto.
- (rb_econv_t): ditto. source_encoding and destination_encoding field
- is added.
- (rb_econv_open): declared.
- (rb_econv_convert): ditto.
- (rb_econv_close): ditto.
-
- * transcode.c (rb_econv_open_by_transcoder_entries): initialize
- source_encoding and destination_encoding field as NULL.
- (rb_econv_open): make it external linkage.
- (rb_econv_close): ditto.
- (rb_econv_convert): ditto. renamed from rb_econv_conv.
- (make_encoding): new function.
- (econv_init): use make_encoding and store rb_encoding* in
- rb_econv_t.
- (econv_source_encoding): new method
- Encoding::Converter#source_encoding.
- (econv_destination_encoding): new method
- Encoding::Converter#destination_encoding.
-
-Thu Aug 14 22:44:32 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode_data.h (rb_econv_result_t): change enumeration
- constant's prefix: transcode_ to econv_.
-
- * transcode.c: follow the constant prefix change.
-
-Thu Aug 14 21:34:41 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode.c (econv_init): accept Encoding object as source_encoding
- and destination_encoding.
-
-Thu Aug 14 21:10:00 2008 Tanaka Akira <akr@fsij.org>
-
- * encoding.c (rb_filesystem_encoding): use default external encoding
- for Unix.
-
- * dir.c (dir_initialize): don't cache fs_encoding.
-
-Thu Aug 14 20:58:57 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode.c (rb_econv_open_by_transcoder_entries): renamed from
- rb_trans_open_by_transcoder_entries.
-
-Thu Aug 14 20:56:28 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode.c (econv_max_output): removed.
-
-Thu Aug 14 20:52:55 2008 Tanaka Akira <akr@fsij.org>
-
- * tool/transcode-tblgen.rb: check unexpected actions.
-
-Thu Aug 14 20:25:52 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode_data.h (transcode_invalid_byte_sequence): renamed from
- transcode_invalid_input.
- (transcode_destination_buffer_full): renamed from transcode_obuf_full.
- (transcode_source_buffer_empty): renamed from transcode_ibuf_empty.
- (rb_econv_result_t): renamed from rb_trans_result_t.
- (rb_econv_elem_t): renamed from rb_trans_elem_t.
- (rb_econv_t): renamed from rb_trans_t.
-
- * transcode.c (UNIVERSAL_NEWLINE_DECODER): renamed from
- UNIVERSAL_NEWLINE.
- (CRLF_NEWLINE_ENCODER): renamed from CRLF_NEWLINE.
- (CR_NEWLINE_ENCODER): renamed from CR_NEWLINE.
- (rb_econv_open): renamed from rb_trans_open.
- (rb_econv_close): renamed from rb_trans_close.
-
-Thu Aug 14 19:41:42 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode.c (load_transcoder): unused function removed.
- (rb_transcoding_open): ditto.
-
-Thu Aug 14 17:57:05 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * include/ruby/encoding.h (rb_enc_ispunct): added.
-
- * common.mk (COMMONOBJS), inits.c (rb_call_inits): id.c is now
- included from parse.c.
-
- * id.c (Init_id), id.h (ruby_method_ids): added IDs used by VM.
-
- * parse.y (global_symbols): added rooms for VM IDs.
-
- * parse.y (rb_intern3, rb_id2str): single punctuation symbol is now
- same as char code.
-
-Thu Aug 14 17:46:21 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (union tmpyystype): no longer needed, since YYSTYPE is
- defined in parse.h now.
-
-Thu Aug 14 17:27:07 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * version.c (Init_version): add RUBY_ENGINE constant.
-
-Thu Aug 14 15:34:10 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode.c (rb_econv_conv): new function. it doesn't consume
- input too much, even for multilevel conversion.
- (transcode_loop): use rb_econv_conv.
- (econv_primitive_convert): ditto.
-
-Thu Aug 14 15:27:42 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * include/ruby/defines.h (RUBY_ALIAS_FUNCTION): fallback definition.
-
-Thu Aug 14 15:08:17 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode_data.h (rb_trans_result_t): new enumeration constant:
- transcode_output_followed_by_input.
-
- * transcode.c (OUTPUT_FOLLOWED_BY_INPUT): new flag.
- (transcode_restartable0): suspend when output followed by input if
- OUTPUT_FOLLOWED_BY_INPUT is specified.
- (trans_sweep): check OUTPUT_FOLLOWED_BY_INPUT.
- (rb_trans_conv): support OUTPUT_FOLLOWED_BY_INPUT.
- (econv_primitive_convert): return :output_followed_by_input for
- transcode_output_followed_by_input.
-
-Thu Aug 14 14:57:46 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * gc.c (getrusage_time): should return the value.
-
- * thread.c (rb_thread_priority_set): get rid of C99 feature.
-
- * transcode.c (transcode_search_path): ditto.
-
- * vm.c (REWIND_CFP): get rid of statement expressions.
-
-Thu Aug 14 14:13:39 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * vm.c (Init_VM): hide FrozenCore.
-
-Thu Aug 14 12:20:36 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * transcode.c (load_transcoder): suppress warning.
-
- * missing/vsnprintf.c (BSD_vfprintf): ditto.
-
-Thu Aug 14 12:01:39 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in (gnumake): check for GNU make.
-
- * Makefile.in (uncommon.mk): includes filtered common.mk.
-
- * common.mk (parse.h): workaround for nmake.
-
-Thu Aug 14 06:09:12 2008 Koichi Sasada <ko1@atdot.net>
-
- * thread.c (rb_thread_execute_interrupts): switch event
- should be occur only once.
-
-Thu Aug 14 05:36:36 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * common.mk: parse.h depends on parse.c.
-
- * common.mk: hash.o depends on $(ID_H_INCLUDES).
-
-Thu Aug 14 02:45:16 2008 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-
- * test/ruby/test_file_exhaustive.rb (TestFileExhaustive#setup):
- set group of tmpdir. [ruby-dev:35633]
-
-Thu Aug 14 15:50:30 2008 Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
-
- * hash.c (set_default): fix rdoc. #441
-
-Thu Aug 14 02:23:31 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode.c (econv_primitive_convert): add output_byteoffset
- argument.
-
-Thu Aug 14 00:43:53 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in (rb_cv_gcc_function_alias): checks alias attribute.
-
- * string.c (alias_func): replaced with RUBY_ALIAS_FUNCTION.
-
-Wed Aug 13 23:42:49 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * common.mk (parse.h): fake rule.
-
-Wed Aug 13 23:15:58 2008 Shugo Maeda <shugo@ruby-lang.org>
-
- * test/ruby/test_thread.rb (test_list): call Thread.pass to run t1.
- fixed [ruby-core:18264].
-
-Wed Aug 13 23:05:51 2008 TAKAO Kouji <kouji@takao7.net>
-
- * string.c (alias_func): changed to 'weak, alias' from 'alias' for
- Mac OSX. (closes #429)
-
-Wed Aug 13 19:40:12 2008 Koichi Sasada <ko1@atdot.net>
-
- * gc.c: count only freed object as freelist size.
-
-Wed Aug 13 18:34:22 2008 Shugo Maeda <shugo@ruby-lang.org>
-
- * marshal.c (marshal_load): set arg.untrust properly.
-
-Wed Aug 13 17:47:09 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode.c (econv_inspect): new method.
-
-Wed Aug 13 17:35:58 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode.c (transcode_restartable0): several local variables
- removed.
-
-Wed Aug 13 17:35:23 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * hash.c (rb_hash_set_default_proc): add new method. a patch from
- Giuseppe Bilotta. #419
-
-Wed Aug 13 17:31:12 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * vm_insnhelper.c (caller_setup_args): should ensure if the value
- from to_proc is a real Proc.
-
-Wed Aug 13 17:28:29 2008 Akinori MUSHA <knu@iDaemons.org>
-
- * common.mk: regint.h no longer includes vm_core.h.
-
-Wed Aug 13 17:26:44 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode_data.h (rb_transcoding): add fields: writebuf_off,
- writebuf_len and writebuf.
- (TRANSCODING_WRITEBUF): new macro.
-
- * transcode.c (transcode_restartable0): output until output buffer is
- really full.
- (rb_transcoding_open_by_transcoder): initialize writebuf_len,
- writebuf_off and writebuf.
- (rb_transcoding_close): finalize writebuf.
-
-Wed Aug 13 17:18:37 2008 Koichi Sasada <ko1@atdot.net>
-
- * thread.c (rb_thread_check_ints): added. please note that
- this function may cause ruby's thread switching.
-
- * include/ruby/intern.h: ditto.
-
- * regint.h: use rb_thread_check_ints() instead of
- RUBY_CHECK_INTS() directly.
-
-Wed Aug 13 17:01:36 2008 Akinori MUSHA <knu@iDaemons.org>
-
- * golf_prelude.rb, lib/set.rb (TC_Set#test_each),
- test/readline/test_readline_history.rb (Readline#test_each__enumerator),
- test/ruby/test_array.rb (TestArray#test_collect),
- test/ruby/test_enumerator.rb (TestEnumerator#test_initialize):
- Enumerable::Enumerator is now called Enumerator.
-
- * lib/rinda/tuplespace.rb (Rinda::TupleBag#initialize): Use
- enum_for instead of hardcoding Enumerable::Enumerator.
-
-Wed Aug 13 16:40:57 2008 Koichi Sasada <ko1@atdot.net>
-
- * thread.c, vm_core.h: add manual priority support
- using time slice. if you enable USE_NATIVE_THREAD_PRIORITY
- macro, this mechanism is ignored. [ruby-dev:33124]
-
- * thread_pthread.c, thread_win32.c: ditto.
-
- * test/ruby/test_thread.rb: fix test parameter.
-
-Wed Aug 13 16:02:14 2008 Shugo Maeda <shugo@ruby-lang.org>
-
- * object.c (rb_obj_untrusted): new method Object#untrusted?.
- (rb_obj_untrust): new method Object#untrust.
- (rb_obj_trust): new method Object#trust.
-
- * array.c, debug.c, time.c, include/ruby/ruby.h, re.c, variable.c,
- string.c, io.c, dir.c, vm_method.c, struct.c, class.c, hash.c,
- ruby.c, marshal.c: fixes for Object#untrusted?.
-
- * test/ruby/test_module.rb, test/ruby/test_array.rb,
- test/ruby/test_object.rb, test/ruby/test_string.rb,
- test/ruby/test_marshal.rb, test/ruby/test_hash.rb: added tests for
- Object#untrusted?.
-
-Wed Aug 13 16:13:58 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * test/ruby/test_m17n.rb: follow EncodingCompatibilityError.
-
- * test/ruby/test_mixed_unicode_escapes.rb: ditto.
-
- * test/ruby/enc/test_utf16.rb: ditto.
-
-Wed Aug 13 16:05:50 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * time.c (time_cmp): retry with right hand operand if its not a
- time object. [ruby-dev:35011]
-
-Wed Aug 13 15:51:22 2008 Akinori MUSHA <knu@iDaemons.org>
-
- * string.c: Apply a temporary fix to fix build on OS X. A real
- fix will follow later.
-
-Wed Aug 13 15:25:09 2008 Akinori MUSHA <knu@iDaemons.org>
-
- * enumerator.c (Init_Enumerator): Rename Enumerable::Enumerator to
- just Enumerator.
-
-Wed Aug 13 15:13:57 2008 Akinori MUSHA <knu@iDaemons.org>
-
- * common.mk (prelude.c, golf_prelude.c): Using $(COMPILE_PRELUDE)
- requires $(RBCONFIG).
-
-Wed Aug 13 15:08:04 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode.c (econv_init): make flags argument optional.
- (econv_primitive_convert): ditto.
-
-Wed Aug 13 14:55:27 2008 Akinori MUSHA <knu@iDaemons.org>
-
- * common.mk (realclean-local): Remove parse.h as well.
-
- * common.mk: Add missing dependencies regarding vm_core.h, id.h,
- parse.c (parse.h), etc..
-
-Wed Aug 13 14:45:37 2008 Tanaka Akira <akr@fsij.org>
-
- * enc/trans/newline.trans (rb_crlf_newline): new transcoder.
- (rb_cr_newline): new transcoder.
-
- * transcode.c (trans_open_i): one more extra room for input newline
- converter.
- (rb_trans_open): crlf newline and cr newline implemented.
- (Init_transcode): Encoding::Converter::CRLF_NEWLINE and
- Encoding::Converter::CR_NEWLINE defined.
-
-Wed Aug 13 14:22:16 2008 Tanaka Akira <akr@fsij.org>
-
- * enc/trans/newline.trans: new file.
-
- * transcode_data.h (rb_trans_t): add last_tc field.
-
- * transcode.c (UNIVERSAL_NEWLINE): defined.
- (CRLF_NEWLINE): defined.
- (CR_NEWLINE): defined.
- (rb_trans_open_by_transcoder_entries): initialize last_tc.
- (trans_open_i): allocate one more room for output newline converter.
- (rb_trans_open): universal newline implemented.
- (more_output_buffer): take max_output argument instead ts.
- (output_replacement_character): take tc argument instead of ts.
- (transcode_loop): use last_tc field.
- (econv_init): add flags argument for rb_trans_open.
- (Init_transcode): Encoding::Converter::UNIVERSAL_NEWLINE defined.
-
-Wed Aug 13 14:00:19 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * common.mk (parse.c): generates parse.h together.
-
- * id.c, id.h: use constants for parser tokens.
-
-Wed Aug 13 13:47:05 2008 Koichi Sasada <ko1@atdot.net>
-
- * vm.c: rewind cfp to show proper backtrace.
- [ruby-dev:35820]
-
-Wed Aug 13 13:09:09 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * tool/make-snapshot: fix for clean up.
-
-Wed Aug 13 11:45:51 2008 Akinori MUSHA <knu@iDaemons.org>
-
- * vm_core.h: Declare rb_iseq_clone, which is used in class.c.
-
-Wed Aug 13 11:39:19 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode.c (transcode_search_path): return the length of converter
- path.
- (load_transcoder_entry): renamed from load_transcoder.
- (load_transcoder): new function for loading transcoder by encoding
- names.
- (rb_transcoding_open_by_transcoder): extracted from
- rb_transcoding_open.
- (rb_transcoding_open): use load_transcoder and
- rb_transcoding_open_by_transcoder.
- (rb_trans_open_by_transcoder_entries): new function.
- (trans_open_i): construct entries array.
- (rb_trans_open): use rb_trans_open_by_transcoder_entries.
-
-Wed Aug 13 10:45:29 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * tool/make-snapshot: try to find exported directory.
-
-Wed Aug 13 10:16:35 2008 TAKAO Kouji <kouji@takao7.net>
-
- * doc/NEWS: Mention the Readline.vi_editing_mode?,
- Readline.emacs_editing_mode?, Readline::HISTORY[] and
- Readline::HISTORY.clear change.
-
-Wed Aug 13 08:03:02 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode.c (econv_primitive_convert): add output_size argument.
-
-Wed Aug 13 07:41:03 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode.c (rb_trans_conv): report last transcode_obuf_full.
- (econv_max_output): new method Encoding::Converter#max_output.
-
-Wed Aug 13 02:46:01 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * error.c (rb_eEncCompatError): add Exception.
-
- * include/ruby/ruby.h: ditto.
-
- * encoding.c (rb_enc_check): use rb_eEncCompatError.
-
- * string.c (rb_enc_cr_str_buf_cat): ditto.
-
- * string.c (rb_str_sub_bang): ditto.
-
- * string.c (rb_str_hex): ditto.
-
- * string.c (rb_str_oct): ditto.
-
-Wed Aug 13 02:36:47 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * transcode.c (str_transcode): fix error message.
-
-Tue Aug 12 23:42:31 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode.c (rb_cEncodingConverter): new class Encoding::Converter.
- (econv_free): new function.
- (econv_s_allocate): ditto.
- (econv_init): ditto.
- (check_econv): ditto.
- (econv_primitive_convert): new method.
- (Init_transcode): define Encoding::Converter.
-
-Tue Aug 12 23:16:09 2008 Tanaka Akira <akr@fsij.org>
-
- * string.c (rb_str_splice_0): call rb_str_drop_bytes, not rb_str_drop.
-
-Tue Aug 12 19:11:05 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * tool/make-snapshot: fix for enc.mk.
-
-Tue Aug 12 19:08:42 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * string.c (rb_str_drop_bytes): new function to drop first bytes.
-
-Tue Aug 12 18:58:48 2008 Koichi Sasada <ko1@atdot.net>
-
- * vm.c, vm_insnhelper.c (vm_define_method): move
- function place.
-
-Tue Aug 12 18:56:52 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * string.c: more descriptive aliases of rb_str_new[2-5].
- [ruby-dev:35615]
-
-Tue Aug 12 18:51:29 2008 TAKAO Kouji <kouji@takao7.net>
-
- * gc.c (getrusage_time): Returned effective value on Windows.
-
-Tue Aug 12 18:51:11 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode.c (rb_trans_open): free ts before raise.
-
-Tue Aug 12 18:46:36 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * ext/bigdecimal/bigdecimal.c (BigDecimalCmp): should not ignore
- <=> comparison. [ruby-dev:35732]
-
-Tue Aug 12 18:43:10 2008 Tanaka Akira <akr@fsij.org>
-
- * enc/trans/make_transdb.rb: *.erb.c is not used anymore.
-
-Tue Aug 12 18:32:33 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode_data.h (rb_trans_elem_t): new field: from and to.
-
- * transcode.c (trans_open_i): just record from and to.
- (rb_trans_open): load transcodings.
-
-Tue Aug 12 18:32:03 2008 Akinori MUSHA <knu@iDaemons.org>
-
- * ext/syslog/syslog.c (mSyslog_open): Use of Check_SafeStr() is
- deprecated.
- (mSyslogConstants_LOG_MASK, mSyslogConstants_LOG_UPTO): Use
- NUM2INT() instead of FIX2INT() when the type of an given object
- is not determined.
-
-Tue Aug 12 18:14:00 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * tool/transcode-tblgen.rb (#transcode_tblgen): slight message
- improvement.
-
-Tue Aug 12 17:16:58 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode.c (trans_open_i): check the result of rb_transcoding_open.
-
-Tue Aug 12 16:23:32 2008 Narihiro Nakamura <authorNari@gmail.com>
-
- * gc.c (gc_profile_result): use rb_str_catf.
-
-Tue Aug 12 16:13:45 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode_data.h (TRANSCODE_ERROR): removed.
-
- * tool/transcode-tblgen.rb: 8bit byte of ASCII-8BIT is a valid
- (but unique to ASCII-8BIT) character.
-
- * transcode.c (rb_eConversionUndefined): new error.
- (rb_eInvalidByteSequence): ditto.
-
-Tue Aug 12 16:08:51 2008 Minero Aoki <aamine@loveruby.net>
-
- * lib/net/pop.rb: POP3Command should export @socket since POP
- calls #socket.
-
-Tue Aug 12 16:06:28 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * sprintf.c, util.c (quorem, nrv_alloc, dtoa): enabled floating point
- support.
-
-Tue Aug 12 15:52:45 2008 Narihiro Nakamura <authorNari@gmail.com>
-
- * gc.c (gc_profile_result): use sprintf.
-
-Tue Aug 12 15:37:40 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * string.c (rb_str_intern): should check symbol table overflow.
-
-Tue Aug 12 15:31:04 2008 Minero Aoki <aamine@loveruby.net>
-
- * lib/net/http.rb (send_request_with_body): Content-Length should
- be byte length of string. (closes #203)
-
-Tue Aug 12 15:17:06 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * enc/depend: (transvpath_prefix): prefix has no extension, so replace
- %s with "".
-
-Tue Aug 12 15:03:43 2008 TAKAO Kouji <kouji@takao7.net>
-
- * test/readline/test_readline.rb (TestReadline#test_safe_level_4):
- tested Readline.vi_editing_mode? and Readline.emacs_editing_mode?.
-
-Tue Aug 12 14:25:09 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * enc/Makefile.in (.SUFFIXES): renamed to .trans.
-
- * enc/make_encmake.rb: added --encs and --no-encs options.
-
- * enc/depend (TRANSVPATH): fix for nmake.
-
-Tue Aug 12 14:19:53 2008 Minero Aoki <aamine@loveruby.net>
-
- * lib/net/https.rb: suppress syntax warning.
-
-Tue Aug 12 14:15:51 2008 Minero Aoki <aamine@loveruby.net>
-
- * lib/net/http.rb (Net::HTTP#initialize): initialize net/https
- variables to suppress syntax warning.
-
-Tue Aug 12 14:15:13 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/dl/cptr.c (rb_dlptr_s_to_ptr): fixed shadowing variable.
-
-Tue Aug 12 10:25:14 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * array.c (rb_ary_delete): Array#delete to return deleted element.
-
-Tue Aug 12 10:18:01 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * test/win32ole/test_err_in_callback.rb: do not require 'mkmf'
- unless WIN32OLE is defined.
-
-Tue Aug 12 07:41:13 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode_data.h (rb_transcoder): add resetstate_func field for
- resetting a state of stateful encoding.
-
- * enc/trans/iso2022.trans (rb_EUC_JP_to_ISO_2022_JP): specify
- finish_eucjp_to_iso2022jp for resetstate_func.
-
- * tool/transcode-tblgen.rb: specify NULL for resetstate_func.
-
- * transcode.c (output_replacement_character): call resetstate_func
- before appending the replacement character.
-
-Tue Aug 12 07:19:24 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode.c (get_replacement_character): extracted from
- output_replacement_character.
-
-Tue Aug 12 07:00:02 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode_data.h (rb_transcoder): typedef at first.
-
-Tue Aug 12 06:48:35 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode.c (rb_trans_conv): find second last error.
-
-Tue Aug 12 00:43:44 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode_data.h (rb_trans_result_t): new type.
- (rb_trans_elem_t): new type.
- (rb_trans_t): new type.
-
- * transcode.c (transcode_dispatch_cb): removed.
- (transcode_dispatch): removed.
- (rb_transcoding_result_t): moved to rb_trans_result_t in
- transcode_data.h.
- (transcode_restartable0): goto follow_info when FUNsi.
- (rb_transcoding_open): use get_transcoder_entry.
- (rb_trans_open): new function.
- (rb_trans_conv): ditto.
- (rb_trans_close): ditto.
- (trans_open_i): ditto.
- (trans_sweep): ditto.
- (more_output_buffer): take rb_trans_t instead of rb_transcoding as
- an argument.
- (transcode_loop): take from_encoding and to_encoding instead of tr
- as arguments. use rb_trans_open/rb_trans_conv/rb_trans_close.
- (str_transcode): don't use transcode_dispatch.
-
-Mon Aug 11 20:37:05 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * iseq.c (rb_iseq_clone): should preserve cref_stack link.
-
-Mon Aug 11 20:27:12 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * ext/dl/cfunc.c (rb_dlcfunc_call): add taint check.
-
- * ext/dl/dl.c (rb_dl_malloc): add rb_secure(2).
-
- * ext/dl/dl.c (rb_dl_realloc): ditto.
-
- * ext/dl/dl.c (rb_dl_free): ditto.
-
- * ext/dl/dl.c (rb_dl_ptr2value): ditto.
-
-Mon Aug 11 20:11:21 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * gc.c (getrusage_time): works only if RUSAGE_SELF is defined right
- now.
-
- * gc.c (gc_profile_result): C99.
-
-Mon Aug 11 18:57:38 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * array.c (rb_ary_sample): rename #choice to #sample. in
- addition, sample takes optional argument, a la #first.
-
-Mon Aug 11 18:28:02 2008 Narihiro Nakamura <authorNari@gmail.com>
-
- * gc.c: added GC::Profiler.
-
-Mon Aug 11 17:26:16 2008 TAKAO Kouji <kouji@takao7.net>
-
- * ext/readline/README.ja: added API document for
- Readline.vi_editing_mode? and Readline.emacs_editing_mode?.
-
- * ext/readline/extconf.rb: checked rl_editing_mode variable in
- Readline library.
-
- * ext/readline/readline.c (readline_s_emacs_editing_mode_p): added
- Readline.emacs_editing_mode? method.
- (readline_s_vi_editing_mode_p): added Readline.vi_editing_mode?
- method.
- (Init_readline): ditto.
-
-Mon Aug 11 16:56:40 2008 TAKAO Kouji <kouji@takao7.net>
-
- * test/readline/test_readline.rb: added test for Readline's class
- methods.
-
-Mon Aug 11 16:39:23 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * class.c (clone_method): should copy cbase in cref as well.
- [ruby-dev:35116]
-
- * iseq.c (iseq_mark): mark original iseq object.
-
- * iseq.c (iseq_free): do not free internal data if they have
- original iseq to belong.
-
- * iseq.c (rb_iseq_clone): a new function to clone iseq value.
-
-Mon Aug 11 16:34:48 2008 Tanaka Akira <akr@fsij.org>
-
- * enc/trans/iso2022.trans: renamed from iso2022.erb.c.
-
- * enc/trans/single_byte.trans: ditto.
-
- * enc/trans/utf_16_32.trans: ditto.
-
- * enc/trans/korean.trans: ditto.
-
- * enc/trans/japanese.trans: ditto.
-
- * enc/depend: follow the renaming.
-
- * tool/build-transcode: ditto.
-
-Mon Aug 11 15:09:23 2008 Tanaka Akira <akr@fsij.org>
+Mon Jan 19 18:25:28 2009 Tanaka Akira <akr@fsij.org>
* configure.in (rb_cv_broken_glibc_ia64_erfc): renamed from
rb_broken_glibc_ia64_erfc.
[ruby-core:18228]
-Mon Aug 11 10:04:34 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode_data.h (rb_transcoding): rename fields.
- readlen -> recognized_len.
- feedlen -> readagain_len.
-
- * transcode.c: follow the field renaming.
-
-Sun Aug 10 22:34:55 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode.c (transcode_restartable0): invalid handling simplified.
- (transcode_restartable): use PARTIAL_INPUT for converting buffered
- input.
-
-Sun Aug 10 22:24:24 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * encoding.c: include util.h. [ruby-dev:35715]
-
- * common.mk: ditto.
-
-Sun Aug 10 20:59:54 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode_data.h (rb_transcoding): new field: flags.
-
- * transcode.c (load_transcoder): extracted from transcode_dispatch_cb.
- (rb_transcoding_result_t): renamed from transcode_result_t.
- (rb_transcoding_open): new function.
- (rb_transcoding_convert): ditto.
- (rb_transcoding_close): ditto.
- (transcode_loop): use rb_transcoding_open, rb_transcoding_convert
- and rb_transcoding_close.
- (str_transcode): don't need rb_transcoding.
-
-Sun Aug 10 18:09:16 2008 Tanaka Akira <akr@fsij.org>
-
- * tool/transcode-tblgen.rb: record checksum of
- transcode-tblgen.rb itself.
-
-Sun Aug 10 12:34:41 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * config.guess ({powerpc-apple,i586-pc}-haiku): re-applied r18403.
- [ruby-core:18110]
-
- * config.{guess,sub}: updated to automake-1.10.1.
-
-Sun Aug 10 11:45:15 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * enc/Makefile.in (make-workdir): use MAKEDIRS.
+Sat Jan 17 12:16:10 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
- * enc/depend: makes target directory before compile/link.
+ * random.c (Init_Random): always initialize seed.
- * tool/transcode-tblgen.rb: creates target directory.
+Fri Jan 16 10:59:31 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
-Sun Aug 10 11:30:48 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode.c: rename my_transcoding to tc and my_transcoder to tr.
-
-Sun Aug 10 11:15:55 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode_data.h (rb_transcoding): add feedlen field.
-
- * transcode.c (transcode_restartable0): renamed from
- transcode_restartable.
- save input buffer into feed buffer if next character is started the
- point before input buffer. for example, "\x00\xd8\x01" then "\x02"
- in UTF-16LE. \x02 causes invalid and next character is started from
- \x01.
- (transcode_restartable): new function to call
- transcode_restartable0. if feed buffer is not empty, convert it at
- first.
-
-Sun Aug 10 11:02:58 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * common.mk (extconf): use MAKEDIRS.
-
-Sun Aug 10 09:35:12 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/irb.rb (IRB::Irb#inspect): instance_variables returns symbols
- instead of strings now. [ruby-dev:34930]
+ * class.c (clone_method): should copy cbase in cref as well.
+ [ruby-dev:35116]
-Sun Aug 10 09:22:14 2008 Tanaka Akira <akr@fsij.org>
+ * node.h (NEW_CREF): new NEW_ macro.
- * transcode.c (transcode_char_start): refactored to remove readlen
- argument.
- (transcode_restartable): refactored to remove readlen variable.
+ * eval.c (PUSH_CREF): use NEW_CREF().
-Sun Aug 10 08:56:14 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Jan 15 14:34:32 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
* gc.c (STACK_LEVEL_MAX, ruby_stack_length): returns size_t.
[ruby-core:18207]
-
- * configure.in (rb_cv_missing__dtos18, rb_cv_missing_fconvert),
- ext/digest/md5/md5.c, ext/openssl/ossl.c (main),
- ext/socket/extconf.rb (ipv6, wide-getaddrinfo): main should be int.
-
- * main.c (main), win32/winmain.c, wince/wincemain.c (WinMain): envp is
- no longer used so long time. based on a patch from Peter Bowen at
- [ruby-core:18208]
-
-Sat Aug 9 22:05:29 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode.c (transcode_loop): take destination and resize function
- as parameters.
- (more_output_buffer): ditto.
- (str_transcoding_resize): argument changed from rb_transcoding* to
- VALUE.
- (str_transcode): call transcode_loop with destination string and its
- resize function.
-
- * transcode_data.h (rb_transcoding): move ruby_string_dest and
- flush_func to transcode_loop parameters.
-
-Sat Aug 9 21:29:45 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * common.mk: encs depend on transdb.h
-
-Sat Aug 9 21:10:51 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in (rb_cv_rshift_sign, rb_cv_binary_elf): get rid of
- AC_TRY_RUN.
-
-Sat Aug 9 16:33:21 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode_data.h (rb_transcoding): new fields: next_info and next_byte.
-
- * transcode.c (transcode_restartable): save/restore next_info and
- next_byte.
- sync readlen and in_p when invalid.
-
-Sat Aug 9 15:10:15 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode.c (transcode_restartable): my_transcoder argument removed.
- (transcode_loop): my_transcoder argument removed.
-
-Sat Aug 9 14:39:34 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode_data.h (rb_transcoding): add fields for restartable
- transcoding.
- (rb_transcoder): add max_input field.
- from_unit_length field is renamed to input_unit_length.
-
- * tool/transcode-tblgen.rb: generate max_input field.
-
- * enc/trans/iso2022.erb.c: follow rb_transcoder change.
-
- * enc/trans/utf_16_32.erb.c: ditto.
-
- * transcode.c (PARTIAL_INPUT): new constant.
- (transcode_char_start): new function.
- (transcode_result_t): new type.
- (transcode_restartable): new function.
- (more_output_buffer): new function.
- (transcode_loop): use transcode_restartable.
-
-Sat Aug 9 13:35:08 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Jan 14 10:39:56 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
* stable/ext/socket/socket.c (NI_MAXHOST, NI_MAXSERV): fixed invalid
preprocessor directives. a patch from Peter Bowen at
[ruby-core:18211].
-Sat Aug 9 06:37:21 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * enc/make_encdb.rb, enc/trans/make_transdb.rb: skip nonexistent
- directory. [ruby-dev:35802]
-
-Sat Aug 9 01:07:51 2008 Tanaka Akira <akr@fsij.org>
-
- * enc/trans/utf_16_32.erb.c (fun_so_from_utf_32le): implemented.
- (fun_so_to_utf_32le): implemented.
- [ruby-dev:35777]
-
-Sat Aug 9 00:42:33 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode_data.h (rb_transcoder): from_unit_length field added.
- from_utf8 field removed.
-
- * tool/transcode-tblgen.rb: generate offsets range.
- follow rb_transcoder change.
-
- * transcode.c (transcode_loop): don't use from_utf8.
- make invalid region from_unit_length wise.
-
- * enc/trans/iso2022.erb.c: follow rb_transcoder and
- transcode_generate_node change.
-
- * enc/trans/utf_16_32.erb.c: follow rb_transcoder and
- transcode_generate_node change.
- explicit :invalid map removed.
-
-Fri Aug 8 23:29:44 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * enc/depend (TRANSCSRCS): needs rule_subst to apply.
-
- * io.c (shutdown): not define if defined already.
-
-Fri Aug 8 22:47:26 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * vm_insnhelper.c (opt_eq_func): large function to make inline.
-
- * bcc32/Makefile.sub (config.h): cannot compile a big inline function.
-
-Fri Aug 8 21:09:10 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * common.mk (enk.mk): give not RUBY but MINIRUBY.
-
-Fri Aug 8 17:03:17 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in (shutdown, sched_yield, pthread_attr_setinheritsched):
- check for Haiku.
-
- * eval_intern.h, io.c, thread_pthread.c: use autoconfisticated results.
-
-Fri Aug 8 16:52:55 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * common.mk (enc.mk): mkmf.rb requires rbconfig.rb.
-
- * common.mk (srcs-enc): renamed from transcodes.
-
- * enc/Makefile.in (make-workdir): creates object directories.
-
- * common.mk (encdb.h): see both $(srcdir)/enc and enc.
-
- * enc/make_encdb.rb: ditto.
-
- * enc/trans/make_transdb.rb: fix for the case no transdirs are given.
-
- * enc/trans/make_transdb.rb: converts only one transcoders for each
- basename.
-
-Fri Aug 8 10:53:52 2008 Tanaka Akira <akr@fsij.org>
-
- * lib/resolv.rb: randomize source port and transaction id.
- CVE-2008-1447.
-
- * lib/resolv-replace.rb (UDPSocket#bind): don't resolv host if host is
- "".
-
-Fri Aug 8 04:20:14 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * common.mk: see both $(srcdir)/enc/trans and enc/trans.
-
- * enc/trans/make_transdb.rb: ditto.
-
-Fri Aug 8 00:05:02 2008 TAKAO Kouji <kouji@takao7.net>
-
- * ext/.document: added readline/readline.c.
-
- * ext/readline/readline.c: changed Copyright. added RDoc.
-
- * ext/readline/README.ja: fixed typo.
-
- * ext/readline/README: contents was moved RDoc.
-
-Thu Aug 7 23:43:11 2008 Tanaka Akira <akr@fsij.org>
-
- * transcode_data.h (rb_transcoding): new field "stateful".
- (rb_transcoder): preprocessor and postprocessor field removed.
- change arguments of func_ii, func_si, func_io and func_so.
- new field "finish_func".
-
- * tool/transcode-tblgen.rb: make FUNii, FUNsi and FUNio
- generatable.
-
- * transcode.c (transcoder_lib_table): removed.
- (transcoder_table): change structure.
- (transcoder_key): removed because the above structure change.
- (make_transcoder_entry): new function.
- (get_transcoder_entry): ditto.
- (rb_register_transcoder): follow the structure change.
- (declare_transcoder): ditto.
- (transcode_search_path): new function for breadth first search to
- find a list of converters.
- (transcode_search_path_i): new function.
- (transcode_dispatch_cb): ditto.
- (transcode_dispatch): use transcode_search_path.
- (transcode_loop): follow the argument change.
- (str_transcode): preprocessor and postprocessor stuff removed.
-
- * enc/trans/iso2022.erb.c: new file. ISO-2022-JP conversion
- re-implemented.
-
- * enc/trans/japanese.erb.c: ISO-2022-JP stuff removed.
-
- * enc/trans/utf_16_32.erb.c: follow argument change of FUNso.
-
- [ruby-dev:35798]
-
-Thu Aug 7 22:55:44 2008 TAKAO Kouji <kouji@takao7.net>
-
- * ext/readline/README.ja: updated API document for Readline module.
-
-Thu Aug 7 20:52:08 2008 Shugo Maeda <shugo@ruby-lang.org>
+Tue Jan 13 04:40:30 2009 Shugo Maeda <shugo@ruby-lang.org>
* lib/net/ftp.rb (login): raise FTPReplyError if passwd or acct
- is not supplied. fixed [ruby-core:18058].
-
-Thu Aug 7 18:01:44 2008 Akinori MUSHA <knu@iDaemons.org>
-
- * misc/ruby-mode.el (ruby-imenu-create-index-in-block): Fix the
- regexp to only pick definition lines properly. `module_function'
- is not a definition of a module named `_function'.
-
-Thu Aug 7 17:47:55 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * enc/depend: add transdb.c.
-
-Thu Aug 7 16:28:51 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * Makefile.in, common.mk, {bcc,win}32/Makefile.sub (clean-ext): do not
- use miniruby.
-
-Thu Aug 7 14:17:32 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * enc/depend: removed needless explicit commands.
-
- * lib/mkmf.rb, {bcc32,win32}/Makefile.sub (CLEANLIBS, CLEANOBJS):
- moved clean targets to platform makefiles.
-
-Thu Aug 7 13:12:30 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * ext/socket/getaddrinfo.c (gai_strerror): ignore only on Haiku.
- a patch from <zn at mbf.nifty.com>, [ruby-dev:35796].
-
-Thu Aug 7 06:31:12 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * test/ruby/process.rb (test_popen_fork): skip a test which is
- freeze in FreeBSD.
-
-Thu Aug 7 06:05:48 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * config.guess: add powerpc-apple-haiku, i586-pc-haiku.
- see [ruby-core:18110]
-
-Thu Aug 7 05:51:05 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * eval_intern.h: Add support to Haiku. see [ruby-core:18110]
+ is not supplied. backported from trunk. fixed [ruby-core:18058].
- * include/ruby/defines.h: ditto.
+Mon Jan 12 00:23:37 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * configure.in: ditto.
-
- * thread_pthread.c: ditto.
-
- * io.c: ditto.
-
- * lib/mkmf.rb: ditto.
-
- * ext/socket/getaddrinfo.c: ditto.
-
- * ext/socket/extconf.rb: ditto.
-
- * ext/socket/socket.c: ditto.
-
- * ext/socket/addrinfo.h: ditto.
-
- * ext/socket/getnameinfo.c: ditto.
-
-Thu Aug 7 05:43:32 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * common.mk: mkdir enc/trans before build tables.
-
-Thu Aug 7 05:18:30 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * enc/depend: enc/*.c is source but enc/trans/*.c is generated.
-
-Thu Aug 7 05:14:12 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * regenc.c (code_to_mbc): raise RangeError Integer#chr
- when more than 255 is given with single byte encoding.
- [ruby-dev:35789]
-
-Thu Aug 7 05:06:03 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * gc.c (run_final): runs finalizers with the object terminated.
-
- * gc.c (rb_gc_call_finalizer_at_exit): keeps finalized objects from
- linking to freelist.
-
-Thu Aug 7 04:43:14 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * enc/depend: for build in other than srcdir.
-
-Wed Aug 6 22:40:48 2008 Tanaka Akira <akr@fsij.org>
-
- * tool/transcode-tblgen.rb (transcode_generate_node): code
- argument removed.
-
-Wed Aug 6 21:25:45 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * gc.c (chain_finalized_object): deletes finalizers to be invoked from
- finalizer_table.
-
- * gc.c (rb_gc_call_finalizer_at_exit): warns when could not invoke
- finalizers.
-
-Wed Aug 6 20:56:43 2008 Tanaka Akira <akr@fsij.org>
-
- * enc/depend: transcode table generation depends on
- tool/transcode-tblgen.rb.
-
-Wed Aug 6 20:48:27 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * gc.c (gc_sweep, obj_free, run_final): defer finalizers of IO and
+ Data. [ruby-dev:35578]
* gc.c (rb_gc_call_finalizer_at_exit): self-referencing finalizers
cannot be invoked. [ruby-dev:35681]
-Wed Aug 6 20:44:41 2008 Tanaka Akira <akr@fsij.org>
-
- * tool/transcode-tblgen.rb: distinguish UNDEF and INVALID.
- [ruby-dev:35709]
-
- * transcode.c (transcode_loop): don't need rb_enc_mbclen now.
-
-Wed Aug 6 14:40:11 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * common.mk (transdb.h): requires transcoders.
-
- * enc/depend (srcs): target for transcoders.
-
-Wed Aug 6 14:04:08 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * enc/depend: replace not only $(<:...) but also $<.
-
-Wed Aug 6 13:54:30 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/Makefile.sub (config.status): export BASERUBY.
-
- * enc/depend: avoid GNU make'ism.
-
-Wed Aug 6 07:59:02 2008 Tanaka Akira <akr@fsij.org>
-
- * tool/transcode-tblgen.rb (ActionMap#eql?): use == to compare @map.
-
-Wed Aug 6 07:45:26 2008 Tanaka Akira <akr@fsij.org>
-
- * tool/transcode-tblgen.rb: show generating tables in verbose mode.
- (transcode_generate_node): call ActionMap#generate_node with showing
- table name.
-
- * enc/trans/utf_16_32.erb.c: use transcode_generate_node.
-
-Wed Aug 6 06:55:20 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * thread.c (thread_start_func_2): propagates fatal error and system
- exit to the main thread.
-
-Wed Aug 6 05:31:54 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * encoding.c (rb_to_encoding_index, rb_to_encoding): check if the name
- is ascii compatible as well as Encoding.find.
-
- * transcode.c (str_encode): no need to duplicate first.
-
-Wed Aug 6 05:08:30 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * array.c (rb_ary_sort_bang): reset to real class.
-
- * file.c (rb_find_file_ext, rb_find_file): ditto.
-
- * io.c (io_reopen): ditto.
-
-Wed Aug 6 03:56:39 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * common.mk (transcodes), tool/build-transcode: generates transcode
- sources.
-
- * enc/trans/{japanese,korean,single_byte,utf_16_32}.c: to be
- autogenerated now.
-
- * enc/depend: added rules for .c from .erb.c.
-
-Tue Aug 5 20:46:20 2008 Tanaka Akira <akr@fsij.org>
-
- * tool/build-transcode: new file.
-
- * tool/transcode-tblgen.rb: new file.
-
- * enc/trans/make_transdb.rb: exclude *.erb.c.
-
- * enc/depend: exclude *.erb.c.
-
- * enc/trans/utf_16_32.erb.c: new file.
-
- * enc/trans/single_byte.erb.c: new file.
-
- * enc/trans/japanese.erb.c: new file.
-
- * enc/trans/korean.erb.c: new file.
-
- * enc/trans/iso-8859-2-tbl.rb: new file.
-
- * enc/trans/iso-8859-3-tbl.rb: new file.
-
- * enc/trans/iso-8859-4-tbl.rb: new file.
-
- * enc/trans/iso-8859-5-tbl.rb: new file.
-
- * enc/trans/iso-8859-6-tbl.rb: new file.
-
- * enc/trans/iso-8859-7-tbl.rb: new file.
-
- * enc/trans/iso-8859-8-tbl.rb: new file.
-
- * enc/trans/iso-8859-9-tbl.rb: new file.
-
- * enc/trans/iso-8859-10-tbl.rb: new file.
-
- * enc/trans/iso-8859-11-tbl.rb: new file.
-
- * enc/trans/iso-8859-13-tbl.rb: new file.
-
- * enc/trans/iso-8859-14-tbl.rb: new file.
-
- * enc/trans/iso-8859-15-tbl.rb: new file.
-
- * enc/trans/eucjp-tbl.rb: new file.
-
- * enc/trans/sjis-tbl.rb: new file.
-
- * enc/trans/euckr-tbl.rb: new file.
-
- * enc/trans/utf_16_32.c: regenerated.
-
- * enc/trans/single_byte.c: regenerated.
-
- * enc/trans/japanese.c: regenerated.
-
- * enc/trans/korean.c: regenerated.
-
- [ruby-dev:35730]
-
-Tue Aug 5 18:02:53 2008 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-
- * test/io/nonblock/test_flush.rb (TestIONonblock#test_flush):
- rescue some exceptions. [ruby-dev:35638]
-
-Tue Aug 5 16:40:06 2008 Shugo Maeda <shugo@ruby-lang.org>
+Sun Jan 11 11:33:27 2009 Shugo Maeda <shugo@ruby-lang.org>
* lib/net/ftp.rb (chdir): handle 5xx errors correctly.
- fixed [ruby-core:18057].
-
-Tue Aug 5 16:38:59 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * include/ruby/win32.h, bcc32/Makefile.sub (config.h): bcc 5.8 has
- stdint.h.
-
-Tue Aug 5 16:13:05 2008 Shugo Maeda <shugo@ruby-lang.org>
-
- * lib/net/imap.rb (disconnect): do not refer to SSL::SSLSocket for
- environments without OpenSSL. fixed [ruby-dev:35755].
-
-Tue Aug 5 14:19:22 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * file.c (rb_stat_mode): generalized st_mode mask.
-
-Tue Aug 5 12:43:47 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * io.c (retry_sendfile, retry_read): ENOSYS and EWOULDBLOCK are not
- defined on every platforms.
-
-Tue Aug 5 12:34:49 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * transcode_data.h (TRANSCODE_ERROR): common transcode failure
- exception, would be changed later.
-
- * enc/trans/japanese.c (UNSUPPORTED_MODE): unsupported mode transition
- exception.
-
-Tue Aug 5 03:29:52 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ backported from trunk. fixed [ruby-core:18057].
- * array.c (rb_ary_sort_bang): respect overridden <=> for String and
- Fixnum. [ruby-core:17708]
+Fri Jan 9 19:25:25 2009 Shugo Maeda <shugo@ruby-lang.org>
- * include/ruby/node.h (NOEX_BASIC): basic definition method flag.
+ * lib/net/imap.rb (disconnect): do not refer SSL::SSLSocket for
+ environments without OpenSSL. backported from trunk.
+ fixed [ruby-dev:35755].
- * include/ruby/intern.h, vm_method.c (rb_method_basic_definition_p):
- new function to check if the method is not redefined after the
- initialization.
-
- * vm_method.c (rb_obj_respond_to): use rb_method_basic_definition_p.
-
-Mon Aug 4 20:39:06 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * Makefile.in (update-rubyspec): renamed the rubyspec directory
- "spec". Changed directory structure.
-
- * Makefile.in (test-rubyspec): ditto.
-
- * spec/README: described the structure of "spec" directory.
-
- * spec/default.mspec: configured for Matz's Ruby Implementation.
-
-Mon Aug 4 19:21:43 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * array.c (rb_ary_tmp_new): added.
-
- * vm_eval.c (vm_call_super): fixed typo, and get rid of too large
- alloca. [ruby-core:17922]
-
-Mon Aug 4 16:48:50 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Jan 8 13:24:23 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
* parse.y (deferred_nodes, compstmt, arg, fixup_nodes, range_op): fix
up fixnum range literal in conditional as automagical line number
comparison. [ruby-core:12124], [ruby-dev:35731]
-Mon Aug 4 14:41:25 2008 URABE Shyouhei <shyouhei@ruby-lang.org>
-
- * lib/net/smtp.rb (Net::SMTP::rcptto): fix a typo. a patch from
- Masao Takaku <masao at nii.ac.jp>
- fix [ruby-dev:35489].
-
-Mon Aug 4 14:08:55 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * marshal.c (dump_ensure), process.c (run_exec_dup2),
- string.c (rb_str_replace), transcode.c (transcode_dispatch): fixed
- memory leaks. based on patches from shinichiro.h <shinichiro.hamaji
- AT gmail.com> at [ruby-dev:35751].
-
-Sun Aug 3 19:32:52 2008 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-
- * ext/win32ole/win32ole.c (hash2named_arg): refactoring.
-
- * ext/win32ole/win32ole.c (ole_invoke, fole_respond_to, ev_on_event,
- fev_off_event): accepts Symbol argument.
-
- * test/win32ole/test_win32ole.rb: ditto.
+Wed Jan 7 10:09:46 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * test/win32ole/test_win32ole_event.rb: ditto.
+ * eval.c (timeofday): use monotonic clock. based on a patch
+ from zimbatm <zimbatm@oree.ch> in [ruby-core:16627].
-Sun Aug 3 10:41:54 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * string.c (rb_str_shared_replace): fixed memory leak. a patch from
- shinichiro.h <shinichiro.hamaji AT gmail.com> at [ruby-dev:35742]
-
-Sat Aug 2 22:55:41 2008 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-
- * test/win32ole/test_err_in_callback.rb: remove temporary files.
- some refactoring.
-
-Sat Aug 2 15:51:50 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Jan 6 09:03:35 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
* parse.y (yylex): 8 and 9 in octal integer should cause compile
error. [ruby-dev:35729]
-Sat Aug 2 01:06:10 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * enc/trans/japanese.c: add U+FF5E to EUC-JP.
- [ruby-dev:35720] [ruby-dev:35722]
-
-Fri Aug 1 23:49:44 2008 TAKAO Kouji <kouji@takao7.net>
-
- * ext/readline/extconf.rb: checked to have clear_history in
- readline library.
- * ext/readline/readline.c (hist_get, hist_each, Init_readline):
- The offset specified for the argument of history_get() might be
- different in GNU Readline and libedit. If use libedit, it was
- corrected that the computational method of the offset specified
- for the argument of history_get() when the Readline module was
- initialized was decided.
- (hist_get, hist_set): If use libedit, accesses first an input
- content in history when specifies the negative offset for the
- argument of history_get() or replace_history_entry(). Then
- checks the offset is negative in ruby.
- (rb_remove_history): When compiling, it corrects it to warning
- when libedit is used.
- (hist_clear, Init_readline): added Readline::HISTORY.clear
- method. [ruby-dev:35551]
- * test/readline/test_readline_history.rb: added unit test for
- Readline::HISTORY.
-
-Fri Aug 1 23:26:45 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * transcode.c (transcode_loop): undefined character is replaced with
- only one character. [ruby-dev:35709]
-
-Fri Aug 1 23:26:22 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- Merged r16430(akr), r16431(akr), r16433(akr), r16469(nobu), and
- r17874(akr) from ruby_1_8.
-
- * Makefile.in (update-rubyspec): added
-
- * Makefile.in (test-rubyspec): added
-
-Fri Aug 1 23:16:03 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * enc/trans/japanese.c: add support for CP51932,
-
-Fri Aug 1 22:59:40 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * enc/trans/japanese.c: add U+FF0C,
-
-Fri Aug 1 21:49:41 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * test/sdbm/test_sdbm.rb: add some tests.
-
-Fri Aug 1 21:36:00 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * gc.c (allocate_heaps, assign_heap_slot, rb_newobj_from_heap):
- reset during_gc before raising NoMemoryError.
-
-Fri Aug 1 21:29:56 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * vm.c (Init_BareVM): check failure of malloc().
-
-Fri Aug 1 20:55:27 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * enc/trans/japanese.c (to_SHIFT_JIS_EF_BF_offsets): add U+FFF3,
- U+FFF4, U+FFF5.
-
- * enc/trans/japanese.c (to_SHIFT_JIS_EF_BF_infos): ditto.
-
- * enc/trans/japanese.c (to_EUC_JP_EF_BF_infos): added.
-
- * enc/trans/japanese.c (to_EUC_JP_EF_BF): added.
-
- * enc/trans/japanese.c (to_EUC_JP_EF_infos): change size.
- [ruby-dev:35714]
-
-Fri Aug 1 18:27:15 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * parse.y (parser_yylex): removed an useless conditional, and magic
- comment are ignored unless at the first of line.
-
- * test/ruby/test_m17n.rb (test_magic_comment_vim): added.
-
- * test/ruby/test_m17n.rb (test_magic_comment_at_various_positions):
- added.
-
-Fri Aug 1 14:54:42 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * win32/win32.c (rb_w32_seekdir): no need to rewind to seek forward.
-
-Fri Aug 1 05:31:08 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * transcode.c (output_replacement_character):
- rename from _get_replacement_character.
-
- * transcode.c (output_replacement_character):
- fix replacement on UTF-32{BE,LE}. [ruby-dev:35705]
-
- * transcode.c (transcode_loop): ditto.
-
- * test/ruby/test_transcode.rb (test_invalid_replace):
- add for above.
-
-Fri Aug 1 01:01:49 2008 Yusuke Endoh <mame@tsg.ne.jp>
+Mon Jan 5 11:14:39 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * proc.c (rb_proc_call_with_block): reduce comparison.
+ * eval.c (rb_thread_schedule): runs deferred finalizers.
-Thu Jul 31 22:17:35 2008 Yusuke Endoh <mame@tsg.ne.jp>
+ * gc.c (gc_sweep): sets rb_thread_pending to run deferred finalizers.
- * ext/bigdecimal/bigdecimal.c (VpMult): prevent memory leak.
+ * rubysig.h (CHECK_INTS): now checks rb_thread_pending even on
+ platforms where setitimer is not available. [ruby-core:18045]
-Thu Jul 31 20:05:56 2008 NARUSE, Yui <naruse@ruby-lang.org>
+Mon Jan 5 11:14:39 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * test/ruby/test_transcode.rb (test_unicode_public_review_issue_121):
- fix option1 and 3.
+ * rubysig.h (CHECK_INTS): gives the chance to perform to deferred
+ finalizers before explicit GC.start or the process termination.
+ [ruby-core:18045]
-Thu Jul 31 19:54:57 2008 NARUSE, Yui <naruse@ruby-lang.org>
+Sun Jan 4 04:49:01 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * transcode.c (get_replacement_character): use U+FFFD as replacement
- character when convert to Unicode.
+ * win32/win32.c (rb_w32_telldir): just returns loc.
- * test/ruby/test_transcode.rb (test_unicode_public_review_issue_121):
- rename from test_public_review_issue_121.
+ * win32/win32.c (rb_w32_rewinddir): needs to intialize loc.
+ [ruby-core:18041]
- * test/ruby/test_transcode.rb (test_unicode_public_review_issue_121):
- enable option2.
-
-Thu Jul 31 17:00:10 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * transcode.c (get_replacement_character): fix: invalid byte sequence
- is always replaced "\x00?".
-
-Thu Jul 31 16:37:03 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * test/rubygems/test_gem_ext_configure_builder.rb
- (test_self_build_fail): remove extra newline. [ruby-dev:35704]
-
-Thu Jul 31 15:11:11 2008 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * test/ruby/test_transcode.rb: added test_shift_jis
- (contributed by Yoshihiro Kambayashi) and
- test_public_review_issue_121
- (see http://www.unicode.org/review/pr-121.html)
-
-Thu Jul 31 13:18:30 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * include/ruby/ruby.h (struct RString): size of ary must be
- RSTRING_EMBED_LEN_MAX + 1.
-
-Thu Jul 31 12:23:53 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * pack.c (pack_unpack): upper half of hexdigits has never been used.
-
-Thu Jul 31 11:31:29 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/syck/syck.h (ASSERT): fix typo at r18176.
-
- * ext/syck/rubyext.c (rb_syck_compile): expression in ASSERT() has no
- effect unless debug mode.
-
-Thu Jul 31 10:51:39 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * iseq.c (ruby_iseq_disasm_insn): suppress warnings on platforms which
- int size differs from pointer size.
-
- * ext/openssl/ossl_asn1.c (ossl_asn1_get_asn1type): ditto
-
- * ext/syck/rubyext.c (rb_syck_err_handler),
- (syck_default_error_handler): ditto.
-
-Thu Jul 31 02:21:39 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * ext/syck/rubyext.c (rb_syck_compile): remove meaningless branch
- that misleads into thinking that the variable sav may be
- uninitialized.
-
-Thu Jul 31 01:25:43 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * thread.c (rb_mutex_unlock_all): mutex is no longer a ruby object.
-
-Thu Jul 31 01:18:07 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * parse.y (magic_comment_encoding): remove meaningless null check.
-
-Thu Jul 31 01:09:28 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * ext/bigdecimal/bigdecimal.c (VpIsRoundMode): fix tautology
- condition.
-
-Thu Jul 31 00:58:33 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * pack.c (pack_unpack): reduced static variables.
-
-Thu Jul 31 00:10:20 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * proc.c (rb_proc_call_with_block): prevent null reference.
-
-Wed Jul 30 22:19:13 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * parse.y (vtable_free): remove meaningless null check.
-
-Wed Jul 30 22:08:25 2008 Tanaka Akira <akr@fsij.org>
-
- * dir.c (struct dir_data): change path field char * to VALUE.
- (mark_dir): new function for mark path field.
- (free_dir): follow the path field change.
- (dir_s_alloc): ditto.
- (dir_initialize): ditto.
- (dir_s_open): ditto.
- (dir_inspect): ditto.
- (dir_path): return (duplicate of) the path field to preserve
- encoding. [ruby-dev:35685]
-
-Wed Jul 30 22:06:56 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * string.c (sym_inspect): remove dead code.
-
-Wed Jul 30 21:32:52 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * ChangeLog: fix wrong method name and add reference.
-
-Wed Jul 30 21:30:08 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * regparse.c (name_add): fix memory leak.
-
-Wed Jul 30 21:08:06 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * ext/syck/syck.c (syck_free_parser): fix memory leak by
- YAML::Syck.compile.
-
- * regparse.c (parse_exp): fix memory leak at Regexp.new("x{1,1}").
-
-Wed Jul 30 17:48:15 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun Jan 4 04:45:26 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
* win32/win32.c (rb_w32_select): recalc the rest of timeout for each
iterations. [ruby-core:18015]
-Tue Jul 29 23:37:37 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * io.c (io_ungetc): raise NotImplementedError when ungetc is called
- against dummy encoding IO. [ruby-dev:35686]
-
- * io.c (rb_io_getline_1): ditto when gets with delimiter is called.
-
- * io.c (io_getc): ditto when getc is called.
-
- * test/ruby/test_io_m17n.rb (test_terminator_stateful_conversion,
- test_getc_stateful_conversion, test_ungetc_stateful_conversion):
- these tests should raise NotImplementedError.
-
-Tue Jul 29 22:55:34 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * test/ruby/test_io.rb (pipe): run reader thread and writer thread.
-
-Tue Jul 29 21:38:08 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * ext/bigdecimal/bigdecimal.c (Init_bigdecimal): fix typo.
-
-Tue Jul 29 21:35:59 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * test/etc/test_etc.rb (test_passwd): age field may be string under
- some environments.
-
-Tue Jul 29 17:54:35 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * dir.c (char_casecmp): fix: return 0 if either of characters is NUL.
-
-Tue Jul 29 13:17:03 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * test/etc/test_etc.rb (test_getpwuid): fix for users whose uid is
- shared.
-
-Tue Jul 29 05:37:53 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * file.c (rb_find_file_ext, rb_find_file): explicit relative path
- which starts with "./" or "../" should be searched from cwd
- instead of load path. [ruby-dev:35673]
-
-Tue Jul 29 02:39:46 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * math.c (math_atanh): raise EDOM on FreeBSD when atanh(1).
-
- * math.c (math_log): ditto.
-
- * math.c (math_log2): ditto.
-
- * math.c (math_log10): ditto.
-
- * test/ruby/test_math.rb: test for above.
-
-Tue Jul 29 01:41:15 2008 Tanaka Akira <akr@fsij.org>
-
- * dir.c (struct dir_data): intenc field removed.
- (dir_s_alloc): intenc initialization removed.
- (dir_initialize): :internal_encoding option removed. dirname code
- conversion removed.
- (dir_enc_str): code conversion removed.
- [ruby-dev:35661]
-
-Mon Jul 28 21:32:17 2008 Kouhei Sutou <kou@cozmixng.org>
-
- * test/rss/: use PNG instead of zlib as binary data.
-
-Mon Jul 28 21:24:33 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * thread_win32.[ch] (cond_every_entry, rb_thread_cond_struct): reverted
- r18239 because r18245 made the changes unnecessary.
-
- * thread.c (rb_mutex_struct): define after including thread_{pthread,
- win32}.c.
-
-Mon Jul 28 21:00:10 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * test/ruby/test_require.rb (test_require_too_long_filename):
- Kernel#require does not use dln_find_file_r (at r18242).
-
-Mon Jul 28 20:17:03 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * vm_core.h: move the definition of struct rb_mutex_struct.
-
- * thread.c: ditto.
-
-Mon Jul 28 18:58:46 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * thread.c (mutex_unlock): fix typo.
-
-Mon Jul 28 18:15:45 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * file.c (rb_find_file_ext, rb_find_file): not to split load path with
- path separator. [ruby-Bugs-21356]
-
-Mon Jul 28 18:14:03 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * win32/win32.c (overlapped_socket_io, fcntl, rb_w32_close): must not
- pass a pointer to int which is smaller than st_data_t on mswin64.
-
-Mon Jul 28 16:49:47 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * win32/win32.c (CreateChild, overlapped_socket_io): suppress
- warnings.
-
-Mon Jul 28 16:06:36 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/win32.c (MAXPATHLEN): define before use.
-
-Mon Jul 28 16:01:12 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * thread_win32.[ch] (cond_every_entry, rb_thread_cond_struct): moved
- the definitions from .c to .h because rb_thread_cond_struct is used
- in vm_core.h.
-
-Mon Jul 28 14:29:54 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * dln.c (load_lib): use dln_find_file_r instead of dln_find_file.
-
-Mon Jul 28 00:18:47 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * vm_core.h, thread.c: It is now prohibited to use Data_Get_Struct in
- *_free against an object that is going to be free'ed. So, change type
- of thread_t#keeping_mutexes from VALUE to mutex_t.
-
- * vm.c: remove mark to keeping_mutexes.
-
-Sun Jul 27 23:32:42 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * test/openssl/test_ssl.rb (server_loop): rescue Errno::EINVAL and
- Errno::ECONNABORTED.
-
-Sun Jul 27 22:11:57 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * bootstraptests/method.rb: increase RLIMIT_STACK size to 4M+8Kbytes
- because FreeBSD fails this less than that.
-
-Sun Jul 27 21:45:59 2008 Koichi Sasada <ko1@atdot.net>
-
- * gc.c (gc_mark_children, obj_free): T_DEFERRED should not be appear.
-
- * gc.c (gc_sweep, finalize_list): fix to decrement heap_slot#limit
- after executing finalizer.
-
-Sun Jul 27 14:48:37 2008 Koichi Sasada <ko1@atdot.net>
-
- * include/ruby/ruby.h: add a type T_DEFERRED.
-
- * gc.c: fix deferred finalizer system. finalize processes of
- T_DATA and T_FILE are executed after gc process.
- And fix to use BUILTIN_TYPE() instead of seeing flag.
-
- * thread.c, vm_core.h: add RUBY_VM_SET_FINALIZER_INTERRUPT()
- and check interrupt_flag at rb_thread_execute_interrupts().
-
- * thread.c (mutex_mark): fix to mark next_mutex.
-
- * vm.c (rb_thread_mark): fix to mark keeping_mutexes.
-
-Sun Jul 27 09:15:28 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * dln.h (dln_find_exe, dln_find_file): deprecated, use reentrant
- versions instead.
-
-Sun Jul 27 09:02:32 2008 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
-
- * lib/rinda/tuplespace.rb: merged from 1.8.
-
- * test/rinda/test_rinda.rb: merged from 1.8.
-
-Sat Jul 26 22:45:18 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * sample/exyacc.rb: fixed NoMethodError(Kernel#sub!).
- replaced use of special variables with explicit IO
- operations.
-
-Sat Jul 26 21:17:18 2008 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-
- * ext/win32ole/win32ole.c (Init_win32ole): add
- WIN32OLE_EVENT#handler=, WIN32OLE_EVENT#handler
-
- * test/win32ole/test_win32ole_event.rb: ditto.
-
-Sat Jul 26 07:44:14 2008 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-
- * ext/win32ole/win32ole.c (add_event_call_back): remove unused
- variable.
-
-Fri Jul 25 23:48:10 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * gc.c (gc_sweep, obj_free, run_final): defer finalizers of IO and
- Data. [ruby-dev:35578]
-
-Fri Jul 25 23:35:18 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/webrick/httputils.rb (WEBrick::HTTPUtils#split_header_value):
- reduce backtrack. based on a fix by Christian Neukirchen
- <chneukirchen AT gmail.com>.
-
-Fri Jul 25 21:55:38 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * test/ruby/enc/test_koi8.rb: move from test/ruby/test_koi8.rb.
-
-Fri Jul 25 21:09:32 2008 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-
- * ext/win32ole/win32ole.c (ole_invoke, add_event_callback,
- rescue_callback): refactoring.
-
-Fri Jul 25 20:52:44 2008 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-
- * test/win32ole/err_in_callback.rb: add test of raising
- exception in WIN32OLE_EVENT callback.
-
- * test/win32ole/test_err_in_callback.rb: ditto.
-
-Fri Jul 25 20:43:57 2008 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-
- * ext/win32ole/win32ole.c (Init_win32ole): add
- WIN32OLE_EVENT#off_event.
-
- * test/win32ole/test_win32ole_event.rb: ditto.
-
- * test/win32ole/test_win32ole_event.rb: some refactoring.
-
-Fri Jul 25 19:50:49 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * regint.c (xmalloc, xrealloc, xfree): not to use ruby managed memory.
-
-Fri Jul 25 15:52:40 2008 Koichi Sasada <ko1@atdot.net>
-
- * vm.c (vm_invoke_proc): skip setting safe_level if
- it from bmethod. This change makes test/ruby/test_proc.rb pass.
-
-Fri Jul 25 10:00:00 2008 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * test/ruby/test_transcode.rb: refactoring/cleanup of
- test_iso_2022_jp(_1)
-
-Fri Jul 25 04:12:57 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * ext/nkf/nkf.c (rb_nkf_convert): output of mime encode is US-ASCII.
- [ruby-list:45257]
-
-Fri Jul 25 02:43:11 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * sample/coverage.rb: move from lib/coverage.rb because this remains in
- an early phase of development.
-
-Fri Jul 25 00:10:23 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * file.c (rb_find_file_ext, rb_find_file): converts Windows style path
- to Cygwin path. [ruby-dev:35647]
-
-Thu Jul 24 16:30:21 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/win32.c (exit_handler): use st_free_table() to free socklist.
-
- * win32/win32.c (rb_w32_pipe_exec, rb_w32_accept, rb_w32_socket,
- rb_w32_socketpair): should check and release fd and sockets/handles
- if an error occurs in rb_w32_open_osfhandle().
-
-Thu Jul 24 16:05:02 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/win32.c (overlapped_socket_io): avoid warnings.
-
- * thread_win32.c (ubf_handle): refactoring.
-
-Thu Jul 24 07:01:13 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/win32ole/win32ole.c: got rid of improper casts.
-
-Wed Jul 23 23:19:15 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * test/socket/test_tcp.rb (test_recvfrom): replace an irrelevant test
- for old behavior.
-
-Wed Jul 23 21:38:16 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * test/ruby/test_marshal.rb: suppress warning during test.
-
-Wed Jul 23 21:35:53 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * test/ruby/test_dir.rb: suppress warning during test.
-
-Wed Jul 23 18:27:46 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/tk/{stubs,tcltklib}.c, ext/tk/tkutil/tkutil.c: fix warnings
- about constness and signedness.
-
-Wed Jul 23 17:04:22 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Jan 2 03:08:47 2009 Kouhei Sutou <kou@cozmixng.org>
- * ext/openssl/openssl_missing.h (d2i_of_void): define for older
- versions. [ruby-dev:35637]
+ * test/rss/: use PNG instead of zlib as binary data. [ruby-dev:35666]
-Wed Jul 23 13:53:36 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Nov 11 01:07:32 2008 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
- * ext/curses/extconf.rb: use try_static_assert.
-
-Wed Jul 23 10:06:19 2008 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-
- * test/zlib/test_zlib.rb (TestZlibDeflate#test_params): suppress a
- finalizer warning.
-
-Wed Jul 23 06:25:42 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/syck: suppress warnings more.
-
-Wed Jul 23 03:19:31 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/nkf/nkf-utf8/nkf.c (struct input_code.name, input_codename):
- constified.
-
-Wed Jul 23 03:02:08 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/syck: suppress warnings.
-
-Wed Jul 23 00:34:20 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/openssl: suppress warnings.
-
-Tue Jul 22 23:01:34 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * ext/syck/rubyext.c, ext/syck/yaml2byte.c, ext/syck/emitter.c,
- ext/syck/syck.c, ext/syck/handler.c, ext/syck/syck.h: suppress GCC
- warning.
-
-Tue Jul 22 20:42:24 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * ext/bigdecimal/bigdecimal.c (BigDecimalCmp): BigDecimal#<=> should
- return nil if an argument can't be coerced into BigDecimal.
-
- * ext/bigdecimal/bigdecimal.h, ext/bigdecimal/bigdecimal.c
- (VpIsNegDoubleZero, VpItoV): comment out unused functions.
-
-Tue Jul 22 20:33:54 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * test/rdoc/test_rdoc_parser_ruby.rb (teardown): close tempfile.
-
-Tue Jul 22 19:38:38 2008 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * test/ruby/test_transcode.rb: added two comments
-
-Tue Jul 22 18:08:34 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * README.EXT, README.EXT.ja: mention about FIX2LONG and NUM2LONG.
- see [ruby-dev:35197]
-
-Tue Jul 22 17:53:32 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * compile.c (insn_data_to_s_detail), file.c (rb_stat_inspect),
- iseq.c (ruby_iseq_disasm_insn, ruby_iseq_disasm),
- process.c (pst_message), re.c (match_inspect): use rb_str_catf.
-
- * dir.c (dir_inspect), iseq.c (iseq_inspect, insn_operand_intern): use
- rb_sprintf.
-
- * error.c (rb_name_error, rb_raise, rb_loaderror, rb_fatal): use
- rb_vsprintf.
-
-Tue Jul 22 17:20:25 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/win32.c (init_func): new function to get API's address which
- is often used and not supported on all Windows.
-
- * win32/win32.c (overlapped_socket_io): shouldn't use overlapped I/O if
- CancelIo() is not supported.
-
-Tue Jul 22 16:47:57 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * include/ruby/intern.h, sprintf.c (rb_str_catf, rb_str_vcatf): new
- functions. [ruby-dev:35597]
-
- * string.c (rb_str_capacity): new function to return the capacity.
-
-Tue Jul 22 16:08:58 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * ext/socket/socket.c (connect_blocking, socks_connect_blocking,
- ruby_connect): cast.
-
-Tue Jul 22 11:05:08 2008 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-
- * test/ruby/test_dir.rb: use realpath of tmpdir. [ruby-dev:35481]
-
- * test/ruby/test_process.rb: ditto.
-
-Tue Jul 22 09:51:32 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * misc/ruby-mode.el: fix here-doc strings with inner quotes. patches
- by Nathan Weizenbaum <nex342 AT gmail.com> from [ruby-core:17615]
- through [ruby-core:17910].
-
-Tue Jul 22 04:26:16 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * include/ruby/intern.h (rb_str_buf_new2): optimization for literals.
-
- * string.c (str_buf_cat): returns VALUE.
-
-Tue Jul 22 03:34:01 2008 Eric Hodel <drbrain@segment7.net>
-
- * lib/rdoc*: Update to RDoc 2.1.0 r112.
-
-Tue Jul 22 02:51:46 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * include/ruby/intern.h (rb_str_buf_cat2, rb_str_cat2): optimization
- for literals.
-
-Tue Jul 22 02:50:47 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * README.EXT, README.EXT.ja (1.5 Manipulating Ruby data): fix the
- prototype of rb_vsprintf, and added rb_str_cat2. [ruby-dev:35622]
-
-Mon Jul 21 17:15:38 2008 Tanaka Akira <akr@fsij.org>
-
- * encoding.c (rb_filesystem_encoding): use locale encoding on Unix.
- [ruby-dev:35617]
-
-Mon Jul 21 15:29:32 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * missing/vsnprintf.c (struct __sbuf, FILE): use size_t.
-
- * sprintf.c (ruby__sfvwrite): ditto.
-
-Mon Jul 21 13:55:37 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * README.EXT, README.EXT.ja (1.5 Manipulating Ruby data): mentioned
- rb_sprintf and rb_vsprintf. [ruby-dev:35611]
-
-Mon Jul 21 10:25:52 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * io.c (prepare_getline_args): check if rs is a string when non-nil
- lim is given. [ruby-dev:35610]
-
-Mon Jul 21 04:55:20 2008 Tanaka Akira <akr@fsij.org>
-
- * dir.c (dir_initialize): use rb_convert_type instead of
- rb_check_convert_type to prevent SEGV by Dir.new(".", true).
- (dir_initialize): use FilePathValue before rb_enc_get(dirname) to
- prevent SEGV by Dir.new(0).
+ * configure.in: fix SEGV on Mac OS X 10.5.3 with --enable-pthread.
+ a patch from Wataru Kimura in Bug #193 [ruby-core:17333].
-Mon Jul 21 04:42:15 2008 Tanaka Akira <akr@fsij.org>
+Mon Aug 11 09:37:17 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
- * re.c (rb_reg_s_union): useless rb_enc_get call removed to prevent
- SEGV by Regexp.union("", nil).
+ * ext/dl/dl.c (rb_str_to_ptr): should propagate taint to dlptr.
-Sun Jul 20 22:50:11 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/dl/dl.c (rb_ary_to_ptr): ditto.
- * compile.c (iseq_compile_each): NODE_POSTEXE should set each end
- procs only once. [ruby-dev:35596]
+ * ext/dl/sym.c (rb_dlsym_call): should check taint of DLPtrData as
+ well.
-Sun Jul 20 16:00:37 2008 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+Fri Aug 8 10:53:52 2008 Tanaka Akira <akr@fsij.org>
- * ext/win32ole/win32ole.c (EVENTSINK_Invoke): use rb_protect
- instead of rb_rescue2. [ruby-dev:35595]
+ * lib/resolv.rb: randomize source port and transaction id.
+ CVE-2008-1447.
-Sun Jul 20 01:23:24 2008 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+ * lib/resolv-replace.rb (UDPSocket#bind): don't resolv host if host is
+ "".
- * ext/win32ole/win32ole.c (EVENTSINK_Invoke): little refactoring.
+Mon Aug 4 14:49:35 2008 URABE Shyouhei <shyouhei@ruby-lang.org>
- * ext/win32ole/win32ole.c (EVENTSINK_GetIDsOfNames): return
- ITypeInfo::GetIDsOfNames().
+ * lib/net/smtp.rb (Net::SMTP::rcptto): fix a typo. a patch from
+ Masao Takaku <masao at nii.ac.jp>
+ fix [ruby-dev:35489].
-Sat Jul 19 09:31:35 2008 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+Mon Aug 4 14:13:15 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/win32ole/win32ole.c (EVENTSINK_Invoke): little refactoring.
+ * regex.c (xmalloc, xrealloc, xfree): not to use ruby managed memory.
- * ext/win32ole/win32ole.c: add document of inspect methods.
+ * regex.c (DOUBLE_STACK, re_compile_fastmap0, re_adjust_startpos),
+ (re_search, re_match_exec): check if failed to allocate memory.
-Sat Jul 19 06:08:43 2008 Eric Hodel <drbrain@segment7.net>
+Mon Aug 4 13:53:42 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/rdoc*: Import RDoc r104. Various make test-all fixes.
+ * bignum.c (rb_big2str0, bigsqr): made interruptible. [ruby-Bugs-20622]
-Sat Jul 19 00:27:58 2008 NAKAMURA Usaku <usa@ruby-lang.org>
+Mon Aug 4 13:31:41 2008 NAKAMURA Usaku <usa@ruby-lang.org>
* numeric.c (check_uint, rb_num2uint, rb_fix2uint): fixed wrong check
about 64bit positive value.
-
-Fri Jul 18 23:23:37 2008 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-
- * ext/win32ole/win32ole.c (EVENTSINK_Invoke): avoid cfp consistency
- error when exception raised in event callback.
-
-Fri Jul 18 14:52:14 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/win32.c (socklist): table for registering socket options
- (currently only O_NONBLOCK).
-
- * win32/win32.c (StartSockets, exit_handler): alloc/free socklist.
-
- * win32/win32.c (is_socket): use socklist.
-
- * win32/win32.c (rb_w32_accept, rb_w32_socket, rb_w32_socketpair):
- register new socket to socklist.
-
- * win32/win32.c (rb_w32_close): remove closing socket from socklist.
-
- * win32/win32.c (fcntl): register socket options.
-
- * win32/win32.c (overlapped_socket_io): send to/recv from socket with
- overlapped operation if the socket is not nonblocking mode.
- [experimental]
-
- * win32/win32.c (rb_w32_send, rb_w32_sendto, rb_w32_recv,
- rb_w32_recvfrom): use overlapped_socket_io().
-
- * win32/win32.c (open_ifs_socket): set overlapped mode. this is the
- default mode of winsock's socket(), so lacking it is an old bug.
-
-Fri Jul 18 09:44:30 2008 Eric Hodel <drbrain@segment7.net>
-
- * lib/rdoc/*: Import RDoc r101.
-
-Thu Jul 17 23:45:55 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * test/rdoc/test_rdoc_c_parser.rb (teardown): close tempfile.
-
-Thu Jul 17 21:08:49 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * test/ruby/test_process.rb (test_getpriority, test_setpriority): use
- PRIO_PROCESS instead of PRIO_USER.
-
-Thu Jul 17 20:41:42 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * pack.c (pack_unpack): fix v and V with big endian.
- [1].pack("V").unpack("V") was [4294967296].
-
-Thu Jul 17 20:35:03 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * pack.c (pack_pack): fix i! with big endian. [1].pack("i!") was
- "\0\0\0\0".
-
-Thu Jul 17 16:48:40 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * ext/socket/socket.c (ruby_connect): select() for connect() has
- mean only when the socket is non-blocking.
-
-Thu Jul 17 10:55:24 2008 Eric Hodel <drbrain@segment7.net>
-
- * mkconfig.rb: Simplify expression for RDoc.
-
-Thu Jul 17 10:21:15 2008 NAKAMURA Usaku <usa@ruby-lang.org>
+Mon Aug 4 13:31:41 2008 NAKAMURA Usaku <usa@ruby-lang.org>
* numeric.c (check_uint, rb_num2uint, rb_fix2uint): strict check.
fixed [ruby-dev:33683]
-Thu Jul 17 04:19:33 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * thread.c (thread_start_func_2): wake up joining threads.
-
- * thread.c (sleep_forever, sleep_timeval): return when interrupted.
- [ruby-dev:35542]
-
- * thread.c (timer_thread_function): restore main thread status.
- [ruby-core:17270]
-
-Thu Jul 17 01:27:38 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * io.c (appendline): remove invalid access.
-
-Wed Jul 16 18:04:34 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * signal.c (signal_exec, trap_handler): trap accepts a string as
- command. [ruby-dev:35533]
-
-Wed Jul 16 00:04:30 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * test/ruby/envutil.rb (Test::Unit::Assertions#assert_in_out_err): new
- method.
-
- * test/ruby/test_argf.rb: use assert_in_out_err instead of
- EnvUtil.rubyexec.
-
- * test/ruby/test_module.rb: ditto.
-
- * test/ruby/test_require.rb: ditto.
-
- * test/ruby/test_objectspace.rb: ditto.
-
- * test/ruby/test_object.rb: ditto.
-
- * test/ruby/test_string.rb: ditto.
-
- * test/ruby/test_method.rb: ditto.
-
- * test/ruby/test_variable.rb: ditto.
-
- * test/ruby/test_io.rb: ditto.
-
- * test/ruby/test_rubyoptions.rb: ditto.
-
- * test/ruby/test_exception.rb: ditto.
-
- * test/ruby/test_class.rb: ditto.
-
- * test/ruby/test_thread.rb: ditto.
-
-Tue Jul 15 22:34:03 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/Makefile.sub (ruby_version): follow changes in configure.in.
-
-Tue Jul 15 21:58:20 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/tk/{,tkutil/}extconf.rb: ruby/ruby.h no longer needs to be
- checked.
-
- * ext/tk/{tcltklib.c,tkutil/tkutil.c}: check macros for each headers.
-
-Tue Jul 15 21:45:41 2008 Akinori MUSHA <knu@iDaemons.org>
-
- * ext/tk/extconf.rb, ext/tk/tcltklib.c, ext/tk/tkutil/tkutil.c: Do
- not test ruby/ruby.h, which makes OS X's gcc pick the wrong
- header file from Ruby.framework.
-
-Tue Jul 15 21:31:26 2008 Akinori MUSHA <knu@iDaemons.org>
+Thu Jul 17 21:42:07 2008 URABE Shyouhei <shyouhei@ruby-lang.org>
- * configure.in (--with-ruby-version): Add a new option to specify
- the ruby version string for version specific directories.
- [ruby-dev:35490]
+ * lib/net/smtp.rb (Net::SMTP::start): revert to avoid RFC2821
+ violation. [ruby-dev:35487]
- * mkconfig.rb: Definition of ruby_version is now determined by the
- configure script.
+Thu Jul 17 21:32:49 2008 Tanaka Akira <akr@fsij.org>
-Tue Jul 15 18:14:20 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * ext/socket/socket.c (ruby_connect, s_accept): check before readable/
- writable by select() instead of wrapping in blocking region.
-
- * ext/socket/socket.c (bsock_send, s_recvfrom, udp_send, unix_send_io,
- unix_recv_io): should check readable/writable before calling blocking
- functions.
- see [ruby-dev:35446]
-
-Tue Jul 15 18:12:02 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * thread_win32.c (ubf_handle): cancel blocking IO if it can (only
- Vista). see [ruby-dev:35446]
-
- * win32/win32.c (errmap): add ERROR_OPERATION_ABORTED as EINTR.
-
-Mon Jul 14 20:35:21 2008 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-
- * test/win32ole/test_win32ole_event.rb (teardown): fix typo.
-
-Mon Jul 14 18:47:30 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * transcode.c (transcode_loop): constified.
-
- * transcode.c (str_transcode): rb_str_set_len() sets a delimiter.
-
- * transcode_data.h (rb_transcoder): constified preprocessor and
- postprocessor input.
-
- * enc/trans/japanese.c: ditto.
-
-Sun Jul 13 05:37:50 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * include/ruby/ruby.h (PRI_PTRDIFF_PREFIX, PRI_SIZE_PREFIX): typo.
-
- * {bcc32,win32}/Makefile.sub: (SIZEOF_SIZE_T, SIZEOF_PTRDIFF_T): added.
-
-Sat Jul 12 23:54:55 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/Makefile.sub (LIBRUBY_DLDFLAGS): import library which created
- with DLL is broken. save import library which created by lib.exe and
- install it.
- fixed the problem mentioned at the postscript of [ruby-dev:35448]
-
-Sat Jul 12 23:24:21 2008 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/socket.c: use PRIuSIZE.
-
-Sat Jul 12 22:41:39 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * include/ruby/ruby.h (PRI_PTRDIFF_PREFIX, PRI_SIZE_PREFIX): fixed typo.
-
-Sat Jul 12 22:30:43 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * include/ruby/intern.h (HAVE_RUBY_RUBY_H): defines macros so that
- extconf.rb do not need to check if headers exist under separated
- directory. [ruby-dev:35437]
-
- * include/{ruby,rubyio,rubysig}.h, include/ruby/intern.h: use
- "ruby/..." instead of <ruby/...>.
-
-Sat Jul 12 22:17:26 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in (sizeof ptrdiff_t): check for size of ptrdiff_t.
+ * string.c (rb_str_format_m): make tmp volatile to avoid possible GC
+ problem.
- * include/ruby/ruby.h (PRI?PTRDIFF, PRI?SIZE): printf conversion
- specifiers for ptrdiff_t and size_t/ssize_t.
+Thu Jul 17 21:30:55 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * insns.def (leave), marshal.c (long_toobig), transcode.c
- (str_transcode), vm_dump.c (control_frame_dump, stack_dump_each),
- (debug_print_register, debug_print_pre): t and z length modifiers
- are C99.
+ * lib/optparse.rb (OptionParser#environment): requires shellwords.
+ [ruby-dev:35466]
-Sat Jul 12 16:02:31 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Jul 17 02:05:10 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/xmlrpc/client.rb (XMLRPC::Client#do_rpc): requires
webrick/cookie. [ ruby-Bugs-21139 ]
-Sat Jul 12 09:25:07 2008 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-
- * test/win32ole/test_win32ole_event.rb: add test
- for WIN32OLE_EVENT#on_event_with_outargs
-
- * test/win32ole/test_win32ole_event.rb(teardown): calling
- WIN32OLE_EVENT.message_loop
-
-Sat Jul 12 01:54:13 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/win32.c (rb_w32_select): shouldn't pass non-socket handle to
- original select().
-
-Fri Jul 11 23:05:40 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * test/zlib/test_zlib.rb: add a test for Zlib::Deflate#params.
-
-Fri Jul 11 22:58:28 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * ext/zlib/zlib.c (rb_deflate_params): flush before deflateParams.
- [ruby-core:17675]
-
-Fri Jul 11 22:09:01 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/setup.rb, win32/Makefile.sub (PLATFORM): use $(PLATFORM)
- instead of $(OS) because ENV["OS"] is used in test-all (drb).
-
-Fri Jul 11 20:51:36 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * io.c (rb_io_wait_readable, rb_io_wait_writable): check if the file
- descriptor is closed.
+Thu Jul 17 01:38:31 2008 Yusuke Endoh <mame@tsg.ne.jp>
- * thread.c (rb_thread_wait_fd_rw): ditto.
+ * ext/zlib/zlib.c (rb_gzfile_set_mtime): fix typo. [ruby-core:17713]
-Fri Jul 11 16:16:43 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/win32.c (rb_w32_accept, rb_w32_socket, rb_w32_socketpair):
- prohibit inheritance of sockets, too. [experimental]
-
-Fri Jul 11 14:39:49 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/win32.c (CreateChild): the measures for Vista is no longer
- unnecessary.
-
-Fri Jul 11 06:16:26 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * common.mk (process.o): depends on util.h.
-
-Fri Jul 11 05:07:46 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * include/ruby/win32.h (pipe): prohibit inheritance.
- fixed: [ruby-dev:35421]
-
-Fri Jul 11 00:56:46 2008 Koichi Sasada <ko1@atdot.net>
-
- * thread.c (thread_create_core): fix GC problem.
- [ruby-core:17669]
-
-Thu Jul 10 22:06:00 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/pstore.rb (PStore#transaction): return the result from the
- block. [ruby-core:17718]
-
-Thu Jul 10 21:15:49 2008 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-
- * test/win32ole/test_win32ole_typelib.rb: add some illegal argument
- test.
-
- * test/win32ole/test_win32ole_type.rb: ditto.
-
- * test/win32ole/test_win32ole_event.rb: ditto.
-
- * test/win32ole/test_win32ole_param.rb: ditto.
-
- * test/win32ole/test_win32ole_method.rb: ditto.
-
-Thu Jul 10 19:38:35 2008 wanabe <s.wanabe@gmail.com>
-
- * test/ruby/envutil.rb (assert_normal_exit): r17993 revert.
-
-Thu Jul 10 18:29:41 2008 wanabe <s.wanabe@gmail.com>
-
- * test/ruby/envutil.rb (assert_normal_exit): finish writing script
- before spawn("ruby") to avoid blocking in win32.
-
-Thu Jul 10 17:20:50 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/win32.c (insert): follow recent changes of globbing.
-
-Thu Jul 10 14:09:05 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/coverage/coverage.c (rb_coverage_start): return nil.
-
-Thu Jul 10 12:41:56 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * thread.c (rb_thread_wait_for): fixed variable name.
-
-Thu Jul 10 12:09:58 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * vm_core.h (rb_thread_t), vm.c (rb_thread_mark), process.c
- (rb_last_status_get, rb_last_status_set, rb_last_status_clear):
- moved last_status from rb_vm_t. [ruby-dev:35414]
-
- * vm.c (th_init2): initialize last_status with nil.
-
-Thu Jul 10 12:09:21 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * thread.c (rb_thread_wait_for): wait until timed out only when
- sleeping with timeout.
-
-Wed Jul 9 22:41:16 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * thread.c (sleep_timeval): wait until timed out. [ruby-core:17270]
-
-Wed Jul 9 20:58:16 2008 Tanaka Akira <akr@fsij.org>
-
- * array.c (rb_ary_fill): don't raise even if length is negative.
- [ruby-core:17483], [ruby-core:17661]
-
-Wed Jul 9 20:18:50 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in (rb_cv_va_args_macro): check for __VA_ARGS__.
-
- * thread.c (thread_debug): show source name and line if possible.
-
- * thread_{pthread,win32}.c (rb_thread_create_timer_thread): needs more
- stack for debug.
-
-Wed Jul 9 11:13:39 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/profiler.rb (Profiler__#print_profile): sort in the descending
- order of cumulative time.
-
-Wed Jul 9 11:11:18 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * dir.c (struct glob_args, rb_glob_caller, rb_glob2, push_pattern),
- (glob_brace): make consistent prototypes.
-
- * dir.c (push_glob): set enc in the caller of rb_glob_caller as well
- as rb_glob2.
-
-Wed Jul 9 09:12:11 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * ext/nkf/nkf-utf8/nkf.c (options): use input_endian.
-
-Wed Jul 9 01:38:37 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * string.c (rb_str_succ): alphabets or numerics mutually enclosing
- non-alphanumeric characters can carry up. e.g., "1.999".succ should
- be "2.000".
-
-Wed Jul 9 00:12:31 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * thread.c (rb_set_coverages, rb_reset_coverages): enable and disable
- coverage measurement.
-
- * thread.c (rb_get_coverages): rename and move from vm.c.
-
- * vm.c (rb_vm_get_coverages): ditto.
-
- * iseq.c (prepare_iseq_build): ditto.
-
- * thread.c (clear_coverage): ditto.
-
- * parse.y (coverage): ditto.
-
- * ext/coverage/coverage.c: use above functions, add new method
- Coverage.start and fix rdoc .
-
-Tue Jul 8 23:02:35 2008 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-
- * ext/win32ole/win32ole.c (find_default_source): bug fix when
- OLE object does not have default source interface.
-
- * test/win32ole/test_win32ole_event.rb: ditto.
-
-Tue Jul 8 22:56:23 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * thread.c (rb_enable_coverages): hide coverage array by setting 0 to
- klass during measurement.
-
- * parse.y (coverage, yycompile0): ditto.
-
- * iseq.c (prepare_iseq_build): use rb_hash_lookup instead of
- rb_hash_aref.
-
- * thread.c (rb_coverage_result): restore klass of coverage array
- and return it.
-
- * thread.c (update_coverage): check whether its klass is 0.
-
-Tue Jul 8 22:28:25 2008 Koichi Sasada <ko1@atdot.net>
-
- * lib/debug.rb, lib/profile.rb: fix to use RubyVM.
-
- * lib/rdoc/parsers/parse_c.rb: ditto.
-
-Tue Jul 8 21:45:22 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * vm.c (rb_vm_mark): mark the last element of special_exceptions.
-
-Tue Jul 8 19:55:40 2008 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-
- * ext/win32ole/win32ole.c (find_default_source): try to
- find COCLASS when WIN32OLE object is not COCLASS.
-
- * test/win32ole/test_win32ole_event.rb: ditto
-
-Tue Jul 8 13:38:22 2008 Koichi Sasada <ko1@atdot.net>
-
- * compile.h: fix to skip inserting a trace insn.
-
-Tue Jul 8 11:41:17 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * dir.c: shouldn't use ruby object in globbing, because glob service
- routines are called before initializing ruby on some platforms (ex.
- windows).
-
-Tue Jul 8 10:08:40 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * dir.c (Next): use rb_enc_mbclen. [ruby-dev:35390]
-
-Tue Jul 8 07:59:40 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * dir.c (Next): use rb_enc_precise_mbclen.
-
-Tue Jul 8 02:27:23 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * dir.c: preserve encoding of strings in glob and fnmatch.
-
- * include/ruby/ruby.h: related changes.
-
-Tue Jul 8 00:22:58 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * string.c (rb_str_succ): limit carrying in an alphanumeric region if
- exists. [ruby-dev:35094]
-
-Mon Jul 7 20:39:28 2008 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-
- * ext/win32ole/win32ole.c(Init_win32ole): add
- WIN32OLE_TYPE#source_ole_types, WIN32OLE_TYPE#default_ole_types,
- WIN32OLE_TYPE#default_event_sources.
-
- * test/win32ole/test_win32ole_type.rb: ditto.
-
-Mon Jul 7 19:45:22 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * test/ruby/test_dir.rb (test_chroot_nodir): add Errno::EPERM.
-
-Mon Jul 7 17:12:20 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun Jul 13 00:08:16 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/ipaddr.rb (IPAddr#initialize): get rid of ArgumentError in
IPAddr#to_range. a patch from okkez <okkez000 AT gmail.com> in
[ruby-dev:35091].
-Mon Jul 7 01:24:43 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * file.c (rb_file_s_extname): fix for file name with spaces.
- [ruby-talk:307404]
-
-Mon Jul 7 00:59:37 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * thread_pthread.c (ruby_init_stack): prior STACK_END_ADDRESS if
- found. [ruby-core:17624]
-
-Sun Jul 6 23:48:06 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/socket/socket.c (bsock_send, s_recvfrom, ruby_connect, s_accept),
- (udp_send, unix_send_io, unix_recv_io): blocking region support.
-
-Sun Jul 6 18:34:35 2008 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-
- * test/win32ole/test_win32ole_type.rb (test_initialize): add
- more assertions.
-
-Sun Jul 6 10:12:21 2008 Kouhei Sutou <kou@cozmixng.org>
-
- * lib/test/unit/collector/objectspace.rb
- (Test::Unit::Collector::ObjectSpace::NAME): fix a typo.
-
-Sun Jul 6 00:56:51 2008 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/socket.c (host_str): fix type mismatch in rb_raise
- format and argument.
- (port_str): ditto.
- (unix_recv_io): ditto.
- (sock_s_unpack_sockaddr_un): ditto.
-
-Sat Jul 5 23:42:23 2008 Tanaka Akira <akr@fsij.org>
-
- * include/ruby/ruby.h (NUM2INT): cast to int.
- (FIX2INT): ditto.
- (NUM2UINT): cast to unsigned int.
- (FIX2UINT): ditto.
-
-Sat Jul 5 23:10:41 2008 Tanaka Akira <akr@fsij.org>
-
- * io.c (rb_pipe): new function for handling EMFILE and ENFILE
- error of pipe().
- (UPDATE_MAXFD_PIPE): removed.
- (pipe_open): use rb_pipe.
- (rb_io_s_pipe): ditto.
-
- * process.c (pipe_nocrash): use rb_pipe.
-
- * include/ruby/intern.h (rb_pipe): declared.
-
-Sat Jul 5 22:22:27 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * thread.c (thread_initialize): NUM2INT() returns int.
-
- * thread.c (timer_thread_function), thread_pthread.c (thread_timer),
- thread_win32.c (timer_thread_func), thread_{pthread,win32}.c
- (rb_thread_create_timer_thread): passing VM.
-
-Sat Jul 5 20:53:18 2008 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-
- * test/win32ole/test_word.rb: check word installed.
-
-Sat Jul 5 16:12:54 2008 Narihiro Nakamura <authorNari@gmail.com>
-
- * gc.c: revert. before lazy sweep.
-
-Sat Jul 5 09:55:44 2008 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-
- * ext/win32ole/win32ole.c: add WIN32OLE#ole_respond_to?
-
- * test/win32ole/test_win32ole.rb: ditto.
-
-Sat Jul 5 08:48:05 2008 Tanaka Akira <akr@fsij.org>
-
- * re.c (unescape_nonascii): add has_property argument not to
- raise error by /\p{Hiragana}\u{3042}/ in EUC-JP script.
- (rb_reg_preprocess): use has_property argument to make regexp
- encoding fixed.
-
-Sat Jul 5 08:29:47 2008 Tanaka Akira <akr@fsij.org>
+Sun Jul 13 00:04:38 2008 Tanaka Akira <akr@fsij.org>
- * re.c (unescape_nonascii): make regexp fixed_encoding if \p is used.
- fixed [ruby-core:17279].
-
-Fri Jul 4 23:12:53 2008 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-
- * ext/win32ole/win32ole.c (d2time): fix the bug of VT_DATE
- to String conversion when negative value.
-
- * test/win32ole/test_win32ole_variant.rb: ditto.
-
-Fri Jul 4 22:15:29 2008 Tanaka Akira <akr@fsij.org>
-
- * lib/test/unit/testcase.rb: collect descendants of
- Test::Unit::TestCase using inherited.
-
- * lib/test/unit/autorunner.rb: don't use ObjectSpace.each_object.
-
- * lib/test/unit/collector/dir.rb: ditto.
-
- * lib/test/unit/collector/objectspace.rb: ditto.
-
- [ruby-core:17126]
+ * configure.in (erfc): erfc of glibc comes with Debian GNU/Linux Etch
+ on IA64 is broken. erfc(10000.0) aborts.
+ use missing/erf.c instead.
+ http://sources.redhat.com/ml/libc-hacker/2005-08/msg00008.html
-Fri Jul 4 20:43:53 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Jul 10 18:50:48 2008 Tanaka Akira <akr@fsij.org>
- * include/ruby/oniguruma.h (OnigEncoding): removed auxiliary_data.
+ * common.mk (SPEC_GIT_BASE): update RubySpec GIT URL.
- * include/ruby/encoding.h (ENC_DUMMY_P): moved dummy encoding flag to
- rb_encoding from Encoding instance.
+Thu Jul 10 18:46:28 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * encoding.c (rb_encoding_list): list of Encoding instances.
+ * file.c (rb_file_s_extname): fix for file name with spaces.
+ [ruby-talk:307404]
- * encoding.c (struct rb_encoding_entry): moved base encoding from
- instance variable.
+Thu Jul 10 18:42:37 2008 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
-Fri Jul 4 17:51:07 2008 NAKAMURA Usaku <usa@ruby-lang.org>
+ * lib/erb.rb (PercentScanner#scan): fix %% line bug. [ruby-core:17491]
- * numeric.c (check_uint, rb_num2uint, rb_fix2uint): proper check.
+ * test/erb/test_erb.rb (test_percent): ditto.
-Fri Jul 4 14:17:22 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Jul 10 18:40:22 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/net/ftp.rb (Net::FTP#sendport): use divmod. [ruby-core:17557]
-Fri Jul 4 11:08:37 2008 Narihiro Nakamura <authorNari@gmail.com>
-
- * gc.c (garbage_collect_force): sweep is completely ended.
-
- * gc.c (os_obj_of): invoke garbage_collect_force() when freelist none.
-
-Fri Jul 4 05:01:26 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * numeric.c (rb_num2uint, rb_fix2uint): typo.
-
-Fri Jul 4 02:21:06 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * numeric.c (check_uint, rb_num2uint, rb_fix2uint): also needs checking
- negative value. see [ruby-dev:33683]
-
-Thu Jul 3 23:26:36 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * include/ruby/intern.h: remove prototypes about coverage.
-
- * iseq.c (prepare_iseq_build): add prototype.
-
- * parse.y (coverage): ditto.
-
- * thread.c (clear_coverage): ditto.
-
- * thread.c (update_coverage): use rb_sourceline.
-
- * thread.c (rb_get_coverages): rename and move to vm.c.
-
- * vm.c (rb_vm_get_coverages): ditto.
-
- * ext/coverage/coverage.c: add rdoc.
-
-Thu Jul 3 21:51:21 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * ext/coverage/coverage.c, ext/coverage/extconf.rb: eliminate
- COVERAGE__ and introduce coverage.so instead. How to measure
- coverage: (1) require "coverage.so", (2) require or load Ruby source
- file, and (3) Coverage.result will return the same hash as COVERAGE__.
- [ruby-dev:35324]
-
- * thread.c (rb_enable_coverages): start coverage measurement by using
- rb_add_event_hook.
-
- * thread.c (rb_get_coverages): returns current results of coverage
- measurement.
-
- * include/ruby/intern.h: add prototype for above two functions.
-
- * vm_core.h, vm.c: add field of coverages to rb_vm_t.
-
- * insns.def (trace): remove special handling for COVERAGE__.
-
- * iseq.c (prepare_iseq_build): switch COVERAGE__ to
- rb_get_coverages().
-
- * parse.y (coverage): ditto.
-
- * thread.c (clear_coverage): ditto.
+Thu Jul 10 18:36:53 2008 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
- * lib/coverage.rb: use coverage.so instead of COVERAGE__.
+ * ruby.c: Mac OS X needs origargc times of '\0' in
+ origargv. [ruby-dev:35308]
-Thu Jul 3 21:20:45 2008 Yusuke Endoh <mame@tsg.ne.jp>
+Thu Jul 10 13:53:08 2008 Tanaka Akira <akr@fsij.org>
- * thread.c (thread_initialize): NUM2INT returns long.
-
-Thu Jul 3 21:06:16 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval.c (Init_eval): typo fixed in r17833.
-
-Thu Jul 3 19:44:44 2008 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-
- * ext/win32ole/win32ole.c (Init_win32ole): remove duplicate line.
-
-Thu Jul 3 16:08:36 2008 Tanaka Akira <akr@fsij.org>
-
- * configure.in (erfc): erfc of glibc comes with Debian GNU/Linux Etch
- on IA64 is broken. erfc(10000.0) aborts.
- use missing/erf.c instead.
- http://sources.redhat.com/ml/libc-hacker/2005-08/msg00008.html
+ * include/ruby/ruby.h (POSFIXABLE): use FIXNUM_MAX+1 instead of
+ FIXNUM_MAX to make it possible to convert to double accurately.
+ It assumes FLT_RADIX is 2.
+ fix RubyForge bug #14102.
+ backported from 1.9.
-Thu Jul 3 12:49:39 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
+Mon Jul 7 16:21:38 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
* lib/net/smtp.rb (Net::SMTP::start): use 'localhost' instead of
'localhost.localdomain'. [ruby-dev:35333]
* lib/net/smtp.rb (Net::SMTP::SMTP.start): ditto.
-Thu Jul 3 07:06:02 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * Makefile.in (SET_LC_MESSAGES): LC_MESSAGES must be C.
-
-Thu Jul 3 07:02:55 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval.c (Init_eval), gc.c (Init_GC), proc.c (Init_Proc): freeze
- messages of preallocated special exceptions also.
-
-Thu Jul 3 04:39:30 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * gc.c (rb_during_gc): VALUE cache is irrelevant.
-
-Thu Jul 3 01:44:01 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * regint.h (GET_ALIGNMENT_PAD_SIZE, ALIGNMENT_RIGHT): cast pointer to
- uintptr_t instead of unsigned int.
-
-Thu Jul 3 01:23:13 2008 Yusuke Endoh <mame@tsg.ne.jp>
+Mon Jul 7 15:02:13 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * sprintf.c: include ieeefp.h to refer to isinf.
+ * eval.c (rb_longjmp): duplicate the thrown exception to set backtrace
+ if it was frozen. clear all raised flags.
- * ext/bigdecimal/bigdecimal.c: ditto.
+ * eval.c (stack_check): leave clearing flag to rb_longjmp.
- * ext/json/ext/generator/generator.c: ditto.
+ * eval.c (rb_thread_set_raised, rb_thread_reset_raised): use generic
+ flags.
- * rational.c: ditto.
+ * eval.c (Init_Proc), gc.c (Init_GC): freeze preallocated special exceptions.
-Thu Jul 3 01:01:57 2008 Yusuke Endoh <mame@tsg.ne.jp>
+ * gc.c (rb_memerror): use thread raised flag instead of static flag,
+ and raise nomem_error without backtrace if failed to make backtrace.
+ [ruby-dev:34724]
- * missing/tgamma.c (tgamma): remove unused variable.
+ * gc.c (ruby_xmalloc): increase malloc_increase only if malloc
+ succeeds. failed malloc size can be huge. it may increase
+ malloc_limit too big which cause less GC and memory full.
+ (ruby_xrealloc): ditto.
-Thu Jul 3 00:18:00 2008 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+Mon Jul 7 12:23:05 2008 Masaki Suketa <masaki.suketa@nifty.ne.jp>
* ext/win32ole/win32ole.c: avoid creating Ruby object during
GC. thanks to arton <artonx AT yahoo.co.jp>. [ruby-dev:35313]
- * test/win32ole/test_win32ole_event.rb: ditto.
-
-Thu Jul 3 00:09:31 2008 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-
- * gc.c: add rb_during_gc(). based on a patch from arton <artonx AT
- yahoo.co.jp> at [ruby-dev:35313].
-
- * include/ruby/intern.h: ditto.
-
-Wed Jul 2 09:49:10 2008 Narihiro Nakamura <authorNari@gmail.com>
-
- * gc.c (gc_lazy_sweep): use lazy sweep algorithm for response
- performance gain.
-
- * gc.c (garbage_collect_force): mark and lazysweep invoke, after
- erasing all mark.
-
- * gc.c (GC_NOT_LAZY_SWEEP): not lazy sweep flag. for debug.
-
-Wed Jul 2 03:42:44 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * test/ruby/test_settracefunc.rb: fix expected traces for
- RubyVM::FrozenCore's event and r17744.
-
-Wed Jul 2 03:10:41 2008 Koichi Sasada <ko1@atdot.net>
-
- * compile.h, insns.def: reduce insn operand of "trace".
-
- * include/ruby/ruby.h: add RUBY_EVENT_COVERAGE event.
-
-Wed Jul 2 02:02:34 2008 Koichi Sasada <ko1@atdot.net>
-
- * proc.c, vm.c: fix to refer to next ruby level cfp to make binding.
-
-Wed Jul 2 01:58:19 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * insns.def (trace): C99ism.
-
-Wed Jul 2 01:53:40 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * Add coverage measurement constant COVERAGE__. This constant is not
- for casual use. Usage: (1) assign {} to COVERAGE__, (2) require or
- load Ruby source file, and (3) COVERAGE__["sourcefilepath"] will
- return an array whose elements represent number of executions per
- line of source code.
-
- * vm_core.h: add field of coverage array to iseq.
-
- * iseq.c (prepare_iseq_build): ditto.
-
- * insns.def (trace): update coverage array.
-
- * parse.y (coverage): create and initialize coverage array.
-
- * compile.h (ADD_TRACE): add trace instruction to update coverage
- array.
-
- * thread.c (clear_coverage): delete coverage array when forking.
- Otherwise, double count of coverage may occur.
-
- * lib/coverage.rb: sample coverage measurement tool.
-
- * error.c: distinguish explicitly between parse_in_eval and
- mild_compile_error.
-
- * load.c: ditto.
-
- * vm_eval.c: ditto.
-
-Tue Jul 1 21:32:43 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * lib/test/unit/ui/console/testrunner.rb: prevent destructive
- modification to $0.
-
- * test/rubygems/gemutilities.rb (build_rake_in): move from
- test_gem_ext_rake_builder.rb.
-
- * test/rubygems/test_gem_ext_rake_builder.rb: ditto.
-
- * test/rubygems/test_gem_installer.rb: override Gem.ruby and
- ENV["rake"].
-
- * test/rubygems/test_gem_uninstaller.rb: ditto.
-
-
-Tue Jul 1 21:13:17 2008 Koichi Sasada <ko1@atdot.net>
-
- * compile.c, vm.c, insns.def: call FrozenCore.set_postexe method
- instead to use "postexe" insn.
-
- * id.c, id.h: add a prepared id for above.
-
-Tue Jul 1 21:09:58 2008 URABE Shyouhei <shyouhei@ruby-lang.org>
-
- * lib/mkmf.rb (create_tmpsrc): we need to include COMMON_HEADERS,
- namely inclusion of ruby.h, because _GNU_SOURCE is now defined
- there (if any) and socket.so requires it on Linux systems.
-
-Tue Jul 1 20:55:07 2008 URABE Shyouhei <shyouhei@ruby-lang.org>
-
- * eval.c (rb_interrupt): trick to suppress GCC warning.
-
- * sprintf.c (rb_str_format): ditto.
-
-Tue Jul 1 20:44:36 2008 Koichi Sasada <ko1@atdot.net>
-
- * tool/instruction.rb: RubyVM is not module.
-
-Tue Jul 1 19:31:24 2008 URABE Shyouhei <shyouhei@ruby-lang.org>
-
- * ext/digest/digest.c (rb_digest_instance_inspect): constified.
-
- * variable.c (rb_path2class): field precision should have type int.
-
-Tue Jul 1 19:01:00 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * enc/shift_jis.c (code_is_ctype): HALF WIDTH KATAKANA is
- a character.
-
-Tue Jul 1 17:56:34 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * missing/vsnprintf.c (BSD__uqtoa): constified.
-
-Tue Jul 1 17:50:44 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * enc/make_encdb.h: always add ';' at the end of line.
-
-Tue Jul 1 17:44:30 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * iseq.c (COMPILE_OPTION_FALSE), time.c (timegm_noleapsecond),
- thread.c (eKillSignal, eTerminateSignal),
- missing/vsnprintf.c (BSD_vfprintf): constified.
+ * ext/win32ole/tests: add test_win32ole_event.rb, remove
+ testOLEEVENT.rb
-Tue Jul 1 17:37:43 2008 URABE Shyouhei <shyouhei@ruby-lang.org>
+ * ext/win32ole/tests/testWIN32OLE.rb(test_convert_bignum):
+ fix test.
- * enc/ascii.c: ISO C does not allow extra ';' outside of a
- function
+Mon Jul 7 12:23:05 2008 Masaki Suketa <masaki.suketa@nifty.ne.jp>
- * enc/us_ascii.c: ditto.
-
- * enc/utf_8.c: ditto.
-
- * enc/big5.c: ditto.
-
- * enc/euc_jp.c: ditto.
-
- * enc/euc_kr.c: ditto.
-
- * enc/euc_tw.c: ditto.
-
- * enc/gb2312.c: ditto.
-
- * enc/gbk.c: ditto.
-
- * enc/iso_8859_1.c: ditto.
-
- * enc/iso_8859_2.c: ditto.
-
- * enc/iso_8859_3.c: ditto.
-
- * enc/iso_8859_4.c: ditto.
-
- * enc/iso_8859_5.c: ditto.
-
- * enc/iso_8859_6.c: ditto.
-
- * enc/iso_8859_7.c: ditto.
-
- * enc/iso_8859_8.c: ditto.
-
- * enc/iso_8859_9.c: ditto.
-
- * enc/iso_8859_10.c: ditto.
-
- * enc/iso_8859_11.c: ditto.
-
- * enc/iso_8859_13.c: ditto.
-
- * enc/iso_8859_14.c: ditto.
-
- * enc/iso_8859_15.c: ditto.
-
- * enc/iso_8859_16.c: ditto.
-
- * enc/koi8_r.c: ditto.
-
- * enc/shift_jis.c: ditto.
-
- * enc/utf_16be.c: ditto.
-
- * enc/utf_32be.c: ditto.
-
- * enc/utf_32le.c: ditto.
-
- * enc/windows_1251.c: ditto.
-
- * process.c (run_exec_rlimit): ISO C90 forbids mixed declarations
- and code
-
- * include/ruby/ruby.h (enum ruby_special_consts): ISO C forbids
- comma at end of enumerator list
-
- * include/ruby/ruby.h (enum ruby_value_type): ditto.
-
- * eval_intern.h (enum): ditto.
-
- * vm_core.h (enum rb_thread_status): ditto.
-
- * parse.y (enum lex_state_e): ditto.
-
- * parse.y (enum string_type): ditto.
-
- * process.c (enum): ditto.
-
- * ruby.c (enum dump_flag_bits): ditto.
-
- * ruby.c (enum disable_flag_bits): ditto.
-
- * enc/gb18030.c (enum): ditto.
-
-Tue Jul 1 17:21:42 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * regexec.c (stack_double): use MatchStackLimitSize atomically.
-
- * regparse.c (onig_free_shared_cclass_table): OnigTypeCClassTable
- needs atomicity
-
- * regsyntax.c: constified all predefined OnigSyntaxTypes.
-
-Tue Jul 1 16:57:44 2008 URABE Shyouhei <shyouhei@ruby-lang.org>
-
- * include/ruby/st.h (struct st_table): type of bit-field
- 'num_entries' is a GCC extension
-
- * include/ruby/ruby.h (rb_intern): prefix __extension__ for
- braced-groups within expressions.
-
- * include/ruby/intern.h (rb_usascii_str_new2): ditto.
-
- * include/ruby/intern.h (rb_tainted_str_new2): ditto.
-
- * include/ruby/intern.h (rb_str_new2): ditto.
-
-Tue Jul 1 15:01:13 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/rubygems/ext/builder.rb (Gem::Ext::Builder.make),
- (Gem::Ext::Builder.run): EXIT_SUCCESS may be 0 or may not.
-
- * test/rubygems/test_gem_ext_rake_builder.rb (build_rake_in): override
- Gem.ruby and ENV["rake"].
-
- * runruby.rb: bin/rake does not exist in archdir where architecture
- depend script (i.e. rbconfig.rb) exists.
-
-Tue Jul 1 13:19:44 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * array.c (rb_ary_fill): check if beg is too big.
-
-Tue Jul 1 12:01:16 2008 Koichi Sasada <ko1@atdot.net>
-
- * compile.c, insns.def, vm.c, vm_core.h: remove some insns
- (undef, alias, definemethod).
- Call RubyVM::FrozenCore's singleton method instead.
- Add "putiseq" and "putspecialobject" instructions.
+ * gc.c: add rb_during_gc(). based on a patch from arton <artonx AT
+ yahoo.co.jp> at [ruby-dev:35313].
- * id.c, id.h: add ids for above.
+ * intern.h: ditto.
- * tool/parse.rb: "VM" no longer exists. Use RubyVM instead.
+Thu Jul 3 20:13:20 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Jul 1 03:28:16 2008 Eric Hodel <drbrain@segment7.net>
+ * marshal.c (w_object, marshal_dump, r_object0, marshal_load): search
+ public methods only. [ruby-core:17283]
- * test/rubygems/test_ext_configure_builder.rb: Apply locale-free
- patch by Yusuke ENDOH. [ruby-core:17444].
+ * object.c (convert_type): ditto.
- * runruby.rb: Set ENV['rake']. Patch by Yusuke ENDOH
- [ruby-core:17442].
+ * lib/singleton.rb (Singleton#_dump): conversion method should be
+ public.
-Tue Jul 1 01:07:17 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Jul 2 19:06:43 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/cgi.rb (CGI::QueryExtension.read_multipart): blanks inside
double quotes are allowed. [ruby-list:45140]
-Tue Jul 1 00:59:43 2008 Tanaka Akira <akr@fsij.org>
+Wed Jul 2 19:03:37 2008 Tanaka Akira <akr@fsij.org>
* numeric.c (num_coerce): call rb_Float(x) first. don't depend on
evaluation order of function arguments.
-Tue Jul 1 00:49:11 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * gc.c (rb_newobj): abort GC phase before rb_bug.
-
-Mon Jun 30 23:15:07 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * test/openssl/test_ssl.rb (start_server): shutdown TCPServer before
- close.
-
-Mon Jun 30 23:01:50 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * common.mk (RUBY_H_INCLUDES): common headers which are included with
- ruby.h together.
-
-Mon Jun 30 22:57:50 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * test/ruby/test_settracefunc.rb (test_raise): reveal an exception
- hided by rescue modifier.
-
-Mon Jun 30 22:49:32 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * test/ruby/test_array.rb (test_aset): access with too big index
- raises not ArgumentError but IndexError now.
-
-Mon Jun 30 22:30:37 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/test/unit/collector/dir.rb (recursive_collect): r15662 reverted.
-
-Mon Jun 30 22:27:39 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * ext/stringio/stringio.c (strio_getline): fix for nil and "" as
- separator. [ruby-dev:34591]
-
-Mon Jun 30 22:21:30 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * io.c (argf_each_line): pass args to each_line. [ruby-dev:34958]
-
-Mon Jun 30 22:12:46 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * gc.c (chain_finalized_object): should not delete from finalizer
- table until run.
-
- * gc.c (rb_gc_call_finalizer_at_exit): deferred_final_list may be
- empty first.
-
-Mon Jun 30 18:57:05 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * gc.c (gc_finalize_deferred): allow object allocation in finalizers.
-
- * gc.c (rb_gc_call_finalizer_at_exit): ditto.
-
-Mon Jun 30 14:41:36 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * gc.c (rb_newobj): prohibit call of rb_newobj() during gc when
- USE_VALUE_CACHE is not defined (normal case).
-
-Mon Jun 30 10:28:33 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
+Wed Jul 2 18:57:19 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
* ext/syslog/syslog.c (syslog_write): syslog operations should be
protected from $SAFE level 4. a patch from Keita Yamaguchi
@@ -20826,1212 +697,156 @@ Mon Jun 30 10:28:33 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
* ext/syslog/syslog.c (mSyslog_set_mask): ditto.
-Mon Jun 30 03:01:35 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * test/net/http/test_http.rb (_test_request__file): specify encoding
- explicitly.
-
- * test/net/http/utils.rb: ditto.
-
-Mon Jun 30 02:31:07 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * encoding.c (rb_utf8_encindex): defined.
-
- * include/ruby/encoding.h (rb_utf8_encindex): ditto.
-
-Mon Jun 30 02:14:34 2008 Koichi Sasada <ko1@atdot.net>
-
- * vm.c, vm_core.h,vm_core.h, vm_dump.c, iseq.c: rename class name
- VM -> RubyVM, and rename rb_cVM -> rb_cRubyVM.
- "VM" is too short name for class.
-
- * test/ruby/test_method.rb, test/ruby/test_settracefunc.rb: ditto.
-
- * include/ruby/ruby.h: rb_cRubyVM, rb_cEnv, rb_cISeq should not be
- exposed.
-
-Mon Jun 30 02:10:32 2008 Koichi Sasada <ko1@atdot.net>
-
- * process.c (Init_process): fix to avoid a warning.
-
-Mon Jun 30 01:52:05 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * test/ruby/test_parse.rb: remove tests for open_args.
-
-Sun Jun 29 23:01:54 2008 Tanaka Akira <akr@fsij.org>
-
- * string.c (rb_str_format_m): make tmp volatile to avoid possible GC
- problem.
-
-Sun Jun 29 18:01:30 2008 Kouhei Sutou <kou@cozmixng.org>
-
- * lib/rss/parser.rb, lib/rss/utils.rb: merge documents from ruby_1_8.
-
-Sun Jun 29 17:44:23 2008 Kouhei Sutou <kou@cozmixng.org>
-
- * lib/rss/parser.rb (RSS::ListenerMixin#known_class): define to
- work with ruby 1.8.x too.
-
-Sun Jun 29 17:41:42 2008 Kouhei Sutou <kou@cozmixng.org>
-
- * lib/rss/maker/base.rb (RSS::Maker::RSSBase#to_feed): raise
- exception not return nil if RSS::Maker.make can't get required
- information.
-
- * test/rss/rss-assertions.rb: follow the above change.
-
-Sun Jun 29 17:37:23 2008 Kouhei Sutou <kou@cozmixng.org>
-
- * lib/rss/maker/base.rb (RSS::Maker::RSSBase#make): require block.
+Wed Jul 2 18:26:20 2008 Tanaka Akira <akr@fsij.org>
- * test/rss/test_maker_{0.9,1.0,2.0}.rb: follow the above change.
+ * math.c (domain_check): fix preprocess condition.
-Sun Jun 29 17:33:34 2008 Kouhei Sutou <kou@cozmixng.org>
-
- * lib/rss/maker/base.rb, lib/rss/maker/itunes.rb: don't use
- instance_eval to initialize variables. (speed up)
-
-Sun Jun 29 17:31:15 2008 Kouhei Sutou <kou@cozmixng.org>
-
- * lib/rss/rss.rb, test/rss/test_version.rb (RSS::VERSION):
- 0.2.4 -> 0.2.5.
-
-Sun Jun 29 11:36:20 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * dir.rb: fix resource leak.
-
-Sun Jun 29 09:43:10 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Jul 2 18:22:52 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/tmpdir.rb (@@systmpdir): prior LOCAL_APPDATA if possible, and
should be clean. based on a patch from arton <artonx AT
yahoo.co.jp> at [ruby-dev:35269]
-Sun Jun 29 07:53:08 2008 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+Wed Jul 2 18:16:19 2008 Masaki Suketa <masaki.suketa@nifty.ne.jp>
* ext/win32ole/win32ole.c (date2time_str): fix the overflow in
some situation. [ruby-bugs-20793]
-Sat Jun 28 21:25:08 2008 Tanaka Akira <akr@fsij.org>
-
- * include/ruby/ruby.h (struct RRegexp): new field usecnt. replace
- str and len by src.
-
- * gc.c (gc_mark_children): mark src field of regexp.
- (obj_free): don't free str field.
-
- * re.c (REG_BUSY): removed.
- (rb_reg_initialize): prohibit re-initialize regexp.
- (rb_reg_search): use usecnt to prevent freeing regexp currently
- using. this prevents SEGV by:
- r = /\A((a.)*(a.)*)*b/
- r =~ "ab" + "\xc2\xa1".force_encoding("euc-jp")
- t = Thread.new { r =~ "ab"*8 + "\xc2\xa1".force_encoding("utf-8")}
- sleep 0.2
- r =~ "ab"*8 + "\xc2\xa1".force_encoding("euc-jp")
-
-Sat Jun 28 21:15:43 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Jul 1 15:11:14 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * include/ruby/intern.h (rb_str_new2, rb_tainted_str_new2,
- rb_usascii_str_new2): use inline versions only for constant
- literals.
-
-Sat Jun 28 13:12:06 2008 Tanaka Akira <akr@fsij.org>
+ * array.c (rb_ary_fill): check if beg is too big.
- * test/rubygems/test_gem.rb (test_self_path_APPLE_GEM_HOME): don't use
- fixed /tmp/apple_gem_home directory.
+Mon Jun 30 20:35:32 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat Jun 28 08:40:18 2008 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+ * string.c (str_buf_cat): check for self concatenation.
- * ext/win32ole/win32ole.c: check String encoding when
- converting String to VT_BSTR in OLE.
+Sun Jun 29 21:39:54 2008 Tanaka Akira <akr@fsij.org>
- * test/win32ole/test_win32ole.rb: ditto.
+ * eval.c (rb_obj_respond_to): use RTEST to test the result of
+ respond_to? method.
-Sat Jun 28 01:08:42 2008 Tanaka Akira <akr@fsij.org>
+Sun Jun 29 21:20:17 2008 URABE Shyouhei <shyouhei@ruby-lang.org>
- * time.c (time_timespec): fix rounding negative float.
+ * array.c (rb_ary_fill): (compatibility) do not raise
+ ArgumentError on negative length. This behaviour shall change
+ in a future release.
-Fri Jun 27 21:38:57 2008 Tanaka Akira <akr@fsij.org>
+Sun Jun 29 20:08:11 2008 Tanaka Akira <akr@fsij.org>
- * struct.c: __size__ removed. use the length of __members__ instead.
- (num_members): new function.
+ * time.c (time_timeval): fix rounding negative float.
-Fri Jun 27 21:19:08 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun Jun 29 19:19:08 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* test/inlinetest.rb (InlineTest.in_progname): workaround for frozen
$0. [ruby-dev:35261]
* lib/test/unit/ui/console/testrunner.rb (TestRunner#finished): ditto.
-Fri Jun 27 17:45:17 2008 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-
- * lib/erb.rb: adjust line number for magic comment.
-
- * test/erb/test_erb.rb: add tests for def_method.
-
-Fri Jun 27 14:29:07 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * parse.y (primary): empty not should call '!' on nil.
- cf [ruby-dev:35227]
-
-Fri Jun 27 14:25:52 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * vm.c (vm_eval_body): if thrown exception is frozen, reraise it to
- create a new instance.
-
-Fri Jun 27 13:29:26 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * include/ruby/intern.h (rb_str_new2, rb_tainted_str_new2,
- rb_usascii_str_new2): use with-length versions with strlen to
- optimize strlen, if optimized.
-
-Fri Jun 27 12:28:57 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/un.rb (mkmf): new command to create makefile.
-
-Fri Jun 27 11:06:05 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/un.rb (wait_writable): added help message.
-
-Fri Jun 27 06:52:54 2008 Koichi Sasada <ko1@atdot.net>
-
- * configure.in: need a ",".
-
- * process.c (rb_fork): check CANNOT_FORK_WITH_PTHREAD macro.
-
-Fri Jun 27 06:50:56 2008 Koichi Sasada <ko1@atdot.net>
-
- * vm_eval.c (vm_call_super): fix to call method_missing.
- [ruby-core:15719], [ruby-core:17340]
-
-Fri Jun 27 00:00:14 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun Jun 29 19:19:08 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ruby.c (set_arg0, ruby_prog_init): freeze $0. a patch from Keita
Yamaguchi <keita.yamaguchi at gmail.com>.
-Thu Jun 26 23:58:29 2008 Yusuke Endoh <mame@tsg.ne.jp>
+Sun Jun 29 18:33:33 2008 Tanaka Akira <akr@fsij.org>
- * string.c (rb_str_index_m, rb_str_rindex_m, rb_str_include): fix
- rdoc.
+ * process.c: include sys/resource.h if HAVE_SYS_RESOURCE_H is defined.
+ pointed by TOYOFUKU Chikanobu. [ruby-dev:35258]
-Thu Jun 26 17:43:41 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
+Sun Jun 29 18:26:01 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
- * variable.c (rb_f_trace_var): should not be allowed at safe level 4.
+ * variable.c (rb_f_trace_var): should not be allowed at safe level 4.
a patch from Keita Yamaguchi <keita.yamaguchi at gmail.com>.
-Thu Jun 26 11:04:30 2008 Eric Hodel <drbrain@segment7.net>
-
- * lib/rubygems: Update to RubyGems 1.2.0 r1824. Incorporates patch by
- Yusuke ENDOH [ruby-core:17353].
-
-Thu Jun 26 00:48:31 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * parse.y (primary): not operand might be empty. [ruby-dev:35227]
-
-Wed Jun 25 21:54:34 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * parse.y (primary): make functional-style not operator to act
- like function. see <http://d.hatena.ne.jp/ku-ma-me/20080624/p1>.
+ * eval.c (rb_call0): wrong condition to check insecure method.
+ a patch from Keita Yamaguchi <keita.yamaguchi at gmail.com>.
-Wed Jun 25 15:28:50 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun Jun 29 18:22:52 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* array.c (rb_ary_fill): not depend on unspecified behavior at integer
overflow. reported by Vincenzo Iozzo <snagg AT openssl.it>.
-Wed Jun 25 13:42:44 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * lib/erb.rb (ERB::Compiler:Buffer#new): push magic comment first.
-
- * lib/erb.rb (ERB::Compiler#compile): fix for broken input.
-
-Wed Jun 25 12:10:01 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * lib/erb.rb (ERB::Compiler#compile): magic comment needs LF.
-
-Wed Jun 25 09:31:11 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * lib/erb.rb (ERB::Compiler#compile): output magic comment.
-
-Tue Jun 24 22:14:36 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * vm_eval.c (eval_string_with_cref): preserve parse_in_eval even if
- exception raised.
-
-Tue Jun 24 22:09:18 2008 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+Sun Jun 29 18:22:06 2008 Masaki Suketa <masaki.suketa@nifty.ne.jp>
* ext/win32ole/win32ole.c(ole_invoke): fix memory leak.
[ruby-bugs-20792]
-Tue Jun 24 17:20:39 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in (rb_cv_fork_with_pthread): check after check for
- pthread library, and define the macro when checked only.
-
-Tue Jun 24 17:04:39 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * ext/io/wait/extconf.rb: check sys/socket.h for cygwin.
-
-Tue Jun 24 16:51:51 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * io.c (io_reopen): remove cygwin handling because it seems to be for
- C's stdio.
- fixed [ruby-dev:35183]
-
-Tue Jun 24 11:12:33 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * include/ruby/win32.h, win32/win32.c (rb_w32_getppid): now support
- getppid() on win32 (but only Win2k or later).
+Sun Jun 29 18:19:11 2008 Akinori MUSHA <knu@iDaemons.org>
- * process.c (get_ppid): remove win32 special logic.
+ * eval.c (PUSH_FRAME, PUSH_CLASS): Add volatile to avoid a
+ possible optimization bug on OS X/PPC. This at least makes
+ build with gcc -O1 and `make test' pass.
-Tue Jun 24 09:40:47 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * ext/socket/socket.c (init_sock): socket is binmode on platforms
- which support binmode.
-
-Tue Jun 24 00:21:53 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * compile.c (iseq_build_from_ary): initialize arg_opts, a patch from
- Adam Strzelecki <ono at java.pl> in [ruby-core:17220].
-
-Tue Jun 24 00:10:53 2008 wanabe <s.wanabe@gmail.com>
-
- * compile.c (iseq_build_from_ary): fix expression to obtain
- iseq->local_size and iseq->local_table_size. [ruby-dev:35205]
-
-Mon Jun 23 11:31:41 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/mathn.rb (Rational::power2): removed incomplete method.
- see [ruby-dev:35195]. [ruby-core:17293]
-
-Sun Jun 22 14:16:28 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/readline/extconf.rb (have_readline_func): readline on Mac OS X
- needs headers to detect some functions.
-
-Sun Jun 22 09:51:14 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * object.c (rb_class_superclass): rdoc improvement, a patch from
- Gaston Ramos <ramos.gaston AT gmail.com> in [ruby-core:17371].
-
-Sun Jun 22 09:22:32 2008 URABE Shyouhei <shyouhei@ruby-lang.org>
-
- * README.EXT: translated README.EXT.ja
-
-Sun Jun 22 00:42:02 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/win32.c (rb_w32_osid, rb_w32_osver, CreateChild): XP is
- is different from Vista about pipe handle inheritance.
- fixed [ruby-core:17367], reported by Lars Christensen <larsch at
- belunktum.dk>
-
-Sun Jun 22 00:38:45 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * README.EXT.ja: add note about mark and free.
-
-Sun Jun 22 00:01:36 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * io.c (rb_io_binmode_p, argf_binmode_p, Init_IO): new method
- IO#binmode? and ARGF.binmode? [ruby-dev:35148]
-
-Sat Jun 21 17:33:50 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/win32.c (rb_w32_spawn): no longer support P_WAIT.
-
-Sat Jun 21 16:46:09 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * thread_win32.c (native_sleep): must block reentrance when accessing
- th->unblock.
- fixed [ruby-core:17341], reported by Bill Kelly <billk at cts.com>
-
-Sat Jun 21 16:29:02 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (call_args2, open_args): removed.
-
- * parse.y (parser_yylex): unified warnings at space between method
- name and argument parenthesis. [ruby-dev:33943]
-
-Sat Jun 21 16:21:07 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * numeric.c (flo_round): get rid of overflow.
-
-Sat Jun 21 15:57:15 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun Jun 29 17:24:43 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/rdoc/parsers/parse_rb.rb (RDoc#collect_first_comment): skip
magic comment.
-Sat Jun 21 15:54:55 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun Jun 29 17:22:09 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * configure.in: check if fork works with pthread.
+ * ext/stringio/stringio.c (strio_each, strio_readlines): IO#each and
+ IO#readlines do not affect $_. [ruby-core:17277]
-Sat Jun 21 15:31:09 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun Jun 29 17:19:59 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * tool/make-snapshot: ported to ruby.
+ * ext/stringio/stringio.c (strio_readline, strio_each)
+ (strio_readlines): set lastline. [ruby-core:17257]
- * tool/make-snapshot: fixed digests.
+Sun Jun 29 17:15:49 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-Sat Jun 21 04:36:59 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * ext/openssl/ossl.h: include winsock.h if USE_WINSOCK2 is not defined.
+ a patch from arton <artonx at yahoo.co.jp> in [ruby-dev:35078]
- * ext/bigdecimal/lib/bigdecimal/jacobian.rb (Jacobian::dfdxi):
- typo fixed (raize -> raise). [ruby-list:45101]
+Sun Jun 29 17:09:48 2008 wanabe <s.wanabe@gmail.com>
- * enumerator.c (enum_each_cons): typo in RDoc fixed.
+ * util.c (ruby_strtod): ruby_strtod don't allow a trailing
+ decimal point like "7.". [ruby-dev:34835] [ruby-dev:35009]
-Sat Jun 21 00:45:34 2008 URABE Shyouhei <shyouhei@ruby-lang.org>
+Sat Jun 28 19:23:40 2008 URABE Shyouhei <shyouhei@ruby-lang.org>
- * tool/make-snapshot: do not use sha256sum; use BASERUBY instead
+ * class.c (clone_method): use rb_copy_node_scope.
+ fixed [ruby-list:45102]
+ fixed [ruby-core:17393]
- * common.mk (dist): use tool/make-snapshot instead
+Sat Jun 28 18:49:50 2008 URABE Shyouhei <shyouhei@ruby-lang.org>
-Fri Jun 20 16:34:14 2008 Tanaka Akira <akr@fsij.org>
+ * class.c: revert to r15855.
- * process.c (Init_process): Process::Status#to_int removed.
- (PST2INT): defined.
- (pst_to_s): use PST2INT.
- (pst_inspect): ditto.
- (pst_equal): ditto.
- (pst_bitand): ditto.
- (pst_rshift): ditto.
- (pst_wifstopped): ditto.
- (pst_wstopsig): ditto.
- (pst_wifsignaled): ditto.
- (pst_wtermsig): ditto.
- (pst_wifexited): ditto.
- (pst_wexitstatus): ditto.
- (pst_success_p): ditto.
- (pst_wcoredump): ditto.
- (rb_f_system): ditto.
+Fri Jun 20 18:25:18 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Jun 20 15:40:02 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * string.c (rb_str_buf_append): should infect.
+
+Fri Jun 20 16:33:09 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* array.c (rb_ary_store, rb_ary_splice): not depend on unspecified
behavior at integer overflow.
* string.c (str_buf_cat): ditto.
-Fri Jun 20 12:39:55 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * process.c (rb_detach_process): store detached process ID in the
- thread local storage. moved from lib/open3.rb.
-
-Fri Jun 20 11:57:46 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * string.c (rb_str_sub_bang): should preserve replacement points
- since they may be altered in the yielded block.
-
-Fri Jun 20 11:07:56 2008 Tanaka Akira <akr@fsij.org>
-
- * string.c (rb_memhash): randomize hash to avoid algorithmic
- complexity attacks.
- (rb_str_hash): use rb_memhash.
-
- * include/ruby/intern.h (rb_reset_random_seed): declared.
-
- * thread.c (rb_thread_atfork): call rb_reset_random_seed.
-
- * inits.c (rb_call_inits): call Init_RandomSeed at first.
-
- * random.c (seed_initialized): defined.
- (fill_random_seed): extracted from random_seed.
- (make_seed_value): extracted from random_seed.
- (rb_f_rand): initialize random seed at first.
- (initial_seed): defined.
- (Init_RandomSeed): defined.
- (Init_RandomSeed2): defined.
- (rb_reset_random_seed): defined.
- (Init_Random): call Init_RandomSeed2.
-
-Wed Jun 18 21:52:38 2008 URABE Shyouhei <shyouhei@ruby-lang.org>
+Wed Jun 18 22:24:46 2008 URABE Shyouhei <shyouhei@ruby-lang.org>
* array.c (ary_new, rb_ary_initialize, rb_ary_store,
- rb_ary_splice, rb_ary_times): integer overflows should be
+ rb_ary_aplice, rb_ary_times): integer overflows should be
checked. based on patches from Drew Yao <ayao at apple.com>
fixed CVE-2008-2726
- * string.c (rb_enc_cr_str_buf_cat): fixed unsafe use of alloca,
+ * string.c (rb_str_buf_append): fixed unsafe use of alloca,
which led memory corruption. based on a patch from Drew Yao
<ayao at apple.com> fixed CVE-2008-2726
-Fri Jun 20 03:26:00 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * process.c (rb_f_fork): NetBSD 4.0 or later can fork.
-
-Fri Jun 20 03:19:39 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * test/testunit/collector/test_dir.rb: r15825 made it unnecessary to
- change String to Symbol.
-
- * test/testunit/collector/test_objectspace.rb: ditto.
-
-Fri Jun 20 03:14:31 2008 Eric Hodel <drbrain@segment7.net>
-
- * lib/rubygems*, test/rubygems/*: Update to RubyGems 1.1.1 r1784 (pre
- 1.2).
-
-Fri Jun 20 03:01:59 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * thread.c: try to remove false positive of deadlock detection (second
- trial).
-
-Fri Jun 20 02:16:43 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/mathn.rb (Rational::power2): typo fixed. [ruby-core:17293]
-
-Fri Jun 20 02:11:01 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * string.c (str_gsub): should preserve last successful match
- data. [ruby-dev:35182]
-
-Fri Jun 20 01:07:28 2008 Koichi Sasada <ko1@atdot.net>
-
- * KNOWNBUGS.rb, bootstraptest/pending.rb: move a bug (?) to pending.
-
-Fri Jun 20 00:40:08 2008 Koichi Sasada <ko1@atdot.net>
-
- * proc.c (proc_new): fix to return Proc object if block is already
- in heap. [ruby-core:15711]
+ * sprintf.c (rb_str_format): backported from trunk.
- * bootstraptest/test_proc.rb: add a test.
-
-Fri Jun 20 00:18:04 2008 Koichi Sasada <ko1@atdot.net>
-
- * thread_win32.c (native_sleep): fix to decrement sleeper count.
-
-Thu Jun 19 23:48:45 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * test/net/http/test_http.rb: compare encodings of two strings before
- comparing themself, which suppress too big error output.
-
-Thu Jun 19 23:46:35 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * ext/json/ext/parser/parser.rl, ext/json/ext/parser/parser.c: JSON
- text SHALL be encoded in Unicode.
-
-Thu Jun 19 23:17:56 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * thread.c, thread_win32.c, vm_core.h: try to remove false positive of
- deadlock detection.
-
-Thu Jun 19 21:38:08 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/extmk.rb (extmake): check if compile before showing message.
-
-Thu Jun 19 21:35:32 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * tool/make-snapshot: supported multiple snapshots.
-
-Thu Jun 19 20:37:00 2008 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-
- * lib/net/pop.rb (Net::POP3#set_all_uids): speed
- up. a patch from <m-sumi AT techfirm.co.jp> [ruby-list:45047]
-
-Thu Jun 19 17:44:15 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * ext/etc/etc.c (Init_etc): define constant aliases Etc::Passwd
- and Etc::Group. [ruby-dev:35150]
-
-Thu Jun 19 17:37:21 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * string.c (str_alloc): specify 'inline' modifier.
-
- * string.c (str_alloc): remove cSymbol hack that no longer
- necessary.
-
- * string.c (scan_once): avoid retrieving encoding info unless
- necessary.
-
-Thu Jun 19 17:19:14 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * string.c (rb_str_scan): String#scan should preserve last
- successful match data. [ruby-dev:35106]
-
-Thu Jun 19 16:49:36 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * missing/acosh.c (atanh): should set ERANGE to errno if parameter
- is the boundary case. fixed [ruby-dev:35155]
-
-Thu Jun 19 16:06:01 2008 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tk/lib/tkextlib/tile/treeview.rb: cannot configure tags.
-
-Thu Jun 19 11:48:33 2008 Koichi Sasada <ko1@atdot.net>
-
- * test/ruby/test_enumerator.rb: fix to skip "with_memo" test.
-
-Thu Jun 19 11:40:55 2008 Koichi Sasada <ko1@atdot.net>
-
- * vm_insnhelper.c (vm_throw): fix "return" process from "lambda".
-
- * bootstraptest/test_proc.rb: add a test.
-
- * bootstraptest/pending.rb: add a pending bug.
-
-Thu Jun 19 00:33:40 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * test/etc/test_etc.rb: avoid infinite loop. [ruby-dev:35158]
-
-Wed Jun 18 23:07:19 2008 URABE Shyouhei <shyouhei@ruby-lang.org>
-
- * gc.c (rb_newobj): prohibit call of rb_newobj() during gc.
- a patch from Sylvain Joyeux in [ruby-core:12099].
-
-Wed Jun 18 21:08:14 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ruby.c (verbose_setter, opt_W_getter): fixed prototypes.
-
-Wed Jun 18 19:20:00 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * ruby.c (opt_W_getter): use ruby_verbose directly instead of parameter
- because ruby_verbose is not a real variable, so the address of
- parameter is not collect.
-
-Wed Jun 18 18:31:03 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/win32.c (errmap): add some pipe errors.
-
- * win32/win32.c (rb_w32_write): set errno when CRT's errno is EINVAL
- for pipe errors.
-
-Wed Jun 18 18:09:08 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/win32.c (poll_child_status): set EINVAL to errno when
- GetExitCodeProcess() fails with ERROR_INVALID_HANDLE.
-
-Wed Jun 18 15:01:18 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * io.c (rb_open_file): fs_encoding and fname_encoding is
- rb_encoding *.
- fixed [ruby-dev:35151]
-
-Wed Jun 18 14:30:06 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * io.c (rb_open_file): not rb_enc_get_index but rb_enc_get.
-
-Wed Jun 18 13:49:58 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * include/ruby/win32.h (pipe): now pipe is textmode. although this
- change is experimental, it will be spec if no compatibility problem
- is reported.
-
-Wed Jun 18 12:05:30 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * marshal.c (w_object, marshal_dump, r_object0, marshal_load): search
- public methods only. [ruby-core:17283]
-
- * object.c (convert_type): ditto.
-
- * lib/singleton.rb (Singleton#_dump): conversion method should be
- public.
-
-Wed Jun 18 10:18:11 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/etc/etc.c (etc_passwd, etc_group): fixed rdoc. a patch from
- okkez <okkez000 AT gmail.com> in [ruby-dev:35141].
-
-Wed Jun 18 08:58:16 2008 Eric Hodel <drbrain@segment7.net>
-
- * lib/rubygems/*: Fix errors for 1.9.
-
- * gem_prelude.rb: Only remove methods from gem_prelude.rb when
- loading real RubyGems.
-
-Wed Jun 18 07:03:30 2008 Eric Hodel <drbrain@egment7.net>
-
- * lib/rubygems/*: Update to RubyGems r1778 (pre 1.2).
-
-Wed Jun 18 04:27:58 2008 Koichi Sasada <ko1@atdot.net>
-
- * KNOWNBUGS.rb, bootstraptest/pending.rb: move pending bug.
-
-Wed Jun 18 04:24:20 2008 Koichi Sasada <ko1@atdot.net>
-
- * vm.c, vm_insnhelper.c: fix escape process with "break" and "return"
- syntax in "lambda". [ ruby-Bugs-19304 ], [ruby-core:17164]
-
- * KNOWNBUGS.rb, bootstraptest/test_proc.rb: add/move solved test.
-
-Wed Jun 18 01:51:10 2008 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tk/lib/multi-tk.rb: cannot access class variable from
- singleton method.
-
-Wed Jun 18 00:03:33 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * dir.c (Init_Dir): dir_foreach() takes variable argument.
-
-Tue Jun 17 23:04:24 2008 James Edward Gray II <jeg2@ruby-lang.org>
-
- * lib/net/telnet.rb: Fixing Telnet#wairfor() which was broken by
- changes to the Kernel::Integer() method. [ruby-core:17272]
-
-Tue Jun 17 23:02:18 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ruby.c (opt_W_getter): made a hooked variable.
-
-Tue Jun 17 22:04:47 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * enc/euc_jp.c (property_name_to_ctype): core dumped when sizeof(int)
- differs from sizeof(long). [ruby-dev:35131]
-
- * enc/shift_jis.c (property_name_to_ctype): ditto.
-
- * enc/unicode.c (onigenc_unicode_property_name_to_ctype): ditto.
-
-Tue Jun 17 20:32:37 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * common.mk (miniruby$(EXEEXT)): $(PREP) isn't always same as
- miniruby, and tests, debug, etc have no meaning when
- cross-compiling.
-
-Tue Jun 17 18:39:11 2008 Ryan Davis <ryand-ruby@zenspider.com>
-
- * common.mk: fixed dependencies on miniruby.
-
-Tue Jun 17 18:11:01 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * include/ruby/win32.h (pipe): expand pipe buffer size.
-
-Tue Jun 17 17:07:35 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/win32.c (CreateChild): no need to inherit handles here because
- spawn'ed child cannot detect that STDIN is closed.
-
-Tue Jun 17 06:32:55 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * dir.c (dir_data): add intenc and extenc.
-
- * dir.c (dir_s_alloc): ditto.
-
- * dir.c (dir_initialize): now accept internal_encoding and
- external_encoding.
-
- * dir.c (dir_s_open): changed for dir_initialize.
-
- * dir.c (dir_open_dir): ditto.
-
- * dir.c (dir_foreach): changed for dir_open_dir.
-
- * dir.c (dir_entries): changed for dir_open_dir.
-
- * dir.c (dir_enc_str): defined.
-
- * dir.c (dir_path): use dir_enc_str.
-
- * dir.c (dir_read): ditto.
-
- * dir.c (dir_each): ditto.
-
-Tue Jun 17 06:28:57 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * io.c (io_set_encoding): defined.
-
- * io.c (rb_open_file): convert path on Windows and Mac OS X.
-
- * io.c (open_key_args): use io_set_encoding and now accept
- internal_encoding and external_encoding.
-
-Tue Jun 17 06:26:28 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * encoding.c (rb_filesystem_encoding): defined.
-
- * include/ruby/encoding.h (rb_filesystem_encoding): added.
-
-Tue Jun 17 06:24:28 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * ext/syck/rubyext.c: add encoding header.
-
-Tue Jun 17 01:52:50 2008 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tk/tcltklib.c: SEGV when exit.
-
- * ext/tk/lib/tk.rb: add a check for safety to Tk.exit.
-
- * ext/tk/sample/irbtkw.rbw: freezes when receives SIGINT.
-
-Mon Jun 16 21:58:38 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/stringio/stringio.c (strio_each, strio_readlines): IO#each and
- IO#readlines do not affect $_. [ruby-core:17277]
-
-Mon Jun 16 18:52:47 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/thwait.rb (ThreadsWait): Exception2MessageMapper no longer has
- extend_to method. [ruby-core:17267]
-
-Mon Jun 16 14:46:25 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/e2mmap.rb (E2MM.def_e2message): typo.
-
-Mon Jun 16 09:43:27 2008 Akinori MUSHA <knu@iDaemons.org>
-
- * enumerator.c (enumerator_with_object, Init_Enumerator):
- Temporarily back out with_memo, for which we need a better name.
-
-Mon Jun 16 07:14:48 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/stringio/stringio.c (strio_readline, strio_each)
- (strio_readlines): set lastline. [ruby-core:17257]
-
-Mon Jun 16 01:49:39 2008 Koichi Sasada <ko1@atdot.net>
-
- * eval.c (rb_f_block_given_p): fix to skip class frame.
- [ruby-core:14813]
-
- * KNOWNBUGS.rb, bootstraptest/test_method.rb: move solved test.
-
-Mon Jun 16 01:48:08 2008 Koichi Sasada <ko1@atdot.net>
-
- * vm_dump.c (vm_stack_dump_raw): disable verbose debug output.
-
-Mon Jun 16 01:33:08 2008 Koichi Sasada <ko1@atdot.net>
-
- * vm_core.h, thread.c: rename global_interpreter_lock to
- global_vm_lock.
-
-Sun Jun 15 18:40:35 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * ext/syck/rubyext.c (yaml_org_handler): associate encoding.
-
- * ext/syck/rubyext.c (syck_genericresolver_node_import): ditto.
-
-Sun Jun 15 18:17:03 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * vm_core.h (rb_vm_t), vm.c (rb_vm_mark): moved preallocated special
- exceptions.
-
- * eval.c (Init_eval), gc.c (Init_GC), proc.c (Init_Proc): freeze
- preallocated special exceptions.
-
- * eval.c (rb_longjmp): duplicate the thrown exception to set backtrace
- if it was frozen.
-
- * gc.c (rb_memerror): raise nomem_error without backtrace if failed to
- make backtrace.
-
-Sat Jun 14 22:52:35 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/stringio/stringio.c (strio_sysread): should not raise at empty
- read. a patch from Arthur Schreiber at [ruby-core:17245].
+ * intern.h: ditto.
-Sat Jun 14 16:55:46 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Jun 17 15:09:46 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* file.c (file_expand_path): no need to expand root path which has no
short file name. [ruby-dev:35095]
-Sat Jun 14 11:59:17 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * gc.h (STACK_UPPER): moved from gc.c
-
- * thread.c, thread_{pthread,win32}.c (ruby_init_stack,
- ruby_thread_init_stack): moved stack initialization from gc.c.
-
-Sat Jun 14 11:57:53 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * gc.h (STACK_UPPER): moved from gc.c
-
- * thread.c, thread_{pthread,win32}.c (ruby_init_stack,
- ruby_thread_init_stack): moved stack initialization from gc.c.
-
-Sat Jun 14 07:52:53 2008 Tanaka Akira <akr@fsij.org>
-
- * gc.c (ruby_initial_gc_stress): defined.
- (ruby_initial_gc_stress_ptr): defined.
-
- * debug.c (set_debug_option): use ruby_initial_gc_stress_ptr for
- gc_stress option.
-
-Sat Jun 14 00:09:19 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * gc.c (ruby_gc_stress): moved to rb_objspace_t.
-
- * gc.c (gc_stress_get, gc_stress_set): VM local attribute.
-
- * signal.c (sigsegv): ditto.
-
-Fri Jun 13 21:55:48 2008 Tadayoshi Funaba <tadf@dotrb.org>
-
- * rational.c (nurat_equal_p): Rational(0,x) and 0 are equivalent,
- anyway.
-
-Fri Jun 13 21:26:39 2008 Tadayoshi Funaba <tadf@dotrb.org>
-
- * complex.c (string_to_c, nucomp_s_convert): preserve the current
- backref.
-
- * rational.c (string_to_r, nurat_s_convert): ditto.
-
- * include/ruby/intern.h (rb_match_busy): added a declaration.
-
-Fri Jun 13 18:08:10 2008 Tanaka Akira <akr@fsij.org>
-
- * lib/time.rb (Time.xmlschema): don't accept decimal dot without
- fractional digits. fractional digits handling simplified.
-
-Fri Jun 13 17:20:40 2008 wanabe <s.wanabe@gmail.com>
-
- * complex.c (string_to_c_internal): save and restore backref.
- fixed [ruby-dev:34991]
-
-Fri Jun 13 17:06:20 2008 wanabe <s.wanabe@gmail.com>
-
- * rational.c (string_to_r_internal): save and restore backref.
- fixed [ruby-dev:34990]
-
-Fri Jun 13 14:41:26 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * README.EXT.ja: update about Fixnum. reported in
- <http://www.tmtm.org/ja/tdiary/?date=20080611#p01>
-
- * README.EXT.ja: describe about StringValueCStr().
-
- * README.EXT: ditto.
-
-Fri Jun 13 14:24:37 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * gc.c (rb_memerror): exit with EXIT_FAILURE instead of magic number.
-
- * gc.c (ruby_stack_check): STACK_LENGTH should be less than
- STACK_LEVEL_MAX.
-
-Fri Jun 13 12:55:37 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * enum.c (sort_by_i): use NODE_DOT2 instead of NODE_MEMO to avoid
- extra calls to is_pointer_to_heap() in GC.
-
- * enum.c (enum_zip): ditto.
-
-Fri Jun 13 00:41:58 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * test/ruby/test_thread.rb: add a test.
-
-Thu Jun 12 23:30:11 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * thread.c (mutex_unlock): fix cond_notified consistency.
-
-Thu Jun 12 22:19:45 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * thread_win32.c (native_sleep): fixed previous commit.
-
-Thu Jun 12 21:59:17 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * thread.c, vm_core.h, vm.c, thread_pthread.c, thread_win32.c: add
- deadlock detection. [ruby-dev:35044]
-
- * bootstraptest/test_thread.rb: add tests for above.
-
-Thu Jun 12 21:39:55 2008 Tadayoshi Funaba <tadf@dotrb.org>
-
- * complex.c: refactoring.
-
- * rational.c: ditto.
-
-Thu Jun 12 17:11:24 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * regint.h: undefine USE_CAPTURE_HISTORY which is mentioned as
- unsupported in the Onigiruma document.
-
-Thu Jun 12 13:36:54 2008 Tanaka Akira <akr@fsij.org>
-
- * include/ruby/ruby.h (rb_intern): use rb_intern2 with strlen for
- constant symbols to optimize strlen.
-
-Thu Jun 12 08:47:51 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * io.c (read_all): should use io_read_encoding(), not
- io_input_encoding().
-
- * io.c (rb_io_getline_1): reduce calling of io_read_encoding().
-
- * string.c (rb_str_scan): need not to restore $~ value, so avoid
- pinning match object.
-
-Thu Jun 12 02:49:40 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * ext/stringio/stringio.c (strio_init): rewind when reopened.
-
-Thu Jun 12 02:43:27 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * array.c (rb_ary_zip): ANSI style.
-
-Thu Jun 12 02:25:54 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * io.c (rb_io_reopen): clear read buffer.
-
-Thu Jun 12 00:56:20 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/tk: check proper conditions. [ruby-dev:35047]
-
-Wed Jun 11 23:33:13 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * io.c (io_fread): bypass buffered read if reading buffer is empty.
-
- * io.c (remain_size): do not add extra one byte.
-
-Wed Jun 11 12:15:17 2008 Tanaka Akira <akr@fsij.org>
-
- * bootstraptest/runner.rb (assert_normal_exit): hide stderr output
- when success.
-
-Wed Jun 11 09:26:43 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * common.mk (encs): need to pass miniruby path for windows.
-
-Wed Jun 11 05:53:20 2008 Koichi Sasada <ko1@atdot.net>
-
- * vm.c, eval_intern.h (PASS_PASSED_BLOCK):
- set a VM_FRAME_FLAG_PASSED flag to skip this frame when
- searching ruby-level-cfp.
-
- * eval.c, eval_intern.h, proc.c: fix to check cfp. if there is
- no valid ruby-level-cfp, cause RuntimeError exception.
- [ruby-dev:34128]
-
- * vm_core.h, vm_evalbody.c, vm.c, vm_dump.c, vm_insnhelper.c,
- insns.def: rename FRAME_MAGIC_* to VM_FRAME_MAGIC_*.
-
- * KNOWNBUGS.rb, bootstraptest/test*.rb: move solved bugs.
-
-Wed Jun 11 05:55:31 2008 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tk/tcltklib.c: SEGV when tcltk-stubs is enabled.
-
- * ext/tk/tcltklib.c: avoid error on a shared object.
-
- * ext/tk/extconf.rb: support --with-tcltkversion
-
- * ext/tk/README.tcltklib: add document about --with-tcltkversion
-
- * ext/tk/lib/tk.rb, ext/tk/lib/multi-tk.rb, ext/tk/lib/remote-tk.rb:
- not work on $SAFE==4
-
- * ext/tk/lib/multi-tk.rb: Object#methods returns Symbols on Ruby1.9.
-
- * ext/tk/lib/tk/timer.rb: add TkTimer#at_end(proc) to register the
- procedure which called at end of the timer.
-
- * ext/tk/lib/tk.rb, ext/tk/lib/tk/itemfont.rb, ext/tk/lib/font.rb:
- support __IGNORE_UNKNOWN_CONFIGURE_OPTION__ about font options.
-
- * ext/tk/lib/*: treat __IGNORE_UNKNOWN_CONFIGURE_OPTION__
-
- * ext/tk/lib/tkextlib/iwidgets/scrolledcanvas.rb,
- ext/tk/lib/tkextlib/iwidgets/scrolledlistbox.rb,
- ext/tk/lib/tkextlib/iwidgets/scrolledtext.rb: bug fix.
-
- * ext/tk/lib/tk/text.rb: typo. call a wrong method.
-
- * ext/tk/lib/tk/itemconfig.rb: ditto.
-
- * ext/tk/lib/tk.rb, ext/tk/lib/tk/itemconfig.rb,
- ext/tk/lib/tk/canvas.rb: support alias names of option keys.
-
- * ext/tk/lib/tk/grid.rb: lack of module-method definitions.
-
- * ext/tk/lib/tk/pack.rb, ext/tk/lib/tk/grid.rb: increase supported
- parameter patterns of configure method.
-
- * ext/tk/lib/tk.rb: add TkWindow#grid_anchor, grid_column, grid_row.
-
- * ext/tk/lib/tk/wm.rb: methods of Tk::Wm_for_General module cannot
- pass the given block to methods of Tk::Wm module.
-
- * ext/tk/lib/tk/wm.rb: Wm#overrideredirect overwrites argument to
- an invalid value.
-
- * ext/tk/lib/tk.rb: fix memory (object) leak bug.
-
- * ext/tk/tcltklib.c, ext/tk/tkutil/tkutil.c: fix memory leak.
-
- * ext/tk/sample/demos-jp/aniwave.rb, ext/tk/sample/demos-en/aniwave.rb:
- bug fix.
-
- * ext/tk/lib/tkextlib/blt/component.rb,
- ext/tk/lib/tkextlib/tile/tentry.rb,
- ext/tk/lib/tkextlib/tile/treeview.rb: ditto.
-
- * ext/tk/lib/tkextlib/tile/tpaned.rb: improve TPaned#add.
-
- * ext/tk/sample/demos-jp/widget, ext/tk/sample/demos-en/widget,
- ext/tk/sample/demos-jp/style.rb, ext/tk/sample/demos-en/style.rb,
- ext/tk/sample/demos-jp/bind.rb, ext/tk/sample/demos-en/bind.rb:
- bug fix.
-
- * ext/tk/sample/ttk_wrapper.rb: ditto.
-
- * ext/tk/sample/ttk_wrapper.rb: support "if __FILE__ == $0" idiom.
-
- * ext/tk/sample/tktextio.rb: add binding for 'Ctrl-u' at console mode.
-
- * ext/tk/lib/tkextlib/tile.rb, ext/tk/lib/tkextlib/tile/style.rb,
- ext/tk/sample/ttk_wrapper.rb: improve treating and control themes.
- add Tk::Tile.themes and Tk::Tile.set_theme(theme).
-
- * ext/tk/lib/tkextlib/tile.rb: lack of autoload definitions.
-
- * ext/tk/lib/tkextlib/tile/tnotebook.rb: cannot use kanji (not UTF-8)
- characters for headings.
-
- * ext/tk/lib/tkextlib/tkDND/shape.rb: wrong package name.
-
- * ext/tk/tkutil/tkutil.c: improve handling callback-subst-keys.
- Now, support longnam-keys (e.g. '%CTT' on tkdnd-2.0; however, still
- not support tkdnd-2.0 on tkextlib), and symbols of parameters (e.g.
- :widget=>'%W', :keycode=>'%k', '%x'=>:x, '%X'=>:root_x, and so on;
- those are attributes of event object). It means that Ruby/Tk accepts
- not only "widget.bind(ev, '%W', '%k', ...){|w, k, ...| ... }", but
- also "widget.bind(ev, :widget, :keycode, ...){|w, k, ...| ... }".
- It is potentially incompatible, when user passes symbols to the
- arguments of the callback block (the block receives the symbols as
- strings). I think that is very rare case (probably, used by Ruby/Tk
- experts only). When causes such trouble, please give strings instead
- of such symbol parameters (e.g. call Symbol#to_s method).
-
- * ext/tk/lib/tk/event.rb, ext/tk/lib/tk/validation.rb,
- ext/tk/lib/tkextlib/blt/treeview.rb,
- ext/tk/lib/tkextlib/winico/winico.rb: ditto.
-
- * ext/tk/tkutil/tkutil.c: strings are available on subst_tables on
- TkUtil::CallbackSubst class (it is useful on Ruby 1.9).
-
- * ext/tk/lib/tk/spinbox.rb, ext/tk/lib/tkextlib/iwidgets/hierarchy.rb,
- ext/tk/lib/tkextlib/iwidgets/spinner.rb,
- ext/tk/lib/tkextlib/iwidgets/entryfield.rb,
- ext/tk/lib/tkextlib/iwidgets/calendar.rb,
- ext/tk/lib/tkextlib/blt/dragdrop.rb,
- ext/tk/lib/tkextlib/tkDND/tkdnd.rb,
- ext/tk/lib/tkextlib/treectrl/tktreectrl.rb,
- ext/tk/lib/tkextlib/tktable/tktable.rb: disable code piece became
- unnecessary by reason of the changes of ext/tk/tkutil/tkutil.c.
-
- * ext/tk/lib/tk.rb, ext/tk/lib/multi-tk.rb: change strategy to define
- the constant WITH_ENCODING.
-
- * ext/tk/lib/tk.rb: fix bug on Tk::Encoding.tk_encoding_names.
-
-Wed Jun 11 03:40:37 2008 Akinori MUSHA <knu@iDaemons.org>
-
- * lib/find.rb (Find#find): Return an enumerator if no block is
- given.
-
-Wed Jun 11 01:28:12 2008 Koichi Sasada <ko1@atdot.net>
-
- * include/ruby/intern.h, proc.c: revert rb_proc_call() and
- create rb_proc_call_with_block() instead.
-
- * include/ruby/ruby.h, eval_jump.c, thread.c, vm_insnhelper.c:
- rb_blockptr should not be exposed.
-
-Tue Jun 10 21:07:19 2008 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-
- * test/ruby/test_float.rb: add tests. [ruby-dev:35009]
-
-Tue Jun 10 20:55:57 2008 Tadayoshi Funaba <tadf@dotrb.org>
-
- * complex.c (nucomp_s_convert): need not to initialize optional
- argument for rb_scan_args().
-
-Tue Jun 10 20:13:56 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/extmk.rb: negate default of --without-ext if --with-ext is
- given.
-
- * ext/extmk.rb: negate default of --without-ext.
-
-Tue Jun 10 17:43:35 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * array.c (rb_ary_shuffle_bang): update RDoc. [ruby-dev:35034]
-
-Tue Jun 10 17:30:19 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * include/ruby/intern.h (rb_obj_instance_exec, rb_mod_module_exec):
- added prototypes.
-
-Tue Jun 10 17:00:29 2008 wanabe <s.wanabe@gmail.com>
-
- * util.c (ruby_strtod): ruby_strtod don't allow a trailing
- decimal point like "7.". [ruby-dev:34835] [ruby-dev:35009]
-
-Tue Jun 10 13:48:38 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * rational.c (nurat_s_convert): need not to initialize optional
- argument for rb_scan_args().
-
-Tue Jun 10 12:58:07 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/io/wait/wait.c (FIONREAD_POSSIBLE_P): suppress warnings.
-
-Tue Jun 10 12:43:19 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * include/ruby/ruby.h (CONST_ID_CACHE): fixed statement expression.
-
-Tue Jun 10 11:25:15 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ruby.c (rb_argv0): revised for ext/tk.
-
- * include/ruby/encoding.h: not to use varargs.h since requiring C89.
-
-Tue Jun 10 00:50:51 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * include/ruby/ruby.h, vm_core.h: add a type rb_blockptr.
-
- * vm_insnhelper.c (vm_yield_with_cfunc): vm_yield_with_cfunc receives
- blockptr and passes it to iterating block.
-
- * proc.c (rb_proc_call), include/ruby/intern.h: rb_proc_call receives
- blockptr. "rb_proc_call(self, args, blockptr)" in C corresponds to
- "self.call(*args, &block)" in Ruby.
-
- * proc.c (proc_call): pass blockptr to block that is written in C.
-
- * proc.c (curry): receive blockptr and pass it to original proc.
- [ruby-core:15551]
-
- * vm.c (invoke_block_from_c): fix for change of vm_yield_with_cfunc.
-
- * thread.c (call_trace_proc), eval_jump.c (rb_call_end_proc): fix for
- change of rb_proc_call.
-
-Tue Jun 10 00:10:49 2008 Tanaka Akira <akr@fsij.org>
-
- * common.mk (test-knownbug): give $(OPTS) for bootstraptest/runner.rb.
-
-Mon Jun 9 23:10:50 2008 Tanaka Akira <akr@fsij.org>
-
- * eval.c (Init_stack): don't declare. it is a macro now.
-
-Mon Jun 9 22:46:47 2008 wanabe <s.wanabe@gmail.com>
-
- * compile.c : treat []&&= in virtually the same way as []||=.
- [ruby-dev:34679]
-
-Mon Jun 9 21:17:26 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * enc/depend (clean): remove build directories.
-
- * test_knownbug.rb -> KNOWNBUGS.rb: renamed.
-
- * common.mk: apply above change.
-
-Mon Jun 9 21:14:26 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/mkmf.rb (configuration): set flags.
-
-Mon Jun 9 21:09:02 2008 Koichi Sasada <ko1@atdot.net>
-
- * bootstraptest/test_knownbug.rb -> ./test_knownbug.rb: moved.
-
- * common.mk: add a rule "test-knownbug".
-
-Mon Jun 9 21:00:32 2008 Tadayoshi Funaba <tadf@dotrb.org>
+Sun Jun 15 19:27:40 2008 Akinori MUSHA <knu@iDaemons.org>
- * complex.c (nucomp_s_convert): can accept Complex('i').
- [ruby-dev:34991]
-
-Mon Jun 9 18:25:30 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * include/ruby/ruby.h (CONST_ID): constant ID cache for non-gcc.
-
- * *.c: no cache in init functions.
+ * configure.in: Fix $LOAD_PATH. Properly expand vendor_ruby
+ directories; submitted by Takahiro Kambe <taca at
+ back-street.net> in [ruby-dev:35099].
Mon Jun 9 17:56:30 2008 Akinori MUSHA <knu@iDaemons.org>
@@ -22043,138 +858,35 @@ Mon Jun 9 17:56:30 2008 Akinori MUSHA <knu@iDaemons.org>
(TC_SortedSet#test_sortedset): Return self; [ruby-dev:35002] by
Arthur Schreiber.
-Mon Jun 9 17:47:09 2008 Tanaka Akira <akr@fsij.org>
-
- * io.c (fptr_finalize): close IO object if fd is already closed.
- (rb_p): call rb_io_write just once.
-
-Mon Jun 9 15:37:38 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * ruby.c (require_libraries): req_list may be NULL. [ruby-dev:35008]
-
-Mon Jun 9 14:18:01 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * vm_core.h (struct rb_vm_struct): moved src_encoding_index,
- ruby_debug, ruby_verbose, and rb_progname.
-
- * ruby.c (rb_argv0): no longer used.
-
- * ruby.c (struct cmdline_options): moved setids and req_list, and the
- latter is now an array, to prevent memory leak.
-
- * ruby.c (cmdline_options_init): added.
-
- * ruby.c (add_modules, require_libraries, init_ids, forbid_setid): use
- struct cmdline_options.
-
- * vm.c (vm_init2): initialize src_encoding_index.
-
- * vm.c: getters/setters for ruby_{debug,verbose}.
-
-Mon Jun 9 09:54:13 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * include/ruby/intern.h (Init_stack): make to call ruby_init_stack.
-
-Mon Jun 9 08:12:40 2008 wanabe <s.wanabe@gmail.com>
-
- * vm_insnhelper.c, vm.c, proc.c : revert r17021. [ruby-dev:34997]
-
-Mon Jun 9 03:12:23 2008 Koichi Sasada <ko1@atdot.net>
-
- * bootstraptest/pending.rb: move/remove solved issues.
-
- * bootstraptest/test_class.rb: ditto.
+Mon Jun 9 03:28:05 2008 Akinori MUSHA <knu@iDaemons.org>
-Mon Jun 9 02:32:58 2008 Akinori MUSHA <knu@iDaemons.org>
-
- * ext/zlib/zlib.c (rb_deflate_init_copy): Copy buffers as well.
- [ruby-list:45018]
-
-Sun Jun 8 22:22:20 2008 wanabe <s.wanabe@gmail.com>
-
- * vm_insnhelper.c, vm.c, proc.c (proc_call): allow call method with
- block that both is written in C. [ruby-dev:34273] [ruby-core:15551]
-
- * proc.c (curry): use proc_call instead of rb_proc_call.
- [ruby-dev:34273] [ruby-core:15551]
-
-Sun Jun 8 21:50:27 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * test/zlib/test_zlib.rb: add tests to achieve over 90% test coverage
- of zlib.
-
-Sun Jun 8 20:12:47 2008 wanabe <s.wanabe@gmail.com>
-
- * vm_insnhelper.c (vm_throw): regard break as return in lambda.
- [ruby-dev:34646]
-
-Sun Jun 8 19:17:59 2008 Koichi Sasada <ko1@atdot.net>
-
- * gc.c: add a build option "CALC_EXACT_MALLOC_SIZE".
- This option enables to calculate exact size of current
- allocated size by malloc(). You can access these information
- with GC.malloc_allocated_size and GC.malloc_allocations.
- This option consume additional memory as a header of each memory
- object. This option also helps to find out xmalloc()/xfree()
- consistency. If you get trouble with this option, some extension
- using "free()" instead of "xfree()".
- This options is disabled by default.
-
-Sun Jun 8 18:15:38 2008 Koichi Sasada <ko1@atdot.net>
+ * ext/zlib/zlib.c (rb_deflate_initialize, Init_zlib): Fix up
+ initialize_copy; [ruby-list:45016], [ruby-list:45018].
- * array.c, bignum.c, cont.c, dir.c, dln.c, encoding.c, enumerator.c,
- enumerator.c (enumerator_allocate), eval_jump.c, file.c, hash.c,
- io.c, load.c, pack.c, proc.c, random.c, re.c, ruby.c, st.c,
- string.c, thread.c, thread_pthread.c, time.c, util.c, variable.c,
- vm.c, gc.c:
- allocated memory objects by xmalloc (ruby_xmalloc) should be
- freed by xfree (ruby_xfree).
+Mon Jun 9 03:26:03 2008 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
- * ext/curses/curses.c, ext/dbm/dbm.c, ext/digest/digest.c,
- ext/gdbm/gdbm.c, ext/json/ext/parser/parser.c,
- ext/json/ext/parser/unicode.c, ext/openssl/ossl_cipher.c,
- ext/openssl/ossl_hmac.c, ext/openssl/ossl_pkey_ec.c,
- ext/sdbm/init.c, ext/strscan/strscan.c, ext/zlib/zlib.c:
- ditto.
+ * NEWS: Mention new constants.
-Sun Jun 8 01:15:11 2008 Tanaka Akira <akr@fsij.org>
+Mon Jun 9 03:24:18 2008 Tanaka Akira <akr@fsij.org>
* hash.c (hash_i): make Hash#hash order insensitive.
- (rb_hash_dup): use DUPSETUP.
-
-Sat Jun 7 23:47:35 2008 Akinori MUSHA <knu@iDaemons.org>
-
- * ext/zlib/zlib.c (rb_deflate_initialize, Init_zlib): Fix up
- initialize_copy; [ruby-list:45016].
-Sat Jun 7 22:15:02 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Jun 9 03:22:43 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* configure.in (VENDOR_DIR): use LIBDIR instead of PREFIX as well as
SITE_DIR. a patch from Richard Brown <rbrown AT exherbo.org> in
[ruby-core:17129].
-Sat Jun 7 21:37:58 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Jun 9 03:21:20 2008 Tanaka Akira <akr@fsij.org>
- * io.c (rb_f_open), re.c (rb_reg_search), transcode.c (str_transcode):
- suppress warnings.
+ * gc.c (os_obj_of): assure to not free the scanning heap.
- * util.c (quorem, rv_alloc, nrv_alloc): only used in dtoa().
-
-Sat Jun 7 16:06:14 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in (CFLAGS, CXXFLAGS): append default flags.
-
-Sat Jun 7 01:23:59 2008 NAKAMURA Usaku <usa@ruby-lang.org>
+Mon Jun 9 03:20:12 2008 NAKAMURA Usaku <usa@ruby-lang.org>
* io.c (rb_open_file, rb_io_s_sysopen): fmode should be unsigned int.
fixed [ruby-dev:34979]
-Fri Jun 6 23:46:19 2008 Koichi Sasada <ko1@atdot.net>
-
- * vm_insnhelper.c (vm_callee_setup_arg): check simple flag before
- calling setup_arg function(). this change reduce function call.
-
-Fri Jun 6 21:51:46 2008 NAKAMURA Usaku <usa@ruby-lang.org>
+Fri Jun 6 21:16:55 2008 NAKAMURA Usaku <usa@ruby-lang.org>
* win32/Makefile.sub (COMMON_HEADERS): include ws2tcpip.h.
@@ -22182,70 +894,43 @@ Fri Jun 6 21:51:46 2008 NAKAMURA Usaku <usa@ruby-lang.org>
freehostent, freeaddrinfo): undef before define because these are
macros in some versions of Windows SDK.
- merged from ruby_1_8.
+ * win32/setup.mak: maybe commit miss.
-Fri Jun 6 18:25:43 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * test/iconv/utils.rb (default_test): override not to croak.
-
-Fri Jun 6 16:41:45 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * include/ruby/win32.h: include ws2tcpip.h. fixed [ruby-Bugs-20528]
-
-Fri Jun 6 15:05:02 2008 Tanaka Akira <akr@fsij.org>
-
- * gc.c (count_objects): clear hash after counting objects.
+Fri Jun 6 19:34:22 2008 Akinori MUSHA <knu@iDaemons.org>
-Fri Jun 6 12:43:41 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * test/ruby/test_dir.rb (TestDir::test_glob): glob file names not sorted.
-
-Fri Jun 6 00:05:33 2008 Tanaka Akira <akr@fsij.org>
-
- * lib/time.rb (Time.xmlschema): don't use float. fix
- http://rubyforge.org/tracker/index.php?func=detail&group_id=426&atid=1698&aid=20504
-
-Thu Jun 5 23:56:18 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * test/ruby/test_gc.rb: add tests to achieve over 90% test coverage of
- gc.c.
-
- * test/ruby/test_objectspace.rb: ditto.
-
- * test/ruby/test_marshal.rb: ditto.
-
-Thu Jun 5 23:40:08 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * gc.c (rb_objspace_alloc): this function is needed only when
- ENABLE_VM_OBJSPACE macro is defined.
+ * mkconfig.rb: hide build path from rbconfig.rb.
- * vm.c: ditto.
+ * util.c (ruby_strtod, dtoa): initialize more variables for error
+ handling.
-Thu Jun 5 23:31:21 2008 Yusuke Endoh <mame@tsg.ne.jp>
+ * io.c (rscheck), marshal.c (w_nbyte, w_bytes, w_unique),
+ (path2class, path2module): constified.
- * test/stringio/test_stringio.rb: add tests to achieve over 95% test
- coverage of stringio.
+ * pack.c (pack_unpack), process.c (rb_syswait): suppress warnings.
- * test/strscan/test_stringscanner.rb: ditto for strscan.
+ * suppress warnings on cygwin, mingw and mswin.
-Thu Jun 5 23:25:34 2008 Yusuke Endoh <mame@tsg.ne.jp>
+Fri Jun 6 19:23:53 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * eval.c (ruby_finalize_0): clear trace_func after executing END
- procs.
+ * file.c (file_expand_path): fix for non-existent files and SFN of
+ symlinks. [ruby-talk:303736]
- * thread.c: fix typo.
+Fri Jun 6 18:25:43 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Jun 5 22:50:50 2008 Tanaka Akira <akr@fsij.org>
+ * test/iconv: Tests fixed.
- * gc.c (os_obj_of): heaps may be modified in yield.
+Fri Jun 6 17:04:56 2008 Akinori MUSHA <knu@iDaemons.org>
-Thu Jun 5 21:46:50 2008 Yusuke Endoh <mame@tsg.ne.jp>
+ * win32/win32.h: include ws2tcpip.h. fixed [ruby-Bugs-20528]
- * st.c (st_reverse_foreach): comment out unused function.
+ * lib/time.rb (Time.xmlschema): don't use float. fix
+ http://rubyforge.org/tracker/index.php?func=detail&group_id=426&atid=1698&aid=20504
- * util.c (dtoa): ditto.
+ * object.c (rb_obj_alloc): RDoc updated. a patch from Gaston
+ Ramos <ramos.gaston at gmail.com> in [ruby-core:17073].
-Thu Jun 5 20:30:46 2008 Akinori MUSHA <knu@iDaemons.org>
+ * lib/rdoc.rb: massive spelling correction patch from Evan Farrar
+ <evanfarrar at gmail.com> in [ruby-doc:1382] applied.
* ext/openssl/ossl_ssl_session.c (ossl_ssl_session_initialize):
Add a null check for ssl; submitted by akira yamada
@@ -22259,127 +944,24 @@ Thu Jun 5 20:30:46 2008 Akinori MUSHA <knu@iDaemons.org>
workaround for the case where OpenSSL is configured with
--enable-tlsext; submitted by akira yamada in [ruby-dev:34944].
-Thu Jun 5 20:24:15 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * thread.c (thread_set_trace_func_m): fix check for proc argument.
-
-Thu Jun 5 20:17:29 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * lib/rexml/document.rb (REXML::Document:write): leaky modification
- trans -> transitive. [ruby-dev:32040], r13686
-
- * lib/rexml/text.rb (Text.check): fix check for illegal character.
-
-Thu Jun 5 14:03:44 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/iconv/iconv.c (iconv_create): find encoding without options.
-
-Thu Jun 5 07:48:32 2008 Koichi Sasada <ko1@atdot.net>
-
- * string.c (hash): should be "static".
-
-Thu Jun 5 01:47:18 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * test/ruby/test_transcode.rb: add tests for iso-2022-jp.
-
-Thu Jun 5 01:27:42 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * test/ruby/test_process.rb: add tests.
-
-Wed Jun 4 23:10:08 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * ext/zlib/zlib.c (rb_gzfile_set_mtime): fix typo.
-
-Wed Jun 4 18:53:39 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * object.c (rb_obj_alloc): RDoc updated. a patch from Gaston
- Ramos <ramos.gaston at gmail.com> in [ruby-core:17073].
-
-Wed Jun 4 18:36:11 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/rdoc.rb: massive spelling correction patch from Evan Farrar
- <evanfarrar at gmail.com> in [ruby-doc:1382] applied.
-
-Wed Jun 4 17:52:18 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Jun 6 16:58:23 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ext/iconv/iconv.c (iconv_iconv): fix for length argument and now
- allows range. [ruby-core:17092]
-
-Wed Jun 4 15:45:41 2008 Akinori MUSHA <knu@iDaemons.org>
-
- * enumerator.c (enumerator_with_index, enumerator_with_memo): Fix
- grammo in rdoc.
-
-Wed Jun 4 13:06:58 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in (CFLAGS, CXXFLAGS): include additional flags to
- CFLAGS and CXXFLAGS while configuration.
-
-Tue Jun 3 23:06:35 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * ext/strscan/strscan.c (strscan_scan_full, strscan_search_full): fix
- document.
-
-Tue Jun 3 22:37:26 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * ext/strscan/strscan.c (strscan_exist_p): fix document.
-
-Tue Jun 3 22:33:29 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * test/ruby/test_dir.rb: add tests to achieve over 90% test coverage
- of dir.c.
+ allows range. [ruby-core:17092] [ruby-core:17115]
- * test/ruby/test_encoding.rb: add tests for dummy?, name_list and
- aliases.
+Wed Jun 4 17:22:30 2008 Akinori MUSHA <knu@iDaemons.org>
- * test/ruby/test_marshal.rb: add some tests.
-
-Tue Jun 3 22:25:51 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * test/etc/test_etc.rb: new tests for etc.
-
-Tue Jun 3 19:35:02 2008 Akinori MUSHA <knu@iDaemons.org>
-
- * enumerator.c (enumerator_with_memo): New method: with_memo().
-
-Tue Jun 3 20:04:03 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * win32/Makefile.sub (miniruby$(EXEEXT)): miniruby cannot be
- written by miniruby itself.
+ * NEWS: Fix typos and move misplaced entries.
+ NEWS: Somehow optflags and warnflags were not actually included
+ in this release.
Tue Jun 3 19:33:22 2008 Akinori MUSHA <knu@iDaemons.org>
* enumerator.c (enumerator_init_copy): Take care of
initialize_copy as well as initialize.
-Tue Jun 3 16:06:09 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * file.c (file_expand_path): fix for non-existent files and SFN of
- symlinks. [ruby-talk:303736]
-
-Tue Jun 3 15:12:01 2008 Akinori MUSHA <knu@iDaemons.org>
-
- * lib/set.rb (Set#classify): Back out the `group_by' alias.
- Better think twice.
-
-Tue Jun 3 15:00:22 2008 Akinori MUSHA <knu@iDaemons.org>
-
- * lib/set.rb (Set#collect, Set#select): Back out. I thought it
- was consistent but turned out to be wrong.
-
-Tue Jun 3 13:41:08 2008 Akinori MUSHA <knu@iDaemons.org>
-
- * lib/set.rb (Set#collect, Set#select): Override Enumerable
- methods and make them return a set. [ruby-core:17055]
- (Set#delete_if, Set#collect!, Set#reject!, Set#classify)
- (Set#divide, Set#delete_if): Return an enumerator if no block is
- given.
- (Set#classify): Define an alias `group_by' to override that of
- Enumerable.
-
-Tue Jun 3 13:35:40 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * process.c (run_exec_pgroup): C99 ism.
+ * test/ruby/test_enumerator.rb: Pull in the test suite for
+ enumerator from trunk.
Tue Jun 3 12:51:57 2008 Akinori MUSHA <knu@iDaemons.org>
@@ -22388,232 +970,65 @@ Tue Jun 3 12:51:57 2008 Akinori MUSHA <knu@iDaemons.org>
appropriate.
(enumerator_initialize): Fix a typo in rdoc. [ruby-core:17052]
-Tue Jun 3 01:21:51 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * test/ruby/test_method.rb: add a test.
-
-Tue Jun 3 00:26:48 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * marshal.c (w_object): add a check for modification of array during
- its dump.
-
-Mon Jun 2 22:27:57 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * enc/iso_8859_5.c: Large omicron should lowercase to small omicron.
-
- * test/ruby/test_big5.rb, test/ruby/test_cp949.rb,
- test/ruby/test_euc_jp.rb, test/ruby/test_euc_kr.rb,
- test/ruby/test_euc_tw.rb, test/ruby/test_gb18030.rb,
- test/ruby/test_gbk.rb, test/ruby/test_iso_8859.rb,
- test/ruby/test_koi8.rb, test/ruby/test_shift_jis.rb,
- test/ruby/test_windows_1251.rb: new tests for encoding.
-
- * test/ruby/test_utf16.rb, test/ruby/test_utf32.rb,
- test/ruby/test_regexp.rb: add tests.
-
-Mon Jun 2 21:56:47 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * test/ruby/test_file.rb: add tests for uninitialized object.
-
- * test/ruby/test_class.rb: ditto.
-
- * test/ruby/test_thread.rb: ditto.
-
-Mon Jun 2 21:44:15 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * re.c: fix SEGV by Regexp.allocate.names, Match.allocate.names, etc.
-
- * test/ruby/test_regexp.rb: add tests for above.
-
- * io.c: fix SEGV by IO.allocate.print, etc.
-
- * test/ruby/test_io.rb: add tests for above.
-
-Mon Jun 2 19:17:47 2008 Tanaka Akira <akr@fsij.org>
-
- * test/ruby/test_argf.rb (teardown): remove renamed temporary files.
-
-Mon Jun 2 18:51:15 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/un.rb (wait_writable): wait until target files can be
- written actually.
-
- * win32/Makefile.sub (LDSHARED_0, LINK_SO): get rid of failure of
- mt.exe.
-
-Mon Jun 2 16:26:17 2008 Akinori MUSHA <knu@iDaemons.org>
-
- * lib/delegate.rb (Delegator::MethodDelegation#respond_to):
- respond_to? should now take optional second argument; submitted
- by Jeremy Kemper <jeremy at bitsweat.net> in [ruby-core:17045].
-
-Mon Jun 2 16:14:18 2008 Akinori MUSHA <knu@iDaemons.org>
-
- * lib/erb.rb (ERB::Compiler::TrimScanner#scan_line): Oops. This
- change did not apply to trunk. Backed out.
-
-Mon Jun 2 16:08:24 2008 Akinori MUSHA <knu@iDaemons.org>
+Tue Jun 3 10:16:40 2008 Akinori MUSHA <knu@iDaemons.org>
* lib/erb.rb (ERB::Compiler::TrimScanner#scan_line): Fix a bug
- where tokens are not yielded one by one.
+ where tokens are not yilelded one by one.
+ (ERB::Compiler::TrimScanner#explicit_trim_line): Fix without-
+ strscan problems. [ruby_core:17028].
* test/erb/test_erb.rb (TestERBCore#_test_01)
(TestERBCore#test_02_safe_04): The expected value should come
first for assert_equal().
+ (TestERBCoreWOStrScan): Add test class for without-strscan.
-Mon Jun 2 13:06:38 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * mkconfig.rb: hide build path from rbconfig.rb.
-
-Mon Jun 2 08:46:52 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * util.c (ruby_strtod, dtoa): initialize more variables for error
- handling.
-
-Mon Jun 2 04:55:05 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * suppress warnings on cygwin, mingw and mswin.
-
-Mon Jun 2 04:35:32 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * enc/gb18030.c (gb18030_code_to_mbc): add 0x80000000
- for 4bytes character.
-
-Mon Jun 2 03:52:04 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ruby.c (set_arg0): reverted used variable definition.
-
-Mon Jun 2 03:23:25 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * enc/gb18030.c (gb18030_mbc_to_code): mask by 0x7FFFFFFF
- because OnigCodePoint will be used as 32bit signed int.
- Masking by 0x7FFFFFFF is ok on GB18030;
- Minimum 4bytes character is 0x81308130.
-
-Sun Jun 1 22:29:35 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * rational.c (string_to_r_internal): use rb_isdigit.
-
- * marshal.c (long_toobig): use %zd.
+Mon Jun 2 19:47:16 2008 Akinori MUSHA <knu@iDaemons.org>
- * ruby.c (set_arg0): move unused variable definition.
+ * lib/delegate.rb (DelegateClass, Delegator#respond_to?):
+ respond_to? must take optional second argument. This was a
+ latent bug exposed by a recent internal change of marshal.c to
+ call respond_to? with a second argument; submitted by Jeremy
+ Kemper <jeremy at bitsweat.net> in [ruby-core:17045].
-Sun Jun 1 12:18:12 2008 NARUSE, Yui <naruse@ruby-lang.org>
+Sat May 31 23:53:35 2008 Akinori MUSHA <knu@iDaemons.org>
- * insns.def (DEFINE_INSN): subtract of pointers is ptrdiff_t.
- this is not int on 64bit system.
-
- * vm_dump.c (control_frame_dump): ditto.
-
- * vm_dump.c (stack_dump_each): ditto.
-
- * vm_dump.c (debug_print_register): ditto.
-
- * vm_dump.c (debug_print_pre): ditto.
-
- * transcode.c (str_transcode): ditto.
-
-Sun Jun 1 10:32:18 2008 Tanaka Akira <akr@fsij.org>
-
- * test/ruby/envutil.rb (assert_normal_exit): show coredump status.
+ * .: Release as Ruby 1.8.7.
Sat May 31 23:33:34 2008 Akinori MUSHA <knu@iDaemons.org>
* README, README.ja: Add a note about default C flags.
-Sat May 31 23:02:00 2008 Tanaka Akira <akr@fsij.org>
-
- * gc.c (count_objects): clear given hash.
+Sat May 31 22:11:15 2008 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-Sat May 31 20:28:10 2008 Yusuke Endoh <mame@tsg.ne.jp>
+ * version.c (ruby_description, ruby_copyright): backported from
+ 1.9. bug#19002, [ruby-dev:34883]
- * test/ruby/test_regexp.rb: add tests.
+ * error.c (report_bug): uses ruby_description.
-Sat May 31 19:11:39 2008 NARUSE, Yui <naruse@ruby-lang.org>
+Sat May 31 20:56:04 2008 Akinori MUSHA <knu@iDaemons.org>
- * enc/utf_16{be,le}.c (utf16{be,le}_code_to_mbc):
- fix codepoint to bytes.
+ * array.c (rb_ary_delete_if): should return enumerator if no block
+ is given. [ruby-dev:34901]
Sat May 31 18:28:17 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* suppress warnings with -Wwrite-string.
-Sat May 31 18:26:33 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * array.c (rb_ary_delete_if): should return enumerator if no block
- is given. [ruby-dev:34901]
-
Sat May 31 15:58:08 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* Makefile.in, configure.in (warnflags): defaulted to -Wall
-Wno-parentheses with gcc. [ruby-dev:34810]
-Sat May 31 15:17:36 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * include/ruby/mvm.h: new header file for MVM, and moved rb_vm_t and
- rb_thread_t from vm_core.h.
-
-Sat May 31 12:02:23 2008 Tanaka Akira <akr@fsij.org>
-
- * test/ruby/envutil.rb (assert_normal_exit): show pid when fail.
-
-Fri May 30 23:55:56 2008 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-
- * test/ruby/test_rubyoptions.rb: add a test of RUBY_DESCRIPTION.
-
-Fri May 30 22:47:17 2008 Yusuke Endoh <mame@tsg.ne.jp>
+Fri May 30 05:28:18 2008 NAKAMURA Usaku <usa@ruby-lang.org>
- * test/ruby/test_regexp.rb: add tests.
+ * enum.c (count_i, count_iter_i, count_all_i): add prototypes for VC.
-Fri May 30 22:40:53 2008 Yusuke Endoh <mame@tsg.ne.jp>
+Fri May 30 04:32:07 2008 Akinori MUSHA <knu@iDaemons.org>
- * test/ruby/test_signal.rb: add tests to achieve over 80% test
- coverage of signal.c.
-
-Fri May 30 22:28:03 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * signal.c (esignal_signo): fix SignalException#signo which returned
- nil absolutely.
-
- * signal.c (esignal_init): always prepend "SIG" to a string that is
- returned by SignalException#signm.
-
-Fri May 30 22:17:39 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * test/ruby/test_argf.rb: rename a conflicting method name.
-
- * test/ruby/test_string.rb: ditto.
-
- * test/ruby/test_io.rb: ditto.
-
-Fri May 30 22:14:37 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * compile.c (defined_expr): fix SEGV by defined?([1]).
-
-Fri May 30 12:18:43 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * common.mk (prelude.c): simply depends on PREP. [ruby-dev:34877]
-
- * enc/make_encdb.rb, enc/trans/make_transdb.rb: ditto.
-
-Fri May 30 10:55:42 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * vm_core.h (struct rb_unblock_callback), thread.c
- (set_unblock_function), thread_{pthread,win32}.c (native_sleep):
- extracted from struct rb_thread_struct.
-
- * thread.c (reset_unblock_function): not check interrupts at leaving
- blocking region. [ruby-dev:34874]
-
-Fri May 30 06:09:31 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * enc/utf_8.c: add UTF8-MAC (UTF-8-MAC).
-
-Fri May 30 04:17:13 2008 Akinori MUSHA <knu@iDaemons.org>
-
- * enum.c (enum_count, count_all_i, Init_Enumerable),
- array.c (rb_ary_count): If no argument or block is given, count
- the number of all elements.
+ * enum.c (count_i, count_iter_i): Sync with trunk.
+ enum.c (enum_count, count_all_i, Init_Enumerable),
+ array.c (rb_ary_count): Sync with trunk. If no argument or
+ block is given, count the number of all elements.
Fri May 30 03:12:18 2008 Akinori MUSHA <knu@iDaemons.org>
@@ -22632,64 +1047,33 @@ Fri May 30 02:35:00 2008 Akinori MUSHA <knu@iDaemons.org>
use FIX2INT() without checking the value type. Use NUM2INT()
instead; found by akr in [ruby-dev:34890].
-Fri May 30 02:08:20 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * signal.c (esignal_init): handle a non-integer argument correctly,
- allowing SignalException.new(:INT).
-
-Fri May 30 00:59:47 2008 Yusuke Endoh <mame@tsg.ne.jp>
+Thu May 29 20:07:45 2008 Akinori MUSHA <knu@iDaemons.org>
- * test/ruby/test_regexp.rb: add tests.
-
-Thu May 29 22:51:05 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * test/ruby/test_require.rb: add a test for load with wrap flag, to
- achieve 100% test coverage of eval_jump.c.
-
-Thu May 29 22:47:53 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * test/ruby/test_argf.rb: new tests for ARGF, to achieve over 85% test
- coverage of file.c.
-
- * test/ruby/test_io.rb: add tests.
-
-Thu May 29 22:41:48 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * io.c (argf_readchar): raise EOFError, synchronizing IO#readchar.
-
-Thu May 29 22:29:39 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * io.c (argf_external_encoding, argf_internal_encoding): fix SEGV by
- ARGF.external_encoding.
+ * configure.in, win32/Makefile.sub, mkconfig.rb, instruby.rb,
+ ruby.c, lib/mkmf.rb, README.EXT, README.EXT.ja: Backport the
+ vendor_ruby directory support.
Thu May 29 17:52:31 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ext/zlib/extconf.rb: search zlib1, and regard mswin32 later than VC6
as WIN32. [ruby-core:16984]
-Wed May 28 18:05:28 2008 Akinori MUSHA <knu@iDaemons.org>
-
- * array.c (rb_ary_nitems, Init_Array): Axe Array#nitems().
- cf. [ruby-dev:34676]-[ruby-dev:34713]
-
-Wed May 28 17:50:32 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed May 28 17:54:29 2008 Akinori MUSHA <knu@iDaemons.org>
- * win32/mkexports.rb (Exports#objdump, Exports#each_line): extracted.
+ * string.c (rb_str_start_with): Remove an unused variable.
+ (rb_str_upto_m): Fix a prototype.
-Wed May 28 17:41:43 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed May 28 17:48:28 2008 Akinori MUSHA <knu@iDaemons.org>
- * Makefile.in (MKPREP): appended $(RBCONFIG).
+ * range.c (range_step): Fix brokenness when a non-integer numeric
+ value is specified as step. [rubyspec]
+ (range_step): Make use of String#step internally if a string (or
+ string-alike) range is given.
- * common.mk (enc.mk, prelude.c): not depend on $(RBCONFIG) on mswin32
- to get of compiling twice each time.
+ * string.c (rb_str_upto_m, Init_String): Add an optional second
+ argument to specify if the last value should be included.
- * win32/Makefile.sub (prelude.c): not depend on $(PREP).
-
-Wed May 28 17:37:07 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/mkexports.rb (Exports::Mswin#each_export): speed up.
-
-Wed May 28 16:41:59 2008 Akinori MUSHA <knu@iDaemons.org>
+Wed May 28 16:53:39 2008 Akinori MUSHA <knu@iDaemons.org>
* array.c (rb_ary_slice_bang): Call rb_ary_modify_check() at the
beginning. [rubyspec]
@@ -22701,20 +1085,10 @@ Wed May 28 16:12:44 2008 Akinori MUSHA <knu@iDaemons.org>
present and the status code is not valid as a client
redirection. cf. RFC 3875 6.2.3, 6.2.4.
-Wed May 28 15:53:52 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * enc/trans/japanese.c (to_SHIFT_JIS_EF_infos): typo.
-
Wed May 28 15:18:16 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/singleton.rb (SingletonClassMethods): _load should be public.
-Wed May 28 13:30:43 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * enc/trans/japanese.c: add workaround for Unicode to CP932.
- U+2015->0x815C, U+2225->0x8161, U+FF0D->0x817C, U+FF3C->0x815F,
- U+FF5E->0x8160, U+FFE0->0x8191, U+FFE1->0x8192, U+FFE2->0x81CA
-
Wed May 28 12:52:41 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* marshal.c (w_object, marshal_dump, r_object0, marshal_load): search
@@ -22722,69 +1096,73 @@ Wed May 28 12:52:41 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* object.c (convert_type): ditto.
-Wed May 28 08:42:51 2008 Tanaka Akira <akr@fsij.org>
-
- * numeric.c: "%" is required before PRI?VALUE.
-
-Tue May 27 22:10:44 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval_error.c (error_handle): SystemExit and SignalException throws
- TAG_RAISE but not TAG_FATAL.
+Tue May 27 23:26:49 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
- * thread.c (rb_thread_execute_interrupts): delay interrupts during
- raising exceptions. [ruby-dev:34855]
+ * error.c (rb_bug): description from rb_bug() should include
+ patchlevel. [ruby-dev:34826]
-Tue May 27 20:18:30 2008 Akinori MUSHA <knu@iDaemons.org>
+Tue May 27 20:19:22 2008 Akinori MUSHA <knu@iDaemons.org>
* array.c (rb_ary_slice_bang): Return an empty array instead of
nil when pos is valid and len is adjusted from a valid value to
zero; caught by RubySpec.
-Tue May 27 19:12:37 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue May 27 19:45:20 2008 Akinori MUSHA <knu@iDaemons.org>
- * Makefile.in (MKPREP), common.mk, win32/Makefile.sub (prelude.c): get
- rid of depending PREP with nmake.
+ * numeric.c (flo_divmod): Revert the behavior change; do not
+ suppress an exception when div is NaN or Inf. [ruby-dev:34857]
- * common.mk (encs): depends on libruby.
+Tue May 27 19:24:40 2008 Akinori MUSHA <knu@iDaemons.org>
-Tue May 27 19:00:22 2008 Akinori MUSHA <knu@iDaemons.org>
+ * enum.c (enum_to_a): Pass arguments through to #each().
+ (enum_sort): Follow the enum_to_a signature change.
+ (enum_reverse_each): Add #reverse_each().
+
+Tue May 27 18:54:02 2008 Akinori MUSHA <knu@iDaemons.org>
* ext/stringio/stringio.c (strio_each_char, Init_stringio): Add
StringIO#{each_char,chars}.
- (Init_stringio): Fix StringIO#bytes.
-Tue May 27 17:54:35 2008 Akinori MUSHA <knu@iDaemons.org>
+Tue May 27 17:59:34 2008 Akinori MUSHA <knu@iDaemons.org>
- * ext/stringio/stringio.c (strio_each_byte): Return self instead
- of nil as the rdoc says.
+ * ext/stringio/stringio.c (strio_each): Return an enumerator if no
+ block is given.
+ (strio_each_byte): Return an enumerator if no block is given,
+ and return self if one is given as the rdoc says.
-Tue May 27 15:36:27 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * io.c (rb_io_each_byte): Fix rdoc. IO#each_byte returns self,
+ not nil.
- * numeric.c (check_int): use PRIxVALUE format specifier.
+Tue May 27 16:02:58 2008 Akinori MUSHA <knu@iDaemons.org>
- * numeric.c (check_uint, rb_num2fix, int_chr): ditto.
+ * eval.c (rb_mod_module_exec, Init_eval): Add
+ Module#{module_exec,class_exec}.
- * numeric.c (num_fdiv): fallback to_f should always return float
- result. should not use #quo that may return rational.
+Tue May 27 15:36:37 2008 Akinori MUSHA <knu@iDaemons.org>
- * numeric.c (num_div): should raise ZeroDivisionError.
+ * io.c (rb_io_each_char, argf_each_char, Init_IO):
+ Add {IO#,ARGF.}{each_char,chars}.
- * numeric.c (fix_divide): ditto.
+Tue May 27 13:46:52 2008 Akinori MUSHA <knu@iDaemons.org>
- * test/ruby/test_numeric.rb (TestNumeric::test_divmod): avoid
- ZeroDivisionError in tests.
+ * ext/stringio/stringio.c (Init_stringio): Define
+ StringIO#{getbyte,readbyte}.
-Tue May 27 13:14:53 2008 Akinori MUSHA <knu@iDaemons.org>
+Tue May 27 13:38:51 2008 Akinori MUSHA <knu@iDaemons.org>
- * enum.c (enum_to_a): Pass arguments through to #each().
- (enum_sort): Follow the enum_to_a signature change.
- (enum_reverse_each): Add #reverse_each().
+ * io.c (Init_IO): Define {IO#,ARGF.}{getbyte,readbyte}.
+
+Tue May 27 13:26:15 2008 Akinori MUSHA <knu@iDaemons.org>
-Tue May 27 13:12:37 2008 Akinori MUSHA <knu@iDaemons.org>
+ * ext/stringio/stringio.c (Init_stringio): Define #bytes and
+ #lines.
- * io.c (Init_IO): Define ARGF.{lines,bytes,chars}.
+Tue May 27 13:20:35 2008 Akinori MUSHA <knu@iDaemons.org>
-Tue May 27 12:06:37 2008 NAKAMURA Usaku <usa@ruby-lang.org>
+ * io.c: (rb_io_lines, rb_io_bytes, Init_IO): Define
+ IO#{lines,bytes} and ARGF.{lines,bytes}.
+
+Tue May 27 12:13:17 2008 NAKAMURA Usaku <usa@ruby-lang.org>
* file.c (BUFCHECK): wrong condition. [ruby-core:16921]
@@ -22796,193 +1174,167 @@ Mon May 26 18:24:48 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* file.c (file_expand_path): use BUFCHECK.
-Mon May 26 17:48:42 2008 Akinori MUSHA <knu@iDaemons.org>
-
- * enumerator.c (struct enumerator, enumerator_init)
- (enumerator_init_copy, enumerator_each): Eliminate iter.
- (enumerator_ptr): Do not hardcode the class name.
- (enumerator_with_index): Delay variable initialization after
- RETURN_ENUMERATOR().
-
-Mon May 26 17:23:49 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * file.c (file_expand_path): add more space for '/'.
-
- * file.c (file_expand_path): should reset address of p after calling
- rb_str_resize(). [ruby-dev:34800]
-
-Mon May 26 16:49:55 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * misc/ruby-mode.el (ruby-mode): use run-hooks if run-mode-hook is
- not available. a patch from Kazuhiro NISHIYAMA <zn at mbf.nifty.com>
- in [ruby-dev:34853].
-
-Mon May 26 16:41:35 2008 NAKAMURA Usaku <usa@ruby-lang.org>
+Mon May 26 16:46:19 2008 NAKAMURA Usaku <usa@ruby-lang.org>
* file.c (ntfs_tail): filename which starts with '.' is valid.
* file.c (file_expand_path): cygwin symlink support.
-Mon May 26 07:15:52 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * vm_dump.c (rb_vm_bugreport): rb_make_backtrace has no arguments.
+Mon May 26 12:16:43 2008 Akinori MUSHA <knu@iDaemons.org>
-Mon May 26 01:17:54 2008 Tanaka Akira <akr@fsij.org>
-
- * test/ruby/envutil.rb (assert_normal_exit): signal description
- refined.
+ * .: Release as Ruby 1.8.7-preview4.
-Mon May 26 00:52:52 2008 Akinori MUSHA <knu@iDaemons.org>
+Mon May 26 12:12:26 2008 Akinori MUSHA <knu@iDaemons.org>
- * hash.c (env_each_key, env_each_value, env_reject_bang)
- (rb_env_clear, env_replace): Omit duplicated secure level check.
+ * marshal.c (dump_ensure, load_ensure): should return values.
-Mon May 26 00:37:16 2008 Akinori MUSHA <knu@iDaemons.org>
+ * eval.c (yield_under, yield_under_i, yield_args_under_i)
+ (specific_eval, rb_obj_instance_exec, Init_eval): Implement
+ Object#instance_exec(), a 1.9 feature.
- * hash.c (env_each_value): Do not call env_values() twice.
+Mon May 26 11:53:21 2008 Akinori MUSHA <knu@iDaemons.org>
-Sun May 25 17:54:36 2008 Yusuke Endoh <mame@tsg.ne.jp>
+ * eval.c (rb_yield_0, proc_invoke, proc_arity): allow passing a
+ block to a Proc. [ruby-dev:23533]; by nobu; backported from
+ 1.9. This implementation in current shape is known to be
+ buggy/broken, especially with nested block invocation. Take
+ this as an experimental feature.
- * compile.c (iseq_compile): set local_table for
- ISEQ_TYPE_DEFINED_GUARD.
-
-Sun May 25 17:52:25 2008 Yusuke Endoh <mame@tsg.ne.jp>
+ * parse.y (block_par, block_var): ditto.
- * compile.c (iseq_build_body): remove side effect from
- VM::InstructionSequence.load.
+Mon May 26 08:00:52 2008 Akinori MUSHA <knu@iDaemons.org>
-Sun May 25 04:30:45 2008 Yusuke Endoh <mame@tsg.ne.jp>
+ * marshal.c (r_object0, Init_marshal): Fix the garbled s_call
+ definition; fixes [ruby-dev:34843].
- * test/ruby/test_modules.rb (remove_json_mixins): change judgment
- condition.
+Mon May 26 03:16:20 2008 Akinori MUSHA <knu@iDaemons.org>
-Sun May 25 03:54:39 2008 Yusuke Endoh <mame@tsg.ne.jp>
+ * hash.c (rb_hash_default): Fix rdoc.
+ (rb_hash_each, env_each_value, env_each_pair): Return an
+ enumerator if no block is given.
+ (rb_hash_update): Update rdoc.
+ (envix): Conditionalize the definition itself.
+ (rb_f_getenv, env_fetch, env_keys, env_values, env_values_at)
+ (env_select, env_inspect, env_to_a, env_empty_p, env_has_key)
+ (env_has_value, env_index, env_indexes, env_to_hash, env_shift)
+ (env_update): Require secure level 4.
+ (env_each_value, env_each_i): Delay variable initialization.
+ (env_each_key, env_each_value, env_reject_bang)
+ (env_clear, env_replace): Omit duplicated secure level check.
+ (env_has_value): Do to_str conversion.
+
+Sun May 25 19:48:12 2008 Akinori MUSHA <knu@iDaemons.org>
+
+ * hash.c (env_delete_if): Return an enumerator if no block is
+ given.
+ (env_each_key): Delay a variable initialization after
+ RETURN_ENUMERATOR().
- * test/ruby/test_modules.rb (test_ancestors, test_included_modules):
- ignore json mixins.
+Sun May 25 05:07:19 2008 Akinori MUSHA <knu@iDaemons.org>
-Sun May 25 02:37:25 2008 Koichi Sasada <ko1@atdot.net>
+ * array.c (rb_ary_slice_bang): Be consistent with Array#slice()
+ and String#slice!(). Just return nil when a negative length or
+ out of boundary index is given instead of raising an exception
+ via internal functions.
+ (rb_ary_slice_bang): should not use rb_ary_subseq() which shares
+ internal pointer. splice modifies the receiver right after
+ subseq. [ruby-dev:34005]
+ (rb_ary_slice_bang): should adjust length before making
+ sub-array.
- * eval_method.c: renamed from vm_method.c. "vm_method.c" is included
- by "vm.c".
+ * enumerator.c (Init_Enumerator): Override
+ Enumerable::Enumerator#each_with_index with #with_index.
- * vm_eval.c: added. Some codes are moved from "eval.c"
+Sun May 25 03:13:09 2008 Akinori MUSHA <knu@iDaemons.org>
- * common.mk: fix for above changes.
+ * eval.c (Init_Thread): Initialize recursive_key.
- * compile.c: make a vm_eval(0)
+Sun May 25 02:45:49 2008 Akinori MUSHA <knu@iDaemons.org>
- * eval.c, eval_error.c, eval_intern.h, eval_jump.c, proc.c, vm.c,
- id.c, id.h, vm_core.h, vm_dump.c, vm_evalbody.c, vm_insnhelper.c,
- blockinlining.c: fix for above changes. and do some refactoring.
- this changes improve rb_yield() performance.
+ * error.c (syserr_eqq): Use en.
Sat May 24 22:32:49 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
- * util.c (ruby_strtod): clear errno at the top of our own
- implementation of strtod(3). [ruby-dev:34834] [ruby-dev:34839]
+ * object.c (rb_cstr_to_dbl): should clear errno before calling
+ strtod(3). [ruby-dev:34834]
-Sat May 24 15:26:16 2008 Yusuke Endoh <mame@tsg.ne.jp>
+Sat May 24 22:27:44 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
- * compile.c (iseq_set_exception_table, NODE_WHILE, NODE_NEXT): remove
- special handling that decrements sp in CATCH_TYPE_NEXT for NODE_WHILE.
+ * marshal.c (marshal_load): should initialize arg.data used for
+ reentrant check. [ruby-dev:34837]
- * vm.c (vm_eval_body), vm_insnhelper.c (vm_throw): remove unused code.
+Sat May 24 00:34:59 2008 Tanaka Akira <akr@fsij.org>
-Sat May 24 08:13:34 2008 NARUSE, Yui <naruse@ruby-lang.org>
+ * lib/rational.rb (Rational#to_i): fix rdoc. Rational(-7,4).to_i
+ should be -1.
- * transcode.c (rb_str_transcode): argc is 1, and argv is &to.
+Fri May 23 20:22:44 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-Fri May 23 17:55:11 2008 Akinori MUSHA <knu@iDaemons.org>
+ * marshal.c (reentrant_check): check reentrance via callcc.
+ [ruby-dev:34802]
- * array.c (rb_ary_slice_bang): Be consistent with Array#slice()
- and String#slice!(). Just return nil when a negative length or
- out of boundary index is given instead of raising an exception
- via internal functions.
+Fri May 23 16:46:28 2008 Akinori MUSHA <knu@iDaemons.org>
-Fri May 23 16:44:34 2008 Akinori MUSHA <knu@iDaemons.org>
+ * enumerator.c (proc_call): Remove an unused static function.
- * enumerator.c (Init_Enumerator): Override
- Enumerable::Enumerator#each_with_index with #with_index.
+Fri May 23 13:46:09 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in (cflags): commit miss.
-Fri May 23 12:23:05 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri May 23 09:52:21 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * vm_core.h (rb_num_t): moved form vm.h.
+ * configure.in (MINIRUBY), common.mk (RUBYOPT): add purelib.rb.
+ [ruby-core:16642]
- * tool/instruction.rb (RubyVM::Instruction#sp_increase_c_expr),
- tool/instruction.rb (RubyVM::VmBodyGenerator#make_header_operands):
- omit unused variables.
+ * ext/extmk.rb: load purelib.rb only when not cross compiling.
Fri May 23 08:47:02 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
- * error.c (exc_equal): == operator should be transitional.
- [ruby-dev:34808]
-
* error.c (syserr_eqq): === should be able to handle delegated
objects as well.
-Fri May 23 06:15:20 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * iseq.c (rb_iseq_compile_with_option): get rid of segv.
-
-Fri May 23 02:29:14 2008 Koichi Sasada <ko1@atdot.net>
-
- * insns.def (opt_gt|ge|lt|le): use values directly to compare.
-
-Fri May 23 01:15:09 2008 Koichi Sasada <ko1@atdot.net>
-
- * eval.c, eval_intern.h, include/ruby/intern.h, include/ruby/ruby.h,
- vm.c, vm_core.h, vm_insnhelper.c: remove pointless "const".
-
-Thu May 22 23:45:17 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * compile.c (get_destination_insn, get_next_insn, get_prev_insn):
- peephole optimization should not ignore ISEQ_ELEMENT_ADJUST.
-
-Thu May 22 20:20:54 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri May 23 04:22:19 2008 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
- * marshal.c (check_dump_arg, check_load_arg): check if reentered.
- [ruby-dev:34802]
-
-Thu May 22 20:14:28 2008 Yusuke Endoh <mame@tsg.ne.jp>
+ * ext/tk/tcltklib.c, ext/tk/tkutil/tkutil.c: fix memory leak.
- * iseq.c (iseq_load, iseq_data_to_ary): support
- ISEQ_TYPE_DEFINED_GUARD.
+ * ext/tk/lib/tk.rb: avoid trouble when finalize TclTkIp.
-Thu May 22 19:01:29 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/tk/lib/tk.rb, ext/tk/lib/tk/*: help to fix troubles when
+ use Ttk widgets on old Tk scripts.
- * vm.c (vm_get_ruby_level_cfp): moved from eval_intern.h.
+ * ext/tk/sample/*: update and add demo scripts. some of them are
+ introduction about new features of Tcl/Tk8.5.
- * vm.c (sdr, nsdr): define methods only if VMDEBUG is defined.
+Fri May 23 03:48:10 2008 Akinori MUSHA <knu@iDaemons.org>
-Thu May 22 17:18:35 2008 Tanaka Akira <akr@fsij.org>
+ * class.c (clone_method): Just use ruby_cref as cref.
- * array.c (rb_ary_compact_bang): fix reallocation size.
+Fri May 23 01:03:23 2008 Akinori MUSHA <knu@iDaemons.org>
-Thu May 22 15:20:20 2008 NAKAMURA Usaku <usa@ruby-lang.org>
+ * class.c (rb_singleton_class_clone): Pass Qnil, not 0.
- * eval_intern.h, vm_core.h, include/ruby/intern.h, include/ruby/ruby.h,
- vm.c: need to add const to prototypes, of course.
+Fri May 23 00:51:48 2008 Akinori MUSHA <knu@iDaemons.org>
-Thu May 22 13:24:43 2008 Koichi Sasada <ko1@atdot.net>
+ * class.c (clone_method): Totally revamp the previous fix which
+ was incorrect.
+ (rb_mod_init_copy): Ditto.
+ (singleton_class_clone_int): Ditto.
- * eval.c, vm.c, vm_core.h, vm_insnhelper.c: specify "const".
+Fri May 23 00:48:10 2008 Akinori MUSHA <knu@iDaemons.org>
- * vm_opts.h: add a OPT_TOKEN_THREADED_CODE macro.
+ * eval.c (rb_copy_node_scope), node.h: Rename from copy_node_scope
+ and export.
-Thu May 22 12:51:41 2008 Tanaka Akira <akr@fsij.org>
+Thu May 22 21:24:15 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
- * insns.def (newhash): fix a variable definition: "const k".
+ * parse.y (top_local_setup): fixed memory leak bug based on a
+ patch from Roger Pack <rogerpack2005 at gmail.com> in
+ [ruby-core:16610].
-Thu May 22 12:40:54 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu May 22 14:20:54 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* array.c (flatten): check if reentered. [ruby-dev:34798]
-Thu May 22 11:39:59 2008 Tanaka Akira <akr@fsij.org>
-
- * test/ruby/envutil.rb (assert_normal_exit): capture stdout and stderr
- of the child process.
-
Thu May 22 08:28:49 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
* array.c (flatten): free memo hash table before raising exception.
@@ -22992,172 +1344,31 @@ Thu May 22 06:30:10 2008 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* array.c (flatten): fix memory leak.
-Thu May 22 06:21:34 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * ext/nkf/nkf-utf8/nkf.c (nkf_str_caseeql): added.
-
- * ext/nkf/nkf-utf8/nkf.c (nkf_enc_find_index): use nkf_str_caseeql.
-
Thu May 22 05:45:30 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
* proc.c (proc_dup): should copy safe_level from src proc
properly. a patch from Keita Yamaguchi
<keita.yamaguchi at gmail.com>
-Thu May 22 02:46:08 2008 Shugo Maeda <shugo@ruby-lang.org>
-
- * lib/net/imap.rb: do not use Thread#raise. [ruby-dev:34739]
-
-Thu May 22 00:30:06 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * test/ruby/test_require.rb: new tests for library requiring, to
- achieve over 90% test coverage of dln.c.
-
- * test/ruby/test_class.rb: add tests to achieve over 90% test coverage
- of class.c.
-
- * test/ruby/test_module.rb: ditto.
-
-Thu May 22 00:15:44 2008 Koichi Sasada <ko1@atdot.net>
-
- * insns.def, vm_insnhelper.c: specify "const".
-
-Wed May 21 23:20:21 2008 Koichi Sasada <ko1@atdot.net>
-
- * bootstraptest/test_eval.rb: fix syntax.
-
-Wed May 21 17:46:17 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * ext/nkf/nkf-utf8/nkf.c (nkf_enc_find_index):
- use strcasecmp. [ruby-dev:34787]
-
-Wed May 21 16:48:22 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * array.c (rb_ary_compact_bang): avoid forceful realloc.
-
-Wed May 21 07:42:28 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * string.c (rb_usascii_str_new): use rb_str_new.
-
- * string.c (rb_enc_str_new): ditto.
-
- * string.c (rb_usascii_str_new2): use rb_str_new2.
-
-Wed May 21 07:22:01 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * encoding.c, include/ruby/encoding.h
- (rb_enc_associate, rb_enc_associate_index):
- returns obj. [ruby-dev:34778]
-
-Wed May 21 04:20:20 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * encoding.c (rb_ascii8bit_encoding): use ENCINDEX_ASCII.
-
- * encoding.c, include/ruby/encoding.h (rb_ascii8bit_encindex):
- added.
-
- * encoding.c (rb_locale_encoding): use rb_usascii_encoding().
-
-Wed May 21 01:45:58 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * test/ruby/test_file_exhaustive.rb (setup): workaround for Windows
- Vista.
-
- * test/ruby/envutil.rb (rubyexec): now Open3.open3 is supported on
- Windows.
-
- * test/ruby/test_process.rb: use ``||'' instead of ``;'' because
- cmd.exe not support it.
-
-Wed May 21 01:28:47 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * transcode.c, include/ruby/encoding.h (rb_str_transcode):
- C API of encoding conversion for Ruby object.
- VALUE rb_str_transcode(VALUE str, VALUE to).
-
- * transcode.c (str_encode, str_encode_bang):
- rename from rb_tr_transcode or rb_str_transcode_bang.
-
-Tue May 20 23:26:05 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * test/ruby/test_array.rb: fix tests for 64bit CPU.
-
-Tue May 20 20:59:56 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * ext/nkf/nkf-utf8/nkf.c (rb_nkf_convert) (nkf_enc_without_bom):
- reverted. nkf-utf8/nkf.c should be independent of ruby.
-
- * ext/nkf/nkf.c (options):
- moved from nkf-utf8/nkf.c.
- override nkf's original settings for Unicode BOM.
-
-Tue May 20 13:20:51 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/nkf/nkf.c (rb_nkf_convert), ext/nkf/nkf-utf8/nkf.c
- (nkf_enc_without_bom): BOM is not a part of encodings.
-
- * ext/nkf/nkf.c (Init_nkf), ext/nkf/nkf-utf8/nkf.c (options):
- UTF-{16,32} without endian have no sense.
-
-Tue May 20 12:13:50 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ruby.c (proc_options, process_options): --dump option.
-
-Tue May 20 11:36:06 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * include/ruby/ruby.h (PRI[diouxX]VALUE): printf format for VALUE.
-
- * gc.c (assign_heap_slot): suppress a warning.
+Wed May 21 23:31:44 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue May 20 03:42:43 2008 Koichi Sasada <ko1@atdot.net>
+ * eval.c (rb_get_method_body, rb_alias, rb_eval): should not cache
+ uninitialized value, since search_method doesn't set origin if the
+ method wasn't found.
- * eval.c, vm_insnhelper.c: fix cref in instance_eval
- and cvar_base search protocol.
+ * eval.c (search_method, remove_method, error_print, rb_alias)
+ (rb_eval, rb_rescue2, search_required, Init_eval, rb_thread_create),
+ gc.c (rb_source_filename, Init_stack), io.c (rb_io_getline),
+ parse.y (rb_id2name, rb_parser_free): suppress warnings.
- * bootstraptest/test_knownbug.rb, test_eval.rb: move solved test
- and add new tests.
+Wed May 21 12:34:51 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * test/ruby/test_eval.rb: fix tests for spec.
+ * hash.c (rb_hash_delete): rdoc fix based on a patch from Gaston Ramos
+ <ramos.gaston AT gmail.com>. [ruby-core:16825]
-Tue May 20 01:43:44 2008 Koichi Sasada <ko1@atdot.net>
+Tue May 20 13:15:46 2008 Akinori MUSHA <knu@iDaemons.org>
- * bootstraptest/test_knownbug.rb: fix a test.
- "block_given?" returns true if "yield" can be used.
-
-Tue May 20 01:07:19 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * parse.y (assignable_gen): when "self = 1" was evaluated, unnecessary
- error message was output, which might cause null pointer access.
-
-Tue May 20 08:38:56 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * string.c (rb_enc_strlen_cr): need to set ENC_CODERANGE_7BIT if
- search_nonascii() fails. [ruby-dev:34751]
-
- * string.c (rb_str_reverse): preserve coderange info if the
- receiver is 7bit string.
-
- * string.c (rb_str_reverse_bang): ditto.
-
- * string.c (rb_str_reverse_bang): should have called
- single_byte_optimizable before rb_str_modify() that clears
- coderange info.
-
- * string.c (tr_trans): handle single bytes more eagerly.
-
-Mon May 19 23:32:12 2008 Koichi Sasada <ko1@atdot.net>
-
- * vm.c (invoke_block_from_c): fix call flow.
-
-Mon May 19 23:19:35 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * regexec.c (slow_search): check the case when the length is 1.
- The behavior of memcmp is undefined if the third argument is 0.
-
-Mon May 19 21:07:48 2008 Koichi Sasada <ko1@atdot.net>
-
- * thread_pthread.c (native_thread_apply_priority):
- fix argument range check. [ruby-dev:33124]
+ * file.c (lchmod_internal): Remove a compiler warning.
Mon May 19 18:22:35 2008 Akinori MUSHA <knu@iDaemons.org>
@@ -23165,73 +1376,32 @@ Mon May 19 18:22:35 2008 Akinori MUSHA <knu@iDaemons.org>
of md; pointed out by Takahiro Kambe <taca at back-street.net>
in [ruby-dev:34748].
-Mon May 19 17:23:55 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * regparse.c (PINC): use optimized enclen() instead of
- ONIGENC_MBC_ENC_LEN().
-
- * regparse.c (PFETCH): ditto.
-
- * regparse.c (PFETCH): small optimization.
-
- * regexec.c (slow_search): single byte encoding optimization.
-
- * regenc.h (enclen): avoid calling function when encoding's
- min_len == max_len.
-
- * re.c (rb_reg_regsub): rb_enc_ascget() optimization for single
- byte encoding.
-
- * re.c (rb_reg_search): avoid allocating new re_registers if we
- already have MatchData.
+Mon May 19 14:20:13 2008 NAKAMURA Usaku <usa@ruby-lang.org>
- * re.c (match_init_copy): avoid unnecessary onig_region_free()
- before onig_region_copy.
+ * sprintf.c (rb_f_sprintf): fixed SEGV on win32 with "% 0e" % 1.0/0.0.
- * encoding.c (rb_enc_get_index): remove implicit enc_capable check
- each time.
+Mon May 19 13:29:58 2008 NAKAMURA Usaku <usa@ruby-lang.org>
- * encoding.c (rb_enc_set_index): ditto.
+ * process.c (rb_f_system): set last_status when status == -1 because
+ there is no path to set it on win32. this patch is derived from
+ [ruby-core:16787], submitted by Luis Lavena <luislavena at gmail.com>
- * encoding.c (enc_compatible_p): small refactoring.
+Mon May 19 13:01:05 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * include/ruby/encoding.h (rb_enc_dummy_p): inline
- rb_enc_dummy_p() and export related code.
+ * common.mk ({MSPEC,RUBYSPEC}_GIT_URL): moved from Makefine.in.
-Mon May 19 14:32:03 2008 Koichi Sasada <ko1@atdot.net>
+ * {win32,bcc32}/Makefile.sub (update-rubyspec): added.
- * version.h: fix strange change by version.h update tool.
+Mon May 19 11:53:45 2008 Akinori MUSHA <knu@iDaemons.org>
-Mon May 19 14:18:13 2008 Koichi Sasada <ko1@atdot.net>
-
- * bootstraptest/test_knownbug.rb: move solved tests.
-
- * bootstraptest/test_eval.rb, test_literal.rb, test_syntax.rb,
- test_thread.rb: ditto.
-
- * test/ruby/test_m17n.rb, test_proc.rb, test_sprintf.rb,
- test_string.rb, test/ruby/test_struct.rb: ditto.
-
-Mon May 19 13:23:03 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * process.c (rb_spawn_internal): set last_status when status == -1
- because there is no path to set it on win32. this patch is derived
- from [ruby-core:16787], submitted by Luis Lavena <luislavena at
- gmail.com>
-
-Mon May 19 11:32:47 2008 Koichi Sasada <ko1@atdot.net>
-
- * vm.c, insns.def, eval.c, vm_insnhelper.c: fix CREF handling.
- VM value stack frame of block contains cref information.
- (dfp[-1] points CREF)
-
- * compile.c, eval_intern.h, eval_method.c, load.c, proc.c,
- vm_dump.h, vm_core.h: ditto.
+ * ext/openssl/openssl_missing.c (HMAC_CTX_copy): adopted
+ prototype change in openssl bundled with newer OpenBSD.
+ a patch from Takahiro Kambe <taca at back-street.net> in
+ [ruby-dev:34691].
- * include/ruby/ruby.h, gc.c: remove T_VALUES because of above
- changes.
+Mon May 19 06:36:37 2008 Akinori MUSHA <knu@iDaemons.org>
- * bootstraptest/test_eval.rb, test_knownbug.rb: move solved test.
+ * .: Release as Ruby 1.8.7-preview3.
Sun May 18 22:26:51 2008 GOTOU Yuuzou <gotoyuzo@notwork.org>
@@ -23243,589 +1413,216 @@ Sun May 18 22:26:51 2008 GOTOU Yuuzou <gotoyuzo@notwork.org>
filename) is less than perfect.
* lib/webrick/httpservlet/abstract.rb
- (WEBrick::HTTPServlet::AbstractServlet#redirect_to_directory_uri):
+ (WEBrick::HTTPServlet::AbstracServlet#redirect_to_directory_uri):
should escape the value of Location: header.
* lib/webrick/httpservlet/cgi_runner.rb: accept interpreter
command line arguments.
-Sun May 18 02:54:46 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * pack.c (pack_pack): check errno to detect error of ruby_strtoul.
-
- * pack.c (pack_unpack): ditto.
-
- * test/ruby/test_pack.rb: add a test for above.
-
Sat May 17 23:53:57 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* file.c (file_expand_path): fix for short file name on Cygwin.
-Sat May 17 18:03:52 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * vm.c (Init_VM): removed the definition of Thread#initialize,
- which is overwritten in Init_Thread and is never used.
-
-Sat May 17 14:01:50 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * array.c (rb_ary_sort_bang): should not free shared pointer, and set
- shared. [ruby-dev:34732]
-
-Sat May 17 12:34:54 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * thread_pthread.c (Init_native_thread): Kernel#.sleep used never to
- sleep on Mac OS X. Reported by arton <artonx AT yahoo.co.jp>.
-
- * thread_pthread.c (native_sleep): added error checks.
-
Sat May 17 11:29:11 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* file.c (rb_file_s_extname): first dot is not an extension name.
-Sat May 17 03:21:29 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * array.c (rb_ary_sort_bang): stop memory leak. [ruby-dev:34726]
+Sat May 17 10:18:44 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
* re.c (rb_reg_search): need to free allocated buffer in re_register.
- * regexec.c (onig_region_new): more pedantic malloc check.
-
- * regexec.c (onig_region_resize): ditto.
-
- * regexec.c (STATE_CHECK_BUFF_INIT): ditto.
+Fri May 16 17:01:44 2008 NAKAMURA Usaku <usa@ruby-lang.org>
- * regexec.c (onig_region_copy): use onig_region_resize.
+ * win32/Makefile.sub (test-rubyspec): added.
-Fri May 16 12:48:33 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
+Fri May 16 16:22:40 2008 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
- * math.c (to_flo): rb_Float() accepts even strings for input.
+ * ext/tk/tcltklib.c: sometimes freeze when receive Interrupt signal.
- * complex.c (nucomp_to_f): fix wrong message.
+Fri May 16 14:54:56 2008 Tanaka Akira <akr@fsij.org>
- * complex.c (nucomp_to_r): ditto.
+ * Makefile.in (update-rubyspec): move rubyspec to srcdir.
+ (test-rubyspec): ditto.
- * object.c (rb_Float): do not check NaN for error. NaN is a part
- of valid float values.
+Fri May 16 14:25:22 2008 Tanaka Akira <akr@fsij.org>
-Thu May 15 23:36:09 2008 Yusuke Endoh <mame@tsg.ne.jp>
+ * Makefile.in (test-rubyspec): use RUNRUBY. suggested by nobu.
- * test/ruby/test_string.rb: add tests to achieve over 90% test
- coverage of string.c.
+Fri May 16 13:01:43 2008 Tanaka Akira <akr@fsij.org>
- * test/ruby/test_m17n.rb: ditto.
+ * Makefile.in (update-rubyspec): new target to download rubyspec.
+ (test-rubyspec): new target to run rubyspec. this doesn't work
+ before install.
- * test/ruby/test_symbol.rb: ditto.
+Fri May 16 08:15:52 2008 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
- * test/ruby/test_pack.rb: ditto.
-
-Thu May 15 23:01:06 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * string.c (tr_find): String#delete returned wrong result when multiple
- utf-8 arguments are passed.
+ * ext/tk/lib/tk.rb: fix memory (object) leak bug.
- * test/ruby/test_m17n.rb (test_delete): add a test for above.
+ * ext/tk/sample/demos-jp/aniwave.rb, ext/tk/sample/demos-en/aniwave.rb:
+ bug fix.
-Thu May 15 22:37:56 2008 NAKAMURA Usaku <usa@ruby-lang.org>
+Thu May 15 17:00:22 2008 Akinori MUSHA <knu@iDaemons.org>
- * parse.y (ripper_warningS): now used.
+ * string.c (Init_String): Define #bytesize as an alias for #size
+ for compatibility with 1.9.
Thu May 15 15:33:59 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* file.c (file_expand_path): support for alternative data stream
- and ignored trailing garbage of NTFS.
+ and ignored trailing garbages of NTFS.
* file.c (rb_file_s_basename): ditto.
* file.c (rb_file_s_extname): ditto.
-Thu May 15 13:43:36 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * object.c (rb_cstr_to_dbl): no need for forceful warning when
- converting to float. overflow is a nature of float values.
-
- * parse.y (parser_yylex): ditto.
-
-Thu May 15 13:23:20 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * re.c (rb_reg_prepare_enc): error condition was updated for non
- ASCII compatible strings.
-
-Thu May 15 12:19:42 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * ext/openssl/openssl_missing.c (HMAC_CTX_copy): adopted
- prototype change in openssl bundled with newer OpenBSD.
- a patch from Takahiro Kambe <taca at back-street.net> in
- [ruby-dev:34691].
-
-Wed May 14 22:09:25 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * ChangeLog: fix typo.
-
-Wed May 14 21:49:14 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * test/ruby/test_object.rb: new tests to achieve over 90% test
- coverage of object.c, eval.c and eval_method.c.
-
- * test/ruby/test_module.rb: ditto.
-
- * test/ruby/test_trace.rb: ditto.
-
- * test/ruby/test_integer.rb: ditto.
-
- * test/ruby/test_float.rb: ditto.
-
- * test/ruby/test_method.rb: ditto.
-
- * test/ruby/test_variable.rb: ditto.
-
- * test/ruby/test_eval.rb: ditto.
-
- * test/ruby/test_exception.rb: ditto.
-
- * test/ruby/test_class.rb: ditto.
-
-Wed May 14 12:46:37 2008 Koichi Sasada <ko1@atdot.net>
-
- * iseq.c (insn_operand_intern): remove Qundef related code.
-
-Wed May 14 12:42:36 2008 Akinori MUSHA <knu@iDaemons.org>
+Wed May 14 19:24:59 2008 Akinori MUSHA <knu@iDaemons.org>
* array.c (rb_ary_count): Override Enumerable#count for better
performance.
+ (rb_ary_nitems): Undo the backport. Use #count {} instead.
-Wed May 14 11:29:06 2008 Koichi Sasada <ko1@atdot.net>
-
- * insns.def: add a "putcbase" instruction.
-
- * compile.c, insns.def: fix to use putcbase instruction for
- class search. Qundef should not be used.
-
-Wed May 14 07:49:35 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (rb_call0): defer calling of rb_frame_self() until it
- become really necessary.
-
- * eval.c (rb_call): ditto.
-
-Wed May 14 00:55:56 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * test/ruby/test_io_m17n.rb: remove a duplicative method.
-
- * test/ruby/test_utf16.rb: rename a conflicting method name.
-
- * test/ruby/test_array.rb: ditto.
-
- * test/ruby/test_file_exhaustive.rb: ditto.
-
- * test/ruby/test_hash.rb: ditto.
-
- * test/ruby/test_env.rb: ditto.
-
- * test/ruby/test_fixnum.rb: ditto.
+ * enumerator.c (enumerator_iter_i): Remove an unused function.
+ (enumerator_with_index, enumerator_each): Remove unused
+ variables.
- * test/ruby/test_rational.rb: ditto.
+Wed May 14 17:15:11 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-Wed May 14 00:45:58 2008 Yusuke Endoh <mame@tsg.ne.jp>
+ * ext/tk/tkutil/extronf.rb: check stdndup() because it's not standard
+ function of C.
- * eval_method.c (rb_add_method): fix check for warning when
- Object#initialize is redefined. (same as 1.8)
+ * ext/tk/tkutil/tkutil.c (cbsubst_table_setup): use malloc() and
+ strncpy() instead of strndup() if not available.
-Tue May 13 23:32:44 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed May 14 09:52:02 2008 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
- * enum.c (enum_yield): use rb_yield_values2.
+ * ext/tk/tkutil/tkutil.c: improve handling callback-subst-keys.
+ Now, support longnam-keys (e.g. '%CTT' on tkdnd-2.0; however, still
+ not support tkdnd-2.0 on tkextlib), and symbols of parameters (e.g.
+ :widget=>'%W', :keycode=>'%k', '%x'=>:x, '%X'=>:root_x, and so on;
+ those are attributes of event object). It means that Ruby/Tk accepts
+ not only "widget.bind(ev, '%W', '%k', ...){|w, k, ...| ... }", but
+ also "widget.bind(ev, :widget, :keycode, ...){|w, k, ...| ... }".
+ It is potentially incompatible, when user passes symbols to the
+ arguments of the callback block (the block receives the symbols as
+ strings). I think that is very rare case (probably, used by Ruby/Tk
+ experts only). When causes such trouble, please give strings instead
+ of such symbol parameters (e.g. call Symbol#to_s method).
- * enum.c (DEFINE_ENUMFUNCS): macro to define enumerator and yielding
- functions.
+ * ext/tk/lib/tk/event.rb, ext/tk/lib/tk/validation.rb,
+ ext/tk/lib/tkextlib/blt/treeview.rb,
+ ext/tk/lib/tkextlib/winico/winico.rb: ditto.
- * enum.c (enum_all_func, enum_any_func, enum_one_func,
- enum_none_func): reduced duplicate code.
+ * ext/tk/tkutil/tkutil.c: strings are available on subst_tables on
+ TkUtil::CallbackSubst class (it is useful on Ruby 1.9).
+
+ * ext/tk/lib/tk/spinbox.rb, ext/tk/lib/tkextlib/iwidgets/hierarchy.rb,
+ ext/tk/lib/tkextlib/iwidgets/spinner.rb,
+ ext/tk/lib/tkextlib/iwidgets/entryfield.rb,
+ ext/tk/lib/tkextlib/iwidgets/calendar.rb,
+ ext/tk/lib/tkextlib/blt/dragdrop.rb,
+ ext/tk/lib/tkextlib/tkDND/tkdnd.rb,
+ ext/tk/lib/tkextlib/treectrl/tktreectrl.rb,
+ ext/tk/lib/tkextlib/tktable/tktable.rb: disable code piece became
+ unnecessary by reason of the changes of ext/tk/tkutil/tkutil.c.
-Tue May 13 15:09:38 2008 Akinori MUSHA <knu@iDaemons.org>
+Tue May 13 15:10:50 2008 Akinori MUSHA <knu@iDaemons.org>
* enumerator.c: Update rdoc.
(enumerator_initialize): Discourage the use.
(enum_each_slice, enum_each_cons, enumerator_each)
(enumerator_with_index): Add a note about a call without a block.
-Tue May 13 08:25:31 2008 Tanaka Akira <akr@fsij.org>
-
- * io.c (rb_f_gets): re-enable rdoc.
- (rb_f_readline): ditto.
- (rb_f_readlines): ditto.
+ * NEWS: Intentionally omit enum_slice and enum_cons, which are
+ removed in 1.9.
Tue May 13 07:56:36 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
* string.c (rb_str_cat): fixed buffer overrun reported by
Christopher Thompson <cthompson at nexopia.com> in [ruby-core:16746]
-Mon May 12 23:37:57 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * vm.c (collect_local_variables_in_env): remove unnecessary check
- which causes: x=1;proc{local_variables}.call #=> []
-
- * test/ruby/test_variable.rb: add a test for above.
-
-Mon May 12 23:05:24 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * process.c, include/ruby/intern.h (rb_run_exec_options): externed.
-
- * process.c (save_redirect_fd, save_env_i, save_env, run_exec_dup2,
- run_exec_open, run_exec_pgroup, run_exec_rlimit, rb_run_exec_options):
- save parent's process environments.
-
- * process.c (rb_spawn_internal): remove calling run_exec_options()
- because cannot restore after spawn.
-
- * io.c (pipe_open): ditto.
-
- * test/ruby/test_process.rb (test_execopts_env): upcase environment
- variable name for case insensitive platforms.
-
- * win32/win32.c (init_env): set USER environment variable only when
- USERNAME is available.
-
-Mon May 12 22:23:01 2008 Tanaka Akira <akr@fsij.org>
-
- * lib/date.rb (once): use Object#object_id instead of Symbol#to_i.
-
-Mon May 12 21:34:46 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * test/ruby/envutil.rb (rubybin): return expanded rubyexe instead of
- expanded ruby if available.
-
-Mon May 12 20:19:55 2008 Akinori MUSHA <knu@iDaemons.org>
-
- * enum.c (grep_i): Be aware of multiple values;
- fix [ruby-dev:34653].
- (grep_iter_i): Ditto.
- (count_i): Ditto.
- (find_i): Ditto.
- (find_index_i): Ditto.
- (find_all_i): Ditto.
- (reject_i): Ditto.
- (inject_i): Ditto.
- (inject_op_i): Ditto.
- (partition_i): Ditto.
- (group_by_i): Ditto.
- (first_i): Ditto.
- (sort_by_i): Ditto.
- (all_i): Ditto.
- (all_iter_i): Ditto.
- (any_i): Ditto.
- (any_iter_i): Ditto.
- (one_i): Ditto.
- (one_iter_i): Ditto.
- (none_i): Ditto.
- (none_iter_i): Ditto.
- (min_i): Ditto.
- (min_ii): Ditto.
- (max_i): Ditto.
- (max_ii): Ditto.
- (minmax_i): Ditto.
- (minmax_ii): Ditto.
- (min_by_i): Ditto.
- (max_by_i): Ditto.
- (minmax_by_i): Ditto.
- (member_i): Ditto.
- (take_i): Ditto.
- (take_while_i): Ditto.
- (drop_i): Ditto.
- (drop_while_i): Ditto.
- (cycle_i): Ditto.
-
- * enum.c (each_with_index): Update rdoc. each_with_index() takes
- arguments that are passed through to each(), and a hash preserves
- key order.
-
-Mon May 12 19:05:24 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * process.c (rb_spawn_internal): remove calling run_exec_options()
- because cannot restore after spawn. we'll fix this later.
-
-Mon May 12 18:16:44 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * process.c (rb_spawn_internal): need to call run_exec_options() before
- spawn if the platform doesn't have fork. [ruby-dev:34647]
-
-Mon May 12 15:20:02 2008 Tanaka Akira <akr@fsij.org>
-
- * gc.c (ruby_vm_xmalloc): increase malloc_increase only if malloc
- succeeds. failed malloc size can be huge. it may increase
- malloc_limit too big which cause less GC and memory full.
- (ruby_vm_xrealloc): ditto.
- (rb_objspace): make params.limit and params.increase size_t.
-
-Mon May 12 15:04:58 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * re.c (rb_reg_prepare_re): made non static with small refactoring.
-
- * ext/strscan/strscan.c (strscan_do_scan): should adjust encoding
- before regex searching.
-
Mon May 12 13:57:19 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
* eval.c (is_defined): add NODE_OP_ASGN_{OR,AND}. "defined?(a||=1)"
should not operate assignment. [ruby-dev:34645]
-Mon May 12 13:29:26 2008 Tanaka Akira <akr@fsij.org>
+Mon May 12 12:59:23 2008 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
- * bignum.c (bigzero_p): check from MSB to LSB. [ruby-dev:34649]
-
-Mon May 12 12:32:10 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * common.mk (RUBYOPT): affected BASERUBY too. [ruby-talk:301514]
-
-Mon May 12 12:27:55 2008 Tanaka Akira <akr@fsij.org>
+ * ext/tk/lib/tk/wm.rb: Wm#overrideredirect overwrites arguemnt to
+ an invalid value.
- * gc.c (assign_heap_slot): fix condition for number of objects in
- a heap.
+ * ext/tk/sample/ttk_wrapper.rb: support "if __FILE__ == $0" idiom.
-Mon May 12 12:24:48 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
+Mon May 12 12:36:55 2008 NAKAMURA Usaku <usa@ruby-lang.org>
- * string.c (sym_to_i): really removed. [ruby-dev:34641]
+ * win32/win32.c (rb_w32_select): backport from trunk.
+ [ruby-talk:300743]
-Mon May 12 11:15:55 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
+Mon May 12 12:33:21 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * gc.c (assign_heap_slot): put the binary search routine in order.
+ * common.mk (RUBYLIB, RUBYOPT): clear.
-Mon May 12 10:52:51 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon May 12 10:41:10 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ruby.c (ruby_init_gems), gem_prelude.rb: check if Gem is defined
- instead of Gem::Enable.
+ * lib/delegate.rb (SimpleDelegator::dup): removed needless argument.
+ [ruby-list:44910]
- * gem_prelude.rb (load_full_rubygems_library, const_missing): prevent
- infinite recursion. [ruby-dev:34539]
+ * lib/delegate.rb (clone, dup): keep relationship with the target
+ object.
Sun May 11 23:19:39 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* enum.c (all_iter_i, any_iter_i): reduced duplicated code.
-Sun May 11 22:54:02 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * bootstraptest/runner.rb (main): leave -I options for purelib.rb
- untouched.
-
- * bootstraptest/runner.rb (main): handle relative path -r options.
-
-Sun May 11 19:04:06 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * test/ruby/test_thread.rb: kill and join temporal threads that are
- created in each test.
-
-Sun May 11 17:58:45 2008 Tanaka Akira <akr@fsij.org>
-
- * test/ruby/test_process.rb (TestProcess#with_stdin): defined.
- (TestProcess#test_argv0_noarg): don't use redirect_fds.
- [ruby-dev:34647]
-
Sun May 11 17:57:36 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* configure.in (MINIRUBY): should not include extension library path.
-Sun May 11 14:40:36 2008 Tanaka Akira <akr@fsij.org>
-
- * include/ruby/ruby.h (SIZET2NUM): new macro.
- (NUM2SIZET): new macro.
-
- * gc.c (struct rb_objspace): use size_t for increment, length and
- used for 64bit.
- (allocate_heaps): ditto.
- (assign_heap_slot): ditto.
- (set_heaps_increment): ditto.
- (gc_mark_all): ditto.
- (is_pointer_to_heap): ditto.
- (free_unused_heaps): ditto.
- (gc_sweep): ditto.
- (os_obj_of): ditto.
- (rb_gc_call_finalizer_at_exit): ditto.
- (count_objects): ditto.
-
-Sun May 11 13:14:09 2008 Tanaka Akira <akr@fsij.org>
-
- * thread.c (thread_cleanup_func_before_exec): extracted from
- thread_cleanup_func not to touch pthread data.
- pthread_cond_destroy in forked process may cause deadlock on
- Debian GNU/Linux Etch on x86, x86-64 and IA64.
- this doesn't cause resource leak because the process will exec soon.
- (terminate_atfork_before_exec_i): defined.
- (rb_thread_atfork_before_exec): defined.
-
- * include/ruby/intern.h (rb_thread_atfork_before_exec): declared.
-
- * process.c (rb_exec_atfork): call rb_thread_atfork_before_exec
- instead of rb_thread_atfork.
-
- * io.c (popen_exec): call rb_thread_atfork_before_exec instead of
- rb_thread_atfork.
-
-Sat May 10 22:14:03 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * string.c (tr_trans): single '^' does not mean negation.
- [ruby-dev:34632]
-
- * string.c (tr_trans): should check src size, not str size.
- [ruby-dev:34637]
-
- * string.c (tr_trans): should not turn on modify flag if no
- modification happens. [ruby-dev:34631]
-
-Sat May 10 18:11:18 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * string.c (rb_str_each_line): zero length record separator should
- split a string into paragraphs. [ruby-dev:34586]
-
- * string.c (rb_str_each_line): RDoc updated.
-
-Sat May 10 11:36:20 2008 Tanaka Akira <akr@fsij.org>
-
- * vm.c (env_mark): mark env->block.self. prevent SEGV when GC occur
- in prepare_iseq_build with gcc version 3.4.6 [FreeBSD] 20060305 on
- FreeBSD/amd64.
-
-Fri May 9 19:16:00 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * thread.c (timeofday): use monotonic clock. based on a patch
- from zimbatm <zimbatm at oree.ch> in [ruby-core:16627].
-
-Fri May 9 07:47:07 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * cont.c (cont_restore_0): dynamic stack direction code should be
- consistent with static one. [ruby-talk:301152]
-
-Fri May 9 00:03:50 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * parse.y (arg): operator assignment "a += b rescue c" should be
- parsed as "a += (b rescue c)" just like normal assignment.
- [ruby-talk:301000]
+Sun May 11 10:36:10 2008 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-Thu May 8 18:14:00 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * eval.c (method_name, method_owner): New methods; backported
+ from 1.9. (UnboundMethod#name, UnboundMethod#owner)
- * bignum.c (rb_big_and): bit-wise operation should not take float
- values. [ruby-dev:34612]
+Sun May 11 02:48:13 2008 <nagai@orca16.orcabay.ddo.jp>
- * bignum.c (rb_big_or): ditto.
-
- * bignum.c (rb_big_xor): ditto.
-
-Thu May 8 17:44:13 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * common.mk, ext/extmk.rb, lib/mkmf.rb: use absolute path for RUBYOPT.
-
- * file.c (rb_find_file_ext): guard load_path from GC.
- gcc version 4.1.2 20061115 (prerelease) (Debian 4.1.1-21) optimizes
- load_path by holding only RARRAY_LEN(load_path) and
- RARRAY_PTR(load_path) in registers on IA64 GNU/Linux Etch.
-
-Thu May 8 16:41:20 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in (MINIRUBY), common.mk (RUBYOPT): add purelib.rb.
- [ruby-core:16642]
-
-Thu May 8 16:00:41 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * parse.y (parser_yylex): ! and ? at the bottom are no longer part
- of valid symbol names. [ruby-dev:34590]
-
-Thu May 8 15:36:11 2008 Tanaka Akira <akr@fsij.org>
-
- * thread.c (rb_gc_save_machine_context): call FLUSH_REGISTER_WINDOWS
- to mark the register stack from GC on another thread.
-
-Thu May 8 15:14:34 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * array.c (rb_ary_sort_bang): freeze temporary array.
-
-Thu May 8 13:19:18 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * vm.c (rb_thread_mark): mark stat_insn_usage only when ptr is not
- null.
-
-Thu May 8 10:44:04 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * array.c (sort_reentered): reentered check may be called from
- Array#sort.
-
-Thu May 8 09:51:52 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/tk/lib/tk/pack.rb, ext/tk/lib/tk/grid.rb: fail to do pack/grid
+ without options.
- * array.c (sort_1, sort_2): check for reentered and if elements are
- accessible. [ruby-core:16679]
-
-Thu May 8 06:43:52 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * dln.c (dln_find_exe_r, dln_find_file_r): reentrant versions.
-
- * file.c (rb_find_file_ext, rb_find_file), process.c (proc_exec_v),
- (rb_proc_exec, proc_spawn_v, proc_spawn), ruby.c (process_options):
- use reentrant versions.
-
-Thu May 8 06:27:33 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * thread.c (rb_thread_key_p): thread local storage stores ID.
-
-Thu May 8 01:10:03 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * string.c (tr_trans): should squeeze properly. [ruby-dev:34587]
-
- * string.c (tr_trans): had a bug in treating multi-byte character
- replacement.
-
- * string.c (rb_str_delete_bang): need not to do anything for empty
- strings.
-
- * test/ruby/test_m17n_comb.rb (TestM17NComb::test_str_delete): add
- test for empty receiver.
-
-Wed May 7 20:19:18 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * ruby.c (process_options, ruby_set_argv): set encoding of rb_argv
- after Init_prelude() because cannot load encoding extensions before
- it.
-
-Wed May 7 20:00:21 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * numeric.c (bit_coerce): float should not be a valid operand of
- bitwise operations. [ruby-dev:34583]
-
-Wed May 7 19:35:29 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * thread.c (rb_thread_key_p): should always convert symbol to ID.
- [ruby-dev:34588]
-
-Wed May 7 19:30:34 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * numeric.c (fix_divide): float division should floor() before
- rounding into integer. [ruby-dev:34584]
+ * ext/tk/lib/tk.rb: add TkWindow#grid_anchor, grid_column, grid_row.
-Wed May 7 18:02:01 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
+Sat May 10 18:19:16 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
- * string.c (sym_to_i): remove obsolete method. preparation for
- symbol GC.
+ * string.c (rb_str_each_line): RDoc updated. [ruby-dev:34586]
- * numeric.c (fix_to_sym): ditto.
+Sat May 10 13:17:56 2008 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
- * numeric.c (fix_id2name): ditto.
+ * ext/tk/lib/tk/pack.rb, ext/tk/lib/tk/grid.rb: increase supported
+ parameter patterns of configure method.
-Wed May 7 17:43:22 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat May 10 09:16:13 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
- * io.c (io_puts_ary): check recursion first. [ruby-dev:34580]
+ * util.c (ruby_strtod): backported from 1.9. a patch from Satoshi
+ Nakagawa <psychs at limechat.net> in [ruby-dev:34625].
+ fixed: [ruby-dev:34623]
-Wed May 7 17:41:14 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri May 9 23:33:25 2008 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
- * vm.c (vm_eval_body): initialize retval. [ruby-dev:34576]
+ * ext/tk/lib/tk/wm.rb: methods of Tk::Wm_for_General module cannot
+ pass the given block to methods of Tk::Wm module.
-Wed May 7 13:02:56 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * ext/tk/lib/tk/grid.rb: lack of module-method definitions.
- * bignum.c (rb_big_fdiv): flo.fdiv(NaN) should result NaN.
+ * ext/tk/lib/tkextlib/tile.rb: lack of autoload definitions.
- * numeric.c (num_quo): renamed and moved from bignum.c.
- [ruby-dev:34582]
+ * ext/tk/lib/tkextlib/tile/tnotebook.rb: cannot use kanji (not UTF-8)
+ characters for headings.
- * bignum.c (rb_big_fdiv): update RDoc description
+ * ext/tk/tcltklib.c: maybe a little more stable about @encoding value
+ of TclTkIp object.
- * rational.c (nurat_s_new_m): small refactoring.
+Wed May 7 08:46:44 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
- * bignum.c (rb_big2dbl): no need for forceful warning when
- converting to float. overflow is a nature of float values.
+ * struct.c (rb_struct_s_def): to_str should be called only once.
+ [ruby-core:16647]
Wed May 7 00:54:25 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
@@ -23833,154 +1630,39 @@ Wed May 7 00:54:25 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
a patch from Kouya <kouyataifu4 at gmail.com> in
[ruby-reference-manual:762].
-Tue May 6 02:08:18 2008 Tanaka Akira <akr@fsij.org>
-
- * test/io/nonblock/test_flush.rb: don't set Thread.abort_on_exception.
-
- * test/net/imap/test_imap.rb: ensure disconnecting imap to terminate
- receiver thread.
-
-Tue May 6 00:29:21 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * iseq.c (insn_operand_intern): should handle Qundef embedded in
- operand. [ruby-core:16656]
-
-Tue May 6 00:00:02 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * compile.c (iseq_compile_each): should call compile_cpath() for
- modules as well. [ruby-dev:34585]
-
- * insns.def (defineclass): add undef handling.
-
-Mon May 5 23:49:40 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * insns.def (defineclass): was using wrong variable. [ruby-dev:34592]
-
-Mon May 5 20:07:59 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * io.c (io_fflush): IO#flush problem within threads. a patch from
- <s.wanabe at gmail.com> in [ruby-dev:34595].
-
-Mon May 5 19:58:44 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * compile.c (defined_expr): protect some expression from
- segmentation fault. a patch from wanabe <s.wanabe at gmail.com>
- in [ruby-dev:34593].
-
-Mon May 5 19:49:59 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * struct.c (rb_struct_s_def): Struct.new(0) should not SEGV.
- based on the patch from wanabe <s.wanabe at gmail.com> in
- [ruby-dev:34594].
-
- * struct.c (make_struct): call to_str on name object.
-
-Mon May 5 17:17:40 2008 Tanaka Akira <akr@fsij.org>
-
- * eval.c (ruby_cleanup): wrap ruby_finalize_0 by SAVE_ROOT_JMPBUF to
- avoid SEGV by at_exit { Fiber.new{}.resume } on IA64.
-
-Mon May 5 12:12:11 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * array.c (rb_ary_slice_bang): should adjust length before making
- sub-array.
-
-Mon May 5 11:36:14 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * array.c (rb_ary_dup): should dupe corresponding information.
- [ruby-dev:34581]
-
-Mon May 5 11:13:50 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * compile.c (compile_cpath): use Qundef to denote cbase lookup.
-
- * insns.def (defineclass): Qundef is passed for cbase.
-
- * insns.def (setconstant): ditto.
-
- * vm_insnhelper.c (vm_check_if_namespace): use rb_inspect()
- instead of rb_obj_as_string() for better description.
-
-Mon May 5 02:10:23 2008 Tanaka Akira <akr@fsij.org>
-
- * gc.c (set_heaps_increment): fix memory allocation strategy by
- determining heaps_inc from heaps_used, not objects_delta.
- (struct rb_objspace): delta removed. change increment, length and
- used to long for LP64.
- (objects_delta): removed.
- (allocate_heaps): add next_heaps_length argument.
- (init_heap): renamed from add_heap.
- (garbage_collect): use heaps_increment in dont_gc.
-
-Sun May 4 21:09:32 2008 Tanaka Akira <akr@fsij.org>
-
- * lib/getoptlong.rb: use $stderr instead of $deferr.
-
-Sun May 4 16:04:28 2008 Tanaka Akira <akr@fsij.org>
-
- * time.c (obj2nsec): fix string argument.
-
-Sun May 4 14:29:14 2008 Tanaka Akira <akr@fsij.org>
+Sun May 4 09:35:51 2008 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
- * eval.c (rb_obj_respond_to): check the result of respond_to? method
- by RTEST.
+ * sample/erb/erb4html.rb (ERB4Html) : add example of ERB#set_eoutvar.
+ ERB4Html is an auto-quote ERB.
-Sun May 4 12:57:58 2008 Tanaka Akira <akr@fsij.org>
+Sat May 3 22:52:48 2008 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
- * string.c (rb_str_each_line): return original string.
-
-Sat May 3 20:57:06 2008 Tanaka Akira <akr@fsij.org>
-
- * test/ruby/envutil.rb (Test::Unit::Assertions#assert_normal_exit):
- new method.
-
-Sat May 3 18:10:54 2008 Tanaka Akira <akr@fsij.org>
-
- * time.c (time_timespec): raise TypeError for nil and other objects
- which has no divmod method.
-
-Fri May 2 23:59:26 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * io.c (internal_read_func, internal_write_func): split from
- internal_io_func.
-
-Fri May 2 23:55:15 2008 Tanaka Akira <akr@fsij.org>
-
- * variable.c (rb_define_hooked_variable): guard *var from GC to
- prevent collecting argf under RUBY_DEBUG=gc_stress.
-
-Fri May 2 17:29:59 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * range.c (range_step): call to_int if step is not a numeric
- value. [ruby-dev:34575]
-
-Fri May 2 16:10:57 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * range.c (range_step): do not forcefully convert steps into
- integers. [ruby-dev:34571]
+ * ext/tk/lib/tkextlib/tile.rb, ext/tk/lib/tkextlib/tile/style.rb,
+ ext/tk/sample/ttk_wrapper.rb: improve treating and control themes.
+ add Tk::Tile.themes and Tk::Tile.set_theme(theme).
Fri May 2 14:52:33 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
* misc/ruby-mode.el: move fontifying code from hook. a patch from
Phil Hagelberg <phil at hagelb.org> in [ruby-core:16636].
-Fri May 2 14:10:17 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * range.c (range_step): step may be bignum.
+Fri May 2 13:47:51 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-Fri May 2 13:52:36 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * re.c (match_select): restore previous behavior of MatchData#select.
+ RDoc updated as well, mentioning the plan to remove this method
+ in the future. [ruby-dev:34556]
- * re.c (Init_Regexp): remove MatchData#select. [ruby-dev:34563]
+Fri May 2 13:04:04 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-Thu May 1 23:59:59 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * bignum.c (rb_big_divide), numeric.c (fix_divide): check for result
- domain. [ruby-dev:34559]
+ * ext/dbm/dbm.c (Init_dbm): defines DBM::VERSION even when
+ DB_VERSION_STRING is not available. [ruby-dev:34569]
Thu May 1 23:57:06 2008 James Edward Gray II <jeg2@ruby-lang.org>
+ Merged 16257 from trunk.
+
* lib/net/telnet.rb: This patch from Brian Candler adds a FailEOF mode which
- can be activated to have net/telnet raise EOFError exceptions when the
+ can be activated to have net/telnet raise EOFError exceptions when the
remote connection is closed. The default behavior remains unchanged though.
Thu May 1 23:43:21 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
@@ -23991,1090 +1673,663 @@ Thu May 1 23:43:21 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* range.c (range_step): allow float step bigger than zero but less
than one. [ruby-dev:34557]
-Thu May 1 23:20:12 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * bignum.c (rb_big_divide): return an integer for idiv.
- [ruby-dev:34553]
-
-Thu May 1 20:47:30 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * hash.c (rb_hash_s_create): should access converted hash value.
- [ruby-dev:34555]
-
-Thu May 1 20:31:09 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * test/ruby/test_parse.rb (TestParse::test_void_expr_stmts_value):
- shut up warning.
+Wed Apr 30 20:22:40 2008 James Edward Gray II <jeg2@ruby-lang.org>
- * rational.c (nurat_to_f): no need for forceful warning when
- converting to float. overflow is a nature of float values.
+ Merged 16241 from trunk.
-Thu May 1 16:10:21 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * hash.c (env_delete_if): return enumerator if no block given.
- [ruby-dev:34554]
-
-Wed Apr 30 21:36:40 2008 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
-
- * lib/erb.rb (url_encode): [ruby-dev:34497] ERB::Util#url_encode
- bug fix. Reported by rubikitch.
-
- * test/erb/test_erb.rb: ditto
-
-Wed Apr 30 20:11:36 2008 James Edward Gray II <jeg2@ruby-lang.org>
-
- * lib/net/telnet.rb: Fixing a bug where line endings would not be properly
+ * lib/net/telnet.rb: Fixing a bug where line endings would not be properly
escaped when the two character ending was broken up into separate TCP
packets. Issue reported and patched by Brian Candler.
-Wed Apr 30 18:03:01 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * load.c (rb_load_path), vm_core.h (rb_vm_t): moved to VM.
-
- * load.c (rb_get_load_path): returns absolute load path.
-
- * load.c (load_path_getter): $LOAD_PATH getter.
-
- * file.c (rb_find_file_ext, rb_find_file), ruby.c (push_include,
- ruby_init_loadpath): use the accessor.
-
- * vm.c (rb_vm_mark): mark load_path.
-
Wed Apr 30 17:47:21 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* re.c (rb_reg_search): use local variable. a patch from wanabe
<s.wanabe AT gmail.com> in [ruby-dev:34537]. [ruby-dev:34492]
-Wed Apr 30 16:10:18 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * eval_intern.h: specify the values of the enumeration constants
- explicitly. [ruby-dev:34489]
-
-Wed Apr 30 12:32:39 2008 Tanaka Akira <akr@fsij.org>
-
- * process.c (check_exec_redirect_fd): prohibit duplex IO.
- (check_exec_fds): record maxhint even if close_others is not
- specified.
- (rb_exec_arg_fixup): renamed from rb_exec_arg_fix.
-
-Mon Apr 28 20:24:27 2008 Tadayoshi Funaba <tadf@dotrb.org>
-
- * rational.c (nurat_marshal_load): checks the given
- denominator. [ruby-dev:34536]
-
-Mon Apr 28 14:21:18 2008 Tanaka Akira <akr@fsij.org>
-
- * include/ruby/ruby.h (POSFIXABLE): use FIXNUM_MAX+1 instead of
- FIXNUM_MAX to make it possible to convert to double accurately on
- environments with 64bit VALUE and 64bit double.
- It assumes FLT_RADIX is 2.
- fix RubyForge bug #14102.
-
-Mon Apr 28 12:48:57 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * process.c (rb_exec_arg_addopt, rb_exec_arg_addopt): now can specify
- close_exec on having no fork environment (but still meaningless).
-
-Mon Apr 28 11:11:29 2008 Tanaka Akira <akr@fsij.org>
-
- * process.c (run_exec_options): don't call FIX2INT for nil.
-
-Mon Apr 28 11:11:38 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * proc.c (method_name): should return symbols instead of strings.
- [ruby-dev:34531]
-
-Mon Apr 28 09:02:43 2008 Tanaka Akira <akr@fsij.org>
-
- * include/ruby/intern.h (rb_exec_arg_init): declared.
- (rb_exec_arg_addopt): declared.
- (rb_exec_arg_fix): declared.
- (rb_exec_initarg): removed.
- (rb_exec_getargs): removed.
- (rb_exec_initarg2): removed.
-
- * io.c (struct popen_arg): make execarg as a pointer.
- (popen_exec): follow popen_arg change.
- (pipe_open): add eargp argument. extract argc and argv from eargp.
- use rb_exec_arg_addopt to add redirect options.
- (pipe_open_v): set up struct rb_exec_arg.
- (pipe_open_s): set up struct rb_exec_arg.
-
- * process.c (rb_exec_arg_addopt): new function extracted from
- check_exec_options_i.
- (check_exec_options_i): use rb_exec_arg_addopt.
- (rb_check_exec_options): opthash is always a hash now.
- (rb_exec_getargs): make it static.
- (rb_exec_fillarg): renamed from rb_exec_initarg2. don't set up
- redirect_fds.
- (rb_exec_arg_init): new function.
- (rb_exec_arg_fix): new function.
- (rb_f_exec): use rb_exec_arg_init and rb_exec_arg_fix. use
- rb_exec_arg_addopt to set close_others option.
- (run_exec_options): make close_others by default.
- (rb_spawn_internal): use rb_exec_arg_init and rb_exec_arg_fix. use
- rb_exec_arg_addopt to set close_others option.
-
-Sun Apr 27 18:59:04 2008 Tadayoshi Funaba <tadf@dotrb.org>
-
- * rational.c (nurat_expt): use f_rational_new2. [ruby-dev:34524]
-
-Sun Apr 27 15:23:40 2008 Koichi Sasada <ko1@atdot.net>
-
- * gc.c (gc_count): add a GC.count method. This method returns
- a GC invoking count.
-
-Sun Apr 27 12:20:33 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * vm_core.h (rb_vm_t), gc.c (rb_objspace, rb_newobj), vm.c
- (Init_BareVM): per-VM object space support, which is disabled now.
-
- * gc.c (rb_objspace_alloc), vm.c (Init_BareVM): should not use ruby
- malloc here.
-
- * gc.c (garbage_collect, etc): performance improvement by passing the
- reference instead of referring the global variable in each functions.
-
-Sun Apr 27 08:06:15 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * ruby.c (ruby_set_argv): ARGV should be locale encoding.
- [ruby-list:44861]
-
-Sun Apr 27 01:46:29 2008 Tanaka Akira <akr@fsij.org>
-
- * lib/open3.rb (Open3.popen3w): removed.
- (Open3.popen3): notice wait_thr.
-
-Sun Apr 27 01:13:05 2008 Eric Hodel <drbrain@segment7.net>
-
- * lib/rdoc, test/rdoc: Update to RDoc 2.0.0 r56.
-
-Sat Apr 26 21:30:40 2008 Tanaka Akira <akr@fsij.org>
-
- * include/ruby/intern.h (rb_hash_dup): declared.
-
- * hash.c (rb_hash_dup): new function.
-
- * process.c (rb_spawn_internal): don't modify option hash.
-
-Sat Apr 26 18:36:31 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * io.c, signal.c, thread.c, thread_win32.c, include/ruby/intern.h:
- suppress warnings.
-
-Sat Apr 26 17:42:30 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * error.c (builtin_types), gc.c (count_objects): added Complex and
- Rational.
-
-Sat Apr 26 17:35:19 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * error.c (rb_eNOERROR): renamed.
-
-Sat Apr 26 17:30:11 2008 Koichi Sasada <ko1@atdot.net>
-
- * include/ruby/ruby.h, gc.c: remove T_BLOCK.
-
- * include/ruby/ruby.h: re-number T_xxx.
-
-Sat Apr 26 17:31:09 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * process.c (rb_cProcessTms, rb_cProcessStatus): renamed.
+Sat Apr 26 19:40:34 2008 Guy Decoux <decoux@moulon.inra.fr>
- * error.c (builtin_types), signal.c (siglist), st.c (primes),
- struct.c (ref_func), time.c (months): constified.
+ * class.c (struct clone_method_data): Add cref.
+ (clone_method): Properly handle NODE_BMETHOD and NODE_DMETHOD.
+ (rb_singleton_class_clone, singleton_class_clone_int): Set a
+ proper value to klass and propagate cref. [ruby-core:16238]
-Sat Apr 26 13:00:41 2008 Tanaka Akira <akr@fsij.org>
+ * eval.c (rb_block_dup, rb_method_dup), intern.h: Add duplicator
+ methods for use from class.c#clone_method().
- * lib/open3.rb: double fork is replaced by spawn with Process.detach.
- (Open3.popen3w): new method to access the thread returned by
- Process.detach.
+Fri Apr 25 15:46:37 2008 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-Sat Apr 26 00:47:43 2008 Tanaka Akira <akr@fsij.org>
+ * ext/tk/lib/tk.rb, ext/tk/lib/tk/scrollbar.rb, ext/tk/lib/tk/scale.rb:
+ improve unknonw-option check when create a widget.
- * process.c (rb_spawn_internal): new function to specify
- default_close_others.
- (rb_spawn): specify default_close_others true.
- (rb_f_system): call rb_spawn_internal with default_close_others as
- false.
+ * ext/tk/lib/tkextlib/blt/unix_dnd.rb, ext/tk/lib/tkextlib/blt/ted.rb,
+ ext/tk/lib/tkextlib/treectrl/tktreectrl.rb: bug fix on 'cget'.
-Sat Apr 26 12:26:41 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * ext/tk/lib/tk/menuspec.rb: option check will fail when
+ TkConfigMethod.__IGNORE_UNKNOWN_CONFIGURE_OPTION__ is true.
- * range.c (range_each): use INT2FIX() for fixnum values.
+ * ext/tk/lib/tk/palette.rb: bug fix.
-Fri Apr 25 17:56:25 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
+Fri Apr 25 12:37:54 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * gc.c (free_unused_heaps): preserve last used heap segment to
- reduce malloc() call.
+ * array.c (flatten): returns an instance of same class.
+ [ruby-core:16554]
-Fri Apr 25 17:54:10 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
+Thu Apr 24 23:47:50 2008 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
- * gc.c (HEAP_SIZE): use smaller heap segment (2K) for more chance
- to be freed. based on patch from authorNari <authornari at gmail.com>.
+ * lib/net/pop.rb: backported from 1.9. bug#19003
- * gc.c (rb_newobj_from_heap): eventually allocate heap segments.
+ * ext/openssl/lib/openssl/ssl.rb: set_params; backported from 1.9.
+ bug#19552, [ruby-dev:34402]
-Fri Apr 25 15:35:36 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/openssl/ossl_ssl.c: ditto.
- * process.c (rb_spawn): rb_exec_initarg() returns new argc and argv in
- earg.
+ * test/openssl/test_ssl.rb: ditto.
-Fri Apr 25 12:37:54 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Apr 24 17:06:34 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
- * array.c (flatten): returns an instance of same class.
- [ruby-core:16554]
-
-Fri Apr 25 10:52:27 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * include/ruby/win32.h: define mode_t for umask.
-
- * process.c (check_exec_options_i, check_exec_fds, run_exec_options):
- support "close_others" only when fork(2) is available.
-
-Fri Apr 25 00:16:11 2008 Tanaka Akira <akr@fsij.org>
-
- * process.c: include sys/stat.h for umask.
-
-Thu Apr 24 23:25:17 2008 Tanaka Akira <akr@fsij.org>
-
- * include/ruby/intern.h (rb_env_clear): declared.
- (rb_io_mode_modenum): declared.
- (rb_close_before_exec): declared.
- (struct rb_exec_arg): add options and redirect_fds field.
- (rb_check_argv): removed.
- (rb_exec_initarg): declared.
- (rb_exec_getargs): declared.
- (rb_exec_initarg2): declared.
- (rb_fork): add third argument: fds.
-
- * io.c (max_file_descriptor): new static variable to record maximum
- file descriptor ruby used.
- (UPDATE_MAXFD): new macro.
- (UPDATE_MAXFD_PIPE): new macro.
- (rb_io_mode_modenum): externed.
- (rb_sysopen): update max_file_descriptor.
- (rb_close_before_exec): new function.
- (popen_exec): redirection removed because it is done by extended
- spawn mechanism.
- (pipe_open): generate a hash for spawn options to specify
- redirections.
- (pipe_open_v): use rb_exec_getargs.
- (pipe_open_s): use rb_exec_getargs.
- (rb_io_initialize): update max_file_descriptor.
-
- * process.c (hide_obj): new function.
- (check_exec_redirect_fd): new function.
- (check_exec_redirect): new function.
- (check_exec_options_i): new function.
- (check_exec_fds): new function.
- (rb_check_exec_options): new function.
- (check_exec_env_i): new function.
- (rb_check_exec_env): new function.
- (rb_exec_getargs): new function.
- (rb_exec_initarg2): new function.
- (rb_exec_initarg): new function.
- (rb_f_exec): use rb_exec_initarg.
- (intcmp): new function.
- (run_exec_dup2): new function.
- (run_exec_close): new function.
- (run_exec_open): new function.
- (run_exec_pgroup): new function.
- (run_exec_rlimit): new function.
- (run_exec_options): new function.
- (rb_exec): call run_exec_options.
- (move_fds_to_avoid_crash): new function.
- (pipe_nocrash): new function.
- (rb_fork): use pipe_nocrash to avoid file descriptor conflicts.
- (rb_spawn): use rb_exec_initarg.
- (rlimit_resource_name2int): extracted from rlimit_resource_type.
- (rlimit_type_by_hname): new function.
- (rlimit_type_by_lname): new function.
- (rlimit_resource_type): use rlimit_type_by_hname.
- (proc_daemon): add fds argument for rb_fork.
-
- * hash.c (rb_env_clear): renamed from env_clear and externed.
-
- [ruby-dev:34086]
-
-Thu Apr 24 23:00:58 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * test/ruby/test_thread.rb: fix typos.
-
- * test/ruby/envutil.rb (rubyexec): move Open3.popen3 call into timeout
- block.
-
-Thu Apr 24 22:34:52 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * test/ruby/test_comparable.rb: new tests for Comparable, to achieve
- 100% test coverage of compar.c.
-
-Thu Apr 24 17:19:01 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * ruby.c (process_options): set safe_level before loading script.
- [ruby-dev:34421]
+ * eval.c (THREAD_SAVE_CONTEXT): remove unnecessary
+ FLUSH_REGISTER_WINDOWS before calling setjmp(). [ruby-core:16285]
Thu Apr 24 14:15:11 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* dln.c (dln_find_1): prior files with extensions to files sans
extensions. [ruby-core:16517]
-Thu Apr 24 00:26:06 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * lib/rdoc/ri/descriptions.rb: fixed wrong class nestings.
-
-Thu Apr 24 00:20:01 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * test/ruby/test_settracefunc.rb: add a test for set_trace_func.
-
- * test/ruby/envutil.rb: move "rubyexec" method from test_rubyoptions.rb.
+Wed Apr 23 15:39:31 2008 Akinori MUSHA <knu@iDaemons.org>
- * test/ruby/test_rubyoptions.rb: use rubyexec in envutil.rb.
-
- * test/ruby/test_thread.rb: add tests to achieve over 90% test coverage
- of thread.c.
+ * eval.c (bind_eval): Add Binding#eval, a shorthand method for
+ eval(str, binding, ..); backported from 1.9.
Wed Apr 23 15:28:52 2008 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
* test/gdbm/test_gdbm.rb (TestGDBM#test_s_open_no_create): failed
notice moved from comment to assertion message. [ruby-dev:29127]
+Wed Apr 23 14:00:05 2008 Akinori MUSHA <knu@iDaemons.org>
+
+ * lib/mkmf.rb (create_makefile): Add a missing dependency on the
+ target directory for each .rb file. This will hopefully fix
+ parallel make (-jN). Tested on FreeBSD.
+
Wed Apr 23 11:49:54 2008 Akinori MUSHA <knu@iDaemons.org>
* lib/set.rb (Set#each, SortedSet#each, TC_Set#test_each): Return
an enumerator if no block is given.
-Wed Apr 23 00:36:03 2008 Yusuke Endoh <mame@tsg.ne.jp>
+Wed Apr 23 00:42:49 2008 Tanaka Akira <akr@fsij.org>
- * test/openssl/test_ssl.rb (start_server): add timeout to server.join.
+ * eval.c (error_print): show full stack grace except SystemStackError.
+ backport from 1.9. [ruby-dev:31014]
Wed Apr 23 00:18:45 2008 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
* test/ruby/test_symbol.rb (TestSymbol#test_to_proc): Improve
tests of Symbol#to_proc.
-Tue Apr 22 22:40:57 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/drb/drb.rb (DRb::DRbServer::check_insecure_method): should
- check method names by symbols, not by strings. a patch from
- Kazuhiro NISHIYAMA <zn at mbf.nifty.com> in [ruby-dev:34487].
-
-Tue Apr 22 22:15:54 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * misc/ruby-style.el (ruby-style-{case,label}-indent): up list from
- indentation point.
-
-Tue Apr 22 21:09:05 2008 NARUSE, Yui <naruse@ruby-lang.org>
+Tue Apr 22 22:43:05 2008 Akinori MUSHA <knu@iDaemons.org>
- * ext/nkf/nkf-utf8/nkf.c (score_table_A0, score_table_F0):
- type of content is unsigned char.
+ * eval.c (rb_proc_new, YIELD_FUNC_LAMBDA): Add a new nd_state
+ YIELD_FUNC_LAMBDA which avoids automatic `avalue' conversion for
+ arguments. This fixes a bug where [1,[2,3]].map(&:object_id)
+ fails.
- * ext/nkf/nkf-utf8/nkf.c (push_broken_buf): 'c' is nkf_char.
+ * intern.h, object.c: Hide rb_proc_new() from intern.h. It should
+ not be considered an official API function yet.
- * ext/nkf/nkf-utf8/nkf.c (push_broken_buf): enc is 0 or pointer.
+Tue Apr 22 21:24:32 2008 Akinori MUSHA <knu@iDaemons.org>
- * ext/nkf//nkf.c (options): type of option is unsigned char.
+ * eval.c (rb_proc_new): Turn the BLOCK_LAMBDA flag on.
-Tue Apr 22 20:51:58 2008 NARUSE, Yui <naruse@ruby-lang.org>
+ * object.c (sym_to_proc), test/ruby/test_symbol.rb: Add back
+ Symbol#to_proc, now that it passes the tests.
- * ext/nkf/nkf-utf8/nkf.c (z_conv): characters must be nkf_char.
-
-Tue Apr 22 19:23:05 2008 Akinori MUSHA <knu@iDaemons.org>
+Tue Apr 22 19:35:03 2008 Akinori MUSHA <knu@iDaemons.org>
* enumerator.c (enumerator_initialize): Remove an undocumented
feature (passing a block to the constructor) that's broken.
This is not what I intended.
-Tue Apr 22 17:54:05 2008 URABE Shyouhei <shyouhei@ruby-lang.org>
-
- * vm_core.h (exec_event_hooks): ``inline'' is a type modifier, not
- a type itself.
-
-Tue Apr 22 16:24:27 2008 URABE Shyouhei <shyouhei@ruby-lang.org>
-
- * string.c (rb_enc_cr_str_buf_cat): do not use C++ comments.
-
-Tue Apr 22 16:23:53 2008 URABE Shyouhei <shyouhei@ruby-lang.org>
-
- * configure.in: use AC_USE_SYSTEM_EXTENSIONS.
-
-Tue Apr 22 16:23:16 2008 URABE Shyouhei <shyouhei@ruby-lang.org>
-
- * vm_evalbody.c (DECL_SC_REG): use __asm__ instead.
-
-Tue Apr 22 16:18:30 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * vm_evalbody.c (DECL_SC_REG): typo fixed.
-
-Tue Apr 22 15:25:04 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Apr 22 17:49:46 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
- * configure.in (struct timespec): needs time.h according to POSIX.
+ * sprintf.c (rb_f_sprintf): should protect temporary string from
+ GC. [ruby-dev:34480]
-Tue Apr 22 13:19:48 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
+Tue Apr 22 17:12:05 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
- * thread.c (rb_thread_stop_timer_thread): should clear
- timer_thread_id after stopping it.
+ * regex.c (re_search): string might be NULL. [ruby-core:16478]
-Tue Apr 22 13:12:58 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Apr 22 16:44:00 2008 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
- * thread.c (thread_join): remove the current thread from the join list
- of the target thread.
+ * object.c (rb_obj_tap): Correct documentation; pointed out by
+ okkez in [ruby-dev:34472].
-Tue Apr 22 12:03:50 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * vm_insnhelper.c (vm_get_ev_const): search from the base klass if it
- is given.
-
-Tue Apr 22 09:58:13 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * ext/win32ole/win32ole.c: avoid warnings.
-
-Tue Apr 22 09:56:51 2008 NAKAMURA Usaku <usa@ruby-lang.org>
+Tue Apr 22 10:05:51 2008 NAKAMURA Usaku <usa@ruby-lang.org>
* file.c (eaccess): workaround for recent msvcrt's behavior.
[ruby-core:16460]
-Mon Apr 21 19:08:32 2008 Tanaka Akira <akr@fsij.org>
-
- * io.c (copy_stream_body): call rb_io_check_readable and
- rb_io_check_writable.
-
-Mon Apr 21 17:45:27 2008 Akinori MUSHA <knu@iDaemons.org>
-
- * ext/dbm/dbm.c (fdbm_each_value, fdbm_each_key, fdbm_each_pair):
- GDBM#{each,each_pair,each_key,each_value}: Return an enumerator
- if no block is given.
-
- * ext/gdbm/gdbm.c (fgdbm_each_value, fgdbm_each_key,
- fgdbm_each_pair): GDBM#{each,each_pair,each_key,each_value}:
- Return an enumerator if no block is given.
-
- * ext/openssl/ossl_config.c (ossl_config_each):
- OpenSSL::Config#each: Return an enumerator if no block is given.
-
- * ext/readline/readline.c (hist_each): Readline::HISTORY#each:
- Return an enumerator if no block is given.
+Mon Apr 21 16:06:47 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
- * ext/sdbm/init.c (fsdbm_each_value, fsdbm_each_key,
- fsdbm_each_pair): SDBM#{each,each_pair,each_key,each_value}:
- Return an enumerator if no block is given.
+ * enumerator.c (enumerator_init): preserve the method name in ID.
- * ext/stringio/stringio.c (strio_each_byte, strio_each):
- StringIO#{each,each_line,each_byte}: Return an enumerator if no
- block is given.
+ * enumerator.c (enumerator_each): need not to call rb_to_id().
- * ext/stringio/stringio.c (Init_stringio): Add #lines and #bytes,
- which are aliases to #each_line and #each_byte, respectively.
+ * enumerator.c (enumerator_with_index): ditto.
- * ext/win32ole/win32ole.c (fole_each): WIN32OLE#each: Return an
- enumerator if no block is given.
+Mon Apr 21 17:19:52 2008 Akinori MUSHA <knu@iDaemons.org>
- * ext/zlib/zlib.c (rb_gzreader_each_byte, rb_gzreader_each):
- Zlib::GzipReader#{each,each_line,each_byte}: Return an
- enumerator if no block is given.
+ * eval.c (rb_f_method_name): New gloval function: __method__;
+ backported from matzruby / 1.9.
- * ext/zlib/zlib.c (Init_zlib): Add Zlib::GzipReader#lines and
- #bytes, which are aliases to #each_line and #each_byte,
- respectively.
+ * eval.c (rb_frame_this_func), intern.h: New internal function.
-Mon Apr 21 17:01:44 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * intern.h (RETURN_ENUMERATOR): Use rb_frame_this_func() instead
+ of rb_frame_last_func(), to accommodate the behavior to that of
+ 1.9.
- * iseq.c (rb_iseq_compile_with_option): check if src is a string.
- [ruby-core:16453]
+Mon Apr 21 15:54:48 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-Mon Apr 21 16:06:47 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * lib/tempfile.rb (Tempfile::_close): check @data before modifying
+ it; backported from 1.9. [ruby-dev:34094]
- * enumerator.c (enumerator_init): preserve the method name in ID.
+ * lib/tempfile.rb (Tempfile::close): clear @data and @tmpname.
- * enumerator.c (enumerator_each): need not to call rb_to_id().
+Mon Apr 21 10:17:17 2008 NAKAMURA Usaku <usa@ruby-lang.org>
- * enumerator.c (enumerator_with_index): ditto.
+ * time.c: should include <errno.h> to refer errno.
-Mon Apr 21 11:00:27 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
+Mon Apr 21 10:02:43 2008 NAKAMURA Usaku <usa@ruby-lang.org>
- * compile.c (defined_expr): capture exception during defined?
- evaluation. a patch from wanabe <s.wanabe at gmail.com> in
- [ruby-dev:34461]. [ruby-core:16010]
+ * hash.c (recursive_hash): prototype.
-Mon Apr 21 10:06:26 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * time.c: should include <errno.h> to refer to errno.
-
-Mon Apr 21 09:58:04 2008 NAKAMURA Usaku <usa@ruby-lang.org>
+Mon Apr 21 10:00:51 2008 NAKAMURA Usaku <usa@ruby-lang.org>
* time.c (rb_strftime): check errno to detect strftime(3)'s error.
this is workaround for recent version of MSVCRT.
[ruby-dev:34456]
-Mon Apr 21 08:54:30 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * gc.c (ruby_xmalloc): use size_t for malloc argument instead of long.
+Sun Apr 20 21:10:04 2008 Akinori MUSHA <knu@iDaemons.org>
-Sun Apr 20 21:00:21 2008 Akinori MUSHA <knu@iDaemons.org>
+ * .: Release as Ruby 1.8.7-preview2.
- * enumerator.c, include/ruby/ruby.h: Export rb_cEnumerator.
-
-Sun Apr 20 20:47:50 2008 Akinori MUSHA <knu@iDaemons.org>
+Sun Apr 20 21:02:06 2008 Akinori MUSHA <knu@iDaemons.org>
* enumerator.c: Resolve the method every time an enumeration
method is run, not once when the enumerator is initialized as it
was before, so that method_missing() and method (re)definition
afterwards are both in effect; pointed out in: [ruby-core:16441]
-Sun Apr 20 15:11:00 2008 Tanaka Akira <akr@fsij.org>
-
- * io.c (copy_stream_rbuf_to_dst): removed.
- (copy_stream_fallback_body): don't bypass write method.
- (copy_stream_body): simplified.
+Sun Apr 20 17:59:25 2008 Akinori MUSHA <knu@iDaemons.org>
-Sun Apr 20 15:01:25 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * object.c, NEWS, test/ruby/test_symbol.rb: Revert Symbol#to_proc
+ since it does not pass the tests.
- * vm_core.h (struct iseq_compile_data): moved label_no from
- new_label_body().
+Sun Apr 20 14:29:35 2008 Technorama Ltd. <oss-ruby@technorama.net>
- * compile.c (iseq_set_exception_table): allocates catch_table only
- when entries exist.
+ * ext/openssl/ossl_ssl.c: initialize session class.
- * compile.c (struct iseq_link_element, struct iseq_insn_data): made
- enum for debuggers.
+Sat Apr 19 20:54:42 2008 akira yamada <akira@arika.org>
-Sun Apr 20 14:44:45 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/uri/ftp.rb, lib/uri/generic.rb, test/uri/test_common.rb,
+ test/uri/test_ftp.rb, test/uri/test_generic.rb: backported from 1.9.
+ [ruby-dev:31318]
- * compile.c (iseq_compile_each): fix for splat in when and rescue.
- a patch from wanabe <s.wanabe AT gmail.com> in [ruby-dev:34429].
- [ruby-core:14537]
+Sat Apr 19 20:35:02 2008 Akinori MUSHA <knu@iDaemons.org>
-Sun Apr 20 13:55:37 2008 Tanaka Akira <akr@fsij.org>
+ * lib/yaml/baseemitter.rb, lib/yaml/encoding.rb: performance
+ tuning around String#gsub.
- * io.c (copy_stream_fallback): write directly (bypassing write method)
- if possible.
+ * lib/yaml/tag.rb: Replace nodoc with stopdoc so Module methods get
+ documented.
-Sun Apr 20 12:49:03 2008 Tanaka Akira <akr@fsij.org>
+ * lib/yaml/store.rb (YAML::load): modified to support empty
+ database.
- * io.c (copy_stream_fallback): read directly (bypassing readpartial
- method) if possible.
+ * lib/yaml/store.rb (YAML::Store::marshal_dump_supports_canonical_option?):
+ add a method to support faster PStore.
-Sun Apr 20 04:45:13 2008 Tanaka Akira <akr@fsij.org>
+Sat Apr 19 20:16:52 2008 Akinori MUSHA <knu@iDaemons.org>
- * io.c (copy_stream_body): use readpartial and write method for
- non-IOs such as StringIO and ARGF.
+ * lib/yaml/types.rb: Likewise, pass self to YAML::quick_emit;
+ merged from 1.9.
-Fri Apr 18 20:57:33 2008 Yusuke Endoh <mame@tsg.ne.jp>
+ * lib/yaml.rb (quick_emit): use combination of object_id and hash to
+ identify repeated object references, since GC will reuse memory of
+ objects during output of YAML. [ruby-Bugs-8548] [ruby-Bugs-3698];
+ merged from 1.9.
- * test/ruby/test_array.rb: add tests to achieve over 95% test coverage
- of array.c.
+Sat Apr 19 20:05:39 2008 Akinori MUSHA <knu@iDaemons.org>
-Fri Apr 18 17:37:48 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * array.c (rb_ary_equal, rb_ary_eql, rb_ary_hash, rb_ary_cmp):
+ Make Array#eql?, #hash, #== and #<=> use rb_exec_recursive() and
+ handle recursive data properly.
- * gc.c (rb_gc_mark_locations): get rid of underflow.
+ * hash.c (hash_equal, rb_hash_hash): Make Hash#eql?, #hash and #==
+ use rb_exec_recursive() and handle recursive data properly.
- * gc.c (mark_current_machine_context): check if the main thread stack
- position may shrink under the initialized position. [ruby-core:16436]
+Sat Apr 19 19:26:09 2008 Akinori MUSHA <knu@iDaemons.org>
-Thu Apr 17 22:20:52 2008 Yusuke Endoh <mame@tsg.ne.jp>
+ * intern.h, eval.c (rb_exec_recursive): New internal function to
+ help perform recursive operation; backported from 1.9.
- * enc/trans/utf_16_32.c (fun_so_to_utf_16be, fun_so_to_utf_16le): add
- parentheses to remove warnings of gcc.
+Sat Apr 19 18:42:04 2008 Akinori MUSHA <knu@iDaemons.org>
- * io.c (rb_io_getc): remove unused variables.
+ * intern.h, hash.c (rb_hash_lookup): New internal function to
+ check if a key exists in a hash, ignoring #default; backported
+ from 1.9.
- * compile.c (NODE_NEXT, NODE_REDO): remove unused labels.
+Fri Apr 18 18:56:57 2008 Akinori MUSHA <knu@iDaemons.org>
- * ext/nkf/nkf.c (rb_nkf_convert): remove unused variables.
+ * ext/syck/rubyext.c (syck_genericresolver_node_import): should
+ not set instance variable "@kind" before initializing it.
+ [ruby-dev:32677]
* ext/syck/rubyext.c (syck_resolver_initialize,
syck_resolver_detect_implicit, syck_emitter_emit): remove unused
variables.
-Thu Apr 17 20:12:47 2008 Yusuke Endoh <mame@tsg.ne.jp>
+Fri Apr 18 18:54:57 2008 Akinori MUSHA <knu@iDaemons.org>
- * test/ruby/test_rubyoptions.rb (test_search): enable some assertions.
-
- * test/ruby/test_rubyoptions.rb: flunk message in win32.
-
-Thu Apr 17 16:07:12 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/syck/rubyext.c: Node#value defined twice.
- * test/ruby/test_rubyoptions.rb (ruby): run in C locale.
+ * lib/yaml/: several method redefinitions causing warnings.
- * test/ruby/test_rubyoptions.rb (test_encoding): --encoding does not
- affect source code.
+Fri Apr 18 16:36:16 2008 Akinori MUSHA <knu@iDaemons.org>
-Thu Apr 17 00:45:41 2008 Yusuke Endoh <mame@tsg.ne.jp>
+ * lib/rexml/node.rb (REXML::Node::indent): should initialize rv
+ variable. a patch from Tadayoshi Funaba <tadf AT dotrb.org> in
+ [ruby-dev:32783].
- * test/ruby/test_process.rb (test_rlimit_nofile): reset RLIMIT_NOFILE
- before exit (for gcov).
+Fri Apr 18 16:01:37 2008 Akinori MUSHA <knu@iDaemons.org>
- * test/ruby/test_rubyoptions.rb: new tests for option of ruby
- interpreter, to achieve over 95% test coverage of ruby.c.
+ * lib/rexml: Merge fixes since 1.8.6 made solely on the ruby_1_8_6
+ branch.
-Wed Apr 16 02:40:44 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Apr 16 06:11:49 2008 Akinori MUSHA <knu@iDaemons.org>
- * ruby.c (process_options): preludes and parser need to run in safe
- level 0. [ruby-dev:34407]
+ * test/ruby/test_settracefunc.rb (TestSetTraceFunc#test_event):
+ Fix tests to reflect the following changes: r15833, r15759.
-Wed Apr 16 02:26:27 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Apr 16 05:03:48 2008 Akinori MUSHA <knu@iDaemons.org>
- * ruby.c (process_options): dln_find_file returns the pointer to a
- static buffer, so should copy it. [ruby-dev:34409]
+ * .: Release as Ruby 1.8.7-preview1.
-Tue Apr 15 23:08:46 2008 Kouhei Sutou <kou@cozmixng.org>
+Wed Apr 16 02:09:14 2008 Kouhei Sutou <kou@cozmixng.org>
* lib/xmlrpc/client.rb: fix cookie handling. [ruby-dev:34403]
* test/xmlrpc/test_cookie.rb: add a test for the above fix.
-Tue Apr 15 19:20:14 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * io.c: #undef rb_argv moved before #define.
-
-Tue Apr 15 18:02:17 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * include/ruby/intern.h (rb_argv): replaced with rb_get_argv().
- [ruby-Bugs-19514]
-
-Tue Apr 15 17:10:59 2008 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+Tue Apr 15 23:48:28 2008 Akinori MUSHA <knu@iDaemons.org>
- * lib/net/http.rb, lib/net/smtp.rb, lib/net/pop.rb: update
- URLs of Japanese documents.
+ * version.h: Branch off ruby_1_8_7 from ruby_1_8 in preparation
+ for the forthcoming 1.8.7 release.
-Tue Apr 15 16:45:14 2008 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+Tue Apr 15 23:40:39 2008 Akinori MUSHA <knu@iDaemons.org>
- * test/ruby/test_symbol.rb (TestSymbol#test_to_proc): add tests.
-
-Tue Apr 15 15:38:02 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * misc/ruby-mode.el (ruby-encoding-map): added shift-jis for older
- versions.
+ * ext/syck/rubyext.c (rb_syck_mktime): Avoid buffer overflow.
- * misc/ruby-mode.el (ruby-mode-set-encoding):
- coding-system-to-mime-charset is not a standard function.
- [carbon-emacs:795]
- fix for the case that magic comment exists but coding system is
- absent.
+Tue Apr 15 20:32:03 2008 Tanaka Akira <akr@fsij.org>
- * misc/ruby-mode.el (ruby-mode): use write-contents-functions or
- write-contents-hooks for older versions.
+ * re.c (match_inspect): backported from 1.9.
-Tue Apr 15 07:21:21 2008 Tadayoshi Funaba <tadf@dotrb.org>
+Tue Apr 15 19:03:28 2008 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
- * complex.c (nucomp_div): [ruby-dev:34357]
+ * eval.c (method_receiver, method_name, method_owner): New
+ methods; backported from 1.9. bug#19007
- * complex.c (nucomp_abs): use hypot.
+Tue Apr 15 18:39:14 2008 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
- * complex.c (nucomp_quo): do not force conversion.
-
- * test/ruby/test_complex.rb: omitted some meaningless tests.
+ * lib/uri.rb, lib/uri/ldaps.rb: added LDAPS
+ scheme; backported from 1.9. bug#19015, [ruby-dev:31896]
-Mon Apr 14 23:25:50 2008 Yusuke Endoh <mame@tsg.ne.jp>
+Tue Apr 15 17:45:43 2008 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
- * test/ruby/test_objectspace.rb: add a test for
- ObjectSpace.count_objects.
+ * lib/net/smtp.rb: backported from 1.9. bug#19003
-Mon Apr 14 22:44:24 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
+Tue Apr 15 17:06:12 2008 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
- * file.c (SET_EXTERNAL_ENCODING): avoid call rb_enc_check() on
- half-baked result string.
+ * test/ruby/test_symbol.rb (TestSymbol#test_to_proc): add tests.
- * re.c (rb_reg_search): make search reentrant. [ruby-dev:34223]
+Tue Apr 15 16:58:55 2008 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
- * test/ruby/test_parse.rb (TestParse::test_global_variable):
- should preserve $& variable.
+ * ext/tk/lib/tk/menuspec.rb: option check will fail when
+ TkConfigMethod.__IGNORE_UNKNOWN_CONFIGURE_OPTION__ is true.
-Mon Apr 14 17:23:27 2008 Akinori MUSHA <knu@iDaemons.org>
+ * ext/tk/lib/tk/palette.rb: bug fix.
- * hash.c (rb_hash_delete_if, rb_hash_reject_bang, env_delete_if,
- env_reject_bang): Return an enumerator if no block is given.
+Tue Apr 15 16:47:48 2008 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-Mon Apr 14 14:33:59 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * signal.c, gc.c: New methods: GC.stress, GC.stress=;
+ backported from 1.9. a patch from Tadashi Saito
+ in [ruby-dev:34394] and bug#19000
- * compile.c, compile.h (compile_debug): made runtime option.
+Tue Apr 15 12:35:44 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * debug.c (ruby_debug_print_indent): returns if debug_level exceeds
- the threshold.
+ * rubyio.h (rb_io_t): renamed from OpenFile.
- * debug.c (ruby_debug_printf): printf to stderr.
+ * ruby.h (struct RHash), file.c, gc.c, io.c, ext/dl/dl.c,
+ ext/io/wait/wait.c, ext/pty/pty.c, ext/readline/readline.c,
+ ext/socket/socket.c: ditto.
- * iseq.c (make_compile_option, make_compile_option_value): added
- debug_level option.
+ * win32/win32.h: removed workaround for OpenFile.
- * vm_core.h (rb_compile_option_t): added debug_level.
+Tue Apr 15 00:15:29 2008 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
- * vm_core.h (struct iseq_compile_data): added node_level.
+ * ext/tk/lib/tk/text.rb: typo. call a wrong method.
-Mon Apr 14 12:52:25 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/tk/lib/tk/itemconfig.rb: ditto.
- * gc.c (Init_stack): use ruby_init_stack. [ruby-dev:34350]
+ * ext/tk/sample/ttk_wrapper.rb: bug fix.
- * gc.c (rb_objspace_t): packed globals. [ruby-dev:34348]
+ * ext/tk/sample/tktextio.rb: add binding for 'Ctrl-u' at console mode.
- * gc.c (finalizers): removed. [ruby-dev:34349]
+ * ext/tk/lib/tk.rb, ext/tk/lib/tk/itemfont.rb, ext/tk/lib/font.rb:
+ support __IGNORE_UNKNOWN_CONFIGURE_OPTION__ about font options.
-Mon Apr 14 11:30:07 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * ext/tk/lib/tkextlib/iwidgets/scrolledcanvas.rb,
+ ext/tk/lib/tkextlib/iwidgets/scrolledlistbox.rb,
+ ext/tk/lib/tkextlib/iwidgets/scrolledtext.rb: bug fix.
- * array.c (ary_new): new integer overflow check condition.
- suggested by TOYOFUKU Chikanobu <nobu_toyofuku at nifty.com> in
- [ruby-dev:34156].
+ * ext/tk/lib/tkextlib/tile/tpaned.rb: improve TPaned#add.
- * array.c (rb_ary_initialize): ditto.
+ * ext/tk/lib/tk/timer.rb: add TkTimer#at_end(proc) to register the
+ procedure which called at end of the timer.
-Mon Apr 14 00:51:40 2008 Yusuke Endoh <mame@tsg.ne.jp>
+Mon Apr 14 19:54:21 2008 Akinori MUSHA <knu@iDaemons.org>
- * test/ruby/test_parse.rb: add tests to achieve over 95% test coverage
- of parse.y.
+ * array.c (rb_ary_flatten, rb_ary_flatten_bang): Take an optional
+ argument that determines the level of recursion to flatten;
+ backported from 1.9.
-Sun Apr 13 23:53:58 2008 Akinori MUSHA <knu@iDaemons.org>
+ * array.c (rb_ary_shuffle_bang, rb_ary_shuffle, rb_ary_choice,
+ rb_ary_cycle, rb_ary_permutation, rb_ary_combination,
+ rb_ary_product, rb_ary_take, rb_ary_take_while, rb_ary_drop,
+ rb_ary_drop_while): New methods: Array#shuffle, #shuffle!,
+ #choice, #cycle, #permutation, #combination, #product, #take,
+ #take_while, #drop, #drop_while; backported from 1.9.
- * enum.c (enum_cycle): Make Enumerable#cycle do a finite loop when
- the number of cycles is specified.
+Mon Apr 14 19:52:35 2008 Akinori MUSHA <knu@iDaemons.org>
- * array.c (rb_ary_cycle): Ditto for Array#cycle.
+ * ruby.h: New macro: RB_GC_GUARD().
-Sun Apr 13 18:52:27 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Apr 14 19:49:35 2008 Akinori MUSHA <knu@iDaemons.org>
- * thread_pthread.c (lock_func): should not check interrupts in
- blocking region. [ruby-dev:34378]
+ * random.c (rb_genrand_int32, rb_genrand_real), intern.h: Export.
-Sat Apr 12 12:41:49 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * string.c (rb_str_tmp_new), intern.h: New function.
- * eval.c (ruby_exec_node, ruby_run_node), ruby.c (process_options):
- use iseq instead of NODE.
+Mon Apr 14 19:18:55 2008 NAKAMURA Usaku <usa@ruby-lang.org>
- * gc.c (source_filenames): removed.
+ * enum.c (inject_i, inject_op_i): prototype.
- * include/ruby/intern.h, parse.y (yycompile, parser_mark, parser_free,
- ripper_initialize): rb_source_filename() is no longer used.
+Mon Apr 14 19:10:47 2008 Akinori MUSHA <knu@iDaemons.org>
- * compile.c, compile.h (ERROR_ARGS), parse.y (node_newnode, fixpos,
- parser_warn, e_option_supplied, warn_unless_e_option, range_op,
- cond0): nd_file is no longer used.
+ * enum.c New methods: Enumerable#take, #take_while, #drop and
+ #drop_while; backported from 1.9.
-Sat Apr 12 12:17:31 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
+Mon Apr 14 18:50:15 2008 Akinori MUSHA <knu@iDaemons.org>
- * prelude.rb (require_relative): move require_relative from
- lib/require_relative.rb. [ruby-core:16356]
+ * enum.c: New methods: Enumerable#one?, #none?, #minmax, #min_by,
+ #max_by, #minmax_by and #cycle; backported from 1.9.
- * lib/require_relative.rb: removed.
+ * enum.c (enum_find_index): Add support for find_index(obj);
+ [ruby-dev:34313]; backported from 1.9.
-Sat Apr 12 05:55:57 2008 Eric Hodel <drbrain@segment7.net>
+ * enum.c (enum_inject): Add support for Enumerable#inject(:binop);
+ backported from 1.9.
- * lib/rubygems*, test/rubygems*: Update to RubyGems 1.1.1 r1701.
+ * enum.c: Alias Enumerable#reject to #inject; backported from 1.9.
-Sat Apr 12 03:13:38 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Apr 14 18:14:19 2008 Akinori MUSHA <knu@iDaemons.org>
- * file.c (file_expand_path): set external encoding.
+ * enum.c (enum_find, enum_reject): Return an enumerator if no
+ block is given; backported from 1.9.
- * file.c (rb_file_s_basename, rb_file_s_dirname, rb_file_s_extname):
- copy encoding.
+ * io.c (rb_io_each_line, rb_io_each_byte, rb_io_s_foreach,
+ argf_each_line, argf_each_byte): Ditto.
-Fri Apr 11 17:35:06 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * string.c (str_gsub): Ditto.
- * enum.c (count_i): modified to shut warning up.
+Mon Apr 14 18:10:05 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-Fri Apr 11 17:25:09 2008 Akinori MUSHA <knu@iDaemons.org>
+ * enum.c (find_index_i, find_index_iter_i): add prototype for VC.
- * enum.c (count_i, count_iter_i, enum_count, enum_find_index):
- Reduce code.
+Mon Apr 14 17:55:30 2008 Akinori MUSHA <knu@iDaemons.org>
-Fri Apr 11 17:06:01 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * array.c (rb_ary_collect_bang, rb_ary_select): Return an
+ enumerator if no block is given; backported from 1.9.
- * enum.c (find_index_i): modified to shut warning up.
+ * dir.c (dir_each, dir_foreach): Ditto.
- * enum.c (find_index_iter_i): ditto.
+ * enum.c (enum_partition, enum_sort_by): Ditto.
-Fri Apr 11 16:44:43 2008 Akinori MUSHA <knu@iDaemons.org>
+ * gc.c (os_each_obj): Ditto.
- * enum.c (enum_find_index): Add support for find_index(obj);
- [ruby-dev:34313].
+ * hash.c (rb_hash_delete_if, rb_hash_reject_bang, rb_hash_select,
+ rb_hash_each_value, rb_hash_each_key, rb_hash_each_pair,
+ env_each_key, env_each_value, env_each, env_each_pair,
+ env_reject_bang, env_delete_if, env_select): Ditto.
- * array.c (rb_ary_index): Define find_index as an alias to index.
+ * numeric.c (num_step, int_upto, int_downto, int_dotimes): Ditto.
-Fri Apr 11 16:42:33 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
+Mon Apr 14 16:42:53 2008 Akinori MUSHA <knu@iDaemons.org>
- * lib/yaml/store.rb (YAML::load): modified to support empty
- database.
+ * ruby.h (rb_block_call_func): Fix prototype.
-Fri Apr 11 08:05:12 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * enumerator.c (enumerator_iter_i, enumerator_each_i): Ditto.
- * marshal.c (w_object): add volatile to avoid potential GC bug. a
- patch from Tomoyuki Chikanaga <chikanag at nippon-control-system.co.jp>
- in [ruby-dev:34312].
+Mon Apr 14 15:49:05 2008 Akinori MUSHA <knu@iDaemons.org>
-Thu Apr 10 23:08:52 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * enum.c (enum_count, enum_find_index): New methods:
+ Enumerable#count and #find_index; backported from 1.9.
- * lib/pstore.rb (PStore::dump, PStore::load): allow subclass
- overriding. [ruby-dev:34305]
+Mon Apr 14 14:16:08 2008 NAKAMURA Usaku <usa@ruby-lang.org>
- * lib/yaml/store.rb (YAML::Store::marshal_dump_supports_canonical_option?):
- add a method to support faster PStore.
+ * enumerator.c (enumerator_mark, enumerator_iter_i, enumerator_each_i,
+ enumerator_allocate): add prototype.
-Thu Apr 10 20:36:45 2008 Akinori MUSHA <knu@iDaemons.org>
+ * enumerator.c (enumerator_each_i): declare unused two arguments.
- * misc/rdebug.el, misc/README: Remove rdebug.el as per request
- from the maintainer and mention the ruby-debug project at
- RubyForge in README; bug#19043.
+Mon Apr 14 13:58:32 2008 Akinori MUSHA <knu@iDaemons.org>
-Thu Apr 10 19:41:00 2008 Akinori MUSHA <knu@iDaemons.org>
+ * string.c (rb_str_each_char): New methods: String#chars and
+ #each_char; backported from 1.9.
- * eval.c (rb_f_loop): Mention StopIteration in the document.
+Mon Apr 14 13:42:20 2008 Akinori MUSHA <knu@iDaemons.org>
-Thu Apr 10 19:23:55 2008 Akinori MUSHA <knu@iDaemons.org>
+ * string.c (rb_str_each_line, rb_str_each_byte): Reflect
+ enumerator integration. #lines and #bytes are now aliases to
+ #each_line and #each_byte, respectively.
- * array.c (rb_ary_pop_m, rb_ary_shift_m): Update documents for
- #pop() and #shift().
+Mon Apr 14 13:19:36 2008 Akinori MUSHA <knu@iDaemons.org>
- * array.c (rb_ary_slice_bang): Update document. Assigning
- array[*args]= nil no longer removes elements.
+ * range.c (range_each, range_step): Return an enumerator if no
+ block is given; backported from 1.9.
-Thu Apr 10 16:58:44 2008 Tanaka Akira <akr@fsij.org>
+ * struct.c (rb_struct_each, rb_struct_each_pair): Ditto.
- * marshal.c (w_object): TYPE_USERDEF assigns id for ivars first.
- [ruby-dev:34159] by nagachika.
+Mon Apr 14 13:07:59 2008 Akinori MUSHA <knu@iDaemons.org>
-Thu Apr 10 15:03:47 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * string.c (rb_str_partition, rb_str_rpartition,
+ rb_str_start_with, rb_str_end_with): New methods:
+ String#partition, #rpartition, #start_with? and #end_with?;
+ backported from 1.9. These methods are $KCODE aware unlike
+ #index, #rindex and #include?.
- * lib/generator.rb: removed obsolete library. [ruby-core:16233]
+Sun Apr 13 15:55:52 2008 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
- * test/test_generator.rb: removed as well. [ruby-dev:34306]
+ * object.c (sym_to_proc): new method Symbol#to_proc; backported
+ from 1.9. bug#19012
- * lib/pstore.rb: replaced by Hongli Lai's faster version.
+Fri Apr 11 19:14:30 2008 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-Thu Apr 10 10:27:24 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * object.c (rb_obj_tap): new method Object#tap; backported from
+ 1.9. bug#19008
- * thread_pthread.c (native_sleep): sleep_cond is initialized at
- creation. [ruby-Patches-19361].
+Fri Apr 11 18:58:09 2008 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-Wed Apr 9 14:43:26 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * process.c: new method Process.exec; backported from 1.9. bug#19006
- * thread.c (lock_func): optimized and checks for interrupt_flag.
- based on a patch from Sylvain Joyeux in [ruby-Patches-19361] and
- [ruby-Patches-19362].
+Fri Apr 11 12:43:56 2008 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-Wed Apr 9 12:12:01 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/tk/lib/tkextlib/tile.rb, ext/tk/lib/tkextlib/tile/style.rb,
+ ext/tk/sample/tkextlib/tile/demo.rb: previous patch is not complete.
- * test/ruby/test_thread.rb: new tests from Sylvain Joyeux in
- [ruby-Patches-19361].
+Fri Apr 11 10:22:54 2008 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-Tue Apr 8 21:36:40 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/tk/lib/tkextlib/tile.rb:
+ __define_LoadImages_proc_for_compatibility__! do nothing when the
+ Tcl command exists.
- * thread.c (rb_mutex_sleep): ensures to re-acquire at waking up.
- [ruby-Patches-19361]
+ * ext/tk/lib/tkextlib/tile/style.rb:
+ __define_wrapper_proc_for_compatibility__! do nothing when the Tcl
+ command exists.
-Tue Apr 8 11:00:14 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * ext/tk/sample/tkextlib/tile/demo.rb: don't create 'step' theme if
+ it already exists.
- * lib/complex.rb: remove Math first before overwriting by CMath.
+Fri Apr 11 08:05:12 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-Tue Apr 8 10:34:10 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * marshal.c (w_object): add volatile to avoid potential GC bug. a
+ patch from Tomoyuki Chikanaga <chikanag at nippon-control-system.co.jp>
+ in [ruby-dev:34311].
- * load.c (rb_require_safe): should check fname path after $SAFE is
- properly set. [ruby-dev:34268]
+Thu Apr 10 20:29:13 2008 Akinori MUSHA <knu@iDaemons.org>
- * re.c (rb_reg_quote): should always copy the quoting string.
- [ruby-core:16235]
+ * misc/rdebug.el, misc/README: Remove rdebug.el as per request
+ from the maintainer and mention the ruby-debug project at
+ RubyForge in README; bug#19043.
-Tue Apr 8 10:30:29 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Apr 10 20:08:37 2008 Akinori MUSHA <knu@iDaemons.org>
- * common.mk (prelude.c): depends on enc/prelude.rb.
+ * enum.c (enum_first, enum_group_by): New methods:
+ Enumerable#first and #group_by; backported from 1.9.
- * enc/prelude.rb: fixed initial library names.
+Thu Apr 10 19:49:10 2008 Akinori MUSHA <knu@iDaemons.org>
-Tue Apr 8 03:39:26 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * enumerator.c (rb_eStopIteration), eval.c (rb_f_loop), ruby.h:
+ Add a new exception class StopIteration, which breaks Kernel#loop
+ iteration when raised; backported from 1.9.
- * load.c (rb_provided): check expanded path for relative path
- features, loading or loaded features are already expanded in 1.9.
+ * enumerator.c (enumerator_next, enumerator_rewind): Implement
+ #next and #rewind using the "generator" library.
- * variable.c (rb_autoload_load): no needs to check if provided before
- rb_require_safe. [ruby-dev:34266]
+ * lib/generator.rb: Implement Enumerable::Enumerator#next and
+ #rewind.
-Mon Apr 7 22:41:21 2008 Tadayoshi Funaba <tadf@dotrb.org>
+Thu Apr 10 19:29:48 2008 Akinori MUSHA <knu@iDaemons.org>
- * numeric.c: cancelled recent changes (except to remove rdiv).
+ * array.c (rb_ary_first, rb_ary_last): Return a shared array when
+ possible.
- * bignum.c: ditto.
+ * array.c (rb_ary_pop, rb_ary_pop_m, rb_ary_shift, rb_ary_shift_m):
+ Array#pop and Array#shift can take an optional argument
+ specifying the number of elements to remove and return;
+ backported from 1.9.
- * bignum.c: added rb_big_idiv.
+Thu Apr 10 14:00:44 2008 Tanaka Akira <akr@fsij.org>
-Mon Apr 7 15:51:31 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/resolv.rb (Resolv::DNS#each_address): backport from 1.9 for
+ CNAME. [ruby-dev:34200]
- * encoding.c (enc_init_db): moved to enc/encdb.c.
+Thu Apr 10 01:42:25 2008 NAKAMURA Usaku <usa@ruby-lang.org>
- * transcode.c (init_transcoder_table): moved to enc/trans/transdb.c.
+ * enum.c (iterate_method): add prototype to avoid warning on VC++.
- * enc/depend (enc/encdb.o enc/trans/transdb.o): depend on
- corresponding headers.
+Wed Apr 9 23:12:41 2008 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
- * common.mk (COMMONOBJS): moved transcode.o from OBJS
+ * ext/tk/tcltklib.c: SEGV when tcltk-stubs is enabled.
-Mon Apr 7 12:26:32 2008 Koichi Sasada <ko1@atdot.net>
+ * ext/tk/tcltklib.c: avoid error on a shared object.
- * bootstraptest/test_knownbug.rb: add a known-bug.
+ * ext/tk/extconf.rb: support --with-tcltkversion
-Mon Apr 7 12:15:24 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/tk/README.tcltklib: add document about --with-tcltkversion
- * range.c (range_each_func): should not leave a variable
- uninitialized, which could cause SEGV.
+ * ext/tk/sample/demos-jp/widget, ext/tk/sample/demos-en/widget,
+ ext/tk/sample/demos-jp/style.rb, ext/tk/sample/demos-en/style.rb,
+ ext/tk/sample/demos-jp/bind.rb, ext/tk/sample/demos-en/bind.rb:
+ bug fix.
- * range.c (range_step): removed duplicated and unreachable code.
+Wed Apr 9 21:54:45 2008 Akinori MUSHA <knu@iDaemons.org>
-Mon Apr 7 02:12:27 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * array.c (rb_ary_pop): Do not reallocate too often; backported
+ from 1.9.
- * string.c (rb_str_intern): need not to check if tainted.
- [ruby-dev:34219]
+Wed Apr 9 21:13:05 2008 Akinori MUSHA <knu@iDaemons.org>
-Sun Apr 6 09:45:00 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * array.c (rb_ary_each, rb_ary_each_index, rb_ary_reverse_each,
+ rb_ary_reject, rb_ary_reject_bang): Array#each, #each_index,
+ #reverse_each, #reject, #reject! and #delete_if return an
+ enumerator if no block is given; backported from 1.9.
- * dir.c (dir_tell): check if closed. [ruby-core:16223]
+Wed Apr 9 20:47:16 2008 Akinori MUSHA <knu@iDaemons.org>
-Sat Apr 5 23:17:20 2008 Tadayoshi Funaba <tadf@dotrb.org>
+ * array.c (rb_ary_index, rb_ary_index): Array#index and #rindex
+ can take a block instead of an argument; backported from 1.9.
- * lib/cmath.rb: new.
+Wed Apr 9 19:58:31 2008 Akinori MUSHA <knu@iDaemons.org>
- * lib/complex.rb: depends lib/cmath.rb.
+ * enumerator.c, inits.c (rb_call_inits), ruby.h, intern.h,
+ ext/enumerator, common.mk (OBJS, enumerator.$(OBJEXT)): Make the
+ enumerator module built-in.
- * lib/rational.rb: added rdiv.
+ * enumerator.c: New method: Enumerable::Enumerator#with_index.
- * complex.c: removed some math functions.
+ * enum.c (enum_each_with_index): Enumerable#each_with_index now
+ returns an enumerator instead of raising an exception if no
+ block is given. Enumerable#enum_with_index, formerly defined in
+ the enumerator module, is kept as an alias to each_with_index
+ for backward compatibility.
-Sat Apr 5 05:50:57 2008 Eric Hodel <drbrain@segment7.net>
+Wed Apr 9 19:43:51 2008 Akinori MUSHA <knu@iDaemons.org>
- * lib/rdoc/parsers/parse_rb.rb: Fix uninitialized variable warnings.
+ * eval.c (rb_obj_method, rb_proc_call), intern.h: Export.
- * lib/rdoc/generator/html.rb: ditto.
+Tue Apr 8 11:11:28 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
- * lib/rdoc/options.rb: Fix shadowed variable warning.
+ * eval.c (EXEC_TAG): remove unnecessary FLUSH_REGISTER_WINDOWS for
+ better performance on SPARC. [ruby-core:16159]
- * lib/webrick/httprequest.rb: Fix redefined method warning.
+Tue Apr 8 10:49:54 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-Sat Apr 5 02:13:52 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * re.c (rb_reg_quote): should always copy the quoting string.
+ [ruby-core:16235]
- * bignum.c (rb_cmpint): moved from compar.c, to check bignum
- zero.
+Mon Apr 7 21:35:08 2008 Akinori MUSHA <knu@iDaemons.org>
-Fri Apr 4 23:24:06 2008 NARUSE, Yui <naruse@ruby-lang.org>
+ * array.c (rb_ary_nitems): Backport Array#nitems with a block;
+ suggested by Bertram Scharpf <lists@bertram-scharpf.de> in
+ [ruby-talk:134083].
- * re.c (rb_memsearch_qs): wrong boundary condition.
+Sun Apr 6 09:45:00 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * re.c (rb_memsearch_qs_utf8): ditto.
+ * dir.c (dir_tell): check if closed. [ruby-core:16223]
-Fri Apr 4 14:11:36 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
+Sat Apr 5 10:05:00 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * re.c (rb_memsearch_qs): wrong boundary condition. a patch from
- wanabe <s.wanabe AT gmail.com> in [ruby-dev:34248].
+ * object.c (rb_check_to_integer): backported for range_step.
Fri Apr 4 05:57:11 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
* lib/net/pop.rb (Net::POP3::do_finish): clear @n_mails and
@n_bytes as well. [ruby-core:16144]
-Fri Apr 4 01:59:30 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * range.c (range_step): add step for each iteration if begin and
- end are numeric. [ruby-core:15990]
+Fri Apr 4 02:17:06 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-Fri Apr 4 00:42:26 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * bignum.c (Init_Bignum): rdiv method removed. [ruby-dev:34242]
-
- * complex.c (nucomp_quo): ditto.
-
- * numeric.c (num_rdiv): ditto.
-
- * rational.c (nurat_div): ditto.
-
- * complex.c (nucomp_fdiv): fdiv implementation restored.
-
- * numeric.c (num_quo): RDoc updated.
-
-Thu Apr 3 21:51:45 2008 Tadayoshi Funaba <tadf@dotrb.org>
-
- * complex.c (nucomp_int_check): function for DRY real check.
-
- * complex.c (nucomp_{add,sub,mul,div,expt}): use rb_num_coerce_bin().
-
-Thu Apr 3 19:59:42 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * insns.def (defineclass): check if cbase is a class or a module.
- [ruby-core:16118]
-
-Thu Apr 3 14:42:11 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * common.mk (INSNS): add insns_info.inc.
-
- * common.mk (INSNS): make incs separately for nmake.
-
-Thu Apr 3 13:20:38 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * common.mk (endb.h, transdb.h, prelude.c): depend on $(PREP) and
- check if really changed. [ruby-core:16102]
-
- * Makefile.in, common.mk, configure.in, {win32,bcc32}/Makefile.sub
- (MINIOBJS, ARCHMINIOBJS): separated.
-
-Thu Apr 3 09:00:45 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * compile.c (iseq_set_sequence, iseq_insns_unification,
- insn_data_to_s_detail): constified.
-
- * iseq.c (insn_operand_intern, ruby_iseq_disasm_insn): ditto.
-
- * template/{insns_info,opt_sc,optunifs}.inc.tmpl: ditto.
-
- * tool/instruction.rb (OptUnifsIncGenerator): ditto.
-
-Thu Apr 3 08:46:09 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * range.c (range_include): add RDoc to describe that comparison
- for numeric is done according magnitude of values.
- [ruby-core:15907]
-
-Wed Apr 2 22:29:35 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * rational.c (nurat_int_check): function for DRY integer check.
-
- * numeric.c (num_rdiv): should always return rational number.
-
- * rational.c (nurat_add, nurat_sub, nurat_mul, nurat_fdiv,
- nurat_cmp): use rb_num_coerce_bin().
-
- * rational.c (nurat_division): does / and rdiv.
-
- * .gdbinit (rp): no longer use rb_p().
-
-Wed Apr 2 06:52:31 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * .gdbinit (rp): supports rational and complex numbers. it's
- cheating since it uses rb_p().
-
-Wed Apr 2 06:24:06 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * include/ruby/node.h: add new constants for rb_call()'s scope.
-
- * eval.c (iterate_method): use CALL_* scope constant to specify
- proper scope value.
-
- * eval.c (rb_each, rb_apply, rb_funcall, rb_funcall2, rb_funcall3):
- ditto.
-
-Tue Apr 1 21:19:41 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * rational.c: need to include <float.h> just once.
-
-Tue Apr 1 16:40:21 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * bignum.c (big2dbl): more precise conversion at edge cases.
- [ruby-dev:34195]
+ * range.c (range_step): should not round step into integer if
+ begin and end are numeric. [ruby-core:15990]
Tue Apr 1 14:43:38 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* configure.in: get rid of empty expansion.
- * configure.in: _setjmp is available but _longjmp is not on mingw.
-
-Tue Apr 1 09:41:22 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
* {bcc,win}32/Makefile (config.h): need to define RUBY_SETJMP, etc.
-Tue Apr 1 07:31:58 2008 Eric Hodel <drbrain@segment7.net>
+Tue Apr 1 11:36:19 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/rubygems* test/rubygems*: Import RubyGems 1.1.0.
+ * configure.in: _setjmp is available but _longjmp is not on mingw.
Tue Apr 1 03:20:40 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
@@ -25094,221 +2349,124 @@ Tue Apr 1 01:55:52 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/resolv.rb (Resolv::Config.default_config_hash): requires
win32/resolv to use Win32::Resolv. [ruby-dev:34138]
-Tue Apr 1 01:40:58 2008 Tadayoshi Funaba <tadf@dotrb.org>
-
- * complex.c: adopted the ruby's style.
-
- * rational.c: ditto.
-
-Tue Apr 1 00:17:35 2008 Tadayoshi Funaba <tadf@dotrb.org>
-
- * rational.c: revert.
-
-Mon Mar 31 18:57:36 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * {bcc,win}32/Makefile.sub (config.h): define ssize_t.
-
- * io.c (copy_stream_body): some platform don't have O_NOCTTY.
-
-Mon Mar 31 18:42:41 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in: check for ssize_t. [ruby-dev:34184]
-
-Mon Mar 31 14:45:00 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * numeric.c (num_quo): should convert its operand to Rational.
-
- * rational.c (string_to_r_strict): should raise TypeError.
-
- * bignum.c (Init_Bignum): should not redefine Bignum#div.
- Numeric#div will do. [ruby-dev:34066]
-
-Mon Mar 31 04:05:15 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * io.c (io_getc): set coderange while getting characters.
-
-Sun Mar 30 23:16:49 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * proc.c (proc_dup): should copy is_lambda attribute as well.
- [ruby-talk:296244]
-
-Sun Mar 30 15:33:29 2008 Tanaka Akira <akr@fsij.org>
+Mon Mar 31 14:51:11 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
- * io.c: IO.copy_stream implemented. [ruby-dev:33843]
+ * bignum.c (rb_big_div): Bignum#div should return integer for
+ floating number operand.
- * thread.c (rb_fd_select): new function.
+Sun Mar 30 07:00:32 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * configure.in (sys/sendfile.h): check the header file.
- (sendfile): check the function.
- (pread): check the function.
+ * ext/tk/tcltklib.c: rb_hash_lookup has not been backported yet.
Sat Mar 29 14:18:41 2008 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tk/*: full update Ruby/Tk to support Ruby(1.9|1.8) and Tc/Tk8.5.
- * ext/tk/lib/tkextlib/tile.rb: [incompatible] remove TileWidgets'
+ * ext/tk/lib/tkextlib/tile.rb: [incompatible] remove TileWidgets'
instate/state/identify method to avoid the conflict with standard
widget options. Those methods are renamed to ttk_instate/ttk_state/
- ttk_identify (tile_instate/tile_state/tile_identify are available
- too). Although I don't recommend, if you really need old methods,
- please define "Tk::USE_OBSOLETE_TILE_STATE_METHOD = true" before
+ ttk_identify (tile_instate/tile_state/tile_identify are available
+ too). Although I don't recommend, if you realy need old methods,
+ please define "Tk::USE_OBSOLETE_TILE_STATE_METHOD = true" before
"require 'tkextlib/tile'".
* ext/tk/lib/tkextlib/tile.rb: "Tk::Tile::__Import_Tile_Widgets__!"
- is obsolete. It outputs warning. To control default widget set,
+ is obsolete. It outputs warning. To control default widget set,
use "Tk.default_widget_set = :Ttk".
- * ext/tk/lib/tk.rb: __IGNORE_UNKNOWN_CONFIGURE_OPTION__ method and
- __set_IGNORE_UNKNOWN_CONFIGURE_OPTION__!(mode) method are defined
- as module methods of TkConfigMethod. It may help users to wrap old
+ * ext/tk/lib/tk.rb: __IGNORE_UNKNOWN_CONFIGURE_OPTION__ method and
+ __set_IGNORE_UNKNOWN_CONFIGURE_OPTION__!(mode) method are defind
+ as module methods of TkConfigMethod. It may help users to wrap old
Ruby/Tk scripts (use standard widgets) to force to use Ttk widgets.
- Ttk widgets don't have some options of standard widgets which are
- control the view of widgets. When set ignore-mode true, configure
- method tries to ignore such unknown options with no exception.
- Of course, it may raise other troubles on the GUI design.
- So, those are a little danger methods.
-
- * ext/tk/lib/tk/itemconfig.rb: __IGNORE_UNKNOWN_CONFIGURE_OPTION__
- method and __set_IGNORE_UNKNOWN_CONFIGURE_OPTION__!(mode) method
- are defined as module methods of TkItemConfigMethod as the same
+ Ttk widgets don't have some options of standard widgets which are
+ control the view of widgets. When set ignore-mode true, configure
+ method tries to ignoure such unknown options with no exception.
+ Of course, it may raise other troubles on the GUI design.
+ So, those are a little danger methods.
+
+ * ext/tk/lib/tk/itemconfig.rb: __IGNORE_UNKNOWN_CONFIGURE_OPTION__
+ method and __set_IGNORE_UNKNOWN_CONFIGURE_OPTION__!(mode) method
+ are defind as module methods of TkItemConfigMethod as the same
purpose as TkConfigMethod's ones.
- * ext/tk/sample/ttk_wrapper.rb: A new example. This is a tool for
- wrapping old Ruby/Tk scripts (which use standard widgets) to use
+ * ext/tk/sample/ttk_wrapper.rb: A new example. This is a tool for
+ wrapping old Ruby/Tk scripts (which use standard widgets) to use
Ttk (Tile) widgets as default.
- * ext/tk/sample/tkextlib/tile/demo.rb: use ttk_instate/ttk_state
+ * ext/tk/sample/tkextlib/tile/demo.rb: use ttk_instate/ttk_state
method instead of instate/state method.
* ext/tk/lib/tk/root, ext/tk/lib/tk/namespace.rb,
- ext/tk/lib/tk/text.rb, ext/tk/lib/tkextlib/*: some 'instance_eval's
+ ext/tk/lib/tk/text.rb, ext/tk/lib/tkextlib/*: some 'instance_eval's
are replaced to "instance_exec(self)".
- * ext/tk/lib/tk/event.rb: bug fix on KEY_TBL and PROC_TBL (?x is not
+ * ext/tk/lib/tk/event.rb: bug fix on KEY_TBL and PROC_TBL (?x is not
a character code on Ruby1.9).
- * ext/tk/lib/tk/variable.rb: support new style of operation argument
- on Tcl/Tk's 'trace' command for variables.
+ * ext/tk/lib/tk/variable.rb: support new style of operation argument
+ on Tcl/Tk's 'trace' command for variables.
* ext/tk/sample/demos-jp/widget, ext/tk/sample/demos-en/widget: bug fix
- * ext/tk/sample/demos-jp/textpeer.rb,
- ext/tk/sample/demos-en/textpeer.rb: new widget demo.
+ * ext/tk/sammple/demos-jp/textpeer.rb,
+ ext/tk/sammple/demos-en/textpeer.rb: new widget demo.
- * ext/tk/tcltklib.c: decrease SEGV troubles (probably)
+ * ext/tk/tcltklib.c: decrase SEGV troubles (probably)
* ext/tk/lib/tk.rb: remove Thread.critical access if Ruby1.9
* ext/tk/lib/tk/multi-tk.rb: support Ruby1.9 (probably)
- * ext/tk/lib/tkextlib/tile.rb: add method to define Tcl/Tk command
- to make Tcl/Tk theme sources (based on different version of Tile
- extension) available.
- (Tk::Tile::__define_LoadImages_proc_for_compatibility__)
+ * ext/tk/lib/tkextlib/tile.rb: add method to define Tcl/Tk command
+ to make Tcl/Tk theme sources (based on different version of Tile
+ extension) available.
+ (Tk::Tile::__define_LoadImages_proc_for_comaptibility__)
* ext/tk/lib/tk.rb, ext/tk/lib/tk/wm.rb: support dockable frames
- (Tcl/Tk8.5 feature). 'wm' command can treat many kinds of widgets
+ (Tcl/Tk8.5 feature). 'wm' command can treat many kinds of widgets
as toplevel widgets.
* ext/tk/lib/tkextlib/tile/style.rb: ditto.
(Tk::Tile::Style.__define_wrapper_proc_for_compatibility__)
- * ext/tk/lib/tk/font.rb: add actual_hash and metrics_hash to get
- properties as a hash. metrics_hash method returns a boolean value
- for 'fixed' option. But metrics method returns numeric value
- (0 or 1) for 'fixed' option, because of backward compatibility.
+ * ext/tk/lib/tk/font.rb: add actual_hash and metrics_hash to get
+ properties as a hash. metrics_hash method returns a boolean value
+ for 'fixed' option. But metrics method returns numeric value
+ (0 or 1) for 'fixed' option, because of backward compatibility.
- * ext/tk/lib/tk/timer.rb: sometimes fail to set callback procedure.
+ * ext/tk/lib/tk/timer.rb: somtimes fail to set callback procedure.
- * ext/tk/lib/tk.rb: add Tk.sleep and Tk.wakeup method. Tk.sleep
- doesn't block the eventloop. It will be better to use the method
+ * ext/tk/lib/tk.rb: add Tk.sleep and Tk.wakeup method. Tk.sleep
+ doesn't block the eventloop. It will be better to use the method
in event callbacks.
* ext/tk/sample/tksleep_sample.rb: sample script about Tk.sleep.
-Thu Mar 27 20:44:22 2008 Tadayoshi Funaba <tadf@dotrb.org>
-
- * complex.c (f_lcm): removed.
-
- * rational.c (rb_lcm, rb_gcdlcm): added.
-
- * lib/complex.rb (gcd, lcm, gcdlcm): removed.
-
- * lib/rational.rb (gcd, lcm, gcdlcm): ditto.
-
-Wed Mar 26 18:11:26 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * variable.c (rb_mod_constants): rdoc updated. a patch from
- Florian Gilcher <flo AT andersground.net> in [ruby-core:16009].
-
-Wed Mar 26 00:55:28 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * test/ruby/test_rand.rb: add tests to achieve over 95% test coverage
- of random.c.
-
-Wed Mar 26 00:28:55 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * test/ruby/test_rational.rb: add tests to achieve over 90% test
- coverage of rational.c.
-
- * test/ruby/test_complex.rb: ditto for complex.c.
-
-Tue Mar 25 19:34:05 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * bootstraptest/test_knownbug.rb: add tests. [ruby-dev:34128]
-
-Tue Mar 25 19:09:04 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * array.c (ary_new): fix size check. [ruby-dev:34123]
-
- * array.c (rb_ary_take, rb_ary_drop): check negative size and use
- NUM2LONG instead of FIX2LONG. [ruby-dev:34123]
-
- * enum.c (enum_take, enum_drop): check negative size.
-
- * test/ruby/test_array.rb: add tests for above.
-
-Tue Mar 25 16:32:56 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ruby.c (proc_options): checks if the word is empty.
-
- * ruby.c (process_options): typo fixed. [ruby-dev:34122]
+Sat Mar 29 04:08:59 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-Tue Mar 25 15:26:30 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * class.c (clone_method): should copy cref as well.
+ [ruby-core:15833]
- * compile.c (defined_expr): false short-circuit destination label may
- be needed. [ruby-talk:295296]
+Mon Mar 24 20:07:42 2008 Akinori MUSHA <knu@iDaemons.org>
- * compile.c (iseq_compile_each): put nil if false short-circuit is
- created.
+ * eval.c (rb_eval): Call trace hook for if expression after the
+ condition has been evaluated, not before; submitted by Rocky
+ Bernstein in #18722.
- * compile.c (compile_massign_opt): no need to use alloca.
+Mon Mar 24 19:44:53 2008 Akinori MUSHA <knu@iDaemons.org>
-Mon Mar 24 19:23:52 2008 Akinori MUSHA <knu@iDaemons.org>
-
- * parse.y (debug_lines): Always prepare a new array for each
- file's SCRIPT_LINES__ storage, instead of appending source lines
- every time a file is re-loaded; submitted by Rocky Bernstein in
+ * parse.y (yycompile): Always prepare a new array for each file's
+ SCRIPT_LINES__ storage, instead of appending source lines every
+ time a file is re-loaded; submitted by Rocky Bernstein in
#18517.
Mon Mar 24 10:25:54 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* configure.in: sitearch should use target_cpu. [ruby-core:15986]
-Sun Mar 23 02:51:57 2008 Tanaka Akira <akr@fsij.org>
-
- * process.c (rlimit_resource_value): use NUM2RLIM.
-
-Sun Mar 23 02:28:01 2008 Tadayoshi Funaba <tadf@dotrb.org>
-
- * complex.c: fixed. [ruby-dev:34109]
-
- * rational.c: ditto.
-
-Fri Mar 21 21:32:25 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Mar 24 01:24:24 2008 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
- * io.c (rb_f_gets, rb_f_readline, rb_f_readlines): delegates to ARGF
- as well as puts and putc. [ruby-dev:34100]
+ * lib/erb.rb (result): use proc instead of Thread. [ruby-dev:33692]
Fri Mar 21 21:26:52 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
@@ -25335,125 +2493,28 @@ Fri Mar 21 09:24:28 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* instruby.rb (open_for_install): write block result and rewrite only
if changed from existing file.
-Fri Mar 21 08:29:33 2008 Tadayoshi Funaba <tadf@dotrb.org>
-
- * rational.c (nurat_to_f): rearrangement.
-
-Fri Mar 21 06:44:59 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * rational.c (nurat_to_f): C99.
-
-Fri Mar 21 01:40:27 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * complex.c (nucomp_sub, nucomp_expt): call corresponding functions.
-
-Fri Mar 21 01:21:43 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * missing/tgamma.c: include config.h before math.h. [ruby-dev:34075]
-
-Thu Mar 20 21:46:33 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * io.c (argf_getline): use receiver.
-
-Thu Mar 20 21:20:19 2008 Tadayoshi Funaba <tadf@dotrb.org>
-
- * rational.c: some improvements (include Shin-ichiro HARA's
- effort).
-
- * complex.c: some improvements.
-
- * test/ruby/test_rational2.rb: new.
-
-Thu Mar 20 00:21:12 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * io.c (argf_initialize_copy): get rid of segfault.
+Wed Mar 19 21:01:08 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * io.c (argf_tell, argf_seek_m, argf_set_pos, argf_rewind,
- argf_fileno, argf_to_io, argf_eofl, argf_getc, argf_getbyte,
- argf_readchar, argf_readbyte, argf_each_line): use receiver.
-
-Wed Mar 19 23:52:41 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * io.c (rb_io_putc, rb_io_puts): output directly if the receiver is
- rb_stdout to get rid of infinite recursion. [ruby-dev:34059]
-
-Wed Mar 19 22:27:41 2008 Tadayoshi Funaba <tadf@dotrb.org>
-
- * rational.c: added rb_gcd.
-
- * complex.c: use rb_gcd.
-
-Wed Mar 19 18:37:00 2008 Tadayoshi Funaba <tadf@dotrb.org>
-
- * complex.c: revert.
-
- * rational.c: revert.
-
-Wed Mar 19 17:31:20 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval_intern.h (TH_EXEC_TAG): need not to FLUSH_REGISTER_WINDOWS.
- [ruby-core:15871], [ruby-dev:34088]
+ * dir.c (dir_inspect, dir_path, dir_tell): check for frozen and closed
+ is not needed. [ruby-dev:32640]
-Wed Mar 19 14:53:03 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Mar 19 20:25:40 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * complex.c (nucomp_to_s, nucomp_inspect): get rid of making
- unnecessary intermediate objects.
+ * dir.c (Init_Dir): define inspect method. [ruby-core:15960]
- * complex.c (make_patterns, string_to_c): do not treat successive
- underscores as a part of numeric like as literals. [ruby-dev:34085]
+Wed Mar 19 14:59:12 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * rational.c (make_patterns, string_to_r): ditto.
+ * misc/ruby-style.el (ruby-style-{case,label}-indent): fix for labels
+ inside blocks in switch and function top level.
Wed Mar 19 14:36:40 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* bignum.c (rb_cstr_to_inum): treat successive underscores as
nondigit. [ruby-dev:34089]
-Wed Mar 19 14:08:47 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * encoding.c (enc_check_encoding): should not load autoloaded encoding
- directly, instead use rb_enc_find_index() which deal with alias and
- replica. [ruby-core:15957]
-
-Wed Mar 19 11:49:47 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * regint.h (include): include ruby.h instead of defines.h and config.h.
-
-Wed Mar 19 10:17:12 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * regint.h (CHECK_INTERRUPT_IN_MATCH_AT): add interrupt check
- during match. [ruby-talk:295002]
-
-Tue Mar 18 16:24:53 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (literal_concat_gen): bail out at different encoding.
-
-Tue Mar 18 04:00:27 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * re.c (rb_memsearch_ss): simple shift search.
+Wed Mar 19 00:01:23 2008 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
- * re.c (rb_memsearch_qs): quick search.
-
- * re.c (rb_memsearch_qs_utf8): quick search for UTF-8 string.
-
- * re.c (rb_memsearch_qs_utf8_hash): hash functions for above.
-
- * re.c (rb_memsearch): use above functions.
-
- * string.c (rb_str_index): give enc to rb_memsearch.
-
- * include/ruby/intern.h (rb_memsearch): move to encoding.h.
-
- * include/ruby/encoding.h (rb_memsearch): move from intern.h.
-
- * common.mk (PREP): add dependency.
-
-Mon Mar 17 22:23:54 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * array.c (rb_ary_take, rb_ary_take_while, rb_ary_drop,
- rb_ary_drop_while): new methods. [ruby-dev:34067]
-
- * test/ruby/test_array.rb: add tests for above.
+ * lib/erb.rb (ERB::Compiler): Make some minor code optimization.
Mon Mar 17 17:11:13 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
@@ -25465,69 +2526,6 @@ Mon Mar 17 16:41:08 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* configure.in: unset GREP_OPTIONS. [ruby-core:15918]
-Sun Mar 16 18:07:07 2008 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * enc/trans/utf_16_32.c: bug fix (some invalid UTF-8 sequences
- were legal)
-
- * test/ruby/test_transcode.rb: test for above bug
-
-Sun Mar 16 17:28:07 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * common.mk (LIBRUBY_SO): add dependency to $(BUILTIN_ENCOBJS).
-
-Sun Mar 16 08:51:41 2008 Tadayoshi Funaba <tadf@dotrb.org>
-
- * include/ruby/intern.h: added some declarations.
-
- * include/ruby/ruby.h: ditto.
-
- * common.mk: added some entries.
-
- * configure.in: added a check for signbit.
-
- * lib/complex.rb: nearly all of core definitions have been removed.
-
- * lib/rational.rb: ditto.
-
- * lib/mathn.rb: some trivial adjustments.
-
- * complex.c: new.
-
- * rational.c: ditto.
-
- * numeric.c (flo_{quo,rdiv}, fix_fdiv): added.
-
- * numeric.c ({num,int}_{numerator,denominator}): ditto.
-
- * bignum.c (rb_big_fdiv): ditto.
-
- * numeric.c (fix_{quo,pow}): now may yield rational number.
-
- * bignum.c (rb_big_{quo,pow}): ditto.
-
- * numeric.c (rb_{int,flo}_induced_from): now can accept rational.
-
- * gc.c (gc_mark_children, obj_free): now detects complex and rational.
-
- * inits.c (rb_call_inits): now calls Init_{Complex,Rational}.
-
- * test/ruby/test_complex.rb: new.
-
- * test/ruby/test_rational.rb: ditto.
-
-Sat Mar 15 17:48:48 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * encoding.c (rb_enc_associate_index): pass unnecessary enc_capable().
-
- * string.c (rb_str_cmp): reduce invocation of rb_enc_compatible().
-
-Fri Mar 14 17:04:43 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * include/ruby/ruby.h (inttypes.h): includes always if available.
-
- * string.c, ext/digest/defs.h: moved inttypes.h to ruby.h.
-
Fri Mar 14 16:59:23 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* configure.in (RUBY_LIB_PREFIX): fix for prefix.
@@ -25541,702 +2539,94 @@ Fri Mar 14 15:49:05 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* configure.in (RUBY_LIB_PREFIX): use libdir.
-Fri Mar 14 14:24:15 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/digest/defs.h: inttypes.h is still needed.
-
-Fri Mar 14 11:34:12 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * {bcc,win}32/Makefile.sub: follow below changes.
-
-Fri Mar 14 11:24:30 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * misc/ruby-mode.el (ruby-encoding-map, ruby-use-encoding-map): added
- to customize.
-
-Fri Mar 14 10:37:15 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * configure.in (int8_t, uint8_t, int16_t, uint16_t int32_t,
- uint32_t int64_t, uint64_t, int128_t, uint128_t,
- intptr_t, uintptr_t): check if defined.
-
- * win32/Makefile.sub: follow configure.in.
-
- * ext/digest/defs.h: remove checks for uint8_t, uint32_t and uint64_t.
-
Fri Mar 14 10:12:29 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* configure.in (RUBY_CHECK_VARTYPE): should not indent preprocessor
directives.
-Fri Mar 14 10:03:59 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * string.c (UNALIGNED_WORD_ACCESS): IA64 cannot access unaligned word.
-
-Thu Mar 13 21:00:50 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * array.c (rb_ary_slice_bang): should not use rb_ary_subseq()
- which shares internal pointer. splice modifies the receiver
- right after subseq. [ruby-dev:34005]
-
- * bootstraptest/test_struct.rb: some test moved from test to shut
- warning up.
-
-Thu Mar 13 19:42:43 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * {bcc,win}32/Makefile.sub (config.h): define uint32_t.
-
-Thu Mar 13 14:14:19 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * trunk/configure.in (AC_CHECK_HEADERS): stdint.h is not needed to
- check.
-
- * trunk/configure.in (rb_cv_type_uint32_t): unquoted. [ruby-dev:34030]
-
- * trunk/string.c (hash): use inttypes.h instead of stdint.h.
-
-Thu Mar 13 10:42:46 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * numeric.c (fix_divmod): should return integer division. [ruby-dev:34006]
-
- * enum.c (zip_ary): wrong boundary condition.
-
- * test/ruby/test_numeric.rb (TestNumeric::test_num2long): bit-and
- should not raise RangeError.
-
-Thu Mar 13 03:12:48 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/irb/cmd/help.rb: should be updated for new ri structure.
- [ruby-core:15825]
-
- * lib/rdoc/ri/driver.rb (RDoc::initialize): allow options to be optional.
-
- * lib/rdoc/ri/driver.rb (RDoc::class_cache): map_dirs may be
- empty.
-
- * lib/rdoc/ri/driver.rb (RDoc::get_info_for): revive get_info_for
- method. maybe broken.
-
- * lib/rdoc/ri/util.rb (RDoc::initialize): should not use RiError
- no more.
-
-Thu Mar 13 01:45:25 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in (stdint.h): check if presence.
-
- * configure.in (uint32_t): check if defined.
-
- * string.c (hash): fix for portability. [ruby-dev:34020]
-
-Wed Mar 12 17:33:34 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * object.c (rb_cstr_to_dbl): fix for a mere underscore.
-
-Wed Mar 12 14:47:07 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval_intern.h (rb_thread_raised_set): use generic flags.
-
- * eval.c (rb_longjmp): clear all raised flags.
-
- * eval.c (stack_check): leave clearing flag to rb_longjmp.
-
- * gc.c (rb_memerror): use thread raised flag instead of static flag.
+Thu Mar 13 00:37:20 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Mar 11 23:38:39 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * eval.c (rb_call0): yields the last executed node line number at
+ return event. [ruby-core:15855]
- * array.c (rb_ary_combination): argument check before creating
- Enumerator.
+Wed Mar 12 02:12:20 2008 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
- * array.c (rb_ary_permutation): ditto.
-
- * enum.c (enum_zip): optimize if all arguments are arrays.
+ * lib/delegate.rb: check $@ to avoid NoMethodError.
Tue Mar 11 19:48:09 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* numeric.c (fix_coerce): try conversion before type check.
[ruby-core:15838]
-Tue Mar 11 12:39:53 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * common.mk (clean-local): WINMAINOBJ is Windows specific.
-
-Tue Mar 11 10:19:10 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * string.c (hash): replaced by MurmurHash described in
- <http://murmurhash.googlepages.com/>.
-
-Tue Mar 11 09:52:49 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * string.c (rb_str_comparable): empty strings in any encoding are
- compatible each other.
-
-Tue Mar 11 00:46:29 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * ruby.c (usage): remove some unimportant lines to fit -h message
- in a page. [ruby-dev:34018]
-
-Mon Mar 10 17:11:00 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (rb_f_local_variables): local_variables should return an
- array of symbols. [ruby-dev:34008]
-
- * vm.c (collect_local_variables_in_env): ditto.
+Tue Mar 11 17:03:23 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Mar 10 15:53:48 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/delegate.rb (Delegator#initialize, DelegateClass): skip correct
+ backtrace. [ruby-dev:34019]
- * version.c (MKSTR): make US-ASCII. [ruby-dev:34010]
+Tue Mar 11 16:43:53 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Mar 10 02:08:21 2008 NARUSE, Yui <naruse@ruby-lang.org>
+ * win32/win32.c (rb_w32_cmdvector): terminate shrunken command line.
- * string.c (rb_str_index): if t == s + pos, the character beginning
- from s + pos is valid.
+Tue Mar 11 12:39:03 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun Mar 9 13:51:21 2008 Eric Hodel <drbrain@segment7.net>
-
- * lib/rdoc/generator.rb: Restore missing line to #params. Patch by
- Lincoln Stoll <lstoll at lstoll.net>
-
-Sun Mar 9 09:52:00 2008 Eric Hodel <drbrain@segment7.net>
-
- * lib/rdoc/code_objects.rb: Remove debugging Kernel#p. Patch by
- Lincoln Stoll <lstoll at lstoll.net>
- * lib/rdoc/generator/html.rb: Fully qualify AllReferences. Patch by
- Lincoln Stoll <lstoll at lstoll.net>
- * lib/rdoc/ri/writer.rb: Fix 1.8 backwards compatibility.
+ * common.mk (clean-local): removes MINOBJS.
Sat Mar 8 18:50:57 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* file.c (isdirsep): backslash is valid path separator on cygwin too.
-Sat Mar 8 06:53:48 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * string.c (search_nonascii): Use VALUE instead of unsigned long
- because VALUE can be the fastest unsigned integer type.
- On LLP64 unsigned long isn't the fastest.
- * string.c (str_strlen): ditto.
- * string.c (str_utf8_nth): ditto.
- * string.c (count_utf8_lead_bytes_with_ulong): ditto.
-
- * string.c (count_utf8_lead_bytes_with_word): renamed.
-
-Fri Mar 7 21:27:43 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * bignum.c: fix indent.
-
-Fri Mar 7 21:12:19 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * bignum.c (power_cache_init, power_cache_get_power0, Init_Bignum):
- delayed initializing power cache per base. [ruby-dev:34003]
-
-Fri Mar 7 20:30:05 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * cont.c (cont_restore_0): fixed typo. [ruby-core:15821]
-
Fri Mar 7 19:56:10 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/mkmf.rb: rdoc added. [ruby-Patches-9762]
-Thu Mar 6 17:26:53 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * sprintf.c (rb_str_format): space flag is in effect for Inf/NaN too.
- [ruby-dev:34002]
-
-Thu Mar 6 15:44:20 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * sprintf.c (rb_str_format): casting double to long is undefined
- if the integer part of double is out of the range of long.
-
-Thu Mar 6 15:11:40 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * sprintf.c (rb_str_format): ignore 0 flag for NaN and Inf.
- [ruby-dev:33994]
-
-Thu Mar 6 15:05:25 2008 NAKAMURA Usaku <usa@ruby-lang.org>
+Thu Mar 6 15:10:21 2008 NAKAMURA Usaku <usa@ruby-lang.org>
* {bcc32,win32}/Makefile.sub (RUNRUBY): use $(PROGRAM) instead of
ruby$(EXEEXT).
suggested by KIMURA Koichi <kimura.koichi at canon.co.jp>.
[ruby-dev:34000]
-Thu Mar 6 14:46:08 2008 Tanaka Akira <akr@fsij.org>
-
- * missing/lgamma_r.c (loggamma): return 0 for 1 and 2.
-
- * test/ruby/test_math.rb: accept errors by functions under missing/.
-
-Thu Mar 6 14:29:44 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * transcode.c (rb_str_transcode_bang): set coderange.
-
- * transcode.c (rb_str_transcode): use rb_str_transcode_bang.
-
-Thu Mar 6 14:00:10 2008 Tanaka Akira <akr@fsij.org>
-
- * include/ruby/missing.h (cbrt): add declaration.
-
-Thu Mar 6 11:14:14 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * misc/ruby-mode.el (ruby-add-log-current-method): use ruby style
- method name format.
-
-Thu Mar 6 11:12:29 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * sprintf.c (rb_str_format): no need of loop.
-
-Thu Mar 6 08:30:42 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * object.c (rb_mod_freeze): call rb_class_name() directly.
- [ruby-core:15802]
+Thu Mar 6 12:15:06 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Mar 6 04:32:06 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * string.c (count_utf8_lead_bytes_with_ulong): fix shift size.
- [ruby-dev:33993]
-
- * string.c (str_utf8_nth) fix wrong counting.
-
-Thu Mar 6 00:34:00 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * sprintf.c (rb_str_format): size_t returned from strlen() can be
- unsigned.
-
-Thu Mar 6 00:31:39 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * struct.c (make_struct): preserve encoding of struct name.
-
-Wed Mar 5 22:49:20 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * string.c (is_utf8_lead_byte, count_utf8_lead_bytes_with_ulong):
- defined for UTF-8 optimization.
-
- * string.c (str_strlen): use is_utf8_lead_byte and
- count_utf8_lead_bytes_with_ulong.
-
- * string.c (str_utf8_nth) ditto.
-
-Wed Mar 5 17:53:01 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * file.c (rb_file_flock): returns false on EAGAIN if non-blocking.
- [ruby-core:15795]
-
-Wed Mar 5 17:43:43 2008 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * transcode.c (transcode_loop): Adjusted detection of invalid
- (ill-formed) UTF-8 sequences. Fixing potential security issue, see
- http://www.unicode.org/versions/Unicode5.1.0/#Notable_Changes.
-
- * test/ruby/test_transcode.rb: Added two tests for above fix.
-
-Wed Mar 5 14:00:49 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * numeric.c (fix_to_s): avoid rb_scan_args() when no argument
- given.
- * bignum.c (rb_big_to_s): ditto.
- * enum.c (enum_first): ditto.
- * eval_jump.c (rb_f_catch): ditto.
- * io.c (rb_obj_display): ditto.
- * class.c (rb_obj_singleton_methods): ditto.
- * object.c (rb_class_initialize): ditto.
- * random.c (rb_f_srand): ditto.
- * range.c (range_step): ditto.
- * re.c (rb_reg_s_last_match): ditto.
- * string.c (rb_str_to_i): ditto.
- * string.c (rb_str_each_line): ditto.
- * string.c (rb_str_chomp_bang): ditto.
- * string.c (rb_str_sum): ditto.
-
- * string.c (str_modifiable): declare inline.
- * string.c (str_independent): ditto.
-
-Wed Mar 5 11:50:32 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/debug.rb: require 'continuation' to implement "restart"
- command. [ruby-dev:33992]
-
- * lib/debug.rb (Context::debug_command): remove local variable
- shadowing to shut up warnings. [ruby-dev:33992]
-
- * lib/debug.rb (Context::display_list): ditto.
-
- * lib/debug.rb (Context::resume): ditto.
-
- * lib/debug.rb (Context::get_thread): no longer use #index for Hash.
-
-Tue Mar 4 21:35:59 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/irb.rb (IRB::Irb::eval_input): SyntaxError should not be
- considered as IRB bug. [ruby-dev:33991]
-
- * lib/irb/workspace.rb (IRB::WorkSpace::filter_backtrace): should
- filter 'irb.rb' as well for context mode 2 and 3.
-
-Tue Mar 4 19:10:43 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * hash.c (rb_hash_aset): should not copy key string when
- compare_by_identity is set. [ruby-dev:33604]
-
- * hash.c (hash_equal): two hash tables are different when internal
- comparison table differ. [ruby-dev:33989]
-
-Tue Mar 4 16:29:06 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * parse.y (parser_yylex): disallow non digits '0o' expression.
-
-Tue Mar 4 14:35:12 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * io.c (open_key_args): use rb_io_open_with_args instead of rb_f_open.
- [ruby-core:15763]
-
-Tue Mar 4 13:41:46 2008 Tanaka Akira <akr@fsij.org>
-
- * gc.c (add_heap): fix previous change. [ruby-dev:33988]
-
-Tue Mar 4 10:21:03 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * gc.c (add_heap): use binary search to find the place to insert the
- new heap slot. [ruby-dev:33983]
+ * parse.y (opt_block_param): command can start just after block param
+ definition. [ruby-list:44479]
-Tue Mar 4 05:30:31 2008 NARUSE, Yui <naruse@ruby-lang.org>
+Thu Mar 6 00:34:11 2008 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
- * io.c (open_key_args): use rb_io_open instead of rb_f_open.
- [ruby-core:15746]
+ * lib/erb.rb: update RDoc. Thanks Makoto Kuwata [ruby-dev:33702]
-Mon Mar 3 23:28:37 2008 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Mon Mar 3 23:28:34 2008 GOTOU Yuuzou <gotoyuzo@notwork.org>
* lib/webrick/httpservlet/filehandler.rb: should normalize path
- separators in path_info to prevent directory traversal
- attacks on DOSISH platforms.
+ separators in path_info to prevent directory traversal attacks
+ on DOSISH platforms.
reported by Digital Security Research Group [DSECRG-08-026].
* lib/webrick/httpservlet/filehandler.rb: pathnames which have
not to be published should be checked case-insensitively.
-Mon Mar 3 17:25:45 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * gc.c (add_heap): sort heaps array in ascending order to use
- binary search.
-
- * gc.c (is_pointer_to_heap): use binary search to identify object
- in heaps. works better when number of heap segments grow big.
-
-Mon Mar 3 17:15:09 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * re.c (rb_reg_regsub): remove too strict encoding check.
- [ruby-dev:33966]
-
Mon Mar 3 16:14:24 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* hash.c (rb_any_hash): shrinks all results in Fixnum range.
[ruby-core:15713]
-Sun Mar 2 23:03:59 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * io.c (rb_io_ungetc): reduce redundant call.
-
-Sun Mar 2 10:13:12 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ruby.c (load_file): parse shebang in us-ascii. a patch from
- sheepman <sheepman AT sheepman.sakura.ne.jp> in [ruby-dev:33955]
-
-Sun Mar 2 00:08:10 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * object.c (rb_cstr_to_dbl): check for successive underscores.
- [ruby-dev:33952]
-
-Sat Mar 1 17:59:01 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * io.c (struct argf): packed ARGF stuffs.
-
- * ruby.c (proc_options): use ruby_set_inplace_mode().
-
-Sat Mar 1 17:51:34 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/test/unit/collector/dir.rb (recursive_collect): do not always
- include all test_*.rb.
-
-Sat Mar 1 14:14:17 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * development snapshot 1.9.0-1 released.
-
-Sat Mar 1 13:46:26 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * tool/make-snapshot: make prereq uses MINIRUBY.
-
- * tool/make-snapshot: allow packaging like 1.9.0-1 by second
- command-line argument.
-
-Sat Mar 1 13:11:03 2008 Tanaka Akira <akr@fsij.org>
-
- * test/ruby/allpairs.rb: new file for all pairs method.
-
- * test/ruby/test_m17n_comb.rb: use allpairs.rb to reduce test cases.
-
- * test/ruby/test_sprintf_comb.rb: ditto.
-
-Sat Mar 1 12:34:21 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * string.c (sym_inspect): use rb_str_inspect() instead of
- rb_str_dump(). [ruby-dev:33946]
-
-Sat Mar 1 12:15:42 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval_method.c (rb_get_method_body): ent->method may be freed by
- GC. [ruby-dev:31819]
-
- * thread.c (remove_event_hook): should not access freed memory.
- [ruby-dev:31820]
-
-Sat Mar 1 10:31:19 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * io.c (read_all, rb_io_getline_fast): encoding is io_input_encoding.
-
-Sat Mar 1 10:09:40 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * string.c (tr_setup_table, rb_str_split_m, rb_str_chomp_bang):
- simplified with rb_enc_ascget(). [ruby-dev:33944]
-
-Sat Mar 1 10:01:30 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * string.c (rb_str_coderange_scan_restartable): should not return
- offset in the middle of a character.
-
- * string.c (rb_str_coderange_scan_restartable): should not return
- invalid cr value.
-
-Sat Mar 1 09:36:08 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * sprintf.c (rb_str_format): "%#.0o" should keep prefix where
- "%#.0x" should not.
-
Sat Mar 1 02:35:08 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* bignum.c (big2str_find_n1): check integer overflow.
-Sat Mar 1 00:29:07 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * encoding.c (rb_enc_dummy_p): bootstrap encodings can not be dummy.
-
- * encoding.c (rb_enc_ascget): no needs to call rb_enc_precise_mbclen()
- twice.
-
-Fri Feb 29 23:14:38 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * test/ruby/test_m17n_comb.rb (TestM17NComb::test_str_chomp): test
- updated.
-
-Fri Feb 29 20:58:09 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * test/ruby/test_iterator.rb (TestIterator::test_enumerator):
- adjust test for zip behavior reversion.
-
-Fri Feb 29 20:25:07 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * string.c (rb_str_chomp_bang): now works on UTF-16.
-
- * string.c (tr_setup_table): negation should work on non ASCII
- compatible strings as well.
-
- * string.c (rb_str_split_m): awk split should work on non ASCII
- compatible strings as well.
-
-Fri Feb 29 18:08:43 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * time.c (time_strftime): format should be ascii compatible.
-
- * parse.y (rb_intern3): non ASCII compatible symbols.
-
- * re.c (rb_reg_regsub): add encoding check.
-
- * string.c (rb_str_chomp_bang): ditto.
-
- * test/ruby/test_utf16.rb (TestUTF16::test_chomp): raises exception.
-
-Fri Feb 29 15:16:31 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * string.c (rb_str_rpartition): calculation was done in byte indexing.
-
- * test/ruby/test_m17n_comb.rb (TestM17NComb::test_str_start_with):
- allow start_with? matching on broken strings.
-
-Fri Feb 29 15:12:43 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (opt_block_param): command can start just after block param
- definition. [ruby-list:44479]
-
-Fri Feb 29 03:22:19 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * test/ruby/test_time.rb (test_readers): fix typo.
- (test_strftime): "UTC" is also ok for time.gmtime.strftime("%Z").
-
-Fri Feb 29 02:50:07 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * string.c (str_new): remove encoding assumption of empty string.
-
- * hash.c ( rb_f_getenv, env_fetch, env_inspect): result of ENV should
- be always ASCII-8BIT.
-
- * object.c (nil_to_s): nil.to_s should be US-ASCII.
-
-Fri Feb 29 02:24:22 2008 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tk/lib/tk.rb: forgot to update RELEASE_DATE
-
- * ext/tk/lib/tk.rb, ext/tk/lib/tk/text.rb,
- ext/tk/lib/tkextlib/iwidgets/scrolledtext.rb: remove adhoc check
- of Ruby's features (use existence of some classes instead of
- comparing with RUBY_VERSION)
-
- * ext/tk/lib/tk/root.rb, ext/tk/lib/tk/autoload.rb: make TkRoot
- (Tk::Root) unswitchable
-
- * ext/tk/lib/multi-tk.rb: partial bug fix (still not work!!)
-
-Thu Feb 28 23:37:12 2008 Tanaka Akira <akr@fsij.org>
-
- * lib/open-uri.rb (OpenURI::Meta#meta_setup_encoding): use ASCII-8BIT
- for charset unspecified non-text data.
-
-Thu Feb 28 22:19:14 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * encoding.c (enc_capable): IMMEDIATE_P doesn't include Qnil and Qfalse.
- use SPECIAL_CONST_P.
-
-Thu Feb 28 19:45:52 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * encoding.c (enc_find): check type of argument and convert to String
- if it is StringValue. [ruby-cvs:22866]
-
-Thu Feb 28 18:07:52 2008 Tanaka Akira <akr@fsij.org>
-
- * lib/open-uri.rb (OpenURI::Meta#meta_setup_encoding): setup encoding
- by charset.
- (OpenURI::Meta#meta_add_field): call meta_setup_encoding when
- content-type.
-
-Thu Feb 28 15:29:12 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * io.c (rb_io_getline_fast): scan coderange.
-
-Thu Feb 28 14:36:46 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * string.c (rb_enc_str_copy): removed.
-
-Thu Feb 28 13:51:59 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval.c (stack_check): made flag per threads.
-
- * thread.c (rb_thread_set_raised, rb_thread_reset_raised): prefixed.
-
-Thu Feb 28 11:43:56 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * file.c (rb_file_flock): immediately returns on EAGAIN if
- non-blocking. [ruby-core:15672]
-
-Thu Feb 28 11:23:50 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * io.c (rb_io_getline_1): get rid of segfault. [ruby-dev:33938]
-
-Thu Feb 28 11:19:51 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * string.c (rb_str_reverse_bang): removed unused variables.
-
- * include/ruby/encoding.h (rb_str_coderange_scan_restartable): added
- prototype.
-
- * string.c (rb_str_coderange_scan_restartable, rb_str_times): removed
- unused variables.
-
- * string.c (rb_str_reverse_bang): ditto
-
- * string.c (rb_enc_str_copy): unused now. may be used in future?
-
-Thu Feb 28 03:03:32 2008 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tk/lib/tk.rb, ext/tk/lib/*: make default widget set
- switchable between Tk (standard Tcl/Tk widget set) and
- Ttk (Tile). Initial default widget set is Tk. Now, toplevel
- widget classes are removed and defined as aliases.
- For example, "TkButton" is an alias of the "Tk::Button" class.
- Those aliases are replaced when switching default widget set.
- "Tk.default_widget_set=" is the method for switching default
- widget set. "Tk.default_widget_set = :Ttk" defines Ttk (Tile)
- widget set as default. It means that "TkButton" denotes
- "Tk::Tile::Button" class. And then, "TkButton.new" creates
- a Tk::Tile::Button widget. Of course, you can back to use
- standard Tk widgets as the default widget set by calling
- "Tk.default_widget_set = :Tk", whenever you want. Based on
- the feature, you can use Ttk widget styling engine on your
- old Ruby/Tk application without modifying its source, if you
- don't use widget options unsupported on Ttk widgets (At first,
- call "Tk.default_widget_set = :Ttk", and next load and run
- your application).
- This is one step for supporting Tcl/Tk8.5 features.
-
-Wed Feb 27 22:55:42 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * string.c (rb_str_coderange_scan_restartable): coderange scanning
- for partial read.
-
- * io.c (read_all): set coderange when not convert encoding.
-
-Wed Feb 27 03:55:58 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/extmk.rb, enc/make_encmake.rb: load current mkmf.rb even if
- cross-compiling.
-
- * ext/extmk.rb, enc/make_encmake.rb, lib/mkmf.rb: need to be 1.8
- compatible for cross-compiling.
-
-Tue Feb 26 16:53:13 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * misc/ruby-mode.el (ruby-calculate-indent): should distinguish
- comment and # in strings. [ruby-dev:33874]
-
-Tue Feb 26 16:41:27 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * array.c (combi_len, rb_ary_product): check for overflow.
- [ruby-Bugs-18355]
-
-Tue Feb 26 16:38:10 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * array.c (recursive_cmp): compare minimal length parts.
-
Tue Feb 26 16:06:00 2008 Technorama Ltd. <oss-ruby@technorama.net>
- * ext/openssl/ossl_{ec,dh,dsa,rsa}.c: Remove useless warnings.
+ * ext/openssl/ossl_pkey_{ec,dh,dsa,rsa}.c: Remove useless warnings.
* ext/openssl/ossl_asn1.c: Simplify code.
* ext/openssl/ossl_ssl_session.c Fix compiler warnings.
Undefine #id if SSL_SESSION_get_id is not supported.
-Tue Feb 26 15:50:10 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (value_expr_gen): removed inappropriate warning.
- [ruby-core:15660]
-
Tue Feb 26 15:43:42 2008 Tanaka Akira <akr@fsij.org>
* parse.y (tokadd_escape): refactored. [ruby-core:15657]
-Tue Feb 26 15:30:36 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * array.c (rb_ary_eql, rb_ary_cmp): get rid of stack overflow with
- self-recursive constructs. [ruby-Bugs-18356]
-
-Tue Feb 26 01:16:01 2008 Tanaka Akira <akr@fsij.org>
-
- * include/ruby/ruby.h (ROBJECT_NUMIV): renamed from ROBJECT_LEN.
- (ROBJECT_IVPTR): renamed from ROBJECT_PTR.
-
- * variable.c: follow the above renaming.
-
- * object.c: ditto.
-
- * gc.c: ditto.
-
- * marshal.c: ditto.
-
Mon Feb 25 17:30:29 2008 Technorama Ltd. <oss-ruby@technorama.net>
* ext/openssl/digest.c ext/openssl/lib/openssl/digest.rb:
@@ -26245,171 +2635,29 @@ Mon Feb 25 17:30:29 2008 Technorama Ltd. <oss-ruby@technorama.net>
existing Digest framework.
Enhance performance.
-Mon Feb 25 15:33:29 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * bignum.c (big2str_karatsuba): initialize cache if not initialized.
-
- * bignum.c (Init_Bignum): delayed initializing cache.
- [ruby-dev:33930]
-
Mon Feb 25 13:40:03 2008 Tanaka Akira <akr@fsij.org>
* process.c (Init_process): share bignum objects for RLIM_INFINITY,
RLIM_SAVED_MAX and RLIM_SAVED_CUR if they are equal.
-Mon Feb 25 10:41:41 2008 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * encoding.c (Encoding#dummy): minor grammatical fixes
- in rdoc documentation.
-
-Mon Feb 25 00:01:03 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * cygwin/GNUmakefile.in (clean-local): should be double-colon.
-
-Sun Feb 24 23:39:59 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun Feb 24 23:29:48 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* common.mk, {bcc,win}32/Makefile.sub (clean-local): remove
intermediate files.
- * cygwin/GNUmakefile.in (clean-local): remove def file.
-
-Sun Feb 24 06:49:12 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * debug.c (ruby_set_debug_option): separated ruby_each_words().
-
- * util.c (ruby_each_words): extracted from ruby_set_debug_option().
-
- * ruby.c (enable_option, disable_option): allow all for all known
- features.
-
- * ruby.c (proc_options): generalized enable/disable options.
-
- * ruby.c (ruby_init_gems): take enabled flag. [ruby-core:14840]
-
- * ruby.c (process_options): added --disable-rubyopt flag.
-
- * include/ruby/util.h (ruby_each_words): prototype.
-
-Sun Feb 24 05:25:26 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ruby.c (proc_options): check if argument for -E exists.
-
-Sun Feb 24 05:09:43 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * misc/ruby-style.el (ruby-style-label-indent): fix for labels inside
- blocks in switch.
-
Sun Feb 24 03:52:58 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* util.c (valid_filename): use O_EXCL to get rid of clobbering
existing files in race conditions.
-Sat Feb 23 21:36:13 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * ext/win32ole/win32ole.c (ole_init_cp): should return value.
-
-Sat Feb 23 20:16:05 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * string.c (str_sublen): removed.
-
- * string.c (rb_str_reverse, rb_str_reverse_bang): use
- single_byte_optimizable.
-
-Sat Feb 23 19:25:18 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * string.c (rb_enc_cr_str_copy_for_substr): renamed from
- rb_enc_cr_str_copy.
-
- * string.c: use rb_enc_cr_str_copy_for_substr and keep coderange.
-
-Sat Feb 23 18:50:17 2008 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-
- * ext/win32ole/win32ole.c (ole_encoding2cp): remove US-ASCII
- mapping.
-
-Sat Feb 23 01:09:47 2008 Tanaka Akira <akr@fsij.org>
-
- * process.c (rlimit_resource_type): new function.
- (rlimit_resource_value): new function.
- (proc_getrlimit): use rlimit_resource_type to accept
- symbol and string as resource type.
- (proc_setrlimit): use rlimit_resource_type and rlimit_resource_value
- to accept symbol and string as resource type and values.
-
-Fri Feb 22 21:12:42 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * string.c (rb_enc_cr_str_copy): check string's coderange is 7bit or
- valid.
-
Fri Feb 22 19:50:19 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* bignum.c (BIGZEROP): fix for longer Bignum zeros. [ruby-Bugs-17454]
-Fri Feb 22 15:47:36 2008 Tanaka Akira <akr@fsij.org>
-
- * encoding.c (rb_enc_mbclen): return minlen instead of 1 when
- a character is not found properly.
-
- * string.c (rb_enc_strlen): round up string length with fixed
- multibyte encoding such as UTF-32.
- (rb_enc_strlen_cr): ditto.
- (rb_str_substr): fix substring with fixed multibyte encoding.
- (rb_str_justify): check number of characters.
-
-Fri Feb 22 12:11:12 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * string.c (rb_str_inspect): string of ascii incompatible encoding
- should be escaped and returned as US-ASCII encoding.
-
-Fri Feb 22 11:16:55 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * string.c (rb_str_substr): copy encoding although empty string.
-
-Fri Feb 22 04:48:22 2008 NARUSE, Yui <naruse@ruby-lang.org>
+Fri Feb 22 16:09:53 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * string.c (rb_str_times): empty string's coderange is CODERANGE_7BIT.
-
- * string.c (rb_str_substr): ditto.
-
- * encoding.c (rb_enc_compatible): empty string is compatible with not
- only nonasciicompatible strings. [ruby-dev:33895]
-
-Thu Feb 21 17:15:15 2008 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * transcode.c: Added basic support for passing options to String#encode
- via a hash. Currently only one option, with one value, is supported:
- invalid: :ignore (dropping invalid byte sequences instead of
- producing an error). Option naming is not yet stable!
-
- * test/ruby/test_transcode.rb: Added a single test for invalid: :ignore
- option. Not more tests because most data does not yet distinguish
- between INVALID and UNKNOWN.
-
-Thu Feb 21 16:35:26 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * array.c (rb_ary_unshift_m): expands enough for argc. [ruby-dev:33880]
-
-Thu Feb 21 14:49:40 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * io.c (argf_set_encoding): uses current_file after check if next
- input is available.
-
-Thu Feb 21 14:13:38 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * io.c (rb_f_putc): invoke stdout method so that redefining putc
- may take effect. [ruby-talk:291844]
-
- * io.c (rb_f_puts): ditto.
-
-Thu Feb 21 11:10:49 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * string.c: replace rb_enc_copy by rb_enc_cr_str_copy or
- rb_enc_cr_str_exact_copy.
-
-Thu Feb 21 10:35:04 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * include/ruby/encoding.h (rb_enc_asciicompat): dummy encoding is not
- ascii compatible. [ruby-dev:33878]
+ * bignum.c (rb_big_lshift, rb_big_rshift, rb_big_aref): removed excess
+ arguments.
Thu Feb 21 00:01:34 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
@@ -26420,29 +2668,6 @@ Wed Feb 20 23:55:19 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* win32/win32.c (rb_w32_map_errno): exported.
-Wed Feb 20 23:28:43 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * ext/readline/extconf.rb (rl_event_hook): workaround for native
- windows.
-
-Wed Feb 20 19:42:03 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * encoding.c (rb_enc_associate_index): doesn't clear coderange
- when new encoding equals to old one.
-
-Wed Feb 20 19:15:38 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * string.c (rb_enc_str_copy): added for wrapper for rb_enc_copy.
- this also copy coderange when ptr and len is equal.
-
- * string.c (rb_enc_cr_str_copy): added for wrapper for rb_enc_copy.
- this always copy coderange.
-
- * string.c (str_replace_shared): use rb_enc_str_copy.
-
- * string.c (str_new3): don't rb_enc_copy because encoding is copied
- at str_replace_shared.
-
Wed Feb 20 13:08:52 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* instruby.rb (parse_args): added --dir-mode, --script-mode and
@@ -26452,7 +2677,7 @@ Wed Feb 20 13:08:52 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
type, for compiled files and script files.
* instruby.rb (parse_args): deal with make style command line macros,
- and count as long style options if prefixed with INSTALL_.
+ and count as long syle options if prefixed with INSTALL_.
* instruby.rb (makedirs): use $dir_mode. [ruby-dev:33805]
@@ -26462,21 +2687,6 @@ Wed Feb 20 13:08:52 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* instruby.rb (bin-comm): installs scripts with replacing shebang
lines.
-Wed Feb 20 10:04:22 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * io.c (open_key_args): set arg->io even if no options passed.
- [ruby-dev:33072]
-
-Tue Feb 19 21:11:49 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * string.c (rb_enc_strlen_cr): get length with coderange scan.
-
- * string.c (str_strlen): use rb_enc_strlen_cr. [ruby-dev:33849]
-
-Tue Feb 19 20:49:49 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval.c (rb_raise_jump): moved adjustment for control frame.
-
Tue Feb 19 18:34:32 2008 Tanaka Akira <akr@fsij.org>
* gc.c (STACK_LENGTH) [SPARC] : 0x80 offset removed. [ruby-dev:33857]
@@ -26486,272 +2696,39 @@ Tue Feb 19 14:27:32 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ext/readline/readline.c (readline_event): prevent polling. based on
a patch from error errorsson in [ruby-Bugs-17675].
-Tue Feb 19 11:14:13 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval.c (ruby_exec_node): no thread starts inside iseq compilation.
-
- * eval.c (rb_f_raise): skip current control frame. [ruby-core:15589]
-
- * insns.def (opt_div): raise as the ordinary method. [ruby-core:15589]
-
-Mon Feb 18 15:16:30 2008 Tanaka Akira <akr@fsij.org>
+Tue Feb 19 12:08:29 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * string.c (rb_str_each_line): fix newline size.
+ * parse.y (yycompile): clear ruby_eval_tree_begin if parse failed.
-Mon Feb 18 13:06:37 2008 Tanaka Akira <akr@fsij.org>
+Mon Feb 18 16:23:45 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/irb/locale.rb (IRB::Locale#lc2kconv): check ja_JP.EUC-JP as well.
-
-Mon Feb 18 11:51:19 2008 Tanaka Akira <akr@fsij.org>
-
- * re.c (re_warn): defined to restore warnings for /[a-c-e]/, etc.
+ * parse.y (yycompile): clear ruby_eval_tree_begin too before parse.
Mon Feb 18 10:17:42 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ext/pty/lib/expect.rb (IO#expect): check if peer is closed.
[ruby-Bugs-17940]
-Mon Feb 18 00:33:03 2008 Tanaka Akira <akr@fsij.org>
-
- * re.c (rb_reg_regsub): don't repeat repl twice with
- "X".sub!(/./, sprintf("\\%c", 255)).
-
-Sun Feb 17 23:06:55 2008 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-
- * lib/cgi.rb (CGI::escapeHTML): use gsub with Hash. [ruby-dev:33828]
-
-Sun Feb 17 21:38:21 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * encoding.c (ENC_CODERANGE_AND): fix broken case. [ruby-dev:33826]
-
- * string.c (rb_str_times): fix broken case. [ruby-dev:33826]
-
-Sun Feb 17 20:45:10 2008 Tanaka Akira <akr@fsij.org>
-
- * re.c (rb_reg_prepare_re): add enable_warning parameter.
- (rb_reg_adjust_startpos): disable warning by rb_reg_prepare_re.
- (rb_reg_search): follow rb_reg_prepare_re parameter change.
-
-Sun Feb 17 20:12:41 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * test/ruby/test_regexp.rb: add tests to achieve over 90% test
- coverage of re.c.
-
-Sun Feb 17 15:25:08 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * encoding.c (ENC_CODERANGE_AND): added.
-
- * string.c (rb_str_plus, rb_str_times): keep coderange.
-
- * parse.y (STR_NEW0) use rb_usascii_str_new.
-
-Sun Feb 17 14:07:24 2008 Tanaka Akira <akr@fsij.org>
-
- * string.c (str_strlen): rb_enc_strlen doesn't fail.
-
-Sun Feb 17 13:03:48 2008 Tanaka Akira <akr@fsij.org>
-
- * string.c (str_sublen): use rb_enc_strlen.
-
-Sun Feb 17 12:17:52 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * enc/{euc_jp.c,gbk.c,iso_8859_1.c,iso_8859_11.c,iso_8859_13.c,
- iso_8859_2.c,iso_8859_6.c,iso_8859_7.c,iso_8859_8.c,iso_8859_9.c,
- shift_jis.c,windows_1251.c}: add document about encodings.
-
- * enc/cp949.c: divided into new file.
-
-Sun Feb 17 10:59:04 2008 Tanaka Akira <akr@fsij.org>
-
- * re.c (rb_reg_quote): return US-ASCII string consistently.
-
-Sun Feb 17 09:17:08 2008 Tanaka Akira <akr@fsij.org>
-
- * string.c (rb_str_times): reduce loop overhead.
-
-Sun Feb 17 03:37:01 2008 Tanaka Akira <akr@fsij.org>
-
- * include/ruby/re.h (struct rmatch_offset): new struct for character
- offsets.
- (struct rmatch): new struct.
- (struct RMatch): reference struct rmatch.
- (RMATCH_REGS): new macro.
-
- * re.c (match_alloc): initialize struct rmatch.
- (pair_byte_cmp): new function.
- (update_char_offset): update character offsets.
- (match_init_copy): copy regexp and character offsets.
- (match_sublen): removed.
- (match_offset): use update_char_offset.
- (match_begin): ditto.
- (match_end): ditto.
- (rb_reg_search): make character offset updated flag false.
- (match_size): use RMATCH_REGS.
- (match_backref_number): ditto.
- (rb_reg_nth_defined): ditto.
- (rb_reg_nth_match): ditto.
- (rb_reg_match_pre): ditto.
- (rb_reg_match_post): ditto.
- (rb_reg_match_last): ditto.
- (match_array): ditto.
- (match_aref): ditto.
- (match_values_at): ditto.
- (match_inspect): ditto.
-
- * string.c (rb_str_subpat_set): use RMATCH_REGS.
- (rb_str_sub_bang): ditto.
- (str_gsub): ditto.
- (rb_str_split_m): ditto.
- (scan_once): ditto.
-
- * gc.c (obj_free): free character offsets.
-
-Sun Feb 17 03:13:40 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/resource.rb: made version infos confirm to OS spec.
-
- * {bcc32,win32}/Makefile.sub (*.rc): add dependency.
-
-Sat Feb 16 20:49:34 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * string.c (rb_str_substr): optimized for UTF-8.
-
-Sat Feb 16 18:13:53 2008 Tanaka Akira <akr@fsij.org>
-
- * encoding.c (rb_enc_compatible): check encoding incapable arguments.
-
-Sat Feb 16 20:12:47 2008 Tanaka Akira <akr@fsij.org>
-
- * re.c (match_inspect): avoid SEGV with MatchData.allocate.inspect.
-
-Sat Feb 16 19:04:17 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * string.c (str_strlen): revert r15507. [ruby-dev:33810]
-
-Sat Feb 16 18:25:14 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * string.c (str_strlen): little more optimization.
- (rb_enc_nth): remove needless variable 'c'.
-
-Sat Feb 16 18:00:13 2008 Tanaka Akira <akr@fsij.org>
+Fri Feb 15 20:37:06 2008 Tadayoshi Funaba <tadf@dotrb.org>
- * encoding.c (rb_enc_compatible): empty strings are always compatible.
-
- * string.c (rb_enc_cr_str_buf_cat): ditto.
-
-Sat Feb 16 16:14:35 2008 Tanaka Akira <akr@fsij.org>
-
- * string.c (rb_enc_strlen): UTF-8 character count moved to str_strlen.
- (str_strlen): UTF-8 character count is only applicable for valid
- UTF-8 string. [ruby-dev:33807]
-
-Sat Feb 16 13:16:49 2008 Tanaka Akira <akr@fsij.org>
-
- * string.c (rb_str_sub_bang): stringize replacing hash values.
- (str_gsub): ditto.
-
-Sat Feb 16 13:01:33 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * string.c (rb_enc_strlen): add search_nonascii like character
- counter for UTF-8.
-
-Sat Feb 16 11:53:35 2008 Tanaka Akira <akr@fsij.org>
-
- * encoding.c (rb_enc_strlen): moved to string.c.
-
- * string.c (rb_enc_strlen): use search_nonascii.
- (str_strlen): don't use search_nonascii.
-
-Sat Feb 16 11:45:31 2008 Tanaka Akira <akr@fsij.org>
-
- * lib/require_relative.rb: check require_relative call in eval.
-
-Sat Feb 16 08:00:01 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * ruby.c (process_options): set default_external before loading
- libraries. [ruby-dev:33801]
-
-Sat Feb 16 05:49:54 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * enc/iso_8859_{4,13}.c: Windows-1257 is replica of ISO-8859-13.
-
- * string.c (single_byte_optimizable): rb_enc_mbminlen must be 1
- when rb_enc_mbmaxlen is 1.
-
-Sat Feb 16 03:43:18 2008 Tanaka Akira <akr@fsij.org>
-
- * encoding.c (rb_enc_nth): moved to string.c.
-
- * string.c (rb_enc_nth): moved from string.c. use search_nonascii
- for ASCII compatible string.
- (str_nth): wrong optimization removed to fix
- "a".force_encoding("EUC-JP").slice!(0,10) returns
- "a\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-
-Sat Feb 16 00:21:49 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * range.c (rb_range_beg_len): check if responds to "begin" and "end"
- methods for non-Range object.
-
-Fri Feb 15 20:29:42 2008 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-
- * ext/win32ole/win32ole.c (ole_init_cp): initialize WIN32OLE.codepage
- according to Encoding.default_external.
-
- * test/win32ole/test_win32ole.rb: ditto.
-
-Fri Feb 15 19:31:23 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * include/ruby/node.h (NODE_FL_NEWLINE): renamed from NODE_NEWLINE
- to denote its a flag. [ruby-core:15529]
-
-Fri Feb 15 18:23:54 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * string.c (rb_str_sub_bang, str_gsub): allows hash for replacement.
-
-Fri Feb 15 17:12:41 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * string.c (str_strlen): use search_nonascii() for performance.
-
- * string.c (str_nth): ditto.
-
-Fri Feb 15 16:22:49 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * io.c (open_key_args): allow specifying both :mode and :encoding.
+ * lib/rational.rb (floor, ceil, truncate, round): do not use
+ definitions of Numeric.
-Fri Feb 15 15:34:47 2008 Tanaka Akira <akr@fsij.org>
+ * lib/rational.rb (to_i): should returns truncated self.
- * string.c (rb_str_getbyte): new method.
- (rb_str_setbyte): new method.
+ * lib/complex.rb (numerator): requires
+ Integer#{numerator,denominator}.
-Fri Feb 15 15:29:03 2008 Tanaka Akira <akr@fsij.org>
+ * lib/complex.rb (quo): do not use definition of Numeric.
- * lib/require_relative.rb: new file.
+ * lib/complex.rb (div, divmod, floor, ceil, truncate, round):
+ undef'ed.
Fri Feb 15 15:23:12 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ext/iconv/iconv.c (iconv_convert): check upper bound. a patch from
Daniel Luz at [ruby-Bugs-17910].
-Fri Feb 15 10:35:54 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * re.c (rb_reg_quote): set US-ASCII for ASCII-only string.
- [ruby-dev:33785]
-
-Fri Feb 15 10:27:47 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * {win,bcc}32/Makefile.sub (config.h): added HAVE_FTRUNCATE.
- [ruby-dev:33786]
-
-Fri Feb 15 09:44:11 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (reg_compile_gen): reg_fragment_setenc might not raise an
- exception before rb_reg_compile.
-
-Fri Feb 15 07:37:40 2008 Eric Hodel <drbrain@segment7.net>
-
- * lib/rdoc/ri/paths.rb: Preserve compatibility with 1.8.
-
Fri Feb 15 02:42:25 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* configure.in (ftruncate): check if available.
@@ -26765,33 +2742,15 @@ Fri Feb 15 02:40:54 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* signal.c (USE_TRAP_MASK): set true if sigprocmask or sigsetmask is
available.
-Thu Feb 14 23:56:38 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval_error.c (error_print): append a newline to rest lines.
-
- * parse.y (reg_compile_gen): appends error message from
- rb_reg_compile() to one from reg_fragment_setenc().
-
-Thu Feb 14 21:00:14 2008 Tanaka Akira <akr@fsij.org>
-
- * io.c (io_reopen): check STDIN, STDOUT and STDERR mode according to
- stdio streams.
-
-Thu Feb 14 16:07:40 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
+Thu Feb 14 17:44:32 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
- * test/ruby/test_math.rb: actual-expected argument ordering for
- test_math.rb fixed. a patch from Tadashi Saito
- <shiba AT mail2.accsnet.ne.jp> in [ruby-dev:33770].
+ * ext/dl/ptr.c (dlmem_each_i): typo fixed. a patch from IKOMA
+ Yoshiki <ikoma AT mb.i-chubu.ne.jp> in [ruby-dev:33776].
Thu Feb 14 16:02:51 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* file.c (rb_file_s_utime): inhibits with secure level 2 or higher.
-Thu Feb 14 12:30:02 2008 Tanaka Akira <akr@fsij.org>
-
- * re.c (rb_reg_preprocess_dregexp): use non-preprocessed regexp source
- for result.
-
Thu Feb 14 01:43:16 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/timeout.rb (Timeout::timeout): made sensitive to location on the
@@ -26803,186 +2762,15 @@ Thu Feb 14 00:49:53 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* instruby.rb (parse_args): added --data-mode and --prog-mode options.
-Thu Feb 14 00:02:19 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * eval.c (eval): allow to eval in a binding that has a singleton method.
- [ruby-dev:33763]
-
- * test/ruby/test_proc.rb: add tests to achieve over 70% test coverage
- of proc.c.
-
- * test/ruby/test_method.rb: ditto.
-
-Wed Feb 13 22:46:36 2008 Tanaka Akira <akr@fsij.org>
-
- * lib/pathname.rb (Pathname#sub_ext): new method. [ruby-list:44608]
-
-Wed Feb 13 21:50:32 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * proc.c (proc_curry): new method. [ruby-dev:33676]
-
- * test/ruby/test_proc.rb: add tests for above.
+Tue Feb 12 11:33:26 2008 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
-Wed Feb 13 20:48:50 2008 Tanaka Akira <akr@fsij.org>
+ * test/erb/test_erb.rb(TestERBCore): import from erb-2.0.4.
- * include/ruby/ruby.h (RObject): add iv_index_tbl for shortcut of
- RCLASS_IV_INDEX_TBL(rb_obj_class(obj)).
- (ROBJECT_IV_INDEX_TBL): defined.
+ * test/erb/hello.erb: ditto
- * object.c (init_copy): initialize iv_index_tbl in struct RObject.
-
- * variable.c (ivar_get): use ROBJECT_IV_INDEX_TBL.
- (rb_ivar_defined): ditto.
- (obj_ivar_each): ditto.
- (rb_obj_remove_instance_variable): ditto.
- (rb_ivar_set): update iv_index_tbl in struct RObject.
-
-Wed Feb 13 16:21:48 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * lib/uri/generic.rb: revert r15442. 2nd argument of String#sub parse
- escapes. [ruby-dev:33726]
-
- * bootstraptest/test_method.rb, enc/depend, instruby.rb, lib/mkmf.rb,
- mkconfig.rb: revert r15443. ditto.
-
-Wed Feb 13 11:20:26 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * enc/depend: fix typo.
-
- * lib/mkmf.rb: revert r15443. "\\1#{sep}\\2" is wrong if sep is ended
- with "\\".
-
-Wed Feb 13 08:57:21 2008 Eric Hodel <drbrain@segment7.net>
-
- * lib/rdoc/markup/inline.rb: Allow inline markup to have a leading
- '#' or '\', or trailing punctuation. i.e. *#freeze?*, *\foo?*.
-
-Wed Feb 13 07:21:23 2008 Eric Hodel <drbrain@segment7.net>
-
- * lib/rdoc/to_html_hyperlink.rb: Moved linking to to_html.rb, move
- crossref to to_html_crossref.rb
-
-Wed Feb 13 04:15:44 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (arg_concat_gen, arg_append_gen): optimize for array push.
-
- * parse.y (arg_concat_gen): optimize for array concat.
-
- * parse.y (arg_add_gen): removed since identical to arg_append_gen.
-
-Tue Feb 12 21:04:51 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (exc_list): should use mrhs if non array.
-
-Tue Feb 12 20:32:50 2008 Tadayoshi Funaba <tadf@dotrb.org>
-
- * lib/rational.rb (floor, ceil, truncate, round): do not use
- definitions of Numeric.
+Mon Feb 11 17:25:21 2008 Kouhei Sutou <kou@cozmixng.org>
- * lib/rational.rb (to_i): should returns truncated self.
-
- * lib/complex.rb (numerator): requires
- Integer#{numerator,denominator}.
-
- * lib/complex.rb (quo): do not use definition of Numeric.
-
- * lib/complex.rb (>, >=, <, <=, between?, div, divmod, modulo,
- floor, ceil, truncate, round): undef'ed.
-
- * lib/mathn.rb (Rational#inspect): removed.
-
-Tue Feb 12 16:48:10 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (args, mrhs): flattens literal array splats.
-
- * parse.y (exc_list): splat literal array.
-
-Tue Feb 12 15:27:19 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * bootstraptest/runner.rb, bootstraptest/test_method.rb, enc/depend,
- instruby.rb, lib/mkmf.rb, lib/test/unit/util/procwrapper.rb,
- mkconfig.rb, sample/test.rb, template/vm.inc.tmpl,
- test/ruby/test_stringchar.rb: fixes around String#gsub.
-
-
-Tue Feb 12 15:11:47 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * ext/json/lib/json/pure/generator.rb,
- ext/json/lib/json/pure/parser.rb, ext/openssl/lib/openssl/x509.rb,
- ext/win32ole/sample/olegen.rb, lib/date/format.rb, lib/irb/context.rb,
- lib/irb/workspace.rb, lib/net/http.rb, lib/net/imap.rb,
- lib/rdoc/generator.rb, lib/rdoc/markup/to_html.rb,
- lib/rdoc/markup/to_latex.rb, lib/rdoc/parsers/parse_c.rb,
- lib/rdoc/ri/formatter.rb, lib/rexml/parsers/baseparser.rb,
- lib/rexml/quickpath.rb, lib/rexml/text.rb, lib/rss/parser.rb,
- lib/uri/common.rb, lib/uri/generic.rb, lib/webrick/httpresponse.rb,
- lib/webrick/httpservlet/filehandler.rb, lib/yaml/baseemitter.rb,
- lib/yaml/encoding.rb: performance tuning around String#gsub.
-
-Tue Feb 12 12:16:45 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * string.c (rb_str_hash_cmp): lighter version of rb_str_cmp() for
- hash comparison function.
-
- * hash.c (rb_any_cmp): use rb_str_hash_cmp().
-
- * string.c (rb_str_casecmp): should return nil for incompatible
- comparison.
-
-Tue Feb 12 12:13:25 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * instruby.rb: specify file mode to install. a patch from
- pegacorn <subscriber.jp AT gmail.com> in [ruby-dev:33699].
-
-Tue Feb 12 11:38:57 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * numeric.c (rb_num_coerce_bin): add ID argument to specify
- caller's method name. [ruby-dev:33663]
-
- * numeric.c (rb_num_coerce_cmp): ditto.
-
- * numeric.c (rb_num_coerce_relop): ditto.
-
- * ext/bigdecimal/bigdecimal.c (DoSomeOne): add function name argument.
-
-Tue Feb 12 10:25:02 2008 Eric Hodel <drbrain@segment7.net>
-
- * lib/rdoc/rdoc.rb: Wrap parse_files' read in version check for
- backwards compatibility.
-
-Tue Feb 12 10:15:14 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * ruby.c (load_file): enc must effect source encoding.
- [ruby-core:15496]
-
-Tue Feb 12 10:16:47 2008 Eric Hodel <drbrain@segment7.net>
-
- * lib/rdoc/ri/paths.rb: Restore require rubygems check.
-
-Tue Feb 12 02:42:27 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * range.c (range_include): specialize single character string
- case (e.g. (?a ..?z).include(?x)) for performance.
- [ruby-core:15481]
-
- * string.c (rb_str_upto): specialize single character case.
-
- * string.c (rb_str_hash): omit coderange scan for performance.
-
- * object.c (rb_check_to_integer): check Fixnum first.
-
- * object.c (rb_to_integer): ditto.
-
- * string.c (rb_str_equal): inline memcmp to avoid unnecessary
- rb_str_comparable().
-
- * parse.y (rb_intern2): use US-ASCII encoding.
-
- * parse.y (rb_intern_str): ditto.
-
-Mon Feb 11 17:21:18 2008 Kouhei Sutou <kou@cozmixng.org>
-
- * lib/rss/rss.rb (RSS::VERSION), test/rss/test_version.rb:
+ * lib/rss/rss.rb (RSS::VERSION), test/rss/test_version.rb, NEWS:
0.2.3 -> 0.2.4.
* lib/rss/maker.rb, lib/rss/maker/, test/rss/test_maker_2.0.rb:
@@ -26993,86 +2781,28 @@ Mon Feb 11 17:21:18 2008 Kouhei Sutou <kou@cozmixng.org>
* lib/rss/maker/0.9.rb, test/rss/test_maker_0.9.rb:
RSS::Maker.make("0.9") generates RSS 0.92 not RSS 0.91.
-Mon Feb 11 10:43:31 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * ruby.c (load_file): the encoding of DATA follows the source
- file encoding. [ruby-dev:33693]
-
-Mon Feb 11 06:50:42 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * test/ruby/test_pack.rb: fix tests for 64bit CPU.
+Mon Feb 11 16:57:00 2008 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
- * test/ruby/test_bignum.rb: ditto.
-
- * test/ruby/test_file_exhaustive.rb: ditto.
-
- * test/ruby/test_integer.rb: ditto.
+ * ChangeLog: format-time-string under C locale. [ruby-dev:33261]
- * test/ruby/test_time.rb: ditto.
+Mon Feb 11 16:31:47 2008 URABE Shyouhei <shyouhei@ice.uec.ac.jp>
- * test/ruby/test_numeric.rb: ditto.
+ * gc.c (rb_newobj): prohibit call of rb_newobj() during gc.
+ Submitted by Sylvain Joyeux [ruby-core:12099].
- * test/ruby/test_fixnum.rb: ditto.
+ * ext/dl/ptr.c: do not use LONG2NUM() inside dlptr_free().
+ Slightly modified fix bassed on a patch by Sylvain Joyeux
+ [ruby-core:12099] [ ruby-bugs-11859 ] [ ruby-bugs-11882 ]
+ [ ruby-patches-13151 ].
-Mon Feb 11 00:18:57 2008 NARUSE, Yui <naruse@ruby-lang.org>
+Mon Feb 11 00:22:55 2008 NARUSE, Yui <naruse@ruby-lang.org>
* lib/benchmark.rb (Job::Benchmark#item): fix typo.
-Sun Feb 10 21:58:32 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * common.mk (encdb, transdb): depend on $(PREP).
-
-Sun Feb 10 16:58:20 2008 Eric Hodel <drbrain@segment7.net>
-
- * lib/rubygems*, test/rubygems*, gem_prelude.rb: Import RubyGems
- r1601. [ruby-core:15381]
-
-Sun Feb 10 15:07:23 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * {bcc32,win32,wince}/Makefile.sub (MISSING): added cbrt.obj.
-
-Sun Feb 10 12:58:33 2008 Eric Hodel <drbrain@segment7.net>
-
- * lib/rdoc/code_objects.rb: Make some attributes accessible for reuse.
- * lib/rdoc/generator/html.rb: Pull out ContextUser classes and related
- methods for reuse.
- * lib/rdoc/generator.rb: Move ContextUser classes to
- RDoc::Generator::Context for reuse.
- * lib/rdoc/rdoc.rb: Make RDoc::RDoc initialization a little easier.
- * lib/rdoc/options.rb: Make RDoc::Options easier to use without
- parsing an ARGV.
- * lib/rdoc/markup/to_*.rb: Subclass RDoc::Markup::Formatter.
- * lib/rdoc/markup/formatter.rb: Add RDoc::Markup::Formatter to make
- RDoc markup conversion easier.
- * lib/rdoc/markup/fragments.rb: Make RDoc::Markup::ListItem easier to
- test.
- * lib/rdoc/markup/to_html_hyperlink.rb: Pulled out of the HTML
- generator for easier reusability.
- * lib/rdoc/markup.rb: Fix bug with labeled lists containing bullet
- lists.
- * lib/rdoc/generators/html/html.rb: Fix Constant display.
-
-Sat Feb 9 23:44:29 2008 Tanaka Akira <akr@fsij.org>
-
- * missing/tgamma.c (tgamma): use lgamma_r if available.
-
Sat Feb 9 23:22:52 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ext/bigdecimal/extconf.rb: simplified the condition.
-Sat Feb 9 21:20:28 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * test/ruby/test_math.rb: add tests for Math.gamma, Math.lgamma and
- Math.cbrt, and use assert_in_delta instead of assert.
-
-Sat Feb 9 18:34:45 2008 Tanaka Akira <akr@fsij.org>
-
- * math.c (math_cbrt): new method Math.cbrt.
-
- * configure.in (cbrt): check for replacement functions.
-
- * missing/cbrt.c: new file.
-
Sat Feb 9 17:51:24 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ext/bigdecimal/bigdecimal.c (BigDecimal_to_f): use strtod() for more
@@ -27082,165 +2812,15 @@ Sat Feb 9 17:51:24 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ext/bigdecimal/extconf.rb: ditto. [ruby-dev:33658]
-Sat Feb 9 12:06:45 2008 Tanaka Akira <akr@fsij.org>
-
- * missing/tgamma.c (tgamma): add error check.
-
-Sat Feb 9 11:47:03 2008 Tanaka Akira <akr@fsij.org>
-
- * math.c (math_gamma): add error check.
- (math_lgamma): ditto.
-
-Sat Feb 9 11:09:26 2008 Tanaka Akira <akr@fsij.org>
-
- * missing/lgamma_r.c (lgamma_r): return HUGE_VAL for non-positive
- integers.
-
-Sat Feb 9 10:03:07 2008 Tanaka Akira <akr@fsij.org>
-
- * string.c (rb_str_new4): copy encoding from orig, instead of shared
- one.
-
-Sat Feb 9 01:01:38 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * file.c (lchmod_internal): fix warning cast from pointer to integer of
- different size.
-
Sat Feb 9 00:44:52 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/irb.rb (IRB::Irb::eval_input): rescues Interrupt and other than
SystemExit and SignalException. [ruby-core:15359]
-Fri Feb 8 23:51:36 2008 Tanaka Akira <akr@fsij.org>
-
- * missing/lgamma_r.c (lgamma_r): use smaller argument for sin function.
-
-Fri Feb 8 22:10:36 2008 Tanaka Akira <akr@fsij.org>
-
- * lib/open-uri.rb (OpenURI.open_http): rescue URI::InvalidURIError by
- URI.parse for location URI.
-
-Fri Feb 8 19:22:13 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/iconv/iconv.c (rb_str_derive): uses rb_str_subseq() for byte
- length. [ruby-dev:33653]
-
- * ext/iconv/iconv.c (iconv_convert): added toidx argument to set
- encoding of successfully converted string. [ruby-dev:33221]
-
Fri Feb 8 15:09:21 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/mkmf.rb (xsystem): expand macros like as make.
-Fri Feb 8 09:27:57 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * lib/rdoc/ri/driver.rb (read_yaml): remove SM* for compatibility.
-
-Fri Feb 8 00:07:24 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * test/ruby/test_hash.rb: follow the change of Hash#flatten.
-
- * test/ruby/test_time.rb: add tests to achieve over 70% test coverage
- of time.c.
-
- * test/ruby/test_prec.rb: ditto over 90% for prec.c.
-
-Thu Feb 7 19:11:39 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * string.c (rb_str_dup): reverted unneeded change. [ruby-dev:33634]
-
- * string.c (rb_str_replace): makes frozen shared string before
- sharing.
-
-Thu Feb 7 16:33:51 2008 Tanaka Akira <akr@fsij.org>
-
- * io.c (io_reopen): don't change access mode for stdin, stdout and
- stderr. [ruby-core:15360]
-
-Thu Feb 7 16:33:48 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * string.c (str_replace_shared): replaces string with sharing.
-
- * string.c (rb_str_new4, rb_str_associate, rb_str_associated): allows
- associated strings shared.
-
- * string.c (rb_str_dup, rb_str_substr, rb_str_replace): shares memory.
- [ruby-core:15400]
-
-Thu Feb 7 15:42:42 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * string.c (rb_str_end_with): compares with the suffix.
-
-Thu Feb 7 15:03:15 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * enc/trans/korean.c: add support for CP949 by Park Ji-In.
- [ruby-dev:33626]
-
-Thu Feb 7 11:11:02 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * missing/lgamma_r.c (lgamma_r): some compilers don't permit dividing
- by literal 0.0. use const variable instead.
-
- * {bcc32,win32,wince}/Makefile.sub (MISSING): add lgamma_r.obj and
- tgamma.obj.
-
-Thu Feb 7 10:39:21 2008 Tanaka Akira <akr@fsij.org>
-
- * math.c (math_gamma): new method Math.gamma.
- (math_lgamma): new method Math.lgamma.
-
- * include/ruby/missing.h (tgamma): declared unless HAVE_TGAMMA.
- (lgamma_r): declared unless HAVE_LGAMMA_R.
-
- * configure.in (tgamma): check for replacement functions.
- (lgamma_r): ditto.
-
- * missing/tgamma.c: new file. based on gamma.c from
- "C-gengo niyoru saishin algorithm jiten" (New Algorithm handbook
- in C language) (Gijyutsu hyouron sha, Tokyo, 1991)
- by Haruhiko Okumura.
-
- * missing/lgamma_r.c: ditto.
-
- * LEGAL (missing/tgamma.c): describe as public domain.
- (missing/lgamma_r.c): ditto.
-
-Thu Feb 7 09:05:57 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * ext/nkf/nkf-utf8/nkf.c (nkf_enc_from_index): BINARY does not
- have in-bound encoding index.
-
-Thu Feb 7 04:26:28 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * enc/trans/korean.c: add EUC-KR conversion support by Park Ji-In.
- [ruby-dev:33621]
-
-Wed Feb 6 01:47:39 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * hash.c (rb_hash_flatten): do not flatten recursively by default.
- [ruby-dev:33603]
-
-Wed Feb 6 00:50:19 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * insns.def (adjuststack): never use INC_SP with minus value because
- some compilers cannot deal it correctly. use DEC_SP instead.
-
-Wed Feb 6 00:48:41 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * test/ruby/test_hash.rb: add tests to achieve over 90% test coverage
- of hash.c.
-
- * test/ruby/test_env.rb: ditto.
-
-Wed Feb 6 00:24:49 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * hash.c (env_rassoc): remove access to free'd environment on mswin32.
-
-Tue Feb 5 21:57:34 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * vm.c (rb_call_super): pass a passed block when super is called via
- rb_call_super. [ruby-dev:33598]
-
Tue Feb 5 11:14:11 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/mkmf.rb (INSTALL_DIRS, install_dirs): added BINDIR.
@@ -27249,52 +2829,19 @@ Tue Feb 5 11:14:11 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
$NONINSTALLFILES.
* lib/mkmf.rb (init_mkmf): defaults $NONINSTALLFILES to backup and
- temporary files.
-
-Mon Feb 4 21:52:06 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/delegate.rb (DelegateClass): use define_method instead of
- module_eval to improve performance. [ruby-dev:33586]
+ temporary filse.
Mon Feb 4 16:44:24 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* configure.in (darwin): NSIG is not defined if _XOPEN_SOURCE > 500L.
[ruby-dev:33584]
-Mon Feb 4 14:51:19 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (rb_enc_symname2_p): support "!", "!=" and "!~".
- [ruby-dev:33592]
-
-Mon Feb 4 13:58:42 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * lib/delegate.rb (Delegator.preserved, DelegateClass.methods): extend
- shouldn't be delegated. [ruby-dev:32987], etc.
-
-Mon Feb 4 08:59:31 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/cgi.rb (CGI::QueryExtension::[]): no more transition
- extend(CGI::Value). a patch from <tommy AT tmtm.org> in
- [ruby-dev:33583].
-
-Sun Feb 3 21:13:13 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * test/ruby/test_numeric.rb: forgot to add this (at r15360).
-
- * test/ruby/test_file_exhaustive.rb: add tests to achieve over 80% test
- coverage of file.c.
-
Sat Feb 2 20:06:42 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
* lib/benchmark.rb (Benchmark::realtime): make Benchmark#realtime
a bit faster. a patch from Alexander Dymo <dymo AT ukrpost.ua> in
[ruby-core:15337].
-Sat Feb 2 17:40:21 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * time.c (time_cmp): Time.<=> no longer supports comparison with
- numeric. [ruby-core:15332]
-
Sat Feb 2 09:53:39 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* configure.in (darwin): disabled fat-binary support which confuses
@@ -27303,11 +2850,6 @@ Sat Feb 2 09:53:39 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
after builds for each archs. Anyway, config.h and rbconfig.rb must
be separated definitely at least.
-Sat Feb 2 09:28:36 2008 Tanaka Akira <akr@fsij.org>
-
- * random.c (limited_big_rand): fix buffer overflow when SIZEOF_BDIGITS
- is 2. fixed by Kenta Murata. [ruby-dev:33565]
-
Fri Feb 1 21:42:37 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* configure.in (darwin): _XOPEN_SOURCE is necessary to make ucontext_t
@@ -27316,312 +2858,33 @@ Fri Feb 1 21:42:37 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* configure.in (darwin): ucontext on PowerPC MacOS X 10.5 is broken.
-Fri Feb 1 11:44:22 2008 Tanaka Akira <akr@fsij.org>
-
- * tool/compile_prelude.rb (C_ESC): use octal escape to avoid
- "\x09for (;;) ..." to be interpret the first character 0x9f.
-
-Thu Jan 31 23:06:42 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * test/ruby/test_bignum.rb: suppress warnings during test.
-
- * test/ruby/test_enum.rb: ditto.
-
- * test/ruby/test_integer.rb: add tests to achieve over 90% test
- coverage of numeric.c.
-
- * test/ruby/test_float.rb: ditto.
-
- * test/ruby/test_fixnum.rb: ditto.
-
- * test/ruby/test_numeric.rb: ditto.
-
- * test/ruby/test_pack.rb: add tests to achieve over 90% test coverage
- of pack.c.
-
-Thu Jan 31 17:30:42 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * marshal.c (r_object0): no need to call r_entry for immediate values.
-
-Thu Jan 31 15:46:30 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * lib/rdoc/ri/formatter.rb (output): add accessor.
-
- * lib/rdoc/ri/display.rb (page): replace @formatter.output instead of
- $stdout.
-
-Thu Jan 31 15:06:50 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * marshal.c (r_object0): call r_entry/r_leave to call proc when
- TYPE_FIXNUM, TYPE_NIL, TYPE_TRUE, TYPE_FALSE, TYPE_SYMBOL.
-
-Thu Jan 31 14:03:38 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * lib/rdoc/ri/display.rb (display_method_list, display_class_list):
- use @formatter.raw_print_line instead of puts.
-
- * lib/rdoc/ri/driver.rb (select_methods): new method to collect all
- instance/class methods which match with passed pattern.
-
- * lib/rdoc/ri/driver.rb (run): use class_cache's result directly
- instead of select_classes' because it's removed now.
-
- * lib/rdoc/ri/driver.rb (run): search methods when passed name is not
- class name. [ruby-core:15309]
-
Thu Jan 31 08:31:19 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* common.mk (ext/extmk.rb, instruby.rb): inlined $(MAKE) so that can
be executed even with -n.
-Thu Jan 31 06:24:22 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Jan 31 07:00:19 2008 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
- * io.c (rb_io_close_read): replaces fptr with the tied writer if
- duplex.
+ * lib/rinda/tuplespace.rb (bin_for_find): should find a symbol by
+ Symbol class.
- * io.c (rb_io_close_write): unties the tied IO for writing if duplex.
- [ruby-dev:33532]
+ * test/rinda/test_rinda.rb (test_symbol_tuple): ditto.
-Thu Jan 31 02:22:04 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
+Wed Jan 30 22:07:58 2008 Tadayoshi Funaba <tadf@dotrb.org>
- * io.c (open_key_args): allow encoding key to take two encoding
- names. a patch from <rubikitch AT ruby-lang.org>. [ruby-dev:33540]
+ * lib/date.rb: refined deprecated methods.
-Thu Jan 31 02:15:49 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * parse.y (dsym): allow empty symbols. [ruby-core:15248]
-
-Thu Jan 31 00:01:51 2008 Tanaka Akira <akr@fsij.org>
-
- * io.c (select_internal): fix SEGV by `select [STDIN],nil,[STDIN]'.
- fixed by Petr Chromec.
- http://rubyforge.org/tracker/index.php?func=detail&aid=17275&group_id=426&atid=1698
-
-Wed Jan 30 17:32:49 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * enc/*.c: add GB12345, UCS-{2,4}{BE,LE}.
-
-Wed Jan 30 14:32:18 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * lib/rdoc/ri/driver.rb (cache_file_for): shouldn't use `:' in filename.
-
-Wed Jan 30 14:27:19 2008 Tanaka Akira <akr@fsij.org>
-
- * string.c (rb_str_succ): use wrapped character as a carry for
- ASCII incompatible encoding.
-
-Wed Jan 30 12:26:59 2008 Tanaka Akira <akr@fsij.org>
-
- * enc/utf_16be.c (UTF16_IS_SURROGATE_FIRST): avoid branch.
- (UTF16_IS_SURROGATE_SECOND): ditto.
- (UTF16_IS_SURROGATE): defined.
- (utf16be_mbc_enc_len): validation implemented.
-
- * enc/utf_16le.c (UTF16_IS_SURROGATE_FIRST): avoid branch.
- (UTF16_IS_SURROGATE_SECOND): ditto.
- (UTF16_IS_SURROGATE): defined.
- (utf16le_mbc_enc_len): validation implemented.
-
-Wed Jan 30 12:06:43 2008 Tadayoshi Funaba <tadf@dotrb.org>
+Wed Jan 30 22:06:54 2008 Tadayoshi Funaba <tadf@dotrb.org>
* bignum.c (rb_cstr_to_inum): '0_2' is a valid representation.
-Wed Jan 30 11:57:50 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * bootstraptest/runner.rb: fix -I../../hoge case.
-
-Wed Jan 30 01:25:16 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * test/ruby/test_range.rb: add tests to achieve over 90% test coverage
- of range.c.
-
-Wed Jan 30 00:09:37 2008 Tanaka Akira <akr@fsij.org>
-
- * enc/euc_tw.c (euctw_mbc_enc_len): validation implemented.
-
-Tue Jan 29 22:58:11 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * test/ruby/test_enumerator.rb: add tests to achieve over 90% test
- coverage of enumerator.c.
-
- * test/ruby/test_enum.rb: add for enum.c.
-
-Tue Jan 29 22:29:48 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * enumerator.c: fix documents.
-
-Tue Jan 29 22:27:11 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * range.c: fix SEGV by ("a" .. "z").step(2 ** 30) { }.
-
-Tue Jan 29 21:59:16 2008 Tanaka Akira <akr@fsij.org>
-
- * enc/euc_tw.c (euctw_islead): 0x8e is a leading byte.
-
-Tue Jan 29 21:55:35 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * bignum.c: move object allocation out of blocking_region.
- [ruby-dev:33139]
-
-Tue Jan 29 20:37:36 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * enc/trans/make_transdb.rb: add for make transdb.h.
-
- * dmytranscode.c: add for miniruby.
-
- * enc/gbk.c (gbk_left_adjust_char_head, gbk_is_allowed_reverse_match):
- fix odd regexp match. [ruby-dev:33502]
-
-Tue Jan 29 20:17:06 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * {bcc32,win32}/Makefile.sub (MINIOBJS): add dmytranscode.$(OBJEXT).
-
-Tue Jan 29 19:39:40 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * configure.in, common.mk: fix rule for dmytranscode.o.
-
-Tue Jan 29 19:03:16 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * enc/trans/japanese.c (rb_to_Windows_31J): to 'Windows-31J'.
-
- * common.mk: add rules for transdb.h.
-
- * transcode.c (init_transcoder_table): use transdb.h.
-
-Tue Jan 29 18:05:48 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * encoding.c (encdb_{replicate,alias,dummy,declare}): define only if
- NO_ENCDB_H is not defined.
-
-Tue Jan 29 17:54:11 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * enc/gbk.c (EncLen_gbk): too short. [ruby-dev:33497]
-
-Tue Jan 29 17:25:22 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * dmyencoding.c, encoding.c (enc_init_db, NO_ENCDB_H):
- miniruby doesn't use encdb.
-
- * common.mk: encdb.h use miniruby.
-
-Tue Jan 29 17:37:36 2008 Tanaka Akira <akr@fsij.org>
-
- * enc/gb18030.c (gb18030_mbc_enc_len): validation implemented.
-
-Tue Jan 29 17:01:07 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * tool/ifchange: remove $temp when unchanged.
-
-Tue Jan 29 16:59:01 2008 Tanaka Akira <akr@fsij.org>
-
- * insns.def (toregexp): generate a regexp from strings instead of one
- string.
-
- * re.c (rb_reg_new_ary): defined for toregexp. it concatenates
- strings after each string is preprocessed.
-
- * compile.c (compile_dstr_fragments): split from compile_dstr.
- (compile_dstr): call compile_dstr_fragments.
- (compile_dregx): defined for dynamic regexp.
- (iseq_compile_each): use compile_dregx for dynamic regexp.
-
- [ruby-dev:33400]
-
-Tue Jan 29 16:25:26 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * common.mk, ext/extmk.rb: always make encdb.h.
-
-Tue Jan 29 12:53:39 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * enc/gbk.c: add GBK, CP936 and CP949.
-
- * enc/euc_kr.c: remove CP949.
-
- * enc/euc_cn.c: remove CP936 and rename to gb2312.c
-
- * enc/gb2312.c: GB2312 is preferred MIME name.
-
-Tue Jan 29 03:01:29 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * parse.y (reg_fragment_setenc_gen): US-ASCII script special code.
-
- * parse.y (reg_fragment_check_len, reg_compile_gen): no need such
- trick.
- [ruby-dev:33399]
-
- * test/ruby/test_m17n.rb (test_regexp_usacii_literal): add tests.
-
-Tue Jan 29 01:38:02 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * common.mk ($(srcdir)/revision.h): no need to show ifchange execution
- because ifchange echos updated or unchanged.
-
-Tue Jan 29 01:26:23 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * common.mk (up): use last changed revision.
-
- * common.mk (up): force to update revision.h.
-
-Tue Jan 29 00:12:17 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * bignum.c (rb_big2str0): should be US-ASCII.
-
-Tue Jan 29 00:10:00 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * misc/ruby-mode.el (ruby-mode-set-encoding): updates magic comment.
-
-Mon Jan 28 23:47:52 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * parse.y (rb_id2str, ripper_initialize, Init_ripper):
- use rb_usascii_str_new2. [ruby-dev:33449]
-
-Mon Jan 28 19:37:08 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * ext/win32ole/win32ole.c (ole_cp2encoding): new function.
-
- * ext/win32ole/win32ole.c (ole_wc2vstr, ole_variant2val, fole_missing):
- set encoding to result.
+Tue Jan 29 22:40:12 2008 Yusuke Endoh <mame@tsg.ne.jp>
- * ext/win32ole/win32ole.c (fole_s_set_code_page, Init_win32ole): set
- default encoding.
- [ruby-dev:33433]
+ * range.c (step_i): rb_funcall receives VALUE as an argument.
-Mon Jan 28 11:17:28 2008 NARUSE, Yui <naruse@ruby-lang.org>
+Tue Jan 29 11:53:05 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * string.c, parse.y, re.c: use rb_ascii8bit_encoding.
-
-Mon Jan 28 17:54:15 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * enc/utf_7.h: add dummy encoding UTF-7 and its alias CP65000.
-
-Mon Jan 28 17:41:19 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * enc/utf_8.c: add alias CP65001.
-
-Mon Jan 28 15:33:23 2008 Tanaka Akira <akr@fsij.org>
-
- * enc/big5.c (big5_mbc_enc_len): validation implemented.
-
-Mon Jan 28 13:02:02 2008 Tanaka Akira <akr@fsij.org>
-
- * enc/euc_kr.c (euckr_mbc_enc_len): validation implemented.
-
-Mon Jan 28 11:24:49 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * parse.y (parser_str_new): encoding of UTF-8 literal string in
- US-ASCII script is UTF-8. [ruby-dev:33406]
-
-Mon Jan 28 10:25:59 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * test/ruby/test_m17n.rb (test_magic_comment): add test.
-
-Mon Jan 28 09:34:54 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * common.mk (help): use double quotes for nmake.
-
-Mon Jan 28 00:39:09 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (parser_set_encode): check if encoding is ASCII compatible.
+ * configure.in: rm largefile.h.
Mon Jan 28 01:21:15 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
@@ -27634,635 +2897,42 @@ Mon Jan 28 01:21:15 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
* io.c (next_argv): ditto.
-Sun Jan 27 23:33:35 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * sprintf.c (rb_str_format): fix for left justify flag.
-
- * sprintf.c (rb_str_format): zero-precision zero bug revised.
- [ruby-dev:33419]
-
-Sun Jan 27 23:20:54 2008 Tanaka Akira <akr@fsij.org>
-
- * include/ruby/oniguruma.h: precise mbclen API redesigned to avoid
- inline functions.
- (onigenc_mbclen_charfound): removed.
- (onigenc_mbclen_needmore): removed.
- (onigenc_mbclen_recover): removed.
- (ONIGENC_MBCLEN_CHARFOUND): removed.
- (ONIGENC_MBCLEN_CHARFOUND_P): defined.
- (ONIGENC_MBCLEN_CHARFOUND_LEN): defined.
- (ONIGENC_MBCLEN_INVALID): removed.
- (ONIGENC_MBCLEN_INVALID_P): defined.
- (ONIGENC_MBCLEN_NEEDMORE): removed.
- (ONIGENC_MBCLEN_NEEDMORE_P): defined.
- (ONIGENC_MBCLEN_NEEDMORE_LEN): defined.
- (ONIGENC_MBC_ENC_LEN): use onigenc_mbclen_approximate.
-
- * regenc.c (onigenc_mbclen_approximate): defined.
-
- * include/ruby/encoding.h (MBCLEN_CHARFOUND): removed.
- (MBCLEN_INVALID): removed.
- (MBCLEN_NEEDMORE): removed.
- (MBCLEN_CHARFOUND_P): defined.
- (MBCLEN_INVALID_P): defined.
- (MBCLEN_NEEDMORE_P): defined.
- (MBCLEN_CHARFOUND_LEN): defined.
- (MBCLEN_NEEDMORE_LEN): defined.
-
- * encoding.c: use new API.
-
- * re.c: ditto.
-
- * string.c: ditto.
-
- * parse.y: ditto.
-
-Sun Jan 27 22:55:27 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (value_expr_gen): reverted r12880. [ruby-dev:33388]
-
-Sun Jan 27 22:33:39 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * sprintf.c (rb_str_format): fix for octal with precision.
- [ruby-dev:33411]
-
-Sun Jan 27 22:31:45 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * misc/ruby-mode.el (ruby-mode-set-encoding): automatically insert
- encoding magic comment.
-
- * misc/ruby-mode.el (ruby-mode): set ruby-mode-set-encoding to buffer
- local before-save-hook.
-
-Sun Jan 27 19:51:15 2008 Tanaka Akira <akr@fsij.org>
-
- * string.c (rb_str_inspect): avoid exception by
- "\#\xa1".force_encoding("euc-jp").inspect.
-
-Sun Jan 27 19:07:33 2008 Tanaka Akira <akr@fsij.org>
-
- * string.c (rb_str_succ): warning suppressed.
-
-Sun Jan 27 18:18:13 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * common.mk (help): show major targets.
-
-Sun Jan 27 17:54:48 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * ext/nkf/nkf.c: raise error when no output encoding is given.
+ * io.c (rb_io_s_foreach): ditto.
-Sun Jan 27 17:20:10 2008 Tanaka Akira <akr@fsij.org>
+ * io.c (rb_io_s_readlines): ditto.
- * string.c (rb_str_succ): don't increment/decrement codepoint.
+ * io.c (rb_io_s_read): ditto.
-Sun Jan 27 16:03:42 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * lib/irb/ruby-lex.rb (RubyLex#buf_input): use chars.to_a.
-
-Sun Jan 27 16:27:22 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * ext/nkf/nkf-utf8: update nkf.
-
-Sun Jan 27 16:25:27 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * re.c (rb_reg_source): set encoding as regexp encoding.
-
-Sun Jan 27 05:56:39 2008 Tanaka Akira <akr@fsij.org>
-
- * re.c (rb_reg_preprocess): force fixed encoding when ASCII
- incompatible source string.
-
-Sat Jan 26 23:46:33 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * sprintf.c (rb_str_format): zero-precision zero should be empty.
- [ruby-dev:33363]
-
- * sprintf.c (rb_str_format): not prepend octal prefix to negative or
- zero value. [ruby-dev:33363], [ruby-dev:33367]
-
-Sat Jan 26 23:42:15 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (assignable_gen, keyword_to_name): __ENCODING__ was missing.
-
-Sat Jan 26 19:08:45 2008 Tanaka Akira <akr@fsij.org>
-
- * marshal.c (w_object): dump string encoding in USERDEF.
- [ruby-dev:33401]
-
-Sat Jan 26 17:42:23 2008 Koichi Sasada <ko1@atdot.net>
-
- * compile.c (iseq_compile_each): validate argument expr of "next"
- statement.
-
- * bootstraptest/test_syntax.rb: add a test.
-
-Sat Jan 26 17:22:46 2008 Koichi Sasada <ko1@atdot.net>
-
- * compile.c, compile.h: fix to calculate correct stack depth
- at each instruction.
-
-Sat Jan 26 09:41:02 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * lib/rexml/doctype.rb, test/rss/test_maker_itunes.rb: replace
- multi-byte string.
-
- * test/json/{test_json.rb, test_json_unicode.rb}:
- add magic comment.
-
-Sat Jan 26 09:30:26 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * include/ruby/encoding.h (rb_usascii_encindex): added prototype.
-
- * include/ruby/intern.h (rb_usascii_str_new, rb_usascii_str_new2):
- ditto.
-
-Sat Jan 26 09:17:13 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * string.c (rb_str_new): set US-ASCII and ENC_CODERANGE_7BIT when
- empty string (len == 0).
-
-Sat Jan 26 03:41:53 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * parse.y (parser_initialize): set default script encoding as US-ASCII.
-
- * ruby.c (load_file): ditto.
-
- * ruby.c (process_options): set script encoding of -e from locale
- except when -K is specified.
-
- * ruby.c (load_file): set script encoding of stdin from locale except
- when -K is specified. [ruby-dev:33375]
-
-Sat Jan 26 02:51:06 2008 Koichi Sasada <ko1@atdot.net>
-
- * compile.c, compile.h: fix stack pointer issues.
- calculate correct stack depth at compile time.
-
- * insns.def (emptstack): remove it and add a new insn "adjuststack".
-
- * bootstraptest/test_knownbug.rb: move/remove fixed test.
-
- * bootstraptest/test_syntax.rb: ditto.
-
-Sat Jan 26 00:17:18 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * string.c (rb_str_usascii_new{,2}: defined.
- (rb_str_new): set US-ASCII and ENC_CODERANGE_7BIT when empty
- string.
+Fri Jan 25 22:33:38 2008 Yusuke Endoh <mame@tsg.ne.jp>
- * encoding.c (rb_usascii_encoding, rb_usascii_encindex): defined.
- (rb_enc_inspect, enc_name, rb_locale_charmap, rb_enc_name_list_i):
- use rb_str_ascii_new.
-
- * array.c (recursive_join, inspect_ary): ditto.
-
- * object.c (nil_to_s, nil_inspect, true_to_s, false_to_s,
- rb_mod_to_s): ditto.
-
- * hash.c (inspect_hash, rb_hash_inspect, rb_f_getenv, env_fetch,
- env_clear, env_to_s, env_inspect): ditto.
-
- * numeric.c (flo_to_s, int_chr, rb_fix2str): ditto.
-
- * bignum.c (rb_big2str): ditto.
-
- * file.c (rb_file_ftype, rb_file_s_dirname, rb_file_s_extname,
- file_inspect_join, Init_file): ditto.
-
- * test/ruby/test_ruby_m17n.rb: add checks for encoding of string.
-
-Sat Jan 26 01:35:46 2008 Tanaka Akira <akr@fsij.org>
-
- * marshal.c (r_byte): use getbyte instead of getc.
- (marshal_load): ditto.
- [ruby-dev:33264]
-
-Sat Jan 26 00:43:40 2008 Tanaka Akira <akr@fsij.org>
-
- * io.c (rb_io_getline_fast): don't care ASCII incompatible encoding.
- (prepare_getline_args): generate a newline according to IO encoding
- when necessary.
- (rb_io_getline_1): call rb_io_getline_fast only for ASCII
- compatible encoding.
-
-Fri Jan 25 21:49:36 2008 Tanaka Akira <akr@fsij.org>
-
- * string.c (rb_str_buf_cat_ascii): use rb_enc_cr_str_buf_cat.
-
-Fri Jan 25 19:38:45 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * common.mk (version.$(OBJEXT)): depends on $(srcdir)/revision.h.
-
- * common.mk (revision.h): extracts revision number with ``svn info''.
-
- * common.mk (up): target to update from the repository.
-
- * Makefile.in, {win,bcc}32/Makefile.sub (IFCHANGE): tool to update a
- file if changed.
-
- * tool/ifchange: for unixen.
-
- * win32/ifchange.bat: some fix
-
-Fri Jan 25 17:12:13 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ruby.c (load_file): set default to ASCII-8BIT explicitly if -K
- option is not given.
-
-Fri Jan 25 16:31:47 2008 Tanaka Akira <akr@fsij.org>
-
- * include/ruby/intern.h (rb_str_buf_cat_ascii): declared.
-
- * string.c (rb_str_buf_cat_ascii): defined.
-
- * re.c (rb_reg_s_union): use rb_str_buf_cat_ascii to support ASCII
- incompatible encoding.
-
-Fri Jan 25 16:11:16 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ruby.c (process_options, load_file, rb_load_file): propagates script
- encoding by -K to libraries. [ruby-dev:33156]
-
-Fri Jan 25 15:56:48 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ruby.c (cmdline_arguments): split argc and argv from cmdline_options.
-
- * ruby.c (process_options): not set encoding of -e option from -E
- option if they are not compatible.
-
-Fri Jan 25 13:15:23 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * ruby.c (proc_options, process_options, load_file): shouldn't effect
- --encoding to script encoding. [ruby-dev:33169]
+ * math.c: fix comment. [ruby-dev:33276]
Fri Jan 25 10:31:58 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* */*.bat: set svn:mime-type to text/batch.
-Thu Jan 24 23:23:06 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * enum.c (enum_one, enum_take_while, enum_drop_while): fix documents.
-
-Thu Jan 24 21:46:24 2008 Tanaka Akira <akr@fsij.org>
-
- * parse.y (reg_fragment_setenc_gen): associate ASCII-8BIT only if
- str has only ASCII characters.
-
-Thu Jan 24 20:46:17 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * test/ruby/test_m17n.rb: follow to the following changes.
-
-Thu Jan 24 20:21:07 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * parser.y (parser_str_new): automatically update string literal's
- encoding from US-ASCII to ASCII-8BIT when script encoding is US-ASCII
- and the string includes non-ascii bytes. [ruby-dev:33348]
-
- * parser.y (reg_fragment_check_gen, reg_compile_gen): automatically
- update regexp literal's encoding from US-ASCII to ASCII-8BIT when
- script encoding is US-ASCII, the regexp has no kcode option and the
- regexp includes non-ascii bytes. [ruby-dev:33353]
-
Thu Jan 24 19:36:22 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/uri/generic.rb (URI::Generic::inspect): use Kernel#to_s instead
object_id with printf. [ruby-dev:33347]
-Thu Jan 24 19:29:20 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * sprintf.c (remove_sign_bits): returns pointer to the first char to
- be used, instead of copying.
-
- * sprintf.c (rb_str_format): negative indicator dots should come
- before sign digits always. [ruby-dev:33224]
-
-Thu Jan 24 18:19:42 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * include/ruby/encoding.h (rb_enc_is_newline): parenthesized arguments.
-
-Thu Jan 24 18:14:14 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * re.c (rb_reg_fixed_encoding_p): no need to treat ASCII-8BIT specially.
-
-Thu Jan 24 16:53:06 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * re.c (rb_reg_initialize): 7bit clean regexp should be US-ASCII.
- [ruby-dev:33346]
-
-Thu Jan 24 16:31:04 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * io.c (rb_io_getline_fast): the end point of left_char_head()
- must be the last character. [ruby-cvs:22445]
-
-Thu Jan 24 16:24:25 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * parse.y (reg_fragment_setenc_gen): recognize regexp with option n as
- as ASCII-8BIT instead of US-ASCII. [ruby-dev:33339]
-
-Thu Jan 24 15:44:42 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * array.c (collect_bang_i): use rb_ary_store() to avoid potential
- memory corruption. a patch from Yusuke Endoh <mame@tsg.ne.jp>
- in [ruby-dev:33328].
-
- * array.c (ITERATE): remove unnecessary macro.
-
- * array.c (sort_1): remove ary_sort_check(). in-place sort keep
- original elements even when it's modified.
-
- * array.c (sort_2): ditto.
-
-Thu Jan 24 15:09:40 2008 Tanaka Akira <akr@fsij.org>
-
- * time.c (make_time_t): revert round trip test. [ruby-dev:33058]
-
-Thu Jan 24 11:14:56 2008 Tanaka Akira <akr@fsij.org>
-
- * string.c (rb_enc_cr_str_buf_cat): ASCII incompatible encoding is
- not compatible with any other encoding.
-
-Thu Jan 24 07:34:34 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * parse.y (STR_NEW0): set encoding as US-ASCII.
-
-Thu Jan 24 03:47:41 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * lib/rexml/text.rb, lib/rubygems/open-uri.rb, lib/open-uri.rb,
- test/logger/test_logger.rb, test/ruby/test_regexp.rb:
- fix tests. [ruby-dev:33336]
-
-Thu Jan 24 03:23:44 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * string.c (rb_str_each_line): use memchr(3) for faster newline
- search.
-
- * io.c (appendline): remove unused arguments
-
- * io.c (rb_io_getline_fast): make much simpler (and faster).
-
-Thu Jan 24 02:13:07 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * insns.def (expandarray): fix stack inc. [ruby-dev:32892]
-
- * bootstraptest/test_knownbug.rb, test_massign.rb: move a fixed test.
-
-Thu Jan 24 01:00:34 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * encoding.{c, h} (rb_usascii_encoding): added.
-
- * parse.y (parser_str_new, rb_intern3): ascii only string literal is
- US-ASCII.
-
- * ruby.c (proc_optionc): -Kn means ASCII-8BIT.
-
-Wed Jan 23 23:54:40 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * sprintf.c: fix comment. [ruby-dev:33275]
-
- * math.c: fix comment. [ruby-dev:33276]
-
-Wed Jan 23 22:47:34 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * test/ruby/test_struct.rb: add tests to achieve over 90% test
- coverage of struct.c.
-
- * test/ruby/test_sprintf.rb: ditto for sprintf.c.
-
- * test/ruby/test_math.rb: ditto for math.c.
-
-Wed Jan 23 22:14:28 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * enc/trans/japanese.c (rb_from_Windows_31J, rb_to_Windows_31J):
- provisional workaround for Windows-31J. [ruby-dev:33320]
-
-Wed Jan 23 15:25:04 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * time.c (time_strftime): copy encoding from format. [ruby-dev:33303]
-
-Wed Jan 23 15:04:11 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * string.c (str_make_independent): should set length.
-
- * string.c (rb_str_associate): hide associated array from ObjectSpace.
-
- * string.c (rb_str_associated): return associated array with freezing
- instead of false. [ruby-dev:33282]
-
- * string.c (rb_str_freeze): freeze associated array together.
-
-Wed Jan 23 13:39:48 2008 Tanaka Akira <akr@fsij.org>
-
- * re.c (rb_reg_prepare_re): fix SEGV by
- /a/ =~ "aa".force_encoding("utf-16be").
-
-Wed Jan 23 11:53:26 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * string.c (str_mod_check, str_nth, str_offset): constified.
-
- * string.c (rb_str_dump): dump in ASCII-8BIT always.
-
-Wed Jan 23 10:18:10 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval_method.c (rb_export_method): set ruby_vm_redefined_flag for
- visibility change as well. reported by K.Kosako in
- http://d.hatena.ne.jp/kkos/20080122#1201012720.
-
-Tue Jan 22 22:26:23 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * test/ruby/test_bignum.rb: change some tests because rational
- redefines Bignum#quo and Bignum#**.
-
-Tue Jan 22 20:58:15 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * lib/mkmf.rb (create_makefile): need to output sodir rule.
-
-Tue Jan 22 19:37:16 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * lib/mkmf.rb (create_makefile): lib files shouldn't depend on install
- dir because if the dir is newer than lib files, lib files will be
- always copied.
-
-Tue Jan 22 17:52:52 2008 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * enc/trans/utf_16_32.c: Streamline parentheses, add more
- 'static' qualifiers.
-
-Tue Jan 22 12:57:07 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * configure.in (MINIRUBY): remove -I$(EXTOUT)/$(arch) from
- MINIRUBY since miniruby might not be able to load DLL.
-
- * test/ruby/test_m17n.rb: move tests from bootstrap test.
-
- * encoding.c (enc_find): should check name if ASCII compatible.
-
- * string.c (rb_str_end_with): should check character boundary.
-
- * encoding.c (rb_enc_compatible): encoding must be ASCII
- compatible before checking ENC_CODERANGE_7BIT.
-
- * encoding.c (rb_enc_compatible): wrong compatibility condition.
- [ruby-dev:33273]
-
-Tue Jan 22 09:26:47 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * string.c (rb_str_each_char): iterates over a shadow.
- [ruby-dev:33243]
-
-Tue Jan 22 08:59:52 2008 Eric Hodel <drbrain@segment7.net>
-
- * lib/rdoc/ri/formatter.rb: Indent labeled lists like note lists.
-
- * test/rdoc/test_rdoc_ri_overstrike_formatter.rb: Added.
-
- * test/rdoc/test_rdoc_ri_formatter.rb: Added tests.
-
-Tue Jan 22 04:40:28 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
+Tue Jan 22 11:22:47 2008 NAKAMURA Usaku <usa@ruby-lang.org>
- * parse.y (rb_intern3): do not call rb_enc_mbclen() if *m is
- ASCII. [ruby-talk:287225]
-
- * string.c (rb_str_each_line): use rb_enc_is_newline() to gain
- performance if the record separator ($/) is not modified.
-
-Tue Jan 22 01:15:51 2008 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-
- * ChangeLog: format-time-string under C locale. [ruby-dev:33261]
-
-Tue Jan 22 00:45:12 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * test/ruby/test_bignum.rb: add tests for bignum.c.
-
-Tue Jan 22 00:30:08 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * bignum.c (big_shift): fix a bug that caused infinite loop when
- left shifting.
-
-Mon Jan 21 20:09:38 2008 Tadayoshi Funaba <tadf@dotrb.org>
-
- * lib/date.rb (marshal_load): initialize the cache.
-
-Mon Jan 21 19:42:42 2008 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * transcode.c, enc/trans/utf_16_32.c, test/ruby/test_transcode.rb:
- added UTF-32BE and UTF-32LE conversions.
+ * win32/setup.mak ($(ARCH)): if a macro is appended by $(APPEND),
+ a space will be inserted on the top of the line.
-Mon Jan 21 14:36:14 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * win32/Makefile.sub (MKFILES): stop make process if Makefile is
+ updated.
- * transcode.c (str_transcode): initialize transcoder in
- rb_transcoding. [ruby-dev:33234]
+Mon Jan 21 17:34:41 2008 Akinori MUSHA <knu@iDaemons.org>
- * transcode_data.h (rb_transcoding): transcoder constified.
+ * io.c (rb_io_mode_flags, rb_io_mode_modenum): Ignore encoding
+ options for forward compatibility.
Mon Jan 21 12:50:02 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* eval.c, gc.c (setjmp): sigsetjmp is a macro on cygwin.
-Mon Jan 21 12:35:00 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * transcode.c (transcode_loop, str_transcoding_resize): use unsigned
- char. [ruby-dev:33232]
-
- * transcode_data.h (rb_transcoding, rb_transcoder): removed callback
- parameters.
-
- * enc/trans/japanese.c: ditto.
-
- * enc/trans/utf_16_32.c: parenthesized bit-or operands.
-
-Mon Jan 21 11:59:00 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * string.c (rb_str_each_char): move forward. [ruby-dev:33231]
-
-Mon Jan 21 06:40:03 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * transcode.c (transcode_dispatch): constified return value.
-
- * transcode_data.h (rb_transcoding): include pointer to rb_transcoder
- and auxiliary data.
-
- * transcode_data.h (rb_transcoder): all callback functions should have
- their own parameters.
-
- * enc/trans/{japanese,single_byte}.c: constified.
-
-Mon Jan 21 03:45:49 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * string.c (rb_str_each_char): advance offset before get next char
- length. [ruby-dev:33211]
-
-Sun Jan 20 20:00:20 2008 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * transcode.c, enc/trans/utf_16_32.c, test/ruby/test_transcode.rb:
- added UTF-16LE conversions.
-
- * fixed changelog for last commit
-
-Sun Jan 20 17:54:00 2008 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * added changelog for last commit
-
-Sun Jan 20 15:08:08 2008 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * enc/trans/utf_16_32.c: new file, currently implementing
- UTF-16BE conversions only.
-
- * test/ruby/test_transcode.rb: Added tests for UTF-16BE;
- made check_both_ways() use force_encoding differently.
-
- * transcode_data.h, transcode.c: Support for more conversion
- functions.
-
-Sun Jan 20 13:06:01 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * string.c (rb_str_each_char): performance improvement, and stop if
- shortened in the block. [ruby-dev:33189]
-
-Sun Jan 20 09:12:26 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * common.mk: use -Ks when read insns.def. [ruby-dev#33185]
-
- * parse.y: fix -e and stdin strings aren't set encoding.
-
-Sun Jan 20 05:12:44 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * enc/make_encdb.rb: fix duplication check.
-
-Sun Jan 20 05:03:46 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * ascii.c: remove definition of replica KOI8-U.
-
-Sun Jan 20 00:33:59 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * enc/koi8_u.c: added.
-
- * regenc.c, enc/utf_8.c, enc/unicode.c, enc/gb18030.c: add ARG_UNUSED.
-
-Sat Jan 19 22:41:39 2008 Tanaka Akira <akr@fsij.org>
-
- * string.c (coderange_scan): don't call mbclen functions for ASCII
- characters with ASCII compatible encoding.
-
-Sat Jan 19 21:00:34 2008 Tanaka Akira <akr@fsij.org>
-
- * lib/rdoc/template.rb (RDoc): defined to avoid uninitialized constant
- error by `./ruby test/rubygems/test_gem_server.rb'.
-
-Sat Jan 19 20:41:29 2008 Tanaka Akira <akr@fsij.org>
-
- * encoding.c (enc_new): don't free rb_encoding to avoid SEGV by
- `miniruby -e exit' on x86_64 GNU/Linux.
-
-Sat Jan 19 18:40:19 2008 Tadayoshi Funaba <tadf@dotrb.org>
-
- * lib/date.rb (once): use an instance variable which points a hash
- as cache. [experimental]
-
-Sat Jan 19 17:21:29 2008 Tadayoshi Funaba <tadf@dotrb.org>
-
- * lib/date.rb, lib/date/format.rb: parse's hints as an
- experimental function has been removed.
-
Sat Jan 19 11:21:53 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* configure.in (sigsetjmp): check if available.
@@ -28274,192 +2944,7 @@ Sat Jan 19 11:10:11 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* configure.in: Remove wrong assumptions about Cygwin. a patch from
Corinna Vinschen in [ruby-Bugs-17018].
-Sat Jan 19 09:23:14 2008 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-
- * ext/win32ole/win32ole.c (ole_set_safe_array): should not use
- recursive calling.
-
- * test/win32ole/test_win32ole_variant.rb: ditto.
-
-Sat Jan 19 08:58:47 2008 Eric Hodel <drbrain@segment7.net>
-
- * lib/rdoc/markup: Remove ListBase and Line constants.
-
- * lib/rdoc/ri: Allow output IO to be specified.
-
- * test/rdoc/parser/test_parse_c.rb: Move up one level, fixed.
-
- * test/rdoc/parser/test_rdoc_markup_attribute_manager.rb: Renamed to
- match new class name, updated to match new classes.
-
- * test/rdoc/test_rdoc_ri_formatter.rb: Start of RI formatting tests.
-
- * test/rdoc/test_rdoc_ri_attribute_manager.rb: Start of
- RDoc::RI::AttributeManager tests.
-
- * test/rdoc/test_simple_markup.rb: Moved to match new class name.
-
-Sat Jan 19 08:35:36 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (parser_prepare): get encoding from the first line.
- [ruby-dev:33168]
-
- * ruby.c (load_file): set encoding to input with set_encoding.
-
-Sat Jan 19 03:46:42 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * thread.c (thread_create_core): prohibit thread creation in the
- frozen thread group. a patch in [ruby-dev:33176] from sheepman
- <sheepman AT sheepman.sakura.ne.jp>.
-
- * thread.c (thread_create_core): should inherit ThreadGroup from
- the current thread.
-
-Sat Jan 19 00:37:19 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * sprintf.c (rb_str_format): set result encoding for wider width.
-
-Sat Jan 19 00:13:19 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * thread_win32.c (w32_wait_events): shouldn't invoke interrupt handle
- by timer_thread.
-
-Fri Jan 18 23:49:41 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * thread.c (thread_create_core): set thread group before creating
- thread.
-
-Fri Jan 18 20:19:51 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * parse.y (ripper_initialize): too early to set parser->enc.
-
-Fri Jan 18 20:03:05 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/setup.mak (BASERUBY): nmake cannot execute ruby correctly
- if the path of ruby.exe is quoted.
-
- * win32/setup.mak ($(ARCH)): if a macro is appended by $(APPEND),
- a space will be inserted on the top of the line.
-
-Fri Jan 18 17:56:09 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval_intern.h, insnhelper.h, thread_pthread.h, vm_core.h, vm_opts.h:
- prefixed include guards with RUBY.
-
- * id.h: added include guard.
-
- * regenc.h, regint.h, regparse.h: prefixed include guards with
- ONIGURUMA.
-
-Fri Jan 18 15:57:05 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * thread.c (thread_cleanup_func): ignore errors from destroying mutex
- of dead thread. [ruby-core:15069]
-
- * thread_pthread.c, thread_win32.c (native_thread_destroy): ditto.
-
-Fri Jan 18 15:56:04 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * encoding.c (rb_enc_name_list_i, rb_enc_aliases_enc_i): freeze
- element strings to be returned.
-
-Fri Jan 18 14:36:34 2008 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-
- * test/ruby/test_m17n.rb (test_str_dump): added test for
- String#dump. [ruby-dev:33142]
-
-Fri Jan 18 12:25:13 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * encoding.c (load_encoding): check if successfully loaded.
-
- * encoding.c (rb_enc_find_index): use original encoding name to
- replicate loaded encoding instead alias.
-
-Fri Jan 18 09:43:02 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * re.c (rb_char_to_option_kcode): Regexp switch `s' should mean
- Windows-31J, as wells as `-Ks'.
-
-Fri Jan 18 09:22:07 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * parse.y (parser_initialize): explicitly call rb_ascii8bit_encoding().
-
- * parse.y (parser_prepare): lex_input may not be have encoding (e.g. IO).
-
- * parse.y (rb_parser_compile_string): set encoding from input string.
-
- * encoding.c (rb_enc_find_index): use ASCII-8BIT if loading known
- encoding failed.
-
- * parse.y (ripper_initialize): move parser->enc initialization.
-
- * encoding.c (rb_enc_aliases_enc_i): exclude non alias names from
- Encoding.aliases.
-
- * encoding.c (rb_enc_find_index): use original encoding name to
- load DLL.
-
-Fri Jan 18 07:06:25 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * io.c (Init_IO): stdin/stdout may not be duplex.
-
-Fri Jan 18 04:27:57 2008 Eric Hodel <drbrain@segment7.net>
-
- * sample/rdoc/markup/rdoc2latex.rb: Fix for new namespacing.
-
- * lib/rdoc/markup/to_latex.rb: Fix namespacing.
-
-Fri Jan 18 02:02:28 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * bootstraptest/runner.rb (assert_valid_syntax): added.
-
- * bootstraptest/test_knownbug.rb: added test for [ruby-list:44479]
-
-Fri Jan 18 01:48:06 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * vm_insnhelper.c (vm_call_method): check argument number to
- attr_reader. [ruby-core:15120]
-
-Fri Jan 18 00:49:31 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * io.c (rb_io_check_readable): flush tied write IO too.
-
- * io.c (Init_IO): tie stdin with stdout. [ruby-core:15107]
-
-Fri Jan 18 00:23:31 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * encoding.c (enc_free): removed since rb_encoding may be used while
- cleanup.
-
-Fri Jan 18 00:17:19 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * enc/euc_cn.c: split from enc/euc_kr.c.
-
-Fri Jan 18 00:03:54 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/stringio/stringio.c (strio_init): use default external encoding
- if nothing is given. a patch from sheepman <sheepman AT
- sheepman.sakura.ne.jp> in [ruby-dev:33159].
-
-Thu Jan 17 23:56:20 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * common.mk (encdb.h): give output file name to make_encdb.rb.
-
- * encoding.c (enc_table): simplified.
-
- * encoding.c (enc_register_at): lazy loading. [ruby-dev:33013]
-
- * regenc.h (ENC_DUMMY): added.
-
- * enc/make_encdb.rb: now emits macros only.
-
- * enc/iso_2022_jp.h: split from encoding.c.
-
-Thu Jan 17 21:48:21 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * re.c (rb_char_to_option_kcode): fixed typo.
-
-Thu Jan 17 21:01:25 2008 Tadayoshi Funaba <tadf@dotrb.org>
+Thu Jan 17 21:06:01 2008 Tadayoshi Funaba <tadf@dotrb.org>
* lib/date.rb (Date::Infinity#<=>): didn't work. A patch from
Dirkjan Bussink <d.bussink AT gmail.com> [ruby-core:15098].
@@ -28468,132 +2953,10 @@ Thu Jan 17 21:01:25 2008 Tadayoshi Funaba <tadf@dotrb.org>
* lib/date.rb, lib/date/format.rb: some trivial changes.
-Thu Jan 17 13:07:18 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * string.c (rb_str_dump): preserve the encoding of source string
- if it is ASCII compatible. otherwise, add '.force_encoding()'
- for ugly work around. maybe we should implement some other way
- to keep non ASCII encoding in dumped string. [ruby-dev:33142]
-
-Thu Jan 17 10:30:32 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * io.c (io_fwrite): always flush IO on tty, even without newlines.
- [ruby-core:15107]
-
-Wed Jan 16 22:45:27 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * encoding.c (enc_register_at): make own copy. [ruby-dev:33136]
-
-Wed Jan 16 18:03:10 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * io.c (pipe_open, rb_io_s_popen): clear temporary object to release
- and prevent from GC.
-
-Wed Jan 16 17:55:07 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * numeric.c (fix_quo): typo. a patch from Shin-ichiro HARA
- <sinara AT blade.nagaokaut.ac.jp> in [ruby-dev:33130]
-
-Wed Jan 16 17:36:26 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * test/test_delegate.rb: add new test file for delegate.rb.
-
-Wed Jan 16 16:14:00 2008 Akinori MUSHA <knu@iDaemons.org>
-
- * ruby.1: Fix grammar.
-
-Wed Jan 16 15:26:31 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * file.c (sys_fail2): get rid of unlimited alloca.
-
- * io.c (mode_enc, pipe_open, rb_io_s_popen): ditto.
-
- * load.c (rb_feature_p): ditto.
-
- * object.c (rb_cstr_to_dbl): ditto.
-
- * io.c (mode_enc): fixed uninitialized variable.
-
-Wed Jan 16 12:51:30 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * include/ruby/intern.h (rb_str_tmp_new, rb_str_shared_replace):
- prototype moved.
-
-Tue Jan 15 23:52:51 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * enc/*: add ARG_UNUSED.
-
- * enc/koi8_u.c: added.
-
-Tue Jan 15 23:00:08 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * enc/utf_{16,32}{be,le}.c: remove some ARG_UNUSED. replace struct
- OnigEncodingST by OnigEncoding.
-
-Tue Jan 15 22:30:43 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * encoding.c (ENC_REGISTER): use &OnigEncoding*.
- (ENCINDEX_UTF_8): renamed from ENCINDEX_UTF8.
- (rb_enc_init): use ENC_REGISTER.
-
- * include/ruby/oniguruma.h (OnigEncodingUTF8, ONIG_ENCODING_UTF8):
- removed.
-
- * enc/*.c: remove use of &encoding_*; use enc argument instead.
-
-Tue Jan 15 18:44:46 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * enc/utf_8.c: remove use of ONIG_ENCODING_UTF8 altogether; use
- enc argument instead.
-
-Tue Jan 15 18:05:26 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * enc/utf_8.c (ONIG_ENCODING_UTF8): reverted.
-
-Tue Jan 15 18:01:55 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/Makefile.sub (MKFILES): add dependencies.
-
-Tue Jan 15 18:00:16 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * enc/utf_8.c (OnigEncodingDefine): encoding name should be kept
- unchanged.
-
-Tue Jan 15 17:53:05 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * enc/utf_8.c: renamed as IANA name.
-
- * enc/Makefile.in: ditto.
-
-Tue Jan 15 16:59:31 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ruby.c (proc_options): encoding libraries cannot be loaded until
- load path is set.
-
Tue Jan 15 15:09:28 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* win32/setup.mak: strip out empty lines from CPP output.
-Tue Jan 15 14:57:38 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * {win,bcc}32/setup.mak (-basic-vars-): expand BASERUBY to full path
- to get rid of ./ruby.exe.
-
- * win32/enc-setup.mak: workaround for Borland make.
-
-Tue Jan 15 14:44:53 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * encoding.c (rb_locale_charmap): use ASCII-8BIT in miniruby.
-
-Tue Jan 15 13:54:41 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * {bcc32,win32}/Makefile.sub (RUNRUBY): need to set archdir when
- invoking ruby.
-
-Tue Jan 15 13:43:18 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * common.mk (us_ascii.o): add dependencies. [ruby-dev:33111]
-
Tue Jan 15 03:41:42 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* eval.c (eval): check if backtrace is empty. [ruby-core:15040]
@@ -28602,282 +2965,26 @@ Tue Jan 15 01:28:47 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* common.mk: simplified dummy objects dependencies.
-Tue Jan 15 01:19:00 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * common.mk (OBJS): moved encoding.o from COMMONOBJS.
-
- * common.mk (dmyencoding.o): added. [ruby-dev:33099]
-
- * configure.in, {win,bcc}32/Makefile.sub (MINIOBJS): added
- dmyencoding.o.
-
- * dmyencoding.c (rb_locale_charmap): returns nil for miniruby.
-
-Tue Jan 15 00:05:50 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * io.c (appendline): specifying limit should not generate broken
- byte sequence. strings should be rounded. [ruby-dev:33088]
-
-Mon Jan 14 23:33:02 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * ext/nkf/lib/kconv.rb (Kconv.tolocale): argument is str.
-
-Mon Jan 14 23:31:05 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * configure.in (setup): add -I$(EXTOUT)/$(arch) to MINIRUBY.
-
- * bootstraptest/runner.rb (main): expand -I directory path.
-
-Mon Jan 14 23:28:10 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/enc-setup.mak (BUILTIN_ENCOBJS): depends on enc/Makefile.in.
-
-Mon Jan 14 22:48:16 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * re.c (rb_char_to_option_kcode): use rb_enc_find_index() instead
- of using fixed index value.
-
- * enc/Makefile.in (encsrcdir): make US-ASCII built-in.
-
-Mon Jan 14 22:25:02 2008 WATANABE Hirofumi <eban@ruby-lang.org>
-
- * golf_prelude.rb: Shorter method name completion. Same method
- used for const missing. do_while and do_until added. Enumerator
- gains all of Array's abilities. Ex:
- '123'.m{|i|i*2} #=> "112233"
- '123'.pe #=> '123'.perm*' ' #=> "123 132 213 231 312 321"
- base on a patch from Darren Smith <darrenks AT ml1.net>.
-
-Mon Jan 14 21:10:02 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * enc/us_ascii.c: wrong alias name: ANSI_X3.4-1986.
-
- * rubytest.rb: add -I#{srcdir} to load encoding DLL.
-
-Mon Jan 14 18:53:58 2008 Koichi Sasada <ko1@atdot.net>
-
- * thread.c: clear thread structure.
- (TODO: survey that child process should clear mutex or not).
-
- * bootstraptest/test_knownbug.rb, test_thread.rb: move a fixed test.
-
-Mon Jan 14 18:43:38 2008 Koichi Sasada <ko1@atdot.net>
-
- * bootstraptest/runner.rb: add "flunk" method.
-
- * bootstraptest/test_knownbug.rb: fix to use flunk.
-
-Mon Jan 14 18:10:59 2008 Koichi Sasada <ko1@atdot.net>
-
- * vm.h: remove dangerous assembler sentence.
-
-Mon Jan 14 18:06:37 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * encoding.c (rb_locale_encoding): return US-ASCII when charmap is
- nil.
-
Mon Jan 14 16:12:58 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
* lib/shellwords.rb: scape should be an alias to shellescape. a
patch from Masahiro Kawato <m-kawato AT mwb.biglobe.ne.jp> in
[ruby-dev:33060].
-Mon Jan 14 16:09:16 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * ruby.1: a patch to describe --encoding. a patch from Yugui
- <yugui AT yugui.sakura.ne.jp> in [ruby-dev:33079].
-
- * ruby.c: ditto.
-
-Mon Jan 14 13:49:26 2008 Tanaka Akira <akr@fsij.org>
-
- * re.c (rb_reg_prepare_re): initialize error message buffer.
- (rb_reg_search): ditto.
- (rb_reg_check_preprocess): ditto.
- (rb_reg_new_str): ditto.
- (rb_enc_reg_new): ditto.
- (rb_reg_compile): ditto.
- (rb_reg_initialize_m): ditto.
- (rb_reg_s_union_m): ditto.
-
-Mon Jan 14 12:33:07 2008 Eric Hodel <drbrain@segment7.net>
-
- * lib/rdoc/markup*: Renamespace from SM::SimpleMarkup to
- RDoc::Markup.
-
-Mon Jan 14 10:45:45 2008 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * enc/ascii.c: Exchanged order of arguments for one ENC_ALIAS
-
-Mon Jan 14 09:19:07 2008 Tadayoshi Funaba <tadf@dotrb.org>
+Mon Jan 14 09:32:40 2008 Tadayoshi Funaba <tadf@dotrb.org>
* lib/time.rb: do not reference Time directly from the inside of
definitions. [ruby-dev:33059]
-Mon Jan 14 05:44:44 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * enc/*.c: add replicas and aliases.
-
- * enc/make_encdb.h: add duplicate and undefined check.
-
-Mon Jan 14 02:03:05 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * include/ruby/oniguruma.h: remove ONIG_ENCODING_* and OnigEncoding*
- which are not builtin.
-
- * regenc.{c,h} (onigenc_mb2_code_to_mbclen, onigenc_mb4_code_to_mbclen):
- fix prototype.
-
- * enc/big5.c, enc/euc_kr.c, enc/euc_tw.c, enc/gb18030.c,
- enc/koi8_r.c, enc/windows_1251.c: imported from Oniguruma.
-
-Sun Jan 13 22:47:28 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * enc/make_encdb.h: sort encoding names by original name.
-
- * encoding.c, enc/*.c: define replicas and aliases.
-
-Sun Jan 13 20:24:03 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * encoding.c: add documents.
-
-Sun Jan 13 18:41:48 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * encoding.c (Init_Encoding): moved initialization from encdb.h.
-
- * enc/make_encdb.rb (enc_name_list): constified.
-
- * enc/make_encdb.rb (enc_init_db): moved some functions to encoding.c.
-
-Sun Jan 13 13:53:00 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ruby.c (load_file): local variable was not initialized when -x flag
- is given.
-
- * ruby.c (load_file): script files should not be affected by locale.
- [ruby-dev:33054]
-
-Sun Jan 13 12:01:32 2008 Eric Hodel <drbrain@segment7.net>
-
- * lib/rdoc/generators*: Reorganize RDoc generators.
-
-Sun Jan 13 11:41:11 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * encoding.c (ENCINDEX_EUC_JP, ENCINDEX_SJIS): removed.
- (rb_enc_init): EUC-JP and Shift_JIS are not builtin now.
-
- * enc/Makefile.in: ditto.
-
- * common.mk: ditto.
-
- * ruby.c (proc_options): ditto.
-
- * enc/shift_jis.c, enc/euc_jp.c: fixes for remove from builtin.
-
-Sun Jan 13 10:21:40 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * encoding.c (enc_table): packed all enc_table stuff.
-
-Sun Jan 13 09:58:17 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * encoding.c (rb_enc_init): revert removing SJIS.
-
- * enc/sjis.c: move to enc/shift_jis.c, to make encoding name equal to
- filename for convenience of loading lib.
-
- * enc/shift_jis.c: moved from enc/sjis.c.
-
- * common.mk: follows enc/shift_jis.c.
-
- * enc/Makefile.in: ditto.
-
-Sun Jan 13 09:22:33 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * common.mk (incs): includes encdb.h.
-
-Sun Jan 13 09:17:29 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * {bcc,win}32/Makefile.sub (MV): use move instead of ren. [ruby-Bugs-17019]
-
-Sun Jan 13 01:52:31 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * enc/make_encdb.rb: should work on Ruby 1.8. [ruby-dev:33069]
-
- * common.mk (encdb.h): pass enc dir from outside to make_encdb.rb.
-
-Sun Jan 13 00:01:07 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * enc/make_encdb.rb: added. search enc/*.c and make encoding database.
-
- * regenc.h (ENC_REPLICATE, ENC_ALIAS): added for defining replica
- encoding and encoding alias.
-
- * encoding.c (rb_enc_init): move alias definitions to enc/*.c.
- (rb_enc_find_index): search original of replica and alias when no
- encoding library.
- (rb_enc_name_list, rb_enc_aliases_enc_i, rb_enc_aliases_str_i,
- rb_enc_aliases, Encoding.name_list, Encoding.aliases): added.
- (Init_Encoding): init encdb.
-
- * enc/ascii.c, enc/us_ascii.c, enc/euc_jp.c, enc/sjis.c:
- add replica encoding and encoding alias definition.
-
- * common.mk (dist-clean-local): add rule for remove encdb.h.
-
Sat Jan 12 18:27:41 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* eval.c (rb_define_alloc_func, rb_undef_alloc_func): should
- define/undef on a singleton class. [ruby-core:09959]
-
-Sat Jan 12 12:44:36 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * ext/nkf/nkf.c: rdoc update.
+ define/undef on a signleton class. [ruby-core:09959]
-Sat Jan 12 12:01:49 2008 Tadayoshi Funaba <tadf@dotrb.org>
+Sat Jan 12 12:04:14 2008 Tadayoshi Funaba <tadf@dotrb.org>
* lib/date.rb, lib/date/format.rb: tuning for performance.
-Sat Jan 12 11:29:45 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * bootstraptest/test_proc.rb: fixed wrong expected result. pointed
- out by Kornelius "murphy" Kalnbach <murphy AT rubychan.de> in
- [ruby-core:15022].
-
-Sat Jan 12 04:38:38 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * ruby.c (process_options): -e'script' is locale encoding by default.
- (load_file): ruby script from stdin is locale encoding by default.
-
-Sat Jan 12 04:31:59 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * ext/nkf/nkf-utf8/nkf.c: fix bug: -m was -m0.
-
-Fri Jan 11 23:22:31 2008 Tanaka Akira <akr@fsij.org>
-
- * string.c (string.c): call rb_str_buf_append to update encoding of
- str1, even if str2 is empty.
-
-Fri Jan 11 20:20:16 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * proc.c (proc_mark): needs to mark the receiver too. a patch from
- Chris Heath <chris AT heathens.co.nz> in [ruby-core:14983].
- [ruby-core:14885]
-
-Fri Jan 11 18:28:49 2008 Eric Hodel <drbrain@segment7.net>
-
- * lib/rdoc/usage.rb: Removed.
-
- * lib/getoptlong.rb: Update example to not use lib/rdoc/usage.rb.
-
-Fri Jan 11 18:17:10 2008 Eric Hodel <drbrain@segment7.net>
-
- * lib/rdoc/ri/driver.rb (read_yaml): Follow namespace change
- [ruby-core:14964].
-
-Fri Jan 11 16:55:21 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * string.c (rb_str_append): performance improvement.
-
Fri Jan 11 12:35:56 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* configure.in: moved broken syscall checks from process.c etc.
@@ -28885,1166 +2992,95 @@ Fri Jan 11 12:35:56 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* defines.h (WORDS_BIGENDIAN): honor __BIG_ENDIAN__ than the result of
configure.
- * lib/rdoc/options.rb (check_diagram): more precise check, darwin
- is not Windows but mingw is on it.
-
-Fri Jan 11 09:59:05 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * ext/nkf/nkf-utf8/nkf.c: update to r1.163.
-
- * ext/nkf/nkf.c: ASCII's canonical name is US-ASCII.
-
- * ext/nkf/lib/kconv.rb (Kconv.isjis): force_encoding('BINARY').
-
-Fri Jan 11 09:23:31 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * encoding.c (set_base_encoding): must use rb_enc_dummy_p.
-
-Fri Jan 11 06:13:14 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * encoding.c (rb_to_encoding_index, rb_to_encoding): disallow nil.
- [ruby-dev:33003]
-
-Fri Jan 11 01:08:01 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * thread.c (rb_mutex_unlock): proper error message for unlocking
- mutex that is not locked. a patch from Yusuke ENDOH
- <mame at tsg.ne.jp> in [ruby-dev:33010].
-
-Thu Jan 10 18:00:41 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * prelude.rb (Mutex::synchronize): capture exception from unlock.
- [ruby-dev:32935]
-
-Thu Jan 10 10:15:03 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * io.c (io_encoding_set): IO.pipe("euc-jp", nil) should work as
- IO.pipe("euc-jp", nil). [ruby-dev:33000]
-
- * io.c (io_encoding_set): handle nil for v1.
-
-Thu Jan 10 02:41:22 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * io.c (rb_io_binmode): should not alter encoding. [ruby-dev:32918]
-
- * io.c (io_read_encoding): need not to return ASCII-8BIT for
- binary IO.
-
-Wed Jan 9 22:04:17 2008 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-
- * lib/mathn.rb (Prime#each): returns an enumerator if no block
- given. [ruby-dev:32815]
-
-Wed Jan 9 22:03:26 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * encoding.c (rb_enc_replicate): replica of dummy is a dummy.
-
-Wed Jan 9 20:55:38 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/e2mmap.rb (Exception2MessageMapper::Raise): define fail.
- [ruby-dev:32854]
-
-Wed Jan 9 20:35:42 2008 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * lib/webrick/httprequest.rb: support X-Forwarded-* header fields.
- WEBrick::HTTPRequest#{host,port,request_uri} is derived having
- regards to X-Forwarded-Proto and X-Forwarded-Host.
-
- * lib/webrick/httprequest.rb
- (WEBrick::HTTPRequest#server_name?): new method.
- (WEBrick::HTTPRequest#remote_ip?): new method.
- (WEBrick::HTTPRequest#ssl?): new method.
-
-Wed Jan 9 18:24:39 2008 WATANABE Hirofumi <eban@ruby-lang.org>
-
- * golf_prelude.rb (Array#to_s): alias to join.
+ * dln.c: use dlopen on Mac OS X 10.3 or later. backport from trunk.
- * golf_prelude.rb (FalseClass#to_s): return "".
-
-Wed Jan 9 16:59:54 2008 Tanaka Akira <akr@fsij.org>
-
- * string.c (rb_enc_cr_str_buf_cat): fix self appending.
-
-Wed Jan 9 15:54:24 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ruby.c (process_options): give priority command line encoding option
- to RUBYOPT, and enable -E option in RUBYOPT.
-
- * ruby.c (load_file): deal with encoding option in shebang line if
- nothing in command line and RUBYOPT.
-
-Wed Jan 9 14:55:36 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * parse.y (yycompile0): remove setting parser->enc because it is set
- in parser_prepare() by previous change of parser_prepare().
-
-Wed Jan 9 14:52:18 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * string.c (rb_enc_cr_str_buf_cat, rb_str_buf_append): deal with self
- appending.
-
-Wed Jan 9 14:44:57 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * parse.y (parser_prepare): set parser->enc from lex_input for ripper.
-
-Wed Jan 9 13:45:52 2008 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * lib/webrick/server.rb (WEBrick::HTTPServer#start):
- :DoNotReverseLookup option had not been performed.
-
-Wed Jan 9 13:03:34 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * string.c (rb_enc_cr_str_buf_cat): do not recalculate coderange
- value if it's given from outside.
-
-Wed Jan 9 08:42:01 2008 James Edward Gray II <jeg2@ruby-lang.org>
-
- * enum.c: Updating the documentation of Enumerable#zip to reflect
- the recent changes Matz made to the method.
-
-Wed Jan 9 01:35:10 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * enc/Makefile.in (BUILTIN_ENCS): UTF-{16,32}{BE,LE} are not builtin.
-
-Tue Jan 8 23:55:15 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * encoding.c (rb_enc_init): UTF-{16,32}{BE,LE} are not builtin.
+ * lib/rdoc/options.rb (check_diagram): more precise check, darwin
+ is not Windows but minwg is on it.
-Tue Jan 8 22:33:03 2008 NARUSE, Yui <naruse@ruby-lang.org>
+Thu Jan 10 10:53:50 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * encoding.c, Makefile.in, include/ruby/oniguruma.h,
- enc/Makefile.in: fix rules for UTF-{16,32}{BE,LE}.
+ * win32/win32.c (rb_w32_open_osfhandle): reverted to old definition.
+ [ ruby-Bugs-16948 ]
Tue Jan 8 20:02:08 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* win{32,ce}/Makefile.sub: merged.
-Tue Jan 8 19:48:15 2008 Eric Hodel <drbrain@segment7.net>
-
- * lib/rdoc/ri/driver.rb: Speed up Marshal.load. Fix bug with nested
- classes' methods.
-
-Tue Jan 8 19:17:29 2008 Eric Hodel <drbrain@segment7.net>
-
- * lib/rdoc/*: Clean up namespacing of RI's classes.
-
-Tue Jan 8 18:05:35 2008 Eric Hodel <drbrain@segment7.net>
-
- * bin/ri, lib/rdoc/ri/*: Replace with Ryan Davis' cached ri.
-
-Tue Jan 8 17:32:07 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * enum.c (enum_zip): honor length of the receiver, not the
- shortest length. [ruby-core:14738]
-
- * enum.c (enum_zip): returns array not enumerator for no block
- form. [ruby-core:14738]
-
- * enumerator.c (next_ii): do not ignore multiple values yielded.
-
- * array.c (rb_ary_zip): faster version without creating generators.
-
-Tue Jan 8 15:47:43 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * enc/utf{16,32}_{be,le}.c: use &OnigEncodingName(*) instead of
- ONIG_ENCODING_*.
-
-Tue Jan 8 15:40:31 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * regenc.c (onigenc_strlen_null, onigenc_str_bytelen_null): suppressed
- warnings.
-
- * regenc.h, enc/unicode.c (onigenc_unicode_ctype_code_range): added
- encoding argument.
-
- * enc/utf{16,32}_{be,le}.c: added init functions.
-
- * enc/utf{16,32}_{be,le}.c: imported from Oniguruma 5.9.1.
-
-Tue Jan 8 15:03:10 2008 Tanaka Akira <akr@fsij.org>
-
- * string.c (str_gsub): avoid appending empty pre-match substr.
-
-Tue Jan 8 13:05:57 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * compile.c (iseq_build_from_ary), iseq.c (iseq_load): fix for format change.
-
-Tue Jan 8 07:56:11 2008 Tanaka Akira <akr@fsij.org>
-
- * string.c (rb_str_buf_append): fix append itself.
-
-Tue Jan 8 01:13:50 2008 Tanaka Akira <akr@fsij.org>
-
- * string.c (STR_ENC_GET): defined. same as rb_enc_get without
- enc_capable.
- (coderange_scan): ASCII-8BIT test refined.
- (rb_enc_cr_str_buf_cat): new internal function to accumulate
- strings with encoding.
- (rb_enc_str_buf_cat): use rb_enc_cr_str_buf_cat.
- (rb_str_buf_append): ditto
- (str_gsub): use rb_str_buf_append.
- (rb_str_hash): use ENCODING_GET.
- (rb_str_comparable): ditto.
- (rb_str_cmp): compare encoding index, not rb_encoding address.
-
-Mon Jan 7 20:37:55 2008 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * lib/webrick/httpservlet/cgihandler.rb: external encoding of
- tempfiles is set to "ASCII-8BIT".
-
-Mon Jan 7 19:39:50 2008 Eric Hodel <drbrain@segment7.net>
-
- * lib/rdoc/template.rb: Use ERB instead of custom template language.
-
- * lib/rdoc/generators/template/html/old_html.rb: Remove.
-
- * lib/rdoc/generators/template/*: Convert to ERB.
-
-Mon Jan 7 19:11:30 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * string.c (Init_String): sym_match arity spec was wrong. a patch
- from Hiroyuki Iwatsuki <don at na.rim.or.jp> in [ruby-dev:32957].
-
-Mon Jan 7 18:10:33 2008 Tanaka Akira <akr@fsij.org>
-
- * string.c (str_gsub): move rb_enc_get(str) to out of loop.
-
-Mon Jan 7 15:52:10 2008 Tanaka Akira <akr@fsij.org>
-
- * include/ruby/oniguruma.h (OnigEncodingType): new member
- ruby_encoding_index to avoid linear search in rb_enc_to_index.
-
- * include/ruby/encoding.h (rb_enc_to_index): macro defined to use
- ruby_encoding_index.
-
- * encoding.c (rb_enc_to_index): removed.
- (enc_register_at): initialize ruby_encoding_index member.
-
-Mon Jan 7 16:10:35 2008 Eric Hodel <drbrain@segment7.net>
-
- * lib/rdoc/tokenstream.rb: Namespace under RDoc.
-
-Mon Jan 7 16:06:09 2008 Eric Hodel <drbrain@segment7.net>
-
- * lib/rdoc/dot.rb: Namespace under RDoc.
-
- * lib/rdoc/diagram.rb: Clean up formatting.
-
-Mon Jan 7 15:51:35 2008 Eric Hodel <drbrain@segment7.net>
-
- * lib/rdoc/options.rb: Convert to OptionParser, clean up -h output,
- namespace under RDoc.
- * lib/rdoc/*: Namespace RDoc::Options.
-
-Mon Jan 7 15:42:46 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * common.mk, Makefile.in, */Makefile.sub (distclean-local): move
- removing rule of ext/ripper/y.output from common.mk to Makefiles
- that depend on platforms.
-
-Mon Jan 7 13:54:57 2008 Tanaka Akira <akr@fsij.org>
-
- * re.c (rb_reg_preprocess): fix fixed_enc condition.
-
-Mon Jan 7 11:51:49 2008 Eric Hodel <drbrain@segment7.net>
-
- * lib/rdoc/generators/ri_generator.rb: Merge documentation from the
- same class on output. Fixes bug where documentation could
- disappear.
-
- * lib/rdoc/options.rb: Fix typo.
-
- * lib/rdoc/generators/*: Clean up some namespacing and make RDoc
- consistent.
-
-Mon Jan 7 11:44:45 2008 Tanaka Akira <akr@fsij.org>
-
- * encoding.c (rb_enc_internal_get_index): extracted from
- rb_enc_get_index.
- (rb_enc_internal_set_index): extracted from rb_enc_associate_index
-
- * include/ruby/encoding.h (ENCODING_SET): work over ENCODING_INLINE_MAX.
- (ENCODING_GET): ditto.
- (ENCODING_IS_ASCII8BIT): defined.
- (ENCODING_CODERANGE_SET): defined.
-
- * re.c (rb_reg_fixed_encoding_p): use ENCODING_IS_ASCII8BIT.
-
- * string.c (rb_enc_str_buf_cat): use ENCODING_IS_ASCII8BIT.
-
- * parse.y (reg_fragment_setenc_gen): use ENCODING_IS_ASCII8BIT.
-
- * marshal.c (has_ivars): use ENCODING_IS_ASCII8BIT.
-
-Mon Jan 7 02:14:07 2008 Tanaka Akira <akr@fsij.org>
-
- * string.c (coderange_scan): avoid rb_enc_to_index.
- (rb_enc_str_buf_cat): ditto.
- (str_cat_char): use rb_enc_str_buf_cat.
- (rb_str_inspect): ditto.
-
-Mon Jan 7 01:36:49 2008 Tanaka Akira <akr@fsij.org>
-
- * string.c (coderange_scan): optimize ASCII-8BIT string.
- (rb_enc_str_buf_cat): don't call coderange_scan if possible.
-
-Mon Jan 7 01:05:45 2008 Tanaka Akira <akr@fsij.org>
-
- * lib/erb.rb (ERB::Revision): cut off locale dependent string in Date
- keyword.
-
-Mon Jan 7 00:48:02 2008 Tanaka Akira <akr@fsij.org>
-
- * Date keyword removed to avoid inclusion of locale dependent
- string. [ruby-dev:32940]
-
-Sun Jan 6 21:14:12 2008 Tanaka Akira <akr@fsij.org>
-
- * re.c (rb_reg_initialize_str): forbid raw non ASCII character
- for ASCII-8BIT regexp in non ASCII-8BIT script.
-
-Sun Jan 6 18:19:12 2008 Tanaka Akira <akr@fsij.org>
-
- * include/ruby/encoding.h (rb_enc_str_buf_cat): declared.
-
- * string.c (coderange_scan): extracted from rb_enc_str_coderange.
- (rb_enc_str_coderange): use coderange_scan.
- (rb_str_shared_replace): copy encoding and coderange.
- (rb_enc_str_buf_cat): new function for linear complexity string
- accumulation with encoding.
- (rb_str_sub_bang): don't conflict substituted part and replacement.
- (str_gsub): use rb_enc_str_buf_cat.
- (rb_str_clear): clear coderange.
-
- * re.c (rb_reg_regsub): use rb_enc_str_buf_cat.
-
-Sun Jan 6 17:55:44 2008 Technorama Ltd. <oss-ruby@technorama.net>
-
- * lib/securerandom.rb: Add Win32 support.
-
-Sun Jan 6 09:32:58 2008 Tadayoshi Funaba <tadf@dotrb.org>
+Sun Jan 6 09:39:02 2008 Tadayoshi Funaba <tadf@dotrb.org>
* lib/date.rb, lib/date/format.rb: introduced some constants
- (for internal use) and aliases (minute and second).
+ (for internal use).
* sample/cal.rb: trivial adjustments.
-Sun Jan 6 01:38:07 2008 Tanaka Akira <akr@fsij.org>
-
- * re.c (rb_reg_initialize_str): /\x80/n is not an error even if script
- encoding is EUC-JP.
-
-Sun Jan 6 00:48:12 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * lib/resolv.rb (Resolv::DNS#each_address): get A record and then AAAA
- record. [ruby-dev:32925]
-
-Sat Jan 5 21:48:03 2008 Tanaka Akira <akr@fsij.org>
-
- * vm_insnhelper.c (vm_callee_setup_arg): it is not inlinable because
- alloca is used.
-
-Sat Jan 5 16:50:48 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * string.c (rb_str_resize): copy if old data is not empty
- [ruby-core:14785]
-
-Sat Jan 5 13:04:24 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ruby.c (proc_options): no need for intermediate object.
-
-Sat Jan 5 11:48:19 2008 Tanaka Akira <akr@fsij.org>
-
- * encoding.c (Init_Encoding): alias csWindows31J to Windows-31J.
- IE6 accepts csWindows31J but Windows-31J.
-
-Sat Jan 5 02:21:10 2008 Tanaka Akira <akr@fsij.org>
-
- * include/ruby/ruby.h (rb_intern): memorize interned ID for constant
- string, using gcc's __builtin_constant_p and statement expression.
-
-Sat Jan 5 02:14:45 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * string.c (trnext): should enable backslash escape.
-
-Sat Jan 5 01:50:32 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (Init_eval): move instance_eval and instance_exec to
- BasicObject. [ruby-core:14747]
-
- * lib/delegate.rb: should preserve new methods in BasicObject.
-
-Sat Jan 5 01:46:29 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * ruby.c (proc_options): update according to the last API revert.
-
-Sat Jan 5 01:30:30 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * include/ruby/intern.h, re.c (rb_reg_new): keep interface same as
- 1.8. [ruby-core:14583]
-
- * include/ruby/intern.h, re.c (rb_reg_new_str): renamed, and defines
- HAVE_RB_REG_NEW_STR macro to tell if it is available.
-
- * include/ruby/encoding.h (rb_enc_reg_new): added.
-
- * insns.def (toregexp), marshal.c (r_object0): use rb_reg_new_str().
-
- * re.c (rb_reg_regcomp, rb_reg_s_union): ditto.
-
Fri Jan 4 23:08:48 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* time.c (time_arg): use converted object. [ruby-core:14759]
-Fri Jan 4 16:24:58 2008 Tanaka Akira <akr@fsij.org>
-
- * ext/digest/lib/digest/hmac.rb (Digest::HMAC#initialize): use
- String#bytesize to avoid test errors on EUC-JP environment.
-
-Fri Jan 4 14:00:50 2008 Tanaka Akira <akr@fsij.org>
-
- * re.c (rb_reg_prepare_re): check string encoding. Oniguruma doesn't
- support invalid encoding.
-
-Fri Jan 4 10:22:25 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * re.c (rb_reg_search): avoid inner loop for reverse search.
-
- * regexec.c: unset USE_MATCH_RANGE_MUST_BE_INSIDE_OF_SPECIFIED_RANGE
- which is turned on since oniguruma 5.9.1.
-
-Fri Jan 4 02:53:31 2008 Tanaka Akira <akr@fsij.org>
-
- * enc/euc_jp.c: remove eucjp_ prefix. breakpoint can be specified as
- euc_jp.c:mbc_enc_len. avoid needless conflict by merge.
-
- * enc/sjis.c: remove sjis_ prefix.
-
- * enc/utf8.c: remove utf8_ prefix.
-
- * enc/iso_8859_1.c: remove iso_8859_1_ prefix.
-
- * enc/iso_8859_2.c: remove iso_8859_2_ prefix.
-
- * enc/iso_8859_3.c: remove iso_8859_3_ prefix.
-
- * enc/iso_8859_4.c: remove iso_8859_4_ prefix.
-
- * enc/iso_8859_5.c: remove iso_8859_5_ prefix.
-
- * enc/iso_8859_6.c: remove iso_8859_6_ prefix.
-
- * enc/iso_8859_7.c: remove iso_8859_7_ prefix.
-
- * enc/iso_8859_8.c: remove iso_8859_8_ prefix.
-
- * enc/iso_8859_9.c: remove iso_8859_9_ prefix.
-
- * enc/iso_8859_10.c: remove iso_8859_10_ prefix.
-
- * enc/iso_8859_11.c: remove iso_8859_11_ prefix.
-
- * enc/iso_8859_13.c: remove iso_8859_13_ prefix.
-
- * enc/iso_8859_14.c: remove iso_8859_14_ prefix.
-
- * enc/iso_8859_15.c: remove iso_8859_15_ prefix.
-
- * enc/iso_8859_16.c: remove iso_8859_16_ prefix.
-
-Fri Jan 4 02:47:06 2008 Tanaka Akira <akr@fsij.org>
-
- * re.c (rb_reg_search): iterate onig_match for reverse mode.
-
Fri Jan 4 01:20:21 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* win32.h: only VC6 needs extern "C++" for math.h. [ruby-talk:285660]
-Fri Jan 4 00:54:43 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * include/ruby/oniguruma.h: Oniguruma 5.9.1 merged.
-
-Fri Jan 4 00:20:47 2008 Tanaka Akira <akr@fsij.org>
-
- * io.c (io_ungetc): move data in buffer if it is required to store the
- argument.
-
-Thu Jan 3 21:56:07 2008 Tanaka Akira <akr@fsij.org>
-
- * include/ruby/ruby.h (st_strcasecmp): declared for STRCASECMP.
- (st_strncasecmp): declared for STRNCASECMP.
-
-Thu Jan 3 20:24:48 2008 Koichi Sasada <ko1@atdot.net>
-
- * eval_jump.c (rb_f_catch): Restore cfp if caught thrown object.
-
-Thu Jan 3 19:45:57 2008 Koichi Sasada <ko1@atdot.net>
-
- * bootstraptest/test_eval.rb, test_knownbug.rb: move a fixed test.
-
-Thu Jan 3 18:39:12 2008 Tanaka Akira <akr@fsij.org>
-
- * encoding.c: (rb_tolower, rb_toupper): body was exchanged.
-
-Thu Jan 3 17:54:01 2008 Tanaka Akira <akr@fsij.org>
-
- * regenc.h (onigenc_ascii_is_code_ctype): put back.
-
-Thu Jan 3 17:33:09 2008 Tanaka Akira <akr@fsij.org>
-
- * encoding.c (rb_isalnum): defined.
- (rb_isalpha): ditto.
- (rb_isblank): ditto.
- (rb_iscntrl): ditto.
- (rb_isdigit): ditto.
- (rb_isgraph): ditto.
- (rb_islower): ditto.
- (rb_isprint): ditto.
- (rb_ispunct): ditto.
- (rb_isspace): ditto.
- (rb_isupper): ditto.
- (rb_isxdigit): ditto.
- (rb_tolower): ditto.
- (rb_toupper): ditto.
-
- * include/ruby/ruby.h: don't include include/ruby/encoding.h.
- (rb_isascii): defined.
- (rb_isalnum): declared.
- (rb_isalpha): ditto.
- (rb_isblank): ditto.
- (rb_iscntrl): ditto.
- (rb_isdigit): ditto.
- (rb_isgraph): ditto.
- (rb_islower): ditto.
- (rb_isprint): ditto.
- (rb_ispunct): ditto.
- (rb_isspace): ditto.
- (rb_isupper): ditto.
- (rb_isxdigit): ditto.
- (rb_tolower): ditto.
- (rb_toupper): ditto.
- (ISASCII): simplified.
- (ISPRINT): ditto.
- (ISSPACE): ditto.
- (ISUPPER): ditto.
- (ISLOWER): ditto.
- (ISALNUM): ditto.
- (ISALPHA): ditto.
- (ISDIGIT): ditto.
- (ISXDIGIT): ditto.
- (TOUPPER): ditto.
- (TOLOWER): ditto.
-
- * include/ruby/encoding.h (rb_isascii): removed.
- (rb_isalnum): ditto.
- (rb_isalpha): ditto.
- (rb_isblank): ditto.
- (rb_iscntrl): ditto.
- (rb_isdigit): ditto.
- (rb_isgraph): ditto.
- (rb_islower): ditto.
- (rb_isprint): ditto.
- (rb_ispunct): ditto.
- (rb_isspace): ditto.
- (rb_isupper): ditto.
- (rb_isxdigit): ditto.
- (rb_tolower): ditto.
- (rb_toupper): ditto.
-
- * common.mk: dependency updated.
-
-Thu Jan 3 15:10:26 2008 Tanaka Akira <akr@fsij.org>
-
- * include/ruby/encoding.h (rb_isascii): simplified.
- (rb_isalnum): call onigenc_ascii_is_code_ctype without indirect call.
- (rb_isalpha): ditto.
- (rb_isblank): ditto.
- (rb_iscntrl): ditto.
- (rb_isdigit): ditto.
- (rb_isgraph): ditto.
- (rb_islower): ditto.
- (rb_isprint): ditto.
- (rb_ispunct): ditto.
- (rb_isspace): ditto.
- (rb_isupper): ditto.
- (rb_isxdigit): ditto.
-
- * include/ruby/oniguruma.h (onigenc_ascii_is_code_ctype): declaration
- moved from regenc.h.
-
-Thu Jan 3 14:37:17 2008 Tanaka Akira <akr@fsij.org>
-
- * parse.y (parser_magic_comment): use STRNCASECMP.
- (set_file_encoding): ditto.
-
-Thu Jan 3 11:44:37 2008 Tanaka Akira <akr@fsij.org>
-
- * time.c: don't mention an obsolete library, ParseDate.
-
Thu Jan 3 11:28:58 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* io.c (fptr_finalize): clear errno first. [ruby-talk:284492]
-Thu Jan 3 05:02:36 2008 Tanaka Akira <akr@fsij.org>
-
- * enc/us_ascii.c: add us_ascii_ prefix for functions to ease
- setting breakpoint when debugging.
-
- * enc/euc_jp.c: add eucjp_ prefix.
-
- * enc/sjis.c: add sjis_ prefix.
-
- * enc/iso_8859_1.c: add iso_8859_1_ prefix.
-
- * enc/iso_8859_2.c: add iso_8859_2_ prefix.
-
- * enc/iso_8859_3.c: add iso_8859_3_ prefix.
-
- * enc/iso_8859_4.c: add iso_8859_4_ prefix.
-
- * enc/iso_8859_5.c: add iso_8859_5_ prefix.
-
- * enc/iso_8859_6.c: add iso_8859_6_ prefix.
-
- * enc/iso_8859_7.c: add iso_8859_7_ prefix.
-
-Thu Jan 3 02:44:34 2008 Tanaka Akira <akr@fsij.org>
-
- * bignum.c (conv_digit): use ISDIGIT, ISLOWER and ISUPPER.
-
-Wed Jan 2 23:50:15 2008 Tanaka Akira <akr@fsij.org>
-
- * util.c (ruby_strtoul): "0x", "+" and "-" is not a valid integer.
- end of integer should be just after "0", the beginning, the
- beginning respectively.
-
-Wed Jan 2 15:23:15 2008 Tanaka Akira <akr@fsij.org>
-
- * util.c (ruby_strtoul): locale independent strtoul is implemented to
- avoid "i".to_i(36) cause 0 under tr_TR locale on Debian GNU/Linux
- 4.0 (Etch).
- This is newly implemented, not a copy of missing/strtoul.c.
-
- * include/ruby/ruby.h (ruby_strtoul): declared.
- (STRTOUL): defined to use ruby_strtoul.
-
- * bignum.c, pack.c, ext/socket/socket.c: use STRTOUL.
-
- * configure.in (strtoul): don't check.
-
- * missing/strtoul.c: removed.
-
- * include/ruby/missing.h (strtoul): removed.
-
- * common.mk (strtoul.o): removed.
-
- * LEGAL (missing/strtoul.c): removed.
-
-Wed Jan 2 14:41:08 2008 Tanaka Akira <akr@fsij.org>
-
- * common.mk (strcasecmp.o): removed.
- (strncasecmp.o): removed.
-
- * include/ruby/missing.h (strcasecmp): removed.
- (strncasecmp): removed.
-
-Wed Jan 2 11:34:57 2008 Tanaka Akira <akr@fsij.org>
-
- * missing/strcasecmp.c: removed. Ruby don't use locale dependent
- strcasecmp.
-
- * missing/strncasecmp.c: ditto.
-
- * configure.in: don't check strcasecmp and strncasecmp.
-
- * LEGAL: missing/strcasecmp.c and missing/strncasecmp.c removed.
-
-Wed Jan 2 10:13:54 2008 Tadayoshi Funaba <tadf@dotrb.org>
+Wed Jan 2 10:18:56 2008 Tadayoshi Funaba <tadf@dotrb.org>
* sample/time.rb: use Process.times instead of Time.times.
-Wed Jan 2 09:09:53 2008 Tadayoshi Funaba <tadf@dotrb.org>
+Wed Jan 2 09:18:11 2008 Tadayoshi Funaba <tadf@dotrb.org>
* sample/goodfriday.rb: examples for date are enough. retired.
-Wed Jan 2 08:58:54 2008 Tadayoshi Funaba <tadf@dotrb.org>
+Wed Jan 2 09:06:55 2008 Tadayoshi Funaba <tadf@dotrb.org>
* sample/cal.rb: just updated with the newest version.
-Wed Jan 2 01:19:31 2008 Tanaka Akira <akr@fsij.org>
-
- * enc/depend: dependency updated.
-
-Wed Jan 2 00:14:41 2008 NARUSE, Yui <naruse@ruby-lang.org>
-
- * ext/nkf/nkf-utf8/{nkf.c, utf8tbl.c}: Update nkf.
-
- * ext/nkf/nkf.c: fix documents.
-
- * ext/nkf/lib/kconv.rb: fix documents.
- (Kconv.is*): use valid_encoding?.
- (Kconv.isjis): defined.
-
-Tue Jan 1 23:17:03 2008 Tanaka Akira <akr@fsij.org>
-
- * common.mk: dependency updated.
-
-Tue Jan 1 21:11:33 2008 Tanaka Akira <akr@fsij.org>
-
- * include/ruby/encoding.h (rb_isascii): defined.
- (rb_isalnum): ditto.
- (rb_isalpha): ditto.
- (rb_isblank): ditto.
- (rb_iscntrl): ditto.
- (rb_isdigit): ditto.
- (rb_isgraph): ditto.
- (rb_islower): ditto.
- (rb_isprint): ditto.
- (rb_ispunct): ditto.
- (rb_isspace): ditto.
- (rb_isupper): ditto.
- (rb_isxdigit): ditto.
- (rb_tolower): ditto.
- (rb_toupper): ditto.
-
- * include/ruby/st.h (st_strcasecmp): declared.
- (st_strncasecmp): ditto.
-
- * st.c (type_strcasehash): use st_strcasecmp instead of strcasecmp.
- (st_strcasecmp): defined.
- (st_strncasecmp): ditto.
-
- * include/ruby/ruby.h: include include/ruby/encoding.h.
- (ISASCII): use rb_isascii.
- (ISPRINT): use rb_isprint.
- (ISSPACE): use rb_isspace.
- (ISUPPER): use rb_isupper.
- (ISLOWER): use rb_islower.
- (ISALNUM): use rb_isalnum.
- (ISALPHA): use rb_isalpha.
- (ISDIGIT): use rb_isdigit.
- (ISXDIGIT): use rb_isxdigit.
- (TOUPPER): defined.
- (TOLOWER): ditto.
- (STRCASECMP): ditto.
- (STRNCASECMP): ditto.
-
- * dir.c, encoding.c, file.c, hash.c, process.c, ruby.c, time.c,
- transcode.c, ext/readline/readline.c: use locale insensitive
- functions. [ruby-core:14662]
-
-Tue Jan 1 17:50:47 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * io.c (rb_io_mode_enc): encoding spec is not allowed in binary mode.
- [ruby-dev:32913]
-
-Tue Jan 1 14:41:56 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/rexml: 1.9 patch from Sam Ruby mentioned in his blog:
- <http://intertwingly.net/blog/2007/12/31/Porting-REXML-to-Ruby-1-9>
- [ruby-core:14639]
-
-Tue Jan 1 14:15:04 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * string.c (rb_str_substr): offset movement bug. a patch from
- Vincent Isambart <vincent.isambart at gmail.com> in
- [ruby-core:14647]. [ruby-core:14644]
-
-Tue Jan 1 01:29:04 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * encoding.c (rb_to_encoding): raises for non-nil, non-encoding,
- non-string object. [ruby-core:14634]
-
-Tue Jan 1 01:04:06 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ruby.c (process_options): rejects dummy encoding.
-
-Mon Dec 31 23:53:55 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ruby.c (proc_options, process_options): delays finding encoding
- until load_path is set.
-
-Mon Dec 31 23:27:17 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * string.c (rb_str_resize): embeds if ptr is null. [ruby-dev:32819]
-
-Mon Dec 31 23:17:22 2007 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * lib/webrick/httpproxy.rb (WEBrick::HTTPProxyServer#proxy_service):
- call do_XXX which correspond with request method.
- (WEBrick::HTTPProxyServer#do_CONNECT,do_GET,do_POST,do_HEAD): added.
-
- * test/webrick/test_httpproxy.rb: add test for WEBrick::HTTPProxyServer.
-
-Mon Dec 31 22:53:29 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * thread_pthread.c (native_sleep): timespec tv_sec may overflow on
- some platform. a patch from zunda <zunda616e AT yahoo.co.jp> in
- [ruby-dev:32904].
-
-Mon Dec 31 19:35:20 2007 Tanaka Akira <akr@fsij.org>
-
- * string.c (IS_7BIT): removed.
- (single_byte_optimizable): new function to test optimizationability
- using single byte string.
- (str_strlen): use single_byte_optimizable instead of
- is_ascii_string.
- (str_nth): rename argument: asc -> singlebyte.
- (str_offset): ditto.
- (rb_str_substr): use single_byte_optimizable instead of IS_7BIT.
- (rb_str_index): ditto.
- (rb_str_rindex): ditto.
- (rb_str_splice): ditto.
- (rb_str_justify): ditto.
-
-Mon Dec 31 07:39:31 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * main.c, goruby.c (RUBY_MAIN_INIT): removed.
-
- * goruby.c (goruby_run_node): run after ruby_init_loadpath() so that
- require works, and protect the call.
-
Mon Dec 31 06:50:38 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * common.mk: not use -I$(srcdir)/lib with $(MINIRUBY) for cross
+ * trunk/common.mk: not use -I$(srcdir)/lib with $(MINIRUBY) for cross
compiling.
* configure.in, {win,bcc}32/Makefile.sub (MINIRUBY): -I$(srcdir)/lib
moved.
-Mon Dec 31 06:08:34 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * include/ruby/encoding.h (rb_enc_sprintf, rb_enc_vsprintf): prototyped.
-
- * sprintf.c (rb_enc_sprintf, rb_enc_vsprintf): new functions to format
- arguments with encoding.
-
-Sun Dec 30 23:48:00 2007 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * golf_prelude.rb (String#/): define / as split, as association of
- Array#*.
-
-Sun Dec 30 23:19:06 2007 WATANABE Hirofumi <eban@ruby-lang.org>
-
- * golf_prelude.rb (@@golf_hash): for performance improvement.
-
-Sun Dec 30 22:44:50 2007 Tadayoshi Funaba <tadf@dotrb.org>
+Sun Dec 30 22:48:37 2007 Tadayoshi Funaba <tadf@dotrb.org>
* lib/date.rb (_valid_time?): I'm not sure to recommend such an
expression. but anyway it is acceptable now. [ruby-core:14580]
-Sun Dec 30 21:54:26 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (program, yycompile0): too early to drop lex_lastline in
- rules.
-
-Sun Dec 30 19:23:23 2007 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * bootstraptest/test_knownbug.rb: support DOSISH.
-
-Sun Dec 30 17:43:54 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * encoding.c (Init_Encoding): registered rb_encoding differs from
- ONIG_ENCODINGs.
-
-Sun Dec 30 13:56:15 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (program): clear input strings after all process.
-
- * parse.y (parser_nextc, parser_yylex): should not drop lex_lastline
- while lex_p is valid. [ruby-dev:32896]
-
-Sun Dec 30 10:54:49 2007 NARUSE, Yui <naruse@ruby-lang.org>
-
- * configure.in: rm largefile.h.
-
- * common.mk: clean golf, conf*, preludes, and so on.
-
- * enc/depend: silent and ignore error for rm.
-
- * enc/Makefile.in: should define prefix and exec_prefix.
-
-Sun Dec 30 06:31:11 2007 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * encoding.c (Init_encoding): register Windows-31J and its alias.
- [ruby-dev:32843]
-
- * ruby.c (proc_options): -Ks options means Windows-31J, not Shift_JIS.
-
-Sun Dec 30 06:27:38 2007 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * lib/mkmf.rb (depend_rules): need to convert `/' to `\' for windows
- native commands.
-
-Sun Dec 30 01:43:56 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * enc/Makefile.in (DLDFLAGS): like as extensions. [ruby-core:14567]
-
-Sat Dec 29 23:48:13 2007 Tanaka Akira <akr@fsij.org>
-
- * io.c (io_fflush): don't retry when wbuf modified by other threads.
-
-Sat Dec 29 22:44:30 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * re.c (rb_reg_regsub): returns the given string itself if nothing
- changed.
-
- * string.c (rb_str_sub_bang): keeps code-range as possible.
-
- * string.c (str_gsub): adjusts code-range. [ruby-core:14566]
-
-Sat Dec 29 21:54:37 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * common.mk (clean, distclean, realclean): should include clean-enc
- and others. [ruby-dev:32887]
-
-Sat Dec 29 13:29:29 2007 Tanaka Akira <akr@fsij.org>
-
- * bootstraptest/test_knownbug.rb: add a test reported by
- Kazuhiro NISHIYAMA. [ruby-dev:32819].
- add a test reported by Frederick Cheung. [ruby-core:14556].
-
- * test/ruby/test_m17n.rb (test_gsub): add a test reported by
- Sam Ruby. [ruby-core:14566]
-
-Sat Dec 29 04:46:58 2007 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * lib/test/unit/assertions.rb (Test::Unit::Assertions#assert_throws):
- throw won't raise NameError nor ThreadError but ArgumentError on 1.9.
- (Test::Unit::Assertions#assert_not_throws): ditto.
-
- * test/testunit/test_assertions.rb: add assertions for throwing some
- objects other than Symbol.
-
-Sat Dec 29 03:10:12 2007 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * io.c (io_unread): fix typo.
-
-Sat Dec 29 02:18:45 2007 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * io.c (io_unread): adhoc workaround for non-binary mode of some DOSish
- platforms. this is not perfect and safety, but works with most cases.
-
-Fri Dec 28 23:53:18 2007 Tanaka Akira <akr@fsij.org>
-
- * ext/strscan/strscan.c (str_new): new function for allocate an string
- with encoding propagation.
- (extract_range): use str_new.
- (extract_beg_len): ditto.
- (strscan_peek): ditto.
- (strscan_rest): ditto.
-
-Fri Dec 28 20:18:42 2007 WATANABE Hirofumi <eban@ruby-lang.org>
-
- * golf_prelude.rb (Object.say): derived from Perl 5.10.
-
-Fri Dec 28 19:39:34 2007 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * encoding.c (rb_locale_encoding): should check return value from
- rb_locale_charmap().
-
- * ruby.c (locale_encoding): removed.
-
- * ruby.c (process_options): use rb_locale_encoding() instead of
- locale_encoding().
-
- * ext/readline/readline.c (readline_readline): use locale encoding
- instead of input IO's encoding. [ruby-dev:32872]
-
-Fri Dec 28 19:29:07 2007 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * ext/readline/readline.c (readline_readline, readline_s_set_input):
- use mReadline directly because self is not always same.
-
-Fri Dec 28 19:11:28 2007 Tanaka Akira <akr@fsij.org>
-
- * encoding.c (rb_locale_encoding): defined.
-
- * include/ruby/encoding.h (rb_locale_encoding): declared.
-
-Fri Dec 28 18:45:29 2007 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * ext/readline/readline.c (readline_readline): set encoding to result.
-
- * ext/readline/readline.c (readline_s_set_input, Init_readline): save
- input IO to hidden instance variable.
-
-Fri Dec 28 01:55:04 2007 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * transcode.c (transcode_dispatch): reverted some of the changes
- in r14746.
-
- * transcode.c, enc/trans/single_byte.c: Added conversions to/from
- US-ASCII and ASCII-8BIT (using data tables).
-
- * enc/trans/single_byte.c: Some spacing/ordering changes due to
- automatic data file generation.
-
- * transcode_data.h, transcode.c: Preliminary code for using
- micro-conversion functions.
-
- * test/ruby/test_transcode.rb: Added some tests for US-ASCII and
- ASCII-8BIT conversions.
-
-Fri Dec 28 17:33:44 2007 Tanaka Akira <akr@fsij.org>
-
- * time.c (make_time_t): verify mktime and timegm result.
-
Fri Dec 28 16:36:33 2007 NARUSE, Yui <naruse@airemix.com>
- * lib/resolv.rb (Resolv::DNS#each_address): now returns IPv6 address.
-
-Fri Dec 28 16:10:00 2007 Eric Hodel <drbrain@segment7.net>
-
- * lib/rdoc/dot/dot.rb: Move to lib/rdoc/dot.rb. Fix namespacing.
-
- * lib/rdoc/diagram.rb: Update for 1.9.
-
-Fri Dec 28 15:38:29 2007 Eric Hodel <drbrain@segment7.net>
-
- * lib/rdoc/markup/sample/: Move to sample/rdoc/markup directory.
-
-Fri Dec 28 15:15:12 2007 Akinori MUSHA <knu@iDaemons.org>
-
- * lib/irb/completion.rb: Remove garbage ("X=1").
-
-Fri Dec 28 15:12:05 2007 Eric Hodel <drbrain@segment7.net>
-
- * lib/rdoc, test/rdoc: Move RDoc tests out of lib/.
+ * lib/resolv.rb (Resolv::DNS#each_address): now returns IPv6 address.
-Fri Dec 28 15:10:47 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Dec 28 13:21:32 2007 Kouhei Sutou <kou@cozmixng.org>
- * encoding.c (set_base_encoding, enc_base_encoding): renamed
- based_encoding as base_encoding.
-
-Fri Dec 28 13:57:49 2007 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * golf_prelude.rb (Integer#each): use alias simply.
-
-Fri Dec 28 13:45:21 2007 Akinori MUSHA <knu@iDaemons.org>
-
- * golf_prelude.rb (Object.const_missing): No need to delegate to
- superclass. Just raise a NameError when none matches.
-
-Fri Dec 28 13:18:47 2007 Kouhei Sutou <kou@cozmixng.org>
-
- * lib/rss/rss.rb, test/rss/test_version.rb: 0.2.2 -> 0.2.3.
+ * lib/rss/rss.rb, test/rss/test_version.rb, NEWS: 0.2.2 -> 0.2.3.
* lib/rss/parser.rb, test/rss/test_parser.rb: supported "-" in tag name.
Reported by Ray Chen. Thanks.
-Fri Dec 28 13:07:31 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * gc.c (os_obj_of): returns an enumerator if no block given. based on
- a patch from Yugui <yugui AT yugui.sakura.ne.jp>. [ruby-dev:32828]
-
-Fri Dec 28 11:46:04 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * tool/ytab.sed: skip yydestruct hack unless yymsg exists, for bison
- 1.8 series. [ruby-dev:32825]
-
-Fri Dec 28 11:39:02 2007 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * golf_prelude.rb (Object.quine): need to join because SCRIPT_LINES__[]
- returns an array of lines.
-
-Fri Dec 28 11:16:53 2007 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * golf_prelude.rb (Object.quine): get the script itself.
-
-Fri Dec 28 10:06:54 2007 Akinori MUSHA <knu@iDaemons.org>
-
- * golf_prelude.rb (Object.const_missing): Auto-complete constants.
-
-Fri Dec 28 01:55:04 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * transcode.c (transcode_dispatch): allows transcoding from/to
- ASCII-8BIT.
-
-Fri Dec 28 01:47:25 2007 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * golf_prelude.rb (Integer): Integer is now enumerable on goruby.
-
-Fri Dec 28 01:27:47 2007 Tanaka Akira <akr@fsij.org>
-
- * lib/rdoc/rdoc.rb (parse_files): don't depend on the default external
- encoding.
-
-Fri Dec 28 00:01:57 2007 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * common.mk (golf_prelude.c): use MINIRUBY instead of BASERUBY because
- tool/compile_prelude.rb requires rbconfig.rb.
-
Thu Dec 27 23:56:01 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* mkconfig.rb: should not use the libraries under the source directory
at cross compiling.
-Thu Dec 27 23:43:35 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * cygwin/GNUmakefile.in (EXTOBJS): uses ruby.rc always for other than
- rubyw.exe.
-
-Thu Dec 27 22:31:37 2007 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * lib/rubygems/commands/update_command.rb (do_rubygems_update): use
- portable and safely ENV operation. reported in
- <http://slashdot.jp/developers/comments.pl?sid=384937&cid=1273085>.
-
-Thu Dec 27 21:47:04 2007 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * mkconfig.rb (prefix): archdir is "1.9.0", not "1.9". reported in
- <http://slashdot.jp/developers/comments.pl?sid=384937&cid=1273085>.
-
-Thu Dec 27 17:57:30 2007 Tanaka Akira <akr@fsij.org>
-
- * parse.y, transcode_data.h, transcode.c, lib/weakref.rb,
- lib/irb/ruby-lex.rb, lib/irb/lc/error.rb, enc/trans/japanese.c:
- change "illegal" to "invalid" in a context which doesn't against
- a law.
-
-Thu Dec 27 16:37:06 2007 Tanaka Akira <akr@fsij.org>
-
- * re.c (rb_reg_s_union): show encodings in error message.
-
-Thu Dec 27 15:25:16 2007 Tanaka Akira <akr@fsij.org>
-
- * encoding.c (rb_enc_codelen): show codepoint in error message.
-
- * include/ruby/encoding.h (rb_enc_codelen): comment it returns
- positive integer.
-
- * string.c (rb_str_concat): rb_enc_codelen doesn't return 0.
-
-Thu Dec 27 15:18:44 2007 Tanaka Akira <akr@fsij.org>
-
- * encoding.c (rb_enc_codelen): error message refined.
-
-Thu Dec 27 15:11:27 2007 Tanaka Akira <akr@fsij.org>
-
- * encoding.c (rb_enc_check): show encodings in error message.
+Thu Dec 27 11:02:45 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Dec 27 15:02:52 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * intern.h, string.c (rb_str_set_len): added for upgrading path from
+ 1.8 to 1.9. [ruby-dev:32807]
- * string.c (rb_str_casecmp): fixed using a wrong variable.
- [ruby-list:44402]
+ * string.c (rb_str_lines, rb_str_bytes): ditto.
-Thu Dec 27 14:34:38 2007 Tanaka Akira <akr@fsij.org>
+Thu Dec 27 10:47:32 2007 Technorama Ltd. <oss-ruby@technorama.net>
- * io.c (io_fflush): checks wbuf modification by other threads.
- not perfect. it need locks.
-
-Thu Dec 27 10:44:03 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * ext/socket/socket.c: a patch to support IRIX from Andrew
- Thompson <andrew@hijacked.us> in [ruby-core:14447].
-
-Thu Dec 27 02:25:45 2007 NAKAMURA Usaku <usa@ruby-lang.org>
+ * ext/openssl/ossl_ssl.c: Only show a warning if the default
+ DH callback is actually used.
- * lib/mkmf.rb (create_tmpsrc): retry to create file if Errno::EACCES
- occurs. this is a workaround for mswin32.
+ * ext/openssl/ossl_rand.c: New method: random_add().
-Wed Dec 26 22:47:31 2007 NARUSE, Yui <naruse@ruby-lang.org>
+Wed Dec 26 22:27:45 2007 NARUSE, Yui <naruse@ruby-lang.org>
* lib/resolv.rb (Resolv::DNS::Name.==): fix for other is array of
Resolv::DNS::Label::Str.
@@ -30053,2260 +3089,58 @@ Wed Dec 26 22:47:31 2007 NARUSE, Yui <naruse@ruby-lang.org>
is not defined, so replace to_s.
* lib/resolv.rb (Resolv::IPv6#to_name): ip6.int is obsoleted by
- ip6.arpa.
-
-
-Wed Dec 26 21:27:02 2007 Tadayoshi Funaba <tadf@dotrb.org>
-
- * lib/date/format.rb (_xmlschema): some improvements.
-
- * lib/date/format.rb (_parse): a new hint compfunc. [experimental]
-
-Wed Dec 26 17:31:08 2007 Tanaka Akira <akr@fsij.org>
-
- * io.c (io_fflush): check closed fptr after rb_write_internal to avoid
- SEGV on MacOS X.
-
-Wed Dec 26 16:10:17 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * string.c (Init_String): defines chars method.
-
-Wed Dec 26 14:38:43 2007 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * instruby.rb: install goruby if exists.
-
-Wed Dec 26 13:55:02 2007 James Edward Gray II <jeg2@ruby-lang.org>
-
- * lib/csv.rb: Cleaned up some code with Ruby 1.9 idioms.
-
-Wed Dec 26 13:29:35 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * array.c (tmpbuf): use rb_str_tmp_new().
-
-Wed Dec 26 00:57:53 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/json/ext/generator/generator.c (Init_generator): requires
- json/common.rb for GeneratorError, when static linked. a patch from
- Kenta Murata <muraken AT gmail.com> in [ruby-dev:32789].
-
-Tue Dec 25 23:33:55 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * development version 1.9.0 released.
-
-Tue Dec 25 23:25:29 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/rexml/node.rb (REXML::Node::indent): should initialize rv
- variable. a patch from Tadayoshi Funaba <tadf AT dotrb.org> in
- [ruby-dev:32783].
-
-Tue Dec 25 23:16:01 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ruby.c (proc_options): encoding option in shebang and RUBYOPT did not
- work, do not store alloca()ed string in a parent scope struct.
-
-Tue Dec 25 22:56:52 2007 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/Makefile.sub (config.status): keep this file.
-
-Tue Dec 25 22:55:42 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in (TIMEZONE_VOID): typo.
-
-Tue Dec 25 22:45:10 2007 Koichi Sasada <ko1@atdot.net>
-
- * insns2vm.rb: add encoding option to shebang.
-
-Tue Dec 25 22:13:51 2007 Koichi Sasada <ko1@atdot.net>
-
- * bootstraptest/pending.rb: add pending issue.
-
-Tue Dec 25 22:12:40 2007 Koichi Sasada <ko1@atdot.net>
-
- * thread.c: remove Thread.critical(=).
-
-Tue Dec 25 21:44:50 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * tool/make-snapshot: add version number.
-
-Tue Dec 25 21:32:54 2007 Koichi Sasada <ko1@atdot.net>
-
- * compile.c (iseq_compile_each): fix stack consistency error
- (break is compiled to throw instead of jump insn).
- these problems are reported by Yusuke ENDOH <mame AT tsg.ne.jp>
-
- * bootstraptest/test_knownbug.rb, test_syntax.rb: move fixed test.
-
-Tue Dec 25 21:32:44 2007 Tanaka Akira <akr@fsij.org>
-
- * parse.y (struct parser_params): make parser_ruby_sourcefile common
- field. it is used by node_newnode.
- new field parser_ruby_sourcefile_string for ripper.
- (parser_initialize): initialize parser_ruby_sourcefile in ripper.
- (ripper_initialize): initialize parser_ruby_sourcefile_string.
-
-Tue Dec 25 21:26:09 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * common.mk (parse.c): depends on tool/ytab.sed.
-
- * tool/ytab.sed: hack for bison 2.1.
-
-Tue Dec 25 20:24:58 2007 Technorama Ltd. <oss-ruby@technorama.net>
-
- * ext/openssl/ossl_ssl.c: Only show a warning if the default
- DH callback is actually used.
-
- * ext/openssl/ossl_rand.c: New method: random_add().
-
-Tue Dec 25 20:24:48 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * tool/make-snapshot: argument check, and cleanup exported directory.
-
-Tue Dec 25 20:07:13 2007 WATANABE Hirofumi <eban@ruby-lang.org>
-
- * tool/make-snapshot: more portable.
-
-Tue Dec 25 19:01:04 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * encoding.h (rb_enc_mbc_to_codepoint): wrapper for
- ONIGENC_MBC_TO_CODE().
-
- * string.c (rb_str_succ): deal with invalid sequence as binary.
-
-Tue Dec 25 18:40:46 2007 Koichi Sasada <ko1@atdot.net>
-
- * iseq.c: all methods need $SAFE < 1.
-
- vm.c: comment out debug functions.
-
-Tue Dec 25 18:37:42 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * io.c (appendline): move RS comparison to rb_io_getline_1().
-
-Tue Dec 25 18:27:51 2007 Tanaka Akira <akr@fsij.org>
-
- * string.c (rb_str_each_line): don't call rb_enc_codepoint with empty
- string.
-
-Tue Dec 25 18:06:04 2007 Tanaka Akira <akr@fsij.org>
-
- * string.c (rb_str_inspect): don't call rb_enc_codepoint with empty
- string. fix '#'.inspect.
-
- * encoding.c (rb_enc_codepoint): raise on empty string.
-
-Tue Dec 25 17:48:28 2007 Shugo Maeda <shugo@ruby-lang.org>
-
- * vm.c (rb_frame_method_id_and_class): new function to get the
- method id and class of the current frame.
-
-Tue Dec 25 17:32:04 2007 Akinori MUSHA <knu@iDaemons.org>
-
- * lib/mkmf.rb (create_makefile): Add a missing dependency on the
- target directory for each .rb file. This will hopefully fix
- parallel make (-jN). Tested on FreeBSD.
-
-Tue Dec 25 16:51:07 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * enc/trans/japanese.c (rb_{from,to}_{SHIFT_JIS,EUC_JP}): inversed
- from_encoding and to_encoding.
-
-Tue Dec 25 16:41:57 2007 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * golf_prelude.rb (h): add new method for all golfers.
-
-Tue Dec 25 16:37:12 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * enc/trans/japanese.c (rb_to_EUC_JP): fixed typo.
-
-Tue Dec 25 16:34:58 2007 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * ext/dl/depend: add dependencies. [ruby-dev:32760]
-
-Tue Dec 25 16:26:48 2007 Koichi Sasada <ko1@atdot.net>
-
- * include/ruby/ruby.h, thread.c: rename is_ruby_native_thread() to
- ruby_native_thread_p().
-
- * ext/tk/tcltklib.c: apply it.
-
-Tue Dec 25 16:15:15 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * common.mk (clean-enc): clean encoding objects.
-
-Tue Dec 25 16:04:28 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * common.mk, goruby.c, golf_prelude.rb: for golfers.
-
- * main.c (main): hook for embedding applications.
-
- * tool/compile_prelude.rb: can change initialize function name.
-
-Tue Dec 25 15:59:51 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * encoding.c (rb_enc_register): do not use based_encoding to check if
- dummy encoding.
-
-Tue Dec 25 15:55:14 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * string.c (rb_str_succ): fix for string with non-alphanumeric chars.
-
-Tue Dec 25 15:42:49 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * io.c (rb_io_external_encoding): should return nil for
- pass-through write IO. [ruby-dev:32740]
+ int.arpa.
-Tue Dec 25 15:24:57 2007 Tanaka Akira <akr@fsij.org>
+Mon Dec 24 16:18:57 2007 Eric Hodel <drbrain@segment7.net>
- * io.c (appendline): initialize rslen to 1 if rsptr is 0.
- rslen is the length of the delimiter.
- if only delim is given, it should be 1.
- [ruby-dev:32746]
+ * lib/rdoc/ri/ri_options.rb: Fix ri --help listing of gem ri paths.
+ Merge of r14567 and r14569 from trunk.
-Tue Dec 25 15:21:33 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * transcode.c (transcode_dispatch): fix for multistep transcode.
-
-Tue Dec 25 15:07:51 2007 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * enc/trans/single_byte.c (Init_single_byte): renamed.
-
-Tue Dec 25 15:00:33 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * enum.c (enum_yield): when multiple values yielded from #each
- pack them into an array. [ruby-dev:32708]
-
- * enum.c: all method but all?, any?, one? and none? passed packed
- multiple values to the block.
-
- * enum.c (collect_all): should pack all values. [ruby-core:14410]
-
-Tue Dec 25 14:57:00 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * common.mk (COMMONOBJS): transcode_data_*.c moved under enc/trans.
-
- * transcode_data.h (rb_transcoding, rb_transcoder): prefixed.
-
- * transcode.c (rb_register_transcoder, rb_declare_transcoder): split
- declaration and registration. [ruby-dev:32704]
-
- * transcode.c (transcode_dispatch): autoload pre-declared transcoder.
-
- * transcode.c (str_transcode): use rb_define_dummy_encoding().
-
- * transcode.c (Init_transcode): initialize transcoder tables.
-
- * enc/trans/single_byte.c, enc/trans/japanese.c: moved from top.
-
-Tue Dec 25 14:20:13 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/mkmf.rb (map_dir): should generate path including $top_srcdir.
-
-Tue Dec 25 14:09:16 2007 James Edward Gray II <jeg2@ruby-lang.org>
-
- * lib/csv.rb: Fixed test failures caused by changes to Ruby.
-
- * test/csv/tc_serialization, test/csv/tc_csv_parsing, test/csv/tc_features:
- Fixed test failures caused by changes to Ruby.
-
-Tue Dec 25 14:11:57 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * io.c (io_encoding_set): missing return type.
-
-Tue Dec 25 14:03:48 2007 NARUSE, Yui <naruse@ruby-lang.org>
-
- * test/rinda/test_rinda.rb (MockClock#{_forward, forward, sleep}):
- Change default value of n as @reso from nil. If default value is
- nil, n.+ is not defined.
-
-Tue Dec 25 13:54:01 2007 Tanaka Akira <akr@fsij.org>
-
- * test/ruby/test_io_m17n.rb (test_pipe): fixed.
- [ruby-dev:32743]
-
-Tue Dec 25 13:44:51 2007 Koichi Sasada <ko1@atdot.net>
-
- * thread.c (rb_thread_wait_fd_rw): should check EBADF on select().
-
-Tue Dec 25 13:30:03 2007 Koichi Sasada <ko1@atdot.net>
-
- * thread_pthread.c, thread_pthread.h, thread_win32.c,
- thread_win32.c: make some functions static functions.
- a patch from Tadashi Saito <shiba AT mail2.accsnet.ne.jp>
- in [ruby-core:14407]
-
-Tue Dec 25 13:23:13 2007 Tanaka Akira <akr@fsij.org>
-
- * test/ruby/test_io_m17n.rb (test_write_noenc): don't mix text and
- binary mode. [ruby-dev:32743]
-
-Tue Dec 25 13:13:09 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * README.EXT.ja, dir.c, eval.c, eval_intern.h, lex.c.src,
- lex.c.blt, keywords, load.c, thread.c: more ANSI'ize.
- a patch from Tadashi Saito <shiba AT mail2.accsnet.ne.jp>
- in [ruby-dev:32725]
-
-Tue Dec 25 13:07:56 2007 Koichi Sasada <ko1@atdot.net>
-
- * vm_core.h, thread.c, cont.c: add RUBY_VM_SET_INTERRUPT(),
- RUBY_VM_SET_TIMER_INTERRUPT(), RUBY_VM_INTERRUPTED().
-
- * thread.c, thread_pthread.c, thread_win32.c: fix to ignore time slice
- event until sleep.
-
- * bootstraptest/test_thread.rb: add a test for time limited join test.
-
-Tue Dec 25 12:42:59 2007 Koichi Sasada <ko1@atdot.net>
-
- * vm.c (Init_VM): remove unused code.
- [ruby-dev:32732]
-
-Tue Dec 25 12:32:32 2007 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * transcode.c: Moving a static counter from inside register_transcoder()
- and register_functional_transcoder() to outside the functions, renaming
- from n to next_transcoder_position. Fixes 3) in [ruby-dev:32715].
-
-Tue Dec 25 12:22:17 2007 NARUSE, Yui <naruse@ruby-lang.org>
-
- * sample/from.rb: follow Ruby 1.9 libraries.
-
-Tue Dec 25 12:21:56 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * proc.c (method_inspect): preserve encoding of the method name.
-
-Tue Dec 25 12:07:52 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in (BASERUBY): delayed error until BASERUBY is used.
-
-Tue Dec 25 11:48:35 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * sample/README: removed obsoleted files: dbmtest.rb,
- getopts.test, mrshtest.rb, regx.rb.
-
-Tue Dec 25 11:45:34 2007 James Edward Gray II <jeg2@ruby-lang.org>
-
- * lib/csv.rb: Import the FasterCSV source as the new CSV class.
-
- * test/csv/*: Added all applicable tests from FasterCSV.
-
-Tue Dec 25 11:33:52 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * error.c (report_bug): uses ruby_description.
-
-Tue Dec 25 11:20:38 2007 Koichi Sasada <ko1@atdot.net>
-
- * compile.c (iseq_compile_each): fix stack consistency error.
- a patch from Yusuke ENDOH <mame AT tsg.ne.jp> [ruby-dev:32720]
-
- * bootstraptest/test_syntax.rb: add 2 tests for above.
-
-Tue Dec 25 11:14:20 2007 Koichi Sasada <ko1@atdot.net>
-
- * iseq.c, vm_core.h: comment out unused fields.
-
-Tue Dec 25 11:02:10 2007 Koichi Sasada <ko1@atdot.net>
-
- * vm.c: check frame is FINAL when creating env.
- [ruby-core:14395]
-
- * bootstraptest/test_block.rb: add a test for above.
-
-Tue Dec 25 09:12:13 2007 Eric Hodel <drbrain@segment7.net>
-
- * lib/rdoc/: Enable RDoc debugging only with $DEBUG_RDOC.
-
-Tue Dec 25 08:37:43 2007 James Edward Gray II <jeg2@ruby-lang.org>
-
- * lib/csv.rb, test/csv/test_csv.rb: Removed in preparation for
- FasterCSV code import.
-
-Tue Dec 25 08:27:43 2007 Eric Hodel <drbrain@segment7.net>
-
- * lib/rubygems.rb: Fix test failures.
-
- * test/rubygems/test_gem.rb: Fix test failure.
-
-Tue Dec 25 06:23:40 2007 Koichi Sasada <ko1@atdot.net>
-
- * bootstraptest/test_knownbug.rb, test_literal.rb: move fixed test.
-
-Tue Dec 25 06:19:04 2007 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * sample/biorhythm.rb: follow Ruby 1.9 libraries.
-
-Tue Dec 25 06:15:01 2007 Koichi Sasada <ko1@atdot.net>
-
- * vm.c: add dummy toplevel frame.
-
-Tue Dec 25 05:44:56 2007 Eric Hodel <drbrain@segment7.net>
-
- * lib/net/http.rb: Fix uninitialized variable warning.
- [ruby-talk:284582]
-
- * lib/irb/output-method.rb: Remove unused #foo method.
- [ruby-talk:284582]
-
-Tue Dec 25 05:24:12 2007 Koichi Sasada <ko1@atdot.net>
-
- * compile.c (iseq_compile): clear local table if node == 0.
- a patch from Yusuke ENDOH <mame AT tsg.ne.jp> [ruby-dev:32530]
-
- * vm.c: clear VM stack.
-
-Tue Dec 25 04:23:32 2007 Tanaka Akira <akr@fsij.org>
-
- * parse.y (rb_id2str): fill klass of returned string as rb_cString.
- some strings are allocated before rb_cString is created.
- This prevents a "called on terminated object" error by
- ObjectSpace.each_object(Module) {|m| p m.name }.
-
-Tue Dec 25 03:51:55 2007 Koichi Sasada <ko1@atdot.net>
-
- * compile.c (iseq_compile_each): fix stack consistency bug.
- a patch from Yusuke ENDOH <mame AT tsg.ne.jp>
-
-Tue Dec 25 03:19:47 2007 WATANABE Hirofumi <eban@ruby-lang.org>
-
- * tool/make-snapshot: must create configure and lex.c.
-
-Tue Dec 25 03:16:05 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * io.c (rb_io_s_pipe): now takes up to two arguments. allow its
- external/internal encoding by Encoding objects.
-
- * io.c (rb_io_set_encoding): new method to set encoding of the IO.
-
- * io.c (argf_set_encoding): ditto.
-
-Tue Dec 25 03:08:53 2007 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * pack.c (pack_pack): use NUM2LONG instead of NUM2INT.
-
- * numeric.c (fix_lshift, fix_aref): use SIZEOF_LONG instead of
- SIZEOF_VALUE.
-
- * bignum.c (big2ulong, rb_big_aref): ditto.
-
-Tue Dec 25 02:55:26 2007 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * lib/rexml/element.rb (REXML::Elements#each): yield in each
- should be called with one parameter. [ruby-dev:32708]
-
-Tue Dec 25 02:15:39 2007 Koichi Sasada <ko1@atdot.net>
-
- * compile.c (iseq_compile_each): add a "pop" insn after break
- to fix stack consistency error. [ruby-core:14385]
-
- * bootstraptest/test_syntax.rb: add tests for above.
-
- * bootstraptest/test_knownbug.rb: remove fixed bug.
-
-Tue Dec 25 01:54:36 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * id.c (Init_id): remove several unused symbols. [ruby-core:14362]
-
- * compile.c (iseq_specialized_instruction): do not use
- VM_CALL_SEND_BANG flag any longer.
-
-Tue Dec 25 01:42:41 2007 Tanaka Akira <akr@fsij.org>
-
- * lib/rdoc/rdoc.rb (parse_files): interpret coding cookie.
-
-Tue Dec 25 01:38:04 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * proc.c (method_name): preserve Symbol's encoding.
-
- * numeric.c (fix_id2name): ditto.
-
-Tue Dec 25 01:19:18 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * include/ruby/encoding.h (rb_enc_left_char_head): new utility macro.
-
- * include/ruby/encoding.h (rb_enc_right_char_head): ditto.
-
- * io.c (appendline): does multibyte RS search in the function.
-
- * io.c (prepare_getline_args): RS may be nil.
-
- * io.c (rb_io_getc): should process character based on external
- encoding, when transcoding required.
-
-Tue Dec 25 01:07:57 2007 Tanaka Akira <akr@fsij.org>
-
- * lib/irb/output-method.rb: translate a comment to English to
- avoid mix of EUC-JP comment and UTF-8 Date keyword.
- svn substitute Date keyword with UTF-8 weekday on UTF-8 locale.
-
-Tue Dec 25 00:27:28 2007 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * lib/webrick/httpservley/cgihandler.rb
- (WEBrick::HTTPServlet::CGIHandler#do_GET): m17nized.
-
-Mon Dec 24 23:55:29 2007 Tanaka Akira <akr@fsij.org>
-
- * lib/cgi.rb (CGI::escape): m17nized.
- (CGI::unescape): ditto.
- (CGI::escapeHTML): ditto.
- (CGI::unescapeHTML): ditto.
-
-Mon Dec 24 23:32:24 2007 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * transcode_data_japanese.c (select_iso_2022_mode): '\e' is not valid.
-
-Mon Dec 24 23:13:09 2007 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * lib/rdoc/diagram.rb (RDoc::Diagram#initialize): use fileuitls
- instead of ftools.
-
-Mon Dec 24 23:04:57 2007 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
-
- * lib/ftools.rb: removed obsoleted lib. use fileutils instead (by eban).
-
- * lib/rdoc/rdoc.rb, lib/rdoc/generators/*, lib/rake.rb: let it use
- fileutils instead of ftools.
-
- * lib/shell/command-processor.rb: removed unused references to ftools.
-
- * lib/parsedate.rb: removed. see [ruby-core:12535], [ruby-dev:31969].
-
- * lib/README: updated.
-
-Mon Dec 24 23:01:04 2007 Tanaka Akira <akr@fsij.org>
-
- * lib/open-uri.rb (OpenURI::Buffer): use Meta ===. [ruby-core:14295]
-
-Mon Dec 24 22:46:42 2007 NARUSE, Yui <naruse@ruby-lang.org>
-
- * transcode.c: register_functional_transcoder() added.
- (init_transcoder_table(: register ISO-2022-JP.
- (str_transcode): add preprocessor and postprocessor.
-
- * transcode_data_japanese.c: add ISO-2022-JP support.
-
- * transcode_data.h: moved transcoder and transcoding definition from
- transcode.c.
-
-Mon Dec 24 20:29:28 2007 Koichi Sasada <ko1@atdot.net>
-
- * test/io/nonblock/test_flush.rb: fix test for 1.9.
-
-Mon Dec 24 20:23:44 2007 Koichi Sasada <ko1@atdot.net>
-
- * test/rinda/test_rinda.rb: revert last commit because this test seems
- to have timing problem to halt all tests.
-
-Mon Dec 24 20:18:52 2007 Koichi Sasada <ko1@atdot.net>
-
- * test/rinda/test_rinda.rb: enable rinda test.
-
-Mon Dec 24 20:16:54 2007 Koichi Sasada <ko1@atdot.net>
-
- * instruby.rb: fix rdoc install dir.
-
-Mon Dec 24 18:37:32 2007 Tanaka Akira <akr@fsij.org>
-
- * re.c (rb_reg_prepare_re): show regexp encoding in the error message.
-
-Mon Dec 24 18:23:32 2007 Tanaka Akira <akr@fsij.org>
-
- * eval.c (rb_exc_raise): ANSI style.
- (rb_exc_fatal): ditto.
- (rb_raise_jump): ditto.
- (rb_jump_tag): ditto.
- (rb_block_given_p): ditto.
-
- * variable.c (original_module): ditto.
-
-Mon Dec 24 18:05:09 2007 Koichi Sasada <ko1@atdot.net>
-
- * iseq.c (Init_ISeq): disable ISeq.load() because there is no verifier.
-
- * iseq.c, proc.c: add ISeq.disasm(method).
-
-Mon Dec 24 18:06:03 2007 Tanaka Akira <akr@fsij.org>
-
- * eval_method.c (Init_eval_method): extracted from Init_eval
- for rdoc to find rb_mod_remove_method, rb_mod_undef_method and
- rb_mod_alias_method.
-
- * eval.c (Init_eval): call Init_eval_method.
-
-Mon Dec 24 17:59:29 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * load.c (load_lock): reverted.
-
- * thread.c (rb_barrier_wait): check for recursive wait.
-
-Mon Dec 24 17:50:54 2007 Tanaka Akira <akr@fsij.org>
-
- * eval.c (function_call_may_return_twice_jmp_buf): removed.
- (function_call_may_return_twice_false): removed.
- [ruby-core:14335]
-
-Mon Dec 24 17:40:57 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * common.mk (node_name.inc, miniprelude.c, prelude.c): nmake cannot
- handle target vpath in other than implicit rules.
-
-Mon Dec 24 17:20:34 2007 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
-
- * lib/{mailread.rb,getopts.rb,parsearg.rb}: removed.
- see [ruby-core:12535], [ruby-dev:31969].
-
-Mon Dec 24 17:12:57 2007 Tanaka Akira <akr@fsij.org>
-
- * include/ruby/intern.h, random.c, array.c:
- change exported name.
- genrand_int32 -> rb_genrand_int32.
- genrand_real -> rb_genrand_real.
- [ruby-core:14335]
-
-Mon Dec 24 17:06:37 2007 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
-
- * {lib,test}/{soap,wsdl,xsd}: removed soap4r along to the discussion
- at ruby-core and ruby-dev. see [ruby-core:12535], [ruby-dev:31969].
-
-Mon Dec 24 17:06:14 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * load.c (rb_feature_p): returns loading path name too.
-
- * load.c (search_required): returns path too if feature is being
- loaded. [ruby-dev:32048] [TODO: refactoring]
-
-Mon Dec 24 16:29:12 2007 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * sample/openssl: reviewed and remove dependency on getopts.rb.
-
-Mon Dec 24 16:18:57 2007 Koichi Sasada <ko1@atdot.net>
-
- * mkconfig.rb: add teeny to CONFIG['ruby_version'].
-
-Mon Dec 24 15:55:50 2007 Koichi Sasada <ko1@atdot.net>
-
- * tool/compile.rb, getrev.rb, runruby.rb: remove unused tools.
-
-Mon Dec 24 15:42:04 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in, cygwin/GNUmakefile.in, */Makefile.sub,
- djgpp/config.hin.: version dependent directory names now contain
- teeny.
-
-Mon Dec 24 15:29:13 2007 Tanaka Akira <akr@fsij.org>
-
- * tool/serb.rb: removed.
-
-Mon Dec 24 13:55:35 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * proc.c (rb_proc_new), vm.c (invoke_block): removed u3.state magic.
- [ruby-core:14310]
-
- * test/ruby/test_symbol.rb (test_to_proc): a test from Frederick
- Cheung <frederick.cheung AT gmail.com>.
-
-Mon Dec 24 13:43:36 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * thread.c (rb_thread_atfork): should not leave living_threads
- referring freed table while allocating new table.
-
-Mon Dec 24 12:49:54 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * Makefile.in, configure.in, lib/mkmf.rb, */Makefile.sub: specify
- compiled output file name explicitly.
-
- * enc/Makefile.in, enc/depend: now makes compiler to put generated
- files under directories corresponding to the each source.
- enc/trans supported.
-
- * enc/make_encmake.rb: evaluates depend file before Makefile.in so
- that the former can influence to CONFIG.
+ * lib/rdoc/ri/ri_paths.rb: Fix duplication of ri data for multiple
+ gems. Merge of r14567 from trunk
Mon Dec 24 12:35:03 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* win{32,ce}/Makefile.sub (MFLAGS): defaulted to -l.
-Mon Dec 24 12:08:10 2007 Eric Hodel <drbrain@segment7.net>
-
- * /, ext/: Add svn:ignore for OS X Xcode 3's conftest.dSYM
- directories.
-
Mon Dec 24 11:56:31 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * common.mk: should not pass MAKEFLAGS to recursive make.
- + normal make: MFLAGS are set and command line options and macros
- are all passed silently.
- + GNU make: ditto, and all options and macros in MAKEFLAGS are in
- effect.
- + nmake: MFLAGS is not set and MAKEFLAGS has only options without
- hyphen, no macros exist in any variables.
- + Borland make: ditto, and command line macros cannot override
- macros in makefile, so passing them is vain.
-
* {bcc32,win{32,ce}}/Makefile.sub (SET_MAKE): set MFLAGS which is not
set by default, to get rid of chaotic situation of MFLAGS/MAKEFLAGS.
-Mon Dec 24 11:32:44 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * string.c (rb_str_comparable): fixed to keep transitivity.
- [ruby-dev:32693]
-
-Mon Dec 24 11:20:31 2007 Eric Hodel <drbrain@segment7.net>
-
- * lib/rdoc/ri/ri_options.rb: Fix display of GEMDIRS, make command
- examples match ri's name.
-
- * lib/rdoc/ri/ri_paths.rb: Only allow latest ri dirs in ri output.
-
-Mon Dec 24 10:49:04 2007 Eric Hodel <drbrain@segment7.net>
-
- * lib/uri/mailto.rb, lib/uri/common.rb: Fix Regexp warnings. Patch
- #16524 from Kornelius Kalnbach, [ruby-core:14302].
-
-Mon Dec 24 10:37:38 2007 Eric Hodel <drbrain@segment7.net>
-
- * gem_prelude.rb: Remove methods from Gem, not QuickLoader, to fix
- warnings.
-
-Mon Dec 24 09:45:45 2007 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * transcode.c, transcode_data_one_byte.c, transcode_data_japanese.c:
- added rb_ prefix to external data symbols.
-
-Mon Dec 24 05:32:22 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * enum.c (enum_inject): updated documentation. a patch from Keita
- Yamaguchi <keita.yamaguchi AT gmail.com> in [ruby-dev:32686].
-
- * README.EXT: updated. a patch from Tadashi Saito
- <shiba AT mail2.accsnet.ne.jp> in [ruby-core:14328].
-
- * array.c (rb_ary_at): updated documentation. a patch from Tadashi
- Saito <shiba AT mail2.accsnet.ne.jp> in [ruby-core:14330].
-
-Mon Dec 24 05:13:04 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * string.c (tr_trans): should associate new encoding if modified.
-
-Mon Dec 24 04:04:12 2007 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * test/net/http/test_https.rb: should rescue LoadError.
-
-Mon Dec 24 03:57:28 2007 Koichi Sasada <ko1@atdot.net>
-
- * cont.c, vm.h: fix to support sparc machine.
- a patch from Yusuke ENDOH <mame AT tsg.ne.jp>
-
-Mon Dec 24 03:35:19 2007 Koichi Sasada <ko1@atdot.net>
-
- * common.mk: remove additional "-".
-
-Mon Dec 24 02:59:32 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * io.c (rb_io_check_readable): should not fill fptr->enc always.
- read-write IO (e.g. socket) does not work. [ruby-dev:32685]
-
- * io.c (io_read_encoding): retrieve reading encoding.
-
- * io.c (prepare_getline_args): convert RS to external encoding.
-
- * string.c (str_new_shared): was setting embedding flag of wrong
- string object. [ruby-dev:32685]
-
- * io.c (io_enc_str): should preserve default_external encoding.
-
- * io.c (appendline): should do multibyte aware RS search.
-
-Mon Dec 24 02:06:35 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * io.c (rb_f_open): documentation update.
-
- * io.c (rb_io_s_pipe): ditto.
-
- * io.c (io_fwrite): wrong encoding destination.
-
- * io.c (rb_io_external_encoding): should return the encoding of
- the file reading.
-
- * io.c (rb_io_internal_encoding): should return the encoding of
- read string.
-
-Mon Dec 24 01:46:43 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * io.c (rb_io_s_pipe): allow specifying read-side encoding.
-
- * io.c (io_enc_str): wrong encoding destination.
-
-Mon Dec 24 01:03:17 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * string.c (rb_str_comparable): comparison including broken
- coderange strings do not consider encoding.
-
-Mon Dec 24 00:57:15 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * io.c (open_key_args): IO direct methods (foreach, readlines,
- read) now takes keyword argument: encoding, mode, open_args.
-
-Mon Dec 24 00:52:15 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * io.c (rb_io_s_read): encoding argument reverted.
-
- * io.c (mode_enc): independent function to share code.
-
- * io.c (rb_io_internal_encoding): new method.
-
-Mon Dec 24 00:47:05 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * test/ruby/test_beginendblock.rb (TestBeginEndBlock::test_endblockwarn):
- rename endblockwarn.rb to endblockwarn_rb to avoid unnecessary
- warning in make test.
-
-Sun Dec 23 23:03:13 2007 Tanaka Akira <akr@fsij.org>
-
- * encoding.c (rb_enc_codepoint): implemented to raise invalid
- encoding.
-
- * include/ruby/encoding.h (rb_enc_codepoint): macro is replaced as a
- declaration.
-
-Sun Dec 23 19:45:22 2007 Tanaka Akira <akr@fsij.org>
-
- * lib/time.rb (Time.httpdate): fix 2 digits year for 20xx.
- reported by Tadayoshi Funaba. [ruby-dev:32687]
-
-Sun Dec 23 19:33:42 2007 Eric Hodel <drbrain@segment7.net>
-
- * lib/open-uri.rb: Fix method redefined warning. [ruby-core:14304]
-
-Sun Dec 23 18:31:49 2007 NARUSE, Yui <naruse@ruby-lang.org>
-
- * ext/nkf/nkf.c (rb_nkf_enc_get): use rb_define_dummy_encoding.
-
- * ext/nkf/nkf.c (Init_nkf): use rb_nkf_enc_get("ASCII").
-
- * ext/nkf/nkf-utf8/nkf.c: Update 1.161.
-
- * ext/nkf/nkf-utf9/config.h: default output encoding is now UTF-8.
-
- * ext/nkf/lib/kconv.rb (Kconv.kconv): replace Encoding#name by
- Encoding#to_s.
-
-Sun Dec 23 18:02:52 2007 Eric Hodel <drbrain@segment7.net>
-
- * lib/rubygems/gem_open_uri.rb: Fix version check.
-
-Sun Dec 23 17:24:48 2007 Tanaka Akira <akr@fsij.org>
-
- * encoding.c (rb_enc_init): add eucJP as an alias of EUC-JP.
-
-Sun Dec 23 17:00:23 2007 Tanaka Akira <akr@fsij.org>
-
- * lib/time.rb (Time.httpdate): use Time.utc for
- "day-of-week, dd-mon-yy HH::MM:SS GMT" format.
-
-Sun Dec 23 16:12:40 2007 Eric Hodel <drbrain@segment7.net>
-
- * lib/rdoc: Fix 1.9 warnings.
-
-Sun Dec 23 15:28:37 2007 Eric Hodel <drbrain@segment7.net>
-
- * lib/rubygems, test/rubygems: Fix new 1.9 warnings.
-
-Sun Dec 23 14:43:10 2007 Eric Hodel <drbrain@segment7.net>
-
- * gem_prelude.rb: Use require to load rubygems.rb so the correct path
- is in $LOADED_FEATURES on RubyGems upgrade.
-
-Sun Dec 23 11:26:43 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * string.c (sym_call): use exact argument array interface.
- [ruby-core:14279]
-
-Sun Dec 23 11:01:35 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * io.c (rb_io_binmode_m): removed C99ism.
-
-Sun Dec 23 10:23:23 2007 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * transcode_data_one_byte.c: Better (and more honest) optimization.
-
- * transcode_data_japanese.c: First optimization step.
-
-Sun Dec 23 09:07:02 2007 Tanaka Akira <akr@fsij.org>
-
- * include/ruby/encoding.h, encoding.c, re.c, io.c, parse.y, numeric.c,
- ruby.c, transcode.c, ext/nkf/nkf.c: rename rb_ascii_encoding to
- rb_ascii8bit_encoding. rb_ascii_encoding is ambiguous with
- ASCII-8BIT and US-ASCII.
-
-Sun Dec 23 03:35:52 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * version.h: use patchlevel if revision is not set.
-
- * {bcc32,win{32,ce}}/setup.mak (-version-): skip including revision.h.
-
- * common.mk (srcs): new target to generated sources.
-
- * common.mk (encs, ext/ripper/ripper.c): MAKEFLAGS needs -.
-
- * enc/depend, enc/make_encmake.rb: use erb.
-
-Sun Dec 23 01:56:18 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * io.c (rb_io_mode_enc): do not set encoding unless explicitly
- specified.
-
- * io.c (rb_io_check_readable): fill fptr->enc by default_external
- if it's empty.
-
- * io.c (io_enc_str): fptr->enc is always set for reading IO (by
- rb_io_check_readable(fptr)).
-
-Sun Dec 23 01:18:06 2007 David Flanagan <david@davidflanagan.com>
-
- * io.c, io.h: temporary patch to partially implement
- transcode-on-read and transcode-on-write
-
-Sun Dec 23 00:48:05 2007 Shugo Maeda <shugo@ruby-lang.org>
-
- * test/net/imap/test_imap.rb: added tests for SSL.
-
-Sat Dec 22 21:10:53 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * ext/syck/rubyext.c (syck_genericresolver_node_import): should
- not set instance variable "@kind" before initializing it.
- [ruby-dev:32677]
-
-Sat Dec 22 19:52:23 2007 Koichi Sasada <ko1@atdot.net>
-
- * bootstraptest/test_objectspace.rb: fix condition.
-
-Sat Dec 22 19:17:10 2007 Koichi Sasada <ko1@atdot.net>
-
- * ext/probeprofiler/: removed.
-
-Sat Dec 22 19:14:38 2007 Koichi Sasada <ko1@atdot.net>
-
- * process.c (rb_f_fork): Unsupport Kernel.fork() on NetBSD.
-
-Sat Dec 22 18:20:13 2007 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * common.mk (version.o): add dependency. [ruby-dev:32680]
-
-Sat Dec 22 17:45:11 2007 NARUSE, Yui <naruse@ruby-lang.org>
-
- * ext/nkf/nkf.c (Init_nkf): use rb_ascii_encoding() for
- rb_nkf_enc_get("US-ASCII").
- * if use rb_nkf_enc_get("US-ASCII"), ruby will crash - this is bug?
-
-Sat Dec 22 17:39:03 2007 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * lib/mkmf.rb ($extmk): fixed broken condition.
-
-Sat Dec 22 17:35:59 2007 NARUSE, Yui <naruse@ruby-lang.org>
-
- * ext/nkf/nkf-utf8.c: Update nkf.c rev:1.157.
-
- * ext/nkf/nkf.c (rb_nkf_enc_get): replicate proper based encoding.
-
- * ext/nkf/kconv.c (Kconv#kconv, to*): use self.encoding as from_enc
- when from_enc isn't given.
-
-Sat Dec 22 17:06:50 2007 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * ext/openssl/lib/net/ssl.rb (OpenSSL::SSL::SSLContext.build): removed.
-
- * ext/openssl/lib/net/ssl.rb (OpenSSL::SSL::SSLContext#set_params):
- new method to set suitable SSL parameters.
-
- * lib/net/pop.rb, lib/net/http.rb, lib/net/imap.rb,
- test/openssl/test_ssl.rb: follow above change.
-
- * test/net/http/test_https.rb: refine error case.
-
-Sat Dec 22 16:58:49 2007 Shugo Maeda <shugo@ruby-lang.org>
-
- * lib/net/imap.rb (encode_utf7): accept UTF-8 strings.
-
- * lib/net/imap.rb (decode_utf7): return UTF-8 strings.
-
-Sat Dec 22 15:56:36 2007 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * transcode_data_japanese: typo.
-
-Sat Dec 22 15:54:54 2007 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * ChangeLog: Information for last patch got lost, fixed
-
- * test/ruby/test_transcode.rb: Added simple tests for
- EUC-JP and Shift_JIS and tests for ASCII-only range
-
-Sat Dec 22 15:45:45 2007 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * transcode_data_one_byte: slightly optimized
-
- * transcode_data_japanese: new data file for EUC-JP and SHIFT_JIS
- (not yet optimized; tests to follow; data from
- http://nkf.sourceforge.jp/ucm/{SJIS|eucJP}-nkf.ucm)
-
- * common.mk, transcode.c: Adjusted for transcode_data_japanese
-
-Sat Dec 22 15:30:13 2007 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * */Makefile.sub (MFLAGS): define unless defined.
-
-Sat Dec 22 15:17:40 2007 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * lib/mkmf.rb ($extmk): set true only when under ext/ or tool/.
-
-Sat Dec 22 15:14:48 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * common.mk (encs, ext/ripper/ripper.c): needs MFLAGS.
-
- * configure.in (STRINGIZE): stringizing macro.
-
- * include/ruby/defines.h (STRINGIZE): fallback.
-
- * tool/make-snapshot: new file.
-
- * version.c (ruby_description, ruby_copyright): string constants for
- -v option.
-
-Sat Dec 22 15:03:37 2007 Shugo Maeda <shugo@ruby-lang.org>
-
- * lib/net/imap.rb (initialize): fixed documentation.
-
-Sat Dec 22 15:01:16 2007 Shugo Maeda <shugo@ruby-lang.org>
-
- * lib/net/pop.rb (enable_ssl): use OpenSSL::SSL::SSLContext.build
- instead of SSLContext.new (default verify mode is now
- OpenSSL::SSL::VERIFY_PEER).
-
-Sat Dec 22 14:45:21 2007 Tadayoshi Funaba <tadf@dotrb.org>
-
- * lib/date.rb: shouldn't freeze nil. [ruby-dev:32677]
-
-Sat Dec 22 14:27:27 2007 Tanaka Akira <akr@fsij.org>
-
- * regenc.c (onigenc_ascii_is_code_ctype): moved from enc/ascii.c.
-
- * regenc.h (onigenc_ascii_is_code_ctype): declared.
-
- * enc/ascii.c: use onigenc_ascii_is_code_ctype.
-
- * enc/us_ascii.c: new file for US-ASCII.
-
-Sat Dec 22 14:30:34 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (reg_named_capture_assign_iter): allows non-ascii names and
- get rid of reserved word IDs.
-
-Sat Dec 22 14:18:45 2007 Koichi Sasada <ko1@atdot.net>
-
- * test/ruby/test_float.rb, test_sprintf.rb: fix test place.
-
-Sat Dec 22 14:17:02 2007 Koichi Sasada <ko1@atdot.net>
-
- * bootstraptest/test_objectspace.rb: skip frozen string.
-
-Sat Dec 22 14:02:58 2007 Koichi Sasada <ko1@atdot.net>
-
- * array.c (rb_ary_permutation): add volatile to avoid GC problem.
-
-Sat Dec 22 11:47:42 2007 Koichi Sasada <ko1@atdot.net>
-
- * eval.c (rb_obj_instance_eval): use class of immediate objects.
-
- * test/ruby/test_eval.rb: fix a test.
-
-Sat Dec 22 11:37:06 2007 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * encoding.c (rb_locale_charmap): win32 support.
-
-Sat Dec 22 11:31:14 2007 Eric Hodel <drbrain@segment7.net>
-
- * gem_prelude.rb: Place bin dir before lib dir so gem bin stubs work.
-
-Sat Dec 22 11:05:44 2007 Jim Weirich <jim@tardis.local>
-
- * lib/rake.rb (Rake): Added Rake and related libraries to the
- source code base.
-
-Sat Dec 22 10:30:45 2007 Koichi Sasada <ko1@atdot.net>
-
- * tool/insns2vm.rb: moved from lib/vm/instruction.rb.
-
-Sat Dec 22 10:25:44 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * parse.y (reg_named_capture_assign_iter): captured name should
- not be reserved word. a patch from Keita Yamaguchi
- <keita.yamaguchi AT gmail.com> in [ruby-dev:32675].
-
- * parse.y (reg_named_capture_assign_iter): just ignore the
- captures that do not have valid local variable name.
-
-Sat Dec 22 10:19:08 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (rb_f_method_name): now __method__ and __callee__ are
- aliases. [ruby-core:14244]
-
-Sat Dec 22 08:29:56 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * string.c (rb_str_buf_append): improvement for non-broken coded
- strings.
-
-Sat Dec 22 06:30:04 2007 Koichi Sasada <ko1@atdot.net>
-
- * bootstraptest/test_fork.rb: skip if fork is not unsupported.
-
- * bootstraptest/test_io.rb: skip if require failed.
-
-Sat Dec 22 06:09:12 2007 David Flanagan <david@davidflanagan.com>
-
- * io.c: fix typo in rdoc comment
-
-Sat Dec 22 05:09:43 2007 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * parse.y (parser_str_new, rb_intern3): rb_default_encoding() renamed.
-
- * ext/nkf/nkf.c (rb_nkf_putchar): ditto.
-
-Sat Dec 22 03:54:18 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * encoding.c (rb_ascii_encoding): renamed from previous
- rb_default_encoding().
-
-Sat Dec 22 02:49:02 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * parse.y (command): block from cmd_brace_block was ignored.
- [ruby-dev:32644]
-
- * re.c (rb_reg_prepare_re): stop ENCODING_NONE warning if the
- encoding of the str is ASCII-8BIT.
-
-Sat Dec 22 01:52:11 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * io.c (io_ungetc): avoid buffer relocation, which might cause
- serious problem under concurrent situation.
-
-Sat Dec 22 01:35:41 2007 Tanaka Akira <akr@fsij.org>
-
- * re.c (ARG_ENCODING_NONE): defined for /.../n option.
- (REG_ENCODING_NONE): ditto.
- (rb_char_to_option_kcode): return ARG_ENCODING_NONE for n.
- (rb_reg_prepare_re): warn /ascii/n =~ "non-ascii".
- (rb_reg_initialize): set REG_ENCODING_NONE from ARG_ENCODING_NONE.
-
-Sat Dec 22 01:23:10 2007 Shugo Maeda <shugo@ruby-lang.org>
-
- * test/json/test_json_addition.rb (test_core): do not use Time.now
- because JSON can't hold nsec.
-
-Sat Dec 22 01:10:30 2007 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * ext/tk/sample/tkextlib/vu/canvSticker2.rb,
- ext/tk/sample/demos-{en,jp}/bind.rb: fix typo. [ruby-dev:32668]
-
-Sat Dec 22 00:56:43 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * sample/test.rb (valid_syntax): force_encoding input script.
-
-Fri Dec 21 23:48:38 2007 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * lib/mkmf.rb (depend_rules): suffixes list broken. fixed.
-
-Fri Dec 21 20:18:15 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * bignum.c (rb_big_mul0): remove unused variable.
-
- * bignum.c (bigdivrem): ditto.
-
-Fri Dec 21 20:13:51 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * include/ruby/ruby.h (rb_catch_obj, rb_throw_obj): prototyped.
-
- * include/ruby/intern.h (rb_fiber_alive_p): prototyped.
-
-Fri Dec 21 20:09:18 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * string.c (rb_str_succ): retry increasing until valid char is found.
-
-Fri Dec 21 20:00:02 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * encoding.c (rb_enc_replicate): now creates first class encoding.
-
- * encoding.c (rb_define_dummy_encoding): always based on the default
- encoding.
-
- * encoding.c (rb_enc_dummy_p): check if dummy.
-
- * encoding.c (enc_inspect): shows if dummy.
-
- * encoding.c (Init_Encoding): added dummy? method
-
- * include/ruby/encoding.h (ENCODING_INLINE_MAX): increased.
-
-Fri Dec 21 18:40:54 2007 Koichi Sasada <ko1@atdot.net>
-
- * io.c: write() should be in blocking region.
-
- * bootstraptest/test_io.rb, test_knownbug.rb: move a fixed test.
-
-Fri Dec 21 17:56:30 2007 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tk/tcltklib.c: provisional support on Ruby-VM.
-
- * ext/tk/MANUAL_tcltklib.eng, ext/tk/MANUAL_tcltklib.eucj:
- modify document about new functions.
-
- * ext/tk/lib/tk.rb, ext/tk/lib/tk/labelframe.rb,
- ext/tk/lib/tk/frame.rb, ext/tk/lib/tk/toplevel.rb,
- ext/tk/lib/tk/scrollbar.rb, ext/tk/lib/tk/message.rb,
- ext/tk/lib/tk/listbox.rb, ext/tk/lib/tk/text.rb,
- ext/tk/lib/tk/scale.rb, ext/tk/lib/tk/entry.rb,
- ext/tk/lib/tk/ttk_selector.rb, ext/tk/lib/tk/menu.rb,
- ext/tk/lib/tk/label.rb, ext/tk/lib/tk/spinbox.rb,
- ext/tk/lib/tk/textmark.rb, ext/tk/lib/tk/winpkg.rb,
- ext/tk/lib/tk/checkbutton.rb, ext/tk/lib/tk/panedwindow.rb,
- ext/tk/lib/tk/texttag.rb, ext/tk/lib/tk/root.rb,
- ext/tk/lib/tk/textimage.rb, ext/tk/lib/tk/radiobutton.rb,
- ext/tk/lib/tk/package.rb, ext/tk/lib/tk/macpkg.rb,
- ext/tk/lib/tk/composite.rb, ext/tk/lib/tk/autoload.rb,
- ext/tk/lib/tk/canvas.rb, ext/tk/lib/tk/button.rb,
- ext/tk/lib/tk/textwindow.rb,
- ext/tk/lib/tkextlib/iwidgets/scrolledtext.rb,
- ext/tk/lib/tkextlib/tile/style.rb,
- ext/tk/lib/tkextlib/tile/tscrollbar.rb,
- ext/tk/lib/tkextlib/tile/tpaned.rb, ext/tk/lib/tkextlib/tile.rb,
- ext/tk/extconf.rb: support Tcl/Tk8.5 (partial, not complete).
-
- * ext/tk/sample/demos-jp/widget,
- ext/tk/sample/demos-jp/pendulum.rb,
- ext/tk/sample/demos-jp/bind.rb,
- ext/tk/sample/tkextlib/vu/canvSticker2.rb,
- ext/tk/sample/demos-en/pendulum.rb,
- ext/tk/sample/demos-en/bind.rb: remove $KCODE and minor bug fix.
-
-Fri Dec 21 17:49:06 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * transcode.c (rb_str_transcode_bang): returns self if no conversion.
- [ruby-dev:32662]
-
-Fri Dec 21 17:44:47 2007 Eric Hodel <drbrain@segment7.net>
-
- * lib/rubygems*: Update to RubyGems 1.0.1, r1581
-
-Fri Dec 21 17:32:49 2007 Koichi Sasada <ko1@atdot.net>
-
- * bootstraptest/pending.rb: renamed from featurebug.rb.
- This file contains bugs which is known but will not be
- fixed in days.
-
-Fri Dec 21 17:31:22 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * debug.c (dummy_gdb_enums.various): added ENCODING and CODERANGE
- constants.
-
- * .gdbinit: use enum constants.
-
-Fri Dec 21 17:28:17 2007 Koichi Sasada <ko1@atdot.net>
-
- * bootstraptest/featurebug.rb: added.
-
- * bootstraptest/test_knownbug.rb: move a feature bug.
-
-Fri Dec 21 17:25:22 2007 Koichi Sasada <ko1@atdot.net>
-
- * thread.c (rb_thread_atfork): fix to mark thread object.
- [ruby-dev:32404]
-
- * bootstraptest/test_knownbug.rb, test_fork.rb: move a fixed test.
-
-Fri Dec 21 17:07:13 2007 Koichi Sasada <ko1@atdot.net>
-
- * gc.h: extern variable should not be initialized.
-
- * thread_pthread.c: add a parameter.
-
-Fri Dec 21 16:50:43 2007 Tanaka Akira <akr@fsij.org>
-
- * encoding.c (Init_Encoding): use enc_name as to_s.
- (enc_inspect): renamed from enc_to_s. add "#" at beginning.
-
-Fri Dec 21 16:37:43 2007 NARUSE, Yui <naruse@ruby-lang.org>
-
- * ext/nkf/nkf-utf8/config.h (MIME_DECODE_DEFAULT, X0201_DEFAULT):
- defined as FALSE. nkf and kconv don't decode MIME encoded string
- and don't convert JIS X 0201 Katakana.
-
- * test/nkf/test_kconv.rb: fix tests.
-
-Fri Dec 21 16:33:28 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * enumerator.c (enumerator_iter_i): adjusted for rb_block_call_func.
-
- * include/ruby/ruby.h (rb_block_call_func): function to be called back
- as block.
-
-Fri Dec 21 16:25:25 2007 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * common.mk, transcode_data_iso_8859.c: renamed to
- transcode_data_one_byte.c.
-
-Fri Dec 21 16:10:30 2007 Shigeo Kobayashi <shigeo@tinyforest.jp>
-
- * ext/bigdecimal/bigdecimal.c (VpMidRound): Round method bug
- pointed by Ryan Platte fixed(Patch to the patch from "NATORI
- Shin"). [ruby-talk:273360]
-
-Fri Dec 21 16:06:13 2007 Tanaka Akira <akr@fsij.org>
-
- * re.c (append_utf8): use rb_utf8_encoding() instead of
- rb_enc_find("utf-8").
-
-Fri Dec 21 15:59:46 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * encoding.c (rb_enc_init): use enc_register_at() directly.
-
- * encoding.c (rb_utf8_encoding): returns utf-8 encoding.
-
- * include/ruby/encoding.h (rb_utf8_encoding): prototyped.
-
- * parse.y (UTF8_ENC): uses rb_utf8_encoding().
-
-Fri Dec 21 15:31:59 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * io.c (rb_io_s_read): allow specifying encoding explicitly.
-
- * io.c (rb_io_binmode): specifies encoding to ASCII-8BIT (binary).
-
- * io.c (rb_io_s_read): IO should be in binary mode when offset is
- specified.
-
- * encoding.c (rb_to_encoding): returns default encoding if no
- corresponding encoding found.
-
-Fri Dec 21 15:24:22 2007 Shugo Maeda <shugo@ruby-lang.org>
-
- * lib/net/imap.rb (initialize): accept service name. changed
- the default value of the old style +verify+ argument to true.
-
-Fri Dec 21 15:15:44 2007 Tanaka Akira <akr@fsij.org>
-
- * gc.c (rb_garbage_collect): new function for debugging.
-
-Fri Dec 21 15:16:00 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * encoding.c (rb_to_encoding_index): should return error instead of
- exception even if type is incorrect.
-
-Fri Dec 21 14:58:27 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * enumerator.c (enumerator_init_copy): prohibit cloning of
- generators since Fibers cannot be copied.
-
- * enumerator.c (enumerator_init_copy): typo fixed.
-
-Fri Dec 21 14:46:07 2007 Tanaka Akira <akr@fsij.org>
-
- * io.c (Init_IO): define IO::BINARY even if O_BINARY is not exist.
-
-Fri Dec 21 14:01:14 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * test/ruby/test_system.rb (TestSystem::valid_syntax): apply
- ASCII-8BIT encoding explicitly.
-
- * re.c (rb_reg_prepare_re): add encoding name in the message.
-
-Fri Dec 21 13:54:05 2007 Tanaka Akira <akr@fsij.org>
-
- * re.c: change "character encodings differ" error messages.
-
-Fri Dec 21 13:46:58 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * encoding.c (rb_enc_register): set encoding constant.
-
- * encoding.c (rb_enc_find_index): replace non-alphanumeric chars with
- underscores, so that initialize function can be called.
-
- * encoding.c (rb_enc_find_index): extension libraries have lower case
- names conventionally.
-
- * ruby.c (proc_options, process_options): finds encoding after
- load_path is initialized.
-
-Fri Dec 21 13:10:57 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * io.c (rb_io_external_encoding): new method.
-
- * encoding.c (rb_enc_from_encoding): returns Qnil for NULL
- encoding.
-
- * io.c (rb_io_external_encoding): should fill delayed
- initialization for STDIN.
-
-Fri Dec 21 13:09:11 2007 Tanaka Akira <akr@fsij.org>
-
- * encoding.c (rb_locale_charmap): return nil if no locale information.
-
-Fri Dec 21 12:55:39 2007 Tanaka Akira <akr@fsij.org>
-
- * lib/runit, lib/rubyunit.rb, test/testunit/runit: removed.
-
-Fri Dec 21 12:45:49 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * string.c (rb_str_chomp_bang): avoid unnecessary loop using
- ONIGENC_LEFT_ADJUST_CHAR_HEAD().
-
-Fri Dec 21 12:32:08 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * file.c (Init_File): File.exists? revived.
-
- * dir.c (Init_Dir): Dir.exists? again.
-
-Fri Dec 21 12:26:36 2007 Koichi Sasada <ko1@atdot.net>
-
- * compile.c: remove "illegal".
-
-Fri Dec 21 12:22:20 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * keywords, parse.y (__ENCODING__): represent script encoding.
-
-Fri Dec 21 12:16:50 2007 Tanaka Akira <akr@fsij.org>
-
- * string.c (rb_str_is_ascii_only_p): new method ascii_only?.
-
-Fri Dec 21 12:11:57 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * io.c (rb_io_mode_enc): set default external encoding if no
- encoding specified explicitly.
-
-Fri Dec 21 12:00:34 2007 Tanaka Akira <akr@fsij.org>
-
- * configure.in: check langinfo.h and locale.h.
-
- * encoding.c: use langinfo.h only if available.
-
- * main.c: use locale.h only if available.
-
-Fri Dec 21 11:47:56 2007 Tanaka Akira <akr@fsij.org>
-
- * encoding.c: include locale.h
- (rb_locale_charmap): new method Encoding.locale_charmap for
- nl_langinfo(CODESET).
-
- * include/ruby/encoding.h (rb_locale_charmap): declared.
-
- * main.c (main): call setlocale with LC_CTYPE.
-
- * ruby.c (locale_encoding): use rb_locale_charmap.
-
-Fri Dec 21 11:35:10 2007 Koichi Sasada <ko1@atdot.net>
-
- * vm.c, vm_dump.c: fix typo. Reported by Yuki Mitsui.
-
-Fri Dec 21 11:28:00 2007 Tanaka Akira <akr@fsij.org>
-
- * regerror.c, string.c, io.c, lib/getoptlong.rb, lib/net/imap.rb,
- compile.c, sprintf.c, parse.y, ext/win32ole/win32ole.c,
- ext/tk/sample/demos-en/entry3.rb, ext/tk/lib/tcltk.rb,
- ext/openssl/ossl_bn.c, numeric.c, vm.c,
- benchmark/bm_so_meteor_contest.rb, bignum.c, ruby.c: don't "illegal"
- for non law violation context.
-
-Fri Dec 21 11:23:24 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * common.mk (enc.mk): depends on $(RBCONFIG) instead of rbconfig.rb.
-
- * encoding.c (Init_Encoding): ISO-8859-1 is no longer a replica.
-
- * regenc.h (OnigEncodingDefine): names of extension and encoding can
- differ.
-
- * enc/Makefile.in: always shared.
-
- * enc/depend (deffile): should not upcase.
-
- * enc/{ascii,euc_jp,sjis,utf8,iso_8859_{1..16}}.c: fix for Init.
-
-Fri Dec 21 09:26:48 2007 Tanaka Akira <akr@fsij.org>
-
- * tool/compile_prelude.rb: use erb.
-
-Fri Dec 21 08:07:35 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * enumerator.c (enumerator_next): should call next_init() if fiber
- is dead already. [ruby-dev:32459]
-
-Fri Dec 21 01:21:49 2007 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * ext/openssl/lib/openssl/ssl.rb (OpenSSL::SSL::SSLContext.build):
- enable CRL checking by default.
-
-Fri Dec 21 01:20:56 2007 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * lib/net/http.rb (Net::HTTP#connect): use
- OpenSSL::SSL::SSLContext.build instead of SSLContext.new (default
- verify mode is now OpenSSL::SSL::VERIFY_PEER).
-
- * lib/net/https.rb: SSL parameters are defined by attr_accessor.
-
- * test/net/http/test_https.rb: add test for HTTPS features.
-
-Fri Dec 21 01:11:37 2007 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * io.c (select_internal): should return original value.
-
-Fri Dec 21 00:26:39 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * string.c (tr_trans): wrong encoding check for tree strings.
-
- * test/ruby/test_m17n.rb (TestM17N::test_tr_s): "invalid mbstring
- sequence" is not an error to be tested.
-
- * test/ruby/test_m17n.rb (TestM17N::test_tr): ditto.
-
-Thu Dec 20 19:29:07 2007 Shugo Maeda <shugo@ruby-lang.org>
-
- * lib/net/imap.rb (initialize): the second argument is an option
- hash now. use SSLContext.build to specify SSL parameters.
-
-Thu Dec 20 19:11:56 2007 Koichi Sasada <ko1@atdot.net>
-
- * thread_pthread.c (native_thread_apply_priority): check
- _POSIX_PRIORITY_SCHEDULING for OpenBSD.
-
-Thu Dec 20 18:33:54 2007 Koichi Sasada <ko1@atdot.net>
-
- * configure.in: add libthr for FreeBSD.
-
-Thu Dec 20 18:17:14 2007 Koichi Sasada <ko1@atdot.net>
-
- * common.mk, *.ci: renamed to *.c.
-
- * eval_load.c: renamed to load.c.
-
-Thu Dec 20 17:36:01 2007 Eric Hodel <drbrain@segment7.net>
-
- * lib/rubygems*: Import RubyGems 1.0.0, r1575.
-
-Thu Dec 20 17:18:38 2007 Koichi Sasada <ko1@atdot.net>
-
- * proc.c: support Proc#binding.
-
- * sample/test.rb: add a test.
-
-Thu Dec 20 17:15:15 2007 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * pack.c: Slight change to documentation ('character' ->
- 'byte (C char)'). [ruby-core:13126], see also [ruby-core:13998].
-
-Thu Dec 20 17:07:54 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * common.mk (enc.mk): depends on rbconfig.rb.
-
- * regenc.h (OnigEncodingDefine): external encoding definition macro.
-
- * enc/Makefile.in: fix for linking.
-
- * enc/depend, enc/make_encmake.rb: fix for Windows.
-
- * enc/{ascii,euc_jp,sjis,utf8,iso_8859_{1..16}}.c: renamed.
-
-Thu Dec 20 16:42:55 2007 Koichi Sasada <ko1@atdot.net>
-
- * iseq.c (find_line_no): return 0 if not found.
-
-Thu Dec 20 16:04:17 2007 Koichi Sasada <ko1@atdot.net>
-
- * insnhelper.ci, vm.c, vm_core.h: change interface of
- vm_invoke_block() to specify block ptr. [ruby-talk:266422]
-
- * cont.c, eval_jump.ci, insns.def, proc.c, signal.c, thread.c:
- apply above change.
-
- * bootstraptest/test_knownbug.rb: move fixed bug.
-
- * bootstraptest/test_block.rb: ditto. and add a test.
-
-Thu Dec 20 15:47:13 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * enc/iso_8859_{1..16}.c: renamed.
-
-Thu Dec 20 09:59:27 2007 Koichi Sasada <ko1@atdot.net>
-
- * insnhelper.ci (vm_expandarray): fix sp increase place.
- a patch from Yusuke ENDOH <mame AT tsg.ne.jp> in [ruby-dev:32581].
-
- * bootstraptest/test_massign.rb: add a test for above.
-
- * bootstraptest/test_syntax.rb: fix last committed test.
-
-Thu Dec 20 09:47:58 2007 Koichi Sasada <ko1@atdot.net>
-
- * bootstraptest/test_syntax.rb: add a test.
-
-Thu Dec 20 09:40:51 2007 Koichi Sasada <ko1@atdot.net>
-
- * compile.c (iseq_compile_each/NODE_RETURN): fix stack consistency.
-
-Thu Dec 20 09:42:11 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * bignum.c (big2str_orig): access beyond memory region cause crash
- on interrupt. a patch from Yusuke ENDOH <mame AT tsg.ne.jp> in
- [ruby-dev:32651]. [ruby-dev:32641]
-
-Thu Dec 20 09:06:54 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * string.c (rb_str_index): wrong starting position.
-
-Thu Dec 20 06:34:27 2007 Koichi Sasada <ko1@atdot.net>
-
- * compile.c (iseq_compile_each): add pop after throw as return.
-
- * bootstraptest/test_knownbug.rb, test_syntax.rb: move resolved test.
-
- * vm_core.h, iseq.c, compile.h: add debug output code.
-
-Thu Dec 20 04:57:18 2007 Koichi Sasada <ko1@atdot.net>
-
- * compile.c (iseq_compile_each): remove unused retry entry.
-
-Thu Dec 20 04:15:41 2007 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * */Makefile.sub (DEFS, RM): output to config.status.
-
-Thu Dec 20 02:59:05 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * common.mk (encs): create encoding directory.
-
-Thu Dec 20 02:50:28 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * enc/iso8859_{1..16}.c: adjust for ruby.
-
-Thu Dec 20 02:28:29 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * enc/iso8859_{1..16}.c: imported from Onigiruma 5.9.0.
-
-Thu Dec 20 02:23:22 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * enc/Makefile.in (RM): added.
-
- * enc/depend (encs): sort in alpha-numeric order.
-
- * enc/depend (clean, distclean): added.
-
-Thu Dec 20 01:10:52 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * compile.c (iseq_compile_each): should handle upper level eval iseq
- from break/next, and COMPILE_ERROR() breaks only one block.
- [ruby-dev:31372]
-
-Thu Dec 20 00:07:36 2007 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
-
- * test/drb/drbtest.rb (test_07_public_private_protected_missing):
- followed current Ruby specification.
-
-Wed Dec 19 23:57:37 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * dir.c (dir_inspect, dir_path, dir_tell): check for frozen and closed
- is not needed. [ruby-dev:32640]
-
-Wed Dec 19 22:59:52 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * string.c (str_sublen): adjust position if position is not at the
- head of a character.
-
- * string.c (rb_str_chomp_bang): check if match start at the head
- of a character.
-
- * string.c (rb_str_chomp_bang): wrong adjust condition.
-
- * string.c (rb_str_rindex): comparison length should be based on
- bytes, not characters.
-
- * string.c (rb_str_rindex_m): too much adjustment.
-
- * re.c (reg_match_pos): pos adjustment should be based on
- characters.
-
- * test/ruby/test_m17n.rb (TestM17N::test_str_insert): test updated
- to check negative offset behavior.
-
- * string.c (rb_str_each_line): should consider rslen.
-
- * string.c (rb_str_buf_append): should propagate encoding.
-
- * string.c (rb_str_each_line): ditto.
-
- * test/ruby/test_m17n.rb (TestM17N::test_str_each_line): should
- check encoding as well.
-
- * test/ruby/test_m17n.rb (TestM17N::test_str_each_line): empty
- array can not propagate encoding; should not check.
-
-Wed Dec 19 21:42:18 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * re.c (rb_reg_regsub): should set checked encoding.
-
- * string.c (rb_str_sub_bang): applied r14212 too.
-
-Wed Dec 19 20:40:01 2007 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * bignum.c (bigmul1): C99ism.
-
- * bignum.c (bigdivrem1): need dummy return value.
-
-Wed Dec 19 19:18:06 2007 NARUSE, Yui <naruse@ruby-lang.org>
-
- * ext/nkf/nkf-utf8/nkf.c: Updated.
-
- * ext/nkf/nkf.c (rb_nkf_enc_get): added.
- (find encoding or replicate default encoding)
-
- * ext/nkf/nkf.c (NKF::<ENCODING>): redefine encoding constant.
-
- * ext/nkf/lib/kconv.rb (Kconv::<ENCODING>): redefined as Encoding.
-
- * ext/nkf/lib/kconv.rb: refactoring.
-
-Wed Dec 19 19:11:08 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * bignum.c (rb_big_mul0): blocking check for bigger numbers.
- a patch from Yusuke ENDOH <mame AT tsg.ne.jp> in [ruby-dev:32632].
-
- * bignum.c (bigdivrem): ditto.
-
-Wed Dec 19 17:34:50 2007 Koichi Sasada <ko1@atdot.net>
-
- * compile.c (iseq_compile_each): remove "retry" in block.
- ("iter{retry}" cause syntax error)
- Currently, "begin; ...; rescue; iter{retry}; end" cause
- syntax error too.
-
- * bootstraptest/test_jump.rb: ditto.
-
- * lib/drb/invokemethod.rb: ditto.
-
- * sample/drb/darrayc.rb: ditto.
-
- * sample/test.rb: ditto.
-
- * test/drb/drbtest.rb: ditto.
-
- * test/ruby/test_iterator.rb: ditto.
-
- * sample/test.rb: add a 'test' directory on the SYSTEM test.
-
-Wed Dec 19 17:12:59 2007 Koichi Sasada <ko1@atdot.net>
-
- * bootstraptest/test_knownbug.rb, test_block.rb:
- move fixed bug.
-
- * bootstraptest/test_m17n.rb: added.
-
-Wed Dec 19 16:59:55 2007 Koichi Sasada <ko1@atdot.net>
-
- * eval.c (errinfo_place): skip if error is Fixnum. [ruby-dev:32608]
-
- * bootstraptest/test_exception.rb, test_known_bug.rb: move fixed bug.
-
-Wed Dec 19 16:31:58 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (reg_named_capture_assign_iter): remove C99 dependency.
+Sat Dec 22 14:49:46 2007 Tadayoshi Funaba <tadf@dotrb.org>
- * parse.y (reg_named_capture_assign_iter): get rid of creating
- unnecessary ID.
-
- * parse.y (rb_enc_symname2_p): check for non-nul-terminated string.
-
-Wed Dec 19 15:37:06 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * insnhelper.ci (vm_yield_with_cfunc): call cfunc with
- (argv[0], data, argc, argv) to pass all arguments.
-
- * enumerator.c (enumerator_each_i): adapted to new calling
- convention.
-
-Wed Dec 19 15:13:20 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * string.c (rb_str_justify): should propagate encoding from pad
- string too.
+ * lib/date.rb: don't freeze nil even if 1.8 will not be aware of
+ the issue. [ruby-dev:32677]
Wed Dec 19 13:57:43 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* configure.in (TIMEZONE_VOID): check whether timezone requires zero
arguments. [ruby-dev:32631]
-Wed Dec 19 13:22:14 2007 NARUSE, Yui <naruse@ruby-lang.org>
-
- * ext/nkf/nkf.c (NKF::_ENCODING): removed.
-
- * ext/nkf/nkf.c (rb_nkf_kconv): renamed to rb_nkf_convert.
-
- * ext/nkf/nkf.c (rb_nkf_convert): set encoding.
-
- * ext/nkf/nkf.c (rb_nkf_guess1): removed.
-
- * ext/nkf/nkf.c (rb_nkf_guess2): renamed to rb_nkf_guess.
+Wed Dec 19 12:01:42 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/nkf/nkf.c (rb_nkf_guess):
- guess method now returns encoding object.
-
- * ext/nkf/nkf-utf8/nkf.c: Update to nkf 2.0.8 2007-12-19.
+ * parse.y (f_rest_arg): check if duplicated. [ruby-core:14140]
Wed Dec 19 10:52:29 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* bignum.c (rb_cstr_to_inum): an underscore succeeding after octal
prefix is allowed. [ruby-core:14139]
-Wed Dec 19 00:09:19 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * bignum.c (rb_cstr_to_inum): wrong radix check. a patch from
- Yusuke ENDOH <mame AT tsg.ne.jp> in [ruby-dev:32628].
-
- * bignum.c (big2str_find_n1): ditto.
-
-Tue Dec 18 23:53:53 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * compile.c (iseq_compile_each): fix for segfault. [ruby-dev:31372]
-
-Tue Dec 18 23:44:32 2007 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * test/net/http/utils.rb: split TestNetHTTPUtils module from
- test/net/http/test_http.rb. and start HTTP server in each test case.
-
-Tue Dec 18 23:27:51 2007 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * lib/webrick/server.rb (WEBrick::GenericServer#accept_client):
- should rescue Errno::EINVAL from TCPServer#accept. this exception
- might occur if the server socket is not in ready to listen.
-
- * lib/webrick/server.rb (WEBrick::GenericServer#accept_client):
- don't call TCPServer#close if the :ShutdownSocketWithoutClose is set.
-
- * lib/webrick/config.rb (WEBrick::Config::General): add new parameter
- :ShutdownSocketWithoutClose.
-
-Tue Dec 18 22:51:47 2007 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * ext/openssl/lib/openssl/ssl.rb (OpenSSL::SSL::SSLServer#shutdown):
- new method which calls TCPSocket#shutdown of the underlying socket.
-
-Tue Dec 18 22:11:50 2007 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * lib/rss/parser.rb, lib/rss/atom.rb, lib/rss/rss.rb,
- test/rss/rss-assertions.rb, test/rss/test_atom.rb: use
- pack/unpack("m") instead of base64 library.
-
- * lib/webrick/httpproxy.rb: use delete("\n") instead of chomp/chop
- because the result of pack("m") might be multi-line.
-
-Tue Dec 18 22:12:35 2007 Koichi Sasada <ko1@atdot.net>
-
- * insnhelper.ci, vm.c: rewrite sp manipulation around method/block
- invocation. [ruby-dev:32547]
-
-Tue Dec 18 22:11:23 2007 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * ext/dl/win32/lib/win32/sspi.rb: use pack/unpack("m") instead of
- base64 library which was already removed.
-
-Tue Dec 18 21:09:23 2007 Koichi Sasada <ko1@atdot.net>
-
- * vm.c (invoke_block): merge 2 stack overflow checks.
-
-Tue Dec 18 20:58:35 2007 Koichi Sasada <ko1@atdot.net>
-
- * compile.c, insnhelper.ci, insns.def, object.c, vm.c, vm.h:
- optimize !@, != method invocation.
-
- * id.c, id.h: ditto.
-
- * bootstraptest/test_syntax.rb: add tests for above.
-
-Tue Dec 18 18:10:05 2007 Koichi Sasada <ko1@atdot.net>
-
- * bootstraptest/test_knownbug.rb: add issues.
-
-Tue Dec 18 20:22:44 2007 Tanaka Akira <akr@fsij.org>
-
- * parse.y (arg tMATCH arg): call reg_named_capture_assign_gen if regexp
- literal is used.
- (reg_named_capture_assign_gen): assign the result of named capture
- into local variables.
- [ruby-dev:32588]
-
- * re.c: document the assignment by named captures.
-
-Tue Dec 18 18:09:15 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * string.c (rb_str_splice): propagate encoding.
-
- * string.c (rb_str_subpat_set): ditto.
-
-Tue Dec 18 17:27:12 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * object.c (rb_obj_freeze): preserve frozen state of immediate
- values in internal hash table, a la generic_ivar.
-
- * object.c (rb_obj_frozen_p): check immediate values too.
-
- * variable.c (generic_ivar_set): add frozen check fro immediate
- values.
-
-Tue Dec 18 17:04:25 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * transcode.c (rb_str_transcode_bang, rb_str_transcode): set new
- encoding even if no conversion is done because of 7bit only.
- [ruby-dev:32591]
-
-Tue Dec 18 15:43:59 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * common.mk (encs, ext/ripper/ripper.c): other options must come
- before MAKEFLAGS in GNU make.
-
-Tue Dec 18 15:19:55 2007 Eric Hodel <drbrain@segment7.net>
-
- * lib/rdoc/parsers/parse_rb.rb: Don't call private fail anymore.
-
-Tue Dec 18 15:17:26 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * common.mk (encs, ext/ripper/ripper.c): pass MAKEFLAGS.
-
-Tue Dec 18 14:45:25 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * parse.y (op_tbl): remove duplication to avoid symbol aliases.
-
-Tue Dec 18 14:39:05 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * string.c (str_nth): need not to raise out-of-range exception.
-
- * test/ruby/test_m17n.rb (TestM17N::test_str_aref_len): removed
- debug print.
-
-Tue Dec 18 14:05:23 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * enc/depend: get rid of target expanded as empty for nmake.
-
-Tue Dec 18 07:56:57 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * proc.c (rb_obj_public_method): Object#public_method to retrieve
- public method object.
-
- * proc.c (rb_mod_public_instance_method): Module#public_instance_method
- to retrieve public instance method from class / module.
-
- * proc.c (mnew): visibility check added.
-
- * eval_error.ci (rb_print_undef): add rb_ prefix.
-
- * eval_error.ci (rb_print_undef): add visibility in the error
- message.
-
-Tue Dec 18 05:54:26 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/Env.rb, lib/base64.rb, lib/importenv.rb, lib/eregex.rb: removed.
-
- * lib/ping.rb, lib/readbytes.rb: removed
-
-Tue Dec 18 02:30:56 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in (BUILTIN_ENCS): removed.
-
- * common.mk (enc.mk): pass BUILTIN_ENCS from command line.
-
- * enc/depend: ditto.
-
- * enc/make_encmake.rb: ditto.
-
-Tue Dec 18 01:46:48 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * sprintf.c (rb_str_format): need to clear output buffer to avoid
- broken encoding compatibility check.
+Mon Dec 17 13:43:15 2007 Tanaka Akira <akr@fsij.org>
-Tue Dec 18 01:40:20 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/mkmf.rb (depend_rules): inserts ruby to only headers.
-
-Tue Dec 18 01:21:19 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (parser_encode_length): chomp eol style modifiers.
-
- * parse.y (parser_magic_comment): ditto.
-
- * parse.y (set_file_encoding): ditto.
-
-Tue Dec 18 01:15:44 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * common.mk (encs): added dependencies.
-
- * enc/Makefile.in, enc/depend, enc/make_encmake.rb: moved serb code.
-
- * lib/mkmf.rb (depend_rules): now takes content string, not file name.
-
- * win32/enc-setup.mak: overrides default target.
-
-Tue Dec 18 00:26:12 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * re.c (rb_reg_initialize): raise error if non-Unicode fixed
- encoding option is specified for regexp literals with \u{}
- escapes.
-
- * string.c (rb_str_squeeze_bang): should squeeze multibyte
- characters as well.
-
-Mon Dec 17 21:41:25 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * win32/enc-setup.mak: extracts BUILTIN_ENCOBJS.
-
- * tool/compile_prelude.rb: needs srcdir.
-
-Mon Dec 17 21:24:04 2007 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * common.mk (miniprelude.c): add -I$(srcdir).
-
-Mon Dec 17 20:53:27 2007 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * ext/openssl/ossl_ssl.c (ossl_sslctx_set_ssl_version):
- new method OpenSSL::SSL::SSLContext#ssl_version to wrap
- SSL_CTX_set_ssl_version.
-
- * ext/openssl/ossl_ssl.c (ossl_ssl_get_verify_result):
- new method OpenSSL::SSL::SSLSocket#verify_result to wrap
- SSL_get_verify_result.
-
- * ext/openssl/lib/openssl/ssl.rb (OpenSSL::SSL::SSLContext.build):
- new method to build OpenSSL::SSL::SSLContext with Hash parameters.
- this method provides safety default parameters than SSLContext.new.
-
- * ext/openssl/lib/openssl/ssl.rb (OpenSSL::SSL.verify_certificate_identity):
- new module function: pull out identity verification process
- from OpenSSL::SSL::SSLSocket#post_connection_check.
-
-Mon Dec 17 18:42:23 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * string.c (scan_once): need no encoding compatibility check.
- it's done inside of re_reg_search().
-
- * string.c (rb_str_split_m): ditto.
-
- * re.c (rb_reg_regsub): ditto.
-
-Mon Dec 17 17:50:30 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * string.c (rb_str_index): check if substring is broken.
-
- * string.c (rb_str_rindex): ditto.
-
- * string.c (rb_str_succ): should carry over.
-
-Mon Dec 17 17:47:26 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * common.mk (encs): new target to compile external encodings.
-
- * enc/Makefile.in: became a serb template.
-
- * enc/make_encmake.rb: creates enc.mk from enc/Makefile.in using serb.
-
- * lib/mkmf.rb (relative_from): moved from ext/extmk.rb.
-
- * lib/mkmf.rb ($extmk): true if under to top source directory, not
- only ext.
-
- * lib/mkmf.rb (depend_rules): extracted from create_makefile.
-
- * tool/serb.rb (serb): splitted from tool/compile_prelude.rb.
-
-Mon Dec 17 17:32:55 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in (MAKEFILES): removed enc/Makefile.
-
- * configure.in (EXTERNAL_ENCOBJS, ENCSOS): removed.
-
- * enc/Makefile.in (BUILTIN_ENCS): includes .c suffix.
-
- * enc/depend: splitted from Makefile.in.
-
- * {bcc32,win32,wince}/setup.mak (-encs-): extracts BUILTIN_ENCOBJS.
-
-Mon Dec 17 17:07:53 2007 Tanaka Akira <akr@fsij.org>
-
- * string.c (rb_enc_str_asciionly_p): use rb_enc_str_coderange.
-
-Mon Dec 17 16:39:25 2007 Tanaka Akira <akr@fsij.org>
-
- * string.c (rb_enc_str_coderange): set ENC_CODERANGE_BROKEN using
- rb_enc_precise_mbclen.
- (rb_str_valid_encoding_p): just check coderange is
- ENC_CODERANGE_BROKEN or not.
-
-Mon Dec 17 16:04:16 2007 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * ext/openssl/lib/openssl/buffering.rb (Buffering#gets): added second
- optional argument to specify maximum length limit.
-
-Mon Dec 17 16:02:30 2007 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * lib/webrick/httprequest.rb, lib/webrick/cgi.rb: Request-Line or
- header fields should be read with maximum length. [ruby-talk:231745]
-
-Mon Dec 17 14:03:39 2007 Tanaka Akira <akr@fsij.org>
-
- * include/ruby/encoding.h (ENC_CODERANGE_VALID): rename from
- ENC_CODERANGE_8BIT.
-
- * string.c (rb_enc_str_coderange): follow the renaming.
-
-Mon Dec 17 13:56:53 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * string.c (tr_find): wrong condition fixed.
-
- * sprintf.c (rb_str_format): check encoding based on result, not
- the format string.
-
- * string.c (rb_str_upto): add encoding check.
+ * gc.c (stack_end_address): use local variable address instead of
+ __builtin_frame_address(0) to avoid SEGV on SunOS 5.11 on x86 with
+ gcc (GCC) 3.4.3 (csl-sol210-3_4-20050802).
+ stack_end_address returned a frame address of garbage_collect
+ since stack_end_address doesn't create its own frame.
+ So a VALUE stored in a callee saved register, %edi, pushed into
+ the stack at the beginning of garbage_collect was not marked.
Mon Dec 17 12:21:25 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* Makefile.in (RUNRUBY): added RUNRUBYOPT.
-Mon Dec 17 11:38:59 2007 Tanaka Akira <akr@fsij.org>
-
- * thread_win32.ci (native_thread_create): initialize
- th->machine_stack_maxsize as rb_gc_stack_maxsize.
-
-Sun Dec 16 17:07:35 2007 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * transcode.c (transcode_loop): removed special case (-1)
- for undefined conversions.
-
- * transcode_data_iso_8859.c: Changed from character constants
- ('\xC2') to integer constants (0xC2) for shorter files and
- better readability; eliminated duplicated tables; changed
- from -1 offset to actual UNDEF entry (not yet distinguishing
- UNDEF and ILLEGAL correctly).
-
- * test/ruby/test_transcode.rb: added a test for UNDEF conversion.
-
-Sun Dec 16 14:51:59 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in (MAKEFILES): should be enc/Makefile, not GNUmakefile.
- [ruby-dev:32609]
-
- * configure.in (BUILTIN_ENCS): removed escapes for OpenBSD.
-
-Sat Dec 15 23:58:46 2007 Tanaka Akira <akr@fsij.org>
-
- * test/openssl/test_pair.rb (SSLPair#ssl_pair): join the thread, even
- on an error.
-
-Sat Dec 15 23:50:31 2007 Tanaka Akira <akr@fsij.org>
-
- * test/xmlrpc/webrick_testing.rb: join webrick server thread.
-
-Sat Dec 15 22:27:39 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in (BUILTIN_ENCS): splitted command line instead of
- semicolons for Solaris.
-
-Sat Dec 15 21:38:24 2007 Tanaka Akira <akr@fsij.org>
-
- * lib/timeout.rb: join the background thread to make sure it is dead.
-
-Sat Dec 15 20:20:48 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in (enc/Makefile): add external encoding objects list.
-
- * common.mk (BUILTIN_ENCOBJS): renamed from ENCOBJS.
-
- * configure.in (BUILTIN_ENCS): [] needs to be enclosed because of m4.
-
- * Makefile.in (BUILTIN_ENCOBJS): substituted by autoconf.
-
- * enc/Makefile.in: new file to compile external encoding sources.
-
- * encoding.c (rb_enc_find_index): auto-load external encoding objects
- as "ext/ENCODING_NAME". [ruby-dev:32606]
-
-Sat Dec 15 13:04:30 2007 Tanaka Akira <akr@fsij.org>
-
- * vm_core.h (rb_thread_t): new member machine_stack_maxsize and
- machine_register_stack_maxsize.
-
- * gc.c (rb_gc_stack_maxsize): new global variable for the thread size
- of the main thread.
- (STACK_LEVEL_MAX): use machine_stack_maxsize of current thread.
- (ruby_stack_check): check IA64 register stack.
- (ruby_set_stack_size): set rb_gc_stack_maxsize.
- (Init_stack): set rb_gc_stack_maxsize.
-
- * thread_pthread.ci (native_thread_create): initialize
- th->machine_stack_maxsize and th->machine_register_stack_maxsize.
-
- * vm.c (Init_BareVM): initialize th->machine_stack_maxsize and
- th->machine_register_stack_maxsize.
-
- * thread_win32.ci (native_thread_create): initialize
- th->machine_stack_maxsize. not tested. just a guess at all.
-
- [ruby-dev:32604]
-
-Sat Dec 15 12:58:00 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * encoding.c (rb_enc_register, rb_enc_replicate, rb_enc_alias): check
- if already registered.
-
-Sat Dec 15 01:57:06 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/rdoc/options.rb (Options::parse): do not access $KCODE any
- longer. [ruby-core:14079]
-
- * lib/irb/init.rb (IRB::IRB.parse_opts): ditto.
-
- * lib/cgi.rb (CGI::CGI): ditto.
-
-Fri Dec 14 18:18:31 2007 Tanaka Akira <akr@fsij.org>
-
- * thread_pthread.ci (native_thread_create): twice the stack size.
- 512KB is not enough to complete test-all on Debian GNU/Linux on
- IA64.
-
-Fri Dec 14 16:10:50 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * io.c (rb_f_p): RDoc update. a patch from murphy <murphy AT rubychan.de>.
- [ruby-core:14010]
-
-Fri Dec 14 16:06:18 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * string.c (rb_str_cmp): encoding aware comparison.
-
- * string.c (rb_str_casecmp): ditto.
-
-Fri Dec 14 15:25:30 2007 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * transcode.c (encoding_equal): new function.
-
- * transcode.c (str_transcode, transcode_dispatch): added two-step
- conversion logic via UTF-8.
-
- * transcode.c: some minor formatting fixes
-
- * transcode_data.h, transcode_data_iso_8859.c: Shortened
- extremely frequently used macros to shorten file length.
-
- * test/ruby/test_transcode.rb: Fixed name of test class;
- added setup method to ensure all necessary encodings exist;
- split tests into more test methods; added tests; fixed ordering
- of arguments in assert_equal to have expected result first.
-
-Fri Dec 14 13:47:54 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * common.mk (ruby.imp): fix for circular dependency. a patch from
- Yutaka Kanemoto <kinpoco AT gmail.com> in [ruby-dev:32590].
-
- * regint.h, st.c, ext/json/ext/generator/generator.c: suppress
- warnings on AIX.
-
Fri Dec 14 12:36:35 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* configure.in (RUBY_CHECK_VARTYPE): check if a variable is defined
@@ -32321,211 +3155,14 @@ Fri Dec 14 12:36:35 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ext/readline/extconf.rb: should use have_func for functions instead
of have_var.
-Fri Dec 14 10:25:56 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/e2mmap.rb (Exception2MessageMapper::E2MM.Raise): $! no
- longer modifiable in 1.9.
-
-Fri Dec 14 08:17:24 2007 Tanaka Akira <akr@fsij.org>
-
- * eval.c (rb_protect): restore root_jmpbuf even if proc exits by
- break such as dbm.delete_if { break }.
-
-Fri Dec 14 02:55:41 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * string.c (str_nth): direct jump if string is 7bit only. great
- performance boost for worst case.
-
- * string.c (str_strlen): direct size if string is 7bit only.
-
-Fri Dec 14 02:29:32 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * encoding.c (rb_enc_compatible): 1st argument (typically the
- receiver) would have higher priority in encoding detection.
-
-Fri Dec 14 02:05:42 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * io.c (rb_io_synchronized): should check if initialized.
- [ruby-dev:32585]
-
-Fri Dec 14 00:54:40 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * re.c (rb_reg_initialize): embedded string may override encoding
- of the regular expression.
+Tue Dec 11 00:04:05 2007 Akinori MUSHA <knu@iDaemons.org>
- * re.c (rb_reg_initialize): fix encoding of regular expression if
- embedded string has its own encoding specified.
+ * array.c (rb_ary_slice_bang): If an invalid negative index (<
+ -size) is given, do not raise an exception but return nil just
+ like slice() does.
-Thu Dec 13 22:16:46 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * encoding.c (rb_enc_compatible): encoding should never fall back
- to ASCII-8BIT unless both encodings are ASCII-8BIT.
-
-Thu Dec 13 20:31:28 2007 Tanaka Akira <akr@fsij.org>
-
- * string.c (rb_str_shared_replace): make str noembed after free.
-
-Thu Dec 13 20:09:09 2007 Tanaka Akira <akr@fsij.org>
-
- * eval.c (rb_protect): restore root_jmpbuf to avoid SEGV by
- 'IO.pipe; [].each.next' with gcc version 3.3.5 (Debian 1:3.3.5-13)
- on IA64.
-
-Thu Dec 13 17:51:54 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * string.c (rb_str_split_m): need not to check encoding if regexp
- is empty.
-
- * string.c (rb_str_justify): associate encoding of original to the
- result.
-
- * string.c (rb_str_chomp_bang): need to check encoding of record
- separator.
-
- * string.c (str_gsub): should copy encoding to the result.
-
- * sprintf.c (rb_str_format): ditto.
-
- * string.c (rb_str_succ): should not enter infinite loop for
- non-ASCII, non-alphanumeric character at the bottom.
-
-Thu Dec 13 17:03:29 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * encoding.c (rb_enc_compatible): should swap encoding indexes too.
-
-Thu Dec 13 16:41:37 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * encoding.c (rb_enc_compatible): should not judge compatibility
- based on rb_enc_asciicompat().
-
-Thu Dec 13 13:09:03 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * include/ruby/io.h (MakeOpenFile): fptr->enc should be
- initialized to zero. [ruby-dev:32569]
-
-Thu Dec 13 08:56:01 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * io.c (rb_io_getc): use default external encoding if fptr->enc is
- not set. [ruby-dev:32565]
-
- * lib/rubygems/package.rb (Gem::TarReader::Entry::rewind): typo fixed.
- [ruby-dev:32565]
-
-Thu Dec 13 08:24:16 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * io.c (read_all): should associate default external encoding.
-
- * io.c (io_read): should NOT associate default external encoding.
-
-Wed Dec 12 23:22:58 2007 Tanaka Akira <akr@fsij.org>
-
- * re.c, regerror.c, string.c, parse.y, ruby.c, file.c:
- use capital letter for \xHH notation. [ruby-dev:32511]
-
-Wed Dec 12 22:21:34 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * io.c (rb_io_mode_enc): allow specifying external encoding in
- open mode, e.g. open(path, "r:utf-8").
-
-Wed Dec 12 21:26:03 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval_method.ci (rb_alias): no need to skip aliasing when new
- equals to old. [ruby-core:13990]
-
-Wed Dec 12 16:34:53 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * io.c (rb_io_check_readable): set default external encoding to
- STDIN.
-
- * io.c (io_enc_str): associate encoding to output string.
-
-Wed Dec 12 12:44:39 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * parse.y (expr): 'not' and '!' should act as conditional
- expression. [ruby-dev:32548]
-
-Wed Dec 12 12:11:42 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * re.c (rb_reg_regsub): should copy encoding.
-
- * string.c (rb_str_sub_bang, str_gsub): should check and copy encoding
- to be replaced.
-
-Tue Dec 11 23:04:17 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * pack.c (pack_pack): RDoc update. a patch from Gary Wright
- <radar2002 AT gmail.com>. [ruby-core:13998]
-
- * pack.c (pack_unpack): ditto.
-
-Tue Dec 11 16:37:47 2007 Tanaka Akira <akr@fsij.org>
-
- * encoding.c (rb_enc_ascget): renamed from rb_enc_get_ascii.
-
- * include/ruby/encoding.h: follow the renaming.
-
- * re.c: ditto.
-
-Tue Dec 11 16:19:26 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * Makefile.in, */Makefile.sub (CP, MV): added.
-
- * common.mk (.y.c): not discard the old target until successfully
- created.
-
-Tue Dec 11 15:20:39 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * object.c (Init_Object): singleton_method_{added,removed,undefined}
- hooks should be defined for BasicObject. [ruby-dev:32531]
-
- * eval.c (Init_eval): method_missing should be defined for all
- objects; moved to BasicObject.
-
-Tue Dec 11 14:27:50 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * transcode.c (transcode_loop): get rid of SEGV at sequence can not be
- converted.
-
- * transcode.c (rb_str_transcode_bang): copy encoding. [ruby-dev:32532]
-
- * test/ruby/test_transcode.rb: added tests from Martin Duerst <duerst
- AT it.aoyama.ac.jp>. [ruby-dev:32532]
-
-Tue Dec 11 12:05:51 2007 Tanaka Akira <akr@fsij.org>
-
- * encoding.c (rb_enc_get_ascii): add an argument to provide the
- length of the returned character.
-
- * include/ruby/encoding.h (rb_enc_get_ascii): add the argument.
-
- * re.c (rb_reg_expr_str): modify rb_enc_get_ascii call.
- (rb_reg_quote): ditto.
- (rb_reg_regsub): ditto.
-
-Tue Dec 11 09:40:21 2007 Tanaka Akira <akr@fsij.org>
-
- * include/ruby/oniguruma.h (ONIGENC_CONSTRUCT_MBCLEN_NEEDMORE):
- parenthesize an argument.
-
-Tue Dec 11 02:23:32 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (rb_method_missing): RDoc update patch from Hugh Sasse
- <hgs AT dmu.ac.uk>. [ruby-core:12932]
-
-Tue Dec 11 01:51:34 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/net/http.rb (Net::HTTP::get): now supports gzip
- content-encoding. a patch from Hugh Sasse <hgs AT dmu.ac.uk>.
- [ruby-core:13451]
-
-Tue Dec 11 01:21:21 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * parse.y (shadowing_lvar_gen): no duplicate error for "_".
-
-Mon Dec 10 22:08:47 2007 Akinori MUSHA <knu@iDaemons.org>
-
- * array.c (rb_ary_slice_bang): If an invalid range is given, do
- not raise an exception but return nil just like slice() does.
+ * test/ruby/test_array.rb (TestArray::test_slice,
+ TestArray::test_slice!): Pull in test cases from trunk.
Mon Dec 10 21:47:53 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
@@ -32538,412 +3175,47 @@ Mon Dec 10 21:00:30 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
of range. a patch from Akinori MUSHA <knu AT iDaemons.org>.
[ruby-dev:32518]
-Mon Dec 10 19:02:52 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * re.c (rb_reg_match): should calculate offset by converted
- operand. [ruby-cvs:21416]
-
Mon Dec 10 18:28:06 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
* lib/uri/common.rb (URI::REGEXP::PATTERN): typo in REG_NAME
regular expression. a patch from Ueda Satoshi
<s-ueda AT livedoor.jp>. [ruby-dev:32514]
-Mon Dec 10 17:46:04 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * string.c (rb_str_tmp_new): creates hidden temporary buffer.
-
- * transcode.c (transcoding): added a pointer to function to flush.
-
- * transcode.c (transcode_loop): do not use string internal.
- [ruby-dev:32512]
-
- * transcode.c (str_transcode): allow Encoding objects.
-
- * transcode_data.h (BYTE_LOOKUP): use actual struct name.
-
-Mon Dec 10 16:52:17 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * string.c (rb_str_insert): should not add length in bytes to index in
- chars.
-
-Mon Dec 10 14:33:50 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (rb_f_public_send): rename invoke_method to public_send.
- it now invokes public method only no matter how it's called.
-
-Mon Dec 10 14:00:43 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * transcode.c: new file to provide encoding conversion features.
- code contributed by Martin Duerst.
-
-Mon Dec 10 13:50:33 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * re.c (rb_reg_search): return byte offset. [ruby-dev:32452]
-
- * re.c (rb_reg_match, rb_reg_match2, rb_reg_match_m): convert byte
- offset to char index.
-
- * string.c (rb_str_index): return byte offset. [ruby-dev:32472]
-
- * string.c (rb_str_split_m): calculate in byte offset.
-
-Mon Dec 10 09:56:29 2007 Koichi Sasada <ko1@atdot.net>
-
- * benchmark/bm_vm1_neq.rb, bm_vm1_not.rb: added.
-
-Mon Dec 10 07:48:14 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * parse.y (parser_yylex): wrong token was generated. [ruby-dev:32498]
-
- * object.c (rb_obj_not_match): wrong test.
-
-Mon Dec 10 06:44:47 2007 Tanaka Akira <akr@fsij.org>
-
- * re.c (rb_reg_expr_str): use \xHH instead of \OOO.
-
- * regerror.c (to_ascii): ditto.
- (onig_snprintf_with_pattern): ditto.
- (onig_snprintf_with_pattern): ditto.
-
- * string.c (rb_str_inspect): ditto.
- (rb_str_dump): ditto.
-
- * parse.y (parser_yylex): ditto.
-
- * ruby.c (proc_options): ditto.
-
- * file.c (rb_f_test): ditto.
-
- [ruby-dev:32495]
-
-Mon Dec 10 06:41:00 2007 Tanaka Akira <akr@fsij.org>
-
- * re.c (rb_reg_names): new method Regexp#names.
- (rb_reg_named_captures): new method Regexp#named_captures
- (match_regexp): new method MatchData#regexp.
- (match_names): new method MatchData#names.
-
- * lib/pp.rb (MatchData#pretty_print): show names of named captures.
-
- [ruby-dev:32493]
-
-Mon Dec 10 01:35:06 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * parse.y (expr): redefinable not (!) operator.
-
- * parse.y (arg): ditto.
-
- * object.c (rb_obj_not): new method "!".
-
- * object.c (rb_obj_not_equal): new method "!=".
-
- * object.c (rb_obj_not_match): new method "!~".
-
-Sun Dec 9 22:31:36 2007 Tanaka Akira <akr@fsij.org>
-
- * re.c (rb_reg_s_last_match): accept named capture's name.
-
-Sun Dec 9 15:57:53 2007 Tanaka Akira <akr@fsij.org>
-
- * re.c (match_backref_number): new function for converting a backref
- name/number to an integer.
- (match_offset): use match_backref_number.
- (match_begin): ditto.
- (match_end): ditto.
- (name_to_backref_number): raise IndexError instead of RuntimeError.
- (match_inspect): show capture index.
-
-Sun Dec 9 14:59:15 2007 Koichi Sasada <ko1@atdot.net>
-
- * eval_intern.h (CHECK_STACK_OVERFLOW): reserve frame size.
- [ruby-dev:32485]
-
-Sun Dec 9 14:38:25 2007 Koichi Sasada <ko1@atdot.net>
-
- * vm.c (rb_thread_mark): use rb_gc_mark_maybe() for
- VM stack specified by mark_stack_len. [ruby-dev:32462]
-
- * insnhelper.ci: clear vm stack extended by opt value.
-
-Sun Dec 9 14:08:47 2007 Tanaka Akira <akr@fsij.org>
-
- * include/ruby/ruby.h (FilePathStringValue): defined. similar to
- FilePathValue but no taint check.
-
- * file.c (rb_get_path_no_checksafe): implementation of
- FilePathStringValue.
- (rb_file_s_basename): use FilePathStringValue.
- (rb_file_s_dirname): ditto.
- (rb_file_s_extname): ditto.
- (rb_file_s_split): ditto.
- (rb_file_join): ditto.
-
- * dir.c (file_s_fnmatch): ditto.
-
-Sun Dec 9 12:49:34 2007 Tanaka Akira <akr@fsij.org>
-
- * re.c (append_utf8): check unicode range.
-
Sun Dec 9 12:39:01 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/cgi.rb (read_multipart): exclude blanks from header values.
[ruby-list:44327]
-Sun Dec 9 12:18:19 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * file.c (rb_get_path): use the original object if to_path method is
- not defined. [ruby-dev:32473]
-
- * io.c (rb_f_open): call to_open on non-string objects, instead of
- to_str. [ruby-dev:32473]
-
-Sun Dec 9 12:12:23 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * string.c (tr_find): returns true if no characters to be removed is
- specified.
-
-Sun Dec 9 12:03:16 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (parser_magic_comment): delimits with a semicolon.
-
-Sun Dec 9 11:29:23 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * string.c (tr_trans): get rid of segfaults when has multibytes but
- source sets have no multibytes.
-
-Sun Dec 9 04:01:28 2007 Tanaka Akira <akr@fsij.org>
-
- * encoding.c (rb_enc_mbclen): return 1 if underlying implementation
- returns a length longer than e-p.
- (rb_enc_precise_mbclen): return needmore if underlying
- implementation returns a length longer than e-p.
-
-Sat Dec 8 17:59:40 2007 Tanaka Akira <akr@fsij.org>
-
- * signal.c (posix_signal): return value.
-
-Sat Dec 8 17:22:16 2007 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * test/openssl/test_pkcs7.rb: Remove redundant module namespace.
-
-Sat Dec 8 17:07:10 2007 Tanaka Akira <akr@fsij.org>
-
- * ruby.c (proc_options): make rb_raise format as a string literal to
- avoid warning.
-
-Sat Dec 8 16:18:16 2007 Tanaka Akira <akr@fsij.org>
-
- * re.c (rb_reg_check_preprocess): new function for validating regexp
- fragment.
-
- * parse.y (regexp): invoke reg_fragment_check.
- (reg_fragment_check): defined.
- (reg_fragment_check_gen): defined.
-
-Sat Dec 8 11:06:29 2007 Tanaka Akira <akr@fsij.org>
-
- * encoding.c (rb_enc_mbclen): make it never fail.
- (rb_enc_nth): don't check the return value of rb_enc_mbclen.
- (rb_enc_strlen): ditto.
- (rb_enc_precise_mbclen): return needmore(1) if e <= p.
- (rb_enc_get_ascii): new function for extracting ASCII character.
-
- * include/ruby/encoding.h (rb_enc_get_ascii): declared.
-
- * include/ruby/regex.h (ismbchar): removed.
-
- * re.c (rb_reg_expr_str): use rb_enc_get_ascii.
- (unescape_escaped_nonascii): use rb_enc_precise_mbclen to determine
- the termination of escaped non-ASCII character.
- (unescape_nonascii): use rb_enc_precise_mbclen.
- (rb_reg_quote): use rb_enc_get_ascii.
- (rb_reg_regsub): use rb_enc_get_ascii.
-
- * string.c (rb_str_reverse) don't check the return value of
- rb_enc_mbclen.
- (rb_str_split_m): don't call rb_enc_mbclen with e <= p.
-
- * parse.y (is_identchar): use ISASCII.
- (parser_ismbchar): removed.
- (parser_precise_mbclen): new macro.
- (parser_isascii): new macro.
- (parser_tokadd_mbchar): use parser_precise_mbclen to check invalid
- character precisely.
- (parser_tokadd_string): use parser_isascii.
- (parser_yylex): ditto.
- (is_special_global_name): don't call is_identchar with e <= p.
- (rb_enc_symname_p): ditto.
-
- [ruby-dev:32455]
-
- * ext/tk/sample/tkextlib/vu/canvSticker2.rb: remove coding cookie
- because the encoding is not UTF-8. [ruby-dev:32475]
-
-Fri Dec 7 20:21:35 2007 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * ext/openssl/lib/net/ftptls.rb, ext/openssl/lib/net/telnets.rb:
- half-finished libraries are discontinued.
-
-Fri Dec 7 15:44:40 2007 Tanaka Akira <akr@fsij.org>
-
- * lib/pp.rb: use Hash for recursion check as inspect.
-
-Fri Dec 7 15:04:01 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * array.c (flatten): some performance improvements, based on a patch
- from Yusuke ENDOH <mame AT tsg.ne.jp> in [ruby-core:13877].
- [ruby-core:13851]
-
- * thread.c (rb_exec_recursive): use Hash instead of Array for
- performance improvement. [ruby-core:13898]
-
- * thread.c (recursive_pop): use object ID.
-
-Thu Dec 6 19:52:50 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * parse.y (arg): typo fixed ("!" -> "|") in the ripper code.
-
-Thu Dec 6 19:48:41 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
+Wed Dec 5 23:38:50 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * parse.y (arg): tUPLUS no longer works as identity operation any
- more. inspired by [ruby-talk:265532].
+ * range.c (range_each): followed step_i change.
-Thu Dec 6 18:22:11 2007 Tanaka Akira <akr@fsij.org>
+Wed Dec 5 18:08:45 2007 Tanaka Akira <akr@fsij.org>
- * encoding.c (rb_enc_precise_mbclen): new function for mbclen with
- validation.
-
- * include/ruby/encoding.h (rb_enc_precise_mbclen): declared.
- (MBCLEN_CHARFOUND): new macro.
- (MBCLEN_INVALID): new macro.
- (MBCLEN_NEEDMORE): new macro.
-
- * include/ruby/oniguruma.h (OnigEncodingTypeST): replace mbc_enc_len
- by precise_mbc_enc_len.
- (ONIGENC_PRECISE_MBC_ENC_LEN): new macro.
- (ONIGENC_CONSTRUCT_MBCLEN_CHARFOUND): new macro.
- (ONIGENC_CONSTRUCT_MBCLEN_INVALID): new macro.
- (ONIGENC_CONSTRUCT_MBCLEN_NEEDMORE): new macro.
- (ONIGENC_MBCLEN_CHARFOUND): new macro.
- (ONIGENC_MBCLEN_INVALID): new macro.
- (ONIGENC_MBCLEN_NEEDMORE): new macro.
- (ONIGENC_MBC_ENC_LEN): use ONIGENC_PRECISE_MBC_ENC_LEN.
-
- * enc/euc_jp.c: validation implemented.
-
- * enc/sjis.c: ditto.
-
- * enc/utf8.c: ditto.
-
- * string.c (rb_str_inspect): use rb_enc_precise_mbclen for invalid
- encoding.
- (rb_str_valid_encoding_p): new method String#valid_encoding?.
-
- * io.c (rb_io_getc): use rb_enc_precise_mbclen.
-
- [ruby-dev:32438]
-
-Thu Dec 6 01:37:23 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * regparse.c (i_apply_case_fold): fix for negative character class. a
- patch from Yusuke ENDOH <mame AT tsg.ne.jp> in [ruby-core:13884].
-
-Thu Dec 6 01:00:38 2007 NARUSE, Yui <naruse@ruby-lang.org>
-
- * ext/iconv/iconv.c (iconv_s_list): support NetBSD/Citrus iconv.
-
-Wed Dec 5 16:18:50 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * proc.c (rb_proc_s_new): call initialize. [ruby-core:13824]
-
- * proc.c (rb_proc_location): return file name and line number where
- the proc is defined.
-
- * thread.c (thread_s_new): call initialize. [ruby-core:13835]
-
- * thread.c (thread_initialize): split initialize method.
-
-Wed Dec 5 15:25:55 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (rb_intern3): fix to changing encoding to default, and
- uncommented r13835, which is rare but not impossible.
+ * numeric.c (int_odd_p): new method Integer#odd?.
+ (int_even_p): new method Integer#even?.
+ (int_pred): new method Integer#pred.
+ (fix_odd_p): new method Fixnum#odd?.
+ (fix_even_p): new method Fixnum#even?.
Wed Dec 5 15:15:21 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* range.c (step_i, range_step): support non-fixnum steps.
[ruby-talk:282100]
-Wed Dec 5 14:25:11 2007 Koichi Sasada <ko1@atdot.net>
-
- * compile.c (iseq_compile_each): fix typo.
-
-Wed Dec 5 13:41:25 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (yycompile): get rid of tracing while parsing.
- [ruby-dev:31351]
-
- * thread.c (ruby_suppress_tracing): added a new parameter, which
- directs to call func always.
-
-Tue Dec 4 19:56:42 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/iconv/iconv.c (iconv_convert): should not set encoding unless
- the target encoding is supported. [ruby-dev:32451]
-
-Tue Dec 4 17:34:17 2007 NARUSE, Yui <naruse@ruby-lang.org>
-
- * ext/nkf/lib/kconv.rb (tojis, tosjis, toeuc, toutf8):
- set encoding. [ruby-dev:32447]
-
-Tue Dec 4 17:07:25 2007 NARUSE, Yui <naruse@ruby-lang.org>
-
- * lib/json.rb, lib/json/*: moved to ext/json/lib.
-
-Tue Dec 4 16:34:46 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/iconv/iconv.c (iconv_create): achieve target encoding.
-
- * ext/iconv/iconv.c (iconv_convert, iconv_finish, iconv_iconv,
- iconv_conv): set result string encoding. [ruby-dev:32446]
-
- * ext/iconv/iconv.c (iconv_initialize, iconv_s_open): set encoding to
- Iconv instance.
-
-Tue Dec 4 14:34:35 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ruby.c (process_options): reverted c flag.
-
Tue Dec 4 11:23:50 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * bignum.c (rb_cstr_to_inum): trailing spaces may exist at squeezing
- preceding 0s. [ruby-core:13873]
-
-Mon Dec 3 11:51:53 2007 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * ext/Win32API/*: removed or moved to ext/dl/win32.
-
- * ext/dl/win32/*: new. [ruby-dev:32387]
-
-Sun Dec 2 22:08:01 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * bignum.c (rb_cstr_to_inum): trailing spaces may exist at sqeezing
+ preceeding 0s. [ruby-core:13873]
- * parse.y (parser_tokadd_mbchar): fix for ASCII chars. [ruby-dev:32432]
+Sun Dec 2 22:43:45 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * parse.y (parser_parse_string, parser_here_document): prevent false
- error messages.
+ * eval.c (error_print): put newline unless multiple line message ends
+ with a newline. [ruby-dev:32429]
-Sun Dec 2 20:43:22 2007 Tanaka Akira <akr@fsij.org>
+Sun Dec 2 15:49:20 2007 Kouhei Sutou <kou@cozmixng.org>
- * re.c (unescape_escaped_nonascii): fix mbclen argument.
-
-Sun Dec 2 15:47:57 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (parser_tokadd_mbchar): check insufficient multibyte char.
- [ruby-dev:32429]
-
-Sun Dec 2 15:42:16 2007 Kouhei Sutou <kou@cozmixng.org>
-
- * lib/rss/rss.rb, test/rss/test_version.rb: 0.2.1 -> 0.2.2.
+ * lib/rss/rss.rb, test/rss/test_version.rb, NEWS: 0.2.1 -> 0.2.2.
* lib/rss/maker/itunes.rb: fixed new_itunes_category.
* lib/rss/maker/taxonomy.rb: new_taxo_topic -> new_topic because
@@ -32952,160 +3224,41 @@ Sun Dec 2 15:42:16 2007 Kouhei Sutou <kou@cozmixng.org>
* test/rss/test_maker_itunes.rb, test/rss/test_itunes.rb: removed
needless UTF-8 characters.
-Sun Dec 2 15:18:37 2007 Koichi Sasada <ko1@atdot.net>
-
- * insnhelper.ci (vm_callee_setup_arg): fix error message.
- [ruby-dev:32430]
-
-Sun Dec 2 09:12:48 2007 Tanaka Akira <akr@fsij.org>
-
- * parse.y (regexp): fix /#{}\xa1\xa2/e to be EUC-JP.
- (reg_fragment_setenc_gen): extracted from reg_compile_gen.
-
-Sun Dec 2 01:39:51 2007 Tanaka Akira <akr@fsij.org>
-
- * include/ruby/intern.h (rb_uv_to_utf8): declared.
-
- * re.c (rb_reg_preprocess): new function for dynamic regexp with
- \u{} such as Regexp.new("\\u{6666}").
- (rb_reg_prepare_re): preprocess regexp for recompiling.
- (read_escaped_byte): new function.
- (unescape_escaped_nonascii): new function.
- (append_utf8): new function.
- (unescape_unicode_list): new function.
- (unescape_unicode_bmp): new function.
- (unescape_nonascii): new function.
- (rb_reg_initialize): preprocess regexp.
-
- * pack.c (rb_uv_to_utf8): renamed from uv_to_utf8.
+Sun Dec 2 01:12:15 2007 James Edward Gray II <jeg2@ruby-lang.org>
- * parse.y (STR_NEW3): take func instead of has8 and hasmb.
- (parser_str_new): use default coderange mechanism except for regexp.
- (parser_tokadd_utf8): copy regexp source as-is.
- (parser_read_escape): UTF-8 stuff removed.
- (parser_tokadd_escape): has8bit and hasmb removed.
- (parser_tokadd_string): fix 8-bit single byte character with \u.
- (parser_parse_string): has8bit and hasmb removed.
- (parser_here_document): has8bit and hasmb removed.
- (parser_yylex): call parser_tokadd_utf8 instead of read_escape for
- UTF-8 character.
-
-Wed Dec 2 01:00:07 2007 James Edward Gray II <jeg2@ruby-lang.org>
+ Merged 14070 from trunk.
* lib/xmlrpc/server.rb (XMLRPC::Server#server): Improve signal handling so
pressing control-c in the controlling terminal or sending SIGTERM stops
the XML-RPC server.
-Sat Dec 1 23:04:42 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * encoding.c: rename primary_encoding -> default_external (encoding).
-
-Sat Dec 1 19:52:57 2007 Tadayoshi Funaba <tadf@dotrb.org>
-
- * lib/date.rb (Time#to_datetime): use nsec instead of usec.
-
- * lib/date.rb (DateTime#to_time): second minute as an argument to
- Time::utc contains fractional part in rational; hence Time
- object may keep resolution at most nanosecond.
-
-Sat Dec 1 14:36:05 2007 Koichi Sasada <ko1@atdot.net>
-
- * bootstraptest/test_knownbug.rb: move fixed bugs.
-
- * test/ruby/test_sprintf.rb: ditto.
-
- * test/yaml/test_yaml.rb: ditto.
-
-Sat Dec 1 13:24:47 2007 Koichi Sasada <ko1@atdot.net>
-
- * insnhelper.ci (vm_yield_with_cfunc): fix to passing argc on third
- parameter of IFUNC. [ruby-dev:32329]
-
- * enumerator.c: fix to pass exact number of argument.
-
- * eval.c (rb_yield_values2): added.
-
- * include/ruby/ruby.h: ditto.
-
- * bootstraptest/test_knownbug.rb: move a fixed test.
-
- * bootstraptest/test_block.rb: ditto.
-
-Sat Dec 1 10:45:56 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * io.c (rb_f_open): use to_open for every non-string object. path
- object may use method_missing.
-
-Sat Dec 1 09:44:32 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * insns.def (concatarray, splatarray): use to_a instead of
- to_splat.
-
- * insnhelper.ci (caller_setup_args): ditto.
-
-Sat Dec 1 03:34:32 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (newline_node): always remove NODE_BEGIN.
-
-Fri Nov 30 23:48:07 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * signal.c (ruby_signal): use SA_SIGINFO if available.
- [ ruby-Patches-6418 ]
-
-Fri Nov 30 22:52:54 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * signal.c (trap_signm): SIGVTALRM no longer used for green
- thread. [ruby-talk:281318]
-
- * signal.c (ruby_sig_finalize): do not install SIG_DFL handler if
- previous handler is sighandler().
-
-Fri Nov 30 21:02:15 2007 NARUSE, Yui <naruse@ruby-lang.org>
-
- * lib/json.rb, lib/json/add/{core.rb, rails.rb},
- test/json/test_json_rails.rb: additional files of JSON 1.1.2.
- [ruby-dev:32405]
-
-Fri Nov 30 19:33:38 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
+Sat Dec 1 15:13:33 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
- * ext/syck/rubyext.c (rb_syck_mktime): avoid segmentation fault.
- [ruby-core:13735]
+ * lib/resolv.rb: documentation update. backported from 1.9.
+ [ruby-core:13273]
-Fri Nov 30 19:05:55 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
+Sat Dec 1 03:30:47 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * enum.c (enum_count): precise argument number check.
+ * parse.y (newline_node): set line from outermost node before removing
+ NODE_BEGIN. [ruby-dev:32406]
- * enum.c (enum_count): return Enumerator if no block given.
+Fri Nov 30 21:53:28 2007 Kouhei Sutou <kou@cozmixng.org>
-Fri Nov 30 16:42:50 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * lib/rss/rss.rb, test/rss/test_version.rb: 0.2.0 -> 0.2.1.
- * enum.c (enum_take_while): returns Enumerator if no block given.
+ * lib/rss/content.rb, lib/rss/content/1.0.rb,
+ lib/rss/content/2.0.rb, lib/rss/maker/content.rb,
+ test/rss/rss-testcase.rb, test/rss/test_content.rb,
+ test/rss/test_maker_content.rb: supported content:encoded with RSS
+ 2.0.
+ Suggested by Sam Lown. Thanks.
- * enum.c (enum_drop_while): ditto.
+ * NEWS: added the above changes.
Thu Nov 29 16:59:10 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* parse.y (stmt): remove unnecessary NODE_BEGIN. [ruby-core:13814]
-Thu Nov 29 06:45:48 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * hash.c (rb_hash_eql): recursive comparison should be based on
- eql? [ruby-core:13803]
-
-Wed Nov 28 18:08:00 2007 NARUSE, Yui <naruse@ruby-lang.org>
-
- * ext/json, lib/json, test/json: Update to JSON 1.1.2.
- (RubyForge#15447)
-
- * math.c: fix typo.
-
-Wed Nov 28 16:29:35 2007 Koichi Sasada <ko1@atdot.net>
-
- * insnhelper.ci (vm_invoke_block): should splat args.
- [ruby-dev:32392]
-
- * test/ruby/test_yield.rb: add tests for above.
-
Wed Nov 28 14:43:14 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ext/extmk.rb (extract_makefile): use dldflags instead of DLDFLAGS to
@@ -33116,459 +3269,29 @@ Wed Nov 28 14:43:14 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/mkmf.rb (create_makefile): support for extensions which has no
shared object.
-Wed Nov 28 02:42:10 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Nov 28 09:51:42 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * bignum.c (big2str_find_n1): removed extraneous element.
- [ruby-dev:32351], [ruby-dev:32365]
-
- * bignum.c (big2str_find_n1): returns necessary digits now.
+ * bignum.c (rb_big2str0): do not clobber space for sign.
* sprintf.c (remove_sign_bits): extends sign bit first.
-Tue Nov 27 15:53:43 2007 Koichi Sasada <ko1@atdot.net>
-
- * compile.c (iseq_compile_each): "when *[],1" dumps core.
- a patch from Yusuke ENDOH <mame AT tsg.ne.jp>. [ruby-dev:32350]
-
- * bootstraptest/test_syntax.rb: add a test for above.
-
-Tue Nov 27 15:40:05 2007 Koichi Sasada <ko1@atdot.net>
-
- * compile.c (iseq_compile_each): "a[*b] += 1" dumps core.
- a patch from Yusuke ENDOH <mame AT tsg.ne.jp>. [ruby-dev:32354]
-
- * bootstraptest/test_syntax.rb: add a test for above.
-
-Tue Nov 27 12:47:23 2007 Koichi Sasada <ko1@atdot.net>
-
- * compile.c, insns.def: change return value of "defined?"
- for $&, $1, ... . If such variables are defined,
- return "global-variable".
-
- * test/ruby/test_defined.rb: add tests.
-
- * bootstraptest/test_syntax.rb: fix a test.
-
-Tue Nov 27 11:54:46 2007 Koichi Sasada <ko1@atdot.net>
-
- * insns.def: fix typo.
-
-Tue Nov 27 11:23:20 2007 Koichi Sasada <ko1@atdot.net>
-
- * test_beginendblock.rb: add loop to wait signal.
- [ruby-dev:32332]
-
-Tue Nov 27 11:14:57 2007 Tanaka Akira <akr@fsij.org>
-
- * include/ruby/encoding.h, encoding.c, re.c, string.c, parse.y:
- rename ENC_CODERANGE_SINGLE to ENC_CODERANGE_7BIT.
- rename ENC_CODERANGE_MULTI to ENC_CODERANGE_8BIT.
- Because single byte 8bit character, such as Shift_JIS 1byte katakana,
- is represented by ENC_CODERANGE_MULTI even if it is not multi byte.
-
-Tue Nov 27 10:45:45 2007 Koichi Sasada <ko1@atdot.net>
-
- * eval.c (rb_method_missing): fix stack trace.
-
- * bootstraptest/test_knownbug.rb: move solved tests.
-
- * bootstraptest/test_method.rb, test/ruby/test_regexp.rb: ditto.
-
-Tue Nov 27 09:57:42 2007 Koichi Sasada <ko1@atdot.net>
-
- * insns.def, compile.c: fix to allow dsym for alias/undef.
- [ruby-dev:32355]
-
- * bootstraptest/test_method.rb: add tests for above.
-
-Mon Nov 26 23:18:46 2007 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
-
- * lib/drb/extserv.rb (initialize, stop_service): synchronize with
- ExtServManager.
-
- * test/drb/test_drb.rb (TestDRbEval): ignored.
-
-Mon Nov 26 17:32:16 2007 Tanaka Akira <akr@fsij.org>
-
- * re.c (Init_Regexp): new method Regexp#fixed_encoding?
- [ruby-dev:32361]
-
-Mon Nov 26 13:28:14 2007 Keiju Ishitsuka <keiju@ruby-lang.org>
-
- * lib/complex.rb: be able to create Complex(0, -0.0). [ruby-list:44268]
-
-Mon Nov 26 11:24:04 2007 Tanaka Akira <akr@fsij.org>
-
- * re.c (rb_reg_fixed_encoding_p): extracted from rb_reg_prepare_re and
- rb_reg_s_union.
- (rb_reg_s_union): refactored.
-
-Mon Nov 26 10:44:20 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * io.c (rb_read_internal, rb_sysopen_internal): remove C99 dependency.
-
-Sun Nov 25 22:21:35 2007 Tanaka Akira <akr@fsij.org>
-
- * include/ruby/encoding.h (rb_enc_str_asciionly_p): declared.
- (rb_enc_str_asciicompat_p): defined.
-
- * re.c (rb_reg_initialize_str): use rb_enc_str_asciionly_p.
- (rb_reg_quote): return ascii-8bit string if the argument is
- ascii-only to generate encoding generic regexp if possible.
- (rb_reg_s_union): fix encoding handling. [ruby-dev:32094]
-
- * string.c (rb_enc_str_asciionly_p): defined.
-
-Sun Nov 25 12:12:03 2007 Eric Hodel <drbrain@segment7.net>
-
- * gem_prelude.rb: Import fast-loading gem_prelude.rb from RubyGems.
-
- * lib/rubygems*: Import RubyGems r1516.
-
-Sat Nov 24 23:25:52 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * test/ruby/test_eval.rb (TestEval::test_instance_eval_cvar):
- updated not to modify class variable of Object class.
-
-Fri Nov 23 17:34:24 2007 Koichi Sasada <ko1@atdot.net>
-
- * io.c: add rb_read_internal() as blocking function.
-
-Fri Nov 23 17:33:39 2007 Koichi Sasada <ko1@atdot.net>
-
- * vm.c: fix comment.
-
-Fri Nov 23 17:26:11 2007 Koichi Sasada <ko1@atdot.net>
-
- * bootstraptest/test_knownbug.rb: move solved tests.
-
- * bootstraptest/test_io.rb, test_marshal.rb, test_objectspace.rb:
- ditto.
-
- * test/ruby/test_integer.rb, test_regexp.rb: ditto.
-
-Fri Nov 23 15:59:04 2007 Tanaka Akira <akr@fsij.org>
-
- * struct.c (rb_struct_alloc_noinit): new function.
- (rb_struct_define_without_accessor): add allocator to the arguments.
-
- * range.c (range_alloc): re-introduced using rb_struct_alloc_noinit.
-
-Fri Nov 23 15:27:43 2007 Tanaka Akira <akr@fsij.org>
-
- * re.c (REG_CASESTATE): unused macro removed.
- (rb_reg_prepare_re): check encoding difference.
- (rb_reg_initialize): check 8bit byte.
-
- * parse.y (parser_tokadd_escape): fix has8bit.
-
- [ruby-dev:32113]
-
-Fri Nov 23 15:16:48 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * variable.c (rb_f_global_variables): variable names should not
- duplicate. [ruby-dev:32344]
-
-Fri Nov 23 13:34:08 2007 Tanaka Akira <akr@fsij.org>
-
- * struct.c (rb_struct_define_without_accessor): new function.
-
- * range.c (range_alloc): removed.
- (Init_Range): use rb_struct_define_without_accessor.
-
- based on [ruby-dev:32327].
-
-Fri Nov 23 11:01:54 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * re.c (match_begin): should return offset by character.
- [ruby-dev:32331]
-
- * re.c (match_end): ditto.
-
- * re.c (rb_reg_search): ditto.
-
-Fri Nov 23 10:44:24 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * compile.c (defined_expr): defined(method(x)) dumped core. a
- patch from Yusuke ENDOH <mame AT tsg.ne.jp>. [ruby-dev:32335]
-
-Wed Nov 21 18:03:49 2007 Koichi Sasada <ko1@atdot.net>
-
- * vm.c: fix to recycle thread data (VM stack).
-
- * thread.c: ditto.
-
- * benchmark/bm_vm3_thread_create_join.rb: add loop count.
-
-Wed Nov 21 18:02:10 2007 Koichi Sasada <ko1@atdot.net>
-
- * benchmark/driver.rb: add path to trunk/lib if driver runner is
- in build directory.
-
-Wed Nov 21 16:39:21 2007 Tanaka Akira <akr@fsij.org>
-
- * test/fileutils/fileasserts.rb (assert_equal_timestamp): new assert
- to test tv_sec only for filestamp resolution portability.
- (assert_same_entry): use assert_same_entry for mtime comparison.
-
-Wed Nov 21 14:55:13 2007 Koichi Sasada <ko1@atdot.net>
-
- * array.c (rb_ary_permutation): add gc guard codes.
-
-Wed Nov 21 11:16:37 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * insnhelper.ci (vm_search_normal_superclass): rename function.
-
- * insnhelper.ci (vm_search_superclass): ditto.
-
- * proc.c (struct METHOD): rename rklass -> rclass.
-
-Wed Nov 21 03:12:50 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * process.c (rb_f_system): returns nil on execution failure.
- [ruby-core:13715]
-
Wed Nov 21 01:04:12 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
* object.c (nil_plus): remove unused function. [ruby-core:13737]
-Tue Nov 20 21:46:46 2007 Tanaka Akira <akr@fsij.org>
-
- * time.c (time_mload): ignore invalid digits in submicro.
-
-Tue Nov 20 20:33:32 2007 Koichi Sasada <ko1@atdot.net>
-
- * include/ruby/ruby.h: rename RFloat#double_value -> float_value.
-
- * numeric.c, parse.y: ditto.
-
-Tue Nov 20 19:36:21 2007 Koichi Sasada <ko1@atdot.net>
-
- * gc.h, vm_core.h: decl of rb_gc_save_machine_context()
- should be at vm_core.h.
-
- * include/ruby/ruby.h, intern.h: remove type rb_thread_t.
-
- * include/ruby/intern.h: change rb_unblock_function_t,
- rb_unblock_function_t.
-
- * file.c, process.c: apply above changes.
-
- * thread.c, thread_pthread.ci, thread_win32.ci: ditto.
-
- * io.c: support blocking open (2). [ruby-core:13614]
-
-Tue Nov 20 17:10:11 2007 Tanaka Akira <akr@fsij.org>
-
- * io.c (rb_io_close_on_exec_p): new method IO#close_on_exec?.
- (rb_io_set_close_on_exec): new method IO#close_on_exec=.
- [ruby-dev:32323]
-
-Tue Nov 20 16:24:31 2007 Tanaka Akira <akr@fsij.org>
-
- * gc.c (gc_mark_children): obj->as.file.fptr may be 0 for T_FILE.
-
-Tue Nov 20 15:09:00 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (parser_read_escape): has8bit flag may be set with control
- escape. [ruby-core:13722]
-
- * parse.y (parser_prepare): set begging after BOM if exists.
- [ruby-core:13718]
-
-Tue Nov 20 14:55:37 2007 Eric Hodel <drbrain@segment7.net>
-
- * lib/rubygems*: Update to RubyGems 0.9.5.
-
-Tue Nov 20 13:00:44 2007 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * include/ruby/win32.h win32/win32.c (rb_w32_pipe_exec): use dual fd
- instead of socketpair when mode is RDWR.
-
- * io.c (pipe_open): pass &write_fd to rb_w32_pipe_exec().
-
- * io.c (popen_redirect): define only when HAVE_FORK.
-
-Tue Nov 20 12:12:04 2007 Tanaka Akira <akr@fsij.org>
-
- * include/ruby/io.h (rb_io_t): add tied_io_for_writing member.
-
- * io.c: use tied_io_for_writing for duplex popen.
-
- * gc.c: mark tied_io_for_writing.
-
- * common.mk: gc.o depends io.h.
-
- [ruby-dev:32205]
-
-Tue Nov 20 11:59:33 2007 Tanaka Akira <akr@fsij.org>
-
- * test/drb/test_drb.rb: rename TestRubyYield to TestDRbRubyYield to
- avoid name crash with test/ruby/test_yield.rb.
- TestRuby18Yield is renamed to TestDRbRuby18Yield too.
-
-Tue Nov 20 03:24:42 2007 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
-
- * lib/drb/extservm.rb: merged from ruby_1_8 branch.
-
- * lib/drb/acl.rb: ditto.
-
- * lib/drb/ssl.rb: ditto.
-
- * lib/drb/unix.rb: ditto.
-
- * lib/drb/drb.rb: ditto.
-
- * lib/drb/observer.rb: ditto.
-
- * lib/drb/invokemethod.rb: ditto.
-
- * test/drb/test_drbssl.rb: ditto.
-
- * test/drb/test_drb.rb: ditto.
-
- * test/drb/drbtest.rb: ditto.
-
- * test/drb/test_drbunix.rb: ditto.
-
-Tue Nov 20 00:52:46 2007 Tanaka Akira <akr@fsij.org>
-
- * test/fileutils/fileasserts.rb (assert_equal_time): show nsec if
- assertion fails but time.to_s equals.
- (assert_same_entry): use assert_equal_time.
-
- * test/fileutils/test_fileutils.rb (test_install): use
- assert_equal_time.
-
-Mon Nov 19 18:46:49 2007 Tanaka Akira <akr@fsij.org>
-
- * file.c (utime_internal): fallback utimensat to utimes.
-
-Mon Nov 19 17:51:27 2007 Tanaka Akira <akr@fsij.org>
-
- * configure.in: check struct timespec, clock_gettime, utimensat,
- struct stat.st_atim,
- struct stat.st_atimespec,
- struct stat.st_atimensec,
- struct stat.st_mtim,
- struct stat.st_mtimespec,
- struct stat.st_mtimensec,
- struct stat.st_ctim,
- struct stat.st_ctimespec,
- struct stat.st_ctimensec.
-
- * include/ruby/missing.h: provide struct timespec if not available.
-
- * time.c: support nanosecond-resolution using struct timespec.
- (time_nsec): new method: Time#nsec and Time#tv_nsec.
-
- * include/ruby/intern.h: provide rb_time_nano_new.
-
- * file.c (utime_internal): use utimensat if available.
- (rb_file_s_utime): refactored.
- (rb_f_test): use stat_atime, stat_mtime, stat_ctime.
- (rb_stat_cmp): check tv_nsec.
- (stat_atimespec): new function.
- (stat_atime): ditto.
- (stat_mtimespec): ditto.
- (stat_mtime): ditto.
- (stat_ctimespec): ditto.
- (stat_ctime): ditto.
- (rb_stat_atime): use stat_atime.
- (rb_file_s_atime): ditto.
- (rb_file_atime): ditto.
- (rb_stat_mtime): use stat_mtime.
- (rb_file_s_mtime): ditto.
- (rb_file_mtime): ditto.
- (rb_file_ctime): use stat_ctime.
- (rb_file_s_ctime): ditto.
- (rb_stat_ctime): ditto.
-
- * variable.c (rb_copy_generic_ivar): clear clone's instance variables
- if obj has no instance variable.
-
- * marshal.c (w_object): dump instance variables of generated string
- for TYPE_USERDEF, even if original object has instance variables.
-
- * lib/time.rb (Time#xmlschema): use nsec instead of usec.
-
- [ruby-dev:32306]
-
-Mon Nov 19 17:48:30 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * object.c (rb_class_superclass): should not raise exception for
- BasicObject. [ruby-Bugs-15668]
-
-Mon Nov 19 16:04:08 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * array.c (rb_ary_permutation): gives all permutations of elements
- if no argument given. a patch from Yusuke ENDOH <mame AT tsg.ne.jp>.
- [ruby-dev:32309]
-
-Mon Nov 19 02:44:07 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * compile.c (iseq_compile_each): alias and undef accept dsyms as well
- as literals. [ruby-dev:32308]
-
-Mon Nov 19 02:31:36 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval_method.ci (rb_add_method): no redefinition warning for undef.
-
-Mon Nov 19 01:53:11 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (parser_read_escape): disallow control and meta modifiers
- for non-ASCII characters. [ruby-core:13685]
-
-Sun Nov 18 20:47:41 2007 Tanaka Akira <akr@fsij.org>
-
- * marshal.c (mark_dump_arg): it may be called after dump_ensure.
-
-Sun Nov 18 18:27:47 2007 Tanaka Akira <akr@fsij.org>
-
- * time.c (time_minus): fix Time.at(2**60+1) - Time.at(2**60).
-
-Sun Nov 18 17:28:49 2007 Tanaka Akira <akr@fsij.org>
-
- * time.c (time_arg): show actual year in 2-3 digits year warning.
- (time_mdump): show actual year in "year too big to marshal" error.
-
Sun Nov 18 14:03:44 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * eval_method.ci (rb_alias): do not call hook functions until
- initialization finishes. [ruby-talk:279538]
+ * eval.c (rb_alias): do not call hook functions until initialization
+ finishes. [ruby-talk:279538]
Sun Nov 18 09:09:48 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/mkmf.rb (String#tr_cpp): make preprocessor identifiers.
-Sun Nov 18 05:19:46 2007 Tanaka Akira <akr@fsij.org>
-
- * lib/mkmf.rb (have_struct_member): define HAVE_type_member.
-
-Sat Nov 17 23:51:29 2007 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+Sat Nov 17 13:58:11 2007 Masaki Suketa <masaki.suketa@nifty.ne.jp>
* ext/win32ole/win32ole.c (ole_invoke): bug fix. [ruby-talk:279100]
-Sat Nov 17 23:21:15 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * parse.y (parser_yylex): should clear parser->tokp as well.
- [ruby-dev:32250]
-
- * parse.y: remove NEED_ASSOC that break test_parser_events.
-
- * parse.y (parser_yylex): should not decrement line numbers at the
- end of file.
-
- * file.c (rb_find_file_ext): search .rb files first through in the
- loadpath.
-
-Fri Nov 16 23:31:18 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * bignum.c (rb_big_odd_p): new method added. a patch from Tadashi
- Saito <shiba AT mail2.accsnet.ne.jp>. [ruby-dev:32305]
-
- * bignum.c (rb_big_even_p): ditto.
-
Fri Nov 16 17:41:34 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ext/iconv/iconv.c (Document-class): moved the simplest example to
@@ -33580,135 +3303,25 @@ Fri Nov 16 17:41:34 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ext/iconv/iconv.c (iconv_iconv): also instance method needs to be
qualified.
-Fri Nov 16 16:26:57 2007 Shugo Maeda <shugo@ruby-lang.org>
-
- * include/ruby/ruby.h: added some declarations for event hooks.
-
- * lib/profile.rb: set VM::InstructionSequence.compile_option.
-
Fri Nov 16 11:16:41 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/yaml/rubytypes.rb (String#is_binary_data?): use Integer#fdiv.
-Fri Nov 16 03:36:01 2007 why the lucky stiff <why@ruby-lang.org>
-
- * ext/syck/rubyext.c: Node#value defined twice.
-
- * lib/yaml/: several method redefinitions causing warnings.
-
-Fri Nov 16 03:01:00 2007 why the lucky stiff <why@ruby-lang.org>
-
- * lib/yaml/types.rb: Likewise, pass self to YAML::quick_emit.
-
-Fri Nov 16 02:51:59 2007 why the lucky stiff <why@ruby-lang.org>
-
- * lib/yaml.rb (quick_emit): use combination of object_id and hash to
- identify repeated object references, since GC will reuse memory of
- objects during output of YAML. [ruby-Bugs-8548] [ruby-Bugs-3698]
-
-Thu Nov 15 19:49:03 2007 NAKAMURA Usaku <usa@ruby-lang.org>
+Thu Nov 15 19:50:46 2007 NAKAMURA Usaku <usa@ruby-lang.org>
* ext/curses/extconf.rb: check macro if cannot find func.
[ruby-list:44224]
-Thu Nov 15 18:04:06 2007 Tanaka Akira <akr@fsij.org>
-
- * tool/compile_prelude.rb: fix TMP_RUBY_PREFIX for relative load path
- environment.
-
-Thu Nov 15 17:28:21 2007 Tanaka Akira <akr@fsij.org>
-
- * tool/compile_prelude.rb: absolute path may not start with a slash.
- pointed by usa.
-
-Thu Nov 15 17:07:54 2007 Tanaka Akira <akr@fsij.org>
-
- * tool/compile_prelude.rb: fix first substitution.
- use constant for prefix.
- pointed by Richard Kilmer.
-
-Thu Nov 15 14:29:56 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * common.mk (prereq): added auto generated sources. [ruby-dev:32280]
-
-Thu Nov 15 12:31:13 2007 Tanaka Akira <akr@fsij.org>
-
- * tool/compile_prelude.rb: use constant for prefix.
-
-Thu Nov 15 12:24:39 2007 Tanaka Akira <akr@fsij.org>
-
- * tool/compile_prelude.rb: use simple template system for source
- code generation.
-
Thu Nov 15 12:19:14 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
* lib/cgi/session.rb (CGI::Session::FileStore::restore): use
lockfile for exclusive locks. a patch from <tommy AT tmtm.org>.
[ruby-dev:32296]
-Thu Nov 15 12:14:53 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * tool/compile_prelude.rb (c_esc): need to escape closing brace.
-
-Thu Nov 15 11:52:16 2007 Tanaka Akira <akr@fsij.org>
-
- * tool/compile_prelude.rb: adjust RbConfig::CONFIG paths relative
- to the installation path.
-
-Thu Nov 15 11:25:20 2007 Tanaka Akira <akr@fsij.org>
-
- * ruby.c (usage): fix typo on --disable-gems option.
- pointed by Richard Kilmer.
-
-Wed Nov 14 16:16:17 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * test/net/http/test_https_proxy.rb
- (HTTPSProxyTest::test_https_proxy_authentication): initialize
- local variable 't' first. [ruby-dev:32253]
-
-Wed Nov 14 15:39:24 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * test/socket/test_socket.rb: update not to use 1.8 assignment to
- external local variable in the block parameters. [ruby-dev:32251]
-
- * test/strscan/test_stringscanner.rb: avoid $KCODE, and use
- String#force_encoding(). [ruby-dev:32251]
-
-Wed Nov 14 14:04:42 2007 Tanaka Akira <akr@fsij.org>
-
- * common.mk, Makefile.in: rename prelude.c to miniprelude.c.
- rename ext_prelude.c to prelude.c
-
- * win32/Makefile.sub: ditto.
-
- * bcc32/Makefile.sub: ditto.
-
-Wed Nov 14 07:09:48 2007 Koichi Sasada <ko1@atdot.net>
-
- * blockinlining.c, compile.c, compile.h, debug.c, debug.h,
- id.c, insnhelper.h, insns.def, thread.c, thread_pthread.ci,
- thread_pthread.h, thread_win32.ci, thread_win32.h, vm.h,
- vm_dump.c, vm_evalbody.ci, vm_opts.h: fix comments and
- copyright year.
-
-Wed Nov 14 07:07:51 2007 Koichi Sasada <ko1@atdot.net>
-
- * tool/makedocs.rb, template/insnstbl.html: removed.
-
-Wed Nov 14 02:50:43 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * common.mk (parse.c): dependency also needs vpath.
-
- * common.mk (node_name.inc, prelude.c): VPATH in nmake does not
- work for targets of explicit rules.
-
-Wed Nov 14 02:11:38 2007 Tanaka Akira <akr@fsij.org>
+Wed Nov 14 01:52:59 2007 Tanaka Akira <akr@fsij.org>
* missing/isinf.c (isinf): don't define if the macro is defined.
- * configure.in: no need to set ac_cv_func_isinf=yes on non-gcc
- solaris.
-
Wed Nov 14 01:34:42 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* numeric.c (round): fallback definition.
@@ -33716,43 +3329,11 @@ Wed Nov 14 01:34:42 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* numeric.c (flo_divmod, flo_round): use round() always.
[ruby-dev:32269]
-Wed Nov 14 00:33:49 2007 Koichi Sasada <ko1@atdot.net>
-
- * include/ruby/ruby.h: introduce 2 macros:
- RFLOAT_VALUE(v), DOUBLE2NUM(dbl).
- Rename RFloat#value -> RFloat#double_value.
- Do not touch RFloat#double_value directly.
-
- * bignum.c, insns.def, marshal.c, math.c, numeric.c, object.c,
- pack.c, parse.y, process.c, random.c, sprintf.c, string.c,
- time.c: apply above changes.
-
- * ext/dl/mkcallback.rb, ext/json/ext/generator/generator.c:
- ditto.
-
-Wed Nov 14 00:15:37 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * tool/ytab.sed: get rid of GNU sed feature. a patch from Laurent
- Sansonetti <laurent.sansonetti AT gmail.com> in [ruby-core:13470].
-
-Tue Nov 13 21:41:39 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * common.mk (parse.c), ext/ripper/depend (ripper.c): process after
- bison with sed. [ruby-dev:32204]
-
- * ruby.c (proc_options): use yydebug in cmdline_options.
-
- * ruby.c (process_options): set yydebug flag of parser.
-
- * parse.y (yydebug): moved into struct parser_params.
+Tue Nov 13 22:02:23 2007 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
- * parse.y (rb_parser_get_yydebug, rb_parser_set_yydebug): parser
- generic methods.
+ * lib/drb/drb.rb: remove Thread.exclusive.
- * */Makefile.sub (parse.c): moved to common.mk.
-
- * tool/ytab.sed: comment out yydebug definition, and substitute
- yyerror with parser_yyerror.
+ * lib/drb/extservm.rb: ditto.
Tue Nov 13 16:33:07 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
@@ -33761,367 +3342,39 @@ Tue Nov 13 16:33:07 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* numeric.c (flo_divmod): work around for platforms have no round().
[ruby-dev:32247]
-Tue Nov 13 15:26:33 2007 Tanaka Akira <akr@fsij.org>
-
- * lex.c.blt: moved from lex.c.
-
- * lex.c.src: copied from keywords. This is the source of lex.c.blt.
-
- * Makefile.in (lex.c): use lex.c.blt if keywords is same as lex.c.src.
-
- * win32/Makefile.sub (lex.c): re-introduce copy rule.
-
- * bcc32/Makefile.sub (lex.c): ditto.
+Tue Nov 13 13:58:51 2007 Tanaka Akira <akr@fsij.org>
- * wince/Makefile.sub (lex.c): ditto.
-
-Tue Nov 13 15:21:52 2007 Koichi Sasada <ko1@atdot.net>
-
- * compile.c (iseq_specialized_instruction): check argc.
-
-Tue Nov 13 14:44:32 2007 why the lucky stiff <why@ruby-lang.org>
-
- * test/yaml/test_yaml.rb: fixed the failing YAML Struct test
- at ko1's request.
+ * numeric.c (numeric.c): Integer#ord implemented. [ruby-dev:32206]
Tue Nov 13 02:57:04 2007 URABE Shyouhei <shyouhei@ice.uec.ac.jp>
* numeric.c (flo_divmod): round to the nearest integer.
[ ruby-Bugs-14540 ]
-Tue Nov 13 00:36:16 2007 Shugo Maeda <shugo@ruby-lang.org>
-
- * test/ruby/test_settracefunc.rb: fixed tests for set_trace_func.
-
-Mon Nov 12 19:47:29 2007 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * thread.c (call_trace_proc): should return value.
-
-Mon Nov 12 19:45:18 2007 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * {bcc,win}32/Makefile.sub (miniruby): use $(COMMONOBJS) and $(DMYEXT)
- instead of $(LIBRUBY_A).
-
-Mon Nov 12 18:32:53 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * {bcc,win}32/Makefile.sub (MINIOBJS): added prelude.$(OBJEXT).
-
-Mon Nov 12 17:13:23 2007 Tanaka Akira <akr@fsij.org>
-
- * Makefile.in, common.mk: add prelude.o to MINIOBJS.
-
Mon Nov 12 16:52:29 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/mkmf.rb (create_makefile): rdoc about srcprefix. a patch from
Daniel Berger <djberg96 AT gmail.com> in [ruby-core:13378].
-Mon Nov 12 16:48:09 2007 Tanaka Akira <akr@fsij.org>
-
- * Makefile.in, common.mk: add ext_prelude.o to OBJS.
-
-Mon Nov 12 13:57:39 2007 Tanaka Akira <akr@fsij.org>
-
- * configure.in (MINIDLNOBJS): removed.
- (MINIOBJS): set to dln.o if dmydln.o is not used.
-
- * Makefile.in (miniruby): use MINIOBJS instead of MINIDLNOBJS.
-
Mon Nov 12 13:53:06 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
* misc/ruby-mode.el (ruby-parse-partial): handle stringified
symbols properly using ruby-forward-string.
-Mon Nov 12 12:17:59 2007 Tanaka Akira <akr@fsij.org>
-
- * configure.in (MINIDLNOBJS): defined.
-
- * Makefile.in (miniruby): use MINIDLNOBJS and COMMONOBJS instead of
- MINIOBJS and OBJS to avoid linking both dmydln.o and dln.o.
-
-Sun Nov 11 20:32:45 2007 Tanaka Akira <akr@fsij.org>
-
- * {win32,wince,bcc32}/Makefile.sub: delete lex.c rule.
-
-Sun Nov 11 19:40:52 2007 Tanaka Akira <akr@fsij.org>
-
- * Makefile.in (lex.c): simplified.
-
-Sun Nov 11 18:31:48 2007 Tanaka Akira <akr@fsij.org>
-
- * Makefile.in (lex.c): touch lex.c if gperf failed but lex.c exists.
- Although this may cause non-updated lex.c,
- svn co may generate keywords newer than lex.c especially on
- a file system which can record fractional mtime such as XFS.
-
-Sun Nov 11 17:32:46 2007 Shugo Maeda <shugo@ruby-lang.org>
-
- * insnhelper.ci (vm_call_method): pass mn->nd_clss to
- vm_call_cfunc() instead of klass.
-
- * vm.c (rb_thread_method_id_and_klass): traverse parent_iseq.
-
- * thread.c (call_trace_proc): use rb_thread_method_id_and_klass().
-
-Sun Nov 11 16:54:25 2007 Tanaka Akira <akr@fsij.org>
-
- * lex.c: renamed from lex.c.blt.
-
- * Makefile.in (lex.c): use find command to check mtime.
-
-Sun Nov 11 05:34:13 2007 Eric Hodel <drbrain@segment7.net>
-
- * bin/gem: Add forgotten gem command.
+Mon Nov 12 12:38:31 2007 Tanaka Akira <akr@fsij.org>
-Sat Nov 10 23:50:31 2007 Tanaka Akira <akr@fsij.org>
-
- * string.c (tr_trans): cast to unsigned char after dereference
- a pointer to a char to avoid SEGV with "\377".tr("a", "b").
- on FreeBSD/amd64.
-
-Sat Nov 10 23:08:53 2007 Tanaka Akira <akr@fsij.org>
-
- * configure.in, common.mk, Makefile.in: don't generate
- libminiruby-static.a.
-
-Sat Nov 10 19:46:54 2007 Tanaka Akira <akr@fsij.org>
-
- * configure.in, common.mk, Makefile.in: generate libminiruby-static.a
- which contains prelude.o for miniruby.
-
-Sat Nov 10 18:10:07 2007 Tanaka Akira <akr@fsij.org>
-
- * gem_prelude.rb: new file for gem libraries. currently empty.
-
- * common.mk: generate ext_prelude.c by prelude.rb and gem_prelude.rb.
- ruby (not miniruby) is linked with ext_prelude.o instead of
- prelude.o.
-
- * inits.c (rb_call_inits): don't call Init_prelude.
-
- * ruby.c: support --disable-gems option.
- (ruby_init_gems): new function to define Gem::Enable and
- invoke Init_prelude.
- (process_options): call ruby_init_gems just after
- ruby_init_loadpath.
-
- * tool/compile_prelude.rb: support multiple files.
-
-Sat Nov 10 17:27:55 2007 Shugo Maeda <shugo@ruby-lang.org>
-
- * thread.c (call_trace_proc): don't call ID2SYM() for ID_ALLOCATOR
- to avoid SEGV.
-
-Sat Nov 10 16:37:07 2007 Eric Hodel <drbrain@segment7.net>
-
- * lib/rubygems: Import RubyGems revision 1493.
-
- * lib/rubygems.rb: ditto.
-
- * lib/ubygems.rb: ditto.
-
- * lib/rbconfig/datadir.rb: ditto.
-
- * test/rubygems: ditto.
-
-Sat Nov 10 16:34:21 2007 Eric Hodel <drbrain@segment7.net>
-
- * lib/soap/property.rb: Don't override Enumerable#inject for 1.9.
-
-Sat Nov 10 14:43:30 2007 David Flanagan <davidflanagan@ruby-lang.org>
-
- * parse.y: use ASCII encoding for string literals that are
- 7-bit clean, fixing regression from my previous patch
-
-Sat Nov 10 13:18:54 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * {bcc32,win32}/Makefile.sub: vendor_ruby support.
-
-Fri Nov 9 23:33:16 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (parser_nextc): added single line read forward buffer.
-
- * parse.y (parser_yylex): adjust line number for fluent interface.
-
-Fri Nov 9 22:04:21 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * vm.h (FRAME_MAGIC_MASK_BITS): bits of FRAME_MAGIC_MASK.
-
- * insnhelper.ci (vm_call_cfunc, vm_cfunc_flags): use shift operations.
-
-Fri Nov 9 21:46:28 2007 Koichi Sasada <ko1@atdot.net>
-
- * eval.c (eval): should be volatile value for GC.
-
-Fri Nov 9 17:48:22 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ruby.c (locale_encoding): guesstimate encoding from environment
- variables. [ruby-core:13315]
-
- * ruby.c (process_options): set primary encoding from environment.
-
-Fri Nov 9 16:51:42 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * io.c (rb_io_each_byte): should update rbuf_off and rbuf_len for
- each iteration. [ruby-dev:31659][ruby-dev:32192]
-
- * variable.c (rb_cvar_set): cvar assignment obey same rule to cvar
- reference. [ruby-dev:32192]
-
-Fri Nov 9 15:52:00 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * encoding.c (enc_check_encoding, rb_set_primary_encoding): ENCODING
- is no longer in FL_USERS flags.
-
-Fri Nov 9 15:20:13 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * string.c (rb_str_squeeze_bang): initialize squeezing table if no
- arguments given.
-
-Fri Nov 9 13:57:50 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * enum.c (each_with_index_i): use rb_yield_values() for
- compatibility with Enumerator#with_index(). a patch from Yusuke
- ENDOH <mame AT tsg.ne.jp>. [ruby-dev:32195]
-
-Fri Nov 9 13:45:05 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * test/ruby/test_iterator.rb (TestIterator::IterTest::each):
- #each_pair is now alias to #each. [ruby-dev:32192]
-
- * test/ruby/test_iterator.rb (TestIterator::test_assoc_yield):
- ditto
-
-Fri Nov 9 12:56:36 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval_load.c (loaded_feature_path): check with type of given feature.
-
-Fri Nov 9 12:43:02 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * test/ruby/test_basicinstructions.rb: updated for new class
- behavior. [ruby-dev:32192]
-
- * encoding.c (enc_name): Encoding should not rely on ENCODING in
- the FL_USERS flags.
-
- * encoding.c (rb_enc_from_encoding): do not call rb_enc_associate
- for encoding itself.
-
- * encoding.c (enc_register_at): ditto.
-
- * marshal.c (r_ivar): do not set real instance variable for
- encoding data associated.
-
-Fri Nov 9 10:43:55 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval.c (send_internal): use self in the previous frame to check for
- protected methods. [ruby-core:13254]
-
- * insnhelper.ci (vm_call_method): send! method has gone.
-
-Fri Nov 9 10:38:13 2007 Koichi Sasada <ko1@atdot.net>
-
- * marshal.c (w_object): should be SPECIAL_CONST_P() instead of
- IMMEDIATE_P().
-
-Fri Nov 9 10:29:21 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval.c (rb_invoke_method): check if invoked in function style.
- [ruby-core:13245]
-
- * insnhelper.ci (vm_call_cfunc, vm_cfunc_flags): stores and returns VM
- calling flags.
-
- * vm.c (rb_vm_cfunc_funcall_p): returns if the current method is
- invoked in function style.
-
-Fri Nov 9 10:10:21 2007 Koichi Sasada <ko1@atdot.net>
-
- * cont.c: add rb_context_t#type.
-
-Fri Nov 9 10:05:54 2007 Koichi Sasada <ko1@atdot.net>
-
- * ruby.c (set_arg0): fix breaking environ bugs.
+ * Makefile.in (lex.c): don't remove lex.c at first.
Fri Nov 9 07:26:04 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
* random.c: update MT URL.[ruby-core:13305].
-Thu Nov 8 17:09:55 2007 David Flanagan <davidflanagan@ruby-lang.org>
-
- * object.c: improve docs for Object.tap
-
- * ChangeLog: fix bogus dates on my previous entries
-
-Thu Nov 8 15:13:56 2007 David Flanagan <davidflanagan@ruby-lang.org>
-
- * parse.y: fix segfault with \x escapes in regexps
- delete unused #if 0 code regions from previous patch
-
-Thu Nov 8 12:12:10 2007 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * parse.y (parser_read_escape): remove C99/gcc-ism.
-
-Thu Nov 8 07:54:22 2007 David Flanagan <davidflanagan@ruby-lang.org>
-
- * parse.y: patch, based on Nobu's, work to support \u escapes
- also modifications for better coderange detection
-
- * test/ruby/test_unicode_escapes.rb: test cases
-
- * test/ruby/test_mixed_unicode_escapes.rb: mixed encoding test cases
-
-Thu Nov 8 07:14:37 2007 David Flanagan <davidflanagan@ruby-lang.org>
-
- * parse.y (rb_intern3): commented out broken code that prevented
- correct interning of multi-byte symbols. Without this patch
- :x==:x is false when x is a multi-byte character.
-
-Thu Nov 8 07:04:31 2007 David Flanagan <davidflanagan@ruby-lang.org>
-
- * string.c (tr_setup_table, tr_trans): fix test failures
- in test/ruby/test_string.rb
-
-Wed Nov 7 15:07:51 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * enum.c (enum_each_with_index): make different arrays at each
- iteration. [ruby-dev:32181]
-
-Wed Nov 7 05:17:24 2007 David Flanagan <davidflanagan@ruby-lang.org>
-
- * eval.c: fix typo in invoke_method documentation
-
-Wed Nov 7 03:52:26 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * array.c (rb_ary_product): core dumped with non array arguments.
- a patch from Yusuke ENDOH <mame AT tsg.ne.jp>. [ruby-dev:32180]
-
Wed Nov 7 03:32:38 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
* lib/rexml/encodings/SHIFT-JIS.rb (REXML::Encoding): place -x for
nkf conversion. a patch from <moonwolf AT moonwolf.com>.
[ruby-dev:32183]
-Wed Nov 7 02:59:49 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * array.c (rb_ary_each_index): should return meaningful value.
-
-Tue Nov 6 16:37:47 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval_load.c (loaded_feature_path): need to expand relative paths.
-
- * eval_load.c (rb_feature_p): check if the feature is loading with
- load path. [ruby-dev:31932]
-
- * eval_load.c (load_lock): check the result of barrier waiting.
-
- * thread.c (rb_barrier_wait): check if owned by the current thread.
-
- * thread.c (rb_barrier_release): ditto.
-
-Mon Nov 5 08:01:22 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (Init_eval): move #send to Kernel module from BasicObject.
-
Mon Nov 5 05:17:04 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/optparse.rb (OptionParser::Switch::summarize): fix for long form
@@ -34135,176 +3388,23 @@ Mon Nov 5 01:20:33 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
reimplement the parser that is simpler than the current one.
since we abandoned the plan, warning no longer required.
-Mon Nov 5 01:02:56 2007 Minero Aoki <aamine@loveruby.net>
-
- * lib/net/http.rb (HTTPHeader#initialize): provide default
- User-Agent to fix 500 error on some corrupted HTTP servers.
- [ruby-core:13135]
-
-Mon Nov 5 00:32:32 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (rb_f_send): allow send/__send__ to call methods of all
- visibility again. we no longer provide __send, __send!.
-
- * eval.c (rb_invoke_method): new method to honor private
- visibility. if it's invoked in a function call style, it calls
- private methods as well (previous 1.9 send behavior).
-
-Mon Nov 5 00:24:24 2007 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/Makefile.sub: vendor_ruby support.
-
- * configure.in (RUBY_LIB): duplicated.
-
-Mon Nov 5 00:01:33 2007 Tanaka Akira <akr@fsij.org>
-
- * re.c (rb_reg_quote): quote \v as well.
-
-Sun Nov 4 23:51:59 2007 Tanaka Akira <akr@fsij.org>
-
- * re.c (rb_reg_initialize_m): use StringValuePtr instead of
- StringValueCStr because \0 exists when Regexp.new("\0").
-
-Sun Nov 4 08:11:19 2007 Tanaka Akira <akr@fsij.org>
-
- * gc.c (count_objects): count TOTAL.
-
-Sun Nov 4 03:58:32 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * string.c (tr_setup_table): use C array for characters that fit
- in a byte to gain performance.
-
- * string.c (rb_str_delete_bang): ditto.
-
- * string.c (rb_str_squeeze_bang): ditto.
-
- * string.c (rb_str_count): ditto.
-
- * string.c (tr_trans): ditto.
-
-Sun Nov 4 00:06:40 2007 Tanaka Akira <akr@fsij.org>
-
- * gc.c (count_objects): ObjectSpace.count_objects implemented.
- [ruby-core:12301]
-
-Sat Nov 3 22:49:37 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * hash.c (rb_hash_each_pair): make Hash#each to be alias to
- Hash#each_pair for compatibility and clarity.
-
- * hash.c (env_each_pair): ditto.
-
-Sat Nov 3 22:41:05 2007 Tanaka Akira <akr@fsij.org>
-
- * configure.in: --with-vendor-hdrdir implemented.
-
- * lib/mkmf.rb: check --vendor argument.
-
- * README.EXT: explain --vendor option for extconf.rb
-
- * README.EXT.ja: ditto.
-
-Sat Nov 3 20:30:48 2007 Tanaka Akira <akr@fsij.org>
-
- * configure.in: --with-vendordir implemented.
-
- * mkconfig.rb: add config to vendorlibdir and vendorarchdir.
-
- * instruby.rb: make vendor library directories.
-
- * ruby.c: insert vendor library directories into load path.
-
-Fri Nov 2 20:55:49 2007 Kouhei Sutou <kou@cozmixng.org>
-
- * lib/rss/content.rb, lib/rss/content/, lib/rss/maker/content.rb,
- test/rss/test_content.rb, test/rss/test_maker_content.rb,
- test/rss/rss-testcase.rb (RSS::TestCase): supported
- content:encoded with RSS 2.0.
- Suggested by Sam Lown. Thanks.
-
-Fri Nov 2 20:47:04 2007 Kouhei Sutou <kou@cozmixng.org>
-
- * lib/rss/rss.rb, test/rss/test_version.rb: 0.2.0 -> 0.2.1.
-
-Thu Nov 1 21:56:45 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * error.c (Init_Exception): make NameError to be subclass of
- StandardError again.
-
- * error.c (Init_Exception): make SecurityError to be subclass of
- Exception, since it's too important to be handled implicitly.
-
-Thu Nov 1 14:51:39 2007 David Flanagan <davidflanagan@ruby-lang.org>
- * enum.c (take_while_i, drop_while_i) add RTEST to handle nil return
-
-Thu Nov 1 02:12:50 2007 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * common.mk (prereq): update the path of prelude.c.
-
- * common.mk (prelude.c): rollback a part of r13675, because it is not
- documented and causes build error.
-
-Thu Nov 1 01:52:23 2007 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * enum.c (enum_drop): fix typo.
-
-Thu Nov 1 01:51:01 2007 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * vm_core.h (ruby_current_thread): RUBY_EXTERN'ed for probeprofiler.
-
-Thu Nov 1 00:46:30 2007 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/configure.bat, setup.mak: now can recognize OS even if
- the ``--target'' option of configure is omitted.
-
- * win32/README.win32: update the descriptions about compiler.
-
-Wed Oct 31 03:13:41 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * enum.c (enum_take_while): separate with-block form.
-
- * enum.c (drop_while_i): ditto.
-
- * enum.c (enum_butfirst): abandon butfirst method. reverted.
-
-Tue Oct 30 10:03:43 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * enum.c (enum_butfirst): add a new method to iterates over
- elements but first n. RDoc need to be updated.
-
- * enumerator.c (Init_Enumerator): remove unnecessary symbol
- initialization.
-
-Mon Oct 29 18:42:17 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (bvar): block-local variable can shadow outer variable.
- [ruby-core:13036]
-
-Mon Oct 29 17:58:16 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * string.c (rb_str_substr): performance improvement. [ruby-dev:31806]
-
-Mon Oct 29 17:20:13 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Nov 2 00:13:51 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
- * encoding.c (rb_enc_replicate): new function to replicate encoding.
-
- * encoding.c (enc_based_encoding): Encoding#base_encoding returns
- based encoding of replica.
-
-Mon Oct 29 17:18:36 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * array.c (rb_ary_assoc): check and convert inner arrays (assocs)
+ using #to_ary.
- * encoding.c (rb_enc_compatible): ASCII encoding is compatible with
- ASCII-compatible encoding, even for non-string objects.
+ * hash.c (rb_hash_s_create): check and convert argument hash
+ using #to_hash.
-Sun Oct 28 21:50:02 2007 Tanaka Akira <akr@fsij.org>
+ * hash.c (rb_hash_s_create): Hash#[] now takes assocs as source of
+ hash conversion.
- * lib/open-uri.rb: :redirect option implemented to disable redirects.
- (OpenURI::HTTPRedirect): new exception class for redirection.
+Thu Nov 1 23:47:43 2007 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
-Fri Oct 26 17:38:13 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/drb/drb.rb (DRbTCPSocket): Improving with multiple network
+ interface.
- * numeric.c (int_chr): take an optional encoding parameter.
- [ruby-core:12816]
+ * test/drb/drbtest.rb: ditto.
Fri Oct 26 17:14:14 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
@@ -34312,344 +3412,107 @@ Fri Oct 26 17:14:14 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* numeric.c (fix_pow): returns infinity for 0**-1. [ruby-dev:32084]
-Fri Oct 26 15:00:52 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * misc/ruby-style.el (ruby-style-{case,label}-indent): adjust for
- labels inside switch block.
+Wed Oct 25 07:18:09 2007 James Edward Gray II <jeg2@ruby-lang.org>
-Fri Oct 26 05:48:57 2007 David Flanagan <davidflanagan@ruby-lang.org>
- * array.c: raise IndexError for negative length in rb_ary_fill
-
-Wed Oct 25 07:12:03 2007 James Edward Gray II <jeg2@ruby-lang.org>
+ Merged 13781 from trunk.
* lib/net/telnet.rb (Net::Telnet#login): Allowing "passphrase" in
addition to "password" for Telnet login prompts. [ruby-Bugs-10746]
-Wed Oct 25 06:34:11 2007 James Edward Gray II <jeg2@ruby-lang.org>
+Wed Oct 25 06:46:21 2007 James Edward Gray II <jeg2@ruby-lang.org>
+
+ Merged 13779 from trunk.
* lib/net/telnet.rb (Net::Telnet#login): Making the password prompt
pattern case insensitive. [ruby-Bugs-10746]
-Fri Oct 26 04:21:36 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/net/pop.rb (Net::POP3::do_start): type fixed. a patch from
- Dan Zwell <dzwell AT zwell.net> in [ruby-core:12941].
-
-Fri Oct 26 01:48:28 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * array.c (rb_ary_assoc): check and convert inner arrays (assocs)
- using #to_ary.
-
- * hash.c (rb_hash_s_create): check and convert argument hash
- using #to_hash.
-
- * hash.c (rb_hash_s_create): Hash#[] now takes assocs as source of
- hash conversion.
-
-Thu Oct 25 16:46:05 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * parse.y (parser_yylex): dot at the head of the line denote line
- continuation from previous one to support fluent interface.
- [experimental]
-
- * misc/ruby-mode.el (ruby-calculate-indent): support fluent dot.
-
Thu Oct 25 14:19:33 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* io.c (rb_io_tell, rb_io_seek): check errno too. [ruby-dev:32093]
-Thu Oct 25 13:59:53 2007 David Flanagan <davidflanagan@ruby-lang.org>
-
- * parse.y (parser_tokspace): increment tokidx
- fixes test failure at [test/ruby/test_stringchar.rb:72]
-
-Thu Oct 25 09:49:49 2007 akira yamada <akira@ruby-lang.org>
-
- * lib/uri.rb, lib/uri/ldaps.rb: added LDAPS
- scheme. [ruby-dev:31896]
+Wed Oct 25 08:03:53 2007 James Edward Gray II <jeg2@ruby-lang.org>
-Wed Oct 25 06:23:14 2007 James Edward Gray II <jeg2@ruby-lang.org>
+ Merged 13767, 13768, 13769, and 13770 from trunk.
* lib/xmlrpc/parser.rb (XMLRPC::Convert::dateTime): Fixing a bug that
caused time zone conversion to fail for some ISO 8601 date formats.
[ruby-Bugs-12677]
-Wed Oct 25 04:59:28 2007 James Edward Gray II <jeg2@ruby-lang.org>
-
* lib/xmlrpc/client.rb (XMLRPC::Client#do_rpc): Explicitly start
the HTTP connection to support keepalive requests. [ruby-Bugs-9353]
-Wed Oct 25 04:46:53 2007 James Edward Gray II <jeg2@ruby-lang.org>
-
* lib/xmlrpc/client.rb (XMLRPC::Client#do_rpc): Improving the error
message for Content-Type check failures. [ruby-core:12163]
-Wed Oct 25 03:45:08 2007 James Edward Gray II <jeg2@ruby-lang.org>
-
* lib/xmlrpc/utils.rb (XMLRPC::ParseContentType#parse_content_type):
Making Content-Type checks case insensitive. [ruby-Bugs-3367]
-Wed Oct 24 17:09:39 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (parser_tokspace): make space in token buffer.
-
- * parse.y (parser_yylex): fix encoding of single character literal.
-
-Tue Oct 23 13:44:14 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (call_args2): nd_head of NODE_BLOCK_PASS should be a list.
- [ruby-core:12850]
-
-Tue Oct 23 10:42:51 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ruby.c (process_options): encoding set by command line option takes
- priority over the encoding in the source, as the primary encoding.
-
-Mon Oct 22 19:24:33 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * ruby.c (proc_options): allow space after -E (encoding) option.
-
-Mon Oct 22 11:03:09 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * encoding.c (enc_check_encoding): returns index now.
-
- * encoding.c (rb_enc_compatible): check if two objects have compatible
- encodings.
-
- * encoding.c (enc_compatible_p): added Encoding.compatible?.
-
- * include/ruby/encoding.h (rb_enc_compatible): prototype.
-
-Sun Oct 21 18:29:17 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * encoding.c (rb_enc_default, rb_enc_primary): return pointers to
- rb_encoding of default and primary respectively. [ruby-core:12795]
-
- * encoding.c (set_primary_encoding): removed primary_encoding setter.
-
-Sat Oct 20 13:17:01 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * enum.c (enum_cycle): hide temporary array from ObjectSpace.
- [ruby-core:12762]
-
-Sat Oct 20 11:49:20 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * file.c (rb_get_path): returns frozen string.
-
- * file.c (rb_file_s_chown, rb_file_s_lchown): use uid_t and gid_t.
-
-Fri Oct 19 20:08:14 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * encoding.c (rb_id_encoding): returns ID "encoding".
-
- * marshal.c (w_encoding): dump encoding name.
-
- * marshal.c (r_ivar): load encoding.
-
-Fri Oct 19 16:41:00 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (parser_regx_options, reg_compile_gen): relaxened encoding
- matching rule.
-
- * re.c (rb_reg_initialize): always set encoding of Regexp.
-
- * re.c (rb_reg_initialize_str): fix encoding for non 7bit-clean
- strings.
-
- * re.c (rb_reg_initialize_m): use ascii encoding for 'n' option.
-
-Fri Oct 19 11:09:56 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ruby.c (process_options): set primary encoding from the parser
- always. [ruby-core:12758]
-
- * ruby.c (load_file): should not discard the parser parameter.
-
-Fri Oct 19 10:55:42 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * range.c (range_last): removed unused variables.
-
-Thu Oct 18 17:08:57 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * enum.c (enum_find_index): update RDoc. a patch from David Flanagan
- <david AT davidflanagan.com> in [ruby-core:12710].
-
- * enum.c (enum_take, enum_drop): ditto.
-
- * enum.c (enum_cycle): should not cause infinite loop for empty
- arrays. [ruby-core:12710]
-
- * range.c (Init_Range): typo fixed.
-
-Thu Oct 18 16:39:34 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/rexml/source.rb (REXML::SourceFactory::SourceFactory): more
- duck typed. better performance on JRuby.
- http://headius.blogspot.com/2007/10/another-performance-discovery-rexml.html
-
-Thu Oct 18 09:33:25 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * range.c (range_first): takes first n element if argument is
- given. [ruby-core:12697]
-
- * range.c (range_last): returns last n elements if argument is
- given.
-
- * array.c (rb_ary_subseq, rb_ary_last): export.
+Sun Oct 21 21:16:43 2007 Kouhei Sutou <kou@cozmixng.org>
-Wed Oct 17 17:39:31 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ruby.c (proc_options): fixed reversed condition. [ruby-core:12722]
-
-Wed Oct 17 13:54:28 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * re.c (rb_reg_s_union): the last check was not complete.
-
-Wed Oct 17 11:30:55 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * encoding.c (rb_enc_from_encoding, rb_enc_register): associate index
- to self.
-
- * encoding.c (enc_capable): Encoding objects are encoding capable.
-
- * re.c (rb_reg_s_union): check if encoding matching by exact encoding
- objects.
-
-Wed Oct 17 06:18:06 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * encoding.c (rb_enc_alias, rb_enc_find_index): changed
- enc_table_alias to a name-to-index hash.
-
- * encoding.c (rb_enc_init): use upper case names for aliases to use as
- constant names.
-
- * encoding.c (enc_find): allow symbols.
-
- * encoding.c (Init_Encoding): define encoding constants.
-
- * st.c (strcasehash): fix wrong code range condition.
-
-Wed Oct 17 05:07:18 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * encoding.c (rb_primary_encoding): added Encoding.primary_encoding.
-
- * parse.y (rb_parser_encoding): added.
-
- * ruby.c (proc_options): added -E and --encoding options.
-
- * ruby.c (process_options): set primary encoding from command line
- option if set, or source encoding.
-
- * include/ruby/encoding.h (rb_enc_from_encoding,
- rb_get_primary_encoding, rb_set_primary_encoding): prototypes.
-
- * include/ruby/node.h (rb_parser_encoding): prototype.
-
-Wed Oct 17 03:37:07 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * re.c (rb_reg_desc): set encoding.
-
- * re.c (rb_reg_s_union): check encodings.
-
- * enc/utf8.c (utf8_code_to_mbclen): 0xfe and 0xff are valid Unicode to
- be encoded to 2bytes in UTF-8. [ruby-core:12700]
-
-Wed Oct 17 02:50:49 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * string.c (rb_str_ord): use encoding.
-
-Wed Oct 17 01:57:06 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * re.c (rb_reg_initialize_m): allow binary encoding option.
- [ruby-dev:32083]
-
-Tue Oct 16 19:48:01 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * re.c (rb_reg_s_union): check for encoding of original object.
-
-Tue Oct 16 18:28:51 2007 Tanaka Akira <akr@fsij.org>
-
- * debug.c: use enum for constants for gdb if possible.
-
-Tue Oct 16 18:20:10 2007 Tanaka Akira <akr@fsij.org>
-
- * ruby.c, debug.c: move debug enum and constants to debug.c.
-
-Tue Oct 16 18:16:15 2007 Tanaka Akira <akr@fsij.org>
-
- * ruby.c (RUBY_ENCODING_SHIFT): added as enum.
-
- * .gdbinit (rp): show encoding and coderange for strings.
-
-Tue Oct 16 14:48:38 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (parser_regx_options): check if regexp encoding option
- matches to current encoding.
-
- * re.c (char_to_option, rb_char_to_option_kcode): 'n' is not kcode
- option now.
-
- * re.c (rb_reg_to_s, rb_reg_error_desc): copy encoding rather than
- append as an option.
-
- * re.c (make_regexp, rb_reg_prepare_re): use encoding of Regexp and
- String instead of kcode.
+ * lib/rss.rb, lib/rss/, test/rss/, sample/rss/: merged from trunk.
+ - 0.1.6 -> 2.0.0.
+ - fixed image module URI. Thanks to Dmitry Borodaenko.
+ - supported Atom.
+ - supported ITunes module.
+ - supported Slash module.
- * re.c (rb_reg_initialize): set fixed option if none is set.
+ * NEWS: added an entry for RSS Parser.
- * re.c (rb_reg_regcomp): ditto.
+Thu Oct 18 10:57:06 2007 Tanaka Akira <akr@fsij.org>
- * re.c (rb_reg_equal): check if encodings are equal.
+ * ruby.h (RCLASS_IV_TBL): defined.
+ (RCLASS_M_TBL): ditto.
+ (RCLASS_SUPER): ditto.
+ (RMODULE_IV_TBL): ditto.
+ (RMODULE_M_TBL): ditto.
+ (RMODULE_SUPER): ditto.
- * re.c (rb_reg_initialize_m): encoding option is obsolete.
+Mon Oct 15 22:08:55 2007 Akinori MUSHA <knu@iDaemons.org>
- * re.c (rb_kcode, rb_get_kcode, rb_set_kcode): removed.
+ * NEWS: Merge some of the sub-sections, as the differences were
+ unclear.
- * re.c (Init_Regexp): removed Regexp#kcode method.
+Mon Oct 15 21:57:07 2007 Akinori MUSHA <knu@iDaemons.org>
- * ruby.c (proc_options): allow long encoding name.
+ * NEWS: Mention ipaddr enhancements.
-Tue Oct 16 14:03:09 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * lib/ipaddr.rb (in_addr, in6_addr, addr_mask): Make some minor
+ code optimization.
- * re.c (rb_reg_s_union): encoding of all regexp objects should
- match. [ruby-dev:32076]
+ * lib/ipaddr.rb (<=>): Implement IPAddr#<=> and make IPAddr
+ comparable.
-Tue Oct 16 13:49:41 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * lib/ipaddr.rb (succ): Implement IPAddr#succ. You can now create
+ a range between two IPAddr's, which (Range) object is
+ enumerable.
- * encoding.c (enc_to_s): rename function.
+ * lib/ipaddr.rb (to_range): A new method to create a Range object
+ for the (network) address.
-Tue Oct 16 13:25:46 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/ipaddr.rb (coerce_other): Support type coercion and make &,
+ |, == and include? accept a string or an integer instead of an
+ IPAddr object as the argument.
- * string.c (rb_str_new4): should copy encoding. a patch from NARUSE,
- Yui <naruse AT airemix.com>. [ruby-dev:32076]
+ * lib/ipaddr.rb (initialize): Give better error messages.
-Tue Oct 16 01:31:23 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * lib/ipaddr.rb: Improve documentation.
- * enum.c (enum_inject): RDoc update. a patch from David Flanagan
- <david AT davidflanagan.com> in [ruby-core:12710].
+Mon Oct 15 21:24:25 2007 Akinori MUSHA <knu@iDaemons.org>
-Tue Oct 16 01:25:40 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * NEWS: Mention shellwords and tempfile enhancements.
- * encoding.c (Init_Encoding): define #to_s to show encoding name
- in to_s representation as well as #inspect.
+ * NEWS: Move the entry about Tk::X_Scrollable to a better section.
-Mon Oct 15 13:24:08 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Oct 15 17:28:20 2007 NAKAMURA Usaku <usa@ruby-lang.org>
- * numeric.c (flo_round): should be number but not rounding factor.
- [ruby-dev:32060]
+ * ext/openssl/lib/openssl/buffering.rb (read, readpartial): revert
+ r12496. handling EOF is a little differnt in ruby 1.8 and ruby 1.9.
+ [ruby-dev:31979]
Mon Oct 15 11:45:12 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* marshal.c (r_bytes0): refined length check. [ruby-dev:32059]
-Mon Oct 15 10:24:19 2007 Tanaka Akira <akr@fsij.org>
-
- * process.c (pst_to_s): returns a string such as "pid 10220 exit 1"
- instead of "256". [ruby-dev:32053]
- (pst_inspect): change format
- "#<Process::Status: pid=10220,exited(1)>" to
- "#<Process::Status: pid 10220 exit 1>".
-
Mon Oct 15 09:58:07 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* marshal.c (r_bytes0): check if source has enough data.
@@ -34660,26 +3523,6 @@ Mon Oct 15 01:15:09 2007 Tanaka Akira <akr@fsij.org>
* ext/socket/socket.c (s_accept_nonblock): make accepted fd
nonblocking. [ruby-talk:274079]
-Sun Oct 14 17:31:48 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * encoding.c (rb_obj_encoding): rdoc update. a patch from David
- Flanagan <david AT davidflanagan.com>. [ruby-core:12664]
-
- * encoding.c (enc_dump, enc_load): marshaling feature. a patch from
- David Flanagan. [ruby-core:12665]
-
- * encoding.c (Init_Encoding): undefine allocator of Encoding.
- [ruby-core:12665], [ruby-core:12666]
-
- * test/ruby/test_encoding.rb: tests for Encoding from David Flanagan
- [ruby-core:12665]
-
-Sun Oct 14 11:09:09 2007 Tanaka Akira <akr@fsij.org>
-
- * lib/pp.rb (PP::PPMethods#pp_hash): don't sort keys because hash is
- ordered.
- (ENV.pretty_print): call pp_hash with sorted hash.
-
Sun Oct 14 04:08:34 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* configure.in (AC_SYS_LARGEFILE): keep results also in command
@@ -34692,789 +3535,98 @@ Sun Oct 14 03:55:52 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* win32/mkexports.rb: deal with __fastcall name decorations.
[ruby-list:44111]
-Sun Oct 14 02:20:40 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * encoding.c (rb_cEncoding): new Encoding class.
-
- * encoding.c (rb_to_encoding, rb_to_encoding_index): helper functions.
-
- * encoding.c (rb_obj_encoding): return Encoding object now.
-
- * gc.c (garbage_collect): mark Encoding objects.
-
- * inits.c (rb_call_inits): call Init_Encoding.
-
- * string.c (rb_str_force_encoding): accept Encoding object as well as
- encoding name.
-
- * include/ruby/encoding.h (rb_to_encoding_index, rb_to_encoding):
- prototypes.
-
-Sun Oct 14 01:03:30 2007 Tanaka Akira <akr@fsij.org>
-
- * lib/open-uri.rb (OpenURI.open_http): fix :ssl_ca_cert option.
-
-Sat Oct 13 21:23:21 2007 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-
- * ext/win32ole/win32ole.c (foletype_s_ole_classes,
- foletype_s_typelibs): refactoring.
-
- * test/win32ole/test_win32ole_type.rb: add some test.
-
- * ext/win32ole/win32ole.c (Init_win32ole): change method name
- WIN32OLE_TYPELIB.ole_types from WIN32OLE_TYPELIB.ole_classes.
-
- * test/win32ole/test_win32ole_typelib.rb: ditto.
-
- * test/win32ole/test_folderitem2_invokeverb.rb: check create
- shortcut string more strictly (This test is invoked in Japanese
- Windows environment).
-
-Sat Oct 13 09:11:58 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (set_file_encoding): case-insensitive search, a patch from
- David Flanagan <david AT davidflanagan.com> [ruby-core:12629]
-
Sat Oct 13 09:02:16 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* {bcc,win}32/mkexports.rb: explicit data. [ruby-list:44108]
-Sat Oct 13 00:17:49 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
+Sat Oct 13 00:35:03 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
- * lib/rexml/document.rb (REXML::Document::write): leaky
- modification trans -> transitive. [ruby-dev:32040]
-
-Sat Oct 13 00:00:33 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * parse.y: encoding specifier should work if the line matches
- /coding[:=] ?/, a la Python PEP-263, so that VIM comments like
- "# vim: set fileencoding=<encoding name>" should be recognized.
-
-Fri Oct 12 15:04:54 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (magic_comments): add "encoding" as same as "coding".
-
- * parse.y (set_file_encoding): special file encoding handling.
-
- * parse.y (parser_yylex): ditto.
-
-Fri Oct 12 12:44:11 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * array.c (rb_ary_combination): fixed memory corruption due to too
- small memory allocation
-
- * array.c (rb_ary_product): accessing out of memory bounds.
- condition fixed.
+ * lib/rexml/source.rb (REXML::SourceFactory::SourceFactory): typo
+ fixed. [ruby-list:44099]
Fri Oct 12 11:22:15 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
* re.c (match_values_at): make #select to be alias to #values_at
to adapt RDoc description. [ruby-core:12588]
-Thu Oct 11 21:10:17 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * include/ruby/node.h (NOEX_LOCAL): remove unused local visibility.
-
- * class.c (ins_methods_push): ditto.
-
- * class.c (rb_class_local_methods): method removed.
-
-Thu Oct 11 14:29:31 2007 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * */Makefile.sub (COMMON_MACROS): workaround for old SDK's bug.
- [ruby-core:12584]
-
-Thu Oct 11 06:35:43 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * Makefile.in, */Makefile.sub (VPATH): add enc directory.
-
- * common.mk (ENCOBJS): encoding objects.
-
- * enc: directory for encodings.
-
-Thu Oct 11 00:04:37 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * include/ruby/oniguruma.h (OnigEncodingTypeST): add OnigEncoding
- parameter to every function members.
-
- * include/ruby/oniguruma.h (OnigEncodingTypeST): add auxiliary
- data member to provide user defined data for an encoding.
+Thu Oct 11 14:32:46 2007 NAKAMURA Usaku <usa@ruby-lang.org>
-Wed Oct 10 23:32:15 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * {bcc32,win32}/Makefile.sub (COMMON_MACROS): workaround for old SDK's
+ bug. [ruby-core:12584]
- * re.c (rb_reg_s_quote): no longer takes optional second argument
- that has never been documented.
+Wed Oct 10 23:34:45 2007 Tanaka Akira <akr@fsij.org>
-Wed Oct 10 15:39:04 2007 Tanaka Akira <akr@fsij.org>
+ * lib/securerandom.rb: new file. [ruby-dev:31928]
- * encoding.c (rb_enc_init): don't alias iso-8859-1 to ascii.
+ * lib/cgi/session.rb (create_new_id): use securerandom if available.
- * ascii.c (OnigEncodingASCII): change the name US-ASCII to ASCII-8BIT.
+Tue Oct 9 01:01:55 2007 Tanaka Akira <akr@fsij.org>
-Wed Oct 10 14:31:05 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * re.c (rb_reg_s_union_m): Regexp.union accepts single
+ argument which is an array of patterns. [ruby-list:44084]
- * string.c (rb_enc_str_coderange): fixed check for non-ascii.
+Mon Oct 8 20:06:23 2007 GOTOU Yuuzou <gotoyuzo@notwork.org>
-Tue Oct 9 21:35:28 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/net/http.rb, lib/open-uri.rb: remove
+ Net::HTTP#enable_post_connection_check. [ruby-dev:31960]
- * array.c (rb_ary_permutation, rb_ary_combination): missing type
- names.
-
- * array.c (rb_ary_permutation): used buffer should be t1.
-
- * array.c (rb_ary_permutation): use frozen shared hidden array.
- [ruby-dev:31985]
-
-Tue Oct 9 16:58:10 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * array.c: remove to_a completely.
-
- * array.c (tmpbuf): keep DRY to clear klass of temporary objects.
-
-Tue Oct 9 16:33:32 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * array.c (rb_ary_permutation, rb_ary_combination, rb_ary_product):
- hide internal buffer objects. [ruby-dev:31982]
-
-Tue Oct 9 16:00:32 2007 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * parse.y (parser_read_escape, parser_tokadd_escape): check code range.
- [ruby-dev:31980]
-
-Tue Oct 9 15:40:24 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (STR_NEW3): check for if single byte sequence.
-
-Mon Oct 8 20:06:29 2007 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * lib/net/imap.rb, lib/net/smtp.rb, lib/net/pop.rb: hostname should
- be verified against server's identity as presented in the server's
- certificate. [ruby-dev:31960]
+ * lib/net/imap.rb: hostname should be verified against server's
+ indentity as persented in the server's certificate. [ruby-dev:31960]
* ext/openssl/lib/net/telnets.rb, ext/openssl/lib/net/ftptls.rb: ditto.
-Sun Oct 7 22:37:47 2007 Kouhei Sutou <kou@cozmixng.org>
-
- * test/rss/test_taxonomy.rb, test/rss/test_parser_1.0.rb,
- test/rss/test_image.rb, test/rss/rss-testcase.rb: ensured
- declaring XML namespaces.
-
-Sun Oct 7 22:00:01 2007 Tanaka Akira <akr@fsij.org>
-
- * include/ruby/node.h: make node flags as VALUE type.
- enum ruby_node_flags removed.
-
- * ruby.c: define RUBY_NODE_* as const for gdb.
-
-Sun Oct 7 18:57:12 2007 Tanaka Akira <akr@fsij.org>
-
- * include/ruby/ruby.h: enum ruby_value_flags removed. [ruby-dev:31959]
-
- * ruby.c: define RUBY_FL_* as const VALUE for gdb.
-
-Sun Oct 7 17:50:14 2007 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * lib/net/http.rb: remove enable_post_connection_check flag.
-
- * lib/open-uri.rb: ditto.
-
-Sun Oct 7 15:48:40 2007 Koichi Sasada <ko1@atdot.net>
-
- * insns.def (opt_eq): fix to use rb_str_equal().
-
Sat Oct 6 23:14:54 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
* string.c (rb_str_to_i): update RDoc since base can be any value
between 2 and 36. [ruby-talk:272879]
-Sat Oct 6 16:24:02 2007 Koichi Sasada <ko1@atdot.net>
-
- * cont.c (cont_free): check Fiber or Continuation.
-
- * bootstraptest/test_knownbug.rb: remove a fixed test.
-
-Sat Oct 6 14:56:02 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * encoding.c (rb_enc_register): returns new index or -1 if failed.
-
- * encoding.c (rb_enc_alias): check if original name is registered.
-
- * encoding.c (rb_enc_init): register in same order as kcode options in
- re.c. added new aliases.
-
- * string.c (rb_str_force_encoding): check if valid encoding name.
-
-Sat Oct 6 14:32:30 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * insns.def (opt_eq): get rid of gcc bug.
-
-Sat Oct 6 02:34:18 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * include/ruby/defines.h: no longer provide DEFAULT_KCODE.
-
-Fri Oct 5 21:24:59 2007 Tanaka Akira <akr@fsij.org>
-
- * re.c (rb_reg_s_union_m): Regexp.union accepts single argument which
- is an array of patterns. [ruby-list:44084]
-
-Fri Oct 5 16:42:27 2007 Tanaka Akira <akr@fsij.org>
-
- * bootstraptest/runner.rb (assert_not_match): new method.
-
-Fri Oct 5 16:15:52 2007 Akinori MUSHA <knu@iDaemons.org>
-
- * configure.in: Turn on --enable-pthread by default for FreeBSD
- 5.2.1-RELEASE and later, and remove pthread support for older
- versions which has never worked perfectly.
-
-Fri Oct 5 16:11:50 2007 Akinori MUSHA <knu@iDaemons.org>
-
- * time.c (time_to_s): Fix documentation. Time format changed.
-
-Fri Oct 5 04:02:39 2007 Akinori MUSHA <knu@iDaemons.org>
-
- * lib/ipaddr.rb (in_addr, in6_addr, addr_mask): Make some minor
- code optimization.
-
-Fri Oct 5 03:25:51 2007 Akinori MUSHA <knu@iDaemons.org>
-
- * lib/ipaddr.rb (<=>): Implement IPAddr#<=> and make IPAddr
- comparable.
-
- * lib/ipaddr.rb (succ): Implement IPAddr#succ. You can now create
- a range between two IPAddr's, which (Range) object is
- enumerable.
-
- * lib/ipaddr.rb (to_range): A new method to create a Range object
- for the (network) address.
-
-Fri Oct 5 03:14:45 2007 Akinori MUSHA <knu@iDaemons.org>
-
- * lib/ipaddr.rb (coerce_other): Support type coercion and make &,
- |, == and include? accept a string or an integer instead of an
- IPAddr object as the argument.
-
- * lib/ipaddr.rb (initialize): Give better error messages.
-
- * lib/ipaddr.rb: Improve documentation.
-
-Thu Oct 4 20:45:53 2007 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * process.c (Init_process): win32 has our own WNOHANG definition, so
- remove unnecessary #ifdef guard.
-
-Thu Oct 4 20:17:19 2007 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * array.c (rb_ary_permutation, rb_ary_product): support non C99
- compilers.
-
-Thu Oct 4 17:33:18 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * re.c (kcode_setter): Perl-ish global variable `$=' no longer
- effective.
-
- * io.c (Init_IO): remove obsolete variables: $defout, $deferr.
-
- * re.c (Init_Regexp): remove obsolete const alias: MatchingData.
-
- * time.c (Init_Time): remove obsolete Time::times.
-
- * re.c (ignorecase_setter): change warning message.
-
- * re.c (ignorecase_getter): now gives warning.
-
- * string.c (rb_str_cmp_m): update RDoc document.
-
- * re.c (kcode_setter): restore erroneously removed setter.
-
-Thu Oct 4 16:28:33 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * encoding.c (rb_obj_encoding): returns encoding of the given object.
-
- * parse.y (reg_compile_gen): copy encoding from source string if
- non-empty.
-
- * re.c (Init_Regexp): new method Regexp#encoding.
-
- * string.c (str_encoding): moved to encoding.c
-
-Thu Oct 4 15:49:33 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * array.c (rb_ary_permutation): remove C99 dependency.
- [ruby-dev:31934]
-
- * array.c (rb_ary_product): ditto.
-
-Wed Oct 3 23:37:17 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * ext/nkf/nkf.c, bin/ri, bin/irb: fixed typos in doc and comments.
- a patch from Eugene Ossintsev <eugoss AT gmail.com>.
- [ruby-core:12375]
-
-Wed Oct 3 17:56:22 2007 Koichi Sasada <ko1@atdot.net>
-
- * benchmark/driver.rb: enable specify label to executable.
- (-e "ruby1::/path/to/ruby1; ruby2::/path/to/ruby2; ...")
-
-Wed Oct 3 16:58:48 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (parser_str_new, parser_yylex, rb_intern3): set code-range
- bits.
-
- * parse.y (parser_tokadd_string): check code-range.
-
- * parse.y (parser_parse_string, parser_here_document): ditto.
-
- * parse.y (parser_set_encode): check if valid encoding.
-
-Wed Oct 3 15:43:15 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * variable.c (rb_cvar_set): check whether class variable is
- defined in superclasses. root classes have higher priority.
- removes lower class variable entry from IV_TBL (if it's defined
- in classes, not modules).
-
- * variable.c (rb_cvar_get): ditto.
-
-Wed Oct 3 10:06:53 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ruby.c (ruby_process_options): push frame with program name.
- [ruby-core:12351]
-
-Tue Oct 2 20:16:55 2007 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/win32.c (init_env): refactoring. remove unused code.
-
-Tue Oct 2 12:30:40 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * array.c (rb_ary_product): generalized product, now takes
- arbitrary number of arrays. a patch from David Flanagan
- <david AT davidflanagan.com>. [ruby-core:12346]
-
-Tue Oct 2 08:25:50 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * array.c (rb_ary_permutation): implementation contributed from
- David Flanagan. [ruby-core:12344]
-
- * array.c (rb_ary_combination): RDoc update to clarify. a patch
- from David Flanagan. [ruby-core:12344]
-
- * array.c (rb_ary_permutation): small dirty hack by Matz to avoid
- arrays on stack.
-
-Tue Oct 2 07:01:05 2007 Koichi Sasada <ko1@atdot.net>
-
- * proc.c (proc_dup): proc->block.proc should be self.
-
- * bootstraptest/test_knownbug.rb, test_method.rb:
- move a fixed test.
-
-Mon Oct 1 16:17:44 2007 Tanaka Akira <akr@fsij.org>
-
- * bootstraptest/test_method.rb: use assert_normal_exit to test
- [ruby-dev:31818].
-
-Mon Oct 1 15:57:49 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * gc.c (id2ref): skip ICLASS.
-
-Mon Oct 1 15:29:35 2007 Tanaka Akira <akr@fsij.org>
-
- * bootstraptest/runner.rb (assert_normal_exit): use `` instead of
- system.
-
-Mon Oct 1 15:17:48 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * gc.c (id2ref): T_VALUES is less than T_BLOCK. [ruby-dev:31911]
-
-Mon Oct 1 10:58:42 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ruby.c (require_libraries): use require method instead of calling
- rb_require directly. [ruby-dev:31322]
-
-Mon Oct 1 10:52:30 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval.c (ruby_options), ruby.c (proc_options, process_options): not
- call exit(2) directly. [ruby-dev:31912]
-
- * eval.c (ruby_run_node): deal with direct exit code.
-
-Sun Sep 30 17:12:53 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * string.c (rb_str_append): always set encoding, and coderange
- cache bits.
-
- * include/ruby/encoding.h (ENC_CODERANGE_SET): fixed a bug not to
- set cache bits.
-
-Sun Sep 30 11:52:11 2007 Tanaka Akira <akr@fsij.org>
-
- * bootstraptest/runner.rb (pretty): don't show beginning empty line.
-
-Sun Sep 30 11:32:34 2007 Tanaka Akira <akr@fsij.org>
-
- * numeric.c: use #ifdef for test LONG_LONG_VALUE.
-
-Sun Sep 30 04:30:55 2007 Tanaka Akira <akr@fsij.org>
-
- * bignum.c: use SIZEOF_LONG instead of SIZEOF_ULONG which is not
- defined.
-
-Sun Sep 30 04:03:43 2007 Tanaka Akira <akr@fsij.org>
-
- * re.c (Init_Regexp): test DEFAULT_KCODE in C code because
- KCODE_EUC, etc. are enum.
-
-Sun Sep 30 00:55:40 2007 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * variable.c (obj_ivar_each): get rid of warning.
-
-Sat Sep 29 17:45:22 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * main.c (main): use platform-independent per-process initialization.
- [ruby-dev:31900]
-
- * ruby.c (ruby_sysinit): new function for per-process initialization.
-
- * include/ruby/ruby.h (RUBY_GLOBAL_SETUP): toplevel setup declaration.
-
- * include/ruby/win32.h, win32/mkexports.rb: alias NtInitialize
- ruby_sysinit.
-
- * win32/win32.c (rb_w32_sysinit): renamed from NtInitialize.
-
-Sat Sep 29 17:31:04 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * array.c (rb_ary_combination): new method to give all combination
- of elements from an array. [ruby-list:42671]
-
- * array.c (rb_ary_product): a new method to get all combinations
- of elements from two arrays. can be extended to combinations of
- n-arrays, e.g. a.product(b,c,d). anyone volunteer?
-
- * array.c (rb_ary_permutation): empty function body to calculate
- permutations of array elements. need volunteer.
-
-Sat Sep 29 17:14:44 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * marshal.c (r_leave): move proc invocation from r_entry() to
- avoid potential crash.
-
-Sat Sep 29 12:28:08 2007 Tanaka Akira <akr@fsij.org>
-
- * bootstraptest/runner.rb (assert_normal_exit): new method.
-
- * bootstraptest/test_knownbug.rb: add test for Marshal.load.
-
-Sat Sep 29 10:12:20 2007 Tanaka Akira <akr@fsij.org>
-
- * variable.c (rb_ivar_set): fix class instance variable.
-
- * object.c (rb_class_real): cl argument may be 0.
-
-Sat Sep 29 09:12:02 2007 Tanaka Akira <akr@fsij.org>
-
- * object.c (rb_class_real): use BUILTIN_TYPE instead of TYPE.
- access flags directly instead of FL_TEST.
- they are enough because cl argument is a class.
-
-Sat Sep 29 08:57:15 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * include/ruby/win32.h (strcasecmp): needed for type_strcasehash.
-
-Sat Sep 29 06:47:29 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ruby.c (struct cmdline_options): static variables packed.
-
-Sat Sep 29 05:29:30 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * io.c (rb_io_fdopen): create IO object from fd.
-
- * parse.y (yycompile): use encoding of the source as default.
-
- * ruby.c (proc_options, load_file): ditto.
-
-Sat Sep 29 04:27:08 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * encoding.c (rb_enc_alias): allow encodings multiple aliases.
-
- * encoding.c (rb_enc_find_index): search the encoding which has the
- given name and return its index if found, or -1.
-
- * st.c (type_strcasehash): case-insensitive string hash type.
-
- * string.c (rb_str_force_encoding): force encoding of self. this name
- comes from [ruby-dev:31894] by Martin Duerst. [ruby-dev:31744]
-
- * include/ruby/encoding.h (rb_enc_find_index, rb_enc_associate_index):
- prototyped.
-
- * include/ruby/encoding.h (rb_enc_isctype): direct interface to ctype.
-
- * include/ruby/st.h (st_init_strcasetable): prototyped.
-
-Sat Sep 29 03:53:26 2007 Koichi Sasada <ko1@atdot.net>
-
- * cont.c: Thread local storage should be fiber local.
-
- * bootstraptest/test_knownbug.rb, test/ruby/test_fiber.rb:
- move a fixed test.
-
-Fri Sep 28 23:15:31 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * insnhelper.ci (vm_call_method): allow send! to call protected
- methods as well. [ruby-core:12280]
-
-Fri Sep 28 22:33:47 2007 Koichi Sasada <ko1@atdot.net>
-
- * benchmark/bm_so_fasta.rb: added.
-
- * benchmark/bm_so_k_nucleotide.rb: added.
-
- * benchmark/bm_so_reverse_complement.rb: added.
-
- * benchmark/make_fasta_output.rb: added.
-
- * benchmark/prepare_so_k_nucleotide.rb: added.
-
- * benchmark/prepare_so_reverse_complement.rb: added.
-
-Fri Sep 28 19:14:51 2007 Koichi Sasada <ko1@atdot.net>
-
- * benchmark/driver.rb: fix notations.
-
- * benchmark/bm_loop_whileloop.rb: ditto.
-
- * benchmark/bm_loop_whileloop2.rb: ditto.
-
- * benchmark/bm_app_uri.rb: added.
-
- * benchmark/bm_vm1_ivar_set.rb: ditto.
-
- * benchmark/bm_so_binary_trees.rb: added from Computer Language
- Benchmarks Game (http://shootout.alioth.debian.org/).
-
- * benchmark/bm_so_fannkuch.rb: ditto.
-
- * benchmark/bm_so_mandelbrot.rb: ditto.
-
- * benchmark/bm_so_meteor_contest.rb: ditto.
-
- * benchmark/bm_so_nbody.rb: ditto.
-
- * benchmark/bm_so_nsieve.rb: ditto.
-
- * benchmark/bm_so_nsieve_bits.rb: ditto.
-
- * benchmark/bm_so_partial_sums.rb: ditto.
-
- * benchmark/bm_so_pidigits.rb: ditto.
-
- * benchmark/bm_so_spectralnorm.rb: ditto.
-
-Fri Sep 28 16:22:52 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * vm_core.h (rb_vm_struct): fix typo: bufferd -> buffered.
-
-Fri Sep 28 15:47:48 2007 Koichi Sasada <ko1@atdot.net>
-
- * benchmark/driver.rb: fix to output benchmark results
- to file "bmlog-#{Time.now.strftime('%Y%m%d-%H%M%S')}.#{$$}".
-
- * benchmark/bm_io_file_create.rb: remove useless codes.
-
- * benchmark/bm_vm2_eval.rb: added.
-
-Fri Sep 28 15:05:24 2007 Tanaka Akira <akr@fsij.org>
-
- * include/ruby/intern.h: export rb_ivar_foreach.
-
- * include/ruby/ruby.h: modify struct RObject and RClass for optimizing
- T_OBJECT space. [ruby-dev:31853]
- (ROBJECT_LEN, ROBJECT_PTR)
- (RCLASS_IV_TBL, RCLASS_M_TBL, RCLASS_SUPER, RCLASS_IV_INDEX_TBL)
- (RMODULE_IV_TBL, RMODULE_M_TBL, RMODULE_SUPER): abstract accessor
- defined.
-
- * variable.c: support the modified RObject and RClass.
-
- * object.c: ditto.
-
- * class.c: ditto.
-
- * gc.c: ditto.
-
- * marshal.c: ditto.
-
- * eval_method.ci: use the abstract accessor.
-
- * insns.def: ditto.
-
- * proc.c: ditto.
-
- * struct.c: ditto.
-
- * eval.c: ditto.
-
- * error.c: ditto.
-
- * vm.c: ditto.
-
- * insnhelper.ci: ditto.
-
- * ext/digest/digest.c: ditto.
+Fri Oct 5 15:44:50 2007 Akinori MUSHA <knu@iDaemons.org>
-Fri Sep 28 13:20:10 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * io.c (rb_io_getline_fast, rb_io_getline_1): set encoding to the
- result string, as well as getc.
-
-Fri Sep 28 12:51:42 2007 Koichi Sasada <ko1@atdot.net>
-
- * benchmark/bm_app_erb.rb: added.
-
- * benchmark/bm_io_file_(create|read|write).rb: added.
-
-Fri Sep 28 12:49:05 2007 Koichi Sasada <ko1@atdot.net>
-
- * benchmark/driver.rb: fix file selection algorithm.
-
-Fri Sep 28 02:05:42 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * string.c (rb_str_comparable): need not to check asciicompat here.
-
- * encoding.c (rb_enc_check): ditto.
-
- * string.c (rb_enc_str_coderange): tuned a bit; no broken check.
-
- * encoding.c (rb_enc_check): new encoding comparison criteria.
-
-Thu Sep 27 17:36:28 2007 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/REAMDE.win32: follow recent changes.
-
-Thu Sep 27 16:01:53 2007 Koichi Sasada <ko1@atdot.net>
-
- * benchmark/driver.rb: fix to output some helpful messages.
-
-Thu Sep 27 15:44:51 2007 Koichi Sasada <ko1@atdot.net>
-
- * benchmark/driver.rb: added.
-
- * common.mk: fix to use above driver.
-
- * benchmark/prepare_so_count_words.rb: added.
-
- * benchmark/bm_so_count_words.rb: fix benchmark process.
-
-Thu Sep 27 15:42:34 2007 Koichi Sasada <ko1@atdot.net>
-
- * ext/fiber/fiber.c: modify prototype declaration.
- [ruby-core:12247]
-
-Thu Sep 27 09:42:50 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (strings, xstring, regexp, dsym): empty strings have
- US-ASCII encoding.
-
-Thu Sep 27 07:39:13 2007 Tanaka Akira <akr@fsij.org>
-
- * bootstraptest/runner.rb (assert_finish): new method.
-
- * bootstraptest/test_knownbug.rb: add test for [ruby-dev:31866] using
- assert_finish.
-
-Thu Sep 27 04:46:31 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * encoding.c (rb_enc_associate_index): deal with ASCII compatible
- flags.
-
- * encoding.c (rb_enc_check): allow ASCII compatible strings.
-
- * parse.y (rb_intern_str): use ASCII encoding for ASCII string.
-
- * string.c (rb_enc_str_coderange): check for code-range.
-
- * string.c (rb_str_modify): clear code-range flags.
-
- * string.c (rb_str_hash, rb_str_eql): ASCII compatible strings are
- comparable.
-
- * include/ruby/encoding.h: added code-range flags.
-
-Thu Sep 27 04:40:47 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * gc.c (rb_mark_set): new function to mark keys.
-
- * marshal.c (struct dump_arg, struct load_arg): added wrappers to mark
- data and compat_tbl entries. [ruby-dev:31870]
-
-Thu Sep 27 03:17:41 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * process.c (rb_waitpid): no needs to poll. [ruby-dev:31871]
-
-Wed Sep 26 20:11:46 2007 Koichi Sasada <ko1@atdot.net>
-
- * bootstraptest/test_knownbug.rb: remove a fixed test.
-
-Wed Sep 26 20:00:12 2007 Koichi Sasada <ko1@atdot.net>
-
- * bootstraptest/test_knownbug.rb: move fixed tests.
-
- * bootstraptest/test_method.rb: ditto.
-
- * test/ruby/test_io.rb: ditto.
-
-Wed Sep 26 19:36:26 2007 Koichi Sasada <ko1@atdot.net>
-
- * eval.c (eval): fix to check stack overflow.
- [ruby-dev:31850]
-
- * eval_intern.h, vm.h: move CHECK_STACK_OVERFLOW() macro.
-
-Wed Sep 26 19:27:11 2007 Koichi Sasada <ko1@atdot.net>
-
- * insnhelper.ci (vm_throw): fix to move increment point.
- [ruby-dev:31840]
-
-Wed Sep 26 19:23:56 2007 Koichi Sasada <ko1@atdot.net>
-
- * cont.c: Fiber as SemiCoroutine on default. [ruby-core:12146]
+ * lib/shellwords.rb: Add shellescape() and shelljoin().
- * ext/fiber/fiber.c: enable Fiber#transfer.
+ * lib/shellwords.rb: Rename shellwords() to shellsplit() and make
+ the former an alias to the latter.
-Wed Sep 26 18:38:41 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/shellwords.rb: Add escape(), split(), join() as class
+ methods, which are aliases to their respective long names
+ prefixed with `shell'.
- * encoding.c (rb_enc_check): check for ASCII-compatibilities.
+ * lib/shellwords.rb: Add String#shellescape(), String#shellsplit()
+ and Array#shelljoin() for convenience.
- * parse.y (parser_tokadd_string, parser_parse_string,
- parser_here_document, parser_yylex): set encoding to US-ASCII.
+Fri Oct 5 15:40:04 2007 Akinori MUSHA <knu@iDaemons.org>
- * parse.y (rb_enc_symname_p): check if valid with encoding.
+ * lib/tempfile.rb (Tempfile::make_tmpname): Allow to specify a
+ suffix for a temporary file name.
- * parse.y (rb_intern3): let symbols have encoding.
+ * lib/tempfile.rb (Tempfile::make_tmpname): Make temporary file
+ names less predictable by including a random string.
+ [inspired by: akr]
- * string.c (rb_str_hash): add encoding index.
+Tue Oct 2 21:20:14 2007 NAKAMURA Usaku <usa@ruby-lang.org>
- * string.c (rb_str_comparable, rb_str_equal, rb_str_eql): check if
- compatible encoding.
+ * win32/win32.c (make_cmdvector): adjust escaped successive
+ double-quote handling. (merge from trunk)
- * string.c (sym_inspect): made encoding aware.
+Tue Oct 2 20:35:24 2007 NAKAMURA Usaku <usa@ruby-lang.org>
- * insns.def (opt_eq): compare with encoding.
+ * win32/win32.c (init_env): initialize HOME and USER environment
+ variables unless set. [ruby-core:12328] (merge from trunk)
- * include/ruby/encoding.h (rb_enc_asciicompat): check if ASCII
- compatible.
+ * win32/win32.c (NtInitialize, getlogin): ditto.
- * include/ruby/encoding.h (rb_enc_get_index): added prototype.
+ * configure.in, win32/Makefile.sub (LIBS): need to link shell32
+ library for SH* functions on mswin32 and mingw32.
- * include/ruby/intern.h (rb_str_comparable, rb_str_equal): ditto.
+Mon Oct 1 12:50:59 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-Wed Sep 26 15:01:16 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * gc.c (id2ref): valid id should not refer T_VALUE nor T_ICLASS.
+ [ruby-dev:31911]
- * eval_method.ci (rb_get_alloc_func): cast to suppress a warning.
+Wed Sep 26 23:54:37 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * eval_method.ci (remove_method): local variable to be initialized.
+ * ext/extmk.rb (extmake), lib/mkmf.rb (configuration): top_srcdir
+ should not prefixed with DESTDIR.
Wed Sep 26 08:36:31 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
@@ -35483,51 +3635,20 @@ Wed Sep 26 08:36:31 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
Wed Sep 26 05:12:17 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * parse.y (parser_yyerror): limit error message length.
- [ruby-dev:31848]
-
-Tue Sep 25 15:11:32 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * io.c (io_ungetc): reallocate internal buffer if pushing data
- excess capacity. [ruby-dev:31650]
-
-Tue Sep 25 13:43:03 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval_method.ci (remove_method): should not remove undef place
- holder. [ruby-dev:31816], [ruby-dev:31817]
-
-Tue Sep 25 09:51:31 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (rb_longjmp): source file information may be NULL.
- [ruby-dev:31849]
-
- * eval.c (ruby_finalize_0): clear trace_func before finalization.
-
-Mon Sep 24 22:36:13 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * array.c (rb_ary_equal): should handle recursive array.
-
- * hash.c (hash_equal): should handle recursive hash.
+ * parse.y (yyerror): limit error message length. [ruby-dev:31848]
-Mon Sep 24 22:14:13 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * regex.c (re_mbc_startpos): separated from re_adjust_startpos.
- * lib/weakref.rb (WeakRef): remove debug print. [ruby-dev:31799]
+Tue Sep 25 13:47:38 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
- * hash.c (hash_i): avoid too frequent hash conflict where key and
- value are same. a patch from Yusuke ENDOH <mame AT tsg.ne.jp>.
- [ruby-dev:31802]
-
-Mon Sep 24 17:56:21 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/strscan/strscan.c (strscan_initialize, strscan_getch): use the
- encoding of the target string instead of setting to StringScanner
- instance. [ruby-dev:31831]
+ * eval.c (remove_method): should not remove undef place holder.
+ [ruby-dev:31817]
Mon Sep 24 16:52:11 2007 Urabe Shyouhei <shyouhei@ruby-lang.org>
* lib/net/http.rb: fix typo.
-Mon Sep 24 06:49:15 2007 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Sun Sep 23 21:57:25 2007 GOTOU Yuuzou <gotoyuzo@notwork.org>
* lib/net/http.rb: an SSL verification (the server hostname should
be matched with its certificate's commonName) is added.
@@ -35548,16 +3669,11 @@ Sun Sep 23 09:05:05 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
Sun Sep 23 08:58:01 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * eval_method.ci (rb_attr): should not use alloca for unknown size
- input. [ruby-dev:31818]
+ * eval_method.ci (rb_attr): should not use alloca for unknowen size
+ input. [ruby-dev:31816]
* parse.y (rb_intern_str): prevent str from optimization.
-Sun Sep 23 06:16:04 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval_method.ci (remove_method): check for undefined method.
- [ruby-dev:31816]
-
Sun Sep 23 05:42:35 2007 URABE Shyouhei <shyouhei@ruby-lang.org>
* lib/rdoc/options.rb (Options::check_diagram): dot -V output
@@ -35573,305 +3689,60 @@ Sat Sep 22 05:19:49 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ext/stringio/stringio.c (strio_init): separate from strio_initialize
to share with strio_reopen properly. [ruby-Bugs-13919]
-Fri Sep 21 14:51:40 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * gc.c (gc_mark_rest): copy just used part.
-
- * gc.c (gc_mark_children): mark u1 and u2 of NODE_ARGSCAT.
-
- * gc.c (os_obj_of): hide T_VALUES too. [ruby-dev:31804]
-
- * gc.c (run_final): freeze temporary argument array.
-
-Fri Sep 21 04:58:39 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * misc/ruby-style.el (ruby-style-label-indent): fix for function top
- level labels.
-
-Fri Sep 21 02:11:22 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * re.c (rb_reg_match_m): evaluate a block if match. it would make
- condition statement much shorter, if no else clause is needed.
-
- * string.c (rb_str_match_m): ditto.
-
-Fri Sep 21 02:02:34 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * hash.c (hash_equal): should call rb_eql when argument eql is set.
-
-Thu Sep 20 17:28:00 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * io.c (popen_exec), process.c (rb_spawn): stop other threads before
- exec. [ruby-core:08262]
-
-Tue Sep 18 22:08:42 2007 Keiju Ishitsuka <keiju@ruby-lang.org>
-
- * lib/matrix.rb: fix a coerce bug of Vector. [ruby-core: 12190]
-
-Mon Sep 17 21:06:03 2007 Minero Aoki <aamine@loveruby.net>
-
- * lib/net/http.rb (HTTP::GenericRequest#initialize): check path is
- not nil. [ruby-dev:31149]
-
-Mon Sep 17 21:00:51 2007 Minero Aoki <aamine@loveruby.net>
-
- * parse.y (ripper): rename event: arglist_* -> args_*.
-
- * parse.y (ripper): rename event: restparam -> rest_param.
-
- * parse.y (ripper): rename event: constpath_* -> const_path_*.
-
- * parse.y (ripper): rename event: topconst_* -> top_const_*.
-
- * parse.y (ripper): rename event: iter_block -> method_add_block.
-
- * parse.y (ripper): support block local parameter declaration.
-
- * parse.y (ripper): introduce new macro params_new.
-
- * ext/ripper/lib/ripper/sexp.rb: should not dispose event
- arguments whose name ends with "_new" but arity != 0.
-
-Sat Sep 15 23:36:31 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (struct parser_params): common members in the parser and
- ripper must be placed at each same location.
-
-Sat Sep 15 18:25:15 2007 Kouhei Sutou <kou@cozmixng.org>
-
- * string.c (rb_str_rstrip_bang): fixed too much rstrip. [ruby-dev:31786]
-
-Sat Sep 15 17:32:10 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (parser_initialize): set default encoding. [ruby-dev:31787]
-
- * ruby.c (load_file): make new parse instance after processing shebang
- line options.
-
-Sat Sep 15 17:04:08 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * encoding.c (rb_enc_associate_index, rb_enc_get_index): check if
- object is encoding capable. [ruby-dev:31780]
-
- * string.c (rb_str_subpat_set): check for if the argument is a String.
-
-Sat Sep 15 13:31:21 2007 Kouhei Sutou <kou@cozmixng.org>
-
- * lib/rss.rb, lib/rss/, test/rss/:
- - 0.1.9 -> 0.2.0.
- - supported Slash module.
+Fri Sep 21 15:46:20 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Sep 14 22:20:01 2007 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+ * process.c (struct rb_exec_arg): proc should be a VALUE.
- * ext/win32ole/win32ole.c (fev_unadvise): no needs to reset
- event handlers.
+ * process.c (rb_f_exec): suppress a warning.
-Fri Sep 14 17:28:32 2007 Koichi Sasada <ko1@atdot.net>
+Fri Sep 21 03:05:35 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * test/ruby/test_io.rb: tests which cause SEGV should not be
- added.
+ * eval.c, intern.h, ext/thread/thread.c: should not free queue while
+ any live threads are waiting. [ruby-dev:30653]
- * bootstraptest/test_knownbug.rb: add above test to known bug.
+Thu Sep 20 17:24:59 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Sep 14 16:24:04 2007 Koichi Sasada <ko1@atdot.net>
+ * process.c (rb_detach_process): cast for the platforms where size of
+ pointer differs from size of int.
- * insnhelper.ci (vm_expandarray): assignment should be placed
- after creating new array.
+ * process.c (rb_f_exec, rb_f_system): should not exceptions after
+ fork. [ruby-core:08262]
-Fri Sep 14 16:17:30 2007 Koichi Sasada <ko1@atdot.net>
+Fri Sep 14 00:34:25 2007 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
- * bootstraptest/runner.rb: add a stress test (-s).
-
-Fri Sep 14 16:14:28 2007 Koichi Sasada <ko1@atdot.net>
-
- * vm.h, eval_intern.h: move some macros to eval_intern.h.
-
- * eval_jump.ci (rb_f_throw): fix to use NEW_THROW_OBJECT().
-
- * eval.c (rb_f_loop): remove additional macro.
-
-Fri Sep 14 16:12:10 2007 Koichi Sasada <ko1@atdot.net>
-
- * insnhelper.ci (vm_expandarray): should be volatile value for GC.
-
-Thu Sep 13 15:42:03 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * compile.c (iseq_compile_each): inline cache entries are overwritten
- in iseq_build_body().
-
-Thu Sep 13 14:00:15 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (brace_block): should use compstmt. patch submitted by
- Kirill A. Shutemov <k.shutemov AT gmail.com> [ruby-core:12154].
-
-Thu Sep 13 13:47:08 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (rb_id2str): fixed typo.
+ * lib/drb/extservm.rb (invoke_service): use Thread.exclusive instead of
+ Thread.critical
Wed Sep 12 23:12:22 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
* ruby.c (proc_options): -W should be allowed in RUBYOPT
environment variable. [ruby-core:12118]
-Wed Sep 12 15:19:04 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * io.c (rb_io_s_sysopen): should not use alloca for unknown size
- input. [ruby-dev:31775]
-
- * parse.y (rb_id2str): ditto.
-
- * marshal.c (w_float): use snprintf instead of sprintf.
-
-Tue Sep 11 17:28:00 2007 Akinori MUSHA <knu@iDaemons.org>
-
- * lib/tempfile.rb (Tempfile::make_tmpname): Allow to specify a
- suffix for a temporary file name.
-
- * lib/tempfile.rb (Tempfile::make_tmpname): Make temporary file
- names less predictable by including a random string.
- [inspired by: akr]
-
-Tue Sep 11 17:25:59 2007 Akinori MUSHA <knu@iDaemons.org>
-
- * lib/shellwords.rb: Add shellescape() and shelljoin().
-
- * lib/shellwords.rb: Rename shellwords() to shellsplit() and make
- the former an alias to the latter.
-
- * lib/shellwords.rb: Add escape(), split(), join() as class
- methods, which are aliases to their respective long names
- prefixed with `shell'.
-
- * lib/shellwords.rb: Add String#shellescape(), String#shellsplit()
- and Array#shelljoin() for convenience.
-
-Mon Sep 10 15:48:31 2007 Tanaka Akira <akr@fsij.org>
-
- * range.c: represent initialized state using EXCL instead of FL_USER3.
-
- * range.c (range_dumper): make uninitialized range dumpable.
- (range_loader): make uninitialized range loadable.
-
-Mon Sep 10 13:44:37 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * array.c (rb_ary_cycle): avoid infinite loop for empty array.
- based on a patch from David Flanagan. [ruby-core:12085]
-
-Mon Sep 10 01:21:23 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * marshal.c (r_object0): struct allocation first to check if a
- class is a struct. compatibility check should come next.
-
Mon Sep 10 01:05:25 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
* range.c (range_step): fixed integer overflow. [ruby-dev:31763]
-Sun Sep 9 08:57:27 2007 Tadayoshi Funaba <tadf@dotrb.org>
+Sun Sep 9 09:14:45 2007 Tadayoshi Funaba <tadf@dotrb.org>
* lib/date/format.rb (_strptime): now also attaches an element
which denotes leftover substring if exists.
-Sun Sep 9 01:59:08 2007 Tanaka Akira <akr@fsij.org>
-
- * marshal.c (r_object0): check T_STRUCT type for structs.
-
-Sun Sep 9 01:17:05 2007 Tanaka Akira <akr@fsij.org>
-
- * marshal.c (r_object0): don't call user-defined initialize for
- T_STRUCT objects.
-
- * include/ruby/intern.h (rb_struct_initialize): declared.
-
- * struct.c (rb_struct_initialize): export.
-
-Sat Sep 8 23:55:56 2007 Tanaka Akira <akr@fsij.org>
-
- * eval_method.ci (rb_get_alloc_func): new function to get allocation
- function.
-
- * include/ruby/intern.h (rb_alloc_func_t): declared.
- (rb_define_alloc_func): declared.
- (rb_marshal_define_compat): declared.
-
- * range.c: use T_STRUCT for Range.
-
- * inits.c: move Init_marshal() prior to Init_Range() because
- Init_Range calls rb_marshal_define_compat which needs
- marshal's compat_allocator_tbl initialized.
-
- * marshal.c: support marshal format compatibility layer designed for
- marshaling T_STRUCT Range using T_OBJECT format.
- (rb_marshal_define_compat): defined.
-
- [ruby-dev:31710]
-
-Sat Sep 8 10:05:14 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * struct.c (rb_struct_s_members): check if __members__ is an
- array to prevent segmentation fault. [ruby-dev:31759]
-
-Sat Sep 8 09:33:09 2007 Tadayoshi Funaba <tadf@dotrb.org>
-
- * lib/date/format.rb (str[fp]time): now check specifications more
- strictly.
-
-Sat Sep 8 02:56:31 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * test/ruby/test_fiber.rb (TestFiber::test_throw): uncaught throw
- now raise ArgumentError exception.
-
-Sat Sep 8 02:45:33 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
+Sat Sep 8 10:22:20 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
* struct.c (rb_struct_s_members): should raise TypeError instead
of call rb_bug(). [ruby-dev:31709]
* marshal.c (r_object0): no nil check require any more.
-Sat Sep 8 01:46:36 2007 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * regenc.c, regenc.h (onigenc_single_byte_mbc_enc_len): should take
- two arguments. [ruby-dev:31754]
-
-Fri Sep 7 00:58:16 2007 Koichi Sasada <ko1@atdot.net>
-
- * common.mk: fix typo.
-
-Fri Sep 7 00:28:25 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * io.c (rb_io_getc): forgot to commit rb_enc_mbclen() fix.
-
- * ext/stringio/stringio.c (strio_getc): rb_enc_mbclen() fix.
-
- * ext/stringio/stringio.c (strio_ungetc): ditto.
-
-Thu Sep 6 22:57:01 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/fileutils.rb (FileUtils::Entry_::copy): prevent self copy of
- directories.
+Sat Sep 8 09:38:19 2007 Tadayoshi Funaba <tadf@dotrb.org>
- * lib/fileutils.rb (FileUtils::fu_each_src_dest0): use try_convert.
-
- * lib/fileutils.rb (FileUtils::fu_update_option): ditto.
-
-Thu Sep 6 21:36:33 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * include/ruby/oniguruma.h (OnigEncodingTypeST): add end parameter
- to mbc_enc_len.
-
- * euc_jp.c (mbc_enc_len), sjis.c (mbc_enc_len),
- utf8.c (utf8_mbc_enc_len): ditto.
-
- * encoding.c (rb_enc_mbclen): add end parameter.
-
-Thu Sep 6 21:31:49 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * array.c (rb_ary_cycle): typo in rdoc. a patch from Yugui
- <yugui@yugui.sakura.ne.jp>. [ruby-dev:31748]
+ * lib/date/format.rb (str[fp]time): now check specifications more
+ strictly.
-Thu Sep 6 12:42:10 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Sep 7 05:36:19 2007 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
- * string.c (rb_str_succ, rb_str_chop_bang, rb_str_chop): m17n support.
- [ruby-dev:31734]
+ * test/rinda/test_rinda.rb (MockClock): correct synchronous problems
+ of the MultiThreading. [ruby-dev:31692]
Wed Sep 5 22:02:27 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
@@ -35885,983 +3756,93 @@ Wed Sep 5 22:02:27 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
* string.c (rb_str_splice): integer overflow for length.
[ruby-dev:31739]
-Tue Sep 4 20:43:44 2007 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-
- * ext/win32ole/win32ole.c: add WIN32OLE_EVENT#unadvise.
-
- * test/win32ole/test_win32ole_event.rb: ditto.
-
-Mon Sep 3 15:37:09 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * common.mk (vm.o): depends on st.h too.
-
-Sun Sep 2 23:38:29 2007 Tanaka Akira <akr@fsij.org>
-
- * include/ruby/st.h (struct st_table): make num_entries bitfield
- instead of num_bins for speed. num_entries has less access.
-
-Sun Sep 2 00:37:57 2007 Tadayoshi Funaba <tadf@dotrb.org>
+Sun Sep 2 00:48:15 2007 Tadayoshi Funaba <tadf@dotrb.org>
* lib/date/format.rb (_parse): improved parsing of ordinal dates.
* lib/date/format.rb (_parse): use named character classes in some
regular expressions.
-Sat Sep 1 23:44:26 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval_jump.ci (rb_f_throw): wrap tag and TAG_THROW in a NODE_MEMO
- node to make throw instruction to work well.
-
-Sat Sep 1 20:56:07 2007 Tanaka Akira <akr@fsij.org>
-
- * include/ruby/ruby.h (struct RBignum): embed digits in RBignum for
- small bignums.
-
- * bignum.c: RBignum embedded digits implemented.
-
- * include/ruby/intern.h: declare rb_big_resize.
-
- * gc.c: don't free embedded digits.
-
- * numeric.c: replace direct bignum field accessor by abstract field
- accessor such as RBIGNUM(val)->sign to RBIGNUM_SIGN(val).
-
- * sprintf.c: ditto.
-
- * compar.c: ditto.
-
- * marshal.c: ditto.
-
- * random.c: ditto.
-
- * .gdbinit: support embedded small bignums.
-
- [ruby-dev:31689]
-
-Sat Sep 1 19:59:43 2007 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-
- * ext/win32ole/win32ole.c (ole_event_free): IConnectionPoint should be
- released.
-
- * ext/win32ole/win32ole.c (EVENTSINK_Destructor): ITypeInfo should be
- released.
-
- * ext/win32ole/win32ole.c (fev_initialize): refactoring.
-
-Sat Sep 1 16:26:09 2007 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * test/socket/test_tcp.rb (test_recvfrom): same as mswin32 on mswin64.
-
-Sat Sep 1 14:24:23 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * st.c (st_numcmp, st_numhash): use st_data_t instead of long, because
- the former may be larger than the latter.
-
- * include/ruby/st.h (CHAR_BIT): get rid of magic number.
-
- * include/ruby/st.h (rb_index_t): use st_data_t for the platforms it
- is larger than int.
-
-Sat Sep 1 10:43:30 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval_jump.ci (rb_f_catch): generate new tag object if no argument is
- given. backported from MatzRuby. [ruby-dev:31609]
-
- * eval_jump.ci (rb_catch): call #catch without arguments if tag
- string is NULL.
-
- * eval_jump.ci (rb_f_throw): allow throwing non-symbol object.
-
- * eval_jump.ci (rb_catch_obj): new function to wait throw with arbitrary
- object.
-
- * eval_jump.ci (rb_throw_obj): new function to throw arbitrary object.
-
- * variable.c (check_autoload_table): prevent multiple calls from
- RSTRING_PTR().
-
-Fri Aug 31 07:12:24 2007 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * numeric.c (SQRT_LONG_MAX): use SIZEOF_LONG instead of SIZEOF_VALUE
- because SIZEOF_VALUE > SIZEOF_LONG on some platforms.
-
-Fri Aug 31 04:18:03 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (f_norm_arg, f_arg_item): not croak already erred names.
- [ruby-dev:31687]
-
- * parse.y (assignable_gen): ignore already erred names.
+Sat Sep 1 08:13:36 2007 Masaki Suketa <masaki.suketa@nifty.ne.jp>
- * parse.y (shadowing_lvar_gen): always make new block local variable
- when shadowing outer local variable. [ruby-dev:31507]
+ * ext/win32ole/win32ole.c: add WIN32OLE#ole_activex_initialize.
-Thu Aug 30 19:40:33 2007 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * regenc.h: check RUBY_EXTERN before including config.h and defines.h
-
- * common.mk: update header dependency.
-
-Thu Aug 30 14:06:50 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * proc.c (rb_obj_define_method): reverted. [ruby-talk:266637]
-
-Thu Aug 30 13:49:25 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/mkmf.rb: initialize $top_srcdir always. [ruby-dev:31682]
+Thu Aug 30 13:13:13 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/mkmf.rb (try_const, have_const): check for a const is defined.
[ruby-core:04422]
-Thu Aug 30 08:00:12 2007 Tanaka Akira <akr@fsij.org>
-
- * include/ruby/intern.h: declare rb_hash_tbl.
-
- * include/ruby/ruby.h (RHash): delay st_table allocation.
- rename tbl field to ntbl to detect direct reference to the st_table
- as a compile error.
- (RHASH_TBL): abstract accessor defined.
- (RHASH_ITER_LEV): ditto.
- (RHASH_IFNONE): ditto.
- (RHASH_SIZE): ditto.
- (RHASH_EMPTY_P): ditto.
- (hash_alloc0, hash_alloc): unified because hash_alloc doesn't
- allocate st_table now.
-
- * hash.c: delay st_table allocation.
-
- * gc.c: replace tbl by ntbl.
-
- * array.c: replace direct field accessor by abstract field accessor
- such as RHASH(hash)->tbl to RHASH_TBL(hash).
-
- * marshal.c: ditto.
-
- * insns.def: ditto.
-
- * ext/iconv/iconv.c: ditto.
-
- * ext/json/ext/generator/generator.c: ditto.
-
- * ext/json/ext/parser/parser.c: ditto.
-
- * ext/json/ext/parser/parser.rl: ditto.
-
- * ext/syck/rubyext.c: ditto.
-
- * ext/tk/tkutil/tkutil.c: ditto.
-
- [ruby-dev:31678]
+Thu Aug 30 13:10:57 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Aug 29 18:36:06 2007 Tanaka Akira <akr@fsij.org>
-
- * lib/open-uri.rb: add :ftp_active_mode option. [ruby-dev:31677]
-
-Wed Aug 29 14:55:28 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * string.c (str_gsub): should not use mbclen2() which has broken API.
-
- * re.c: remove rb_reg_mbclen2().
-
-Wed Aug 29 12:48:17 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (aref_args): args may not be a list. [ruby-dev:31592]
+ * configure.in (group_member): check if presents.
-Wed Aug 29 11:30:10 2007 Tanaka Akira <akr@fsij.org>
+ * configure.in (XCFLAGS): add _GNU_SOURCE on linux.
- * include/ruby/st.h (struct st_table): add entries_packed 1-bit
- bitfield. decrease num_bins 1-bit.
+ * file.c (group_member): use system routine if available.
- * st.c: pack numhash which have 5 or less entries in bins.
- (st_init_table_with_size): setup entries_packed flag.
- (st_clear): support packed mode.
- (st_lookup): ditto.
- (st_insert): ditto.
- (st_add_direct): ditto.
- (st_copy): ditto.
- (st_delete): ditto.
- (st_foreach): ditto.
- (st_reverse_foreach): ditto.
- (unpack_entries): new function for converting to unpacked mode.
+Thu Aug 30 08:24:18 2007 Tanaka Akira <akr@fsij.org>
- [ruby-list:43954]
+ * ruby.h (RHASH_TBL): defined for compatibility to 1.9.
+ * (RHASH_ITER_LEV): ditto.
+ * (RHASH_IFNONE): ditto.
+ * (RHASH_SIZE): ditto.
+ * (RHASH_EMPTY_P): ditto.
-Wed Aug 29 10:46:37 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
+Wed Aug 29 13:05:59 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
* include/ruby/defines.h (flush_register_windows): call "ta 0x03"
even on Linux/Sparc. [ruby-dev:31674]
-Tue Aug 28 19:16:00 2007 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-
- * ext/win32ole/win32ole.c (ole_type_progid): progid getted by
- ProgIDFromCLSID should be freed by CoTaskMemFree. Thanks, arton.
-
- * test/win32ole/test_win32ole.rb (test_raise_message): set negative
- compareMode value to raise WIN32OLERuntimeError.
-
- * test/win32ole/test_win32ole_type.rb (test_implemented_ole_types):
- support some environment which returns IShellDispatch5 instead
- of IShellDispatch.
-
-Tue Aug 28 15:42:09 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * string.c (rb_str_subseq): retrieve substring based on byte offset.
-
- * string.c (rb_str_rindex_m): was confusing character offset and
- byte offset.
-
-Tue Aug 28 14:23:31 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * string.c (rb_str_splice_0): should check to modify. [ruby-dev:31665]
-
-Tue Aug 28 14:21:46 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (parser_prepare): set parser encode too when BOM exists.
-
-Tue Aug 28 00:51:22 2007 Koichi Sasada <ko1@atdot.net>
-
- * thread.c: fix Mutex to be interruptable lock.
+Tue Aug 28 23:26:12 2007 Masaki Suketa <masaki.suketa@nifty.ne.jp>
- * thread_win32.ci, thread_win32.h, thread_pthread.ci, thread_pthread.h:
- prepare native_cond_*() which are based on pthread_cond_*() spec.
-
- * prelude.rb: fix Mutex#synchronize method.
-
- * vm_core.h, include/ruby/intern.h: change unblock function interface
- (to pass some user data).
-
- * file.c, process.c: ditto.
-
- * benchmark/bm_vm2_mutex.rb: add a benchmark for mutex.
-
- * benchmark/bm_vm3_thread_mutex.rb: add a benchmark for mutex
- with contention.
-
- * benchmark/run.rb: fix to remove ENV['RUBYLIB'] for matzruby.
-
- * test/ruby/test_thread.rb: add a test.
-
- * common.mk: fix benchmark options.
-
-Mon Aug 27 23:14:02 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * string.c (rb_str_rstrip_bang): wrong strip point. [ruby-dev:31652]
-
- * string.c (rb_str_each_line): should swallow sequence of newlines
- if rs (optional argument) is an empty string. [ruby-dev:31652]
-
-Mon Aug 27 22:39:08 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * encoding.c (rb_enc_codelen): raises invalid sequence exception
- if ONIGENC_CODE_TO_MBCLEN() returns zero. [ruby-dev:31661]
-
- * encoding.c (rb_enc_mbclen): check invalid sequence.
-
-Mon Aug 27 20:27:59 2007 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-
- * ext/win32ole/win32ole.c (ole_type_progid): fix the bug.
+ * ext/win32ole/win32ole.c (ole_type_progid, reg_enum_key,
+ reg_get_val, ole_wc2mb): fix the bug. Thanks, arton.
[ruby-dev:31576]
- * test/win32ole/test_win32ole_type.rb (test_initialize):
- remove duplicate assertions.
-
Mon Aug 27 19:10:50 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
* ext/etc/etc.c (etc_getlogin): update documentation to note
security issue. [ruby-Bugs-11821]
-Mon Aug 27 15:56:48 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * string.c (sym_encoding): return the encoding of a Symbol.
-
-Mon Aug 27 15:33:10 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * util.c (IEEE_BIG_ENDIAN): use configured value. [ruby-dev:31623]
-
- * util.c (Llong): set to LONG_LONG if available.
-
-Mon Aug 27 13:11:56 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * string.c (tr_trans): wrong condition for mbmaxlen==1 strings.
- [ruby-dev:31652]
-
-Mon Aug 27 00:41:13 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * io.c (rb_io_each_byte): caused infinite loop. [ruby-dev:31652]
-
- * io.c (rb_io_getc): should return nil at EOF, not EOFError.
-
- * lib/delegate.rb (SimpleDelegator::__setobj__): use raise
- argument to specify backtrace.
-
- * test/ruby/test_fnmatch.rb (TestFnmatch::bracket_test):
- String#include? no longer works for Fixnum. use #chr.
- [ruby-dev:31652]
-
-Sun Aug 26 12:27:14 2007 Koichi Sasada <ko1@atdot.net>
-
- * cont.c: fix to remove Fiber.new until fiber.so is not loaded.
-
- * test/ruby/test_continuation.rb: fix to use resume.
-
-Sun Aug 26 06:51:46 2007 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-
- * ext/win32ole/win32ole.c (ole_wc2mb, reg_enum_key): allocate
- buffer should be NULL terminated.
-
-Sun Aug 26 06:04:13 2007 Koichi Sasada <ko1@atdot.net>
-
- * insnhelper.ci (vm_setup_method): reorder code for branch prediction.
-
-Sun Aug 26 05:54:49 2007 Koichi Sasada <ko1@atdot.net>
-
- * insnhelper.ci (vm_call_method): fix to relaxant safe level check
- ($SAFE > 2). [ruby-core:11998]
-
- * bootstraptest/test_method.rb: add tests for above.
-
-Sun Aug 26 05:52:08 2007 Koichi Sasada <ko1@atdot.net>
-
- * test/ruby/test_fiber.rb: fix to require 'continuation'.
-
-Sat Aug 25 23:52:14 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * enumerator.c (enumerator_next): message changed.
-
-Sat Aug 25 23:22:14 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * include/ruby/encoding.h: remove unused rb_enc_ismbchar().
-
-Sat Aug 25 22:50:14 2007 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-
- * ext/win32ole/win32ole.c (ole_event_free, EVENTSINK_Destructor,
- fev_initialize): remove the connection ole_event_free and
- EVENTSINK_Destructor.
-
-Sat Aug 25 17:52:06 2007 Koichi Sasada <ko1@atdot.net>
-
- * string.c, include/ruby/intern.h: export rb_str_length().
-
- * insns.def: use rb_str_length() in opt_length.
-
-Sat Aug 25 17:48:51 2007 Koichi Sasada <ko1@atdot.net>
-
- * cont.c: rename FIBER_STACK_SIZE to FIBER_VM_STACK_SIZE.
-
-Sat Aug 25 17:05:05 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * io.c (swallow): removed condition using an unset variable.
-
- * parse.y, re.c: re-applied revision 13092.
-
- * string.c (rb_str_splice): return from void function.
-
- * include/ruby/encoding.h (rb_enc_str_new): prototype added.
-
-Sat Aug 25 11:45:37 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * encoding.c: provide basic features for M17N.
-
- * parse.y: encoding aware parsing.
-
- * parse.y (pragma_encoding): encoding specification pragma.
-
- * parse.y (rb_intern3): encoding specified symbols.
-
- * string.c (rb_str_length): length based on characters.
- for older behavior, bytesize method added.
-
- * string.c (rb_str_index_m): index based on characters. rindex as
- well.
-
- * string.c (succ_char): encoding aware succeeding string.
-
- * string.c (rb_str_reverse): reverse based on characters.
-
- * string.c (rb_str_inspect): encoding aware string description.
-
- * string.c (rb_str_upcase_bang): encoding aware case conversion.
- downcase, capitalize, swapcase as well.
-
- * string.c (rb_str_tr_bang): tr based on characters. delete,
- squeeze, tr_s, count as well.
-
- * string.c (rb_str_split_m): split based on characters.
-
- * string.c (rb_str_each_line): encoding aware each_line.
-
- * string.c (rb_str_each_char): added. iteration based on
- characters.
-
- * string.c (rb_str_strip_bang): encoding aware whitespace
- stripping. lstrip, rstrip as well.
-
- * string.c (rb_str_justify): encoding aware justifying (ljust,
- rjust, center).
-
- * string.c (str_encoding): get encoding attribute from a string.
-
- * re.c (rb_reg_initialize): encoding aware regular expression
-
- * sprintf.c (rb_str_format): formatting (i.e. length count) based
- on characters.
-
- * io.c (rb_io_getc): getc to return one-character string.
- for older behavior, getbyte method added.
-
- * ext/stringio/stringio.c (strio_getc): ditto.
-
- * io.c (rb_io_ungetc): allow pushing arbitrary string at the
- current reading point.
-
- * ext/stringio/stringio.c (strio_ungetc): ditto.
-
- * ext/strscan/strscan.c: encoding support.
-
-Sat Aug 25 10:59:19 2007 Koichi Sasada <ko1@atdot.net>
-
- * cont.c: separate Continuation and Fiber from core.
-
- * ext/continuation/*, ext/fiber/*: ditto.
-
- * include/ruby/ruby.h: remove rb_cFiber.
-
- * include/ruby/intern.h: add the rb_fiber_new() declaration.
-
- * enumerator.c (next_init): fix to use rb_fiber_new().
-
- * test/ruby/test_enumerator.rb: remove next? tests.
-
- * test/ruby/test_continuation.rb: add a require 'continuation'.
-
- * test/ruby/test_fiber.rb: add a require 'fiber'.
-
-Sat Aug 25 10:20:28 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * common.mk (prelude.o): depends on vm_core.h now.
-
- * common.mk (prelude.c): depends on tool/compile_prelude.rb too.
-
- * common.mk (prereq): updates all auto-generated sources.
-
- * tool/compile_prelude.rb: separated dynamic and static portions.
-
-Sat Aug 25 10:05:17 2007 Koichi Sasada <ko1@atdot.net>
-
- * prelude.rb: add Thread.exclusive. This class method
- is different from 1.8's. Thread.exclusive only does
- synchronize with VM global mutex.
-
-Sat Aug 25 09:39:50 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * array.c (rb_ary_s_try_convert): more document description.
-
- * re.c (rb_reg_s_try_convert): typo fixed.
-
-Sat Aug 25 08:54:12 2007 Koichi Sasada <ko1@atdot.net>
-
- * id.h, id.c: remove idFuncall.
-
- * compile.c (iseq_specialized_instruction): ditto.
-
-Sat Aug 25 08:47:28 2007 Koichi Sasada <ko1@atdot.net>
-
- * tool/compile_prelude.rb: fix to include "vm_core.h".
-
-Sat Aug 25 03:49:14 2007 Tanaka Akira <akr@fsij.org>
-
- * test/ruby/sentence.rb (Sentence): include Enumerable.
- (Sentence#each): defined.
-
- * test/ruby/test_assignment.rb: use Sentence#expand.
-
-Sat Aug 25 03:08:57 2007 Koichi Sasada <ko1@atdot.net>
-
- * prelude.rb: fix Mutex#synchronize definition.
-
-Sat Aug 25 02:08:45 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * array.c (rb_ary_s_try_convert): a new class method to convert
- object or nil if it's not target-type. this mechanism is used
- to convert types in the C implemented methods.
-
- * hash.c (rb_hash_s_try_convert): ditto.
-
- * io.c (rb_io_s_try_convert): ditto.
-
- * re.c (rb_reg_s_try_convert): ditto.
-
- * string.c (rb_str_s_try_convert): ditto.
-
-Sat Aug 25 00:49:44 2007 Koichi Sasada <ko1@atdot.net>
-
- * benchmark/bm_loop_generator.rb: added.
-
-Sat Aug 25 00:22:31 2007 Koichi Sasada <ko1@atdot.net>
-
- * prelude.rb: added. run this script on startup.
-
- * tool/compile_prelude.rb: compile prelude.rb to C string.
- (prelude.rb -> prelude.c)
-
- * common.mk: fix to build with prelude.c.
-
- * inits.c (rb_call_inits): ditto.
-
- * thread.c (Init_Thread): move definition of Mutex#synchronize
- to prelude.rb.
-
-Sat Aug 25 00:08:43 2007 Koichi Sasada <ko1@atdot.net>
-
- * compile.c (compile_massign_opt): fix to skip massign optimization
- with global variables.
-
- * bootstraptest/test_massign.rb: add some tests for above.
-
-Fri Aug 24 18:42:03 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * test/ruby/test_dir.rb (TestDir::setup): ?c now makes a string.
-
- * lib/test/unit/autorunner.rb (Test::Unit::AutoRunner::initialize):
- initialize @workdir to stop warning.
-
-Fri Aug 24 18:30:50 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/drb/drb.rb (DRb::DRbServer::InvokeMethod::perform_without_block):
- replace funcall by send!. other files in the distribution as well.
-
-Fri Aug 24 17:06:56 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (rb_f_send_bang): abandon the name funcall for private
- aware method call.
-
-Fri Aug 24 15:27:12 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * enumerator.c (enumerator_next): stop pre-fetching.
-
- * enumerator.c (Init_Enumerator): remove next? method.
-
-Fri Aug 24 15:14:57 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (rb_f_loop): now handles StopIteration exception.
-
-Thu Aug 23 20:31:31 2007 Koichi Sasada <ko1@atdot.net>
-
- * compile.c: optimize simple massign.
-
-Thu Aug 23 20:02:25 2007 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-
- * ext/win32ole/win32ole.c (reg_get_value): use RegQueryValueEx instead
- of RegQueryValueEx.
-
- * ext/win32ole/win32ole.c (typelib_file_from_clsid): fix the bug
- that the function always returns Qnil.
-
- * test/win32ole/test_win32ole_type.rb (test_initialize): add some test.
-
-Thu Aug 23 17:25:05 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in (group_member): check if presents.
-
- * configure.in (XCFLAGS): add _GNU_SOURCE on linux.
-
- * file.c (group_member): use system routine if available.
-
- * process.c: moved _GNU_SOURCE macro to Makefile.
-
-Thu Aug 23 16:59:40 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * compile.c (compile_massign), insnhelper.ci (vm_throw): not use C99
- comment.
-
- * cont.c (rb_cont_call, fiber_switch, rb_fiber_resume, rb_fiber_yield):
- suppress warnings.
-
- * cont.c (rb_fiber_start): change on non-volatile variable between
- setjmp and longjmp may not has an effect.
-
- * enumerator.c (sym_call): initialize first.
-
- * enumerator.c (enum_iter): typedefed.
-
- * enumerator.c (next_i): suppress a warning.
-
-Thu Aug 23 16:04:11 2007 Koichi Sasada <ko1@atdot.net>
-
- * compile.c, insns.def, parse.y: fix massign order. This change
- causes performance problem. Try vm1_swap benchmark.
- [ruby-dev:31522]
-
- * insns.def, insnhelper.ci: move process body of expandarray insn to
- vm_expandarray().
-
- * bootstraptest/test_knownbug.rb, bootstraptest/test_massign.rb:
- move a solved test.
-
-Thu Aug 23 15:51:19 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (f_norm_arg): ripper has no shadowing check.
-
- * parse.y (f_block_arg): dispatch blkarg_mark.
-
-Thu Aug 23 15:48:26 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * compile.c (make_masgn_lhs, iseq_compile_each): fixed indent.
-
- * compile.c (iseq_translate_threaded_code),
- vm_evalbody.ci (get_insns_address_table),
- template/vmtc.inc.tmpl (insns_address_table): constified.
-
- * vm_evalbody.ci (vm_eval),
- template/insns_info.inc.tmpl (insn_stack_increase, insn_ret_num):
- suppress warnings.
-
-Thu Aug 23 13:19:43 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (f_norm_arg): check also nested arguments. [ruby-dev:31502]
-
-Thu Aug 23 00:06:48 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * util.c: updated for ANSI C only. applied a patch from
- <snakagawa AT infoteria.co.jp>. [ruby-dev:31591]
-
-Thu Aug 23 00:04:45 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * missing/strtod.c: removed. [ruby-dev:31588]
-
- * LEGAL: updated.
-
-Wed Aug 22 15:59:44 2007 Koichi Sasada <ko1@atdot.net>
-
- * bootstraptest/test_knownbug.rb:
- fix typo of filename (test_knownbug.rb).
-
-Wed Aug 22 14:04:53 2007 Koichi Sasada <ko1@atdot.net>
-
- * bootstraptest/test_knownbug.rb: added. This file will contain
- test cases which point out known bug. If bug is fixed, tests
- should move to the suitable place.
-
- * bootstraptest/test_massign.rb: move a test which show known bug
- to test_knownbug.rb.
-
-Wed Aug 22 13:02:26 2007 Tanaka Akira <akr@fsij.org>
-
- * bootstraptest/runner.rb (in_temporary_working_directory):
- don't remove the directory specified by --dir.
-
-Wed Aug 22 05:51:23 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * util.c (ruby_strtod): replaced by the implementation by David
- M. Gay inspired by William D. Clinger's paper "How to Read Floating
- Point Numbers Accurately" [Proc. ACM SIGPLAN '90, pp. 92-101].
- a patch from Satoshi Nakagawa <snakagawa AT infoteria.co.jp>.
- [ruby-dev:31582]
-
- * test/ruby/test_float.rb (TestFloat::test_float): add test for
- precision.
-
-Wed Aug 22 03:51:07 2007 Koichi Sasada <ko1@atdot.net>
-
- * cont.c: add Fiber#resume and Fiber.yield.
- and Fiber::Core class to realize Coroutine.
-
- * include/ruby/intern.h: declare rb_fiber_yield(), rb_fiber_resume().
-
- * enumerator.c: use above api.
-
- * test/ruby/test_fiber.rb: fix and add tests for above changes.
-
Tue Aug 21 21:09:48 2007 Tanaka Akira <akr@fsij.org>
* lib/tmpdir.rb (Dir.mktmpdir): make directory suffix specifiable.
- suggested by knu. [ruby-dev:31568]
-
-Tue Aug 21 15:00:23 2007 Koichi Sasada <ko1@atdot.net>
-
- * st.c (st_clear): reset num_entries too.
Tue Aug 21 13:57:04 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* hash.c (st_foreach_func, rb_foreach_func): typedefed.
- * hash.c (rb_hash_clear): use st_clear() unless iterating.
-
- * st.c (struct st_table_entry): add new members, fore and back, to
- iterate in inserted order.
-
- * include/ruby/st.h (struct st_table): ditto.
-
-Tue Aug 21 04:09:06 2007 Koichi Sasada <ko1@atdot.net>
-
- * benchmark/bm_vm2_case.rb: add a new benchmark.
- YARV optimize case/when syntax. If every conditions
- are literal (such as Symbol, Fixnum, String), dispatch
- calc order will be O(1).
-
-Tue Aug 21 04:08:07 2007 Koichi Sasada <ko1@atdot.net>
-
- * test/ruby/test_enumerator.rb: fix last commit.
-
-Tue Aug 21 03:59:32 2007 Koichi Sasada <ko1@atdot.net>
-
- * test_enumerator.rb (enum_test): fix to return sorted
- array (for Hash test).
-
-Tue Aug 21 03:55:20 2007 Koichi Sasada <ko1@atdot.net>
-
- * enumerator.c (next_i): fix to return with Fiber#yield at
- the end of each block. [ruby-dev:31470]
+Mon Aug 20 17:25:33 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
- * enumerator.c (enumerator_next_p): call init_next if not
- initialized. [ruby-dev:31514]
+ * eval.c (mnew): should preserve noex as safe_level.
- * test/ruby/test_enumerator.rb: add tests for Enumerator.
+ * eval.c (rb_call0): tighten security check condition..
-Mon Aug 20 23:28:39 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
+Sat Aug 18 21:32:20 2007 Tanaka Akira <akr@fsij.org>
- * string.c (Init_String): remove Symbol.intern and Symbol#dump.
- [ruby-dev:31525]
-
- * dir.c (dir_foreach): return Enumerator if no block given.
- [ruby-dev:31525]
-
- * io.c (rb_io_s_foreach): argument count check before making
- Enumerator. [ruby-dev:31525]
-
-Mon Aug 20 23:17:14 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * vm_core.h (struct rb_thread_struct): removed first_func_arg and
- reuse first_args instead.
-
-Sun Aug 19 13:31:40 2007 Tanaka Akira <akr@fsij.org>
-
- * gc.c: use VALGRIND_MAKE_MEM_UNDEFINED to detect use of collected
- objects if valgrind is available. It cannot detect first 2 words
- because they are used as the free list.
-
-Sun Aug 19 13:13:52 2007 Koichi Sasada <ko1@atdot.net>
-
- * compile.c (iseq_compile_each/NODE_RESBODY): fix to add
- additional nop to prevent tailcall optimization.
-
- * vm_opts.h: clean up comments.
-
-Sun Aug 19 12:58:39 2007 Koichi Sasada <ko1@atdot.net>
-
- * insnhelper.ci (vm_call_bmethod): fix to propagate information
- that this proc is "from Method". [ruby-dev:31490]
-
- * proc.c (method_proc, rb_mod_define_method): ditto.
-
- * vm.c (vm_invoke_proc_core): removed.
-
- * vm_core.h: ditto.
-
-Sun Aug 19 12:36:11 2007 Tanaka Akira <akr@fsij.org>
-
- * test/ruby/sentence.rb: new method Sentence().
-
-Sun Aug 19 12:32:39 2007 Koichi Sasada <ko1@atdot.net>
-
- * insnhelper.ci (vm_callee_setup_arg): fix to mark enough VM stack.
- [ruby-dev:31492]
-
-Sat Aug 18 19:02:34 2007 Tanaka Akira <akr@fsij.org>
-
- * test/ruby/test_yield.rb (TestYieldGen): relax array size check
- in nested parameters.
- [ruby-dev:31485]
+ * lib/tmpdir.rb (Dir.mktmpdir): new method.
+ [ruby-dev:31462]
Sat Aug 18 17:44:42 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ext/tk/tcltklib.c (Init_tcltklib): use rb_set_end_proc().
-Sat Aug 18 17:40:11 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * thread.c (is_ruby_native_thread): check properly. [ruby-dev:31166]
-
-Sat Aug 18 16:44:15 2007 Koichi Sasada <ko1@atdot.net>
-
- * insnhelper.ci (vm_call_bmethod),
- vm.c (vm_invoke_proc_core): fix to do not restore
- $SAFE when proc invoked by bmethod.
-
- * vm_core.h: ditto.
-
-Sat Aug 18 16:44:49 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval_error.ci (ruby_error_print): call error_print.
-
- * eval_jump.ci, process.c (rb_exit, rb_f_exit, rb_f_abort): moved.
-
Sat Aug 18 15:59:52 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* process.c (detach_process_watcher): should not pass the pointer
to an auto variable to the thread to be created. pointed and
fix by KUBO Takehiro <kubo at jiubao.org> [ruby-dev:30618]
-Sat Aug 18 15:52:50 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * insnhelper.ci (vm_send_optimize): use MEMMOVE to shift values inside
- an array.
-
-Sat Aug 18 15:45:34 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * insnhelper.ci (vm_yield_setup_args): rsize and psize should not be
- negative.
-
-Sat Aug 18 14:35:00 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * insnhelper.ci (vm_callee_setup_arg, vm_send_optimize,
- vm_yield_setup_args): bulk copy for arguments.
-
-Sat Aug 18 13:55:58 2007 Koichi Sasada <ko1@atdot.net>
-
- * compile.c (iseq_compile_each): fix to allow self.x=
- if x= is private.
-
- * bootstraptest/test_method.rb: add a test for above.
-
-Sat Aug 18 14:05:34 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (reg_compile_gen): obtain error info from errinfo.
-
- * re.c (rb_reg_error_desc): make RegexpError for initialization error.
-
- * re.c (rb_reg_compile): return nil and set errinfo if error.
-
-Sat Aug 18 13:23:01 2007 Koichi Sasada <ko1@atdot.net>
-
- * eval.c: $! should not be writable.
-
- * eval.c (rb_rubylevel_errinfo): added. rb_errinfo() returns
- rb_thread_t#errinfo. rb_rubylevel_errinfo() returns $! value.
-
-Sat Aug 18 13:14:40 2007 Koichi Sasada <ko1@atdot.net>
-
- * insnhelper.ci (vm_callee_setup_arg): fix to check arguments
- correctly. [ruby-dev:31472]
-
-Sat Aug 18 13:13:06 2007 Koichi Sasada <ko1@atdot.net>
-
- * bootstraptest/test_exception.rb: add escape character ("\") for
- editors.
-
-Sat Aug 18 12:42:50 2007 Tanaka Akira <akr@fsij.org>
-
- * test/ruby/test_yield.rb (TestYieldGen): add test for yielding to
- lambda using lambda parameter passing emulator.
-
Sat Aug 18 12:24:30 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* sample/test.rb, test/ruby/test_system.rb(valid_syntax?): keep
comment lines first.
-Sat Aug 18 11:44:59 2007 Koichi Sasada <ko1@atdot.net>
-
- * compile.c (iseq_set_arguments), insnhelper.ci
- (vm_callee_setup_arg, vm_yield_setup_args):
- fix to cause raise on "lambda{|a|}.call(1, 2)".
- [ruby-dev:31464]
-
- * bootstraptest/test_block.rb: add tests for above.
-
-Sat Aug 18 01:12:01 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval.c (frame_func_id): return proper method ID.
-
-Fri Aug 17 22:43:11 2007 Koichi Sasada <ko1@atdot.net>
-
- * compile.c (iseq_compile_each): massign should return rvalue(s).
-
-Fri Aug 17 22:10:19 2007 Koichi Sasada <ko1@atdot.net>
-
- * test/ruby/test_basicinstructions.rb: fix old tests.
- class variables should be inherited.
-
-Fri Aug 17 21:20:44 2007 Koichi Sasada <ko1@atdot.net>
-
- * eval.c (rb_call), eval_method.ci (rb_add_method, rb_alias),
- insnhelper.ci (vm_call_method): fix to save safelevel for
- method node.
-
- * include/ruby/node.h: ditto.
-
- * bootstraptest/test_method.rb: add a test for above.
-
-Fri Aug 17 16:02:50 2007 Koichi Sasada <ko1@atdot.net>
-
- * thread.c (rb_thread_terminate_all): fix to ignore
- exceptions.
-
- * thread.c (thread_start_func_2): fix
- abort_on_exception process. [ruby-dev:31394]
-
-Fri Aug 17 14:38:36 2007 Tanaka Akira <akr@fsij.org>
-
- * bootstraptest/runner.rb (in_temporary_working_directory): use
- Dir.mktmpdir to create and remove temporary directory.
- (Dir.mktmpdir): define if not available.
- [ruby-dev:31431]
-
-Fri Aug 17 03:07:37 2007 Koichi Sasada <ko1@atdot.net>
-
- * compile.c (iseq_compile_each): fix throw insn option of next.
-
-Fri Aug 17 01:25:23 2007 Koichi Sasada <ko1@atdot.net>
-
- * compile.c (iseq_set_arguments), insnhelper.ci
- (vm_callee_setup_arg, vm_yield_setup_args): fix
- block parameter problems. [ruby-dev:31437], [ruby-dev:31440]
-
- * bootstraptest/test_block.rb: add a test of [ruby-dev:31440].
-
-Fri Aug 17 01:24:12 2007 Koichi Sasada <ko1@atdot.net>
-
- * iseq.c (ruby_iseq_disasm): fix to show arg_simple value.
-
-Fri Aug 17 01:21:29 2007 Koichi Sasada <ko1@atdot.net>
-
- * insns.def (throw): insert a RUBY_VM_CHECK_INTS(). [ruby-dev:31361]
-
Thu Aug 16 20:40:50 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
* bignum.c (bigtrunc): RBIGNUM(x)->len may be zero. out of bound
access. [ruby-dev:31404]
- * sprintf.c (rb_str_format): small float should not call
- rb_dbl2big().
-
-Thu Aug 16 22:10:06 2007 Koichi Sasada <ko1@atdot.net>
-
- * compile.c (iseq_compile_each): fix next/redo stack consistency.
- [ruby-dev:31373]
-
- * bootstraptest/test_syntax.rb: add tests for above.
-
- * sample/test.rb: fix to use __FILE__ instead of $0 to know basedir.
-
-Thu Aug 16 21:14:06 2007 WATANABE Hirofumi <eban@ruby-lang.org>
-
- * configure.in (BASERUBY): need AC_SUBST. [ruby-dev:31438]
-
-Thu Aug 16 19:18:26 2007 Tanaka Akira <akr@fsij.org>
-
- * test/ruby/sentence.rb: Sentence class implemented
- based on sentgen.rb
-
- * test/ruby/sentgen.rb: removed.
-
- * test/ruby/test_assignment.rb: use sentence.rb.
-
- * test/ruby/test_yield.rb: block parameter passing emulator
- implemented.
-
-Thu Aug 16 16:48:47 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in (BASERUBY): check if base ruby is runnable first.
- [ruby-core:11900]
-
Thu Aug 16 16:46:07 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* configure.in (aix): enable shared by default.
@@ -36879,49 +3860,10 @@ Thu Aug 16 13:06:08 2007 Tanaka Akira <akr@fsij.org>
(big_rshift): ditto.
[ruby-dev:31434]
-Thu Aug 16 06:29:08 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * io.c (argf_readpartial): argf_forward needs argc and argv.
-
-Thu Aug 16 02:47:39 2007 Koichi Sasada <ko1@atdot.net>
-
- * cont.c (rb_fiber_m_yield): added. use this function
- for Fiber#yield instead of rb_fiber_yield.
-
-Thu Aug 16 00:36:52 2007 Tanaka Akira <akr@fsij.org>
-
- * lib/tmpdir.rb (Dir.mktmpdir): new method. [ruby-dev:31416]
-
-Wed Aug 15 18:57:30 2007 Koichi Sasada <ko1@atdot.net>
-
- * gc.c (os_live_obj): fix to skip T_VALUES.
-
- * sample/test.rb: add an ObjectSpace test.
-
-Wed Aug 15 16:49:04 2007 Koichi Sasada <ko1@atdot.net>
-
- * inits.c (rb_call_inits): change initializing order.
- [ruby-dev:31420]
-
-Wed Aug 15 16:44:15 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * io.c (ARGF_FORWARD): wrongly compares with current_file with
- rb_stdout. should be rb_stdin. [ruby-cvs:20177]
-
-Wed Aug 15 14:59:21 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * io.c (rb_io_initialize, argf_each_line, argf_each_byte): suppress
- warnings.
+Thu Aug 16 04:09:19 2007 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
-Wed Aug 15 14:22:05 2007 Koichi Sasada <ko1@atdot.net>
-
- * parse.y: remove "//" type comment.
-
-Wed Aug 15 13:42:15 2007 Koichi Sasada <ko1@atdot.net>
-
- * parse.y: fix rules around f_margs. "make test" passes all tests.
-
- * bootstraptest/test_block.rb: add some tests for above.
+ * lib/rinda/tuplespace.rb (Rinda::TupleSpace#start_keeper): improve
+ keeper thread.
Wed Aug 15 13:50:10 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
@@ -36932,212 +3874,18 @@ Wed Aug 15 13:50:10 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* hash.c (delete_if_i): use rb_hash_delete_key() so that the block
isn't called twice. [ruby-core:11556]
-Wed Aug 15 13:39:25 2007 Koichi Sasada <ko1@atdot.net>
-
- * process.c (proc_geteuid): fix strange conversion. [ruby-dev:31417]
-
-Wed Aug 15 01:05:55 2007 Tanaka Akira <akr@fsij.org>
-
- * bootstraptest/runner.rb (assert_check): don't call newtest.
- (assert_equal): call newtest.
- (assert_match): ditto.
-
-Tue Aug 14 21:43:39 2007 Tanaka Akira <akr@fsij.org>
-
- * bootstraptest/runner.rb (assert_check): new method.
- (assert_match): new method.
- (assert_equal): use assert_check.
- (pretty): give failure description as an argument.
-
- * bootstraptest/test_exception.rb: use assert_match to describe the
- test for [ruby-dev:31407]. [ruby-dev:31412]
-
-Tue Aug 14 19:53:15 2007 Koichi Sasada <ko1@atdot.net>
-
- * proc.c (Init_Proc), eval.c (Init_eval), eval_intern.h: move
- init place of exception_error.
-
- * inits.c: ditto.
-
- * eval.c (Init_eval): set exception_error#throwed_state as TAG_FATAL.
- [ruby-dev:31407]
-
- * bootstraptest/test_exception.rb: add a test for above.
-
-Tue Aug 14 19:51:20 2007 Koichi Sasada <ko1@atdot.net>
-
- * common.mk: change test order (test -> btest).
-
-Tue Aug 14 00:04:27 2007 Kouhei Sutou <kou@cozmixng.org>
-
- * lib/rss/rss.rb: 0.1.8 -> 0.1.9.
-
- * test/rss/test_version.rb: followed the above change.
-
- * lib/rss/parser.rb: fixed a bug that handles unintended elements.
- Thanks to Takuo Yonezawa. [ruby-list:43841]
+Sun Arg 12 03:56:30 2007 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
-Mon Aug 13 17:23:10 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/rinda/tuplespace.rb: fix Rinda::TupleSpace keeper thread bug.
+ the thread is started too early. [ruby-talk:264062]
- * eval.c (rb_clear_trace_func, rb_thread_stop_timer_thread):
- declarations for forward references.
-
- * eval.c (rb_longjmp, eval): use local variable.
-
- * eval.c (rb_longjmp): string object not to be optimized.
-
-Mon Aug 13 13:21:58 2007 Tanaka Akira <akr@fsij.org>
-
- * lib/open-uri.rb: make ftp passive mode to avoid NAT problem.
- [ruby-dev:31377]
-
-Mon Aug 13 09:18:05 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * ext/stringio/stringio.c (strio_getc): should returns
- one-character string.
-
- * ext/stringio/stringio.c: remove unnecessary prototypes.
-
- * ext/stringio/stringio.c (strio_getbyte): new method.
-
- * ext/stringio/stringio.c (strio_readbyte): new method.
-
- * ext/stringio/stringio.c (strio_ungetc): should take a string as
- an input.
-
-Mon Aug 13 08:19:43 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * io.c (argf_close): always close via method.
-
- * io.c (Init_IO): remove obsolete Kernel#getc.
-
-Mon Aug 13 05:03:53 2007 Koichi Sasada <ko1@atdot.net>
-
- * thread.c (rb_thread_raise): check if target thread is
- thrown by another thread or not. [ruby-dev:31371]
-
- * bootstraptest/test_thread.rb: add a test for above.
-
-Mon Aug 13 04:35:30 2007 Koichi Sasada <ko1@atdot.net>
-
- * compile.c (iseq_peephole_optimize): fix peephole optimization
- bug. [ruby-dev:31360]
-
- * bootstraptest/test_syntax.rb: add a test for above.
-
-Mon Aug 13 04:02:29 2007 Koichi Sasada <ko1@atdot.net>
-
- * vm_dump.c (debug_print_pre): fix to show control frame count.
-
- * insns.def (opt_call_c_function): fix operand type.
-
- * lib/vm/instruction.rb: ditto.
-
- * insnhelper.ci (vm_push_frame, vm_pop_frame): fix to show
- control stack status on if VMDEBUG == 2.
-
- * vm.h: add a comment about VMDEBUG.
-
- * iseq.c (find_prev_line_no): fix to skip bug report if
- line is not found.
-
- * lib/vm/instruction.rb: fix to use build_string() on
- source code generators.
-
-Mon Aug 13 03:57:32 2007 Koichi Sasada <ko1@atdot.net>
-
- * template/yasmdata.rb.tmpl: fix type and name.
-
-Sat Aug 11 23:27:37 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * io.c (argf_each_line): should use #each_line, not #each.
-
- * io.c (argf_each_line): simplified.
-
- * io.c (argf_getline): should handle non T_FILE object in ARGV.
-
- * io.c (argf_each_byte): each_byte should yield bytes not
- one-character strings. [ruby-dev:31374]
+ * test/rinda/test_rinda.rb: ditto.
-Sat Aug 11 07:24:55 2007 Tadayoshi Funaba <tadf@dotrb.org>
+Sat Aug 11 07:34:10 2007 Tadayoshi Funaba <tadf@dotrb.org>
* lib/date/format.rb: reverted some wrongly erased "o" options
(pointed out by nobu).
-Sat Aug 11 00:01:12 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * thread.c (thread_start_func_2): not re-raise to main thread if it is
- joining the current thread.
-
-Fri Aug 10 23:54:46 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * thread.c (thread_create_core): inherit the priority of creating
- thread. submitted at [ruby-core:11873] by David Flanagan <david AT
- davidflanagan.com>. [ruby-core:11876]
-
-Fri Aug 10 05:12:19 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * thread.c (thread_start_func_2): let abort_on_exception work.
- [ruby-core:11873]
-
-Fri Aug 10 04:47:09 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (internal_id_gen): internal ID must be bigger than
- tLAST_TOKEN.
-
-Thu Aug 9 16:04:55 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (stmt): check if rhs has value before assignment instead
- inside node_assign_gen(). [ruby-dev:31293]
-
- * parse.y (call_bin_op_gen, call_uni_op_gen): split call_op_gen.
-
-Thu Aug 9 14:01:36 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (f_marg_list): renamed from f_marg_head.
-
- * parse.y (f_margs): allow multiple mandatory arguments after a splat.
- [ruby-dev:31153]
-
-Thu Aug 9 02:02:02 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * enum.c (enum_cycle): typo fixed. a patch from Kazuhiro
- NISHIYAMA <zn AT mbf.nifty.com>. [ruby-dev:31362]
-
-Wed Aug 8 19:17:40 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * ext/dl/cptr.c (rb_dlptr_s_to_ptr): no longer check
- HAVE_RB_IO_STDIO_FILE.
-
-Wed Aug 8 15:52:01 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * enumerator.c (enumerator_next_p): should check correctly even when
- e.next has not been called before.
-
- * enumerator.c (enumerator_next): raise StopIteration (name taken
- from Python) instead of IndexError.
-
- * enum.c (enum_zip): catch StopIteration exception.
-
- * enumerator.c (enumerator_with_index): return Enumerator if no
- block is given.
-
- * test/ruby/test_iterator.rb (TestIterator::test_enumerator): add
- test for enumerators.
-
-Wed Aug 8 11:48:37 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * bignum.c (rb_big2str0): should not use RTEST for non-VALUE.
-
-Wed Aug 8 11:25:25 2007 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * bignum.c (rb_big2str0): should preserve sign mark.
-
-Wed Aug 8 11:02:43 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * common.mk (btest-miniruby, test-sample): split the test target
- so that -k option works.
-
Tue Aug 7 14:58:39 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ext/pty/pty.c (establishShell): handshaking before close slave
@@ -37149,130 +3897,15 @@ Tue Aug 7 14:58:39 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ext/pty/expect_sample.rb: support for autologin.
-Tue Aug 7 13:58:03 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * include/ruby/ruby.h (ruby_special_consts): added RUBY_SPECIAL_SHIFT.
-
- * .gdbinit: some improvements.
-
-Tue Aug 7 13:28:32 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * common.mk (node_name.inc): use $? instead of $< for nmake.
- [ruby-dev:31356]
-
Tue Aug 7 12:45:13 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* configure.in (ac_cv_func_isinf): set yes also on OpenSolaris.
[ruby-Bugs-12859]
-Tue Aug 7 12:31:51 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * io.c (pipe_open): fix for win32 platforms.
-
-Tue Aug 7 02:58:33 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * bignum.c (rb_big2str0): make Bignum#to_s even faster. a patch
- from Kenta Murata <muraken AT gmail.com>. [ruby-dev:31354]
-
-Tue Aug 7 01:42:05 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * enum.c (enum_zip): zip no longer converts arguments into
- arrays, uses enumerators.
-
-Tue Aug 7 01:27:47 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * cont.c (rb_fiber_yield): change argument ordering. export.
-
- * cont.c (rb_fiber_current): export
-
- * include/ruby/intern.h: export several functions from cont.c.
-
- * enumerator.c (enumerator_next): new method to implement external
- iterator (generator) using fiber.
-
- * enumerator.c (enumerator_next_p): new method to check whether
- any element is left in the generator sequence.
-
- * enumerator.c (enumerator_rewind): a new method to rewind the
- generator sequence.
-
-Tue Aug 7 01:15:24 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * enum.c (enum_cycle): new method to cycle enumerable forever.
-
-Tue Aug 7 00:05:38 2007 Keiju Ishitsuka <keiju@ruby-lang.org>
-
- * irb/ruby-lex.rb: support for '\c'. [ruby-talk:263508]
-
-Mon Aug 6 20:29:22 2007 Koichi Sasada <ko1@atdot.net>
-
- * insnhelper.ci, insns.def: move some statements to functions.
-
- * vm.c, vm.h, vm_evalbody.ci: fix include/typedef places.
-
-Mon Aug 6 18:41:12 2007 Koichi Sasada <ko1@atdot.net>
-
- * lib/vm/instruction.rb (make_header_analysys): fix last commit.
-
-Mon Aug 6 18:33:22 2007 Koichi Sasada <ko1@atdot.net>
-
- * lib/vm/instruction.rb (make_header_analysys): add to separate
- header addition process.
-
Mon Aug 6 17:36:29 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/rexml/encodings/{ISO-8859-15,CP-1252}.rb: fixed invalid syntax.
-Mon Aug 6 16:57:08 2007 Koichi Sasada <ko1@atdot.net>
-
- * sample/test.rb: fix to output file name if it contains
- invalid syntax.
-
-Mon Aug 6 16:41:22 2007 Koichi Sasada <ko1@atdot.net>
-
- * parse.y (value_expr_gen): fix to cause "void value expression"
- when jump expression such as "next" are shown on value_expr().
- [ruby-dev:31119]
-
- * bootstraptest/test_syntax.rb: fix to above change.
-
-Mon Aug 6 14:36:30 2007 Koichi Sasada <ko1@atdot.net>
-
- * parse.y: fix a f_marg rule. [ruby-dev:31160]
-
-Mon Aug 6 14:29:30 2007 Koichi Sasada <ko1@atdot.net>
-
- * bootstraptest/runner.rb (assert_equal): add additional
- message parameter.
-
-Mon Aug 6 13:34:09 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * common.mk (INSNS): not chdir to srcdir.
-
- * common.mk (node_name.inc): auto-generate node name list.
-
- * iseq.c (ruby_node_name): ditto.
-
- * iseq.c (iseq_s_compile_option_get, Init_ISeq): added a new
- method VM::InstructionSequence::compile_option.
-
- * lib/vm/instruction.rb (RubyVM::SourceCodeGenerator): --destdir
- option.
-
- * tool/node_name.rb: to auto-generate node name list.
-
-Sun Aug 5 11:51:39 2007 Kouhei Sutou <kou@cozmixng.org>
-
- * lib/rss, sample/rss, test/rss:
- - 0.1.7 -> 0.1.8.
- - supported <itunes:XXX>.
- - reverted backward incompatibility API changes introduced 0.1.7.
-
-Sun Aug 5 04:56:25 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * io.c (pipe_open_v, pipe_open_s): separate array and string
- cases. [ruby-dev:31344]
-
Fri Aug 3 11:05:54 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ext/extmk.rb (extmake): save all CONFIG values.
@@ -37291,47 +3924,11 @@ Fri Aug 3 07:09:05 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/mkmf.rb (find_type): new method.
-Fri Aug 3 00:00:20 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * bignum.c (big2str_table): base cannot be 0 or 1.
-
-Thu Aug 2 23:42:57 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (reg_compile_gen): set error if failed to compile regexp
- literal. [ruby-dev:31336]
-
- * re.c (option_to_str, arg_kcode, opt_kcode): options conversion
- between int and string.
-
- * re.c (rb_reg_compile): should not use regexp which could not get
- initialized. [ruby-dev:31333]
- return error message to let the parser know it.
-
- * re.c (rb_reg_compile): append regexp options to error message.
- [ruby-dev:31334]
-
-Thu Aug 2 22:05:32 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * bignum.c (rb_big2str0): faster Bignum#to_s using Karatsuba
- algorithm. a patch from Yusuke ENDOH <mame AT tsg.ne.jp>
- in [ruby-dev:31312], slightly modified by Kenta Murata
- <muraken AT gmail.com> in [ruby-dev:31339].
-
Thu Aug 2 13:46:39 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* sprintf.c (rb_f_sprintf): should not check positional number as
width. [ruby-core:11838]
-Wed Aug 1 12:40:05 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * generic.rb (URI::Generic::merge_path): behave as RFC 3986.
- [ruby-talk:252052]
-
-Tue Jul 31 23:38:09 2007 Tadayoshi Funaba <tadf@dotrb.org>
-
- * lib/date/format.rb (_parse): now interprets slashed numerical
- dates as a big endian (except dd/mm/yyyy). [experimental]
-
Mon Jul 30 11:16:40 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* bignum.c (rb_big_aref): check for Bignum index range.
@@ -37342,11 +3939,6 @@ Sat Jul 28 09:35:41 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
* ext/digest/lib/digest.rb (Digest::self.const_missing): avoid
infinite recursive const_missing call. [ruby-talk:262193]
-Thu Jul 26 20:40:25 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * range.c (range_eqq): call_super() in === does not work well
- since Enumerable#=== has different behavior. [ruby-dev:31296]
-
Thu Jul 26 13:57:45 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* dln.c (load_1, dln_find_1): constified.
@@ -37363,37 +3955,12 @@ Thu Jul 26 13:57:45 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ruby.c (ruby_init_loadpath): not convert built-in paths.
-Tue Jul 24 10:37:04 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * io.c (rb_f_p): return nil if no argument. [ruby-dev:31285]
-
-Tue Jul 24 01:05:07 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * regint.h (USE_MATCH_RANGE_IS_COMPLETE_RANGE): undef to achieve old
- rindex behavior. [ruby-dev:31265]
-
-Mon Jul 23 18:37:14 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * include/ruby/oniguruma.h: upgrade to Oniguruma 5.9.0. fixes
- some memory violation. [ruby-dev:31070]
-
-Sun Jul 22 20:09:49 2007 Tadayoshi Funaba <tadf@dotrb.org>
+Sun Jul 22 16:07:12 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/date/format.rb (Date._parse): now accepts some new
- hints. [experimental]
+ * intern.h (is_ruby_native_thread): removed since declared as an int
+ function in ruby.h already.
- * lib/parsedate.rb: followed the changes on
- lib/date/format.rb. [experimental]
-
-Sun Jul 22 16:06:56 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * thread.c (is_ruby_native_thread): made an int function as
- well as version 1.8.
-
- * include/ruby/ruby.h (is_ruby_native_thread): moved prototype
- from intern.h as well as version 1.8.
-
-Sun Jul 22 14:33:46 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun Jul 22 14:33:40 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* file.c (rb_file_s_rename): deleted code to get rid of a bug of
old Cygwin.
@@ -37401,7 +3968,7 @@ Sun Jul 22 14:33:46 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* file.c (rb_file_truncate): added prototype of GetLastError()
on cygwin. [ruby-dev:31239]
- * include/ruby/intern.h (is_ruby_native_thread): prototype.
+ * intern.h (is_ruby_native_thread): prototype.
* missing/strftime.c (strftime): fix printf format and actual
arguments.
@@ -37410,35 +3977,21 @@ Sun Jul 22 14:33:46 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ext/tk/tcltklib.c (ip_finalize): ditto.
- * ext/win32ole/win32ole.c (lcid_installed): ditto.
-
- * ext/socket/getnameinfo.c: include stdio.h always.
-
-Sat Jul 21 21:39:12 2007 Tadayoshi Funaba <tadf@dotrb.org>
+ * ext/dl/ptr.c (rb_dlptr_inspect): ditto. [ruby-dev:31268]
- * lib/date.rb, lib/date/format.rb (Date._parse): now can take some
- hints (its aim must be mainly determination of endianness of
- date). [experimental]
+ * ext/dl/sym.c (rb_dlsym_inspect): ditto.
- * lib/date.rb, lib/date/format.rb (Date._parse): now completes
- truncated year as default action. [experimental]
+ * ext/socket/getnameinfo.c: include stdio.h always.
- * lib/date.rb, lib/date/format.rb: added ::iso8601, ::rfc3339,
- ::xmlschema, ::rfc2822, ::httpdate, ::jisx0301, #xmlschema,
- #httpdate. [experimental]
+ * ext/win32ole/win32ole.c (ole_hresult2msg, folevariable_name,
+ folevariable_ole_type, folevariable_ole_type_detail,
+ folevariable_value, folemethod_visible): missing return value.
Sat Jul 21 17:48:26 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * common.mk: inverted rules order.
-
- * thread_win32.ci (w32_create_thread): bcc does not have
- _beginthreadex().
-
* lib/mkmf.rb (create_makefile): make OBJS depend on RUBY_EXTCONF_H
only if extconf.h is created.
- * bcc32/Makefile.sub: headers have moved.
-
* bcc32/{Makefile.sub,configure.bat,setup.mak: configure_args
support.
@@ -37455,63 +4008,21 @@ Sat Jul 21 12:06:48 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/mkmf.rb (init_mkmf): should remove mkmf.log too.
-Sat Jul 21 01:45:03 2007 Tadayoshi Funaba <tadf@dotrb.org>
+Sat Jul 21 01:53:17 2007 Tadayoshi Funaba <tadf@dotrb.org>
* lib/date/format.rb (Date._parse): completes calendar week based year.
* lib/date/format.rb (Date._parse): detects year of ordinal date in
extended format.
-Fri Jul 20 16:30:31 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * compile.c (iseq_set_sequence): raise SyntaxError instead of rb_bug
- since this function can be called from VM::InstructionSequence.load.
-
- * compile.c (insn_set_sc_state, iseq_set_sequence_stackcaching): ditto.
-
-Fri Jul 20 16:11:33 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * compile.c, compile.h (DECL_ANCHOR, INIT_ANCHOR): split not to
- initialize aggregations with dynamic values. [ruby-talk:259306]
-
- * eval.c (rb_protect): not to initialize aggregations with dynamic
- values. [ruby-talk:259306]
-
- * gc.c (mark_current_machine_context): ditto.
-
- * thread.c (thgroup_list, call_trace_func): ditto.
-
- * vm.c (vm_init_redefined_flag): ditto.
-
Fri Jul 20 15:22:51 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ext/openssl/ossl_config.c (ossl_config_set_section): do not
initialize aggregations with dynamic values. [ruby-talk:259306]
-Fri Jul 20 10:39:28 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (stmt, mlhs_node, lhs, arg, var_ref): return dummy
- NODE_BEGIN after errors. [ruby-dev:31100], [ruby-dev:31118]
-
- * parse.y (remove_begin): keep empty NODE_BEGIN, instead of null.
- [ruby-dev:31252], [ruby-dev:31263]
-
-Fri Jul 20 09:50:40 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * bootstraptest/runner.rb (get_result_string): check $?.coredump?
- first.
-
- * bootstraptest/runner.rb (cleanup_coredump, check_coredump): see
- stackdump file too.
-
-Thu Jul 19 20:39:30 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * parse.y (value_expr_gen): warn for empty expression ().
- [ruby-dev:31252]
-
Thu Jul 19 19:24:14 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * eval_error.ci (get_backtrace): check the result more.
+ * eval.c (get_backtrace): check the result more.
[ruby-dev:31261] [ruby-bugs-12398]
Thu Jul 19 14:38:45 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
@@ -37526,40 +4037,29 @@ Wed Jul 18 16:57:41 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* bignum.c (rb_big_pow): refine overflow check. [ruby-dev:31242]
-Wed Jul 18 09:19:07 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (rb_parser_append_print, rb_parser_while_loop): moved check
- for node to the head.
-
- * ruby.c (proc_options): do nothing for -p/-n options if tree is null.
- submitted by Yusuke ENDOH <mame AT tsg.ne.jp> at [ruby-dev:31243].
-
Wed Jul 18 08:47:09 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
* time.c (time_succ): Time#succ should return a time object in the
same timezone mode to the original. [ruby-talk:260256]
+Tue Jul 17 00:50:53 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * numeric.c (fix_pow): integer power calculation: 0**n => 0,
+ 1**n => 1, -1**n => 1 (n: even) / -1 (n: odd).
+
+ * test/ruby/test_fixnum.rb (TestFixnum::test_pow): update test
+ suite. pow(-3, 2^64) gives NaN when pow(3, 2^64) gives Inf.
+
Mon Jul 16 23:07:51 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
* lib/base64.rb (Base64::b64encode): should not specify /o option
for regular expression. [ruby-dev:31221]
-Mon Jul 16 22:57:53 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * sprintf.c (rb_str_format): make %u behave like %d for negative
- values, since decimal format does not work with preceding dots.
- [ruby-core:11575]
-
Mon Jul 16 18:29:33 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* string.c (rb_str_rindex_m): accept string-like object convertible
with #to_str method, as well as rb_str_index_m. [ruby-core:11692]
-Mon Jul 16 07:17:28 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * insns.def (getspecial): lfp_svar_get() requires int for special
- global variables.
-
Mon Jul 16 05:45:53 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* sprintf.c (rb_f_sprintf): more checks for format argument.
@@ -37570,9 +4070,11 @@ Mon Jul 16 00:26:10 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* bignum.c (rb_big_pow): removed invariant variable. [ruby-dev:31236]
-Sun Jul 15 22:24:37 2007 pegacorn <subscriber.jp AT gmail.com>
+Sun Jul 15 23:59:57 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * bignum.c (rb_big_neg): SIGNED_VALUE isn't in 1.8.
- * ext/dl/cfunc.c (rb_dlcfunc_call): adjust format. [ruby-dev:31222]
+Sun Jul 15 22:24:49 2007 pegacorn <subscriber.jp AT gmail.com>
* ext/digest/digest.c (rb_digest_instance_update,
rb_digest_instance_finish, rb_digest_instance_reset,
@@ -37596,8 +4098,7 @@ Sun Jul 15 22:24:37 2007 pegacorn <subscriber.jp AT gmail.com>
* win32/win32.c: include mbstring.h for _mbspbrk(). [ruby-dev:31232]
- * include/ruby/win32.h (rb_w32_getcwd): prototype added.
- [ruby-dev:31232]
+ * win32.h (rb_w32_getcwd): prototype added. [ruby-dev:31232]
Sun Jul 15 21:07:43 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
@@ -37612,67 +4113,33 @@ Sun Jul 15 04:42:20 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* bignum.c (get2comp): do nothing for empty Bignum. [ruby-dev:31225]
-Sat Jul 14 22:49:30 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * numeric.c (fix_pow): integer power calculation: 0**n => 0,
- 1**n => 1, -1**n => 1 (n: even) / -1 (n: odd).
-
- * test/ruby/test_fixnum.rb (TestFixnum::test_pow): update test
- suite. pow(-3, 2^64) gives NaN when pow(3, 2^64) gives Inf.
-
-Sat Jul 14 18:46:35 2007 Tanaka Akira <akr@fsij.org>
-
- * configure.in: add --with-valgrind.
-
- * gc.h (SET_MACHINE_STACK_END): new macro to replace
- rb_gc_set_stack_end. it find out accurate stack boundary by
- asm using gcc on x86.
-
- * thread.c (rb_gc_set_stack_end): don't define if asm-version
- SET_MACHINE_STACK_END is available.
-
- * gc.c (mark_current_machine_context): extracted from garbage_collect.
- it use SET_MACHINE_STACK_END to not scan out of stack area.
- it notify conservative GC information to valgrind if
- --with-valgrind.
-
Sat Jul 14 14:04:06 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* enum.c (sort_by_cmp): check if reentered. [ruby-dev:24291]
-Sat Jul 14 11:08:28 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * ext/json/ext/generator/generator.c (check_max_nesting): wrong
- format specifier. a patch from pegacorn <subscriber.jp AT gmail.com>.
- [ruby-dev:31217]
-
-Sat Jul 14 02:27:43 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * numeric.c (int_pow): overflow detection using FIT_SQRT_LONG().
- [ruby-dev:31215]
-
-Sat Jul 14 02:05:53 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * insns.def (opt_div): LONG2FIX() may not work for corner cases,
- use LONG2NUM() instead. [ruby-dev:31210]
+Sat Jul 14 12:44:14 2007 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
-Sat Jul 14 00:34:01 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * test/openssl/test_pkcs7.rb: reverted the previous patch. it should
+ be as it was to check interface compatibility. sorry for bothering
+ with this.
- * numeric.c (int_round): should not return false, but self.
- [ruby-dev:31212]
+Sat Jul 14 12:16:17 2007 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
-Fri Jul 13 18:31:27 2007 Koichi Sasada <ko1@atdot.net>
+ * test/openssl/test_pkcs7.rb: follow the library change. applied a
+ patch from <zn at mbf.nifty.com> [ruby-dev:31214].
+ NOTE: r12496 imports the latest openssl libs from trunk to ruby_1_8
+ though its's not ChangeLog-ed. maintainer should aware that.
- * include/ruby/intern.h: remove unused function declarations.
+Sat Jul 14 02:51:52 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
- * include/ruby/ruby.h: ditto.
+ * numeric.c (fix_pow): 0**2 should not raise floating point
+ exception. [ruby-dev:31216]
-Fri Jul 13 17:32:37 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
+Sat Jul 14 02:25:48 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
- * vm.c (vm_free): clear free'ed living_threads field.
- [ruby-dev:31163]
+ * numeric.c (int_pow): wrong overflow detection. [ruby-dev:31213]
- * insns.def (opt_succ): use cast to shut a warning up.
+ * numeric.c (int_pow): wrong overflow detection. [ruby-dev:31215]
Fri Jul 13 16:10:00 2007 Tanaka Akira <akr@fsij.org>
@@ -37685,319 +4152,30 @@ Fri Jul 13 15:02:15 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* win32/win32.c (CreateChild): enclose command line except for
command.com which can not handle quotes. [ruby-talk:258939]
-Fri Jul 13 11:33:09 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * range.c (range_max, range_min): return nil for empty set as well as
- 1.8 and Enumerable. [ruby-dev:31198]
-
-Fri Jul 13 11:28:37 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * parse.y (bvar): semicolon was lost for ripper description.
- [ruby-dev:31140]
-
-Fri Jul 13 11:25:10 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (program, stmt, primary): reduced duplicated code.
-
- * parse.y (dsym): convert also literals containing NUL to
- symbol.
-
- * parse.y (debug_lines): use rb_hash_lookup() to get rid of
- call of Hash#default.
-
- * parse.y (ripper_warningS): unused in ripper right now.
-
-Fri Jul 13 10:33:29 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * array.c (rb_ary_flatten_bang): check argument if valid
- integer. [ruby-dev:31197]
-
Fri Jul 13 10:10:46 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/mkmf.rb (link_command, cc_command, cpp_command): do not expand
::CONFIG which is an alias of MAKEFILE_CONFIG.
-Thu Jul 12 21:38:02 2007 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * insns.def (opt_succ): use LONG_MAX as maximum Fixnum VALUE.
- [ruby-dev:31199]
-
-Thu Jul 12 18:42:18 2007 Tanaka Akira <akr@fsij.org>
-
- * range.c (range_max): use FIX2LONG instead of FIX2INT to avoid
- RangeError by ((-0x80000001)...(-0x80000001)).max on LP64.
-
- * insns.def (opt_plus): use FIX2LONG instead of FIX2INT to avoid
- RangeError by 0x3fffffffffffffff+1 on LP64.
-
- * insns.def (opt_succ): don't use 0x80000000 which assumes 32bit VALUE.
- use FIX2LONG instead of FIX2INT.
- [ruby-dev:31190]
-
Thu Jul 12 17:03:15 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* struct.c (rb_struct_init_copy): disallow changing the size.
[ruby-dev:31168]
-Thu Jul 12 12:58:21 2007 Koichi Sasada <ko1@atdot.net>
-
- * blockinlining.c: remove "yarv" prefix.
-
- * array.c, numeric.c: ditto.
-
- * insnhelper.ci, insns.def, vm_evalbody.ci: ditto.
-
- * yarvcore.c: removed.
-
- * yarvcore.h: renamed to core.h.
-
- * cont.c, debug.c, error.c, process.c, signal.c : ditto.
-
- * ext/probeprofiler/probeprofiler.c: ditto.
-
- * id.c, id.h: added.
-
- * inits.c: ditto.
-
- * compile.c: rename internal functions.
-
- * compile.h: fix debug flag.
-
- * eval.c, object.c, vm.c: remove ruby_top_self.
- use rb_vm_top_self() instead.
-
- * eval_intern.h, eval_load: ditto.
-
- * gc.c: rename yarv_machine_stack_mark() to
- rb_gc_mark_machine_stack().
-
- * insnhelper.h: remove unused macros.
-
- * iseq.c: add iseq_compile() to create iseq object
- from source string.
-
- * proc.c: rename a internal function.
-
- * template/insns.inc.tmpl: remove YARV prefix.
-
- * thread.c: use rb_iseq_eval() and rb_str_new2().
-
- * vm.c (rb_iseq_eval): added.
-
- * vm.c: move some functions from yarvcore.c.
-
- * vm_dump.c: fix to remove compiler warning.
-
-Thu Jul 12 12:24:29 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * insns.def (opt_succ): fixed typo. [ruby-dev:31189]
-
-Thu Jul 12 10:30:46 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * thread.c (thread_start_func_2): moved prototye from thread_*.ci.
-
- * thread_pthread.ci (thread_start_func_2): not use a directive
- inside a macro argument. [ruby-talk:258763]
-
- * thread.c (thread_join): pthread_t may not be pointer.
-
- * thread_pthread.ci (ubf_select_each): ditto.
-
-Thu Jul 12 05:32:28 2007 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * include/ruby/ruby.h (FIX2ULONG): drop sign bit for LLP64 platform.
-
-Tue Jul 10 19:34:45 2007 Koichi Sasada <ko1@atdot.net>
-
- * hash.c (rb_hash_lookup): added. this function is similar to
- rb_hash_aref(), but doesn't call Hash#default when no entry
- exists.
-
- * include/ruby/intern.h: ditto.
-
- * insnhelper.ci (lfp_svar_get): use rb_hash_lookup().
+Wed Jul 11 23:38:14 2007 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
-Tue Jul 10 19:16:28 2007 Koichi Sasada <ko1@atdot.net>
-
- * eval.c, insnhelper.ci, vm.c: change cref index (-1 -> 2).
-
-Tue Jul 10 18:49:56 2007 Koichi Sasada <ko1@atdot.net>
-
- * eval.c (exec_under): add proper casts.
-
-Tue Jul 10 16:58:16 2007 Koichi Sasada <ko1@atdot.net>
-
- * vm.c, insnhelper.ci: fix svar interface.
-
- * compile.c (iseq_compile_each), yarvcore.h: fix to use new
- svar interface for flip flop.
-
- * eval.c: ditto.
-
- * insns.def: ditto.
-
- * include/ruby/intern.h: remove "rb_svar()" declaration.
-
-Tue Jul 10 16:52:01 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * compile.c (rb_iseq_compile): formatted if/else to switch statement.
-
-Tue Jul 10 15:57:53 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * bootstraptest/test_flip.rb: new test for flip-flop operator.
+ * random.c: documentation fix. srand(0) initializes PRNG with '0',
+ not with random_seed.
Tue Jul 10 14:50:01 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* bcc32/{Makefile.sub,setup.mak}: remove surplus slash from srcdir.
-Mon Jul 9 02:17:36 2007 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * cont.c (cont_restore_1): workaround for x64-mswin64's SEH.
-
-Sun Jul 8 02:08:53 2007 NARUSE, Yui <naruse@ruby-lang.org>
-
- * lib/json.rb, lib/json/, ext/json/: import JSON 1.1.1
-
-Sat Jul 7 21:59:29 2007 Tanaka Akira <akr@fsij.org>
-
- * lib/pp.rb (PP::PPMethods#pp_hash): sort condition changed:
- all keys have a same class which is kind of Comparable.
-
-Sat Jul 7 17:12:37 2007 Koichi Sasada <ko1@atdot.net>
-
- * compile.c: use rb_bug() instead of rb_compile_error().
-
-Sat Jul 7 16:12:48 2007 Koichi Sasada <ko1@atdot.net>
-
- * parse.y: fix node construction (around f_margs).
- [ruby-dev:31143]
-
- * bootstraptest/test_block.rb: add a test for above.
-
- * insnhelper.ci: fix indent.
-
-Sat Jul 7 15:36:50 2007 Tanaka Akira <akr@fsij.org>
-
- * lib/pp.rb (PP::PPMethods#pp_hash): sort if
- all keys are strings, symbols or integers.
-
-Sat Jul 7 15:30:05 2007 Koichi Sasada <ko1@atdot.net>
-
- * insnhelper.ci (vm_yield_setup_args), vm.c, insns.def:
- fix to pass nil as block parameter to yielded block.
- [ruby-dev:31147]
-
- * bootstraptest/test_block.rb: add a test for above.
-
-Fri Jul 6 19:55:10 2007 Keiju Ishitsuka <keiju@ruby-lang.org>
-
- * lib/irb.rb: typo. Thanks, Giles Bowkett.
-
- * lib/irb/completion.rb: support Ruby1.9 changing return value
- String to Symbol for Object#methods, etc. [ruby-dev:31148].
-
-Fri Jul 6 18:20:50 2007 Koichi Sasada <ko1@atdot.net>
-
- * bootstraptest/runner.rb: fix load path.
-
- * common.mk: fix "test" rule to run with "btest".
-
- * rubytest.rb, sample/test.rb: fix to show tests progress.
-
-Fri Jul 6 15:37:48 2007 Koichi Sasada <ko1@atdot.net>
-
- * test/ruby/test_iterator.rb: fix test to 1.9 spec.
-
-Fri Jul 6 15:21:25 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Jul 6 15:22:58 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* eval.c (rb_interrupt): suppress a gcc's officious warning.
-Fri Jul 6 14:57:12 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (keyword_to_name): constified.
-
- * ext/ripper/eventids2.c (token_to_eventid): ditto.
-
-Fri Jul 6 14:50:40 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * bootstraptest/runner.rb: added --quiet option.
-
-Fri Jul 6 14:35:25 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (f_marg): wrap f_norm_arg assignment node with NODE_LIST.
- [ruby-dev:31141]
-
-Fri Jul 6 12:15:01 2007 Tanaka Akira <akr@fsij.org>
-
- * test/ruby/sentgen.rb: new file.
-
- * test/ruby/test_assignment.rb: tests implemented using assignment
- generator and emulator.
-
-Fri Jul 6 03:06:58 2007 Koichi Sasada <ko1@atdot.net>
-
- * insns.def: remove unused code.
-
- * compile.c (compile_massign): fix to invoke to_splat on
- splat rhs (example: *a = *nil). [ruby-dev:31136]
-
- * bootstraptest/test_massign.rb: add tests for above.
-
- * compile.c (iseq_compile_each): disable excess optimization.
- [ruby-dev:31126]
-
-Fri Jul 6 02:08:25 2007 Koichi Sasada <ko1@atdot.net>
-
- * insns.def: fix to invoke nil.to_splat on NODE_ARGSCAT.
- [ruby-dev:31138].
-
- * bootstraptest/test_literal.rb: add tests for above.
-
-Thu Jul 5 19:45:55 2007 Koichi Sasada <ko1@atdot.net>
-
- * yarvcore.h: rename rb_control_frame_t#magic to flag.
-
- * vm.h: add VM_FRAME_TYPE() and VM_FRAME_FLAG().
-
- * cont.c, insnhelper.ci, insns.def, vm.c, vm_dump.c,
- vm_evalbody.ci, yarvcore.c: apply above changes.
-
-Thu Jul 5 19:16:14 2007 Koichi Sasada <ko1@atdot.net>
-
- * test/ruby/test_basicinstructions.rb: remove an assertion using
- unsupported hash literal (such as {1, 2}).
-
- * test/ruby/test_hash.rb: ditto.
-
-Thu Jul 5 19:12:22 2007 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * ruby.c: Qfalse is VALUE, not pointer.
-
-Thu Jul 5 18:42:01 2007 Koichi Sasada <ko1@atdot.net>
-
- * compile.c (iseq_compile_each): add break catch point.
-
- * insns.def (throw): support correct "break" and "return".
- this commit achieve that "make test" passes all tests.
-
- * vm.c: ditto.
-
-Thu Jul 5 18:44:12 2007 Tanaka Akira <akr@fsij.org>
-
- * parse.y (mlhs_basic): use mlhs_post after tSTAR.
- [ruby-dev:31109]
-
-Thu Jul 5 18:27:58 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * include/ruby/{intern,ruby}.h, compile.[ch], error.c, eval.c,
- eval_load.c, gc.c, iseq.c, main.c, parse.y, re.c, ruby.c,
- yarvcore.[ch] (ruby_eval_tree, ruby_sourcefile, ruby_sourceline,
- ruby_nerrs): purge global variables.
-
- * ruby.c (proc_options): moved do_print and do_loop options
- handling from ruby_process_options().
-
-Thu Jul 5 16:37:34 2007 NAKAMURA Usaku <usa@ruby-lang.org>
+Thu Jul 5 16:44:28 2007 NAKAMURA Usaku <usa@ruby-lang.org>
* numeric.c (int_pow): fix previous nubu's commit.
@@ -38007,684 +4185,41 @@ Thu Jul 5 15:56:06 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* numeric.c (int_pow): even number multiplication never be negative.
-Thu Jul 5 10:42:07 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * include/ruby/{node,ruby}.h, ruby.c: added enum constants for gdb
- support. [ruby-dev:31066]
-
- * .gdbinit: some improvements.
-
-Thu Jul 5 10:13:08 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (global_symbols.last_id): reduce unused ID numbers.
-
- * include/ruby/st.h, st.c (st_init_table, st_init_table_with_size):
- constified.
-
-Wed Jul 4 23:36:27 2007 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
-
- * lib/webrick/httpauth/authenticator.rb
- (WEBrick::HTTPAuth::Authenticator#check_scheme): auth-scheme must be
- treated as a case-insensitive token according to RFC 2617 section 1.2.
-
-Wed Jul 4 18:30:04 2007 Tanaka Akira <akr@fsij.org>
-
- * parse.y (mlhs_inner): new rule. [ruby-dev:31132]
-
-Wed Jul 4 05:11:57 2007 Koichi Sasada <ko1@atdot.net>
-
- * iseq.c (set_relation): added.
-
-Wed Jul 4 04:58:30 2007 Koichi Sasada <ko1@atdot.net>
-
- * insnhelper.ci (caller_setup_args): fix to show correct class
- on an error message (ex: m(&1)). [ruby-dev:31101]
-
-Wed Jul 4 04:30:32 2007 Koichi Sasada <ko1@atdot.net>
-
- * compile.c (compile_array, iseq_compile_each): fix about array
- generation in void context. [ruby-dev:31102]
-
- * bootstraptest/test_literal.rb: add a test for above.
-
-Wed Jul 4 04:07:00 2007 Koichi Sasada <ko1@atdot.net>
-
- * compile.c (compile_array): ignore NODE_ZARRAY.
- [ruby-dev:31110]
-
- * bootstraptest/test_method.rb: add a test for above.
-
-Wed Jul 4 04:04:02 2007 Koichi Sasada <ko1@atdot.net>
-
- * compile.h: fix debug print level.
-
-Wed Jul 4 03:52:55 2007 Koichi Sasada <ko1@atdot.net>
-
- * compile.c (iseq_compile_each): support v[&b]= type method call.
- [ruby-dev:31094]
-
- * bootstraptest/test_method.rb: add a test for above.
-
-Wed Jul 4 03:43:29 2007 Koichi Sasada <ko1@atdot.net>
-
- * compile.c (compile_massign): fix massign compilation
- (example: a, *v, (*x) = ...). [ruby-dev:31107]
-
- * bootstraptest/test_massign.rb: add tests for above.
-
-Tue Jul 3 23:12:29 2007 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * include/ruby/onigiruma.h (ONIG_EXTERN): use RUBY_EXTERN if defined.
-
- * regenc.h: include ruby/defines.h.
-
- * regint.h: x64-mswin64 support.
-
-Tue Jul 3 13:47:44 2007 Koichi Sasada <ko1@atdot.net>
-
- * cont.c (cont_save_machine_stack): clear saved_thread.machine_stack*.
-
-Mon Jul 2 21:45:53 2007 Koichi Sasada <ko1@atdot.net>
-
- * compile.c: rename iseq_translate_direct_threaded_code()
- to iseq_translate_threaded_code().
-
- * eval_intern.h, yarvcore.h: mv EXEC_EVENT_HOOK() and
- exec_event_hooks() to yarvcore.h.
-
- * insnhelper.ci, vm.c: mv yarv_finish_insn_seq to vm.c.
-
- * insns.def (opt_call_c_function): fix to use RESTORE_REGS().
-
- * iseq.c (rb_iseq_build_for_ruby2cext): fix to allocate iseq.
-
-Mon Jul 2 11:59:34 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * insns.def (defineclass): suppress a warning.
-
- * insns.def (opt_call_c_function): should raise the thrown exception
- instead of returning it.
-
-Mon Jul 2 08:53:47 2007 Koichi Sasada <ko1@atdot.net>
-
- * eval_intern.h, yarvcore.h: move declaration of sysstack_error
- to yarvcore.h.
-
- * iseq.c: fix symbol name (:toplevel -> :top).
-
- * lib/vm/instruction.rb, template/vm.inc.tmpl: replaceable
- current file name.
-
-Mon Jul 2 05:29:07 2007 Koichi Sasada <ko1@atdot.net>
-
- * compile.c, iseq.c: fix iseq some of load/store process.
-
-Mon Jul 2 03:09:36 2007 Koichi Sasada <ko1@atdot.net>
+Mon Jul 2 14:34:43 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * yarvcore.h, compile.c, insnhelper.ci, iseq.c, vm.c:
- rename structure names and field names.
-
- * insnhelper.h, insns.def: add GET_CONST_INLINE_CACHE().
-
- * iseq.c: add rb_iseq_build_for_ruby2cext().
-
- * yarvcore.h, vm.h: move declaration of rb_insn_func_t
- to yarvcore.h.
-
-Sun Jul 1 03:25:53 2007 Koichi Sasada <ko1@atdot.net>
-
- * insnhelper.h, vm.h: some refactoring.
- remove useless comments, etc.
-
-Sun Jul 1 03:02:29 2007 Koichi Sasada <ko1@atdot.net>
-
- * yarvcore.h: some refactoring on rb_iseq_t.
- rename some variable names, add comments, etc.
-
- * compile.c, iseq.c, proc.c, vm.c: ditto.
-
-Sun Jul 1 02:57:57 2007 Koichi Sasada <ko1@atdot.net>
-
- * vm.h: rename insn_func_type to rb_insn_func_type.
+ * sprintf.c (rb_f_sprintf): sign bit extension should not be done
+ if FPLUS flag is specified. [ruby-list:39224]
- * vm_evalbody.ci: ditto.
+Sat Jun 30 16:05:41 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
- * insns.def: add opt_call_native_compiled instruction
- instead of opt_call_native_compiled.
+ * array.c (rb_ary_initialize): should call rb_ary_modify() first.
+ [ruby-core:11562]
Sat Jun 30 00:17:00 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * parse.y (parser_yylex): return non-valid token for an invalid
+ * parse.y (yylex): return non-valid token for an invalid
instance/class variable name. a patch from Yusuke ENDOH
<mame AT tsg.ne.jp>. [ruby-dev:31095]
-Fri Jun 29 23:38:06 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (stmts): fix for ripper.
-
-Fri Jun 29 21:55:48 2007 Koichi Sasada <ko1@atdot.net>
-
- * parse.y: fix to show line number of blank block.
- [ruby-dev:31093]
-
-Fri Jun 29 20:51:04 2007 Tanaka Akira <akr@fsij.org>
-
- * lib/cgi/session.rb (create_new_id): don't cut off md5.hexdigest to
- follow Ruby 1.8.
-
-Fri Jun 29 17:10:14 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * debug.h: constified.
-
- * debug.c (ruby_set_debug_option): separated from main.c.
-
- * gc.c (ruby_gc_stress), signal.c (ruby_enable_coredump): prefixed.
-
-Fri Jun 29 16:39:06 2007 Koichi Sasada <ko1@atdot.net>
-
- * proc.c (proc_new): fix to return a proc object
- which block is contained ([ruby-dev:31056]).
-
-Fri Jun 29 15:43:59 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * numeric.c (fix_pow): get rid of division by zero. reported by
- Yusuke ENDOH <mame AT tsg.ne.jp> [ruby-dev:31040]
-
- * numeric.c (int_round): do nothing when rounding by zeroth digit.
- check underflow. [ruby-dev:31043]
-
-Fri Jun 29 15:32:00 2007 Koichi Sasada <ko1@atdot.net>
-
- * configure.in: add fastcall attribute check.
-
-Fri Jun 29 14:51:24 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * parse.y (assoc_list): remove expanded hash literal (no splat).
-
- * lib/webrick/httpstatus.rb (WEBrick::HTTPStatus::EOFError): adapt
- to new syntax.
-
-Fri Jun 29 14:48:18 2007 Koichi Sasada <ko1@atdot.net>
-
- * tool/insns2vm.rb, lib/vm/instruction.rb: move process body
- to lib/vm/instruction.rb.
-
- * common.mk: fix aotc rule.
- experimental. bin/ruby2cext is not added yet.
-
Fri Jun 29 11:23:09 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* parse.y (dsym): return non-null NODE even if yyerror(). based on a
patch from Yusuke ENDOH <mame AT tsg.ne.jp>. [ruby-dev:31085]
-Thu Jun 28 23:29:30 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * parse.y (assoc_list): odd number check only for NODE_ARRAY.
- [ruby-dev:31082]
-
-Thu Jun 28 22:24:33 2007 Koichi Sasada <ko1@atdot.net>
-
- * win32/Makefile.sub: define FUNC_FASTCALL macro.
-
- * vm.h: fix to use FUNC_FASTCALL macro.
- TODO: add FUNC_FASTCALL macro by configure.
-
-Thu Jun 28 19:38:53 2007 Koichi Sasada <ko1@atdot.net>
-
- * compile.c: fix to remove -Wall warnings on gcc.
-
- * compile.c (make_name_with_str): removed. use rb_sprintf() instead.
-
-Thu Jun 28 18:53:01 2007 Tanaka Akira <akr@fsij.org>
-
- * bignum.c (rb_big_hash): fix hash area.
-
-Thu Jun 28 15:00:06 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/stringio/stringio.c (strio_getline): local variable to be
- initialized. [ruby-dev:31077]
-
-Thu Jun 28 11:30:39 2007 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * gc.c (rb_obj_id): use SIGNED_VALUE instead of long.
-
-Thu Jun 28 05:01:56 2007 Koichi Sasada <ko1@atdot.net>
-
- * common.mk (run.gdb): fix to load $(srcdir)/.gdbinit
-
- * vm.c (rb_vm_set_finish_env): add a cast.
-
- * vm.h: support __fastcall for MSVC.
-
-Thu Jun 28 02:12:08 2007 Koichi Sasada <ko1@atdot.net>
-
- * bootstraptest/runner.rb: fix to untouch $:.
-
-Thu Jun 28 02:03:07 2007 Koichi Sasada <ko1@atdot.net>
-
- * compile.c (setup_args): change parameter type.
-
-Thu Jun 28 02:03:39 2007 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * parse.y (rb_intern2): unconstify cast.
-
-Thu Jun 28 01:44:31 2007 Tanaka Akira <akr@fsij.org>
-
- * parse.y (rb_intern2): don't allocate a string object at first.
- [ruby-dev:31064]
-
-Thu Jun 28 01:24:02 2007 Koichi Sasada <ko1@atdot.net>
-
- * bootstraptest/runner.rb: fix to show file name.
-
- * bootstraptest/test_*.rb: add bootstrap tests.
-
-Thu Jun 28 01:22:15 2007 Koichi Sasada <ko1@atdot.net>
-
- * include/ruby/node.h, parse.y, gc.c, iseq.c: remove NODE_CREF.
-
-Thu Jun 28 01:19:43 2007 Koichi Sasada <ko1@atdot.net>
-
- * compile.c (iseq_compile_each): fix popped backref and others.
- ([ruby-dev:31068]).
-
- * compile.c (iseq_compile_each): remove needless statements.
-
-Wed Jun 27 23:51:33 2007 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/win32.c: remove unused functions.
-
-Wed Jun 27 20:46:05 2007 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * include/ruby/win32.h, win32/Makefile.sub, win32/configure.bat,
- win32/mkexports.rb, win32/setup.mak, win32/win32.c: import
- x64-mswin64 port.
-
-Wed Jun 27 20:31:07 2007 Koichi Sasada <ko1@atdot.net>
-
- * compile.c (iseq_translate_direct_threaded_code): fix prototype
- function name.
-
- * vm.h: add correct cast.
-
-Wed Jun 27 17:08:42 2007 Koichi Sasada <ko1@atdot.net>
-
- * vm_evalbody.ci: support OPT_CALL_THREADED_CODE.
-
- * insns.def, vm.c, vm.h: ditto.
-
- * vm.h: add VM_CFP_CNT() and VM_SP_CNT().
-
-Wed Jun 27 04:23:47 2007 Koichi Sasada <ko1@atdot.net>
-
- * compile.c (iseq_compile_each): fix type error.
-
-Wed Jun 27 03:26:15 2007 Koichi Sasada <ko1@atdot.net>
-
- * compile.c (compile_massign), insns.def (expandarray): support
- postarg with massign (a, *b, c = ...).
-
- * bootstraptest/test_massign.rb: add tests for above.
-
- * compile.h: fix debug macro names.
-
-Wed Jun 27 00:18:41 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * string.c (rb_str_clear): need to check STR_EMBED_P() before
- free()ing memory. a patch from Yusuke ENDOH <mame AT tsg.ne.jp>.
- [ruby-dev:31062]
-
-Tue Jun 26 16:39:01 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * process.c (proc_getgroups): use GIDT2NUM for rb_gid_t.
-
-Tue Jun 26 16:28:24 2007 Koichi Sasada <ko1@atdot.net>
-
- * thread.c (rb_thread_wait_fd_rw): terminate fdset.
-
-Tue Jun 26 16:26:58 2007 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * regint.h: IL32LLP64 support.
-
-Tue Jun 26 16:22:45 2007 Koichi Sasada <ko1@atdot.net>
-
- * iseq.c (ruby_node_name): update node names.
-
-Tue Jun 26 15:21:20 2007 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * include/ruby/ruby.h: IL32LLP64 support.
-
- * bignum.c (bigfixize, rb_cstr_to_inum): ditto.
-
- * insns.def (opt_plus, opt_minus, opt_mult): ditto.
-
-Tue Jun 26 15:04:06 2007 Koichi Sasada <ko1@atdot.net>
-
- * cont.c (rb_fiber_s_new): revert initializing VM stack.
-
- * yarvcore.c (th_init2): ditto.
-
- * vm.c, vm.h: fix to stop using Qundef on VM stack. According to
- this change, VM stack should not include Qundef value.
-
- * insns.def (putundef): removed.
-
- * compile.c (iseq_compile_each): ditto.
-
- * eval.c (eval): fix spacing.
-
-Tue Jun 26 04:03:50 2007 Koichi Sasada <ko1@atdot.net>
-
- * insnhelper.ci (vm_yield_with_cfunc), proc.c: fix Method#to_proc
- to return lambda Proc ([ruby-dev:31021], [ruby-dev:31037]).
-
-Tue Jun 26 03:46:08 2007 Koichi Sasada <ko1@atdot.net>
-
- * cont.c (rb_fiber_s_new): fix to clear rb_thread_t#tag.
- [ruby-dev:30995]
-
-Tue Jun 26 03:38:31 2007 Koichi Sasada <ko1@atdot.net>
-
- * cont.c (rb_fiber_s_new), yarvcore.c (th_init2): fix to clear
- VM stack ([ruby-dev:31046]).
-
-Tue Jun 26 03:15:27 2007 Koichi Sasada <ko1@atdot.net>
-
- * compile.c: rename setup_arg() to setup_args().
- fix to use setup_args() at processing NODE_YIELD.
-
-Tue Jun 26 02:50:24 2007 Koichi Sasada <ko1@atdot.net>
-
- * compile.c (setup_arg): support kind of "m(*ary, x)" method call.
- ([ruby-dev:31048]).
-
-Tue Jun 26 00:28:44 2007 Koichi Sasada <ko1@atdot.net>
-
- * insnhelper.ci, vm.c: complete block parameter support.
- post arguments, optional arguments, block argument.
-
- * compile.c, parse.y: fix {|a|} parameter.
-
- * insnshelper.ci, insns.def: revert caller_setup_args() option
- (need_block_check) parameter.
-
-Mon Jun 25 20:18:44 2007 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * gc.c (RVALUE): in RVALUE and RBasic, flags must be the same type.
-
-Mon Jun 25 18:02:55 2007 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * ext/pty/extconf.rb: skip wince and win64.
-
-Mon Jun 25 17:59:32 2007 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * include/ruby/node.h (NODE_LMASK, nd_line): shouldn't use int and/or
- long carelessly.
-
-Mon Jun 25 11:36:35 2007 Koichi Sasada <ko1@atdot.net>
-
- * gc.h: add RUBY_ prefix to debug macros.
-
- * cont.c, proc.c, yarvcore.c,
-
- * gc.c: define ruby_gc_debug_indent variable to debug mark/free.
-
- * vm.c, insnhelper.ci: rename some functions to vm_* or rb_vm_*.
- move some functions, definitions, declarations to suitable files.
-
- * eval.c, yarvcore.h, eval_error.ci, insnhelper.ci: ditto.
-
-Mon Jun 25 09:45:46 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval_error.ci, eval_jump.ci, eval_method.ci, eval_safe.ci: c-mode.
-
-Mon Jun 25 05:27:54 2007 Koichi Sasada <ko1@atdot.net>
-
- * eval.c: remove ruby_current_node and change eval() prototype.
- fix to use rb_sourcefile/line() instead of ruby_sourcefile/line.
-
- * error.c, eval_error.ci, eval_load.c, eval_safe.ci, gc.c,
- include/ruby/intern.h, parse.y, process.c, ruby.c: ditto.
-
- * vm.c: fix spaces.
-
-Mon Jun 25 04:20:14 2007 Koichi Sasada <ko1@atdot.net>
-
- * eval_*.h: rename to eval_*.ci.
-
- * common.mk: ditto.
-
- * eval_error.ci: remove ruby_set_current_source().
-
- * error.c, eval.c, ruby.c: ditto.
-
- * eval_safe.c, proc.c: remove unused macros.
-
-Mon Jun 25 03:37:20 2007 Koichi Sasada <ko1@atdot.net>
-
- * insnhelper.ci (caller_setup_args): add need_block_check option.
-
- * insns.def: ditto.
-
- * yarvcore.h: add GetCoreDataFromValue().
-
-Mon Jun 25 02:14:30 2007 Koichi Sasada <ko1@atdot.net>
-
- * call_cfunc.ci: removed.
-
- * insnhelper.ci: added. this function includes all functions that
- vm insns need.
-
- * common.mk: ditto.
-
- * insnhelper.h, vm.h, vm.c: move some declaration.
-
- * gc.h: remove GC_CHECK() macro because GC.stress is more useful.
-
- * compile.c, iseq.c, vm_dump: ditto.
-
- * gc.h, thread.c: move a prototype declaration.
-
- * debug.c, debug.h: rename some functions.
-
- * compile.h: ditto.
-
-Mon Jun 25 00:45:02 2007 Koichi Sasada <ko1@atdot.net>
-
- * insns.def (invokesuper): fix error message.
-
-Mon Jun 25 00:14:13 2007 Koichi Sasada <ko1@atdot.net>
-
- * vm.c: some refactoring.
- * rename th_* to vm_*.
- * remove unused variables functions.
- * add prototypes.
-
- * blockinlining.c, compile.c, cont.c, eval.c, eval_intern.h,
- eval_jump.h, eval_load.c, inits.c, insns.def, iseq.c, parse.y,
- proc.c, process.c, signal.c, thread.c, vm.c, vm_dump.c,
- vm_evalbody.ci, yarvcore.c, yarvcore.h: ditto.
-
-Sun Jun 24 22:32:00 2007 Koichi Sasada <ko1@atdot.net>
-
- * eval_method.h (rb_add_method): fix to check 0.
-
-Sun Jun 24 22:00:17 2007 Koichi Sasada <ko1@atdot.net>
-
- * insn_send.ci: removed.
+Tue Jun 26 16:35:21 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * common.mk: ditto.
+ * process.c (ruby_setreuid, ruby_setregid): rename to get rid of name
+ clash.
- * vm.c (vm_call_bmethod), isnsn.def: added. fix to use this
- function instead of using goto.
+ * process.c (proc_exec_v, rb_proc_exec): preserve errno.
- * vm.c (vm_call_bmethod): renamed from th_invoke_bmethod().
+Sat Jun 23 00:37:46 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
- * vm.c (vm_method_missing): renamed from eval_method_missing().
+ * hash.c (rb_hash_select): remove unnecessary varargs for
+ rb_hash_select. a patch from Daniel Berger
+ <Daniel.Berger at qwest.com>. [ruby-core:11527]
- * vm_evalbody.ci: remove tmp_* variables.
-
- * insnhelper.h: add some macros.
-
- * insns.def: forbid zsuper from method defined by define_method().
-
- * test/ruby/test_super.rb: ditto.
-
-Sun Jun 24 20:01:08 2007 Koichi Sasada <ko1@atdot.net>
-
- * vm_macro.def: removed.
-
- * insn_send.ci: added. this file includes send instruction body.
-
- * common.mk: ditto.
-
- * insns.def: ditto.
-
- * tool/insns2vm.rb: ditto.
-
- * vm.c: ditto.
-
-Sun Jun 24 19:30:37 2007 Koichi Sasada <ko1@atdot.net>
-
- * insnhelper.h (RESTORE_REGS): add do/while(0) around macro.
-
- * vm.c, vm_macro.def: remove macro_eval_invoke_func() and
- add vm_setup_method(). use it instead.
-
-Sun Jun 24 19:02:33 2007 Koichi Sasada <ko1@atdot.net>
-
- * vm.c, vm_macro.def : remove macro_eval_invoke_cfunc() and
- add vm_call_cfunc().
-
-Sun Jun 24 17:54:13 2007 Koichi Sasada <ko1@atdot.net>
-
- * insns.def, vm.c: add/fix stack overflow check.
-
-Sun Jun 24 17:28:52 2007 Koichi Sasada <ko1@atdot.net>
-
- * insnhelper.h: change CHECK_STACK_OVERFLOW() to throw exception.
-
- * vm.c (caller_setup_arg), vm_macro.def: remove
- macro_eval_setup_send_arguments and add caller_setup_arg().
-
- * insns.def: ditto.
-
- * bootstraptest/test_method.rb: add splat arg tests.
-
-Sun Jun 24 16:35:46 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * proc.c (proc_to_s): used a variable before initialized.
-
-Sun Jun 24 16:05:45 2007 Koichi Sasada <ko1@atdot.net>
-
- * vm.c (callee_setup_arg): added. support correct post arg.
-
- * vm_macro.def (macro_eval_invoke_func): fix to use
- callee_setup_arg.
-
- * compile.c (set_arguments): adjust for above changes.
-
- * compile.c (iseq_compile_each): ditto.
-
- * iseq.c (ruby_iseq_disasm): ditto.
-
- * yarvcore.h: add rb_iseq_t#post_arg_start and arg_size.
-
- * bootstraptest/test_method.rb: add post arg tests.
-
-Sun Jun 24 16:10:43 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * proc.c (proc_to_s): suppress warning, and reduced duplicated code.
-
-Sun Jun 24 15:33:47 2007 Koichi Sasada <ko1@atdot.net>
-
- * bootstraptest/runner.rb: set default directory to
- '/tmp/bootstraptest.tmpwd' and add --dir option.
- fix to output driver and target information.
-
- * common.mk: fix to run btest on BASERUBY and
- add OPTS to pass option ("make btest OPTS=...").
-
-Sun Jun 24 03:05:00 2007 Tanaka Akira <akr@fsij.org>
-
- * enum.c (enum_minmax): fix SEGV by [].minmax.
-
-Sat Jun 23 17:18:19 2007 Tanaka Akira <akr@fsij.org>
-
- * re.c (match_inspect): MatchData#inspect implemented.
-
-Sat Jun 23 15:00:16 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * enum.c (enum_minmax): new method to get the minimum and maximum
- values from the enumerable at once.
-
- * enum.c (enum_minmax_by): ditto.
-
-Sat Jun 23 01:25:40 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * hash.c (rb_hash_assoc): new method.
-
- * hash.c (rb_hash_rassoc): ditto.
-
- * hash.c (rb_hash_flatten): ditto.
-
-Fri Jun 22 23:55:59 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * string.c (rb_str_upto): add optional argument to specify
- exclusiveness.
-
- * range.c (range_step): use String#upto with optional argument.
-
- * range.c (range_each): ditto.
-
-Fri Jun 22 19:55:51 2007 Tanaka Akira <akr@fsij.org>
-
- * proc.c (proc_to_s): revert the change from %p to %lx at YARV
- merge time.
-
-Fri Jun 22 19:33:49 2007 Tanaka Akira <akr@fsij.org>
-
- * proc.c (proc_to_s): show is_lambda.
-
-Thu Jun 21 20:36:12 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * hash.c (rb_hash_sort): remove hash specific implementation.
-
-Thu Jun 21 20:28:05 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * hash.c (rb_hash_select): returns new hash, not assoc array.
- [ruby-core:11504]
-
- * hash.c (env_select): ditto.
-
-Thu Jun 21 23:08:19 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * parse.y (rb_intern2): ID_JUNK test based on len, not by NUL.
-
-Thu Jun 21 19:42:07 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * yarvcore.c (rb_thread_mark): mark also thrown_errinfo.
-
-Thu Jun 21 17:13:44 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (rb_intern2): name may not be NUL-terminated.
-
-Wed Jun 20 08:27:57 2007 Tanaka Akira <akr@fsij.org>
-
- * eval_error.h (error_print): show full stacktrace on
- non-SystemStackError.
-
-Wed Jun 20 04:45:39 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (rb_intern2): use rb_intern2 to intern without trailing
- equal sign.
-
- * parse.y (rb_intern2, ripper_id2sym): fixed indent.
-
-Tue Jun 19 10:55:05 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval_load.c (load_ext, rb_require_safe): pass VALUE instead of
- pointer. [ruby-Bugs-11659]
+ * hash.c: ditto.
Mon Jun 18 08:47:54 2007 Technorama Ltd. <oss-ruby@technorama.net>
@@ -38698,46 +4233,11 @@ Mon Jun 18 08:47:54 2007 Technorama Ltd. <oss-ruby@technorama.net>
* ext/openssl/ossl_rand.c
New method Random.status?
- * test/openssl/test_ec.rb
- New tests.
-
-Mon Jun 18 17:04:07 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval_load.c (rb_require_safe, ruby_init_ext): load with ruby level
- cfp. [ruby-core:10779]
-
- * eval_intern.h, vm.c (rb_vm_call_cfunc): new function to call a
- function with ruby level cfp.
-
-Mon Jun 18 16:57:24 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (yycompile): disable trace while creating ruby_debug_lines.
- [ruby-talk:253586]
-
- * thread.c (ruby_suppress_tracing): new function to call a function
- with suppressing trace.
-
- * lib/debug.rb, lib/tracer.rb: for YARV.
-
Mon Jun 18 13:54:36 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * eval.c (ruby_cleanup): return EXIT_FAILURE if any exceptions occurred
+ * eval.c (ruby_cleanup): return EXIT_FAILURE if any exceptions occured
in at_exit blocks. [ruby-core:11263]
-Mon Jun 18 02:49:16 2007 Koichi Sasada <ko1@atdot.net>
-
- * vm.c (env_mark): fix to mark block.proc.
-
- * vm.c (th_make_proc_from_block): set created proc to block->proc.
-
-Mon Jun 18 02:48:12 2007 Koichi Sasada <ko1@atdot.net>
-
- * vm_dump.c (vm_stack_dump_raw): hide VM stack trace.
-
-Mon Jun 18 02:43:53 2007 Koichi Sasada <ko1@atdot.net>
-
- * signal.c (sigsegv): clear gc_stress flag on SEGV.
-
Mon Jun 18 01:14:10 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* variable.c (rb_path2class): get rid of dangling pointer caused by
@@ -38749,170 +4249,31 @@ Mon Jun 18 01:14:10 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
rb_free_generic_ivar, rb_copy_generic_ivar,
rb_obj_instance_variables): suppress warnings.
-Sun Jun 17 11:11:07 2007 Tanaka Akira <akr@fsij.org>
-
- * eval.c (rb_method_missing): avoid a warning "too many arguments
- for format string" on "./ruby -ve 'def m() super end; m'".
-
-Sat Jun 16 22:24:17 2007 Tanaka Akira <akr@fsij.org>
-
- * gc.c (garbage_collect): re-introduce ruby_current_node marking code.
- [ruby-dev:31005]
-
-Sat Jun 16 21:37:43 2007 Tanaka Akira <akr@fsij.org>
-
- * gc.c (gc_sweep): re-introduce heap extension strategy change.
- [ruby-dev:31005]
-
-Fri Jun 15 22:59:37 2007 Tanaka Akira <akr@fsij.org>
-
- * .gdbinit: new file to ease debugging using gdb.
-
-Fri Jun 15 22:33:55 2007 Tanaka Akira <akr@fsij.org>
-
- * signal.c (default_handler): func argument removed.
- (trap_handler): support SYSTEM_DEFAULT. call default_handler
- internally.
- (sig_trap): don't call default_handler.
- [ruby-dev:30999]
-
Fri Jun 15 22:33:29 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* common.mk (realclean): separate local and ext.
* ext/extmk.rb: not remove unrelated directories.
-Fri Jun 15 20:50:02 2007 Tanaka Akira <akr@fsij.org>
-
- * keywords: enclose C code in declaration section by %{ and %} to
- avoid extra semicolon after #ifdef RIPPER.
- pointed by eban.
-
-Fri Jun 15 18:56:52 2007 Tanaka Akira <akr@fsij.org>
-
- * signal.c (trap_handler): trap("SIGSEGV", "DEFAULT") may cause wrong
- trap error because SIG_DFL may be zero.
-
-Fri Jun 15 15:55:55 2007 Koichi Sasada <ko1@atdot.net>
-
- * insns.def (setconstant, toregexp): fix to mark object correctly.
-
-Fri Jun 15 13:24:18 2007 Koichi Sasada <ko1@atdot.net>
-
- * hash.c: exchange semantics of Hash#each and Hash#each_pair.
- pointed out by [ruby-dev:30997].
-
- * test/ruby/test_iterator.rb: ditto.
-
- * test/ruby/test_yield.rb: ditto.
-
-Fri Jun 15 12:38:29 2007 Koichi Sasada <ko1@atdot.net>
-
- * test/ruby/test_iterator.rb: remove debug code (GC.stress=true).
-
-Fri Jun 15 12:25:33 2007 Koichi Sasada <ko1@atdot.net>
-
- * vm.c (th_yield_setup_args): |v| should work as |v,|.
- ex) def m;yield 1, 2; end; m{|v| p v} #=> 1
-
- * parse.y: apply above change for "for" statement.
-
- * test/ruby/test_assignment.rb: ditto
-
- * test/ruby/test_basicinstructions.rb: ditto.
-
- * test/ruby/test_iterator.rb: ditto.
-
- * test/ruby/test_yield.rb: ditto.
-
- * compile.c (iseq_compile_each): fix debug.
-
-Fri Jun 15 12:22:10 2007 Koichi Sasada <ko1@atdot.net>
-
- * eval.c (ruby_finalize_1): rb_thread_t#errinfo should be clear with
- Qnil.
-
-Fri Jun 15 12:20:11 2007 Koichi Sasada <ko1@atdot.net>
-
- * cont.c (rb_cont_call): forbid cross fiber continuation call.
-
- * test/ruby/test_fiber.rb: ditto.
-
-Fri Jun 15 12:14:07 2007 Koichi Sasada <ko1@atdot.net>
+Fri Jun 15 17:01:20 2007 NAKAMURA Usaku <usa@ruby-lang.org>
- * sample/test.rb: fix to show line information whether test succeeds.
-
-Thu Jun 14 17:16:05 2007 Tanaka Akira <akr@fsij.org>
-
- * eval_load.c (Init_load): delay allocating an array for rb_load_path
- to avoid GC problem in very early stage.
- (RUBY_GC_STRESS causes GC in such stage.)
-
- * variable.c (rb_gc_mark_global_tbl): rb_global_tbl may be 0 in
- very early stage.
-
- * thread.c (thread_cleanup_func) [IA64]: clear register stack position.
- (thread_start_func_2) [IA64]: record the beginning of register
- stack using extra argument.
- (rb_gc_save_machine_context) [IA64]: record the end of register
- stack.
-
- * gc.c [IA64] (SET_STACK_END): record the end of register stack.
- (garbage_collect) [IA64]: use recorded register stack area for
- GC marking.
- (yarv_machine_stack_mark) [IA64]: GC mark from the register stack
- area.
-
- * yarvcore.c [IA64] (rb_gc_register_stack_start): defined.
- (Init_VM): store th->self on stack to fix GC problem.
- (Init_yarv) [IA64]: initialize the beginning of register stack.
-
- * yarvcore.h (struct rb_thread_struct) [IA64]: new members for
- register stack area.
-
- * thread_pthread.ci (thread_start_func_1) [IA64]: call
- thread_start_func_2 with the end of register stack.
-
- * cont.c (struct rb_context_struct) [IA64]: new members for register
- stack area.
- (cont_mark) [IA64]: GC mark from register stack area.
- (cont_free) [IA64]: free saved register stack.
- (cont_save_machine_stack) [IA64]: record the position and contents
- of the register stack.
- (cont_capture): store cont->self on stack to fix GC problem.
- (cont_restore_1) [IA64]: restore the register stack.
- [IA64] (register_stack_extend): new function.
- (cont_restore_0) [IA64]: call register_stack_extend instead of
- cont_restore_1.
-
- [ruby-dev:30982]
+ * ext/dl/lib/dl/win32.rb: seems that dl doesn't accept void argument.
+ fixed [ruby-bugs:PR#5489].
Thu Jun 14 17:09:48 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/rdoc/parsers/parse_c.rb (RDoc::C_Parser): handle more
extensions. [ruby-dev:30972]
-Thu Jun 14 14:40:42 2007 Tanaka Akira <akr@fsij.org>
-
- * lib/securerandom.rb: document updated.
- suggested by NaHi. [ruby-dev:30966]
-
-Wed Jun 13 22:42:06 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * gc.c (garbage_collect): update IA64 register stack code.
- [ruby-dev:30971]
-
Wed Jun 13 06:05:12 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* configure.in (darwin): prohibit loading extension libraries to
miniruby.
-Tue Jun 12 21:50:51 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
+Wed Jun 13 05:47:58 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * parse.y (call_args): no allow splat after assocs. takes
- consistency over compatibility.
-
- * parse.y (call_args2): ditto
+ * eval.c (rb_kill_thread): renamed in order to get rid of conflict
+ with a BeOS system function. [ruby-core:10830]
Tue Jun 12 14:53:51 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
@@ -38921,408 +4282,66 @@ Tue Jun 12 14:53:51 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/mkmf.rb (find_header): use header names in the message.
-Sun Jun 10 18:37:13 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/probeprofiler/probeprofiler.c: clean warnings.
-
-Sun Jun 10 18:32:24 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * missing/isinf.c, missing/dup2.c, missing/strtod.c, missing/x68.c,
- missing/alloca.c: use "ruby/config.h".
-
-Sun Jun 10 17:49:20 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * instruby.rb (install_recursive): should check parent directories of
- the destination. [ruby-dev:30947]
-
-Sun Jun 10 16:59:39 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (do_block, brace_block): fix line numbers. [ruby-dev:30831]
-
-Sun Jun 10 16:57:20 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * instruby.rb (install_recursive): add :glob option rather than
- using FNM_DOTMACH.
-
- * instruby.rb (ext-comm): make header directory first.
-
-Sun Jun 10 16:10:58 2007 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * test/ruby/test_beginendblock.rb: typo.
-
-Sun Jun 10 16:07:10 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * instruby.rb (install_recursive): skip .svn directories.
-
-Sun Jun 10 15:44:43 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * win32/Makefile.sub (config.status): rubyhdrdir was missing.
-
-Sun Jun 10 15:26:36 2007 Tanaka Akira <akr@fsij.org>
-
- * Makefile.in: use --output-file for gperf to not leave lex.c.tmp.
-
-Sun Jun 10 15:11:07 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * Makefile.in, win32/Makefile.sub (XCFLAGS): -I. is needed for *.inc.
-
- * ext/extmk.rb: prepend also topdir to mflags at last.
-
Sun Jun 10 13:47:36 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* test/ruby/test_beginendblock.rb (test_should_propagate_signaled):
get rid of invoking shell. [ruby-dev:30942]
-Sun Jun 10 12:56:46 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * include/ruby: moved public headers.
-
- * instruby.rb (install_recursive): skip backup files.
-
- * instruby.rb (ext-comm): install only current platform headers.
-
-Sun Jun 10 10:42:04 2007 Tanaka Akira <akr@fsij.org>
-
- * lib/securerandom.rb: renamed from lib/secrand.rb.
- suggested by NaHi. [ruby-dev:30934]
-
-Sat Jun 9 06:40:05 2007 Tanaka Akira <akr@fsij.org>
-
- * lib/secrand.rb: rename SecRand() to SecRand.random_number.
- suggested by NaHi. [ruby-dev:30934]
-
-Fri Jun 8 16:34:20 2007 Tanaka Akira <akr@fsij.org>
-
- * ext/zlib/zlib.c (gzfile_s_open): use FilePathValue to support
- to_path.
-
-Fri Jun 8 16:11:00 2007 Koichi Sasada <ko1@atdot.net>
-
- * eval_jump.h: th->errinfo should clear with nil.
-
-Fri Jun 8 14:53:28 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * parse.y (call_args): allow splat argument after unpacked
- assocs like 1.8 does.
-
- * parse.y (call_args): ditto.
-
-Fri Jun 8 14:26:18 2007 Tanaka Akira <akr@fsij.org>
-
- * lib/secrand.rb: new file for secure random interface.
-
- * lib/cgi/session.rb: use secrand for generating cookies.
-
-Fri Jun 8 12:44:37 2007 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * {win32,wince}/Makefile.sub: add lex.c rule.
-
-Fri Jun 8 11:54:18 2007 Tanaka Akira <akr@fsij.org>
-
- * lex.c.blt: moved from lex.c.
-
- * Makefile.in: use lex.c.blt if gperf is not available.
- [ruby-list:8212], [ruby-list:8214], [ruby-list:24667],
- [ruby-talk:120857], [ruby-dev:28102]
-
-Thu Jun 7 21:38:39 2007 Koichi Sasada <ko1@atdot.net>
-
- * thread.c (rb_thread_execute_interrupts): invoke ensure when
- main thread exits.
-
Thu Jun 7 19:02:48 2007 Tanaka Akira <akr@fsij.org>
* lib/pp.rb: call original "method" method instead of redefined one.
-Thu Jun 7 17:20:57 2007 Koichi Sasada <ko1@atdot.net>
-
- * iseq.c (prepare_iseq_build): freeze filename and name string.
-
- * variable.c: freeze class name string.
-
-Thu Jun 7 12:48:33 2007 Koichi Sasada <ko1@atdot.net>
-
- * cont.c (cont_restore_1): fix to check root fiber [ruby-dev:30911].
-
- * test/ruby/test_fiber.rb: add a test.
-
-Thu Jun 7 07:24:36 2007 NARUSE, Yui <naruse@ruby-lang.org>
-
- * lib/json/common.rb: Ponder offering parse! method.
-
- * lib/json/editor.rb: be a bit more robust while loading data.
-
- * ext/json/ext/{generator,parser}/extconf.rb:
- add a have_header directive for st.h
-
- * test/json: fix some tests.
-
-Thu Jun 7 03:29:18 2007 Koichi Sasada <ko1@atdot.net>
-
- * test_fiber.rb: add a test (Continuation and Fiber).
-
-Thu Jun 7 03:17:24 2007 Koichi Sasada <ko1@atdot.net>
-
- * cont.c (cont_new): add debug message.
-
- * cont.c (cont_restore_1): copy stack information from fiber.
-
- * cont.c (rb_fiber_s_new): fix to mark created fiber.
-
- * test/ruby/test_fiber.rb: add some tests around Thread and Fiber.
-
- * yarvcore.c (thread_free): fix to skip freeing stack if root fiber
- is available.
-
-Thu Jun 7 01:03:20 2007 Koichi Sasada <ko1@atdot.net>
-
- * eval_intern.h, eval.c (ruby_init): remove POP_TAG_INIT().
-
- * cont.c (rb_fiber_start): remove zero-clearing tag.
-
-Wed Jun 6 20:23:46 2007 Koichi Sasada <ko1@atdot.net>
-
- * insns.def (invokeblock): fix of splat argument.
- (splat same as normal method dispatch)
-
-Wed Jun 6 16:27:25 2007 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * insns.def: fixed indentation.
-
-Wed Jun 6 10:58:23 2007 Koichi Sasada <ko1@atdot.net>
-
- * eval.c (rb_yield): fix to check Qundef.
-
-Wed Jun 6 10:57:45 2007 Koichi Sasada <ko1@atdot.net>
-
- * test/ruby/test_continuation.rb: add a test for last commit.
-
-Wed Jun 6 10:55:42 2007 Koichi Sasada <ko1@atdot.net>
-
- * cont.c (rb_cont_call): forbid calling dead fiber with
- Continuation#call.
-
-Wed Jun 6 10:50:01 2007 Koichi Sasada <ko1@atdot.net>
-
- * compile.c (iseq_compile_each): fix around yield arguments
- (with NODE_ARGSCAT).
-
-Wed Jun 6 02:50:53 2007 Koichi Sasada <ko1@atdot.net>
-
- * cont.c (rb_fiber_start): clear th->tag and check error to fix
- [ruby-dev:30888] and [ruby-dev:30889].
-
- * eval_intern.h: fix rb_fiber_start() prototype.
-
- * test/ruby/test_fiber.rb: add tests for above.
-
-Wed Jun 6 02:40:20 2007 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * insnhelper.h, insns.def (DEC_SP): shouldn't use unary minus operator
- in pointer operation. some compilers (such as VC++8 x64) cannot deal
- it with expected way.
-
-Wed Jun 6 02:19:48 2007 Koichi Sasada <ko1@atdot.net>
-
- * parse.y (new_yield), compile.c (iseq_compile_each): fix
- passing parameter.
-
- * eval.c, eval_jump.h: simplify rb_yield*.
-
- * proc.c (proc_mark): fix to mark proc->block.proc.
-
- * proc.c (Init_Proc): add Proc#lambda?
-
- * test/ruby/test_lambda.rb: add some tests.
-
- * vm.c (invoke_block): fix to check lambda block or not.
-
- * vm.c (th_yield_setup_args): fix to check arguments size
- when lambda block.
-
-Tue Jun 5 16:30:38 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * io.c (rb_f_p): returns arguments to intervene. [ruby-dev:29736]
-
-Tue Jun 5 14:07:55 2007 Koichi Sasada <ko1@atdot.net>
-
- * insns.def (invokeblock): check block is created by lambda
- or Proc.new.
-
- * vm.c (block_proc_is_lambda): added.
-
-Tue Jun 5 14:47:52 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/pp.rb (PP::PPMethods::seplist): revert last change to work
- around wrapper bug. [ruby-dev:30840]
-
-Tue Jun 5 14:11:15 2007 NARUSE, Yui <naruse@ruby-lang.org>
-
- * ext/nkf/nkf-utf8/nkf.c (kanji_convert): Fix guess fallback.
-
-Tue Jun 5 13:32:04 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * compile.c, dir.c, eval.c, eval_jump.h, eval_method.h, numeric.c,
- pack.c, parse.y, re.c, thread.c, vm.c, vm_dump.c, call_cfunc.ci,
- thread_pthread.ci, thread_win32.ci: fixed indentation.
-
- * call_cfunc.ci: protoized.
-
- * thread_win32.ci: fixed typo.
-
-Tue Jun 5 13:17:11 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * call_cfunc.ci, compile.c, dir.c, eval.c, eval_jump.h, numeric.c,
- pack.c, re.c, thread.c, thread_win32.ci, vm.c, vm_dump.c: fixed
- indentation.
-
-Mon Jun 4 21:15:45 2007 NARUSE, Yui <naruse@ruby-lang.org>
+Mon Jun 4 11:11:12 2007 Shugo Maeda <shugo@ruby-lang.org>
- * lib/json.rb, lib/json, ext/json, test/json:
- import JSON library.
-
- * ext/nkf: import nkf.c rev:1.124
- Support CP10001.
-
-Mon Jun 4 20:52:58 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * numeric.c (int_round): should not just truncate.
-
-Sat Jun 2 16:48:55 2007 Koichi Sasada <ko1@atdot.net>
-
- * cont.c (Fiber#pass): rename to Fiber#yield. Block parameter
- of fiber body receive first yield values.
- e.g.: Fiber.new{|x| p x}.yield(:ok) #=> :ok
-
- * cont.c: rename rb_context_t#retval to rb_context_t#value.
-
- * test/ruby/test_fiber.rb: ditto.
-
-Sat Jun 2 16:45:21 2007 Koichi Sasada <ko1@atdot.net>
-
- * proc.c (Init_Proc): remove a line break.
-
-Sat Jun 2 01:27:27 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * numeric.c (int_round): small optimization to handle bignums.
-
-Fri Jun 1 13:02:35 2007 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * insnhelper.h (INC_SP): shouldn't cast ``x'' to unsigned type because
- it might be a negative value.
-
- * insnhelper.h, insns.def: shouldn't use unary minus operator in index
- operator. some compilers (such as VC++8 x64) cannot deal it with
- expected way.
-
-Fri Jun 1 11:33:40 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * numeric.c (num_round): should convert self to Float.
- [ruby-dev:30860]
-
-Fri Jun 1 02:01:13 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * numeric.c (flo_round): now takes optional argument to specify
- number of digits, like round() in Python/PHP.
-
- * numeric.c (num_round): ditto.
-
-Fri Jun 1 01:58:33 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * lib/net/imap.rb (ResponseParser#next_token): fixed
+ error message. (backported from HEAD)
- * enum.c (each_with_index_i): should work well with continuation.
- a patch from sheepman <sheepman AT sheepman.sakura.ne.jp>.
- [ruby-dev:30846]
+ * lib/net/imap.rb (ResponseParser#parse_error): fixed
+ the condition not to refer @token.symbol unexpectedly.
+ Thanks, Dick Monahan. (backported from HEAD)
Thu May 31 17:27:53 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/benchmark.rb (Benchmark::Job::item): avoid modifying the
argument unintentionally. [ruby-talk:253676]
-Wed May 30 14:43:00 2007 Koichi Sasada <ko1@atdot.net>
-
- * cont.c (cont_capture): store all local variables in heap
- ([ruby-dev:30832]).
+Thu May 31 02:12:32 2007 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
- * vm.c (th_stack_to_heap): added.
+ * lib/rinda/tuplespace.rb (Rinda::TupleBag): create index on tuple bag
+ by first column.
- * test/ruby/test_continuation.rb: add a test for above.
+Wed May 30 13:27:40 2007 Shugo Maeda <shugo@ruby-lang.org>
- * eval_intern.h (th_get_ruby_level_cfp): fix to clean code.
+ * lib/net/ftp.rb (Net::FTP#transfercmd): skip 2XX
+ responses for some FTP servers. (backported from HEAD)
-Wed May 30 13:32:34 2007 Shugo Maeda <shugo@ruby-lang.org>
+Wed May 30 05:17:55 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/net/imap.rb (ResponseParser#next_token): fixed
- error message.
+ * eval.c (rb_eval): get rid of SEGV at ZSUPER in a block
+ [ruby-dev:30836]
- * lib/net/imap.rb (ResponseParser#parse_error): fixed
- the condition not to refer to @token.symbol unexpectedly.
- Thanks, Dick Monahan.
+Wed May 30 04:29:43 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed May 30 13:24:33 2007 Shugo Maeda <shugo@ruby-lang.org>
-
- * lib/net/ftp.rb (Net::FTP#transfercmd): skip 2XX
- responses for some FTP servers.
+ * eval.c (thread_timer): timer thread should not receive any
+ signals. submitted by Sylvain Joyeux. [ruby-core:08546]
Wed May 30 04:18:37 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* eval.c (rb_eval_cmd): just return if no exceptions.
[ruby-dev:30820]
-Wed May 30 02:14:25 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * signal.c (interrupt_init): needs to pass nil for Interrupt.
- [ruby-core:11038]
-
- * signal.c (trap): fixed segfaults. [ruby-dev:30830]
-
-Wed May 30 00:50:48 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * gc.c (rb_source_filename, obj_free): suppress warnings.
+Tue May 29 11:01:06 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * gc.c (garbage_collect, yarv_machine_stack_mark): fixed typo.
- http://bugs.debian.org/426267
-
-Wed May 30 00:24:09 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (open_args, arg_ambiguous, parser_warning): should not use
- rb_warning in the parser.
-
-Tue May 29 12:31:33 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * win32/win32.c (rb_w32_opendir): removed duplicated code.
-
-Tue May 29 10:55:24 2007 Koichi Sasada <ko1@atdot.net>
-
- * cont.c: fix bug around Continuation and Fiber.
-
- * test/ruby/test_continuation.rb: add tests for Continuation.
-
-Tue May 29 10:54:34 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * win32/win32.c (rb_w32_opendir): store attributes of the second
+ entries or later too.
* win32/win32.c (rb_w32_opendir, rb_w32_readdir): eliminate magic
numbers.
-Mon May 28 10:27:14 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * cont.c: fixed a function name.
-
-Mon May 28 03:56:44 2007 Koichi Sasada <ko1@atdot.net>
+Mon May 28 02:54:05 2007 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
- * cont.c: support Fiber. Check test/ruby/test_fiber.rb for detail.
- Fiber is known as "Micro Thread", "Coroutine", and other terms.
- At this time, only Fiber#pass is supported to change context.
- I want to know more suitable method name/API for Fiber (... do you
- know more suitable class name instead of Fiber?) as "suspend/resume",
- "call", "yield", "start/kick/stop/restart", ....
-
- * eval.c, eval_intern.h, thread.c, yarvcore.c, yarvcore.h: ditto.
-
-Sat May 26 00:38:21 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval.c (ruby_exec_internal): do nothing if no code.
-
- * compile.c (rb_iseq_compile): check node if NULL before check
- nd_type. [ruby-talk:252956]
+ * lib/rinda/tuplespace.rb (Rinda::TupleBag#delete): use rindex and
+ delete_at instead of delete for little improvement.
Sat May 26 00:05:22 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
@@ -39330,54 +4349,6 @@ Sat May 26 00:05:22 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
skip tests for exitstatus and termsig on the platforms where
signals not supported.
-Fri May 25 16:04:47 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * yarvcore.c (Init_VM): wrap already initialized structs to use
- it directly.
-
-Fri May 25 11:09:47 2007 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * regint.h (include): on some platform, defines.h redefines
- SIZE_OF_LONG_LONG so shouldn't re-include config.h after included
- defines.h.
-
- * regint.h (vsnprintf): ruby on windows already have vsnprintf macro.
-
-Thu May 24 12:07:27 2007 Koichi Sasada <ko1@atdot.net>
-
- * cont.c: check across trap violation.
-
- * eval.c, yarvcore.h: ditto.
-
-Thu May 24 11:46:55 2007 Koichi Sasada <ko1@atdot.net>
-
- * gc.c, yarvcore.c: fix to mark VM structure on startup.
-
- * yarvcore.h: disable USE_CACHED_VALUE.
-
-Thu May 24 01:54:53 2007 Koichi Sasada <ko1@atdot.net>
-
- * cont.c: support callcc which everyone love.
- incomplete. please give me bug reports.
-
- * common.mk, inits.c, thread.c: ditto.
-
- * yarvcore.c: export thread_mark().
-
- * yarvcore.h: disable value cache option.
-
- * eval_intern.h: set th_get_ruby_level_cfp to inline.
-
-Wed May 23 15:39:02 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * common.mk: add a rule for regsyntax.c.
-
-Wed May 23 10:31:53 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * oniguruma.h: updated to Oniguruma 5.7.0.
-
- * regsyntax.c, unicode.c: new files along with Oniguruma 5.x.
-
Wed May 23 06:51:46 2007 URABE Shyouhei <shyouhei@ruby-lang.org>
* lib/cgi.rb (CGI#[]): get rid of exceptions being raised.
@@ -39389,148 +4360,50 @@ Wed May 23 05:49:49 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
load path to get rid of load pre-installed extensions/libraries.
[ruby-core:11017]
-Tue May 22 16:37:36 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * ruby.c (set_arg0): support RSTRING_LEN on HP-UX. a patch from
- WATANABE Tetsuya <Tetsuya.WATANABE AT nifty.com>. [ruby-dev:30806]
-
-Mon May 21 13:40:00 2007 Koichi Sasada <ko1@atdot.net>
-
- * compile.c, vm_macro.def: support tail call optimization
- (on default, this feature is not enabled).
-
- * iseq.c, compile.c, vm_opts.h: add "tailcall_optimization"
- option.
-
- * sample/test.rb (test_ok): fix to adjust tailcall stack layout.
-
- * insns.def, vm.c, compile.c, yarvcore.c, yarvcore.h:
- add opt_gt, opt_le instructions.
-
-Mon May 21 03:34:06 2007 Minero Aoki <aamine@loveruby.net>
-
- * lib/net/smtp.rb: CRAM-MD5 authentication did not work.
- [ruby-dev:30770]
-
-Sat May 19 10:26:01 2007 Tadayoshi Funaba <tadf@dotrb.org>
+Sat May 19 10:29:18 2007 Tadayoshi Funaba <tadf@dotrb.org>
* lib/date/format.rb (Date._parse): detects some OFX dates
(Of course not fully).
-Sat May 19 03:08:05 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * enum.c (enum_inject): minor improvement. [ruby-dev:30792]
-
- * enum.c (one_i): no needs to iterate once the result became false.
+Fri May 18 23:07:33 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
- * enum.c (enum_one): fix for an example.
+ * array.c (rb_ary_first): call rb_ary_subseq() instead of pushing
+ values by itself. [ruby-talk:252062]
- * enum.c (one_iter_i, none_iter_i): DRY.;
+ * array.c (rb_ary_first): add negative length check.
-Sat May 19 01:07:42 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
+Fri May 18 17:10:31 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * enum.c (enum_inject): it is now can work without block. you
- have to specify two argument method name as the first argument.
+ * win32/win32.c (move_to_next_entry): loc also must move forward.
+ [ruby-talk:251987]
- * enum.c (Init_Enumerable): reduce is new alias to inject.
+Fri May 18 03:02:40 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat May 19 01:05:33 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * file.c (Init_File): method definition mismatch.
-
-Fri May 18 16:44:04 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * file.c (Init_File): add to_path method to File objects.
-
-Fri May 18 11:12:39 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * win32/mkexports.rb: preserve prefixed underscores for WINAPI
+ symbols.
- * ruby.c (DllMain, ruby_init_loadpath): use DLL instance handle given
- to DllMain instead of VirtualQuery so that loadpath becomes relative
- from the DLL on WinCE too.
+ * wince/mkconfig_wce.rb, wince/mkexports.rb: obsolete.
Thu May 17 17:03:11 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* misc/ruby-style.el (ruby-style-label-indent): for yacc rules.
-Thu May 17 13:30:27 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * parse.y (f_arg): remove typo from ripper description.
-
-Thu May 17 13:23:38 2007 Koichi Sasada <ko1@atdot.net>
-
- * parse.y, compile.c (set_arguments): fix to support in-paren
- parameter (ex: def foo((a, b))).
-
-Thu May 17 13:01:52 2007 Koichi Sasada <ko1@atdot.net>
-
- * iseq.c (ruby_iseq_disasm): fix to show post arg info.
-
-Thu May 17 12:56:52 2007 Koichi Sasada <ko1@atdot.net>
-
- * debug.c (ruby_debug_node): fix to show node line.
-
-Wed May 16 21:48:44 2007 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
-
- * lib/logger.rb (Logger::Application): remove meaningless logdev
- attribute and added logger attribute instead. [ruby-core:11143]
- also added Logger#formatter rdoc comment.
-
-Tue May 15 16:40:07 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * test/ruby/test_beginendblock.rb (test_endblockwarn): now parser
- warnings emit source names and line numbers.
-
-Tue May 15 15:01:38 2007 NAKAMURA Usaku <usa@ruby-lang.org>
+Tue May 15 14:54:07 2007 NAKAMURA Usaku <usa@ruby-lang.org>
* win32/win32.c (init_stdhandle): stderr should be without buffering,
but mswin32 use buffering when stderr is not connected to tty.
-Mon May 14 02:12:07 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * array.c (rb_ary_zip): a.zip(b,c) should return an array, not
- enumerator.
-
- * array.c (rb_ary_zip): a.zip(b,c) should return array with size
- truncated to the size of its shortest argument array.
- [incompatible]
-
-Mon May 14 01:54:15 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * array.c (rb_ary_choice): should return nil when the array is
- empty.
-
-Sat May 12 18:26:36 2007 Minero Aoki <aamine@loveruby.net>
-
- * lib/net/http.rb (tokens): forgot to add strip. [ruby-core:11120]
-
- * test/net/http/test_http.rb: test Net::HTTP.post_form.
-
-Fri May 11 15:27:09 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * iseq.c (iseq_data_to_ary): internal IDs must not be exposed.
- [ruby-core:11073]
+Mon May 14 13:28:03 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * parse.y (internal_id_gen): now returns scope local ID instead of
- global one.
+ * ext/thread/thread.c (wait_list): supress a warning.
-Thu May 10 15:15:53 2007 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * test/ruby/test_super.rb: add tests.
-
-Thu May 10 15:14:05 2007 NAKAMURA Usaku <usa@ruby-lang.org>
+Thu May 10 15:21:51 2007 NAKAMURA Usaku <usa@ruby-lang.org>
* ext/iconv/iconv.c (iconv_s_conv): rdoc fix.
-Thu May 10 15:09:23 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (POINTER_P): pointer may be larger than long.
+Thu May 10 10:14:14 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * parse.y (vtable_size, vtable_included, vtable_tblcpy,
- vtable_to_tbl): constified.
-
-Thu May 10 10:13:14 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * thread.c (rb_thread_priority): rdoc fix; the initial value is
+ * eval.c (rb_thread_priority): rdoc fix; the initial value is
inherited from the creating thread. [ruby-core:10607]
Wed May 9 12:28:57 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
@@ -39538,163 +4411,49 @@ Wed May 9 12:28:57 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* bignum.c (Init_Bignum), numeric.c (Init_Numeric): added fdiv as
aliases of quo. [ruby-dev:30771]
-Tue May 8 23:39:09 2007 Tadayoshi Funaba <tadf@dotrb.org>
-
- * lib/date/format.rb (Date._parse): revised treatment of
- hyphened/separatorless dates.
-
- * lib/date/format.rb: some trivial adjustments.
-
-Tue May 8 20:23:07 2007 Tadayoshi Funaba <tadf@dotrb.org>
-
- * lib/date/format.rb: reverted.
-
-Tue May 8 19:32:18 2007 Keiju Ishitsuka <keiju@ruby-lang.org>
-
- * lib/rational.rb: fix high-precision Rationals cannot be
- converted to Floats. [ruby-Bugs:10502], [ruby-core:11069],
- [ruby-dev:30743]
-
-Mon May 7 10:59:55 2007 Kouhei Sutou <kou@cozmixng.org>
-
- * lib/rss/image.rb, test/rss/test_image.rb: fixed Image module
- namespace URI. reported by Dmitry Borodaenko. Thanks.
-
-Sun May 6 18:44:11 2007 Minero Aoki <aamine@loveruby.net>
-
- * lib/net/http.rb (Net::HTTP.post_form): allow an Array of String
- for pairs argument. [ruby-Bugs:10340]
-
- * lib/net/http.rb (Net::HTTP#set_form_data): ditto.
-
-Sun May 6 17:54:36 2007 Minero Aoki <aamine@loveruby.net>
-
- * lib/net/http.rb: Connection header field might include both of
- "keep-alive" token and "close" token. [ruby-core:10818]
-
-Sat May 5 16:26:33 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/date/format.rb (Format::Bag#method_missing): get rid of
- modifying original argument. [ruby-core:11090]
-
-Thu May 3 22:20:08 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in, defines.h, eval_load.c (rb_feature_p, rb_provided,
- search_required, rb_require_safe), ext/extmk.rb: Fix
- a bug where a statically linked extension cannot be autoloaded.
- [ruby-dev:30023] / [ruby-dev:30239]
-
- * thread.c: added an internal class, Barrier.
-
- * thread.c: copied rdocs from fastthread.
-
- * yarvcore.h (struct rb_vm_struct): moved loading_table from global.
-
-Thu May 3 18:10:12 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * vm_evalbody.ci, insns.def, vm.c, tool/insns2vm.rb (rb_num_t):
- renamed to get rid of name clash. [ruby-dev:30504]
-
- * yarvcore.c (ruby_thread_init): ditto.
-
-Wed May 2 18:52:58 2007 Koichi Sasada <ko1@atdot.net>
-
- * vm.c, yarvcore.h, yarvcore.c, insns.def: fix to mark VM stack
- in correct range.
-
-Wed May 2 17:13:26 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed May 9 11:55:15 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* bignum.c (rb_big_quo): now calculate in integer. [ruby-dev:30753]
-Wed May 2 15:14:56 2007 Koichi Sasada <ko1@atdot.net>
-
- * eval_method.h: add redefine checks ([ruby-dev:30751]).
-
-Wed May 2 11:22:52 2007 Koichi Sasada <ko1@atdot.net>
-
- * compile.c: use Qtrue instead of 2.
+Wed May 9 11:51:06 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * vm.c, insns.def: support "lambda" calling convention.
-
-Wed May 2 06:46:43 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * error.c, parse.y, ruby.h (rb_compile_warn, rb_compile_warning): warn
- for compilation. the parser should no longer use rb_warn() and
- rb_warning(). [ruby-dev:30121]
-
-Wed May 2 05:45:21 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (assoc): result of assoc_new needs to be an assoc.
+ * bignum.c (rb_big_pow): reduce multiplying for even number.
-Wed May 2 05:40:43 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * bignum.c (rb_big_pow): truncate all zero BDIGITs. [ruby-dev:30733]
* bignum.c (rb_big_pow): improvement by calculating from MSB and using
factorization. <http://yowaken.dip.jp/tdiary/20070426.html#p01>
-Tue May 1 18:45:45 2007 Koichi Sasada <ko1@atdot.net>
-
- * sample/test.rb: import matzruby's sample/test.rb.
-
-Tue May 1 17:46:05 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * array.c (rb_ary_choice): a new method to choose an element
- randomly from an array.
-
- * array.c (rb_ary_choice): fixed mistake from RDoc.
-
-Tue May 1 13:59:18 2007 Koichi Sasada <ko1@atdot.net>
-
- * proc.c (proc_arity): fix an arity bug ([ruby-core:11060]).
-
-Tue May 1 13:12:49 2007 Koichi Sasada <ko1@atdot.net>
-
- * yarvcore.h, compile.c (set_arguments): support post arguments.
-
- * test/ruby/test_method.rb: add tests for above.
-
- * test/ruby/test_proc.rb: ditto.
-
- * proc.c: fix an arity bug ([ruby-core:11029]).
-
- * vm.c, vm.h, insns.def, vm_dump.h: fix bmethod process.
-
- * vm.c: support block argument on block parameter.
-
-Fri Apr 27 17:05:41 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * numeric.c (int_pow): bugfix of overflow detection.
-
- * numeric.c (int_pow): rb_big_pow() may return other than Bignum.
-
-Fri Apr 27 01:51:50 2007 Koichi Sasada <ko1@atdot.net>
-
- * compile.c: support multiple splat (e.g, [a, *b, *c, e, *f]).
+ * numeric.c (int_pow): calculate power in Fixnum as possible.
+ [ruby-dev:30726]
-Fri Apr 27 00:03:48 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue May 8 23:42:51 2007 Tadayoshi Funaba <tadf@dotrb.org>
- * bignum.c (rb_big_pow): truncate all zero BDIGITs. [ruby-dev:30733]
+ * lib/date/format.rb (Date._parse): revised treatment of
+ hyphened/separatorless dates.
-Thu Apr 26 17:31:00 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/date/format.rb: some trivial adjustments.
- * bignum.c (rb_big_pow): reduce multiplying for even number.
+Tue May 8 20:25:05 2007 Tadayoshi Funaba <tadf@dotrb.org>
- * numeric.c (int_pow): calculate power in Fixnum as possible.
- [ruby-dev:30726]
+ * lib/date/format.rb: reverted.
-Thu Apr 26 17:18:51 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat May 5 16:26:33 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * parse.y: fixes for ripper.
+ * lib/date/format.rb (Format::Bag#method_missing): get rid of
+ modifying orginal argument. [ruby-core:11090]
- * parse.y (primary): reduced duplicated code.
+Mon Apr 30 01:17:51 2007 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
- * parse.y (f_arg_item): should not override by meaningless value.
+ * lib/rinda/tuplespace.rb (TupleSpace#create_entry, TupleBag#push,
+ delete): extract method, and rename parameter.
- * parse.y (f_arg, assocs): should not use $$ before assigned.
+Fri Apr 27 02:00:17 2007 Ryan Davis <ryand-ruby@zenspider.com>
- * parse.y (assoc_list): dispatch assoclist_from_args for assocs as
- well as args.
+ * signal.c: Fixed backwards compatibility for 'raise Interrupt'.
- * parse.y (assoc): return assoc if dispatched result is $1.
+ * lib/yaml/tag.rb: Running rdoc over the 1.8.6 tree skips
+ Module. Patch from James Britt
Thu Apr 26 13:54:51 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
@@ -39705,49 +4464,6 @@ Wed Apr 25 19:49:16 2007 Tanaka Akira <akr@fsij.org>
* ext/socket/socket.c (unix_send_io, unix_recv_io): use CMSG_DATA to
align file descriptor appropriately.
-Wed Apr 25 15:23:29 2007 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/win32.c (NtInitialize, exit_handler): add initializing and
- cleanup of critical section object for select.
-
- * win32/win32.c (do_select): block reentrance.
-
- * win32/win32.c (rb_w32_select): 0 sec polling of socket. this is
- workaround because winsock cannot do select at same socket at the
- same time by two or more threads.
-
-Wed Apr 25 14:10:47 2007 Koichi Sasada <ko1@atdot.net>
-
- * ext/probeprofiler/probeprofiler.c: fix function name and
- return value.
-
-Wed Apr 25 12:42:40 2007 Koichi Sasada <ko1@atdot.net>
-
- * yarvcore.h: remove rb_control_frame_t#callee_id.
-
- * vm_macro.def: ditto.
-
- * eval_intern.h (exec_event_hooks): fix to check event flags
-
- * eval_intern.h (EXEC_EVENT_HOOK): fix to re-check event flags.
-
- * ext/probeprofiler : added. this profiler is sampling based
- profiler.
-
- * vm.c: add rb_thread_current_status() API for probeprofiler.
-
- * thread.c (rb_thread_execute_interrupts): add comments.
-
-Wed Apr 25 10:36:03 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval_intern.h (PUSH_TAG): no argument now.
-
- * eval.c, eval_error.h, eval_jump.h, eval_load.c, proc.c, thread.c:
- ditto.
-
- * thread.c (alloc_event_hook, rb_thread_remove_event_hook): should
- return value.
-
Tue Apr 24 09:33:57 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* dir.c (do_stat, do_lstat, do_opendir): should not warn ENOTDIR.
@@ -39775,89 +4491,19 @@ Fri Apr 20 12:27:04 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/optparse.rb: fix to override conv proc.
-Fri Apr 20 12:21:28 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval.c (ruby_cleanup): fixed access to out of bound, and inverted
- the order of errinfos.
-
-Fri Apr 20 10:33:23 2007 Koichi Sasada <ko1@atdot.net>
-
- * eval_intern.h: add prototypes of rb_sourceline() and
- rb_sourcefile().
+Fri Apr 20 12:17:05 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Apr 20 02:37:48 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * eval.c (ruby_cleanup): inversed the order of errinfos.
- * eval.c (ruby_cleanup): re-send signal. [ruby-dev:30516]
-
- * eval_error.h (error_handle): no message when exiting by signal.
+Thu Apr 19 14:53:32 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * intern.h (rb_thread_signal_raise, ruby_default_signal): prototypes.
-
- * signal.c (esignal_init): takes a signal number and an optional
- signal name.
-
- * signal.c (interrupt_init): pass SIGINT always.
-
- * signal.c (ruby_default_signal): invoke system default signal
- handler.
-
- * signal.c (rb_f_kill): use NUM2PIDT instead of NUM2INT.
-
- * signal.c (rb_signal_exec, trap): handle SIGTERM. [ruby-dev:30505]
-
- * thread.c (rb_thread_signal_raise): now takes signal number instead
- of signal name.
-
- * thread.c (rb_thread_signal_exit): since rb_make_exception() calls
- #exception method, rb_class_new_instance() is not needed here.
-
- * yarvcore.h (struct rb_vm_struct), eval_jump.h (terminate_process):
- exit_code is no longer stored in VM.
-
-Thu Apr 19 18:37:49 2007 Koichi Sasada <ko1@atdot.net>
-
- * eval.c, node.h, thread.c, yarvcore.[ch], eval_intern.h:
- support set_trace_func (incomplete. id and klass
- don't be passed). And support Thread#set_trace_func
- which hook only specified thread and Thread#add_trace_func
- which add new trace func instead of replace old one.
- C level API was modified. See thread.c (logic) and
- yarvcore.h (data structures).
-
- * vm.c, vm_macro.def: add hook points.
-
- * compile.c, insns.def: fix "trace" instruction.
-
- * iseq.c, vm_macro.h: add compile option "trace_instruction".
-
- * test/ruby/test_settracefunc.rb: hook "c-return" of set_trace_func.
-
-Thu Apr 19 20:57:50 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * parse.y (symbol): symbols should be followed by EXPR_ENDARG.
-
- * parse.y (dsym): ditto.
-
- * parse.y (parser_yylex): strings should be followed by
- EXPR_ENDARG.
-
- * parse.y (parser_yylex): ditto for numbers.
-
- * parse.y (parser_yylex): EXPR_ENDARG after ']' and '}'.
-
-Thu Apr 19 17:46:36 2007 Koichi Sasada <ko1@atdot.net>
-
- * lib/optparse.rb: fix to override conv proc.
+ * lib/monitor.rb (ConditionVariable#wait, mon_enter, mon_exit_for_cond):
+ ensures Thread.critical to be false. [ruby-talk:248300]
Wed Apr 18 10:41:21 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* util.c (ruby_strtod): exponent is radix 10. [ruby-talk:248272]
-Wed Apr 18 02:50:50 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * yarvcore.c (th_init2): push initial blockptr value for
- rb_block_given_p() outside ruby_exec(). [ruby-core:10923]
-
Wed Apr 18 02:30:24 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* configure.in (LDFLAGS): prepend -L. instead appending it to
@@ -39866,6 +4512,14 @@ Wed Apr 18 02:30:24 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* configure.in (Makefile): remove $U for automake from MISSING.
[ruby-talk:248171]
+Tue Apr 17 16:46:46 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * eval.c (rb_yield_0): should not clear state on TAG_NEXT when
+ it's invoked from within lambda body. [ruby-talk:248136]
+
+ * eval.c (proc_invoke): handle TAG_NEXT which would be caused by
+ next in the lambda body as well.
+
Mon Apr 16 22:56:01 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
* ext/pty/expect_sample.rb: avoid symbolic link representation for
@@ -39893,124 +4547,23 @@ Mon Apr 16 16:34:08 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
* parse.y (parser_yylex): should set command_start after block
starting "do"s and braces. [ruby-core:10916]
-Mon Apr 16 10:51:37 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * enum.c (enum_each_with_index): each_with_index to forward
- arguments to each. [ruby-core:10921]
-
-Mon Apr 16 10:43:10 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * time.c (time_arg): should allow to specify 24:00.
- [ruby-core:10915]
-
-Sun Apr 15 09:12:54 2007 Tadayoshi Funaba <tadf@dotrb.org>
+Sun Apr 15 09:19:57 2007 Tadayoshi Funaba <tadf@dotrb.org>
* lib/date/format.rb: added some zone names.
* lib/date/format.rb (_parse): now interprets doted numerical
dates as a big endian (except dd.mm.yyyy).
-Thu Apr 12 17:13:22 2007 Koichi Sasada <ko1@atdot.net>
-
- * thread.c (mutex_try_lock): check and set owner thread.
-
- * thread_pthread.ci: fix to show error code in error message.
-
-Thu Apr 12 17:11:54 2007 Koichi Sasada <ko1@atdot.net>
-
- * eval.c (rb_rescue2): restore cfp ([ruby-dev:30582]).
-
-Thu Apr 12 16:06:48 2007 Koichi Sasada <ko1@atdot.net>
-
- * eval.c (rb_protect): restore cfp ([ruby-dev:30671]).
-
-Thu Apr 12 16:04:31 2007 Koichi Sasada <ko1@atdot.net>
-
- * compile.c (iseq_compile_each): check node->nd_state == 1, not !0.
-
-Wed Apr 11 16:35:16 2007 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/win32.[ch] (rb_w32_enter_critical, rb_w32_leave_critical): no
- need to reject reentrance. removed.
-
- * rubysig.h (RUBY_CRITICAL): follow above changes.
-
- * rubysig.h (TRAP_BEG, TRAP_END): no need to save errno.
-
-Tue Apr 10 17:02:17 2007 NAKAMURA Usaku <usa@ruby-lang.org>
+Tue Apr 10 17:37:36 2007 NAKAMURA Usaku <usa@ruby-lang.org>
* win32/win32.c (rb_w32_fclose, rb_w32_close): need to save errno
before calling original fclose()/close().
-Tue Apr 10 16:14:22 2007 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * thread_win32.ci (w32_wait_events): check whether interrupt_event is
- valid handle or not.
-
- * thread_win32.ci (native_thread_destroy): clear interrupt_event when
- close it.
-
-Tue Apr 10 15:53:17 2007 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * thread_pthread.ci (native_thread_create): initialize sleep_cond.
- fixed: [ruby-dev:30675]
-
-Mon Apr 9 18:48:57 2007 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * thread.c (do_select): ubf_select() is not necessary. interrupt is
- checked in the loop.
-
-Mon Apr 9 18:27:26 2007 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * thread.c (do_select): use ubf_select() as UBF on windows.
-
- * win32/win32.c (do_select): shouldn't call catch_interrupt() here.
- fixed: [ruby-dev:30674], reported by wanabe.
-
-Mon Apr 9 09:24:32 2007 Shugo Maeda <shugo@ruby-lang.org>
+Mon Apr 9 09:30:44 2007 Shugo Maeda <shugo@ruby-lang.org>
* lib/net/imap.rb (disconnect): call shutdown for
SSLSocket. Thanks, Technorama Ltd.
-Sun Apr 8 13:28:17 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * compile.c (defined_expr): test arguments of NODE_CALL and so
- on as well as NODE_ATTRASGN. [ruby-core:10886]
-
-Fri Apr 6 10:56:29 2007 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * ext/openssl/ossl_pkey_ec.c (ossl_ec_key_get_group): get rid of
- warning. we are aware of it.
-
-Fri Apr 6 04:00:24 2007 Technorama Ltd. <oss-ruby@technorama.net>
-
- * ext/openssl/ossl_{bn,x509{attr,cert,name,store}}.c:
- Add documentation.
-
-Thu Apr 5 17:59:19 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * compile.c (defined_expr): support for assignment.
- [ruby-core:10867]
-
- * compile.h (ADD_CATCH_ENTRY): removed temporary variable.
-
-Thu Apr 5 15:13:34 2007 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * ext/openssl/ossl_ssl_session.c (ossl_ssl_session_alloc): should
- return value.
-
-Thu Apr 5 14:58:49 2007 Technorama Ltd. <oss-ruby@technorama.net>
-
- * ext/openssl/ossl_pkcs5.c: New module.
-
- * ext/openssl/ossl_{cipher,digest,pkcs7,pkcs12}.c:
- Remove redundant module namespace.
-
- * ext/openssl/lib/openssl/{cipher,digest}.rb
- Add backwards compatible classes for rearranged classes.
-
- * ext/openssl/ossl_{pkcs7,pkcs12}.c: Add documentation.
-
Thu Apr 5 00:42:48 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* error.c (rb_notimplement), io.c (pipe_open): removed definite
@@ -40021,258 +4574,153 @@ Wed Apr 4 17:09:17 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* io.c (pipe_open): refined the message of NotImplementedError.
[ruby-dev:30685]
-Wed Apr 4 12:29:02 2007 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * error.c (rb_notimplement): should show the name of this func,
- not callee.
-
Wed Apr 4 10:18:04 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * io.c (popen_exec): should not close close-on-exec FDs.
- [ruby-dev:30679]
-
* io.c (pipe_open): raise NotImplementedError for command "-" on
platforms where fork(2) is not available. [ruby-dev:30681]
-Tue Apr 4 04:17:18 2007 Technorama Ltd. <oss-ruby@technorama.net>
-
- * ext/openssl/ossl_ssl.c: Add documentation.
-
-Tue Apr 3 16:22:24 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/openssl/extconf.rb: check for functions added in 1.9.
-
- * ext/openssl/ruby_missing.h: check per features instead by
- checking version code. [ruby-core:10845]
-
-Tue Apr 3 16:02:44 2007 Technorama Ltd. <oss-ruby@technorama.net>
-
- * ext/openssl/ossl_bn.c: More documentation.
-
- * ext/openssl/lib/ossl_{pkey,pkey_ec}.[ch]: Add elliptic curves.
-
-Tue Apr 3 15:50:41 2007 NAKAMURA Usaku <usa@ruby-lang.org>
+Tue Apr 3 15:45:41 2007 NAKAMURA Usaku <usa@ruby-lang.org>
* ext/socket/socket.c (s_recv, s_recvfrom): some systems (such as
windows) doesn't set fromlen if the socket is connection-oriented.
reported by Bram Whillock in [ruby-core:10512] [ruby-Bugs#9061]
-Tue Apr 3 09:36:55 2007 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * ext/openssl/ruby_missing.h: need to include version.h to check
- RUBY_VERSION_CODE.
-
-Mon Apr 3 07:10:12 2007 Technorama Ltd. <oss-ruby@technorama.net>
-
- * ext/openssl/ossl_{ssl.[ch],ssl_session.c},
- ext/openssl/lib/openssl/lib/openssl/ssl.rb:
- New SSL::Session class. Add session cb's, getter/setters,
- config, and statistics methods.
-
-Mon Apr 3 04:00:23 2007 Technorama Ltd. <oss-ruby@technorama.net>
-
- * ext/openssl/{ossl.[ch],ossl_pkey.c} Add documentation.
-
- * ext/openssl/ossl_hmac.c Add reset method.
-
- * ext/openssl/ossl_cipher.c (Cipher#update) Take additional
- buffer argument.
+Sat Mar 24 23:40:29 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/openssl/{ossl_bio.c,ossl_ssl.c,ruby_missing.h}
- compatibility with 1.8.
+ * node.h (struct rb_thread.locals): explicit as struct.
+ [ruby-core:10585]
-Mon Apr 2 21:55:12 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * eval.c, node.h (enum rb_thread_status, struct rb_thread,
+ rb_curr_thread, rb_main_thread): prefixed. [ruby-core:10586]
- * insns.def (throw), thread.c, yarvcore.h (throwed_errinfo): fixed
- typo.
+ * file.c (chompdirsep): made an unprefixed name static.
-Fri Mar 30 11:46:51 2007 NAKAMURA Usaku <usa@ruby-lang.org>
+ * io.c (io_fread): ditto.
- * win32/win32.c (rb_w32_cmdvector): fixed buffer size. reported by
- wanabe [ruby-dev:30672]
+Sat Mar 24 01:54:03 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * win32/win32.c (init_env, insert, rb_w32_get_environ): use strdup
- instead of malloc + strlcpy. suggested by nobu [ruby-dev:30673]
+ * eval.c (ruby_cleanup): exit by SystemExit and SignalException in END
+ block. [ruby-core:10609]
-Fri Mar 30 02:29:04 2007 Technorama <oss-ruby@technorama.net>
+ * test/ruby/test_beginendblock.rb (test_should_propagate_exit_code):
+ test for exit in END block. [ruby-core:10760]
- * ext/openssl/ossl_{bn,cipher,digest,hmac,rand,pkey_{dh,dsa,rsa}}.c:
- Add Documentation for various methods.
-
- * ext/openssl/lib/openssl/cipher.rb: Ditto
-
- * ext/openssl/ossl_bn.c: add lshift! and rshift! methods.
-
- * ext/openssl/ossl_digest.c: GetDigestPtr() also accept a string.
-
-Fri Mar 23 11:28:24 2007 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/win32.c (init_env, insert, cmdglob, rb_w32_cmdvector,
- rb_w32_opendir, rb_w32_readdir, rb_w32_strerror, rb_w32_stati64,
- rb_w32_get_environ): use strlcpy() and strlcat().
-
- * win32/win32.c (rb_w32_opendir): use realloc() instead of xrealloc().
-
- * win32/win32.c (rb_w32_closedir): check NULL before free pointers.
-
-Fri Mar 23 00:24:52 2007 Keiju Ishitsuka <keiju@ruby-lang.org>
-
- * lib/shell: commit miss(support for ruby 1.9(YARV) thread model).
+ * test/ruby/test_beginendblock.rb (test_should_propagate_signaled):
+ test for signal in END block.
-Thu Mar 22 13:32:17 2007 NAKAMURA Usaku <usa@ruby-lang.org>
+Thu Mar 22 23:13:17 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * win32/Makefile.sub (LIBS): remove an unnecessary library.
+ * eval.c (rb_provided): check for extension library if SOEXT is
+ explicitly given. [ruby-dev:30657]
-Thu Mar 22 10:27:58 2007 NAKAMURA Usaku <usa@ruby-lang.org>
+Thu Mar 22 10:29:25 2007 NAKAMURA Usaku <usa@ruby-lang.org>
* test/ruby/test_bignum.rb (test_to_s): add tests for Bignum#to_s.
-Wed Mar 21 20:38:06 2007 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * marshal.c (w_short, w_long, w_object): get rid of VC++ warnings.
-
-Wed Mar 21 20:05:07 2007 Koichi Sasada <ko1@atdot.net>
-
- * compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
- proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
- debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
- is to change node structure around NODE_SCOPE, NODE_ARGS. Every
- scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
- represents more details of arguments information. I'll write a
- document about detail of node structure.
-
Wed Mar 21 17:04:30 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* bignum.c (rb_big2str0): round up for the most significant digit.
[ruby-core:10686]
-Tue Mar 21 08:20:00 2007 Nathaniel Talbott <ntalbott@ruby-lang.org>
-
- * test/testunit/collector/test_dir.rb: Fixed test/unit tests that
- were breaking due to Module#public_instance_methods now
- returning a Symbol instead of a String.
+Wed Mar 21 07:21:24 2007 Akinori MUSHA <knu@iDaemons.org>
- * test/testunit/collector/test_objectspace.rb: Ditto.
+ * ext/thread/thread.c (remove_one): Preserve List invariants;
+ submitted by: MenTaLguY <mental AT rydia.net>
+ in [ruby-core:10598] and [ruby-bugs:PR#9388].
Tue Mar 20 22:54:50 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
* marshal.c (w_extended): erroneous check condition when dump
method is defined. [ruby-core:10646]
-Tue Mar 20 21:36:47 2007 Keiju Ishitsuka <keiju@ruby-lang.org>
-
- * lib/shell.rb, lib/shell: support for ruby 1.9(YARV) thread model.
-
-Tue Mar 20 16:36:08 2007 URABE Shyouhei <shyouhei@ruby-lang.org>
+Tue Mar 20 15:37:24 2007 URABE Shyouhei <shyouhei@ruby-lang.org>
* distruby.rb: Add zip generation.
-Tue Mar 20 16:20:49 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (rb_f_callee_name): add __method__ and __callee__ again.
- __callee__ need to rework to adopt YARV. [ruby-core:10671]
-
-Tue Mar 20 11:09:00 2007 Akinori MUSHA <knu@iDaemons.org>
-
- * lib/set.rb: Revise rdoc.
-
- * lib/set.rb (Set#freeze, Set#taint, Set#untaint): Implement
- Set#freeze, Set#taint, and Set#untaint; requested by: Dan
- Hutchings <dan AT moltoagitato.com> in [ruby-bugs:PR#9359].
-
-Tue Mar 20 09:13:10 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * process.c (rb_fork): flush stdouts always before fork(2).
- fixed: [ruby-dev:30612]
-
-Tue Mar 20 01:38:48 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * thread.c (thread_start_func_2): store the result of first_func
- as well as first_proc.
-
- * thread.c (thread_create_core): block is not used if first_func
- is given.
-
-Mon Mar 19 16:58:52 2007 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * missing/{strlcat,strlcpy}.c, missing.h: new functions.
-
- * LEGAL: add copyright notice about above files.
-
- * configure.in: check whether strlcat and strlcpy are exist or not.
-
- * {bcc32,win32,wince}/Makefile.sub: use above files.
-
-Mon Mar 19 14:12:25 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
+Tue Mar 20 11:28:41 2007 Akinori MUSHA <knu@iDaemons.org>
* lib/matrix.rb (Matrix::inverse_from): adding partial pivoting to
the Gauss-Jordan algorithm, making it stable. a patch from
Peter Vanbroekhoven. [ruby-core:10641]
-Mon Mar 19 12:13:36 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
+Mon Mar 19 11:39:29 2007 Minero Aoki <aamine@loveruby.net>
- * regparse.c, etc.: K&R to ANSI code cleanup patch from Stefan
- Huehner <stefan at huehner.org>. [ruby-core:10543]
+ * lib/net/protocol.rb (rbuf_read): extend buffer size for speed.
-Mon Mar 19 11:27:13 2007 Minero Aoki <aamine@loveruby.net>
+Sun Mar 18 04:23:52 2007 Akinori MUSHA <knu@iDaemons.org>
- * lib/net/protocol.rb (rbuf_read): extend buffer size for speed.
+ * NEWS: Add a note about the new `date' library defining
+ Time#to_date and Time#to_datetime private methods.
-Sun Mar 18 08:31:51 2007 NAKAMURA Usaku <usa@ruby-lang.org>
+ * NEWS: Inform that the old `thread' library is considered to be
+ stable.
- * win32/dir.h, win32/win32.c (rb_w32_opendir, rb_w32_readdir,
- rb_w32_closedir): get rid of possible buffer-overflows.
+ * NEWS: Sort library entries in alphabetical order.
-Sat Mar 17 19:10:39 2007 Kouhei Sutou <kou@cozmixng.org>
+Fri Mar 16 21:48:11 2007 Akinori MUSHA <knu@iDaemons.org>
- * lib/rss, test/rss:
- - supported Atom.
- - bumped version 0.1.6 to 0.1.7.
- * sample/rss/convert.rb: added new sample.
+ * ext/dl/dl.c (rb_ary2cary): Fix a bug in type validation;
+ submitted by sheepman <sheepman AT sheepman.sakura.ne.jp>
+ in [ruby-dev:30554].
+
+Fri Mar 16 18:28:06 2007 Akinori MUSHA <knu@iDaemons.org>
-Fri Mar 16 22:32:20 2007 Minero Aoki <aamine@loveruby.net>
+ * ext/etc/etc.c (etc_getgrgid): Fix a bug in Etc::getgrgid()
+ always returning the (real) group entry of the running process;
+ reported by: UEDA Hiroyuki <ueda AT netforest.ad.jp>
+ in [ruby-dev:30586].
- * lib/net/pop.rb: change default verification mode from
- VERIFY_PEER to VERIFY_NONE because most POPS server does not have
- true certification.
+Fri Mar 16 16:33:58 2007 Akinori MUSHA <knu@iDaemons.org>
-Fri Mar 16 22:19:24 2007 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+ * ext/thread/thread.c (unlock_mutex_inner): Make sure that the
+ given mutex is actually owned by the caller; submitted by:
+ Sylvain Joyeux <sylvain.joyeux AT m4x.org> in [ruby-core:10598].
- * ext/win32ole/win32ole.c: add WIN32OLE#ole_activex_initialize,
- a little bit supporting ActiveX control. [ruby-talk:241188]
+Fri Mar 16 16:21:35 2007 Akinori MUSHA <knu@iDaemons.org>
-Fri Mar 16 22:16:58 2007 Minero Aoki <aamine@loveruby.net>
+ * ext/thread/thread.c (wait_condvar, lock_mutex): Fix a problem in
+ ConditionVariable#wait that occurs when two threads that are
+ trying to access the condition variable are also in concurrence
+ for the given mutex; submitted by: Sylvain Joyeux
+ <sylvain.joyeux AT m4x.org> and MenTaLguY <mental AT rydia.net>
+ in [ruby-core:10598].
- * lib/net/http.rb: merge Ruby-SSPI patch contributed by Justin
- Bailey.
+Fri Mar 16 16:17:27 2007 Akinori MUSHA <knu@iDaemons.org>
- * ext/Win32API/lib/win32/sspi.rb: new file.
+ * test/thread/test_thread.rb: Add a test script for the `thread'
+ library. This should result in failure as of now with
+ ext/thread; submitted by: Sylvain Joyeux <sylvain.joyeux AT
+ m4x.org> in [ruby-core:10598].
Wed Mar 14 12:30:00 2007 Shigeo Kobayashi <shigeo@tinyforest.jp>
* ext/bigdecimal/bigdecimal.c: BigDecimal("-.31") is now
treated as ("-0.31") not as ("0.31").
-Tue Mar 13 19:04:30 2007 Keiju Ishitsuka <keiju@ruby-lang.org>
-
- * lib/sync.rb: support for ruby 1.9(YARV) thread model.
-
Tue Mar 13 09:25:10 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* common.mk (clear-installed-list): separated from install-prereq.
-Tue Mar 13 07:23:20 2007 Shugo Maeda <shugo@ruby-lang.org>
+Tue Mar 13 06:38:43 2007 Akinori MUSHA <knu@iDaemons.org>
+
+ * NEWS: Reword and improve entries.
+
+Tue Mar 13 06:03:46 2007 Akinori MUSHA <knu@iDaemons.org>
- * lib/monitor.rb (mon_try_enter): call @mon_muetx.try_lock.
- Thanks, Keiju ISHITSUKA. [ruby-dev:30507]
+ * stable version 1.8.6 released from the ruby_1_8_6 branch.
-Tue Mar 13 02:42:58 2007 Akinori MUSHA <knu@iDaemons.org>
+Tue Mar 13 03:24:07 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * runruby.rb: added --pure (turned on by default) and --debugger
+ options.
+
+Tue Mar 13 02:50:28 2007 Akinori MUSHA <knu@iDaemons.org>
* lib/cgi.rb (CGI::header): IIS >= 5.0 does not need the nph
assumption any more; submitted by MIYASAKA Masaru <alkaid AT
coral.ocn.ne.jp> in [ruby-dev:30537].
-Mon Mar 12 10:53:28 2007 Akinori MUSHA <knu@iDaemons.org>
+Mon Mar 12 11:07:44 2007 Akinori MUSHA <knu@iDaemons.org>
* ext/openssl/ossl_asn1.c (Init_ossl_asn1): Let rdoc know about
externally defined modules; submitted by Technorama
@@ -40298,105 +4746,101 @@ Mon Mar 12 10:53:28 2007 Akinori MUSHA <knu@iDaemons.org>
* ext/openssl/ossl_ssl.c (Init_ossl_ssl): Ditto.
-Sun Mar 11 18:42:01 2007 Akinori MUSHA <knu@iDaemons.org>
-
- * misc/ruby-mode.el (ruby-block-end-re): Support for the
- experimental ';;' terminator had been dropped.
-
-Sun Mar 11 05:45:46 2007 Akinori MUSHA <knu@iDaemons.org>
-
- * misc/README, misc/rdebug.el: Add rdebug.el, Emacs ruby-debug
- interface based on rubydb3x.el; submitted by Martin Nordholts
- <enselic AT gmail.com> in [ruby-bugs:PR#9023].
-
-Sat Mar 10 07:20:28 2007 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-
- * ext/win32ole/win32ole.c: add WIN32OLE_TYPELIB#library_name,
- WIN32OLE_TYPELIB#visible?.
+Mon Mar 12 01:05:17 2007 Akinori MUSHA <knu@iDaemons.org>
- * test/win32ole/test_win32ole_typelib.rb: ditto.
+ * ext/dl/sym.c (rb_dlsym_inspect): Use "0x%x" rather for pointers.
+ This might not be very right but it is commonly used in other
+ parts of the code; submitted by sheepman <sheepman AT
+ sheepman.sakura.ne.jp> in [ruby-dev:30532].
-Thu Mar 8 09:17:59 2007 Minero Aoki <aamine@loveruby.net>
+ * ext/dl/ptr.c (rb_dlptr_inspect): Ditto.
- * compile.c: iseq_compile -> rb_iseq_compile.
+Mon Mar 12 00:59:19 2007 Akinori MUSHA <knu@iDaemons.org>
- * iseq.c: ditto.
+ * ext/dl/lib/dl/import.rb (DL::Importable::Internal::import,
+ DL::Importable::Internal::callback): Avoid race condition for an
+ instance variable; submitted by sheepman <sheepman AT
+ sheepman.sakura.ne.jp> in [ruby-dev:30530].
- * intern.h: provide function prototype of Init_jump.
+Sun Mar 11 18:57:50 2007 Akinori MUSHA <knu@iDaemons.org>
- * eval_jump.h (Init_jump): declare function type.
+ * misc/README: Add a note about ruby-electric.el.
- * thread.c: platform-dependent functions should be surrounded by #ifdef.
+ * misc/ruby-mode.el (ruby-non-block-do-re): Fix
+ ruby-non-block-do-re. [ruby-core:03719]
- * iseq.c (iseq_data_to_ary): remove unused variable.
+ * misc/inf-ruby.el: Synchronize the comment section with trunk.
- * compile.c (set_arguments): ditto.
-
- * thread.c (set_unblock_function): ditto.
-
- * thread_pthread.ci: reduce printf warning.
+ * misc/README, misc/rdebug.el: Add rdebug.el, Emacs ruby-debug
+ interface based on rubydb3x.el; submitted by Martin Nordholts
+ <enselic AT gmail.com> in [ruby-bugs:PR#9023].
- * vm_dump.c: ditto.
+Sun Mar 11 17:45:51 2007 Akinori MUSHA <knu@iDaemons.org>
-Tue Mar 6 16:35:04 2007 Keiju Ishitsuka <keiju@ruby-lang.org>
+ * ext/dl/mkcallback.rb (mkfunc): Make sure that a callback
+ function is found in the function table before trying to call
+ it; submitted by sheepman <sheepman AT sheepman.sakura.ne.jp>
+ in [ruby-dev:30524].
- * lib/shell/process-controller.rb: fix thread synchronization problem for [ruby-dev:30477].
+Sun Mar 11 12:09:37 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Mar 6 11:53:25 2007 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * eval.c (error_handle): no message when exiting by signal.
- * ext/tk/sample/irbtkw.rbw: fails to exit process.
+ * eval.c (ruby_cleanup): re-send signal. [ruby-dev:30516]
-Tue Mar 6 10:23:09 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * eval.c (rb_thread_interrupt): instantiate SignalException.
- * runruby.rb: added --pure (turned on by default) and --debugger
- options.
+ * eval.c (rb_thread_signal_raise): now takes signal number instead
+ of signal name.
-Mon Mar 5 09:19:33 2007 Minero Aoki <aamine@loveruby.net>
+ * intern.h (rb_thread_signal_raise, ruby_default_signal): prototypes.
- * lib/timeout.rb (Timeout.timeout): should return the block value
- always.
+ * signal.c (esignal_init): takes a signal number and an optional
+ signal name.
- * lib/timeout.rb (Timeout.timeout): should yield sec argument
- always.
+ * signal.c (interrupt_init): pass SIGINT always.
- * lib/timeout.rb (Timeout.timeout): fix document.
+ * signal.c (ruby_default_signal): invoke system default signal
+ handler.
-Mon Mar 5 09:16:40 2007 Minero Aoki <aamine@loveruby.net>
+ * signal.c (rb_signal_exec, trap): handle SIGTERM. [ruby-dev:30505]
- * lib/net/smtp.rb: support automatic STARTTLS.
+Tue Mar 6 19:08:46 2007 Akinori MUSHA <knu@iDaemons.org>
- * lib/net/smtp.rb: check server advertisement.
+ * ext/digest/lib/md5.rb (MD5::new, MD5::md5): Do not modify
+ Digest::MD5.
- * lib/net/smtp.rb: introduce new class SMTP::Response.
+ * ext/digest/lib/sha1.rb (SHA1::new, SHA1::sha1): Ditto.
- * lib/net/smtp.rb (getok): should not use sprintf.
+Tue Mar 6 18:58:37 2007 Keiju Ishitsuka <keiju@ruby-lang.org>
- * lib/net/smtp.rb (get_response): ditto.
+ * lib/shell/process-controller.rb: fix thread synchronization
+ problem for [ruby-dev:30477].
- * lib/net/protocol.rb: reduce syntax warning on 1.9.
+Tue Mar 6 18:44:26 2007 Akinori MUSHA <knu@iDaemons.org>
-Mon Mar 5 07:13:28 2007 Minero Aoki <aamine@loveruby.net>
+ * ext/digest/lib/md5.rb (MD5::new, MD5::md5): Catch up with
+ Digest's API changes; noted by: Kazuhiro Yoshida <moriq AT
+ moriq.com> in [ruby-dev:30500].
- * lib/net/smtp.rb: reconstruct SMTPS/STARTTLS interface. New
- interface is incompatible from current 1.9 interface at all.
+ * ext/digest/lib/sha1.rb (SHA1::new, SHA1::sha1): Ditto.
- * lib/net/smtp.rb: All SSL-related class methods are removed; use
- instance methods instead.
+Tue Mar 6 18:24:19 2007 Akinori MUSHA <knu@iDaemons.org>
- * lib/net/smtp.rb: rename methods: *ssl -> *tls (with alias
- "ssl").
+ * time.c (time_to_s): Back out the format changes; discussed
+ in [ruby-dev:30495].
- * lib/net/smtp.rb: rename methods: *tls -> *starttls.
+Tue Mar 6 11:53:25 2007 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-Mon Mar 5 01:36:41 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/tk/sample/irbtkw.rbw: fails to exit process.
- * parse.y (parser_yylex), win32/win32.c (rb_w32_utime): fixed
- indentation broken at YARV merger.
+Mon Mar 5 20:14:49 2007 Akinori MUSHA <knu@iDaemons.org>
-Sun Mar 4 23:41:14 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * time.c (time_to_s): Correct the wrong format which did not
+ really conform to RFC 2822; pointed out by: OHARA Shigeki <os at
+ iij.ad.jp> in [ruby-dev:30487].
- * file.c (rb_stat_uid, rb_stat_gid, eaccess): use rb_uid_t and
- rb_gid_t instead of int.
+Sun Mar 4 23:38:07 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* file.c (rb_stat_s_utime): fixed a commit miss for the platforms
where utimes() does not exist.
@@ -40407,21 +4851,21 @@ Sun Mar 4 14:46:56 2007 WATANABE Hirofumi <eban@ruby-lang.org>
* util.c (push_element): should return a int value.
-Sun Mar 4 01:01:25 2007 Akinori MUSHA <knu@iDaemons.org>
+Sun Mar 4 01:05:57 2007 Akinori MUSHA <knu@iDaemons.org>
* lib/set.rb (Set#^, Set#&): Correct documentation. Those methods
return sets, not arrays; noted by Oliver Frank Wittich <nietz AT
mangabrain.de>.
-Sat Mar 3 22:54:33 2007 Minero Aoki <aamine@loveruby.net>
+Sat Mar 3 23:01:07 2007 Minero Aoki <aamine@loveruby.net>
- * lib/fileutils.rb (touch): last #touch change causes error when
- :mtime option was not given.
+ * lib/fileutils.rb (mv): could not move a directory between
+ different filesystems. [ruby-dev:30411]
-Sat Mar 3 22:51:29 2007 Minero Aoki <aamine@loveruby.net>
+Sat Mar 3 22:57:11 2007 Minero Aoki <aamine@loveruby.net>
- * lib/fileutils.rb (mv): could not move directory between
- different file systems. [ruby-dev:30411]
+ * lib/fileutils.rb (touch): last commit causes error if :mtime
+ option was not given.
Sat Mar 3 22:37:02 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
@@ -40430,26 +4874,39 @@ Sat Mar 3 22:37:02 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/fileutils.rb (touch): ditto, and added :mtime and :nocreate
options. fixed: [ruby-talk:219037]
-Sat Mar 3 15:52:26 2007 Akinori MUSHA <knu@iDaemons.org>
+Sat Mar 3 21:17:35 2007 Akinori MUSHA <knu@iDaemons.org>
+
+ * eval.c (stack_check): Unset inline to fix build with GCC 3.4.6;
+ submitted by: NISHIMATSU Takeshi <t_nissie AT yahoo.co.jp> in
+ [ruby-list:43218].
+ cf. http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24556
- * object.c (instance_variable_get): Restore rdoc markups lost in
- the last commit.
+Sat Mar 3 19:05:31 2007 Akinori MUSHA <knu@iDaemons.org>
-Fri Mar 2 21:17:14 2007 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+ * ext/thread/thread.c (push_list): Use ALLOC().
- * ext/win32ole/win32ole.c (get_ptr_of_variant, ole_set_safe_array,
- ole_val2ptr_variant, ole_val2olevariantdata, ole_variant2val,
- ): fix some bugs of WIN32OLE_VARIANT.new when variant type is
- VT_ARRAY|VT_BSTR or VT_BYREF.
+ * ext/thread/thread.c (rb_mutex_alloc): Ditto.
- * ext/win32ole/win32ole.c (folevariant_s_array, folevariant_initialize):
- WIN32OLE_VARIANT#[], WIN32OLE_VARIANT#[]=, WIN32OLE_VARIANT#value=
- is defined as instance method of WIN32OLE_VARIANT.
+ * ext/thread/thread.c (rb_condvar_alloc): Ditto.
- * test/win32ole/test_win32ole_variant.rb: add some test for
- VT_ARRAY, VT_BYREF variant type.
+Sat Mar 3 18:53:11 2007 Akinori MUSHA <knu@iDaemons.org>
-Fri Mar 2 07:58:24 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * NEWS: Add a note for String#intern.
+
+Sat Mar 3 16:23:13 2007 Akinori MUSHA <knu@iDaemons.org>
+
+ * env.h (SCOPE_CLONE): Introduce a new scope flag to prevent a
+ local_tbl region from getting freed many times; submitted by
+ Chikanaga Tomoyuki <chikanag AT nippon-control-system.co.jp> in
+ [ruby-dev:30460].
+
+ * eval.c (proc_invoke): Ditto.
+
+ * gc.c (obj_free): Ditto.
+
+ * parse.y (top_local_setup_gen): Ditto.
+
+Sat Mar 3 16:07:02 2007 Akinori MUSHA <knu@iDaemons.org>
* object.c (rb_obj_ivar_set): RDoc updated according to a
suggestion from Brian Candler <B.Candler AT pobox.com>.
@@ -40460,7 +4917,14 @@ Thu Mar 1 21:38:07 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* parse.y (stmt, arg): should not omit lhs of OP_ASGN1 even if
empty. [ruby-dev:30455]
-Thu Mar 1 02:55:25 2007 Akinori MUSHA <knu@iDaemons.org>
+Thu Mar 1 08:55:38 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * eval.c (rb_feature_p): check loading_tbl if the given ext is
+ empty. [ruby-dev:30452]
+
+ * eval.c (rb_feature_p): fix possible buffer overrun.
+
+Thu Mar 1 03:30:21 2007 Akinori MUSHA <knu@iDaemons.org>
* ext/digest/digest.c (get_digest_base_metadata): Allow inheriting
Digest::Base subclasses, which was unintentionally made
@@ -40470,6 +4934,11 @@ Thu Mar 1 02:05:17 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* mkconfig.rb (patchlevel): read from version.h.
+Thu Mar 1 00:09:39 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * eval.c (rb_provided): return true only for features loaded from
+ .rb files, and not search actual library type. [ruby-dev:30414]
+
Wed Feb 28 21:15:00 2007 WATANABE Hirofumi <eban@ruby-lang.org>
* configure.in (ac_cv_func_fcntl): fcntl support for MinGW.
@@ -40482,31 +4951,29 @@ Wed Feb 28 20:51:32 2007 URABE Shyouhei <shyouhei@ruby-lang.org>
UTF-8 encoded BOMs; submitted by SOUMA Yutaka <holon@radastery.jp>
to fix [ruby-core:10437]
-Wed Feb 28 18:31:51 2007 NAKAMURA Usaku <usa@ruby-lang.org>
+Wed Feb 28 18:59:57 2007 Akinori MUSHA <knu@iDaemons.org>
+
+ * NEWS: Add NEWS, a document file to keep user visible feature
+ changes between releases.
+
+Wed Feb 28 18:35:50 2007 NAKAMURA Usaku <usa@ruby-lang.org>
* ext/openssl/extconf.rb: no need to check unistd.h and sys/time.h.
they are already checked at configure.
reported by KOBAYASHI Yasuhiro [ruby-list:43225]
-Wed Feb 28 18:23:43 2007 NAKAMURA Usaku <usa@ruby-lang.org>
+Wed Feb 28 18:34:48 2007 NAKAMURA Usaku <usa@ruby-lang.org>
* lib/mkmf.rb ($DEFLIBPATH): default library paths ($(topdir), etc)
should be the first elements of library paths list.
reported by KOBAYASHI Yasuhiro [ruby-list:43225]
-Wed Feb 28 10:33:58 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * Makefile.in, configure.in, */Makefile.sub (THREAD_MODEL): system
- specific thread model.
-
- * compile.h, regint.h, vm.h, array.c: removed unnecessary #include.
-
-Wed Feb 28 04:03:03 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
+Wed Feb 28 18:31:32 2007 Akinori MUSHA <knu@iDaemons.org>
- * enum.c (take_i): small cosmetic / documentation patch from
- Tadashi Saito <shiba AT mail2.accsnet.ne.jp>. [ruby-dev:30446]
+ * doc/NEWS-1.8.0: Rename NEWS to NEWS-1.8.0. This is way too old
+ NEWS.
-Wed Feb 28 01:20:18 2007 NAKAMURA Usaku <usa@ruby-lang.org>
+Wed Feb 28 01:22:58 2007 NAKAMURA Usaku <usa@ruby-lang.org>
* test/{dbm,gdbm}/test_{dbm,gdbm}.rb: shouldn't use host_os. use
target_os instead. reported by KOBAYASHI Yasuhiro [ruby-list:43225]
@@ -40521,7 +4988,7 @@ Wed Feb 28 00:08:11 2007 URABE Shyouhei <shyouhei@ice.uec.ac.jp>
Tue Feb 27 22:18:45 2007 WATANABE Hirofumi <eban@ruby-lang.org>
- * configure.in (--enable-auto-image-base): avoid the necessity to
+ * configure.in (--enable-auto-image-base): avoid the neccessity to
rebase the shared libs as much as possible;
submitted by Corinna Vinschen <spam at vinschen.de> in
[ruby-talk:240964].
@@ -40534,27 +5001,19 @@ Tue Feb 27 21:33:04 2007 WATANABE Hirofumi <eban@ruby-lang.org>
* configure.in (ac_cv_func_setrlimit): workaround for djgpp.
-Tue Feb 27 20:35:28 2007 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * common.mk (error.c, process.c): depend on yarvcore.h and rubysig.h.
-
-Tue Feb 27 19:26:31 2007 Akinori MUSHA <knu@iDaemons.org>
-
- * ext/nkf/nkf.c (rb_str_resize, rb_nkf_kconv, rb_nkf_guess1,
- rb_nkf_guess2): Silence warnings regarding char * vs. unsigned
- char * mismatch; submitted by Lyle Johnson
- <lyle.johnson@gmail.com> in [ruby-core:10416].
-
-Tue Feb 27 19:15:01 2007 Akinori MUSHA <knu@iDaemons.org>
+Tue Feb 27 19:38:52 2007 Akinori MUSHA <knu@iDaemons.org>
* lib/base64.rb (Base64::b64encode): Fix documentation; submitted
by David Symonds <dsymonds@gmail.com> in [ruby-core:10432].
-Tue Feb 27 18:59:42 2007 Akinori MUSHA <knu@iDaemons.org>
+Tue Feb 27 19:36:57 2007 Akinori MUSHA <knu@iDaemons.org>
- * ext/bigdecimal/bigdecimal.c (BigDecimal_load): Silence warnings
- regarding char * vs. unsigned char * mismatch; submitted by Lyle
- Johnson <lyle.johnson@gmail.com> in [ruby-core:10416].
+ * regex.c (calculate_must_string, slow_search, re_search): Silence
+ warnings regarding char * vs. unsigned char * mismatch;
+ submitted by Lyle Johnson <lyle.johnson@gmail.com>
+ in [ruby-core:10416].
+
+ * ext/bigdecimal/bigdecimal.c (BigDecimal_load): Ditto.
* ext/digest/sha1/sha1ossl.c (SHA1_Finish): Ditto.
@@ -40563,321 +5022,65 @@ Tue Feb 27 18:59:42 2007 Akinori MUSHA <knu@iDaemons.org>
* ext/digest/digest.c (rb_digest_base_finish,
rb_digest_base_update): Ditto.
-Tue Feb 27 18:12:05 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * enum.c (enum_take): new method. [ruby-dev:30407]
-
- * enum.c (enum_drop): ditto.
-
-Tue Feb 27 07:47:24 2007 Koichi Sasada <ko1@atdot.net>
-
- * yarvcore.h, vm.h: rename th_invoke_yield() to th_yield().
-
- * blockinlining.c: ditto.
-
- * eval.c: ditto.
-
- * vm.c, insns.def: rename th_invoke_yield_cfunc()
- to th_yield_with_cfunc().
-
- * yarvcore.h, yarvcore.c: rename theYarvVM to ruby_current_vm and
- yarvCurrentThread to ruby_current_thread. remove yarvVMArray.
-
-Tue Feb 27 00:45:23 2007 Minero Aoki <aamine@loveruby.net>
-
- * test/ruby/test_optimization.rb: restore method before calling
- assert_equal.
-
-Mon Feb 26 00:58:39 2007 Koichi Sasada <ko1@atdot.net>
-
- * yarvcore.h: add rb_thread_t#top_wrapper, top_self.
-
- * eval_load.c (rb_load): support eval in wrapper module
- (load(file, true)).
-
- * eval.c: ditto.
-
- * eval_jump.h: ditto.
-
- * iseq.c: ditto.
-
- * vm.c: ditto.
-
- * yarvcore.c: ditto.
-
- * insns.def: add a empty line.
-
-Mon Feb 26 00:54:36 2007 Koichi Sasada <ko1@atdot.net>
-
- * common.mk: change "gdb" rule. You can debug miniruby with
- $(srcdir)/test.rb on gdb by this rule (type "make gdb").
- If you write break points to "breakpoints.gdb" on $srcdir,
- gdb runs with this file.
-
-Sun Feb 25 11:46:58 2007 Koichi Sasada <ko1@atdot.net>
-
- * win32/Makefile.sub: enable -Zi (debug) option.
-
-Sun Feb 25 11:38:40 2007 Koichi Sasada <ko1@atdot.net>
-
- * ruby.h: define RUBY_VM macro and remove NATIVETHREAD* macros.
-
- * intern.h: ditto.
-
- * signal.c (posix_signal): remove unused function
- posix_nativethread_signal().
-
-Sun Feb 25 11:31:13 2007 Koichi Sasada <ko1@atdot.net>
-
- * thread.c (rb_thread_run): fix to ANSI style.
-
-Sun Feb 25 11:09:16 2007 Minero Aoki <aamine@loveruby.net>
-
- * bootstraptest/runner.rb: show source code in error message.
-
-Sun Feb 25 09:39:50 2007 Koichi Sasada <ko1@atdot.net>
-
- * yarvcore.h:
- rename:
- rb_iseq_t#file_name -> filename
- rb_iseq_t#local_tbl -> local_table
- add:
- rb_iseq_t#local_table_size
-
- * compile.c: separate local_table_size and local_size
- (local variable size)
-
- * blockinlining.c: apply above rename.
-
- * compile.h: ditto.
-
- * eval.c: ditto.
-
- * iseq.c: ditto.
-
- * proc.c: ditto.
-
- * vm.c: ditto.
-
- * vm_dump.c: ditto.
-
-Sun Feb 25 10:27:17 2007 Minero Aoki <aamine@loveruby.net>
-
- * bootstraptest/runner.rb: add lib/ to load path.
-
-Sat Feb 25 10:16:50 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * rubyio.h (HAVE_RB_IO_T): macro to tell if rb_io_t is defined.
-
-Sat Feb 24 19:39:16 2007 Minero Aoki <aamine@loveruby.net>
-
- * common.mk: new target "btest", to run bootstraptests.
-
-Sat Feb 24 19:30:40 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * file.c, gc.c, io.c, ruby.h, rubyio.h, win32/win32.h (rb_io_t):
- renamed from OpenFile.
-
- * ext/dl/cptr.c, ext/io/wait/wait.c, ext/openssl/ossl.h,
- ext/openssl/ossl_bio.c, ext/openssl/ossl_ssl.c, ext/pty/pty.c,
- ext/readline/readline.c, ext/socket/socket.c: ditto.
-
-Sat Feb 24 19:28:23 2007 Minero Aoki <aamine@loveruby.net>
-
- * bootstraptest/runner.rb: new option -v,--verbose.
-
-Sat Feb 24 18:55:50 2007 Minero Aoki <aamine@loveruby.net>
-
- * yarvtest/test_method.rb: removed (merged to bootstraptest).
-
- * yarvtest/test_class.rb: ditto.
-
-Sat Feb 24 18:44:39 2007 Minero Aoki <aamine@loveruby.net>
-
- * bootstraptest/test_class.rb: new file.
-
- * bootstraptest/test_method.rb: add tests.
-
-Sat Feb 24 18:44:30 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * intern.h (rb_thread_blocking_region): add prototype.
-
- * file.c (rb_thread_flock, rb_file_flock): use UBF feature.
-
- * process.c (rb_waitpid_blocking, rb_waitpid): use UBF feature.
-
- * thread.c (rb_thread_debug): added runtime debugging flag.
-
- * thread.c (BLOCKING_REGION): restore previous UBF.
-
- * thread.c (rb_thread_blocking_region): default UBF to interrupt
- in system dependent way by RB_UBF_DFL.
- + ubf_select() on posix system
- + ubf_handle() on Win32
- + none on cygwin
-
- * thread_win32.ci (rb_w32_wait_events_blocking): blocking version.
-
- * win32/win32.c (waitpid): use rb_w32_wait_events_blocking().
-
-Sat Feb 24 17:45:48 2007 Minero Aoki <aamine@loveruby.net>
-
- * parse.y (f_arg, opt_f_block_arg): ripper should export VALUE.
-
-Sat Feb 24 16:52:55 2007 Minero Aoki <aamine@loveruby.net>
-
- * bootstraptest/runner.rb: fix syntax error.
-
-Sat Feb 24 16:51:09 2007 Minero Aoki <aamine@loveruby.net>
-
- * bootstraptest/runner.rb: new option --help.
-
-Sat Feb 24 16:47:33 2007 Minero Aoki <aamine@loveruby.net>
-
- * bootstraptest: new test suite.
-
- * bootstraptest/runner.rb: new file.
-
- * bootstraptest/test_literal.rb: new file.
-
- * bootstraptest/test_method.rb: new file.
-
-Sat Feb 24 16:29:15 2007 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/win32.c (StartSocket): remove unnecessary code.
-
-Sat Feb 24 16:04:30 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * parse.y (struct local_vars): remove unused nofree member from
- struct.
-
- * parse.y (parser_free): ditto.
-
-Sat Feb 24 15:57:19 2007 Shugo Maeda <shugo@ruby-lang.org>
-
- * lib/thread.rb (ConditionVariable#broadcast): use Mutex
- instead of Thread.exclusive.
-
- * lib/monitor.rb (MonitorMixin#mon_exit): unset @mon_owner
- before calling Mutex#unlock.
-
-Sat Feb 24 15:51:45 2007 Minero Aoki <aamine@loveruby.net>
-
- * parse.y (program): remove useless assignment to reduce warning.
-
-Sat Feb 24 15:41:51 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * parse.y (lambda): remove unused clause from the rule to stop
- warning.
-
-Sat Feb 24 15:41:22 2007 Shugo Maeda <shugo@ruby-lang.org>
-
- * lib/thread.rb: do not redefine Mutex#synchronize.
-
-Sat Feb 24 15:14:02 2007 Shugo Maeda <shugo@ruby-lang.org>
-
- * lib/monitor.rb: rewritten using Mutex/ConditionVariable.
-
-Sat Feb 24 13:25:32 2007 Koichi Sasada <ko1@atdot.net>
-
- * lib/soap/mapping/factory.rb: catch up with spec changes (return
- Symbols instead of Strings).
-
- * lib/soap/mapping/mapping.rb: ditto.
-
-Sat Feb 24 10:49:55 2007 Koichi Sasada <ko1@atdot.net>
-
- * parse.y, node.h, compile.c: change node tree structure. a purpose
- of this change is to unify argument structure of method and block.
- this change prohibits duplicate block parameter name.
- new argument information:
- NODE_ARGS [m: int, o: NODE_OPT_ARG, ->]
- NODE_ARGS_AUX [r: ID, b: ID, ->]
- NODE_ARGS_AUX [Pst: id, Plen: int, init: NODE*]
- optarg information:
- NODE_OPT_ARGS [idx, expr, ->]
+ * ext/nkf/nkf.c (rb_str_resize, rb_nkf_kconv, rb_nkf_guess1,
+ rb_nkf_guess2): Ditto.
- * vm_macro.def: ditto.
+Tue Feb 27 03:40:09 2007 Akinori MUSHA <knu@iDaemons.org>
- * gc.c: ditto.
+ * ext/thread/thread.c (wait_list_cleanup, rb_mutex_try_lock):
+ Eliminate rb_thread_critical switching where unnecessary;
+ implied by shugo in [ruby-dev:30412].
- * iseq.c: ditto.
+ * ext/thread/thread.c (set_critical): Merge in
+ thread_exclusive_ensure().
- * compile.h: fix debug function name.
+ * ext/thread/thread.c: Consistently use 0 and 1 for
+ rb_thread_critical values.
- * test/ripper/test_scanner_events.rb: |_,_,foo| -> |_1,_2,foo|
+Mon Feb 26 15:18:23 2007 Akinori MUSHA <knu@iDaemons.org>
- * test/ruby/test_lambda.rb: disable test temporarily.
+ * ext/thread/thread.c: Use xmalloc()/xfree() instead of
+ malloc()/free(); pointed out by shugo in [ruby-dev:30412].
-Sat Feb 24 10:46:28 2007 Koichi Sasada <ko1@atdot.net>
+Sun Feb 25 23:02:55 2007 Akinori MUSHA <knu@iDaemons.org>
- * test/testunit/test_testcase.rb: catch up with current instance
- variable spec.
+ * lib/test/unit/autorunner.rb (Test::Unit::AutoRunner::initialize):
+ Initialize @workdir properly to silence a warning under -w.
+ Submitted by <tommy at tmtm.org> in [ruby-dev:30400].
-Sat Feb 24 10:32:59 2007 Koichi Sasada <ko1@atdot.net>
+Sun Feb 25 02:47:43 2007 Akinori MUSHA <knu@iDaemons.org>
- * common.mk: change vm_macro.def rule.
+ * defines.h: Pull the RUBY_MBCHAR_MAXSIZE definition from trunk,
+ which is necessary for dir.c to compile on djgpp and emx.
-Sat Feb 24 10:38:05 2007 Minero Aoki <aamine@loveruby.net>
+Sat Feb 24 10:42:01 2007 Minero Aoki <aamine@loveruby.net>
* ext/racc/cparse/cparse.c (cparse_params_mark): remove useless
rb_gc_mark. Thanks Tomoyuki Chikanaga. [ruby-dev:30405]
-Sat Feb 24 07:31:35 2007 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-
- * ext/win32ole/win32ole.c: add WIN32OLE_VARIANT.array,
- WIN32OLE_VARIANT#value=, refactoring.
-
- * test/win32ole/test_win32ole_variant.rb: add some test for
- WIN32OLE_VARIANT.array, WIN32OLE_VARIANT#value=.
-
-Fri Feb 23 18:37:55 2007 Minero Aoki <aamine@loveruby.net>
-
- * test/ruby/test_yield.rb: new test.
-
- * yarvtest/test_yield.rb: removed (moved to test_yield.rb).
-
-Fri Feb 23 18:27:17 2007 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * thread.c (rb_thread_polling): check interrupts here.
-
- * thread_win32.ci (w32_wait_events): rename from w32_wait_event(), and
- now receive multiple event handles.
+Fri Feb 23 15:10:46 2007 NAKAMURA Usaku <usa@ruby-lang.org>
- * win32/win32.c (wait_events, rb_w32_main_context): removed.
-
- * thread_win32.ci (rb_w32_wait_events): new function.
-
- * thread_win32.ci, win32/win32.c (rb_w32_sleep, rb_w32_Sleep): move
- from win32/win32.c to thread_win32.ci, and use w32_wait_events().
-
-Fri Feb 23 18:13:22 2007 Minero Aoki <aamine@loveruby.net>
-
- * test/ruby/test_optimization.rb: new test (merges test_opts.rb).
-
- * yarvtest/test_opts.rb: removed.
-
-Fri Feb 23 16:59:39 2007 Minero Aoki <aamine@loveruby.net>
-
- * test/ruby/test_assignment.rb: merge yarvtest/test_massign.
-
- * yarvtest/test_massign.rb: removed (merged to
- test_assignment.rb).
+ * win32/win32.c (set_pioinfo_extra): new function for VC++8 SP1
+ workaround. [ruby-core:10259]
-Fri Feb 23 15:58:20 2007 NAKAMURA Usaku <usa@ruby-lang.org>
+ * win32/win32.c (NtInitialize): call above function.
- * signal.c (sighandler): need to re-install sighandler on some
- platforms.
+Fri Feb 23 14:19:40 2007 NAKAMURA Usaku <usa@ruby-lang.org>
-Fri Feb 23 15:05:57 2007 NAKAMURA Usaku <usa@ruby-lang.org>
+ * signal.c (sighandler): need to tell to be interrupted to main
+ context when handler is installed.
- * win32/win32.c (set_pioinfo_extra): simplified.
+ * win32/win32.[ch] (rb_win32_interrupted): new function to listen
+ interrupt.
-Fri Feb 23 14:23:20 2007 Minero Aoki <aamine@loveruby.net>
+Fri Feb 23 13:02:17 2007 Akinori MUSHA <knu@iDaemons.org>
- * test/ruby/test_literal.rb: new test.
+ * numeric.c (fix_cmp, fix_equal): Remove FIX2LONG() to optimize.
+ suggested in
+ http://t-a-w.blogspot.com/2007/02/making-ruby-faster.html.
+ [ruby-talk:240223]
-Fri Feb 23 12:40:12 2007 James Edward Gray II <james@grayproductions.net>
+Fri Feb 23 12:43:17 2007 James Edward Gray II <james@grayproductions.net>
* lib/xmlrpc/client.rb (XMLRPC::Client::do_rpc): Make the
Content-Length parameter optional for responses in
@@ -40887,85 +5090,12 @@ Fri Feb 23 12:40:12 2007 James Edward Gray II <james@grayproductions.net>
* lib/xmlrpc/create.rb (XMLRPC::Create::conv2value): Add DateTime
support to xmlrpc; approved by the maintainer.
-Fri Feb 23 12:24:46 2007 Minero Aoki <aamine@loveruby.net>
-
- * parse.y (lambda): add ripper event. This fixes bus error on
- "make test-all".
-
- * ext/ripper/extconf.rb: do not stop build.
-
-Fri Feb 23 12:16:05 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * parse.y: remove dyna_check_gen() prototype.
-
-Fri Feb 23 11:41:21 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * parse.y, compile.c, gc.c, insns.def, intern.h, iseq.c, node.h,
- object.c, string.c, variable.c, vm_macro.def: revert private
- instance variable feature, which is postponed until next major
- release.
-
- * marshal.c: TYPE_SYMBOL2 removed; MARSHAL_MINOR reverted back to
- 8th version.
-
-Fri Feb 23 10:53:21 2007 Shugo Maeda <shugo@ruby-lang.org>
-
- * thread_pthread.ci (native_mutex_lock): do not call
- pthread_mutex_trylock().
-
-Fri Feb 23 10:31:16 2007 Minero Aoki <aamine@loveruby.net>
-
- * dln.c: use dlopen on Mac OS X 10.3 or later.
-
-Fri Feb 23 10:03:49 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * string.c (rb_str_ord): need not to check string length; ord
- returns a codepoint for the first character in the string.
-
-Wed Feb 21 22:29:45 2007 Akinori MUSHA <knu@iDaemons.org>
-
- * numeric.c (fix_equal): A bit more optimization.
-
-Wed Feb 21 17:40:37 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * numeric.c (fix_equal): remove FIX2LONG() to optimize. suggested
- in http://t-a-w.blogspot.com/2007/02/making-ruby-faster.html.
- [ruby-talk:240223]
-
- * numeric.c (fix_cmp): ditto.
+Mon Feb 19 18:22:52 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Feb 21 09:14:04 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval_load.c (rb_require_safe): should restore safe level.
-
-Tue Feb 20 21:19:29 2007 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-
- * ext/win32ole/win32ole.c (installed_code_page_proc,
- ole_variant2val): small refactoring.
-
-Tue Feb 20 15:11:42 2007 Koichi Sasada <ko1@atdot.net>
-
- * eval.c, vm.c, yarvcore.h: move definition of rb_call_super() to
- vm.c from eval.c. change th_call_super() to static function.
-
-Tue Feb 20 15:08:25 2007 Koichi Sasada <ko1@atdot.net>
-
- * test/io/nonblock/test_flush.rb: YARV doesn't raise any errors if
- another thread close IO object which current thread is blocking with.
-
-Tue Feb 20 15:03:29 2007 Koichi Sasada <ko1@atdot.net>
-
- * thread.c (do_select, rb_thread_wait_fd_rw): raise sys error if
- errno is not 0 and EBADF.
-
-Mon Feb 19 22:15:31 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in (RUBY_REPLACE_TYPE): cache convertible type info.
-
- * intern.h (rb_detach_process): use rb_pid_t instead of pid_t.
-
- * ruby.h (PIDT2NUM, NUM2PIDT, UIDT2NUM, NUM2UIDT, GIDT2NUM, NUM2GIDT):
- defaulted to conversion using long.
+ * configure.in, defines.h, eval.c (rb_feature_p, rb_provided,
+ load_wait, search_required, rb_require_safe), ext/extmk.rb: Fix
+ a bug where a statically linked extension cannot be autoloaded.
+ [ruby-dev:30023] / [ruby-dev:30239]
Mon Feb 19 17:14:28 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
@@ -40973,45 +5103,10 @@ Mon Feb 19 17:14:28 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
message for #peeraddr. a patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:10366]
-Sun Feb 18 22:56:07 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/etc/etc.c (etc_getgrgid): missed to replace a macro.
-
-Sun Feb 18 19:33:00 2007 Tadayoshi Funaba <tadf@dotrb.org>
+Sun Feb 18 19:35:21 2007 Tadayoshi Funaba <tadf@dotrb.org>
* lib/date/format.rb: updated based on date2 4.0.3.
-Sun Feb 18 13:11:51 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in (pid_t, uid_t, gid_t): check if defined.
-
- * intern.h, process.c, rubyio.h, ext/etc/etc.c, ext/pty/pty.c: use
- rb_{pid,uid,gid}_t instead of plain int. [ruby-dev:30376]
-
- * ext/etc/extconf.rb (PIDT2NUM, NUM2PIDT, UIDT2NUM, NUM2UIDT, GIDT2NUM,
- NUM2GIDT): moved to configure.in.
-
-Fri Feb 16 21:34:33 2007 Koichi Sasada <ko1@atdot.net>
-
- * object.c (rb_obj_ivar_set/get/defined): fix to check :@_v/C id.
-
- * test/testunit/test_testcase.rb: fix to use instance_variable_get()
- to access @_result.
-
-Fri Feb 16 20:59:10 2007 Koichi Sasada <ko1@atdot.net>
-
- * intern.h: add a prototype of rb_sym_to_s().
-
-Fri Feb 16 19:24:22 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * math.c (math_log): update document to mention second optional
- argument for logarithm base.
-
-Fri Feb 16 19:19:21 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * parse.y (mrhs): need to append by arg_append().
- [ruby-talk:239385]
-
Fri Feb 16 11:18:21 2007 Eric Hodel <drbrain@segment7.net>
* lib/.document: Apply patch for irb, e2mmap and README by Hugh Sasse
@@ -41019,108 +5114,35 @@ Fri Feb 16 11:18:21 2007 Eric Hodel <drbrain@segment7.net>
* lib/prettyprint.rb: Suppress RDoc for PrettyPrint test suite.
-Thu Feb 15 20:48:36 2007 NAKAMURA Usaku <usa@ruby-lang.org>
+Thu Feb 15 20:26:30 2007 Akinori MUSHA <knu@iDaemons.org>
- * win32/win32.c (set_pioinfo_extra): new function for VC++8 SP1
- workaround. [ruby-core:10259]
+ * lib/uri/ftp.rb: Revert the previous change pending discussion.
- * win32/win32.c (NtInitialize): call above function.
+Thu Feb 15 18:08:17 2007 Akinori MUSHA <knu@iDaemons.org>
+
+ * dir.c (glob_helper): Fix the function declaration.
+
+Thu Feb 15 17:13:32 2007 Akinori MUSHA <knu@iDaemons.org>
+
+ * version.h: Welcome to the post-1.8.6 world. Radical changes are
+ inhibited in the ruby_1_8 branch until the 1.8.6 final release
+ goes out of the door.
-Thu Feb 15 16:25:54 2007 Akinori MUSHA <knu@iDaemons.org>
+Thu Feb 15 16:44:14 2007 Akinori MUSHA <knu@iDaemons.org>
* lib/uri/generic.rb (URI::Generic::userinfo): Considering how
`scheme://user:@...', `scheme://:password@...' and
`scheme://:@...' are parsed, an empty user name or password
should be allowed and represented as it is.
-Thu Feb 15 01:52:53 2007 Koichi Sasada <ko1@atdot.net>
-
- * vm.(c|h), yarvcore.(c|h) (yarvGlobalStateVersion): rename to
- ruby_vm_global_state_version.
-
-Thu Feb 15 01:50:26 2007 Koichi Sasada <ko1@atdot.net>
-
- * test/fileutils/test_fileutils.rb (check_singleton): fix to use
- symbol instead of string.
-
- * test/io/nonblock/test_flush.rb: enable tests.
-
- * test/xmlrpc/test_webrick_server.rb: ditto.
+Thu Feb 15 11:46:05 2007 KIMURA Koichi <hogemuta@gmail.com>
-Thu Feb 15 01:43:45 2007 Koichi Sasada <ko1@atdot.net>
+ * dir.c, win32/win32.c, win32/dir.h, ruby.h, intern.h: Bring
+ encoding aware globbing support in from trunk. Dir.[] and
+ Dir.glob() can now take many patterns in an array. Minor fixes
+ will follow.
- * lib/delegate.rb: catch up with class local variable (@_v) spec.
-
- * lib/singleton.rb: ditto.
-
-Wed Feb 14 22:52:43 2007 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-
- * ext/win32ole/win32ole.c (ole_variant2val): VC++6 does not
- support VT_I8, VT_UI8.
-
-Wed Feb 14 22:10:21 2007 Koichi Sasada <ko1@atdot.net>
-
- * configure.in: change stack limit to 2MB from 32MB.
-
- * win32/Makefile.sub: ditto.
-
-Wed Feb 14 21:39:36 2007 Akinori MUSHA <knu@iDaemons.org>
-
- * ext/digest/lib/digest.rb (Digest::self.const_missing): Drop
- autoloads for sha2 classes in favor of handling in
- const_missing(), to work around a problem exposed on OS X.
-
-Wed Feb 14 21:19:47 2007 Koichi Sasada <ko1@atdot.net>
-
- * thread_pthread.ci (native_thread_create): adjust 4KB (page size)
- alignment.
-
-Wed Feb 14 21:12:36 2007 Koichi Sasada <ko1@atdot.net>
-
- * thread_pthread.ci (CHECK_ERR): call rb_bug()
- instead of printf() and exit().
-
-Wed Feb 14 16:48:56 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/date/format.rb (Date::Format::Bag::method_missing): need not
- to use instance variables corresponding each method; use Hash
- instead.
-
-Wed Feb 14 13:12:06 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * re.c (reg_operand): allow symbols to be operands for regular
- expression matches.
-
- * string.c (Init_String): allow Symbol#===.
-
- * lib/date/format.rb (Date::Format::Bag::to_hash): string
- added prefixes.
-
-Wed Feb 14 12:58:38 2007 Koichi Sasada <ko1@atdot.net>
-
- * thread.c (do_select): fix to iterate select().
- on cygwin/mswin32, iterate in unblocking region.
-
- * thread.c (rb_thread_select): don't iterate on this function.
- (iterate in do_select).
-
-Wed Feb 14 11:39:18 2007 Koichi Sasada <ko1@atdot.net>
-
- * thread.c (set_unblock_function): fix function interface.
-
-Wed Feb 14 11:12:02 2007 Koichi Sasada <ko1@atdot.net>
-
- * eval_load.c, yarvcore.h: use rb_vm_t#loaded_features instead of
- rb_features (global variable).
-
- * yarvcore.c: mark rb_vm_t#loaded_features.
-
-Wed Feb 14 08:46:25 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * compile.c (defined_expr): no longer distinguish ordinary local
- variables and in-block local variables in defined? value.
-
-Wed Feb 14 03:14:42 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
+Thu Feb 15 11:00:26 2007 Akinori MUSHA <knu@iDaemons.org>
* lib/uri/generic.rb (URI::Generic::userinfo): should support
empty password. [ruby-core:10290]
@@ -41128,644 +5150,147 @@ Wed Feb 14 03:14:42 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
* lib/uri/generic.rb (URI::Generic::set_password): password can be
cleared by nil. [ruby-core:10290]
-Wed Feb 14 03:10:33 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * lib/uri/common.rb (escape): regard second string argument as a
+ character set properly. [ruby-dev:27692]
- * parse.y (struct local_vars): no need to warn out-of-scope
- variables; remove dnames member from struct.
+ * lib/uri/ftp.rb: Attempt to conform to RFC 1738 with regard to
+ relative/absolute paths.
-Wed Feb 14 03:04:10 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * lib/uri: Lovely RDOC patches from mathew (metaATpoboxDOTcom).
- * parse.y: RVarmap no longer used as yytype; removed.
+Thu Feb 15 10:57:38 2007 Tietew <tietew@tietew.net>>
- * parse.y (dyna_push_gen): no longer need return value.
+ * lib/cgi.rb (CGI::unescapeHTML): invalid decoding for single
+ unescaped ampersand. a patch from Tietew
+ <tietew+ruby-dev at tietew.net> in [ruby-dev:30292].
+ fixed: [ruby-dev:30289]
- * parse.y (dyna_pop_gen): no longer need argument.
+Thu Feb 15 10:48:40 2007 MenTaLguY <mental@rydia.net>
- * parse.y (local_push_gen): initialize nofree.
+ * ext/thread/thread.c: Handle interrupted waits correctly.
+ [ruby-bugs:PR#8663]
-Wed Feb 14 00:30:07 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
+Wed Feb 14 19:22:15 2007 Akinori MUSHA <knu@iDaemons.org>
- * ext/socket/socket.c (init_unixsock): path may contain NUL for
- abstract unix sockets. [ruby-core:10288]
+ * ext/digest/lib/digest.rb (Digest::self.const_missing): Drop
+ autoloads for sha2 classes in favor of handling in
+ const_missing(), to work around a problem exposed on OS X.
Tue Feb 13 02:21:12 2007 Sam Roberts <sroberts@uniserve.com>
* io.c (rb_f_syscall): Fix buffer overflow with syscall
arguments. [ruby-bugs:PR#8541]
-Mon Feb 12 13:57:30 2007 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-
- * ext/win32ole/win32ole.c (ole_variant2val): support VT_I8, VT_UI8.
-
-Mon Feb 12 11:48:52 2007 Kouhei Sutou <kou@cozmixng.org>
+Sun Feb 11 07:46:45 2007 Akinori MUSHA <knu@iDaemons.org>
- * lib/rss/dublincore.rb, lib/rss/maker/dublincore.rb: dc_rightses
- -> dc_rights_list. dc_rightses still exists for backward
- compatibility. [ruby-core:8350]
-
- * test/rss/test_maker_dc.rb: added tests for dc_rights_list.
+ * lib/cgi.rb (CGI::QueryExtension::read_multipart): Properly parse
+ a quoted-string in a Content-Disposition value.
-Sun Feb 11 22:40:17 2007 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+Sun Feb 11 06:27:54 2007 Akinori MUSHA <knu@iDaemons.org>
- * ext/win32ole/win32ole.c (ole_ptrtype2val): ole_type, ole_type_detail
- should not return "VARIANT,VARIANT".
+ * configure.in, ext/thread/extconf.rb, lib/thread.rb: Add a
+ configure option `--disable-fastthread', to choose the original,
+ pure ruby version of the "thread" library instead of the new,
+ much faster implementation in ext/thread.
-Sun Feb 11 22:11:05 2007 Kouhei Sutou <kou@cozmixng.org>
+Sun Feb 11 06:22:20 2007 Akinori MUSHA <knu@iDaemons.org>
- * lib/rss/xml-stylesheet.rb (RSS::XMLStyleSheet#initialize):
- kept backward compatibility.
+ * ext/Setup: Add thread except for platforms without threads
+ support.
-Sun Feb 11 22:10:08 2007 Kouhei Sutou <kou@cozmixng.org>
+Sun Feb 11 06:15:16 2007 Akinori MUSHA <knu@iDaemons.org>
- * lib/rss/parser.rb (RSS::ListenerMixin#start_else_element): used
- const_defined? instead of constants.include?.
+ * ext/thread/lib/thread.rb: Add a replacement of thread.rb that
+ loads this extension.
-Sun Feb 11 18:47:14 2007 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+Sun Feb 11 05:39:47 2007 Akinori MUSHA <knu@iDaemons.org>
- * ext/win32ole/win32ole.c (ole_val2olevariantdata):
- WIN32OLE_VARIANT#new accepts nil when variant type is VT_ARRAY.
+ * lib/thread.rb: Remove an ineffective part of the code.
- * test/win32ole/test_win32ole_variant.rb: ditto.
+Sun Feb 11 05:32:54 2007 Akinori MUSHA <knu@iDaemons.org>
- * ext/win32ole/win32ole.c: small refactoring.
+ * ext/thread/thread.c (rb_thread_exclusive): Implement
+ Thread.exclusive.
-Sun Feb 11 07:42:25 2007 Akinori MUSHA <knu@iDaemons.org>
+Sun Feb 11 05:26:51 2007 Akinori MUSHA <knu@iDaemons.org>
- * lib/cgi.rb (CGI::QueryExtension::read_multipart): Properly parse
- a quoted-string in a Content-Disposition value.
+ * ext/thread/thread.c: Get rid of use of a dummy function.
-Sat Feb 10 20:21:29 2007 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+Sun Feb 11 01:45:31 2007 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
- * ext/win32ole/win32ole.c: add WIN32OLE#ole_query_interface.
- thanks to Mikael Pahmp.
+ * ext/thread/thread.c (Init_thread): Define missing aliases:
+ Queue#enq and SizedQueue#enq.
- * test/win32ole/test_win32ole.rb: ditto.
+Sat Feb 10 09:27:35 2007 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-Sat Feb 10 17:46:52 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/win32ole/win32ole.c (ole_variant2val): fix compile error
+ on VC++.
- * common.mk: targets which depend on yarvcore.h now depend on
- rubysig.h too.
+Sat Feb 10 07:41:52 2007 Masaki Suketa <masaki.suketa@nifty.ne.jp>
- * yarvcore.h (rb_vm_t): use rb_atomic_t instead of int.
+ * ext/win32ole/win32ole.c (ole_variant2val): fix the bug when
+ SAFEARRAY pointer is NULL.
Sat Feb 10 00:13:11 2007 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tk/lib/tk.rb: fix typo (TkConfigMethod::__confinfo_cmd,
__conv_keyonly_opts).
-Fri Feb 9 12:33:40 2007 Koichi Sasada <ko1@atdot.net>
-
- * thread_win32.ci (w32_show_error_message): renamed to w32_error.
- this function do rb_bug().
-
- * thread_win32.ci (w32_set_event, w32_reset_event, w32_close_handle,
- w32_resume_thread): added. fix to use these functions instead calling
- win32api directly.
-
- * thread_win32.ci (w32_create_thread): create suspend thread
- (caller must call w32_resume_thread()).
-
-Fri Feb 9 11:03:40 2007 Koichi Sasada <ko1@atdot.net>
-
- * test/ruby/test_readpartial.rb: tests are working on mswin32/cygwin.
-
-Fri Feb 9 05:08:17 2007 Koichi Sasada <ko1@atdot.net>
-
- * thread.c, thread_pthread.ci, thread_win32.ci (thread_start_func_1):
- move cleanup function to thread_start_func_2().
-
- * thread.c, thread_pthread.ci, thread_win32.ci:
- add more destruct functions.
- (native_thread_destroy() and native_mutex_destroy())
-
- * thread_pthread.ci, thread_pthread.h: make native_mutex_* functions
- (check error, etc), it's not macro any more.
-
- * thread_win32.ci (thread_start_func_1): store some values before
- running thread (to release these after running thread).
-
- * thread_win32.ci (native_thread_create): fix spaces.
-
-Thu Feb 8 22:44:04 2007 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-
- * ext/win32ole/win32ole.c (ole_set_safe_array, ole_variant2val,
- ole_val_ary2variant_ary): fix WIN32OLE_VARIANT.new bug when
- 1st argument is empty array, and when 2nd argument is
- VT_ARRAY|VT_BYREF.
-
- * test/win32ole/test_win32ole_variant.rb: ditto.
-
-Thu Feb 8 22:39:09 2007 Koichi Sasada <ko1@atdot.net>
-
- * yarvtest/yarvtest.rb: check target command names.
-
-Thu Feb 8 22:31:45 2007 Koichi Sasada <ko1@atdot.net>
-
- * test/ruby/test_clone.rb: fix to current spec
- (Module should not be occur many times in ancestors).
-
-Thu Feb 8 22:26:14 2007 Koichi Sasada <ko1@atdot.net>
-
- * test/ruby/test_string.rb: ("foo" == :foo) and ("foo" === :foo)
- should be false.
-
- * ChangeLog: fix last messages.
-
-Thu Feb 8 22:24:06 2007 Koichi Sasada <ko1@atdot.net>
-
- * test/ruby/test_module.rb: fix to use Symbol instead of String.
-
- * test/ruby/test_module.rb: remove space before argument parentheses.
-
-Thu Feb 8 22:02:14 2007 Koichi Sasada <ko1@atdot.net>
-
- * test/ruby/marshaltestlib.rb: eval(sym) -> eval(sym.to_s)
-
-Thu Feb 8 21:35:16 2007 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-
- * test/win32ole/test_propertyputref.rb (setup): fix typo.
-
- * test/win32ole/test_win32ole_event.rb: should not use
- InternetExplorer.gohome to test.
-
-Thu Feb 8 21:02:07 2007 Koichi Sasada <ko1@atdot.net>
-
- * thread.c (GVL_UNLOCK_RANGE): rename to BLOCKING_REGION().
-
- * thread.c (rb_thread_run_parallel): rename to
- rb_thread_blocking_region().
-
-Thu Feb 8 15:48:44 2007 Koichi Sasada <ko1@atdot.net>
-
- * yarvcore.h, thread.c: fix to use pthread on cygwin.
-
- * yarvcore.h, thread.c: move GVL_UNLOCK_BEGIN() and GVL_UNLOCK_END()
- from yarvcore.h to thread.c.
-
- * thread.c: change GVL_UNLOCK_RANGE() arguments
- (adding ubf as 2nd argument).
+Fri Feb 9 20:44:53 2007 Akinori MUSHA <knu@iDaemons.org>
- * thread.c: fix to use polling in select on cygwin and mswin32.
+ * ext/thread: Make style fixes (mostly de-K&R'ism) to match the
+ rest of the source code.
- * thread.c, thread_pthread.ci, thread_win32.ci, yarvcore.h:
- rename:
- * rb_thread_t#interrupt_function -> unblock_function
- * rb_interrupt_function_t -> rb_unblock_function
- * some interrupt function name -> ubf_*
- * yarv_* -> *
+ * ext/thread: Make USE_MEM_POOLS an extconf option.
-Thu Feb 8 16:08:02 2007 Koichi Sasada <ko1@atdot.net>
+Fri Feb 9 20:43:01 2007 Akinori MUSHA <knu@iDaemons.org>
- * common.mk: fix to use RUNRUBY instead of BASERUBY if possible.
+ * ext/thread: Import the "fastthread" implementation by MenTaLguY
+ in the original form. This module is not hooked into the build
+ yet since it needs some style fixes and adjustments.
- * common.mk ($(INSNS) rule): remove $(PROGRAM) first.
+Fri Feb 9 15:46:09 2007 Akinori MUSHA <knu@iDaemons.org>
-Thu Feb 8 15:43:05 2007 Koichi Sasada <ko1@atdot.net>
+ * ext/bigdecimal: Synchronize with trunk. Better function
+ prototypes, removal of a useless method `!=', and document
+ updates.
- * process.c: fix to use rb_status_line_set/get/clear().
-
- * eval_intern.h: fix line break.
-
-Thu Feb 8 15:00:14 2007 Koichi Sasada <ko1@atdot.net>
-
- * blockinlining.c, error.c, eval.c, eval_error.h, eval_intern.h,
- eval_jump.h, eval_load.c, eval_safe.h, gc.c, proc.c, signal.c,
- thread.c, thread_pthread.ci, thread_win32.ci, vm.c, vm.h,
- vm_dump.c, vm_evalbody.ci, yarvcore.c, yarvcore.h:
- fix typo (rb_thead_t -> rb_thread_t).
-
- * eval_intern.h: remove unused definitions.
-
- * common.mk: fix around vm_opts.h path
- and remove harmful argument passed to insns2vm.rb.
-
-Thu Feb 8 03:11:47 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/cgi.rb (CGI::unescapeHTML): invalid decoding for single
- unescaped ampersand. a patch from Tietew
- <tietew+ruby-dev at tietew.net> in [ruby-dev:30292].
- fixed: [ruby-dev:30289]
-
-Wed Feb 7 23:25:31 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval.c (specific_eval): suppress warning.
-
- * thread_win32.h: undefine _WIN32 on cygwin. [ruby-dev:30303]
-
-Wed Feb 7 22:41:34 2007 Koichi Sasada <ko1@atdot.net>
-
- * eval_intern.h: remove UNSUPPORTED() macro.
-
- * thread.c: fix to define Continuation methods
- (they only do rb_notimplement()).
-
-Wed Feb 7 22:33:58 2007 Koichi Sasada <ko1@atdot.net>
-
- * eval_intern.h, yarvcore.h: remove unused macro definition.
-
-Wed Feb 7 22:30:28 2007 Koichi Sasada <ko1@atdot.net>
-
- * eval.c: fixed to use ANSI function style.
-
-Wed Feb 7 09:35:32 2007 Koichi Sasada <ko1@atdot.net>
-
- * this commit is a result of refactoring. only renaming functions,
- moving definitions place, add/remove prototypes, deleting
- unused variables and removing yarv.h.
- This commit doesn't change any behavior of ruby/vm.
-
- * yarv.h, common.mk: remove yarv.h (contents are moved to yarvcore.h).
-
- * error.c, eval_intern.h: include yarvcore.h instead yarv.h
-
- * rename some functions:
- * debug.[ch]: debug_*() -> ruby_debug_*()
- * iseq.c: iseq_*() -> rb_iseq_*(), ruby_iseq_disasm()
- * iseq.c: node_name() -> ruby_node_name()
- * vm.c: yarv_check_redefinition_opt_method() ->
- rb_vm_check_redefinition_opt_method()
-
- * some refactoring with checking -Wall.
-
- * array.c: remove rb_ary_ptr() (unused) and remove unused
- local variables.
-
- * object.c: add a prototype of rb_mod_module_exec().
-
- * eval_intern.h (ruby_cref): set it inline.
-
- * eval_load.c (rb_load), yarvcore.c: yarv_load() -> rb_load_internal().
-
- * parse.y: add a prototype of rb_parse_in_eval() (in eval.c).
-
- * process.c: add a prototype of rb_thread_stop_timer_thread() (in thread.c).
-
- * thread.c: remove raw_gets() function (unused) and fix some format
- mismatch (format mismatches have remained yet. this is todo).
-
- * thread.c (rb_thread_wait_fd_rw): fix typo on label name.
-
- * thread_pthread.ci: comment out codes with USE_THREAD_CACHE.
-
- * vm.c (rb_svar, rb_backref_get, rb_backref_get,
- rb_lastline_get, rb_lastline_set) : moved from yarvcore.c.
-
- * vm.c (yarv_init_redefined_flag): add a prototype and rename
- yarv_opt_method_table to vm_opt_method_table.
-
- * vm.c (rb_thread_eval): moved from yarvcore.c.
-
- * yarvcore.c: remove unused global variables and fix to use nsdr().
-
-Wed Feb 7 03:39:32 2007 Koichi Sasada <ko1@atdot.net>
-
- * blockinlining.c, compile.c, compile.h, error.c, eval.c,
- eval_intern.h, eval_jump.h, eval_load.c, eval_method.h,
- eval_safe.h, gc.c, insnhelper.h, insns.def, iseq.c, proc.c,
- process.c, signal.c, thread.c, thread_pthread.ci, thread_win32.ci,
- vm.c, vm.h, vm_dump.c, vm_evalbody.ci, vm_macro.def,
- yarv.h, yarvcore.h, yarvcore.c: change type and macro names:
- * yarv_*_t -> rb_*_t
- * yarv_*_struct -> rb_*_struct
- * yarv_tag -> rb_vm_tag
- * YARV_* -> RUBY_VM_*
-
- * proc.c, vm.c: move functions about env object creation
- from proc.c to vm.c.
-
- * proc.c, yarvcore.c: fix rb_cVM initialization place.
-
- * inits.c: change Init_ISeq() order (after Init_VM).
-
- * ruby.h, proc.c: change declaration place of rb_cEnv
- from proc.c to ruby.c.
-
-Tue Feb 6 22:06:45 2007 NARUSE, Yui <naruse@ruby-lang.org>
+Tue Feb 06 22:06:45 2007 NARUSE, Yui <naruse@ruby-lang.org>
* ext/nkf/nkf-utf8/{nkf.c,utf8tbl.c}:
imported nkf 2007-01-28.
* Fixed: can't decode MIME encode JIS string.
- * Fixed: Fullwidth-halfwidth conversion.
+ * Fixed: Fullwitdh-halfwidth conversion.
* Support DoCoMo's and Softbank's EMOJI
* Support CP932, CP5022x, eucJP-ms UDC
* Support UTF-32 encoding
* Support beyond BMP
[ruby-dev:29700] [ruby-dev:29922] [ruby-dev:30144]
-Tue Feb 6 20:36:19 2007 Kouhei Sutou <kou@cozmixng.org>
-
- * lib/rss/rss.rb, lib/rss/parser.rb: followed current Ruby
- specification. [ruby-dev:30274]
-
-Tue Feb 6 20:29:44 2007 Kouhei Sutou <kou@cozmixng.org>
-
- * lib/rss/rss.rb, lib/rss/parser.rb: removed needless code for
- backward compatibility.
-
-Tue Feb 6 18:43:17 2007 Shugo Maeda <shugo@ruby-lang.org>
-
- * lib/net/ftp.rb: moved fixes for EPIPE to the correct
- place. [ruby-core:10204]
-
-Tue Feb 6 16:38:08 2007 Koichi Sasada <ko1@atdot.net>
-
- * vm_opts.h: set properties:
- svn:keywords: Author Date Id Revision
- svn:eol-style: native
-
-Tue Feb 6 15:55:46 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * variable.c (ivar_i): need to support class local instance
- variables.
-
-Tue Feb 6 15:44:11 2007 Koichi Sasada <ko1@atdot.net>
-
- * compile.c (iseq_compile_each): fix setting is_local flag.
-
- * yarvtest/test_class.rb: add a test for class local instance variable.
-
-Tue Feb 6 14:15:34 2007 Koichi Sasada <ko1@atdot.net>
-
- * compile.c, insns.def: remove (get|set)instancevariable2 and add a
- operand is_local to (get|set)instancevariable.
-
- * yarvtest/test_class.rb: add a test for class local instance variable.
-
- * parse.y (rb_decompose_ivar2): remove unused variable oid.
-
- * tool/insns2vm.rb: remove needless require.
-
-Tue Feb 6 11:18:41 2007 Shugo Maeda <shugo@ruby-lang.org>
-
- * lib/net/ftp.rb: check the control connection on EPIPE.
- Thanks, Simon Williams. [ruby-core:9547]
-
-Tue Feb 6 11:03:27 2007 Koichi Sasada <ko1@atdot.net>
-
- * complement last commit.
-
- * common.mk (*.inc): use VPATH.
-
- * vm_opts.h: renamed from vm_opts.h.base.
-
-Tue Feb 6 10:02:41 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * tool/insns2vm.rb: use vm_opts.h in VPATH.
-
-Tue Feb 6 03:47:58 2007 Koichi Sasada <ko1@atdot.net>
-
- * proc.c: support Binding#eval.
-
- * yarvtest/test_eval.rb: add a test for above change.
-
-Tue Feb 6 03:13:33 2007 Koichi Sasada <ko1@atdot.net>
-
- * proc.c: refactoring (remove K&R style, move Binding stuffs from
- Init_Proc() to Init_Binding()).
-
-Tue Feb 6 01:07:14 2007 Koichi Sasada <ko1@atdot.net>
-
- * intern.h: prepare rb_last_status_get() and rb_last_status_set().
- Use these functions instead of rb_last_status ([ruby-dev:30264]).
-
- * process.c: define above functions.
-
- * ext/pty/pty.c: use above functions.
-
- * io.c (pipe_finalize): ditto.
-
- * process.c: ditto.
-
-Mon Feb 5 21:26:56 2007 Koichi Sasada <ko1@atdot.net>
-
- * ruby.h: add a prototype of rb_id2str().
-
-Mon Feb 5 21:06:50 2007 Koichi Sasada <ko1@atdot.net>
-
- * eval_thread.c, common.mk: remove eval_thread.c.
-
- * yarvcore.c: rename cYarvThread to rb_cThread.
-
- * gc.c: remove YARV_* prefix.
-
- * gc.h: add an include guard and prototype of rb_gc_set_stack_end().
-
- * inits.c: fix to ANSI prototype style and reorder Init_*().
-
- * io.c (pipe_finalize): TODO: comment out last_status.
-
- * process.c, yarvcore.h: fix to use yarv_vm_t#last_status instead of
- rb_last_status and make last_status_get() to access $?.
-
- * yarvcore.c (vm_mark): mark yarv_vm_t#last_status.
-
- * ruby.h: add declarations of rb_cISeq and rb_cVM.
-
- * thread.c: move eval_thread.c codes to thread.c and remove yarv_*
- function prefix.
-
- * thread.c (thread_start_func_2): use yarv_thread_t#first_func if
- it is not null.
-
- * vm.c: fix copyright year.
-
- * yarvcore.c (Init_vm): rename to Init_VM().
-
-Mon Feb 5 04:09:48 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (rb_frame_callee): check if prev_cfp can be accessible.
- a patch from Yoshinori Sano <yoshinori.sano at gmail.com> in
- [ruby-dev:30252]. solves [ruby-dev:30200] and [ruby-core:9856].
-
-Sun Feb 4 20:34:41 2007 Kouhei Sutou <kou@cozmixng.org>
-
- * test/rss/rss-assertions.rb: removed needless code for backward
- compatibility.
-
-Sun Feb 4 02:22:59 2007 Akinori MUSHA <knu@iDaemons.org>
-
- * lib/cgi.rb (CGI::QueryExtension::read_multipart): Remove a debug
- print.
-
-Sat Feb 3 23:51:58 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * parse.y (rb_compose_ivar2): function to create a new ivar2
- symbol from a symbol and a class. back-ported from matzruby.
-
- * parse.y (rb_decompose_ivar2): reverse function of
- rb_compose_ivar2().
-
- * marshal.c (w_symbol): support class local instance variables.
-
- * marshal.c (r_object0): ditto.
-
- * compile.c (defined_expr): ditto.
-
- * compile.c (iseq_compile_each): ditto.
-
- * insns.def: add two new instructions: getinstancevariable2 and
- setinstancevariable2.
-
-Sat Feb 3 23:21:13 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * insns.def (setclassvariable): remove unnecessary operand.
-
- * compile.c (iseq_compile_each): ditto.
-
- * common.mk (insns_info.inc): add dependency for insns_info.inc.
-
-Sat Feb 3 14:32:58 2007 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-
- * ext/win32ole/win32ole.c (ole_val2olevariantdata, ole_val2variant):
- fix the bug of WIN32OLE_VARIANT.new when variant type is
- VT_ARRAY.
-
- * ext/win32ole/sample/excel1.rb: rewrite using WIN32OLE_VARIANT.
-
- * test/win32ole/test_win32ole.rb: add some test.
-
- * test/win32ole/test_win32ole_variant.rb: ditto.
-
-Sat Feb 3 03:35:20 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * Makefile.in, */Makefile.sub, common.mk (vmasm): generalized.
-
- * common.mk (runruby, benchmark, benchmark-each, tbench): use
- PROGRAM for the file to be built.
-
- * proc.c (yarv_proc_alloc): needs return.
-
- * call_cfunc.ci, compile.c, compile.h, debug.h, eval.c,
- eval_error.h, eval_jump.h, eval_load.c, eval_thread.c, gc.c,
- insnhelper.h, insns.def, iseq.c, main.c, numeric.c, parse.y,
- range.c, ruby.h, signal.c, thread.c, thread_win32.ci, vm.c,
- vm.h, vm_dump.c, vm_evalbody.ci, yarvcore.c, yarvcore.h:
- fixed indents and non-C90 comments.
-
- * regenc.h: revert to before YARV.
-
- * lib/mkmf.rb (create_makefile): make object files depend on
- extconf.h even if depend file exists.
-
-Fri Feb 2 23:39:42 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * common.mk (bin): add more dependency. a patch from Tadashi
- Saito <shiba at mail2.accsnet.ne.jp>. [ruby-dev:30245]
-
-Fri Feb 2 18:44:31 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * insns.def (setclassvariable): remove warn argument.
-
-Fri Feb 2 18:36:40 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * common.mk (compile.$(OBJEXT)): add config.h to vm.c and
- compile.c.
-
-Fri Feb 2 18:27:54 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c: remove duplicated global variables rb_cProc and
- rb_cBinding. [ruby-dev:30242]
-
-Fri Feb 2 00:13:44 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * ruby.h (SYMBOL_P): make Symbol immediate again for performance.
-
- * string.c: redesign symbol methods.
-
-Thu Feb 1 23:25:21 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (rb_id2str): store Strings for operator symbols.
- [ruby-dev:30235]
-
-Thu Feb 1 21:04:39 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * parse.y (assignable_gen): no need to generate NODE_CVDECL.
-
- * compile.c (iseq_compile_each): no NODE_CVDECL.
-
-Thu Feb 1 20:53:32 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * vm.c (eval_get_cvar_base): destination for class variable access
- is now strictly innermost surrounding class or module. warned
- if accessed from toplevel.
-
- * variable.c (rb_cvar_get): new class variable look-up scheme:
- 1) look up in the class. 2) if the class is singleton attached
- to a class (i.e. metaclass) then start look up in the attached
- class and its ancestors. 3) otherwise, look-up in ancestors of
- the class.
-
- * eval.c (cvar_cbase): destination for class variable access is
- the class/module that holds the method, or cbase outside of
- methods.
-
-Thu Feb 1 20:31:41 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * variable.c (rb_cvar_set): remove warn argument.
-
Wed Jan 31 14:52:09 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * eval.c (rb_iterate): need to PUSH_ITER in proper order.
+ [ruby-core:10125]
+
* test/ruby/test_iterator.rb (TestIterator::test_block_given_within_iterator):
add new test. [ruby-core:10125]
-Tue Jan 30 17:01:21 2007 NAKAMURA Usaku <usa@ruby-lang.org>
+Tue Jan 30 14:58:51 2007 NAKAMURA Usaku <usa@ruby-lang.org>
* string.c (rb_str_sub_bang): calling rb_str_modify() should be just
before actually modifying the string.
fixed: [ruby-dev:30211] (originally reported by zunda)
-Tue Jan 30 13:24:06 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * numeric.c (int_pred): add Integer#pred corresponding
- Integer#succ. [RCR#5]
-
Tue Jan 30 12:05:35 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* mkconfig.rb: autoconf 2.61 support. [ruby-core:10016]
-Mon Jan 29 23:52:32 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * tool/compile.rb: replace YARVCore by VM class.
-
-Mon Jan 29 17:52:44 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/date/format.rb (Date::Format::Bag::method_missing): add
- prefix to avoid making t class-local instance variable.
-
-Mon Jan 29 21:32:37 2007 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-
- * ext/win32ole/win32ole.c: add WIN32OLE.locale=, WIN32OLE.locale,
- WIN32OLE_VARIANT#vartype.
-
- * test/win32ole/test_win32ole.rb: add test for WIN32OLE.locale=,
- WIN32OLE.locale.
-
- * test/win32ole/test_win32ole_variant.rb: add test for
- WIN32OLE_VARIANT#vartype.
-
-Mon Jan 29 14:14:35 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * tool/parse.rb: replace YARVCore by VM class.
- http://d.hatena.ne.jp/ysano2005/20070128
-
-Sun Jan 28 08:41:49 2007 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+Sat Jan 27 15:20:11 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
- * ext/win32ole/win32ole.c: refactoring.
+ * parse.y (dyna_var_lookup): should not alter dvar->val not to
+ destroy living value. [ruby-core:10076]
-Sat Jan 27 18:36:33 2007 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-
- * ext/win32ole/win32ole.c (ole_val2olevariantdata): bug fix.
- WIN32OLE_VARIANT.new check that 1st argument should T_ARRAY
- when variant type is VT_ARRAY.
-
- * test/win32ole/test_win32ole_variant.rb: add some test.
-
-Fri Jan 26 23:55:56 2007 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-
- * ext/win32ole/win32ole.c: bug fix of WIN32OLE_VARIANT when variant
- type is VT_BYREF|VT_VARIANT.
-
- * test/win32ole/test_win32ole_variant_with_ie.rb: ditto.
+ * parse.y (dyna_init): ditto.
Fri Jan 26 12:03:39 2007 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
@@ -41782,195 +5307,62 @@ Fri Jan 26 12:03:39 2007 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tk/lib/tk/scrollable.rb: change primary name of modules
[ruby-dev:30080].
-Fri Jan 26 07:48:57 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * enumerator.c (enumerator_init_copy): need to copy internal
- structure on clone and dup. [ruby-dev:30192]
-
-Wed Jan 24 20:34:51 2007 Kouhei Sutou <kou@cozmixng.org>
-
- * test/ruby/test_iterator.rb: removed a needless workaround.
-
Wed Jan 24 18:05:39 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
* misc/ruby-mode.el (ruby-font-lock-syntactic-keywords): fix
regexp font-lock bug. [ruby-talk:235758]
+Tue Jan 23 11:02:33 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * lib/webrick/httprequest.rb (WEBrick::HTTPRequest::read_line):
+
Tue Jan 23 18:26:12 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
* lib/cgi.rb (CGI::QueryExtension::read_multipart): use == instead
of ===. [ruby-dev:30176]
-Tue Jan 23 15:39:25 2007 NAKAMURA Usaku <usa@ruby-lang.org>
+Tue Jan 23 10:48:17 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
- * Makefile.in, common.mk, configure.in, */{Makefile.sub, configure.bat,
- setup.mak}: add --with-baseruby configure option.
+ * hash.c: added documentation for Hash about how it uses eql? and
+ hash methods for the keys. [ruby-core:09995]
Mon Jan 22 14:57:25 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
* ext/socket/socket.c: fix errors in socket sample code.
[ruby-core:09992]
-Sat Jan 20 21:05:18 2007 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-
- * ext/win32ole/win32ole.c (fole_s_set_code_page): WIN32OLE.codepage=
- accepts installed codepage.
-
- * test/win32ole/test_win32ole.rb (test_s_codepage_changed): ditto.
-
-Sat Jan 20 11:18:49 2007 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-
- * ext/win32ole/win32ole.c (ole_invoke, ole_invoke2, ole_propertyput):
- modify WIN32OLERuntimeError message.
-
- * test/win32ole/test_win32ole.rb: ditto.
-
-Sat Jan 20 06:45:21 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval_proc.c (method_receiver): add new method to get the bound
- receiver of the method object. [ruby-talk:234949]
-
- * eval_proc.c (method_name): new method to get the name of a
- method.
-
- * eval_proc.c (method_owner): a new method to get the class or
- module that defines the method.
-
-Fri Jan 19 17:12:23 2007 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-
- * ext/win32ole/win32ole.c (Init_win32ole): add WIN32OLE_VARIANT::Empty,
- WIN32OLE_VARIANT::Null, WIN32OLE_VARIANT::Nothing.
-
- * test/win32ole/test_win32ole_variant.rb: ditto.
-
- * test/win32ole/test_nil2vtempty.rb(test_openSchema): ditto.
-
-Fri Jan 19 06:53:38 2007 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-
- * ext/win32ole/win32ole.c (olevariant_free): fix memory leak.
-
- * ext/win32ole/win32ole.c (ole_val2olevariantdata):
- WIN32OLE_VARIANT.new accepts nil as first argument for some VARIANT
- TYPE.
-
- * test/win32ole/test_win32ole_variant.rb: ditto.
-
-Wed Jan 17 17:31:28 2007 Koichi Sasada <ko1@atdot.net>
-
- * some refactoring around yarvcore and proc.
-
- * eval_proc.c: renamed to proc.c.
-
- * common.mk: ditto.
-
- * yarvcore.h, yarvcore.c: rename or remove some global variables
- removed: mYarvCore, mYarvInsns
- renamed: cYarvISeq -> rb_cISeq,
- cYarvProc -> rb_cProc, cYarvBinding -> rb_cBinding
- ::YarvCore module is removed and ::YarvCore::VM class becomes ::VM.
- And change/remove some functions which added with YARV.
-
- * compile.c: ditto.
-
- * eval.c: ditto.
-
- * iseq.c: ditto.
-
- * vm.c: ditto.
-
- * inits.c: rename Init_yarvcore to Init_vm.
-
- * yarvcore.c, proc.c: move some functions and initialization
- from yarvcore.c to proc.c.
-
- * intern.h, proc.c: add global function rb_binding_new(void).
-
-Tue Jan 16 17:49:29 2007 Koichi Sasada <ko1@atdot.net>
-
- * vm.c (eval_search_super_klass): rename to search_super_klass() and
- use it by th_call_super().
-
- * insns.def: ditto.
-
-Tue Jan 16 17:48:11 2007 Koichi Sasada <ko1@atdot.net>
-
- * common.mk: fix ruby script path.
-
-Tue Jan 16 17:39:44 2007 Koichi Sasada <ko1@atdot.net>
-
- * vm.c (invoke_block): fix to specify self.
-
-Tue Jan 16 12:12:27 2007 Koichi Sasada <ko1@atdot.net>
-
- * env.h: removed
-
-Tue Jan 16 12:00:06 2007 Koichi Sasada <ko1@atdot.net>
-
- * eval_proc.c (rb_proc_new): added.
-
- * string.c (sym_to_proc): supported.
-
- * vm.c (invoke_block, th_invoke_yield, th_invoke_proc): fix to support
- rb_proc_new.
-
- * yarvcore.c: add a test code.
-
-Sat Jan 13 23:24:59 2007 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+Sat Jan 13 23:54:48 2007 Masaki Suketa <masaki.suketa@nifty.ne.jp>
* ext/win32ole/win32ole.c (ole_free, ole_type_free,
olemethod_free, olevariable_free, oleparam_free,
ole_event_free): fix memory leak. [ruby-core:09846]
-Wed Jan 10 00:10:23 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * array.c (rb_ary_replace): use ptr and len of orig instead of
- shared. fixed: [ruby-dev:30116]
-
-Tue Jan 9 17:48:38 2007 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * file.c (rb_find_file): should not call fpath_check() with NULL.
- fixed: [ruby-core:09867]
-
-Tue Jan 9 12:29:20 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Jan 12 11:13:55 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ext/etc/etc.c (etc_getpwuid, etc_getgrgid): fix to correctly
- convert uid/gid from VALUE.
+ convert uid/gid from VALUE. (backport of r11521)
- * ext/etc/etc.c (etc_getpwuid): ditto.
+Wed Jan 10 18:57:57 2007 Minero Aoki <aamine@loveruby.net>
-Tue Jan 9 03:54:38 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * ext/strscan/strscan.c (strscan_do_scan): should set kcode option
+ before match. [ruby-dev:29914]
- * string.c (rb_str_upto): String#upto from empty string makes
- infinite loop. [ruby-core:09864]
-
- * string.c (rb_str_upto): use RSTRING_LEN().
-
-Sun Jan 7 18:36:05 2007 Koichi Sasada <ko1@atdot.net>
-
- * thread.c (rb_thread_stop_timer_thread(), rb_thread_reset_timer_thread(),
- rb_thread_start_timer_thread()): added.
-
- * thread_pthread.ci: add a native_thread_join() and move
- rb_thread_reset_timer_thread() definition to thread.c.
+ * test/strscan/test_stringscanner.rb: test it.
- * thread_win32.ci: ditto
+ * re.c: export kcode_set_option and kcode_reset_option (with "rb_"
+ prefix).
- * process.c: fix before_exec(), after_exec() to stop timer thread
- (and restart timer thread if exec failed). and fix to reset
- timer thread information when forked child process starts
- (to fix [ruby-core:09822]).
-
-Sun Jan 7 18:28:17 2007 Koichi Sasada <ko1@atdot.net>
+ * intern.h: ditto.
- * common.mk: add a "compare" rule and fix MATZRUBY variable
+Tue Jan 9 17:45:17 2007 NAKAMURA Usaku <usa@ruby-lang.org>
-Sun Jan 7 17:47:16 2007 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+ * file.c (rb_find_file): should not call fpath_check() with NULL.
+ fixed: [ruby-core:09867]
- * test/win32ole/test_win32ole.rb: add test for WIN32OLE#[],
- WIN32OLE#[]=.
+Tue Jan 9 03:54:38 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
- * ext/win32ole/win32ole.c: update comment for rdoc of
- WIN32OLE#[] and WIN32OLE#[]=.
+ * string.c (rb_str_upto): String#upto from empty string makes
+ inifinite loop. [ruby-core:09864]
Sun Jan 7 12:13:26 2007 Eric Hodel <drbrain@segment7.net>
@@ -41985,330 +5377,36 @@ Sun Jan 7 10:32:12 2007 Eric Hodel <drbrain@segment7.net>
* test/rdoc/parsers/test_parse_c.rb:
Test RDoc::C_Parser#do_classes and Rdoc::C_Parser#find_class_comment.
-Sun Jan 7 09:31:18 2007 Tadayoshi Funaba <tadf@dotrb.org>
+Sun Jan 7 09:33:02 2007 Tadayoshi Funaba <tadf@dotrb.org>
* lib/date/format.rb: updated based on date2 4.0.1.
-Sat Jan 6 18:46:34 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * io.c (rb_io_getline_fast, rb_io_getline): increase lineno
- when met the delimiter or EOF. fixed: [ruby-dev:30081]
-
- * io.c (prepare_getline_args, rb_io_getline_1): split
- preparation of arguments and reading. [ruby-dev:30085]
-
-Sat Jan 6 13:48:36 2007 Koichi Sasada <ko1@atdot.net>
-
- * insns.def (send): fix to optimize send() with Symbol.
-
- * yarvtest/test_method.rb: add another test.
-
-Sat Jan 6 13:43:55 2007 Koichi Sasada <ko1@atdot.net>
-
- * common.mk: add PHONY dependency to some rules
-
-Sat Jan 6 11:50:33 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * io.c (argf_read): fix wrong replacement. [ruby-dev:30070]
-
-Sat Jan 6 09:10:52 2007 Koichi Sasada <ko1@atdot.net>
-
- * insns.def: support direct method dispatch with "send" or "funcall".
- This means that "obj.send :m" skips "BasicObject#send" invocation
- (method frame creation, etc) and "obj.m" invokes directly.
- If you make backtrace, there are no entries of "send" method.
-
- * compile.c (iseq_specialized_instruction): fix to support above
-
- * eval.c: ditto (remove "static" from rb_f_send and rb_f_funcall
-
- * yarvcore.c: ditto (add a external IDs for compiler)
-
- * yarvcore.h: ditto (add a VM_CALL_SEND_BIT macro)
-
- * yarvtest/test_method.rb: add tests for above changes
-
- * eval.c: remove unused "Kernel#send" declaration
-
-Sat Jan 6 08:29:17 2007 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-
- * ext/win32ole/win32ole.c (Init_win32ole): add
- WIN32OLE::VARIANT::VT_EMPTY, WIN32OLE::VARIANT::VT_NULL
-
- * test/win32ole/test_win32ole_variant_m.rb (test_variant): ditto.
-
-Sat Jan 6 03:49:22 2007 Koichi Sasada <ko1@atdot.net>
-
- * benchmark/run.rb: change option format
-
- * common.mk: ditto
-
-Fri Jan 5 22:21:08 2007 Koichi Sasada <ko1@atdot.net>
-
- * benchmark/bm_app_pentomino.rb: use Array#dup instead of
- Array#clone
-
- * benchmark/bmx_temp.rb: removed
-
- * benchmark/run.rb: use run.rb instead of run_rite.rb
-
- * common.mk: ditto
-
- * benchmark/run_rite.rb: removed
-
- * common.mk: use $(srcdir)/test.rb to run a test program
- with "make run"
-
- * benchmark/bmx_temp.rb: removed and
- set svn:ignore (bmx_*.rb) to benchmark/
-
- * test.rb: set svn:ignore
-
-Fri Jan 5 21:03:08 2007 Koichi Sasada <ko1@atdot.net>
-
- * yarvtest/yarvtest.rb: fix to compare results
-
-Fri Jan 5 20:52:56 2007 Koichi Sasada <ko1@atdot.net>
-
- * compile.c, compile.h: add ADD_CALL_RECEIVER() macro.
-
- * insns.def (send): use GET_SELF() direct if FCALL.
-
- * eval.c (rb_f_send): check method dispatch type to permit
- invoking private method when dispatch type is FCALL/VCALL
-
- * insns.def (opt_ltlt): remove useless statement.
-
- * vm.h: remove unused macros.
-
-Fri Jan 5 20:50:31 2007 Koichi Sasada <ko1@atdot.net>
-
- * benchmark/run_rite.rb: fix to use readlines instead of
- read(...).lines (because 1.8 doesn't have String#lines).
-
-Fri Jan 5 20:28:19 2007 Koichi Sasada <ko1@atdot.net>
-
- * thread_win32.ci (rb_thread_reset_timer_thread):
- added ([ruby-dev:30086]).
-
-Fri Jan 5 20:20:36 2007 Koichi Sasada <ko1@atdot.net>
-
- * common.mk: add .SUFFIXES rule
-
-Fri Jan 5 15:58:15 2007 Koichi Sasada <ko1@atdot.net>
-
- * eval_method.h (rb_alias): fix to check search result
-
-Fri Jan 5 13:59:53 2007 Koichi Sasada <ko1@atdot.net>
-
- * eval_method.h (rb_add_method): fix to check old_node
-
-Fri Jan 5 12:03:07 2007 Koichi Sasada <ko1@atdot.net>
-
- * compile.c (iseq_compile_each, set_block_local_tbl):
- support NODE_LAMBDA (partly).
-
- * sample/test.rb: restore test of NODE_LAMBDA
-
- * test/ruby/test_lambda.rb: ditto
-
-Fri Jan 5 12:31:23 2007 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * thread_pthread.ci (native_sleep): fix tv_nsec overflow.
-
-Thu Jan 4 20:01:29 2007 Koichi Sasada <ko1@atdot.net>
-
- * common.mk: rename yarv-test-[all/each] to compare-test[/-each].
- purpose of "compare-test" rule is to compare ruby (trunk) and
- matzruby (branches/matzruby) binary in miniruby level. MATZRUBY
- parameter means an path to miniruby of matzruby binary. to do this
- comparison test, you should build matzruby branch.
-
- * yarvtest/yarvtest.rb: fix to use command line option as
- command names to be compared.
-
- * yarvtest/runner.rb: remove a debug output.
-
-Thu Jan 4 19:12:27 2007 Koichi Sasada <ko1@atdot.net>
-
- * common.mk: fix to use test.rb script in build directory.
- ($(srcdir)/test.rb -> test.rb)
-
-Thu Jan 4 17:28:05 2007 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * lib/webrick/utils.rb (WEBrick::Utils::TimeoutHandler#initialize):
- Arrays could not be modified in its each block. [ruby-dev:30063]
-
-Thu Jan 4 16:57:14 2007 Koichi Sasada <ko1@atdot.net>
-
- * yarv_version.h: removed.
-
- * common.mk: remove yarv_version.h from rules
-
- * yarvcore.h (Init_yarvcore): remove useless constants
-
-Thu Jan 4 17:00:06 2007 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * ext/openssl/ossl_asn1.c (Init_ossl_asn1):
- OpenSSL::ASN1::ASN1Data#value,#tag,#tag_class and
- OpenSSL::ASN1::BitString#unused_bits should be public.
-
-Thu Jan 4 13:45:10 2007 Koichi Sasada <ko1@atdot.net>
-
- * thread_pthread.ci: fix last changes around PTHREAD_STACK_MIN.
-
-Thu Jan 4 13:42:47 2007 Koichi Sasada <ko1@atdot.net>
-
- * common.mk: restore changes.
-
-Thu Jan 4 10:33:54 2007 Koichi Sasada <ko1@atdot.net>
-
- * thread_pthread.ci: fix to skip using PTHREAD_STACK_MIN.
- [ruby-dev:30063]
-
-Thu Jan 4 10:30:11 2007 Koichi Sasada <ko1@atdot.net>
-
- * benchmark/run_rite.rb (bm): fix to use lines.
-
-Wed Jan 3 18:49:15 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * io.c (rb_io_getline): lineno update condition was wrong.
- [ruby-dev:30065]
-
- * io.c (rb_io_getline_fast): ditto.
-
Wed Jan 3 11:36:51 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
* io.c (ruby_dup): start GC on ENOMEM as well.
-Tue Jan 2 10:29:54 2007 Eric Hodel <drbrain@segment7.net>
-
- * ext/zlib/zlib.c: fix to compile on YARV
- ruby_errinfo -> rb_errinfo()
-
-Mon Jan 1 08:07:06 2007 Koichi Sasada <ko1@atdot.net>
-
- * ext/tk/tcltklib.c: fix to compile on YARV
- ruby_errinfo -> rb_errinfo(),
- ruby_safe_level -> rb_safe_level().
-
-Mon Jan 1 07:57:17 2007 Koichi Sasada <ko1@atdot.net>
-
- * test/drb/test_drbssl.rb: fix to skip drb tests.
-
Mon Jan 1 06:13:11 2007 Eric Hodel <drbrain@segment7.net>
* lib/rdoc/parsers/c_parser.rb: Make Rdoc accessible. Update constant
value information.
+Mon Jan 1 06:13:11 2007 Eric Hodel <drbrain@segment7.net>
+
* ext/bigdecimal/bigdecimal.c: Update constant comments to provide
values for RDoc.
Mon Jan 1 06:05:55 2007 Eric Hodel <drbrain@segment7.net>
- * lib/rdoc/parsers/parse_c.rb (RDoc::C_Parser#handle_constants):
+ * lib/rdoc/parsers/parse_c.rb (RDoc::C_Parser#handle_constansts):
Allow RDoc comment to give friendly value for rb_define_const. Patch
by Daniel Berger <djberg96 at gmail.com>, [ruby-patches-7499].
- * lib/rdoc/parsers/parse_c.rb (RDoc::C_Parser#handle_constants): Fix
+ * lib/rdoc/parsers/parse_c.rb (RDoc::C_Parser#handle_constansts): Fix
whitespace handling in constant comments.
-Mon Jan 1 00:00:00 2007 Koichi Sasada <ko1@atdot.net>
-
- * Merge YARV
-
-Sun Dec 31 16:22:48 2006 Eric Hodel <drbrain@segment7.net>
-
- * array.c: Fix Array#reject.
-
-Sun Dec 31 00:46:25 2006 Tadayoshi Funaba <tadf@dotrb.org>
-
- * lib/date2.rb: removed.
-
-Sun Dec 31 00:15:13 2006 Tadayoshi Funaba <tadf@dotrb.org>
+Sun Dec 31 00:31:16 2006 Tadayoshi Funaba <tadf@dotrb.org>
* lib/date.rb, lib/date/format.rb: updated based on date2 4.0.
-Sat Dec 30 04:38:23 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * enum.c (enum_each_with_index): reuse array for yield parameters.
-
- * enum.c (enum_min, enum_max): ditto.
-
-Sat Dec 30 04:25:29 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * enum.c (enum_inject): reuse array for yield parameters.
-
-Sat Dec 30 02:54:22 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * ext/stringio/stringio.c (strio_gets): accepts limit argument.
-
- * ext/stringio/stringio.c (strio_readline, strio_each,
- strio_readlines): ditto.
-
-Sat Dec 30 02:22:32 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * ext/stringio/stringio.c (strio_getline): add limit capability.
-
- * io.c (rb_io_gets_m): accepts limit argument. [ruby-talk:231563]
-
- * io.c (rb_io_readline, rb_io_readlines, rb_io_each_line, argf_getline):
- ditto.
-
- * io.c (appendline): add limit capability.
-
- * io.c (rb_io_getline_fast, rb_io_getline): ditto.
-
- * io.c (rb_io_getline): small refactoring for DRY.
-
- * io.c (rb_io_s_foreach, rb_io_s_readlines): small refactoring.
-
-Thu Dec 28 15:27:38 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/cgi.rb (CGI::Cookie::initialize): use Array() again.
- [ruby-core:09781]
-
-Wed Dec 27 20:52:32 2006 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-
- * ext/win32ole/win32ole.c: remove WIN32OLE::PROPERTY class.
-
- * ext/win32ole/tests/testWIN32OLE.rb: ditto.
-
-Wed Dec 27 10:04:11 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * object.c (rb_Array): returns 1-element array if the argument
- does not have to_ary nor to_a.
-
-Tue Dec 26 21:02:14 2006 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-
- * test/win32ole/test_folderitem2_invokeverb.rb: The argument
- of Shell.NameSpace should not be file path.
-
-Tue Dec 26 06:13:08 2006 Minero Aoki <aamine@loveruby.net>
-
- * ext/bigdecimal/bigdecimal.c: remove useless method
- BigDecimal#!=. [ruby-dev:30050]
-
-Thu Dec 21 15:37:17 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * string.c (rb_str_slice_bang): rdoc description bug fixed.
- [ruby-core:09754]
-
-Wed Dec 20 12:54:31 2006 Koichi Sasada <ko1@atdot.net>
-
- * Convert CVS repository to Subversion repository.
-
-Mon Dec 18 08:36:29 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/cgi.rb (CGI::Cookie::initialize): Array(string) no longer
- works. [ruby-core:09738]
-
-Fri Dec 15 00:19:53 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * win32/Makefile.sub (COMPILE_RULES): latter rule has higher priority.
-
- * lib/mkmf.rb (create_makefile): remove static library before update,
- to get rid of sludge of Borland tlib.exe.
-
Thu Dec 14 18:29:13 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
* ext/readline/readline.c: NetBSD editline does not have
@@ -42321,11 +5419,7 @@ Thu Dec 14 18:20:43 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
* lib/irb/locale.rb (IRB::Locale::puts): typo fixed. a patch from
NAKAMURA Usaku <usa@ruby-lang.org>. [ruby-dev:30012]
-Tue Dec 12 23:33:53 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/optparse.rb (Switch#parse_arg, Switch#conv_arg): splat failures.
-
-Mon Dec 11 11:51:10 2006 Akinori MUSHA <knu@iDaemons.org>
+Mon Dec 11 11:58:36 2006 Akinori MUSHA <knu@iDaemons.org>
* ext/digest/sha2/lib/sha2.rb: Moved one level up from under
the superfluous subdirectory digest/.
@@ -42346,132 +5440,83 @@ Sat Dec 9 21:39:24 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
Sat Dec 9 11:22:00 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
- * lib/irb/locale.rb (IRB::Locale::search_file): use File.exist?
+ * lib/irb/locale.rb (IRB::Locale::search_file): ues File.exist?
instead of File.exists?. a patch from Yutaka Kanemoto
<kinpoco at gmail.com> in [ruby-dev:30000].
-Fri Dec 8 18:11:18 2006 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * lib/optparse.rb: cannot put :nodoc: before method definition.
- put after it.
-
-Fri Dec 8 17:00:13 2006 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * bin/rdoc: use File.exist? instead of File.exists?.
-
-Thu Dec 7 23:50:21 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * object.c (Init_Object): new method Dir.exist?(path).
- [ruby-core:09663]
-
- * file.c (Init_File): remove File.exists?; use File.exist?
- instead.
-
- * file.c: rename functions to test_* to rb_file_*_p.
-
Thu Dec 7 09:29:02 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
* lib/weakref.rb (WeakRef::__setobj__): should support
marshaling. [ruby-talk:228508]
-Wed Dec 6 23:58:36 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/delegate.rb (Delegator::marshal_load): need to call
+ __setobj__.
+
+Wed Dec 6 23:56:14 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
* Makefile.in, common.mk (NULLCMD): moved for platforms that empty
command does not run. fixed: [ruby-dev:29994]
- * win32/win32.c (init_stdhandle): redirect unopened IOs to NUL.
- [ruby-core:09572]
-
-Tue Dec 5 19:01:42 2006 WATANABE Hirofumi <eban@ruby-lang.org>
+Wed Dec 6 17:17:26 2006 WATANABE Hirofumi <eban@ruby-lang.org>
- * configure.in (SITE_DIR): fixed to empty RUBY_SITE_LIB in config.h on
+ * configure.in (SITE_DIR): fixed to emtpy RUBY_SITE_LIB in config.h on
NetBSD. fixed: [ruby-dev:29358]
-Tue Dec 5 18:38:21 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/matrix.rb (Matrix::rank): use quo method to avoid integer
- division problem. [ruby-core:09644]
-
- * lib/matrix.rb (Matrix::rank_e): ditto.
-
Tue Dec 5 00:59:05 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
* misc/ruby-mode.el (ruby-parse-partial): need to parse "/=" as
self assignment operator, not regex. [ruby-talk:227324]
-Tue Dec 5 00:19:14 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * intern.h, object.c, variable.c (rb_mod_constants): added an optional
- flag to search ancestors, which is defaulted to true, as well as
- const_defined? and const_get. [ruby-dev:29989]
-
-Mon Dec 4 23:49:28 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * instruby.rb (install_recursive): get rid of warning.
-
- * lib/optparse.rb (CompletingHash#match): get rid of splat failure.
-
-Mon Dec 4 19:16:39 2006 Akinori MUSHA <knu@iDaemons.org>
-
- * ext/digest/lib/digest/hmac.rb: Do alias << update.
-
Mon Dec 4 10:48:03 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
* ruby.h (OFFT2NUM): use LONG2NUM() if sizeof(long) equals to
sizeof(off_t).
-Mon Dec 4 08:32:25 2006 Shugo Maeda <shugo@ruby-lang.org>
+Mon Dec 4 10:43:46 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
- * lib/cgi.rb (CGI::QueryExtension::read_multipart): should quote
- boundary. JVN#84798830
-
-Sun Dec 3 16:16:53 2006 Akinori MUSHA <knu@iDaemons.org>
-
- * ext/digest/lib/digest/hmac.rb: Fix problems with update
- timing. [Reported by: oss-ruby@technorama.net]
-
-Sat Dec 2 07:33:53 2006 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * parse.y (dyna_init_gen): dvar initialization only if dvar is
+ assigned inner block. [ruby-talk:227402]
- * lib/webrick/httputils.rb (WEBrick::HTTPUtils::FormData::<<):
- HTTPUtils::parse_header() takes a string. [ruby-dev:29931]
+Mon Dec 4 08:32:49 2006 Shugo Maeda <shugo@ruby-lang.org>
- * lib/webrick/httputils.rb (WEBrick::HTTPUtils::parse_header):
- String does no longer have each method.
-
- * lib/webrick/httputils.rb (WEBrick::HTTPUtils::parse_form_data):
- ditto.
+ * lib/cgi.rb (CGI::QueryExtension::read_multipart): should quote
+ boundary. JVN#84798830
Sat Dec 2 07:09:04 2006 GOTOU Yuuzou <gotoyuzo@notwork.org>
* ext/openssl/ossl_ocsp.c: OpenSSL::OCSP::OSCPError should be
subclass of OpenSSL::OpenSSLError. [ruby-dev:29980]
+Fri Dec 1 17:01:49 2006 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * gc.c (ruby_init_stack): decrease "stack level too deep" in Windows.
+ merge from trunk.
+
Fri Dec 1 16:31:53 2006 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tk/tcltklib.c: shouldn't run the killed thread at callback.
[ruby-talk: 227408]
-Tue Nov 28 17:25:11 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * array.c (ary_iter_check): should check modification (size
- change) during iteration.
-
- * array.c (rb_ary_initialize, rb_ary_shift, rb_ary_unshift,
- rb_ary_splice, rb_ary_reverse, rb_ary_sort, rb_ary_delete,
- rb_ary_delete_at, rb_ary_reject_bang, rb_ary_replace,
- rb_ary_clear, rb_ary_fill, rb_ary_uniq_bang, rb_ary_compact,
- rb_ary_shuffle): add iteration check.
-
-Mon Nov 27 09:00:15 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+Mon Nov 27 17:18:27 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
- * string.c (rb_str_ord): typo fixed. reported from Kornelius
- Kalnbach <murphy@rubychan.de>. [ruby-core:09621]
+ * sprintf.c (rb_f_sprintf): need not to truncate string if no
+ width specifier given for %s. [ruby-dev:29952]
Sun Nov 26 16:36:46 2006 URABE Shyouhei <shyouhei@ruby-lang.org>
* version.h: addition of RUBY_PATCHLEVEL.
* version.c: ditto.
+Fri Nov 24 10:17:51 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * bignum.c (bignorm): avoid segmentation. a patch from Hiroyuki
+ Ito <ZXB01226@nifty.com>. [ruby-list:43012]
+
+Thu Nov 23 10:38:40 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * eval.c (rb_mod_define_method): set implicit visibility only when
+ it's called for the target class (ruby_cbase).
+
Wed Nov 22 16:00:49 2006 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tk/extconf.rb: support --with-X11/--without-X11 option.
@@ -42482,57 +5527,28 @@ Wed Nov 22 16:00:49 2006 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tk/tkutil/extconf.rb: able to be called manually
[ruby-talk:225950].
-Sat Nov 18 23:39:20 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * object.c (rb_obj_tap): a new method. [ruby-talk:224013]
-
Wed Nov 15 23:22:54 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
* file.c (test_grpowned, rb_stat_grpowned): should honor
supplementary group IDs. [ruby-core:09546]
-Tue Nov 7 18:35:18 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (formal_assign): need to pack rest arg information in
- argc.
-
-Tue Nov 7 18:05:01 2006 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tk/lib/tk/itemconfig.rb: minor bug fix.
-
-Tue Nov 7 17:52:08 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * class.c (rb_include_module): revert duplicate inclusion of
- modules. [ruby-dev:29793]
-
-Tue Nov 7 17:18:11 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (method_missing): update old argument adjustment.
-
-Tue Nov 7 16:41:21 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Nov 9 03:15:22 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
- * eval.c (when_check): need to splat for NODE_ARGSCAT as well.
- [ruby-dev:29860]
+ * eval.c (BEGIN_CALLARGS): ruby_block may be NULL even when
+ ITER_PRE.
-Mon Nov 6 22:23:52 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+Tue Nov 7 18:34:34 2006 Akinori MUSHA <knu@iDaemons.org>
- * string.c (Init_String): remove duplicated definition of
- Symbol#to_s.
+ * ext/digest/lib/digest/hmac.rb: Keep this out of the 1.8 tree
+ until we reach a consensus that HMAC should be put under Digest.
-Mon Nov 6 18:54:13 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (svalue_to_avalue): need to splat but no error.
-
- * eval.c: new macros - YIELD_CALL, YIELD_VALUES.
-
- * eval.c (rb_yield_values): specify YIELD_VALUES.
+Tue Nov 7 18:05:01 2006 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
- * eval.c (rb_yield_0): use new macros.
+ * ext/tk/lib/tk/itemconfig.rb: minor bug fix.
- * eval.c (proc_invoke): slightly modified to separate YIELD_CALL
- and YIELD_VALUES from YIELD_ARY_ARGS.
+Mon Nov 6 20:11:20 2006 Kouhei Sutou <kou@cozmixng.org>
- * object.c (Init_Object): add nil.to_splat => [].
+ * lib/rss/0.9.rb (RSS::Rss): removed needless include.
Mon Nov 6 15:41:55 2006 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
@@ -42540,9 +5556,9 @@ Mon Nov 6 15:41:55 2006 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
fix on 'itemconfiginfo' method, and modify to make it easy to
override 'itemconfiginfo' method.
- * ext/tk/lib/tkextlib/tile/treeview.rb: support Tile 0.7.8.
+ * ext/tk/lib/tkextlib/tile/treeview.rb : support Tile 0.7.8.
- * ext/tk/lib/tkextlib/version.rb: [new] add Tk::Tkextlib_RELEASE_DATE
+ * ext/tk/lib/tkextlib/version.rb : [new] add Tk::Tkextlib_RELEASE_DATE
to get the information from scripts.
* ext/tk/lib/tk.rb: load 'tkextlib/version.rb', and update RELEASE_DATE
@@ -42559,17 +5575,14 @@ Mon Nov 6 15:41:55 2006 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
real console. IRB works on a text widget without I/O blocking. That
is, thread switching on IRB will work properly, even if on Windows.
-Mon Nov 6 00:42:05 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * parse.y (arg_dup_check): vid may be nameless internal id.
-
-Sun Nov 5 19:52:19 2006 Tadayoshi Funaba <tadf@dotrb.org>
+Sun Nov 5 19:53:49 2006 Tadayoshi Funaba <tadf@dotrb.org>
* lib/date.rb: updated based on date2 3.9.7.
-Sat Nov 4 13:09:31 2006 Shugo Maeda <shugo@ruby-lang.org>
+Sat Nov 4 13:13:57 2006 Shugo Maeda <shugo@ruby-lang.org>
* lib/net/imap.rb: accept NOMODSEQ. [ruby-core:9002]
+ (backported from HEAD)
Fri Nov 3 00:16:37 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
@@ -42577,49 +5590,17 @@ Fri Nov 3 00:16:37 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
for AIX. a patch from Yutaka Kanemoto <kinpoco AT gmail.com>.
[ruby-dev:29744]
-Thu Nov 2 14:19:44 2006 Akinori MUSHA <knu@iDaemons.org>
-
- * lib/set.rb (Set#^): Fix XOR operation against a container that
- holds duplicate values. [ruby-core:9372]
-
-Thu Nov 2 10:00:06 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+Thu Nov 2 15:43:39 2006 NAKAMURA Usaku <usa@ruby-lang.org>
- * string.c: class Symbol is no longer subclass of String. also
- covers [ruby-core:09366]
+ * parse.y (primary): should set NODE even when compstmt is NULL.
+ merge from trunk. fixed: [ruby-dev:29732]
-Thu Nov 2 08:21:07 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+Thu Nov 2 14:48:30 2006 Akinori MUSHA <knu@iDaemons.org>
- * lib/xmlrpc/create.rb (XMLRPC::Create::conv2value): Symbol should
- come earlier than String.
-
- * lib/soap/mapping/rubytypeFactory.rb (RubytypeFactory::obj2soap):
- ditto.
-
- * lib/set.rb (TC_Set::test_s_new): strings are no longer
- Enumerable
-
- * lib/soap/property.rb (Property::load): ditto.
-
- * lib/webrick/httputils.rb (WEBrick::HTTPUtils::parse_header): ditto.
-
- * lib/soap/mimemessage.rb (MIMEMessage::Headers::parse): ditto.
-
-Thu Nov 2 09:08:04 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * array.c: revert lfree shift/unshift boost patch to avoid unknown
- memory error.
-
-Wed Nov 1 23:24:42 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * ruby.h (struct RArray): revert embedding ptr in RVALUE.
-
- * array.c: ditto.
-
-Wed Nov 1 23:01:55 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * string.c (hash): use Bob Jenkins' hash algorithm.
+ * lib/set.rb (Set#^): Fix XOR operation against a container that
+ holds duplicate values. [issue: #6444]
-Wed Nov 1 02:22:31 2006 Akinori MUSHA <knu@iDaemons.org>
+Wed Nov 1 02:41:38 2006 Akinori MUSHA <knu@iDaemons.org>
* ext/digest/lib/digest/hmac.rb (Digest::HMAC::update): Minor
optimization.
@@ -42632,6 +5613,8 @@ Wed Nov 1 01:05:13 2006 NAKAMURA Usaku <usa@ruby-lang.org>
* eval.c (rb_call0): fixed bug of zsuper with both of opt and rest.
fixed: [ruby-list:42928]
+ * test/ruby/test_super.rb: add tests to check above bug.
+
Tue Oct 31 17:03:21 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
* time.c (time_dup): duplicate the class of original time.
@@ -42640,11 +5623,6 @@ Tue Oct 31 17:03:21 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
* lib/time.rb (Time::make_time, Time::rfc2822, Time::httpdate):
should respect subclasses. [ruby-core:09357]
-Tue Oct 31 16:25:22 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * array.c (ary_shared_first): should address offset after
- ary_shared_array(). [ruby-core:09358]
-
Mon Oct 30 23:40:52 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
* Makefile.in (miniruby): add XLDFLAGS.
@@ -42656,7 +5634,7 @@ Mon Oct 30 23:40:52 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
* win32/win32.c (cmdglob, rb_w32_cmdvector, rb_w32_opendir,
rb_w32_get_environ): not to use GC before initialization.
-Mon Oct 30 19:28:02 2006 NAKAMURA Usaku <usa@ruby-lang.org>
+Mon Oct 30 19:29:20 2006 NAKAMURA Usaku <usa@ruby-lang.org>
* bignum.c (rb_big2str0): use better approximation.
@@ -42669,96 +5647,62 @@ Mon Oct 30 12:34:02 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
* eval.c (rb_eval): fix commit miss. [ruby-dev:29707]
+Mon Oct 30 12:20:58 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * bignum.c (rb_big2str0): a bug in length adjustment.
+
Mon Oct 30 11:15:40 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
* sprintf.c (rb_str_format): should preserve leading zero
information for negative %b and %x. [ruby-talk:221347]
-Sun Oct 29 19:51:31 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
-
- * regexec.c: invalid offset value was used in STATE_CHECK_BUFF_INIT().
-
-Sat Oct 28 20:13:18 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
-
- * oniguruma.h: Version 4.4.5
-
- * regint.h: ditto.
-
- * regerror.c: ditto.
-
- * regexec.c: ditto.
-
- * regcomp.c ditto.
-
- * regparse.c ditto.
-
-Sat Oct 28 07:56:13 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * marshal.c (r_object0): missing break. [ruby-core:09345]
-
-Fri Oct 27 17:30:31 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * enumerator.c (enum_each_cons): move RETURN_ENUMERATOR() after
- argument check.
-
-Thu Oct 26 21:05:48 2006 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Thu Oct 26 21:05:58 2006 GOTOU Yuuzou <gotoyuzo@notwork.org>
* ext/openssl/ossl_pkcs7.c (ossl_pkcs7_verify): should clear error.
(fix http://bugs.debian.org/394336)
* ext/openssl/ossl_ns_spki.c (ossl_spki_initialize): ditto.
-Thu Oct 26 15:23:47 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * enumerator.c: remove by_slice and by_cons.
-
-Thu Oct 26 15:12:12 2006 NAKAMURA Usaku <usa@ruby-lang.org>
+Thu Oct 26 15:21:10 2006 NAKAMURA Usaku <usa@ruby-lang.org>
* ext/digest/digest.c (Init_digest): typo.
-Wed Oct 25 17:16:05 2006 Akinori MUSHA <knu@iDaemons.org>
-
- * test/digest/test_digest_hmac.rb: added.
-
-Wed Oct 25 16:34:31 2006 Akinori MUSHA <knu@iDaemons.org>
-
- * ext/digest/test.sh: make this script work again.
-
-Wed Oct 25 07:59:42 2006 Tadayoshi Funaba <tadf@dotrb.org>
+Wed Oct 25 17:23:28 2006 Akinori MUSHA <knu@iDaemons.org>
+
+ * ext/digest, test/digest/test_digest.rb: Merge from trunk:
+ - Introduce versioning in Digest::Base API, and prefix C
+ constants with RUBY_ and C type names with rb_ to avoid name
+ clash in writing extensions.
+ - Introduce Digest::Class and Digest::Instance for ease of
+ implementing subclasses and add-ons.
+ - Digest::Instance module requires and assumes that any instance
+ be resettable and clonable. An instance method #new() is
+ added so digest instances work just like digest classes.
+ - The constructor does no longer take an initial string to feed;
+ digest() and hexdigest() now do, instead. This allows digest
+ classes to take their own hashing parameters.
+ - Make some changes to digest() and hexdigest() class methods,
+ which now take extra arguments, which are passed through to
+ the constructor in an internal call.
+ - Add #digest_length/size/length() and #block_length(),
+ - Add the Digest::SHA2 class to wrap up SHA2 variants: SHA256,
+ SHA384 and SHA512, hoping this module would make a decent
+ example of a digest subclass written in Ruby.
+ - Rip BubbleBabble support out of the base class and have a
+ separate module named digest/bubblebabble.
+ - Remove RD documents in favor of newly written and embedded
+ RDoc documentation.
+
+Wed Oct 25 08:03:23 2006 Tadayoshi Funaba <tadf@dotrb.org>
* lib/date/format.rb: updated based on date2 3.9.6.
[ruby-core:09323]
-Wed Oct 25 00:58:19 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * win32/mkexports.rb, win32/resource.rb: use unique variable names.
-
-Tue Oct 24 19:18:53 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * enumerator.c (enumerator_by_slice): new method added.
-
- * enumerator.c (enumerator_by_cons): ditto.
-
-Tue Oct 24 18:56:13 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * enumerator.c (enum_each_slice, enum_each_cons): returns
- Enumerable::Enumerator if no block is given. [ruby-dev:29246]
-
- * enumerator.c: remove methods: enum_with_index, enum_slice,
- enum_cons. [ruby-dev:29246]
-
-Tue Oct 24 18:51:27 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * enum.c (enum_zip): add RETURN_ENUMERATOR() to zip method.
-
-Mon Oct 23 04:30:04 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * marshal.c (r_object0): use return value from proc given as the
- second argument to Marshal#load() to allow value replacement in
- the restoring data.
-
Sun Oct 22 14:48:31 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * signal.c (ruby_signal): don't set SA_RESTART. a backport from
+ the HEAD. [ruby-talk:220937] [ruby-talk:147220]
+
* signal.c (Init_signal): avoid duplicated installation of SIGCHLD
handler.
@@ -42767,57 +5711,14 @@ Sun Oct 22 16:47:56 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
* string.c (rb_str_substr): should be infected with only original
string, but not the shared string. fixed: [ruby-core:09152]
- * string.c (rb_str_new4): keep shared string untainted when original
+ * string.c (rb_str_new4): keep shared string untainted when orignal
string is tainted. fixed: [ruby-dev:29672]
-Sun Oct 22 07:55:11 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * string.c (rb_str_upcase, rb_str_downcase, rb_str_downcase,
- rb_str_upcase_bang, rb_str_downcase_bang, rb_str_swapcase_bang):
- add RDoc description that case conversion to be effective only
- in ASCII region.
-
Sun Oct 22 05:20:34 2006 URABE Shyouhei <shyouhei@ice.uec.ac.jp>
* configure.in: alloca is broken; use C_ALLOCA instead.
[ruby-dev:29416]
-Sat Oct 21 17:50:40 2006 Akinori MUSHA <knu@iDaemons.org>
-
- * ext/digest/lib/digest.rb: Follow the framework updates.
-
-Fri Oct 20 22:00:43 2006 Akinori MUSHA <knu@iDaemons.org>
-
- * ext/digest/lib/digest/hmac.rb: Complete half-boiled updates.
-
- * ext/digest/sha2/lib/digest/sha2.rb: Fix #initialize_clone().
-
-Fri Oct 20 20:28:37 2006 Akinori MUSHA <knu@iDaemons.org>
-
- * ext/digest: Prefix C constants with RUBY_ and C type names with
- rb_ to avoid name clash in writing extensions.
-
- * ext/digest: Introduce Digest::Class and Digest::Instance for
- ease of implementing subclasses and add-ons, inspired by
- gotoyuzo.
-
- * ext/digest: The Digest::Instance module now requires and assumes
- that any instance be resettable and clonable, and add some
- convenient instance methods such as "new()", for creating a new
- copy, parameter taking "digest()" and "hexdigest()", for instant
- calculation. These methods make digest instances work just like
- digest classes.
-
- * ext/digest/sha2/lib/digest/sha2.rb:
- Add the Digest::SHA2 class to wrap up SHA2 variants: SHA256,
- SHA384 and SHA512, hoping this module would make a decent
- example of a digest subclass written in Ruby.
-
- * ext/digest/lib/digest.rb: Adjust autoload entries for SHA2
- classes.
-
- * ext/digest/lib/digest/hmac.rb: Follow the framework updates.
-
Fri Oct 20 10:47:43 2006 NAKAMURA Usaku <usa@ruby-lang.org>
* lib/mkmf.rb: fixed the bug of handling COMMON_MACROS.
@@ -42844,39 +5745,10 @@ Wed Oct 18 23:02:40 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
* win32/win32.c (rb_w32_utime): allow NULL to set the current time.
[ruby-talk:219248]
-Wed Oct 18 13:25:50 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * string.c (rb_str_each_line): String#lines now works when a block
- is given. in other words, lines become an alias to each_line.
- [ruby-core:09218]
-
- * string.c (rb_str_each_byte): ditto for bytes in place of lines.
-
Wed Oct 18 00:55:33 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
* parse.y (parser_yylex): use particular enums. [ruby-core:09221]
-Tue Oct 17 22:03:08 2006 Minero Aoki <aamine@loveruby.net>
-
- * lib/erb.rb: String#each was removed, use #each_line instead.
-
-Tue Oct 17 12:27:32 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * array.c (ary_shared_array): should set NOEMBED flag for a copied
- array.
-
-Tue Oct 17 08:04:31 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * string.c (rb_str_lines): now takes optional argument for the
- line separator.
-
- * io.c (rb_io_lines, rb_io_bytes): new methods.
-
-Mon Oct 16 23:33:18 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * array.c (rb_ary_unshift_m): a bug in lfree shift length
- calculation.
-
Mon Oct 16 08:30:43 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
* mkconfig.rb: *OBJS are not needed for extension libraries.
@@ -42884,11 +5756,6 @@ Mon Oct 16 08:30:43 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
* {bcc32,wince,win32}/Makefile.sub (config.status): fixed typo,
missing comma.
-Mon Oct 16 00:44:26 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * pack.c (pack_unpack): execute block if given with unpacked value
- instead of creating an array. an idea from Tim Bray.
-
Sun Oct 15 01:03:08 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/test/unit/collector/dir.rb (Collector::Dir#collect): append base
@@ -42908,49 +5775,16 @@ Sat Oct 14 23:25:31 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
contain format specifiers. a patch from Akinori MUSHA <knu at
iDaemons.org>. [ruby-dev:29657]
- * regparse.c (onig_rb_warning, onig_rb_warn): ditto.
-
* ext/bigdecimal/bigdecimal.c (VpException): ditto.
* ext/dl/handle.c (rb_dlhandle_initialize): ditto.
* ext/gdbm/gdbm.c (rb_gdbm_fatal): ditto.
-Sat Oct 14 08:15:42 2006 Akinori MUSHA <knu@iDaemons.org>
-
- * ext/digest/digest.c, ext/digest/digest.h,
- ext/digest/md5/md5init.c, ext/digest/rmd160/rmd160init.c,
- ext/digest/sha1/sha1init.c, ext/digest/sha2/sha2init.c:
- Introduce API versioning.
-
- * ext/digest/digest.c, ext/digest/digest.h,
- ext/digest/md5/md5init.c, ext/digest/rmd160/rmd160init.c,
- ext/digest/sha1/sha1init.c, ext/digest/sha2/sha2init.c: Remove
- the constants DIGEST_LENGTH and BLOCK_LENGTH and turn them into
- instance methods digest_length() and block_length(). Class
- methods with the same names are also provided, which take extra
- parameters for a digest method.
-
- * ext/digest/lib/digest/hmac.rb: Completely redesign the somewhat
- bizarre API, now that Digest classes can take hashing
- parameters.
+Sat Oct 14 08:24:45 2006 Akinori MUSHA <knu@iDaemons.org>
-Sat Oct 14 05:54:05 2006 Akinori MUSHA <knu@iDaemons.org>
-
- * ext/digest/digest.c: Improve RDoc documentation further more.
-
-Sat Oct 14 04:33:33 2006 Akinori MUSHA <knu@iDaemons.org>
-
- * ext/digest/digest.c: Improve RDoc documentation.
-
- * ext/digest/digest.c (Init_digest, rb_digest_base_s_digest,
- rb_digest_base_s_hexdigest): Make Digest::Base::digest() and
- Digest::Base::hexdigest() take extra arguments, which are passed
- through to the constructor in an internal call.
-
- * ext/digest/bubblebabble/bubblebabble.c
- (rb_digest_base_s_bubblebabble): Ditto for
- Digest::Base::bubblebabble().
+ * ext/digest/lib/digest/hmac: Back out the addition of digest/hmac
+ for now because the API is too premature for a stable branch.
Sat Oct 14 00:55:08 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
@@ -42959,58 +5793,20 @@ Sat Oct 14 00:55:08 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
* bcc32/configure.bat: get rid of a quirk of Borland make, which
sets empty macro in command line to "1".
-Fri Oct 13 22:49:02 2006 Tadayoshi Funaba <tadf@dotrb.org>
+Fri Oct 13 22:50:43 2006 Tadayoshi Funaba <tadf@dotrb.org>
* lib/date.rb: updated based on date2 3.9.5.
-Fri Oct 13 21:00:01 2006 Akinori MUSHA <knu@iDaemons.org>
-
- * ext/digest/lib/digest.rb (Digest): Try to auto-load non-standard
- digest modules when a specified digest class is missing.
-
- * ext/digest/lib/digest.rb: Define Digest(name) for ease of
- dynamically selecting a hashing algorithm.
-
-Fri Oct 13 20:53:37 2006 Akinori MUSHA <knu@iDaemons.org>
-
- * ext/digest/digest.c (Init_digest): Digest::Base.new() does no
- longer take an initial string to feed. This change allows
- subclasses to take hashing parameters. A statement such as
- ``md = Digest::MD5.new(s)'' can be easily rewritten as
- ``md = Digest::MD5.new << s'' or
- ``md = Digest::MD5.new.update(s)''.
-
-Fri Oct 13 20:51:55 2006 Akinori MUSHA <knu@iDaemons.org>
-
- * ext/digest/digest.c, ext/digest/md5/md5init.c,
- ext/digest/rmd160/rmd160init.c, ext/digest/sha1/sha1init.c,
- ext/digest/sha2/sha2init.c: Add RDoc documentation.
+Fri Oct 13 22:33:28 2006 Minero Aoki <aamine@loveruby.net>
- * ext/digest/digest.txt, ext/digest/digest.txt.ja: Removed in
- favor of embedded RDoc documentation.
-
-Fri Oct 13 20:38:12 2006 Akinori MUSHA <knu@iDaemons.org>
-
- * ext/digest/bubblebabble, ext/digest/digest.c: Rip BubbleBabble
- support out of the base class and have a separate module named
- digest/bubblebabble.
-
-Fri Oct 13 19:53:59 2006 Akinori MUSHA <knu@iDaemons.org>
-
- * ext/digest/digest.c (rb_digest_base_equal): Again, should call
- digest() of a subclass instead of the one defined in the base
- class.
+ * lib/fileutils.rb (FileUtils.cp_r): dereference_root=true is
+ default in Ruby 1.8. This line is wrongly removed in last commit.
Fri Oct 13 18:19:31 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
* object.c: Class#inherited RDoc added. a patch from Daniel
Berger <djberg96 at gmail.com> [ruby-core:08942]
-Fri Oct 13 02:42:00 2006 Akinori MUSHA <knu@iDaemons.org>
-
- * ext/digest/digest.c (rb_digest_base_equal): Should call digest()
- of a subclass instead of the one defined in the base class.
-
Fri Oct 13 02:30:12 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/test/unit/collector/dir.rb (Collector::Dir#collect): prepend
@@ -43027,13 +5823,6 @@ Fri Oct 13 01:48:42 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
* lib/date.rb (Date::self.complete_hash): need to check if g is
nil before dereference. [ruby-core:09116]
-Fri Oct 13 01:05:58 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * string.c (rb_str_partition): RDoc update. a patch from
- Mauricio Fernandez <mfp at acm.org>. [ruby-core:09160]
-
- * hash.c (rb_hash_compare_by_id): ditto.
-
Fri Oct 13 00:34:26 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
* object.c (rb_mod_cvar_defined): wrong id check. a patch from
@@ -43043,102 +5832,29 @@ Fri Oct 13 00:34:26 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
* object.c (rb_mod_cvar_set): ditto.
-Thu Oct 12 22:58:11 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * hash.c (rb_hash_compare_by_id): somehow we lost renaming from
- Hash#identical. [ruby-core:09163]
+Wed Oct 11 22:21:41 2006 Akinori MUSHA <knu@iDaemons.org>
-Thu Oct 12 18:25:40 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * ext/digest: Merge from trunk; metadata location changed,
+ Digest::Base#reset() added, Digest::Base#equal() changed, and
+ digest/hmac added with some modifications made for ruby 1.8.
- * ext/tk/tkutil/tkutil.c (cbsubst_table_setup): need to handle new
- character literal (1 char string).
+Tue Oct 10 17:24:12 2006 NAKAMURA Usaku <usa@ruby-lang.org>
- * lib/mkmf.rb: shut up some warnings from tk's extconf.rb.
-
-Thu Oct 12 02:15:24 2006 Akinori MUSHA <knu@iDaemons.org>
-
- * ext/digest/lib/digest/hmac.rb: Make use of String#bytes.
-
-Thu Oct 12 02:12:31 2006 Akinori MUSHA <knu@iDaemons.org>
-
- * ext/digest/digest.c (get_digest_base_metadata): Use an instance
- variable of a class object instead of a class variable for
- metadata. This change is only crucial for ruby 1.8 because
- class variables are inherited to subclasses prior to 1.9, but
- applying it also to 1.9 will assure compatibilities.
-
- * ext/digest/md5/md5init.c (Init_md5): Ditto.
-
- * ext/digest/rmd160/rmd160init.c (Init_rmd160): Ditto.
-
- * ext/digest/sha1/sha1init.c (Init_sha1): Ditto.
-
- * ext/digest/sha2/sha2init.c (Init_sha2): Ditto.
-
-Wed Oct 11 21:36:47 2006 Akinori MUSHA <knu@iDaemons.org>
-
- * ext/digest/digest.c (rb_digest_base_alloc,
- rb_digest_base_equal): Simplify the equality check and just
- compare resulted digests since state-level equality should
- not be so significant.
-
- * ext/digest/digest.h: Ditto.
-
- * ext/digest/*/*.[ch]: Ditto.
-
-Wed Oct 11 17:11:03 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (rb_obj_define_method): add half boiled RDoc document.
-
-Wed Oct 11 16:57:46 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * array.c (rb_ary_replace): should shift lfree pointer before
- calling xfree.
-
-Wed Oct 11 15:07:42 2006 Akinori MUSHA <knu@iDaemons.org>
-
- * ext/digest/lib/digest/hmac.rb: Add digest/hmac, which implements
- HMAC keyed-hashing algorithm.
-
-Wed Oct 11 15:03:55 2006 Akinori MUSHA <knu@iDaemons.org>
-
- * ext/digest/digest.c (rb_digest_base_reset): Do not make
- recursive calls, but call initialize() when reset() is not
- defined in a subclass.
-
-Wed Oct 11 14:56:10 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * ext/digest/sha1/sha1ossl.h: libssl 0.9.8c-3 defines no
- SHA_BLOCK_LENGTH.
-
-Wed Oct 11 14:03:31 2006 Akinori MUSHA <knu@iDaemons.org>
-
- * ext/digest/digest.c (rb_digest_base_reset, Init_digest): Add
- Digest::Base#reset.
-
- * ext/digest/digest.h: Update the header comment.
-
- * ext/digest/md5/md5ossl.h, ext/digest/md5/md5init.c (Init_md5):
- Define DIGEST_LENGTH and BLOCK_LENGTH.
-
- * ext/digest/rmd160/rmd160init.c (Init_rmd160): Ditto.
-
- * ext/digest/sha1/sha1init.c (Init_sha1): Ditto.
-
- * ext/digest/sha2/sha2init.c (Init_sha2): Ditto.
-
- * ext/digest/depend, ext/digest/extconf.rb: Use $INSTALLFILES
- rather than adding make targets. [Pointed out by: nobu]
+ * {bcc32,win32,wince}/Makefile.sub (config.status): shouldn't use
+ copy command instead of install. use -run install.
-Tue Oct 10 16:39:08 2006 Akinori MUSHA <knu@iDaemons.org>
+Tue Oct 10 16:49:16 2006 Akinori MUSHA <knu@iDaemons.org>
* ext/digest/digest.c (hexdigest_str_new, bubblebabble_str_new):
Perform StringValue() checks properly.
-Tue Oct 10 13:21:21 2006 Akinori MUSHA <knu@iDaemons.org>
+ * ext/digest/digest.c: Use RSTRING_{PTR,LEN} macros.
+
+Tue Oct 10 13:49:53 2006 Akinori MUSHA <knu@iDaemons.org>
- * ext/digest/sha1/depend, ext/digest/sha2/depend: Remove obsolete
- dependencies.
+ * ext/digest: Merge from trunk; apply all changes since the
+ initial import, except for the removal of compatibility stub
+ libraries (md5.rb and sha1.rb).
Mon Oct 9 23:46:29 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
@@ -43147,11 +5863,6 @@ Mon Oct 9 23:46:29 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
* lib/open3.rb, lib/ping.rb: ditto.
-Mon Oct 9 23:40:58 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/extmk.rb, lib/fileutils.rb, lib/mkmf.rb, lib/optparse.rb,
- lib/shellwords.rb: get rid of shadowing outer local variable.
-
Mon Oct 9 22:56:12 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
* lib/rexml/encoding.rb (REXML::Encoding::check_encoding): spaces
@@ -43159,11 +5870,6 @@ Mon Oct 9 22:56:12 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
* lib/rexml/parsers/baseparser.rb (REXML::Parsers::BaseParser): ditto.
-Mon Oct 9 01:56:34 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (rb_obj_define_method): add new method
- Kernel#define_singleton_method. [ruby-list:42851]
-
Sat Oct 7 23:53:08 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
* string.c (rb_str_scan): small documentation fix.
@@ -43174,95 +5880,15 @@ Sat Oct 7 23:44:33 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
* bignum.c (rb_big_rshift): a bug in right shift of negative
bignums. [ruby-core:09020]
-Sat Oct 7 23:33:02 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (formal_assign): packed post splat arguments may conflict
- with normal arguments. [ruby-core:09021]
-
- * eval.c (rb_call0): ditto.
-
-Sat Oct 7 11:53:04 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * object.c (rb_mod_initialize): since module_eval no longer passes
- self, use module_exec instead. fixed: [ruby-dev:29637]
-
Sat Oct 7 00:27:58 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
* class.c (rb_include_module): remove unnecessary check.
[ruby-talk:218402]
-Fri Oct 6 15:19:59 2006 Akinori MUSHA <knu@iDaemons.org>
-
- * ext/digest/depend: Fix header installation when the build
- directory is different from srcdir. [Pointed out by: eban]
-
-Fri Oct 6 09:56:31 2006 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * {bcc32,win32,wince}/Makefile.sub (config.status): shouldn't use
- copy command instead of install. use -run install.
-
-Fri Oct 6 06:53:46 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (rb_yield_0): small refactoring.
-
- * parse.y (bparam_item): fixed bugs in handling parenthesized LHS.
-
-Fri Oct 6 04:47:07 2006 Akinori MUSHA <knu@iDaemons.org>
-
- * ext/digest/depend: Install digest.h.
-
-Fri Oct 6 04:27:40 2006 Akinori MUSHA <knu@iDaemons.org>
-
- * ext/digest/lib/md5.rb, ext/digest/lib/sha1.rb: Remove those
- compatibility stub libraries.
+Fri Oct 6 04:30:30 2006 Akinori MUSHA <knu@iDaemons.org>
* sample/openssl/c_rehash.rb: Use digest/md5 instead of obsolete md5.
-Fri Oct 6 04:09:51 2006 Akinori MUSHA <knu@iDaemons.org>
-
- * ext/digest/digest.c: Make hexdigest() always call digest() internally.
-
- * ext/digest/digest.c: Add bubblebabble().
-
-Fri Oct 6 02:38:42 2006 Akinori MUSHA <knu@iDaemons.org>
-
- * ext/digest/digest.c: Allow subclassing in Ruby.
-
-Fri Oct 6 02:06:10 2006 Akinori MUSHA <knu@iDaemons.org>
-
- * ext/digest/digest.c (hexdigest_str_new): Add a string size check.
-
-Thu Oct 5 19:28:35 2006 Akinori MUSHA <knu@iDaemons.org>
-
- * ext/digest/digest.[ch]: Since the argument order of
- hash_final_func_t was inconsistent with others, change it and
- rename to hash_finish_func_t to avoid confusion.
-
- * ext/digest/digest.[ch]: Remove and eliminate the use of
- hash_end_func_t. Implement hexdigest conversion in the base
- class.
-
- * ext/digest/md5/md5.c, ext/digest/md5/md5.h,
- ext/digest/md5/md5init.c, ext/digest/md5/md5ossl.c,
- ext/digest/md5/md5ossl.h: Remove MD5_End() and change
- MD5_Final() to MD5_Finish().
-
- * ext/digest/rmd160/depend, ext/digest/rmd160/extconf.rb,
- ext/digest/rmd160/rmd160.c, ext/digest/rmd160/rmd160.h,
- ext/digest/rmd160/rmd160hl.c, ext/digest/rmd160/rmd160init.c,
- ext/digest/rmd160/rmd160ossl.c, ext/digest/rmd160/rmd160ossl.h:
- Remove unused functions RMD160_End(), RMD160_File(),
- RMD160_Data() and change RMD160_Final() to RMD160_Finish().
-
- * ext/digest/sha1/extconf.rb, ext/digest/sha1/sha1.c,
- ext/digest/sha1/sha1.h, ext/digest/sha1/sha1hl.c,
- ext/digest/sha1/sha1init.c, ext/digest/sha1/sha1ossl.c,
- ext/digest/sha1/sha1ossl.h: Likewise.
-
- * ext/digest/sha2/extconf.rb, ext/digest/sha2/sha2.c,
- ext/digest/sha2/sha2.h, ext/digest/sha2/sha2hl.c,
- ext/digest/sha2/sha2init.c: Likewise.
-
Wed Oct 4 18:47:25 2006 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tk/lib/tkextlib/*: bugfix and update
@@ -43273,45 +5899,15 @@ Wed Oct 4 17:25:14 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
* eval.c (rb_call): check protected visibility based on real self,
not ruby_frame->self. [ruby-talk:217822]
-Wed Oct 4 15:46:32 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * parse.y (block_param): should interpret single parenthesized
- left hand side expression.
-
Wed Oct 4 08:52:30 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
* test/optparse/test_getopts.rb: changed the class name of test case
to get rid of conflict with test_optparse.rb.
-Tue Oct 3 21:04:29 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * parse.y (dyna_in_block): inline using macro.
-
- * parse.y (mlhs): simplifies the rule a bit.
-
- * parse.y (block_param): restrict block parameters to be local
- variables only.
+Tue Oct 3 23:32:27 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * test/ruby/test_iterator.rb (TestIterator::test_nested_iterator):
- update test suite to conform the last change.
-
-Tue Oct 3 02:31:13 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (splat_value): use "to_splat" instead of "to_ary" to
- prepare splat values as an array.
-
- * array.c (Init_Array): define to_splat.
-
- * range.c (range_to_splat): new method.
-
- * enumerator.c (enumerator_to_splat): ditto.
-
-Tue Oct 3 01:36:47 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * string.c (rb_str_lines): returns an Enumerator instead of an
- array of lines.
-
- * string.c (rb_str_bytes): a new method.
+ * lib/test/unit/testcase.rb (Test::Unit::TestCase.suite): test name
+ must be string. fixed: [ruby-core:08978]
Mon Oct 2 23:47:55 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
@@ -43323,7 +5919,7 @@ Mon Oct 2 23:47:55 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/test/unit/collector/dir.rb (Test::Unit::Collector::Dir#collect_file):
load expanded path. fixed: [ruby-dev:29621]
-Mon Oct 2 15:47:55 2006 NAKAMURA Usaku <usa@ruby-lang.org>
+Mon Oct 2 15:49:19 2006 NAKAMURA Usaku <usa@ruby-lang.org>
* instruby.rb: batfile should be CRLF'ed.
@@ -43347,15 +5943,10 @@ Sun Oct 1 23:12:19 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/optparse.rb (OptionParser#make_switch): pass arguments directly.
-Sat Sep 30 15:11:26 2006 Tadayoshi Funaba <tadf@dotrb.org>
+Sat Sep 30 15:12:25 2006 Tadayoshi Funaba <tadf@dotrb.org>
* lib/date.rb, lib/date/format.rb: updated based on date2 3.9.4.
-Fri Sep 29 13:18:24 2006 Akinori MUSHA <knu@iDaemons.org>
-
- * ext/digest/lib/digest.rb (Digest): Require digest.so and fix the
- breakage. Point out by NAKAMURA Usaku in [ruby-dev:29619].
-
Fri Sep 29 12:11:04 2006 WATANABE Hirofumi <eban@ruby-lang.org>
* jcode.rb (succ!): call original succ! if $KCODE == 'n'.
@@ -43380,60 +5971,22 @@ Thu Sep 28 23:59:31 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
win32 regardless if it is implemented. Provisional fix for
[ruby-core:08917].
-Thu Sep 28 20:49:20 2006 NAKAMURA Usaku <usa@ruby-lang.org>
+Thu Sep 28 20:53:16 2006 NAKAMURA Usaku <usa@ruby-lang.org>
* lib/tmpdir.rb: use return value of getdir.call for length.
-Wed Sep 27 22:08:16 2006 Akinori MUSHA <knu@iDaemons.org>
-
- * ext/digest/md5/md5init.c (Init_md5): Now that we have digest.rb,
- require "digest" rather than "digest.so".
-
- * ext/digest/rmd160/rmd160init.c (Init_rmd160): Ditto.
-
- * ext/digest/sha1/sha1init.c (Init_sha1): Ditto.
-
- * ext/digest/sha2/sha2init.c (Init_sha2): Ditto.
-
-Wed Sep 27 21:21:08 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * string.c (rb_str_startwith): rename startwith? to start_with?,
- endwith? to endwith?, respectively. [ruby-talk:216685]
-
-Wed Sep 27 13:29:01 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/cgi.rb (CGI::TagMaker::nOE_element_def): replace to_s by
- join. some other methods as well. [ruby-dev:29613]
-
Wed Sep 27 01:04:49 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/mkmf.rb (try_func): check function pointer first and macro next.
* lib/mkmf.rb (have_type): simplified with typedef and sizeof.
-Wed Sep 27 00:08:12 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * array.c (rb_ary_shift): shift/unshift performance boost patch,
- based on the patch from Eric Mahurin <eric_mahurin at yahoo.com>.
- [ruby-core:05861]
-
- * array.c (rb_ary_unshift_m): ditto.
-
- * array.c (ary_make_shared): ditto.
-
- * array.c (RESIZE_CAPA): ditto.
-
- * array.c (rb_ary_free): new function to free memory. code moved
- from gc.c.
-
- * string.c (rb_str_free): ditto.
-
Tue Sep 26 23:57:03 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/optparse.rb (OptionParser#getopts): use strings as key.
fixed: [ruby-dev:29614]
-Tue Sep 26 15:29:55 2006 NAKAMURA Usaku <usa@ruby-lang.org>
+Tue Sep 26 15:31:26 2006 NAKAMURA Usaku <usa@ruby-lang.org>
* {win32,wince}/Makefile.sub (CPP): check predefined value.
@@ -43443,38 +5996,13 @@ Tue Sep 26 07:55:16 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
body is shared. a patch from Kent Sibilev <ksruby at gmail.com>.
[ruby-core:08922]
-Mon Sep 25 23:10:46 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * dir.c (rb_push_glob): need not to check by FilePathValue().
- [ruby-dev:29599]
-
- * dir.c (dir_globs): ditto.
-
Mon Sep 25 22:26:26 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
* file.c (rb_path_end): skip root directory. fixed: [ruby-core:08913]
- * lib/mkmf.rb (rm_f): get rid of NUL.
-
* lib/mkmf.rb (init_mkmf): set default $LDFLAGS. Patch by Michal
Suchanek <hramrach at centrum.cz>. [ruby-talk:216256]
-Mon Sep 25 15:06:18 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * sample/test.rb: "print nil" now prints empty string.
-
- * test/ruby/test_system.rb (TestSystem::test_system): ditto.
-
-Mon Sep 25 11:26:25 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * hash.c (recursive_hash): remove unused local variable.
-
- * parse.y (parser_yylex): ditto.
-
- * parse.y (rb_gc_mark_symbols): fix unmatched prototype .
-
- * file.c (rb_get_path): check NUL byte in the path string.
-
Mon Sep 25 08:14:43 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
* array.c (rb_ary_shift): should clear shifting top element.
@@ -43488,25 +6016,19 @@ Mon Sep 25 08:11:35 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
* random.c (rb_f_rand): RDoc typo fix. a patch from Frederick
Cheung <fred at 82ask.com>. [ruby-talk:216047]
-Sun Sep 24 21:19:24 2006 Guy Decoux <ts@moulon.inra.fr>
-
- * gc.c (gc_mark_children): NODE_POSTEXE holds Ruby VALUE.
- [ruby-core:08912]
-
Sun Sep 24 22:28:20 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
* runruby.rb: extension library scripts moved into common directory.
-Sun Sep 24 12:10:04 2006 Tadayoshi Funaba <tadf@dotrb.org>
+Sun Sep 24 14:59:50 2006 Tanaka Akira <akr@fsij.org>
- * lib/date.rb, lib/date/format.rb: updated based on date2 3.9.3.
+ * node.h (struct thread): ia64 support is broken by sandbox patch.
-Sun Sep 24 06:55:36 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun Sep 24 12:11:16 2006 Tadayoshi Funaba <tadf@dotrb.org>
- * io.c (rb_io_print): no special handling for nil as well as puts.
- fixed: [ruby-dev:29586]
+ * lib/date.rb, lib/date/format.rb: updated based on date2 3.9.3.
-Sun Sep 24 06:25:53 2006 why the lucky stiff <why@ruby-lang.org>
+Sat Sep 23 23:24:57 2006 why the lucky stiff <why@ruby-lang.org>
* eval.c (rb_thread_save_context, rb_thread_restore_context):
sandbox hook to save and restore sandbox state.
@@ -43515,7 +6037,7 @@ Sun Sep 24 06:25:53 2006 why the lucky stiff <why@ruby-lang.org>
* eval.c (rb_thread_kill_bang): Thread#kill! uses the above flag
to circumvent ensure, in order to prevent endless loops.
- contributed by MenTaLguY. [ruby-core:08768]
+ [ruby-core:08768]
* eval.c (rb_thread_kill): fix Thread#kill docs, which returns
the thread object in all cases.
@@ -43530,40 +6052,14 @@ Sat Sep 23 21:34:15 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
* lib/cgi.rb (CGI::QueryExtension::read_multipart): CGI content
may be empty. a patch from Jamis Buck <jamis at 37signals.com>.
-Sat Sep 23 20:54:28 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
-
- * oniguruma.h: Version 4.4.4
-
- * regexec.c: ditto.
-
- * regcomp.c ditto.
-
Sat Sep 23 08:35:53 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
* lib/rdoc/ri/ri_options.rb: prevent NameError. [ruby-dev:29597]
-Sat Sep 23 01:02:57 2006 Tadayoshi Funaba <tadf@dotrb.org>
+Sat Sep 23 01:04:20 2006 Tadayoshi Funaba <tadf@dotrb.org>
* lib/date.rb, lib/date/format.rb: updated based on date2 3.9.2.
-Fri Sep 22 18:07:17 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * string.c (rb_str_partition): no need to call rb_call_super(),
- since String is no longer includes Enumerable.
-
-Fri Sep 22 17:33:29 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * hash.c (rb_hash_eql): new method to be used by Hash.
-
- * hash.c (rb_hash_hash): ditto.
-
-Fri Sep 22 06:53:22 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * bignum.c (rb_big_hash): use rb_memhash().
-
- * numeric.c (flo_hash): simplified. klass need not to affect
- resulting hash value.
-
Fri Sep 22 02:06:26 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
* .cvsignore: ignore timestamp files and installed list file.
@@ -43572,11 +6068,6 @@ Fri Sep 22 01:36:34 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
* instruby.rb: include FileUtils unconditionally.
-Fri Sep 22 00:36:05 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * numeric.c (Init_Numeric): fix_odd_p and fix_even_p are for Fixnum.
- patch from Ondrej Bilka <neleai at seznam.cz>. [ruby-core:08904]
-
Thu Sep 21 22:56:20 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
* common.mk (no-install): not install rdoc actually.
@@ -43587,51 +6078,14 @@ Thu Sep 21 22:56:20 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ext/extmk.rb: expand ruby executable names.
-Thu Sep 21 20:19:22 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * string.c (str_new3): embed shorter strings more eagerly.
-
-Thu Sep 21 17:44:49 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * string.c (rb_str_startwith): a new method to check if a string
- starts with given prefix.
-
- * string.c (rb_str_endwith): the opposite of String#startwith?.
-
-Thu Sep 21 16:29:02 2006 WATANABE Hirofumi <eban@ruby-lang.org>
-
- * rubytest.rb: use each_line instead of each.
-
-Thu Sep 21 15:06:24 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * numeric.c (int_odd_p): a new method to check even or odd.
- [RCR#337]
-
- * numeric.c (int_even_p): ditto.
-
Thu Sep 21 13:55:07 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
- * ext/etc/etc.c (etc_getpwuid): uid integer should be wrapped in
+ * ext/etc/etc.c (etc_getpwuid): uid integer should be wraped in
uid_t value. [ruby-core:08897]
* ext/etc/etc.c (etc_getpwuid): uid_t may be bigger than plain
'int' type.
-Thu Sep 21 10:07:09 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * string.c (rb_str_partition): RDoc typo fixed. [ruby-core:08898]
-
- * string.c (rb_str_rpartition): fixed separation seek bug.
-
-Thu Sep 21 09:38:12 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * string.c (rb_str_lines): new method to split a string into lines.
-
- * string.c (Init_String): Strings are no longer Enumerable. use
- each_line or lines method explicitly.
-
- * string.c (Init_String): remove each method. use each_lines.
-
Wed Sep 20 23:17:41 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
* common.mk (pre-install-doc): create data directory before install.
@@ -43640,19 +6094,7 @@ Wed Sep 20 23:17:41 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/mkmf.rb (install_dirs): remove extra slash.
-Wed Sep 20 22:41:45 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * numeric.c (fix_mul): typo again. patch from Tadashi Saito
- <shiba at mail2.accsnet.ne.jp>. fixed: [ruby-core:08893]
-
-Wed Sep 20 19:32:06 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * string.c (rb_str_partition): a new method to separate the string
- by a separator. taken from Python 2.5.
-
- * string.c (rb_str_rpartition): ditto.
-
-Wed Sep 20 09:49:40 2006 NAKAMURA Usaku <usa@ruby-lang.org>
+Wed Sep 20 09:53:38 2006 NAKAMURA Usaku <usa@ruby-lang.org>
* {bcc32,win32,wince}/Makefile.sub (INSTALLED_LIST): need to define
this macro to install.
@@ -43660,7 +6102,7 @@ Wed Sep 20 09:49:40 2006 NAKAMURA Usaku <usa@ruby-lang.org>
Wed Sep 20 09:43:10 2006 Shugo Maeda <shugo@ruby-lang.org>
* lib/net/imap.rb: allow extra spaces in responses.
- Thanks, Tom Soderlund.
+ Thanks, Tom Soderlund. (backported from HEAD)
Wed Sep 20 09:25:39 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
@@ -43668,6 +6110,13 @@ Wed Sep 20 09:25:39 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
Adolphs <futzilogik at users dot sourceforge dot net>.
[ruby-doc:1223]
+Tue Sep 19 01:28:00 2006 Minero Aoki <aamine@loveruby.net>
+
+ * lib/fileutils.rb: backport from HEAD (rev 1.71).
+
+ * lib/fileutils.rb (FileUtils.cp_r): new option
+ :remove_destination.
+
Tue Sep 19 00:42:15 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
* object.c (rb_obj_ivar_defined, rb_mod_cvar_defined): new methods,
@@ -43679,42 +6128,6 @@ Tue Sep 19 00:42:15 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
defined. fixed: [ruby-dev:29554]
-- This didn't fix anything.
-Tue Sep 19 00:07:17 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * string.c (sym_eql): fail early to gain performance.
-
- * string.c (sym_hash): cache hash value in aux.shared if possible.
-
- * gc.c (rb_obj_id): no need to treat symbols specially.
-
- * lib/fileutils.rb (FileUtils::FileUtils): singleton_methods() no
- longer return an array of strings, but of symbols.
-
- * lib/delegate.rb (DelegateClass): ditto.
-
-Mon Sep 18 15:29:21 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * dir.c (dir_s_glob): restore GC protection volatile variable.
- [ruby-dev:29588]
-
- * re.c (rb_reg_regcomp): ditto.
-
-Mon Sep 18 12:16:48 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * numeric.c (fix_mul): get rid of shift overflow.
-
-Mon Sep 18 10:47:49 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * dir.c (dir_s_glob): remove unused variable.
-
- * math.c (math_log): ditto.
-
- * re.c (rb_reg_regcomp): ditto.
-
- * eval.c (break_jump): ditto.
-
- * eval.c (rb_thread_yield_0): remove unused function.
-
Sun Sep 17 23:44:58 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/rdoc/rdoc.rb (RDoc::RDoc#document): scan only files modified
@@ -43728,18 +6141,11 @@ Sun Sep 17 17:42:13 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/rdoc/generators/ri_generator.rb: do not chdir twice.
-Sun Sep 17 10:42:10 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * numeric.c (fix_mul): fixed typo. fixed: [ruby-core:08885]
+Sat Sep 16 23:14:29 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-Sat Sep 16 19:47:16 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * ext/pty/pty.c (establishShell): remove remaining unused line.
- * README.EXT: should mention new macros: RSTRING_PTR, RSTRING_LEN,
- RARRAY_PTR, RARRAY_LEN.
-
- * README.EXT.ja: ditto.
-
-Sat Sep 16 16:39:23 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat Sep 16 16:40:44 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
* Makefile.in, common.in, instruby.rb, ext/extmk.rb, lib/mkmf.rb:
use instruby.rb to install extensions instead of ext/extmk.rb.
@@ -43754,53 +6160,9 @@ Sat Sep 16 16:39:23 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ext/pty/pty.c (freeDevice): not used.
- * lib/mkmf.rb (checking_for): improved the messages.
-
-Sat Sep 16 11:03:49 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * array.c (ary_shared_first): should create embedded copies
- instead of sharing memory region for smaller arrays.
-
-Sat Sep 16 09:37:39 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * struct.c (inspect_struct): do not display a class name for
- anonymous struct. The member fields are sufficient.
-
-Fri Sep 15 20:22:15 2006 NARUSE, Yui <naruse@ruby-lang.org>
-
- * ext/nkf/nkf-8/nkf.c: imported nkf 2.0.8 rev.110.
- * Fix: check_bom cuts \xfe\xff\xXX\xXX of UTF-32LE.
- * Add support --ic=UTF-32.
- * Fix: can't guess UTF-16 and UTF-32.
- * Fix: can't decode beyond BMP of UTF-16LE.
-
- * ext/nkf/nkf.c (guess): Support UTF-32.
-
- * ext/nkf/lib/kconv.rb (kconv): Support UTF-32.
-
- * ext/nkf/lib/kconv.rb (to_utf32): new method.
-
-Fri Sep 15 05:23:24 2006 NARUSE, Yui <naruse@ruby-lang.org>
-
- * ext/nkf/nkf-8/nkf.c: imported nkf 2.0.8 2006-09-15.
- Add support for U+10000 - U+10FFFF
- Add support UTF-32
-
-Fri Sep 15 00:03:07 2006 Tanaka Akira <akr@fsij.org>
+ * ext/pty/pty.c (get_device_once): removed garbage right brace.
- * ext/digest/lib/digest.rb (Digest::Base.file): open a file in binary
- mode. suggested by Kazuhiro NISHIYAMA. [ruby-dev:29579]
-
-Thu Sep 14 17:21:07 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * numeric.c (fix_mul): avoid bignum multiplication as far as
- possible. a patch from Ondrej Bilka <neleai at seznam.cz>.
- [ruby-core:08825]
-
-Thu Sep 14 16:34:55 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * string.c (rb_str_intern): allow zero length symbols.
- [ruby-core:08861]
+ * lib/mkmf.rb (checking_for): improved the messages.
Thu Sep 14 16:11:15 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
@@ -43810,27 +6172,7 @@ Thu Sep 14 16:11:15 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
* parse.y (rb_interned_p): new function to check if a string is
already interned.
- * string.c (str_to_id): use rb_str_intern().
-
-Thu Sep 14 14:37:45 2006 Tanaka Akira <akr@fsij.org>
-
- * ext/digest/lib/digest.rb (Digest::Base.file): new method.
- [ruby-dev:29572]
-
-Thu Sep 14 08:30:02 2006 Tanaka Akira <akr@fsij.org>
-
- * ext/digest/digest.c (rb_digest_base_inspect): new method.
- [ruby-dev:29573]
-
-Thu Sep 14 01:13:56 2006 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * gc.c (ruby_init_stack): decrease "stack level too deep" in Windows.
- [ruby-dev:29569]
-
-Thu Sep 14 01:02:25 2006 Tanaka Akira <akr@fsij.org>
-
- * ext/digest/lib/digest.rb: new file.
- [ruby-dev:28689]
+ * object.c (str_to_id): use rb_str_intern().
Wed Sep 13 18:43:05 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
@@ -43847,74 +6189,28 @@ Wed Sep 13 16:43:36 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
* string.c (rb_str_intern): prohibit interning tainted string.
-Wed Sep 13 01:14:02 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Sep 13 01:14:21 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/optparse.rb (OptionParser#getopts): works with pre-registered
options. [ruby-core:08826]
-Tue Sep 12 03:58:39 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * hash.c (rb_hash_compare_by_identity): rename Hash#identical to
- Hash#compare_by_identity.
-
-Mon Sep 11 16:52:37 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * hash.c (rb_hash_identical): a new method to make a hash to
- compare keys by their identity.
-
- * hash.c (rb_hash_identical_p): new method to tell if a hash is
- identical or not.
-
- * st.c (st_numcmp, st_numhash): export hash type functions.
-
-Mon Sep 11 11:42:21 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/rexml/source.rb (REXML::Source::encoding): should not
- convert the body twice. [ruby-core:08828]
-
- * lib/rexml/encoding.rb (REXML::Encoding::encoding):
- Encoding#encoding= to return boolean value to tell if the body
- is really converted or not.
-
- * lib/rexml/encoding.rb (REXML::Encoding::encoding): Specific
- conversion library (e.g. rexml/encodings/UTF-16.rb) to have
- higher preceding.
-
- * lib/rexml/encodings/UTF-16.rb (REXML::Encoding::decode_utf16):
- UTF-16#decode_utf16 should work strings without BOM.
-
-Mon Sep 11 07:39:44 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * string.c (sym_equal): "sym == str" should compare them as
- strings. [ruby-dev:29554]
-
-Sun Sep 10 22:59:43 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * instruby.rb (parse_args): remove splat.
-
-Sun Sep 10 20:25:30 2006 Tadayoshi Funaba <tadf@dotrb.org>
+Sun Sep 10 20:27:13 2006 Tadayoshi Funaba <tadf@dotrb.org>
* lib/date.rb, lib/date/format.rb: updated based on date2 3.9.1.
-Sun Sep 10 09:41:29 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * file.c: ISPRINT() needs ctype.h
-
-Sun Sep 10 09:19:47 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/optparse.rb: splat parsed arguments.
-
Tue Jan 10 09:18:03 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * eval.c (stack_extend): fixed prototype.
+
* eval.c (rb_require_safe): prevent extension from loading twice.
fixed: [ruby-dev:29523]
-Sat Sep 9 23:55:28 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+Sat Sep 9 23:50:38 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
- * file.c (rb_f_test): test(0) should not have any special
- meaning. [ruby-dev:29425]
+ * bignum.c (rb_big_mul0): bignum multiplication without
+ normalization.
- * file.c (rb_f_test): properer error message.
+ * bignum.c (rb_big_pow): use rb_big_mul0(). [ruby-dev:29547]
Sat Sep 9 14:08:38 2006 Eric Hodel <drbrain@segment7.net>
@@ -43926,29 +6222,18 @@ Sat Sep 9 04:55:59 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/pstore.rb: open all in binary mode, and get rid of the quirk of
msvcrt. fixed: [ruby-dev:29518]
-Sat Sep 9 04:47:45 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat Sep 9 04:54:42 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
* Makefile.in, win32/Makefile.sub (MINIRUBY): append MINIRUBYOPT.
* mkconfig.rb, ext/extmk.rb, lib/mkmf.rb, win32/mkexports.rb: suppress
warnings with $VERBOSE.
- * win32/resource.rb: only file which has more than one icon is DLL.
-
-Fri Sep 8 16:53:30 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * string.c (str_alloc): should allocate a String object, even when
- asked to allocate a Symbol object. [ruby-dev:29529]
-
-Fri Sep 8 16:36:27 2006 NAKAMURA Usaku <usa@ruby-lang.org>
+ * ext/extmk.rb: Proc#call does not pass the block in 1.8.
- * ext/extmk.rb (extmake): follow Array#to_s.
+ * win32/resource.rb: add more info.
- * lib/mkmf.rb (create_makefile): ditto.
-
- * win32/resource.rb: ditto.
-
-Fri Sep 8 10:00:12 2006 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Fri Sep 8 10:03:59 2006 GOTOU Yuuzou <gotoyuzo@notwork.org>
* lib/webrick/cookie.rb (WEBrick::Cookie.parse_set_cookies): new
method to parse multiple cookies per Set-Cookie header.
@@ -43960,62 +6245,33 @@ Fri Sep 8 08:59:30 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
* win32/Makefile.sub, win32/configure.bat win32/setup.mak: program
name transform.
-Fri Sep 8 08:25:39 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/optparse.rb: suppress `assigning void value' warning.
-
-Fri Sep 8 01:16:34 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+Fri Sep 8 01:33:08 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
- * array.c (Init_Array): #to_s to be an alias to #inspect.
- [ruby-dev:29520]
+ * ruby.h (RSTRING_PTR): add migration macro.
- * hash.c (Init_Hash): ditto.
-
- * lib/mkmf.rb (create_makefile): replace "print array" by
- "print *array".
-
- * mkconfig.rb: ditto.
-
-Thu Sep 7 21:02:56 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * object.c (nil_to_s): returns the empty string again.
- [ruby-dev:29520]
+ * ruby.h (RARRAY_PTR): ditto.
Thu Sep 7 23:27:05 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
* file.c (path_check_0, fpath_check): disable path check on cygwin.
[ruby-talk:213074]
-Thu Sep 7 02:03:45 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * time.c (time_to_s): adopt new date format using digits
- e.g. "2006-09-07 02:03:45 +9000".
-
-Thu Sep 7 01:54:22 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+Wed Sep 06 12:05:19 2006 NARUSE, Yui <naruse@ruby-lang.org>
- * string.c (sym_equal): override. check equivalence.
-
-Wed Sep 6 13:25:04 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * parse.y (symbols_i): need to initialize early-created symbols.
- [ruby-dev:29496]
-
-Wed Sep 6 12:05:19 2006 NARUSE, Yui <naruse@ruby-lang.org>
+ * ext/nkf/lib/kconv.rb (Kconv::RegexpEucjp): fix regexp for euc-jp
+ [ruby-dev:29344]
* ext/nkf/lib/kconv.rb (Kconv::toeuc): remove -m0 [ruby-dev:29505]
-Tue Sep 5 22:06:43 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/tk/tcltklib.c: use rb_ary_new3() since RARRAY_LEN() is not l-value.
-
- * ext/tk/tkutil/tkutil.c: use RARRAY_PTR() and RARRAY_LEN() and etc.
- fixed: [ruby-dev:29473]
-
Tue Sep 5 06:47:22 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
* time.c (time_to_s): variable declaration after an execution
statement.
+Tue Sep 5 05:56:51 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * numeric.c (flo_hash): improve collision. fixed: [ruby-dev:29352]
+
Tue Sep 5 05:49:41 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
* file.c (path_check_0): check if sticky bit is set on parent
@@ -44042,7 +6298,7 @@ Mon Sep 4 21:43:57 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ext/dbm/extconf.rb: create makefile according to the result of check
for dbm header. fixed: [ruby-dev:29445]
-Mon Sep 4 21:39:42 2006 Tadayoshi Funaba <tadf@dotrb.org>
+Mon Sep 4 21:42:35 2006 Tadayoshi Funaba <tadf@dotrb.org>
* lib/date.rb, lib/date/format.rb: updated based on date2 3.9.
@@ -44050,37 +6306,21 @@ Mon Sep 4 21:14:20 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
* time.c (time_strftime): include nul character. fixed: [ruby-dev:29422]
-Mon Sep 4 16:39:11 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/cgi.rb (CGI::out): specify -x option for nkf.
-
- * lib/cgi.rb (CGI::out): should not convert utf-8 implicitly using
- NKF. it is too Japanese centric.
-
-Mon Sep 4 14:23:10 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * ext/dbm/extconf.rb (db_check): remove debug print.
-
-Mon Sep 4 06:46:08 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * parse.y (rb_id2sym): intern if id is attrset_id.
- [ruby-dev:29420] [ruby-dev:29447]
-
-Mon Sep 4 01:25:16 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+Mon Sep 4 16:29:33 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
- * eval.c (rb_f_local_variables): list symbols.
+ * lib/cgi.rb (CGI::out): specify -m0 -x option for nkf.
+ [ruby-dev:29284]
- * struct.c (rb_struct_s_members_m): ditto.
+Mon Sep 4 16:13:23 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
- * variable.c (ivar_i): ditto.
+ * io.c (pipe_open): command name should not contain null bytes.
+ [ruby-dev:29421]
- * variable.c (gvar_i): ditto.
+ * process.c (proc_spawn): ditto.
- * variable.c (cv_i): ditto.
+ * process.c (proc_spawn_n): ditto.
-Sun Sep 3 20:47:02 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ruby.h (SYMBOL_P): Qnil and Qfalse are not Symbol.
+ * process.c (rb_f_system): ditto.
Sun Sep 3 15:32:44 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
@@ -44096,279 +6336,95 @@ Sun Sep 3 04:40:42 2006 Tanaka Akira <akr@fsij.org>
* ext/socket/socket.c: include arpa/inet.h if available.
-Sat Sep 2 23:59:58 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * string.c (Init_String): undef Symbol#new.
-
- * struct.c (rb_struct_s_def): wrong symbol detection.
-
-Sat Sep 2 23:59:37 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * string.c (str_to_id): a bug caused by premature optimization.
-
-Sat Sep 2 23:53:28 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * object.c (Init_Object): move symbol related code to string.c
-
- * string.c (Init_String): Symbol as subclass of String.
-
- * parse.y (rb_intern2): handle symbol as strings.
-
- * string.c (str_new): substring of symbols are mere strings, not
- symbols.
+Sun Sep 3 02:34:55 2006 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
-Sat Sep 2 23:37:29 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * lib/drb/unix.rb (DRbUNIXSocket#close): don't get path if client mode.
+ [ruby-dev:29417]
- * ruby.h (struct RArray): embed small arrays.
- (RARRAY_LEN): defined for accessing array members.
- (RARRAY_PTR): ditto.
+Sun Sep 3 01:45:17 2006 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
- * array.c: use RARRAY_LEN and RARRAY_PTR.
+ * lib/drb/acl.rb (ACLEntry#initialize): examine whether '*' is
+ included before IPAddr.new. [ruby-dev:29406]
Sat Sep 2 13:23:01 2006 Tanaka Akira <akr@fsij.org>
* common.mk (ia64.o): use the compiler driver to assemble ia64.s
to use appropriate ABI.
-Sat Sep 2 12:06:35 2006 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
-
- * lib/soap/generator.rb (SOAP::SOAPGenerator#encode_tag): do not dump
- XML attribute which value is nil. value "" and nil both were dumped
- as 'attr="value"'. [ruby-dev:29395]
-
-Sat Sep 2 12:00:32 2006 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
-
- * lib/csv.rb (CSV::IOReader#initialize): use String#[](pos, len)
- instead of String#[](idx) to check utf BOM. follows String#[](idx)
- behavior change of 1.9.
-
-Sat Sep 2 11:47:58 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (rb_eval): should handle when in else clause. a patch
- from Eric Hodel <drbrain at segment7.net>. [ruby-core:08662]
-
- * parse.y (primary): wrap with NODE_CASE. [ruby-core:08663]
-
-Fri Sep 1 22:07:04 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * ruby.h (RSTRING_EMBED_LEN_MASK): uses 5 bits to support 64bit
- environment. [ruby-dev:29369]
-
-Fri Sep 1 22:02:08 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * string.c (rb_str_resize): should copy embedded string to
- malloc'ed buffer. a patch from <nobu at ruby-lang.org> in
- [ruby-dev:29369]. fixed: [ruby-dev:29368]
+Sat Sep 2 03:36:22 2006 Tanaka Akira <akr@fsij.org>
- * string.c (rb_str_ord): use %ld specifier since STRING_LEN() is a
- long. [ruby-dev:29369]
-
-Fri Sep 1 21:41:12 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * ext/socket/socket.c (socks_init): typo fixed. a patch from Sven
- Klemm <sven at c3d2.de>. [ruby-core:08770]
-
-Fri Sep 1 14:22:42 2006 WATANABE Hirofumi <eban@ruby-lang.org>
-
- * array.c (rb_ary_shuffle): RDoc fixed.
+ * common.mk, configure.in, defines.h, eval.c, gc.c, main.c,
+ numeric.c, ruby.h, ia64.s: backport IA64 HP-UX support.
Fri Sep 1 13:52:57 2006 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tk/lib/tk/font.rb: TkFont#current_configinfo() doesn't work
on Tcl/Tk8.x.
-Fri Sep 1 09:32:55 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/irb/ruby-lex.rb (RubyLex::getc): should not push nil into
- reading buffer (@readed). reported in
- <http://jarp.does.notwork.org/diary/200608c.html#200608311>.
-
-Thu Aug 31 23:59:03 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/mkmf.rb (configuration): follow nil.to_s.
-
-Thu Aug 31 20:50:46 2006 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * lib/mkmf.rb (create_makefile): follow nil.to_s.
-
- * win32/resource.rb: ditto.
-
-Thu Aug 31 20:21:47 2006 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * eval.c (search_required): use RSTRING_PTR and RSTRING_STR.
-
- * file.c (test_identical, rb_file_s_truncate): ditto.
-
- * io.c (pipe_open, rb_io_reopen): ditto.
-
- * object.c (nil_plus): ditto.
-
- * process.c (proc_spawn_n, rb_spawn): ditto.
-
- * util.c (ruby_add_suffix): ditto.
-
- * ext/Win32API/Win32API.c (Win32API_initialize): ditto.
-
- * ext/dl/cptr.c (rb_dlptr_s_to_ptr): ditto.
-
- * ext/openssl/ossl_x509ext.c (ossl_x509extfactory_create_ext): ditto.
-
- * ext/tk/stubs.c, ext/tk/tcltklib.c, ext/tk/tkutil/tkutil.c: ditto.
-
- * ext/win32ole/win32ole.c (ole_val2olevariantdata): ditto.
-
-Thu Aug 31 18:23:00 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * ruby.h (struct RString): embed small strings.
- (RSTRING_LEN): defined for accessing string members.
- (RSTRING_PTR): ditto.
-
- * string.c: use RSTRING_LEN and RSTRING_PTR.
-
-Thu Aug 31 17:16:19 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * array.c (rb_ary_shuffle_bang): new method.
-
- * array.c (rb_ary_shuffle): ditto.
-
- * random.c (genrand_real): ditto.
-
- * random.c (genrand_int32): export the function.
-
- * random.c (Init_Random): initialize random seed at the
- beginning.
-
-Thu Aug 31 13:12:06 2006 why the lucky stiff <why@ruby-lang.org>
+Thu Aug 31 12:46:55 2006 why the lucky stiff <why@ruby-lang.org>
* eval.c (ruby_init): rename top_cref to ruby_top_cref and export,
along with ruby_cref, for use by the sandbox. [ruby-core:08762]
* node.h: ditto.
-Wed Aug 30 12:01:57 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * numeric.c (flo_hash): improve collision.
-
- * string.c (rb_memhash): new generic function to calculate hash value
- for memory chunk.
-
Tue Aug 29 19:10:10 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
* hash.c (rb_hash_s_create): fixed memory leak, based on the patch
by Kent Sibilev <ksruby at gmail.com>. fixed: [ruby-talk:211233]
-Mon Aug 28 11:29:46 2006 Eric Hodel <drbrain@segment7.net>
+Mon Aug 28 11:36:02 2006 Eric Hodel <drbrain@segment7.net>
- * eval.c, parse.y: Revert.
- * ext/.document: Add digest.c.
- * ext/digest/digest.c: Make RDoc show up.
- * ext/io/wait.c: Fix call-seq in RDoc.
-
-Mon Aug 28 08:03:20 2006 Eric Hodel <drbrain@segment7.net>
-
- * ext/.document: Add C files with RDoc.
- * ext/digest/digest.c: Convert to RDoc.
- * ext/io/wait.c: ditto.
* lib/rdoc/parsers/parse_rb.rb: Fix typo. Submitted by
<calamitas at gmail.com>. [ruby-core:08724]
-Mon Aug 28 07:21:47 2006 Eric Hodel <drbrain@segment7.net>
-
- * file.c (File#size?): Fix documentation submitted by Rick Ohnemus.
- ruby-Bugs-5529. [ruby-core:08725]
-
-Sun Aug 27 21:41:23 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
-
- * oniguruma.h: Version 4.4.0
-
- * regint.h: ditto.
+Mon Aug 28 07:53:44 2006 Eric Hodel <drbrain@segment7.net>
- * regparse.h: ditto.
-
- * regexec.c: ditto.
+ * lib/rdoc/ri/ri_formatter.rb: Don't unescape HTML in HtmlFormatter.
+ Submitted by Kent Sibilev <ksruby at gmail.com>. [ruby-core:08392].
- * regcomp.c ditto.
+Mon Aug 28 07:25:45 2006 Eric Hodel <drbrain@segment7.net>
- * regparse.c: ditto.
+ * file.c (File#size?): Fix documentation submitted by Rick Ohnemus.
+ ruby-Bugs-5529. [ruby-core:08725]
-Sat Aug 26 08:03:03 2006 Tadayoshi Funaba <tadf@dotrb.org>
+Sat Aug 26 08:07:13 2006 Tadayoshi Funaba <tadf@dotrb.org>
* lib/date.rb, lib/date/format.rb: updated based on date2 3.8.2.
-Fri Aug 25 21:15:22 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
-
- * common.mk: add regint.h and oniguruma.h to dependence.
-
- * ext/strscan/depend: ditto.
+Fri Aug 25 22:32:04 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Aug 25 20:35:57 2006 NAKAMURA Usaku <usa@ruby-lang.org>
+ * lib/rexml/source.rb (REXML::IOSource#initialize): encoding have to
+ be set with the accessor. fixed: [ruby-list:42737]
- * test/wsdl/document/echo.rb: removed.
+Fri Aug 25 17:15:17 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
- * test/wsdl/document/test_rpc.rb: remove echo.rb after test.
- [ruby-dev:29337]
+ * stable version 1.8.5 released.
Fri Aug 25 17:02:06 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
* gc.c (gc_sweep): typo fixed.
-Fri Aug 25 16:05:50 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * object.c (sym_call): check if the receiver is given.
-
-Fri Aug 25 01:10:11 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * object.c (rb_Integer): Integer(nil) should raise TypeError.
- [ruby-talk:210205]
-
- * object.c (nil_to_s): no longer returns empty string but "nil".
- [ruby-talk:210205]
-
- * lib/mkmf.rb: avoid COMMON_HEADERS being nil.
-
-Wed Aug 23 00:25:14 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/rexml/source.rb (REXML::IOSource#initialize): encoding have to
- be set with the accessor. fixed: [ruby-list:42737]
-
-Tue Aug 22 19:21:00 2006 Minero Aoki <aamine@loveruby.net>
-
- * lib/net/smtp.rb: parameter `to_addrs' might be an Array,
- .flatten is required. [ruby-dev:29316]
-
Tue Aug 22 18:47:51 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
* lib/rdoc/parsers/parse_c.rb (RDoc::C_Parser::handle_method):
rdoc documents C module methods as instance methods. a patch in
[ruby-core:08536].
-Tue Aug 22 12:35:57 2006 NARUSE, Yui <naruse@ruby-lang.org>
-
- * ext/nkf/lib/kconv.rb (Kconv::RegexpEucjp): fix regexp for
- euc-jp [ruby-dev:29344]
-
-Sun Aug 20 11:46:52 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * numeric.c (num_step): also return an enumerator object if no block
- is given.
-
-Sat Aug 19 16:47:51 2006 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+Sat Aug 19 14:15:02 2006 NAKAMURA Usaku <usa@ruby-lang.org>
- * ext/win32ole/win32ole.c (hash2named_arg): accept hash argument
- of symbol key.
-
- * test/win32ole/test_win32ole.rb
- ditto.
+ * win32/Makefile.sub (config.status): include winsock2.h instead of
+ winsock.h when --with-winsock2 is specified.
+ fixed: [ruby-dev:29296]
Sat Aug 19 11:28:08 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
* file.c (rb_file_s_rename): use errno if set properly.
fixed: [ruby-dev:29293]
-Fri Aug 18 01:05:57 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+Sat Aug 19 11:09:23 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
- * lib/cgi.rb (CGI::out): specify -m0 to disable MIME decode. a
- patch from Fujioka <fuj at rabbix.jp>. [ruby-dev:29284]
+ * parse.y (then): remove semicolon warning. [ruby-dev:29299]
Thu Aug 17 19:15:16 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
@@ -44379,98 +6435,30 @@ Thu Aug 17 14:47:06 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/mkmf.rb: added rdoc by Daniel Berger. [ruby-core:08177]
-Wed Aug 16 17:46:59 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * marshal.c (r_byte): IO#getc returns one byte string now.
- fixed: [ruby-dev:29255]
+Thu Aug 17 00:39:05 2006 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
-Wed Aug 16 17:22:44 2006 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * common.mk (pre-install-local): remove unnecessary code.
- [ruby-dev:29249]
+ * lib/rinda/ring.rb (do_reply): Fix for RingServer fails to find a
+ TupleSpace when TupleSpace resides in the same ruby process with
+ RingServer. a patch from Kent Sibilev. [ruby-core:08453]
Wed Aug 16 11:45:36 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
* process.c (proc_setuid, proc_setgid, proc_seteuid, proc_setegid):
get rid of bogus implementations on Mac OS X.
+Tue Aug 15 19:10:18 2006 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rdoc/parsers/parse_c.rb (RDoc::C_Parser#find_class_comment): Fix
+ broken class-level documentation.
+
Wed Aug 16 11:09:26 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ruby.c (set_arg0): fill argv other than the first with an empty
string instead of NULL.
-Tue Aug 15 11:21:08 2006 Minero Aoki <aamine@loveruby.net>
-
- * lib/net/smtp.rb: support SMTP/SSL. Thanks Kazuhiro NISHIYAMA.
-
- * lib/net/smtp.rb: new method SMTP.use_ssl?
-
- * lib/net/smtp.rb: new method SMTP.enable_ssl.
-
- * lib/net/smtp.rb: new method SMTP.disable_ssl.
-
- * lib/net/smtp.rb: new method SMTP.default_ssl_port.
-
- * lib/net/smtp.rb: new method SMTP.default_tls_port.
-
- * lib/net/smtp.rb: now SMTP#enable_tls accepts a SSLContext
- object, instead of a verity and cert. [FEATURE CHANGE]
-
- * lib/net/smtp.rb: new method SMTP.ssl_context.
-
- * lib/net/smtp.rb: new method SMTP.default_ssl_context.
+Wed Aug 16 11:08:00 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/net/smtp.rb: export SMTP.authenticate.
-
- * lib/net/smtp.rb: export SMTP.auth_plain.
-
- * lib/net/smtp.rb: export SMTP.auth_login.
-
- * lib/net/smtp.rb: export SMTP.auth_cram_md5.
-
- * lib/net/smtp.rb: export SMTP.starttls.
-
- * lib/net/smtp.rb: export SMTP.helo.
-
- * lib/net/smtp.rb: export SMTP.ehlo.
-
- * lib/net/smtp.rb: export SMTP.mailfrom.
-
- * lib/net/smtp.rb: export SMTP.rcptto.
-
- * lib/net/smtp.rb: export SMTP.rcptto_list.
-
- * lib/net/smtp.rb: export SMTP.data.
-
- * lib/net/smtp.rb: export SMTP.quit.
-
-Sat Aug 12 22:33:06 2006 Eric Hodel <drbrain@segment7.net>
-
- * string.c (String#split): Describe grouping behavior. Patch by Jan
- Svitok <jan.svitok at gmail.com>. [ruby-core:08603]
-
-Sun Aug 13 12:08:02 2006 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/socket.c: ANSIfied. [ruby-core:08601]
-
-Sat Aug 12 15:55:32 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in, bcc32/Makefile.sub, win32/Makefile.sub, win32/dir.h,
- win32/win32.c, win32/win32.h: large file support for win32.
-
-Fri Aug 11 15:39:25 2006 Eric Hodel <drbrain@segment7.net>
-
- * lib/rdoc/parsers/parse_c.rb (RDoc::C_Parser#find_body): Make RDoc
- ignore C function prototypes. Patch by Tilman Sauerbeck
- <tilman at code-monkey.de>. [ruby-core:8574]
- * lib/yaml/tag.rb: Replace nodoc with stopdoc so Module methods get
- documented.
-
-Wed Aug 9 16:53:28 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/net/smtp.rb (Net::SMTP::auth_cram_md5): use ord to retrieve
- bytes from strings. a patch from WATANABE Tetsuya
- <Tetsuya.WATANABE at nifty.com>. [ruby-dev:29240]
+ * win32/win32.h: removed an excess macro. fixed: [ruby-dev:29258]
Tue Aug 8 23:49:06 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
@@ -44478,23 +6466,17 @@ Tue Aug 8 23:49:06 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
RDoc. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:08522]
-Tue Aug 8 19:26:10 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/resolv.rb (Resolv::DNS::Message::MessageDecoder::get_string):
- affected by str[0] returns 1 char string. [ruby-dev:29223]
-
- * lib/resolv.rb (Resolv::DNS::Message::MessageDecoder::get_labels):
- ditto.
-
-Tue Aug 8 12:28:43 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Aug 8 11:32:54 2006 NAKAMURA Usaku <usa@ruby-lang.org>
- * parse.y (arg): allow newlines before ternary colon. [ruby-dev:29189]
+ * Makefile.in, common.mk, configure.in: fix for platforms without
+ rm. patches from Yutaka kanemoto <kinpoco at gmail.com>.
+ [ruby-dev:29215]
Mon Aug 7 17:56:59 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
* ext/bigdecimal/bigdecimal.c, ext/digest/rmd160/rmd160ossl.c,
ext/digest/sha1/sha1ossl.c, ext/readline/readline.c: move
- inclusion of config.h to pacify AIX. a patch from Yutaka
+ incluion of config.h to pacify AIX. a patch from Yutaka
Kanemoto <kinpoco at gmail.com>. [ruby-dev:29197]
Mon Aug 7 15:55:08 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
@@ -44511,58 +6493,33 @@ Mon Aug 7 14:37:48 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
Mon Aug 7 12:05:28 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
- * dln.c, eval.c, gc.c, ruby.h: shut up AIX alloca warning.
- a patch from Yutaka Kanemoto <kinpoco at gmail.com>.
+ * dln.c, eval.c, gc.c, regex.c, ruby.h: shut up AIX alloca
+ warning. a patch from Yutaka Kanemoto <kinpoco at gmail.com>.
[ruby-dev:29191]
-Sun Aug 6 20:34:24 2006 Tadayoshi Funaba <tadf@dotrb.org>
+Sun Aug 6 20:40:41 2006 Tadayoshi Funaba <tadf@dotrb.org>
* lib/date/format.rb (str[fp]time): %[EO]U didn't denote %U.
-Sun Aug 6 17:12:12 2006 Tanaka Akira <akr@fsij.org>
-
- * io.c (io_reopen): STDERR.reopen(open("/dev/tty", "w")) should not
- clear FMODE_PREP in STDERR.
-
-Sat Aug 5 22:53:41 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
-
- * oniguruma.h: Version 4.2.2
-
- * regint.h: ditto.
-
- * regparse.h: ditto.
-
- * regexec.c: ditto.
-
- * regcomp.c ditto.
-
- * regerror.c: ditto.
-
- * regparse.c: ditto.
-
Sat Aug 5 17:07:43 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
* parse.y (top_local_setup): local_vars[-1] should point
ruby_scope itself to protect local_tbl from garbage collection.
[ruby-dev:29049]
-Sat Aug 5 13:49:43 2006 Tadayoshi Funaba <tadf@dotrb.org>
+Sat Aug 5 13:54:03 2006 Tadayoshi Funaba <tadf@dotrb.org>
* lib/date/format.rb (str[fp]time): "%\n" means "\n".
-Fri Aug 4 12:13:22 2006 Eric Hodel <drbrain@segment7.net>
+Fri Aug 4 15:21:00 2006 Eric Hodel <drbrain@segment7.net>
- * lib: Clean up files for RDoc.
- * lib/.document: Include most of the standard library in RDoc
- generation.
- * lib/rdoc/ri/ri_formatter.rb: Don't unescape HTML in HtmlFormatter.
- Submitted by <ksruby at gmail.com>. [ruby-core:08392].
+ * lib: Merge RDoc and .document from HEAD.
* lib/drb/ssl.rb: Close socket on SSLError [ruby-core:7197]
-Fri Aug 4 18:59:49 2006 Keiju Ishitsuka <keiju@ruby-lang.org>
+Fri Aug 4 19:13:41 2006 Keiju Ishitsuka <keiju@ruby-lang.org>
* lib/irb/{init.rb,ruby-lex.rb,slex.rb}: can't input '\c' for
- [ruby-core: 7122]. and support for ruby1.8.X
+ [ruby-core: 7122].
Fri Aug 4 14:02:14 2006 James Edward Gray II <james@grayproductions.net>
@@ -44575,22 +6532,15 @@ Fri Aug 4 13:56:51 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
* pack.c (pack_pack): check argument overrun for 'P'. based on a
patch by rucila <rucila at yahoo.cojp>. fixed: [ruby-dev:29182]
-Fri Aug 4 02:42:29 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * sprintf.c (rb_str_format): a bug in %c type check.
-
-Fri Aug 4 01:28:19 2006 Tanaka Akira <akr@fsij.org>
+Tue Aug 1 17:44:03 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * io.c (io_reopen): STDERR.reopen(File.open("/dev/null", "w")) should
- not fclose stderr.
+ * win32/win32.c (init_stdhandle): assign standard file handles.
-Thu Aug 3 15:16:44 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+Tue Aug 1 12:24:58 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * range.c (range_include): should always call Enumerable#include?
- (not #===) for non numeric end points. [ruby-core:08477]
- [ruby-core:08496]
+ * eval.c (Init_Binding): fix old commit miss.
-Mon Jul 31 16:51:40 2006 NAKAMURA Usaku <usa@ruby-lang.org>
+Mon Jul 31 17:08:20 2006 NAKAMURA Usaku <usa@ruby-lang.org>
* win32/win32.c (exit_handler): new function; release winsock and
environment work area.
@@ -44601,7 +6551,7 @@ Mon Jul 31 16:51:40 2006 NAKAMURA Usaku <usa@ruby-lang.org>
* win32/win32.c (rb_w32_getenv): use GetEnvironmentStrings() instead
of GetEnvironmentVariable(), because the latter cannot distinguish
- whether a null environment variable exists or not.
+ wheather a null environment variable exists or not.
fixed: [ruby-talk:205123]
Mon Jul 31 16:15:13 2006 Tanaka Akira <akr@fsij.org>
@@ -44610,18 +6560,18 @@ Mon Jul 31 16:15:13 2006 Tanaka Akira <akr@fsij.org>
setrlimit may fail with EINVAL.
reported by MIYAMUKO Katsuyuki. [ruby-dev:29174]
+Mon Jul 31 13:38:22 2006 GOTOU Yuuzou <gotoyuzo@notwork.org>
+
+ * lib/webrick/httprequest.rb (WEBrick::HTTPReuqest#parse_uri): improve
+ for the value of IPv6 address in the Host: header field.
+
Mon Jul 31 09:22:12 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
* ruby.h: use ifdef (or defined) for macro constants that may or
may not be defined to shut up gcc's -Wundef warnings.
[ruby-core:08447]
-Mon Jul 31 13:38:13 2006 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * lib/webrick/httprequest.rb (WEBrick::HTTPReuqest#parse_uri): improve
- for the value of IPv6 address in the Host: header field.
-
-Sun Jul 30 23:26:12 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun Jul 30 23:26:22 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
* eval.c (rb_call0): trace call/return of method defined from block.
fixed: [ruby-core:08329]
@@ -44643,33 +6593,9 @@ Sat Jul 29 01:23:52 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
statement back before the comment block. a patch from Hugh
Sasse <hgs at dmu.ac.uk>. [ruby-core:08422]
-Fri Jul 28 17:18:03 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/curses/curses.c (NUM2CH, CH2FIX): use single char strings.
-
-Fri Jul 28 14:09:14 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (rb_call): fixed typo in cache look-up. [ruby-dev:29167]
-
-Fri Jul 28 10:41:35 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (rb_call): a bug in method cache look-up.
- http://www.rubyist.net/~matz/20060720.html#c04
-
-Fri Jul 28 10:19:28 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * sprintf.c (rb_f_sprintf): documentation update patch from Jacob
- Fugal <lukfugl at gmail.com>. [ruby-core:08418]
-
-Fri Jul 28 09:41:45 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * time.c (time_to_s): fixed typo. [ruby-dev:29162]
-
-Fri Jul 28 00:26:47 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * math.c (domain_check): ANSI style function arguments
+Thu Jul 27 22:21:52 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * math.c (math_log): too few argument to domain_check().
+ * time.c (time_to_s): fixed format mismatch.
Thu Jul 27 21:19:54 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
@@ -44682,10 +6608,6 @@ Thu Jul 27 21:19:54 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
* math.c (math_sqrt): fix documentation flaw.
-Thu Jul 27 22:21:52 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * time.c (time_to_s): fixed format mismatch.
-
Thu Jul 27 18:12:12 2006 WATANABE Hirofumi <eban@ruby-lang.org>
* time.c: need to declare time_utc_offset.
@@ -44695,19 +6617,23 @@ Thu Jul 27 17:01:01 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
* io.c (io_close): always calls "close" method of the receiver.
[ruby-core:6911] [ruby-core:8112]
+Thu Jul 27 16:49:01 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * time.c (time_to_s): use +0900 style timezone string for local time.
+ [ruby-dev:29143]
+
Thu Jul 27 16:41:15 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
* ext/openssl/ossl.h: move <ruby.h> inclusion point to shut up
Solaris compiler. [ruby-core:08114]
- * time.c (time_to_s): use +0900 style timezone string for local time.
- [ruby-dev:29143]
-
Wed Jul 26 22:20:59 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
* configure.in: add support for as and ASFLAGS. [ruby-dev:29138]
-Wed Jul 26 21:59:33 2006 Minero Aoki <aamine@loveruby.net>
+Wed Jul 26 22:13:45 2006 Minero Aoki <aamine@loveruby.net>
+
+ * lib/net/http.rb: sync with HEAD (rev 1.132).
* lib/net/http.rb (Net::HTTP#post, request_post, request): should
set Content-Type: x-www-form-urlencoded by default.
@@ -44721,37 +6647,21 @@ Wed Jul 26 21:59:33 2006 Minero Aoki <aamine@loveruby.net>
* lib/net/http.rb (Net::HTTPHeader#type_params): wrongly failed
when there's no Content-Type.
-Wed Jul 26 18:38:13 2006 Minero Aoki <aamine@loveruby.net>
-
- * ext/strscan/strscan.c (strscan_do_scan): always return nil if
- p->curr exceeds string size.
-
-Wed Jul 26 18:33:31 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (Init_eval): rename #invoke_method and
- #invoke_functional_method to __send and __send! respectively.
-
- * eval.c (remove_method): prohibit removing __send and __send!.
-
- * eval.c (rb_undef): prohibit undef'ing __send and __send!.
+Wed Jul 26 18:35:38 2006 Minero Aoki <aamine@loveruby.net>
- * eval.c (rb_eval): prohibit redefining __send and __send!.
+ * ext/strscan/strscan.c: sync with HEAD (rev 1.25).
- * lib/delegate.rb (Delegator): preserve __send.
+ * ext/strscan/strscan.c (strscan_do_scan):
+ StringScanner.new("").scan(//) should return "". [ruby-Bugs:4361]
Wed Jul 26 18:14:19 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ext/pty/pty.c (getDevice): retry once after GC on failure.
[ruby-core:08282]
-Wed Jul 26 17:43:20 2006 Minero Aoki <aamine@loveruby.net>
-
- * ext/strscan/strscan.c (strscan_do_scan):
- StringScanner.new("").scan(//) should return "". [ruby-Bugs:4361]
-
Wed Jul 26 17:28:16 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * sprintf.c (rb_str_format): prepend ".." to %u for negative bignum,
+ * sprintf.c (rb_f_sprintf): prepend ".." to %u for negative bignum,
but not "-". fixed: [ruby-core:08167]
Wed Jul 26 16:39:07 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
@@ -44769,7 +6679,11 @@ Wed Jul 26 01:02:59 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
* configure.in: suppress warnings by automake 1.8 or later.
-Tue Jul 25 14:46:14 2006 NAKAMURA Usaku <usa@ruby-lang.org>
+Tue Jul 25 00:30:06 2006 Eric Hodel <drbrain@segment7.net>
+
+ * lib/prettyprint.rb: RD to RDoc conversion by Hugh Sasse.
+
+Tue Jul 25 14:49:51 2006 NAKAMURA Usaku <usa@ruby-lang.org>
* lib/mkmf.rb (configuration): typo.
@@ -44782,6 +6696,13 @@ Mon Jul 24 22:03:40 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
* eval.c (backtrace): skip frames successive on node and method name.
+Mon Jul 24 17:55:55 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * process.c (rb_f_system): add security check. [ruby-talk:202947]
+
+ * process.c (rb_f_system): move signal right before fork to avoid
+ signal handler intervention.
+
Mon Jul 24 15:51:52 2006 Tanaka Akira <akr@fsij.org>
* ext/readline/readline.c (readline_readline): rl_deprep_term_function
@@ -44797,61 +6718,36 @@ Sun Jul 23 22:59:49 2006 Tanaka Akira <akr@fsij.org>
* test/socket/test_unix.rb: disabled on cygwin.
reported by Kouhei Yanagita. [ruby-dev:29080]
-Fri Jul 21 23:57:26 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ruby.c (proc_options): script is never used while recursing.
-
Fri Jul 21 21:21:08 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
* eval.c (rb_call0): include funcalled methods in caller list.
fixed: [ruby-core:08290]
-Fri Jul 21 17:52:24 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * object.c (rb_cstr_to_dbl): "9_e8" should consider "_e8" as
- trailing garbage so that it should return 9.0. [ruby-dev:29088]
-
Fri Jul 21 12:11:00 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ext/extmk.rb, lib/mkmf.rb (with_destdir): remove drive letter before
prepending destdir on DOSISH.
-Fri Jul 21 04:17:22 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (rb_call): try local method look-up first for fcall, then
- normal method look-up. [ruby-talk:202564]
-
- * eval.c (rb_get_method_body): save local method cache separately.
-
- * eval.c (search_method): export info whether method is local or
- not.
-
-Thu Jul 20 20:27:07 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * object.c (rb_mod_attr): make Module#attr to be an alias to
- attr_reader. [RCR#331]
-
Thu Jul 20 15:07:14 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
* ruby.h: export classes/modules to implement sandbox.
[ruby-core:08283]
-Wed Jul 19 19:40:00 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+Thu Jul 20 00:06:29 2006 Keiju Ishitsuka <keiju@ishitsuka.com>
- * eval.c (rb_yield_0): should check args_args before lambda
- argument check. [ruby-dev:29029]
+ * lib/irb/completion.rb: support for completion of numeric
+ number. [ruby-dev: 29038]
-Tue Jul 18 23:53:59 2006 NAKAMURA Usaku <usa@ruby-lang.org>
+Wed Jul 19 23:53:05 2006 Kouhei Sutou <kou@cozmixng.org>
- * process.c (rb_f_system): shouldn't block SIGCHLD if it's not
- exist.
+ * lib/rss/parser.rb, lib/rss/utils.rb: added documents.
Tue Jul 18 22:10:13 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
* process.c (rb_f_system): block SIGCHLD during the process
execution, like glibc system(3) does. [ruby-talk:202361]
-Tue Jul 18 23:10:43 2006 NAKAMURA Usaku <usa@ruby-lang.org>
+Tue Jul 18 23:12:14 2006 NAKAMURA Usaku <usa@ruby-lang.org>
* win32/win32.c (open_ifs_socket): should not use plain malloc.
@@ -44862,11 +6758,6 @@ Tue Jul 18 18:05:49 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
* test/ruby/test_float.rb (TestFloat::test_strtod): update test to
conform strtod change.
-Tue Jul 18 16:52:29 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (yield_under_i): argument should be passed in avalue
- form. [ruby-dev:29044]
-
Tue Jul 18 15:49:42 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
* pack.c (pack_unpack): propagate association array to copied
@@ -44878,15 +6769,6 @@ Tue Jul 18 15:49:42 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
* pack.c (pack_pack): taint 'p' packed strings.
-Tue Jul 18 15:19:07 2006 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * intern.h (st_foreach_safe): fix prototype.
-
- * node.h (NODE_LMASK): bigger than long on LLP64.
-
- * missing/vsnprintf.c (BSD__uqtoa): new function to support LLP64.
- all changes are derived from [ruby-dev:29045]
-
Tue Jul 18 14:03:02 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
* lib/webrick/httpserver.rb (WEBrick::HTTPServer::unmount): remove
@@ -44902,7 +6784,7 @@ Tue Jul 18 10:53:37 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
Mon Jul 18 00:43:05 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
* util.c (ruby_strtod): stop at dot not followed by digits.
- fixed: [ruby-dev:29036]
+ fixed: [ruby-dev:29035]
Tue Jul 18 00:01:27 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
@@ -44913,23 +6795,23 @@ Mon Jul 17 23:30:46 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
* configure.in (rb_cv_msvcrt): defaulted to msvcrt. Workaround for a
bug of cygwin 1.5.20.
-Mon Jul 17 22:55:31 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * ext/io/wait/wait.c (io_ready_p): protoize.
-
Mon Jul 17 13:43:05 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
* pack.c (define_swapx): should not use plain malloc.
- * ext/curses/curses.c (curses_getmouse): ditto.
-
Mon Jul 17 12:58:41 2006 WATANABE Hirofumi <eban@ruby-lang.org>
* configure.in: should use ac_cv_lib_dl_dlopen=no on MinGW.
-Mon Jul 17 11:47:35 2006 NAKAMURA Usaku <usa@ruby-lang.org>
+Sat Jul 15 23:50:12 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * st.c: still need to include config.h on some platforms.
+ * eval.c (rb_require_safe): wait for another thread requiring the same
+ feature. fixed: [ruby-core:08229]
+
+Sat Jul 15 01:27:13 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * dir.c (has_magic): glob names contain alphabets to enable case fold
+ search also for directories. fixed: [ruby-talk:201917]
Sat Jul 15 01:09:22 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
@@ -44937,6 +6819,8 @@ Sat Jul 15 01:09:22 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
malloc/calloc, to detect memory allocation failure. see
<http://www.nongnu.org/failmalloc/>.
+ * gc.c (rb_memerror): should not raise empty nomem_error.
+
Fri Jul 14 13:08:13 2006 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tk/lib/tk.rb: add methods for new features of latest Tcl/Tk8.5.
@@ -44948,6 +6832,10 @@ Fri Jul 14 02:30:12 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
* lib/monitor.rb: document patch from Hugh Sasse <hgs at dmu.ac.uk>.
[ruby-core:08205]
+Fri Jul 14 01:09:46 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * parse.y (then): error in warning action.
+
Fri Jul 14 00:10:15 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
* array.c (rb_ary_pop): may cause realloc oscillation. a patch
@@ -44959,23 +6847,15 @@ Thu Jul 13 22:23:56 2006 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tk/lib/tk/composite.rb: improve handling of the classname on the
option database for the widget class which includes TkComposite.
-Thu Jul 13 00:40:57 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * ruby.h (FIX2LONG): returns integer of size of VALUE.
- [ruby-dev:29024]
+Thu Jul 13 20:32:19 2006 Kouhei Sutou <kou@cozmixng.org>
- * ruby.h (FIX2ULONG): ditto.
+ * lib/rss/parser.rb: updated documents by a patch from
+ Hugh Sasse <hgs at dmu.ac.uk>. [ruby-core:8194]
-Wed Jul 12 20:05:23 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+Wed Jul 12 13:54:09 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
- * parse.y (f_args): allow post mandatory arguments after optional
- arguments. [ruby-dev:29014]
-
- * parse.y (new_args_gen): allow post_args without rest_args.
-
- * eval.c (formal_assign): ditto.
-
- * parse.y (new_args_gen): check post argument duplication.
+ * parse.y (then): we'd like to reserve colon here for the future.
+ warning added.
Tue Jul 11 20:58:18 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
@@ -44990,42 +6870,10 @@ Tue Jul 11 18:00:57 2006 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tk/lib/multi-tk.rb: security fix.
-Tue Jul 11 17:28:08 2006 NAKAMURA Usaku <usa@ruby-lang.org>
+Tue Jul 11 17:33:39 2006 NAKAMURA Usaku <usa@ruby-lang.org>
* string.c (rb_str_dump): need to extend len for \b.
-Tue Jul 11 15:29:15 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * bignum.c (rb_int2big): use SIGNED_VALUE. [ruby-dev:29019]
-
- * bignum.c (rb_int2inum, rb_uint2inum): use VALUE sized integer.
-
- * bignum.c (rb_big2long, rb_big2ulong): ditto.
-
- * numeric.c (rb_num2long, rb_num2ulong): ditto.
-
- * numeric.c (check_int, check_uint): ditto.
-
- * bignum.c (rb_quad_pack): typo fixed.
-
-Tue Jul 11 13:40:52 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * bignum.c (bignorm): sizeof(long) may be smaller than
- sizeof(VALUE). [ruby-dev:29013]
-
- * ruby.h (FIXNUM_MAX): fixnum may be bigger than long.
-
- * ruby.h (SIGNED_VALUE): signed integer of size of VALUE.
-
-Mon Jul 10 23:37:14 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/soap/rpc/proxy.rb (Proxy::Operation::response_doc): remove
- splat star from return statements.
-
- * lib/soap/rpc/proxy.rb (Proxy::Operation::response_obj): retrieve
- the first value from the result array if response has only one
- value.
-
Mon Jul 10 22:00:00 2006 Shigeo Kobayashi <shigek@ruby-lang.org>
* ext/bigdecimal/bigdecimal.c: Allows '_' to appear within
@@ -45069,52 +6917,17 @@ Mon Jul 10 18:46:52 2006 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tk/sample/demos-jp/widget: ditto.
-Mon Jul 10 17:32:38 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * sample/test.rb: update test suites.
-
- * test/ruby/test_assignment.rb (TestAssignment::test_yield): ditto.
-
- * test/ruby/test_iterator.rb (TestIterator::test_itertest): ditto.
+Mon Jul 10 13:58:40 2006 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-Mon Jul 10 14:43:47 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * signal.c (ruby_nativethread_signal, posix_nativethread_signal,
+ sigsend_to_ruby_thread, install_nativethread_sighandler):
+ nativethread-support on signal handler. RE-backport from 1.9.
- * eval.c (rb_call): remove erroneously restored prot_tag->blkid
- initialization. [ruby-dev:28997] [ruby-dev:29000]
+ * ruby.h (HAVE_NATIVETHREAD_KILL): ditto.
-Mon Jul 10 13:58:08 2006 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * signal.c (install_nativethread_sighandler): commented out.
-
-Mon Jul 10 09:29:12 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval.c (rb_clear_cache_for_remove): clear entries for included
- module. fixed: [ruby-core:08180]
+ * eval.c (ruby_native_thread_kill): ditto.
-Mon Jul 10 02:22:58 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (proc_invoke): should not overwrite block information in
- current frame. [ruby-dev:28957]
-
- * eval.c (rb_yield_0): retrieve proper block object from the frame
- record.
-
- * eval.c (proc_alloc): return preserved block object if it's
- available.
-
-Mon Jul 10 01:48:38 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * st.h (st_data_t): use pointer sized integer for st_data_t.
- [ruby-dev:28988]
-
-Sun Jul 9 18:06:47 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/mkmf.rb (try_constant): fix for value 1 at cross compiling.
-
- * lib/mkmf.rb (create_makefile): prevent substitution of macro
- definition. fixed: http://www.yotabanana.com/lab/20060624.html#p02
-
-Sun Jul 9 07:58:48 2006 Ryan Davis <ryand@zenspider.com>
+Mon Jul 10 10:54:14 2006 Ryan Davis <ryand@zenspider.com>
* lib/rdoc/parsers/parse_f95.rb: massive overhaul from Yasuhiro
Morikawa including new file suffixes, function support, public
@@ -45134,33 +6947,44 @@ Sun Jul 9 07:58:48 2006 Ryan Davis <ryand@zenspider.com>
* lib/pp.rb: minor clarification on exception.
-Sun Jul 9 00:54:11 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Jul 10 09:29:12 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * eval.c (next_jump): deal with destination of next.
- fixed: [ruby-core:08169]
+ * eval.c (rb_clear_cache_for_undef): clear entries for included
+ module. fixed: [ruby-core:08180]
-Fri Jul 7 17:49:16 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Jul 10 01:48:38 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * st.h (st_data_t): use pointer sized integer for st_data_t.
+ [ruby-dev:28988]
+
+Sun Jul 9 18:06:47 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * string.c (rb_str_ord): extract lower byte. fixed: [ruby-dev:28980]
+ * lib/mkmf.rb (try_constant): fix for value 1 at cross compiling.
- * lib/jcode.rb (String#succ!): fix for 1.9. fixed: [ruby-dev:28979]
+ * lib/mkmf.rb (create_makefile): prevent substitution of macro
+ definition. fixed: http://www.yotabanana.com/lab/20060624.html#p02
-Fri Jul 7 14:05:03 2006 NAKAMURA Usaku <usa@ruby-lang.org>
+Sun Jul 9 00:54:34 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * win32/Makefile.sub (config.h): define FUNC_STDCALL/FUNC_CDECL.
- from [ruby-dev:28970].
+ * eval.c (next_jump): deal with destination of next.
+ fixed: [ruby-core:08169]
Fri Jul 7 00:38:49 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
* hash.c (rb_hash_default): should not call default procedure if
no key is given. [ruby-list:42541]
-Thu Jul 6 23:30:04 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Jul 7 00:29:10 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * time.c (time_mload): a patch from Daniel Berger
+ <Daniel.Berger at qwest.com>. [ruby-core:08128]
+
+Thu Jul 6 22:21:57 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
* process.c (rb_proc_times): use sysconf(_SC_CLK_TCK) value prior to
HZ and CLK_TCK. fixed: [ruby-talk:200293]
-Thu Jul 6 21:50:06 2006 Minero Aoki <aamine@loveruby.net>
+Thu Jul 6 22:17:21 2006 Minero Aoki <aamine@loveruby.net>
* ext/racc/cparse/cparse.c: sync with original code, rev 1.8.
@@ -45170,35 +6994,11 @@ Thu Jul 6 21:50:06 2006 Minero Aoki <aamine@loveruby.net>
* lib/racc/parser.rb: update coding style.
-Wed Jul 5 05:28:45 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * parse.y (block_param): should allow block argument after splat
- and post splat args.
-
-Wed Jul 5 01:12:19 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * test/ruby/test_lambda.rb (TestLambdaParameters::test_lambda_as_iterator):
- -> style block no longer available. [ruby-dev:28958]
-
-Tue Jul 4 21:48:56 2006 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * ruby.c (proc_options): suppress warning on DOSISH.
-
-Tue Jul 4 15:12:49 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (rb_call): should not set prot_tag->blkid since it would
- never catch breaks at this level. [ruby-dev:28922]
-
-Tue Jul 4 04:48:36 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * bignum.c: ruby 1.9 HEAD 64 bit warnings clean up from
- <ville.mattila at stonesoft.com>. [ruby-core:08120]
-
Mon Jul 3 19:04:38 2006 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tk/tcltklib.c (ip_make_menu_embeddable): help to make a menu
widget embeddable (pack, grid, and so on) like as a general widget.
- However, an embeddable menu may require to be defined some event
+ However, an embeddable menu may require to be definied some event
bindings for general use.
* ext/tk/lib/tk/event.rb: [bug fix] Tk.callback_break and
@@ -45216,15 +7016,6 @@ Mon Jul 3 14:42:06 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
from int, and sys/types.h needs to be included before grp.h.
fixed: [ruby-dev:28938]
-Mon Jul 3 10:44:01 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * io.c (popen_exec): close file descriptors other than standard I/Os.
- fixed: [ruby-dev:28924]
-
-Mon Jul 3 05:15:29 2006 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * test/openssl/test_asn1.c: String#[]= doesn't accept Integer.
-
Mon Jul 3 01:14:15 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
* string.c (rb_str_inspect): encode \b (\010) for escape.
@@ -45232,34 +7023,15 @@ Mon Jul 3 01:14:15 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
* string.c (rb_str_dump): ditto.
-Sun Jul 2 19:03:30 2006 Minero Aoki <aamine@loveruby.net>
-
- * ext/racc/cparse/cparse.c: sync with original code, rev 1.7.
-
- * ext/racc/cparse/cparse.c: must require version.h to get
- RUBY_VERSION_CODE.
-
-Sun Jul 2 18:42:27 2006 Minero Aoki <aamine@loveruby.net>
-
- * ext/racc/cparse/cparse.c: sync with original source code, rev
- 1.6.
+Sun Jul 2 19:17:56 2006 Minero Aoki <aamine@loveruby.net>
- * ext/racc/cparse/cparse.c: do not use rb_iterate to give a block
- to the method, use rb_block_call instead. [ruby-dev:28445]
+ * ext/racc/cparse/cparse.c: sync with original code (rev 1.7).
-Sun Jul 2 11:22:03 2006 Tanaka Akira <akr@m17n.org>
-
- * io.c (io_reopen): STDOUT.reopen(filename, "w+") didn't work.
- (rb_io_reopen): STDOUT.reopen(File.open(filename, "w+")) didn't work.
-
-Sat Jul 1 23:55:42 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (PUSH_FRAME): initialize frame->self. [ruby-dev:28911]
-
-Sat Jul 1 17:00:42 2006 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * test/webrick/utils.rb: use Proc#yield instead of Proc#call.
- [ruby-dev:28914]
+ * ext/racc/cparse/cparse.c: use rb_catch instead of rb_iterate.
+ Giving a block to a Ruby-level method by rb_iterate is obsolete on
+ Ruby 1.9. Note that current cparse.c still includes one
+ rb_iterate call on Ruby 1.8, but it is not a problem (at least
+ just now).
Sat Jul 1 15:15:49 2006 Tanaka Akira <akr@m17n.org>
@@ -45275,34 +7047,6 @@ Fri Jun 30 23:46:23 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
* configure.in: -shared patch from Andrew Morrow
<andrew.c.morrow at gmail.com>. [ruby-core:08100]
-Fri Jun 30 19:35:41 2006 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * lib/webrick/httputils.rb (WEBrick::HTTPUtils._escape): should
- use String#ord to get ascii code from the one-character string.
- [ruby-dev:28901]
-
-Thu Jun 29 23:56:01 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * gc.c (gc_mark_children): a bug in NODE_BLOCK_PASS marking.
- [ruby-dev:28908]
-
-Thu Jun 29 23:04:36 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * parse.y: use ARGSPUSH instead of ARGSCAT to prevent too much
- splat expansion.
-
- * eval.c (when_check): need to handle ARGSPUSH as well.
-
- * eval.c (block_orphan): lambda and proc from method are always
- orphan.
-
- * gc.c (gc_mark_children): proper marking for NODE_LAMBDA.
-
-Thu Jun 29 22:47:30 2006 Tanaka Akira <akr@m17n.org>
-
- * eval.c (SETUP_ARGS0): avoid GC problem.
- [ruby-dev:28902]
-
Thu Jun 29 18:58:51 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
* ext/bigdecimal/bigdecimal.c (BigDecimal_version): fix patch
@@ -45313,51 +7057,16 @@ Thu Jun 29 18:00:51 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
* ext/bigdecimal/bigdecimal.c: add RDoc document. a patch from
mathew <meta at pobox.com>. [ruby-core:07050]
-Wed Jun 28 14:53:09 2006 Eric Hodel <drbrain@segment7.net>
+Wed Jun 28 15:47:14 2006 Eric Hodel <drbrain@segment7.net>
* lib/optparse.rb: RDoc patch from Robin Stocker <robin@nibor.org>
[ruby-core:08087]
-Wed Jun 28 23:23:48 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * object.c (rb_cstr_to_dbl): underscores should appear only
- between digits. [ruby-dev:28891]
-
Wed Jun 28 19:04:34 2006 Tanaka Akira <akr@m17n.org>
* test/socket/test_unix.rb: test_seqpacket_pair removed.
[ruby-dev:28846]
-Wed Jun 28 13:51:21 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval.c (when_check): arbitrary values are allowed after splats.
- fixed: [ruby-dev:28879]
-
-Wed Jun 28 09:16:18 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * parse.y (primary): remove meaningless else-only case statement
- syntax.
-
-Wed Jun 28 08:08:13 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (rb_eval): problem to handle else part. [ruby-dev:28873]
-
-Wed Jun 28 01:48:23 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (rb_eval): support splat in when expression list.
- [ruby-dev:28822]
-
- * eval.c (when_check): a new auxiliary function for case match.
-
- * eval.c (when_cond): ditto.
-
-Wed Jun 28 01:05:37 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * object.c (rb_cstr_to_dbl): should not skip '_' at the beginning
- of a string. [ruby-dev:28830]
-
- * bignum.c (rb_cstr_to_inum): ditto.
-
Tue Jun 27 23:03:49 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
* string.c: RDoc update for =~ method. a patch from Alex Young
@@ -45370,17 +7079,6 @@ Tue Jun 27 22:47:18 2006 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tk/lib/tk.rb (tk_tcl2ruby): [bug fix] sometimes fail to convert
a tcl string to a ruby object if the tcl string includes "\n".
-Tue Jun 27 20:05:14 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * io.c (pipe_open): backout unnecessary fix on 2006-06-26.
- [ruby-dev:28865]
-
- * eval.c (rb_yield_0): exact argument number check now done only
- for lambda Proc.
-
- * eval.c (rb_yield_0): add check for number of arguments, if
- there's one lambda block parameter.
-
Tue Jun 27 16:04:05 2006 WATANABE Hirofumi <eban@ruby-lang.org>
* win32/win32.h: define isascii on MinGW for msvcrt compatibility.
@@ -45393,246 +7091,297 @@ Tue Jun 27 11:36:02 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ext/etc/etc.c (setup_passwd, setup_group): allow bignum uid, gid and
so on. [ruby-talk:199102]
-Tue Jun 27 10:46:53 2006 Tanaka Akira <akr@m17n.org>
-
- * eval.c (rb_yield_0): avoid core dump. [ruby-dev:28840]
-
-Mon Jun 26 11:03:00 2006 Eric Hodel <drbrain@segment7.net>
+Mon Jun 26 13:37:27 2006 Eric Hodel <drbrain@segment7.net>
- * lib/rdoc/ri: Add options to limit the ri search path.
+ * lib/rdoc: Merge from HEAD.
+ Add options to limit the ri search path.
-Tue Jun 27 01:31:59 2006 Tanaka Akira <akr@m17n.org>
+Tue Jun 27 00:54:08 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/socket/socket.c (bsock_recv_nonblock): new method
- BasicSocket#recv_nonblock.
- (udp_recvfrom_nonblock): renamed from ip_recvfrom_nonblock.
- IPSocket#recvfrom_nonblock is moved to UDPSocket#recvfrom_nonblock.
- (unix_recvfrom_nonblock): removed.
- UNIXSocket#recvfrom_nonblock is removed.
-
-Tue Jun 27 00:52:40 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/ripper/eventids2.c (token_assoc): added tCHAR, which is not
- under 256 now. fixed: [ruby-dev:28832]
-
-Mon Jun 26 23:42:57 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval.c (call_trace_func): no check for argument number of the
- callback. fixed: [ruby-dev:28812]
+ * util.c (powersOf10): constified.
Mon Jun 26 18:37:44 2006 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tk/tcltklib.c (ip_delete): fix SEGV when a slave-ip is
deleted on callback.
-Mon Jun 26 15:40:26 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * ext/socket/socket.c (sock_accept): revert to avoid ambiguity of
- argument evaluation order. [ruby-dev:28861]
-
- * ext/socket/socket.c (sock_accept_nonblock): ditto.
-
Mon Jun 26 10:47:42 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
* io.c (pipe_open): avoid closing uninitialized file descriptors.
a patch from <tommy at tmtm.org> [ruby-dev:28600]
+Mon Jun 26 09:56:22 2006 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * win32/win32.[ch] (rb_w32_send, rb_w32_sendto): constified.
+
Sun Jun 25 23:02:12 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
* Makefile.in, mkconfig.rb: catch-up for latest autoconf.
-Sun Jun 25 17:44:16 2006 Tanaka Akira <akr@m17n.org>
+Sat Jun 24 06:35:00 2006 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
- * parse.y (paren_args): wrap $2 by escape_Qundef because it may be
- Qundef. [ruby-dev:28843]
+ * signal.c: revert last change.
-Sun Jun 25 17:18:33 2006 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+ * ruby.h: ditto.
- * ext/win32ole/win32ole.c(ole_invoke): support some kind of
- method of word. [ruby-Bugs#3237]
+ * eval.c: ditto.
- * test/win32ole/test_word.rb: ditto.
+Thu Jun 22 11:52:02 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-Sat Jun 24 23:48:08 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * lib/net/http.rb (Net::HTTPResponse): duplicated error 501;
+ HTTPInternalServerError should be error 500. [ruby-core:08037]
- * parse.y: replace terminal token names with more descriptive
- name, i.e. kEND to keyword_end. [ruby-list:42477]
+Thu Jun 22 05:15:58 2006 Tanaka Akira <akr@m17n.org>
-Sat Jun 24 23:37:41 2006 Tanaka Akira <akr@m17n.org>
+ * ext/socket/socket.c (sock_s_socketpair): try GC only once.
+ [ruby-dev:28778]
- * eval.c (rb_eval): use rb_ary_new2 instead of rb_ary_new4 to avoid
- GC problem.
- (rb_yield_values): use rb_ary_new2 instead of rb_ary_new4.
+Wed Jun 21 21:28:32 2006 Tadayoshi Funaba <tadf@dotrb.org>
- * array.c (rb_ary_new4): don't set len as n if contents is not
- initialized. make it safe with GC.
+ * lib/date.rb (jd_to_commercial): now works fine even if in
+ mathn-ized context.
- [ruby-dev:28826]
+Wed Jun 21 17:32:31 2006 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-Fri Jun 23 23:35:32 2006 Tanaka Akira <akr@m17n.org>
+ * signal.c (ruby_nativethread_signal, posix_nativethread_signal,
+ sigsend_to_ruby_thread, install_nativethread_sighandler):
+ nativethread-support on signal handler (backport from 1.9).
- * ruby.h, lib/drb/drb.rb, lib/drb/invokemethod.rb: remove Values class.
- [ruby-dev:28805]
+ * ruby.h (HAVE_NATIVETHREAD_KILL): ditto.
-Fri Jun 23 17:27:52 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * eval.c (ruby_native_thread_kill): ditto.
- * eval.c (rb_block_pass): removed.
+Wed Jun 21 08:39:54 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
- * eval.c (rb_thread_start_1): use rb_proc_yield() instead of
- rb_block_pass(). fixed: [ruby-dev:28794]
+ * lib/xmlrpc/create.rb (XMLRPC::Create::conv2value): merge Date
+ and Time processing. [ruby-core:08033]
-Thu Jun 22 11:52:02 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+Wed Jun 21 01:40:25 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/net/http.rb (Net::HTTPResponse): duplicated error 501;
- HTTPInternalServerError should be error 500. [ruby-core:08037]
+ * parse.y (yylex, reswords): modifier token is no longer returned in
+ fname state. [ruby-dev:28775]
-Thu Jun 22 11:47:52 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+Wed Jun 21 01:12:46 2006 Kouhei Sutou <kou@cozmixng.org>
- * variable.c (rb_mod_name): returns nil for anonymous modules.
- [ruby-talk:198440]
+ * lib/rss/rss.rb: RSS::Element.def_corresponded_attr_writer
+ supported date type.
-Thu Jun 22 10:31:39 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+Tue Jun 20 22:08:36 2006 Kouhei Sutou <kou@cozmixng.org>
- * string.c (rb_str_aref): "abc"[3] should not return an empty
- string but nil. [ruby-dev:28786]
+ * test/rss/test_parser.rb: split parser tests into ...
+ * test/rss/test_parser_1.0.rb: ... RSS 1.0 parsing tests and ...
+ * test/rss/test_parser_2.0.rb: ... RSS 2.0 parsing tests.
-Thu Jun 22 05:15:58 2006 Tanaka Akira <akr@m17n.org>
+Tue Jun 20 21:19:06 2006 Kouhei Sutou <kou@cozmixng.org>
- * ext/socket/socket.c (sock_s_socketpair): try GC only once.
- [ruby-dev:28778]
+ * lib/rss/rss.rb: provided default RSS::Element#children.
-Wed Jun 21 21:20:31 2006 Tadayoshi Funaba <tadf@dotrb.org>
+ * lib/rss/0.9.rb: used default RSS::Element#children.
+ * lib/rss/1.0.rb: ditto.
+ * lib/rss/2.0.rb: ditto.
+ * lib/rss/taxonomy.rb: ditto.
- * lib/date.rb (jd_to_commercial): now works fine even if in
- mathn-ized context.
+Tue Jun 20 21:04:33 2006 Kouhei Sutou <kou@cozmixng.org>
-Wed Jun 21 17:29:57 2006 NAKAMURA Usaku <usa@ruby-lang.org>
+ * lib/rss/rss.rb: provided default RSS::Element#_tags.
- * ext/socket/getaddrinfo.c (freeaddrinfo, get_name): fixed typo.
+ * lib/rss/0.9.rb: used default RSS::Element#_tags.
+ * lib/rss/1.0.rb: ditto.
+ * lib/rss/2.0.rb: ditto.
+ * lib/rss/image.rb: ditto.
+ * lib/rss/taxonomy.rb: ditto.
- * ext/tk/tcltklib.c (tcl_eval, tcl_global_eval): ditto.
+Tue Jun 20 20:47:07 2006 Kouhei Sutou <kou@cozmixng.org>
- * ext/zlib/zlib.c (rscheck): constified.
+ * lib/rss/rss.rb: hide RSS::Element.install_model.
+ (RSS::Element.install_have_child_element,
+ RSS::Element.install_have_children_element,
+ RSS::Element.install_text_element,
+ RSS::Element.install_date_element): call
+ RSS::Element.install_model internally.
-Wed Jun 21 17:18:55 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * lib/rss/0.9.rb: followed new API.
+ * lib/rss/1.0.rb: ditto.
+ * lib/rss/2.0.rb: ditto.
+ * lib/rss/content.rb: ditto.
+ * lib/rss/dublincore.rb: ditto.
+ * lib/rss/image.rb: ditto.
+ * lib/rss/syndication.rb: ditto.
+ * lib/rss/taxonomy.rb: ditto.
+ * lib/rss/trackback.rb: ditto.
- * lib/pp.rb (PP::PPMethods::seplist): should have preserved
- original reference to the array. [ruby-dev:28747]
+Tue Jun 20 20:18:05 2006 GOTOU Yuuzou <gotoyuzo@notwork.org>
-Wed Jun 21 14:35:06 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * ext/openssl/extconf.rb: add check for OBJ_NAME_do_all_sorted.
- * parse.y (block_param): do not use multiple assignment for a sole
- block parameter. [ruby-dev:28710]
+ * ext/openssl/ossl_cipher.c (ossl_s_ciphers): new method
+ OpenSSL::Cipher.ciphers. it returns all the cipher names.
- * eval.c (rb_yield_0): pass a raw yielded value to a sole block
- parameter if a value is passed by yield.
+ * ext/openssl/lib/openssl/cipher.rb:
+ - add constants AES128, AES192, AES256. [ruby-dev:28610]
+ - reimplement without eval()
- * eval.c (proc_invoke): args may not be an array.
+ * ext/openssl/lib/openssl/digest.rb: reimplement without eval().
- * eval.c (rb_proc_yield): pass original value without wrapping
- it in an array.
+ * test/openssl/test_cipher.rb, test_digest: fix about reimplemented
+ features.
-Wed Jun 21 14:06:47 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * sample/openssl/cipher.rb: rewrite all.
- * parse.y (method_call): remove (fn)(args) style lambda
- invocation, add fn.(args) instead.
+Sat Jun 19 11:21:46 2006 Eric Hodel <drbrain@segment7.net>
-Wed Jun 21 08:39:54 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * lib/test/unit/assertions.rb: Merge RDoc from HEAD.
- * lib/xmlrpc/create.rb (XMLRPC::Create::conv2value): merge Date
- and Time processing. [ruby-core:08033]
+Tue Jun 20 01:06:57 2006 Kouhei Sutou <kou@cozmixng.org>
-Wed Jun 21 03:01:10 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * lib/rss/rss.rb:
+ - cleanup validation mechanism. Now, #XXX_validation is
+ needless.
+ - changed internal variable name RSS::Element::MODEL to
+ RSS::Element::MODELS.
+ - RSS::Element.install_model requires uri.
- * eval.c, file.c, etc.: code-cleanup patch from Stefan Huehner
- <stefan at huehner.org>. [ruby-core:08029]
+ * lib/rss/0.9.rb: followed new validation API.
+ * lib/rss/1.0.rb: ditto.
+ * lib/rss/2.0.rb: ditto.
+ * lib/rss/content.rb: ditto.
+ * lib/rss/dublincore.rb: ditto.
+ * lib/rss/image.rb: ditto.
+ * lib/rss/syndication.rb: ditto.
+ * lib/rss/taxonomy.rb: ditto.
+ * lib/rss/trackback.rb: ditto.
-Wed Jun 21 01:40:25 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Jun 19 23:40:59 2006 NARUSE, Yui <naruse@ruby-lang.org>
- * parse.y (reswords): modifier token is no longer returned in fname
- state. fixed: [ruby-dev:28775]
+ * ext/nkf/lib/kconv.rb: remove default -m0 and fix document.
-Tue Jun 20 23:28:34 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/nkf/nkf-8/{nkf.c, config.h, utf8tbl.c, utf8tbl.h}:
+ imported nkf 2.0.7.
- * ext/extmk.rb (parse_args): provisional catch-up for the recent changes.
+Mon Jun 19 22:31:59 2006 Kouhei Sutou <kou@cozmixng.org>
- * lib/optparse.rb (OptionParser::List#summarize, OptionParser#order!): ditto.
+ * lib/rss/rss.rb:
+ - provided default #to_s as RSS::Element#to_s.
+ - removed RSS::Element#other_element.
+ - RSS::Element#tag requires attributes as Hash instead of Array.
-Tue Jun 20 11:07:55 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * lib/rss/0.9.rb: removed #to_s to use RSS::Element#to_s.
+ * lib/rss/1.0.rb: ditto.
+ * lib/rss/image.rb: ditto.
+ * lib/rss/taxonomy.rb: ditto.
+ * lib/rss/trackback.rb: ditto.
- * eval.c (proc_invoke): intercept break and return from lambda
- Proc objects. [ruby-dev:28742]
+ * lib/rss/2.0.rb: removed #other_element.
- * eval.c (proc_invoke): remove unnecessary YIELD_PROC_CALL flag.
+Mon Jun 19 22:09:16 2006 Masaki Suketa <masaki.suketa@nifty.ne.jp>
- * eval.c (YIELD_EXACT_ARGS): renamed from YIELD_LAMBDA_CALL, which
- is no longer related to the behavior turned on by this flag.
+ * ext/win32ole/win32ole.c(ole_invoke): support some kind of
+ method of word. [ruby-Bugs#3237]
- * eval.c (return_jump): no need to care about PROT_YIELD.
+ * ext/win32ole/tests/test_word.rb: ditto.
- * eval.c (break_jump): no jump to toplevel PROT_THREAD tag.
+ * ext/win32ole/tests/testall.rb: ditto.
- * eval.c (rb_yield_0): fix confusion between lambda (which is a
- property of a proc) and pcall (which depends on whether it's
- called via yield or call).
+Mon Jun 19 00:02:17 2006 Kouhei Sutou <kou@cozmixng.org>
- * eval.c (rb_thread_yield): no need to specify YIELD_LAMBDA_CALL.
+ * lib/rss/rss.rb: automatically detected attributes.
- * eval.c (rb_block_pass): update blkid in prot_tag.
+ * lib/rss/0.9.rb: removed #_attrs.
+ * lib/rss/1.0.rb: ditto.
+ * lib/rss/2.0.rb: ditto.
+ * lib/rss/image.rb: ditto.
+ * lib/rss/taxonomy.rb: ditto.
+ * lib/rss/trackback.rb: ditto.
-Mon Jun 19 23:40:59 2006 NARUSE, Yui <naruse@ruby-lang.org>
+ * lib/rss/parser.rb: followed new internal API.
- * ext/nkf/lib/kconv.rb: remove default -m0 and fix document.
+Mon Jun 19 00:00:17 2006 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
- * ext/nkf/nkf-8/{nkf.c, config.h, utf8tbl.c, utf8tbl.h}:
- imported nkf 2.0.7.
+ * ext/tk/lib/multi-tk.rb: fix bug: initialize improper tables.
-Mon Jun 19 17:02:14 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+Sun Jun 18 22:36:13 2006 Kouhei Sutou <kou@cozmixng.org>
- * sample/test.rb (proc_return3): return within non lambda block
- should terminate surrounding method. [ruby-dev:28741]
+ * lib/rss/rss.rb: RSS::Element#initialize accepts initial
+ attributes.
+ * lib/rss/0.9.rb: ditto.
+ * lib/rss/1.0.rb: ditto.
+ * lib/rss/2.0.rb: ditto.
+ * lib/rss/dublincore.rb: ditto.
+ * lib/rss/image.rb: ditto.
+ * lib/rss/taxonomy.rb: ditto.
+ * lib/rss/trackback.rb: ditto.
-Mon Jun 19 13:22:48 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * lib/rss/utils.rb: added Utils.element_initialize_arguments? to
+ detect backward compatibility initial arguments.
- * ext/socket/socket.c (unix_sysaccept): typo fixed.
+ * lib/rss/parser.rb: user initial attributes to initialize
+ RSS::Element.
- * ext/socket/socket.c (sock_connect): remove an unused local
- variable tmpaddr.
+Sun Jun 18 18:24:42 2006 Kouhei Sutou <kou@cozmixng.org>
-Mon Jun 19 02:10:32 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * lib/rss/converter.rb: use NKF for Uconv fallback.
- * ext/socket/socket.c (tcp_accept_nonblock): forgot to remove
- abandoned hacks. [ruby-dev:28740]
+Sun Jun 18 18:22:04 2006 Kouhei Sutou <kou@cozmixng.org>
-Mon Jun 19 00:00:17 2006 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * test/rss/test_image.rb: shared name space configuration.
- * ext/tk/lib/multi-tk.rb: fix bug: initialize improper tables.
+Sun Jun 18 18:13:25 2006 Kouhei Sutou <kou@cozmixng.org>
-Sun Jun 18 20:28:43 2006 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+ * lib/rss/rss.rb: improved ignore_unknown_element
+ handling. RSS::NotExpectedTagError provides tag URI.
+ * lib/rss/parser.rb: ditto.
+ * lib/rss/0.9.rb: ditto.
+ * lib/rss/1.0.rb: ditto.
+ * lib/rss/content.rb: ditto.
+ * lib/rss/dublincore.rb: ditto.
+ * lib/rss/image.rb: ditto.
+ * lib/rss/syndication.rb: ditto.
+ * lib/rss/taxonomy.rb: ditto.
+ * lib/rss/trackback.rb: ditto.
- * ext/win32ole/win32ole.c (fole_methods): The return value
- of WIN32OLE#ole_methods should include PROPERTYPUTREF methods.
+ * test/rss/rss-assertions.rb: checked URI of not expected tag too.
+ * test/rss/test_parser.rb: ditto.
- * ext/win32ole/win32ole.c (fole_put_methods): The return value
- of WIN32OLE#ole_put_methods should include PROPERTYPUTREF methods.
+Sun Jun 18 18:08:36 2006 Kouhei Sutou <kou@cozmixng.org>
- * test/win32ole/test_ole_methods.rb: ditto.
+ * lib/rss/rss.rb: changed empty namespace URI representation to ""
+ from nil.
+ * lib/rss/parser.rb: ditto.
+ * lib/rss/0.9.rb: ditto.
+ * lib/rss/1.0.rb: ditto.
+ * lib/rss/2.0.rb: ditto.
- * ext/win32ole/win32ole.c (ole_propertyput): support
- PROPERTYPUTREF. [ruby-talk:183042]
+Sun Jun 18 18:03:50 2006 Kouhei Sutou <kou@cozmixng.org>
- * test/win32ole/test_propertyputref.rb: ditto.
+ * lib/rss/parser.rb: removed a guard for requiring open-uri.
-Sat Jun 17 23:42:26 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+Sun Jun 18 18:01:26 2006 Kouhei Sutou <kou@cozmixng.org>
- * eval.c (Init_eval): add aliases invoke_method and
- invoke_functional_method corresponding send and funcall
- respectively. [ruby-talk:197512]
+ * lib/rss/rss.rb: fixed typo: except -> expect
+ * lib/rss/parser.rb: ditto.
+ * test/rss/rss-assertions.rb: ditto.
+ * test/rss/test_parser.rb: ditto.
- * parse.y (parser_yylex): returns the most typical keyword token
- on EXPR_FNAME. [ruby-core:7995]
+Sun Jun 18 17:52:39 2006 Kouhei Sutou <kou@cozmixng.org>
- * ext/socket/socket.c: protoize.
+ * lib/rss/rss.rb: RSS::Element#calc_indent became to be deprecated.
+ * lib/rss/0.9.rb: ditto.
+ * lib/rss/1.0.rb: ditto.
+ * lib/rss/image.rb: ditto.
+ * lib/rss/taxonomy.rb: ditto.
+ * lib/rss/trackback.rb: ditto.
+
+ * test/rss/test_1.0.rb: removed RSS::Element.indent_size tests.
+ * test/rss/test_2.0.rb: ditto.
+
+Sun Jun 18 00:49:11 2006 Tanaka Akira <akr@m17n.org>
+
+ * ext/socket/socket.c (bsock_recv_nonblock): new method
+ BasicSocket#recv_nonblock.
+ (udp_recvfrom_nonblock): renamed from ip_recvfrom_nonblock.
+ IPSocket#recvfrom_nonblock is moved to UDPSocket#recvfrom_nonblock.
+ (unix_recvfrom_nonblock): removed.
+ UNIXSocket#recvfrom_nonblock is removed.
Sat Jun 17 22:17:17 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
@@ -45641,147 +7390,227 @@ Sat Jun 17 22:17:17 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
Sat Jun 17 14:53:32 2006 Tanaka Akira <akr@m17n.org>
- * lib/pathname.rb (Kernel#Pathname): new method.
+ * lib/pathname.rb: backport from 1.9.
+ (Kernel#Pathname): new method.
-Sat Jun 17 02:01:00 2006 Tanaka Akira <akr@m17n.org>
+Sat Jun 17 10:30:41 2006 Kouhei Sutou <kou@cozmixng.org>
- * lib/pp.rb (Kernel#pretty_inspect): defined for pretty printed
- string.
+ * lib/rss/rss.rb (Hash#merge, Enumerable#sort_by): removed.
-Fri Jun 16 01:41:00 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/rss/rss.rb (RSS::RootElementMixin#to_xml): added.
+ [ruby-talk:197284]
- * eval.c (rb_proc_arity): get rid of segfault for mere splat.
+ We can convert RSS version easily like the following:
+ rss10 = RSS::Parser.parse(File.read("1.0.rdf"))
+ File.open("2.0.rss", "w") {|f| f.print(rss10.to_xml("2.0"))}
- * gc.c (gc_mark_children): NODE_BLOCK_PASS needs u3 to be marked.
+ * test/rss/test_1.0.rb: added #to_xml test.
+ * test/rss/test_2.0.rb: ditto.
-Thu Jun 15 22:06:56 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * test/rss/rss-testcase.rb: added some helper methods that
+ generates sample RSS 2.0.
- * parse.y (then): remove ':' from 'then' and 'do' rules.
+ * sample/rss/convert.rb: added a sample script to convert RSS format.
-Wed Jun 14 18:00:20 2006 Eric Hodel <drbrain@segment7.net>
+Sat Jun 17 10:23:22 2006 Kouhei Sutou <kou@cozmixng.org>
- * enum.c (enum_any): Documentation typo.
+ * lib/rss/rss.rb (Kernel#funcall): removed.
+ * lib/rss/parser.rb (Kernel.URI): removed.
-Wed Jun 14 15:01:09 2006 Eric Hodel <drbrain@segment7.net>
+ * lib/rss/maker/: supported
+ xxx.new_yyy do |yyy|
+ yyy.zzz = zzz
+ ...
+ end
+ style and this style became the style of the recommendation.
- * lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser#warn): Don't print
- warnings when -q is set.
+ Old style
+ yyy = xxx.new_yyy
+ yyy.zzz = zzz
+ ...
+ is supported too but this style isn't recommended.
+ [ruby-talk:197284]
-Wed Jun 14 16:11:37 2006 NAKAMURA Usaku <usa@ruby-lang.org>
+ * test/rss/test_*maker*.rb: used new recommended style.
- * eval.c (rb_f_method_name, rb_f_callee_name): document typo.
+Sat Jun 17 09:03:47 2006 Kouhei Sutou <kou@cozmixng.org>
-Wed Jun 14 15:19:14 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * lib/rss, test/rss: backported from trunk. (2005-11-16 - now)
- * hash.c (env_aset): raise TypeError on nil with more descriptive
- message. [ruby-core:07990]
+ * lib/rss/rss.rb (RSS::VERSION): 0.1.5 -> 0.1.6.
+ * test/rss/test_version.rb (RSS::TestVersion#test_version): ditto.
-Tue Jun 13 17:22:19 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * lib/rss/trackback.rb: added TrackBack prefix.
+ * lib/rss/maker/trackback.rb: ditto.
- * ext/socket/socket.c (Init_socket): remove obsolete constants:
- IPsocket, TCPsocket, SOCKSsocket, TCPserver, UDPsocket,
- UNIXsocket, UNIXserver.
+ * lib/rss/rss.rb : removed needless argument 'prefix'.
+ * lib/rss/parser.rb: ditto.
-Tue Jun 13 09:07:27 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * lib/rss/1.0.rb: added rdf:Bag.
- * eval.c (formal_assign): post splat arguments should have had
- higher priority than optional arguments, since they are
- mandatory. [ruby-dev:28715]
+ * lib/rss/taxonomy.rb: implemented taxonomy module.
+ * test/rss/test_taxonomy.rb: added tests for taxonomy support.
- * eval.c (VIS_MASK): broken. should be 15. [ruby-dev:28715]
+ * lib/rss/1.0.rb: added convenience method 'resources'.
+ * lib/rss/taxonomy.rb: ditto.
+ * test/rss/rss-assertions.rb: added test for 'resources'.
+ * test/rss/test_taxonomy.rb: ditto.
- * io.c (argf_getc): should return one-character string.
- [ruby-dev:28715]
+ * lib/rss/rss.rb: fixed a indentation bug.
+ * lib/rss/taxonomy.rb: fixed <taxo:topic> #to_s bug.
+ * test/rss/test_taxonomy.rb: added a #to_s test.
- * io.c (rb_io_readchar): ditto.
+ * lib/rss/maker/taxonomy.rb: implemented taxonomy module for RSS
+ Maker.
+ * lib/rss/taxonomy.rb: supported RSS Maker.
+ * lib/rss/maker.rb: added taxonomy module support.
-Sun Jun 11 23:20:07 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/rss/rss.rb: adjusted to other element API.
+ * lib/rss/1.0.rb: adjusted to other element API but backward
+ compatibility is reserved.
+ * lib/rss/0.9.rb: ditto.
- * object.c (sym_call): disallow to call private methods.
+ * test/rss/test_maker_taxo.rb: added test case for taxonomy module
+ for RSS Maker.
+ * test/rss/test_setup_maker_1.0.rb: added tests for taxo:topic.
- * lib/optparse.rb (OptionParser::Arguable#getopts): pass self to the
- parser.
+ * test/rss/test_setup_maker_1.0.rb: added backward compatibility
+ test.
+ * test/rss/test_setup_maker_0.9.rb: ditto.
+ * test/rss/test_setup_maker_2.0.rb: ditto.
-Sun Jun 11 09:56:41 2006 NAKAMURA Usaku <usa@ruby-lang.org>
+ * test/rss/rss-testcase.rb: added convenience method for setting
+ up taxo:topic.
+ * test/rss/rss-assertions.rb: added assertion for taxo:topic.
- * win32/win32.h (write): not need to define on bcc.
+ * sample/rss/blend.rb: followed new API.
-Sun Jun 11 08:30:33 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/rss/taxonomy.rb: changed class or module prefix to
+ Taxonomy from Taxo.
+ * lib/rss/maker/taxonomy.rb: ditto.
- * lib/optparse.rb (OptionParser#getopts): new methods.
+ * test/rss/test_taxonomy.rb: use #reject directory.
-Sun Jun 11 07:27:11 2006 NAKAMURA Usaku <usa@ruby-lang.org>
+ * lib/rss/: use #__send__ instead of #send.
+ * test/rss/: ditto.
- * lib/rdoc/ri/ri_writer.rb: use String#ord.
+ * lib/rss/parser.rb: added entity handling type predicate.
+ * lib/rss/rexmlparser.rb: ditto.
+ * lib/rss/xmlparser.rb: ditto.
+ * lib/rss/xmlscanner.rb: ditto.
-Sun Jun 11 04:38:20 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/rss/xmlscanner.rb: more robust entity handling.
- * object.c (sym_to_proc): imported Symbol#to_proc from ActiveSupport.
+ * test/rss/test_parser.rb: added an entity handling test.
-Sat Jun 10 18:02:40 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * test/rss/test_2.0.rb: added RSS 2.0 tests.
+ * test/rss/rss-assertions.rb: extended XML stylesheet assertion.
+ * lib/rss/0.9.rb: added initialize method.
+ * test/rss/test_1.0.rb: cleanup.
- * ext/bigdecimal/lib/bigdecimal/newton.rb (Newton::nlsolve): typo
- fixed: raize -> raise. [ruby-talk:196608]
+ * lib/rss/image.rb: added Image prefix.
+ * lib/rss/maker/image.rb: ditto.
-Sat Jun 10 17:49:53 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * lib/rss/rss.rb: improved type conversion.
+ * lib/rss/1.0.rb: ditto.
+ * lib/rss/0.9.rb: ditto.
+ * lib/rss/2.0.rb: ditto.
+ * lib/rss/image.rb: ditto.
+ * lib/rss/syndication.rb: ditto.
- * string.c (rb_str_ord): new method.
+ * test/rss/test_2.0.rb: added type conversion tests.
+ * test/rss/test_accessor.rb: ditto.
+ * test/rss/test_to_s.rb: ditto.
+ * test/rss/test_syndication.rb: ditto.
+ * test/rss/test_setup_maker_2.0.rb: ditto.
+ * test/rss/test_setup_maker_1.0.rb: ditto.
+ * test/rss/test_setup_maker_0.9.rb: ditto.
+ * test/rss/test_maker_sy.rb: ditto.
+ * test/rss/test_maker_image.rb: ditto.
+ * test/rss/test_maker_2.0.rb: ditto.
+ * test/rss/test_maker_0.9.rb: ditto.
+ * test/rss/test_image.rb: ditto.
- * parse.y (rbracket): allow optional newline before closing
- brackets.
+ * test/rss/test_maker_1.0.rb: use assert instead of assert_equal.
-Sat Jun 10 15:12:29 2006 NAKAMURA Usaku <usa@ruby-lang.org>
+ * test/rss/rss-assertions.rb: improved type conversion assertions.
- * eval.c (rb_f_method_name, rb_f_callee_name): new functions.
- new global method `__method__' and `__callee__'.
+ * lib/rss/rss.rb: added backward compatibility codes.
+ * lib/rss/parser.rb: ditto.
+ * test/rss/test_parser.rb: ditto.
+ * test/rss/test_2.0.rb: ditto.
-Sat Jun 10 10:13:13 2006 NAKAMURA Usaku <usa@ruby-lang.org>
+Sat Jun 17 02:01:00 2006 Tanaka Akira <akr@m17n.org>
- * lib/getoptlong.rb (GetoptLong#set_options): receive arguments
- as Array.
+ * lib/pp.rb (Kernel#pretty_inspect): defined for pretty printed
+ string.
- * lib/irb/slex.rb: use Proc#yield.
+Sat Jun 17 00:23:58 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/rdoc/markup/simple_markup/inline.rb: follow the new behavior
- of String#[].
+ * parse.y (reswords): kDO_BLOCK was missing. fixed: [ruby-core:7995]
- * lib/rdoc/ri/ri_writer.rb: ditto.
+Sat Jun 17 00:02:15 2006 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-Sat Jun 10 08:17:23 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/win32ole/win32ole.c (ole_propertyput): support
+ PROPERTYPUTREF. [ruby-talk:183042]
- * math.c (log2): may be a macro.
+ * ext/win32ole/tests/test_propertyputref.rb: ditto.
- * parse.y (args, block_param, f_args): pass f_post_arg to #params.
+Thu Jun 15 23:02:47 2006 Masaki Suketa <masaki.suketa@nifty.ne.jp>
- * util.c (powersOf10): constified.
+ * ext/win32ole/win32ole.c (fole_methods): The return value
+ of WIN32OLE#ole_methods should include PROPERTYPUTREF methods.
- * ext/readline/readline.c: include extconf.h first.
+ * ext/win32ole/win32ole.c (fole_put_methods): The return value
+ of WIN32OLE#ole_put_methods should include PROPERTYPUTREF methods.
- * ext/ripper/eventids2.c: removed tLAMBDA_ARG.
+ * ext/win32ole/tests/test_ole_methods.rb: ditto.
- * ext/tk/tcltklib.c (lib_fromUTF8_core): removed conflict.
+ * ext/win32ole/tests/testall.rb : ditto.
- * ext/tk/tkutil/tkutil.c (cbsubst_get_subst_arg): rb_id2name() is
- defined as const now.
+Wed Jun 14 18:23:28 2006 Eric Hodel <drbrain@segment7.net>
- * ext/win32ole/win32ole.c (fole_missing): ditto.
+ * enum.c (enum_any): Documentation typo.
- * lib/mkmf.rb (create_makefile): force to create extconf header.
+Wed Jun 14 15:01:09 2006 Eric Hodel <drbrain@segment7.net>
- * lib/optparse.rb (order!): use Proc#yield.
+ * lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser#warn): Don't print
+ warnings when -q is set.
-Sat Jun 10 06:53:22 2006 NAKAMURA Usaku <usa@ruby-lang.org>
+Wed Jun 14 23:03:53 2006 Tanaka Akira <akr@m17n.org>
- * eval.c (CALLARGS): remove last semicolon. C90 compiler doesn't
- allow any lines (even if they're empty) within variable
- declarations.
+ * configure.in: check sizeof(rlim_t).
+ check setrlimit.
-Fri Jun 9 09:56:32 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * process.c (proc_getrlimit): new method Process.getrlimit.
+ (proc_setrlimit): new method Process.setrlimit.
- * sprintf.c (rb_str_format): allow %c to print one character
- string (e.g. ?x).
+ * ruby.h (NUM2ULL): new macro.
-Thu Jun 8 14:00:02 2006 NAKAMURA Usaku <usa@ruby-lang.org>
+Mon Jun 12 22:25:09 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * sprintf.c (rb_f_sprintf): adjust precision length to prevent
+ splitting multi-byte characters. [ruby-list:42389]
+
+Sun Jun 11 23:20:07 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/optparse.rb (OptionParser::Arguable#getopts): pass self to the
+ parser.
+
+Sun Jun 11 10:00:57 2006 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * win32/win32.h (write): not need to define on bcc.
+
+Sun Jun 11 08:30:33 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/optparse.rb (OptionParser#getopts): new methods.
+
+Sat Jun 10 18:02:40 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * ext/bigdecimal/lib/bigdecimal/newton.rb (Newton::nlsolve): typo
+ fixed: raize -> raise. [ruby-talk:196608]
+
+Thu Jun 8 14:19:17 2006 NAKAMURA Usaku <usa@ruby-lang.org>
* win32/win32.[ch] (rb_w32_read, rb_w32_write): new functions.
use recv() and send() when fd is socket. fixed: [ruby-dev:28694]
@@ -45791,25 +7620,43 @@ Wed Jun 7 16:22:51 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
-Wed Jun 7 16:16:29 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+Wed Jun 7 14:53:04 2006 NAKAMURA Usaku <usa@ruby-lang.org>
- * parse.y (do_block): remove -> style block.
+ * win32/win32.c (errmap): add some winsock errors.
- * parse.y (parser_yylex): remove tLAMBDA_ARG.
+Wed Jun 7 11:34:38 2006 NAKAMURA Usaku <usa@ruby-lang.org>
-Wed Jun 7 14:51:22 2006 NAKAMURA Usaku <usa@ruby-lang.org>
+ * configure.in: add new configure option `--with-winsock2' for mingw.
- * win32/win32.c (errmap): add some winsock errors.
+ * win32/Makefile.sub (config.h): define USE_WINSOCK2 in config.h
+ instead of in CPPFLAGS.
+
+ * ext/socket/extconf.rb: determine whether to use winsock2 or not
+ by using with_config.
+
+Wed Jun 7 10:45:10 2006 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * win32/{configure.bat, setup.mak, Makefile.sub, win32.h}: add
+ new configure option `--with-winsock2'.
+
+ * win32/win32.c (StartSockets): ditto.
+
+ * ext/socket/extconf.rb: ditto.
+
+ * win32/win32.c (open_ifs_socket): new function.
+
+ * win32/win32.c (StartSockets, rb_w32_socket): use open_ifs_socket()
+ instead of socket().
+ ifs socket support is backported from trunk.
Wed Jun 7 09:14:44 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
-Tue Jun 6 23:25:49 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (proc_invoke): return behavior should depend whether it
- is surrounded by a lambda or a mere block.
+ * eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
+ event_hooks. no guarantee for arbitrary hook deletion.
+ [ruby-dev:28632]
Mon Jun 5 18:12:12 2006 Tanaka Akira <akr@m17n.org>
@@ -45823,21 +7670,12 @@ Sun Jun 4 20:40:19 2006 Tanaka Akira <akr@m17n.org>
* ext/socket/socket.c: fix sockaddr_un handling.
[ruby-dev:28677]
-Sat Jun 3 23:53:18 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (formal_assign): handles post splat arguments.
-
- * eval.c (rb_call0): ditto.
-
-Sat Jun 3 13:10:41 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * st.c (strhash): use FNV-1a hash.
+Fri Jun 2 22:08:17 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-Fri Jun 2 20:01:24 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * lib/forwardable.rb: RDoc typo fix from Jan Svitok
+ <jan.svitok at gmail.com>. [ruby-core:07943]
- * parse.y (parser_yylex): removed experimental ';;' terminator.
-
-Fri Jun 2 19:00:40 2006 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Fri Jun 2 19:02:09 2006 GOTOU Yuuzou <gotoyuzo@notwork.org>
* ext/openssl/extconf.rb: use create_header.
@@ -45866,83 +7704,23 @@ Thu Jun 1 19:12:37 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
* win32/win32.c (rb_w32_cmdvector): backslashes inside single-quotes
no longer has special meanings. fixed: [ruby-list:42311]
-Thu Jun 1 17:55:42 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (rb_node_arity): should be aware of post splat arguments.
-
- * eval.c (rb_proc_arity): ditto.
-
-Thu Jun 1 16:17:26 2006 NAKAMURA Usaku <usa@ruby-lang.org>
+Thu Jun 1 16:14:41 2006 NAKAMURA Usaku <usa@ruby-lang.org>
* win32/win32.c (rb_w32_getcwd): runtime's getcwd() will not success
if the length of the cwd is longer than MAX_PATH.
fixed [ruby-list:42335]
-Thu Jun 1 16:07:48 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * parse.y (f_args): syntax rule enhanced to support arguments
- after the splat.
-
- * parse.y (mlhs_basic): ditto for multiple assignments
-
- * parse.y (block_param): ditto for block parameters.
-
- * parse.y (f_post_arg): mandatory formal arguments after the splat
- argument.
-
- * parse.y (new_args_gen): generate nodes for mandatory formal
- arguments after the splat argument.
-
- * eval.c (rb_eval): dispatch mandatory formal arguments after the
- splat argument.
-
-Thu Jun 1 11:33:32 2006 NAKAMURA Usaku <usa@ruby-lang.org>
+Thu Jun 1 11:29:14 2006 NAKAMURA Usaku <usa@ruby-lang.org>
* win32/win32.c (rb_w32_getcwd): set errno if not set.
fixed [ruby-list:42346]
-Thu Jun 1 00:45:52 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * parse.y (args): allow more than one splat in the argument list.
-
-Wed May 31 18:38:11 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * parse.y (method_call): allow aref [] to accept all kind of
- method argument, including assocs, splat, and block argument.
-
- * eval.c (SETUP_ARGS0): prepare block argument as well.
-
-Tue May 30 18:13:53 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
-
-Mon May 29 22:40:13 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (error_line): print receivers true/false/nil specially.
-
- * eval.c (rb_proc_yield): handles parameters in yield semantics.
-
- * eval.c (nil_yield): gives LocalJumpError to denote no block
- error.
-
- * io.c (rb_io_getc): now takes one-character string.
-
-Sat May 27 22:46:38 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (proc_invoke): save and restore block in the current frame.
- fixed: [ruby-core:07833], [ruby-talk:191639]
-
-Sat May 27 11:29:46 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat May 27 11:29:46 2006 nobuyoshi nakada <nobu@ruby-lang.org>
* ext/extmk.rb (extmake): remove extinit files if no statically linked
extensions.
-Fri May 26 19:56:46 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
- hashing algorithm.
-
-Fri May 26 09:05:11 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri May 26 09:05:11 2006 nobuyoshi nakada <nobu@ruby-lang.org>
* ruby.h, lib/mkmf.rb (create_header): clear command line options for
macros moved to extconf.h.
@@ -45957,7 +7735,7 @@ Fri May 26 09:05:11 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/mkmf.rb (configuration): add $defs unless extconf.h was created.
-Thu May 25 01:52:07 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu May 25 01:52:07 2006 nobuyoshi nakada <nobu@ruby-lang.org>
* lib/mkmf.rb (pkg_config): particular config commands support.
@@ -45971,27 +7749,23 @@ Thu May 25 01:52:07 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
* win32/setup.mak: suffix OS name by runtime version.
-Wed May 24 23:52:11 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed May 24 23:52:11 2006 nobuyoshi nakada <nobu@ruby-lang.org>
* configure.in (ac_install_sh): ignore dummy install-sh.
[ruby-talk:193876]
-Wed May 24 17:55:13 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * string.c (rb_str_aref): str[0] now returns 1 character string,
- instead of a fixnum. [Ruby2]
-
- * parse.y (parser_yylex): ?c now returns 1 character string,
- instead of a fixnum. [Ruby2]
-
- * string.c (rb_str_aset): no longer support fixnum insertion.
-
-Wed May 24 03:10:44 2006 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Wed May 24 03:10:48 2006 GOTOU Yuuzou <gotoyuzo@notwork.org>
* ext/openssl/lib/openssl/ssl.rb
(OpenSSL::SSL::SocketForwarder#setsockopt,getsockopt): typo fixed.
-Mon May 22 16:32:03 2006 Tanaka Akira <akr@m17n.org>
+Mon May 22 17:54:12 2006 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * ext/socket/socket.c (sock_recvfrom_nonblock): use rb_read_pending
+ instead of rb_io_read_pending.
+ [ruby-dev:28663]
+
+Mon May 22 17:30:04 2006 Tanaka Akira <akr@m17n.org>
* rubyio.h (rb_io_set_nonblock): declared.
@@ -46000,8 +7774,7 @@ Mon May 22 16:32:03 2006 Tanaka Akira <akr@m17n.org>
(io_read_nonblock): new method: IO#read_nonblock.
(io_write_nonblock): new method: IO#write_nonblock.
- * ext/socket/socket.c (s_accept): retry for EWOULDBLOCK.
- revert [ruby-talk:113807].
+ * ext/socket/socket.c
(sock_connect_nonblock): new method: Socket#connect_nonblock.
(sock_accept_nonblock): new method: Socket#accept_nonblock.
(sock_recvfrom_nonblock): new method: Socket#recvfrom_nonblock.
@@ -46018,33 +7791,6 @@ Mon May 22 13:38:57 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
-Sun May 21 09:50:31 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
-
- * regexec.c: add STK_NULL_CHECK_END to IS_TO_VOID_TARGET().
- [ruby-list:42234]
-
-Thu May 18 22:37:20 2006 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * lib/webrick/config.rb (WEBrick::Config::HTTP): add new parameters,
- :InputBufferSize and :OutputBufferSize.
-
- * lib/webrick/utils.rb (WEBrick::Utils.timeout): add new timeout
- method. this implementation is expected to be compatible with
- timeout.rb and faster than timeout.rb.
-
- * lib/webrick/httprequest.rb (WEBrick::HTTPRequest#_read_data):
- Timeout.timeout is replaced by WEBrick::Utils.timeout.
-
- * lib/webrick/httprequest.rb: WEBrick::HTTPRequest::BUFSIZE is
- replaced by config[:InputBufferSize].
-
- * lib/webrick/httpresposne.rb: WEBrick::HTTPResponse::BUFSIZE is
- replaced by config[:OutputBufferSize].
-
- * lib/webrick/server.rb: get rid of unnecessary require.
-
- * test/webrick/test_utils.rb: test for WEBrick::Utils.timeout.
-
Thu May 18 17:51:32 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
* time.c (time_timeval): should round for usec floating
@@ -46052,21 +7798,24 @@ Thu May 18 17:51:32 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
* time.c (time_add): ditto.
-Thu May 18 00:42:12 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu May 18 17:11:45 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * lib/cgi.rb (CGI::out): support utf-8. a patch from Fujioka
+ <fuj at rabbix.jp>. [ruby-dev:28649]
+
+Thu May 18 00:42:12 2006 nobuyoshi nakada <nobu@ruby-lang.org>
* ext/extmk.rb, lib/mkmf.rb: use BUILD_FILE_SEPARATOR in Makefiles.
Wed May 17 17:55:26 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
* dir.c (sys_warning): should not call a vararg function
- rb_sys_warning() indirectly. [ruby-core:07886]
+ rb_sys_warning() indirectly. [ruby-core:07886]
-Tue May 16 17:23:19 2006 Shin-ichiro HARA <sinara@blade.nagaokaut.ac.jp>
+Wed May 17 08:17:15 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
- * numeric.c (flo_divmod): the first element of Float#divmod should
- be an integer. [ruby-dev:28589]
-
- * test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
+ * util.c (ruby_strtod): try to reduce errors using powersOf10
+ table. [ruby-dev:28644]
Tue May 16 15:34:18 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
@@ -46084,10 +7833,6 @@ Tue May 16 09:20:16 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
-Mon May 15 21:37:12 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
-
- * re.c (rb_reg_prepare_re): don't use onig_recompile().
-
Mon May 15 17:42:39 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
@@ -46101,85 +7846,40 @@ Sat May 13 16:14:05 2006 Tanaka Akira <akr@m17n.org>
(Struct#pretty_print_cycle): ditto.
[ruby-core:7865]
-Fri May 12 15:54:48 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
- event_hooks. no guarantee for arbitrary hook deletion.
- [ruby-dev:28632]
-
Thu May 11 19:57:00 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
-Thu May 11 18:30:11 2006 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Fri Aug 11 15:39:25 2006 Eric Hodel <drbrain@segment7.net>
- * ext/openssl/ossl_cipher.c (add_cipher_name_to_ary): should return
- value. [ruby-dev:28627]
+ * lib/yaml/tag.rb: Replace nodoc with stopdoc so Module methods get
+ documented.
Thu May 11 18:10:43 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
-Wed May 10 23:40:21 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
-
- * oniguruma.h: Version 4.0.3
-
- * regexec.c: ditto.
-
-Mon May 8 09:10:31 2006 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * ext/openssl/extconf.rb: add check for OBJ_NAME_do_all_sorted.
-
- * ext/openssl/ossl_cipher.c (ossl_s_ciphers): new method
- OpenSSL::Cipher.ciphers. it returns all the cipher names.
-
- * ext/openssl/ossl_cipher.c (ossl_cipher_init): refine warning message.
-
- * ext/openssl/lib/openssl/cipher.rb: reimplement without eval() and
- add constants AES128, AES192, AES256. [ruby-dev:28610]
-
- * ext/openssl/lib/openssl/digest.rb: reimplement without eval().
-
- * test/openssl/test_cipher.rb, test_digest: fix about reimplemented
- features.
-
- * sample/openssl/cipher.rb: rewrite all.
-
Sun May 7 03:09:51 2006 Stephan Maka <stephan@spaceboyz.net>
* lib/resolv.rb (Resolv::DNS::Requester::ConnectedUDP#initialize):
Use AF_INET6 for nameservers containing colons.
-Sat May 6 23:40:03 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (proc_invoke): should restore old ruby_frame->block.
- thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
- also fix [ruby-dev:28614] as well.
-
Sat May 6 00:38:42 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
-Thu May 4 22:13:22 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * math.c (math_log2): add new method inspired by
- [ruby-talk:191237].
-
- * math.c (math_log): add optional base argument to Math::log().
- [ruby-talk:191308]
-
Thu May 4 02:24:16 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
- uninitialized array element. a patch from Pat Eyler
+ uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
- patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
+ patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
@@ -46191,17 +7891,17 @@ Wed May 3 02:12:07 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
-Mon May 1 17:58:16 2006 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+Mon May 1 12:23:19 2006 <sinara@blade.nagaokaut.ac.jp>
- * ext/win32ole/win32ole.c (add_event_call_back): should not
- delete event handler when the event name is not entried.
+ * numeric.c (num_div): use floor rather than rb_Integer().
+ [ruby-dev:28589]
-Mon May 1 08:32:10 2006 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+ * numeric.c (flo_divmod): the first element of Float#divmod should
+ be an integer. [ruby-dev:28589]
- * ext/win32ole/win32ole.c (ole_param_ole_type): should return
- "unknown type" string when ITypeInfo::GetFuncDesc failed.
+ * test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
-Sat Apr 29 22:43:37 2006 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Sat Apr 29 22:42:08 2006 GOTOU Yuuzou <gotoyuzo@notwork.org>
* ext/openssl/ossl_asn1.c (ossl_asn1_decode0): should initialize
flag. [ruby-core:07785]
@@ -46211,6 +7911,8 @@ Fri Apr 28 10:53:16 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
+ * util.c (ruby_strtod): fixed wrong conversion.
+
Thu Apr 27 01:38:10 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
* array.c (rb_ary_fill): internalize local variable "beg" to
@@ -46219,12 +7921,7 @@ Thu Apr 27 01:38:10 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
Wed Apr 26 16:59:24 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
- <tommy at tmtm.org>. [ruby-dev:28601]
-
-Wed Apr 26 16:55:19 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * applied code clean-up patch from Stefan Huehner
- <stefan at huehner.org>. [ruby-core:07764]
+ <tommy at tmtm.org>. [ruby-dev:28601]
Tue Apr 25 18:00:05 2006 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
@@ -46237,21 +7934,22 @@ Tue Apr 25 07:55:31 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
+Tue Apr 25 00:08:24 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * regex.c (re_compile_pattern): should check if c is not a
+ multibyte character. a patch from KIMURA Koichi
+ <kimura.koichi at canon.co.jp>. [ruby-dev:28598]
+
Fri Apr 21 15:19:13 2006 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
- * ext/tk/tcltklib.c (lib_eventloop_ensure): avoid dereferencing
- freed pointer [ruby-core:07744] and memory leak.
+ * ext/tk/tcltklib.c (lib_eventloop_ensure): refer freed pointer
+ [ruby-core:07744] and memory leak.
Fri Apr 21 12:14:52 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
-Thu Apr 20 08:43:54 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/mathn.rb (Integer): need not to remove gcd2. a patch from
- NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
-
Wed Apr 19 13:55:27 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
* parse.y (arg): too much NEW_LIST()
@@ -46263,6 +7961,8 @@ Wed Apr 19 11:57:04 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
+ * parse.y (list_concat): revert last change.
+
* parse.y (arg): use NODE_ARGSCAT for placeholder.
Wed Apr 19 11:13:17 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
@@ -46275,6 +7975,11 @@ Wed Apr 19 10:13:27 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
+Wed Apr 19 09:49:36 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * parse.y (list_concat): should not modify nodes other than
+ NODE_ARRAY. [ruby-dev:28583]
+
Tue Apr 18 17:40:37 2006 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tk/lib/multi-tk.rb: add a binding to a container for a slave IP.
@@ -46285,6 +7990,19 @@ Tue Apr 18 17:40:37 2006 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tk/stubs.c: fix potential bugs about handling rb_argv0.
+Tue Apr 18 00:11:21 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * eval.c: block_unique should be 1, not frame_unique.
+ [ruby-dev:28577]
+
+Fri Aug 11 15:39:25 2006 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rdoc/parsers/parse_c.rb (RDoc::C_Parser#find_body): Make RDoc
+ ignore C function prototypes. Patch by Tilman Sauerbeck
+ <tilman at code-monkey.de>. [ruby-core:8574]
+ * lib/yaml/tag.rb: Replace nodoc with stopdoc so Module methods get
+ documented.
+
Mon Apr 10 01:03:10 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
* prec.c (prec_prec_f): documentation patch from
@@ -46299,30 +8017,10 @@ Sat Apr 8 02:12:38 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
* README.EXT: update symbol description. [ruby-talk:188104]
-Sat Apr 8 18:06:28 2006 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-
- * ext/win32ole/win32ole.c: add WIN32OLE_METHOD#inspect,
- WIN32OLE_PARAM#inspect.
-
- * test/win32ole/test_win32ole_method.rb: ditto.
-
- * add test/win32ole/test_win32ole_param.rb.
-
-Fri Apr 7 22:11:30 2006 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-
- * ext/win32ole/win32ole.c(foletypelib_initialize): WIN32OLE_TYPELIB.new
- accepts OLE file.
-
- * test/win32ole/test_win32ole_typelib.rb(test_initialize): ditto.
-
Thu Apr 6 23:28:47 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
-Thu Apr 6 16:43:06 2006 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * intern.h (rb_obj_instance_exec, rb_mod_module_exec): add declaration.
-
Thu Apr 6 11:18:37 2006 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tk/lib/tk/panedwindow.rb: lack of arguments. [ruby-core:7681]
@@ -46346,51 +8044,27 @@ Thu Apr 6 01:04:47 2006 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tk/lib/tk/variable.rb: remove warning about unseting Tcl
variables.
-Wed Apr 5 00:22:54 2006 Tanaka Akira <akr@m17n.org>
+Wed Mar 29 20:54:44 2006 Masaki Suketa <masaki.suketa@nifty.ne.jp>
- * lib/pathname.rb: use a subclass for instantiation except
- methods take pathname argument. suggested by Evan Phoenix.
- [ruby-core:7618]
-
-Tue Apr 4 22:15:41 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * parse.y: remove some obsolete syntax rules (unparenthesized
- method calls in argument list).
-
-Sat Apr 1 15:11:27 2006 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-
- * ext/win32ole/win32ole.c: add WIN32OLE_TYPE#inspect,
- WIN32OLE_VARIABLE#inspect
-
- * remove ext/win32ole/tests/testOLEVARIABLE.rb, testOLETYPE.rb
- testOLETYPELIB.rb.
-
- * testall.rb: ditto.
-
- * add test/win32ole
-
-Fri Mar 31 14:24:55 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * enumerator.c (enumerator_with_index): removed suspicious return
- statement.
+ * ext/win32ole/win32ole.c (fole_getproperty): WIN32OLE#[] should accept
+ multi arguments.
-Wed Mar 29 23:06:48 2006 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+ * ext/win32ole/tests/testWIN32OLE.rb (test_setproperty_bracket): ditto.
- * ext/win32ole/win32ole.c (ole_invoke): change the behavior of
- WIN32OLE#[], WIN32OLE#[]=. These methods invoke DISPID_VALUE.
-
- * ext/win32ole/sample/excel2.rb: ditto.
-
- * ext/win32ole/tests/testWIN32OLE.rb: ditto.
-
-Wed Mar 29 10:11:31 2006 NAKAMURA Usaku <usa@ruby-lang.org>
+Wed Mar 29 10:07:44 2006 NAKAMURA Usaku <usa@ruby-lang.org>
* ext/nkf/nkf-utf8/nkf.c (nkf_each_char_to_hex, encode_fallback_subchar,
e2w_conv): support C90 compiler.
-Mon Mar 27 22:45:37 2006 NARUSE, Yui <naruse@ruby-lang.org>
+Wed Mar 29 06:48:40 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
- * ext/nkf/nkf-utf8/{nkf.c, utf8tbl.c}: imported nkf 2.0.6.
+ * eval.c (backtrace): reports aliased method names in a generated
+ backtrace. a patch from "U.Nakamura" <usa at garbagecollect.jp>.
+ [ruby-dev:28471]
+
+Mon Mar 27 22:19:09 2006 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * ext/nkf/nkf-utf8/{nkf.c, utf8tbl.c, config.h}: imported nkf 2.0.6.
* Add --ic / --oc option and mapping tables.
* Add fallback option.
* Add --no-best-fit-chars option.
@@ -46401,12 +8075,6 @@ Mon Mar 27 22:45:37 2006 NARUSE, Yui <naruse@ruby-lang.org>
* ext/nkf/lib/kconv.rb (Kconv.to*): add -m0.
Note that Kconv.to* still imply -X.
- * ext/nkf/test.rb: Removed. Obsolete by test/nkf.
-
- * ext/.document: enabled documents in nkf and kconv
-
- * ext/nkf/nkf.c, ext/nkf/lib/kconv.rb: Add rdoc.
-
Mon Mar 27 03:17:21 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
* eval.c (rb_call0): insecure calling should be checked for non
@@ -46415,125 +8083,53 @@ Mon Mar 27 03:17:21 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
-Sun Mar 26 22:02:51 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
-
- * re.c: refactoring for options.
-
- * parse.y: ditto.
+Fri Mar 24 23:14:30 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-Fri Mar 24 21:11:02 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
-
- * re.c (match_aref): RDoc description updated.
-
- * string.c (rb_str_sub): ditto.
-
- * string.c (rb_str_gsub): ditto.
+ * eval.c (yield_under_i): pass self again for instance_eval().
+ [ruby-dev:28466]
Fri Mar 24 17:20:03 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
- * process.c (rb_f_sleep): remove RDoc description about SIGALRM
- which is not valid on the current implementation. [ruby-dev:28464]
-
-Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
-
- * re.c (rb_reg_regsub): prohibit \1, \2 ...\9 in replaced string
- for named regex pattern.
-
-Thu Mar 23 21:06:23 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
-
- * oniguruma.h: Version 4.0.2
-
- * regparse.c: ditto.
-
- * regcomp.c ditto.
-
- * regerror.c: ditto.
+ * process.c (rb_f_sleep): remove description about SIGALRM which
+ is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 10:47:03 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
* eval.c (method_missing): should support argument splat in
- super. a bug in combination of super, splat and
- method_missing. [ruby-talk:185438]
-
-Thu Mar 23 00:01:32 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
-
- * re.c (rb_reg_regsub): add back reference by name \k<name> in
- replace string.
-
- * re.h: add regexp argument to rb_reg_regsub().
-
- * string.c (rb_str_sub_bang): ditto.
-
- * string.c (str_gsub): ditto.
-
-Tue Mar 21 22:14:01 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
-
- * re.c (match_alloc): initialize member regexp.
-
- * re.c (match_aref): add String and Symbol argument. [ruby-dev:28448]
-
- * re.h: add member regexp to RMatch.
-
- * gc.c (gc_mark_children): add gc_mark() to regexp member.
+ super. [ruby-talk:185438]
Mon Mar 20 12:05:18 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
-Mon Mar 20 11:12:38 2006 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * ext/win32ole/win32ole.c (folevariant_value): could not compile
- with C90 compiler.
-
Mon Mar 20 09:40:23 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
-Sun Mar 19 09:46:30 2006 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-
- * ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
- of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
- String object.
+Fri Mar 17 19:08:49 2006 GOTOU Yuuzou <gotoyuzo@notwork.org>
- * ext/win32ole/win32ole.c (folevariant_value): ditto.
+ * ext/openssl/ossl_ssl.c, ext/openssl/ossl_nsspki.c: fix typo.
+ [ruby-core:07571]
- * ext/win32ole/tests/testOLEVARIANT.rb: ditto.
-
-Wed Mar 15 16:51:11 2006 NAKAMURA Usaku <usa@ruby-lang.org>
+Wed Mar 15 16:54:21 2006 NAKAMURA Usaku <usa@ruby-lang.org>
* lib/mkmf.rb (create_makefile): support libraries without *.so.
-Wed Mar 15 16:39:29 2006 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Wed Mar 15 16:35:43 2006 GOTOU Yuuzou <gotoyuzo@notwork.org>
* ext/openssl/ossl_ssl.c, ext/openssl/ossl_nsspki.c: should use
"rb_str_new(0, 0)" to make empty string.
-Sun Mar 12 17:02:10 2006 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-
- * ext/win32ole/win32ole.c(ole_val2olevariantdata): support VT_ARRAY in
- WIN32OLE_VARIANT.new().
-
- * ext/win32ole/tests/testOLEVARIANT.rb: ditto.
-
- * ext/win32ole/tests/testOLEPARAM.rb: test method name should not be
- duplicated.
-
Sat Mar 11 14:24:06 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * lib/rdoc/ri/ri_formatter.rb (RI::TextFormatter::wrap): removed
+ space before argument parenthesis. [ruby-talk:183630]
+
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
-Sun Mar 5 18:40:58 2006 Minero Aoki <aamine@loveruby.net>
-
- * lib/fileutils.rb: do not repeat command options.
-
-Sun Mar 5 18:35:03 2006 Minero Aoki <aamine@loveruby.net>
-
- * lib/net/http.rb (send_request_with_body): #content_type never
- return false, use #main_type instead. [ruby-core:07476]
-
Sat Mar 4 15:26:40 2006 Tanaka Akira <akr@m17n.org>
* gc.c (id2ref): fix symbol test.
@@ -46541,112 +8137,84 @@ Sat Mar 4 15:26:40 2006 Tanaka Akira <akr@m17n.org>
Sat Mar 4 01:08:07 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
- directories. a patch from Eric Hodel <drbrain at segment7.net>.
+ directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
-Fri Mar 3 17:59:00 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (rb_clear_cache_by_class): clearing wrong cache.
-
-Fri Mar 3 21:22:42 2006 Tanaka Akira <akr@m17n.org>
-
- * lib/fileutils.rb (FileUtils.cp_r): implement :remove_destination
- option.
+Thu Mar 2 19:44:18 2006 Tanaka Akira <akr@m17n.org>
- * ext/extmk.rb: use :remove_destination to install extension libraries
- to avoid SEGV. [ruby-dev:28417]
-
-Fri Mar 3 14:41:04 2006 Minero Aoki <aamine@loveruby.net>
-
- * ext/dl/.cvsignore: ignore callback.h.
-
- * ext/ripper/.cvsignore: ignore eventids2table.c.
-
- * ext/socket/.cvsignore: ignore constants.h.
+ * gc.c: align VALUE with sizeof(RVALUE) globally.
+ (is_pointer_to_heap): check alignment out of loop.
+ (id2ref): avoid collision between symbols and objects.
+ (rb_obj_id): ditto. moved from object.c.
+ [ruby-talk:178364] [ruby-core:7305]
Thu Mar 2 18:58:18 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
-Thu Mar 2 09:12:05 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * array.c (rb_ary_flatten_bang): allow specifying recursion
- level. [ruby-talk:182170]
-
- * array.c (rb_ary_flatten): ditto.
-
-Thu Mar 2 08:02:42 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
- Weil <weil at mail.berlios.de>.
-
-Wed Mar 1 17:13:37 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (rb_call): use separate cache for fcall/vcall
- invocation.
-
- * eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
- functions.
-
- * eval.c (rb_mod_local): a new method to specify newly added
- visibility "local".
-
- * eval.c (search_method): search for local methods which are
- visible only from the current class.
-
- * class.c (rb_class_local_methods): a method to list local methods.
-
-Thu Mar 2 17:54:45 2006 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Thu Mar 2 17:57:49 2006 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* gc.c: commited magic for reducing RVALUE size on windows. (24->20byte)
[ruby-core:7474]
-Thu Mar 2 14:12:26 2006 Tanaka Akira <akr@m17n.org>
-
- * gc.c: align VALUE with sizeof(RVALUE) globally.
- (is_pointer_to_heap): check alignment out of loop.
- (id2ref): avoid collision between symbols and objects.
- (rb_obj_id): ditto. moved from object.c.
- [ruby-talk:178364] [ruby-core:7305]
-
-Thu Mar 2 12:55:16 2006 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Thu Mar 2 12:59:14 2006 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* win32/win32.c (filetime_to_unixtime): should set tm_isdst to -1.
stat() didn't treat daylight saving time property on WinNT.
[ruby-talk:182100]
-Wed Mar 1 00:15:51 2006 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Thu Mar 2 08:02:42 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * gc.c (add_heap): heap_slots may overflow. a patch from Stefan
+ Weil <weil at mail.berlios.de>.
+
+Wed Mar 1 00:24:31 2006 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* lib/rdoc/parsers/parse_rb.rb (read_escape): could not handle /\^/.
merged Mr. Ishizuka's lib/irb/ruby-lex.rb 's patch rev 1.29.
[ruby-talk:181631] [ruby-dev:28404]
-Tue Feb 28 19:32:14 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+Tue Feb 28 09:32:17 2006 NAKAMURA Usaku <usa@ruby-lang.org>
- * object.c (Init_Object): add BasicObject class as a top level
- BlankSlate class.
+ * lib/drb/extservm.rb (invoke_service_command): cannot invoke command
+ if command name is quoted on mswin32. [ruby-dev:28400]
Mon Feb 27 00:19:16 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
-Fri Feb 24 20:21:38 2006 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+Fri Feb 24 20:07:23 2006 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
* test/drb/drbtest.rb (add_service_command): quote pathnames in the
server's command line for space contained directory names.
Thanks, arton. [ruby-dev:28386]
-Fri Feb 24 12:10:07 2006 NAKAMURA Usaku <usa@ruby-lang.org>
+Fri Feb 24 12:11:08 2006 NAKAMURA Usaku <usa@ruby-lang.org>
* instruby.rb: install *.exe.manifest and *.dll.manifest if exist.
It's for VC++8.
-Fri Feb 24 11:17:45 2006 NAKAMURA Usaku <usa@ruby-lang.org>
+Fri Feb 24 11:33:52 2006 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+
+ * bcc32/Makefile.sub (HAVE_HYPOT): bcc32 has hypot().
+
+Fri Feb 24 11:19:58 2006 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * time.c (time_new_internal): add prototype to tell the compiler
+ arugments types.
* win32/win32.c (NtInitialize): need to set a handler for VC++8.
+Fri Feb 24 08:19:16 2006 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * test.rb: Removed. Obsolete by test/nkf.
+
+ * ext/.document: enabled documents in nkf and kconv
+
+ * ext/nkf/nkf.c ext/nkf/lib/kconv.rb: Add rdoc.
+
Thu Feb 23 22:39:59 2006 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* bcc32/Makefile.sub: use borlndmm.dll if possible. bcc32's RTL internal
@@ -46654,84 +8222,30 @@ Thu Feb 23 22:39:59 2006 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
ex: 10000.times { "" << "." * 529671; GC.start } # crash
[ruby-dev:28230]
-Thu Feb 23 13:23:03 2006 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Thu Feb 23 13:20:28 2006 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* eval.c (SETUP_ARGS0): fixed memory corruption. [ruby-dev:28360]
-Wed Feb 22 21:16:55 2006 Tanaka Akira <akr@m17n.org>
-
- * lib/pathname.rb (Pathname#each_filename): use split_names properly.
-
-Wed Feb 22 16:24:05 2006 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * test/webrick/test_cgi.rb: should support platforms which search
- library path from the interpreter's path.
- And, support test without install incidentally.
-
-Wed Feb 22 14:21:03 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * bignum.c (bignorm): x may not be a bignum. [ruby-dev:28367]
+Tue Feb 21 02:18:46 2006 NAKAMURA Usaku <usa@ruby-lang.org>
-Wed Feb 22 09:22:40 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * configure.in (mingw): have link. [ruby-list:41838]
- * eval.c (proc_alloc): add proper check for creation of a lambda
- without a block.
+ * win32/Makefile.sub (config.h): ditto.
Tue Feb 21 02:07:39 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
* parse.y (f_arglist): should set command_start = Qtrue for
command body. [ruby-talk:180648]
-Mon Feb 20 22:30:17 2006 Tanaka Akira <akr@m17n.org>
+Mon Feb 20 17:37:26 2006 Tanaka Akira <akr@m17n.org>
- * mkconfig.rb: alias Config to RbConfig for compatibility.
-
-Mon Feb 20 18:21:41 2006 Tanaka Akira <akr@m17n.org>
-
- * io.c (rb_io_reopen): flush before reopening a file.
- reported by Mathieu Bouchard. [ruby-core:7396]
-
-Mon Feb 20 17:29:50 2006 Tanaka Akira <akr@m17n.org>
-
- * mkconfig.rb: generate RbConfig instead of Config.
-
- * instruby.rb, rubytest.rb, runruby.rb, bcc32/Makefile.sub,
- ext/extmk.rb, ext/dl/extconf.rb, ext/iconv/charset_alias.rb,
- lib/mkmf.rb, lib/rdoc/ri/ri_paths.rb,
- lib/webrick/httpservlet/cgihandler.rb,
- test/dbm/test_dbm.rb, test/gdbm/test_gdbm.rb,
- test/ruby/envutil.rb, test/soap/calc/test_calc_cgi.rb,
- test/soap/header/test_authheader_cgi.rb, test/soap/ssl/test_ssl.rb,
- win32/mkexports.rb, win32/resource.rb: Use RbConfig instead of
- Config.
-
-Mon Feb 20 13:46:19 2006 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * lib/find.rb: should raise ENOENT if root entry does not exist,
- without opening it. [ruby-dev:28345]
+ * mkconfig.rb: alias RbConfig for Config.
Mon Feb 20 12:27:53 2006 Kent Sibilev <ksruby@gmail.com>
* lib/rational.rb (Integer::gcd): small typo fix.
[ruby-core:07395]
-Mon Feb 20 10:03:59 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * variable.c (rb_const_get_0): Object should have been the lowest
- in const lookup precedence. [ruby-dev:28343]
-
-Mon Feb 20 09:17:11 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/delegate.rb (Delegator): should not delegate "funcall".
-
-Mon Feb 20 09:13:42 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/webrick/httpservlet/cgihandler.rb (WEBrick::HTTPServlet::CGIHandler):
- qualify the access for Config constant. [ruby-dev:28338]
-
- * lib/resolv.rb (Resolv::DNS::Resource::IN::A): qualify
- ClassValue. [ruby-dev:28338]
-
Mon Feb 20 01:05:27 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
* lib/rational.rb (Integer::gcd): replaced by gcd4 in
@@ -46742,13 +8256,6 @@ Mon Feb 20 00:57:02 2006 GOTOU Yuuzou <gotoyuzo@notwork.org>
* ext/openssl/ossl.h (OSSL_Debug): should not use __func__.
[ruby-dev:28339]
-Mon Feb 20 00:13:49 2006 Tanaka Akira <akr@m17n.org>
-
- * lib/open-uri.rb: add :ssl_verify_mode option.
- suggested by Will Glynn.
-
- * lib/open-uri.rb: add :ssl_ca_cert option.
-
Sun Feb 19 04:46:29 2006 Guy Decoux <ts@moulon.inra.fr>
* eval.c: initial value for block_unique must be 1.
@@ -46764,44 +8271,17 @@ Sat Feb 18 23:58:26 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
* sample/rtags.rb: ditto.
-Sat Feb 18 21:16:27 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (rb_obj_instance_eval): RDoc description updated. a
- patch from Ozgur Murat Homurlu <ozgurmurath at gmail.com>.
- [ruby-core:07381]
-
-Sat Feb 18 01:01:17 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+Sat Feb 18 12:18:26 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
- * variable.c (rb_const_get_0): skip ruby_wrapper in const search
- to give it lower priority (just above Object). need not to
- change rb_const_defined_0() since it's only a precedence matter;
- they are defined anyway.
+ * lib/fileutils.rb (FileUtils::fu_world_writable): make it
+ private. [ruby-core:07383]
Sat Feb 18 00:22:39 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
* lib/tracer.rb: merged a minor clarification patch from Daniel
Berger <Daniel.Berger at qwest.com>. [ruby-core:07376]
-Fri Feb 17 17:30:20 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (ev_const_get): simplified using rb_const_get_fallback().
-
- * eval.c (ev_const_defined): adopt to ev_const_get() using
- rb_const_defined_fallback().
-
- * variable.c (rb_const_get_fallback): new function to implement
- constant search.
-
- * variable.c (rb_const_defined_fallback): new function to
- implement constant definition check.
-
- * variable.c (rb_const_get_0): adopt to new behavior. constants
- are looked up in the order of: current class, super classes (but
- Object), lexically external classes/modules, and Object.
-
- * variable.c (rb_const_defined_0): ditto.
-
-Fri Feb 17 11:20:53 2006 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Fri Feb 17 11:18:42 2006 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* util.c (ruby_strtod): Float("1e") should fail. [ruby-core:7330]
@@ -46816,6 +8296,11 @@ Fri Feb 17 09:39:29 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
* eval.c (rb_thread_wait_for): sleep should always sleep for
specified amount of time. [ruby-talk:180067]
+Thu Feb 16 01:10:48 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * eval.c (backtrace): frame->orig_func may not be initialized.
+ [ruby-core:07367]
+
Wed Feb 15 16:52:52 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
* eval.c (rb_eval): NODE_OP_ASGN1 should allow splat in its
@@ -46827,10 +8312,6 @@ Wed Feb 15 16:52:52 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
* eval.c (rb_eval): honor visibility on OP_ASGN1 and
OP_ASGN2. [ruby-core:07366]
-Wed Feb 15 15:20:23 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (error_line): remove void control path. [ruby-dev:28335]
-
Wed Feb 15 10:09:51 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
* eval.c (yield_under_i): should not pass self as an argument to
@@ -46841,32 +8322,17 @@ Wed Feb 15 09:20:35 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
* eval.c (rb_obj_instance_eval): should be no singleton classes for
true, false, and nil. [ruby-dev:28186]
-Tue Feb 14 20:26:00 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * enumerator.c (enumerator_each): return self if no block is
- given. [yarv-dev:882]
-
Tue Feb 14 18:48:33 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
* eval.c (DMETHOD_P): accessing wrong frame. [ruby-dev:28181]
* eval.c (proc_invoke): preserve FRAME_DMETH flag.
-Tue Feb 14 15:15:22 2006 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * ext/zlib/zlib.c: suppress warning on test/zlib. [ruby-dev:28323]
-
-Tue Feb 14 13:47:22 2006 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/win32.c (rb_w32_utime): drop read-only attribute before
- changing file time.
+Tue Feb 14 15:13:51 2006 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-Tue Feb 14 13:38:01 2006 NAKAMURA Usaku <usa@ruby-lang.org>
+ * ext/zlib/zlib.c: supress warning on test/zlib. [ruby-dev:28323]
- * win32/Makefile.sub (config.h): should define HAVE_LONG_LONG with
- VC++8.
-
-Tue Feb 14 11:42:38 2006 NAKAMURA Usaku <usa@ruby-lang.org>
+Tue Feb 14 14:01:17 2006 NAKAMURA Usaku <usa@ruby-lang.org>
* time.c (search_time_t): support non 32bit time_t environments.
@@ -46874,40 +8340,35 @@ Tue Feb 14 11:42:38 2006 NAKAMURA Usaku <usa@ruby-lang.org>
* win32/Makefile.sub (config.h): VC++8's time_t is 64bit value.
-Mon Feb 13 18:01:52 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (copy_node_scope): remove duplicated semicolons at end.
- a patch from KIMURA Koichi <kimura.koichi at canon.co.jp>.
- [ruby-dev:28332]
-
- * eval.c (VIS_MODE): remove unnecessary argument.
- [ruby-dev:28332]
+ * win32/win32.c (rb_w32_utime): drop read-only attribute before
+ changing file time.
-Mon Feb 13 13:49:48 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ all changes are backported from CVS HEAD.
- * parse.y (parser_parse_string): mention "regexp" in a error
- message. a patch from Mauricio Fernandez <mfp at acm.org>
- [ruby-core:07340]
+Tue Feb 14 11:21:38 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-Mon Feb 13 00:01:32 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
+ * io.c (argf_forward): should not use frame->argv.
+ [ruby-core:07358]
- * oniguruma.h: Version 4.0.1
+Mon Feb 13 18:08:12 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
- * regparse.c (onig_free_shared_cclass_table): fix memory leaks.
+ * eval.c (rb_call0): argument update propagation. [ruby-dev:28044]
- * regcomp.c (optimize_node_left): change from IS_POSIXLINE() to IS_MULTILINE().
+ * env.h: remove argv member from struct FRAME.
- * regint.h: rename ANCHOR_ANYCHAR_STAR_PL to ANCHOR_ANYCHAR_STAR_ML.
+Mon Feb 13 13:27:00 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
- * regparse.h: ditto.
+ * eval.c (eval): should push class from binding if supplied.
+ [ruby-core:07347]
- * regexec.c: ditto.
+Mon Feb 13 00:04:00 2006 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
-Sat Feb 11 21:57:29 2006 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+ * lib/erb.rb (ERB::Compiler): add instance variable @insert_cmd to
+ change <%='s behavior. (backported 1.15 - 1.16)
- * ext/win32ole/win32ole.c: add WIN32OLE.create_guid.
+Sat Feb 11 02:04:11 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
- * ext/win32ole/tests/testWIN32OLE.rb: ditto.
+ * eval.c (eval): no need to push ruby_class. [ruby-dev:28176]
Sat Feb 11 01:57:44 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
@@ -46915,76 +8376,39 @@ Sat Feb 11 01:57:44 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
instance_eval for objects cannot have singleton classes,
e.g. fixnums and symbols). [ruby-dev:28178]
-Fri Feb 10 12:31:05 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (rb_eval): should support NODE_ZSUPER in NODE_ITER.
- [ruby-dev:28326]
-
- * eval.c (ZSUPER_ARGS): support macro.
-
-Wed Feb 8 10:26:06 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * gc.c (rb_gc_call_finalizer_at_exit): turn on during_gc while
- invoking finalizers.
-
- * gc.c (rb_gc_finalize_deferred): ditto.
-
-Tue Feb 7 23:03:13 2006 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Tue Feb 7 23:03:24 2006 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* ext/zlib/zlib.c: should not access ruby objects in finalizer.
[ruby-dev:28286]
-Tue Feb 7 18:42:00 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * io.c (rb_write_error2): use fwrite(3) if rb_stderr is not
- updated or is already freed. [ruby-dev:28313]
-
Mon Feb 6 16:02:51 2006 WATANABE Hirofumi <eban@ruby-lang.org>
* file.c (rb_thread_flock): ERROR_NOT_LOCKED is not an error on Cygwin.
In such situation, flock() should return 0.
-Mon Feb 6 14:36:29 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (error_line): include the class name of a surrounding
- method in error position description.
+Mon Feb 6 00:41:08 2006 Tanaka Akira <akr@m17n.org>
-Mon Feb 6 00:14:57 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * ruby.h (RSTRUCT_LEN, RSTRUCT_PTR): defined for source level
+ compatibility with ruby 1.9.
- * enum.c (enum_find_index): a new method Enumerable#find_index.
- [ruby-talk:178495]
-
-Sun Feb 5 23:29:31 2006 Tanaka Akira <akr@m17n.org>
-
- * ruby.h (struct RStruct): embed 3 or less elements structs.
- (RSTRUCT_LEN): defined for accessing struct members.
- (RSTRUCT_PTR): ditto.
-
- * struct.c: use RSTRUCT_LEN and RSTRUCT_PTR.
- (struct_alloc): allocate small structs in embedded format.
- (rb_struct_init_copy): ditto.
-
- * gc.c (gc_mark_children): use RSTRUCT_LEN and RSTRUCT_PTR.
- (obj_free): ditto.
-
- * marshal.c (w_object): use RSTRUCT_LEN and RSTRUCT_PTR.
-
-Sun Feb 5 21:01:49 2006 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Sun Feb 5 21:05:34 2006 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* numeric.c (fix_to_s): removed workaround for radix 2. Historically,
rb_fix2str could only handle radix 8, 10, 16. (Rev1.37) But for now,
it can handle radix 2..36. [ruby-Bugs#3438] [ruby-core:7300]
-Sun Feb 5 18:49:00 2006 Minero Aoki <aamine@loveruby.net>
+Sun Feb 5 18:55:08 2006 Minero Aoki <aamine@loveruby.net>
- * lib/net/http.rb (add_field, get_fields): keep 1.8.2
- compatibility. This patch is contributed by Rob Pitt.
+ * lib/net/http.rb: imported from trunk, rev 1.129
-Sun Feb 5 16:33:50 2006 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+ * lib/net/http.rb (add_field, get_fields): keep 1.8.2 backward
+ compatibility.
+
+ * lib/net/https.rb: imported from trunk, rev 1.3.
- * lib/mkmf.rb (create_makefile): Kernel#sub! was removed on HEAD.
+ * lib/net/https.rb: #use_ssl? definition moved from net/http.rb.
-Sun Feb 5 14:26:54 2006 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Sun Feb 5 14:22:15 2006 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* lib/pstore.rb: should return default value if name is not found.
[ruby-core:7304]
@@ -46996,68 +8420,42 @@ Sat Feb 4 22:51:43 2006 Tanaka Akira <akr@m17n.org>
* eval.c: apply the FreeBSD getcontext/setcontext workaround
only before FreeBSD 7-CURRENT.
-Sat Feb 4 21:10:06 2006 NAKAMURA Usaku <usa@ruby-lang.org>
+Sat Feb 4 21:19:23 2006 NAKAMURA Usaku <usa@ruby-lang.org>
* win32/win32.c (LK_ERR): ERROR_NOT_LOCKED is not an error.
In such situation, flock() should return 0.
-Sat Feb 4 15:52:56 2006 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Sat Feb 4 15:56:37 2006 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* numeric.c (fix_to_s): (2**32).to_s(2) fails with exception where
sizeof(int) == 4 < sizeof(long). [ruby-core:7300]
-Sat Feb 4 15:02:05 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * oniguruma.h: merge Oniguruma 4.0.0 [ruby-dev:28290]
-
-Fri Feb 3 19:25:53 2006 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * ruby.h: fixed prototype.
-
- * ext/syck/rubyext.c: defined symbol ID as global variable as others.
-
-Fri Feb 3 17:57:02 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c: unify ruby_class (for method definition) and ruby_cbase
- (for constant reference).
-
-Fri Feb 3 15:02:10 2006 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Fri Feb 3 15:06:50 2006 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* ext/syck/syck.c (syck_move_tokens): should reset p->cursor or etc
even if skip == 0. This causes buffer overrun.
(ex: YAML.load('--- "..' + '\x82\xA0' * 511 + '"'))
-Fri Feb 3 00:01:31 2006 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Thu Feb 2 23:51:18 2006 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* ext/syck/emitter.c (syck_emitter_write): should not set '\0' on
- emitter's marker. if marker points to the end of buffer, this is
+ emitter's marker. if marker points to the end of buffer, this causes
buffer overrun. (ex: YAML.dump("." * 12288))
-Thu Feb 2 17:13:01 2006 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser#get_tk): added
- support of :'string' style Symbol.
-
Thu Feb 2 16:01:24 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
- * eval.c (rb_call0): use TMP_ALLOC() instead of allocating
- a temporary array object.
-
* eval.c (eval): need not to protect $SAFE value.
[ruby-core:07177]
- * error.c (Init_Exception): change NameError to direct subclass of
- Exception so that default rescue do not handle it silently.
-
Thu Feb 2 14:45:53 2006 Ville Mattila <ville.mattila@stonesoft.com>
- * configure.in: The isinf is not recognized by autoconf
+ * configure.in: The isinf is not regognized by autoconf
library guesser on solaris 10. [ruby-core:7138]
Wed Feb 1 22:01:47 2006 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* configure.in, hash.c (ruby_setenv): use setenv(3) and unsetenv(3)
- where they are supported. modifying environ variable seems to
+ where they are supported. modifing environ variable seems to
segfault solaris 10. [ruby-core:7276] [ruby-dev:28270]
* ruby.c (set_arg0): if use setenv(3), environ space cannot be used
@@ -47075,36 +8473,17 @@ Tue Jan 31 11:58:51 2006 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tk/lib/tk/namespace.rb: TkNamespace#eval was enbugged at the
last commit. Now it will return a proper object.
-Tue Jan 31 08:07:02 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * numeric.c (int_upto): return an enumerator if no block is
- attached to the method.
-
- * numeric.c (int_downto): ditto.
-
- * numeric.c (int_dotimes): ditto.
-
- * enum.c (enum_first): new method Enumerable#first to take first n
- elements from an enumerable.
-
- * enum.c (enum_group_by): new method Enumerable#group_by that
- groups enumerable values according to their block values.
-
-Tue Jan 31 00:08:22 2006 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Tue Jan 31 00:10:26 2006 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* ext/syck/rubyext.c (syck_resolver_transfer): workaround for SEGV.
ex: ruby -ryaml -e 'YAML.load("!map:B {}")' [ruby-core:7217]
-Sat Jan 28 07:49:30 2006 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Sat Jan 28 07:56:57 2006 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* lib/rdoc/usage.rb: support "a:0:33" style caller[-1]. In this case
file name is "a:0". I don't know this really happens though...
[ruby-Bugs:3344]
-Thu Jan 26 15:55:52 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * ext/socket/socket.c: turn on do_not_reverse_lookup by default.
-
Wed Jan 25 22:29:04 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
* configure.in, dln.c, file.c, intern.h, missing.h (eaccess): use
@@ -47128,7 +8507,13 @@ Sun Jan 22 20:03:35 2006 Tanaka Akira <akr@m17n.org>
FreeBSD/i386 getcontext/setcontext bug.
[ruby-dev:28263]
-Thu Jan 19 22:19:18 2006 Minero Aoki <aamine@loveruby.net>
+Sat Jan 21 00:36:47 2006 Tanaka Akira <akr@m17n.org>
+
+ * eval.c (FUNCTION_CALL_MAY_RETURN_TWICE): use only on SPARC and IA64
+ before gcc 4.0.3.
+ [ruby-dev:28247]
+
+Thu Jan 19 22:21:23 2006 Minero Aoki <aamine@loveruby.net>
* lib/fileutils.rb (mv): should remove file after copying.
[ruby-dev:28223]
@@ -47142,34 +8527,32 @@ Wed Jan 18 23:37:06 2006 Tanaka Akira <akr@m17n.org>
reported by Pav Lucistnik and Marius Strobl.
http://lists.freebsd.org/pipermail/freebsd-sparc64/2006-January/003739.html
-Tue Jan 17 23:59:56 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * object.c (rb_mod_const_get, rb_mod_const_defined): added optional
- flag to search ancestors, which is defaulted to true.
- fixed: [ruby-talk:175899]
-
- * eval.c (rb_mod_method_defined): ditto.
-
-Tue Jan 17 11:31:47 2006 NAKAMURA Usaku <usa@ruby-lang.org>
+Tue Jan 17 11:32:46 2006 NAKAMURA Usaku <usa@ruby-lang.org>
* win32/setup.mak (MAKE): workaround for nmake 8.
-Tue Jan 17 11:06:19 2006 NAKAMURA Usaku <usa@ruby-lang.org>
+Tue Jan 17 11:10:21 2006 NAKAMURA Usaku <usa@ruby-lang.org>
- * win32/Makefile.sub: invoke .bat via shell. workaround for nmake 8.
+ * win32/{Makefile.sub,setup.mak}: invoke .bat via shell. workaround
+ for nmake 8.
-Mon Jan 16 10:13:38 2006 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Mon Jan 16 10:26:23 2006 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* ext/syck/emitter.c (syck_emit_seq, syck_emit_map, syck_emit_item):
should output complex key mark even if map's key is empty seq/map.
[ruby-core:7129]
-Sat Jan 14 03:38:54 2006 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Sat Jan 14 05:37:06 2006 Tanaka Akira <akr@m17n.org>
+
+ * io.c (READ_DATA_PENDING, READ_DATA_PENDING_COUNT): defined
+ for DragonFly BSD 1.4.0.
+
+Sat Jan 14 03:43:24 2006 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* file.c (rb_file_s_chmod): avoid warning where sizeof(int) !=
sizeof(void*).
-Fri Jan 13 19:26:15 2006 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Fri Jan 13 19:14:56 2006 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* lib/rdoc/diagram.rb:
- properly quote bare element attributes
@@ -47191,15 +8574,23 @@ Thu Jan 12 11:53:08 2006 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
[new feature] support 'command' option which is called just before
popping up the balloon help.
-Wed Jan 11 00:12:29 2006 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+Wed Jan 11 15:00:00 2006 Ville Mattila <mulperi@iki.fi>
- * lib/erb.rb (ERB::Compiler): add instance variable @insert_cmd to
- change <%='s behavior.
+ * io.c (READ_PENDING*): Support solaris 64-bit environments.
+ Solaris defines a opaque FILE struct when compiling 64 bit
+ binaries. This means that we dont have access to _ptr etc.
+ members anymore. The solution by Steven Lumos is to define
+ FILE64 that has needed members available. I've modified
+ the origanal patch a bit so that it compiles both with gcc
+ and now free sun studio 11 compiler and both amd64 and sparc.
+ NOTE! We have to 64 bit solaris FILE structure time to time
+ otherwise we'll get breakage.
+ [ruby-core:7106]
Tue Jan 10 19:42:33 2006 Tanaka Akira <akr@m17n.org>
* gc.c (garbage_collect): mark ruby_current_node.
- if an exception is raised in a finalizer written in C called by
+ if an exception is raised in a finalizer called written in C by
rb_gc_call_finalizer_at_exit, ruby_set_current_source may use
collected ruby_current_node and mark_source_filename may corrupt
memory.
@@ -47222,68 +8613,37 @@ Tue Jan 10 12:00:48 2006 Aaron Schrab <aaron @nospam@ schrab.com>
* lib/yaml/rubytypes.rb (Symbol#yaml_new): YAML loading of quoted
Symbols broken. [ruby-Bugs:2535]
-Tue Jan 10 07:26:52 2006 Tanaka Akira <akr@m17n.org>
-
- * gc.c (gc_stress): renamed from always_gc and enabled by default.
- (gc_stress_get): new function for GC.stress.
- (gc_stress_set): new function for GC.stress=.
-
-Mon Jan 9 19:58:56 2006 arton <artonx@yahoo.co.jp>
+Mon Jan 9 19:54:35 2006 arton <artonx@yahoo.co.jp>
* ext/zlib/extconf.rb: zlib compiled DLL version 1.2.3 distributed by
http://www.zlib.net/ has zdll.lib. [ruby-dev:28209]
-Mon Jan 9 14:25:00 2006 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Mon Jan 9 14:17:12 2006 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* win32/Makefile.sub (OPTFLAGS): I have experienced trouble on y- flag,
(VisualC++6) so use -O2b2xg- if $(MSC_VER) < 1400. [ruby-core:7040]
-Mon Jan 9 14:25:00 2006 Kero van Gelder <rubyforge @nospam@ kero.tmfweb.nl>
+Mon Jan 9 14:17:12 2006 Kero van Gelder <rubyforge @nospam@ kero.tmfweb.nl>
* lib/webrick/httpservlet/filehandler.rb: fixed typo. [ruby-core:7075]
-Sun Jan 8 14:15:27 2006 Tanaka Akira <akr@m17n.org>
-
- * eval.c (GCC_VERSION_BEFORE): check __INTEL_COMPILER.
- Intel C++ Compiler defines __GNUC__.
- http://www.intel.com/software/products/compilers/clin/docs/ug_cpp/lin1077.htm
-
Sat Jan 7 15:40:07 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
* parse.y (singleton): get rid of segfault on syntax error.
fixed: [ruby-core:07070]
-Sat Jan 7 06:24:18 2006 Tanaka Akira <akr@m17n.org>
-
- * eval.c (rb_fd_isset): compare the result of FD_ISSET with 0 to
- avoid FreeBSD bug. FreeBSD defines FD_ISSET as just a bitmap of
- unsigned long. So returning the value from rb_fd_isset discards
- upper 32bits on LP64 environment.
- http://www.freebsd.org/cgi/query-pr.cgi?pr=ia64/91421
-
-Fri Jan 6 02:20:18 2006 Tanaka Akira <akr@m17n.org>
-
- * configure.in: don't force getcontext on IA64.
+Fri Jan 6 10:16:20 2006 Steven Lumos <steven@lumos.us>
- * eval.c (ruby_setjmp): add an argument for just before getcontext.
- (THREAD_SAVE_CONTEXT): call rb_thread_save_context just
- before getcontext.
- [ruby-dev:28205]
+ * io.c (READ_DATA_PENDING): defined for 64bit Solaris on SPARC.
+ [ruby-core:7057]
+ (READ_DATA_PENDING_COUNT): ditto.
+ (READ_DATA_PENDING_PTR): ditto.
-Sun Jan 1 15:28:46 2006 Tanaka Akira <akr@m17n.org>
-
- * missing.h (isinf): avoid macro expansion
- "extern int isinf(double);" to
- "extern int ((sizeof(double)==sizeof(float))?_Isinff(double):_Isinf(double));" on
- HP-UX.
-
-Sun Jan 1 14:42:54 2006 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Sun Jan 1 17:07:59 2006 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* win32/win32.c (rb_w32_seekdir): should not segfault even if passed
- the location which rb_w32_telldir didn't return. (and should change
- `bits' position) [ruby-core:7035]
-
- * win32/dir.h: ditto. (stores `loc' instead of `bitpos')
+ the location which rb_w32_telldir didn't return. [ruby-core:7035]
+ (I think HEAD implementation is better. but binary compatibility)
* test/ruby/test_dir.rb: added.
@@ -47292,41 +8652,26 @@ Sat Dec 31 22:57:00 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
* eval.c (rb_thread_save_context): should not recycle scope object used
in a thread. fixed: [ruby-dev:28177]
-Sat Dec 31 19:50:38 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * ext/syck/rubyext.c: attribute name was truncated with Rev1.64.
-
-Sat Dec 31 11:53:16 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * lib/generator.rb: (Generator#initialize): should kill @loop_thread
- before starting new thread. (occurs when called via Generator#rewind)
- [ruby-dev:28184]
-
Fri Dec 30 18:22:42 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * gc.c (garbage_collect): mark objects referred from aborting threads.
+ * gc.c (garbage_collect): mark objects refered from aborting threads.
[ruby-dev:28190]
* win32/Makefile.sub: VC++8 support.
-Fri Dec 30 15:17:35 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * lib/generator.rb (Generator#initialize): ensured to stop @loop_thread.
- Mr. Tanaka pointed out one Thread.pass is not enough. [ruby-dev:28185]
+Fri Dec 30 14:24:53 2005 WATANABE Hirofumi <eban@ruby-lang.org>
-Fri Dec 30 12:20:57 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+ * dir.c (glob_helper): do not use TRUE for djgpp.
- * lib/generator.rb (Generator#initialize): fixed dead lock. this occurred
- when end? was called before @loop_thread was stopped. [ruby-core:7029]
+Fri Dec 30 04:54:40 2005 NAKAMURA Usaku <usa@ruby-lang.org>
-Fri Dec 30 01:04:52 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+ * file.c (eaccess): workaround for VC++8 runtime.
- * lib/generator.rb: should work with another thread. (more robust code)
- [ruby-dev:28177]
+ * win32/win32.c (ioinfo): VC++8 support.
Thu Dec 29 23:59:37 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * eval.c (rb_gc_mark_threads): keep unmarked threads which won't wake
+ * eval.c (rb_gc_mark_threads): leave unmarked threads which won't wake
up alone, and mark threads in the loading table. [ruby-dev:28154]
* eval.c (rb_gc_abort_threads), gc.c (gc_sweep): kill unmarked
@@ -47337,87 +8682,23 @@ Thu Dec 29 17:02:07 2005 Tanaka Akira <akr@m17n.org>
* test/ruby/envutil.rb (EnvUtil.rubybin): search "ruby" instead of
"miniruby". [ruby-dev:28140]
-Thu Dec 29 14:35:10 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (rb_mod_define_method): should save safe_level in the
- proc object. [ruby-dev:28146]
-
-Thu Dec 29 11:22:34 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * lib/generator.rb: reimplemented Generator class with Thread instead of
- callcc, in order to fix memory leak. [ruby-dev:28142]
-
-Wed Dec 28 14:10:05 2005 Tanaka Akira <akr@m17n.org>
-
- * ia64.s: remove .pred.safe_across_calls directive.
- reported by WATANABE Tetsuya. [ruby-dev:28141]
-
-Wed Dec 28 01:32:39 2005 Tanaka Akira <akr@m17n.org>
-
- * eval.c (struct thread): add bstr_max.
- (rb_thread_save_context): use realloc instead of REALLOC_N
- to avoid GC.
-
-Tue Dec 27 23:59:53 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/optparse.rb (CompletingHash#match): fix for 1.9.
-
Tue Dec 27 16:59:52 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
* test/drb/drbtest.rb (DRbService::self.ext_service): increase
timeout limit. a patch from Kazuhiro NISHIYAMA
<zn at mbf.nifty.com>. [ruby-dev:28132]
-Tue Dec 27 14:17:55 2005 Tanaka Akira <akr@m17n.org>
+Tue Dec 27 08:29:18 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
- * configure.in: define IA64 for portability. (HP aC++/ANSI C doesn't
- define __ia64__.)
- don't check libunwind stuff.
- check __libc_ia64_register_backing_store_base.
-
- * defines.h: declare rb_ia64_bsp and rb_ia64_flushrs.
- (flush_register_windows): call rb_ia64_flushrs on IA64.
-
- * ia64.s: new file for IA64.
- it is separated from C program files because
- Intel C++ Compiler for IA64 doesn't support inline assembly.
-
- * common.mk (ia64.$(OBJEXT)): new target.
-
- * ruby.h (RUBY_INIT_STACK): defined.
- (ruby_init_stack): declared for RUBY_INIT_STACK.
-
- * main.c (main): precedes RUBY_INIT_STACK before ruby_init.
-
- * gc.c (rb_gc_register_stack_start): new global variable on IA64.
- (garbage_collect): simplify register stack marking code.
- don't use libunwind.
- (Init_stack): initialize rb_gc_register_stack_start.
- (ruby_init_stack): new function for RUBY_INIT_STACK.
-
- * eval.c (struct thread): add bstr_pos member for original position of
- register stack.
- (rb_thread_save_context): simplify register stack saving code.
- don't use libunwind.
- (rb_thread_restore_context_0): new function. moved from
- rb_thread_restore_context except the stack position checking code.
- don't use libunwind for IA64 register stack.
- (register_stack_extend): new function.
- (stack_extend): make it self-recursive with
- the stack position checking code in old rb_thread_restore_context.
- (rb_thread_restore_context): just call stack_extend.
- (flush_register_windows): removed.
-
- [ruby-dev:28127]
-
-Tue Dec 27 14:09:39 2005 Minero Aoki <aamine@loveruby.net>
-
- * process.c: new method Process.exec. [ruby-dev:28107]
+ * ext/openssl/lib/openssl/ssl.rb (OpenSSL::SSL::SSLSocket#post_connection_chech):
+ treat wildcard character in commonName. [ruby-dev:28121]
-Tue Dec 27 08:22:15 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Mon Dec 26 22:32:47 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/openssl/lib/openssl/ssl.rb (OpenSSL::SSL::SSLSocket#post_connection_check):
- treat wildcard character in commonName. [ruby-dev:28121]
+ * eval.c (rb_eval), gc.c (gc_mark_children), node.h (NEW_ALIAS,
+ NEW_VALIAS), parse.y (fitem): allow dynamic symbols to
+ NODE_UNDEF and NODE_ALIAS.
+ backported from trunk. fixed: [ruby-dev:28105]
Mon Dec 26 08:50:36 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
@@ -47430,20 +8711,23 @@ Mon Dec 26 08:50:36 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
Joel VanderWerf <vjoel at path.berkeley.edu>.
[ruby-talk:165285] [ruby-core:6995]
+Sat Dec 24 18:58:14 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * stable version 1.8.4 released.
+
Fri Dec 23 10:30:23 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
* ext/digest/sha2/sha2.c (ULL): support AIX C. a patch from
Kailden <kailden at gmail.com>. [ruby-core:06984]
-Wed Dec 21 16:47:35 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Wed Dec 21 16:53:06 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* file.c (w32_io_info): should return handle because FileIndex is
valid only while file is open. [ruby-dev:28088]
-Wed Dec 21 12:12:21 2005 Tanaka Akira <akr@m17n.org>
+Wed Dec 21 14:53:26 2005 Tanaka Akira <akr@m17n.org>
- * test/pathname/test_pathname.rb (test_kernel_open): use
- File.identical?.
+ * lib/pathname.rb (test_kernel_open): use File.identical?.
[ruby-talk:171804]
Tue Dec 20 22:41:17 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
@@ -47451,102 +8735,36 @@ Tue Dec 20 22:41:17 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
* eval.c (eval_under_i): evaluate source in caller's frame.
[ruby-dev:28076]
-Tue Dec 20 12:53:23 2005 why the lucky stiff <why@ruby-lang.org>
-
- * ext/syck/rubyext.c (syck_emitter_reset): to ensure compatibility
- with previous Ruby versions, documents are no longer headless.
-
-Tue Dec 20 12:33:01 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * ext/syck/rubyext.c (syck_node_transform): ruby object holding
- explicitly freed SyckNode caused SEGV. [ruby-dev:28067]
-
- ... I think syck GC problem was solved now!
+ * eval.c (rb_call_super): use original method name on exception.
+ [ruby-dev:28078]
-Tue Dec 20 01:46:48 2005 Tanaka Akira <akr@m17n.org>
+Tue Dec 20 13:11:59 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
- * io.c (rb_f_backquote): fix a GC problem on
- IA64 with gcc 4.0.3 20051216 (prerelease) -O3.
+ * ext/syck/rubyext.c: fixed GC problem (backported HEAD 1.55 - 1.62)
+ [ruby-dev:27839]
-Mon Dec 19 23:32:39 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * Makefile.in (XCFLAGS): separated as well as win32/Makefile.sub.
-
- * main.c (always_gc): dllimport is required for VC to import a DLL
- symbol. fixed: [ruby-dev:28051]
-
- * parse.y (rb_symname_p): fixed wrong validation. [ruby-dev:28047]
-
-Mon Dec 19 23:09:24 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+ * ext/syck/syck.h (S_FREE): small hack. no need to check if pointer is
+ NULL or not before S_FREE.
* st.c: uses malloc instead of xmalloc to avoid GC. syck uses st_insert
in gram.c to insert node from rb_syck_bad_anchor_handler into
SyckParser's hash table. if GC occurs in st_insert, it's not under
SyckParser's mark system yet. so RString can be released wrongly.
+ [ruby-dev:28057]
- * ext/syck/syck.h (S_FREE): small hack. no need to check if pointer is
- NULL or not before S_FREE.
-
- * ext/syck/rubyext.c (syck_parser_assign_io): rb_check_string_type can
- return new RString. if so, it becomes unreachable from GC after
- returns syck_parser_assign_io, and can be freed by GC. (dangling
- in syck io system) so extends its life time till syck_parse is called.
-
- * ext/syck/rubyext.c (syck_parser_s_alloc): always allocates bonus,
- so no need to check if NULL, and "volatile VALUE hash"
- is not needed. (bonus->port was not protected in syck_emitter_reset)
-
- * ext/syck/rubyext.c (syck_mark_parser): ditto.
-
- * ext/syck/rubyext.c (syck_parser_load): ditto.
-
- * ext/syck/rubyext.c (syck_parser_load_documents): ditto.
-
- * ext/syck/rubyext.c (syck_emitter_s_alloc): ditto.
-
- * ext/syck/rubyext.c (syck_mark_emitter): ditto.
-
- * ext/syck/rubyext.c (syck_emitter_reset): ditto.
-
- * ext/syck/rubyext.c (syck_scalar_value_set): "should set newly
- allocated memory instead of RString's internal storage" stuff again.
- by this, should call syck_free_node instead of rb_syck_free_node.
-
- * ext/syck/rubyext.c (syck_node_type_id_set): ditto.
-
- ... I believe syck GC problem was solved by this.
-
-Mon Dec 19 12:20:59 2005 Tanaka Akira <akr@m17n.org>
-
- * eval.c (FUNCTION_CALL_MAY_RETURN_TWICE): activate only
- before gcc 4.0.3 on SPARC and IA64.
-
-Mon Dec 19 11:37:47 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * ext/syck/rubyext.c: sorry, I reverted my "should set newly
- allocated memory instead of RString's internal storage" stuff.
- node allocated in rubyext.c seems to be freed by rb_syck_free_node
- not syck_free_node, and it won't free data.str->ptr and type_id.
-
- (I still think this is unsafe because RString(foo)->ptr becomes
- dangling pointer when RString is modified or freed, but anyway
- I misunderstood, so go back to original code for now)
-
-Sat Dec 17 21:50:41 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Tue Dec 20 12:53:23 2005 why the lucky stiff <why@ruby-lang.org>
- * ext/syck/rubyext.c (syck_emitter_reset): should initialize
- emitter->bonus->oid. otherwise rb_gc_mark crashes.
+ * ext/syck/rubyext.c (syck_emitter_reset): to ensure compatibility
+ with previous Ruby versions, documents are no longer headless.
- * ext/syck/rubyext.c (syck_mark_parser): should mark anchor nodes
- because they hold ruby objects. (ie: rb_syck_bad_anchor_handler)
+Tue Dec 20 01:46:48 2005 Tanaka Akira <akr@m17n.org>
-Sat Dec 17 11:00:17 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * io.c (rb_f_backquote): fix a GC problem on
+ IA64 with gcc 4.0.3 20051216 (prerelease) -O3.
- * ext/syck/rubyext.c (rb_syck_compile): avoid potential memory
- leak.
+Mon Dec 19 23:32:39 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/syck/rubyext.c (syck_set_ivars): avoid potential memory
- leak by explicit symbol allocation.
+ * parse.y (rb_symname_p): fixed wrong validation. [ruby-dev:28047]
Sat Dec 17 03:57:01 2005 Tanaka Akira <akr@m17n.org>
@@ -47558,35 +8776,10 @@ Sat Dec 17 03:30:23 2005 Tanaka Akira <akr@m17n.org>
* eval.c (bmcall): fix a GC problem by tail call on
IA64 with gcc 4.0.3 20051216 (prerelease).
-Fri Dec 16 17:53:45 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * ext/syck/rubyext.c (rb_syck_compile): fixed memory leak.
+Fri Dec 16 00:54:06 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
- * ext/syck/rubyext.c: should protect global variable from GC.
-
-Fri Dec 16 11:44:43 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * ext/syck/rubyext.c (syck_resolver_tagurize): fixed memory leak.
-
- * ext/syck/rubyext.c (syck_node_type_id_set): should set newly
- allocated memory instead of RString's internal storage.
-
- * ext/syck/rubyext.c (syck_scalar_value_set): ditto.
-
- ... these fixes won't fix [ruby-dev:27839]. more work is needed.
-
-Fri Dec 16 04:38:55 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/delegate.rb (Delegator::method_missing): should delegate
- block as well.
-
-Thu Dec 15 19:57:12 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/cgi.rb (CGI::QueryExtension::MorphingBody): fix criteria to
- use Tempfile. A fix from Zev Blut <rubyzbibd at ubit.com>.
- [ruby-core:06076]
-
- * string.c: remove global functions work on $_.
+ * signal.c (Init_signal): revert C++ style comment.
+ [ruby-dev:28041]
Thu Dec 15 12:35:14 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
@@ -47598,18 +8791,10 @@ Thu Dec 15 01:33:31 2005 Tanaka Akira <akr@m17n.org>
* ext/zlib/zlib.c (zstream_run): fix a GC problem by tail call on
x86_64 with gcc 4.0.3 20051111 (prerelease) (Debian 4.0.2-4)
-Wed Dec 14 23:50:20 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/rdoc/parsers/parse_c.rb (find_class_comment): fix for class
- document with prototypes. [ruby-core:06863]
+Wed Dec 14 12:11:46 2005 WATANABE Hirofumi <eban@ruby-lang.org>
-Wed Dec 14 23:39:53 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * dir.c (has_magic): glob names contain alphabets to enable case fold
- search. [ruby-dev:27735]
-
- * dir.c (Init_Dir): FNM_SYSCASE which is default case fold flag.
- [ruby-dev:23296]
+ * test/gdbm/test_gdbm.rb: specify pid for the argument of
+ Process.wait. workaround for Cygwin.
Wed Dec 14 12:01:26 2005 Tanaka Akira <akr@m17n.org>
@@ -47633,18 +8818,11 @@ Tue Dec 13 00:08:09 2005 Tanaka Akira <akr@m17n.org>
* sprintf.c (rb_str_format): fix a GC problem.
[ruby-dev:28001]
-Mon Dec 12 15:51:22 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Mon Dec 12 15:54:56 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
* test/openssl/test_ssl.rb (test_parallel): call GC.start to close
unused files. [ruby-dev:27981]
-Mon Dec 12 09:58:09 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * range.c (range_cover): new method Range#cover? added. the
- method name might be changed. thanks to takano32 at
- http://www.rubyist.net/~matz/20051210.html#c08 for name
- suggestion. [ruby-talk:167182]
-
Mon Dec 12 00:33:56 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
* ext/digest/digest.c (rb_digest_base_s_digest): add volatile to
@@ -47654,38 +8832,11 @@ Mon Dec 12 00:33:56 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
be called before actual variable initialization.
[ruby-dev:27986]
-Sun Dec 11 23:54:07 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tk/*: update to support libraries in ActiveTcl8.4.12.0
- (see ext/tk/ChangeLog.tkextlib).
-
- * ext/tk/sample/scrollframe.rb: add a new sample.
-
-Sun Dec 11 22:07:58 2005 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
-
- * test/rinda/test_rinda.rb (test_remote_array_and_hash): pseudo remote
- objects are protected against GC. [ruby-dev:27911]
-
-Sat Dec 10 01:06:06 2005 Keiju Ishitsuka <keiju@ruby-lang.org>
-
- * lib/matrix.rb: add Matrix#determinant_e, Matrix#rank_e.
- [ruby-dev:27820] and related thread.
-
-Sat Dec 10 00:31:42 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval.c (calling_scope_t): gave names to magic numbers for rb_call().
- [ruby-dev:27978]
-
Fri Dec 9 23:31:02 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/rexml/encoding.rb (encoding=): give priority to particular
conversion to iconv. [ruby-core:06520]
-Fri Dec 9 23:16:51 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * range.c (range_include): return false unless included in numeric
- range. fixed: [ruby-dev:27975]
-
Thu Dec 8 02:07:19 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
* eval.c (umethod_bind): adjust invoking class for module method.
@@ -47700,15 +8851,6 @@ Wed Dec 7 17:10:27 2005 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
* sprintf.c (rb_f_sprintf): [ruby-dev:27967]
-Wed Dec 7 16:39:18 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * range.c (range_include): use discrete membership for non Numeric
- values, for example, String.
-
- * numeric.c (num_scalar_p): new method. [ruby-dev:27936]
-
- * lib/complex.rb (Complex#scalar?): ditto.
-
Wed Dec 7 15:31:35 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
* sprintf.c (rb_str_format): integer overflow check added.
@@ -47736,22 +8878,11 @@ Wed Dec 7 01:02:04 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tk/sample/demos-en/menu.rb: ditto.
-Tue Dec 6 16:48:40 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * gc.c (ruby_xmalloc2): change check condition for integer
- overflow. [ruby-dev:27399]
-
- * gc.c (ruby_xrealloc2): ditto.
-
Tue Dec 6 16:37:57 2005 Yuya Nishida <yuya@j96.org>
* eval.c (exec_under): avoid accessing ruby_frame->prev.
[ruby-dev:27948]
-Fri Dec 2 19:06:06 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * dir.c (Compare): should not fold double byte alphabet on win9x.
-
Thu Dec 1 00:50:33 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
* eval.c (rb_funcall2): allow to call protected methods.
@@ -47759,9 +8890,6 @@ Thu Dec 1 00:50:33 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
Wed Nov 30 23:52:17 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * parse.y (struct parser_params): fields common to ripper must be
- placed at each same offset.
-
* parse.y (NEWHEAP, ADD2HEAP): set count after pointer was set.
fixed: [ruby-dev:27896]
@@ -47770,51 +8898,23 @@ Wed Nov 30 13:43:07 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
* misc/ruby-mode.el (ruby-expr-beg): support $! at the end of
expression. [ruby-dev:27868]
-Tue Nov 29 23:57:05 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (struct parser_params): heap must be placed at same offset
- also in ripper.y. fixed: [ruby-dev:27846]
-
- * parse.y (yycompile): prevent vparser from tail call optimization.
- fixed: [ruby-dev:27851]
-
- * parse.y (parser_mark): value needs to be marked.
- fixed: [ruby-dev:27845]
-
-Tue Nov 29 22:45:30 2005 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
-
- * lib/drb/observer.rb (notify_observers): follow change of observer.rb.
- fixed: [ruby-core:6796]
-
-Mon Nov 28 20:24:22 2005 Tanaka Akira <akr@m17n.org>
-
- * lib/pp.rb (PP::PPMethods#object_address_group): mask an address with
- word size.
-
- * lib/pp.rb (PP::PPMethods#object_address_group): adjust address format.
-
-Mon Nov 28 18:55:22 2005 NAKAMURA Usaku <usa@ruby-lang.org>
+Mon Nov 28 18:55:43 2005 NAKAMURA Usaku <usa@ruby-lang.org>
* ext/socket/socket.c (init_inetsock_internal): remove setting
SO_REUSEADDR option on server socket on Cygwin.
fixed: [ruby-core:6765] ([ ruby-Bugs-2872 ])
-Mon Nov 28 13:11:45 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Mon Nov 28 13:08:54 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* win32/win32.c (rb_w32_strerror): remove all CR and LF. (avoid broken
error message on bccwin32 + winsock)
-Mon Nov 28 09:15:50 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Mon Nov 28 09:21:49 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* lib/mkmf.rb (create_makefile): should not change sodir with
- dir.gsub!. (bccwin32 failed to install third party extensions)
+ dir.gsub!. (bccwin32 failed to install third party exntesions)
[ruby-dev:27834]
-Sun Nov 27 05:37:20 2005 Tanaka Akira <akr@m17n.org>
-
- * lib/pathname.rb: use File.basename to decompose pathnames.
- experimental Windows support.
-
Sun Nov 27 00:56:13 2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
* lib/wsdl/xmlSchema/complexContent.rb: missing
@@ -47824,103 +8924,23 @@ Sat Nov 26 19:57:45 2005 WATANABE Hirofumi <eban@ruby-lang.org>
* dln.c (conv_to_posix_path): should initialize posix.
-Fri Nov 25 20:34:56 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/xmlrpc/datetime.rb (DateTime::to_a): comparison with non
- array-convertible object must return false.
+Thu Nov 24 21:05:58 2005 NAKAMURA Usaku <usa@ruby-lang.org>
-Fri Nov 25 14:34:09 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * configure.in (AC_CHECK_FUNCS): need to check link().
+ fixed: [ruby-dev:27814]
- * range.c (range_max): treat end exclusion without iteration if
- the end value is an integer. [ruby-talk:167433]
-
-Fri Nov 25 12:52:57 2005 Kouhei Sutou <kou@cozmixng.org>
-
- * lib/rss/rss.rb: added backward compatibility codes.
- * lib/rss/parser.rb: ditto.
- * test/rss/test_parser.rb: ditto.
- * test/rss/test_2.0.rb: ditto.
-
- * test/rss/test_content.rb: use #__send__ instead of #funcall for
- no private method.
-
-Fri Nov 25 12:39:56 2005 Kouhei Sutou <kou@cozmixng.org>
-
- * lib/rss/rss.rb: improved type conversion.
- * lib/rss/1.0.rb: ditto.
- * lib/rss/0.9.rb: ditto.
- * lib/rss/2.0.rb: ditto.
- * lib/rss/image.rb: ditto.
- * lib/rss/syndication.rb: ditto.
-
- * test/rss/test_2.0.rb: added type conversion tests.
- * test/rss/test_accessor.rb: ditto.
- * test/rss/test_to_s.rb: ditto.
- * test/rss/test_syndication.rb: ditto.
- * test/rss/test_setup_maker_2.0.rb: ditto.
- * test/rss/test_setup_maker_1.0.rb: ditto.
- * test/rss/test_setup_maker_0.9.rb: ditto.
- * test/rss/test_maker_sy.rb: ditto.
- * test/rss/test_maker_image.rb: ditto.
- * test/rss/test_maker_2.0.rb: ditto.
- * test/rss/test_maker_0.9.rb: ditto.
- * test/rss/test_image.rb: ditto.
-
- * test/rss/test_maker_1.0.rb: use assert instead of assert_equal.
-
- * test/rss/rss-assertions.rb: improved type conversion assertions.
-
-Fri Nov 25 10:38:20 2005 Kouhei Sutou <kou@cozmixng.org>
-
- * lib/rss/image.rb: added Image prefix.
-
- * lib/rss/maker/image.rb: ditto.
-
-Fri Nov 25 10:33:02 2005 Kouhei Sutou <kou@cozmixng.org>
-
- * test/rss/test_2.0.rb: added RSS 2.0 tests.
-
- * test/rss/rss-assertions.rb: extended XML stylesheet assertion.
-
- * lib/rss/0.9.rb: added initialize method.
-
- * test/rss/test_1.0.rb: cleanup.
-
-Fri Nov 25 10:29:48 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * range.c (range_min): use <=> comparison rather than iteration.
- [ruby-talk:167420]
-
- * range.c (range_max): ditto.
-
-Thu Nov 24 01:31:44 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Thu Nov 24 01:22:25 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* file.c (w32_io_info): CreateFile failed on Win9x if file was already
opened. (FILE_SHARE_READ was needed, but actually I don't understand
the flags of CreateFile well...)
-Wed Nov 23 23:52:35 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * numeric.c (num_div): use floor rather than rb_Integer().
- [ruby-dev:27674]
-
-Wed Nov 23 22:34:15 2005 Kouhei Sutou <kou@cozmixng.org>
-
- * lib/rss/parser.rb: added entity handling type predicate.
- * lib/rss/rexmlparser.rb: ditto.
- * lib/rss/xmlparser.rb: ditto.
- * lib/rss/xmlscanner.rb: ditto.
-
- * lib/rss/xmlscanner.rb: more robust entity handling.
-
- * test/rss/test_parser.rb: added an entity handling test.
-
Wed Nov 23 20:59:01 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tk/lib/tk.rb: add Tk.pkgconfig_list and Tk.pkgconfig_get
[Tk8.5 feature].
- * ext/tk/lib/tk/text.rb: supports new indices modifiers on a Text
+ * ext/tk/lib/tk/text.rb: supports new indices modifires on a Text
widget [Tk8.5 feature].
* ext/tk/lib/tk/virtevent.rb: add TkNamedVirtualEvent.
@@ -47930,7 +8950,7 @@ Wed Nov 23 20:59:01 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tk/lib/tk/event.rb: add :data key for virtual events [Tk8.5
feature].
-Wed Nov 23 18:52:45 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Wed Nov 23 18:55:31 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* file.c (w32_io_info): should not call GetFileInformationByHandle
for pipe.
@@ -47939,61 +8959,15 @@ Wed Nov 23 18:52:45 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* file.c (w32_io_info): now can identify directory on WinNT.
-Wed Nov 23 18:46:53 2005 Kouhei Sutou <kou@cozmixng.org>
-
- * lib/rss/: use #__send__ instead of #send.
- * test/rss/: ditto.
-
-Wed Nov 23 18:32:56 2005 Kouhei Sutou <kou@cozmixng.org>
-
- * test/rss/test_taxonomy.rb: use #reject directory.
-
-Wed Nov 23 18:26:00 2005 Kouhei Sutou <kou@cozmixng.org>
-
- * lib/rss/taxonomy.rb: changed class or module prefix to
- Taxonomy from Taxo.
- * lib/rss/maker/taxonomy.rb: ditto.
-
-Wed Nov 23 18:21:11 2005 Kouhei Sutou <kou@cozmixng.org>
-
- * lib/rss/maker/taxonomy.rb: implemented taxonomy module for RSS
- Maker.
- * lib/rss/taxonomy.rb: supported RSS Maker.
- * lib/rss/maker.rb: added taxonomy module support.
-
- * lib/rss/rss.rb: adjusted to other element API.
- * lib/rss/1.0.rb: adjusted to other element API but backward
- compatibility is reserved.
- * lib/rss/0.9.rb: ditto.
-
- * test/rss/test_maker_taxo.rb: added test case for taxonomy module
- for RSS Maker.
- * test/rss/test_setup_maker_1.0.rb: added tests for taxo:topic.
-
- * test/rss/test_setup_maker_1.0.rb: added backward compatibility
- test.
- * test/rss/test_setup_maker_0.9.rb: ditto.
- * test/rss/test_setup_maker_2.0.rb: ditto.
-
- * test/rss/rss-testcase.rb: added convenience method for setting
- up taxo:topic.
- * test/rss/rss-assertions.rb: added assertion for taxo:topic.
-
- * sample/rss/blend.rb: followed new API.
-
-Wed Nov 23 17:42:24 2005 Kouhei Sutou <kou@cozmixng.org>
-
- * lib/rss/rss.rb: fixed a indentation bug.
-
- * lib/rss/taxonomy.rb: fixed <taxo:topic> #to_s bug.
-
- * test/rss/test_taxonomy.rb: added a #to_s test.
-
Wed Nov 23 03:40:49 2005 Guy Decoux <ts@moulon.inra.fr>
* re.c (KR_REHASH): should cast to unsigned for 64bit CPU.
[ruby-core:06721]
+Wed Nov 23 11:01:33 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+
+ * intern.h, file.c: failed to compile on windows.
+
Wed Nov 23 07:26:44 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
* ext/openssl/extconf.rb: check for X509V3_EXT_nconf_nid.
@@ -48025,14 +8999,14 @@ Tue Nov 22 18:36:11 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* win32/win32.c (winnt_stat): set mapped errno instead of ENOENT.
-Tue Nov 22 14:36:54 2005 NAKAMURA Usaku <usa@ruby-lang.org>
+Tue Nov 22 14:46:57 2005 NAKAMURA Usaku <usa@ruby-lang.org>
* file.c (rb_file_s_basename): skip slashes just after UNC top slashes.
* test/ruby/test_path.rb (test_dirname, test_basename): follow new
spec. and add new tests.
-Tue Nov 22 13:30:15 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Tue Nov 22 13:18:32 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* win32/win32.c (rb_w32_stat): Dir.chdir('//server/shared');
p Dir.glob('*') should work on WinNT. (implemented our own
@@ -48061,11 +9035,6 @@ Mon Nov 21 16:03:48 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
* win32/setup.mk: findstr doesn't exist on win9x.
fixed: [ruby-dev:27756]
-Sun Nov 20 21:39:27 2005 K.Kosako <sndgk393 AT ybb.ne.jp>
-
- * regparse.c (fetch_token_in_cc): tok->escaped should be
- initialized. [ruby-dev:27763]
-
Sun Nov 20 22:34:06 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
* parse.y (rb_symname_p): [ not followed by ] is not valid symbol.
@@ -48076,10 +9045,6 @@ Sat Nov 19 19:57:54 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
* lib/fileutils.rb (FileUtils::ln): ln documentation fix.
[ruby-core:06661]
-Sat Nov 19 08:19:38 2005 Zach Dennis <zdennis@mktec.com>
-
- * ext/socket/socket.c: Socket Documentation. [ruby-core:6552]
-
Sat Nov 19 07:34:32 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tk/lib/tk/font.rb: remove dependency on Ruby's version (1.8
@@ -48089,7 +9054,7 @@ Sat Nov 19 07:34:32 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tk/sample/tkextlib/treectrl/demo.rb: ditto.
-Fri Nov 18 18:07:05 2005 NAKAMURA Usaku <usa@ruby-lang.org>
+Fri Nov 18 17:57:08 2005 NAKAMURA Usaku <usa@ruby-lang.org>
* file.c (rb_file_s_dirname): should use skipprefix for UNC path.
pointed out by nobu ([ruby-dev:27744]). fixed: [ruby-core:5076]
@@ -48110,7 +9075,7 @@ Fri Nov 18 17:35:09 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tk/lib/tk/namespace.rb: ditto.
-Fri Nov 18 16:47:33 2005 NAKAMURA Usaku <usa@ruby-lang.org>
+Fri Nov 18 17:26:06 2005 NAKAMURA Usaku <usa@ruby-lang.org>
* file.c (rb_file_s_dirname): added checks for some patterns with drive
letter. fixed: [ruby-dev:27738]
@@ -48118,37 +9083,11 @@ Fri Nov 18 16:47:33 2005 NAKAMURA Usaku <usa@ruby-lang.org>
* test/ruby/test_path.rb (test_dirname): added tests for above
patterns.
-Fri Nov 18 12:19:16 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Fri Nov 18 12:18:02 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* win32/win32.h (S_IFIFO): r,w = IO.pipe; r.stat.pipe? now
returns true on VisualC++6.
-Thu Nov 17 17:58:00 2005 Kouhei Sutou <kou@cozmixng.org>
-
- * lib/rss/1.0.rb: added convenience method 'resources'.
-
- * lib/rss/taxonomy.rb: ditto.
-
- * test/rss/rss-assertions.rb: added test for 'resources'.
-
- * test/rss/test_taxonomy.rb: ditto.
-
-Thu Nov 17 17:53:30 2005 Kouhei Sutou <kou@cozmixng.org>
-
- * lib/rss/taxonomy.rb: implemented taxonomy module.
-
- * test/rss/test_taxonomy.rb: added tests for taxonomy support.
-
-Thu Nov 17 17:40:19 2005 Kouhei Sutou <kou@cozmixng.org>
-
- * lib/rss/1.0.rb: added rdf:Bag.
-
-Thu Nov 17 13:52:00 2005 Kouhei Sutou <kou@cozmixng.org>
-
- * lib/rss/rss.rb: removed needless argument 'prefix'.
-
- * lib/rss/parser.rb: ditto.
-
Wed Nov 16 23:24:17 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
* common.mk (static-ruby): overridable.
@@ -48158,24 +9097,12 @@ Wed Nov 16 23:24:17 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ext/extmk.rb (RUBY, RUBYW): overridable.
-Wed Nov 16 01:29:31 2005 Kouhei Sutou <kou@cozmixng.org>
-
- * lib/rss/trackback.rb: added TrackBack prefix.
-
- * lib/rss/maker/trackback.rb: ditto.
-
-Wed Nov 16 01:26:13 2005 Kouhei Sutou <kou@cozmixng.org>
-
- * lib/rss/rss.rb (RSS::VERSION): 0.1.5 -> 0.1.6.
-
- * test/rss/test_version.rb (RSS::TestVersion#test_version): ditto.
-
-Tue Nov 15 23:54:24 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Nov 15 23:46:35 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
- * file.c (file_load_ok): eaccess() returns 0 on success.
- fixed: [ruby-dev:27713]
+ * lib/find.rb (Find::find): should not ignore symbolic links to
+ non-existing files. [ruby-talk:165866]
-Tue Nov 15 16:36:03 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Tue Nov 15 16:23:26 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* array.c (rb_ary_fill): previous commit disabled this usage:
@@ -48183,17 +9110,9 @@ Tue Nov 15 16:36:03 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
a.fill {|i| a[i] * 10} #=> [nil, nil, ...., nil]
previous commit has the advantage of early garbage collection, but
- potentially this would break some script. so I reverted behavior.
+ potensially this would break some script. so I reverted behavior.
-Tue Nov 15 16:15:23 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * file.c (file_load_ok): use eaccess() instead of actually opening
- the file. [ruby-talk:156378]
-
- * lib/jcode.rb (String::reverse): add new methods.
- [ruby-list:41245]
-
-Tue Nov 15 15:49:34 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Tue Nov 15 16:04:10 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* array.c (rb_ary_fill): tail elements were vanished when the middle
part of array was filled. (ie: [0,1,2,3,4].fill(-1,2,1) => [0,1,-1])
@@ -48215,71 +9134,33 @@ Mon Nov 14 17:36:22 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
* array.c (rb_ary_first): RDoc update from Daniel Berger
<djberg96@yahoo.com>. [ruby-core:06577].
-Sun Nov 13 10:55:24 2005 Minero Aoki <aamine@loveruby.net>
-
- * lib/uri/common.rb (escape): regard second argument as a
- character set. [ruby-dev:27692]
-
-Sat Nov 12 08:36:40 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in, eval.c, intern.h: check fd_mask type.
-
- * configure.in (socketpair): need to be checked.
-
-Fri Nov 11 19:53:47 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * eval.c, intern.h: failed to compile where NFDBITS is defined but
- howmany() is not defined. [ruby-dev:27680]
-
- * io.c (is_socket): failed to compile where S_ISSOCK is not defined.
+Fri Nov 11 10:31:44 2005 Zach Dennis <zdennis@mktec.com>
- * io.c (pipe_open): failed to compile where socketpair is not supported.
+ * ext/socket/socket.c: Socket Documentation. [ruby-core:6552]
Fri Nov 11 08:20:56 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
* Makefile.in (OUTFLAG): keep trailing spaces. [ruby-dev:27666]
- * mkconfig.rb: substitution references added.
+ * mkconfig.rb: substitution refereces added.
-Fri Nov 11 07:39:49 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Fri Nov 11 07:44:18 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* configure.in: undef HAVE_LINK on BeOS. (link(2) always returns
EINVAL, and this causes error in test/fileutils.)
- * file.c: override chown(2) and fchown(2) on BeOS. (these functions
+ * file.c: overwride chown(2) and fchown(2) on BeOS. (these functions
should not change user/group id if -1 is passed as corresponding
argument, and this causes error in test/fileutils too)
[ruby-dev:27672]
-Thu Nov 10 21:05:03 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/shellwords.rb: fix for blank but not empty string.
- fixed: [ruby-dev:27663]
-
-Wed Nov 9 08:39:38 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/shellwords.rb: refactored. [ruby-core:06581]
-
-Tue Nov 8 17:35:53 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * intern.h, eval.c (rb_thread_signal_raise): constified.
-
- * signal.c: cosmetic change.
+ * file.c (rb_file_s_link): checks HAVE_LINK.
Tue Nov 8 15:32:27 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
* lib/drb/ssl.rb (DRb::SSLConfig#accept): fixed typo.
[ruby-dev:27560] [ruby-core:4627]
-Mon Nov 7 20:54:57 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/iconv/iconv.c: iconvctl() support. [EXPERIMENTAL]
-
-Mon Nov 7 16:23:23 2005 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * ext/openssl/ossl.h: need to include winsock2.h before including
- windows.h by some openssl headers.
-
Mon Nov 7 13:43:51 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tk/stubs.c (_nativethread_consistency_check): use simpler
@@ -48290,7 +9171,7 @@ Mon Nov 7 13:43:51 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tk/tkutil/tkutil.c: ditto.
-Mon Nov 7 00:06:12 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Mon Nov 7 00:06:58 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* lib/yaml.rb: removed :nodoc: to generate Kernel doc. [ruby-core:6324]
@@ -48299,7 +9180,7 @@ Sun Nov 6 23:39:13 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ext/iconv/iconv.c (Iconv::BrokenLibrary): exception when detected a
bug of underlying library.
-Sun Nov 6 21:43:22 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Sun Nov 6 21:46:59 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* ext/tk/stubs.c (ruby_tcl_create_ip_and_stubs_init): should touch
interpreter after initialization is done. [ruby-dev:27638]
@@ -48309,33 +9190,21 @@ Sun Nov 6 20:13:27 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
* file.c (rb_file_s_readlink): readlink(2) on AIX fails with ERANGE if
buffer size is less than required. fixed: [ruby-dev:27634]
-Sat Nov 5 13:42:50 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in, cygwin/GNUmakefile.in (mingw): use def file to alias
- symbols. [ruby-dev:27532]
-
- * bcc32/mkexports.rb, win32/mkexports.rb: make aliases in DLL.
-
- * win32/win32.c, win32/win32.h: replace symbols only when RUBY_EXPORT
- is defined.
-
-Thu Nov 3 07:57:39 2005 Minero Aoki <aamine@loveruby.net>
-
- * lib/open-uri.rb (open_loop): find_proxy should return nil when
- proxy does not exist. [ruby-dev:27630]
-
Wed Nov 2 20:25:28 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tk/extconf.rb: ext/tk/extconf.rb: change the check parameter
for Win32.
+Wed Nov 2 20:14:53 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+
+ * ext/tcltklib: merge into ext/tk and remove.
+
Wed Nov 2 19:03:06 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
- * ext/tk/tcltklib.c (ip_rbUpdateObjCmd, ip_rb_threadUpdateObjCmd):
- passed improper flags to DoOneEvent().
+ * ext/tcltklib/tcltklib.c (ip_rbUpdateObjCmd,
+ ip_rb_threadUpdateObjCmd): passed improper flags to DoOneEvent().
- * ext/tk/tkutil/tkutil.c: use rb_obj_respond_to() instead of
- rb_respond_to().
+ * ext/tk/tkutil.c: use rb_obj_respond_to() instead of rb_respond_to().
Tue Nov 1 14:20:11 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
@@ -48345,7 +9214,7 @@ Tue Nov 1 14:20:11 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
* eval.c (exec_under): frame during eval should preserve external
information.
-Tue Nov 1 10:48:49 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Tue Nov 1 10:50:17 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
* ext/openssl/extconf.rb: should check ERR_peek_last_error().
[ruby-dev:27597]
@@ -48357,14 +9226,19 @@ Mon Oct 31 17:34:46 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
* configure.in: use proper option for Sun linker. A patch from
Shinya Kuwamura <kuwa at labs.fujitsu.com>. [ruby-dev:27603]
-Mon Oct 31 05:46:08 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Mon Oct 31 11:27:22 2005 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * test/gdbm/test_gdbm.rb, test/sdbm/test_sdbm.rb (test_s_open_error):
+ skip on Win32/DOS platforms.
+
+Mon Oct 31 05:49:23 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
* ext/openssl/ossl_cipher.c (ossl_cipher_update): input data must
not be empty. [ruby-talk:161220]
* test/openssl/test_cipher.rb: add test for Cipher#update("").
-Mon Oct 31 05:38:26 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Mon Oct 31 05:37:20 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
* lib/webrick/httpservlet/cgihandler.rb
(WEBrick::HTTPServlet::CGIHandler#do_GET): the value of Set-Cookie:
@@ -48376,14 +9250,17 @@ Mon Oct 31 05:38:26 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
* test/webrick/test_cookie.rb, test/webrick/test_cgi.rb,
test/webrick/webrick.cgi: add some test for cookie.
-Mon Oct 31 02:33:25 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+Mon Oct 31 03:19:36 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * ext/readline/readline.c (readline_readline): type check.
+ [ruby-core:6089]
* numeric.c (fix_rshift): RDoc fix. [ruby-core:6351]
* util.h (strtod): add #undef for platforms defines strtod()
macro. [ruby-dev:27563]
-Mon Oct 31 02:31:41 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Mon Oct 31 02:35:59 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* test/ruby/test_float.rb (test_precision): test by assert_in_delta.
[ruby-dev:27575]
@@ -48395,33 +9272,25 @@ Sat Oct 29 01:58:25 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
* ext/fcntl/fcntl.c: ditto.
-Sat Oct 29 16:56:03 2005 Tadayoshi Funaba <tadf@dotrb.org>
-
- * lib/date.rb: added seven predicates sunday? to saturday?.
-
- * lib/date.rb: added two methods {prev,next}_month,
- that are almost same as << and >>.
-
-Thu Oct 27 20:34:43 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * enumerator.c (enumerator_allocate): allow subclassing.
-
Thu Oct 27 16:45:31 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
* string.c (scan_once): wrong condition to use mbclen2().
[ruby-dev:27535]
-Thu Oct 27 11:53:17 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * missing.h, missing/memcmp.c, missing/memmove.c:
- ANSI compatible interface.
-
-Wed Oct 26 09:15:48 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Wed Oct 26 09:27:27 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* ext/syck/implicit.c (syck_type_id_to_uri): should return
newly allocated memory. otherwise, type_id will be freed
twice. [ruby-dev:27384] [ruby-core:6385]
+Wed Oct 26 09:04:51 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+
+ * ruby.h (Qfalse, Qtrue, Qnil, Qundef): make sure these immediate
+ values have VALUE type. there is an environment where sizeof(VALUE)
+ != sizeof(int) like IA64. if 32bit integer (Qtrue) is passed to ANYARGS
+ and received by 64bit integer (VALUE), upper bits may have garbage value.
+ [ruby-dev:27513]
+
Wed Oct 26 01:58:19 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
* configure.in (RUBY_EXTERN): macro to export symbols in shared
@@ -48432,14 +9301,6 @@ Wed Oct 26 01:58:19 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ext/extmk.rb (extmake): RUBY_EXTERN for static linked extensions.
-Tue Oct 25 20:06:59 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * ruby.h (Qfalse, Qtrue, Qnil, Qundef): make sure these immediate
- values have VALUE type. there is an environment where sizeof(VALUE)
- != sizeof(int) like IA64. if 32bit integer (Qtrue) is passed to ANYARGS
- and received by 64bit integer (VALUE), upper bits may have garbage value.
- [ruby-dev:27513]
-
Tue Oct 25 15:32:00 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
* lib/rational.rb: applied documentation patch from Gavin Sinclair
@@ -48448,22 +9309,12 @@ Tue Oct 25 15:32:00 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
* lib/irb.rb (IRB::Irb::eval_input): handle prompts with newlines
in irb auto-indentation mode. [ruby-core:06358]
-Tue Oct 25 14:21:46 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * gc.c (garbage_collect): sorry, previous commit was incorrect.
- [ruby-core:6386]
-
-Tue Oct 25 13:40:16 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * gc.c (garbage_collect): return now whether there're rooms for new
- objects, rather than whether GC run. fixed: [ruby-core:6376]
-
Tue Oct 25 02:12:08 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/rdoc/markup/simple_markup.rb (SM::SimpleMarkup::LABEL_LIST_RE):
reduce redundant backtrack. [ruby-talk:161771]
-Tue Oct 25 00:35:33 2005 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+Tue Oct 25 00:27:35 2005 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
* lib/rinda/*: RDoc documentation from Eric Hodel
<drbrain@segment7.net> added.
@@ -48473,19 +9324,11 @@ Mon Oct 24 21:14:29 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
* configure.in, io.c: use sys/syscall.h if syscall.h is not available.
[ruby-core:06247]
-Mon Oct 24 20:38:25 2005 NAKAMURA Usaku <usa@ruby-lang.org>
+Mon Oct 24 20:49:45 2005 NAKAMURA Usaku <usa@ruby-lang.org>
* ext/Win32API/lib/win32/resolv.rb (get_info): support multiple DNS.
fixed: [ruby-list:40058], [ruby-dev:27479]
-Mon Oct 24 11:01:11 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tk/lib/tk/canvas.rb (TkCanvasItemConfig::__item_val2ruby_optkeys):
- typo fixed. [ruby-talk:162187]
-
- * ext/tk/lib/tk/menu.rb (TkMenuEntryConfig::__item_val2ruby_optkeys):
- ditto. [ruby-core:06359]
-
Mon Oct 24 07:57:56 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
* ext/tk/lib/tk/canvas.rb (TkCanvasItemConfig::__item_val2ruby_optkeys):
@@ -48494,18 +9337,15 @@ Mon Oct 24 07:57:56 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
* ext/tk/lib/tk/menu.rb (TkMenuEntryConfig::__item_val2ruby_optkeys):
ditto. [ruby-core:06359]
- * lib/matrix.rb (Matrix::initialize): use funcall instead of send
- to allow private methods to be called. A report from
- Jean-Claude Arbaut <jcarbaut@laposte.net>. [ruby-core:06359]
-
-Mon Oct 24 00:41:18 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+Sun Oct 23 21:50:15 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
- * time.c (time_sunday): added predicate methods for the days of the
- week. [ruby-list:41340]
+ * ext/enumerator/enumerator.c: applied documentation patch from
+ James Edward Gray II <james@grayproductions.net>.
+ [ruby-core:06348]
Sun Oct 23 07:11:11 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
- * ext/tk/extconf.rb: improve messages [ruby-core:06325].
+ * ext/tcltklib/extconf.rb: improve messages [ruby-core:06325].
* ext/tk/lib/tk.rb, ext/tk/lib/tk/canvas.rb, ext/tk/lib/tk/entry.rb,
ext/tk/lib/tk/frame.rb, ext/tk/lib/tk/image.rb,
@@ -48532,16 +9372,6 @@ Sat Oct 22 23:54:07 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ext/extmk.rb, lib/mkmf.rb (with_config): support --with-extension
options. [ruby-dev:27449]
-Sat Oct 22 14:25:43 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * util.[hc] (ruby_add_suffix): constified.
-
- * util.[hc] (ruby_scan_{oct,hex}): fixed typo. (renamed from
- scan_{oct,hex})
-
- * util.c: almostly ANSI styled. (except for functions depending on
- macro and K&R technique)
-
Sat Oct 22 13:26:57 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
* object.c (sym_inspect), parse.y (parser_yylex, rb_symname_p): check
@@ -48552,20 +9382,7 @@ Sat Oct 22 13:26:57 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
* time.c (rb_strftime): removed meaningless volatile modifiers, and
concatenate successive nul characters at once. [ruby-dev:27472]
- * ext/tk/lib/tk/font.rb, ext/tk/lib/tkextlib/ICONS/icons.rb,
- ext/tk/sample/tkextlib/treectrl/demo.rb, lib/net/imap.rb,
- lib/rss/parser.rb, test/rss/test_content.rb,
- test/rss/test_dublincore.rb, test/rss/test_syndication.rb,
- test/rss/test_trackback.rb, test/ruby/test_eval.rb,
- test/socket/test_socket.rb, test/socket/test_udp.rb:
- Object#fcall was renamed as Object#funcall.
-
-Sat Oct 22 10:08:28 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * missing.h, missing/*.c: SUSv3 compatible strcasecmp and strncasecmp,
- ANSI compatible strtol and strtoul, and ANSI styled other functions.
-
-Fri Oct 21 19:16:08 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Fri Oct 21 19:21:56 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* rubysig.h (CHECK_INTS): fixed typo. (I believe bit-or is improper)
@@ -48573,27 +9390,7 @@ Fri Oct 21 17:49:32 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
* bin/erb (ERB::Main::run): typo fixed. [ruby-core:06337]
-Fri Oct 21 15:42:28 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * intern.h, struct.c (rb_struct_iv_get): constified.
-
- * marshal.c: avoid one VC++6 warning for implicit conversion
- from int to char.
-
- * ruby.h: ANSI styled.
-
- * bcc32/Makefile.sub (HAVE_HYPOT): added.
-
- * ext/socket/extconf.rb: BeOS is only one platform should call
- closesocket, so check __BEOS__ macro directly. (I was worried
- accidently HAVE_CLOSESOCKET is defined on windows again because
- it has it)
-
- * ext/socket/{getaddrinfo.c,socket.c}: ditto.
-
- ... these are all cosmetic changes.
-
-Fri Oct 21 15:23:23 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Fri Oct 21 15:27:17 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* bignum.c (bignew_1): convertion from `int' to `char' discards
upper bits, (ie. (char)0xff00 -> 0) so it's better to test if
@@ -48603,26 +9400,7 @@ Fri Oct 21 15:23:23 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* time.c: should use LONG_LONG instead of `long long'.
-Thu Oct 20 22:22:49 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parser.y (struct parser_params): parser never modify input string.
-
- * ext/ripper/tools/preproc.rb (prelude): do not append surplus
- newlines to fix line numbers.
-
-Thu Oct 20 11:41:57 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * class.c, eval.c, hash.c, st.c, variable.c: changed /* ??? */ stuff
- protoize generated to ANYARGS.
-
-Thu Oct 20 11:18:11 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * eval.c, file.c, ruby.c: removed strchr, strrchr, strstr definition
- because they are defined in missing.h.
-
- * missing.h, missing/strchr.c, missing/strstr.c: ANSI styled.
-
-Thu Oct 20 09:36:06 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Thu Oct 20 09:37:15 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* lib/mkmf.rb (create_makefile): Borland make seems not to allow
empty dependency list. If this change is not good, please correct
@@ -48633,13 +9411,20 @@ Thu Oct 20 07:55:09 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/mkmf.rb (create_makefile): get rid of a restriction
of Borland make. fixed: [ruby-dev:27460]
- * ext/ripper/depend: ditto.
+Thu Oct 20 00:13:18 2005 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * rubysig.h (CHECK_INTS): fix typo.
Wed Oct 19 23:58:03 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/mkmf.rb (create_makefile): do not create unnecessary empty
directories. fixed: [ruby-dev:27451]
+Wed Oct 19 19:26:15 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * parse.y (rb_gc_mark_parser): get rid of segfault with old yacc.
+ fixed: [ruby-dev:27439]
+
Wed Oct 19 08:28:32 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
* file.c (rb_file_join): elements may contain null pointer strings.
@@ -48647,33 +9432,27 @@ Wed Oct 19 08:28:32 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
Wed Oct 19 02:34:33 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * enumerator.c, eval.c, gc.c, parse.y, regparse.c, sjis.c, time.c:
- made internal symbols static. [ruby-dev:27435]
-
-Tue Oct 18 10:58:27 2005 NAKAMURA Usaku <usa@ruby-lang.org>
+ * eval.c, gc.c, time.c: made internal symbols static. [ruby-dev:27435]
- * ext/dl/depend, ext/dl/extconf.rb, ext/socket/depend,
- ext/socket/extconf.rb: shouldn't define DESTCLEANFILES in depend,
- use $distcleanfiles in extconf.rb.
+Wed Oct 19 01:27:07 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * win32/Makefile.sub (distclean-local): should remove .config.h.time.
+ * regex.c (re_compile_pattern): numeric literal inside character class
+ disabled succeeding backtrack. fixed: [ruby-list:41328]
-Mon Oct 17 09:42:50 2005 NAKAMURA Usaku <usa@ruby-lang.org>
+Mon Oct 17 21:18:50 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * mkconfig.rb: fixup configure_args for mswin32 configure.
+ * parse.y (parser_heap): byacc never free parser stack.
+ fixed: [ruby-dev:27428]
- * win32/configure.bat (srcdir, target): ditto.
+Mon Oct 17 16:04:47 2005 NAKAMURA Usaku <usa@ruby-lang.org>
-Mon Oct 17 05:01:50 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * env.h: move struct METHOD and struct BLOCK from eval.c to
- support NodeWrap and ParseTree.
+ * file.c (chmod_internal, lchmod_internal): fixed type of 2nd argument.
Sun Oct 16 22:16:51 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ext/extmk.rb: omit non-existing directories.
-Sun Oct 16 14:40:54 2005 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+Sun Oct 16 14:30:05 2005 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
* lib/rinda/rinda.rb (Rinda::Tuple#initialize): check remote hash
tuple. fixed: [ruby-list:41227]
@@ -48691,48 +9470,20 @@ Sun Oct 16 03:38:07 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
* eval.c (rb_thread_schedule): clear rb_thread_critical.
[ruby-core:04039]
-Sun Oct 16 00:13:14 2005 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/configure.bat: remove unnecessary line which prevents
- creating Makefile.
-
-Sat Oct 15 23:52:07 2005 Shugo Maeda <shugo@ruby-lang.org>
-
- * lib/net/ftp.rb: (getbinaryfile): allow nil for localfile, and
- returns retrieved data if localfile is nil.
-
- * lib/net/ftp.rb: (gettextfile): ditto.
-
-Sat Oct 15 19:51:29 2005 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+Sat Oct 15 19:56:38 2005 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
* bin/erb: typo fixed, again. thanks, Doug Kearns.
-Fri Oct 14 23:09:31 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * win32/Makefile.sub (MKFILES): update MKFILES if configure files get
- changed.
-
- * win32/configure.bat, win32/setup.mak (configure_args): store
- arguments to configure files.
-
-Fri Oct 14 22:05:45 2005 NAKAMURA Usaku <usa@ruby-lang.org>
+Fri Oct 14 22:08:26 2005 NAKAMURA Usaku <usa@ruby-lang.org>
* win32/win32.c (ioctl): should set errno.
-Fri Oct 14 16:39:37 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Fri Oct 14 16:57:32 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
* lib/webrick/config.rb (Config::FileHandler): :UserDir should be nil.
It is harmful to permit the access to ~/public_html by default.
suggested by Hiroyuki Iwatsuki.
-Fri Oct 14 04:58:38 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (rb_obj_instance_exec): create instance_exec and
- module_exec which pass arguments to the block.
-
- * eval.c (rb_f_funcall): rename fcall to funcall to follow
- tradition.
-
Thu Oct 13 23:29:51 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
* parse.y (HEAPCNT): bison allocates indivisible size.
@@ -48741,7 +9492,7 @@ Thu Oct 13 23:29:51 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
* io.c, pack.c, ext/syck/rubyext.c, ext/syck/syck.h, missing/isinf.c:
get rid of warnings. fixed: [ruby-core:06247]
-Wed Oct 12 12:51:56 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Wed Oct 12 12:52:57 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
* ext/openssl/ossl.c (Init_openssl): should call
OpenSSL_add_ssl_algorithms().
@@ -48752,15 +9503,6 @@ Wed Oct 12 11:08:54 2005 WATANABE Hirofumi <eban@ruby-lang.org>
Tue Oct 11 21:41:58 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * configure.in (RUBY_FUNC_ATTRIBUTE): check prefixed attribute form
- first. [ruby-dev:27398]
-
- * array.c, enum.c, eval.c, util.c: safer function pointer usage.
- fixed: [ruby-core:06143]
-
- * util.h (qsort): removed the definition incompatible to ANSI.
- fixed: [ruby-core:06147]
-
* eval.c (rb_obj_respond_to): check if obj responds to the given
method with the given visibility. [ruby-dev:27408]
@@ -48771,66 +9513,33 @@ Tue Oct 11 00:01:21 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
* st.c (st_free_table): do not call free() but xfree().
[ruby-core:06205]
-Sat Oct 8 19:49:42 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat Oct 8 20:04:40 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
* eval.c (Init_Binding): add Binding#dup method. [yarv-dev:666]
- * io.c (rb_io_init_copy): clear PREP flag for copied IO.
- fixed: [ruby-dev:27371]
-
* parse.y (rb_parser_malloc, rb_parser_free): manage parser stack on
heap. [ruby-list:41199]
- * parse.y (ripper_initialize): use rb_respond_to().
-
- * ext/ripper/depend (check): get rid of re-generating ripper.y always.
-
* ext/iconv/charset_alias.rb: parse config.charset_alias file directly.
- * ext/nkf/lib/kconv.rb (Kconv.conv): get rid of nil.to_a.
-
- * lib/scanf.rb (Scanf::FormatSpecifier#letter, #width): use matched
- substring directly.
-
- * test/ruby/test_assignment.rb, test/ruby/test_iterator.rb: followed
- change of sample/test.rb.
-
- * test/net/http/test_http.rb: removed superfluous splatting stars.
-
-Fri Oct 7 16:41:43 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (splat_value): call rb_Array() to convert svalue to
- values. [ruby-dev:27397]
-
Fri Oct 7 09:54:00 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
* lib/cgi.rb (CGI::Cookie::parse): Cookies from Nokia devices may
not be parsed correctly. A patch from August Z. Flatby
(augustzf) in [ruby-Patches-2595]. [ruby-core:06183]
-Thu Oct 6 22:51:30 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * object.c (rb_Array): Array() to raise error for objects without
- to_ary, nor to_a.
-
- * object.c (nil_to_a): revert NilClass#to_a.
-
-Thu Oct 6 20:10:38 2005 Minero Aoki <aamine@loveruby.net>
+Thu Oct 6 20:12:16 2005 Minero Aoki <aamine@loveruby.net>
* ext/strscan/strscan.c (strscan_free): remove useless code.
[ruby-dev:26368] [ruby-dev:27389]
-
-Thu Oct 6 01:02:19 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * range.c (rb_range_beg_len): should return Qfalse for non-range
- object.
+ (backported from trunk, rev 1.22)
Wed Oct 5 04:42:38 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
* lib/xmlrpc/server.rb (XMLRPC::Server#initialize): should mount the
servlet on "/".
-Wed Oct 5 04:06:49 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Wed Oct 5 03:59:09 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
* lib/xmlrpc/server.rb (XMLRPC::Server#serve): delete wrong call
of "join".
@@ -48839,31 +9548,14 @@ Mon Oct 3 00:04:00 2005 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
* pack.c (EXTEND16): [ruby-dev:27383]
-Sat Oct 1 23:55:24 2005 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/win32.c (do_select, rb_w32_select): brush up.
-
-Sat Oct 1 12:57:02 2005 Tanaka Akira <akr@m17n.org>
-
- * bignum.c (rb_big_rand): removed. [ruby-dev:25405]
-
-Sat Oct 1 01:46:51 2005 Tanaka Akira <akr@m17n.org>
-
- * lib/open-uri.rb (OpenURI.open_loop): prohibit multiple proxy
- options.
-
Thu Sep 29 10:26:18 2005 Tanaka Akira <akr@m17n.org>
- * ext/dl/cptr.c (rb_dlptr_s_to_ptr): abolish sizeof(FILE).
+ * ext/dl/dl.c (rb_io_to_ptr): abolish sizeof(FILE).
[ruby-dev:27317]
-Thu Sep 29 10:15:14 2005 Tanaka Akira <akr@m17n.org>
-
- * lib/open-uri.rb (:proxy_http_basic_authentication): new option.
-
Thu Sep 29 07:22:05 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * eval.c (rb_f_send): underscores need to be escaped.
+ * evalc. (rb_f_send): underscores need to be escaped.
fixed by Doug Kearns. [ruby-core:06053]
Thu Sep 29 00:57:35 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
@@ -48874,21 +9566,38 @@ Thu Sep 29 00:57:35 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
* variable.c (rb_autoload_load): now return true if autoload
succeeded. fixed: [ruby-dev:27331]
-Wed Sep 28 23:40:04 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Sep 28 23:42:15 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * file.c (apply2files): add prototype.
* file.c (rb_stat_inspect): constified.
-Wed Sep 28 15:12:28 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * class.c (rb_mod_init_copy, rb_class_init_copy), file.c (rb_stat_init_copy),
+ numeric.c (num_init_copy), object.c (rb_obj_init_copy, Init_Object),
+ re.c (match_init_copy, rb_reg_init_copy), time.c (time_init_copy):
+ undocumented.
+
+Wed Sep 28 23:09:23 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * lib/delegate.rb: document update from James Edward Gray II
+ <james@grayproductions.net>. [ruby-core:06027]
+
+Wed Sep 28 15:14:19 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
* lib/webrick/cgi.rb (WEBrick::CGI#start): req.query_string should
- refer to the value of QUERY_STRING. [ruby-list:41186]
+ refer the value of QUERY_STRING. [ruby-list:41186]
* lib/webrick/httprequest.rb (WEBrick::HTTPRequest#query_string=):
add new method.
Wed Sep 28 10:45:44 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
- * ext/tk/tcltklib.c: cannot compile with Tcl/Tk8.0.x [ruby-dev:27335].
+ * ext/tcltklib/tcltklib.c: cannot compile with Tcl/Tk8.0.x
+ [ruby-dev:27335].
+
+Wed Sep 28 08:12:18 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * io.c (read_buffered_data): check if reached EOF. fixed: [ruby-dev:27334]
Wed Sep 28 07:56:52 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
@@ -48899,7 +9608,7 @@ Wed Sep 28 07:56:52 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/yaml/types.rb (YAML::PrivateType, YAML::DomainType): ditto.
-Wed Sep 28 03:16:41 2005 NAKAMURA Usaku <usa@ruby-lang.org>
+Wed Sep 28 03:23:35 2005 NAKAMURA Usaku <usa@ruby-lang.org>
* rubysig.h: fixed build problem with --enable-pthread on platforms
which don't have setitimer().
@@ -48909,38 +9618,15 @@ Mon Sep 26 22:32:13 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
* eval.c (set_trace_func): add rb_secure(4) to prevent adding
tracing function.
-Mon Sep 26 20:59:28 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * parse.y: changed to ANSI function style.
-
-Sun Sep 25 12:02:04 2005 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+Sun Sep 25 12:05:10 2005 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
* bin/erb: typo fixed.
-Sun Sep 25 11:54:11 2005 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
-
- * lib/rinda/tuplespace.rb (Rinda::TemplateEntry::initialize): pull
- up method. Tabs converted to spaces.
-
-Sun Sep 25 09:34:22 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * parse.y: replaced `foo _((boo))' with `foo(boo)'.
-
-Sun Sep 25 08:19:53 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * test/rss/test_content.rb, test/rss/test_syndication.rb: use fcall
- instead of send in order to override visibility.
-
Sun Sep 25 01:46:43 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
* misc/ruby-mode.el (ruby-calculate-indent): arrange deep-indent
closing parenthesis at same column as the opening.
-Sun Sep 25 01:33:41 2005 Tanaka Akira <akr@m17n.org>
-
- * process.c (proc_setrlimit): make the third argument (rlim_max)
- optional.
-
Sun Sep 25 00:42:11 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
* misc/ruby-mode.el (ruby-expr-beg): deal with heredoc separately.
@@ -48950,37 +9636,20 @@ Sun Sep 25 00:42:11 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
level for continuous line inside parentheses.
http://nabeken.tdiary.net/20050915.html#p02
-Sat Sep 24 21:19:39 2005 Minero Aoki <aamine@loveruby.net>
-
- * ext/strscan/strscan.c: document enhancement.
-
- * ext/strscan/strscan.c: update copyright year.
+Sun Sep 25 00:18:11 2005 Tanaka Akira <akr@m17n.org>
- * ext/strscan/strscan.c: update coding style.
-
-Sat Sep 24 20:20:05 2005 Minero Aoki <aamine@loveruby.net>
-
- * test/net/http/test_http.rb (teardown): Net::HTTP.version_1_1 breaks
- many other tests; ensure that Net::HTTP is version 1.2 after test.
- [ruby-dev:27312]
-
-Sat Sep 24 11:44:28 2005 Minero Aoki <aamine@loveruby.net>
-
- * test/net/http/test_http.rb: new file.
+ * eval.c (unknown_node): show more information. [ruby-dev:26196]
-Sat Sep 24 08:54:05 2005 Minero Aoki <aamine@loveruby.net>
+Sat Sep 24 08:56:01 2005 Minero Aoki <aamine@loveruby.net>
* lib/fileutils.rb (cd): no longer accept :noop option, related
- code is useless. [ruby-core:05858] [ruby-Bugs:2494]
+ code is useless (backported from trunk, rev 1.67).
+ [ruby-core:05858] [ruby-Bugs:2494]
-Sat Sep 24 08:30:00 2005 Tanaka Akira <akr@m17n.org>
-
- * lib/pathname.rb (Pathname#sub): new method.
-
-Sat Sep 24 08:29:36 2005 Minero Aoki <aamine@loveruby.net>
+Sat Sep 24 08:38:07 2005 Minero Aoki <aamine@loveruby.net>
* lib/fileutils.rb: fix visibility of FileUtils::NoWrite, Verbose,
- DryRun. [ruby-core:05954]
+ DryRun (backported from trunk, rev 1.66). [ruby-core:05954]
* test/fileutils/test_nowrite.rb: test it.
@@ -48988,163 +9657,32 @@ Sat Sep 24 08:29:36 2005 Minero Aoki <aamine@loveruby.net>
* test/fileutils/test_verbose.rb: new file.
-Sat Sep 24 07:59:01 2005 Minero Aoki <aamine@loveruby.net>
-
- * sample/ripper/colorize.rb: removed (replaced by ruby2html.rb).
-
- * sample/ripper/ruby2html.rb: added.
-
-Sat Sep 24 06:35:15 2005 Minero Aoki <aamine@loveruby.net>
-
- * ext/ripper: no longer generates .rb files.
-
- * parse.y (Init_ripper): ripper_init_eventids*() takes 1 argument,
- self (class Ripper).
-
- * ext/ripper/depend: target removed: `lib/ripper/core.rb'.
-
- * ext/ripper/depend: new target `eventids2table.c'.
-
- * ext/ripper/depend: new target `check'.
-
- * ext/ripper/eventids2.c: include eventids2table.c.
-
- * ext/ripper/eventids2.c: initialize SCANNER_EVENT_TABLE.
-
- * ext/ripper/extconf.rb: update $cleanfiles list.
-
- * ext/ripper/tools/generate.rb: no longer generate ripper/core.rb.
-
- * ext/ripper/tools/generate.rb: new mode `check'.
-
- * ext/ripper/tools/generate.rb: new mode `eventids2table'.
-
- * ext/ripper/lib/ripper/core.rb.in: removed.
-
- * ext/ripper/lib/ripper/core.rb: added.
-
- * ext/ripper/lib/ripper/filter.rb: update copyright year.
-
- * ext/ripper/lib/ripper/lexer.rb: ditto.
-
- * ext/ripper/lib/ripper/sexp.rb: ditto.
-
Sat Sep 24 02:40:20 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
* lib/delegate.rb: document update from James Edward Gray II
<james@grayproductions.net>. [ruby-core:05942]
-Sat Sep 24 02:05:51 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * process.c (proc_daemon): should restrict execution on levels
- higher than $SAFE=2. suggested by URABE Shyouhei
- <shyouhei@ice.uec.ac.jp>.
-
-Fri Sep 23 20:10:35 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/ripper/tools/generate.rb, ext/ripper/tools/preproc.rb: StringIO
- is not available for miniruby. fixed: [ruby-dev:27307]
-
-Fri Sep 23 17:36:48 2005 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-
- * ext/win32ole/win32ole.c: avoid core dump with WIN32OLE_EVENT.
- [ruby-dev:27133]
-
-Fri Sep 23 16:27:39 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/forwardable.rb: replaced by new implementation from
- <Daniel.Berger@qwest.com>. [ruby-core:05899]
-
-Fri Sep 23 07:07:47 2005 Minero Aoki <aamine@loveruby.net>
-
- * test/ripper/depend: use --output option instead of redirect;
- nmake does not remove a target when the target file is created by
- redirect. [ruby-dev:26466]
-
- * test/ripper/tools/preproc.rb: new option --output.
-
-Fri Sep 23 06:57:52 2005 Minero Aoki <aamine@loveruby.net>
-
- * test/ripper/tools/generate.rb: check parser event arity.
-
- * test/ripper/tools/generate.rb: detect crash of parser-event-IDs
- and scanner-event-IDs.
-
-Fri Sep 23 06:01:30 2005 Minero Aoki <aamine@loveruby.net>
-
- * test/ruby/test_file.rb: check File#chown(nil,nil).
- [ruby-dev:27140]
-
-Fri Sep 23 05:57:23 2005 Minero Aoki <aamine@loveruby.net>
-
- * ext/ripper: refactoring code generation tools. [ruby-dev:27247]
- [ruby-dev:27273]
-
- * ext/ripper/depend: use generate.rb.
-
- * ext/ripper/lib/ripper/core.rb: removed.
-
- * ext/ripper/tools/generate-eventids1.rb: removed (code moved to
- generate.rb).
-
- * ext/ripper/tools/generate-ripper_rb.rb: removed (code moved to
- generate.rb).
-
- * ext/ripper/tools/list-parse-event-ids.rb: removed (code moved to
- generate.rb).
-
- * ext/ripper/tools/list-scan-event-ids.rb: removed (code moved to
- generate.rb).
-
- * ext/ripper/lib/ripper/core.rb: removed.
-
- * ext/ripper: refactoring tests. [ruby-dev:27273]
-
- * ext/ripper/test/check-event-arity.rb: removed (code moved to
- tools/generate.rb).
-
- * ext/ripper/test/check-event-coverage.rb: removed (code moved to
- test/ripper/test_parser_events.rb).
-
- * ext/ripper/test/check-scanner-event-coverage.rb: removed (code
- moved to test/ripper/test_scanner_events.rb).
-
- * ext/ripper/test/list-called-events.rb: removed.
-
- * ext/ripper/test/src_rb: removed.
-
- * ext/ripper/test/validate.rb: removed.
-
- * test/ripper/test_scanner_events.rb: check event coverage.
-
- * ext/ripper/lib/ripper/core.rb.in: update copyright year.
-
-Thu Sep 22 23:40:19 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Sep 22 23:36:24 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/mkmf.rb (find_executable0): default path if environment is not
set. [ruby-dev:27281]
- * ext/ripper/extconf.rb (have_command): replaced with find_executable.
-
-Thu Sep 22 17:31:48 2005 Shugo Maeda <shugo@ruby-lang.org>
+Thu Sep 22 16:33:12 2005 Shugo Maeda <shugo@ruby-lang.org>
* test/readline/test_readline.rb (TestReadline::replace_stdio):
merged the patch of [ruby-dev:25232] instead of [ruby-dev:25223].
- (merged from ruby_1_8 branch)
Wed Sep 21 23:30:44 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/mkmf.rb (configuration): generalized nmake dependent code.
-Wed Sep 21 14:16:30 2005 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * ext/ripper/depend (SUFFIXES): no longer needed.
+Wed Sep 21 09:07:55 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
- * ext/ripper/depend (c): avoid nmake problem. fixed [ruby-dev:27191]
+ * stable version 1.8.3 released.
Wed Sep 21 08:52:25 2005 why the lucky stiff <why@ruby-lang.org>
- * ext/syck/token.c: correctly compute indentation of a block
+ * ext/syck/token.c: correctly compute identation of a block
scalar's parent node. [ruby-talk:150620]
Wed Sep 21 08:20:24 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
@@ -49161,18 +9699,19 @@ Wed Sep 21 02:44:09 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
* file.c (path_check_0): disallow sticky world writable directory
in PATH (and $LOAD_PATH). [ruby-dev:27226]
-Wed Sep 21 00:32:22 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * file.c (fpath_check): typo fixed.
+
+Tue Sep 20 22:29:49 2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
- * numeric.c (fix_idiv): 1.div(1.0) should return integer value.
- [ruby-dev:27235]
+ * test/wsdl/simpletype/rpc/test_rpc.rb, test/wsdl/ref/test_ref.rb,
+ test/wsdl/any/test_any.rb test/soap/wsdlDriver/test_calc.rb:
+ suppress deliberate warnings with $VERBOSE = nil.
-Tue Sep 20 22:25:43 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Sep 20 21:26:23 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ext/io/wait/lib/nonblock.rb: disable on platforms non-blocking flag
is not available. fixed: [ruby-dev:27187]
- * file.c (rb_stat_inspect): protoized function pointer.
-
Tue Sep 20 18:23:04 2005 Tanaka Akira <akr@m17n.org>
* eval.c (thread_mark): mark th->last_status. [ruby-dev:27179]
@@ -49192,23 +9731,28 @@ Tue Sep 20 17:48:34 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
* lib/xmlrpc/server.rb (WEBrickServlet::service): ditto.
-Tue Sep 20 17:26:42 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Tue Sep 20 17:34:46 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* test/webrick/test_cgi.rb: set ENV["PATH"] to CGIEnvPath on
windows. bcc32's runtime is not installed into system directory,
so it cannot be found without this setting. [ruby-dev:27166]
-Tue Sep 20 17:14:10 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * io.c: PIPE_BUF is not defined on BeOS. use _POSIX_PIPE_BUF instead.
- [ruby-dev:27185]
-
Tue Sep 20 17:10:38 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
* test/dbm/test_dbm.rb (TestDBM::test_s_open_error): remove
test_s_open_error test to detect duplicate open.
[ruby-dev:27202]
+Tue Sep 20 17:08:31 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+
+ * io.c: PIPE_BUF is not defined on BeOS. use _POSIX_PIPE_BUF instead.
+ [ruby-dev:27185]
+
+Tue Sep 20 16:53:53 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * test/readline/test_readline.rb (TestReadline::replace_stdio):
+ BSD seek support from [ruby-dev:25223]. fixed: [ruby-dev:27150]
+
Tue Sep 20 15:39:40 2005 why the lucky stiff <why@ruby-lang.org>
* ext/syck/emitter.c (syck_scan_scalar): prevent indicators from
@@ -49225,57 +9769,49 @@ Tue Sep 20 15:39:40 2005 why the lucky stiff <why@ruby-lang.org>
* ext/syck/rubyext.c: loading of binary-typed nodes. prevent
emission of plain strings that look like symbols, but which aren't.
-Tue Sep 20 05:48:26 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Tue Sep 20 05:50:22 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* test/xmlrpc/test_webrick_server.rb (setup_http_server):
should not include 'webrick/https' unless 'use_ssl' because
it fails where openssl is not installed.
-Tue Sep 20 01:24:45 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (splat_value): use to_a to splat non Array object.
-
- * object.c (nil_to_a): remove nil.to_a. [experimental]
-
-Tue Sep 20 01:01:41 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/mathn.rb (Fixnum): remove debug print.
-
- * lib/rational.rb (Rational): ditto.
-
Tue Sep 20 00:34:07 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
* io.c (io_close): call rb_io_close() directly if io is a T_FILE
object. [ruby-dev:27156]
-Mon Sep 19 18:58:10 2005 Minero Aoki <aamine@loveruby.net>
+Mon Sep 19 19:09:08 2005 Minero Aoki <aamine@loveruby.net>
* file.c (rb_file_chown): should accept nil. [ruby-dev:27171]
+ (backport from trunk, rev 1.208)
-Mon Sep 19 18:29:54 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+Mon Sep 19 18:35:13 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
- * file.c (file_expand_path): allow pathnames to expand.
- [ruby-dev:27152]
+ * ext/dl/dl.c (rb_io_to_ptr): fix DragonFlyBSD support.
+ [ruby-dev:27151]
-Mon Sep 19 15:12:15 2005 Minero Aoki <aamine@loveruby.net>
+Mon Sep 19 14:17:04 2005 Minero Aoki <aamine@loveruby.net>
- * ext/ripper/depend: do not make ripper/core.rb. [ruby-dev:26462]
+ * ext/syck/emitter.c (syck_emit): passing an int* value to the
+ long* parameter causes unaligned access on LP64 systems.
+ [ruby-dev:27161]
-Mon Sep 19 14:49:19 2005 Minero Aoki <aamine@loveruby.net>
+Mon Sep 19 13:44:03 2005 Masaki Suketa <masaki.suketa@nifty.ne.jp>
- * ext/ripper/eventids2.c: add prefix `t' to tLAMBDA-related lexer
- events.
+ * ext/win32ole/win32ole.c: avoid core dump with WIN32OLE_EVENT.
+ [ruby-dev:27133]
- * ext/ripper/lib/ripper/core.rb: updated.
+Mon Sep 19 10:36:06 2005 Minero Aoki <aamine@loveruby.net>
-Mon Sep 19 14:39:46 2005 Minero Aoki <aamine@loveruby.net>
+ * lib/fileutils.rb (cp_r): default is :dereference_root=>true for
+ backward compatibility. [ruby-dev:27145]
- * parse.y (do_block): do_block event dispatches 2 args.
- [ruby-dev:26964]
+ * test/fileutils/test_fileutils.rb (test_cp_r): test it.
- * ext/ripper/lib/ripper/core.rb: updated.
+Mon Sep 19 09:57:39 2005 Minero Aoki <aamine@loveruby.net>
- * ext/ripper/tools/list-parser-event-ids.rb: check arity mismatch.
+ * test/fileutils/test_fileutils.rb: backported from trunk (1.36).
+ (again) [ruby-dev:27145]
Mon Sep 19 07:45:37 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
@@ -49287,23 +9823,43 @@ Mon Sep 19 07:45:37 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
* ext/openssl/ossl_engine.c: (ossl_engine_load_privkey): set private
key flag.
- * test/openssl/test_pkey_rsa.rb: add test about private detection.
+Mon Sep 19 06:41:32 2005 Minero Aoki <aamine@loveruby.net>
-Mon Sep 19 06:38:03 2005 Minero Aoki <aamine@loveruby.net>
+ * lib/fileutils.rb: backported from trunk (rev 1.65):
- * lib/fileutils.rb: method renaming: collect_methods ->
- collect_method.
+ * lib/fileutils.rb (rm_r): new option :secure.
-Mon Sep 19 05:58:59 2005 Minero Aoki <aamine@loveruby.net>
+ * lib/fileutils.rb (rm_rf): new option :secure.
- * lib/fileutils.rb: use module_function instead of single extend.
+ * lib/fileutils.rb: new method #remove_entry_secure.
- * test/fileutils/test_fileutils.rb: test existence of singleton
- methods.
+ * lib/fileutils.rb (cd): remove option :noop.
-Mon Sep 19 05:32:41 2005 Minero Aoki <aamine@loveruby.net>
+ * lib/fileutils.rb (cp_r): new option :dereference_root.
- * lib/fileutils.rb (remove_entry_secure): does not use chdir(2).
+ * lib/fileutils.rb (cp_r): new option :dereference_root.
+
+ * lib/fileutils.rb: new method #remove_entry.
+
+ * lib/fileutils.rb: new method #chmod_R.
+
+ * lib/fileutils.rb: new method #chown.
+
+ * lib/fileutils.rb: new method #chown_R.
+
+ * lib/fileutils.rb: new method .commands.
+
+ * lib/fileutils.rb: new method .options.
+
+ * lib/fileutils.rb: new method .have_option?.
+
+ * lib/fileutils.rb: new method .options_of.
+
+ * lib/fileutils.rb: new method .collect_method.
+
+ * lib/fileutils.rb: use module_function instead of single extend.
+
+ * test/fileutils/test_fileutils.rb: backported from trunk (1.36).
Mon Sep 19 03:17:48 2005 Tanaka Akira <akr@m17n.org>
@@ -49315,24 +9871,13 @@ Mon Sep 19 03:17:48 2005 Tanaka Akira <akr@m17n.org>
which is full. [ruby-dev:27132]
* io.c (rb_io_syswrite): wrap the write system call by
- TRAP_BEG/TRAP_END to run signal handler in syswrite method.
- [ruby-dev:27134]
-
-Mon Sep 19 01:07:38 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * numeric.c (Init_Numeric): should define Fixnum#div.
- [ruby-dev:27129]
-
- * file.c (rb_thread_flock): wrap flock(2) by TRAP_BEG and
- TRAP_END. [ruby-dev:27122]
+ TRAP_BEG/TRAP_END to enable signals when writing to a pipe which is
+ full. [ruby-dev:27134]
- * file.c (rb_file_join): call FilePathValue() to all Pathnames to
- join. [ruby-dev:27127]
+Mon Sep 19 03:02:08 2005 Tanaka Akira <akr@m17n.org>
- * file.c (rb_get_path): call StringValueCStr() to ensure no nul
- bytes in path strings.
-
- * gc.c (garbage_collect): need value for return. [ruby-dev:27127]
+ * io.c (io_fwrite): wrap the write system call by TRAP_BEG/TRAP_END to
+ enable signals when writing to a pipe which is full.
Sun Sep 18 02:10:47 2005 why the lucky stiff <why@ruby-lang.org>
@@ -49350,10 +9895,6 @@ Sun Sep 18 02:10:47 2005 why the lucky stiff <why@ruby-lang.org>
* test/yaml/test_yaml.rb: remove outdated tests.
-Sun Sep 18 01:10:37 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * gc.c (garbage_collect): return false if no GC run.
-
Sat Sep 17 23:25:04 2005 sheepman <sheepman@sheepman.sakura.ne.jp>
* lib/mathn.rb (Rational::inspect): should preserve original
@@ -49364,79 +9905,6 @@ Sat Sep 17 23:20:27 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
* lib/cgi.rb (CGI::Cookie): should handle multiple values for a
cookie name. [ruby-talk:156140]
- * test/socket/test_tcp.rb (TestTCPSocket::test_recvfrom): typo
- fixed. [ruby-dev:27123]
-
-Sat Sep 17 20:58:56 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * win32/win32.c (rb_w32_select): fixed deadlock bug.
- because select(2) modifies its fd_set arguments, it must be
- restored sometimes.
-
- * win32/win32.c (rb_w32_select): performance improvement when
- 'always readable/writable handles' and sockets are passed.
- sockets should be polled every time.
-
- require "net/http"
-
- Thread.new {
- loop do
- STDOUT.write(".") # busy on console (this is worst case though)
- end
- }
-
- # socket operation took long time. (sometimes timed out)
- Net::HTTP.start("www.ruby-lang.org") do |http|
- http.get("/cgi-bin/cvsweb.cgi/ruby/array.c?rev=1.179")
- end
-
-Sat Sep 17 14:54:40 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * test/ruby/test_readpartial.rb (test_open_pipe, test_with_stdio):
- these tests are working now, so turned on. (windows)
-
-Sat Sep 17 14:18:15 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * win32/win32.c (rb_w32_select): I hope performance problem was
- solved.
-
-Sat Sep 17 13:45:22 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * win32/win32.c (rb_w32_select): console support is back.
- but still has performance problem because I loosely took 1 second
- for wait time. I'll fix it later. (The reason I drastically changed
- the code is that I wanted to implement the fileset management as
- single function, and I was worried that if pipe or console
- was always available, socket may not be processed any time)
-
-Sat Sep 17 11:24:16 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * win32/win32.c (rb_w32_select): select for socket didn't work.
- this caused deadlock in drb test. this happened because GetFileType
- for socket handle returns FILE_TYPE_PIPE. Of course, it's not a
- pipe. So socket handle didn't reach winsock's select function.
-
- * win32/win32.c (rb_w32_select): read for pipe was still blocked
- even if writer handle was closed.
-
- r,w = IO.pipe
-
- Thread.new {
- sleep 3; puts "------- 1"
- w.puts("foo")
- sleep 3; puts "------- 2"
- w.puts("boo")
- sleep 3; puts "------- 3"
- w.close
- }
-
- until r.eof? # should break by w.close but didn't.
- puts r.gets
- end
-
- * win32/win32.c (rb_w32_select): temporary reverted console support
- but it'll be back soon.
-
Sat Sep 17 10:42:13 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tk/lib/multi-tk.rb: MultiTkIp#eval_string and bg_eval_string
@@ -49460,14 +9928,14 @@ Sat Sep 17 08:35:39 2005 Kouhei Sutou <kou@cozmixng.org>
* test/rss/test_maker_1.0.rb (RSS::TestMaker10#test_items): ditto.
-Sat Sep 17 08:02:53 2005 Shugo Maeda <shugo@ruby-lang.org>
+Fri Sep 16 23:09:20 2005 Masaki Suketa <masaki.suketa@nifty.ne.jp>
- * lib/net/imap.rb: supported DIGEST-MD5. Thanks, Mathieu Arnold.
+ * ext/win32ole/win32ole.c (ole_search_event_at): bug fix
+ in ext/win32ole/sample/ienavi.rb.
- * lib/net/imap.rb: use fcall instead of send. Thanks, Satoru
- Takabayashi.
+ * ext/win32ole/win32ole/tests/testOLEEVENT.rb: ditto.
-Fri Sep 16 22:45:49 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Sep 16 22:41:18 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
* file.c (rb_file_s_extname): empty string for path name ending with a
period. fixed: [ruby-core:05651]
@@ -49475,19 +9943,6 @@ Fri Sep 16 22:45:49 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
* file.c (rb_file_join): smarter behavior at edge cases.
fixed: [ruby-core:05706]
- * gc.c (rb_memerror, ruby_xmalloc, ruby_xrealloc, rb_newobj): just
- abandon if no memory available, when interpreter is not running.
- [ruby-dev:27104]
-
- * gc.c (garbage_collect): return whether GC could run.
-
- * dir.c (rb_push_glob): fix delimiter bug. fixed: [ruby-dev:27105]
-
- * dir.c (dir_s_aref, dir_s_glob): allow multiple patterns.
- [ruby-dev:27110]
-
- * win32/win32.c (cmdglob): enable brace expansion.
-
Fri Sep 16 18:34:01 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
* ext/syck/node.c (syck_replace_str): was using return from the
@@ -49503,12 +9958,12 @@ Fri Sep 16 12:02:12 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
* ext/syck/rubyext.c (syck_resolver_transfer): remove C++ style
comment (//). [ruby-core:05793]
-Fri Sep 16 00:17:03 2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+Fri Sep 16 00:14:14 2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
* test/logger/test_logger.rb: unintentionally overwritten changes by
Usa. reverted.
-Fri Sep 16 00:03:11 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Fri Sep 16 00:06:18 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
* lib/webrick/cgi.rb (WEBrick::CGI::Socket#initialize): should set
$stdout.binmode.
@@ -49522,17 +9977,17 @@ Thu Sep 15 23:25:21 2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
* SOAP
* allow to configure an envelope namespace of SOAP request. (#124)
- TemporaryNamespace = 'http://www.w3.org/2003/05/soap-envelope'
- @client.options["soap.envelope.requestnamespace"] =
+ TemporaryNamespace = 'http://www.w3.org/2003/05/soap-envelope'
+ @client.options["soap.envelope.requestnamespace"] =
TemporaryNamespace
- @client.options["soap.envelope.responsenamespace"] =
+ @client.options["soap.envelope.responsenamespace"] =
TemporaryNamespace
@client.do_proc(...)
- * let SOAP request XML indent space configurable. see
+ * let SOAP request XML indent space configuable. see
"soap.envelope.no_indent" option. (#130)
- * let external CES configurable.
+ * let external CES configuable.
ex. client["soap.mapping.external_ces"] = 'SJIS'. $KCODE is used
by default. (#133)
external CES ::= CES used in Ruby object of client and server
@@ -49541,7 +9996,7 @@ Thu Sep 15 23:25:21 2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
* add iso-8859-1 external CES support. (#106)
* fixed illegal 'qualified' handling of elements. it caused
- ASP.NET interoperability problem. (#144)
+ ASP.NET inteoperability problem. (#144)
* added 'soap.envelope.use_numeric_character_reference' (boolean)
option to let query XML use numeric character reference in XML,
@@ -49573,7 +10028,7 @@ Thu Sep 15 23:25:21 2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
* Array of an element which has simpleType causes a crash. (#128)
- * parameterOrder may not contain return part so it can be shorter
+ * prarmeterOrder may not contain return part so it can be shorter
than parts size. Thanks to Hugh. (#139)
* Samples
@@ -49597,62 +10052,45 @@ Thu Sep 15 23:25:21 2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
* updated deprecated method usage. (#138)
-Thu Sep 15 22:40:27 2005 NAKAMURA Usaku <usa@ruby-lang.org>
+Thu Sep 15 23:02:57 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
- * test/ruby/test_signal.rb (test_exit_action): skip the test using
- fork on fork-less platforms.
+ * win32/win32.h (rb_w32_stat): added prototype.
-Thu Sep 15 13:54:33 2005 Tanaka Akira <akr@m17n.org>
+Thu Sep 15 22:35:55 2005 NAKAMURA Usaku <usa@ruby-lang.org>
- * lib/open-uri.rb: add :read_timeout option.
- [ruby-core:4848]
+ * test/ruby/test_signal.rb (test_exit_action): skip the test using
+ fork on fork-less platforms.
Thu Sep 15 11:39:18 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tk/lib/tk/dialog.rb: If a dialog does not show up yet,
TkDialogObj#name raises an exception. [ruby-talk:156109]
-Thu Sep 15 11:01:58 2005 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/win32.c (rb_w32_pipe_exec): remove unnecessary CloseHandle().
+Thu Sep 15 01:39:19 2005 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
- * win32/win32.c (extract_console_fd, peek_console): new functions.
-
- * win32/win32.c (rb_w32_select): check consoles by polling them.
+ * lib/rinda/tuplespace.rb (Rinda::TemplateEntry::initialize): pull
+ up method. Tabs converted to spaces.
Thu Sep 15 00:18:24 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
* lib/net/telnet.rb (Net::Telnet::waitfor): replace sysread with
readpartial. [ruby-talk:127641]
-Wed Sep 14 23:28:28 2005 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/win32.c (collect_file_fd): rename from extract_file_fd.
-
- * win32/win32.c (extract_pipe_fd, peek_pipe): new functions.
-
- * win32/win32.c (rb_w32_select): check pipes by polling them.
-
Wed Sep 14 22:40:26 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
* dir.c (ruby_glob): glob function not using ruby exception system.
-Wed Sep 14 17:24:22 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * dir.c: changed `foo (*bar)_((boo))' to `foo (*bar)(boo)`.
+Wed Sep 14 01:26:03 2005 Minero Aoki <aamine@loveruby.net>
- * enumerator.c, eval.c, gc.c, intern.h, io.c, process.c, ruby.c,
- ruby.h, signal.c: ditto.
+ * lib/net/https.rb: backported from trunk, rev 1.3.
+ [ruby-dev:25673] (again), [ruby-dev:26617] (again),
+ [ruby-dev:27062]
-Wed Sep 14 15:06:22 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+ * ext/openssl/lib/net/https.rb: removed.
- * bignum.c: changed `foo _((boo))' to `foo(boo)`. [ruby-dev:27056]
+ * ext/openssl/lib/net/protocols.rb: removed.
- * defines.h, dir.c, dln.h, enumerator.c, env.h, error.c, eval.c, file.c,
- gc.c, hash.c, inits.c, intern.h, io.c, lex.c, marshal.c, missing.h,
- node.h, numeric.c, pack.c, process.c, re.h, ruby.c, ruby.h, rubyio.h,
- rubysig.h, signal.c, sprintf.c, st.h, string.c, struct.c, time.c,
- util.c, util.h, variable.c: ditto.
+ * lib/net/http.rb: #use_ssl?, #use_ssl are moved from net/https.
Tue Sep 13 22:09:40 2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
@@ -49673,20 +10111,19 @@ Tue Sep 13 21:47:17 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
* eval.c (BEGIN_CALLARGS): pop halfly pushed status.
fixed: [ruby-dev:26881]
-Tue Sep 13 20:24:37 2005 Tanaka Akira <akr@m17n.org>
+Tue Sep 13 16:26:45 2005 Minero Aoki <aamine@loveruby.net>
- * ruby.h (PRINTF_ARGS): new macro for printf style argument checking.
+ * lib/net/http.rb: backported from trunk, rev 1.128.
+ [ruby-dev:25673] [ruby-dev:26617]
-Tue Sep 13 15:41:29 2005 Minero Aoki <aamine@loveruby.net>
+ * lib/net/protocol.rb: backported from trunk, rev 1.78.
- * lib/net/http.rb: wrote documentation of HTTPRequest/HTTPResponse
- classes.
+ * lib/net/protocol.rb: new method #old_open to support net/smtp
+ and net/pop.
-Tue Sep 13 14:27:47 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+ * lib/net/smtp.rb: use #old_open.
- * string.c, missing.h: failed to build on powerpc-apple-darwin7.9.0
- because of crypt argument's constness mismatch. (I hope this works)
- (http://mput.dip.jp/autobuild/ruby-trunk/log/20050913T110001.gz)
+ * lib/net/pop.rb: ditto.
Tue Sep 13 12:33:05 2005 why the lucky stiff <why@ruby-lang.org>
@@ -49702,12 +10139,12 @@ Tue Sep 13 12:33:05 2005 why the lucky stiff <why@ruby-lang.org>
continue support of Object#to_yaml_type.
* ext/syck/rubyext.c: new emitter code. yaml_new and yaml_initialize
- get called, should they be present. consolidated all the diaspora of internal node types into the family below YAML::Syck::Node -- Map,
+ get called, should they be present. consolidated all the diaspora of internal
+ node types into the family below YAML::Syck::Node -- Map,
Seq, Scalar -- all of whom are SyckNode structs pointing to
- Ruby data. moved Object#yaml_new into the node_import and made it
- the default behavior. the target_class is always called with
- yaml_new, prepended a parameter, which is the klass. loaded nodes
- through GenericResolver show their style.
+ Ruby data. moved Object#yaml_new into the node_import and made it the
+ default behavior. the target_class is always called wih yaml_new, prepended
+ a parameter, which is the klass. loaded nodes through GenericResolver show their style.
new Resolver#tagurize converts type ids to taguris.
* ext/syck/implicit.re: were 'y' and 'n' seriously omitted??
@@ -49726,112 +10163,36 @@ Tue Sep 13 12:33:05 2005 why the lucky stiff <why@ruby-lang.org>
* ext/syck/syck.h: reflect block_styles and new node functions.
-Tue Sep 13 08:09:18 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/ostruct.rb (new_ostruct_member): Object#send no longer call
- private methods. [ruby-dev:27044]
-
- * test/rss/test_dublincore.rb, test/rss/test_trackback.rb,
- test/ruby/test_eval.rb, test/socket/test_socket.rb: ditto.
-
- * test/ruby/test_lambda (test_call_with_block): lambda makes new scope
- for formal block parameter.
-
-Tue Sep 13 01:17:45 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (proc_save_safe_level): no need to restrict safe level
- memoize in $SAFE>=3. [ruby-dev:27050]
-
-Tue Sep 13 00:02:33 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * file.c (apply2files): stricter callback definition.
-
- * file.c (rb_path_check): constified.
-
Mon Sep 12 20:53:06 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
* test/openssl/test_pkcs7.rb (test_enveloped): skip this test
- to avoid a bug of PKCS7_encrypt() (only if ext/openssl is
+ to avoid a bug of PKCS7_enctypt() (only if ext/openssl is
compiled with OpenSSL-0.9.7d or earlier versions).
http://www.mail-archive.com/openssl-dev@openssl.org/msg17376.html
-Mon Sep 12 20:32:00 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * win32/win32.[hc] (rb_w32_argv_size, ...): reverted my latest change
- to avoid incompatible pointer warning. (mingw32)
-
-Mon Sep 12 19:58:53 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * dln.c: avoid warning of const to non-const convertion.
- [ruby-dev:27041]
-
- * eval.c, io.c, ruby.c: ditto.
-
-Mon Sep 12 19:26:29 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * array.c: moved to ANSI function style from K&R function style.
- (used protoize on windows, so still K&R remains on #ifdef part of
- other platforms. And `foo _((boo))' stuff is still there)
- [ruby-dev:26975]
-
- * bignum.c, class.c, compar.c, dir.c, dln.c, dmyext.c, enum.c,
- enumerator.c, error.c, eval.c, file.c, gc.c, hash.c, inits.c,
- io.c, main.c, marshal.c, math.c, numeric.c, object.c, pack.c,
- prec.c, process.c, random.c, range.c, re.c, regcomp.c, regenc.c,
- regerror.c, regexec.c, regparse.c, regparse.h, ruby.c, signal.c,
- sprintf.c, st.c, string.c, struct.c, time.c, util.h, variable.c,
- version.c: ditto.
-
Mon Sep 12 14:03:33 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
* test/dbm/test_dbm.rb: remove locking test, which may not be
supported on some platforms. [ruby-dev:27030]
-Sun Sep 11 23:23:02 2005 Shugo Maeda <shugo@ruby-lang.org>
+Mon Sep 12 10:45:58 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
- * lib/net/imap.rb (starttls): supported the STARTTLS command.
+ * ext/dl/dl.c (rb_io_to_ptr): merged a patch for DragonFly BSD
+ from Takahiro Kambe <taca at back-street.net>. [ruby-dev:27023]
-Sun Sep 11 22:18:07 2005 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+Sun Sep 11 22:05:51 2005 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
* bin/erb (ERB::Main#run): set ERB#filename so that it is used
when reporting syntax/runtime errors. Tabs converted to spaces.
-Sat Sep 10 22:34:19 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * array.c, bignum.c: protoize.
-
-Sat Sep 10 00:23:01 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (splat_value): simpler and consistent array conversion
- for argument splat. [yarv-dev:599]
-
-Fri Sep 9 16:45:25 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * string.c (rb_str_times): make empty strings to keep taintness,
- and a little improvement. [ruby-dev:26900]
-
- * ext/iconv/iconv.c (iconv_try), ext/iconv/extconf.rb: get rid of meta
- characters in command line option. fixed: [ruby-talk:155369]
-
- * ext/iconv/iconv.c: protoized.
-
-Thu Sep 8 14:58:11 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * merged a patch from Takahiro Kambe <taca at back-street.net> to
- support DragonFly BSD. [ruby-dev:26984]
-
-Thu Sep 8 13:14:57 2005 Tadashi Saito <shiba@mail2.accsnet.ne.jp>
-
- * missing/strchr.c (strrchr): fixed a bug in detecting NUL in a
- string. [ruby-dev:26985]
-
-Wed Sep 7 17:29:27 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Sat Sep 10 10:17:03 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
* ext/openssl/ossl_engine.c (ossl_engine_s_by_id):
OpenSSL::Engine.by_id calls given block before calling
ENGINE_init (block parameter is the return value of this method
itself). this functionality is useful to load dynamic shared
- engines.
+ engines. the following code is a sample of loading a key using
+ OpenSC PKCS #11 module.
require "openssl"
pkcs11 = OpenSSL::Engine.by_id("dynamic"){|e|
@@ -49846,9 +10207,9 @@ Wed Sep 7 17:29:27 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
OpenSSL::Engine#ctrl_cmd. it wraps ENGINE_ctrl_cmd_string.
* ext/openssl/ossl_engine.c (ossl_engine_get_cmds): new method
- OpenSSL::Engine#cmds. it returns engine command definitions.
+ OpenSSL::Engine#cmds. it returms engine command definitions.
-Wed Sep 7 15:48:37 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Sat Sep 10 10:09:47 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
* ext/openssl/ossl_asn1.c (asn1str_to_str): new function.
@@ -49861,6 +10222,64 @@ Wed Sep 7 15:48:37 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
* test/openssl/test_pkcs7.rb: new file.
+Sat Sep 10 10:05:51 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
+
+ * ext/openssl/ossl_ns_spki.c (ossl_spki_initialize): assume that
+ the argument is a DER string if Base64 decoding failed.
+
+ * ext/openssl/ossl_ns_pki.c (ossl_spki_to_der): new method.
+
+ * test/openssl/test_ns_spki.rb: add new file.
+
+Sat Sep 10 09:56:24 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
+
+ * ext/openssl/lib/digest.rb: added SHA224, SHA256, SHA384 and SHA512.
+ these features are enabled if this library is compiled with
+ OpenSSL 0.9.8 or later.
+
+ * test/openssl/test_digest.rb: add test for new digests.
+
+Sat Sep 10 09:51:30 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
+
+ * ext/openssl/ossl.c (ossl_raise): should use ERR_peek_last_error
+ to get last error on the current thread. And should report
+ errors on the stack while OpenSSL.debug is true.
+
+ * ext/openssl/ossl.c (ossl_get_errors): new method for debugging
+ this library.
+
+ * ext/openssl/ossl_ssl.c (ossl_sslctx_set_ciphers): fix error message.
+
+ * ext/openssl/ossl_x509req.c (ossl_x509req_set_attributes): get rid
+ of unused variable.
+
+ * ext/openssl/ossl_x509store.c (ossl_x509store_initialize): should
+ set @time to avoid warning.
+
+ * ext/openssl/ossl_x509store.c (ossl_x509store_set_default_paths,
+ X509_STORE_add_cert, X509_STORE_add_crl): should raise error if
+ wrapped functions failed.
+
+ * test/openssl/test_x509store.rb: add test for errors.
+
+Fri Sep 9 22:13:19 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * eval.c (rb_call0): prohibit calling tainted method (>2) when
+ $SAFE == 0.
+
+Fri Sep 9 16:45:25 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * string.c (rb_str_times): make empty strings to keep taintness,
+ and a little improvement. [ruby-dev:26900]
+
+ * ext/iconv/iconv.c (iconv_try), ext/iconv/extconf.rb: get rid of meta
+ characters in command line option. fixed: [ruby-talk:155369]
+
+Thu Sep 8 14:58:11 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * merged a patch from Takahiro Kambe <taca at back-street.net> to
+ support DragonFly BSD. [ruby-dev:26984]
+
Wed Sep 7 12:55:08 2005 Tanaka Akira <akr@m17n.org>
* lib/open-uri.rb: abolish mod === tempfile to avoid a problem
@@ -49874,15 +10293,6 @@ Wed Sep 7 10:45:15 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
* eval.c (rb_thread_terminated): show backtrace before propagate
exceptions to main thread.
-Wed Sep 7 09:21:41 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * win32/win32.[hc] (rb_w32_utime): constified.
-
- * win32/win32.h (rb_w32_stat): added prototype.
-
- * win32/win32.[hc] (rb_w32_argv_size,rb_w32_join_argv,rb_w32_aspawn):
- changed `char *const *' to `const char *const *'. (constify string)
-
Wed Sep 7 08:35:04 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
* Makefile.in, configure.in (MINIOBJS): miniruby on HP-UX can not load
@@ -49901,62 +10311,37 @@ Wed Sep 7 08:35:04 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ext/etc/etc.c (setup_passwd), ext/etc/extconf.rb: pw_age might be
char*. fixed: [ruby-core:05470]
-Wed Sep 7 08:32:07 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * string.c (rb_str_times): should taint empty strings as well.
+Wed Sep 7 08:32:47 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
- * object.c (Init_Object): make class_variable_{get,set} public.
- [ruby-dev:26965]
+ * object.c (rb_mod_cvar_get, rb_mod_cvar_set): document fix from
+ sheepman <sheepman@sheepman.sakura.ne.jp>; a bug in visibility
+ description. [ruby-dev:26965]
-Mon Sep 5 22:28:46 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (stmt, mlhs_node, lhs, arg, method_call): aref_args might be
- nothing. fixed: [ruby-dev:26952]
-
- * ext/ripper/eventids2.c: added new tokens. fixed: [ruby-dev:26952]
+ * sprintf.c (rb_f_sprintf): warn "too many argument" on verbose
+ mode (-v/-w); backported from 1.9. [ruby-dev:26963]
Mon Sep 5 17:03:07 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
- * lib/find.rb: should raise ENOENT if root entry does not exist.
- [ruby-list:41054]
-
* lib/ostruct.rb: a patch from Florian Gross <florgro at gmail.com>
merged to allow recursive inspect (and to_s) for OpenStruct.
[ruby-core:05532]
-Mon Sep 5 08:20:19 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/observer.rb: a patch from nornagon <nornagon at gmail.com>
- merged to allow arbitrary names for update methods.
- [ruby-core:05416]
-
Mon Sep 5 07:01:12 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
* ext/openssl/openssl/lib/openssl/buffering.rb (Buffering#do_write):
should clear data from the buffer which already been output.
-Sun Sep 4 15:01:35 2005 Minero Aoki <aamine@loveruby.net>
-
- * parse.y (f_arg): Ripper should not do semantic check.
- [ruby-dev:26948]
-
-Sat Sep 3 23:52:35 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (rb_f_fcall): new method to avoid inefficiency of
- obj.instance_eval{send(...)} tricks.
-
-Sat Sep 3 13:59:31 2005 Tanaka Akira <akr@m17n.org>
+Fri Sep 2 23:51:54 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/pathname.rb (Pathname#descend): Pathname.new("./a/b/c").descend
- didn't yield "."
- (Pathname#ascend): ditto.
+ * lib: do not use __send__ to access private methods. [ruby-dev:26935]
-Fri Sep 2 23:51:54 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Sep 2 03:29:00 2005 Keiju Ishitsuka <keiju@ruby-lang.org>
- * parse.y (f_arg): f_norm_arg is a VALUE in ripper, not an ID.
- fixed: [ruby-dev:26942]
+ * lib/irb/init.rb: make IRB -I option that is same befavior for ruby.
+ [ruby-dev:26872], [ruby-dev: 26920]
- * lib: do not use __send__ to access private methods. [ruby-dev:26935]
+ * lib/irb/locale.rb: support to print help message when OS locale is
+ ja_JP.utf-8. [ruby-dev:26872]
Thu Sep 1 17:11:25 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
@@ -49971,31 +10356,20 @@ Thu Sep 1 14:12:45 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
to support '-namespace' option of 'interp invokehidden' command
on Tcl8.5.
-Wed Aug 31 14:41:30 2005 NAKAMURA Usaku <usa@ruby-lang.org>
+Wed Aug 31 14:43:15 2005 NAKAMURA Usaku <usa@ruby-lang.org>
* win32/Makefile.sub (OPTFLAGS): default global optimization to
disabled for all VC++ versions. fixed: [ruby-dev:26897]
-Wed Aug 31 10:36:09 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Wed Aug 31 11:35:43 2005 NAKAMURA Usaku <usa@ruby-lang.org>
- * process.c (proc_detach, proc_setmaxgroups): missing argument type
- declaration. (I recommend ANSI-style function)
-
-Wed Aug 31 06:59:01 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * string.c (rb_str_scan): already String#scan behaves differently
- regarding if block is given.
-
-Tue Aug 30 23:49:34 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * array.c, dir.c, enum.c, hash.c, io.c, range.c, string.c, struct.c:
- let enumerable methods return Enumerator. [ruby-dev:26924]
-
- * intern.h (RETURN_ENUMERATOR): utility macro for enumerable methods.
+ * test/gdbm/test_gdbm.rb (teardown): should remove GDBM temporary
+ file.
-Tue Aug 30 23:25:45 2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+Wed Aug 31 10:30:56 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
- * lib/debug.rb: no need to restart at exit.
+ * process.c (proc_detach, proc_setmaxgroups): missing argument type
+ declaration. (I recommend ANSI-style function)
Tue Aug 30 23:20:19 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
@@ -50014,127 +10388,45 @@ Tue Aug 30 19:34:27 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
ext/digest/sha1/sha1ossl.h: include <stddef.h> to avoid
error in compilation with OpenSSL-0.9.8. [ruby-list:41068]
-Tue Aug 30 16:19:40 2005 Keiju Ishitsuka <keiju@ruby-lang.org>
-
- * lib/irb/init.rb: bug fix. [ruby-dev: 26920]
-
-Tue Aug 30 16:13:00 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * enum.c (enum_count): new method. [ruby-dev:26895]
-
-Tue Aug 30 12:45:15 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (rb_f_send): do not call private methods if the receiver
- is specified. [ruby-talk:153672]
-
-Mon Aug 29 19:47:18 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Mon Aug 29 19:54:21 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* lib/rdoc/usage.rb: improper exceptions. [ruby-dev:26870]
* lib/rdoc/usage.rb: support the case when non-ruby code exists before
shebang. (this is needed when ri.bat is executed on windows)
-Mon Aug 29 18:58:05 2005 Keiju Ishitsuka <keiju@ruby-lang.org>
-
- * lib/irb/init.rb: make IRB -I option that is same behavior for ruby.
- [ruby-dev:26872]
-
- * lib/irb/locale.rb: support to print help message when OS locale is
- ja_JP.utf-8. [ruby-dev:26872]
-
-Mon Aug 29 01:43:05 2005 Tanaka Akira <akr@m17n.org>
+Mon Aug 29 17:48:17 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
- * lib/pathname.rb (Pathname#descend): new method.
- (Pathname#ascend): ditto.
+ * eval.c (method_arity): should return proper arity value.
+ [ruby-dev:26390]
-Mon Aug 29 00:35:09 2005 Tanaka Akira <akr@m17n.org>
+Mon Aug 29 01:19:57 2005 Tanaka Akira <akr@m17n.org>
- * lib/time.rb: require 'date/format' instead of 'parsedate'.
- (Time.parse): extract fractional seconds using Date._parse.
- (Time.strptime): extract fractional seconds using Date._strptime.
- [ruby-talk:153859]
+ * lib/time.rb (Time.parse): extract fractional seconds using
+ Date._parse. [ruby-talk:153859]
-Sat Aug 27 20:13:31 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Sat Aug 27 20:20:01 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* ext/curses/curses.c ({curses,window}_clrtoeol): added. suggested
by Reyn Vlietstra.
- * ext/curses/curses.c: chtype in curses is not `char', rather `long'.
+ * ext/curses/curses.c: chtype in curses is not `char', rahter `long'.
[ruby-Bugs:2298]
* ext/curses/view.rb: String =~ String is deprecated.
-Thu Aug 25 15:48:58 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * ext/win32ole/win32ole.c: suppress warnings. (win32)
-
-Wed Aug 24 11:01:26 2005 NAKAMURA Usaku <usa@ruby-lang.org>
+Wed Aug 24 10:53:28 2005 NAKAMURA Usaku <usa@ruby-lang.org>
* test/logger/test_logger.rb (test_shifting_size): should close log
device before unlink, since some platform cannot unlink opened
file.
-Tue Aug 23 06:07:02 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * ext/openssl/lib/digest.rb: added SHA224, SHA256, SHA384 and SHA512.
- these features are enabled if this library is compiled with
- OpenSSL 0.9.8 or later.
-
- * test/openssl/test_digest.rb: add test for new digests.
-
-Tue Aug 23 05:47:04 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * ext/openssl/ossl_ns_spki.c (ossl_spki_initialize): try to decode
- the argument as a string.
-
- * ext/openssl/ossl_ns_pki.c (ossl_spki_to_der): new method.
-
- * ext/openssl/ossl_x509store.c (ossl_x509store_initialize): should
- set @time to avoid warning.
-
- * ext/openssl/ossl_x509store.c (ossl_x509store_set_default_paths,
- X509_STORE_add_cert, X509_STORE_add_crl): should raise error if
- wrapped functions fails.
-
- * ext/openssl/ossl_ssl.c (ossl_sslctx_set_ciphers): fix error message.
-
- * ext/openssl/ossl_x509req.c (ossl_x509req_set_attributes): get rid
- of unused variable.
-
- * test/openssl/test_ns_spki.rb: add new file.
-
- * test/openssl/test_x509store.rb: add test for error.
-
-Tue Aug 23 01:11:40 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * sprintf.c (ruby__sfvwrite): should move `buf' to the end of
- `result'. [ruby-dev:26859]
-
-Mon Aug 22 23:51:19 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * parse.y: ONIG_OPTION_CAPTURE_GROUP conflicts with
- RE_OPTION_ONCE. [ruby-dev:26852]
-
-Mon Aug 22 20:11:35 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * missing/vsnprintf.c (BSD__sprint): needs to call vwrite function
- pointer. fixed: [ruby-dev:26854]
-
-Sat Aug 20 23:55:25 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * parse.y (parser_yylex): update paren_nest for brackets [].
-
-Sun Aug 21 00:10:23 2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+Sun Aug 21 00:13:27 2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
* lib/wsdl/xmlSchema/importer.rb (WSDL::XMLSchema::Importer#fetch): add
a workaround for importing an WSDL whose path begins with drive
letter. [ruby-dev:26242]
-Sat Aug 20 22:05:25 2005 K.Kosako <sndgk393 AT ybb.ne.jp>
-
- * regexec.c (code_is_in_cclass_node): check code size.
- [ruby-dev:26840]
-
Sat Aug 20 22:37:13 2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
* lib/logger.rb (write, shift_log?, shift_log): file shifting race
@@ -50147,25 +10439,23 @@ Fri Aug 19 18:13:39 2005 Tanaka Akira <akr@m17n.org>
* lib/time.rb (Time.apply_offset): fix a problem with last day of
month. reported by Lucas Nussbaum. [ruby-talk:152866]
-Thu Aug 18 11:05:36 2005 NAKAMURA Usaku <usa@ruby-lang.org>
+Thu Aug 18 12:46:28 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
- * win32/win32.c (socketpair_internal): need to call open_ifs_socket()
- to create sockets instead of winsock's socket().
- fixed: [yarv-dev:581]
+ * bcc32/Makefile.sub (COMMON_HEADERS): reverted 1.42.2.24.
+ I misunderstood, bccwin32 on ruby_1_8 uses winsock2 originally.
+ [ruby-dev:26806]
+
+ * win32/win32.h: include winsock2.h instead of winsock.h. (bcc32)
Wed Aug 17 23:58:05 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * object.c (rb_to_integer): argument constified.
+
* eval.c (terminate_process): take String message.
* eval.c (rb_thread_switch): propagate the exception caused thread
termination directly. fixed: [ruby-core:05552]
-Wed Aug 17 21:20:05 2005 NARUSE, Yui <naruse@ruby-lang.org>
-
- * ext/nkf/lib/kconv.rb: ensure that symbol_to_option is private_class_method
- and all other methods are module_function
- fixed: [ruby-dev:26808]
-
Wed Aug 17 00:05:46 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
* eval.c (rb_add_method): preserve safe level in the environment
@@ -50174,19 +10464,6 @@ Wed Aug 17 00:05:46 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
* eval.c (rb_call0): restore preserved safe level in the method
execution.
- * parse.y (lambda): need separate block variable stack
- manipulation and lpar_beg maintenance. based on a patch found
- in [ruby-core:05551] from Mauricio Fernandez <mfp at acm.org>.
-
- * parse.y (parser_yylex): adjust lpar_beg after tLAMBEG and
- kDO_LAMBDA. [ruby-core:05551]
-
-Mon Aug 15 07:24:38 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * intern.h (rb_check_to_integer): add declaration.
-
- * object.c (rb_to_integer, rb_check_to_integer): argument constified.
-
Mon Aug 15 00:38:51 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
* eval.c (rb_rescue2): reduce PUSH_TAG() as well as NODE_RESCUE.
@@ -50194,27 +10471,6 @@ Mon Aug 15 00:38:51 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
* range.c (range_check, range_init): reduce useless exceptions.
-Mon Aug 15 00:34:11 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * parse.y (yycompile): remove unreachable code. [yarv-dev:570]
-
-Sat Aug 13 22:16:12 2005 Minero Aoki <aamine@loveruby.net>
-
- * lib/fileutils.rb (remove_entry_secure): forgot final chdir.
-
-Sat Aug 13 22:07:49 2005 Minero Aoki <aamine@loveruby.net>
-
- * lib/fileutils.rb (remove_entry_secure): uses chdir(2) and check
- if current directory is correct. [ruby-dev:26100] [ruby-dev:26226]
-
-Sat Aug 13 21:11:05 2005 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-
- * ext/win32ole/win32ole.c: add WIN32OLE_VARIANT class.
-
- * ext/win32ole/tests/testall.rb: ditto.
-
- * ext/win32ole/tests/testOLEVARIANT.rb: ditto.
-
Sat Aug 13 18:51:26 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
* eval.c (rb_block_pass): distinguish current block from others.
@@ -50223,30 +10479,10 @@ Sat Aug 13 18:51:26 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ext/stringio/stringio.c (strio_set_string): disallow nil.
http://www.rubyist.net/~nobu/t/20050811.html#c05
-Sat Aug 13 08:01:59 2005 NARUSE, Yui <naruse@ruby-lang.org>
-
- * ext/nkf/lib/kconv.rb: Kconv.kconv is now alias of Kconv.conv
- * ext/nkf/lib/kconv.rb: remove nkf dependent symbols from SYMBOL_TO_OPTION
-
-Fri Aug 12 17:06:53 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * parse.y (f_larglist): allow optional arguments even when
- parentheses are omitted. based on Nobu's patch from
- http://www.rubyist.net/~nobu/t/20050805.html
-
- * parse.y (parser_yylex): update & maintain lpar_beg for detect
- lambda parameters.
-
Thu Aug 11 23:29:03 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ext/stringio/stringio.c: keep holding string after closed.
-Thu Aug 11 20:48:40 2005 Tadashi Saito <shiba@mail2.accsnet.ne.jp>
-
- * numeric.c (fix_equal, fix_cmp, fix_gt, fix_ge, fix_lt, fix_le):
- reduce coercing when a method knows about a operand type.
- [ruby-dev:26789]
-
Thu Aug 11 13:01:48 2005 Kouhei Sutou <kou@cozmixng.org>
* lib/rss: fixed sort bug. [ruby-list:41018]
@@ -50271,33 +10507,6 @@ Thu Aug 11 13:01:48 2005 Kouhei Sutou <kou@cozmixng.org>
(RSS::TestSetupMaker10::test_setup_maker_items_sort): added some
tests for RSS::Maker::ItemsBase#do_sort.
-Wed Aug 10 12:01:20 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/delegate.rb: simplifies Delegator classes; SimpleDelegator
- now uses method_missing for all methods.
-
-Wed Aug 10 10:38:50 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * bignum.c (rb_big_mul0): multiply two numbers (x, y) without
- normalizing the result. x should be a big number.
- [ruby-dev:26778]
-
- * bignum.c (rb_big_pow): use rb_big_mul0() instead of
- rb_big_mul().
-
- * array.c (rb_ary_or, rb_ary_and, rb_ary_plus, rb_ary_diff):
- revert the change on 2005-08-03. Set operation on other item
- should have in separate methods.
-
- * parse.y (shadowing_lvar_gen): warn when arguments shadows
- external local variables.
-
- * parse.y (f_opt): optional arguments should not clobber external
- local variables.
-
- * parse.y (f_rest_arg): rest arguments should not clobber external
- local variables.
-
Wed Aug 10 10:29:40 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tk/lib/tk.rb: fix bug on handling __ruby2val_optkeys().
@@ -50309,19 +10518,9 @@ Wed Aug 10 10:29:40 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tk/lib/tkextlib/blt/component.rb: ditto.
-Tue Aug 9 21:53:17 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval.c (formal_assign): let default values override
- arguments to zsuper. fixed: [ruby-dev:26743]
-
-Tue Aug 9 20:30:19 2005 Tadashi Saito <shiba@mail2.accsnet.ne.jp>
-
- * bignum.c (rb_big_coerce): allow bignum x bignum coercing.
- [ruby-dev:26778]
-
Tue Aug 9 15:12:04 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
- * ext/tk/tcltklib.c: remove dangerous 'rb_jump_tag's.
+ * ext/tcltklib/tcltklib.c: remove dangerous 'rb_jump_tag's.
* ext/tk/lib/tk.rb: add __val2ruby_optkeys and __ruby2val_optkeys to
help to convert option values between ruby and tcl.
@@ -50344,56 +10543,28 @@ Tue Aug 9 15:12:04 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tk/lib/tkextlib/*: support to treat tkvariable-type
configure options.
-Tue Aug 9 08:24:05 2005 Mauricio Fernandez <mfp@acm.org>
-
- * parse.y (f_block_arg), eval.c (rb_yield_0): deal with dynamic
- variable lambda arguments. [ruby-core:05540]
-
-Mon Aug 8 22:13:48 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval.c (assign): deal with new block argument.
- fixed: [ruby-core:05536]
-
- * eval.c (rb_node_arity): follow change of NODE_ARGS.
- fixed: [ruby-dev:26761]
-
-Mon Aug 8 21:28:13 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Tue Aug 9 20:30:19 2005 Tadashi Saito <shiba@mail2.accsnet.ne.jp>
- * test/ruby/test_fnmatch.rb: separated from test_file.rb.
+ * bignum.c (rb_big_coerce): allow bignum x bignum coercing.
+ [ruby-dev:26778]
-Mon Aug 8 20:40:35 2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+Mon Aug 8 20:43:02 2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
* test/ruby/test_method.rb: added. [ruby-dev:26761]
-Mon Aug 8 01:26:37 2005 Mauricio Fernandez <mfp@acm.org>
-
- * parse.y (f_larglist): mistake in syntax rule. [ruby-core:05535]
+Sun Aug 7 23:50:14 2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
-Mon Aug 8 05:16:55 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * test/ruby/test_super.rb: added from HEAD. [ruby-dev:26743]
- * ext/openssl/ossl.c (ossl_raise): should use ERR_peek_last_error
- to get last error on the current thread. And should report
- if errors are on the stack while OpenSSL.debug is true.
-
- * ext/openssl/ossl.c (ossl_get_errors): new method for debugging
- this library.
+Sun Aug 7 01:31:15 2005 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-Mon Aug 8 05:15:19 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * ext/win32ole/win32ole.c (WIN32OLE_EVENT#on_event): should set
+ only one event handler.
- * lib/webrick/httpproxy.rb (HTTPProxyServer#initialize),
- lib/webrick/httpserver.rb (HTTPServer#initialize),
- lib/webrick/httpservlet/cgihandler.rb (CGIHandler#initialize),
- lib/webrick/httpservlet/erbhandler.rb (ERBHandler#initialize),
- lib/webrick/httpservlet/filehandler.rb(DefaultFileHandler#initialize):
- super (called with no arguments) takes default value of optional
- arguments. [ruby-dev:26743]
+ * ext/win32ole/tests/testOLEEVENT.rb: ditto.
- * lib/webrick/httputils.rb: add a media-type "text/html" for .xhtml.
-
-Sun Aug 7 23:52:39 2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
-
- * test/ruby/test_super.rb: added optional arg tests. [ruby-dev:26743]
- the tests expects 1.8 behavior at this time.
+ * ext/win32ole/tests/testOLEPARAM.rb: remove re-defined
+ test_ole_type_detail method.
Sat Aug 6 12:35:24 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
@@ -50406,58 +10577,33 @@ Sat Aug 6 12:35:24 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tk/lib/tk/variable.rb: retains backward conpatibility.
-Fri Aug 5 12:48:31 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Fri Aug 5 12:50:32 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
- * ext/tk/tcltklib.c: fixed memory leak when tk_funcall raised
+ * ext/tcltklib/tcltklib.c: fixed memory leak when tk_funcall raised
exception. (copies argv into heap in tk_funcall instead of
caller)
-Fri Aug 5 12:36:40 2005 NAKAMURA Usaku <usa@ruby-lang.org>
+Fri Aug 5 12:42:57 2005 NAKAMURA Usaku <usa@ruby-lang.org>
* lib/mkmf.rb (create_makefile): need to convert path separetor
before invoking install command.
-Fri Aug 5 08:08:05 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (return_jump): fix "can't across thread" error message
- when no thread associated.
- http://www.namikilab.tuat.ac.jp/~sasada/diary/200507.html#d31
+Fri Aug 5 00:27:04 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-Fri Aug 5 00:25:12 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * ext/tk/tcltklib.c: refactoring - extract ruby string <->
+ * ext/tcltklib/tcltklib.c: refactoring - extract ruby string <->
tcl object conversion as get_str_from_obj and get_obj_from_str.
Fri Aug 5 00:19:33 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * enumerator.c (Init_Enumerator): provided features should have
- extensions.
-
- * eval.c (rb_feature_p): returns type of the feature instead of
- extension.
-
- * eval.c (search_required): ruby library should be prior to statically
- linked extensions. fixed: [ruby-dev:26711]
-
- * eval.c (formal_assign): returns position of rest arguments variable.
-
- * parse.y (f_rest_arg): use anonymous variable for rest arguments.
- fixed: [ruby-dev:26647]
-
* extmk.rb (extmake): needs to be wrapped in an Array.
-Thu Aug 4 20:03:18 2005 Tadashi Saito <shiba@mail2.accsnet.ne.jp>
-
- * numeric.c (Init_Numeric): do not share implementation among
- Fixnum#/ and Fixnum#div. [ruby-core:05531]
-
Thu Aug 4 18:38:36 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
- * ext/tk/tcltklib.c: cannot compile for Tcl7.6/Tk4.2.
+ * ext/tcltklib/tcltklib.c: cannot compile for Tcl7.6/Tk4.2.
- * ext/tk/tcltklib.c: add nativethread consistency check.
+ * ext/tcltklib/tcltklib.c: add nativethread consistency check.
- * ext/tk/stubs.c: ditto.
+ * ext/tcltklib/stubs.c: ditto.
* ext/tk/lib/tk.rb: forgot to define TclTkIp.encoding and encoding=
when Tcl is 7.6 or 8.0.
@@ -50471,15 +10617,10 @@ Thu Aug 4 18:38:36 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tk/lib/tkextlib/SUPPRT_STATUS: update RELEASE_DATE
-Thu Aug 4 13:30:15 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * numeric.c (fix_div): should not convert the result into
- integer. [ruby-core:05524]
-
Thu Aug 4 08:03:39 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ext/extmk.rb (extmake): should not modify $mflags for each
- extensions.
+ extentions.
Thu Aug 4 00:25:48 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
@@ -50490,84 +10631,47 @@ Thu Aug 4 00:25:48 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
* {win32,wince}/Makefile.sub: separate config.h for compiler versions.
-Thu Aug 4 00:24:59 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * sprintf.c: replacing is no longer needed.
-
Wed Aug 3 21:59:16 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tk/lib/tk/variable.rb: TkVariable#trace didn't work on
TkVariable retrived from TkVariable.new_hash.ref. [ruby-dev:26721]
-Wed Aug 3 12:40:28 2005 Tadashi Saito <shiba@mail2.accsnet.ne.jp>
-
- * numeric.c (fix_plus): reduce coercing when a method knows about
- a operand type. [ruby-dev:26723]
-
- * numeric.c (fix_minus, fix_mul, fix_quo, fix_div, fix_mod,
- fix_divmod, fix_pow): ditto.
-
- * bignum.c (rb_big_div, rb_big_modulo): export to reduce
- coercing.
-
-Wed Aug 3 10:13:52 2005 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * configure.in, {bcc32,win32,wince}/Makefile.sub (HAVE_SNPRINTF,
- HAVE_VSNPRINTF): use win32/win32.c's implementation instead of
- missing/vsnprintf.c's.
-
- * win32/win32.[ch] (rb_w32_snprintf, rb_w32_vsnprintf): reverted.
-
-Wed Aug 3 10:05:08 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in: check vsnprintf() and snprintf().
-
- * sprintf.c, missing/vsnprintf.c: made vsnprintf() and snprintf()
- private. fixed: [ruby-dev:26651]
-
Wed Aug 3 08:22:13 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
* ext/socket/socket.c (ruby_connect): revert [ruby-talk:111654]
changes at 2004-09-07. [ruby-dev:26656]
-Wed Aug 3 06:53:35 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * array.c (rb_ary_or): wraps the operand in an array if it is not
- an array. [ruby-talk:150495] [EXPERIMENTAL]
-
- * array.c (rb_ary_and, rb_ary_plus, rb_ary_diff): ditto.
+Tue Aug 2 10:20:54 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-Tue Aug 2 10:23:12 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * ext/tk/tcltklib.c: use Tcl_[GS]etVar2Ex instead of
+ * ext/tcltklib/tcltklib.c: use Tcl_[GS]etVar2Ex instead of
Tcl_Obj[GS]etVar2. (avoid Tcl_NewStringObj on supported platforms)
- * ext/tk/tcltklib.c: use ip_{get,set,unset}_variable2_core from
+ * ext/tcltklib/tcltklib.c: use ip_{get,set,unset}_variable2_core from
ip_{get,set,unset}_variable.
- * ext/tk/tcltklib.c: replaced Tcl_Panic with rb_bug.
+ * ext/tcltklib/tcltklib.c: replaced Tcl_Panic with rb_bug.
-Tue Aug 2 01:40:38 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Tue Aug 2 01:41:28 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
* lib/ping.rb (Ping.pingecho): should rescue StandardError.
[ruby-dev:26677]
-Mon Aug 1 19:02:23 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Mon Aug 1 19:09:41 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
- * ext/tk/tcltklib.c: refactoring - replaced rb_ivar_defined &
+ * ext/tcltklib/tcltklib.c: refactoring - replaced rb_ivar_defined &
rb_ivar_get with single rb_attr_get call.
-Mon Aug 1 18:44:08 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Mon Aug 1 18:45:07 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
- * ext/tk/tcltklib.c (Tcl_GetStringResult): refactoring - define
+ * ext/tcltklib/tcltklib.c (Tcl_GetStringResult): refactoring - define
alternative macro on Tcl7.x or earlier.
-Mon Aug 1 13:53:55 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Mon Aug 1 13:57:35 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
- * ext/tk/tcltklib.c (deleted_ip): refactoring - interpreter
+ * ext/tcltklib/tcltklib.c (deleted_ip): refactoring - interpreter
deletion check. [ruby-dev:26664]
-Mon Aug 1 01:08:21 2005 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+Mon Aug 1 01:17:40 2005 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
* lib/drb/drb.rb (check_insecure_method): use private_methods and
protected_methods instead of respond_to? to check method visibility.
@@ -50577,205 +10681,86 @@ Mon Aug 1 01:08:21 2005 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
* test/drb/ut_drb.rb: ditto.
-Sat Jul 30 18:49:44 2005 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-
- * ext/win32ole/win32ole.c: add WIN32OLE_TYPE#ole_typelib,
- WIN32OLE_TYPE#implemented_ole_types.
+Mon Aug 1 00:07:32 2005 Keiju Ishitsuka <keiju@ruby-lang.org>
- * ext/win32ole/tests/testOLETYPE.rb: ditto.
-
-Fri Jul 29 16:12:02 2005 Keiju Ishitsuka <keiju@ruby-lang.org>
-
- * lib/irb/context.rb: fix `irb --readline` option. [ruby-dev:40955]
+ * lib/irb/context.rb: fix `irb --readline` option. [ruby-list:40955]
Fri Jul 29 09:59:38 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * eval.c (rb_call0): fix calling zsuper from a method with anonymous
- rest argument. [ruby-dev:26639]
-
* eval.c (rb_yield_0): push yielded node instead of yielding.
fixed: [yarv-dev:549]
-Thu Jul 28 21:49:17 2005 IWATSUKI Hiroyuki <don@na.rim.or.jp>
-
- * parse.y (rb_parser_end_seen_p): exclude from ripper.
- <http://moonrock.jp/~don/d/200507.html#d28_t2>
-
- * sprintf.c (clearerr): remove standard macro before re-definition.
- <http://moonrock.jp/~don/d/200507.html#d28_t3>
-
Thu Jul 28 18:09:55 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
- * ext/tk/stubs.c: When --enable-tcltk-stubs, the initialize
+ * ext/tcltklib/stubs.c: When --enable-tcltk-stubs, the initialize
routine creates a Tcl/Tk interpreter and deletes it. However,
init cost of Tk's MainWindow is not so small. And that makes it
impossible to use libraries written with Tcl functions only on
an environment without a graphical display. This changes support
delaying initalization of Tk_Stubs until the script needs Tk.
- * ext/tk/stubs.h: New file. Define prototypes and return codes of
- functions on stubs.c.
+ * ext/tcltklib/stubs.h: New file. Define prototypes and return
+ codes of functions on stubs.c.
- * ext/tk/tcltklib.c: Support delaying initalization of Tk_Stubs
- until the script needs Tk.
+ * ext/tcltklib/tcltklib.c: Support delaying initalization of
+ Tk_Stubs until the script needs Tk.
- * ext/tk/tcltklib.c: Show friendly error messages for errors on
- initialization.
+ * ext/tcltklib/tcltklib.c: Show friendly error messages for errors
+ on initialization.
- * ext/tk/tcltklib.c: Avoid SEGV on ip_finalize() when ruby is
+ * ext/tcltklib/tcltklib.c: Avoid SEGV on ip_finalize() when ruby is
exiting and $DEBUG is true. (Not fix. If you know the reason of
why, please fix it.)
- * ext/tk/tkutil/tkutil.c (ary2list, ary2list2): bug fix on handling
- of encoding.
+ * ext/tk/tkutil.c (ary2list, ary2list2): bug fix on handling of
+ encoding.
* ext/tk/lib/multi-tk.rb: MultiTkIp#eval_string and bg_eval_string
don't work propery.
* ext/tk/lib/tk.rb: Forget extending Tk::Encoding module to Tk.
-
* ext/tk/lib/tk/variable.rb: TkVarAccess fails to initialize the
object for an element of a Tcl's array variable.
-Thu Jul 28 17:23:37 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * parse.y (f_larglist): allow block argument in lambda parameter
- list without parenthesis.
-
-Thu Jul 28 17:14:01 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * hash.c (each_i): typo fixed. [ruby-dev:26622]
-
-Thu Jul 28 15:04:11 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * parse.y (f_arg): better argument name duplication check
-
- * parse.y (new_args_gen): factored out name duplication check for
- optional and rest arguments.
-
- * parse.y (new_bv_gen): allow shadowing outer local variables;
- warning remains.
-
-Thu Jul 28 13:46:06 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (ripper_warningS): the argument was omitted.
- [ruby-dev:26621]
-
-Thu Jul 28 11:30:57 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * parse.y (f_larglist): allow bv_decl at the end of lambda
- argument list. [EXPERIMENTAL]
-
- * parse.y (new_bv_gen): allow local variable shadowing, with
- warning in verbose mode.
-
Wed Jul 27 23:23:54 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
* gc.c (obj_free): make message format consistent with one from
gc_mark(). [ruby-talk:149668]
- * sprintf.c (quad_t): prepare quad_t as well. [ruby-talk:149668]
-
Wed Jul 27 22:11:37 2005 Kouhei Sutou <kou@cozmixng.org>
* sample/rss/tdiary_plugin: removed. because the plugin
is imported in the tDiary plugin packages.
-Wed Jul 27 19:11:53 2005 Minero Aoki <aamine@loveruby.net>
-
- * lib/fileutils.rb (cd): follow :noop option change. (This patch
- is contributed by Doug Kearns)
-
-Wed Jul 27 16:25:59 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * parse.y (lambda): Perl6 style -> lambda expression. [NEW]
- [VERY EXPERIMENTAL]
-
-Wed Jul 27 10:43:14 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * gc.c (id2ref): must not assign pointers to long int. use
- LONG_LONG instead if SIZEOF_LONG < SIZEOF_VOIDP.
- [ruby-talk:149645]
-
- * ruby.h: use LONG_LONG to simplify the change.
- [ruby-talk:149645]
-
Wed Jul 27 10:59:02 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
* dir.c (dir_each): rewinddir(3) before iteration.
[ruby-talk:149628]
-Wed Jul 27 02:34:58 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (rb_f_throw): replace all '0x%lx' by '%p'.
- [ruby-talk:149553]
-
- * missing/vsnprintf.c (BSD_vfprintf): '%p' need to handle 64bit
- size pointer. [ruby-talk:149553]
-
-Tue Jul 26 22:41:28 2005 Minero Aoki <aamine@loveruby.net>
-
- * ext/ripper/lib/ripper/sexp.rb: new method Ripper.sexp_raw.
-
- * ext/ripper/lib/ripper/sexp.rb (Ripper.sexp): returns more
- readable tree. This is suggested by Kirill A. Shutemov.
-
-Tue Jul 26 22:05:12 2005 Minero Aoki <aamine@loveruby.net>
-
- * lib/net/http.rb: merge a patch contributed by Daniel Berger,
- with some modification. (RubyForge #2128)
-
-Tue Jul 26 18:11:33 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * ruby.h: support LLP64 model. [ruby-talk:149524]
-
-Tue Jul 26 12:57:40 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Tue Jul 26 12:57:49 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
* ext/openssl/openssl_missin.c: include <openssl/engine.h> before
<openssl/x509_vfy.h> to avoid compilation error of mswin32.
suggested by NAKAMURA Usaku.
-Mon Jul 25 23:48:55 2005 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/win32.[ch]: (rb_w32_vsnprintf, rb_w32_snprintf): removed.
-
Mon Jul 25 21:30:46 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * common.mk: Borland MAKE doesn't look for file names which have paths
- from VPATH. fixed: [ruby-dev:26604]
-
- * ruby.h (NORETURN, DEPRECATED): moved just after config.h.
-
- * {win32,wince}/Makefile.sub: vsnprintf() is in missing now.
-
* {bcc32,win32,wince}/Makefile.sub: moved CPPFLAGS only for ruby
source to XCFLAGS.
-Mon Jul 25 14:10:02 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tk/lib/multi-tk.rb: fix en-bugged part in the last commit.
-
Mon Jul 25 13:45:18 2005 NAJIMA Hiroki <najima@mickey.ai.kyutech.ac.jp>
* io.c: check HAVE_SYS_IOCTL_H before including the header.
[ruby-dev:26610]
-Sat Jul 23 16:48:12 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * ext/openssl/ossl_engine.c (ossl_engine_s_load): should check
- OPENSSL_NO_STATIC_ENGINE.
-
-Sat Jul 23 11:46:30 2005 Tanaka Akira <akr@m17n.org>
-
- * eval.c (rb_fd_select): the all three fd_sets must be long enough for
- select. fixed: [ruby-talk:149059]
+Mon Jul 25 14:10:02 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-Sat Jul 23 10:01:41 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/tk/lib/multi-tk.rb: fix en-bugged part in the last commit.
- * sprintf.c (rb_vsprintf, rb_sprintf): new functions return new String,
- using missing/vsnprintf.c. [ruby-dev:26580]
+Sat Jul 23 16:49:04 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
- * missing/vsnprintf.c: made the output changeable.
+ * ext/openssl/ossl_engine.c (ossl_engine_s_load): should check
+ OPENSSL_NO_STATIC_ENGINE.
Fri Jul 22 21:06:08 2005 Tadashi Saito <shiba@mail2.accsnet.ne.jp>
@@ -50809,12 +10794,12 @@ Fri Jul 22 14:37:43 2005 Kouhei Sutou <kou@cozmixng.org>
Fri Jul 22 07:01:42 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
- * ext/tk/tkutil/tkutil.c (tk_conv_args): forget to revert
- thread_critical and gc_disable when raise ArgumentError.
+ * ext/tk/tkutil.c (tk_conv_args): forget to revert thread_critical
+ and gc_disable when raise ArgumentError.
* ext/tk/lib/remote-tk.rb: RemoteTkIp doesn't need to include TkUtil.
- * ext/tk/tcltklib.c: add TclTkIp#has_mainwindow? method.
+ * ext/tcltklib/tcltklib.c: add TclTkIp#has_mainwindow? method.
* ext/tk/lib/tk.rb: add Tk.has_mainwindow? method.
@@ -50846,17 +10831,11 @@ Fri Jul 22 07:01:42 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tk/lib/multi-tk.rb: fail to control a slave IP when Tk.mainloop
runs on the IP.
-Thu Jul 21 01:00:00 2005 NARUSE, Yui <naruse@ruby-lang.org>
-
- * ext/nkf/nkf-utf8/{nkf.c,utf8tbl.c,config.h}:
- import 1.76
- [ruby-dev:26592] nkf constification
-
-Wed Jul 20 19:18:52 2005 NAKAMURA Usaku <usa@ruby-lang.org>
+Wed Jul 20 19:20:37 2005 NAKAMURA Usaku <usa@ruby-lang.org>
* io.c (S_ISREG): need to define S_ISREG before it is used first.
-Wed Jul 20 18:33:15 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Wed Jul 20 18:40:50 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* io.c (wsplit_p): patch for the environment where
fcntl(F_GETFL, O_NONBLOCK) is not supported. in that case,
@@ -50872,7 +10851,7 @@ Wed Jul 20 10:04:51 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
* variable.c (rb_class_path): need to adjust snprintf() len for
teminating NUL. [ruby-dev:26581]
-Wed Jul 20 03:58:52 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Wed Jul 20 04:01:55 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* ext/socket/socket.c: sorry, BeOS also uses HAVE_CLOSESOCKET,
so reverted.
@@ -50880,7 +10859,7 @@ Wed Jul 20 03:58:52 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* ext/socket/extconf.rb: should not define HAVE_CLOSESOCKET
on windows.
-Wed Jul 20 03:12:21 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Wed Jul 20 03:16:43 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* ext/socket/socket.c: should not undef close() on win32.
it's defined to rb_w32_close(), otherwise handle leaks.
@@ -50896,22 +10875,19 @@ Tue Jul 19 22:47:29 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
* error.c (syserr_initialize): add 1 byte for snprintf() size for
NUL at the end. [ruby-dev:26574]
-Tue Jul 19 17:16:34 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * signal.c (trap): remove sigexit(); handle "EXIT" via sig_exec().
- [ruby-dev:26440]
+Tue Jul 19 16:39:46 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
* io.c (rb_io_inspect): replace sprintf() with "%s" format all
over the place by snprintf() to avoid integer overflow.
-Tue Jul 19 14:10:50 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Tue Jul 19 14:08:22 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
- * ext/tk/tcltklib.c: rbtk_eventloop_depth is used as int.
+ * ext/tcltklib/tcltklib.c: rbtk_eventloop_depth is used as int.
- * ext/tk/tcltklib.c: rbtk_pending_exception is tested with
+ * ext/tcltklib/tcltklib.c: rbtk_pending_exception is tested with
NIL_P, so should assign Qnil instead of 0 (Qfalse).
- * ext/tk/tcltklib.c (ip_invoke_real): fixed memory leak when
+ * ext/tcltklib/tcltklib.c (ip_invoke_real): fixed memory leak when
ip is deleted.
Tue Jul 19 13:19:46 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
@@ -50920,50 +10896,33 @@ Tue Jul 19 13:19:46 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
returns a string even if the default value type of the TkVariable
object is not "string".
-Mon Jul 18 21:39:18 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Mon Jul 18 21:40:20 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* eval.c (rb_call0): make the pointer to NODE volatile
instead of NODE itself.
Mon Jul 18 14:32:21 2005 Tanaka Akira <akr@m17n.org>
- * eval.c (rb_call0): make body volatile to avoid possible optimization
- problem.
+ * eval.c (rb_call0): make body volatile to avoid optimization problem.
[ruby-dev:26195]
Mon Jul 18 12:23:27 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
- * ext/io/wait/wait.c: wrong backport from trunk, and compile error on
- platforms fd_set is not a bit set. fixed: [ruby-dev:26562]
+ * ext/io/wait/wait.c: wrong backport from trunk. fixed: [ruby-dev:26562]
Mon Jul 18 09:36:25 2005 Tanaka Akira <akr@m17n.org>
* rubyio.h (FMODE_WSPLIT, FMODE_WSPLIT_INITIALIZED): new constant.
* io.c (wsplit_p): new function.
- (io_fflush): split writing data by PIPE_BUF if wsplit_p is true in
+ (io_fwrite): split writing data by PIPE_BUF if wsplit_p is true in
multi-threaded mode.
- (io_fwrite): ditto.
[ruby-dev:26540]
-Mon Jul 18 05:00:00 2005 NARUSE, Yui <naruse@ruby-lang.org>
-
- * ext/nkf/nkf-utf8/nkf.c: import nkf.c 1.73
- fix: TestKconv 1F
-
Sun Jul 17 13:46:54 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ext/io/wait/extconf.rb, ext/io/wait/wait.c: Win32 platforms support.
-Sat Jul 16 23:43:16 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * enumerator.c (Init_Enumerator): wrong argument specs.
- [ruby-core:05481]
-
-Sat Jul 16 15:52:50 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * win32/win32.[hc]: constified socket functions. [ruby-dev:26553]
-
Fri Jul 15 23:59:03 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/rdoc/parsers/parse_c.rb (handle_class_module): handle a
@@ -50974,25 +10933,23 @@ Fri Jul 15 23:59:03 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/rdoc/parsers/parse_c.rb (find_call_seq): allow :nodoc: modifier
in C. [ruby-core:04572]
-Fri Jul 15 23:20:03 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Jul 15 18:00:01 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
- * enumerator.c (Init_Enumerator): use an internal directly.
+ * bcc32/Makefile.sub (COMMON_HEADERS): ruby_1_8 is using winsock.h.
+ failed to compile ext/socket on bcc5.6.4. [ruby-dev:26193]
-Fri Jul 15 07:58:10 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Fri Jul 15 07:58:56 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
* lib/webrick/server.rb (WEBrick::GenericServer#accept_client):
sockets should be non-blocking mode. [ruby-dev:26405]
* lib/webrick/utils.rb (WEBrick::Utils.set_non_blocking): new method.
-Fri Jul 15 00:11:36 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/webrick/httprequest.rb (WEBrick::HTTPRequest#read_chunked):
+ should call sock.read repeatedly until the preferred size data
+ is obtained.
- * enum.c (enumeratorize): create new enumerator for current method if
- no block is given.
-
- * enumerator.c: moved from ext/enumerator.
-
-Thu Jul 14 18:27:35 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Thu Jul 14 18:27:16 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* win32/win32.c (rb_w32_strerror): should return correct message
for ENAMETOOLONG and ENOTEMPTY. (bcc32) [ruby-dev:26533]
@@ -51004,11 +10961,7 @@ Thu Jul 14 00:45:42 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
* LEGAL (ext/nkf/nkf-utf8): updated from nkf1.7 to nkf-utf8.
-Wed Jul 13 22:44:00 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y: remove static variables. [ruby-dev:26530]
-
-Wed Jul 13 19:36:29 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Wed Jul 13 19:37:47 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* win32/win32.c (rb_w32_mkdir): should set EEXIST (not EACCES)
if file or directory already exists. (bcc32) [ruby-dev:26508]
@@ -51021,7 +10974,7 @@ Wed Jul 13 19:36:29 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
Wed Jul 13 12:40:00 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
- * ext/tk/tcltklib.c: TclTkLib.do_one_event doesn't work.
+ * ext/tcltklib/tcltklib.c: TclTkLib.do_one_event doesn't work.
* ext/tk/lib/tk.rb: Tk.thread_update is available.
@@ -51029,30 +10982,16 @@ Tue Jul 12 23:32:11 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/mkmf.rb: keep curdir unexpanded.
-Mon Jul 11 23:50:17 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval.c, intern.h (rb_proc_call, rb_obj_method, rb_method_call):
- export.
-
- * ext/enumerator/enumerator.c (enumerator_with_index): [EXPERIMENTAL]
- added a new method Enumerator#with_index. [ruby-talk:147728]
-
Mon Jul 11 08:31:29 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * regparse.c (fetch_escaped_value): mask values following \c in
+ * regex.c (read_special): fix parsing backslashes following \c in
regexp. fixed: [ruby-dev:26500]
-Sun Jul 11 05:18:17 2005 Michael Neumann <mneumann@ruby-lang.org>
-
- * lib/xmlrpc/server.rb (XMLRPC::Server): Switch from GServer over to
- WEBrick. This makes file lib/xmlrpc/httpserver.rb obsolete (at least it is
- no further used by the XML-RPC library).
-
-Mon Jul 11 02:50:23 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Mon Jul 11 02:53:00 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
* lib/webrick/cgi.rb (WEBrick::CGI::Socket#request_line):
- mistook to merge the patch of [ruby-dev:26235] at
- revision 1.11.
+ mistook in merging the patch of [ruby-dev:26235] at
+ revision 1.4.2.6.
Sun Jul 10 23:58:04 2005 Tanaka Akira <akr@m17n.org>
@@ -51060,12 +10999,18 @@ Sun Jul 10 23:58:04 2005 Tanaka Akira <akr@m17n.org>
avoid unlink a directory by root.
cf. [ruby-dev:26237]
+Sun Jul 11 05:18:17 2005 Michael Neumann <mneumann@ruby-lang.org>
+
+ * lib/xmlrpc/server.rb (XMLRPC::Server): Switch from GServer over to
+ WEBrick. This makes file lib/xmlrpc/httpserver.rb obsolete (at least it is
+ no further used by the XML-RPC library).
+
Sun Jul 10 12:47:01 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/debug.rb (debug_command): added a deficient format specifier.
fixed: [ruby-core:05419]
-Sat Jul 9 22:02:37 2005 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+Sat Jul 9 21:28:46 2005 Masaki Suketa <masaki.suketa@nifty.ne.jp>
* ext/win32ole/win32ole.c (ole_method_dispid): convert dispid
in Ruby and C by INT2NUM and NUM2INT.
@@ -51090,36 +11035,6 @@ Fri Jul 8 15:45:04 2005 Kouhei Sutou <kou@cozmixng.org>
* test/rss/test_parser.rb (RSS::TestParser#test_category20):
adjusted test case.
-Wed Jul 6 18:45:53 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * object.c (rb_obj_pattern_match): now returns nil.
- [ruby-core:05391]
-
-Mon Jul 4 14:35:52 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * sample/svr.rb: service can be stopped by ill-behaved client; use
- tsvr.rb instead.
-
-Mon Jul 4 13:25:21 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * missing/erf.c: original erf.c by prof. Okumura is confirmed to
- be public domain. reverted BSD implementation.
-
-Wed Jul 6 11:15:21 2005 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/win32.c (open_ifs_socket): new function.
-
- * win32/win32.c (StartSockets, rb_w32_socket): use open_ifs_socket()
- instead of socket().
- all changes are derived from [ruby-core:5388].
-
-Wed Jul 6 00:15:00 2005 NARUSE, Yui <naruse@ruby-lang.org>
-
- * ext/nkf/nkf-utf8/{nkf.c,utf8tbl.c,config.h}:
- imported nkf.c 1.70 (support UTF-8-MAC)
-
- * ext/nkf/lib/kconv.rb: add :utf8mac and :internalunicode
-
Tue Jul 5 23:44:06 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
* instruby.rb: expand source library path.
@@ -51136,19 +11051,19 @@ Tue Jul 5 15:15:10 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tk/tkutil.c: fix typo.
-Tue Jul 5 14:52:56 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Tue Jul 5 14:51:35 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
- * ext/tk/tcltklib.c: bug fix on treating Unicode strings.
+ * ext/tcltklib/tcltklib.c: bug fix on treating Unicode strings.
- * ext/tk/tcltklib.c: add methods to treat encoding mode.
+ * ext/tcltklib/tcltklib.c: add methods to treat encoding mode.
- * ext/tk/MANUAL_tcltklib.eng: add description of TclTkLib#encoding,
+ * ext/tcltklib/MANUAL.eng: add description of TclTkLib#encoding,
encoding_system, and so on.
- * ext/tk/MANUAL_tcltklib.eucj: ditto.
+ * ext/tcltklib/MANUAL.euc: ditto.
- * ext/tk/tkutil/tkutil.c: fail to create a Tcl's list string from
- an array including multiple kind of encoded strings.
+ * ext/tk/tkutil.c: fail to create a Tcl's list string from an
+ array including multiple kind of encoded strings.
* ext/tk/lib/tk.rb: ditto.
@@ -51174,11 +11089,17 @@ Tue Jul 5 14:52:56 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tk/lib/tk/namespace.rb: arguemnts for TclTkIp#_merge_tklist
should be UTF-8 strings.
-Mon Jul 4 19:29:32 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Mon Jul 4 14:35:52 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
- * lib/set.rb: test change to follow revision 1.28. (duck typing?)
+ * sample/svr.rb: service can be stopped by ill-behaved client; use
+ tsvr.rb instead.
+
+Mon Jul 4 13:25:21 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * missing/erf.c: original erf.c by prof. Okumura is confirmed to
+ be public domain. reverted BSD implementation.
-Mon Jul 4 11:23:50 2005 NAKAMURA Usaku <usa@ruby-lang.org>
+Mon Jul 4 11:15:37 2005 NAKAMURA Usaku <usa@ruby-lang.org>
* test/{dbm,gdbm,sdbm}/test_{dbm,gdbm,sdbm}.rb: skip some tests
which using fork on fork-less platforms.
@@ -51201,18 +11122,11 @@ Sat Jul 2 17:06:23 2005 Tanaka Akira <akr@m17n.org>
* eval.c (flush_register_windows): new function.
- * ruby.h (NOINLINE): move up to be effective in defines.h.
+Fri Jul 1 17:48:52 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-Sat Jul 2 15:19:41 2005 Tanaka Akira <akr@m17n.org>
-
- * configure.in: check select_large_fdset.
-
- * eval.c: use select_large_fdset to support large file descriptors
- on Solaris. [ruby-dev:26404]
-
-Fri Jul 1 17:55:08 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * bignum.c (rb_big_neg): may be accessing bogus pointer value.
+ * bignum.c (get2comp): revert all prior changes, and calculate
+ proper 2's complement for negative numbers. backported from
+ HEAD.
Fri Jul 1 15:50:12 2005 NAKAMURA Usaku <usa@ruby-lang.org>
@@ -51252,11 +11166,6 @@ Fri Jul 1 00:18:40 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
* lib/delegate.rb (Delegator::respond_to): respond_to? must check
destination object. [ruby-talk:146894]
-Thu Jun 30 23:52:12 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * signal.c (trap): non-string trap hander was ignored.
- fixed: [ruby-dev:26417]
-
Thu Jun 30 19:00:21 2005 Keiju Ishitsuka <keiju@ruby-lang.org>
* lib/irb/ruby-lex.rb (RubyLex::identify_number): alternative implements
@@ -51272,76 +11181,46 @@ Thu Jun 30 15:13:16 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
* eval.c (rb_eval): pre-evaluate argument for unambiguous
evaluation order. [ruby-dev:26383]
-Thu Jun 30 14:48:23 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * lib/net/http.rb (Net::HTTP#connect, Net::HTTP#request): should
- not send proxy username and password to origin servers.
- [ruby-dev:25673]
-
- * lib/net/http.rb (Net::HTTP::ProxyDelta#edit_path): should not
- send HTTPS scheme URL to origine servers. [ruby-dev:25689]
-
Thu Jun 30 09:53:56 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
* lib/delegate.rb (Delegator::method_missing): forward unknown
method to the destination. suggested by
<christophe.poucet@gmail.com>. [ruby-talk:146776]
-Wed Jun 29 00:03:20 2005 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-
- * regparse.c (fetch_token): avoid warning of unused goto tag.
- [ruby-dev:26389]
-
Tue Jun 28 21:59:29 2005 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
- * dir.c, eval.c, parse.y, process.c, ruby.c: avoid warning "unused
+ * dir.c, eval.c, hash.c, process.c, ruby.c: avoid warning "unused
variable" [ruby-dev:26387]
- * dir.c (glob_helper): avoid warning "enumeration value `RECURSIVE'
- not handled in switch" [ruby-dev:26392]
-
-Tue Jun 28 01:52:00 2005 NARUSE, Yui <naruse@ruby-lang.org>
+Sat Jun 25 17:15:23 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
- * ext/nkf/lib/kconv.rb: add Kconv::VERSION
- * ext/nkf/lib/kconv.rb (conv): can process arrayed options
- * ext/nkf/nkf-utf8/nkf.c: imported Revision 1.69
- * ext/nkf/nkf-utf8/utf8tbl.c: imported Revision 1.9
+ * lib/webrick/httputils.rb (WEBrick::HTTPUtils.parse_query): should
+ discard if key=val pair is empty. patch from Gary Wright.
Sat Jun 25 23:30:51 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
* process.c (detach_process_watcher): terminate process watcher
thread right after rb_waitpid() succeed. [ruby-talk:146430]
-Sat Jun 25 17:12:20 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * lib/webrick/httputils.rb (WEBrick::HTTPUtils.parse_query): should
- discard if key=val pair is empty. patch from Gary Wright.
-
Sat Jun 25 15:49:18 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * enum.c (enum_min, enum_max, enum_min_by, enum_max_by): do not ignore
- nil as the first element.
+ * enum.c (enum_min, enum_max): do not ignore nil as the first element.
-Sat Jun 25 15:13:54 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Sat Jun 25 14:40:17 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
- * lib/set.rb (Set#==): [ruby-dev:25206] (ported from ruby_1_8 branch)
+ * ext/sdbm/init.c (fsdbm_select): SDBM#select had returned the array
+ which contained each elements twice. [ruby-dev:26358]
-Sat Jun 25 11:37:00 2005 NARUSE, Yui <naruse@ruby-lang.org>
+Fri Jun 25 05:06:47 2005 Michael Neumann <mneumann@ruby-lang.org>
- * ext/nkf/lib/kconv.rb: remove constants
- Iconv_Shift_JIS, Uconv_EUC_JP, Iconv_UTF8
- * ext/nkf/lib/kconv.rb: add module functions to Kconv
- conv, {eucjp, shiftjis, utf8}?, guess_as_symbol
- * ext/nkf/lib/kconv.rb: add instance methods to String
- conv, {eucjp, shiftjis, utf8}?
- * ext/nkf/lib/kconv.rb: add aliases Kconv.to_* and String#to_*
+ * lib/xmlrpc/*, test/xmlrpc/*: backported changes from HEAD into 1.8
Fri Jun 24 17:00:00 2005 Shigeo Kobayashi <shigeo@tinyforest.jp>
* ext/bigdecimal/bigdecimal.c: patch from "NATORI Shin"
(u-tokyo.ac.jp) applied to fix rounding bug.
-Fri Jun 24 13:17:45 2005 akira yamada <akira@ruby-lang.org>
+Fri Jun 24 13:06:45 2005 akira yamada <akira@ruby-lang.org>
* lib/uri/common.rb, lib/uri/generic.rb: fixed typo in documents and
replaced some existent domain name with "example.com".
@@ -51378,7 +11257,7 @@ Mon Jun 20 18:44:04 2005 Tanaka Akira <akr@m17n.org>
because setjmp is not enough to fix getcontext and SPARC register
window problem.
-Mon Jun 20 17:15:51 2005 NAKAMURA Usaku <usa@ruby-lang.org>
+Mon Jun 20 16:48:36 2005 NAKAMURA Usaku <usa@ruby-lang.org>
* ext/dbm/dbm.c (fdbm_closed): new method DBM#closed?
@@ -51391,7 +11270,7 @@ Mon Jun 20 17:15:51 2005 NAKAMURA Usaku <usa@ruby-lang.org>
* win32/win32.{ch} (unlink): hook runtime function to change
file attribute before unlinking.
- merge from 1.8, see [ruby-dev:26360]
+ fixed: [ruby-dev:26360]
Mon Jun 20 02:15:35 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
@@ -51405,17 +11284,6 @@ Mon Jun 20 01:26:49 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
ext/openssl/ossl_pkcs12.h, ext/openssl/ossl_x509req.c: avoid
compiler warnings. suggested by Michal Rokos.
-Sun Jun 20 00:22:02 2005 Michael Neumann <mneumann@ruby-lang.org>
-
- * lib/xmlrpc/utils.rb: Patch by Nobuhiro IMAI fixes the following
- problem: Default value modification on
- Module#public_instance_methods (false -> true) breaks
- s.add_handler(XMLRPC::iPIMethods("sample"), MyHandler.new) style
- security protection.
-
- * lib/xmlrpc/client.rb: Aliased XMLRPC::Client#new2 as
- XMLRPC::Client#new_from_uri, and #new3 as #new_from_hash.
-
Sun Jun 19 14:09:07 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
* gc.c (run_final): reduce unnecessary object allocation during
@@ -51424,30 +11292,15 @@ Sun Jun 19 14:09:07 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
* gc.c (rb_gc_call_finalizer_at_exit): deferred finalizers list should
be cleared before calling them. fixed: [ruby-talk:145790]
-Sat Jun 18 01:15:36 2005 Shugo Maeda <shugo@ruby-lang.org>
-
- * ext/readline/readline.c (readline_readline): do not set
- rl_{in,out}stream.
-
- * ext/readline/readline.c (readline_s_set_input): new method.
-
- * ext/readline/readline.c (readline_s_set_output): new method.
-
- * lib/irb/input-method.rb: set Readline.input and Readline.output.
-
Fri Jun 17 13:01:40 2005 Tanaka Akira <akr@m17n.org>
* lib/time.rb (Time.parse): fix previous leap seconds support.
(Time.rfc2822): ditto.
(Time.xmlschema): ditto.
-Thu Jun 16 15:41:32 2005 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * ruby.c (load_file): '!' is already read. reported by gotoyuzo.
-
-Thu Jun 16 15:09:38 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Thu Jun 16 15:06:55 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
- * ext/tk/tcltklib.c (ip_rb_threadVwaitCommand): Tcl_Release
+ * ext/tcltklib/tcltklib.c (ip_rb_threadVwaitCommand): Tcl_Release
was missing.
Thu Jun 16 13:34:48 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
@@ -51463,14 +11316,10 @@ Thu Jun 16 12:53:24 2005 Tanaka Akira <akr@m17n.org>
(Time.rfc2822): ditto.
(Time.xmlschema): ditto.
-Thu Jun 16 00:13:41 2005 Tanaka Akira <akr@m17n.org>
+Thu Jun 16 08:29:22 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
- * lib/resolv.rb (Resolv::DNS::Resource#ttl): new attribute.
- (Resolv::DNS::Resource#==): ignore @ttl.
- (Resolv::DNS::Resource#hash): ditto.
- (Resolv::DNS::Message::MessageDecoder#get_rr): save TTL in a
- Resource object.
- based on [ruby-core:5190] by Eric Hodel.
+ * ext/dl/sym.c (rb_dlsym_call): needs FREE_ARGS before return.
+ fixed memory leak. [ruby-Bugs-2034]
Wed Jun 15 18:26:39 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
@@ -51481,13 +11330,13 @@ Wed Jun 15 18:26:39 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
Tue Jun 14 02:02:43 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
- * ext/tk/tkutil/tkutil.c: add TkUtil::CallbackSubst.subst_arg(m, ...)
- & _define_attribute_aliases(hash) to get substitution-argument from
+ * ext/tk/tkutil.c: add TkUtil::CallbackSubst.subst_arg(m, ...) &
+ _define_attribute_aliases(hash) to get substitution-argument from
attributes (e.g. subst_arg(:x,:y,:num,:button) --> "%x %y %b %b ").
* ext/tk/lib/tk/event.rb: use _define_attribute_aliases().
-Mon Jun 13 13:03:08 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Mon Jun 13 13:01:05 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* hash.c (ruby_setenv): fixed SEGV. [ruby-dev:26186]
@@ -51510,20 +11359,11 @@ Mon Jun 13 01:20:02 2005 Tanaka Akira <akr@m17n.org>
* eval.c (rb_gc_mark_threads): curr_thread may not be part of the
thread list. [ruby-dev:26312]
-Sat Jun 11 22:34:44 2005 Minero Aoki <aamine@loveruby.net>
-
- * parse.y: missing arg_paren event. This patch is contributed by
- Mitchell N Charity.
-
-Fri Jun 10 23:55:17 2005 Tanaka Akira <akr@m17n.org>
-
- * eval.c (unknown_node): show more information. [ruby-dev:26196]
-
Fri Jun 10 23:35:34 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
* missing/mkdir.c: remove. [ruby-core:05177]
-Fri Jun 10 22:54:18 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Jun 10 22:54:26 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
* missing.h: fd_set stuffs need sys/types.h. fixed: [ruby-core:05179]
@@ -51547,47 +11387,20 @@ Thu Jun 9 19:55:41 2005 Tanaka Akira <akr@m17n.org>
* gc.c (Init_stack): remove IA64_MAGIC_STACK_LIMIT.
-Thu Jun 9 18:24:16 2005 Tanaka Akira <akr@m17n.org>
-
- * configure.in, eval.c, gc.c: use libunwind only on HP-UX.
- [ruby-dev:26297]
-
-Thu Jun 9 14:46:32 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * hash.c (env_aset): do not treat nil as key-removing value.
- [ruby-list:40865]
-
- * parse.y (method_call): allow aref expression ([]) to take a
- block.
-
- * parse.y (block_dup_check): a function to check duplication of
- a block argument and an actual block.
-
Thu Jun 9 11:55:34 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
* lib/delegate.rb (SimpleDelegator::__setobj__): need check for
recursive delegation. [ruby-core:04940]
-Thu Jun 9 11:50:43 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/cgi.rb: add underscore aliases CGI::escape_html,
- CGI::unescape_html, CGI::escape_element, CGI::unescape_element.
- [ruby-core:05058]
-
Wed Jun 8 18:47:10 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
* misc/ruby-mode.el (ruby-expr-beg): fix looking point drift.
-Wed Jun 8 12:25:59 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * array.c (rb_ary_nitems): add the block feature to Array#nitems.
- suggested by Bertram Scharpf <lists@bertram-scharpf.de> in
- [ruby-talk:134083].
-
Wed Jun 8 11:11:34 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
- * bignum.c (get2comp): revert all prior changes, and calculate
- proper 2's complement for negative numbers.
+ * bignum.c (get2comp): calculate proper 2's complement for
+ negative numbers. a bug in normalizing negative numbers
+ reported from Honda Hiroki <hhonda@ipflex.com>.
Wed Jun 8 08:33:10 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
@@ -51598,15 +11411,6 @@ Wed Jun 8 08:33:10 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
* eval.c (backtrace): skip successive frames sharing same node.
-Wed Jun 8 01:27:06 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * bignum.c (bignorm): fixed a bug in normalizing negative numbers
- reported from Honda Hiroki <hhonda@ipflex.com>. normalizing
- should not trim leading zeros from negative numbers.
-
- * bignum.c (rb_cstr_to_inum): must remove leading zeros for this
- case.
-
Wed Jun 8 00:15:08 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
* ext/socket/socket.c (ruby_getaddrinfo__aix): merged a patch from
@@ -51632,55 +11436,37 @@ Tue Jun 7 19:34:15 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
Tue Jun 7 18:39:31 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
* lib/thread.rb: RDoc documentation from Eric Hodel
- <drbrain@segment7.net> added. [ruby-core:05148]
+ <drbrain at segment7.net> added. [ruby-core:05148]
Tue Jun 7 18:30:04 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/mkmf.rb (create_makefile): add .SUFFIXES from depend file.
fixed: [ruby-dev:26294]
-Tue Jun 7 17:20:39 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * parse.y (parser_yylex): allow ';;' to be block terminator in
- place of 'end'. [highly experimental]
-
- * misc/ruby-mode.el (ruby-block-end-re): allow ';;' to be a
- negative indent trigger. [highly experimental]
+Tue Jun 7 17:39:54 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
- * parse.y (parser_yylex): small error fixed.
+ * object.c (rb_mod_cvar_get): Module#class_variable_get(): back
+ ported from CVS HEAD. [ruby-talk:144741]
-Tue Jun 7 16:45:49 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * parse.y (parser_yylex): "respond_to?:foo" should be interpreted
- as "respond_to? :foo" at the command level. [ruby-talk:144303]
+ * object.c (rb_mod_cvar_set): Module#class_variable_set().
+ [ruby-talk:144741]
Tue Jun 7 16:32:53 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
* sprintf.c (rb_f_sprintf): raise exception on debug mode (-d),
not verbose mode (-v/-w). [ruby-core:05123]
- * sprintf.c (rb_f_sprintf): warn always on verbose mode.
-
Tue Jun 7 10:30:49 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tk/lib/multi-tk.rb: slave-ip fails to call procedures
delegated by master-ip.
-Mon Jun 6 16:35:18 2005 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * ext/ripper/depend: add .y to .SUFFIXES for nmake.
-
Sun Jun 5 23:00:35 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tk/lib/tk/console.rb: create console when required
* ext/tk/sample/tkextlib/tile/demo.rb: fix TypeError & create Console
-Sun Jun 5 10:23:52 2005 Tanaka Akira <akr@m17n.org>
-
- * signal.c (ruby_signal): don't set SA_RESTART.
- [ruby-dev:26276]
-
Sat Jun 4 14:55:18 2005 Tanaka Akira <akr@m17n.org>
* test/dbm/test_dbm.rb: merged from ext/dbm/testdbm.rb.
@@ -51690,61 +11476,15 @@ Sat Jun 4 14:55:18 2005 Tanaka Akira <akr@m17n.org>
* test/sdbm/test_sdbm.rb: renamed from ext/sdbm/testsdbm.rb with
modification to use test/unit.
-Fri Jun 3 23:23:02 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * intern.h (rb_fdset_t): deal with fd bit sets over FD_SETSIZE.
- fixed: [ruby-dev:26187]
-
- * eval.c (rb_fd_init, rb_fd_term, rb_fd_zero, rb_fd_set, rb_fd_clr,
- rb_fd_isset, rb_fd_copy): ditto.
-
- * io.c (rb_io_wait_readable, rb_io_wait_writable, rb_f_select): ditto.
-
- * ext/io/wait/wait.c (io_wait): ditto.
-
- * ext/socket/socket.c (wait_connectable, unix_recv_io): ditto.
-
Fri Jun 3 14:06:12 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tk/lib/multi-tk.rb: fix typo.
-Thu Jun 2 23:42:57 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y: pragma support on ripper. [ruby-dev:26266]
-
-Thu Jun 2 00:02:16 2005 Minero Aoki <aamine@loveruby.net>
-
- * struct.c: accessing >10 member caused segmentation fault.
- [ruby-dev:26247]
-
- * test/ruby/test_struct.rb: test it.
-
-Wed Jun 1 11:30:09 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Wed Jun 1 11:32:42 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* bcc32/Makefile.sub: can use single quote character in DESTDIR.
[ruby-dev:26205]
- * bcc32/Makefile.sub: Dir.glob in 1.9 doesn't treat \ as path separator.
- [ruby-dev:26254]
-
-Wed Jun 1 00:11:06 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * parse.y (method_call): new experiment: "(expr)(args...)" to
- invoke "expr.call(args...)". [EXPERIMENTAL]
-
-Tue May 31 23:43:41 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * parse.y (command): revert implicit "call" for local variables.
-
-Tue May 31 15:52:45 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * lib/webrick/httpserver.rb (WEBrick::HTTPServer#run): should
- break the loop if the socket reached to EOF. [ruby-talk:142285]
-
- * lib/webrick/httpserver.rb (WEBrick::HTTPServer#run): send response
- without reading the whole request body if keep-alive is diabled.
- [experimental]
-
Mon May 30 23:48:29 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tk/lib/tk/macpkg.rb: add PACKAGE_NAME information of Tcl/Tk
@@ -51756,12 +11496,12 @@ Mon May 30 23:48:29 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tk/lib/tkextlib/*: ditto.
-Sat May 28 16:39:21 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Sat May 28 16:40:15 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
* test/openssl/test_x509store.rb: add test for expired CRL
and refine some assertions.
-Sat May 28 05:15:44 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Sat May 28 05:15:51 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
* ext/openssl/ossl_x509store.c (ossl_x509stctx_set_time): should
not set internal flag directry.
@@ -51777,41 +11517,22 @@ Fri May 27 16:32:04 2005 WATANABE Hirofumi <eban@ruby-lang.org>
* lib/mkmf.rb: use the semicolon as the path separator
in the environment of MSYS. fixed: [ruby-dev:26232]
-Thu May 26 20:31:21 2005 Minero Aoki <aamine@loveruby.net>
-
- * lib/fileutils.rb (remove_entry_secure): add documentation.
-
- * lib/fileutils.rb (remove_entry_secure): should not invoke
- unlink(2) against a directory.
-
-Thu May 26 08:29:19 2005 Akiyoshi, Masamichi <akiyoshi@hp.com>
-
- * vms/vmsruby_private.c, vms/vmsruby_private.h: private routines
- for VMS port are added.
-
- * eval.c (ruby_init): change to call VMS private intialization routine.
-
-Thu May 26 07:39:07 2005 Minero Aoki <aamine@loveruby.net>
-
- * lib/fileutils.rb (rm_r): use lchown(2), not chown(2).
- [ruby-dev:26226]
-
- * lib/fileutils.rb (cd): remove :noop option. (feature change)
+Thu May 26 06:08:11 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
- * lib/fileutils.rb (cp_r): should copy symlink as symlink, for
- also tree root. (feature change)
+ * ext/tk/lib/tk.rb: add shortcut-methods of tk_call + tk_split_list
- * lib/fileutils.rb (cp_r): new option :dereference_root.
+Wed May 25 22:52:42 2005 Shugo Maeda <shugo@ruby-lang.org>
- * lib/fileutils.rb: new method remove_entry.
+ * lib/irb/input-method.rb: do not use Readline::HISTORY.pop.
+ (backported from HEAD)
- * lib/fileutils.rb: new method remove_entry_secure.
+Wed May 25 21:55:40 2005 Shugo Maeda <shugo@ruby-lang.org>
- * lib/fileutils.rb: add documentation.
+ * ext/readline/readline.c: supported libedit. (backported from HEAD)
-Thu May 26 06:08:11 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * ext/readline/extconf.rb: ditto.
- * ext/tk/lib/tk.rb: add shortcut-methods of tk_call + tk_split_list
+ * test/readline/test_readline.rb: ditto.
Wed May 25 20:06:27 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
@@ -51853,10 +11574,6 @@ Wed May 25 20:06:27 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tk/lib/tkextlib/iwidgets/scrolledcanvas.rb: ditto.
-Wed May 25 19:48:12 2005 Minero Aoki <aamine@loveruby.net>
-
- * lib/fileutils.rb (rm_r): does chown(2). [ruby-dev:26199]
-
Wed May 25 12:59:48 2005 Tanaka Akira <akr@m17n.org>
* lib/open-uri.rb (OpenURI::Meta::RE_QUOTED_STRING): a content of
@@ -51872,17 +11589,17 @@ Tue May 24 16:57:24 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
* ruby.c (require_libraries): caused SEGV when continuation jumped
in to the required library code.
-Tue May 24 17:45:59 2005 Shugo Maeda <shugo@ruby-lang.org>
+Tue May 24 11:56:25 2005 WATANABE Hirofumi <eban@ruby-lang.org>
- * test/readline/test_readline.rb: do not test libedit.
- fixed: [ruby-dev:26217]
+ * lib/getopts.rb: should warn only if verbose mode.
+ fixed: [ruby-dev:26201]
Tue May 24 06:45:31 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
* misc/ruby-mode.el (ruby-font-lock-syntactic-keywords): string
literals to be matched non-greedy.
-Tue May 24 00:39:14 2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+Tue May 24 00:34:32 2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
* test/soap/calc: method name 'set' was able to crash with a class Set.
[ruby-dev:26210]
@@ -51890,16 +11607,11 @@ Tue May 24 00:39:14 2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
* test/wsdl/document/test_rpc.rb: dateTime comparison failed under
TZ=right/Asia/Tokyo (with leap second.) [ruby-dev:26208]
-Mon May 23 16:23:06 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tk/extconf.rb: Framework support on MacOS X Tiger.
+Mon May 23 16:24:05 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
- * ext/tk/README.tcltklib: add description of Framework support options.
+ * ext/tcltklib/extconf.rb: Framework support on MacOS X Tiger.
-Mon May 23 15:07:34 2005 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/Makefile.sub ($(PROGRAM)): add dependency on $(LIBRUBY_SO).
- [experimental]
+ * ext/tcltklib/README.1st: add description of Framework support options.
Mon May 23 12:21:37 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
@@ -51992,79 +11704,41 @@ Sun May 22 19:11:35 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
* ext/openssl/ossl_ssl.c (ossl_sslctx_setup): add session id support.
-Sun May 22 12:30:58 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * intern.h, parse.y (ruby_pragma): removed. fixed: [ruby-dev:26198]
-
- * parse.y (parser_pragma): pragma name was ignored.
-
-Sun May 22 02:39:57 2005 Minero Aoki <aamine@loveruby.net>
-
- * lib/fileutils.rb (rm_r): new option :secure to avoid
- time-to-check-to-time-to-use security problem. [ruby-dev:26100]
-
- * lib/fileutils.rb (remove_file, remove_dir): try chmod(700) only
- on Windows.
-
- * lib/fileutils.rb: does not depend on find.rb.
-
- * lib/fileutils.rb: new method chmod_R.
-
- * lib/fileutils.rb (chown_R): did not work.
-
-Sat May 21 10:23:21 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Sat May 21 10:24:21 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* bcc32/Makefile.sub: tds files were not deleted when DESTDIR
included '\' path delimiter. [ruby-dev:26193]
-Fri May 20 15:52:18 2005 Shugo Maeda <shugo@ruby-lang.org>
-
- * ext/readline/readline.c (readline_attempted_completion_function):
- return 2 items if completion_proc returns only 1 item (for libedit).
-
-Fri May 20 01:24:33 2005 Shugo Maeda <shugo@ruby-lang.org>
-
- * ext/readline/extconf.rb: check rl_vi_editing_mode() and
- rl_emacs_editing_mode().
-
-Thu May 19 23:33:09 2005 Shugo Maeda <shugo@ruby-lang.org>
-
- * ext/readline/readline.c: supported libedit. fixed: [ruby-core:4858]
+Thu May 19 19:04:29 2005 speakillof <speakillof@yahoo.co.jp>
- * ext/readline/extconf.rb: added new option --enable-libedit.
-
- * test/readline/test_readline.rb: added assertions for
- Readline::HISTORY.
-
- * lib/irb/input-method.rb: do not use Readline::HISTORY.pop.
+ * lib/rexml/encodings/SHIFT-JIS.rb: encoding and decoding were
+ swapped. [ruby-core:4772]
Wed May 18 23:42:25 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
* error.c (exc_exception): reverted to call Exception#initialize
directly. fixed: [ruby-dev:26177]
-Wed May 18 17:38:51 2005 WATANABE Hirofumi <eban@ruby-lang.org>
-
- * dir.c (glob_helper): check whether path is "" before calling
- do_opendir. [ruby-dev:26183]
-
-Wed May 18 13:40:48 2005 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/win32.c (NtInitialize): fix typo.
-
-Wed May 18 11:07:47 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed May 18 23:39:09 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
* dir.c (glob_helper): get rid of using String. [ruby-dev:26180]
+ * dir.c (push_braces): should skip balanced braces.
+
* eval.c (ruby_options), win32/win32.c (NtInitialize): move argument
intialization back. [ruby-dev:26180]
-Tue May 17 11:49:18 2005 NAKAMURA Usaku <usa@ruby-lang.org>
+Tue May 17 15:31:31 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
+
+ * lib/webrick/httpserver.rb (WEBrick::HTTPServer#run): should
+ break the loop if the socket reached to EOF. [ruby-talk:142285]
+
+Tue May 17 11:52:18 2005 NAKAMURA Usaku <usa@ruby-lang.org>
* win32/win32.c (unixtime_to_filetime): use localtime() instead of
gmtime() when using FileLocalTimeToFileTime().
-Mon May 16 22:42:52 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon May 16 22:28:43 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
* win32/win32.h, {bcc32,win32,wince}/Makefile.sub: moved rb_[ugp]id_t
to get rid of redefinition warnings on mingw.
@@ -52072,12 +11746,7 @@ Mon May 16 22:42:52 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
* class.c (rb_class_init_copy): singleton class is disallowed to copy,
from its definition. fixed: [ruby-talk:142749]
- * parse.y (pragma_encoding): add prototype to suppress false warning
- by VC.
-
- * process.c (proc_spawn_v): use rb_w32_aspawn on Win32.
-
-Mon May 16 03:29:01 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Mon May 16 08:52:29 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* win32/win32.{h,c}: define rb_[pgu]id_t.
@@ -52087,7 +11756,7 @@ Mon May 16 00:21:02 2005 Tanaka Akira <akr@m17n.org>
Errno::EISDIR because EISDIR is not portable.
[ruby-core:5001]
-Sun May 15 22:28:10 2005 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+Sun May 15 22:11:33 2005 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
* lib/drb/drb.rb (DRbObject#method_missing): use raise(exception).
[ruby-dev:26164]
@@ -52112,7 +11781,7 @@ Sat May 14 23:59:11 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
* error.c (exc_exception, {exit,name_err,syserr}_initialize): call
Execption#initialize. fixed: [ruby-talk:142593]
-Sat May 14 23:56:41 2005 Erik Huelsmann <ehuels@gmail.com>
+Sat May 14 23:57:26 2005 Erik Huelsmann <ehuels@gmail.com>
* configure.in: Check for the availability of pid_t, gid_t and uid_t and
remove AC_TYPE_UID_T. fixed: [ruby-core:04745]
@@ -52137,16 +11806,6 @@ Sat May 14 23:56:41 2005 Erik Huelsmann <ehuels@gmail.com>
* wince/sys/types.h: Remove definitions of {p,g,u}id_t.
-Sat May 14 11:47:57 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * intern.h (ruby_pragma): prototype. [ruby-core:04881]
-
- * parse.y (parser_pragma): parse Emacsen hack.
-
- * parse.y (parser_prepare): deal with specific syntax at the top.
-
- * ruby.c (load_file): read the first line iff it started with shebang.
-
Fri May 13 23:44:22 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ext/extmk.rb: keep srcdir unexpanded.
@@ -52158,45 +11817,87 @@ Fri May 13 23:44:22 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
also INSTALL_PROG and INSTALL_DATA system dependent.
fixed: [ruby-core:04931]
-Fri May 13 23:32:55 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval.c (unknown_node): add volatile directive to prototype.
-
-Fri May 13 17:50:49 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Fri May 13 17:54:39 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* variable.c (generic_ivar_get): rb_attr_get should not warn.
[ruby-dev:26010]
-Thu May 12 17:41:00 2005 NARUSE, Yui <naruse@ruby-lang.org>
+Fri May 13 12:28:43 2005 Daniel Berger <djberge@qwest.com>
- * ext/nkf/nkf-utf8/nkf.c: follow nkf 2.0.5
+ * array.c (rb_ary_select): can remove argc check. [ruby-core:4911]
+
+ * test/ruby/test_array.rb: add test for find_all.
+
+Fri May 13 11:29:00 2005 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * eval.c (unknown_node): add volatile directive to prototype.
+
+Thu May 12 17:08:48 2005 Tanaka Akira <akr@m17n.org>
+
+ * io.c (rb_io_eof, remain_size, read_all, io_read, appendline)
+ (swallow, rb_io_each_byte, rb_io_getc): revert previous change.
+
+ * io.c (rb_io_eof, io_fread, appendline, swallow, rb_io_each_byte)
+ (rb_io_getc, rb_getc): call clearerr before getc to avoid
+ stdio incompatibility.
-Thu May 12 16:50:40 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Thu May 12 16:52:20 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* lib/rdoc/parsers/parse_c.rb: more readability for mixing
progress "c..." and warning message.
-Thu May 12 15:50:56 2005 Tilman Sauerbeck <tilman@code-monkey.de>
+Thu May 12 16:31:00 2005 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * ext/nkf/nkf-utf8/nkf.c: follow nkf 2.0.5
+
+Thu May 12 16:15:01 2005 Tanaka Akira <akr@m17n.org>
+
+ * io.c (rb_io_eof, remain_size, read_all, io_read, appendline)
+ (swallow, rb_io_each_byte, rb_io_getc): don't rely EOF flag.
+ [ruby-talk:141527]
+
+Thu May 12 15:56:20 2005 Tilman Sauerbeck <tilman@code-monkey.de>
* lib/rdoc/parsers/parse_c.rb: show parsing progress for C files.
[ruby-core:4341]
+Thu May 12 13:47:56 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+
+ * test/drb/test_drb{ssl,unix}.rb: can test drb
+ before install. (backported from HEAD) [ruby-dev:26146]
+
Thu May 12 09:53:57 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
* version.c (ruby_show_version): flush for non-tty stdout.
+Thu May 12 09:07:07 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+
+ * test/ruby/envutil.rb, test/drb/drbtest.rb: can test drb
+ before install. (backported from HEAD) [ruby-Bugs-1672]
+
Thu May 12 01:23:55 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * eval.c (rb_eval), parse.y (arg): reduce fixnum range literal at
+ parser. fixed: [ruby-dev:26113]
+
* eval.c (unknown_node): ignore broken NODE to get rid of accessing
possibly inaccessible address. fixed: [ruby-dev:26122]
should emit more useful information like [ruby-dev:26126], though.
+Wed May 11 16:20:01 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
+
+ * lib/webrick/cgi.rb: new methods WEBrick::CGI#[], WEBrick::CGI#logger
+ and WEBrick::CGI#config. (backported from HEAD)
+
+ * lib/webrick/httputils.rb (WEBrick::HTTPUtils.escape_path): should
+ not use String#split("/"). (backported from HEAD)
+
Wed May 11 15:58:39 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
* eval.c (break_jump): break should not cross functions.
[ruby-list:40818]
-Wed May 11 10:41:54 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Wed May 11 10:39:37 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* lib/tempfile.rb (Tempfile#unlink): fixed typo.
@@ -52209,12 +11910,7 @@ Sun May 8 23:17:47 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tk/lib/tk/timer.rb: fix typo.
-Sun May 8 21:00:50 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * hash.c (Init_Hash): remove custom "hash" and "eql?".
- (ported from 1.8) [ruby-dev:26132]
-
-Sun May 8 16:50:25 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Sun May 8 16:52:56 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* lib/profiler.rb: fixed "undefined method `[]' for nil:NilClass"
[ruby-core:4775] [ruby-talk:140401] [ruby-dev:26118]
@@ -52223,54 +11919,11 @@ Sat May 7 22:58:00 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/mkmf.rb (have_var): no libs argument is given.
-Fri May 6 08:08:37 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * hash.c:rb_hash_hash_i() should be static. [ruby-core:04815]
-
- * re.c should include regint.h for declarations of oniguruma
- functions. [ruby-core:04815]
-
-Sun May 1 09:15:17 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun May 1 09:58:11 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ruby.c (process_sflag): replace '-' in variable names with '_'.
[ruby-dev:26107]
- * eval.c (rb_eval), parse.y (arg): reduce fixnum range literal at
- parser. fixed: [ruby-dev:26113]
-
-Sat Apr 30 11:59:25 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in (RUBY_FUNC_ATTRIBUTE): check for function attribute.
- [ruby-dev:26109]
-
- * eval.c, gc.c: moved noinline to configure.in.
-
- * rubyio.h (DEPRECATED): moved to configure.in.
-
- * ruby.h (DEPRECATED, NOINLINE): default definition.
-
- * win{32,ce}/Makefile.sub (config.h): deprecated and noinline for
- __declspec() are available for VC++7 or later.
-
-Sat Apr 30 06:57:39 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * lib/webrick/cgi.rb: new methods WEBrick::CGI#[], WEBrick::CGI#logger
- and WEBrick::CGI#config. these are necessary to use an instance of
- WEBrick::CGI as the first argument of HTTPServlet#get_instance.
- (suggested by Tatsuki Sugiura)
-
- * lib/webrick/cgi.rb
- (WEBrick::CGI#initalize): set a dummy to @config[:ServerSoftware]
- if SERVER_SOFTWARE environment variable is not given.
- (WEBrick::CGI#start): req.path_info must be a String.
- (WEBrick::CGI::Socket#request_line): treat REQUEST_METHOD, PATH_INFO
- and SCRIPT_NAME to run in console.
-
- * lib/webrick/httputils.rb (WEBrick::HTTPUtils.escape_path): should
- not use String#split("/"). it removes trailing empty path component.
-
-Thu Apr 28 08:21:51 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
* ruby.c (set_arg0): use also environment variable space for setting
$0. [ruby-core:04774]
@@ -52281,46 +11934,23 @@ Wed Apr 27 23:42:22 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
Tue Apr 26 22:58:00 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
- * ext/tk/tcltklib.c (ip_invoke_core): call Tcl's "::unknown"
+ * ext/tcltklib/tcltklib.c (ip_invoke_core): call Tcl's "::unknown"
command when can't get information of target command.
-Mon Apr 25 13:54:55 2005 speakillof <speakillof@yahoo.co.jp>
-
- * lib/rexml/encodings/SHIFT-JIS.rb: encoding and decoding were
- swapped. [ruby-core:4772]
-
Mon Apr 25 01:18:43 2005 Tanaka Akira <akr@m17n.org>
- * oniguruma.h (OnigWarnFunc): add a variadic argument.
- [ruby-core:4751]
+ * regex.c: declare rb_warn to have variadic argument. [ruby-core:4751]
-Sat Apr 23 19:49:21 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Sat Apr 23 19:45:59 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
- * ext/tk/tcltklib.c (ip_RubyExitCommand): exit with status code
+ * ext/tcltklib/tcltklib.c (ip_RubyExitCommand): exit with status code
via TclTkIp#_eval didn't work. [ruby-talk:139390]
-Sat Apr 23 11:45:29 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval.c (rb_provided): should check also path name to be loaded.
- fixed: [ruby-dev:26093]
-
-Fri Apr 22 16:55:35 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * ext/tk/tcltklib.c (ip_set_exc_message): fixed memory leak.
-
- * ext/tk/tcltklib.c: eTkCallbackReturn was not initialized.
+Fri Apr 22 16:41:50 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-Thu Apr 21 06:45:28 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/tcltklib/tcltklib.c (ip_set_exc_message): fixed memory leak.
- * ruby.c (ruby_incpush_expand, proc_options): expand relative path
- given with -I option. [ruby-dev:26090]
-
- * configure.in, lib/mkmf.rb, {bcc32,win32,wince}/Makefile.sub: improve
- C++ support. [ruby-dev:26089]
-
-Thu Apr 21 01:53:09 2005 Minero Aoki <aamine@loveruby.net>
-
- * lib/net/http.rb: add rdoc.
+ * ext/tcltklib/tcltklib.c: eTkCallbackReturn was not initialized.
Thu Apr 21 00:07:50 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
@@ -52334,7 +11964,7 @@ Thu Apr 21 00:07:50 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
Wed Apr 20 23:22:39 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * Makefile.in, common.mk: miniruby depends on MINIOBJS.
+ * Makefile.in, common.mk: miniruby depens on MINIOBJS.
* dmydln.c (dln_load): dummy function to raise LoadError.
@@ -52345,21 +11975,6 @@ Wed Apr 20 23:01:35 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
* win32/ifchange.bat: delete testing files.
-Wed Apr 20 22:54:54 2005 Minero Aoki <aamine@loveruby.net>
-
- * lib/net/http.rb: new method Net::HTTP.post_form.
-
- * lib/net/http.rb: new method Net::HTTPHeader#set_form_data and
- its alias #form_data=.
-
- * lib/net/http.rb: Net::HTTPHeader#add_header -> add_field
- (adjustted to Ruby 1.8).
-
-Wed Apr 20 10:53:30 2005 WATANABE Hirofumi <eban@ruby-lang.org>
-
- * lib/rdoc/parsers/parse_rb.rb (lex_init): use IRB module.
- [ruby-core:04737]
-
Wed Apr 20 07:27:18 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
* {bcc32,win32,wince}/configure.bat, {bcc32,win32,wince}/setup.mak:
@@ -52367,33 +11982,18 @@ Wed Apr 20 07:27:18 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
* bcc32/setup.mak: make configuration variables overridable.
-Tue Apr 19 23:37:09 2005 WATANABE Hirofumi <eban@ruby-lang.org>
+Wed Apr 20 04:15:27 2005 Keiju Ishitsuka <keiju@ruby-lang.org>
- * lib/ftools.rb (File.safe_unlink): do not modify a symlinked file.
+ * lib/irb.rb lib/irb/* doc/irb: IRB 0.9.5
-Tue Apr 19 23:02:40 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval.c (search_required): deal with features with path too.
-
- * intern.h (rb_file_expand_path): prototype. fixed: [ruby-dev:26082]
-
-Tue Apr 19 08:38:07 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Apr 19 23:37:09 2005 WATANABE Hirofumi <eban@ruby-lang.org>
- * eval.c (search_required, rb_require_safe): expand path in
- rb_features. [ruby-dev:26079]
+ * lib/ftools.rb (File.safe_unlink): do not modify a symlinked file.
- * file.c (rb_find_file_ext): return absolute path.
+Tue Apr 19 00:06:20 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ext/extmk.rb: expand path for ext/**/extconf.rb.
- * eval.c (search_required): handle static linked extensions.
-
-Mon Apr 18 15:37:35 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (rb_attr): attribute name check added.
-
- * numeric.c (flo_plus): small typo fix.
-
Mon Apr 18 11:25:14 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* ext/zlib/zlib.c (zstream_run): fixed SEGV. [ruby-core:4712]
@@ -52420,7 +12020,7 @@ Sat Apr 16 15:27:03 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
* mkconfig.rb: purge autoconf value variables.
-Sat Apr 16 10:33:48 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Sat Apr 16 10:36:01 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* bcc32/Makefile.sub: quick hack... prepend DESTDIR.
still have restriction on DESTDIR ("", "/", "e:")
@@ -52431,55 +12031,18 @@ Sat Apr 16 03:59:42 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
* ext/openssl/openssl_missing.h: ditto.
-Fri Apr 15 22:40:19 2005 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-
- * ext/win32ole/tests/testWIN32OLE.rb: add test for WIN32OLE.codepage=
-
- * ext/win32ole/tests/testOLETYPELIB.rb: correct expected message.
-
-Fri Apr 15 22:04:07 2005 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-
- * ext/win32ole/win32ole.c(ole_invoke): retry after converting Qnil
- to VT_EMPTY.
-
-Thu Apr 14 19:05:06 2005 Minero Aoki <aamine@loveruby.net>
-
- * parse.y [ripper] (regexp): dispatch regexp option.
- [ruby-Bugs:1688]
-
- * ext/ripper/lib/core.rb: regenerated (interface changed).
-
-Thu Apr 14 18:59:43 2005 Minero Aoki <aamine@loveruby.net>
+Thu Apr 14 19:18:30 2005 Minero Aoki <aamine@loveruby.net>
* lib/fileutils.rb (remove_file): ignore exceptions caused by
chmod.
* lib/fileutils.rb (remove_dir): try to get rights to rmdir.
- [ruby-Bugs:1502]
-
-Thu Apr 14 18:51:02 2005 Keiju Ishitsuka <keiju@ruby-lang.org>
-
- * lib/irb/ruby-lex.rb, lib/irb/slex.rb: bug fix of [ruby-Bugs-1745]
-
- * lib/irb/ext/loader.rb, lib/irb/ext/save-history.rb:
- fix location of @RCS_ID
-
- * lib/irb/cmd/help.rb: a lost of release IRB 0.9.5.
-
-Thu Apr 14 15:10:30 2005 Keiju Ishitsuka <keiju@ruby-lang.org>
-
- * lib/irb/notifier.rb, lib/irb/output-method.rb, lib/irb/ext/history.rb
- fixed warning of 'ruby -w'
+ [ruby-Bugs:1502] (2 items backportted from HEAD, rev 1.53-54)
-Thu Apr 14 05:35:45 2005 Keiju Ishitsuka <keiju@ruby-lang.org>
+Thu Apr 14 16:57:40 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * doc/irb/irb.rd.ja: a lost of release IRB 0.9.5.
-
- * lib/irb/slex.rb: bug fix by [ruby-core:04707].
-
-Thu Apr 14 00:20:31 2005 Keiju Ishitsuka <keiju@ruby-lang.org>
-
- * bin/irb lib/irb.rb lib/irb/...: IRB 0.9.5.
+ * bcc32/Makefile.sub: failed to remove debug information files.
+ fixed: [ruby-dev:26034]
Wed Apr 13 23:40:21 2005 Kouhei Sutou <kou@cozmixng.org>
@@ -52488,44 +12051,33 @@ Wed Apr 13 23:40:21 2005 Kouhei Sutou <kou@cozmixng.org>
* lib/rss/rss.rb (RSS::Element#converter): fixed converter
transmission bug.
-Wed Apr 13 22:12:16 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/optparse.rb (OptionParser#order!): call handlers iff matches
- non-switch.
-
Wed Apr 13 21:20:35 2005 WATANABE Hirofumi <eban@ruby-lang.org>
* configure.in (mingw32): extract msvcr*.dll from objdump result.
-Wed Apr 13 19:25:31 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Apr 13 20:24:30 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
* configure.in (mingw32): use actual runtime DLL name as ruby DLL
name and default load path.
* win32/Makefile.sub, win32/setup.mak: ditto.
-Tue Apr 12 19:30:36 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/optparse.rb (OptionParser#make_switch, OptionParser#order!):
- added non-option and end-of-args handler. [ruby-talk:136878]
- [EXPERIMENTAL]
-
Tue Apr 12 15:33:09 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
- * ext/tk/tcltklib.c (ip_finalize): better modification than the
+ * ext/tcltklib/tcltklib.c (ip_finalize): better modification than the
previous commit [ruby-dev:26029].
Tue Apr 12 12:38:06 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
- * ext/tk/tcltklib.c (ip_finalize): fix SEGV when Tcl_GlobalEval()
+ * ext/tcltklib/tcltklib.c (ip_finalize): fix SEGV when Tcl_GlobalEval()
modifies the argument string to eval.
Tue Apr 12 02:21:55 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
- * ext/tk/tcltklib.c (ip_finalize): add existence check of
+ * ext/tcltklib/tcltklib.c (ip_finalize): add existence check of
Tcl commands before calling Tcl_GlobalEval().
-Mon Apr 11 23:36:04 2005 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+Mon Apr 11 23:47:21 2005 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
* lib/drb/drb.rb: [druby-ja:123] fix: When reference of my object is
loaded, the object is tainted.
@@ -52538,13 +12090,28 @@ Mon Apr 11 22:18:23 2005 WATANABE Hirofumi <eban@ruby-lang.org>
Mon Apr 11 20:11:06 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
- * ext/tk/tcltklib.c (ip_finalize): adhoc patch to avoid SEGV when exit
- on Tcl/Tk8.3.x.
+ * ext/tcltklib/tcltklib.c (ip_finalize): adhoc patch to avoid SEGV
+ when exit on Tcl/Tk8.3.x.
-Mon Apr 11 15:24:20 2005 NAKAMURA Usaku <usa@ruby-lang.org>
+Mon Apr 11 15:26:25 2005 NAKAMURA Usaku <usa@ruby-lang.org>
* lib/mkmf.rb (configuration): shouldn't output hdrdir twice.
+Mon Apr 11 12:09:05 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+
+ * {bcc32,win32,wince}/Makefile.sub: ri data was not installed
+ into correct path. [ruby-dev:26011]
+
+ * bcc32/Makefile.sub: defaulted install-nodoc. [ruby-dev:26011]
+
+Sun Apr 10 10:12:42 2005 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+
+ * ext/win32ole/win32ole.c(ole_invoke): retry after converting Qnil
+ to VT_EMPTY.
+
+ * ext/win32ole/win32ole/tests/testWIN32OLE.rb: correct error
+ message string "Unknown" => "unknown".
+
Sat Apr 9 18:20:31 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tk/lib/tk/image.rb: support to create TkImage object without
@@ -52564,41 +12131,68 @@ Sat Apr 9 14:42:29 2005 Kouhei Sutou <kou@cozmixng.org>
* sample/rss/tdiary_plugin/rss-recent.rb: supported configuration
via Web browser.
-Fri Apr 8 20:17:48 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat Apr 9 11:59:57 2005 Kouhei Sutou <kou@cozmixng.org>
- * ext/extmk.rb (extmake): hdrdir needs to be defined also in
- Config::CONFIG.
+ * lib/rss: backoported from HEAD.
- * lib/mkmf.rb (configuration, create_makefile): get rid of recursive
- macro reference.
+ * lib/rss: refactored.
+ - gave a name to 'x'.
+ - undef_method -> remove_method for avoiding a warning in ruby 1.6.
-Fri Apr 8 01:55:20 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * lib/rss/parser.rb: @@setter -> @@setters.
- * ext/tk/sample/demos-{en,jp}/goldberg.rb: reduced window size.
- [ruby-dev:25992]
+ * lib/rss/parser.rb
+ (RSS::BaseListener.register_uri)
+ (RSS::BaseListener.uri_registered?)
+ (RSS::BaseListener.install_get_text_element):
+ swapped the first argument and the second argument.
-Thu Apr 7 23:58:40 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/rss/taxonomy.rb: swapped the first argument and the second
+ argument for RSS::BaseListener.install_get_text_element.
+ * lib/rss/image.rb: ditto.
+ * lib/rss/syndication.rb: ditto.
+ * lib/rss/dublincore.rb: ditto.
+ * lib/rss/parser.rb: ditto.
+ * lib/rss/1.0.rb: ditto.
+ * lib/rss/2.0.rb: ditto.
+ * lib/rss/0.9.rb: ditto.
+ * lib/rss/content.rb: ditto.
- * ext/extmk.rb (extmake): keep directory names in Makefile as macros.
+ * lib/rss/parser.rb
+ (RSS::BaseListener.install_setter)
+ (RSS::BaseListener.register_uri): changed fallback way.
- * lib/mkmf.rb (configuration, create_makefile): ditto.
+ * lib/rss/parser.rb: added class name registry for complex model
+ elements. (ex. have childlen elements, have some attributes and
+ a child element and so on.)
- * lib/mkmf.rb (CXX_EXT): separate C++ extensions.
+ * lib/rss/dublincore.rb: supported multiple Dublin Core items.
+ * lib/rss/maker/dublincore.rb: ditto.
-Thu Apr 7 17:24:17 2005 Shugo Maeda <shugo@ruby-lang.org>
+ * lib/rss/maker/image.rb: supproted new Dublin Core API.
- * eval.c (rb_call0): "return" event hook should be always executed
- if event_hooks is set.
+ * lib/rss/maker/base.rb: added default current_element implementation.
-Thu Apr 7 14:33:09 2005 Kouhei Sutou <kou@cozmixng.org>
+ * lib/rss/trackback.rb (RSS::TrackBackUtils.new_with_value_if_need):
+ moved to RSS::Utils.
- * test/rss/test_maker_dc.rb (test_date): added a test for #date=
- and #dc_date=.
+ * lib/rss/utils.rb (RSS::Utils.new_with_value_if_need):
+ moved from RSS::TrackBackUtils.
-Thu Apr 7 11:49:53 2005 Kouhei Sutou <kou@cozmixng.org>
+ * lib/rss/maker/image.rb: fixed invalid argument of
+ add_need_initialize_variable bug.
+ * lib/rss/maker/trackback.rb: ditto.
+
+ * lib/rss/rss.rb (Hash#merge): added for ruby 1.6.
+
+ * lib/rss/rss.rb (RSS::BaseModel.date_writer): changed to accept nil
+ for date value.
- * lib/rss/maker/dublincore.rb: _really_ supported multiple Dublin
- Core items.
+ * test/test_dublincore.rb: added tests for plural accessor and
+ multiple Dublin Core items.
+
+ * test/test_setup_maker_1.0.rb: fixed swapped actual and expected
+ values.
* test/rss/rss-assertions.rb (assert_multiple_dublin_core): added
an assertion for testing multiple Dublin Core items.
@@ -52606,18 +12200,8 @@ Thu Apr 7 11:49:53 2005 Kouhei Sutou <kou@cozmixng.org>
* test/rss/test_maker_dc.rb (test_rss10_multiple): added a test
for making multiple Dublin Core items.
-Wed Apr 6 16:06:30 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * test/ruby/test_env.rb (test_key): should test ENV.key instead of
- ENV.index. [ruby-dev:25994]
-
-Tue Apr 5 16:01:12 2005 Kouhei Sutou <kou@cozmixng.org>
-
- * lib/rss/*: refactored.
- - gave a name to 'x'.
- - undef_method -> remove_method for avoiding a warning in ruby 1.6.
-
-Tue Apr 5 15:45:33 2005 Kouhei Sutou <kou@cozmixng.org>
+ * test/rss/test_maker_dc.rb (test_date): added a test for #date=
+ and #dc_date=.
* sample/rss/tdiary_plugin/rss-recent.rb:
new option: @options['rss-recent.use-image-link']:
@@ -52626,46 +12210,54 @@ Tue Apr 5 15:45:33 2005 Kouhei Sutou <kou@cozmixng.org>
* sample/rss/tdiary_plugin/rss-recent.rb (RSS_RECENT_VERSION):
0.0.5 -> 0.0.6.
-Tue Apr 5 15:15:26 2005 Kouhei Sutou <kou@cozmixng.org>
-
- * lib/rss/dublincore.rb: supported multiple Dublin Core items.
+Fri Apr 8 20:17:48 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/rss/parser.rb: added class name registry for complex model
- elements. (ex. have childlen elements, have some attributes and
- a child element and so on.)
+ * ext/extmk.rb (extmake): hdrdir needs to be defined also in
+ Config::CONFIG.
- * lib/rss/maker/base.rb: added default current_element implementation.
+ * lib/mkmf.rb (configuration, create_makefile): get rid of recursive
+ macro reference.
- * lib/rss/maker/dublincore.rb: supported multiple Dublin Core
- items.
+Fri Apr 8 18:26:56 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
- * lib/rss/maker/image.rb: supproted new Dublin Core API.
+ * ext/openssl/ossl_ssl.c: add callbacks to OpenSSL::SSL::SSLContexts.
+ - SSLContext#client_cert_cb=(aProc). it is called when a client
+ certificate is requested by a server and no certificate was not
+ set for the SSLContext. it must return an Array which includes
+ OpenSSL::X509::Certificate and OpenSSL::PKey::RSA/DSA objects.
+ - SSLContext#tmp_dh_callback=(aProc). it is called in key
+ exchange with DH algorithm. it must return an OpenSSL::PKey::DH
+ object.
+ * ext/openssl/ossl_ssl.c (ossl_sslctx_set_ciphers): ignore the
+ argument if it's nil.
- * lib/rss/trackback.rb (RSS::TrackBackUtils.new_with_value_if_need):
- moved to RSS::Utils.
+ * ext/openssl/ossl_pkey.c
+ (GetPrivPKeyPtr, ossl_pkey_sign): should call rb_funcall first.
+ (DupPrivPKeyPtr): new function.
- * lib/rss/utils.rb (RSS::Utils.new_with_value_if_need):
- moved from RSS::TrackBackUtils.
+ * ext/openssl/ossl_pkey_dh.c: add default DH parameters.
+ * ext/openssl/ossl_pkey.h: ditto.
- * lib/rss/maker/image.rb: fixed invalid argument of
- add_need_initialize_variable bug.
+Fri Apr 8 01:55:20 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
- * lib/rss/maker/trackback.rb: ditto.
+ * ext/tk/sample/demos-{en,jp}/goldberg.rb: reduced window size.
+ [ruby-dev:25992]
+Thu Apr 7 23:58:40 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/rss/rss.rb (Hash#merge): added for ruby 1.6.
+ * ext/extmk.rb (extmake): keep directory names in Makefile as macros.
- * lib/rss/rss.rb (RSS::BaseModel.date_writer): changed to accept nil
- for date value.
+ * lib/mkmf.rb (configuration, create_makefile): ditto.
+ * lib/mkmf.rb (CXX_EXT): separate C++ extensions.
- * test/test_dublincore.rb: added tests for plural accessor and
- multiple Dublin Core items.
+Thu Apr 7 17:43:25 2005 Shugo Maeda <shugo@ruby-lang.org>
- * test/test_setup_maker_1.0.rb: fixed swapped actual and expected
- values.
+ * eval.c (rb_call0): "return" event hook should be always executed
+ if event_hooks is set. fixed: [ruby-core:04662]
+ (backported from HEAD)
Mon Apr 4 23:17:52 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
@@ -52680,6 +12272,11 @@ Mon Apr 4 10:26:48 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* ext/tk/lib/tk/dialog.rb: fixed typo.
+Sun Apr 3 17:16:33 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+
+ * win32/win32.{h,c} (rb_w32_fdopen): avoid warning on bcc32.
+ (backported from HEAD)
+
Sat Apr 2 23:38:54 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
* configure.in (CP, INSTALL): get rid of less portable options.
@@ -52687,8 +12284,8 @@ Sat Apr 2 23:38:54 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/mkmf.rb (configuration, create_makefile): correct configuration
variable.
- * wince/configure.bat, wince/setup.mak: add prefix, extstatic and
- rdoc options.
+ * {bcc32,win32,wince}/{Makefile.sub,setup.mak}: leave prefix empty in
+ config.status for backward compatibility. fixed: [ruby-core:04649]
* lib/mkmf.rb (create_makefile): ensure library directories get made
before copying libraries there.
@@ -52707,11 +12304,6 @@ Sat Apr 2 16:59:46 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tk/lib/tk/autoload.rb: add autoload entry 'TkDialogObj' and
'TkWarningObj'
-Sat Apr 2 13:23:17 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * hash.c (env_key): ENV.index is deprecated as well as Hash#index.
- use ENV.key instead. [ruby-dev:25974]
-
Sat Apr 2 02:19:11 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tk/lib/tk.rb (TkWindow.initialize): accept 'without_creating'
@@ -52728,39 +12320,12 @@ Thu Mar 31 22:23:51 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
* README.EXT, README.EXT.ja (Appendix C): utility functions.
-Thu Mar 31 14:08:43 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Thu Mar 31 14:15:44 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
* ext/openssl/ossl_engine.c (ossl_engine_s_load): should return
value. [ruby-dev:25971]
-Thu Mar 31 11:07:50 2005 Kouhei Sutou <kou@cozmixng.org>
-
- * lib/rss/parser.rb: @@setter -> @@setters.
-
- * lib/rss/parser.rb
- (RSS::BaseListener.register_uri)
- (RSS::BaseListener.uri_registered?)
- (RSS::BaseListener.install_get_text_element):
- swapped the first argument and the second argument.
-
- * lib/rss/taxonomy.rb: swapped the first argument and the second
- argument for RSS::BaseListener.install_get_text_element.
- * lib/rss/image.rb: ditto.
- * lib/rss/syndication.rb: ditto.
- * lib/rss/dublincore.rb: ditto.
- * lib/rss/parser.rb: ditto.
- * lib/rss/1.0.rb: ditto.
- * lib/rss/2.0.rb: ditto.
- * lib/rss/0.9.rb: ditto.
- * lib/rss/content.rb: ditto.
-
-Thu Mar 31 11:00:36 2005 Kouhei Sutou <kou@cozmixng.org>
-
- * lib/rss/parser.rb
- (RSS::BaseListener.install_setter)
- (RSS::BaseListener.register_uri): changed fallback way.
-
-Thu Mar 31 08:25:40 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Mar 31 08:25:50 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
* common.mk (RUBYOPT): clear for the environment RubyGems installed.
@@ -52774,10 +12339,21 @@ Thu Mar 31 06:00:20 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
error even if the specified engine could not be loaded. (Dynamic
engines don't have fixed name to load.)
+Thu Mar 31 00:18:27 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+
+ * win32/ifchange.bat, win32/rm.bat: backported from HEAD.
+
+Wed Mar 30 23:44:50 2005 Nobuyoshi Nakada <nobu.nokada@softhome.net>
+
+ * Makefile.in, */Makefile.sub, */configure.bat,
+ cygwin/GNUmakefile.in, common.mk, configure.in, ext/extmk.rb,
+ lib/mkmf.rb, instruby.rb, runruby.rb: backport extout.
+ [ruby-dev:25963]
+
Wed Mar 30 17:41:48 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
- * ext/tk/tcltklib.c: add TclTkIp#_create_console() method to create
- a Tcl/Tk's console window.
+ * ext/tcltklib/tcltklib.c: add TclTkIp#_create_console() method to
+ create a Tcl/Tk's console window.
* ext/tk/lib/multi-tk.rb: support TclTkIp#_create_console() method.
@@ -52791,12 +12367,12 @@ Wed Mar 30 17:41:48 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tk/sample/tkextlib/**: ditto.
-Tue Mar 29 22:20:49 2005 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+Tue Mar 29 22:11:56 2005 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
* test/rinda/test_rinda.rb: use DRbObject.new_with instead of reinit.
[ruby-dev:25961]
-Tue Mar 29 00:04:57 2005 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+Mon Mar 28 23:40:40 2005 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
* lib/drb/drb.rb: move method DRbObject#reinit to DRbObject.new_with.
extract method DRbObject.prepare_backtrace. add DRb.regist_server,
@@ -52805,23 +12381,15 @@ Tue Mar 29 00:04:57 2005 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
* lib/drb/gw.rb: ditto.
-Mon Mar 28 20:53:44 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/extmk.rb (extract_makefile): nothing to be removed when no file
- was deleted.
+Mon Mar 28 20:43:34 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/extmk.rb (extmake): restore srcdir.
+ * ext/syck/rubyext.c: get rid of warnings caused by a bug of VC.
Mon Mar 28 08:39:49 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ext/iconv/iconv.c (iconv_create): Iconv::Failure requires 3
arguments. (pointed out by NaHi)
-Sun Mar 27 00:56:58 2005 Minero Aoki <aamine@loveruby.net>
-
- * lib/fileutils.rb (remove_file): ignore Errno::E* if force option
- is set. [ruby-dev:25944]
-
Sat Mar 26 22:51:33 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tk/lib/tk.rb (_callback_entry_class?): add for checking whether
@@ -52877,26 +12445,31 @@ Thu Mar 24 23:10:44 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/mkmf.rb (check_sizeof): refine logging messages.
-Wed Mar 23 19:08:10 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Thu Mar 24 03:57:48 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
* lib/webrick/utils.rb (WEBrick::Utils.create_listeners):
- should raise ArgumentError if no port is specified.
- even if the specified port is 0, all TCPServers should be
- initialized with the port given to the first one.
+ initialized with the port given to the first one.
* lib/webrick/server.rb (WEBrick::GenericServer#initialize): if :Port
parameter is 0, it should be updated with the port number which
- ectually listened.
-
-Wed Mar 23 16:12:40 2005 Shugo Maeda <shugo@ruby-lang.org>
-
- * parse.y (primary): fix lineno of rescue and ensure.
+ actually listened.
-Wed Mar 23 00:39:05 2005 Shugo Maeda <shugo@ruby-lang.org>
+Wed Mar 23 00:35:10 2005 Shugo Maeda <shugo@ruby-lang.org>
* test/ruby/test_settracefunc.rb (test_event): added tests for
"class" and "end" and "raise".
+Tue Mar 22 22:40:18 2005 Shugo Maeda <shugo@ruby-lang.org>
+
+ * eval.c (rb_call0): check event_hooks instead of trace_func.
+
+Tue Mar 22 17:30:44 2005 Shugo Maeda <shugo@ruby-lang.org>
+
+ * eval.c (rb_add_event_hook): new function to add a hook function for
+ interpreter events. (backported form HEAD)
+
Sun Mar 20 22:51:19 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/mkmf.rb (mkmf_failed): check if Makefile is created without
@@ -52922,42 +12495,28 @@ Thu Mar 17 17:42:13 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
* struct.c (inspect_struct): ditto.
-Wed Mar 16 23:39:13 2005 Shugo Maeda <shugo@ruby-lang.org>
-
- * test/ruby/test_settracefunc.rb: added test for c-return.
-
-Wed Mar 16 22:57:43 2005 Shugo Maeda <shugo@ruby-lang.org>
+Wed Mar 16 23:36:02 2005 Shugo Maeda <shugo@ruby-lang.org>
* eval.c (rb_call0): call_cfunc() should be protected.
- * eval.c (rb_add_event_hook): use K&R style.
-
- * eval.c (rb_remove_event_hook): ditto.
+ * test/ruby/test_settracefunc.rb: added test for c-return.
-Wed Mar 16 22:03:15 2005 Shugo Maeda <shugo@ruby-lang.org>
+Wed Mar 16 22:20:25 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
- * eval.c (rb_add_event_hook): new function to add a hook function for
- interpreter events.
+ * object.c (str_to_id): fixed typo.
Wed Mar 16 18:08:32 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
* eval.c (rb_call0): reorganize "return" event post.
- * eval.c (return_jump): no need to post "return" event here.
-
Tue Mar 15 23:49:19 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ext/iconv/iconv.c (Init_iconv): InvalidEncoding also should include
Iconv::Failure.
-Tue Mar 15 23:12:36 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval.c (recursive_check, recursive_push): more restrictive check.
- fixed: [ruby-dev:25916]
+Tue Mar 15 16:38:11 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-Tue Mar 15 16:38:31 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tk/tkutil/tkutil.c (ary2list): give wrong arguments to hash2kv()
+ * ext/tk/tkutil.c (ary2list): give wrong arguments to hash2kv()
Mon Mar 14 19:39:33 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
@@ -52973,8 +12532,7 @@ Mon Mar 14 12:21:03 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
Mon Mar 14 08:14:56 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
- * object.c (str_to_id): raise ArgumentError for NUL containing
- strings.
+ * object.c (str_to_id): warn for NUL containing strings.
Mon Mar 14 00:13:49 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
@@ -52994,37 +12552,14 @@ Mon Mar 14 00:13:49 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tk/sample/demos-jp/tcolor: ditto.
-Sun Mar 13 22:19:17 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval.c (recursive_pop): raise TypeError instead of fatal error.
- fixed: [ruby-dev:25843]
-
-Sun Mar 13 10:09:17 2005 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+Sun Mar 13 10:04:17 2005 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
* test/rinda/test_rinda.rb: remove test_gc. [ruby-dev:25871]
-Sun Mar 13 02:32:54 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * ext/openssl/ossl_ssl.c (ossl_tmp_dh_callback): should get DH
- parameter from the current SSL object.
-
-Sun Mar 13 02:09:03 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * ext/openssl/ossl_pkey_dh.c (ossl_create_dh): fix typo.
- patch from IWATSUKI Hiroyuki. [ruby-dev:25867]
-
- * ext/openssl/ossl_ssl.c (ossl_tmp_dh_callback): ditto.
- (ossl_call_tmp_dh_callback): ditto
+Thu Mar 10 19:12:06 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-Fri Mar 11 03:24:59 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * parse.y (primary): wrong var node was set for NODE_LAMBDA.
- [ruby-core:04555]
-
-Thu Mar 10 19:10:29 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tk/tcltklib.c (lib_eventloop_ensure): mis-delete a timer handler
- when exit from a recursive called eventloop
+ * ext/tcltklib/tcltklib.c (lib_eventloop_ensure): mis-delete a timer
+ handler when exit from a recursive called eventloop
* ext/tk/lib/tk/timer.rb: new TkRTTimer class, which can works for a
realtime operation
@@ -53045,48 +12580,18 @@ Thu Mar 10 08:10:11 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
* re.c (make_regexp): need to free internal regexp structure when
compilation fails. [ruby-talk:133228]
-Thu Mar 10 01:08:20 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * parse.y (bv_decl): remove initialize rule from block local
- variable declaration.
-
-Wed Mar 9 23:55:34 2005 Tanaka Akira <akr@m17n.org>
-
- * lib/pp.rb (PP::PPMethods#guard_inspect_key): support
- __recursive_key__. [ruby-dev:25821]
-
-Wed Mar 9 19:42:21 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * ext/openssl/ossl_ssl.c: OpenSSL::SSL::SSLContexts suports callbacks:
- - SSLContext#client_cert_cb is a Proc. it is called when a client
- certificate is requested by a server and no certificate was yet
- set for the SSLContext. it must return an Array which includes
- OpenSSL::X509::Certificate and OpenSSL::PKey::RSA/DSA objects.
- - SSLContext#tmp_dh_callback is called in key exchange with DH
- algorithm. it must return an OpenSSL::PKey::DH object.
-
- * ext/openssl/ossl_ssl.c:
- (ossl_sslctx_set_ciphers): ignore the argument if it's nil.
- (ossl_start_ssl, ossl_ssl_write): call rb_sys_fail if errno isn't 0.
- [ruby-dev:25831]
-
- * ext/openssl/ossl_pkey.c
- (GetPrivPKeyPtr, ossl_pkey_sign): should call rb_funcall first.
- (DupPrivPKeyPtr): new function.
-
- * ext/openssl/ossl_pkey_dh.c: add default DH parameters.
+Wed Mar 9 20:25:58 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
- * ext/openssl/ossl_pkey.h: ditto.
+ * ext/openssl/ossl_ssl.c (ossl_start_ssl, ossl_ssl_write): call
+ rb_sys_fail if errno isn't 0. [ruby-dev:25831]
* ext/openssl/lib/openssl/cipher.rb: fix typo. [ruby-dev:24285]
-Wed Mar 9 18:09:51 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+Wed Mar 9 15:46:35 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
- * parse.y (gettable_gen): warns if VCALL name is used as
- out-of-scope block local variable. [EXPERIMENTAL]
-
- * parse.y (opt_bv_decl): add explicit block local variable
- declaration. raises error for name conflicts. [EXPERIMENTAL]
+ * lib/webrick/server.rb (WEBrick::GenericServer#start): should
+ restore @token if accept failure. suggested by Dominique Brezinski.
+ [ruby-core:04518]
Wed Mar 9 13:37:57 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
@@ -53099,10 +12604,9 @@ Tue Mar 8 18:16:55 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
sample supports to use a text widget as if it is a I/O stream (such
like as StringIO class).
-Tue Mar 8 13:39:25 2005 NAKAMURA Usaku <usa@ruby-lang.org>
+Tue Mar 8 13:54:40 2005 NAKAMURA Usaku <usa@ruby-lang.org>
- * ext/socket/mkconstants.rb: workaround for some of 4.4BSD-Lite
- derived OSs.
+ * ext/socket/socket.c: workaround for some of 4.4BSD-Lite derived OSs.
Tue Mar 8 12:36:17 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
@@ -53110,277 +12614,161 @@ Tue Mar 8 12:36:17 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
<sroberts@uniserve.com> for getsockopt and setsockopt is merged.
[ruby-doc:824]
-Tue Mar 8 10:48:53 2005 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * eval.c (rb_exec_recursive): declaration should precede statements
- before C99.
-
-Tue Mar 8 10:05:40 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * error.c (errno_missing): Errno.const_missing to allow references
- to SyscallError exceptions not defined on the platform.
- [ruby-core:04522]
-
- * error.c (Init_syserr): Errno::NOERROR(0) for fallback exception.
-
-Tue Mar 8 01:19:00 2005 NARUSE, Yui <naruse@ruby-lang.org>
+Tue Mar 8 01:27:00 2005 NARUSE, Yui <naruse@ruby-lang.org>
* ext/nkf/nkf-utf8/nkf.c: follow nkf 1.66
fixed: [ruby-dev:25828]
-Mon Mar 7 21:29:40 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * lib/webrick/server.rb (WEBrick::GenericServer#start): should
- restore @token if accept failure. suggested by Dominique Brezinski.
- [ruby-core:04518]
+Mon Mar 7 21:35:02 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
* sample/webrick/httpsd.rb: fix typo in comment. suggested by
Kazuhiko Shiozaki.
-Mon Mar 7 21:01:37 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval.c (rb_require_safe): get actual path string under safe level
- when requested. fixed: [ruby-dev:25815]
-
-Mon Mar 7 16:46:02 2005 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * ext/openssl/ossl_ssl.c (ossl_start_ssl, ossl_ssl_read,
- ossl_ssl_write): need to set errno on Win32 platform.
-
Mon Mar 7 14:55:43 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
* eval.c (block_pass): should not push unique number if a block is
not an orphan. [ruby-dev:25808]
-Mon Mar 7 14:13:23 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Wed Feb 16 02:55:21 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
- * ext/openssl/lib/openssl/buffering.rb (Buffering#initialize):
- should set @eof and @rbuffer.
-
-Mon Mar 7 10:28:00 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * object.c (inspect_obj): unintended space removal.
- [ruby-dev:25810]
-
- * eval.c (rb_exec_recursive): should not use NODE in disclosed
- context. [ruby-dev:25812]
-
- * io.c (rb_f_open): need not to check if to_open value is a
- T_FILE. [ruby-dev:25812]
-
-Mon Mar 7 01:21:01 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tk/tkutil/tkutil.c: follow the change of st.c (committed
- at Fri, 4 Mar 2005 15:47:47 +0900 by matz)
-
-Mon Mar 7 00:01:55 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tk/tcltklib.c: fail to call TclTkLib.mainloop when $SAFE==4
-
-Sun Mar 6 13:04:10 2005 Dee Zsombor <zsombor@ruby-lang.org>
-
- * misc/ruby-electric.el: added.
- * misc/Readme: updated.
-
-Sun Mar 6 11:47:10 2005 Sam Roberts <sroberts@uniserve.com>
-
- * lib/pp.rb: rdoced. [ruby-core:4490]
-
-Sun Mar 6 11:36:37 2005 Tanaka Akira <akr@m17n.org>
-
- * lib/pp.rb (File::Stat#pretty_print): Etc.getpwuid and Etc.getgrgid
- may return nil. [ruby-talk:129826]
- reported by Daniel Berger.
-
-Sun Mar 6 06:34:31 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * ext/openssl/ossl_ssl.c (ossl_start_ssl): should wait for that
- the underlying IO become readable or writable if the error was
- SSL_ERROR_WANT_READ or SSL_ERROR_WANT_WRITE. [ruby-dev:25795]
-
- * ext/openssl/ossl_ssl.c (ossl_ssl_read, ossl_ssl_write): ditto.
+ * ext/openssl/ossl_ssl.c (ossl_start_ssl, ossl_ssl_read,
+ ossl_ssl_write):
+ - need to set errno on Win32 platform.
+ - should call rb_sys_fail instead of rasing SSLError if
+ SSL_ERROR_SYSCALL occured.
+ - should wait for that the underlying IO become readable or
+ writable if the error was SSL_ERROR_WANT_READ or
+ SSL_ERROR_WANT_WRITE. [ruby-dev:25795]
* ext/openssl/lib/openssl/buffering.rb
+ (Buffering#initialize): should set @eof and @rbuffer.
+ (Buffering#fill_rbuff): should rescue Errno::EAGAIN.
(Buffering#consume_rbuf): pointless eof flag resetting is deleted.
(Buffering#read): should return an empty string if the specified
size is zero.
(Buffering#readpartial): new method.
(Buffering#readline): fix typo.
(Buffering#getc): return the first character of string correctly.
+ (Buffering#each): fix typo. suggested by Brian Ollenberger.
(Buffering#readchar): fix typo.
(Buffering#eof?): should read again it the input buffer is empty.
(Buffering#do_write): should rescue Errno::EAGAIN.
(Buffering#puts): use "\n" as the output field separator.
+ * ext/openssl/lib/openssl/ssl.rb: set non-blocking flag to the
+ underlying IO.
+
* ext/openssl/extconf.rb: get rid of GNUmakefile generation.
* text/openssl/test_pair.rb: test for IO like methods.
* test/ruby/ut_eof.rb: test about empty file.
-Sat Mar 5 17:48:31 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Mon Mar 7 10:22:06 2005 WATANABE Hirofumi <eban@ruby-lang.org>
- * dir.c (rb_glob): fixed mismatch of argument.
+ * lib/un.rb: should use OptionParser. (backported form HEAD)
- * dir.c (fnmatch): removed unnecessary code. (by string.c 1.219)
+Mon Mar 7 09:18:42 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
- * win32/win32.c (NtInitialize): ditto. (by numeric.c 1.117)
+ * string.c (rb_str_cmp_m): should not return false but nil.
+ fixed: [ruby-dev:25811]
-Sat Mar 5 16:50:00 2005 NARUSE, Yui <naruse@ruby-lang.org>
+Mon Mar 7 01:22:14 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
- * ext/nkf/nkf-utf8/nkf.c: follow nkf 1.65
+ * ext/tk/tkutil.c: remove the some codes which depend on the
+ difference between Ruby1.8 and 1.9, because st.c on Ruby1.9
+ was changed.
-Sat Mar 5 16:29:26 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Mon Mar 7 00:01:04 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
- * ext/tk/lib/multi-tk.rb: freeze callback-entry objects
-
- * ext/tk/lib/tkextlib/tile.rb: support tile-0.6
+ * ext/tcltklib/tcltklib.c: fail to call TclTkLib.mainloop when $SAFE==4
-Sat Mar 5 12:52:08 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun Mar 6 16:41:33 2005 Minero Aoki <aamine@loveruby.net>
- * lib/mkmf.rb (create_makefile): allow putting spaces between target
- and colon in depend file.
+ * lib/net/http.rb: HTTPHeader holds its header fields as an array
+ (backport from CVS HEAD rev 1.112-1.123). [ruby-list:40629]
-Sat Mar 5 02:41:00 2005 NAKAMURA Usaku <usa@ruby-lang.org>
+ * test/net/http/test_httpheader.rb: new file.
- * file.c (eaccess): workaround for VC++8 runtime.
-
- * win32/win32.c (ioinfo): VC++8 support.
-
-Fri Mar 4 19:39:55 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/rdoc/parsers/parse_c.rb (RDoc::C_Parser#do_includes): replace
- also locally defined modules.
-
- * ext/iconv/iconv.c: rdocified.
-
- * ext/strscan/strscan.c: moved misplaced rdoc.
-
-Fri Mar 4 16:11:20 2005 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * eval.c (rb_exec_recursive): matched the declaration to prototype.
-
- * ext/curses/curses.c: don't need to check HAVE_WCOLOR_SET excluding
- window_color_set().
+Sun Mar 6 11:47:10 2005 Sam Roberts <sroberts@uniserve.com>
- * ext/tk/tcltklib.c: fixed commit mistakes.
+ * lib/pp.rb: rdoced. [ruby-core:4490]
-Fri Mar 4 12:45:17 2005 Tilman Sauerbeck <tilman@code-monkey.de>
+Sun Mar 6 11:36:37 2005 Tanaka Akira <akr@m17n.org>
- * lib/rdoc/parsers/parse_c.rb: allow whitespace after function names.
- [ruby-core:4296]
+ * lib/pp.rb (File::Stat#pretty_print): Etc.getpwuid and Etc.getgrgid
+ may return nil. [ruby-talk:129826]
+ reported by Daniel Berger.
- * lib/rdoc/parsers/parse_simple.rb: adds support for private comments
- in the "simple" parser. [ruby-core:4301]
+Sat Mar 5 18:06:21 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-Fri Mar 4 12:45:17 2005 Charles Mills <cmills@freeshell.org>
+ * dir.c (fnmatch): removed unnecessary code. (ruby_1_8 didn't have
+ String#clear, so [ruby-dev:24749] didn't affect it)
- * lib/rdoc/parsers/parse_c.rb: adds support for constants
- (rb_define_const), accessors (rb_define_attr), and makes a
- couple fixes. [ruby-core:4307]
+ * win32/win32.c (NtInitialize): ditto. (by numeric.c 1.101.2.14)
-Fri Mar 4 12:45:17 2005 Florian Gross <florgro@gmail.com>
+Sat Mar 5 16:29:26 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
- * lib/rdoc/parsers/parse_rb.rb: Logic for def Builtin.method() end
- [ruby-core:4302]
+ * ext/tk/lib/multi-tk.rb: freeze callback-entry objects
-Fri Mar 4 12:45:17 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * ext/tk/lib/tkextlib/tile.rb: support tile-0.6
- * array.c: replace rb_protect_inspect() and rb_inspecting_p() by
- rb_exec_recursive() in eval.c.
+Fri Mar 4 19:39:28 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * eval.c (rb_exec_recursive): new function.
+ * lib/rdoc/parsers/parse_c.rb (RDoc::C_Parser#do_includes): replace
+ also locally defined modules.
- * array.c (rb_ary_join): use rb_exec_recursive().
+ * ext/iconv/iconv.c: backport Iconv::InvalidEncoding from CVS HEAD.
- * array.c (rb_ary_inspect, rb_ary_hash): ditto.
+ * ext/strscan/strscan.c: moved misplaced rdoc.
- * file.c (rb_file_join): ditto.
+Fri Mar 4 15:58:12 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
- * hash.c (rb_hash_inspect, rb_hash_to_s, rb_hash_hash): ditto.
+ * lib/cgi-lib.rb: add deprecation warning. [ruby-dev:25499]
+ getopts.rb, parsearg.rb, importenv.rb as well.
- * io.c (rb_io_puts): ditto.
+Fri Mar 4 11:17:06 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
- * object.c (rb_obj_inspect): ditto
+ * ext/tcltklib/tcltklib.c (ip_rbUpdateCommand): get rid of
+ warnings with Tcl/Tk 8.3 or former (backport from CVS_HEAD).
- * struct.c (rb_struct_inspect): ditto.
+ * ext/tcltklib/tcltklib.c (ip_rb_threadUpdateCommand): ditto.
Fri Mar 4 10:15:30 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
* lib/set.rb (SortedSet::setup): a hack to shut up warning.
[ruby-talk:132866]
-Fri Mar 4 09:37:12 2005 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * common.mk (install-nodoc, pre-install-doc, post-install-doc):
- fix some omissions.
-
-Fri Mar 4 08:09:12 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/time.rb (Time::strptime): add new function. inspired by
- [ruby-talk:132815].
-
- * lib/parsedate.rb (ParseDate::strptime): ditto.
-
Fri Mar 4 07:07:00 2005 NARUSE, Yui <naruse@ruby-lang.org>
* ext/nkf/nkf-utf8/nkf.c: follow nkf 1.63
-Thu Mar 3 23:24:00 2005 NARUSE, Yui <naruse@ruby-lang.org>
+Thu Mar 3 23:49:00 2005 NARUSE, Yui <naruse@ruby-lang.org>
* ext/nkf/nkf-utf8/nkf.c: follow nkf 1.62
-Thu Mar 3 18:47:18 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * {bcc32,win32,wince}/Makefile.sub (config.h): check if affected
- when makefiles are modified.
-
- * {bcc32,win32,wince}/Makefile.sub (config.status): add variables
- for tests.
-
- * win32/ifchange.bat: try to update a file only if modified.
-
- * win32/resource.rb: more descriptions.
-
- * common.mk: add {pre,post}-install targets.
-
- * instruby.rb (install?): install particular part.
-
- * bcc32/Makefile.sub (post-install-ext): remove debug information
- files after installation.
-
- * ext/tk/tcltklib.c (ip_rbUpdateCommand, ip_rb_threadUpdateCommand):
- get rid of warnings with Tcl/Tk 8.3 or former.
-
Thu Mar 3 11:49:51 2005 Kouhei Sutou <kou@cozmixng.org>
* sample/rss/tdiary_plugin/rss-recent.rb: added site information.
-Wed Mar 2 19:53:44 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/extmk.rb (parse_args): return false if nothing matched.
-
-Wed Mar 2 17:15:08 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Wed Mar 2 19:53:07 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/tk/tcltklib.c (lib_eventloop_core): fix typo
+ * ext/extmk.rb (parse_args): add DESTDIR only when not directed
+ already. fixed: [ruby-dev:25781]
-Wed Mar 2 16:59:50 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Wed Mar 2 17:14:18 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
- * eval.c (ruby_native_thread_kill): call pthread_kill() to send a
- signal to ruby's native thread
+ * ext/tcltklib/tcltklib.c (lib_eventloop_core): fix typo
- * ruby.h: add definition of ruby_native_thread_kill()
+Wed Mar 2 16:00:02 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
- * signal.c (sigsend_to_ruby_thread): send the signal to ruby's
- native thread ([ruby-dev:25744], [ruby-dev:25754]), and set
- signal mask to the current native thread
+ * ext/tcltklib/tcltklib.c: enforce thread-check and exception-handling
+ to avoid SEGV trouble.
+ [KNOWN BUG] When supports pthread and running multiple Tk
+ interpreters, an interrupt signal causes SEGV frequently. That
+ may be a trouble of Ruby's signal handler.
-Wed Mar 2 16:03:08 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tk/tcltklib.c: enforce thread-check and exception-handling to
- avoid SEGV trouble.
-
- * ext/tk/tkutil/tkutil.c: fix a bug on converting a SJIS string array
+ * ext/tk/tkutil/tkutil.c; fix a bug on converting a SJIS string array
to a Tcl's list string.
* ext/tk/tcltklib.c: wrap Tcl's original "namespace" command to
@@ -53422,58 +12810,17 @@ Wed Mar 2 16:03:08 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tk/sample/demos-*/widget: add entries of animation demos.
-Wed Mar 2 12:21:18 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval.c (rb_eval): [EXPERIMENTAL] NODE_LAMBDA implemented.
- [ruby-dev:25780]
-
- * node.h (NODE_LAMBDA): for literal Proc object.
-
- * parse.y (expr): interpret mere do...end block as proc object.
-
- * parse.y (primary): ditto, for brace block.
+Tue Mar 1 00:47:43 2005 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
-Tue Mar 1 21:16:54 2005 K.Kosako <sndgk393 AT ybb.ne.jp>
+ * test/rinda/test_rinda.rb: backport from CVS_HEAD. use
+ MockClock.sleep instead of Kernel.sleep [ruby-dev:25387]
- * regcomp.c (optimize_node_left): uninitialized member
- (OptEnv.backrefed_status) was used. [ruby-dev:25778]
-
-Tue Mar 1 16:50:37 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * regparse.c: move st_*_strend() functions from st.c. fixed some
- potential memory leaks.
-
-Tue Mar 1 00:40:35 2005 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+Tue Mar 1 00:34:24 2005 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
* lib/rinda/tuplespace.rb (Rinda::TupleSpace): improved keeper thread.
* test/rinda/test_rinda.rb: ditto.
-Mon Feb 28 23:10:13 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * ext/socket/socket.c (Init_socket): IPv6 is not supported although
- AF_INET6 is defined on bcc32. (rev1.108 again)
-
- * ext/socket/mkconstants.rb: ditto.
-
-Mon Feb 28 21:55:49 2005 K.Kosako <sndgk393 AT ybb.ne.jp>
-
- * ext/strscan/strscan.c (strscan_s_allocate):
- use onig_region_init().
-
- * ext/strscan/strscan.c (adjust_registers_to_matched):
- use onig_region_set().
-
-Mon Feb 28 15:12:06 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * ext/socket/socket.c (Init_socket): ported more Socket::Constants
- from ruby_1_8, and made it easy to add new constants.
- [ruby-dev:25771]
-
- * ext/socket/depend: ditto.
-
- * ext/socket/mkconstants.rb: ditto. (added)
-
Mon Feb 28 11:42:23 2005 Ian Macdonald <ian@caliban.org>
* exception error messages updated. [ruby-core:04497]
@@ -53484,27 +12831,6 @@ Mon Feb 28 09:03:09 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
constants. Patch from Sam Roberts <sroberts@uniserve.com>.
[ruby-core:04409]
-Sun Feb 27 05:55:38 2005 Minero Aoki <aamine@loveruby.net>
-
- * parse.y [ripper]: fix typo. [ruby-core:04494]
-
-Sat Feb 26 16:58:20 2005 K.Kosako <sndgk393 AT ybb.ne.jp>
-
- * parse.y, re.c, regex.h, LEGAL, ext/strscan/strscan.c:
- remove oniggnu.h (GNU regex API).
-
-Wed Feb 23 22:08:16 2005 Kazuo Saito <ksaito@uranus.dti.ne.jp>
-
- * st.c, st.h: imported additional file changes on
- Oniguruma 3.7.0.
-
-Wed Feb 23 21:45:29 2005 Kazuo Saito <ksaito@uranus.dti.ne.jp>
-
- * ascii.c, euc_jp.c, oniggnu.h, oniguruma.h, regcomp.c,
- regenc.c, regenc.h, regerror.c, regexec.c, regint.h,
- regparse.c, regparse.h, sjis.c, utf8.c: imported Oni Guruma
- 3.7.0.
-
Wed Feb 23 15:04:32 2005 akira yamada <akira@ruby-lang.org>
* lib/uri/generic.rb (split_userinfo): should split ":pass" into ""
@@ -53517,53 +12843,27 @@ Wed Feb 23 08:00:18 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
* array.c (rb_ary_unshift_m): ditto.
-Wed Feb 23 01:53:29 2005 Shugo Maeda <shugo@ruby-lang.org>
+Wed Feb 23 01:57:46 2005 Shugo Maeda <shugo@ruby-lang.org>
* lib/net/imap.rb (initialize): handle certs correctly. Thanks,
- NABEYA Kenichi.
-
-Wed Feb 23 00:37:34 2005 Kouhei Sutou <kou@cozmixng.org>
-
- * lib/mkmf.rb (mkmf_failed): fixed typo.
-
-Tue Feb 22 23:52:45 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ NABEYA Kenichi. (backported from CVS HEAD)
- * configure.in, lib/mkmf.rb: use simple commands if available.
+Tue Feb 22 07:25:18 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * mkconfig.rb: remove autoconf internal variables from rbconfig.rb.
+ * parse.y (parser_yylex): identfier after dot must not be a variable.
- * lib/mkmf.rb (create_makefile): substitute implicit rules in depend
- file.
-
- * {bcc32,win32,wince}/Makefile.sub (COMPILE_RULES, RULE_SUBST):
- include $(topdir) and $(hdrdir) to search path.
-
-Tue Feb 22 23:51:45 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/syck/rubyext.c: get rid of warnings caused by a bug of VC.
+Mon Feb 21 10:04:49 2005 NAKAMURA Usaku <usa@ruby-lang.org>
-Tue Feb 22 23:50:26 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * signal.c (ruby_signal, ruby_nativethread_signal): must be valid as
- expressions, not only statements.
-
-Tue Feb 22 12:54:13 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (rb_thread_start_0): update curr_thread before raising
- TAG_THREAD. [ruby-dev:25712]
-
-Tue Feb 22 07:24:57 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * {bcc32,win32,wince}/Makefile.sub (config.h): add fcntl.
- * parse.y (parser_yylex): identifier after dot must not be a variable.
+ * win32/win32.[ch] (fcntl): ditto.
-Mon Feb 21 18:31:12 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * win32/win32.c (rb_w32_connect): support nonblocking mode.
- * signal.c: Standard signal handlers ignore signals on non-Ruby native
- threads. When a handler is entried with ruby_signal() (like as the
- standard signal handlers), the handler for the signal is marked as
- it cannot accept non-Ruby native threads. If a handler can treat all
- signals on all native threads, please use ruby_nativethread_signal()
- to entry it.
+ * ext/socket/socket.c (wait_connectable, ruby_connect): support
+ nonblocking connect on various platforms.
+ all changes are backported from CVS HEAD. [ruby-core:3154],
+ [ruby-core:4364].
Sun Feb 20 00:48:48 2005 Tanaka Akira <akr@m17n.org>
@@ -53571,7 +12871,7 @@ Sun Feb 20 00:48:48 2005 Tanaka Akira <akr@m17n.org>
re-implemented according to RFC 1738.
reported by Guillaume Marcais. [ruby-talk:131650]
-Sat Feb 19 18:46:56 2005 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+Sat Feb 19 18:11:47 2005 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
* lib/drb/drb.rb (DRbObject#respond_to?): take two arguments.
[ruby-dev:25722]
@@ -53583,16 +12883,7 @@ Sat Feb 19 13:52:02 2005 Tanaka Akira <akr@m17n.org>
* lib/open-uri.rb: call OpenSSL::SSL::SSLSocket#post_connection_check
after connection is made.
-Sat Feb 19 13:31:28 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/extmk.rb (extract_makefile): remove no longer existing installed
- files.
-
- * lib/mkmf.rb (install_dirs): return installation directory list.
-
- * lib/mkmf.rb (create_makefile): reverted wrongly removed lines.
-
-Sat Feb 19 01:28:56 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Sat Feb 19 01:32:03 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* ext/bigdecimal/lib/bigdecimal/newton.rb: resolved LoadError.
[ruby-dev:25685]
@@ -53609,42 +12900,16 @@ Fri Feb 18 17:14:00 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
* lib/xmlrpc/parser.rb (XMLRPC::FaultException): make it subclass
of StandardError class, not Exception class. [ruby-core:04429]
-Fri Feb 18 04:06:41 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * parse.y (fcall_gen): lvar(arg) will be evaluated as
- lvar.call(arg) when lvar is a defined local variable. [new]
-
-Thu Feb 17 22:15:34 2005 K.Kosako <sndgk393 AT ybb.ne.jp>
-
- * ext/strscan/strscan.c: calls Oniguruma API directly.
-
-Thu Feb 17 21:53:12 2005 K.Kosako <sndgk393 AT ybb.ne.jp>
-
- * common.mk, LEGAL: remove reggnu.c.
-
-Thu Feb 17 21:53:12 2005 Kazuo Saito <ksaito@uranus.dti.ne.jp>
-
- * gc.c, re.c: now ruby calls Oniguruma API directly, bypassing
- GNU compatible APIs.
-
-Thu Feb 17 20:09:23 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Thu Feb 17 20:11:18 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* lib/drb/drb.rb (DRbServer.default_safe_level): fix typo.
-Thu Feb 17 20:09:23 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Feb 17 20:11:18 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
* test/digest/test_digest.rb: separate test case for each algorithms.
[ruby-dev:25412]
-Thu Feb 17 14:31:52 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * object.c (rb_class_initialize): call inherited method before
- calling initializing block.
-
- * eval.c (rb_thread_start_1): initialize newly pushed frame.
- fixed: [ruby-dev:25707]
-
-Thu Feb 17 13:46:00 2005 Nathaniel Talbott <ntalbott@ruby-lang.org>
+Thu Feb 17 11:54:00 2005 Nathaniel Talbott <ntalbott@ruby-lang.org>
* lib/test/unit/collector.rb (collect_file): now deletes paths added
to $LOAD_PATH instead of restoring it verbatim.
@@ -53662,43 +12927,38 @@ Thu Feb 17 04:21:47 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
* lib/open3.rb (Open3::popen3): $? should not be EXIT_FAILURE.
fixed: [ruby-core:04444]
-Thu Feb 17 00:31:21 2005 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
-
- * test/drb/test_drb.rb, ut_safe1.rb: port from 1.8
+Thu Feb 17 00:09:45 2005 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
-Thu Feb 17 00:02:27 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * test/drb/ignore_test_drb.rb: move TestDRbReusePort to new file
+ [ruby-dev:25238]
- * eval.c (is_defined): NODE_IASGN is an assignment.
+ * test/drb/test_drb.rb: add method DRbService.ext_service, move
+ TestDRbReusePort to new file [ruby-dev:25238]
-Wed Feb 16 23:54:14 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/drb/test_drb.rb: ditto.
- * eval.c (rb_thread_start_1): outer block variables wasn't linked to
- threads. fixed: [ruby-dev:25700]
+ * test/drb/test_drbssl.rb: ditto.
-Wed Feb 16 15:11:43 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * test/drb/test_drbunix.rb: ditto.
- * ext/openssl/lib/openssl/ssl.rb (OpenSSL::Nonblock#initialize):
- native win32 platform doesn't have F_GETFL.
+ * test/drb/ut_drb.rb: reduce sleep.
-Wed Feb 16 02:47:45 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Thu Feb 17 00:02:27 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
- * ext/openssl/ossl_ssl.c (ossl_ssl_read, ossl_ssl_write): should
- call rb_sys_fail instead of raising SSLError if SSL_ERROR_SYSCALL
- occurred.
+ * eval.c (is_defined): NODE_IASGN is an assignment.
- * ext/openssl/lib/openssl/buffering.rb (Buffering#fill_rbuff):
- should rescue Errno::EAGAIN.
+Wed Feb 16 23:34:30 2005 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
- * ext/openssl/lib/openssl/buffering.rb (Buffering#each): fix typo.
- suggested by Brian Ollenberger.
+ * lib/drb/drb.rb: add lazy stop_service. ([druby-ja:109])
- * ext/openssl/lib/openssl/ssl.rb: set non-blocking flag to the
- underlying IO.
+ * lib/drb/extserv.rb: ditto.
-Tue Feb 15 22:14:34 2005 sheepman <sheepman@tcn.zaq.ne.jp>
+Wed Feb 16 17:07:57 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
- * ext/readline/readline.c (Readline.readline): use rl_outstream
- and rl_instream. [ruby-dev:25699]
+ * ext/tk/tkutil.c: Follow the change of st.c (st_foreach)
+ [ruby-list:40623].
+ Sometimes mis-convert from a Ruby's Array of SJIS Strings, which
+ includes some kind of SJIS characters, to a Tcl's UTF8 list string.
Mon Feb 14 23:58:17 2005 Kouhei Sutou <kou@cozmixng.org>
@@ -53708,14 +12968,13 @@ Mon Feb 14 23:58:17 2005 Kouhei Sutou <kou@cozmixng.org>
Mon Feb 14 13:12:38 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
* ext/openssl/lib/openssl/ssl.rb
- (OpenSSL::SSL::SSLSocket#post_connection_check): new method.
+ (OpenSSL::SSL::SSLSocket#post_connection_check): new method.
-Mon Feb 14 00:10:17 2005 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+Mon Feb 14 00:40:49 2005 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
- * lib/drb/drb.rb (DRbServer): add default_safe_level, safe_level,
- config[:safe_level] ([druby-ja:120])
+ * lib/drb/drb.rb (InvokeMethod.perform): pass DRb info to sub thread.
- * test/drb/test_drb.rb, ut_eval.rb, ut_safe1.rb: ditto.
+ * test/drb/test_drb.rb (test_01_safe1_safe4_eval): fix test case.
Sun Feb 13 23:13:46 2005 Kouhei Sutou <kou@cozmixng.org>
@@ -53728,43 +12987,22 @@ Sun Feb 13 23:13:46 2005 Kouhei Sutou <kou@cozmixng.org>
* test/rss/: added tests for the convenient methods.
-Sun Feb 13 23:12:47 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun Feb 13 22:43:03 2005 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+
+ * lib/drb/drb.rb (DRbServer): add default_safe_level, safe_level,
+ config[:safe_level] ([druby-ja:120])
- * eval.c (rb_thread_start_0): restore prot_tag before rewinding.
+ * test/drb/test_drb.rb, ut_eval.rb, ut_safe1.rb: ditto.
Sun Feb 13 16:56:52 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
* lib/webrick/cgi.rb (WEBrick::CGI.start): should set reason-phrase
to the value of status header field. ([ruby-dev:40617])
-Sun Feb 13 11:38:40 2005 Kazuo Saito <ksaito@uranus.dti.ne.jp>
-
- * regparse.c (type_cclass_hash): (Thanks Nobu) fixed
- overrun. ([ruby-dev:25676]).
-
-Sun Feb 13 10:53:08 2005 Kazuo Saito <ksaito@uranus.dti.ne.jp>
-
- * oniggnu.h, oniguruma.h, regcomp.c, st.c: imported
- Oni Guruma 3.6.0.
-
-Sun Feb 13 01:33:19 2005 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+Sun Feb 13 00:52:33 2005 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
* lib/erb.rb (ERB::Util.h, u): make it module_function.
-Sat Feb 12 22:17:11 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval.c (TAG_THREAD): to start a new thread.
-
- * eval.c (ruby_init, ruby_options, ruby_cleanup, rb_protect,
- rb_load_protect, rb_thread_start_0): make thread anchor.
-
- * eval.c (proc_alloc): clone proc object if klass is not Proc or
- created in different thread.
-
- * eval.c (rb_block_pass): call a function with a block. [new]
-
- * eval.c (rb_f_throw): raise NameError in main thread.
-
Sat Feb 12 17:29:19 2005 Tanaka Akira <akr@m17n.org>
* lib/open-uri.rb (OpenURI.open_loop): send authentication only for
@@ -53774,10 +13012,6 @@ Sat Feb 12 15:07:23 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
* random.c (rand_init): suppress warning.
-Sat Feb 12 14:10:24 2005 Tanaka Akira <akr@m17n.org>
-
- * lib/open-uri.rb (OpenURI.open_http): reject userinfo explicitly.
-
Sat Feb 12 13:54:03 2005 Tanaka Akira <akr@m17n.org>
* lib/open-uri.rb: support https if the platform provides CA
@@ -53785,10 +13019,10 @@ Sat Feb 12 13:54:03 2005 Tanaka Akira <akr@m17n.org>
Sat Feb 12 06:18:28 2005 URABE Shyouhei <shyouhei@ice.uec.ac.jp>
- * ext/etc/etc.c (Init_etc): sGroup needs HAVE_ST_GR_PASSWD check
+ * ext/etc/etc.c (Init_etc): sGroup needs HAVE_ST_GR_PASSWD check.
[ruby-dev:25675]
-Fri Feb 11 17:37:50 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Fri Feb 11 17:40:42 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
* ext/openssl/ossl_x509store.c (ossl_x509store_set_default_paths):
new method OpenSSL::X509::Store#set_default_paths.
@@ -53810,108 +13044,68 @@ Fri Feb 11 04:54:13 2005 Tilman Sauerbeck <tilman@code-monkey.de>
* lib/rdoc/generators/ri_generator.rb: ditto.
-Thu Feb 10 13:52:42 2005 NAKAMURA Usaku <usa@ruby-lang.org>
+Thu Feb 10 11:14:17 2005 NAKAMURA Usaku <usa@ruby-lang.org>
- * configure.in, win32/Makefile.sub (LIBS, COMMON_HEADERS): use
- winsock2 on mswin32/mingw.
+ * win32/Makefile.sub (COMMON_HEADERS): shouldn't include winsock2.h.
- * ext/socket/extconf.rb: ditto.
+ * ext/socket/extconf.rb (sockaddr_storage): remove workaround for
+ mswin32.
- * win32/win32.c (StartSockets): ditto.
+Thu Feb 10 10:29:16 2005 NAKAMURA Usaku <usa@ruby-lang.org>
- * win32/win32.h: ditto.
-
-Thu Feb 10 12:09:16 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/extmk.rb (extract_makefile): default to true if not compiled
- previously.
-
- * ext/extmk.rb (extmake): create dummy makefile if extconf failed.
-
-Thu Feb 10 12:07:10 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * win32/win32.c (init_stdhandle): assign standard file handles.
-
- * bcc32/Makefile.sub (COMMON_LIBS): add libraries included in
- import32.lib.
-
- * lib/mkmf.rb (create_makefile): restrict prefixing with srcdir to
- rule lines, add search path to implicit rules, and set Borland make
- special macros for search path.
-
- * win32/win32.c, win32/win32.h (read): avoid a BCC runtime bug.
+ * ext/curses/curses.c: don't need to check HAVE_WCOLOR_SET excluding
+ window_color_set().
Thu Feb 10 00:47:25 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
* struct.c (make_struct): fixed: [ruby-core:04402]
-Wed Feb 9 16:33:05 2005 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * ext/socket/socket.c (wait_connectable): fixed wrong condition.
-
-Wed Feb 9 14:42:28 2005 URABE Shyouhei <shyouhei@ice.uec.ac.jp>
-
- * eval.c (scope_dup): add volatile not to optimize tbl.
-
-Wed Feb 9 10:02:02 2005 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * ext/tk/make-tkutil, ext/tk/tkutil/subconf.rb: no longer used.
-
- * ext/tk/tkutil/extconf.rb: need to compile tkutil. [ruby-dev:25607]
-
Wed Feb 9 08:07:08 2005 Paul Duncan <pabs@pablotron.org>
* ext/curses/curses.c (window_color_set): [ruby-core:04393]
-Tue Feb 8 23:48:36 2005 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+Tue Feb 8 23:51:47 2005 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
* lib/drb/drb.rb: reject :instance_eval, :class_eval, :module_eval
[druby-ja:117]
-Tue Feb 8 22:38:28 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * keywords, parse.y: separate EXPR_VALUE from EXPR_BEG.
- fixed: [ruby-core:04310], [ruby-core:04368]
-
Tue Feb 8 13:06:12 2005 Sam Roberts <sroberts@uniserve.com>
* ext/socket/socket.c (Init_socket): SO_REUSEPORT added.
[ruby-talk:130092]
+Tue Feb 8 09:30:01 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * lib/cgi.rb (CGI::Cookie): [ruby-talk:130040]
+
Tue Feb 8 00:19:02 2005 Tanaka Akira <akr@m17n.org>
* lib/resolv.rb (Resolv::DNS::Name#subdomain_of?): new method.
(Resolv::DNS::Name#inspect): ditto.
Suggested by Sam Roberts. [ruby-talk:129086]
-Mon Feb 7 23:14:11 2005 Tanaka Akira <akr@m17n.org>
-
- * io.c (io_getc): flush rb_stdout before read from stdin, which is
- connected to a tty. [ruby-core:4378]
-
- * rubyio.h (FMODE_TTY): renamed from FMODE_LINEBUF.
-
Mon Feb 7 10:06:30 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
* object.c: [ruby-doc:818]
-Mon Feb 7 02:13:05 2005 NAKAMURA Usaku <usa@ruby-lang.org>
+Mon Feb 7 01:56:20 2005 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * instruby.rb, rubytest.rb (srcdir): no longer embed srcdir into
+ rbconfig.rb. (backported from CVS HEAD)
* ext/socket/extconf.rb (sockaddr_storage): winsock2.h have the
definition of struct sockaddr_storage, but socket.c doesn't
include it because this version of ruby still has binary level
compatibility with winsock1.
-Mon Feb 7 01:22:50 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/mkmf.rb (create_makefile): should support header files in
+ depend file.
- * ext/extmk.rb (extract_makefile): extract previously collected
- informations from existing Makefile.
+Mon Feb 7 01:21:50 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ext/socket/extconf.rb: check if getaddrinfo() works fine only when
wide-getaddrinfo option is not given. fixed: [ruby-dev:25422]
- * ext/tk/extconf.rb: separate tkutil configuration.
-
* lib/mkmf.rb ($extmk): check if under ext directory.
* lib/mkmf.rb (Logging.postpone): allow recursive operation.
@@ -53928,25 +13122,31 @@ Mon Feb 7 01:22:50 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/mkmf.rb (dir_config): accept arrays of directory names as
default values.
- * lib/mkmf.rb (with_cppflags, with_cflags, with_ldflags): keep flags
- modified if the block returned true.
+ * mkconfig.rb: no longer embed srcdir and compile_dir into
+ rbconfig.rb.
-Sun Feb 6 19:20:05 2005 NAKAMURA Usaku <usa@ruby-lang.org>
+ * lib/mkmf.rb (create_makefile): fix unbalanced parens.
+
+Sun Feb 6 19:23:01 2005 NAKAMURA Usaku <usa@ruby-lang.org>
* eval.c (stack_extend): add prototype because VC++8 doesn't
accept __declspec(noinline) with K&R style function definitions.
+ (backported from CVS HEAD)
-Sun Feb 6 13:56:19 2005 Tadayoshi Funaba <tadf@dotrb.org>
+Sun Feb 6 14:14:26 2005 Tadayoshi Funaba <tadf@dotrb.org>
* lib/date.rb (new_with_hash): changed messages of exception.
* lib/date/format.rb (str[fp]time): undocumented conversion
specifications %[1-3] are now deprecated.
-Sun Feb 6 11:27:37 2005 Tanaka Akira <akr@m17n.org>
+Sun Feb 6 12:20:11 2005 Akinori MUSHA <knu@iDaemons.org>
+
+ * bignum.c (rb_big2ulong_pack): One too many arguments are passed
+ to big2ulong().
- * ext/dl/dl.c (Init_dl): function declaration should precede
- statements before C99.
+ * re.c (rb_reg_init_copy, rb_reg_initialize_m): One too many
+ arguments are passed to rb_reg_initialize().
Sun Feb 6 03:24:20 2005 Tanaka Akira <akr@m17n.org>
@@ -53958,28 +13158,7 @@ Sun Feb 6 03:24:20 2005 Tanaka Akira <akr@m17n.org>
(Resolv::DNS::Message::MessageDecoder#get_string_list): ditto.
based on [ruby-talk:129732] by Sam Roberts.
-Sat Feb 5 02:24:06 2005 Minero Aoki <aamine@loveruby.net>
-
- * test/ripper/test_scanner_events.rb: fix test.
-
-Fri Feb 4 18:44:35 2005 Minero Aoki <aamine@loveruby.net>
-
- * ext/ripper/lib/ripper/lexer.rb: last Lexer fix was incomplete;
- test all green.
-
-Fri Feb 4 15:57:06 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * parse.y (open_args): fix too verbose warnings for the space
- before argument parentheses. [ruby-dev:25492]
-
- * parse.y (parser_yylex): ditto.
-
-Fri Feb 4 14:33:25 2005 Minero Aoki <aamine@loveruby.net>
-
- * ext/ripper/lib/ripper/filter.rb: ripper/tokenizer ->
- ripper/lexer. [ruby-dev:25632]
-
-Fri Feb 4 00:24:15 2005 Kouhei Sutou <kou@cozmixng.org>
+Fri Feb 4 00:30:45 2005 Kouhei Sutou <kou@cozmixng.org>
* lib/rss: supported Image module.
http://web.resource.org/rss/1.0/modules/image/
@@ -53992,19 +13171,6 @@ Thu Feb 3 23:42:36 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ext/stringio/stringio.c (strio_extend, strio_putc): fill with zero
extended portion. [ruby-dev:25626]
-Thu Feb 3 16:12:57 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * parse.y (parser_yylex): the first expression in the parentheses
- should not be a command. [ruby-dev:25492]
-
-Thu Feb 3 03:31:20 2005 NARUSE, Yui <naruse@ruby-lang.org>
-
- * ext/nkf/nkf-utf8/nkf.c: follow original v 1.57
-
- * ext/nkf/nkf-utf8/utf8tbl.c: follow original v 1.8
-
- * ext/nkf/nkf-utf8/config.h: follow original v 1.7
-
Wed Feb 2 23:52:53 2005 sheepman <sheepman@tcn.zaq.ne.jp>
* ext/stringio/stringio.c (strio_truncate): should MEMZERO an extended
@@ -54024,49 +13190,18 @@ Wed Feb 2 21:56:01 2005 Kouhei Sutou <kou@cozmixng.org>
* lib/rss/trackback.rb: ditto.
-Wed Feb 2 03:30:58 2005 Minero Aoki <aamine@loveruby.net>
-
- * ext/ripper/lib/ripper/tokenizer.rb -> lexer.rb.
-
- * ext/ripper/lib/ripper/lexer.rb: new method Ripper.slice.
- [experimental]
-
- * ext/ripper/lib/ripper/sexp.rb: new file. [experimental]
-
- * ext/ripper/lib/ripper.rb: require ripper/lexer and ripper/sexp.
-
-Tue Feb 1 21:49:24 2005 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+Tue Feb 1 22:48:48 2005 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
* lib/drb/drb.rb (DRb::DRbObject#respond_to?): check marshal_dump and
_dump.
Tue Feb 1 00:20:23 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * Makefile.in, configure.in: made EXTOUT configurable.
-
- * ext/extmk.rb (extmake), lib/mkmf.rb: keep topdir as relative style.
-
- * lib/mkmf.rb: make extensions in depth order. [ruby-dev:25522]
-
* configure.in (aix): fix linker flags on AIX. [ruby-talk:125460]
-Mon Jan 31 13:16:39 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tk/extconf.rb: add tkutil configuration step (remove old schema)
-
- * ext/tk/depend: remove the information of tkutil
-
- * ext/tk/make-tkutil: sub-part of Makefile to compile tkutil
-
- * ext/tk/tkutil/tkutil.c: move tkutil.c to subdirectory
+Mon Jan 31 13:33:21 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
- * ext/tk/tkutil/subconf.rb: configuration file for tkutil.c
-
- * ext/tk/tkutil/depend: ditto
-
-Mon Jan 31 13:13:35 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tk/tcltklib.c: add invalid namespace check
+ * ext/tcltklib/tcltklib.c: add invalid namespace check
* ext/tk/lib/multi-tk.rb: add invalid_namespace? method
@@ -54076,22 +13211,11 @@ Mon Jan 31 10:29:18 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
* lib/irb/context.rb (IRB::Context::initialize): [ruby-core:04330]
-Mon Jan 31 09:44:03 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * object.c (Init_Object): remove Object#type. [ruby-core:04335]
-
Sat Jan 29 09:42:12 2005 Sam Roberts <sroberts@uniserve.com>
* lib/resolv.rb (Resolv::DNS::Resource::IN::SRV): Added RFC2782 SRV
resource record for specifying location of services.
-Sat Jan 29 00:10:33 2005 Kazuo Saito <ksaito@uranus.dti.ne.jp>
-
- * ascii.c, euc_jp.c, hash.c, oniggnu.h, oniguruma.h, regcomp.c,
- regenc.c, regenc.h, regerror.c, regexec.c, reggnu.c, regint.h,
- regparse.c, regparse.h, sjis.c, st.c, st.h, utf8.c: imported
- Oni Guruma 3.5.4.
-
Fri Jan 28 17:16:55 2005 Tanaka Akira <akr@m17n.org>
* lib/resolv.rb (Resolv::DNS::Config.parse_resolv_conf):
@@ -54101,60 +13225,33 @@ Fri Jan 28 17:16:55 2005 Tanaka Akira <akr@m17n.org>
(Resolv::DNS::Config#lazy_initialize): ditto.
Suggested by Sam Roberts.
-Thu Jan 27 17:15:03 2005 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * ext/tk/extconf.rb: support new tk scheme on bccwin32.
- fixed: [ruby-dev:25546]
-
Thu Jan 27 13:18:03 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
* st.c (st_foreach): report success/failure by return value.
[ruby-Bugs-1396]
-Thu Jan 27 00:12:19 2005 Minero Aoki <aamine@loveruby.net>
-
- * test/fileutils/test_fileutils.rb (setup): support BSD style
- directory group inheritance (again).
+Thu Jan 27 00:15:29 2005 Minero Aoki <aamine@loveruby.net>
-Thu Jan 27 00:02:40 2005 Minero Aoki <aamine@loveruby.net>
-
- * test/fileutils/test_fileutils.rb (setup): support BSD style
- directory group inheritance. [ruby-dev:25440]
+ * test/fileutils/test_fileutils.rb (setup): support BSD-style
+ directory group inheritance. (backport from HEAD, rev 1.32)
* test/fileutils/fileasserts.rb (assert_same_entry): show entry
- difference.
-
-Wed Jan 26 17:12:50 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * parse.y: forgot to initialize parser struct. [ruby-dev:25492]
-
- * parse.y (parser_yylex): no tLABEL on EXPR_BEG.
- [ruby-talk:127711]
-
-Wed Jan 26 14:12:58 2005 NAKAMURA Usaku <usa@ruby-lang.org>
+ difference. (backport from HEAD, rev 1.4)
- * ext/Setup*: remove tcltklib.
+Wed Jan 26 23:09:11 2005 Minero Aoki <aamine@loveruby.net>
-Wed Jan 26 12:45:16 2005 NAKAMURA Usaku <usa@ruby-lang.org>
+ * lib/net/protocol.rb (WriteAdapter#puts): should append \n, not
+ prepend. [ruby-talk:128302] (backport from HEAD, rev 1.75)
- * ext/tk/extconf.rb: support new tk scheme on mswin32.
- fixed: [ruby-dev:25535]
-
-Wed Jan 26 10:45:19 2005 NAKAMURA Usaku <usa@ruby-lang.org>
+Wed Jan 26 10:51:50 2005 NAKAMURA Usaku <usa@ruby-lang.org>
* win32/win32.c (flock_winnt, flock_win95): unlock file even if
- LOCK_NB is specified.
-
-Tue Jan 25 23:10:48 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tk: merge tcltklib for Ruby/Tk installation control
+ LOCK_NB is specified. (backported from CVS HEAD)
- * ext/tcltklib: remove
+Tue Jan 25 17:11:51 2005 NAKAMURA Usaku <usa@ruby-lang.org>
-Tue Jan 25 17:05:15 2005 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * ruby.c (proc_options): correct -T option in RUBYOPT.
- fixed: [ruby-dev:25512]
+ * ruby.c (proc_options): correct -T option in RUBYOPT. (backported
+ from CVS HEAD)
Tue Jan 25 14:05:52 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
@@ -54193,17 +13290,31 @@ Tue Jan 25 14:05:52 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tk/sample/tkHTML/ss.rb: local variable scope bug fix
[ruby-dev:25479]
-Mon Jan 24 16:00:53 2005 NARUSE, Yui <naruse@ruby-lang.org>
+Mon Jan 24 15:44:25 2005 Tilman Sauerbeck <tilman@code-monkey.de>
- * ext/nkf/lib/kconv.rb (guess_old): not use NKF.guess_old
- but NKF.guess1. fixed: [ruby-dev:25491]
+ * lib/rdoc/parsers/parse_c.rb: allow whitespace after function names.
+ [ruby-core:4296]
+
+ * lib/rdoc/parsers/parse_simple.rb: adds support for private comments
+ in the "simple" parser. [ruby-core:4301]
+
+Mon Jan 24 15:44:25 2005 Charles Mills <cmills@freeshell.org>
+
+ * lib/rdoc/parsers/parse_c.rb: adds support for constants
+ (rb_define_const), accessors (rb_define_attr), and makes a
+ couple fixes. [ruby-core:4307]
+
+Mon Jan 24 15:44:25 2005 Florian Gro <florgro@gmail.com>
+
+ * lib/rdoc/parsers/parse_rb.rb: Logic for def Builtin.method() end
+ [ruby-core:4302]
Mon Jan 24 15:44:25 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
* document updates - [ruby-core:04296], [ruby-core:04301],
[ruby-core:04302], [ruby-core:04307]
-Sun Jan 23 12:38:01 2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+Sun Jan 23 12:41:16 2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
* lib/soap/wsdlDriver.rb: from 1.5.3-ruby1.8.2, operation which has
capitalized name (such as KeywordSearchRequest in AWS) is defined as
@@ -54219,62 +13330,65 @@ Sun Jan 23 05:24:42 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
* ext/openssl/ossl_ocsp.c (ossl_ocspreq_to_der): should call
GetOCSPReq at first.
-Sat Jan 22 22:59:08 2005 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+Sat Jan 22 23:09:47 2005 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
* lib/drb/ssl.rb (accept): rescue SSLError. [druby-ja:110]
-Sat Jan 22 22:27:28 2005 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+Sat Jan 22 22:35:03 2005 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
* lib/drb/unix.rb: fail if UNIXFileOwner is set. [druby-ja:111]
+Fri Jan 21 23:58:42 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * ext/stringio/stringio.c (strio_set_pos): clear EOF flag.
+ [ruby-talk:127511]
+
Fri Jan 21 20:07:02 2005 Tanaka Akira <akr@m17n.org>
* lib/resolv.rb (Resolv::DNS::Config.resolv): don't raise ResolvError.
reported by Sam Roberts. [ruby-talk:127133]
-Fri Jan 21 17:09:44 2005 Shugo Maeda <shugo@ruby-lang.org>
-
- * lib/net/imap.rb (decode_utf7): use pack("U*") to encode UTF-8.
-
- * lib/net/imap.rb (encode_utf7): use unpack("U*") to decode UTF-8.
-
- * test/net/imap/test_imap.rb: added tests for Net::IMAP.
-
Fri Jan 21 16:58:10 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
* dir.c (rb_push_glob): should work for NUL delimited patterns.
- * dir.c (rb_glob2): should aware of offset in the pattern.
-
Fri Jan 21 13:58:37 2005 Shugo Maeda <shugo@ruby-lang.org>
* lib/net/imap.rb (u8tou16): fixed typo. fixed: [ruby-list:40546]
+ (backported from CVS HEAD)
+
+Fri Jan 21 09:30:16 2005 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * rubyio.h (rb_eof_error): should mark as NORETURN. (backported
+ from CVS HEAD)
-Fri Jan 21 00:37:09 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Fri Jan 21 00:31:36 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* ext/syck/rubyext.c (syck_parser_bufsize_set): avoid VC++ warning
"local variable 'size' used without having been initialized".
+Thu Jan 20 19:03:24 2005 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * ext/extmk.rb (extmake): shouldn't set $extflags on mswin32.
+
+ * win32/Makefile.sub (LIBRUBY_SO): should use $DLDOBJS instead of
+ $EXTOBJS.
+ fixed: [ruby-core:04290] (backported from CVS HEAD)
+
Thu Jan 20 11:42:02 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
* string.c (rb_str_new4): should propagate taintedness.
- * env.h: rename member names in struct FRAME; last_func -> callee,
- orig_func -> this_func, last_class -> this_class.
-
* struct.c (rb_struct_set): use original method name, not callee
name, to retrieve member slot. [ruby-core:04268]
* time.c (time_strftime): protect from format modification from GC
finalizers.
-Thu Jan 20 02:01:10 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * object.c (Init_Object): remove rb_obj_id_obsolete()
-
-Wed Jan 19 18:02:19 2005 NAKAMURA Usaku <usa@ruby-lang.org>
+Wed Jan 19 18:06:40 2005 NAKAMURA Usaku <usa@ruby-lang.org>
* lib/ipaddr.rb (to_s, test_to_s): too many colons with some cases.
+ (backported from CVS HEAD)
Wed Jan 19 01:16:30 2005 Tanaka Akira <akr@m17n.org>
@@ -54282,6 +13396,32 @@ Wed Jan 19 01:16:30 2005 Tanaka Akira <akr@m17n.org>
domain and search directive without an argument.
reported by Sam Roberts. [ruby-talk:126781]
+Tue Jan 18 15:03:05 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
+
+ * lib/webrick/ssl.rb (WEBrick::Config::SSL): the default value
+ of :SSLEnable is false.
+
+ * lib/webrick/server.rb (WEBrick::Daemon.start): prepared stdio
+ don't allow changing its mode.
+
+ * lib/webrick/httpproxy.rb (WEBrick::HTTPProxyServer#proxy_service):
+ should delete trailing LF from the result of pack("m*").
+
+ * lib/webrick/httpproxy.rb (WEBrick::HTTPProxyServer#proxy_connect):
+ - should delete trailing LF from the result of pack("m*").
+ - clear Request-Line not to send the response by HTTPServer#run.
+
+ * lib/webrick/httputils (WEBrick::HTTPUtils.parse_qvalues):
+ refine regexp (and change the name of a local variable).
+
+ * lib/webrick/httputils.rb (WEBrick::HTTPUtils#escape_path): add
+ new method to escape URI path component.
+
+ * lib/webrick/cgi.rb (WEBrick::CGI::Socket#request_line): should
+ escape SCRIPT_NAME and PATH_INFO before being parsed as a URI.
+
+ * test/webrick/*, sample/webrick/httpproxy.rb: add new file.
+
Mon Jan 17 23:33:46 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
* configure.in (aix): fix typo. [ruby-talk:126401]
@@ -54310,63 +13450,48 @@ Sat Jan 15 14:57:22 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ruby.c (proc_options): ignore trailing CRs at the end of short
options as well as long options. fixed: [ruby-core:04232]
-Sat Jan 15 13:44:22 2005 Kouhei Sutou <kou@cozmixng.org>
+Sat Jan 15 13:35:16 2005 Kouhei Sutou <kou@cozmixng.org>
* lib/rss/rss.rb (RSS::VERSION): 0.1.2 -> 0.1.3.
* lib/rss/rss.rb: accept inheritance. [ruby-talk:126104]
-Wed Jan 12 12:29:28 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (rb_mod_define_method): incomplete subclass check.
- [ruby-dev:25464]
+Thu Jan 13 04:48:53 2005 Tanaka Akira <akr@m17n.org>
- * class.c (rb_make_metaclass): class of metaclasses should be
- plain Class. [ruby-list:40524]
+ * io.c (io_fread): don't warn nonblocking behavior by default.
-Tue Jan 11 20:58:52 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Jan 12 00:36:29 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * io.c (remain_size): use buffered data instead of unreading to avoid
- inconsistency of text mode. fixed: [ruby-dev:25446]
+ * object.c (rb_class_superclass): superclass of singleton class also
+ should be a singleton class. fixed: [ruby-list:40519]
-Tue Jan 11 09:37:53 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Tue Jan 11 09:44:40 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* numeric.c (Init_Numeric): turn off floating point exceptions
on bcc32. "1e300".to_f had crashed by overflow.
-Mon Jan 10 15:28:51 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Tue Jan 11 03:10:10 2005 Minero Aoki <aamine@loveruby.net>
- * lib/webrick/cgi.rb (WEBrick::CGI::Socket#request_line): should
- escape SCRIPT_NAME and PATH_INFO before being parsed as a URI.
-
- * lib/webrick/httputils.rb (WEBrick::HTTPUtils#escape_path): add
- new method to escape URI path component.
+ * lib/fileutils.rb (copy_entry): could not copy symbolic link.
+ [ruby-talk:125733]
- * lib/webrick/ssl.rb (WEBrick::Config::SSL): the default value
- of :SSLEnable is false.
+ * lib/fileutils.rb (copy_stream): use read/write instead of
+ sysread/syswrite.
- * test/webrick/{test_cgi.rb,webrick.cgi}: new file.
+Mon Jan 10 23:08:15 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * test/webrick/utils.rb: require "webrick/https.h".
+ * variable.c (rb_autoload): hide internal data from ruby level.
+ fixed: [ruby-dev:25435], [ruby-list:40498]
Mon Jan 10 01:22:55 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
* gc.c (rb_data_object_alloc): klass may be NULL.
[ruby-list:40498]
-Sun Jan 9 14:12:17 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * io.c (rb_f_select): IO list could be altered. [ruby-dev:25312]
-
-Sun Jan 9 04:08:40 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Sun Jan 9 03:12:58 2005 Tanaka Akira <akr@m17n.org>
- * test/webrick/test_server.rb (test_daemon): delete an assertion
- which has possibility to fail by race condition.
-
-Sun Jan 9 03:22:46 2005 Minero Aoki <aamine@loveruby.net>
-
- * test/fileutils/test_fileutils.rb (test_copy_entry): copy_entry
- copies only file type, not mtime. [ruby-dev:25383]
+ * io.c (io_fread): warn nonblocking behavior.
+ (io_readpartial): new method IO#readpartial.
Sat Jan 8 04:38:47 2005 why the lucky stiff <why@ruby-lang.org>
@@ -54377,33 +13502,17 @@ Fri Jan 7 21:12:29 2005 TAMURA Takashi <sheepman@tcn.zaq.ne.jp>
* random.c (rand_init): use ALLOC_N instead of ALLOCA_N
[ruby-dev:25426]
-Fri Jan 7 20:01:31 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * lib/webrick/httpproxy.rb (WEBrick::HTTPProxyServer#proxy_service):
- should delete trailing LF from the result of pack("m*").
-
- * lib/webrick/httpproxy.rb (WEBrick::HTTPProxyServer#proxy_connect):
- - should delete trailing LF from the result of pack("m*").
- - clear Request-Line not to send the response by HTTPServer#run.
-
- * lib/webrick/httputils (WEBrick::HTTPUtils.parse_qvalues):
- refine regexp (and change the name of a local variable).
-
- * lib/webrick/server.rb (WEBrick::Daemon.start): prepared stdio
- don't allow changing its mode.
-
- * test/webrick/*, sample/webrick/httpproxy.rb: add new files.
-
Fri Jan 7 18:03:35 2005 Tanaka Akira <akr@m17n.org>
* gc.c (mark_locations_array): avoid core dump with -O3.
[ruby-dev:25424]
-Thu Jan 6 20:29:18 2005 NAKAMURA Usaku <usa@ruby-lang.org>
+Thu Jan 6 20:31:07 2005 NAKAMURA Usaku <usa@ruby-lang.org>
- * ext/zlib/zlib.c (zstream_end): should return value.
+ * ext/zlib/zlib.c (zstream_end): should return value. (backported
+ from CVS HEAD)
-Thu Jan 6 19:59:03 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Thu Jan 6 19:55:13 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* win32/win32.c (rb_w32_close): didn't close socket handle.
[ruby-dev:25414]
@@ -54411,7 +13520,7 @@ Thu Jan 6 19:59:03 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* win32/win32.c (rb_w32_open_osfhandle): bcc32's _open_osfhandle
never set EMFILE.
-Thu Jan 6 17:22:41 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Thu Jan 6 17:14:31 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* random.c (random_seed): O_NONBLOCK isn't defined on some
platforms. [ruby-dev:25417]
@@ -54425,11 +13534,6 @@ Thu Jan 6 07:58:28 2005 Dave Thomas <dave@pragprog.com>
* lib/rdoc/usage.rb (RDoc::RDoc.usage_no_exit): Allow for colons
in path names on DOS machines. (thanks to Johan Nilsson)
-Thu Jan 6 00:02:35 2005 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
-
- * test/rinda/test_rinda.rb: use MockClock.sleep instead of Kernel.sleep
- [ruby-dev:25387]
-
Wed Jan 5 20:16:32 2005 Tanaka Akira <akr@m17n.org>
* random.c (limited_big_rand): didn't work if SIZEOF_BDIGITS == 2.
@@ -54437,20 +13541,22 @@ Wed Jan 5 20:16:32 2005 Tanaka Akira <akr@m17n.org>
* random.c (random_seed): refined.
-Wed Jan 5 16:39:54 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * parse.y (BITSTACK_POP): workaround for bcc32 compiler's bug.
- shift assignment operator '>>=' for __int64 in struct may
- generate collapsed code. [ruby-dev:25342]
-
- * win32/win32.[ch]: failed to compile on bcc32 (and probably wince)
- [ruby-dev:25306]
-
Wed Jan 5 12:49:39 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
* eval.c (rb_thread_initialize): Thread objects cannot be initialized
again. fixed: [ruby-core:04067]
+Wed Jan 5 10:48:16 2005 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * dir.c (dir_s_mkdir): win32 special processing doesn't need any
+ longer. (backported from CVS HEAD)
+
+ * win32/win32.[ch] (rb_w32_mkdir): new function. POSIX.1 compatible
+ interface. (backported from CVS HEAD)
+
+ * win32/win32.[ch] (rb_w32_rmdir): new function. (backported from CVS
+ HEAD)
+
Wed Jan 5 02:30:11 2005 Tanaka Akira <akr@m17n.org>
* random.c (init_by_array): imported from mt19937ar-cok.tgz.
@@ -54469,10 +13575,10 @@ Tue Jan 4 23:25:29 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
* bignum.c (rb_big_rand): should return positive random number.
[ruby-dev:25401]
-Tue Jan 4 21:25:43 2005 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+Tue Jan 4 11:15:29 2005 TAMURA Takashi <sheepman@tcn.zaq.ne.jp>
- * test/drb/{test_drbssl.rb,test_drbunix.rb,ut_drb.rb}: use
- DRbService.ext_service. reduce sleep.
+ * bignum.c (rb_big_rand): do not use rb_big_modulo to generate
+ random bignums. [ruby-dev:25396]
Mon Jan 3 14:01:54 2005 Tanaka Akira <akr@m17n.org>
@@ -54484,21 +13590,7 @@ Mon Jan 3 11:37:42 2005 Tanaka Akira <akr@m17n.org>
* random.c (random_seed): use /dev/urandom if available.
[ruby-dev:25392]
-Tue Jan 4 11:15:29 2005 TAMURA Takashi <sheepman@tcn.zaq.ne.jp>
-
- * bignum.c (rb_big_rand): do not use rb_big_modulo to generate
- random bignums. [ruby-dev:25396]
-
-Mon Jan 3 11:03:37 2005 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
-
- * test/drb/test_drb.rb: move TestDRbReusePort to new file.
- [ruby-dev:25238]
-
- * test/drb/drbtest.rb: change timeout.
-
- * test/drb/ignore_test_drb.rb: new file.
-
-Mon Jan 3 07:27:46 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Mon Jan 3 07:46:42 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
* lib/webrick/httpauth/htpasswd.rb (WEBrick::Htpasswd#reload):
raise NotImplementedError if password is encrypted by digest
@@ -54514,46 +13606,6 @@ Mon Jan 3 07:27:46 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
* test/webrick/test_httpauth.rb: new file.
-Sun Jan 2 15:42:10 2005 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
-
- * lib/drb/drb.rb: add lazy stop_service.
-
- * lib/drb/extserv.rb: ditto.
-
-Sun Jan 2 01:17:17 2005 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
-
- * test/drb/drbtest.rb: add method DRbService.ext_service.
-
- * test/drb/test_drb.rb: ditto.
-
- * test/drb/test_drbssl.rb: ditto.
-
-Sat Jan 1 20:23:02 2005 Tanaka Akira <akr@m17n.org>
-
- * io.c (argf_readpartial): new method ARGF.readpartial.
- (io_getpartial): extracted from io_readpartial.
- (io_readpartial): call io_getpartial.
-
-Sat Jan 1 17:44:54 2005 Minero Aoki <aamine@loveruby.net>
-
- * lib/net/http.rb (each_capitalized): should join header field
- value. This patch is contributed sheepman [ruby-list:40478]
-
- * test/net/http/test_httpheader.rb: test it.
-
-Sat Jan 1 16:21:29 2005 Minero Aoki <aamine@loveruby.net>
-
- * lib/fileutils.rb (copy_stream): use read/write instead of
- sysread/syswrite, which allows duck typing. [ruby-dev:25369]
-
- * lib/fileutils.rb (copy_stream): does NOT support nonblocking IO.
- [ruby-dev:25370]
-
- * lib/fileutils.rb (copy_entry): could not copy symlink.
-
- * test/fileutils/test_fileutils.rb: test copy_entry, copy_file,
- copy_stream.
-
Sat Jan 1 04:20:23 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
* ext/openssl/ossl_ns_spki.c (ossl_spki_set_challenge): should call
@@ -54565,29 +13617,8 @@ Sat Jan 1 01:13:28 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
Fri Dec 31 14:10:43 2004 Dave Thomas <dave@pragprog.com>
- * lib/rdoc/ri/ri_formatter.rb (RI::TextFormatter::display_flow_item):
- Fix problem if heading contains formatting.
-
-Fri Dec 31 00:08:02 2004 Tanaka Akira <akr@m17n.org>
-
- * configure.in (HAVE_RLIM_T): removed because not used.
-
-Thu Dec 30 22:45:39 2004 Tanaka Akira <akr@m17n.org>
-
- * rubyio.h: don't deprecate rb_read_check.
-
- * io.c (STDIO_READ_DATA_PENDING): reverted from old READ_DATA_PENDING
- to check stdio read buffer.
- (rb_read_check): use STDIO_READ_DATA_PENDING.
- (rb_read_pending): ditto.
- (rb_getc): ditto.
-
-Thu Dec 30 05:39:35 2004 Minero Aoki <aamine@loveruby.net>
-
- * parse.y: eliminate unused members in struct parser_params.
- [ruby-dev:25258] (again)
-
- * parse.y: make parser_new() static.
+ * lib/rdoc/ri/ri_formatter.rb (RI::TextFormatter::display_flow_item): Fix problem
+ if heading contains formatting.
Thu Dec 30 00:41:42 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
@@ -54605,11 +13636,6 @@ Tue Dec 28 22:31:46 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
* string.c (rb_str_justify): create buffer string after argument type
conversion. fixed: [ruby-dev:25341]
-Tue Dec 28 17:18:17 2004 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * lib/net/telnet.rb (preprocess): remove NULL unless binmode.
- fixed: [ruby-list:40320]
-
Tue Dec 28 15:41:48 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ext/nkf/nkf-utf8/nkf.c (reinit): should initialize all static
@@ -54630,58 +13656,91 @@ Tue Dec 28 13:35:20 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ext/zlib/zlib.c (rb_deflate_init_copy): replace rb_deflate_clone.
+Tue Dec 28 12:26:45 2004 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * win32/Makefile.sub, win32/setup.mak (RDOCTARGET, install,
+ install-nodoc, install-doc): rdoc support for mswin32.
+
+ * win32/configure.bat (--enable-install-doc, --disable-install-doc):
+ ditto.
+
Mon Dec 27 20:02:14 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tcltklib/tcltklib.c: fix SEGV bug when deleting Tk interp
* ext/tk/lib/multi-tk.rb: ditto
-Mon Dec 27 16:54:05 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Mon Dec 27 16:55:17 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
* ext/openssl/ossl_x509name.c (Init_ossl_x509name): should use
rb_hash_new to get exactly a Hash. fix [ruby-dev:25325].
-Mon Dec 27 15:29:12 2004 Minero Aoki <aamine@loveruby.net>
+Mon Dec 27 16:29:56 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * string.c (rb_str_justify): [ruby-dev:25341]
- * test/fileutils/test_fileutils.rb (cp_r): tested wrong file name.
- [ruby-dev:25339]
+Mon Dec 27 15:47:48 2004 Minero Aoki <aamine@loveruby.net>
-Mon Dec 27 15:15:18 2004 Minero Aoki <aamine@loveruby.net>
+ * test/fileutils/fileasserts.rb: sync with HEAD.
+
+ * test/fileutils/test_fileutils.rb: ditto.
+
+ * test/fileutils/test_nowrite.rb: ditto.
+
+Mon Dec 27 15:21:07 2004 Minero Aoki <aamine@loveruby.net>
* lib/fileutils.rb (mv): should raise error when moving a
directory to the (empty) directory. [ruby-talk:124368]
+ (backport from HEAD 1.48)
* lib/fileutils.rb (mv): wrongly did not overwrite file on Win32
- platforms.
+ platforms. (backport from HEAD 1.48)
+
+Sat Dec 25 11:11:48 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
-Mon Dec 27 14:36:20 2004 NAKAMURA Usaku <usa@ruby-lang.org>
+ * stable version 1.8.2 released.
- * process.c (NUM2RLIM, RLIM2NUM): Without SIZEOF_RLIM_T is not error.
- fixed: [ruby-dev:25346]
+Sat Dec 25 04:23:49 2004 Minero Aoki <aamine@loveruby.net>
-Sun Dec 26 16:21:39 2004 Shugo Maeda <shugo@ruby-lang.org>
+ * lib/fileutils.rb (mkdir, mkdir_p): should ensure directory
+ permission. (backportted from HEAD, 1.47)
- * lib/net/imap.rb (Net::IMAP::PlainAuthenticator): added a new class
- to support the PLAIN authentication mechanism. Thanks, Benjamin
- Stiglitz.
+ * lib/fileutils.rb (traverse, remove_dir): untaint trasted
+ objects. (backportted from HEAD, 1.46)
Sat Dec 25 01:28:23 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
- * io.c (rb_f_select): [ruby-dev:25312]
+ * io.c: cancel io_reopen() change on Dec. 24th.
+
+ * dln.c: use <dlfcn.h> for NetBSD. [ruby-dev:25313]
+
+ * io.c (rb_f_select): IO list could be altered. [ruby-dev:25312]
+
+Fri Dec 24 23:51:48 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+
+ * bcc32/Makefile.sub: bcc32 should use RTL dll (backport from HEAD)
+ [ruby-dev:25306]
+
+ * win32/win32.[ch]: ditto.
Fri Dec 24 23:27:18 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tk/lib/tk/image.rb: TkPhotoImage#cget bug fix
-Fri Dec 24 03:06:13 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Dec 24 18:39:25 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+
+ * win32/win32.[ch]: failed to compile on bcc32 (and probably wince)
+ [ruby-dev:25306]
+
+Fri Dec 24 02:52:52 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
* io.c (io_reopen, rb_io_reopen): prohibit to change access mode for
special IO ports. [ruby-dev:25225]
- * io.c (next_argv): reduce use of stdio.
-
Fri Dec 24 02:22:53 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/syck/rubyext.c (rb_syck_io_str_read): [ruby-core:03973]
+
* ext/syck/rubyext.c (syck_loader_transfer): check type conversion.
* ext/syck/rubyext.c (syck_parser_assign_io, rb_new_syck_node): duck
@@ -54701,20 +13760,11 @@ Fri Dec 24 01:21:00 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tk/lib/tkextlib/blt/tile/*.rb: ditto
-Thu Dec 23 23:43:24 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Dec 23 23:36:28 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * process.c (proc_setgroups): check if the argument length is
+ * process.c (proc_setgroups): check if the argument lenght is
modified. fixed: [ruby-dev:25285]
- * process.c (SIZEOF_RLIM_T): err if size of rlim_t is not set.
-
-Thu Dec 23 19:08:41 2004 Tanaka Akira <akr@m17n.org>
-
- * rubyio.h: rename FMODE_UNSEEKABLE to FMODE_DUPLEX.
-
- * io.c (io_check_tty): extracted function to set FMODE_LINEBUF and
- FMODE_DUPLEX.
-
Thu Dec 23 13:13:33 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tcltklib/tcltklib.c: define TclTkLib::COMPILE_INFO and
@@ -54726,6 +13776,10 @@ Thu Dec 23 13:13:33 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tk/lib/tk.rb: define Tk::RELEASE_DATE
+Thu Dec 23 09:38:31 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * io.c (io_reopen): restore exact mode. fixed: [ruby-core:04003]
+
Thu Dec 23 00:16:32 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
* configure.in (bsdi): use $(CC) for LDSHARED. fixed [ruby-dev:25270]
@@ -54740,49 +13794,41 @@ Wed Dec 22 08:34:32 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ext/dl/sym.c (rb_dlsym_initialize): extract internal pointers after
all argument conversion. fixed: [ruby-dev:25271]
-Tue Dec 21 16:15:21 2004 Michael Neumann <mneumann@ruby-lang.org>
-
- * lib/xmlrpc/client.rb: use "" instead of "." if prefix argument is
- nil in proxy methods. nil is default value.
-
- * test/xmlrpc/test_webrick_server.rb, test/xmlrpc/webrick_testing.rb:
- use threads instead of forking. this should fix issue #1208
- (http://rubyforge.org/tracker/?func=detail&atid=1698&aid=1208&group_id=426).
- removed testing of SSL enabled servlet as this hangs.
-
-Wed Dec 22 00:05:10 2004 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+Wed Dec 22 00:08:01 2004 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
* lib/soap/*, test/soap/*, sample/soap/authheader/*: eval cleanup.
-Tue Dec 21 22:07:41 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * ext/openssl/ossl_asn1.c (ossl_asn1_decode_all): use rb_str_new4
- to avoid SEGV.
+Tue Dec 21 22:07:33 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
* ext/openssl/ossl_asn1.c (ossl_asn1_traverse, ossl_asn1_decode,
ossl_asn1_decode_all): temporary value should be marked volatile.
-Tue Dec 21 12:42:34 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Tue Dec 21 14:40:02 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
- * ext/openssl/ossl_asn1.c (ossl_asn1_traverse, ossl_asn1_decode):
- use rb_str_new4 to avoid SEGV. fix [ruby-dev:25261]
+ * ext/openssl/ossl_asn1.c (ossl_asn1_traverse, ossl_asn1_decode,
+ ossl_asn1_decode_all): use rb_str_new4 to avoid SEGV.
+ fix [ruby-dev:25261]
* test/openssl/test_asn1.rb: add tests for OpenSSL::ASN1.
+Tue Dec 21 12:22:40 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * io.c (io_reopen): keep duplex pipe in correct mode for exception
+ safeness. fixed: [ruby-dev:25152]
+
Tue Dec 21 12:10:04 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tk/lib/tk/grid.rb: rescue bug of 'grid configure' on Tcl/Tk8.3-
-Mon Dec 20 22:52:29 2004 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+Tue Dec 21 00:53:01 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
- * added samples for the previous soap4r's commit.
+ * ext/openssl/ossl_asn1.c (ossl_asn1_traverse): [ruby-dev:25261]
-Mon Dec 20 22:56:39 2004 Tanaka Akira <akr@m17n.org>
+ * ext/openssl/ossl_asn1.c (ossl_asn1_decode): ditto.
- * gc.c (set_stack_end): gcc noinline attribute is available since
- gcc-3.1.
+ * ext/openssl/ossl_asn1.c (ossl_asn1_decode_all): ditto.
-Mon Dec 20 22:40:31 2004 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+Mon Dec 20 23:22:26 2004 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
* added files:
* lib/soap/mapping/wsdl*.rb
@@ -54796,6 +13842,8 @@ Mon Dec 20 22:40:31 2004 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
* test/soap/*
* test/wsdl/*
* test/xsd/*
+ * sample/soap/*
+ * sample/sdl/*
* summary
* imported from the soap4r repository. Version: 1.5.3-ruby1.8.2
@@ -54809,14 +13857,12 @@ Mon Dec 20 22:40:31 2004 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
* HTTP client/server gzipped content encoding support.
* improved WSDL schema definition support; still is far from
- complete, but is making step by step improvement.
-
-Mon Dec 20 14:45:19 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ complete, but is making step by step improovement.
- * lib/net/https.rb: delete descriptions about key_file and cert_file.
- fixed: [ruby-dev:25243]
+Mon Dec 20 22:56:39 2004 Tanaka Akira <akr@m17n.org>
- * ext/openssl/lib/net/telnets.rb: ditto.
+ * gc.c (stack_end_address): gcc noinline attribute is available since
+ gcc-3.1.
Mon Dec 20 14:07:02 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
@@ -54828,14 +13874,21 @@ Mon Dec 20 14:07:02 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tk/lib/tk/panedwindow.rb: ditto
-Mon Dec 20 13:51:40 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+Mon Dec 20 12:47:13 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
- * ext/socket/socket.c (sock_s_getservbyport): [ruby-talk:124072]
+ * ext/openssl/lib/net/https.rb,protocols.rb,telnets.rb: delete
+ doc and code about SSLContext#{key_file,cert_file}.
+ fixed: [ruby-dev:25243]
+
+Mon Dec 20 12:42:17 2004 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * io.c (io_fwrite): workaround for MSVCRT's bug.
+ fixed: [ruby-core:03982]
-Mon Dec 20 10:51:58 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Dec 20 11:21:04 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * parse.y (special_local_set): prevent the parser object from GC.
- fixed: [ruby-dev:25252]
+ * io.c (rb_io_eof): check if closed before clearerr().
+ fixed: [ruby-dev:25251]
Mon Dec 20 03:30:40 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
@@ -54846,10 +13899,40 @@ Mon Dec 20 01:51:01 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
* struct.c (make_struct): [ruby-dev:25249]
-Mon Dec 20 00:16:54 2004 Kouhei Sutou <kou@cozmixng.org>
+Mon Dec 20 00:28:20 2004 Kouhei Sutou <kou@cozmixng.org>
+
+ * lib/rexml/encodings/SHIFT-JIS.rb: backported from CVS HEAD.
+
+ * lib/rexml/encodings/SHIFT_JIS.rb: ditto.
+
+Sun Dec 19 17:19:48 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
+
+ * ext/openssl/ossl_x509store.c
+ (ossl_x509store_set_time): add OpenSSL::X509::Store#time=.
+ (ossl_x509stctx_set_time): add OpenSSL::X509::StoreContext#time=.
+
+ * test/openssl/ossl_x509store.rb: test certificate validity times.
+
+ * ext/openssl/ossl_x509name.c (ossl_x509name_to_s): add optional
+ second argument to specify the output format (see also
+ X509_NAME_print_ex).
- * lib/rexml/encodings/SHIFT_JIS.rb: fixed LoadError bug.
- [ruby-core:3958]
+ * ext/openssl/ossl_x509name.c (ossl_x509name_init): new constants:
+ OpenSSL::X509::Name::COMPAT, OpenSSL::X509::Name::RFC2253,
+ OpenSSL::X509::ONELINE, OpenSSL::X509::MULTILINE.
+
+ * ext/openssl/lib/openssl/x509.rb (OpenSSL::X509::Name::RFC2253DN):
+ new module to provide the parse for RFC2253 DN format.
+
+ * ext/openssl/lib/openssl/x509.rb (OpenSSL::X509::Name.parse_rfc2253):
+ new method to parse RFC2253 DN format.
+
+ * test/openssl/ossl_x509name.rb: add tests about RFC2253 DN.
+
+ * text/openssl/ssl_server.rb: try to listen ports from 20443 to 20542
+ while EADDRINUSE is raised.
+
+ * all changes in this entry are backport from 1.9.
Sun Dec 19 17:24:59 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
@@ -54871,7 +13954,7 @@ Sat Dec 18 16:36:23 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ext/zlib/zlib.c (rb_deflate_s_deflate, rb_inflate_s_inflate):
disallow interrupt by type conversion. fixed: [ruby-dev:25226]
-Sat Dec 18 15:09:02 2004 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+Sat Dec 18 15:16:41 2004 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
* lib/webrick/httpauth.rb,
lib/webrick/httpauth/{basicauth.rb,digestauth.rb}: use
@@ -54882,12 +13965,10 @@ Sat Dec 18 10:51:01 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
* dir.c (dir_open_dir): new function. [ruby-dev:25242]
- * io.c (rb_f_open): add type check for return value from to_open.
-
-Fri Dec 17 16:44:26 2004 Tanaka Akira <akr@m17n.org>
+Fri Dec 17 18:07:01 2004 Shugo Maeda <shugo@ruby-lang.org>
- * configure.in (ac_cv_sizeof_rlim_t): set 8 for BSD/OS.
- Reported by OHARA Shigeki. [ruby-dev:25236]
+ * test/readline/test_readline.rb: fix for BSD. Thanks, GOTOU Yuuzou.
+ fixed: [ruby-dev:25218]
Fri Dec 17 16:28:12 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
@@ -54925,27 +14006,45 @@ Fri Dec 17 16:28:12 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tk/lib/tk/textwindow.rb: wrong gravity of text mark for
embedded window
+Fri Dec 17 13:50:00 2004 Akiyoshi, Masamichi <akiyoshi@hp.com>
+
+ * vms/vmsruby_private.c, vms/vmsruby_private.h: private routines
+ for VMS port are added.
+
+ * eval.c (ruby_init): change to call VMS private intialization routine.
+
Fri Dec 17 13:33:58 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/cgi/session.rb (CGI::Session#initialize): control adding
session_id hidden fields. fixed: [ruby-talk:123850]
-Fri Dec 17 00:01:48 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Dec 16 23:25:25 2004 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+
+ * lib/drb/drb.rb, lib/drb/ssl.rb: backported from CVS HEAD.
+ [druby-ja:101]
+
+ * test/drb/test_drb.rb: adjust and reduce sleep (backported from
+ CVS HEAD.)
- * eval.c (rb_proc_arity, rb_node_arity, rb_mod_method_arity,
- rb_obj_method_arity): new functions to obtain method arity.
- [ruby-dev:25143]
+Thu Dec 16 18:44:58 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
-Thu Dec 16 23:31:13 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/webrick/httpserver.rb (WEBrick::HTTPServer#run): should wait
+ for reading request till data arrive. [ruby-talk:121068]
+
+ * lib/webrick/server.rb (WEBrick::GenericServer#start_thread):
+ should log about all accepted socket. [ruby-core:03962]
- * lib/mkmf.rb (create_makefile): create RUBYARCHDIR also when no extension
- is installed. fixed: [ruby-dev:25215]
+ * lib/webrick/accesslog.rb (WEBrick::AccessLog#setup_params):
+ "%%" and "%u" are supported. [webricken:135]
-Thu Dec 16 22:36:57 2004 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+ * lib/webrick/httpservlet/filehandler.rb
+ (WEBrick::HTTPServlet::FileHandler#check_filename):
+ :NondisclosureName is acceptable if it is Enumerable.
- * test/drb/test_drb.rb: adjust and reduce sleep.
+ * lib/webrick/config.rb (WEBrick::Config::FileHandler):
+ default value of :NondisclosureName is [".ht*", "*~"].
-Thu Dec 16 18:37:08 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Thu Dec 16 18:36:52 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
* ext/openssl/ossl.c (ossl_raise): refine message format.
@@ -54984,64 +14083,55 @@ Thu Dec 16 16:03:50 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tk/lib/tkextlib/*: ditto
-Thu Dec 16 04:02:28 2004 Minero Aoki <aamine@loveruby.net>
-
- * ext/ripper/extconf.rb: bison is not needed if ripper.c exists.
- [ruby-dev:25191]
-
-Thu Dec 16 03:27:10 2004 Minero Aoki <aamine@loveruby.net>
+Thu Dec 16 03:14:28 2004 Minero Aoki <aamine@loveruby.net>
- * lib/net/http.rb: remove junk.
+ * lib/net/http.rb (basic_encode): return value of pack('m') may
+ include multiple CR/LFs. Backported from main trunk (rev 1.112).
+ [ruby-dev:25212]
-Thu Dec 16 00:57:30 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+Thu Dec 16 00:33:37 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
- * ext/syck/rubyext.c (rb_syck_io_str_read): [ruby-core:03973]
+ * hash.c (Init_Hash): remove custom "hash" and "eql?".
-Thu Dec 16 00:43:29 2004 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+Wed Dec 15 18:57:01 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
- * lib/drb/drb.rb: changed default binded address family to use an
- available address family of host name. [druby-ja:101]
+ * lib/set.rb (Set::eql): wrong definition. [ruby-dev:25207]
- * lib/drb/ssl.rb: ditto
+Wed Dec 15 18:48:42 2004 Shugo Maeda <shugo@ruby-lang.org>
-Wed Dec 15 17:47:17 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * ext/curses/curses.c (window_subwin): call NUM2INT() before
+ GetWINDOW(). (backported from CVS HEAD)
- * lib/webrick/server.rb (WEBrick::GenericServer#start_thread):
- should log about all accepted socket. [ruby-core:03962]
+Wed Dec 15 17:03:50 2004 NAKAMURA Usaku <usa@ruby-lang.org>
- * lib/webrick/accesslog.rb (WEBrick::AccessLog#setup_params):
- "%%" and "%u" are supported. [webricken:135]
+ * win32/win32.[ch] (rb_w32_isatty): new function to replace MSVCRT's
+ isatty because it never sets errno. (backported from CVS HEAD)
- * lib/webrick/httpservlet/filehandler.rb
- (WEBrick::HTTPServlet::FileHandler#check_filename):
- :NondisclosureName is acceptable if it is Enumerable.
+Wed Dec 15 15:39:32 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
- * lib/webrick/config.rb (WEBrick::Config::FileHandler):
- default value of :NondisclosureName is [".ht*", "*~"].
+ * ext/openssl/ossl_x509name.c (ossl_x509name_to_a): avoid SEGV
+ (rollback the previous commit).
Wed Dec 15 16:10:23 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
* object.c (rb_obj_id_obsolete): warn always.
+ * eval.c (rb_enable_super): ditto.
+
Wed Dec 15 15:31:02 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
* lib/set.rb (Set#==): [ruby-dev:25206]
-Wed Dec 15 14:32:18 2004 NAKAMURA Usaku <usa@ruby-lang.org>
+Wed Dec 15 14:22:10 2004 NAKAMURA Usaku <usa@ruby-lang.org>
* win32/win32.c (rb_w32_fdisset): check whether the handle is valid.
+ fixed: [ruby-core:03959]
Wed Dec 15 10:30:37 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
* ext/openssl/ossl_digest.c (ossl_digest_initialize): [ruby-dev:25198]
-Tue Dec 14 19:17:15 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * utf8.c (utf8_is_mbc_ambiguous): [ruby-talk:123561]
-
- * utf8.c (utf8_mbc_to_normalize): ditto.
-
-Tue Dec 14 17:08:15 2004 NAKAMURA Usaku <usa@ruby-lang.org>
+Tue Dec 14 17:10:09 2004 NAKAMURA Usaku <usa@ruby-lang.org>
* win32/win32.c (rb_w32_close): need to reset osfhnd().
@@ -55055,36 +14145,27 @@ Tue Dec 14 12:36:04 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
* lib/cgi/session.rb (CGI::Session::initialize): generate new
session if given session_id does not exist. [ruby-list:40368]
-Tue Dec 14 08:47:45 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (Init_eval): should mark ruby_eval_tree. [ruby-dev:25189]
-
Mon Dec 13 18:13:52 2004 Tanaka Akira <akr@m17n.org>
- * gc.c (set_stack_end): new function to obtain stack end address.
- set_stack_end obtains a stack end address by an address of local
- variable in the function.
- (SET_STACK_END, STACK_END): use set_stack_end. don't use alloca.
+ * gc.c (stack_end_address): new function to obtain stack end address.
+ stack_end_address calls __builtin_frame_address(0) to obtain the
+ frame pointer of a stack frame of stack_end_address. The address
+ is the stack pointer of the caller's stack frame.
+ (SET_STACK_END): use stack_end_address.
This makes the conservative garbage collector to scan a stack frame
of the garbage_collect function itself. This is required because
callee-save registers may be stored in the frame.
[ruby-dev:25158]
-Mon Dec 13 02:45:51 2004 Shugo Maeda <shugo@ruby-lang.org>
-
- * ext/curses/curses.c (window_subwin): call NUM2INT() before
- GetWINDOW(). fixed: [ruby-dev:25161]
-
Mon Dec 13 00:58:02 2004 Tanaka Akira <akr@m17n.org>
* lib/pathname.rb (cleanpath_aggressive): make it private.
(cleanpath_conservative): ditto.
Suggested by Daniel Berger. [ruby-core:3914]
-Sun Dec 12 21:32:14 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun Dec 12 20:06:38 2004 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
- * test/ruby/test_super.rb (TestSuper#test_define_method): now methods
- from procs can call super.
+ * lib/drb/drb.rb: backported from CVS HEAD.
Sun Dec 12 10:35:10 2004 Dave Thomas <dave@pragprog.com>
@@ -55096,7 +14177,14 @@ Sun Dec 12 10:14:03 2004 Dave Thomas <dave@pragprog.com>
* lib/rdoc/rdoc.rb (RDoc::RDoc::parse_files): Never exclude files
explicitly given on the command line.
-Sat Dec 11 21:10:16 2004 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+Sun Dec 11 23:54:07 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+
+ * ext/tk/*: update to support libraries in ActiveTcl8.4.12.0
+ (see ext/tk/ChangeLog.tkextlib).
+
+ * ext/tk/sample/scrollframe.rb: add a new sample.
+
+Sat Dec 11 20:12:21 2004 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
* lib/drb/drb.rb: add DRbRemoteError. [ruby-list:40348],
[ruby-list:40390]
@@ -55105,27 +14193,41 @@ Sat Dec 11 21:10:16 2004 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
* test/drb/ut_drb.rb: ditto.
-Sat Dec 11 13:08:28 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat Dec 11 15:38:14 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * lib/jcode.rb (String::succ): [ruby-dev:25156]
+
+Sat Dec 11 12:41:55 2004 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * eval.c (run_trap_eval): prototype; avoid VC++ warnings.
+
+ * ext/socket/getaddrinfo.c: fix typo. fixed: [ruby-core:03947]
- * sample/optparse/subcommand.rb: a sample for sub commands like
- cvs. contributed by Minero Aoki.
+ * win32/win32.c: need to include dln.h.
-Fri Dec 10 08:39:48 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat Dec 11 00:10:18 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * io.c (io_reopen): [ruby-dev:25150]
+
+Fri Dec 10 08:39:27 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ext/socket/socket.c (sock_listen): get OpenFile just before calling
- listen(2).
+ listen(2). fixed: [ruby-dev:25149]
-Thu Dec 9 16:28:35 2004 NAKAMURA Usaku <usa@ruby-lang.org>
+Thu Dec 9 17:00:00 2004 Akiyoshi, Masamichi <akiyoshi@hp.com>
- * ext/sdbm/init.c (GetDBM): typo.
+ * ext/socket/socket.c, ext/socket/getaddrinfo.c: port to VMS
-Thu Dec 9 16:21:51 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Thu Dec 9 16:31:02 2004 NAKAMURA Usaku <usa@ruby-lang.org>
- * lib/webrick/cgi.rb (WEBrick::CGI#setup_header): avoid
- SecurityError. [ruby-dev:24970]
+ * ext/sdbm/init.c (GetDBM): typo.
- * lib/webrick/httpserver.rb (WEBrick::HTTPServer#run): should wait
- for reading request till data arrive. [ruby-talk:121068]
+Thu Dec 9 16:05:00 2004 Akiyoshi, Masamichi <akiyoshi@hp.com>
+
+ * defines.h: change path of vms.h
+ * vms/vms.h: delete reference for snprintf()
+ * vms/config.h: new file
+ * vms/config.h_in: deleted
Thu Dec 9 14:38:35 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
@@ -55134,10 +14236,6 @@ Thu Dec 9 14:38:35 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
* string.c (rb_str_dump): not escape # which isn't a substitution.
-Thu Dec 9 12:31:53 2004 WATANABE Hirofumi <eban@ruby-lang.org>
-
- * io.c (pipe_open): should set prog if argc != 0.
-
Thu Dec 9 10:54:36 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
* ext/dbm/dbm.c (fdbm_select): [ruby-dev:25132]
@@ -55146,11 +14244,6 @@ Thu Dec 9 10:54:36 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
* ext/gdbm/gdbm.c: ditto.
-Thu Dec 9 10:19:18 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * test/socket/test_socket.rb (test_setsockopt): use SO_LINGER instead
- of SO_BINDTODEVICE. fixed: [ruby-dev:25133]
-
Thu Dec 9 03:08:36 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tcltklib/tcltklib.c (ip_init): set root-win title to "ruby" when
@@ -55205,174 +14298,44 @@ Wed Dec 8 23:54:29 2004 Dave Thomas <dave@pragprog.com>
* lib/rdoc/generators/template/html/html.rb (RDoc::Page): Typo
meant that h2 tag was invisible.
-Wed Dec 8 22:10:02 2004 Tanaka Akira <akr@m17n.org>
+Wed Dec 8 21:56:31 2004 Kouhei Sutou <kou@cozmixng.org>
- * rubyio.h, io.c, ext/dl/dl.c, ext/pty/pty.c, ext/socket/socket.c:
- create FILE object only when required: popen(3) and DL's IO#to_ptr.
- [ruby-dev:25122]
-
- * io.c (rb_io_binmode): use setmode for Human68k. [ruby-dev:25121]
-
-Wed Dec 8 20:13:06 2004 WATANABE Hirofumi <eban@ruby-lang.org>
-
- * process.c (rb_spawn): support for DJGPP.
-
- * lib/mkmf.rb (VPATH): specify the implicit path separator for DJGPP.
-
-Wed Dec 8 17:48:22 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (proc_invoke): merge Guy Decoux's argument preserve
- patch in [ruby-core:03874].
-
-Wed Dec 8 17:37:33 2004 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/win32.c (rb_w32_pipe_exec): need to close original socket
- handle.
+ * lib/rss, test/rss, sample/rss: backported from CVS HEAD.
Wed Dec 8 14:31:36 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
- * sprintf.c (rb_f_sprintf): [ruby-dev:25104]
-
-Wed Dec 8 13:49:46 2004 NAKAMURA Usaku <usa@ruby-lang.org>
+ * io.c (io_fwrite): change dereference for cosmetic reason.
- * win32/win32.c (rb_w32_pipe_exec): must close original handle
- before exec. fixed: [ruby-dev:25112]
-
-Wed Dec 8 11:46:26 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (string_content): get rid of segfault at empty evstr.
- fixed: [ruby-dev:25113]
-
-Wed Dec 8 03:26:51 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * ext/openssl/ossl_bio.c (ossl_obj2bio): should not use fptr->f.
- [ruby-dev:25101]
-
-Wed Dec 8 03:26:41 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * runruby.rb: prepend LIBRUBY_SO to LD_PRELOAD as well as rubytest.rb.
-
-Wed Dec 8 01:35:44 2004 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/win32.c (is_socket): reorder of function definitions.
-
-Wed Dec 8 00:44:31 2004 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * io.c (pipe_open): win32 bidirectional pipe support.
-
- * win32/win32.[ch] (rb_w32_pipe_exec): ditto.
-
- * win32/win32.[ch] (socketpair): new function. POSIX socketpair
- emulation.
-
- * win32/win32.c (socketpair_internal): ditto.
-
-Wed Dec 8 00:25:07 2004 Kouhei Sutou <kou@cozmixng.org>
-
- * test/rss/test_version.rb: added version check test.
- [ruby-dev:25053]
-
-Tue Dec 7 15:40:38 2004 Tanaka Akira <akr@m17n.org>
-
- * io.c (io_fwrite): avoid context switch before writing to stderr.
- [ruby-dev:25080]
-
- * rubyio.h: refine deprecated declaration.
-
- * configure.in, file.c, io.c: remove useless check: fseeko, etc.
-
-Tue Dec 7 13:42:07 2004 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * dir.c (dir_s_mkdir): win32 special processing doesn't need any
- longer.
+ * sprintf.c (rb_f_sprintf): [ruby-dev:25104]
- * win32/win32.[ch] (rb_w32_mkdir): new function. POSIX.1 compatible
- interface.
+Tue Dec 7 19:08:00 2004 Akiyoshi, Masamichi <akiyoshi@hp.com>
- * win32/win32.[ch] (rb_w32_rmdir): new function.
+ * io.c (io_fwrite): fix offset incrementation (for VMS and Human68k)
Tue Dec 7 00:27:37 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
* process.c (proc_setgroups): [ruby-dev:25081]
-Mon Dec 6 23:07:57 2004 Tanaka Akira <akr@m17n.org>
-
- * configure.in: check -lsocket for socketpair and shutdown.
- reported by Ville Mattila. [ruby-core:03903]
-
-Mon Dec 6 23:00:45 2004 WATANABE Hirofumi <eban@ruby-lang.org>
-
- * configure.in (ac_cv_sizeof_rlim_t): setup for DJGPP.
-
- * io.c (is_socket, shutdown): define dummy macros for DJGPP.
-
- * process.c: use SIZEOF_RLIM_T instead of HAVE_RLIM_T for DJGPP.
-
-Mon Dec 6 21:19:40 2004 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * io.c (is_socket): fix typos. [ruby-core:03900]
-
-Mon Dec 6 20:13:28 2004 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * io.c (is_socket): new function.
-
- * io.c (rb_io_close_read, rb_io_close_write): use is_socket().
-
- * io.c (rb_io_fptr_finalize): need to check fptr->f before calling
- rb_io_fptr_cleanup().
-
- * io.c (pipe_open): win32 pipe support (experimental).
-
- * win32/win32.[ch] (rb_w32_pipe_exec): return file descriptors
- instead of FILE structure objects.
-
- * win32/win32.[ch] (rb_w32_is_socket): new function.
-
-Mon Dec 6 19:40:40 2004 WATANABE Hirofumi <eban@ruby-lang.org>
-
- * Makefile.in (.y.c): simplify the rule.
-
Mon Dec 6 18:08:10 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
* re.c (rb_reg_eqq): document fix. [ruby-talk:122541]
-Mon Dec 6 17:49:30 2004 NAKAMURA Usaku <usa@ruby-lang.org>
+Mon Dec 6 17:19:13 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * eval.c (run_trap_eval): add prototype for Microsoft compiler.
+ * rubysig.h (TRAP_BEG, TRAP_END): safe errno around CHECK_INTS.
+ (backported from CVS HEAD) [ruby-dev:24993]
-Mon Dec 6 17:32:38 2004 Tanaka Akira <akr@m17n.org>
+Mon Dec 6 10:18:17 2004 Dave Thomas <dave@pragprog.com>
- * rubyio.h, intern.h, io.c, file.c, process.c, ext/socket/socket.c,
- ext/pty/pty.c, ext/io/wait/wait.c, ext/openssl/ossl_ssl.c:
- Use own buffering mechanism instead of stdio. [ruby-dev:25056]
-
- * io.c, ext/stringio/stringio.c, test/ruby/ut_eof.rb:
- EOF flag removed.
-
-Mon Dec 6 17:15:17 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * test/socket/test_socket.rb (TestBasicSocket#test_setsockopt):
- BasicSocket#setsockopt dumps core. [ruby-dev:25039]
-
- * test/socket/test_tcp.rb (TestTCPSocket#test_recvfrom):
- TCPSocket#recvfrom dumps core. [ruby-dev:24705]
-
- * test/socket/test_udp.rb (TestUDPSocket#test_connect):
- UDPSocket#connect dumps core. [ruby-dev:25045]
-
- * test/socket/test_udp.rb (TestUDPSocket#test_bind):
- UDPSocket#bind dumps core. [ruby-dev:25057]
+ * lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::look_for_directives_in):
+ Oops - 1.8 doesn't have String#clear
Mon Dec 6 09:59:23 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
- * io.c (io_fread): take VALUE argument.
-
* ext/socket/socket.c (sock_connect): use rb_str_new4().
[ruby-dev:25052]
- * eval.c (rb_yield_0): [ruby-dev:25051]
-
-Mon Dec 6 01:32:31 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Mon Dec 6 01:42:08 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
* ext/openssl/ossl_pkey_rsa.c (ossl_rsa_public_encrypt,
ossl_rsa_public_decrypt, ossl_rsa_private_encrypt,
@@ -55393,11 +14356,6 @@ Sun Dec 5 19:39:17 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/optparse.rb (OptionParser#order!): ignore case only for long
option. [ruby-dev:25048]
-Sun Dec 5 00:54:32 2004 WATANABE Hirofumi <eban@ruby-lang.org>
-
- * mkconfig.rb: setup library paths before requiring library.
- [ruby-core:03892]
-
Sat Dec 4 22:54:15 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
* io.c (io_write): remove rb_str_locktmp(). [ruby-dev:25050]
@@ -55421,29 +14379,10 @@ Sat Dec 4 22:54:15 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
* hash.c (rb_hash_hash): should provide "hash" method where "eql?"
is redefined. [ruby-talk:122482]
-Sat Dec 4 21:29:05 2004 Minero Aoki <aamine@loveruby.net>
-
- * lib/fileutils.rb: (In previous commit) new method chown.
+Sat Dec 4 14:54:52 2004 WATANABE Hirofumi <eban@ruby-lang.org>
- * lib/fileutils.rb: (In previous commit) new method chown_R.
-
- * lib/fileutils.rb: (In previous commit) new method chmod_R
- wrongly added. Removed now.
-
-Sat Dec 4 20:45:52 2004 Minero Aoki <aamine@loveruby.net>
-
- * lib/fileutils.rb (mkdir, mkdir_p): should chmod explicitly.
- [ruby-core:03881]
-
-Sat Dec 4 18:54:09 2004 Kouhei Sutou <kou@cozmixng.org>
-
- * lib/rss/rss.rb: removed empty lines from output.
-
-Sat Dec 4 18:49:09 2004 Kouhei Sutou <kou@cozmixng.org>
-
- * lib/rss/rss.rb (RSS::VERSION): 0.1.1 -> 0.1.2
-
- * lib/rss/rss.rb: #item=/#set_item and so on are obsolete.
+ * eval.c (proc_invoke): use volatile `tmp' rather than `args'.
+ [ruby-core:03882]
Sat Dec 4 14:28:56 2004 Dave Thomas <dave@pragprog.com>
@@ -55457,13 +14396,48 @@ Sat Dec 4 14:28:56 2004 Dave Thomas <dave@pragprog.com>
The lines before :section: are removed, and identical lines at the end are
also removed if present.
+Sat Dec 4 03:33:45 2004 Shugo Maeda <shugo@ruby-lang.org>
+
+ * ext/readline/readline.c: check $SAFE. (backported from CVS HEAD)
+
+ * test/readline/test_readline.rb: added tests for readline.
+ (backported from CVS HEAD)
+
+Sat Dec 4 02:24:00 2004 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * ext/nkf/nkf.c: add constant NKF::VERSION
+
+ * ext/nkf/nkf.c(guess): this becomes an alias of guess2
+
+ * ext/nkf/test.rb(mime_out2): add --no-cp932
+
+ * ext/nkf/nkf-utf8/nkf.c: original nkf2 revision 1.47
+
Sat Dec 4 00:35:08 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
* ext/socket/socket.c (bsock_setsockopt): [ruby-dev:25039]
-Fri Dec 3 12:25:21 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Dec 3 18:57:03 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
- * st.h: fix prototype for C++.
+ * lib/ostruct.rb: 1.9 marshaling support back-ported.
+ [ruby-core:03871]
+
+Fri Dec 3 13:45:20 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * eval.c (proc_invoke): copy arguments to frame.argv.
+ [ruby-core:03861]
+
+Fri Dec 3 12:25:41 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * st.h: fix prototypes.
+
+Fri Dec 3 00:21:05 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * object.c (convert_type): use rb_respond_to() again.
+ [ruby-dev:25021]
+
+ * eval.c (rb_respond_to): funcall respond_to? if it's redefined.
+ [ruby-dev:25021]
Fri Dec 3 01:55:24 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
@@ -55483,25 +14457,6 @@ Fri Dec 3 01:55:24 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tk/sample/demos-jp/widget: ditto.
-Fri Dec 3 00:21:05 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (proc_invoke): prepare to pass a block from "call" method
- to a Proc generated by Method#to_proc. [ruby-dev:25031]
-
- * eval.c (rb_yield_0): actually passes a block given to "call".
-
- * object.c (convert_type): use rb_respond_to() again. this fix is
- based on [ruby-dev:25021]
-
- * eval.c (rb_respond_to): funcall respond_to? if it's redefined.
- [ruby-dev:25021]
-
-Thu Dec 2 15:13:53 2004 Michael Neumann <mneumann@ruby-lang.org>
-
- * test/xmlrpc/test_parser.rb, test/xmlrpc/data/*.expected: Expected
- values are now stored in YAML instead of using #inspect. This fixes
- false hash order.
-
Fri Dec 3 00:11:48 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
* io.c (rb_file_initialize): [ruby-dev:25032]
@@ -55514,16 +14469,12 @@ Thu Dec 2 16:41:03 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
* eval.c (rb_callcc, rb_cont_call): prohibit calling from different
signal contexts. [ruby-dev:25022]
-Thu Dec 2 10:45:02 2004 Shugo Maeda <shugo@ruby-lang.org>
-
- * test/readline/test_readline.rb: fix for NetBSD.
-
Thu Dec 2 09:57:24 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
* lib/ostruct.rb (OpenStruct::Marshaler): OpenStruct can be
marshaled again. [ruby-core:03862]
-Thu Dec 2 09:30:58 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Dec 2 09:30:06 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
* eval.c (thread_mark): mark thread group. [ruby-dev:25020]
@@ -55533,56 +14484,35 @@ Thu Dec 2 07:57:16 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
* io.c (rb_io_ctl): [ruby-dev:25019]
-Wed Dec 1 06:13:00 2004 NARUSE, Yui <naruse@ruby-lang.org>
-
- * ext/nkf/nkf.c: add constant NKF::VERSION
-
- * ext/nkf/nkf.c(guess): this becomes an alias of guess2
-
- * ext/nkf/test.rb: add --no-cp932
-
- * ext/nkf/nkf-utf8/nkf.c: original nkf2 revision 1.47
-
Wed Dec 1 02:21:02 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
* signal.c (sighandler): call handler immediately only for default
handlers. [ruby-dev:25003]
-Tue Nov 30 23:49:12 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * io.c (pipe_open): errno should be preserved for rb_sys_fail() when
- fork failed.
-
-Tue Nov 30 16:18:50 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+Tue Nov 30 23:38:18 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
* io.c (io_fread): need not to null terminate. [ruby-dev:24998]
- * eval.c (rb_eval): should check previous frame for ZSUPER.
-
* io.c (read_all): remove unnecessary rb_str_resize().
- [ruby-dev:24996]
+ [ruby-dev:24996] (backported from CVS HEAD)
* io.c (io_readpartial): ditto.
* io.c (io_read): ditto.
-Tue Nov 30 14:58:33 2004 WATANABE Hirofumi <eban@ruby-lang.org>
+Tue Nov 30 16:18:50 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
- * instruby.rb (install): add arguments explicitly to "super".
+ * io.c (io_fread): need not to null terminate. [ruby-dev:24998]
-Tue Nov 30 00:49:08 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * io.c (read_all): remove unnecessary rb_str_resize().
+ [ruby-dev:24996]
- * eval.c (PUSH_FRAME): flags should have been initialized.
+ * io.c (io_read): ditto.
- * eval.c (rb_eval): [ruby-core:03856]
+Tue Nov 30 00:49:08 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
* io.c (rb_io_sysread): use temporary lock. [ruby-dev:24992]
-Tue Nov 30 00:12:57 2004 Kazuo Saito <ksaito@uranus.dti.ne.jp>
-
- * regparse.c: now handles many alternatives (over 500000)
- in regexp. [ruby-dev:24773]
-
Mon Nov 29 16:06:04 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ext/stringio/stringio.c (strio_write): insufficiently filled string
@@ -55600,19 +14530,10 @@ Mon Nov 29 15:22:28 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
* test/io/nonblock/test_flush.rb: abandon tests when io/nonblock is
not supported.
-Mon Nov 29 13:37:54 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * io.c (fptr_finalize): must not use FILE after fclose().
- [ruby-dev:24985]
-
-Mon Nov 29 13:13:13 2004 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/win32.c (CreateChild): push back the last space before next
- loop because CharNext() eats it.
-
Mon Nov 29 03:08:30 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
- * object.c (convert_type): [ruby-core:03845]
+ * object.c (convert_type): direct call conversion methods for the
+ performance. [ruby-core:03845]
* eval.c (rb_funcall_rescue): new function.
@@ -55620,57 +14541,30 @@ Mon Nov 29 03:08:30 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
* object.c (rb_Integer): ditto.
- * eval.c (get_backtrace): no conversion for nil.
-
* parse.y (reduce_nodes): empty body should return nil.
-Mon Nov 29 01:18:18 2004 Tanaka Akira <akr@m17n.org>
-
- * io.c (rb_io_check_writable): call io_seek regardless of
- NEED_IO_SEEK_BETWEEN_RW. [ruby-dev:24986]
-
-Sun Nov 28 15:57:58 2004 Kouhei Sutou <kou@cozmixng.org>
-
- * lib/rss/rss.rb (RSS::Element#tag): not use block_given? for
- working with ruby 1.6 again.
-
- * lib/rss/{0.9,2.0,trackback}.rb, lib/rss/maker/base.rb:
- undef -> remove_method for working with ruby 1.6 again.
-
-Sun Nov 28 15:51:40 2004 Kouhei Sutou <kou@cozmixng.org>
+ * string.c (rb_str_aset): the original string should not be
+ affected by modifying duplicated string. [ruby-dev:24981]
- * lib/rss/rss.rb (RSS::NotSetError): added.
+Mon Nov 29 13:57:38 2004 NAKAMURA Usaku <usa@ruby-lang.org>
- * lib/rss/maker/{1.0,0.9,2.0}.rb: changed RSS Maker to raise
- RSS::NotSetError if required values of maker.channel are not
- set. [ruby-talk:120061]
-
- * test/rss/test_maker_{1.0,0.9,2.0}.rb: changed tests to check RSS
- Maker raises or not.
-
-Sun Nov 28 12:14:47 2004 Kazuo Saito <ksaito@uranus.dti.ne.jp>
-
- * regparse.c (fetch_token): fixed test failure on HP-UX ia64
- ([ruby-dev:24859]).
-
-Sun Nov 28 12:08:15 2004 Kazuo Saito <ksaito@uranus.dti.ne.jp>
-
- * regparse.c, test/ruby/test_regexp.rb: fixed problem with UTF-8
- characters that have U+00FE or invalid characters.
+ * win32/win32.c (CreateChild): search executable file if no program
+ name given. (backported from CVS HEAD)
-Sun Nov 28 12:07:04 2004 Kazuo Saito <ksaito@uranus.dti.ne.jp>
+Mon Nov 29 13:37:54 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * regexec.c, test/ruby/test_regexp.rb: fixed segmentation fault
- ([ruby-dev:24887]).
+ * io.c (fptr_finalize): must not use FILE after fclose().
+ [ruby-dev:24985]
-Sun Nov 28 12:05:48 2004 Kazuo Saito <ksaito@uranus.dti.ne.jp>
+Mon Nov 29 13:16:31 2004 NAKAMURA Usaku <usa@ruby-lang.org>
- * regcomp.c, regint.h: fixed PLATFORM_UNALIGNED_WORD_ACCESS
- problem ([ruby-dev:24802] and [ruby-core:3733])
+ * win32/win32.c (CreateChild): push back the last space before next
+ loop because CharNext() eats it.
-Sat Nov 27 23:43:39 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+Mon Nov 29 01:18:18 2004 Tanaka Akira <akr@m17n.org>
- * io.c (rb_io_initialize): [ruby-dev:24972]
+ * io.c (rb_io_check_writable): call io_seek regardless of
+ NEED_IO_SEEK_BETWEEN_RW. [ruby-dev:24986]
Sat Nov 27 21:43:39 2004 Tanaka Akira <akr@m17n.org>
@@ -55682,36 +14576,10 @@ Sat Nov 27 21:43:39 2004 Tanaka Akira <akr@m17n.org>
(rb_io_fwrite): wrapper for io_fwrite now.
(io_write): call io_fwrite instead of rb_io_fwrite.
-Sat Nov 27 17:43:21 2004 Kouhei Sutou <kou@cozmixng.org>
-
- * lib/rss/{0.9,1.0,2.0,trackback,xml-stylesheet}.rb: added
- #setup_maker.
-
- * test/rss/test_setup_maker_*.rb: added tests for #setup_maker.
-
- * lib/rss/maker/base.rb(RSS::Maker::Items#max_size=): supported
- output item size limitation.
-
- * sample/rss/blend.rb: added sample for RSS Maker.
-
-Sat Nov 27 17:41:35 2004 Kouhei Sutou <kou@cozmixng.org>
-
- * lib/rss/maker/0.9.rb: supported RSS::Maker.make("0.91"). Now,
- "0.9" is just alias of "0.91."
-
- * test/rss/test_maker_0.9.rb: make("0.9") -> maker("0.91").
-
- * test/rss/test_to_s.rb: ditto.
-
-Sat Nov 27 17:21:30 2004 Kouhei Sutou <kou@cozmixng.org>
-
- * sample/rss/list_description.rb: untabified.
-
- * sample/rss/rss_recent.rb: ditto.
-
Sat Nov 27 14:44:15 2004 Kent Sibilev <ksibilev@bellsouth.net>
- * lib/cgi/session.rb (CGI::Session::initialize): [ruby-core:03832]
+ * lib/cgi/session.rb (CGI::Session::initialize): create_new_id is
+ now a instance method. [ruby-core:03832]
Sat Nov 27 09:41:21 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
@@ -55729,18 +14597,8 @@ Fri Nov 26 18:02:44 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tk/lib/tkextlib/*: some methods uses TkWindow#epath
-Fri Nov 26 14:29:39 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * io.c (rb_io_initialize): uninitialized fd was checked to see open
- mode. [ruby-dev:24963]
-
- * io.c (rb_io_initialize): uninitialized fd was used. [ruby-dev:24962]
-
Fri Nov 26 13:49:06 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
- * io.c (rb_io_initialize): should retrieve flags from copying file
- descriptor. [ruby-dev:24961]
-
* eval.c (method_missing): raise TypeError for classes do not
have allocators. [ruby-core:03752]
@@ -55762,17 +14620,12 @@ Thu Nov 25 20:14:57 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/thwait.rb (ThreadsWait#join_nowait): abnormally terminated
threads should be also processed. [ruby-talk:121320]
-Thu Nov 25 18:06:37 2004 Tanaka Akira <akr@m17n.org>
+Thu Nov 25 10:14:26 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * configure.in: AC_CHECK_SIZEOF(rlim_t) to include stdio.h to fix
- problem with autoconf 2.52 or earlier.
- revert AC_PREREQ to 2.50.
- [ruby-core:3809]
+ * dir.c (push_braces): do not reuse buffer strings. [ruby-core:03806]
Thu Nov 25 07:59:41 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
- * configure.in: AC_PREREQ(2.53) [ruby-core:03800]
-
* io.c (read_all): stringify non-nil buffer argument, and always
taint the result. [ruby-dev:24955]
@@ -55803,12 +14656,13 @@ Tue Nov 23 00:10:48 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
* dir.c (dir_seek): use NUM2OFFT().
- * misc/ruby-mode.el (ruby-non-block-do-re): [ruby-core:03719]
+ * misc/ruby-mode.el (ruby-non-block-do-re): should not match words
+ start with block keyword and underscore. [ruby-core:03719]
Mon Nov 22 22:33:02 2004 Dave Thomas <dave@pragprog.com>
* lib/rdoc/parsers/parse_rb.rb (RDoc::parse_require): Don't use names
- of variables or constants when parsing 'require'
+ of variables or constants when oarsing 'require'
Mon Nov 22 00:13:35 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
@@ -55818,7 +14672,7 @@ Mon Nov 22 00:13:35 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
Sat Nov 20 23:57:33 2004 Dave Thomas <dave@pragprog.com>
* lib/rdoc/README (et al): Add a new directive, :section:, and
- change the output format to accommodate. :section: allows to to
+ change the output format to accomodate. :section: allows to to
group together methods, attributes, constants, etc under
headings in the output. If used, a table of contents is
generated.
@@ -55833,25 +14687,9 @@ Sat Nov 20 23:55:19 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
* string.c (rb_str_splice): should place index wrapping after
possible modification. [ruby-dev:24940]
-Sat Nov 20 23:25:12 2004 Minero Aoki <aamine@loveruby.net>
-
- * io.c (rb_io_getline): f.gets("") did not work. [ruby-core:03771]
-
- * test/ruby/test_io.rb (test_gets_rs): test it.
-
-Sat Nov 20 22:55:09 2004 WATANABE Hirofumi <eban@ruby-lang.org>
-
- * test/runner.rb (CROSS_COMPILING): need to require rbconfig.rb before
- using CROSS_COMPILNG.
+Sat Nov 20 13:26:03 2004 NARUSE, Yui <naruse@ruby-lang.org>
-Sat Nov 20 20:42:42 2004 Minero Aoki <aamine@loveruby.net>
-
- * ext/ripper/depend: fix ripper.o dependency.
-
-Sat Nov 20 17:48:29 2004 WATANABE Hirofumi <eban@ruby-lang.org>
-
- * io.c (io_reopen): work around problem with Cygwin fseeko
- returning ESPIPE.
+ * ext/nkf/nkf-utf8/utf8tbl.c: original revision 1.7
Sat Nov 20 05:34:24 2004 NARUSE, Yui <naruse@ruby-lang.org>
@@ -55859,11 +14697,6 @@ Sat Nov 20 05:34:24 2004 NARUSE, Yui <naruse@ruby-lang.org>
* ext/nkf/test.rb: add test for mime encode/decode
-Sat Nov 20 01:45:04 2004 WATANABE Hirofumi <eban@ruby-lang.org>
-
- * test/xmlrpc/test_webrick_server.rb: move `requrie "webrick/https"'
- into #setup_http_server method to avoid soap test errors.
-
Sat Nov 20 01:37:34 2004 Johan Holmberg <holmberg@iar.se>
* eval.c (error_print): nicer traceback at interrupt.
@@ -55874,66 +14707,6 @@ Sat Nov 20 00:07:16 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
* string.c (str_gsub): internal buffer should not be listed by
ObjectSpace.each_object() by String#gsub. [ruby-dev:24931]
-Fri Nov 19 22:44:43 2004 WATANABE Hirofumi <eban@ruby-lang.org>
-
- * lib/test/unit/collector/dir.rb: better support for -p/-x option.
-
-Fri Nov 19 17:46:56 2004 Kouhei Sutou <kou@cozmixng.org>
-
- * lib/rss/maker/0.9.rb (RSS::Maker::RSS09::Image#have_required_values):
- changed /rss/channel/image to be optional. [ruby-Bugs:1047]
-
- * test/rss/test_maker_0.9.rb: added tests for the above.
-
-Fri Nov 19 17:18:17 2004 Kouhei Sutou <kou@cozmixng.org>
-
- * lib/rss/rss.rb (RSS::VERSION): 0.1.0 -> 0.1.1.
-
- * lib/rss: #to_s used #tag.
-
- * test/rss/test_to_s.rb: added.
-
- * lib/rss/maker.rb (RSS::Maker.make): changed API. It's not
- received modules which is used as the second argument.
-
- * lib/rss/xml-stylesheet.rb (RSS::XMLStyleSheet#alternate):
- changed return value type which is not String but Boolean.
-
- * lib/rss/2.0.rb (RSS::Rss::Channel#ttl): changed return value
- type which is not String but Integer.
-
- * lib/rss/0.9.rb (RSS::Rss::Channel): <skipDays> has <day>s and
- <skipHours> has <hour>s.
-
- * lib/rss/maker/0.9.rb (RSS::Maker::RSS09::Channel): ditto.
-
- * lib/rss/0.9.rb (RSS::Rss::Channel::Item): <item> has <category>s.
-
- * lib/rss/maker/2.0.rb (RSS::Maker::Rss20::Channel::Item): ditto.
-
- * lib/rss/2.0.rb (RSS::Rss::Channel): <channel> has <category>s.
-
- * lib/rss/maker/2.0.rb (RSS::Maker::RSS20::Channel): ditto.
-
- * lib/rss/trackback.rb: parent element has <trackback:about>s.
-
- * lib/rss/maker/trackback.rb: ditto.
-
-Fri Nov 19 11:10:16 2004 WATANABE Hirofumi <eban@ruby-lang.org>
-
- * lib/test/unit/collector/dir.rb: add support for directory name
- with -p/-x options.
-
- * test/testunit/collector/test_dir.rb: ditto.
-
- * lib/xmlrpc/datetime.rb (XMLRPC::DateTime#==): should use Array()
- instead of to_a.
-
-Fri Nov 19 10:32:36 2004 Shugo Maeda <shugo@ruby-lang.org>
-
- * ext/readline/readline.c (readline_s_set_completion_append_character):
- accept nil. [ruby-core:03765]
-
Fri Nov 19 01:20:22 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
* lib/cgi/session.rb (CGI::Session::FileStore::initialize): raise
@@ -55945,37 +14718,12 @@ Fri Nov 19 00:59:31 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
* string.c (str_gsub): internal buffer should not be listed by
ObjectSpace.each_object(). [ruby-dev:24919]
-Thu Nov 18 23:42:36 2004 Minero Aoki <aamine@loveruby.net>
-
- * ext/ripper/depend: Never regenerate lib/ripper/core.rb
- automatically. [ruby-dev:24911]
-
-Thu Nov 18 20:47:24 2004 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/win32.[ch] (rb_w32_isatty): new function to replace MSVCRT's
- isatty because it never sets errno.
-
Thu Nov 18 18:41:08 2004 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
* test/ruby/test_stringchar.rb (test_bang): added.
* string.c (rb_str_upcase_bang, rb_str_capitalize_bang)
- (rb_str_swapcase_bang): missing rb_str_modify().
-
-Thu Nov 18 17:05:01 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (f_rest_arg): store rest args into invisible local variable
- in order to get rid of SEGV at ZSUPER. [ruby-dev:24913]
-
-Thu Nov 18 15:39:52 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * hash.c (rb_f_getenv): prohibit for $SAFE=4. [ruby-dev:24908]
-
-Thu Nov 18 14:58:42 2004 Shugo Maeda <shugo@ruby-lang.org>
-
- * ext/readline/readline.c: check $SAFE.
-
- * test/readline/test_readline.rb: added tests for readline.
+ (rb_str_swapcase_bang): missing rb_str_modify(). [ruby-dev:24915]
Thu Nov 18 00:21:15 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
@@ -55996,15 +14744,10 @@ Thu Nov 18 10:10:14 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ext/stringio/stringio.c (strio_initialize): allow Fixnum as mode as
well as IO.new does. [ruby-dev:24896]
-Wed Nov 17 23:47:30 2004 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+Wed Nov 17 23:42:40 2004 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
* test/ruby/test_settracefunc.rb: added. [ruby-dev:24884]
-Wed Nov 17 18:59:16 2004 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-
- * process.c (proc_getrlimit, proc_setrlimit): add rb_secure(2) to
- methods of Process.{getrlimit,setrlimit}
-
Wed Nov 17 13:56:57 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
* parse.y (newline_node): should not use FL_SET. [ruby-dev:24874]
@@ -56014,65 +14757,28 @@ Wed Nov 17 13:56:57 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
* node.h (NODE_NEWLINE): remove unused bit to utilize flag field
in nodes.
-Wed Nov 17 13:05:10 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Nov 17 13:09:40 2004 NAKAMURA Usaku <usa@ruby-lang.org>
- * dir.c (rb_push_glob): fix overrun. [ruby-dev:24886]
+ * {bcc32,win32,wince}/Makefile.sub (test): should build ruby.exe
+ before running test. [ruby-core:03756]
-Wed Nov 17 11:48:17 2004 Michael Neumann <mneumann@ruby-lang.org>
+Wed Nov 17 04:33:01 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
- * lib/xmlrpc/parser.rb, test/xmlrpc/test_features.rb: fixed "assigning
- to constants" warnings
+ * pack.c: all features are backport from 1.9. [ruby-dev:24826]
-Wed Nov 17 09:38:18 2004 Johan Holmberg <holmberg@iar.se>
-
- * re.c (rb_reg_initialize_m): should raise exception instead of
- compile error. [ruby-core:03755]
+ * bignum.c (rb_big2ulong_pack): new function to pack Bignums.
Wed Nov 17 03:42:45 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
* string.c (rb_str_splice): move rb_str_modify() after
StringValue(), which may alter the receiver. [ruby-dev:24878]
- * error.c (rb_error_frozen): now raise RuntimeError instead of
- TypeError.
-
-Tue Nov 16 21:22:47 2004 Michael Neumann <mneumann@ruby-lang.org>
-
- * lib/xmlrpc/server.rb (CGIServer): fixed bug when client sends
- "Content-typ: text/xml; ..."
-
Tue Nov 16 23:45:07 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
* numeric.c (flo_divmod): protect float values from GC by
assignment to local variables. [ruby-dev:24873]
-Tue Nov 16 14:31:54 2004 Michael Neumann <mneumann@ruby-lang.org>
-
- * test/xmlrpc/*: imported and refactored original test cases.
-
- * test/xmlrpc/test_webrick_server.rb, test/xmlrpc/webrick_testing.rb:
- added test case that starts up a WEBrick XML-RPC server and performs
- some tests on it (both http and https servers are started).
-
- * lib/xmlrpc/create.rb (XMLWriter::each_installed_writer),
- lib/xmlrpc/parser.rb (XMLParser::each_installed_parser):
- added methods to simply original test cases
-
- * lib/xmlrpc/parser.rb, lib/xmlrpc/datetime.rb: applied patch by
- MoonWolf <moonwolf@moonwolf.com> to allow parsing datetime.iso8601
- (e.g. 20041105T01:15:23Z).
-
- * lib/xmlrpc/server.rb: fixed issue #998
- (http://rubyforge.org/tracker/?func=detail&atid=1700&aid=998&group_id=426)
-
- * lib/xmlrpc/create.rb, lib/xmlrpc/utils.rb: when marshalling/loading
- user-defined data structures, use Class#allocate instead of defining
- an empty #initialize method. module XMLRPC::Marshallable is now only
- used for tagging.
-
- * lib/xmlrpc/.document, lib/xmlrpc/README.rdoc: added howto
-
-Tue Nov 16 16:26:12 2004 NAKAMURA Usaku <usa@ruby-lang.org>
+Tue Nov 16 16:30:21 2004 NAKAMURA Usaku <usa@ruby-lang.org>
* {bcc32,win32,wince}/setup.mak (-epilogue-): remove config.h and
config.status to force updating them.
@@ -56082,15 +14788,6 @@ Tue Nov 16 16:20:45 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ext/stringio/stringio.c (strio_read): position was ignored when a
buffer was passed. http://www.yo.rim.or.jp/~nov/d/?date=20041116#p03
-Tue Nov 16 13:35:54 2004 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * lib/test/unit/autorunner.rb (Test::Unit::AutoRunner::options): add
- new option --exclude (-x) to skip some tests. [ruby-core:3363],
- [ruby-dev:24865]
-
- * lib/test/unit/collector/dir.rb (Test::Unit::Collector::Dir.exclude):
- ditto.
-
Tue Nov 16 11:19:07 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/test/unit/autorunner.rb (Test::Unit::AutoRunner::options): use
@@ -56104,72 +14801,32 @@ Tue Nov 16 01:41:31 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
* array.c (rb_ary_update): pedantic check to detect
rb_ary_to_ary() to modify the receiver. [ruby-dev:24861]
-Mon Nov 15 18:58:05 2004 Tanaka Akira <akr@m17n.org>
+Mon Nov 15 13:50:52 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
- * configure.in: check rlim_t more portably. [ruby-core:3735]
+ * string.c (rb_str_justify): typo fixed. [ruby-dev:24851]
Mon Nov 15 11:50:32 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
* misc/ruby-mode.el (ruby-special-char-p, ruby-parse-partial): handle
operator symbols. [ruby-talk:120177]
-Mon Nov 15 08:58:55 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (Init_Proc): make proc as an alias to Proc.new.
- [ruby-dev:24848]
-
-Mon Nov 15 00:46:03 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (rb_yield_0): lambda{}.call(1) should raise exception.
- [ruby-talk:120253]
-
-Mon Nov 15 00:33:40 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * string.c (rb_str_clear): avoid revealing NULL pointer.
- [ruby-dev:24766]
-
- * string.c (str_gsub): add paranoid check. [ruby-dev:24827]
-
- * string.c (str_mod_check): check frozen status as well.
- [ruby-dev:24801]
-
-Sun Nov 14 18:59:03 2004 Tanaka Akira <akr@m17n.org>
-
- * process.c (proc_getrlimit): new function for Process.getrlimit.
- (proc_setrlimit): new function for Process.setrlimit.
- [ruby-dev:24834]
-
- * configure.in: check rlim_t and its size. check setrlimit.
-
- * ruby.h (NUM2ULL): new macro.
-
Sun Nov 14 13:27:03 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/pp.rb (PP#object_address_group): remove odd number of 'f'
prefixed to negative address.
-Sun Nov 14 10:48:21 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/mathn.rb (Integer::gcd2): faster implementation by
- <erlercw@siu.edu>. [ruby-talk:120232]
-
-Sun Nov 14 08:46:33 2004 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+Sun Nov 14 08:51:04 2004 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
* test/logger/test_logger.rb: Logger just expects
Logger#datetime_format to be used for Time#strftime independently of
locale. [ruby-dev:24828]
-Fri Nov 12 17:32:07 2004 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * bcc32/README.bcc32, win32/README.win32: need bison instead of
- byacc.
-
-Fri Nov 12 15:15:06 2004 NAKAMURA Usaku <usa@ruby-lang.org>
+Fri Nov 12 15:03:26 2004 NAKAMURA Usaku <usa@ruby-lang.org>
* eval.c (ruby_options): now we cannot call rb_glob() before
ruby_init(), so call rb_w32_cmdvector() at ruby_options().
- * win32/win32.{c,h} (rb_w32_cmdvector): rename make_cmdvector() and
+ * win32.{c,h} (rb_w32_cmdvector): rename make_cmdvector() and
export it.
Fri Nov 12 14:08:01 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
@@ -56183,15 +14840,21 @@ Fri Nov 12 00:31:05 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
* ext/gdbm/gdbm.c (fgdbm_store): StringValue() may alter string
pointer. [ruby-dev:24783]
-Thu Nov 11 17:58:19 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+Thu Nov 11 17:36:12 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * dir.c (rb_glob): should have called rb_glob_caller().
- [ruby-dev:24773]
+ * dir.c (rb_globi): also should call back via rb_glob_caller().
+ [ruby-dev:24775]
-Thu Nov 11 16:56:10 2004 NAKAMURA Usaku <usa@ruby-lang.org>
+Thu Nov 11 16:47:21 2004 NAKAMURA Usaku <usa@ruby-lang.org>
* test/ruby/test_file.rb (test_truncate_wbuf): we want to test
- only File#truncate, not behavior of seek(2).
+ only File#truncate, not behaviour of seek(2).
+
+Thu Nov 11 09:41:01 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * dir.c (push_braces): was confusing VALUE and char*.
+
+ * dir.c (rb_push_glob): Dir.glob should have called its block.
Thu Nov 11 01:52:52 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
@@ -56205,10 +14868,6 @@ Wed Nov 10 22:49:01 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
* lib/delegate.rb (DelegateClass::dup): ditto.
-Wed Nov 10 19:47:55 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * dir.c (glob_helper): path is a string object now.
-
Wed Nov 10 12:31:21 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
* README.EXT (Example): extconf.rb is indispensable now.
@@ -56220,22 +14879,10 @@ Wed Nov 10 03:33:36 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tk/lib/tkextlib/tile/style.rb: bug fix
-Tue Nov 9 22:24:07 2004 NARUSE, Yui <naruse@ruby-lang.org>
-
- * ext/nkf: original nkf.c rev:1.38
-
- * ext/nkf/nkf.c: fix bug: can't parse long-name options
-
- * ext/nkf/test.rb: fix bug: mime tests fail
-
Tue Nov 9 14:27:18 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/optparse.rb (OptionParser::Officious): moved from DefaultList.
-Tue Nov 9 00:50:06 2004 Dave Thomas <dave@pragprog.com>
-
- * lib/rdoc/rdoc.rb: Change version numbering of RDoc and ri
-
Tue Nov 9 01:05:04 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
* dir.c (rb_glob2): do not allocate buffer from heap to avoid
@@ -56249,7 +14896,15 @@ Tue Nov 9 01:05:04 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
* dir.c (fnmatch): p or s may be NULL. [ruby-dev:24749]
-Tue Nov 9 00:36:26 2004 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+Tue Nov 9 00:53:53 2004 WATANABE Hirofumi <eban@ruby-lang.org>
+
+ * regex.c (slow_match): avoid GCC 3.4.x warnings.
+
+Tue Nov 9 00:50:06 2004 Dave Thomas <dave@pragprog.com>
+
+ * lib/rdoc/rdoc.rb: Change version numbering of RDoc and ri
+
+Mon Nov 8 23:38:35 2004 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
* lib/drb/extservm.rb: add DRb::ExtServManager#uri=.
[ruby-dev:24743]
@@ -56280,14 +14935,13 @@ Sun Nov 7 23:49:26 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tk/lib/tkextlib: ditto.
-Sat Nov 6 20:40:16 2004 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-
- * ext/win32ole/win32ole.c: rename WIN32OLE#ole_obj_help to
- WIN32OLE#ole_type. alias ole_obj_help to ole_type.
+Sat Nov 6 14:58:44 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
- * ext/win32ole/tests/testWIN32OLE.rb: ditto.
+ * lib/webrick/server.rb (WEBrick::HTTPServer#start): remove
+ :DoNotReverseLookup option. (Socket#do_not_reverse_lookup is a
+ ruby 1.9 feature)
-Sat Nov 6 11:18:59 2004 Tadayoshi Funaba <tadf@dotrb.org>
+Sat Nov 6 11:31:04 2004 Tadayoshi Funaba <tadf@dotrb.org>
* lib/date.rb (_parse): checks whether zone was given.
@@ -56296,10 +14950,6 @@ Sat Nov 6 00:46:27 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
* string.c (rb_str_locktmp): check STR_TMPLOCK flag before
locking. [ruby-dev:24727]
-Fri Nov 5 19:07:16 2004 NARUSE, Yui <naruse@ruby-lang.org>
-
- * ext/nkf: follow CVS Head of original nkf.
-
Fri Nov 5 18:12:42 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tk/lib/tk/scrollable.rb: divide Scrollable module into
@@ -56326,43 +14976,23 @@ Fri Nov 5 08:52:48 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
* gc.c (gc_mark): stricter GC stack check.
+Fri Nov 5 08:52:48 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * gc.c (gc_mark): stricter GC stack check.
+
Fri Nov 5 08:34:43 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
* string.c (str_gsub): should have removed rb_str_unlocktmp(str).
[ruby-dev:24708]
- * ext/socket/socket.c (s_recvfrom): buffer modification check.
- [ruby-dev:24708]
-
-Thu Nov 4 23:54:21 2004 Kazuo Saito <ksaito@uranus.dti.ne.jp>
-
- * regexec.c, regparse.c, regint.h: fixed conflicts between
- vendor branch.
-
-Thu Nov 4 23:41:55 2004 Kazuo Saito <ksaito@uranus.dti.ne.jp>
-
- * ascii.c, euc_jp.c, oniggnu.h, oniguruma.h, regcomp.c,
- regenc.c, regenc.h, regerror.c, regexec.c, reggnu.c,
- regint.h, regparse.c, regparse.h, sjis.c, utf8.c:
- imported Oni Guruma 3.4.0.
-
- * parse.y, re.c: Now mbclen() takes unsigned char as
- its argument.
-
Thu Nov 4 21:25:38 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
* string.c (str_gsub): string modify check no longer based on
tmplock. [ruby-dev:24706]
-Thu Nov 4 21:13:48 2004 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-
- * ext/win32ole/win32ole.c(typelib_file_from_typelib): search "win16"
- entry to get library path.
+Thu Nov 4 19:27:46 2004 NAKAMURA Usaku <usa@ruby-lang.org>
- * ext/win32ole/win32ole.c(oletypelib_path): ditto.
-
- * ext/win32ole/win32ole.c(ole_typedesc2val): add VT_LPWSTR, VT_LPSTR,
- VT_ERROR case.
+ * io.c (rb_f_open): fix typo.
Thu Nov 4 15:02:14 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
@@ -56380,6 +15010,10 @@ Thu Nov 4 03:11:33 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
* ext/socket/socket.c (s_recvfrom): tmplock input buffer.
[ruby-dev:24705]
+Wed Nov 3 22:32:12 2004 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * process.c: On NetBSD don't use setruid() and setrgid().
+
Wed Nov 3 22:24:17 2004 Daigo Moriwaki <techml@sgtpepper.net>
* lib/webrick/httpauth/digestauth.rb: use Base64.encode64 to
@@ -56394,7 +15028,11 @@ Wed Nov 3 17:19:59 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
* array.c (rb_ary_or): ditto.
-Wed Nov 3 17:02:48 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Wed Nov 3 17:13:02 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+
+ * io.c (pipe_open): fix compile error
+
+Wed Nov 3 16:58:07 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tk/lib/tk.rb: support to use different Tcl commands between
configure and configinfo
@@ -56410,55 +15048,33 @@ Wed Nov 3 17:02:48 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tk/lib/tkextlib: some bug fixes (see ext/tk/ChangeLog.tkextlib)
-Wed Nov 3 15:38:28 2004 Kouhei Sutou <kou@cozmixng.org>
+Wed Nov 3 16:30:41 2004 NARUSE, Yui <naruse@ruby-lang.org>
- * test/rss/*.rb: removed tab width configuration headers.
+ * ext/nkf: follow nkf 2.0.4
- * test/rss/test_maker_{0.9,1.0}.rb: sort -> do_sort.
+Wed Nov 3 15:53:34 2004 Kouhei Sutou <kou@cozmixng.org>
- * lib/rss/maker/*.rb: changed API to RSS version independence.
-
- * lib/rss/maker/base.rb
- (RSS::Maker::XMLStyleSheets::XMLStyleSheet): checked required
- (pseudo) attributes.
-
- * lib/rss/maker/base.rb (RSS::Maker::Items): sort -> do_sort.
+ * test/rss/test_maker_*.rb: added tests for RSS Maker.
- * lib/rss/rss.rb (RSS::BaseModel.install_date_element): avoided
- warning.
+ * lib/rss/maker.rb: added RSS Maker.
- * lib/rss/0.9.rb (RSS::Rss#textinput): added convenience method.
+ * lib/rss/maker/*.rb: ditto.
Tue Nov 2 16:35:57 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
* ext/enumerator/enumerator.c (each_cons_i): pass copy of an
internal consequent array. [ruby-talk:118691]
-Tue Nov 2 14:54:02 2004 NAKAMURA Usaku <usa@ruby-lang.org>
+Tue Nov 2 16:05:21 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
- * io.c (pipe_open): need to set cmd if argc == 0 (win32).
+ * process.c (rb_f_fork): need to flush stdout and stderr before
+ fork(2). [ruby-talk:117715]
Tue Nov 2 01:20:09 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
- * io.c (pipe_open): IO.popen should take array as 1st argument for
- a command line. [ruby-dev:24678]
-
* eval.c (proc_invoke): nail down dyna_var node when Proc object
or continuation is created. [ruby-dev:24671]
- * io.c (rb_io_s_popen): do not expand argv array. [ruby-dev:24670]
-
-Mon Nov 1 22:25:56 2004 Kouhei Sutou <kou@cozmixng.org>
-
- * lib/rss/maker/base.rb: changed xml-stylesheet's API of RSS Maker
- like to item's one.
-
- * lib/rss/xml-stylesheet.rb (RSS::XMLStyleSheet#guess_type): fixed
- regular expression bug.
-
- * test/rss/test_maker_xml-stylesheet.rb: updated tests for
- xml-stylesheet.
-
Mon Nov 1 13:59:28 2004 WATANABE Hirofumi <eban@ruby-lang.org>
* ext/extmk.rb (MANIFEST): do not use anymore, use extconf.rb instead.
@@ -56470,29 +15086,15 @@ Mon Nov 1 13:59:28 2004 WATANABE Hirofumi <eban@ruby-lang.org>
* README.EXT, README.EXT.ja: remove MANIFEST stuff.
-Mon Nov 1 11:52:18 2004 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * io.c (pipe_open): avoid conflict of variable name. [ruby-dev:24662]
-
-Mon Nov 1 11:46:19 2004 WATANABE Hirofumi <eban@ruby-lang.org>
-
- * process.c (rb_f_exec): should check whether prog is NULL.
-
-Mon Nov 1 09:37:19 2004 Kouhei Sutou <kou@cozmixng.org>
-
- * lib/rss/maker.rb: added entry point of RSS Maker.
-
-Mon Nov 1 03:14:14 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+Mon Nov 1 01:14:52 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
- * eval.c (rb_get_method_body): store ICLASS in the cache.
- [ruby-core:03672]
+ * io.c (rb_f_open): create copy of popen specifier. [ruby-dev:24656]
- * eval.c (rb_provided): should return true for loading library
- too for autoloading. [ruby-core:03655]
+Mon Nov 1 00:36:48 2004 WATANABE Hirofumi <eban@ruby-lang.org>
-Mon Nov 1 01:14:52 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * main.c (_stklen): move to gc.c.
- * io.c (rb_f_open): create copy of popen specifier. [ruby-dev:24656]
+Sun Oct 31 00:22:28 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
* string.c (rb_str_locktmp): lock string temporarily.
@@ -56505,54 +15107,15 @@ Mon Nov 1 01:14:52 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
* io.c (read_all): ditto.
-Sun Oct 31 23:37:00 2004 NARUSE, Yui <naruse@ruby-lang.org>
-
- * process.c: on NetBSD don't use setruid() and setrgid().
-
-Sun Oct 31 23:12:10 2004 Kouhei Sutou <kou@cozmixng.org>
-
- * lib/rss/maker/*.rb: added RSS Maker.
-
- * test/rss/test_maker_*.rb: added tests for RSS Maker.
-
-Sun Oct 31 16:58:12 2004 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-
- * ext/win32ole/win32ole.c: add WIN32OLE.codepage, WIN32OLE.codepage=.
-
- * ext/win32ole/tests/testWIN32OLE.rb: ditto.
-
-Sun Oct 31 14:35:26 2004 WATANABE Hirofumi <eban@ruby-lang.org>
-
- * ext/nkf/nkf-utf8/nkf.c: add "\075?UTF-8?Q?" for Gmail.
-
-Sun Oct 31 14:18:56 2004 Minero Aoki <aamine@loveruby.net>
-
- * parse.y [ripper]: emit lexer-event values to the parser
- (still incomplete).
-
-Sat Oct 30 15:24:41 2004 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-
- * ext/win32ole/win32ole.c: add WIN32OLE_TYPELIB class. add
- WIN32OLE#ole_typelib method.
-
- * ext/win32ole/tests/testOLETYPELIB.rb: add WIN32OLE_TYPELIB class.
-
Sat Oct 30 06:53:24 2004 Peter Vanbroekhoven <peter.vanbroekhoven@cs.kuleuven.ac.be>
* eval.c (rb_eval): NODE_XSTR should pass copy of literal string.
Sat Oct 30 00:19:40 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
- * array.c (rb_ary_update): a[n,m]=nil no longer works as element
- deletion.
-
* enum.c (enum_sort_by): protect continuation jump in.
[ruby-dev:24642]
- * eval.c (rb_eval), gc.c (gc_mark_children), node.h (NEW_ALIAS,
- NEW_VALIAS), parse.y (fitem): allow dynamic symbols to
- NODE_UNDEF and NODE_ALIAS.
-
Fri Oct 29 21:27:51 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
* io.c (rb_io_check_initialized): new function to check uninitialized
@@ -56560,26 +15123,6 @@ Fri Oct 29 21:27:51 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
* file.c (rb_file_path), io.c (rb_io_closed): check if initialized.
-Fri Oct 29 19:05:33 2004 NARUSE, Yui <naruse@ruby-lang.org>
-
- * ext/nkf: follow nkf2.0.
-
-Fri Oct 29 17:18:22 2004 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * parse.y (ripper_s_allocate): add prototype for Microsoft compiler.
-
- * range.c (range_step, range_each): need cast.
-
-Fri Oct 29 16:34:19 2004 Daiki Ueno <ueno@unixuser.org>
-
- * misc/ruby-mode.el (ruby-parse-partial): Parse the rest of the
- line after opening heredoc identifier. [ruby-dev:24635]
-
-Fri Oct 29 11:35:04 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (rb_parser_append_print, rb_parser_while_loop): body node
- can be empty. [ruby-dev:24628]
-
Fri Oct 29 10:00:30 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
* eval.c (rb_thread_start_0): forget to free some memory chunks.
@@ -56594,20 +15137,32 @@ Thu Oct 28 08:42:02 2004 Tanaka Akira <akr@m17n.org>
(argf_read): call argf_forward with argv argument.
[ruby-dev:24624]
+Thu Oct 28 23:32:54 2004 akira yamada <akira@ruby-lang.org>
+
+ * ext/zlib/zlib.c (zstream_detach_input): resets klass of z->input if
+ z->input isn't nil.
+
+Thu Oct 28 23:19:31 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/extmk.rb: prefer relative path. [ruby-talk:93037]
+
+Wed Oct 27 18:49:11 2004 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * gc.c: prototype; rb_io_fptr_finalize() doesn't return any value
+ at this version.
+
+Wed Oct 27 17:27:45 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * gc.c (gc_sweep): recover ruby_in_compile variable.
+
Wed Oct 27 09:17:30 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
* string.c (str_gsub): use a string object for exception safeness.
[ruby-dev:24601]
-Wed Oct 27 07:38:55 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+Tue Oct 26 23:52:32 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * node.h (NODE_TYPESHIFT): allow 4 more bits for line numbers.
- [ruby-talk:117841]
-
- * ruby.h (FL_ABLE): nodes are not subject for flag operations.
-
- * io.c (ARGF_FORWARD): should have specified argv explicitly,
- since we no longer have frame->argv saved. [ruby-dev:24602]
+ * io.c (rb_io_getline): rs modification check should not interfere in the loop.
Tue Oct 26 23:30:39 2004 Dave Thomas <dave@pragprog.com>
@@ -56629,6 +15184,16 @@ Tue Oct 26 10:56:55 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
* sprintf.c (rb_f_sprintf): raise ArgumentError for extra
arguments, unless (digit)$ style used.
+Tue Oct 26 11:33:26 2004 David G. Andersen <dga@lcs.mit.edu>
+
+ * ext/zlib/zlib.c (gzreader_gets): use memchr() to to gain
+ performance. [ruby-talk:117701]
+
+Tue Oct 26 10:56:55 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * sprintf.c (rb_f_sprintf): raise ArgumentError for extra
+ arguments, unless (digit)$ style used.
+
Mon Oct 25 18:35:39 2004 WATANABE Hirofumi <eban@ruby-lang.org>
* win32/win32.c (isUNCRoot): should check NUL after '.'.
@@ -56640,16 +15205,11 @@ Mon Oct 25 08:03:26 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
* eval.c (get_backtrace): ignore illegal backtrace. [ruby-dev:24587]
-Sun Oct 24 00:40:50 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun Oct 24 00:41:09 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
* eval.c (rb_load, search_required, rb_require_safe, rb_require): use
frozen shared string to avoid outside modification. [ruby-dev:24580]
-Sat Oct 23 23:40:34 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * io.c (rb_io_fptr_finalize): leave stdin/stdout/stderr open in
- interpreter termination. [ruby-dev:24579]
-
Sat Oct 23 22:18:32 2004 Guy Decoux <ts@moulon.inra.fr>
* eval.c (frame_free): Guy Decoux solved the leak problem.
@@ -56693,10 +15253,6 @@ Thu Oct 21 19:06:15 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
* lib/webrick/httpresponse.rb (WEBrick::HTTPResponse#send_body_io):
ensure to close @body. (http://bugs.debian.org/277520)
-Thu Oct 21 13:11:31 2004 WATANABE Hirofumi <eban@ruby-lang.org>
-
- * io.c (pipe_open): variable name "fpw" is conflicted.
-
Thu Oct 21 00:36:41 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
* eval.c (rb_alias): should warn on method discarding.
@@ -56705,21 +15261,11 @@ Thu Oct 21 00:36:41 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
* ext/zlib/zlib.c (zstream_expand_buffer_into): hide internal
string buffer by clearing klass. [ruby-dev:24548]
- * parse.y (lex_getline): should not touch ruby_debug_lines if
- RIPPER is defined. [ruby-dev:24547]
-
Wed Oct 20 19:45:13 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
* string.c (str_gsub): reentrant check. [ruby-dev:24432]
-Wed Oct 20 12:42:53 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * io.c (rb_io_getline): rs modification check should not interfere
- in the loop.
-
-Wed Oct 20 10:31:33 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * parse.y (lex_getline): should update ruby_debug_lines.
+ * backport all SEGV bug fixes from CVS HEAD. [ruby-dev:24536]
Wed Oct 20 04:17:55 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
@@ -56741,23 +15287,13 @@ Wed Oct 20 01:37:18 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
* eval.c (ruby_exec): stack marking position may be higher than
expected. thanks to Guy Decoux. [ruby-core:03527]
-Wed Oct 20 00:25:41 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval.c (search_required): required name must not be changed before
- loading. [ruby-dev:24492]
-
-Tue Oct 19 23:59:46 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval.c (rb_require_safe): provide the feature after loaded.
- [ruby-list:40085]
-
Tue Oct 19 22:43:12 2004 Dave Thomas <dave@pragprog.com>
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_attr): If
we come across 'attr' in a context where it isn't
followed by a symbol, just issue a warning.
-Tue Oct 19 20:32:50 2004 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+Tue Oct 19 20:41:37 2004 Masaki Suketa <masaki.suketa@nifty.ne.jp>
* ext/win32ole.c(ole_invoke): retrieve the result value when
retrying the IDispatch::invoke.
@@ -56777,7 +15313,15 @@ Tue Oct 19 17:24:11 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
* ext/zlib/zlib.c (zstream_expand_buffer): hide internal string
buffer by clearing klass. [ruby-dev:24510]
-Tue Oct 19 08:47:21 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Oct 19 16:12:18 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+
+ * ext/tk/tkutil.c: backport from CVS HEAD
+
+Tue Oct 19 08:54:26 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * intern.h, object.c (rb_class_inherited_p): export.
+
+Tue Oct 19 08:46:57 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
* string.c (rb_str_upto): method result must be checked. [ruby-dev:24504]
@@ -56788,20 +15332,60 @@ Mon Oct 18 23:37:05 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
* marshal.c (r_object0): check inheritance by the internal function.
[ruby-dev:24515]
-Mon Oct 18 11:29:32 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Oct 18 15:58:01 2004 NAKAMURA Usaku <usa@ruby-lang.org>
- * io.c (rb_io_flags_mode, rb_io_mode_flags): distinguish whether file
- not existing is created. [ruby-dev:24505]
+ * range.c (range_step, range_each): need cast.
+
+Fri Oct 29 16:34:19 2004 Daiki Ueno <ueno@unixuser.org>
+
+ * misc/ruby-mode.el (ruby-parse-partial): Parse the rest of the
+ line after opening heredoc identifier. [ruby-dev:24635]
Mon Oct 18 07:26:21 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
* file.c (rb_file_truncate): discard read buffer before truncation.
[ruby-dev:24197]
-Mon Oct 18 01:56:03 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Mon Oct 18 02:11:21 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
+
+ * lib/webrick/config.rb (WEBrick::Config::General): add default values:
+ - WEBrick::Config[:DoNotReverseLookup]
+ - WEBrick::Config[:RequestCallback] (it used as an alias of
+ :RequestHandler in WEBrick::HTTPServer#run)
+ - WEBrick::Config::FileHandler[:AcceptableLanguages]
+
+ * lib/webrick/httpservlet/filehandler.rb
+ (WEBrick::HTTPServlet::FileHandler#set_filename): search files
+ having suffix of language-name which Accept-Language header field
+ includes if :AcceptableLanguages options is present.
+
+ * lib/webrick/httpservlet/filehandler.rb
+ (WEBrick::HTTPServlet::FileHandler#get_servlet): new method to
+ search servlet correspond to the suffix of filename.
+
+ * lib/webrick/httprequest.rb: add attributes access methods: accept,
+ accept_charset, accept_encoding, accept_language, content_length
+ and content_type.
+
+ * lib/webrick/httpresponse.rb: add attribute access methods:
+ content_length, content_length=, content_type and content_type=.
+
+ * lib/webrick/httputils.rb (WEBrick::HTTPUtils.mime_types):
+ use the second suffix to detect media type. (the first suffix
+ may be a language name.)
+
+ * lib/webrick/httputils.rb (WEBrick::HTTPUtils.parse_qvalues):
+ add method to parse Accept header field. it returns an Array of
+ values sorted by the qvalues.
+
+Mon Oct 18 02:04:11 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
+
+ * lib/webrick/httpserver.rb (WEBrick::HTTPServer#virtual_host): new
+ method to register virtual hosting servers.
- * lib/webrick/httprequest.rb (WEBrick::HTTPRequest#initialize):
- initial value of accpet-* should be array.
+ * lib/webrick/server.rb (WEBrick::GenericServer#accept): call
+ do_not_reverse_lookup for each socket if :DoNotReverseLookup
+ is set. [ruby-core:02357]
Mon Oct 18 00:42:45 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
@@ -56815,7 +15399,7 @@ Sun Oct 17 23:03:48 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tk/lib/tk/timer.rb: TkTimer#start and restart accept a block
-Sun Oct 17 12:53:46 2004 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+Sun Oct 17 13:05:04 2004 Masaki Suketa <masaki.suketa@nifty.ne.jp>
* ext/win32ole/win32ole.c (fole_func_methods): correct argument mismatch.
* ext/win32ole/win32ole.c (fole_get_methods): ditto.
@@ -56838,21 +15422,6 @@ Sat Oct 16 13:34:56 2004 Kouhei Sutou <kou@cozmixng.org>
* lib/rss: supported prety print.
* test/rss/test_1.0.rb: added test for calculating default indent size.
-Sat Oct 16 10:56:36 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/mkmf.rb (create_makefile): install-rb is needed for statically
- linked extensions. [ruby-dev:24491]
-
-Fri Oct 15 18:07:08 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * ext/openssl/ossl_x509store.c
- (ossl_x509stctx_initialize): setup OpenSSL::X509::StoreContext with
- ossl_x509stctx_* functions instead of X509_STORE_CTX_*.
- (ossl_x509store_set_time): add OpenSSL::X509::Store#time=.
- (ossl_x509stctx_set_time): add OpenSSL::X509::StoreContext#time=.
-
- * test/openssl/ossl_x509store.rb: test certificate validity times.
-
Fri Oct 15 18:04:35 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tk/lib/tk/timer.rb: TkTimer.new(interval, loop){ ... } is
@@ -56863,60 +15432,13 @@ Fri Oct 15 12:43:09 2004 Tanaka Akira <akr@m17n.org>
* eval.c (Init_stack): make prototype declaration consistent with
the definition in gc.c.
-Thu Oct 14 13:33:59 2004 Kouhei Sutou <kou@cozmixng.org>
-
- * lib/rss/rss.rb: added link to Tutorial.
-
-Tue Oct 12 21:22:50 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * lib/webrick/config.rb:
- add WEBrick::Config::FileHandler[:AcceptableLanguages].
-
- * lib/webrick/httpservlet/filehandler.rb
- (WEBrick::HTTPServlet::FileHandler#set_filename): search files
- having suffix of language-name which Accept-Language header field
- includes if :AcceptableLanguages options is present.
-
- * lib/webrick/httpservlet/filehandler.rb
- (WEBrick::HTTPServlet::FileHandler#get_servlet): new method to
- search servlet correspond to the suffix of filename.
-
- * lib/webrick/httprequest.rb: add attributes access methods: accept,
- accept_charset, accept_encoding, accept_language, content_length
- and content_type.
-
- * lib/webrick/httpresponse.rb: add attribute access methods:
- content_length, content_length=, content_type and content_type=.
-
- * lib/webrick/httputils.rb (WEBrick::HTTPUtils.mime_types):
- use the second suffix to detect media type. (the first suffix
- may be a language name.)
-
- * lib/webrick/httputils.rb (WEBrick::HTTPUtils.parse_qvalues):
- add method to parse Accept header field. it returns an Array of
- values sorted by the qvalues.
-
-Tue Oct 12 15:05:32 2004 WATANABE Hirofumi <eban@ruby-lang.org>
+Thu Oct 14 14:34:01 2004 WATANABE Hirofumi <eban@ruby-lang.org>
* io.c (MODE_BINMODE, MODE_BINARY): fixed reversed condition.
-Mon Oct 11 17:51:34 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * io.c (rb_io_popen): get mode string via rb_io_flags_mode() to
- avoid mode string modification. [ruby-dev:24454]
-
- * io.c (rb_io_getline_fast): should take delim as unsigned char to
- distinguish EOF and '\377'. [ruby-dev:24460]
-
- * io.c (rb_io_getline): add check for RS modification.
- [ruby-dev:24461]
-
- * enum.c (enum_sort_by): use qsort() directly instead using
- rb_iterate(). [ruby-dev:24462]
+Thu Oct 14 13:33:59 2004 Kouhei Sutou <kou@cozmixng.org>
- * enum.c (enum_each_with_index): remove rb_gc_force_recycle() to
- prevent access to recycled object (via continuation for
- example). [ruby-dev:24463]
+ * lib/rss/rss.rb: added link to Tutorial.
Mon Oct 11 13:48:20 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
@@ -56927,16 +15449,6 @@ Sun Oct 10 12:32:08 2004 Dave Thomas <dave@pragprog.com>
* lib/rdoc/parsers/parse_rb.rb (RDoc::parse_require): Allow 'require'
to be used as a variable name
-Sun Oct 10 02:49:14 2004 Minero Aoki <aamine@loveruby.net>
-
- * ext/ripper/lib/ripper/filter.rb: require ripper/tokenizer.
-
- * ext/ripper/lib/ripper/filter.rb (parse): argument is optional.
-
-Sun Oct 10 02:43:13 2004 Minero Aoki <aamine@loveruby.net>
-
- * parse.y [ripper]: \n between two comments disappeared.
-
Sat Oct 9 21:23:37 2004 Kouhei Sutou <kou@cozmixng.org>
* lib/rss/converter.rb: changed to try to use Iconv for default
@@ -56949,19 +15461,6 @@ Sat Oct 9 19:50:36 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
* io.c (rb_io_getline): should not treat char as negative value.
[ruby-dev:24460]
-Sat Oct 9 00:25:39 2004 Tanaka Akira <akr@m17n.org>
-
- * io.c (rb_io_fread): rb_thread_wait_fd() was lost.
- [ruby-dev:24457]
-
-Fri Oct 8 21:36:56 2004 Minero Aoki <aamine@loveruby.net>
-
- * lib/fileutils.rb (fu_traverse): return value of Dir.entries is
- reliable. (pass $SAFE=1)
-
- * lib/fileutils.rb (remove_dir): return value of Dir.foreach is
- reliable. (pass $SAFE=1)
-
Fri Oct 8 09:49:32 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
* pack.c (pack_pack): pointer modification check before each
@@ -57021,19 +15520,7 @@ Wed Oct 6 09:21:00 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
* range.c (member_i): use RANGE_EACH_BREAK. [ruby-talk:114959]
-Tue Oct 5 09:53:22 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * io.c (rb_fopen): mode string copy at the lowest level.
-
- * io.c (rb_io_flags_mode): requires output buffer no more. no
- allocation needed.
-
- * array.c (rb_ary_index): takes a block to compare items in an
- array. [ruby-talk:113069] [Ruby2]
-
- * array.c (rb_ary_rindex): ditto.
-
-Mon Oct 4 14:03:40 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Oct 4 14:04:14 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
* io.c (rb_file_open_internal, rb_io_reopen): fname might be altered
while GC. [ruby-dev:24408]
@@ -57045,21 +15532,16 @@ Mon Oct 4 12:53:45 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tk/lib/tk/image.rb: bug fix
-Sun Oct 3 21:16:05 2004 Shugo Maeda <shugo@ruby-lang.org>
+Sun Oct 3 21:20:03 2004 Shugo Maeda <shugo@ruby-lang.org>
* lib/net/imap.rb (TEXT_REGEXP): allow 8-bit characters for the german
- version of Microsoft Exchange Server.
+ version of Microsoft Exchange Server. (backported from HEAD)
* lib/net/imap.rb (RTEXT_REGEXP): ditto.
* lib/net/imap.rb (CTEXT_REGEXP): ditto.
-Sat Oct 2 20:34:05 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (local_vars): moved to struct parser_params.
- [ruby-dev:24391]
-
- * parser.y (stmts): remove suspicious NODE_BEGIN. [ruby-dev:24390]
+Sat Oct 2 20:34:22 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
* node.h (NEW_DVAR): extra semicolon.
@@ -57081,6 +15563,9 @@ Sat Oct 2 00:42:20 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
* eval.c (specific_eval): defer pointer retrieval to prevent
unsafe sourcefile string modification. [ruby-dev:24382]
+ * eval.c (specific_eval): defer pointer retrieval to prevent
+ unsafe sourcefile string modification. [ruby-dev:24382]
+
* string.c (rb_str_sum): wrong cast caused wrong result.
[ruby-dev:24385]
@@ -57092,6 +15577,24 @@ Sat Oct 2 00:42:20 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
* string.c (rb_str_sum): string may be altered. [ruby-dev:24381]
+Mon Oct 11 17:51:34 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * io.c (rb_io_popen): get mode string via rb_io_flags_mode() to
+ avoid mode string modification. [ruby-dev:24454]
+
+ * io.c (rb_io_getline_fast): should take delim as unsigned char to
+ distinguish EOF and '\377'. [ruby-dev:24460]
+
+ * io.c (rb_io_getline): add check for RS modification.
+ [ruby-dev:24461]
+
+ * enum.c (enum_sort_by): use qsort() directly instead using
+ rb_iterate(). [ruby-dev:24462]
+
+ * enum.c (enum_each_with_index): remove rb_gc_force_recycle() to
+ prevent access to recycled object (via continuation for
+ example). [ruby-dev:24463]
+
Fri Oct 1 11:40:14 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
* eval.c (rb_f_eval): defer pointer retrieval to prevent unsafe
@@ -57136,18 +15639,6 @@ Wed Sep 29 10:58:07 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
* enum.c (sort_by_i): internally used object must not be changed
outside. [ruby-dev:24368]
-Mon Sep 27 21:25:12 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval.c (rb_call0): invoke finalizers periodically.
-
- * gc.c (gc_sweep): defer running finalizers. [ruby-dev:24354]
-
- * gc.c (rb_gc_finalize_deferred): run deferred finalizers.
-
-Mon Sep 27 15:01:59 2004 Minero Aoki <aamine@loveruby.net>
-
- * parse.y [ripper]: missing ';'.
-
Mon Sep 27 13:46:45 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
* intern.h, struct.c (rb_struct_s_members, rb_struct_members): public
@@ -57157,34 +15648,9 @@ Mon Sep 27 13:46:45 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
Mon Sep 27 09:14:03 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
- * array.c (rb_ary_delete): comparison may change the capacity.
- [ruby-dev:24348]
-
- * array.c (rb_ary_fill): fill should honor length argument.
- [ruby-dev:24346]
-
- * array.c (rb_ary_replace): should not use ptr from shared array.
- [ruby-dev:24345]
-
* ext/socket/socket.c (s_accept): don't retry for EWOULDBLOCK.
[ruby-talk:113807]
-Sun Sep 26 08:05:10 2004 Tadayoshi Funaba <tadf@dotrb.org>
-
- * lib/date.rb: provides {Time,Date,DateTime}#to_{time,date,datetime}.
-
- * sample/cal.rb: uses getoptlong instead of getopts.
-
-Sat Sep 25 18:39:22 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * array.c (flatten): element size might change during comparison.
- [ruby-dev:24343]
-
-Sat Sep 25 01:52:49 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * struct.c (rb_struct_s_members): wrong call of struct_members.
- [ruby-dev:24333]
-
Fri Sep 24 16:09:42 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
* eval.c (proc_invoke): propagate DVAR_DONT_RECYCLE on termination
@@ -57192,11 +15658,6 @@ Fri Sep 24 16:09:42 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
Fri Sep 24 08:29:45 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
- * parse.y (rb_parser_append_print): should handle prelude.
- [llama@u01.gate0]
-
- * parse.y (rb_parser_while_loop): ditto.
-
* array.c (rb_ary_subseq): original object might be modified after
sharing data creation. [ruby-dev:24327]
@@ -57207,22 +15668,6 @@ Fri Sep 24 08:29:45 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
* struct.c (struct_members): always check struct size and size of
members list in the class. [ruby-dev:24320]
-Thu Sep 23 19:48:14 2004 Minero Aoki <aamine@loveruby.net>
-
- * ext/ripper/Makefile.dev: removed.
-
- * ext/ripper/ripper.rb.in: moved to lib/ripper/core.rb.in.
-
- * ext/ripper/lib/ripper/core.rb: new file.
-
- * ext/ripper/lib/ripper/core.rb.in: new file.
-
- * ext/ripper/tools/generate-ripper_rb.rb: change comment.
-
- * test/ripper/*.rb: on__scan event removed.
-
- * test/ripper/*.rb: event name is changed: on__XXX -> on_XXX.
-
Thu Sep 23 09:29:14 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
* string.c (rb_str_sub_bang): check if string is not modified
@@ -57231,50 +15676,23 @@ Thu Sep 23 09:29:14 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
* hash.c (rb_hash_rehash): replace st_foreach() by its deep
checking counterpart. [ruby-dev:24310]
-Wed Sep 22 14:21:54 2004 Minero Aoki <aamine@loveruby.net>
-
- * parse.y [ripper]: on__scan event removed.
-
- * parse.y [ripper]: event name is changed: on__XXX -> on_XXX.
-
- * ext/ripper/eventids2.c: ditto.
-
- * ext/ripper/ripper.rb.in: ditto.
-
- * ext/ripper/lib/ripper.rb: sync with ripper.rb.in.
-
- * ext/ripper/lib/ripper/tokenizer: ditto.
-
- * ext/ripper/lib/ripper/filter: new file.
-
- * sample/ripper/colorize.rb: new file.
-
- * sample/ripper/strip-comment.rb: new file.
-
-Wed Sep 22 13:50:49 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * hash.c (hash_alloc): was using tbl pointer without
- initialization.
-
Wed Sep 22 13:38:12 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
* hash.c (rb_hash_rehash): add iteration check. [ruby-dev:24301]
* st.c (st_foreach): add deep check.
- * hash.c (rb_hash_fetch): returns KeyError instead of IndexError.
+Wed Sep 22 13:06:14 2004 NAKAMURA Usaku <usa@ruby-lang.org>
- * hash.c (env_fetch): ditto.
+ * win32/win32.c (rb_w32_call_handler): workaround for Ctrl-C.
+ merge from HEAD.
-Wed Sep 22 13:02:02 2004 NAKAMURA Usaku <usa@ruby-lang.org>
+Wed Sep 22 00:11:12 2004 Dave Thomas <dave@pragprog.com>
- * win32/win32.c (rb_w32_call_handler): workaround for Ctrl-C.
+ * process.c: Add documentation for fork()
Wed Sep 22 09:04:41 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
- * parse.y: remove global variables ruby_eval_tree and
- ruby_eval_tree_begin.
-
* array.c (rb_ary_collect_bang): element size might change during
comparison. [ruby-dev:24300]
@@ -57282,116 +15700,13 @@ Wed Sep 22 09:04:41 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
* array.c (rb_ary_eql): ditto. [ruby-dev:24300]
-Wed Sep 22 00:11:12 2004 Dave Thomas <dave@pragprog.com>
-
- * process.c: Add documentation for fork()
-
Tue Sep 21 18:29:49 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * array.c (rb_ary_equal): merge miss.
+
* array.c (rb_ary_uniq_bang): element size might change during
comparison. [ruby-dev:24298]
-Mon Sep 20 17:46:51 2004 Minero Aoki <aamine@loveruby.net>
-
- * ext/ripper/lib/ripper/tokenizer.rb: fix typo.
-
-Mon Sep 20 17:38:43 2004 Minero Aoki <aamine@loveruby.net>
-
- * test/ripper/test_scanner_events.rb: tokens must be reordered.
-
- * ext/ripper/lib/ripper/tokenizer.rb: ditto.
-
-Mon Sep 20 16:58:16 2004 Minero Aoki <aamine@loveruby.net>
-
- * parse.y [ripper]: do not delay dispatching.
-
- * ext/ripper/lib/ripper/tokenizer.rb: sort tokens by right order.
-
-Mon Sep 20 15:17:47 2004 Minero Aoki <aamine@loveruby.net>
-
- * ext/ripper/lib/ripper/tokenizer.rb: new file.
-
-Mon Sep 20 15:13:52 2004 Minero Aoki <aamine@loveruby.net>
-
- * test/ripper/test_scanner_events.rb: test #lineno and #column.
-
-Mon Sep 20 14:50:17 2004 Minero Aoki <aamine@loveruby.net>
-
- * parse.y [ripper]: delayed heredocument events should be
- dispatched after EOF.
-
-Mon Sep 20 14:39:42 2004 Minero Aoki <aamine@loveruby.net>
-
- * parse.y [ripper]: adjust lineno and columns for multi-line
- strings.
-
- * parse.y [ripper]: delay heredocument events until seeing
- end-of-line.
-
- * parse.y [ripper]: event on__heredoc_contentn ->
- on__tstring_content.
-
- * ext/ripper/eventids2.c: ditto.
-
- * ext/ripper/lib/ripper.rb: sync with eventids2.c.
-
- * test/ripper/test_scanner_events.rb: test it.
-
- * ext/ripper/tools/generate-ripper_rb.rb: show basename of input.
-
- * ext/ripper/Makefile.dev: support objdir build.
-
-Mon Sep 20 13:22:55 2004 Minero Aoki <aamine@loveruby.net>
-
- * parse.y [ripper]: remove Ripper#pos.
-
- * parse.y [ripper]: Ripper#column should return the column of the
- current token.
-
-Mon Sep 20 12:02:41 2004 Minero Aoki <aamine@loveruby.net>
-
- * parse.y [ripper]: unify old_lex_p and token_head.
-
- * test/ripper/test_scanner_events.rb: now \r\n is saved correctly.
-
- * parse.y: new macro lex_goto_eol() for next change.
-
-Mon Sep 20 11:01:55 2004 Minero Aoki <aamine@loveruby.net>
-
- * parse.y [ripper]: adjust line number for heredoc. [ruby-dev:24272]
-
-Mon Sep 20 04:49:22 2004 Minero Aoki <aamine@loveruby.net>
-
- * ext/ripper/ripper.rb.in: new const Ripper::PARSER_EVENT_TABLE.
-
- * ext/ripper/ripper.rb.in: new const Ripper::SCANNER_EVENT_TABLE.
-
- * ext/ripper/lib/ripper.rb: sync with ripper.rb.in.
-
-Mon Sep 20 04:13:00 2004 Minero Aoki <aamine@loveruby.net>
-
- * test/ripper/test_scanner_events.rb: test spaces before heredoc
- mark.
-
-Mon Sep 20 03:46:54 2004 Minero Aoki <aamine@loveruby.net>
-
- * parse.y [ripper]: spaces before heredoc marker was lost.
- [ruby-dev:24272]
-
- * keywords: rb_reserved_word() should be defined only in ruby
- core. [ruby-dev:24272]
-
- * lex.c: sync with keywords.
-
- * ext/ripper/ripper.rb.in (parse): fix typo.
-
- * ext/ripper/lib/ripper.rb: sync with ripper.rb.in.
-
-Mon Sep 20 03:37:59 2004 Tanaka Akira <akr@m17n.org>
-
- * ext/zlib/zlib.c (gzfile_read_raw): call readpartial at first.
- (Zlib::GzipReader#readpartial): new method.
-
Mon Sep 20 00:24:19 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
* enum.c (enum_sort_by): do not use qsort directly. use
@@ -57433,23 +15748,15 @@ Sat Sep 18 14:10:23 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
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>
-
- * parse.y: add prototypes for Microsoft compiler.
-
- * ext/ripper/depend (parse.obj): lex.c exists at hdrdir.
+Fri Sep 17 20:20:27 2004 Minero Aoki <aamine@loveruby.net>
- * {bcc32,win32,wince}/Makefile.sub (YACC, YFLAGS, parse.c):
- use bison.
+ * lib/fileutils.rb (mkdir_p): backport from CVS HEAD 1.45. [ruby-core:03420]
Fri Sep 17 17:11:08 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
* array.c (rb_ary_delete): element comparison might change array
size. [ruby-dev:24273]
- * parse.y: make ruby parser reentrant. merge ripper parser to the
- real one. this change makes ruby require bison.
-
* file.c (rb_file_truncate): clear stdio buffer before truncating
the file. [ruby-dev:24191]
@@ -57477,7 +15784,7 @@ Fri Sep 17 15:01:57 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tk/sample/tkoptdb-safeTk.rb: ditto
-Thu Sep 16 18:12:13 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Thu Sep 16 18:12:32 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
* lib/webrick/cgi.rb (WEBrick::CGI#start): should set REMOTE_USER
to request.user attribute.
@@ -57506,44 +15813,6 @@ Tue Sep 14 23:45:44 2004 Dave Thomas <dave@pragprog.com>
* lib/rdoc/ri/ri_formatter.rb (RI::TextFormatter::TextFormatter.for):
Add Eric Hodel's simpleformatter.
-Tue Sep 14 22:11:08 2004 Minero Aoki <aamine@loveruby.net>
-
- * parse.y [ripper]: Add rdoc.
-
-Tue Sep 14 20:24:49 2004 Minero Aoki <aamine@loveruby.net>
-
- * parse.y [ripper]: space event is on__sp, not on__lwsp.
- [ruby-dev:24257]
-
- * ext/ripper/eventids2.c: ditto.
-
- * ext/ripper/lib/ripper.rb: ditto.
-
- * ext/ripper/depend (ripper.o): No action is needed.
- [ruby-dev:24260]
-
- * ext/ripper/depend: Borland make does not accept pipes in
- Makefile rules. [ruby-dev:24589]
-
- * ext/ripper/depend: separate rules for developpers.
-
- * ext/ripper/Makefile.dev: new file.
-
- * ext/ripper/MANIFEST: add Makefile.dev.
-
- * ext/ripper/tools/generate-eventids1.rb: read from file, not
- stdin.
-
- * ext/ripper/extconf.rb: clean ripper.E.
-
- * ext/ripper/tools/generate-ripper_rb.rb: #include ids1/ids2
- function was lost.
-
- * ext/ripper/tools/generate-ripper_rb.rb: SCANNER_EVENTS wrongly
- contained parser events.
-
- * ext/ripper/lib/ripper.rb: ditto.
-
Tue Sep 14 16:59:37 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tcltklib/tcltklib.c: fix SEGV
@@ -57554,22 +15823,9 @@ Tue Sep 14 16:59:37 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tk/sample/safe-tk.rb: new sample script
+Tue Sep 14 00:15:15 2004 WATANABE Hirofumi <eban@ruby-lang.org>
-Mon Sep 13 21:33:40 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * ext/openssl/ossl_x509name.c (ossl_x509name_to_s): add optional
- second argument to specify the output format (see also
- X509_NAME_print_ex).
-
- * ext/openssl/ossl_x509name.c (ossl_x509name_init): new constants:
- OpenSSL::X509::Name::COMPAT, OpenSSL::X509::Name::RFC2253,
- OpenSSL::X509::ONELINE, OpenSSL::X509::MULTILINE.
-
- * ext/openssl/lib/openssl/x509.rb (OpenSSL::X509::Name::RFC2253DN):
- new module to provide the parse for RFC2253 DN format.
-
- * ext/openssl/lib/openssl/x509.rb (OpenSSL::X509::Name.parse_rfc2253):
- new method to parse RFC2253 DN format.
+ * ext/zlib/zlib.c: backported from HEAD.
Mon Sep 13 19:16:33 2004 WATANABE Hirofumi <eban@ruby-lang.org>
@@ -57580,92 +15836,10 @@ Mon Sep 13 16:23:27 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tk/lib/multi-tk.rb: MultiTkIp.new_master and new_slave accept
safe-level value argument
-Mon Sep 13 10:48:37 2004 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/win32.c (rb_w32_getpid): don't need to use _getpid() on
- mswin32 and mingw32.
-
-Mon Sep 13 10:22:05 2004 NAKAMURA Usaku <usa@ruby-lang.org>
+Mon Sep 13 10:20:45 2004 NAKAMURA Usaku <usa@ruby-lang.org>
* object.c (nil_inspect): fix typo.
-Mon Sep 13 09:29:58 2004 Minero Aoki <aamine@loveruby.net>
-
- * ext/ripper/depend: (nmake hack) prepend "./" to ripper.c to
- avoid {$(srcdir)}.
-
-Mon Sep 13 06:43:42 2004 Minero Aoki <aamine@loveruby.net>
-
- * ext/ripper/tools/list-parse-event-ids.rb: does not use getopts.
-
- * ext/ripper/tools/list-scan-event-ids.rb: ditto.
-
-Mon Sep 13 02:42:28 2004 Minero Aoki <aamine@loveruby.net>
-
- * ext/Setup: add ripper.
-
- * ext/Setup.atheos: ditto.
-
- * ext/Setup.dj: ditto.
-
- * ext/Setup.emx: ditto.
-
- * ext/Setup.nt: ditto.
-
- * ext/Setup.x68: ditto.
-
-Mon Sep 13 02:26:31 2004 Minero Aoki <aamine@loveruby.net>
-
- * ext/ripper: ripper extension added.
-
- * ext/ripper/MANIFEST: new file.
-
- * ext/ripper/README: new file.
-
- * ext/ripper/depend: new file.
-
- * ext/ripper/extconf.rb: new file.
-
- * ext/ripper/eventids2.c: new file.
-
- * ext/ripper/ripper.rb.in: new file.
-
- * ext/ripper/lib/ripper.rb: new file.
-
- * ext/ripper/test/check-event-arity.rb: new file.
-
- * ext/ripper/test/check-event-coverage.sh: new file.
-
- * ext/ripper/test/check-scanner-event-coverage.rb: new file.
-
- * ext/ripper/test/list-called-events.rb: new file.
-
- * ext/ripper/test/src_rb: new file.
-
- * ext/ripper/test/validate.rb: new file.
-
- * ext/ripper/tools/generate-eventids1.rb: new file.
-
- * ext/ripper/tools/generate-param-macros.rb: new file.
-
- * ext/ripper/tools/generate-ripper_rb.rb: new file.
-
- * ext/ripper/tools/list-parse-event-ids.rb: new file.
-
- * ext/ripper/tools/list-scan-event-ids.rb: new file.
-
- * ext/ripper/tools/preproc.rb: new file.
-
- * ext/ripper/tools/strip.rb: new file.
-
- * test/ripper: ripper tests added.
-
- * test/ripper/dummyparser.rb: new file.
-
- * test/ripper/test_parser_events.rb: new file.
-
- * test/ripper/test_scanner_events.rb: new file.
-
Mon Sep 13 01:03:02 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tcltklib/tcltklib.c: improve control of preserv/release tcltkip
@@ -57674,19 +15848,7 @@ Mon Sep 13 01:03:02 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tk/tkutil.c: fix(?) SEGV
-Mon Sep 13 00:22:53 2004 Minero Aoki <aamine@loveruby.net>
-
- * parse.y: fix file header.
-
-Mon Sep 13 00:20:39 2004 Minero Aoki <aamine@loveruby.net>
-
- * parse.y: ripper merged.
-
- * lex.c: ditto.
-
- * keywords: ditto.
-
-Sun Sep 12 23:53:17 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Sun Sep 12 23:46:23 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* util.c (ruby_strdup): remove unnecessary code. (xmalloc never
returns NULL.)
@@ -57718,25 +15880,11 @@ Sat Sep 11 16:09:46 2004 Dave Thomas <dave@pragprog.com>
* lib/rdoc/parsers/parse_rb.rb: Fix up cross-file class merging.
-Fri Sep 10 20:18:05 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Fri Sep 10 20:20:53 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* ext/tcltklib/tcltklib.c (lib_merge_tklist): fix suspicious
pointer conversion.
-Fri Sep 10 19:16:24 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * bcc32/Makefile.sub: bccwin32 port starts to use RTL dll.
- (need to rebuild all) [ruby-dev:24138]
-
- * win32/win32.{h,c}: ditto.
-
-Fri Sep 10 15:55:59 2004 Minero Aoki <aamine@loveruby.net>
-
- * lib/fileutils.rb (mkdir_p): should pass mode argument to
- Dir.mkdir. [ruby-dev:24242]
-
- * test/fileutils/test_fileutils.rb: test it.
-
Fri Sep 10 02:43:54 2004 Dave Thomas <dave@pragprog.com>
* lib/rdoc/generators/template/kilmer.rb: James Buck's
@@ -57778,16 +15926,9 @@ Tue Sep 7 15:17:49 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ext/socket/socket.c (ruby_connect): break immediately if a
socket is non-blocking. [ruby-talk:111654]
-Tue Sep 7 12:48:22 2004 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * {bcc32,win32,wince}/Makefile.sub (config.h): add fcntl.
-
- * win32/win32.[ch] (fcntl): ditto.
+Mon Sep 6 11:08:50 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
- * win32/win32.c (rb_w32_connect): support nonblocking mode.
-
- * ext/socket/socket.c (wait_connectable, ruby_connect): support
- nonblocking connect on various platforms.
+ * ext/tk/lib/tk/menu.rb(TkOptionMenubutton#insert): call correct method
Mon Sep 6 11:00:47 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
@@ -57795,13 +15936,9 @@ Mon Sep 6 11:00:47 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
exception occurred within a block. a patch was given from Johan
Holmberg <holmberg at iar.se>. [ruby-core:03292]
-Mon Sep 6 10:57:40 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * ext/tk/lib/tk/menu.rb(TkOptionMenubutton#insert): call correct method
-
Mon Sep 6 07:51:42 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
- * eval.c (cvar_cbase): singletons should refer to outer cvar scope.
+ * eval.c (cvar_cbase): singletons should refer outer cvar scope.
[ruby-dev:24223]
* eval.c (rb_load): should preserve previous ruby_wrapper value.
@@ -57832,20 +15969,18 @@ Fri Sep 3 02:12:48 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
Fri Sep 3 01:54:20 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/extmk.rb (extmake): extact target prefix from Makefiles.
-
* ext/extmk.rb: already built-in libraries satisfy dependencies.
[ruby-dev:24028]
-Wed Sep 1 21:16:50 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Thu Sep 2 11:36:20 2004 WATANABE Hirofumi <eban@ruby-lang.org>
- * ext/tk/lib/tk/spinbox.rb: fix typo
+ * eval.c (rb_obj_instance_eval): backported from HEAD.
-Wed Sep 1 19:28:37 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Sep 1 21:18:25 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
- * process.c (rb_proc_exec): label cannot precede variable declarations.
+ * ext/tk/lib/tk/spinbox.rb: fix typo
-Tue Aug 31 18:20:49 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Tue Aug 31 18:24:04 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* ext/tk/tkutil.c (cbsubst_init): fix memory leak
@@ -57860,10 +15995,6 @@ Tue Aug 31 12:30:36 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tcltklib/tcltklib.c (del_root): fix SEGV
-Mon Aug 30 21:50:14 2004 Dave Thomas <dave@pragprog.com>
-
- * object.c: Add RDoc for Module.included.
-
Mon Aug 30 23:11:06 2004 Dave Thomas <dave@pragprog.com>
* lib/rdoc/ri/ri_driver.rb (and others): ri now merges documentation
@@ -57873,10 +16004,19 @@ Mon Aug 30 22:40:30 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tk/lib/multi-tk.rb: 'restart' method accepts arguments
+Mon Aug 30 21:50:14 2004 Dave Thomas <dave@pragprog.com>
+
+ * object.c: Add RDoc for Module.included.
+
Mon Aug 30 15:10:46 2004 WATANABE Hirofumi <eban@ruby-lang.org>
* configure.in (GNU/k*BSD): fixed FTBFS on GNU/k*BSD. [ruby-dev:24051]
+Mon Aug 30 11:29:35 2004 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * win32/win32.c (CreateChild): strip trailing spaces. [ruby-dev:24143]
+ merge from HEAD.
+
Sun Aug 29 14:08:56 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tcltklib/tcltklib.c: compile error on bcc32 [ruby-dev:24081]
@@ -57888,49 +16028,27 @@ Sat Aug 28 23:04:41 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
* bignum.c (rb_big_and): protect parameters from GC.
[ruby-talk:110664]
-Fri Aug 27 12:13:50 2004 Tanaka Akira <akr@m17n.org>
-
- * ext/stringio/stringio.c (Init_stringio): add StringIO#readpartial as
- an alias for StringIO#sysread.
-
-Fri Aug 27 10:14:21 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * process.c (rb_proc_exec): strip trailing spaces. [ruby-dev:24143]
-
- * win32/win32.c (CreateChild): ditto.
-
Thu Aug 26 04:38:29 2004 Dave Thomas <dave@pragprog.com>
* eval.c (return_jump): Minor typo in error message. Now reads
"return can't jump across threads".
-Wed Aug 25 15:18:52 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval.c (rb_longjmp): Exception#to_str is no longer defined.
-
-Wed Aug 25 11:39:10 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * error.c (exc_equal): exceptions are equal if they share same
- class, message and backtrace. [ruby-talk:110354]
-
- * error.c (name_err_mesg_equal): ditto.
-
-Tue Aug 24 16:41:48 2004 Shugo Maeda <shugo@ruby-lang.org>
+Tue Aug 24 17:30:00 2004 Shugo Maeda <shugo@ruby-lang.org>
* lib/cgi/session.rb (CGI::Session::FileStore#initialize): do not
- use a session id as a filename.
+ use a session id as a filename. (backported from HEAD)
* lib/cgi/session/pstore.rb (CGI::Session::PStore#initialize): ditto.
* lib/cgi/session/pstore.rb (CGI::Session::PStore#initialize): use
- Dir::tmpdir.
+ Dir::tmpdir. (backported from HEAD)
-Tue Aug 24 14:32:17 2004 Shugo Maeda <shugo@ruby-lang.org>
+Tue Aug 24 14:40:16 2004 Shugo Maeda <shugo@ruby-lang.org>
* lib/cgi/session.rb (CGI::Session::FileStore#initialize): untaint
- session id after check.
+ session id after check. (backported from HEAD)
-Tue Aug 24 08:57:51 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Tue Aug 24 09:09:01 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
* ext/openssl/ossl_x509attr.c (ossl_x509attr_initialize): d2i
functions may replace the pointer indicated by the first argument.
@@ -57939,12 +16057,7 @@ Tue Aug 24 08:57:51 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
* ext/openssl/ossl_x509name.c (ossl_x509name_initialize): ditto.
-Mon Aug 23 12:43:32 2004 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * lib/resolv.rb (Config.default_config_hash): when multiple domains
- are set, Win32::Resolv.get_resolv_info returns Array.
-
-Sun Aug 22 16:27:38 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Mon Aug 23 14:04:51 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
* ext/openssl/ossl_ssl.c (ossl_ssl_read):
- should return an empty string if specified length to read is 0.
@@ -57960,7 +16073,12 @@ Sun Aug 22 16:27:38 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
* ext/openssl/lib/openssl/buffering.rb: should not use select.
-Sun Aug 22 01:10:36 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Mon Aug 23 12:40:56 2004 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * lib/resolv.rb (Config.default_config_hash): when multiple domains
+ are set, Win32::Resolv.get_resolv_info returns Array.
+
+Sun Aug 22 01:15:31 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
* lib/webrick/httpproxy.rb (WEBrick::HTTPProxyServer#proxy_connect):
should call :ProxyContentHandler before finishing CONNECT.
@@ -57972,15 +16090,6 @@ Sat Aug 21 06:41:16 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/mkmf.rb (arg_config, with_config): deal with '-' and '_'
uniformly. [ruby-dev:24118]
-Fri Aug 20 14:49:42 2004 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * io.c (rb_io_check_writable): no need to check read buffer if
- already changed to write mode.
-
-Fri Aug 20 11:46:43 2004 UENO Katsuhiro <katsu@blue.sky.or.jp>
-
- * ext/zlib/zlib.c: GzipReader#ungetc caused crc error.
-
Thu Aug 19 16:29:45 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tk/lib/tk.rb: Fail to treat a hash value of 'font' option.
@@ -57994,15 +16103,17 @@ Thu Aug 19 15:15:24 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
* dir.c (free_dir): fix memory leak. reported by yamamoto
madoka.
-Thu Aug 19 09:19:27 2004 NAKAMURA Usaku <usa@ruby-lang.org>
+Thu Aug 19 11:00:00 2004 Akiyoshi, Masamichi <masamichi.akiyoshi@hp.com>
- * configure.in, win32/Makefile.sub (LIBS): need to link shell32
- library for SH* functions on mswin32 and mingw32.
+ * dln.c (dln_load): Modify to call lib$find_image_symbol for VMS.
+ * io.c (rb_io_fwrite): Use fputc() for VMS non-stream file.
- * wince/Makefile.sub (LIBS): need to link ceshell library for SH*
- functions on mswince.
+Thu Aug 19 06:07:45 2004 why the lucky stiff <why@ruby-lang.org>
-Thu Aug 19 03:07:00 2004 why the lucky stiff <why@ruby-lang.org>
+ * ext/syck/token.c: re2c no longer compiled with bit vectors. caused
+ problems for non-ascii characters. [ruby-core:03280]
+ * ext/syck/implicit.c: ditto.
+ * ext/syck/bytecode.c: ditto.
* lib/yaml/baseemitter.rb: folding now handles double-quoted strings,
fixed problem with extra line feeds at end of folding, whitespace
@@ -58011,9 +16122,9 @@ Thu Aug 19 03:07:00 2004 why the lucky stiff <why@ruby-lang.org>
* lib/yaml/rubytypes.rb: subtelties in handling strings with
non-printable characters and odd whitespace patterns.
-Wed Aug 18 23:44:20 2004 Minero Aoki <aamine@loveruby.net>
+Wed Aug 18 23:41:33 2004 Minero Aoki <aamine@loveruby.net>
- * lib/net/protocol.rb (rbuf_fill): OpenSSL::SSLSocket has its own
+ * lib/net/protocol.rb (rbuf_fill): OpenSSL::SSL::SSLSocket has its own
buffer, select(2) might not work. [ruby-dev:24072]
Wed Aug 18 17:10:12 2004 WATANABE Hirofumi <eban@ruby-lang.org>
@@ -58026,17 +16137,6 @@ Wed Aug 18 12:52:55 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
* eval.c (rb_obj_instance_eval): evaluates under special singleton
classes as for special constants.
-Wed Aug 18 11:22:52 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * win32/win32.c (init_env): initialize HOME and USER environment
- variables unless set.
-
-Wed Aug 18 10:17:21 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (bind_eval): new method. [RCR 251]
-
- * string.c (rb_str_clear): new method. [ruby-dev:24104]
-
Tue Aug 17 17:20:59 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
* io.c (rb_io_reopen): should clear allocated OpenFile. pointed
@@ -58047,19 +16147,23 @@ Tue Aug 17 01:36:32 2004 Dave Thomas <dave@pragprog.com>
* lib/rdoc/usage.rb: Remove extra indent. Tidy 'ri' option
parsing so RDoc::usage plays better with OptionParser.
+Sat Aug 14 13:09:10 2004 Minero Aoki <aamine@loveruby.net>
+
+ * lib/fileutils.rb: backport from CVS HEAD (rev1.44).
+
+ * lib/fileutils.rb: cp_r should copy symlink itself, except cp_r
+ root.
+
+ * lib/fileutils.rb: new option mv :force.
+
+ * lib/fileutils.rb: new module FileUtils::DryRun.
+
Sat Aug 14 02:48:16 2004 Dave Thomas <dave@pragprog.com>
* lib/rdoc/usage.rb: Added. Allows command line programs
to report usage using their initial RDoc comment.
-Sat Aug 14 01:25:48 2004 why the lucky stiff <why@ruby-lang.org>
-
- * ext/syck/token.c: re2c no longer compiled with bit vectors. caused
- problems for non-ascii characters. [ruby-core:03280]
- * ext/syck/implicit.c: ditto.
- * ext/syck/bytecode.c: ditto.
-
-Fri Aug 13 12:55:20 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Fri Aug 13 13:23:17 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
* lib/webrick/httputils.rb (WEBrick::HTTPUtils.parse_range_header):
fix regex for range-spec.
@@ -58068,44 +16172,15 @@ Fri Aug 13 12:55:20 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
(WEBrick::HTTPServlet::DefaultFileHandler#make_partial_content):
multipart/byteranges response was broken.
- * lib/xmlrpc/server.rb: refine example code.
-
-Thu Aug 12 10:54:17 2004 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * rubyio.h (rb_eof_error): should mark as NORETURN.
-
- * win32/win32.c (make_cmdvector): adjust escaped successive
- double-quote handling.
-
-Thu Aug 12 01:53:10 2004 Tanaka Akira <akr@m17n.org>
-
- * io.c (read_buffered_data): extracted from rb_io_fread.
- (io_readpartial): new method IO#readpartial.
- [ruby-dev:24055]
-
-Wed Aug 11 17:17:50 2004 WATANABE Hirofumi <eban@ruby-lang.org>
-
- * configure.in (RPATHFLAG): stop setting RPATHFLAG on Interix.
-
-Mon Aug 9 15:03:20 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
* lib/webrick/httpservlet/erbhandler.rb
(WEBrick::HTTPServlet::ERBHandler#do_GET): should select media type
by suffix of script filename.
-Mon Aug 9 12:51:43 2004 Dave Thomas <dave@pragprog.com>
-
- * dir.c (dir_s_glob): Roll in Austin Ziegler's Dir.glob and
- fnmatch updates.
-
-Mon Aug 9 06:33:06 2004 Minero Aoki <aamine@loveruby.net>
-
- * lib/fileutils.rb (cp_r): copies symlink to symlink, except
- root entries of cp_r.
+ * lib/xmlrpc/server.rb: refine example code.
- * lib/fileutils.rb: new method FileUtils.copy_entry.
+Wed Aug 11 17:17:50 2004 WATANABE Hirofumi <eban@ruby-lang.org>
- * test/fileutils/test_fileutils.rb: more cp_r tests.
+ * configure.in (RPATHFLAG): stop setting RPATHFLAG on Interix.
Sun Aug 8 00:43:31 2004 why the lucky stiff <why@ruby-lang.org>
@@ -58117,38 +16192,21 @@ Sun Aug 8 00:43:31 2004 why the lucky stiff <why@ruby-lang.org>
collections. plain scalars are trimmed if indentation follows in
an ambiguous flow collection.
-Sat Aug 7 03:08:21 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * process.c (proc_daemon): new method. should be modified for
- platforms without /dev/null.
-
Sat Aug 7 00:50:01 2004 Tanaka Akira <akr@m17n.org>
* ext/zlib/zlib.c: Zlib::GzipReader#read(0) returns "" instead of nil.
-Wed Aug 4 13:26:00 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * marshal.c (r_bytes0): optimize out read(0). [ruby-talk:108276]
-
-Tue Aug 3 13:49:12 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Tue Aug 3 13:49:20 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tk/lib/tk/namespace.rb: bug fix
* ext/tk/lib/tkextlib/treectrl/tktreectrl.rb: add Tk::TreeCtrl.loupe
-Mon Aug 2 23:33:48 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * test/ruby/test_file.rb (test_fnmatch): added more tests.
-
Mon Aug 2 18:04:21 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tk/lib/tk/msgcat.rb (set_translation): bug fix (fail to set
trans_str to the same as src_str when trans_str is not given.)
-Mon Aug 2 17:40:44 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (blk_free): fixed serious memory leak. [ruby-dev:24013]
-
Mon Aug 2 11:53:06 2004 Dave Thomas <dave@pragprog.com>
* lib/rdoc/code_objects.rb (RDoc::Context::find_symbol): Fix infinite recursion
@@ -58159,21 +16217,15 @@ Mon Aug 2 11:48:29 2004 Dave Thomas <dave@pragprog.com>
* lib/rdoc/parsers/parse_c.rb (RDoc::C_Parser::do_methods): Allow '.'s in
variable names to support SWIG generated files (Hans Fugal)
-Sat Jul 31 23:08:00 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (is_defined): stupid mistakes fixed. [ruby-dev:24006]
-
-Sat Jul 31 17:39:47 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat Jul 31 17:40:16 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
* misc/ruby-mode.el (ruby-expr-beg, ruby-parse-partial,
ruby-calculate-indent, ruby-move-to-block, ruby-forward-sexp,
ruby-backward-sexp): keywords must match word-wise.
-Sat Jul 31 13:37:51 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+Sat Jul 31 05:47:37 2004 why the lucky stiff <why@ruby-lang.org>
- * eval.c (is_defined): avoid unnecessary method invocations.
-
-Sat Jul 31 05:35:37 2004 why the lucky stiff <why@ruby-lang.org>
+ * lib/yaml.rb (YAML::load_file, YAML::parse_file): added.
* lib/yaml/rubytypes.rb: exceptions were using an older
YAML.object_maker. [ruby-core:03080]
@@ -58182,10 +16234,9 @@ Sat Jul 31 05:35:37 2004 why the lucky stiff <why@ruby-lang.org>
handline CR-LFs. "\000" was showing up on folded blocks which
stopped at EOF.
-Sat Jul 31 01:25:11 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (is_defined): call is_defined() before invoking
- rb_eval(). [ruby-talk:107867]
+ * ext/syck/token.c: re2c compiled with bit vectors now.
+ * ext/syck/implicit.c: ditto.
+ * ext/syck/bytecode.c: ditto.
Fri Jul 30 16:10:54 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
@@ -58203,26 +16254,8 @@ Wed Jul 28 18:59:17 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
* lib/cgi.rb (CGI::initialize): remove at_exit code for CGI_PARAMS
and CGI_COOKIES. they will no longer be used.
-Wed Jul 28 15:44:08 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (rb_call0): should call rb_call_super() directly for
- visibility overriding. [ruby-dev:23989]
-
Wed Jul 28 01:04:44 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
- * env.h: remove argv from ruby_frame.
-
- * eval.c (rb_eval): no more copy on write.
-
- * eval.c (assign): ditto.
-
- * eval.c (rb_call0): can receive *rest by specifying negative
- argc. (-1 means 0 arg and *rest, -2 means 1 arg and *rest...)
-
- * eval.c (rb_call0): properly set frame's argc counter.
-
- * gc.c (rb_gc_mark_frame): need not to mark frame's argv
-
* gc.c (run_final): wrong order of data. [ruby-dev:23984]
Tue Jul 27 07:05:04 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
@@ -58243,13 +16276,11 @@ Mon Jul 26 11:22:55 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
* lib/webrick/httputils.rb (WEBrick::HTTPUtils.escape): should
escape space.
-Sun Jul 25 10:56:28 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Sun Jul 25 11:05:21 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* win32/win32.{h,c} (rb_w32_{f,fd,fs}open): workaround for bcc32's
{f,fd,fs}open bug. set errno EMFILE and EBADF. [ruby-dev:23963]
- * test/drb/drbtest.rb: fix method duplication.
-
Sat Jul 24 13:32:47 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
* range.c (rb_range_beg_len): returns Qnil only when "beg" points
@@ -58260,24 +16291,37 @@ Fri Jul 23 16:40:25 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
* gc.c (define_final): should not disclose NODE* to Ruby world.
[ruby-dev:23957]
-Fri Jul 23 08:52:22 2004 Shugo Maeda <shugo@ruby-lang.org>
+Fri Jul 23 09:03:16 2004 Shugo Maeda <shugo@ruby-lang.org>
- * lib/net/imap.rb (disconnected?): new method.
+ * lib/net/imap.rb (disconnected?): new method. (backported from HEAD)
Thu Jul 22 16:41:54 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
* lib/cgi/session.rb (CGI::Session::FileStore#update): sets the
- permission of the session data file to 0600.
+ permission of the session data file to 0600.
* lib/cgi/session/pstore.rb (CGI::Session::Pstore#initialize):
ditto.
-Mon Jul 19 00:53:46 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Thu Jul 22 00:02:21 2004 Masahiro Kitajima <katonbo@katontech.com>
+
+ * process.c (rb_f_system): not need to call last_status_set() any
+ longer on _WIN32.
+
+Tue Jul 20 09:15:17 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+
+ * test/fileutils/test_fileutils.rb: File.link raises EINVAL on BeOS.
+
+Mon Jul 19 01:15:07 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
* lib/webrick/httpservlet/cgihandler.rb
(WEBrick::HTTPServlet::CGIhandler#do_GET): set SystemRoot environment
variable to CGI process on Windows native platforms. [ruby-dev:23936]
+ * lib/webrick/httpservlet/cgihandler.rb
+ (WEBrick::HTTPServlet::CGIhandler#do_GET): use $?.exitstatus and
+ refine log message.
+
Sun Jul 18 16:14:29 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tk/lib/tk/msgcat.rb (TkMsgCatalog.callback): bug fix
@@ -58287,19 +16331,18 @@ Sun Jul 18 08:13:58 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
* sprintf.c (rb_f_sprintf): remove extra sign digit.
-Sun Jul 18 03:19:14 2004 Akinori MUSHA <knu@iDaemons.org>
-
- * dir.c (bracket): use NULL instead of 0.
+Sun Jul 18 03:21:42 2004 Akinori MUSHA <knu@iDaemons.org>
-Sun Jul 18 02:35:30 2004 Shugo Maeda <shugo@ruby-lang.org>
+ * dir.c (range): use NULL instead of 0.
- * lib/net/imap.rb (receive_responses): return if a LOGOUT response
- received.
+ * dir.c (range): get rid of a gcc 3.4 warning.
-Sat Jul 17 23:59:01 2004 Shugo Maeda <shugo@ruby-lang.org>
+Sun Jul 18 03:12:11 2004 Shugo Maeda <shugo@ruby-lang.org>
+ * lib/net/imap.rb (receive_responses): return if a LOGOUT response
+ received. (backported from HEAD)
* lib/net/imap.rb (send_string_data): wait command continuation
- requests before sending octet data of literals.
+ requests before sending octet data of literals. (backported from HEAD)
Sat Jul 17 23:54:59 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
@@ -58313,14 +16356,6 @@ Sat Jul 17 18:29:07 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
* parse.y (stmt): not to show same error messages twice.
-Sat Jul 17 14:18:11 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * string.c (rb_str_match_m): String#match should also take
- optional argument. [ruby-core:03205]
-
- * re.c (rb_reg_match_m): add optional second argugment "pos" to
- specify match start point. [ruby-core:03203]
-
Sat Jul 17 13:13:32 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
* lib/irb/ruby-lex.rb (RubyLex::identify_string): %s string do not
@@ -58328,7 +16363,7 @@ Sat Jul 17 13:13:32 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
Sat Jul 17 05:26:27 2004 Dave Thomas <dave@pragprog.com>
- * lib/rdoc/diagram.rb: Incorporate Micheal Neumann's
+ * lib/rdoc/diagram.rb: Incorporate Micheal Neuman's
client-side imagemao patch
Sat Jul 17 01:57:03 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
@@ -58341,6 +16376,24 @@ Fri Jul 16 22:30:28 2004 Michael Neumann <mneumann@ntecs.de>
* file.c (rb_stat_dev_major): new methods File::Stat#dev_major and
#dev_minor. [ruby-core:03195]
+Fri Jul 16 15:23:53 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * eval.c (return_jump, break_jump): raise unexpceted local jump
+ exception directly. [ruby-dev:23740]
+
+ * lib/base64.rb (Deprecated): super in bound method calls original
+ name method in stable version. [ruby-dev:23916]
+
+Fri Jul 16 11:31:49 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+
+ * lib/test/unit/ui/{fox,gtk,gtk2}/testrunner.rb: remove
+ garbage (patch from akira yamada) [ruby-dev:23911]
+
+Fri Jul 16 11:20:00 2004 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * sprintf.c (rb_f_sprintf): fix output of NaN, Inf and -Inf with
+ "%f" or etc on MSVCRT platforms. (backported from HEAD)
+
Fri Jul 16 11:17:38 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
* error.c (exit_initialize): use EXIT_SUCCESS instead of 0.
@@ -58360,19 +16413,13 @@ Thu Jul 15 23:53:38 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
Thu Jul 15 22:59:48 2004 Shugo Maeda <shugo@ruby-lang.org>
* ext/readline/extconf.rb: added dir_config for curses, ncurses,
- termcap.
-
-Thu Jul 15 20:44:46 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+ termcap. (backported from HEAD)
- * class.c: rdoc patch
+Thu Jul 15 20:29:15 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-Thu Jul 15 14:12:34 2004 why the lucky stiff <why@ruby-lang.org>
-
- * lib/yaml.rb (YAML::load_file, YAML::parse_file): added.
-
- * ext/syck/token.c: re2c compiled with bit vectors now.
- * ext/syck/implicit.c: ditto.
- * ext/syck/bytecode.c: ditto.
+ * class.c, error.c, eval.c, intern.h, object.c, variable.c:
+ do not set path if it is a singleton class. [ruby-dev:22588]
+ (backport from 1.9)
Thu Jul 15 10:15:04 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
@@ -58398,13 +16445,7 @@ Thu Jul 15 10:15:04 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tk/sample/tkextlib/: add samples of Iwidget and TkTable
-
-Wed Jul 14 23:49:30 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * enum.c (enum_min_by): new method Enum#min_by. added Enum#max_by
- as well.
-
-Wed Jul 14 18:05:21 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Wed Jul 14 18:08:37 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
* ext/openssl/ossl_asn1.c (ossl_asn1cons_to_der): fix type of
argument. [ruby-dev:23891]
@@ -58412,14 +16453,14 @@ Wed Jul 14 18:05:21 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
* test/openssl/test_x509store.rb: prune tests for CRL checking
unless X509::V_FLAG_CRL_CHECK is defined.
-Wed Jul 14 12:20:05 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Wed Jul 14 12:29:07 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* util.c (ruby_strtod): should not convert string in the form of
"-I.FE-X" which both "I" and "F" are ommitted. [ruby-dev:23883]
* test/ruby/test_float.rb (test_strtod): add test for bug fix.
-Wed Jul 14 00:33:48 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Wed Jul 14 00:31:15 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* array.c: rdoc patch. merged patch from Johan Holmberg
<holmberg@iar.se> [ruby-core:3170]
@@ -58434,7 +16475,7 @@ Tue Jul 13 19:39:12 2004 akira yamada <akira@ruby-lang.org>
* test/uri/test_generic.rb (TestGeneric#test_merge): added tests.
-Tue Jul 13 15:48:56 2004 Akinori MUSHA <knu@iDaemons.org>
+Tue Jul 13 15:51:45 2004 Akinori MUSHA <knu@iDaemons.org>
* lib/mkmf.rb (init_mkmf): Do not add $(libdir) to $LIBPATH in
extmk mode.
@@ -58446,14 +16487,14 @@ Tue Jul 13 00:50:48 2004 Dave Thomas <dave@pragprog.com>
* lib/rdoc/parsers/parse_rb.rb: Support call-seq: for Ruby files.
-Mon Jul 12 21:20:51 2004 Dave Thomas <dave@pragprog.com>
+Mon Jul 12 21:20:36 2004 Dave Thomas <dave@pragprog.com>
* html_generator.rb: Support hyperlinks of the form {any text}[xxx]
as well as stuff[xxx]
Sat Jul 10 09:30:24 2004 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
- * test/soap/marshal/test_struct.rb: use qualified built-in class name
+ * test/soap/marshal/test_struct.rb: use qualified build-tin class name
(::Struct) to avoid name crash.
Sat Jul 10 04:21:56 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
@@ -58468,7 +16509,7 @@ Sat Jul 10 04:21:56 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
function of Tk::ValidateConfigure to define validatecommand
methods easier
-Fri Jul 9 22:18:59 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Fri Jul 9 22:36:36 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* array.c, enum.c, pack.c: rdoc patch from Johan Holmberg
<holmberg@iar.se> [ruby-core:3132] [ruby-core:3136]
@@ -58488,33 +16529,36 @@ Fri Jul 9 14:28:54 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
Fri Jul 9 01:47:08 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
- * ext/tk/lib: bug fix
- * ext/tk/lib/tkextlib/itcl: add [incr Tcl] support
- * ext/tk/lib/tkextlib/itk: add [incr Tk] support
- * ext/tk/lib/tkextlib/iwidgets: midway point of [incr Widgets] support
- * ext/tk/sample/tkextlib/iwidgets: very simple examples of
+ * ext/tk/lib : bug fix
+ * ext/tk/lib/tkextlib/itcl : add [incr Tcl] support
+ * ext/tk/lib/tkextlib/itk : add [incr Tk] support
+ * ext/tk/lib/tkextlib/iwidgets : midway point of [incr Widgets] support
+ * ext/tk/sample/tkextlib/iwidgets : very simple examples of
[incr Widgets]
-Thu Jul 8 19:27:16 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in (rb_cv_stack_end_address): detect stack end address
- variable supplied by system. [ruby-core:03115]
+Thu Jul 8 22:52:19 2004 Kouhei Sutou <kou@cozmixng.org>
- * gc.c (Init_stack): use system provided address if possible.
+ * lib/rss/{rss,parser,0.9,1.0,2.0}.rb: supported RSS 0.9x/2.0
+ validation and validation which disregard order of elements.
+ * test/rss/test_parser.rb: added tests for RSS 0.9x/2.0
+ validation.
+ * test/rss/{test_trackback,rss-testcase}.rb: fixed no good method
+ name.
Thu Jul 8 00:05:23 2004 akira yamada <akira@ruby-lang.org>
* lib/tempfile.rb (Tempfile::initialize): got out code of
generating tmpname. [ruby-dev:23832][ruby-dev:23837]
-Wed Jul 7 02:31:41 2004 Kouhei Sutou <kou@cozmixng.org>
+Wed Jul 7 15:53:14 2004 NAKAMURA Usaku <usa@ruby-lang.org>
- * lib/rss/{rss,parser,0.9,1.0,2.0}.rb: supported RSS 0.9x/2.0
- validation and validation which disregard order of elements.
- * test/rss/test_parser.rb: added tests for RSS 0.9x/2.0
- validation.
- * test/rss/{test_trackback,rss-testcase}.rb: fixed no good method
- name.
+ * string.c (rb_str_match): raise TypeError when both arguments are
+ strings. [ruby-dev:22869] (backported from HEAD)
+
+ * string.c (rb_str_match2): removed.
+
+ * Makefile.in, bcc32/Makefile.sub, win32/Makefile.sub,
+ wince/Makefile.sub (string.c): now not depend on version.h.
Wed Jul 7 00:48:34 2004 WATANABE Hirofumi <eban@ruby-lang.org>
@@ -58523,7 +16567,7 @@ Wed Jul 7 00:48:34 2004 WATANABE Hirofumi <eban@ruby-lang.org>
Tue Jul 6 18:38:45 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
- * ext/tk/lib: improve framework of developping Tcl/Tk extension
+ * ext/tk/lib : improve framework of developping Tcl/Tk extension
wrappers
Mon Jul 5 23:56:42 2004 Kouhei Sutou <kou@cozmixng.org>
@@ -58542,7 +16586,7 @@ Mon Jul 5 09:02:52 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
* eval.c (rb_thread_yield, rb_f_catch): 4th argument to rb_yield_0()
is a set of bit flags. [ruby-dev:23859]
-Mon Jul 5 01:20:17 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Mon Jul 5 01:27:32 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* lib/drb/drb.rb(DRbConn self.open): If socket pool is full, close
the socket whose last-access-time is oldest. (and add new one)
@@ -58552,10 +16596,12 @@ Sun Jul 4 12:24:50 2004 Kouhei Sutou <kou@cozmixng.org>
* lib/rss/rss.rb: added copyright header.
-Sat Jul 3 22:25:27 2004 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+Sun Jul 4 00:24:40 2004 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
- * added files:
- * lib/soap/header/*
+ * added files
+ * lib/soap/attachment.rb
+ * lib/soap/header
+ * lib/soap/mimemessage.rb
* lib/soap/rpc/httpserver.rb
* lib/wsdl/soap/cgiStubCreator.rb
* lib/wsdl/soap/classDefCreator.rb
@@ -58569,29 +16615,36 @@ Sat Jul 3 22:25:27 2004 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
* lib/wsdl/xmlSchema/enumeration.rb
* lib/wsdl/xmlSchema/simpleRestriction.rb
* lib/wsdl/xmlSchema/simpleType.rb
- * lib/xsd/codegen/*
+ * lib/xsd/codegen
* lib/xsd/codegen.rb
- * sample/soap/authheader/*
- * sample/soap/raa2.4/*
- * sample/soap/ssl/*
- * sample/soap/swa/*
+ * sample/soap/authheader
+ * sample/soap/raa2.4
+ * sample/soap/ssl
+ * sample/soap/swa
* sample/soap/whois.rb
- * sample/wsdl/raa2.4/*
- * test/soap/header/*
- * test/soap/ssl/*
- * test/soap/struct/*
- * test/soap/swa/*
- * test/soap/wsdlDriver/*
+ * sample/soap/calc/samplehttpd.conf
+ * sample/soap/exchange/samplehttpd.conf
+ * sample/soap/sampleStruct/samplehttpd.conf
+ * sample/wsdl/raa2.4
+ * sample/wsdl/googleSearch/samplehttpd.conf
+ * test/openssl/_test_ssl.rb
+ * test/soap/header
+ * test/soap/ssl
+ * test/soap/struct
+ * test/soap/swa
+ * test/soap/wsdlDriver
* test/wsdl/multiplefault.wsdl
- * test/wsdl/simpletype/*
+ * test/wsdl/simpletype
* test/wsdl/test_multiplefault.rb
- * modified files:
+ * modified files
* lib/soap/baseData.rb
* lib/soap/element.rb
* lib/soap/generator.rb
+ * lib/soap/marshal.rb
* lib/soap/netHttpClient.rb
* lib/soap/parser.rb
+ * lib/soap/processor.rb
* lib/soap/property.rb
* lib/soap/soap.rb
* lib/soap/streamHandler.rb
@@ -58606,6 +16659,7 @@ Sat Jul 3 22:25:27 2004 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
* lib/soap/mapping/wsdlRegistry.rb
* lib/soap/rpc/cgistub.rb
* lib/soap/rpc/driver.rb
+ * lib/soap/rpc/element.rb
* lib/soap/rpc/proxy.rb
* lib/soap/rpc/router.rb
* lib/soap/rpc/soaplet.rb
@@ -58622,12 +16676,26 @@ Sat Jul 3 22:25:27 2004 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
* lib/wsdl/xmlSchema/schema.rb
* lib/xsd/datatypes.rb
* lib/xsd/qname.rb
+ * sample/soap/calc/httpd.rb
+ * sample/soap/exchange/httpd.rb
+ * sample/soap/sampleStruct/httpd.rb
* sample/soap/sampleStruct/server.rb
* sample/wsdl/amazon/AmazonSearch.rb
* sample/wsdl/amazon/AmazonSearchDriver.rb
+ * sample/wsdl/googleSearch/httpd.rb
+ * test/soap/test_basetype.rb
* test/soap/test_property.rb
+ * test/soap/test_streamhandler.rb
+ * test/soap/calc/test_calc.rb
+ * test/soap/calc/test_calc2.rb
* test/soap/calc/test_calc_cgi.rb
+ * test/soap/helloworld/test_helloworld.rb
* test/wsdl/test_emptycomplextype.rb
+ * test/wsdl/axisArray/test_axisarray.rb
+ * test/wsdl/datetime/test_datetime.rb
+ * test/wsdl/raa/test_raa.rb
+ * test/xsd/test_xmlschemaparser.rb
+ * test/xsd/test_xsd.rb
* summary
* add SOAP Header mustUnderstand support.
@@ -58642,33 +16710,34 @@ Sat Jul 3 22:25:27 2004 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
* add WSDL simpleType support to restrict lexical value space.
+ * add SOAP with Attachment support.
+
Sat Jul 3 17:19:44 2004 WATANABE Hirofumi <eban@ruby-lang.org>
* ext/tk/lib/tkextlib/tkDND.rb: fix syntax error.
-Thu Jul 1 18:36:08 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Thu Jul 1 23:15:29 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/tk/lib/tcltklib: bug fix
+ * lib/pstore.rb (transaction): safer backup scheme. [ruby-list:39102]
- * ext/tk/lib/tk: bug fix and add Tcl/Tk extension support libraries
+ * lib/pstore.rb (commit_new): use FileUtils.copy_stream for Cygwin.
+ [ruby-dev:23157]
-Thu Jul 1 18:31:31 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/pstore.rb (transaction): allow overriding dump and load.
+ [ruby-dev:23567]
* lib/pstore.rb (PStore#transaction): get rid of opening in write mode
when read only transaction. [ruby-dev:23842]
-Thu Jul 1 00:44:42 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * lib/yaml/store.rb: follow lib/pstore.rb's change.
- * ext/openssl/ossl_cipher.c (ossl_cipher_encrypt, ossl_cipher_decrypt):
- re-implemnt (the arguments for this method is ).
+Thu Jul 1 18:36:08 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
- * ext/openssl/ossl_cipher.c (ossl_cipher_pkcs5_keyivgen): new method
- OpenSSL::Cipher::Cipher#pkcs5_keyivgen. it calls EVP_BytesToKey().
+ * ext/tk/lib/tcltklib : bug fix
- * ext/openssl/ossl_cipher.c (ossl_cipher_set_key_length): new method
- OpenSSL::Cipher::Cipher#key_len=.
+ * ext/tk/lib/tk : bug fix and add Tcl/Tk extension support libraries
-Wed Jun 30 19:48:09 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Thu Jul 1 11:59:45 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
* ext/openssl/extconf.rb: check for EVP_CIPHER_CTX_copy, ENGINE_add,
EVP_CIPHER_CTX_set_padding, EVP_CipherFinal_ex, EVP_CipherInit_ex,
@@ -58680,17 +16749,23 @@ Wed Jun 30 19:48:09 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
EVP_CipherInit_ex, EVP_CipherFinal_ex, HMAC_Init_ex): new macro for
OpenSSL 0.9.6.
+ * ext/openssl/ossl_cipher.c (ossl_cipher_encrypt, ossl_cipher_decrypt):
+ re-implemnt (the arguments for this method is ).
+
+ * ext/openssl/ossl_cipher.c (ossl_cipher_pkcs5_keyivgen): new method
+ OpenSSL::Cipher::Cipher#pkcs5_keyivgen. it calls EVP_BytesToKey().
+
* ext/openssl/ossl_cipher.c (ossl_cipher_alloc, ossl_cipher_initialize,
- ossl_cipher_copy, ossl_cipher_reset, ossl_cipher_encrypt,
- ossl_cipher_decrypt, ossl_cipher_final, ossl_cipher_set_key,
- ossl_cipher_set_iv): replace all EVP_CipherInit and
- EVP_CipherFinal into EVP_CipherInit_ex and EVP_CipherFinal_ex.
+ ossl_cipher_copy, ossl_cipher_reset ossl_cipher_final,
+ ossl_cipher_set_key, ossl_cipher_set_iv): replace all EVP_CipherInit
+ and EVP_CipherFinal into EVP_CipherInit_ex and EVP_CipherFinal_ex.
and EVP_CIPHER_CTX_init should only be called once.
- * ext/openssl/ossl_cipher.c (ossl_cipher_set_padding): check for
- EVP_CIPHER_CTX_set_padding.
+ * ext/openssl/ossl_cipher.c (ossl_cipher_set_key_length): new method
+ OpenSSL::Cipher::Cipher#key_len=.
- * ext/openssl/ossl_cipher.c (Init_ossl_cipher): Cipher#<< is deprecated.
+ * ext/openssl/ossl_cipher.c (ossl_cipher_init_deprecated): new
+ finction; print warning for Cipher#<<.
* ext/openssl/ossl_digest.c: replace all EVP_DigestInit and
EVP_DigestFinal into EVP_DigestInit_ex and EVP_DigestFinal_ex.
@@ -58708,16 +16783,50 @@ Wed Jun 30 19:48:09 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
* test/openssl/test_cipher.rb, test/openssl/test_digest.rb,
test/openssl/test_hmac.rb: new file.
-Wed Jun 30 16:59:39 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Thu Jul 1 04:08:30 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
+
+ * ext/openssl/ossl_asn1.c (ossl_i2d_ASN1_TYPE, ossl_ASN1_TYPE_free):
+ workaround for the versions earlier than OpenSSL-0.9.7.
+
+Thu Jul 1 03:33:55 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
+
+ * ext/openssl/ossl_pkey_dh.c (ossl_dh_initialize): should create
+ empty pkey object if no argument is passed. [ruby-talk:103328]
+
+ * ext/openssl/ossl_pkey_dsa.c (ossl_dsa_initialize): ditto.
+
+ * ext/openssl/ossl_pkey_rsa.c (ossl_rsa_initialize): ditto.
+
+ * ext/openssl/ossl_pkey_dh.c: add new methods: OpenSSL::PKey::DH#p,
+ OpenSSL::PKey::DH#p=, OpenSSL::PKey::DH#g, OpenSSL::PKey::DH#g=,
+ OpenSSL::PKey::DH#pub_key, OpenSSL::PKey::DH#pub_key=,
+ OpenSSL::PKey::DH#priv_key and OpenSSL::PKey::DH#priv_key=.
+
+ * ext/openssl/ossl_pkey_dsa.c: add new methods: OpenSSL::PKey::DSA#p,
+ OpenSSL::PKey::DSA#p=, OpenSSL::PKey::DSA#q, OpenSSL::PKey::DSA#q=,
+ OpenSSL::PKey::DSA#g, OpenSSL::PKey::DSA#g=,
+ OpenSSL::PKey::DSA#pub_key, OpenSSL::PKey::DSA#pub_key=,
+ OpenSSL::PKey::DSA#priv_key and OpenSSL::PKey::DSA#priv_key=.
+
+Thu Jul 1 03:16:09 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
- * test/ruby/test_file.rb (test_fnmatch): some tests for File.fnmatch
- are added.
+ * ext/openssl/ossl_ssl.c (ossl_ssl_read): take optional second argument
+ to specify a string to be written.
+
+ * ext/openssl/lib/openssl/buffering.rb (OpenSSL::Buffering#read):
+ take optional second argument to specify a string to be written.
+
+ * ext/openssl/lib/openssl/buffering.rb (OpenSSL::Buffering#gets):
+ refine regexp for end-of-line.
+
+ * ext/opnessl/lib/openssl/ssl.rb
+ (OpenSSL::SSL::SocketForwarder#listen): fix typo.
Wed Jun 30 11:38:51 2004 Mikael Brockman <phubuh@phubuh.org>
* parse.y (primary): should not be NULL. [ruby-core:03098]
-Wed Jun 30 02:41:10 2004 why the lucky stiff <why@ruby-lang.org>
+Wed Jun 30 02:53:24 2004 why the lucky stiff <why@ruby-lang.org>
* ext/syck/rubyext.c (syck_emitter_new): set buffer after
Data_Wrap_Struct to avoid possible GC. [ruby-talk:104835]
@@ -58737,107 +16846,80 @@ Mon Jun 28 14:57:56 2004 Jeff Mitchell <quixoticsycophant@yahoo.com>
* configure.in, lib/mkmf.rb (LIBPATHFLAG): use double quotes due to
DOSISH compilers. [ruby-core:03107]
-Mon Jun 28 00:35:29 2004 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+Mon Jun 28 00:30:19 2004 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
* sample/drb/*.rb: using 'DRb.thread.join' instead of 'gets'
-Sun Jun 27 22:36:47 2004 Kouhei Sutou <kou@cozmixng.org>
+Sun Jun 27 22:39:51 2004 Kouhei Sutou <kou@cozmixng.org>
* sample/rss/tdiary_plugin/rss-recent.rb: supported Hiki.
-Sat Jun 26 15:17:11 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun Jun 27 12:19:46 2004 Kouhei Sutou <kou@cozmixng.org>
- * variable.c (rb_mod_class_variables): class variables are no longer
- inherited. [ruby-dev:23808]
+ * {lib,sample,test}/rss: added RSS Parser. [ruby-dev:23780]
-Sat Jun 26 11:07:20 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat Jun 26 11:07:30 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
* configure.in (aix): -b must come at the start of the command line,
and -e must not appear while testing libraries. [ruby-talk:104501]
- * lib/mkmf.rb (find_header, dir_config): quote directory names if
- necessary. [ruby-talk:104505]
+ * lib/mkmf.rb (dir_config): quote directory names if necessary.
+ [ruby-talk:104505]
-Sat Jun 26 00:13:08 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Jun 25 15:33:19 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * io.c (rb_fopen, rb_fdopen, rb_io_reopen): setvbuf() may return
- positive value on failure. [ruby-dev:23792]
+ * ext/iconv/extconf.rb: check stricter. [ruby-talk:104501]
-Fri Jun 25 18:07:15 2004 Michal Rokos <michal@ruby-lang.org>
+ * ext/iconv/extconf.rb: include iconv.h for libiconv. [ruby-dev:22715]
- * gc.c: bring back _stklen for DJGPP [ruby-core:3084]
+Fri Jun 25 08:31:29 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
-Fri Jun 25 15:33:01 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * eval.c (rb_thread_atfork): remove "fork terminates thread"
+ warning. [ruby-dev:23768]
- * ext/iconv/extconf.rb: check stricter. [ruby-talk:104501]
+ * object.c (rb_obj_clone): backport FL_FINALIZE patch from 1.9.
+ [ruby-core:02786][ruby-core:03067]
-Fri Jun 25 01:58:01 2004 NAKAMURA Usaku <usa@ruby-lang.org>
+ * ext/socket/socket.c (sock_sockaddr): Socket#gethostbyname()
+ should give us packed address, not struct sockaddr.
+ [ruby-core:03053]
+
+Fri Jun 25 02:04:23 2004 NAKAMURA Usaku <usa@ruby-lang.org>
* {bcc32,win32,wince}/setup.mak: remove RUBY_EXTERN lines when
- including version.h. [ruby-talk:104456]
+ including version.h. [ruby-talk:104456] (backported from HEAD)
Thu Jun 24 14:23:29 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
* io.c (rb_io_fread): return already read data when system call is
interrupted. [ruby-talk:97206]
-Thu Jun 24 01:25:21 2004 Shugo Maeda <shugo@ruby-lang.org>
+Thu Jun 24 01:32:43 2004 Shugo Maeda <shugo@ruby-lang.org>
* version.h: added declarations of ruby_version,
ruby_release_date, ruby_platform.
+ (backported from HEAD)
-Thu Jun 24 01:07:15 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * ext/socket/socket.c (sock_sockaddr): Socket#gethostbyname()
- should give us packed address, not struct sockaddr.
- [ruby-core:03053]
-
-Wed Jun 23 22:19:10 2004 Dave Thomas <dave@pragprog.com>
+Wed Jun 23 22:23:37 2004 Dave Thomas <dave@pragprog.com>
* ext/socket/socket.c (sock_s_gethostbyaddr): Work around problem
with OS X not returning 'from' parameter to recvfrom for
connection-oriented sockets.
-Wed Jun 23 22:16:16 2004 Michal Rokos <michal@ruby-lang.org>
-
- * io.c: io_seek()'s retval should be checked [ruby-core:03045]
-
-Wed Jun 23 21:48:27 2004 Michal Rokos <michal@ruby-lang.org>
-
- * time.c: Fix indentation.
-
- * main.c: Remove _stklen, and _CRT_glob. Move _stacksize for
- __human68k__ to gc.c where the others are.
-
- * gc.c: put _stacksize in place and clean the #ifdefs macros.
-
-Wed Jun 23 17:37:54 2004 Shugo Maeda <shugo@ruby-lang.org>
-
- * lib/net/imap.rb: added new option --ssl.
-
Wed Jun 23 01:45:27 2004 Dave Thomas <dave@pragprog.com>
* lib/rdoc/parsers/parse_rb.rb (RubyLex::identify_quotation):
Fix problem with the 'r' being dropped from %r{xxx}
-Wed Jun 23 00:10:17 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Wed Jun 23 00:20:20 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* ext/win32ole/win32ole.c (ole_hresult2msg): remove trailing
CRs and LFs. (doesn't depend on CR+LF) [ruby-dev:23749]
Wed Jun 23 00:00:25 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * eval.c (return_jump, break_jump): raise unexpected local jump
- exception directly. [ruby-dev:23740]
-
* io.c (rb_io_initialize): should check fcntl result. [ruby-dev:23742]
-Tue Jun 22 23:35:43 2004 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * sprintf.c (rb_f_sprintf): support FZERO and FSPACE with NaN/Inf.
-
- * test/ruby/test_sprintf.rb (test_nan, test_inf): add tests.
-
Tue Jun 22 21:11:36 2004 Masaki Suketa <masaki.suketa@nifty.ne.jp>
* ext/win32ole/win32ole.c (OLE_FREE): should not call CoFreeUnuse-
@@ -58848,56 +16930,21 @@ Tue Jun 22 21:11:36 2004 Masaki Suketa <masaki.suketa@nifty.ne.jp>
* ext/win32ole/win32ole.c (ole_hresult2msg): truncate error message
before CR.
-Tue Jun 22 19:24:59 2004 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * sprintf.c (rb_f_sprintf): unify output of NaN, Inf and -Inf with
- "%f" or etc on all platform. [ruby-dev:23704], [ruby-dev:23747]
-
-Tue Jun 22 15:28:12 2004 Michal Rokos <michal@ruby-lang.org>
-
- * compar.c: Remove explicit NIL_P() checks since rb_cmpint() does it
- again in the exactly same manner.
-
-Tue Jun 22 01:32:40 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * ext/openssl/ossl_pkey_dh.c (ossl_dh_initialize): should create
- empty pkey object if no argument is passed. [ruby-talk:103328]
-
- * ext/openssl/ossl_pkey_dsa.c (ossl_dsa_initialize): ditto.
-
- * ext/openssl/ossl_pkey_rsa.c (ossl_rsa_initialize): ditto.
-
- * ext/openssl/ossl_pkey_dh.c: add new methods: OpenSSL::PKey::DH#p,
- OpenSSL::PKey::DH#p=, OpenSSL::PKey::DH#g, OpenSSL::PKey::DH#g=,
- OpenSSL::PKey::DH#pub_key, OpenSSL::PKey::DH#pub_key=,
- OpenSSL::PKey::DH#priv_key and OpenSSL::PKey::DH#priv_key=.
-
- * ext/openssl/ossl_pkey_dsa.c: add new methods: OpenSSL::PKey::DSA#p,
- OpenSSL::PKey::DSA#p=, OpenSSL::PKey::DSA#q, OpenSSL::PKey::DSA#q=,
- OpenSSL::PKey::DSA#g, OpenSSL::PKey::DSA#g=,
- OpenSSL::PKey::DSA#pub_key, OpenSSL::PKey::DSA#pub_key=,
- OpenSSL::PKey::DSA#priv_key and OpenSSL::PKey::DSA#priv_key=.
-
-Mon Jun 21 09:24:51 2004 NAKAMURA Usaku <usa@ruby-lang.org>
+Tue Jun 22 16:47:42 2004 Shugo Maeda <shugo@ruby-lang.org>
- * win32/win32.c (rb_w32_opendir): should set errno if error occurs
- when calling OS API.
+ * lib/net/ftp.rb (MDTM_REGEXP): fix for demon's ftp server.
+ Thanks, Rutger Nijlunsing.
-Sun Jun 20 21:12:54 2004 Shugo Maeda <shugo@ruby-lang.org>
+Mon Jun 21 10:19:23 2004 NAKAMURA Usaku <usa@ruby-lang.org>
- * lib/net/ftp.rb (binary=): send TYPE commands only once.
+ * win32/win32.c (rb_w32_opendir): use FindFirstFile()/FindNextFile()/
+ FindClose() instead of _findfirst()/_findnext()/_findclose().
+ merge from HEAD.
-Sat Jun 19 13:27:01 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat Jun 19 13:24:15 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
* eval.c (method_call): allow changing $SAFE. [ruby-dev:23713]
- * eval.c (proc_set_safe_level, proc_invoke, rb_mod_define_method): not
- set $SAFE for methods defined from Proc. [ruby-dev:23697]
-
-Sat Jun 19 01:10:12 2004 Kouhei Sutou <kou@cozmixng.org>
-
- * sample/rss/tdiary_plugin/rss-recent.rb: added more information.
-
Fri Jun 18 23:12:22 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
* eval.c (proc_save_safe_level, rb_set_safe_level, safe_setter): limit
@@ -58908,27 +16955,10 @@ Wed Jun 16 23:05:57 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
* object.c (rb_mod_freeze): prepare string representation before
freezing. [ruby-talk:103646]
-Wed Jun 16 19:57:24 2004 Michal Rokos <michal@ruby-lang.org>
-
- * test/ruby/test_array.rb: extend testcase to check #first, #last,
- #shift, #unshift, #pop, #push
-
-Wed Jun 16 16:05:17 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * array.c (ary_new): move alloc behind checks. [ruby-core:02982]
-
- * array.c (rb_ary_pop_m, rb_ary_shift_m): take arg to behave as push
- and unshift.
-
- * array.c (rb_ary_first, rb_ary_last): make shared array for result
- array, and correct doc for Array#first(n) and Array#last(n)
-
- * array.c (rb_ary_select): not accept any arg.
-
-Wed Jun 16 16:03:59 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Jun 16 16:04:40 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * object.c (rb_class_inherited_p): singleton class inherits Class
- rather than its object's class. [ruby-dev:23690]
+ * object.c (rb_mod_le): singleton class inherits Class rather than its
+ object's class. [ruby-dev:23690]
Wed Jun 16 16:01:17 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
@@ -58963,36 +16993,31 @@ Sun Jun 13 00:23:04 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tk/sample/menubar?.rb: [add] sample of menu_spec usage
-Sat Jun 12 14:15:20 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * dir.c: RDOC for File::FNM_CASEFOLD was missed.
-
Sat Jun 12 11:15:53 2004 WATANABE Hirofumi <eban@ruby-lang.org>
* configure.in (target_os): strip -gnu suffix on Linux.
-Fri Jun 11 22:08:50 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * array.c: remove #indexes, #indices.
+Fri Jun 11 17:08:21 2004 Akinori MUSHA <knu@iDaemons.org>
- * hash.c: ditto.
+ * config.guess: Restore a wrongly removed hyphen.
- * ext/dbm/dbm.c: remove #indexes, #indices, "values_at" warning
- from #select.
+Fri Jun 11 14:30:08 2004 Akinori MUSHA <knu@iDaemons.org>
- * ext/gdbm/gdbm.c: ditto.
+ * config.guess: Attempt to avoid system name change on
+ Darwin platforms also.
- * ext/sdbm/init.c: ditto.
+Fri Jun 11 14:22:45 2004 Akinori MUSHA <knu@iDaemons.org>
- * ext/dbm/dbm.c (Init_dbm): set VERSION constant as "unknown" when
- DB_VERSION_STRING is not available.
+ * config.guess, config.sub: Attempt to avoid system name change on
+ Linux platforms. We have been using "linux" instead of
+ "linux-gnu" on this branch.
Thu Jun 10 19:19:41 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
* ext/sdbm/init.c (fsdbm_store): sdbm should use StringValue().
[ruby-talk:103062]
-Wed Jun 9 16:09:01 2004 akira yamada <akira@ruby-lang.org>
+Wed Jun 9 18:04:14 2004 akira yamada <akira@ruby-lang.org>
* lib/uri/generic.rb (URI::Generic::merge,
URI::Generic::route_from): accepts non-hierarchical URI.
@@ -59001,18 +17026,12 @@ Wed Jun 9 16:09:01 2004 akira yamada <akira@ruby-lang.org>
* test/uri/test_generic.rb (TestGeneric::test_route,
TestGeneric::test_merge): added tests for above changes.
-Wed Jun 9 15:39:55 2004 Akinori MUSHA <knu@iDaemons.org>
-
- * configure.in: Add support for DragonFly BSD.
-
-Wed Jun 9 15:07:06 2004 Akinori MUSHA <knu@iDaemons.org>
+Wed Jun 9 17:39:37 2004 Akinori MUSHA <knu@iDaemons.org>
* config.guess, config.sub: Update to a more recent version as of
2004-01-20.
-Wed Jun 9 11:20:05 2004 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/win32.c: remove unused functions and variables.
+ * configure.in: Add support for DragonFly BSD.
Wed Jun 2 20:16:03 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
@@ -59030,43 +17049,82 @@ Fri May 28 11:20:31 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
* eval.c (eval): reverted wrongly removed condition. [ruby-dev:23638]
-Thu May 27 21:37:50 2004 Tanaka Akira <akr@m17n.org>
-
- * lib/pathname.rb (Pathname#initialize): fix pathname initialization
- by pathname.
+Thu May 27 23:15:18 2004 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
-Thu May 27 20:02:09 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+ * lib/logger.rb: leading 0 padding of timestamp usec part.
- * io.c (rb_io_fwrite): check all case errno != 0 [ruby-dev:23648]
+ * lib/csv.rb (CSV.parse): [CAUTION] behavior changed. in the past,
+ CSV.parse accepts a filename to be read-opened (it was just a
+ shortcut of CSV.open(filename, 'r')). now CSV.parse accepts a
+ string or a stream to be parsed e.g.
+ CSV.parse("1,2\n3,r") #=> [['1', '2'], ['3', '4']]
-Thu May 27 15:54:02 2004 Shugo Maeda <shugo@ruby-lang.org>
+ * lib/csv.rb: CSV::Row and CSV::Cell are deprecated. these classes
+ are removed in the future. in the new csv.rb, row is represented
+ as just an Array. since CSV::Row was a subclass of Array, it won't
+ hurt almost all programs except one which depended CSV::Row#match.
+ and a cell is represented as just a String or nil(NULL). this
+ change will cause widespread destruction.
- * lib/net/ftp.rb (MDTM_REGEXP): fix for demon's ftp server.
- Thanks, Rutger Nijlunsing.
+ CSV.open("foo.csv", "r") do |row|
+ row.each do |cell|
+ if cell.is_null # using Cell#is_null
+ p "(NULL)"
+ else
+ p cell.data # using Cell#data
+ end
+ end
+ end
-Thu May 27 14:53:13 2004 WATANABE Hirofumi <eban@ruby-lang.org>
+ must be just;
- * io.c (rb_io_fwrite): workaround for bcc32's fwrite bug.
- add errno checking. [ruby-dev:23627]
+ CSV.open("foo.csv", "r") do |row|
+ row.each do |cell|
+ if cell.nil?
+ p "(NULL)"
+ else
+ p cell
+ end
+ end
+ end
- * io.c (rb_io_fwrite): should check if errno == ENOENT, too.
+ * lib/csv.rb: [CAUTION] record separator(CR, LF, CR+LF) behavior
+ change. CSV.open, CSV.parse, and CSV,generate now do not force
+ opened file binmode. formerly it set binmode explicitly.
-Thu May 27 11:25:03 2004 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+ with CSV.open, binmode of opened file depends the given mode
+ parameter "r", "w", "rb", and "wb". CSV.parse and CSV.generate open
+ file with "r" and "w".
- * test/csv/test_csv.rb: illegal require module name (../lib/csv.rb).
+ setting mode properly is user's responsibility now.
-Wed May 26 23:12:13 2004 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+ * lib/csv.rb: accepts String as a fs (field separator/column separator)
+ and rs (record separator/row separator)
* lib/csv.rb (CSV.read, CSV.readlines): added. works as IO.read and
IO.readlines in CSV format.
- * lib/csv.rb (CSV.parse): [CAUTION] behavior changed. in the past,
- CSV.parse accepts a filename to be read-opened (it was just a
- shortcut of CSV.open(filename, 'r')). now CSV.parse accepts a
- string or a stream to be parsed e.g.
- CSV.parse("1,2\n3,r") #=> [['1', '2'], ['3', '4']]
+ * lib/csv.rb: added CSV.foreach(path, rs = nil, &block). CSV.foreach
+ now does not handle "| cmd" as a path different from IO.foreach.
+ needed?
+
+ * test/csv/test_csv.rb: updated.
+
+ * test/ruby/test_float.rb: added test_strtod to test Float("0").
+
+Thu May 27 21:37:50 2004 Tanaka Akira <akr@m17n.org>
- * test/csv/test_csv.rb: follow above changes.
+ * lib/pathname.rb (Pathname#initialize): refine pathname initialization
+ by pathname.
+
+Thu May 27 20:22:05 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+
+ * io.c (rb_io_fwrite): check all case errno != 0 [ruby-dev:23648]
+
+Thu May 27 14:53:13 2004 WATANABE Hirofumi <eban@ruby-lang.org>
+
+ * io.c (rb_io_fwrite): workaround for bcc32's fwrite bug.
+ add errno checking. [ruby-dev:23627]
Wed May 26 14:19:42 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
@@ -59097,33 +17155,16 @@ Wed May 26 00:00:00 2004 why the lucky stiff <why@ruby-lang.org>
* lib/yaml/baseemitter.rb (indent_text): simpler flow block code.
-Tue May 25 11:54:13 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval.c (rb_yield_0, proc_invoke, proc_arity): allow passing a block
- to a Proc. [ruby-dev:23533]
-
- * parse.y (block_par, block_var): ditto.
-
-Tue May 25 01:50:17 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * ext/openssl/ossl_asn1.c (ossl_i2d_ASN1_TYPE, ossl_ASN1_TYPE_free):
- workaround for the versions earlier than OpenSSL-0.9.7.
+ * lib/yaml.rb: added rdoc to beginning of lib.
Mon May 24 10:46:26 2004 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
* lib/rdoc/generators/template/html/html.rb: SYSTEM identifiers
must be absolute URIs
-Sun May 23 04:53:50 2004 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-
- * lib/pstore.rb (transaction): allow overriding dump and load.
- [ruby-dev:23567]
-
- * lib/yaml/store.rb: follow lib/pstore.rb's change.
-
-Sat May 22 11:54:10 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat May 22 12:00:04 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * MANIFEST: add test/openssl/test_x509store.rb.
+ * MANIFEST: add new encodings in rexml.
* ext/tk/MANIFEST: add recent files.
@@ -59137,12 +17178,6 @@ Fri May 21 09:22:05 2004 Dave Thomas <dave@pragprog.com>
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_method_parameters):
Add ()'s around parameters that don't have them
-Fri May 21 02:21:11 2004 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
-
- * lib/csv.rb: fixed a few bugs around multi char record/field separator.
-
- * test/csv/test_csv.rb: added boundary test for above feature.
-
Thu May 20 17:02:03 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/mkmf.rb (check_sizeof): define result size. [ruby-core:02911]
@@ -59150,6 +17185,10 @@ Thu May 20 17:02:03 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/mkmf.rb (create_header): macro name should not include equal
sign.
+Thu May 20 15:59:50 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+
+ * ext/socket/socket.c: fix SEGV. [ruby-dev:23550]
+
Thu May 20 14:35:52 2004 Tanaka Akira <akr@m17n.org>
* ext/socket/socket.c: check SCM_RIGHTS macro addition to
@@ -59170,100 +17209,20 @@ Thu May 20 12:34:39 2004 Dave Thomas <dave@pragprog.com>
Thu May 20 12:22:13 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/mkmf.rb (have_type): do not check pointer to incomplete type,
- which always get compiled.
- [ruby-list:39683]
-
-Wed May 19 23:45:43 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ which always get compiled. [ruby-list:39683]
- * test/inlinetest.rb (InlineTest::loadtest): requiring library with
- replaced $0 can make $0 == __FILE__ block be evaluated twice.
-
- * test/ruby/envutil.rb (EnvUtil::rubybin): give priority to
- environment variable. [ruby-dev:23538]
-
-Wed May 19 11:08:10 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Wed May 19 11:09:00 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tk/lib/tk.rb: change permition of TkObject#tk_send from
private to public
-Wed May 19 02:29:36 2004 Minero Aoki <aamine@loveruby.net>
-
- * lib/net/http.rb: support TRACE.
-
-Wed May 19 02:21:53 2004 Minero Aoki <aamine@loveruby.net>
-
- * lib/net/http.rb: do not use class variables.
-
-Tue May 18 21:21:43 2004 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
-
- * lib/csv.rb: writes lines with "\n" when row separator is not given.
- formerly it was "\r\n".
-
- * lib/csv.rb: [CAUTION] API change
-
- * CSV::Row removed. a row is represented as just an Array. since
- CSV::Row was a subclass of Array, it won't hurt almost all programs
- except one which depended CSV::Row#match.
-
- * CSV::Cell removed. a cell is represented as just a String or
- nil(NULL). this change will cause widespread destruction.
-
- CSV.open("foo.csv", "r") do |row|
- row.each do |cell|
- if cell.is_null # Cell#is_null
- p "(NULL)"
- else
- p cell.data # Cell#data
- end
- end
- end
-
- must be just;
-
- CSV.open("foo.csv", "r") do |row|
- row.each do |cell|
- if cell.nil?
- p "(NULL)"
- else
- p cell
- end
- end
- end
-
- * lib/csv.rb: [CAUTION] record separator(CR, LF, CR+LF) behavior
- change. CSV.open, CSV.parse, and CSV,generate now do not force
- opened file binmode. formerly it set binmode explicitly.
-
- with CSV.open, binmode of opened file depends the given mode
- parameter "r", "w", "rb", and "wb". CSV.parse and CSV.generate open
- file with "r" and "w".
-
- setting mode properly is user's responsibility now.
-
- * lib/csv.rb: accepts String as a fs (field separator/column separator)
- and rs (record separator/row separator)
-
- * lib/csv.rb: added CSV.foreach(path, rs = nil, &block). CSV.foreach
- now does not handle "| cmd" as a path different from IO.foreach.
- needed?
-
- * test/csv/test_csv.rb: updated.
-
-Tue May 18 14:24:20 2004 why the lucky stiff <why@ruby-lang.org>
-
- * lib/yaml.rb: added rdoc to beginning of lib.
-
Tue May 18 14:00:46 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
* node.h (NEW_DSTR): adjust list length.
* parse.y (literal_concat): ditto.
-Tue May 18 09:30:25 2004 SASADA Koichi <ko1@atdot.net>
-
- * eval.c (rb_method_node): search cache entry first.
-
-Mon May 17 16:04:06 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Mon May 17 16:14:25 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* numeric.c (flo_to_s): it's preferable that "p 0.0" outputs "0.0"
instead of "0.0e+00". [ruby-dev:23480]
@@ -59280,43 +17239,13 @@ Mon May 17 10:13:33 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
* ext/socket/socket.c (sock_s_getnameinfo): ditto.
-Mon May 17 00:36:21 2004 why the lucky stiff <why@ruby-lang.org>
+Mon May 17 01:15:23 2004 why the lucky stiff <why@ruby-lang.org>
+
+ * lib/yaml.rb: removed fallback to pure Ruby parser.
* lib/yaml/baseemitter.rb (indent_text): was forcing a mod value
of zero at times, which kept some blocks from getting indentation.
-Mon May 17 00:07:00 2004 Gavin Sinclair <gsinclair@soyabean.com.au>
-
- * lib/drb/drb.rb: Cosmetic documentation changes.
-
-Sun May 16 20:55:49 2004 Tanaka Akira <akr@m17n.org>
-
- * ext/dbm/dbm.c (fdbm_initialize): accept optional 3rd argument to
- specify an open flag.
- (Init_dbm): define open flags: DBM::READER, DBM::WRITER, DBM::WRCREAT
- and DBM::NEWDB.
-
-Sat May 15 17:52:24 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * test/ruby/test_float.rb(test_strtod): Add test for signed 0.000...1
-
-Sat May 15 14:20:13 2004 WATANABE Hirofumi <eban@ruby-lang.org>
-
- * ext/syck/depend: add ruby's headers.
-
-Sat May 15 13:38:33 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/syck/MANIFEST, ext/syck/depend: new file.
-
- * lib/yaml/rubytypes.rb: range of exponential floats. [ruby-core:02824]
-
- * test/yaml/test_yaml.rb: tests for strings start with colon and some
- round trip.
-
-Sat May 15 12:04:58 2004 why the lucky stiff <why@ruby-lang.org>
-
- * lib/yaml.rb: removed fallback to pure Ruby parser.
-
* lib/yaml/baseemitter.rb (node_text): rewriting folded scalars.
* ext/syck/syck.h: reports style of scalars now, be they plain, block
@@ -59333,9 +17262,33 @@ Sat May 15 12:04:58 2004 why the lucky stiff <why@ruby-lang.org>
* ext/syck/rubyext.c (yaml_org_handler): symbols loaded only
if scalar style is plain.
+ * ext/syck/rubyext.c (yaml_org_handler): some empty strings were
+ loaded as symbols.
+
* test/yaml/test_yaml.rb (test_perl_regexp): updated test to
match new regexp serialization.
+Mon May 17 00:03:00 2004 Gavin Sinclair <gsinclair@soyabean.com.au>
+
+ * lib/drb/drb.rb: Cosmetic documentation changes.
+
+Sun May 16 22:36:00 2004 Gavin Sinclair <gsinclair@soyabean.com.au>
+
+ * lib/test/unit.rb: Removed :nodoc: directive (it prevented effective
+ RDoc operation), and added file-level comment.
+
+Sun May 16 20:55:49 2004 Tanaka Akira <akr@m17n.org>
+
+ * ext/dbm/dbm.c (fdbm_initialize): accept optional 3rd argument to
+ specify an open flag.
+ (Init_dbm): define open flags: DBM::READER, DBM::WRITER, DBM::WRCREAT
+ and DBM::NEWDB.
+
+Sun May 16 13:10:00 2004 Gavin Sinclair <gsinclair@soyabean.com.au>
+
+ * lib/test/unit/**/*.rb: Removed :nodoc: directives (many were
+ generating warnings, many were on private methods).
+
Sat May 15 01:41:34 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
* eval.c (eval): forgot to restore $SAFE value before evaluating
@@ -59351,27 +17304,18 @@ Fri May 14 22:08:38 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
* string.c (rb_str_new4): should not reuse frozen shared string if
the original is not an instance of String. [ruby-talk:100193]
-Fri May 14 21:29:26 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * time.c (time_mdump): preserve GMT bit in the marshal data.
- [ruby-talk:100213]
-
-Fri May 14 18:37:49 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Fri May 14 18:39:25 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
- * ext/tk/lib/tk/canvas.rb: improve coords support for canvas
- items. Now, supports all of the followings.
- TkcLine.new(c, 0, 0, 100, 100, :fill=>'red')
- TkcLine.new(c, [0, 0, 100, 100], :fill=>'red')
- TkcLine.new(c, [0, 0], [100, 100], :fill=>'red')
- TkcLine.new(c, [[0, 0], [100, 100]], :fill=>'red')
- TkcLine.new(c, :coords=>[0, 0, 100, 100], :fill=>'red')
- TkcLine.new(c, :coords=>[[0, 0], [100, 100]], :fill=>'red')
+ * ext/tk/lib/tk/canvas.rb: improve coords support for canvas items.
+ Now, supports all of the followings.
+ TkcLine.new(c, 0, 0, 100, 100, :fill=>'red')
+ TkcLine.new(c, [0, 0, 100, 100], :fill=>'red')
+ TkcLine.new(c, [0, 0], [100, 100], :fill=>'red')
+ TkcLine.new(c, [[0, 0], [100, 100]], :fill=>'red')
+ TkcLine.new(c, :coords=>[0, 0, 100, 100], :fill=>'red')
+ TkcLine.new(c, :coords=>[[0, 0], [100, 100]], :fill=>'red')
-Fri May 14 13:30:39 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * test/ruby/test_float.rb: Add test for util.c revision 1.42.
-
-Fri May 14 12:13:46 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Fri May 14 12:11:43 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* util.c (ruby_strtod): strtod("0", &end); => end should point '\0'.
[ruby-dev:23498]
@@ -59381,10 +17325,15 @@ Thu May 13 15:47:30 2004 akira yamada <akira@ruby-lang.org>
* lib/net/telnet.rb (Net::Telnet::login): "options" can specify
regexps for login prompt and/or password prompt.
-Thu May 13 14:17:57 2004 why the lucky stiff <why@ruby-lang.org>
+Thu May 13 14:23:45 2004 WATANABE Hirofumi <eban@ruby-lang.org>
- * ext/syck/rubyext.c (yaml_org_handler): some empty strings were
- loaded as symbols.
+ * hash.c (delete_if_i): use st_delete_safe() (via
+ rb_hash_delete()) instead of returning ST_DELETE.
+ backport from HEAD. [ruby-dev:23487]
+
+Thu May 13 13:01:30 2004 akira yamada <akira@ruby-lang.org>
+
+ * lib/uri/mailto.rb (URI::MailTo::to_s): should include fragment.
Thu May 13 11:04:08 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
@@ -59416,15 +17365,6 @@ Wed May 12 11:51:08 2004 Dave Thomas <dave@pragprog.com>
* class.c (rb_obj_singleton_methods): fix rdoc
-Tue May 11 07:09:42 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (is_defined): do not protect exception during receiver
- evaluation.
-
-Mon May 10 22:28:14 2004 Minero Aoki <aamine@loveruby.net>
-
- * lib/net/protocol.rb (each_crlf_line): remove junk line.
-
Mon May 10 21:44:42 2004 Dave Thomas <dave@pragprog.com>
* lib/rdoc/generators/html_generator.rb: Change scheme for
@@ -59443,81 +17383,43 @@ Mon May 10 12:11:37 2004 Dave Thomas <dave@pragprog.com>
* lib/rdoc/generators/html_generator.rb: Hack to search parents
for unqualified constant names.
-Mon May 10 01:18:15 2004 Minero Aoki <aamine@loveruby.net>
-
- * lib/net/pop.rb (logging): append "\n".
-
-Sun May 9 23:38:00 2004 Gavin Sinclair <gsinclair@soyabean.com.au>
-
- * lib/net/ftp.rb: ported documentation improvement from 1.8 branch
-
- * lib/net/imap.rb: ditto
+Mon May 10 12:11:37 2004 Dave Thomas <dave@pragprog.com>
- * lib/net/pop.rb: ditto
+ * lib/rdoc/generators/html_generator.rb: Hack to search parents
+ for unqualified constant names.
- * lib/net/smtp.rb: ditto
+Sun May 9 22:37:00 2004 Gavin Sinclair <gsinclair@soyabean.com.au>
+ * lib/net/ftp.rb: improved documentation
+ * lib/net/imap.rb: ditto
+ * lib/net/pop.rb: ditto
+ * lib/net/smtp.rb: ditto
* lib/net/telnet.rb: ditto
-Sun May 9 23:34:51 2004 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
-
- * test/ruby/test_float.rb: added test_strtod to test Float("0").
-
-Sun May 9 13:24:24 2004 WATANABE Hirofumi <eban@ruby-lang.org>
-
- * lib/yaml/store.rb: use FileUtils::copy.
-
-Sun May 9 12:34:26 2004 Kazuo Saito <ksaito@uranus.dti.ne.jp>
-
- * regex.c: removed unused file.
-
-Sat May 8 10:53:30 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * io.c (rb_f_open): open should not ignore block when "to_open"
- method is used. [ruby-dev:23478]
-
-Fri May 7 22:07:39 2004 Minero Aoki <aamine@loveruby.net>
-
- * lib/fileutils.rb (mv): new option `force'. [ruby-talk:99457]
-
- * lib/fileutils.rb: new method for command option reflection:
- FileUtils.commands, .options, .have_option?, .options_of,
- .collect_methods.
-
- * lib/fileutils.rb: module Verbose, NoWrite, DryRun do not have
- option flags @fileutils_verbose and @fileutils_noop, they make no
- sense.
-
Fri May 7 21:50:21 2004 Dave Thomas <dave@pragprog.com>
* lib/rdoc/parsers/parse_rb.rb (RDoc::parse_include): Allow
multiple arguments to 'include'
-Fri May 7 21:03:51 2004 Minero Aoki <aamine@loveruby.net>
+Fri May 7 21:31:56 2004 Minero Aoki <aamine@loveruby.net>
* lib/fileutils.rb (fu_list): Array() breaks pathes including "\n".
[ruby-core:02843]
- * test/fileutils/test_fileutils.rb (mkdir): test "\n" in path.
-
-Fri May 7 20:53:25 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * ext/dbm/dbm.c (fdbm_modify): typo fixed. [ruby-dev:23473]
-
-Fri May 7 11:17:27 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Fri May 7 11:25:53 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* util.c (ruby_strtod): "0.0000000000000000001" should be converted
to 1.0e-19 instead of 0.0. (leading zeros aren't significant digits)
[ruby-talk:99318] [ruby-dev:23465]
-Thu May 6 22:27:32 2004 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+Fri May 7 10:00:05 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
- * ext/socket/socket.c (ippaddr): use NUMERICHOST if can not resolve
- hostname.
+ * ext/tk/tkutil.c (get_eval_string_core): bug fix. [ruby-dev:23466]
-Thu May 6 22:09:29 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Thu May 6 22:13:17 2004 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
- * ext/tk/tkutil.c (get_eval_string_core): bug fix. [ruby-dev:23466]
+ * ext/socket/socket.c (ippaddr): use NUMERICHOST if can not resolve
+ hostname.
Thu May 6 14:22:29 2004 why the lucky stiff <why@ruby-lang.org>
@@ -59532,15 +17434,6 @@ Thu May 6 14:22:29 2004 why the lucky stiff <why@ruby-lang.org>
* ext/syck/gram.c: fixed transfer methods on structs, broke it
last commit.
-Thu May 6 14:38:02 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * dir.c (rb_push_glob): simplified code (not change behavior)
-
-Thu May 6 13:32:44 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/extmk.rb: get rid of side effect of Config.expand, patched by
- <tttt01@infoseek.jp> (ruby-bugs:PR#597)
-
Thu May 6 11:40:28 2004 Shugo Maeda <shugo@ruby-lang.org>
* lib/net/imap.rb (string): accept NIL.
@@ -59553,13 +17446,16 @@ Thu May 6 01:59:04 2004 Dave Thomas <dave@pragprog.com>
Don't include the &block parameter if we have explicit
yield parameters.
-Wed May 5 03:52:31 2004 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+Wed May 5 03:40:29 2004 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
* lib/rinda/ring.rb: use recv instead of recvfrom.
-Wed May 5 00:38:00 2004 Gavin Sinclair <gsinclair@soyabean.com.au>
+Tue May 4 23:52:00 2004 Gavin Sinclair <gsinclair@soyabean.com.au>
* lib/gserver.rb: documented
+
+Tue May 4 23:46:00 2004 Gavin Sinclair <gsinclair@soyabean.com.au>
+
* lib/xmlrpc/README.txt: introduced for documentation purposes
Mon May 3 09:47:24 2004 Dave Thomas <dave@pragprog.com>
@@ -59567,10 +17463,6 @@ Mon May 3 09:47:24 2004 Dave Thomas <dave@pragprog.com>
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_method_or_yield_parameters):
Fix parsing bug if yield called within 1 line block
-Sun May 2 21:56:48 2004 Minero Aoki <aamine@loveruby.net>
-
- * test/fileutils/test_fileutils.rb (rm_f, rm_r): test :force flag.
-
Sun May 2 01:04:38 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tcltklib, ext/tk: renewal Ruby/Tk
@@ -59579,26 +17471,11 @@ Fri Apr 30 20:08:41 2004 WATANABE Hirofumi <eban@ruby-lang.org>
* time.c (SIZEOF_TIME_T): support SIZEOF_TIME_T == SIZEOF_INT.
-Wed Apr 28 01:26:11 2004 Kazuo Saito <ksaito@uranus.dti.ne.jp>
+Tue Apr 27 13:12:42 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
- * oniguruma.h, regparse.c: imported Oni Guruma 2.2.8.
+ * eval.c (rb_eval): too many line trace call. (ruby-bugs PR#1320)
-Wed Apr 28 01:16:23 2004 Kazuo Saito <ksaito@uranus.dti.ne.jp>
-
- * oniguruma.h, regparse.c: imported Oni Guruma 2.2.7.
-
-Tue Apr 27 14:43:32 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * common.mk: LIBURUBY_A is needed for extconf.rb even when
- cross-compiling.
-
-Tue Apr 27 13:33:50 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * parse.y (string_content): turn off NODE_NEWLINE flag to avoid
- unnecessary line trace for inlined expression.
- (ruby-bugs PR#1320)
-
-Tue Apr 27 08:15:13 2004 why the lucky stiff <why@ruby-lang.org>
+Tue Apr 27 08:41:28 2004 why the lucky stiff <why@ruby-lang.org>
* lib/yaml/rubytypes.rb: passing Range tests.
@@ -59626,33 +17503,32 @@ Mon Apr 26 21:40:09 2004 Dave Thomas <dave@pragprog.com>
* lib/rdoc/code_objects.rb (RDoc::Context::add_alias): Only alias
to instance methods.
-Sun Apr 25 18:26:23 2004 WATANABE Hirofumi <eban@ruby-lang.org>
-
- * configure.in (ac_cv_func_fork): set to no on DJGPP.
-
-Sat Apr 24 14:32:03 2004 Kazuo Saito <ksaito@uranus.dti.ne.jp>
-
- * re.c: applied stack error handling patch. [ruby-dev:23431]
-
Sat Apr 24 10:38:31 2004 Dave Thomas <dave@pragprog.com>
* lib/rdoc/markup/simple_markup.rb (SM::SimpleMarkup::group_lines):
Fix bug where consecutive headings are merged.
-Fri Apr 23 23:24:47 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Apr 23 23:26:13 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/mkmf.rb: $hdrdir should not contain macros, for backward
+ * lib/mkmf.rb: $hdrdir should not contain macros for backward
compatibility. [bruby-dev:28]
- * lib/mkmf.rb (create_makefile): in the case of extout, just copy
- script files, without comparison.
+ * version.c (ruby_show_copyright): obtain copyright year from
+ RUBY_RELEASE_YEAR.
+
+ * win32/resource.rb: ditto.
+
+ * win32/resource.rb: default rubyw icon to ruby.ico, and let DLL also
+ include them.
+
+ * win32/resource.rb: include winver.h for older WindowsCE.
Fri Apr 23 16:38:46 2004 Tanaka Akira <akr@m17n.org>
* lib/pathname.rb: sync taint/freeze flag between
a pathname object and its internal string object.
-Fri Apr 23 14:52:14 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Apr 23 14:52:08 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
* parse.y (stmt, arg, aref_args): should not make sole splat into
array, in aref_args other than aref with op_asgn.
@@ -59662,18 +17538,7 @@ Fri Apr 23 14:14:38 2004 Tanaka Akira <akr@m17n.org>
* lib/resolv.rb: don't use Regexp#source to embed regexps.
[ruby-dev:23432]
-Thu Apr 22 18:25:10 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * common.mk, ext/extmk.rb: make ext and .ext get removed by distclean.
-
-Thu Apr 22 10:07:01 2004 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * */Makefile.sub (distclean-local): should remove $(RBCONFIG).
-
-Thu Apr 22 04:17:57 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval.c (rb_mod_define_method): allow binding methods to modules.
- [ruby-dev:23410]
+Thu Apr 22 04:15:36 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
* parse.y (aref_args): should pass expanded list. [ruby-core:02793]
@@ -59685,7 +17550,7 @@ Thu Apr 22 01:12:57 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
* string.c (rb_str_index_m): use unsigned comparison for T_FIXNUM
search. [ruby-talk:97342]
-Wed Apr 21 23:04:42 2004 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+Wed Apr 21 22:57:27 2004 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
* lib/rinda/rinda.rb, test/rinda/test_rinda.rb: check Hash tuple size.
@@ -59694,44 +17559,6 @@ Wed Apr 21 20:05:00 2004 Tanaka Akira <akr@m17n.org>
* lib/open-uri.rb (URI::HTTP#proxy_open): set Host: field explicitly.
[ruby-list:39542]
-Wed Apr 21 18:39:46 2004 Minero Aoki <aamine@loveruby.net>
-
- * lib/net/smtp.rb: merge SMTP-TLS patch. This patch is
- contributed by Daniel Hob. [ruby-core:02789]
-
-Wed Apr 21 18:23:45 2004 Minero Aoki <aamine@loveruby.net>
-
- * lib/net/smtp.rb: change coding style: def m( a ) -> def m(a).
-
-Wed Apr 21 18:01:47 2004 Minero Aoki <aamine@loveruby.net>
-
- * lib/net/pop.rb: do not use class variables.
-
- * lib/net/pop.rb (do_start): ensure to clean up connection when
- authentication failed.
-
-Wed Apr 21 17:23:59 2004 Minero Aoki <aamine@loveruby.net>
-
- * lib/net/http.rb (HTTP#connect): CONNECT must precede SSL connect.
- [ruby-dev:23379]
-
- * lib/net/http.rb (HTTP.new): class variables are not inherited
- now.
-
-Wed Apr 21 15:56:43 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/test/unit/ui/console/testrunner.rb (test_started): restore $0
- after changing process title. [ruby-talk:97426]
-
-Wed Apr 21 10:18:06 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * process.c(rb_spawn): fix SEGV at "p system('command line here')"
- (may happen only in bccwin32) [ruby-dev:23380]
-
-Mon Apr 19 20:58:44 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * dir.c: Updated RDocs.
-
Mon Apr 19 18:11:15 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
* hash.c (rb_hash_equal): returns true if two hashes have same set
@@ -59740,132 +17567,107 @@ Mon Apr 19 18:11:15 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
* hash.c (rb_hash_eql): returns true if two hashes are equal and
have same default values.
-Mon Apr 19 08:19:11 2004 Doug Kearns <djkea2@mugca.its.monash.edu.au>
+Mon Apr 19 08:19:58 2004 Doug Kearns <djkea2@mugca.its.monash.edu.au>
- * dln.c, io.c, pack.c, lib/benchmark.rb, lib/cgi.rb, lib/csv.rb,
- lib/date.rb, lib/ftools.rb, lib/getoptlong.rb, lib/logger.rb,
- lib/matrix.rb, lib/monitor.rb, lib/set.rb, lib/thwait.rb,
- lib/timeout.rb, lib/yaml.rb, lib/drb/drb.rb, lib/irb/workspace.rb,
- lib/net/ftp.rb, lib/net/http.rb, lib/net/imap.rb, lib/net/pop.rb,
- lib/net/telnet.rb, lib/racc/parser.rb, lib/rinda/rinda.rb,
- lib/rinda/tuplespace.rb, lib/shell/command-processor.rb,
- lib/soap/rpc/soaplet.rb, lib/test/unit/testcase.rb,
- lib/test/unit/testsuite.rb: typo fix.
+ * dln.c, io.c, lib/benchmark.rb, lib/cgi.rb, lib/csv.rb, lib/date.rb,
+ lib/ftools.rb, lib/getoptlong.rb, lib/logger.rb, lib/matrix.rb,
+ lib/monitor.rb, lib/set.rb, lib/thwait.rb, lib/timeout.rb,
+ lib/yaml.rb, lib/drb/drb.rb, lib/irb/workspace.rb, lib/net/ftp.rb,
+ lib/net/http.rb, lib/net/imap.rb, lib/net/telnet.rb,
+ lib/racc/parser.rb, lib/rinda/rinda.rb, lib/rinda/tuplespace.rb,
+ lib/shell/command-processor.rb, lib/soap/rpc/soaplet.rb,
+ lib/test/unit/testcase.rb, lib/test/unit/testsuite.rb: typo fix.
Mon Apr 19 08:14:18 2004 Dave Thomas <dave@pragprog.com>
* lib/rdoc/parsers/parse_c.rb (RDoc::C_Parser::find_body): Allow for
#ifdef HAVE_PROTOTYPES
+Fri Apr 16 22:33:00 2004 Gavin Sinclair <gsinclair@soyabean.com.au>
+
+ * ext/iconv/iconv.c: nearly finished RDoc comments.
+
Fri Apr 16 17:04:07 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
* string.c (rb_str_equal): always returns true or false, never
returns nil. [ruby-dev:23404]
-Fri Apr 16 12:38:48 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/drb/drb.rb (DRb::DRbUnknown::initialize): Exception#to_str is
- deprecated.
-
- * lib/drb/drb.rb (DRb::DRbServer::InvokeMethod::perform): multiple
- value class changed.
-
- * lib/drb/invokemethod.rb (DRb::DRbServer::InvokeMethod18Mixin::block_yield):
- ditto.
-
-Fri Apr 16 08:27:08 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Apr 16 08:27:02 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ext/extmk.rb: skip linking when libraries to be preloaded not
compiled. [ruby-list:39561]
-Thu Apr 15 19:57:11 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Apr 15 23:21:52 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
* process.c (pst_success_p): new method Process::Status#success?.
[ruby-dev:23385]
- * rubytest.rb: do nothing while cross-compiling, return status in
- system independent style.
-
-Thu Apr 15 19:26:54 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * dir.c (rb_push_glob): Dir.glob() should return nil if block is given.
- (http://www.ruby-lang.org/ja/man/index.cgi?cmd=view;name=Dir)
-
- * dir.c (push_braces): Dir.glob() should handle '{ }' nested more than
- 3 times.
-
- * dir.c (push_braces, rb_push_glob): Dir.glob() should handle escaped
- '{' and '}' and ','.
-
- [ruby-dev:23376]
-
Thu Apr 15 17:12:13 2004 Tanaka Akira <akr@m17n.org>
* ext/gdbm/gdbm.c (Init_gdbm): define GDBM::READER, GDBM::WRITER,
GDBM::WRCREAT and GDBM::NEWDB.
(fgdbm_initialize): use specified read/write flag.
-Wed Apr 14 13:06:09 2004 Doug Kearns <djkea2@mugca.its.monash.edu.au>
-
- * array.c, enum.c, eval.c, file.c, io.c, numeric.c, object.c, prec.c,
- process.c, re.c, string.c: typos in RDoc comments. [ruby-core:02783]
-
Wed Apr 14 11:29:56 2004 WATANABE Hirofumi <eban@ruby-lang.org>
* numeric.c (flo_eq): workaround for bcc32's bug.
(ruby-bugs-ja:PR#594)
+Wed Apr 14 13:06:35 2004 Doug Kearns <djkea2@mugca.its.monash.edu.au>
+
+ * array.c, enum.c, eval.c, file.c, io.c, numeric.c, object.c, prec.c,
+ process.c, re.c, string.c: typos in RDoc comments. [ruby-core:02783]
+
Wed Apr 14 11:06:38 2004 Dave Thomas <dave@pragprog.com>
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::scan): Changed
behavior of :enddoc: -- it now unconditionally terminates
processing of the current file.
-Wed Apr 14 10:57:40 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Wed Apr 14 11:03:22 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* defines.h: include <net/socket.h> to get fd_set definition in BeOS.
-Tue Apr 13 23:00:55 2004 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+Tue Apr 13 23:06:30 2004 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
* lib/rinda/rinda.rb: change pattern matching.
a === b -> a == b || a === b. [druby-ja:98]
* test/rinda/test_rinda.rb: ditto.
-Tue Apr 13 21:50:57 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Apr 13 19:54:29 2004 Minero Aoki <aamine@loveruby.net>
- * bcc32/Makefile.sub (PHONY): Borland make disallows empty command
- rules.
+ * lib/net/http.rb: should not overwrite HTTP request header.
+ [ruby-list:39543]
-Tue Apr 13 17:55:16 2004 Minero Aoki <aamine@loveruby.net>
+Tue Apr 13 01:30:00 2004 Gavin Sinclair <gsinclair@soyabean.com.au>
- * lib/net/http.rb (begin_transport): should not overwrite HTTP
- request header. [ruby-list:39543]
+ * ext/iconv/iconv.c: RDoc documentation (from RD; nearly finished).
+ * ext/iconv/charset_alias.rb: Prevent from RDoc'ing.
-Tue Apr 13 16:48:00 2004 Minero Aoki <aamine@loveruby.net>
+Mon Apr 12 19:11:29 2004 Eric Hodel <drbrain@segment7.net>
- * lib/net/pop.rb: merge POP3S patch. This patch is contributed by
- Daniel Hobe.
+ * gc.c (rb_gc_copy_finalizer): typo. [ruby-core:02774]
-Tue Apr 13 02:56:29 2004 Kazuo Saito <ksaito@uranus.dti.ne.jp>
+Mon Apr 12 18:52:32 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
- * common.mk: changed the order of ascii.c alphabetically.
+ * ext/openssl/ossl_x509name.c (ossl_x509name_init_i): should return
+ a value.
-Mon Apr 12 19:11:21 2004 Eric Hodel <drbrain@segment7.net>
+Mon Apr 12 10:43:47 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
- * gc.c (rb_gc_copy_finalizer): typo. [ruby-core:02774]
+ * dir.c (rb_glob2, rb_glob, rb_globi, push_globs, push_braces,
+ rb_push_glob): fix memory leak. (leaked when block was interrupted)
-Mon Apr 12 18:45:58 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Mon Apr 12 10:27:37 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
- * ext/openssl/ossl_x509name.c (ossl_x509name_init_i): should return
- a value.
+ * bcc32/Makefile.sub: backport SIZEOF_TIME_T definition from 1.9.
-Mon Apr 12 10:39:50 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+ * win32/Makefile.sub: ditto.
- * dir.c (rb_glob2, rb_glob, push_globs, push_braces, rb_push_glob):
- fix memory leak. (leaked when block was interrupted)
+ * wince/Makefile.sub: ditto.
-Sun Apr 11 19:10:13 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun Apr 11 19:12:35 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ruby.c (require_libraries): restore source file/line after
statically linked extensions initialized. [ruby-dev:23357]
@@ -59886,73 +17688,7 @@ Sat Apr 10 00:00:19 2004 Dave Thomas <dave@pragprog.com>
* lib/rdoc/markup/simple_markup/inline.rb: Fix problem
with \_cat_<b>dog</b>
-Fri Apr 9 17:05:21 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * dir.c (has_magic, find_dirsep): incomplete '[' matches no character
- in Dir.glob. (follows File.fnmatch's behavior)
-
- * dir.c (fnmatch_helper): incomplete escape is ignored in File.fnmatch.
- (follows Dir.glob's behavior)
-
- * dir.c (find_dirsep): '/' between '[' and ']' is ignored in Dir.glob.
- (follows File.fnmatch with File::FNM_PATHNAME 's behavior)
-
- * dir.c (find_dirsep): escaped slash '\/' loses its meaning as
- directory separator in Dir.glob.
-
- [ruby-dev:23291]
-
-Thu Apr 8 20:25:19 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/extmk.rb (extmake): skip uncompiled extensions.
-
- * lib/mkmf.rb (create_makefile): emit no rules for static library if
- $static is nil, e.g., outside of ext/.
-
- * lib/test/unit/ui/console/testrunner.rb (test_started): show test
- name via $0.
-
- * runruby.rb: set environments to use the compiled binary.
-
- * test/runner.rb: do nothing while cross-compiling.
-
- * test/drb/drbtest.rb, test/soap/calc/test_calc_cgi.rb: use envutil to
- know ruby binary, and restore $: after require.
-
- * test/ruby/envutil.rb: give priority to RUBY environment variable to
- use just compiled binary and libraries.
-
-Thu Apr 8 19:03:33 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * io.c (rb_io_binmode): inverted condition. [ruby-dev:23349]
-
-Thu Apr 8 18:22:00 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/iconv/iconv.c (iconv_s_list): return encoding list if no block
- is given. [ruby-dev:23063]
-
-Wed Apr 7 15:29:24 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * pack.c (pack_pack): use NUM2INT() instead of num2i32().
-
-Wed Apr 7 12:32:02 2004 Kouhei Sutou <kou@cozmixng.org>
-
- * lib/rss/parser.rb, lib/rss/1.0.rb: accepted rdf:resource or
- resource attribute in rdf:li.
- * test/rss/test_parser.rb: added test for above change.
-
- * lib/rss/dublincore.rb: reverted style.
-
- * lib/rss/xmlparser.rb: normalized XMLParser class hierarchy.
-
-Wed Apr 7 10:43:17 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * Makefile.in, common.mk, */Makefile.sub (ext/extinit.o): OUTFLAG
- doesn't work for object files on VC.
-
- * */Makefile.sub (config.h): need SIZEOF_TIME_T now.
-
-Wed Apr 7 00:24:34 2004 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+Wed Apr 7 00:19:50 2004 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
* lib/rinda/rinda.rb: fix hash tuple bug.
@@ -59962,12 +17698,6 @@ Wed Apr 7 00:24:34 2004 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
Tue Apr 6 18:24:18 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
- * file.c (rb_get_path): get path string via "to_path" method if
- path object is not a string. [Ruby2]
-
- * gc.c (rb_gc_call_finalizer_at_exit): do not free threads in the
- exit finalizers.
-
* io.c (rb_io_reopen): should use rb_io_check_io().
Tue Apr 6 16:46:09 2004 Tanaka Akira <akr@m17n.org>
@@ -59978,82 +17708,49 @@ Tue Apr 6 16:46:09 2004 Tanaka Akira <akr@m17n.org>
(time_plus): use time_add.
(time_minus): use time_add.
-Tue Apr 6 13:11:48 2004 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * ext/socket/socket.c (raise_socket_error): never return.
+Tue Apr 6 13:21:30 2004 NAKAMURA Usaku <usa@ruby-lang.org>
* ext/socket/socket.c (make_hostent): must return value.
-Tue Apr 6 00:14:43 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * error.c (Init_Exception): remove Exception#to_str. [Ruby2]
-
- * eval.c (error_print): should no call "to_str" anymore use
- "message" method instead.
-
- * io.c (rb_f_open): Kernel#open() calls "to_open" if the first
- argument responds to it. [Ruby2]
-
-Tue Apr 6 00:13:43 2004 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+Tue Apr 6 00:05:30 2004 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
* lib/rinda/rinda.rb: add require 'drb/drb'
-Mon Apr 5 22:25:32 2004 Tanaka Akira <akr@m17n.org>
-
- * test/zlib/test_zlib.rb: new file.
- (TestZlibGzipWriter#test_new_nil): test for [ruby-dev:23228].
-
-Mon Apr 5 22:16:23 2004 Minero Aoki <aamine@loveruby.net>
-
- * parse.y (assoc_list): {a: 1, b: 2} should be allowed.
- [ruby-dev:23328]
-
-Mon Apr 5 19:43:40 2004 Kazuo Saito <ksaito@uranus.dti.ne.jp>
-
- * regexec.c: imported Oni Guruma 2.2.6.
-
-Mon Apr 5 19:39:10 2004 Kazuo Saito <ksaito@uranus.dti.ne.jp>
+Mon Apr 5 08:18:23 2004 Dave Thomas <dave@pragprog.com>
- * regparse.c, oniguruma.h: imported Oni Guruma 2.2.6.
+ * lib/rdoc/rdoc.rb: Remove leading ./ from file names so that cross
+ references work properly.
-Mon Apr 5 12:12:09 2004 NAKAMURA Usaku <usa@ruby-lang.org>
+Sun Apr 4 20:33:42 2004 Minero Aoki <aamine@loveruby.net>
- * ext/socket/socket.c (raise_socket_error): some platforms don't have
- EAI_SYSTEM.
+ * eval.c (Init_load): make $LOADED_FEATURES built-in.
+ [ruby-dev:23299]
-Mon Apr 5 08:18:23 2004 Dave Thomas <dave@pragprog.com>
+ * ruby.c (ruby_prog_init): make $PROGRAM_NAME built-in.
- * lib/rdoc/rdoc.rb: Remove leading ./ from file names so that cross
- references work properly.
+ * lib/English.rb: remove $LOADED_FEATURES and $PROGRAM_NAME.
Sun Apr 4 14:01:20 2004 Dave Thomas <dave@pragprog.com>
- * lib/rdoc/options.rb (Options::parse): Allow multiple -x options to
- RDoc. Fix bug where files weren't being excluded properly
+ * lib/rdoc/options.rb (Options::parse): Allow multiple -x options to RDoc.
+ Fix bug where files weren't being excluded properly
-Sat Apr 3 09:36:38 2004 why the lucky stiff <why@ruby-lang.org>
+Sat Apr 3 17:11:05 2004 why the lucky stiff <why@ruby-lang.org>
* ext/syck/syck.h: version 0.43.
-Sat Apr 3 08:28:47 2004 why the lucky stiff <why@ruby-lang.org>
-
* ext/syck/lib/gram.c: allow root-level inline collections.
- [ruby-talk:94922]
+ [ruby-talk:94922]
* lib/yaml/rubytypes.rb (Symbol#to_yaml): emit symbols as implicits.
- [ruby-talk:94930]
+ [ruby-talk:94930]
-Fri Apr 2 19:28:48 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * bcc32/Makefile.sub (OUTFLAG): needed for static-linked-ext.
-
-Fri Apr 2 18:00:05 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/syck/bytecode.c: turn off default implicit typing.
- * ext/extmk.rb (extmake): extract necessary variables for static link
- from Makefile.
+ * ext/syck/implicit.c: detect base60 integers.
- * lib/mkmf.rb (create_makefile): save preload and libpath for next
- compile.
+ * ext/syck/rubyext.c: handle base60, as well as hex and octal
+ with commas. implicit typing of ruby symbols.
Fri Apr 2 17:27:17 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
@@ -60072,20 +17769,8 @@ Fri Apr 2 14:35:26 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
* eval.c (block_pass): should generate unique identifier of the
pushing block. [ruby-talk:96363]
-Fri Apr 2 11:36:20 2004 Minero Aoki <aamine@loveruby.net>
-
- * eval.c (Init_load): make $LOADED_FEATURES built-in.
- [ruby-dev:23299]
-
- * ruby.c (ruby_prog_init): make $PROGRAM_NAME built-in.
-
- * lib/English.rb: remove $LOADED_FEATURES and $PROGRAM_NAME.
-
Fri Apr 2 07:31:38 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
- * ext/socket/socket.c: mistakingly removed do_not_reverse_lookup.
- [ruby-list:39475]
-
* ext/socket/socket.c (make_hostent): fix memory leak, based on
the patch from HORIKAWA Hisashi <vzw00011@nifty.ne.jp>.
@@ -60110,6 +17795,14 @@ Thu Apr 1 19:58:37 2004 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
be empty). Instance of URI have instance_variables but it must be
llowed whenever original mapping is allowed or not.
+ * lib/xsd/datatypes.rb: check the smallest positive non-zero
+ single-precision float exactly instead of packing with "f".
+ [ruby-talk:88822]
+
+ * lib/soap/mapping/rubytypeFactory.rb: should not dump singleton class.
+ [ruby-dev:22588]
+ c = class << Object.new; class C; self; end; end; SOAPMarshal.dump(c)
+
Wed Mar 31 19:06:23 2004 Tanaka Akira <akr@m17n.org>
* time.c (year_leap_p): new function.
@@ -60117,7 +17810,7 @@ Wed Mar 31 19:06:23 2004 Tanaka Akira <akr@m17n.org>
(search_time_t): use timegm_noleapsecond instead of
mktime for first guess.
-Wed Mar 31 12:05:17 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Mar 31 12:04:04 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/delegate.rb (DelegateClass): define internal methods of the
result class, but not metaclass of the caller. [ruby-talk:96156]
@@ -60126,44 +17819,12 @@ Wed Mar 31 12:05:17 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ruby.h: missing.h is now prerequisite to intern.h.
-Wed Mar 31 11:17:16 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * pack.c (pack_pack): raises RangeError if uv is out of UTF8 value
- range. [ruby-dev:23281]
-
- * io.c (rb_io_binmode): stdio buffer should be empty when calling
- IO#binmode. [ruby-talk:96155]
-
Tue Mar 30 20:25:34 2004 Tanaka Akira <akr@m17n.org>
* time.c (search_time_t): limit guess range by mktime if it is
available. [ruby-dev:23274]
-Tue Mar 30 18:19:00 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval.c (rb_eval): fix SEGV at retry in iterator's receiver.
- [ruby-dev:23227]
-
-Mon Mar 29 20:17:16 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * process.c (rb_exec): follow older behavior if close-on-exec is not
- available.
-
- * process.c (rb_fork): protect from exceptions while waiting failed
- process, if status is given.
-
-Sun Mar 28 16:25:37 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * cygwin/GNUmakefile.in (clean-local, distclean-local): remove
- work files.
-
- * win32/Makefile.sub (clean-local): ditto.
-
-Sun Mar 28 14:23:02 2004 Minero Aoki <aamine@loveruby.net>
-
- * lib/net/pop.rb: def m( arg ) -> def m(arg).
-
-Sun Mar 28 14:09:13 2004 Minero Aoki <aamine@loveruby.net>
+Sun Mar 28 14:16:59 2004 Minero Aoki <aamine@loveruby.net>
* lib/net/pop.rb (auth): failed when account/password include "%".
[ruby-talk:95933]
@@ -60177,46 +17838,16 @@ Sat Mar 27 10:40:48 2004 Tanaka Akira <akr@m17n.org>
* (lib/pp.rb, lib/prettyprint.rb): define seplist in PP::PPMethods
instead of PrettyPrint.
-Sat Mar 27 01:47:09 2004 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
-
- * lib/logger.rb: trim tail space of each line. no user visible change.
-
- * lib/rss/dublincore.rb: fixed class definition mismatch.
+Thu Mar 25 23:28:52 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
- * sample/openssl/gen_csr.rb: fixed wrong usage text.
+ * time.c (time_overflow_p): backport 1.9 usec overflow function.
+ (ruby-bugs PR#1307)
Thu Mar 25 23:15:24 2004 Dave Thomas <dave@pragprog.com>
* lib/rdoc/ri/ri_options.rb (RI::Options::show_version):
Add --version option
-Thu Mar 25 21:45:00 2004 Shigeo Kobayashi <shigek@ruby-lang.org>
-
- * ext/bigdecimal/bigdecimal.c: Bug in + and - reported by Bret Jolly
- fixed.
-
-Thu Mar 25 21:01:32 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * version.c (ruby_show_copyright): obtain copyright year from
- RUBY_RELEASE_YEAR.
-
- * win32/resource.rb: ditto.
-
-Thu Mar 25 19:37:35 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * win32/resource.rb: default rubyw icon to ruby.ico, and let DLL also
- include them.
-
- * win32/resource.rb: include winver.h for older WindowsCE.
-
-Thu Mar 25 14:01:03 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * common.mk, */Makefile.sub (lib, dll): phony targets.
-
- * configure.in (ruby, miniruby): ditto.
-
- * cygwin/GNUmakefile.in (rubyw): ditto.
-
Thu Mar 25 04:16:18 2004 Dave Thomas <dave@pragprog.com>
* lib/rdoc/ri/ri_options.rb (RI::Options): Add the --list-names option,
@@ -60233,7 +17864,7 @@ Thu Mar 25 02:00:18 2004 Dave Thomas <dave@pragprog.com>
* lib/rdoc/generators/template/html/one_page_html.rb (Page):
Fix to work with C modules.
-Wed Mar 24 20:49:00 2004 Gavin Sinclair <gsinclair@soyabean.com.au>
+Wed Mar 24 21:17:00 2004 Gavin Sinclair <gsinclair@soyabean.com.au>
* lib/uri.rb: Documented (thanks Dmitry V. Sabanin).
* lib/uri/common.rb: Ditto.
@@ -60243,13 +17874,17 @@ Wed Mar 24 20:49:00 2004 Gavin Sinclair <gsinclair@soyabean.com.au>
* lib/uri/https.rb: Ditto.
* lib/uri/ldap.rb: Ditto.
* lib/uri/mailto.rb: Ditto.
+ (All backported from 1.9)
-Wed Mar 24 18:48:05 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Mar 24 18:48:26 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/mkmf.rb ($ruby, $topdir, $hdrdir): should not be affected by
DESTDIR after installed.
- * lib/mkmf.rb (dummy_makefile): default file lists to be cleaned.
+ * lib/mkmf.rb (RUBY): / is not recognized as path separator on
+ nmake/bmake. [ruby-list:39388]
+
+ * lib/mkmf.rb (init_mkmf): $INCFLAGS also should be lazy-evaluated.
Wed Mar 24 12:32:56 2004 Dave Thomas <dave@pragprog.com>
@@ -60266,86 +17901,18 @@ Wed Mar 24 11:11:26 2004 Dave Thomas <dave@pragprog.com>
* lib/rdoc/generators/html_generator.rb (Generators::HTMLGenerator::load_html_template):
Allow non-RDoc templates by putting a slash in the template name
-Wed Mar 24 10:05:22 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/tempfile.rb (Tempfile::_close): should not clear @tmpname
- until the file is really removed. [ruby-core:02684]
-
-Wed Mar 24 04:12:44 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * object.c (rb_mod_cvar_get): new method Module#class_variable_get.
-
- * object.c (rb_mod_cvar_set): ditto (Module#class_variable_set).
-
-Tue Mar 23 17:45:22 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (rb_thread_atfork): 1.9 warns no more for thread
- termination. [ruby-dev:23212]
-
-Tue Mar 23 14:46:10 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * Makefile.in, */Makefile.sub, common.mk (clean-local, distclean-local):
- separate files under directories due to directory separator.
-
- * */Makefile.sub (MKFILES): common.mk and */Makefile.sub should not be
- removed.
-
- * win32/Makefile.sub, wince/Makefile.sub: $* cannot appear in explicit
- rules.
-
- * cygwin/GNUmakefile.in: some mingw stuffs were missed.
-
- * lib/mkmf.rb (create_makefile): Borland make wrongly removes braces
- from command lines.
-
- * bcc32/Makefile.sub: needs bcc32/mkexports.rb.
-
-Mon Mar 22 08:21:17 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * Makefile.in, */Makefile.sub, common.mk: extract common portions.
-
- * Makefile.in, cygwin/GNUmakefile.in, */Makefile.sub (RBCONFIG):
- separated time stamp file for rbconfig.rb.
-
- * configure.in: append common.mk to Makefile.
+Mon Mar 22 16:19:57 2004 WATANABE Hirofumi <eban@ruby-lang.org>
- * mkconfig.rb: keep mtime of rbconfig.rb if unchanged.
-
- * win32/rm.bat: remove multiple files.
-
- * wince/mkconfig_wce.rb: use fake.rb instead.
-
-Sun Mar 21 22:17:35 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * lib/webrick/httpserver.rb (WEBrick::HTTPServer#virtual_host):
- sort @virtual_hosts in address, port, host order.
-
- * lib/webrick/httpserver.rb (WEBrick::HTTPServer#lookup_server):
- hostname should not be match if :ServerAlias is not given.
+ * ruby.1: add -width option to .Bl for old groff.
Sun Mar 21 21:11:16 2004 Keiju Ishitsuka <keiju@ishitsuka.com>
* lib/shell/*: bug fix for Shell#system(command_line_string).
-Sun Mar 21 21:04:42 2004 WATANABE Hirofumi <eban@ruby-lang.org>
-
- * ruby.1: add -width option to .Bl for old groff.
-
-Sun Mar 21 18:57:37 2004 Kouhei Sutou <kou@cozmixng.org>
-
- * test/rss/*: Test::Unit::TestCase -> RSS::TestCase and
- Test::Unit::Assertions -> RSS::Assertions.
-
-Sun Mar 21 18:48:20 2004 Kouhei Sutou <kou@cozmixng.org>
+Sat Mar 20 20:57:10 2004 David Black <dblack@wobblini.net>
- * lib/rss/{rss,dublincore,syndication}.rb: handled W3CDTF correctly.
-
-Sun Mar 21 18:15:29 2004 Kouhei Sutou <kou@cozmixng.org>
-
- * test/rss/test_xml-stylesheet.rb: added tests for xml-stylesheet.
-
- * lib/rss/xml-stylesheet.rb: added xml-stylesheet parsing
- function.
+ * lib/scanf.rb: Backported 1.9 branch
+ modifications/corrections to 1.8 branch
Sat Mar 20 23:51:03 2004 WATANABE Hirofumi <eban@ruby-lang.org>
@@ -60355,164 +17922,58 @@ Sat Mar 20 23:51:03 2004 WATANABE Hirofumi <eban@ruby-lang.org>
* eval.c (rb_f_raise): should not clear backtrace information if
exception object already have one.
-Sat Mar 20 21:21:03 2004 WATANABE Hirofumi <eban@ruby-lang.org>
-
- * ext/extmk.rb: rm -rf $extout, not extout.
-
Sat Mar 20 15:25:36 2004 Dave Thomas <dave@pragprog.com>
* lib/rdoc/generators/template/html/html.rb (RDoc::Page): Force
page background to white.
-Sat Mar 20 09:33:36 2004 Tadayoshi Funaba <tadf@dotrb.org>
+Sat Mar 20 09:52:33 2004 Tadayoshi Funaba <tadf@dotrb.org>
* lib/date.rb, lib/date/format.rb: _parse() now accepts fractional
part of second minute that follows a comma or a full stop.
-Fri Mar 19 21:06:21 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * parse.y (assoc_list): allow {sym: val} style Hash. [Ruby2]
- this change is done by Nobuyoshi Nakada <nobu@ruby-lang.org>.
-
-Fri Mar 19 15:15:15 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * variable.c (rb_cvar_set): class variables become private to the
- particular class/module. [Ruby2]
-
- * variable.c (rb_cvar_get): ditto.
-
- * variable.c (rb_cvar_defined): ditto.
-
-Fri Mar 19 11:31:32 2004 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * lib/mkmf.rb ($beos, $solaris): add OS flags.
-
- * lib/mkmf.rb (RUBY): / is not recognized as path separator on
- nmake/bmake. [ruby-list:39388]
-
- * lib/mkmf.rb (CLEANLIBS, CLEANOBJS): should remove *.exp with *.so.
-
Fri Mar 19 01:55:57 2004 Mauricio Fernandez <batsman.geo@yahoo.com>
* io.c (rb_io_sync): need not to check writable. [ruby-core:02674]
-Thu Mar 18 19:47:44 2004 WATANABE Hirofumi <eban@ruby-lang.org>
+Thu Mar 18 21:44:38 2004 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
- * instruby.rb, rubytest.rb: do not depend on srcdir.
+ * lib/drb/drb.rb: backport drb.rb 1.16.
-Thu Mar 18 18:50:06 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Mar 18 17:49:51 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
- * mkconfig.rb: no longer embed srcdir and compile_dir into
- rbconfig.rb.
-
- * ext/extmk.rb, lib/mkmf.rb: obtain top_srcdir and topdir from library
- paths.
+ * struct.c (make_struct): allow const_id for accessor names.
+ [ruby-core:04585]
-Thu Mar 18 17:46:35 2004 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
-
- * lib/drb/drb.rb: do not undef :to_a.
+ * eval.c (rb_attr): check if attribute name is local_id or
+ const_id.
Thu Mar 18 16:22:38 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
* eval.c (proc_eq): avoid false positive by using scope and
dyna_vars. no longer use frame.uniq.
- * eval.c (proc_arity): arity is now defined as number of
- parameters that would not be ignored. i.e. Proc.new{}.arity
- returns zero. update test suites too.
-
-Thu Mar 18 15:27:25 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c: remove specialized version of rb_Array(). use simple
- one defined in object.c.
-
- * object.c (Init_Object): remove Kernel#to_a.
-
- * enum.c (enum_zip): use "to_a" instead of "to_ary".
-
-Wed Mar 17 00:22:03 2004 Kazuo Saito <ksaito@uranus.dti.ne.jp>
-
- * oniguruma.h: imported Oniguruma 2.2.5.
- * regparse.c: ditto.
-
-Tue Mar 16 11:14:17 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * dir.c (fnmatch_helper): File.fnmatch('\.', '.') should return true.
- (Rev1.112 lost compatiblity)
-
- * dir.c (fnmatch_helper): File.fnmatch('\/', '/', File::FNM_PATHNAME)
- should return true. (Rev1.112 lost compatiblity)
-
- * dir.c (fnmatch): File.fnmatch('**/.boo', '.foo/.boo',
- File::FNM_PATHNAME) should return false because of leading period.
-
-Mon Mar 15 17:01:07 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+Wed Mar 17 14:44:43 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
- * error.c (exc_initialize): calling 'to_str' each time just for
- type checking is too heavy. [ruby-core:02661]
-
-Mon Mar 15 10:14:51 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * ext/openssl/lib/openssl/ssl.rb (OpenSSL::SSL::SocketForwarder):
- add do_not_reverse_lookup.
+ * dir.c (range): fix possible "\0" overrun. (in case of "\0-")
Mon Mar 15 07:39:13 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
* eval.c (rb_yield_0): should not re-submit TAG_BREAK if this
yield is not break destination. [ruby-dev:23197]
-Sun Mar 14 22:07:38 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval.c (rb_thread_raise): err at unstarted thread. (PR#1302)
-
-Sat Mar 13 14:56:32 2004 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
-
- * test/drb/ut_drb.rb: use 'druby://localhost:0'. [ruby-dev:23078]
-
- * test/drb/ut_eval.rb: ditto.
-
- * test/drb/ut_large.rb: ditto.
-
- * test/drb/ut_safe1.rb: ditto.
-
- * test/drb/ut_drb_drbssl.rb: use 'drbssl://localhost:0'.
-
-Fri Mar 12 23:52:56 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * dir.c (fnmatch): directory recursion '**/' can be used with
- File::FNM_PATHNAME. [ruby-dev:22901]
-
- * dir.c (fnmatch, fnmatch_helper): only '/' is accepted as path
- separator even in DOSISH environment. [ruby-dev:22974]
- [ruby-list:39337]
-
- * dir.c (fnmatch_helper): faster '*' matching.
-
-Fri Mar 12 20:19:16 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in (rb_cv_noreturn): default for platforms not support
- prototypes.
-
- * ruby.c (ruby_init_loadpath): buffer for path name should have
- MAXPATHLEN.
+Sat Mar 13 14:28:16 2004 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
- * lib/mkmf.rb (configuration): include topdir and hdrdir in VPATH.
+ * test/drb/test_drbssl.rb: rescue LoadError. (Barkport from main
+ trunk)
- * lib/mkmf.rb (create_makefile): default dependency rule.
-
-Fri Mar 12 07:35:36 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * lib/webrick/config.rb (WEBrick::Config::General): add
- :DoNotReverseLookup.
-
- * lib/webrick/server.rb (WEBrick::GenericServer#accept): call
- do_not_reverse_lookup for each socket if :DoNotReverseLookup
- is set. [ruby-code:02357]
+ * test/drb/test_drbunix.rb: ditto.
-Wed Mar 10 22:26:25 2004 Minero Aoki <aamine@loveruby.net>
+Wed Mar 10 22:28:09 2004 Minero Aoki <aamine@loveruby.net>
* lib/fileutils.rb (remove_dir): should handle symlink correctly.
This patch is contributed by Christian Loew. [ruby-talk:94635]
+ (Backport from main trunk)
Wed Mar 10 16:28:42 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
@@ -60523,337 +17984,54 @@ Wed Mar 10 16:28:42 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
* eval.c (rb_yield_0): set exit_value for block break.
-Wed Mar 10 16:00:14 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * struct.c (rb_struct_s_def): Struct::new executes block with
- generated struct class. [ruby-talk:02606]
-
Wed Mar 10 15:58:43 2004 Ryan Davis <ryand@zenspider.com>
* eval.c (eval): Only print backtrace if generating the backtrace
doesn't generate an exception. [ruby-core:02621]
-Wed Mar 10 10:15:16 2004 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * ruby.c (opt_W_getter): get rid of warning.
-
- * bcc32/Makefile.sub, win32/Makefile.sub, wince/Makefile.sub:
- fixed dependency.
-
Tue Mar 9 13:04:26 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
* io.c (rb_io_ungetc): raise IOError instead of calling
rb_sys_fail(). [ruby-talk:23181]
-Tue Mar 9 10:03:40 2004 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * bcc32/Makefile.sub, win32/Makefile.sub, wince/Makefile.sub:
- replaced regex.c entry with Oniguruma files.
-
-Tue Mar 9 01:09:46 2004 Kazuo Saito <ksaito@uranus.dti.ne.jp>
-
- * Makefile.in: replaced regex.c entry with Oniguruma files.
-
-Mon Mar 8 23:16:07 2004 Minero Aoki <aamine@loveruby.net>
-
- * lib/net/http.rb: HTTPHeader did not initialized correctly.
-
- * lib/net/http.rb (connect): does same debug output.
-
-Mon Mar 8 21:38:18 2004 Minero Aoki <aamine@loveruby.net>
-
- * lib/net/http.rb (add_header): remove warning. [ruby-dev:23170]
-
-Mon Mar 8 21:09:39 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * dir.c (range): Cancel change for incomplete '['. More discussion
- is needed.
-
-Mon Mar 8 19:35:13 2004 akira yamada <akira@arika.org>
+Mon Mar 8 19:32:28 2004 akira yamada <akira@ruby-lang.org>
* lib/uri/common.rb (URI::REGEXP::PATTERN::HOSTPORT): (?:#{PORT})
-> (?::#{PORT}). [ruby-dev:23170]
-Mon Mar 8 15:03:24 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Mon Mar 8 15:31:41 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* dir.c (range): treat incomplete '[' as ordinary character (like
- has_magic does). fix buffer overrun at incomplete escape like '[\'.
+ has_magic does).
-Mon Mar 8 13:35:32 2004 WATANABE Hirofumi <eban@ruby-lang.org>
+ * dir.c (range): Cancel above change. More discussion is needed.
- * regparse.c (parse_exp): need to separate initialization for bcc32.
- [ruby-dev:23169]
+Sun Mar 7 22:37:46 2004 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
- * oniguruma.h (ONIG_EXTERN): check __GNUC__ instead of __CYGWIN__.
-
-Mon Mar 8 01:05:55 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * lib/webrick/config.rb (WEBrick::Config::HTTP): rename :RequestHander
- to :RequestCallback and add new option :ServerAlias.
+ * test/drb/ut_drb.rb: use 'druby://localhost:0'. [ruby-dev:23078]
- * lib/webrick/httpserver.rb (WEBrick::HTTPServer#run): use
- :RequestCallback and warn if :RequestHandler is in server's option.
+ * test/drb/ut_eval.rb: ditto.
- * lib/webrick/httpserver.rb (WEBrick::HTTPServer#run): should print
- error message for WEBrick::HTTPSataus::Error.
+ * test/drb/ut_large.rb: ditto.
- * lib/webrick/httpserver.rb (WEBrick::HTTPServer#lookup_server):
- lookup for hostname from :ServerAlias if the req.host is not match
- to :ServerName.
+ * test/drb/ut_safe1.rb: ditto.
- * lib/webrick/httpservlet.rb (WEBrick::HTTPServlet::CGIHandler#do_GET):
- use $?.exitstatus and refine log message.
+ * test/drb/ut_drb_drbssl.rb: use 'drbssl://localhost:0'.
Sun Mar 7 16:22:26 2004 WATANABE Hirofumi <eban@ruby-lang.org>
* Makefile.in (lex.c): use $? instead of $<.
- * lib/pstore.rb (commit_new): use FileUtils.copy_stream for Cygwin.
- [ruby-dev:23157]
-
-Sun Mar 7 05:34:42 2004 Minero Aoki <aamine@loveruby.net>
-
- * lib/net/http.rb: HTTPHeader keeps its header fields as an array.
-
- * lib/net/http.rb: new method HTTPHeader#add_header, get_fields.
-
- * lib/net/http.rb: new method HTTPHeader#content_length=.
-
- * lib/net/http.rb: new method HTTPHeader#content_type, main_type,
- sub_type, type_params, content_type=, set_content_type.
-
- * lib/net/http.rb (HTTPHeader#basic_encode): result of pack(m) may
- contain multiple LFs.
-
-Sun Mar 7 03:11:00 2004 Minero Aoki <aamine@loveruby.net>
-
- * lib/net/http.rb: new method Net::HTTPRequest#body(=).
-
- * lib/net/http.rb: new method Net::HTTPRequest#body_stream(=).
-
-Sun Mar 7 02:06:07 2004 Minero Aoki <aamine@loveruby.net>
-
- * lib/net/http.rb: spin off https code again.
-
- * lib/net/https.rb: new file.
-
- * ext/openssl/lib/net/https.rb: removed. moved to net/https with
- slight modifications.
-
- * ext/openssl/lib/net/protocols.rb: removed. merged with net/http.
-
- * lib/net/protocol.rb: new class BufferedIO.
-
- * lib/net/protocol.rb: InternetMessageIO < BufferedIO.
-
- * lib/net/protocol.rb: BufferedIO.new takes an IO.
-
- * lib/net/smtp.rb: follow InternetMessageIO's change.
-
- * lib/net/pop.rb: ditto.
-
-Sun Mar 7 00:55:03 2004 Minero Aoki <aamine@loveruby.net>
-
- * lib/net/protocol.rb: remove method: InternetMessageIO#address,
- port, ip_address, read_timeout(=), socket.
-
- * lib/net/protocol.rb: simplify code.
-
- * lib/net/protocol.rb: apply latest coding style.
-
-Sat Mar 6 15:15:05 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/strscan/depend: depends on re.h and regex.h.
-
- * ext/strscan/strscan.c: no version check needed.
-
- * ext/strscan/strscan.c (strscan_init_copy): struct re_registers must
- not be bitwise copied.
-
-Sat Mar 6 11:14:33 2004 David Black <dblack@wobblini.net>
-
- * lib/scanf.rb: refixed the previous fix in IO#block_scanf
+Fri Mar 5 00:54:14 2004 Dave Thomas <dave@pragprog.com>
-Sat Mar 6 10:49:40 2004 David Black <dblack@wobblini.net>
-
- * lib/scanf.rb: fixed a logic glitch in IO#block_scanf
-
-Sat Mar 6 02:00:19 2004 Minero Aoki <aamine@loveruby.net>
-
- * lib/net/http.rb: net/https is merged.
-
- * ext/openssl/lib/net/https.rb: ditto.
-
-Sat Mar 6 00:39:21 2004 Kazuo Saito <ksaito@uranus.dti.ne.jp>
-
- * oniggnu.h: imported from Oniguruma library.
- * oniguruma.h: ditto.
- * regcomp.c: ditto.
- * regenc.c: ditto.
- * regenc.h: ditto.
- * regerror.c: ditto.
- * regex.c: ditto.
- * regexec.c: ditto.
- * reggnu.c: ditto.
- * regint.h: ditto.
- * regparse.c: ditto.
- * regparse.h: ditto.
- * ascii.c: ditto.
- * euc_jp.c: ditto.
- * sjis.c: ditto.
- * utf8.c: ditto.
-
- * MANIFEST: added Oniguruma files listed above.
-
- * LEGAL: added Oniguruma license.
-
- * regex.h: now includes oniggnu.h.
-
- * re.c: applied Oniguruma patch.
-
-Fri Mar 5 23:13:08 2004 Minero Aoki <aamine@loveruby.net>
-
- * lib/net/http.rb: support WebDAV methods, PROPPATCH, LOCK,
- UNLOCK, OPTIONS, PROPFIND, DELETE, MOVE, COPY, MKCOL.
- This patch is contributed by Tatsuki Sugiura.
-
-Fri Mar 5 20:58:37 2004 Minero Aoki <aamine@loveruby.net>
-
- * lib/net/http.rb: Net::HTTPResponse#response is obsolete.
- [ruby-core:02592]
-
- * lib/net/http.rb: Net::HTTPResponse#header is obsolete.
-
- * lib/net/http.rb: Net::HTTPResponse#read_header is obsolete.
-
-Fri Mar 5 20:10:57 2004 Minero Aoki <aamine@loveruby.net>
-
- * ext/strscan/strscan.c: new method StringScanner#initialize_copy
- to allow #dup and #clone.
-
- * test/strscan/test_strscan.rb: test StringScanner#dup.
-
-Fri Mar 5 19:42:09 2004 Minero Aoki <aamine@loveruby.net>
-
- * lib/net/http.rb (HTTPResponse#to_ary): should return an object
- which does not respond to #to_ary. It causes infinite loop in
- puts. [ruby-core:02578]
-
-Fri Mar 5 00:51:35 2004 Dave Thomas <dave@pragprog.com>
-
- * lib/test/unit.rb: Move RDoc documentation so that you can
+ * lib/test/unit.rb: MOve RDoc documentation so that you can
now say 'ri Test::Unit'
-Thu Mar 4 22:31:40 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * Makefile.in: miniruby is not needed for cross compile.
-
- * configure.in (PREP): miniruby for native compile.
-
-Thu Mar 4 11:46:32 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/drb/extservm.rb (DRb::ExtServManager#invoke_service_command):
- detach server processes to get rid of zombies.
-
-Thu Mar 4 10:41:25 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * ruby.h (T_MASK): save 1 bit in flags bits by shifting T_xxx
- values.
-
-Thu Mar 4 08:08:36 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/syck/rubyext.c: get rid of warnings.
-
- * lib/rss/taxonomy.rb: ditto.
-
- * lib/rdoc/ri/ri_formatter.rb: ditto.
-
- * test/ruby/test_assignment.rb: ditto.
-
-Thu Mar 4 01:17:28 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/rdoc/ri/ri_display.rb (DefaultDisplay::page): wait until the
- pager terminates.
-
-Wed Mar 3 13:10:56 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (method_hash): new method. [ruby-talk:93968]
-
- * eval.c (proc_eq): do not compare dyna_vars.
-
- * eval.c (proc_hash): new method.
-
- * eval.c (rb_yield_0): protect break/return from within orphan (or
- lambda) Proc object.
-
-Wed Mar 3 09:52:05 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/mkmf.rb ($topdir): use compile_dir only when not installed yet.
- [ruby-talk:94098]
-
-Wed Mar 3 01:18:52 2004 Kouhei Sutou <kou@cozmixng.org>
-
- * lib/rss/converter.rb: handled Uconv::Error.
-
- * lib/rss/dublincore.rb: DublincoreModel -> DublinCoreModel
-
-Wed Mar 3 00:59:30 2004 David Black <dblack@wobblini.net>
-
- * lib/scanf.rb: soak_up_spaces only ungetc's non-space last
- character
-
- * lib/scanf.rb: IO#block_scanf now returns partial last iteration
- array if format string matches partly
-
-Tue Mar 2 16:30:21 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * io.c (pipe_open): erred program name should be reported by
- exceptions, instead of the first argument.
-
- * process.c (rb_spawn): ditto.
-
- * process.c (proc_spawn_v): use first argument as program name.
-
- * win32/win32.c (rb_w32_aspawn): ditto.
-
- * win32/win32.c (CreateChild): search executable file if no program
- name given.
-
- * lib/drb/extservm.rb (invoke_service_command): use Process.spawn.
- [ruby-dev:23103]
-
- * lib/rdoc/ri/ri_display.rb (setup_pager): use IO.popen.
- [ruby-dev:23086], [ruby-dev:23103]
-
- * lib/rdoc/diagram.rb (convert_to_png): ditto.
-
- * lib/rdoc/generators/chm_generator.rb (compile_project): ditto.
-
-Tue Mar 2 12:24:03 2004 NAKAMURA Usaku <usa@ruby-lang.org>
+Tue Mar 2 12:32:59 2004 NAKAMURA Usaku <usa@ruby-lang.org>
* win32/Makefile.sub, wince/Makefile.sub (config.h): shouldn't check
defined? NORETURN. [ruby-dev:23100]
-Tue Mar 2 11:28:40 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * test/ruby/test_iterator.rb (test_ljump): cannot use
- assert_nothing_raised due to passing block.
-
-Tue Mar 2 06:23:14 2004 David Black <dblack@wobblini.net>
-
- * lib/scanf.rb: fixed Kernel#scanf to propagate code block
-
-Mon Mar 1 23:25:40 2004 David Black <dblack@wobblini.net>
-
- * lib/scanf.rb: Partial fix so STDIN#scanf works with new
- STDIN#pos behavior
-
-Mon Mar 1 19:42:05 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * bcc32/setup.mak: configure's default is "--enable-install-doc"
-
- * win32/setup.mak: ditto.
-
Mon Mar 1 12:24:10 2004 Dave Thomas <dave@pragprog.com>
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_alias):
@@ -60864,105 +18042,38 @@ Sun Feb 29 23:14:53 2004 Dave Thomas <dave@pragprog.com>
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_class):
Handle :nodoc: on singleton classes.
-Sat Feb 28 21:50:20 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * bcc32/Makefile.sub, bcc32/README.bcc32, bcc32/configure.bat,
- bcc32/setup.mak: new configure scheme. use ``configure --prefix=dir''
- instead of ``make DESTDIR=dir install''.
- --with-static-linked-ext support on bccwin32. [ruby-dev:23034]
-
-Sat Feb 28 21:50:20 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * bcc32/setup.mak: "configure --disable-install-doc" is now working.
-
- * win32/setup.mak: ditto.
-
-Sat Feb 28 15:09:49 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * bcc32/configure.bat: append missing label ":exit".
-
- * bcc32/configure.bat: fix typo.
-
-Sat Feb 28 10:31:03 2004 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+Sat Feb 28 10:58:49 2004 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
* MANIFEST: add test_erb.rb
* lib/erb.rb, test/erb/test_erb.rb: don't forget filename,
if both filename and safe_level given. [ruby-dev:23050]
-Sat Feb 28 01:08:40 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * parse.y (yylex): should not allow symbol for invalid global
- variable (e.g. `:$-)`). [ruby-core:02518]
-
-Fri Feb 27 20:37:09 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (proc_invoke): no orphan block check is needed when pcall
- is true.
-
- * eval.c (localjump_destination): update localjump condition.
-
-Fri Feb 27 02:10:49 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (localjump_destination): lambda should not interfere
- return from the yielded block.
-
-Fri Feb 27 00:53:49 2004 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+Fri Feb 27 01:00:09 2004 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
* lib/drb/drb.rb, test/drb/drbtest.rb: require drb/eq.rb by default
-Thu Feb 26 12:15:02 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * win32/win32.c (make_cmdvector): adjust successive double-quote
- handling.
-
-Thu Feb 26 09:42:56 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * hash.c (delete_if_i): use st_delete_safe() (via
- rb_hash_delete()) instead of returning ST_DELETE.
-
-Thu Feb 26 02:35:10 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * process.c (rb_f_exec): get rid of SEGV when exec failed for command
- in single string.
-
-Wed Feb 25 21:17:33 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * gc.c (obj_free), io.c (rb_io_fptr_finalize), rubyio.h (OpenFile):
- sharing OpenFile.
-
- * io.c (rb_io_initialize): accept IO instance. [ruby-dev:22195]
-
-Wed Feb 25 21:16:10 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Feb 25 21:16:25 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
* instruby.rb (with_destdir): should return the given argument if no
DESTDIR is given.
* instruby.rb: use path name expansion of cmd.exe.
-Wed Feb 25 20:44:45 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Feb 25 09:35:22 2004 NAKAMURA Usaku <usa@ruby-lang.org>
- * lib/cgi-lib.rb, lib/getopts.rb, lib/importenv.rb, lib/parsearg.rb:
- warn with caller position.
+ * error.c (NameError::Message): new class for lazy evaluation of
+ message to ensure replaced before marshalling. merge from HEAD.
+ (ruby-bugs-ja:PR#588)
- * test/rss/test_content.rb, test/rss/test_dublincore.rb,
- test/rss/test_syndication.rb, test/rss/test_trackback.rb: use cgi
- instead of cgi-lib.
+ * eval.c (rb_method_missing): use NameError::Message. merge from
+ HEAD. (ruby-bugs-ja:PR#588)
-Tue Feb 24 18:42:03 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Tue Feb 24 18:59:37 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* dir.c (glob_helper): '**/' should not match leading period
unless File::FNM_DOTMATCH is set. (like '*/') [ruby-dev:23014]
-Tue Feb 24 18:03:14 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * test/ruby/test_file.rb (test_fnmatch): test for dir.c:1.108.
-
-Tue Feb 24 17:07:17 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * dir.c (fnmatch): File.fnmatch with File::FNM_PATHNAME was broken
- for the pattern including '*' followed by '/'.
-
Tue Feb 24 13:22:21 2004 Dave Thomas <dave@pragprog.com>
* lib/rdoc/rdoc.rb (RDoc::RDoc::normalized_file_list): Attempt to get better
@@ -60980,6 +18091,11 @@ Tue Feb 24 06:40:14 2004 Dave Thomas <dave@pragprog.com>
* lib/rdoc/parsers/parse_rb.rb (RubyLex::identify_identifier): Handle
class variables in code listings
+Tue Feb 24 06:40:14 2004 Dave Thomas <dave@pragprog.com>
+
+ * lib/rdoc/parsers/parse_rb.rb (RubyLex::identify_identifier): Handle
+ class variables in code listings
+
Tue Feb 24 06:32:27 2004 Dave Thomas <dave@pragprog.com>
* lib/rdoc/parsers/parse_c.rb (RDoc::C_Parser::do_aliases): Handle
@@ -61008,164 +18124,88 @@ Tue Feb 24 03:45:06 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
* ext/openssl/ossl_config.c (Init_ossl_config): include Enumerable.
-Mon Feb 23 09:09:44 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * instruby.rb (parse_args): use optparse instead of getopts.
+Mon Feb 23 09:16:35 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
* instruby.rb (DOSISH): embedded path in batch files should not be
prefixed by DESTDIR. [ruby-core:02186]
-Sun Feb 22 14:58:04 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun Feb 22 09:54:00 2004 Gavin Sinclair <gsinclair@soyabean.com.au>
- * ext/extmk.rb: $extstatic is Array or nil now. [ruby-talk:93383]
+ * re.c: corrected documentation format (again)
- * Makefile.in, bcc32/Makefile.sub, win32/Makefile.sub: terminate options.
-
- * lib/mkmf.rb (init_mkmf): $INCFLAGS also should be lazy-evaluated.
-
-Sun Feb 22 13:05:37 2004 akira yamada <akira@ruby-lang.org>
-
- * lib/uri/mailto.rb (URI::MailTo::to_s): should include fragment.
-
-Sun Feb 22 12:58:35 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/extmk.rb: use optparse instead of getopts.
-
- * Makefile.in, bcc32/Makefile.sub, win32/Makefile.sub: ditto.
-
-Sun Feb 22 09:51:00 2004 Gavin Sinclair <gsinclair@soyabean.com.au>
+Sun Feb 22 09:43:00 2004 Gavin Sinclair <gsinclair@soyabean.com.au>
* re.c: corrected documentation format (rb_reg_initialize_m)
-Sat Feb 21 22:41:00 2004 Gavin Sinclair <gsinclair@soyabean.com.au>
+Sat Feb 21 22:36:00 2004 Gavin Sinclair <gsinclair@soyabean.com.au>
* ext/zlib/zlib.c: documented, but needs more effort.
-Sat Feb 21 14:33:20 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/extmk.rb: prefer relative path. [ruby-talk:93037]
-
-Sat Feb 21 11:12:08 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat Feb 21 11:12:15 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
* missing/os2.c, missing/x68.c: typo fix. pointed out by greentea.
-Fri Feb 20 19:11:20 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/ostruct.rb (OpenStruct#initialize_copy): should not share
- members. [ruby-dev:22966]
-
Fri Feb 20 18:59:47 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
* lib/irb/init.rb (IRB::IRB.parse_opts): add -I option to
irb. [ruby-dev:39243]
-Fri Feb 20 12:55:27 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * io.c (pipe_open): fix typo.
-
- * win32/win32.c (CreateChild): first argument to CreateProcess() must
- have path, not just basename.
-
Thu Feb 19 23:24:16 2004 Dave Thomas <dave@pragprog.com>
* lib/rdoc/generators/html_generator.rb (Generators::HtmlClass::build_attribute_list):
Support visibility modifiers for attributes
-Thu Feb 19 22:39:00 2004 Gavin Sinclair <gsinclair@soyabean.com.au>
+Thu Feb 19 23:24:16 2004 Dave Thomas <dave@pragprog.com>
- * lib/ostruct.rb: documented
+ * lib/rdoc/generators/html_generator.rb (Generators::HtmlClass::build_attribute_list):
+ Support visibility modifiers for attributes
Thu Feb 19 22:39:04 2004 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
* test/rinda/test_rinda.rb: DRb.start_service only once in testsuites.
DRb.start_service could handle this.
-Thu Feb 19 22:24:04 2004 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+Thu Feb 19 22:19:00 2004 Gavin Sinclair <gsinclair@soyabean.com.au>
- * lib/soap/mapping/rubytypeFactory.rb: should not dump singleton class.
- [ruby-dev:22588]
- c = class << Object.new; class C; self; end; end; SOAPMarshal.dump(c)
+ * lib/ostruct.rb: documented
-Thu Feb 19 18:08:18 2004 Gavin Sinclair <gsinclair@soyabean.com.au>
+Thu Feb 19 21:28:00 2004 Gavin Sinclair <gsinclair@soyabean.com.au>
* ext/strscan/strscan.c: improved documentation
-Thu Feb 19 18:08:18 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * win32/win32.c, win32/win32.h: fixed prototypes.
-
- * win32/win32.c (wait): same as waitpid() with -1.
-
-Thu Feb 19 02:34:28 2004 Dave Thomas <dave@pragprog.com>
-
- * lib/rdoc/markup/simple_markup/preprocess.rb (SM::PreProcess::include_file):
- Only strip comment markers if all lines start with comments.
-
-Thu Feb 19 03:05:49 2004 Minero Aoki <aamine@loveruby.net>
-
- * ext/strscan/strscan.c: StringScanner#restsize is obsolete;
- use #rest_size instead.
-
- * ext/strscan/strscan.c: StringScanner#matchedsize is obsolete;
- use #matched_size instead.
-
-Thu Feb 19 02:42:19 2004 Minero Aoki <aamine@loveruby.net>
-
- * ext/strscan/strscan.c: don't use rb_eval_string, it defines
- classes under the module when required in module clauses.
- [ruby-dev:22951]
-
-Thu Feb 19 02:37:28 2004 Minero Aoki <aamine@loveruby.net>
-
- * ext/strscan/strscan.c: merge documentation from 1.8 branch.
- Thanks Gavin Sinclair.
+Thu Feb 19 03:10:52 2004 Minero Aoki <aamine@loveruby.net>
-Thu Feb 19 00:20:00 2004 Gavin Sinclair <gsinclair@soyabean.com.au>
+ * ext/strscan/strscan.c: synchronized with main trunk (rev 1.11).
- * lib/cgi-lib.rb: deprecated after 1.8.1
+Thu Feb 19 02:30:34 2004 Minero Aoki <aamine@loveruby.net>
- * lib/getopts.rb: ditto
-
- * lib/importenv.rb: ditto
-
- * lib/parsearg.rb: ditto
+ * ext/strscan/strscan.c: documentation checked.
Thu Feb 19 00:11:05 2004 Dave Thomas <dave@pragprog.com>
* lib/rdoc/markup/simple_markup/preprocess.rb (SM::PreProcess::handle):
Strip extraneous space from filenames in :include:
-Wed Feb 18 22:53:41 2004 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+Wed Feb 18 22:52:00 2004 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
- * lib/drb/unix.rb: remove O_NONBLOCk, thanks \ay
+ * lib/drb/unix.rb: remove O_NONBLOCK, thanks \ay
-Wed Feb 18 22:42:19 2004 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+Wed Feb 18 22:47:00 2004 Gavin Sinclair <gsinclair@soyabean.com.au>
- * test/rinda/test_rinda.rb: improt test_rinda.rb
+ * ext/strscan/strscan.c: documented
Wed Feb 18 22:03:11 2004 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
* test/*: should not depend on $KCODE.
-Wed Feb 18 18:07:09 2004 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * test/ruby/test_sprintf.rb: added tests.
-
Wed Feb 18 17:18:01 2004 WATANABE Hirofumi <eban@ruby-lang.org>
* ext/win32ole/win32ole.c: need to include <olectl.h> on Cygwin.
Wed Feb 18 10:40:38 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
- * sprintf.c (rb_f_sprintf): sign bit extension should not be done
- if FPLUS flag is specified. [ruby-list:39224]
-
* sprintf.c (rb_f_sprintf): do not prepend dots for negative
- numbers if FZERO is specified. [ruby-dev:39218]
-
-Wed Feb 18 10:23:34 2004 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * sprintf.c (rb_f_sprintf): clean up.
+ numbers if FZERO is specified. [ruby-list:39218]
Tue Feb 17 23:40:34 2004 Guy Decoux <ts@moulon.inra.fr>
@@ -61174,11 +18214,6 @@ Tue Feb 17 23:40:34 2004 Guy Decoux <ts@moulon.inra.fr>
Tue Feb 17 23:28:45 2004 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
- * test/soap/marshal/test_marshal.rb, test/ruby/test_marshal.rb: do $:
- trick to share the testcase test/ruby/marshaltestlib.rb.
-
-Tue Feb 17 23:13:23 2004 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
-
* test/ruby/marshaltestlib.rb: common marshal testcase added.
* test/ruby/test_marshal.rb: use above testsuite.
@@ -61187,282 +18222,108 @@ Tue Feb 17 23:13:23 2004 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
* test/soap/marshal/cmarshal.rb: removed (not used).
-Tue Feb 17 19:34:26 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/extmk.rb (extmake): $extout_prefix doesn't vary for libraries.
-
- * ext/extmk.rb (extmake): remove compile directory if empty.
-
- * ext/extmk.rb (parse_args) lib/mkmf.rb (create_makefile): move
- initialization of $extout_prefix from lib/mkmf.rb. [ruby-dev:22928]
-
- * ext/extmk.rb: clear ext and extout directory when cleaning.
-
- * lib/mkmf.rb (CLEANLIBS): should be under $(arch) directory.
-
-Tue Feb 17 18:02:10 2004 Minero Aoki <aamine@loveruby.net>
-
- * ext/strscan/strscan.c: ScanError may be (wrongly) garbage
- collected. (thanks Gavin Sinclair)
-
- * ext/strscan/strscan.c: move ::ScanError to StringScanner::Error.
- ::ScanError is also defined for backward compatibility.
-
- * ext/strscan/strscan.c: #peep is obsolete, use #peek.
-
- * ext/strscan/strscan.c: #empty? is obsolete, use #eos?.
+Tue Feb 17 10:51:23 2004 NAKAMURA Usaku <usa@ruby-lang.org>
- * ext/strscan/strscan.c: #clear is obsolete, use #terminate.
+ * ext/syck/rubyext.c (syck_emitter_end_object): takes only one arg.
- * ext/strscan/strscan.c: #getbyte is obsolete, use #get_byte.
+Tue Feb 17 01:35:28 2004 Tanaka Akira <akr@m17n.org>
-Tue Feb 17 12:12:47 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * eval.c (rb_eval): care that another thread replace NODE_DREGX_ONCE
+ to NODE_LIT. [ruby-dev:22920]
- * ext/extmk.rb (parse_args): delay expanding $(extout) until invoking
- make.
+Tue Feb 17 01:24:35 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/mkmf.rb (CLEANLIBS): should remove files have specific
- extensions.
+ * bcc32/Makefile.sub, win32/Makefile.sub (config.h): define
+ STACK_GROW_DIRECTION. [ruby-dev:22910]
-Tue Feb 17 11:33:30 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * bcc32/Makefile.sub (config.h): add newer checks.
- * lib/rss/rexmlparser.rb: REXML version may be 4 digits.
+ * wince/Makefile.sub (config.h): define NEED_IO_SEEK_BETWEEN_RW.
-Tue Feb 17 10:45:59 2004 NAKAMURA Usaku <usa@ruby-lang.org>
+Tue Feb 17 00:38:10 2004 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
- * ext/syck/rubyext.c (syck_emitter_end_object): takes only one arg.
+ * lib/rinda/tuplespace.rb: TupleSpace#initialize, stop doubling timeout
-Tue Feb 17 07:48:21 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Feb 17 00:18:03 2004 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
- * lib/rexml/encodings/SHIFT_JIS: wrong library name.
+ * test/rinda/test_rinda.rb: import test_rinda.rb
-Tue Feb 17 01:35:28 2004 Tanaka Akira <akr@m17n.org>
+Tue Feb 17 00:14:30 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
- * eval.c (rb_eval): care that another thread replace NODE_DREGX_ONCE
- to NODE_LIT. [ruby-dev:22920]
-
-Tue Feb 17 01:20:57 2004 Minero Aoki <aamine@loveruby.net>
+ * bcc32/Makefile.sub: avoid warning "Redefinition of macro
+ 'HAVE_GETLOGIN'".
- * lib/fileutils.rb: new module FileUtils::DryRun.
+ * vms/config.h_in: ditto.
Mon Feb 16 23:28:14 2004 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
* lib/csv.rb: document reduction. [ruby-core:02429]
- * test/yaml/test_yaml.rb: added 0..1 test with "0".."1" on display.
- it should be defined that the specification about what kind of Range
- is supported in ruby's custom type in YAML.
-
-Mon Feb 16 22:22:00 2004 Gavin Sinclair <gsinclair@soyabean.com.au>
+Mon Feb 16 22:08:00 2004 Gavin Sinclair <gsinclair@soyabean.com.au>
* lib/generator.rb: corrected doc format
-
* lib/rinda/rinda.rb: added documentation (from Hugh Sasse)
-
* lib/rinda/tuplespace.rb: ditto
- [Note: rinda files actually committed Wed Feb 18 07:27:00 2004]
-
-Mon Feb 16 20:28:52 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Mon Feb 16 20:41:32 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* bcc32/Makefile.sub: show more warnings. (refering to mingw)
* bcc32/setup.mak: ditto.
-Mon Feb 16 18:35:58 2004 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/Makefile.sub (config.status): should create *.pdb on ext/,
- not .ext/.
-
- * win32/Makefile.sub (config.status): convert the name of import
- library.
-
- * lib/mkmf.rb (create_makefile): now don't need to remove
- $(TARGET).lib.
+Mon Feb 16 13:39:44 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-Mon Feb 16 15:45:22 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * dir.c (rb_glob, rb_globi): add const.
- * configure.in: check functions, fork spawnv.
+ * ruby.h: ditto.
- * io.c (rb_io_s_popen): accept argv not only single command line.
-
- * process.c (rb_proc_exec_n): export.
-
- * process.c (rb_check_argv): check if arguments are safe to invoke.
-
- * process.c (rb_fork): retry to fork.
-
- * process.c (rb_spawn): spawn child process asynchronously.
-
- * process.c (rb_f_system): raise an exception if the command could not
- execute.
-
- * win32/win32.c (rb_w32_argv_size): count necessary size for joined
- arguments.
-
- * win32/win32.c (rb_w32_join_argv): join arguments with quoting.
-
- * win32/win32.c (rb_w32_pipe_exec, rb_w32_spawn, rb_w32_aspawn):
- accept program name adding to command line.
-
-Mon Feb 16 15:18:33 2004 Minero Aoki <aamine@loveruby.net>
-
- * lib/racc/parser.rb: add note for Racc full package.
-
-Mon Feb 16 15:13:01 2004 Minero Aoki <aamine@loveruby.net>
-
- * ext/racc/cparse/README: new file.
-
- * ext/racc/cparse/MANIFEST: add README.
-
-Mon Feb 16 12:29:10 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/iconv/iconv.c (iconv_s_list): new method Iconv.list
- (libiconv only).
-
-Mon Feb 16 10:29:52 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * dir.c (CompareImpl): File.fnmatch and Dir.glob get better performance
- in Win32. This is achived by calling downcase() for single-byte
- characters. (CharLower() is slower than downcase())
-
-Mon Feb 16 02:14:29 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Mon Feb 16 02:16:33 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* bcc32/Makefile.sub: should warn suspicious pointer conversion.
* bcc32/setup.mak: ditto.
-Sun Feb 15 20:56:22 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * dir.c (push_braces): remove wrong const. [ruby-dev:22891]
+Sun Feb 15 19:06:42 2004 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
-Sun Feb 15 20:41:15 2004 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+ * lib/rinda/tuplespace.rb: TupleSpace#read(tpl, 0), raise
+ RequestExpiredError if not found.
- * sample/soap/calc/httpd.rb, sample/soap/exchange/httpd.rb,
- sample/soap/sampleStruct/httpd.rb, sample/wsdl/googleSearch/httpd.rb:
- use soap/property instead of getopts for configuring DocumentRoot
- and port# of httpd. see samplehttpd.conf below.
-
- * sample/soap/calc/samplehttpd.conf,
- sample/soap/exchange/samplehttpd.conf,
- sample/soap/sampleStruct/samplehttpd.conf,
- sample/wsdl/googleSearch/samplehttpd.conf: added.
-
-Sun Feb 15 19:13:33 2004 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
-
- * lib/rinda/tuplespace.rb: read(tpl,0), raise RequestExpiredError
- if not found.
-
-Sun Feb 15 15:48:57 2004 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+Sun Feb 15 15:56:46 2004 Masaki Suketa <masaki.suketa@nifty.ne.jp>
* ext/win32ole/win32ole.c: add IDispatch wrapper in val2variant.
Thanks, arton.
-Sun Feb 15 15:23:29 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * ruby.h, dir.c (rb_glob): add const.
-
Sun Feb 15 01:46:05 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
* lib/mkmf.rb: absolute path of ruby is assigned to $(RUBY).
[ruby-dev:22870]
-Sat Feb 14 23:59:11 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * mkconfig.rb: use fileutils.rb instead of ftools.rb.
-
- * bcc32/Makefile.sub, win32/Makefile.sub (config.h): define
- STACK_GROW_DIRECTION.
-
- * bcc32/Makefile.sub (config.h): add newer checks.
-
- * wince/Makefile.sub (config.h): define NEED_IO_SEEK_BETWEEN_RW.
-
-Sat Feb 14 23:26:27 2004 WATANABE Hirofumi <eban@ruby-lang.org>
-
- * lib/un.rb: use OptionParser instead of getopts.
-
-Sat Feb 14 11:28:14 2004 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+Sat Feb 14 11:29:41 2004 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
* sample/drb/*: import lib/drb/sample
-Sat Feb 14 11:14:12 2004 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+Sat Feb 14 11:08:23 2004 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
* lib/drb/drb.rb: add pretty_print, thanks gotoken.
-Fri Feb 13 21:51:00 2004 Gavin Sinclair <gsinclair@soyabean.com.au>
-
- * lib/fileutils.rb: slighly improved documentation (sync with 1.8)
-
-Fri Feb 13 19:57:01 2004 Kouhei Sutou <kou@cozmixng.org>
-
- * test/rss/test_trackback.rb: added tests for TrackBack with RSS
- 2.0.
-
- * test/rss/common.rb: added methods make RSS 2.0.
+Fri Feb 13 12:35:08 2004 Minero Aoki <aamine@loveruby.net>
- * lib/rss/trackback.rb: TrackBack API is decided.
+ * test/fileutils/test_fileutils.rb: File.link may raise EINVAL and
+ EACCES on Windows.
- * lib/rss/rss.rb: RSS::VERSION 0.0.7 -> 0.0.8.
-
- * lib/rss/parser.rb, lib/rss/rss.rb: replaced $DEBUG by RSS::DEBUG.
-
- * lib/rss/2.0.rb: removed RSS 2.0 URI. Because RSS 2.0 doesn't
- have URI.
-
-Fri Feb 13 14:41:00 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tk/lib/tk.rb: en-bugged at last commit (Feb 11 23:24:22 2004)
-
-Fri Feb 13 12:26:37 2004 Minero Aoki <aamine@loveruby.net>
-
- * test/fileutils/test_fileutils.rb: rescue SystemCallError instead
- of EINVAL. File.link may raise EACCES on network file systems.
-
-Fri Feb 13 05:18:58 2004 Minero Aoki <aamine@loveruby.net>
-
- * test/fileutils/test_fileutils.rb: File.link raises EINVAL on
- Win9x. [ruby-dev:22713]
-
-Thu Feb 12 21:49:00 2004 Gavin Sinclair <gsinclair@soyabean.com.au>
+Thu Feb 12 21:45:00 2004 Gavin Sinclair <gsinclair@soyabean.com.au>
* lib/ftools.rb: documented
-Thu Feb 12 21:19:00 2004 Gavin Sinclair <gsinclair@soyabean.com.au>
-
- * lib/base64.rb: added and tidied documentation
-
-Thu Feb 12 20:45:01 2004 Minero Aoki <aamine@loveruby.net>
+Thu Feb 12 21:25:00 2004 Gavin Sinclair <gsinclair@soyabean.com.au>
- * lib/net/protocol.rb (WriteAdapater#puts): must append "\n" to
- the string, don't prepend. (ruby-bugs:PR#1280)
+ * lib/base64.rb: backported from HEAD (modularised and documented)
-Thu Feb 12 20:31:43 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Feb 12 20:31:48 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/mkmf.rb (create_tmpsrc): cpp32 of Borland C++ ignores #error
directives in DOS line-ending files at all.
-Thu Feb 12 15:23:20 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (rparen): ignore preceding newlines to right parentheses.
- (ruby-bugs:PR#1221) [ruby-dev:22858]
-
-Thu Feb 12 14:17:43 2004 WATANABE Hirofumi <eban@ruby-lang.org>
-
- * configure.in: set ac_cv_func_link to yes to enable link() on MinGW.
- [ruby-dev:22241]
-
-Thu Feb 12 13:32:49 2004 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/win32.c (link): raise NotImplementedError on Win9X.
- contributed by Tietew. [ruby-dev:22713]
-
- * win32/win32.c, win32/win32.h (link): add const.
-
-Thu Feb 12 09:56:19 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/tk/lib/tk.rb (TkComm::tk_split_list): suppress a warning.
-
Thu Feb 12 02:23:56 2004 Tanaka Akira <akr@m17n.org>
* lib/pathname.rb: use assert_raise instead of assert_raises.
@@ -61474,91 +18335,26 @@ Thu Feb 12 02:23:56 2004 Tanaka Akira <akr@m17n.org>
* lib/tsort.rb: ditto.
use TSortHash and TSortArray instead of Hash and Array in test.
-Wed Feb 11 23:24:22 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tk/lib/tk.rb: properly treat a Tcl/Tk's string with escaping
- special characters.
-
-Tue Feb 10 20:49:07 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval.c (method_proc): return bound Proc object. [ruby-dev:22854]
-
- * eval.c (rb_mod_define_method): bind method body itself for Method
- object.
-
- * node.h (NODE_DMETHOD): deprecated.
-
- * object.c (rb_class_inherited_p): export.
-
-Tue Feb 10 16:43:50 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval.c (umethod_bind): purge unused check. [ruby-dev:22850]
-
-Tue Feb 10 14:33:08 2004 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * string.c (rb_str_match): raise TypeError when both arguments are
- strings. [ruby-dev:22851]
-
- * string.c (rb_str_match2): removed.
-
- * Makefile.in, bcc32/Makefile.sub, win32/Makefile.sub,
- wince/Makefile.sub (string.c): now not depend on version.h.
-
-Mon Feb 9 17:46:07 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * Makefile.in, bcc32/Makefile.sub, win32/Makefile.sub, configure.in,
- runruby.rb: run rdoc, test and so on with compiled extension
- libraries. [ruby-dev:22688]
-
- * ext/extmk.rb, lib/mkmf.rb: make extension libraries in separated
- directory, similar to the actual directory structure.
-
- * lib/fileutils.rb (FileUtils.copy_file): use the mode of the original
- file to create new file.
-
- * lib/rdoc/ri/ri_paths.rb (RI::Paths::SYSDIR): get rid of unexpected
- influence by environment variable.
-
- * bcc32/configure.bat, win32/configure.bat: add install-doc options.
-
- * win32/win32.c, win32/win32.h (rb_w32_fstat): fix Borland C runtime
- bug which returns wrong mode. [ruby-dev:22846]
-
-Mon Feb 9 16:30:12 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * process.c (detach_process_watcher): return the last status.
- [ruby-dev:22841]
-
-Sun Feb 8 16:46:08 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/pp.rb (PP::PPMethods::object_address_group): suppress negative
- sign for higher heap areas.
-
-Sun Feb 8 16:18:27 2004 akira yamada <akira@ruby-lang.org>
-
- * test/yaml/test_yaml.rb (YAML_Unit_Tests::test_range_cycle):
- added tests.
-
-Sun Feb 8 15:51:57 2004 akira yamada <akira@ruby-lang.org>
+Wed Feb 11 20:01:12 2004 akira yamada <akira@ruby-lang.org>
* test/ruby/test_file.rb (TestFile::test_fnmatch): added tests for
File.fnmatch. [ruby-dev:22815][ruby-dev:22819]
-Sun Feb 8 15:41:45 2004 akira yamada <akira@ruby-lang.org>
+ * test/ruby/test_proc.rb (TestProc::test_eq): added a
+ test. [ruby-dev:22599]
- * test/yaml/test_yaml.rb (YAML_Unit_Tests::test_range_cycle):
- added tests. [ruby-core:02306] [ruby-core:02311]
+ * test/ruby/test_proc.rb (TestProc::test_eq): added tests for
+ Proc#==. [ruby-dev:22592], [ruby-dev:22601]
-Sun Feb 8 14:24:35 2004 Minero Aoki <aamine@loveruby.net>
+Tue Feb 10 16:43:56 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/net/http.rb (HTTP#request): should not overwrite Connection
- header. (ruby-bugs:PR#1274)
+ * eval.c (umethod_bind): purge unused check. [ruby-dev:22850]
-Sun Feb 8 10:11:21 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Mon Feb 9 17:16:00 2004 WATANABE Hirofumi <eban@ruby-lang.org>
- * dir.c (glob_helper): Dir.glob('**/') did not work. [ruby-dev:22832]
+ * lib/rdoc/parsers/parse_c.rb: escape '{' and '}' to avoid warnings.
-Sun Feb 8 00:29:26 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Mon Feb 9 13:00:55 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* dir.c (fnmatch): File.fnmatch('*?', 'a') should return true.
[ruby-dev:22815]
@@ -61566,14 +18362,10 @@ Sun Feb 8 00:29:26 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* dir.c (fnmatch): File.fnmatch('\[1\]' , '[1]') should return true.
[ruby-dev:22819]
- * dir.c: Did some styles (no change to behavior)
-
-Sat Feb 7 19:56:11 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/irb/init.rb (IRB.rc_files): yield possible rc file names.
+Sun Feb 8 16:46:13 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/irb/input-method.rb (IRB::ReadlineInputMethod::initialize):
- load and save history automatically. [ruby-core:02352]
+ * lib/pp.rb (PP::PPMethods::object_address_group): suppress negative
+ sign for higher heap areas.
Fri Feb 6 22:48:16 2004 Dave Thomas <dave@pragprog.com>
@@ -61590,27 +18382,6 @@ Fri Feb 6 22:22:50 2004 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
* lib/pp.rb (PPInspectTest#test_to_s_with_iv): remove instance
variable which is defined in the test.
-Fri Feb 6 18:54:18 2004 akira yamada <akira@ruby-lang.org>
-
- * test/ruby/test_proc.rb (TestProc::test_eq): added a
- test. [ruby-dev:22599]
-
-Fri Feb 6 18:26:00 2004 akira yamada <akira@ruby-lang.org>
-
- * test/ruby/test_proc.rb (TestProc::test_eq): added tests for
- Proc#==. [ruby-dev:22592], [ruby-dev:22601]
-
-Fri Feb 6 10:12:06 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/socket/socket.c (bsock_do_not_reverse_lookup): control reverse
- lookup for every instance. [ruby-core:02346]
-
-Fri Feb 6 09:15:11 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/irb/extend-command.rb: add irb_help command. [ruby-talk:91610]
-
- * lib/irb/cmd/help.rb (IRB::ExtendCommand::Help): show RDoc.
-
Fri Feb 6 00:48:37 2004 Tanaka Akira <akr@m17n.org>
* lib/prettyprint.rb (PrettyPrint#first?): obsoleted.
@@ -61627,10 +18398,6 @@ Thu Feb 5 23:56:55 2004 Tanaka Akira <akr@m17n.org>
* lib/set.rb (Set#pretty_print): use seplist.
-Wed Feb 4 22:39:46 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * file.c (rb_stat_mode): should not sign-expand, so backout.
-
Wed Feb 4 02:12:06 2004 Tanaka Akira <akr@m17n.org>
* file.c (test_l): fix wrong method name in document.
@@ -61641,37 +18408,19 @@ Wed Feb 4 02:12:06 2004 Tanaka Akira <akr@m17n.org>
(test_sgid): ditto.
(test_sticky): ditto.
-Tue Feb 3 22:36:25 2004 Kouhei Sutou <kou@cozmixng.org>
-
- * lib/rss/2.0.rb, lib/rss/content.rb, lib/rss/dublincore.rb,
- lib/rss/rss.rb, lib/rss/syndication.rb: removed warnings.
-
- * lib/rss/converter.rb: removed handling load error of nkf.
-
- * test/rss/test_syndication.rb, test/rss/test_trackback.rb,
- test/rss/test_dublincore.rb, test/rss/test_content.rb: replaced
- 'require "rss/parser"' by 'require "rss/1.0"'.
-
- * test/rss/test_parser.rb, test/rss/test_accessor.rb: removed
- 'require "rss/parser"'.
-
-Tue Feb 3 11:23:17 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (reduce_nodes): remove tail returns. [ruby-talk:90934]
-
Tue Feb 3 08:04:57 2004 Tanaka Akira <akr@m17n.org>
* lib/pp.rb (Struct#pretty_print_cycle): follow 1.8 style.
-Mon Feb 2 22:06:31 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Feb 2 19:33:49 2004 WATANABE Hirofumi <eban@ruby-lang.org>
- * parse.y (block_append, new_evstr, void_expr0): remove no longer used
- labels.
+ * configure.in: backport from 1.9 for Interix.
-Mon Feb 2 18:45:50 2004 WATANABE Hirofumi <eban@ruby-lang.org>
+ * dln.c (dln_load): ditto.
+
+Mon Feb 2 13:31:51 2004 NAKAMURA Usaku <usa@ruby-lang.org>
- * dln.c (dln_load): don't specify RTLD_GLOBAL on Interix,
- because it caused SEGV when running runner.rb.
+ * lib/net/http.rb (canonical_each): fix merge miss.
Mon Feb 2 01:54:00 2004 Tanaka Akira <akr@m17n.org>
@@ -61693,14 +18442,12 @@ Mon Feb 2 01:54:00 2004 Tanaka Akira <akr@m17n.org>
(UDPSocket#send): recognize 3 arguments form. try all addresses on
4 arguments form.
-Sun Feb 1 23:00:00 2004 Shigeo Kobayashi <shigek@ruby-lang.org>
+Sun Feb 1 18:17:00 2004 Gavin Sinclair <gsinclair@soyabean.com.au>
- * ext/bigdecimal.c: Bug in BigDecimal("1e#{n}").add BigDecimal('.5'),n)
- reported and fixed by Javier Goizueta.
+ * lib/net/http.rb: merged coding style changes from HEAD.
-Sun Feb 1 18:21:00 2004 Gavin Sinclair <gsinclair@soyabean.com.au>
+Sun Feb 1 16:15:00 2004 Gavin Sinclair <gsinclair@soyabean.com.au>
- From ruby_1_8 branch:
* lib/test/unit.rb: rearranged documentation for RDoc's sake.
* lib/matrix.rb: improved documentation.
* lib/net/http.rb: slight documentation formatting improvement.
@@ -61711,32 +18458,27 @@ Sun Feb 1 05:30:06 2004 Tanaka Akira <akr@m17n.org>
raise an errror on non-http proxy URI.
(OpenURI::Buffer#<<): make a tempfile binmode. [ruby-talk:90793]
-Sun Feb 1 00:57:41 2004 Kouhei Sutou <kou@cozmixng.org>
-
- * lib/rss/parser.rb (RSS::Parser): added @@default_parser. Used
- XML parser became selectable.
- * test/rss/test_parser.rb: added tests for
- RSS::Parser.default_parser.
+Sat Jan 31 09:20:32 2004 NAKAMURA, Hiroshi <nakahiro@sairon.co.jp>
-Sat Jan 31 02:28:15 2004 WATANABE Hirofumi <eban@ruby-lang.org>
+ * sample/openssl/gen_csr.rb: wrong usage string.
- * configure.in (RPATHFLAG): set to -Wl,-R like NetBSD on Interix.
+Sat Jan 31 01:00:32 2004 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
-Sat Jan 31 01:09:41 2004 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
-
- * lib/logger.rb: leading 0 padding of timestamp usec part.
+ * lib/soap/wsdlDriver.rb, lib/wsdl/soap/operation.rb: add support of
+ "parts" attribute of soap:body element in WSDL.
-Fri Jan 30 18:53:23 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * lib/wsdl/xmlSchema/schema.rb: friendly warning message for
+ simpleType element which is not supported for now.
- * re.c (KR_REHASH): wrong hash value on sizeof(long) > sizeof(int).
+ * lib/soap/mapping/factory.rb: deleted unused methods.
-Thu Jan 29 23:11:57 2004 WATANABE Hirofumi <eban@ruby-lang.org>
+ * lib/soap/mapping/rubytypeFactory.rb: do no ignore case while xsi:type
+ string <-> Ruby class name matching.
- * configure.in (DLEXT2): removed. Ruby does not treat
- ".dll" as a extension library anymore.
+ * test/wsdl/soap/{soapbodyparts.wsdl,test_soapbodyparts.wsdl}: new
+ files.
- * bcc32/Makefile.sub, win32/Makefile.sub, wince/Makefile.sub (DLEXT2):
- ditto.
+Thu Jan 29 23:56:00 2004 WATANABE Hirofumi <eban@ruby-lang.org>
* util.c (mblen): fix overrun. [ruby-dev:22672]
@@ -61745,83 +18487,36 @@ Thu Jan 29 22:41:53 2004 Dave Thomas <dave@pragprog.com>
* lib/rdoc/generators/html_generator.rb: Allow 'link:' in Tidylinks.
THis means you can write "see f1[link:files/f1_rb.html]".
-Thu Jan 29 22:24:47 2004 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
-
- * sample/openssl/gen_csr.rb: follow OpenSSL::X509::Name change.
- ASN.1 type of subject DN elements were wrong.
-
-Thu Jan 29 22:19:51 2004 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
-
- * test/*: remove $: trick. [ruby-dev:22763] use test/runner.rb to
- run test.
-
-Thu Jan 29 19:28:16 2004 Minero Aoki <aamine@loveruby.net>
-
- * lib/net/http.rb (Request#initialize): reject only when a path is
- empty. [ruby-dev:22771]
-
-Thu Jan 29 18:54:08 2004 H.Yamamoto <ocean@m2.ccsnet.ne.jp>
+Thu Jan 29 15:33:23 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
- * dir.c (glob_helper): infinite loop bug in win32 code.
- [ruby-dev:22770]
-
-Thu Jan 29 17:03:49 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * dir.c: merge tuning from H.Yamamoto <ocean@m2.ccsnet.ne.jp>.
- [ruby-dev:22761]
-
-Thu Jan 29 11:32:14 2004 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
-
- * test/rss/test_*: do $: trick while searching a module in the current
- directory.
-
- * test/xsd/test_xmlschemaparser.rb, test/wsdl/test_emptycomplextype.rb,
- test/soap/helloworld/test_helloworld.rb,
- test/soap/calc/{test_calc.rb,test_calc2.rb}: do File.expand_path
- before using __FILE__.
-
- * test/yaml/test_yaml.rb: assert_equals -> assert_equal.
-
-Thu Jan 29 01:56:02 2004 why the lucky stiff <why@ruby-lang.org>
-
- * ext/syck/rubyext.c: usec round-tripping skew. [ruby-core:2305]
-
- * lib/yaml/rubytypes.rb: character Range now round-trips. [ruby-core:2306]
-
- * test/yaml/test_yaml.rb: add Time and Range tests.
-
-Thu Jan 29 00:00:46 2004 Kouhei Sutou <kou@cozmixng.org>
-
- * lib/rss: rss/parser.rb is always required.
-
-Wed Jan 28 15:09:14 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/openssl/ossl_x509hame.c (ossl_x509name_initialize): change
+ second argument. it expected to be a Hash not an Integer.
- * test/rss/*.rb: remove "test/" prefix.
+ * ext/openssl/ossl_x509name.c (ossl_x509name_add_entry): add new
+ function for OpenSSL::X509::Name#add_entry.
-Wed Jan 28 13:07:02 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/openssl/ossl_x509name.c (ossl_x509name_to_a): append ASN.1
+ tag number to each element of return value.
- * ext/iconv/extconf.rb: include iconv.h for libiconv. [ruby-dev:22715]
+ * ext/openssl/ossl_x509name.c (Init_ossl_x509name): add constants
+ OpenSSL::X509::Name::DEFAULT_OBJECT_TYPE and OBJECT_TYPE_TEMPLATE.
-Wed Jan 28 12:43:07 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * ext/openssl/lib/openssl/x509.rb (OpenSSL::X509::Name#initialize):
+ second argument takes OBJECT_TYPE_TEMPLATE by default.
- * lib/rss: rss library imported. [ruby-dev:22726]
+ * sample/openssl/gen_csr.rb: use OpenSSL::X509::Name.parse.
Wed Jan 28 04:29:41 2004 Eric Schwartz <emschwar@fc.hp.com>
* lib/cgi/session.rb: use LOCK_SH to read, and a few other
improvements. [ruby-core:02328]
-Tue Jan 27 15:00:14 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * misc/ruby-mode.el: better support for general delimited
- strings. [ruby-dev:22695]
-
-Tue Jan 27 11:04:40 2004 FUKUMOTO Atsushi <fukumoto@nospam.imasy.or.jp>
+Tue Jan 27 11:09:29 2004 FUKUMOTO Atsushi <fukumoto@nospam.imasy.or.jp>
* ext/socket/socket.c (s_recvfrom): sending length should be an
invariant while retrying on EAGAIN. [ruby-talk:89962]
-Tue Jan 27 10:31:28 2004 NAKAMURA Usaku <usa@ruby-lang.org>
+Tue Jan 27 10:35:18 2004 NAKAMURA Usaku <usa@ruby-lang.org>
* ext/win32ole/win32ole.c (set_argv): fix condition.
@@ -61830,14 +18525,19 @@ Tue Jan 27 02:26:31 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
* lib/webrick/httputils.rb (WEBrick:HTTPUtils::parse_header):
refine regex for header-name.
+Tue Jan 27 00:30:11 2004 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * win32/Makefile.sub: rollback.
+
Mon Jan 26 22:53:04 2004 Dave Thomas <dave@pragprog.com>
* io.c: Remove documentation references to $defout.
-Mon Jan 26 14:41:46 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+Mon Jan 26 15:11:47 2004 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * sample/exyacc.rb: escape '}' to avoid warning.
- * lib/weakref.rb (WeakRef::initialize): set up @__id before
- calling "super".
+Mon Jan 26 14:41:46 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
* lib/delegate.rb (Delegator::initialize): preserve
singleton_method_added method [ruby-dev:22685]
@@ -61845,11 +18545,11 @@ Mon Jan 26 14:41:46 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
* lib/delegate.rb (Delegator::initialize): use Kernel::raise
instead of mere raise. [ruby-dev:22681]
-Mon Jan 26 12:45:23 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Mon Jan 26 12:47:17 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tcltklib/tcltklib.c: define CONST84 when TCL_MAJOR_VERSION == 7
-Mon Jan 26 11:30:58 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Jan 26 11:35:23 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ext/extmk.rb: Makefiles should depend on also rbconfig.rb.
(ruby-bugs:PR#1256)
@@ -61857,112 +18557,18 @@ Mon Jan 26 11:30:58 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ext/win32ole/win32ole.c (set_argv): set real arguments to
WIN32OLE::ARGV. [ruby-list:39073]
-Sun Jan 25 18:25:26 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * ext/openssl/ossl_x509name.c (ossl_x509name_add_entry): third
- argument become optional.
-
- * ext/openssl/ossl_x509name.c (ossl_x509name_initialize): ditto.
-
- * ext/openssl/ossl_x509name.c (Init_x509name): emailAddress and
- domainComponent should be IA5String.
-
-Sun Jan 25 01:45:38 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * lib/webrick/httpserver.rb (WEBrick::HTTPServer#run): support
- virtual host.
-
- * lib/webrick/httpserver.rb (WEBrick::HTTPServer#virtual_host): add
- new method to register virtual hosting server.
-
- * lib/webrick/httpserver.rb (WEBrick::HTTPServer#lookup_server): add
- new method to lookup virtual hosting server.
-
-Sat Jan 24 13:06:26 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * ext/openssl/ossl_x509hame.c (ossl_x509name_initialize): change
- second argument. it expected to be a Hash not an Integer.
-
- * ext/openssl/ossl_x509name.c (ossl_x509name_add_entry): add new
- function for OpenSSL::X509::Name#add_entry.
-
- * ext/openssl/ossl_x509name.c (Init_ossl_x509name): add constants
- OpenSSL::X509::Name::DEFAULT_OBJECT_TYPE and OBJECT_TYPE_TEMPLATE.
-
- * ext/openssl/lib/openssl/x509.rb (OpenSSL::X509::Name#initialize):
- second argument takes OBJECT_TYPE_TEMPLATE by default.
-
-Fri Jan 23 02:26:30 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * pack.c (num2i32): pack should not raise RangeError.
- [ruby-dev:22654]
-
- * pack.c (pack_pack): do not auto convert nil to zero.
-
Thu Jan 22 22:54:53 2004 Shugo Maeda <shugo@ruby-lang.org>
* lib/net/imap.rb (BEG_REGEXP): allow 8-bit characters in quoted
strings for Novell GroupWise Internet Agent.
-
* lib/net/imap.rb (DATA_REGEXP): ditto.
-Thu Jan 22 18:35:49 2004 WATANABE Hirofumi <eban@ruby-lang.org>
-
- * lib/e2mmap.rb (VERSION): remove unnecessary version checking.
-
-Thu Jan 22 16:21:02 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Jan 22 16:21:33 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
* parse.y (string_content): reset lexical states at the beginning of
string contents. [ruby-list:39061]
-Thu Jan 22 08:08:50 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * parse.y (opt_rescue): use NODE_ERRINFO() instead of
- NODE_GVAR("$!"), to avoid confusion from variable aliasing.
- [ruby-talk:90074]
-
- * version.c (Init_version): remove obsolete constants VERSION
- etc. [ruby-dev:22643]
-
-Thu Jan 22 01:46:32 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * parse.y (newline_node): do not use NODE_NEWLINE node anymore,
- use NEWLINE flag instead.
-
-Thu Jan 22 01:12:12 2004 Siena. <siena@faculty.chiba-u.jp>
-
- * missing/os2.c (chdir, getcwd):
- use _chdir2 and _getcwd2 supporting multiple drives in OS/2 with EMX.
-
-Thu Jan 22 00:33:52 2004 Siena. <siena@faculty.chiba-u.jp>
-
- * configure.in: check availability of link(). [ruby-dev:22237]
- * file.c (rb_file_s_link): raise an exception when link() is unavailable.
- * missing/os2.c (link): removed. File#link isn't supported.
- * bcc32/Makefile.sub: define HAVE_LINK to enable link(). [ruby-dev:22241]
- * win32/Makefile.sub: ditto.
-
-Thu Jan 22 00:26:25 2004 Siena. <siena@faculty.chiba-u.jp>
-
- * ChangeLog: typo: RUBY_MBCHAR_MAX was RUBY_MBCHAR_MAXSIZE.
-
-Thu Jan 22 00:12:51 2004 Siena. <siena@faculty.chiba-u.jp>
-
- * defines.h: define RUBY_MBCHAR_MAX instead of MB_CUR_MAX.
- * dir.c (Next, emx_mblen): use RUBY_MBCHAR_MAX for mblen().
- * file.c (CharNext): ditto.
- * ruby.c (translate_char): ditto.
- * util.c (__crt0_glob_function): ditto.
-
-Thu Jan 22 00:10:01 2004 Dave Thomas <dave@pragprog.com>
-
- * lib/base64.rb: :nodoc: the Deprecated module
-
-Wed Jan 21 23:52:39 2004 WATANABE Hirofumi <eban@ruby-lang.org>
-
- * configure.in: Interix(SFU) support.
-
-Wed Jan 21 23:03:45 2004 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+Wed Jan 21 21:55:51 2004 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
* lib/drb/drb.rb: remove O_NONBLOCK, thanks \ay
* lib/drb/extserv.rb: typo
@@ -61975,28 +18581,21 @@ Wed Jan 21 17:57:56 2004 Shugo Maeda <shugo@ruby-lang.org>
* lib/net/imap.rb (ensure_nz_number): show a detailed error
message.
-Wed Jan 21 16:44:15 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Jan 21 16:44:20 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/mkmf.rb (merge_libs): squeeze successive same libraries.
[ruby-dev:22652]
-Wed Jan 21 16:10:36 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/base64.rb: enclosed in a module. [ruby-core:02285]
-
-Wed Jan 21 16:01:26 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Jan 21 16:01:37 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ext/digest/rmd160/extconf.rb: have_library appends found library.
Wed Jan 21 11:36:00 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
- * ext/socket/socket.c (sock_gethostbyname): returns host if
- ai_canonname is NULL. (ruby-bugs PR#1243)
-
* parse.y (block_append): update nd_end for "real" head node.
[ruby-list:39058]
-Tue Jan 20 14:48:28 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Tue Jan 20 14:48:13 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
* ext/openssl/extconf.rb: should check <openssl/conf_api.h> instead
of OPENSSL_VERSION_NUMBER. [ruby-list:39056]
@@ -62016,57 +18615,25 @@ Tue Jan 20 13:22:39 2004 Dave Thomas <dave@pragprog.com>
* lib/English.rb: Document English.rb.
-Tue Jan 20 04:41:58 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * test/ruby/test_marshal.rb (MarshalTestLib::test_exception): test
- for [ruby-dev:22604].
-
- * test/ruby/test_marshal.rb (MarshalTestLibtest_singleton): test
- for [ruby-dev:22588].
-
-Tue Jan 20 02:38:13 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * marshal.c (w_class): should not dump singleton class.
- [ruby-dev:22631]
-
Tue Jan 20 02:49:22 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
* ext/openssl/extconf.rb: add check for OpenSSL version.
[ruby-list:39054]
-Mon Jan 19 23:56:20 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * error.c (name_err_mesg_to_str): inverted condition for result of
- inspection. [ruby-dev:22628]
-
-Mon Jan 19 22:24:28 2004 WATANABE Hirofumi <eban@ruby-lang.org>
-
- * sample/exyacc.rb: escape '}' to avoid warning.
-
- * lib/rdoc/parsers/parse_c.rb: escape '{' and '}' to avoid warnings.
-
-Mon Jan 19 21:28:06 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/digest/defs.h, win32/win3.c, win32/win32.h, file.c: remove
- useless casts for Borland C.
-
-Mon Jan 19 17:39:38 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * error.c (NameError::message): internal use only.
+Tue Jan 20 02:38:13 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
- * eval.c (rb_method_missing): use hidden constant.
+ * marshal.c (w_class): should not dump singleton class.
+ [ruby-dev:22631]
-Mon Jan 19 16:30:53 2004 akira yamada <akira@ruby-lang.org>
+Tue Jan 20 01:31:36 2004 WATANABE Hirofumi <eban@ruby-lang.org>
- * test/ruby/test_time.rb: added tests for [ruby-dev:22614] and
- [ruby-dev:22617].
+ * io.c (lineno): typo fix(FIX2INT -> INT2FIX).
-Mon Jan 19 13:09:21 2004 NAKAMURA Usaku <usa@ruby-lang.org>
+Mon Jan 19 21:53:38 2004 akira yamada <akira@ruby-lang.org>
- * ext/extmk.rb, win32/Makefile.sub, win32/configure.bat,
- win32/setup.mak: --with-static-linked-ext support on mswin32.
+ * io.c, re.c, string.c, time.c: fixed up positions of RDocs.
-Mon Jan 19 06:49:07 2004 Tadayoshi Funaba <tadf@dotrb.org>
+Mon Jan 19 07:09:20 2004 Tadayoshi Funaba <tadf@dotrb.org>
* lib/date.rb: zone was wrong when it was behind UTC.
Thanks Mark J. Reed.
@@ -62076,53 +18643,10 @@ Mon Jan 19 06:49:07 2004 Tadayoshi Funaba <tadf@dotrb.org>
* sample/cal.rb: added a class, anyway.
-Mon Jan 19 01:08:39 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * class.c, error.c, eval.c, intern.h, object.c, variable.c:
- do not set path if it is a singleton class. [ruby-dev:22588]
-
- * lib/cgi.rb (CGI::QueryExtension): give extended string, not a
- delegater object.
-
-Sun Jan 18 23:59:44 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/iconv/charset_alias.rb: prefer us_EN locale encodings or
- former. [ruby-dev:22609]
-
- * ext/iconv/iconv.c (iconv_create): raise InvalidEncoding
- exception when EINVAL.
-
-Sun Jan 18 23:16:34 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * class.c, error.c, file.c, io.c, numeric.c, object.c, re.c, struct.c,
- time.c: marked init_copy functions nodoc.
-
Sun Jan 18 20:47:35 2004 WATANABE Hirofumi <eban@ruby-lang.org>
* ruby.c: use translate_char() on Cygwin.
-Sun Jan 18 20:00:16 2004 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
-
- * lib/soap/wsdlDriver.rb, lib/wsdl/soap/operation.rb: add support of
- "parts" attribute of soap:body element in WSDL.
-
- * lib/wsdl/xmlSchema/schema.rb: friendly warning message for
- simpleType element which is not supported for now.
-
- * test/wsdl/soap/{soapbodyparts.wsdl,test_soapbodyparts.wsdl}: new
- files.
-
-Sun Jan 18 16:46:48 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * time.c (time_overflow_p): should return results. [ruby-dev:22614]
-
-Sun Jan 18 12:07:24 2004 Siena. <siena@faculty.chiba-u.jp>
-
- * test/ruby/test_time.rb: new test case to test Time#[+-].
-
- * time.c (time_plus, time_minus): fix RangeError for a negative
- argument in environments whose time_t is unsigned. [ruby-dev:22608]
-
Sun Jan 18 02:33:26 2004 WATANABE Hirofumi <eban@ruby-lang.org>
* defines.h (_WIN32): undef _WIN32 on Cygwin before defining DOSISH.
@@ -62132,136 +18656,59 @@ Sun Jan 18 00:23:55 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
* marshal.c (class2path): check anonymous class/module before
checking referable, and allow singleton classes.
-Sat Jan 17 23:58:51 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * error.c (NameError::Message): new class for lazy evaluation of
- message to ensure replaced before marshalling. [ruby-dev:22604]
-
- * eval.c (rb_method_missing): use NameError::Message.
-
-Sat Jan 17 21:49:50 2004 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * lib/time.rb (test_rfc2822, test_rfc3339, test_encode_xmlschema):
- should not expect that all platforms handle negative time_t value.
-
-Fri Jan 16 23:53:09 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval.c (proc_eq): compare also arguments and environment
- (including local variables). [ruby-dev:22590]
-
Fri Jan 16 14:33:35 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
* marshal.c (class2path): get class path and check referable.
[ruby-dev:22588]
-Thu Jan 15 12:58:26 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Jan 16 09:52:23 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * eval.c (proc_eq): Proc with empty body may not be equal.
+ [ruby-dev:22590]
+
+Thu Jan 15 13:03:10 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
* io.c (argf_read): do not append EOF. (ruby-bugs-ja:PR#585)
* io.c (rb_io_fwrite): ad-hockery hack to get rid of HP-UX stdio
weird behavior. [ruby-dev:22424]
-Wed Jan 14 21:13:06 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * test/inlinetest.rb (InlineTest::eval_part): eval under the top
- level environment.
-
-Wed Jan 14 17:54:17 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * test/inlinetest.rb (InlineTest::loadtest): require instead of
- load, to get rid of multiple loading.
-
-Wed Jan 14 13:30:52 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Jan 14 13:31:06 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ext/iconv/extconf.rb: wrapper iconv.rb is dependent on platform.
-Wed Jan 14 09:32:02 2004 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * MANIFEST: add test/net/test_httpheader.rb. (commit miss?)
-
-Wed Jan 14 00:58:35 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (Init_Proc): move SystemStackError from under
- StandardError to Exception. [ruby-talk:89782]
-
-Tue Jan 13 18:03:02 2004 Ian Macdonald <ian@caliban.org>
-
- * file.c (rb_stat_wr, rb_stat_ww): New functions
- implementing new methods (File::Stat#world_readable?,
- File::Stat#world_writable?).
+Tue Jan 13 18:54:28 2004 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
-Tue Jan 13 16:53:25 2004 why the lucky stiff <why@ruby-lang.org>
-
- * ext/syck/rubyext.c: omission of Date library code caused
- test suite failure. [ruby-core:2251]
-
-Tue Jan 13 16:50:03 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tk/lib/tk.rb: use $0 as the default application class name.
-
-Tue Jan 13 14:48:00 2004 Ian Macdonald <ian@caliban.org>
-
- * lib/pathname.rb: New methods (Pathname#world_readable?,
- Pathname#world_writable?).
-
-Tue Jan 13 14:48:01 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * parse.y (primary): allow no "when" case. [ruby-dev:22578]
+ * lib/logger.rb(Logger#msg2str): no special treatment for the object
+ which responds to :to_str. commited at 2004-01-11T21:46:27 by
+ gsinclair.
- * ruby.h (rb_class_of): reduce branch. [ruby-dev:22577]
+ * lib/logger.rb(LogDevice#initialize): remove type checking if the
+ given object is a String. Kernel.open handles it correctly.
+ commited at 2004-01-11T21:46:27 by gsinclair.
- * ruby.h (rb_type): ditto.
+ * test/logger/test_logger.rb: follow above change (ArgumentError ->
+ TypeError.) follow above commit.
-Tue Jan 13 14:26:59 2004 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+Tue Jan 13 14:27:13 2004 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
* lib/test/unit/ui/testrunnerutilities.rb (TestRunnerUtilities):
moved run method which allows output level. [ruby-dev:22554]
-Tue Jan 13 13:04:24 2004 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
-
- * test/test_*.rb: Pathname#parent -> Pathname#dirname.
-
-Tue Jan 13 11:38:58 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * test/yaml/test_yaml.rb (YAML_Unit_Tests::test_spec_type_{int,float}):
- fix syntax error.
-
-Tue Jan 13 07:52:40 2004 why the lucky stiff <why@ruby-lang.org>
-
- * ext/syck/bytecode.c: turn off default implicit typing.
-
- * ext/syck/implicit.c: detect base60 integers.
-
- * ext/syck/rubyext.c: handle base60, as well as hex and octal
- with commas. implicit typing of ruby symbols.
-
- * test/yaml/test_yaml.rb: add test.
-
Tue Jan 13 04:29:52 2004 Dave Thomas <dave@pragprog.com>
* lib/rdoc/ri/ri_driver.rb (RiDriver::report_method_stuff):
Show fully-qualified class names in class list.
-Tue Jan 13 01:24:17 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * file.c (test_wr): Rdoc fix. [ruby-core:02225]
-
Tue Jan 13 01:04:37 2004 Dave Thomas <dave@pragprog.com>
* lib/rdoc/ri/ri_paths.rb (RI::Paths): First attempt at
incorporating DESTDIR in the rdoc installation.
-Mon Jan 12 23:26:21 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Jan 12 23:27:19 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
* parse.y (primary): fix position after FCALL. [ruby-dev:22574]
-Mon Jan 12 18:00:11 2004 Ian Macdonald <ian@caliban.org>
-
- * file.c (test_wr, test_ww): New functions implementing new
- methods (File::world_readable?, File::world_writable?).
-
- * file.c (S_IRUGO, S_IGUGO): New macros.
-
Mon Jan 12 12:07:22 2004 Dave Thomas <dave@pragprog.com>
* lib/rdoc/parsers/parse_c.rb (RDoc::C_Parser::do_methods):
@@ -62279,22 +18726,29 @@ Mon Jan 12 12:07:22 2004 Dave Thomas <dave@pragprog.com>
* lib/rdoc/ri/ri_formatter.rb (RI::HtmlFormatter::break_to_newline):
HTML formats need explicit line breaks.
+Mon Jan 12 11:46:30 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in (LIBPATHFLAG, RPATHFLAG): enclose paths with single
+ quotes. [ruby-dev:22564]
+
+ * lib/mkmf.rb (libpathflag): do not enclose with quotes always.
+
+ * {bcc32,win32,wince}/Makefile.sub (LIBPATHFLAG): quoted.
+
Mon Jan 12 02:24:07 2004 Dave Thomas <dave@pragprog.com>
* lib/rdoc/ri/ri_formatter.rb (RI::HtmlFormatter): Add HTML
generation support to ri (Elliot Hughes)
-Sun Jan 11 23:54:41 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * env.h (ruby_frame, ruby_scope, ruby_in_eval, ruby_class,
- ruby_dyna_vars): export. [ruby-dev:22566]
+Mon Jan 12 02:24:07 2004 Dave Thomas <dave@pragprog.com>
-Sun Jan 11 02:35:53 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * lib/rdoc/ri/ri_formatter.rb (RI::HtmlFormatter): Add HTML
+ generation support to ri (Elliot Hughes)
- * ext/socket/socket.c (make_hostent): a bug in brace position.
+Sun Jan 11 02:07:47 2004 Dave Thomas <dave@pragprog.com>
- * configure.in: install rdoc by default. if you do not want to
- install rdoc, specify --disable-install-doc.
+ * lib/rdoc/ri/ri_options.rb (RI::Options::OptionList::OptionList):
+ Also accept command line options via the 'RI' environment variable.
Sun Jan 11 02:07:47 2004 Dave Thomas <dave@pragprog.com>
@@ -62315,49 +18769,7 @@ Sat Jan 10 01:54:50 2004 Eric Sunshine <sunshine@sunshineco.com>
correctly on Rhapsody when -arch compiler flag was used (via
configure's --enable-fat-binary option).
-Sat Jan 10 23:01:41 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in (LIBPATHFLAG, RPATHFLAG): enclose paths with single
- quotes. [ruby-dev:22564]
-
- * lib/mkmf.rb (libpathflag): do not enclose with quotes always.
-
- * {bcc32,win32,wince}/Makefile.sub (LIBPATHFLAG): quoted.
-
-Sat Jan 10 22:46:18 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * dir.c (dir_inspect): new method, Dir#inspect. [ruby-dev:22562]
-
-Fri Jan 9 17:36:51 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * ext/socket/socket.c (make_hostent): getaddrinfo(3) on BSD do not
- fill ai_canonname if serv is not supplied. (ruby-bugs PR#1243)
-
-Fri Jan 9 13:14:59 2004 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
-
- * lib/test/unit/collector/dir.rb: do not ignore exceptions(LoadError
- and SystemExitError) while loading a testcase. smell of bug.
-
- * test/testunit/collector/test_dir.rb: add new test of the LoadError.
-
- * test/drb/{test_drbssl.rb,test_drbunix.rb}: do not define testcase if
- openssl is not installed.
-
- * test/testunit/collector/test_dir.rb: assert_raises -> assert_raise.
-
-Fri Jan 9 11:52:16 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * rubysig.h: <errno.h> is needed to use errno which may be a macro.
-
-Fri Jan 9 11:20:24 2004 Siena. <siena@faculty.chiba-u.jp>
-
- * ext/extmk.rb (extmake): should not reduce necessary libraries.
- [ruby-dev:22440]
-
- * lib/mkmf.rb (merge_libs): merge libraries according to
- dependency.
-
-Fri Jan 9 10:05:23 2004 Siena. <siena@faculty.chiba-u.jp>
+Fri Jan 9 10:05:14 2004 Siena. <siena@faculty.chiba-u.jp>
* lib/mkmf.rb (libpathflag): use single quotes. [ruby-dev:22440]
@@ -62367,7 +18779,7 @@ Thu Jan 8 23:49:21 2004 WATANABE Hirofumi <eban@ruby-lang.org>
rdoc documentation, you need to run configure with
--enable-install-doc.
-Thu Jan 8 21:17:43 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Thu Jan 8 21:29:43 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
* ext/openssl/ossl_pkey.c (ossl_pkey_to_der): removed; it returns
public key only.
@@ -62381,10 +18793,6 @@ Thu Jan 8 21:17:43 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
* ext/openssl/ossl_pkey_rsa.c (ossl_rsa_to_der): new function for
OpenSSL::PKey::RSA#to_der.
-Thu Jan 8 18:25:29 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * dir.c (glob_helper): should not recurse in exceptional status.
-
Thu Jan 8 16:51:04 2004 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
* test/wsdl/datetime/test_datetime.rb: fixed a stupid testcase which
@@ -62394,58 +18802,15 @@ Thu Jan 8 11:20:01 2004 WATANABE Hirofumi <eban@ruby-lang.org>
* eval.c, object.c, process.c, re.c: don't use C++ style comments.
-Thu Jan 8 08:46:14 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/syck/rubyext.c (yaml_org_handler): lazy-load Date for
- static-ext.
-
-Thu Jan 8 07:06:30 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/extmk.rb: preserve order in Setup. [ruby-dev:22503]
-
- * ext/extmk.rb: move dependent libraries just after depended
- libraries.
-
- * ext/digest/*/extconf.rb: depend on digest.
-
-Thu Jan 8 04:36:17 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Thu Jan 8 04:36:21 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
* lib/webrick/cgi.rb (WEBrick::CGI#initialize): should create
@config[:Logger] if it was not given.
-Wed Jan 7 22:28:12 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * dir.c (glob_helper): fix memory leak.
-
-Wed Jan 7 21:15:07 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
* sample/webrick/*: new files.
* MANIFEST: add sample/webrick/*
-Wed Jan 7 20:51:51 2004 Minero Aoki <aamine@loveruby.net>
-
- * test/net/test_httpheader.rb: new file.
-
- * MANIFEST: add test/net/test_httpheader.rb.
-
-Wed Jan 7 20:42:06 2004 Minero Aoki <aamine@loveruby.net>
-
- * lib/net/http.rb (HTTPHeader#content_length): should return nil
- unless header exists. [ruby-dev:22519]
-
-Wed Jan 7 14:26:05 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tk/lib/tk.rb (TkPanedWindow): use epath for embedded windows.
-
- * ext/tk/lib/tktext.rb: use epath for embedded windows.
-
- * ext/tk/lib/tkcanvas.rb: use epath for window items.
-
-Wed Jan 7 14:24:04 2004 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
-
- * lib/soap/{attachment.rb,mimemessage.rb}: added from soap4r/1.5.2.
-
Wed Jan 7 13:00:18 2004 Dave Thomas <dave@pragprog.com>
* lib/rdoc/ri/ri_driver.rb: Fix problem where ri was
@@ -62469,71 +18834,16 @@ Tue Jan 6 22:13:34 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
* eval.c (rb_mod_modfunc): should break if m has no super class.
[ruby-dev:22498]
-Tue Jan 6 21:51:37 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Jan 6 21:55:02 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
* io.c (fptr_finalize): should save errno just after failure.
[ruby-dev:22492]
-Tue Jan 6 20:51:10 2004 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
-
- * lib/logger.rb(Logger#msg2str): no special treatment for the object
- which responds to :to_str.
-
- * lib/logger.rb(LogDevice#initialize): remove type checking if the
- given object is a String. Kernel.open handles it correctly.
-
- * test/logger/test_logger.rb: follow above change (ArgumentError ->
- TypeError.)
-
Tue Jan 6 14:53:14 2004 Dave Thomas <dave@pragprog.com>
* bin/ri: split out the display side, making it pluggable. Added
new ri_driver and ri_display files in lib/rdoc/ri.
-Tue Jan 6 11:29:43 2004 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
-
- * test/inlinetest.rb, test/{test_generator.rb,test_ipaddr.rb,
- test_pathname.rb,test_pp.rb,test_prettyprint.rb,test_set.rb,
- test_time.rb,test_tsort.rb: added.
-
-Tue Jan 6 09:38:27 2004 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
-
- * import soap4r/1.5.2;
-
- * lib/soap/{attachment.rb,baseData.rb,encodingstyle/soapHandler.rb}:
- introduce SOAPExternalReference class as a referenct to SOAPEnvelope
- external content.
-
- * lib/soap/{attachment.rb,mimemessage.rb}: great SwA (SOAP messages
- with Attachments) support code by Jamie Herre.
-
- * lib/soap/{element.rb,marshal.rb,parser.rb,processor.rb,
- streamHandler.rb,wsdlDriver.rb}: SwA support.
-
- * lib/soap/rpc/{cgistub.rb,driver.rb,element.rb,proxy.rb,router.rb,
- soaplet.rb}: SwA support and refactoring.
-
- * lib/soap/generator.rb, lib/soap/mapping/mapping.rb: follow
- SOAPReference#initialize signature change.
-
- * lib/soap/mapping/factory.rb: deleted unused methods.
-
- * lib/soap/mapping/rubytypeFactory.rb: do no ignore case while xsi:type
- string <-> Ruby class name matching.
-
- * lib/xsd/datatypes.rb: check the smallest positive non-zero
- single-precision float exactly instead of packing with "f".
- [ruby-talk:88822]
-
- * test/soap/test_basetype.rb, test/xsd/test_xsd.rb: use 1.402e-45, not
- 1.4e-45. 1.4e-45 is smaller than 2 ** -149...
-
- * test/soap/test_basetype.rb, test/soap/marshal/test_marshal.rb,
- test/xsd/test_xsd.rb: use "(-1.0 / (1.0 / 0.0))" instead of "-0.0".
-
- * test/soap/test_streamhandler.rb: revert to the previous test that
- warns "basic_auth unsupported under net/http".
-
Tue Jan 6 06:37:53 2004 Dave Thomas <dave@pragprog.com>
* bin/rdoc: Add --ri-system switch
@@ -62554,45 +18864,6 @@ Tue Jan 6 00:04:40 2004 Dave Thomas <dave@pragprog.com>
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_method_or_yield_parameters):
fix parsing if there are braces in a method parameter list
-Tue Jan 6 01:01:04 2004 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/dir.h, win32/win32.c: fix patch miss.
-
- * win32/Makefile.sub: fix file dependency.
-
-Mon Jan 5 20:32:00 2004 Gavin Sinclair <gsinclair@soyabean.com.au>
-
- * lib/logger.rb: enhanced documentation.
-
-Mon Jan 5 18:58:47 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * dir.c: merge tuning from H.Yamamoto <ocean@m2.ccsnet.ne.jp>.
- [ruby-dev:22486]
-
- * pack.c (pack_unpack): unpack requires big endian offet (OFF16B
- and OFF32B). The patch is from Minero Aoki in [ruby-dev:22489]
-
- * pack.c (OFF16B): add big-endian offset again.
-
-Mon Jan 5 03:00:53 2004 Minero Aoki <aamine@loveruby.net>
-
- * test/ruby/test_pack.rb: new test test_unpack_N.
-
-Mon Jan 5 01:47:53 2004 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * lib/mkmf.rb (create_makefile): remove duplicated object files
- from $objs on DOSISH platforms.
-
-Sat Jan 3 02:44:48 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * rubysig.h (TRAP_END): preserve errno before switching context.
- [ruby-core:02137]
-
-Sat Jan 3 01:18:08 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * dir.c: merge tuning from H.Yamamoto <ocean@m2.ccsnet.ne.jp>.
- [ruby-dev:22476]
-
Fri Jan 2 14:54:11 2004 Dave Thomas <dave@pragprog.com>
* bin/ri: Add new --classes option, and arrange for
@@ -62611,23 +18882,10 @@ Fri Jan 2 01:50:13 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
* io.c (argf_eof): ARGF.eof? should not have any side effect.
[ruby-dev:22469]
-Thu Jan 1 09:03:20 2004 Dave Thomas <dave@pragprog.com>
-
- * bin/ri (report_class_stuff): Fix problem with ambiguous nested
- classes not matching.
-
Wed Dec 31 17:25:17 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
* io.c (argf_each_byte): should return self. [ruby-dev:22465]
-Wed Dec 31 15:05:00 2003 Gavin Sinclair <gsinclair@soyabean.com.au>
-
- * lib/pathname.rb: Corrected small coding error.
-
-Wed Dec 31 15:00:00 2003 Gavin Sinclair <gsinclair@soyabean.com.au>
-
- * lib/pathname.rb: Completed documentation.
-
Wed Dec 31 11:20:34 2003 Dave Thomas <dave@pragprog.com>
* lib/rdoc/parsers/parse_c.rb (RDoc::C_Parser::do_methods): Make
@@ -62666,20 +18924,16 @@ Tue Dec 30 12:30:30 2003 Dave Thomas <dave@pragprog.com>
Tue Dec 30 08:32:32 2003 Dave Thomas <dave@pragprog.com>
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_method):
- Handle undoing nsting of yield parameters correctly for:
+ Handle undoing nesting of yield parameters correctly for:
- def each_entry(&b) Dir.foreach(@path) {|f| yield P.new(f) } end
+ def each_entry(&b) Dir.foreach(@path) {|f| yield P.new(f) } end
-Tue Dec 30 07:30:00 2003 Gavin Sinclair <gsinclair@soyabean.com.au>
-
- * lib/pathname.rb: Added documentation.
-
-Mon Dec 29 20:08:17 2003 Minero Aoki <aamine@loveruby.net>
+Tue Dec 30 08:32:32 2003 Dave Thomas <dave@pragprog.com>
- * lib/net/http.rb (GenericRequest#initialize): check if path
- begins with '/'.
+ * lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_method):
+ Handle undoing nesting of yield parameters correctly for:
- * lib/net/http.rb: def m( arg ) -> def m(arg)
+ def each_entry(&block) Dir.foreach(@path) {|f| yield Pathname.new(f) } end
Mon Dec 29 12:51:02 2003 Dave Thomas <dave@pragprog.com>
@@ -62693,25 +18947,10 @@ Mon Dec 29 05:05:51 2003 Dave Thomas <dave@pragprog.com>
* struct.c, random: Add RDoc comments
-Mon Dec 29 02:25:00 2003 Gavin Sinclair <gsinclair@soyabean.com.au>
-
- * lib/optparse.rb: Improved documentation.
-
Mon Dec 29 02:20:54 2003 Dave Thomas <dave@pragprog.com>
* eval.c: Add RDoc for class Proc, Method, UnboundMethod
-Mon Dec 29 02:20:26 2003 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * instruby.rb: fix install directory if destdir and compile_dir are
- not in the same drive.
-
- * ext/extmk.rb: ditto. [ruby-list:39009]
-
- * win32/Makefile.sub, win32/README.win32, win32/configure.bat,
- win32/setup.mak: new configure scheme. use ``configure --prefix=dir''
- instead of ``nmake DESTDIR=dir install''.
-
Mon Dec 29 00:41:44 2003 Dave Thomas <dave@pragprog.com>
* math.c: Add RDoc comments
@@ -62745,7 +18984,7 @@ Sun Dec 28 03:50:05 2003 Dave Thomas <dave@pragprog.com>
* lib/rdoc/parsers/parse_c.rb (RDoc::C_Parser::find_override_comment):
Escape method names used in regexp
-Sun Dec 28 01:46:02 2003 Dave Thomas <dave@wireless_3.local.thomases.com>
+Sun Dec 28 01:46:02 2003 Dave Thomas <dave@pragprog.com>
* lib/rdoc/ri/ri_formatter.rb (RI::TextFormatter::display_flow_item):
Add support for rules in 'ri' output.
@@ -62763,27 +19002,27 @@ Sun Dec 28 01:05:31 2003 Dave Thomas <dave@pragprog.com>
* marshal.c, signal.c: RDoc collemts added by Elliott Hughes
-Sun Dec 28 00:46:25 2003 Dave Thomas <dave@pragprog.com>
+Sun Dec 28 00:48:47 2003 Dave Thomas <dave@pragprog.com>
* lib/rdoc/parsers/parse_c.rb (RDoc::C_Parser::find_class_comment):
- Some Ruby source uses lower-case class names for the
- Init_Xxx C function name.
+ Some source files use lower case class or module names
+ when naming the Init_XXX function in C.
Sat Dec 27 23:41:46 2003 WATANABE Hirofumi <eban@ruby-lang.org>
* configure.in: fix "test: too many arguments" error.
-Sat Dec 27 15:32:40 2003 Dave Thomas <dave@wireless_3.local.thomases.com>
+Sat Dec 27 15:32:19 2003 Dave Thomas <dave@wireless_3.local.thomases.com>
- * time.c: Add RDoc comments for Time class.
+ * time.c: RDoc comments added
-Sat Dec 27 15:07:26 2003 Dave Thomas <dave@pragprog.com>
+Sat Dec 27 15:07:57 2003 Dave Thomas <dave@pragprog.com>
* object.c: Add RDoc comments for Symbol class.
-Sat Dec 27 14:39:53 2003 Dave Thomas <dave@pragprog.com>
+Sat Dec 27 14:42:30 2003 Dave Thomas <dave@pragprog.com>
- * numeric.c (Init_Numeric): Add RDoc comments.
+ * numeric.c: Add RDoc comments.
Sat Dec 27 00:44:00 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
@@ -62801,7 +19040,7 @@ Fri Dec 26 23:02:09 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
* io.c (rb_io_getline): should return nil when read_all gives
empty string, even when nil rs is specified. [ruby-core:02077]
-Fri Dec 26 18:33:54 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Dec 26 18:50:59 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
* configure.in: check if getcontext and setcontext are available.
@@ -62811,26 +19050,14 @@ Fri Dec 26 16:40:53 2003 Tanaka Akira <akr@m17n.org>
* lib/pathname.rb (PathnameTest#test_plus): add 2 assertions.
-Fri Dec 26 14:05:13 2003 Minero Aoki <aamine@loveruby.net>
-
- * test/ruby/test_pack.rb: new test test_pack_N.
-
-Fri Dec 26 12:53:26 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+Fri Dec 26 09:26:58 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
* pack.c (pack_pack): add sign check for 'i', and 'l'.
[ruby-dev:22427]
* bignum.c (rb_quad_pack): add range check for 'quad int'.
-Fri Dec 26 10:58:58 2003 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * MANIFEST: add vms/config.h and remove vms/config.h_in.
-
-Fri Dec 26 10:42:00 2003 AKIYOSHI, Masamichi <masamichi.akiyoshi@hp.com>
-
- * io.c: [VMS] "rfm=stmlf" is specified for open() and fopen().
-
-Thu Dec 25 22:29:53 2003 NAKAMURA Usaku <usa@ruby-lang.org>
+Thu Dec 25 22:39:59 2003 NAKAMURA Usaku <usa@ruby-lang.org>
* string.c (rb_str_update): don't return any value.
@@ -64680,10 +20907,10 @@ Wed Nov 5 22:55:16 2003 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tcltklib/README.1st: add the description of '--with-pthread-ext'
- * ext/tk/lib/tktext.rb: add TkText#text_copy, text_cut, text_paste
+ * ext/tk/lib/tktext.rb : add TkText#text_copy, text_cut, text_paste
to support Tcl/Tk8.4's tk_textCopy, tk_textCut, tk_textPaste
- * ext/tk/lib/tk.rb: add TkMenu#set_focus support Tcl/Tk's
+ * ext/tk/lib/tk.rb : add TkMenu#set_focus support Tcl/Tk's
tk_menuSetFocus
Wed Nov 5 17:33:45 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
@@ -65095,6 +21322,11 @@ Mon Oct 20 09:45:12 2003 NAKAMURA Usaku <usa@ruby-lang.org>
* lib/debug.rb (debug_command): remove debug print.
+Wed Oct 20 00:25:41 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * eval.c (search_required): required name must not be changed before
+ loading. [ruby-dev:24492]
+
Sun Oct 19 13:12:30 2003 Tanaka Akira <akr@m17n.org>
* lib/pathname.rb (foreachline, dir_foreach): add obsolete warning.
@@ -65252,10 +21484,10 @@ Wed Oct 15 05:05:53 2003 Akinori MUSHA <knu@iDaemons.org>
Wed Oct 15 04:31:51 2003 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
- * ext/tk/sample/demos-en/entry3.rb, ext/tk/sample/demos-jp/entry3.rb:
+ * ext/tk/sample/demos-en/entry3.rb, ext/tk/sample/demos-jp/entry3.rb :
new demo-scripts
- * ext/tk/sample/demos-en/widget, ext/tk/sample/demos-jp/widget:
+ * ext/tk/sample/demos-en/widget, ext/tk/sample/demos-jp/widget :
add entries for 'entry3.rb'
Wed Oct 15 04:31:47 2003 Akinori MUSHA <knu@iDaemons.org>
@@ -65651,6 +21883,12 @@ Mon Oct 6 22:59:46 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
* test/csv/test_csv.rb: add tests for above change.
+Sun Oct 5 23:27:09 2003 Tanaka Akira <akr@m17n.org>
+
+ * ext/socket/extconf.rb: check recvmsg even if sendmsg is exists.
+
+ * ext/socket/socket.c (thread_read_select): restored.
+
Mon Oct 6 16:23:38 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
* marshal.c (w_object): wrong method name in the message.
@@ -65680,10 +21918,6 @@ Mon Oct 6 09:19:54 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
Sun Oct 5 23:27:09 2003 Tanaka Akira <akr@m17n.org>
- * ext/socket/extconf.rb: check recvmsg even if sendmsg is exists.
-
- * ext/socket/socket.c (thread_read_select): restored.
-
* lib/pathname.rb: version information is added in document.
Sun Oct 5 23:07:03 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
@@ -66076,6 +22310,35 @@ Thu Oct 2 00:21:11 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
* test/soap/calc/*: give httpd config param "CGIInterpreter".
"/usr/bin/env ruby" thing does not work under non-Unix boxes.
+Sat Oct 2 00:42:20 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * marshal.c (r_byte): retrieve pointer from string value for each
+ time. [ruby-dev:24404]
+
+ * marshal.c (r_bytes0): ditto.
+
+ * enum.c (sort_by_i): re-entrance check added. [ruby-dev:24399]
+
+ * io.c (io_read): should freeze all reading buffer.
+ [ruby-dev:24400]
+
+ * string.c (rb_str_sum): should use bignums when bits is greater
+ than or equals to sizeof(long)*CHAR_BITS. [ruby-dev:24395]
+
+ * eval.c (specific_eval): defer pointer retrieval to prevent
+ unsafe sourcefile string modification. [ruby-dev:24382]
+
+ * string.c (rb_str_sum): wrong cast caused wrong result.
+ [ruby-dev:24385]
+
+ * enum.c (enum_sort_by): hide temporary array from
+ ObjectSpace.each_object. [ruby-dev:24386]
+
+ * string.c (rb_str_sum): check was done with false pointer.
+ [ruby-dev:24383]
+
+ * string.c (rb_str_sum): string may be altered. [ruby-dev:24381]
+
Thu Oct 2 00:25:21 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
* signal.c (ruby_signal_name): adjust to the prototype.
@@ -66239,6 +22502,20 @@ Sat Sep 27 09:44:18 2003 Minero Aoki <aamine@loveruby.net>
* test/fileutils/test_nowrite.rb: ditto.
+Mon Sep 27 09:14:03 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * array.c (rb_ary_delete): comparison may change the capacity.
+ [ruby-dev:24348]
+
+ * array.c (rb_ary_fill): fill should honor length argument.
+ [ruby-dev:24346]
+
+ * array.c (rb_ary_replace): should not use ptr from shared array.
+ [ruby-dev:24345]
+
+ * ext/socket/socket.c (s_accept): don't retry for EWOULDBLOCK.
+ [ruby-talk:113807]
+
Sat Sep 27 04:57:07 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
* test/ruby/test_file.rb: new file. only asserts unlink-before-close
@@ -66569,6 +22846,8 @@ Tue Sep 9 10:39:51 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
* eval.c (struct tag): dst should be VALUE.
+Tue Sep 9 10:39:51 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
* eval.c (localjump_destination): stop at the scope where the current
block was created. [ruby-dev:21353]
@@ -66640,7 +22919,7 @@ Sun Sep 7 16:08:28 2003 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tcltklib/tcltklib.c (lib_mainloop_core): fixed signal-trap bug
- * ext/tk/lib/*.rb: Ruby/Tk works at $SAFE == 4
+ * ext/tk/lib/*.rb : Ruby/Tk works at $SAFE == 4
Sat Sep 6 02:26:34 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
@@ -66859,7 +23138,7 @@ Tue Sep 2 14:02:19 2003 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tcltklib/tcltklib.c (ip_invoke): fixed bug on passing a exception
- * ext/tk/lib/{tk.rb, tkcanvas.rb, tkfont.rb, tktext.rb}:
+ * ext/tk/lib/{tk.rb, tkcanvas.rb, tkfont.rb, tktext.rb} :
bug fix and improvement of font control
Tue Sep 2 09:51:36 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
@@ -66960,17 +23239,17 @@ Fri Aug 29 17:30:15 2003 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* process.c: deny handling IDs during evaluating the block given to
the Process::{UID,GID}.switch method
- * ext/tcltklib/tcltklib.c: some methods have no effect if on slave-IP
+ * ext/tcltklib/tcltklib.c : some methods have no effect if on slave-IP
- * ext/tcltklib/tcltklib.c: can create a interpreter without Tk
+ * ext/tcltklib/tcltklib.c : can create a interpreter without Tk
- * ext/tcltklib/tcltklib.c: bug fix on handling exceptions
+ * ext/tcltklib/tcltklib.c : bug fix on handling exceptions
- * ext/tcltklib/MANUAL.euc: modify
+ * ext/tcltklib/MANUAL.euc : modify
- * ext/tk/lib/tk.rb: freeze some core modules
+ * ext/tk/lib/tk.rb : freeze some core modules
- * ext/tk/lib/multi-tk.rb: more secure
+ * ext/tk/lib/multi-tk.rb : more secure
* ext/tk/lib/tk.rb: TkVariable.new(array) --> treat the array as the
Tk's list
@@ -66978,9 +23257,9 @@ Fri Aug 29 17:30:15 2003 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tk/lib/tk.rb: improve accessibility of TkVariable object
* ext/tk/lib/tk.rb, ext/tk/lib/tkfont.rb, ext/tk/lib/tkcanvas.rb,
- ext/tk/lib/tktext.rb: fix bug of font handling
+ ext/tk/lib/tktext.rb : fix bug of font handling
- * ext/tk/lib/tkfont.rb: TkFont.new() accepts compound fonts
+ * ext/tk/lib/tkfont.rb TkFont.new() accepts compound fonts
Thu Aug 28 22:07:12 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
@@ -67144,12 +23423,7 @@ Tue Aug 19 23:20:00 2003 Shigeo Kobayashi <shigek@ruby-lang.org>
* ext/bigdecimal/lib/bigdecimal/math.rb: E implemented.
-Tue Aug 19 11:19:33 2003 Shugo Maeda <shugo@ruby-lang.org>
-
- * io.c (next_argv): should not call GetOpenFile() if rb_stdout is
- not a IO (T_FILE).
-
-Tue Aug 19 07:47:10 2003 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Tue Aug 19 07:47:09 2003 GOTOU Yuuzou <gotoyuzo@notwork.org>
* lib/webrick/ssl.rb: new file; SSL/TLS enhancement for GenericServer.
@@ -67170,6 +23444,11 @@ Tue Aug 19 07:47:10 2003 GOTOU Yuuzou <gotoyuzo@notwork.org>
* ext/openssl/lib/openssl/ssl.rb (SSLServer#accept): should close
socket if SSLSocket raises error.
+Tue Aug 19 11:19:33 2003 Shugo Maeda <shugo@ruby-lang.org>
+
+ * io.c (next_argv): should not call GetOpenFile() if rb_stdout is
+ not a IO (T_FILE).
+
Tue Aug 19 07:47:09 2003 GOTOU Yuuzou <gotoyuzo@notwork.org>
* ext/openssl/ossl_ssl.c: sync_close is moved to SSLSocket as
@@ -67258,7 +23537,7 @@ Fri Aug 15 23:15:00 2003 Shigeo Kobayashi <shigek@ruby-lang.org>
* ext/bigdecimal/lib/bigdecimal/math.rb: atan() & sqrt() added.
-Fri Aug 15 12:01:44 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Aug 15 12:01:43 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
* configure.in (HUGE_ST_INO): check whether struct stat.st_ino
is larger than long. [ruby-dev:21194]
@@ -67582,7 +23861,7 @@ Tue Aug 5 15:47:34 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
Tue Aug 5 10:04:42 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
- * string.c (str_new4): ptr may refer to null_str.
+ * string.c (str_new4): ptr may refer null_str.
Mon Aug 4 17:25:18 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
diff --git a/KNOWNBUGS.rb b/KNOWNBUGS.rb
deleted file mode 100644
index b97a08d928..0000000000
--- a/KNOWNBUGS.rb
+++ /dev/null
@@ -1,5 +0,0 @@
-#
-# This test file concludes tests which point out known bugs.
-# So all tests will cause failure.
-#
-
diff --git a/LEGAL b/LEGAL
index 991bb4dea9..908eb270f5 100644
--- a/LEGAL
+++ b/LEGAL
@@ -5,59 +5,34 @@ 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.
-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.
+regex.[ch]:
+
+ These files are under LGPL. Treat them as LGPL says. (See the file
+ LGPL for details)
+
+ Extended regular expression matching and search library.
+ Copyright (C) 1993, 94, 95, 96, 97, 98 Free Software Foundation, Inc.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+
+ The GNU C Library 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
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file LGPL. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+ Multi-byte extension added May, 1993 by t^2 (Takahiro Tanimoto)
+ Last change: May 21, 1993 by t^2
+ removed gapped buffer support, multiple syntax support by matz <matz@nts.co.jp>
+ Perl5 extension added by matz <matz@caelum.co.jp>
+ UTF-8 extension added Jan 16 1999 by Yoshida Masato <yoshidam@tau.bekkoame.ne.jp>
configure:
@@ -68,8 +43,8 @@ configure:
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:
+config.guess:
+config.sub:
parse.c:
As long as you distribute these files with the file configure, they
@@ -98,21 +73,6 @@ parse.c:
the same distribution terms that you use for the rest of that program.
util.c (partly):
-
- Copyright (c) 1991, 2000, 2001 by Lucent Technologies.
-
- Permission to use, copy, modify, and distribute this software for any
- purpose without fee is hereby granted, provided that this entire notice
- is included in all copies of any software which is or includes a copy
- or modification of this software and in all copies of the supporting
- documentation for such software.
-
- THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED
- WARRANTY. IN PARTICULAR, NEITHER THE AUTHOR NOR LUCENT MAKES ANY
- REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY
- OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.
-
-util.c (partly):
win32/win32.[ch]:
You can apply the Artistic License to these files. (or GPL,
@@ -171,6 +131,7 @@ random.c
email: matumoto@math.keio.ac.jp
st.[ch]:
+x68/*:
missing/alloca.c:
missing/dup2.c:
missing/finite.c:
@@ -179,16 +140,51 @@ missing/isinf.c:
missing/isnan.c:
missing/memcmp.c:
missing/memmove.c:
+missing/strcasecmp.c:
missing/strchr.c:
+missing/streror.c:
+missing/strftime.c:
+missing/strncasecmp.c:
missing/strstr.c:
missing/strtol.c:
ext/digest/sha1/sha1.[ch]:
These files are all under public domain.
+missing/strtod.c:
+
+ This file will not be used on most platforms depending on how the
+ configure script results. In any case you must not receive any fee
+ with the file itself.
+
+ Copyright (c) 1988-1993 The Regents of the University of California.
+ Copyright (c) 1994 Sun Microsystems, Inc.
+
+ Permission to use, copy, modify, and distribute this
+ software and its documentation for any purpose and without
+ fee is hereby granted, provided that the above copyright
+ notice appear in all copies. The University of California
+ makes no representations about the suitability of this
+ software for any purpose. It is provided "as is" without
+ express or implied warranty.
+
+missing/strtoul.c:
+
+ This file will not be used on most platforms depending on how the
+ configure script results. In any case you must not receive any fee
+ with the file itself.
+
+ Copyright 1988 Regents of the University of California
+
+ Permission to use, copy, modify, and distribute this
+ software and its documentation for any purpose and without
+ fee is hereby granted, provided that the above copyright
+ notice appear in all copies. The University of California
+ makes no representations about the suitability of this
+ software for any purpose. It is provided "as is" without
+ express or implied warranty.
+
missing/erf.c:
-missing/tgamma.c:
-missing/lgamma_r.c:
missing/crypt.c:
missing/vsnprintf.c:
@@ -230,47 +226,6 @@ missing/vsnprintf.c:
From ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change
paragraph 3 above is now null and void.
-missing/strlcat.c
-missing/strlcpy.c
-
- These files are under the new-style BSD license.
-
- Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
- All rights reserved.
-
- 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.
-
ext/digest/md5/md5.[ch]:
These files are under the following license. Ruby uses modified
@@ -309,7 +264,18 @@ ext/digest/rmd160/rmd160.[ch]:
Copyright (c) Katholieke Universiteit Leuven
1996, All Rights Reserved
+ext/digest/rmd160/rmd160hl.c:
+ext/digest/sha1/sha1hl.c:
+
+ These files are under the beer-ware license.
+
+ "THE BEER-WARE LICENSE" (Revision 42):
+ <phk@login.dkuug.dk> wrote this file. As long as you retain this notice you
+ can do whatever you want with this stuff. If we meet some day, and you think
+ this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
+
ext/digest/sha2/sha2.[ch]:
+ext/digest/sha2/sha2hl.c:
These files are under the new-style BSD license.
diff --git a/Makefile.in b/Makefile.in
index 9da6eb80d0..a37bcf65fb 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -1,22 +1,17 @@
SHELL = /bin/sh
NULLCMD = :
-RUNCMD = $(SHELL)
-CHDIR = @CHDIR@
-exec = exec
#### Start of system configuration section. ####
srcdir = @srcdir@
-top_srcdir = $(srcdir)
-hdrdir = $(srcdir)/include
+VPATH = $(srcdir):$(srcdir)/missing
CC = @CC@
-YACC = bison
+YACC = @YACC@
PURIFY =
AUTOCONF = autoconf
@SET_MAKE@
MKFILES = @MAKEFILES@
-BASERUBY = @BASERUBY@
prefix = @prefix@
exec_prefix = @exec_prefix@
@@ -29,27 +24,21 @@ datadir = @datadir@
arch = @arch@
sitearch = @sitearch@
sitedir = @sitedir@
-ruby_version = @ruby_version@
TESTUI = console
TESTS =
RDOCTARGET = @RDOCTARGET@
EXTOUT = @EXTOUT@
-arch_hdrdir = $(EXTOUT)/include/$(arch)
-VPATH = $(arch_hdrdir)/ruby:$(hdrdir)/ruby:$(srcdir):$(srcdir)/enc:$(srcdir)/missing
+RIDATADIR = $(DESTDIR)$(datadir)/ri/$(MAJOR).$(MINOR)/system
empty =
OUTFLAG = @OUTFLAG@$(empty)
-COUTFLAG = @COUTFLAG@$(empty)
-ARCH_FLAG = @ARCH_FLAG@
-CFLAGS = @CFLAGS@
+CFLAGS = @CFLAGS@ @XCFLAGS@ @ARCH_FLAG@
cflags = @cflags@
optflags = @optflags@
debugflags = @debugflags@
-warnflags = @warnflags@
-XCFLAGS = -I. -I$(arch_hdrdir) -I$(hdrdir) -I$(srcdir) @XCFLAGS@
-CPPFLAGS = @CPPFLAGS@
+CPPFLAGS = -I. -I$(srcdir) @CPPFLAGS@
LDFLAGS = @STATIC@ $(CFLAGS) @LDFLAGS@
EXTLDFLAGS =
XLDFLAGS = @XLDFLAGS@ $(EXTLDFLAGS)
@@ -57,15 +46,11 @@ EXTLIBS =
LIBS = @LIBS@ $(EXTLIBS)
MISSING = @LIBOBJS@ @ALLOCA@
LDSHARED = @LIBRUBY_LDSHARED@
-DLDFLAGS = @LIBRUBY_DLDFLAGS@ $(EXTLDFLAGS) $(ARCH_FLAG)
+DLDFLAGS = @LIBRUBY_DLDFLAGS@ $(EXTLDFLAGS) @ARCH_FLAG@
SOLIBS = @SOLIBS@
MAINLIBS = @MAINLIBS@
-ARCHMINIOBJS = @MINIOBJS@
-BUILTIN_ENCOBJS = @BUILTIN_ENCOBJS@
-BUILTIN_TRANSSRCS = @BUILTIN_TRANSSRCS@
-BUILTIN_TRANSOBJS = @BUILTIN_TRANSOBJS@
+MINIOBJS = @MINIOBJS@
-RUBY_BASE_NAME=@RUBY_BASE_NAME@
RUBY_INSTALL_NAME=@RUBY_INSTALL_NAME@
RUBY_SO_NAME=@RUBY_SO_NAME@
EXEEXT = @EXEEXT@
@@ -88,43 +73,23 @@ LIBRUBYARG = @LIBRUBYARG@
LIBRUBYARG_STATIC = @LIBRUBYARG_STATIC@
LIBRUBYARG_SHARED = @LIBRUBYARG_SHARED@
-THREAD_MODEL = @THREAD_MODEL@
-
PREP = @PREP@
ARCHFILE = @ARCHFILE@
SETUP =
EXTSTATIC = @EXTSTATIC@
-SET_LC_MESSAGES = env LC_MESSAGES=C
-MAKEDIRS = @MAKEDIRS@
-CP = cp
-MV = mv
RM = rm -f
-RMDIRS = @RMDIRS@
-RMALL = @RMALL@
NM = @NM@
AR = @AR@
ARFLAGS = rcu
RANLIB = @RANLIB@
AS = @AS@
ASFLAGS = @ASFLAGS@
-IFCHANGE = $(srcdir)/tool/ifchange
-SET_LC_MESSAGES = env LC_MESSAGES=C
-OBJDUMP = @OBJDUMP@
-OBJCOPY = @OBJCOPY@
-VCS = @VCS@
-VCSUP = @VCSUP@
OBJEXT = @OBJEXT@
-ASMEXT = S
-DLEXT = @DLEXT@
MANTYPE = @MANTYPE@
INSTALLED_LIST= .installed.list
-
-MKMAIN_CMD = mkmain.sh
-
-SRC_FILE = $<
#### End of variables
all:
@@ -135,8 +100,8 @@ all:
.NOEXPORT:
miniruby$(EXEEXT):
- @-if test -f $@; then mv -f $@ $@.old; $(RM) $@.old; fi
- $(PURIFY) $(CC) $(LDFLAGS) $(XLDFLAGS) $(MAINLIBS) $(MAINOBJ) $(MINIOBJS) $(COMMONOBJS) $(DMYEXT) $(ARCHFILE) $(LIBS) $(OUTFLAG)$@
+ @$(RM) $@
+ $(PURIFY) $(CC) $(LDFLAGS) $(XLDFLAGS) $(MAINLIBS) $(MAINOBJ) $(MINIOBJS) $(LIBRUBY_A) $(LIBS) $(OUTFLAG)$@
$(PROGRAM):
@$(RM) $@
@@ -153,18 +118,30 @@ $(LIBRUBY_A):
$(LIBRUBY_SO):
@-$(PRE_LIBRUBY_UPDATE)
$(LDSHARED) $(DLDFLAGS) $(OBJS) $(DLDOBJS) $(SOLIBS) $(OUTFLAG)$@
- -$(OBJCOPY) -w -L '@EXPORT_PREFIX@Init_*' $@
@-$(MINIRUBY) -e 'ARGV.each{|link| File.delete link if File.exist? link; \
File.symlink "$(LIBRUBY_SO)", link}' \
$(LIBRUBY_ALIASES) || true
-fake: $(arch)-fake.rb
-$(arch)-fake.rb: config.status
- @./config.status --file=$@:$(srcdir)/template/fake.rb.in
-
-Makefile: $(srcdir)/Makefile.in $(srcdir)/enc/Makefile.in
-
-$(MKFILES): config.status
+fake.rb: Makefile
+ @echo ' \
+ class Object; \
+ CROSS_COMPILING = RUBY_PLATFORM; \
+ remove_const :RUBY_PLATFORM; \
+ remove_const :RUBY_VERSION; \
+ RUBY_PLATFORM = "@arch@"; \
+ RUBY_VERSION = "@MAJOR@.@MINOR@.@TEENY@"; \
+ end; \
+ if RUBY_PLATFORM =~ /mswin|bccwin|mingw/; \
+ class File; \
+ remove_const :ALT_SEPARATOR; \
+ ALT_SEPARATOR = "\\"; \
+ end; \
+ end; \
+ ' > $@
+
+Makefile: $(srcdir)/Makefile.in
+
+$(MKFILES): config.status $(srcdir)/common.mk
MAKE=$(MAKE) $(SHELL) ./config.status
@{ \
echo "all:; -@rm -f conftest.mk"; \
@@ -174,116 +151,52 @@ $(MKFILES): config.status
$(MAKE) -f conftest.mk | grep '^AUTO_REMAKE$$' >/dev/null 2>&1 || \
{ echo "Makefile updated, restart."; exit 1; }
-uncommon.mk: $(srcdir)/common.mk
- sed 's/{\$$([^(){}]*)[^{}]*}//g' $< > $@
-
-config.status: $(srcdir)/configure $(srcdir)/enc/Makefile.in
- PWD= MINIRUBY="$(MINIRUBY)" $(SHELL) ./config.status --recheck
+config.status: $(srcdir)/configure
+ MINIRUBY="$(MINIRUBY)" $(SHELL) ./config.status --recheck
$(srcdir)/configure: $(srcdir)/configure.in
- $(CHDIR) $(srcdir) && exec $(AUTOCONF)
-
-incs: id.h
-id.h: parse.h $(srcdir)/tool/generic_erb.rb $(srcdir)/template/id.h.tmpl
- $(BASERUBY) $(srcdir)/tool/generic_erb.rb --output=$@ \
- $(srcdir)/template/id.h.tmpl --vpath=$(VPATH) parse.h
-
-# Things which should be considered:
-# * with gperf v.s. without 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
-# * XFS has a mtime with fractional part
-lex.c: defs/keywords
- @\
- if cmp -s $(srcdir)/defs/lex.c.src $?; then \
- set -x; \
- cp $(srcdir)/lex.c.blt $@; \
+ cd $(srcdir) && $(AUTOCONF)
+
+lex.c: keywords
+ ( gperf -C -p -j1 -i 1 -g -o -t -N rb_reserved_word -k1,3,$$ $? > $@.tmp && mv $@.tmp $@ ) || \
+ if test -f $@; then \
+ touch $@ && echo $@ touched.; \
else \
- 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; \
+ cp $(srcdir)/lex.c $@ && echo $@ copied.; \
fi
+.y.c:
+ $(YACC) $<
+ sed '/^#/s|y\.tab\.c|$@|' y.tab.c > $@
+ rm -f y.tab.c
+
.c.@OBJEXT@:
- $(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) $(COUTFLAG)$@ -c $<
+ $(CC) $(CFLAGS) $(CPPFLAGS) -c $<
.s.@OBJEXT@:
$(AS) $(ASFLAGS) -o $@ $<
-.c.S:
- $(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) $(COUTFLAG)$@ -S $<
-
-.c.i:
- $(CPP) $(XCFLAGS) $(CPPFLAGS) $(COUTFLAG)$@ -E $< > $@
-
clean-local::
- @$(RM) ext/extinit.c ext/extinit.$(OBJEXT) ext/ripper/y.output
+ @$(RM) ext/extinit.c ext/extinit.$(OBJEXT)
distclean-local::
- @$(RM) ext/config.cache $(RBCONFIG) Doxyfile
- @-$(RM) run.gdb
- @-$(RM) $(INSTALLED_LIST) $(arch_hdrdir)/ruby/config.h
- @-$(RMDIRS) $(arch_hdrdir)/ruby
-
-distclean-rdoc:
- @$(RMALL) $(RDOCOUT:/=\)
-
-clean-ext distclean-ext realclean-ext::
- @set dummy ${EXTS}; shift; \
- if test "$$#" = 0; then \
- set dummy `find ext -name Makefile | sed 's:^ext/::;s:/Makefile$$::' | sort`; \
- shift; \
- fi; \
- for dir; do \
- [ -f "ext/$$dir/Makefile" ] || continue; \
- echo $(@:-ext=)ing "$$dir"; \
- (cd "ext/$$dir" && exec $(MAKE) $(MFLAGS) $(@:-ext=)) && \
- case "$@" in \
- *distclean-ext*|*realclean-ext*) \
- $(RMDIRS) "ext/$$dir";; \
- esac; \
- done
-
-distclean-ext realclean-ext::
- @-rmdir ext 2> /dev/null || true
+ @$(RM) ext/config.cache $(RBCONFIG)
ext/extinit.$(OBJEXT): ext/extinit.c $(SETUP)
- $(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) $(COUTFLAG)$@ -c ext/extinit.c
-
-up::
- @$(CHDIR) "$(srcdir)" && LC_TIME=C exec $(VCSUP)
-
-update-mspec:
- @$(CHDIR) $(srcdir); \
- if [ -d spec/mspec ]; then \
- cd spec/mspec; \
- echo updating mspec ...; \
- exec git pull; \
+ $(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) $(OUTFLAG)$@ -c ext/extinit.c
+
+update-rubyspec:
+ if [ -d $(srcdir)/rubyspec ]; then \
+ cd $(srcdir)/rubyspec/mspec; \
+ git pull; \
+ cd ../spec/rubyspec; \
+ 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; \
+ git clone $(MSPEC_GIT_URL) $(srcdir)/rubyspec/mspec; \
+ git clone $(RUBYSPEC_GIT_URL) $(srcdir)/rubyspec/spec/rubyspec; \
fi
test-rubyspec:
- @if [ ! -d $(srcdir)/spec/rubyspec ]; then echo No rubyspec here. make update-rubyspec first.; exit 1; fi
- $(RUNRUBY) $(srcdir)/spec/mspec/bin/mspec -B $(srcdir)/spec/default.mspec $(MSPECOPT)
-
-INSNS = opt_sc.inc optinsn.inc optunifs.inc insns.inc insns_info.inc \
- vmtc.inc vm.inc
+ @if [ ! -d $(srcdir)/rubyspec ]; then echo No rubyspec here. make update-rubyspec first.; exit 1; fi
+ $(RUNRUBY) $(srcdir)/rubyspec/mspec/bin/mspec -r$(srcdir)/ext/purelib.rb $(srcdir)/rubyspec/spec/rubyspec/$(MAJOR).$(MINOR)
-$(INSNS): $(srcdir)/insns.def vm_opts.h $(srcdir)/defs/opt_operand.def $(srcdir)/defs/opt_insn_unif.def
- $(BASERUBY) -Ks $(srcdir)/tool/insns2vm.rb $(INSNS2VMOPT) $@
diff --git a/NEWS b/NEWS
index 83f10ff1e0..965ce6de5a 100644
--- a/NEWS
+++ b/NEWS
@@ -7,233 +7,632 @@ Note that each entry is kept so brief that no reason behind or
reference information is supplied with. For a full list of changes
with all sufficient information, see the ChangeLog file.
-== Changes since the 1.9.1 release
+* REXML
+
+ * REXML::Document.entity_expansion_limit=
+
+ New method to set the entity expansion limit. By default the limit is
+ set to 10000. See the following URL for details.
+
+ http://www.ruby-lang.org/en/news/2008/08/23/dos-vulnerability-in-rexml/
+
+== Changes since the 1.8.6 release
+
+=== Configuration changes
+
+* vendor_ruby directory
+
+ A new library directory named `vendor_ruby' is introduced in
+ addition to `site_ruby'. The idea is to separate libraries
+ installed by the package system (`vendor') from manually (`site')
+ installed libraries preventing the former from getting overwritten
+ by the latter, while preserving the user option to override vendor
+ libraries with site libraries. (`site_ruby' takes precedence over
+ `vendor_ruby')
+
+ If you are a package maintainer, make each library package configure
+ the library passing the `--vendor' option to `extconf.rb' so that
+ the library files will get installed under `vendor_ruby'.
+
+ You can change the directory locations using configure options such
+ as `--with-sitedir=DIR' and `--with-vendordir=DIR'.
+
+=== Global constants
+
+* new constants
+
+ * RUBY_COPYRIGHT
+ * RUBY_DESCRIPTION
=== Library updates (outstanding ones only)
+* new library
+
+ * securerandom
+
* builtin classes
- * Array
- * new method:
- * Array#sort_by!
+ * Array#flatten
+ * Array#flatten!
- * Dir
- * new method:
- * Dir.home
+ Takes an optional argument that determines the level of recursion
+ to flatten.
- * Enumerator
- * extended methods:
- * #with_index accepts an optional argument that specifies the
- index number to start with, defaulted to 0.
+ * Array#eql?
+ * Array#hash
+ * Array#==
+ * Array#<=>
- * incompatible changes:
- * #rewind now calls the "rewind" method of the enclosed object
- if defined.
+ Handle recursive data properly.
- * IO
- * new method:
- * IO#fdatasync
+ * Array#index
+ * Array#rindex
- * extended methods:
- * IO.pipe can take a block.
+ Take a block instead of an argument.
- * new modules:
- * IO::WaitReadable
- * IO::WaitWritable
- They are used to extend non-blocking exceptions.
+ * Array#collect!
+ * Array#map!
+ * Array#each
+ * Array#each_index
+ * Array#reverse_each
+ * Array#reject
+ * Array#reject!
+ * Array#delete_if
- * Process
- * extended methods:
- * Process.spawn accepts [:child, FD] for a redirect target.
+ Return an enumerator if no block is given.
- * String
- * extended methods:
- * string[regexp, name] is supported for named capture.
+ Note that #map and #collect still return an array unlike Ruby 1.9
+ to keep compatibility.
- * Time
- * extended feature:
- * time_t restriction is removed to represent before 1901 and after 2038.
- Proleptic Gregorian calendar is used for old dates.
- * Time.new have optional arguments to specify date with time offset.
- * Time#getlocal, Time#localtime have optional time offset argument.
+ * Array#pop
+ * Array#shift
- * new method:
- * Time#to_r
+ Take an optional argument specifying the number of elements to
+ remove.
- * incompatible changes:
- * The year argument of Time.{utc,gm,local,mktime} is now interpreted as
- the value itself. For example, Time.utc(99) means the year 99 AD,
- not 1999 AD.
+ * Array#choice
+ * Array#combination
+ * Array#cycle
+ * Array#drop
+ * Array#drop_while
+ * Array#permutation
+ * Array#product
+ * Array#shuffle
+ * Array#shuffle!
+ * Array#take,
+ * Array#take_while
- * Kernel
- * extended methods:
- * respond_to? can be used to detect methods not implemented.
- For example, Process.respond_to?(:fork) returns false on Windows.
+ New methods.
-* rss
+ * Binding#eval
- * 0.2.4 -> 0.2.7.
+ New method.
- * RSS::Maker.make
- * raise an exception not returns nil for invalid feed making.
- * requires block.
+ * Dir#each
+ * Dir#foreach
- * RSS::Maker.[]
- * new method to return maker class.
+ Return an enumerator if no block is given.
- * RSS::Maker.supported?(version)
- * new method to check whether given version is supported.
+ * Enumerable::Enumerator
- * RSS::Maker: item.guid.permanent_link?
- * new alias of item.guid.isPermaLink
- * RSS::Maker: item.guid.permanent_link=
- * new alias of item.guid.isPermaLink=
+ New class for various enumeration defined by the enumerator library.
-* REXML
+ * Enumerable#each_slice
+ * Enumerable#each_cons
+ * Object#to_enum
+ * Object#enum_for
- * REXML::Document.entity_expansion_limit=
+ New methods for various enumeration defined by the enumerator library.
- New method to set the entity expansion limit. By default the limit is
- set to 10000. See the following URL for details.
+ * Enumerable#count
+ * Enumerable#cycle
+ * Enumerable#drop
+ * Enumerable#drop_while
+ * Enumerable#find_index
+ * Enumerable#first
+ * Enumerable#group_by
+ * Enumerable#max_by
+ * Enumerable#min_by
+ * Enumerable#minmax
+ * Enumerable#minmax_by
+ * Enumerable#none?
+ * Enumerable#one?
+ * Enumerable#take
+ * Enumerable#take_while
- http://www.ruby-lang.org/en/news/2008/08/23/dos-vulnerability-in-rexml/
+ New methods.
+
+ * Enumerable#find
+ * Enumerable#find_all
+ * Enumerable#partition
+ * Enumerable#reject
+ * Enumerable#select
+ * Enumerable#sort_by
+
+ Return an enumerator if no block is given.
+
+ Note that #map and #collect still return an array unlike Ruby 1.9
+ to keep compatibility.
+
+ * Enumerable#inject
+
+ Accepts a binary operator instead of a block.
+
+ * Enumerable#reduce
+
+ New alias to #inject.
+
+ * Hash#eql?
+ * Hash#hash
+ * Hash#==
+
+ Handle recursive data properly.
+
+ * Hash#delete_if
+ * Hash#each
+ * Hash#each_key
+ * Hash#each_pair
+ * Hash#each_value
+ * Hash#reject!
+ * Hash#select
+ * ENV.delete_if
+ * ENV.each
+ * ENV.each_key
+ * ENV.each_pair
+ * ENV.each_value
+ * ENV.reject!
+ * ENV.select
+
+ Return an enumerator if no block is given.
+
+ * GC.stress
+ * GC.stress=
+
+ New methods.
+
+ * Integer#ord
+ * Integer#odd?
+ * Integer#even?
+ * Integer#pred
+
+ New methods.
+
+ * Integer#downto
+ * Integer#times
+ * Integer#upto
+
+ Return an enumerator if no block is given.
+
+ * IO#each
+ * IO#each_line
+ * IO#each_byte
+ * IO.foreach
+ * ARGF.each
+ * ARGF.each_line
+ * ARGF.each_byte
+
+ Return an enumerator if no block is given.
+
+ * IO#bytes
+ * IO#chars
+ * IO#each_char
+ * IO#getbyte
+ * IO#lines
+ * IO#readbyte
+ * ARGF.bytes
+ * ARGF.chars
+ * ARGF.each_char
+ * ARGF.getbyte
+ * ARGF.lines
+ * ARGF.readbyte
+
+ New methods.
+
+ * Method#name
+ * Method#owner
+ * Method#receiver
+ * UnboundMethod#name
+ * UnboundMethod#owner
+
+ New methods.
+
+ * Module#class_exec
+ * Module#module_exec
-* logger
-
- * imported upstream version (logger/1.2.7)
- * do not raise an exception even if log writing failed.
- * do not raise ShiftingError if an aged file already exists.
- (no ShiftingError will be raised from 1.2.7, just warn() instead)
-
-* open3
- * new methods:
- * Open3.popen2
- * Open3.popen2e
- * Open3.capture3
- * Open3.capture2
- * Open3.capture2e
- * Open3.pipeline_rw
- * Open3.pipeline_r
- * Open3.pipeline_w
- * Open3.pipeline_start
- * Open3.pipeline
-
-* pty
- * new method:
- * PTY.open
+ New methods.
+
+ * Numeric#step
+
+ Return an enumerator if no block is given.
+
+ * Object#instance_exec
+ * Object#tap
+
+ New methods.
+
+ * ObjectSpace.each_object
+
+ Return an enumerator if no block is given.
+
+ * Process.exec implemented.
+
+ * Range#each
+ * Range#step
+
+ Return an enumerator if no block is given.
+
+ * Regexp.union accepts an array of patterns.
+
+ * String#bytesize
+
+ New method, returning the size in bytes. (alias length and size)
+
+ * String#chars
+ * String#each_char
+ * String#partition
+ * String#rpartition
+ * String#start_with?
+ * String#end_with?
+
+ New methods. These are $KCODE aware unlike #index, #rindex and
+ #include?.
+
+ * String#each_byte
+ * String#each
+ * String#each_line
+ * String#gsub(pattern)
+
+ Return an enumerator if no block is given.
+
+ * String#upto
+
+ An optional second argument is added to specify if the last value
+ should be included.
+
+ * StopIteration
+
+ New exception class that causes Kernel#loop to stop iteration when
+ raised.
+
+ * Struct#each
+ * Struct#each_pair
+
+ Return an enumerator if no block is given.
+
+ * Symbol#to_proc
+
+ New method.
+
+ * __method__
+
+ New global function that returns the name of the current method as
+ a Symbol.
+
+* enumerator
+
+ * Enumerator is now a built-in module. The #next and #rewind
+ methods are implemented using the "generator" library. Use with
+ care and be aware of the performance loss.
+
+* ipaddr
+
+ * New methods
+ * IPAddr#<=>
+ * IPAddr#succ
+
+ IPAddr objects are now comparable and enumerable having these
+ methods. This also means that it is possible to have a Range
+ object between two IPAddr objects.
+
+ * IPAddr#to_range
+
+ A new method to create a Range object for the (network) address.
+
+ * Type coercion support
+ * IPAddr#&
+ * IPAddr#|
+ * IPAddr#==
+ * IPAddr#include?
+
+ These methods now accept a string or an integer instead of an
+ IPAddr object as the argument.
+
+* net/smtp
+
+ * Support SSL/TLS.
* openssl
- * new methods:
- * OpenSSL::Buffering#read_nonblock
- * OpenSSL::Buffering#write_nonblock
- * OpenSSL::SSL::SSLSocket#connect_nonblock
- * OpenSSL::SSL::SSLSocket#accept_nonblock
-
-* socket
-
- * incompatible changes:
- * Socket#{recvfrom,recvfrom_nonblock,accept,accept_nonblock,sysaccept}
- returns a sender address as Addrinfo object instead of a binary sockaddr string.
- Addrinfo#to_s returns the old binary sockaddr string.
- * BasicSocket#getsockopt returns Socket::Option object instead of a binary string.
- Socket::Option#to_s returns the old binary string.
-
- * new class:
- * Addrinfo
- * Socket::Option
- * Socket::AncillaryData
-
- * new methods:
- * Socket.ip_address_list
- * Socket.tcp
- * Socket.tcp_server_loop
- * Socket.tcp_server_sockets
- * Socket.unix
- * Socket.unix_server_loop
- * Socket.unix_server_socket
- * Socket.accept_loop
- * Socket#ipv6only!
- * BasicSocket#local_address
- * BasicSocket#remote_address
- * BasicSocket#connect_address
- * BasicSocket#sendmsg
- * BasicSocket#sendmsg_nonblock
- * BasicSocket#recvmsg
- * BasicSocket#recvmsg_nonblock
- * BasicSocket#getpeereid
-
- * extended methods:
- * Socket.new's 3rd argument is optional now.
- * Socket.pair's 3rd argument is optional now.
- * Socket.pair and UNIXSocket.pair can take a block.
- * BasicSocket#send, UDPSocket#send, Socket.getnameinfo, Socket#bind, and
- Socket#{connect,connect_nonblock} accepts an Addrinfo object as sockaddr.
- * BasicSocket#getsockopt accepts a Socket::Option object.
-
- * constant names can be accepted as well as constant values.
- i.e. Socket.new(:PF_INET, :SOCK_STREAM, 0)
- The constant names can be specified without the prefix.
- i.e. Socket.new(:INET, :STREAM, 0)
- * protocol/address family
- * socket type
- * socket option protocol level
- * socket option name
- * shutdown's argument
-
-* pathname
- * new methods:
- * Pathname#binread
- * Pathname#realdirpath
- * Pathname#each_child
-
-* Readline
- * new methods:
- * Readline.set_screen_size
- * Readline.get_screen_size
-
- * extended methods:
- * Readline.completion_proc= accepts nil.
- nil means to use default completion proc.
-
-* time
- * incompatible changes:
- * Time.parse raises ArgumentError when no date information.
-
-* securerandom
- * new methods:
- * SecureRandom.urlsafe_base64
-
-* etc
- * new methods:
- * Etc::Passwd.each
- * Etc::Group.each
-
-* zlib
- * new methods:
- * Zlib::GzipFile#path
-
-=== Compilation options
-
-* --program-prefix and --program-suffix no longer act on the shared object
- names nor paths to libraries.
-
- use --with-rubylibprefix='${libruby}/${RUBY_INSTALL_NAME}' and
- --with-soname='${RUBY_INSTALL_NAME}' for the same result as Ruby 1.9.1.
+
+ * New classes
+ * OpenSSL::PKey::EC
+ * OpenSSL::PKey::EC::Group
+ * OpenSSL::PKey::EC::Point
+ * OpenSSL::PKey::PKCS5
+ * OpenSSL::SSL::Session
+
+ * Documentation!
+
+ * Various new methods (see documentation).
+
+ * Remove redundant module namespace in Cipher, Digest, PKCS7, PKCS12.
+ Compatibility classes are provided which will be removed in Ruby 1.9.
+
+* shellwords
+
+ * Add methods for escaping shell-unsafe characters:
+ * Shellwords.join
+ * Shellwords.escape
+ * Array#shelljoin
+ * String#shellescape
+
+ * Add shorthand methods:
+ * Shellwords.split (alias shellwords)
+ * String#shellsplit
+
+* stringio
+
+ * StringIO#getbyte
+ * StringIO#readbyte
+
+ New methods. (aliases for compatibility with 1.9)
+
+ * StringIO#each_char
+ * StringIO#chars
+
+ New methods.
+
+ * StringIO#each
+ * StringIO#each_line
+ * StringIO#each_byte
+
+ Return an enumerator if no block is given.
+
+* tempfile
+
+ * Tempfile.open and Tempfile.new now accept a suffix for the
+ temporary file to be created. To specify a suffix, pass an array
+ of [basename, suffix] as the first argument.
+
+ Tempfile.open(['image', 'jpg']) { |tempfile| ... }
+
+* tmpdir
+
+ * New method:
+
+ * Dir.mktmpdir
+
+* uri
+
+ * added LDAPS scheme.
+ * Change for RFC3986:
+ * 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 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')
+ * URI('http://a/b/c/d;p?q').merge('/../g') == URI('http://a/g')
+ * URI('http://a/b/c/d;p?q').merge('../../../g') == URI('http://a/g')
+ * URI('http://a/b/c/d;p?q').merge('../../../../g') == URI('http://a/g')
+
+* rss
+
+ * 0.1.6 -> 0.2.4
+
+ * Fix image module URI
+
+ * Atom support
+
+ * ITunes module support
+
+ * Slash module support
+
+ * content:encoded with RSS 2.0 support
+
+=== Interpreter Implementation
+
+* passing a block to a Proc [experimental]
+
+ This implementation in current shape is known to be buggy/broken,
+ especially with nested block invocation. Take this as an
+ experimental feature.
+
+* stack trace
+
+ On non-SystemStackError exception, full stack trace is shown.
+
+=== Compatibility issues (excluding feature bug fixes)
+
+* String#slice! had some unintentional bugs and they have been fixed
+ because either they disagreed with documentation or their respective
+ behavior of #slice. Unfortunately, this causes some
+ incompatibilities in the following (somewhat rare) cases.
+
+ * #slice! no longer expands the array when an out-of-boundary value
+ is given.
+
+ # Ruby 1.8.6
+ a = [1,2]
+ a.slice!(4,0) #=> nil
+ a #=> [1,2,nil,nil]
+
+ # Ruby 1.8.7
+ a = [1,2]
+ a.slice!(4,0) #=> nil
+ a #=> [1,2]
+
+ * #slice! no longer raises an exception but returns nil when a
+ negative length or out-of-boundary negative position is given.
+
+ # Ruby 1.8.6
+ a = [1,2]
+ a.slice!(1,-1) #=> (raises IndexError)
+ a.slice!(-5,1) #=> (raises IndexError)
+
+ # Ruby 1.8.7
+ a = [1,2]
+ a.slice!(1,-1) #=> nil
+ a.slice!(-5,1) #=> nil
+
+* String#to_i, String#hex and String#oct no longer accept a sequence
+ of underscores (`__') as part of a number.
+
+ # Ruby 1.8.6
+ '1__0'.to_i #=> 10
+ '1__0'.to_i(2) #=> 2 # 0b10
+ '1__0'.oct #=> 8 # 010
+ '1__0'.hex #=> 16 # 0x10
+
+ # Ruby 1.8.7
+ '1__0'.to_i #=> 1
+ '1__0'.to_i(2) #=> 1
+ '1__0'.oct #=> 1
+ '1__0'.hex #=> 1
+
+ The old behavior was inconsistent with Ruby syntax and considered as
+ a bug.
+
+* date
+
+ * Date.parse
+
+ '##.##.##' (where each '#' is a digit) is now taken as 'YY.MM.DD'
+ instead of 'MM.DD.YY'. While the change may confuse you, you can
+ always use Date.strptime() when you know what you are dealing
+ with.
+
+* stringio
+
+ * StringIO#each_byte
+
+ The return value changed from nil to self. This is what the
+ document says and the same as each_line() does.
+
+* tempfile
+
+ * The file name format has changed. No dots are included by default
+ in temporary file names any more. See above for how to specify a
+ suffix.
+
+* uri
+
+ * See above for details.
+
+== Changes since the 1.8.5 release
+
+=== New platforms/build tools support
+
+* IA64 HP-UX
+
+* Visual C++ 8 SP1
+
+* autoconf 2.6x
+
+=== Global constants
+
+* RUBY_PATCHLEVEL
+
+ New constant since 1.8.5-p1.
+
+=== Library updates (outstanding ones only)
+
+* builtin classes
+
+ * New method: Kernel#instance_variable_defined?
+
+ * New method: Module#class_variable_defined?
+
+ * New feature: Dir::glob() can now take an array of glob patterns.
+
+* date
+
+ * Updated based on date2 4.0.3.
+
+* digest
+
+ * New internal APIs for C and Ruby.
+
+ * Support for autoloading.
+
+ require 'digest'
+
+ # autoloads digest/md5
+ md = Digest::MD5.digest("string")
+
+ * New digest class methods: file
+
+ * New digest instance methods: clone, reset, new, inspect,
+ digest_length (alias size or length), block_length()
+
+ * New library: digest/bubblebabble
+
+ * New function: Digest(name)
+
+* fileutils
+
+ * New option for FileUtils.cp_r(): :remove_destination
+
+* nkf
+
+ * Updated based on nkf as of 2007-01-28.
+
+* thread
+
+ * Replaced with much faster mutex implementation in C. The former
+ implementation, which is slow but considered to be stable, is
+ available with a configure option `--disable-fastthread'.
+
+* tk
+
+ * Updated Tile extension support based on Tile 0.7.8.
+
+ * Support --without-X11 configure option for non-X11 versions of
+ Tcl/Tk (e.g. Tcl/Tk Aqua).
+
+ * New sample script: irbtkw.rbw -- IRB on Ruby/Tk. It has no trouble
+ about STDIN blocking on Windows.
+
+* webrick
+
+ * New method: WEBrick::Cookie.parse_set_cookies()
=== Compatibility issues (excluding feature bug fixes)
- * Enumerator#rewind
- * Socket#recvfrom
- * Socket#recvfrom_nonblock
- * Socket#accept
- * Socket#accept_nonblock
- * Socket#sysaccept
- * BasicSocket#getsockopt
- * Time.utc
- * Time.gm
- * Time.local
- * Time.mktime
- * Time.parse
- * --program-prefix and --program-suffix
-
- See above.
+* builtin classes
+
+ * String#intern now raises SecurityError when $SAFE level is greater
+ than zero.
+
+* date
+
+ * Time#to_date and Time#to_datetime are added as private methods.
+ They cause name conflict error in ActiveSupport 1.4.1 and prior,
+ which comes with Rails 1.2.2 and prior. Updating ActiveSupport
+ and/or Rails to the latest versions fixes the problem.
+
+* digest
+
+ * The constructor does no longer take an initial string to feed.
+ The following examples show how to migrate:
+
+ # Before
+ md = Digest::MD5.new("string")
+ # After (works with any version)
+ md = Digest::MD5.new.update("string")
+
+ # Before
+ hd = Digest::MD5.new("string").hexdigest
+ # After (works with any version)
+ hd = Digest::MD5.hexdigest("string")
+
+* fileutils
+
+ * A minor implementation change breaks Rake <=0.7.1.
+ Updating Rake to 0.7.2 or higher fixes the problem.
+
+* tk
+
+ * Tk::X_Scrollable (Y_Scrollable) is renamed to Tk::XScrollable
+ (YScrollable). Tk::X_Scrollable (Y_Scrollable) is still available,
+ but it is an alias name.
diff --git a/README b/README
index 7e8370ec59..1b79781367 100644
--- a/README
+++ b/README
@@ -16,9 +16,8 @@ Perl). It is simple, straight-forward, and extensible.
+ Iterators and Closures
+ Garbage Collection
+ Dynamic Loading of Object files(on some architecture)
- + Highly Portable (works on many Unix-like/POSIX compatible platforms
- as well as Windows, Mac OS X, BeOS etc.)
- cf. http://redmine.ruby-lang.org/wiki/ruby-19/SupportedPlatforms
+ + Highly Portable(works on many UNIX machines, and on DOS,
+ Windows, Mac, BeOS etc.)
* How to get Ruby
@@ -27,6 +26,11 @@ The Ruby distribution files can be found in the following FTP site:
ftp://ftp.ruby-lang.org/pub/ruby/
+The latest source code of this version series can be checked out
+through SVN with the following command:
+
+ $ svn co http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8/
+
The trunk of the Ruby source tree can be checked out with the
following command:
diff --git a/README.EXT b/README.EXT
index da0f6148f1..637b19d25b 100644
--- a/README.EXT
+++ b/README.EXT
@@ -31,12 +31,10 @@ The Ruby interpreter has the following data types:
T_STRING string
T_REGEXP regular expression
T_ARRAY array
+ T_FIXNUM Fixnum(31bit integer)
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
@@ -48,8 +46,9 @@ In addition, there are several other types used internally:
T_ICLASS
T_MATCH
T_UNDEF
+ T_VARMAP
+ T_SCOPE
T_NODE
- T_ZOMBIE
Most of the types are represented by C structures.
@@ -79,8 +78,7 @@ 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.
+which raises an exception if the VALUE does not have the type specified.
There are also faster check macros for fixnums and nil.
@@ -94,44 +92,37 @@ respectively. They are singletons for the data type.
The T_FIXNUM data is a 31bit length fixed integer (63bit length on
some machines), which can be converted to a C integer by using the
-FIX2INT() macro or FIX2LONG(). Though you have to check that the
-data is really FIXNUM before using them, they are faster. FIX2LONG()
-never raises exceptions, but FIX2INT() raises RangeError if the
-result is bigger or smaller than the size of int.
-There are also NUM2INT() and NUM2LONG() which converts any Ruby
-numbers into C integers. These macros includes a type check,
-so an exception will be raised if the conversion failed. NUM2DBL()
-can be used to retrieve the double float value in the same way.
-
-You can use the macros
+FIX2INT() macro. There is also NUM2INT() which converts any Ruby
+numbers into C integers. The NUM2INT() macro includes a type check, so
+an exception will be raised if the conversion failed. NUM2DBL() can
+be used to retrieve the double float value in the same way.
+
+In version 1.7 or later it is recommended that you use the new macros
StringValue() and StringValuePtr() to get a char* from a VALUE.
StringValue(var) replaces var's value with the result of "var.to_str()".
StringValuePtr(var) does same replacement and returns char*
-representation of var. These macros will skip the replacement if var
-is a String. Notice that the macros take only the lvalue as their
+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 gurantee to exist nul at the end of the
-result, and the result may contain nul.
+In version 1.6 or earlier, STR2CSTR() was used to do the same thing
+but now it is deprecated in version 1.7, because STR2CSTR() has a risk
+of a dangling pointer problem in the to_str() impliclit conversion.
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".
+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".
-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)'. For arrays,
-use `RARRAY_LEN(ary)' and `RARRAY_PTR(ary)' respectively.
+For example, `RSTRING(str)->len' is the way to get the size of the
+Ruby String object. The allocated region can be accessed by
+`RSTRING(str)->ptr'. For arrays, use `RARRAY(ary)->len' and
+`RARRAY(ary)->ptr' respectively.
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.
+are responsible for the result. This ends up being the cause of interesting
+bugs.
1.4 Convert C data into VALUE
@@ -161,10 +152,9 @@ range, but is a bit slower.
1.5 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:
+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
@@ -173,7 +163,6 @@ listed below:
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)).
@@ -184,41 +173,13 @@ listed below:
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.
-
rb_str_cat(VALUE str, const char *ptr, long len)
Appends len bytes of data from ptr to the Ruby string.
- rb_str_cat2(VALUE str, const char* ptr)
-
- Appends C string ptr to Ruby string str. This function is
- equivalent to rb_str_cat(str, ptr, strlen(ptr)).
-
- rb_str_catf(VALUE str, const char* format, ...)
- rb_str_vcatf(VALUE str, const char* format, va_list ap)
-
- Appends C string format and successive arguments to Ruby string
- str according to a printf-like format. These functions are
- equivalent to rb_str_cat2(str, rb_sprintf(format, ...)) and
- rb_str_cat2(str, rb_vsprintf(format, ap)), respectively.
-
- rb_enc_str_new(const char *ptr, long len, rb_encoding *enc)
-
- Creates a new Ruby string with the specified encoding.
-
- rb_usascii_str_new(const char *ptr, long len)
- rb_usascii_str_new_cstr(const char *ptr)
-
- Creates a new Ruby string with encoding US-ASCII.
-
Array functions
rb_ary_new()
@@ -238,35 +199,17 @@ listed below:
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)
-
- Equivaelent to Array#[].
-
- rb_ary_entry(VALUE ary, long offset)
-
- ary[offset]
-
- 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)
+ Array operations. The first argument to each functions must be an
+ array. They may dump core if other types are given.
2. Extending Ruby with C
-2.1 Adding new features to Ruby
+2.1 Addding new features to Ruby
You can add new features (classes, methods, etc.) to the Ruby
interpreter. Ruby provides APIs for defining the following things:
@@ -321,23 +264,15 @@ will be called like:
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 2.2.2 for IDs.
-
- void rb_define_method_id(VALUE klass, ID name,
- VALUE (*func)(ANYARGS), int argc)
-
-There are two functions to define private/protected methods:
+There are two more functions to define methods. One is to define
+private 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_funcion defines a module functions,
-which are private AND singleton methods of the module.
-For example, sqrt is the module function defined in Math module.
-It can be called in the following way:
+The other is to define module functions, which are private AND singleton
+methods of the module. For example, sqrt is the module function
+defined in Math module. It can be called in the following way:
Math.sqrt(4)
@@ -360,10 +295,6 @@ To define an alias for the method,
void rb_define_alias(VALUE module, const char* new, const char* old);
-To define an reader/writer to 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));
@@ -397,26 +328,14 @@ evaluate the string as Ruby program. This function will do the job:
Evaluation is done under the current context, thus current local variables
of the innermost method (which is defined by Ruby) can be accessed.
-Note that the evaluation can raise an exception. There is a safer
-function:
-
- VALUE rb_eval_string_protect(const char *str, int *state)
-
-It returns nil when an error occur. And *state is zero if str was
-successfully evaluated, or nonzero otherwise.
-
-
2.2.2 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:
+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
@@ -447,8 +366,8 @@ specified by the symbol mid.
2.2.4 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.
+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:
@@ -497,30 +416,23 @@ function below.
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,
+ void rb_define_hooked_variable(constchar *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:
+This function defines a Ruby global variable without a corresponding C
+variable. The value of the variable will be set/get only by hooks.
- VALUE (*getter)(ID id);
- void (*setter)(VALUE val, ID id);
+The prototypes of the getter and setter functions are as follows:
+ (*getter)(ID id, void *data, struct global_entry* entry);
+ (*setter)(VALUE val, ID id, void *data, struct global_entry* entry);
3.3 Encapsulate C data into a Ruby object
@@ -536,10 +448,6 @@ 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)
@@ -593,8 +501,7 @@ the library.
Here's the example of an initializing function.
--
-void
-Init_dbm(void)
+Init_dbm()
{
/* define DBM class */
cDBM = rb_define_class("DBM", rb_cObject);
@@ -628,8 +535,8 @@ struct dbmdata {
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.
+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:
@@ -649,7 +556,8 @@ methods with a fixed number of arguments receive arguments like this:
--
static VALUE
-fdbm_delete(VALUE obj, VALUE keystr)
+fdbm_delete(obj, keystr)
+ VALUE obj, keystr;
{
:
}
@@ -663,7 +571,10 @@ arguments like this:
--
static VALUE
-fdbm_s_open(int argc, VALUE *argv, VALUE klass)
+fdbm_s_open(argc, argv, klass)
+ int argc;
+ VALUE *argv;
+ VALUE klass;
{
:
if (rb_scan_args(argc, argv, "11", &file, &vmode) == 1) {
@@ -678,17 +589,16 @@ 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.
-
+arguments. For example, "11" means that the method requires at least one
+argument, and at most receives two arguments.
-The following is an example of a method that takes arguments by Ruby's
-array:
+Methods with an arbitrary number of arguments can receive arguments
+by Ruby's array, like this:
--
static VALUE
-thread_initialize(VALUE thread, VALUE args)
+fdbm_indexes(obj, args)
+ VALUE obj, args;
{
:
}
@@ -786,121 +696,53 @@ 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
- -> parse.c : automatically generated
- keywords : reserved keywords
- -> lex.c : automatically generated
-
-ruby evaluator (a.k.a. YARV)
- blockinlining.c
- compile.c
+ class.c
+ error.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 swiching
- 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
+ gc.c
+ object.c
+ parse.y
+ variable.c
utility functions
- debug.c : debug symbols for C debuggger
- dln.c : dynamic loading
- st.c : general purpose hash table
- strftime.c : formatting times
- util.c : misc utilities
+ dln.c
+ regex.c
+ st.c
+ util.c
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.c : String
- struct.c : Struct
- time.c : Time
-
- defs/knwon_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
-
+ array.c
+ bignum.c
+ compar.c
+ dir.c
+ enum.c
+ file.c
+ hash.c
+ io.c
+ marshal.c
+ math.c
+ numeric.c
+ pack.c
+ prec.c
+ process.c
+ random.c
+ range.c
+ re.c
+ signal.c
+ sprintf.c
+ string.c
+ struct.c
+ time.c
Appendix B. Ruby extension API reference
@@ -956,17 +798,10 @@ void Check_SafeStr(VALUE value)
** Data type conversion
-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)
+FIX2INT(value)
+INT2FIX(i)
+NUM2INT(value)
+INT2NUM(i)
NUM2DBL(value)
rb_float_new(f)
StringValue(value)
@@ -1079,42 +914,11 @@ 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 [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
-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-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 iterator block, is
-returned.
+Retrieve argument from argc, argv. The fmt is the format string for
+the arguments, such as "12" for 1 non-optional argument, 2 optional
+arguments. If `*' appears at the end of fmt, it means the rest of
+the arguments are assigned to the corresponding variable, packed in
+an array.
** Invoking Ruby method
@@ -1159,23 +963,12 @@ 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, supplying func as the block. func will receive the
-value from yield as the first argument, data2 as the second, and
-argc/argv as the third/fourth arguments.
-
- [OBSOLETE] VALUE rb_iterate(VALUE (*func1)(), void *arg1, VALUE (*func2)(), void *arg2)
+ VALUE rb_iterate(VALUE (*func1)(), void *arg1, VALUE (*func2)(), void *arg2)
Calls the function func1, supplying func2 as the block. func1 will be
called with the argument arg1. func2 receives the value from yield as
the first argument, arg2 as the second argument.
-When rb_iterate is used in 1.9, func1 has to call some Ruby-level method.
-This function is obsolete since 1.9; use rb_block_call instead.
-
VALUE rb_yield(VALUE val)
Evaluates the block with value val.
@@ -1245,7 +1038,7 @@ 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)
+ void rb_add_event_hook(rb_event_hook_func_t func, rb_event_t events)
Adds a hook function for the specified interpreter events.
events should be Or'ed value of:
@@ -1262,57 +1055,13 @@ events should be Or'ed value of:
The definition of rb_event_hook_func_t is below:
- typedef void (*rb_event_hook_func_t)(rb_event_t event, VALUE data,
+ typedef void (*rb_event_hook_func_t)(rb_event_t event, NODE *node,
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 the Compatibilities
-
-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 correspoinding 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 in extconf.rb
These functions are available in extconf.rb:
@@ -1376,7 +1125,7 @@ this method, the compilation will not be done.
find_executable(bin, path)
Finds command in path, which is File::PATH_SEPARATOR-separated list of
-directories. If path is nil or omitted, environment variable PATH
+directories. If path is nil or omitted, environment varialbe PATH
will be used. Returns the path name of the command if it is found,
otherwise nil.
@@ -1405,7 +1154,7 @@ Returns an array of the added directories ([include_dir, lib_dir]).
pkg_config(pkg)
Obtains the information for pkg by pkg-config command. The actual
-command name can be overridden by --with-pkg-config command line
+command name can be overriden by --with-pkg-config command line
option.
/*
diff --git a/README.EXT.ja b/README.EXT.ja
index c6b5dfed9f..73425c2cdb 100644
--- a/README.EXT.ja
+++ b/README.EXT.ja
@@ -35,12 +35,10 @@ Rubyˤϥ桼ȤǽΤʲΥפޤ
T_STRING ʸ
T_REGEXP ɽ
T_ARRAY
+ T_FIXNUM Fixnum(31bitĹ)
T_HASH Ϣ
T_STRUCT (Ruby)¤
T_BIGNUM ¿Ĺ
- T_FIXNUM Fixnum(31bitޤ63bitĹ)
- T_COMPLEX ʣǿ
- T_RATIONAL ͭ
T_FILE
T_TRUE
T_FALSE
@@ -52,8 +50,9 @@ Rubyˤϥ桼ȤǽΤʲΥפޤ
T_ICLASS
T_MATCH
T_UNDEF
+ T_VARMAP
+ T_SCOPE
T_NODE
- T_ZOMBIE
ۤȤɤΥפCι¤ΤǼƤޤ
@@ -96,40 +95,28 @@ FIXNUMNIL˴ؤƤϤ®Ƚ̥ޥѰդƤޤ
1.3 VALUECΥǡѴ
-ǡפT_NILT_FALSET_TRUEǤǡϤ줾
-nilfalsetrueǤΥǡפΥ֥ȤϤҤ
+ǡפ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 ʸޤޤƤǽ⤢ޤ
+ǡפT_FIXNUMλ31bitΥ
+FIXNUMCѴ뤿ˤϥޥFIX2INT()פ
+ޤ줫顤FIXNUM˸¤餺RubyΥǡѴ
+NUM2INT()פȤޥޤΥޥϥǡ
+פΥå̵ǻȤޤ(ѴǤʤˤ㳰
+ȯ)Ʊͤ˥å̵ǻȤѴޥdouble
+ФNUM2DBL()פޤ
+
+char* Ф硢version 1.6 ǤϡSTR2CSTR()פ
+ޥȤäƤޤ to_str() ˤۤ
+Ѵ̤ GC ǽ뤿ᡢversion 1.7 ʹߤǤ
+obsolete Ȥʤꡢ StringValue() StringValuePtr()
+Ȥ侩ƤޤStringValue(var) var String
+ Ǥв⤻Ǥʤ var var.to_str() η̤
+֤ޥStringValuePtr(var) Ʊͤ var ֤
+Ƥ var ʸɽФ char* ֤ޥǤvar
+Ƥľ֤Τǡvar lvalue Ǥɬפ
ʳΥǡפбCι¤Τޤб
빽¤ΤΤVALUEϤΤޤޥ㥹(Ѵ)й¤Τ
@@ -142,11 +129,10 @@ var lvalue Ǥɬפޤ
ruby.hǤϹ¤Τإ㥹ȤޥRXXXXX()(ʸ
ˤ)Ȥ̾󶡤Ƥޤ(: RSTRING())
-¤ΤǡФޥ󶡤Ƥޤʸ
-strĹ뤿ˤϡRSTRING_LEN(str)פȤʸstr
-char*Ȥ뤿ˤϡRSTRING_PTR(str)פȤޤ
-ˤϡ줾RARRAY_LEN(ary)סRARRAY_PTR(ary)פ
-ʤޤ
+㤨СʸstrĹ뤿ˤϡRSTRING(str)->lenפ
+ʸstrchar*Ȥ뤿ˤϡRSTRING(str)->ptr
+Ȥޤξˤϡ줾RARRAY(ary)->lenס
+RARRAY(ary)->ptrפȤʤޤ
Rubyι¤Τľܥ˵ĤʤФʤʤ
Ȥϡʸι¤ΤȤϻȤǡľѹ
@@ -179,8 +165,7 @@ FIXNUM˴ؤƤѴޥͳɬפޤC
VALUEѴޥϰʲΤΤޤɬפ˱
ƻȤʬƤ
- INT2FIX() Ȥ31bitޤ63bit˼ޤ뼫
-
+ INT2FIX() Ȥ31bit˼ޤ뼫
INT2NUM() ǤդVALUE
INT2NUM()FIXNUMϰϤ˼ޤʤ硤BignumѴ
@@ -202,13 +187,11 @@ RubyѰդƤؿѤƤ
Rubyʸ롥
rb_str_new2(const char *ptr)
- rb_str_new_cstr(const char *ptr)
Cʸ󤫤Rubyʸ롥δؿεǽ
rb_str_new(ptr, strlen(ptr))ƱǤ롥
rb_tainted_str_new(const char *ptr, long len)
- rb_tainted_str_new_cstr(const char *ptr)
ޡղä줿Rubyʸ롥
Υǡ˴Ťʸˤϱޡղä٤
@@ -218,39 +201,10 @@ RubyѰդƤؿѤƤ
Cʸ󤫤ޡղä줿Rubyʸ롥
- rb_sprintf(const char *format, ...)
- rb_vsprintf(const char *format, va_list ap)
-
- Cʸformat³printf(3)ΥեޥåȤˤä
- Rubyʸ롥
-
rb_str_cat(VALUE str, const char *ptr, long len)
RubyʸstrlenХȤʸptrɲä롥
- rb_str_cat2(VALUE str, const char* ptr)
-
- RubyʸstrCʸ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)
-
- ꤵ줿󥳡ǥ󥰤Rubyʸ.
-
- rb_usascii_str_new(const char *ptr, long len)
- rb_usascii_str_new_cstr(const char *ptr)
-
- 󥳡ǥ󥰤US-ASCIIRubyʸ.
-
-
Фؿ
rb_ary_new()
@@ -270,32 +224,14 @@ RubyѰդƤؿѤƤ
Ϳ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_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)
+ ArrayƱ̾Υ᥽åɤƱƯ򤹤ؿ1ɬ
+ ǤʤФʤʤ
+
2RubyεǽȤ
ŪRubyǽ񤱤뤳ȤCǤ񤱤ޤRubyΤΤCǵ
@@ -358,26 +294,19 @@ 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ʥ᥽åɤդĤδؿޤ.
+᥽åɤؿϤ⤦ĤޤҤȤĤprivate
+åɤؿǡrb_define_method()ƱǤ
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()ʤɤޤΥ᥽åɤ
+⤦ҤȤĤϥ⥸塼ؿΤǤ⥸塼ؿ
+Ȥϥ⥸塼ðۥ᥽åɤǤꡤƱprivate᥽åɤ
+⤢ΤǤ򤢤Math⥸塼sqrt()ʤɤ
+ޤΥ᥽åɤ
Math.sqrt(4)
@@ -398,24 +327,20 @@ private᥽åɤǤ⤢ΤǤ򤢤Math⥸塼
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ϥ饹ȤƼäơƤ줿
-󥹤֤ʤƤϤʤޤ󡥤Υ󥹥󥹤ϡ
-ʤɤޤޤʤǤֶפΤޤޤˤƤۤ
-褤Ǥ礦
+funcϥ饹ȤƼäơƤ줿
+󥹤֤ʤƤϤʤޤ󡣤Υ󥹥󥹤ϡ
+ʤɤޤޤʤǤֶפΤޤޤˤƤۤ
+褤Ǥ礦
2.1.3
@@ -449,26 +374,16 @@ CRubyεǽƤӽФäȤñˡȤơʸ
ɾϸߤδĶǹԤޤĤޤꡤߤΥѿ
ʤɤѤޤ
-ɾ㳰ȯ뤫⤷ʤȤդޤ礦.
-ʴؿ⤢ޤ.
-
- VALUE rb_eval_string_protect(const char *str, int *state)
-
-δؿϥ顼ȯnil֤ޤơˤ
-*stateϥˡʤ󥼥ˤʤޤ
-
-
2.2.2 IDޤϥܥ
CʸͳRubyΥ᥽åɤƤӽФȤǤ
ˡRuby󥿥ץ꥿ǥ᥽åɤѿ̾ꤹ
˻ȤƤIDˤĤƤޤ礦
-IDȤѿ̾᥽å̾ɽǤRubyǤ
+IDȤѿ̾᥽å̾ɽǤRubyǤIDб
+֥ȤȤƥܥ(Symbol)ꡤ
- :"Ǥդʸ"
ǥǤޤC餳뤿ˤϴؿ
@@ -479,6 +394,14 @@ IDȤѿ̾᥽å̾ɽǤRubyǤ
rb_to_id(VALUE symbol)
+ID饷ܥ뤿ˤϰʲΥޥȤޤ
+
+ VALUE ID2SYM(ID id)
+
+ܥ뤫ID뤿ˤϰʲΥޥȤޤ
+
+ ID SYM2ID(VALUE symbol)
+
2.2.3 CRubyΥ᥽åɤƤӽФ
CʸͳRubyΥ᥽åɤƤӽФˤϰʲ
@@ -560,17 +483,11 @@ CRubyѿȤäƾͭǤޤͭǤ
ѿȤ줿ˤϴؿgetterѿͤåȤ
ˤϴؿsetterƤФ롥hookꤷʤgetter
setter0ꤷޤ
-# gettersetter0ʤrb_define_variable()Ʊˤʤ롥
-
-gettersetterλͤϼ̤Ǥ
-
- VALUE (*getter)(ID id, VALUE *var);
- void (*setter)(VALUE val, ID id, VALUE *var);
+# gettersetter0ʤrb_define_variable()Ʊˤʤ롥
-줫顤бCѿʤRubyѿ
-ȤǤޤ. ѿͤϥեåؿΤߤˤäƼ
-ޤ.
+줫顤CδؿˤäƼ¸Rubyѿ
+ؿޤ
void rb_define_virtual_variable(const char *name,
VALUE (*getter)(), void (*setter)())
@@ -580,8 +497,8 @@ getterѿͤåȤ줿ˤsetterƤФޤ
gettersetterλͤϰʲ̤Ǥ
- (*getter)(ID id);
- (*setter)(VALUE val, ID id);
+ (*getter)(ID id, void *data, struct global_entry* entry);
+ (*setter)(VALUE val, ID id, void *data, struct global_entry* entry);
3.3 CΥǡRuby֥Ȥˤ
@@ -608,11 +525,6 @@ freeϤι¤Τ⤦פˤʤä˸ƤФؿǤ
ؿ١쥯ƤФޤ줬-1ξϡñ
˳ޤ
-markfreeؿGC¹˸ƤӽФޤ.
-ʤ, GC¹Ruby֥ȤΥ϶ػߤ
-. ä, markfreeؿRuby֥ȤΥ
-ϹԤʤǤ.
-
Cι¤ΤγData֥ȤƱ˹Ԥޥ
ưʲΤΤ󶡤Ƥޤ
@@ -672,8 +584,7 @@ Rubyϳĥ饤֥ɤˡInit_饤֥̾פ
Ԥޤdbm.cѤޤ
--
-void
-Init_dbm(void)
+Init_dbm()
{
/* DBM饹 */
cDBM = rb_define_class("DBM", rb_cObject);
@@ -735,7 +646,8 @@ fdbm_delete()ϤΤ褦ˤʤäƤޤ
--
static VALUE
-fdbm_delete(VALUE obj, VALUE keystr)
+fdbm_delete(obj, keystr)
+ VALUE obj, keystr;
{
:
}
@@ -751,7 +663,10 @@ fdbm_delete(VALUE obj, VALUE keystr)
--
static VALUE
-fdbm_s_open(int argc, VALUE *argv, VALUE klass)
+fdbm_s_open(argc, argv, klass)
+ int argc;
+ VALUE *argv;
+ VALUE klass;
{
:
if (rb_scan_args(argc, argv, "11", &file, &vmode) == 1) {
@@ -766,17 +681,22 @@ fdbm_s_open(int argc, VALUE *argv, VALUE klass)
ޤ
Ϳ줿Ϥ뤿δؿopen()ǤȤ
-Ƥrb_scan_args()Ǥ3˻ꤷեޥåȤ˽
-4ѿʹߤ˻ꤷVALUEؤλȤͤƤ
-
-
-
-RubyȤƼ᥽åɤˤ
-Thread#initializeޤϤǤ
+Ƥrb_scan_args()Ǥ3˻ꤷեޥåȤ
+4ѿʹߤ˻ꤷѿͤƤޤ
+եޥåȤϡ1ʸܤάǤʤο2ʸܤ
+άǤο3ʸܤб̵꤬ޤΰ
+뤫ɤ򼨤"*"Ǥ2ʸܤ3ʸܤϾάǤ
+dbm.cǤϡեޥåȤ"11"Ǥ顤Ϻ1
+ǡ2ĤޤǵȤ̣ˤʤޤάƤ
+ѿͤnil(CΥ٥ǤQnil)ˤʤޤ
+
+RubyǰΤindexesޤϤ
--
static VALUE
-thread_initialize(VALUE thread, VALUE args)
+fdbm_indexes(obj, args)
+ VALUE obj, args;
{
:
}
@@ -815,9 +735,9 @@ Makefileοˤʤextconf.rbȤե
$LDFLAGS: 󥯻ɲŪ˻ꤹե饰(-Lʤ)
$objs: 󥯤륪֥ȥե̾Υꥹ
-֥ȥեΥꥹȤϡ̾ϥե򸡺
-ƼưŪޤmakeǥ褦
-Ū˻ꤹɬפޤ
+֥ȥեΥꥹȤϡ̾ϥե򸡺
+ƼưŪޤmakeǥ褦
+Ū˻ꤹɬפޤ
饤֥򥳥ѥ뤹郎·鷺Υ饤֥򥳥
ѥ뤷ʤˤcreate_makefileƤФʤMakefile
@@ -845,7 +765,7 @@ Makefileºݤ뤿ˤ
ȤƤ
-site_ruby ǥ쥯ȥǤʤ
+site_ruby ǥ쥯ȥǤʤ
vendor_ruby ǥ쥯ȥ˥󥹥ȡ뤹ˤ
ʲΤ褦 --vendor ץäƤ
@@ -893,120 +813,53 @@ RubyΥϤĤʬह뤳ȤޤΤ
RubyΥ
- class.c : 饹ȥ⥸塼
- error.c : 㳰饹㳰
- gc.c : ΰ
- load.c : 饤֥Υ
- object.c : ֥
- variable.c : ѿ
-
-Rubyιʸϴ
- parse.y : ϴȹʸ
- -> parse.c : ư
- keywords : ͽ
- -> lex.c : ư
-
-Rubyɾ(̾YARV)
- blockinlining.c
- compile.c
+ class.c
+ error.c
eval.c
- eval_error.c
- eval_jump.c
- eval_safe.c
- insns.def : ۵
- iseq.c : VM::ISeqμ
- thread.c : åɴȥƥڤؤ
- thread_win32.c : åɼ
- thread_pthread.c : Ʊ
- vm.c
- vm_dump.c
- vm_eval.c
- vm_exec.c
- vm_insnhelper.c
- vm_method.c
-
- opt_insns_unif.def : ̿ͻ
- opt_operand.def : ŬΤ
-
- -> insn*.inc : ư
- -> opt*.inc : ư
- -> vm.inc : ư
-
-ɽ󥸥 ()
- regex.c
- regcomp.c
- regenc.c
- regerror.c
- regexec.c
- regparse.c
- regsyntax.c
+ gc.c
+ object.c
+ parse.y
+ variable.c
桼ƥƥؿ
- debug.c : CǥХåѤΥǥХåܥ
- dln.c : ưŪǥ
- st.c : ѥϥåɽ
- strftime.c :
- util.c : ¾Υ桼ƥƥ
+ dln.c
+ regex.c
+ st.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.c : String
- struct.c : Struct
- time.c : Time
-
- defs/knwon_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 : ư
-
+ array.c
+ bignum.c
+ compar.c
+ dir.c
+ enum.c
+ file.c
+ hash.c
+ io.c
+ marshal.c
+ math.c
+ numeric.c
+ pack.c
+ prec.c
+ process.c
+ random.c
+ range.c
+ re.c
+ signal.c
+ sprintf.c
+ string.c
+ struct.c
+ time.c
Appendix B. ĥѴؿե
@@ -1064,17 +917,10 @@ void Check_SafeStr(VALUE 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)
+FIX2INT(value)
+INT2FIX(i)
+NUM2INT(value)
+INT2NUM(i)
NUM2DBL(value)
rb_float_new(f)
StringValue(value)
@@ -1178,38 +1024,13 @@ rb_define_singleton_method(VALUE klass, const char *name, VALUE (*func)(), int a
rb_scan_args(int argc, VALUE *argv, const char *fmt, ...)
- argc, argvͿ줿ꤵ줿եޥåȤ˽äư
- ʬ򤷡³VALUEؤλȤ˥åȤޤΥեޥ
- ȤϡABNFǵҤȰʲ̤Ǥ
-
---
-scan-arg-spec := param-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
-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-block-arg := "&" ; ƥ졼֥å뤿
- ;
---
-
- եޥåȤ"12"ξ硤Ϻ1Ĥǡ3(1+2)ޤǵ
- Ȥ̣ˤʤޤäơեޥåʸ³
- 3ĤVALUEؤλȤ֤ɬפޤˤϼ
- ѿåȤޤѿؤλȤNULLꤹ
- ȤǤξϼͤϼΤƤޤʤ
- άǽά줿ѿͤnil(CΥ٥Ǥ
- Qnil)ˤʤޤ
-
- ֤ͤͿ줿οǤƥ졼֥åϿ
-
+ argc, argvͿ줿ʬ򤹤롥fmtɬܰο,
+ ղðο, Ĥΰ뤫ꤹʸ, "
+ *"ȤǤ롥 2 ܤο"*"Ϥ줾ά
+ ǽǤ롥ɬܰĤʤ0ꤹ롥3
+ ߤѿؤΥݥ󥿤, Ǥѿ˳Ǽ롥
+ ղðбͿƤʤѿQnil
+ 롥
** Ruby᥽åɸƤӽФ
@@ -1236,12 +1057,12 @@ char *rb_id2name(ID id)
char *rb_class2name(VALUE klass)
- 饹֤̾(ǥХå)饹̾ʤ
- , ̤ä̾ĥ饹֤̾
+ 饹֤̾(ǥХå)饹̾ʤˤ,
+ ̤ä̾ĥ饹֤̾
int rb_respond_to(VALUE obj, ID id)
- objidǼ᥽åɤĤɤ֤
+ objidǼ᥽åɤĤɤ֤
** 󥹥ѿ
@@ -1258,23 +1079,12 @@ VALUE rb_iv_set(VALUE obj, const char *name, VALUE val)
** 湽¤
-VALUE rb_block_call(VALUE obj, ID mid, int argc, VALUE * argv,
- VALUE (*func) (ANYARGS), VALUE data2)
-
- func֥åȤꤷ, obj쥷, argcargv
- Ȥmid᥽åɤƤӽФ. funcyield줿
- , data2, 軰, Ͱargcargv.
-
-[OBSOLETE] VALUE rb_iterate(VALUE (*func1)(), VALUE arg1, VALUE (*func2)(), VALUE arg2)
+VALUE rb_iterate(VALUE (*func1)(), VALUE arg1, VALUE (*func2)(), VALUE arg2)
func2֥åȤꤷ, func1򥤥ƥ졼ȤƸƤ֡
func1ˤ arg1ȤϤ, func2ˤ1˥ƥ졼
Ϳ줿, 2arg2Ϥ롥
- 1.9rb_iterateȤ, func1Ruby٥Υ᥽å
- ƤӽФʤФʤʤ.
- 1.9obsoleteȤʤä. rb_block_callѰդ줿.
-
VALUE rb_yield(VALUE val)
valͤȤƥƥ졼֥åƤӽФ
@@ -1341,77 +1151,6 @@ 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ǻȤؿ
@@ -1436,10 +1175,10 @@ find_library(lib, func, path...)
have_func(func, header)
- إåեheader򥤥󥯥롼ɤƴؿfunc¸ߤ
- å롥funcɸǤϥ󥯤ʤ饤֥ΤΤ
- ˤhave_libraryǤΥ饤֥åƤ
- ؿ¸ߤtrue֤
+ إåեheader򥤥󥯥롼ɤƴؿfunc¸ߤ
+ 롥funcɸǤϥ󥯤ʤ饤֥ΤΤǤ
+ ˤhave_libraryǤΥ饤֥åƤ
+ ؿ¸ߤtrue֤
have_var(var, header)
@@ -1490,8 +1229,7 @@ find_executable(command, path)
with_config(withval[, default=nil])
- ޥɥ饤--with-<withval>ǻꤵ줿ץ
- 롥
+ ޥɥ饤--with-<withval>ǻꤵ줿ץͤ롥
enable_config(config, *defaults)
disable_config(config, *defaults)
@@ -1500,9 +1238,8 @@ disable_config(config, *defaults)
--disable-<config>ǻꤵ줿ͤ롥
--enable-<config>ꤵƤtrue
--disable-<config>ꤵƤfalse֤
- ɤꤵƤʤϡ֥åĤǸƤӽФ
- *defaultsyield̡֥åʤʤ
- *defaults֤
+ ɤꤵƤʤϡ֥åĤǸƤӽФƤ
+ *defaultsyield̡֥åʤʤ*defaults֤
dir_config(target[, default_dir])
dir_config(target[, default_include, default_lib])
@@ -1511,8 +1248,8 @@ dir_config(target[, default_include, default_lib])
--with-<target>-libΤ줫ǻꤵǥ쥯ȥ
$CFLAGS $LDFLAGS ɲä롥--with-<target>-dir=/path
--with-<target>-include=/path/include --with-<target>-lib=/path/lib
- Ǥ롥ɲä줿 include ǥ쥯ȥ lib ǥ
- ȥ֤ ([include_dir, lib_dir])
+ Ǥ롥ɲä줿 include ǥ쥯ȥ lib ǥ쥯ȥ
+ ֤ ([include_dir, lib_dir])
pkg_config(pkg)
diff --git a/README.ja b/README.ja
index 2191720a26..71ce4ee12c 100644
--- a/README.ja
+++ b/README.ja
@@ -20,9 +20,9 @@ RubyϥƥȽطǽϤʤɤͥ졤PerlƱ餤
+ ƥ졼ȥ
+ ١쥯
+ ʥߥåǥ (ƥˤ)
- + ܿ⤤¿Unix-like/POSIXߴץåȥե
- ưǤʤWindows Mac OS XBeOSʤɤξǤư
- cf. http://redmine.ruby-lang.org/wiki/ruby-19/SupportedPlatformsJa
+ + ܿ⤤¿UNIXưǤʤDOSWindows
+ MacBeOSʤɤξǤư
+
* ˡ
@@ -34,6 +34,10 @@ RubyϥƥȽطǽϤʤɤͥ졤PerlƱ餤
** Subversion
+ܥ֥RubyκǿΥɤϼΥޥɤǼǤޤ
+
+ $ svn co http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8/
+
ȯüΥɤϼΥޥɤǼǤޤ
$ svn co http://svn.ruby-lang.org/repos/ruby/trunk/ ruby
@@ -130,14 +134,15 @@ UNIXǤconfigureۤȤɤκۤۼƤϤ
ȤݡȤСǤ뤫Τޤ
ƥˤäȤ¸ΤGCǤRubyGCо
-Υƥ㤬setjmp()ޤgetcontext()ˤäƤΥ
-jmp_bufucontext_t˳Ǽ뤳Ȥȡjmp_buf
-ucontext_tȥå32bit饤ȤƤ뤳Ȥ
-ƤޤäԤΩʤб˺Ǥ
-ԤβŪñǡgc.cǥåޡƤ
-ʬ˥饤ȤΥХȿ餷ƥޡ륳ɤ
-ɲäǺѤߤޤdefined(__mc68000__)פdzƤ
-ʬ򻲹ͤˤƤ
+Υƥ㤬setjmp()ˤäƤΥ쥸 jmp_buf
+Ǽ뤳Ȥȡjmp_bufȥå32bit饤Ȥ
+뤳ȤꤷƤޤäԤΩʤб
+˺Ǥ礦ԤβŪñǡgc.cǥå
+ޡƤʬ˥饤ȤΥХȿ餷ƥޡ
+륳ɤɲäǺѤߤޤdefined(THINK_C)פ
+Ƥʬ򻲹ͤˤƤ
+
+# ºݤˤRubyThink CǤϥѥǤޤ
쥸ɥCPUǤϡ쥸ɥ򥹥
˥եå夹륢֥饳ɤɲäɬפ뤫
diff --git a/ToDo b/ToDo
index 7e5ef523a8..b55e399edf 100644
--- a/ToDo
+++ b/ToDo
@@ -2,10 +2,6 @@ Language Spec.
- Class#allocate - basicNew
- class Foo::Bar<Baz .. end, module Boo::Bar .. end
-- raise exception by `` error
-- a +1 to be a+1, not a(+1).
-- clarify evaluation order of operator argument (=~, .., ...)
-- :symbol => value hash in the form of {symbol: value, ...} ??
* operator !! for rescue. ???
* objectify characters
* ../... outside condition invokes operator method too.
@@ -18,6 +14,7 @@ Language Spec.
* def Class#method .. end ??
* def Foo::Bar::baz() .. end ??
* I18N (or M17N) script/string/regexp
+* Fixnum 0 as false ????
* discourage use of symbol variables (e.g. $/, etc.) in manual
* discourage use of Perlish features by giving warnings.
* non confusing in-block local variable (is it possible?)
@@ -25,9 +22,12 @@ Language Spec.
+ variables appears within block may have independent values.
* Regexp: make /o thread safe.
* decide whether begin with rescue or ensure make do..while loop.
+* a +1 to be a+1, not a(+1).
* unify == and eql? again
* to_i returns nil if str contains no digit.
+* raise exception by `` error
* jar like combined library package. -> RubyGems?
+* resumable Exception via Exception#resume.
* method combination, e.g. before, after, around, etc.
* .. or something like defadvice in Emacs.
* property - for methods, or for objects in general.
@@ -35,6 +35,8 @@ Language Spec.
* selector namespace - something like generic-flet in CLOS, to help RubyBehavior
* private instance variable (as in Python?) @_foo in class Foo => @_Foo_foo
* warn/error "bare word" method, like "foo", you should type "foo()"
+* clarify evaluation order of operator argument (=~, .., ...)
+* :symbol => value hash in the form of {symbol: value, ...} ??
Hacking Interpreter
@@ -81,7 +83,7 @@ Standard Libraries
- use Mersenne Twister RNG for random.
- deprecate Array#indexes, and Array#indices.
- remove dependency on MAXPATHLEN.
-- String#scanf(?)
+* String#scanf(?)
* Object#fmt(?)
* Time::strptime
* Integer[num], Float[num]; Fixnum[num]?
@@ -115,7 +117,7 @@ Extension Libraries
Ruby Libraries
-- urllib.rb, nttplib.rb, etc.
+* urllib.rb, nttplib.rb, etc.
* format like perl's
Tools
diff --git a/array.c b/array.c
index a0dc6434ea..89f74d01ff 100644
--- a/array.c
+++ b/array.c
@@ -3,32 +3,29 @@
array.c -
$Author$
+ $Date$
created at: Fri Aug 6 09:46:12 JST 1993
- Copyright (C) 1993-2007 Yukihiro Matsumoto
+ Copyright (C) 1993-2003 Yukihiro Matsumoto
Copyright (C) 2000 Network Applied Communication Laboratory, Inc.
Copyright (C) 2000 Information-technology Promotion Agency, Japan
**********************************************************************/
-#include "ruby/ruby.h"
-#include "ruby/util.h"
-#include "ruby/st.h"
-
-#ifndef ARRAY_DEBUG
-# define NDEBUG
-#endif
-#include <assert.h>
+#include "ruby.h"
+#include "util.h"
+#include "st.h"
VALUE rb_cArray;
-
static ID id_cmp;
#define ARY_DEFAULT_SIZE 16
-#define ARY_MAX_SIZE (LONG_MAX / (int)sizeof(VALUE))
+#define ARY_MAX_SIZE (LONG_MAX / sizeof(VALUE))
void
-rb_mem_clear(register VALUE *mem, register long size)
+rb_mem_clear(mem, size)
+ register VALUE *mem;
+ register long size;
{
while (size--) {
*mem++ = Qnil;
@@ -36,242 +33,48 @@ rb_mem_clear(register VALUE *mem, register long size)
}
static inline void
-memfill(register VALUE *mem, register long size, register VALUE val)
+memfill(mem, size, val)
+ register VALUE *mem;
+ register long size;
+ register VALUE val;
{
while (size--) {
*mem++ = val;
}
}
-# 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_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_OWNS_HEAP_P(a) (!FL_TEST(a, ELTS_SHARED|RARRAY_EMBED_FLAG))
-#define FL_SET_EMBED(a) do { \
- assert(!ARY_SHARED_P(a)); \
- assert(!OBJ_FROZEN(a)); \
- FL_SET(a, RARRAY_EMBED_FLAG); \
-} 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)); \
- FL_SET(ary, ELTS_SHARED); \
-} while (0)
-#define FL_UNSET_SHARED(ary) FL_UNSET(ary, ELTS_SHARED)
-
-#define ARY_SET_PTR(ary, p) do { \
- assert(!ARY_EMBED_P(ary)); \
- assert(!OBJ_FROZEN(ary)); \
- RARRAY(ary)->as.heap.ptr = (p); \
-} while (0)
-#define ARY_SET_EMBED_LEN(ary, n) do { \
- long tmp_n = n; \
- assert(ARY_EMBED_P(ary)); \
- assert(!OBJ_FROZEN(ary)); \
- RBASIC(ary)->flags &= ~RARRAY_EMBED_LEN_MASK; \
- RBASIC(ary)->flags |= (tmp_n) << RARRAY_EMBED_LEN_SHIFT; \
-} while (0)
-#define ARY_SET_HEAP_LEN(ary, n) do { \
- assert(!ARY_EMBED_P(ary)); \
- RARRAY(ary)->as.heap.len = n; \
-} while (0)
-#define ARY_SET_LEN(ary, n) do { \
- if (ARY_EMBED_P(ary)) { \
- ARY_SET_EMBED_LEN(ary, n); \
- } \
- else { \
- ARY_SET_HEAP_LEN(ary, n); \
- } \
- assert(RARRAY_LEN(ary) == n); \
-} while (0)
-#define ARY_INCREASE_PTR(ary, n) do { \
- assert(!ARY_EMBED_P(ary)); \
- assert(!OBJ_FROZEN(ary)); \
- RARRAY(ary)->as.heap.ptr += n; \
-} while (0)
-#define ARY_INCREASE_LEN(ary, n) do { \
- assert(!OBJ_FROZEN(ary)); \
- if (ARY_EMBED_P(ary)) { \
- ARY_SET_EMBED_LEN(ary, RARRAY_LEN(ary)+n); \
- } \
- else { \
- RARRAY(ary)->as.heap.len += n; \
- } \
-} while (0)
-
-#define ARY_CAPA(ary) (ARY_EMBED_P(ary) ? RARRAY_EMBED_LEN_MAX : \
- 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)); \
- assert(!OBJ_FROZEN(ary)); \
- RARRAY(ary)->as.heap.aux.capa = (n); \
-} while (0)
-
-#define ARY_SHARED(ary) (assert(ARY_SHARED_P(ary)), RARRAY(ary)->as.heap.aux.shared)
-#define ARY_SET_SHARED(ary, value) do { \
- assert(!ARY_EMBED_P(ary)); \
- assert(ARY_SHARED_P(ary)); \
- assert(ARY_SHARED_ROOT_P(value)); \
- RARRAY(ary)->as.heap.aux.shared = (value); \
-} while (0)
-#define RARRAY_SHARED_ROOT_FLAG FL_USER5
-#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_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)); \
- FL_SET(ary, RARRAY_SHARED_ROOT_FLAG); \
-} while (0)
-
-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 = 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 {
- REALLOC_N(RARRAY(ary)->as.heap.ptr, VALUE, (capacity));
- }
- ARY_SET_CAPA(ary, (capacity));
- }
- else {
- if (!ARY_EMBED_P(ary)) {
- long len = RARRAY_LEN(ary);
- VALUE *ptr = RARRAY_PTR(ary);
- if (len > capacity) len = capacity;
- MEMCPY(RARRAY(ary)->as.ary, ptr, VALUE, len);
- FL_SET_EMBED(ary);
- ARY_SET_LEN(ary, len);
- xfree(ptr);
- }
- }
-}
-
-static void
-ary_double_capa(VALUE ary, long min)
-{
- long new_capa = ARY_CAPA(ary) / 2;
-
- if (new_capa < ARY_DEFAULT_SIZE) {
- new_capa = ARY_DEFAULT_SIZE;
- }
- if (new_capa >= ARY_MAX_SIZE - min) {
- new_capa = (ARY_MAX_SIZE - min) / 2;
- }
- new_capa += min;
- ary_resize_capa(ary, new_capa);
-}
-
-static void
-rb_ary_decrement_share(VALUE shared)
-{
- if (shared) {
- long num = ARY_SHARED_NUM(shared) - 1;
- if (num == 0) {
- rb_ary_free(shared);
- rb_gc_force_recycle(shared);
- }
- else if (num > 0) {
- ARY_SET_SHARED_NUM(shared, num);
- }
- }
-}
-
-static void
-rb_ary_unshare(VALUE ary)
-{
- VALUE shared = RARRAY(ary)->as.heap.aux.shared;
- rb_ary_decrement_share(shared);
- FL_UNSET_SHARED(ary);
-}
+#define ARY_TMPLOCK FL_USER1
static inline void
-rb_ary_unshare_safe(VALUE ary)
-{
- if (ARY_SHARED_P(ary) && !ARY_EMBED_P(ary)) {
- rb_ary_unshare(ary);
- }
-}
-
-static VALUE
-rb_ary_increment_share(VALUE shared)
-{
- long num = ARY_SHARED_NUM(shared);
- if (num >= 0) {
- ARY_SET_SHARED_NUM(shared, num + 1);
- }
- return shared;
-}
-
-static void
-rb_ary_set_shared(VALUE ary, VALUE shared)
-{
- rb_ary_increment_share(shared);
- FL_SET_SHARED(ary);
- ARY_SET_SHARED(ary, shared);
-}
-
-static inline void
-rb_ary_modify_check(VALUE ary)
+rb_ary_modify_check(ary)
+ VALUE ary;
{
if (OBJ_FROZEN(ary)) rb_error_frozen("array");
- if (!OBJ_UNTRUSTED(ary) && rb_safe_level() >= 4)
+ if (FL_TEST(ary, ARY_TMPLOCK))
+ rb_raise(rb_eRuntimeError, "can't modify array during iteration");
+ if (!OBJ_TAINTED(ary) && rb_safe_level() >= 4)
rb_raise(rb_eSecurityError, "Insecure: can't modify array");
}
static void
-rb_ary_modify(VALUE ary)
+rb_ary_modify(ary)
+ VALUE ary;
{
+ VALUE *ptr;
+
rb_ary_modify_check(ary);
- if (ARY_SHARED_P(ary)) {
- long len = RARRAY_LEN(ary);
- if (len <= RARRAY_EMBED_LEN_MAX) {
- VALUE *ptr = ARY_HEAP_PTR(ary);
- VALUE shared = ARY_SHARED(ary);
- FL_UNSET_SHARED(ary);
- FL_SET_EMBED(ary);
- MEMCPY(ARY_EMBED_PTR(ary), ptr, VALUE, len);
- rb_ary_decrement_share(shared);
- ARY_SET_EMBED_LEN(ary, len);
- }
- else {
- VALUE *ptr = ALLOC_N(VALUE, len);
- MEMCPY(ptr, RARRAY_PTR(ary), VALUE, len);
- rb_ary_unshare(ary);
- ARY_SET_CAPA(ary, len);
- ARY_SET_PTR(ary, ptr);
- }
+ if (FL_TEST(ary, ELTS_SHARED)) {
+ ptr = ALLOC_N(VALUE, RARRAY(ary)->len);
+ FL_UNSET(ary, ELTS_SHARED);
+ RARRAY(ary)->aux.capa = RARRAY(ary)->len;
+ MEMCPY(ptr, RARRAY(ary)->ptr, VALUE, RARRAY(ary)->len);
+ RARRAY(ary)->ptr = ptr;
}
}
VALUE
-rb_ary_freeze(VALUE ary)
+rb_ary_freeze(ary)
+ VALUE ary;
{
return rb_obj_freeze(ary);
}
@@ -285,62 +88,79 @@ rb_ary_freeze(VALUE ary)
*/
static VALUE
-rb_ary_frozen_p(VALUE ary)
+rb_ary_frozen_p(ary)
+ VALUE ary;
{
if (OBJ_FROZEN(ary)) return Qtrue;
+ if (FL_TEST(ary, ARY_TMPLOCK)) return Qtrue;
return Qfalse;
}
+static VALUE ary_alloc _((VALUE));
static VALUE
-ary_alloc(VALUE klass)
+ary_alloc(klass)
+ VALUE klass;
{
NEWOBJ(ary, struct RArray);
OBJSETUP(ary, klass, T_ARRAY);
- FL_SET_EMBED((VALUE)ary);
- ARY_SET_EMBED_LEN((VALUE)ary, 0);
+
+ ary->len = 0;
+ ary->ptr = 0;
+ ary->aux.capa = 0;
return (VALUE)ary;
}
static VALUE
-ary_new(VALUE klass, long capa)
+ary_new(klass, len)
+ VALUE klass;
+ long len;
{
- VALUE ary;
+ VALUE ary = ary_alloc(klass);
- if (capa < 0) {
+ if (len < 0) {
rb_raise(rb_eArgError, "negative array size (or size too big)");
}
- if (capa > ARY_MAX_SIZE) {
+ if (len > ARY_MAX_SIZE) {
rb_raise(rb_eArgError, "array size too big");
}
- ary = ary_alloc(klass);
- if (capa > RARRAY_EMBED_LEN_MAX) {
- FL_UNSET_EMBED(ary);
- ARY_SET_PTR(ary, ALLOC_N(VALUE, capa));
- ARY_SET_CAPA(ary, capa);
- ARY_SET_HEAP_LEN(ary, 0);
- }
+ if (len == 0) len++;
+ RARRAY(ary)->ptr = ALLOC_N(VALUE, len);
+ RARRAY(ary)->aux.capa = len;
return ary;
}
VALUE
-rb_ary_new2(long capa)
+rb_ary_new2(len)
+ long len;
{
- return ary_new(rb_cArray, capa);
+ return ary_new(rb_cArray, len);
}
VALUE
-rb_ary_new(void)
+rb_ary_new()
{
- return rb_ary_new2(RARRAY_EMBED_LEN_MAX);
+ return rb_ary_new2(ARY_DEFAULT_SIZE);
}
+#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
VALUE
+#ifdef HAVE_STDARG_PROTOTYPES
rb_ary_new3(long n, ...)
+#else
+rb_ary_new3(n, va_alist)
+ long n;
+ va_dcl
+#endif
{
va_list ar;
VALUE ary;
@@ -348,153 +168,84 @@ rb_ary_new3(long n, ...)
ary = rb_ary_new2(n);
- va_start(ar, n);
+ va_init_list(ar, n);
for (i=0; i<n; i++) {
- RARRAY_PTR(ary)[i] = va_arg(ar, VALUE);
+ RARRAY(ary)->ptr[i] = va_arg(ar, VALUE);
}
va_end(ar);
- ARY_SET_LEN(ary, n);
+ RARRAY(ary)->len = n;
return ary;
}
VALUE
-rb_ary_new4(long n, const VALUE *elts)
+rb_ary_new4(n, elts)
+ long n;
+ const VALUE *elts;
{
VALUE ary;
ary = rb_ary_new2(n);
if (n > 0 && elts) {
- MEMCPY(RARRAY_PTR(ary), elts, VALUE, n);
- ARY_SET_LEN(ary, n);
+ MEMCPY(RARRAY(ary)->ptr, elts, VALUE, n);
}
- return ary;
-}
+ /* This assignment to len will be moved to the above "if" block in Ruby 1.9 */
+ RARRAY(ary)->len = n;
-VALUE
-rb_ary_tmp_new(long capa)
-{
- return ary_new(0, capa);
-}
-
-void
-rb_ary_free(VALUE ary)
-{
- if (ARY_OWNS_HEAP_P(ary)) {
- xfree(ARY_HEAP_PTR(ary));
- }
-}
-
-size_t
-rb_ary_memsize(VALUE ary)
-{
- if (ARY_OWNS_HEAP_P(ary)) {
- return RARRAY(ary)->as.heap.aux.capa * sizeof(VALUE);
- }
- else {
- return 0;
- }
-}
-
-static inline void
-ary_discard(VALUE ary)
-{
- rb_ary_free(ary);
- RBASIC(ary)->flags |= RARRAY_EMBED_FLAG;
- RBASIC(ary)->flags &= ~RARRAY_EMBED_LEN_MASK;
+ return ary;
}
static VALUE
-ary_make_shared(VALUE ary)
+ary_make_shared(ary)
+ VALUE ary;
{
- assert(!ARY_EMBED_P(ary));
- if (ARY_SHARED_P(ary)) {
- return ARY_SHARED(ary);
- }
- else if (ARY_SHARED_ROOT_P(ary)) {
- return ary;
- }
- else if (OBJ_FROZEN(ary)) {
- ary_resize_capa(ary, ARY_HEAP_LEN(ary));
- FL_SET_SHARED_ROOT(ary);
- ARY_SET_SHARED_NUM(ary, 0);
- return ary;
- }
- else {
+ if (!FL_TEST(ary, ELTS_SHARED)) {
NEWOBJ(shared, struct RArray);
- OBJSETUP(shared, 0, T_ARRAY);
- FL_UNSET_EMBED(shared);
-
- ARY_SET_LEN((VALUE)shared, RARRAY_LEN(ary));
- ARY_SET_PTR((VALUE)shared, RARRAY_PTR(ary));
- FL_SET_SHARED_ROOT(shared);
- ARY_SET_SHARED_NUM((VALUE)shared, 1);
- FL_SET_SHARED(ary);
- ARY_SET_SHARED(ary, (VALUE)shared);
+ OBJSETUP(shared, rb_cArray, T_ARRAY);
+
+ shared->len = RARRAY(ary)->len;
+ shared->ptr = RARRAY(ary)->ptr;
+ shared->aux.capa = RARRAY(ary)->aux.capa;
+ RARRAY(ary)->aux.shared = (VALUE)shared;
+ FL_SET(ary, ELTS_SHARED);
OBJ_FREEZE(shared);
return (VALUE)shared;
}
-}
-
-
-static VALUE
-ary_make_substitution(VALUE ary)
-{
- if (RARRAY_LEN(ary) <= RARRAY_EMBED_LEN_MAX) {
- VALUE subst = rb_ary_new2(RARRAY_LEN(ary));
- MEMCPY(ARY_EMBED_PTR(subst), RARRAY_PTR(ary), VALUE, RARRAY_LEN(ary));
- ARY_SET_EMBED_LEN(subst, RARRAY_LEN(ary));
- return subst;
- }
else {
- return rb_ary_increment_share(ary_make_shared(ary));
+ return RARRAY(ary)->aux.shared;
}
}
VALUE
-rb_assoc_new(VALUE car, VALUE cdr)
+rb_assoc_new(car, cdr)
+ VALUE car, cdr;
{
- return rb_ary_new3(2, car, cdr);
+ VALUE ary;
+
+ ary = rb_ary_new2(2);
+ RARRAY(ary)->ptr[0] = car;
+ RARRAY(ary)->ptr[1] = cdr;
+ RARRAY(ary)->len = 2;
+
+ return ary;
}
static VALUE
-to_ary(VALUE ary)
+to_ary(ary)
+ VALUE ary;
{
return rb_convert_type(ary, T_ARRAY, "Array", "to_ary");
}
VALUE
-rb_check_array_type(VALUE ary)
+rb_check_array_type(ary)
+ VALUE ary;
{
return rb_check_convert_type(ary, T_ARRAY, "Array", "to_ary");
}
-/*
- * call-seq:
- * Array.try_convert(obj) -> array or nil
- *
- * Try to convert <i>obj</i> into an array, using to_ary method.
- * Returns converted array or nil if <i>obj</i> cannot be converted
- * for any reason. This method is to check if an argument is an
- * array.
- *
- * Array.try_convert([1]) # => [1]
- * Array.try_convert("1") # => nil
- *
- * if tmp = Array.try_convert(arg)
- * # the argument is an array
- * elsif tmp = String.try_convert(arg)
- * # the argument is a string
- * end
- *
- */
-
-static VALUE
-rb_ary_s_try_convert(VALUE dummy, VALUE ary)
-{
- return rb_check_array_type(ary);
-}
+static VALUE rb_ary_replace _((VALUE, VALUE));
/*
* call-seq:
@@ -515,45 +266,43 @@ rb_ary_s_try_convert(VALUE dummy, VALUE ary)
* Array.new
* Array.new(2)
* Array.new(5, "A")
- *
+ *
* # only one copy of the object is created
* a = Array.new(2, Hash.new)
* a[0]['cat'] = 'feline'
* a
* a[1]['cat'] = 'Felix'
* a
- *
+ *
* # here multiple copies are created
* a = Array.new(2) { Hash.new }
* a[0]['cat'] = 'feline'
* a
- *
+ *
* squares = Array.new(5) {|i| i*i}
* squares
- *
+ *
* copy = Array.new(squares)
*/
static VALUE
-rb_ary_initialize(int argc, VALUE *argv, VALUE ary)
+rb_ary_initialize(argc, argv, ary)
+ int argc;
+ VALUE *argv;
+ VALUE ary;
{
long len;
VALUE size, val;
rb_ary_modify(ary);
- if (argc == 0) {
- if (ARY_OWNS_HEAP_P(ary) && RARRAY_PTR(ary)) {
- xfree(RARRAY_PTR(ary));
- }
- rb_ary_unshare_safe(ary);
- FL_SET_EMBED(ary);
- ARY_SET_EMBED_LEN(ary, 0);
+ if (rb_scan_args(argc, argv, "02", &size, &val) == 0) {
+ RARRAY(ary)->len = 0;
if (rb_block_given_p()) {
rb_warning("given block not used");
}
return ary;
}
- rb_scan_args(argc, argv, "02", &size, &val);
+
if (argc == 1 && !FIXNUM_P(size)) {
val = rb_check_array_type(size);
if (!NIL_P(val)) {
@@ -569,8 +318,10 @@ rb_ary_initialize(int argc, VALUE *argv, VALUE ary)
if (len > ARY_MAX_SIZE) {
rb_raise(rb_eArgError, "array size too big");
}
- rb_ary_modify(ary);
- ary_resize_capa(ary, len);
+ if (len > RARRAY(ary)->aux.capa) {
+ REALLOC_N(RARRAY(ary)->ptr, VALUE, len);
+ RARRAY(ary)->aux.capa = len;
+ }
if (rb_block_given_p()) {
long i;
@@ -579,19 +330,20 @@ rb_ary_initialize(int argc, VALUE *argv, VALUE ary)
}
for (i=0; i<len; i++) {
rb_ary_store(ary, i, rb_yield(LONG2NUM(i)));
- ARY_SET_LEN(ary, i + 1);
+ RARRAY(ary)->len = i + 1;
}
}
else {
- memfill(RARRAY_PTR(ary), len, val);
- ARY_SET_LEN(ary, len);
+ memfill(RARRAY(ary)->ptr, len, val);
+ RARRAY(ary)->len = len;
}
+
return ary;
}
-/*
-* Returns a new array populated with the given objects.
+/*
+* Returns a new array populated with the given objects.
*
* Array.[]( 1, 'a', /^A/ )
* Array[ 1, 'a', /^A/ ]
@@ -599,25 +351,33 @@ rb_ary_initialize(int argc, VALUE *argv, VALUE ary)
*/
static VALUE
-rb_ary_s_create(int argc, VALUE *argv, VALUE klass)
+rb_ary_s_create(argc, argv, klass)
+ int argc;
+ VALUE *argv;
+ VALUE klass;
{
- VALUE ary = ary_new(klass, argc);
- if (argc > 0 && argv) {
- MEMCPY(RARRAY_PTR(ary), argv, VALUE, argc);
- ARY_SET_LEN(ary, argc);
+ VALUE ary = ary_alloc(klass);
+
+ if (argc > 0) {
+ RARRAY(ary)->ptr = ALLOC_N(VALUE, argc);
+ MEMCPY(RARRAY(ary)->ptr, argv, VALUE, argc);
}
+ RARRAY(ary)->len = RARRAY(ary)->aux.capa = argc;
return ary;
}
void
-rb_ary_store(VALUE ary, long idx, VALUE val)
+rb_ary_store(ary, idx, val)
+ VALUE ary;
+ long idx;
+ VALUE val;
{
if (idx < 0) {
- idx += RARRAY_LEN(ary);
+ idx += RARRAY(ary)->len;
if (idx < 0) {
rb_raise(rb_eIndexError, "index %ld out of array",
- idx - RARRAY_LEN(ary));
+ idx - RARRAY(ary)->len);
}
}
else if (idx >= ARY_MAX_SIZE) {
@@ -625,85 +385,78 @@ rb_ary_store(VALUE ary, long idx, VALUE val)
}
rb_ary_modify(ary);
- if (idx >= ARY_CAPA(ary)) {
- ary_double_capa(ary, idx);
- }
- if (idx > RARRAY_LEN(ary)) {
- rb_mem_clear(RARRAY_PTR(ary) + RARRAY_LEN(ary),
- idx-RARRAY_LEN(ary) + 1);
- }
+ if (idx >= RARRAY(ary)->aux.capa) {
+ long new_capa = RARRAY(ary)->aux.capa / 2;
- if (idx >= RARRAY_LEN(ary)) {
- ARY_SET_LEN(ary, idx + 1);
+ if (new_capa < ARY_DEFAULT_SIZE) {
+ new_capa = ARY_DEFAULT_SIZE;
+ }
+ if (new_capa >= ARY_MAX_SIZE - idx) {
+ new_capa = (ARY_MAX_SIZE - idx) / 2;
+ }
+ new_capa += idx;
+ REALLOC_N(RARRAY(ary)->ptr, VALUE, new_capa);
+ RARRAY(ary)->aux.capa = new_capa;
}
- RARRAY_PTR(ary)[idx] = val;
-}
-
-static VALUE
-ary_make_partial(VALUE ary, VALUE klass, long offset, long len)
-{
- assert(offset >= 0);
- assert(len >= 0);
- assert(offset+len <= RARRAY_LEN(ary));
-
- if (len <= RARRAY_EMBED_LEN_MAX) {
- VALUE result = ary_alloc(klass);
- MEMCPY(ARY_EMBED_PTR(result), RARRAY_PTR(ary) + offset, VALUE, len);
- ARY_SET_EMBED_LEN(result, len);
- return result;
+ if (idx > RARRAY(ary)->len) {
+ rb_mem_clear(RARRAY(ary)->ptr + RARRAY(ary)->len,
+ idx-RARRAY(ary)->len + 1);
}
- else {
- VALUE shared, result = ary_alloc(klass);
- FL_UNSET_EMBED(result);
-
- shared = ary_make_shared(ary);
- ARY_SET_PTR(result, RARRAY_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);
- return result;
+ if (idx >= RARRAY(ary)->len) {
+ RARRAY(ary)->len = idx + 1;
}
+ RARRAY(ary)->ptr[idx] = val;
}
static VALUE
-ary_make_shared_copy(VALUE ary)
+ary_shared_array(klass, ary)
+ VALUE klass;
+ VALUE ary;
{
- return ary_make_partial(ary, rb_obj_class(ary), 0, RARRAY_LEN(ary));
-}
+ VALUE val = ary_alloc(klass);
-enum ary_take_pos_flags
-{
- ARY_TAKE_FIRST = 0,
- ARY_TAKE_LAST = 1
-};
+ ary_make_shared(ary);
+ RARRAY(val)->ptr = RARRAY(ary)->ptr;
+ RARRAY(val)->len = RARRAY(ary)->len;
+ RARRAY(val)->aux.shared = RARRAY(ary)->aux.shared;
+ FL_SET(val, ELTS_SHARED);
+ return val;
+}
static VALUE
-ary_take_first_or_last(int argc, VALUE *argv, VALUE ary, enum ary_take_pos_flags last)
+ary_shared_first(argc, argv, ary, last)
+ int argc;
+ VALUE *argv;
+ VALUE ary;
+ int last;
{
- VALUE nv;
+ VALUE nv, result;
long n;
long offset = 0;
rb_scan_args(argc, argv, "1", &nv);
n = NUM2LONG(nv);
- if (n > RARRAY_LEN(ary)) {
- n = RARRAY_LEN(ary);
+ if (n > RARRAY(ary)->len) {
+ n = RARRAY(ary)->len;
}
else if (n < 0) {
rb_raise(rb_eArgError, "negative array size");
}
if (last) {
- offset = RARRAY_LEN(ary) - n;
+ offset = RARRAY(ary)->len - n;
}
- return ary_make_partial(ary, rb_cArray, offset, n);
+ result = ary_shared_array(rb_cArray, ary);
+ RARRAY(result)->ptr += offset;
+ RARRAY(result)->len = n;
+
+ return result;
}
/*
* call-seq:
* array << obj -> array
- *
+ *
* Append---Pushes the given object on to the end of this array. This
* expression returns the array itself, so several appends
* may be chained together.
@@ -714,36 +467,33 @@ ary_take_first_or_last(int argc, VALUE *argv, VALUE ary, enum ary_take_pos_flags
*/
VALUE
-rb_ary_push(VALUE ary, VALUE item)
+rb_ary_push(ary, item)
+ VALUE ary;
+ VALUE item;
{
- long idx = RARRAY_LEN(ary);
-
- rb_ary_modify(ary);
- if (idx >= ARY_CAPA(ary)) {
- ary_double_capa(ary, idx);
- }
- RARRAY_PTR(ary)[idx] = item;
- ARY_SET_LEN(ary, idx + 1);
+ rb_ary_store(ary, RARRAY(ary)->len, item);
return ary;
}
-/*
+/*
* call-seq:
* array.push(obj, ... ) -> array
- *
+ *
* Append---Pushes the given object(s) on to the end of this array. This
* expression returns the array itself, so several appends
* may be chained together.
*
* a = [ "a", "b", "c" ]
- * a.push("d", "e", "f")
+ * a.push("d", "e", "f")
* #=> ["a", "b", "c", "d", "e", "f"]
*/
static VALUE
-rb_ary_push_m(int argc, VALUE *argv, VALUE ary)
+rb_ary_push_m(argc, argv, ary)
+ int argc;
+ VALUE *argv;
+ VALUE ary;
{
- rb_ary_modify_check(ary);
while (argc--) {
rb_ary_push(ary, *argv++);
}
@@ -751,33 +501,31 @@ rb_ary_push_m(int argc, VALUE *argv, VALUE ary)
}
VALUE
-rb_ary_pop(VALUE ary)
+rb_ary_pop(ary)
+ VALUE ary;
{
- long n;
rb_ary_modify_check(ary);
- if (RARRAY_LEN(ary) == 0) return Qnil;
- if (ARY_OWNS_HEAP_P(ary) &&
- RARRAY_LEN(ary) * 3 < ARY_CAPA(ary) &&
- ARY_CAPA(ary) > ARY_DEFAULT_SIZE)
- {
- ary_resize_capa(ary, RARRAY_LEN(ary) * 2);
+ if (RARRAY(ary)->len == 0) return Qnil;
+ if (!FL_TEST(ary, ELTS_SHARED) &&
+ RARRAY(ary)->len * 3 < RARRAY(ary)->aux.capa &&
+ RARRAY(ary)->aux.capa > ARY_DEFAULT_SIZE) {
+ RARRAY(ary)->aux.capa = RARRAY(ary)->len * 2;
+ REALLOC_N(RARRAY(ary)->ptr, VALUE, RARRAY(ary)->aux.capa);
}
- n = RARRAY_LEN(ary)-1;
- ARY_SET_LEN(ary, n);
- return RARRAY_PTR(ary)[n];
+ return RARRAY(ary)->ptr[--RARRAY(ary)->len];
}
/*
* call-seq:
* array.pop -> obj or nil
* array.pop(n) -> array
- *
+ *
* Removes the last element from <i>self</i> and returns it, or
* <code>nil</code> if the array is empty.
*
* If a number _n_ is given, returns an array of the last n elements
* (or less) just like <code>array.slice!(-n, n)</code> does.
- *
+ *
* a = [ "a", "b", "c", "d" ]
* a.pop #=> "d"
* a.pop(2) #=> ["b", "c"]
@@ -785,7 +533,10 @@ rb_ary_pop(VALUE ary)
*/
static VALUE
-rb_ary_pop_m(int argc, VALUE *argv, VALUE ary)
+rb_ary_pop_m(argc, argv, ary)
+ int argc;
+ VALUE *argv;
+ VALUE ary;
{
VALUE result;
@@ -794,35 +545,31 @@ 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));
+ result = ary_shared_first(argc, argv, ary, Qtrue);
+ RARRAY(ary)->len -= RARRAY(result)->len;
return result;
}
VALUE
-rb_ary_shift(VALUE ary)
+rb_ary_shift(ary)
+ VALUE ary;
{
VALUE top;
rb_ary_modify_check(ary);
- if (RARRAY_LEN(ary) == 0) return Qnil;
- top = RARRAY_PTR(ary)[0];
- if (!ARY_SHARED_P(ary)) {
- if (RARRAY_LEN(ary) < ARY_DEFAULT_SIZE) {
- MEMMOVE(RARRAY_PTR(ary), RARRAY_PTR(ary)+1, VALUE, RARRAY_LEN(ary)-1);
- ARY_INCREASE_LEN(ary, -1);
- return top;
- }
- assert(!ARY_EMBED_P(ary)); /* ARY_EMBED_LEN_MAX < ARY_DEFAULT_SIZE */
-
- RARRAY_PTR(ary)[0] = Qnil;
+ if (RARRAY(ary)->len == 0) return Qnil;
+ top = RARRAY(ary)->ptr[0];
+ if (!FL_TEST(ary, ELTS_SHARED)) {
+ if (RARRAY(ary)->len < ARY_DEFAULT_SIZE) {
+ MEMMOVE(RARRAY(ary)->ptr, RARRAY(ary)->ptr+1, VALUE, RARRAY(ary)->len-1);
+ RARRAY(ary)->len--;
+ return top;
+ }
+ RARRAY(ary)->ptr[0] = Qnil;
ary_make_shared(ary);
}
- else if (ARY_SHARED_NUM(ARY_SHARED(ary)) == 1) {
- RARRAY_PTR(ary)[0] = Qnil;
- }
- ARY_INCREASE_PTR(ary, 1); /* shift ptr */
- ARY_INCREASE_LEN(ary, -1);
+ RARRAY(ary)->ptr++; /* shift ptr */
+ RARRAY(ary)->len--;
return top;
}
@@ -831,14 +578,14 @@ rb_ary_shift(VALUE ary)
* call-seq:
* array.shift -> obj or nil
* array.shift(n) -> array
- *
+ *
* Returns the first element of <i>self</i> and removes it (shifting all
* other elements down by one). Returns <code>nil</code> if the array
* is empty.
*
* If a number _n_ is given, returns an array of the first n elements
* (or less) just like <code>array.slice!(0, n)</code> does.
- *
+ *
* args = [ "-m", "-q", "filename" ]
* args.shift #=> "-m"
* args #=> ["-q", "filename"]
@@ -849,7 +596,10 @@ rb_ary_shift(VALUE ary)
*/
static VALUE
-rb_ary_shift_m(int argc, VALUE *argv, VALUE ary)
+rb_ary_shift_m(argc, argv, ary)
+ int argc;
+ VALUE *argv;
+ VALUE ary;
{
VALUE result;
long n;
@@ -859,97 +609,130 @@ 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);
- if (ARY_SHARED_P(ary)) {
- if (ARY_SHARED_NUM(ARY_SHARED(ary)) == 1) {
- rb_mem_clear(RARRAY_PTR(ary), n);
+ result = ary_shared_first(argc, argv, ary, Qfalse);
+ n = RARRAY(result)->len;
+ if (FL_TEST(ary, ELTS_SHARED)) {
+ RARRAY(ary)->ptr += n;
+ RARRAY(ary)->len -= n;
}
- ARY_INCREASE_PTR(ary, n);
- }
else {
- MEMMOVE(RARRAY_PTR(ary), RARRAY_PTR(ary)+n, VALUE, RARRAY_LEN(ary)-n);
+ MEMMOVE(RARRAY(ary)->ptr, RARRAY(ary)->ptr+n, VALUE, RARRAY(ary)->len-n);
+ RARRAY(ary)->len -= n;
}
- ARY_INCREASE_LEN(ary, -n);
return result;
}
+VALUE
+rb_ary_unshift(ary, item)
+ VALUE ary, item;
+{
+ rb_ary_modify(ary);
+ if (RARRAY(ary)->len == RARRAY(ary)->aux.capa) {
+ long capa_inc = RARRAY(ary)->aux.capa / 2;
+ if (capa_inc < ARY_DEFAULT_SIZE) {
+ capa_inc = ARY_DEFAULT_SIZE;
+ }
+ RARRAY(ary)->aux.capa += capa_inc;
+ REALLOC_N(RARRAY(ary)->ptr, VALUE, RARRAY(ary)->aux.capa);
+ }
+
+ /* sliding items */
+ MEMMOVE(RARRAY(ary)->ptr + 1, RARRAY(ary)->ptr, VALUE, RARRAY(ary)->len);
+
+ RARRAY(ary)->len++;
+ RARRAY(ary)->ptr[0] = item;
+
+ return ary;
+}
+
/*
* call-seq:
* array.unshift(obj, ...) -> array
- *
+ *
* Prepends objects to the front of <i>array</i>.
* other elements up one.
- *
+ *
* a = [ "b", "c", "d" ]
* a.unshift("a") #=> ["a", "b", "c", "d"]
* a.unshift(1, 2) #=> [ 1, 2, "a", "b", "c", "d"]
*/
static VALUE
-rb_ary_unshift_m(int argc, VALUE *argv, VALUE ary)
+rb_ary_unshift_m(argc, argv, ary)
+ int argc;
+ VALUE *argv;
+ VALUE ary;
{
- long len;
+ long len = RARRAY(ary)->len;
if (argc == 0) return ary;
- rb_ary_modify(ary);
- if (ARY_CAPA(ary) <= (len = RARRAY_LEN(ary)) + argc) {
- ary_double_capa(ary, len + argc);
- }
- /* sliding items */
- MEMMOVE(RARRAY_PTR(ary) + argc, RARRAY_PTR(ary), VALUE, len);
- MEMCPY(RARRAY_PTR(ary), argv, VALUE, argc);
- ARY_INCREASE_LEN(ary, argc);
+ /* make rooms by setting the last item */
+ rb_ary_store(ary, len + argc - 1, Qnil);
+ /* sliding items */
+ MEMMOVE(RARRAY(ary)->ptr + argc, RARRAY(ary)->ptr, VALUE, len);
+ MEMCPY(RARRAY(ary)->ptr, argv, VALUE, argc);
+
return ary;
}
-VALUE
-rb_ary_unshift(VALUE ary, VALUE item)
-{
- return rb_ary_unshift_m(1,&item,ary);
-}
-
/* faster version - use this if you don't need to treat negative offset */
static inline VALUE
-rb_ary_elt(VALUE ary, long offset)
+rb_ary_elt(ary, offset)
+ VALUE ary;
+ long offset;
{
- if (RARRAY_LEN(ary) == 0) return Qnil;
- if (offset < 0 || RARRAY_LEN(ary) <= offset) {
+ if (RARRAY(ary)->len == 0) return Qnil;
+ if (offset < 0 || RARRAY(ary)->len <= offset) {
return Qnil;
}
- return RARRAY_PTR(ary)[offset];
+ return RARRAY(ary)->ptr[offset];
}
VALUE
-rb_ary_entry(VALUE ary, long offset)
+rb_ary_entry(ary, offset)
+ VALUE ary;
+ long offset;
{
if (offset < 0) {
- offset += RARRAY_LEN(ary);
+ offset += RARRAY(ary)->len;
}
return rb_ary_elt(ary, offset);
}
-VALUE
-rb_ary_subseq(VALUE ary, long beg, long len)
+static VALUE
+rb_ary_subseq(ary, beg, len)
+ VALUE ary;
+ long beg, len;
{
- VALUE klass;
+ VALUE klass, ary2, shared;
+ VALUE *ptr;
- if (beg > RARRAY_LEN(ary)) return Qnil;
+ if (beg > RARRAY(ary)->len) return Qnil;
if (beg < 0 || len < 0) return Qnil;
- if (RARRAY_LEN(ary) < len || RARRAY_LEN(ary) < beg + len) {
- len = RARRAY_LEN(ary) - beg;
+ if (RARRAY(ary)->len < len || RARRAY(ary)->len < beg + len) {
+ len = RARRAY(ary)->len - beg;
+ if (len < 0)
+ len = 0;
}
klass = rb_obj_class(ary);
if (len == 0) return ary_new(klass, 0);
- return ary_make_partial(ary, klass, beg, len);
+ shared = ary_make_shared(ary);
+ ptr = RARRAY(ary)->ptr;
+ ary2 = ary_alloc(klass);
+ RARRAY(ary2)->ptr = ptr + beg;
+ RARRAY(ary2)->len = len;
+ RARRAY(ary2)->aux.shared = shared;
+ FL_SET(ary2, ELTS_SHARED);
+
+ return ary2;
}
-/*
+/*
* call-seq:
* array[index] -> obj or nil
* array[start, length] -> an_array or nil
@@ -982,16 +765,22 @@ rb_ary_subseq(VALUE ary, long beg, long len)
*/
VALUE
-rb_ary_aref(int argc, VALUE *argv, VALUE ary)
+rb_ary_aref(argc, argv, ary)
+ int argc;
+ VALUE *argv;
+ VALUE ary;
{
VALUE arg;
long beg, len;
if (argc == 2) {
+ if (SYMBOL_P(argv[0])) {
+ rb_raise(rb_eTypeError, "Symbol as array index");
+ }
beg = NUM2LONG(argv[0]);
len = NUM2LONG(argv[1]);
if (beg < 0) {
- beg += RARRAY_LEN(ary);
+ beg += RARRAY(ary)->len;
}
return rb_ary_subseq(ary, beg, len);
}
@@ -1003,8 +792,11 @@ rb_ary_aref(int argc, VALUE *argv, VALUE ary)
if (FIXNUM_P(arg)) {
return rb_ary_entry(ary, FIX2LONG(arg));
}
+ if (SYMBOL_P(arg)) {
+ rb_raise(rb_eTypeError, "Symbol as array index");
+ }
/* check if idx is Range */
- switch (rb_range_beg_len(arg, &beg, &len, RARRAY_LEN(ary), 0)) {
+ switch (rb_range_beg_len(arg, &beg, &len, RARRAY(ary)->len, 0)) {
case Qfalse:
break;
case Qnil:
@@ -1015,13 +807,15 @@ rb_ary_aref(int argc, VALUE *argv, VALUE ary)
return rb_ary_entry(ary, NUM2LONG(arg));
}
-/*
+/*
* call-seq:
* array.at(index) -> obj or nil
*
* Returns the element at _index_. A
* negative index counts from the end of _self_. Returns +nil+
* if the index is out of range. See also <code>Array#[]</code>.
+ * (<code>Array#at</code> is slightly faster than <code>Array#[]</code>,
+ * as it does not accept ranges and so on.)
*
* a = [ "a", "b", "c", "d", "e" ]
* a.at(0) #=> "a"
@@ -1029,34 +823,39 @@ rb_ary_aref(int argc, VALUE *argv, VALUE ary)
*/
static VALUE
-rb_ary_at(VALUE ary, VALUE pos)
+rb_ary_at(ary, pos)
+ VALUE ary, pos;
{
return rb_ary_entry(ary, NUM2LONG(pos));
}
/*
* call-seq:
- * array.first -> obj or nil
- * array.first(n) -> an_array
+ * array.first -> obj or nil
+ * array.first(n) -> an_array
*
* Returns the first element, or the first +n+ elements, of the array.
* If the array is empty, the first form returns <code>nil</code>, and the
* second form returns an empty array.
*
* a = [ "q", "r", "s", "t" ]
- * a.first #=> "q"
- * a.first(2) #=> ["q", "r"]
+ * a.first #=> "q"
+ * a.first(1) #=> ["q"]
+ * a.first(3) #=> ["q", "r", "s"]
*/
static VALUE
-rb_ary_first(int argc, VALUE *argv, VALUE ary)
+rb_ary_first(argc, argv, ary)
+ int argc;
+ VALUE *argv;
+ VALUE ary;
{
if (argc == 0) {
- if (RARRAY_LEN(ary) == 0) return Qnil;
- return RARRAY_PTR(ary)[0];
+ if (RARRAY(ary)->len == 0) return Qnil;
+ return RARRAY(ary)->ptr[0];
}
else {
- return ary_take_first_or_last(argc, argv, ary, ARY_TAKE_FIRST);
+ return ary_shared_first(argc, argv, ary, Qfalse);
}
}
@@ -1064,24 +863,25 @@ rb_ary_first(int argc, VALUE *argv, VALUE ary)
* call-seq:
* array.last -> obj or nil
* array.last(n) -> an_array
- *
+ *
* Returns the last element(s) of <i>self</i>. If the array is empty,
* the first form returns <code>nil</code>.
- *
- * a = [ "w", "x", "y", "z" ]
- * a.last #=> "z"
- * a.last(2) #=> ["y", "z"]
+ *
+ * [ "w", "x", "y", "z" ].last #=> "z"
*/
-VALUE
-rb_ary_last(int argc, VALUE *argv, VALUE ary)
+static VALUE
+rb_ary_last(argc, argv, ary)
+ int argc;
+ VALUE *argv;
+ VALUE ary;
{
if (argc == 0) {
- if (RARRAY_LEN(ary) == 0) return Qnil;
- return RARRAY_PTR(ary)[RARRAY_LEN(ary)-1];
+ if (RARRAY(ary)->len == 0) return Qnil;
+ return RARRAY(ary)->ptr[RARRAY(ary)->len-1];
}
else {
- return ary_take_first_or_last(argc, argv, ary, ARY_TAKE_LAST);
+ return ary_shared_first(argc, argv, ary, Qtrue);
}
}
@@ -1090,14 +890,14 @@ rb_ary_last(int argc, VALUE *argv, VALUE ary)
* array.fetch(index) -> obj
* array.fetch(index, default ) -> obj
* array.fetch(index) {|index| block } -> obj
- *
+ *
* Tries to return the element at position <i>index</i>. If the index
* lies outside the array, the first form throws an
* <code>IndexError</code> exception, the second form returns
* <i>default</i>, and the third form returns the value of invoking
* the block, passing in the index. Negative values of <i>index</i>
* count from the end of the array.
- *
+ *
* a = [ 11, 22, 33, 44 ]
* a.fetch(1) #=> 22
* a.fetch(-1) #=> 44
@@ -1106,7 +906,10 @@ rb_ary_last(int argc, VALUE *argv, VALUE ary)
*/
static VALUE
-rb_ary_fetch(int argc, VALUE *argv, VALUE ary)
+rb_ary_fetch(argc, argv, ary)
+ int argc;
+ VALUE *argv;
+ VALUE ary;
{
VALUE pos, ifnone;
long block_given;
@@ -1120,28 +923,28 @@ rb_ary_fetch(int argc, VALUE *argv, VALUE ary)
idx = NUM2LONG(pos);
if (idx < 0) {
- idx += RARRAY_LEN(ary);
+ idx += RARRAY(ary)->len;
}
- if (idx < 0 || RARRAY_LEN(ary) <= idx) {
+ if (idx < 0 || RARRAY(ary)->len <= idx) {
if (block_given) return rb_yield(pos);
if (argc == 1) {
rb_raise(rb_eIndexError, "index %ld out of array", idx);
}
return ifnone;
}
- return RARRAY_PTR(ary)[idx];
+ return RARRAY(ary)->ptr[idx];
}
/*
* call-seq:
* array.index(obj) -> int or nil
* array.index {|item| block} -> int or nil
- *
+ *
* Returns the index of the first object in <i>self</i> such that is
* <code>==</code> to <i>obj</i>. If a block is given instead of an
* argument, returns first object for which <em>block</em> is true.
* Returns <code>nil</code> if no match is found.
- *
+ *
* a = [ "a", "b", "c" ]
* a.index("b") #=> 1
* a.index("z") #=> nil
@@ -1151,25 +954,26 @@ rb_ary_fetch(int argc, VALUE *argv, VALUE ary)
*/
static VALUE
-rb_ary_index(int argc, VALUE *argv, VALUE ary)
+rb_ary_index(argc, argv, ary)
+ int argc;
+ VALUE *argv;
+ VALUE ary;
{
VALUE val;
long i;
- if (argc == 0) {
+ if (argc == 0) {
RETURN_ENUMERATOR(ary, 0, 0);
- for (i=0; i<RARRAY_LEN(ary); i++) {
- if (RTEST(rb_yield(RARRAY_PTR(ary)[i]))) {
+ for (i=0; i<RARRAY(ary)->len; i++) {
+ if (RTEST(rb_yield(RARRAY(ary)->ptr[i]))) {
return LONG2NUM(i);
}
}
return Qnil;
}
- rb_scan_args(argc, argv, "1", &val);
- if (rb_block_given_p())
- rb_warn("given block not used");
- for (i=0; i<RARRAY_LEN(ary); i++) {
- if (rb_equal(RARRAY_PTR(ary)[i], val))
+ rb_scan_args(argc, argv, "01", &val);
+ for (i=0; i<RARRAY(ary)->len; i++) {
+ if (rb_equal(RARRAY(ary)->ptr[i], val))
return LONG2NUM(i);
}
return Qnil;
@@ -1178,12 +982,12 @@ rb_ary_index(int argc, VALUE *argv, VALUE ary)
/*
* call-seq:
* array.rindex(obj) -> int or nil
- *
+ *
* Returns the index of the last object in <i>array</i>
* <code>==</code> to <i>obj</i>. If a block is given instead of an
* argument, returns first object for which <em>block</em> is
* true. Returns <code>nil</code> if no match is found.
- *
+ *
* a = [ "a", "b", "b", "b", "c" ]
* a.rindex("b") #=> 3
* a.rindex("z") #=> nil
@@ -1191,106 +995,144 @@ rb_ary_index(int argc, VALUE *argv, VALUE ary)
*/
static VALUE
-rb_ary_rindex(int argc, VALUE *argv, VALUE ary)
+rb_ary_rindex(argc, argv, ary)
+ int argc;
+ VALUE *argv;
+ VALUE ary;
{
VALUE val;
- long i = RARRAY_LEN(ary);
+ long i = RARRAY(ary)->len;
if (argc == 0) {
RETURN_ENUMERATOR(ary, 0, 0);
while (i--) {
- if (RTEST(rb_yield(RARRAY_PTR(ary)[i])))
+ if (RTEST(rb_yield(RARRAY(ary)->ptr[i])))
return LONG2NUM(i);
- if (i > RARRAY_LEN(ary)) {
- i = RARRAY_LEN(ary);
+ if (i > RARRAY(ary)->len) {
+ i = RARRAY(ary)->len;
}
}
return Qnil;
}
- rb_scan_args(argc, argv, "1", &val);
- if (rb_block_given_p())
- rb_warn("given block not used");
+ rb_scan_args(argc, argv, "01", &val);
while (i--) {
- if (rb_equal(RARRAY_PTR(ary)[i], val))
+ if (rb_equal(RARRAY(ary)->ptr[i], val))
return LONG2NUM(i);
- if (i > RARRAY_LEN(ary)) {
- i = RARRAY_LEN(ary);
+ if (i > RARRAY(ary)->len) {
+ i = RARRAY(ary)->len;
}
}
return Qnil;
}
+/*
+ * call-seq:
+ * array.indexes( i1, i2, ... iN ) -> an_array
+ * array.indices( i1, i2, ... iN ) -> an_array
+ *
+ * Deprecated; use <code>Array#values_at</code>.
+ */
+
+static VALUE
+rb_ary_indexes(argc, argv, ary)
+ int argc;
+ VALUE *argv;
+ VALUE ary;
+{
+ VALUE new_ary;
+ long i;
+
+ rb_warn("Array#%s is deprecated; use Array#values_at", rb_id2name(rb_frame_last_func()));
+ new_ary = rb_ary_new2(argc);
+ for (i=0; i<argc; i++) {
+ rb_ary_push(new_ary, rb_ary_aref(1, argv+i, ary));
+ }
+
+ return new_ary;
+}
+
VALUE
-rb_ary_to_ary(VALUE obj)
+rb_ary_to_ary(obj)
+ VALUE obj;
{
if (TYPE(obj) == T_ARRAY) {
return obj;
}
if (rb_respond_to(obj, rb_intern("to_ary"))) {
- return to_ary(obj);
+ return rb_convert_type(obj, T_ARRAY, "Array", "to_ary");
}
return rb_ary_new3(1, obj);
}
static void
-rb_ary_splice(VALUE ary, long beg, long len, VALUE rpl)
+rb_ary_splice(ary, beg, len, rpl)
+ VALUE ary;
+ long beg, len;
+ VALUE rpl;
{
long rlen;
if (len < 0) rb_raise(rb_eIndexError, "negative length (%ld)", len);
if (beg < 0) {
- beg += RARRAY_LEN(ary);
+ beg += RARRAY(ary)->len;
if (beg < 0) {
- beg -= RARRAY_LEN(ary);
+ beg -= RARRAY(ary)->len;
rb_raise(rb_eIndexError, "index %ld out of array", beg);
}
}
- if (RARRAY_LEN(ary) < len || RARRAY_LEN(ary) < beg + len) {
- len = RARRAY_LEN(ary) - beg;
+ if (RARRAY(ary)->len < len || RARRAY(ary)->len < beg + len) {
+ len = RARRAY(ary)->len - beg;
}
- if (rpl == Qundef) {
+ if (NIL_P(rpl)) {
rlen = 0;
}
else {
rpl = rb_ary_to_ary(rpl);
- rlen = RARRAY_LEN(rpl);
+ rlen = RARRAY(rpl)->len;
}
rb_ary_modify(ary);
- if (beg >= RARRAY_LEN(ary)) {
+
+ if (beg >= RARRAY(ary)->len) {
if (beg > ARY_MAX_SIZE - rlen) {
rb_raise(rb_eIndexError, "index %ld too big", beg);
}
len = beg + rlen;
- if (len >= ARY_CAPA(ary)) {
- ary_double_capa(ary, len);
+ if (len >= RARRAY(ary)->aux.capa) {
+ REALLOC_N(RARRAY(ary)->ptr, VALUE, len);
+ RARRAY(ary)->aux.capa = len;
}
- rb_mem_clear(RARRAY_PTR(ary) + RARRAY_LEN(ary), beg - RARRAY_LEN(ary));
+ rb_mem_clear(RARRAY(ary)->ptr + RARRAY(ary)->len, beg - RARRAY(ary)->len);
if (rlen > 0) {
- MEMCPY(RARRAY_PTR(ary) + beg, RARRAY_PTR(rpl), VALUE, rlen);
+ MEMCPY(RARRAY(ary)->ptr + beg, RARRAY(rpl)->ptr, VALUE, rlen);
}
- ARY_SET_LEN(ary, len);
+ RARRAY(ary)->len = len;
}
else {
long alen;
- alen = RARRAY_LEN(ary) + rlen - len;
- if (alen >= ARY_CAPA(ary)) {
- ary_double_capa(ary, alen);
+ if (beg + len > RARRAY(ary)->len) {
+ len = RARRAY(ary)->len - beg;
+ }
+
+ alen = RARRAY(ary)->len + rlen - len;
+ if (alen >= RARRAY(ary)->aux.capa) {
+ REALLOC_N(RARRAY(ary)->ptr, VALUE, alen);
+ RARRAY(ary)->aux.capa = alen;
}
if (len != rlen) {
- MEMMOVE(RARRAY_PTR(ary) + beg + rlen, RARRAY_PTR(ary) + beg + len,
- VALUE, RARRAY_LEN(ary) - (beg + len));
- ARY_SET_LEN(ary, alen);
+ MEMMOVE(RARRAY(ary)->ptr + beg + rlen, RARRAY(ary)->ptr + beg + len,
+ VALUE, RARRAY(ary)->len - (beg + len));
+ RARRAY(ary)->len = alen;
}
if (rlen > 0) {
- MEMMOVE(RARRAY_PTR(ary) + beg, RARRAY_PTR(rpl), VALUE, rlen);
+ MEMMOVE(RARRAY(ary)->ptr + beg, RARRAY(rpl)->ptr, VALUE, rlen);
}
}
}
-/*
+/*
* call-seq:
* array[index] = obj -> obj
* array[start, length] = obj or an_array or nil -> obj or an_array or nil
@@ -1303,10 +1145,11 @@ rb_ary_splice(VALUE ary, long beg, long len, VALUE rpl)
* the current capacity of the array, the array grows
* automatically. A negative indices will count backward
* from the end of the array. Inserts elements if _length_ is
- * zero. An +IndexError+ is raised if a negative index points
- * past the beginning of the array. See also
+ * zero. If +nil+ is used in the second and third form,
+ * deletes elements from _self_. An +IndexError+ is raised if a
+ * negative index points past the beginning of the array. See also
* <code>Array#push</code>, and <code>Array#unshift</code>.
- *
+ *
* a = Array.new
* a[4] = "4"; #=> [nil, nil, nil, nil, "4"]
* a[0, 3] = [ 'a', 'b', 'c' ] #=> ["a", "b", "c", nil, "4"]
@@ -1314,19 +1157,25 @@ rb_ary_splice(VALUE ary, long beg, long len, VALUE rpl)
* a[0, 2] = "?" #=> ["?", 2, nil, "4"]
* a[0..2] = "A" #=> ["A", "4"]
* a[-1] = "Z" #=> ["A", "Z"]
- * a[1..-1] = nil #=> ["A", nil]
- * a[1..-1] = [] #=> ["A"]
+ * a[1..-1] = nil #=> ["A"]
*/
static VALUE
-rb_ary_aset(int argc, VALUE *argv, VALUE ary)
+rb_ary_aset(argc, argv, ary)
+ int argc;
+ VALUE *argv;
+ VALUE ary;
{
long offset, beg, len;
if (argc == 3) {
- beg = NUM2LONG(argv[0]);
- len = NUM2LONG(argv[1]);
- rb_ary_splice(ary, beg, len, argv[2]);
+ if (SYMBOL_P(argv[0])) {
+ rb_raise(rb_eTypeError, "Symbol as array index");
+ }
+ if (SYMBOL_P(argv[1])) {
+ rb_raise(rb_eTypeError, "Symbol as subarray length");
+ }
+ rb_ary_splice(ary, NUM2LONG(argv[0]), NUM2LONG(argv[1]), argv[2]);
return argv[2];
}
if (argc != 2) {
@@ -1336,7 +1185,10 @@ rb_ary_aset(int argc, VALUE *argv, VALUE ary)
offset = FIX2LONG(argv[0]);
goto fixnum;
}
- if (rb_range_beg_len(argv[0], &beg, &len, RARRAY_LEN(ary), 1)) {
+ if (SYMBOL_P(argv[0])) {
+ rb_raise(rb_eTypeError, "Symbol as array index");
+ }
+ if (rb_range_beg_len(argv[0], &beg, &len, RARRAY(ary)->len, 1)) {
/* check if idx is Range */
rb_ary_splice(ary, beg, len, argv[1]);
return argv[1];
@@ -1351,17 +1203,20 @@ fixnum:
/*
* call-seq:
* array.insert(index, obj...) -> array
- *
+ *
* Inserts the given values before the element with the given index
* (which may be negative).
- *
+ *
* a = %w{ a b c d }
* a.insert(2, 99) #=> ["a", "b", 99, "c", "d"]
* a.insert(-2, 1, 2, 3) #=> ["a", "b", 99, "c", 1, 2, 3, "d"]
*/
static VALUE
-rb_ary_insert(int argc, VALUE *argv, VALUE ary)
+rb_ary_insert(argc, argv, ary)
+ int argc;
+ VALUE *argv;
+ VALUE ary;
{
long pos;
@@ -1371,7 +1226,7 @@ rb_ary_insert(int argc, VALUE *argv, VALUE ary)
}
pos = NUM2LONG(argv[0]);
if (pos == -1) {
- pos = RARRAY_LEN(ary);
+ pos = RARRAY(ary)->len;
}
if (pos < 0) {
pos++;
@@ -1383,26 +1238,27 @@ rb_ary_insert(int argc, VALUE *argv, VALUE ary)
/*
* call-seq:
* array.each {|item| block } -> array
- *
+ *
* Calls <i>block</i> once for each element in <i>self</i>, passing that
* element as a parameter.
- *
+ *
* a = [ "a", "b", "c" ]
* a.each {|x| print x, " -- " }
- *
+ *
* produces:
- *
+ *
* a -- b -- c --
*/
VALUE
-rb_ary_each(VALUE ary)
+rb_ary_each(ary)
+ VALUE ary;
{
long i;
RETURN_ENUMERATOR(ary, 0, 0);
- for (i=0; i<RARRAY_LEN(ary); i++) {
- rb_yield(RARRAY_PTR(ary)[i]);
+ for (i=0; i<RARRAY(ary)->len; i++) {
+ rb_yield(RARRAY(ary)->ptr[i]);
}
return ary;
}
@@ -1410,25 +1266,26 @@ rb_ary_each(VALUE ary)
/*
* call-seq:
* array.each_index {|index| block } -> array
- *
+ *
* Same as <code>Array#each</code>, but passes the index of the element
* instead of the element itself.
- *
+ *
* a = [ "a", "b", "c" ]
* a.each_index {|x| print x, " -- " }
- *
+ *
* produces:
- *
+ *
* 0 -- 1 -- 2 --
*/
static VALUE
-rb_ary_each_index(VALUE ary)
+rb_ary_each_index(ary)
+ VALUE ary;
{
long i;
- RETURN_ENUMERATOR(ary, 0, 0);
- for (i=0; i<RARRAY_LEN(ary); i++) {
+ RETURN_ENUMERATOR(ary, 0, 0);
+ for (i=0; i<RARRAY(ary)->len; i++) {
rb_yield(LONG2NUM(i));
}
return ary;
@@ -1436,30 +1293,31 @@ rb_ary_each_index(VALUE ary)
/*
* call-seq:
- * array.reverse_each {|item| block }
- *
+ * array.reverse_each {|item| block }
+ *
* Same as <code>Array#each</code>, but traverses <i>self</i> in reverse
* order.
- *
+ *
* a = [ "a", "b", "c" ]
* a.reverse_each {|x| print x, " " }
- *
+ *
* produces:
- *
+ *
* c b a
*/
static VALUE
-rb_ary_reverse_each(VALUE ary)
+rb_ary_reverse_each(ary)
+ VALUE ary;
{
long len;
RETURN_ENUMERATOR(ary, 0, 0);
- len = RARRAY_LEN(ary);
+ len = RARRAY(ary)->len;
while (len--) {
- rb_yield(RARRAY_PTR(ary)[len]);
- if (RARRAY_LEN(ary) < len) {
- len = RARRAY_LEN(ary);
+ rb_yield(RARRAY(ary)->ptr[len]);
+ if (RARRAY(ary)->len < len) {
+ len = RARRAY(ary)->len;
}
}
return ary;
@@ -1468,259 +1326,285 @@ rb_ary_reverse_each(VALUE ary)
/*
* call-seq:
* array.length -> int
- *
+ *
* Returns the number of elements in <i>self</i>. May be zero.
- *
+ *
* [ 1, 2, 3, 4, 5 ].length #=> 5
*/
static VALUE
-rb_ary_length(VALUE ary)
+rb_ary_length(ary)
+ VALUE ary;
{
- long len = RARRAY_LEN(ary);
- return LONG2NUM(len);
+ return LONG2NUM(RARRAY(ary)->len);
}
/*
* call-seq:
* array.empty? -> true or false
- *
+ *
* Returns <code>true</code> if <i>self</i> array contains no elements.
- *
+ *
* [].empty? #=> true
*/
static VALUE
-rb_ary_empty_p(VALUE ary)
+rb_ary_empty_p(ary)
+ VALUE ary;
{
- if (RARRAY_LEN(ary) == 0)
+ if (RARRAY(ary)->len == 0)
return Qtrue;
return Qfalse;
}
VALUE
-rb_ary_dup(VALUE ary)
+rb_ary_dup(ary)
+ VALUE ary;
{
- VALUE dup = rb_ary_new2(RARRAY_LEN(ary));
- int is_embed = ARY_EMBED_P(dup);
- DUPSETUP(dup, ary);
- if (is_embed) FL_SET_EMBED(dup);
- MEMCPY(RARRAY_PTR(dup), RARRAY_PTR(ary), VALUE, RARRAY_LEN(ary));
- ARY_SET_LEN(dup, RARRAY_LEN(ary));
+ VALUE dup = rb_ary_new2(RARRAY(ary)->len);
+ DUPSETUP(dup, ary);
+ MEMCPY(RARRAY(dup)->ptr, RARRAY(ary)->ptr, VALUE, RARRAY(ary)->len);
+ RARRAY(dup)->len = RARRAY(ary)->len;
return dup;
}
-VALUE
-rb_ary_resurrect(VALUE ary)
-{
- return rb_ary_new4(RARRAY_LEN(ary), RARRAY_PTR(ary));
-}
-
extern VALUE rb_output_fs;
-static void ary_join_1(VALUE obj, VALUE ary, VALUE sep, long i, VALUE result);
-
static VALUE
-recursive_join(VALUE obj, VALUE argp, int recur)
-{
- VALUE *arg = (VALUE *)argp;
- VALUE ary = arg[0];
- VALUE sep = arg[1];
- VALUE result = arg[2];
-
- if (recur) {
- rb_raise(rb_eArgError, "recursive array join");
- }
- else {
- ary_join_1(obj, ary, sep, 0, result);
- }
- return Qnil;
-}
-
-static void
-ary_join_0(VALUE ary, VALUE sep, long max, VALUE result)
+inspect_join(ary, arg)
+ VALUE ary;
+ VALUE *arg;
{
- long i;
- VALUE val;
-
- for (i=0; i<max; i++) {
- val = RARRAY_PTR(ary)[i];
- 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);
- if (OBJ_UNTRUSTED(val)) OBJ_TAINT(result);
- }
+ return rb_ary_join(arg[0], arg[1]);
}
-static void
-ary_join_1(VALUE obj, VALUE ary, VALUE sep, long i, VALUE result)
+VALUE
+rb_ary_join(ary, sep)
+ VALUE ary, sep;
{
- VALUE val, tmp;
+ long len = 1, i;
+ int taint = Qfalse;
+ VALUE result, tmp;
- for (; i<RARRAY_LEN(ary); i++) {
- if (i > 0 && !NIL_P(sep))
- rb_str_buf_append(result, sep);
+ if (RARRAY(ary)->len == 0) return rb_str_new(0, 0);
+ if (OBJ_TAINTED(ary) || OBJ_TAINTED(sep)) taint = Qtrue;
- val = RARRAY_PTR(ary)[i];
- switch (TYPE(val)) {
+ for (i=0; i<RARRAY(ary)->len; i++) {
+ tmp = rb_check_string_type(RARRAY(ary)->ptr[i]);
+ len += NIL_P(tmp) ? 10 : RSTRING(tmp)->len;
+ }
+ if (!NIL_P(sep)) {
+ StringValue(sep);
+ len += RSTRING(sep)->len * (RARRAY(ary)->len - 1);
+ }
+ result = rb_str_buf_new(len);
+ for (i=0; i<RARRAY(ary)->len; i++) {
+ tmp = RARRAY(ary)->ptr[i];
+ switch (TYPE(tmp)) {
case T_STRING:
- str_join:
- rb_str_buf_append(result, val);
break;
case T_ARRAY:
- obj = val;
- ary_join:
- if (val == ary) {
- rb_raise(rb_eArgError, "recursive array join");
+ if (tmp == ary || rb_inspecting_p(tmp)) {
+ tmp = rb_str_new2("[...]");
}
else {
- VALUE args[3];
-
- args[0] = val;
+ VALUE args[2];
+
+ args[0] = tmp;
args[1] = sep;
- args[2] = result;
- rb_exec_recursive(recursive_join, obj, (VALUE)args);
+ tmp = rb_protect_inspect(inspect_join, ary, (VALUE)args);
}
break;
default:
- tmp = rb_check_string_type(val);
- if (!NIL_P(tmp)) {
- val = tmp;
- goto str_join;
- }
- tmp = rb_check_convert_type(val, T_ARRAY, "Array", "to_a");
- if (!NIL_P(tmp)) {
- obj = val;
- val = tmp;
- goto ary_join;
- }
- val = rb_obj_as_string(val);
- goto str_join;
+ tmp = rb_obj_as_string(tmp);
}
- }
-}
-
-VALUE
-rb_ary_join(VALUE ary, VALUE sep)
-{
- long len = 1, i;
- int taint = Qfalse;
- int untrust = Qfalse;
- VALUE val, tmp, result;
-
- if (RARRAY_LEN(ary) == 0) return rb_str_new(0, 0);
- if (OBJ_TAINTED(ary) || OBJ_TAINTED(sep)) taint = Qtrue;
- if (OBJ_UNTRUSTED(ary) || OBJ_UNTRUSTED(sep)) untrust = Qtrue;
-
- if (!NIL_P(sep)) {
- StringValue(sep);
- len += RSTRING_LEN(sep) * (RARRAY_LEN(ary) - 1);
- }
- for (i=0; i<RARRAY_LEN(ary); i++) {
- val = RARRAY_PTR(ary)[i];
- tmp = rb_check_string_type(val);
-
- if (NIL_P(tmp) || tmp != val) {
- result = rb_str_buf_new(len + (RARRAY_LEN(ary)-i)*10);
- if (taint) OBJ_TAINT(result);
- if (untrust) OBJ_UNTRUST(result);
- ary_join_0(ary, sep, i, result);
- ary_join_1(ary, ary, sep, i, result);
- return result;
- }
-
- len += RSTRING_LEN(tmp);
+ if (i > 0 && !NIL_P(sep))
+ rb_str_buf_append(result, sep);
+ rb_str_buf_append(result, tmp);
+ if (OBJ_TAINTED(tmp)) taint = Qtrue;
}
- result = rb_str_buf_new(len);
if (taint) OBJ_TAINT(result);
- if (untrust) OBJ_UNTRUST(result);
- ary_join_0(ary, sep, RARRAY_LEN(ary), result);
-
return result;
}
/*
* call-seq:
* array.join(sep=$,) -> str
- *
+ *
* Returns a string created by converting each element of the array to
* a string, separated by <i>sep</i>.
- *
+ *
* [ "a", "b", "c" ].join #=> "abc"
* [ "a", "b", "c" ].join("-") #=> "a-b-c"
*/
static VALUE
-rb_ary_join_m(int argc, VALUE *argv, VALUE ary)
+rb_ary_join_m(argc, argv, ary)
+ int argc;
+ VALUE *argv;
+ VALUE ary;
{
VALUE sep;
rb_scan_args(argc, argv, "01", &sep);
if (NIL_P(sep)) sep = rb_output_fs;
-
+
return rb_ary_join(ary, sep);
}
+/*
+ * call-seq:
+ * array.to_s -> string
+ *
+ * Returns _self_<code>.join</code>.
+ *
+ * [ "a", "e", "i", "o" ].to_s #=> "aeio"
+ *
+ */
+
+VALUE
+rb_ary_to_s(ary)
+ VALUE ary;
+{
+ if (RARRAY(ary)->len == 0) return rb_str_new(0, 0);
+
+ return rb_ary_join(ary, rb_output_fs);
+}
+
+static ID inspect_key;
+
+struct inspect_arg {
+ VALUE (*func)();
+ VALUE arg1, arg2;
+};
+
static VALUE
-inspect_ary(VALUE ary, VALUE dummy, int recur)
+inspect_call(arg)
+ struct inspect_arg *arg;
+{
+ return (*arg->func)(arg->arg1, arg->arg2);
+}
+
+static VALUE
+get_inspect_tbl(create)
+ int create;
+{
+ VALUE inspect_tbl = rb_thread_local_aref(rb_thread_current(), inspect_key);
+
+ if (NIL_P(inspect_tbl)) {
+ if (create) {
+ tbl_init:
+ inspect_tbl = rb_ary_new();
+ rb_thread_local_aset(rb_thread_current(), inspect_key, inspect_tbl);
+ }
+ }
+ else if (TYPE(inspect_tbl) != T_ARRAY) {
+ rb_warn("invalid inspect_tbl value");
+ if (create) goto tbl_init;
+ rb_thread_local_aset(rb_thread_current(), inspect_key, Qnil);
+ return Qnil;
+ }
+ return inspect_tbl;
+}
+
+static VALUE
+inspect_ensure(obj)
+ VALUE obj;
+{
+ VALUE inspect_tbl;
+
+ inspect_tbl = get_inspect_tbl(Qfalse);
+ if (!NIL_P(inspect_tbl)) {
+ rb_ary_pop(inspect_tbl);
+ }
+ return 0;
+}
+
+VALUE
+rb_protect_inspect(func, obj, arg)
+ VALUE (*func)(ANYARGS);
+ VALUE obj, arg;
+{
+ struct inspect_arg iarg;
+ VALUE inspect_tbl;
+ VALUE id;
+
+ inspect_tbl = get_inspect_tbl(Qtrue);
+ id = rb_obj_id(obj);
+ if (rb_ary_includes(inspect_tbl, id)) {
+ return (*func)(obj, arg);
+ }
+ rb_ary_push(inspect_tbl, id);
+ iarg.func = func;
+ iarg.arg1 = obj;
+ iarg.arg2 = arg;
+
+ return rb_ensure(inspect_call, (VALUE)&iarg, inspect_ensure, obj);
+}
+
+VALUE
+rb_inspecting_p(obj)
+ VALUE obj;
+{
+ VALUE inspect_tbl;
+
+ inspect_tbl = get_inspect_tbl(Qfalse);
+ if (NIL_P(inspect_tbl)) return Qfalse;
+ return rb_ary_includes(inspect_tbl, rb_obj_id(obj));
+}
+
+static VALUE
+inspect_ary(ary)
+ VALUE ary;
{
int tainted = OBJ_TAINTED(ary);
- int untrust = OBJ_UNTRUSTED(ary);
long i;
VALUE s, str;
- if (recur) return rb_tainted_str_new2("[...]");
str = rb_str_buf_new2("[");
- for (i=0; i<RARRAY_LEN(ary); i++) {
- s = rb_inspect(RARRAY_PTR(ary)[i]);
+ for (i=0; i<RARRAY(ary)->len; i++) {
+ s = rb_inspect(RARRAY(ary)->ptr[i]);
if (OBJ_TAINTED(s)) tainted = Qtrue;
- if (OBJ_UNTRUSTED(s)) untrust = Qtrue;
if (i > 0) rb_str_buf_cat2(str, ", ");
rb_str_buf_append(str, s);
}
rb_str_buf_cat2(str, "]");
if (tainted) OBJ_TAINT(str);
- if (untrust) OBJ_UNTRUST(str);
return str;
}
/*
* call-seq:
- * array.to_s -> string
* array.inspect -> string
*
* Create a printable version of <i>array</i>.
*/
static VALUE
-rb_ary_inspect(VALUE ary)
-{
- if (RARRAY_LEN(ary) == 0) return rb_usascii_str_new2("[]");
- return rb_exec_recursive(inspect_ary, ary, 0);
-}
-
-VALUE
-rb_ary_to_s(VALUE ary)
+rb_ary_inspect(ary)
+ VALUE ary;
{
- return rb_ary_inspect(ary);
+ if (RARRAY(ary)->len == 0) return rb_str_new2("[]");
+ if (rb_inspecting_p(ary)) return rb_str_new2("[...]");
+ return rb_protect_inspect(inspect_ary, ary, 0);
}
/*
* call-seq:
* array.to_a -> array
- *
+ *
* Returns _self_. If called on a subclass of Array, converts
* the receiver to an Array object.
*/
static VALUE
-rb_ary_to_a(VALUE ary)
+rb_ary_to_a(ary)
+ VALUE ary;
{
if (rb_obj_class(ary) != rb_cArray) {
- VALUE dup = rb_ary_new2(RARRAY_LEN(ary));
+ VALUE dup = rb_ary_new2(RARRAY(ary)->len);
rb_ary_replace(dup, ary);
return dup;
}
@@ -1730,26 +1614,28 @@ rb_ary_to_a(VALUE ary)
/*
* call-seq:
* array.to_ary -> array
- *
+ *
* Returns _self_.
*/
static VALUE
-rb_ary_to_ary_m(VALUE ary)
+rb_ary_to_ary_m(ary)
+ VALUE ary;
{
return ary;
}
VALUE
-rb_ary_reverse(VALUE ary)
+rb_ary_reverse(ary)
+ VALUE ary;
{
VALUE *p1, *p2;
VALUE tmp;
rb_ary_modify(ary);
- if (RARRAY_LEN(ary) > 1) {
- p1 = RARRAY_PTR(ary);
- p2 = p1 + RARRAY_LEN(ary) - 1; /* points last item */
+ if (RARRAY(ary)->len > 1) {
+ p1 = RARRAY(ary)->ptr;
+ p2 = p1 + RARRAY(ary)->len - 1; /* points last item */
while (p1 < p2) {
tmp = *p1;
@@ -1762,17 +1648,18 @@ rb_ary_reverse(VALUE ary)
/*
* call-seq:
- * array.reverse! -> array
- *
+ * array.reverse! -> array
+ *
* Reverses _self_ in place.
- *
+ *
* a = [ "a", "b", "c" ]
* a.reverse! #=> ["c", "b", "a"]
* a #=> ["c", "b", "a"]
*/
static VALUE
-rb_ary_reverse_bang(VALUE ary)
+rb_ary_reverse_bang(ary)
+ VALUE ary;
{
return rb_ary_reverse(ary);
}
@@ -1780,246 +1667,180 @@ rb_ary_reverse_bang(VALUE ary)
/*
* call-seq:
* array.reverse -> an_array
- *
+ *
* Returns a new array containing <i>self</i>'s elements in reverse order.
- *
+ *
* [ "a", "b", "c" ].reverse #=> ["c", "b", "a"]
* [ 1 ].reverse #=> [1]
*/
static VALUE
-rb_ary_reverse_m(VALUE ary)
+rb_ary_reverse_m(ary)
+ VALUE ary;
{
return rb_ary_reverse(rb_ary_dup(ary));
}
struct ary_sort_data {
VALUE ary;
- int opt_methods;
- int opt_inited;
-};
-
-enum {
- sort_opt_Fixnum,
- sort_opt_String,
- sort_optimizable_count
+ VALUE *ptr;
+ long len;
};
-#define STRING_P(s) (TYPE(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)
+static void
+ary_sort_check(data)
+ struct ary_sort_data *data;
{
- if (RBASIC(ary)->klass) {
- rb_raise(rb_eRuntimeError, "sort reentered");
+ if (RARRAY(data->ary)->ptr != data->ptr || RARRAY(data->ary)->len != data->len) {
+ rb_raise(rb_eArgError, "array modified during sort");
}
- return Qnil;
}
static int
-sort_1(const void *ap, const void *bp, void *dummy)
+sort_1(a, b, data)
+ VALUE *a, *b;
+ struct ary_sort_data *data;
{
- struct ary_sort_data *data = dummy;
- VALUE retval = sort_reentered(data->ary);
- VALUE a = *(const VALUE *)ap, b = *(const VALUE *)bp;
+ VALUE retval = rb_yield_values(2, *a, *b);
int n;
- retval = rb_yield_values(2, a, b);
- n = rb_cmpint(retval, a, b);
- sort_reentered(data->ary);
+ n = rb_cmpint(retval, *a, *b);
+ ary_sort_check(data);
return n;
}
static int
-sort_2(const void *ap, const void *bp, void *dummy)
+sort_2(ap, bp, data)
+ VALUE *ap, *bp;
+ struct ary_sort_data *data;
{
- struct ary_sort_data *data = dummy;
- VALUE retval = sort_reentered(data->ary);
- VALUE a = *(const VALUE *)ap, b = *(const VALUE *)bp;
+ VALUE retval;
+ VALUE a = *ap, b = *bp;
int n;
- if (FIXNUM_P(a) && FIXNUM_P(b) && SORT_OPTIMIZABLE(data, Fixnum)) {
+ if (FIXNUM_P(a) && FIXNUM_P(b)) {
if ((long)a > (long)b) return 1;
if ((long)a < (long)b) return -1;
return 0;
}
- if (STRING_P(a) && STRING_P(b) && SORT_OPTIMIZABLE(data, String)) {
- return rb_str_cmp(a, b);
+ if (TYPE(a) == T_STRING) {
+ if (TYPE(b) == T_STRING) return rb_str_cmp(a, b);
}
retval = rb_funcall(a, id_cmp, 1, b);
n = rb_cmpint(retval, a, b);
- sort_reentered(data->ary);
+ ary_sort_check(data);
return n;
}
+static VALUE
+sort_internal(ary)
+ VALUE ary;
+{
+ struct ary_sort_data data;
+
+ data.ary = ary;
+ data.ptr = RARRAY(ary)->ptr; data.len = RARRAY(ary)->len;
+ qsort(RARRAY(ary)->ptr, RARRAY(ary)->len, sizeof(VALUE),
+ rb_block_given_p()?sort_1:sort_2, &data);
+ return ary;
+}
+
+static VALUE
+sort_unlock(ary)
+ VALUE ary;
+{
+ FL_UNSET(ary, ARY_TMPLOCK);
+ return ary;
+}
+
/*
* call-seq:
* array.sort! -> array
- * array.sort! {| a,b | block } -> array
- *
+ * array.sort! {| a,b | block } -> array
+ *
* Sorts _self_. Comparisons for
* the sort will be done using the <code><=></code> operator or using
* an optional code block. The block implements a comparison between
* <i>a</i> and <i>b</i>, returning -1, 0, or +1. See also
* <code>Enumerable#sort_by</code>.
- *
+ *
* 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
-rb_ary_sort_bang(VALUE ary)
+rb_ary_sort_bang(ary)
+ VALUE ary;
{
rb_ary_modify(ary);
- assert(!ARY_SHARED_P(ary));
- if (RARRAY_LEN(ary) > 1) {
- VALUE tmp = ary_make_substitution(ary); /* only ary refers tmp */
- struct ary_sort_data data;
-
- RBASIC(tmp)->klass = 0;
- data.ary = tmp;
- data.opt_methods = 0;
- data.opt_inited = 0;
- ruby_qsort(RARRAY_PTR(tmp), RARRAY_LEN(tmp), sizeof(VALUE),
- rb_block_given_p()?sort_1:sort_2, &data);
-
- if (ARY_EMBED_P(tmp)) {
- assert(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);
- MEMCPY(RARRAY_PTR(ary), ARY_EMBED_PTR(tmp), VALUE, ARY_EMBED_LEN(tmp));
- ARY_SET_LEN(ary, ARY_EMBED_LEN(tmp));
- }
- else {
- assert(!ARY_EMBED_P(tmp));
- if (ARY_HEAP_PTR(ary) == ARY_HEAP_PTR(tmp)) {
- assert(!ARY_EMBED_P(ary));
- FL_UNSET_SHARED(ary);
- ARY_SET_CAPA(ary, ARY_CAPA(tmp));
- }
- else {
- assert(!ARY_SHARED_P(tmp));
- if (ARY_EMBED_P(ary)) {
- FL_UNSET_EMBED(ary);
- }
- else if (ARY_SHARED_P(ary)) {
- /* ary might be destructively operated in the given block */
- rb_ary_unshare(ary);
- }
- else {
- xfree(ARY_HEAP_PTR(ary));
- }
- ARY_SET_PTR(ary, RARRAY_PTR(tmp));
- ARY_SET_HEAP_LEN(ary, RARRAY_LEN(tmp));
- ARY_SET_CAPA(ary, ARY_CAPA(tmp));
- }
- /* 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(tmp)->klass = rb_cArray;
+ if (RARRAY(ary)->len > 1) {
+ FL_SET(ary, ARY_TMPLOCK); /* prohibit modification during sort */
+ rb_ensure(sort_internal, ary, sort_unlock, ary);
}
return ary;
}
/*
* call-seq:
- * array.sort -> an_array
- * array.sort {| a,b | block } -> an_array
- *
+ * array.sort -> an_array
+ * array.sort {| a,b | block } -> an_array
+ *
* Returns a new array created by sorting <i>self</i>. Comparisons for
* the sort will be done using the <code><=></code> operator or using
* an optional code block. The block implements a comparison between
* <i>a</i> and <i>b</i>, returning -1, 0, or +1. See also
* <code>Enumerable#sort_by</code>.
- *
+ *
* 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
-rb_ary_sort(VALUE ary)
+rb_ary_sort(ary)
+ VALUE ary;
{
ary = rb_ary_dup(ary);
rb_ary_sort_bang(ary);
return ary;
}
-
-static VALUE
-sort_by_i(VALUE i)
-{
- return rb_yield(i);
-}
-
-/*
- * call-seq:
- * array.sort_by! {| obj | block } -> array
- *
- * Sorts <i>array</i> in place using a set of keys generated by mapping the
- * values in <i>array</i> through the given block.
- */
-
-static VALUE
-rb_ary_sort_by_bang(VALUE ary)
-{
- VALUE sorted;
-
- RETURN_ENUMERATOR(ary, 0, 0);
- rb_ary_modify(ary);
- sorted = rb_block_call(ary, rb_intern("sort_by"), 0, 0, sort_by_i, 0);
- rb_ary_replace(ary, sorted);
- return ary;
-}
-
-
/*
* call-seq:
* array.collect {|item| block } -> an_array
* array.map {|item| block } -> an_array
- *
- * Invokes <i>block</i> once for each element of <i>self</i>. Creates a
+ *
+ * Invokes <i>block</i> once for each element of <i>self</i>. Creates a
* new array containing the values returned by the block.
* See also <code>Enumerable#collect</code>.
- *
+ *
* a = [ "a", "b", "c", "d" ]
* a.collect {|x| x + "!" } #=> ["a!", "b!", "c!", "d!"]
* a #=> ["a", "b", "c", "d"]
*/
static VALUE
-rb_ary_collect(VALUE ary)
+rb_ary_collect(ary)
+ VALUE ary;
{
long i;
VALUE collect;
- RETURN_ENUMERATOR(ary, 0, 0);
- collect = rb_ary_new2(RARRAY_LEN(ary));
- for (i = 0; i < RARRAY_LEN(ary); i++) {
- rb_ary_push(collect, rb_yield(RARRAY_PTR(ary)[i]));
+ if (!rb_block_given_p()) {
+ return rb_ary_new4(RARRAY(ary)->len, RARRAY(ary)->ptr);
+ }
+
+ collect = rb_ary_new2(RARRAY(ary)->len);
+ for (i = 0; i < RARRAY(ary)->len; i++) {
+ rb_ary_push(collect, rb_yield(RARRAY(ary)->ptr[i]));
}
return collect;
}
-
-/*
+/*
* call-seq:
* array.collect! {|item| block } -> array
* array.map! {|item| block } -> array
@@ -2027,27 +1848,33 @@ rb_ary_collect(VALUE ary)
* Invokes the block once for each element of _self_, replacing the
* element with the value returned by _block_.
* See also <code>Enumerable#collect</code>.
- *
+ *
* a = [ "a", "b", "c", "d" ]
* a.collect! {|x| x + "!" }
* a #=> [ "a!", "b!", "c!", "d!" ]
*/
static VALUE
-rb_ary_collect_bang(VALUE ary)
+rb_ary_collect_bang(ary)
+ VALUE ary;
{
long i;
RETURN_ENUMERATOR(ary, 0, 0);
rb_ary_modify(ary);
- for (i = 0; i < RARRAY_LEN(ary); i++) {
- rb_ary_store(ary, i, rb_yield(RARRAY_PTR(ary)[i]));
+ for (i = 0; i < RARRAY(ary)->len; i++) {
+ rb_ary_store(ary, i, rb_yield(RARRAY(ary)->ptr[i]));
}
return ary;
}
VALUE
-rb_get_values_at(VALUE obj, long olen, int argc, VALUE *argv, VALUE (*func) (VALUE, long))
+rb_values_at(obj, olen, argc, argv, func)
+ VALUE obj;
+ long olen;
+ int argc;
+ VALUE *argv;
+ VALUE (*func) _((VALUE,long));
{
VALUE result = rb_ary_new2(argc);
long beg, len, i, j;
@@ -2074,15 +1901,15 @@ rb_get_values_at(VALUE obj, long olen, int argc, VALUE *argv, VALUE (*func) (VAL
return result;
}
-/*
+/*
* call-seq:
* array.values_at(selector,... ) -> an_array
*
* Returns an array containing the elements in
* _self_ corresponding to the given selector(s). The selectors
- * may be either integer indices or ranges.
+ * may be either integer indices or ranges.
* See also <code>Array#select</code>.
- *
+ *
* a = %w{ a b c d e f }
* a.values_at(1, 3, 5)
* a.values_at(1, 3, 5, 7)
@@ -2091,34 +1918,37 @@ rb_get_values_at(VALUE obj, long olen, int argc, VALUE *argv, VALUE (*func) (VAL
*/
static VALUE
-rb_ary_values_at(int argc, VALUE *argv, VALUE ary)
+rb_ary_values_at(argc, argv, ary)
+ int argc;
+ VALUE *argv;
+ VALUE ary;
{
- return rb_get_values_at(ary, RARRAY_LEN(ary), argc, argv, rb_ary_entry);
+ return rb_values_at(ary, RARRAY(ary)->len, argc, argv, rb_ary_entry);
}
-
/*
* call-seq:
* array.select {|item| block } -> an_array
- *
+ *
* Invokes the block passing in successive elements from <i>array</i>,
* returning an array containing those elements for which the block
* returns a true value (equivalent to <code>Enumerable#select</code>).
- *
+ *
* a = %w{ a b c d e f }
* a.select {|v| v =~ /[aeiou]/} #=> ["a", "e"]
*/
static VALUE
-rb_ary_select(VALUE ary)
+rb_ary_select(ary)
+ VALUE ary;
{
VALUE result;
long i;
RETURN_ENUMERATOR(ary, 0, 0);
- result = rb_ary_new2(RARRAY_LEN(ary));
- for (i = 0; i < RARRAY_LEN(ary); i++) {
- if (RTEST(rb_yield(RARRAY_PTR(ary)[i]))) {
+ result = rb_ary_new2(RARRAY(ary)->len);
+ for (i = 0; i < RARRAY(ary)->len; i++) {
+ if (RTEST(rb_yield(RARRAY(ary)->ptr[i]))) {
rb_ary_push(result, rb_ary_elt(ary, i));
}
}
@@ -2127,14 +1957,14 @@ rb_ary_select(VALUE ary)
/*
* call-seq:
- * array.delete(obj) -> obj or nil
+ * array.delete(obj) -> obj or nil
* array.delete(obj) { block } -> obj or nil
- *
+ *
* Deletes items from <i>self</i> that are equal to <i>obj</i>. If
* the item is not found, returns <code>nil</code>. If the optional
* code block is given, returns the result of <i>block</i> if the item
* is not found.
- *
+ *
* a = [ "a", "b", "b", "b", "c" ]
* a.delete("b") #=> "b"
* a #=> ["a", "c"]
@@ -2143,24 +1973,22 @@ rb_ary_select(VALUE ary)
*/
VALUE
-rb_ary_delete(VALUE ary, VALUE item)
+rb_ary_delete(ary, item)
+ VALUE ary;
+ VALUE item;
{
- VALUE v = item;
long i1, i2;
- for (i1 = i2 = 0; i1 < RARRAY_LEN(ary); i1++) {
- VALUE e = RARRAY_PTR(ary)[i1];
+ for (i1 = i2 = 0; i1 < RARRAY(ary)->len; i1++) {
+ VALUE e = RARRAY(ary)->ptr[i1];
- if (rb_equal(e, item)) {
- v = e;
- continue;
- }
+ if (rb_equal(e, item)) continue;
if (i1 != i2) {
rb_ary_store(ary, i2, e);
}
i2++;
}
- if (RARRAY_LEN(ary) == i2) {
+ if (RARRAY(ary)->len == i2) {
if (rb_block_given_p()) {
return rb_yield(item);
}
@@ -2168,21 +1996,24 @@ rb_ary_delete(VALUE ary, VALUE item)
}
rb_ary_modify(ary);
- if (RARRAY_LEN(ary) > i2) {
- ARY_SET_LEN(ary, i2);
- if (i2 * 2 < ARY_CAPA(ary) &&
- ARY_CAPA(ary) > ARY_DEFAULT_SIZE) {
- ary_resize_capa(ary, i2*2);
+ if (RARRAY(ary)->len > i2) {
+ RARRAY(ary)->len = i2;
+ if (i2 * 2 < RARRAY(ary)->aux.capa &&
+ RARRAY(ary)->aux.capa > ARY_DEFAULT_SIZE) {
+ REALLOC_N(RARRAY(ary)->ptr, VALUE, i2 * 2);
+ RARRAY(ary)->aux.capa = i2 * 2;
}
}
- return v;
+ return item;
}
VALUE
-rb_ary_delete_at(VALUE ary, long pos)
+rb_ary_delete_at(ary, pos)
+ VALUE ary;
+ long pos;
{
- long len = RARRAY_LEN(ary);
+ long i, len = RARRAY(ary)->len;
VALUE del;
if (pos >= len) return Qnil;
@@ -2192,10 +2023,11 @@ rb_ary_delete_at(VALUE ary, long pos)
}
rb_ary_modify(ary);
- del = RARRAY_PTR(ary)[pos];
- MEMMOVE(RARRAY_PTR(ary)+pos, RARRAY_PTR(ary)+pos+1, VALUE,
- RARRAY_LEN(ary)-pos-1);
- ARY_INCREASE_LEN(ary, -1);
+ del = RARRAY(ary)->ptr[pos];
+ for (i = pos + 1; i < len; i++, pos++) {
+ RARRAY(ary)->ptr[pos] = RARRAY(ary)->ptr[i];
+ }
+ RARRAY(ary)->len = pos;
return del;
}
@@ -2203,11 +2035,11 @@ rb_ary_delete_at(VALUE ary, long pos)
/*
* call-seq:
* array.delete_at(index) -> obj or nil
- *
+ *
* Deletes the element at the specified index, returning that element,
* or <code>nil</code> if the index is out of range. See also
* <code>Array#slice!</code>.
- *
+ *
* a = %w( ant bat cat dog )
* a.delete_at(2) #=> "cat"
* a #=> ["ant", "bat", "dog"]
@@ -2215,7 +2047,8 @@ rb_ary_delete_at(VALUE ary, long pos)
*/
static VALUE
-rb_ary_delete_at_m(VALUE ary, VALUE pos)
+rb_ary_delete_at_m(ary, pos)
+ VALUE ary, pos;
{
return rb_ary_delete_at(ary, NUM2LONG(pos));
}
@@ -2224,12 +2057,18 @@ rb_ary_delete_at_m(VALUE ary, VALUE pos)
* call-seq:
* array.slice!(index) -> obj or nil
* array.slice!(start, length) -> sub_array or nil
- * array.slice!(range) -> sub_array or nil
- *
+ * array.slice!(range) -> sub_array or nil
+ *
* Deletes the element(s) given by an index (optionally with a length)
* or by a range. Returns the deleted object, subarray, or
- * <code>nil</code> if the index is out of range.
- *
+ * <code>nil</code> if the index is out of range. Equivalent to:
+ *
+ * def slice!(*args)
+ * result = self[*args]
+ * self[*args] = nil
+ * result
+ * end
+ *
* a = [ "a", "b", "c" ]
* a.slice!(1) #=> "b"
* a #=> ["a", "c"]
@@ -2240,15 +2079,18 @@ rb_ary_delete_at_m(VALUE ary, VALUE pos)
*/
static VALUE
-rb_ary_slice_bang(int argc, VALUE *argv, VALUE ary)
+rb_ary_slice_bang(argc, argv, ary)
+ int argc;
+ VALUE *argv;
+ VALUE ary;
{
VALUE arg1, arg2;
long pos, len, orig_len;
rb_ary_modify_check(ary);
- if (argc == 2) {
- pos = NUM2LONG(argv[0]);
- len = NUM2LONG(argv[1]);
+ if (rb_scan_args(argc, argv, "11", &arg1, &arg2) == 2) {
+ pos = NUM2LONG(arg1);
+ len = NUM2LONG(arg2);
delete_pos_len:
if (len < 0) return Qnil;
orig_len = RARRAY_LEN(ary);
@@ -2263,16 +2105,10 @@ rb_ary_slice_bang(int argc, VALUE *argv, VALUE ary)
if (len == 0) return rb_ary_new2(0);
arg2 = rb_ary_new4(len, RARRAY_PTR(ary)+pos);
RBASIC(arg2)->klass = rb_obj_class(ary);
- rb_ary_splice(ary, pos, len, Qundef);
+ rb_ary_splice(ary, pos, len, Qnil); /* Qundef in 1.9 */
return arg2;
}
- if (argc != 1) {
- /* error report */
- rb_scan_args(argc, argv, "11", NULL, NULL);
- }
- arg1 = argv[0];
-
if (!FIXNUM_P(arg1)) {
switch (rb_range_beg_len(arg1, &pos, &len, RARRAY_LEN(ary), 0)) {
case Qtrue:
@@ -2293,7 +2129,7 @@ rb_ary_slice_bang(int argc, VALUE *argv, VALUE ary)
/*
* call-seq:
* array.reject! {|item| block } -> array or nil
- *
+ *
* Equivalent to <code>Array#delete_if</code>, deleting elements from
* _self_ for which the block evaluates to true, but returns
* <code>nil</code> if no changes were made. Also see
@@ -2301,37 +2137,39 @@ rb_ary_slice_bang(int argc, VALUE *argv, VALUE ary)
*/
static VALUE
-rb_ary_reject_bang(VALUE ary)
+rb_ary_reject_bang(ary)
+ VALUE ary;
{
long i1, i2;
RETURN_ENUMERATOR(ary, 0, 0);
rb_ary_modify(ary);
- for (i1 = i2 = 0; i1 < RARRAY_LEN(ary); i1++) {
- VALUE v = RARRAY_PTR(ary)[i1];
+ for (i1 = i2 = 0; i1 < RARRAY(ary)->len; i1++) {
+ VALUE v = RARRAY(ary)->ptr[i1];
if (RTEST(rb_yield(v))) continue;
if (i1 != i2) {
rb_ary_store(ary, i2, v);
}
i2++;
}
+ if (RARRAY(ary)->len == i2) return Qnil;
+ if (i2 < RARRAY(ary)->len)
+ RARRAY(ary)->len = i2;
- if (RARRAY_LEN(ary) == i2) return Qnil;
- if (i2 < RARRAY_LEN(ary))
- ARY_SET_LEN(ary, i2);
return ary;
}
/*
* call-seq:
* array.reject {|item| block } -> an_array
- *
+ *
* Returns a new array containing the items in _self_
* for which the block is not true.
*/
static VALUE
-rb_ary_reject(VALUE ary)
+rb_ary_reject(ary)
+ VALUE ary;
{
RETURN_ENUMERATOR(ary, 0, 0);
ary = rb_ary_dup(ary);
@@ -2342,50 +2180,28 @@ rb_ary_reject(VALUE ary)
/*
* call-seq:
* array.delete_if {|item| block } -> array
- *
+ *
* Deletes every element of <i>self</i> for which <i>block</i> evaluates
* to <code>true</code>.
- *
+ *
* a = [ "a", "b", "c" ]
* a.delete_if {|x| x >= "b" } #=> ["a"]
*/
static VALUE
-rb_ary_delete_if(VALUE ary)
+rb_ary_delete_if(ary)
+ VALUE ary;
{
RETURN_ENUMERATOR(ary, 0, 0);
rb_ary_reject_bang(ary);
return ary;
}
-static VALUE
-take_i(VALUE val, VALUE *args, int argc, VALUE *argv)
-{
- if (args[1]-- == 0) rb_iter_break();
- if (argc > 1) val = rb_ary_new4(argc, argv);
- rb_ary_push(args[0], val);
- return Qnil;
-}
-
-static VALUE
-take_items(VALUE obj, long n)
-{
- VALUE result = rb_check_array_type(obj);
- VALUE args[2];
-
- if (!NIL_P(result)) return rb_ary_subseq(result, 0, n);
- result = rb_ary_new2(n);
- args[0] = result; args[1] = (VALUE)n;
- rb_block_call(obj, rb_intern("each"), 0, 0, take_i, (VALUE)args);
- return result;
-}
-
-
/*
* call-seq:
* array.zip(arg, ...) -> an_array
* array.zip(arg, ...) {| arr | block } -> nil
- *
+ *
* Converts any arguments to arrays, then merges elements of
* <i>self</i> with corresponding elements from each argument. This
* generates a sequence of <code>self.size</code> <em>n</em>-element
@@ -2394,42 +2210,50 @@ take_items(VALUE obj, long n)
* <code>nil</code> values are supplied. If a block given, it is
* invoked for each output array, otherwise an array of arrays is
* returned.
- *
+ *
* a = [ 4, 5, 6 ]
* b = [ 7, 8, 9 ]
+ *
* [1,2,3].zip(a, b) #=> [[1, 4, 7], [2, 5, 8], [3, 6, 9]]
* [1,2].zip(a,b) #=> [[1, 4, 7], [2, 5, 8]]
* a.zip([1,2],[8]) #=> [[4,1,8], [5,2,nil], [6,nil,nil]]
*/
static VALUE
-rb_ary_zip(int argc, VALUE *argv, VALUE ary)
+rb_ary_zip(argc, argv, ary)
+ int argc;
+ VALUE *argv;
+ VALUE ary;
{
int i, j;
long len;
- VALUE result = Qnil;
+ VALUE result;
- len = RARRAY_LEN(ary);
for (i=0; i<argc; i++) {
- argv[i] = take_items(argv[i], len);
- }
- if (!rb_block_given_p()) {
- result = rb_ary_new2(len);
+ argv[i] = to_ary(argv[i]);
}
+ if (rb_block_given_p()) {
+ for (i=0; i<RARRAY(ary)->len; i++) {
+ VALUE tmp = rb_ary_new2(argc+1);
- for (i=0; i<RARRAY_LEN(ary); i++) {
+ rb_ary_push(tmp, rb_ary_elt(ary, i));
+ for (j=0; j<argc; j++) {
+ rb_ary_push(tmp, rb_ary_elt(argv[j], i));
+ }
+ rb_yield(tmp);
+ }
+ return Qnil;
+ }
+ len = RARRAY(ary)->len;
+ result = rb_ary_new2(len);
+ for (i=0; i<len; i++) {
VALUE tmp = rb_ary_new2(argc+1);
rb_ary_push(tmp, rb_ary_elt(ary, i));
for (j=0; j<argc; j++) {
rb_ary_push(tmp, rb_ary_elt(argv[j], i));
}
- if (NIL_P(result)) {
- rb_yield(tmp);
- }
- else {
- rb_ary_push(result, tmp);
- }
+ rb_ary_push(result, tmp);
}
return result;
}
@@ -2437,34 +2261,35 @@ rb_ary_zip(int argc, VALUE *argv, VALUE ary)
/*
* call-seq:
* array.transpose -> an_array
- *
+ *
* Assumes that <i>self</i> is an array of arrays and transposes the
* rows and columns.
- *
+ *
* a = [[1,2], [3,4], [5,6]]
* a.transpose #=> [[1, 3, 5], [2, 4, 6]]
*/
static VALUE
-rb_ary_transpose(VALUE ary)
+rb_ary_transpose(ary)
+ VALUE ary;
{
long elen = -1, alen, i, j;
VALUE tmp, result = 0;
- alen = RARRAY_LEN(ary);
+ alen = RARRAY(ary)->len;
if (alen == 0) return rb_ary_dup(ary);
for (i=0; i<alen; i++) {
tmp = to_ary(rb_ary_elt(ary, i));
if (elen < 0) { /* first element */
- elen = RARRAY_LEN(tmp);
+ elen = RARRAY(tmp)->len;
result = rb_ary_new2(elen);
for (j=0; j<elen; j++) {
rb_ary_store(result, j, rb_ary_new2(alen));
}
}
- else if (elen != RARRAY_LEN(tmp)) {
- rb_raise(rb_eIndexError, "element size differs (%ld should be %ld)",
- RARRAY_LEN(tmp), elen);
+ else if (elen != RARRAY(tmp)->len) {
+ rb_raise(rb_eIndexError, "element size differs (%d should be %d)",
+ RARRAY(tmp)->len, elen);
}
for (j=0; j<elen; j++) {
rb_ary_store(rb_ary_elt(result, j), i, rb_ary_elt(tmp, j));
@@ -2476,58 +2301,36 @@ rb_ary_transpose(VALUE ary)
/*
* call-seq:
* array.replace(other_array) -> array
- *
+ *
* Replaces the contents of <i>self</i> with the contents of
* <i>other_array</i>, truncating or expanding if necessary.
- *
+ *
* a = [ "a", "b", "c", "d", "e" ]
* a.replace([ "x", "y", "z" ]) #=> ["x", "y", "z"]
* a #=> ["x", "y", "z"]
*/
-VALUE
-rb_ary_replace(VALUE copy, VALUE orig)
+static VALUE
+rb_ary_replace(copy, orig)
+ VALUE copy, orig;
{
+ VALUE shared;
+
+ rb_ary_modify(copy);
orig = to_ary(orig);
- rb_ary_modify_check(copy);
if (copy == orig) return copy;
+ shared = ary_make_shared(orig);
+ if (RARRAY(copy)->ptr && !FL_TEST(copy, ELTS_SHARED))
+ free(RARRAY(copy)->ptr);
+ RARRAY(copy)->ptr = RARRAY(orig)->ptr;
+ RARRAY(copy)->len = RARRAY(orig)->len;
+ RARRAY(copy)->aux.shared = shared;
+ FL_SET(copy, ELTS_SHARED);
- if (RARRAY_LEN(orig) <= RARRAY_EMBED_LEN_MAX) {
- VALUE *ptr;
- VALUE shared = 0;
-
- if (ARY_OWNS_HEAP_P(copy)) {
- xfree(RARRAY_PTR(copy));
- }
- else if (ARY_SHARED_P(copy)) {
- shared = ARY_SHARED(copy);
- FL_UNSET_SHARED(copy);
- }
- FL_SET_EMBED(copy);
- ptr = RARRAY_PTR(orig);
- MEMCPY(RARRAY_PTR(copy), ptr, VALUE, RARRAY_LEN(orig));
- if (shared) {
- rb_ary_decrement_share(shared);
- }
- ARY_SET_LEN(copy, RARRAY_LEN(orig));
- }
- else {
- VALUE shared = ary_make_shared(orig);
- if (ARY_OWNS_HEAP_P(copy)) {
- xfree(RARRAY_PTR(copy));
- }
- else {
- rb_ary_unshare_safe(copy);
- }
- FL_UNSET_EMBED(copy);
- ARY_SET_PTR(copy, RARRAY_PTR(orig));
- ARY_SET_LEN(copy, RARRAY_LEN(orig));
- rb_ary_set_shared(copy, shared);
- }
return copy;
}
-/*
+/*
* call-seq:
* array.clear -> array
*
@@ -2538,12 +2341,14 @@ rb_ary_replace(VALUE copy, VALUE orig)
*/
VALUE
-rb_ary_clear(VALUE ary)
+rb_ary_clear(ary)
+ VALUE ary;
{
rb_ary_modify(ary);
- ARY_SET_LEN(ary, 0);
- if (ARY_DEFAULT_SIZE * 2 < ARY_CAPA(ary)) {
- ary_resize_capa(ary, ARY_DEFAULT_SIZE * 2);
+ RARRAY(ary)->len = 0;
+ if (ARY_DEFAULT_SIZE * 2 < RARRAY(ary)->aux.capa) {
+ REALLOC_N(RARRAY(ary)->ptr, VALUE, ARY_DEFAULT_SIZE * 2);
+ RARRAY(ary)->aux.capa = ARY_DEFAULT_SIZE * 2;
}
return ary;
}
@@ -2556,15 +2361,14 @@ rb_ary_clear(VALUE ary)
* array.fill {|index| block } -> array
* array.fill(start [, length] ) {|index| block } -> array
* array.fill(range) {|index| block } -> array
- *
+ *
* The first three forms set the selected elements of <i>self</i> (which
* may be the entire array) to <i>obj</i>. A <i>start</i> of
* <code>nil</code> is equivalent to zero. A <i>length</i> of
* <code>nil</code> is equivalent to <i>self.length</i>. The last three
* forms fill the array with the value of the block. The block is
* passed the absolute index of each element to be filled.
- * Negative values of <i>start</i> count from the end of the array.
- *
+ *
* a = [ "a", "b", "c", "d" ]
* a.fill("x") #=> ["x", "x", "x", "x"]
* a.fill("z", 2, 2) #=> ["x", "x", "z", "z"]
@@ -2574,7 +2378,10 @@ rb_ary_clear(VALUE ary)
*/
static VALUE
-rb_ary_fill(int argc, VALUE *argv, VALUE ary)
+rb_ary_fill(argc, argv, ary)
+ int argc;
+ VALUE *argv;
+ VALUE ary;
{
VALUE item, arg1, arg2;
long beg = 0, end = 0, len = 0;
@@ -2592,20 +2399,20 @@ rb_ary_fill(int argc, VALUE *argv, VALUE ary)
switch (argc) {
case 1:
beg = 0;
- len = RARRAY_LEN(ary);
+ len = RARRAY(ary)->len;
break;
case 2:
- if (rb_range_beg_len(arg1, &beg, &len, RARRAY_LEN(ary), 1)) {
+ if (rb_range_beg_len(arg1, &beg, &len, RARRAY(ary)->len, 1)) {
break;
}
/* fall through */
case 3:
beg = NIL_P(arg1) ? 0 : NUM2LONG(arg1);
if (beg < 0) {
- beg = RARRAY_LEN(ary) + beg;
+ beg = RARRAY(ary)->len + beg;
if (beg < 0) beg = 0;
}
- len = NIL_P(arg2) ? RARRAY_LEN(ary) - beg : NUM2LONG(arg2);
+ len = NIL_P(arg2) ? RARRAY(ary)->len - beg : NUM2LONG(arg2);
break;
}
rb_ary_modify(ary);
@@ -2616,12 +2423,13 @@ rb_ary_fill(int argc, VALUE *argv, VALUE ary)
rb_raise(rb_eArgError, "argument too big");
}
end = beg + len;
- if (RARRAY_LEN(ary) < end) {
- if (end >= ARY_CAPA(ary)) {
- ary_resize_capa(ary, end);
+ if (end > RARRAY(ary)->len) {
+ if (end >= RARRAY(ary)->aux.capa) {
+ REALLOC_N(RARRAY(ary)->ptr, VALUE, end);
+ RARRAY(ary)->aux.capa = end;
}
- rb_mem_clear(RARRAY_PTR(ary) + RARRAY_LEN(ary), end - RARRAY_LEN(ary));
- ARY_SET_LEN(ary, end);
+ rb_mem_clear(RARRAY(ary)->ptr + RARRAY(ary)->len, end - RARRAY(ary)->len);
+ RARRAY(ary)->len = end;
}
if (block_p) {
@@ -2630,12 +2438,12 @@ rb_ary_fill(int argc, VALUE *argv, VALUE ary)
for (i=beg; i<end; i++) {
v = rb_yield(LONG2NUM(i));
- if (i>=RARRAY_LEN(ary)) break;
- RARRAY_PTR(ary)[i] = v;
+ if (i>=RARRAY(ary)->len) break;
+ RARRAY(ary)->ptr[i] = v;
}
}
else {
- p = RARRAY_PTR(ary) + beg;
+ p = RARRAY(ary)->ptr + beg;
pend = p + len;
while (p < pend) {
*p++ = item;
@@ -2644,53 +2452,55 @@ rb_ary_fill(int argc, VALUE *argv, VALUE ary)
return ary;
}
-/*
+/*
* call-seq:
* array + other_array -> an_array
*
* Concatenation---Returns a new array built by concatenating the
* two arrays together to produce a third array.
- *
+ *
* [ 1, 2, 3 ] + [ 4, 5 ] #=> [ 1, 2, 3, 4, 5 ]
*/
VALUE
-rb_ary_plus(VALUE x, VALUE y)
+rb_ary_plus(x, y)
+ VALUE x, y;
{
VALUE z;
long len;
y = to_ary(y);
- len = RARRAY_LEN(x) + RARRAY_LEN(y);
+ len = RARRAY(x)->len + RARRAY(y)->len;
z = rb_ary_new2(len);
- MEMCPY(RARRAY_PTR(z), RARRAY_PTR(x), VALUE, RARRAY_LEN(x));
- MEMCPY(RARRAY_PTR(z) + RARRAY_LEN(x), RARRAY_PTR(y), VALUE, RARRAY_LEN(y));
- ARY_SET_LEN(z, len);
+ MEMCPY(RARRAY(z)->ptr, RARRAY(x)->ptr, VALUE, RARRAY(x)->len);
+ MEMCPY(RARRAY(z)->ptr + RARRAY(x)->len, RARRAY(y)->ptr, VALUE, RARRAY(y)->len);
+ RARRAY(z)->len = len;
return z;
}
-/*
+/*
* call-seq:
* array.concat(other_array) -> array
*
* Appends the elements in other_array to _self_.
- *
+ *
* [ "a", "b" ].concat( ["c", "d"] ) #=> [ "a", "b", "c", "d" ]
*/
VALUE
-rb_ary_concat(VALUE x, VALUE y)
+rb_ary_concat(x, y)
+ VALUE x, y;
{
y = to_ary(y);
- if (RARRAY_LEN(y) > 0) {
- rb_ary_splice(x, RARRAY_LEN(x), 0, y);
+ if (RARRAY(y)->len > 0) {
+ rb_ary_splice(x, RARRAY(x)->len, 0, y);
}
return x;
}
-/*
+/*
* call-seq:
* array * int -> an_array
* array * str -> a_string
@@ -2706,7 +2516,8 @@ rb_ary_concat(VALUE x, VALUE y)
*/
static VALUE
-rb_ary_times(VALUE ary, VALUE times)
+rb_ary_times(ary, times)
+ VALUE ary, times;
{
VALUE ary2, tmp;
long i, len;
@@ -2717,31 +2528,27 @@ rb_ary_times(VALUE ary, VALUE times)
}
len = NUM2LONG(times);
- if (len == 0) {
- ary2 = ary_new(rb_obj_class(ary), 0);
- goto out;
- }
+ if (len == 0) return ary_new(rb_obj_class(ary), 0);
if (len < 0) {
rb_raise(rb_eArgError, "negative argument");
}
- if (ARY_MAX_SIZE/len < RARRAY_LEN(ary)) {
+ if (ARY_MAX_SIZE/len < RARRAY(ary)->len) {
rb_raise(rb_eArgError, "argument too big");
}
- len *= RARRAY_LEN(ary);
+ len *= RARRAY(ary)->len;
ary2 = ary_new(rb_obj_class(ary), len);
- ARY_SET_LEN(ary2, len);
+ RARRAY(ary2)->len = len;
- for (i=0; i<len; i+=RARRAY_LEN(ary)) {
- MEMCPY(RARRAY_PTR(ary2)+i, RARRAY_PTR(ary), VALUE, RARRAY_LEN(ary));
+ for (i=0; i<len; i+=RARRAY(ary)->len) {
+ MEMCPY(RARRAY(ary2)->ptr+i, RARRAY(ary)->ptr, VALUE, RARRAY(ary)->len);
}
- out:
OBJ_INFECT(ary2, ary);
return ary2;
}
-/*
+/*
* call-seq:
* array.assoc(obj) -> an_array or nil
*
@@ -2762,15 +2569,16 @@ rb_ary_times(VALUE ary, VALUE times)
*/
VALUE
-rb_ary_assoc(VALUE ary, VALUE key)
+rb_ary_assoc(ary, key)
+ VALUE ary, key;
{
long i;
VALUE v;
- for (i = 0; i < RARRAY_LEN(ary); ++i) {
- v = rb_check_array_type(RARRAY_PTR(ary)[i]);
- if (!NIL_P(v) && RARRAY_LEN(v) > 0 &&
- rb_equal(RARRAY_PTR(v)[0], key))
+ for (i = 0; i < RARRAY(ary)->len; ++i) {
+ v = rb_check_array_type(RARRAY(ary)->ptr[i]);
+ if (!NIL_P(v) && RARRAY(v)->len > 0 &&
+ rb_equal(RARRAY(v)->ptr[0], key))
return v;
}
return Qnil;
@@ -2778,48 +2586,52 @@ rb_ary_assoc(VALUE ary, VALUE key)
/*
* call-seq:
- * array.rassoc(obj) -> an_array or nil
- *
+ * array.rassoc(key) -> an_array or nil
+ *
* Searches through the array whose elements are also arrays. Compares
- * _obj_ with the second element of each contained array using
+ * <em>key</em> with the second element of each contained array using
* <code>==</code>. Returns the first contained array that matches. See
* also <code>Array#assoc</code>.
- *
+ *
* a = [ [ 1, "one"], [2, "two"], [3, "three"], ["ii", "two"] ]
* a.rassoc("two") #=> [2, "two"]
* a.rassoc("four") #=> nil
*/
VALUE
-rb_ary_rassoc(VALUE ary, VALUE value)
+rb_ary_rassoc(ary, value)
+ VALUE ary, value;
{
long i;
VALUE v;
- for (i = 0; i < RARRAY_LEN(ary); ++i) {
- v = RARRAY_PTR(ary)[i];
+ for (i = 0; i < RARRAY(ary)->len; ++i) {
+ v = RARRAY(ary)->ptr[i];
if (TYPE(v) == T_ARRAY &&
- RARRAY_LEN(v) > 1 &&
- rb_equal(RARRAY_PTR(v)[1], value))
+ RARRAY(v)->len > 1 &&
+ rb_equal(RARRAY(v)->ptr[1], value))
return v;
}
return Qnil;
}
+static VALUE recursive_equal _((VALUE, VALUE, int));
static VALUE
-recursive_equal(VALUE ary1, VALUE ary2, int recur)
+recursive_equal(ary1, ary2, recur)
+ VALUE ary1, ary2;
+ int recur;
{
long i;
- if (recur) return Qtrue; /* Subtle! */
- for (i=0; i<RARRAY_LEN(ary1); i++) {
+ if (recur) return Qfalse;
+ for (i=0; i<RARRAY(ary1)->len; i++) {
if (!rb_equal(rb_ary_elt(ary1, i), rb_ary_elt(ary2, i)))
return Qfalse;
}
return Qtrue;
}
-/*
+/*
* call-seq:
* array == other_array -> bool
*
@@ -2834,7 +2646,8 @@ recursive_equal(VALUE ary1, VALUE ary2, int recur)
*/
static VALUE
-rb_ary_equal(VALUE ary1, VALUE ary2)
+rb_ary_equal(ary1, ary2)
+ VALUE ary1, ary2;
{
if (ary1 == ary2) return Qtrue;
if (TYPE(ary2) != T_ARRAY) {
@@ -2843,17 +2656,20 @@ rb_ary_equal(VALUE ary1, VALUE ary2)
}
return rb_equal(ary2, ary1);
}
- if (RARRAY_LEN(ary1) != RARRAY_LEN(ary2)) return Qfalse;
- return rb_exec_recursive_paired(recursive_equal, ary1, ary2, ary2);
+ if (RARRAY(ary1)->len != RARRAY(ary2)->len) return Qfalse;
+ return rb_exec_recursive(recursive_equal, ary1, ary2);
}
+static VALUE recursive_eql _((VALUE, VALUE, int));
static VALUE
-recursive_eql(VALUE ary1, VALUE ary2, int recur)
+recursive_eql(ary1, ary2, recur)
+ VALUE ary1, ary2;
+ int recur;
{
long i;
- if (recur) return Qtrue; /* Subtle! */
- for (i=0; i<RARRAY_LEN(ary1); i++) {
+ if (recur) return Qfalse;
+ for (i=0; i<RARRAY(ary1)->len; i++) {
if (!rb_eql(rb_ary_elt(ary1, i), rb_ary_elt(ary2, i)))
return Qfalse;
}
@@ -2869,29 +2685,35 @@ recursive_eql(VALUE ary1, VALUE ary2, int recur)
*/
static VALUE
-rb_ary_eql(VALUE ary1, VALUE ary2)
+rb_ary_eql(ary1, ary2)
+ VALUE ary1, ary2;
{
if (ary1 == ary2) return Qtrue;
if (TYPE(ary2) != T_ARRAY) return Qfalse;
- if (RARRAY_LEN(ary1) != RARRAY_LEN(ary2)) return Qfalse;
- return rb_exec_recursive_paired(recursive_eql, ary1, ary2, ary2);
+ if (RARRAY(ary1)->len != RARRAY(ary2)->len) return Qfalse;
+ return rb_exec_recursive(recursive_eql, ary1, ary2);
}
+static VALUE recursive_hash _((VALUE, VALUE, int));
static VALUE
-recursive_hash(VALUE ary, VALUE dummy, int recur)
+recursive_hash(ary, dummy, recur)
+ VALUE ary;
+ VALUE dummy;
+ int recur;
{
long i, h;
VALUE n;
if (recur) {
- rb_raise(rb_eArgError, "recursive key for hash");
+ return LONG2FIX(0);
}
- h = rb_hash_start(RARRAY_LEN(ary));
- for (i=0; i<RARRAY_LEN(ary); i++) {
- n = rb_hash(RARRAY_PTR(ary)[i]);
- h = rb_hash_uint(h, NUM2LONG(n));
+
+ h = RARRAY(ary)->len;
+ for (i=0; i<RARRAY(ary)->len; i++) {
+ h = (h << 1) | (h<0 ? 1 : 0);
+ n = rb_hash(RARRAY(ary)->ptr[i]);
+ h ^= NUM2LONG(n);
}
- h = rb_hash_end(h);
return LONG2FIX(h);
}
@@ -2904,7 +2726,8 @@ recursive_hash(VALUE ary, VALUE dummy, int recur)
*/
static VALUE
-rb_ary_hash(VALUE ary)
+rb_ary_hash(ary)
+ VALUE ary;
{
return rb_exec_recursive(recursive_hash, ary, 0);
}
@@ -2912,23 +2735,25 @@ rb_ary_hash(VALUE ary)
/*
* call-seq:
* array.include?(obj) -> true or false
- *
+ *
* Returns <code>true</code> if the given object is present in
* <i>self</i> (that is, if any object <code>==</code> <i>anObject</i>),
* <code>false</code> otherwise.
- *
+ *
* a = [ "a", "b", "c" ]
* a.include?("b") #=> true
* a.include?("z") #=> false
*/
VALUE
-rb_ary_includes(VALUE ary, VALUE item)
+rb_ary_includes(ary, item)
+ VALUE ary;
+ VALUE item;
{
long i;
-
- for (i=0; i<RARRAY_LEN(ary); i++) {
- if (rb_equal(RARRAY_PTR(ary)[i], item)) {
+
+ for (i=0; i<RARRAY(ary)->len; i++) {
+ if (rb_equal(RARRAY(ary)->ptr[i], item)) {
return Qtrue;
}
}
@@ -2936,15 +2761,19 @@ rb_ary_includes(VALUE ary, VALUE item)
}
+static VALUE recursive_cmp _((VALUE, VALUE, int));
static VALUE
-recursive_cmp(VALUE ary1, VALUE ary2, int recur)
+recursive_cmp(ary1, ary2, recur)
+ VALUE ary1;
+ VALUE ary2;
+ int recur;
{
long i, len;
- if (recur) return Qundef; /* Subtle! */
- len = RARRAY_LEN(ary1);
- if (len > RARRAY_LEN(ary2)) {
- len = RARRAY_LEN(ary2);
+ if (recur) return Qnil;
+ len = RARRAY(ary1)->len;
+ if (len > RARRAY(ary2)->len) {
+ len = RARRAY(ary2)->len;
}
for (i=0; i<len; i++) {
VALUE v = rb_funcall(rb_ary_elt(ary1, i), id_cmp, 1, rb_ary_elt(ary2, i));
@@ -2955,7 +2784,7 @@ recursive_cmp(VALUE ary1, VALUE ary2, int recur)
return Qundef;
}
-/*
+/*
* call-seq:
* array <=> other_array -> -1, 0, +1
*
@@ -2969,87 +2798,48 @@ recursive_cmp(VALUE ary1, VALUE ary2, int recur)
* ``equal'' according to <code>Array#<=></code> if and only if they have
* the same length and the value of each element is equal to the
* value of the corresponding element in the other array.
- *
+ *
* [ "a", "a", "c" ] <=> [ "a", "b", "c" ] #=> -1
* [ 1, 2, 3, 4, 5, 6 ] <=> [ 1, 2 ] #=> +1
*
*/
VALUE
-rb_ary_cmp(VALUE ary1, VALUE ary2)
+rb_ary_cmp(ary1, ary2)
+ VALUE ary1, ary2;
{
long len;
VALUE v;
ary2 = to_ary(ary2);
if (ary1 == ary2) return INT2FIX(0);
- v = rb_exec_recursive_paired(recursive_cmp, ary1, ary2, ary2);
+ v = rb_exec_recursive(recursive_cmp, ary1, ary2);
if (v != Qundef) return v;
- len = RARRAY_LEN(ary1) - RARRAY_LEN(ary2);
+ len = RARRAY(ary1)->len - RARRAY(ary2)->len;
if (len == 0) return INT2FIX(0);
if (len > 0) return INT2FIX(1);
return INT2FIX(-1);
}
static VALUE
-ary_add_hash(VALUE hash, VALUE ary)
-{
- long i;
-
- for (i=0; i<RARRAY_LEN(ary); i++) {
- rb_hash_aset(hash, RARRAY_PTR(ary)[i], Qtrue);
- }
- return hash;
-}
-
-static inline VALUE
-ary_tmp_hash_new(void)
+ary_make_hash(ary1, ary2)
+ VALUE ary1, ary2;
{
VALUE hash = rb_hash_new();
-
- RBASIC(hash)->klass = 0;
- return hash;
-}
-
-static VALUE
-ary_make_hash(VALUE ary)
-{
- VALUE hash = ary_tmp_hash_new();
- return ary_add_hash(hash, ary);
-}
-
-static VALUE
-ary_add_hash_by(VALUE hash, VALUE ary)
-{
long i;
- for (i = 0; i < RARRAY_LEN(ary); ++i) {
- VALUE v = rb_ary_elt(ary, i), k = rb_yield(v);
- if (rb_hash_lookup2(hash, k, Qundef) == Qundef) {
- rb_hash_aset(hash, k, v);
+ for (i=0; i<RARRAY(ary1)->len; i++) {
+ rb_hash_aset(hash, RARRAY(ary1)->ptr[i], Qtrue);
+ }
+ if (ary2) {
+ for (i=0; i<RARRAY(ary2)->len; i++) {
+ rb_hash_aset(hash, RARRAY(ary2)->ptr[i], Qtrue);
}
}
return hash;
}
-static VALUE
-ary_make_hash_by(VALUE ary)
-{
- VALUE hash = ary_tmp_hash_new();
- return ary_add_hash_by(hash, ary);
-}
-
-static inline void
-ary_recycle_hash(VALUE hash)
-{
- if (RHASH(hash)->ntbl) {
- st_table *tbl = RHASH(hash)->ntbl;
- RHASH(hash)->ntbl = 0;
- st_free_table(tbl);
- }
-}
-
-/*
+/*
* call-seq:
* array - other_array -> an_array
*
@@ -3062,24 +2852,24 @@ ary_recycle_hash(VALUE hash)
*/
static VALUE
-rb_ary_diff(VALUE ary1, VALUE ary2)
+rb_ary_diff(ary1, ary2)
+ VALUE ary1, ary2;
{
VALUE ary3;
volatile VALUE hash;
long i;
- hash = ary_make_hash(to_ary(ary2));
+ hash = ary_make_hash(to_ary(ary2), 0);
ary3 = rb_ary_new();
- for (i=0; i<RARRAY_LEN(ary1); i++) {
- if (st_lookup(RHASH_TBL(hash), RARRAY_PTR(ary1)[i], 0)) continue;
+ for (i=0; i<RARRAY(ary1)->len; i++) {
+ if (st_lookup(RHASH(hash)->tbl, RARRAY(ary1)->ptr[i], 0)) continue;
rb_ary_push(ary3, rb_ary_elt(ary1, i));
}
- ary_recycle_hash(hash);
return ary3;
}
-/*
+/*
* call-seq:
* array & other_array
*
@@ -3091,31 +2881,28 @@ rb_ary_diff(VALUE ary1, VALUE ary2)
static VALUE
-rb_ary_and(VALUE ary1, VALUE ary2)
+rb_ary_and(ary1, ary2)
+ VALUE ary1, ary2;
{
VALUE hash, ary3, v, vv;
long i;
ary2 = to_ary(ary2);
- ary3 = rb_ary_new2(RARRAY_LEN(ary1) < RARRAY_LEN(ary2) ?
- RARRAY_LEN(ary1) : RARRAY_LEN(ary2));
- hash = ary_make_hash(ary2);
-
- if (RHASH_EMPTY_P(hash))
- return ary3;
+ ary3 = rb_ary_new2(RARRAY(ary1)->len < RARRAY(ary2)->len ?
+ RARRAY(ary1)->len : RARRAY(ary2)->len);
+ hash = ary_make_hash(ary2, 0);
- for (i=0; i<RARRAY_LEN(ary1); i++) {
+ for (i=0; i<RARRAY(ary1)->len; i++) {
v = vv = rb_ary_elt(ary1, i);
- if (st_delete(RHASH_TBL(hash), (st_data_t*)&vv, 0)) {
+ if (st_delete(RHASH(hash)->tbl, (st_data_t*)&vv, 0)) {
rb_ary_push(ary3, v);
}
}
- ary_recycle_hash(hash);
return ary3;
}
-/*
+/*
* call-seq:
* array | other_array -> an_array
*
@@ -3127,84 +2914,65 @@ rb_ary_and(VALUE ary1, VALUE ary2)
*/
static VALUE
-rb_ary_or(VALUE ary1, VALUE ary2)
+rb_ary_or(ary1, ary2)
+ VALUE ary1, ary2;
{
VALUE hash, ary3;
VALUE v, vv;
long i;
ary2 = to_ary(ary2);
- ary3 = rb_ary_new2(RARRAY_LEN(ary1)+RARRAY_LEN(ary2));
- hash = ary_add_hash(ary_make_hash(ary1), ary2);
+ ary3 = rb_ary_new2(RARRAY(ary1)->len+RARRAY(ary2)->len);
+ hash = ary_make_hash(ary1, ary2);
- for (i=0; i<RARRAY_LEN(ary1); i++) {
+ for (i=0; i<RARRAY(ary1)->len; i++) {
v = vv = rb_ary_elt(ary1, i);
- if (st_delete(RHASH_TBL(hash), (st_data_t*)&vv, 0)) {
+ if (st_delete(RHASH(hash)->tbl, (st_data_t*)&vv, 0)) {
rb_ary_push(ary3, v);
}
}
- for (i=0; i<RARRAY_LEN(ary2); i++) {
+ for (i=0; i<RARRAY(ary2)->len; i++) {
v = vv = rb_ary_elt(ary2, i);
- if (st_delete(RHASH_TBL(hash), (st_data_t*)&vv, 0)) {
+ if (st_delete(RHASH(hash)->tbl, (st_data_t*)&vv, 0)) {
rb_ary_push(ary3, v);
}
}
- ary_recycle_hash(hash);
return ary3;
}
-static int
-push_value(st_data_t key, st_data_t val, st_data_t ary)
-{
- rb_ary_push((VALUE)ary, (VALUE)val);
- return ST_CONTINUE;
-}
-
/*
* call-seq:
* array.uniq! -> array or nil
- *
+ *
* Removes duplicate elements from _self_.
* Returns <code>nil</code> if no changes are made (that is, no
* duplicates are found).
- *
+ *
* a = [ "a", "a", "b", "b", "c" ]
* a.uniq! #=> ["a", "b", "c"]
* b = [ "a", "b", "c" ]
* b.uniq! #=> nil
- * c = [ "a:def", "a:xyz", "b:abc", "b:xyz", "c:jkl" ]
- * c.uniq! {|s| s[/^\w+/]} #=> [ "a:def", "b:abc", "c:jkl" ]
*/
static VALUE
-rb_ary_uniq_bang(VALUE ary)
+rb_ary_uniq_bang(ary)
+ VALUE ary;
{
- VALUE hash, v;
+ VALUE hash, v, vv;
long i, j;
- if (rb_block_given_p()) {
- hash = ary_make_hash_by(ary);
- if (RARRAY_LEN(ary) == (i = RHASH_SIZE(hash))) {
- return Qnil;
- }
- ary_resize_capa(ary, i);
- ARY_SET_LEN(ary, 0);
- st_foreach(RHASH_TBL(hash), push_value, ary);
+ hash = ary_make_hash(ary, 0);
+
+ if (RARRAY(ary)->len == RHASH(hash)->tbl->num_entries) {
+ return Qnil;
}
- else {
- hash = ary_make_hash(ary);
- if (RARRAY_LEN(ary) == (long)RHASH_SIZE(hash)) {
- return Qnil;
- }
- for (i=j=0; i<RARRAY_LEN(ary); i++) {
- st_data_t vv = (st_data_t)(v = rb_ary_elt(ary, i));
- if (st_delete(RHASH_TBL(hash), &vv, 0)) {
- rb_ary_store(ary, j++, v);
- }
+ for (i=j=0; i<RARRAY(ary)->len; i++) {
+ v = vv = rb_ary_elt(ary, i);
+ if (st_delete(RHASH(hash)->tbl, (st_data_t*)&vv, 0)) {
+ rb_ary_store(ary, j++, v);
}
- ARY_SET_LEN(ary, j);
}
- ary_recycle_hash(hash);
+ RARRAY(ary)->len = j;
return ary;
}
@@ -3212,42 +2980,23 @@ rb_ary_uniq_bang(VALUE ary)
/*
* call-seq:
* array.uniq -> an_array
- *
+ *
* Returns a new array by removing duplicate values in <i>self</i>.
- *
+ *
* a = [ "a", "a", "b", "b", "c" ]
* a.uniq #=> ["a", "b", "c"]
- * c = [ "a:def", "a:xyz", "b:abc", "b:xyz", "c:jkl" ]
- * c.uniq {|s| s[/^\w+/]} #=> [ "a:def", "b:abc", "c:jkl" ]
*/
static VALUE
-rb_ary_uniq(VALUE ary)
+rb_ary_uniq(ary)
+ VALUE ary;
{
- VALUE hash, uniq, v;
- long i;
-
- if (rb_block_given_p()) {
- hash = ary_make_hash_by(ary);
- uniq = ary_new(rb_obj_class(ary), RHASH_SIZE(hash));
- st_foreach(RHASH_TBL(hash), push_value, uniq);
- }
- else {
- hash = ary_make_hash(ary);
- uniq = ary_new(rb_obj_class(ary), RHASH_SIZE(hash));
- for (i=0; i<RARRAY_LEN(ary); i++) {
- st_data_t vv = (st_data_t)(v = rb_ary_elt(ary, i));
- if (st_delete(RHASH_TBL(hash), &vv, 0)) {
- rb_ary_push(uniq, v);
- }
- }
- }
- ary_recycle_hash(hash);
-
- return uniq;
+ ary = rb_ary_dup(ary);
+ rb_ary_uniq_bang(ary);
+ return ary;
}
-/*
+/*
* call-seq:
* array.compact! -> array or nil
*
@@ -3259,27 +3008,24 @@ rb_ary_uniq(VALUE ary)
*/
static VALUE
-rb_ary_compact_bang(VALUE ary)
+rb_ary_compact_bang(ary)
+ VALUE ary;
{
VALUE *p, *t, *end;
- long n;
rb_ary_modify(ary);
- p = t = RARRAY_PTR(ary);
- end = p + RARRAY_LEN(ary);
-
+ p = t = RARRAY(ary)->ptr;
+ end = p + RARRAY(ary)->len;
+
while (t < end) {
if (NIL_P(*t)) t++;
else *p++ = *t++;
}
- n = p - RARRAY_PTR(ary);
- if (RARRAY_LEN(ary) == n) {
+ if (RARRAY(ary)->len == (p - RARRAY(ary)->ptr)) {
return Qnil;
}
- ARY_SET_LEN(ary, n);
- if (n * 2 < ARY_CAPA(ary) && ARY_DEFAULT_SIZE * 2 < ARY_CAPA(ary)) {
- ary_resize_capa(ary, n * 2);
- }
+ RARRAY(ary)->len = RARRAY(ary)->aux.capa = (p - RARRAY(ary)->ptr);
+ REALLOC_N(RARRAY(ary)->ptr, VALUE, RARRAY(ary)->len);
return ary;
}
@@ -3295,7 +3041,8 @@ rb_ary_compact_bang(VALUE ary)
*/
static VALUE
-rb_ary_compact(VALUE ary)
+rb_ary_compact(ary)
+ VALUE ary;
{
ary = rb_ary_dup(ary);
rb_ary_compact_bang(ary);
@@ -3304,10 +3051,34 @@ rb_ary_compact(VALUE ary)
/*
* call-seq:
+ * array.nitems -> int
+ *
+ * Returns the number of non-<code>nil</code> elements in _self_.
+ *
+ * May be zero.
+ *
+ * [ 1, nil, 3, nil, 5 ].nitems #=> 3
+ */
+
+static VALUE
+rb_ary_nitems(ary)
+ VALUE ary;
+{
+ long n = 0;
+ VALUE *p, *pend;
+
+ for (p = RARRAY(ary)->ptr, pend = p + RARRAY(ary)->len; p < pend; p++) {
+ if (!NIL_P(*p)) n++;
+ }
+ return LONG2NUM(n);
+}
+
+/*
+ * call-seq:
* array.count -> int
* array.count(obj) -> int
* array.count { |item| block } -> int
- *
+ *
* Returns the number of elements. If an argument is given, counts
* the number of elements which equals to <i>obj</i>. If a block is
* given, counts the number of elements yielding a true value.
@@ -3320,7 +3091,10 @@ rb_ary_compact(VALUE ary)
*/
static VALUE
-rb_ary_count(int argc, VALUE *argv, VALUE ary)
+rb_ary_count(argc, argv, ary)
+ int argc;
+ VALUE *argv;
+ VALUE ary;
{
long n = 0;
@@ -3350,7 +3124,10 @@ rb_ary_count(int argc, VALUE *argv, VALUE ary)
}
static VALUE
-flatten(VALUE ary, int level, int *modified)
+flatten(ary, level, modified)
+ VALUE ary;
+ int level;
+ int *modified;
{
long i = 0;
VALUE stack, result, tmp, elt;
@@ -3364,13 +3141,13 @@ flatten(VALUE ary, int level, int *modified)
*modified = 0;
while (1) {
- while (i < RARRAY_LEN(ary)) {
- elt = RARRAY_PTR(ary)[i++];
+ while (i < RARRAY(ary)->len) {
+ elt = RARRAY(ary)->ptr[i++];
tmp = rb_check_array_type(elt);
if (RBASIC(result)->klass) {
rb_raise(rb_eRuntimeError, "flatten reentered");
}
- if (NIL_P(tmp) || (level >= 0 && RARRAY_LEN(stack) / 2 >= level)) {
+ if (NIL_P(tmp) || (level >= 0 && RARRAY(stack)->len / 2 >= level)) {
rb_ary_push(result, elt);
}
else {
@@ -3387,7 +3164,7 @@ flatten(VALUE ary, int level, int *modified)
i = 0;
}
}
- if (RARRAY_LEN(stack) == 0) {
+ if (RARRAY(stack)->len == 0) {
break;
}
id = (st_data_t)ary;
@@ -3407,12 +3184,12 @@ flatten(VALUE ary, int level, int *modified)
* call-seq:
* array.flatten! -> array or nil
* array.flatten!(level) -> array or nil
- *
+ *
* Flattens _self_ in place.
* Returns <code>nil</code> if no modifications were made (i.e.,
* <i>array</i> contains no subarrays.) If the optional <i>level</i>
* argument determines the level of recursion to flatten.
- *
+ *
* a = [ 1, 2, [3, [4, 5] ] ]
* a.flatten! #=> [1, 2, 3, 4, 5]
* a.flatten! #=> nil
@@ -3422,23 +3199,21 @@ flatten(VALUE ary, int level, int *modified)
*/
static VALUE
-rb_ary_flatten_bang(int argc, VALUE *argv, VALUE ary)
+rb_ary_flatten_bang(argc, argv, ary)
+ int argc;
+ VALUE *argv;
+ VALUE ary;
{
int mod = 0, level = -1;
VALUE result, lv;
rb_scan_args(argc, argv, "01", &lv);
if (!NIL_P(lv)) level = NUM2INT(lv);
- if (level == 0) return Qnil;
+ if (level == 0) return ary;
result = flatten(ary, level, &mod);
- if (mod == 0) {
- ary_discard(result);
- return Qnil;
- }
- if (!(mod = ARY_EMBED_P(result))) rb_obj_freeze(result);
+ if (mod == 0) return Qnil;
rb_ary_replace(ary, result);
- if (mod) ARY_SET_EMBED_LEN(result, 0);
return ary;
}
@@ -3447,12 +3222,12 @@ rb_ary_flatten_bang(int argc, VALUE *argv, VALUE ary)
* call-seq:
* array.flatten -> an_array
* array.flatten(level) -> an_array
- *
+ *
* Returns a new array that is a one-dimensional flattening of this
* array (recursively). That is, for every element that is an array,
* extract its elements into the new array. If the optional
* <i>level</i> argument determines the level of recursion to flatten.
- *
+ *
* s = [ 1, 2, 3 ] #=> [1, 2, 3]
* t = [ 4, 5, 6, [7, 8] ] #=> [4, 5, 6, [7, 8]]
* a = [ s, t, 9, 10 ] #=> [[1, 2, 3], [4, 5, 6, [7, 8]], 9, 10]
@@ -3462,40 +3237,44 @@ rb_ary_flatten_bang(int argc, VALUE *argv, VALUE ary)
*/
static VALUE
-rb_ary_flatten(int argc, VALUE *argv, VALUE ary)
+rb_ary_flatten(argc, argv, ary)
+ int argc;
+ VALUE *argv;
+ VALUE ary;
{
int mod = 0, level = -1;
VALUE result, lv;
rb_scan_args(argc, argv, "01", &lv);
if (!NIL_P(lv)) level = NUM2INT(lv);
- if (level == 0) return ary_make_shared_copy(ary);
+ if (level == 0) return ary;
result = flatten(ary, level, &mod);
- OBJ_INFECT(result, ary);
+ if (OBJ_TAINTED(ary)) OBJ_TAINT(result);
return result;
}
/*
* call-seq:
- * array.shuffle! -> array
- *
+ * array.shuffle! -> array or nil
+ *
* Shuffles elements in _self_ in place.
*/
static VALUE
-rb_ary_shuffle_bang(VALUE ary)
+rb_ary_shuffle_bang(ary)
+ VALUE ary;
{
- long i = RARRAY_LEN(ary);
+ long i = RARRAY(ary)->len;
rb_ary_modify(ary);
while (i) {
- long j = (long)(rb_genrand_real()*i);
- VALUE tmp = RARRAY_PTR(ary)[--i];
- RARRAY_PTR(ary)[i] = RARRAY_PTR(ary)[j];
- RARRAY_PTR(ary)[j] = tmp;
+ long j = rb_genrand_real()*i;
+ VALUE tmp = RARRAY(ary)->ptr[--i];
+ RARRAY(ary)->ptr[i] = RARRAY(ary)->ptr[j];
+ RARRAY(ary)->ptr[j] = tmp;
}
return ary;
}
@@ -3504,9 +3283,9 @@ rb_ary_shuffle_bang(VALUE ary)
/*
* call-seq:
* array.shuffle -> an_array
- *
+ *
* Returns a new array with elements of this array shuffled.
- *
+ *
* a = [ 1, 2, 3 ] #=> [1, 2, 3]
* a.shuffle #=> [2, 3, 1]
*/
@@ -3522,86 +3301,22 @@ rb_ary_shuffle(VALUE ary)
/*
* call-seq:
- * array.sample -> obj
- * array.sample(n) -> an_array
- *
- * Choose a random element or +n+ random elements from the array. The elements
- * are chosen by using random and unique indices into the array in order to
- * ensure that an element doesn't repeat itself unless the array already
- * contained duplicate elements. If the array is empty the first form returns
- * <code>nil</code> and the second form returns an empty array.
- *
+ * array.choice -> obj
+ *
+ * Choose a random element from an array.
*/
static VALUE
-rb_ary_sample(int argc, VALUE *argv, VALUE ary)
+rb_ary_choice(ary)
+ VALUE ary;
{
- VALUE nv, result, *ptr;
- long n, len, i, j, k, idx[10];
-
- len = RARRAY_LEN(ary);
- if (argc == 0) {
- if (len == 0) return Qnil;
- i = len == 1 ? 0 : (long)(rb_genrand_real()*len);
- return RARRAY_PTR(ary)[i];
- }
- rb_scan_args(argc, argv, "1", &nv);
- n = NUM2LONG(nv);
- if (n < 0) rb_raise(rb_eArgError, "negative sample number");
- ptr = RARRAY_PTR(ary);
- len = RARRAY_LEN(ary);
- if (n > len) n = len;
- switch (n) {
- case 0: return rb_ary_new2(0);
- case 1:
- return rb_ary_new4(1, &ptr[(long)(rb_genrand_real()*len)]);
- case 2:
- i = (long)(rb_genrand_real()*len);
- j = (long)(rb_genrand_real()*(len-1));
- if (j >= i) j++;
- return rb_ary_new3(2, ptr[i], ptr[j]);
- case 3:
- i = (long)(rb_genrand_real()*len);
- j = (long)(rb_genrand_real()*(len-1));
- k = (long)(rb_genrand_real()*(len-2));
- {
- long l = j, g = i;
- if (j >= i) l = i, g = ++j;
- if (k >= l && (++k >= g)) ++k;
- }
- return rb_ary_new3(3, ptr[i], ptr[j], ptr[k]);
- }
- if ((size_t)n < sizeof(idx)/sizeof(idx[0])) {
- long sorted[sizeof(idx)/sizeof(idx[0])];
- sorted[0] = idx[0] = (long)(rb_genrand_real()*len);
- for (i=1; i<n; i++) {
- k = (long)(rb_genrand_real()*--len);
- for (j = 0; j < i; ++j) {
- if (k < sorted[j]) break;
- ++k;
- }
- memmove(&sorted[j+1], &sorted[j], sizeof(sorted[0])*(i-j));
- sorted[j] = idx[i] = k;
- }
- result = rb_ary_new2(n);
- for (i=0; i<n; i++) {
- RARRAY_PTR(result)[i] = RARRAY_PTR(ary)[idx[i]];
- }
- }
- else {
- result = rb_ary_new4(len, ptr);
- RB_GC_GUARD(ary);
- for (i=0; i<n; i++) {
- j = (long)(rb_genrand_real()*(len-i)) + i;
- nv = RARRAY_PTR(result)[j];
- RARRAY_PTR(result)[j] = RARRAY_PTR(result)[i];
- RARRAY_PTR(result)[i] = nv;
- }
- }
- ARY_SET_LEN(result, n);
+ long i, j;
- return result;
+ i = RARRAY(ary)->len;
+ if (i == 0) return Qnil;
+ j = rb_genrand_real()*i;
+ return RARRAY(ary)->ptr[j];
}
@@ -3609,20 +3324,23 @@ rb_ary_sample(int argc, VALUE *argv, VALUE ary)
* call-seq:
* ary.cycle {|obj| block }
* ary.cycle(n) {|obj| block }
- *
+ *
* Calls <i>block</i> for each element repeatedly _n_ times or
* forever if none or nil is given. If a non-positive number is
* given or the array is empty, does nothing. Returns nil if the
* loop has finished without getting interrupted.
- *
+ *
* 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.
- *
+ *
*/
static VALUE
-rb_ary_cycle(int argc, VALUE *argv, VALUE ary)
+rb_ary_cycle(argc, argv, ary)
+ int argc;
+ VALUE *argv;
+ VALUE ary;
{
long n, i;
VALUE nv = Qnil;
@@ -3638,9 +3356,9 @@ rb_ary_cycle(int argc, VALUE *argv, VALUE ary)
if (n <= 0) return Qnil;
}
- while (RARRAY_LEN(ary) > 0 && (n < 0 || 0 < n--)) {
- for (i=0; i<RARRAY_LEN(ary); i++) {
- rb_yield(RARRAY_PTR(ary)[i]);
+ while (RARRAY(ary)->len > 0 && (n < 0 || 0 < n--)) {
+ for (i=0; i<RARRAY(ary)->len; i++) {
+ rb_yield(RARRAY(ary)->ptr[i]);
}
}
return Qnil;
@@ -3651,9 +3369,9 @@ rb_ary_cycle(int argc, VALUE *argv, VALUE ary)
/*
* Recursively compute permutations of r elements of the set [0..n-1].
* When we have a complete permutation of array indexes, copy the values
- * at those indexes into a new array and yield that array.
+ * at those indexes into a new array and yield that array.
*
- * n: the size of the set
+ * n: the size of the set
* r: the number of elements in each permutation
* p: the array (of size r) that we're filling in
* index: what index we're filling in now
@@ -3661,7 +3379,10 @@ rb_ary_cycle(int argc, VALUE *argv, VALUE ary)
* values: the Ruby array that holds the actual values to permute
*/
static void
-permute0(long n, long r, long *p, long index, int *used, VALUE values)
+permute0(n, r, p, index, used, values)
+ long n, r, *p, index;
+ int *used;
+ VALUE values;
{
long i,j;
for (i = 0; i < n; i++) {
@@ -3670,7 +3391,7 @@ permute0(long n, long r, long *p, long index, int *used, VALUE values)
if (index < r-1) { /* if not done yet */
used[i] = 1; /* mark index used */
permute0(n, r, p, index+1, /* recurse */
- used, values);
+ used, values);
used[i] = 0; /* index unused */
}
else {
@@ -3678,11 +3399,11 @@ permute0(long n, long r, long *p, long index, int *used, VALUE values)
/* Build a ruby array of the corresponding values */
/* And yield it to the associated block */
VALUE result = rb_ary_new2(r);
- VALUE *result_array = RARRAY_PTR(result);
- const VALUE *values_array = RARRAY_PTR(values);
+ VALUE *result_array = RARRAY(result)->ptr;
+ const VALUE *values_array = RARRAY(values)->ptr;
for (j = 0; j < r; j++) result_array[j] = values_array[p[j]];
- ARY_SET_LEN(result, r);
+ RARRAY(result)->len = r;
rb_yield(result);
}
}
@@ -3695,15 +3416,15 @@ permute0(long n, long r, long *p, long index, int *used, VALUE values)
* ary.permutation -> enumerator
* ary.permutation(n) { |p| block } -> array
* ary.permutation(n) -> enumerator
- *
+ *
* When invoked with a block, yield all permutations of length <i>n</i>
* of the elements of <i>ary</i>, then return the array itself.
* If <i>n</i> is not specified, yield all permutations of all elements.
- * The implementation makes no guarantees about the order in which
+ * The implementation makes no guarantees about the order in which
* the permutations are yielded.
*
* When invoked without a block, return an enumerator object instead.
- *
+ *
* Examples:
*
* a = [1, 2, 3]
@@ -3716,47 +3437,49 @@ permute0(long n, long r, long *p, long index, int *used, VALUE values)
*/
static VALUE
-rb_ary_permutation(int argc, VALUE *argv, VALUE ary)
+rb_ary_permutation(argc, argv, ary)
+ int argc;
+ VALUE *argv;
+ VALUE ary;
{
VALUE num;
long r, n, i;
- n = RARRAY_LEN(ary); /* Array length */
+ n = RARRAY(ary)->len; /* Array length */
RETURN_ENUMERATOR(ary, argc, argv); /* Return enumerator if no block */
rb_scan_args(argc, argv, "01", &num);
r = NIL_P(num) ? n : NUM2LONG(num); /* Permutation size from argument */
- if (r < 0 || n < r) {
+ if (r < 0 || n < r) {
/* no permutations: yield nothing */
}
else if (r == 0) { /* exactly one permutation: the zero-length array */
rb_yield(rb_ary_new2(0));
}
else if (r == 1) { /* this is a special, easy case */
- for (i = 0; i < RARRAY_LEN(ary); i++) {
- rb_yield(rb_ary_new3(1, RARRAY_PTR(ary)[i]));
+ for (i = 0; i < RARRAY(ary)->len; i++) {
+ rb_yield(rb_ary_new3(1, RARRAY(ary)->ptr[i]));
}
}
else { /* this is the general case */
volatile VALUE t0 = tmpbuf(n,sizeof(long));
- long *p = (long*)RSTRING_PTR(t0);
+ long *p = (long*)RSTRING(t0)->ptr;
volatile VALUE t1 = tmpbuf(n,sizeof(int));
- int *used = (int*)RSTRING_PTR(t1);
- VALUE ary0 = ary_make_substitution(ary); /* private defensive copy of ary */
- RBASIC(ary0)->klass = 0;
+ int *used = (int*)RSTRING(t1)->ptr;
+ VALUE ary0 = ary_make_shared(ary); /* private defensive copy of ary */
for (i = 0; i < n; i++) used[i] = 0; /* initialize array */
permute0(n, r, p, 0, used, ary0); /* compute and yield permutations */
RB_GC_GUARD(t0);
RB_GC_GUARD(t1);
- RBASIC(ary0)->klass = rb_cArray;
}
return ary;
}
static long
-combi_len(long n, long k)
+combi_len(n, k)
+ long n, k;
{
long i, val = 1;
@@ -3779,14 +3502,14 @@ combi_len(long n, long k)
* call-seq:
* ary.combination(n) { |c| block } -> ary
* ary.combination(n) -> enumerator
- *
- * When invoked with a block, yields all combinations of length <i>n</i>
+ *
+ * When invoked with a block, yields all combinations of length <i>n</i>
* of elements from <i>ary</i> and then returns <i>ary</i> itself.
- * The implementation makes no guarantees about the order in which
+ * The implementation makes no guarantees about the order in which
* the combinations are yielded.
*
* When invoked without a block, returns an enumerator object instead.
- *
+ *
* Examples:
*
* a = [1, 2, 3, 4]
@@ -3796,17 +3519,19 @@ combi_len(long n, long k)
* a.combination(4).to_a #=> [[1,2,3,4]]
* a.combination(0).to_a #=> [[]] # one combination of length 0
* a.combination(5).to_a #=> [] # no combinations of length 5
- *
+ *
*/
static VALUE
-rb_ary_combination(VALUE ary, VALUE num)
+rb_ary_combination(ary, num)
+ VALUE ary;
+ VALUE num;
{
long n, i, len;
n = NUM2LONG(num);
RETURN_ENUMERATOR(ary, 1, &num);
- len = RARRAY_LEN(ary);
+ len = RARRAY(ary)->len;
if (n < 0 || len < n) {
/* yield nothing */
}
@@ -3815,24 +3540,24 @@ rb_ary_combination(VALUE ary, VALUE num)
}
else if (n == 1) {
for (i = 0; i < len; i++) {
- rb_yield(rb_ary_new3(1, RARRAY_PTR(ary)[i]));
+ rb_yield(rb_ary_new3(1, RARRAY(ary)->ptr[i]));
}
}
else {
volatile VALUE t0 = tmpbuf(n+1, sizeof(long));
- long *stack = (long*)RSTRING_PTR(t0);
+ long *stack = (long*)RSTRING(t0)->ptr;
long nlen = combi_len(len, n);
volatile VALUE cc = rb_ary_new2(n);
- VALUE *chosen = RARRAY_PTR(cc);
+ VALUE *chosen = RARRAY(cc)->ptr;
long lev = 0;
RBASIC(cc)->klass = 0;
MEMZERO(stack, long, n);
stack[0] = -1;
for (i = 0; i < nlen; i++) {
- chosen[lev] = RARRAY_PTR(ary)[stack[lev+1]];
+ chosen[lev] = RARRAY(ary)->ptr[stack[lev+1]];
for (lev++; lev < n; lev++) {
- chosen[lev] = RARRAY_PTR(ary)[stack[lev+1] = stack[lev]+1];
+ chosen[lev] = RARRAY(ary)->ptr[stack[lev+1] = stack[lev]+1];
}
rb_yield(rb_ary_new4(n, chosen));
do {
@@ -3846,11 +3571,11 @@ rb_ary_combination(VALUE ary, VALUE num)
/*
* call-seq:
* ary.product(other_ary, ...)
- *
+ *
* Returns an array of all combinations of elements from all arrays.
* The length of the returned array is the product of the length
* of ary and the argument arrays
- *
+ *
* [1,2,3].product([4,5]) # => [[1,4],[1,5],[2,4],[2,5],[3,4],[3,5]]
* [1,2].product([1,2]) # => [[1,1],[1,2],[2,1],[2,2]]
* [1,2].product([3,4],[5,6]) # => [[1,3,5],[1,3,6],[1,4,5],[1,4,6],
@@ -3860,13 +3585,16 @@ rb_ary_combination(VALUE ary, VALUE num)
*/
static VALUE
-rb_ary_product(int argc, VALUE *argv, VALUE ary)
+rb_ary_product(argc, argv, ary)
+ int argc;
+ VALUE *argv;
+ VALUE ary;
{
int n = argc+1; /* How many arrays we're operating on */
volatile VALUE t0 = tmpbuf(n, sizeof(VALUE));
volatile VALUE t1 = tmpbuf(n, sizeof(int));
- VALUE *arrays = (VALUE*)RSTRING_PTR(t0); /* The arrays we're computing the product of */
- int *counters = (int*)RSTRING_PTR(t1); /* The current position in each one */
+ VALUE *arrays = (VALUE*)RSTRING(t0)->ptr; /* The arrays we're computing the product of */
+ int *counters = (int*)RSTRING(t1)->ptr; /* The current position in each one */
VALUE result; /* The array we'll be returning */
long i,j;
long resultlen = 1;
@@ -3877,13 +3605,13 @@ rb_ary_product(int argc, VALUE *argv, VALUE ary)
/* initialize the arrays of arrays */
arrays[0] = ary;
for (i = 1; i < n; i++) arrays[i] = to_ary(argv[i-1]);
-
+
/* initialize the counters for the arrays */
for (i = 0; i < n; i++) counters[i] = 0;
/* Compute the length of the result array; return [] if any is empty */
for (i = 0; i < n; i++) {
- long k = RARRAY_LEN(arrays[i]), l = resultlen;
+ long k = RARRAY(arrays[i])->len, l = resultlen;
if (k == 0) return rb_ary_new2(0);
resultlen *= k;
if (resultlen < k || resultlen < l || resultlen / k != l) {
@@ -3910,7 +3638,7 @@ rb_ary_product(int argc, VALUE *argv, VALUE ary)
*/
m = n-1;
counters[m]++;
- while (m > 0 && counters[m] == RARRAY_LEN(arrays[m])) {
+ while (m > 0 && counters[m] == RARRAY(arrays[m])->len) {
counters[m] = 0;
m--;
counters[m]++;
@@ -3923,44 +3651,48 @@ rb_ary_product(int argc, VALUE *argv, VALUE ary)
/*
* call-seq:
* ary.take(n) => array
- *
+ *
* Returns first n elements from <i>ary</i>.
- *
+ *
* a = [1, 2, 3, 4, 5, 0]
* a.take(3) # => [1, 2, 3]
- *
+ *
*/
static VALUE
-rb_ary_take(VALUE obj, VALUE n)
+rb_ary_take(obj, n)
+ VALUE obj;
+ VALUE n;
{
long len = NUM2LONG(n);
if (len < 0) {
rb_raise(rb_eArgError, "attempt to take negative size");
}
+
return rb_ary_subseq(obj, 0, len);
}
/*
* call-seq:
* ary.take_while {|arr| block } => array
- *
+ *
* Passes elements to the block until the block returns nil or false,
* then stops iterating and returns an array of all prior elements.
- *
+ *
* a = [1, 2, 3, 4, 5, 0]
* a.take_while {|i| i < 3 } # => [1, 2]
- *
+ *
*/
static VALUE
-rb_ary_take_while(VALUE ary)
+rb_ary_take_while(ary)
+ VALUE ary;
{
long i;
RETURN_ENUMERATOR(ary, 0, 0);
- for (i = 0; i < RARRAY_LEN(ary); i++) {
- if (!RTEST(rb_yield(RARRAY_PTR(ary)[i]))) break;
+ for (i = 0; i < RARRAY(ary)->len; i++) {
+ if (!RTEST(rb_yield(RARRAY(ary)->ptr[i]))) break;
}
return rb_ary_take(ary, LONG2FIX(i));
}
@@ -3968,17 +3700,19 @@ rb_ary_take_while(VALUE ary)
/*
* call-seq:
* ary.drop(n) => array
- *
+ *
* Drops first n elements from <i>ary</i>, and returns rest elements
* in an array.
- *
+ *
* a = [1, 2, 3, 4, 5, 0]
* a.drop(3) # => [4, 5, 0]
- *
+ *
*/
static VALUE
-rb_ary_drop(VALUE ary, VALUE n)
+rb_ary_drop(ary, n)
+ VALUE ary;
+ VALUE n;
{
VALUE result;
long pos = NUM2LONG(n);
@@ -3986,7 +3720,7 @@ rb_ary_drop(VALUE ary, VALUE n)
rb_raise(rb_eArgError, "attempt to drop negative size");
}
- result = rb_ary_subseq(ary, pos, RARRAY_LEN(ary));
+ result = rb_ary_subseq(ary, pos, RARRAY(ary)->len);
if (result == Qnil) result = rb_ary_new();
return result;
}
@@ -3994,54 +3728,51 @@ rb_ary_drop(VALUE ary, VALUE n)
/*
* call-seq:
* ary.drop_while {|arr| block } => array
- *
+ *
* Drops elements up to, but not including, the first element for
* which the block returns nil or false and returns an array
* containing the remaining elements.
- *
+ *
* a = [1, 2, 3, 4, 5, 0]
* a.drop_while {|i| i < 3 } # => [3, 4, 5, 0]
- *
+ *
*/
static VALUE
-rb_ary_drop_while(VALUE ary)
+rb_ary_drop_while(ary)
+ VALUE ary;
{
long i;
RETURN_ENUMERATOR(ary, 0, 0);
- for (i = 0; i < RARRAY_LEN(ary); i++) {
- if (!RTEST(rb_yield(RARRAY_PTR(ary)[i]))) break;
+ for (i = 0; i < RARRAY(ary)->len; i++) {
+ if (!RTEST(rb_yield(RARRAY(ary)->ptr[i]))) break;
}
return rb_ary_drop(ary, LONG2FIX(i));
}
-/* Arrays are ordered, integer-indexed collections of any object.
- * Array indexing starts at 0, as in C or Java. A negative index is
- * assumed to be relative to the end of the array---that is, an index of -1
- * indicates the last element of the array, -2 is the next to last
- * element in the array, and so on.
+/* Arrays are ordered, integer-indexed collections of any object.
+ * Array indexing starts at 0, as in C or Java. A negative index is
+ * assumed to be relative to the end of the array---that is, an index of -1
+ * indicates the last element of the array, -2 is the next to last
+ * element in the array, and so on.
*/
void
-Init_Array(void)
+Init_Array()
{
-#undef rb_intern
-#define rb_intern(str) rb_intern_const(str)
-
rb_cArray = rb_define_class("Array", rb_cObject);
rb_include_module(rb_cArray, rb_mEnumerable);
rb_define_alloc_func(rb_cArray, ary_alloc);
rb_define_singleton_method(rb_cArray, "[]", rb_ary_s_create, -1);
- rb_define_singleton_method(rb_cArray, "try_convert", rb_ary_s_try_convert, 1);
rb_define_method(rb_cArray, "initialize", rb_ary_initialize, -1);
rb_define_method(rb_cArray, "initialize_copy", rb_ary_replace, 1);
+ rb_define_method(rb_cArray, "to_s", rb_ary_to_s, 0);
rb_define_method(rb_cArray, "inspect", rb_ary_inspect, 0);
- rb_define_alias(rb_cArray, "to_s", "inspect");
rb_define_method(rb_cArray, "to_a", rb_ary_to_a, 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);
@@ -4072,12 +3803,13 @@ Init_Array(void)
rb_define_method(rb_cArray, "find_index", rb_ary_index, -1);
rb_define_method(rb_cArray, "index", rb_ary_index, -1);
rb_define_method(rb_cArray, "rindex", rb_ary_rindex, -1);
+ rb_define_method(rb_cArray, "indexes", rb_ary_indexes, -1);
+ rb_define_method(rb_cArray, "indices", rb_ary_indexes, -1);
rb_define_method(rb_cArray, "join", rb_ary_join_m, -1);
rb_define_method(rb_cArray, "reverse", rb_ary_reverse_m, 0);
rb_define_method(rb_cArray, "reverse!", rb_ary_reverse_bang, 0);
rb_define_method(rb_cArray, "sort", rb_ary_sort, 0);
rb_define_method(rb_cArray, "sort!", rb_ary_sort_bang, 0);
- rb_define_method(rb_cArray, "sort_by!", rb_ary_sort_by_bang, 0);
rb_define_method(rb_cArray, "collect", rb_ary_collect, 0);
rb_define_method(rb_cArray, "collect!", rb_ary_collect_bang, 0);
rb_define_method(rb_cArray, "map", rb_ary_collect, 0);
@@ -4116,10 +3848,11 @@ Init_Array(void)
rb_define_method(rb_cArray, "compact!", rb_ary_compact_bang, 0);
rb_define_method(rb_cArray, "flatten", rb_ary_flatten, -1);
rb_define_method(rb_cArray, "flatten!", rb_ary_flatten_bang, -1);
+ rb_define_method(rb_cArray, "nitems", rb_ary_nitems, 0);
rb_define_method(rb_cArray, "count", rb_ary_count, -1);
rb_define_method(rb_cArray, "shuffle!", rb_ary_shuffle_bang, 0);
rb_define_method(rb_cArray, "shuffle", rb_ary_shuffle, 0);
- rb_define_method(rb_cArray, "sample", rb_ary_sample, -1);
+ rb_define_method(rb_cArray, "choice", rb_ary_choice, 0);
rb_define_method(rb_cArray, "cycle", rb_ary_cycle, -1);
rb_define_method(rb_cArray, "permutation", rb_ary_permutation, -1);
rb_define_method(rb_cArray, "combination", rb_ary_combination, 1);
@@ -4131,4 +3864,5 @@ Init_Array(void)
rb_define_method(rb_cArray, "drop_while", rb_ary_drop_while, 0);
id_cmp = rb_intern("<=>");
+ inspect_key = rb_intern("__inspect_key__");
}
diff --git a/bcc32/Makefile.sub b/bcc32/Makefile.sub
index 834e8a5870..713b5c69df 100644
--- a/bcc32/Makefile.sub
+++ b/bcc32/Makefile.sub
@@ -3,10 +3,6 @@
SHELL = $(COMSPEC)
MKFILES = Makefile
-!ifndef MFLAGS
-MFLAGS=-
-!endif
-
#### Start of system configuration section. ####
!ifndef OS
OS = bccwin32
@@ -15,8 +11,6 @@ OS = bccwin32
!error RT not defined. Retry from configure pass.
!endif
-arch = $(ARCH)-$(OS)
-
## variables may be overridden by $(compile_dir)/Makefile
!ifndef srcdir
srcdir = ..
@@ -33,7 +27,7 @@ RUBYW_INSTALL_NAME = $(RUBY_INSTALL_NAME:ruby=rubyw)
RUBYW_INSTALL_NAME = $(RUBY_INSTALL_NAME)w
!endif
!ifndef RUBY_SO_NAME
-RUBY_SO_NAME = $(RT)-$(RUBY_INSTALL_NAME)$(MAJOR)$(MINOR)$(TEENY)
+RUBY_SO_NAME = $(RT)-$(RUBY_INSTALL_NAME)$(MAJOR)$(MINOR)
!endif
!ifndef icondirs
!ifdef ICONDIRS
@@ -46,6 +40,7 @@ iconinc=-I$(icondirs: = -I)
!endif
###############
+VPATH = $(srcdir):$(srcdir)/missing
.SUFFIXES: .y
!ifndef CC
@@ -58,21 +53,15 @@ CPP = cpp32
RC = brcc32
!endif
!ifndef YACC
-YACC = bison
+YACC = byacc
!endif
!ifndef AR
AR = tlib
!endif
-!ifndef BASERUBY
-BASERUBY = ruby
-!endif
PURIFY =
AUTOCONF = autoconf
-IFCHANGE = $(srcdir:/=\)\win32\ifchange.bat
RM = $(srcdir:/=\)\win32\rm.bat
-CP = copy > nul
-MV = move > nul
!if !defined(PROCESSOR_ARCHITECTURE)
PROCESSOR_ARCHITECTURE = x86
@@ -109,11 +98,14 @@ exec_prefix = $(prefix)
libdir = $(exec_prefix)/lib
!endif
!if !defined(datadir)
-datadir = $(prefix)/share
+datadir = /share
!endif
!ifndef EXTOUT
EXTOUT = .ext
!endif
+!ifndef RIDATADIR
+RIDATADIR = $(DESTDIR)$(datadir)/ri/$(MAJOR).$(MINOR)/system
+!endif
!ifndef TESTUI
TESTUI = console
!endif
@@ -121,24 +113,13 @@ TESTUI = console
TESTS =
!endif
!ifndef RDOCTARGET
-RDOCTARGET = install-doc
+RDOCTARGET = install-nodoc
!endif
OUTFLAG = -o
-COUTFLAG = -o
!ifndef CFLAGS
CFLAGS = -q -tWR -tWC $(DEBUGFLAGS) $(OPTFLAGS) $(PROCESSOR_FLAG) -w- -wsus -wcpt -wdup -wext -wrng -wrpt -wzdi
!endif
-!ifndef DEFS
-DEFS =
-!endif
-!ifndef CPPFLAGS
-CPPFLAGS =
-!endif
-CPPFLAGS = $(DEFS) $(CPPFLAGS)
-!ifndef CXXFLAGS
-CXXFLAGS = $(CFLAGS)
-!endif
!ifndef LDFLAGS
LDFLAGS = -S:$(STACK)
!endif
@@ -152,13 +133,13 @@ EXTLIBS =
MEMLIB =
!endif
LIBS = $(MEMLIB) cw32i.lib import32.lib ws2_32.lib $(EXTLIBS)
-MISSING = acosh.obj cbrt.obj crypt.obj erf.obj lgamma_r.obj strlcat.obj strlcpy.obj tgamma.obj win32.obj
+MISSING = acosh.obj crypt.obj erf.obj win32.obj
!ifndef STACK
STACK = 0x2000000
!endif
-XCFLAGS = -DRUBY_EXPORT -I. -I$(arch_hdrdir) -I$(hdrdir) -I$(srcdir) -I$(srcdir)/missing
+XCFLAGS = -DRUBY_EXPORT -I. -I$(srcdir) -I$(srcdir)/missing
ARFLAGS = /a /p32
LD = ilink32 -q -Gn
@@ -177,7 +158,7 @@ PROGRAM=$(RUBY_INSTALL_NAME)$(EXEEXT)
WPROGRAM=$(RUBYW_INSTALL_NAME)$(EXEEXT)
RUBYDEF = $(RUBY_SO_NAME).def
MINIRUBY = .\miniruby$(EXEEXT) -I$(srcdir)/lib $(MINIRUBYOPT)
-RUNRUBY = .\$(PROGRAM) -i"$(EXTOUT)/$(arch)" "$(srcdir)/runruby.rb" --extout="$(EXTOUT)" --
+RUNRUBY = .\$(PROGRAM) "$(srcdir)/runruby.rb" --extout="$(EXTOUT)" --
ORGLIBPATH = $(LIB)
@@ -187,39 +168,32 @@ LIBRUBY_A = $(RUBY_SO_NAME)-static.lib
LIBRUBY_SO = $(RUBY_SO_NAME).dll
LIBRUBY = $(RUBY_SO_NAME).lib
LIBRUBYARG = $(LIBRUBY)
-THREAD_MODEL = win32
PREP = miniruby$(EXEEXT)
OBJEXT = obj
-ASMEXT = asm
INSTALLED_LIST= .installed.list
WINMAINOBJ = winmain.$(OBJEXT)
-ARCHMINIOBJS = dmydln.$(OBJEXT)
+MINIOBJS = dmydln.$(OBJEXT)
-arch_hdrdir = $(EXTOUT)/include/$(arch)
-hdrdir = $(srcdir)/include
-VPATH = $(arch_hdrdir)/ruby;$(hdrdir)/ruby;$(srcdir);$(srcdir)/enc;$(srcdir)/missing;$(srcdir)/win32
-
-.path.c = .;$(srcdir);$(srcdir)/enc;$(srcdir)/win32;$(srcdir)/missing
-.path.ci = $(srcdir)
-.path.inc = .;$(srcdir)
-.path.def = .;$(srcdir)
-.path.h = .;$(arch_hdrdir)/ruby;$(hdrdir)/ruby;$(srcdir);$(srcdir)/win32;$(srcdir)/missing
+.path.c = .;$(srcdir);$(srcdir)/win32;$(srcdir)/missing
+.path.h = .;$(srcdir);$(srcdir)/win32;$(srcdir)/missing
.path.y = $(srcdir)
.path. = $(srcdir)
.c.obj:
- $(CC) $(CFLAGS) $(XCFLAGS) -I. $(CPPFLAGS) $(COUTFLAG)$@ -c $(<:/=\)
-
-.c.asm:
- $(CC) $(CFLAGS) $(XCFLAGS) -I. $(CPPFLAGS) $(COUTFLAG)$@ -S $(<:\=/)
+ $(CC) $(CFLAGS) $(XCFLAGS) -I. $(CPPFLAGS) -c $(<:/=\)
.rc.res:
$(RC) $(RFLAGS) -I. -I$(<D). $(iconinc) -I$(srcdir)/win32 $(RFLAGS) -fo$@ $(<:/=\)
+.y.c:
+ $(YACC) $(YFLAGS) $(<:\=/)
+ sed -e "s!^ *extern char \*getenv();!/* & */!;s/^\(#.*\)y\.tab/\1parse/" y.tab.c > $(@F)
+ @del y.tab.c
+
all: $(srcdir)/bcc32/Makefile.sub $(srcdir)/common.mk
ruby: $(PROGRAM)
@@ -235,9 +209,6 @@ PHONY: nul
@exit
|
-PHONY: nul
-
-RUBY_CONFIG_H = $(arch_hdrdir)/ruby/config.h
CONFIG_H = ./.config.h.time
config: config.status
@@ -245,30 +216,23 @@ config: config.status
config.status: $(CONFIG_H)
$(CONFIG_H): $(MKFILES) $(srcdir)/bcc32/Makefile.sub
- @if not exist $(arch_hdrdir:/=\) md $(arch_hdrdir:/=\)
- @if not exist $(arch_hdrdir:/=\)\ruby md $(arch_hdrdir:/=\)\ruby
- @$(IFCHANGE) $(RUBY_CONFIG_H:/=\) &&|
-\#define NO_BIG_INLINE 1
+ @$(srcdir:/=\)\win32\ifchange.bat config.h &&|
\#define HAVE_SYS_TYPES_H 1
\#define HAVE_SYS_STAT_H 1
\#define HAVE_STDLIB_H 1
\#define HAVE_STRING_H 1
\#define HAVE_MEMORY_H 1
-\#define HAVE_LONG_LONG 1
\#define HAVE_OFF_T 1
\#define SIZEOF_INT 4
\#define SIZEOF_SHORT 2
\#define SIZEOF_LONG 4
\#define SIZEOF_LONG_LONG 0
\#define SIZEOF___INT64 8
-\#define SIZEOF_OFF_T 8
+\#define SIZEOF_OFF_T 4
\#define SIZEOF_VOIDP 4
\#define SIZEOF_FLOAT 4
\#define SIZEOF_DOUBLE 8
\#define SIZEOF_TIME_T 4
-\#define SIZEOF_RLIM_T 0
-\#define SIZEOF_SIZE_T 4
-\#define SIZEOF_PTRDIFF_T 4
\#define HAVE_PROTOTYPES 1
\#define TOKEN_PASTE(x,y) x\#\#y
\#define HAVE_STDARG_PROTOTYPES 1
@@ -284,27 +248,6 @@ $(CONFIG_H): $(MKFILES) $(srcdir)/bcc32/Makefile.sub
\#define rb_pid_t int
\#define HAVE_STRUCT_STAT_ST_RDEV 1
\#define HAVE_ST_RDEV 1
-!if $(BORLANDC) < 0x0580
-\#define int8_t signed char
-\#define uint8_t unsigned char
-\#define int16_t short
-\#define uint16_t unsigned short
-\#define int32_t int
-\#define uint32_t unsigned int
-\#define int64_t __int64
-\#define uint64_t unsigned __int64
-\#define ssize_t int
-!endif
-\#define HAVE_UINT8_T 1
-\#define HAVE_INT16_T 1
-\#define HAVE_UINT16_T 1
-\#define HAVE_INT32_T 1
-\#define HAVE_UINT32_T 1
-\#define HAVE_INT64_T HAVE_LONG_LONG
-\#define HAVE_UINT64_T HAVE_LONG_LONG
-\#define HAVE_INTPTR_T 1
-\#define HAVE_UINTPTR_T 1
-\#define HAVE_SSIZE_T 1
\#define GETGROUPS_T int
\#define RETSIGTYPE void
\#define HAVE_ALLOCA 1
@@ -320,7 +263,6 @@ $(CONFIG_H): $(MKFILES) $(srcdir)/bcc32/Makefile.sub
\#define HAVE_STRTOD 1
\#define HAVE_STRTOL 1
\#define HAVE_STRTOUL 1
-\#define HAVE_SNPRINTF 1
\#define HAVE_VSNPRINTF 1
\#define HAVE_ISNAN 1
\#define HAVE_FINITE 1
@@ -329,10 +271,7 @@ $(CONFIG_H): $(MKFILES) $(srcdir)/bcc32/Makefile.sub
\#define HAVE_WAITPID 1
\#define HAVE_FSYNC 1
\#define HAVE_GETCWD 1
-\#define HAVE_TRUNCATE 1
-\#define HAVE_FTRUNCATE 1
-\#define HAVE_FSEEKO 1
-\#define HAVE_FTELLO 1
+\#define HAVE_CHSIZE 1
\#define HAVE_TIMES 1
\#define HAVE_FCNTL 1
\#define HAVE_LINK 1
@@ -344,26 +283,25 @@ $(CONFIG_H): $(MKFILES) $(srcdir)/bcc32/Makefile.sub
\#define RSHIFT(x,y) ((x)>>(int)y)
\#define FILE_COUNT level
\#define FILE_READPTR curp
-\#define RUBY_SETJMP(env) setjmp(env)
+\#define RUBY_SETJMP(env) _setjmp(env)
\#define RUBY_LONGJMP(env,val) longjmp(env,val)
\#define RUBY_JMP_BUF jmp_buf
\#define inline __inline
\#define NEED_IO_SEEK_BETWEEN_RW 1
\#define STACK_GROW_DIRECTION -1
\#define DEFAULT_KCODE KCODE_NONE
-\#define LOAD_RELATIVE 1
\#define DLEXT ".so"
-\#define RUBY_LIB "/lib/ruby/$(MAJOR).$(MINOR).$(TEENY)"
+\#define RUBY_LIB "/lib/ruby/$(MAJOR).$(MINOR)"
\#define RUBY_SITE_LIB "/lib/ruby/site_ruby"
-\#define RUBY_SITE_LIB2 "/lib/ruby/site_ruby/$(MAJOR).$(MINOR).$(TEENY)"
+\#define RUBY_SITE_LIB2 "/lib/ruby/site_ruby/$(MAJOR).$(MINOR)"
\#define RUBY_VENDOR_LIB "/lib/ruby/vendor_ruby"
-\#define RUBY_VENDOR_LIB2 "/lib/ruby/vendor_ruby/$(MAJOR).$(MINOR).$(TEENY)"
+\#define RUBY_VENDOR_LIB2 "/lib/ruby/vendor_ruby/$(MAJOR).$(MINOR)"
\#define RUBY_PLATFORM "$(ARCH)-$(OS)"
-\#define RUBY_ARCHLIB "/lib/ruby/$(MAJOR).$(MINOR).$(TEENY)/$(ARCH)-$(OS)"
-\#define RUBY_SITE_ARCHLIB "/lib/ruby/site_ruby/$(MAJOR).$(MINOR).$(TEENY)/$(ARCH)-$(OS)"
-\#define RUBY_VENDOR_ARCHLIB "/lib/ruby/vendor_ruby/$(MAJOR).$(MINOR).$(TEENY)/$(ARCH)-$(OS)"
+\#define RUBY_ARCHLIB "/lib/ruby/$(MAJOR).$(MINOR)/$(ARCH)-$(OS)"
+\#define RUBY_SITE_ARCHLIB "/lib/ruby/site_ruby/$(MAJOR).$(MINOR)/$(ARCH)-$(OS)"
+\#define RUBY_VENDOR_ARCHLIB "/lib/ruby/vendor_ruby/$(MAJOR).$(MINOR)/$(ARCH)-$(OS)"
|
- @exit > $(@:/=\)
+ @exit > $@
config.status: $(MKFILES) $(srcdir)/bcc32/Makefile.sub $(srcdir)/common.mk
@echo Creating $@
@@ -373,14 +311,13 @@ s,@SHELL@,$$(COMSPEC),;t t
s,@BUILD_FILE_SEPARATOR@,\,;t t
s,@PATH_SEPARATOR@,;,;t t
s,@CFLAGS@,$(CFLAGS),;t t
-s,@DEFS@,$(DEFS),;t t
s,@CPPFLAGS@,$(CPPFLAGS),;t t
s,@CXXFLAGS@,$(CXXFLAGS),;t t
s,@FFLAGS@,$(FFLAGS),;t t
s,@LDFLAGS@,,;t t
s,@LIBS@,$(LIBS),;t t
s,@exec_prefix@,$${prefix},;t t
-s,@prefix@,$(prefix),;t t
+s,@prefix@,,;t t
s,@program_transform_name@,s,,,,;t t
s,@bindir@,$${exec_prefix}/bin,;t t
s,@sbindir@,$${exec_prefix}/sbin,;t t
@@ -394,7 +331,6 @@ s,@includedir@,$${prefix}/include,;t t
s,@oldincludedir@,/usr/include,;t t
s,@infodir@,$${prefix}/info,;t t
s,@mandir@,$${prefix}/man,;t t
-s,@ridir@,$${prefix}/share/ri,;t t
s,@build@,$(CPU)-pc-$(OS),;t t
s,@build_alias@,$(CPU)-$(OS),;t t
s,@build_cpu@,$(CPU),;t t
@@ -412,17 +348,14 @@ s,@target_vendor@,pc,;t t
s,@target_os@,$(OS),;t t
s,@CC@,$(CC),;t t
s,@CPP@,cpp32,;t t
-s,@CXX@,$$(CC),;t t
-s,@LD@,$(LD),;t t
s,@YACC@,$(YACC),;t t
s,@RANLIB@,,;t t
s,@AR@,$(AR),;t t
s,@ARFLAGS@,$(ARFLAGS) ,;t t
s,@LN_S@,$(LN_S),;t t
s,@SET_MAKE@,MFLAGS = -$$(MAKEFLAGS),;t t
-s,@RM@,$$(top_srcdir:/=\)\win32\rm.bat,;t t
s,@CP@,copy > nul,;t t
-s,@LIBOBJS@, $(MISSING),;t t
+s,@LIBOBJS@, acosh.obj crypt.obj erf.obj win32.obj,;t t
s,@ALLOCA@,$(ALLOCA),;t t
s,@DEFAULT_KCODE@,$(DEFAULT_KCODE),;t t
s,@EXEEXT@,.exe,;t t
@@ -462,30 +395,24 @@ s,@SOLIBS@,$(SOLIBS),;t t
s,@DLDLIBS@,$(DLDLIBS),;t t
s,@ENABLE_SHARED@,yes,;t t
s,@OUTFLAG@,$(OUTFLAG),;t t
-s,@COUTFLAG@,$(COUTFLAG),;t t
s,@CPPOUTFILE@,,;t t
s,@LIBPATHFLAG@, -L"%s",;t t
s,@RPATHFLAG@,,;t t
s,@LIBARG@,%s.lib,;t t
-s,@LINK_SO@,$$(LDSHARED) $$(DLDFLAGS) $$(LIBPATH) $$(OBJS:/=\), $$(@:/=\), nul, $$(LIBS) $$(LOCAL_LIBS), $$(DEFFILE:/=\), $$(RESFILE:/=\),;t t
-s,@COMPILE_C@,$$(CC) $$(INCFLAGS) $$(CFLAGS) $$(CPPFLAGS) $(COUTFLAG)$$(@) -c $$(<:/=\),;t t
-s,@COMPILE_CXX@,$$(CXX) $$(INCFLAGS) $$(CXXFLAGS) $$(CPPFLAGS) -P $(COUTFLAG)$$(@) -c $$(<:/=\),;t t
+s,@LINK_SO@,$$(LDSHARED) $$(DLDFLAGS) $$(LIBPATH) $$(OBJS), $$(@:/=\), nul, $$(LIBS) $$(LOCAL_LIBS), $$(DEFFILE), $$(RESFILE),;t t
+s,@COMPILE_C@,$$(CC) $$(INCFLAGS) $$(CFLAGS) $$(CPPFLAGS) -c $$(<:/=\),;t t
+s,@COMPILE_CXX@,$$(CXX) $$(INCFLAGS) $$(CXXFLAGS) $$(CPPFLAGS) -P -c $$(<:/=\),;t t
s,@COMPILE_RULES@,{$$(srcdir)}.%s{}.%s: {$$(topdir)}.%s{}.%s: {$$(hdrdir)}.%s{}.%s: .%s.%s:,;t t
s,@RULE_SUBST@,{.;$$(VPATH)}%s,;t t
s,@COMMON_LIBS@,m advapi32 avicap32 avifil32 cap comctl32 comdlg32 dlcapi gdi32 glu32 imagehlp imm32 inetmib1 kernel32 loadperf lsapi32 lz32 mapi32 mgmtapi mpr msacm32 msvfw32 nddeapi netapi32 ole32 oleaut32 oledlg olepro32 opengl32 pdh pkpd32 rasapi32 rasdlg rassapi rpcrt4 setupapi shell32 shfolder snmpapi sporder tapi32 url user32 vdmdbg version win32spl winmm wintrust wsock32,;t t
s,@COMMON_MACROS@,WIN32_LEAN_AND_MEAN WIN32,;t t
s,@COMMON_HEADERS@,winsock2.h windows.h,;t t
-s,@cleanlibs@,$$*.tds,;t t
-s,@cleanobjs@,$$*-$$(arch).def $$*.il? $$*.lib,;t t
s,@TRY_LINK@,$$(CC) -oconftest $$(INCFLAGS) -I$$(hdrdir) $$(CPPFLAGS) $$(CFLAGS) $$(LIBPATH) $$(LDFLAGS) $$(src) $$(LOCAL_LIBS) $$(LIBS),;t t
s,@EXPORT_PREFIX@,_,;t t
s,@arch@,$(ARCH)-$(OS),;t t
s,@sitearch@,$(ARCH)-$(OS),;t t
s,@sitedir@,$${prefix}/lib/ruby/site_ruby,;t t
s,@vendordir@,$${prefix}/lib/ruby/vendor_ruby,;t t
-s,@rubyhdrdir@,$$(includedir)/ruby-$$(MAJOR).$$(MINOR).$$(TEENY),;t t
-s,@sitehdrdir@,$$(rubyhdrdir)/site_ruby,;t t
-s,@vendorhdrdir@,$$(rubyhdrdir)/vendor_ruby,;t t
s,@configure_args@,--enable-shared $(configure_args),;t t
s,@configure_input@,$$configure_input,;t t
s,@srcdir@,$(srcdir),;t t
@@ -494,7 +421,7 @@ s,@top_srcdir@,$(srcdir),;t t
miniruby$(EXEEXT):
@echo $(LIBS)
- $(LD) $(LDFLAGS) $(XLDFLAGS) $(MAINOBJ) $(MINIOBJS) $(COMMONOBJS:/=\) $(DMYEXT),$@,nul,$(LIBS)
+ $(LD) $(LDFLAGS) $(XLDFLAGS) $(MAINOBJ) $(MINIOBJS),$@,nul,$(LIBRUBY_A) $(LIBS)
$(PROGRAM): $(MAINOBJ) $(LIBRUBY_SO) $(RUBY_INSTALL_NAME).res
$(LD) $(LDFLAGS) $(XLDFLAGS) $(MAINOBJ),$@,nul,$(LIBRUBYARG) $(LIBS),,$(RUBY_INSTALL_NAME).res
@@ -519,16 +446,13 @@ $(LIBRUBY): $(LIBRUBY_SO)
$(RUBYDEF): $(LIBRUBY_A) $(PREP)
$(MINIRUBY) $(srcdir)/bcc32/mkexports.rb -output=$@ -base=$(RUBY_SO_NAME) $(LIBRUBY_A)
-$(RUBY_INSTALL_NAME).rc $(RUBYW_INSTALL_NAME).rc $(RUBY_SO_NAME).rc: rbconfig.rb $(srcdir)/revision.h $(srcdir)/win32/resource.rb
+$(RUBY_INSTALL_NAME).rc $(RUBYW_INSTALL_NAME).rc $(RUBY_SO_NAME).rc: rbconfig.rb
@$(MINIRUBY) $(srcdir)/win32/resource.rb \
-ruby_name=$(RUBY_INSTALL_NAME) \
-rubyw_name=$(RUBYW_INSTALL_NAME) \
-so_name=$(RUBY_SO_NAME) \
. $(icondirs) $(srcdir)/win32
-lex.c: {$(srcdir)}lex.c.blt
- copy "$(?:/=\)" $@
-
post-install-bin::
@$(NULLCMD)
post-install-lib::
@@ -545,25 +469,48 @@ post-install-doc::
clean-local::
@$(RM) $(WINMAINOBJ) ext\extinit.c ext\extinit.$(OBJEXT) *.tds *.il? $(RUBY_SO_NAME).lib
@$(RM) $(RUBY_INSTALL_NAME).res $(RUBYW_INSTALL_NAME).res $(RUBY_SO_NAME).res
- @$(RM) *.map *.pdb *.ilk *.exp $(RUBYDEF) ext\ripper\y.output
+ @$(RM) *.map *.pdb *.ilk *.exp $(RUBYDEF)
distclean-local::
@$(RM) ext\config.cache $(RBCONFIG:/=\)
@$(RM) $(RUBY_INSTALL_NAME).rc $(RUBYW_INSTALL_NAME).rc $(RUBY_SO_NAME).rc
-clean-ext distclean-ext realclean-ext::
- @for /R ext %I in (.) do @if exist %I\Makefile ( \
- echo $(@:-ext=)ing %~nI & \
- cd %I & \
- $(MAKE) $(MFLAGS) $(@:-ext=) & \
- cd %CD% \
- )
+update-rubyspec:
+ @echo SPEC_EXISTS=0 > $@.mk
+ @if exist $(srcdir:/=\)\rubyspec\nul echo SPEC_EXISTS=1 >> $@.mk
+ @type >> $@.mk &&|
+$()update-rubyspec:
+$() @del $@.mk
+$()!if $$(SPEC_EXISTS)
+$() cd $(srcdir:/=\)\rubyspec\mspec
+$() git pull
+$() cd ..\spec\rubyspec
+$() git pull
+$()!else
+$() git clone $(MSPEC_GIT_URL) $(srcdir)/rubyspec/mspec
+$() git clone $(RUBYSPEC_GIT_URL) $(srcdir)/rubyspec/spec/rubyspec
+$()!endif
+|
+ @$(MAKE) -$(MAKEFLAGS)$(MFLAGS) -f $@.mk
+
+test-rubyspec:
+ @echo SPEC_EXISTS=0 > $@.mk
+ @if exist $(srcdir:/=\)\rubyspec\nul echo SPEC_EXISTS=1 >> $@.mk
+ @type >> $@.mk &&|
+$()test-rubyspec:
+$()!if $$(SPEC_EXISTS)
+$() $(RUNRUBY) $(srcdir)/rubyspec/mspec/bin/mspec -r$(srcdir)/ext/purelib.rb $(srcdir)/rubyspec/spec/rubyspec/$(MAJOR).$(MINOR)
+$()!else
+$() @echo No rubyspec here. put rubyspec to srcdir first.
+$() @cd $(srcdir:/=\)\rubyspec
+$()!endif
+|
+ @$(MAKE) -$(MAKEFLAGS) -f $@.mk
ext/extinit.obj: ext/extinit.c $(SETUP)
- $(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) $(COUTFLAG)$@ -c ext/extinit.c
+ $(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) -o$@ -c ext/extinit.c
main.$(OBJEXT): win32.h
-ascii.$(OBJEXT): win32.h
array.$(OBJEXT): win32.h
bignum.$(OBJEXT): win32.h
class.$(OBJEXT): win32.h
@@ -572,7 +519,6 @@ dir.$(OBJEXT): dir.h win32.h
dln.$(OBJEXT): win32.h
enum.$(OBJEXT): win32.h
error.$(OBJEXT): win32.h
-euc_jp.$(OBJEXT): win32.h
eval.$(OBJEXT): win32.h
file.$(OBJEXT): win32.h
gc.$(OBJEXT): win32.h
@@ -590,21 +536,14 @@ prec.$(OBJEXT): win32.h
random.$(OBJEXT): win32.h
range.$(OBJEXT): win32.h
re.$(OBJEXT): win32.h
-regcomp.$(OBJEXT): win32.h
-regenc.$(OBJEXT): win32.h
-regerror.$(OBJEXT): win32.h
-regexec.$(OBJEXT): win32.h
-reggnu.$(OBJEXT): win32.h
-regparse.$(OBJEXT): win32.h
+regex.$(OBJEXT): win32.h
ruby.$(OBJEXT): win32.h
signal.$(OBJEXT): win32.h
-sjis.$(OBJEXT): win32.h
sprintf.$(OBJEXT): win32.h
st.$(OBJEXT): win32.h
string.$(OBJEXT): win32.h
struct.$(OBJEXT): win32.h
time.$(OBJEXT): win32.h
-utf_8.$(OBJEXT): win32.h
util.$(OBJEXT): win32.h
variable.$(OBJEXT): win32.h
version.$(OBJEXT): win32.h
diff --git a/bcc32/README.bcc32 b/bcc32/README.bcc32
index fb19906c75..c27a1261f1 100644
--- a/bcc32/README.bcc32
+++ b/bcc32/README.bcc32
@@ -16,7 +16,7 @@
* ilink32
(3) If you want to build from CVS source, following commands are required.
- * bison ((<URL:http://gnuwin32.sourceforge.net/packages/bison.htm>))
+ * byacc ((<URL:http://gnuwin32.sourceforge.net/packages/byacc.htm>))
* sed ((<URL:http://gnuwin32.sourceforge.net/packages/sed.htm>))
(4) We strongly recommend to build ruby on C++Builder, to link following files.
@@ -30,12 +30,7 @@
== How to compile and install
(1) Execute bcc32\configure.bat on your build directory.
- ex. c:\src\ruby> bcc32\configure.bat
- You can specify the target platform as an argument.
- For example, run `((%configure i686-bccwin32%))'
- You can also specify the install directory.
- For example, run `((%configure --prefix=<install_directory>%))'
- Default of the install directory is /usr .
+ ex. c:\ruby-1.6.7>bcc32\configure.bat
(2) Change ((|RUBY_INSTALL_NAME|)) and ((|RUBY_SO_NAME|)) in (({Makefile}))
if you want to change the name of the executable files.
@@ -46,7 +41,7 @@
(4) Run `((%make test%))'
-(5) Run `((%make install%))'
+(5) Run `((%make DESTDIR=<install_directory> install%))'
This command will create following directories and install files onto them.
* <install_directory>\bin
@@ -59,7 +54,7 @@
* <install_directory>\lib\ruby\site_ruby\<MAJOR>.<MINOR>\<PLATFORM>
* <install_directory>\man\man1
If Ruby's version is `x.y.z', the ((|<MAJOR>|)) is `x' and the ((|<MINOR>|)) is `y'.
- The default ((|<PLATFORM>|)) is `(({i386-bccwin32}))'.
+ The ((|<PLATFORM>|)) is usually `(({i586-bccwin32}))'.
(6) Requires dynamic RTL (cc3250.dll on C++Builder5) and borlndmm.dll (If built with
usebormm.lib) to use installed binary. These files are ordinary in bcc32's bin
@@ -95,10 +90,10 @@ in Japanese, but you can download at least.
C:
cd \ruby
- bcc32\configure --prefix=/usr/local
+ bcc32\configure
make
make test
- make install
+ make DESTDIR=/usr/local install
* Build on the relative directory from the ruby source directory and CPU type
i386.
@@ -113,10 +108,10 @@ in Japanese, but you can download at least.
cd \ruby
mkdir bccwin32
cd bccwin32
- ..\bcc32\configure --prefix=/usr/local
+ ..\bcc32\configure target i386-bccwin32
make
make test
- make install
+ make DESTDIR=/usr/local install
* Build on the different drive.
@@ -127,10 +122,10 @@ in Japanese, but you can download at least.
D:
cd D:\build\ruby
- C:\src\ruby\bcc32\configure --prefix=C:/usr/local
+ C:\src\ruby\bcc32\configure
make
make test
- make install
+ make DESTDIR=C:/usr/local install
== Bugs
diff --git a/bcc32/configure.bat b/bcc32/configure.bat
index 8cdfc64b03..95575cbc60 100755
--- a/bcc32/configure.bat
+++ b/bcc32/configure.bat
@@ -30,8 +30,6 @@ if "%1" == "--enable-install-doc" goto :enable-rdoc
if "%1" == "--disable-install-doc" goto :disable-rdoc
if "%1" == "--extout" goto :extout
if "%1" == "EXTOUT" goto :extout
-if "%1" == "--with-baseruby" goto :baseruby
-if "%1" == "BASERUBY" goto :baseruby
if "%1" == "--path" goto :path
if "%1" == "-h" goto :help
if "%1" == "--help" goto :help
@@ -109,14 +107,6 @@ goto :loop
shift
shift
goto :loop
-:baseruby
- echo>>confargs.mk !ifndef BASERUBY
- echo>>confargs.mk BASERUBY = %2
- echo>>confargs.mk !endif
- echo>>confargs.tmp %1=%2 \
- shift
- shift
-goto :loop
:path
echo>>pathlist.tmp %2;\
echo>>confargs.tmp %1=%2 \
@@ -132,9 +122,8 @@ goto :loop
echo System types:
echo --target=TARGET configure for TARGET [i386-bccwin32]
echo Optional Package:
- echo --with-baseruby=RUBY use RUBY as baseruby [ruby]
echo --with-static-linked-ext link external modules statically
- echo --enable-install-doc install rdoc indexes during install
+ echo --disable-install-doc install rdoc indexes during install
del *.tmp
del ~tmp~.mak
goto :exit
diff --git a/bcc32/mkexports.rb b/bcc32/mkexports.rb
index 888ab2e2a6..dc523e2541 100755
--- a/bcc32/mkexports.rb
+++ b/bcc32/mkexports.rb
@@ -1,26 +1,27 @@
#!./miniruby -s
-$:.unshift(File.expand_path("../..", __FILE__))
-require 'win32/mkexports'
+$name = $library = $description = nil
-class Exports::Bcc < Exports
- def forwarding(internal, export)
- internal[/\A_?/]+export
+SYM = {}
+STDIN.reopen(open("nul"))
+ARGV.each do |obj|
+ IO.foreach("|tdump -q -oiPUBDEF -oiPUBD32 #{obj.tr('/', '\\')}") do |l|
+ next unless /(?:PUBDEF|PUBD32)/ =~ l
+ SYM[$1] = true if /'(.*?)'/ =~ l
end
+end
- def each_line(objs, &block)
- objs.each do |obj|
- opt = /\.(?:so|dll)\z/i =~ obj ? "-ee" : "-oiPUBDEF -oiPUBD32"
- IO.foreach("|tdump -q #{opt} #{obj.tr('/', '\\')} < nul", &block)
- end
- end
+exports = []
+if $name
+ exports << "Name " + $name
+elsif $library
+ exports << "Library " + $library
+end
+exports << "Description " + $description.dump if $description
+exports << "EXPORTS" << SYM.keys.sort
- def each_export(objs)
- objdump(objs) do |l|
- next unless /(?:PUBDEF|PUBD32|EXPORT)/ =~ l
- yield $1 if /'(.*?)'/ =~ l
- end
- yield "_strcasecmp", "_stricmp"
- yield "_strncasecmp", "_strnicmp"
- end
+if $output
+ open($output, 'w') {|f| f.puts exports.join("\n")}
+else
+ puts exports.join("\n")
end
diff --git a/bcc32/setup.mak b/bcc32/setup.mak
index e5b4ee8f44..483292ed51 100644
--- a/bcc32/setup.mak
+++ b/bcc32/setup.mak
@@ -15,7 +15,7 @@ prefix = /usr
OS = bccwin32
RT = $(OS)
BANG = !
-APPEND = echo.>>$(MAKEFILE)
+APPEND = echo>>$(MAKEFILE)
!ifdef MAKEFILE
MAKE = $(MAKE) -f $(MAKEFILE)
!else
@@ -42,16 +42,6 @@ $(BANG)endif
$(BANG)ifndef prefix
prefix = $(prefix:\=/)
$(BANG)endif
-$(BANG)if !defined(BASERUBY)
-!if defined(BASERUBY)
-BASERUBY = $(BASERUBY)
-!endif
-|
-!if !defined(BASERUBY)
- @for %I in (ruby.exe) do @echo BASERUBY = "%~$$PATH:I" >> $(MAKEFILE)
-!endif
- @type >> $(MAKEFILE) &&|
-$(BANG)endif
|
!if exist(confargs.mk)
@type confargs.mk >> $(MAKEFILE)
@@ -94,7 +84,6 @@ $(BANG)endif
-version-: nul
@cpp32 -I$(srcdir) -P- -o$(MAKEFILE) > nul &&|
-\#define RUBY_REVISION 0
\#include "version.h"
MAJOR = RUBY_VERSION_MAJOR
MINOR = RUBY_VERSION_MINOR
@@ -158,11 +147,6 @@ $(BANG)endif
@$(APPEND) PROCESSOR_LEVEL = 6
@$(APPEND) !endif
--epilogue-: -encs-
-
--encs-: nul
- @$(MAKE) -f $(srcdir)/win32/enc-setup.mak srcdir="$(srcdir)" MAKEFILE=$(MAKEFILE)
-
-epilogue-: nul
@type >> $(MAKEFILE) &&|
diff --git a/benchmark/bm_app_answer.rb b/benchmark/bm_app_answer.rb
deleted file mode 100644
index 3cd8a8fd37..0000000000
--- a/benchmark/bm_app_answer.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-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
-
-def the_answer_to_life_the_universe_and_everything
- (ack(3,7).to_s.split(//).inject(0){|s,x| s+x.to_i}.to_s + "2" ).to_i
-end
-
-answer = the_answer_to_life_the_universe_and_everything
diff --git a/benchmark/bm_app_erb.rb b/benchmark/bm_app_erb.rb
deleted file mode 100644
index e58b7a34a1..0000000000
--- a/benchmark/bm_app_erb.rb
+++ /dev/null
@@ -1,26 +0,0 @@
-#
-# Create many HTML strings with ERB.
-#
-
-require 'erb'
-
-data = DATA.read
-max = 5_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/bm_app_factorial.rb b/benchmark/bm_app_factorial.rb
deleted file mode 100644
index a5a5de0426..0000000000
--- a/benchmark/bm_app_factorial.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-def fact(n)
- if(n > 1)
- n * fact(n-1)
- else
- 1
- end
-end
-
-8.times{
- fact(5000)
-} \ No newline at end of file
diff --git a/benchmark/bm_app_fib.rb b/benchmark/bm_app_fib.rb
deleted file mode 100644
index 34a7b2e725..0000000000
--- a/benchmark/bm_app_fib.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-def fib n
- if n < 3
- 1
- else
- fib(n-1) + fib(n-2)
- end
-end
-
-fib(34)
-
diff --git a/benchmark/bm_app_mandelbrot.rb b/benchmark/bm_app_mandelbrot.rb
deleted file mode 100644
index a0dcf5e874..0000000000
--- a/benchmark/bm_app_mandelbrot.rb
+++ /dev/null
@@ -1,23 +0,0 @@
-require 'complex'
-
-def mandelbrot? z
- i = 0
- while i<100
- i+=1
- z = z * z
- return false if z.abs > 2
- end
- true
-end
-
-ary = []
-
-(0..100).each{|dx|
- (0..100).each{|dy|
- x = dx / 50.0
- y = dy / 50.0
- c = Complex(x, y)
- ary << c if mandelbrot?(c)
- }
-}
-
diff --git a/benchmark/bm_app_pentomino.rb b/benchmark/bm_app_pentomino.rb
deleted file mode 100644
index 59c63f358e..0000000000
--- a/benchmark/bm_app_pentomino.rb
+++ /dev/null
@@ -1,259 +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)
-
-
-__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/bm_app_raise.rb b/benchmark/bm_app_raise.rb
deleted file mode 100644
index 01d2ae3219..0000000000
--- a/benchmark/bm_app_raise.rb
+++ /dev/null
@@ -1,8 +0,0 @@
-i=0
-while i<300000
- i+=1
- begin
- raise
- rescue
- end
-end
diff --git a/benchmark/bm_app_strconcat.rb b/benchmark/bm_app_strconcat.rb
deleted file mode 100644
index c6ef817263..0000000000
--- a/benchmark/bm_app_strconcat.rb
+++ /dev/null
@@ -1,5 +0,0 @@
-i=0
-while i<500000
- "#{1+1} #{1+1} #{1+1}"
- i+=1
-end
diff --git a/benchmark/bm_app_tak.rb b/benchmark/bm_app_tak.rb
deleted file mode 100644
index efe5380f4e..0000000000
--- a/benchmark/bm_app_tak.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-
-def tak x, y, z
- unless y < x
- z
- else
- tak( tak(x-1, y, z),
- tak(y-1, z, x),
- tak(z-1, x, y))
- end
-end
-
-tak(18, 9, 0)
-
diff --git a/benchmark/bm_app_tarai.rb b/benchmark/bm_app_tarai.rb
deleted file mode 100644
index 4c146f5ccf..0000000000
--- a/benchmark/bm_app_tarai.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-def tarai( x, y, z )
- if x <= y
- then y
- else tarai(tarai(x-1, y, z),
- tarai(y-1, z, x),
- tarai(z-1, x, y))
- end
-end
-
-tarai(12, 6, 0)
diff --git a/benchmark/bm_app_uri.rb b/benchmark/bm_app_uri.rb
deleted file mode 100644
index 586edfd5dc..0000000000
--- a/benchmark/bm_app_uri.rb
+++ /dev/null
@@ -1,8 +0,0 @@
-require 'uri'
-
-100_000.times{
- uri = URI.parse('http://www.ruby-lang.org')
- uri.scheme
- uri.host
- uri.port
-}
diff --git a/benchmark/bm_io_file_create.rb b/benchmark/bm_io_file_create.rb
deleted file mode 100644
index 7adbe9ea5e..0000000000
--- a/benchmark/bm_io_file_create.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# Create files
-#
-
-max = 50_000
-file = './tmpfile_of_bm_io_file_create'
-
-max.times{
- f = open(file, 'w')
- f.close#(true)
-}
-File.unlink(file)
-
diff --git a/benchmark/bm_io_file_read.rb b/benchmark/bm_io_file_read.rb
deleted file mode 100644
index 2b4212db76..0000000000
--- a/benchmark/bm_io_file_read.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-#
-# Seek and Read file.
-#
-
-require 'tempfile'
-
-max = 20_000
-str = "Hello world! " * 1000
-f = Tempfile.new('yarv-benchmark')
-f.write str
-
-max.times{
- f.seek 0
- f.read
-}
diff --git a/benchmark/bm_io_file_write.rb b/benchmark/bm_io_file_write.rb
deleted file mode 100644
index 3cec58c6ae..0000000000
--- a/benchmark/bm_io_file_write.rb
+++ /dev/null
@@ -1,14 +0,0 @@
-#
-# Seek and Write file.
-#
-
-require 'tempfile'
-
-max = 20_000
-str = "Hello world! " * 1000
-f = Tempfile.new('yarv-benchmark')
-
-max.times{
- f.seek 0
- f.write str
-}
diff --git a/benchmark/bm_loop_for.rb b/benchmark/bm_loop_for.rb
deleted file mode 100644
index 0fc4cc1511..0000000000
--- a/benchmark/bm_loop_for.rb
+++ /dev/null
@@ -1,3 +0,0 @@
-for i in 1..30_000_000
- #
-end
diff --git a/benchmark/bm_loop_generator.rb b/benchmark/bm_loop_generator.rb
deleted file mode 100644
index d3375c744c..0000000000
--- a/benchmark/bm_loop_generator.rb
+++ /dev/null
@@ -1,14 +0,0 @@
-max = 600000
-
-if defined? Fiber
- gen = (1..max).each
- loop do
- gen.next
- end
-else
- require 'generator'
- gen = Generator.new((0..max))
- while gen.next?
- gen.next
- end
-end
diff --git a/benchmark/bm_loop_times.rb b/benchmark/bm_loop_times.rb
deleted file mode 100644
index 521f72ad1a..0000000000
--- a/benchmark/bm_loop_times.rb
+++ /dev/null
@@ -1 +0,0 @@
-30_000_000.times{|e|}
diff --git a/benchmark/bm_loop_whileloop.rb b/benchmark/bm_loop_whileloop.rb
deleted file mode 100644
index 43d35e1131..0000000000
--- a/benchmark/bm_loop_whileloop.rb
+++ /dev/null
@@ -1,4 +0,0 @@
-i=0
-while i<30_000_000 # benchmark loop 1
- i+=1
-end
diff --git a/benchmark/bm_loop_whileloop2.rb b/benchmark/bm_loop_whileloop2.rb
deleted file mode 100644
index e514989661..0000000000
--- a/benchmark/bm_loop_whileloop2.rb
+++ /dev/null
@@ -1,4 +0,0 @@
-i=0
-while i< 6_000_000 # benchmark loop 2
- i+=1
-end
diff --git a/benchmark/bm_so_ackermann.rb b/benchmark/bm_so_ackermann.rb
deleted file mode 100644
index 7db5be9050..0000000000
--- a/benchmark/bm_so_ackermann.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/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
deleted file mode 100644
index 2b8fce8f99..0000000000
--- a/benchmark/bm_so_array.rb
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/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/bm_so_binary_trees.rb b/benchmark/bm_so_binary_trees.rb
deleted file mode 100644
index 6a26465578..0000000000
--- a/benchmark/bm_so_binary_trees.rb
+++ /dev/null
@@ -1,57 +0,0 @@
-# The Computer Language Shootout Benchmarks
-# http://shootout.alioth.debian.org
-#
-# contributed by Jesse Millikan
-
-# disable output
-def STDOUT.write_ *args
-end
-
-def item_check(tree)
- if tree[0] == nil
- tree[1]
- else
- tree[1] + item_check(tree[0]) - item_check(tree[2])
- end
-end
-
-def bottom_up_tree(item, depth)
- if depth > 0
- item_item = 2 * item
- depth -= 1
- [bottom_up_tree(item_item - 1, depth), item, bottom_up_tree(item_item, depth)]
- else
- [nil, item, nil]
- end
-end
-
-max_depth = 12 # 16 # ARGV[0].to_i
-min_depth = 4
-
-max_depth = min_depth + 2 if min_depth + 2 > max_depth
-
-stretch_depth = max_depth + 1
-stretch_tree = bottom_up_tree(0, stretch_depth)
-
-puts "stretch tree of depth #{stretch_depth}\t check: #{item_check(stretch_tree)}"
-stretch_tree = nil
-
-long_lived_tree = bottom_up_tree(0, max_depth)
-
-min_depth.step(max_depth + 1, 2) do |depth|
- iterations = 2**(max_depth - depth + min_depth)
-
- check = 0
-
- for i in 1..iterations
- temp_tree = bottom_up_tree(i, depth)
- check += item_check(temp_tree)
-
- temp_tree = bottom_up_tree(-i, depth)
- check += item_check(temp_tree)
- end
-
- puts "#{iterations * 2}\t trees of depth #{depth}\t check: #{check}"
-end
-
-puts "long lived tree of depth #{max_depth}\t check: #{item_check(long_lived_tree)}"
diff --git a/benchmark/bm_so_concatenate.rb b/benchmark/bm_so_concatenate.rb
deleted file mode 100644
index 82629688b7..0000000000
--- a/benchmark/bm_so_concatenate.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-#!/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 = ''
- 400000.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
deleted file mode 100644
index 65f6337a4a..0000000000
--- a/benchmark/bm_so_count_words.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/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
deleted file mode 100644
index d8b461290c..0000000000
--- a/benchmark/bm_so_exception.rb
+++ /dev/null
@@ -1,61 +0,0 @@
-#!/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/bm_so_fannkuch.rb b/benchmark/bm_so_fannkuch.rb
deleted file mode 100644
index a214f2e205..0000000000
--- a/benchmark/bm_so_fannkuch.rb
+++ /dev/null
@@ -1,45 +0,0 @@
-# The Computer Language Shootout
-# http://shootout.alioth.debian.org/
-# Contributed by Sokolov Yura
-# Modified by Ryan Williams
-
-def fannkuch(n)
- maxFlips, m, r, check = 0, n-1, n, 0
- count = (1..n).to_a
- perm = (1..n).to_a
-
- while true
- if check < 30
- puts "#{perm}"
- check += 1
- end
-
- while r != 1
- count[r-1] = r
- r -= 1
- end
-
- if perm[0] != 1 and perm[m] != n
- perml = perm.clone #.dup
- flips = 0
- while (k = perml.first ) != 1
- perml = perml.slice!(0, k).reverse + perml
- flips += 1
- end
- maxFlips = flips if flips > maxFlips
- end
- while true
- if r==n then return maxFlips end
- perm.insert r,perm.shift
- break if (count[r] -= 1) > 0
- r += 1
- end
- end
-end
-
-def puts *args
-end
-
-N = 10 # (ARGV[0] || 1).to_i
-puts "Pfannkuchen(#{N}) = #{fannkuch(N)}"
-
diff --git a/benchmark/bm_so_fasta.rb b/benchmark/bm_so_fasta.rb
deleted file mode 100644
index 3f759ba7ae..0000000000
--- a/benchmark/bm_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/bm_so_k_nucleotide.rb b/benchmark/bm_so_k_nucleotide.rb
deleted file mode 100644
index dadab3e79c..0000000000
--- a/benchmark/bm_so_k_nucleotide.rb
+++ /dev/null
@@ -1,48 +0,0 @@
-# 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/bm_so_lists.rb b/benchmark/bm_so_lists.rb
deleted file mode 100644
index 3652288881..0000000000
--- a/benchmark/bm_so_lists.rb
+++ /dev/null
@@ -1,47 +0,0 @@
-#from http://www.bagley.org/~doug/shootout/bench/lists/lists.ruby
-
-NUM = 100
-SIZE = 10000
-
-def test_lists()
- # create a list of integers (Li1) from 1 to SIZE
- li1 = (1..SIZE).to_a
- # copy the list to li2 (not by individual items)
- li2 = li1.dup
- # remove each individual item from left side of li2 and
- # append to right side of li3 (preserving order)
- li3 = Array.new
- while (not li2.empty?)
- li3.push(li2.shift)
- end
- # li2 must now be empty
- # remove each individual item from right side of li3 and
- # append to right side of li2 (reversing list)
- while (not li3.empty?)
- li2.push(li3.pop)
- end
- # li3 must now be empty
- # reverse li1 in place
- li1.reverse!
- # check that first item is now SIZE
- if li1[0] != SIZE then
- p "not SIZE"
- 0
- else
- # compare li1 and li2 for equality
- if li1 != li2 then
- return(0)
- else
- # return the length of the list
- li1.length
- end
- end
-end
-
-i = 0
-while i<NUM
- i+=1
- result = test_lists()
-end
-
-result
diff --git a/benchmark/bm_so_mandelbrot.rb b/benchmark/bm_so_mandelbrot.rb
deleted file mode 100644
index 76331c64b8..0000000000
--- a/benchmark/bm_so_mandelbrot.rb
+++ /dev/null
@@ -1,57 +0,0 @@
-# The Computer Language Benchmarks Game
-# http://shootout.alioth.debian.org/
-#
-# contributed by Karl von Laudermann
-# modified by Jeremy Echols
-
-size = 600 # ARGV[0].to_i
-
-puts "P4\n#{size} #{size}"
-
-ITER = 49 # Iterations - 1 for easy for..in looping
-LIMIT_SQUARED = 4.0 # Presquared limit
-
-byte_acc = 0
-bit_num = 0
-
-count_size = size - 1 # Precomputed size for easy for..in looping
-
-# For..in loops are faster than .upto, .downto, .times, etc.
-for y in 0..count_size
- for x in 0..count_size
- zr = 0.0
- zi = 0.0
- cr = (2.0*x/size)-1.5
- ci = (2.0*y/size)-1.0
- escape = false
-
- # To make use of the for..in code, we use a dummy variable,
- # like one would in C
- for dummy in 0..ITER
- tr = zr*zr - zi*zi + cr
- ti = 2*zr*zi + ci
- zr, zi = tr, ti
-
- if (zr*zr+zi*zi) > LIMIT_SQUARED
- escape = true
- break
- end
- end
-
- byte_acc = (byte_acc << 1) | (escape ? 0b0 : 0b1)
- bit_num += 1
-
- # Code is very similar for these cases, but using separate blocks
- # ensures we skip the shifting when it's unnecessary, which is most cases.
- if (bit_num == 8)
- print byte_acc.chr
- byte_acc = 0
- bit_num = 0
- elsif (x == count_size)
- byte_acc <<= (8 - bit_num)
- print byte_acc.chr
- byte_acc = 0
- bit_num = 0
- end
- end
-end
diff --git a/benchmark/bm_so_matrix.rb b/benchmark/bm_so_matrix.rb
deleted file mode 100644
index 0f274ad06c..0000000000
--- a/benchmark/bm_so_matrix.rb
+++ /dev/null
@@ -1,48 +0,0 @@
-#!/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 = 30
-
-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
deleted file mode 100644
index 99cf6a91cc..0000000000
--- a/benchmark/bm_so_meteor_contest.rb
+++ /dev/null
@@ -1,564 +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 boundries 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 accross the rows
- (location / 6).to_i.upto(9) do | row_on |
- # obtain a set of regions representing the bits of the curent 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 muliple 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
- # follwing 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 noticable 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/bm_so_nbody.rb b/benchmark/bm_so_nbody.rb
deleted file mode 100644
index d6c5bb9e61..0000000000
--- a/benchmark/bm_so_nbody.rb
+++ /dev/null
@@ -1,148 +0,0 @@
-# The Computer Language Shootout
-# http://shootout.alioth.debian.org
-#
-# Optimized for Ruby by Jesse Millikan
-# From version ported by Michael Neumann from the C gcc version,
-# which was written by Christoph Bauer.
-
-SOLAR_MASS = 4 * Math::PI**2
-DAYS_PER_YEAR = 365.24
-
-def _puts *args
-end
-
-class Planet
- attr_accessor :x, :y, :z, :vx, :vy, :vz, :mass
-
- def initialize(x, y, z, vx, vy, vz, mass)
- @x, @y, @z = x, y, z
- @vx, @vy, @vz = vx * DAYS_PER_YEAR, vy * DAYS_PER_YEAR, vz * DAYS_PER_YEAR
- @mass = mass * SOLAR_MASS
- end
-
- def move_from_i(bodies, nbodies, dt, i)
- while i < nbodies
- b2 = bodies[i]
- dx = @x - b2.x
- dy = @y - b2.y
- dz = @z - b2.z
-
- distance = Math.sqrt(dx * dx + dy * dy + dz * dz)
- mag = dt / (distance * distance * distance)
- b_mass_mag, b2_mass_mag = @mass * mag, b2.mass * mag
-
- @vx -= dx * b2_mass_mag
- @vy -= dy * b2_mass_mag
- @vz -= dz * b2_mass_mag
- b2.vx += dx * b_mass_mag
- b2.vy += dy * b_mass_mag
- b2.vz += dz * b_mass_mag
- i += 1
- end
-
- @x += dt * @vx
- @y += dt * @vy
- @z += dt * @vz
- end
-end
-
-def energy(bodies)
- e = 0.0
- nbodies = bodies.size
-
- for i in 0 ... nbodies
- b = bodies[i]
- e += 0.5 * b.mass * (b.vx * b.vx + b.vy * b.vy + b.vz * b.vz)
- for j in (i + 1) ... nbodies
- b2 = bodies[j]
- dx = b.x - b2.x
- dy = b.y - b2.y
- dz = b.z - b2.z
- distance = Math.sqrt(dx * dx + dy * dy + dz * dz)
- e -= (b.mass * b2.mass) / distance
- end
- end
- e
-end
-
-def offset_momentum(bodies)
- px, py, pz = 0.0, 0.0, 0.0
-
- for b in bodies
- m = b.mass
- px += b.vx * m
- py += b.vy * m
- pz += b.vz * m
- end
-
- b = bodies[0]
- b.vx = - px / SOLAR_MASS
- b.vy = - py / SOLAR_MASS
- b.vz = - pz / SOLAR_MASS
-end
-
-BODIES = [
- # sun
- Planet.new(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0),
-
- # jupiter
- Planet.new(
- 4.84143144246472090e+00,
- -1.16032004402742839e+00,
- -1.03622044471123109e-01,
- 1.66007664274403694e-03,
- 7.69901118419740425e-03,
- -6.90460016972063023e-05,
- 9.54791938424326609e-04),
-
- # saturn
- Planet.new(
- 8.34336671824457987e+00,
- 4.12479856412430479e+00,
- -4.03523417114321381e-01,
- -2.76742510726862411e-03,
- 4.99852801234917238e-03,
- 2.30417297573763929e-05,
- 2.85885980666130812e-04),
-
- # uranus
- Planet.new(
- 1.28943695621391310e+01,
- -1.51111514016986312e+01,
- -2.23307578892655734e-01,
- 2.96460137564761618e-03,
- 2.37847173959480950e-03,
- -2.96589568540237556e-05,
- 4.36624404335156298e-05),
-
- # neptune
- Planet.new(
- 1.53796971148509165e+01,
- -2.59193146099879641e+01,
- 1.79258772950371181e-01,
- 2.68067772490389322e-03,
- 1.62824170038242295e-03,
- -9.51592254519715870e-05,
- 5.15138902046611451e-05)
-]
-
-init = 200_000 # ARGV[0]
-n = Integer(init)
-
-offset_momentum(BODIES)
-
-puts "%.9f" % energy(BODIES)
-
-nbodies = BODIES.size
-dt = 0.01
-
-n.times do
- i = 0
- while i < nbodies
- b = BODIES[i]
- b.move_from_i(BODIES, nbodies, dt, i + 1)
- i += 1
- end
-end
-
-puts "%.9f" % energy(BODIES)
diff --git a/benchmark/bm_so_nested_loop.rb b/benchmark/bm_so_nested_loop.rb
deleted file mode 100644
index a0513f8c47..0000000000
--- a/benchmark/bm_so_nested_loop.rb
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/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/bm_so_nsieve.rb b/benchmark/bm_so_nsieve.rb
deleted file mode 100644
index a65cc78233..0000000000
--- a/benchmark/bm_so_nsieve.rb
+++ /dev/null
@@ -1,35 +0,0 @@
-# The Computer Language Shootout
-# http://shootout.alioth.debian.org/
-#
-# contributed by Glenn Parker, March 2005
-# modified by Evan Phoenix, Sept 2006
-
-def sieve(m)
- flags = Flags.dup[0,m]
- count = 0
- pmax = m - 1
- p = 2
- while p <= pmax
- unless flags[p].zero?
- count += 1
- mult = p
- while mult <= pmax
- flags[mult] = 0
- mult += p
- end
- end
- p += 1
- end
- count
-end
-
-n = 9 # (ARGV[0] || 2).to_i
-Flags = ("\x1" * ( 2 ** n * 10_000)).unpack("c*")
-
-n.downto(n-2) do |exponent|
- break if exponent < 0
- m = (1 << exponent) * 10_000
- # m = (2 ** exponent) * 10_000
- count = sieve(m)
- printf "Primes up to %8d %8d\n", m, count
-end
diff --git a/benchmark/bm_so_nsieve_bits.rb b/benchmark/bm_so_nsieve_bits.rb
deleted file mode 100644
index 019b8b6382..0000000000
--- a/benchmark/bm_so_nsieve_bits.rb
+++ /dev/null
@@ -1,42 +0,0 @@
-#!/usr/bin/ruby
-#
-# The Great Computer Language Shootout
-# http://shootout.alioth.debian.org/
-#
-# nsieve-bits in Ruby
-# Contributed by Glenn Parker, March 2005
-
-CharExponent = 3
-BitsPerChar = 1 << CharExponent
-LowMask = BitsPerChar - 1
-
-def sieve(m)
- items = "\xFF" * ((m / BitsPerChar) + 1)
- masks = ""
- BitsPerChar.times do |b|
- masks << (1 << b).chr
- end
-
- count = 0
- pmax = m - 1
- 2.step(pmax, 1) do |p|
- if items[p >> CharExponent][p & LowMask] == 1
- count += 1
- p.step(pmax, p) do |mult|
- a = mult >> CharExponent
- b = mult & LowMask
- items[a] -= masks[b] if items[a][b] != 0
- end
- end
- end
- count
-end
-
-n = 9 # (ARGV[0] || 2).to_i
-n.step(n - 2, -1) do |exponent|
- break if exponent < 0
- m = 2 ** exponent * 10_000
- count = sieve(m)
- printf "Primes up to %8d %8d\n", m, count
-end
-
diff --git a/benchmark/bm_so_object.rb b/benchmark/bm_so_object.rb
deleted file mode 100644
index e8607c7199..0000000000
--- a/benchmark/bm_so_object.rb
+++ /dev/null
@@ -1,56 +0,0 @@
-#!/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/bm_so_partial_sums.rb b/benchmark/bm_so_partial_sums.rb
deleted file mode 100644
index 630b45cb8d..0000000000
--- a/benchmark/bm_so_partial_sums.rb
+++ /dev/null
@@ -1,31 +0,0 @@
-n = 2_500_000 # (ARGV.shift || 1).to_i
-
-alt = 1.0 ; s0 = s1 = s2 = s3 = s4 = s5 = s6 = s7 = s8 = 0.0
-
-1.upto(n) do |d|
- d = d.to_f ; d2 = d * d ; d3 = d2 * d ; ds = Math.sin(d) ; dc = Math.cos(d)
-
- s0 += (2.0 / 3.0) ** (d - 1.0)
- s1 += 1.0 / Math.sqrt(d)
- s2 += 1.0 / (d * (d + 1.0))
- s3 += 1.0 / (d3 * ds * ds)
- s4 += 1.0 / (d3 * dc * dc)
- s5 += 1.0 / d
- s6 += 1.0 / d2
- s7 += alt / d
- s8 += alt / (2.0 * d - 1.0)
-
- alt = -alt
-end
-
-if false
- printf("%.9f\t(2/3)^k\n", s0)
- printf("%.9f\tk^-0.5\n", s1)
- printf("%.9f\t1/k(k+1)\n", s2)
- printf("%.9f\tFlint Hills\n", s3)
- printf("%.9f\tCookson Hills\n", s4)
- printf("%.9f\tHarmonic\n", s5)
- printf("%.9f\tRiemann Zeta\n", s6)
- printf("%.9f\tAlternating Harmonic\n", s7)
- printf("%.9f\tGregory\n", s8)
-end
diff --git a/benchmark/bm_so_pidigits.rb b/benchmark/bm_so_pidigits.rb
deleted file mode 100644
index c7d6fbfb4d..0000000000
--- a/benchmark/bm_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/bm_so_random.rb b/benchmark/bm_so_random.rb
deleted file mode 100644
index 83c0d6d380..0000000000
--- a/benchmark/bm_so_random.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-# from http://www.bagley.org/~doug/shootout/bench/random/random.ruby
-
-IM = 139968.0
-IA = 3877.0
-IC = 29573.0
-
-$last = 42.0
-
-def gen_random(max)
- (max * ($last = ($last * IA + IC) % IM)) / IM
-end
-
-N = 1000000
-
-i=0
-while i<N
- i+=1
- gen_random(100.0)
-end
-# "%.9f" % gen_random(100.0)
diff --git a/benchmark/bm_so_reverse_complement.rb b/benchmark/bm_so_reverse_complement.rb
deleted file mode 100644
index 82ea666994..0000000000
--- a/benchmark/bm_so_reverse_complement.rb
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/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/bm_so_sieve.rb b/benchmark/bm_so_sieve.rb
deleted file mode 100644
index dbe2bfa63d..0000000000
--- a/benchmark/bm_so_sieve.rb
+++ /dev/null
@@ -1,24 +0,0 @@
-# from http://www.bagley.org/~doug/shootout/bench/sieve/sieve.ruby
-num = 40
-count = i = j = 0
-flags0 = Array.new(8192,1)
-k = 0
-while k < num
- k+=1
- count = 0
- flags = flags0.dup
- i = 2
- while i<8192
- i+=1
- if flags[i]
- # remove all multiples of prime: i
- j = i*i
- while j < 8192
- j += i
- flags[j] = nil
- end
- count += 1
- end
- end
-end
-count
diff --git a/benchmark/bm_so_spectralnorm.rb b/benchmark/bm_so_spectralnorm.rb
deleted file mode 100644
index 6b97206689..0000000000
--- a/benchmark/bm_so_spectralnorm.rb
+++ /dev/null
@@ -1,50 +0,0 @@
-# The Computer Language Shootout
-# http://shootout.alioth.debian.org/
-# Contributed by Sokolov Yura
-
-def eval_A(i,j)
- return 1.0/((i+j)*(i+j+1)/2+i+1)
-end
-
-def eval_A_times_u(u)
- v, i = nil, nil
- (0..u.length-1).collect { |i|
- v = 0
- for j in 0..u.length-1
- v += eval_A(i,j)*u[j]
- end
- v
- }
-end
-
-def eval_At_times_u(u)
- v, i = nil, nil
- (0..u.length-1).collect{|i|
- v = 0
- for j in 0..u.length-1
- v += eval_A(j,i)*u[j]
- end
- v
- }
-end
-
-def eval_AtA_times_u(u)
- return eval_At_times_u(eval_A_times_u(u))
-end
-
-n = 500 # ARGV[0].to_i
-
-u=[1]*n
-for i in 1..10
- v=eval_AtA_times_u(u)
- u=eval_AtA_times_u(v)
-end
-vBv=0
-vv=0
-for i in 0..n-1
- vBv += u[i]*v[i]
- vv += v[i]*v[i]
-end
-
-str = "%0.9f" % (Math.sqrt(vBv/vv)), "\n"
-# print str
diff --git a/benchmark/bm_vm1_block.rb b/benchmark/bm_vm1_block.rb
deleted file mode 100644
index 2dc4e72be5..0000000000
--- a/benchmark/bm_vm1_block.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-def m
- yield
-end
-
-i=0
-while i<30000000 # while loop 1
- i+=1
- m{
- }
-end \ No newline at end of file
diff --git a/benchmark/bm_vm1_const.rb b/benchmark/bm_vm1_const.rb
deleted file mode 100644
index 3e395d9478..0000000000
--- a/benchmark/bm_vm1_const.rb
+++ /dev/null
@@ -1,8 +0,0 @@
-Const = 1
-
-i = 0
-while i<30000000 # while loop 1
- i+= 1
- j = Const
- k = Const
-end
diff --git a/benchmark/bm_vm1_ensure.rb b/benchmark/bm_vm1_ensure.rb
deleted file mode 100644
index c3b71ead5a..0000000000
--- a/benchmark/bm_vm1_ensure.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-i=0
-while i<30000000 # benchmark loop 1
- i+=1
- begin
- begin
- ensure
- end
- ensure
- end
-end
-
diff --git a/benchmark/bm_vm1_ivar.rb b/benchmark/bm_vm1_ivar.rb
deleted file mode 100644
index 4de833a316..0000000000
--- a/benchmark/bm_vm1_ivar.rb
+++ /dev/null
@@ -1,8 +0,0 @@
-@a = 1
-
-i = 0
-while i<30000000 # 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
deleted file mode 100644
index c8076c6ab6..0000000000
--- a/benchmark/bm_vm1_ivar_set.rb
+++ /dev/null
@@ -1,6 +0,0 @@
-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
deleted file mode 100644
index 2d7d7f0b52..0000000000
--- a/benchmark/bm_vm1_length.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-a = 'abc'
-b = [1, 2, 3]
-i=0
-while i<30000000 # while loop 1
- i+=1
- a.length
- b.length
-end
-
diff --git a/benchmark/bm_vm1_neq.rb b/benchmark/bm_vm1_neq.rb
deleted file mode 100644
index 212f056c6e..0000000000
--- a/benchmark/bm_vm1_neq.rb
+++ /dev/null
@@ -1,8 +0,0 @@
-i = 0
-obj1 = Object.new
-obj2 = Object.new
-
-while i<30000000 # while loop 1
- i+= 1
- obj1 != obj2
-end
diff --git a/benchmark/bm_vm1_not.rb b/benchmark/bm_vm1_not.rb
deleted file mode 100644
index f139fed8be..0000000000
--- a/benchmark/bm_vm1_not.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-i = 0
-obj = Object.new
-
-while i<30000000 # while loop 1
- i+= 1
- !obj
-end
diff --git a/benchmark/bm_vm1_rescue.rb b/benchmark/bm_vm1_rescue.rb
deleted file mode 100644
index 0c98d00e0d..0000000000
--- a/benchmark/bm_vm1_rescue.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-i=0
-while i<30000000 # while loop 1
- i+=1
- begin
- rescue
- end
-end
diff --git a/benchmark/bm_vm1_simplereturn.rb b/benchmark/bm_vm1_simplereturn.rb
deleted file mode 100644
index c843ee3d97..0000000000
--- a/benchmark/bm_vm1_simplereturn.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-def m
- return 1
-end
-i=0
-while i<30000000 # while loop 1
- i+=1
- m
-end
-
diff --git a/benchmark/bm_vm1_swap.rb b/benchmark/bm_vm1_swap.rb
deleted file mode 100644
index a565b6f6dc..0000000000
--- a/benchmark/bm_vm1_swap.rb
+++ /dev/null
@@ -1,8 +0,0 @@
-a = 1
-b = 2
-i=0
-while i<30000000 # while loop 1
- i+=1
- a, b = b, a
-end
-
diff --git a/benchmark/bm_vm2_array.rb b/benchmark/bm_vm2_array.rb
deleted file mode 100644
index e29c11200f..0000000000
--- a/benchmark/bm_vm2_array.rb
+++ /dev/null
@@ -1,5 +0,0 @@
-i=0
-while i<6000000 # benchmark loop 2
- i+=1
- a = [1,2,3,4,5,6,7,8,9,10]
-end
diff --git a/benchmark/bm_vm2_case.rb b/benchmark/bm_vm2_case.rb
deleted file mode 100644
index 1ec34ad692..0000000000
--- a/benchmark/bm_vm2_case.rb
+++ /dev/null
@@ -1,14 +0,0 @@
-i=0
-while i<6000000 # 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_eval.rb b/benchmark/bm_vm2_eval.rb
deleted file mode 100644
index 375dccc00e..0000000000
--- a/benchmark/bm_vm2_eval.rb
+++ /dev/null
@@ -1,6 +0,0 @@
-i=0
-while i<6000000 # benchmark loop 2
- i+=1
- eval("1")
-end
-
diff --git a/benchmark/bm_vm2_method.rb b/benchmark/bm_vm2_method.rb
deleted file mode 100644
index cc94b8ab3d..0000000000
--- a/benchmark/bm_vm2_method.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-def m
- nil
-end
-
-i=0
-while i<6000000 # 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
deleted file mode 100644
index 9ec1a0f136..0000000000
--- a/benchmark/bm_vm2_mutex.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-require 'thread'
-
-m = Mutex.new
-
-i=0
-while i<6000000 # benchmark loop 2
- i+=1
- m.synchronize{}
-end
diff --git a/benchmark/bm_vm2_poly_method.rb b/benchmark/bm_vm2_poly_method.rb
deleted file mode 100644
index ac9953ce5f..0000000000
--- a/benchmark/bm_vm2_poly_method.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-class C1
- def m
- 1
- end
-end
-class C2
- def m
- 2
- end
-end
-
-o1 = C1.new
-o2 = C2.new
-
-i=0
-while i<6000000 # 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
deleted file mode 100644
index 856ba9b161..0000000000
--- a/benchmark/bm_vm2_poly_method_ov.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-class C1
- def m
- 1
- end
-end
-class C2
- def m
- 2
- end
-end
-
-o1 = C1.new
-o2 = C2.new
-
-i=0
-while i<6000000 # 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
deleted file mode 100644
index 0bd05b9544..0000000000
--- a/benchmark/bm_vm2_proc.rb
+++ /dev/null
@@ -1,14 +0,0 @@
-def m &b
- b
-end
-
-pr = m{
- a = 1
-}
-
-i=0
-while i<6000000 # benchmark loop 2
- i+=1
- pr.call
-end
-
diff --git a/benchmark/bm_vm2_regexp.rb b/benchmark/bm_vm2_regexp.rb
deleted file mode 100644
index 44f6ed402e..0000000000
--- a/benchmark/bm_vm2_regexp.rb
+++ /dev/null
@@ -1,6 +0,0 @@
-i=0
-str = 'xxxhogexxx'
-while i<6000000 # benchmark loop 2
- /hoge/ =~ str
- i+=1
-end
diff --git a/benchmark/bm_vm2_send.rb b/benchmark/bm_vm2_send.rb
deleted file mode 100644
index c20dbdd26c..0000000000
--- a/benchmark/bm_vm2_send.rb
+++ /dev/null
@@ -1,12 +0,0 @@
-class C
- def m
- end
-end
-
-o = C.new
-
-i=0
-while i<6000000 # benchmark loop 2
- i+=1
- o.__send__ :m
-end
diff --git a/benchmark/bm_vm2_super.rb b/benchmark/bm_vm2_super.rb
deleted file mode 100644
index 70c86b376f..0000000000
--- a/benchmark/bm_vm2_super.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-
-class C
- def m
- 1
- end
-end
-
-class CC < C
- def m
- super()
- end
-end
-
-obj = CC.new
-
-i = 0
-while i<6000000 # benchmark loop 2
- obj.m
- i+=1
-end
diff --git a/benchmark/bm_vm2_unif1.rb b/benchmark/bm_vm2_unif1.rb
deleted file mode 100644
index e12bd2ade0..0000000000
--- a/benchmark/bm_vm2_unif1.rb
+++ /dev/null
@@ -1,8 +0,0 @@
-i = 0
-def m a, b
-end
-
-while i<6000000 # benchmark loop 2
- i+=1
- m 100, 200
-end
diff --git a/benchmark/bm_vm2_zsuper.rb b/benchmark/bm_vm2_zsuper.rb
deleted file mode 100644
index 3a75960403..0000000000
--- a/benchmark/bm_vm2_zsuper.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-i = 0
-
-class C
- def m a
- 1
- end
-end
-
-class CC < C
- def m a
- super
- end
-end
-
-obj = CC.new
-
-while i<6000000 # benchmark loop 2
- obj.m 10
- i+=1
-end
diff --git a/benchmark/bm_vm3_gc.rb b/benchmark/bm_vm3_gc.rb
deleted file mode 100755
index 7db9829d44..0000000000
--- a/benchmark/bm_vm3_gc.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-#! /usr/bin/ruby
-5000.times do
- 100.times do
- {"xxxx"=>"yyyy"}
- end
- GC.start
-end
diff --git a/benchmark/bm_vm3_thread_create_join.rb b/benchmark/bm_vm3_thread_create_join.rb
deleted file mode 100644
index 325a66d587..0000000000
--- a/benchmark/bm_vm3_thread_create_join.rb
+++ /dev/null
@@ -1,6 +0,0 @@
-i=0
-while i<100_000 # benchmark loop 3
- i+=1
- Thread.new{
- }.join
-end
diff --git a/benchmark/bm_vm3_thread_mutex.rb b/benchmark/bm_vm3_thread_mutex.rb
deleted file mode 100644
index 649f1fddac..0000000000
--- a/benchmark/bm_vm3_thread_mutex.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-require 'thread'
-m = Mutex.new
-r = 0
-max = 1000
-(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/bmx_temp.rb b/benchmark/bmx_temp.rb
deleted file mode 100644
index 0b4b219ca2..0000000000
--- a/benchmark/bmx_temp.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-def m
- nil
-end
-
-i=0
-while i<800000 # benchmark loop 2
- i+=1
- m; m; m; m; m; m; m; m;
-end
diff --git a/benchmark/driver.rb b/benchmark/driver.rb
deleted file mode 100644
index 4a1afe360b..0000000000
--- a/benchmark/driver.rb
+++ /dev/null
@@ -1,253 +0,0 @@
-#
-# Ruby Benchmark driver
-#
-
-first = true
-
-p RUBY_VERSION
-
-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
- v = $1.strip
- e = $2
- else
- v = `#{e} -v`.chomp
- v.sub!(/ patchlevel \d+/, '')
- end
- [e, v]
- }.compact
-
- @dir = dir
- @repeat = opt[:repeat] || 1
- @repeat = 1 if @repeat < 1
- @pattern = opt[:pattern] || nil
- @verbose = opt[:quiet] ? false : (opt[:verbose] || false)
- @output = opt[:output] ? open(opt[:output], 'w') : nil
- @loop_wl1 = @loop_wl2 = 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{|(e, v), i|
- message "target #{i}: #{v}"
- }
- end
- end
-
- def show_results
- output
-
- if @verbose
- message '-----------------------------------------------------------'
- message 'raw data:'
- message
- message PP.pp(@results, "", 79)
- message
- message "Elapesed time: #{Time.now - @start_time} (sec)"
- end
-
- output '-----------------------------------------------------------'
- output 'benchmark results:'
-
- if @verbose and @repeat > 1
- output "minimum results in each #{@repeat} measurements."
- end
-
- output "name\t#{@execs.map{|(e, v)| v}.join("\t")}"
- @results.each{|v, result|
- rets = []
- s = nil
- result.each_with_index{|e, i|
- r = e.min
- case v
- when /^vm1_/
- if @loop_wl1
- r -= @loop_wl1[i]
- s = '*'
- end
- when /^vm2_/
- if @loop_wl2
- r -= @loop_wl2[i]
- s = '*'
- end
- end
- rets << sprintf("%.3f", r)
- }
- output "#{v}#{s}\t#{rets.join("\t")}"
- }
- end
-
- def files
- flag = {}
- vm1 = vm2 = wl1 = wl2 = false
- @files = Dir.glob(File.join(@dir, 'bm*.rb')).map{|file|
- next if @pattern && /#{@pattern}/ !~ File.basename(file)
- 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
-
- def measure executable, file
- cmd = "#{executable} #{file}"
- m = Benchmark.measure{
- `#{cmd}`
- }
-
- if $? != 0
- raise "Benchmark process exited with abnormal status (#{$?})"
- end
-
- m.real
- end
-end
-
-if __FILE__ == $0
- opt = {
- :execs => ['ruby'],
- :dir => './',
- :repeat => 1,
- :output => "bmlog-#{Time.now.strftime('%Y%m%d-%H%M%S')}.#{$$}",
- }
-
- parser = OptionParser.new{|o|
- o.on('-e', '--executables [EXECS]',
- "Specify benchmark one or more targets. (exec1; exec2; exec3, ...)"){|e|
- opt[:execs] = e.split(/;/)
- }
- 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('-r', '--repeat-count [NUM]', "Repeat count"){|n|
- opt[:repeat] = n.to_i
- }
- o.on('-o', '--output-file [FILE]', "Output file"){|o|
- opt[:output] = o
- }
- o.on('-q', '--quiet', "Run without notify information except result table."){|q|
- opt[:quiet] = q
- }
- o.on('-v', '--verbose'){|v|
- opt[:verbose] = v
- }
- }
-
- parser.parse!(ARGV)
- BenchmarkDriver.benchmark(opt)
-end
-
diff --git a/benchmark/make_fasta_output.rb b/benchmark/make_fasta_output.rb
deleted file mode 100644
index b6d787ae27..0000000000
--- a/benchmark/make_fasta_output.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-# 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/other-lang/ack.pl b/benchmark/other-lang/ack.pl
deleted file mode 100644
index 201e22ddfa..0000000000
--- a/benchmark/other-lang/ack.pl
+++ /dev/null
@@ -1,11 +0,0 @@
-use integer;
-
-sub Ack {
- return $_[0] ? ($_[1] ? Ack($_[0]-1, Ack($_[0], $_[1]-1))
- : Ack($_[0]-1, 1))
- : $_[1]+1;
-}
-
-my $NUM = 9;
-$NUM = 1 if ($NUM < 1);
-my $ack = Ack(3, $NUM);
diff --git a/benchmark/other-lang/ack.py b/benchmark/other-lang/ack.py
deleted file mode 100644
index 9968e7cfcf..0000000000
--- a/benchmark/other-lang/ack.py
+++ /dev/null
@@ -1,16 +0,0 @@
-import sys
-sys.setrecursionlimit(5000000)
-
-def Ack(M, N):
- if (not M):
- return( N + 1 )
- if (not N):
- return( Ack(M-1, 1) )
- return( Ack(M-1, Ack(M, N-1)) )
-
-def main():
- NUM = 9
- sys.setrecursionlimit(10000)
- Ack(3, NUM)
-
-main()
diff --git a/benchmark/other-lang/ack.rb b/benchmark/other-lang/ack.rb
deleted file mode 100644
index 7451bed6c4..0000000000
--- a/benchmark/other-lang/ack.rb
+++ /dev/null
@@ -1,12 +0,0 @@
-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/other-lang/ack.scm b/benchmark/other-lang/ack.scm
deleted file mode 100644
index a80b73ba55..0000000000
--- a/benchmark/other-lang/ack.scm
+++ /dev/null
@@ -1,7 +0,0 @@
-(define (ack m n)
- (cond ((zero? m) (+ n 1))
- ((zero? n) (ack (- m 1) 1))
- (else (ack (- m 1) (ack m (- n 1))))))
-
-(ack 3 9)
-
diff --git a/benchmark/other-lang/eval.rb b/benchmark/other-lang/eval.rb
deleted file mode 100644
index 3875927389..0000000000
--- a/benchmark/other-lang/eval.rb
+++ /dev/null
@@ -1,66 +0,0 @@
-
-Bench = %w(
- loop
- ack
- fib
- tak
- fact
-)
-
-Lang = <<EOP.map{|l| l.strip}
- ruby-cyg
- ../../../test6/miniruby
- perl
- python
- gosh
-EOP
-
-Bench.replace ['loop2']
-Lang.replace ['ruby-cyg']
-
-Ext = %w(
- .rb
- .rb
- .pl
- .py
- .scm
-)
-
-p Bench
-p Lang
-
-require 'benchmark'
-
-def bench cmd
- m = Benchmark.measure{
- #p cmd
- system(cmd)
- }
- [m.utime, m.real]
-end
-
-Result = []
-Bench.each{|b|
- r = []
- Lang.each_with_index{|l, idx|
- cmd = "#{l} #{b}#{Ext[idx]}"
- r << bench(cmd)
- }
- Result << r
-}
-
-require 'pp'
-# utime
-puts Lang.join("\t")
-Bench.each_with_index{|b, bi|
- print b, "\t"
- puts Result[bi].map{|e| e[0]}.join("\t")
-}
-
-# rtime
-puts Lang.join("\t")
-Bench.each_with_index{|b, bi|
- print b, "\t"
- puts Result[bi].map{|e| e[1]}.join("\t")
-}
-
diff --git a/benchmark/other-lang/fact.pl b/benchmark/other-lang/fact.pl
deleted file mode 100644
index a9b0b69cdf..0000000000
--- a/benchmark/other-lang/fact.pl
+++ /dev/null
@@ -1,13 +0,0 @@
-sub fact{
- my $n = @_[0];
- if($n < 2){
- return 1;
- }
- else{
- return $n * fact($n-1);
- }
-}
-
-for($i=0; $i<10000; $i++){
- &fact(100);
-}
diff --git a/benchmark/other-lang/fact.py b/benchmark/other-lang/fact.py
deleted file mode 100644
index 01593965d9..0000000000
--- a/benchmark/other-lang/fact.py
+++ /dev/null
@@ -1,18 +0,0 @@
-#import sys
-#sys.setrecursionlimit(1000)
-
-def factL(n):
- r = 1
- for x in range(2, n):
- r *= x
- return r
-
-def factR(n):
- if n < 2:
- return 1
- else:
- return n * factR(n-1)
-
-for i in range(10000):
- factR(100)
-
diff --git a/benchmark/other-lang/fact.rb b/benchmark/other-lang/fact.rb
deleted file mode 100644
index 7e97b22b39..0000000000
--- a/benchmark/other-lang/fact.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-def fact(n)
- if n < 2
- 1
- else
- n * fact(n-1)
- end
-end
-
-i=0
-while i<10000
- i+=1
- fact(100)
-end
diff --git a/benchmark/other-lang/fact.scm b/benchmark/other-lang/fact.scm
deleted file mode 100644
index c98a7fedd3..0000000000
--- a/benchmark/other-lang/fact.scm
+++ /dev/null
@@ -1,8 +0,0 @@
-(define (fact n)
- (if (< n 2)
- 1
- (* n (fact (- n 1)))))
-
-(dotimes (i 10000)
- (fact 100))
-
diff --git a/benchmark/other-lang/fib.pl b/benchmark/other-lang/fib.pl
deleted file mode 100644
index a46f666d1e..0000000000
--- a/benchmark/other-lang/fib.pl
+++ /dev/null
@@ -1,11 +0,0 @@
-sub fib{
- my $n = $_[0];
- if($n < 3){
- return 1;
- }
- else{
- return fib($n-1) + fib($n-2);
- }
-};
-
-&fib(34);
diff --git a/benchmark/other-lang/fib.py b/benchmark/other-lang/fib.py
deleted file mode 100644
index 45f2bceb8d..0000000000
--- a/benchmark/other-lang/fib.py
+++ /dev/null
@@ -1,7 +0,0 @@
-def fib(n):
- if n < 3:
- return 1
- else:
- return fib(n-1) + fib(n-2)
-
-fib(34)
diff --git a/benchmark/other-lang/fib.rb b/benchmark/other-lang/fib.rb
deleted file mode 100644
index ec587eabe0..0000000000
--- a/benchmark/other-lang/fib.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-def fib n
- if n < 3
- 1
- else
- fib(n-1) + fib(n-2)
- end
-end
-
-fib(34)
diff --git a/benchmark/other-lang/fib.scm b/benchmark/other-lang/fib.scm
deleted file mode 100644
index 2fc4e225bd..0000000000
--- a/benchmark/other-lang/fib.scm
+++ /dev/null
@@ -1,7 +0,0 @@
-(define (fib n)
- (if (< n 3)
- 1
- (+ (fib (- n 1)) (fib (- n 2)))))
-
-(fib 34)
-
diff --git a/benchmark/other-lang/loop.pl b/benchmark/other-lang/loop.pl
deleted file mode 100644
index 2777490aaa..0000000000
--- a/benchmark/other-lang/loop.pl
+++ /dev/null
@@ -1,3 +0,0 @@
-for($i=0; $i<30000000; $i++){
-}
-
diff --git a/benchmark/other-lang/loop.py b/benchmark/other-lang/loop.py
deleted file mode 100644
index 003749bf3a..0000000000
--- a/benchmark/other-lang/loop.py
+++ /dev/null
@@ -1,2 +0,0 @@
-for i in xrange(30000000):
- pass
diff --git a/benchmark/other-lang/loop.rb b/benchmark/other-lang/loop.rb
deleted file mode 100644
index d43cef61f3..0000000000
--- a/benchmark/other-lang/loop.rb
+++ /dev/null
@@ -1,4 +0,0 @@
-i=0
-while i<30000000
- i+=1
-end
diff --git a/benchmark/other-lang/loop.scm b/benchmark/other-lang/loop.scm
deleted file mode 100644
index 3364f7e679..0000000000
--- a/benchmark/other-lang/loop.scm
+++ /dev/null
@@ -1 +0,0 @@
-(dotimes (x 30000000))
diff --git a/benchmark/other-lang/loop2.rb b/benchmark/other-lang/loop2.rb
deleted file mode 100644
index df8fffc1ff..0000000000
--- a/benchmark/other-lang/loop2.rb
+++ /dev/null
@@ -1 +0,0 @@
-30000000.times{}
diff --git a/benchmark/other-lang/tak.pl b/benchmark/other-lang/tak.pl
deleted file mode 100644
index 7e748a67c6..0000000000
--- a/benchmark/other-lang/tak.pl
+++ /dev/null
@@ -1,11 +0,0 @@
-sub tak {
- local($x, $y, $z) = @_;
- if (!($y < $x)) {
- return $z;
- } else {
- return &tak(&tak($x - 1, $y, $z),
- &tak($y - 1, $z, $x),
- &tak($z - 1, $x, $y));
- }
-}
-&tak(18, 9, 0);
diff --git a/benchmark/other-lang/tak.py b/benchmark/other-lang/tak.py
deleted file mode 100644
index 04f3f6829c..0000000000
--- a/benchmark/other-lang/tak.py
+++ /dev/null
@@ -1,8 +0,0 @@
-def tak(x, y, z):
- if not(y<x):
- return z
- else:
- return tak(tak(x-1, y, z),
- tak(y-1, z, x),
- tak(z-1, x, y))
-tak(18, 9, 0)
diff --git a/benchmark/other-lang/tak.rb b/benchmark/other-lang/tak.rb
deleted file mode 100644
index efe5380f4e..0000000000
--- a/benchmark/other-lang/tak.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-
-def tak x, y, z
- unless y < x
- z
- else
- tak( tak(x-1, y, z),
- tak(y-1, z, x),
- tak(z-1, x, y))
- end
-end
-
-tak(18, 9, 0)
-
diff --git a/benchmark/other-lang/tak.scm b/benchmark/other-lang/tak.scm
deleted file mode 100644
index 52a7629ee5..0000000000
--- a/benchmark/other-lang/tak.scm
+++ /dev/null
@@ -1,10 +0,0 @@
-(define (tak x y z)
- (if (not (< y x))
- z
- (tak (tak (- x 1) y z)
- (tak (- y 1) z x)
- (tak (- z 1) x y))))
-
-(tak 18 9 0)
-
-
diff --git a/benchmark/prepare_so_count_words.rb b/benchmark/prepare_so_count_words.rb
deleted file mode 100644
index ee2138cdb2..0000000000
--- a/benchmark/prepare_so_count_words.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# 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
deleted file mode 100644
index f28f4460a1..0000000000
--- a/benchmark/prepare_so_k_nucleotide.rb
+++ /dev/null
@@ -1,2 +0,0 @@
-require File.join(File.dirname(__FILE__), 'make_fasta_output')
-prepare_fasta_output(100_000)
diff --git a/benchmark/prepare_so_reverse_complement.rb b/benchmark/prepare_so_reverse_complement.rb
deleted file mode 100644
index 7f089109de..0000000000
--- a/benchmark/prepare_so_reverse_complement.rb
+++ /dev/null
@@ -1,2 +0,0 @@
-require File.join(File.dirname(__FILE__), 'make_fasta_output')
-prepare_fasta_output(2_500_000)
diff --git a/benchmark/report.rb b/benchmark/report.rb
deleted file mode 100644
index e931966cca..0000000000
--- a/benchmark/report.rb
+++ /dev/null
@@ -1,81 +0,0 @@
-#
-# 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'] || File.join(
- RbConfig::CONFIG["bindir"],
- RbConfig::CONFIG["ruby_install_name"] + RbConfig::CONFIG["EXEEXT"])
-
- 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/run.rb b/benchmark/run.rb
deleted file mode 100644
index 6ef2943642..0000000000
--- a/benchmark/run.rb
+++ /dev/null
@@ -1,127 +0,0 @@
-#
-# 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
deleted file mode 100644
index ec1d36a61b..0000000000
--- a/benchmark/runc.rb
+++ /dev/null
@@ -1,29 +0,0 @@
-#
-#
-#
-
-require 'benchmark'
-require 'rbconfig'
-
-$rubybin = ENV['RUBY'] || File.join(
- RbConfig::CONFIG["bindir"],
- RbConfig::CONFIG["ruby_install_name"] + RbConfig::CONFIG["EXEEXT"])
-
-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/wc.input.base b/benchmark/wc.input.base
deleted file mode 100644
index 41143fbac0..0000000000
--- a/benchmark/wc.input.base
+++ /dev/null
@@ -1,25 +0,0 @@
-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:
-
-wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
diff --git a/bignum.c b/bignum.c
index f2853ebe7b..7f14aee709 100644
--- a/bignum.c
+++ b/bignum.c
@@ -3,14 +3,15 @@
bignum.c -
$Author$
+ $Date$
created at: Fri Jun 10 00:48:55 JST 1994
- Copyright (C) 1993-2007 Yukihiro Matsumoto
+ Copyright (C) 1993-2003 Yukihiro Matsumoto
**********************************************************************/
-#include "ruby/ruby.h"
-#include "ruby/util.h"
+#include "ruby.h"
+#include "rubysig.h"
#include <math.h>
#include <float.h>
@@ -18,7 +19,6 @@
#ifdef HAVE_IEEEFP_H
#include <ieeefp.h>
#endif
-#include <assert.h>
VALUE rb_cBignum;
@@ -26,122 +26,45 @@ VALUE rb_cBignum;
#define USHORT _USHORT
#endif
-#define BDIGITS(x) (RBIGNUM_DIGITS(x))
+#define BDIGITS(x) ((BDIGIT*)RBIGNUM(x)->digits)
#define BITSPERDIG (SIZEOF_BDIGITS*CHAR_BIT)
#define BIGRAD ((BDIGIT_DBL)1 << BITSPERDIG)
-#define DIGSPERLONG (SIZEOF_LONG/SIZEOF_BDIGITS)
+#define DIGSPERLONG ((unsigned int)(SIZEOF_LONG/SIZEOF_BDIGITS))
#if HAVE_LONG_LONG
-# define DIGSPERLL (SIZEOF_LONG_LONG/SIZEOF_BDIGITS)
+# define DIGSPERLL ((unsigned int)(SIZEOF_LONG_LONG/SIZEOF_BDIGITS))
#endif
#define BIGUP(x) ((BDIGIT_DBL)(x) << BITSPERDIG)
#define BIGDN(x) RSHIFT(x,BITSPERDIG)
#define BIGLO(x) ((BDIGIT)((x) & (BIGRAD-1)))
#define BDIGMAX ((BDIGIT)-1)
-#define BIGZEROP(x) (RBIGNUM_LEN(x) == 0 || \
+#define BIGZEROP(x) (RBIGNUM(x)->len == 0 || \
(BDIGITS(x)[0] == 0 && \
- (RBIGNUM_LEN(x) == 1 || bigzero_p(x))))
+ (RBIGNUM(x)->len == 1 || bigzero_p(x))))
+static int bigzero_p(VALUE);
static int
-bigzero_p(VALUE x)
+bigzero_p(x)
+ VALUE x;
{
long i;
- for (i = RBIGNUM_LEN(x) - 1; 0 <= i; i--) {
+ for (i = 0; i < RBIGNUM(x)->len; ++i) {
if (BDIGITS(x)[i]) return 0;
}
return 1;
}
-int
-rb_bigzero_p(VALUE x)
-{
- return BIGZEROP(x);
-}
-
-int
-rb_cmpint(VALUE val, VALUE a, VALUE b)
-{
- if (NIL_P(val)) {
- rb_cmperr(a, b);
- }
- if (FIXNUM_P(val)) {
- long l = FIX2LONG(val);
- if (l > 0) return 1;
- if (l < 0) return -1;
- return 0;
- }
- if (TYPE(val) == T_BIGNUM) {
- if (BIGZEROP(val)) return 0;
- if (RBIGNUM_SIGN(val)) return 1;
- return -1;
- }
- if (RTEST(rb_funcall(val, '>', 1, INT2FIX(0)))) return 1;
- if (RTEST(rb_funcall(val, '<', 1, INT2FIX(0)))) return -1;
- return 0;
-}
-
-#define RBIGNUM_SET_LEN(b,l) \
- ((RBASIC(b)->flags & RBIGNUM_EMBED_FLAG) ? \
- (void)(RBASIC(b)->flags = \
- (RBASIC(b)->flags & ~RBIGNUM_EMBED_LEN_MASK) | \
- ((l) << RBIGNUM_EMBED_LEN_SHIFT)) : \
- (void)(RBIGNUM(b)->as.heap.len = (l)))
-
-static void
-rb_big_realloc(VALUE big, long len)
-{
- BDIGIT *ds;
- if (RBASIC(big)->flags & RBIGNUM_EMBED_FLAG) {
- if (RBIGNUM_EMBED_LEN_MAX < len) {
- ds = ALLOC_N(BDIGIT, len);
- MEMCPY(ds, RBIGNUM(big)->as.ary, BDIGIT, RBIGNUM_EMBED_LEN_MAX);
- RBIGNUM(big)->as.heap.len = RBIGNUM_LEN(big);
- RBIGNUM(big)->as.heap.digits = ds;
- RBASIC(big)->flags &= ~RBIGNUM_EMBED_FLAG;
- }
- }
- else {
- if (len <= RBIGNUM_EMBED_LEN_MAX) {
- ds = RBIGNUM(big)->as.heap.digits;
- RBASIC(big)->flags |= RBIGNUM_EMBED_FLAG;
- RBIGNUM_SET_LEN(big, len);
- if (ds) {
- MEMCPY(RBIGNUM(big)->as.ary, ds, BDIGIT, len);
- xfree(ds);
- }
- }
- else {
- if (RBIGNUM_LEN(big) == 0) {
- RBIGNUM(big)->as.heap.digits = ALLOC_N(BDIGIT, len);
- }
- else {
- REALLOC_N(RBIGNUM(big)->as.heap.digits, BDIGIT, len);
- }
- }
- }
-}
-
-void
-rb_big_resize(VALUE big, long len)
-{
- rb_big_realloc(big, len);
- RBIGNUM_SET_LEN(big, len);
-}
-
static VALUE
-bignew_1(VALUE klass, long len, int sign)
+bignew_1(klass, len, sign)
+ VALUE klass;
+ long len;
+ int sign;
{
NEWOBJ(big, struct RBignum);
OBJSETUP(big, klass, T_BIGNUM);
- RBIGNUM_SET_SIGN(big, sign?1:0);
- if (len <= RBIGNUM_EMBED_LEN_MAX) {
- RBASIC(big)->flags |= RBIGNUM_EMBED_FLAG;
- RBIGNUM_SET_LEN(big, len);
- }
- else {
- RBIGNUM(big)->as.heap.digits = ALLOC_N(BDIGIT, len);
- RBIGNUM(big)->as.heap.len = len;
- }
+ big->sign = sign?1:0;
+ big->len = len;
+ big->digits = ALLOC_N(BDIGIT, len);
return (VALUE)big;
}
@@ -149,25 +72,21 @@ bignew_1(VALUE klass, long len, int sign)
#define bignew(len,sign) bignew_1(rb_cBignum,len,sign)
VALUE
-rb_big_new(long len, int sign)
-{
- return bignew(len, sign != 0);
-}
-
-VALUE
-rb_big_clone(VALUE x)
+rb_big_clone(x)
+ VALUE x;
{
- VALUE z = bignew_1(CLASS_OF(x), RBIGNUM_LEN(x), RBIGNUM_SIGN(x));
+ VALUE z = bignew_1(CLASS_OF(x), RBIGNUM(x)->len, RBIGNUM(x)->sign);
- MEMCPY(BDIGITS(z), BDIGITS(x), BDIGIT, RBIGNUM_LEN(x));
+ MEMCPY(BDIGITS(z), BDIGITS(x), BDIGIT, RBIGNUM(x)->len);
return z;
}
/* modify a bignum by 2's complement */
static void
-get2comp(VALUE x)
+get2comp(x)
+ VALUE x;
{
- long i = RBIGNUM_LEN(x);
+ long i = RBIGNUM(x)->len;
BDIGIT *ds = BDIGITS(x);
BDIGIT_DBL num;
@@ -178,56 +97,52 @@ get2comp(VALUE x)
num += ds[i];
ds[i++] = BIGLO(num);
num = BIGDN(num);
- } while (i < RBIGNUM_LEN(x));
+ } while (i < RBIGNUM(x)->len);
if (num != 0) {
- rb_big_resize(x, RBIGNUM_LEN(x)+1);
+ REALLOC_N(RBIGNUM(x)->digits, BDIGIT, ++RBIGNUM(x)->len);
ds = BDIGITS(x);
- ds[RBIGNUM_LEN(x)-1] = 1;
+ ds[RBIGNUM(x)->len-1] = RBIGNUM(x)->sign ? ~0 : 1;
}
}
void
-rb_big_2comp(VALUE x) /* get 2's complement */
+rb_big_2comp(x) /* get 2's complement */
+ VALUE x;
{
get2comp(x);
}
-static inline VALUE
-bigtrunc(VALUE x)
+static VALUE
+bigtrunc(x)
+ VALUE x;
{
- long len = RBIGNUM_LEN(x);
+ long len = RBIGNUM(x)->len;
BDIGIT *ds = BDIGITS(x);
if (len == 0) return x;
while (--len && !ds[len]);
- if (RBIGNUM_LEN(x) > len+1) {
- rb_big_resize(x, len+1);
- }
+ RBIGNUM(x)->len = ++len;
return x;
}
-static inline VALUE
-bigfixize(VALUE x)
+static VALUE
+bigfixize(x)
+ VALUE x;
{
- long len = RBIGNUM_LEN(x);
+ long len = RBIGNUM(x)->len;
BDIGIT *ds = BDIGITS(x);
- if (len == 0) return INT2FIX(0);
- if ((size_t)(len*SIZEOF_BDIGITS) <= sizeof(long)) {
+ if (len*SIZEOF_BDIGITS <= sizeof(VALUE)) {
long num = 0;
-#if 2*SIZEOF_BDIGITS > SIZEOF_LONG
- num = (long)ds[0];
-#else
while (len--) {
- num = (long)(BIGUP(num) + ds[len]);
+ num = BIGUP(num) + ds[len];
}
-#endif
if (num >= 0) {
- if (RBIGNUM_SIGN(x)) {
+ if (RBIGNUM(x)->sign) {
if (POSFIXABLE(num)) return LONG2FIX(num);
}
else {
- if (NEGFIXABLE(-num)) return LONG2FIX(-num);
+ if (NEGFIXABLE(-(long)num)) return LONG2FIX(-(long)num);
}
}
}
@@ -235,7 +150,8 @@ bigfixize(VALUE x)
}
static VALUE
-bignorm(VALUE x)
+bignorm(x)
+ VALUE x;
{
if (!FIXNUM_P(x) && TYPE(x) == T_BIGNUM) {
x = bigfixize(bigtrunc(x));
@@ -244,13 +160,15 @@ bignorm(VALUE x)
}
VALUE
-rb_big_norm(VALUE x)
+rb_big_norm(x)
+ VALUE x;
{
return bignorm(x);
}
VALUE
-rb_uint2big(VALUE n)
+rb_uint2big(n)
+ unsigned long n;
{
BDIGIT_DBL num = n;
long i = 0;
@@ -266,12 +184,13 @@ rb_uint2big(VALUE n)
i = DIGSPERLONG;
while (--i && !digits[i]) ;
- RBIGNUM_SET_LEN(big, i+1);
+ RBIGNUM(big)->len = i+1;
return big;
}
VALUE
-rb_int2big(SIGNED_VALUE n)
+rb_int2big(n)
+ long n;
{
long neg = 0;
VALUE big;
@@ -282,29 +201,33 @@ rb_int2big(SIGNED_VALUE n)
}
big = rb_uint2big(n);
if (neg) {
- RBIGNUM_SET_SIGN(big, 0);
+ RBIGNUM(big)->sign = 0;
}
return big;
}
VALUE
-rb_uint2inum(VALUE n)
+rb_uint2inum(n)
+ unsigned long n;
{
if (POSFIXABLE(n)) return LONG2FIX(n);
return rb_uint2big(n);
}
VALUE
-rb_int2inum(SIGNED_VALUE n)
+rb_int2inum(n)
+ long n;
{
if (FIXABLE(n)) return LONG2FIX(n);
return rb_int2big(n);
}
-#if SIZEOF_BDIGITS*2 == SIZEOF_LONG_LONG
+#ifdef HAVE_LONG_LONG
void
-rb_quad_pack(char *buf, VALUE val)
+rb_quad_pack(buf, val)
+ char *buf;
+ VALUE val;
{
LONG_LONG q;
@@ -313,25 +236,26 @@ rb_quad_pack(char *buf, VALUE val)
q = FIX2LONG(val);
}
else {
- long len = RBIGNUM_LEN(val);
+ long len = RBIGNUM(val)->len;
BDIGIT *ds;
- if (len > SIZEOF_LONG_LONG/SIZEOF_BDIGITS) {
- len = SIZEOF_LONG_LONG/SIZEOF_BDIGITS;
- }
+ if (len > SIZEOF_LONG_LONG/SIZEOF_BDIGITS)
+ rb_raise(rb_eRangeError, "bignum too big to convert into `quad int'");
ds = BDIGITS(val);
q = 0;
while (len--) {
q = BIGUP(q);
q += ds[len];
}
- if (!RBIGNUM_SIGN(val)) q = -q;
+ if (!RBIGNUM(val)->sign) q = -q;
}
memcpy(buf, (char*)&q, SIZEOF_LONG_LONG);
}
VALUE
-rb_quad_unpack(const char *buf, int sign)
+rb_quad_unpack(buf, sign)
+ const char *buf;
+ int sign;
{
unsigned LONG_LONG q;
long neg = 0;
@@ -361,10 +285,10 @@ rb_quad_unpack(const char *buf, int sign)
i = DIGSPERLL;
while (i-- && !digits[i]) ;
- RBIGNUM_SET_LEN(big, i+1);
+ RBIGNUM(big)->len = i+1;
if (neg) {
- RBIGNUM_SET_SIGN(big, 0);
+ RBIGNUM(big)->sign = 0;
}
return bignorm(big);
}
@@ -374,7 +298,9 @@ rb_quad_unpack(const char *buf, int sign)
#define QUAD_SIZE 8
void
-rb_quad_pack(char *buf, VALUE val)
+rb_quad_pack(buf, val)
+ char *buf;
+ VALUE val;
{
long len;
@@ -383,12 +309,12 @@ rb_quad_pack(char *buf, VALUE val)
if (FIXNUM_P(val)) {
val = rb_int2big(FIX2LONG(val));
}
- len = RBIGNUM_LEN(val) * SIZEOF_BDIGITS;
+ len = RBIGNUM(val)->len * SIZEOF_BDIGITS;
if (len > QUAD_SIZE) {
rb_raise(rb_eRangeError, "bignum too big to convert into `quad int'");
}
memcpy(buf, (char*)BDIGITS(val), len);
- if (!RBIGNUM_SIGN(val)) {
+ if (!RBIGNUM(val)->sign) {
len = QUAD_SIZE;
while (len--) {
*buf = ~*buf;
@@ -400,7 +326,9 @@ rb_quad_pack(char *buf, VALUE val)
#define BNEG(b) (RSHIFT(((BDIGIT*)b)[QUAD_SIZE/SIZEOF_BDIGITS-1],BITSPERDIG-1) != 0)
VALUE
-rb_quad_unpack(const char *buf, int sign)
+rb_quad_unpack(buf, sign)
+ const char *buf;
+ int sign;
{
VALUE big = bignew(QUAD_SIZE/SIZEOF_BDIGITS, 1);
@@ -409,7 +337,7 @@ rb_quad_unpack(const char *buf, int sign)
long len = QUAD_SIZE;
char *tmp = (char*)BDIGITS(big);
- RBIGNUM_SET_SIGN(big, 0);
+ RBIGNUM(big)->sign = 0;
while (len--) {
*tmp = ~*tmp;
tmp++;
@@ -422,7 +350,10 @@ rb_quad_unpack(const char *buf, int sign)
#endif
VALUE
-rb_cstr_to_inum(const char *str, int base, int badcheck)
+rb_cstr_to_inum(str, base, badcheck)
+ const char *str;
+ int base;
+ int badcheck;
{
const char *s = str;
char *end;
@@ -436,16 +367,21 @@ rb_cstr_to_inum(const char *str, int base, int badcheck)
#define conv_digit(c) \
(!ISASCII(c) ? -1 : \
- ISDIGIT(c) ? ((c) - '0') : \
- ISLOWER(c) ? ((c) - 'a' + 10) : \
- ISUPPER(c) ? ((c) - 'A' + 10) : \
+ isdigit(c) ? ((c) - '0') : \
+ islower(c) ? ((c) - 'a' + 10) : \
+ isupper(c) ? ((c) - 'A' + 10) : \
-1)
if (!str) {
if (badcheck) goto bad;
return INT2FIX(0);
}
- while (ISSPACE(*str)) str++;
+ if (badcheck) {
+ while (ISSPACE(*str)) str++;
+ }
+ else {
+ while (ISSPACE(*str) || *str == '_') str++;
+ }
if (str[0] == '+') {
str++;
@@ -516,7 +452,7 @@ rb_cstr_to_inum(const char *str, int base, int badcheck)
break;
default:
if (base < 2 || 36 < base) {
- rb_raise(rb_eArgError, "invalid radix %d", base);
+ rb_raise(rb_eArgError, "illegal radix %d", base);
}
if (base <= 32) {
len = 5;
@@ -526,7 +462,7 @@ rb_cstr_to_inum(const char *str, int base, int badcheck)
}
break;
}
- if (*str == '0') { /* squeeze preceding 0s */
+ if (*str == '0') { /* squeeze preceeding 0s */
int us = 0;
while ((c = *++str) == '0' || c == '_') {
if (c == '_') {
@@ -545,10 +481,10 @@ rb_cstr_to_inum(const char *str, int base, int badcheck)
}
len *= strlen(str)*sizeof(char);
- if ((size_t)len <= (sizeof(long)*CHAR_BIT)) {
- unsigned long val = STRTOUL(str, &end, base);
+ if (len <= (sizeof(VALUE)*CHAR_BIT)) {
+ unsigned long val = strtoul((char*)str, &end, base);
- if (str < end && *end == '_') goto bigparse;
+ if (*end == '_') goto bigparse;
if (badcheck) {
if (end == str) goto bad; /* no number */
while (*end && ISSPACE(*end)) end++;
@@ -564,7 +500,7 @@ rb_cstr_to_inum(const char *str, int base, int badcheck)
}
else {
VALUE big = rb_uint2big(val);
- RBIGNUM_SET_SIGN(big, sign);
+ RBIGNUM(big)->sign = sign;
return bignorm(big);
}
}
@@ -610,7 +546,7 @@ rb_cstr_to_inum(const char *str, int base, int badcheck)
while (*str && ISSPACE(*str)) str++;
if (*str) {
bad:
- rb_invalid_str(s, "Integer()");
+ rb_invalid_str(s, "Integer");
}
}
@@ -618,7 +554,10 @@ rb_cstr_to_inum(const char *str, int base, int badcheck)
}
VALUE
-rb_str_to_inum(VALUE str, int base, int badcheck)
+rb_str_to_inum(str, base, badcheck)
+ VALUE str;
+ int base;
+ int badcheck;
{
char *s;
long len;
@@ -628,10 +567,10 @@ rb_str_to_inum(VALUE str, int base, int badcheck)
s = StringValueCStr(str);
}
else {
- s = RSTRING_PTR(str);
+ s = RSTRING(str)->ptr;
}
if (s) {
- len = RSTRING_LEN(str);
+ len = RSTRING(str)->len;
if (s[len]) { /* no sentinel somehow */
char *p = ALLOCA_N(char, len+1);
@@ -645,8 +584,9 @@ rb_str_to_inum(VALUE str, int base, int badcheck)
#if HAVE_LONG_LONG
-static VALUE
-rb_ull2big(unsigned LONG_LONG n)
+VALUE
+rb_ull2big(n)
+ unsigned LONG_LONG n;
{
BDIGIT_DBL num = n;
long i = 0;
@@ -662,12 +602,13 @@ rb_ull2big(unsigned LONG_LONG n)
i = DIGSPERLL;
while (i-- && !digits[i]) ;
- RBIGNUM_SET_LEN(big, i+1);
+ RBIGNUM(big)->len = i+1;
return big;
}
-static VALUE
-rb_ll2big(LONG_LONG n)
+VALUE
+rb_ll2big(n)
+ LONG_LONG n;
{
long neg = 0;
VALUE big;
@@ -678,20 +619,22 @@ rb_ll2big(LONG_LONG n)
}
big = rb_ull2big(n);
if (neg) {
- RBIGNUM_SET_SIGN(big, 0);
+ RBIGNUM(big)->sign = 0;
}
return big;
}
VALUE
-rb_ull2inum(unsigned LONG_LONG n)
+rb_ull2inum(n)
+ unsigned LONG_LONG n;
{
if (POSFIXABLE(n)) return LONG2FIX(n);
return rb_ull2big(n);
}
VALUE
-rb_ll2inum(LONG_LONG n)
+rb_ll2inum(n)
+ LONG_LONG n;
{
if (FIXABLE(n)) return LONG2FIX(n);
return rb_ll2big(n);
@@ -700,200 +643,90 @@ rb_ll2inum(LONG_LONG n)
#endif /* HAVE_LONG_LONG */
VALUE
-rb_cstr2inum(const char *str, int base)
+rb_cstr2inum(str, base)
+ const char *str;
+ int base;
{
return rb_cstr_to_inum(str, base, base==0);
}
VALUE
-rb_str2inum(VALUE str, int base)
+rb_str2inum(str, base)
+ VALUE str;
+ int base;
{
return rb_str_to_inum(str, base, base==0);
}
const char ruby_digitmap[] = "0123456789abcdefghijklmnopqrstuvwxyz";
-
-static VALUE bigsqr(VALUE x);
-static void bigdivmod(VALUE x, VALUE y, VALUE *divp, VALUE *modp);
-
-#define POW2_P(x) (((x)&((x)-1))==0)
-
-static inline int
-ones(register unsigned long x)
-{
-#if SIZEOF_LONG == 8
-# define MASK_55 0x5555555555555555UL
-# define MASK_33 0x3333333333333333UL
-# define MASK_0f 0x0f0f0f0f0f0f0f0fUL
-#else
-# define MASK_55 0x55555555UL
-# define MASK_33 0x33333333UL
-# define MASK_0f 0x0f0f0f0fUL
-#endif
- x -= (x >> 1) & MASK_55;
- x = ((x >> 2) & MASK_33) + (x & MASK_33);
- x = ((x >> 4) + x) & MASK_0f;
- x += (x >> 8);
- x += (x >> 16);
-#if SIZEOF_LONG == 8
- x += (x >> 32);
-#endif
- return (int)(x & 0x7f);
-#undef MASK_0f
-#undef MASK_33
-#undef MASK_55
-}
-
-static inline unsigned long
-next_pow2(register unsigned long x)
-{
- x |= x >> 1;
- x |= x >> 2;
- x |= x >> 4;
- x |= x >> 8;
- x |= x >> 16;
-#if SIZEOF_LONG == 8
- x |= x >> 32;
-#endif
- return x + 1;
-}
-
-static inline int
-floor_log2(register unsigned long x)
-{
- x |= x >> 1;
- x |= x >> 2;
- x |= x >> 4;
- x |= x >> 8;
- x |= x >> 16;
-#if SIZEOF_LONG == 8
- x |= x >> 32;
-#endif
- return (int)ones(x) - 1;
-}
-
-static inline int
-ceil_log2(register unsigned long x)
-{
- return floor_log2(x) + !POW2_P(x);
-}
-
-#define LOG2_KARATSUBA_DIGITS 7
-#define KARATSUBA_DIGITS (1L<<LOG2_KARATSUBA_DIGITS)
-#define MAX_BIG2STR_TABLE_ENTRIES 64
-
-static VALUE big2str_power_cache[35][MAX_BIG2STR_TABLE_ENTRIES];
-
-static void
-power_cache_init(void)
-{
- int i, j;
- for (i = 0; i < 35; ++i) {
- for (j = 0; j < MAX_BIG2STR_TABLE_ENTRIES; ++j) {
- big2str_power_cache[i][j] = Qnil;
- }
- }
-}
-
-static inline VALUE
-power_cache_get_power0(int base, int i)
-{
- if (NIL_P(big2str_power_cache[base - 2][i])) {
- big2str_power_cache[base - 2][i] =
- i == 0 ? rb_big_pow(rb_int2big(base), INT2FIX(KARATSUBA_DIGITS))
- : bigsqr(power_cache_get_power0(base, i - 1));
- rb_gc_register_mark_object(big2str_power_cache[base - 2][i]);
- }
- return big2str_power_cache[base - 2][i];
-}
-
-static VALUE
-power_cache_get_power(int base, long n1, long* m1)
+VALUE
+rb_big2str0(x, base, trim)
+ VALUE x;
+ int base;
+ int trim;
{
- int i, m;
- long j;
- VALUE t;
-
- if (n1 <= KARATSUBA_DIGITS)
- rb_bug("n1 > KARATSUBA_DIGITS");
-
- m = ceil_log2(n1);
- if (m1) *m1 = 1 << m;
- i = m - LOG2_KARATSUBA_DIGITS;
- if (i >= MAX_BIG2STR_TABLE_ENTRIES)
- i = MAX_BIG2STR_TABLE_ENTRIES - 1;
- t = power_cache_get_power0(base, i);
-
- j = KARATSUBA_DIGITS*(1 << i);
- while (n1 > j) {
- t = bigsqr(t);
- j *= 2;
- }
- return t;
-}
-
-/* big2str_muraken_find_n1
- *
- * Let a natural number x is given by:
- * x = 2^0 * x_0 + 2^1 * x_1 + ... + 2^(B*n_0 - 1) * x_{B*n_0 - 1},
- * where B is BITSPERDIG (i.e. BDIGITS*CHAR_BIT) and n_0 is
- * RBIGNUM_LEN(x).
- *
- * Now, we assume n_1 = min_n \{ n | 2^(B*n_0/2) <= b_1^(n_1) \}, so
- * it is realized that 2^(B*n_0) <= {b_1}^{2*n_1}, where b_1 is a
- * given radix number. And then, we have n_1 <= (B*n_0) /
- * (2*log_2(b_1)), therefore n_1 is given by ceil((B*n_0) /
- * (2*log_2(b_1))).
- */
-static long
-big2str_find_n1(VALUE x, int base)
-{
- static const double log_2[] = {
- 1.0, 1.58496250072116, 2.0,
- 2.32192809488736, 2.58496250072116, 2.8073549220576,
- 3.0, 3.16992500144231, 3.32192809488736,
- 3.4594316186373, 3.58496250072116, 3.70043971814109,
- 3.8073549220576, 3.90689059560852, 4.0,
- 4.08746284125034, 4.16992500144231, 4.24792751344359,
- 4.32192809488736, 4.39231742277876, 4.4594316186373,
- 4.52356195605701, 4.58496250072116, 4.64385618977472,
- 4.70043971814109, 4.75488750216347, 4.8073549220576,
- 4.85798099512757, 4.90689059560852, 4.95419631038688,
- 5.0, 5.04439411935845, 5.08746284125034,
- 5.12928301694497, 5.16992500144231
- };
- long bits;
-
- if (base < 2 || 36 < base)
- rb_bug("invalid radix %d", base);
+ volatile VALUE t;
+ BDIGIT *ds;
+ long i, j, hbase;
+ VALUE ss;
+ char *s;
if (FIXNUM_P(x)) {
- bits = (SIZEOF_LONG*CHAR_BIT - 1)/2 + 1;
+ return rb_fix2str(x, base);
}
- else if (BIGZEROP(x)) {
- return 0;
+ i = RBIGNUM(x)->len;
+ if (BIGZEROP(x)) {
+ return rb_str_new2("0");
}
- else if (RBIGNUM_LEN(x) >= LONG_MAX/BITSPERDIG) {
+ if (i >= LONG_MAX/SIZEOF_BDIGITS/CHAR_BIT) {
rb_raise(rb_eRangeError, "bignum too big to convert into `string'");
}
- else {
- bits = BITSPERDIG*RBIGNUM_LEN(x);
+ j = SIZEOF_BDIGITS*CHAR_BIT*i;
+ switch (base) {
+ case 2: break;
+ case 3:
+ j = j * 53L / 84 + 1;
+ break;
+ case 4: case 5: case 6: case 7:
+ j = (j + 1) / 2;
+ break;
+ case 8: case 9:
+ j = (j + 2) / 3;
+ break;
+ case 10: case 11: case 12: case 13: case 14: case 15:
+ j = j * 28L / 93 + 1;
+ break;
+ case 16: case 17: case 18: case 19: case 20: case 21:
+ case 22: case 23: case 24: case 25: case 26: case 27:
+ case 28: case 29: case 30: case 31:
+ j = (j + 3) / 4;
+ break;
+ case 32: case 33: case 34: case 35: case 36:
+ j = (j + 4) / 5;
+ break;
+ default:
+ rb_raise(rb_eArgError, "illegal radix %d", base);
+ break;
}
+ j++; /* space for sign */
- return (long)ceil(bits/log_2[base - 2]);
-}
+ hbase = base * base;
+#if SIZEOF_BDIGITS > 2
+ hbase *= hbase;
+#endif
-static long
-big2str_orig(VALUE x, int base, char* ptr, long len, long hbase, int trim)
-{
- long i = RBIGNUM_LEN(x), j = len;
- BDIGIT* ds = BDIGITS(x);
+ t = rb_big_clone(x);
+ ds = BDIGITS(t);
+ ss = rb_str_new(0, j+1);
+ s = RSTRING(ss)->ptr;
- while (i && j > 0) {
+ s[0] = RBIGNUM(x)->sign ? '+' : '-';
+ TRAP_BEG;
+ while (i && j > 1) {
long k = i;
BDIGIT_DBL num = 0;
- while (k--) { /* x / hbase */
+ while (k--) {
num = BIGUP(num) + ds[k];
ds[k] = (BDIGIT)(num / hbase);
num %= hbase;
@@ -901,93 +734,24 @@ big2str_orig(VALUE x, int base, char* ptr, long len, long hbase, int trim)
if (trim && ds[i-1] == 0) i--;
k = SIZEOF_BDIGITS;
while (k--) {
- ptr[--j] = ruby_digitmap[num % base];
+ s[--j] = ruby_digitmap[num % base];
num /= base;
- if (j <= 0) break;
+ if (!trim && j <= 1) break;
if (trim && i == 0 && num == 0) break;
}
}
- if (trim) {
- while (j < len && ptr[j] == '0') j++;
- MEMMOVE(ptr, ptr + j, char, len - j);
- len -= j;
- }
- return len;
-}
-
-static long
-big2str_karatsuba(VALUE x, int base, char* ptr,
- long n1, long len, long hbase, int trim)
-{
- long lh, ll, m1;
- VALUE b, q, r;
-
- if (BIGZEROP(x)) {
- if (trim) return 0;
- else {
- memset(ptr, '0', len);
- return len;
- }
- }
-
- if (n1 <= KARATSUBA_DIGITS) {
- return big2str_orig(x, base, ptr, len, hbase, trim);
- }
-
- b = power_cache_get_power(base, n1, &m1);
- bigdivmod(x, b, &q, &r);
- lh = big2str_karatsuba(q, base, ptr, (len - m1)/2,
- len - m1, hbase, trim);
- rb_big_resize(q, 0);
- ll = big2str_karatsuba(r, base, ptr + lh, m1/2,
- m1, hbase, !lh && trim);
- rb_big_resize(r, 0);
-
- return lh + ll;
-}
-
-VALUE
-rb_big2str0(VALUE x, int base, int trim)
-{
- int off;
- VALUE ss, xx;
- long n1, n2, len, hbase;
- char* ptr;
-
- if (FIXNUM_P(x)) {
- return rb_fix2str(x, base);
- }
- if (BIGZEROP(x)) {
- return rb_usascii_str_new2("0");
- }
-
- if (base < 2 || 36 < base)
- rb_raise(rb_eArgError, "invalid radix %d", base);
-
- n2 = big2str_find_n1(x, base);
- n1 = (n2 + 1) / 2;
- ss = rb_usascii_str_new(0, n2 + 1); /* plus one for sign */
- ptr = RSTRING_PTR(ss);
- ptr[0] = RBIGNUM_SIGN(x) ? '+' : '-';
-
- hbase = base*base;
-#if SIZEOF_BDIGITS > 2
- hbase *= hbase;
-#endif
- off = !(trim && RBIGNUM_SIGN(x)); /* erase plus sign if trim */
- xx = rb_big_clone(x);
- RBIGNUM_SET_SIGN(xx, 1);
- if (n1 <= KARATSUBA_DIGITS) {
- len = off + big2str_orig(xx, base, ptr + off, n2, hbase, trim);
+ if (trim) {while (s[j] == '0') j++;}
+ i = RSTRING(ss)->len - j;
+ if (RBIGNUM(x)->sign) {
+ memmove(s, s+j, i);
+ RSTRING(ss)->len = i-1;
}
else {
- len = off + big2str_karatsuba(xx, base, ptr + off, n1,
- n2, hbase, trim);
+ memmove(s+1, s+j, i);
+ RSTRING(ss)->len = i;
}
- rb_big_resize(xx, 0);
-
- ptr[len] = '\0';
- rb_str_resize(ss, len);
+ s[RSTRING(ss)->len] = '\0';
+ TRAP_END;
return ss;
}
@@ -995,7 +759,7 @@ rb_big2str0(VALUE x, int base, int trim)
VALUE
rb_big2str(VALUE x, int base)
{
- return rb_big2str0(x, base, 1);
+ return rb_big2str0(x, base, Qtrue);
}
/*
@@ -1013,84 +777,87 @@ rb_big2str(VALUE x, int base)
*/
static VALUE
-rb_big_to_s(int argc, VALUE *argv, VALUE x)
+rb_big_to_s(argc, argv, x)
+ int argc;
+ VALUE *argv;
+ VALUE x;
{
+ VALUE b;
int base;
+ rb_scan_args(argc, argv, "01", &b);
if (argc == 0) base = 10;
- else {
- VALUE b;
-
- rb_scan_args(argc, argv, "01", &b);
- base = NUM2INT(b);
- }
+ else base = NUM2INT(b);
return rb_big2str(x, base);
}
-static VALUE
-big2ulong(VALUE x, const char *type, int check)
+static unsigned long
+big2ulong(x, type)
+ VALUE x;
+ char *type;
{
- long len = RBIGNUM_LEN(x);
+ long len = RBIGNUM(x)->len;
BDIGIT_DBL num;
BDIGIT *ds;
- if (len > DIGSPERLONG) {
- if (check)
- rb_raise(rb_eRangeError, "bignum too big to convert into `%s'", type);
- len = DIGSPERLONG;
- }
+ if (len > SIZEOF_LONG/SIZEOF_BDIGITS)
+ rb_raise(rb_eRangeError, "bignum too big to convert into `%s'", type);
ds = BDIGITS(x);
num = 0;
while (len--) {
num = BIGUP(num);
num += ds[len];
}
- return (VALUE)num;
+ return num;
}
-VALUE
-rb_big2ulong_pack(VALUE x)
+unsigned long
+rb_big2ulong_pack(x)
+ VALUE x;
{
- VALUE num = big2ulong(x, "unsigned long", Qfalse);
- if (!RBIGNUM_SIGN(x)) {
- return (VALUE)(-(SIGNED_VALUE)num);
+ unsigned long num = big2ulong(x, "unsigned long");
+ if (!RBIGNUM(x)->sign) {
+ return -num;
}
return num;
}
-VALUE
-rb_big2ulong(VALUE x)
+unsigned long
+rb_big2ulong(x)
+ VALUE x;
{
- VALUE num = big2ulong(x, "unsigned long", Qtrue);
+ unsigned long num = big2ulong(x, "unsigned long");
- if (!RBIGNUM_SIGN(x)) {
- if ((SIGNED_VALUE)num < 0) {
+ if (!RBIGNUM(x)->sign) {
+ if ((long)num < 0) {
rb_raise(rb_eRangeError, "bignum out of range of unsigned long");
}
- return (VALUE)(-(SIGNED_VALUE)num);
+ return -num;
}
return num;
}
-SIGNED_VALUE
-rb_big2long(VALUE x)
+long
+rb_big2long(x)
+ VALUE x;
{
- VALUE num = big2ulong(x, "long", Qtrue);
+ unsigned long num = big2ulong(x, "long");
- if ((SIGNED_VALUE)num < 0 &&
- (RBIGNUM_SIGN(x) || (SIGNED_VALUE)num != LONG_MIN)) {
+ if ((long)num < 0 && (RBIGNUM(x)->sign || (long)num != LONG_MIN)) {
rb_raise(rb_eRangeError, "bignum too big to convert into `long'");
}
- if (!RBIGNUM_SIGN(x)) return -(SIGNED_VALUE)num;
+ if (!RBIGNUM(x)->sign) return -(long)num;
return num;
}
#if HAVE_LONG_LONG
static unsigned LONG_LONG
-big2ull(VALUE x, const char *type)
+big2ull(x, type)
+ VALUE x;
+ char *type;
{
- long len = RBIGNUM_LEN(x);
+ long len = RBIGNUM(x)->len;
BDIGIT_DBL num;
BDIGIT *ds;
@@ -1106,32 +873,34 @@ big2ull(VALUE x, const char *type)
}
unsigned LONG_LONG
-rb_big2ull(VALUE x)
+rb_big2ull(x)
+ VALUE x;
{
unsigned LONG_LONG num = big2ull(x, "unsigned long long");
- if (!RBIGNUM_SIGN(x))
- return (VALUE)(-(SIGNED_VALUE)num);
+ if (!RBIGNUM(x)->sign) return -num;
return num;
}
LONG_LONG
-rb_big2ll(VALUE x)
+rb_big2ll(x)
+ VALUE x;
{
unsigned LONG_LONG num = big2ull(x, "long long");
- if ((LONG_LONG)num < 0 && (RBIGNUM_SIGN(x)
+ if ((LONG_LONG)num < 0 && (RBIGNUM(x)->sign
|| (LONG_LONG)num != LLONG_MIN)) {
rb_raise(rb_eRangeError, "bignum too big to convert into `long long'");
}
- if (!RBIGNUM_SIGN(x)) return -(LONG_LONG)num;
+ if (!RBIGNUM(x)->sign) return -(LONG_LONG)num;
return num;
}
#endif /* HAVE_LONG_LONG */
static VALUE
-dbl2big(double d)
+dbl2big(d)
+ double d;
{
long i = 0;
BDIGIT c;
@@ -1163,92 +932,36 @@ dbl2big(double d)
}
VALUE
-rb_dbl2big(double d)
+rb_dbl2big(d)
+ double d;
{
return bignorm(dbl2big(d));
}
-static int
-nlz(BDIGIT x)
-{
- BDIGIT y;
- int n = BITSPERDIG;
-#if BITSPERDIG > 64
- y = x >> 64; if (y) {n -= 64; x = y;}
-#endif
-#if BITSPERDIG > 32
- y = x >> 32; if (y) {n -= 32; x = y;}
-#endif
-#if BITSPERDIG > 16
- y = x >> 16; if (y) {n -= 16; x = y;}
-#endif
- y = x >> 8; if (y) {n -= 8; x = y;}
- 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 n - x;
-}
-
static double
-big2dbl(VALUE x)
+big2dbl(x)
+ VALUE x;
{
double d = 0.0;
- long i = RBIGNUM_LEN(x), lo = 0, bits;
- BDIGIT *ds = BDIGITS(x), dl;
+ long i = RBIGNUM(x)->len;
+ BDIGIT *ds = BDIGITS(x);
- if (i) {
- bits = i * BITSPERDIG - nlz(ds[i-1]);
- if (bits > DBL_MANT_DIG+DBL_MAX_EXP) {
- d = HUGE_VAL;
- }
- else {
- if (bits > DBL_MANT_DIG+1)
- lo = (bits -= DBL_MANT_DIG+1) / BITSPERDIG;
- else
- bits = 0;
- while (--i > lo) {
- d = ds[i] + BIGRAD*d;
- }
- dl = ds[i];
- if (bits && (dl & (1UL << (bits %= BITSPERDIG)))) {
- int carry = dl & ~(~(BDIGIT)0 << bits);
- if (!carry) {
- while (i-- > 0) {
- if ((carry = ds[i]) != 0) break;
- }
- }
- if (carry) {
- dl &= (BDIGIT)~0 << bits;
- dl += (BDIGIT)1 << bits;
- if (!dl) d += 1;
- }
- }
- d = dl + BIGRAD*d;
- if (lo) {
- if (lo > INT_MAX / BITSPERDIG)
- d = HUGE_VAL;
- else if (lo < INT_MIN / BITSPERDIG)
- d = 0.0;
- else
- d = ldexp(d, (int)(lo * BITSPERDIG));
- }
- }
+ while (i--) {
+ d = ds[i] + BIGRAD*d;
}
- if (!RBIGNUM_SIGN(x)) d = -d;
+ if (!RBIGNUM(x)->sign) d = -d;
return d;
}
double
-rb_big2dbl(VALUE x)
+rb_big2dbl(x)
+ VALUE x;
{
double d = big2dbl(x);
if (isinf(d)) {
- rb_warning("Bignum out of Float range");
- if (d < 0.0)
- d = -HUGE_VAL;
- else
- d = HUGE_VAL;
+ rb_warn("Bignum out of Float range");
+ d = HUGE_VAL;
}
return d;
}
@@ -1263,9 +976,10 @@ rb_big2dbl(VALUE x)
*/
static VALUE
-rb_big_to_f(VALUE x)
+rb_big_to_f(x)
+ VALUE x;
{
- return DBL2NUM(rb_big2dbl(x));
+ return rb_float_new(rb_big2dbl(x));
}
/*
@@ -1278,10 +992,11 @@ rb_big_to_f(VALUE x)
*
*/
-VALUE
-rb_big_cmp(VALUE x, VALUE y)
+static VALUE
+rb_big_cmp(x, y)
+ VALUE x, y;
{
- long xlen = RBIGNUM_LEN(x);
+ long xlen = RBIGNUM(x)->len;
switch (TYPE(y)) {
case T_FIXNUM:
@@ -1292,32 +1007,24 @@ rb_big_cmp(VALUE x, VALUE y)
break;
case T_FLOAT:
- {
- double a = RFLOAT_VALUE(y);
-
- if (isinf(a)) {
- if (a > 0.0) return INT2FIX(-1);
- else return INT2FIX(1);
- }
- return rb_dbl_cmp(rb_big2dbl(x), a);
- }
+ return rb_dbl_cmp(rb_big2dbl(x), RFLOAT(y)->value);
default:
- return rb_num_coerce_cmp(x, y, rb_intern("<=>"));
+ return rb_num_coerce_cmp(x, y);
}
- if (RBIGNUM_SIGN(x) > RBIGNUM_SIGN(y)) return INT2FIX(1);
- if (RBIGNUM_SIGN(x) < RBIGNUM_SIGN(y)) return INT2FIX(-1);
- if (xlen < RBIGNUM_LEN(y))
- return (RBIGNUM_SIGN(x)) ? INT2FIX(-1) : INT2FIX(1);
- if (xlen > RBIGNUM_LEN(y))
- return (RBIGNUM_SIGN(x)) ? INT2FIX(1) : INT2FIX(-1);
+ if (RBIGNUM(x)->sign > RBIGNUM(y)->sign) return INT2FIX(1);
+ if (RBIGNUM(x)->sign < RBIGNUM(y)->sign) return INT2FIX(-1);
+ if (xlen < RBIGNUM(y)->len)
+ return (RBIGNUM(x)->sign) ? INT2FIX(-1) : INT2FIX(1);
+ if (xlen > RBIGNUM(y)->len)
+ return (RBIGNUM(x)->sign) ? INT2FIX(1) : INT2FIX(-1);
while(xlen-- && (BDIGITS(x)[xlen]==BDIGITS(y)[xlen]));
if (-1 == xlen) return INT2FIX(0);
return (BDIGITS(x)[xlen] > BDIGITS(y)[xlen]) ?
- (RBIGNUM_SIGN(x) ? INT2FIX(1) : INT2FIX(-1)) :
- (RBIGNUM_SIGN(x) ? INT2FIX(-1) : INT2FIX(1));
+ (RBIGNUM(x)->sign ? INT2FIX(1) : INT2FIX(-1)) :
+ (RBIGNUM(x)->sign ? INT2FIX(-1) : INT2FIX(1));
}
/*
@@ -1331,8 +1038,9 @@ rb_big_cmp(VALUE x, VALUE y)
* 68719476736 == 68719476736.0 #=> true
*/
-VALUE
-rb_big_eq(VALUE x, VALUE y)
+static VALUE
+rb_big_eq(x, y)
+ VALUE x, y;
{
switch (TYPE(y)) {
case T_FIXNUM:
@@ -1341,10 +1049,10 @@ rb_big_eq(VALUE x, VALUE y)
case T_BIGNUM:
break;
case T_FLOAT:
- {
+ {
volatile double a, b;
- a = RFLOAT_VALUE(y);
+ a = RFLOAT(y)->value;
if (isnan(a)) return Qfalse;
b = rb_big2dbl(x);
return (a == b)?Qtrue:Qfalse;
@@ -1352,9 +1060,9 @@ rb_big_eq(VALUE x, VALUE y)
default:
return rb_equal(y, x);
}
- if (RBIGNUM_SIGN(x) != RBIGNUM_SIGN(y)) return Qfalse;
- if (RBIGNUM_LEN(x) != RBIGNUM_LEN(y)) return Qfalse;
- if (MEMCMP(BDIGITS(x),BDIGITS(y),BDIGIT,RBIGNUM_LEN(y)) != 0) return Qfalse;
+ if (RBIGNUM(x)->sign != RBIGNUM(y)->sign) return Qfalse;
+ if (RBIGNUM(x)->len != RBIGNUM(y)->len) return Qfalse;
+ if (MEMCMP(BDIGITS(x),BDIGITS(y),BDIGIT,RBIGNUM(y)->len) != 0) return Qfalse;
return Qtrue;
}
@@ -1370,12 +1078,13 @@ rb_big_eq(VALUE x, VALUE y)
*/
static VALUE
-rb_big_eql(VALUE x, VALUE y)
+rb_big_eql(x, y)
+ VALUE x, y;
{
if (TYPE(y) != T_BIGNUM) return Qfalse;
- if (RBIGNUM_SIGN(x) != RBIGNUM_SIGN(y)) return Qfalse;
- if (RBIGNUM_LEN(x) != RBIGNUM_LEN(y)) return Qfalse;
- if (MEMCMP(BDIGITS(x),BDIGITS(y),BDIGIT,RBIGNUM_LEN(y)) != 0) return Qfalse;
+ if (RBIGNUM(x)->sign != RBIGNUM(y)->sign) return Qfalse;
+ if (RBIGNUM(x)->len != RBIGNUM(y)->len) return Qfalse;
+ if (MEMCMP(BDIGITS(x),BDIGITS(y),BDIGIT,RBIGNUM(y)->len) != 0) return Qfalse;
return Qtrue;
}
@@ -1387,11 +1096,12 @@ rb_big_eql(VALUE x, VALUE y)
*/
static VALUE
-rb_big_uminus(VALUE x)
+rb_big_uminus(x)
+ VALUE x;
{
VALUE z = rb_big_clone(x);
- RBIGNUM_SET_SIGN(z, !RBIGNUM_SIGN(x));
+ RBIGNUM(z)->sign = !RBIGNUM(x)->sign;
return bignorm(z);
}
@@ -1409,62 +1119,38 @@ rb_big_uminus(VALUE x)
*/
static VALUE
-rb_big_neg(VALUE x)
+rb_big_neg(x)
+ VALUE x;
{
VALUE z = rb_big_clone(x);
- BDIGIT *ds;
long i;
+ BDIGIT *ds;
- if (!RBIGNUM_SIGN(x)) get2comp(z);
+ if (!RBIGNUM(x)->sign) get2comp(z);
ds = BDIGITS(z);
- i = RBIGNUM_LEN(x);
- if (!i) return INT2FIX(~(SIGNED_VALUE)0);
- while (i--) {
- ds[i] = ~ds[i];
- }
- RBIGNUM_SET_SIGN(z, !RBIGNUM_SIGN(z));
- if (RBIGNUM_SIGN(x)) get2comp(z);
+ i = RBIGNUM(x)->len;
+ if (!i) return INT2FIX(~0);
+ while (i--) ds[i] = ~ds[i];
+ RBIGNUM(z)->sign = !RBIGNUM(z)->sign;
+ if (RBIGNUM(x)->sign) get2comp(z);
return bignorm(z);
}
-static void
-bigsub_core(BDIGIT *xds, long xn, BDIGIT *yds, long yn, BDIGIT *zds, long zn)
-{
- BDIGIT_DBL_SIGNED num;
- long i;
-
- for (i = 0, num = 0; i < yn; i++) {
- num += (BDIGIT_DBL_SIGNED)xds[i] - yds[i];
- zds[i] = BIGLO(num);
- num = BIGDN(num);
- }
- while (num && i < xn) {
- num += xds[i];
- zds[i++] = BIGLO(num);
- num = BIGDN(num);
- }
- while (i < xn) {
- zds[i] = xds[i];
- i++;
- }
- assert(i <= zn);
- while (i < zn) {
- zds[i++] = 0;
- }
-}
-
static VALUE
-bigsub(VALUE x, VALUE y)
+bigsub(x, y)
+ VALUE x, y;
{
VALUE z = 0;
- long i = RBIGNUM_LEN(x);
+ BDIGIT *zds;
+ BDIGIT_DBL_SIGNED num;
+ long i = RBIGNUM(x)->len;
/* if x is larger than y, swap */
- if (RBIGNUM_LEN(x) < RBIGNUM_LEN(y)) {
+ if (RBIGNUM(x)->len < RBIGNUM(y)->len) {
z = x; x = y; y = z; /* swap x y */
}
- else if (RBIGNUM_LEN(x) == RBIGNUM_LEN(y)) {
+ else if (RBIGNUM(x)->len == RBIGNUM(y)->len) {
while (i > 0) {
i--;
if (BDIGITS(x)[i] > BDIGITS(y)[i]) {
@@ -1477,177 +1163,68 @@ bigsub(VALUE x, VALUE y)
}
}
- z = bignew(RBIGNUM_LEN(x), z==0);
- bigsub_core(BDIGITS(x), RBIGNUM_LEN(x),
- BDIGITS(y), RBIGNUM_LEN(y),
- BDIGITS(z), RBIGNUM_LEN(z));
-
- return z;
-}
-
-static VALUE bigadd_int(VALUE x, long y);
-
-static VALUE
-bigsub_int(VALUE x, long y0)
-{
- VALUE z;
- BDIGIT *xds, *zds;
- long xn;
- BDIGIT_DBL_SIGNED num;
- long i, y;
-
- y = y0;
- xds = BDIGITS(x);
- xn = RBIGNUM_LEN(x);
-
- z = bignew(xn, RBIGNUM_SIGN(x));
+ z = bignew(RBIGNUM(x)->len, z==0);
zds = BDIGITS(z);
-#if SIZEOF_BDIGITS == SIZEOF_LONG
- num = (BDIGIT_DBL_SIGNED)xds[0] - y;
- if (xn == 1 && num < 0) {
- for (i=0; i<xn; i++) {
- }
- RBIGNUM_SET_SIGN(z, !RBIGNUM_SIGN(x));
- zds[0] = (BDIGIT)-num;
- return bignorm(z);
- }
- zds[0] = BIGLO(num);
- num = BIGDN(num);
- i = 1;
-#else
- num = 0;
- for (i=0; i<(int)(sizeof(y)/sizeof(BDIGIT)); i++) {
- num += (BDIGIT_DBL_SIGNED)xds[i] - BIGLO(y);
+ for (i = 0, num = 0; i < RBIGNUM(y)->len; i++) {
+ num += (BDIGIT_DBL_SIGNED)BDIGITS(x)[i] - BDIGITS(y)[i];
zds[i] = BIGLO(num);
num = BIGDN(num);
- y = BIGDN(y);
}
-#endif
- while (num && i < xn) {
- num += xds[i];
+ while (num && i < RBIGNUM(x)->len) {
+ num += BDIGITS(x)[i];
zds[i++] = BIGLO(num);
num = BIGDN(num);
}
- while (i < xn) {
- zds[i] = xds[i];
+ while (i < RBIGNUM(x)->len) {
+ zds[i] = BDIGITS(x)[i];
i++;
}
- if (num < 0) {
- z = bigsub(x, rb_int2big(y0));
- }
- return bignorm(z);
+
+ return z;
}
static VALUE
-bigadd_int(VALUE x, long y)
+bigadd(x, y, sign)
+ VALUE x, y;
+ int sign;
{
VALUE z;
- BDIGIT *xds, *zds;
- long xn, zn;
BDIGIT_DBL num;
- long i;
+ long i, len;
- xds = BDIGITS(x);
- xn = RBIGNUM_LEN(x);
-
- if (xn < 2) {
- zn = 3;
- }
- else {
- zn = xn + 1;
+ sign = (sign == RBIGNUM(y)->sign);
+ if (RBIGNUM(x)->sign != sign) {
+ if (sign) return bigsub(y, x);
+ return bigsub(x, y);
}
- z = bignew(zn, RBIGNUM_SIGN(x));
- zds = BDIGITS(z);
-#if SIZEOF_BDIGITS == SIZEOF_LONG
- num = (BDIGIT_DBL)xds[0] + y;
- zds[0] = BIGLO(num);
- num = BIGDN(num);
- i = 1;
-#else
- num = 0;
- for (i=0; i<(int)(sizeof(y)/sizeof(BDIGIT)); i++) {
- num += (BDIGIT_DBL)xds[i] + BIGLO(y);
- zds[i] = BIGLO(num);
- num = BIGDN(num);
- y = BIGDN(y);
+ if (RBIGNUM(x)->len > RBIGNUM(y)->len) {
+ len = RBIGNUM(x)->len + 1;
+ z = x; x = y; y = z;
}
-#endif
- while (num && i < xn) {
- num += xds[i];
- zds[i++] = BIGLO(num);
- num = BIGDN(num);
- }
- if (num) zds[i++] = (BDIGIT)num;
- else while (i < xn) {
- zds[i] = xds[i];
- i++;
- }
- assert(i <= zn);
- while (i < zn) {
- zds[i++] = 0;
- }
- return bignorm(z);
-}
-
-static void
-bigadd_core(BDIGIT *xds, long xn, BDIGIT *yds, long yn, BDIGIT *zds, long zn)
-{
- BDIGIT_DBL num = 0;
- long i;
-
- if (xn > yn) {
- BDIGIT *tds;
- tds = xds; xds = yds; yds = tds;
- i = xn; xn = yn; yn = i;
+ else {
+ len = RBIGNUM(y)->len + 1;
}
+ z = bignew(len, sign);
- i = 0;
- while (i < xn) {
- num += (BDIGIT_DBL)xds[i] + yds[i];
- zds[i++] = BIGLO(num);
+ len = RBIGNUM(x)->len;
+ for (i = 0, num = 0; i < len; i++) {
+ num += (BDIGIT_DBL)BDIGITS(x)[i] + BDIGITS(y)[i];
+ BDIGITS(z)[i] = BIGLO(num);
num = BIGDN(num);
}
- while (num && i < yn) {
- num += yds[i];
- zds[i++] = BIGLO(num);
+ len = RBIGNUM(y)->len;
+ while (num && i < len) {
+ num += BDIGITS(y)[i];
+ BDIGITS(z)[i++] = BIGLO(num);
num = BIGDN(num);
}
- while (i < yn) {
- zds[i] = yds[i];
+ while (i < len) {
+ BDIGITS(z)[i] = BDIGITS(y)[i];
i++;
}
- if (num) zds[i++] = (BDIGIT)num;
- assert(i <= zn);
- while (i < zn) {
- zds[i++] = 0;
- }
-}
-
-static VALUE
-bigadd(VALUE x, VALUE y, int sign)
-{
- VALUE z;
- long len;
-
- sign = (sign == RBIGNUM_SIGN(y));
- if (RBIGNUM_SIGN(x) != sign) {
- if (sign) return bigsub(y, x);
- return bigsub(x, y);
- }
-
- if (RBIGNUM_LEN(x) > RBIGNUM_LEN(y)) {
- len = RBIGNUM_LEN(x) + 1;
- }
- else {
- len = RBIGNUM_LEN(y) + 1;
- }
- z = bignew(len, sign);
-
- bigadd_core(BDIGITS(x), RBIGNUM_LEN(x),
- BDIGITS(y), RBIGNUM_LEN(y),
- BDIGITS(z), RBIGNUM_LEN(z));
+ BDIGITS(z)[i] = (BDIGIT)num;
return z;
}
@@ -1660,32 +1237,21 @@ bigadd(VALUE x, VALUE y, int sign)
*/
VALUE
-rb_big_plus(VALUE x, VALUE y)
+rb_big_plus(x, y)
+ VALUE x, y;
{
- long n;
-
switch (TYPE(y)) {
case T_FIXNUM:
- n = FIX2LONG(y);
- if ((n > 0) != RBIGNUM_SIGN(x)) {
- if (n < 0) {
- n = -n;
- }
- return bigsub_int(x, n);
- }
- if (n < 0) {
- n = -n;
- }
- return bigadd_int(x, n);
-
+ y = rb_int2big(FIX2LONG(y));
+ /* fall through */
case T_BIGNUM:
return bignorm(bigadd(x, y, 1));
case T_FLOAT:
- return DBL2NUM(rb_big2dbl(x) + RFLOAT_VALUE(y));
+ return rb_float_new(rb_big2dbl(x) + RFLOAT(y)->value);
default:
- return rb_num_coerce_bin(x, y, '+');
+ return rb_num_coerce_bin(x, y);
}
}
@@ -1697,325 +1263,71 @@ rb_big_plus(VALUE x, VALUE y)
*/
VALUE
-rb_big_minus(VALUE x, VALUE y)
+rb_big_minus(x, y)
+ VALUE x, y;
{
- long n;
-
switch (TYPE(y)) {
case T_FIXNUM:
- n = FIX2LONG(y);
- if ((n > 0) != RBIGNUM_SIGN(x)) {
- if (n < 0) {
- n = -n;
- }
- return bigadd_int(x, n);
- }
- if (n < 0) {
- n = -n;
- }
- return bigsub_int(x, n);
-
+ y = rb_int2big(FIX2LONG(y));
+ /* fall through */
case T_BIGNUM:
return bignorm(bigadd(x, y, 0));
case T_FLOAT:
- return DBL2NUM(rb_big2dbl(x) - RFLOAT_VALUE(y));
+ return rb_float_new(rb_big2dbl(x) - RFLOAT(y)->value);
default:
- return rb_num_coerce_bin(x, y, '-');
+ return rb_num_coerce_bin(x, y);
}
}
-static long
-big_real_len(VALUE x)
-{
- long i = RBIGNUM_LEN(x);
- while (--i && !BDIGITS(x)[i]);
- return i + 1;
-}
-
-static VALUE
-bigmul1_normal(VALUE x, VALUE y)
+VALUE
+rb_big_mul0(x, y)
+ VALUE x, y;
{
long i, j;
BDIGIT_DBL n = 0;
- VALUE z = bignew(RBIGNUM_LEN(x) + RBIGNUM_LEN(y) + 1, RBIGNUM_SIGN(x)==RBIGNUM_SIGN(y));
+ VALUE z;
BDIGIT *zds;
- j = RBIGNUM_LEN(x) + RBIGNUM_LEN(y) + 1;
+ if (FIXNUM_P(x)) x = rb_int2big(FIX2LONG(x));
+ switch (TYPE(y)) {
+ case T_FIXNUM:
+ y = rb_int2big(FIX2LONG(y));
+ break;
+
+ case T_BIGNUM:
+ break;
+
+ case T_FLOAT:
+ return rb_float_new(rb_big2dbl(x) * RFLOAT(y)->value);
+
+ default:
+ return rb_num_coerce_bin(x, y);
+ }
+
+ j = RBIGNUM(x)->len + RBIGNUM(y)->len + 1;
+ z = bignew(j, RBIGNUM(x)->sign==RBIGNUM(y)->sign);
zds = BDIGITS(z);
while (j--) zds[j] = 0;
- for (i = 0; i < RBIGNUM_LEN(x); i++) {
- BDIGIT_DBL dd;
- dd = BDIGITS(x)[i];
+ for (i = 0; i < RBIGNUM(x)->len; i++) {
+ BDIGIT_DBL dd = BDIGITS(x)[i];
if (dd == 0) continue;
n = 0;
- for (j = 0; j < RBIGNUM_LEN(y); j++) {
+ for (j = 0; j < RBIGNUM(y)->len; j++) {
BDIGIT_DBL ee = n + (BDIGIT_DBL)dd * BDIGITS(y)[j];
n = zds[i + j] + ee;
if (ee) zds[i + j] = BIGLO(n);
n = BIGDN(n);
}
if (n) {
- zds[i + j] = (BDIGIT)n;
- }
- }
- rb_thread_check_ints();
- return z;
-}
-
-static VALUE bigmul0(VALUE x, VALUE y);
-
-/* balancing multiplication by slicing larger argument */
-static VALUE
-bigmul1_balance(VALUE x, VALUE y)
-{
- VALUE z, t1, t2;
- long i, xn, yn, r, n;
-
- xn = RBIGNUM_LEN(x);
- yn = RBIGNUM_LEN(y);
- assert(2 * xn <= yn);
-
- z = bignew(xn + yn, RBIGNUM_SIGN(x)==RBIGNUM_SIGN(y));
- t1 = bignew(xn, 1);
-
- for (i = 0; i < xn + yn; i++) BDIGITS(z)[i] = 0;
-
- n = 0;
- while (yn > 0) {
- r = xn > yn ? yn : xn;
- MEMCPY(BDIGITS(t1), BDIGITS(y) + n, BDIGIT, r);
- RBIGNUM_SET_LEN(t1, r);
- t2 = bigmul0(x, t1);
- bigadd_core(BDIGITS(z) + n, RBIGNUM_LEN(z) - n,
- BDIGITS(t2), big_real_len(t2),
- BDIGITS(z) + n, RBIGNUM_LEN(z) - n);
- yn -= r;
- n += r;
- }
-
- return z;
-}
-
-/* split a bignum into high and low bignums */
-static void
-big_split(VALUE v, long n, VALUE *ph, VALUE *pl)
-{
- long hn, ln;
- VALUE h, l;
-
- ln = RBIGNUM_LEN(v) > n ? n : RBIGNUM_LEN(v);
- hn = RBIGNUM_LEN(v) - ln;
-
- while (--hn && !BDIGITS(v)[hn + ln]);
- h = bignew(hn += 2, 1);
- MEMCPY(BDIGITS(h), BDIGITS(v) + ln, BDIGIT, hn);
- BDIGITS(h)[hn - 1] = 0;
-
- while (--ln && !BDIGITS(v)[ln]);
- l = bignew(ln += 2, 1);
- MEMCPY(BDIGITS(l), BDIGITS(v), BDIGIT, ln);
- BDIGITS(l)[ln - 1] = 0;
-
- *pl = l;
- *ph = h;
-}
-
-/* multiplication by karatsuba method */
-static VALUE
-bigmul1_karatsuba(VALUE x, VALUE y)
-{
- long i, n, xn, yn, t1n, t2n;
- VALUE xh, xl, yh, yl, z, t1, t2;
- BDIGIT *zds;
-
- xn = RBIGNUM_LEN(x);
- yn = RBIGNUM_LEN(y);
- n = yn / 2;
- big_split(x, n, &xh, &xl);
- if (x == y) {
- yh = xh; yl = xl;
- }
- else big_split(y, n, &yh, &yl);
-
- /* x = xh * b + xl
- * y = yh * b + yl
- *
- * Karatsuba method:
- * x * y = z2 * b^2 + z1 * b + z0
- * where
- * z2 = xh * yh
- * z0 = xl * yl
- * z1 = (xh + xl) * (yh + yl) - z2 - z0
- *
- * ref: http://en.wikipedia.org/wiki/Karatsuba_algorithm
- */
-
- /* allocate a result bignum */
- z = bignew(xn + yn, RBIGNUM_SIGN(x)==RBIGNUM_SIGN(y));
- zds = BDIGITS(z);
-
- /* t1 <- xh * yh */
- t1 = bigmul0(xh, yh);
- t1n = big_real_len(t1);
-
- /* copy t1 into high bytes of the result (z2) */
- MEMCPY(zds + 2 * n, BDIGITS(t1), BDIGIT, t1n);
- for (i = 2 * n + t1n; i < xn + yn; i++) zds[i] = 0;
-
- if (!BIGZEROP(xl) && !BIGZEROP(yl)) {
- /* t2 <- xl * yl */
- t2 = bigmul0(xl, yl);
- t2n = big_real_len(t2);
-
- /* copy t2 into low bytes of the result (z0) */
- MEMCPY(zds, BDIGITS(t2), BDIGIT, t2n);
- for (i = t2n; i < 2 * n; i++) zds[i] = 0;
-
- /* subtract t2 from middle bytes of the result (z1) */
- i = xn + yn - n;
- bigsub_core(zds + n, i, BDIGITS(t2), t2n, zds + n, i);
- }
- else {
- /* copy 0 into low bytes of the result (z0) */
- for (i = 0; i < 2 * n; i++) zds[i] = 0;
- }
-
- /* subtract t1 from middle bytes of the result (z1) */
- i = xn + yn - n;
- bigsub_core(zds + n, i, BDIGITS(t1), t1n, zds + n, i);
-
- /* xh <- xh + xl */
- if (RBIGNUM_LEN(xl) > RBIGNUM_LEN(xh)) {
- t1 = xl; xl = xh; xh = t1;
- }
- bigadd_core(BDIGITS(xh), RBIGNUM_LEN(xh),
- BDIGITS(xl), RBIGNUM_LEN(xl),
- BDIGITS(xh), RBIGNUM_LEN(xh));
-
- /* yh <- yh + yl */
- if (x != y) {
- if (RBIGNUM_LEN(yl) > RBIGNUM_LEN(yh)) {
- t1 = yl; yl = yh; yh = t1;
+ zds[i + j] = n;
}
- bigadd_core(BDIGITS(yh), RBIGNUM_LEN(yh),
- BDIGITS(yl), RBIGNUM_LEN(yl),
- BDIGITS(yh), RBIGNUM_LEN(yh));
}
- else yh = xh;
-
- /* t1 <- xh * yh */
- t1 = bigmul0(xh, yh);
-
- /* add t1 to middle bytes of the result (z1) */
- bigadd_core(zds + n, i, BDIGITS(t1), big_real_len(t1), zds + n, i);
-
- return z;
-}
-/* efficient squaring (2 times faster than normal multiplication)
- * ref: Handbook of Applied Cryptography, Algorithm 14.16
- * http://www.cacr.math.uwaterloo.ca/hac/about/chap14.pdf
- */
-static VALUE
-bigsqr_fast(VALUE x)
-{
- long len = RBIGNUM_LEN(x), i, j;
- VALUE z = bignew(2 * len + 1, 1);
- BDIGIT *xds = BDIGITS(x), *zds = BDIGITS(z);
- BDIGIT_DBL c, v, w;
-
- for (i = 2 * len + 1; i--; ) zds[i] = 0;
- for (i = 0; i < len; i++) {
- v = (BDIGIT_DBL)xds[i];
- if (!v) continue;
- c = (BDIGIT_DBL)zds[i + i] + v * v;
- zds[i + i] = BIGLO(c);
- c = BIGDN(c);
- v *= 2;
- for (j = i + 1; j < len; j++) {
- w = (BDIGIT_DBL)xds[j];
- c += (BDIGIT_DBL)zds[i + j] + BIGLO(v) * w;
- zds[i + j] = BIGLO(c);
- c = BIGDN(c);
- if (BIGDN(v)) c += w;
- }
- if (c) {
- c += (BDIGIT_DBL)zds[i + len];
- zds[i + len] = BIGLO(c);
- c = BIGDN(c);
- }
- if (c) zds[i + len + 1] += (BDIGIT)c;
- }
return z;
}
-#define KARATSUBA_MUL_DIGITS 70
-
-
-/* determine whether a bignum is sparse or not by random sampling */
-static inline VALUE
-big_sparse_p(VALUE x)
-{
- long c = 0, n = RBIGNUM_LEN(x);
- unsigned long rb_rand_internal(unsigned long i);
-
- if ( BDIGITS(x)[rb_rand_internal(n / 2) + n / 4]) c++;
- if (c <= 1 && BDIGITS(x)[rb_rand_internal(n / 2) + n / 4]) c++;
- if (c <= 1 && BDIGITS(x)[rb_rand_internal(n / 2) + n / 4]) c++;
-
- return (c <= 1) ? Qtrue : Qfalse;
-}
-
-#if 0
-static void
-dump_bignum(VALUE x)
-{
- long i;
- printf("0x0");
- for (i = RBIGNUM_LEN(x); i--; ) {
- printf("_%08x", BDIGITS(x)[i]);
- }
- puts("");
-}
-#endif
-
-static VALUE
-bigmul0(VALUE x, VALUE y)
-{
- long xn, yn;
-
- xn = RBIGNUM_LEN(x);
- yn = RBIGNUM_LEN(y);
-
- /* make sure that y is longer than x */
- if (xn > yn) {
- VALUE t;
- long tn;
- t = x; x = y; y = t;
- tn = xn; xn = yn; yn = tn;
- }
- assert(xn <= yn);
-
- /* normal multiplication when x is small */
- if (xn < KARATSUBA_MUL_DIGITS) {
- normal:
- if (x == y) return bigsqr_fast(x);
- return bigmul1_normal(x, y);
- }
-
- /* normal multiplication when x or y is a sparse bignum */
- if (big_sparse_p(x)) goto normal;
- if (big_sparse_p(y)) return bigmul1_normal(y, x);
-
- /* balance multiplication by slicing y when x is much smaller than y */
- if (2 * xn <= yn) return bigmul1_balance(x, y);
-
- /* multiplication by karatsuba method */
- return bigmul1_karatsuba(x, y);
-}
-
/*
* call-seq:
* big * other => Numeric
@@ -2024,93 +1336,23 @@ bigmul0(VALUE x, VALUE y)
*/
VALUE
-rb_big_mul(VALUE x, VALUE y)
-{
- switch (TYPE(y)) {
- case T_FIXNUM:
- y = rb_int2big(FIX2LONG(y));
- break;
-
- case T_BIGNUM:
- break;
-
- case T_FLOAT:
- return DBL2NUM(rb_big2dbl(x) * RFLOAT_VALUE(y));
-
- default:
- return rb_num_coerce_bin(x, y, '*');
- }
-
- return bignorm(bigmul0(x, y));
-}
-
-struct big_div_struct {
- long nx, ny;
- BDIGIT *yds, *zds;
- VALUE stop;
-};
-
-static VALUE
-bigdivrem1(void *ptr)
+rb_big_mul(x, y)
+ VALUE x, y;
{
- struct big_div_struct *bds = (struct big_div_struct*)ptr;
- long nx = bds->nx, ny = bds->ny;
- long i, j, nyzero;
- BDIGIT *yds = bds->yds, *zds = bds->zds;
- BDIGIT_DBL t2;
- BDIGIT_DBL_SIGNED num;
- BDIGIT q;
-
- j = nx==ny?nx+1:nx;
- for (nyzero = 0; !yds[nyzero]; nyzero++);
- do {
- if (bds->stop) return Qnil;
- if (zds[j] == yds[ny-1]) q = (BDIGIT)BIGRAD-1;
- else q = (BDIGIT)((BIGUP(zds[j]) + zds[j-1])/yds[ny-1]);
- if (q) {
- i = nyzero; num = 0; t2 = 0;
- do { /* multiply and subtract */
- BDIGIT_DBL ee;
- t2 += (BDIGIT_DBL)yds[i] * q;
- ee = num - BIGLO(t2);
- num = (BDIGIT_DBL)zds[j - ny + i] + ee;
- if (ee) zds[j - ny + i] = BIGLO(num);
- num = BIGDN(num);
- t2 = BIGDN(t2);
- } while (++i < ny);
- num += zds[j - ny + i] - t2;/* borrow from high digit; don't update */
- while (num) { /* "add back" required */
- i = 0; num = 0; q--;
- do {
- BDIGIT_DBL ee = num + yds[i];
- num = (BDIGIT_DBL)zds[j - ny + i] + ee;
- if (ee) zds[j - ny + i] = BIGLO(num);
- num = BIGDN(num);
- } while (++i < ny);
- num--;
- }
- }
- zds[j] = q;
- } while (--j >= ny);
- return Qnil;
+ return bignorm(rb_big_mul0(x, y));
}
static void
-rb_big_stop(void *ptr)
-{
- VALUE *stop = (VALUE*)ptr;
- *stop = Qtrue;
-}
-
-static VALUE
-bigdivrem(VALUE x, VALUE y, VALUE *divp, VALUE *modp)
+bigdivrem(x, y, divp, modp)
+ VALUE x, y;
+ VALUE *divp, *modp;
{
- struct big_div_struct bds;
- long nx = RBIGNUM_LEN(x), ny = RBIGNUM_LEN(y);
+ long nx = RBIGNUM(x)->len, ny = RBIGNUM(y)->len;
long i, j;
- volatile VALUE yy, z;
+ VALUE yy, z;
BDIGIT *xds, *yds, *zds, *tds;
BDIGIT_DBL t2;
+ BDIGIT_DBL_SIGNED num;
BDIGIT dd, q;
if (BIGZEROP(y)) rb_num_zerodiv();
@@ -2118,7 +1360,7 @@ bigdivrem(VALUE x, VALUE y, VALUE *divp, VALUE *modp)
if (nx < ny || (nx == ny && BDIGITS(x)[nx - 1] < BDIGITS(y)[ny - 1])) {
if (divp) *divp = rb_int2big(0);
if (modp) *modp = x;
- return Qnil;
+ return;
}
xds = BDIGITS(x);
if (ny == 1) {
@@ -2131,23 +1373,23 @@ bigdivrem(VALUE x, VALUE y, VALUE *divp, VALUE *modp)
zds[i] = (BDIGIT)(t2 / dd);
t2 %= dd;
}
- RBIGNUM_SET_SIGN(z, RBIGNUM_SIGN(x)==RBIGNUM_SIGN(y));
+ RBIGNUM(z)->sign = RBIGNUM(x)->sign==RBIGNUM(y)->sign;
if (modp) {
- *modp = rb_uint2big((VALUE)t2);
- RBIGNUM_SET_SIGN(*modp, RBIGNUM_SIGN(x));
+ *modp = rb_uint2big((unsigned long)t2);
+ RBIGNUM(*modp)->sign = RBIGNUM(x)->sign;
}
if (divp) *divp = z;
- return Qnil;
+ return;
}
- z = bignew(nx==ny?nx+2:nx+1, RBIGNUM_SIGN(x)==RBIGNUM_SIGN(y));
+ z = bignew(nx==ny?nx+2:nx+1, RBIGNUM(x)->sign==RBIGNUM(y)->sign);
zds = BDIGITS(z);
if (nx==ny) zds[nx+1] = 0;
while (!yds[ny-1]) ny--;
dd = 0;
q = yds[ny-1];
- while ((q & (1UL<<(BITSPERDIG-1))) == 0) {
- q <<= 1UL;
+ while ((q & (1U<<(BITSPERDIG-1))) == 0) {
+ q <<= 1;
dd++;
}
if (dd) {
@@ -2176,25 +1418,41 @@ bigdivrem(VALUE x, VALUE y, VALUE *divp, VALUE *modp)
while (j--) zds[j] = xds[j];
}
- bds.nx = nx;
- bds.ny = ny;
- bds.zds = zds;
- bds.yds = yds;
- bds.stop = Qfalse;
- if (RBIGNUM_LEN(x) > 10000 || RBIGNUM_LEN(y) > 10000) {
- rb_thread_blocking_region(bigdivrem1, &bds, rb_big_stop, &bds.stop);
- }
- else {
- bigdivrem1(&bds);
- }
-
+ j = nx==ny?nx+1:nx;
+ do {
+ if (zds[j] == yds[ny-1]) q = BIGRAD-1;
+ else q = (BDIGIT)((BIGUP(zds[j]) + zds[j-1])/yds[ny-1]);
+ if (q) {
+ i = 0; num = 0; t2 = 0;
+ do { /* multiply and subtract */
+ BDIGIT_DBL ee;
+ t2 += (BDIGIT_DBL)yds[i] * q;
+ ee = num - BIGLO(t2);
+ num = (BDIGIT_DBL)zds[j - ny + i] + ee;
+ if (ee) zds[j - ny + i] = BIGLO(num);
+ num = BIGDN(num);
+ t2 = BIGDN(t2);
+ } while (++i < ny);
+ num += zds[j - ny + i] - t2;/* borrow from high digit; don't update */
+ while (num) { /* "add back" required */
+ i = 0; num = 0; q--;
+ do {
+ BDIGIT_DBL ee = num + yds[i];
+ num = (BDIGIT_DBL)zds[j - ny + i] + ee;
+ if (ee) zds[j - ny + i] = BIGLO(num);
+ num = BIGDN(num);
+ } while (++i < ny);
+ num--;
+ }
+ }
+ zds[j] = q;
+ } while (--j >= ny);
if (divp) { /* move quotient down in z */
*divp = rb_big_clone(z);
zds = BDIGITS(*divp);
j = (nx==ny ? nx+2 : nx+1) - ny;
for (i = 0;i < j;i++) zds[i] = zds[i+ny];
- if (!zds[i-1]) i--;
- RBIGNUM_SET_LEN(*divp, i);
+ RBIGNUM(*divp)->len = i;
}
if (modp) { /* normalize remainder */
*modp = rb_big_clone(z);
@@ -2209,31 +1467,40 @@ bigdivrem(VALUE x, VALUE y, VALUE *divp, VALUE *modp)
t2 = BIGUP(q);
}
}
- if (!zds[ny-1]) ny--;
- RBIGNUM_SET_LEN(*modp, ny);
- RBIGNUM_SET_SIGN(*modp, RBIGNUM_SIGN(x));
+ RBIGNUM(*modp)->len = ny;
+ RBIGNUM(*modp)->sign = RBIGNUM(x)->sign;
}
- return z;
}
static void
-bigdivmod(VALUE x, VALUE y, VALUE *divp, VALUE *modp)
+bigdivmod(x, y, divp, modp)
+ VALUE x, y;
+ VALUE *divp, *modp;
{
VALUE mod;
bigdivrem(x, y, divp, &mod);
- if (RBIGNUM_SIGN(x) != RBIGNUM_SIGN(y) && !BIGZEROP(mod)) {
+ if (RBIGNUM(x)->sign != RBIGNUM(y)->sign && !BIGZEROP(mod)) {
if (divp) *divp = bigadd(*divp, rb_int2big(1), 0);
if (modp) *modp = bigadd(mod, y, 1);
}
- else if (modp) {
- *modp = mod;
+ else {
+ if (divp) *divp = *divp;
+ if (modp) *modp = mod;
}
}
+/*
+ * call-seq:
+ * big / other => Numeric
+ * big.div(other) => Numeric
+ *
+ * Divides big by other, returning the result.
+ */
static VALUE
-rb_big_divide(VALUE x, VALUE y, ID op)
+rb_big_div(x, y)
+ VALUE x, y;
{
VALUE z;
@@ -2245,19 +1512,8 @@ rb_big_divide(VALUE x, VALUE y, ID op)
case T_BIGNUM:
break;
- case T_FLOAT:
- {
- double div = rb_big2dbl(x) / RFLOAT_VALUE(y);
- if (op == '/') {
- return DBL2NUM(div);
- }
- else {
- return rb_dbl2big(div);
- }
- }
-
default:
- return rb_num_coerce_bin(x, y, op);
+ return rb_num_coerce_bin(x, y);
}
bigdivmod(x, y, &z, 0);
@@ -2266,25 +1522,6 @@ rb_big_divide(VALUE x, VALUE y, ID op)
/*
* call-seq:
- * big / other => Numeric
- *
- * Divides big by other, returning the result.
- */
-
-VALUE
-rb_big_div(VALUE x, VALUE y)
-{
- return rb_big_divide(x, y, '/');
-}
-
-VALUE
-rb_big_idiv(VALUE x, VALUE y)
-{
- return rb_big_divide(x, y, rb_intern("div"));
-}
-
-/*
- * call-seq:
* big % other => Numeric
* big.modulo(other) => Numeric
*
@@ -2292,8 +1529,9 @@ rb_big_idiv(VALUE x, VALUE y)
* information.
*/
-VALUE
-rb_big_modulo(VALUE x, VALUE y)
+static VALUE
+rb_big_modulo(x, y)
+ VALUE x, y;
{
VALUE z;
@@ -2306,7 +1544,7 @@ rb_big_modulo(VALUE x, VALUE y)
break;
default:
- return rb_num_coerce_bin(x, y, '%');
+ return rb_num_coerce_bin(x, y);
}
bigdivmod(x, y, 0, &z);
@@ -2323,7 +1561,8 @@ rb_big_modulo(VALUE x, VALUE y)
* -1234567890987654321.remainder(13731.24) #=> -9906.22531493148
*/
static VALUE
-rb_big_remainder(VALUE x, VALUE y)
+rb_big_remainder(x, y)
+ VALUE x, y;
{
VALUE z;
@@ -2336,41 +1575,13 @@ rb_big_remainder(VALUE x, VALUE y)
break;
default:
- return rb_num_coerce_bin(x, y, rb_intern("remainder"));
+ return rb_num_coerce_bin(x, y);
}
bigdivrem(x, y, 0, &z);
return bignorm(z);
}
-/*
- * call-seq:
- * big.divmod(numeric) => array
- *
- * See <code>Numeric#divmod</code>.
- *
- */
-VALUE
-rb_big_divmod(VALUE x, VALUE y)
-{
- VALUE div, mod;
-
- switch (TYPE(y)) {
- case T_FIXNUM:
- y = rb_int2big(FIX2LONG(y));
- break;
-
- case T_BIGNUM:
- break;
-
- default:
- return rb_num_coerce_bin(x, y, rb_intern("divmod"));
- }
- bigdivmod(x, y, &div, &mod);
-
- return rb_assoc_new(bignorm(div), bignorm(mod));
-}
-
static int
bdigbitsize(BDIGIT x)
{
@@ -2392,120 +1603,165 @@ bdigbitsize(BDIGIT x)
return size;
}
-static VALUE big_lshift(VALUE, unsigned long);
-static VALUE big_rshift(VALUE, unsigned long);
+static VALUE big_lshift _((VALUE, unsigned long));
+static VALUE big_rshift _((VALUE, unsigned long));
-static VALUE
-big_shift(VALUE x, long n)
+static VALUE big_shift(x, n)
+ VALUE x;
+ int n;
{
if (n < 0)
- return big_lshift(x, (unsigned long)-n);
+ return big_lshift(x, (unsigned int)n);
else if (n > 0)
- return big_rshift(x, (unsigned long)n);
+ return big_rshift(x, (unsigned int)n);
return x;
}
-static VALUE
-big_fdiv(VALUE x, VALUE y)
+/*
+ * call-seq:
+ * big.divmod(numeric) => array
+ *
+ * See <code>Numeric#divmod</code>.
+ *
+ */
+VALUE
+rb_big_divmod(x, y)
+ VALUE x, y;
{
-#define DBL_BIGDIG ((DBL_MANT_DIG + BITSPERDIG) / BITSPERDIG)
- VALUE z;
- long l, ex, ey;
- int i;
-
- bigtrunc(x);
- l = RBIGNUM_LEN(x) - 1;
- ex = l * BITSPERDIG;
- ex += bdigbitsize(BDIGITS(x)[l]);
- ex -= 2 * DBL_BIGDIG * BITSPERDIG;
- if (ex) x = big_shift(x, ex);
+ VALUE div, mod;
switch (TYPE(y)) {
case T_FIXNUM:
y = rb_int2big(FIX2LONG(y));
- case T_BIGNUM: {
- bigtrunc(y);
- l = RBIGNUM_LEN(y) - 1;
- ey = l * BITSPERDIG;
- ey += bdigbitsize(BDIGITS(y)[l]);
- ey -= DBL_BIGDIG * BITSPERDIG;
- if (ey) y = big_shift(y, ey);
- bignum:
- bigdivrem(x, y, &z, 0);
- l = ex - ey;
-#if SIZEOF_LONG > SIZEOF_INT
- {
- /* Visual C++ can't be here */
- if (l > INT_MAX) return DBL2NUM(ruby_div0(1.0));
- if (l < INT_MIN) return DBL2NUM(0.0);
- }
-#endif
- return DBL2NUM(ldexp(big2dbl(z), (int)l));
- }
- case T_FLOAT:
- y = dbl2big(ldexp(frexp(RFLOAT_VALUE(y), &i), DBL_MANT_DIG));
- ey = i - DBL_MANT_DIG;
- goto bignum;
+ break;
+
+ case T_BIGNUM:
+ break;
+
+ default:
+ return rb_num_coerce_bin(x, y);
}
- rb_bug("big_fdiv");
- /* NOTREACHED */
+ bigdivmod(x, y, &div, &mod);
+
+ return rb_assoc_new(bignorm(div), bignorm(mod));
}
/*
* call-seq:
- * big.fdiv(numeric) -> float
+ * big.quo(numeric) -> float
+ * 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
+ * -1234567890987654321.quo(13731) #=> -89910996357705.5
+ * -1234567890987654321.quo(13731.24) #=> -89909424858035.7
*
*/
-
-VALUE
-rb_big_fdiv(VALUE x, VALUE y)
+static VALUE
+rb_big_quo(x, y)
+ VALUE x, y;
{
- double dx, dy;
+ double dx = big2dbl(x);
+ double dy;
- dx = big2dbl(x);
+ if (isinf(dx)) {
+#define DBL_BIGDIG ((DBL_MANT_DIG + BITSPERDIG) / BITSPERDIG)
+ VALUE z;
+ int ex, ey;
+
+ ex = (RBIGNUM(bigtrunc(x))->len - 1) * BITSPERDIG;
+ ex += bdigbitsize(BDIGITS(x)[RBIGNUM(x)->len - 1]);
+ ex -= 2 * DBL_BIGDIG * BITSPERDIG;
+ if (ex) x = big_shift(x, ex);
+
+ switch (TYPE(y)) {
+ case T_FIXNUM:
+ y = rb_int2big(FIX2LONG(y));
+ case T_BIGNUM: {
+ ey = (RBIGNUM(bigtrunc(y))->len - 1) * BITSPERDIG;
+ ey += bdigbitsize(BDIGITS(y)[RBIGNUM(y)->len - 1]);
+ ey -= DBL_BIGDIG * BITSPERDIG;
+ if (ey) y = big_shift(y, ey);
+ bignum:
+ bigdivrem(x, y, &z, 0);
+ return rb_float_new(ldexp(big2dbl(z), ex - ey));
+ }
+ case T_FLOAT:
+ y = dbl2big(ldexp(frexp(RFLOAT(y)->value, &ey), DBL_MANT_DIG));
+ ey -= DBL_MANT_DIG;
+ goto bignum;
+ }
+ }
switch (TYPE(y)) {
case T_FIXNUM:
dy = (double)FIX2LONG(y);
- if (isinf(dx))
- return big_fdiv(x, y);
break;
case T_BIGNUM:
dy = rb_big2dbl(y);
- if (isinf(dx) || isinf(dy))
- return big_fdiv(x, y);
break;
case T_FLOAT:
- dy = RFLOAT_VALUE(y);
- if (isnan(dy))
- return y;
- if (isinf(dx))
- return big_fdiv(x, y);
+ dy = RFLOAT(y)->value;
break;
default:
- return rb_num_coerce_bin(x, y, rb_intern("fdiv"));
+ return rb_num_coerce_bin(x, y);
}
- return DBL2NUM(dx / dy);
+ return rb_float_new(dx / dy);
}
static VALUE
-bigsqr(VALUE x)
+bigsqr(x)
+ VALUE x;
{
- return bigtrunc(bigmul0(x, x));
+ long len = RBIGNUM(x)->len, k = len / 2, i;
+ VALUE a, b, a2, z;
+ BDIGIT_DBL num;
+
+ if (len < 4000 / BITSPERDIG) {
+ return rb_big_mul0(x, x);
+ }
+
+ a = bignew(len - k, 1);
+ MEMCPY(BDIGITS(a), BDIGITS(x) + k, BDIGIT, len - k);
+ b = bignew(k, 1);
+ MEMCPY(BDIGITS(b), BDIGITS(x), BDIGIT, k);
+
+ a2 = bigtrunc(bigsqr(a));
+ z = bigsqr(b);
+ REALLOC_N(RBIGNUM(z)->digits, BDIGIT, (len = 2 * k + RBIGNUM(a2)->len) + 1);
+ while (RBIGNUM(z)->len < 2 * k) BDIGITS(z)[RBIGNUM(z)->len++] = 0;
+ MEMCPY(BDIGITS(z) + 2 * k, BDIGITS(a2), BDIGIT, RBIGNUM(a2)->len);
+ RBIGNUM(z)->len = len;
+ a2 = bigtrunc(rb_big_mul0(a, b));
+ len = RBIGNUM(a2)->len;
+ TRAP_BEG;
+ for (i = 0, num = 0; i < len; i++) {
+ num += (BDIGIT_DBL)BDIGITS(z)[i + k] + ((BDIGIT_DBL)BDIGITS(a2)[i] << 1);
+ BDIGITS(z)[i + k] = BIGLO(num);
+ num = BIGDN(num);
+ }
+ TRAP_END;
+ if (num) {
+ len = RBIGNUM(z)->len;
+ for (i += k; i < len && num; ++i) {
+ num += (BDIGIT_DBL)BDIGITS(z)[i];
+ BDIGITS(z)[i] = BIGLO(num);
+ num = BIGDN(num);
+ }
+ if (num) {
+ BDIGITS(z)[RBIGNUM(z)->len++] = BIGLO(num);
+ }
+ }
+ return bigtrunc(z);
}
/*
* call-seq:
- * big ** exponent => numeric
+ * 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
@@ -2517,15 +1773,16 @@ bigsqr(VALUE x)
*/
VALUE
-rb_big_pow(VALUE x, VALUE y)
+rb_big_pow(x, y)
+ VALUE x, y;
{
double d;
- SIGNED_VALUE yy;
+ long yy;
if (y == INT2FIX(0)) return INT2FIX(1);
switch (TYPE(y)) {
case T_FLOAT:
- d = RFLOAT_VALUE(y);
+ d = RFLOAT(y)->value;
break;
case T_BIGNUM:
@@ -2535,91 +1792,32 @@ rb_big_pow(VALUE x, VALUE y)
case T_FIXNUM:
yy = FIX2LONG(y);
-
- if (yy < 0)
- return rb_funcall(rb_rational_raw1(x), rb_intern("**"), 1, y);
- else {
+ if (yy > 0) {
VALUE z = 0;
- SIGNED_VALUE mask;
+ long mask;
const long BIGLEN_LIMIT = 1024*1024 / SIZEOF_BDIGITS;
- if ((RBIGNUM_LEN(x) > BIGLEN_LIMIT) ||
- (RBIGNUM_LEN(x) > BIGLEN_LIMIT / yy)) {
+ if ((RBIGNUM(x)->len > BIGLEN_LIMIT) ||
+ (RBIGNUM(x)->len > BIGLEN_LIMIT / yy)) {
rb_warn("in a**b, b may be too big");
d = (double)yy;
break;
}
for (mask = FIXNUM_MAX + 1; mask; mask >>= 1) {
- if (z) z = bigsqr(z);
+ if (z) z = bigtrunc(bigsqr(z));
if (yy & mask) {
- z = z ? bigtrunc(bigmul0(z, x)) : x;
+ z = z ? bigtrunc(rb_big_mul0(z, x)) : x;
}
}
return bignorm(z);
}
- /* NOTREACHED */
+ d = (double)yy;
break;
default:
- return rb_num_coerce_bin(x, y, rb_intern("**"));
+ return rb_num_coerce_bin(x, y);
}
- return DBL2NUM(pow(rb_big2dbl(x), d));
-}
-
-static inline VALUE
-bit_coerce(VALUE x)
-{
- while (!FIXNUM_P(x) && TYPE(x) != T_BIGNUM) {
- if (TYPE(x) == T_FLOAT) {
- rb_raise(rb_eTypeError, "can't convert Float into Integer");
- }
- x = rb_to_int(x);
- }
- return x;
-}
-
-static VALUE
-bigand_int(VALUE x, long y)
-{
- VALUE z;
- BDIGIT *xds, *zds;
- long xn, zn;
- long i;
- char sign;
-
- if (y == 0) return INT2FIX(0);
- sign = (y > 0);
- xds = BDIGITS(x);
- zn = xn = RBIGNUM_LEN(x);
-#if SIZEOF_BDIGITS == SIZEOF_LONG
- if (sign) {
- y &= xds[0];
- return LONG2NUM(y);
- }
-#endif
-
- z = bignew(zn, RBIGNUM_SIGN(x) || sign);
- zds = BDIGITS(z);
-
-#if SIZEOF_BDIGITS == SIZEOF_LONG
- i = 1;
- zds[0] = xds[0] & y;
-#else
- {
- BDIGIT_DBL num = y;
-
- for (i=0; i<(int)(sizeof(y)/sizeof(BDIGIT)); i++) {
- zds[i] = xds[i] & BIGLO(num);
- num = BIGDN(num);
- }
- }
-#endif
- while (i < xn) {
- zds[i] = sign?0:xds[i];
- i++;
- }
- if (!RBIGNUM_SIGN(z)) get2comp(z);
- return bignorm(z);
+ return rb_float_new(pow(rb_big2dbl(x), d));
}
/*
@@ -2630,7 +1828,8 @@ bigand_int(VALUE x, long y)
*/
VALUE
-rb_big_and(VALUE xx, VALUE yy)
+rb_big_and(xx, yy)
+ VALUE xx, yy;
{
volatile VALUE x, y, z;
BDIGIT *ds1, *ds2, *zds;
@@ -2638,33 +1837,33 @@ rb_big_and(VALUE xx, VALUE yy)
char sign;
x = xx;
- y = bit_coerce(yy);
- if (!RBIGNUM_SIGN(x)) {
- x = rb_big_clone(x);
- get2comp(x);
- }
+ y = rb_to_int(yy);
if (FIXNUM_P(y)) {
- return bigand_int(x, FIX2LONG(y));
+ y = rb_int2big(FIX2LONG(y));
}
- if (!RBIGNUM_SIGN(y)) {
+ if (!RBIGNUM(y)->sign) {
y = rb_big_clone(y);
get2comp(y);
}
- if (RBIGNUM_LEN(x) > RBIGNUM_LEN(y)) {
- l1 = RBIGNUM_LEN(y);
- l2 = RBIGNUM_LEN(x);
+ if (!RBIGNUM(x)->sign) {
+ x = rb_big_clone(x);
+ get2comp(x);
+ }
+ if (RBIGNUM(x)->len > RBIGNUM(y)->len) {
+ l1 = RBIGNUM(y)->len;
+ l2 = RBIGNUM(x)->len;
ds1 = BDIGITS(y);
ds2 = BDIGITS(x);
- sign = RBIGNUM_SIGN(y);
+ sign = RBIGNUM(y)->sign;
}
else {
- l1 = RBIGNUM_LEN(x);
- l2 = RBIGNUM_LEN(y);
+ l1 = RBIGNUM(x)->len;
+ l2 = RBIGNUM(y)->len;
ds1 = BDIGITS(x);
ds2 = BDIGITS(y);
- sign = RBIGNUM_SIGN(x);
+ sign = RBIGNUM(x)->sign;
}
- z = bignew(l2, RBIGNUM_SIGN(x) || RBIGNUM_SIGN(y));
+ z = bignew(l2, RBIGNUM(x)->sign || RBIGNUM(y)->sign);
zds = BDIGITS(z);
for (i=0; i<l1; i++) {
@@ -2673,43 +1872,7 @@ rb_big_and(VALUE xx, VALUE yy)
for (; i<l2; i++) {
zds[i] = sign?0:ds2[i];
}
- if (!RBIGNUM_SIGN(z)) get2comp(z);
- return bignorm(z);
-}
-
-static VALUE
-bigor_int(VALUE x, long y)
-{
- VALUE z;
- BDIGIT *xds, *zds;
- long xn, zn;
- long i;
- char sign;
-
- sign = (y >= 0);
- xds = BDIGITS(x);
- zn = xn = RBIGNUM_LEN(x);
- z = bignew(zn, RBIGNUM_SIGN(x) && sign);
- zds = BDIGITS(z);
-
-#if SIZEOF_BDIGITS == SIZEOF_LONG
- i = 1;
- zds[0] = xds[0] | y;
-#else
- {
- BDIGIT_DBL num = y;
-
- for (i=0; i<(int)(sizeof(y)/sizeof(BDIGIT)); i++) {
- zds[i] = xds[i] | BIGLO(num);
- num = BIGDN(num);
- }
- }
-#endif
- while (i < xn) {
- zds[i] = sign?xds[i]:(BDIGIT)(BIGRAD-1);
- i++;
- }
- if (!RBIGNUM_SIGN(z)) get2comp(z);
+ if (!RBIGNUM(z)->sign) get2comp(z);
return bignorm(z);
}
@@ -2721,7 +1884,8 @@ bigor_int(VALUE x, long y)
*/
VALUE
-rb_big_or(VALUE xx, VALUE yy)
+rb_big_or(xx, yy)
+ VALUE xx, yy;
{
volatile VALUE x, y, z;
BDIGIT *ds1, *ds2, *zds;
@@ -2729,81 +1893,46 @@ rb_big_or(VALUE xx, VALUE yy)
char sign;
x = xx;
- y = bit_coerce(yy);
-
- if (!RBIGNUM_SIGN(x)) {
- x = rb_big_clone(x);
- get2comp(x);
- }
+ y = rb_to_int(yy);
if (FIXNUM_P(y)) {
- return bigor_int(x, FIX2LONG(y));
+ y = rb_int2big(FIX2LONG(y));
}
- if (!RBIGNUM_SIGN(y)) {
+ if (!RBIGNUM(y)->sign) {
y = rb_big_clone(y);
get2comp(y);
}
- if (RBIGNUM_LEN(x) > RBIGNUM_LEN(y)) {
- l1 = RBIGNUM_LEN(y);
- l2 = RBIGNUM_LEN(x);
+ if (!RBIGNUM(x)->sign) {
+ x = rb_big_clone(x);
+ get2comp(x);
+ }
+ if (RBIGNUM(x)->len > RBIGNUM(y)->len) {
+ l1 = RBIGNUM(y)->len;
+ l2 = RBIGNUM(x)->len;
ds1 = BDIGITS(y);
ds2 = BDIGITS(x);
- sign = RBIGNUM_SIGN(y);
+ sign = RBIGNUM(y)->sign;
}
else {
- l1 = RBIGNUM_LEN(x);
- l2 = RBIGNUM_LEN(y);
+ l1 = RBIGNUM(x)->len;
+ l2 = RBIGNUM(y)->len;
ds1 = BDIGITS(x);
ds2 = BDIGITS(y);
- sign = RBIGNUM_SIGN(x);
+ sign = RBIGNUM(x)->sign;
}
- z = bignew(l2, RBIGNUM_SIGN(x) && RBIGNUM_SIGN(y));
+ z = bignew(l2, RBIGNUM(x)->sign && RBIGNUM(y)->sign);
zds = BDIGITS(z);
for (i=0; i<l1; i++) {
zds[i] = ds1[i] | ds2[i];
}
for (; i<l2; i++) {
- zds[i] = sign?ds2[i]:(BDIGIT)(BIGRAD-1);
+ zds[i] = sign?ds2[i]:(BIGRAD-1);
}
- if (!RBIGNUM_SIGN(z)) get2comp(z);
- return bignorm(z);
-}
+ if (!RBIGNUM(z)->sign) get2comp(z);
-static VALUE
-bigxor_int(VALUE x, long y)
-{
- VALUE z;
- BDIGIT *xds, *zds;
- long xn, zn;
- long i;
- char sign;
-
- sign = (y >= 0) ? 1 : 0;
- xds = BDIGITS(x);
- zn = xn = RBIGNUM_LEN(x);
- z = bignew(zn, !(RBIGNUM_SIGN(x) ^ sign));
- zds = BDIGITS(z);
-
-#if SIZEOF_BDIGITS == SIZEOF_LONG
- i = 1;
- zds[0] = xds[0] ^ y;
-#else
- {
- BDIGIT_DBL num = y;
-
- for (i=0; i<(int)(sizeof(y)/sizeof(BDIGIT)); i++) {
- zds[i] = xds[i] ^ BIGLO(num);
- num = BIGDN(num);
- }
- }
-#endif
- while (i < xn) {
- zds[i] = sign?xds[i]:~xds[i];
- i++;
- }
- if (!RBIGNUM_SIGN(z)) get2comp(z);
return bignorm(z);
}
+
/*
* call-seq:
* big ^ numeric => integer
@@ -2812,7 +1941,8 @@ bigxor_int(VALUE x, long y)
*/
VALUE
-rb_big_xor(VALUE xx, VALUE yy)
+rb_big_xor(xx, yy)
+ VALUE xx, yy;
{
volatile VALUE x, y;
VALUE z;
@@ -2821,36 +1951,35 @@ rb_big_xor(VALUE xx, VALUE yy)
char sign;
x = xx;
- y = bit_coerce(yy);
-
- if (!RBIGNUM_SIGN(x)) {
- x = rb_big_clone(x);
- get2comp(x);
- }
+ y = rb_to_int(yy);
if (FIXNUM_P(y)) {
- return bigxor_int(x, FIX2LONG(y));
+ y = rb_int2big(FIX2LONG(y));
}
- if (!RBIGNUM_SIGN(y)) {
+ if (!RBIGNUM(y)->sign) {
y = rb_big_clone(y);
get2comp(y);
}
- if (RBIGNUM_LEN(x) > RBIGNUM_LEN(y)) {
- l1 = RBIGNUM_LEN(y);
- l2 = RBIGNUM_LEN(x);
+ if (!RBIGNUM(x)->sign) {
+ x = rb_big_clone(x);
+ get2comp(x);
+ }
+ if (RBIGNUM(x)->len > RBIGNUM(y)->len) {
+ l1 = RBIGNUM(y)->len;
+ l2 = RBIGNUM(x)->len;
ds1 = BDIGITS(y);
ds2 = BDIGITS(x);
- sign = RBIGNUM_SIGN(y);
+ sign = RBIGNUM(y)->sign;
}
else {
- l1 = RBIGNUM_LEN(x);
- l2 = RBIGNUM_LEN(y);
+ l1 = RBIGNUM(x)->len;
+ l2 = RBIGNUM(y)->len;
ds1 = BDIGITS(x);
ds2 = BDIGITS(y);
- sign = RBIGNUM_SIGN(x);
+ sign = RBIGNUM(x)->sign;
}
- RBIGNUM_SET_SIGN(x, RBIGNUM_SIGN(x)?1:0);
- RBIGNUM_SET_SIGN(y, RBIGNUM_SIGN(y)?1:0);
- z = bignew(l2, !(RBIGNUM_SIGN(x) ^ RBIGNUM_SIGN(y)));
+ RBIGNUM(x)->sign = RBIGNUM(x)->sign?1:0;
+ RBIGNUM(y)->sign = RBIGNUM(y)->sign?1:0;
+ z = bignew(l2, !(RBIGNUM(x)->sign ^ RBIGNUM(y)->sign));
zds = BDIGITS(z);
for (i=0; i<l1; i++) {
@@ -2859,7 +1988,7 @@ rb_big_xor(VALUE xx, VALUE yy)
for (; i<l2; i++) {
zds[i] = sign?ds2[i]:~ds2[i];
}
- if (!RBIGNUM_SIGN(z)) get2comp(z);
+ if (!RBIGNUM(z)->sign) get2comp(z);
return bignorm(z);
}
@@ -2867,9 +1996,9 @@ rb_big_xor(VALUE xx, VALUE yy)
static VALUE
check_shiftdown(VALUE y, VALUE x)
{
- if (!RBIGNUM_LEN(x)) return INT2FIX(0);
- if (RBIGNUM_LEN(y) > SIZEOF_LONG / SIZEOF_BDIGITS) {
- return RBIGNUM_SIGN(x) ? INT2FIX(0) : INT2FIX(-1);
+ if (!RBIGNUM(x)->len) return INT2FIX(0);
+ if (RBIGNUM(y)->len > SIZEOF_LONG / SIZEOF_BDIGITS) {
+ return RBIGNUM(x)->sign ? INT2FIX(0) : INT2FIX(-1);
}
return Qnil;
}
@@ -2882,7 +2011,8 @@ check_shiftdown(VALUE y, VALUE x)
*/
VALUE
-rb_big_lshift(VALUE x, VALUE y)
+rb_big_lshift(x, y)
+ VALUE x, y;
{
long shift;
int neg = 0;
@@ -2897,33 +2027,35 @@ rb_big_lshift(VALUE x, VALUE y)
break;
}
else if (TYPE(y) == T_BIGNUM) {
- if (!RBIGNUM_SIGN(y)) {
+ if (!RBIGNUM(y)->sign) {
VALUE t = check_shiftdown(y, x);
if (!NIL_P(t)) return t;
neg = 1;
}
- shift = big2ulong(y, "long", Qtrue);
+ shift = big2ulong(y, "long");
break;
}
y = rb_to_int(y);
}
- x = neg ? big_rshift(x, shift) : big_lshift(x, shift);
- return bignorm(x);
+ if (neg) return big_rshift(x, shift);
+ return big_lshift(x, shift);
}
static VALUE
-big_lshift(VALUE x, unsigned long shift)
+big_lshift(x, shift)
+ VALUE x;
+ unsigned long shift;
{
BDIGIT *xds, *zds;
long s1 = shift/BITSPERDIG;
- int s2 = (int)(shift%BITSPERDIG);
+ int s2 = shift%BITSPERDIG;
VALUE z;
BDIGIT_DBL num = 0;
long len, i;
- len = RBIGNUM_LEN(x);
- z = bignew(len+s1+1, RBIGNUM_SIGN(x));
+ len = RBIGNUM(x)->len;
+ z = bignew(len+s1+1, RBIGNUM(x)->sign);
zds = BDIGITS(z);
for (i=0; i<s1; i++) {
*zds++ = 0;
@@ -2935,7 +2067,7 @@ big_lshift(VALUE x, unsigned long shift)
num = BIGDN(num);
}
*zds = BIGLO(num);
- return z;
+ return bignorm(z);
}
/*
@@ -2946,7 +2078,8 @@ big_lshift(VALUE x, unsigned long shift)
*/
VALUE
-rb_big_rshift(VALUE x, VALUE y)
+rb_big_rshift(x, y)
+ VALUE x, y;
{
long shift;
int neg = 0;
@@ -2961,52 +2094,54 @@ rb_big_rshift(VALUE x, VALUE y)
break;
}
else if (TYPE(y) == T_BIGNUM) {
- if (RBIGNUM_SIGN(y)) {
+ if (RBIGNUM(y)->sign) {
VALUE t = check_shiftdown(y, x);
if (!NIL_P(t)) return t;
}
else {
neg = 1;
}
- shift = big2ulong(y, "long", Qtrue);
+ shift = big2ulong(y, "long");
break;
}
y = rb_to_int(y);
}
- x = neg ? big_lshift(x, shift) : big_rshift(x, shift);
- return bignorm(x);
+ if (neg) return big_lshift(x, shift);
+ return big_rshift(x, shift);
}
static VALUE
-big_rshift(VALUE x, unsigned long shift)
+big_rshift(x, shift)
+ VALUE x;
+ unsigned long shift;
{
BDIGIT *xds, *zds;
long s1 = shift/BITSPERDIG;
- int s2 = (int)(shift%BITSPERDIG);
+ int s2 = shift%BITSPERDIG;
VALUE z;
BDIGIT_DBL num = 0;
long i, j;
volatile VALUE save_x;
- if (s1 > RBIGNUM_LEN(x)) {
- if (RBIGNUM_SIGN(x))
+ if (s1 > RBIGNUM(x)->len) {
+ if (RBIGNUM(x)->sign)
return INT2FIX(0);
else
return INT2FIX(-1);
}
- if (!RBIGNUM_SIGN(x)) {
+ if (!RBIGNUM(x)->sign) {
save_x = x = rb_big_clone(x);
get2comp(x);
}
xds = BDIGITS(x);
- i = RBIGNUM_LEN(x); j = i - s1;
+ i = RBIGNUM(x)->len; j = i - s1;
if (j == 0) {
- if (RBIGNUM_SIGN(x)) return INT2FIX(0);
+ if (RBIGNUM(x)->sign) return INT2FIX(0);
else return INT2FIX(-1);
}
- z = bignew(j, RBIGNUM_SIGN(x));
- if (!RBIGNUM_SIGN(x)) {
+ z = bignew(j, RBIGNUM(x)->sign);
+ if (!RBIGNUM(x)->sign) {
num = ((BDIGIT_DBL)~0) << BITSPERDIG;
}
zds = BDIGITS(z);
@@ -3015,10 +2150,10 @@ big_rshift(VALUE x, unsigned long shift)
zds[j] = BIGLO(num);
num = BIGUP(xds[i]);
}
- if (!RBIGNUM_SIGN(x)) {
+ if (!RBIGNUM(x)->sign) {
get2comp(z);
}
- return z;
+ return bignorm(z);
}
/*
@@ -3041,22 +2176,22 @@ big_rshift(VALUE x, unsigned long shift)
*/
static VALUE
-rb_big_aref(VALUE x, VALUE y)
+rb_big_aref(x, y)
+ VALUE x, y;
{
BDIGIT *xds;
BDIGIT_DBL num;
- VALUE shift;
+ unsigned long shift;
long i, s1, s2;
if (TYPE(y) == T_BIGNUM) {
- if (!RBIGNUM_SIGN(y))
+ if (!RBIGNUM(y)->sign)
return INT2FIX(0);
- bigtrunc(y);
- if (RBIGNUM_LEN(y) > DIGSPERLONG) {
+ if (RBIGNUM(bigtrunc(y))->len > SIZEOF_LONG/SIZEOF_BDIGITS) {
out_of_range:
- return RBIGNUM_SIGN(x) ? INT2FIX(0) : INT2FIX(1);
+ return RBIGNUM(x)->sign ? INT2FIX(0) : INT2FIX(1);
}
- shift = big2ulong(y, "long", Qfalse);
+ shift = big2ulong(y, "long");
}
else {
i = NUM2LONG(y);
@@ -3066,8 +2201,8 @@ rb_big_aref(VALUE x, VALUE y)
s1 = shift/BITSPERDIG;
s2 = shift%BITSPERDIG;
- if (s1 >= RBIGNUM_LEN(x)) goto out_of_range;
- if (!RBIGNUM_SIGN(x)) {
+ if (s1 >= RBIGNUM(x)->len) goto out_of_range;
+ if (!RBIGNUM(x)->sign) {
xds = BDIGITS(x);
i = 0; num = 1;
while (num += ~xds[i], ++i <= s1) {
@@ -3090,12 +2225,17 @@ rb_big_aref(VALUE x, VALUE y)
*/
static VALUE
-rb_big_hash(VALUE x)
+rb_big_hash(x)
+ VALUE x;
{
- int hash;
+ long i, len, key;
+ BDIGIT *digits;
- hash = rb_memhash(BDIGITS(x), sizeof(BDIGIT)*RBIGNUM_LEN(x)) ^ RBIGNUM_SIGN(x);
- return INT2FIX(hash);
+ key = 0; digits = BDIGITS(x); len = RBIGNUM(x)->len;
+ for (i=0; i<len; i++) {
+ key ^= *digits++;
+ }
+ return LONG2FIX(key);
}
/*
@@ -3103,7 +2243,8 @@ rb_big_hash(VALUE x)
*/
static VALUE
-rb_big_coerce(VALUE x, VALUE y)
+rb_big_coerce(x, y)
+ VALUE x, y;
{
if (FIXNUM_P(y)) {
return rb_assoc_new(rb_int2big(FIX2LONG(y)), x);
@@ -3129,15 +2270,37 @@ rb_big_coerce(VALUE x, VALUE y)
*/
static VALUE
-rb_big_abs(VALUE x)
+rb_big_abs(x)
+ VALUE x;
{
- if (!RBIGNUM_SIGN(x)) {
+ if (!RBIGNUM(x)->sign) {
x = rb_big_clone(x);
- RBIGNUM_SET_SIGN(x, 1);
+ RBIGNUM(x)->sign = 1;
}
return x;
}
+VALUE
+rb_big_rand(max, rand_buf)
+ VALUE max;
+ double *rand_buf;
+{
+ VALUE v;
+ long len = RBIGNUM(max)->len;
+
+ if (BIGZEROP(max)) {
+ return rb_float_new(rand_buf[0]);
+ }
+ v = bignew(len,1);
+ len--;
+ BDIGITS(v)[len] = BDIGITS(max)[len] * rand_buf[len];
+ while (len--) {
+ BDIGITS(v)[len] = ((BDIGIT)~0) * rand_buf[len];
+ }
+
+ return v;
+}
+
/*
* call-seq:
* big.size -> integer
@@ -3151,41 +2314,10 @@ rb_big_abs(VALUE x)
*/
static VALUE
-rb_big_size(VALUE big)
-{
- return LONG2FIX(RBIGNUM_LEN(big)*SIZEOF_BDIGITS);
-}
-
-/*
- * 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 (BDIGITS(num)[0] & 1) {
- return Qtrue;
- }
- return Qfalse;
-}
-
-/*
- * call-seq:
- * big.even? -> true or false
- *
- * Returns <code>true</code> if <i>big</i> is an even number.
- */
-
-static VALUE
-rb_big_even_p(VALUE num)
+rb_big_size(big)
+ VALUE big;
{
- if (BDIGITS(num)[0] & 1) {
- return Qfalse;
- }
- return Qtrue;
+ return LONG2FIX(RBIGNUM(big)->len*SIZEOF_BDIGITS);
}
/*
@@ -3207,7 +2339,7 @@ rb_big_even_p(VALUE num)
*/
void
-Init_Bignum(void)
+Init_Bignum()
{
rb_cBignum = rb_define_class("Bignum", rb_cInteger);
@@ -3219,11 +2351,12 @@ Init_Bignum(void)
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, "div", rb_big_div, 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, "quo", rb_big_quo, 1);
+ rb_define_method(rb_cBignum, "fdiv", rb_big_quo, 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);
@@ -3239,10 +2372,5 @@ Init_Bignum(void)
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, "odd?", rb_big_odd_p, 0);
- rb_define_method(rb_cBignum, "even?", rb_big_even_p, 0);
-
- power_cache_init();
}
diff --git a/bin/erb b/bin/erb
index 6db3d0b6ed..a6fcd5370c 100755
--- a/bin/erb
+++ b/bin/erb
@@ -12,17 +12,9 @@ class ERB
arg = self.shift
return nil if arg == '--'
if arg =~ /^-(.)(.*)/
- if $1 == '-'
- arg, @maybe_arg = arg.split(/=/, 2)
- return arg
- end
- raise 'unknown switch "-"' if $2[0] == ?- and $1 != 'T'
- if $2.size > 0
- self.unshift "-#{$2}"
- @maybe_arg = $2
- else
- @maybe_arg = nil
- end
+ return arg if $1 == '-'
+ raise 'unknown switch "-"' if $2.index('-')
+ self.unshift "-#{$2}" if $2.size > 0
"-#{$1}"
else
self.unshift arg
@@ -31,9 +23,7 @@ class ERB
end
def ARGV.req_arg
- (@maybe_arg || self.shift || raise('missing argument')).tap {
- @maybe_arg = nil
- }
+ self.shift || raise('missing argument')
end
def trim_mode_opt(trim_mode, disable_percent)
@@ -82,11 +72,20 @@ class ERB
end
raise "invalid trim mode #{arg.dump}" unless arg =~ /^[0-2]$/
trim_mode = arg.to_i
- when '-E', '--encoding'
+ when '-K' # KCODE
arg = ARGV.req_arg
- set_encoding(*arg.split(/:/, 2))
- when '-U'
- set_encoding(Encoding::UTF_8, Encoding::UTF_8)
+ case arg.downcase
+ when 'e', '-e', 'euc'
+ $KCODE = 'EUC'
+ when 's', '-s', 'sjis'
+ $KCODE = 'SJIS'
+ when 'u', '-u', 'utf8'
+ $KCODE = 'UTF8'
+ when 'n', '-n', 'none'
+ $KCODE = 'NONE'
+ else
+ raise "invalid KCODE #{arg.dump}"
+ end
when '-P'
disable_percent = true
when '--help'
@@ -104,17 +103,15 @@ class ERB
-n print ruby script with line number
-v enable verbose mode
-d set $DEBUG to true
- -r library load a library
- -S safe_level set $SAFE (0..4)
- -E ex[:in] set default external/internal encodings
- -U set default encoding to UTF-8.
- -T trim_mode specify trim_mode (0..2, -)
+ -r [library] load a library
+ -K [kcode] specify KANJI code-set
+ -S [safe_level] set $SAFE (0..4)
+ -T [trim_mode] specify trim_mode (0..2, -)
-P ignore lines which start with "%"
EOU
exit 1
end
- $<.set_encoding(Encoding::ASCII_8BIT, nil)
src = $<.read
filename = $FILENAME
exit 2 unless src
@@ -123,8 +120,10 @@ EOU
erb.filename = filename
if output
if number
- erb.src.each_line.with_index do |line, l|
- puts "%3d %s"%[l+1, line]
+ l = 1
+ for line in erb.src
+ puts "%3d %s"%[l, line]
+ l += 1
end
else
puts erb.src
@@ -134,19 +133,6 @@ EOU
end
end
module_function :run
-
- def set_encoding(extern, intern = nil)
- verbose, $VERBOSE = $VERBOSE, nil
- Encoding.default_external = extern unless extern.nil? || extern.empty?
- Encoding.default_internal = intern unless intern.nil? || intern.empty?
- [$stdin, $stdout, $stderr].each do |io|
- io.set_encoding(extern, intern)
- end
- ensure
- $VERBOSE = verbose
- end
- module_function :set_encoding
- class << self; private :set_encoding; end
end
end
diff --git a/bin/gem b/bin/gem
deleted file mode 100755
index 14c3d3c480..0000000000
--- a/bin/gem
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
-# All rights reserved.
-# See LICENSE.txt for permissions.
-#++
-
-require 'rubygems'
-require 'rubygems/gem_runner'
-require 'rubygems/exceptions'
-
-required_version = Gem::Requirement.new ">= 1.8.6"
-
-unless required_version.satisfied_by? Gem.ruby_version then
- abort "Expected Ruby Version #{required_version}, is #{Gem.ruby_version}"
-end
-
-args = ARGV.clone
-
-begin
- Gem::GemRunner.new.run args
-rescue Gem::SystemExitException => e
- exit e.exit_code
-end
-
diff --git a/bin/irb b/bin/irb
index 6c8465c802..f277bc4b69 100755..100644
--- a/bin/irb
+++ b/bin/irb
@@ -1,8 +1,9 @@
#!/usr/bin/env ruby
#
-# irb.rb - interactive ruby
-# $Release Version: 0.9.6 $
+# irb.rb - intaractive ruby
+# $Release Version: 0.9.5 $
# $Revision$
+# $Date$
# by Keiju ISHITSUKA(keiju@ruby-lang.org)
#
diff --git a/bin/rake b/bin/rake
deleted file mode 100755
index c9e95da611..0000000000
--- a/bin/rake
+++ /dev/null
@@ -1,31 +0,0 @@
-#!/usr/bin/env ruby
-
-#--
-# Copyright (c) 2003, 2004, 2005, 2006, 2007 Jim Weirich
-#
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documentation files (the "Software"), to
-# deal in the Software without restriction, including without limitation the
-# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-# sell copies of the Software, and to permit persons to whom the Software is
-# furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
-# IN THE SOFTWARE.
-#++
-
-begin
- require 'rake'
-rescue LoadError
- require 'rubygems'
- require 'rake'
-end
-Rake.application.run
diff --git a/bin/rdoc b/bin/rdoc
index e50285478d..fe619137fd 100755..100644
--- a/bin/rdoc
+++ b/bin/rdoc
@@ -8,15 +8,60 @@
#
# $Revision$
+## Transitional Hack ####
+#
+# RDoc was initially distributed independently, and installed
+# itself into <prefix>/lib/ruby/site_ruby/<ver>/rdoc...
+#
+# Now that RDoc is part of the distribution, it's installed into
+# <prefix>/lib/ruby/<ver>, which unfortunately appears later in the
+# search path. This means that if you have previously installed RDoc,
+# and then install from ruby-lang, you'll pick up the old one by
+# default. This hack checks for the condition, and readjusts the
+# search path if necessary.
+
+def adjust_for_existing_rdoc(path)
+
+ $stderr.puts %{
+ It seems as if you have a previously-installed RDoc in
+ the directory #{path}.
+
+ Because this is now out-of-date, you might want to consider
+ removing the directories:
+
+ #{File.join(path, "rdoc")}
+
+ and
+
+ #{File.join(path, "markup")}
+
+ }
+
+ # Move all the site_ruby directories to the end
+ p $:
+ $:.replace($:.partition {|path| /site_ruby/ !~ path}.flatten)
+ p $:
+end
+
+$:.each do |path|
+ if /site_ruby/ =~ path
+ rdoc_path = File.join(path, 'rdoc', 'rdoc.rb')
+ if File.exists?(rdoc_path)
+ adjust_for_existing_rdoc(path)
+ break
+ end
+ end
+end
+
+## End of Transitional Hack ##
+
+
require 'rdoc/rdoc'
begin
r = RDoc::RDoc.new
- r.document ARGV
-rescue Interrupt
- $stderr.puts
- $stderr.puts "Interrupted"
-rescue RDoc::Error => e
+ r.document(ARGV)
+rescue RDoc::RDocError => e
$stderr.puts e.message
- exit 1
+ exit(1)
end
diff --git a/bin/ri b/bin/ri
index 243557403c..fb3e00eda3 100755
--- a/bin/ri
+++ b/bin/ri
@@ -1,5 +1,49 @@
#!/usr/bin/env ruby
+# usage:
+#
+# ri name...
+#
+# where name can be
+#
+# Class | Class::method | Class#method | Class.method | method
+#
+# All names may be abbreviated to their minimum unbiguous form. If a name
+# _is_ ambiguous, all valid options will be listed.
+#
+# The form '.' method matches either class or instance methods, while
+# #method matches only instance and ::method matches only class methods.
+#
+#
+# == Installing Documentation
+#
+# 'ri' uses a database of documentation built by the RDoc utility.
+#
+# So, how do you install this documentation on your system?
+# It depends on how you installed Ruby.
+#
+# <em>If you installed Ruby from source files</em> (that is, if it some point
+# you typed 'make' during the process :), you can install the RDoc
+# documentation yourself. Just go back to the place where you have
+# your Ruby source and type
+#
+# make install-doc
+#
+# You'll probably need to do this as a superuser, as the documentation
+# is installed in the Ruby target tree (normally somewhere under
+# <tt>/usr/local</tt>.
+#
+# <em>If you installed Ruby from a binary distribution</em> (perhaps
+# using a one-click installer, or using some other packaging system),
+# then the team that produced the package probably forgot to package
+# the documentation as well. Contact them, and see if they can add
+# it to the next release.
+#
-require 'rdoc/ri/driver'
-RDoc::RI::Driver.run ARGV
+require 'rdoc/ri/ri_driver'
+
+######################################################################
+
+ri = RiDriver.new
+ri.process_args
+
diff --git a/bin/testrb b/bin/testrb
index e4eb9099b3..ff49cb5466 100755
--- a/bin/testrb
+++ b/bin/testrb
@@ -1,14 +1,5 @@
#!/usr/bin/env ruby
require 'test/unit'
-Test::Unit.setup_argv {|files|
- if files.empty?
- puts "Usage: testrb [options] tests..."
- exit 1
- end
- if files.size == 1
- $0 = File.basename(files[0])
- else
- $0 = files.to_s
- end
- files
-}
+(r = Test::Unit::AutoRunner.new(true)).process_args(ARGV) or
+ abort r.options.banner + " tests..."
+exit r.run
diff --git a/blockinlining.c b/blockinlining.c
deleted file mode 100644
index f9eb8af229..0000000000
--- a/blockinlining.c
+++ /dev/null
@@ -1,464 +0,0 @@
-/**********************************************************************
-
- blockinlining.c -
-
- $Author$
-
- Copyright (C) 2004-2007 Koichi Sasada
-
-**********************************************************************/
-
-#include "ruby/ruby.h"
-#include "vm_core.h"
-
-static VALUE
-iseq_special_block(rb_iseq_t *iseq, void *builder)
-{
-#if OPT_BLOCKINLINING
- VALUE parent = Qfalse;
- VALUE iseqval;
-
- if (iseq->argc > 1 || iseq->arg_simple == 0) {
- /* argument check */
- return 0;
- }
-
- if (iseq->cached_special_block_builder) {
- if (iseq->cached_special_block_builder == builder) {
- return iseq->cached_special_block;
- }
- else {
- return 0;
- }
- }
- else {
- iseq->cached_special_block_builder = (void *)1;
- }
-
- if (iseq->parent_iseq) {
- parent = iseq->parent_iseq->self;
- }
- iseqval = rb_iseq_new_with_bopt(iseq->node, iseq->name, iseq->filename,
- parent, iseq->type,
- GC_GUARDED_PTR(builder));
- if (0) {
- printf("%s\n", RSTRING_PTR(rb_iseq_disasm(iseqval)));
- }
- iseq->cached_special_block = iseqval;
- iseq->cached_special_block_builder = builder;
- return iseqval;
-#else
- return 0;
-#endif
-}
-
-static NODE *
-new_block(NODE * head, NODE * tail)
-{
- head = NEW_BLOCK(head);
- tail = NEW_BLOCK(tail);
- head->nd_next = tail;
- return head;
-}
-
-static NODE *
-new_ary(NODE * head, NODE * tail)
-{
- head = NEW_ARRAY(head);
- head->nd_next = tail;
- return head;
-}
-
-static NODE *
-new_assign(NODE * lnode, NODE * rhs)
-{
- switch (nd_type(lnode)) {
- case NODE_LASGN:{
- return NEW_NODE(NODE_LASGN, lnode->nd_vid, rhs, lnode->nd_cnt);
- /* NEW_LASGN(lnode->nd_vid, rhs); */
- }
- case NODE_GASGN:{
- return NEW_GASGN(lnode->nd_vid, rhs);
- }
- case NODE_DASGN:{
- return NEW_DASGN(lnode->nd_vid, rhs);
- }
- case NODE_ATTRASGN:{
- NODE *args = 0;
- if (lnode->nd_args) {
- args = NEW_ARRAY(lnode->nd_args->nd_head);
- args->nd_next = NEW_ARRAY(rhs);
- args->nd_alen = 2;
- }
- else {
- args = NEW_ARRAY(rhs);
- }
-
- return NEW_ATTRASGN(lnode->nd_recv,
- lnode->nd_mid,
- args);
- }
- default:
- rb_bug("unimplemented (block inlining): %s", ruby_node_name(nd_type(lnode)));
- }
- return 0;
-}
-
-static NODE *
-build_Integer_times_node(rb_iseq_t *iseq, NODE * node, NODE * lnode,
- VALUE param_vars, VALUE local_vars)
-{
- /* Special Block for Integer#times
- {|e, _self|
- _e = e
- while(e < _self)
- e = _e
- redo_point:
- BODY
- next_point:
- _e = _e.succ
- end
- }
-
- {|e, _self|
- while(e < _self)
- BODY
- next_point:
- e = e.succ
- end
- }
- */
- ID _self;
- CONST_ID(_self, "#_self");
- if (iseq->argc == 0) {
- ID e;
- CONST_ID(e, "#e");
- rb_ary_push(param_vars, ID2SYM(e));
- rb_ary_push(param_vars, ID2SYM(_self));
- iseq->argc += 2;
-
- node =
- NEW_WHILE(NEW_CALL
- (NEW_DVAR(e), idLT, new_ary(NEW_DVAR(_self), 0)),
- new_block(NEW_OPTBLOCK(node),
- NEW_DASGN(e,
- NEW_CALL(NEW_DVAR(e), idSucc, 0))),
- Qundef);
- }
- else {
- ID _e;
- ID e = SYM2ID(rb_ary_entry(param_vars, 0));
- NODE *assign;
-
- CONST_ID(_e, "#_e");
- rb_ary_push(param_vars, ID2SYM(_self));
- rb_ary_push(local_vars, ID2SYM(_e));
- iseq->argc++;
-
- if (nd_type(lnode) == NODE_DASGN_CURR) {
- assign = NEW_DASGN(e, NEW_DVAR(_e));
- }
- else {
- assign = new_assign(lnode, NEW_DVAR(_e));
- }
-
- node =
- new_block(NEW_DASGN(_e, NEW_DVAR(e)),
- NEW_WHILE(NEW_CALL
- (NEW_DVAR(_e), idLT,
- new_ary(NEW_DVAR(_self), 0)),
- new_block(assign,
- new_block(NEW_OPTBLOCK(node),
- NEW_DASGN(_e,
- NEW_CALL
- (NEW_DVAR(_e),
- idSucc, 0)))),
- Qundef));
- }
- return node;
-}
-
-VALUE
-invoke_Integer_times_special_block(VALUE num)
-{
- rb_thread_t *th = GET_THREAD();
- rb_block_t *orig_block = GC_GUARDED_PTR_REF(th->cfp->lfp[0]);
-
- if (orig_block && BUILTIN_TYPE(orig_block->iseq) != T_NODE) {
- VALUE tsiseqval = iseq_special_block(orig_block->iseq,
- build_Integer_times_node);
- rb_iseq_t *tsiseq;
- VALUE argv[2], val;
-
- if (tsiseqval) {
- rb_block_t block = *orig_block;
- GetISeqPtr(tsiseqval, tsiseq);
- block.iseq = tsiseq;
- th->cfp->lfp[0] = GC_GUARDED_PTR(&block);
- argv[0] = INT2FIX(0);
- argv[1] = num;
- val = rb_yield_values(2, argv);
- if (val == Qundef) {
- return num;
- }
- else {
- return val;
- }
- }
- }
- return Qundef;
-}
-
-static NODE *
-build_Range_each_node(rb_iseq_t *iseq, NODE * node, NODE * lnode,
- VALUE param_vars, VALUE local_vars, ID mid)
-{
- /* Special Block for Range#each
- {|e, _last|
- _e = e
- while _e < _last
- e = _e
- next_point:
- BODY
- redo_point:
- _e = _e.succ
- end
- }
- {|e, _last|
- while e < _last
- BODY
- redo_point:
- e = e.succ
- end
- }
- */
- ID _last;
- CONST_ID(_last, "#_last");
- if (iseq->argc == 0) {
- ID e;
- CONST_ID(e, "#e");
- rb_ary_push(param_vars, ID2SYM(e));
- rb_ary_push(param_vars, ID2SYM(_last));
- iseq->argc += 2;
-
- node =
- NEW_WHILE(NEW_CALL(NEW_DVAR(e), mid, new_ary(NEW_DVAR(_last), 0)),
- new_block(NEW_OPTBLOCK(node),
- NEW_DASGN(e,
- NEW_CALL(NEW_DVAR(e), idSucc, 0))),
- Qundef);
- }
- else {
- ID _e;
- ID e = SYM2ID(rb_ary_entry(param_vars, 0));
- NODE *assign;
-
- CONST_ID(_e, "#_e");
- rb_ary_push(param_vars, ID2SYM(_last));
- rb_ary_push(local_vars, ID2SYM(_e));
- iseq->argc++;
-
- if (nd_type(lnode) == NODE_DASGN_CURR) {
- assign = NEW_DASGN(e, NEW_DVAR(_e));
- }
- else {
- assign = new_assign(lnode, NEW_DVAR(_e));
- }
-
- node =
- new_block(NEW_DASGN(_e, NEW_DVAR(e)),
- NEW_WHILE(NEW_CALL
- (NEW_DVAR(_e), mid,
- new_ary(NEW_DVAR(_last), 0)),
- new_block(assign,
- new_block(NEW_OPTBLOCK(node),
- NEW_DASGN(_e,
- NEW_CALL
- (NEW_DVAR(_e),
- idSucc, 0)))),
- Qundef));
- }
- return node;
-}
-
-static NODE *
-build_Range_each_node_LE(rb_iseq_t *iseq, NODE * node, NODE * lnode,
- VALUE param_vars, VALUE local_vars)
-{
- return build_Range_each_node(iseq, node, lnode,
- param_vars, local_vars, idLE);
-}
-
-static NODE *
-build_Range_each_node_LT(rb_iseq_t *iseq, NODE * node, NODE * lnode,
- VALUE param_vars, VALUE local_vars)
-{
- return build_Range_each_node(iseq, node, lnode,
- param_vars, local_vars, idLT);
-}
-
-VALUE
-invoke_Range_each_special_block(VALUE range,
- VALUE beg, VALUE end, int excl)
-{
- rb_thread_t *th = GET_THREAD();
- rb_block_t *orig_block = GC_GUARDED_PTR_REF(th->cfp->lfp[0]);
-
- if (BUILTIN_TYPE(orig_block->iseq) != T_NODE) {
- void *builder =
- excl ? build_Range_each_node_LT : build_Range_each_node_LE;
- VALUE tsiseqval = iseq_special_block(orig_block->iseq, builder);
- rb_iseq_t *tsiseq;
- VALUE argv[2];
-
- if (tsiseqval) {
- VALUE val;
- rb_block_t block = *orig_block;
- GetISeqPtr(tsiseqval, tsiseq);
- block.iseq = tsiseq;
- th->cfp->lfp[0] = GC_GUARDED_PTR(&block);
- argv[0] = beg;
- argv[1] = end;
- val = rb_yield_values(2, argv);
- if (val == Qundef) {
- return range;
- }
- else {
- return val;
- }
- }
- }
- return Qundef;
-}
-
-
-static NODE *
-build_Array_each_node(rb_iseq_t *iseq, NODE * node, NODE * lnode,
- VALUE param_vars, VALUE local_vars)
-{
- /* Special block for Array#each
- ary.each{|e|
- BODY
- }
- =>
- {|e, _self|
- _i = 0
- while _i < _self.length
- e = _self[_i]
- redo_point:
- BODY
- next_point:
- _i = _i.succ
- end
- }
-
- ary.each{
- BODY
- }
- =>
- {|_i, _self|
- _i = 0
- while _i < _self.length
- redo_point:
- BODY
- next_point:
- _i = _i.succ
- end
- }
- */
-
- ID _self, _i;
-
- CONST_ID(_self, "#_self");
- CONST_ID(_i, "#_i");
- if (iseq->argc == 0) {
- ID _e;
- CONST_ID(_e, "#_e");
- rb_ary_push(param_vars, ID2SYM(_e));
- rb_ary_push(param_vars, ID2SYM(_self));
- iseq->argc += 2;
- rb_ary_push(local_vars, ID2SYM(_i));
-
- node =
- new_block(NEW_DASGN(_i, NEW_LIT(INT2FIX(0))),
- NEW_WHILE(NEW_CALL(NEW_DVAR(_i), idLT,
- new_ary(NEW_CALL
- (NEW_DVAR(_self), idLength,
- 0), 0)),
- new_block(NEW_OPTBLOCK(node),
- NEW_DASGN(_i,
- NEW_CALL(NEW_DVAR(_i),
- idSucc, 0))),
- Qundef));
- }
- else {
- ID e = SYM2ID(rb_ary_entry(param_vars, 0));
- NODE *assign;
-
- rb_ary_push(param_vars, ID2SYM(_self));
- iseq->argc++;
- rb_ary_push(local_vars, ID2SYM(_i));
-
- if (nd_type(lnode) == NODE_DASGN_CURR) {
- assign = NEW_DASGN(e,
- NEW_CALL(NEW_DVAR(_self), idAREF,
- new_ary(NEW_DVAR(_i), 0)));
- }
- else {
- assign = new_assign(lnode,
- NEW_CALL(NEW_DVAR(_self), idAREF,
- new_ary(NEW_DVAR(_i), 0)));
- }
-
- node =
- new_block(NEW_DASGN(_i, NEW_LIT(INT2FIX(0))),
- NEW_WHILE(NEW_CALL(NEW_DVAR(_i), idLT,
- new_ary(NEW_CALL
- (NEW_DVAR(_self), idLength,
- 0), 0)), new_block(assign,
- new_block
- (NEW_OPTBLOCK
- (node),
- NEW_DASGN
- (_i,
- NEW_CALL
- (NEW_DVAR
- (_i),
- idSucc,
- 0)))),
- Qundef));
- }
- return node;
-}
-
-VALUE
-invoke_Array_each_special_block(VALUE ary)
-{
- rb_thread_t *th = GET_THREAD();
- rb_block_t *orig_block = GC_GUARDED_PTR_REF(th->cfp->lfp[0]);
-
- if (BUILTIN_TYPE(orig_block->iseq) != T_NODE) {
- VALUE tsiseqval = iseq_special_block(orig_block->iseq,
- build_Array_each_node);
- rb_iseq_t *tsiseq;
- VALUE argv[2];
-
- if (tsiseqval) {
- VALUE val;
- rb_block_t block = *orig_block;
- GetISeqPtr(tsiseqval, tsiseq);
- block.iseq = tsiseq;
- th->cfp->lfp[0] = GC_GUARDED_PTR(&block);
- argv[0] = 0;
- argv[1] = ary;
- val = rb_yield_values(2, argv);
- if (val == Qundef) {
- return ary;
- }
- else {
- return val;
- }
- }
- }
- return Qundef;
-}
diff --git a/bootstraptest/pending.rb b/bootstraptest/pending.rb
deleted file mode 100644
index 744c0adac1..0000000000
--- a/bootstraptest/pending.rb
+++ /dev/null
@@ -1,39 +0,0 @@
-assert_equal 'A', %q{
- class A
- @@a = 'A'
- def a=(x)
- @@a = x
- end
- def a
- @@a
- end
- end
-
- B = A.dup
- B.new.a = 'B'
- A.new.a
-}, '[ruby-core:17019]'
-
-assert_equal 'ok', %q{
- def m
- lambda{
- proc{
- return :ng1
- }
- }.call.call
- :ng2
- end
-
- begin
- m()
- rescue LocalJumpError
- :ok
- end
-}
-
-assert_normal_exit %q{
- r = Range.allocate
- def r.<=>(o) true end
- r.instance_eval { initialize r, r }
- r.inspect
-}
diff --git a/bootstraptest/runner.rb b/bootstraptest/runner.rb
deleted file mode 100644
index aff5a54ee7..0000000000
--- a/bootstraptest/runner.rb
+++ /dev/null
@@ -1,363 +0,0 @@
-# $Id$
-
-# NOTE:
-# Never use optparse in this file.
-# Never use test/unit in this file.
-# Never use Ruby extensions in this file.
-
-begin
- require 'fileutils'
- require 'tmpdir'
-rescue LoadError
- $:.unshift File.join(File.dirname(__FILE__), '../lib')
- retry
-end
-
-if !Dir.respond_to?(:mktmpdir)
- # copied from lib/tmpdir.rb
- def Dir.mktmpdir(prefix="d", tmpdir=nil)
- tmpdir ||= Dir.tmpdir
- t = Time.now.strftime("%Y%m%d")
- n = nil
- begin
- path = "#{tmpdir}/#{prefix}#{t}-#{$$}-#{rand(0x100000000).to_s(36)}"
- path << "-#{n}" if n
- Dir.mkdir(path, 0700)
- rescue Errno::EEXIST
- n ||= 0
- n += 1
- retry
- end
-
- if block_given?
- begin
- yield path
- ensure
- FileUtils.remove_entry_secure path
- end
- else
- path
- end
- end
-end
-
-def main
- @ruby = File.expand_path('miniruby')
- @verbose = false
- dir = nil
- quiet = false
- tests = nil
- ARGV.delete_if {|arg|
- case arg
- when /\A--ruby=(.*)/
- @ruby = $1
- @ruby.gsub!(/^([^ ]*)/){File.expand_path($1)}
- @ruby.gsub!(/(\s+-I\s*)((?!(?:\.\/)*-(?:\s|\z))\S+)/){$1+File.expand_path($2)}
- @ruby.gsub!(/(\s+-r\s*)(\.\.?\/\S+)/){$1+File.expand_path($2)}
- true
- when /\A--sets=(.*)/
- tests = Dir.glob("#{File.dirname($0)}/test_{#{$1}}*.rb")
- puts tests.map {|path| File.basename(path) }.inspect
- true
- when /\A--dir=(.*)/
- dir = $1
- true
- when /\A(--stress|-s)/
- $stress = true
- when /\A(-q|--q(uiet))\z/
- quiet = true
- true
- when /\A(-v|--v(erbose))\z/
- @verbose = true
- when /\A(-h|--h(elp)?)\z/
- puts(<<-End)
-Usage: #{File.basename($0, '.*')} --ruby=PATH [--sets=NAME,NAME,...]
- --sets=NAME,NAME,... Name of test sets.
- --dir=DIRECTORY Working directory.
- default: /tmp/bootstraptest.tmpwd
- -s, --stress stress test.
- -v, --verbose Output test name before exec.
- -q, --quiet Don\'t print header message.
- -h, --help Print this message and quit.
-End
- exit true
- else
- false
- end
- }
- if tests and not ARGV.empty?
- $stderr.puts "--tests and arguments are exclusive"
- exit false
- end
- tests ||= ARGV
- tests = Dir.glob("#{File.dirname($0)}/test_*.rb") if tests.empty?
- pathes = tests.map {|path| File.expand_path(path) }
-
- unless quiet
- puts Time.now
- if defined?(RUBY_DESCRIPTION)
- puts "Driver is #{RUBY_DESCRIPTION}"
- elsif defined?(RUBY_PATCHLEVEL)
- puts "Driver is ruby #{RUBY_VERSION} (#{RUBY_RELEASE_DATE}#{RUBY_PLATFORM}) [#{RUBY_PLATFORM}]"
- else
- puts "Driver is ruby #{RUBY_VERSION} (#{RUBY_RELEASE_DATE}) [#{RUBY_PLATFORM}]"
- end
- puts "Target is #{`#{@ruby} -v`.chomp}"
- puts
- $stdout.flush
- end
-
- in_temporary_working_directory(dir) {
- exec_test pathes
- }
-end
-
-def exec_test(pathes)
- @count = 0
- @error = 0
- @errbuf = []
- @location = nil
- pathes.each do |path|
- $stderr.print "\n#{File.basename(path)} "
- load File.expand_path(path)
- end
- $stderr.puts
- if @error == 0
- if @count == 0
- $stderr.puts "No tests, no problem"
- else
- $stderr.puts "PASS all #{@count} tests"
- end
- exit true
- else
- @errbuf.each do |msg|
- $stderr.puts msg
- end
- $stderr.puts "FAIL #{@error}/#{@count} tests failed"
- exit false
- end
-end
-
-def assert_check(testsrc, message = '', opt = '')
- $stderr.puts "\##{@count} #{@location}" if @verbose
- result = get_result_string(testsrc, opt)
- check_coredump
- faildesc = yield(result)
- if !faildesc
- $stderr.print '.'
- else
- $stderr.print 'F'
- error faildesc, message
- end
-rescue Exception => err
- $stderr.print 'E'
- error err.message, message
-end
-
-def assert_equal(expected, testsrc, message = '')
- newtest
- assert_check(testsrc, message) {|result|
- if expected == result
- nil
- else
- desc = "#{result.inspect} (expected #{expected.inspect})"
- pretty(testsrc, desc, result)
- end
- }
-end
-
-def assert_match(expected_pattern, testsrc, message = '')
- newtest
- assert_check(testsrc, message) {|result|
- if expected_pattern =~ result
- nil
- else
- desc = "#{expected_pattern.inspect} expected to be =~\n#{result.inspect}"
- pretty(testsrc, desc, result)
- end
- }
-end
-
-def assert_not_match(unexpected_pattern, testsrc, message = '')
- newtest
- assert_check(testsrc, message) {|result|
- if unexpected_pattern !~ result
- nil
- else
- desc = "#{unexpected_pattern.inspect} expected to be !~\n#{result.inspect}"
- pretty(testsrc, desc, result)
- end
- }
-end
-
-def assert_valid_syntax(testsrc, message = '')
- newtest
- assert_check(testsrc, message, '-c') {|result|
- result if /Syntax OK/ !~ result
- }
-end
-
-def assert_normal_exit(testsrc, message = '', ignore_signals = nil)
- newtest
- $stderr.puts "\##{@count} #{@location}" if @verbose
- faildesc = nil
- filename = make_srcfile(testsrc)
- old_stderr = $stderr.dup
- begin
- $stderr.reopen("assert_normal_exit_stderr.log", "w")
- `#{@ruby} -W0 #{filename}`
- status = $?
- ensure
- $stderr.reopen(old_stderr)
- old_stderr.close
- end
- if status.signaled?
- signo = status.termsig
- signame = Signal.list.invert[signo]
- unless ignore_signals and ignore_signals.include?(signame)
- sigdesc = "signal #{signo}"
- if signame
- sigdesc = "SIG#{signame} (#{sigdesc})"
- end
- faildesc = pretty(testsrc, "killed by #{sigdesc}", nil)
- stderr_log = File.read("assert_normal_exit_stderr.log")
- if !stderr_log.empty?
- faildesc << "\n" if /\n\z/ !~ faildesc
- stderr_log << "\n" if /\n\z/ !~ stderr_log
- stderr_log.gsub!(/^.*\n/) { '| ' + $& }
- faildesc << stderr_log
- end
- end
- end
- if !faildesc
- $stderr.print '.'
- true
- else
- $stderr.print 'F'
- error faildesc, message
- false
- end
-rescue Exception => err
- $stderr.print 'E'
- error err.message, message
- false
-end
-
-def assert_finish(timeout_seconds, testsrc, message = '')
- newtest
- $stderr.puts "\##{@count} #{@location}" if @verbose
- faildesc = nil
- filename = make_srcfile(testsrc)
- io = IO.popen("#{@ruby} -W0 #{filename}")
- pid = io.pid
- waited = false
- tlimit = Time.now + timeout_seconds
- while Time.now < tlimit
- if Process.waitpid pid, Process::WNOHANG
- waited = true
- break
- end
- sleep 0.1
- end
- if !waited
- Process.kill(:KILL, pid)
- Process.waitpid pid
- faildesc = pretty(testsrc, "not finished in #{timeout_seconds} seconds", nil)
- end
- io.close
- if !faildesc
- $stderr.print '.'
- else
- $stderr.print 'F'
- error faildesc, message
- end
-rescue Exception => err
- $stderr.print 'E'
- error err.message, message
-end
-
-def flunk(message = '')
- newtest
- $stderr.print 'F'
- error message, ''
-end
-
-def pretty(src, desc, result)
- src = src.sub(/\A.*\n/, '')
- (/\n/ =~ src ? "\n#{adjust_indent(src)}" : src) + " #=> #{desc}"
-end
-
-INDENT = 27
-
-def adjust_indent(src)
- untabify(src).gsub(/^ {#{INDENT}}/o, '').gsub(/^/, ' ')
-end
-
-def untabify(str)
- str.gsub(/^\t+/) {' ' * (8 * $&.size) }
-end
-
-def make_srcfile(src)
- filename = 'bootstraptest.tmp.rb'
- File.open(filename, 'w') {|f|
- f.puts "GC.stress = true" if $stress
- f.puts "print(begin; #{src}; end)"
- }
- filename
-end
-
-def get_result_string(src, opt = '')
- if @ruby
- filename = make_srcfile(src)
- begin
- `#{@ruby} -W0 #{opt} #{filename}`
- ensure
- raise CoreDumpError, "core dumped" if $? and $?.coredump?
- end
- else
- eval(src).to_s
- end
-end
-
-def newtest
- @location = File.basename(caller(2).first)
- @count += 1
- cleanup_coredump
-end
-
-def error(msg, additional_message)
- @errbuf.push "\##{@count} #{@location}: #{msg} #{additional_message}"
- @error += 1
-end
-
-def in_temporary_working_directory(dir)
- if dir
- Dir.mkdir dir
- Dir.chdir(dir) {
- yield
- }
- else
- Dir.mktmpdir("bootstraptest.tmpwd") {|d|
- Dir.chdir(d) {
- yield
- }
- }
- end
-end
-
-def cleanup_coredump
- FileUtils.rm_f 'core'
- FileUtils.rm_f Dir.glob('core.*')
- FileUtils.rm_f @ruby+'.stackdump' if @ruby
-end
-
-class CoreDumpError < StandardError; end
-
-def check_coredump
- if File.file?('core') or not Dir.glob('core.*').empty? or
- (@ruby and File.exist?(@ruby+'.stackdump'))
- raise CoreDumpError, "core dumped"
- end
-end
-
-main
diff --git a/bootstraptest/test_attr.rb b/bootstraptest/test_attr.rb
deleted file mode 100644
index 721a847145..0000000000
--- a/bootstraptest/test_attr.rb
+++ /dev/null
@@ -1,36 +0,0 @@
-assert_equal 'ok', %q{
- module M
- class A
- class << self
- attr_accessor :at
- def workflow_rule
- yield self
- end
-
- def eval_str(str)
- eval(str)
- end
- end
- end
- end
- begin
- M::A.eval_str(<<-END)
- workflow_rule do |r|
- r.at 1
- end
- END
- rescue ArgumentError => e
- print "ok"
- end
-}, '[ruby-core:14641]'
-
-assert_equal %{ok}, %{
- class A
- attr :m
- end
- begin
- A.new.m(3)
- rescue ArgumentError => e
- print "ok"
- end
-}, '[ruby-core:15120]'
diff --git a/bootstraptest/test_autoload.rb b/bootstraptest/test_autoload.rb
deleted file mode 100644
index b781fdb7e9..0000000000
--- a/bootstraptest/test_autoload.rb
+++ /dev/null
@@ -1,78 +0,0 @@
-assert_equal 'ok', %q{
- open("zzz.rb", "w") {|f| f.puts "class ZZZ; def self.ok;:ok;end;end"}
- autoload :ZZZ, "./zzz.rb"
- ZZZ.ok
-}
-
-assert_equal 'ok', %q{
- open("zzz.rb", "w") {|f| f.puts "class ZZZ; def self.ok;:ok;end;end"}
- autoload :ZZZ, "./zzz.rb"
- require "./zzz.rb"
- ZZZ.ok
-}
-
-assert_equal 'ok', %q{
- open("zzz.rb", "w") {|f| f.puts "class ZZZ; def self.ok;:ok;end;end"}
- autoload :ZZZ, "./zzz.rb"
- proc{$SAFE=4; ZZZ.ok}.call
-}
-
-assert_equal 'ok', %q{
- open("zzz.rb", "w") {|f| f.puts "class ZZZ; def self.ok;:ok;end;end"}
- autoload :ZZZ, "./zzz.rb"
- require "./zzz.rb"
- proc{$SAFE=4; ZZZ.ok}.call
-}
-
-assert_equal 'ok', %q{
- open("zzz.rb", "w") {|f| f.puts "class ZZZ; def hoge;:ok;end;end"}
- autoload :ZZZ, File.join(Dir.pwd, 'zzz.rb')
- module M; end
- Thread.new{M.instance_eval('$SAFE=4; ZZZ.new.hoge')}.value
-}
-
-assert_equal 'ok', %q{
- open("zzz.rb", "w") {|f| f.puts "class ZZZ; def hoge;:ok;end;end"}
- autoload :ZZZ, File.join(Dir.pwd, 'zzz.rb')
- module M; end
- Thread.new{$SAFE=4; M.instance_eval('ZZZ.new.hoge')}.value
-}
-
-assert_equal 'ok', %q{
- open("zzz.rb", "w") {|f| f.puts "class ZZZ; def hoge;:ok;end;end"}
- autoload :ZZZ, File.join(Dir.pwd, 'zzz.rb')
- Thread.new{$SAFE=4; eval('ZZZ.new.hoge')}.value
-}
-
-assert_equal 'ok', %q{
- open("zzz.rb", "w") {|f| f.puts "class ZZZ; def hoge;:ok;end;end"}
- autoload :ZZZ, File.join(Dir.pwd, 'zzz.rb')
- module M; end
- Thread.new{eval('$SAFE=4; ZZZ.new.hoge')}.value
-}
-
-assert_equal 'okok', %q{
- open("zzz.rb", "w") {|f| f.puts "class ZZZ; def self.ok;:ok;end;end"}
- autoload :ZZZ, "./zzz.rb"
- t1 = Thread.new {ZZZ.ok}
- t2 = Thread.new {ZZZ.ok}
- [t1.value, t2.value].join
-}
-
-assert_finish 5, %q{
- autoload :ZZZ, File.expand_path(__FILE__)
- begin
- ZZZ
- rescue NameError
- end
-}, '[ruby-core:21696]'
-
-assert_equal 'A::C', %q{
- open("zzz.rb", "w") {}
- class A
- autoload :C, "./zzz"
- class C
- end
- C
- end
-}
diff --git a/bootstraptest/test_block.rb b/bootstraptest/test_block.rb
deleted file mode 100644
index ce7f00b033..0000000000
--- a/bootstraptest/test_block.rb
+++ /dev/null
@@ -1,567 +0,0 @@
-assert_equal %q{1}, %q{
- 1.times{
- begin
- a = 1
- ensure
- foo = nil
- end
- }
-}
-assert_equal %q{2}, %q{
- [1,2,3].find{|x| x == 2}
-}
-assert_equal %q{2}, %q{
- class E
- include Enumerable
- def each(&block)
- [1, 2, 3].each(&block)
- end
- end
- E.new.find {|x| x == 2 }
-}
-assert_equal %q{6}, %q{
- sum = 0
- for x in [1, 2, 3]
- sum += x
- end
- sum
-}
-assert_equal %q{15}, %q{
- sum = 0
- for x in (1..5)
- sum += x
- end
- sum
-}
-assert_equal %q{0}, %q{
- sum = 0
- for x in []
- sum += x
- end
- sum
-}
-assert_equal %q{1}, %q{
- ans = []
- 1.times{
- for n in 1..3
- a = n
- ans << a
- end
- }
-}
-assert_equal %q{1..3}, %q{
- ans = []
- for m in 1..3
- for n in 1..3
- a = [m, n]
- ans << a
- end
- end
-}
-assert_equal %q{[1, 2, 3]}, %q{
- (1..3).to_a
-}
-assert_equal %q{[4, 8, 12]}, %q{
- (1..3).map{|e|
- e * 4
- }
-}
-assert_equal %q{[1, 2, 3]}, %q{
- class C
- include Enumerable
- def each
- [1,2,3].each{|e|
- yield e
- }
- end
- end
-
- C.new.to_a
-}
-assert_equal %q{[4, 5, 6]}, %q{
- class C
- include Enumerable
- def each
- [1,2,3].each{|e|
- yield e
- }
- end
- end
-
- C.new.map{|e|
- e + 3
- }
-}
-assert_equal %q{100}, %q{
- def m
- yield
- end
- def n
- yield
- end
-
- m{
- n{
- 100
- }
- }
-}
-assert_equal %q{20}, %q{
- def m
- yield 1
- end
-
- m{|ib|
- m{|jb|
- i = 20
- }
- }
-}
-assert_equal %q{2}, %q{
- def m
- yield 1
- end
-
- m{|ib|
- m{|jb|
- ib = 20
- kb = 2
- }
- }
-}
-assert_equal %q{3}, %q{
- def iter1
- iter2{
- yield
- }
- end
-
- def iter2
- yield
- end
-
- iter1{
- jb = 2
- iter1{
- jb = 3
- }
- jb
- }
-}
-assert_equal %q{2}, %q{
- def iter1
- iter2{
- yield
- }
- end
-
- def iter2
- yield
- end
-
- iter1{
- jb = 2
- iter1{
- jb
- }
- jb
- }
-}
-assert_equal %q{2}, %q{
- def m
- yield 1
- end
- m{|ib|
- ib*2
- }
-}
-assert_equal %q{92580}, %q{
- def m
- yield 12345, 67890
- end
- m{|ib,jb|
- ib*2+jb
- }
-}
-assert_equal %q{[10, nil]}, %q{
- def iter
- yield 10
- end
-
- a = nil
- [iter{|a|
- a
- }, a]
-}
-assert_equal %q{21}, %q{
- def iter
- yield 10
- end
-
- iter{|a|
- iter{|a|
- a + 1
- } + a
- }
-}
-assert_equal %q{[10, 20, 30, 40, nil, nil, nil, nil]}, %q{
- def iter
- yield 10, 20, 30, 40
- end
-
- a = b = c = d = nil
- iter{|a, b, c, d|
- [a, b, c, d]
- } + [a, b, c, d]
-}
-assert_equal %q{[10, 20, 30, 40, nil, nil]}, %q{
- def iter
- yield 10, 20, 30, 40
- end
-
- a = b = nil
- iter{|a, b, c, d|
- [a, b, c, d]
- } + [a, b]
-}
-assert_equal %q{[1]}, %q{
- $a = []
-
- def iter
- yield 1
- end
-
- def m
- x = iter{|x|
- $a << x
- y = 0
- }
- end
- m
- $a
-}
-assert_equal %q{[1, [2]]}, %q{
- def iter
- yield 1, 2
- end
-
- iter{|a, *b|
- [a, b]
- }
-}
-assert_equal %q{[[1, 2]]}, %q{
- def iter
- yield 1, 2
- end
-
- iter{|*a|
- [a]
- }
-}
-assert_equal %q{[1, 2, []]}, %q{
- def iter
- yield 1, 2
- end
-
- iter{|a, b, *c|
- [a, b, c]
- }
-}
-assert_equal %q{[1, 2, nil, []]}, %q{
- def iter
- yield 1, 2
- end
-
- iter{|a, b, c, *d|
- [a, b, c, d]
- }
-}
-assert_equal %q{1}, %q{
- def m
- yield
- end
- m{
- 1
- }
-}
-assert_equal %q{15129}, %q{
- def m
- yield 123
- end
- m{|ib|
- m{|jb|
- ib*jb
- }
- }
-}
-assert_equal %q{2}, %q{
- def m a
- yield a
- end
- m(1){|ib|
- m(2){|jb|
- ib*jb
- }
- }
-}
-assert_equal %q{9}, %q{
- sum = 0
- 3.times{|ib|
- 2.times{|jb|
- sum += ib + jb
- }}
- sum
-}
-assert_equal %q{10}, %q{
- 3.times{|bl|
- break 10
- }
-}
-assert_equal %q{[1, 2]}, %q{
- def iter
- yield 1,2,3
- end
-
- iter{|i, j|
- [i, j]
- }
-}
-assert_equal %q{[1, nil]}, %q{
- def iter
- yield 1
- end
-
- iter{|i, j|
- [i, j]
- }
-}
-
-assert_equal '0', %q{
-def m()
-end
-m {|(v0,*,(*)),|}
-m {|(*v0,(*)),|}
-m {|(v0,*v1,(*)),|}
-m {|((v0,*v1,v2)),|}
-m {|(v0,*v1,v2),|}
-m {|(v0,*v1,(v2)),|}
-m {|((*),*v0,v1),|}
-m {|((v0),*v1,v2),|}
-m {|(v0,v1,*v2,v3),|}
-m {|v0,(v1,*v2,v3),|}
-m {|(v0,*v1,v2),v3,|}
-m {|(v0,*v1,v2)|}
-m {|(v0,*v1,v2),&v3|}
-m {|(v0,*v1,v2),*|}
-m {|(v0,*v1,v2),*,&v3|}
-m {|*,(v0,*v1,v2)|}
-m {|*,(v0,*v1,v2),&v3|}
-m {|v0,*,(v1,*v2,v3)|}
-m {|v0,*,(v1,*v2,v3),&v4|}
-m {|(v0,*v1,v2),*,v3|}
-m {|(v0,*v1,v2),*,v3,&v4|}
-m {|(v0, *v1, v2)|}
-m {|(*,v)|}
-0
-}, "block parameter (shouldn't SEGV: [ruby-dev:31143])"
-
-assert_equal 'nil', %q{
- def m
- yield
- end
- m{|&b| b}.inspect
-}, '[ruby-dev:31147]'
-
-assert_equal 'nil', %q{
- def m()
- yield
- end
- m {|(v,(*))|}.inspect
-}, '[ruby-dev:31160]'
-
-assert_equal 'nil', %q{
- def m()
- yield
- end
- m {|(*,a,b)|}.inspect
-}, '[ruby-dev:31153]'
-
-assert_equal 'nil', %q{
- def m()
- yield
- end
- m {|((*))|}.inspect
-}
-
-assert_equal %q{[1, 1, [1, nil], [1, nil], [1, nil], [1, nil], [1, 1], 1, [1, nil], [1, nil], [1, nil], [1, nil], [[1, 1], [1, 1]], [1, 1], [1, 1], [1, 1], [1, nil], [1, nil], [[[1, 1], [1, 1]], [[1, 1], [1, 1]]], [[1, 1], [1, 1]], [[1, 1], [1, 1]], [[1, 1], [1, 1]], [1, 1], [1, 1], [[[[1, 1], [1, 1]], [[1, 1], [1, 1]]], [[[1, 1], [1, 1]], [[1, 1], [1, 1]]]], [[[1, 1], [1, 1]], [[1, 1], [1, 1]]], [[[1, 1], [1, 1]], [[1, 1], [1, 1]]], [[[1, 1], [1, 1]], [[1, 1], [1, 1]]], [[1, 1], [1, 1]], [[1, 1], [1, 1]]]}, %q{
-def m(ary = [])
- yield(ary)
-end
-
-$ans = []
-o = 1
-5.times{
- v,(*) = o; $ans << o
- m(o){|(v,(*))| $ans << v}
- ((x, y)) = o; $ans << [x, y]
- m(o){|((x, y))| $ans << [x, y]}
- (((x, y))) = o; $ans << [x, y]
- m(o){|(((x, y)))| $ans << [x, y]}
- o = [o, o]
-}; $ans
-}
-
-assert_equal '0', %q{
- def m()
- yield [0]
- end
- m {|*,v| v}.inspect
-}, '[ruby-dev:31437]'
-assert_equal '[0]', %q{
- def m
- yield [0]
- end
- m{|v, &b| v}.inspect
-}, '[ruby-dev:31440]'
-assert_equal 'ok', %q{
- begin
- lambda{|a|}.call(1, 2)
- rescue ArgumentError
- :ok
- else
- :ng
- end
-}, '[ruby-dev:31464]'
-assert_equal 'ok', %q{
- begin
- lambda{|&b|}.call(3)
- rescue ArgumentError
- :ok
- else
- :ng
- end
-}, '[ruby-dev:31472]'
-assert_equal 'ok', %q{
- class C
- def each
- yield [1,2]
- yield 1,2
- end
- end
- vs1 = []
- C.new.each {|*v| vs1 << v }
- vs2 = []
- C.new.to_enum.each {|*v| vs2 << v }
- vs1 == vs2 ? :ok : :ng
-}, '[ruby-dev:32329]'
-
-assert_normal_exit %q{
- e = [1,2,3].each
- 10000.times {
- e = [e].each
- }
- Thread.new { GC.start }.join
-}, '[ruby-dev:32604]'
-
-
-assert_equal '[nil, []]', %q{
- def m() yield nil,[] end
- l = lambda {|*v| v}
- GC.stress=true
- r = m(&l)
- GC.stress=false
- r.inspect
-}, '[ruby-dev:32567]'
-
-assert_equal NilClass.to_s, %q{
- r = false; 1.times{|&b| r = b}; r.class
-}
-
-assert_equal 'ok', %q{
- class C
- define_method(:foo) do |arg, &block|
- if block then block.call else arg end
- end
- end
- C.new.foo("ng") {"ok"}
-}, '[ruby-talk:266422]'
-
-assert_equal 'ok', %q{
- class C
- define_method(:xyz) do |o, k, &block|
- block.call(o, k)
- end
- end
- C.new.xyz("o","k") {|o, k| o+k}
-}, '[ruby-core:20544]'
-
-assert_equal 'ok', %q{
- class C
- define_method(:xyz) do |*args, &block|
- block.call(*args)
- end
- end
- C.new.xyz("o","k") {|*args| args.join("")}
-}, '[ruby-core:20544]'
-
-assert_equal 'ok', %q{
- STDERR.reopen(STDOUT)
- class C
- define_method(:foo) do |&block|
- block.call if block
- end
- result = "ng"
- new.foo() {result = "ok"}
- result
- end
-}
-
-assert_equal "ok", %q{
- class Bar
- def bar; :ok; end
- end
- def foo
- yield(Bar.new) if block_given?
- end
- foo(&:bar)
-}, '[ruby-core:14279]'
-
-assert_normal_exit %q{
- class Controller
- def respond_to(&block)
- responder = Responder.new
- block.call(responder)
- responder.respond
- end
- def test_for_bug
- respond_to{|format|
- format.js{
- puts "in test"
- render{|obj|
- puts obj
- }
- }
- }
- end
- def render(&block)
- puts "in render"
- end
- end
-
- class Responder
- def method_missing(symbol, &block)
- puts "enter method_missing"
- @response = Proc.new{
- puts 'in method missing'
- block.call
- }
- puts "leave method_missing"
- end
- def respond
- @response.call
- end
- end
- t = Controller.new
- t.test_for_bug
-}, '[ruby-core:14395]'
-
diff --git a/bootstraptest/test_class.rb b/bootstraptest/test_class.rb
deleted file mode 100644
index a7f6d4df47..0000000000
--- a/bootstraptest/test_class.rb
+++ /dev/null
@@ -1,152 +0,0 @@
-# class
-assert_equal 'true', %q( class C; end
- Object.const_defined?(:C) )
-assert_equal 'Class', %q( class C; end
- C.class )
-assert_equal 'C', %q( class C; end
- C.name )
-assert_equal 'C', %q( class C; end
- C.new.class )
-assert_equal 'C', %q( class C; end
- C.new.class.name )
-assert_equal 'Class', %q( class C; end
- C.new.class.class )
-
-# inherited class
-assert_equal 'true', %q( class A; end
- class C < A; end
- Object.const_defined?(:C) )
-assert_equal 'Class', %q( class A; end
- class C < A; end
- C.class )
-assert_equal 'C', %q( class A; end
- class C < A; end
- C.name )
-assert_equal 'C', %q( class A; end
- class C < A; end
- C.new.class )
-assert_equal 'C', %q( class A; end
- class C < A; end
- C.new.class.name )
-assert_equal 'Class', %q( class A; end
- class C < A; end
- C.new.class.class )
-
-# module
-assert_equal 'true', %q( module M; end
- Object.const_defined?(:M) )
-assert_equal 'Module', %q( module M; end
- M.class )
-assert_equal 'M', %q( module M; end
- M.name )
-assert_equal 'C', %q( module M; end
- class C; include M; end
- C.new.class )
-
-# nested class
-assert_equal 'A::B', %q( class A; end
- class A::B; end
- A::B )
-assert_equal 'A::B', %q( class A; end
- class A::B; end
- A::B.name )
-assert_equal 'A::B', %q( class A; end
- class A::B; end
- A::B.new.class )
-assert_equal 'Class', %q( class A; end
- class A::B; end
- A::B.new.class.class )
-assert_equal 'A::B::C', %q( class A; end
- class A::B; end
- class A::B::C; end
- A::B::C )
-assert_equal 'A::B::C', %q( class A; end
- class A::B; end
- class A::B::C; end
- A::B::C.name )
-assert_equal 'Class', %q( class A; end
- class A::B; end
- class A::B::C; end
- A::B::C.class )
-assert_equal 'A::B::C', %q( class A; end
- class A::B; end
- class A::B::C; end
- A::B::C.new.class )
-assert_equal 'Class', %q( class A; end
- class A::B; end
- class A::B::C; end
- A::B::C.new.class.class )
-assert_equal 'A::B2', %q( class A; end
- class A::B; end
- class A::B2 < A::B; end
- A::B2 )
-assert_equal 'Class', %q( class A; end
- class A::B; end
- class A::B2 < A::B; end
- A::B2.class )
-
-# reopen
-assert_equal 'true', %q( class C; end; c1 = ::C
- class C; end; c2 = ::C
- c1.equal?(c2) )
-assert_equal '1', %q( class C; end
- class A; end
- begin class C < A; end; rescue TypeError; 1 end )
-assert_equal '1', %q( class C; end
- begin module C; end; rescue TypeError; 1 end )
-assert_equal '1', %q( C = 1 # [yarv-dev:782]
- begin class C; end; rescue TypeError; 1 end )
-assert_equal '1', %q( C = 1 # [yarv-dev:800]
- begin module C; end; rescue TypeError; 1 end )
-
-# colon2, colon3
-assert_equal '1', %q( class A; end; A::C = 1; A::C )
-assert_equal '1', %q( A = 7; begin A::C = 7; rescue TypeError; 1 end )
-assert_equal '1', %q( begin 7::C = 7; rescue TypeError; 1 end )
-assert_equal 'C', %q( class A; class ::C; end end; C )
-assert_equal 'Class', %q( class A; class ::C; end end; C.class )
-assert_equal 'OK', %q( class A; ::C = "OK"; end; C )
-assert_equal 'String', %q( class A; ::C = "OK"; end; C.class )
-
-# class/module dup
-assert_equal 'Class', %q( class C; end; C.dup.class )
-assert_equal 'Module', %q( module M; end; M.dup.class )
-
-
-assert_equal "ok", %q{
- module Foo
- end
-
- begin
- def foo(&b)
- Foo.module_eval &b
- end
- foo{
- def bar
- end
- }
- bar()
- rescue NameError
- :ok
- end
-}, '[ruby-core:14378]'
-
-assert_equal '3', %q{
- $i = 0
- class C
- def self.const_missing *args
- $i+=1
- end
- end
-
- 3.times{
- C::FOO
- }
- $i
-}
-
-assert_match /::C\z/, %q{
- c = nil
- Module.new{|m| c = class m::C; name; end}
- c
-}, '[ruby-dev:38456]'
diff --git a/bootstraptest/test_eval.rb b/bootstraptest/test_eval.rb
deleted file mode 100644
index 6dc23468cb..0000000000
--- a/bootstraptest/test_eval.rb
+++ /dev/null
@@ -1,301 +0,0 @@
-assert_equal %q{ok}, %q{
- def m
- a = :ok
- $b = binding
- end
- m
- eval('a', $b)
-}
-assert_equal %q{[:ok, :ok2]}, %q{
- def m
- a = :ok
- $b = binding
- end
- m
- eval('b = :ok2', $b)
- eval('[a, b]', $b)
-}
-assert_equal %q{[nil, 1]}, %q{
- $ans = []
- def m
- $b = binding
- end
- m
- $ans << eval(%q{
- $ans << eval(%q{
- a
- }, $b)
- a = 1
- }, $b)
- $ans
-}
-assert_equal %q{C}, %q{
- Const = :top
- class C
- Const = :C
- def m
- binding
- end
- end
- eval('Const', C.new.m)
-}
-assert_equal %q{top}, %q{
- Const = :top
- a = 1
- class C
- Const = :C
- def m
- eval('Const', TOPLEVEL_BINDING)
- end
- end
- C.new.m
-}
-assert_equal %q{:ok
-ok}, %q{
- class C
- $b = binding
- end
- eval %q{
- def m
- :ok
- end
- }, $b
- p C.new.m
-}
-assert_equal %q{ok}, %q{
- b = proc{
- a = :ok
- binding
- }.call
- a = :ng
- eval("a", b)
-}
-assert_equal %q{C}, %q{
- class C
- def foo
- binding
- end
- end
- C.new.foo.eval("self.class.to_s")
-}
-assert_equal %q{1}, %q{
- eval('1')
-}
-assert_equal %q{1}, %q{
- eval('a=1; a')
-}
-assert_equal %q{1}, %q{
- a = 1
- eval('a')
-}
-assert_equal %q{ok}, %q{
- __send__ :eval, %{
- :ok
- }
-}
-assert_equal %q{ok}, %q{
- 1.__send__ :instance_eval, %{
- :ok
- }
-}
-assert_equal %q{1}, %q{
- 1.instance_eval{
- self
- }
-}
-assert_equal %q{foo}, %q{
- 'foo'.instance_eval{
- self
- }
-}
-assert_equal %q{1}, %q{
- class Fixnum
- Const = 1
- end
- 1.instance_eval %{
- Const
- }
-}
-assert_equal %q{C}, %q{
- Const = :top
- class C
- Const = :C
- end
- C.module_eval{
- Const
- }
-}
-assert_equal %q{C}, %q{
- Const = :top
- class C
- Const = :C
- end
- C.class_eval %{
- def m
- Const
- end
- }
- C.new.m
-}
-assert_equal %q{C}, %q{
- Const = :top
- class C
- Const = :C
- end
- C.class_eval{
- def m
- Const
- end
- }
- C.new.m
-}
-assert_equal %q{[:top, :C, :top, :C]}, %q{
- Const = :top
- class C
- Const = :C
- end
- $nest = false
- $ans = []
- def m
- $ans << Const
- C.module_eval %{
- $ans << Const
- Boo = false unless defined? Boo
- unless $nest
- $nest = true
- m
- end
- }
- end
- m
- $ans
-}
-assert_equal %q{[10, main]}, %q{
- $nested = false
- $ans = []
- $pr = proc{
- $ans << self
- unless $nested
- $nested = true
- $pr.call
- end
- }
- class C
- def initialize &b
- 10.instance_eval(&b)
- end
- end
- C.new(&$pr)
- $ans
-}
-
-%w[break next redo].each do |keyword|
- assert_match %r"Can't escape from eval with #{keyword}\z", %{
- begin
- eval "0 rescue #{keyword}"
- rescue SyntaxError => e
- e.message
- end
- }, '[ruby-dev:31372]'
-end
-
-assert_normal_exit %q{
- STDERR.reopen(STDOUT)
- class Foo
- def self.add_method
- class_eval("def some-bad-name; puts 'hello' unless @some_variable.some_function(''); end")
- end
- end
- Foo.add_method
-}, '[ruby-core:14556] reported by Frederick Cheung'
-
-assert_equal 'ok', %q{
- class Module
- def my_module_eval(&block)
- module_eval(&block)
- end
- end
- class String
- Integer.my_module_eval do
- def hoge; end
- end
- end
- if Integer.instance_methods(false).map{|m|m.to_sym}.include?(:hoge) &&
- !String.instance_methods(false).map{|m|m.to_sym}.include?(:hoge)
- :ok
- else
- :ng
- end
-}, "[ruby-dev:34236]"
-
-assert_equal 'ok', %q{
- begin
- eval("class nil::Foo; end")
- :ng
- rescue Exception
- :ok
- end
-}
-
-assert_equal 'ok', %q{
- begin
- 0.instance_eval { def m() :m end }
- 1.m
- :ng
- rescue Exception
- :ok
- end
-}, '[ruby-dev:34579]'
-
-assert_equal 'ok', %q{
- begin
- 12.instance_eval { @@a }
- rescue NameError
- :ok
- end
-}, '[ruby-core:16794]'
-
-assert_equal 'ok', %q{
- begin
- 12.instance_exec { @@a }
- rescue NameError
- :ok
- end
-}, '[ruby-core:16794]'
-
-assert_equal 'ok', %q{
- begin
- nil.instance_eval {
- def a() :a end
- }
- rescue TypeError
- :ok
- end
-}, '[ruby-core:16796]'
-
-assert_equal 'ok', %q{
- begin
- nil.instance_exec {
- def a() :a end
- }
- rescue TypeError
- :ok
- end
-}, '[ruby-core:16796]'
-
-assert_normal_exit %q{
- eval("", method(:proc).call {}.binding)
-}
-
-assert_equal "(eval):1:in `block in <main>': ", %q{
- b = binding
- 10.times{
- eval('', b)
- }
- begin
- eval('1.times{raise}', b)
- rescue => e
- e.message
- end
-}, ' [ruby-dev:35392]'
-
diff --git a/bootstraptest/test_exception.rb b/bootstraptest/test_exception.rb
deleted file mode 100644
index bd3d02ade3..0000000000
--- a/bootstraptest/test_exception.rb
+++ /dev/null
@@ -1,404 +0,0 @@
-assert_equal %q{2}, %q{
- begin
- 1+1
- ensure
- 2+2
- end
-}
-assert_equal %q{4}, %q{
- begin
- 1+1
- begin
- 2+2
- ensure
- 3+3
- end
- ensure
- 4+4
- end
-}
-assert_equal %q{4}, %q{
- begin
- 1+1
- begin
- 2+2
- ensure
- 3+3
- end
- ensure
- 4+4
- begin
- 5+5
- ensure
- 6+6
- end
- end
-}
-assert_equal %q{NilClass}, %q{
- a = nil
- 1.times{|e|
- begin
- rescue => err
- end
- a = err.class
- }
- a
-}
-assert_equal %q{RuntimeError}, %q{
- a = nil
- 1.times{|e|
- begin
- raise
- rescue => err
- end
- a = err.class
- }
- a
-}
-assert_equal %q{}, %q{
- $!
-}
-assert_equal %q{FOO}, %q{
- begin
- raise "FOO"
- rescue
- $!
- end
-}
-assert_equal %q{FOO}, %q{
- def m
- $!
- end
- begin
- raise "FOO"
- rescue
- m()
- end
-}
-assert_equal %q{[#<RuntimeError: BAR>, #<RuntimeError: FOO>]}, %q{
- $ans = []
- def m
- $!
- end
- begin
- raise "FOO"
- rescue
- begin
- raise "BAR"
- rescue
- $ans << m()
- end
- $ans << m()
- end
- $ans
-}
-assert_equal %q{[#<RuntimeError: FOO>, #<RuntimeError: FOO>]}, %q{
- $ans = []
- def m
- $!
- end
-
- begin
- begin
- raise "FOO"
- ensure
- $ans << m()
- end
- rescue
- $ans << m()
- end
-}
-assert_equal %q{[nil]}, %q{
- $ans = []
- def m
- $!
- end
- def m2
- 1.times{
- begin
- return
- ensure
- $ans << m
- end
- }
- end
- m2
- $ans
-}
-assert_equal %q{ok}, %q{
- begin
- raise
- rescue
- :ok
- end
-}
-assert_equal %q{ok}, %q{
- begin
- raise
- rescue
- :ok
- ensure
- :ng
- end
-}
-assert_equal %q{RuntimeError}, %q{
- begin
- raise
- rescue => e
- e.class
- end
-}
-assert_equal %q{ng}, %q{
- begin
- raise
- rescue StandardError
- :ng
- rescue Exception
- :ok
- end
-}
-assert_equal %q{c}, %q{
- begin
- begin
- raise "a"
- rescue
- raise "b"
- ensure
- raise "c"
- end
- rescue => e
- e.message
- end
-}
-assert_equal %q{33}, %q{
- def m a, b
- a + b
- end
- m(1, begin
- raise
- rescue
- 2
- end) +
- m(10, begin
- raise
- rescue
- 20
- ensure
- 30
- end)
-}
-assert_equal %q{3}, %q{
- def m a, b
- a + b
- end
- m(begin
- raise
- rescue
- 1
- end,
- begin
- raise
- rescue
- 2
- end)
-}
-assert_equal %q{ok3}, %q{
- class E1 < Exception
- end
-
- def m
- yield
- end
-
- begin
- begin
- begin
- m{
- raise
- }
- rescue E1
- :ok2
- ensure
- end
- rescue
- :ok3
- ensure
- end
- rescue E1
- :ok
- ensure
- end
-}
-assert_equal %q{7}, %q{
- $i = 0
- def m
- iter{
- begin
- $i += 1
- begin
- $i += 2
- break
- ensure
-
- end
- ensure
- $i += 4
- end
- $i = 0
- }
- end
-
- def iter
- yield
- end
- m
- $i
-}
-assert_equal %q{10}, %q{
- $i = 0
- def m
- begin
- $i += 1
- begin
- $i += 2
- return
- ensure
- $i += 3
- end
- ensure
- $i += 4
- end
- p :end
- end
- m
- $i
-}
-assert_equal %q{1}, %q{
- begin
- 1
- rescue
- 2
- end
-}
-assert_equal %q{4}, %q{
- begin
- 1
- begin
- 2
- rescue
- 3
- end
- 4
- rescue
- 5
- end
-}
-assert_equal %q{3}, %q{
- begin
- 1
- rescue
- 2
- else
- 3
- end
-}
-assert_equal %q{2}, %q{
- begin
- 1+1
- rescue
- 2+2
- ensure
- 3+3
- end
- }
-assert_equal %q{2}, %q{
- begin
- 1+1
- rescue
- 2+2
- ensure
- 3+3
- end
- }
-assert_equal %q{6}, %q{
- begin
- 1+1
- rescue
- 2+2
- else
- 3+3
- ensure
- 4+4
- end
- }
-assert_equal %q{12}, %q{
- begin
- 1+1
- begin
- 2+2
- rescue
- 3+3
- else
- 4+4
- end
- rescue
- 5+5
- else
- 6+6
- ensure
- 7+7
- end
- }
-assert_equal %q{ok}, %q{ #
- proc{
- begin
- raise
- break
- rescue
- :ok
- end
- }.call
-}
-assert_equal %q{}, %q{
- proc do
- begin
- raise StandardError
- redo
- rescue StandardError
- end
- end.call
-}
-
-##
-assert_match /undefined method `foo\'/, %q{
- STDERR.reopen(STDOUT)
- class C
- def inspect
- bar {}
- end
-
- def bar
- raise
- ensure
- end
- end
- C.new.foo
-}, "[ruby-dev:31407]"
-
-assert_equal 'nil', %q{
- doit = false
- exc = nil
- t = Thread.new {
- begin
- doit = true
- sleep 10
- ensure
- exc = $!
- end
- }
- Thread.pass until doit
- t.kill
- t.join
- exc.inspect
-}, '[ruby-dev:32608]'
-
diff --git a/bootstraptest/test_finalizer.rb b/bootstraptest/test_finalizer.rb
deleted file mode 100644
index 22a16b1220..0000000000
--- a/bootstraptest/test_finalizer.rb
+++ /dev/null
@@ -1,8 +0,0 @@
-assert_normal_exit %q{
-a1,a2,b1,b2=Array.new(4){""}
-ObjectSpace.define_finalizer(b2,proc{})
-ObjectSpace.define_finalizer(b1,proc{b1.inspect})
-
-ObjectSpace.define_finalizer(a2,proc{a1.inspect})
-ObjectSpace.define_finalizer(a1,proc{})
-}, '[ruby-dev:35778]'
diff --git a/bootstraptest/test_flip.rb b/bootstraptest/test_flip.rb
deleted file mode 100644
index ff194868b2..0000000000
--- a/bootstraptest/test_flip.rb
+++ /dev/null
@@ -1 +0,0 @@
-assert_equal %q{E}, %q{$_ = "E"; eval("nil if true..~/^E/",nil,"-e"); $_}
diff --git a/bootstraptest/test_flow.rb b/bootstraptest/test_flow.rb
deleted file mode 100644
index 46ca1a0c6a..0000000000
--- a/bootstraptest/test_flow.rb
+++ /dev/null
@@ -1,504 +0,0 @@
-assert_equal %q{[1, 2, 4, 5, 6, 7, 8]}, %q{$a = []; begin; ; $a << 1
- [1,2].each{; $a << 2
- break; $a << 3
- }; $a << 4
- begin; $a << 5
- ensure; $a << 6
- end; $a << 7
-; $a << 8
-; rescue Exception; $a << 99; end; $a}
-assert_equal %q{[1, 2, 3, 5, 6, 7, 8]}, %q{$a = []; begin; ; $a << 1
- begin; $a << 2
- [1,2].each do; $a << 3
- break; $a << 4
- end; $a << 5
- ensure; $a << 6
- end; $a << 7
-; $a << 8
-; rescue Exception; $a << 99; end; $a}
-assert_equal %q{ok}, %q{
- ["a"].inject("ng"){|x,y|
- break :ok
- }
-}
-assert_equal %q{ok}, %q{
- unless ''.respond_to? :lines
- class String
- def lines
- self
- end
- end
- end
-
- ('a').lines.map{|e|
- break :ok
- }
-}
-assert_equal %q{[1, 2, 4, 5]}, %q{$a = []; begin; ; $a << 1
- ["a"].inject("ng"){|x,y|; $a << 2
- break :ok; $a << 3
- }; $a << 4
-; $a << 5
-; rescue Exception; $a << 99; end; $a}
-assert_equal %q{[1, 2, 4, 5]}, %q{$a = []; begin; ; $a << 1
- ('a'..'b').map{|e|; $a << 2
- break :ok; $a << 3
- }; $a << 4
-; $a << 5
-; rescue Exception; $a << 99; end; $a}
-assert_equal %q{[1, 2, 3, 5, 7, 8]}, %q{$a = []; begin; ; $a << 1
- [1,2].each do; $a << 2
- begin; $a << 3
- break; $a << 4
- ensure; $a << 5
- end; $a << 6
- end; $a << 7
-; $a << 8
-; rescue Exception; $a << 99; end; $a}
-assert_equal %q{[1, 2, 3, 4, 5, 6, 9, 10]}, %q{$a = []; begin; ; $a << 1
- i=0; $a << 2
- while i<3; $a << 3
- i+=1; $a << 4
- begin; $a << 5
- ensure; $a << 6
- break; $a << 7
- end; $a << 8
- end; $a << 9
-; $a << 10
-; rescue Exception; $a << 99; end; $a}
-assert_equal %q{[1, 2, 3, 4, 5, 7, 10, 11]}, %q{$a = []; begin; ; $a << 1
- i=0; $a << 2
- while i<3; $a << 3
- i+=1; $a << 4
- begin; $a << 5
- raise; $a << 6
- ensure; $a << 7
- break; $a << 8
- end; $a << 9
- end; $a << 10
-; $a << 11
-; rescue Exception; $a << 99; end; $a}
-assert_equal %q{[1, 2, 3, 4, 5, 7, 10, 11]}, %q{$a = []; begin; ; $a << 1
- i=0; $a << 2
- while i<3; $a << 3
- i+=1; $a << 4
- begin; $a << 5
- raise; $a << 6
- rescue; $a << 7
- break; $a << 8
- end; $a << 9
- end; $a << 10
-; $a << 11
-; rescue Exception; $a << 99; end; $a}
-assert_equal %q{[1, 2, 3, 5, 8, 9]}, %q{$a = []; begin; ; $a << 1
- [1,2].each do; $a << 2
- begin; $a << 3
- raise StandardError; $a << 4
- ensure; $a << 5
- break; $a << 6
- end; $a << 7
- end; $a << 8
-; $a << 9
-; rescue Exception; $a << 99; end; $a}
-assert_equal %q{[1, 2, 3, 5, 8, 9]}, %q{$a = []; begin; ; $a << 1
- [1,2].each do; $a << 2
- begin; $a << 3
- raise StandardError; $a << 4
- rescue; $a << 5
- break; $a << 6
- end; $a << 7
- end; $a << 8
-; $a << 9
-; rescue Exception; $a << 99; end; $a}
-assert_equal %q{[1, 2, 3, 4, 6, 8, 10, 11]}, %q{$a = []; begin; ; $a << 1
- [1,2].each do; $a << 2
- begin; $a << 3
- begin; $a << 4
- break; $a << 5
- ensure; $a << 6
- end; $a << 7
- ensure; $a << 8
- end; $a << 9
- end; $a << 10
-; $a << 11
-; rescue Exception; $a << 99; end; $a}
-assert_equal %q{[1, 2, 3, 4, 5, 6, 7, 8, 10, 13, 3, 4, 5, 6, 7, 8, 10, 13, 3, 4, 5, 6, 7, 8, 10, 13, 14, 15]}, %q{$a = []; begin; ; $a << 1
- i = 0; $a << 2
- while i<3; $a << 3
- i+=1; $a << 4
- j = 0; $a << 5
- while j<3; $a << 6
- j+=1; $a << 7
- begin; $a << 8
- raise; $a << 9
- rescue; $a << 10
- break; $a << 11
- end; $a << 12
- end; $a << 13
- end; $a << 14
-; $a << 15
-; rescue Exception; $a << 99; end; $a}
-assert_equal %q{[1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 14, 6, 7, 8, 9, 11, 14, 6, 7, 8, 9, 11, 14, 15, 3, 4, 5, 6, 7, 8, 9, 11, 14, 6, 7, 8, 9, 11, 14, 6, 7, 8, 9, 11, 14, 15, 3, 4, 5, 6, 7, 8, 9, 11, 14, 6, 7, 8, 9, 11, 14, 6, 7, 8, 9, 11, 14, 15, 16, 17]}, %q{$a = []; begin; ; $a << 1
- i = 0; $a << 2
- while i<3; $a << 3
- i+=1; $a << 4
- j = 0; $a << 5
- while j<3; $a << 6
- j+=1; $a << 7
- 1.times{; $a << 8
- begin; $a << 9
- raise; $a << 10
- rescue; $a << 11
- break; $a << 12
- end; $a << 13
- }; $a << 14
- end; $a << 15
- end; $a << 16
-; $a << 17
-; rescue Exception; $a << 99; end; $a}
-assert_equal %q{[1, 2, 3, 4, 5, 6, 7, 8, 10, 13, 3, 4, 5, 6, 7, 8, 10, 13, 3, 4, 5, 6, 7, 8, 10, 13, 14, 15]}, %q{$a = []; begin; ; $a << 1
- i = 0; $a << 2
- while i<3; $a << 3
- i+=1; $a << 4
- j = 0; $a << 5
- while j<3; $a << 6
- j+=1; $a << 7
- begin; $a << 8
- raise; $a << 9
- ensure; $a << 10
- break; $a << 11
- end; $a << 12
- end; $a << 13
- end; $a << 14
-; $a << 15
-; rescue Exception; $a << 99; end; $a}
-assert_equal %q{[1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 14, 6, 7, 8, 9, 11, 14, 6, 7, 8, 9, 11, 14, 15, 3, 4, 5, 6, 7, 8, 9, 11, 14, 6, 7, 8, 9, 11, 14, 6, 7, 8, 9, 11, 14, 15, 3, 4, 5, 6, 7, 8, 9, 11, 14, 6, 7, 8, 9, 11, 14, 6, 7, 8, 9, 11, 14, 15, 16, 17]}, %q{$a = []; begin; ; $a << 1
- i = 0; $a << 2
- while i<3; $a << 3
- i+=1; $a << 4
- j = 0; $a << 5
- while j<3; $a << 6
- j+=1; $a << 7
- 1.times{; $a << 8
- begin; $a << 9
- raise; $a << 10
- ensure; $a << 11
- break; $a << 12
- end; $a << 13
- }; $a << 14
- end; $a << 15
- end; $a << 16
-; $a << 17
-; rescue Exception; $a << 99; end; $a}
-assert_equal %q{[1, 2, 3, 5, 8, 9]}, %q{$a = []; begin; ; $a << 1
- while true; $a << 2
- begin; $a << 3
- break; $a << 4
- ensure; $a << 5
- break; $a << 6
- end; $a << 7
- end; $a << 8
-; $a << 9
-; rescue Exception; $a << 99; end; $a}
-assert_equal %q{[1, 2, 3, 5, 99]}, %q{
-$a = [];
-begin; ; $a << 1
- while true; $a << 2
- begin; $a << 3
- break; $a << 4
- ensure; $a << 5
- raise; $a << 6
- end; $a << 7
- end; $a << 8
-; $a << 9
-; rescue Exception; $a << 99; end; $a}
-assert_equal %q{[1, 2, 3, 4, 6, 8, 9, 10, 11]}, %q{$a = []; begin; ; $a << 1
- begin; $a << 2
- [1,2].each do; $a << 3
- begin; $a << 4
- break; $a << 5
- ensure; $a << 6
- end; $a << 7
- end; $a << 8
- ensure; $a << 9
- end; $a << 10
-; $a << 11
-; rescue Exception; $a << 99; end; $a}
-assert_equal %q{[1, 2, 4, 99]}, %q{$a = []; begin; ; $a << 1
- begin; $a << 2
- raise StandardError; $a << 3
- ensure; $a << 4
- end; $a << 5
-; $a << 6
-; rescue Exception; $a << 99; end; $a}
-assert_equal %q{[1, 2, 3, 4]}, %q{$a = []; begin; ; $a << 1
- begin; $a << 2
- ensure; $a << 3
- end ; $a << 4
-; rescue Exception; $a << 99; end; $a}
-assert_equal %q{[1, 2, 3, 5, 99]}, %q{$a = []; begin; ; $a << 1
- [1,2].each do; $a << 2
- begin; $a << 3
- break; $a << 4
- ensure; $a << 5
- raise StandardError; $a << 6
- end; $a << 7
- end; $a << 8
-; $a << 9
-; rescue Exception; $a << 99; end; $a}
-assert_equal %q{3}, %q{
- def m a, b
- a + b
- end
- m(1,
- while true
- break 2
- end
- )
-}
-assert_equal %q{4}, %q{
- def m a, b
- a + b
- end
- m(1,
- (i=0; while i<2
- i+=1
- class C
- next 2
- end
- end; 3)
- )
-}
-assert_equal %q{34}, %q{
- def m a, b
- a+b
- end
- m(1, 1.times{break 3}) +
- m(10, (1.times{next 3}; 20))
-}
-assert_equal %q{[1, 2, 3, 6, 7]}, %q{$a = []; begin; ; $a << 1
- 3.times{; $a << 2
- class C; $a << 3
- break; $a << 4
- end; $a << 5
- }; $a << 6
-; $a << 7
-; rescue Exception; $a << 99; end; $a}
-assert_equal %q{[1, 2, 3, 4, 8, 9]}, %q{$a = []; begin; ; $a << 1
- 3.times{; $a << 2
- class A; $a << 3
- class B; $a << 4
- break; $a << 5
- end; $a << 6
- end; $a << 7
- }; $a << 8
-; $a << 9
-; rescue Exception; $a << 99; end; $a}
-assert_equal %q{[1, 2, 3, 2, 3, 2, 3, 6, 7]}, %q{$a = []; begin; ; $a << 1
- 3.times{; $a << 2
- class C; $a << 3
- next; $a << 4
- end; $a << 5
- }; $a << 6
-; $a << 7
-; rescue Exception; $a << 99; end; $a}
-assert_equal %q{[1, 2, 3, 4, 2, 3, 4, 2, 3, 4, 8, 9]}, %q{$a = []; begin; ; $a << 1
- 3.times{; $a << 2
- class C; $a << 3
- class D; $a << 4
- next; $a << 5
- end; $a << 6
- end; $a << 7
- }; $a << 8
-; $a << 9
-; rescue Exception; $a << 99; end; $a}
-assert_equal %q{[1, 2, 3, 6, 7]}, %q{$a = []; begin; ; $a << 1
- while true; $a << 2
- class C; $a << 3
- break; $a << 4
- end; $a << 5
- end; $a << 6
-; $a << 7
-; rescue Exception; $a << 99; end; $a}
-assert_equal %q{[1, 2, 3, 4, 8, 9]}, %q{$a = []; begin; ; $a << 1
- while true; $a << 2
- class C; $a << 3
- class D; $a << 4
- break; $a << 5
- end; $a << 6
- end; $a << 7
- end; $a << 8
-; $a << 9
-; rescue Exception; $a << 99; end; $a}
-assert_equal %q{[1, 2, 3, 4, 5, 3, 4, 5, 3, 4, 5, 8, 9]}, %q{$a = []; begin; ; $a << 1
- i=0; $a << 2
- while i<3; $a << 3
- i+=1; $a << 4
- class C; $a << 5
- next 10; $a << 6
- end; $a << 7
- end; $a << 8
-; $a << 9
-; rescue Exception; $a << 99; end; $a}
-assert_equal %q{1}, %q{
- 1.times{
- while true
- class C
- begin
- break
- ensure
- break
- end
- end
- end
- }
-}
-assert_equal %q{[1, 2, 3, 5, 2, 3, 5, 7, 8]}, %q{$a = []; begin; ; $a << 1
- [1,2].each do; $a << 2
- begin; $a << 3
- next; $a << 4
- ensure; $a << 5
- end; $a << 6
- end; $a << 7
-; $a << 8
-; rescue Exception; $a << 99; end; $a}
-assert_equal %q{[1, 2, 6, 3, 5, 7, 8]}, %q{$a = []; begin; ; $a << 1
- o = "test"; $a << 2
- def o.test(a); $a << 3
- return a; $a << 4
- ensure; $a << 5
- end; $a << 6
- o.test(123); $a << 7
-; $a << 8
-; rescue Exception; $a << 99; end; $a}
-assert_equal %q{[1, 4, 7, 5, 8, 9]}, %q{$a = []; begin; ; $a << 1
- def m1 *args; $a << 2
- ; $a << 3
- end; $a << 4
- def m2; $a << 5
- m1(:a, :b, (return 1; :c)); $a << 6
- end; $a << 7
- m2; $a << 8
-; $a << 9
-; rescue Exception; $a << 99; end; $a}
-assert_equal %q{[1, 8, 2, 3, 4, 5, 9, 10]}, %q{$a = []; begin; ; $a << 1
- def m(); $a << 2
- begin; $a << 3
- 2; $a << 4
- ensure; $a << 5
- return 3; $a << 6
- end; $a << 7
- end; $a << 8
- m; $a << 9
-; $a << 10
-; rescue Exception; $a << 99; end; $a}
-assert_equal %q{[1, 3, 11, 4, 5, 6, 7, 12, 13]}, %q{$a = []; begin; ; $a << 1
- def m2; $a << 2
- end; $a << 3
- def m(); $a << 4
- m2(begin; $a << 5
- 2; $a << 6
- ensure; $a << 7
- return 3; $a << 8
- end); $a << 9
- 4; $a << 10
- end; $a << 11
- m(); $a << 12
-; $a << 13
-; rescue Exception; $a << 99; end; $a}
-assert_equal %q{[1, 16, 2, 3, 4, 5, 6, 7, 10, 11, 17, 18]}, %q{$a = []; begin; ; $a << 1
- def m; $a << 2
- 1; $a << 3
- 1.times{; $a << 4
- 2; $a << 5
- begin; $a << 6
- 3; $a << 7
- return; $a << 8
- 4; $a << 9
- ensure; $a << 10
- 5; $a << 11
- end; $a << 12
- 6; $a << 13
- }; $a << 14
- 7; $a << 15
- end; $a << 16
- m(); $a << 17
-; $a << 18
-; rescue Exception; $a << 99; end; $a}
-assert_equal %q{[:ok, :ok2, :last]}, %q{
- a = []
- i = 0
- begin
- while i < 1
- i+=1
- begin
- begin
- next
- ensure
- a << :ok
- end
- ensure
- a << :ok2
- end
- end
- ensure
- a << :last
- end
- a
-}
-assert_equal %q{[:ok, :ok2, :last]}, %q{
- a = []
- i = 0
- begin
- while i < 1
- i+=1
- begin
- begin
- break
- ensure
- a << :ok
- end
- ensure
- a << :ok2
- end
- end
- ensure
- a << :last
- end
- a
-}
-assert_equal %q{[:ok, :ok2, :last]}, %q{
- a = []
- i = 0
- begin
- while i < 1
- if i>0
- break
- end
- i+=1
- begin
- begin
- redo
- ensure
- a << :ok
- end
- ensure
- a << :ok2
- end
- end
- ensure
- a << :last
- end
- a
-}
-assert_equal %Q{ENSURE\n}, %q{
- def test
- while true
- return
- end
- ensure
- puts("ENSURE")
- end
- test
-}, '[ruby-dev:37967]'
-
diff --git a/bootstraptest/test_fork.rb b/bootstraptest/test_fork.rb
deleted file mode 100644
index 60a74e8a22..0000000000
--- a/bootstraptest/test_fork.rb
+++ /dev/null
@@ -1,28 +0,0 @@
-assert_equal '0', %q{
- begin
- GC.stress = true
- pid = fork {}
- Process.wait pid
- $?.to_i
- rescue NotImplementedError
- 0
- end
-}, '[ruby-dev:32404]'
-
-assert_finish 10, %q{
- begin
- children = (1..10).map{
- Thread.start{fork{}}.value
- }
- while !children.empty? and pid = Process.wait
- children.delete(pid)
- end
- rescue NotImplementedError
- end
-}, '[ruby-core:22158]'
-
-assert_normal_exit(<<'End', '[ruby-dev:37934]')
- Thread.new { sleep 1; Thread.kill Thread.main }
- Process.setrlimit(:NPROC, 1)
- fork {}
-End
diff --git a/bootstraptest/test_io.rb b/bootstraptest/test_io.rb
deleted file mode 100644
index 83b38f8cce..0000000000
--- a/bootstraptest/test_io.rb
+++ /dev/null
@@ -1,100 +0,0 @@
-assert_finish 5, %q{
- r, w = IO.pipe
- t1 = Thread.new { r.sysread(1) }
- t2 = Thread.new { r.sysread(1) }
- sleep 0.1
- w.write "a"
- sleep 0.1
- w.write "a"
-}, '[ruby-dev:31866]'
-
-assert_finish 10, %q{
- begin
- require "io/nonblock"
- r, w = IO.pipe
- w.nonblock = true
- w.write_nonblock("a" * 100000)
- w.nonblock = false
- t1 = Thread.new { w.write("b" * 4096) }
- t2 = Thread.new { w.write("c" * 4096) }
- sleep 0.5
- r.sysread(4096).length
- sleep 0.5
- r.sysread(4096).length
- t1.join
- t2.join
- rescue LoadError
- end
-}, '[ruby-dev:32566]'
-
-assert_finish 1, %q{
- r, w = IO.pipe
- Thread.new {
- w << "ab"
- sleep 0.1
- w << "ab"
- }
- r.gets("abab")
-}
-
-assert_equal 'ok', %q{
- require 'tmpdir'
- begin
- tmpname = "#{Dir.tmpdir}/ruby-btest-#{$$}-#{rand(0x100000000).to_s(36)}"
- rw = File.open(tmpname, File::RDWR|File::CREAT|File::EXCL)
- rescue Errno::EEXIST
- retry
- end
- save = STDIN.dup
- STDIN.reopen(rw)
- STDIN.reopen(save)
- rw.close
- File.unlink(tmpname)
- :ok
-}
-
-assert_equal 'ok', %q{
- require 'tmpdir'
- begin
- tmpname = "#{Dir.tmpdir}/ruby-btest-#{$$}-#{rand(0x100000000).to_s(36)}"
- rw = File.open(tmpname, File::RDWR|File::CREAT|File::EXCL)
- rescue Errno::EEXIST
- retry
- end
- save = STDIN.dup
- STDIN.reopen(rw)
- STDIN.print "a"
- STDIN.reopen(save)
- rw.close
- File.unlink(tmpname)
- :ok
-}
-
-assert_normal_exit %q{
- ARGF.set_encoding "foo"
-}
-
-50.times do
- assert_normal_exit %q{
- at_exit { p :foo }
-
- megacontent = "abc" * 12345678
- #File.open("megasrc", "w") {|f| f << megacontent }
-
- Thread.new { sleep rand*0.2; Process.kill(:INT, $$) }
-
- r1, w1 = IO.pipe
- r2, w2 = IO.pipe
- t1 = Thread.new { w1 << megacontent; w1.close }
- t2 = Thread.new { r2.read }
- IO.copy_stream(r1, w2) rescue nil
- r2.close; w2.close
- r1.close; w1.close
- }, '', ["INT"] or break
-end
-
-assert_normal_exit %q{
- r, w = IO.pipe
- STDOUT.reopen(w)
- STDOUT.reopen(__FILE__, "r")
-}, '[ruby-dev:38131]'
diff --git a/bootstraptest/test_jump.rb b/bootstraptest/test_jump.rb
deleted file mode 100644
index 77467337c2..0000000000
--- a/bootstraptest/test_jump.rb
+++ /dev/null
@@ -1,261 +0,0 @@
-assert_equal %q{ok}, %q{
- def m
- :ng1
- mm{
- yield
- }
- :ng2
- end
-
- def mm
- :ng3
- yield
- :ng4
- end
-
- m{
- break :ok
- }
-}
-assert_equal %q{ok}, %q{
- 3.times{
- break :ok
- }
-}
-assert_equal %q{}, %q{
- catch(:foo){
- throw :foo
- }
-}
-assert_equal %q{false}, %q{
- catch(:foo){
- throw :foo, false
- }
-}
-assert_equal %q{}, %q{
- catch(:foo){
- throw :foo, nil
- }
-}
-assert_equal %q{ok}, %q{
- catch(:foo){
- throw :foo, :ok
- }
-}
-assert_equal %q{}, %q{
- catch(:foo){
- 1.times{
- throw :foo
- }
- }
-}
-assert_equal %q{ok}, %q{
- catch(:foo){
- 1.times{
- throw :foo, :ok
- }
- }
-}
-assert_equal %q{ok}, %q{
- catch(:foo){
- catch(:bar){
- throw :foo, :ok
- }
- :ng
- }
-}
-assert_equal %q{ok}, %q{
- catch(:foo){
- catch(:bar){
- 1.times{
- throw :foo, :ok
- }
- }
- :ng
- }
-}
-assert_equal %q{2}, %q{
- module Enumerable
- def all_?
- self.each{|e|
- unless yield(e)
- return false
- end
- }
- true
- end
- end
-
- xxx = 0
- [1,2].each{|bi|
- [3,4].each{|bj|
- [true, nil, true].all_?{|be| be}
- break
- }
- xxx += 1
- }
- xxx
-}
-assert_equal %q{ok}, %q{
- def m
- yield
- end
-
- m{
- begin
- ensure
- break :ok
- end
- }
-}
-assert_equal %q{ok}, %q{
- def m
- yield
- :ok
- end
- i=0
- m{
- if i>10
- i*i
- else
- i+=1
- next
- end
- }
-}
-assert_equal %q{ok}, %q{
- def m
- yield
- end
-
- m{
- next :ok
- }
-}
-assert_equal %q{131}, %q{
- def m
- yield + 10
- end
- i=0
- m{
- if i>10
- i*i
- else
- i+=1
- redo
- end
- }
-}
-assert_equal %q{ok}, %q{
-begin
- eval %q{
- 1.times{
- retry
- }
- }
-rescue SyntaxError
- :ok
-end
-}
-assert_equal %q{3}, %q{
- def m
- return 3
- end
- m
-}
-assert_equal %q{ok}, %q{
- def m
- :ng1
- mm{
- return :ok
- }
- :ng2
- end
-
- def mm
- :ng3
- yield
- :ng4
- end
- m
-}
-assert_equal %q{100}, %q{
- $i = 0
- def m
- begin
- iter{
- return
- }
- ensure
- $i = 100
- end
- end
-
- def iter
- yield
- end
- m
- $i
-}
-assert_equal %q{ok}, %q{
- def m
- begin
- raise
- rescue
- return :ok
- end
- :ng
- end
- m
-}
-assert_equal %q{1}, %q{
- def m
- begin
- raise
- rescue
- return 1
- end
- end
-
- m
-}
-assert_equal %q{1}, %q{
- def m
- begin
- #
- ensure
- return 1
- end
- end
-
- m
-}
-assert_equal 'ok', %q{
- begin
- catch {|t| throw t, :ok }
- rescue ArgumentError
- :ng
- end
-}, '[ruby-dev:31609]'
-
-assert_equal "1", %q{
- catch do |t|
- begin
- throw t, 1
- 2
- ensure
- 3
- end
- end
-}, "[ruby-dev:31698]"
-
-assert_normal_exit %q{
- f = 0
- 1.times do
- begin
- f += 1
- ensure
- redo unless f > 2
- end
- end
-}
diff --git a/bootstraptest/test_literal.rb b/bootstraptest/test_literal.rb
deleted file mode 100644
index 8480c65308..0000000000
--- a/bootstraptest/test_literal.rb
+++ /dev/null
@@ -1,194 +0,0 @@
-# empty program
-assert_equal '', ''
-assert_equal '', ' '
-assert_equal '', "\n"
-
-# special const
-assert_equal 'true', 'true'
-assert_equal 'TrueClass', 'true.class'
-assert_equal 'false', 'false'
-assert_equal 'FalseClass', 'false.class'
-assert_equal '', 'nil'
-assert_equal 'nil', 'nil.inspect'
-assert_equal 'NilClass', 'nil.class'
-assert_equal 'sym', ':sym'
-assert_equal ':sym', ':sym.inspect'
-assert_equal 'Symbol', ':sym.class'
-assert_equal '1234', '1234'
-assert_equal 'Fixnum', '1234.class'
-assert_equal '1234', '1_2_3_4'
-assert_equal 'Fixnum', '1_2_3_4.class'
-assert_equal '18', '0x12'
-assert_equal 'Fixnum', '0x12.class'
-assert_equal '15', '0o17'
-assert_equal 'Fixnum', '0o17.class'
-assert_equal '5', '0b101'
-assert_equal 'Fixnum', '0b101.class'
-assert_equal '123456789012345678901234567890', '123456789012345678901234567890'
-assert_equal 'Bignum', '123456789012345678901234567890.class'
-assert_equal '2.0', '2.0'
-assert_equal 'Float', '1.3.class'
-
-# self
-assert_equal 'main', 'self'
-assert_equal 'Object', 'self.class'
-
-# string literal
-assert_equal 'a', '?a'
-assert_equal 'String', '?a.class'
-assert_equal 'A', '?A'
-assert_equal 'String', '?A.class'
-assert_equal "\n", '?\n'
-assert_equal 'String', '?\n.class'
-assert_equal ' ', '?\ '
-assert_equal 'String', '?\ .class'
-assert_equal 'string', "'string'"
-assert_equal 'string', '"string"'
-assert_equal 'string', '%(string)'
-assert_equal 'string', '%q(string)'
-assert_equal 'string', '%Q(string)'
-assert_equal 'string string', '"string string"'
-assert_equal ' ', '" "'
-assert_equal "\0", '"\0"'
-assert_equal "\1", '"\1"'
-assert_equal "3", '"\x33"'
-assert_equal "\n", '"\n"'
-
-# dynamic string literal
-assert_equal '2', '"#{1 + 1}"'
-assert_equal '16', '"#{2 ** 4}"'
-assert_equal 'string', 's = "string"; "#{s}"'
-
-# dynamic symbol literal
-assert_equal 'a3c', ':"a#{1+2}c"'
-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}`)
-
-# regexp
-assert_equal '', '//.source'
-assert_equal 'Regexp', '//.class'
-assert_equal '0', '// =~ "a"'
-assert_equal '0', '// =~ ""'
-assert_equal 'a', '/a/.source'
-assert_equal 'Regexp', '/a/.class'
-assert_equal '0', '/a/ =~ "a"'
-assert_equal '0', '/test/ =~ "test"'
-assert_equal '', '/test/ =~ "tes"'
-assert_equal '0', 're = /test/; re =~ "test"'
-assert_equal '0', 'str = "test"; /test/ =~ str'
-assert_equal '0', 're = /test/; str = "test"; re =~ str'
-
-# dynacmi regexp
-assert_equal 'regexp', %q(/re#{'ge'}xp/.source)
-assert_equal 'Regexp', %q(/re#{'ge'}xp/.class)
-
-# array
-assert_equal 'Array', '[].class'
-assert_equal '0', '[].size'
-assert_equal '0', '[].length'
-assert_equal '[]', '[].inspect'
-assert_equal 'Array', '[0].class'
-assert_equal '1', '[3].size'
-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 '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'
-assert_equal '1', 'a = [1,2]; a[0]'
-assert_equal '2', 'a = [1,2]; a[1]'
-assert_equal 'Array', 'a = [1 + 2, 3 + 4, 5 + 6]; a.class'
-assert_equal '[3, 7, 11]', 'a = [1 + 2, 3 + 4, 5 + 6]; a.inspect'
-assert_equal '7', 'a = [1 + 2, 3 + 4, 5 + 6]; a[1]'
-assert_equal '1', '([0][0] += 1)'
-assert_equal '1', '([2][0] -= 1)'
-assert_equal 'Array', 'a = [obj = Object.new]; a.class'
-assert_equal '1', 'a = [obj = Object.new]; a.size'
-assert_equal 'true', 'a = [obj = Object.new]; a[0] == obj'
-assert_equal '5', 'a = [1,2,3]; a[1] = 5; a[1]'
-assert_equal 'bar', '[*:foo];:bar'
-assert_equal '[1, 2]', 'def nil.to_a; [2]; end; [1, *nil]'
-assert_equal '[1, 2]', 'def nil.to_a; [1, 2]; end; [*nil]'
-assert_equal '[0, 1, {2=>3}]', '[0, *[1], 2=>3]', "[ruby-dev:31592]"
-
-
-# hash
-assert_equal 'Hash', '{}.class'
-assert_equal '{}', '{}.inspect'
-assert_equal 'Hash', '{1=>2}.class'
-assert_equal '{1=>2}', '{1=>2}.inspect'
-assert_equal '2', 'h = {1 => 2}; h[1]'
-assert_equal '0', 'h = {1 => 2}; h.delete(1); h.size'
-assert_equal '', 'h = {1 => 2}; h.delete(1); h[1]'
-assert_equal '2', 'h = {"string" => "literal", "goto" => "hell"}; h.size'
-assert_equal 'literal', 'h = {"string"=>"literal", "goto"=>"hell"}; h["string"]'
-assert_equal 'hell', 'h = {"string"=>"literal", "goto"=>"hell"}; h["goto"]'
-
-# range
-assert_equal 'Range', '(1..2).class'
-assert_equal '1..2', '(1..2).inspect'
-assert_equal '1', '(1..2).begin'
-assert_equal '2', '(1..2).end'
-assert_equal 'false', '(1..2).exclude_end?'
-assert_equal 'Range', 'r = 1..2; r.class'
-assert_equal '1..2', 'r = 1..2; r.inspect'
-assert_equal '1', 'r = 1..2; r.begin'
-assert_equal '2', 'r = 1..2; r.end'
-assert_equal 'false', 'r = 1..2; r.exclude_end?'
-assert_equal 'Range', '(1...3).class'
-assert_equal '1...3', '(1...3).inspect'
-assert_equal '1', '(1...3).begin'
-assert_equal '3', '(1...3).end'
-assert_equal 'true', '(1...3).exclude_end?'
-assert_equal 'Range', 'r = (1...3); r.class'
-assert_equal '1...3', 'r = (1...3); r.inspect'
-assert_equal '1', 'r = (1...3); r.begin'
-assert_equal '3', 'r = (1...3); r.end'
-assert_equal 'true', 'r = (1...3); r.exclude_end?'
-assert_equal 'Range', 'r = (1+2 .. 3+4); r.class'
-assert_equal '3..7', 'r = (1+2 .. 3+4); r.inspect'
-assert_equal '3', 'r = (1+2 .. 3+4); r.begin'
-assert_equal '7', 'r = (1+2 .. 3+4); r.end'
-assert_equal 'false', 'r = (1+2 .. 3+4); r.exclude_end?'
-assert_equal 'Range', 'r = (1+2 ... 3+4); r.class'
-assert_equal '3...7', 'r = (1+2 ... 3+4); r.inspect'
-assert_equal '3', 'r = (1+2 ... 3+4); r.begin'
-assert_equal '7', 'r = (1+2 ... 3+4); r.end'
-assert_equal 'true', 'r = (1+2 ... 3+4); r.exclude_end?'
-assert_equal 'Range', 'r = ("a".."c"); r.class'
-assert_equal '"a".."c"', 'r = ("a".."c"); r.inspect'
-assert_equal 'a', 'r = ("a".."c"); r.begin'
-assert_equal 'c', 'r = ("a".."c"); r.end'
-
-assert_equal 'String', '__FILE__.class'
-assert_equal 'Fixnum', '__LINE__.class'
-
-###
-
-assert_equal 'ok', %q{
- # this cause "called on terminated object".
- ObjectSpace.each_object(Module) {|m| m.name.inspect }
- :ok
-}
-
-assert_normal_exit %q{
- begin
- r = 0**-1
- r + r
- rescue
- end
-}, '[ruby-dev:34524]'
-
-assert_normal_exit %q{
- begin
- r = Marshal.load("\x04\bU:\rRational[\ai\x06i\x05")
- r + r
- rescue
- end
-}, '[ruby-dev:34536]'
diff --git a/bootstraptest/test_load.rb b/bootstraptest/test_load.rb
deleted file mode 100644
index e63c93a8f4..0000000000
--- a/bootstraptest/test_load.rb
+++ /dev/null
@@ -1,27 +0,0 @@
-assert_equal 'ok', %q{
- open("require-lock-test.rb", "w") {|f|
- f.puts "sleep 0.1"
- f.puts "module M"
- f.puts "end"
- }
- $:.unshift Dir.pwd
- vs = (1..2).map {|i|
- Thread.start {
- require "require-lock-test"
- M
- }
- }.map {|t| t.value }
- vs[0] == M && vs[1] == M ? :ok : :ng
-}, '[ruby-dev:32048]'
-
-assert_equal 'ok', %q{
- %w[a a/foo b].each {|d| Dir.mkdir(d)}
- open("b/foo", "w") {|f| f.puts "$ok = :ok"}
- $:.replace(%w[a b])
- begin
- load "foo"
- $ok
- rescue => e
- e.message
- end
-}, '[ruby-dev:38097]'
diff --git a/bootstraptest/test_marshal.rb b/bootstraptest/test_marshal.rb
deleted file mode 100644
index 7e34176169..0000000000
--- a/bootstraptest/test_marshal.rb
+++ /dev/null
@@ -1,5 +0,0 @@
-
-assert_normal_exit %q{
- Marshal.load(Marshal.dump({"k"=>"v"}), lambda {|v| v})
-}
-
diff --git a/bootstraptest/test_massign.rb b/bootstraptest/test_massign.rb
deleted file mode 100644
index 0f63dd424a..0000000000
--- a/bootstraptest/test_massign.rb
+++ /dev/null
@@ -1,183 +0,0 @@
-assert_equal '[[1], 2, 3]', '*v1, (a, b) = [1,[2, 3]]; [v1, a, b]'
-assert_equal '[[1], 2, 3]', '*v1,(*), (a, b) = [1,:x,[2, 3]]; [v1, a, b]'
-
-assert_equal '[]', '*a = *nil; a'
-assert_equal '[nil]', '*a = nil; a'
-assert_equal '2', 'a, a = 1, 2; a', "[ruby-dev:31522]"
-assert_equal '[1, 2]', 'a, b = 1, 2'
-assert_equal '[1, 2]', %q{
- ans = []
- trace_var(:$a){|v| ans << v}
- trace_var(:$b){|v| ans << v}
- $a, $b = 1, 2
- ans
-}
-
-assert_equal 'ok', %q{
- r = :ok
- :ng.tap {|(r)|}
- r
-}, '[ruby-dev:31507]'
-
-=begin
-# generated by this script:
-
-3.times{|i|
- 8.times{|e|
- ary = (0...e).to_a
- a,b,c,d,e,f = nil
- vals = %w(a b c d e f)
- vals[i] = '*' + vals[i]
- program = "#{vals.join(", ")} = *ary"
- eval(program)
- ans = [a,b,c,d,e,f]
- puts %Q{
- assert_equal "#{ans.inspect}", %q{
- ary = #{ary.inspect}
- #{program}; [a, b, c, d, e, f]
- }}
- }
-}
-=end
-
- assert_equal "[[], nil, nil, nil, nil, nil]", %q{
- ary = []
- *a, b, c, d, e, f = *ary; [a, b, c, d, e, f]
- }
-
- assert_equal "[[], 0, nil, nil, nil, nil]", %q{
- ary = [0]
- *a, b, c, d, e, f = *ary; [a, b, c, d, e, f]
- }
-
- assert_equal "[[], 0, 1, nil, nil, nil]", %q{
- ary = [0, 1]
- *a, b, c, d, e, f = *ary; [a, b, c, d, e, f]
- }
-
- assert_equal "[[], 0, 1, 2, nil, nil]", %q{
- ary = [0, 1, 2]
- *a, b, c, d, e, f = *ary; [a, b, c, d, e, f]
- }
-
- assert_equal "[[], 0, 1, 2, 3, nil]", %q{
- ary = [0, 1, 2, 3]
- *a, b, c, d, e, f = *ary; [a, b, c, d, e, f]
- }
-
- assert_equal "[[], 0, 1, 2, 3, 4]", %q{
- ary = [0, 1, 2, 3, 4]
- *a, b, c, d, e, f = *ary; [a, b, c, d, e, f]
- }
-
- assert_equal "[[0], 1, 2, 3, 4, 5]", %q{
- ary = [0, 1, 2, 3, 4, 5]
- *a, b, c, d, e, f = *ary; [a, b, c, d, e, f]
- }
-
- assert_equal "[[0, 1], 2, 3, 4, 5, 6]", %q{
- ary = [0, 1, 2, 3, 4, 5, 6]
- *a, b, c, d, e, f = *ary; [a, b, c, d, e, f]
- }
-
- assert_equal "[nil, [], nil, nil, nil, nil]", %q{
- ary = []
- a, *b, c, d, e, f = *ary; [a, b, c, d, e, f]
- }
-
- assert_equal "[0, [], nil, nil, nil, nil]", %q{
- ary = [0]
- a, *b, c, d, e, f = *ary; [a, b, c, d, e, f]
- }
-
- assert_equal "[0, [], 1, nil, nil, nil]", %q{
- ary = [0, 1]
- a, *b, c, d, e, f = *ary; [a, b, c, d, e, f]
- }
-
- assert_equal "[0, [], 1, 2, nil, nil]", %q{
- ary = [0, 1, 2]
- a, *b, c, d, e, f = *ary; [a, b, c, d, e, f]
- }
-
- assert_equal "[0, [], 1, 2, 3, nil]", %q{
- ary = [0, 1, 2, 3]
- a, *b, c, d, e, f = *ary; [a, b, c, d, e, f]
- }
-
- assert_equal "[0, [], 1, 2, 3, 4]", %q{
- ary = [0, 1, 2, 3, 4]
- a, *b, c, d, e, f = *ary; [a, b, c, d, e, f]
- }
-
- assert_equal "[0, [1], 2, 3, 4, 5]", %q{
- ary = [0, 1, 2, 3, 4, 5]
- a, *b, c, d, e, f = *ary; [a, b, c, d, e, f]
- }
-
- assert_equal "[0, [1, 2], 3, 4, 5, 6]", %q{
- ary = [0, 1, 2, 3, 4, 5, 6]
- a, *b, c, d, e, f = *ary; [a, b, c, d, e, f]
- }
-
- assert_equal "[nil, nil, [], nil, nil, nil]", %q{
- ary = []
- a, b, *c, d, e, f = *ary; [a, b, c, d, e, f]
- }
-
- assert_equal "[0, nil, [], nil, nil, nil]", %q{
- ary = [0]
- a, b, *c, d, e, f = *ary; [a, b, c, d, e, f]
- }
-
- assert_equal "[0, 1, [], nil, nil, nil]", %q{
- ary = [0, 1]
- a, b, *c, d, e, f = *ary; [a, b, c, d, e, f]
- }
-
- assert_equal "[0, 1, [], 2, nil, nil]", %q{
- ary = [0, 1, 2]
- a, b, *c, d, e, f = *ary; [a, b, c, d, e, f]
- }
-
- assert_equal "[0, 1, [], 2, 3, nil]", %q{
- ary = [0, 1, 2, 3]
- a, b, *c, d, e, f = *ary; [a, b, c, d, e, f]
- }
-
- assert_equal "[0, 1, [], 2, 3, 4]", %q{
- ary = [0, 1, 2, 3, 4]
- a, b, *c, d, e, f = *ary; [a, b, c, d, e, f]
- }
-
- assert_equal "[0, 1, [2], 3, 4, 5]", %q{
- ary = [0, 1, 2, 3, 4, 5]
- a, b, *c, d, e, f = *ary; [a, b, c, d, e, f]
- }
-
- assert_equal "[0, 1, [2, 3], 4, 5, 6]", %q{
- ary = [0, 1, 2, 3, 4, 5, 6]
- a, b, *c, d, e, f = *ary; [a, b, c, d, e, f]
- }
-
-
-#
-assert_equal 'ok', %q{
- a,s=[],"aaa"
- 300.times { a<<s; s=s.succ }
- eval <<-END__
- GC.stress=true
- Fiber.new do
- #{ a.join(",") },*zzz=1
- end.resume
- END__
- :ok
-}, '[ruby-dev:32581]'
-
-assert_equal 'ok', %q{
- while true
- *, z = 1
- break
- end
- :ok
-}, '[ruby-dev:32892]'
diff --git a/bootstraptest/test_method.rb b/bootstraptest/test_method.rb
deleted file mode 100644
index 8953a0d4d1..0000000000
--- a/bootstraptest/test_method.rb
+++ /dev/null
@@ -1,1153 +0,0 @@
-# regular argument
-assert_equal '1', 'def m() 1 end; m()'
-assert_equal '1', 'def m(a) a end; m(1)'
-assert_equal '[1, 2]', 'def m(a,b) [a, b] end; m(1,2)'
-assert_equal '[1, 2, 3]', 'def m(a,b,c) [a, b, c] end; m(1,2,3)'
-assert_equal 'wrong number of arguments (1 for 0)', %q{
- def m; end
- begin
- m(1)
- rescue => e
- e.message
- end
-}
-
-assert_equal 'wrong number of arguments (0 for 1)', %q{
- def m a; end
- begin
- m
- rescue => e
- e.message
- end
-}
-
-# default argument
-assert_equal '1', 'def m(x=1) x end; m()'
-assert_equal '1', 'def m(x=7) x end; m(1)'
-assert_equal '1', 'def m(a,x=1) x end; m(7)'
-assert_equal '1', 'def m(a,x=7) x end; m(7,1)'
-assert_equal '1', 'def m(a,b,x=1) x end; m(7,7)'
-assert_equal '1', 'def m(a,b,x=7) x end; m(7,7,1)'
-assert_equal '1', 'def m(a,x=1,y=1) x end; m(7)'
-assert_equal '1', 'def m(a,x=1,y=1) y end; m(7)'
-assert_equal '1', 'def m(a,x=7,y=1) x end; m(7,1)'
-assert_equal '1', 'def m(a,x=7,y=1) y end; m(7,1)'
-assert_equal '1', 'def m(a,x=7,y=7) x end; m(7,1,1)'
-assert_equal '1', 'def m(a,x=7,y=7) y end; m(7,1,1)'
-
-# rest argument
-assert_equal '[]', 'def m(*a) a end; m().inspect'
-assert_equal '[1]', 'def m(*a) a end; m(1).inspect'
-assert_equal '[1, 2]', 'def m(*a) a end; m(1,2).inspect'
-assert_equal '[]', 'def m(x,*a) a end; m(7).inspect'
-assert_equal '[1]', 'def m(x,*a) a end; m(7,1).inspect'
-assert_equal '[1, 2]', 'def m(x,*a) a end; m(7,1,2).inspect'
-assert_equal '[]', 'def m(x,y,*a) a end; m(7,7).inspect'
-assert_equal '[1]', 'def m(x,y,*a) a end; m(7,7,1).inspect'
-assert_equal '[1, 2]', 'def m(x,y,*a) a end; m(7,7,1,2).inspect'
-assert_equal '[]', 'def m(x,y=7,*a) a end; m(7).inspect'
-assert_equal '[]', 'def m(x,y,z=7,*a) a end; m(7,7).inspect'
-assert_equal '[]', 'def m(x,y,z=7,*a) a end; m(7,7,7).inspect'
-assert_equal '[]', 'def m(x,y,z=7,zz=7,*a) a end; m(7,7,7).inspect'
-assert_equal '[]', 'def m(x,y,z=7,zz=7,*a) a end; m(7,7,7,7).inspect'
-assert_equal '1', 'def m(x,y,z=7,zz=1,*a) zz end; m(7,7,7).inspect'
-assert_equal '1', 'def m(x,y,z=7,zz=1,*a) zz end; m(7,7,7).inspect'
-assert_equal '1', 'def m(x,y,z=7,zz=7,*a) zz end; m(7,7,7,1).inspect'
-
-# block argument
-assert_equal 'Proc', 'def m(&block) block end; m{}.class'
-assert_equal 'nil', 'def m(&block) block end; m().inspect'
-assert_equal 'Proc', 'def m(a,&block) block end; m(7){}.class'
-assert_equal 'nil', 'def m(a,&block) block end; m(7).inspect'
-assert_equal '1', 'def m(a,&block) a end; m(1){}'
-assert_equal 'Proc', 'def m(a,b=nil,&block) block end; m(7){}.class'
-assert_equal 'nil', 'def m(a,b=nil,&block) block end; m(7).inspect'
-assert_equal 'Proc', 'def m(a,b=nil,&block) block end; m(7,7){}.class'
-assert_equal '1', 'def m(a,b=nil,&block) b end; m(7,1){}'
-assert_equal 'Proc', 'def m(a,b=nil,*c,&block) block end; m(7){}.class'
-assert_equal 'nil', 'def m(a,b=nil,*c,&block) block end; m(7).inspect'
-assert_equal '1', 'def m(a,b=nil,*c,&block) a end; m(1).inspect'
-assert_equal '1', 'def m(a,b=1,*c,&block) b end; m(7).inspect'
-assert_equal '1', 'def m(a,b=7,*c,&block) b end; m(7,1).inspect'
-assert_equal '[1]', 'def m(a,b=7,*c,&block) c end; m(7,7,1).inspect'
-
-# splat
-assert_equal '1', 'def m(a) a end; m(*[1])'
-assert_equal '1', 'def m(x,a) a end; m(7,*[1])'
-assert_equal '1', 'def m(x,y,a) a end; m(7,7,*[1])'
-assert_equal '1', 'def m(a,b) a end; m(*[1,7])'
-assert_equal '1', 'def m(a,b) b end; m(*[7,1])'
-assert_equal '1', 'def m(x,a,b) b end; m(7,*[7,1])'
-assert_equal '1', 'def m(x,y,a,b) b end; m(7,7,*[7,1])'
-assert_equal '1', 'def m(a,b,c) a end; m(*[1,7,7])'
-assert_equal '1', 'def m(a,b,c) b end; m(*[7,1,7])'
-assert_equal '1', 'def m(a,b,c) c end; m(*[7,7,1])'
-assert_equal '1', 'def m(x,a,b,c) a end; m(7,*[1,7,7])'
-assert_equal '1', 'def m(x,y,a,b,c) a end; m(7,7,*[1,7,7])'
-
-# hash argument
-assert_equal '1', 'def m(h) h end; m(7=>1)[7]'
-assert_equal '1', 'def m(h) h end; m(7=>1).size'
-assert_equal '1', 'def m(h) h end; m(7=>1, 8=>7)[7]'
-assert_equal '2', 'def m(h) h end; m(7=>1, 8=>7).size'
-assert_equal '1', 'def m(h) h end; m(7=>1, 8=>7, 9=>7)[7]'
-assert_equal '3', 'def m(h) h end; m(7=>1, 8=>7, 9=>7).size'
-assert_equal '1', 'def m(x,h) h end; m(7, 7=>1)[7]'
-assert_equal '1', 'def m(x,h) h end; m(7, 7=>1, 8=>7)[7]'
-assert_equal '1', 'def m(x,h) h end; m(7, 7=>1, 8=>7, 9=>7)[7]'
-assert_equal '1', 'def m(x,y,h) h end; m(7,7, 7=>1)[7]'
-assert_equal '1', 'def m(x,y,h) h end; m(7,7, 7=>1, 8=>7)[7]'
-assert_equal '1', 'def m(x,y,h) h end; m(7,7, 7=>1, 8=>7, 9=>7)[7]'
-
-# block argument
-assert_equal '1', %q(def m(&block) mm(&block) end
- def mm() yield 1 end
- m {|a| a })
-assert_equal '1', %q(def m(x,&block) mm(x,&block) end
- def mm(x) yield 1 end
- m(7) {|a| a })
-assert_equal '1', %q(def m(x,y,&block) mm(x,y,&block) end
- def mm(x,y) yield 1 end
- m(7,7) {|a| a })
-
-# recursive call
-assert_equal '1', %q(def m(n) n == 0 ? 1 : m(n-1) end; m(5))
-
-# instance method
-assert_equal '1', %q(class C; def m() 1 end end; C.new.m)
-assert_equal '1', %q(class C; def m(a) a end end; C.new.m(1))
-assert_equal '1', %q(class C; def m(a = 1) a end end; C.new.m)
-assert_equal '[1]', %q(class C; def m(*a) a end end; C.new.m(1).inspect)
-assert_equal '1', %q( class C
- def m() mm() end
- def mm() 1 end
- end
- C.new.m )
-
-# singleton method (const)
-assert_equal '1', %q(class C; def C.m() 1 end end; C.m)
-assert_equal '1', %q(class C; def C.m(a) a end end; C.m(1))
-assert_equal '1', %q(class C; def C.m(a = 1) a end end; C.m)
-assert_equal '[1]', %q(class C; def C.m(*a) a end end; C.m(1).inspect)
-assert_equal '1', %q(class C; end; def C.m() 1 end; C.m)
-assert_equal '1', %q(class C; end; def C.m(a) a end; C.m(1))
-assert_equal '1', %q(class C; end; def C.m(a = 1) a end; C.m)
-assert_equal '[1]', %q(class C; end; def C.m(*a) a end; C.m(1).inspect)
-assert_equal '1', %q(class C; def m() 7 end end; def C.m() 1 end; C.m)
-assert_equal '1', %q( class C
- def C.m() mm() end
- def C.mm() 1 end
- end
- C.m )
-
-# singleton method (lvar)
-assert_equal '1', %q(obj = Object.new; def obj.m() 1 end; obj.m)
-assert_equal '1', %q(obj = Object.new; def obj.m(a) a end; obj.m(1))
-assert_equal '1', %q(obj = Object.new; def obj.m(a=1) a end; obj.m)
-assert_equal '[1]', %q(obj = Object.new; def obj.m(*a) a end; obj.m(1))
-assert_equal '1', %q(class C; def m() 7 end; end
- obj = C.new
- def obj.m() 1 end
- obj.m)
-
-# inheritance
-assert_equal '1', %q(class A; def m(a) a end end
- class B < A; end
- B.new.m(1))
-assert_equal '1', %q(class A; end
- class B < A; def m(a) a end end
- B.new.m(1))
-assert_equal '1', %q(class A; def m(a) a end end
- class B < A; end
- class C < B; end
- C.new.m(1))
-
-# include
-assert_equal '1', %q(class A; def m(a) a end end
- module M; end
- class B < A; include M; end
- B.new.m(1))
-assert_equal '1', %q(class A; end
- module M; def m(a) a end end
- class B < A; include M; end
- B.new.m(1))
-
-# alias
-assert_equal '1', %q( def a() 1 end
- alias m a
- m() )
-assert_equal '1', %q( class C
- def a() 1 end
- alias m a
- end
- C.new.m )
-assert_equal '1', %q( class C
- def a() 1 end
- alias :m a
- end
- C.new.m )
-assert_equal '1', %q( class C
- def a() 1 end
- alias m :a
- end
- C.new.m )
-assert_equal '1', %q( class C
- def a() 1 end
- alias :m :a
- end
- C.new.m )
-assert_equal '1', %q( class C
- def a() 1 end
- alias m a
- undef a
- end
- C.new.m )
-
-# undef
-assert_equal '1', %q( class C
- def m() end
- undef m
- end
- begin C.new.m; rescue NoMethodError; 1 end )
-assert_equal '1', %q( class A
- def m() end
- end
- class C < A
- def m() end
- undef m
- end
- begin C.new.m; rescue NoMethodError; 1 end )
-assert_equal '1', %q( class A; def a() end end # [yarv-dev:999]
- class B < A
- def b() end
- undef a, b
- end
- begin B.new.a; rescue NoMethodError; 1 end )
-assert_equal '1', %q( class A; def a() end end # [yarv-dev:999]
- class B < A
- def b() end
- undef a, b
- end
- begin B.new.b; rescue NoMethodError; 1 end )
-
-assert_equal '3', %q{
- def m1
- 1
- end
- alias m2 m1
- alias :"#{'m3'}" m1
- m1 + m2 + m3
-}, '[ruby-dev:32308]'
-assert_equal '1', %q{
- def foobar
- end
- undef :"foo#{:bar}"
- 1
-}, '[ruby-dev:32308]'
-assert_equal '1', %q{
- def foobar
- 1
- end
- alias :"bar#{:baz}" :"foo#{:bar}"
- barbaz
-}, '[ruby-dev:32308]'
-
-# private
-assert_equal '1', %q( class C
- def m() mm() end
- def mm() 1 end
- private :mm
- end
- C.new.m )
-assert_equal '1', %q( class C
- def m() 7 end
- private :m
- end
- begin C.m; rescue NoMethodError; 1 end )
-assert_equal '1', %q( class C
- def C.m() mm() end
- def C.mm() 1 end
- private_class_method :mm
- end
- C.m )
-assert_equal '1', %q( class C
- def C.m() 7 end
- private_class_method :m
- end
- begin C.m; rescue NoMethodError; 1 end )
-assert_equal '1', %q( class C; def m() 1 end end
- C.new.m # cache
- class C
- alias mm m; private :mm
- end
- C.new.m
- begin C.new.mm; 7; rescue NoMethodError; 1 end )
-
-# nested method
-assert_equal '1', %q( class C
- def m
- def mm() 1 end
- end
- end
- C.new.m
- C.new.mm )
-assert_equal '1', %q( class C
- def m
- def mm() 1 end
- end
- end
- instance_eval "C.new.m; C.new.mm" )
-
-# method_missing
-assert_equal ':m', %q( class C
- def method_missing(mid, *args) mid end
- end
- C.new.m.inspect )
-assert_equal ':mm', %q( class C
- def method_missing(mid, *args) mid end
- end
- C.new.mm.inspect )
-assert_equal '[1, 2]', %q( class C
- def method_missing(mid, *args) args end
- end
- C.new.m(1,2).inspect )
-assert_equal '1', %q( class C
- def method_missing(mid, *args) yield 1 end
- end
- C.new.m {|a| a })
-assert_equal 'nil', %q( class C
- def method_missing(mid, *args, &block) block end
- end
- C.new.m.inspect )
-
-# send
-assert_equal '1', %q( class C; def m() 1 end end;
- C.new.__send__(:m) )
-assert_equal '1', %q( class C; def m() 1 end end;
- C.new.send(:m) )
-assert_equal '1', %q( class C; def m(a) a end end;
- C.new.send(:m,1) )
-assert_equal '1', %q( class C; def m(a,b) a end end;
- C.new.send(:m,1,7) )
-assert_equal '1', %q( class C; def m(x,a=1) a end end;
- C.new.send(:m,7) )
-assert_equal '1', %q( class C; def m(x,a=7) a end end;
- C.new.send(:m,7,1) )
-assert_equal '[1, 2]', %q( class C; def m(*a) a end end;
- C.new.send(:m,1,2).inspect )
-assert_equal '1', %q( class C; def m() 7 end; private :m end
- begin C.new.public_send(:m); rescue NoMethodError; 1 end )
-assert_equal '1', %q( class C; def m() 1 end; private :m end
- C.new.send(:m) )
-
-# with block
-assert_equal '[[:ok1, :foo], [:ok2, :foo, :bar]]',
-%q{
- class C
- def [](a)
- $ary << [yield, a]
- end
- def []=(a, b)
- $ary << [yield, a, b]
- end
- end
-
- $ary = []
- C.new[:foo, &lambda{:ok1}]
- C.new[:foo, &lambda{:ok2}] = :bar
- $ary
-}
-
-# with
-assert_equal '[:ok1, [:ok2, 11]]', %q{
- class C
- def []
- $ary << :ok1
- 10
- end
- def []=(a)
- $ary << [:ok2, a]
- end
- end
- $ary = []
- C.new[]+=1
- $ary
-}
-
-# splat and block arguments
-assert_equal %q{[[[:x, :y, :z], NilClass], [[1, :x, :y, :z], NilClass], [[1, 2, :x, :y, :z], NilClass], [[:obj], NilClass], [[1, :obj], NilClass], [[1, 2, :obj], NilClass], [[], Proc], [[1], Proc], [[1, 2], Proc], [[], Proc], [[1], Proc], [[1, 2], Proc], [[:x, :y, :z], Proc], [[1, :x, :y, :z], Proc], [[1, 2, :x, :y, :z], Proc]]}, %q{
-def m(*args, &b)
- $result << [args, b.class]
-end
-$result = []
-ary = [:x, :y, :z]
-obj = :obj
-b = Proc.new{}
-
-m(*ary)
-m(1,*ary)
-m(1,2,*ary)
-m(*obj)
-m(1,*obj)
-m(1,2,*obj)
-m(){}
-m(1){}
-m(1,2){}
-m(&b)
-m(1,&b)
-m(1,2,&b)
-m(*ary,&b)
-m(1,*ary,&b)
-m(1,2,*ary,&b)
-$result
-}
-
-# post test
-assert_equal %q{[1, 2, :o1, :o2, [], 3, 4, NilClass, nil, nil]}, %q{
-def m(m1, m2, o1=:o1, o2=:o2, *r, p1, p2, &b)
- x, y = :x, :y if $foo
- [m1, m2, o1, o2, r, p1, p2, b.class, x, y]
-end
-; m(1, 2, 3, 4)}
-
-assert_equal %q{[1, 2, 3, :o2, [], 4, 5, NilClass, nil, nil]}, %q{
-def m(m1, m2, o1=:o1, o2=:o2, *r, p1, p2, &b)
- x, y = :x, :y if $foo
- [m1, m2, o1, o2, r, p1, p2, b.class, x, y]
-end
-; m(1, 2, 3, 4, 5)}
-
-assert_equal %q{[1, 2, 3, 4, [], 5, 6, NilClass, nil, nil]}, %q{
-def m(m1, m2, o1=:o1, o2=:o2, *r, p1, p2, &b)
- x, y = :x, :y if $foo
- [m1, m2, o1, o2, r, p1, p2, b.class, x, y]
-end
-; m(1, 2, 3, 4, 5, 6)}
-
-assert_equal %q{[1, 2, 3, 4, [5], 6, 7, NilClass, nil, nil]}, %q{
-def m(m1, m2, o1=:o1, o2=:o2, *r, p1, p2, &b)
- x, y = :x, :y if $foo
- [m1, m2, o1, o2, r, p1, p2, b.class, x, y]
-end
-; m(1, 2, 3, 4, 5, 6, 7)}
-
-assert_equal %q{[1, 2, 3, 4, [5, 6], 7, 8, NilClass, nil, nil]}, %q{
-def m(m1, m2, o1=:o1, o2=:o2, *r, p1, p2, &b)
- x, y = :x, :y if $foo
- [m1, m2, o1, o2, r, p1, p2, b.class, x, y]
-end
-; m(1, 2, 3, 4, 5, 6, 7, 8)}
-
-assert_equal %q{[1, 2, 3, 4, [5, 6, 7], 8, 9, NilClass, nil, nil]}, %q{
-def m(m1, m2, o1=:o1, o2=:o2, *r, p1, p2, &b)
- x, y = :x, :y if $foo
- [m1, m2, o1, o2, r, p1, p2, b.class, x, y]
-end
-; m(1, 2, 3, 4, 5, 6, 7, 8, 9)}
-
-assert_equal %q{[1, 2, 3, 4, [5, 6, 7, 8], 9, 10, NilClass, nil, nil]}, %q{
-def m(m1, m2, o1=:o1, o2=:o2, *r, p1, p2, &b)
- x, y = :x, :y if $foo
- [m1, m2, o1, o2, r, p1, p2, b.class, x, y]
-end
-; m(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)}
-
-assert_equal %q{[1, 2, 3, 4, [5, 6, 7, 8, 9], 10, 11, NilClass, nil, nil]}, %q{
-def m(m1, m2, o1=:o1, o2=:o2, *r, p1, p2, &b)
- x, y = :x, :y if $foo
- [m1, m2, o1, o2, r, p1, p2, b.class, x, y]
-end
-; m(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11)}
-
-assert_equal %q{[1, 2, :o1, :o2, [], 3, 4, Proc, nil, nil]}, %q{
-def m(m1, m2, o1=:o1, o2=:o2, *r, p1, p2, &b)
- x, y = :x, :y if $foo
- [m1, m2, o1, o2, r, p1, p2, b.class, x, y]
-end
-; m(1, 2, 3, 4){}}
-
-assert_equal %q{[1, 2, 3, :o2, [], 4, 5, Proc, nil, nil]}, %q{
-def m(m1, m2, o1=:o1, o2=:o2, *r, p1, p2, &b)
- x, y = :x, :y if $foo
- [m1, m2, o1, o2, r, p1, p2, b.class, x, y]
-end
-; m(1, 2, 3, 4, 5){}}
-
-assert_equal %q{[1, 2, 3, 4, [], 5, 6, Proc, nil, nil]}, %q{
-def m(m1, m2, o1=:o1, o2=:o2, *r, p1, p2, &b)
- x, y = :x, :y if $foo
- [m1, m2, o1, o2, r, p1, p2, b.class, x, y]
-end
-; m(1, 2, 3, 4, 5, 6){}}
-
-assert_equal %q{[1, 2, 3, 4, [5], 6, 7, Proc, nil, nil]}, %q{
-def m(m1, m2, o1=:o1, o2=:o2, *r, p1, p2, &b)
- x, y = :x, :y if $foo
- [m1, m2, o1, o2, r, p1, p2, b.class, x, y]
-end
-; m(1, 2, 3, 4, 5, 6, 7){}}
-
-assert_equal %q{[1, 2, 3, 4, [5, 6], 7, 8, Proc, nil, nil]}, %q{
-def m(m1, m2, o1=:o1, o2=:o2, *r, p1, p2, &b)
- x, y = :x, :y if $foo
- [m1, m2, o1, o2, r, p1, p2, b.class, x, y]
-end
-; m(1, 2, 3, 4, 5, 6, 7, 8){}}
-
-assert_equal %q{[1, 2, 3, 4, [5, 6, 7], 8, 9, Proc, nil, nil]}, %q{
-def m(m1, m2, o1=:o1, o2=:o2, *r, p1, p2, &b)
- x, y = :x, :y if $foo
- [m1, m2, o1, o2, r, p1, p2, b.class, x, y]
-end
-; m(1, 2, 3, 4, 5, 6, 7, 8, 9){}}
-
-assert_equal %q{[1, 2, 3, 4, [5, 6, 7, 8], 9, 10, Proc, nil, nil]}, %q{
-def m(m1, m2, o1=:o1, o2=:o2, *r, p1, p2, &b)
- x, y = :x, :y if $foo
- [m1, m2, o1, o2, r, p1, p2, b.class, x, y]
-end
-; m(1, 2, 3, 4, 5, 6, 7, 8, 9, 10){}}
-
-assert_equal %q{[1, 2, 3, 4, [5, 6, 7, 8, 9], 10, 11, Proc, nil, nil]}, %q{
-def m(m1, m2, o1=:o1, o2=:o2, *r, p1, p2, &b)
- x, y = :x, :y if $foo
- [m1, m2, o1, o2, r, p1, p2, b.class, x, y]
-end
-; m(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11){}}
-
-assert_equal %q{[1, 2, :o1, :o2, [], 3, 4, nil, nil]}, %q{
-def m(m1, m2, o1=:o1, o2=:o2, *r, p1, p2)
- x, y = :x, :y if $foo
- [m1, m2, o1, o2, r, p1, p2, x, y]
-end
-; m(1, 2, 3, 4)}
-
-assert_equal %q{[1, 2, 3, :o2, [], 4, 5, nil, nil]}, %q{
-def m(m1, m2, o1=:o1, o2=:o2, *r, p1, p2)
- x, y = :x, :y if $foo
- [m1, m2, o1, o2, r, p1, p2, x, y]
-end
-; m(1, 2, 3, 4, 5)}
-
-assert_equal %q{[1, 2, 3, 4, [], 5, 6, nil, nil]}, %q{
-def m(m1, m2, o1=:o1, o2=:o2, *r, p1, p2)
- x, y = :x, :y if $foo
- [m1, m2, o1, o2, r, p1, p2, x, y]
-end
-; m(1, 2, 3, 4, 5, 6)}
-
-
-#
-# super
-#
-=begin
-# below programs are generated by this program:
-
-BASE = <<EOS__
-class C0; def m *args; [:C0_m, args]; end; end
-class C1 < C0; <TEST>; super; end; end
-EOS__
-
-tests = {
-%q{
- def m
-} => %q{
- C1.new.m
-},
-#
-%q{
- def m a
-} => %q{
- C1.new.m 1
-},
-%q{
- def m a
- a = :a
-} => %q{
- C1.new.m 1
-},
-#
-%q{
- def m a, o=:o
-} => %q{
- C1.new.m 1
- C1.new.m 1, 2
-},
-%q{
- def m a, o=:o
- a = :a
-} => %q{
- C1.new.m 1
- C1.new.m 1, 2
-},
-%q{
- def m a, o=:o
- o = :x
-} => %q{
- C1.new.m 1
- C1.new.m 1, 2
-},
-#
-%q{
- def m a, *r
-} => %q{
- C1.new.m 1
- C1.new.m 1, 2
- C1.new.m 1, 2, 3
-},
-%q{
- def m a, *r
- r = [:x, :y]
-} => %q{
- C1.new.m 1
- C1.new.m 1, 2
- C1.new.m 1, 2, 3
-},
-#
-%q{
- def m a, o=:o, *r
-} => %q{
- C1.new.m 1
- C1.new.m 1, 2
- C1.new.m 1, 2, 3
- C1.new.m 1, 2, 3, 4
-},
-#
-%q{
- def m a, o=:o, *r, &b
-} => %q{
- C1.new.m 1
- C1.new.m 1, 2
- C1.new.m 1, 2, 3
- C1.new.m 1, 2, 3, 4
- C1.new.m(1){}
- C1.new.m(1, 2){}
- C1.new.m(1, 2, 3){}
- C1.new.m(1, 2, 3, 4){}
-},
-#
-"def m(m1, m2, o1=:o1, o2=:o2, p1, p2)" =>
-%q{
-C1.new.m(1,2,3,4)
-C1.new.m(1,2,3,4,5)
-C1.new.m(1,2,3,4,5,6)
-},
-#
-"def m(m1, m2, *r, p1, p2)" =>
-%q{
-C1.new.m(1,2,3,4)
-C1.new.m(1,2,3,4,5)
-C1.new.m(1,2,3,4,5,6)
-C1.new.m(1,2,3,4,5,6,7)
-C1.new.m(1,2,3,4,5,6,7,8)
-},
-#
-"def m(m1, m2, o1=:o1, o2=:o2, *r, p1, p2)" =>
-%q{
-C1.new.m(1,2,3,4)
-C1.new.m(1,2,3,4,5)
-C1.new.m(1,2,3,4,5,6)
-C1.new.m(1,2,3,4,5,6,7)
-C1.new.m(1,2,3,4,5,6,7,8)
-C1.new.m(1,2,3,4,5,6,7,8,9)
-},
-
-###
-}
-
-
-tests.each{|setup, methods| setup = setup.dup; setup.strip!
- setup = BASE.gsub(/<TEST>/){setup}
- methods.split(/\n/).each{|m| m = m.dup; m.strip!
- next if m.empty?
- expr = "#{setup}; #{m}"
- result = eval(expr)
- puts "assert_equal %q{#{result.inspect}}, %q{\n#{expr}}"
- puts
- }
-}
-
-=end
-
-assert_equal %q{[:C0_m, [1, 2, :o1, :o2, 3, 4]]}, %q{
-class C0; def m *args; [:C0_m, args]; end; end
-class C1 < C0; def m(m1, m2, o1=:o1, o2=:o2, p1, p2); super; end; end
-; C1.new.m(1,2,3,4)}
-
-assert_equal %q{[:C0_m, [1, 2, 3, :o2, 4, 5]]}, %q{
-class C0; def m *args; [:C0_m, args]; end; end
-class C1 < C0; def m(m1, m2, o1=:o1, o2=:o2, p1, p2); super; end; end
-; C1.new.m(1,2,3,4,5)}
-
-assert_equal %q{[:C0_m, [1, 2, 3, 4, 5, 6]]}, %q{
-class C0; def m *args; [:C0_m, args]; end; end
-class C1 < C0; def m(m1, m2, o1=:o1, o2=:o2, p1, p2); super; end; end
-; C1.new.m(1,2,3,4,5,6)}
-
-assert_equal %q{[:C0_m, [1, :o]]}, %q{
-class C0; def m *args; [:C0_m, args]; end; end
-class C1 < C0; def m a, o=:o, *r; super; end; end
-; C1.new.m 1}
-
-assert_equal %q{[:C0_m, [1, 2]]}, %q{
-class C0; def m *args; [:C0_m, args]; end; end
-class C1 < C0; def m a, o=:o, *r; super; end; end
-; C1.new.m 1, 2}
-
-assert_equal %q{[:C0_m, [1, 2, 3]]}, %q{
-class C0; def m *args; [:C0_m, args]; end; end
-class C1 < C0; def m a, o=:o, *r; super; end; end
-; C1.new.m 1, 2, 3}
-
-assert_equal %q{[:C0_m, [1, 2, 3, 4]]}, %q{
-class C0; def m *args; [:C0_m, args]; end; end
-class C1 < C0; def m a, o=:o, *r; super; end; end
-; C1.new.m 1, 2, 3, 4}
-
-assert_equal %q{[:C0_m, [:a]]}, %q{
-class C0; def m *args; [:C0_m, args]; end; end
-class C1 < C0; def m a
- a = :a; super; end; end
-; C1.new.m 1}
-
-assert_equal %q{[:C0_m, [1, 2, 3, 4]]}, %q{
-class C0; def m *args; [:C0_m, args]; end; end
-class C1 < C0; def m(m1, m2, *r, p1, p2); super; end; end
-; C1.new.m(1,2,3,4)}
-
-assert_equal %q{[:C0_m, [1, 2, 3, 4, 5]]}, %q{
-class C0; def m *args; [:C0_m, args]; end; end
-class C1 < C0; def m(m1, m2, *r, p1, p2); super; end; end
-; C1.new.m(1,2,3,4,5)}
-
-assert_equal %q{[:C0_m, [1, 2, 3, 4, 5, 6]]}, %q{
-class C0; def m *args; [:C0_m, args]; end; end
-class C1 < C0; def m(m1, m2, *r, p1, p2); super; end; end
-; C1.new.m(1,2,3,4,5,6)}
-
-assert_equal %q{[:C0_m, [1, 2, 3, 4, 5, 6, 7]]}, %q{
-class C0; def m *args; [:C0_m, args]; end; end
-class C1 < C0; def m(m1, m2, *r, p1, p2); super; end; end
-; C1.new.m(1,2,3,4,5,6,7)}
-
-assert_equal %q{[:C0_m, [1, 2, 3, 4, 5, 6, 7, 8]]}, %q{
-class C0; def m *args; [:C0_m, args]; end; end
-class C1 < C0; def m(m1, m2, *r, p1, p2); super; end; end
-; C1.new.m(1,2,3,4,5,6,7,8)}
-
-assert_equal %q{[:C0_m, [1, :o]]}, %q{
-class C0; def m *args; [:C0_m, args]; end; end
-class C1 < C0; def m a, o=:o, *r, &b; super; end; end
-; C1.new.m 1}
-
-assert_equal %q{[:C0_m, [1, 2]]}, %q{
-class C0; def m *args; [:C0_m, args]; end; end
-class C1 < C0; def m a, o=:o, *r, &b; super; end; end
-; C1.new.m 1, 2}
-
-assert_equal %q{[:C0_m, [1, 2, 3]]}, %q{
-class C0; def m *args; [:C0_m, args]; end; end
-class C1 < C0; def m a, o=:o, *r, &b; super; end; end
-; C1.new.m 1, 2, 3}
-
-assert_equal %q{[:C0_m, [1, 2, 3, 4]]}, %q{
-class C0; def m *args; [:C0_m, args]; end; end
-class C1 < C0; def m a, o=:o, *r, &b; super; end; end
-; C1.new.m 1, 2, 3, 4}
-
-assert_equal %q{[:C0_m, [1, :o]]}, %q{
-class C0; def m *args; [:C0_m, args]; end; end
-class C1 < C0; def m a, o=:o, *r, &b; super; end; end
-; C1.new.m(1){}}
-
-assert_equal %q{[:C0_m, [1, 2]]}, %q{
-class C0; def m *args; [:C0_m, args]; end; end
-class C1 < C0; def m a, o=:o, *r, &b; super; end; end
-; C1.new.m(1, 2){}}
-
-assert_equal %q{[:C0_m, [1, 2, 3]]}, %q{
-class C0; def m *args; [:C0_m, args]; end; end
-class C1 < C0; def m a, o=:o, *r, &b; super; end; end
-; C1.new.m(1, 2, 3){}}
-
-assert_equal %q{[:C0_m, [1, 2, 3, 4]]}, %q{
-class C0; def m *args; [:C0_m, args]; end; end
-class C1 < C0; def m a, o=:o, *r, &b; super; end; end
-; C1.new.m(1, 2, 3, 4){}}
-
-assert_equal %q{[:C0_m, [1, :x]]}, %q{
-class C0; def m *args; [:C0_m, args]; end; end
-class C1 < C0; def m a, o=:o
- o = :x; super; end; end
-; C1.new.m 1}
-
-assert_equal %q{[:C0_m, [1, :x]]}, %q{
-class C0; def m *args; [:C0_m, args]; end; end
-class C1 < C0; def m a, o=:o
- o = :x; super; end; end
-; C1.new.m 1, 2}
-
-assert_equal %q{[:C0_m, [:a, :o]]}, %q{
-class C0; def m *args; [:C0_m, args]; end; end
-class C1 < C0; def m a, o=:o
- a = :a; super; end; end
-; C1.new.m 1}
-
-assert_equal %q{[:C0_m, [:a, 2]]}, %q{
-class C0; def m *args; [:C0_m, args]; end; end
-class C1 < C0; def m a, o=:o
- a = :a; super; end; end
-; C1.new.m 1, 2}
-
-assert_equal %q{[:C0_m, [1]]}, %q{
-class C0; def m *args; [:C0_m, args]; end; end
-class C1 < C0; def m a; super; end; end
-; C1.new.m 1}
-
-assert_equal %q{[:C0_m, [1, :x, :y]]}, %q{
-class C0; def m *args; [:C0_m, args]; end; end
-class C1 < C0; def m a, *r
- r = [:x, :y]; super; end; end
-; C1.new.m 1}
-
-assert_equal %q{[:C0_m, [1, :x, :y]]}, %q{
-class C0; def m *args; [:C0_m, args]; end; end
-class C1 < C0; def m a, *r
- r = [:x, :y]; super; end; end
-; C1.new.m 1, 2}
-
-assert_equal %q{[:C0_m, [1, :x, :y]]}, %q{
-class C0; def m *args; [:C0_m, args]; end; end
-class C1 < C0; def m a, *r
- r = [:x, :y]; super; end; end
-; C1.new.m 1, 2, 3}
-
-assert_equal %q{[:C0_m, [1, 2, :o1, :o2, 3, 4]]}, %q{
-class C0; def m *args; [:C0_m, args]; end; end
-class C1 < C0; def m(m1, m2, o1=:o1, o2=:o2, *r, p1, p2); super; end; end
-; C1.new.m(1,2,3,4)}
-
-assert_equal %q{[:C0_m, [1, 2, 3, :o2, 4, 5]]}, %q{
-class C0; def m *args; [:C0_m, args]; end; end
-class C1 < C0; def m(m1, m2, o1=:o1, o2=:o2, *r, p1, p2); super; end; end
-; C1.new.m(1,2,3,4,5)}
-
-assert_equal %q{[:C0_m, [1, 2, 3, 4, 5, 6]]}, %q{
-class C0; def m *args; [:C0_m, args]; end; end
-class C1 < C0; def m(m1, m2, o1=:o1, o2=:o2, *r, p1, p2); super; end; end
-; C1.new.m(1,2,3,4,5,6)}
-
-assert_equal %q{[:C0_m, [1, 2, 3, 4, 5, 6, 7]]}, %q{
-class C0; def m *args; [:C0_m, args]; end; end
-class C1 < C0; def m(m1, m2, o1=:o1, o2=:o2, *r, p1, p2); super; end; end
-; C1.new.m(1,2,3,4,5,6,7)}
-
-assert_equal %q{[:C0_m, [1, 2, 3, 4, 5, 6, 7, 8]]}, %q{
-class C0; def m *args; [:C0_m, args]; end; end
-class C1 < C0; def m(m1, m2, o1=:o1, o2=:o2, *r, p1, p2); super; end; end
-; C1.new.m(1,2,3,4,5,6,7,8)}
-
-assert_equal %q{[:C0_m, [1, 2, 3, 4, 5, 6, 7, 8, 9]]}, %q{
-class C0; def m *args; [:C0_m, args]; end; end
-class C1 < C0; def m(m1, m2, o1=:o1, o2=:o2, *r, p1, p2); super; end; end
-; C1.new.m(1,2,3,4,5,6,7,8,9)}
-
-assert_equal %q{[:C0_m, [1]]}, %q{
-class C0; def m *args; [:C0_m, args]; end; end
-class C1 < C0; def m a, *r; super; end; end
-; C1.new.m 1}
-
-assert_equal %q{[:C0_m, [1, 2]]}, %q{
-class C0; def m *args; [:C0_m, args]; end; end
-class C1 < C0; def m a, *r; super; end; end
-; C1.new.m 1, 2}
-
-assert_equal %q{[:C0_m, [1, 2, 3]]}, %q{
-class C0; def m *args; [:C0_m, args]; end; end
-class C1 < C0; def m a, *r; super; end; end
-; C1.new.m 1, 2, 3}
-
-assert_equal %q{[:C0_m, []]}, %q{
-class C0; def m *args; [:C0_m, args]; end; end
-class C1 < C0; def m; super; end; end
-; C1.new.m}
-
-assert_equal %q{[:C0_m, [1, :o]]}, %q{
-class C0; def m *args; [:C0_m, args]; end; end
-class C1 < C0; def m a, o=:o; super; end; end
-; C1.new.m 1}
-
-assert_equal %q{[:C0_m, [1, 2]]}, %q{
-class C0; def m *args; [:C0_m, args]; end; end
-class C1 < C0; def m a, o=:o; super; end; end
-; C1.new.m 1, 2}
-
-assert_equal %q{[:ok, :ok, :ok, :ok, :ok, :ok, :ng, :ng]}, %q{
- $ans = []
- class Foo
- def m
- end
- end
-
- c1 = c2 = nil
-
- lambda{
- $SAFE = 4
- c1 = Class.new{
- def m
- end
- }
- c2 = Class.new(Foo){
- alias mm m
- }
- }.call
-
- def test
- begin
- yield
- rescue SecurityError
- $ans << :ok
- else
- $ans << :ng
- end
- end
-
- o1 = c1.new
- o2 = c2.new
-
- test{o1.m}
- test{o2.mm}
- test{o1.send :m}
- test{o2.send :mm}
- test{o1.public_send :m}
- test{o2.public_send :mm}
- test{o1.method(:m).call}
- test{o2.method(:mm).call}
- $ans
-}
-
-assert_equal 'ok', %q{
- class C
- def x=(n)
- end
- def m
- self.x = :ok
- end
- end
- C.new.m
-}
-
-assert_equal 'ok', %q{
- proc{
- $SAFE = 1
- class C
- def m
- :ok
- end
- end
- }.call
- C.new.m
-}, '[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
- class C < B
- undef m
- begin
- remove_method :m
- rescue NameError
- end
- end
- begin
- C.new.m
- rescue NameError
- :ok
- end
-}, '[ruby-dev:31816], [ruby-dev:31817]'
-
-assert_normal_exit %q{
- begin
- Process.setrlimit(Process::RLIMIT_STACK, 4_202_496)
- # FreeBSD fails this less than 4M + 8K bytes.
- rescue Exception
- exit
- end
- class C
- attr "a" * (10*1024*1024)
- end
-}, '[ruby-dev:31818]'
-
-assert_equal 'ok', %q{
- class Module
- def define_method2(name, &block)
- define_method(name, &block)
- end
- end
- class C
- define_method2(:m) {|x, y| :fail }
- end
- begin
- C.new.m([1,2])
- rescue ArgumentError
- :ok
- end
-}
-
-assert_not_match /method_missing/, %q{
- STDERR.reopen(STDOUT)
- variable_or_mehtod_not_exist
-}
-
-assert_equal '[false, false, false, false, true, true]', %q{
- class C
- define_method(:foo) {
- block_given?
- }
- end
-
- C.new.foo {}
-
- class D
- def foo
- D.module_eval{
- define_method(:m1){
- block_given?
- }
- }
- end
- def bar
- D.module_eval{
- define_method(:m2){
- block_given?
- }
- }
- end
- end
-
- D.new.foo
- D.new.bar{}
- [C.new.foo, C.new.foo{}, D.new.m1, D.new.m1{}, D.new.m2, D.new.m2{}]
-}, '[ruby-core:14813]'
-
-assert_equal 'ok', %q{
- class Foo
- define_method(:foo) do |&b|
- b.call
- end
- end
- Foo.new.foo do
- break :ok
- end
-}, '[ruby-dev:36028]'
-
-assert_equal '[1, 2, [3, 4]]', %q{
- def regular(a, b, *c)
- [a, b, c]
- end
- regular(*[], 1, *[], *[2, 3], *[], 4)
-}, '[ruby-core:19413]'
-
-assert_equal '[1, [:foo, 3, 4, :foo]]', %q{
- def regular(a, *b)
- [a, b]
- end
- a = b = [:foo]
- regular(1, *a, *[3, 4], *b)
-}
-
-assert_equal '["B", "A"]', %q{
- class A
- def m
- 'A'
- end
- end
-
- class B < A
- define_method(:m) do
- ['B', super()]
- end
- end
-
- class C < B
- end
-
- C.new.m
-}
-
-assert_equal 'ok', %q{
- module Foo
- def foo
- begin
- super
- rescue NoMethodError
- :ok
- end
- end
- module_function :foo
- end
- Foo.foo
-}, '[ruby-dev:37587]'
-
-assert_equal 'Object#foo', %q{
- class Object
- def self.foo
- "Object.foo"
- end
- def foo
- "Object#foo"
- end
- end
-
- module Foo
- def foo
- begin
- super
- rescue NoMethodError
- :ok
- end
- end
- module_function :foo
- end
- Foo.foo
-}, '[ruby-dev:37587]'
-
-assert_normal_exit %q{
- class BasicObject
- remove_method :method_missing
- end
- begin
- "a".lalala!
- rescue NoMethodError => e
- e.message == "undefined method `lalala!' for \"a\":String" ? :ok : :ng
- end
-}, '[ruby-core:22298]'
diff --git a/bootstraptest/test_objectspace.rb b/bootstraptest/test_objectspace.rb
deleted file mode 100644
index 486d5aff73..0000000000
--- a/bootstraptest/test_objectspace.rb
+++ /dev/null
@@ -1,34 +0,0 @@
-assert_normal_exit %q{
- eval("", TOPLEVEL_BINDING)
- minobj = ObjectSpace.to_enum(:each_object).min_by {|a| a.object_id }
- maxobj = ObjectSpace.to_enum(:each_object).max_by {|a| a.object_id }
- (((minobj.object_id-100)..(minobj.object_id+100))+
- ((maxobj.object_id-100)..(maxobj.object_id+100))).each {|id|
- begin
- o = ObjectSpace._id2ref(id)
- rescue RangeError
- next
- end
- o.inspect if defined?(o.inspect)
- }
-}, '[ruby-dev:31911]'
-
-assert_normal_exit %q{
- ary = (1..10).to_a
- ary.permutation(2) {|x|
- if x == [1,2]
- ObjectSpace.each_object(String) {|s|
- s.clear if !s.frozen? && (s.length == 40 || s.length == 80)
- }
- end
- }
-}, '[ruby-dev:31982]'
-
-assert_normal_exit %q{
- ary = (1..100).to_a
- ary.permutation(2) {|x|
- if x == [1,2]
- ObjectSpace.each_object(Array) {|o| o.clear if o == ary && o.object_id != ary.object_id }
- end
- }
-}, '[ruby-dev:31985]'
diff --git a/bootstraptest/test_proc.rb b/bootstraptest/test_proc.rb
deleted file mode 100644
index 28a23777a3..0000000000
--- a/bootstraptest/test_proc.rb
+++ /dev/null
@@ -1,431 +0,0 @@
-assert_equal %q{[1, 2, 3]}, %q{
- def getproc &b
- b
- end
-
- def m
- yield
- end
-
- m{
- i = 1
- m{
- j = 2
- m{
- k = 3
- getproc{
- [i, j, k]
- }
- }
- }
- }.call
-}
-assert_equal %q{7}, %q{
- def make_proc(&b)
- b
- end
-
- def make_closure
- a = 0
- make_proc{
- a+=1
- }
- end
-
- cl = make_closure
- cl.call + cl.call * cl.call
-}
-assert_equal %q{ok}, %q{
- class C
- def foo
- :ok
- end
- end
-
- def block
- C.method(:new).to_proc
- end
- b = block()
- b.call.foo
-}
-assert_equal %q{[0, 1, :last, 0, 2, :last]}, %q{
- def proc &b
- b
- end
-
- pr = []
- proc{|i_b|
- p3 = proc{|j_b|
- pr << proc{|k_b|
- [i_b, j_b, k_b]
- }
- }
- p3.call(1)
- p3.call(2)
- }.call(0)
-
- pr[0].call(:last).concat pr[1].call(:last)
-}
-assert_equal %q{12}, %q{
- def iter
- yield
- end
-
- def getproc &b
- b
- end
-
- iter{
- bvar = 3
- getproc{
- bvar2 = 4
- bvar * bvar2
- }
- }.call
-}
-assert_equal %q{200}, %q{
- def iter
- yield
- end
-
- def getproc &b
- b
- end
-
- loc1 = 0
- pr1 = iter{
- bl1 = 1
- getproc{
- loc1 += 1
- bl1 += 1
- loc1 + bl1
- }
- }
-
- pr2 = iter{
- bl1 = 1
- getproc{
- loc1 += 1
- bl1 += 1
- loc1 + bl1
- }
- }
-
- pr1.call; pr2.call
- pr1.call; pr2.call
- pr1.call; pr2.call
- (pr1.call + pr2.call) * loc1
-}
-assert_equal %q{[1, 2]}, %q{
- def proc(&pr)
- pr
- end
-
- def m
- a = 1
- m2{
- a
- }
- end
-
- def m2
- b = 2
- proc{
- [yield, b]
- }
- end
-
- pr = m
- x = ['a', 1,2,3,4,5,6,7,8,9,0,
- 1,2,3,4,5,6,7,8,9,0,
- 1,2,3,4,5,6,7,8,9,0,
- 1,2,3,4,5,6,7,8,9,0,
- 1,2,3,4,5,6,7,8,9,0,]
- pr.call
-}
-assert_equal %q{1}, %q{
- def proc(&pr)
- pr
- end
-
- def m
- a = 1
- m2{
- a
- }
- end
-
- def m2
- b = 2
- proc{
- [yield, b]
- }
- 100000.times{|x|
- "#{x}"
- }
- yield
- end
- m
-}
-assert_equal %q{[:C, :C]}, %q{
- Const = :top
- class C
- Const = :C
- $pr = proc{
- (1..2).map{
- Const
- }
- }
- end
- $pr.call
-}
-assert_equal %q{top}, %q{
- Const = :top
- class C
- Const = :C
- end
- pr = proc{
- Const
- }
- C.class_eval %q{
- pr.call
- }
-}
-assert_equal %q{1}, %q{
- def m(&b)
- b
- end
-
- m{|e_proctest| e_proctest}.call(1)
-}
-assert_equal %q{12}, %q{
- def m(&b)
- b
- end
-
- m{|e_proctest1, e_proctest2|
- a = e_proctest1 * e_proctest2 * 2
- a * 3
- }.call(1, 2)
-}
-assert_equal %q{[[], [1], [1, 2], [1, 2, 3]]}, %q{
- [
- Proc.new{|*args| args}.call(),
- Proc.new{|*args| args}.call(1),
- Proc.new{|*args| args}.call(1, 2),
- Proc.new{|*args| args}.call(1, 2, 3),
- ]
-}
-assert_equal %q{[[nil, []], [1, []], [1, [2]], [1, [2, 3]]]}, %q{
- [
- Proc.new{|a, *b| [a, b]}.call(),
- Proc.new{|a, *b| [a, b]}.call(1),
- Proc.new{|a, *b| [a, b]}.call(1, 2),
- Proc.new{|a, *b| [a, b]}.call(1, 2, 3),
- ]
-}
-assert_equal %q{0}, %q{
- pr = proc{
- $SAFE
- }
- $SAFE = 1
- pr.call
-}
-assert_equal %q{[1, 0]}, %q{
- pr = proc{
- $SAFE += 1
- }
- [pr.call, $SAFE]
-}
-assert_equal %q{1}, %q{
- def m(&b)
- b
- end
- m{1}.call
-}
-assert_equal %q{3}, %q{
- def m(&b)
- b
- end
-
- m{
- a = 1
- a + 2
- }.call
-}
-assert_equal %Q{ok\n}, %q{
- class A; def get_block; proc {puts "ok"} end end
- block = A.new.get_block
- GC.start
- block.call
-}, '[ruby-core:14885]'
-
-assert_equal 'ok', %q{
- a = lambda {|x, y, &b| b }
- b = a.curry[1]
- if b.call(2){} == nil
- :ng
- else
- :ok
- end
-}, '[ruby-core:15551]'
-
-assert_equal 'ok', %q{
- lambda {
- break :ok
- :ng
- }.call
-}, '[ruby-dev:34646]'
-
-assert_equal %q{[:bar, :foo]}, %q{
- def foo
- klass = Class.new do
- define_method(:bar) do
- return :bar
- end
- end
- [klass.new.bar, :foo]
- end
- foo
-}, "[ ruby-Bugs-19304 ]"
-
-assert_equal 'ok', %q{
- $x = :ok
- def def7(x, y)
- x[y]
- $x = :ng
- end
- def test_def7
- def7(lambda {|x| x.call}, Proc.new {return})
- $x = :ng
- end
- test_def7
- $x
-}, '[ruby-core:17164]'
-
-assert_equal 'ok', %q{
- lambda { a = lambda { return }; $x = :ng; a[]; $x = :ok }.call
- $x
-}, '[ruby-core:17164]'
-
-assert_equal 'ok', %q{
- lambda { a = lambda { break }; $x = :ng; a[]; $x = :ok }.call
- $x
-}, '[ruby-core:17164]'
-
-assert_equal 'ok', %q{
- def def8
- $x = :ng
- lambda { a = Proc.new { return }; a[]}.call
- $x = :ok
- end
- def8
- $x
-}, '[ruby-core:17164]'
-
-
-assert_equal 'ok', %q{
- def def9
- lambda {|a| $x = :ok; a[]; $x = :ng }.call(Proc.new { return })
- $x = :ng
- end
- def9
- $x
-}, '[ruby-core:17164]'
-
-assert_equal 'ok', %q{
- def def10
- $x = :ng
- lambda { 1.times { return } }.call
- $x = :ok
- end
- $x = :ok
- def10
- $x
-}, '[ruby-core:17164]'
-
-assert_equal 'ok', %q{
- def def11
- yield
- end
- begin
- lambda { def11 { return } }.call
- rescue LocalJumpError
- :ng
- else
- :ok
- end
-}, '[ruby-core:17164]'
-
-assert_equal 'ok', %q{
- def def12
- b = Proc.new { $x = :ng; lambda { return }.call; $x = :ok }.call
- end
- def12
- $x
-}, '[ruby-core:17164]'
-
-assert_equal 'ok', %q{
- def m
- pr = proc{
- proc{
- return :ok
- }
- }.call
- pr.call
- :ng
- end
- m()
-}
-
-assert_equal 'ok', %q{
- class Foo
- def call_it
- p = Proc.new
- p.call
- end
- end
-
- def give_it
- proc { :ok }
- end
-
- f = Foo.new
- a_proc = give_it
- f.call_it(&give_it())
-}, '[ruby-core:15711]'
-
-assert_equal 'foo!', %q{
- class FooProc < Proc
- def initialize
- @foo = "foo!"
- end
-
- def bar
- @foo
- end
- end
-
- def bar
- FooProc.new &lambda{
- p 1
- }
- end
-
- fp = bar(&lambda{
- p 2
- })
-
- fp.bar
-}, 'Subclass of Proc'
-
-assert_equal 'ok', %q{
- o = Object.new
- def o.write(s); end
- $stderr = o
- at_exit{
- print $!.message
- }
- raise "ok"
-}
-
diff --git a/bootstraptest/test_struct.rb b/bootstraptest/test_struct.rb
deleted file mode 100644
index a65964d5f9..0000000000
--- a/bootstraptest/test_struct.rb
+++ /dev/null
@@ -1,5 +0,0 @@
-assert_equal 'Struct::Foo', %q{
- Struct.instance_eval { const_set(:Foo, nil) }
- Struct.new("Foo")
- Struct::Foo
-}
diff --git a/bootstraptest/test_syntax.rb b/bootstraptest/test_syntax.rb
deleted file mode 100644
index a9005a4292..0000000000
--- a/bootstraptest/test_syntax.rb
+++ /dev/null
@@ -1,830 +0,0 @@
-assert_equal %q{4}, %q{1 && 2 && 3 && 4}
-assert_equal %q{}, %q{1 && nil && 3 && 4}
-assert_equal %q{}, %q{1 && 2 && 3 && nil}
-assert_equal %q{false}, %q{1 && 2 && 3 && false}
-assert_equal %q{4}, %q{1 and 2 and 3 and 4}
-assert_equal %q{}, %q{1 and nil and 3 and 4}
-assert_equal %q{}, %q{1 and 2 and 3 and nil}
-assert_equal %q{false}, %q{1 and 2 and 3 and false}
-assert_equal %q{}, %q{nil && true}
-assert_equal %q{false}, %q{false && true}
-assert_equal %q{}, %q{
- case 1
- when 2
- :ng
- end}
-assert_equal %q{ok}, %q{
- case 1
- when 10,20,30
- :ng1
- when 1,2,3
- :ok
- when 100,200,300
- :ng2
- else
- :elseng
- end}
-assert_equal %q{elseok}, %q{
- case 123
- when 10,20,30
- :ng1
- when 1,2,3
- :ng2
- when 100,200,300
- :ng3
- else
- :elseok
- end
-}
-assert_equal %q{ok}, %q{
- case 'test'
- when /testx/
- :ng1
- when /test/
- :ok
- when /tetxx/
- :ng2
- else
- :ng_else
- end
-}
-assert_equal %q{ok}, %q{
- case Object.new
- when Object
- :ok
- end
-}
-assert_equal %q{ok}, %q{
- case Object
- when Object.new
- :ng
- else
- :ok
- end
-}
-assert_equal %q{ok}, %q{
- case 'test'
- when 'tes'
- :ng
- when 'te'
- :ng
- else
- :ok
- end
-}
-assert_equal %q{ok}, %q{
- case 'test'
- when 'tes'
- :ng
- when 'te'
- :ng
- when 'test'
- :ok
- end
-}
-assert_equal %q{ng}, %q{
- case 'test'
- when 'tes'
- :ng
- when /te/
- :ng
- else
- :ok
- end
-}
-assert_equal %q{ok}, %q{
- case 'test'
- when 'tes'
- :ng
- when /test/
- :ok
- else
- :ng
- end
-}
-assert_equal %q{100}, %q{
- def test(arg)
- case 1
- when 2
- 3
- end
- return arg
- end
-
- test(100)
-}
-assert_equal %q{ok}, %q{
- ary = [1, 2]
- case 1
- when *ary
- :ok
- else
- :ng
- end
-}
-assert_equal %q{ok}, %q{
- ary = [1, 2]
- case 3
- when *ary
- :ng
- else
- :ok
- end
-}
-assert_equal %q{ok}, %q{
- ary = [1, 2]
- case 1
- when :x, *ary
- :ok
- when :z
- :ng1
- else
- :ng2
- end
-}
-assert_equal %q{ok}, %q{
- ary = [1, 2]
- case 3
- when :x, *ary
- :ng1
- when :z
- :ng2
- else
- :ok
- end
-}
-assert_equal %q{[:false, :false, :false, :false, :false, :false, :false, :false, :false, :false, :false, :then, :false, :false, :false, :then, :false, :false, :false, :then, :false, :false, :false, :then, :false, :false, :then, :then, :false, :false, :then, :then, :false, :false, :then, :then, :false, :false, :then, :then, :false, :then, :then, :then, :false, :then, :then, :then, :false, :then, :then, :then, :false, :then, :then, :then, :then, :then, :then, :then, :then, :then, :then, :then, :false, :false, :false, :then, :false, :false, :false, :then, :false, :false, :false, :false, :false, :false, :false, :false, :false, :false, :then, :then, :false, :false, :then, :then, :false, :false, :false, :then, :false, :false, :false, :then, :false, :then, :then, :then, :false, :then, :then, :then, :false, :false, :then, :then, :false, :false, :then, :then, :then, :then, :then, :then, :then, :then, :then, :then, :false, :then, :then, :then, :false, :then, :then, :then, :false, :false, :false, :then, :false, :false, :false, :then, :false, :false, :then, :then, :false, :false, :then, :then, :false, :false, :false, :false, :false, :false, :false, :false, :false, :false, :false, :then, :false, :false, :false, :then, :false, :then, :then, :then, :false, :then, :then, :then, :then, :then, :then, :then, :then, :then, :then, :then, :false, :false, :then, :then, :false, :false, :then, :then, :false, :then, :then, :then, :false, :then, :then, :then, :false, :false, :then, :then, :false, :false, :then, :then, :false, :false, :false, :then, :false, :false, :false, :then, :false, :false, :false, :then, :false, :false, :false, :then, :false, :false, :false, :false, :false, :false, :false, :false, :then, :then, :then, :then, :then, :then, :then, :then, :false, :then, :then, :then, :false, :then, :then, :then, :false, :then, :then, :then, :false, :then, :then, :then, :false, :false, :then, :then, :false, :false, :then, :then, :false, :false, :then, :then, :false, :false, :then, :then, :false, :then, :then, :then, :false, :then, :then, :then, :false, :then, :then, :then, :false, :then, :then, :then, :then, :then, :then, :then, :then, :then, :then, :then, :false, :false, :false, :false, :false, :false, :false, :false, :false, :false, :false, :then, :false, :false, :false, :then, :false, :false, :false, :then, :false, :false, :false, :then, :false, :false, :then, :then, :false, :false, :then, :then, :false, :then, :then, :then, :false, :then, :then, :then, :false, :false, :then, :then, :false, :false, :then, :then, :then, :then, :then, :then, :then, :then, :then, :then, :false, :then, :then, :then, :false, :then, :then, :then, :false, :false, :false, :then, :false, :false, :false, :then, :false, :false, :false, :false, :false, :false, :false, :false, :false, :false, :then, :then, :false, :false, :then, :then, :false, :false, :false, :then, :false, :false, :false, :then, :false, :then, :then, :then, :false, :then, :then, :then, :then, :then, :then, :then, :then, :then, :then, :then, :false, :false, :then, :then, :false, :false, :then, :then, :false, :then, :then, :then, :false, :then, :then, :then, :false, :false, :false, :then, :false, :false, :false, :then, :false, :false, :then, :then, :false, :false, :then, :then, :false, :false, :false, :false, :false, :false, :false, :false, :false, :false, :false, :then, :false, :false, :false, :then, :then, :then, :then, :then, :then, :then, :then, :then, :false, :then, :then, :then, :false, :then, :then, :then, :false, :then, :then, :then, :false, :then, :then, :then, :false, :false, :then, :then, :false, :false, :then, :then, :false, :false, :then, :then, :false, :false, :then, :then, :false, :false, :false, :then, :false, :false, :false, :then, :false, :false, :false, :then, :false, :false, :false, :then, :false, :false, :false, :false, :false, :false, :false, :false, :then, :then, :then, :then, :then, :then, :then, :then, :then, :then, :then, :false, :then, :then, :then, :false, :then, :then, :then, :false, :then, :then, :then, :false, :then, :then, :false, :false, :then, :then, :false, :false, :then, :then, :false, :false, :then, :then, :false, :false, :then, :false, :false, :false, :then, :false, :false, :false, :then, :false, :false, :false, :then, :false, :false, :false, :false, :false, :false, :false, :false, :false, :false, :false, :then, :then, :then, :false, :then, :then, :then, :false, :then, :then, :then, :then, :then, :then, :then, :then, :then, :then, :false, :false, :then, :then, :false, :false, :then, :then, :then, :false, :then, :then, :then, :false, :then, :false, :false, :false, :then, :false, :false, :false, :then, :then, :false, :false, :then, :then, :false, :false, :false, :false, :false, :false, :false, :false, :false, :false, :then, :false, :false, :false, :then, :false, :false, :false, :then, :then, :then, :false, :then, :then, :then, :false, :then, :then, :false, :false, :then, :then, :false, :false, :then, :then, :then, :then, :then, :then, :then, :then, :then, :then, :then, :false, :then, :then, :then, :false, :then, :false, :false, :false, :then, :false, :false, :false, :false, :false, :false, :false, :false, :false, :false, :false, :then, :then, :false, :false, :then, :then, :false, :false, :then, :false, :false, :false, :then, :false, :false, :false, :then, :then, :false, :false, :then, :then, :false, :false, :then, :then, :then, :false, :then, :then, :then, :false, :then, :then, :then, :false, :then, :then, :then, :false, :then, :then, :then, :then, :then, :then, :then, :then, :false, :false, :false, :false, :false, :false, :false, :false, :then, :false, :false, :false, :then, :false, :false, :false, :then, :false, :false, :false, :then, :false, :false, :false, :then, :then, :false, :false, :then, :then, :false, :false, :then, :then, :false, :false, :then, :then, :false, :false, :then, :false, :false, :false, :then, :false, :false, :false, :then, :false, :false, :false, :then, :false, :false, :false, :false, :false, :false, :false, :false, :false, :false, :false, :then, :then, :then, :then, :then, :then, :then, :then, :then, :then, :then, :false, :then, :then, :then, :false, :then, :then, :then, :false, :then, :then, :then, :false, :then, :then, :false, :false, :then, :then, :false, :false, :then, :false, :false, :false, :then, :false, :false, :false, :then, :then, :false, :false, :then, :then, :false, :false, :false, :false, :false, :false, :false, :false, :false, :false, :then, :false, :false, :false, :then, :false, :false, :false, :then, :then, :then, :false, :then, :then, :then, :false, :then, :then, :then, :then, :then, :then, :then, :then, :then, :then, :false, :false, :then, :then, :false, :false, :then, :then, :then, :false, :then, :then, :then, :false, :then, :false, :false, :false, :then, :false, :false, :false, :false, :false, :false, :false, :false, :false, :false, :false, :then, :then, :false, :false, :then, :then, :false, :false, :then, :false, :false, :false, :then, :false, :false, :false, :then, :then, :then, :false, :then, :then, :then, :false, :then, :then, :false, :false, :then, :then, :false, :false, :then, :then, :then, :then, :then, :then, :then, :then, :then, :then, :then, :false, :then, :then, :then, :false, :false, :false, :false, :false, :false, :false, :false, :false, :then, :false, :false, :false, :then, :false, :false, :false, :then, :false, :false, :false, :then, :false, :false, :false, :then, :then, :false, :false, :then, :then, :false, :false, :then, :then, :false, :false, :then, :then, :false, :false, :then, :then, :then, :false, :then, :then, :then, :false, :then, :then, :then, :false, :then, :then, :then, :false, :then, :then, :then, :then, :then, :then, :then, :then, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep]}, %q{
-
- def make_perm ary, num
- if num == 1
- ary.map{|e| [e]}
- else
- base = make_perm(ary, num-1)
- res = []
- base.each{|b|
- ary.each{|e|
- res << [e] + b
- }
- }
- res
- end
- end
-
- def each_test
- conds = make_perm(['fv', 'tv'], 3)
- bangs = make_perm(['', '!'], 3)
- exprs = make_perm(['and', 'or'], 3)
- ['if', 'unless'].each{|syn|
- conds.each{|cs|
- bangs.each{|bs|
- exprs.each{|es|
- yield(syn, cs, bs, es)
- }
- }
- }
- }
- end
-
- fv = false
- tv = true
-
- $ans = []
- each_test{|syn, conds, bangs, exprs|
- c1, c2, c3 = conds
- bang1, bang2, bang3 = bangs
- e1, e2 = exprs
- eval %Q{
- #{syn} #{bang1}#{c1} #{e1} #{bang2}#{c2} #{e2} #{bang3}#{c3}
- $ans << :then
- else
- $ans << :false
- end
- }
- }
-
- each_test{|syn, conds, bangs, exprs|
- c1, c2, c3 = conds
- bang1, bang2, bang3 = bangs
- e1, e2 = exprs
- eval %Q{
- #{syn} #{bang1}#{c1} #{e1} #{bang2}#{c2} #{e2} #{bang3}#{c3}
- $ans << :then
- end
- $ans << :sep
- }
- }
- $ans
-}
-assert_equal %q{}, %q{
- defined?(m)
-}
-assert_equal %q{method}, %q{
- def m
- end
- defined?(m)
-}
-assert_equal %q{}, %q{
- defined?(a.class)
-}
-assert_equal %q{method}, %q{
- a = 1
- defined?(a.class)
-}
-assert_equal %q{["method", "method", "method", "method", nil, nil, "method", "method", "method", nil]}, %q{
- class C
- def test
- [defined?(m1()), defined?(self.m1), defined?(C.new.m1),
- defined?(m2()), defined?(self.m2), defined?(C.new.m2),
- defined?(m3()), defined?(self.m3), defined?(C.new.m3)]
- end
- def m1
- end
- private
- def m2
- end
- protected
- def m3
- end
- end
- C.new.test + [defined?(C.new.m3)]
-}
-assert_equal %q{[nil, nil, nil, nil, "global-variable", "global-variable", nil, nil]}, %q{
- $ans = [defined?($1), defined?($2), defined?($3), defined?($4)]
- /(a)(b)/ =~ 'ab'
- $ans + [defined?($1), defined?($2), defined?($3), defined?($4)]
-}
-assert_equal %q{nilselftruefalse}, %q{
- defined?(nil) + defined?(self) +
- defined?(true) + defined?(false)
-}
-assert_equal %q{}, %q{
- defined?(@a)
-}
-assert_equal %q{instance-variable}, %q{
- @a = 1
- defined?(@a)
-}
-assert_equal %q{}, %q{
- defined?(@@a)
-}
-assert_equal %q{class variable}, %q{
- @@a = 1
- defined?(@@a)
-}
-assert_equal %q{}, %q{
- defined?($a)
-}
-assert_equal %q{global-variable}, %q{
- $a = 1
- defined?($a)
-}
-assert_equal %q{}, %q{
- defined?(C_definedtest)
-}
-assert_equal %q{constant}, %q{
- C_definedtest = 1
- defined?(C_definedtest)
-}
-assert_equal %q{}, %q{
- defined?(::C_definedtest)
-}
-assert_equal %q{constant}, %q{
- C_definedtest = 1
- defined?(::C_definedtest)
-}
-assert_equal %q{}, %q{
- defined?(C_definedtestA::C_definedtestB::C_definedtestC)
-}
-assert_equal %q{constant}, %q{
- class C_definedtestA
- class C_definedtestB
- C_definedtestC = 1
- end
- end
- defined?(C_definedtestA::C_definedtestB::C_definedtestC)
-}
-assert_equal %q{30}, %q{
- sum = 0
- 30.times{|ib|
- if ib % 10 == 0 .. true
- sum += ib
- end
- }
- sum
-}
-assert_equal %q{63}, %q{
- sum = 0
- 30.times{|ib|
- if ib % 10 == 0 ... true
- sum += ib
- end
- }
- sum
-}
-assert_equal %q{[["NUM", "Type: NUM\n"], ["NUM", "123\n"], ["NUM", "456\n"], ["NUM", "Type: ARP\n"], ["NUM", "aaa\n"], ["NUM", "bbb\n"], ["NUM", "\f\n"], ["ARP", "Type: ARP\n"], ["ARP", "aaa\n"], ["ARP", "bbb\n"]]}, %q{
- t = nil
- unless ''.respond_to? :lines
- class String
- def lines
- self
- end
- end
- end
- ary = []
-"this must not print
-Type: NUM
-123
-456
-Type: ARP
-aaa
-bbb
-\f
-this must not print
-hoge
-Type: ARP
-aaa
-bbb
-".lines.each{|l|
- if (t = l[/^Type: (.*)/, 1])..(/^\f/ =~ l)
- ary << [t, l]
- end
- }
- ary
-}
-assert_equal %q{1}, %q{if true then 1 ; end}
-assert_equal %q{}, %q{if false then 1 ; end}
-assert_equal %q{1}, %q{if true then 1 ; else; 2; end}
-assert_equal %q{2}, %q{if false then 1 ; else; 2; end}
-assert_equal %q{}, %q{if true then ; elsif true then ; 1 ; end}
-assert_equal %q{1}, %q{if false then ; elsif true then ; 1 ; end}
-assert_equal %q{}, %q{unless true then 1 ; end}
-assert_equal %q{1}, %q{unless false then 1 ; end}
-assert_equal %q{2}, %q{unless true then 1 ; else; 2; end}
-assert_equal %q{1}, %q{unless false then 1 ; else; 2; end}
-assert_equal %q{1}, %q{1 if true}
-assert_equal %q{}, %q{1 if false}
-assert_equal %q{}, %q{1 if nil}
-assert_equal %q{}, %q{1 unless true}
-assert_equal %q{1}, %q{1 unless false}
-assert_equal %q{1}, %q{1 unless nil}
-assert_equal %q{1}, %q{1 || 2 || 3 || 4}
-assert_equal %q{1}, %q{1 || false || 3 || 4}
-assert_equal %q{2}, %q{nil || 2 || 3 || 4}
-assert_equal %q{2}, %q{false || 2 || 3 || 4}
-assert_equal %q{false}, %q{nil || false || nil || false}
-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{false}, %q{nil or false or nil or false}
-assert_equal %q{elseng}, %q{
- case
- when 1==2, 2==3
- :ng1
- when false, 4==5
- :ok
- when false
- :ng2
- else
- :elseng
- end
-}
-assert_equal %q{ok}, %q{
- case
- when nil, nil
- :ng1
- when 1,2,3
- :ok
- when false, false
- :ng2
- else
- :elseng
- end
-}
-assert_equal %q{elseok}, %q{
- case
- when nil
- :ng1
- when false
- :ng2
- else
- :elseok
- end}
-assert_equal %q{}, %q{
- case
- when 1
- end
-}
-assert_equal %q{ok}, %q{
- r = nil
- ary = []
- case
- when false
- r = :ng1
- when false, false
- r = :ng2
- when *ary
- r = :ng3
- when false, *ary
- r = :ng4
- when true, *ary
- r = :ok
- end
- r
-}
-assert_equal %q{ok}, %q{
- ary = []
- case
- when false, *ary
- :ng
- else
- :ok
- end
-}
-assert_equal %q{ok}, %q{
- ary = [false, nil]
- case
- when *ary
- :ng
- else
- :ok
- end
-}
-assert_equal %q{ok}, %q{
- ary = [false, nil]
- case
- when *ary
- :ng
- when true
- :ok
- else
- :ng2
- end
-}
-assert_equal %q{ng}, %q{
- ary = [false, nil]
- case
- when *ary
- :ok
- else
- :ng
- end
-}
-assert_equal %q{ok}, %q{
- ary = [false, true]
- case
- when *ary
- :ok
- else
- :ng
- end
-}
-assert_equal %q{ok}, %q{
- ary = [false, true]
- case
- when false, false
- when false, *ary
- :ok
- else
- :ng
- end
-}
-assert_equal %q{}, %q{
- i = 0
- while i < 10
- i+=1
- end}
-assert_equal %q{10}, %q{
- i = 0
- while i < 10
- i+=1
- end; i}
-assert_equal %q{}, %q{
- i = 0
- until i > 10
- i+=1
- end}
-assert_equal %q{11}, %q{
- i = 0
- until i > 10
- i+=1
- end; i}
-assert_equal %q{1}, %q{
- i = 0
- begin
- i+=1
- end while false
- i
-}
-assert_equal %q{1}, %q{
- i = 0
- begin
- i+=1
- end until true
- i
-}
-def assert_syntax_error expected, code, message = ''
- assert_equal "#{expected}",
- "begin eval(%q{#{code}}, nil, '', 0)"'; rescue SyntaxError => e; e.message[/\A:(?:\d+:)? (.*)/, 1] end', message
-end
-assert_syntax_error "unterminated string meets end of file", '().."', '[ruby-dev:29732]'
-assert_equal %q{[]}, %q{$&;[]}, '[ruby-dev:31068]'
-assert_syntax_error "syntax error, unexpected tSTAR, expecting '}'", %q{{*0}}, '[ruby-dev:31072]'
-assert_syntax_error "`@0' is not allowed as an instance variable name", %q{@0..0}, '[ruby-dev:31095]'
-assert_syntax_error "identifier $00 is not valid to get", %q{$00..0}, '[ruby-dev:31100]'
-assert_syntax_error "identifier $00 is not valid to set", %q{0..$00=1}
-assert_equal %q{0}, %q{[*0];0}, '[ruby-dev:31102]'
-assert_syntax_error "syntax error, unexpected ')'", %q{v0,(*,v1,) = 0}, '[ruby-dev:31104]'
-assert_equal %q{1}, %q{
- class << (ary=[]); def []; 0; end; def []=(x); super(0,x);end;end; ary[]+=1
-}, '[ruby-dev:31110]'
-assert_syntax_error "Can't set variable $1", %q{0..$1=1}, '[ruby-dev:31118]'
-assert_valid_syntax %q{1.times{1+(1&&next)}}, '[ruby-dev:31119]'
-assert_valid_syntax %q{x=-1;loop{x+=1&&redo if (x+=1).zero?}}, '[ruby-dev:31119]'
-assert_syntax_error %q{syntax error, unexpected $end}, %q{!}, '[ruby-dev:31243]'
-assert_equal %q{[nil]}, %q{[()]}, '[ruby-dev:31252]'
-assert_equal %q{true}, %q{!_=()}, '[ruby-dev:31263]'
-assert_equal 'ok', %q{while true; redo; end if 1 == 2; :ok}, '[ruby-dev:31360]'
-assert_equal 'ok', %q{
- 1.times {
- begin
- ensure
- next
- end
- }; :ok
-}, '[ruby-dev:31373]'
-assert_equal 'ok', %q{
- flag = false
- 1.times {
- next if flag
- flag = true
- begin
- ensure
- redo
- end
- }; :ok
-}, '[ruby-dev:31373]'
-
-assert_equal 'ok', %q{
- 1.times{
- p(1, (next; 2))
- }; :ok
-}
-assert_equal '3', %q{
- i = 0
- 1 + (while true
- break 2 if (i+=1) > 1
- next
- end)
-}
-assert_equal '3', %q{
- i = 0
- 1 + (while true
- break 2 if (i+=1) > 1
- p(1, (next; 2))
- end)
-}
-# redo
-assert_equal 'ok', %q{
- i = 0
- 1.times{
- break if i>1
- i+=1
- p(1, (redo; 2))
- }; :ok
-}
-assert_equal '3', %q{
- i = 0
- 1 + (while true
- break 2 if (i+=1) > 1
- redo
- end)
-}
-assert_equal '3', %q{
- i = 0
- 1 + (while true
- break 2 if (i+=1) > 1
- p(1, (redo; 2))
- end)
-}
-assert_equal '1', %q{
- a = [0]
- a[*a]+=1
-}
-assert_equal '2', %q{
- ary = [0]
- case 1
- when *ary, 1
- 1
- end +
- case
- when *ary
- 1
- end
-}
-
-assert_match /invalid multibyte char/, %q{
- STDERR.reopen(STDOUT)
- eval("\"\xf0".force_encoding("utf-8"))
-}, '[ruby-dev:32429]'
-
-# method ! and !=
-assert_equal 'true', %q{!false}
-assert_equal 'true', %q{1 == 1}
-assert_equal 'true', %q{1 != 2}
-assert_equal 'true', %q{
- class C; def !=(obj); true; end; end
- C.new != 1
-}
-assert_equal 'true', %q{
- class C; def !@; true; end; end
- !C.new
-}
-assert_normal_exit %q{
- eval "while true; return; end rescue p $!"
-}, '[ruby-dev:31663]'
-assert_equal '1', %q{
- def bar
- raise
- end
-
- def foo
- 1.times{
- begin
- return bar
- rescue
- :ok
- end
- }
- end
-
- foo
-}
-
-assert_equal 'ok', %q{
- counter = 2
- while true
- counter -= 1
- next if counter != 0
- break
- end
- :ok
-}, '[ruby-core:14385]'
-
-assert_equal 'ok', %q{
- counter = 2
- while true
- counter -= 1
- next if counter != 0
- break :ok
- end # direct
-}, '[ruby-core:14385]'
-
-assert_equal 'ok', %q{
- counter = 2
- while true
- counter -= 1
- break if counter == 0
- "#{next}"
- end
- :ok
-}, 'reported by Yusuke ENDOH'
-
-assert_equal 'ok', %q{
- counter = 2
- while true
- counter -= 1
- break if counter == 0
- next
- redo
- end
- :ok
-}, 'reported by Yusuke ENDOH'
-
-assert_equal 'ok', %q{
- counter = 2
- while true
- counter -= 1
- break if counter == 0
- next
- "#{ redo }"
- end
- :ok
-}, 'reported by Yusuke ENDOH'
-
-assert_normal_exit %q{
- begin
- raise
- rescue
- counter = 2
- while true
- counter -= 1
- break if counter == 0
- next
- retry
- end
- end
-}, 'reported by Yusuke ENDOH'
-
-assert_normal_exit %q{
- counter = 2
- while true
- counter -= 1
- break if counter == 0
- next
- "#{ break }"
- end
-}, 'reported by Yusuke ENDOH'
-
-assert_normal_exit %q{
- counter = 2
- while true
- counter -= 1
- next if counter != 0
- "#{ break }"
- end
-}, 'reported by Yusuke ENDOH'
-
-assert_equal 'ok', %q{
- 1.times do
- [
- 1, 2, 3, 4, 5, 6, 7, 8,
- begin
- false ? next : p
- break while true
- end
- ]
- end
- :ok
-}, '[ruby-dev:32882]'
-
-assert_equal "1\n2\n", %q{
- i = 0
- while i<2
- i += 1
- next p(i)
- end
-}
-
-assert_valid_syntax('1.times {|i|print (42),1;}', '[ruby-list:44479]')
-
-assert_equal 'ok', %q{
- def a() end
- begin
- if defined?(a(1).a)
- :ng
- else
- :ok
- end
- rescue
- :ng
- end
-}, '[ruby-core:16010]'
-
-assert_equal 'ok', %q{
- def a() end
- begin
- if defined?(a::B)
- :ng
- else
- :ok
- end
- rescue
- :ng
- end
-}, '[ruby-core:16010]'
-
-assert_normal_exit %q{
- defined? C && 0
-}
-
-assert_normal_exit %q{
- class C
- def m
- defined?(super())
- end
- end
- C.new.m
-}
-
-assert_equal 'ok', %q{
- class X < RuntimeError;end
- x = [X]
- begin
- raise X
- rescue *x
- :ok
- end
-}, '[ruby-core:14537]'
-
-assert_equal 'ok', %q{
- a = [false]
- (a[0] &&= true) == false ? :ok : :ng
-}, '[ruby-dev:34679]'
-
-assert_normal_exit %q{
- a = []
- 100.times {|i| a << i << nil << nil }
- p a.compact!
-}
-
diff --git a/bootstraptest/test_thread.rb b/bootstraptest/test_thread.rb
deleted file mode 100644
index c82ad22ebe..0000000000
--- a/bootstraptest/test_thread.rb
+++ /dev/null
@@ -1,387 +0,0 @@
-# Thread and Fiber
-
-assert_equal %q{ok}, %q{
- Thread.new{
- }.join
- :ok
-}
-assert_equal %q{ok}, %q{
- Thread.new{
- :ok
- }.value
-}
-assert_equal %q{20100}, %q{
- v = 0
- (1..200).map{|i|
- Thread.new{
- i
- }
- }.each{|t|
- v += t.value
- }
- v
-}
-assert_equal %q{5000}, %q{
- 5000.times{|e|
- (1..2).map{
- Thread.new{
- }
- }.each{|e|
- e.join()
- }
- }
-}
-assert_equal %q{5000}, %q{
- 5000.times{|e|
- (1..2).map{
- Thread.new{
- }
- }.each{|e|
- e.join(1000000000)
- }
- }
-}
-assert_equal %q{5000}, %q{
- 5000.times{
- t = Thread.new{}
- while t.alive?
- Thread.pass
- end
- }
-}
-assert_equal %q{100}, %q{
- 100.times{
- Thread.new{loop{Thread.pass}}
- }
-}
-assert_equal %q{ok}, %q{
- Thread.new{
- :ok
- }.join.value
-}
-assert_equal %q{ok}, %q{
- begin
- Thread.new{
- raise "ok"
- }.join
- rescue => e
- e
- end
-}
-assert_equal %q{ok}, %q{
- ans = nil
- t = Thread.new{
- begin
- sleep 0.5
- ensure
- ans = :ok
- end
- }
- Thread.pass
- t.kill
- t.join
- ans
-}
-assert_equal %q{ok}, %q{
- t = Thread.new{
- sleep
- }
- sleep 0.1
- t.raise
- begin
- t.join
- :ng
- rescue
- :ok
- end
-}
-assert_equal %q{ok}, %q{
- t = Thread.new{
- loop{}
- }
- Thread.pass
- t.raise
- begin
- t.join
- :ng
- rescue
- :ok
- end
-}
-assert_equal %q{ok}, %q{
- t = Thread.new{
- }
- Thread.pass
- t.join
- t.raise # raise to exited thread
- begin
- t.join
- :ok
- rescue
- :ng
- end
-}
-assert_equal %q{run}, %q{
- t = Thread.new{
- loop{}
- }
- st = t.status
- t.kill
- st
-}
-assert_equal %q{sleep}, %q{
- t = Thread.new{
- sleep
- }
- sleep 0.1
- st = t.status
- t.kill
- st
-}
-assert_equal %q{false}, %q{
- t = Thread.new{
- }
- t.kill
- sleep 0.1
- t.status
-}
-assert_equal %q{[ThreadGroup, true]}, %q{
- ptg = Thread.current.group
- Thread.new{
- ctg = Thread.current.group
- [ctg.class, ctg == ptg]
- }.value
-}
-assert_equal %q{[1, 1]}, %q{
- thg = ThreadGroup.new
-
- t = Thread.new{
- thg.add Thread.current
- sleep
- }
- sleep 0.1
- [thg.list.size, ThreadGroup::Default.list.size]
-}
-assert_equal %q{true}, %q{
- thg = ThreadGroup.new
-
- t = Thread.new{sleep 5}
- thg.add t
- thg.list.include?(t)
-}
-assert_equal %q{[true, nil, true]}, %q{
- /a/ =~ 'a'
- $a = $~
- Thread.new{
- $b = $~
- /a/ =~ 'a'
- $c = $~
- }
- $d = $~
- [$a == $d, $b, $c != $d]
-}
-assert_equal %q{11}, %q{
- Thread.current[:a] = 1
- Thread.new{
- Thread.current[:a] = 10
- Thread.pass
- Thread.current[:a]
- }.value + Thread.current[:a]
-}
-assert_equal %q{100}, %q{
-begin
- 100.times do |i|
- begin
- Thread.start(Thread.current) {|u| u.raise }
- raise
- rescue
- ensure
- end
- end
-rescue
- 100
-end
-}, '[ruby-dev:31371]'
-
-assert_equal 'true', %{
- t = Thread.new { loop {} }
- begin
- pid = fork {
- exit t.status != "run"
- }
- Process.wait pid
- $?.success?
- rescue NotImplementedError
- true
- end
-}
-
-assert_equal 'ok', %{
- open("zzz.rb", "w") do |f|
- f.puts <<-END
- begin
- Thread.new { fork { GC.start } }.join
- pid, status = Process.wait2
- $result = status.success? ? :ok : :ng
- rescue NotImplementedError
- $result = :ok
- end
- END
- end
- require "./zzz.rb"
- $result
-}
-
-assert_finish 3, %{
- th = Thread.new {sleep 2}
- th.join(1)
- th.join
-}
-
-assert_finish 3, %{
- require 'timeout'
- th = Thread.new {sleep 2}
- begin
- Timeout.timeout(1) {th.join}
- rescue Timeout::Error
- end
- th.join
-}
-
-assert_normal_exit %q{
- STDERR.reopen(STDOUT)
- exec "/"
-}
-
-assert_normal_exit %q{
- (0..10).map {
- Thread.new {
- 10000.times {
- Object.new.to_s
- }
- }
- }.each {|t|
- t.join
- }
-}
-
-assert_equal 'ok', %q{
- def m
- t = Thread.new { while true do // =~ "" end }
- sleep 0.1
- 10.times {
- if /((ab)*(ab)*)*(b)/ =~ "ab"*7
- return :ng if !$4
- return :ng if $~.size != 5
- end
- }
- :ok
- ensure
- Thread.kill t
- end
- m
-}, '[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]'
-
-assert_normal_exit %q{
- g = enum_for(:block_given?)
- loop { g.next }
-}, '[ruby-dev:34128]'
-
-assert_normal_exit %q{
- g = enum_for(:binding)
- loop { g.next }
-}, '[ruby-dev:34128]'
-
-assert_normal_exit %q{
- g = "abc".enum_for(:scan, /./)
- loop { g.next }
-}, '[ruby-dev:34128]'
-
-assert_normal_exit %q{
- g = Module.enum_for(:new)
- loop { g.next }
-}, '[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]'
-
-assert_equal 'ok', %q{
- begin
- Thread.new { Thread.stop }
- Thread.stop
- :ng
- rescue Exception
- :ok
- end
-}
-
-assert_equal 'ok', %q{
- begin
- m1, m2 = Mutex.new, Mutex.new
- Thread.new { m1.lock; sleep 1; m2.lock }
- m2.lock; sleep 1; m1.lock
- :ng
- rescue Exception
- :ok
- end
-}
-
-assert_equal 'ok', %q{
- m = Mutex.new
- Thread.new { m.lock }; sleep 1; m.lock
- :ok
-}
-
-assert_equal 'ok', %q{
- m = Mutex.new
- Thread.new { m.lock }; m.lock
- :ok
-}
-
-assert_equal 'ok', %q{
- m = Mutex.new
- Thread.new { m.lock }.join; m.lock
- :ok
-}
-
-assert_equal 'ok', %q{
- m = Mutex.new
- Thread.new { m.lock; sleep 2 }
- sleep 1; m.lock
- :ok
-}
-
-assert_equal 'ok', %q{
- m = Mutex.new
- Thread.new { m.lock; sleep 2; m.unlock }
- sleep 1; m.lock
- :ok
-}
-
-assert_equal 'ok', %q{
- t = Thread.new {`echo`}
- t.join
- $? ? :ng : :ok
-}, '[ruby-dev:35414]'
-
-assert_equal 'ok', %q{
- begin
- 10000.times { Thread.new(true) {|x| x == false } }
- rescue NoMemoryError, StandardError
- end
- :ok
-}
diff --git a/class.c b/class.c
index 3c7b1f0595..80f57a1622 100644
--- a/class.c
+++ b/class.c
@@ -3,116 +3,48 @@
class.c -
$Author$
+ $Date$
created at: Tue Aug 10 15:05:44 JST 1993
- Copyright (C) 1993-2007 Yukihiro Matsumoto
+ Copyright (C) 1993-2003 Yukihiro Matsumoto
**********************************************************************/
-/*!
- * \defgroup class Classes and their hierarchy.
- * \par Terminology
- * - class: same as in Ruby.
- * - singleton class: class for a particular object
- * - eigenclass: = singleton class
- * - metaclass: class of a class. metaclass is a kind of singleton class.
- * - metametaclass: class of a metaclass.
- * - meta^(n)-class: class of a meta^(n-1)-class.
- * - attached object: A singleton class knows its unique instance.
- * The instance is called the attached object for the singleton class.
- * \{
- */
-
-#include "ruby/ruby.h"
-#include "ruby/st.h"
-#include "method.h"
-#include "vm_core.h"
+#include "ruby.h"
+#include "rubysig.h"
+#include "node.h"
+#include "st.h"
#include <ctype.h>
extern st_table *rb_class_tbl;
-/**
- * Allocates a struct RClass for a new class.
- *
- * \param flags initial value for basic.flags of the returned class.
- * \param klass the class of the returned class.
- * \return an uninitialized Class object.
- * \pre \p klass must refer \c Class class or an ancestor of Class.
- * \pre \code (flags | T_CLASS) != 0 \endcode
- * \post the returned class can safely be \c #initialize 'd.
- *
- * \note this function is not Class#allocate.
- */
-static VALUE
-class_alloc(VALUE flags, VALUE klass)
-{
- rb_classext_t *ext = ALLOC(rb_classext_t);
- NEWOBJ(obj, struct RClass);
- OBJSETUP(obj, klass, flags);
- obj->ptr = ext;
- RCLASS_IV_TBL(obj) = 0;
- RCLASS_M_TBL(obj) = 0;
- RCLASS_SUPER(obj) = 0;
- RCLASS_IV_INDEX_TBL(obj) = 0;
- return (VALUE)obj;
-}
-
-
-/*!
- * A utility function that wraps class_alloc.
- *
- * allocates a class and initializes safely.
- * \param super a class from which the new class derives.
- * \return a class object.
- * \pre \a super must be a class.
- * \post the metaclass of the new class is Class.
- */
VALUE
-rb_class_boot(VALUE super)
+rb_class_boot(super)
+ VALUE super;
{
- VALUE klass = class_alloc(T_CLASS, rb_cClass);
+ NEWOBJ(klass, struct RClass);
+ OBJSETUP(klass, rb_cClass, T_CLASS);
- RCLASS_SUPER(klass) = super;
- RCLASS_M_TBL(klass) = st_init_numtable();
+ klass->super = super;
+ klass->iv_tbl = 0;
+ klass->m_tbl = 0; /* safe GC */
+ klass->m_tbl = st_init_numtable();
OBJ_INFECT(klass, super);
return (VALUE)klass;
}
-
-/*!
- * Ensures a class can be derived from super.
- *
- * \param super a reference to an object.
- * \exception TypeError if \a super is not a Class or \a super is a singleton class.
- */
-void
-rb_check_inheritable(VALUE super)
-{
- if (TYPE(super) != T_CLASS) {
- 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");
- }
-}
-
-
-/*!
- * Creates a new class.
- * \param super a class from which the new class derives.
- * \exception TypeError \a super is not inheritable.
- * \exception TypeError \a super is the Class class.
- */
VALUE
-rb_class_new(VALUE super)
+rb_class_new(super)
+ VALUE super;
{
Check_Type(super, T_CLASS);
- rb_check_inheritable(super);
if (super == rb_cClass) {
rb_raise(rb_eTypeError, "can't make subclass of Class");
}
+ if (FL_TEST(super, FL_SINGLETON)) {
+ rb_raise(rb_eTypeError, "can't make subclass of virtual class");
+ }
return rb_class_boot(super);
}
@@ -121,50 +53,51 @@ struct clone_method_data {
VALUE klass;
};
-VALUE rb_iseq_clone(VALUE iseqval, VALUE newcbase);
-
static int
-clone_method(ID mid, const rb_method_entry_t *me, struct clone_method_data *data)
+clone_method(mid, body, data)
+ ID mid;
+ NODE *body;
+ struct clone_method_data *data;
{
- switch (me->type) {
- case VM_METHOD_TYPE_ISEQ: {
- VALUE newiseqval = rb_iseq_clone(me->body.iseq->self, data->klass);
- rb_iseq_t *iseq;
- GetISeqPtr(newiseqval, iseq);
- rb_add_method(data->klass, mid, VM_METHOD_TYPE_ISEQ, iseq, me->flag);
- break;
- }
- default:
- rb_add_method_me(data->klass, mid, me, me->flag);
- break;
+ NODE *fbody = body->nd_body;
+
+ if (fbody && nd_type(fbody) == NODE_SCOPE) {
+ NODE *cref = (NODE*)fbody->nd_rval;
+
+ if (cref) cref = cref->nd_next;
+ fbody = rb_copy_node_scope(fbody, NEW_CREF(data->klass, cref));
}
+ st_insert(data->tbl, mid, (st_data_t)NEW_METHOD(fbody, body->nd_noex));
return ST_CONTINUE;
}
/* :nodoc: */
VALUE
-rb_mod_init_copy(VALUE clone, VALUE orig)
+rb_mod_init_copy(clone, orig)
+ VALUE clone, orig;
{
rb_obj_init_copy(clone, orig);
if (!FL_TEST(CLASS_OF(clone), FL_SINGLETON)) {
- RBASIC(clone)->klass = rb_singleton_class_clone(orig);
+ RBASIC(clone)->klass = RBASIC(orig)->klass;
+ RBASIC(clone)->klass = rb_singleton_class_clone(clone);
}
- RCLASS_SUPER(clone) = RCLASS_SUPER(orig);
- if (RCLASS_IV_TBL(orig)) {
+ RCLASS(clone)->super = RCLASS(orig)->super;
+ if (RCLASS(orig)->iv_tbl) {
ID id;
- RCLASS_IV_TBL(clone) = st_copy(RCLASS_IV_TBL(orig));
- CONST_ID(id, "__classpath__");
- st_delete(RCLASS_IV_TBL(clone), (st_data_t*)&id, 0);
- CONST_ID(id, "__classid__");
- st_delete(RCLASS_IV_TBL(clone), (st_data_t*)&id, 0);
+ RCLASS(clone)->iv_tbl = st_copy(RCLASS(orig)->iv_tbl);
+ id = rb_intern("__classpath__");
+ st_delete(RCLASS(clone)->iv_tbl, (st_data_t*)&id, 0);
+ id = rb_intern("__classid__");
+ st_delete(RCLASS(clone)->iv_tbl, (st_data_t*)&id, 0);
}
- if (RCLASS_M_TBL(orig)) {
+ if (RCLASS(orig)->m_tbl) {
struct clone_method_data data;
- data.tbl = RCLASS_M_TBL(clone) = st_init_numtable();
- data.klass = clone;
- st_foreach(RCLASS_M_TBL(orig), clone_method,
- (st_data_t)&data);
+
+ data.tbl = RCLASS(clone)->m_tbl = st_init_numtable();
+ data.klass = (VALUE)clone;
+
+ st_foreach(RCLASS(orig)->m_tbl, clone_method, (st_data_t)&data);
}
return clone;
@@ -172,9 +105,10 @@ rb_mod_init_copy(VALUE clone, VALUE orig)
/* :nodoc: */
VALUE
-rb_class_init_copy(VALUE clone, VALUE orig)
+rb_class_init_copy(clone, orig)
+ VALUE clone, orig;
{
- if (RCLASS_SUPER(clone) != 0) {
+ if (RCLASS(clone)->super != 0) {
rb_raise(rb_eTypeError, "already initialized class");
}
if (FL_TEST(orig, FL_SINGLETON)) {
@@ -184,16 +118,17 @@ rb_class_init_copy(VALUE clone, VALUE orig)
}
VALUE
-rb_singleton_class_clone(VALUE obj)
+rb_singleton_class_clone(obj)
+ VALUE obj;
{
VALUE klass = RBASIC(obj)->klass;
if (!FL_TEST(klass, FL_SINGLETON))
return klass;
else {
- struct clone_method_data data;
/* copy singleton(unnamed) class */
- VALUE clone = class_alloc(RBASIC(klass)->flags, 0);
+ NEWOBJ(clone, struct RClass);
+ OBJSETUP(clone, 0, RBASIC(klass)->flags);
if (BUILTIN_TYPE(obj) == T_CLASS) {
RBASIC(clone)->klass = (VALUE)clone;
@@ -202,15 +137,28 @@ rb_singleton_class_clone(VALUE obj)
RBASIC(clone)->klass = rb_singleton_class_clone(klass);
}
- RCLASS_SUPER(clone) = RCLASS_SUPER(klass);
- if (RCLASS_IV_TBL(klass)) {
- RCLASS_IV_TBL(clone) = st_copy(RCLASS_IV_TBL(klass));
+ clone->super = RCLASS(klass)->super;
+ clone->iv_tbl = 0;
+ clone->m_tbl = 0;
+ if (RCLASS(klass)->iv_tbl) {
+ clone->iv_tbl = st_copy(RCLASS(klass)->iv_tbl);
+ }
+ {
+ struct clone_method_data data;
+
+ data.tbl = clone->m_tbl = st_init_numtable();
+ switch (TYPE(obj)) {
+ case T_CLASS:
+ case T_MODULE:
+ data.klass = obj;
+ break;
+ default:
+ data.klass = 0;
+ break;
+ }
+
+ st_foreach(RCLASS(klass)->m_tbl, clone_method, (st_data_t)&data);
}
- RCLASS_M_TBL(clone) = st_init_numtable();
- data.tbl = RCLASS_M_TBL(clone);
- data.klass = (VALUE)clone;
- st_foreach(RCLASS_M_TBL(klass), clone_method,
- (st_data_t)&data);
rb_singleton_class_attached(RBASIC(clone)->klass, (VALUE)clone);
FL_SET(clone, FL_SINGLETON);
return (VALUE)clone;
@@ -218,96 +166,45 @@ rb_singleton_class_clone(VALUE obj)
}
void
-rb_singleton_class_attached(VALUE klass, VALUE obj)
+rb_singleton_class_attached(klass, obj)
+ VALUE klass, obj;
{
if (FL_TEST(klass, FL_SINGLETON)) {
- ID attached;
- if (!RCLASS_IV_TBL(klass)) {
- RCLASS_IV_TBL(klass) = st_init_numtable();
+ if (!RCLASS(klass)->iv_tbl) {
+ RCLASS(klass)->iv_tbl = st_init_numtable();
}
- CONST_ID(attached, "__attached__");
- st_insert(RCLASS_IV_TBL(klass), attached, obj);
+ st_insert(RCLASS(klass)->iv_tbl, rb_intern("__attached__"), obj);
}
}
-
-/*!
- * Creates a meta^(n+1)-class for a meta^(n)-class.
- * \param metaclass a class of a class
- * \return the created meta^(n+1)-class.
- * \pre \a metaclass is a metaclass
- * \post the class of \a metaclass is the returned class.
- */
-static VALUE
-make_metametaclass(VALUE metaclass)
-{
- VALUE metametaclass, super_of_metaclass;
-
- if (RBASIC(metaclass)->klass == metaclass) { /* for meta^(n)-class of Class */
- metametaclass = rb_class_boot(Qnil);
- RBASIC(metametaclass)->klass = metametaclass;
- }
- else {
- metametaclass = rb_class_boot(Qnil);
- RBASIC(metametaclass)->klass =
- (RBASIC(RBASIC(metaclass)->klass)->klass == RBASIC(metaclass)->klass)
- ? make_metametaclass(RBASIC(metaclass)->klass)
- : RBASIC(RBASIC(metaclass)->klass)->klass;
- }
-
- FL_SET(metametaclass, FL_SINGLETON);
- rb_singleton_class_attached(metametaclass, metaclass);
- RBASIC(metaclass)->klass = metametaclass;
-
- super_of_metaclass = RCLASS_SUPER(metaclass);
- while (FL_TEST(super_of_metaclass, T_ICLASS)) {
- super_of_metaclass = RCLASS_SUPER(super_of_metaclass);
- }
- RCLASS_SUPER(metametaclass) =
- rb_iv_get(RBASIC(super_of_metaclass)->klass, "__attached__") == super_of_metaclass
- ? RBASIC(super_of_metaclass)->klass
- : make_metametaclass(super_of_metaclass);
- OBJ_INFECT(metametaclass, RCLASS_SUPER(metametaclass));
-
- return metametaclass;
-}
-
-
-/*!
- * \internal
- * Creates a singleton class for an object.
- *
- * \note DO NOT USE the function in an extension libraries. Use rb_singleton_class.
- * \param obj An object.
- * \param super A class from which the singleton class derives.
- * \note \a super is ignored if \a obj is a metaclass.
- * \return The singleton class of the object.
- */
VALUE
-rb_make_metaclass(VALUE obj, VALUE super)
+rb_make_metaclass(obj, super)
+ VALUE obj, super;
{
- if (BUILTIN_TYPE(obj) == T_CLASS && FL_TEST(obj, FL_SINGLETON)) { /* obj is a metaclass */
- return make_metametaclass(obj);
+ VALUE klass = rb_class_boot(super);
+ FL_SET(klass, FL_SINGLETON);
+ RBASIC(obj)->klass = klass;
+ rb_singleton_class_attached(klass, obj);
+ if (BUILTIN_TYPE(obj) == T_CLASS && FL_TEST(obj, FL_SINGLETON)) {
+ RBASIC(klass)->klass = klass;
+ RCLASS(klass)->super = RBASIC(rb_class_real(RCLASS(obj)->super))->klass;
}
else {
- VALUE metasuper;
- VALUE klass = rb_class_boot(super);
-
- FL_SET(klass, FL_SINGLETON);
- RBASIC(obj)->klass = klass;
- rb_singleton_class_attached(klass, obj);
+ VALUE metasuper = RBASIC(rb_class_real(super))->klass;
- metasuper = RBASIC(rb_class_real(super))->klass;
/* metaclass of a superclass may be NULL at boot time */
if (metasuper) {
RBASIC(klass)->klass = metasuper;
}
- return klass;
}
+
+ return klass;
}
VALUE
-rb_define_class_id(ID id, VALUE super)
+rb_define_class_id(id, super)
+ ID id;
+ VALUE super;
{
VALUE klass;
@@ -318,17 +215,31 @@ rb_define_class_id(ID id, VALUE super)
return klass;
}
+void
+rb_check_inheritable(super)
+ VALUE super;
+{
+ if (TYPE(super) != T_CLASS) {
+ 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 virtual class");
+ }
+}
+
VALUE
-rb_class_inherited(VALUE super, VALUE klass)
+rb_class_inherited(super, klass)
+ VALUE super, klass;
{
- ID inherited;
if (!super) super = rb_cObject;
- CONST_ID(inherited, "inherited");
- return rb_funcall(super, inherited, 1, klass);
+ return rb_funcall(super, rb_intern("inherited"), 1, klass);
}
VALUE
-rb_define_class(const char *name, VALUE super)
+rb_define_class(name, super)
+ const char *name;
+ VALUE super;
{
VALUE klass;
ID id;
@@ -339,7 +250,7 @@ rb_define_class(const char *name, VALUE super)
if (TYPE(klass) != T_CLASS) {
rb_raise(rb_eTypeError, "%s is not a class", name);
}
- if (rb_class_real(RCLASS_SUPER(klass)) != super) {
+ if (rb_class_real(RCLASS(klass)->super) != super) {
rb_name_error(id, "%s is already defined", name);
}
return klass;
@@ -357,7 +268,10 @@ rb_define_class(const char *name, VALUE super)
}
VALUE
-rb_define_class_under(VALUE outer, const char *name, VALUE super)
+rb_define_class_under(outer, name, super)
+ VALUE outer;
+ const char *name;
+ VALUE super;
{
VALUE klass;
ID id;
@@ -368,7 +282,7 @@ rb_define_class_under(VALUE outer, const char *name, VALUE super)
if (TYPE(klass) != T_CLASS) {
rb_raise(rb_eTypeError, "%s is not a class", name);
}
- if (rb_class_real(RCLASS_SUPER(klass)) != super) {
+ if (rb_class_real(RCLASS(klass)->super) != super) {
rb_name_error(id, "%s is already defined", name);
}
return klass;
@@ -386,17 +300,22 @@ rb_define_class_under(VALUE outer, const char *name, VALUE super)
}
VALUE
-rb_module_new(void)
+rb_module_new()
{
- VALUE mdl = class_alloc(T_MODULE, rb_cModule);
+ NEWOBJ(mdl, struct RClass);
+ OBJSETUP(mdl, rb_cModule, T_MODULE);
- RCLASS_M_TBL(mdl) = st_init_numtable();
+ mdl->super = 0;
+ mdl->iv_tbl = 0;
+ mdl->m_tbl = 0;
+ mdl->m_tbl = st_init_numtable();
return (VALUE)mdl;
}
VALUE
-rb_define_module_id(ID id)
+rb_define_module_id(id)
+ ID id;
{
VALUE mdl;
@@ -407,7 +326,8 @@ rb_define_module_id(ID id)
}
VALUE
-rb_define_module(const char *name)
+rb_define_module(name)
+ const char *name;
{
VALUE module;
ID id;
@@ -427,7 +347,9 @@ rb_define_module(const char *name)
}
VALUE
-rb_define_module_under(VALUE outer, const char *name)
+rb_define_module_under(outer, name)
+ VALUE outer;
+ const char *name;
{
VALUE module;
ID id;
@@ -448,19 +370,21 @@ rb_define_module_under(VALUE outer, const char *name)
}
static VALUE
-include_class_new(VALUE module, VALUE super)
+include_class_new(module, super)
+ VALUE module, super;
{
- VALUE klass = class_alloc(T_ICLASS, rb_cClass);
+ NEWOBJ(klass, struct RClass);
+ OBJSETUP(klass, rb_cClass, T_ICLASS);
if (BUILTIN_TYPE(module) == T_ICLASS) {
module = RBASIC(module)->klass;
}
- if (!RCLASS_IV_TBL(module)) {
- RCLASS_IV_TBL(module) = st_init_numtable();
+ if (!RCLASS(module)->iv_tbl) {
+ RCLASS(module)->iv_tbl = st_init_numtable();
}
- RCLASS_IV_TBL(klass) = RCLASS_IV_TBL(module);
- RCLASS_M_TBL(klass) = RCLASS_M_TBL(module);
- RCLASS_SUPER(klass) = super;
+ klass->iv_tbl = RCLASS(module)->iv_tbl;
+ klass->m_tbl = RCLASS(module)->m_tbl;
+ klass->super = super;
if (TYPE(module) == T_ICLASS) {
RBASIC(klass)->klass = RBASIC(module)->klass;
}
@@ -474,16 +398,17 @@ include_class_new(VALUE module, VALUE super)
}
void
-rb_include_module(VALUE klass, VALUE module)
+rb_include_module(klass, module)
+ VALUE klass, module;
{
VALUE p, c;
int changed = 0;
rb_frozen_class_p(klass);
- if (!OBJ_UNTRUSTED(klass)) {
+ if (!OBJ_TAINTED(klass)) {
rb_secure(4);
}
-
+
if (TYPE(module) != T_MODULE) {
Check_Type(module, T_MODULE);
}
@@ -493,15 +418,15 @@ rb_include_module(VALUE klass, VALUE module)
while (module) {
int superclass_seen = Qfalse;
- if (RCLASS_M_TBL(klass) == RCLASS_M_TBL(module))
+ if (RCLASS(klass)->m_tbl == RCLASS(module)->m_tbl)
rb_raise(rb_eArgError, "cyclic include detected");
/* ignore if the module included already in superclasses */
- for (p = RCLASS_SUPER(klass); p; p = RCLASS_SUPER(p)) {
+ for (p = RCLASS(klass)->super; p; p = RCLASS(p)->super) {
switch (BUILTIN_TYPE(p)) {
case T_ICLASS:
- if (RCLASS_M_TBL(p) == RCLASS_M_TBL(module)) {
+ if (RCLASS(p)->m_tbl == RCLASS(module)->m_tbl) {
if (!superclass_seen) {
- c = p; /* move insertion point */
+ c = p; /* move insertion point */
}
goto skip;
}
@@ -511,10 +436,10 @@ rb_include_module(VALUE klass, VALUE module)
break;
}
}
- c = RCLASS_SUPER(c) = include_class_new(module, RCLASS_SUPER(c));
+ c = RCLASS(c)->super = include_class_new(module, RCLASS(c)->super);
changed = 1;
skip:
- module = RCLASS_SUPER(module);
+ module = RCLASS(module)->super;
}
if (changed) rb_clear_cache();
}
@@ -522,27 +447,28 @@ rb_include_module(VALUE klass, VALUE module)
/*
* call-seq:
* mod.included_modules -> array
- *
+ *
* Returns the list of modules included in <i>mod</i>.
- *
+ *
* module Mixin
* end
- *
+ *
* module Outer
* include Mixin
* end
- *
+ *
* Mixin.included_modules #=> []
* Outer.included_modules #=> [Mixin]
*/
VALUE
-rb_mod_included_modules(VALUE mod)
+rb_mod_included_modules(mod)
+ VALUE mod;
{
VALUE ary = rb_ary_new();
VALUE p;
- for (p = RCLASS_SUPER(mod); p; p = RCLASS_SUPER(p)) {
+ for (p = RCLASS(mod)->super; p; p = RCLASS(p)->super) {
if (BUILTIN_TYPE(p) == T_ICLASS) {
rb_ary_push(ary, RBASIC(p)->klass);
}
@@ -553,10 +479,10 @@ rb_mod_included_modules(VALUE mod)
/*
* call-seq:
* mod.include?(module) => true or false
- *
+ *
* Returns <code>true</code> if <i>module</i> is included in
* <i>mod</i> or one of <i>mod</i>'s ancestors.
- *
+ *
* module A
* end
* class B
@@ -570,12 +496,14 @@ rb_mod_included_modules(VALUE mod)
*/
VALUE
-rb_mod_include_p(VALUE mod, VALUE mod2)
+rb_mod_include_p(mod, mod2)
+ VALUE mod;
+ VALUE mod2;
{
VALUE p;
Check_Type(mod2, T_MODULE);
- for (p = RCLASS_SUPER(mod); p; p = RCLASS_SUPER(p)) {
+ for (p = RCLASS(mod)->super; p; p = RCLASS(p)->super) {
if (BUILTIN_TYPE(p) == T_ICLASS) {
if (RBASIC(p)->klass == mod2) return Qtrue;
}
@@ -586,25 +514,26 @@ rb_mod_include_p(VALUE mod, VALUE mod2)
/*
* call-seq:
* mod.ancestors -> array
- *
+ *
* Returns a list of modules included in <i>mod</i> (including
* <i>mod</i> itself).
- *
+ *
* module Mod
* include Math
* include Comparable
* end
- *
+ *
* Mod.ancestors #=> [Mod, Comparable, Math]
* Math.ancestors #=> [Math]
*/
VALUE
-rb_mod_ancestors(VALUE mod)
+rb_mod_ancestors(mod)
+ VALUE mod;
{
VALUE p, ary = rb_ary_new();
- for (p = mod; p; p = RCLASS_SUPER(p)) {
+ for (p = mod; p; p = RCLASS(p)->super) {
if (FL_TEST(p, FL_SINGLETON))
continue;
if (BUILTIN_TYPE(p) == T_ICLASS) {
@@ -621,10 +550,13 @@ rb_mod_ancestors(VALUE mod)
#define VISI_CHECK(x,f) (VISI(x) == (f))
static int
-ins_methods_push(ID name, long type, VALUE ary, long visi)
+ins_methods_push(name, type, ary, visi)
+ ID name;
+ long type;
+ VALUE ary;
+ long visi;
{
if (type == -1) return ST_CONTINUE;
-
switch (visi) {
case NOEX_PRIVATE:
case NOEX_PROTECTED:
@@ -636,58 +568,70 @@ ins_methods_push(ID name, long type, VALUE ary, long visi)
break;
}
if (visi) {
- rb_ary_push(ary, ID2SYM(name));
+ rb_ary_push(ary, rb_str_new2(rb_id2name(name)));
}
return ST_CONTINUE;
}
static int
-ins_methods_i(ID name, long type, VALUE ary)
+ins_methods_i(name, type, ary)
+ ID name;
+ long type;
+ VALUE ary;
{
return ins_methods_push(name, type, ary, -1); /* everything but private */
}
static int
-ins_methods_prot_i(ID name, long type, VALUE ary)
+ins_methods_prot_i(name, type, ary)
+ ID name;
+ long type;
+ VALUE ary;
{
return ins_methods_push(name, type, ary, NOEX_PROTECTED);
}
static int
-ins_methods_priv_i(ID name, long type, VALUE ary)
+ins_methods_priv_i(name, type, ary)
+ ID name;
+ long type;
+ VALUE ary;
{
return ins_methods_push(name, type, ary, NOEX_PRIVATE);
}
static int
-ins_methods_pub_i(ID name, long type, VALUE ary)
+ins_methods_pub_i(name, type, ary)
+ ID name;
+ long type;
+ VALUE ary;
{
return ins_methods_push(name, type, ary, NOEX_PUBLIC);
}
static int
-method_entry(ID key, const rb_method_entry_t *me, st_table *list)
+method_entry(key, body, list)
+ ID key;
+ NODE *body;
+ st_table *list;
{
long type;
- if (key == ID_ALLOCATOR) {
- return ST_CONTINUE;
- }
-
+ if (key == ID_ALLOCATOR) return ST_CONTINUE;
if (!st_lookup(list, key, 0)) {
- if (!me || me->type == VM_METHOD_TYPE_UNDEF) {
- type = -1; /* none */
- }
- else {
- type = VISI(me->flag);
- }
+ if (!body->nd_body) type = -1; /* none */
+ else type = VISI(body->nd_noex);
st_add_direct(list, key, type);
}
return ST_CONTINUE;
}
static VALUE
-class_instance_method_list(int argc, VALUE *argv, VALUE mod, int (*func) (ID, long, VALUE))
+class_instance_method_list(argc, argv, mod, func)
+ int argc;
+ VALUE *argv;
+ VALUE mod;
+ int (*func) _((ID, long, VALUE));
{
VALUE ary;
int recur;
@@ -703,8 +647,8 @@ class_instance_method_list(int argc, VALUE *argv, VALUE mod, int (*func) (ID, lo
}
list = st_init_numtable();
- for (; mod; mod = RCLASS_SUPER(mod)) {
- st_foreach(RCLASS_M_TBL(mod), method_entry, (st_data_t)list);
+ for (; mod; mod = RCLASS(mod)->super) {
+ st_foreach(RCLASS(mod)->m_tbl, method_entry, (st_data_t)list);
if (BUILTIN_TYPE(mod) == T_ICLASS) continue;
if (FL_TEST(mod, FL_SINGLETON)) continue;
if (!recur) break;
@@ -719,14 +663,14 @@ class_instance_method_list(int argc, VALUE *argv, VALUE mod, int (*func) (ID, lo
/*
* call-seq:
* mod.instance_methods(include_super=true) => array
- *
- * Returns an array containing the names of instance methods that is callable
- * from outside in the receiver. For a module, these are the public methods;
- * for a class, they are the instance (not singleton) methods. With no
+ *
+ * Returns an array containing the names of public instance methods in
+ * the receiver. For a module, these are the public methods; for a
+ * class, they are the instance (not singleton) methods. With no
* argument, or with an argument that is <code>false</code>, the
* instance methods in <i>mod</i> are returned, otherwise the methods
* in <i>mod</i> and <i>mod</i>'s superclasses are returned.
- *
+ *
* module A
* def method1() end
* end
@@ -736,15 +680,18 @@ class_instance_method_list(int argc, VALUE *argv, VALUE mod, int (*func) (ID, lo
* class C < B
* def method3() end
* end
- *
- * A.instance_methods #=> [:method1]
- * B.instance_methods(false) #=> [:method2]
- * C.instance_methods(false) #=> [:method3]
+ *
+ * A.instance_methods #=> ["method1"]
+ * B.instance_methods(false) #=> ["method2"]
+ * C.instance_methods(false) #=> ["method3"]
* C.instance_methods(true).length #=> 43
*/
VALUE
-rb_class_instance_methods(int argc, VALUE *argv, VALUE mod)
+rb_class_instance_methods(argc, argv, mod)
+ int argc;
+ VALUE *argv;
+ VALUE mod;
{
return class_instance_method_list(argc, argv, mod, ins_methods_i);
}
@@ -752,14 +699,17 @@ rb_class_instance_methods(int argc, VALUE *argv, VALUE mod)
/*
* call-seq:
* mod.protected_instance_methods(include_super=true) => array
- *
+ *
* Returns a list of the protected instance methods defined in
* <i>mod</i>. If the optional parameter is not <code>false</code>, the
* methods of any ancestors are included.
*/
VALUE
-rb_class_protected_instance_methods(int argc, VALUE *argv, VALUE mod)
+rb_class_protected_instance_methods(argc, argv, mod)
+ int argc;
+ VALUE *argv;
+ VALUE mod;
{
return class_instance_method_list(argc, argv, mod, ins_methods_prot_i);
}
@@ -767,22 +717,25 @@ rb_class_protected_instance_methods(int argc, VALUE *argv, VALUE mod)
/*
* call-seq:
* mod.private_instance_methods(include_super=true) => array
- *
+ *
* Returns a list of the private instance methods defined in
* <i>mod</i>. If the optional parameter is not <code>false</code>, the
* methods of any ancestors are included.
- *
+ *
* module Mod
* def method1() end
* private :method1
* def method2() end
* end
- * Mod.instance_methods #=> [:method2]
- * Mod.private_instance_methods #=> [:method1]
+ * Mod.instance_methods #=> ["method2"]
+ * Mod.private_instance_methods #=> ["method1"]
*/
VALUE
-rb_class_private_instance_methods(int argc, VALUE *argv, VALUE mod)
+rb_class_private_instance_methods(argc, argv, mod)
+ int argc;
+ VALUE *argv;
+ VALUE mod;
{
return class_instance_method_list(argc, argv, mod, ins_methods_priv_i);
}
@@ -790,14 +743,17 @@ rb_class_private_instance_methods(int argc, VALUE *argv, VALUE mod)
/*
* call-seq:
* mod.public_instance_methods(include_super=true) => array
- *
+ *
* Returns a list of the public instance methods defined in <i>mod</i>.
* If the optional parameter is not <code>false</code>, the methods of
* any ancestors are included.
*/
VALUE
-rb_class_public_instance_methods(int argc, VALUE *argv, VALUE mod)
+rb_class_public_instance_methods(argc, argv, mod)
+ int argc;
+ VALUE *argv;
+ VALUE mod;
{
return class_instance_method_list(argc, argv, mod, ins_methods_pub_i);
}
@@ -805,57 +761,58 @@ rb_class_public_instance_methods(int argc, VALUE *argv, VALUE mod)
/*
* call-seq:
* obj.singleton_methods(all=true) => array
- *
+ *
* Returns an array of the names of singleton methods for <i>obj</i>.
* If the optional <i>all</i> parameter is true, the list will include
* methods in modules included in <i>obj</i>.
- *
+ *
* module Other
* def three() end
* end
- *
+ *
* class Single
* def Single.four() end
* end
- *
+ *
* a = Single.new
- *
+ *
* def a.one()
* end
- *
+ *
* class << a
* include Other
* def two()
* end
* end
- *
- * Single.singleton_methods #=> [:four]
- * a.singleton_methods(false) #=> [:two, :one]
- * a.singleton_methods #=> [:two, :one, :three]
+ *
+ * Single.singleton_methods #=> ["four"]
+ * a.singleton_methods(false) #=> ["two", "one"]
+ * a.singleton_methods #=> ["two", "one", "three"]
*/
VALUE
-rb_obj_singleton_methods(int argc, VALUE *argv, VALUE obj)
+rb_obj_singleton_methods(argc, argv, obj)
+ int argc;
+ VALUE *argv;
+ VALUE obj;
{
VALUE recur, ary, klass;
st_table *list;
+ rb_scan_args(argc, argv, "01", &recur);
if (argc == 0) {
recur = Qtrue;
}
- else {
- rb_scan_args(argc, argv, "01", &recur);
- }
klass = CLASS_OF(obj);
list = st_init_numtable();
if (klass && FL_TEST(klass, FL_SINGLETON)) {
- st_foreach(RCLASS_M_TBL(klass), method_entry, (st_data_t)list);
- klass = RCLASS_SUPER(klass);
+ st_foreach(RCLASS(klass)->m_tbl, method_entry, (st_data_t)list);
+ klass = RCLASS(klass)->super;
}
if (RTEST(recur)) {
while (klass && (FL_TEST(klass, FL_SINGLETON) || TYPE(klass) == T_ICLASS)) {
- st_foreach(RCLASS_M_TBL(klass), method_entry, (st_data_t)list);
- klass = RCLASS_SUPER(klass);
+ st_foreach(RCLASS(klass)->m_tbl, method_entry, (st_data_t)list);
+ klass = RCLASS(klass)->super;
}
}
ary = rb_ary_new();
@@ -866,33 +823,55 @@ rb_obj_singleton_methods(int argc, VALUE *argv, VALUE obj)
}
void
-rb_define_method_id(VALUE klass, ID mid, VALUE (*func)(ANYARGS), int argc)
+rb_define_method_id(klass, name, func, argc)
+ VALUE klass;
+ ID name;
+ VALUE (*func)();
+ int argc;
{
- rb_add_method_cfunc(klass, mid, func, argc, NOEX_PUBLIC);
+ rb_add_method(klass, name, NEW_CFUNC(func,argc), NOEX_PUBLIC);
}
void
-rb_define_method(VALUE klass, const char *name, VALUE (*func)(ANYARGS), int argc)
+rb_define_method(klass, name, func, argc)
+ VALUE klass;
+ const char *name;
+ VALUE (*func)();
+ int argc;
{
- rb_add_method_cfunc(klass, rb_intern(name), func, argc, NOEX_PUBLIC);
+ ID id = rb_intern(name);
+ int ex = NOEX_PUBLIC;
+
+
+ rb_add_method(klass, id, NEW_CFUNC(func, argc), ex);
}
void
-rb_define_protected_method(VALUE klass, const char *name, VALUE (*func)(ANYARGS), int argc)
+rb_define_protected_method(klass, name, func, argc)
+ VALUE klass;
+ const char *name;
+ VALUE (*func)();
+ int argc;
{
- rb_add_method_cfunc(klass, rb_intern(name), func, argc, NOEX_PROTECTED);
+ rb_add_method(klass, rb_intern(name), NEW_CFUNC(func, argc), NOEX_PROTECTED);
}
void
-rb_define_private_method(VALUE klass, const char *name, VALUE (*func)(ANYARGS), int argc)
+rb_define_private_method(klass, name, func, argc)
+ VALUE klass;
+ const char *name;
+ VALUE (*func)();
+ int argc;
{
- rb_add_method_cfunc(klass, rb_intern(name), func, argc, NOEX_PRIVATE);
+ rb_add_method(klass, rb_intern(name), NEW_CFUNC(func, argc), NOEX_PRIVATE);
}
void
-rb_undef_method(VALUE klass, const char *name)
+rb_undef_method(klass, name)
+ VALUE klass;
+ const char *name;
{
- rb_add_method(klass, rb_intern(name), VM_METHOD_TYPE_UNDEF, 0, NOEX_UNDEF);
+ rb_add_method(klass, rb_intern(name), 0, NOEX_UNDEF);
}
#define SPECIAL_SINGLETON(x,c) do {\
@@ -902,10 +881,10 @@ rb_undef_method(VALUE klass, const char *name)
} while (0)
VALUE
-rb_singleton_class(VALUE obj)
+rb_singleton_class(obj)
+ VALUE obj;
{
VALUE klass;
- ID attached;
if (FIXNUM_P(obj) || SYMBOL_P(obj)) {
rb_raise(rb_eTypeError, "can't define singleton");
@@ -917,178 +896,165 @@ rb_singleton_class(VALUE obj)
rb_bug("unknown immediate %ld", obj);
}
- CONST_ID(attached, "__attached__");
+ DEFER_INTS;
if (FL_TEST(RBASIC(obj)->klass, FL_SINGLETON) &&
- rb_ivar_get(RBASIC(obj)->klass, attached) == obj) {
+ rb_iv_get(RBASIC(obj)->klass, "__attached__") == obj) {
klass = RBASIC(obj)->klass;
}
else {
klass = rb_make_metaclass(obj, RBASIC(obj)->klass);
}
-
- if (BUILTIN_TYPE(obj) == T_CLASS) {
- if (rb_iv_get(RBASIC(klass)->klass, "__attached__") != klass)
- make_metametaclass(klass);
- }
if (OBJ_TAINTED(obj)) {
OBJ_TAINT(klass);
}
else {
FL_UNSET(klass, FL_TAINT);
}
- if (OBJ_UNTRUSTED(obj)) {
- OBJ_UNTRUST(klass);
- }
- else {
- FL_UNSET(klass, FL_UNTRUSTED);
- }
if (OBJ_FROZEN(obj)) OBJ_FREEZE(klass);
+ ALLOW_INTS;
return klass;
}
void
-rb_define_singleton_method(VALUE obj, const char *name, VALUE (*func)(ANYARGS), int argc)
+rb_define_singleton_method(obj, name, func, argc)
+ VALUE obj;
+ const char *name;
+ VALUE (*func)();
+ int argc;
{
rb_define_method(rb_singleton_class(obj), name, func, argc);
}
void
-rb_define_module_function(VALUE module, const char *name, VALUE (*func)(ANYARGS), int argc)
+rb_define_module_function(module, name, func, argc)
+ VALUE module;
+ const char *name;
+ VALUE (*func)();
+ int argc;
{
rb_define_private_method(module, name, func, argc);
rb_define_singleton_method(module, name, func, argc);
}
void
-rb_define_global_function(const char *name, VALUE (*func)(ANYARGS), int argc)
+rb_define_global_function(name, func, argc)
+ const char *name;
+ VALUE (*func)();
+ int argc;
{
rb_define_module_function(rb_mKernel, name, func, argc);
}
void
-rb_define_alias(VALUE klass, const char *name1, const char *name2)
+rb_define_alias(klass, name1, name2)
+ VALUE klass;
+ const char *name1, *name2;
{
rb_alias(klass, rb_intern(name1), rb_intern(name2));
}
void
-rb_define_attr(VALUE klass, const char *name, int read, int write)
+rb_define_attr(klass, name, read, write)
+ VALUE klass;
+ const char *name;
+ int read, write;
{
rb_attr(klass, rb_intern(name), read, write, Qfalse);
}
+#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
int
+#ifdef HAVE_STDARG_PROTOTYPES
rb_scan_args(int argc, const VALUE *argv, const char *fmt, ...)
+#else
+rb_scan_args(argc, argv, fmt, va_alist)
+ int argc;
+ const VALUE *argv;
+ const char *fmt;
+ va_dcl
+#endif
{
- int i;
+ int n, i = 0;
const char *p = fmt;
VALUE *var;
va_list vargs;
- int f_var = 0, f_block = 0;
- int n_lead = 0, n_opt = 0, n_trail = 0, n_mand;
- int argi = 0;
+
+ va_init_list(vargs, fmt);
+
+ if (*p == '*') goto rest_arg;
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++;
+ n = *p - '0';
+ if (n > argc)
+ rb_raise(rb_eArgError, "wrong number of arguments (%d for %d)", argc, n);
+ for (i=0; i<n; i++) {
+ var = va_arg(vargs, VALUE*);
+ if (var) *var = argv[i];
}
- }
- block_arg:
- if (*p == '&') {
- f_block = 1;
p++;
}
- if (*p != '\0') {
- rb_fatal("bad scan arg format: %s", fmt);
+ else {
+ goto error;
}
- n_mand = n_lead + n_trail;
- if (argc < n_mand)
- goto argc_error;
-
- va_start(vargs, fmt);
-
- /* 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;
+ if (ISDIGIT(*p)) {
+ n = i + *p - '0';
+ for (; i<n; i++) {
+ var = va_arg(vargs, VALUE*);
+ if (argc > i) {
+ if (var) *var = argv[i];
+ }
+ else {
+ if (var) *var = Qnil;
+ }
}
+ p++;
}
- /* 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;
+
+ if(*p == '*') {
+ rest_arg:
+ var = va_arg(vargs, VALUE*);
+ if (argc > i) {
+ if (var) *var = rb_ary_new4(argc-i, argv+i);
+ i = argc;
}
else {
if (var) *var = rb_ary_new();
}
+ p++;
}
- /* capture trailing mandatory arguments */
- for (i = n_trail; i-- > 0; ) {
- var = va_arg(vargs, VALUE *);
- if (var) *var = argv[argi];
- argi++;
- }
- /* capture iterator block */
- if (f_block) {
- var = va_arg(vargs, VALUE *);
+
+ if (*p == '&') {
+ var = va_arg(vargs, VALUE*);
if (rb_block_given_p()) {
*var = rb_block_proc();
}
else {
*var = Qnil;
}
+ p++;
}
va_end(vargs);
- if (argi < argc)
- goto argc_error;
+ if (*p != '\0') {
+ goto error;
+ }
+
+ if (argc > i) {
+ rb_raise(rb_eArgError, "wrong number of arguments (%d for %d)", argc, i);
+ }
return argc;
- argc_error:
- if (0 < n_opt)
- rb_raise(rb_eArgError, "wrong number of arguments (%d for %d..%d%s)",
- argc, n_mand, n_mand + n_opt, f_var ? "+" : "");
- else
- rb_raise(rb_eArgError, "wrong number of arguments (%d for %d%s)",
- argc, n_mand, f_var ? "+" : "");
+ error:
+ rb_fatal("bad scan arg format: %s", fmt);
+ return 0;
}
-
-/*!
- * \}
- */
diff --git a/common.mk b/common.mk
index e4fbfe01f1..bf49aade4a 100644
--- a/common.mk
+++ b/common.mk
@@ -2,8 +2,6 @@ bin: $(PROGRAM) $(WPROGRAM)
lib: $(LIBRUBY)
dll: $(LIBRUBY_SO)
-.SUFFIXES: .inc .h .c .y .i
-
RUBYLIB = -
RUBYOPT = -
@@ -16,30 +14,23 @@ STATIC_RUBY = static-ruby
EXTCONF = extconf.rb
RBCONFIG = ./.rbconfig.time
LIBRUBY_EXTS = ./.libruby-with-ext.time
-REVISION_H = ./.revision.time
RDOCOUT = $(EXTOUT)/rdoc
-ID_H_TARGET = -id.h-
DMYEXT = dmyext.$(OBJEXT)
-NORMALMAINOBJ = main.$(OBJEXT)
-MAINOBJ = $(NORMALMAINOBJ)
+MAINOBJ = main.$(OBJEXT)
EXTOBJS =
DLDOBJS = $(DMYEXT)
-MINIOBJS = $(ARCHMINIOBJS) dmyencoding.$(OBJEXT) miniprelude.$(OBJEXT)
-ENC_MK = enc.mk
-COMMONOBJS = array.$(OBJEXT) \
+OBJS = array.$(OBJEXT) \
bignum.$(OBJEXT) \
class.$(OBJEXT) \
compar.$(OBJEXT) \
- complex.$(OBJEXT) \
dir.$(OBJEXT) \
+ dln.$(OBJEXT) \
enum.$(OBJEXT) \
enumerator.$(OBJEXT) \
error.$(OBJEXT) \
eval.$(OBJEXT) \
- load.$(OBJEXT) \
- proc.$(OBJEXT) \
file.$(OBJEXT) \
gc.$(OBJEXT) \
hash.$(OBJEXT) \
@@ -52,58 +43,28 @@ COMMONOBJS = array.$(OBJEXT) \
pack.$(OBJEXT) \
parse.$(OBJEXT) \
process.$(OBJEXT) \
+ prec.$(OBJEXT) \
random.$(OBJEXT) \
range.$(OBJEXT) \
- rational.$(OBJEXT) \
re.$(OBJEXT) \
- regcomp.$(OBJEXT) \
- regenc.$(OBJEXT) \
- regerror.$(OBJEXT) \
- regexec.$(OBJEXT) \
- regparse.$(OBJEXT) \
- regsyntax.$(OBJEXT) \
+ regex.$(OBJEXT) \
ruby.$(OBJEXT) \
- safe.$(OBJEXT) \
signal.$(OBJEXT) \
sprintf.$(OBJEXT) \
st.$(OBJEXT) \
- strftime.$(OBJEXT) \
string.$(OBJEXT) \
struct.$(OBJEXT) \
time.$(OBJEXT) \
- transcode.$(OBJEXT) \
util.$(OBJEXT) \
variable.$(OBJEXT) \
version.$(OBJEXT) \
- compile.$(OBJEXT) \
- debug.$(OBJEXT) \
- iseq.$(OBJEXT) \
- vm.$(OBJEXT) \
- vm_dump.$(OBJEXT) \
- thread.$(OBJEXT) \
- cont.$(OBJEXT) \
- $(BUILTIN_ENCOBJS) \
- $(BUILTIN_TRANSOBJS) \
$(MISSING)
-OBJS = dln.$(OBJEXT) \
- encoding.$(OBJEXT) \
- prelude.$(OBJEXT) \
- $(COMMONOBJS)
-
-GOLFOBJS = goruby.$(OBJEXT) golf_prelude.$(OBJEXT)
-
-PRELUDE_SCRIPTS = $(srcdir)/prelude.rb $(srcdir)/enc/prelude.rb $(srcdir)/gem_prelude.rb
-PRELUDES = prelude.c miniprelude.c
-GOLFPRELUDES = golf_prelude.c
-
SCRIPT_ARGS = --dest-dir="$(DESTDIR)" \
--extout="$(EXTOUT)" \
--mflags="$(MFLAGS)" \
--make-flags="$(MAKEFLAGS)"
-EXTMK_ARGS = $(SCRIPT_ARGS) --extension $(EXTS) --extstatic $(EXTSTATIC) \
- --make-flags="MINIRUBY='$(MINIRUBY)'" --
-INSTRUBY = $(MINIRUBY) $(srcdir)/tool/rbinstall.rb
+EXTMK_ARGS = $(SCRIPT_ARGS) --extension $(EXTS) --extstatic $(EXTSTATIC) --
INSTRUBY_ARGS = $(SCRIPT_ARGS) \
--data-mode=$(INSTALL_DATA_MODE) \
--prog-mode=$(INSTALL_PROG_MODE) \
@@ -117,49 +78,17 @@ PRE_LIBRUBY_UPDATE = $(MINIRUBY) -e 'ARGV[1] or File.unlink(ARGV[0]) rescue nil'
TESTSDIR = $(srcdir)/test
TESTWORKDIR = testwork
-TESTRUN_SCRIPT = $(srcdir)/test.rb
-
-BOOTSTRAPRUBY = $(BASERUBY)
-
-COMPILE_PRELUDE = $(MINIRUBY) -I$(srcdir) -I. -rrbconfig $(srcdir)/tool/compile_prelude.rb
-
-all: encs exts main
-
-main: exts
- @$(RUNCMD) $(MKMAIN_CMD) $(MAKE)
-
-exts: $(MKMAIN_CMD)
-
-$(MKMAIN_CMD): $(MKFILES) incs $(PREP) $(RBCONFIG) $(LIBRUBY)
- @$(MINIRUBY) $(srcdir)/ext/extmk.rb --make="$(MAKE)" --command-output=$@ $(EXTMK_ARGS)
-
+all: $(MKFILES) $(PREP) $(RBCONFIG) $(LIBRUBY)
+ @$(MINIRUBY) $(srcdir)/ext/extmk.rb --make="$(MAKE)" $(EXTMK_ARGS)
prog: $(PROGRAM) $(WPROGRAM)
-loadpath: $(PREP) PHONY
- $(MINIRUBY) -e 'p $$:'
-
-$(PREP): $(MKFILES)
-
-miniruby$(EXEEXT): config.status $(NORMALMAINOBJ) $(MINIOBJS) $(COMMONOBJS) $(DMYEXT) $(ARCHFILE)
-
-GORUBY = go$(RUBY_INSTALL_NAME)
-golf: $(LIBRUBY) $(GOLFOBJS) PHONY
- $(MAKE) $(MFLAGS) MAINOBJ="$(GOLFOBJS)" PROGRAM=$(GORUBY)$(EXEEXT) program
-capi: Doxyfile PHONY
- @$(MAKEDIRS) doc/capi
- @$(DOXYGEN)
-
-Doxyfile: $(srcdir)/template/Doxyfile.tmpl $(PREP) $(srcdir)/tool/generic_erb.rb $(RBCONFIG)
- $(MINIRUBY) $(srcdir)/tool/generic_erb.rb -o $@ $(srcdir)/template/Doxyfile.tmpl \
- --srcdir="$(srcdir)" --miniruby="$(MINIRUBY)"
-
-program: $(PROGRAM)
+miniruby$(EXEEXT): config.status $(LIBRUBY_A) $(MAINOBJ) $(MINIOBJS) $(OBJS) $(DMYEXT)
$(PROGRAM): $(LIBRUBY) $(MAINOBJ) $(OBJS) $(EXTOBJS) $(SETUP) $(PREP)
$(LIBRUBY_A): $(OBJS) $(DMYEXT) $(ARCHFILE)
-$(LIBRUBY_SO): $(OBJS) $(DLDOBJS) $(LIBRUBY_A) $(PREP) $(LIBRUBY_SO_UPDATE) $(BUILTIN_ENCOBJS)
+$(LIBRUBY_SO): $(OBJS) $(DLDOBJS) $(LIBRUBY_A) $(PREP) $(LIBRUBY_SO_UPDATE)
$(LIBRUBY_EXTS):
@exit > $@
@@ -172,80 +101,76 @@ ruby.imp: $(OBJS)
@$(NM) -Pgp $(OBJS) | awk 'BEGIN{print "#!"}; $$2~/^[BD]$$/{print $$1}' | sort -u -o $@
install: install-nodoc $(RDOCTARGET)
-install-all: install-nodoc install-doc install-capi
+install-all: install-nodoc install-doc
install-nodoc: pre-install-nodoc do-install-nodoc post-install-nodoc
pre-install-nodoc:: pre-install-local pre-install-ext
-do-install-nodoc: $(PREP)
- $(INSTRUBY) --make="$(MAKE)" $(INSTRUBY_ARGS) --mantype="$(MANTYPE)"
+do-install-nodoc:
+ $(MINIRUBY) $(srcdir)/instruby.rb --make="$(MAKE)" $(INSTRUBY_ARGS) --mantype="$(MANTYPE)"
post-install-nodoc:: post-install-local post-install-ext
install-local: pre-install-local do-install-local post-install-local
pre-install-local:: pre-install-bin pre-install-lib pre-install-man
-do-install-local: $(PREP)
- $(INSTRUBY) --make="$(MAKE)" $(INSTRUBY_ARGS) --install=local --mantype="$(MANTYPE)"
+do-install-local:
+ $(MINIRUBY) $(srcdir)/instruby.rb --make="$(MAKE)" $(INSTRUBY_ARGS) --install=local --mantype="$(MANTYPE)"
+loadpath: $(PREP)
+ $(MINIRUBY) -e 'p $$:'
+
post-install-local:: post-install-bin post-install-lib post-install-man
install-ext: pre-install-ext do-install-ext post-install-ext
pre-install-ext:: pre-install-ext-arch pre-install-ext-comm
-do-install-ext: $(PREP)
- $(INSTRUBY) --make="$(MAKE)" $(INSTRUBY_ARGS) --install=ext
+do-install-ext:
+ $(MINIRUBY) $(srcdir)/instruby.rb --make="$(MAKE)" $(INSTRUBY_ARGS) --install=ext
post-install-ext:: post-install-ext-arch post-install-ext-comm
install-arch: pre-install-arch do-install-arch post-install-arch
pre-install-arch:: pre-install-bin pre-install-ext-arch
-do-install-arch: $(PREP)
- $(INSTRUBY) --make="$(MAKE)" $(INSTRUBY_ARGS) --install=bin --install=ext-arch
+do-install-arch:
+ $(MINIRUBY) $(srcdir)/instruby.rb --make="$(MAKE)" $(INSTRUBY_ARGS) --install=bin --install=ext-arch
post-install-arch:: post-install-bin post-install-ext-arch
install-comm: pre-install-comm do-install-comm post-install-comm
pre-install-comm:: pre-install-lib pre-install-ext-comm pre-install-man
-do-install-comm: $(PREP)
- $(INSTRUBY) --make="$(MAKE)" $(INSTRUBY_ARGS) --install=lib --install=ext-comm --install=man
+do-install-comm:
+ $(MINIRUBY) $(srcdir)/instruby.rb --make="$(MAKE)" $(INSTRUBY_ARGS) --install=lib --install=ext-comm --install=man
post-install-comm:: post-install-lib post-install-ext-comm post-install-man
install-bin: pre-install-bin do-install-bin post-install-bin
pre-install-bin:: install-prereq
-do-install-bin: $(PREP)
- $(INSTRUBY) --make="$(MAKE)" $(INSTRUBY_ARGS) --install=bin
+do-install-bin:
+ $(MINIRUBY) $(srcdir)/instruby.rb --make="$(MAKE)" $(INSTRUBY_ARGS) --install=bin
post-install-bin::
@$(NULLCMD)
install-lib: pre-install-lib do-install-lib post-install-lib
pre-install-lib:: install-prereq
-do-install-lib: $(PREP)
- $(INSTRUBY) --make="$(MAKE)" $(INSTRUBY_ARGS) --install=lib
+do-install-lib:
+ $(MINIRUBY) $(srcdir)/instruby.rb --make="$(MAKE)" $(INSTRUBY_ARGS) --install=lib
post-install-lib::
@$(NULLCMD)
install-ext-comm: pre-install-ext-comm do-install-ext-comm post-install-ext-comm
pre-install-ext-comm:: install-prereq
-do-install-ext-comm: $(PREP)
- $(INSTRUBY) --make="$(MAKE)" $(INSTRUBY_ARGS) --install=ext-comm
+do-install-ext-comm:
+ $(MINIRUBY) $(srcdir)/instruby.rb --make="$(MAKE)" $(INSTRUBY_ARGS) --install=ext-comm
post-install-ext-comm::
@$(NULLCMD)
install-ext-arch: pre-install-ext-arch do-install-ext-arch post-install-ext-arch
pre-install-ext-arch:: install-prereq
-do-install-ext-arch: $(PREP)
- $(INSTRUBY) --make="$(MAKE)" $(INSTRUBY_ARGS) --install=ext-arch
+do-install-ext-arch:
+ $(MINIRUBY) $(srcdir)/instruby.rb --make="$(MAKE)" $(INSTRUBY_ARGS) --install=ext-arch
post-install-ext-arch::
@$(NULLCMD)
install-man: pre-install-man do-install-man post-install-man
pre-install-man:: install-prereq
-do-install-man: $(PREP)
- $(INSTRUBY) --make="$(MAKE)" $(INSTRUBY_ARGS) --install=man --mantype="$(MANTYPE)"
+do-install-man:
+ $(MINIRUBY) $(srcdir)/instruby.rb --make="$(MAKE)" $(INSTRUBY_ARGS) --install=man --mantype="$(MANTYPE)"
post-install-man::
@$(NULLCMD)
-install-capi: capi pre-install-capi do-install-capi post-install-capi
-pre-install-capi:: install-prereq
-do-install-capi: $(PREP)
- $(INSTRUBY) --make="$(MAKE)" $(INSTRUBY_ARGS) --install=capi
-post-install-capi::
- @$(NULLCMD)
-
what-where: no-install
no-install: no-install-nodoc no-install-doc
what-where-all: no-install-all
@@ -254,82 +179,82 @@ no-install-all: no-install-nodoc
what-where-nodoc: no-install-nodoc
no-install-nodoc: pre-no-install-nodoc dont-install-nodoc post-no-install-nodoc
pre-no-install-nodoc:: pre-no-install-local pre-no-install-ext
-dont-install-nodoc: $(PREP)
- $(INSTRUBY) -n --make="$(MAKE)" $(INSTRUBY_ARGS) --mantype="$(MANTYPE)"
+dont-install-nodoc:
+ $(MINIRUBY) $(srcdir)/instruby.rb -n --make="$(MAKE)" $(INSTRUBY_ARGS) --mantype="$(MANTYPE)"
post-no-install-nodoc:: post-no-install-local post-no-install-ext
what-where-local: no-install-local
no-install-local: pre-no-install-local dont-install-local post-no-install-local
pre-no-install-local:: pre-no-install-bin pre-no-install-lib pre-no-install-man
-dont-install-local: $(PREP)
- $(INSTRUBY) -n --make="$(MAKE)" $(INSTRUBY_ARGS) --install=local --mantype="$(MANTYPE)"
+dont-install-local:
+ $(MINIRUBY) $(srcdir)/instruby.rb -n --make="$(MAKE)" $(INSTRUBY_ARGS) --install=local --mantype="$(MANTYPE)"
post-no-install-local:: post-no-install-bin post-no-install-lib post-no-install-man
what-where-ext: no-install-ext
no-install-ext: pre-no-install-ext dont-install-ext post-no-install-ext
pre-no-install-ext:: pre-no-install-ext-arch pre-no-install-ext-comm
-dont-install-ext: $(PREP)
- $(INSTRUBY) -n --make="$(MAKE)" $(INSTRUBY_ARGS) --install=ext
+dont-install-ext:
+ $(MINIRUBY) $(srcdir)/instruby.rb -n --make="$(MAKE)" $(INSTRUBY_ARGS) --install=ext
post-no-install-ext:: post-no-install-ext-arch post-no-install-ext-comm
what-where-arch: no-install-arch
no-install-arch: pre-no-install-arch dont-install-arch post-no-install-arch
pre-no-install-arch:: pre-no-install-bin pre-no-install-ext-arch
-dont-install-arch: $(PREP)
- $(INSTRUBY) -n --make="$(MAKE)" $(INSTRUBY_ARGS) --install=bin --install=ext-arch
+dont-install-arch:
+ $(MINIRUBY) $(srcdir)/instruby.rb -n --make="$(MAKE)" $(INSTRUBY_ARGS) --install=bin --install=ext-arch
post-no-install-arch:: post-no-install-lib post-no-install-man post-no-install-ext-arch
what-where-comm: no-install-comm
no-install-comm: pre-no-install-comm dont-install-comm post-no-install-comm
pre-no-install-comm:: pre-no-install-lib pre-no-install-ext-comm pre-no-install-man
-dont-install-comm: $(PREP)
- $(INSTRUBY) -n --make="$(MAKE)" $(INSTRUBY_ARGS) --install=lib --install=ext-comm --install=man
+dont-install-comm:
+ $(MINIRUBY) $(srcdir)/instruby.rb -n --make="$(MAKE)" $(INSTRUBY_ARGS) --install=lib --install=ext-comm --install=man
post-no-install-comm:: post-no-install-lib post-no-install-ext-comm post-no-install-man
what-where-bin: no-install-bin
no-install-bin: pre-no-install-bin dont-install-bin post-no-install-bin
pre-no-install-bin:: install-prereq
-dont-install-bin: $(PREP)
- $(INSTRUBY) -n --make="$(MAKE)" $(INSTRUBY_ARGS) --install=bin
+dont-install-bin:
+ $(MINIRUBY) $(srcdir)/instruby.rb -n --make="$(MAKE)" $(INSTRUBY_ARGS) --install=bin
post-no-install-bin::
@$(NULLCMD)
what-where-lib: no-install-lib
no-install-lib: pre-no-install-lib dont-install-lib post-no-install-lib
pre-no-install-lib:: install-prereq
-dont-install-lib: $(PREP)
- $(INSTRUBY) -n --make="$(MAKE)" $(INSTRUBY_ARGS) --install=lib
+dont-install-lib:
+ $(MINIRUBY) $(srcdir)/instruby.rb -n --make="$(MAKE)" $(INSTRUBY_ARGS) --install=lib
post-no-install-lib::
@$(NULLCMD)
what-where-ext-comm: no-install-ext-comm
no-install-ext-comm: pre-no-install-ext-comm dont-install-ext-comm post-no-install-ext-comm
pre-no-install-ext-comm:: install-prereq
-dont-install-ext-comm: $(PREP)
- $(INSTRUBY) -n --make="$(MAKE)" $(INSTRUBY_ARGS) --install=ext-comm
+dont-install-ext-comm:
+ $(MINIRUBY) $(srcdir)/instruby.rb -n --make="$(MAKE)" $(INSTRUBY_ARGS) --install=ext-comm
post-no-install-ext-comm::
@$(NULLCMD)
what-where-ext-arch: no-install-ext-arch
no-install-ext-arch: pre-no-install-ext-arch dont-install-ext-arch post-no-install-ext-arch
pre-no-install-ext-arch:: install-prereq
-dont-install-ext-arch: $(PREP)
- $(INSTRUBY) -n --make="$(MAKE)" $(INSTRUBY_ARGS) --install=ext-arch
+dont-install-ext-arch:
+ $(MINIRUBY) $(srcdir)/instruby.rb -n --make="$(MAKE)" $(INSTRUBY_ARGS) --install=ext-arch
post-no-install-ext-arch::
@$(NULLCMD)
what-where-man: no-install-man
no-install-man: pre-no-install-man dont-install-man post-no-install-man
pre-no-install-man:: install-prereq
-dont-install-man: $(PREP)
- $(INSTRUBY) -n --make="$(MAKE)" $(INSTRUBY_ARGS) --install=man --mantype="$(MANTYPE)"
+dont-install-man:
+ $(MINIRUBY) $(srcdir)/instruby.rb -n --make="$(MAKE)" $(INSTRUBY_ARGS) --install=man --mantype="$(MANTYPE)"
post-no-install-man::
@$(NULLCMD)
install-doc: rdoc pre-install-doc do-install-doc post-install-doc
pre-install-doc:: install-prereq
do-install-doc: $(PROGRAM)
- $(INSTRUBY) --make="$(MAKE)" $(INSTRUBY_ARGS) --install=rdoc --rdoc-output="$(RDOCOUT)"
+ $(MINIRUBY) $(srcdir)/instruby.rb --make="$(MAKE)" $(INSTRUBY_ARGS) --install=rdoc --rdoc-output="$(RDOCOUT)"
post-install-doc::
@$(NULLCMD)
@@ -340,119 +265,67 @@ rdoc: $(PROGRAM) PHONY
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 --rdoc-output="$(RDOCOUT)"
+dont-install-doc::
+ $(MINIRUBY) $(srcdir)/instruby.rb -n --make="$(MAKE)" $(INSTRUBY_ARGS) --install=rdoc --rdoc-output="$(RDOCOUT)"
post-no-install-doc::
@$(NULLCMD)
CLEAR_INSTALLED_LIST = clear-installed-list
-install-prereq: $(CLEAR_INSTALLED_LIST) PHONY
+install-prereq: $(CLEAR_INSTALLED_LIST)
-clear-installed-list: PHONY
+clear-installed-list:
@exit > $(INSTALLED_LIST)
-clean: clean-ext clean-local clean-enc clean-golf clean-rdoc clean-extout
-clean-local:: PHONY
+clean: clean-ext clean-local
+clean-local::
@$(RM) $(OBJS) $(MINIOBJS) $(MAINOBJ) $(LIBRUBY_A) $(LIBRUBY_SO) $(LIBRUBY) $(LIBRUBY_ALIASES)
@$(RM) $(PROGRAM) $(WPROGRAM) miniruby$(EXEEXT) dmyext.$(OBJEXT) $(ARCHFILE) .*.time
- @$(RM) *.inc y.tab.c y.output encdb.h transdb.h
-clean-ext:: PHONY
-clean-golf: PHONY
- @$(RM) $(GORUBY)$(EXEEXT) $(GOLFOBJS)
-clean-rdoc: PHONY
-clean-extout: PHONY
- @-$(RMDIRS) $(EXTOUT)/$(arch)
-
-distclean: distclean-ext distclean-local distclean-enc distclean-golf distclean-extout
+ @$(RM) y.tab.c y.output
+clean-ext:
+ @-$(MINIRUBY) $(srcdir)/ext/extmk.rb --make="$(MAKE)" $(EXTMK_ARGS) clean
+
+distclean: distclean-ext distclean-local
distclean-local:: clean-local
- @$(RM) $(MKFILES) rbconfig.rb yasmdata.rb encdb.h
- @$(RM) config.cache config.log config.status config.status.lineno $(PRELUDES)
+ @$(RM) $(MKFILES) config.h rbconfig.rb
+ @$(RM) config.cache config.log config.status
@$(RM) *~ *.bak *.stackdump core *.core gmon.out $(PREP)
-distclean-ext:: PHONY
-distclean-golf: clean-golf
- @$(RM) $(GOLFPRELUDES)
-distclean-rdoc: PHONY
-distclean-extout: clean-extout
- @-$(RMDIRS) $(EXTOUT)
-
-realclean:: realclean-ext realclean-local realclean-enc realclean-golf realclean-extout
+distclean-ext:
+ @-$(MINIRUBY) $(srcdir)/ext/extmk.rb --make="$(MAKE)" $(EXTMK_ARGS) distclean
+
+realclean:: realclean-ext realclean-local
realclean-local:: distclean-local
- @$(RM) parse.c parse.h lex.c newline.c revision.h
+ @$(RM) parse.c lex.c
realclean-ext::
-realclean-golf: distclean-golf
-realclean-extout: distclean-extout
-
-clean-enc distclean-enc realclean-enc:
- @echo $(@:-enc=ing) encodings
- @-$(MAKE) -f $(ENC_MK) $(MFLAGS) $(@:-enc=)
+ @-$(MINIRUBY) $(srcdir)/ext/extmk.rb --make="$(MAKE)" $(EXTMK_ARGS) realclean
check: test test-all
-btest: miniruby$(EXEEXT) PHONY
- $(BOOTSTRAPRUBY) "$(srcdir)/bootstraptest/runner.rb" --ruby="$(MINIRUBY)" $(OPTS)
-
-btest-ruby: miniruby$(EXEEXT) $(RBCONFIG) $(PROGRAM) PHONY
- @$(RUNRUBY) "$(srcdir)/bootstraptest/runner.rb" --ruby="$(PROGRAM) -I$(srcdir)/lib" -q $(OPTS)
-
-test-sample: miniruby$(EXEEXT) $(RBCONFIG) $(PROGRAM) PHONY
- @$(RUNRUBY) $(srcdir)/tool/rubytest.rb
-
-test-knownbug: miniruby$(EXEEXT) $(PROGRAM) $(RBCONFIG) PHONY
- $(MINIRUBY) "$(srcdir)/bootstraptest/runner.rb" --ruby="$(PROGRAM)" $(OPTS) $(srcdir)/KNOWNBUGS.rb
-
-test: test-sample btest-ruby test-knownbug
+test: miniruby$(EXEEXT) $(RBCONFIG) $(PROGRAM) PHONY
+ @$(MINIRUBY) $(srcdir)/rubytest.rb
test-all:
- $(RUNRUBY) "$(srcdir)/test/runner.rb" $(TESTS)
+ $(RUNRUBY) "$(srcdir)/test/runner.rb" --basedir="$(TESTSDIR)" --runner=$(TESTUI) $(TESTS)
-extconf: $(PREP)
- $(MAKEDIRS) "$(EXTCONFDIR)"
+extconf:
+ $(MINIRUBY) -run -e mkdir -- -p "$(EXTCONFDIR)"
$(RUNRUBY) -C "$(EXTCONFDIR)" $(EXTCONF) $(EXTCONFARGS)
-$(RBCONFIG): $(srcdir)/tool/mkconfig.rb config.status $(PREP)
- @$(MINIRUBY) $(srcdir)/tool/mkconfig.rb -timestamp=$@ \
+$(RBCONFIG): $(srcdir)/mkconfig.rb config.status $(PREP)
+ @$(MINIRUBY) $(srcdir)/mkconfig.rb -timestamp=$@ \
-install_name=$(RUBY_INSTALL_NAME) \
-so_name=$(RUBY_SO_NAME) rbconfig.rb
-encs: enc trans
-encs enc trans: $(ENC_MK) $(LIBRUBY) $(PREP)
- $(MAKE) -f $(ENC_MK) RUBY="$(MINIRUBY)" MINIRUBY="$(MINIRUBY)" $(MFLAGS) $@
-
-enc: {$(VPATH)}encdb.h
-trans: {$(VPATH)}transdb.h
-
-$(ENC_MK): $(srcdir)/enc/make_encmake.rb $(srcdir)/enc/Makefile.in $(srcdir)/enc/depend \
- $(srcdir)/lib/mkmf.rb $(RBCONFIG)
- $(MINIRUBY) $(srcdir)/enc/make_encmake.rb --builtin-encs="$(BUILTIN_ENCOBJS)" --builtin-transes="$(BUILTIN_TRANSOBJS)" $@ $(ENCS)
-
.PRECIOUS: $(MKFILES)
-.PHONY: PHONY all fake prereq incs srcs preludes help
.PHONY: test install install-nodoc install-doc dist
-.PHONY: loadpath golf capi rdoc install-prereq clear-installed-list
-.PHONY: clean clean-ext clean-local clean-enc clean-golf clean-rdoc clean-extout
-.PHONY: distclean distclean-ext distclean-local distclean-enc distclean-golf distclean-extout
-.PHONY: realclean realclean-ext realclean-local realclean-enc realclean-golf realclean-extout
-.PHONY: check test test-all btest btest-ruby test-sample test-knownbug
-.PHONY: run runruby parse benchmark benchmark-each tbench gdb gdb-ruby
-.PHONY: update-mspec update-rubyspec test-rubyspec
PHONY:
-{$(VPATH)}parse.c: {$(VPATH)}parse.y $(srcdir)/tool/ytab.sed
-parse.h {$(VPATH)}parse.h: {$(VPATH)}parse.c
-
-{$(srcdir)}.y.c:
- $(YACC) -d $(YFLAGS) -o y.tab.c $(SRC_FILE)
- sed -f $(srcdir)/tool/ytab.sed -e "/^#/s!y\.tab\.c!$@!" y.tab.c > $@.new
- @$(MV) $@.new $@
- sed -e "/^#line.*y\.tab\.h/d;/^#line.*parse\.y/d" y.tab.h > $(@:.c=.h).new
- @$(IFCHANGE) $(@:.c=.h) $(@:.c=.h).new
- @$(RM) y.tab.c y.tab.h
+{$(VPATH)}parse.c: parse.y
acosh.$(OBJEXT): {$(VPATH)}acosh.c
-alloca.$(OBJEXT): {$(VPATH)}alloca.c {$(VPATH)}config.h
+alloca.$(OBJEXT): {$(VPATH)}alloca.c
crypt.$(OBJEXT): {$(VPATH)}crypt.c
dup2.$(OBJEXT): {$(VPATH)}dup2.c
erf.$(OBJEXT): {$(VPATH)}erf.c
@@ -461,333 +334,135 @@ flock.$(OBJEXT): {$(VPATH)}flock.c
memcmp.$(OBJEXT): {$(VPATH)}memcmp.c
memmove.$(OBJEXT): {$(VPATH)}memmove.c
mkdir.$(OBJEXT): {$(VPATH)}mkdir.c
+vsnprintf.$(OBJEXT): {$(VPATH)}vsnprintf.c
+strcasecmp.$(OBJEXT): {$(VPATH)}strcasecmp.c
+strncasecmp.$(OBJEXT): {$(VPATH)}strncasecmp.c
strchr.$(OBJEXT): {$(VPATH)}strchr.c
strdup.$(OBJEXT): {$(VPATH)}strdup.c
strerror.$(OBJEXT): {$(VPATH)}strerror.c
+strftime.$(OBJEXT): {$(VPATH)}strftime.c
strstr.$(OBJEXT): {$(VPATH)}strstr.c
strtod.$(OBJEXT): {$(VPATH)}strtod.c
strtol.$(OBJEXT): {$(VPATH)}strtol.c
+strtoul.$(OBJEXT): {$(VPATH)}strtoul.c
nt.$(OBJEXT): {$(VPATH)}nt.c
+x68.$(OBJEXT): {$(VPATH)}x68.c
os2.$(OBJEXT): {$(VPATH)}os2.c
dl_os2.$(OBJEXT): {$(VPATH)}dl_os2.c
ia64.$(OBJEXT): {$(VPATH)}ia64.s
$(CC) $(CFLAGS) -c $<
-win32.$(OBJEXT): {$(VPATH)}win32.c $(RUBY_H_INCLUDES)
+# when I use -I., there is confliction at "OpenFile"
+# so, set . into environment varible "include"
+win32.$(OBJEXT): {$(VPATH)}win32.c
###
-RUBY_H_INCLUDES = {$(VPATH)}ruby.h {$(VPATH)}config.h {$(VPATH)}defines.h \
- {$(VPATH)}intern.h {$(VPATH)}missing.h {$(VPATH)}st.h
-ENCODING_H_INCLUDES= {$(VPATH)}encoding.h {$(VPATH)}oniguruma.h
-ID_H_INCLUDES = {$(VPATH)}id.h
-VM_CORE_H_INCLUDES = {$(VPATH)}vm_core.h {$(VPATH)}vm_opts.h \
- {$(VPATH)}thread_$(THREAD_MODEL).h \
- {$(VPATH)}node.h {$(VPATH)}method.h $(ID_H_INCLUDES)
-
-array.$(OBJEXT): {$(VPATH)}array.c $(RUBY_H_INCLUDES) {$(VPATH)}util.h
-bignum.$(OBJEXT): {$(VPATH)}bignum.c $(RUBY_H_INCLUDES) {$(VPATH)}util.h
-class.$(OBJEXT): {$(VPATH)}class.c $(RUBY_H_INCLUDES) {$(VPATH)}node.h
-compar.$(OBJEXT): {$(VPATH)}compar.c $(RUBY_H_INCLUDES)
-complex.$(OBJEXT): {$(VPATH)}complex.c $(RUBY_H_INCLUDES)
-dir.$(OBJEXT): {$(VPATH)}dir.c $(RUBY_H_INCLUDES) {$(VPATH)}util.h \
- $(ENCODING_H_INCLUDES)
-dln.$(OBJEXT): {$(VPATH)}dln.c {$(VPATH)}dln.h $(RUBY_H_INCLUDES)
+array.$(OBJEXT): {$(VPATH)}array.c {$(VPATH)}ruby.h config.h \
+ {$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h \
+ {$(VPATH)}util.h {$(VPATH)}st.h
+bignum.$(OBJEXT): {$(VPATH)}bignum.c {$(VPATH)}ruby.h config.h \
+ {$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h \
+ {$(VPATH)}rubysig.h
+class.$(OBJEXT): {$(VPATH)}class.c {$(VPATH)}ruby.h config.h \
+ {$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h \
+ {$(VPATH)}rubysig.h {$(VPATH)}node.h {$(VPATH)}st.h
+compar.$(OBJEXT): {$(VPATH)}compar.c {$(VPATH)}ruby.h config.h \
+ {$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h
+dir.$(OBJEXT): {$(VPATH)}dir.c {$(VPATH)}ruby.h config.h \
+ {$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h \
+ {$(VPATH)}util.h
+dln.$(OBJEXT): {$(VPATH)}dln.c {$(VPATH)}ruby.h config.h \
+ {$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h \
+ {$(VPATH)}dln.h
dmydln.$(OBJEXT): {$(VPATH)}dmydln.c dln.$(OBJEXT)
dmyext.$(OBJEXT): {$(VPATH)}dmyext.c
-dmyencoding.$(OBJEXT): {$(VPATH)}dmyencoding.c $(RUBY_H_INCLUDES) \
- {$(VPATH)}regenc.h {$(VPATH)}util.h $(ENCODING_H_INCLUDES) \
- {$(VPATH)}encoding.c
-encoding.$(OBJEXT): {$(VPATH)}encoding.c $(RUBY_H_INCLUDES) \
- $(ENCODING_H_INCLUDES) {$(VPATH)}regenc.h {$(VPATH)}util.h
-enum.$(OBJEXT): {$(VPATH)}enum.c $(RUBY_H_INCLUDES) {$(VPATH)}node.h \
- {$(VPATH)}util.h
-enumerator.$(OBJEXT): {$(VPATH)}enumerator.c $(RUBY_H_INCLUDES)
-error.$(OBJEXT): {$(VPATH)}error.c {$(VPATH)}known_errors.inc $(RUBY_H_INCLUDES) \
- $(VM_CORE_H_INCLUDES) {$(VPATH)}debug.h
-eval.$(OBJEXT): {$(VPATH)}eval.c {$(VPATH)}eval_intern.h \
- $(RUBY_H_INCLUDES) $(VM_CORE_H_INCLUDES) {$(VPATH)}eval_error.c \
- {$(VPATH)}eval_jump.c {$(VPATH)}debug.h {$(VPATH)}gc.h \
- {$(VPATH)}iseq.h
-load.$(OBJEXT): {$(VPATH)}load.c {$(VPATH)}eval_intern.h \
- {$(VPATH)}util.h $(RUBY_H_INCLUDES) $(VM_CORE_H_INCLUDES) \
- {$(VPATH)}dln.h {$(VPATH)}debug.h
-file.$(OBJEXT): {$(VPATH)}file.c $(RUBY_H_INCLUDES) {$(VPATH)}io.h \
- $(ENCODING_H_INCLUDES) {$(VPATH)}util.h {$(VPATH)}dln.h
-gc.$(OBJEXT): {$(VPATH)}gc.c $(RUBY_H_INCLUDES) {$(VPATH)}re.h \
- {$(VPATH)}regex.h $(ENCODING_H_INCLUDES) $(VM_CORE_H_INCLUDES) \
- {$(VPATH)}gc.h {$(VPATH)}io.h {$(VPATH)}eval_intern.h {$(VPATH)}util.h \
- {$(VPATH)}debug.h
-hash.$(OBJEXT): {$(VPATH)}hash.c $(RUBY_H_INCLUDES) {$(VPATH)}util.h
-inits.$(OBJEXT): {$(VPATH)}inits.c $(RUBY_H_INCLUDES)
-io.$(OBJEXT): {$(VPATH)}io.c $(RUBY_H_INCLUDES) {$(VPATH)}io.h \
- {$(VPATH)}util.h $(ENCODING_H_INCLUDES)
-main.$(OBJEXT): {$(VPATH)}main.c $(RUBY_H_INCLUDES) {$(VPATH)}debug.h \
- {$(VPATH)}node.h
-marshal.$(OBJEXT): {$(VPATH)}marshal.c $(RUBY_H_INCLUDES) {$(VPATH)}io.h \
- $(ENCODING_H_INCLUDES) {$(VPATH)}util.h
-math.$(OBJEXT): {$(VPATH)}math.c $(RUBY_H_INCLUDES)
-numeric.$(OBJEXT): {$(VPATH)}numeric.c $(RUBY_H_INCLUDES) {$(VPATH)}util.h \
- $(ENCODING_H_INCLUDES)
-object.$(OBJEXT): {$(VPATH)}object.c $(RUBY_H_INCLUDES) {$(VPATH)}util.h
-pack.$(OBJEXT): {$(VPATH)}pack.c $(RUBY_H_INCLUDES)
-parse.$(OBJEXT): {$(VPATH)}parse.c $(RUBY_H_INCLUDES) \
- {$(VPATH)}node.h $(ENCODING_H_INCLUDES) $(ID_H_INCLUDES) \
- {$(VPATH)}regenc.h {$(VPATH)}regex.h {$(VPATH)}util.h {$(VPATH)}lex.c \
- {$(VPATH)}defs/keywords {$(VPATH)}id.c
-proc.$(OBJEXT): {$(VPATH)}proc.c {$(VPATH)}eval_intern.h \
- $(RUBY_H_INCLUDES) {$(VPATH)}gc.h $(VM_CORE_H_INCLUDES) \
- {$(VPATH)}debug.h
-process.$(OBJEXT): {$(VPATH)}process.c $(RUBY_H_INCLUDES) \
- {$(VPATH)}util.h {$(VPATH)}io.h $(ENCODING_H_INCLUDES) {$(VPATH)}dln.h \
- $(VM_CORE_H_INCLUDES) {$(VPATH)}debug.h
-random.$(OBJEXT): {$(VPATH)}random.c $(RUBY_H_INCLUDES)
-range.$(OBJEXT): {$(VPATH)}range.c $(RUBY_H_INCLUDES) \
- $(ENCODING_H_INCLUDES)
-rational.$(OBJEXT): {$(VPATH)}rational.c $(RUBY_H_INCLUDES)
-re.$(OBJEXT): {$(VPATH)}re.c $(RUBY_H_INCLUDES) {$(VPATH)}re.h \
- {$(VPATH)}regex.h $(ENCODING_H_INCLUDES) {$(VPATH)}util.h \
- {$(VPATH)}regint.h {$(VPATH)}regenc.h
-regcomp.$(OBJEXT): {$(VPATH)}regcomp.c {$(VPATH)}regparse.h \
- {$(VPATH)}regint.h {$(VPATH)}regenc.h {$(VPATH)}oniguruma.h \
- $(RUBY_H_INCLUDES)
-regenc.$(OBJEXT): {$(VPATH)}regenc.c {$(VPATH)}regint.h \
- {$(VPATH)}regenc.h {$(VPATH)}oniguruma.h $(RUBY_H_INCLUDES)
-regerror.$(OBJEXT): {$(VPATH)}regerror.c {$(VPATH)}regint.h \
- {$(VPATH)}regenc.h {$(VPATH)}oniguruma.h $(RUBY_H_INCLUDES)
-regexec.$(OBJEXT): {$(VPATH)}regexec.c {$(VPATH)}regint.h \
- {$(VPATH)}regenc.h {$(VPATH)}oniguruma.h $(RUBY_H_INCLUDES)
-regparse.$(OBJEXT): {$(VPATH)}regparse.c {$(VPATH)}regparse.h \
- {$(VPATH)}regint.h {$(VPATH)}regenc.h {$(VPATH)}oniguruma.h \
- $(RUBY_H_INCLUDES)
-regsyntax.$(OBJEXT): {$(VPATH)}regsyntax.c {$(VPATH)}regint.h \
- {$(VPATH)}regenc.h {$(VPATH)}oniguruma.h $(RUBY_H_INCLUDES)
-ruby.$(OBJEXT): {$(VPATH)}ruby.c $(RUBY_H_INCLUDES) {$(VPATH)}util.h \
- $(ENCODING_H_INCLUDES) {$(VPATH)}eval_intern.h $(VM_CORE_H_INCLUDES) \
- {$(VPATH)}dln.h {$(VPATH)}debug.h
-safe.$(OBJEXT): {$(VPATH)}safe.c $(RUBY_H_INCLUDES) \
- $(VM_CORE_H_INCLUDES) {$(VPATH)}debug.h
-signal.$(OBJEXT): {$(VPATH)}signal.c $(RUBY_H_INCLUDES) \
- $(VM_CORE_H_INCLUDES) {$(VPATH)}debug.h
-sprintf.$(OBJEXT): {$(VPATH)}sprintf.c $(RUBY_H_INCLUDES) {$(VPATH)}re.h \
- {$(VPATH)}regex.h {$(VPATH)}vsnprintf.c $(ENCODING_H_INCLUDES)
-st.$(OBJEXT): {$(VPATH)}st.c {$(VPATH)}config.h {$(VPATH)}defines.h \
- {$(VPATH)}st.h {$(VPATH)}ruby.h {$(VPATH)}missing.h {$(VPATH)}intern.h
-strftime.$(OBJEXT): {$(VPATH)}strftime.c {$(VPATH)}ruby.h \
- {$(VPATH)}config.h {$(VPATH)}defines.h {$(VPATH)}missing.h \
- {$(VPATH)}intern.h {$(VPATH)}st.h
-string.$(OBJEXT): {$(VPATH)}string.c $(RUBY_H_INCLUDES) {$(VPATH)}re.h \
- {$(VPATH)}regex.h $(ENCODING_H_INCLUDES)
-struct.$(OBJEXT): {$(VPATH)}struct.c $(RUBY_H_INCLUDES)
-thread.$(OBJEXT): {$(VPATH)}thread.c {$(VPATH)}eval_intern.h \
- $(RUBY_H_INCLUDES) {$(VPATH)}gc.h $(VM_CORE_H_INCLUDES) \
- {$(VPATH)}debug.h {$(VPATH)}thread_$(THREAD_MODEL).c
-transcode.$(OBJEXT): {$(VPATH)}transcode.c $(RUBY_H_INCLUDES) \
- $(ENCODING_H_INCLUDES) {$(VPATH)}transcode_data.h
-cont.$(OBJEXT): {$(VPATH)}cont.c $(RUBY_H_INCLUDES) \
- $(VM_CORE_H_INCLUDES) {$(VPATH)}gc.h {$(VPATH)}eval_intern.h \
- {$(VPATH)}debug.h
-time.$(OBJEXT): {$(VPATH)}time.c $(RUBY_H_INCLUDES) \
- $(ENCODING_H_INCLUDES)
-util.$(OBJEXT): {$(VPATH)}util.c $(RUBY_H_INCLUDES) {$(VPATH)}util.h
-variable.$(OBJEXT): {$(VPATH)}variable.c $(RUBY_H_INCLUDES) \
+enum.$(OBJEXT): {$(VPATH)}enum.c {$(VPATH)}ruby.h config.h \
+ {$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h \
{$(VPATH)}node.h {$(VPATH)}util.h
-version.$(OBJEXT): {$(VPATH)}version.c $(RUBY_H_INCLUDES) \
- {$(VPATH)}version.h $(srcdir)/revision.h
-
-compile.$(OBJEXT): {$(VPATH)}compile.c {$(VPATH)}iseq.h \
- $(RUBY_H_INCLUDES) $(VM_CORE_H_INCLUDES) {$(VPATH)}insns.inc \
- {$(VPATH)}insns_info.inc {$(VPATH)}optinsn.inc {$(VPATH)}debug.h
-iseq.$(OBJEXT): {$(VPATH)}iseq.c {$(VPATH)}gc.h {$(VPATH)}iseq.h \
- $(RUBY_H_INCLUDES) $(VM_CORE_H_INCLUDES) {$(VPATH)}insns.inc \
- {$(VPATH)}insns_info.inc {$(VPATH)}node_name.inc {$(VPATH)}debug.h
-vm.$(OBJEXT): {$(VPATH)}vm.c {$(VPATH)}gc.h {$(VPATH)}iseq.h \
- {$(VPATH)}eval_intern.h $(RUBY_H_INCLUDES) $(ENCODING_H_INCLUDES) \
- $(VM_CORE_H_INCLUDES) {$(VPATH)}vm_method.c {$(VPATH)}vm_eval.c \
- {$(VPATH)}vm_insnhelper.c {$(VPATH)}vm_insnhelper.h {$(VPATH)}vm_exec.c \
- {$(VPATH)}vm_exec.h {$(VPATH)}insns.def {$(VPATH)}vmtc.inc \
- {$(VPATH)}vm.inc {$(VPATH)}insns.inc {$(VPATH)}debug.h
-vm_dump.$(OBJEXT): {$(VPATH)}vm_dump.c $(RUBY_H_INCLUDES) \
- $(VM_CORE_H_INCLUDES) {$(VPATH)}debug.h
-debug.$(OBJEXT): {$(VPATH)}debug.c $(RUBY_H_INCLUDES) \
- $(ENCODING_H_INCLUDES) $(VM_CORE_H_INCLUDES) {$(VPATH)}eval_intern.h \
- {$(VPATH)}util.h {$(VPATH)}debug.h
-id.$(OBJEXT): {$(VPATH)}id.c $(RUBY_H_INCLUDES) $(ID_H_INCLUDES)
-miniprelude.$(OBJEXT): {$(VPATH)}miniprelude.c $(RUBY_H_INCLUDES) \
- $(VM_CORE_H_INCLUDES) {$(VPATH)}debug.h
-prelude.$(OBJEXT): {$(VPATH)}prelude.c $(RUBY_H_INCLUDES) \
- $(VM_CORE_H_INCLUDES) {$(VPATH)}debug.h
-golf_prelude.$(OBJEXT): {$(VPATH)}golf_prelude.c $(RUBY_H_INCLUDES) \
- $(VM_CORE_H_INCLUDES) {$(VPATH)}debug.h
-goruby.$(OBJEXT): {$(VPATH)}goruby.c {$(VPATH)}main.c $(RUBY_H_INCLUDES) \
- {$(VPATH)}debug.h {$(VPATH)}node.h
-
-ascii.$(OBJEXT): {$(VPATH)}ascii.c {$(VPATH)}regenc.h {$(VPATH)}config.h \
- {$(VPATH)}defines.h {$(VPATH)}oniguruma.h
-us_ascii.$(OBJEXT): {$(VPATH)}us_ascii.c {$(VPATH)}regenc.h \
- {$(VPATH)}config.h {$(VPATH)}defines.h {$(VPATH)}oniguruma.h
-unicode.$(OBJEXT): {$(VPATH)}unicode.c {$(VPATH)}regint.h \
- {$(VPATH)}config.h {$(VPATH)}defines.h {$(VPATH)}regenc.h \
- {$(VPATH)}oniguruma.h {$(VPATH)}st.h {$(VPATH)}ruby.h \
- {$(VPATH)}missing.h {$(VPATH)}intern.h
-utf_8.$(OBJEXT): {$(VPATH)}utf_8.c {$(VPATH)}regenc.h {$(VPATH)}config.h \
- {$(VPATH)}defines.h {$(VPATH)}oniguruma.h
-
-newline.c: $(srcdir)/enc/trans/newline.trans $(srcdir)/tool/transcode-tblgen.rb
- $(BASERUBY) "$(srcdir)/tool/transcode-tblgen.rb" -vo newline.c $(srcdir)/enc/trans/newline.trans
-newline.$(OBJEXT): {$(VPATH)}newline.c {$(VPATH)}defines.h \
- {$(VPATH)}intern.h {$(VPATH)}missing.h {$(VPATH)}st.h \
- {$(VPATH)}transcode_data.h {$(VPATH)}ruby.h {$(VPATH)}config.h
-
-INSNS2VMOPT = --srcdir="$(srcdir)"
-
-{$(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
-
-srcs: {$(VPATH)}parse.c {$(VPATH)}lex.c {$(VPATH)}newline.c srcs-ext srcs-enc
-
-EXT_SRCS = $(srcdir)/ext/ripper/ripper.c $(srcdir)/ext/dl/callback/callback.c
-
-srcs-ext: $(EXT_SRCS)
-
-srcs-enc: $(ENC_MK)
- $(MAKE) -f $(ENC_MK) RUBY="$(MINIRUBY)" MINIRUBY="$(MINIRUBY)" $(MFLAGS) srcs
-
-incs: $(INSNS) {$(VPATH)}node_name.inc {$(VPATH)}encdb.h {$(VPATH)}transdb.h {$(VPATH)}known_errors.inc \
- $(srcdir)/revision.h $(REVISION_H)
-
-insns: $(INSNS)
-
-node_name.inc: {$(VPATH)}node.h
- $(BASERUBY) -n $(srcdir)/tool/node_name.rb $? > $@
-
-encdb.h: $(PREP) $(srcdir)/tool/generic_erb.rb $(srcdir)/template/encdb.h.tmpl
- $(MINIRUBY) $(srcdir)/tool/generic_erb.rb -c -o $@ $(srcdir)/template/encdb.h.tmpl $(srcdir)/enc enc
-
-transdb.h: $(PREP) srcs-enc $(srcdir)/tool/generic_erb.rb $(srcdir)/template/transdb.h.tmpl
- $(MINIRUBY) $(srcdir)/tool/generic_erb.rb -c -o $@ $(srcdir)/template/transdb.h.tmpl $(srcdir)/enc/trans enc/trans
-
-known_errors.inc: $(srcdir)/template/known_errors.inc.tmpl $(srcdir)/defs/known_errors.def
- $(BASERUBY) $(srcdir)/tool/generic_erb.rb -c -o $@ $(srcdir)/template/known_errors.inc.tmpl $(srcdir)/defs/known_errors.def
-
-miniprelude.c: $(srcdir)/tool/compile_prelude.rb $(srcdir)/prelude.rb
- $(BASERUBY) -I$(srcdir) $(srcdir)/tool/compile_prelude.rb $(srcdir)/prelude.rb $@
-
-prelude.c: $(srcdir)/tool/compile_prelude.rb $(RBCONFIG) $(PRELUDE_SCRIPTS) $(PREP)
- $(COMPILE_PRELUDE) $(PRELUDE_SCRIPTS) $@
-
-golf_prelude.c: $(srcdir)/tool/compile_prelude.rb $(RBCONFIG) $(srcdir)/prelude.rb $(srcdir)/golf_prelude.rb $(PREP)
- $(COMPILE_PRELUDE) $(srcdir)/golf_prelude.rb $@
-
-prereq: incs srcs preludes
-
-preludes: {$(VPATH)}miniprelude.c
-preludes: {$(srcdir)}golf_prelude.c
-
-$(srcdir)/revision.h:
- @exit > $@
-
-$(REVISION_H): $(srcdir)/version.h $(srcdir)/ChangeLog $(srcdir)/tool/file2lastrev.rb $(REVISION_FORCE)
- @-$(BASERUBY) $(srcdir)/tool/file2lastrev.rb --revision.h "$(srcdir)" > "$(srcdir)/revision.tmp"
- @$(IFCHANGE) "--timestamp=$@" "$(srcdir)/revision.h" "$(srcdir)/revision.tmp"
-
-$(EXT_SRCS):
- $(CHDIR) $(@D) && $(exec) $(MAKE) -f depend $(MFLAGS) top_srcdir=../.. srcdir=.
-
-##
-
-run: miniruby$(EXEEXT) PHONY
- $(MINIRUBY) $(TESTRUN_SCRIPT) $(RUNOPT)
-
-runruby: $(PROGRAM) PHONY
- $(RUNRUBY) $(TESTRUN_SCRIPT)
-
-parse: miniruby$(EXEEXT) PHONY
- $(MINIRUBY) $(srcdir)/tool/parse.rb $(TESTRUN_SCRIPT)
-
-COMPARE_RUBY = $(BASERUBY)
-ITEM =
-OPTS =
-
-benchmark: $(PROGRAM) PHONY
- $(BASERUBY) $(srcdir)/benchmark/driver.rb -v \
- --executables="$(COMPARE_RUBY); $(RUNRUBY)" \
- --pattern='bm_' --directory=$(srcdir)/benchmark $(OPTS)
-
-benchmark-each: $(PROGRAM) PHONY
- $(BASERUBY) $(srcdir)/benchmark/driver.rb -v \
- --executables="$(COMPARE_RUBY); $(RUNRUBY)" \
- --pattern=$(ITEM) --directory=$(srcdir)/benchmark $(OPTS)
-
-tbench: $(PROGRAM) PHONY
- $(BASERUBY) $(srcdir)/benchmark/driver.rb -v \
- --executables="$(COMPARE_RUBY); $(RUNRUBY)" \
- --pattern='bmx_' --directory=$(srcdir)/benchmark $(OPTS)
-
-run.gdb:
- echo b ruby_debug_breakpoint > run.gdb
- echo '# handle SIGINT nostop' >> run.gdb
- echo '# handle SIGPIPE nostop' >> run.gdb
- echo '# b rb_longjmp' >> run.gdb
- echo source $(srcdir)/breakpoints.gdb >> run.gdb
- echo source $(srcdir)/.gdbinit >> run.gdb
- echo run >> run.gdb
-
-gdb: miniruby$(EXEEXT) run.gdb PHONY
- gdb -x run.gdb --quiet --args $(MINIRUBY) $(TESTRUN_SCRIPT)
-
-gdb-ruby: $(PROGRAM) run.gdb PHONY
- gdb -x run.gdb --quiet --args $(PROGRAM) $(TESTRUN_SCRIPT)
-
-dist:
- $(BASERUBY) $(srcdir)/tool/make-snapshot tmp $(RELNAME)
-
-up::
- -@$(MAKE) $(MFLAGS) REVISION_FORCE=PHONY "$(REVISION_H)"
-
-info: info-program info-libruby_a info-libruby_so info-arch
-info-program:
- @echo PROGRAM=$(PROGRAM)
-info-libruby_a:
- @echo LIBRUBY_A=$(LIBRUBY_A)
-info-libruby_so:
- @echo LIBRUBY_SO=$(LIBRUBY_SO)
-info-arch:
- @echo arch=$(arch)
-
-help: PHONY
- @echo " Makefile of Ruby"
- @echo ""
- @echo "targets:"
- @echo " all (default): builds ruby"
- @echo " miniruby: builds only miniruby"
- @echo " run: runs test.rb by miniruby"
- @echo " runruby: runs test.rb by ruby you just built"
- @echo " gdb: runs test.rb by miniruby under gdb"
- @echo " gdb-ruby: runs test.rb by ruby under gdb"
- @echo " all: compile ruby and extensions"
- @echo " check: equals make test test-all"
- @echo " test: ruby core tests"
- @echo " test-all: all ruby tests"
- @echo " test-rubyspec run RubySpec test suite"
- @echo " update-rubyspec update local copy of RubySpec"
- @echo " install: install all ruby distributions"
- @echo " install-nodoc: install without rdoc"
- @echo " clean: clean built objects"
- @echo " golf: for golfers"
- @echo
- @echo "see DeveloperHowto for more detail: "
- @echo " http://redmine.ruby-lang.org/wiki/ruby/DeveloperHowto"
+enumerator.$(OBJEXT): {$(VPATH)}enumerator.c {$(VPATH)}ruby.h config.h \
+ {$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h
+error.$(OBJEXT): {$(VPATH)}error.c {$(VPATH)}ruby.h config.h \
+ {$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h \
+ {$(VPATH)}env.h {$(VPATH)}st.h
+eval.$(OBJEXT): {$(VPATH)}eval.c {$(VPATH)}ruby.h config.h \
+ {$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h \
+ {$(VPATH)}node.h {$(VPATH)}env.h {$(VPATH)}util.h \
+ {$(VPATH)}rubysig.h {$(VPATH)}st.h {$(VPATH)}dln.h
+file.$(OBJEXT): {$(VPATH)}file.c {$(VPATH)}ruby.h config.h \
+ {$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h \
+ {$(VPATH)}rubyio.h {$(VPATH)}rubysig.h {$(VPATH)}util.h \
+ {$(VPATH)}dln.h
+gc.$(OBJEXT): {$(VPATH)}gc.c {$(VPATH)}ruby.h config.h \
+ {$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h \
+ {$(VPATH)}rubysig.h {$(VPATH)}st.h {$(VPATH)}node.h \
+ {$(VPATH)}env.h {$(VPATH)}re.h {$(VPATH)}regex.h
+hash.$(OBJEXT): {$(VPATH)}hash.c {$(VPATH)}ruby.h config.h \
+ {$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h \
+ {$(VPATH)}st.h {$(VPATH)}util.h {$(VPATH)}rubysig.h
+inits.$(OBJEXT): {$(VPATH)}inits.c {$(VPATH)}ruby.h config.h \
+ {$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h
+io.$(OBJEXT): {$(VPATH)}io.c {$(VPATH)}ruby.h config.h \
+ {$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h \
+ {$(VPATH)}rubyio.h {$(VPATH)}rubysig.h {$(VPATH)}util.h \
+ {$(VPATH)}env.h
+main.$(OBJEXT): {$(VPATH)}main.c {$(VPATH)}ruby.h config.h \
+ {$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h
+marshal.$(OBJEXT): {$(VPATH)}marshal.c {$(VPATH)}ruby.h config.h \
+ {$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h \
+ {$(VPATH)}rubyio.h {$(VPATH)}st.h {$(VPATH)}util.h
+math.$(OBJEXT): {$(VPATH)}math.c {$(VPATH)}ruby.h config.h \
+ {$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h
+numeric.$(OBJEXT): {$(VPATH)}numeric.c {$(VPATH)}ruby.h config.h \
+ {$(VPATH)}env.h {$(VPATH)}defines.h {$(VPATH)}intern.h \
+ {$(VPATH)}missing.h
+object.$(OBJEXT): {$(VPATH)}object.c {$(VPATH)}ruby.h config.h \
+ {$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h \
+ {$(VPATH)}st.h {$(VPATH)}util.h
+pack.$(OBJEXT): {$(VPATH)}pack.c {$(VPATH)}ruby.h config.h \
+ {$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h
+parse.$(OBJEXT): {$(VPATH)}parse.c {$(VPATH)}ruby.h config.h \
+ {$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h \
+ {$(VPATH)}env.h {$(VPATH)}node.h {$(VPATH)}st.h \
+ {$(VPATH)}regex.h {$(VPATH)}util.h {$(VPATH)}lex.c
+prec.$(OBJEXT): {$(VPATH)}prec.c {$(VPATH)}ruby.h config.h \
+ {$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h
+process.$(OBJEXT): {$(VPATH)}process.c {$(VPATH)}ruby.h config.h \
+ {$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h \
+ {$(VPATH)}rubysig.h {$(VPATH)}st.h
+random.$(OBJEXT): {$(VPATH)}random.c {$(VPATH)}ruby.h config.h \
+ {$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h
+range.$(OBJEXT): {$(VPATH)}range.c {$(VPATH)}ruby.h config.h \
+ {$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h
+re.$(OBJEXT): {$(VPATH)}re.c {$(VPATH)}ruby.h config.h \
+ {$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h \
+ {$(VPATH)}re.h {$(VPATH)}regex.h
+regex.$(OBJEXT): {$(VPATH)}regex.c config.h {$(VPATH)}regex.h
+ruby.$(OBJEXT): {$(VPATH)}ruby.c {$(VPATH)}ruby.h config.h \
+ {$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h \
+ {$(VPATH)}dln.h {$(VPATH)}node.h {$(VPATH)}util.h
+signal.$(OBJEXT): {$(VPATH)}signal.c {$(VPATH)}ruby.h config.h \
+ {$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h \
+ {$(VPATH)}rubysig.h
+sprintf.$(OBJEXT): {$(VPATH)}sprintf.c {$(VPATH)}ruby.h config.h \
+ {$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h
+st.$(OBJEXT): {$(VPATH)}st.c config.h {$(VPATH)}st.h
+string.$(OBJEXT): {$(VPATH)}string.c {$(VPATH)}ruby.h config.h \
+ {$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h \
+ {$(VPATH)}re.h {$(VPATH)}regex.h
+struct.$(OBJEXT): {$(VPATH)}struct.c {$(VPATH)}ruby.h config.h \
+ {$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h
+time.$(OBJEXT): {$(VPATH)}time.c {$(VPATH)}ruby.h config.h \
+ {$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h
+util.$(OBJEXT): {$(VPATH)}util.c {$(VPATH)}ruby.h config.h \
+ {$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h \
+ {$(VPATH)}util.h
+variable.$(OBJEXT): {$(VPATH)}variable.c {$(VPATH)}ruby.h config.h \
+ {$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h \
+ {$(VPATH)}env.h {$(VPATH)}node.h {$(VPATH)}st.h {$(VPATH)}util.h
+version.$(OBJEXT): {$(VPATH)}version.c {$(VPATH)}ruby.h config.h \
+ {$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h \
+ {$(VPATH)}version.h
+
+dist: $(PROGRAM)
+ $(RUNRUBY) $(srcdir)/distruby.rb
diff --git a/compar.c b/compar.c
index e8ebfc5bfa..1488b2c65d 100644
--- a/compar.c
+++ b/compar.c
@@ -3,20 +3,39 @@
compar.c -
$Author$
+ $Date$
created at: Thu Aug 26 14:39:48 JST 1993
- Copyright (C) 1993-2007 Yukihiro Matsumoto
+ Copyright (C) 1993-2003 Yukihiro Matsumoto
**********************************************************************/
-#include "ruby/ruby.h"
+#include "ruby.h"
VALUE rb_mComparable;
static ID cmp;
+int
+rb_cmpint(val, a, b)
+ VALUE val, a, b;
+{
+ if (NIL_P(val)) {
+ rb_cmperr(a, b);
+ }
+ if (FIXNUM_P(val)) return FIX2INT(val);
+ if (TYPE(val) == T_BIGNUM) {
+ if (RBIGNUM(val)->sign) return 1;
+ return -1;
+ }
+ if (RTEST(rb_funcall(val, '>', 1, INT2FIX(0)))) return 1;
+ if (RTEST(rb_funcall(val, '<', 1, INT2FIX(0)))) return -1;
+ return 0;
+}
+
void
-rb_cmperr(VALUE x, VALUE y)
+rb_cmperr(x, y)
+ VALUE x, y;
{
const char *classname;
@@ -31,33 +50,37 @@ rb_cmperr(VALUE x, VALUE y)
rb_obj_classname(x), classname);
}
+#define cmperr() (rb_cmperr(x, y), Qnil)
+
static VALUE
-cmp_eq(VALUE *a)
+cmp_eq(a)
+ VALUE *a;
{
VALUE c = rb_funcall(a[0], cmp, 1, a[1]);
- if (NIL_P(c)) return Qfalse;
+ if (NIL_P(c)) return Qnil;
if (rb_cmpint(c, a[0], a[1]) == 0) return Qtrue;
return Qfalse;
}
static VALUE
-cmp_failed(void)
+cmp_failed()
{
- return Qfalse;
+ return Qnil;
}
/*
* call-seq:
* obj == other => true or false
- *
+ *
* 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.
*/
static VALUE
-cmp_equal(VALUE x, VALUE y)
+cmp_equal(x, y)
+ VALUE x, y;
{
VALUE a[2];
@@ -70,16 +93,18 @@ cmp_equal(VALUE x, VALUE y)
/*
* call-seq:
* obj > other => true or false
- *
+ *
* Compares two objects based on the receiver's <code><=></code>
* method, returning true if it returns 1.
*/
static VALUE
-cmp_gt(VALUE x, VALUE y)
+cmp_gt(x, y)
+ VALUE x, y;
{
VALUE c = rb_funcall(x, cmp, 1, y);
+ if (NIL_P(c)) return cmperr();
if (rb_cmpint(c, x, y) > 0) return Qtrue;
return Qfalse;
}
@@ -87,16 +112,18 @@ cmp_gt(VALUE x, VALUE y)
/*
* call-seq:
* obj >= other => true or false
- *
+ *
* Compares two objects based on the receiver's <code><=></code>
* method, returning true if it returns 0 or 1.
*/
static VALUE
-cmp_ge(VALUE x, VALUE y)
+cmp_ge(x, y)
+ VALUE x, y;
{
VALUE c = rb_funcall(x, cmp, 1, y);
+ if (NIL_P(c)) return cmperr();
if (rb_cmpint(c, x, y) >= 0) return Qtrue;
return Qfalse;
}
@@ -104,33 +131,38 @@ cmp_ge(VALUE x, VALUE y)
/*
* call-seq:
* obj < other => true or false
- *
+ *
* Compares two objects based on the receiver's <code><=></code>
* method, returning true if it returns -1.
*/
static VALUE
-cmp_lt(VALUE x, VALUE y)
+cmp_lt(x, y)
+ VALUE x, y;
{
VALUE c = rb_funcall(x, cmp, 1, y);
+ if (NIL_P(c)) return cmperr();
if (rb_cmpint(c, x, y) < 0) return Qtrue;
return Qfalse;
}
+
/*
* call-seq:
* obj <= other => true or false
- *
+ *
* Compares two objects based on the receiver's <code><=></code>
* method, returning true if it returns -1 or 0.
*/
static VALUE
-cmp_le(VALUE x, VALUE y)
+cmp_le(x, y)
+ VALUE x, y;
{
VALUE c = rb_funcall(x, cmp, 1, y);
+ if (NIL_P(c)) return cmperr();
if (rb_cmpint(c, x, y) <= 0) return Qtrue;
return Qfalse;
}
@@ -138,20 +170,21 @@ cmp_le(VALUE x, VALUE y)
/*
* call-seq:
* obj.between?(min, max) => true or false
- *
+ *
* 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
* 'cat'.between?('ant', 'dog') #=> true
* 'gnu'.between?('ant', 'dog') #=> false
- *
+ *
*/
static VALUE
-cmp_between(VALUE x, VALUE min, VALUE max)
+cmp_between(x, min, max)
+ VALUE x, min, max;
{
if (RTEST(cmp_lt(x, min))) return Qfalse;
if (RTEST(cmp_gt(x, max))) return Qfalse;
@@ -167,7 +200,7 @@ cmp_between(VALUE x, VALUE min, VALUE max)
* <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
@@ -181,26 +214,23 @@ cmp_between(VALUE x, VALUE min, VALUE max)
* @str
* end
* end
- *
+ *
* s1 = SizeMatters.new("Z")
* s2 = SizeMatters.new("YY")
* s3 = SizeMatters.new("XXX")
* s4 = SizeMatters.new("WWWW")
* s5 = SizeMatters.new("VVVVV")
- *
+ *
* s1 < s2 #=> true
* s4.between?(s1, s3) #=> false
* s4.between?(s3, s5) #=> true
* [ s3, s2, s5, s4, s1 ].sort #=> [Z, YY, XXX, WWWW, VVVVV]
- *
+ *
*/
void
-Init_Comparable(void)
+Init_Comparable()
{
-#undef rb_intern
-#define rb_intern(str) rb_intern_const(str)
-
rb_mComparable = rb_define_module("Comparable");
rb_define_method(rb_mComparable, "==", cmp_equal, 1);
rb_define_method(rb_mComparable, ">", cmp_gt, 1);
diff --git a/compile.c b/compile.c
deleted file mode 100644
index 636ad31c4c..0000000000
--- a/compile.c
+++ /dev/null
@@ -1,5415 +0,0 @@
-/**********************************************************************
-
- compile.c - ruby node tree -> VM instruction sequence
-
- $Author$
- created at: 04/01/01 03:42:15 JST
-
- Copyright (C) 2004-2007 Koichi Sasada
-
-**********************************************************************/
-
-#include "ruby/ruby.h"
-
-#define USE_INSN_STACK_INCREASE 1
-#define USE_INSN_ICLEN 1
-#include "vm_core.h"
-#include "iseq.h"
-#include "insns.inc"
-#include "insns_info.inc"
-
-#define numberof(array) (int)(sizeof(array) / sizeof((array)[0]))
-
-typedef struct iseq_link_element {
- enum {
- ISEQ_ELEMENT_NONE = INT2FIX(0x00),
- ISEQ_ELEMENT_LABEL = INT2FIX(0x01),
- ISEQ_ELEMENT_INSN = INT2FIX(0x02),
- ISEQ_ELEMENT_ADJUST = INT2FIX(0x03)
- } type;
- struct iseq_link_element *next;
- struct iseq_link_element *prev;
-} LINK_ELEMENT;
-
-typedef struct iseq_link_anchor {
- LINK_ELEMENT anchor;
- LINK_ELEMENT *last;
-} LINK_ANCHOR;
-
-typedef struct iseq_label_data {
- LINK_ELEMENT link;
- int label_no;
- int position;
- int sc_state;
- int set;
- int sp;
-} LABEL;
-
-typedef struct iseq_insn_data {
- LINK_ELEMENT link;
- enum ruby_vminsn_type insn_id;
- long line_no;
- int operand_size;
- int sc_state;
- VALUE *operands;
-} INSN;
-
-typedef struct iseq_adjust_data {
- LINK_ELEMENT link;
- LABEL *label;
- long line_no;
-} ADJUST;
-
-struct ensure_range {
- LABEL *begin;
- LABEL *end;
- struct ensure_range *next;
-};
-
-struct iseq_compile_data_ensure_node_stack {
- NODE *ensure_node;
- struct iseq_compile_data_ensure_node_stack *prev;
- struct ensure_range *erange;
-};
-
-/**
- * debug function(macro) interface depend on CPDEBUG
- * if it is less than 0, runtime option is in effect.
- *
- * debug level:
- * 0: no debug output
- * 1: show node type
- * 2: show node important parameters
- * ...
- * 5: show other parameters
- * 10: show every AST array
- */
-
-#ifndef CPDEBUG
-#define CPDEBUG 0
-#endif
-
-#if CPDEBUG >= 0
-#define compile_debug CPDEBUG
-#else
-#define compile_debug iseq->compile_data->option->debug_level
-#endif
-
-NORETURN(PRINTF_ARGS(void rb_compile_bug(const char*, int, const char*, ...), 3, 4));
-
-#if CPDEBUG
-
-#define compile_debug_print_indent(level) \
- ruby_debug_print_indent(level, compile_debug, gl_node_level * 2)
-
-#define debugp(header, value) (void) \
- (compile_debug_print_indent(1) && \
- ruby_debug_print_value(1, compile_debug, header, value))
-
-#define debugi(header, id) (void) \
- (compile_debug_print_indent(1) && \
- ruby_debug_print_id(1, compile_debug, header, id))
-
-#define debugp_param(header, value) (void) \
- (compile_debug_print_indent(1) && \
- ruby_debug_print_value(1, compile_debug, header, value))
-
-#define debugp_verbose(header, value) (void) \
- (compile_debug_print_indent(2) && \
- ruby_debug_print_value(2, compile_debug, header, value))
-
-#define debugp_verbose_node(header, value) (void) \
- (compile_debug_print_indent(10) && \
- ruby_debug_print_value(10, compile_debug, header, value))
-
-#define debug_node_start(node) ((void) \
- (compile_debug_print_indent(1) && \
- (ruby_debug_print_node(1, CPDEBUG, "", (NODE *)node), gl_node_level)), \
- gl_node_level++)
-
-#define debug_node_end() gl_node_level --;
-
-#else
-
-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
-PRINTF_ARGS(void ruby_debug_printf(const char*, ...), 1, 2);
-#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
-#define debugs if(0)printf
-#define debug_compile(msg, v) (v)
-#endif
-
-
-/* create new label */
-#define NEW_LABEL(l) new_label_body(iseq, l)
-
-#define iseq_filename(iseq) \
- (((rb_iseq_t*)DATA_PTR(iseq))->filename)
-
-#define NEW_ISEQVAL(node, name, type) \
- new_child_iseq(iseq, node, name, 0, type)
-
-#define NEW_CHILD_ISEQVAL(node, name, type) \
- new_child_iseq(iseq, node, name, iseq->self, type)
-
-#define NEW_SPECIAQL_BLOCK_ISEQVAL(iseq, sym) \
- new_child_iseq(iseq, iseq->node, iseq->name, iseq->parent_iseq, iseq->type, sym)
-
-/* add instructions */
-#define ADD_SEQ(seq1, seq2) \
- APPEND_LIST(seq1, seq2)
-
-/* add an instruction */
-#define ADD_INSN(seq, line, insn) \
- ADD_ELEM(seq, (LINK_ELEMENT *) new_insn_body(iseq, line, BIN(insn), 0))
-
-/* add an instruction with label operand */
-#define ADD_INSNL(seq, line, insn, label) \
- ADD_ELEM(seq, (LINK_ELEMENT *) \
- new_insn_body(iseq, line, BIN(insn), 1, (VALUE)label))
-
-/* add an instruction with some operands (1, 2, 3, 5) */
-#define ADD_INSN1(seq, line, insn, op1) \
- ADD_ELEM(seq, (LINK_ELEMENT *) \
- new_insn_body(iseq, line, BIN(insn), 1, (VALUE)op1))
-
-#define ADD_INSN2(seq, line, insn, op1, op2) \
- ADD_ELEM(seq, (LINK_ELEMENT *) \
- new_insn_body(iseq, line, BIN(insn), 2, (VALUE)op1, (VALUE)op2))
-
-#define ADD_INSN3(seq, line, insn, op1, op2, op3) \
- ADD_ELEM(seq, (LINK_ELEMENT *) \
- new_insn_body(iseq, line, BIN(insn), 3, (VALUE)op1, (VALUE)op2, (VALUE)op3))
-
-/* Specific Insn factory */
-#define ADD_SEND(seq, line, id, argc) \
- ADD_SEND_R(seq, line, id, argc, (VALUE)Qfalse, (VALUE)INT2FIX(0))
-
-#define ADD_CALL_RECEIVER(seq, line) \
- ADD_INSN(seq, line, putnil)
-
-#define ADD_CALL(seq, line, id, argc) \
- ADD_SEND_R(seq, line, id, argc, (VALUE)Qfalse, (VALUE)INT2FIX(VM_CALL_FCALL_BIT))
-
-#define ADD_CALL_WITH_BLOCK(seq, line, id, argc, block) \
- ADD_SEND_R(seq, line, id, argc, block, (VALUE)INT2FIX(VM_CALL_FCALL_BIT))
-
-#define ADD_SEND_R(seq, line, id, argc, block, flag) \
- ADD_ELEM(seq, (LINK_ELEMENT *) \
- new_insn_send(iseq, line, \
- (VALUE)id, (VALUE)argc, (VALUE)block, (VALUE)flag))
-
-#define ADD_TRACE(seq, line, event) \
- do { \
- if ((event) == RUBY_EVENT_LINE && iseq->coverage && \
- RARRAY_PTR(iseq->coverage)[(line) - 1] == Qnil) { \
- RARRAY_PTR(iseq->coverage)[(line) - 1] = INT2FIX(0); \
- ADD_INSN1(seq, line, trace, INT2FIX(RUBY_EVENT_COVERAGE)); \
- } \
- if (iseq->compile_data->option->trace_instruction) { \
- ADD_INSN1(seq, line, trace, INT2FIX(event)); \
- } \
- }while(0);
-
-/* add label */
-#define ADD_LABEL(seq, label) \
- ADD_ELEM(seq, (LINK_ELEMENT *) label)
-
-#define ADD_ADJUST(seq, line, label) \
- ADD_ELEM(seq, (LINK_ELEMENT *) new_adjust_body(iseq, label, line))
-
-#define ADD_ADJUST_RESTORE(seq, label) \
- ADD_ELEM(seq, (LINK_ELEMENT *) new_adjust_body(iseq, label, -1))
-
-#define ADD_CATCH_ENTRY(type, ls, le, iseqv, lc) \
- (rb_ary_push(iseq->compile_data->catch_table_ary, \
- rb_ary_new3(5, type, \
- (VALUE)(ls) | 1, (VALUE)(le) | 1, \
- iseqv, (VALUE)(lc) | 1)))
-
-/* compile node */
-#define COMPILE(anchor, desc, node) \
- (debug_compile("== " desc "\n", \
- iseq_compile_each(iseq, anchor, node, 0)))
-
-/* compile node, this node's value will be poped */
-#define COMPILE_POPED(anchor, desc, node) \
- (debug_compile("== " desc "\n", \
- iseq_compile_each(iseq, anchor, node, 1)))
-
-/* compile node, which is poped when 'poped' is true */
-#define COMPILE_(anchor, desc, node, poped) \
- (debug_compile("== " desc "\n", \
- iseq_compile_each(iseq, anchor, node, poped)))
-
-#define OPERAND_AT(insn, idx) \
- (((INSN*)(insn))->operands[idx])
-
-#define INSN_OF(insn) \
- (((INSN*)(insn))->insn_id)
-
-/* error */
-#define COMPILE_ERROR(strs) \
-{ \
- VALUE tmp = GET_THREAD()->errinfo; \
- if (compile_debug) rb_compile_bug strs; \
- GET_THREAD()->errinfo = iseq->compile_data->err_info; \
- rb_compile_error strs; \
- iseq->compile_data->err_info = GET_THREAD()->errinfo; \
- GET_THREAD()->errinfo = tmp; \
- ret = 0; \
- break; \
-}
-
-#define ERROR_ARGS ruby_sourcefile, nd_line(node),
-
-
-#define COMPILE_OK 1
-#define COMPILE_NG 0
-
-
-/* leave name uninitialized so that compiler warn if INIT_ANCHOR is
- * missing */
-#define DECL_ANCHOR(name) \
- LINK_ANCHOR *name, name##_body__ = {{0,},}
-#define INIT_ANCHOR(name) \
- (name##_body__.last = &name##_body__.anchor, name = &name##_body__)
-
-#define hide_obj(obj) do {OBJ_FREEZE(obj); RBASIC(obj)->klass = 0;} while (0)
-
-#include "optinsn.inc"
-#if OPT_INSTRUCTIONS_UNIFICATION
-#include "optunifs.inc"
-#endif
-
-/* for debug */
-#if CPDEBUG < 0
-#define ISEQ_ARG iseq,
-#define ISEQ_ARG_DECLARE rb_iseq_t *iseq,
-#else
-#define ISEQ_ARG
-#define ISEQ_ARG_DECLARE
-#endif
-
-#if CPDEBUG
-#define gl_node_level iseq->compile_data->node_level
-#if 0
-static void debug_list(ISEQ_ARG_DECLARE LINK_ANCHOR *anchor);
-#endif
-#endif
-
-static void dump_disasm_list(LINK_ELEMENT *elem);
-
-static int insn_data_length(INSN *iobj);
-static int insn_data_line_no(INSN *iobj);
-static int calc_sp_depth(int depth, INSN *iobj);
-
-static void ADD_ELEM(ISEQ_ARG_DECLARE LINK_ANCHOR *anchor, LINK_ELEMENT *elem);
-
-static INSN *new_insn_body(rb_iseq_t *iseq, long line_no, int 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, long line);
-
-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, ID *tbl);
-static int iseq_set_exception_local_table(rb_iseq_t *iseq);
-static int iseq_set_arguments(rb_iseq_t *iseq, LINK_ANCHOR *anchor, NODE * node);
-
-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);
-
-/*
- * To make Array to LinkedList, use link_anchor
- */
-
-static void
-verify_list(ISEQ_ARG_DECLARE const char *info, LINK_ANCHOR *anchor)
-{
-#if CPDEBUG
- int flag = 0;
- LINK_ELEMENT *list, *plist;
-
- if (!compile_debug) return;
-
- list = anchor->anchor.next;
- plist = &anchor->anchor;
- while (list) {
- if (plist != list->prev) {
- flag += 1;
- }
- plist = list;
- list = list->next;
- }
-
- if (anchor->last != plist && anchor->last != 0) {
- flag |= 0x70000;
- }
-
- if (flag != 0) {
- rb_bug("list verify error: %08x (%s)", flag, info);
- }
-#endif
-}
-#if CPDEBUG < 0
-#define verify_list(info, anchor) verify_list(iseq, info, anchor)
-#endif
-
-/*
- * elem1, elem2 => elem1, elem2, elem
- */
-static void
-ADD_ELEM(ISEQ_ARG_DECLARE LINK_ANCHOR *anchor, LINK_ELEMENT *elem)
-{
- elem->prev = anchor->last;
- anchor->last->next = elem;
- anchor->last = elem;
- verify_list("add", anchor);
-}
-#if CPDEBUG < 0
-#define ADD_ELEM(anchor, elem) ADD_ELEM(iseq, anchor, elem)
-#endif
-
-static int
-iseq_add_mark_object(rb_iseq_t *iseq, VALUE v)
-{
- if (!SPECIAL_CONST_P(v)) {
- rb_ary_push(iseq->mark_ary, v);
- }
- return COMPILE_OK;
-}
-
-#define ruby_sourcefile RSTRING_PTR(iseq->filename)
-
-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;
-}
-
-VALUE
-rb_iseq_compile_node(VALUE self, NODE *node)
-{
- DECL_ANCHOR(ret);
- rb_iseq_t *iseq;
- INIT_ANCHOR(ret);
- GetISeqPtr(self, iseq);
-
- if (node == 0) {
- COMPILE(ret, "nil", node);
- iseq_set_local_table(iseq, 0);
- }
- else if (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->type) {
- case ISEQ_TYPE_BLOCK: {
- LABEL *start = iseq->compile_data->start_label = NEW_LABEL(0);
- LABEL *end = iseq->compile_data->end_label = NEW_LABEL(0);
-
- ADD_LABEL(ret, start);
- COMPILE(ret, "block body", node->nd_body);
- ADD_LABEL(ret, end);
-
- /* wide range catch handler must put at last */
- ADD_CATCH_ENTRY(CATCH_TYPE_REDO, start, end, 0, start);
- ADD_CATCH_ENTRY(CATCH_TYPE_NEXT, start, end, 0, end);
- break;
- }
- case ISEQ_TYPE_CLASS: {
- ADD_TRACE(ret, nd_line(node), 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, nd_line(node), RUBY_EVENT_CALL);
- COMPILE(ret, "scoped node", node->nd_body);
- ADD_TRACE(ret, nd_line(node), RUBY_EVENT_RETURN);
- break;
- }
- default: {
- COMPILE(ret, "scoped node", node->nd_body);
- break;
- }
- }
- }
- else {
- 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);
- COMPILE(ret, "rescue", node);
- break;
- case ISEQ_TYPE_ENSURE:
- iseq_set_exception_local_table(iseq);
- COMPILE_POPED(ret, "ensure", node);
- break;
- case ISEQ_TYPE_DEFINED_GUARD:
- iseq_set_local_table(iseq, 0);
- COMPILE(ret, "defined guard", node);
- break;
- default:
- rb_bug("unknown scope");
- }
- }
-
- if (iseq->type == ISEQ_TYPE_RESCUE || iseq->type == ISEQ_TYPE_ENSURE) {
- ADD_INSN2(ret, 0, getdynamic, INT2FIX(2), INT2FIX(0));
- ADD_INSN1(ret, 0, throw, INT2FIX(0) /* continue throw */ );
- }
- else {
- ADD_INSN(ret, iseq->compile_data->last_line, leave);
- }
-
- return iseq_setup(iseq, ret);
-}
-
-int
-rb_iseq_translate_threaded_code(rb_iseq_t *iseq)
-{
-#if OPT_DIRECT_THREADED_CODE || OPT_CALL_THREADED_CODE
- extern const void **rb_vm_get_insns_address_table(void);
-#if OPT_DIRECT_THREADED_CODE
- const void * const *table = rb_vm_get_insns_address_table();
-#else
- const void * const *table = rb_vm_get_insns_address_table();
-#endif
- unsigned long i;
-
- iseq->iseq_encoded = ALLOC_N(VALUE, iseq->iseq_size);
- MEMCPY(iseq->iseq_encoded, iseq->iseq, VALUE, iseq->iseq_size);
-
- for (i = 0; i < iseq->iseq_size; /* */ ) {
- int insn = (int)iseq->iseq_encoded[i];
- int len = insn_len(insn);
- iseq->iseq_encoded[i] = (VALUE)table[insn];
- i += len;
- }
-#else
- iseq->iseq_encoded = iseq->iseq;
-#endif
- return COMPILE_OK;
-}
-
-/*********************************************/
-/* definition of data structure for compiler */
-/*********************************************/
-
-static void *
-compile_data_alloc(rb_iseq_t *iseq, size_t size)
-{
- void *ptr = 0;
- struct iseq_compile_data_storage *storage =
- iseq->compile_data->storage_current;
-
- if (storage->pos + size > storage->size) {
- unsigned long alloc_size = storage->size * 2;
-
- retry:
- if (alloc_size < size) {
- alloc_size *= 2;
- goto retry;
- }
- storage->next = (void *)ALLOC_N(char, alloc_size +
- sizeof(struct
- iseq_compile_data_storage));
- storage = iseq->compile_data->storage_current = storage->next;
- storage->next = 0;
- storage->pos = 0;
- storage->size = alloc_size;
- storage->buff = (char *)(&storage->buff + 1);
- }
-
- ptr = (void *)&storage->buff[storage->pos];
- storage->pos += size;
- return ptr;
-}
-
-static INSN *
-compile_data_alloc_insn(rb_iseq_t *iseq)
-{
- return (INSN *)compile_data_alloc(iseq, sizeof(INSN));
-}
-
-static LABEL *
-compile_data_alloc_label(rb_iseq_t *iseq)
-{
- return (LABEL *)compile_data_alloc(iseq, sizeof(LABEL));
-}
-
-static ADJUST *
-compile_data_alloc_adjust(rb_iseq_t *iseq)
-{
- return (ADJUST *)compile_data_alloc(iseq, sizeof(ADJUST));
-}
-
-/*
- * elem1, elemX => elem1, elem2, elemX
- */
-static void
-INSERT_ELEM_NEXT(LINK_ELEMENT *elem1, LINK_ELEMENT *elem2)
-{
- elem2->next = elem1->next;
- elem2->prev = elem1;
- elem1->next = elem2;
- if (elem2->next) {
- elem2->next->prev = elem2;
- }
-}
-
-#if 0 /* unused */
-/*
- * elemX, elem1 => elemX, elem2, elem1
- */
-static void
-INSERT_ELEM_PREV(LINK_ELEMENT *elem1, LINK_ELEMENT *elem2)
-{
- elem2->prev = elem1->prev;
- elem2->next = elem1;
- elem1->prev = elem2;
- if (elem2->prev) {
- elem2->prev->next = elem2;
- }
-}
-#endif
-
-/*
- * elemX, elem1, elemY => elemX, elem2, elemY
- */
-static void
-REPLACE_ELEM(LINK_ELEMENT *elem1, LINK_ELEMENT *elem2)
-{
- elem2->prev = elem1->prev;
- elem2->next = elem1->next;
- if (elem1->prev) {
- elem1->prev->next = elem2;
- }
- if (elem1->next) {
- elem1->next->prev = elem2;
- }
-}
-
-static void
-REMOVE_ELEM(LINK_ELEMENT *elem)
-{
- elem->prev->next = elem->next;
- if (elem->next) {
- elem->next->prev = elem->prev;
- }
-}
-
-static LINK_ELEMENT *
-FIRST_ELEMENT(LINK_ANCHOR *anchor)
-{
- return anchor->anchor.next;
-}
-
-#if 0 /* unused */
-static LINK_ELEMENT *
-LAST_ELEMENT(LINK_ANCHOR *anchor)
-{
- return anchor->last;
-}
-#endif
-
-static LINK_ELEMENT *
-POP_ELEMENT(ISEQ_ARG_DECLARE LINK_ANCHOR *anchor)
-{
- LINK_ELEMENT *elem = anchor->last;
- anchor->last = anchor->last->prev;
- anchor->last->next = 0;
- verify_list("pop", anchor);
- return elem;
-}
-#if CPDEBUG < 0
-#define POP_ELEMENT(anchor) POP_ELEMENT(iseq, anchor)
-#endif
-
-#if 0 /* unused */
-static LINK_ELEMENT *
-SHIFT_ELEMENT(LINK_ANCHOR *anchor)
-{
- LINK_ELEMENT *elem = anchor->anchor.next;
- if (elem) {
- anchor->anchor.next = elem->next;
- }
- return elem;
-}
-#endif
-
-#if 0 /* unused */
-static int
-LIST_SIZE(LINK_ANCHOR *anchor)
-{
- LINK_ELEMENT *elem = anchor->anchor.next;
- int size = 0;
- while (elem) {
- size += 1;
- elem = elem->next;
- }
- return size;
-}
-#endif
-
-static int
-LIST_SIZE_ZERO(LINK_ANCHOR *anchor)
-{
- if (anchor->anchor.next == 0) {
- return 1;
- }
- else {
- return 0;
- }
-}
-
-/*
- * anc1: e1, e2, e3
- * anc2: e4, e5
- *#=>
- * anc1: e1, e2, e3, e4, e5
- * anc2: e4, e5 (broken)
- */
-static void
-APPEND_LIST(ISEQ_ARG_DECLARE LINK_ANCHOR *anc1, LINK_ANCHOR *anc2)
-{
- if (anc2->anchor.next) {
- anc1->last->next = anc2->anchor.next;
- anc2->anchor.next->prev = anc1->last;
- anc1->last = anc2->last;
- }
- verify_list("append", anc1);
-}
-#if CPDEBUG < 0
-#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 0 /* unused */
-/*
- * anc1: e1, e2, e3
- * anc2: e4, e5
- *#=>
- * anc1: e4, e5
- * anc2: e1, e2, e3
- */
-static void
-SWAP_LIST(ISEQ_ARG_DECLARE LINK_ANCHOR *anc1, LINK_ANCHOR *anc2)
-{
- LINK_ANCHOR tmp = *anc2;
-
- /* it has bug */
- *anc2 = *anc1;
- *anc1 = tmp;
-
- verify_list("swap1", anc1);
- verify_list("swap2", anc2);
-}
-#if CPDEBUG < 0
-#define SWAP_LIST(anc1, anc2) SWAP_LIST(iseq, anc1, anc2)
-#endif
-
-static LINK_ANCHOR *
-REVERSE_LIST(ISEQ_ARG_DECLARE LINK_ANCHOR *anc)
-{
- LINK_ELEMENT *first, *last, *elem, *e;
- first = &anc->anchor;
- elem = first->next;
- last = anc->last;
-
- if (elem != 0) {
- anc->anchor.next = last;
- anc->last = elem;
- }
- else {
- /* null list */
- return anc;
- }
- while (elem) {
- e = elem->next;
- elem->next = elem->prev;
- elem->prev = e;
- elem = e;
- }
-
- first->next = last;
- last->prev = first;
- anc->last->next = 0;
-
- verify_list("reverse", anc);
- return anc;
-}
-#if CPDEBUG < 0
-#define REVERSE_LIST(anc) REVERSE_LIST(iseq, anc)
-#endif
-#endif
-
-#if CPDEBUG && 0
-static void
-debug_list(ISEQ_ARG_DECLARE LINK_ANCHOR *anchor)
-{
- LINK_ELEMENT *list = FIRST_ELEMENT(anchor);
- printf("----\n");
- printf("anch: %p, frst: %p, last: %p\n", &anchor->anchor,
- anchor->anchor.next, anchor->last);
- while (list) {
- printf("curr: %p, next: %p, prev: %p, type: %d\n", list, list->next,
- list->prev, FIX2INT(list->type));
- list = list->next;
- }
- printf("----\n");
-
- dump_disasm_list(anchor->anchor.next);
- verify_list("debug list", anchor);
-}
-#if CPDEBUG < 0
-#define debug_list(anc) debug_list(iseq, anc)
-#endif
-#endif
-
-static LABEL *
-new_label_body(rb_iseq_t *iseq, long line)
-{
- LABEL *labelobj = compile_data_alloc_label(iseq);
-
- labelobj->link.type = ISEQ_ELEMENT_LABEL;
- labelobj->link.next = 0;
-
- labelobj->label_no = iseq->compile_data->label_no++;
- labelobj->sc_state = 0;
- labelobj->sp = -1;
- return labelobj;
-}
-
-static ADJUST *
-new_adjust_body(rb_iseq_t *iseq, LABEL *label, long line)
-{
- ADJUST *adjust = compile_data_alloc_adjust(iseq);
- adjust->link.type = ISEQ_ELEMENT_ADJUST;
- adjust->link.next = 0;
- adjust->label = label;
- adjust->line_no = line;
- return adjust;
-}
-
-static INSN *
-new_insn_core(rb_iseq_t *iseq, long line_no,
- int insn_id, int argc, VALUE *argv)
-{
- INSN *iobj = compile_data_alloc_insn(iseq);
-
- iobj->link.type = ISEQ_ELEMENT_INSN;
- iobj->link.next = 0;
- iobj->insn_id = insn_id;
- iobj->line_no = line_no;
- iobj->operands = argv;
- iobj->operand_size = argc;
- iobj->sc_state = 0;
- return iobj;
-}
-
-static INSN *
-new_insn_body(rb_iseq_t *iseq, long line_no, int insn_id, int argc, ...)
-{
- VALUE *operands = 0;
- va_list argv;
- if (argc > 0) {
- int i;
- va_init_list(argv, 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;
- }
- va_end(argv);
- }
- return new_insn_core(iseq, line_no, insn_id, argc, operands);
-}
-
-static INSN *
-new_insn_send(rb_iseq_t *iseq, int line_no,
- VALUE id, VALUE argc, VALUE block, VALUE flag)
-{
- INSN *iobj = 0;
- VALUE *operands =
- (VALUE *)compile_data_alloc(iseq, sizeof(VALUE) * 4);
- operands[0] = id;
- operands[1] = argc;
- operands[2] = block;
- operands[3] = flag;
- iobj = new_insn_core(iseq, line_no, BIN(send), 4, operands);
- return iobj;
-}
-
-static VALUE
-new_child_iseq(rb_iseq_t *iseq, NODE *node,
- VALUE name, VALUE parent, VALUE type)
-{
- VALUE ret;
-
- debugs("[new_child_iseq]> ---------------------------------------\n");
- ret = rb_iseq_new_with_opt(node, name, iseq_filename(iseq->self),
- parent, type, iseq->compile_data->option);
- debugs("[new_child_iseq]< ---------------------------------------\n");
- iseq_add_mark_object(iseq, ret);
- return ret;
-}
-
-static int
-iseq_setup(rb_iseq_t *iseq, LINK_ANCHOR *anchor)
-{
- /* debugs("[compile step 2] (iseq_array_to_linkedlist)\n"); */
-
- if (compile_debug > 5)
- dump_disasm_list(FIRST_ELEMENT(anchor));
-
- debugs("[compile step 3.1 (iseq_optimize)]\n");
- iseq_optimize(iseq, anchor);
-
- if (compile_debug > 5)
- dump_disasm_list(FIRST_ELEMENT(anchor));
-
- 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->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 4.1 (iseq_set_sequence)]\n");
- 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");
- iseq_set_exception_table(iseq);
-
- debugs("[compile step 4.3 (set_optargs_table)] \n");
- iseq_set_optargs_table(iseq);
-
- debugs("[compile step 5 (iseq_translate_threaded_code)] \n");
- rb_iseq_translate_threaded_code(iseq);
-
- if (compile_debug > 1) {
- VALUE str = rb_iseq_disasm(iseq->self);
- printf("%s\n", StringValueCStr(str));
- fflush(stdout);
- }
- debugs("[compile step: finish]\n");
-
- return 0;
-}
-
-static int
-iseq_set_exception_local_table(rb_iseq_t *iseq)
-{
- 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_dyna_var_idx_at_raw(rb_iseq_t *iseq, ID id)
-{
- 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(rb_iseq_t *iseq, ID id)
-{
- int idx = get_dyna_var_idx_at_raw(iseq->local_iseq, id);
-
- if (idx < 0) {
- rb_bug("get_local_var_idx: %d", idx);
- }
-
- return idx;
-}
-
-static int
-get_dyna_var_idx(rb_iseq_t *iseq, ID id, int *level, int *ls)
-{
- int lv = 0, idx = -1;
-
- while (iseq) {
- idx = get_dyna_var_idx_at_raw(iseq, id);
- if (idx >= 0) {
- break;
- }
- iseq = iseq->parent_iseq;
- lv++;
- }
-
- if (idx < 0) {
- rb_bug("get_dyna_var_idx: -1");
- }
-
- *level = lv;
- *ls = iseq->local_size;
- return idx;
-}
-
-static int
-iseq_set_arguments(rb_iseq_t *iseq, LINK_ANCHOR *optargs, NODE *node_args)
-{
- debugs("iseq_set_arguments: %s\n", node_args ? "" : "0");
-
- if (node_args) {
- NODE *node_aux = node_args->nd_next;
- NODE *node_opt = node_args->nd_opt;
- ID rest_id = 0;
- int last_comma = 0;
- ID block_id = 0;
- NODE *node_init = 0;
-
- if (nd_type(node_args) != NODE_ARGS) {
- rb_bug("iseq_set_arguments: NODE_ARGS is expected, but %s",
- ruby_node_name(nd_type(node_args)));
- }
-
- /*
- * new argument infromation:
- * NODE_ARGS [m: int, o: NODE_OPT_ARG, ->]
- * NODE_ARGS_AUX [r: ID, b: ID, ->]
- * NODE_ARGS_AUX [Pst: id, Plen: int, init: NODE*]
- * optarg information:
- * NODE_OPT_ARGS [idx, expr, next ->]
- * init arg:
- * NODE_AND(m_init, p_init)
- * if "r" is 1, it's means "{|x,|}" type block parameter.
- */
-
- iseq->argc = (int)node_args->nd_frml;
- debugs(" - argc: %d\n", iseq->argc);
-
- if (node_aux) {
- rest_id = node_aux->nd_rest;
- if (rest_id == 1) {
- last_comma = 1;
- rest_id = 0;
- }
- block_id = (ID)node_aux->nd_body;
- node_aux = node_aux->nd_next;
-
- if (node_aux) {
- ID post_start_id = node_aux->nd_pid;
- iseq->arg_post_start = get_dyna_var_idx_at_raw(iseq, post_start_id);
- iseq->arg_post_len = (int)node_aux->nd_plen;
- node_init = node_aux->nd_next;
- }
- }
-
- if (node_opt) {
- NODE *node = node_opt;
- LABEL *label;
- VALUE labels = rb_ary_tmp_new(1);
- int i = 0, j;
-
- while (node) {
- label = NEW_LABEL(nd_line(node));
- rb_ary_push(labels, (VALUE)label | 1);
- ADD_LABEL(optargs, label);
- COMPILE_POPED(optargs, "optarg", node->nd_body);
- node = node->nd_next;
- i += 1;
- }
-
- /* last label */
- label = NEW_LABEL(nd_line(node_args));
- rb_ary_push(labels, (VALUE)label | 1);
- ADD_LABEL(optargs, label);
- i += 1;
-
- iseq->arg_opts = i;
- iseq->arg_opt_table = ALLOC_N(VALUE, i);
- MEMCPY(iseq->arg_opt_table, RARRAY_PTR(labels), VALUE, i);
- for (j = 0; j < i; j++) {
- iseq->arg_opt_table[j] &= ~1;
- }
- rb_ary_clear(labels);
- }
- else {
- iseq->arg_opts = 0;
- }
-
- if (node_init) {
- if (node_init->nd_1st) { /* m_init */
- COMPILE_POPED(optargs, "init arguments (m)", node_init->nd_1st);
- }
- if (node_init->nd_2nd) { /* p_init */
- COMPILE_POPED(optargs, "init arguments (p)", node_init->nd_2nd);
- }
- }
-
- if (rest_id) {
- iseq->arg_rest = get_dyna_var_idx_at_raw(iseq, rest_id);
-
- if (iseq->arg_rest == -1) {
- rb_bug("arg_rest: -1");
- }
-
- if (iseq->arg_post_start == 0) {
- iseq->arg_post_start = iseq->arg_rest + 1;
- }
- }
-
- if (block_id) {
- iseq->arg_block = get_dyna_var_idx_at_raw(iseq, block_id);
- }
-
- if (iseq->arg_opts != 0 || iseq->arg_post_len != 0 ||
- iseq->arg_rest != -1 || iseq->arg_block != -1) {
- iseq->arg_simple = 0;
-
- /* set arg_size: size of arguments */
- if (iseq->arg_block != -1) {
- iseq->arg_size = iseq->arg_block + 1;
- }
- else if (iseq->arg_post_len) {
- iseq->arg_size = iseq->arg_post_start + iseq->arg_post_len;
- }
- else if (iseq->arg_rest != -1) {
- iseq->arg_size = iseq->arg_rest + 1;
- }
- else if (iseq->arg_opts) {
- iseq->arg_size = iseq->argc + iseq->arg_opts - 1;
- }
- else {
- iseq->arg_size = iseq->argc;
- }
- }
- else {
- iseq->arg_simple = 1;
- iseq->arg_size = iseq->argc;
- }
-
- if (iseq->type == ISEQ_TYPE_BLOCK) {
- if (iseq->arg_opts == 0 && iseq->arg_post_len == 0 && iseq->arg_rest == -1) {
- if (iseq->argc == 1 && last_comma == 0) {
- /* {|a|} */
- iseq->arg_simple |= 0x02;
- }
- }
- }
- }
- else {
- iseq->arg_simple = 1;
- }
-
- return COMPILE_OK;
-}
-
-static int
-iseq_set_local_table(rb_iseq_t *iseq, ID *tbl)
-{
- int size;
-
- if (tbl) {
- size = (int)*tbl;
- tbl++;
- }
- else {
- size = 0;
- }
-
- if (size > 0) {
- iseq->local_table = (ID *)ALLOC_N(ID *, size);
- MEMCPY(iseq->local_table, tbl, ID *, 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)
-{
- if (val == lit) return 0;
- if (SPECIAL_CONST_P(lit)) {
- return val != lit;
- }
- if (SPECIAL_CONST_P(val) || BUILTIN_TYPE(val) != BUILTIN_TYPE(lit)) {
- return -1;
- }
- if (BUILTIN_TYPE(lit) == T_STRING) {
- return rb_str_hash_cmp(lit, val);
- }
- return !rb_eql(lit, val);
-}
-
-static int
-cdhash_hash(VALUE a)
-{
- if (SPECIAL_CONST_P(a)) return (int)a;
- if (TYPE(a) == T_STRING) return rb_str_hash(a);
- {
- VALUE hval = rb_hash(a);
- return (int)FIX2LONG(hval);
- }
-}
-
-static const struct st_hash_type cdhash_type = {
- cdhash_cmp,
- cdhash_hash,
-};
-
-/**
- ruby insn object array -> raw instruction sequence
- */
-static int
-iseq_set_sequence(rb_iseq_t *iseq, LINK_ANCHOR *anchor)
-{
- LABEL *lobj;
- INSN *iobj;
- struct iseq_insn_info_entry *insn_info_table;
- LINK_ELEMENT *list;
- VALUE *generated_iseq;
- int ic_size = 0;
- int ic_index = 0;
-
- int k, pos, sp, stack_max = 0, line = 0;
-
- /* set label position */
- list = FIRST_ELEMENT(anchor);
- k = pos = 0;
- while (list) {
- switch (list->type) {
- case ISEQ_ELEMENT_INSN:
- {
- iobj = (INSN *)list;
- line = iobj->line_no;
- pos += insn_data_length(iobj);
- ic_size += insn_iclen(iobj->insn_id);
- k++;
- break;
- }
- case ISEQ_ELEMENT_LABEL:
- {
- lobj = (LABEL *)list;
- lobj->position = pos;
- lobj->set = Qtrue;
- break;
- }
- case ISEQ_ELEMENT_NONE:
- {
- /* ignore */
- break;
- }
- case ISEQ_ELEMENT_ADJUST:
- {
- ADJUST *adjust = (ADJUST *)list;
- if (adjust->line_no != -1) {
- pos += 2 /* insn + 1 operand */;
- k++;
- }
- break;
- }
- default:
- dump_disasm_list(FIRST_ELEMENT(anchor));
- dump_disasm_list(list);
- rb_compile_error(RSTRING_PTR(iseq->filename), line,
- "error: set_sequence");
- break;
- }
- list = list->next;
- }
-
- /* make instruction sequence */
- generated_iseq = ALLOC_N(VALUE, pos);
- insn_info_table = ALLOC_N(struct iseq_insn_info_entry, k);
- iseq->ic_entries = ALLOC_N(struct iseq_inline_cache_entry, ic_size);
- MEMZERO(iseq->ic_entries, struct iseq_inline_cache_entry, ic_size);
- iseq->ic_size = ic_size;
-
- list = FIRST_ELEMENT(anchor);
- k = pos = sp = 0;
-
- while (list) {
- switch (list->type) {
- case ISEQ_ELEMENT_INSN:
- {
- int j, len, insn, iclen = 0;
- const char *types;
- VALUE *operands;
-
- 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[pos] = insn;
- types = insn_op_types(insn);
- len = insn_len(insn);
- iclen = insn_iclen(insn);
-
- /* operand check */
- if (iobj->operand_size + iclen != len - 1) {
- printf("%d, %d, %d\n", iobj->operand_size, iclen, len);
- dump_disasm_list(list);
- rb_compile_error(RSTRING_PTR(iseq->filename), iobj->line_no,
- "operand size miss! (%d for %d)",
- iobj->operand_size + iclen, len - 1);
- xfree(generated_iseq);
- xfree(insn_info_table);
- return 0;
- }
-
- for (j = 0; types[j]; j++) {
- char type = types[j];
- /* printf("--> [%c - (%d-%d)]\n", type, k, j); */
- switch (type) {
- case TS_OFFSET:
- {
- /* label(destination position) */
- lobj = (LABEL *)operands[j];
- if (lobj->set != Qtrue) {
- rb_compile_error(RSTRING_PTR(iseq->filename), 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:
- {
- /*
- * [obj, label, ...]
- */
- int i;
- VALUE lits = operands[j];
- VALUE map = rb_hash_new();
- RHASH_TBL(map)->type = &cdhash_type;
-
- for (i=0; i < RARRAY_LEN(lits); i+=2) {
- VALUE obj = rb_ary_entry(lits, i);
- VALUE lv = rb_ary_entry(lits, i+1);
- lobj = (LABEL *)(lv & ~1);
-
- if (lobj->set != Qtrue) {
- rb_compile_error(RSTRING_PTR(iseq->filename), iobj->line_no,
- "unknown label");
- }
- if (!st_lookup(rb_hash_tbl(map), obj, 0)) {
- rb_hash_aset(map, obj, INT2FIX(lobj->position - (pos+len)));
- }
- else {
- rb_compile_warning(RSTRING_PTR(iseq->filename), iobj->line_no,
- "duplicated when clause is ignored");
- }
- }
- hide_obj(map);
- generated_iseq[pos + 1 + j] = map;
- iseq_add_mark_object(iseq, map);
- break;
- }
- case TS_LINDEX:
- case TS_DINDEX:
- case TS_NUM: /* ulong */
- generated_iseq[pos + 1 + j] = FIX2INT(operands[j]);
- break;
- case TS_ISEQ: /* iseq */
- {
- VALUE v = operands[j];
- rb_iseq_t *block = 0;
- if (v) {
- GetISeqPtr(v, block);
- }
- generated_iseq[pos + 1 + j] = (VALUE)block;
- 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_IC: /* inline cache */
- {
- IC ic = &iseq->ic_entries[ic_index++];
- if (UNLIKELY(ic_index > ic_size)) {
- rb_bug("iseq_set_sequence: ic_index overflow: index: %d, size: %d",
- ic_index, ic_size);
- }
- generated_iseq[pos + 1 + j] = (VALUE)ic;
- break;
- }
- case TS_ID: /* ID */
- 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[pos + 1 + j] = (VALUE)entry;
- }
- break;
- default:
- rb_compile_error(RSTRING_PTR(iseq->filename), iobj->line_no,
- "unknown operand type: %c", type);
- xfree(generated_iseq);
- xfree(insn_info_table);
- return 0;
- }
- }
- insn_info_table[k].line_no = iobj->line_no;
- insn_info_table[k].position = pos;
- insn_info_table[k].sp = sp;
- pos += len;
- k++;
- break;
- }
- case ISEQ_ELEMENT_LABEL:
- {
- lobj = (LABEL *)list;
- if (lobj->sp == -1) {
- lobj->sp = sp;
- }
- else {
- sp = lobj->sp;
- }
- break;
- }
- case ISEQ_ELEMENT_ADJUST:
- {
- ADJUST *adjust = (ADJUST *)list;
- int orig_sp = sp;
-
- if (adjust->label) {
- sp = adjust->label->sp;
- }
- else {
- sp = 0;
- }
-
- if (adjust->line_no != -1) {
- if (orig_sp - sp > 0) {
- insn_info_table[k].line_no = adjust->line_no;
- insn_info_table[k].position = pos;
- insn_info_table[k].sp = sp;
- k++;
- generated_iseq[pos++] = BIN(adjuststack);
- generated_iseq[pos++] = orig_sp - sp;
- }
- else if (orig_sp - sp == 0) {
- /* jump to next insn */
- insn_info_table[k].line_no = adjust->line_no;
- insn_info_table[k].position = pos;
- insn_info_table[k].sp = sp;
- k++;
- generated_iseq[pos++] = BIN(jump);
- generated_iseq[pos++] = 0;
- }
- else {
- rb_bug("iseq_set_sequence: adjust bug");
- }
- }
- break;
- }
- default:
- /* ignore */
- break;
- }
- list = list->next;
- }
-
-#if 0 /* XXX */
- /* this check need dead code elimination */
- if (sp != 1) {
- rb_bug("SP is not 0 on %s (%d)\n", RSTRING_PTR(iseq->name), sp);
- }
-#endif
-
- iseq->iseq = (void *)generated_iseq;
- iseq->iseq_size = pos;
- iseq->insn_info_table = insn_info_table;
- iseq->insn_info_size = k;
- iseq->stack_max = stack_max;
-
- return COMPILE_OK;
-}
-
-static int
-label_get_position(LABEL *lobj)
-{
- return lobj->position;
-}
-
-static int
-label_get_sp(LABEL *lobj)
-{
- return lobj->sp;
-}
-
-static int
-iseq_set_exception_table(rb_iseq_t *iseq)
-{
- VALUE *tptr, *ptr;
- int tlen, i;
- struct iseq_catch_table_entry *entry;
-
- tlen = (int)RARRAY_LEN(iseq->compile_data->catch_table_ary);
- tptr = RARRAY_PTR(iseq->compile_data->catch_table_ary);
-
- iseq->catch_table = tlen ? ALLOC_N(struct iseq_catch_table_entry, tlen) : 0;
- iseq->catch_table_size = tlen;
-
- for (i = 0; i < tlen; i++) {
- ptr = RARRAY_PTR(tptr[i]);
- entry = &iseq->catch_table[i];
- entry->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--;
- }
- }
- else {
- entry->cont = 0;
- }
- }
-
- iseq->compile_data->catch_table_ary = 0; /* free */
- return COMPILE_OK;
-}
-
-/*
- * set optional argument table
- * def foo(a, b=expr1, c=expr2)
- * =>
- * b:
- * expr1
- * c:
- * expr2
- */
-static int
-iseq_set_optargs_table(rb_iseq_t *iseq)
-{
- int i;
-
- if (iseq->arg_opts != 0) {
- for (i = 0; i < iseq->arg_opts; i++) {
- iseq->arg_opt_table[i] =
- label_get_position((LABEL *)iseq->arg_opt_table[i]);
- }
- }
- return COMPILE_OK;
-}
-
-static LINK_ELEMENT *
-get_destination_insn(INSN *iobj)
-{
- LABEL *lobj = (LABEL *)OPERAND_AT(iobj, 0);
- LINK_ELEMENT *list;
-
- list = lobj->link.next;
- while (list) {
- if (list->type == ISEQ_ELEMENT_INSN || list->type == ISEQ_ELEMENT_ADJUST) {
- break;
- }
- list = list->next;
- }
- return list;
-}
-
-static LINK_ELEMENT *
-get_next_insn(INSN *iobj)
-{
- LINK_ELEMENT *list = iobj->link.next;
-
- while (list) {
- if (list->type == ISEQ_ELEMENT_INSN || list->type == ISEQ_ELEMENT_ADJUST) {
- return list;
- }
- list = list->next;
- }
- return 0;
-}
-
-static LINK_ELEMENT *
-get_prev_insn(INSN *iobj)
-{
- LINK_ELEMENT *list = iobj->link.prev;
-
- while (list) {
- if (list->type == ISEQ_ELEMENT_INSN || list->type == ISEQ_ELEMENT_ADJUST) {
- return list;
- }
- list = list->prev;
- }
- return 0;
-}
-
-static int
-iseq_peephole_optimize(rb_iseq_t *iseq, LINK_ELEMENT *list, const int do_tailcallopt)
-{
- INSN *iobj = (INSN *)list;
- again:
- 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);
-
- if (diobj == niobj) {
- /*
- * jump LABEL
- * LABEL:
- * =>
- * LABEL:
- */
- REMOVE_ELEM(&iobj->link);
- }
- else if (iobj != diobj && diobj->insn_id == BIN(jump)) {
- if (OPERAND_AT(iobj, 0) != OPERAND_AT(diobj, 0)) {
- OPERAND_AT(iobj, 0) = OPERAND_AT(diobj, 0);
- goto again;
- }
- }
- else if (diobj->insn_id == BIN(leave)) {
- /*
- * jump LABEL
- * ...
- * LABEL:
- * leave
- * =>
- * leave
- * ...
- * LABEL:
- * leave
- */
- INSN *eiobj = new_insn_core(iseq, iobj->line_no, BIN(leave),
- diobj->operand_size, diobj->operands);
- INSN *popiobj = new_insn_core(iseq, iobj->line_no,
- BIN(pop), 0, 0);
- /* replace */
- REPLACE_ELEM((LINK_ELEMENT *)iobj, (LINK_ELEMENT *)eiobj);
- INSERT_ELEM_NEXT((LINK_ELEMENT *)eiobj, (LINK_ELEMENT *)popiobj);
- iobj = popiobj;
- }
- /*
- * 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);
- OPERAND_AT(piobj, 0) = OPERAND_AT(iobj, 0);
- REMOVE_ELEM(&iobj->link);
- }
- }
- }
-
- if (iobj->insn_id == BIN(branchif) ||
- iobj->insn_id == BIN(branchunless)) {
- /*
- * if L1
- * ...
- * L1:
- * jump L2
- * =>
- * if L2
- */
- INSN *nobj = (INSN *)get_destination_insn(iobj);
- if (nobj->insn_id == BIN(jump)) {
- OPERAND_AT(iobj, 0) = OPERAND_AT(nobj, 0);
- }
- }
-
- if (do_tailcallopt && iobj->insn_id == BIN(leave)) {
- /*
- * send ...
- * leave
- * =>
- * send ..., ... | VM_CALL_TAILCALL_BIT, ...
- * leave # unreachable
- */
- INSN *piobj = (INSN *)get_prev_insn((INSN *)list);
-
- if (piobj->insn_id == BIN(send) &&
- piobj->operands[2] == 0 /* block */
- ) {
- piobj->operands[3] = INT2FIX(FIX2INT(piobj->operands[3]) | VM_CALL_TAILCALL_BIT);
- }
- }
- return COMPILE_OK;
-}
-
-static int
-insn_set_specialized_instruction(INSN *iobj, int insn_id)
-{
- iobj->insn_id = insn_id;
- iobj->operand_size = 0;
- return COMPILE_OK;
-}
-
-static int
-iseq_specialized_instruction(rb_iseq_t *iseq, INSN *iobj)
-{
- if (iobj->insn_id == BIN(send)) {
- ID mid = SYM2ID(OPERAND_AT(iobj, 0));
- int argc = FIX2INT(OPERAND_AT(iobj, 1));
- VALUE block = OPERAND_AT(iobj, 2);
- VALUE flag = OPERAND_AT(iobj, 3);
-
- /* TODO: should be more sophisticated search */
- if (block == 0 && flag == INT2FIX(0)) {
- if (argc == 0) {
- if (mid == idLength) {
- insn_set_specialized_instruction(iobj, BIN(opt_length));
- }
- else if (mid == idSucc) {
- insn_set_specialized_instruction(iobj, BIN(opt_succ));
- }
- else if (mid == idNot) {
- insn_set_specialized_instruction(iobj, BIN(opt_not));
- }
- }
- else if (argc == 1) {
- if (0) {
- }
- else if (mid == idPLUS) {
- insn_set_specialized_instruction(iobj, BIN(opt_plus));
- }
- else if (mid == idMINUS) {
- insn_set_specialized_instruction(iobj, BIN(opt_minus));
- }
- else if (mid == idMULT) {
- insn_set_specialized_instruction(iobj, BIN(opt_mult));
- }
- else if (mid == idDIV) {
- insn_set_specialized_instruction(iobj, BIN(opt_div));
- }
- else if (mid == idMOD) {
- insn_set_specialized_instruction(iobj, BIN(opt_mod));
- }
- else if (mid == idEq) {
- insn_set_specialized_instruction(iobj, BIN(opt_eq));
- }
- else if (mid == idNeq) {
- insn_set_specialized_instruction(iobj, BIN(opt_neq));
- }
- else if (mid == idLT) {
- insn_set_specialized_instruction(iobj, BIN(opt_lt));
- }
- else if (mid == idLE) {
- insn_set_specialized_instruction(iobj, BIN(opt_le));
- }
- else if (mid == idGT) {
- insn_set_specialized_instruction(iobj, BIN(opt_gt));
- }
- else if (mid == idGE) {
- insn_set_specialized_instruction(iobj, BIN(opt_ge));
- }
- else if (mid == idLTLT) {
- insn_set_specialized_instruction(iobj, BIN(opt_ltlt));
- }
- else if (mid == idAREF) {
- insn_set_specialized_instruction(iobj, BIN(opt_aref));
- }
- }
- }
- }
- return COMPILE_OK;
-}
-
-static int
-iseq_optimize(rb_iseq_t *iseq, LINK_ANCHOR *anchor)
-{
- LINK_ELEMENT *list;
- const int do_peepholeopt = iseq->compile_data->option->peephole_optimization;
- const int do_tailcallopt = iseq->compile_data->option->tailcall_optimization;
- const int do_si = iseq->compile_data->option->specialized_instruction;
- const int do_ou = iseq->compile_data->option->operands_unification;
- list = FIRST_ELEMENT(anchor);
-
- while (list) {
- if (list->type == ISEQ_ELEMENT_INSN) {
- if (do_peepholeopt) {
- iseq_peephole_optimize(iseq, list, do_tailcallopt);
- }
- if (do_si) {
- iseq_specialized_instruction(iseq, (INSN *)list);
- }
- if (do_ou) {
- insn_operands_unification((INSN *)list);
- }
- }
- list = list->next;
- }
- return COMPILE_OK;
-}
-
-#if OPT_INSTRUCTIONS_UNIFICATION
-static INSN *
-new_unified_insn(rb_iseq_t *iseq,
- int insn_id, int size, LINK_ELEMENT *seq_list)
-{
- INSN *iobj = 0;
- LINK_ELEMENT *list = seq_list;
- int i, argc = 0;
- VALUE *operands = 0, *ptr = 0;
-
-
- /* count argc */
- for (i = 0; i < size; i++) {
- iobj = (INSN *)list;
- argc += iobj->operand_size;
- list = list->next;
- }
-
- if (argc > 0) {
- ptr = operands =
- (VALUE *)compile_data_alloc(iseq, sizeof(VALUE) * argc);
- }
-
- /* copy operands */
- list = seq_list;
- for (i = 0; i < size; i++) {
- iobj = (INSN *)list;
- MEMCPY(ptr, iobj->operands, VALUE, iobj->operand_size);
- ptr += iobj->operand_size;
- list = list->next;
- }
-
- return new_insn_core(iseq, iobj->line_no, insn_id, argc, operands);
-}
-#endif
-
-/*
- * This scheme can get more performance if do this optimize with
- * label address resolving.
- * It's future work (if compile time was bottle neck).
- */
-static int
-iseq_insns_unification(rb_iseq_t *iseq, LINK_ANCHOR *anchor)
-{
-#if OPT_INSTRUCTIONS_UNIFICATION
- LINK_ELEMENT *list;
- INSN *iobj, *niobj;
- int id, j, k;
-
- list = FIRST_ELEMENT(anchor);
- while (list) {
- if (list->type == ISEQ_ELEMENT_INSN) {
- iobj = (INSN *)list;
- id = iobj->insn_id;
- if (unified_insns_data[id] != 0) {
- const int *const *entry = unified_insns_data[id];
- for (j = 1; j < (int)entry[0]; j++) {
- const int *unified = entry[j];
- LINK_ELEMENT *li = list->next;
- for (k = 2; k < unified[1]; k++) {
- if (li->type != ISEQ_ELEMENT_INSN ||
- ((INSN *)li)->insn_id != unified[k]) {
- goto miss;
- }
- li = li->next;
- }
- /* matched */
- niobj =
- new_unified_insn(iseq, unified[0], unified[1] - 1,
- list);
-
- /* insert to list */
- niobj->link.prev = (LINK_ELEMENT *)iobj->link.prev;
- niobj->link.next = li;
- if (li) {
- li->prev = (LINK_ELEMENT *)niobj;
- }
-
- list->prev->next = (LINK_ELEMENT *)niobj;
- list = (LINK_ELEMENT *)niobj;
- break;
- miss:;
- }
- }
- }
- list = list->next;
- }
-#endif
- return COMPILE_OK;
-}
-
-#if OPT_STACK_CACHING
-
-#define SC_INSN(insn, stat) sc_insn_info[(insn)][(stat)]
-#define SC_NEXT(insn) sc_insn_next[insn]
-
-#include "opt_sc.inc"
-
-static int
-insn_set_sc_state(rb_iseq_t *iseq, INSN *iobj, int state)
-{
- int nstate;
- int insn_id;
-
- insn_id = iobj->insn_id;
- iobj->insn_id = SC_INSN(insn_id, state);
- nstate = SC_NEXT(iobj->insn_id);
-
- if (insn_id == BIN(jump) ||
- insn_id == BIN(branchif) || insn_id == BIN(branchunless)) {
- LABEL *lobj = (LABEL *)OPERAND_AT(iobj, 0);
-
- if (lobj->sc_state != 0) {
- if (lobj->sc_state != nstate) {
- dump_disasm_list((LINK_ELEMENT *)iobj);
- dump_disasm_list((LINK_ELEMENT *)lobj);
- printf("\n-- %d, %d\n", lobj->sc_state, nstate);
- rb_compile_error(RSTRING_PTR(iseq->filename), iobj->line_no,
- "insn_set_sc_state error\n");
- return 0;
- }
- }
- else {
- lobj->sc_state = nstate;
- }
- if (insn_id == BIN(jump)) {
- nstate = SCS_XX;
- }
- }
- else if (insn_id == BIN(leave)) {
- nstate = SCS_XX;
- }
-
- return nstate;
-}
-
-static int
-label_set_sc_state(LABEL *lobj, int state)
-{
- if (lobj->sc_state != 0) {
- if (lobj->sc_state != state) {
- state = lobj->sc_state;
- }
- }
- else {
- lobj->sc_state = state;
- }
-
- return state;
-}
-
-
-#endif
-
-static int
-iseq_set_sequence_stackcaching(rb_iseq_t *iseq, LINK_ANCHOR *anchor)
-{
-#if OPT_STACK_CACHING
- LINK_ELEMENT *list;
- int state, insn_id;
-
- /* initialize */
- state = SCS_XX;
- list = FIRST_ELEMENT(anchor);
- /* dump_disasm_list(list); */
-
- /* for each list element */
- while (list) {
- redo_point:
- switch (list->type) {
- case ISEQ_ELEMENT_INSN:
- {
- INSN *iobj = (INSN *)list;
- insn_id = iobj->insn_id;
-
- /* dump_disasm_list(list); */
-
- switch (insn_id) {
- case BIN(nop):
- {
- /* exception merge point */
- if (state != SCS_AX) {
- INSN *rpobj =
- new_insn_body(iseq, 0, BIN(reput), 0);
-
- /* replace this insn */
- REPLACE_ELEM(list, (LINK_ELEMENT *)rpobj);
- list = (LINK_ELEMENT *)rpobj;
- goto redo_point;
- }
- break;
- }
- case BIN(swap):
- {
- if (state == SCS_AB || state == SCS_BA) {
- state = (state == SCS_AB ? SCS_BA : SCS_AB);
-
- REMOVE_ELEM(list);
- list = list->next;
- goto redo_point;
- }
- break;
- }
- case BIN(pop):
- {
- switch (state) {
- case SCS_AX:
- case SCS_BX:
- state = SCS_XX;
- break;
- case SCS_AB:
- state = SCS_AX;
- break;
- case SCS_BA:
- state = SCS_BX;
- break;
- case SCS_XX:
- goto normal_insn;
- default:
- rb_compile_error(RSTRING_PTR(iseq->filename), iobj->line_no,
- "unreachable");
- }
- /* remove useless pop */
- REMOVE_ELEM(list);
- list = list->next;
- goto redo_point;
- }
- default:;
- /* none */
- } /* end of switch */
- normal_insn:
- state = insn_set_sc_state(iseq, iobj, state);
- break;
- }
- case ISEQ_ELEMENT_LABEL:
- {
- LABEL *lobj;
- lobj = (LABEL *)list;
-
- state = label_set_sc_state(lobj, state);
- }
- default:
- break;
- }
- list = list->next;
- }
-#endif
- return COMPILE_OK;
-}
-
-
-
-static int
-compile_dstr_fragments(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int *cntp)
-{
- NODE *list = node->nd_next;
- VALUE lit = node->nd_lit;
- int cnt = 1;
-
- debugp_param("nd_lit", lit);
- hide_obj(lit);
- ADD_INSN1(ret, nd_line(node), putobject, lit);
-
- while (list) {
- COMPILE(ret, "each string", list->nd_head);
- cnt++;
- list = list->nd_next;
- }
- *cntp = cnt;
-
- return COMPILE_OK;
-}
-
-static int
-compile_dstr(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node)
-{
- int 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 *ret, NODE * node)
-{
- int 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_branch_condition(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * cond,
- LABEL *then_label, LABEL *else_label)
-{
- switch (nd_type(cond)) {
- case NODE_AND:
- {
- LABEL *label = NEW_LABEL(nd_line(cond));
- compile_branch_condition(iseq, ret, cond->nd_1st, label,
- else_label);
- ADD_LABEL(ret, label);
- compile_branch_condition(iseq, ret, cond->nd_2nd, then_label,
- else_label);
- break;
- }
- case NODE_OR:
- {
- LABEL *label = NEW_LABEL(nd_line(cond));
- compile_branch_condition(iseq, ret, cond->nd_1st, then_label,
- label);
- ADD_LABEL(ret, label);
- compile_branch_condition(iseq, ret, cond->nd_2nd, then_label,
- else_label);
- break;
- }
- case NODE_LIT: /* NODE_LIT is always not true */
- case NODE_TRUE:
- case NODE_STR:
- /* printf("useless conditon eliminate (%s)\n", ruby_node_name(nd_type(cond))); */
- ADD_INSNL(ret, nd_line(cond), jump, then_label);
- break;
- case NODE_FALSE:
- case NODE_NIL:
- /* printf("useless conditon eliminate (%s)\n", ruby_node_name(nd_type(cond))); */
- ADD_INSNL(ret, nd_line(cond), jump, else_label);
- break;
- default:
- COMPILE(ret, "branch condition", cond);
- ADD_INSNL(ret, nd_line(cond), branchunless, else_label);
- ADD_INSNL(ret, nd_line(cond), jump, then_label);
- break;
- }
- return COMPILE_OK;
-}
-
-static int
-compile_array_(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE* node_root,
- VALUE opt_p, int poped)
-{
- NODE *node = node_root;
- int len = (int)node->nd_alen, line = (int)nd_line(node), i=0;
- DECL_ANCHOR(anchor);
-
- INIT_ANCHOR(anchor);
- if (nd_type(node) != NODE_ZARRAY) {
- while (node) {
- if (nd_type(node) != NODE_ARRAY) {
- rb_bug("compile_array: This node is not NODE_ARRAY, but %s",
- ruby_node_name(nd_type(node)));
- }
-
- i++;
- if (opt_p && nd_type(node->nd_head) != NODE_LIT) {
- opt_p = Qfalse;
- }
- COMPILE_(anchor, "array element", node->nd_head, poped);
- node = node->nd_next;
- }
- }
-
- if (len != i) {
- if (0) {
- rb_bug("node error: compile_array (%d: %d-%d)",
- (int)nd_line(node_root), len, i);
- }
- len = i;
- }
-
- if (opt_p == Qtrue) {
- if (!poped) {
- VALUE ary = rb_ary_tmp_new(len);
- node = node_root;
- while (node) {
- rb_ary_push(ary, node->nd_head->nd_lit);
- node = node->nd_next;
- }
- OBJ_FREEZE(ary);
- iseq_add_mark_object_compile_time(iseq, ary);
- ADD_INSN1(ret, nd_line(node_root), duparray, ary);
- }
- }
- else {
- if (!poped) {
- ADD_INSN1(anchor, line, newarray, INT2FIX(len));
- }
- APPEND_LIST(ret, anchor);
- }
- return len;
-}
-
-static VALUE
-compile_array(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE* node_root, VALUE opt_p)
-{
- return compile_array_(iseq, ret, node_root, opt_p, 0);
-}
-
-static VALUE
-case_when_optimizable_literal(NODE * node)
-{
- switch (nd_type(node)) {
- case NODE_LIT: {
- VALUE v = node->nd_lit;
- if (SYMBOL_P(v) || rb_obj_is_kind_of(v, rb_cNumeric)) {
- return v;
- }
- break;
- }
- case NODE_STR:
- return node->nd_lit;
- }
- return Qfalse;
-}
-
-static VALUE
-when_vals(rb_iseq_t *iseq, LINK_ANCHOR *cond_seq, NODE *vals, LABEL *l1, VALUE special_literals)
-{
- while (vals) {
- VALUE lit;
- NODE* val;
-
- val = vals->nd_head;
-
- if (special_literals &&
- (lit = case_when_optimizable_literal(val)) != Qfalse) {
- rb_ary_push(special_literals, lit);
- rb_ary_push(special_literals, (VALUE)(l1) | 1);
- }
- else {
- special_literals = Qfalse;
- }
-
- COMPILE(cond_seq, "when cond", val);
- ADD_INSN1(cond_seq, nd_line(val), topn, INT2FIX(1));
- ADD_SEND(cond_seq, nd_line(val), ID2SYM(idEqq), INT2FIX(1));
- ADD_INSNL(cond_seq, nd_line(val), branchif, l1);
- vals = vals->nd_next;
- }
- return special_literals;
-}
-
-static int
-compile_massign_lhs(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE *node)
-{
- switch (nd_type(node)) {
- case NODE_ATTRASGN: {
- INSN *iobj;
- VALUE dupidx;
-
- COMPILE_POPED(ret, "masgn lhs (NODE_ATTRASGN)", node);
- POP_ELEMENT(ret); /* pop pop insn */
- iobj = (INSN *)POP_ELEMENT(ret); /* pop send insn */
-
- dupidx = iobj->operands[1];
- dupidx = INT2FIX(FIX2INT(dupidx) + 1);
- iobj->operands[1] = dupidx;
-
- ADD_INSN1(ret, nd_line(node), topn, dupidx);
- ADD_ELEM(ret, (LINK_ELEMENT *)iobj);
- ADD_INSN(ret, nd_line(node), pop); /* result */
- ADD_INSN(ret, nd_line(node), pop); /* rhs */
- break;
- }
- case NODE_MASGN: {
- DECL_ANCHOR(anchor);
- INIT_ANCHOR(anchor);
- COMPILE_POPED(anchor, "nest masgn lhs", node);
- REMOVE_ELEM(FIRST_ELEMENT(anchor));
- ADD_SEQ(ret, anchor);
- break;
- }
- default: {
- DECL_ANCHOR(anchor);
- INIT_ANCHOR(anchor);
- COMPILE_POPED(anchor, "masgn lhs", node);
- REMOVE_ELEM(FIRST_ELEMENT(anchor));
- ADD_SEQ(ret, anchor);
- }
- }
-
- return COMPILE_OK;
-}
-
-static void
-compile_massign_opt_lhs(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE *lhsn)
-{
- if (lhsn) {
- compile_massign_opt_lhs(iseq, ret, lhsn->nd_next);
- compile_massign_lhs(iseq, ret, lhsn->nd_head);
- }
-}
-
-static int
-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;
- NODE *lhsn = orig_lhsn;
-
-#define MEMORY(v) { \
- int i; \
- if (memindex == memsize) return 0; \
- for (i=0; i<memindex; i++) { \
- if (mem[i] == (v)) return 0; \
- } \
- mem[memindex++] = (v); \
-}
-
- if (rhsn == 0 || nd_type(rhsn) != NODE_ARRAY) {
- return 0;
- }
-
- while (lhsn) {
- NODE *ln = lhsn->nd_head;
- switch (nd_type(ln)) {
- case NODE_LASGN:
- MEMORY(ln->nd_vid);
- break;
- case NODE_DASGN:
- case NODE_DASGN_CURR:
- case NODE_IASGN:
- case NODE_IASGN2:
- case NODE_CVASGN:
- MEMORY(ln->nd_vid);
- break;
- default:
- return 0;
- }
- lhsn = lhsn->nd_next;
- llen++;
- }
-
- while (rhsn) {
- if (llen <= rlen) {
- COMPILE_POPED(ret, "masgn val (poped)", rhsn->nd_head);
- }
- else {
- COMPILE(ret, "masgn val", rhsn->nd_head);
- }
- rhsn = rhsn->nd_next;
- rlen++;
- }
-
- if (llen > rlen) {
- for (i=0; i<llen-rlen; i++) {
- ADD_INSN(ret, nd_line(orig_lhsn), putnil);
- }
- }
-
- compile_massign_opt_lhs(iseq, ret, orig_lhsn);
- return 1;
-}
-
-static int
-compile_massign(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE *node, int poped)
-{
- 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 (!poped || splatn || !compile_massign_opt(iseq, ret, rhsn, lhsn)) {
- int llen = 0;
- DECL_ANCHOR(lhsseq);
-
- INIT_ANCHOR(lhsseq);
-
- while (lhsn) {
- compile_massign_lhs(iseq, lhsseq, lhsn->nd_head);
- llen += 1;
- lhsn = lhsn->nd_next;
- }
-
- COMPILE(ret, "normal masgn rhs", rhsn);
-
- if (!poped) {
- ADD_INSN(ret, nd_line(node), dup);
- }
-
- 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 */
- NODE *postn = splatn->nd_2nd;
- NODE *restn = splatn->nd_1st;
- int num = (int)postn->nd_alen;
- int flag = 0x02 | (((VALUE)restn == (VALUE)-1) ? 0x00 : 0x01);
-
- ADD_INSN2(ret, nd_line(splatn), expandarray,
- INT2FIX(num), INT2FIX(flag));
-
- if ((VALUE)restn != (VALUE)-1) {
- compile_massign_lhs(iseq, ret, restn);
- }
- while (postn) {
- compile_massign_lhs(iseq, ret, postn->nd_head);
- postn = postn->nd_next;
- }
- }
- else {
- /* a, b, *r */
- compile_massign_lhs(iseq, ret, splatn);
- }
- }
- }
- return COMPILE_OK;
-}
-
-static int
-compile_colon2(rb_iseq_t *iseq, NODE * node,
- LINK_ANCHOR *pref, LINK_ANCHOR *body)
-{
- switch (nd_type(node)) {
- case NODE_CONST:
- debugi("compile_colon2 - colon", node->nd_vid);
- ADD_INSN1(body, nd_line(node), getconstant, ID2SYM(node->nd_vid));
- break;
- case NODE_COLON3:
- debugi("compile_colon2 - colon3", node->nd_mid);
- ADD_INSN(body, nd_line(node), pop);
- ADD_INSN1(body, nd_line(node), putobject, rb_cObject);
- ADD_INSN1(body, nd_line(node), getconstant, ID2SYM(node->nd_mid));
- break;
- case NODE_COLON2:
- 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:
- COMPILE(pref, "const colon2 prefix", node);
- break;
- }
- return COMPILE_OK;
-}
-
-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 Qfalse;
- }
- else if (cpath->nd_head) {
- /* Bar::Foo */
- 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_CBASE));
- return Qtrue;
- }
-}
-
-static int
-defined_expr(rb_iseq_t *iseq, LINK_ANCHOR *ret,
- NODE *node, LABEL **lfinish, VALUE needstr)
-{
- const char *estr = 0;
- enum node_type type;
-
- switch (type = nd_type(node)) {
-
- /* easy literals */
- case NODE_NIL:
- estr = "nil";
- break;
- case NODE_SELF:
- estr = "self";
- break;
- case NODE_TRUE:
- estr = "true";
- break;
- case NODE_FALSE:
- estr = "false";
- break;
-
- case NODE_ARRAY:{
- NODE *vals = node;
-
- do {
- defined_expr(iseq, ret, vals->nd_head, lfinish, Qfalse);
-
- if (!lfinish[1]) {
- lfinish[1] = NEW_LABEL(nd_line(node));
- }
- ADD_INSNL(ret, nd_line(node), branchunless, lfinish[1]);
- } while ((vals = vals->nd_next) != NULL);
- }
- case NODE_STR:
- case NODE_LIT:
- case NODE_ZARRAY:
- case NODE_AND:
- case NODE_OR:
- default:
- estr = "expression";
- break;
-
- /* variables */
- case NODE_LVAR:
- case NODE_DVAR:
- estr = "local-variable";
- break;
-
- case NODE_IVAR:
- ADD_INSN(ret, nd_line(node), putnil);
- ADD_INSN3(ret, nd_line(node), defined, INT2FIX(DEFINED_IVAR),
- ID2SYM(node->nd_vid), needstr);
- return 1;
-
- case NODE_GVAR:
- ADD_INSN(ret, nd_line(node), putnil);
- ADD_INSN3(ret, nd_line(node), defined, INT2FIX(DEFINED_GVAR),
- ((VALUE)node->nd_entry) | 1, needstr);
- return 1;
-
- case NODE_CVAR:
- ADD_INSN(ret, nd_line(node), putnil);
- ADD_INSN3(ret, nd_line(node), defined, INT2FIX(DEFINED_CVAR),
- ID2SYM(node->nd_vid), needstr);
- return 1;
-
- case NODE_CONST:
- ADD_INSN(ret, nd_line(node), putnil);
- ADD_INSN3(ret, nd_line(node), defined, INT2FIX(DEFINED_CONST),
- ID2SYM(node->nd_vid), needstr);
- return 1;
- case NODE_COLON2:
- if (!lfinish[1]) {
- lfinish[1] = NEW_LABEL(nd_line(node));
- }
- defined_expr(iseq, ret, node->nd_head, lfinish, Qfalse);
- ADD_INSNL(ret, nd_line(node), branchunless, lfinish[1]);
-
- if (rb_is_const_id(node->nd_mid)) {
- COMPILE(ret, "defined/colon2#nd_head", node->nd_head);
- ADD_INSN3(ret, nd_line(node), defined, INT2FIX(DEFINED_CONST),
- ID2SYM(node->nd_mid), needstr);
- }
- else {
- COMPILE(ret, "defined/colon2#nd_head", node->nd_head);
- ADD_INSN3(ret, nd_line(node), defined, INT2FIX(DEFINED_METHOD),
- ID2SYM(node->nd_mid), needstr);
- }
- return 1;
- case NODE_COLON3:
- ADD_INSN1(ret, nd_line(node), putobject, rb_cObject);
- ADD_INSN3(ret, nd_line(node), defined,
- INT2FIX(DEFINED_CONST), ID2SYM(node->nd_mid), needstr);
- return 1;
-
- /* method dispatch */
- case NODE_CALL:
- case NODE_VCALL:
- case NODE_FCALL:
- case NODE_ATTRASGN:{
- int self = Qtrue;
-
- switch (type) {
- case NODE_ATTRASGN:
- if (node->nd_recv == (NODE *)1) break;
- case NODE_CALL:
- self = Qfalse;
- break;
- default:
- /* through */;
- }
- if (!lfinish[1]) {
- lfinish[1] = NEW_LABEL(nd_line(node));
- }
- if (node->nd_args) {
- defined_expr(iseq, ret, node->nd_args, lfinish, Qfalse);
- ADD_INSNL(ret, nd_line(node), branchunless, lfinish[1]);
- }
- if (!self) {
- LABEL *lstart = NEW_LABEL(nd_line(node));
- LABEL *lend = NEW_LABEL(nd_line(node));
- VALUE rescue = NEW_CHILD_ISEQVAL(NEW_NIL(),
- rb_str_concat(rb_str_new2
- ("defined guard in "),
- iseq->name),
- ISEQ_TYPE_DEFINED_GUARD);
-
- defined_expr(iseq, ret, node->nd_recv, lfinish, Qfalse);
- ADD_INSNL(ret, nd_line(node), branchunless, lfinish[1]);
-
- ADD_LABEL(ret, lstart);
- COMPILE(ret, "defined/recv", node->nd_recv);
- ADD_LABEL(ret, lend);
- ADD_CATCH_ENTRY(CATCH_TYPE_RESCUE, lstart, lend, rescue, lfinish[1]);
- ADD_INSN3(ret, nd_line(node), defined, INT2FIX(DEFINED_METHOD),
- ID2SYM(node->nd_mid), needstr);
- }
- else {
- ADD_INSN(ret, nd_line(node), putself);
- ADD_INSN3(ret, nd_line(node), defined, INT2FIX(DEFINED_FUNC),
- ID2SYM(node->nd_mid), needstr);
- }
- return 1;
- }
-
- case NODE_YIELD:
- ADD_INSN(ret, nd_line(node), putnil);
- ADD_INSN3(ret, nd_line(node), defined, INT2FIX(DEFINED_YIELD), 0,
- needstr);
- return 1;
-
- case NODE_BACK_REF:
- case NODE_NTH_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 1;
-
- case NODE_SUPER:
- case NODE_ZSUPER:
- ADD_INSN(ret, nd_line(node), putnil);
- ADD_INSN3(ret, nd_line(node), defined, INT2FIX(DEFINED_ZSUPER), 0,
- needstr);
- return 1;
-
- case NODE_OP_ASGN1:
- case NODE_OP_ASGN2:
- case NODE_OP_ASGN_OR:
- case NODE_OP_ASGN_AND:
- case NODE_MASGN:
- case NODE_LASGN:
- case NODE_DASGN:
- case NODE_DASGN_CURR:
- case NODE_GASGN:
- case NODE_IASGN:
- case NODE_CDECL:
- case NODE_CVDECL:
- case NODE_CVASGN:
- estr = "assignment";
- break;
- }
-
- if (estr != 0) {
- if (needstr != Qfalse) {
- VALUE str = rb_str_new2(estr);
- hide_obj(str);
- ADD_INSN1(ret, nd_line(node), putstring, str);
- iseq_add_mark_object_compile_time(iseq, str);
- }
- else {
- ADD_INSN1(ret, nd_line(node), putobject, Qtrue);
- }
- return 1;
- }
- return 0;
-}
-
-#define BUFSIZE 0x100
-
-static VALUE
-make_name_for_block(rb_iseq_t *iseq)
-{
- int level = 1;
- rb_iseq_t *ip = iseq;
-
- if (iseq->parent_iseq != 0) {
- while (ip->local_iseq != ip) {
- if (ip->type == ISEQ_TYPE_BLOCK) {
- level++;
- }
- ip = ip->parent_iseq;
- }
- }
-
- if (level == 1) {
- return rb_sprintf("block in %s", RSTRING_PTR(ip->name));
- }
- else {
- return rb_sprintf("block (%d levels) in %s", level, RSTRING_PTR(ip->name));
- }
-}
-
-static void
-push_ensure_entry(rb_iseq_t *iseq,
- struct iseq_compile_data_ensure_node_stack *enl,
- struct ensure_range *er, NODE *node)
-{
- enl->ensure_node = node;
- enl->prev = iseq->compile_data->ensure_node_stack; /* prev */
- enl->erange = er;
- iseq->compile_data->ensure_node_stack = enl;
-}
-
-static void
-add_ensure_range(rb_iseq_t *iseq, struct ensure_range *erange,
- LABEL *lstart, LABEL *lend)
-{
- struct ensure_range *ne =
- compile_data_alloc(iseq, sizeof(struct ensure_range));
-
- while (erange->next != 0) {
- erange = erange->next;
- }
- ne->next = 0;
- ne->begin = lend;
- ne->end = erange->end;
- erange->end = lstart;
-
- erange->next = ne;
-}
-
-static void
-add_ensure_iseq(LINK_ANCHOR *ret, rb_iseq_t *iseq, int is_return)
-{
- struct iseq_compile_data_ensure_node_stack *enlp =
- iseq->compile_data->ensure_node_stack;
- struct iseq_compile_data_ensure_node_stack *prev_enlp = enlp;
- DECL_ANCHOR(ensure);
-
- INIT_ANCHOR(ensure);
- while (enlp) {
- if (enlp->erange != 0) {
- DECL_ANCHOR(ensure_part);
- LABEL *lstart = NEW_LABEL(0);
- LABEL *lend = NEW_LABEL(0);
- INIT_ANCHOR(ensure_part);
-
- add_ensure_range(iseq, enlp->erange, lstart, lend);
-
- iseq->compile_data->ensure_node_stack = enlp->prev;
- ADD_LABEL(ensure_part, lstart);
- COMPILE_POPED(ensure_part, "ensure part", enlp->ensure_node);
- ADD_LABEL(ensure_part, lend);
- ADD_SEQ(ensure, ensure_part);
- }
- else {
- if (!is_return) {
- break;
- }
- }
- enlp = enlp->prev;
- }
- iseq->compile_data->ensure_node_stack = prev_enlp;
- ADD_SEQ(ret, ensure);
-}
-
-static VALUE
-setup_args(rb_iseq_t *iseq, LINK_ANCHOR *args, NODE *argn, unsigned long *flag)
-{
- VALUE argc = INT2FIX(0);
- int nsplat = 0;
- DECL_ANCHOR(arg_block);
- DECL_ANCHOR(args_splat);
-
- 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_BIT;
- argn = argn->nd_head;
- }
-
- setup_argn:
- if (argn) {
- switch (nd_type(argn)) {
- case NODE_SPLAT: {
- COMPILE(args, "args (splat)", argn->nd_head);
- argc = INT2FIX(1);
- nsplat++;
- *flag |= VM_CALL_ARGS_SPLAT_BIT;
- 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 (next_is_array && nsplat == 0) {
- /* none */
- }
- else {
- if (nd_type(argn) == NODE_ARGSCAT) {
- ADD_INSN1(tmp, nd_line(argn), splatarray, Qfalse);
- }
- else {
- ADD_INSN1(tmp, nd_line(argn), newarray, INT2FIX(1));
- }
- }
- INSERT_LIST(args_splat, tmp);
- nsplat++;
- *flag |= VM_CALL_ARGS_SPLAT_BIT;
-
- if (next_is_array) {
- argc = INT2FIX(compile_array(iseq, args, argn->nd_head, Qfalse) + 1);
- POP_ELEMENT(args);
- }
- else {
- argn = argn->nd_head;
- goto setup_argn;
- }
- break;
- }
- case NODE_ARRAY: {
- argc = INT2FIX(compile_array(iseq, args, argn, Qfalse));
- POP_ELEMENT(args);
- break;
- }
- default: {
- rb_bug("setup_arg: unknown node: %s\n", ruby_node_name(nd_type(argn)));
- }
- }
- }
-
- if (nsplat > 1) {
- int i;
- for (i=1; i<nsplat; i++) {
- ADD_INSN(args_splat, nd_line(args), concatarray);
- }
- }
-
- if (!LIST_SIZE_ZERO(args_splat)) {
- ADD_SEQ(args, args_splat);
- }
-
- if (*flag & VM_CALL_ARGS_BLOCKARG_BIT) {
- ADD_SEQ(args, arg_block);
- }
- return argc;
-}
-
-
-/**
- compile each node
-
- self: InstructionSequence
- node: Ruby compiled node
- poped: This node will be poped
- */
-static int
-iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
-{
- enum node_type type;
-
- if (node == 0) {
- if (!poped) {
- debugs("node: NODE_NIL(implicit)\n");
- ADD_INSN(ret, iseq->compile_data->last_line, putnil);
- }
- return COMPILE_OK;
- }
-
- iseq->compile_data->last_line = (int)nd_line(node);
- debug_node_start(node);
-
- type = nd_type(node);
-
- if (node->flags & NODE_FL_NEWLINE) {
- ADD_TRACE(ret, nd_line(node), RUBY_EVENT_LINE);
- }
-
- 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(nd_line(node));
- else_label = NEW_LABEL(nd_line(node));
- end_label = NEW_LABEL(nd_line(node));
-
- 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);
-
- ADD_LABEL(ret, then_label);
- ADD_SEQ(ret, then_seq);
- ADD_INSNL(ret, nd_line(node), jump, end_label);
-
- ADD_LABEL(ret, else_label);
- ADD_SEQ(ret, else_seq);
-
- ADD_LABEL(ret, end_label);
-
- break;
- }
- case NODE_CASE:{
- NODE *vals;
- NODE *tempnode = node;
- LABEL *endlabel, *elselabel;
- DECL_ANCHOR(head);
- DECL_ANCHOR(body_seq);
- DECL_ANCHOR(cond_seq);
- VALUE special_literals = rb_ary_tmp_new(1);
-
- INIT_ANCHOR(head);
- INIT_ANCHOR(body_seq);
- INIT_ANCHOR(cond_seq);
- if (node->nd_head == 0) {
- COMPILE_(ret, "when", node->nd_body, poped);
- break;
- }
- COMPILE(head, "case base", node->nd_head);
-
- node = node->nd_body;
- type = nd_type(node);
-
- if (type != NODE_WHEN) {
- COMPILE_ERROR((ERROR_ARGS "NODE_CASE: unexpected node. must be NODE_WHEN, but %s", ruby_node_name(type)));
- }
-
- endlabel = NEW_LABEL(nd_line(node));
- elselabel = NEW_LABEL(nd_line(node));
-
- ADD_SEQ(ret, head); /* case VAL */
-
- while (type == NODE_WHEN) {
- LABEL *l1;
-
- l1 = NEW_LABEL(nd_line(node));
- ADD_LABEL(body_seq, l1);
- ADD_INSN(body_seq, nd_line(node), pop);
- COMPILE_(body_seq, "when body", node->nd_body, poped);
- ADD_INSNL(body_seq, nd_line(node), jump, endlabel);
-
- vals = node->nd_head;
- if (vals) {
- switch (nd_type(vals)) {
- case NODE_ARRAY:
- special_literals = when_vals(iseq, cond_seq, vals, l1, special_literals);
- break;
- case NODE_SPLAT:
- case NODE_ARGSCAT:
- case NODE_ARGSPUSH:
- special_literals = 0;
- COMPILE(cond_seq, "when/cond splat", vals);
- ADD_INSN1(cond_seq, nd_line(vals), checkincludearray, Qtrue);
- 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;
- }
- type = nd_type(node);
- }
- /* else */
- if (node) {
- ADD_LABEL(cond_seq, elselabel);
- ADD_INSN(cond_seq, nd_line(node), pop);
- COMPILE_(cond_seq, "else", node, poped);
- ADD_INSNL(cond_seq, nd_line(node), jump, endlabel);
- }
- else {
- debugs("== else (implicit)\n");
- ADD_LABEL(cond_seq, elselabel);
- ADD_INSN(cond_seq, nd_line(tempnode), pop);
- if (!poped) {
- ADD_INSN(cond_seq, nd_line(tempnode), putnil);
- }
- ADD_INSNL(cond_seq, nd_line(tempnode), jump, endlabel);
- }
-
- if (special_literals) {
- ADD_INSN(ret, nd_line(tempnode), dup);
- ADD_INSN2(ret, nd_line(tempnode), opt_case_dispatch,
- special_literals, elselabel);
- iseq_add_mark_object_compile_time(iseq, special_literals);
- }
-
- ADD_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(nd_line(node));
-
- while (node && nd_type(node) == NODE_WHEN) {
- LABEL *l1 = NEW_LABEL(nd_line(node));
- ADD_LABEL(body_seq, l1);
- COMPILE_(body_seq, "when", node->nd_body, poped);
- ADD_INSNL(body_seq, nd_line(node), jump, endlabel);
-
- vals = node->nd_head;
- if (vals && nd_type(vals) == NODE_ARRAY) {
- while (vals) {
- val = vals->nd_head;
- COMPILE(ret, "when2", val);
- ADD_INSNL(ret, nd_line(val), branchif, l1);
- vals = vals->nd_next;
- }
- }
- else if (nd_type(vals) == NODE_SPLAT ||
- nd_type(vals) == NODE_ARGSCAT ||
- nd_type(vals) == NODE_ARGSPUSH) {
-
- NODE *val = vals->nd_head;
-
- if (nd_type(vals) == NODE_ARGSCAT || nd_type(vals) == NODE_ARGSPUSH) {
- NODE *vs = vals->nd_head;
- val = vals->nd_body;
-
- while (vs) {
- NODE* val = vs->nd_head;
- COMPILE(ret, "when/argscat", val);
- ADD_INSNL(ret, nd_line(val), branchif, l1);
- vs = vs->nd_next;
- }
- }
-
- ADD_INSN(ret, nd_line(val), putnil);
- COMPILE(ret, "when2/splat", val);
- ADD_INSN1(ret, nd_line(val), checkincludearray, Qfalse);
- ADD_INSN(ret, nd_line(val), pop);
- ADD_INSNL(ret, nd_line(val), branchif, l1);
- }
- else {
- rb_bug("err");
- }
- node = node->nd_next;
- }
- /* else */
- COMPILE_(ret, "else", node, poped);
- ADD_INSNL(ret, nd_line(orig_node), jump, endlabel);
-
- ADD_SEQ(ret, body_seq);
- ADD_LABEL(ret, endlabel);
-
- break;
- }
- case NODE_OPT_N:
- case NODE_WHILE:
- case NODE_UNTIL:{
- LABEL *prev_start_label = iseq->compile_data->start_label;
- LABEL *prev_end_label = iseq->compile_data->end_label;
- LABEL *prev_redo_label = iseq->compile_data->redo_label;
- VALUE prev_loopval_popped = iseq->compile_data->loopval_popped;
-
- struct iseq_compile_data_ensure_node_stack enl;
-
- LABEL *next_label = iseq->compile_data->start_label = NEW_LABEL(nd_line(node)); /* next */
- LABEL *redo_label = iseq->compile_data->redo_label = NEW_LABEL(nd_line(node)); /* redo */
- LABEL *break_label = iseq->compile_data->end_label = NEW_LABEL(nd_line(node)); /* break */
- LABEL *end_label = NEW_LABEL(nd_line(node));
-
- LABEL *next_catch_label = NEW_LABEL(nd_line(node));
- LABEL *tmp_label = NULL;
-
- iseq->compile_data->loopval_popped = 0;
- push_ensure_entry(iseq, &enl, 0, 0);
-
- if (type == NODE_OPT_N || node->nd_state == 1) {
- ADD_INSNL(ret, nd_line(node), jump, next_label);
- }
- else {
- tmp_label = NEW_LABEL(nd_line(node));
- ADD_INSNL(ret, nd_line(node), jump, tmp_label);
- }
- ADD_INSN(ret, nd_line(node), putnil);
- ADD_LABEL(ret, next_catch_label);
- ADD_INSN(ret, nd_line(node), pop);
- ADD_INSNL(ret, nd_line(node), jump, next_label);
- if (tmp_label) ADD_LABEL(ret, tmp_label);
-
- ADD_LABEL(ret, redo_label);
- COMPILE_POPED(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 if (type == NODE_UNTIL) {
- /* untile */
- compile_branch_condition(iseq, ret, node->nd_cond,
- end_label, redo_label);
- }
- else {
- ADD_CALL_RECEIVER(ret, nd_line(node));
- ADD_CALL(ret, nd_line(node), ID2SYM(idGets), INT2FIX(0));
- ADD_INSNL(ret, nd_line(node), branchif, redo_label);
- /* opt_n */
- }
-
- ADD_LABEL(ret, end_label);
-
- if (node->nd_state == Qundef) {
- /* ADD_INSN(ret, nd_line(node), putundef); */
- rb_bug("unsupported: putundef");
- }
- else {
- ADD_INSN(ret, nd_line(node), putnil);
- }
-
- ADD_LABEL(ret, break_label); /* break */
-
- if (poped) {
- ADD_INSN(ret, nd_line(node), pop);
- }
-
- ADD_CATCH_ENTRY(CATCH_TYPE_BREAK, redo_label, break_label,
- 0, break_label);
- ADD_CATCH_ENTRY(CATCH_TYPE_NEXT, redo_label, break_label, 0,
- next_catch_label);
- ADD_CATCH_ENTRY(CATCH_TYPE_REDO, redo_label, break_label, 0,
- iseq->compile_data->redo_label);
-
- iseq->compile_data->start_label = prev_start_label;
- iseq->compile_data->end_label = prev_end_label;
- iseq->compile_data->redo_label = prev_redo_label;
- iseq->compile_data->loopval_popped = prev_loopval_popped;
- iseq->compile_data->ensure_node_stack = iseq->compile_data->ensure_node_stack->prev;
- break;
- }
- case NODE_ITER:
- case NODE_FOR:{
- VALUE prevblock = iseq->compile_data->current_block;
- LABEL *retry_label = NEW_LABEL(nd_line(node));
- LABEL *retry_end_l = NEW_LABEL(nd_line(node));
- ID mid = 0;
-
- ADD_LABEL(ret, retry_label);
- if (nd_type(node) == NODE_FOR) {
- COMPILE(ret, "iter caller (for)", node->nd_iter);
-
- iseq->compile_data->current_block =
- NEW_CHILD_ISEQVAL(node->nd_body, make_name_for_block(iseq),
- ISEQ_TYPE_BLOCK);
-
- mid = idEach;
- ADD_SEND_R(ret, nd_line(node), ID2SYM(idEach), INT2FIX(0),
- iseq->compile_data->current_block, INT2FIX(0));
- }
- else {
- iseq->compile_data->current_block =
- NEW_CHILD_ISEQVAL(node->nd_body, make_name_for_block(iseq),
- ISEQ_TYPE_BLOCK);
- COMPILE(ret, "iter caller", node->nd_iter);
- }
- ADD_LABEL(ret, retry_end_l);
-
- if (poped) {
- ADD_INSN(ret, nd_line(node), pop);
- }
-
- iseq->compile_data->current_block = prevblock;
-
- ADD_CATCH_ENTRY(CATCH_TYPE_BREAK, retry_label, retry_end_l, 0, retry_end_l);
-
- break;
- }
- case NODE_BREAK:{
- unsigned long level = 0;
-
- if (iseq->compile_data->redo_label != 0) {
- /* while/until */
- LABEL *splabel = NEW_LABEL(0);
- ADD_LABEL(ret, splabel);
- ADD_ADJUST(ret, nd_line(node), 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, nd_line(node), jump, iseq->compile_data->end_label);
- ADD_ADJUST_RESTORE(ret, splabel);
-
- if (!poped) {
- ADD_INSN(ret, nd_line(node), putnil);
- }
- }
- else if (iseq->type == ISEQ_TYPE_BLOCK) {
- break_by_insn:
- /* escape from block */
- COMPILE(ret, "break val (block)", node->nd_stts);
- ADD_INSN1(ret, nd_line(node), throw, INT2FIX(level | 0x02) /* TAG_BREAK */ );
- if (poped) {
- ADD_INSN(ret, nd_line(node), pop);
- }
- }
- 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;
- }
-
- level++;
- if (ip->compile_data->redo_label != 0) {
- level = 0x8000;
- if (ip->compile_data->loopval_popped == 0) {
- /* need value */
- level |= 0x4000;
- }
- goto break_by_insn;
- }
- else if (ip->type == ISEQ_TYPE_BLOCK) {
- level <<= 16;
- goto break_by_insn;
- }
- else if (ip->type == ISEQ_TYPE_EVAL) {
- goto break_in_eval;
- }
-
- ip = ip->parent_iseq;
- }
- COMPILE_ERROR((ERROR_ARGS "Invalid break"));
- }
- break;
- }
- case NODE_NEXT:{
- unsigned long level = 0;
-
- 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, nd_line(node), iseq->compile_data->redo_label);
- ADD_INSNL(ret, nd_line(node), jump, iseq->compile_data->start_label);
- ADD_ADJUST_RESTORE(ret, splabel);
- }
- else if (iseq->compile_data->end_label) {
- LABEL *splabel = NEW_LABEL(0);
- debugs("next in block\n");
- ADD_LABEL(ret, splabel);
- ADD_ADJUST(ret, nd_line(node), iseq->compile_data->start_label);
- COMPILE(ret, "next val", node->nd_stts);
- add_ensure_iseq(ret, iseq, 0);
- ADD_INSNL(ret, nd_line(node), jump, iseq->compile_data->end_label);
- ADD_ADJUST_RESTORE(ret, splabel);
-
- if (!poped) {
- ADD_INSN(ret, nd_line(node), putnil);
- }
- }
- else if (iseq->type == ISEQ_TYPE_EVAL) {
- next_in_eval:
- COMPILE_ERROR((ERROR_ARGS "Can't escape from eval with next"));
- }
- else {
- rb_iseq_t *ip;
- ip = iseq;
- while (ip) {
- if (!ip->compile_data) {
- ip = 0;
- break;
- }
-
- level = 0x8000 | 0x4000;
- if (ip->compile_data->redo_label != 0) {
- /* while loop */
- break;
- }
- else if (ip->type == ISEQ_TYPE_BLOCK) {
- break;
- }
- else if (ip->type == ISEQ_TYPE_EVAL) {
- goto next_in_eval;
- }
-
- ip = ip->parent_iseq;
- }
- if (ip != 0) {
- COMPILE(ret, "next val", node->nd_stts);
- ADD_INSN1(ret, nd_line(node), throw, INT2FIX(level | 0x03) /* TAG_NEXT */ );
-
- if (poped) {
- ADD_INSN(ret, nd_line(node), pop);
- }
- }
- else {
- COMPILE_ERROR((ERROR_ARGS "Invalid next"));
- }
- }
- 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, nd_line(node), iseq->compile_data->redo_label);
- add_ensure_iseq(ret, iseq, 0);
- ADD_INSNL(ret, nd_line(node), jump, iseq->compile_data->redo_label);
- ADD_ADJUST_RESTORE(ret, splabel);
- }
- else if (iseq->type == ISEQ_TYPE_EVAL) {
- redo_in_eval:
- COMPILE_ERROR((ERROR_ARGS "Can't escape from eval with redo"));
- }
- else if (iseq->compile_data->start_label) {
- LABEL *splabel = NEW_LABEL(0);
-
- debugs("redo in block");
- ADD_LABEL(ret, splabel);
- add_ensure_iseq(ret, iseq, 0);
- ADD_ADJUST(ret, nd_line(node), iseq->compile_data->start_label);
- ADD_INSNL(ret, nd_line(node), jump, iseq->compile_data->start_label);
- ADD_ADJUST_RESTORE(ret, splabel);
-
- if (!poped) {
- ADD_INSN(ret, nd_line(node), putnil);
- }
- }
- else {
- rb_iseq_t *ip;
- unsigned long level;
- level = 0x8000 | 0x4000;
- ip = iseq;
- while (ip) {
- if (!ip->compile_data) {
- 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;
- }
-
- ip = ip->parent_iseq;
- }
- if (ip != 0) {
- ADD_INSN(ret, nd_line(node), putnil);
- ADD_INSN1(ret, nd_line(node), throw, INT2FIX(level | 0x05) /* TAG_REDO */ );
-
- if (poped) {
- ADD_INSN(ret, nd_line(node), pop);
- }
- }
- else {
- COMPILE_ERROR((ERROR_ARGS "Invalid redo"));
- }
- }
- break;
- }
- case NODE_RETRY:{
- if (iseq->type == ISEQ_TYPE_RESCUE) {
- ADD_INSN(ret, nd_line(node), putnil);
- ADD_INSN1(ret, nd_line(node), throw, INT2FIX(0x04) /* TAG_RETRY */ );
-
- if (poped) {
- ADD_INSN(ret, nd_line(node), pop);
- }
- }
- else {
- COMPILE_ERROR((ERROR_ARGS "Invalid retry"));
- }
- break;
- }
- case NODE_BEGIN:{
- COMPILE_(ret, "NODE_BEGIN", node->nd_body, poped);
- break;
- }
- case NODE_RESCUE:{
- LABEL *lstart = NEW_LABEL(nd_line(node));
- LABEL *lend = NEW_LABEL(nd_line(node));
- LABEL *lcont = NEW_LABEL(nd_line(node));
- VALUE rescue = NEW_CHILD_ISEQVAL(
- node->nd_resq,
- rb_str_concat(rb_str_new2("rescue in "), iseq->name),
- ISEQ_TYPE_RESCUE);
-
- ADD_LABEL(ret, lstart);
- COMPILE(ret, "rescue head", node->nd_head);
- ADD_LABEL(ret, lend);
- if (node->nd_else) {
- ADD_INSN(ret, nd_line(node), pop);
- COMPILE(ret, "rescue else", node->nd_else);
- }
- ADD_INSN(ret, nd_line(node), nop);
- ADD_LABEL(ret, lcont);
-
- if (poped) {
- ADD_INSN(ret, nd_line(node), pop);
- }
-
- /* resgister 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(nd_line(node));
- label_hit = NEW_LABEL(nd_line(node));
-
- narg = resq->nd_args;
- if (narg) {
- switch (nd_type(narg)) {
- case NODE_ARRAY:
- while (narg) {
- COMPILE(ret, "rescue arg", narg->nd_head);
- ADD_INSN2(ret, nd_line(node), getdynamic, INT2FIX(2), INT2FIX(0));
- ADD_SEND(ret, nd_line(node), ID2SYM(idEqq), INT2FIX(1));
- ADD_INSNL(ret, nd_line(node), branchif, label_hit);
- narg = narg->nd_next;
- }
- break;
- case NODE_SPLAT:
- case NODE_ARGSCAT:
- case NODE_ARGSPUSH:
- ADD_INSN2(ret, nd_line(node), getdynamic, INT2FIX(2), INT2FIX(0));
- COMPILE(ret, "rescue/cond splat", narg);
- ADD_INSN1(ret, nd_line(node), checkincludearray, Qtrue);
- ADD_INSN(ret, nd_line(node), swap);
- ADD_INSN(ret, nd_line(node), pop);
- ADD_INSNL(ret, nd_line(node), branchif, label_hit);
- break;
- default:
- rb_bug("NODE_RESBODY: unknown node (%s)",
- ruby_node_name(nd_type(narg)));
- }
- }
- else {
- ADD_INSN1(ret, nd_line(node), putobject,
- rb_eStandardError);
- ADD_INSN2(ret, nd_line(node), getdynamic, INT2FIX(2), INT2FIX(0));
- ADD_SEND(ret, nd_line(node), ID2SYM(idEqq), INT2FIX(1));
- ADD_INSNL(ret, nd_line(node), branchif, label_hit);
- }
- ADD_INSNL(ret, nd_line(node), 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, nd_line(node), nop);
- }
- ADD_INSN(ret, nd_line(node), 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->name),
- ISEQ_TYPE_ENSURE);
- LABEL *lstart = NEW_LABEL(nd_line(node));
- LABEL *lend = NEW_LABEL(nd_line(node));
- LABEL *lcont = NEW_LABEL(nd_line(node));
- struct ensure_range er;
- struct iseq_compile_data_ensure_node_stack enl;
- struct ensure_range *erange;
-
- INIT_ANCHOR(ensr);
- COMPILE_POPED(ensr, "ensure ensr", node->nd_ensr);
-
- er.begin = lstart;
- er.end = lend;
- er.next = 0;
- push_ensure_entry(iseq, &enl, &er, node->nd_ensr);
-
- ADD_LABEL(ret, lstart);
- COMPILE_(ret, "ensure head", node->nd_head, poped);
- ADD_LABEL(ret, lend);
- if (ensr->anchor.next == 0) {
- ADD_INSN(ret, nd_line(node), nop);
- }
- else {
- ADD_SEQ(ret, ensr);
- }
- ADD_LABEL(ret, lcont);
-
- 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;
- }
-
- iseq->compile_data->ensure_node_stack = enl.prev;
- break;
- }
-
- case NODE_AND:
- case NODE_OR:{
- LABEL *end_label = NEW_LABEL(nd_line(node));
- COMPILE(ret, "nd_1st", node->nd_1st);
- if (!poped) {
- ADD_INSN(ret, nd_line(node), dup);
- }
- if (type == NODE_AND) {
- ADD_INSNL(ret, nd_line(node), branchunless, end_label);
- }
- else {
- ADD_INSNL(ret, nd_line(node), branchif, end_label);
- }
- if (!poped) {
- ADD_INSN(ret, nd_line(node), pop);
- }
- COMPILE_(ret, "nd_2nd", node->nd_2nd, poped);
- ADD_LABEL(ret, end_label);
- break;
- }
-
- case NODE_MASGN:{
- compile_massign(iseq, ret, node, poped);
- break;
- }
-
- case NODE_LASGN:{
- ID id = node->nd_vid;
- int idx = iseq->local_iseq->local_size - get_local_var_idx(iseq, id);
-
- debugs("lvar: %s idx: %d\n", rb_id2name(id), idx);
- COMPILE(ret, "rvalue", node->nd_value);
-
- if (!poped) {
- ADD_INSN(ret, nd_line(node), dup);
- }
- ADD_INSN1(ret, nd_line(node), setlocal, INT2FIX(idx));
-
- break;
- }
- case NODE_DASGN:
- case NODE_DASGN_CURR:{
- int idx, lv, ls;
- COMPILE(ret, "dvalue", node->nd_value);
- debugp_param("dassn id", rb_str_new2(rb_id2name(node->nd_vid) ? rb_id2name(node->nd_vid) : "*"));
-
- if (!poped) {
- ADD_INSN(ret, nd_line(node), dup);
- }
-
- idx = get_dyna_var_idx(iseq, node->nd_vid, &lv, &ls);
-
- if (idx < 0) {
- rb_bug("NODE_DASGN(_CURR): unknown id (%s)", rb_id2name(node->nd_vid));
- }
-
- ADD_INSN2(ret, nd_line(node), setdynamic,
- INT2FIX(ls - idx), INT2FIX(lv));
- break;
- }
- case NODE_GASGN:{
- COMPILE(ret, "lvalue", node->nd_value);
-
- if (!poped) {
- ADD_INSN(ret, nd_line(node), dup);
- }
- ADD_INSN1(ret, nd_line(node), setglobal,
- (((long)node->nd_entry) | 1));
- break;
- }
- case NODE_IASGN:
- case NODE_IASGN2:{
- COMPILE(ret, "lvalue", node->nd_value);
- if (!poped) {
- ADD_INSN(ret, nd_line(node), dup);
- }
- ADD_INSN1(ret, nd_line(node), setinstancevariable,
- ID2SYM(node->nd_vid));
- break;
- }
- case NODE_CDECL:{
- COMPILE(ret, "lvalue", node->nd_value);
-
- if (!poped) {
- ADD_INSN(ret, nd_line(node), dup);
- }
-
- if (node->nd_vid) {
- ADD_INSN1(ret, nd_line(node), putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_CBASE));
- ADD_INSN1(ret, nd_line(node), setconstant, ID2SYM(node->nd_vid));
- }
- else {
- compile_cpath(ret, iseq, node->nd_else);
- ADD_INSN1(ret, nd_line(node), setconstant, ID2SYM(node->nd_else->nd_mid));
- }
- break;
- }
- case NODE_CVASGN:{
- COMPILE(ret, "cvasgn val", node->nd_value);
- if (!poped) {
- ADD_INSN(ret, nd_line(node), dup);
- }
- ADD_INSN1(ret, nd_line(node), setclassvariable,
- ID2SYM(node->nd_vid));
- break;
- }
- case NODE_OP_ASGN1: {
- DECL_ANCHOR(args);
- VALUE argc;
- unsigned long flag = 0;
- ID id = node->nd_mid;
-
- /*
- * a[x] (op)= y
- *
- * eval a # a
- * eval x # a x
- * dupn 2 # a x a x
- * send :[] # a x a[x]
- * eval y # a x a[x] y
- * send op # a x a[x]+y
- * send []= # ret
- */
-
- /*
- * nd_recv[nd_args->nd_body] (nd_mid)= nd_args->nd_head;
- * NODE_OP_ASGN nd_recv
- * nd_args->nd_head
- * nd_args->nd_body
- * nd_mid
- */
-
- COMPILE(ret, "NODE_OP_ASGN1 recv", node->nd_recv);
- if (nd_type(node->nd_args->nd_body) != NODE_ZARRAY) {
- INIT_ANCHOR(args);
- argc = setup_args(iseq, args, node->nd_args->nd_body, &flag);
- ADD_SEQ(ret, args);
- }
- else {
- argc = INT2FIX(0);
- }
- ADD_INSN1(ret, nd_line(node), dupn, INT2FIX(FIX2INT(argc)+1));
- ADD_SEND_R(ret, nd_line(node), ID2SYM(idAREF), argc, Qfalse, LONG2FIX(flag));
-
- if (id == 0 || id == 1) {
- /* 0: or, 1: and
- a[x] ||= y
-
- unless/if a[x]
- a[x]= y
- else
- nil
- end
- */
- LABEL *label = NEW_LABEL(nd_line(node));
- LABEL *lfin = NEW_LABEL(nd_line(node));
-
- if (id == 0) {
- /* or */
- ADD_INSN(ret, nd_line(node), dup);
- ADD_INSNL(ret, nd_line(node), branchif, label);
- ADD_INSN(ret, nd_line(node), pop);
- }
- else {
- /* and */
- ADD_INSN(ret, nd_line(node), dup);
- ADD_INSNL(ret, nd_line(node), branchunless, label);
- ADD_INSN(ret, nd_line(node), pop);
- }
-
- COMPILE(ret, "NODE_OP_ASGN1 args->head: ", node->nd_args->nd_head);
- if (flag & VM_CALL_ARGS_SPLAT_BIT) {
- ADD_INSN1(ret, nd_line(node), newarray, INT2FIX(1));
- ADD_INSN(ret, nd_line(node), concatarray);
- ADD_SEND_R(ret, nd_line(node), ID2SYM(idASET),
- argc, Qfalse, LONG2FIX(flag));
- }
- else {
- ADD_SEND_R(ret, nd_line(node), ID2SYM(idASET),
- INT2FIX(FIX2INT(argc) + 1), Qfalse, LONG2FIX(flag));
- }
- ADD_INSNL(ret, nd_line(node), jump, lfin);
- ADD_LABEL(ret, label);
- if (id == 0 || id == 1) { /* 0: or, 1: and */
- ADD_INSN(ret, nd_line(node), swap);
- ADD_INSN(ret, nd_line(node), pop);
- ADD_INSN(ret, nd_line(node), swap);
- ADD_INSN(ret, nd_line(node), pop);
- }
- ADD_LABEL(ret, lfin);
- }
- else {
- COMPILE(ret, "NODE_OP_ASGN1 args->head: ", node->nd_args->nd_head);
- ADD_SEND(ret, nd_line(node), ID2SYM(id), INT2FIX(1));
- if (flag & VM_CALL_ARGS_SPLAT_BIT) {
- ADD_INSN1(ret, nd_line(node), newarray, INT2FIX(1));
- ADD_INSN(ret, nd_line(node), concatarray);
- ADD_SEND_R(ret, nd_line(node), ID2SYM(idASET),
- argc, Qfalse, LONG2FIX(flag));
- }
- else {
- ADD_SEND_R(ret, nd_line(node), ID2SYM(idASET),
- INT2FIX(FIX2INT(argc) + 1), Qfalse, LONG2FIX(flag));
- }
- }
-
- if (poped) {
- ADD_INSN(ret, nd_line(node), pop);
- }
-
- break;
- }
- case NODE_OP_ASGN2:{
- ID atype = node->nd_next->nd_mid;
- LABEL *lfin = NEW_LABEL(nd_line(node));
- LABEL *lcfin = NEW_LABEL(nd_line(node));
- /*
- class C; attr_accessor :c; end
- r = C.new
- r.a &&= v # asgn2
-
- eval r # r
- dup # r r
- eval r.a # r o
-
- # or
- dup # r o o
- if lcfin # r o
- pop # r
- eval v # r v
- send a= # v
- jump lfin # v
-
- lcfin: # r o
- swap # o r
- pop # o
-
- lfin: # v
-
- # and
- dup # r o o
- unless lcfin
- pop # r
- eval v # r v
- send a= # v
- jump lfin # v
-
- # others
- eval v # r o v
- send ?? # r w
- send a= # w
-
- */
-
- COMPILE(ret, "NODE_OP_ASGN2#recv", node->nd_recv);
- ADD_INSN(ret, nd_line(node), dup);
- ADD_SEND(ret, nd_line(node), ID2SYM(node->nd_next->nd_vid),
- INT2FIX(0));
-
- if (atype == 0 || atype == 1) { /* 0: OR or 1: AND */
- ADD_INSN(ret, nd_line(node), dup);
- if (atype == 0) {
- ADD_INSNL(ret, nd_line(node), branchif, lcfin);
- }
- else {
- ADD_INSNL(ret, nd_line(node), branchunless, lcfin);
- }
- ADD_INSN(ret, nd_line(node), pop);
- COMPILE(ret, "NODE_OP_ASGN2 val", node->nd_value);
- ADD_SEND(ret, nd_line(node), ID2SYM(node->nd_next->nd_aid),
- INT2FIX(1));
- ADD_INSNL(ret, nd_line(node), jump, lfin);
-
- ADD_LABEL(ret, lcfin);
- ADD_INSN(ret, nd_line(node), swap);
- ADD_INSN(ret, nd_line(node), pop);
-
- ADD_LABEL(ret, lfin);
- }
- else {
- COMPILE(ret, "NODE_OP_ASGN2 val", node->nd_value);
- ADD_SEND(ret, nd_line(node), ID2SYM(node->nd_next->nd_mid),
- INT2FIX(1));
- ADD_SEND(ret, nd_line(node), ID2SYM(node->nd_next->nd_aid),
- INT2FIX(1));
- }
-
- if (poped) {
- /* we can apply more optimize */
- ADD_INSN(ret, nd_line(node), pop);
- }
- break;
- }
- case NODE_OP_ASGN_AND:
- case NODE_OP_ASGN_OR:{
- LABEL *lfin = NEW_LABEL(nd_line(node));
- LABEL *lassign;
-
- if (nd_type(node) == NODE_OP_ASGN_OR) {
- LABEL *lfinish[2];
- lfinish[0] = lfin;
- lfinish[1] = 0;
- defined_expr(iseq, ret, node->nd_head, lfinish, Qfalse);
- lassign = lfinish[1];
- if (!lassign) {
- lassign = NEW_LABEL(nd_line(node));
- }
- ADD_INSNL(ret, nd_line(node), branchunless, lassign);
- }
- else {
- lassign = NEW_LABEL(nd_line(node));
- }
-
- COMPILE(ret, "NODE_OP_ASGN_AND/OR#nd_head", node->nd_head);
- ADD_INSN(ret, nd_line(node), dup);
-
- if (nd_type(node) == NODE_OP_ASGN_AND) {
- ADD_INSNL(ret, nd_line(node), branchunless, lfin);
- }
- else {
- ADD_INSNL(ret, nd_line(node), branchif, lfin);
- }
-
- ADD_INSN(ret, nd_line(node), pop);
- ADD_LABEL(ret, lassign);
- COMPILE(ret, "NODE_OP_ASGN_AND/OR#nd_value", node->nd_value);
- ADD_LABEL(ret, lfin);
-
- if (poped) {
- /* we can apply more optimize */
- ADD_INSN(ret, nd_line(node), pop);
- }
- break;
- }
- case NODE_CALL:
- 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 long flag = 0;
- 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) {
- if (mid == idBitblt) {
- ADD_INSN(ret, nd_line(node), bitblt);
- break;
- }
- else if (mid == idAnswer) {
- ADD_INSN(ret, nd_line(node), answer);
- break;
- }
- }
- /* only joke */
- {
- ID goto_id;
- ID label_id;
- VALUE label;
- VALUE label_sym;
-
- CONST_ID(goto_id, "__goto__");
- CONST_ID(label_id, "__label__");
-
- if (nd_type(node) == NODE_FCALL &&
- (mid == goto_id || mid == label_id)) {
- if (nd_type(node->nd_args->nd_head) == NODE_LIT &&
- SYMBOL_P(node->nd_args->nd_head->nd_lit)) {
-
- label_sym = label = node->nd_args->nd_head->nd_lit;
- if ((label =
- rb_hash_aref(iseq->compile_data,
- label_sym)) == Qnil) {
- rb_hash_aset(iseq->compile_data, label_sym,
- label = NEW_LABEL(nd_line(node)));
- }
- }
- else {
- rb_bug("invalid goto/label format");
- }
-
-
- if (mid == goto_id) {
- ADD_INSNL(ret, nd_line(node), jump, label);
- }
- else {
- ADD_LABEL(ret, label);
- }
- break;
- }
- }
-#endif
- /* reciever */
- if (type == NODE_CALL) {
- COMPILE(recv, "recv", node->nd_recv);
- }
- else if (type == NODE_FCALL || type == NODE_VCALL) {
- ADD_CALL_RECEIVER(recv, nd_line(node));
- }
-
- /* args */
- if (nd_type(node) != NODE_VCALL) {
- argc = setup_args(iseq, args, node->nd_args, &flag);
- }
- 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_BIT;
- /* VCALL is funcall, so fall through */
- case NODE_FCALL:
- flag |= VM_CALL_FCALL_BIT;
- }
-
- ADD_SEND_R(ret, nd_line(node), ID2SYM(mid),
- argc, parent_block, LONG2FIX(flag));
-
- if (poped) {
- ADD_INSN(ret, nd_line(node), pop);
- }
- break;
- }
- case NODE_SUPER:
- case NODE_ZSUPER:{
- DECL_ANCHOR(args);
- VALUE argc;
- unsigned long flag = 0;
- VALUE parent_block = iseq->compile_data->current_block;
-
- INIT_ANCHOR(args);
- iseq->compile_data->current_block = Qfalse;
- if (nd_type(node) == NODE_SUPER) {
- argc = setup_args(iseq, args, node->nd_args, &flag);
- }
- else {
- /* NODE_ZSUPER */
- int i;
- rb_iseq_t *liseq = iseq->local_iseq;
-
- argc = INT2FIX(liseq->argc);
-
- /* normal arguments */
- for (i = 0; i < liseq->argc; i++) {
- int idx = liseq->local_size - i;
- ADD_INSN1(args, nd_line(node), getlocal, INT2FIX(idx));
- }
-
- if (!liseq->arg_simple) {
- if (liseq->arg_opts) {
- /* optional arguments */
- int j;
- for (j = 0; j < liseq->arg_opts - 1; j++) {
- int idx = liseq->local_size - (i + j);
- ADD_INSN1(args, nd_line(node), getlocal, INT2FIX(idx));
- }
- i += j;
- argc = INT2FIX(i);
- }
-
- if (liseq->arg_rest != -1) {
- /* rest argument */
- int idx = liseq->local_size - liseq->arg_rest;
- ADD_INSN1(args, nd_line(node), getlocal, INT2FIX(idx));
- argc = INT2FIX(liseq->arg_rest + 1);
- flag |= VM_CALL_ARGS_SPLAT_BIT;
- }
-
- if (liseq->arg_post_len) {
- /* post arguments */
- int post_len = liseq->arg_post_len;
- int post_start = liseq->arg_post_start;
-
- if (liseq->arg_rest != -1) {
- int j;
- for (j=0; j<post_len; j++) {
- int idx = liseq->local_size - (post_start + j);
- ADD_INSN1(args, nd_line(node), getlocal, INT2FIX(idx));
- }
- ADD_INSN1(args, nd_line(node), newarray, INT2FIX(j));
- ADD_INSN (args, nd_line(node), concatarray);
- /* argc is setteled at above */
- }
- else {
- int j;
- for (j=0; j<post_len; j++) {
- int idx = liseq->local_size - (post_start + j);
- ADD_INSN1(args, nd_line(node), getlocal, INT2FIX(idx));
- }
- argc = INT2FIX(post_len + post_start);
- }
- }
- }
- }
-
- /* dummy reciever */
- ADD_INSN1(ret, nd_line(node), putobject,
- nd_type(node) == NODE_ZSUPER ? Qfalse : Qtrue);
- ADD_SEQ(ret, args);
- ADD_INSN3(ret, nd_line(node), invokesuper,
- argc, parent_block, LONG2FIX(flag));
-
- if (poped) {
- ADD_INSN(ret, nd_line(node), pop);
- }
- break;
- }
- case NODE_ARRAY:{
- compile_array_(iseq, ret, node, Qtrue, poped);
- break;
- }
- case NODE_ZARRAY:{
- if (!poped) {
- ADD_INSN1(ret, nd_line(node), newarray, INT2FIX(0));
- }
- break;
- }
- case NODE_VALUES:{
- NODE *n = node;
- while (n) {
- COMPILE(ret, "values item", n->nd_head);
- n = n->nd_next;
- }
- ADD_INSN1(ret, nd_line(node), newarray, INT2FIX(node->nd_alen));
- if (poped) {
- ADD_INSN(ret, nd_line(node), pop);
- }
- break;
- }
- case NODE_HASH:{
- DECL_ANCHOR(list);
- VALUE size = 0;
- int type = node->nd_head ? nd_type(node->nd_head) : NODE_ZARRAY;
-
- INIT_ANCHOR(list);
- switch (type) {
- case NODE_ARRAY:{
- compile_array(iseq, list, node->nd_head, Qfalse);
- size = OPERAND_AT(POP_ELEMENT(list), 0);
- ADD_SEQ(ret, list);
- break;
- }
- case NODE_ZARRAY:
- size = INT2FIX(0);
- break;
-
- default:
- rb_bug("can't make hash with this node: %s", ruby_node_name(type));
- }
-
- ADD_INSN1(ret, nd_line(node), newhash, size);
-
- if (poped) {
- ADD_INSN(ret, nd_line(node), pop);
- }
- break;
- }
- case NODE_RETURN:{
- rb_iseq_t *is = iseq;
-
- while (is) {
- if (is->type == ISEQ_TYPE_TOP || is->type == ISEQ_TYPE_CLASS) {
- COMPILE_ERROR((ERROR_ARGS "Invalid return"));
- break;
- }
- else {
- LABEL *splabel = 0;
-
- if (is->type == ISEQ_TYPE_METHOD) {
- splabel = NEW_LABEL(0);
- ADD_LABEL(ret, splabel);
- ADD_ADJUST(ret, nd_line(node), 0);
- }
-
- COMPILE(ret, "return nd_stts (return val)", node->nd_stts);
-
- if (is->type == ISEQ_TYPE_METHOD) {
- add_ensure_iseq(ret, iseq, 1);
- ADD_INSN(ret, nd_line(node), leave);
- ADD_ADJUST_RESTORE(ret, splabel);
-
- if (!poped) {
- ADD_INSN(ret, nd_line(node), putnil);
- }
- }
- else {
- ADD_INSN1(ret, nd_line(node), throw, INT2FIX(0x01) /* TAG_RETURN */ );
- if (poped) {
- ADD_INSN(ret, nd_line(node), pop);
- }
- }
- break;
- }
- }
- break;
- }
- case NODE_YIELD:{
- DECL_ANCHOR(args);
- VALUE argc;
- unsigned long flag = 0;
-
- INIT_ANCHOR(args);
- if (iseq->type == ISEQ_TYPE_TOP || iseq->type == ISEQ_TYPE_CLASS) {
- COMPILE_ERROR((ERROR_ARGS "Invalid yield"));
- }
-
- if (node->nd_head) {
- argc = setup_args(iseq, args, node->nd_head, &flag);
- }
- else {
- argc = INT2FIX(0);
- }
-
- ADD_SEQ(ret, args);
- ADD_INSN2(ret, nd_line(node), invokeblock, argc, LONG2FIX(flag));
-
- if (poped) {
- ADD_INSN(ret, nd_line(node), pop);
- }
- break;
- }
- case NODE_LVAR:{
- if (!poped) {
- ID id = node->nd_vid;
- int idx = iseq->local_iseq->local_size - get_local_var_idx(iseq, id);
-
- debugs("id: %s idx: %d\n", rb_id2name(id), idx);
- ADD_INSN1(ret, nd_line(node), getlocal, INT2FIX(idx));
- }
- break;
- }
- case NODE_DVAR:{
- int lv, idx, ls;
- debugi("nd_vid", node->nd_vid);
- if (!poped) {
- idx = get_dyna_var_idx(iseq, node->nd_vid, &lv, &ls);
- if (idx < 0) {
- rb_bug("unknown dvar (%s)", rb_id2name(node->nd_vid));
- }
- ADD_INSN2(ret, nd_line(node), getdynamic, INT2FIX(ls - idx), INT2FIX(lv));
- }
- break;
- }
- case NODE_GVAR:{
- ADD_INSN1(ret, nd_line(node), getglobal,
- (((long)node->nd_entry) | 1));
- if (poped) {
- ADD_INSN(ret, nd_line(node), pop);
- }
- break;
- }
- case NODE_IVAR:{
- debugi("nd_vid", node->nd_vid);
- if (!poped) {
- ADD_INSN1(ret, nd_line(node), getinstancevariable,
- ID2SYM(node->nd_vid));
- }
- break;
- }
- case NODE_CONST:{
- debugi("nd_vid", node->nd_vid);
-
- if (iseq->compile_data->option->inline_const_cache) {
- LABEL *lstart = NEW_LABEL(nd_line(node));
- LABEL *lend = NEW_LABEL(nd_line(node));
-
- ADD_LABEL(ret, lstart);
- ADD_INSN1(ret, nd_line(node), getinlinecache, lend);
- ADD_INSN1(ret, nd_line(node), getconstant, ID2SYM(node->nd_vid));
- ADD_INSN1(ret, nd_line(node), setinlinecache, lstart);
- ADD_LABEL(ret, lend);
- }
- else {
- ADD_INSN(ret, nd_line(node), putnil);
- ADD_INSN1(ret, nd_line(node), getconstant, ID2SYM(node->nd_vid));
- }
-
- if (poped) {
- ADD_INSN(ret, nd_line(node), pop);
- }
- break;
- }
- case NODE_CVAR:{
- if (!poped) {
- ADD_INSN1(ret, nd_line(node), getclassvariable,
- ID2SYM(node->nd_vid));
- }
- break;
- }
- case NODE_NTH_REF:{
- if (!poped) {
- ADD_INSN2(ret, nd_line(node), getspecial, INT2FIX(1) /* '~' */,
- INT2FIX(node->nd_nth << 1));
- }
- break;
- }
- case NODE_BACK_REF:{
- if (!poped) {
- ADD_INSN2(ret, nd_line(node), getspecial, INT2FIX(1) /* '~' */,
- INT2FIX(0x01 | (node->nd_nth << 1)));
- }
- break;
- }
- case NODE_MATCH:
- case NODE_MATCH2:
- case NODE_MATCH3:{
- DECL_ANCHOR(recv);
- DECL_ANCHOR(val);
-
- INIT_ANCHOR(recv);
- INIT_ANCHOR(val);
- switch(nd_type(node)) {
- case NODE_MATCH:
- ADD_INSN1(recv, nd_line(node), putobject, node->nd_lit);
- ADD_INSN2(val, nd_line(node), getspecial, INT2FIX(0),
- INT2FIX(0));
- break;
- case NODE_MATCH2:
- COMPILE(recv, "reciever", node->nd_recv);
- COMPILE(val, "value", node->nd_value);
- break;
- case NODE_MATCH3:
- COMPILE(recv, "reciever", node->nd_value);
- COMPILE(val, "value", node->nd_recv);
- break;
- }
-
- 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, nd_line(node), opt_regexpmatch1,
- OPERAND_AT(recv->last, 0));
- }
- else {
- ADD_SEQ(ret, recv);
- ADD_SEQ(ret, val);
- ADD_INSN(ret, nd_line(node), opt_regexpmatch2);
- }
- }
- else {
- ADD_SEQ(ret, recv);
- ADD_SEQ(ret, val);
- ADD_SEND(ret, nd_line(node), ID2SYM(idEqTilde), INT2FIX(1));
- }
-
- if (poped) {
- ADD_INSN(ret, nd_line(node), pop);
- }
- break;
- }
- case NODE_LIT:{
- debugp_param("lit", node->nd_lit);
- if (!poped) {
- ADD_INSN1(ret, nd_line(node), putobject, node->nd_lit);
- }
- break;
- }
- case NODE_STR:{
- debugp_param("nd_lit", node->nd_lit);
- if (!poped) {
- hide_obj(node->nd_lit);
- ADD_INSN1(ret, nd_line(node), putstring, node->nd_lit);
- }
- break;
- }
- case NODE_DSTR:{
- compile_dstr(iseq, ret, node);
-
- if (poped) {
- ADD_INSN(ret, nd_line(node), pop);
- }
- break;
- }
- case NODE_XSTR:{
- OBJ_FREEZE(node->nd_lit);
- ADD_CALL_RECEIVER(ret, nd_line(node));
- ADD_INSN1(ret, nd_line(node), putobject, node->nd_lit);
- ADD_CALL(ret, nd_line(node), ID2SYM(idBackquote), INT2FIX(1));
-
- if (poped) {
- ADD_INSN(ret, nd_line(node), pop);
- }
- break;
- }
- case NODE_DXSTR:{
- ADD_CALL_RECEIVER(ret, nd_line(node));
- compile_dstr(iseq, ret, node);
- ADD_CALL(ret, nd_line(node), ID2SYM(idBackquote), INT2FIX(1));
-
- if (poped) {
- ADD_INSN(ret, nd_line(node), pop);
- }
- break;
- }
- case NODE_EVSTR:{
- COMPILE(ret, "nd_body", node->nd_body);
-
- if (poped) {
- ADD_INSN(ret, nd_line(node), pop);
- }
- else {
- ADD_INSN(ret, nd_line(node), tostring);
- }
- break;
- }
- case NODE_DREGX:{
- compile_dregx(iseq, ret, node);
-
- if (poped) {
- ADD_INSN(ret, nd_line(node), pop);
- }
- break;
- }
- case NODE_DREGX_ONCE:{
- /* TODO: once? */
- LABEL *lstart = NEW_LABEL(nd_line(node));
- LABEL *lend = NEW_LABEL(nd_line(node));
-
- ADD_LABEL(ret, lstart);
- ADD_INSN1(ret, nd_line(node), onceinlinecache, lend);
- ADD_INSN(ret, nd_line(node), pop);
-
- compile_dregx(iseq, ret, node);
-
- ADD_INSN1(ret, nd_line(node), setinlinecache, lstart);
- ADD_LABEL(ret, lend);
-
- if (poped) {
- ADD_INSN(ret, nd_line(node), pop);
- }
- break;
- }
- case NODE_ARGSCAT:{
- COMPILE(ret, "argscat head", node->nd_head);
- COMPILE(ret, "argscat body", node->nd_body);
- ADD_INSN(ret, nd_line(node), concatarray);
- break;
- }
- case NODE_ARGSPUSH:{
- COMPILE(ret, "arsgpush head", node->nd_head);
- COMPILE(ret, "argspush body", node->nd_body);
- ADD_INSN1(ret, nd_line(node), newarray, INT2FIX(1));
- ADD_INSN(ret, nd_line(node), concatarray);
- break;
- }
- case NODE_SPLAT:{
- COMPILE(ret, "splat", node->nd_head);
- ADD_INSN1(ret, nd_line(node), splatarray, Qfalse);
-
- if (poped) {
- ADD_INSN(ret, nd_line(node), pop);
- }
- break;
- }
- case NODE_DEFN:{
- VALUE iseqval = NEW_ISEQVAL(node->nd_defn,
- rb_str_dup(rb_id2str(node->nd_mid)),
- ISEQ_TYPE_METHOD);
-
- debugp_param("defn/iseq", iseqval);
-
- ADD_INSN1(ret, nd_line(node), putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_VMCORE));
- ADD_INSN1(ret, nd_line(node), putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_CBASE));
- ADD_INSN1(ret, nd_line(node), putobject, ID2SYM(node->nd_mid));
- ADD_INSN1(ret, nd_line(node), putiseq, iseqval);
- ADD_SEND (ret, nd_line(node), ID2SYM(id_core_define_method), INT2FIX(3));
-
- if (poped) {
- ADD_INSN(ret, nd_line(node), pop);
- }
-
- debugp_param("defn", iseqval);
- break;
- }
- case NODE_DEFS:{
- VALUE iseqval = NEW_ISEQVAL(node->nd_defn,
- rb_str_dup(rb_id2str(node->nd_mid)),
- ISEQ_TYPE_METHOD);
-
- debugp_param("defs/iseq", iseqval);
-
- ADD_INSN1(ret, nd_line(node), putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_VMCORE));
- COMPILE(ret, "defs: recv", node->nd_recv);
- ADD_INSN1(ret, nd_line(node), putobject, ID2SYM(node->nd_mid));
- ADD_INSN1(ret, nd_line(node), putiseq, iseqval);
- ADD_SEND (ret, nd_line(node), ID2SYM(id_core_define_singleton_method), INT2FIX(3));
-
- if (poped) {
- ADD_INSN(ret, nd_line(node), pop);
- }
- break;
- }
- case NODE_ALIAS:{
- ADD_INSN1(ret, nd_line(node), putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_VMCORE));
- ADD_INSN1(ret, nd_line(node), putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_CBASE));
- COMPILE(ret, "alias arg1", node->u1.node);
- COMPILE(ret, "alias arg2", node->u2.node);
- ADD_SEND(ret, nd_line(node), ID2SYM(id_core_set_method_alias), INT2FIX(3));
-
- if (poped) {
- ADD_INSN(ret, nd_line(node), pop);
- }
- break;
- }
- case NODE_VALIAS:{
- ADD_INSN1(ret, nd_line(node), putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_VMCORE));
- ADD_INSN1(ret, nd_line(node), putobject, ID2SYM(node->u1.id));
- ADD_INSN1(ret, nd_line(node), putobject, ID2SYM(node->u2.id));
- ADD_SEND(ret, nd_line(node), ID2SYM(id_core_set_variable_alias), INT2FIX(2));
-
- if (poped) {
- ADD_INSN(ret, nd_line(node), pop);
- }
- break;
- }
- case NODE_UNDEF:{
- ADD_INSN1(ret, nd_line(node), putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_VMCORE));
- ADD_INSN1(ret, nd_line(node), putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_CBASE));
- COMPILE(ret, "undef arg", node->u2.node);
- ADD_SEND(ret, nd_line(node), ID2SYM(id_core_undef_method), INT2FIX(2));
-
- if (poped) {
- ADD_INSN(ret, nd_line(node), pop);
- }
- break;
- }
- case NODE_CLASS:{
- VALUE iseqval =
- NEW_CHILD_ISEQVAL(
- node->nd_body,
- rb_sprintf("<class:%s>", rb_id2name(node->nd_cpath->nd_mid)),
- ISEQ_TYPE_CLASS);
- compile_cpath(ret, iseq, node->nd_cpath);
- COMPILE(ret, "super", node->nd_super);
- ADD_INSN3(ret, nd_line(node), defineclass,
- ID2SYM(node->nd_cpath->nd_mid), iseqval, INT2FIX(0));
-
- if (poped) {
- ADD_INSN(ret, nd_line(node), pop);
- }
- break;
- }
- case NODE_MODULE:{
- VALUE iseqval = NEW_CHILD_ISEQVAL(
- node->nd_body,
- rb_sprintf("<module:%s>", rb_id2name(node->nd_cpath->nd_mid)),
- ISEQ_TYPE_CLASS);
-
- compile_cpath(ret, iseq, node->nd_cpath);
- ADD_INSN (ret, nd_line(node), putnil); /* dummy */
- ADD_INSN3(ret, nd_line(node), defineclass,
- ID2SYM(node->nd_cpath->nd_mid), iseqval, INT2FIX(2));
- if (poped) {
- ADD_INSN(ret, nd_line(node), pop);
- }
- break;
- }
- case NODE_SCLASS:{
- ID singletonclass;
- VALUE iseqval =
- NEW_ISEQVAL(node->nd_body, rb_str_new2("singletonclass"),
- ISEQ_TYPE_CLASS);
-
- COMPILE(ret, "sclass#recv", node->nd_recv);
- ADD_INSN (ret, nd_line(node), putnil);
- CONST_ID(singletonclass, "singletonclass");
- ADD_INSN3(ret, nd_line(node), defineclass,
- ID2SYM(singletonclass), iseqval, INT2FIX(1));
-
- if (poped) {
- ADD_INSN(ret, nd_line(node), pop);
- }
- break;
- }
- case NODE_COLON2:{
- if (rb_is_const_id(node->nd_mid)) {
- /* constant */
- LABEL *lstart = NEW_LABEL(nd_line(node));
- LABEL *lend = NEW_LABEL(nd_line(node));
- DECL_ANCHOR(pref);
- DECL_ANCHOR(body);
-
- INIT_ANCHOR(pref);
- INIT_ANCHOR(body);
- compile_colon2(iseq, node, pref, body);
- if (LIST_SIZE_ZERO(pref)) {
- if (iseq->compile_data->option->inline_const_cache) {
- ADD_LABEL(ret, lstart);
- ADD_INSN1(ret, nd_line(node), getinlinecache, lend);
- }
- else {
- ADD_INSN(ret, nd_line(node), putnil);
- }
-
- ADD_SEQ(ret, body);
-
- if (iseq->compile_data->option->inline_const_cache) {
- ADD_INSN1(ret, nd_line(node), setinlinecache, lstart);
- ADD_LABEL(ret, lend);
- }
- }
- else {
- ADD_SEQ(ret, pref);
- ADD_SEQ(ret, body);
- }
- }
- else {
- /* function call */
- ADD_CALL_RECEIVER(ret, nd_line(node));
- COMPILE(ret, "colon2#nd_head", node->nd_head);
- ADD_CALL(ret, nd_line(node), ID2SYM(node->nd_mid),
- INT2FIX(1));
- }
- if (poped) {
- ADD_INSN(ret, nd_line(node), pop);
- }
- break;
- }
- case NODE_COLON3:{
- LABEL *lstart = NEW_LABEL(nd_line(node));
- LABEL *lend = NEW_LABEL(nd_line(node));
- debugi("colon3#nd_mid", node->nd_mid);
-
- /* add cache insn */
- if (iseq->compile_data->option->inline_const_cache) {
- ADD_LABEL(ret, lstart);
- ADD_INSN1(ret, nd_line(node), getinlinecache, lend);
- ADD_INSN(ret, nd_line(node), pop);
- }
-
- ADD_INSN1(ret, nd_line(node), putobject, rb_cObject);
- ADD_INSN1(ret, nd_line(node), getconstant, ID2SYM(node->nd_mid));
-
- if (iseq->compile_data->option->inline_const_cache) {
- ADD_INSN1(ret, nd_line(node), setinlinecache, lstart);
- ADD_LABEL(ret, lend);
- }
-
- if (poped) {
- ADD_INSN(ret, nd_line(node), pop);
- }
- break;
- }
- case NODE_DOT2:
- case NODE_DOT3:{
- int 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, nd_line(node), pop);
- ADD_INSN(ret, nd_line(node), pop);
- }
- else {
- ADD_INSN1(ret, nd_line(node), newrange, flag);
- }
- break;
- }
- case NODE_FLIP2:
- case NODE_FLIP3:{
- LABEL *lend = NEW_LABEL(nd_line(node));
- LABEL *lfin = NEW_LABEL(nd_line(node));
- LABEL *ltrue = NEW_LABEL(nd_line(node));
- VALUE key = rb_sprintf("flipflag/%s-%p-%d",
- RSTRING_PTR(iseq->name), (void *)iseq,
- iseq->compile_data->flip_cnt++);
-
- hide_obj(key);
- iseq_add_mark_object_compile_time(iseq, key);
- ADD_INSN2(ret, nd_line(node), getspecial, key, INT2FIX(0));
- ADD_INSNL(ret, nd_line(node), branchif, lend);
-
- /* *flip == 0 */
- COMPILE(ret, "flip2 beg", node->nd_beg);
- ADD_INSN(ret, nd_line(node), dup);
- ADD_INSNL(ret, nd_line(node), branchunless, lfin);
- if (nd_type(node) == NODE_FLIP3) {
- ADD_INSN(ret, nd_line(node), dup);
- ADD_INSN1(ret, nd_line(node), setspecial, key);
- ADD_INSNL(ret, nd_line(node), jump, lfin);
- }
- else {
- ADD_INSN1(ret, nd_line(node), setspecial, key);
- }
-
- /* *flip == 1 */
- ADD_LABEL(ret, lend);
- COMPILE(ret, "flip2 end", node->nd_end);
- ADD_INSNL(ret, nd_line(node), branchunless, ltrue);
- ADD_INSN1(ret, nd_line(node), putobject, Qfalse);
- ADD_INSN1(ret, nd_line(node), setspecial, key);
-
- ADD_LABEL(ret, ltrue);
- ADD_INSN1(ret, nd_line(node), putobject, Qtrue);
-
- ADD_LABEL(ret, lfin);
- break;
- }
- case NODE_SELF:{
- if (!poped) {
- ADD_INSN(ret, nd_line(node), putself);
- }
- break;
- }
- case NODE_NIL:{
- if (!poped) {
- ADD_INSN(ret, nd_line(node), putnil);
- }
- break;
- }
- case NODE_TRUE:{
- if (!poped) {
- ADD_INSN1(ret, nd_line(node), putobject, Qtrue);
- }
- break;
- }
- case NODE_FALSE:{
- if (!poped) {
- ADD_INSN1(ret, nd_line(node), putobject, Qfalse);
- }
- break;
- }
- case NODE_ERRINFO:{
- if (!poped) {
- if (iseq->type == ISEQ_TYPE_RESCUE) {
- ADD_INSN2(ret, nd_line(node), getdynamic, INT2FIX(2), INT2FIX(0));
- }
- else {
- rb_iseq_t *ip = iseq;
- int level = 0;
- while (ip) {
- if (ip->type == ISEQ_TYPE_RESCUE) {
- break;
- }
- ip = ip->parent_iseq;
- level++;
- }
- if (ip) {
- ADD_INSN2(ret, nd_line(node), getdynamic, INT2FIX(2), INT2FIX(level));
- }
- else {
- ADD_INSN(ret, nd_line(node), putnil);
- }
- }
- }
- break;
- }
- case NODE_DEFINED:{
- if (!poped) {
- LABEL *lfinish[2];
- lfinish[0] = NEW_LABEL(nd_line(node));
- lfinish[1] = 0;
- defined_expr(iseq, ret, node->nd_head, lfinish, Qtrue);
- if (lfinish[1]) {
- ADD_INSNL(ret, nd_line(node), jump, lfinish[0]);
- ADD_LABEL(ret, lfinish[1]);
- ADD_INSN(ret, nd_line(node), putnil);
- }
- ADD_LABEL(ret, lfinish[0]);
- }
- break;
- }
- case NODE_POSTEXE:{
- LABEL *lstart = NEW_LABEL(nd_line(node));
- LABEL *lend = NEW_LABEL(nd_line(node));
- VALUE block = NEW_CHILD_ISEQVAL(node->nd_body, make_name_for_block(iseq), ISEQ_TYPE_BLOCK);
-
- ADD_LABEL(ret, lstart);
- ADD_INSN1(ret, nd_line(node), onceinlinecache, lend);
- ADD_INSN(ret, nd_line(node), pop);
-
- ADD_INSN1(ret, nd_line(node), putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_VMCORE));
- ADD_INSN1(ret, nd_line(node), putiseq, block);
- ADD_SEND (ret, nd_line(node), ID2SYM(id_core_set_postexe), INT2FIX(1));
-
- ADD_INSN1(ret, nd_line(node), setinlinecache, lstart);
- ADD_LABEL(ret, lend);
-
- if (poped) {
- ADD_INSN(ret, nd_line(node), pop);
- }
- break;
- }
- case NODE_DSYM:{
- compile_dstr(iseq, ret, node);
- if (!poped) {
- ADD_SEND(ret, nd_line(node), ID2SYM(idIntern), INT2FIX(0));
- }
- else {
- ADD_INSN(ret, nd_line(node), pop);
- }
- break;
- }
- case NODE_ATTRASGN:{
- DECL_ANCHOR(recv);
- DECL_ANCHOR(args);
- unsigned long flag = 0;
- VALUE argc;
-
- INIT_ANCHOR(recv);
- INIT_ANCHOR(args);
- argc = setup_args(iseq, args, node->nd_args, &flag);
-
- if (node->nd_recv == (NODE *) 1) {
- flag |= VM_CALL_FCALL_BIT;
- ADD_INSN(recv, nd_line(node), putself);
- }
- else {
- COMPILE(recv, "recv", node->nd_recv);
- }
-
- debugp_param("argc", argc);
- debugp_param("nd_mid", ID2SYM(node->nd_mid));
-
- if (!poped) {
- ADD_INSN(ret, nd_line(node), putnil);
- ADD_SEQ(ret, recv);
- ADD_SEQ(ret, args);
-
- if (flag & VM_CALL_ARGS_BLOCKARG_BIT) {
- ADD_INSN1(ret, nd_line(node), topn, INT2FIX(1));
- ADD_INSN1(ret, nd_line(node), setn, INT2FIX(FIX2INT(argc) + 3));
- ADD_INSN (ret, nd_line(node), pop);
- }
- else {
- ADD_INSN1(ret, nd_line(node), setn, INT2FIX(FIX2INT(argc) + 1));
- }
- }
- else {
- ADD_SEQ(ret, recv);
- ADD_SEQ(ret, args);
- }
- ADD_SEND_R(ret, nd_line(node), ID2SYM(node->nd_mid), argc, 0, LONG2FIX(flag));
- ADD_INSN(ret, nd_line(node), pop);
-
- break;
- }
- case NODE_OPTBLOCK:{
- /* for optimize */
- LABEL *redo_label = NEW_LABEL(0);
- LABEL *next_label = NEW_LABEL(0);
-
- iseq->compile_data->start_label = next_label;
- iseq->compile_data->redo_label = redo_label;
-
- ADD_LABEL(ret, redo_label);
- COMPILE_(ret, "optblock body", node->nd_head, 1 /* pop */ );
- ADD_LABEL(ret, next_label);
- ADD_INSN(ret, 0, opt_checkenv);
- break;
- }
- case NODE_PRELUDE:{
- COMPILE_POPED(ret, "prelude", node->nd_head);
- COMPILE_(ret, "body", node->nd_body, poped);
- break;
- }
- case NODE_LAMBDA:{
- /* compile same as lambda{...} */
- VALUE block = NEW_CHILD_ISEQVAL(node->nd_body, make_name_for_block(iseq), ISEQ_TYPE_BLOCK);
- VALUE argc = INT2FIX(0);
- ADD_CALL_RECEIVER(ret, nd_line(node));
- ADD_CALL_WITH_BLOCK(ret, nd_line(node), ID2SYM(idLambda), argc, block);
-
- if (poped) {
- ADD_INSN(ret, nd_line(node), pop);
- }
- break;
- }
- default:
- rb_bug("iseq_compile_each: unknown node: %s", ruby_node_name(type));
- return Qnil;
- }
-
- debug_node_end();
- return COMPILE_OK;
-}
-
-/***************************/
-/* instruction information */
-/***************************/
-
-static int
-insn_data_length(INSN *iobj)
-{
- return insn_len(iobj->insn_id);
-}
-
-static int
-calc_sp_depth(int depth, INSN *insn)
-{
- return insn_stack_increase(depth, insn->insn_id, insn->operands);
-}
-
-static int
-insn_data_line_no(INSN *iobj)
-{
- return insn_len(iobj->line_no);
-}
-
-static VALUE
-insn_data_to_s_detail(INSN *iobj)
-{
- VALUE str = rb_str_new(0, 0);
-
- str = rb_sprintf("%-16s", insn_name(iobj->insn_id));
- if (iobj->operands) {
- const char *types = insn_op_types(iobj->insn_id);
- int j;
-
- for (j = 0; types[j]; j++) {
- char type = types[j];
-
- switch (type) {
- case TS_OFFSET: /* label(destination position) */
- {
- LABEL *lobj = (LABEL *)OPERAND_AT(iobj, j);
- rb_str_catf(str, "<L%03d>", lobj->label_no);
- break;
- }
- break;
- case TS_ISEQ: /* iseq */
- {
- rb_iseq_t *iseq = (rb_iseq_t *)OPERAND_AT(iobj, j);
- VALUE val = Qnil;
- if (iseq) {
- val = iseq->self;
- }
- rb_str_concat(str, rb_inspect(val));
- }
- break;
- case TS_LINDEX:
- case TS_DINDEX:
- case TS_NUM: /* ulong */
- case TS_VALUE: /* VALUE */
- rb_str_concat(str, rb_inspect(OPERAND_AT(iobj, j)));
- break;
- case TS_ID: /* ID */
- rb_str_concat(str, rb_inspect(OPERAND_AT(iobj, j)));
- break;
- case TS_GENTRY:
- {
- struct rb_global_entry *entry = (struct rb_global_entry *)
- (OPERAND_AT(iobj, j) & (~1));
- rb_str_cat2(str, rb_id2name(entry->id));
- }
- case TS_IC: /* method cache */
- rb_str_cat2(str, "<ic>");
- break;
- case TS_CDHASH: /* case/when condition cache */
- rb_str_cat2(str, "<ch>");
- break;
- default:{
- rb_raise(rb_eSyntaxError, "unknown operand type: %c", type);
- }
- }
- if (types[j + 1]) {
- rb_str_cat2(str, ", ");
- }
- }
- }
- return str;
-}
-
-static void
-dump_disasm_list(struct iseq_link_element *link)
-{
- int pos = 0;
- INSN *iobj;
- LABEL *lobj;
- VALUE str;
-
- printf("-- raw disasm--------\n");
-
- while (link) {
- switch (link->type) {
- case ISEQ_ELEMENT_INSN:
- {
- iobj = (INSN *)link;
- str = insn_data_to_s_detail(iobj);
- printf("%04d %-65s(%4d)\n", pos, StringValueCStr(str),
- insn_data_line_no(iobj));
- pos += insn_data_length(iobj);
- break;
- }
- case ISEQ_ELEMENT_LABEL:
- {
- lobj = (LABEL *)link;
- printf("<L%03d>\n", lobj->label_no);
- break;
- }
- case ISEQ_ELEMENT_NONE:
- {
- printf("[none]\n");
- break;
- }
- case ISEQ_ELEMENT_ADJUST:
- {
- ADJUST *adjust = (ADJUST *)link;
- printf("adjust: [label: %d]\n", adjust->label->label_no);
- break;
- }
- default:
- /* ignore */
- rb_raise(rb_eSyntaxError, "dump_disasm_list error: %ld\n", FIX2LONG(link->type));
- }
- link = link->next;
- }
- printf("---------------------\n");
-}
-
-VALUE
-rb_insns_name_array(void)
-{
- VALUE ary = rb_ary_new();
- int i;
- for (i = 0; i < numberof(insn_name_info); i++) {
- rb_ary_push(ary, rb_obj_freeze(rb_str_new2(insn_name_info[i])));
- }
- return rb_obj_freeze(ary);
-}
-
-static LABEL *
-register_label(rb_iseq_t *iseq, struct st_table *labels_table, VALUE obj)
-{
- LABEL *label = 0;
- st_data_t tmp;
- obj = rb_convert_type(obj, T_SYMBOL, "Symbol", "to_sym");
-
- if (st_lookup(labels_table, obj, &tmp) == 0) {
- label = NEW_LABEL(0);
- st_insert(labels_table, obj, (st_data_t)label);
- }
- else {
- label = (LABEL *)tmp;
- }
- return label;
-}
-
-static VALUE
-get_exception_sym2type(VALUE sym)
-{
-#undef rb_intern
-#define rb_intern(str) rb_intern_const(str)
- static VALUE symRescue, symEnsure, symRetry;
- static VALUE symBreak, symRedo, symNext;
-
- if (symRescue == 0) {
- symRescue = ID2SYM(rb_intern("rescue"));
- symEnsure = ID2SYM(rb_intern("ensure"));
- symRetry = ID2SYM(rb_intern("retry"));
- symBreak = ID2SYM(rb_intern("break"));
- symRedo = ID2SYM(rb_intern("redo"));
- symNext = ID2SYM(rb_intern("next"));
- }
-
- if (sym == symRescue) return CATCH_TYPE_RESCUE;
- if (sym == symEnsure) return CATCH_TYPE_ENSURE;
- if (sym == symRetry) return CATCH_TYPE_RETRY;
- 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: %s",
- RSTRING_PTR(rb_inspect(sym)));
- return 0;
-}
-
-static int
-iseq_build_exception(rb_iseq_t *iseq, struct st_table *labels_table,
- VALUE exception)
-{
- int i;
-
- for (i=0; i<RARRAY_LEN(exception); i++) {
- VALUE v, type, *ptr, eiseqval;
- LABEL *lstart, *lend, *lcont;
- int sp;
-
- RB_GC_GUARD(v) = rb_convert_type(RARRAY_PTR(exception)[i], T_ARRAY,
- "Array", "to_ary");
- if (RARRAY_LEN(v) != 6) {
- rb_raise(rb_eSyntaxError, "wrong exception entry");
- }
- ptr = RARRAY_PTR(v);
- type = get_exception_sym2type(ptr[0]);
- if (ptr[1] == Qnil) {
- eiseqval = 0;
- }
- else {
- eiseqval = rb_iseq_load(ptr[1], iseq->self, Qnil);
- }
-
- lstart = register_label(iseq, labels_table, ptr[2]);
- lend = register_label(iseq, labels_table, ptr[3]);
- lcont = register_label(iseq, labels_table, ptr[4]);
- sp = NUM2INT(ptr[5]);
-
- ADD_CATCH_ENTRY(type, lstart, lend, eiseqval, lcont);
- }
- return COMPILE_OK;
-}
-
-static struct st_table *
-insn_make_insn_table(void)
-{
- struct st_table *table;
- int i;
- table = st_init_numtable();
-
- for (i=0; i<VM_INSTRUCTION_SIZE; i++) {
- st_insert(table, ID2SYM(rb_intern(insn_name(i))), i);
- }
-
- return table;
-}
-
-static int
-iseq_build_body(rb_iseq_t *iseq, LINK_ANCHOR *anchor,
- VALUE body, struct st_table *labels_table)
-{
- /* TODO: body should be freezed */
- VALUE *ptr = RARRAY_PTR(body);
- int len = RARRAY_LEN(body);
- int i, j;
- int line_no = 0;
- /*
- * index -> LABEL *label
- */
- static struct st_table *insn_table;
-
- if (insn_table == 0) {
- insn_table = insn_make_insn_table();
- }
-
- for (i=0; i<len; i++) {
- VALUE obj = ptr[i];
-
- if (SYMBOL_P(obj)) {
- LABEL *label = register_label(iseq, labels_table, obj);
- ADD_LABEL(anchor, label);
- }
- else if (FIXNUM_P(obj)) {
- line_no = NUM2INT(obj);
- }
- else if (TYPE(obj) == T_ARRAY) {
- VALUE *argv = 0;
- int argc = (int)RARRAY_LEN(obj) - 1;
- VALUE insn_id;
- VALUE insn;
-
- insn = (argc < 0) ? Qnil : RARRAY_PTR(obj)[0];
- if (st_lookup(insn_table, insn, &insn_id) == 0) {
- /* TODO: exception */
- RB_GC_GUARD(insn) = rb_inspect(insn);
- rb_compile_error(RSTRING_PTR(iseq->filename), line_no,
- "unknown instruction: %s", RSTRING_PTR(insn));
- }
-
- if (argc != insn_len(insn_id)-1) {
- rb_compile_error(RSTRING_PTR(iseq->filename), line_no,
- "operand size mismatch");
- }
-
- if (argc > 0) {
- 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(insn_id, j)) {
- case TS_OFFSET: {
- LABEL *label = register_label(iseq, labels_table, op);
- argv[j] = (VALUE)label;
- break;
- }
- case TS_LINDEX:
- case TS_DINDEX:
- case TS_NUM:
- (void)NUM2INT(op);
- argv[j] = op;
- break;
- case TS_VALUE:
- argv[j] = op;
- iseq_add_mark_object(iseq, op);
- break;
- case TS_ISEQ:
- {
- if (op != Qnil) {
- if (TYPE(op) == T_ARRAY) {
- argv[j] = rb_iseq_load(op, iseq->self, Qnil);
- }
- else if (CLASS_OF(op) == rb_cISeq) {
- argv[j] = op;
- }
- else {
- rb_raise(rb_eSyntaxError, "ISEQ is required");
- }
- iseq_add_mark_object(iseq, argv[j]);
- }
- else {
- argv[j] = 0;
- }
- }
- break;
- case TS_GENTRY:
- op = rb_convert_type(op, T_SYMBOL, "Symbol", "to_sym");
- argv[j] = (VALUE)rb_global_entry(SYM2ID(op));
- break;
- case TS_IC:
- break;
- case TS_ID:
- argv[j] = rb_convert_type(op, T_SYMBOL,
- "Symbol", "to_sym");
- break;
- case TS_CDHASH:
- {
- int i;
- op = rb_convert_type(op, T_ARRAY, "Array", "to_ary");
- op = rb_ary_dup(op);
- for (i=0; i<RARRAY_LEN(op); i+=2) {
- VALUE sym = rb_ary_entry(op, i+1);
- LABEL *label =
- register_label(iseq, labels_table, sym);
- rb_ary_store(op, i+1, (VALUE)label | 1);
- }
- argv[j] = op;
- }
- break;
- default:
- rb_raise(rb_eSyntaxError, "unknown operand: %c", insn_op_type(insn_id, j));
- }
- }
- }
- ADD_ELEM(anchor,
- (LINK_ELEMENT*)new_insn_core(iseq, line_no,
- insn_id, argc, argv));
- }
- else {
- rb_raise(rb_eTypeError, "unexpected object for instruction");
- }
- }
- st_free_table(labels_table);
- iseq_setup(iseq, anchor);
- return COMPILE_OK;
-}
-
-#define CHECK_ARRAY(v) rb_convert_type(v, T_ARRAY, "Array", "to_ary")
-#define CHECK_STRING(v) rb_convert_type(v, T_STRING, "String", "to_str")
-#define CHECK_SYMBOL(v) rb_convert_type(v, T_SYMBOL, "Symbol", "to_sym")
-static inline VALUE CHECK_INTEGER(VALUE v) {NUM2LONG(v); return v;}
-
-VALUE
-rb_iseq_build_from_ary(rb_iseq_t *iseq, VALUE locals, VALUE args,
- VALUE exception, VALUE body)
-{
- int i;
- ID *tbl;
- struct st_table *labels_table = st_init_numtable();
-
- DECL_ANCHOR(anchor);
-
- INIT_ANCHOR(anchor);
-
- iseq->local_table_size = RARRAY_LEN(locals);
- iseq->local_table = tbl = (ID *)ALLOC_N(ID *, iseq->local_table_size);
- iseq->local_size = iseq->local_table_size + 1;
-
- for (i=0; i<RARRAY_LEN(locals); i++) {
- VALUE lv = RARRAY_PTR(locals)[i];
- tbl[i] = FIXNUM_P(lv) ? (ID)FIX2LONG(lv) : SYM2ID(CHECK_SYMBOL(lv));
- }
-
- /* args */
- if (FIXNUM_P(args)) {
- iseq->arg_size = iseq->argc = FIX2INT(args);
- iseq->arg_simple = 1;
- }
- else {
- int i = 0;
- VALUE argc = CHECK_INTEGER(rb_ary_entry(args, i++));
- VALUE arg_opt_labels = CHECK_ARRAY(rb_ary_entry(args, i++));
- VALUE arg_post_len = CHECK_INTEGER(rb_ary_entry(args, i++));
- VALUE arg_post_start = CHECK_INTEGER(rb_ary_entry(args, i++));
- VALUE arg_rest = CHECK_INTEGER(rb_ary_entry(args, i++));
- VALUE arg_block = CHECK_INTEGER(rb_ary_entry(args, i++));
- VALUE arg_simple = CHECK_INTEGER(rb_ary_entry(args, i++));
-
- iseq->argc = FIX2INT(argc);
- iseq->arg_rest = FIX2INT(arg_rest);
- iseq->arg_post_len = FIX2INT(arg_post_len);
- iseq->arg_post_start = FIX2INT(arg_post_start);
- iseq->arg_block = FIX2INT(arg_block);
- iseq->arg_opts = RARRAY_LEN(arg_opt_labels);
- iseq->arg_opt_table = (VALUE *)ALLOC_N(VALUE, iseq->arg_opts);
-
- if (iseq->arg_block != -1) {
- iseq->arg_size = iseq->arg_block + 1;
- }
- else if (iseq->arg_post_len) {
- iseq->arg_size = iseq->arg_post_start + iseq->arg_post_len;
- }
- else if (iseq->arg_rest != -1) {
- iseq->arg_size = iseq->arg_rest + 1;
- }
- else {
- iseq->arg_size = iseq->argc + (iseq->arg_opts ? iseq->arg_opts - 1 : 0);
- }
-
- for (i=0; i<RARRAY_LEN(arg_opt_labels); i++) {
- iseq->arg_opt_table[i] =
- (VALUE)register_label(iseq, labels_table,
- rb_ary_entry(arg_opt_labels, i));
- }
-
- iseq->arg_simple = NUM2INT(arg_simple);
- }
-
- /* exception */
- iseq_build_exception(iseq, labels_table, exception);
-
- /* body */
- iseq_build_body(iseq, anchor, body, labels_table);
- return iseq->self;
-}
-
-/* for parser */
-
-int
-rb_dvar_defined(ID id)
-{
- 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
- ) {
- int i;
-
- for (i = 0; i < iseq->local_table_size; i++) {
- if (iseq->local_table[i] == id) {
- return 1;
- }
- }
- iseq = iseq->parent_iseq;
- }
- }
- return 0;
-}
-
-int
-rb_local_defined(ID id)
-{
- 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<iseq->local_table_size; i++) {
- if (iseq->local_table[i] == id) {
- return 1;
- }
- }
- }
- 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;
-}
diff --git a/complex.c b/complex.c
deleted file mode 100644
index 91f53e643e..0000000000
--- a/complex.c
+++ /dev/null
@@ -1,2006 +0,0 @@
-/*
- complex.c: Coded by Tadayoshi Funaba 2008,2009
-
- This implementation is based on Keiju Ishitsuka's Complex library
- which is written in ruby.
-*/
-
-#include "ruby.h"
-#include <math.h>
-
-#define NDEBUG
-#include <assert.h>
-
-#define ZERO INT2FIX(0)
-#define ONE INT2FIX(1)
-#define TWO INT2FIX(2)
-
-VALUE rb_cComplex;
-
-static ID id_abs, id_abs2, id_arg, id_cmp, id_conj, id_convert,
- id_denominator, id_divmod, id_eqeq_p, id_expt, id_fdiv, id_floor,
- id_idiv, id_imag, id_inspect, id_negate, id_numerator, id_quo,
- id_real, id_real_p, id_to_f, id_to_i, id_to_r, id_to_s;
-
-#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)\
-{\
- return rb_funcall(x, id_##n, 0);\
-}
-
-#define fun2(n) \
-inline static VALUE \
-f_##n(VALUE x, VALUE y)\
-{\
- return rb_funcall(x, id_##n, 1, y);\
-}
-
-#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)
-{
-#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);
-}
-
-inline static VALUE
-f_cmp(VALUE x, VALUE y)
-{
- if (FIXNUM_P(x) && FIXNUM_P(y)) {
- long c = FIX2LONG(x) - FIX2LONG(y);
- if (c > 0)
- c = 1;
- else if (c < 0)
- c = -1;
- return INT2FIX(c);
- }
- return rb_funcall(x, id_cmp, 1, y);
-}
-
-inline static VALUE
-f_div(VALUE x, VALUE y)
-{
- if (FIXNUM_P(y) && FIX2LONG(y) == 1)
- return x;
- return rb_funcall(x, '/', 1, y);
-}
-
-inline static VALUE
-f_gt_p(VALUE x, VALUE y)
-{
- if (FIXNUM_P(x) && FIXNUM_P(y))
- return f_boolcast(FIX2LONG(x) > FIX2LONG(y));
- return rb_funcall(x, '>', 1, y);
-}
-
-inline static VALUE
-f_lt_p(VALUE x, VALUE y)
-{
- if (FIXNUM_P(x) && FIXNUM_P(y))
- return f_boolcast(FIX2LONG(x) < FIX2LONG(y));
- return rb_funcall(x, '<', 1, y);
-}
-
-binop(mod, '%')
-
-inline static VALUE
-f_mul(VALUE x, VALUE y)
-{
-#ifndef PRESERVE_SIGNEDZERO
- if (FIXNUM_P(y)) {
- long iy = FIX2LONG(y);
- if (iy == 0) {
- if (FIXNUM_P(x) || TYPE(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) || TYPE(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)
-{
-#ifndef PRESERVE_SIGNEDZERO
- if (FIXNUM_P(y) && FIX2LONG(y) == 0)
- return x;
-#endif
- return rb_funcall(x, '-', 1, y);
-}
-
-fun1(abs)
-fun1(abs2)
-fun1(arg)
-fun1(conj)
-fun1(denominator)
-fun1(floor)
-fun1(imag)
-fun1(inspect)
-fun1(negate)
-fun1(numerator)
-fun1(real)
-fun1(real_p)
-
-fun1(to_f)
-fun1(to_i)
-fun1(to_r)
-fun1(to_s)
-
-fun2(divmod)
-
-inline static VALUE
-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);
-}
-
-fun2(expt)
-fun2(fdiv)
-fun2(idiv)
-fun2(quo)
-
-inline static VALUE
-f_negative_p(VALUE 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 VALUE
-f_zero_p(VALUE x)
-{
- switch (TYPE(x)) {
- case T_FIXNUM:
- return f_boolcast(FIX2LONG(x) == 0);
- case T_BIGNUM:
- return Qfalse;
- case T_RATIONAL:
- {
- VALUE num = RRATIONAL(x)->num;
-
- return f_boolcast(FIXNUM_P(num) && FIX2LONG(num) == 0);
- }
- }
- return rb_funcall(x, id_eqeq_p, 1, ZERO);
-}
-
-#define f_nonzero_p(x) (!f_zero_p(x))
-
-inline static VALUE
-f_one_p(VALUE x)
-{
- switch (TYPE(x)) {
- case T_FIXNUM:
- return f_boolcast(FIX2LONG(x) == 1);
- case T_BIGNUM:
- return Qfalse;
- case T_RATIONAL:
- {
- 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_funcall(x, id_eqeq_p, 1, ONE);
-}
-
-inline static VALUE
-f_kind_of_p(VALUE x, VALUE c)
-{
- return rb_obj_is_kind_of(x, c);
-}
-
-inline static VALUE
-k_numeric_p(VALUE x)
-{
- return f_kind_of_p(x, rb_cNumeric);
-}
-
-inline static VALUE
-k_integer_p(VALUE x)
-{
- return f_kind_of_p(x, rb_cInteger);
-}
-
-inline static VALUE
-k_fixnum_p(VALUE x)
-{
- return f_kind_of_p(x, rb_cFixnum);
-}
-
-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;\
- dat = ((struct RComplex *)(x))
-
-#define get_dat2(x,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)
-{
- NEWOBJ(obj, struct RComplex);
- OBJSETUP(obj, klass, T_COMPLEX);
-
- obj->real = real;
- obj->imag = imag;
-
- return (VALUE)obj;
-}
-
-static VALUE
-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(!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(!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;
-
-void
-nucomp_canonicalization(int f)
-{
- canonicalization = f;
-}
-#endif
-
-inline static void
-nucomp_real_check(VALUE num)
-{
- switch (TYPE(num)) {
- case T_FIXNUM:
- case T_BIGNUM:
- case T_FLOAT:
- case T_RATIONAL:
- break;
- default:
- if (!k_numeric_p(num) || !f_real_p(num))
- rb_raise(rb_eArgError, "not a real");
- }
-}
-
-inline static VALUE
-nucomp_s_canonicalize_internal(VALUE klass, VALUE real, VALUE imag)
-{
-#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
-#endif
- if (f_real_p(real) && f_real_p(imag))
- return nucomp_s_new_internal(klass, real, imag);
- 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 (f_real_p(imag)) {
- get_dat1(real);
-
- return nucomp_s_new_internal(klass,
- dat->real,
- f_add(dat->imag, imag));
- }
- else {
- get_dat2(real, imag);
-
- return nucomp_s_new_internal(klass,
- f_sub(adat->real, bdat->imag),
- f_add(adat->imag, bdat->real));
- }
-}
-
-/*
- * call-seq:
- * Complex.rect(real[, imag]) -> complex
- * Complex.rectangular(real[, imag]) -> complex
- *
- * Returns a complex object which denotes the given rectangular form.
- */
-static VALUE
-nucomp_s_new(int argc, VALUE *argv, VALUE klass)
-{
- VALUE real, imag;
-
- switch (rb_scan_args(argc, argv, "11", &real, &imag)) {
- case 1:
- nucomp_real_check(real);
- imag = ZERO;
- break;
- default:
- nucomp_real_check(real);
- nucomp_real_check(imag);
- break;
- }
-
- return nucomp_s_canonicalize_internal(klass, real, imag);
-}
-
-inline static VALUE
-f_complex_new1(VALUE klass, VALUE x)
-{
- assert(!k_complex_p(x));
- return nucomp_s_canonicalize_internal(klass, x, ZERO);
-}
-
-inline static VALUE
-f_complex_new2(VALUE klass, VALUE x, VALUE y)
-{
- assert(!k_complex_p(x));
- return nucomp_s_canonicalize_internal(klass, x, y);
-}
-
-/*
- * call-seq:
- * Complex(x[, y]) -> numeric
- *
- * Returns x+i*y;
- */
-static VALUE
-nucomp_f_complex(int argc, VALUE *argv, VALUE klass)
-{
- return rb_funcall2(rb_cComplex, id_convert, argc, argv);
-}
-
-#define imp1(n) \
-extern VALUE rb_math_##n(VALUE x);\
-inline static VALUE \
-m_##n##_bang(VALUE x)\
-{\
- return rb_math_##n(x);\
-}
-
-#define imp2(n) \
-extern VALUE rb_math_##n(VALUE x, VALUE y);\
-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)
-
-extern VALUE rb_math_log(int argc, VALUE *argv);
-
-static VALUE
-m_log_bang(VALUE x)
-{
- return rb_math_log(1, &x);
-}
-
-imp1(sin)
-imp1(sinh)
-imp1(sqrt)
-
-static VALUE
-m_cos(VALUE x)
-{
- if (f_real_p(x))
- return m_cos_bang(x);
- {
- get_dat1(x);
- return f_complex_new2(rb_cComplex,
- f_mul(m_cos_bang(dat->real),
- m_cosh_bang(dat->imag)),
- f_mul(f_negate(m_sin_bang(dat->real)),
- m_sinh_bang(dat->imag)));
- }
-}
-
-static VALUE
-m_sin(VALUE x)
-{
- if (f_real_p(x))
- return m_sin_bang(x);
- {
- get_dat1(x);
- return f_complex_new2(rb_cComplex,
- f_mul(m_sin_bang(dat->real),
- m_cosh_bang(dat->imag)),
- f_mul(m_cos_bang(dat->real),
- m_sinh_bang(dat->imag)));
- }
-}
-
-#if 0
-static VALUE
-m_sqrt(VALUE x)
-{
- 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 {
- VALUE a = f_abs(x);
- return f_complex_new2(rb_cComplex,
- m_sqrt_bang(f_div(f_add(a, dat->real), TWO)),
- m_sqrt_bang(f_div(f_sub(a, dat->real), TWO)));
- }
- }
-}
-#endif
-
-inline static VALUE
-f_complex_polar(VALUE klass, VALUE x, VALUE y)
-{
- assert(!k_complex_p(x));
- assert(!k_complex_p(y));
- return nucomp_s_canonicalize_internal(klass,
- f_mul(x, m_cos(y)),
- f_mul(x, m_sin(y)));
-}
-
-/*
- * call-seq:
- * Complex.polar(abs[, arg]) -> complex
- *
- * Returns a complex object which denotes the given polar form.
- */
-static VALUE
-nucomp_s_polar(int argc, VALUE *argv, VALUE klass)
-{
- VALUE abs, arg;
-
- switch (rb_scan_args(argc, argv, "11", &abs, &arg)) {
- case 1:
- nucomp_real_check(abs);
- arg = ZERO;
- break;
- default:
- nucomp_real_check(abs);
- nucomp_real_check(arg);
- break;
- }
- return f_complex_polar(klass, abs, arg);
-}
-
-/*
- * call-seq:
- * cmp.real -> real
- *
- * Returns the real part.
- */
-static VALUE
-nucomp_real(VALUE self)
-{
- get_dat1(self);
- return dat->real;
-}
-
-/*
- * call-seq:
- * cmp.imag -> real
- * cmp.imaginary -> real
- *
- * Returns the imaginary part.
- */
-static VALUE
-nucomp_imag(VALUE self)
-{
- get_dat1(self);
- return dat->imag;
-}
-
-/*
- * call-seq:
- * -cmp -> complex
- *
- * Returns negation of the value.
- */
-static VALUE
-nucomp_negate(VALUE self)
-{
- get_dat1(self);
- return f_complex_new2(CLASS_OF(self),
- f_negate(dat->real), f_negate(dat->imag));
-}
-
-inline static VALUE
-f_addsub(VALUE self, VALUE other,
- VALUE (*func)(VALUE, VALUE), ID id)
-{
- if (k_complex_p(other)) {
- VALUE real, imag;
-
- get_dat2(self, other);
-
- real = (*func)(adat->real, bdat->real);
- imag = (*func)(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),
- (*func)(dat->real, other), dat->imag);
- }
- return rb_num_coerce_bin(self, other, id);
-}
-
-/*
- * call-seq:
- * cmp + numeric -> complex
- *
- * Performs addition.
- */
-static VALUE
-nucomp_add(VALUE self, VALUE other)
-{
- return f_addsub(self, other, f_add, '+');
-}
-
-/*
- * call-seq:
- * cmp - numeric -> complex
- *
- * Performs subtraction.
- */
-static VALUE
-nucomp_sub(VALUE self, VALUE other)
-{
- return f_addsub(self, other, f_sub, '-');
-}
-
-/*
- * call-seq:
- * cmp * numeric -> complex
- *
- * Performs multiplication.
- */
-static VALUE
-nucomp_mul(VALUE self, VALUE other)
-{
- if (k_complex_p(other)) {
- VALUE real, imag;
-
- get_dat2(self, other);
-
- real = f_sub(f_mul(adat->real, bdat->real),
- f_mul(adat->imag, bdat->imag));
- imag = f_add(f_mul(adat->real, bdat->imag),
- f_mul(adat->imag, bdat->real));
-
- 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_mul(dat->real, other),
- f_mul(dat->imag, other));
- }
- return rb_num_coerce_bin(self, other, '*');
-}
-
-inline static VALUE
-f_divide(VALUE self, VALUE other,
- VALUE (*func)(VALUE, VALUE), ID id)
-{
- if (k_complex_p(other)) {
- int flo;
- get_dat2(self, other);
-
- 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)));
- 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)));
- 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 (k_numeric_p(other) && f_real_p(other)) {
- get_dat1(self);
-
- return f_complex_new2(CLASS_OF(self),
- (*func)(dat->real, other),
- (*func)(dat->imag, other));
- }
- return rb_num_coerce_bin(self, other, id);
-}
-
-#define rb_raise_zerodiv() rb_raise(rb_eZeroDivError, "divided by 0")
-
-/*
- * call-seq:
- * cmp / numeric -> complex
- * cmp.quo(numeric) -> complex
- *
- * Performs division.
- *
- * For example:
- *
- * Complex(10.0) / 3 #=> (3.3333333333333335+(0/1)*i)
- * Complex(10) / 3 #=> ((10/3)+(0/1)*i) # not (3+0i)
- */
-static VALUE
-nucomp_div(VALUE self, VALUE other)
-{
- return f_divide(self, other, f_quo, id_quo);
-}
-
-#define nucomp_quo nucomp_div
-
-/*
- * call-seq:
- * cmp.fdiv(numeric) -> complex
- *
- * Performs division as each part is a float, never returns a float.
- *
- * For example:
- *
- * Complex(11,22).fdiv(3) #=> (3.6666666666666665+7.333333333333333i)
- */
-static VALUE
-nucomp_fdiv(VALUE self, VALUE other)
-{
- return f_divide(self, other, f_fdiv, id_fdiv);
-}
-
-static VALUE
-m_log(VALUE x)
-{
- if (f_real_p(x) && f_positive_p(x))
- return m_log_bang(x);
- return rb_complex_new2(m_log_bang(f_abs(x)), f_arg(x));
-}
-
-static VALUE
-m_exp(VALUE x)
-{
- VALUE ere, im;
-
- if (f_real_p(x))
- return m_exp_bang(x);
- ere = m_exp_bang(f_real(x));
- im = f_imag(x);
- return rb_complex_new2(f_mul(ere, m_cos_bang(im)),
- f_mul(ere, m_sin_bang(im)));
-}
-
-VALUE
-rb_fexpt(VALUE x, VALUE y)
-{
- if (f_zero_p(x) || (!k_float_p(x) && !k_float_p(y)))
- return f_expt(x, y);
- return m_exp(f_mul(m_log(x), y));
-}
-
-inline static VALUE
-f_reciprocal(VALUE x)
-{
- return f_quo(ONE, x);
-}
-
-/*
- * call-seq:
- * cmp ** numeric -> complex
- *
- * Performs exponentiation.
- *
- * For example:
- *
- * Complex('i') ** 2 #=> (-1+0i)
- * Complex(-8) ** Rational(1,3) #=> (1.0000000000000002+1.7320508075688772i)
- */
-static VALUE
-nucomp_expt(VALUE self, VALUE other)
-{
- if (k_exact_zero_p(other))
- return f_complex_new_bang1(CLASS_OF(self), ONE);
-
- if (k_rational_p(other) && f_one_p(f_denominator(other)))
- other = f_numerator(other); /* c14n */
-
- if (k_complex_p(other)) {
- get_dat1(other);
-
- if (k_exact_zero_p(dat->imag))
- other = dat->real; /* c14n */
- }
-
- if (k_complex_p(other)) {
- VALUE r, theta, nr, ntheta;
-
- get_dat1(other);
-
- r = f_abs(self);
- theta = f_arg(self);
-
- nr = m_exp_bang(f_sub(f_mul(dat->real, m_log_bang(r)),
- f_mul(dat->imag, theta)));
- ntheta = f_add(f_mul(theta, dat->real),
- f_mul(dat->imag, m_log_bang(r)));
- return f_complex_polar(CLASS_OF(self), nr, ntheta);
- }
- 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 = f_complex_new2(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 (k_bignum_p(other))
- rb_warn("in a**b, b may be too big");
-
- r = f_abs(self);
- theta = f_arg(self);
-
- return f_complex_polar(CLASS_OF(self), f_expt(r, other),
- f_mul(theta, other));
- }
- return rb_num_coerce_bin(self, other, id_expt);
-}
-
-/*
- * call-seq:
- * cmp == object -> true or false
- *
- * Returns true if cmp equals object numerically.
- */
-static VALUE
-nucomp_eqeq_p(VALUE self, VALUE other)
-{
- if (k_complex_p(other)) {
- get_dat2(self, other);
-
- return f_boolcast(f_eqeq_p(adat->real, bdat->real) &&
- f_eqeq_p(adat->imag, bdat->imag));
- }
- if (k_numeric_p(other) && f_real_p(other)) {
- get_dat1(self);
-
- return f_boolcast(f_eqeq_p(dat->real, other) && f_zero_p(dat->imag));
- }
- 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 (TYPE(other) == T_COMPLEX)
- return rb_assoc_new(other, self);
-
- rb_raise(rb_eTypeError, "%s can't be coerced into %s",
- rb_obj_classname(other), rb_obj_classname(self));
- return Qnil;
-}
-
-/*
- * call-seq:
- * cmp.abs -> real
- * cmp.magnitude -> real
- *
- * Returns the absolute part of its polar form.
- */
-static VALUE
-nucomp_abs(VALUE self)
-{
- get_dat1(self);
-
- if (f_zero_p(dat->real)) {
- VALUE a = f_abs(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 (!k_float_p(dat->real) && k_float_p(dat->imag))
- a = f_to_f(a);
- return a;
- }
- return m_hypot(dat->real, dat->imag);
-}
-
-/*
- * call-seq:
- * cmp.abs2 -> real
- *
- * Returns square of the absolute value.
- */
-static VALUE
-nucomp_abs2(VALUE self)
-{
- get_dat1(self);
- return f_add(f_mul(dat->real, dat->real),
- f_mul(dat->imag, dat->imag));
-}
-
-/*
- * call-seq:
- * cmp.arg -> float
- * cmp.angle -> float
- * cmp.phase -> float
- *
- * Returns the angle part of its polar form.
- */
-static VALUE
-nucomp_arg(VALUE self)
-{
- get_dat1(self);
- return m_atan2_bang(dat->imag, dat->real);
-}
-
-/*
- * call-seq:
- * cmp.rect -> array
- * cmp.rectangular -> array
- *
- * Returns an array; [cmp.real, cmp.imag].
- */
-static VALUE
-nucomp_rect(VALUE self)
-{
- get_dat1(self);
- return rb_assoc_new(dat->real, dat->imag);
-}
-
-/*
- * call-seq:
- * cmp.polar -> array
- *
- * Returns an array; [cmp.abs, cmp.arg].
- */
-static VALUE
-nucomp_polar(VALUE self)
-{
- return rb_assoc_new(f_abs(self), f_arg(self));
-}
-
-/*
- * call-seq:
- * cmp.conj -> complex
- * cmp.conjucate -> complex
- *
- * Returns the complex conjucate.
- */
-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:
- * cmp.real? -> false
- *
- * Returns false.
- */
-static VALUE
-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
-
-extern VALUE rb_lcm(VALUE x, VALUE y);
-
-/*
- * call-seq:
- * cmp.denominator -> integer
- *
- * Returns the denominator (lcm of both denominator, real and imag).
- *
- * See numerator.
- */
-static VALUE
-nucomp_denominator(VALUE self)
-{
- get_dat1(self);
- return rb_lcm(f_denominator(dat->real), f_denominator(dat->imag));
-}
-
-/*
- * call-seq:
- * cmp.numerator -> numeric
- *
- * Returns the numerator.
- *
- * For example:
- *
- * 1 2 3+4i <- numerator
- * - + -i -> ----
- * 2 3 6 <- denominator
- *
- * c = Complex('1/2+2/3i') #=> ((1/2)+(2/3)*i)
- * n = c.numerator #=> (3+4i)
- * d = c.denominator #=> 6
- * n / d #=> ((1/2)+(2/3)*i)
- * Complex(Rational(n.real, d), Rational(n.imag, d))
- * #=> ((1/2)+(2/3)*i)
- * See denominator.
- */
-static VALUE
-nucomp_numerator(VALUE self)
-{
- VALUE cd;
-
- get_dat1(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))),
- f_mul(f_numerator(dat->imag),
- f_div(cd, f_denominator(dat->imag))));
-}
-
-/* :nodoc: */
-static VALUE
-nucomp_hash(VALUE self)
-{
- long v, h[3];
- VALUE n;
-
- get_dat1(self);
- h[0] = rb_hash(rb_obj_class(self));
- n = rb_hash(dat->real);
- h[1] = NUM2LONG(n);
- n = rb_hash(dat->imag);
- h[2] = NUM2LONG(n);
- v = rb_memhash(h, sizeof(h));
- return LONG2FIX(v);
-}
-
-/* :nodoc: */
-static VALUE
-nucomp_eql_p(VALUE self, VALUE other)
-{
- if (k_complex_p(other)) {
- get_dat2(self, other);
-
- return f_boolcast((CLASS_OF(adat->real) == CLASS_OF(bdat->real)) &&
- (CLASS_OF(adat->imag) == CLASS_OF(bdat->imag)) &&
- f_eqeq_p(self, other));
-
- }
- return Qfalse;
-}
-
-#ifndef HAVE_SIGNBIT
-#ifdef signbit
-#define HAVE_SIGNBIT 1
-#endif
-#endif
-
-inline static VALUE
-f_signbit(VALUE x)
-{
- switch (TYPE(x)) {
- case T_FLOAT: {
-#ifdef HAVE_SIGNBIT
- double f = RFLOAT_VALUE(x);
- return f_boolcast(!isnan(f) && signbit(f));
-#else
- char s[2];
- double f = RFLOAT_VALUE(x);
-
- if (isnan(f)) return Qfalse;
- (void)snprintf(s, sizeof s, "%.0f", f);
- return f_boolcast(s[0] == '-');
-#endif
- }
- }
- return f_negative_p(x);
-}
-
-inline static VALUE
-f_tpositive_p(VALUE x)
-{
- return f_boolcast(!f_signbit(x));
-}
-
-static VALUE
-f_format(VALUE self, VALUE (*func)(VALUE))
-{
- VALUE s, impos;
-
- get_dat1(self);
-
- impos = f_tpositive_p(dat->imag);
-
- s = (*func)(dat->real);
- rb_str_cat2(s, !impos ? "-" : "+");
-
- rb_str_concat(s, (*func)(f_abs(dat->imag)));
- if (!rb_isdigit(RSTRING_PTR(s)[RSTRING_LEN(s) - 1]))
- rb_str_cat2(s, "*");
- rb_str_cat2(s, "i");
-
- return s;
-}
-
-/*
- * call-seq:
- * cmp.to_s -> string
- *
- * Returns the value as a string.
- */
-static VALUE
-nucomp_to_s(VALUE self)
-{
- return f_format(self, f_to_s);
-}
-
-/*
- * call-seq:
- * cmp.inspect -> string
- *
- * Returns the value as a string for inspection.
- */
-static VALUE
-nucomp_inspect(VALUE self)
-{
- VALUE s;
-
- s = rb_usascii_str_new2("(");
- rb_str_concat(s, f_format(self, f_inspect));
- rb_str_cat2(s, ")");
-
- return s;
-}
-
-/* :nodoc: */
-static VALUE
-nucomp_marshal_dump(VALUE self)
-{
- VALUE a;
- get_dat1(self);
-
- a = rb_assoc_new(dat->real, dat->imag);
- rb_copy_generic_ivar(a, self);
- return a;
-}
-
-/* :nodoc: */
-static VALUE
-nucomp_marshal_load(VALUE self, VALUE a)
-{
- get_dat1(self);
- dat->real = RARRAY_PTR(a)[0];
- dat->imag = RARRAY_PTR(a)[1];
- rb_copy_generic_ivar(self, a);
- return self;
-}
-
-/* --- */
-
-VALUE
-rb_complex_raw(VALUE x, VALUE y)
-{
- return nucomp_s_new_internal(rb_cComplex, x, y);
-}
-
-VALUE
-rb_complex_new(VALUE x, VALUE y)
-{
- return nucomp_s_canonicalize_internal(rb_cComplex, x, y);
-}
-
-VALUE
-rb_complex_polar(VALUE x, VALUE y)
-{
- return f_complex_polar(rb_cComplex, x, y);
-}
-
-static VALUE nucomp_s_convert(int argc, VALUE *argv, VALUE klass);
-
-VALUE
-rb_Complex(VALUE x, VALUE y)
-{
- VALUE a[2];
- a[0] = x;
- a[1] = y;
- return nucomp_s_convert(2, a, rb_cComplex);
-}
-
-/*
- * call-seq:
- * cmp.to_i -> integer
- *
- * Returns the value as an integer if possible.
- */
-static VALUE
-nucomp_to_i(VALUE self)
-{
- get_dat1(self);
-
- if (k_inexact_p(dat->imag) || f_nonzero_p(dat->imag)) {
- VALUE s = f_to_s(self);
- rb_raise(rb_eRangeError, "can't convert %s into Integer",
- StringValuePtr(s));
- }
- return f_to_i(dat->real);
-}
-
-/*
- * call-seq:
- * cmp.to_f -> float
- *
- * Returns the value as a float if possible.
- */
-static VALUE
-nucomp_to_f(VALUE self)
-{
- get_dat1(self);
-
- if (k_inexact_p(dat->imag) || f_nonzero_p(dat->imag)) {
- VALUE s = f_to_s(self);
- rb_raise(rb_eRangeError, "can't convert %s into Float",
- StringValuePtr(s));
- }
- return f_to_f(dat->real);
-}
-
-/*
- * call-seq:
- * cmp.to_r -> rational
- *
- * Returns the value as a rational if possible.
- */
-static VALUE
-nucomp_to_r(VALUE self)
-{
- get_dat1(self);
-
- if (k_inexact_p(dat->imag) || f_nonzero_p(dat->imag)) {
- VALUE s = f_to_s(self);
- rb_raise(rb_eRangeError, "can't convert %s into Rational",
- StringValuePtr(s));
- }
- return f_to_r(dat->real);
-}
-
-/*
- * call-seq:
- * nil.to_c -> (0+0i)
- *
- * Returns zero as a complex.
- */
-static VALUE
-nilclass_to_c(VALUE self)
-{
- return rb_complex_new1(INT2FIX(0));
-}
-
-/*
- * call-seq:
- * num.to_c -> complex
- *
- * Returns the value as a complex.
- */
-static VALUE
-numeric_to_c(VALUE self)
-{
- return rb_complex_new1(self);
-}
-
-static VALUE comp_pat0, comp_pat1, comp_pat2, a_slash, a_dot_and_an_e,
- null_string, underscores_pat, an_underscore;
-
-#define WS "\\s*"
-#define DIGITS "(?:\\d(?:_\\d|\\d)*)"
-#define NUMERATOR "(?:" DIGITS "?\\.)?" DIGITS "(?:[eE][-+]?" DIGITS ")?"
-#define DENOMINATOR DIGITS
-#define NUMBER "[-+]?" NUMERATOR "(?:\\/" DENOMINATOR ")?"
-#define NUMBERNOS NUMERATOR "(?:\\/" DENOMINATOR ")?"
-#define PATTERN0 "\\A" WS "(" NUMBER ")@(" NUMBER ")" WS
-#define PATTERN1 "\\A" WS "([-+])?(" NUMBER ")?[iIjJ]" WS
-#define PATTERN2 "\\A" WS "(" NUMBER ")(([-+])(" NUMBERNOS ")?[iIjJ])?" WS
-
-static void
-make_patterns(void)
-{
- static const char comp_pat0_source[] = PATTERN0;
- static const char comp_pat1_source[] = PATTERN1;
- static const char comp_pat2_source[] = PATTERN2;
- static const char underscores_pat_source[] = "_+";
-
- if (comp_pat0) return;
-
- comp_pat0 = rb_reg_new(comp_pat0_source, sizeof comp_pat0_source - 1, 0);
- rb_gc_register_mark_object(comp_pat0);
-
- comp_pat1 = rb_reg_new(comp_pat1_source, sizeof comp_pat1_source - 1, 0);
- rb_gc_register_mark_object(comp_pat1);
-
- comp_pat2 = rb_reg_new(comp_pat2_source, sizeof comp_pat2_source - 1, 0);
- rb_gc_register_mark_object(comp_pat2);
-
- a_slash = rb_usascii_str_new2("/");
- rb_gc_register_mark_object(a_slash);
-
- a_dot_and_an_e = rb_usascii_str_new2(".eE");
- rb_gc_register_mark_object(a_dot_and_an_e);
-
- null_string = rb_usascii_str_new2("");
- rb_gc_register_mark_object(null_string);
-
- underscores_pat = rb_reg_new(underscores_pat_source,
- sizeof underscores_pat_source - 1, 0);
- rb_gc_register_mark_object(underscores_pat);
-
- an_underscore = rb_usascii_str_new2("_");
- rb_gc_register_mark_object(an_underscore);
-}
-
-#define id_match rb_intern("match")
-#define f_match(x,y) rb_funcall(x, id_match, 1, y)
-
-#define id_aref rb_intern("[]")
-#define f_aref(x,y) rb_funcall(x, id_aref, 1, y)
-
-#define id_post_match rb_intern("post_match")
-#define f_post_match(x) rb_funcall(x, id_post_match, 0)
-
-#define id_split rb_intern("split")
-#define f_split(x,y) rb_funcall(x, id_split, 1, y)
-
-#define id_include_p rb_intern("include?")
-#define f_include_p(x,y) rb_funcall(x, id_include_p, 1, y)
-
-#define id_count rb_intern("count")
-#define f_count(x,y) rb_funcall(x, id_count, 1, y)
-
-#define id_gsub_bang rb_intern("gsub!")
-#define f_gsub_bang(x,y,z) rb_funcall(x, id_gsub_bang, 2, y, z)
-
-static VALUE
-string_to_c_internal(VALUE self)
-{
- VALUE s;
-
- s = self;
-
- if (RSTRING_LEN(s) == 0)
- return rb_assoc_new(Qnil, self);
-
- {
- VALUE m, sr, si, re, r, i;
- int po;
-
- m = f_match(comp_pat0, s);
- if (!NIL_P(m)) {
- sr = f_aref(m, INT2FIX(1));
- si = f_aref(m, INT2FIX(2));
- re = f_post_match(m);
- po = 1;
- }
- if (NIL_P(m)) {
- m = f_match(comp_pat1, s);
- if (!NIL_P(m)) {
- sr = Qnil;
- si = f_aref(m, INT2FIX(1));
- if (NIL_P(si))
- si = rb_usascii_str_new2("");
- {
- VALUE t;
-
- t = f_aref(m, INT2FIX(2));
- if (NIL_P(t))
- t = rb_usascii_str_new2("1");
- rb_str_concat(si, t);
- }
- re = f_post_match(m);
- po = 0;
- }
- }
- if (NIL_P(m)) {
- m = f_match(comp_pat2, s);
- if (NIL_P(m))
- return rb_assoc_new(Qnil, self);
- sr = f_aref(m, INT2FIX(1));
- if (NIL_P(f_aref(m, INT2FIX(2))))
- si = Qnil;
- else {
- VALUE t;
-
- si = f_aref(m, INT2FIX(3));
- t = f_aref(m, INT2FIX(4));
- if (NIL_P(t))
- t = rb_usascii_str_new2("1");
- rb_str_concat(si, t);
- }
- re = f_post_match(m);
- po = 0;
- }
- r = INT2FIX(0);
- i = INT2FIX(0);
- if (!NIL_P(sr)) {
- if (f_include_p(sr, a_slash))
- r = f_to_r(sr);
- else if (f_gt_p(f_count(sr, a_dot_and_an_e), INT2FIX(0)))
- r = f_to_f(sr);
- else
- r = f_to_i(sr);
- }
- if (!NIL_P(si)) {
- if (f_include_p(si, a_slash))
- i = f_to_r(si);
- else if (f_gt_p(f_count(si, a_dot_and_an_e), INT2FIX(0)))
- i = f_to_f(si);
- else
- i = f_to_i(si);
- }
- if (po)
- return rb_assoc_new(rb_complex_polar(r, i), re);
- else
- return rb_assoc_new(rb_complex_new2(r, i), re);
- }
-}
-
-static VALUE
-string_to_c_strict(VALUE self)
-{
- VALUE a = string_to_c_internal(self);
- if (NIL_P(RARRAY_PTR(a)[0]) || RSTRING_LEN(RARRAY_PTR(a)[1]) > 0) {
- VALUE s = f_inspect(self);
- rb_raise(rb_eArgError, "invalid value for convert(): %s",
- StringValuePtr(s));
- }
- return RARRAY_PTR(a)[0];
-}
-
-#define id_gsub rb_intern("gsub")
-#define f_gsub(x,y,z) rb_funcall(x, id_gsub, 2, y, z)
-
-/*
- * call-seq:
- * str.to_c -> complex
- *
- * Returns a complex which denotes the string form. The parser
- * ignores leading whitespaces and trailing garbage. Any digit
- * sequences can be separeted by an underscore. Returns zero for null
- * or garbage string.
- *
- * For example:
- *
- * '9'.to_c #=> (9+0i)
- * '2.5'.to_c #=> (2.5+0i)
- * '2.5/1'.to_c #=> ((5/2)+0i)
- * '-3/2'.to_c #=> ((-3/2)+0i)
- * '-i'.to_c #=> (0-1i)
- * '45i'.to_c #=> (0+45i)
- * '3-4i'.to_c #=> (3-4i)
- * '-4e2-4e-2i'.to_c #=> (-400.0-0.04i)
- * '-0.0-0.0i'.to_c #=> (-0.0-0.0i)
- * '1/2+3/4i'.to_c #=> ((1/2)+(3/4)*i)
- * 'ruby'.to_c #=> (0+0i)
- */
-static VALUE
-string_to_c(VALUE self)
-{
- VALUE s, a, backref;
-
- backref = rb_backref_get();
- rb_match_busy(backref);
-
- s = f_gsub(self, underscores_pat, an_underscore);
- a = string_to_c_internal(s);
-
- rb_backref_set(backref);
-
- if (!NIL_P(RARRAY_PTR(a)[0]))
- return RARRAY_PTR(a)[0];
- return rb_complex_new1(INT2FIX(0));
-}
-
-static VALUE
-nucomp_s_convert(int argc, VALUE *argv, VALUE klass)
-{
- VALUE a1, a2, backref;
-
- 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);
-
- switch (TYPE(a1)) {
- case T_FIXNUM:
- case T_BIGNUM:
- case T_FLOAT:
- break;
- case T_STRING:
- a1 = string_to_c_strict(a1);
- break;
- }
-
- switch (TYPE(a2)) {
- case T_FIXNUM:
- case T_BIGNUM:
- case T_FLOAT:
- break;
- case T_STRING:
- a2 = string_to_c_strict(a2);
- break;
- }
-
- rb_backref_set(backref);
-
- switch (TYPE(a1)) {
- case T_COMPLEX:
- {
- get_dat1(a1);
-
- if (k_exact_zero_p(dat->imag))
- a1 = dat->real;
- }
- }
-
- switch (TYPE(a2)) {
- case T_COMPLEX:
- {
- get_dat1(a2);
-
- if (k_exact_zero_p(dat->imag))
- a2 = dat->real;
- }
- }
-
- switch (TYPE(a1)) {
- case T_COMPLEX:
- if (argc == 1 || (k_exact_zero_p(a2)))
- return a1;
- }
-
- if (argc == 1) {
- if (k_numeric_p(a1) && !f_real_p(a1))
- return a1;
- /* expect raise exception for consistency */
- 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)) &&
- (!f_real_p(a1) || !f_real_p(a2)))
- return f_add(a1,
- f_mul(a2,
- f_complex_new_bang2(rb_cComplex, ZERO, ONE)));
- }
-
- {
- VALUE argv2[2];
- argv2[0] = a1;
- argv2[1] = a2;
- return nucomp_s_new(argc, argv2, klass);
- }
-}
-
-/* --- */
-
-/*
- * call-seq:
- * num.real -> self
- *
- * Returns self.
- */
-static VALUE
-numeric_real(VALUE self)
-{
- return self;
-}
-
-/*
- * call-seq:
- * num.imag -> 0
- * num.imaginary -> 0
- *
- * Returns zero.
- */
-static VALUE
-numeric_imag(VALUE self)
-{
- return INT2FIX(0);
-}
-
-/*
- * call-seq:
- * num.abs2 -> real
- *
- * Returns square of self.
- */
-static VALUE
-numeric_abs2(VALUE self)
-{
- return f_mul(self, self);
-}
-
-#define id_PI rb_intern("PI")
-
-/*
- * call-seq:
- * num.arg -> 0 or float
- * num.angle -> 0 or float
- * num.phase -> 0 or float
- *
- * Returns 0 if the value is positive, pi otherwise.
- */
-static VALUE
-numeric_arg(VALUE self)
-{
- if (f_positive_p(self))
- return INT2FIX(0);
- return rb_const_get(rb_mMath, id_PI);
-}
-
-/*
- * call-seq:
- * num.rect -> array
- *
- * Returns an array; [num, 0].
- */
-static VALUE
-numeric_rect(VALUE self)
-{
- return rb_assoc_new(self, INT2FIX(0));
-}
-
-/*
- * call-seq:
- * num.polar -> array
- *
- * Returns an array; [num.abs, num.arg].
- */
-static VALUE
-numeric_polar(VALUE self)
-{
- return rb_assoc_new(f_abs(self), f_arg(self));
-}
-
-/*
- * call-seq:
- * num.conj -> self
- * num.conjucate -> self
- *
- * Returns self.
- */
-static VALUE
-numeric_conj(VALUE self)
-{
- return self;
-}
-
-/*
- * call-seq:
- * flo.arg -> 0 or float
- * flo.angle -> 0 or float
- * flo.phase -> 0 or float
- *
- * Returns 0 if the value is positive, pi otherwise.
- */
-static VALUE
-float_arg(VALUE self)
-{
- if (isnan(RFLOAT_VALUE(self)))
- return self;
- if (f_tpositive_p(self))
- return INT2FIX(0);
- return rb_const_get(rb_mMath, id_PI);
-}
-
-/*
- * A complex number can be represented as a paired real number with
- * imaginary unit; a+bi. Where a is real part, b is imaginary part
- * and i is imaginary unit. Real a equals complex a+0i
- * mathematically.
- *
- * In ruby, you can create complex object with Complex, Complex::rect,
- * Complex::polar or to_c method.
- *
- * Complex(1) #=> (1+0i)
- * Complex(2, 3) #=> (2+3i)
- * Complex.polar(2, 3) #=> (-1.9799849932008908+0.2822400161197344i)
- * 3.to_c #=> (3+0i)
- *
- * You can also create complex object from floating-point numbers or
- * strings.
- *
- * Complex(0.3) #=> (0.3+0i)
- * Complex('0.3-0.5i') #=> (0.3-0.5i)
- * Complex('2/3+3/4i') #=> ((2/3)+(3/4)*i)
- * Complex('1@2') #=> (-0.4161468365471424+0.9092974268256817i)
- *
- * 0.3.to_c #=> (0.3+0i)
- * '0.3-0.5i'.to_c #=> (0.3-0.5i)
- * '2/3+3/4i'.to_c #=> ((2/3)+(3/4)*i)
- * '1@2'.to_c #=> (-0.4161468365471424+0.9092974268256817i)
- *
- * A complex object is either an exact or an inexact number.
- *
- * Complex(1, 1) / 2 #=> ((1/2)+(1/2)*i)
- * Complex(1, 1) / 2.0 #=> (0.5+0.5i)
- */
-void
-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_abs2 = rb_intern("abs2");
- id_arg = rb_intern("arg");
- id_cmp = rb_intern("<=>");
- id_conj = rb_intern("conj");
- id_convert = rb_intern("convert");
- id_denominator = rb_intern("denominator");
- id_divmod = rb_intern("divmod");
- id_eqeq_p = rb_intern("==");
- id_expt = rb_intern("**");
- id_fdiv = rb_intern("fdiv");
- id_floor = rb_intern("floor");
- id_idiv = rb_intern("div");
- id_imag = rb_intern("imag");
- id_inspect = rb_intern("inspect");
- id_negate = rb_intern("-@");
- id_numerator = rb_intern("numerator");
- id_quo = rb_intern("quo");
- id_real = rb_intern("real");
- id_real_p = rb_intern("real?");
- id_to_f = rb_intern("to_f");
- id_to_i = rb_intern("to_i");
- id_to_r = rb_intern("to_r");
- id_to_s = rb_intern("to_s");
-
- 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);
- rb_define_singleton_method(rb_cComplex, "polar", nucomp_s_polar, -1);
-
- rb_define_global_function("Complex", nucomp_f_complex, -1);
-
- 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");
- rb_undef_method(rb_cComplex, "ceil");
- rb_undef_method(rb_cComplex, "modulo");
- rb_undef_method(rb_cComplex, "remainder");
- rb_undef_method(rb_cComplex, "round");
- rb_undef_method(rb_cComplex, "step");
- rb_undef_method(rb_cComplex, "truncate");
-
-#if 0 /* NUBY */
- rb_undef_method(rb_cComplex, "//");
-#endif
-
- rb_define_method(rb_cComplex, "real", nucomp_real, 0);
- rb_define_method(rb_cComplex, "imaginary", nucomp_imag, 0);
- rb_define_method(rb_cComplex, "imag", nucomp_imag, 0);
-
- rb_define_method(rb_cComplex, "-@", nucomp_negate, 0);
- rb_define_method(rb_cComplex, "+", 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, "**", nucomp_expt, 1);
-
- rb_define_method(rb_cComplex, "==", nucomp_eqeq_p, 1);
- rb_define_method(rb_cComplex, "coerce", nucomp_coerce, 1);
-
- 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", 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", 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);
-
- rb_define_method(rb_cComplex, "hash", nucomp_hash, 0);
- rb_define_method(rb_cComplex, "eql?", nucomp_eql_p, 1);
-
- rb_define_method(rb_cComplex, "to_s", nucomp_to_s, 0);
- rb_define_method(rb_cComplex, "inspect", nucomp_inspect, 0);
-
- rb_define_method(rb_cComplex, "marshal_dump", nucomp_marshal_dump, 0);
- rb_define_method(rb_cComplex, "marshal_load", nucomp_marshal_load, 1);
-
- /* --- */
-
- rb_define_method(rb_cComplex, "to_i", nucomp_to_i, 0);
- rb_define_method(rb_cComplex, "to_f", nucomp_to_f, 0);
- rb_define_method(rb_cComplex, "to_r", nucomp_to_r, 0);
- rb_define_method(rb_cNilClass, "to_c", nilclass_to_c, 0);
- rb_define_method(rb_cNumeric, "to_c", numeric_to_c, 0);
-
- make_patterns();
-
- rb_define_method(rb_cString, "to_c", string_to_c, 0);
-
- rb_define_private_method(CLASS_OF(rb_cComplex), "convert", nucomp_s_convert, -1);
-
- /* --- */
-
- rb_define_method(rb_cNumeric, "real", numeric_real, 0);
- rb_define_method(rb_cNumeric, "imaginary", numeric_imag, 0);
- rb_define_method(rb_cNumeric, "imag", numeric_imag, 0);
- rb_define_method(rb_cNumeric, "abs2", numeric_abs2, 0);
- rb_define_method(rb_cNumeric, "arg", numeric_arg, 0);
- rb_define_method(rb_cNumeric, "angle", numeric_arg, 0);
- rb_define_method(rb_cNumeric, "phase", numeric_arg, 0);
- rb_define_method(rb_cNumeric, "rectangular", numeric_rect, 0);
- rb_define_method(rb_cNumeric, "rect", numeric_rect, 0);
- rb_define_method(rb_cNumeric, "polar", numeric_polar, 0);
- rb_define_method(rb_cNumeric, "conjugate", numeric_conj, 0);
- rb_define_method(rb_cNumeric, "conj", numeric_conj, 0);
-
- rb_define_method(rb_cFloat, "arg", float_arg, 0);
- rb_define_method(rb_cFloat, "angle", float_arg, 0);
- rb_define_method(rb_cFloat, "phase", float_arg, 0);
-
- rb_define_const(rb_cComplex, "I",
- f_complex_new_bang2(rb_cComplex, ZERO, ONE));
-}
-
-/*
-Local variables:
-c-file-style: "ruby"
-End:
-*/
diff --git a/config.guess b/config.guess
new file mode 100644
index 0000000000..dd1688b7b5
--- /dev/null
+++ b/config.guess
@@ -0,0 +1,1459 @@
+#! /bin/sh
+# Attempt to guess a canonical system name.
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+# 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+
+timestamp='2004-06-11'
+
+# 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 2 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.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# As a special exception 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.
+
+# Originally written by Per Bothner <per@bothner.com>.
+# Please send patches to <config-patches@gnu.org>. Submit a context
+# diff and a properly formatted ChangeLog entry.
+#
+# This script attempts to guess a canonical system name similar to
+# config.sub. If it succeeds, it prints the system name on stdout, and
+# exits with 0. Otherwise, it exits with 1.
+#
+# The plan is that this can be called by configure scripts if you
+# don't specify an explicit build system type.
+
+me=`echo "$0" | sed -e 's,.*/,,'`
+
+usage="\
+Usage: $0 [OPTION]
+
+Output the configuration name of the system \`$me' is run on.
+
+Operation modes:
+ -h, --help print this help, then exit
+ -t, --time-stamp print date of last modification, then exit
+ -v, --version print version number, then exit
+
+Report bugs and patches to <config-patches@gnu.org>."
+
+version="\
+GNU config.guess ($timestamp)
+
+Originally written by Per Bothner.
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
+Free Software Foundation, Inc.
+
+This is free software; see the source for copying conditions. There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+help="
+Try \`$me --help' for more information."
+
+# Parse command line
+while test $# -gt 0 ; do
+ case $1 in
+ --time-stamp | --time* | -t )
+ echo "$timestamp" ; exit 0 ;;
+ --version | -v )
+ echo "$version" ; exit 0 ;;
+ --help | --h* | -h )
+ echo "$usage"; exit 0 ;;
+ -- ) # Stop option processing
+ shift; break ;;
+ - ) # Use stdin as input.
+ break ;;
+ -* )
+ echo "$me: invalid option $1$help" >&2
+ exit 1 ;;
+ * )
+ break ;;
+ esac
+done
+
+if test $# != 0; then
+ echo "$me: too many arguments$help" >&2
+ exit 1
+fi
+
+trap 'exit 1' 1 2 15
+
+# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
+# compiler to aid in system detection is discouraged as it requires
+# temporary files to be created and, as you can see below, it is a
+# headache to deal with in a portable fashion.
+
+# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
+# use `HOST_CC' if defined, but it is deprecated.
+
+# Portable tmp directory creation inspired by the Autoconf team.
+
+set_cc_for_build='
+trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
+trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
+: ${TMPDIR=/tmp} ;
+ { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
+ { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
+ { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
+ { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
+dummy=$tmp/dummy ;
+tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
+case $CC_FOR_BUILD,$HOST_CC,$CC in
+ ,,) echo "int x;" > $dummy.c ;
+ for c in cc gcc c89 c99 ; do
+ if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
+ CC_FOR_BUILD="$c"; break ;
+ fi ;
+ done ;
+ if test x"$CC_FOR_BUILD" = x ; then
+ CC_FOR_BUILD=no_compiler_found ;
+ fi
+ ;;
+ ,,*) CC_FOR_BUILD=$CC ;;
+ ,*,*) CC_FOR_BUILD=$HOST_CC ;;
+esac ;'
+
+# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
+# (ghazi@noc.rutgers.edu 1994-08-24)
+if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
+ PATH=$PATH:/.attbin ; export PATH
+fi
+
+UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
+UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
+UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
+UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
+
+# Note: order is significant - the case branches are not exclusive.
+
+case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+ *:NetBSD:*:*)
+ # NetBSD (nbsd) targets should (where applicable) match one or
+ # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
+ # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
+ # switched to ELF, *-*-netbsd* would select the old
+ # object file format. This provides both forward
+ # compatibility and a consistent mechanism for selecting the
+ # object file format.
+ #
+ # Note: NetBSD doesn't particularly care about the vendor
+ # portion of the name. We always set it to "unknown".
+ sysctl="sysctl -n hw.machine_arch"
+ UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
+ /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
+ case "${UNAME_MACHINE_ARCH}" in
+ armeb) machine=armeb-unknown ;;
+ arm*) machine=arm-unknown ;;
+ sh3el) machine=shl-unknown ;;
+ sh3eb) machine=sh-unknown ;;
+ *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
+ esac
+ # The Operating System including object format, if it has switched
+ # to ELF recently, or will in the future.
+ case "${UNAME_MACHINE_ARCH}" in
+ arm*|i386|m68k|ns32k|sh3*|sparc|vax)
+ eval $set_cc_for_build
+ if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
+ | grep __ELF__ >/dev/null
+ then
+ # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
+ # Return netbsd for either. FIX?
+ os=netbsd
+ else
+ os=netbsdelf
+ fi
+ ;;
+ *)
+ os=netbsd
+ ;;
+ esac
+ # The OS release
+ # Debian GNU/NetBSD machines have a different userland, and
+ # thus, need a distinct triplet. However, they do not need
+ # kernel version information, so it can be replaced with a
+ # suitable tag, in the style of linux-gnu.
+ case "${UNAME_VERSION}" in
+ Debian*)
+ release='-gnu'
+ ;;
+ *)
+ release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
+ ;;
+ esac
+ # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
+ # contains redundant information, the shorter form:
+ # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
+ echo "${machine}-${os}${release}"
+ exit 0 ;;
+ amd64:OpenBSD:*:*)
+ echo x86_64-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ amiga:OpenBSD:*:*)
+ echo m68k-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ arc:OpenBSD:*:*)
+ echo mipsel-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ cats:OpenBSD:*:*)
+ echo arm-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ hp300:OpenBSD:*:*)
+ echo m68k-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ luna88k:OpenBSD:*:*)
+ echo m88k-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ mac68k:OpenBSD:*:*)
+ echo m68k-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ macppc:OpenBSD:*:*)
+ echo powerpc-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ mvme68k:OpenBSD:*:*)
+ echo m68k-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ mvme88k:OpenBSD:*:*)
+ echo m88k-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ mvmeppc:OpenBSD:*:*)
+ echo powerpc-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ pmax:OpenBSD:*:*)
+ echo mipsel-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ sgi:OpenBSD:*:*)
+ echo mipseb-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ sun3:OpenBSD:*:*)
+ echo m68k-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ wgrisc:OpenBSD:*:*)
+ echo mipsel-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ *:OpenBSD:*:*)
+ echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ *:ekkoBSD:*:*)
+ echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
+ exit 0 ;;
+ macppc:MirBSD:*:*)
+ echo powerppc-unknown-mirbsd${UNAME_RELEASE}
+ exit 0 ;;
+ *:MirBSD:*:*)
+ echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
+ exit 0 ;;
+ alpha:OSF1:*:*)
+ case $UNAME_RELEASE in
+ *4.0)
+ UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
+ ;;
+ *5.*)
+ UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
+ ;;
+ esac
+ # According to Compaq, /usr/sbin/psrinfo has been available on
+ # OSF/1 and Tru64 systems produced since 1995. I hope that
+ # covers most systems running today. This code pipes the CPU
+ # types through head -n 1, so we only detect the type of CPU 0.
+ ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
+ case "$ALPHA_CPU_TYPE" in
+ "EV4 (21064)")
+ UNAME_MACHINE="alpha" ;;
+ "EV4.5 (21064)")
+ UNAME_MACHINE="alpha" ;;
+ "LCA4 (21066/21068)")
+ UNAME_MACHINE="alpha" ;;
+ "EV5 (21164)")
+ UNAME_MACHINE="alphaev5" ;;
+ "EV5.6 (21164A)")
+ UNAME_MACHINE="alphaev56" ;;
+ "EV5.6 (21164PC)")
+ UNAME_MACHINE="alphapca56" ;;
+ "EV5.7 (21164PC)")
+ UNAME_MACHINE="alphapca57" ;;
+ "EV6 (21264)")
+ UNAME_MACHINE="alphaev6" ;;
+ "EV6.7 (21264A)")
+ UNAME_MACHINE="alphaev67" ;;
+ "EV6.8CB (21264C)")
+ UNAME_MACHINE="alphaev68" ;;
+ "EV6.8AL (21264B)")
+ UNAME_MACHINE="alphaev68" ;;
+ "EV6.8CX (21264D)")
+ UNAME_MACHINE="alphaev68" ;;
+ "EV6.9A (21264/EV69A)")
+ UNAME_MACHINE="alphaev69" ;;
+ "EV7 (21364)")
+ UNAME_MACHINE="alphaev7" ;;
+ "EV7.9 (21364A)")
+ UNAME_MACHINE="alphaev79" ;;
+ esac
+ # A Pn.n version is a patched version.
+ # A Vn.n version is a released version.
+ # A Tn.n version is a released field test version.
+ # A Xn.n version is an unreleased experimental baselevel.
+ # 1.2 uses "1.2" for uname -r.
+ echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+ exit 0 ;;
+ Alpha*:OpenVMS:*:*)
+ echo alpha-hp-vms
+ exit 0 ;;
+ Alpha\ *:Windows_NT*:*)
+ # How do we know it's Interix rather than the generic POSIX subsystem?
+ # Should we change UNAME_MACHINE based on the output of uname instead
+ # of the specific Alpha model?
+ echo alpha-pc-interix
+ exit 0 ;;
+ 21064:Windows_NT:50:3)
+ echo alpha-dec-winnt3.5
+ exit 0 ;;
+ Amiga*:UNIX_System_V:4.0:*)
+ echo m68k-unknown-sysv4
+ exit 0;;
+ *:[Aa]miga[Oo][Ss]:*:*)
+ echo ${UNAME_MACHINE}-unknown-amigaos
+ exit 0 ;;
+ *:[Mm]orph[Oo][Ss]:*:*)
+ echo ${UNAME_MACHINE}-unknown-morphos
+ exit 0 ;;
+ *:OS/390:*:*)
+ echo i370-ibm-openedition
+ exit 0 ;;
+ *:OS400:*:*)
+ echo powerpc-ibm-os400
+ exit 0 ;;
+ arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
+ echo arm-acorn-riscix${UNAME_RELEASE}
+ exit 0;;
+ SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
+ echo hppa1.1-hitachi-hiuxmpp
+ exit 0;;
+ Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
+ # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
+ if test "`(/bin/universe) 2>/dev/null`" = att ; then
+ echo pyramid-pyramid-sysv3
+ else
+ echo pyramid-pyramid-bsd
+ fi
+ exit 0 ;;
+ NILE*:*:*:dcosx)
+ echo pyramid-pyramid-svr4
+ exit 0 ;;
+ DRS?6000:unix:4.0:6*)
+ echo sparc-icl-nx6
+ exit 0 ;;
+ DRS?6000:UNIX_SV:4.2*:7*)
+ case `/usr/bin/uname -p` in
+ sparc) echo sparc-icl-nx7 && exit 0 ;;
+ esac ;;
+ sun4H:SunOS:5.*:*)
+ echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit 0 ;;
+ sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
+ echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit 0 ;;
+ i86pc:SunOS:5.*:*)
+ echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit 0 ;;
+ sun4*:SunOS:6*:*)
+ # According to config.sub, this is the proper way to canonicalize
+ # SunOS6. Hard to guess exactly what SunOS6 will be like, but
+ # it's likely to be more like Solaris than SunOS4.
+ echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit 0 ;;
+ sun4*:SunOS:*:*)
+ case "`/usr/bin/arch -k`" in
+ Series*|S4*)
+ UNAME_RELEASE=`uname -v`
+ ;;
+ esac
+ # Japanese Language versions have a version number like `4.1.3-JL'.
+ echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
+ exit 0 ;;
+ sun3*:SunOS:*:*)
+ echo m68k-sun-sunos${UNAME_RELEASE}
+ exit 0 ;;
+ sun*:*:4.2BSD:*)
+ UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
+ test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
+ case "`/bin/arch`" in
+ sun3)
+ echo m68k-sun-sunos${UNAME_RELEASE}
+ ;;
+ sun4)
+ echo sparc-sun-sunos${UNAME_RELEASE}
+ ;;
+ esac
+ exit 0 ;;
+ aushp:SunOS:*:*)
+ echo sparc-auspex-sunos${UNAME_RELEASE}
+ exit 0 ;;
+ # The situation for MiNT is a little confusing. The machine name
+ # can be virtually everything (everything which is not
+ # "atarist" or "atariste" at least should have a processor
+ # > m68000). The system name ranges from "MiNT" over "FreeMiNT"
+ # to the lowercase version "mint" (or "freemint"). Finally
+ # the system name "TOS" denotes a system which is actually not
+ # MiNT. But MiNT is downward compatible to TOS, so this should
+ # be no problem.
+ atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
+ echo m68k-atari-mint${UNAME_RELEASE}
+ exit 0 ;;
+ atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
+ echo m68k-atari-mint${UNAME_RELEASE}
+ exit 0 ;;
+ *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
+ echo m68k-atari-mint${UNAME_RELEASE}
+ exit 0 ;;
+ milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
+ echo m68k-milan-mint${UNAME_RELEASE}
+ exit 0 ;;
+ hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
+ echo m68k-hades-mint${UNAME_RELEASE}
+ exit 0 ;;
+ *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
+ echo m68k-unknown-mint${UNAME_RELEASE}
+ exit 0 ;;
+ m68k:machten:*:*)
+ echo m68k-apple-machten${UNAME_RELEASE}
+ exit 0 ;;
+ powerpc:machten:*:*)
+ echo powerpc-apple-machten${UNAME_RELEASE}
+ exit 0 ;;
+ RISC*:Mach:*:*)
+ echo mips-dec-mach_bsd4.3
+ exit 0 ;;
+ RISC*:ULTRIX:*:*)
+ echo mips-dec-ultrix${UNAME_RELEASE}
+ exit 0 ;;
+ VAX*:ULTRIX*:*:*)
+ echo vax-dec-ultrix${UNAME_RELEASE}
+ exit 0 ;;
+ 2020:CLIX:*:* | 2430:CLIX:*:*)
+ echo clipper-intergraph-clix${UNAME_RELEASE}
+ exit 0 ;;
+ mips:*:*:UMIPS | mips:*:*:RISCos)
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+#ifdef __cplusplus
+#include <stdio.h> /* for printf() prototype */
+ int main (int argc, char *argv[]) {
+#else
+ int main (argc, argv) int argc; char *argv[]; {
+#endif
+ #if defined (host_mips) && defined (MIPSEB)
+ #if defined (SYSTYPE_SYSV)
+ printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
+ #endif
+ #if defined (SYSTYPE_SVR4)
+ printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
+ #endif
+ #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
+ printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
+ #endif
+ #endif
+ exit (-1);
+ }
+EOF
+ $CC_FOR_BUILD -o $dummy $dummy.c \
+ && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
+ && exit 0
+ echo mips-mips-riscos${UNAME_RELEASE}
+ exit 0 ;;
+ Motorola:PowerMAX_OS:*:*)
+ echo powerpc-motorola-powermax
+ exit 0 ;;
+ Motorola:*:4.3:PL8-*)
+ echo powerpc-harris-powermax
+ exit 0 ;;
+ Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
+ echo powerpc-harris-powermax
+ exit 0 ;;
+ Night_Hawk:Power_UNIX:*:*)
+ echo powerpc-harris-powerunix
+ exit 0 ;;
+ m88k:CX/UX:7*:*)
+ echo m88k-harris-cxux7
+ exit 0 ;;
+ m88k:*:4*:R4*)
+ echo m88k-motorola-sysv4
+ exit 0 ;;
+ m88k:*:3*:R3*)
+ echo m88k-motorola-sysv3
+ exit 0 ;;
+ AViiON:dgux:*:*)
+ # DG/UX returns AViiON for all architectures
+ UNAME_PROCESSOR=`/usr/bin/uname -p`
+ if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
+ then
+ if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
+ [ ${TARGET_BINARY_INTERFACE}x = x ]
+ then
+ echo m88k-dg-dgux${UNAME_RELEASE}
+ else
+ echo m88k-dg-dguxbcs${UNAME_RELEASE}
+ fi
+ else
+ echo i586-dg-dgux${UNAME_RELEASE}
+ fi
+ exit 0 ;;
+ M88*:DolphinOS:*:*) # DolphinOS (SVR3)
+ echo m88k-dolphin-sysv3
+ exit 0 ;;
+ M88*:*:R3*:*)
+ # Delta 88k system running SVR3
+ echo m88k-motorola-sysv3
+ exit 0 ;;
+ XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
+ echo m88k-tektronix-sysv3
+ exit 0 ;;
+ Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
+ echo m68k-tektronix-bsd
+ exit 0 ;;
+ *:IRIX*:*:*)
+ echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
+ exit 0 ;;
+ ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
+ echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
+ exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX '
+ i*86:AIX:*:*)
+ echo i386-ibm-aix
+ exit 0 ;;
+ ia64:AIX:*:*)
+ if [ -x /usr/bin/oslevel ] ; then
+ IBM_REV=`/usr/bin/oslevel`
+ else
+ IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+ fi
+ echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
+ exit 0 ;;
+ *:AIX:2:3)
+ if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #include <sys/systemcfg.h>
+
+ main()
+ {
+ if (!__power_pc())
+ exit(1);
+ puts("powerpc-ibm-aix3.2.5");
+ exit(0);
+ }
+EOF
+ $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
+ echo rs6000-ibm-aix3.2.5
+ elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
+ echo rs6000-ibm-aix3.2.4
+ else
+ echo rs6000-ibm-aix3.2
+ fi
+ exit 0 ;;
+ *:AIX:*:[45])
+ IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
+ if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
+ IBM_ARCH=rs6000
+ else
+ IBM_ARCH=powerpc
+ fi
+ if [ -x /usr/bin/oslevel ] ; then
+ IBM_REV=`/usr/bin/oslevel`
+ else
+ IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+ fi
+ echo ${IBM_ARCH}-ibm-aix${IBM_REV}
+ exit 0 ;;
+ *:AIX:*:*)
+ echo rs6000-ibm-aix
+ exit 0 ;;
+ ibmrt:4.4BSD:*|romp-ibm:BSD:*)
+ echo romp-ibm-bsd4.4
+ exit 0 ;;
+ ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
+ echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
+ exit 0 ;; # report: romp-ibm BSD 4.3
+ *:BOSX:*:*)
+ echo rs6000-bull-bosx
+ exit 0 ;;
+ DPX/2?00:B.O.S.:*:*)
+ echo m68k-bull-sysv3
+ exit 0 ;;
+ 9000/[34]??:4.3bsd:1.*:*)
+ echo m68k-hp-bsd
+ exit 0 ;;
+ hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
+ echo m68k-hp-bsd4.4
+ exit 0 ;;
+ 9000/[34678]??:HP-UX:*:*)
+ HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
+ case "${UNAME_MACHINE}" in
+ 9000/31? ) HP_ARCH=m68000 ;;
+ 9000/[34]?? ) HP_ARCH=m68k ;;
+ 9000/[678][0-9][0-9])
+ if [ -x /usr/bin/getconf ]; then
+ sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
+ sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
+ case "${sc_cpu_version}" in
+ 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
+ 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
+ 532) # CPU_PA_RISC2_0
+ case "${sc_kernel_bits}" in
+ 32) HP_ARCH="hppa2.0n" ;;
+ 64) HP_ARCH="hppa2.0w" ;;
+ '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
+ esac ;;
+ esac
+ fi
+ if [ "${HP_ARCH}" = "" ]; then
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+
+ #define _HPUX_SOURCE
+ #include <stdlib.h>
+ #include <unistd.h>
+
+ int main ()
+ {
+ #if defined(_SC_KERNEL_BITS)
+ long bits = sysconf(_SC_KERNEL_BITS);
+ #endif
+ long cpu = sysconf (_SC_CPU_VERSION);
+
+ switch (cpu)
+ {
+ case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
+ case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
+ case CPU_PA_RISC2_0:
+ #if defined(_SC_KERNEL_BITS)
+ switch (bits)
+ {
+ case 64: puts ("hppa2.0w"); break;
+ case 32: puts ("hppa2.0n"); break;
+ default: puts ("hppa2.0"); break;
+ } break;
+ #else /* !defined(_SC_KERNEL_BITS) */
+ puts ("hppa2.0"); break;
+ #endif
+ default: puts ("hppa1.0"); break;
+ }
+ exit (0);
+ }
+EOF
+ (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
+ test -z "$HP_ARCH" && HP_ARCH=hppa
+ fi ;;
+ esac
+ if [ ${HP_ARCH} = "hppa2.0w" ]
+ then
+ # avoid double evaluation of $set_cc_for_build
+ test -n "$CC_FOR_BUILD" || eval $set_cc_for_build
+ if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null
+ then
+ HP_ARCH="hppa2.0w"
+ else
+ HP_ARCH="hppa64"
+ fi
+ fi
+ echo ${HP_ARCH}-hp-hpux${HPUX_REV}
+ exit 0 ;;
+ ia64:HP-UX:*:*)
+ HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
+ echo ia64-hp-hpux${HPUX_REV}
+ exit 0 ;;
+ 3050*:HI-UX:*:*)
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #include <unistd.h>
+ int
+ main ()
+ {
+ long cpu = sysconf (_SC_CPU_VERSION);
+ /* The order matters, because CPU_IS_HP_MC68K erroneously returns
+ true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct
+ results, however. */
+ if (CPU_IS_PA_RISC (cpu))
+ {
+ switch (cpu)
+ {
+ case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
+ case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
+ case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
+ default: puts ("hppa-hitachi-hiuxwe2"); break;
+ }
+ }
+ else if (CPU_IS_HP_MC68K (cpu))
+ puts ("m68k-hitachi-hiuxwe2");
+ else puts ("unknown-hitachi-hiuxwe2");
+ exit (0);
+ }
+EOF
+ $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
+ echo unknown-hitachi-hiuxwe2
+ exit 0 ;;
+ 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
+ echo hppa1.1-hp-bsd
+ exit 0 ;;
+ 9000/8??:4.3bsd:*:*)
+ echo hppa1.0-hp-bsd
+ exit 0 ;;
+ *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
+ echo hppa1.0-hp-mpeix
+ exit 0 ;;
+ hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
+ echo hppa1.1-hp-osf
+ exit 0 ;;
+ hp8??:OSF1:*:*)
+ echo hppa1.0-hp-osf
+ exit 0 ;;
+ i*86:OSF1:*:*)
+ if [ -x /usr/sbin/sysversion ] ; then
+ echo ${UNAME_MACHINE}-unknown-osf1mk
+ else
+ echo ${UNAME_MACHINE}-unknown-osf1
+ fi
+ exit 0 ;;
+ parisc*:Lites*:*:*)
+ echo hppa1.1-hp-lites
+ exit 0 ;;
+ C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
+ echo c1-convex-bsd
+ exit 0 ;;
+ C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
+ if getsysinfo -f scalar_acc
+ then echo c32-convex-bsd
+ else echo c2-convex-bsd
+ fi
+ exit 0 ;;
+ C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
+ echo c34-convex-bsd
+ exit 0 ;;
+ C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
+ echo c38-convex-bsd
+ exit 0 ;;
+ C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
+ echo c4-convex-bsd
+ exit 0 ;;
+ CRAY*Y-MP:*:*:*)
+ echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit 0 ;;
+ CRAY*[A-Z]90:*:*:*)
+ echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
+ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
+ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
+ -e 's/\.[^.]*$/.X/'
+ exit 0 ;;
+ CRAY*TS:*:*:*)
+ echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit 0 ;;
+ CRAY*T3E:*:*:*)
+ echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit 0 ;;
+ CRAY*SV1:*:*:*)
+ echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit 0 ;;
+ *:UNICOS/mp:*:*)
+ echo nv1-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit 0 ;;
+ F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
+ FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+ FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+ FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
+ echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+ exit 0 ;;
+ 5000:UNIX_System_V:4.*:*)
+ FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+ FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
+ echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+ exit 0 ;;
+ i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
+ echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
+ exit 0 ;;
+ sparc*:BSD/OS:*:*)
+ echo sparc-unknown-bsdi${UNAME_RELEASE}
+ exit 0 ;;
+ *:BSD/OS:*:*)
+ echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
+ exit 0 ;;
+ *:FreeBSD:*:*)
+ # Determine whether the default compiler uses glibc.
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #include <features.h>
+ #if __GLIBC__ >= 2
+ LIBC=gnu
+ #else
+ LIBC=
+ #endif
+EOF
+ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
+ # GNU/KFreeBSD systems have a "k" prefix to indicate we are using
+ # FreeBSD's kernel, but not the complete OS.
+ case ${LIBC} in gnu) kernel_only='k' ;; esac
+ echo ${UNAME_MACHINE}-unknown-${kernel_only}freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC}
+ exit 0 ;;
+ i*:CYGWIN*:*)
+ echo ${UNAME_MACHINE}-pc-cygwin
+ exit 0 ;;
+ i*:MINGW*:*)
+ echo ${UNAME_MACHINE}-pc-mingw32
+ exit 0 ;;
+ i*:PW*:*)
+ echo ${UNAME_MACHINE}-pc-pw32
+ exit 0 ;;
+ x86:Interix*:[34]*)
+ echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//'
+ exit 0 ;;
+ [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
+ echo i${UNAME_MACHINE}-pc-mks
+ exit 0 ;;
+ i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
+ # How do we know it's Interix rather than the generic POSIX subsystem?
+ # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
+ # UNAME_MACHINE based on the output of uname instead of i386?
+ echo i586-pc-interix
+ exit 0 ;;
+ i*:UWIN*:*)
+ echo ${UNAME_MACHINE}-pc-uwin
+ exit 0 ;;
+ p*:CYGWIN*:*)
+ echo powerpcle-unknown-cygwin
+ exit 0 ;;
+ prep*:SunOS:5.*:*)
+ echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit 0 ;;
+ *:GNU:*:*)
+ # the GNU system
+ echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
+ exit 0 ;;
+ *:GNU/*:*:*)
+ # other systems with GNU libc and userland
+ echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
+ exit 0 ;;
+ i*86:Minix:*:*)
+ echo ${UNAME_MACHINE}-pc-minix
+ exit 0 ;;
+ arm*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit 0 ;;
+ cris:Linux:*:*)
+ echo cris-axis-linux-gnu
+ exit 0 ;;
+ ia64:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit 0 ;;
+ m32r*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit 0 ;;
+ m68*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit 0 ;;
+ mips:Linux:*:*)
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #undef CPU
+ #undef mips
+ #undef mipsel
+ #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
+ CPU=mipsel
+ #else
+ #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
+ CPU=mips
+ #else
+ CPU=
+ #endif
+ #endif
+EOF
+ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
+ test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
+ ;;
+ mips64:Linux:*:*)
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #undef CPU
+ #undef mips64
+ #undef mips64el
+ #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
+ CPU=mips64el
+ #else
+ #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
+ CPU=mips64
+ #else
+ CPU=
+ #endif
+ #endif
+EOF
+ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
+ test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
+ ;;
+ ppc:Linux:*:*)
+ echo powerpc-unknown-linux-gnu
+ exit 0 ;;
+ ppc64:Linux:*:*)
+ echo powerpc64-unknown-linux-gnu
+ exit 0 ;;
+ alpha:Linux:*:*)
+ case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
+ EV5) UNAME_MACHINE=alphaev5 ;;
+ EV56) UNAME_MACHINE=alphaev56 ;;
+ PCA56) UNAME_MACHINE=alphapca56 ;;
+ PCA57) UNAME_MACHINE=alphapca56 ;;
+ EV6) UNAME_MACHINE=alphaev6 ;;
+ EV67) UNAME_MACHINE=alphaev67 ;;
+ EV68*) UNAME_MACHINE=alphaev68 ;;
+ esac
+ objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
+ if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
+ echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
+ exit 0 ;;
+ parisc:Linux:*:* | hppa:Linux:*:*)
+ # Look for CPU level
+ case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
+ PA7*) echo hppa1.1-unknown-linux-gnu ;;
+ PA8*) echo hppa2.0-unknown-linux-gnu ;;
+ *) echo hppa-unknown-linux-gnu ;;
+ esac
+ exit 0 ;;
+ parisc64:Linux:*:* | hppa64:Linux:*:*)
+ echo hppa64-unknown-linux-gnu
+ exit 0 ;;
+ s390:Linux:*:* | s390x:Linux:*:*)
+ echo ${UNAME_MACHINE}-ibm-linux
+ exit 0 ;;
+ sh64*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit 0 ;;
+ sh*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit 0 ;;
+ sparc:Linux:*:* | sparc64:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit 0 ;;
+ x86_64:Linux:*:*)
+ echo x86_64-unknown-linux-gnu
+ exit 0 ;;
+ i*86:Linux:*:*)
+ # The BFD linker knows what the default object file format is, so
+ # first see if it will tell us. cd to the root directory to prevent
+ # problems with other programs or directories called `ld' in the path.
+ # Set LC_ALL=C to ensure ld outputs messages in English.
+ ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
+ | sed -ne '/supported targets:/!d
+ s/[ ][ ]*/ /g
+ s/.*supported targets: *//
+ s/ .*//
+ p'`
+ case "$ld_supported_targets" in
+ elf32-i386)
+ TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
+ ;;
+ a.out-i386-linux)
+ echo "${UNAME_MACHINE}-pc-linux-gnuaout"
+ exit 0 ;;
+ coff-i386)
+ echo "${UNAME_MACHINE}-pc-linux-gnucoff"
+ exit 0 ;;
+ "")
+ # Either a pre-BFD a.out linker (linux-gnuoldld) or
+ # one that does not give us useful --help.
+ echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
+ exit 0 ;;
+ esac
+ # Determine whether the default compiler is a.out or elf
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #include <features.h>
+ #ifdef __ELF__
+ # ifdef __GLIBC__
+ # if __GLIBC__ >= 2
+ LIBC=gnu
+ # else
+ LIBC=gnulibc1
+ # endif
+ # else
+ LIBC=gnulibc1
+ # endif
+ #else
+ #ifdef __INTEL_COMPILER
+ LIBC=gnu
+ #else
+ LIBC=gnuaout
+ #endif
+ #endif
+ #ifdef __dietlibc__
+ LIBC=dietlibc
+ #endif
+EOF
+ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
+ test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0
+ test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
+ ;;
+ i*86:DYNIX/ptx:4*:*)
+ # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
+ # earlier versions are messed up and put the nodename in both
+ # sysname and nodename.
+ echo i386-sequent-sysv4
+ exit 0 ;;
+ i*86:UNIX_SV:4.2MP:2.*)
+ # Unixware is an offshoot of SVR4, but it has its own version
+ # number series starting with 2...
+ # I am not positive that other SVR4 systems won't match this,
+ # I just have to hope. -- rms.
+ # Use sysv4.2uw... so that sysv4* matches it.
+ echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
+ exit 0 ;;
+ i*86:OS/2:*:*)
+ # If we were able to find `uname', then EMX Unix compatibility
+ # is probably installed.
+ echo ${UNAME_MACHINE}-pc-os2-emx
+ exit 0 ;;
+ i*86:XTS-300:*:STOP)
+ echo ${UNAME_MACHINE}-unknown-stop
+ exit 0 ;;
+ i*86:atheos:*:*)
+ echo ${UNAME_MACHINE}-unknown-atheos
+ exit 0 ;;
+ i*86:syllable:*:*)
+ echo ${UNAME_MACHINE}-pc-syllable
+ exit 0 ;;
+ i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
+ echo i386-unknown-lynxos${UNAME_RELEASE}
+ exit 0 ;;
+ i*86:*DOS:*:*)
+ echo ${UNAME_MACHINE}-pc-msdosdjgpp
+ exit 0 ;;
+ i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
+ UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
+ if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
+ echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
+ else
+ echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
+ fi
+ exit 0 ;;
+ i*86:*:5:[78]*)
+ case `/bin/uname -X | grep "^Machine"` in
+ *486*) UNAME_MACHINE=i486 ;;
+ *Pentium) UNAME_MACHINE=i586 ;;
+ *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
+ esac
+ echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
+ exit 0 ;;
+ i*86:*:3.2:*)
+ if test -f /usr/options/cb.name; then
+ UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
+ echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
+ elif /bin/uname -X 2>/dev/null >/dev/null ; then
+ UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
+ (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
+ (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
+ && UNAME_MACHINE=i586
+ (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
+ && UNAME_MACHINE=i686
+ (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
+ && UNAME_MACHINE=i686
+ echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
+ else
+ echo ${UNAME_MACHINE}-pc-sysv32
+ fi
+ exit 0 ;;
+ pc:*:*:*)
+ # Left here for compatibility:
+ # uname -m prints for DJGPP always 'pc', but it prints nothing about
+ # the processor, so we play safe by assuming i386.
+ echo i386-pc-msdosdjgpp
+ exit 0 ;;
+ Intel:Mach:3*:*)
+ echo i386-pc-mach3
+ exit 0 ;;
+ paragon:*:*:*)
+ echo i860-intel-osf1
+ exit 0 ;;
+ i860:*:4.*:*) # i860-SVR4
+ if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
+ echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
+ else # Add other i860-SVR4 vendors below as they are discovered.
+ echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
+ fi
+ exit 0 ;;
+ mini*:CTIX:SYS*5:*)
+ # "miniframe"
+ echo m68010-convergent-sysv
+ exit 0 ;;
+ mc68k:UNIX:SYSTEM5:3.51m)
+ echo m68k-convergent-sysv
+ exit 0 ;;
+ M680?0:D-NIX:5.3:*)
+ echo m68k-diab-dnix
+ exit 0 ;;
+ M68*:*:R3V[5678]*:*)
+ test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
+ 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0)
+ OS_REL=''
+ test -r /etc/.relid \
+ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
+ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+ && echo i486-ncr-sysv4.3${OS_REL} && exit 0
+ /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
+ && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;;
+ 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
+ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+ && echo i486-ncr-sysv4 && exit 0 ;;
+ m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
+ echo m68k-unknown-lynxos${UNAME_RELEASE}
+ exit 0 ;;
+ mc68030:UNIX_System_V:4.*:*)
+ echo m68k-atari-sysv4
+ exit 0 ;;
+ TSUNAMI:LynxOS:2.*:*)
+ echo sparc-unknown-lynxos${UNAME_RELEASE}
+ exit 0 ;;
+ rs6000:LynxOS:2.*:*)
+ echo rs6000-unknown-lynxos${UNAME_RELEASE}
+ exit 0 ;;
+ PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
+ echo powerpc-unknown-lynxos${UNAME_RELEASE}
+ exit 0 ;;
+ SM[BE]S:UNIX_SV:*:*)
+ echo mips-dde-sysv${UNAME_RELEASE}
+ exit 0 ;;
+ RM*:ReliantUNIX-*:*:*)
+ echo mips-sni-sysv4
+ exit 0 ;;
+ RM*:SINIX-*:*:*)
+ echo mips-sni-sysv4
+ exit 0 ;;
+ *:SINIX-*:*:*)
+ if uname -p 2>/dev/null >/dev/null ; then
+ UNAME_MACHINE=`(uname -p) 2>/dev/null`
+ echo ${UNAME_MACHINE}-sni-sysv4
+ else
+ echo ns32k-sni-sysv
+ fi
+ exit 0 ;;
+ PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
+ # says <Richard.M.Bartel@ccMail.Census.GOV>
+ echo i586-unisys-sysv4
+ exit 0 ;;
+ *:UNIX_System_V:4*:FTX*)
+ # From Gerald Hewes <hewes@openmarket.com>.
+ # How about differentiating between stratus architectures? -djm
+ echo hppa1.1-stratus-sysv4
+ exit 0 ;;
+ *:*:*:FTX*)
+ # From seanf@swdc.stratus.com.
+ echo i860-stratus-sysv4
+ exit 0 ;;
+ *:VOS:*:*)
+ # From Paul.Green@stratus.com.
+ echo hppa1.1-stratus-vos
+ exit 0 ;;
+ mc68*:A/UX:*:*)
+ echo m68k-apple-aux${UNAME_RELEASE}
+ exit 0 ;;
+ news*:NEWS-OS:6*:*)
+ echo mips-sony-newsos6
+ exit 0 ;;
+ R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
+ if [ -d /usr/nec ]; then
+ echo mips-nec-sysv${UNAME_RELEASE}
+ else
+ echo mips-unknown-sysv${UNAME_RELEASE}
+ fi
+ exit 0 ;;
+ BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
+ echo powerpc-be-beos
+ exit 0 ;;
+ BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
+ echo powerpc-apple-beos
+ exit 0 ;;
+ BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
+ echo i586-pc-beos
+ exit 0 ;;
+ SX-4:SUPER-UX:*:*)
+ echo sx4-nec-superux${UNAME_RELEASE}
+ exit 0 ;;
+ SX-5:SUPER-UX:*:*)
+ echo sx5-nec-superux${UNAME_RELEASE}
+ exit 0 ;;
+ SX-6:SUPER-UX:*:*)
+ echo sx6-nec-superux${UNAME_RELEASE}
+ exit 0 ;;
+ Power*:Rhapsody:*:*)
+ echo powerpc-apple-rhapsody${UNAME_RELEASE}
+ exit 0 ;;
+ *:Rhapsody:*:*)
+ echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
+ exit 0 ;;
+ *:Darwin:*:*)
+ case `uname -p` in
+ *86) UNAME_PROCESSOR=i686 ;;
+ powerpc) UNAME_PROCESSOR=powerpc ;;
+ esac
+ echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
+ exit 0 ;;
+ *:procnto*:*:* | *:QNX:[0123456789]*:*)
+ UNAME_PROCESSOR=`uname -p`
+ if test "$UNAME_PROCESSOR" = "x86"; then
+ UNAME_PROCESSOR=i386
+ UNAME_MACHINE=pc
+ fi
+ echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
+ exit 0 ;;
+ *:QNX:*:4*)
+ echo i386-pc-qnx
+ exit 0 ;;
+ NSR-?:NONSTOP_KERNEL:*:*)
+ echo nsr-tandem-nsk${UNAME_RELEASE}
+ exit 0 ;;
+ *:NonStop-UX:*:*)
+ echo mips-compaq-nonstopux
+ exit 0 ;;
+ BS2000:POSIX*:*:*)
+ echo bs2000-siemens-sysv
+ exit 0 ;;
+ DS/*:UNIX_System_V:*:*)
+ echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
+ exit 0 ;;
+ *:Plan9:*:*)
+ # "uname -m" is not consistent, so use $cputype instead. 386
+ # is converted to i386 for consistency with other x86
+ # operating systems.
+ if test "$cputype" = "386"; then
+ UNAME_MACHINE=i386
+ else
+ UNAME_MACHINE="$cputype"
+ fi
+ echo ${UNAME_MACHINE}-unknown-plan9
+ exit 0 ;;
+ *:TOPS-10:*:*)
+ echo pdp10-unknown-tops10
+ exit 0 ;;
+ *:TENEX:*:*)
+ echo pdp10-unknown-tenex
+ exit 0 ;;
+ KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
+ echo pdp10-dec-tops20
+ exit 0 ;;
+ XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
+ echo pdp10-xkl-tops20
+ exit 0 ;;
+ *:TOPS-20:*:*)
+ echo pdp10-unknown-tops20
+ exit 0 ;;
+ *:ITS:*:*)
+ echo pdp10-unknown-its
+ exit 0 ;;
+ SEI:*:*:SEIUX)
+ echo mips-sei-seiux${UNAME_RELEASE}
+ exit 0 ;;
+ *:DragonFly:*:*)
+ echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
+ exit 0 ;;
+esac
+
+#echo '(No uname command or uname output not recognized.)' 1>&2
+#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
+
+eval $set_cc_for_build
+cat >$dummy.c <<EOF
+#ifdef _SEQUENT_
+# include <sys/types.h>
+# include <sys/utsname.h>
+#endif
+main ()
+{
+#if defined (sony)
+#if defined (MIPSEB)
+ /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
+ I don't know.... */
+ printf ("mips-sony-bsd\n"); exit (0);
+#else
+#include <sys/param.h>
+ printf ("m68k-sony-newsos%s\n",
+#ifdef NEWSOS4
+ "4"
+#else
+ ""
+#endif
+ ); exit (0);
+#endif
+#endif
+
+#if defined (__arm) && defined (__acorn) && defined (__unix)
+ printf ("arm-acorn-riscix"); exit (0);
+#endif
+
+#if defined (hp300) && !defined (hpux)
+ printf ("m68k-hp-bsd\n"); exit (0);
+#endif
+
+#if defined (NeXT)
+#if !defined (__ARCHITECTURE__)
+#define __ARCHITECTURE__ "m68k"
+#endif
+ int version;
+ version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
+ if (version < 4)
+ printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
+ else
+ printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
+ exit (0);
+#endif
+
+#if defined (MULTIMAX) || defined (n16)
+#if defined (UMAXV)
+ printf ("ns32k-encore-sysv\n"); exit (0);
+#else
+#if defined (CMU)
+ printf ("ns32k-encore-mach\n"); exit (0);
+#else
+ printf ("ns32k-encore-bsd\n"); exit (0);
+#endif
+#endif
+#endif
+
+#if defined (__386BSD__)
+ printf ("i386-pc-bsd\n"); exit (0);
+#endif
+
+#if defined (sequent)
+#if defined (i386)
+ printf ("i386-sequent-dynix\n"); exit (0);
+#endif
+#if defined (ns32000)
+ printf ("ns32k-sequent-dynix\n"); exit (0);
+#endif
+#endif
+
+#if defined (_SEQUENT_)
+ struct utsname un;
+
+ uname(&un);
+
+ if (strncmp(un.version, "V2", 2) == 0) {
+ printf ("i386-sequent-ptx2\n"); exit (0);
+ }
+ if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
+ printf ("i386-sequent-ptx1\n"); exit (0);
+ }
+ printf ("i386-sequent-ptx\n"); exit (0);
+
+#endif
+
+#if defined (vax)
+# if !defined (ultrix)
+# include <sys/param.h>
+# if defined (BSD)
+# if BSD == 43
+ printf ("vax-dec-bsd4.3\n"); exit (0);
+# else
+# if BSD == 199006
+ printf ("vax-dec-bsd4.3reno\n"); exit (0);
+# else
+ printf ("vax-dec-bsd\n"); exit (0);
+# endif
+# endif
+# else
+ printf ("vax-dec-bsd\n"); exit (0);
+# endif
+# else
+ printf ("vax-dec-ultrix\n"); exit (0);
+# endif
+#endif
+
+#if defined (alliant) && defined (i860)
+ printf ("i860-alliant-bsd\n"); exit (0);
+#endif
+
+ exit (1);
+}
+EOF
+
+$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0
+
+# Apollos put the system type in the environment.
+
+test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; }
+
+# Convex versions that predate uname can use getsysinfo(1)
+
+if [ -x /usr/convex/getsysinfo ]
+then
+ case `getsysinfo -f cpu_type` in
+ c1*)
+ echo c1-convex-bsd
+ exit 0 ;;
+ c2*)
+ if getsysinfo -f scalar_acc
+ then echo c32-convex-bsd
+ else echo c2-convex-bsd
+ fi
+ exit 0 ;;
+ c34*)
+ echo c34-convex-bsd
+ exit 0 ;;
+ c38*)
+ echo c38-convex-bsd
+ exit 0 ;;
+ c4*)
+ echo c4-convex-bsd
+ exit 0 ;;
+ esac
+fi
+
+cat >&2 <<EOF
+$0: unable to guess system type
+
+This script, last modified $timestamp, has failed to recognize
+the operating system you are using. It is advised that you
+download the most up to date version of the config scripts from
+
+ ftp://ftp.gnu.org/pub/gnu/config/
+
+If the version you run ($0) is already up to date, please
+send the following data and any information you think might be
+pertinent to <config-patches@gnu.org> in order to provide the needed
+information to handle your system.
+
+config.guess timestamp = $timestamp
+
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
+/bin/uname -X = `(/bin/uname -X) 2>/dev/null`
+
+hostinfo = `(hostinfo) 2>/dev/null`
+/bin/universe = `(/bin/universe) 2>/dev/null`
+/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null`
+/bin/arch = `(/bin/arch) 2>/dev/null`
+/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
+
+UNAME_MACHINE = ${UNAME_MACHINE}
+UNAME_RELEASE = ${UNAME_RELEASE}
+UNAME_SYSTEM = ${UNAME_SYSTEM}
+UNAME_VERSION = ${UNAME_VERSION}
+EOF
+
+exit 1
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "timestamp='"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:
diff --git a/config.sub b/config.sub
new file mode 100644
index 0000000000..506d3ab77f
--- /dev/null
+++ b/config.sub
@@ -0,0 +1,1537 @@
+#! /bin/sh
+# Configuration validation subroutine script.
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+# 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+
+timestamp='2004-06-11'
+
+# This file is (in principle) common to ALL GNU software.
+# The presence of a machine in this file suggests that SOME GNU software
+# can handle that machine. It does not imply ALL GNU software can.
+#
+# 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 2 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.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+# As a special exception 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.
+
+# Please send patches to <config-patches@gnu.org>. Submit a context
+# diff and a properly formatted ChangeLog entry.
+#
+# Configuration subroutine to validate and canonicalize a configuration type.
+# Supply the specified configuration type as an argument.
+# If it is invalid, we print an error message on stderr and exit with code 1.
+# Otherwise, we print the canonical config type on stdout and succeed.
+
+# This file is supposed to be the same for all GNU packages
+# and recognize all the CPU types, system types and aliases
+# that are meaningful with *any* GNU software.
+# Each package is responsible for reporting which valid configurations
+# it does not support. The user should be able to distinguish
+# a failure to support a valid configuration from a meaningless
+# configuration.
+
+# The goal of this file is to map all the various variations of a given
+# machine specification into a single specification in the form:
+# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
+# or in some cases, the newer four-part form:
+# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
+# It is wrong to echo any other type of specification.
+
+me=`echo "$0" | sed -e 's,.*/,,'`
+
+usage="\
+Usage: $0 [OPTION] CPU-MFR-OPSYS
+ $0 [OPTION] ALIAS
+
+Canonicalize a configuration name.
+
+Operation modes:
+ -h, --help print this help, then exit
+ -t, --time-stamp print date of last modification, then exit
+ -v, --version print version number, then exit
+
+Report bugs and patches to <config-patches@gnu.org>."
+
+version="\
+GNU config.sub ($timestamp)
+
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
+Free Software Foundation, Inc.
+
+This is free software; see the source for copying conditions. There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+help="
+Try \`$me --help' for more information."
+
+# Parse command line
+while test $# -gt 0 ; do
+ case $1 in
+ --time-stamp | --time* | -t )
+ echo "$timestamp" ; exit 0 ;;
+ --version | -v )
+ echo "$version" ; exit 0 ;;
+ --help | --h* | -h )
+ echo "$usage"; exit 0 ;;
+ -- ) # Stop option processing
+ shift; break ;;
+ - ) # Use stdin as input.
+ break ;;
+ -* )
+ echo "$me: invalid option $1$help"
+ exit 1 ;;
+
+ *local*)
+ # First pass through any local machine types.
+ echo $1
+ exit 0;;
+
+ * )
+ break ;;
+ esac
+done
+
+case $# in
+ 0) echo "$me: missing argument$help" >&2
+ exit 1;;
+ 1) ;;
+ *) echo "$me: too many arguments$help" >&2
+ exit 1;;
+esac
+
+# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
+# Here we must recognize all the valid KERNEL-OS combinations.
+maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
+case $maybe_os in
+ nto-qnx* | linux-gnu* | linux-dietlibc | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | \
+ kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
+ os=-$maybe_os
+ basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
+ ;;
+ *)
+ basic_machine=`echo $1 | sed 's/-[^-]*$//'`
+ if [ $basic_machine != $1 ]
+ then os=`echo $1 | sed 's/.*-/-/'`
+ else os=; fi
+ ;;
+esac
+
+### Let's recognize common machines as not being operating systems so
+### that things like config.sub decstation-3100 work. We also
+### recognize some manufacturers as not being operating systems, so we
+### can provide default operating systems below.
+case $os in
+ -sun*os*)
+ # Prevent following clause from handling this invalid input.
+ ;;
+ -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
+ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
+ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
+ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
+ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
+ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
+ -apple | -axis)
+ os=
+ basic_machine=$1
+ ;;
+ -sim | -cisco | -oki | -wec | -winbond)
+ os=
+ basic_machine=$1
+ ;;
+ -scout)
+ ;;
+ -wrs)
+ os=-vxworks
+ basic_machine=$1
+ ;;
+ -chorusos*)
+ os=-chorusos
+ basic_machine=$1
+ ;;
+ -chorusrdb)
+ os=-chorusrdb
+ basic_machine=$1
+ ;;
+ -hiux*)
+ os=-hiuxwe2
+ ;;
+ -sco5)
+ os=-sco3.2v5
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco4)
+ os=-sco3.2v4
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco3.2.[4-9]*)
+ os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco3.2v[4-9]*)
+ # Don't forget version if it is 3.2v4 or newer.
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco*)
+ os=-sco3.2v2
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -udk*)
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -isc)
+ os=-isc2.2
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -clix*)
+ basic_machine=clipper-intergraph
+ ;;
+ -isc*)
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -lynx*)
+ os=-lynxos
+ ;;
+ -ptx*)
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
+ ;;
+ -windowsnt*)
+ os=`echo $os | sed -e 's/windowsnt/winnt/'`
+ ;;
+ -psos*)
+ os=-psos
+ ;;
+ -mint | -mint[0-9]*)
+ basic_machine=m68k-atari
+ os=-mint
+ ;;
+esac
+
+# Decode aliases for certain CPU-COMPANY combinations.
+case $basic_machine in
+ # Recognize the basic CPU types without company name.
+ # Some are omitted here because they have special meanings below.
+ 1750a | 580 \
+ | a29k \
+ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
+ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
+ | am33_2.0 \
+ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
+ | c4x | clipper \
+ | d10v | d30v | dlx | dsp16xx \
+ | fr30 | frv \
+ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+ | i370 | i860 | i960 | ia64 \
+ | ip2k | iq2000 \
+ | m32r | m68000 | m68k | m88k | mcore \
+ | mips | mipsbe | mipseb | mipsel | mipsle \
+ | mips16 \
+ | mips64 | mips64el \
+ | mips64vr | mips64vrel \
+ | mips64orion | mips64orionel \
+ | mips64vr4100 | mips64vr4100el \
+ | mips64vr4300 | mips64vr4300el \
+ | mips64vr5000 | mips64vr5000el \
+ | mipsisa32 | mipsisa32el \
+ | mipsisa32r2 | mipsisa32r2el \
+ | mipsisa64 | mipsisa64el \
+ | mipsisa64r2 | mipsisa64r2el \
+ | mipsisa64sb1 | mipsisa64sb1el \
+ | mipsisa64sr71k | mipsisa64sr71kel \
+ | mipstx39 | mipstx39el \
+ | mn10200 | mn10300 \
+ | msp430 \
+ | ns16k | ns32k \
+ | openrisc | or32 \
+ | pdp10 | pdp11 | pj | pjl \
+ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
+ | pyramid \
+ | sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \
+ | sh64 | sh64le \
+ | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv9 | sparcv9b \
+ | strongarm \
+ | tahoe | thumb | tic4x | tic80 | tron \
+ | v850 | v850e \
+ | we32k \
+ | x86 | xscale | xstormy16 | xtensa \
+ | z8k)
+ basic_machine=$basic_machine-unknown
+ ;;
+ m6811 | m68hc11 | m6812 | m68hc12)
+ # Motorola 68HC11/12.
+ basic_machine=$basic_machine-unknown
+ os=-none
+ ;;
+ m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
+ ;;
+
+ # We use `pc' rather than `unknown'
+ # because (1) that's what they normally are, and
+ # (2) the word "unknown" tends to confuse beginning users.
+ i*86 | x86_64)
+ basic_machine=$basic_machine-pc
+ ;;
+ # Object if more than one company name word.
+ *-*-*)
+ echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+ exit 1
+ ;;
+ # Recognize the basic CPU types with company name.
+ 580-* \
+ | a29k-* \
+ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
+ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
+ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
+ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \
+ | avr-* \
+ | bs2000-* \
+ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
+ | clipper-* | cydra-* \
+ | d10v-* | d30v-* | dlx-* \
+ | elxsi-* \
+ | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \
+ | h8300-* | h8500-* \
+ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
+ | i*86-* | i860-* | i960-* | ia64-* \
+ | ip2k-* | iq2000-* \
+ | m32r-* \
+ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
+ | m88110-* | m88k-* | mcore-* \
+ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
+ | mips16-* \
+ | mips64-* | mips64el-* \
+ | mips64vr-* | mips64vrel-* \
+ | mips64orion-* | mips64orionel-* \
+ | mips64vr4100-* | mips64vr4100el-* \
+ | mips64vr4300-* | mips64vr4300el-* \
+ | mips64vr5000-* | mips64vr5000el-* \
+ | mipsisa32-* | mipsisa32el-* \
+ | mipsisa32r2-* | mipsisa32r2el-* \
+ | mipsisa64-* | mipsisa64el-* \
+ | mipsisa64r2-* | mipsisa64r2el-* \
+ | mipsisa64sb1-* | mipsisa64sb1el-* \
+ | mipsisa64sr71k-* | mipsisa64sr71kel-* \
+ | mipstx39-* | mipstx39el-* \
+ | msp430-* \
+ | none-* | np1-* | nv1-* | ns16k-* | ns32k-* \
+ | orion-* \
+ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
+ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
+ | pyramid-* \
+ | romp-* | rs6000-* \
+ | sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \
+ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
+ | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \
+ | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
+ | tahoe-* | thumb-* \
+ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
+ | tron-* \
+ | v850-* | v850e-* | vax-* \
+ | we32k-* \
+ | x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \
+ | xtensa-* \
+ | ymp-* \
+ | z8k-*)
+ ;;
+ # Recognize the various machine names and aliases which stand
+ # for a CPU type and a company and sometimes even an OS.
+ 386bsd)
+ basic_machine=i386-unknown
+ os=-bsd
+ ;;
+ 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
+ basic_machine=m68000-att
+ ;;
+ 3b*)
+ basic_machine=we32k-att
+ ;;
+ a29khif)
+ basic_machine=a29k-amd
+ os=-udi
+ ;;
+ adobe68k)
+ basic_machine=m68010-adobe
+ os=-scout
+ ;;
+ alliant | fx80)
+ basic_machine=fx80-alliant
+ ;;
+ altos | altos3068)
+ basic_machine=m68k-altos
+ ;;
+ am29k)
+ basic_machine=a29k-none
+ os=-bsd
+ ;;
+ amd64)
+ basic_machine=x86_64-pc
+ ;;
+ amd64-*)
+ basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ amdahl)
+ basic_machine=580-amdahl
+ os=-sysv
+ ;;
+ amiga | amiga-*)
+ basic_machine=m68k-unknown
+ ;;
+ amigaos | amigados)
+ basic_machine=m68k-unknown
+ os=-amigaos
+ ;;
+ amigaunix | amix)
+ basic_machine=m68k-unknown
+ os=-sysv4
+ ;;
+ apollo68)
+ basic_machine=m68k-apollo
+ os=-sysv
+ ;;
+ apollo68bsd)
+ basic_machine=m68k-apollo
+ os=-bsd
+ ;;
+ aux)
+ basic_machine=m68k-apple
+ os=-aux
+ ;;
+ balance)
+ basic_machine=ns32k-sequent
+ os=-dynix
+ ;;
+ c90)
+ basic_machine=c90-cray
+ os=-unicos
+ ;;
+ convex-c1)
+ basic_machine=c1-convex
+ os=-bsd
+ ;;
+ convex-c2)
+ basic_machine=c2-convex
+ os=-bsd
+ ;;
+ convex-c32)
+ basic_machine=c32-convex
+ os=-bsd
+ ;;
+ convex-c34)
+ basic_machine=c34-convex
+ os=-bsd
+ ;;
+ convex-c38)
+ basic_machine=c38-convex
+ os=-bsd
+ ;;
+ cray | j90)
+ basic_machine=j90-cray
+ os=-unicos
+ ;;
+ crds | unos)
+ basic_machine=m68k-crds
+ ;;
+ cris | cris-* | etrax*)
+ basic_machine=cris-axis
+ ;;
+ da30 | da30-*)
+ basic_machine=m68k-da30
+ ;;
+ decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
+ basic_machine=mips-dec
+ ;;
+ decsystem10* | dec10*)
+ basic_machine=pdp10-dec
+ os=-tops10
+ ;;
+ decsystem20* | dec20*)
+ basic_machine=pdp10-dec
+ os=-tops20
+ ;;
+ delta | 3300 | motorola-3300 | motorola-delta \
+ | 3300-motorola | delta-motorola)
+ basic_machine=m68k-motorola
+ ;;
+ delta88)
+ basic_machine=m88k-motorola
+ os=-sysv3
+ ;;
+ dpx20 | dpx20-*)
+ basic_machine=rs6000-bull
+ os=-bosx
+ ;;
+ dpx2* | dpx2*-bull)
+ basic_machine=m68k-bull
+ os=-sysv3
+ ;;
+ ebmon29k)
+ basic_machine=a29k-amd
+ os=-ebmon
+ ;;
+ elxsi)
+ basic_machine=elxsi-elxsi
+ os=-bsd
+ ;;
+ encore | umax | mmax)
+ basic_machine=ns32k-encore
+ ;;
+ es1800 | OSE68k | ose68k | ose | OSE)
+ basic_machine=m68k-ericsson
+ os=-ose
+ ;;
+ fx2800)
+ basic_machine=i860-alliant
+ ;;
+ genix)
+ basic_machine=ns32k-ns
+ ;;
+ gmicro)
+ basic_machine=tron-gmicro
+ os=-sysv
+ ;;
+ go32)
+ basic_machine=i386-pc
+ os=-go32
+ ;;
+ h3050r* | hiux*)
+ basic_machine=hppa1.1-hitachi
+ os=-hiuxwe2
+ ;;
+ h8300hms)
+ basic_machine=h8300-hitachi
+ os=-hms
+ ;;
+ h8300xray)
+ basic_machine=h8300-hitachi
+ os=-xray
+ ;;
+ h8500hms)
+ basic_machine=h8500-hitachi
+ os=-hms
+ ;;
+ harris)
+ basic_machine=m88k-harris
+ os=-sysv3
+ ;;
+ hp300-*)
+ basic_machine=m68k-hp
+ ;;
+ hp300bsd)
+ basic_machine=m68k-hp
+ os=-bsd
+ ;;
+ hp300hpux)
+ basic_machine=m68k-hp
+ os=-hpux
+ ;;
+ hp3k9[0-9][0-9] | hp9[0-9][0-9])
+ basic_machine=hppa1.0-hp
+ ;;
+ hp9k2[0-9][0-9] | hp9k31[0-9])
+ basic_machine=m68000-hp
+ ;;
+ hp9k3[2-9][0-9])
+ basic_machine=m68k-hp
+ ;;
+ hp9k6[0-9][0-9] | hp6[0-9][0-9])
+ basic_machine=hppa1.0-hp
+ ;;
+ hp9k7[0-79][0-9] | hp7[0-79][0-9])
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k78[0-9] | hp78[0-9])
+ # FIXME: really hppa2.0-hp
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
+ # FIXME: really hppa2.0-hp
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k8[0-9][13679] | hp8[0-9][13679])
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k8[0-9][0-9] | hp8[0-9][0-9])
+ basic_machine=hppa1.0-hp
+ ;;
+ hppa-next)
+ os=-nextstep3
+ ;;
+ hppaosf)
+ basic_machine=hppa1.1-hp
+ os=-osf
+ ;;
+ hppro)
+ basic_machine=hppa1.1-hp
+ os=-proelf
+ ;;
+ i370-ibm* | ibm*)
+ basic_machine=i370-ibm
+ ;;
+# I'm not sure what "Sysv32" means. Should this be sysv3.2?
+ i*86v32)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-sysv32
+ ;;
+ i*86v4*)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-sysv4
+ ;;
+ i*86v)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-sysv
+ ;;
+ i*86sol2)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-solaris2
+ ;;
+ i386mach)
+ basic_machine=i386-mach
+ os=-mach
+ ;;
+ i386-vsta | vsta)
+ basic_machine=i386-unknown
+ os=-vsta
+ ;;
+ iris | iris4d)
+ basic_machine=mips-sgi
+ case $os in
+ -irix*)
+ ;;
+ *)
+ os=-irix4
+ ;;
+ esac
+ ;;
+ isi68 | isi)
+ basic_machine=m68k-isi
+ os=-sysv
+ ;;
+ m88k-omron*)
+ basic_machine=m88k-omron
+ ;;
+ magnum | m3230)
+ basic_machine=mips-mips
+ os=-sysv
+ ;;
+ merlin)
+ basic_machine=ns32k-utek
+ os=-sysv
+ ;;
+ mingw32)
+ basic_machine=i386-pc
+ os=-mingw32
+ ;;
+ miniframe)
+ basic_machine=m68000-convergent
+ ;;
+ *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
+ basic_machine=m68k-atari
+ os=-mint
+ ;;
+ mips3*-*)
+ basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
+ ;;
+ mips3*)
+ basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
+ ;;
+ mmix*)
+ basic_machine=mmix-knuth
+ os=-mmixware
+ ;;
+ monitor)
+ basic_machine=m68k-rom68k
+ os=-coff
+ ;;
+ morphos)
+ basic_machine=powerpc-unknown
+ os=-morphos
+ ;;
+ msdos)
+ basic_machine=i386-pc
+ os=-msdos
+ ;;
+ mvs)
+ basic_machine=i370-ibm
+ os=-mvs
+ ;;
+ ncr3000)
+ basic_machine=i486-ncr
+ os=-sysv4
+ ;;
+ netbsd386)
+ basic_machine=i386-unknown
+ os=-netbsd
+ ;;
+ netwinder)
+ basic_machine=armv4l-rebel
+ os=-linux
+ ;;
+ news | news700 | news800 | news900)
+ basic_machine=m68k-sony
+ os=-newsos
+ ;;
+ news1000)
+ basic_machine=m68030-sony
+ os=-newsos
+ ;;
+ news-3600 | risc-news)
+ basic_machine=mips-sony
+ os=-newsos
+ ;;
+ necv70)
+ basic_machine=v70-nec
+ os=-sysv
+ ;;
+ next | m*-next )
+ basic_machine=m68k-next
+ case $os in
+ -nextstep* )
+ ;;
+ -ns2*)
+ os=-nextstep2
+ ;;
+ *)
+ os=-nextstep3
+ ;;
+ esac
+ ;;
+ nh3000)
+ basic_machine=m68k-harris
+ os=-cxux
+ ;;
+ nh[45]000)
+ basic_machine=m88k-harris
+ os=-cxux
+ ;;
+ nindy960)
+ basic_machine=i960-intel
+ os=-nindy
+ ;;
+ mon960)
+ basic_machine=i960-intel
+ os=-mon960
+ ;;
+ nonstopux)
+ basic_machine=mips-compaq
+ os=-nonstopux
+ ;;
+ np1)
+ basic_machine=np1-gould
+ ;;
+ nv1)
+ basic_machine=nv1-cray
+ os=-unicosmp
+ ;;
+ nsr-tandem)
+ basic_machine=nsr-tandem
+ ;;
+ op50n-* | op60c-*)
+ basic_machine=hppa1.1-oki
+ os=-proelf
+ ;;
+ or32 | or32-*)
+ basic_machine=or32-unknown
+ os=-coff
+ ;;
+ os400)
+ basic_machine=powerpc-ibm
+ os=-os400
+ ;;
+ OSE68000 | ose68000)
+ basic_machine=m68000-ericsson
+ os=-ose
+ ;;
+ os68k)
+ basic_machine=m68k-none
+ os=-os68k
+ ;;
+ pa-hitachi)
+ basic_machine=hppa1.1-hitachi
+ os=-hiuxwe2
+ ;;
+ paragon)
+ basic_machine=i860-intel
+ os=-osf
+ ;;
+ pbd)
+ basic_machine=sparc-tti
+ ;;
+ pbb)
+ basic_machine=m68k-tti
+ ;;
+ pc532 | pc532-*)
+ basic_machine=ns32k-pc532
+ ;;
+ pentium | p5 | k5 | k6 | nexgen | viac3)
+ basic_machine=i586-pc
+ ;;
+ pentiumpro | p6 | 6x86 | athlon | athlon_*)
+ basic_machine=i686-pc
+ ;;
+ pentiumii | pentium2 | pentiumiii | pentium3)
+ basic_machine=i686-pc
+ ;;
+ pentium4)
+ basic_machine=i786-pc
+ ;;
+ pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
+ basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pentiumpro-* | p6-* | 6x86-* | athlon-*)
+ basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
+ basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pentium4-*)
+ basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pn)
+ basic_machine=pn-gould
+ ;;
+ power) basic_machine=power-ibm
+ ;;
+ ppc) basic_machine=powerpc-unknown
+ ;;
+ ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ppcle | powerpclittle | ppc-le | powerpc-little)
+ basic_machine=powerpcle-unknown
+ ;;
+ ppcle-* | powerpclittle-*)
+ basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ppc64) basic_machine=powerpc64-unknown
+ ;;
+ ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ppc64le | powerpc64little | ppc64-le | powerpc64-little)
+ basic_machine=powerpc64le-unknown
+ ;;
+ ppc64le-* | powerpc64little-*)
+ basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ps2)
+ basic_machine=i386-ibm
+ ;;
+ pw32)
+ basic_machine=i586-unknown
+ os=-pw32
+ ;;
+ rom68k)
+ basic_machine=m68k-rom68k
+ os=-coff
+ ;;
+ rm[46]00)
+ basic_machine=mips-siemens
+ ;;
+ rtpc | rtpc-*)
+ basic_machine=romp-ibm
+ ;;
+ s390 | s390-*)
+ basic_machine=s390-ibm
+ ;;
+ s390x | s390x-*)
+ basic_machine=s390x-ibm
+ ;;
+ sa29200)
+ basic_machine=a29k-amd
+ os=-udi
+ ;;
+ sb1)
+ basic_machine=mipsisa64sb1-unknown
+ ;;
+ sb1el)
+ basic_machine=mipsisa64sb1el-unknown
+ ;;
+ sei)
+ basic_machine=mips-sei
+ os=-seiux
+ ;;
+ sequent)
+ basic_machine=i386-sequent
+ ;;
+ sh)
+ basic_machine=sh-hitachi
+ os=-hms
+ ;;
+ sh64)
+ basic_machine=sh64-unknown
+ ;;
+ sparclite-wrs | simso-wrs)
+ basic_machine=sparclite-wrs
+ os=-vxworks
+ ;;
+ sps7)
+ basic_machine=m68k-bull
+ os=-sysv2
+ ;;
+ spur)
+ basic_machine=spur-unknown
+ ;;
+ st2000)
+ basic_machine=m68k-tandem
+ ;;
+ stratus)
+ basic_machine=i860-stratus
+ os=-sysv4
+ ;;
+ sun2)
+ basic_machine=m68000-sun
+ ;;
+ sun2os3)
+ basic_machine=m68000-sun
+ os=-sunos3
+ ;;
+ sun2os4)
+ basic_machine=m68000-sun
+ os=-sunos4
+ ;;
+ sun3os3)
+ basic_machine=m68k-sun
+ os=-sunos3
+ ;;
+ sun3os4)
+ basic_machine=m68k-sun
+ os=-sunos4
+ ;;
+ sun4os3)
+ basic_machine=sparc-sun
+ os=-sunos3
+ ;;
+ sun4os4)
+ basic_machine=sparc-sun
+ os=-sunos4
+ ;;
+ sun4sol2)
+ basic_machine=sparc-sun
+ os=-solaris2
+ ;;
+ sun3 | sun3-*)
+ basic_machine=m68k-sun
+ ;;
+ sun4)
+ basic_machine=sparc-sun
+ ;;
+ sun386 | sun386i | roadrunner)
+ basic_machine=i386-sun
+ ;;
+ sv1)
+ basic_machine=sv1-cray
+ os=-unicos
+ ;;
+ symmetry)
+ basic_machine=i386-sequent
+ os=-dynix
+ ;;
+ t3e)
+ basic_machine=alphaev5-cray
+ os=-unicos
+ ;;
+ t90)
+ basic_machine=t90-cray
+ os=-unicos
+ ;;
+ tic54x | c54x*)
+ basic_machine=tic54x-unknown
+ os=-coff
+ ;;
+ tic55x | c55x*)
+ basic_machine=tic55x-unknown
+ os=-coff
+ ;;
+ tic6x | c6x*)
+ basic_machine=tic6x-unknown
+ os=-coff
+ ;;
+ tx39)
+ basic_machine=mipstx39-unknown
+ ;;
+ tx39el)
+ basic_machine=mipstx39el-unknown
+ ;;
+ toad1)
+ basic_machine=pdp10-xkl
+ os=-tops20
+ ;;
+ tower | tower-32)
+ basic_machine=m68k-ncr
+ ;;
+ tpf)
+ basic_machine=s390x-ibm
+ os=-tpf
+ ;;
+ udi29k)
+ basic_machine=a29k-amd
+ os=-udi
+ ;;
+ ultra3)
+ basic_machine=a29k-nyu
+ os=-sym1
+ ;;
+ v810 | necv810)
+ basic_machine=v810-nec
+ os=-none
+ ;;
+ vaxv)
+ basic_machine=vax-dec
+ os=-sysv
+ ;;
+ vms)
+ basic_machine=vax-dec
+ os=-vms
+ ;;
+ vpp*|vx|vx-*)
+ basic_machine=f301-fujitsu
+ ;;
+ vxworks960)
+ basic_machine=i960-wrs
+ os=-vxworks
+ ;;
+ vxworks68)
+ basic_machine=m68k-wrs
+ os=-vxworks
+ ;;
+ vxworks29k)
+ basic_machine=a29k-wrs
+ os=-vxworks
+ ;;
+ w65*)
+ basic_machine=w65-wdc
+ os=-none
+ ;;
+ w89k-*)
+ basic_machine=hppa1.1-winbond
+ os=-proelf
+ ;;
+ xps | xps100)
+ basic_machine=xps100-honeywell
+ ;;
+ ymp)
+ basic_machine=ymp-cray
+ os=-unicos
+ ;;
+ z8k-*-coff)
+ basic_machine=z8k-unknown
+ os=-sim
+ ;;
+ none)
+ basic_machine=none-none
+ os=-none
+ ;;
+
+# Here we handle the default manufacturer of certain CPU types. It is in
+# some cases the only manufacturer, in others, it is the most popular.
+ w89k)
+ basic_machine=hppa1.1-winbond
+ ;;
+ op50n)
+ basic_machine=hppa1.1-oki
+ ;;
+ op60c)
+ basic_machine=hppa1.1-oki
+ ;;
+ romp)
+ basic_machine=romp-ibm
+ ;;
+ rs6000)
+ basic_machine=rs6000-ibm
+ ;;
+ vax)
+ basic_machine=vax-dec
+ ;;
+ pdp10)
+ # there are many clones, so DEC is not a safe bet
+ basic_machine=pdp10-unknown
+ ;;
+ pdp11)
+ basic_machine=pdp11-dec
+ ;;
+ we32k)
+ basic_machine=we32k-att
+ ;;
+ sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele)
+ basic_machine=sh-unknown
+ ;;
+ sh64)
+ basic_machine=sh64-unknown
+ ;;
+ sparc | sparcv9 | sparcv9b)
+ basic_machine=sparc-sun
+ ;;
+ cydra)
+ basic_machine=cydra-cydrome
+ ;;
+ orion)
+ basic_machine=orion-highlevel
+ ;;
+ orion105)
+ basic_machine=clipper-highlevel
+ ;;
+ mac | mpw | mac-mpw)
+ basic_machine=m68k-apple
+ ;;
+ pmac | pmac-mpw)
+ basic_machine=powerpc-apple
+ ;;
+ *-unknown)
+ # Make sure to match an already-canonicalized machine name.
+ ;;
+ *)
+ echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+ exit 1
+ ;;
+esac
+
+# Here we canonicalize certain aliases for manufacturers.
+case $basic_machine in
+ *-digital*)
+ basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
+ ;;
+ *-commodore*)
+ basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
+ ;;
+ *)
+ ;;
+esac
+
+# Decode manufacturer-specific aliases for certain operating systems.
+
+if [ x"$os" != x"" ]
+then
+case $os in
+ # First match some system type aliases
+ # that might get confused with valid system types.
+ # -solaris* is a basic system type, with this one exception.
+ -solaris1 | -solaris1.*)
+ os=`echo $os | sed -e 's|solaris1|sunos4|'`
+ ;;
+ -solaris)
+ os=-solaris2
+ ;;
+ -svr4*)
+ os=-sysv4
+ ;;
+ -unixware*)
+ os=-sysv4.2uw
+ ;;
+ -gnu/linux*)
+ os=`echo $os | sed -e 's|gnu/linux|linux|'`
+ ;;
+ # First accept the basic system types.
+ # The portable systems comes first.
+ # Each alternative MUST END IN A *, to match a version number.
+ # -sysv* is not here because it comes later, after sysvr4.
+ -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
+ | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
+ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
+ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
+ | -aos* \
+ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
+ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
+ | -hiux* | -386bsd* | -knetbsd* | -netbsd* | -openbsd* | -kfreebsd* | -freebsd* | -riscix* \
+ | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
+ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
+ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
+ | -chorusos* | -chorusrdb* \
+ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+ | -mingw32* | -linux-gnu* | -linux-uclibc* | -uxpv* | -beos* | -mpeix* | -udk* \
+ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
+ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
+ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
+ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
+ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
+ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly*)
+ # Remember, each alternative MUST END IN *, to match a version number.
+ ;;
+ -qnx*)
+ case $basic_machine in
+ x86-* | i*86-*)
+ ;;
+ *)
+ os=-nto$os
+ ;;
+ esac
+ ;;
+ -nto-qnx*)
+ ;;
+ -nto*)
+ os=`echo $os | sed -e 's|nto|nto-qnx|'`
+ ;;
+ -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
+ | -windows* | -osx | -abug | -netware* | -os9* | -beos* \
+ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
+ ;;
+ -mac*)
+ os=`echo $os | sed -e 's|mac|macos|'`
+ ;;
+ -linux-dietlibc)
+ os=-linux-dietlibc
+ ;;
+ -linux*)
+ os=-linux
+ ;;
+ -sunos5*)
+ os=`echo $os | sed -e 's|sunos5|solaris2|'`
+ ;;
+ -sunos6*)
+ os=`echo $os | sed -e 's|sunos6|solaris3|'`
+ ;;
+ -opened*)
+ os=-openedition
+ ;;
+ -os400*)
+ os=-os400
+ ;;
+ -wince*)
+ os=-wince
+ ;;
+ -osfrose*)
+ os=-osfrose
+ ;;
+ -osf*)
+ os=-osf
+ ;;
+ -utek*)
+ os=-bsd
+ ;;
+ -dynix*)
+ os=-bsd
+ ;;
+ -acis*)
+ os=-aos
+ ;;
+ -atheos*)
+ os=-atheos
+ ;;
+ -syllable*)
+ os=-syllable
+ ;;
+ -386bsd)
+ os=-bsd
+ ;;
+ -ctix* | -uts*)
+ os=-sysv
+ ;;
+ -nova*)
+ os=-rtmk-nova
+ ;;
+ -ns2 )
+ os=-nextstep2
+ ;;
+ -nsk*)
+ os=-nsk
+ ;;
+ # Preserve the version number of sinix5.
+ -sinix5.*)
+ os=`echo $os | sed -e 's|sinix|sysv|'`
+ ;;
+ -sinix*)
+ os=-sysv4
+ ;;
+ -tpf*)
+ os=-tpf
+ ;;
+ -triton*)
+ os=-sysv3
+ ;;
+ -oss*)
+ os=-sysv3
+ ;;
+ -svr4)
+ os=-sysv4
+ ;;
+ -svr3)
+ os=-sysv3
+ ;;
+ -sysvr4)
+ os=-sysv4
+ ;;
+ # This must come after -sysvr4.
+ -sysv*)
+ ;;
+ -ose*)
+ os=-ose
+ ;;
+ -es1800*)
+ os=-ose
+ ;;
+ -xenix)
+ os=-xenix
+ ;;
+ -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+ os=-mint
+ ;;
+ -aros*)
+ os=-aros
+ ;;
+ -kaos*)
+ os=-kaos
+ ;;
+ -none)
+ ;;
+ *)
+ # Get rid of the `-' at the beginning of $os.
+ os=`echo $os | sed 's/[^-]*-//'`
+ echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
+ exit 1
+ ;;
+esac
+else
+
+# Here we handle the default operating systems that come with various machines.
+# The value should be what the vendor currently ships out the door with their
+# machine or put another way, the most popular os provided with the machine.
+
+# Note that if you're going to try to match "-MANUFACTURER" here (say,
+# "-sun"), then you have to tell the case statement up towards the top
+# that MANUFACTURER isn't an operating system. Otherwise, code above
+# will signal an error saying that MANUFACTURER isn't an operating
+# system, and we'll never get to this point.
+
+case $basic_machine in
+ *-acorn)
+ os=-riscix1.2
+ ;;
+ arm*-rebel)
+ os=-linux
+ ;;
+ arm*-semi)
+ os=-aout
+ ;;
+ c4x-* | tic4x-*)
+ os=-coff
+ ;;
+ # This must come before the *-dec entry.
+ pdp10-*)
+ os=-tops20
+ ;;
+ pdp11-*)
+ os=-none
+ ;;
+ *-dec | vax-*)
+ os=-ultrix4.2
+ ;;
+ m68*-apollo)
+ os=-domain
+ ;;
+ i386-sun)
+ os=-sunos4.0.2
+ ;;
+ m68000-sun)
+ os=-sunos3
+ # This also exists in the configure program, but was not the
+ # default.
+ # os=-sunos4
+ ;;
+ m68*-cisco)
+ os=-aout
+ ;;
+ mips*-cisco)
+ os=-elf
+ ;;
+ mips*-*)
+ os=-elf
+ ;;
+ or32-*)
+ os=-coff
+ ;;
+ *-tti) # must be before sparc entry or we get the wrong os.
+ os=-sysv3
+ ;;
+ sparc-* | *-sun)
+ os=-sunos4.1.1
+ ;;
+ *-be)
+ os=-beos
+ ;;
+ *-ibm)
+ os=-aix
+ ;;
+ *-wec)
+ os=-proelf
+ ;;
+ *-winbond)
+ os=-proelf
+ ;;
+ *-oki)
+ os=-proelf
+ ;;
+ *-hp)
+ os=-hpux
+ ;;
+ *-hitachi)
+ os=-hiux
+ ;;
+ i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
+ os=-sysv
+ ;;
+ *-cbm)
+ os=-amigaos
+ ;;
+ *-dg)
+ os=-dgux
+ ;;
+ *-dolphin)
+ os=-sysv3
+ ;;
+ m68k-ccur)
+ os=-rtu
+ ;;
+ m88k-omron*)
+ os=-luna
+ ;;
+ *-next )
+ os=-nextstep
+ ;;
+ *-sequent)
+ os=-ptx
+ ;;
+ *-crds)
+ os=-unos
+ ;;
+ *-ns)
+ os=-genix
+ ;;
+ i370-*)
+ os=-mvs
+ ;;
+ *-next)
+ os=-nextstep3
+ ;;
+ *-gould)
+ os=-sysv
+ ;;
+ *-highlevel)
+ os=-bsd
+ ;;
+ *-encore)
+ os=-bsd
+ ;;
+ *-sgi)
+ os=-irix
+ ;;
+ *-siemens)
+ os=-sysv4
+ ;;
+ *-masscomp)
+ os=-rtu
+ ;;
+ f30[01]-fujitsu | f700-fujitsu)
+ os=-uxpv
+ ;;
+ *-rom68k)
+ os=-coff
+ ;;
+ *-*bug)
+ os=-coff
+ ;;
+ *-apple)
+ os=-macos
+ ;;
+ *-atari*)
+ os=-mint
+ ;;
+ *)
+ os=-none
+ ;;
+esac
+fi
+
+# Here we handle the case where we know the os, and the CPU type, but not the
+# manufacturer. We pick the logical manufacturer.
+vendor=unknown
+case $basic_machine in
+ *-unknown)
+ case $os in
+ -riscix*)
+ vendor=acorn
+ ;;
+ -sunos*)
+ vendor=sun
+ ;;
+ -aix*)
+ vendor=ibm
+ ;;
+ -beos*)
+ vendor=be
+ ;;
+ -hpux*)
+ vendor=hp
+ ;;
+ -mpeix*)
+ vendor=hp
+ ;;
+ -hiux*)
+ vendor=hitachi
+ ;;
+ -unos*)
+ vendor=crds
+ ;;
+ -dgux*)
+ vendor=dg
+ ;;
+ -luna*)
+ vendor=omron
+ ;;
+ -genix*)
+ vendor=ns
+ ;;
+ -mvs* | -opened*)
+ vendor=ibm
+ ;;
+ -os400*)
+ vendor=ibm
+ ;;
+ -ptx*)
+ vendor=sequent
+ ;;
+ -tpf*)
+ vendor=ibm
+ ;;
+ -vxsim* | -vxworks* | -windiss*)
+ vendor=wrs
+ ;;
+ -aux*)
+ vendor=apple
+ ;;
+ -hms*)
+ vendor=hitachi
+ ;;
+ -mpw* | -macos*)
+ vendor=apple
+ ;;
+ -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+ vendor=atari
+ ;;
+ -vos*)
+ vendor=stratus
+ ;;
+ esac
+ basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
+ ;;
+esac
+
+echo $basic_machine$os
+exit 0
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "timestamp='"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:
diff --git a/configure.in b/configure.in
index 8779e983a1..d922bd20da 100644
--- a/configure.in
+++ b/configure.in
@@ -1,42 +1,11 @@
dnl Process this file with autoconf to produce a configure script.
-dnl {
AC_INIT()
-AC_CONFIG_AUX_DIR(tool)
-AC_PREREQ(2.60)
-
-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_DEFUN([when], dnl [(] makes parentheses balanced.
-dnl note that spaces after comma need to be quoted.
-[[$*]][)])
-
-dnl environment section {
-
-AC_ARG_WITH(baseruby,
- AS_HELP_STRING([--with-baseruby=RUBY], [ use RUBY as baseruby; RUBY is the pathname of ruby]),
- [
- case "$withval" in
- when(*ruby*)
- BASERUBY=$withval
- ;;
- when(*)
- AC_MSG_ERROR(need ruby)
- ;;
- esac
- ],
- [
- BASERUBY="ruby"
- ])
-test "`RUBYOPT=- $BASERUBY -e 'p 42' 2>/dev/null`" = 42 ||
- BASERUBY="echo executable host ruby is required. use --with-baseruby option.; false"
-AC_SUBST(BASERUBY)
+AC_PREREQ(2.58)
AC_DEFUN([RUBY_MINGW32],
[case "$host_os" in
-when(cygwin*)
+cygwin*)
AC_CACHE_CHECK(for mingw32 environment, rb_cv_mingw32,
[AC_TRY_CPP([
#ifndef __MINGW32__
@@ -75,31 +44,31 @@ fi
GNU_LD=$rb_cv_prog_gnu_ld
AC_SUBST(GNU_LD)])
-eval `sed -n 's/^#define RUBY_VERSION_\([A-Z][A-Z_0-9]*\) \([0-9][0-9]*\)/\1=\2/p' $srcdir/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
+unset GREP_OPTIONS
+rb_version=`grep RUBY_VERSION $srcdir/version.h`
+MAJOR=`expr "$rb_version" : '#define RUBY_VERSION "\([0-9][0-9]*\)\.[0-9][0-9]*\.[0-9][0-9]*"'`
+MINOR=`expr "$rb_version" : '#define RUBY_VERSION "[0-9][0-9]*\.\([0-9][0-9]*\)\.[0-9][0-9]*"'`
+TEENY=`expr "$rb_version" : '#define RUBY_VERSION "[0-9][0-9]*\.[0-9][0-9]*\.\([0-9][0-9]*\)"'`
+if test "$MAJOR" = ""; then
+ AC_MSG_ERROR(could not determine MAJOR number from version.h)
+fi
+if test "$MINOR" = ""; then
+ AC_MSG_ERROR(could not determine MINOR number from version.h)
+fi
+if test "$TEENY" = ""; then
+ AC_MSG_ERROR(could not determine TEENY number from version.h)
+fi
AC_SUBST(MAJOR)
AC_SUBST(MINOR)
AC_SUBST(TEENY)
-if test "$MAJOR" = "1"; then
- AC_DEFINE(CANONICALIZATION_FOR_MATHN)
-fi
dnl checks for alternative programs
-AC_ARG_WITH(gcc,
- AS_HELP_STRING([--without-gcc], [never use gcc]),
- [
+AC_ARG_WITH(gcc, [ --without-gcc never use gcc], [
case $withval in
- when(no)
- : ${CC=cc}
+ no) : ${CC=cc}
;;
- when(yes)
- : ${CC=gcc}
+ yes) : ${CC=gcc}
;;
- when(*)
- CC=$withval
+ *) CC=$withval
;;
esac])
dnl If the user switches compilers, we can't believe the cache
@@ -112,132 +81,88 @@ fi
if test "$program_prefix" = NONE; then
program_prefix=
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_CANONICAL_TARGET
target_os=`echo $target_os | sed 's/linux-gnu$/linux/;s/linux-gnu/linux-/'`
ac_install_sh='' # unusable for extension libraries.
-AC_DEFUN([RUBY_APPEND_OPTION],
- [case " [$]{$1-} " in # RUBY_APPEND_OPTION($1, $2)
- when(*' $2 '*);; when(' ') $1="$2";; when(*) $1="[$]$1 $2";;
- esac])
-AC_DEFUN([RUBY_APPEND_OPTIONS],
- [{ for rb_opt in $2; do # RUBY_APPEND_OPTIONS($1, $2)
- case " [$]{$1-} " in
- when(*" [$]{rb_opt} "*);; when(' ') $1="[$]{rb_opt}";; when(*) $1="[$]$1 [$]{rb_opt}";;
- esac
- done; }])
-AC_DEFUN([RUBY_PREPEND_OPTION],
- [case " [$]{$1-} " in # RUBY_PREPEND_OPTION($1, $2)
- when(*' $2 '*);; when(' ') $1="$2";; when(*) $1="$2 [$]$1";;
- esac])
-AC_DEFUN([RUBY_PREPEND_OPTIONS],
- [{ unset rb_opts; for rb_opt in $2; do # RUBY_PREPEND_OPTIONS($1, $2)
- case " [$]{rb_opts} [$]{$1-} " in
- when(*" [$]{rb_opt} "*);; when(' ') $1="[$]{rb_opt}";; when(*) rb_opts="[$]{rb_opts}[$]{rb_opt} ";;
- esac
- done
- $1="[$]{rb_opts}[$]$1"; }])
-
-AC_ARG_WITH(arch,
- AS_HELP_STRING([--with-arch=ARCHS],
- [build an Apple/NeXT Multi Architecture Binary (MAB);
+ifelse(currently,disabled, [
+dnl checks for fat-binary
+AC_ARG_ENABLE(fat-binary,
+ [ --enable-fat-binary=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])
-test ${CFLAGS+set} && CFLAGS=`echo "$CFLAGS" | sed 's/ *-arch *[^ ]*//g'`
-test ${LDFLAGS+set} && LDFLAGS=`echo "$LDFLAGS" | sed 's/ *-arch *[^ ]*//g'`
-unset ARCH_FLAG universal_binary universal_archnames
-if test ${target_archs+set}; then
+ which to build; if ARCHS is omitted, then the package
+ will be built for all architectures supported by the
+ platform ("ppc" for MacOS/X and Darwin; "ppc,i386"
+ for Rhapsody; "m68k,i386,sparc" for OpenStep;
+ "m68k,i386,sparc,hppa" for NextStep); if this option
+ is disabled or omitted entirely, then the package
+ will be built only for the target platform],
+ [fat_binary=$enableval], [fat_binary=no])
+if test "$fat_binary" != no; then
+
AC_MSG_CHECKING([target architectures])
- target_archs=`echo $target_archs | tr , ' '`
+
+ # Respect TARGET_ARCHS setting from environment if available.
+ if test -z "$TARGET_ARCHS"; then
+ # Respect ARCH given to --enable-fat-binary if present.
+ if test "$fat_binary" != yes; then
+ TARGET_ARCHS=`echo "$fat_binary" | tr ',' ' '`
+ else
+ # Choose a default set of architectures based upon platform.
+ case "$target_os" in
+ darwin*)
+ TARGET_ARCHS="ppc"
+ ;;
+ rhapsody*)
+ TARGET_ARCHS="ppc i386"
+ ;;
+ openstep*)
+ TARGET_ARCHS="m68k i386 sparc"
+ ;;
+ nextstep*)
+ TARGET_ARCHS="m68k i386 sparc hppa"
+ ;;
+ *)
+ TARGET_ARCHS=`arch`
+ esac
+ fi
+ fi
+
+ AC_MSG_RESULT([$TARGET_ARCHS])
+
# /usr/lib/arch_tool -archify_list $TARGET_ARCHS
- for archs in $target_archs
+ ARCH_FLAG=
+ for archs in $TARGET_ARCHS
do
- case ",$universal_binary," in
- when(*",$archs,"*)
- ;;
- when(*)
- 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"
- ;;
- esac
+ ARCH_FLAG="$ARCH_FLAG -arch $archs"
done
- target_archs="$universal_binary"
- unset universal_binary
- case "$target_archs" in
- when(*,*) universal_binary=yes;;
- when(*) unset universal_archnames;;
- esac
- AC_MSG_RESULT([$target_archs])
-
- if test "${universal_binary-no}" = yes; then
- RUBY_PREREQ_AC(2.63, [ to compile universal binary])
- AC_SUBST(try_header,try_compile)
- target=`echo $target | sed "s/^$target_cpu-/universal-/"`
- target_alias=`echo $target_alias | sed "s/^$target_cpu-/universal-/"`
- target_cpu=universal
- else
- target=`echo $target | sed "s/^$target_cpu-/${target_archs}-/"`
- target_alias=`echo $target_alias | sed "s/^$target_cpu-/${target_archs}-/"`
- target_cpu=${target_archs}
- fi
- CFLAGS="$CFLAGS ${ARCH_FLAG}"
- LDFLAGS="${LDFLAGS+$LDFLAGS }${ARCH_FLAG}"
-else
- target_archs="$target_cpu"
+ AC_DEFINE(NEXT_FAT_BINARY)
fi
+], [fat_binary=no])
case $target_cpu in
- when(i?86) frame_address=yes;;
- when(*) frame_address=no;;
+ i?86) frame_address=yes;;
+ *) frame_address=no;;
esac
AC_ARG_ENABLE(frame-address,
- AS_HELP_STRING([--enable-frame-address], [use GCC __builtin_frame_address()]),
+ [ --enable-frame-address use GCC __builtin_frame_address(). ],
[frame_address=$enableval])
if test $frame_address = yes; then
AC_DEFINE(USE_BUILTIN_FRAME_ADDRESS)
fi
-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.
-if test -z "${CFLAGS+set}"; then
- orig_cflags="$cflags"
- cflags="$cflags "'${optflags} ${debugflags} ${warnflags}'
-fi
-if test -z "${CXXFLAGS+set}"; then
- orig_cxxflags="$cxxflags"
- cxxflags="$cxxflags "'${optflags} ${debugflags} ${warnflags}'
-fi
-
if test x"${build}" != x"${host}"; then
AC_CHECK_TOOL(CC, gcc)
fi
AC_PROG_CC
-AC_PROG_CXX
AC_PROG_GCC_TRADITIONAL
-test $ac_cv_prog_cc_g = yes && : ${debugflags=-g}
if test "$GCC" = yes; then
linker_flag=-Wl,
- : ${optflags=-O3}
else
linker_flag=
fi
@@ -246,12 +171,15 @@ RUBY_PROG_GNU_LD
RUBY_CPPOUTFILE
: ${OUTFLAG='-o '}
-: ${COUTFLAG=${OUTFLAG}}
AC_SUBST(OUTFLAG)
-AC_SUBST(COUTFLAG)
RUBY_MINGW32
+AC_PROG_YACC
+if test "$YACC" = "yacc"; then
+ AC_DEFINE([OLD_YACC])
+fi
+
AC_CHECK_TOOL(RANLIB, ranlib, :)
AC_CHECK_TOOL(AR, ar)
if test -z "$AR"; then
@@ -263,23 +191,15 @@ ASFLAGS=$ASFLAGS
AC_SUBST(ASFLAGS)
case "$target_os" in
-when(cygwin*|mingw*|darwin*)
- ac_cv_prog_ac_ct_OBJCOPY=":";;
-esac
-
-# BSD's ports and MacPorts prefix GNU binutils with 'g'
-AC_CHECK_TOOLS(OBJDUMP, [objdump gobjdump])
-AC_CHECK_TOOLS(OBJCOPY, [objcopy gobjcopy])
-
-case "$target_os" in
-when(cygwin*|mingw*)
+cygwin*|mingw*)
AC_CHECK_TOOL(NM, nm)
AC_CHECK_TOOL(WINDRES, windres)
AC_CHECK_TOOL(DLLWRAP, dllwrap)
target_cpu=`echo $target_cpu | sed s/i.86/i386/`
case "$target_os" in
- when(mingw*)
+ mingw*)
test "$rb_cv_msvcrt" = "" && unset rb_cv_msvcrt
+ AC_CHECK_TOOL(OBJDUMP, objdump)
AC_CACHE_CHECK(for mingw32 runtime DLL, rb_cv_msvcrt, [
AC_TRY_LINK([#include <stdio.h>],
[FILE* volatile f = stdin; return 0;],
@@ -288,13 +208,22 @@ when(cygwin*|mingw*)
sed -n '/^[[ ]]*dll name: \(msvc.*\)\.dll$/{s//\1/p;q;}'`],
[rb_cv_msvcrt=msvcrt])
test "$rb_cv_msvcrt" = "" && rb_cv_msvcrt=msvcrt])
+ AC_ARG_WITH(winsock2,
+ [ --with-winsock2 link winsock2 (MinGW only)], [
+ case $withval in
+ yes) with_winsock2=yes;;
+ *) with_winsock2=no;;
+ esac], [with_winsock2=no])
+ if test "$with_winsock2" = yes; then
+ AC_DEFINE(USE_WINSOCK2)
+ fi
esac
: ${enable_shared=yes}
;;
-when(aix*)
+aix*)
AC_CHECK_TOOL(NM, nm, /usr/ccs/bin/nm, /usr/ccs/bin:$PATH)
;;
-when(hiuxmpp*)
+hiuxmpp*)
# by TOYODA Eizi <toyoda@npd.kishou.go.jp>
AC_DEFINE(__HIUX_MPP__)
;;
@@ -304,61 +233,18 @@ AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_PROG_INSTALL
-AC_CHECK_TOOL(DOT, dot)
-AC_CHECK_TOOL(DOXYGEN, doxygen)
-
# checks for UNIX variants that set C preprocessor variables
-AC_USE_SYSTEM_EXTENSIONS
+AC_AIX
+AC_MINIX
AC_SUBST(RM, ['rm -f'])
AC_SUBST(CP, ['cp'])
if $as_mkdir_p; then
- MAKEDIRS='mkdir -p'
+ AC_SUBST(MAKEDIRS, ['mkdir -p'])
else
- MAKEDIRS='install -d'
-fi
-AC_SUBST(MAKEDIRS)
-AC_SUBST(RMDIRS, ['$(top_srcdir)/tool/rmdirs'])
-AC_SUBST(RMALL, ['rm -fr'])
-
-AC_MSG_CHECKING([for cd using phisical 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 -e 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)
-
-dnl }
-dnl compiler section {
-
-if test "$GCC:${warnflags+set}:no" = yes::no; then
- save_CFLAGS="$CFLAGS"
- for wflag in -Wno-missing-field-initializers -Wshorten-64-to-32; do
- CFLAGS="$CFLAGS $wflag"
- AC_MSG_CHECKING([whether $wflag is accepted])
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],
- [warnflags="${warnflags+$warnflags }$wflag"
- AC_MSG_RESULT(yes)],
- [AC_MSG_RESULT(no)])
- done
- CFLAGS="$save_CFLAGS"
- unset save_CFLAGS
- warnflags="-Wall -Wno-unused-parameter -Wno-parentheses ${warnflags+$warnflags }-Wpointer-arith -Wwrite-strings"
+ AC_SUBST(MAKEDIRS, ['install -d'])
fi
-test -z "${ac_env_CFLAGS_set}" -a -n "${cflags+set}" && eval CFLAGS="\"$cflags $ARCH_FLAG\""
-test -z "${ac_env_CXXFLAGS_set}" -a -n "${cxxflags+set}" && eval CXXFLAGS="\"$cxxflags $ARCH_FLAG\""
-
dnl check for large file stuff
mv confdefs.h confdefs1.h
: > confdefs.h
@@ -367,159 +253,23 @@ mv confdefs.h largefile.h
mv confdefs1.h confdefs.h
cat largefile.h >> confdefs.h
-case "$target_os" in
-when(mingw*)
- ac_cv_type_off_t=yes
- ac_cv_sizeof_off_t=8
- ;;
-esac
-
AC_CHECK_TYPES([long long, off_t])
-AC_CACHE_CHECK([char bit], [rb_cv_char_bit],
- [_AC_COMPUTE_INT_COMPILE([CHAR_BIT], [rb_cv_char_bit],
- [AC_INCLUDES_DEFAULT([@%:@include <limits.h>])], [rb_cv_char_bit=8])])
-
-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], [case "${AS_TR_SH(ac_cv_sizeof_$1)}" in
- when([SIZEOF_*]);;
- when(*)])
- _AC_COMPUTE_INT_COMPILE(AS_TR_CPP(SIZEOF_$1), [t], [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], [unset t])
- if test ${t-0} != 0; then
- AS_TR_SH(ac_cv_sizeof_$1)="${AS_TR_SH(ac_cv_sizeof_$1)+${AS_TR_SH(ac_cv_sizeof_$1)-} }${t}"
- fi
- m4_ifval([$2][$3], [;; esac])
- : ${AS_TR_SH(ac_cv_sizeof_$1)=0}
-])
-{
- unset cond
- for t in ${AS_TR_SH(ac_cv_sizeof_$1)-}; do
- case "$t" in
- when([[0-9]*|SIZEOF_*])
- ${cond+echo "@%:@else"}
- echo "[@%:@define ]AS_TR_CPP(SIZEOF_$1) [$t]"
- break
- ;;
- when([*])
- 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
- ;;
- esac
- 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(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>])
-
-dnl RUBY_REPLACE_TYPE [typename] [default type] [macro type] [included]
-AC_DEFUN([RUBY_REPLACE_TYPE], [dnl
- AC_CHECK_TYPE([$1], [n=[$1]], [n=[$2]], [$4])
- AC_CACHE_CHECK([for convertible type of [$1]], rb_cv_[$1]_convertible, [
- u= t=
- case "$n " in
- when(*" signed "*) ;;
- when(*" unsigned "*)
- u=U;;
- when(*)
- AC_COMPILE_IFELSE(
- [AC_LANG_BOOL_COMPILE_TRY([AC_INCLUDES_DEFAULT([$4])], [($n)-1 > 0])],
- [u=U]);;
- esac
- 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
- case " $n " in
- when(*" long long "*)
- t=LL;;
- when(*" long "*)
- t=LONG;;
- when(*)
- t=INT;;
- esac
- rb_cv_[$1]_convertible=${u}${t}])
- m4_ifval([$2], AC_DEFINE_UNQUOTED(rb_[$1], $n))
- 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,
- ["`echo ${rb_cv_[$1]_convertible} | sed ['s/^U//;s/[^L].*//;y/L/l/']`"])
-])
-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>])
+AC_CHECK_SIZEOF(int, 4)
+AC_CHECK_SIZEOF(short, 2)
+AC_CHECK_SIZEOF(long, 4)
+AC_CHECK_SIZEOF(long long, 0)
+AC_CHECK_SIZEOF(__int64, 0)
+AC_CHECK_SIZEOF(off_t, 0)
+AC_CHECK_SIZEOF(void*, 4)
+AC_CHECK_SIZEOF(float, 4)
+AC_CHECK_SIZEOF(double, 8)
+AC_CHECK_SIZEOF(time_t, 0)
+
+for id in pid_t gid_t uid_t; do
+ AC_CHECK_TYPE($id, [typ=$id], [typ=int])
+ AC_DEFINE_UNQUOTED(rb_$id, $typ)
+done
AC_CACHE_CHECK(for prototypes, rb_cv_have_prototypes,
[AC_TRY_COMPILE([int foo(int x) { return 0; }], [return foo(10);],
@@ -540,41 +290,6 @@ 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>
@@ -593,27 +308,6 @@ 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([@%:@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],[test "$1" && cat <<EOH >> confdefs.h
-@%:@if $1
-EOH
-])dnl
-AC_DEFINE_UNQUOTED($2, $3)
- m4_ifval([$1],[test "$1" && cat <<EOH >> confdefs.h
-@%:@endif /* $1 */
-EOH
-])dnl
-])dnl
-
AC_DEFUN([RUBY_FUNC_ATTRIBUTE], [dnl
m4_ifval([$2], dnl
[AS_VAR_PUSHDEF([attrib],[$2])], dnl
@@ -623,7 +317,6 @@ m4_ifval([$3], dnl
[AS_VAR_PUSHDEF([rbcv],[$3])], dnl
[AS_VAR_PUSHDEF([rbcv],[rb_cv_func_][$1])]dnl
)dnl
-m4_ifval([$4], [rbcv_cond=[$4]; test "$rbcv_cond" || unset rbcv_cond])
AC_CACHE_CHECK(for [$1] function attribute, rbcv,
[rbcv=x
if test "${ac_c_werror_flag+set}"; then
@@ -633,14 +326,9 @@ else
fi
ac_c_werror_flag=yes
for mac in "__attribute__ (($1)) x" "x __attribute__ (($1))" "__declspec($1) 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));], [],
+ [#define ]attrib[(x) $mac
+ ]attrib[(void conftest_attribute_check(void));], [],
[rbcv="$mac"; break])
done
if test "${rb_c_werror_flag+set}"; then
@@ -649,38 +337,14 @@ else
unset ac_c_werror_flag
fi
])
-if test "$rbcv" != x; then
- RUBY_DEFINE_IF([${rbcv_cond}], attrib[(x)], $rbcv)
-fi
+AC_DEFINE_UNQUOTED(attrib[(x)], $rbcv)
AS_VAR_POPDEF([attrib])
AS_VAR_POPDEF([rbcv])
])
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})
-
-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_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
-fi
-
AC_CACHE_CHECK([for RUBY_EXTERN], rb_cv_ruby_extern,
[rb_cv_ruby_extern=no
for mac in "__attribute__((dllimport))" "__declspec(dllimport)"; do
@@ -690,155 +354,63 @@ for mac in "__attribute__((dllimport))" "__declspec(dllimport)"; do
done])
test "x$rb_cv_ruby_extern" = xno || AC_DEFINE_UNQUOTED(RUBY_EXTERN, $rb_cv_ruby_extern)
-RUBY_APPEND_OPTION(XCFLAGS, -DRUBY_EXPORT)
-
-dnl }
-dnl header and library section {
+XCFLAGS="$XCFLAGS -DRUBY_EXPORT"
dnl Check whether we need to define sys_nerr locally
AC_CHECK_DECLS([sys_nerr], [], [], [$ac_includes_default
#include <errno.h>])
-AC_ARG_ENABLE(win95,
- AS_HELP_STRING([--enable-win95], [enable Windows 95 series support]),
- [case "$enableval" in
- when(yes|no) enable_win95=$enableval;;
- when(*) unset enable_win95;;
- esac])
-
-case "$target_os" in
-when(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_default=$rb_cv_enable_pthread_default
- ;;
-when(mingw*)
- enable_pthread_default=no
- ;;
-when(*)
- enable_pthread_default=yes
- ;;
-esac
+dnl whether link libc_r or not
+AC_ARG_WITH(libc_r,
+ [ --with-libc_r link libc_r if possible (FreeBSD only)], [
+ case $withval in
+ yes) with_libc_r=yes;;
+ *) with_libc_r=no;;
+ esac], [with_libc_r=no])
AC_ARG_ENABLE(pthread,
- AS_HELP_STRING([--enable-pthread], [use pthread library]),
- [enable_pthread=$enableval], [enable_pthread=$enable_pthread_default])
+ [ --enable-pthread use pthread library.],
+ [enable_pthread=$enableval], [enable_pthread=no])
-dnl Checks for libraries.
-case "$target_os" in
-when(*bsd*|dragonfly*)
- ;;
-when(*)
- ac_cv_func_daemon=no
- ;;
-esac
+AC_ARG_ENABLE(fastthread,
+ [ --disable-fastthread do not use the fastthread mutex], [
+ : handled by ext/thread/extconf.rb
+ ])
+dnl Checks for libraries.
case "$target_os" in
-when(nextstep*) ;;
-when(openstep*) ;;
-when(rhapsody*) ;;
-when(darwin*) RUBY_PREPEND_OPTION(LIBS, -lobjc)
- RUBY_APPEND_OPTIONS(CPPFLAGS, -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE)
- AC_MSG_CHECKING(whether Mac OS X 10.5 or later)
+nextstep*) ;;
+openstep*) ;;
+rhapsody*) ;;
+darwin*) LIBS="-lobjc $LIBS"
+ CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE"
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_header_ucontext_h=no
- else
+ [
+ test "x$target_cpu" = xpowerpc && ac_cv_header_ucontext_h=no
+ ],
+ [
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_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()
-{
- char buf[256];
- strcpy(buf, crypt("", "\xE0\xA0"));
- return strcmp(buf, crypt("", "\xE0\xA0"));
-}
-],
- 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
+ ])
;;
-when(hpux*) LIBS="-lm $LIBS"
+hpux*) LIBS="-lm $LIBS"
ac_cv_c_inline=no;;
-when(human*) ac_cv_func_getpgrp_void=yes
+human*) ac_cv_func_getpgrp_void=yes
ac_cv_func_setitimer=no
- AC_CHECK_LIB(signal, _harderr)
- AC_CHECK_LIB(hmem, hmemset)
- AC_CHECK_FUNCS(select)
- AC_CACHE_CHECK(whether PD libc _dtos18 fail to convert big number,
- rb_cv_missing__dtos18,
- [AC_TRY_RUN([
-#include <stdio.h>
-int
-main()
-{
- char buf[256];
- sprintf(buf, "%g", 1e+300);
- return (strcmp (buf, "1e+300") ? 0 : 1);
-}
-],
- rb_cv_missing__dtos18=yes, rb_cv_missing__dtos18=no, rb_cv_missing__dtos18=no)])
- if test "$rb_cv_missing__dtos18" = yes; then
- AC_DEFINE(MISSING__DTOS18)
- fi
- AC_CACHE_CHECK(whether PD libc fconvert fail to round,
- rb_cv_missing_fconvert,
- [AC_TRY_RUN([
-#include <stdio.h>
-#include <math.h>
-int
-main()
-{
- char buf[256];
- sprintf(buf, "%f", log(exp(1.0)));
- return (strcmp (buf, "1.000000") ? 0 : 1);
-}
-],
- rb_cv_missing_fconvert=yes, rb_cv_missing_fconvert=no, rb_cv_missing_fconvert=no)])
- if test "$rb_cv_missing_fconvert" = yes; then
- AC_DEFINE(MISSING_FCONVERT)
- fi
- ;;
-when(beos*|haiku*)
- ac_cv_func_link=no
- ac_cv_func_sched_yield=no
- ac_cv_func_pthread_attr_setinheritsched=no
- case "$target_os" in
- when(beos*) ac_cv_header_net_socket_h=yes;;
- when(haiku*) ac_cv_func_shutdown=no;;
- esac
- LIBS="$LIBS" # m lib is include in root under BeOS/Haiku
- ;;
-when(cygwin*) ac_cv_header_langinfo_h=yes
- AC_LIBOBJ([langinfo])
;;
-when(mingw*) LIBS="-lshell32 -lws2_32 $LIBS"
+beos*) ac_cv_func_link=no;;
+cygwin*) ;;
+mingw*) if test "$with_winsock2" = yes; then
+ LIBS="-lws2_32 $LIBS"
+ else
+ LIBS="-lwsock32 $LIBS"
+ fi
+ LIBS="-lshell32 $LIBS"
ac_cv_header_a_out_h=no
ac_cv_header_pwd_h=no
ac_cv_header_utime_h=no
@@ -848,19 +420,16 @@ when(mingw*) LIBS="-lshell32 -lws2_32 $LIBS"
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_vsnprintf=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_func_truncate=yes
- ac_cv_func_fseeko=yes
- ac_cv_func_ftello=yes
ac_cv_lib_crypt_crypt=no
ac_cv_func_getpgrp_void=no
ac_cv_func_setpgrp_void=yes
@@ -868,77 +437,91 @@ when(mingw*) LIBS="-lshell32 -lws2_32 $LIBS"
ac_cv_lib_dl_dlopen=no
rb_cv_binary_elf=no
rb_cv_negative_time_t=no
+ enable_pthread=no
ac_cv_func_fcntl=yes
- ac_cv_func_flock=yes
- AC_LIBOBJ([langinfo])
- : ${enable_win95=maybe}
;;
-when(os2-emx*) LIBS="-lm $LIBS"
+os2-emx*) LIBS="-lm $LIBS"
ac_cv_lib_dir_opendir=no;;
-when(msdosdjgpp*)
- LIBS="-lm $LIBS"
+msdosdjgpp*) LIBS="-lm $LIBS"
ac_cv_func_getpgrp_void=yes
ac_cv_func_setitimer=no
- ac_cv_sizeof_rlim_t=4
- ac_cv_func_fork=no
+ ac_cv_sizeof_rlim_t=4
ac_cv_func_setrlimit=no
- ac_cv_header_sys_socket_h=no
;;
-when(bsdi*) LIBS="-lm $LIBS"
+bsdi*) LIBS="-lm $LIBS"
AC_DEFINE(BROKEN_SETREUID, 1)
AC_DEFINE(BROKEN_SETREGID, 1)
ac_cv_sizeof_rlim_t=8;;
-when(freebsd*) LIBS="-lm $LIBS"
+freebsd*) LIBS="-lm $LIBS"
+ AC_CACHE_CHECK([whether -lxpg4 has to be linked],
+ rb_cv_lib_xpg4_needed,
+ [AC_TRY_CPP([
+#include <osreldate.h>
+#if __FreeBSD_version < 400020 || \
+ (__FreeBSD_version >= 500000 && __FreeBSD_version < 500005)
+#error needs libxpg4
+#endif
+ ],
+ rb_cv_lib_xpg4_needed=no,
+ rb_cv_lib_xpg4_needed=yes,
+ rb_cv_lib_xpg4_needed=yes)])
+ if test "$rb_cv_lib_xpg4_needed" = yes; then
+ AC_CHECK_LIB(xpg4, setlocale)
+ fi
+ if test "$with_libc_r" = yes; then
+ AC_CACHE_CHECK([whether libc_r is supplementary to libc],
+ rb_cv_supplementary_lib_c_r,
+ [AC_TRY_CPP([
+#include <osreldate.h>
+#if 500016 <= __FreeBSD_version
+#error libc_r is supplementary to libc
+#endif
+ ],
+ rb_cv_supplementary_lib_c_r=no,
+ rb_cv_supplementary_lib_c_r=yes,
+ rb_cv_supplementary_lib_c_r=yes)])
+ if test "$rb_cv_supplementary_lib_c_r" = yes; then
+ MAINLIBS="-lc_r $MAINLIBS"
+ fi
+ fi
;;
-when(dragonfly*) LIBS="-lm $LIBS"
+dragonfly*) LIBS="-lm $LIBS"
;;
-when(bow) ac_cv_func_setitimer=no
+bow) ac_cv_func_setitimer=no
;;
-when(superux*) ac_cv_func_setitimer=no
+superux*) ac_cv_func_setitimer=no
+ ;;
+solaris*2.1*) if test -z "$GCC"; then
+ ac_cv_func_isinf=yes
+ fi
+ LIBS="-lm $LIBS"
;;
-when(*) LIBS="-lm $LIBS";;
+*) LIBS="-lm $LIBS";;
esac
AC_CHECK_LIB(crypt, crypt)
AC_CHECK_LIB(dl, dlopen) # Dynamic linking for SunOS/Solaris and SYSV
AC_CHECK_LIB(dld, shl_load) # Dynamic linking for HP-UX
-AC_CHECK_LIB(socket, socketpair) # SunOS/Solaris
AC_CHECK_LIB(rt, clock_gettime) # GNU/Linux
-if test "${enable_win95}" = maybe; then
- AC_HAVE_LIBRARY(unicows, [enable_win95=yes], [enable_win95=no])
-fi
-if test "${enable_win95}" = yes; then
- AC_DEFINE(WIN95)
- LIBS="-lunicows $LIBS"
-fi
case "$target_cpu" in
-when(alpha*) case "$target_os"::"$GCC" in
- when(*::yes) CFLAGS="-mieee $CFLAGS" ;; # gcc
- when(osf*) CFLAGS="-ieee $CFLAGS" ;; # ccc
+alpha*) case "$target_os"::"$GCC" in
+ *::yes) CFLAGS="-mieee $CFLAGS" ;; # gcc
+ osf*) CFLAGS="-ieee $CFLAGS" ;; # ccc
esac ;;
esac
-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
-
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_STDC
AC_HEADER_SYS_WAIT
-AC_CHECK_HEADERS(limits.h sys/file.h sys/ioctl.h sys/syscall.h\
+AC_CHECK_HEADERS(stdlib.h string.h unistd.h limits.h sys/file.h sys/ioctl.h sys/syscall.h\
fcntl.h sys/fcntl.h sys/select.h sys/time.h sys/times.h sys/param.h\
- syscall.h pwd.h grp.h a.out.h utime.h direct.h sys/resource.h \
- sys/mkdev.h sys/utime.h xti.h netinet/in_systm.h float.h ieeefp.h \
- ucontext.h intrinsics.h langinfo.h locale.h sys/sendfile.h time.h \
- net/socket.h sys/socket.h)
+ syscall.h pwd.h grp.h a.out.h utime.h memory.h direct.h sys/resource.h \
+ sys/mkdev.h sys/utime.h netinet/in_systm.h float.h ieeefp.h pthread.h \
+ ucontext.h intrinsics.h)
dnl Check additional types.
-RUBY_CHECK_SIZEOF(rlim_t, [int long "long long"], [], [
+AC_CHECK_SIZEOF(rlim_t, 0, [
#ifdef HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif
@@ -954,106 +537,29 @@ RUBY_CHECK_SIZEOF(rlim_t, [int long "long long"], [], [
#include <stdio.h>
])
+dnl Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_SIZE_T
-RUBY_CHECK_SIZEOF(size_t, [int long void*], [], [@%:@include <sys/types.h>])
-RUBY_CHECK_SIZEOF(ptrdiff_t, size_t, [], [@%:@include <stddef.h>])
AC_STRUCT_ST_BLKSIZE
AC_STRUCT_ST_BLOCKS
AC_STRUCT_ST_RDEV
-RUBY_CHECK_SIZEOF([struct stat.st_size], [int long "long long"])
-if test "$ac_cv_member_struct_stat_st_blocks" = yes; then
- RUBY_CHECK_SIZEOF([struct stat.st_blocks], [int long "long long"])
-fi
-AC_CHECK_MEMBERS([struct stat.st_atim])
-AC_CHECK_MEMBERS([struct stat.st_atimespec])
-AC_CHECK_MEMBERS([struct stat.st_atimensec])
-AC_CHECK_MEMBERS([struct stat.st_mtim])
-AC_CHECK_MEMBERS([struct stat.st_mtimespec])
-AC_CHECK_MEMBERS([struct stat.st_mtimensec])
-AC_CHECK_MEMBERS([struct stat.st_ctim])
-AC_CHECK_MEMBERS([struct stat.st_ctimespec])
-AC_CHECK_MEMBERS([struct stat.st_ctimensec])
-
-AC_CHECK_TYPES([struct timespec], [], [], [@%:@ifdef HAVE_TIME_H
-@%:@include <time.h>
-@%:@endif])
-
-AC_CHECK_TYPE(fd_mask, [AC_DEFINE(HAVE_RB_FD_INIT, 1)])
-
-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],
- [case m4_bmatch([$2], [^[1-9][0-9]*$], $2, [$ac_cv_sizeof_]AS_TR_SH($2)) in
- when("1") rb_cv_type_$1="m4_if([$3], [], [signed ], [$3 ])char";;
- when("$ac_cv_sizeof_short") rb_cv_type_$1="m4_if([$3], [], [], [$3 ])short";;
- when("$ac_cv_sizeof_int") rb_cv_type_$1="m4_if([$3], [], [], [$3 ])int";;
- when("$ac_cv_sizeof_long") rb_cv_type_$1="m4_if([$3], [], [], [$3 ])long";;
- when("$ac_cv_sizeof_long_long") rb_cv_type_$1="m4_if([$3], [], [], [$3 ])long long";;
- when("$ac_cv_sizeof___int64") rb_cv_type_$1="m4_if([$3], [], [], [$3 ])__int64";;
- when(*) rb_cv_type_$1=no;;
- esac])])
-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.
-
-AC_CACHE_CHECK(for stack end address, rb_cv_stack_end_address,
-[rb_cv_stack_end_address=no
-for addr in __libc_stack_end _SEND; do
- AC_TRY_LINK(
- [extern void *$addr;],
- [if (!$addr) return 1;],
- [rb_cv_stack_end_address="$addr"; break])
-done])
-if test $rb_cv_stack_end_address != no; then
- AC_DEFINE_UNQUOTED(STACK_END_ADDRESS, $rb_cv_stack_end_address)
-fi
dnl Checks for library functions.
AC_TYPE_GETGROUPS
AC_TYPE_SIGNAL
-case "${target_cpu}-${target_os}:${target_archs}" in
-when(powerpc-darwin*)
+case "${target_cpu}-${target_os}" in
+powerpc-darwin*)
AC_LIBSOURCES(alloca.c)
AC_SUBST([ALLOCA], [\${LIBOBJDIR}alloca.${ac_objext}])
AC_DEFINE(C_ALLOCA)
AC_DEFINE_UNQUOTED(alloca, alloca)
;;
-when(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)
- ;;
-when(*)
+*)
AC_FUNC_ALLOCA
;;
esac
AC_FUNC_MEMCMP
+AC_FUNC_FSEEKO
+AC_CHECK_FUNCS(ftello)
# 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.
@@ -1072,25 +578,22 @@ main()
rb_cv_broken_glibc_ia64_erfc=yes,
rb_cv_broken_glibc_ia64_erfc=no)])
case $rb_cv_broken_glibc_ia64_erfc in
- when(yes) ac_cv_func_erf=no;;
+ yes) ac_cv_func_erf=no;;
esac
-AC_REPLACE_FUNCS(dup2 memmove strerror\
- strchr strstr crypt flock vsnprintf\
- isnan finite isinf hypot acosh erf tgamma lgamma_r cbrt \
- strlcpy strlcat)
-AC_CHECK_FUNCS(fmod killpg wait4 waitpid fork spawnv syscall chroot getcwd eaccess\
- truncate ftruncate chsize times utimes utimensat fcntl lockf lstat\
- link symlink readlink readdir_r fsync fdatasync\
- setitimer setruid seteuid setreuid setresuid setproctitle socketpair\
- setrgid setegid setregid setresgid issetugid pause lchown lchmod\
- getpgrp setpgrp getpgid setpgid initgroups getgroups setgroups\
- getpriority getrlimit setrlimit sysconf group_member\
- dlopen sigprocmask sigaction sigsetjmp _setjmp _longjmp snprintf\
- setsid telldir seekdir fchmod cosh sinh tanh log2 round signbit\
- setuid setgid daemon select_large_fdset setenv unsetenv\
- mktime timegm gmtime_r clock_gettime gettimeofday\
- pread sendfile shutdown sigaltstack)
+AC_REPLACE_FUNCS(dup2 memmove strcasecmp strncasecmp strerror strftime\
+ strchr strstr strtoul crypt flock vsnprintf\
+ isnan finite isinf hypot acosh erf)
+AC_CHECK_FUNCS(fmod killpg wait4 waitpid syscall chroot fsync getcwd eaccess\
+ truncate ftruncate chsize times utimes fcntl lockf lstat symlink link\
+ readlink setitimer setruid seteuid setreuid setresuid\
+ setproctitle setrgid setegid setregid setresgid issetugid pause\
+ lchown lchmod getpgrp setpgrp getpgid setpgid initgroups\
+ getgroups setgroups getpriority getrlimit setrlimit sysconf\
+ group_member dlopen sigprocmask\
+ sigaction sigsetjmp _setjmp _longjmp setsid telldir seekdir fchmod\
+ mktime timegm gettimeofday\
+ cosh sinh tanh round setuid setgid setenv unsetenv)
AC_CACHE_CHECK(for __builtin_setjmp, ac_cv_func___builtin_setjmp,
[AC_TRY_LINK([@%:@include <setjmp.h>
@@ -1103,16 +606,15 @@ AC_CACHE_CHECK(for __builtin_setjmp, ac_cv_func___builtin_setjmp,
test x$ac_cv_func__longjmp = xno && ac_cv_func__setjmp=no
AC_MSG_CHECKING(for setjmp type)
-AC_ARG_WITH(setjmp-type,
- AS_HELP_STRING([--with-setjmp-type],[select setjmp type]),
- [
+AC_ARG_WITH(setjmp-type,
+ [ --with-setjmp-type select setjmp type], [
case $withval in
- when(__builtin_setjmp) setjmp_prefix=__builtin_;;
- when(_setjmp) setjmp_prefix=_;;
- when(sigsetjmp) setjmp_prefix=sig;;
- when(setjmp) setjmp_prefix=;;
- when('') unset setjmp_prefix;;
- when(*) AC_MSG_ERROR(invalid setjmp type: $withval);;
+ __builtin_setjmp) setjmp_prefix=__builtin_;;
+ _setjmp) setjmp_prefix=_;;
+ sigsetjmp) setjmp_prefix=sig;;
+ setjmp) setjmp_prefix=;;
+ '') unset setjmp_prefix;;
+ *) AC_MSG_ERROR(invalid setjmp type: $withval);;
esac], [unset setjmp_prefix])
if test ${setjmp_prefix+set}; then
if test "${setjmp_prefix}" && eval test '$ac_cv_func_'${setjmp_prefix}setjmp = no; then
@@ -1124,9 +626,9 @@ elif test "$ac_cv_func__setjmp" = yes; then
setjmp_prefix=_
elif test "$ac_cv_func_sigsetjmp" = yes; then
case $target_os in
- when(solaris*|cygwin*)
+ solaris*|cygwin*)
setjmp_prefix=;;
- when(*)
+ *)
setjmp_prefix=sig;;
esac
else
@@ -1143,7 +645,7 @@ AC_DEFINE_UNQUOTED([RUBY_LONGJMP(env,val)], [${setjmp_prefix}longjmp(env,val)])
AC_DEFINE_UNQUOTED(RUBY_JMP_BUF, ${setjmp_sigmask+${setjmp_prefix}}jmp_buf)
AC_ARG_ENABLE(setreuid,
- AS_HELP_STRING([--enable-setreuid], [use setreuid()/setregid() according to need even if obsolete]),
+ [ --enable-setreuid use setreuid()/setregid() according to need even if obsolete.],
[use_setreuid=$enableval])
if test "$use_setreuid" = yes; then
AC_DEFINE(USE_SETREUID)
@@ -1161,15 +663,15 @@ fi
AC_CACHE_CHECK(for external int daylight, rb_cv_have_daylight,
[AC_TRY_LINK([#include <time.h>
int i;],
- [i = daylight;],
+ [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_CACHE_CHECK([for external $1], rb_cv_var_$1,
+ [rb_cv_var_$1=no
AC_TRY_COMPILE([
#ifndef _XOPEN_SOURCE
#define _XOPEN_SOURCE 1
@@ -1188,24 +690,26 @@ $2
extern $t $1;
const volatile void *volatile t;],
[t = &(&$1)[0];],
- [AS_TR_SH(rb_cv_var_$1)=$t; break])
+ [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)})
+if test "[$rb_cv_var_]$1" != no; then
+ AC_DEFINE([HAVE_VAR_]m4_toupper($1))
+ AC_DEFINE_UNQUOTED([TYPEOF_VAR_]m4_toupper($1), $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)
+if test "$rb_cv_var_timezone" = no; then
+ 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
fi
@@ -1280,7 +784,7 @@ main()
fi
AC_FUNC_GETPGRP
-AC_FUNC_SETPGRP
+AC_FUNC_SETPGRP
AC_C_BIGENDIAN
AC_C_CONST
@@ -1304,9 +808,18 @@ if test x"$target_cpu" = xia64; then
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))]),
+ [AC_TRY_RUN([
+int
+main()
+{
+ if (-1==(-1>>1))
+ return 0;
+ return 1;
+}
+],
rb_cv_rshift_sign=yes,
- rb_cv_rshift_sign=no)])
+ rb_cv_rshift_sign=no,
+ rb_cv_rshift_sign=yes)])
if test "$rb_cv_rshift_sign" = yes; then
AC_DEFINE(RSHIFT(x,y), ((x)>>(int)y))
else
@@ -1343,7 +856,6 @@ AC_CACHE_VAL(rb_cv_frptr,
__ptr dnl
bufpos dnl
_p dnl
- __bufpos dnl
; do
AC_TRY_COMPILE([#include <stdio.h>
],
@@ -1363,13 +875,12 @@ else
[for frend in dnl
_IO_read_end dnl
bufread dnl
- __bufread dnl
; do
AC_TRY_COMPILE([#include <stdio.h>
],
- [FILE *f = stdin; char buf[256]; f->$frend = buf;],
- rb_cv_frend="$frend"; break,
- rb_cv_frend="not found")
+ [FILE *f = stdin; char buf[256]; f->$frend = buf;],
+ rb_cv_frend="$frend"; break,
+ rb_cv_frend="not found")
done])
if test "$rb_cv_frend" = "not found"; then
AC_MSG_RESULT([not found])
@@ -1380,7 +891,80 @@ else
fi
fi
-RUBY_CHECK_SIZEOF([struct stat.st_ino], [long "long long"], [], [@%:@include <sys/stat.h>])
+AC_DEFUN([RUBY_CHECK_IO_NEED],
+[AC_CACHE_CHECK(whether need to [$1], [$2],
+ [AC_TRY_RUN([
+#include <stdio.h>
+#ifndef SEEK_SET
+#define SEEK_SET 0
+#endif
+#ifndef SEEK_CUR
+#define SEEK_CUR 1
+#endif
+#define before_seek(f) ]ifelse(index($2,flush_before_seek),-1,[fflush(f)],[(f,0)])[
+#define reset_rw(f) ]ifelse(index($2,seek_between_rw),-1,[do_seek(f,SEEK_CUR)],[(f,0)])[
+#define do_seek(f, w) (before_seek(f), fseek(f,0,w))
+
+char *fn = "conftest.dat";
+char *wombat = "wombat\n";
+char *koara = "koara\n";
+char *kangaroo = "kangaroo\n";
+
+int main()
+{
+ char buf[BUFSIZ];
+ FILE *f;
+ int r = 1;
+
+ if (!(f = fopen(fn, "w+"))) return 1;
+ fputs(wombat, f);
+ do_seek(f, SEEK_SET);
+ if (!fgets(buf, BUFSIZ, f) || strcmp(buf, wombat)) goto fail;
+ reset_rw(f);
+ fputs(koara, f);
+ fputs(kangaroo, f);
+ do_seek(f, SEEK_SET);
+ if (!fgets(buf, BUFSIZ, f) || strcmp(buf, wombat)) goto fail;
+ if (!fgets(buf, BUFSIZ, f) || strcmp(buf, koara)) goto fail;
+ if (!fgets(buf, BUFSIZ, f) || strcmp(buf, kangaroo)) goto fail;
+ do_seek(f, SEEK_SET);
+ if (!fgets(buf, BUFSIZ, f) || strcmp(buf, wombat)) goto fail;
+ reset_rw(f);
+ fputc('X', f);
+ reset_rw(f);
+ if (!fgets(buf, BUFSIZ, f) || strcmp(buf, koara+1)) goto fail;
+ if (!fgets(buf, BUFSIZ, f) || strcmp(buf, kangaroo)) goto fail;
+ do_seek(f, SEEK_SET);
+ if (!fgets(buf, BUFSIZ, f) || strcmp(buf, wombat)) goto fail;
+ if (!fgets(buf, BUFSIZ, f) || buf[0] != 'X' || strcmp(buf+1, koara+1)) goto fail;
+ if (!fgets(buf, BUFSIZ, f) || strcmp(buf, kangaroo)) goto fail;
+ r = 0;
+ fail:
+ fclose(f);
+ unlink(fn);
+ return r;
+}
+], [$2]=no, [$2]=yes, [$2]=[$3])])])
+RUBY_CHECK_IO_NEED(seek between R/W, rb_cv_need_io_seek_between_rw, yes)
+if test "$rb_cv_need_io_seek_between_rw" = yes; then
+ AC_DEFINE(NEED_IO_SEEK_BETWEEN_RW, 1)
+fi
+dnl RUBY_CHECK_IO_NEED(flush before seek, rb_cv_need_io_flush_before_seek, no)
+dnl if test "$rb_cv_need_io_flush_before_seek" = yes; then
+dnl AC_DEFINE(NEED_IO_FLUSH_BEFORE_SEEK, 1)
+dnl fi
+
+AC_CACHE_CHECK([whether st_ino is huge], rb_cv_huge_st_ino,
+[AC_COMPILE_IFELSE([AC_LANG_BOOL_COMPILE_TRY([
+#include <sys/stat.h>
+struct stat test_stat;
+], [sizeof(test_stat.st_ino)>sizeof(long)])],
+rb_cv_huge_st_ino=yes,
+rb_cv_huge_st_ino=no)
+])
+if test $rb_cv_huge_st_ino = yes; then
+ AC_DEFINE(HUGE_ST_INO)
+fi
if test "$ac_cv_func_sysconf" = yes; then
AC_DEFUN([RUBY_CHECK_SYSCONF], [dnl
@@ -1399,8 +983,8 @@ if test "$ac_cv_func_sysconf" = yes; then
fi
case "$target_cpu" in
-when(m68*|i?86|ia64|sparc*|alpha*) rb_cv_stack_grow_dir=-1;;
-when(hppa*) rb_cv_stack_grow_dir=+1;;
+m68*|i?86|ia64|sparc*|alpha*) rb_cv_stack_grow_dir=-1;;
+hppa*) rb_cv_stack_grow_dir=+1;;
esac
AC_CACHE_CHECK(stack growing direction, rb_cv_stack_grow_dir,
[AC_TRY_RUN([
@@ -1424,8 +1008,8 @@ int main()
AC_DEFINE_UNQUOTED(STACK_GROW_DIRECTION, $rb_cv_stack_grow_dir)
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,
+ for pthread_lib in pthread pthreads c c_r; 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
@@ -1434,21 +1018,19 @@ if test x"$enable_pthread" = xyes; then
AC_DEFINE(_THREAD_SAFE)
AC_DEFINE(HAVE_LIBPTHREAD)
case $pthread_lib in
- when(c)
- ;;
- when(root)
+ c)
;;
- when(c_r)
+ c_r)
MAINLIBS="-pthread $MAINLIBS"
;;
- when(*)
- LIBS="-l$pthread_lib $LIBS"
+ *)
+ LIBS="-l$pthread_lib $LIBS"
;;
esac
else
AC_MSG_WARN("Don't know how to find pthread library on your system -- thread support disabled")
fi
- AC_CHECK_FUNCS(nanosleep sched_yield pthread_attr_setinheritsched)
+ AC_CHECK_FUNCS(nanosleep)
if test x"$ac_cv_func_nanosleep" = xno; then
AC_CHECK_LIB(rt, nanosleep)
if test x"$ac_cv_lib_rt_nanosleep" = xyes; then
@@ -1462,113 +1044,56 @@ if test x"$ac_cv_header_ucontext_h" = xyes; then
fi
fi
-if test "$ac_cv_func_fork" = "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
+dnl default value for $KANJI
+DEFAULT_KCODE="KCODE_NONE"
-AC_CHECK_FUNCS(backtrace)
-
-AC_ARG_WITH(valgrind,
- AS_HELP_STRING([--with-valgrind],[enable valgrind memcheck support]),
- [AC_CHECK_HEADERS(valgrind/memcheck.h)])
-
-dnl }
-dnl runtime section {
+AC_ARG_WITH(default-kcode,
+ [ --with-default-kcode=CODE specify default value for \$KCODE (utf8|euc|sjis|none)],
+ [case $withval in
+ utf8) DEFAULT_KCODE="KCODE_UTF8";;
+ euc) DEFAULT_KCODE="KCODE_EUC";;
+ sjis) DEFAULT_KCODE="KCODE_SJIS";;
+ none) DEFAULT_KCODE="KCODE_NONE";;
+ *) AC_MSG_WARN($withval is not valid kcode; ignored);;
+ esac])
+AC_DEFINE_UNQUOTED(DEFAULT_KCODE, $DEFAULT_KCODE)
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]),
- [
+AC_ARG_WITH(dln-a-out,
+ [ --with-dln-a-out use dln_a_out if possible], [
case $withval in
- when(yes)
- if test "$enable_shared" = yes; then
- AC_MSG_ERROR(dln_a_out can not make shared library)
- fi
- with_dln_a_out=yes;;
- when(*)
- with_dln_a_out=no;;
+ yes) with_dln_a_out=yes;;
+ *) with_dln_a_out=no;;
esac], [with_dln_a_out=no])
AC_CACHE_CHECK(whether ELF binaries are produced, rb_cv_binary_elf,
-[AC_TRY_LINK([],[], [
-case "`head -1 conftest$EXEEXT | cat -e`" in
-when('^?ELF'*)
- rb_cv_binary_elf=yes;;
-when(*)
- rb_cv_binary_elf=no;;
-esac],
-rb_cv_binary_elf=no)])
+[AC_TRY_RUN([
+/* Test for whether ELF binaries are produced */
+#include <fcntl.h>
+#include <stdlib.h>
+main() {
+ char buffer[4];
+ int i=open("conftest",O_RDONLY);
+ if(i==-1)
+ exit(1); /* fail */
+ if(read(i,&buffer[0],4)<4)
+ exit(1); /* fail */
+ if(buffer[0] != 127 || buffer[1] != 'E' ||
+ buffer[2] != 'L' || buffer[3] != 'F')
+ exit(1); /* fail */
+ exit(0); /* succeed (yes, it's ELF) */
+}
+],
+rb_cv_binary_elf=yes,
+rb_cv_binary_elf=no,
+rb_cv_binary_elf=yes)])
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
fi
case "$target_os" in
-when(linux* | gnu* | k*bsd*-gnu | bsdi* | kopensolaris*-gnu)
+linux* | gnu* | k*bsd*-gnu | bsdi*)
if test "$rb_cv_binary_elf" = no; then
with_dln_a_out=yes
else
@@ -1583,12 +1108,12 @@ AC_SUBST(ARCH_FLAG)dnl
AC_SUBST(STATIC)dnl
AC_SUBST(CCDLFLAGS)dnl
AC_SUBST(LDSHARED)dnl
-AC_SUBST(LDSHAREDXX)dnl
AC_SUBST(DLEXT)dnl
AC_SUBST(DLEXT2)dnl
AC_SUBST(LIBEXT)dnl
STATIC=
+: ${LIBPATHFLAG=' -L%s'}
: ${PATHFLAG=''}
if test "$with_dln_a_out" != yes; then
@@ -1596,39 +1121,34 @@ if test "$with_dln_a_out" != yes; then
AC_MSG_CHECKING(whether OS depend dynamic link works)
if test "$GCC" = yes; then
case "$target_os" in
- when(nextstep*|openstep*|rhapsody*|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);;
- when(human*|bsdi*|beos*|haiku*|cygwin*|mingw*|aix*|interix*) ;;
- when(*)
- RUBY_APPEND_OPTION(CCDLFLAGS, -fPIC);;
+ nextstep*) CCDLFLAGS="$CCDLFLAGS -fno-common";;
+ openstep*) CCDLFLAGS="$CCDLFLAGS -fno-common";;
+ rhapsody*) CCDLFLAGS="$CCDLFLAGS -fno-common";;
+ darwin*) CCDLFLAGS="$CCDLFLAGS -fno-common";;
+ human*|bsdi*|beos*|cygwin*|mingw*|aix*|interix*) ;;
+ *) CCDLFLAGS="$CCDLFLAGS -fPIC";;
esac
else
case "$target_os" in
- when(hpux*) CCDLFLAGS="$CCDLFLAGS +Z";;
- when(solaris*|irix*) CCDLFLAGS="$CCDLFLAGS -KPIC" ;;
- when(sunos*) CCDLFLAGS="$CCDLFLAGS -PIC" ;;
- when(esix*|uxpds*) CCDLFLAGS="$CCDLFLAGS -KPIC" ;;
- when(*) : ${CCDLFLAGS=""} ;;
+ hpux*) CCDLFLAGS="$CCDLFLAGS +Z";;
+ solaris*|irix*) CCDLFLAGS="$CCDLFLAGS -KPIC" ;;
+ sunos*) CCDLFLAGS="$CCDLFLAGS -PIC" ;;
+ esix*|uxpds*) CCDLFLAGS="$CCDLFLAGS -KPIC" ;;
+ *) : ${CCDLFLAGS=""} ;;
esac
fi
AC_ARG_ENABLE(rpath,
- AS_HELP_STRING([--disable-rpath], [embed run path into extension libraries]),
+ [ --disable-rpath embed run path into extension libraries.],
[enable_rpath=$enableval], [enable_rpath="$rb_cv_binary_elf"])
if test "$enable_rpath" = yes; then
+ LIBPATHFLAG=" -L%1\$-s"
RPATHFLAG=" ${linker_flag}-R%1\$-s"
fi
case "$target_os" in
- when(hpux*) DLDFLAGS="$DLDFLAGS -E"
+ hpux*) DLDFLAGS="$DLDFLAGS -E"
: ${LDSHARED='ld -b'}
XLDFLAGS="$XLDFLAGS -Wl,-E"
: ${LIBPATHENV=SHLIB_PATH}
@@ -1636,43 +1156,42 @@ if test "$with_dln_a_out" != yes; then
RPATHFLAG=' +b %1$-s'
fi
rb_cv_dlopen=yes;;
- when(solaris*) if test "$GCC" = yes; then
- : ${LDSHARED='$(CC) -shared'}
- if test "$rb_cv_prog_gnu_ld" = yes; then
- LDFLAGS="$LDFLAGS -Wl,-E"
- fi
+ 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='ld -G'}
+ : ${LDSHARED='ld -G'}
fi
rb_cv_dlopen=yes;;
- when(sunos*) : ${LDSHARED='ld -assert nodefinitions'}
+ sunos*) : ${LDSHARED='ld -assert nodefinitions'}
rb_cv_dlopen=yes;;
- when(irix*) : ${LDSHARED='ld -shared'}
+ irix*) : ${LDSHARED='ld -shared'}
rb_cv_dlopen=yes;;
- when(sysv4*) : ${LDSHARED='ld -G'}
+ sysv4*) : ${LDSHARED='ld -G'}
rb_cv_dlopen=yes;;
- when(nto-qnx*) : ${LDSHARED="qcc -shared"}
+ nto-qnx*) : ${LDSHARED="qcc -shared"}
rb_cv_dlopen=yes ;;
- when(esix*|uxpds*) : ${LDSHARED="ld -G"}
+ esix*|uxpds*) : ${LDSHARED="ld -G"}
rb_cv_dlopen=yes ;;
- when(osf*) : ${LDSHARED="ld -shared -expect_unresolved \"*\""}
+ osf*) : ${LDSHARED="ld -shared -expect_unresolved \"*\""}
rb_cv_dlopen=yes ;;
- when(bsdi3*) case "$CC" in
- when(*shlicc*) : ${LDSHARED="$CC -r"}
+ bsdi3*) case "$CC" in
+ *shlicc*) : ${LDSHARED="$CC -r"}
rb_cv_dlopen=yes ;;
esac ;;
- when(linux* | gnu* | k*bsd*-gnu | netbsd* | bsdi* | kopensolaris*-gnu)
+ linux* | gnu* | k*bsd*-gnu | netbsd* | bsdi*)
: ${LDSHARED='${CC} -shared'}
if test "$rb_cv_binary_elf" = yes; then
LDFLAGS="$LDFLAGS -Wl,-export-dynamic"
fi
rb_cv_dlopen=yes ;;
- when(interix*) : ${LDSHARED="$CC -shared"}
+ interix*) : ${LDSHARED="$CC -shared"}
XLDFLAGS="$XLDFLAGS -Wl,-E"
LIBPATHFLAG=" -L%1\$-s"
rb_cv_dlopen=yes ;;
- when(freebsd*|dragonfly*)
- : ${LDSHARED="$CC -shared"}
+ freebsd*|dragonfly*) : ${LDSHARED="$CC -shared"}
if test "$rb_cv_binary_elf" = yes; then
LDFLAGS="$LDFLAGS -rdynamic"
DLDFLAGS="$DLDFLAGS "'-Wl,-soname,$(.TARGET)'
@@ -1680,33 +1199,25 @@ if test "$with_dln_a_out" != yes; then
test "$GCC" = yes && test "$rb_cv_prog_gnu_ld" = yes || LDSHARED="ld -Bshareable"
fi
rb_cv_dlopen=yes ;;
- when(openbsd*) : ${LDSHARED="\$(CC) -shared ${CCDLFLAGS}"}
+ openbsd*) : ${LDSHARED="\$(CC) -shared ${CCDLFLAGS}"}
if test "$rb_cv_binary_elf" = yes; then
LDFLAGS="$LDFLAGS -Wl,-E"
fi
rb_cv_dlopen=yes ;;
- when(nextstep*) : ${LDSHARED='cc -r -nostdlib'}
+ nextstep*) : ${LDSHARED='cc -r -nostdlib'}
LDFLAGS="$LDFLAGS -u libsys_s"
rb_cv_dlopen=yes ;;
- when(openstep*) : ${LDSHARED='cc -dynamic -bundle -undefined suppress'}
+ openstep*) : ${LDSHARED='cc -dynamic -bundle -undefined suppress'}
: ${LDFLAGS=""}
rb_cv_dlopen=yes ;;
- when(rhapsody*) : ${LDSHARED='cc -dynamic -bundle -undefined suppress'}
+ rhapsody*) : ${LDSHARED='cc -dynamic -bundle -undefined suppress'}
: ${LDFLAGS=""}
rb_cv_dlopen=yes ;;
- when(darwin*) : ${LDSHARED='$(CC) -dynamic -bundle -undefined suppress -flat_namespace'}
+ darwin*) : ${LDSHARED='cc -dynamic -bundle -undefined suppress -flat_namespace'}
: ${LDFLAGS=""}
: ${LIBPATHENV=DYLD_LIBRARY_PATH}
- # /usr/local/include is always searched for
- # some reason, but /usr/local/lib is not.
- hdr=`find /usr/local/include -name \*.h -type f | sed 's:^/usr/local/include/::;q'`
- if test -n "$hdr" && $CC -E -include "$hdr" -xc /dev/null | fgrep -q "$hdr"; then
- $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 ;;
- when(aix*) if test "$GCC" = yes; then
+ aix*) if test "$GCC" = yes; then
: ${LDSHARED='$(CC) -shared'}
else
: ${LDSHARED='$(CC)'}
@@ -1714,85 +1225,46 @@ if test "$with_dln_a_out" != yes; then
LDSHARED="$LDSHARED ${linker_flag}-G"
DLDFLAGS='-eInit_$(TARGET)'
XLDFLAGS="${linker_flag}-bE:ruby.imp ${linker_flag}-brtl"
- XLDFLAGS="$XLDFLAGS ${linker_flag}-blibpath:${prefix}/lib:${LIBPATH:-/usr/lib:/lib}"
- : ${ARCHFILE="ruby.imp"}
+ : ${ARCHFILE="ruby.imp"}
TRY_LINK='$(CC) $(LDFLAGS) -oconftest $(INCFLAGS) -I$(hdrdir) $(CPPFLAGS)'
TRY_LINK="$TRY_LINK"' $(CFLAGS) $(src) $(LIBPATH) $(LOCAL_LIBS) $(LIBS)'
- : ${LIBPATHENV=SHLIB_PATH}
- RPATHFLAG=" ${linker_flag}-blibpath:%1\$-s"
- rb_cv_dlopen=yes ;;
- when(human*) : ${DLDFLAGS=''}
+ : ${LIBPATHENV=SHLIB_PATH}
+ rb_cv_dlopen=yes ;;
+ human*) : ${DLDFLAGS=''}
: ${LDSHARED=''}
: ${LDFLAGS=''}
: ${LINK_SO='ar cru $@ $(OBJS)'}
rb_cv_dlopen=yes ;;
- when(beos*) case "$target_cpu" in
- when(powerpc*)
- : ${LDSHARED="ld -xms"}
- DLDFLAGS="$DLDFLAGS "'-export Init_$(TARGET) -lbe -lroot glue-noinit.a init_term_dyn.o start_dyn.o'
- LDFLAGS="$LDFLAGS -L/boot/home/config/lib -lbe -lroot"
- ;;
- when(i586*)
- : ${LDSHARED="ld -shared"}
- DLDFLAGS="$DLDFLAGS -L/boot/develop/lib/x86 -L/boot/home/config/lib \$(topdir)/_APP_ -lbe -lroot"
- LDFLAGS="$LDFLAGS -L/boot/develop/lib/x86 -L/boot/home/config/lib -lbe -lroot"
- ;;
- esac
- : ${LIBPATHENV=LIBRARY_PATH}
- rb_cv_dlopen=yes ;;
- when(haiku*) case "$target_cpu" in
- when(powerpc*)
+ beos*) case "$target_cpu" in
+ powerpc*)
: ${LDSHARED="ld -xms"}
DLDFLAGS="$DLDFLAGS "'-export Init_$(TARGET) -lbe -lroot glue-noinit.a init_term_dyn.o start_dyn.o'
;;
- when(i586*)
+ i586*)
: ${LDSHARED="ld -shared"}
DLDFLAGS="$DLDFLAGS -L/boot/develop/lib/x86 -lbe -lroot"
;;
esac
: ${LIBPATHENV=LIBRARY_PATH}
rb_cv_dlopen=yes ;;
- when(nto-qnx*) DLDFLAGS="$DLDFLAGS -L/lib -L/usr/lib -L/usr/local/lib"
+ 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;;
- when(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"
+ cygwin*|mingw*) : ${LDSHARED="${CC} -shared -s"}
+ XLDFLAGS="$XLDFLAGS -Wl,--stack,0x02000000"
+ DLDFLAGS="${DLDFLAGS} -Wl,--enable-auto-image-base,--enable-auto-import,--export-all"
: ${LIBPATHENV=""}
rb_cv_dlopen=yes ;;
- when(hiuxmpp) : ${LDSHARED='ld -r'} ;;
- when(atheos*) : ${LDSHARED="$CC -shared"}
+ hiuxmpp) : ${LDSHARED='ld -r'} ;;
+ atheos*) : ${LDSHARED="$CC -shared"}
rb_cv_dlopen=yes ;;
- when(os2-emx*) LDFLAGS="$LDFLAGS -Zomf"
+ os2-emx*) LDFLAGS="$LDFLAGS -Zbsd-signals"
;;
- when(*) : ${LDSHARED='ld'} ;;
+ *) : ${LDSHARED='ld'} ;;
esac
AC_MSG_RESULT($rb_cv_dlopen)
fi
-if test "${LDSHAREDXX}" = ""; then
- case "${LDSHARED}" in
- when(*'$(CC)'*)
- LDSHAREDXX=`echo "${LDSHARED}" | sed 's/\$(CC)/$(CXX)/'`
- ;;
- when(*'${CC}'*)
- LDSHAREDXX=`echo "${LDSHARED}" | sed 's/\${CC}/${CXX}/'`
- ;;
- when(*$CC*)
- LDSHAREDXX=`echo "${LDSHARED}" | sed "s|$CC|$CXX|"`
- ;;
- when(ld" "*)
- ;;
- esac
-fi
-case ${RPATHFLAG} in
-when(*'%1$'*)
- : ${LIBPATHFLAG=' -L%1$-s'};;
-when(*)
- : ${LIBPATHFLAG=' -L%s'};;
-esac
-
AC_SUBST(LINK_SO)
AC_SUBST(LIBPATHFLAG)
AC_SUBST(RPATHFLAG)
@@ -1808,7 +1280,7 @@ if test "$ac_cv_header_a_out_h" = yes; then
#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
@@ -1828,36 +1300,21 @@ if test "$dln_a_out_works" = yes; then
CCDLFLAGS=
else
case "$target_os" in
- when(hpux*)
- DLEXT=sl;;
- when(nextstep*|openstep*|rhapsody*|darwin*)
- DLEXT=bundle;;
- when(os2-emx*)
- LOAD_RELATIVE=1
- DLEXT=dll;;
- when(cygwin*|mingw*|*djgpp*)
- LOAD_RELATIVE=1
- DLEXT=so;;
- when(*)
- DLEXT=so;;
+ hpux*) DLEXT=sl;;
+ nextstep*|openstep*|rhapsody*|darwin*)
+ DLEXT=bundle;;
+ os2-emx*) DLEXT=dll;;
+ cygwin*|mingw*)
+ DLEXT=so DLEXT2=dll;;
+ *) DLEXT=so;;
esac
fi
-if test "$rb_cv_dlopen:$load_relative" = yes:yes; then
- AC_CHECK_FUNCS(dladdr)
- if test "$ac_cv_func_dladdr" = yes; then
- LOAD_RELATIVE=1
- else
- unset load_relative
- fi
-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)
AC_SUBST(STRIP)dnl
if test "$with_dln_a_out" = yes; then
@@ -1867,35 +1324,86 @@ else
fi
case "$target_os" in
- when(linux* | gnu* | k*bsd*-gnu | kopensolaris*-gnu)
+ linux* | gnu* | k*bsd*-gnu)
STRIP='strip -S -x';;
- when(nextstep* | openstep* | rhapsody* | darwin*)
+ nextstep*)
+ STRIP='strip -A -n';;
+ openstep*)
+ STRIP='strip -A -n';;
+ rhapsody*)
+ STRIP='strip -A -n';;
+ darwin*)
STRIP='strip -A -n';;
esac
EXTSTATIC=
AC_SUBST(EXTSTATIC)dnl
AC_ARG_WITH(static-linked-ext,
- AS_HELP_STRING([--with-static-linked-ext], [link external modules statically]),
+ [ --with-static-linked-ext link external modules statically],
[case $withval in
- when(yes)
- STATIC=
- EXTSTATIC=static;;
- when(*) ;;
+ yes) STATIC=
+ EXTSTATIC=static;;
+ *) ;;
esac])
case "$target_os" in
- when(human*)
+ human*)
+ AC_CHECK_LIB(signal, _harderr)
+ AC_CHECK_LIB(hmem, hmemset)
+ AC_CHECK_FUNCS(select)
+ AC_CACHE_CHECK(whether PD libc _dtos18 fail to convert big number,
+ rb_cv_missing__dtos18,
+ [AC_TRY_RUN(
+changequote(<<, >>)dnl
+<<
+#include <stdio.h>
+main ()
+{
+ char buf[256];
+ sprintf (buf, "%g", 1e+300);
+ exit (strcmp (buf, "1e+300") ? 0 : 1);
+}
+>>,
+changequote([, ])dnl
+rb_cv_missing__dtos18=yes, rb_cv_missing__dtos18=no, rb_cv_missing__dtos18=no)])
+ if test "$rb_cv_missing__dtos18" = yes; then
+ AC_DEFINE(MISSING__DTOS18)
+ fi
+ AC_CACHE_CHECK(whether PD libc fconvert fail to round,
+ rb_cv_missing_fconvert,
+ [AC_TRY_RUN(
+changequote(<<, >>)dnl
+<<
+#include <stdio.h>
+#include <math.h>
+main ()
+{
+ char buf[256];
+ sprintf (buf, "%f", log(exp(1.0)));
+ exit (strcmp (buf, "1.000000") ? 0 : 1);
+}
+>>,
+changequote([, ])dnl
+rb_cv_missing_fconvert=yes, rb_cv_missing_fconvert=no, rb_cv_missing_fconvert=no)])
+ if test "$rb_cv_missing_fconvert" = yes; then
+ AC_DEFINE(MISSING_FCONVERT)
+ fi
+ AC_LIBOBJ([x68.o])
+ CFLAGS="$CFLAGS -fansi-only"
+ XCFLAGS="$XCFLAGS -cc1-stack=262144 -cpp-stack=2694144"
+ EXEEXT=.x
+ OBJEXT=o
setup=Setup.x68
;;
dnl OS/2 environment w/ Autoconf 2.1x for EMX
- when(os2-emx)
+ os2-emx)
+ AC_LIBOBJ([os2])
setup=Setup.emx
;;
- when(*djgpp*)
+ *djgpp*)
setup=Setup.dj
;;
- when(*)
+ *)
setup=Setup
;;
esac
@@ -1906,20 +1414,24 @@ if test "$prefix" = NONE; then
prefix=$ac_default_prefix
fi
+#if test "$fat_binary" != no ; then
+# CFLAGS="$CFLAGS $ARCH_FLAG"
+#fi
+
if test x"$cross_compiling" = xyes; then
- test x"$MINIRUBY" = x && MINIRUBY="${RUBY-ruby} -I`pwd` "-r'$(arch)-fake'
- PREP='$(arch)-fake.rb'
+ test x"$MINIRUBY" = x && MINIRUBY="${RUBY-ruby} -I`pwd` -rfake"
+ PREP=fake.rb
RUNRUBY='$(MINIRUBY) -I`cd $(srcdir)/lib; pwd`'
else
MINIRUBY='./miniruby$(EXEEXT) -I$(srcdir)/lib'
MINIRUBY="$MINIRUBY"' -I$(EXTOUT)/common -I./- -r$(srcdir)/ext/purelib.rb'
PREP='miniruby$(EXEEXT)'
- RUNRUBY='$(MINIRUBY) $(srcdir)/tool/runruby.rb --extout=$(EXTOUT)'
+ RUNRUBY='$(MINIRUBY) $(srcdir)/runruby.rb --extout=$(EXTOUT)'
fi
AC_SUBST(MINIRUBY)
AC_SUBST(PREP)
AC_SUBST(RUNRUBY)
-AC_SUBST(EXTOUT, [${EXTOUT=.ext}])
+AC_SUBST(EXTOUT, [${EXTOUT-.ext}])
FIRSTMAKEFILE=""
LIBRUBY_A='lib$(RUBY_SO_NAME)-static.a'
@@ -1929,18 +1441,15 @@ LIBRUBYARG='$(LIBRUBYARG_STATIC)'
SOLIBS=
case "$target_os" in
- when(cygwin*|mingw*|beos*|haiku*|openstep*|nextstep*|rhapsody*|darwin*|os2-emx*)
+ cygwin*|mingw*|beos*|openstep*|nextstep*|rhapsody*|darwin*|os2-emx*)
: ${DLDLIBS=""}
;;
- when(*)
+ *)
DLDLIBS="$DLDLIBS -lc"
;;
esac
-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)'])
-
+RUBY_SO_NAME='$(RUBY_INSTALL_NAME)'
LIBRUBY_LDSHARED=$LDSHARED
LIBRUBY_DLDFLAGS=$DLDFLAGS
LIBRUBY_SO='lib$(RUBY_SO_NAME).so.$(MAJOR).$(MINOR).$(TEENY)'
@@ -1948,26 +1457,26 @@ 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 build a shared library for Ruby. ],
[enable_shared=$enableval])
-LIBRUBYARG_SHARED='-l$(RUBY_SO_NAME)'
if test "$enable_shared" = 'yes'; then
LIBRUBY='$(LIBRUBY_SO)'
+ LIBRUBYARG_SHARED='-l$(RUBY_SO_NAME)'
LIBRUBYARG='$(LIBRUBYARG_SHARED)'
- test -z "$CCDLFLAGS" || CFLAGS="$CFLAGS $CCDLFLAGS"
+ CFLAGS="$CFLAGS $CCDLFLAGS"
ENABLE_SHARED=yes
if test "$rb_cv_binary_elf" = yes; then
SOLIBS='$(LIBS)'
fi
case "$target_os" in
- when(sunos4*)
+ sunos4*)
LIBRUBY_ALIASES='lib$(RUBY_SO_NAME).so.$(MAJOR).$(MINOR) lib$(RUBY_SO_NAME).so'
;;
- when(linux* | gnu* | k*bsd*-gnu | atheos* | kopensolaris*-gnu)
+ linux* | gnu* | k*bsd*-gnu | atheos*)
LIBRUBY_DLDFLAGS='-Wl,-soname,lib$(RUBY_SO_NAME).so.$(MAJOR).$(MINOR)'
LIBRUBY_ALIASES='lib$(RUBY_SO_NAME).so.$(MAJOR).$(MINOR) lib$(RUBY_SO_NAME).so'
;;
- when(freebsd*|dragonfly*)
+ freebsd*|dragonfly*)
SOLIBS='$(LIBS)'
LIBRUBY_SO='lib$(RUBY_SO_NAME).so.$(MAJOR)$(MINOR)'
if test "$rb_cv_binary_elf" != "yes" ; then
@@ -1975,7 +1484,7 @@ if test "$enable_shared" = 'yes'; then
LIBRUBY_ALIASES=''
fi
;;
- when(netbsd*)
+ netbsd*)
SOLIBS='$(LIBS)'
LIBRUBY_SO='lib$(RUBY_SO_NAME).so.$(MAJOR)$(MINOR).$(TEENY)'
LIBRUBY_DLDFLAGS='-Wl,-soname,lib$(RUBY_SO_NAME).so.$(MAJOR)$(MINOR)'
@@ -1984,12 +1493,12 @@ if test "$enable_shared" = 'yes'; then
else # a.out platforms
LIBRUBY_ALIASES=""
fi
- ;;
- when(openbsd*)
+ ;;
+ openbsd*)
SOLIBS='$(LIBS)'
LIBRUBY_SO='lib$(RUBY_INSTALL_NAME).so.$(MAJOR).'`expr ${MINOR} \* 10 + ${TEENY}`
;;
- when(solaris*)
+ 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'
@@ -1997,111 +1506,94 @@ if test "$enable_shared" = 'yes'; then
LIBRUBY_DLDFLAGS="$DLDFLAGS "'-Wl,-h,$(@F)'
fi
XLDFLAGS="$XLDFLAGS "'-R${libdir}'
- ;;
- when(hpux*)
+ ;;
+ 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'
;;
- when(aix*)
+ aix*)
LIBRUBY_DLDFLAGS="${linker_flag}-bnoentry $XLDFLAGS"
LIBRUBYARG_SHARED='-L${libdir} -l${RUBY_SO_NAME}'
SOLIBS='-lm -lc'
;;
- when(beos*)
+ beos*)
case "$target_cpu" in
- when(powerpc*)
+ powerpc*)
LIBRUBY_DLDFLAGS='-f ruby.exp -lnet -lbe -lroot glue-noinit.a init_term_dyn.o start_dyn.o'
;;
esac
;;
- when(darwin*)
- RUBY_SO_NAME="$RUBY_SO_NAME"'.$(MAJOR).$(MINOR).$(TEENY)'
- LIBRUBY_LDSHARED='$(CC) -dynamiclib -undefined suppress -flat_namespace'
- if test "$load_relative" = yes; then
- libprefix='@executable_path/../lib'
- else
- libprefix='$(libdir)'
- fi
- LIBRUBY_DLDFLAGS='-install_name '${libprefix}'/$(LIBRUBY_SO)'
- LIBRUBY_DLDFLAGS="$LIBRUBY_DLDFLAGS "'-current_version $(MAJOR).$(MINOR).$(TEENY)'
- LIBRUBY_DLDFLAGS="$LIBRUBY_DLDFLAGS "'-compatibility_version $(ruby_version)'
- LIBRUBY_DLDFLAGS="$LIBRUBY_DLDFLAGS "'-Wl,-unexported_symbol,_Init_* $(XLDFLAGS)'
- LIBRUBY_SO='lib$(RUBY_SO_NAME).dylib'
- LIBRUBY_ALIASES='lib$(RUBY_BASE_NAME).$(MAJOR).$(MINOR).dylib lib$(RUBY_INSTALL_NAME).dylib'
+ darwin*)
+ LIBRUBY_SO='lib$(RUBY_SO_NAME).$(MAJOR).$(MINOR).$(TEENY).dylib'
+ LIBRUBY_LDSHARED='cc -dynamiclib -undefined suppress -flat_namespace'
+ LIBRUBY_DLDFLAGS='-install_name $(libdir)/lib$(RUBY_SO_NAME).dylib -current_version $(MAJOR).$(MINOR).$(TEENY) -compatibility_version $(MAJOR).$(MINOR)'
+ LIBRUBY_ALIASES='lib$(RUBY_SO_NAME).$(MAJOR).$(MINOR).dylib lib$(RUBY_SO_NAME).dylib'
;;
- when(interix*)
+ interix*)
LIBRUBYARG_SHARED='-L. -L${libdir} -l$(RUBY_SO_NAME)'
;;
- when(*)
+ *)
;;
esac
fi
if test "$enable_rpath" = yes; then
- LIBRUBY_RPATHFLAGS="${linker_flag}-R ${linker_flag}\$(libdir) -L\$(libdir)"
- LIBRUBYARG_SHARED="$LIBRUBY_RPATHFLAGS $LIBRUBYARG_SHARED"
- LIBRUBYARG_STATIC="$LIBRUBY_RPATHFLAGS $LIBRUBYARG_STATIC"
+ LIBRUBYARG_SHARED="${linker_flag}-R ${linker_flag}\$(libdir) -L\$(libdir) $LIBRUBYARG_SHARED"
fi
LDFLAGS="-L. $LDFLAGS"
AC_SUBST(ARCHFILE)
-dnl }
-dnl build section {
-
dnl build rdoc index if requested
RDOCTARGET=""
AC_ARG_ENABLE(install-doc,
- AS_HELP_STRING([--disable-install-doc], [do not install rdoc indexes during install]),
- [install_doc=$enableval], [install_doc=yes])
+ [ --enable-install-doc build and install rdoc indexes during install ],
+ [install_doc=$enableval], [install_doc=no])
if test "$install_doc" != no; then
RDOCTARGET="install-doc"
fi
AC_SUBST(RDOCTARGET)
-if test "$rb_with_pthread" = "yes"; then
- THREAD_MODEL=pthread
-fi
-MINIDLNOBJ=dln.o
case "$target_os" in
- when(linux*)
+ linux*)
+ XCFLAGS="$XCFLAGS -D_GNU_SOURCE=1"
;;
- when(netbsd*)
- RUBY_APPEND_OPTION(CFLAGS, -pipe)
+ netbsd*)
+ CFLAGS="$CFLAGS -pipe"
;;
- when(nextstep*|openstep*)
- RUBY_APPEND_OPTION(CPPFLAGS, -I/usr/local/include)
+ nextstep*|openstep*)
+ # 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.
+ CFLAGS="$CFLAGS -pipe -fno-common"
+ CPPFLAGS="$CPPFLAGS -I/usr/local/include"
;;
- when(rhapsody*)
- RUBY_APPEND_OPTIONS(CFLAGS, -pipe -no-precomp)
+ rhapsody*)
+ CFLAGS="$CFLAGS -pipe -no-precomp -fno-common"
;;
- when(darwin*)
- RUBY_APPEND_OPTION(CFLAGS, -pipe)
- MINIDLNOBJ=dmydln.o
+ darwin*)
+ CFLAGS="$CFLAGS -pipe -fno-common"
+ MINIOBJS=dmydln.o
;;
- when(human*)
- AC_LIBOBJ([x68.o])
- CFLAGS="$CFLAGS -fansi-only"
- XCFLAGS="$XCFLAGS -cc1-stack=262144 -cpp-stack=2694144"
- EXEEXT=.x
- OBJEXT=o
- ;;
- when(os2-emx)
- AC_LIBOBJ([os2])
- CFLAGS="$CFLAGS -DOS2"
+ os2-emx)
+ CFLAGS="$CFLAGS -DOS2 -Zmts"
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//'`
;;
- when(osf*)
+ osf*)
if test "$GCC" != "yes" ; then
# compile something small: taint.c is fine for this.
# the main point is the '-v' flag of 'cc'.
case "`cc -v -I. -c main.c -o /tmp/main.o 2>&1`" in
- when(*/gemc_cc*) # we have the new DEC GEM CC
+ */gemc_cc*) # we have the new DEC GEM CC
CFLAGS="$CFLAGS -oldc"
;;
- when(*) # we have the old MIPS CC
+ *) # we have the old MIPS CC
;;
esac
# cleanup
@@ -2109,154 +1601,68 @@ case "$target_os" in
CFLAGS="$CFLAGS -std"
fi
;;
- when(beos*)
+ beos*)
case "$target_cpu" in
- when(powerpc*)
+ powerpc*)
CFLAGS="$CFLAGS -relax_pointers"
;;
esac
- CPPFLAGS="$CPPFLAGS -I/boot/home/config/include"
;;
- when(cygwin*|mingw*)
- RUBY_SO_NAME="${RUBY_SO_NAME}${MAJOR}${MINOR}${TEENY}"
- LIBRUBY_DLDFLAGS="${DLDFLAGS}"' -Wl,--out-implib=$(LIBRUBY)'
+ cygwin*|mingw*)
case "$target_os" in
- when(cygwin*)
+ cygwin*)
if test x"$enable_shared" = xyes; then
- LIBRUBY_SO='cyg$(RUBY_SO_NAME)'.dll
- LIBRUBY_DLDFLAGS="${LIBRUBY_DLDFLAGS}"' $(RUBYDEF)'
+ LIBRUBY_SO='cyg$(RUBY_SO_NAME)'${MAJOR}${MINOR}.dll
+ LIBRUBY='lib$(RUBY_SO_NAME).dll.a'
fi
;;
- when(mingw*)
- RUBY_SO_NAME="${rb_cv_msvcrt}-${RUBY_SO_NAME}"
+ mingw*)
+ RUBY_SO_NAME=${rb_cv_msvcrt}-'$(RUBY_INSTALL_NAME)'${MAJOR}${MINOR}
if test x"$enable_shared" = xyes; then
LIBRUBY_SO='$(RUBY_SO_NAME)'.dll
- LIBRUBY_DLDFLAGS="${LIBRUBY_DLDFLAGS}"' $(RUBYDEF)'
+ LIBRUBY='lib$(LIBRUBY_SO).a'
fi
AC_LIBOBJ([win32])
COMMON_LIBS=m
# COMMON_MACROS="WIN32_LEAN_AND_MEAN="
- COMMON_HEADERS="winsock2.h windows.h"
- THREAD_MODEL=win32
+ COMMON_HEADERS="windows.h winsock.h"
;;
esac
+ LIBRUBY_DLDFLAGS="${DLDFLAGS}"' -Wl,--out-implib=$(LIBRUBY)'
LIBRUBY_ALIASES=''
FIRSTMAKEFILE=GNUmakefile:cygwin/GNUmakefile.in
SOLIBS='$(LIBS)'
- if test x"$enable_shared" = xyes; then
- LIBRUBY='lib$(RUBY_SO_NAME).dll.a'
- else
+ if test x"$enable_shared" = xno; then
LIBRUBY_SO=dummy
LIBRUBY='lib$(RUBY_SO_NAME).a'
LIBRUBYARG='-l$(RUBY_SO_NAME)'
fi
- MINIDLNOBJ=dmydln.o
+ MINIOBJS=dmydln.o
;;
- when(hpux*)
+ hpux*)
case "$YACC" in
- when(*yacc*)
+ *yacc*)
XCFLAGS="$XCFLAGS -DYYMAXDEPTH=300"
YACC="$YACC -Nl40000 -Nm40000"
;;
esac
- MINIDLNOBJ=dmydln.o
- ;;
- when(*msdosdjgpp*)
- FIRSTMAKEFILE=GNUmakefile:djgpp/GNUmakefile.in
+ MINIOBJS=dmydln.o
;;
- when(*)
+ *)
;;
esac
-MINIOBJS="$MINIDLNOBJ"
-case "$THREAD_MODEL" in
-when(pthread)
- AC_CHECK_HEADERS(pthread.h)
- ;;
-when(win32)
- ;;
-when(*)
- AC_MSG_ERROR(unknown thread model $THREAD_MODEL)
- ;;
-esac
-
-case "$FIRSTMAKEFILE" in
-when(*GNUmakefile:*)
- gnumake=yes
- ;;
-when(*)
- AC_MSG_CHECKING([for 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
- case "$gnumake" in
- when(*yes*)
- echo "include Makefile" > GNUmakefile
- echo "-include uncommon.mk" >> GNUmakefile
- gnumake=yes;;
- when(*)
- gnumake=no;;
- esac
- AC_MSG_RESULT($gnumake)
- ;;
+case "$build_os" in
+ *msdosdjgpp*) FIRSTMAKEFILE=GNUmakefile:djgpp/GNUmakefile.in;;
esac
-if test "${universal_binary-no}" = yes ; then
- AC_MSG_CHECKING([for 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], [],
-[
- AC_MSG_RESULT(yes)
- mv -f confdefs1.h confdefs.h
-], [
- AC_MSG_RESULT(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])
- ])
-fi
-
CPPFLAGS="$CPPFLAGS "'$(DEFS)'
+test -z "$CFLAGS" || CFLAGS="$CFLAGS "; CFLAGS="$CFLAGS"'${cflags}'
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"'|$(ARCH_FLAG)|'`
- CXXFLAGS=`echo "$CXXFLAGS" | sed "s|$archflagpat"'|$(ARCH_FLAG)|'`
- LDFLAGS=`echo "$LDFLAGS" | sed "s|$archflagpat"'|$(ARCH_FLAG)|'`
-fi
AC_SUBST(cppflags, [])dnl
-AC_SUBST(cflags, ["$orig_cflags "'${optflags} ${debugflags} ${warnflags}'])dnl
-AC_SUBST(cxxflags, ["$orig_cxxflags "'${optflags} ${debugflags} ${warnflags}'])dnl
+AC_SUBST(cflags, ['${optflags} ${debugflags}'])dnl
AC_SUBST(optflags)dnl
AC_SUBST(debugflags)dnl
-AC_SUBST(warnflags)dnl
AC_SUBST(XCFLAGS)dnl
AC_SUBST(XLDFLAGS)dnl
AC_SUBST(LIBRUBY_LDSHARED)
@@ -2281,7 +1687,6 @@ AC_SUBST(COMMON_MACROS)
AC_SUBST(COMMON_HEADERS)
AC_SUBST(EXPORT_PREFIX)
AC_SUBST(MINIOBJS)
-AC_SUBST(THREAD_MODEL)
MAKEFILES="Makefile `echo $FIRSTMAKEFILE | sed 's/:.*//'`"
MAKEFILES="`echo $MAKEFILES`"
@@ -2295,209 +1700,111 @@ ri_suffix=
test "$program_suffix" != NONE &&
ri_suffix=$program_suffix
-RUBY_INSTALL_NAME="${ri_prefix}"'$(RUBY_BASE_NAME)'"${ri_suffix}"
+RUBY_INSTALL_NAME="${ri_prefix}ruby${ri_suffix}"
case "$target_os" in
- when(cygwin*|mingw*)
- RUBYW_INSTALL_NAME="${ri_prefix}"'$(RUBYW_BASE_NAME)'"${ri_suffix}"
- rubyw_install_name='$(RUBYW_INSTALL_NAME)'
+ cygwin*|mingw*)
+ RUBYW_INSTALL_NAME="${ri_prefix}rubyw${ri_suffix}"
+ rubyw_install_name="$RUBYW_INSTALL_NAME"
;;
esac
-
-rubylibprefix='${libdir}/${RUBY_BASE_NAME}'
-AC_ARG_WITH(rubylibprefix,
- AS_HELP_STRING([--with-rubylibprefix=DIR], [prefix for ruby libraries [[LIBDIR/RUBY_BASE_NAME]]]),
- [rubylibprefix=$withval])
-RUBY_LIB_PREFIX=`eval echo \\"${rubylibprefix}\\"`
-AC_SUBST(rubylibprefix)
-
-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])
-RIDIR=`eval echo \\"${ridir}\\"`
-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
-case "$ruby_version" in
- when(full)
- RUBY_LIB_VERSION_STYLE='3 /* full */'
- ;;
- when(minor)
- RUBY_LIB_VERSION_STYLE='2 /* minor */'
- ;;
-esac
-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 "version.h"'
- echo 'ruby_version=RUBY_LIB_VERSION'
- } > conftest.c
- ruby_version="`$CPP -I"${srcdir}" -I"${srcdir}/include" conftest.c | sed '/^ruby_version=/!d;s/ //g'`"
- eval $ruby_version
-else
- RUBY_LIB_VERSION="\"${ruby_version}\""
-fi
+RUBY_LIB_PREFIX=`eval echo \\"${libdir}/ruby\\"`
AC_ARG_WITH(sitedir,
- AS_HELP_STRING([--with-sitedir=DIR], [site libraries in DIR [[RUBY_LIB_PREFIX/site_ruby]]]),
+ [ --with-sitedir=DIR site libraries in DIR [[LIBDIR/ruby/site_ruby]]],
[sitedir=$withval],
- [sitedir='${rubylibprefix}/site_ruby'])
-dir="${sitedir}"
-until SITE_DIR=`eval echo \\"${dir}\\"`; test "x${dir}" = "x${SITE_DIR}"; do
- dir="${SITE_DIR}"
-done
-
-AC_ARG_WITH(vendordir,
- AS_HELP_STRING([--with-vendordir=DIR], [vendor libraries in DIR [[RUBY_LIB_PREFIX/vendor_ruby]]]),
- [vendordir=$withval],
- [vendordir='${rubylibprefix}/vendor_ruby'])
-dir="${vendordir}"
-until VENDOR_DIR=`eval echo \\"${dir}\\"`; test "x${dir}" = "x${VENDOR_DIR}"; do
- dir="${VENDOR_DIR}"
-done
+ [sitedir='${libdir}/ruby/site_ruby'])
+SITE_DIR=`eval echo \\"${sitedir}\\"`
-if test "${LOAD_RELATIVE+set}"; then
- AC_DEFINE_UNQUOTED(LOAD_RELATIVE, $LOAD_RELATIVE)
+case "$target_os" in
+ cygwin*|mingw*|*djgpp*|os2-emx*)
RUBY_LIB_PREFIX="`eval echo "$RUBY_LIB_PREFIX" | sed 's|^NONE/|/|;s|^'"$prefix"'/|/|'`"
RUBY_SITE_LIB_PATH="`eval echo "$SITE_DIR" | sed 's|^NONE/|/|;s|^'"$prefix"'/|/|'`"
- RUBY_VENDOR_LIB_PATH="`eval echo "$VENDOR_DIR" | sed 's|^NONE/|/|;s|^'"$prefix"'/|/|'`"
-else
+ ;;
+ *)
RUBY_LIB_PREFIX="`eval echo \\"$RUBY_LIB_PREFIX\\" | sed 's|^NONE/|'"$prefix"'/|'`"
RUBY_SITE_LIB_PATH="`eval echo \\"$SITE_DIR\\" | sed 's|^NONE/|'"$prefix"'/|'`"
- RUBY_VENDOR_LIB_PATH="`eval echo \\"$VENDOR_DIR\\" | sed 's|^NONE/|'"$prefix"'/|'`"
-fi
-
-pat="$RUBY_LIB_PREFIX/"'\(.*\)'
-RUBY_LIB_PATH='RUBY_LIB_PREFIX"/"RUBY_LIB_VERSION'
-case "$RUBY_SITE_LIB_PATH" in
- when("$RUBY_LIB_PREFIX/"*)
- RUBY_SITE_LIB_PATH='RUBY_LIB_PREFIX"/'"`expr \"$RUBY_SITE_LIB_PATH\" : \"$pat\"`"'"'
- ;;
- when(*)
- RUBY_SITE_LIB_PATH="\"${RUBY_SITE_LIB_PATH}\""
;;
esac
-RUBY_SITE_LIB_PATH2='RUBY_SITE_LIB"/"RUBY_LIB_VERSION'
-case "$RUBY_VENDOR_LIB_PATH" in
- when("$RUBY_LIB_PREFIX/"*)
- RUBY_VENDOR_LIB_PATH='RUBY_LIB_PREFIX"/'"`expr \"$RUBY_VENDOR_LIB_PATH\" : \"$pat\"`"'"'
+RUBY_LIB_PATH="${RUBY_LIB_PREFIX}/${MAJOR}.${MINOR}"
+RUBY_SITE_LIB_PATH2="${RUBY_SITE_LIB_PATH}/${MAJOR}.${MINOR}"
+
+AC_DEFINE_UNQUOTED(RUBY_LIB, "${RUBY_LIB_PATH}")
+AC_DEFINE_UNQUOTED(RUBY_SITE_LIB, "${RUBY_SITE_LIB_PATH}")
+AC_DEFINE_UNQUOTED(RUBY_SITE_LIB2, "${RUBY_SITE_LIB_PATH2}")
+
+AC_ARG_WITH(vendordir,
+ [ --with-vendordir=DIR vendor libraries in DIR [[LIBDIR/ruby/vendor_ruby]]],
+ [vendordir=$withval],
+ [vendordir='${libdir}/ruby/vendor_ruby'])
+VENDOR_DIR=`eval echo \\"${vendordir}\\"`
+case "$target_os" in
+ cygwin*|mingw*|*djgpp*|os2-emx*)
+ RUBY_VENDOR_LIB_PATH="`eval echo "$VENDOR_DIR" | sed 's|^NONE/|/|;s|^'"$prefix"'/|/|'`"
;;
- when(*)
- RUBY_VENDOR_LIB_PATH="\"${RUBY_VENDOR_LIB_PATH}\""
+ *)
+ RUBY_VENDOR_LIB_PATH="`eval echo \\"$VENDOR_DIR\\" | sed 's|^NONE/|'"$prefix"'/|'`"
;;
esac
-RUBY_VENDOR_LIB_PATH2='RUBY_VENDOR_LIB"/"RUBY_LIB_VERSION'
+RUBY_VENDOR_LIB_PATH2="${RUBY_VENDOR_LIB_PATH}/${MAJOR}.${MINOR}"
-if test ${RUBY_LIB_VERSION_STYLE+set}; then
- AC_DEFINE_UNQUOTED(RUBY_LIB_VERSION_STYLE, $RUBY_LIB_VERSION_STYLE)
-else
- AC_DEFINE_UNQUOTED(RUBY_LIB_VERSION, [$RUBY_LIB_VERSION])
-fi
-AC_DEFINE_UNQUOTED(RUBY_LIB_PREFIX, "${RUBY_LIB_PREFIX}")
-AC_DEFINE_UNQUOTED(RUBY_LIB, ${RUBY_LIB_PATH})
-AC_DEFINE_UNQUOTED(RUBY_SITE_LIB, ${RUBY_SITE_LIB_PATH})
-AC_DEFINE_UNQUOTED(RUBY_SITE_LIB2, ${RUBY_SITE_LIB_PATH2})
-AC_DEFINE_UNQUOTED(RUBY_VENDOR_LIB, ${RUBY_VENDOR_LIB_PATH})
-AC_DEFINE_UNQUOTED(RUBY_VENDOR_LIB2, ${RUBY_VENDOR_LIB_PATH2})
+AC_DEFINE_UNQUOTED(RUBY_VENDOR_LIB, "${RUBY_VENDOR_LIB_PATH}")
+AC_DEFINE_UNQUOTED(RUBY_VENDOR_LIB2, "${RUBY_VENDOR_LIB_PATH2}")
AC_SUBST(arch)dnl
AC_SUBST(sitearch)dnl
-AC_SUBST(ruby_version)dnl
AC_SUBST(sitedir)dnl
AC_SUBST(vendordir)dnl
configure_args=$ac_configure_args
AC_SUBST(configure_args)dnl
-if test "${universal_binary-no}" = yes ; then
- arch="universal-${target_os}"
- AC_CACHE_CHECK(whether __ARCHITECTURE__ is available, rb_cv_architecture_available,
- AC_TRY_COMPILE([const char arch[] = __ARCHITECTURE__;], [puts(arch);],
- [rb_cv_architecture_available=yes], [rb_cv_architecture_available=no]))
- if test "${rb_cv_architecture_available}" = yes; then
- AC_DEFINE_UNQUOTED(RUBY_PLATFORM_CPU, __ARCHITECTURE__)
- else
- 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'
- test "$ac_cv_type_long_long" = yes && ints="'long long' $ints"
- AC_SUBST(UNIVERSAL_ARCHNAMES, "${universal_archnames}")
- AC_SUBST(UNIVERSAL_INTS, "${ints}")
- AC_DEFINE_UNQUOTED(RUBY_PLATFORM_OS, "${target_os}")
- AC_DEFINE_UNQUOTED(RUBY_ARCH, "universal-"RUBY_PLATFORM_OS)
- AC_DEFINE_UNQUOTED(RUBY_PLATFORM, "universal."RUBY_PLATFORM_CPU"-"RUBY_PLATFORM_OS)
- AC_DEFINE_UNQUOTED(RUBY_THIN_ARCHLIB, RUBY_LIB"/"RUBY_PLATFORM_CPU"-"RUBY_PLATFORM_OS)
- AC_DEFINE_UNQUOTED(RUBY_SITE_THIN_ARCHLIB, RUBY_SITE_LIB2"/"RUBY_PLATFORM_CPU"-"RUBY_PLATFORM_OS)
- AC_DEFINE_UNQUOTED(RUBY_VENDOR_THIN_ARCHLIB, RUBY_VENDOR_LIB2"/"RUBY_PLATFORM_CPU"-"RUBY_PLATFORM_OS)
+if test "$fat_binary" != no ; then
+ arch="fat-${target_os}"
+
+ AC_DEFINE_UNQUOTED(RUBY_THIN_ARCHLIB,
+ "${RUBY_LIB_PATH}/" __ARCHITECTURE__ "-${target_os}")
+
+ AC_DEFINE_UNQUOTED(RUBY_SITE_THIN_ARCHLIB,
+ "${RUBY_SITE_LIB_PATH}/" __ARCHITECTURE__ "-${target_os}")
+ AC_DEFINE_UNQUOTED(RUBY_VENDOR_THIN_ARCHLIB,
+ "${RUBY_VENDOR_LIB_PATH}/" __ARCHITECTURE__ "-${target_os}")
+ AC_DEFINE_UNQUOTED(RUBY_PLATFORM, __ARCHITECTURE__ "-${target_os}")
else
arch="${target_cpu}-${target_os}"
AC_DEFINE_UNQUOTED(RUBY_PLATFORM, "${arch}")
fi
-unset sitearch
case "$target_os" in
- when(mingw*) sitearch="$target_cpu-$rb_cv_msvcrt" ;;
+ mingw*) sitearch="$target_cpu-$rb_cv_msvcrt" ;;
+ *) sitearch="${arch}" ;;
esac
-test ${sitearch+set} && AC_DEFINE_UNQUOTED(RUBY_SITEARCH, "${sitearch}")
-AC_DEFINE_UNQUOTED(RUBY_ARCHLIB, RUBY_LIB"/"RUBY_ARCH)
-AC_DEFINE_UNQUOTED(RUBY_SITE_ARCHLIB, RUBY_SITE_LIB2"/"RUBY_SITEARCH)
-AC_DEFINE_UNQUOTED(RUBY_VENDOR_ARCHLIB, RUBY_VENDOR_LIB2"/"RUBY_SITEARCH)
+AC_DEFINE_UNQUOTED(RUBY_ARCHLIB, "${RUBY_LIB_PATH}/${arch}")
+AC_DEFINE_UNQUOTED(RUBY_SITE_ARCHLIB, "${RUBY_SITE_LIB_PATH2}/${sitearch}")
+AC_DEFINE_UNQUOTED(RUBY_VENDOR_ARCHLIB, "${RUBY_VENDOR_LIB_PATH2}/${sitearch}")
AC_ARG_WITH(search-path,
- AS_HELP_STRING([--with-search-path=DIR], [specify the additional search path]),
+ [ --with-search-path=DIR specify the additional search path],
[search_path=$withval])
if test "$search_path" != ""; then
AC_DEFINE_UNQUOTED(RUBY_SEARCH_PATH,"$search_path")
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_BASE_NAME}-${ruby_version}'])
-
-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(vendorhdrdir,
- AS_HELP_STRING([--with-vendorhdrdir=DIR], [ core vendor headers in DIR [RUBYHDRDIR/vendor_ruby]]),
- [vendorhdrdir=$withval],
- [vendorhdrdir='${rubyhdrdir}/vendor_ruby'])
-
-AC_SUBST(rubyhdrdir)dnl
-AC_SUBST(sitehdrdir)dnl
-AC_SUBST(vendorhdrdir)dnl
-
AC_ARG_WITH(mantype,
- AS_HELP_STRING([--with-mantype=TYPE], [specify man page type; TYPE is one of man and doc]),
+ [ --with-mantype=TYPE specify man page type; TYPE is one of man and doc],
[
case "$withval" in
- when(man|doc)
+ man|doc)
MANTYPE=$withval
;;
- when(*)
+ *)
AC_MSG_ERROR(invalid man type: $withval)
;;
esac
])
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
+ if ${NROFF} -mdoc ${srcdir}/ruby.1 >/dev/null 2>&1; then
MANTYPE=doc
else
MANTYPE=man
@@ -2505,64 +1812,21 @@ if test -z "$MANTYPE"; then
fi
AC_SUBST(MANTYPE)
-arch_hdrdir="${EXTOUT}/include/${arch}/ruby"
-$MAKEDIRS "${arch_hdrdir}"
-config_h="${arch_hdrdir}/config.h"
-tr -d '\015' < confdefs.h | grep -v "^#define PACKAGE_" |
-${srcdir}/tool/ifchange "${config_h}" -
+if test -f config.h && tr -d '\015' < confdefs.h | cmp -s config.h -; then
+ echo "config.h unchanged"
+else
+ echo "creating config.h"
+ tr -d '\015' < confdefs.h > config.h
+fi
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)
-
AC_CONFIG_FILES($FIRSTMAKEFILE)
AC_CONFIG_FILES(Makefile, [{
- if test -d "$srcdir/.svn"; then
- VCS='svn'
- VCSUP='$(VCS) up $(SVNUPOPTIONS)'
- elif test -d "$srcdir/.git/svn"; then
- VCS='git svn'
- VCSUP='$(VCS) rebase $(GITSVNREBASEOPTIONS)'
- elif test -d "$srcdir/.git"; then
- VCS='git'
- VCSUP='$(VCS) pull $(GITPULLOPTIONS)'
- else
- VCS='echo cannot'
- VCSUP='$(VCS)'
- fi
- sed '/^MISSING/s/\$U\././g;/^VCS *=/s#@VCS@#'"$VCS"'#;/^VCSUP *=/s#@VCSUP@#'"$VCSUP"'#' Makefile
+ sed '/^MISSING/s/\$U\././g' 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
- } > confmk$$.tmp && mv -f confmk$$.tmp Makefile &&
- ${MAKE-make} info-program | grep '^PROGRAM=ruby$' > /dev/null ||
- echo 'ruby: $(PROGRAM);' >> Makefile],
-[EXEEXT=$EXEEXT gnumake=$gnumake])
+ test "$RUBY_INSTALL_NAME$EXEEXT" = ruby || echo 'ruby: $(PROGRAM);'
+ sed ['s/{\$([^(){}]*)[^{}]*}//g'] ${srcdir}/common.mk
+ } >> confmk$$.tmp && mv -f confmk$$.tmp Makefile],
+[RUBY_INSTALL_NAME=$RUBY_INSTALL_NAME EXEEXT=$EXEEXT])
AC_OUTPUT
-dnl }
-dnl }
diff --git a/cont.c b/cont.c
deleted file mode 100644
index c0a5dd78ef..0000000000
--- a/cont.c
+++ /dev/null
@@ -1,1050 +0,0 @@
-/**********************************************************************
-
- cont.c -
-
- $Author$
- created at: Thu May 23 09:03:43 2007
-
- Copyright (C) 2007 Koichi Sasada
-
-**********************************************************************/
-
-#include "ruby/ruby.h"
-#include "vm_core.h"
-#include "gc.h"
-#include "eval_intern.h"
-
-#define CAPTURE_JUST_VALID_VM_STACK 1
-
-enum context_type {
- CONTINUATION_CONTEXT = 0,
- FIBER_CONTEXT = 1,
- ROOT_FIBER_CONTEXT = 2
-};
-
-typedef struct rb_context_struct {
- enum context_type type;
- VALUE self;
- int argc;
- VALUE value;
- VALUE *vm_stack;
-#ifdef CAPTURE_JUST_VALID_VM_STACK
- size_t vm_stack_slen; /* length of stack (head of th->stack) */
- size_t vm_stack_clen; /* length of control frames (tail of th->stack) */
-#endif
- VALUE *machine_stack;
- VALUE *machine_stack_src;
-#ifdef __ia64
- VALUE *machine_register_stack;
- VALUE *machine_register_stack_src;
- int machine_register_stack_size;
-#endif
- rb_thread_t saved_thread;
- rb_jmpbuf_t jmpbuf;
- int machine_stack_size;
-} rb_context_t;
-
-enum fiber_status {
- CREATED,
- RUNNING,
- TERMINATED
-};
-
-typedef struct rb_fiber_struct {
- rb_context_t cont;
- VALUE prev;
- enum fiber_status status;
- struct rb_fiber_struct *prev_fiber;
- struct rb_fiber_struct *next_fiber;
-} rb_fiber_t;
-
-static VALUE rb_cContinuation;
-static VALUE rb_cFiber;
-static VALUE rb_eFiberError;
-
-#define GetContPtr(obj, ptr) \
- Data_Get_Struct(obj, rb_context_t, ptr)
-
-#define GetFiberPtr(obj, ptr) do {\
- ptr = (rb_fiber_t*)DATA_PTR(obj);\
- if (!ptr) rb_raise(rb_eFiberError, "uninitialized fiber");\
-} while(0)
-
-NOINLINE(static VALUE cont_capture(volatile int *stat));
-
-void rb_thread_mark(rb_thread_t *th);
-
-static void
-cont_mark(void *ptr)
-{
- RUBY_MARK_ENTER("cont");
- if (ptr) {
- rb_context_t *cont = ptr;
- rb_gc_mark(cont->value);
- rb_thread_mark(&cont->saved_thread);
-
- if (cont->vm_stack) {
-#ifdef CAPTURE_JUST_VALID_VM_STACK
- rb_gc_mark_locations(cont->vm_stack,
- cont->vm_stack + cont->vm_stack_slen + cont->vm_stack_clen);
-#else
- rb_gc_mark_localtion(cont->vm_stack,
- cont->vm_stack, cont->saved_thread.stack_size);
-#endif
- }
-
- if (cont->machine_stack) {
- 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 void
-cont_free(void *ptr)
-{
- RUBY_FREE_ENTER("cont");
- if (ptr) {
- rb_context_t *cont = ptr;
- RUBY_FREE_UNLESS_NULL(cont->saved_thread.stack); fflush(stdout);
- RUBY_FREE_UNLESS_NULL(cont->machine_stack);
-#ifdef __ia64
- RUBY_FREE_UNLESS_NULL(cont->machine_register_stack);
-#endif
- RUBY_FREE_UNLESS_NULL(cont->vm_stack);
-
- /* free rb_cont_t or rb_fiber_t */
- ruby_xfree(ptr);
- }
- RUBY_FREE_LEAVE("cont");
-}
-
-static void
-fiber_mark(void *ptr)
-{
- RUBY_MARK_ENTER("cont");
- if (ptr) {
- rb_fiber_t *fib = ptr;
- rb_gc_mark(fib->prev);
- cont_mark(&fib->cont);
- }
- RUBY_MARK_LEAVE("cont");
-}
-
-static void
-fiber_link_join(rb_fiber_t *fib)
-{
- VALUE current_fibval = rb_fiber_current();
- rb_fiber_t *current_fib;
- GetFiberPtr(current_fibval, current_fib);
-
- /* join fiber link */
- fib->next_fiber = current_fib->next_fiber;
- fib->prev_fiber = current_fib;
- current_fib->next_fiber->prev_fiber = fib;
- current_fib->next_fiber = fib;
-}
-
-static void
-fiber_link_remove(rb_fiber_t *fib)
-{
- fib->prev_fiber->next_fiber = fib->next_fiber;
- fib->next_fiber->prev_fiber = fib->prev_fiber;
-}
-
-static void
-fiber_free(void *ptr)
-{
- RUBY_FREE_ENTER("fiber");
- if (ptr) {
- rb_fiber_t *fib = ptr;
-
- if (fib->cont.type != ROOT_FIBER_CONTEXT) {
- st_free_table(fib->cont.saved_thread.local_storage);
- }
- fiber_link_remove(fib);
-
- cont_free(&fib->cont);
- }
- RUBY_FREE_LEAVE("fiber");
-}
-
-static void
-cont_save_machine_stack(rb_thread_t *th, rb_context_t *cont)
-{
- size_t size;
- rb_thread_t *sth = &cont->saved_thread;
-
- SET_MACHINE_STACK_END(&th->machine_stack_end);
-#ifdef __ia64
- th->machine_register_stack_end = rb_ia64_bsp();
-#endif
-
- if (th->machine_stack_start > th->machine_stack_end) {
- size = cont->machine_stack_size = th->machine_stack_start - th->machine_stack_end;
- cont->machine_stack_src = th->machine_stack_end;
- }
- else {
- 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);
- }
- else {
- 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
-
- sth->machine_stack_start = sth->machine_stack_end = 0;
-#ifdef __ia64
- sth->machine_register_stack_start = sth->machine_register_stack_end = 0;
-#endif
-}
-
-static void
-cont_init(rb_context_t *cont)
-{
- rb_thread_t *th = GET_THREAD();
-
- /* save thread context */
- cont->saved_thread = *th;
-}
-
-static rb_context_t *
-cont_new(VALUE klass)
-{
- rb_context_t *cont;
- volatile VALUE contval;
-
- contval = Data_Make_Struct(klass, rb_context_t, cont_mark, cont_free, cont);
- cont->self = contval;
- cont_init(cont);
- return cont;
-}
-
-void rb_vm_stack_to_heap(rb_thread_t *th);
-
-static VALUE
-cont_capture(volatile int *stat)
-{
- rb_context_t *cont;
- rb_thread_t *th = GET_THREAD(), *sth;
- volatile VALUE contval;
-
- rb_vm_stack_to_heap(th);
- cont = cont_new(rb_cContinuation);
- contval = cont->self;
- sth = &cont->saved_thread;
-
-#ifdef CAPTURE_JUST_VALID_VM_STACK
- cont->vm_stack_slen = th->cfp->sp + th->mark_stack_len - th->stack;
- cont->vm_stack_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->vm_stack = ALLOC_N(VALUE, th->stack_size);
- MEMCPY(cont->vm_stack, th->stack, VALUE, th->stack_size);
-#endif
- sth->stack = 0;
-
- cont_save_machine_stack(th, cont);
-
- if (ruby_setjmp(cont->jmpbuf)) {
- VALUE value;
-
- value = cont->value;
- if (cont->argc == -1) rb_exc_raise(value);
- cont->value = Qnil;
- *stat = 1;
- return value;
- }
- else {
- *stat = 0;
- return cont->self;
- }
-}
-
-NOINLINE(NORETURN(static void cont_restore_1(rb_context_t *)));
-
-static void
-cont_restore_1(rb_context_t *cont)
-{
- rb_thread_t *th = GET_THREAD(), *sth = &cont->saved_thread;
-
- /* restore thread context */
- if (cont->type == CONTINUATION_CONTEXT) {
- /* continuation */
- VALUE fib;
-
- th->fiber = sth->fiber;
- fib = th->fiber ? th->fiber : th->root_fiber;
-
- if (fib) {
- rb_context_t *fcont;
- GetContPtr(fib, fcont);
- th->stack_size = fcont->saved_thread.stack_size;
- th->stack = fcont->saved_thread.stack;
- }
-#ifdef CAPTURE_JUST_VALID_VM_STACK
- 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->stack, cont->vm_stack, VALUE, sth->stack_size);
-#endif
- }
- else {
- /* fiber */
- th->stack = sth->stack;
- th->stack_size = sth->stack_size;
- th->local_storage = sth->local_storage;
- th->fiber = cont->self;
- }
-
- th->cfp = sth->cfp;
- th->safe_level = sth->safe_level;
- th->raised_flag = sth->raised_flag;
- th->state = sth->state;
- th->status = sth->status;
- th->tag = sth->tag;
- th->trap_tag = sth->trap_tag;
- th->errinfo = sth->errinfo;
- th->first_proc = sth->first_proc;
-
- /* restore machine stack */
-#ifdef _M_AMD64
- {
- /* 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);
- }
-
-#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)
-{
- if (cont->machine_stack_src) {
-#ifdef HAVE_ALLOCA
-#define STACK_PAD_SIZE 1
-#else
-#define STACK_PAD_SIZE 1024
-#endif
- VALUE space[STACK_PAD_SIZE];
-
-#if !STACK_GROW_DIRECTION
- 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) {
-# ifdef HAVE_ALLOCA
- volatile VALUE *sp = ALLOCA_N(VALUE, &space[0] - end);
- (void)sp;
-# else
- cont_restore_0(cont, &space[0]);
-# endif
- }
-#endif
-#if !STACK_GROW_DIRECTION
- }
- 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) {
-# ifdef HAVE_ALLOCA
- volatile VALUE *sp = ALLOCA_N(VALUE, end - &space[STACK_PAD_SIZE]);
- (void)sp;
-# else
- 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
- *
- * Continuation objects are generated by
- * <code>Kernel#callcc</code>. They hold a return address and execution
- * context, allowing a nonlocal return to the end of the
- * <code>callcc</code> block from anywhere within a program.
- * Continuations are somewhat analogous to a structured version of C's
- * <code>setjmp/longjmp</code> (although they contain more state, so
- * you might consider them closer to threads).
- *
- * For instance:
- *
- * arr = [ "Freddie", "Herbie", "Ron", "Max", "Ringo" ]
- * callcc{|$cc|}
- * puts(message = arr.shift)
- * $cc.call unless message =~ /Max/
- *
- * <em>produces:</em>
- *
- * Freddie
- * Herbie
- * Ron
- * Max
- *
- * This (somewhat contrived) example allows the inner loop to abandon
- * processing early:
- *
- * callcc {|cont|
- * for i in 0..4
- * print "\n#{i}: "
- * for j in i*5...(i+1)*5
- * cont.call() if j == 17
- * printf "%3d", j
- * end
- * end
- * }
- * print "\n"
- *
- * <em>produces:</em>
- *
- * 0: 0 1 2 3 4
- * 1: 5 6 7 8 9
- * 2: 10 11 12 13 14
- * 3: 15 16
- */
-
-/*
- * call-seq:
- * callcc {|cont| block } => obj
- *
- * Generates a <code>Continuation</code> object, which it passes to the
- * associated block. Performing a <em>cont</em><code>.call</code> will
- * cause the <code>callcc</code> to return (as will falling through the
- * end of the block). The value returned by the <code>callcc</code> is
- * the value of the block, or the value passed to
- * <em>cont</em><code>.call</code>. See class <code>Continuation</code>
- * for more details. Also see <code>Kernel::throw</code> for
- * an alternative mechanism for unwinding a call stack.
- */
-
-static VALUE
-rb_callcc(VALUE self)
-{
- volatile int called;
- volatile VALUE val = cont_capture(&called);
-
- if (called) {
- return val;
- }
- else {
- return rb_yield(val);
- }
-}
-
-static VALUE
-make_passing_arg(int argc, VALUE *argv)
-{
- switch(argc) {
- case 0:
- return Qnil;
- case 1:
- return argv[0];
- default:
- return rb_ary_new4(argc, argv);
- }
-}
-
-/*
- * call-seq:
- * cont.call(args, ...)
- * cont[args, ...]
- *
- * 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
- * callcc {|cont| cont.call 1, 2, 3 } #=> [1, 2, 3]
- */
-
-static VALUE
-rb_cont_call(int argc, VALUE *argv, VALUE contval)
-{
- rb_context_t *cont;
- rb_thread_t *th = GET_THREAD();
- GetContPtr(contval, cont);
-
- if (cont->saved_thread.self != th->self) {
- rb_raise(rb_eRuntimeError, "continuation called across threads");
- }
- if (cont->saved_thread.trap_tag != th->trap_tag) {
- rb_raise(rb_eRuntimeError, "continuation called across trap");
- }
- if (cont->saved_thread.fiber) {
- rb_context_t *fcont;
- GetContPtr(cont->saved_thread.fiber, fcont);
-
- if (th->fiber != cont->saved_thread.fiber) {
- rb_raise(rb_eRuntimeError, "continuation called across fiber");
- }
- }
-
- cont->argc = argc;
- cont->value = make_passing_arg(argc, argv);
-
- cont_restore_0(cont, &contval);
- return Qnil; /* unreachable */
-}
-
-/*********/
-/* fiber */
-/*********/
-
-/*
- * Document-class: Fiber
- *
- * Fibers are primitives for implementing light weight cooperative
- * concurrency in Ruby. Basically they are a means of creating code blocks
- * that can be paused and resumed, much like threads. The main difference
- * is that they are never preempted and that the scheduling must be done by
- * the programmer and not the VM.
- *
- * As opposed to other stackless light weight concurrency models, each fiber
- * 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
- * be explicitly asked to run using the <code>Fiber#resume</code> method.
- * The code running inside the fiber can give up control by calling
- * <code>Fiber.yield</code> in which case it yields control back to caller
- * (the caller of the <code>Fiber#resume</code>).
- *
- * Upon yielding or termination the Fiber returns the value of the last
- * executed expression
- *
- * For instance:
- *
- * fiber = Fiber.new do
- * Fiber.yield 1
- * 2
- * end
- *
- * puts fiber.resume
- * puts fiber.resume
- * puts fiber.resume
- *
- * <em>produces</em>
- *
- * 1
- * 2
- * FiberError: dead fiber called
- *
- * The <code>Fiber#resume</code> method accepts an arbitary 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:
- *
- * fiber = Fiber.new do |first|
- * second = Fiber.yield first + 2
- * end
- *
- * puts fiber.resume 10
- * puts fiber.resume 14
- * puts fiber.resume 18
- *
- * <em>produces</em>
- *
- * 12
- * 14
- * FiberError: dead fiber called
- *
- */
-
-#define FIBER_VM_STACK_SIZE (4 * 1024)
-
-static VALUE
-fiber_alloc(VALUE klass)
-{
- return Data_Wrap_Struct(klass, fiber_mark, fiber_free, 0);
-}
-
-static rb_fiber_t*
-fiber_t_alloc(VALUE fibval)
-{
- rb_fiber_t *fib = ALLOC(rb_fiber_t);
-
- memset(fib, 0, sizeof(rb_fiber_t));
- fib->cont.self = fibval;
- fib->cont.type = FIBER_CONTEXT;
- cont_init(&fib->cont);
- fib->prev = Qnil;
- fib->status = CREATED;
-
- DATA_PTR(fibval) = fib;
-
- return fib;
-}
-
-static VALUE
-fiber_init(VALUE fibval, VALUE proc)
-{
- rb_fiber_t *fib = fiber_t_alloc(fibval);
- rb_context_t *cont = &fib->cont;
- rb_thread_t *th = &cont->saved_thread;
-
- fiber_link_join(fib);
-
- /* initialize cont */
- cont->vm_stack = 0;
-
- th->stack = 0;
- th->stack_size = FIBER_VM_STACK_SIZE;
- th->stack = ALLOC_N(VALUE, th->stack_size);
-
- th->cfp = (void *)(th->stack + th->stack_size);
- th->cfp--;
- th->cfp->pc = 0;
- th->cfp->sp = th->stack + 1;
- th->cfp->bp = 0;
- th->cfp->lfp = th->stack;
- *th->cfp->lfp = 0;
- th->cfp->dfp = th->stack;
- th->cfp->self = Qnil;
- th->cfp->flag = 0;
- th->cfp->iseq = 0;
- th->cfp->proc = 0;
- th->cfp->block_iseq = 0;
- th->tag = 0;
- th->local_storage = st_init_numtable();
-
- th->first_proc = proc;
-
- MEMCPY(&cont->jmpbuf, &th->root_jmpbuf, rb_jmpbuf_t, 1);
-
- return fibval;
-}
-
-static VALUE
-rb_fiber_init(VALUE fibval)
-{
- return fiber_init(fibval, rb_block_proc());
-}
-
-VALUE
-rb_fiber_new(VALUE (*func)(ANYARGS), VALUE obj)
-{
- return fiber_init(fiber_alloc(rb_cFiber), rb_proc_new(func, obj));
-}
-
-static VALUE
-return_fiber(void)
-{
- rb_fiber_t *fib;
- VALUE curr = rb_fiber_current();
- GetFiberPtr(curr, fib);
-
- if (fib->prev == Qnil) {
- rb_thread_t *th = GET_THREAD();
-
- if (th->root_fiber != curr) {
- return th->root_fiber;
- }
- else {
- rb_raise(rb_eFiberError, "can't yield from root fiber");
- }
- }
- else {
- VALUE prev = fib->prev;
- fib->prev = Qnil;
- return prev;
- }
-}
-
-VALUE rb_fiber_transfer(VALUE fib, int argc, VALUE *argv);
-
-static void
-rb_fiber_terminate(rb_fiber_t *fib)
-{
- VALUE value = fib->cont.value;
- fib->status = TERMINATED;
- rb_fiber_transfer(return_fiber(), 1, &value);
-}
-
-void
-rb_fiber_start(void)
-{
- rb_thread_t *th = GET_THREAD();
- rb_fiber_t *fib;
- rb_context_t *cont;
- rb_proc_t *proc;
- int state;
-
- GetFiberPtr(th->fiber, fib);
- cont = &fib->cont;
-
- TH_PUSH_TAG(th);
- if ((state = EXEC_TAG()) == 0) {
- int argc;
- VALUE *argv, args;
- GetProcPtr(cont->saved_thread.first_proc, proc);
- args = cont->value;
- argv = (argc = cont->argc) > 1 ? RARRAY_PTR(args) : &args;
- cont->value = Qnil;
- th->errinfo = Qnil;
- th->local_lfp = proc->block.lfp;
- th->local_svar = Qnil;
-
- fib->status = RUNNING;
- cont->value = rb_vm_invoke_proc(th, proc, proc->block.self, argc, argv, 0);
- }
- TH_POP_TAG();
-
- if (state) {
- if (TAG_RAISE) {
- th->thrown_errinfo = th->errinfo;
- }
- else {
- th->thrown_errinfo =
- rb_vm_make_jump_tag_but_local_jump(state, th->errinfo);
- }
- RUBY_VM_SET_INTERRUPT(th);
- }
-
- rb_fiber_terminate(fib);
- rb_bug("rb_fiber_start: unreachable");
-}
-
-static rb_fiber_t *
-root_fiber_alloc(rb_thread_t *th)
-{
- rb_fiber_t *fib;
-
- /* no need to allocate vm stack */
- fib = fiber_t_alloc(fiber_alloc(rb_cFiber));
- fib->cont.type = ROOT_FIBER_CONTEXT;
- fib->prev_fiber = fib->next_fiber = fib;
-
- return fib;
-}
-
-VALUE
-rb_fiber_current(void)
-{
- rb_thread_t *th = GET_THREAD();
- if (th->fiber == 0) {
- /* save root */
- rb_fiber_t *fib = root_fiber_alloc(th);
- th->root_fiber = th->fiber = fib->cont.self;
- }
- return th->fiber;
-}
-
-static VALUE
-fiber_store(rb_fiber_t *next_fib)
-{
- rb_thread_t *th = GET_THREAD();
- rb_fiber_t *fib;
-
- if (th->fiber) {
- GetFiberPtr(th->fiber, fib);
- fib->cont.saved_thread = *th;
- }
- else {
- /* create current fiber */
- fib = root_fiber_alloc(th);
- th->root_fiber = th->fiber = fib->cont.self;
- }
-
- cont_save_machine_stack(th, &fib->cont);
-
- if (ruby_setjmp(fib->cont.jmpbuf)) {
- /* restored */
- GetFiberPtr(th->fiber, fib);
- if (fib->cont.argc == -1) rb_exc_raise(fib->cont.value);
- return fib->cont.value;
- }
- else {
- return Qundef;
- }
-}
-
-static inline VALUE
-fiber_switch(VALUE fibval, int argc, VALUE *argv, int is_resume)
-{
- VALUE value;
- rb_fiber_t *fib;
- rb_context_t *cont;
- rb_thread_t *th = GET_THREAD();
-
- GetFiberPtr(fibval, fib);
- cont = &fib->cont;
-
- if (cont->saved_thread.self != th->self) {
- rb_raise(rb_eFiberError, "fiber called across threads");
- }
- else if (cont->saved_thread.trap_tag != th->trap_tag) {
- rb_raise(rb_eFiberError, "fiber called across trap");
- }
- else if (fib->status == TERMINATED) {
- value = rb_exc_new2(rb_eFiberError, "dead fiber called");
- if (th->fiber != fibval) rb_exc_raise(value);
- fibval = fib->prev;
- if (NIL_P(fibval)) fibval = th->root_fiber;
- GetFiberPtr(fibval, fib);
- cont = &fib->cont;
- cont->argc = -1;
- cont->value = value;
- cont_restore_0(cont, &value);
- }
-
- if (is_resume) {
- fib->prev = rb_fiber_current();
- }
-
- cont->argc = argc;
- cont->value = make_passing_arg(argc, argv);
-
- if ((value = fiber_store(fib)) == Qundef) {
- cont_restore_0(cont, &value);
- rb_bug("rb_fiber_resume: unreachable");
- }
-
- RUBY_VM_CHECK_INTS();
-
- return value;
-}
-
-VALUE
-rb_fiber_transfer(VALUE fib, int argc, VALUE *argv)
-{
- return fiber_switch(fib, argc, argv, 0);
-}
-
-VALUE
-rb_fiber_resume(VALUE fibval, int argc, VALUE *argv)
-{
- rb_fiber_t *fib;
- GetFiberPtr(fibval, fib);
-
- if (fib->prev != Qnil) {
- rb_raise(rb_eFiberError, "double resume");
- }
-
- return fiber_switch(fibval, argc, argv, 1);
-}
-
-VALUE
-rb_fiber_yield(int argc, VALUE *argv)
-{
- return rb_fiber_transfer(return_fiber(), argc, argv);
-}
-
-/*
- * call-seq:
- * fiber.alive? -> true or false
- *
- * Returns true if the fiber can still be resumed (or transferred to).
- * After finishing execution of the fiber block this method will always
- * return false.
- */
-VALUE
-rb_fiber_alive_p(VALUE fibval)
-{
- 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 <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 <code>Fiber.yield</code> statement inside the fiber's block
- * or to the block value if it runs to completion without any
- * <code>Fiber.yield</code>
- */
-static VALUE
-rb_fiber_m_resume(int argc, VALUE *argv, VALUE fib)
-{
- return rb_fiber_resume(fib, argc, argv);
-}
-
-/*
- * call-seq:
- * fiber.transfer(args, ...) -> obj
- *
- * 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 <code>Fiber.yield</code>.
- *
- * The fiber which recieves the transfer call is treats it much like
- * a resume call. Arguments passed to transfer are treated like those
- * passed to resume.
- *
- * 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.
- */
-static VALUE
-rb_fiber_m_transfer(int argc, VALUE *argv, VALUE fib)
-{
- return rb_fiber_transfer(fib, argc, argv);
-}
-
-/*
- * call-seq:
- * Fiber.yield(args, ...) -> obj
- *
- * 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 <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(argc, argv);
-}
-
-/*
- * call-seq:
- * Fiber.current() -> fiber
- *
- * Returns the current fiber. You need to <code>require 'fiber'</code>
- * before using this method. If you are not running in the context of
- * a fiber this method will return the root fiber.
- */
-static VALUE
-rb_fiber_s_current(VALUE klass)
-{
- return rb_fiber_current();
-}
-
-void
-Init_Cont(void)
-{
- 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_init, 0);
- rb_define_method(rb_cFiber, "resume", rb_fiber_m_resume, -1);
-}
-
-void
-ruby_Init_Continuation_body(void)
-{
- rb_cContinuation = rb_define_class("Continuation", rb_cObject);
- rb_undef_alloc_func(rb_cContinuation);
- rb_undef_method(CLASS_OF(rb_cContinuation), "new");
- rb_define_method(rb_cContinuation, "call", rb_cont_call, -1);
- rb_define_method(rb_cContinuation, "[]", rb_cont_call, -1);
- rb_define_global_function("callcc", rb_callcc, 0);
-}
-
-void
-ruby_Init_Fiber_as_Coroutine(void)
-{
- rb_define_method(rb_cFiber, "transfer", rb_fiber_m_transfer, -1);
- rb_define_method(rb_cFiber, "alive?", rb_fiber_alive_p, 0);
- rb_define_singleton_method(rb_cFiber, "current", rb_fiber_s_current, 0);
-}
diff --git a/cygwin/GNUmakefile.in b/cygwin/GNUmakefile.in
index eb6967aef5..03208df11c 100644
--- a/cygwin/GNUmakefile.in
+++ b/cygwin/GNUmakefile.in
@@ -1,15 +1,14 @@
include Makefile
--include uncommon.mk
ENABLE_SHARED=@ENABLE_SHARED@
DLLWRAP = @DLLWRAP@ --target=@target_os@
ifeq (@target_os@,cygwin)
- DLL_BASE_NAME := $(LIBRUBY_SO:.dll=)
+ DLL_BASE_NAME := $(subst .dll,,$(LIBRUBY_SO))
else
DLL_BASE_NAME := $(RUBY_SO_NAME)
DLLWRAP += -mno-cygwin
- VPATH := $(VPATH):$(srcdir)/win32
+ VPATH += $(srcdir)/win32
endif
ifneq ($(ENABLE_SHARED),yes)
@@ -27,9 +26,8 @@ endif
WPROGRAM = $(RUBYW_INSTALL_NAME)$(EXEEXT)
SOLIBS := $(DLL_BASE_NAME).res.@OBJEXT@ $(SOLIBS)
-EXTOBJS += $(if $(filter-out $(RUBYW_INSTALL_NAME),$(@:$(EXEEXT)=)),$(RUBY_INSTALL_NAME),$(@:$(EXEEXT)=)).res.$(OBJEXT)
+EXTOBJS += $(@:$(EXEEXT)=.res.@OBJEXT@)
RCFILES = $(RUBY_INSTALL_NAME).rc $(RUBYW_INSTALL_NAME).rc $(DLL_BASE_NAME).rc
-RUBYDEF = $(DLL_BASE_NAME).def
ruby: $(PROGRAM)
rubyw: $(WPROGRAM)
@@ -62,22 +60,15 @@ $(RUBY_EXP): $(LIBRUBY_A)
GNUmakefile: $(srcdir)/cygwin/GNUmakefile.in
ifeq (@target_os@,mingw32)
-$(OBJS) $(MAINOBJ): win32.h
-
-dir.$(OBJEXT) win32.$(OBJEXT): win32/dir.h
+$(OBJS) $(MAINOBJ): win32/win32.h
endif
-$(LIBRUBY_SO): $(RUBYDEF)
-
-$(RUBYDEF): $(LIBRUBY_A) $(PREP) $(RBCONFIG)
- $(MINIRUBY) $(srcdir)/win32/mkexports.rb -output=$@ $(LIBRUBY_A)
-
-clean-local::
- @$(RM) $(RUBYDEF)
-
ifeq (@target_os@,cygwin)
-cygwin-$(RUBY_INSTALL_NAME)$(MAJOR)$(MINOR)$(TEENY).dll: $(LIBRUBY_A) $(RUBYDEF)
- @DLLWRAP@ -s --def=$(RUBYDEF) -o $@
+cygwin-$(RUBY_INSTALL_NAME)$(MAJOR)$(MINOR).dll: $(LIBRUBY_A)
+ @NM@ --extern --defined $(LIBRUBY_A) | \
+ $(MINIRUBY) -ne 'BEGIN{puts "EXPORTS"}; puts $$1+"=cyg$(RUBY_INSTALL_NAME)$(MAJOR)$(MINOR)."+$$1 if / [CDT] _(.*)$$/' >rubydll.def
+ @DLLWRAP@ -s --def=rubydll.def -o $@
+ @rm -f rubydll.def
endif
clean-local::
diff --git a/debug.c b/debug.c
deleted file mode 100644
index 874d1c84b7..0000000000
--- a/debug.c
+++ /dev/null
@@ -1,164 +0,0 @@
-/**********************************************************************
-
- debug.c -
-
- $Author$
- created at: 04/08/25 02:31:54 JST
-
- Copyright (C) 2004-2007 Koichi Sasada
-
-**********************************************************************/
-
-#include "ruby/ruby.h"
-#include "ruby/encoding.h"
-#include "ruby/util.h"
-#include "debug.h"
-#include "eval_intern.h"
-#include "vm_core.h"
-#include "id.h"
-
-/* for gdb */
-static const union {
- enum ruby_special_consts special_consts;
- enum ruby_value_type value_type;
- enum ruby_tag_type tag_type;
- enum node_type node_type;
- enum ruby_method_ids method_ids;
- enum {
- RUBY_ENCODING_INLINE_MAX = ENCODING_INLINE_MAX,
- RUBY_ENCODING_SHIFT = ENCODING_SHIFT,
- RUBY_ENCODING_MASK = ENCODING_MASK,
- 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_MARK = FL_MARK,
- RUBY_FL_REMENBERED_SET = FL_REMEMBERED_SET,
- RUBY_FL_FINALIZE = FL_FINALIZE,
- RUBY_FL_TAINT = FL_TAINT,
- RUBY_FL_UNTRUSTED = FL_UNTRUSTED,
- 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_LMASK = NODE_LMASK,
- RUBY_NODE_FL_NEWLINE = NODE_FL_NEWLINE
- } various;
-} dummy_gdb_enums;
-
-const VALUE RUBY_FL_USER19 = FL_USER19;
-
-int
-ruby_debug_print_indent(int level, int debug_level, int indent_level)
-{
- if (level < debug_level) {
- fprintf(stderr, "%*s", indent_level, "");
- fflush(stderr);
- return Qtrue;
- }
- return Qfalse;
-}
-
-void
-ruby_debug_printf(const char *format, ...)
-{
- va_list ap;
- va_start(ap, format);
- vfprintf(stderr, format, ap);
- va_end(ap);
-}
-
-VALUE
-ruby_debug_print_value(int level, int debug_level, const char *header, VALUE obj)
-{
- if (level < debug_level) {
- VALUE str;
- str = rb_inspect(obj);
- fprintf(stderr, "DBG> %s: %s\n", header,
- obj == (VALUE)(SIGNED_VALUE)-1 ? "" : StringValueCStr(str));
- fflush(stderr);
- }
- return obj;
-}
-
-void
-ruby_debug_print_v(VALUE v)
-{
- ruby_debug_print_value(0, 1, "", v);
-}
-
-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));
- fflush(stderr);
- }
- return id;
-}
-
-NODE *
-ruby_debug_print_node(int level, int debug_level, const char *header, const NODE *node)
-{
- if (level < debug_level) {
- fprintf(stderr, "DBG> %s: %s (%lu)\n", header,
- ruby_node_name(nd_type(node)), nd_line(node));
- }
- return (NODE *)node;
-}
-
-void
-ruby_debug_breakpoint(void)
-{
- /* */
-}
-
-#ifdef RUBY_DEBUG_ENV
-static void
-set_debug_option(const char *str, int len, void *arg)
-{
-#define SET_WHEN(name, var) do { \
- if (len == sizeof(name) - 1 && \
- strncmp(str, name, len) == 0) { \
- extern int var; \
- var = 1; \
- return; \
- } \
- } while (0)
- SET_WHEN("gc_stress", *ruby_initial_gc_stress_ptr);
- SET_WHEN("core", ruby_enable_coredump);
-#if defined _WIN32 && defined _MSC_VER && _MSC_VER >= 1400
- SET_WHEN("rtc_error", ruby_w32_rtc_error);
-#endif
- fprintf(stderr, "unexpected debug option: %.*s\n", len, str);
-}
-
-void
-ruby_set_debug_option(const char *str)
-{
- ruby_each_words(str, set_debug_option, 0);
-}
-#endif
diff --git a/debug.h b/debug.h
deleted file mode 100644
index d5670651a4..0000000000
--- a/debug.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/**********************************************************************
-
- debug.h - YARV Debug function interface
-
- $Author$
- created at: 04/08/25 02:33:49 JST
-
- Copyright (C) 2004-2007 Koichi Sasada
-
-**********************************************************************/
-
-#ifndef RUBY_DEBUG_H
-#define RUBY_DEBUG_H
-
-#include "ruby/ruby.h"
-#include "node.h"
-
-#define dpv(h,v) ruby_debug_print_value(-1, 0, h, v)
-#define dp(v) ruby_debug_print_value(-1, 0, "", v)
-#define dpi(i) ruby_debug_print_id(-1, 0, "", i)
-#define dpn(n) ruby_debug_print_node(-1, 0, "", n)
-
-#define bp() ruby_debug_breakpoint()
-
-VALUE ruby_debug_print_value(int level, int debug_level, const char *header, VALUE v);
-ID ruby_debug_print_id(int level, int debug_level, const char *header, ID id);
-NODE *ruby_debug_print_node(int level, int debug_level, const char *header, const NODE *node);
-int ruby_debug_print_indent(int level, int debug_level, int indent_level);
-void ruby_debug_breakpoint(void);
-void ruby_debug_gc_check_func(void);
-
-#ifdef RUBY_DEBUG_ENV
-void ruby_set_debug_option(const char *str);
-#endif
-
-#endif /* RUBY_DEBUG_H */
diff --git a/defines.h b/defines.h
new file mode 100644
index 0000000000..f39097fea4
--- /dev/null
+++ b/defines.h
@@ -0,0 +1,273 @@
+/************************************************
+
+ defines.h -
+
+ $Author$
+ $Date$
+ created at: Wed May 18 00:21:44 JST 1994
+
+************************************************/
+#ifndef DEFINES_H
+#define DEFINES_H
+
+#define RUBY
+
+#ifdef __cplusplus
+# ifndef HAVE_PROTOTYPES
+# define HAVE_PROTOTYPES 1
+# endif
+# ifndef HAVE_STDARG_PROTOTYPES
+# define HAVE_STDARG_PROTOTYPES 1
+# endif
+#endif
+
+#undef _
+#ifdef HAVE_PROTOTYPES
+# define _(args) args
+#else
+# define _(args) ()
+#endif
+
+#undef __
+#ifdef HAVE_STDARG_PROTOTYPES
+# define __(args) args
+#else
+# define __(args) ()
+#endif
+
+#ifdef __cplusplus
+#define ANYARGS ...
+#else
+#define ANYARGS
+#endif
+
+#define xmalloc ruby_xmalloc
+#define xcalloc ruby_xcalloc
+#define xrealloc ruby_xrealloc
+#define xfree ruby_xfree
+
+void *xmalloc _((long));
+void *xcalloc _((long,long));
+void *xrealloc _((void*,long));
+void xfree _((void*));
+
+#if SIZEOF_LONG_LONG > 0
+# define LONG_LONG long long
+#elif SIZEOF___INT64 > 0
+# define HAVE_LONG_LONG 1
+# define LONG_LONG __int64
+# undef SIZEOF_LONG_LONG
+# define SIZEOF_LONG_LONG SIZEOF___INT64
+#endif
+
+#if SIZEOF_INT*2 <= SIZEOF_LONG_LONG
+# define BDIGIT unsigned int
+# define SIZEOF_BDIGITS SIZEOF_INT
+# define BDIGIT_DBL unsigned LONG_LONG
+# define BDIGIT_DBL_SIGNED LONG_LONG
+#elif SIZEOF_INT*2 <= SIZEOF_LONG
+# define BDIGIT unsigned int
+# define SIZEOF_BDIGITS SIZEOF_INT
+# define BDIGIT_DBL unsigned long
+# define BDIGIT_DBL_SIGNED long
+#elif SIZEOF_SHORT*2 <= SIZEOF_LONG
+# define BDIGIT unsigned short
+# define SIZEOF_BDIGITS SIZEOF_SHORT
+# define BDIGIT_DBL unsigned long
+# define BDIGIT_DBL_SIGNED long
+#else
+# define BDIGIT unsigned short
+# define SIZEOF_BDIGITS (SIZEOF_LONG/2)
+# define BDIGIT_DBL unsigned long
+# define BDIGIT_DBL_SIGNED long
+#endif
+
+#ifdef __CYGWIN__
+#undef _WIN32
+#endif
+
+#if defined(MSDOS) || defined(_WIN32) || defined(__human68k__) || defined(__EMX__)
+#define DOSISH 1
+#ifndef _WIN32_WCE
+# define DOSISH_DRIVE_LETTER
+#endif
+#endif
+
+/* define RUBY_USE_EUC/SJIS for default kanji-code */
+#ifndef DEFAULT_KCODE
+#if defined(DOSISH) || defined(__CYGWIN__) || defined(__MACOS__) || defined(OS2)
+#define DEFAULT_KCODE KCODE_SJIS
+#else
+#define DEFAULT_KCODE KCODE_EUC
+#endif
+#endif
+
+#if defined(__NeXT__) || defined(__APPLE__)
+/* Do not trust WORDS_BIGENDIAN from configure since -arch compiler flag may
+ result in a different endian. Instead trust __BIG_ENDIAN__ and
+ __LITTLE_ENDIAN__ which are set correctly by -arch. */
+#undef WORDS_BIGENDIAN
+#ifdef __BIG_ENDIAN__
+#define WORDS_BIGENDIAN
+#endif
+#endif
+
+#ifdef __NeXT__
+/* NextStep, OpenStep, Rhapsody */
+#ifndef S_IRUSR
+#define S_IRUSR 0000400 /* read permission, owner */
+#endif
+#ifndef S_IRGRP
+#define S_IRGRP 0000040 /* read permission, group */
+#endif
+#ifndef S_IROTH
+#define S_IROTH 0000004 /* read permission, other */
+#endif
+#ifndef S_IWUSR
+#define S_IWUSR 0000200 /* write permission, owner */
+#endif
+#ifndef S_IWGRP
+#define S_IWGRP 0000020 /* write permission, group */
+#endif
+#ifndef S_IWOTH
+#define S_IWOTH 0000002 /* write permission, other */
+#endif
+#ifndef S_IXUSR
+#define S_IXUSR 0000100 /* execute/search permission, owner */
+#endif
+#ifndef S_IXGRP
+#define S_IXGRP 0000010 /* execute/search permission, group */
+#endif
+#ifndef S_IXOTH
+#define S_IXOTH 0000001 /* execute/search permission, other */
+#endif
+#ifndef S_IRWXU
+#define S_IRWXU 0000700 /* read, write, execute permissions, owner */
+#endif
+#ifndef S_IRWXG
+#define S_IRWXG 0000070 /* read, write, execute permissions, group */
+#endif
+#ifndef S_IRWXO
+#define S_IRWXO 0000007 /* read, write, execute permissions, other */
+#endif
+#ifndef S_ISBLK
+#define S_ISBLK(mode) (((mode) & (0170000)) == (0060000))
+#endif
+#ifndef S_ISCHR
+#define S_ISCHR(mode) (((mode) & (0170000)) == (0020000))
+#endif
+#ifndef S_ISDIR
+#define S_ISDIR(mode) (((mode) & (0170000)) == (0040000))
+#endif
+#ifndef S_ISFIFO
+#define S_ISFIFO(mode) (((mode) & (0170000)) == (0010000))
+#endif
+#ifndef S_ISREG
+#define S_ISREG(mode) (((mode) & (0170000)) == (0100000))
+#endif
+#ifndef __APPLE__
+/* NextStep, OpenStep (but not Rhapsody) */
+#ifndef GETPGRP_VOID
+#define GETPGRP_VOID 1
+#endif
+#ifndef WNOHANG
+#define WNOHANG 01
+#endif
+#ifndef WUNTRACED
+#define WUNTRACED 02
+#endif
+#ifndef X_OK
+#define X_OK 1
+#endif
+#endif /* __APPLE__ */
+#endif /* NeXT */
+
+#ifdef _WIN32
+#include "win32/win32.h"
+#endif
+
+#if defined(__VMS)
+#include "vms.h"
+#endif
+
+#if defined(__BEOS__)
+#include <net/socket.h> /* intern.h needs fd_set definition */
+#endif
+
+#ifdef RUBY_EXPORT
+#undef RUBY_EXTERN
+#endif
+
+#ifndef RUBY_EXTERN
+#define RUBY_EXTERN extern
+#endif
+
+#ifndef EXTERN
+#define EXTERN RUBY_EXTERN /* deprecated */
+#endif
+
+#ifndef RUBY_MBCHAR_MAXSIZE
+#define RUBY_MBCHAR_MAXSIZE INT_MAX
+ /* MB_CUR_MAX will not work well in C locale */
+#endif
+
+#if defined(sparc) || defined(__sparc__)
+static inline void
+flush_register_windows(void)
+{
+ asm
+#ifdef __GNUC__
+ volatile
+#endif
+# if defined(__sparc_v9__) || defined(__sparcv9) || defined(__arch64__)
+ ("flushw")
+# else
+ ("ta 0x03")
+# endif /* trap always to flush register windows if we are on a Sparc system */
+ ;
+}
+# define FLUSH_REGISTER_WINDOWS flush_register_windows()
+#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
+
+#if defined(DOSISH)
+#define PATH_SEP ";"
+#elif defined(riscos)
+#define PATH_SEP ","
+#else
+#define PATH_SEP ":"
+#endif
+#define PATH_SEP_CHAR PATH_SEP[0]
+
+#if defined(__human68k__)
+#define PATH_ENV "path"
+#else
+#define PATH_ENV "PATH"
+#endif
+
+#if defined(DOSISH) && !defined(__human68k__) && !defined(__EMX__)
+#define ENV_IGNORECASE
+#endif
+
+#ifndef CASEFOLD_FILESYSTEM
+# if defined DOSISH || defined __VMS
+# define CASEFOLD_FILESYSTEM 1
+# else
+# define CASEFOLD_FILESYSTEM 0
+# endif
+#endif
+
+#ifndef DLEXT_MAXLEN
+#define DLEXT_MAXLEN 4
+#endif
+
+#ifndef RUBY_PLATFORM
+#define RUBY_PLATFORM "unknown-unknown"
+#endif
+
+#endif
diff --git a/defs/keywords b/defs/keywords
deleted file mode 100644
index 1b5719aa85..0000000000
--- a/defs/keywords
+++ /dev/null
@@ -1,53 +0,0 @@
-%{
-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);
-#define rb_reserved_word(str, len) reserved_word(str, len)
-%}
-
-struct kwtable;
-%%
-__ENCODING__, {keyword__ENCODING__, keyword__ENCODING__}, EXPR_END
-__LINE__, {keyword__LINE__, keyword__LINE__}, EXPR_END
-__FILE__, {keyword__FILE__, keyword__FILE__}, EXPR_END
-BEGIN, {keyword_BEGIN, keyword_BEGIN}, EXPR_END
-END, {keyword_END, keyword_END}, EXPR_END
-alias, {keyword_alias, keyword_alias}, EXPR_FNAME
-and, {keyword_and, keyword_and}, EXPR_VALUE
-begin, {keyword_begin, keyword_begin}, EXPR_BEG
-break, {keyword_break, keyword_break}, EXPR_MID
-case, {keyword_case, keyword_case}, EXPR_VALUE
-class, {keyword_class, keyword_class}, EXPR_CLASS
-def, {keyword_def, keyword_def}, EXPR_FNAME
-defined?, {keyword_defined, keyword_defined}, EXPR_ARG
-do, {keyword_do, keyword_do}, EXPR_BEG
-else, {keyword_else, keyword_else}, EXPR_BEG
-elsif, {keyword_elsif, keyword_elsif}, EXPR_VALUE
-end, {keyword_end, keyword_end}, EXPR_END
-ensure, {keyword_ensure, keyword_ensure}, EXPR_BEG
-false, {keyword_false, keyword_false}, EXPR_END
-for, {keyword_for, keyword_for}, EXPR_VALUE
-if, {keyword_if, modifier_if}, EXPR_VALUE
-in, {keyword_in, keyword_in}, EXPR_VALUE
-module, {keyword_module, keyword_module}, EXPR_VALUE
-next, {keyword_next, keyword_next}, EXPR_MID
-nil, {keyword_nil, keyword_nil}, EXPR_END
-not, {keyword_not, keyword_not}, EXPR_ARG
-or, {keyword_or, keyword_or}, EXPR_VALUE
-redo, {keyword_redo, keyword_redo}, EXPR_END
-rescue, {keyword_rescue, modifier_rescue}, EXPR_MID
-retry, {keyword_retry, keyword_retry}, EXPR_END
-return, {keyword_return, keyword_return}, EXPR_MID
-self, {keyword_self, keyword_self}, EXPR_END
-super, {keyword_super, keyword_super}, EXPR_ARG
-then, {keyword_then, keyword_then}, EXPR_BEG
-true, {keyword_true, keyword_true}, EXPR_END
-undef, {keyword_undef, keyword_undef}, EXPR_FNAME
-unless, {keyword_unless, modifier_unless}, EXPR_VALUE
-until, {keyword_until, modifier_until}, EXPR_VALUE
-when, {keyword_when, keyword_when}, EXPR_VALUE
-while, {keyword_while, modifier_while}, EXPR_VALUE
-yield, {keyword_yield, keyword_yield}, EXPR_ARG
-%%
-#endif
diff --git a/defs/known_errors.def b/defs/known_errors.def
deleted file mode 100644
index 9f09aa9c22..0000000000
--- a/defs/known_errors.def
+++ /dev/null
@@ -1,122 +0,0 @@
-EPERM
-ENOENT
-ESRCH
-EINTR
-EIO
-ENXIO
-E2BIG
-ENOEXEC
-EBADF
-ECHILD
-EAGAIN
-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
-EBADR
-EXFULL
-ENOANO
-EBADRQC
-EBADSLT
-EDEADLOCK
-EBFONT
-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
-ECONNRESET
-ENOBUFS
-EISCONN
-ENOTCONN
-ESHUTDOWN
-ETOOMANYREFS
-ETIMEDOUT
-ECONNREFUSED
-EHOSTDOWN
-EHOSTUNREACH
-EALREADY
-EINPROGRESS
-ESTALE
-EUCLEAN
-ENOTNAM
-ENAVAIL
-EISNAM
-EREMOTEIO
-EDQUOT
diff --git a/defs/lex.c.src b/defs/lex.c.src
deleted file mode 100644
index 1b5719aa85..0000000000
--- a/defs/lex.c.src
+++ /dev/null
@@ -1,53 +0,0 @@
-%{
-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);
-#define rb_reserved_word(str, len) reserved_word(str, len)
-%}
-
-struct kwtable;
-%%
-__ENCODING__, {keyword__ENCODING__, keyword__ENCODING__}, EXPR_END
-__LINE__, {keyword__LINE__, keyword__LINE__}, EXPR_END
-__FILE__, {keyword__FILE__, keyword__FILE__}, EXPR_END
-BEGIN, {keyword_BEGIN, keyword_BEGIN}, EXPR_END
-END, {keyword_END, keyword_END}, EXPR_END
-alias, {keyword_alias, keyword_alias}, EXPR_FNAME
-and, {keyword_and, keyword_and}, EXPR_VALUE
-begin, {keyword_begin, keyword_begin}, EXPR_BEG
-break, {keyword_break, keyword_break}, EXPR_MID
-case, {keyword_case, keyword_case}, EXPR_VALUE
-class, {keyword_class, keyword_class}, EXPR_CLASS
-def, {keyword_def, keyword_def}, EXPR_FNAME
-defined?, {keyword_defined, keyword_defined}, EXPR_ARG
-do, {keyword_do, keyword_do}, EXPR_BEG
-else, {keyword_else, keyword_else}, EXPR_BEG
-elsif, {keyword_elsif, keyword_elsif}, EXPR_VALUE
-end, {keyword_end, keyword_end}, EXPR_END
-ensure, {keyword_ensure, keyword_ensure}, EXPR_BEG
-false, {keyword_false, keyword_false}, EXPR_END
-for, {keyword_for, keyword_for}, EXPR_VALUE
-if, {keyword_if, modifier_if}, EXPR_VALUE
-in, {keyword_in, keyword_in}, EXPR_VALUE
-module, {keyword_module, keyword_module}, EXPR_VALUE
-next, {keyword_next, keyword_next}, EXPR_MID
-nil, {keyword_nil, keyword_nil}, EXPR_END
-not, {keyword_not, keyword_not}, EXPR_ARG
-or, {keyword_or, keyword_or}, EXPR_VALUE
-redo, {keyword_redo, keyword_redo}, EXPR_END
-rescue, {keyword_rescue, modifier_rescue}, EXPR_MID
-retry, {keyword_retry, keyword_retry}, EXPR_END
-return, {keyword_return, keyword_return}, EXPR_MID
-self, {keyword_self, keyword_self}, EXPR_END
-super, {keyword_super, keyword_super}, EXPR_ARG
-then, {keyword_then, keyword_then}, EXPR_BEG
-true, {keyword_true, keyword_true}, EXPR_END
-undef, {keyword_undef, keyword_undef}, EXPR_FNAME
-unless, {keyword_unless, modifier_unless}, EXPR_VALUE
-until, {keyword_until, modifier_until}, EXPR_VALUE
-when, {keyword_when, keyword_when}, EXPR_VALUE
-while, {keyword_while, modifier_while}, EXPR_VALUE
-yield, {keyword_yield, keyword_yield}, EXPR_ARG
-%%
-#endif
diff --git a/defs/opt_insn_unif.def b/defs/opt_insn_unif.def
deleted file mode 100644
index 1ac613dbea..0000000000
--- a/defs/opt_insn_unif.def
+++ /dev/null
@@ -1,29 +0,0 @@
-#
-# a definition of instruction unification
-#
-#
-
-__END__
-
-putobject putobject
-putobject putstring
-putobject setlocal
-putobject setdynamic
-
-putstring putstring
-putstring putobject
-putstring setlocal
-putstring setdynamic
-
-# putnil end
-
-dup setlocal
-
-# from tarai
-getlocal getlocal
-# getlocal send
-
-# from tak, ackermann
-getlocal putobject
-
-
diff --git a/defs/opt_operand.def b/defs/opt_operand.def
deleted file mode 100644
index 5ca1d74028..0000000000
--- a/defs/opt_operand.def
+++ /dev/null
@@ -1,59 +0,0 @@
-#
-# configration file for operand union optimization
-#
-# format:
-# [insn name] op1, op2 ...
-#
-# wildcard: *
-#
-
-__END__
-
-getlocal 2
-getlocal 3
-getlocal 4
-
-setlocal 2
-setlocal 3
-setlocal 4
-
-getdynamic *, 0
-getdynamic 1, 0
-getdynamic 2, 0
-getdynamic 3, 0
-getdynamic 4, 0
-
-setdynamic *, 0
-setdynamic 1, 0
-setdynamic 2, 0
-setdynamic 3, 0
-setdynamic 4, 0
-
-putobject INT2FIX(0)
-putobject INT2FIX(1)
-putobject Qtrue
-putobject Qfalse
-
-# CALL
-send *, *, Qfalse, 0, *
-send *, 0, Qfalse, 0, *
-send *, 1, Qfalse, 0, *
-send *, 2, Qfalse, 0, *
-send *, 3, Qfalse, 0, *
-
-# FCALL
-send *, *, Qfalse, 0x04, *
-send *, 0, Qfalse, 0x04, *
-send *, 1, Qfalse, 0x04, *
-send *, 2, Qfalse, 0x04, *
-send *, 3, Qfalse, 0x04, *
-
-# VCALL
-send *, 0, Qfalse, 0x0c, *
-
-
-__END__
-
-
-
-
diff --git a/dir.c b/dir.c
index f3ffc45f4f..710299e7b6 100644
--- a/dir.c
+++ b/dir.c
@@ -3,16 +3,16 @@
dir.c -
$Author$
+ $Date$
created at: Wed Jan 5 09:51:01 JST 1994
- Copyright (C) 1993-2007 Yukihiro Matsumoto
+ Copyright (C) 1993-2003 Yukihiro Matsumoto
Copyright (C) 2000 Network Applied Communication Laboratory, Inc.
Copyright (C) 2000 Information-technology Promotion Agency, Japan
**********************************************************************/
-#include "ruby/ruby.h"
-#include "ruby/encoding.h"
+#include "ruby.h"
#include <sys/types.h>
#include <sys/stat.h>
@@ -56,17 +56,25 @@ char *getenv();
#endif
#ifndef HAVE_STRING_H
-char *strchr(char*,char);
+char *strchr _((char*,char));
#endif
#include <ctype.h>
-#include "ruby/util.h"
+#include "util.h"
#if !defined HAVE_LSTAT && !defined lstat
#define lstat stat
#endif
+#ifndef CASEFOLD_FILESYSTEM
+# if defined DOSISH || defined __VMS
+# define CASEFOLD_FILESYSTEM 1
+# else
+# define CASEFOLD_FILESYSTEM 0
+# endif
+#endif
+
#define FNM_NOESCAPE 0x01
#define FNM_PATHNAME 0x02
#define FNM_DOTMATCH 0x04
@@ -80,22 +88,100 @@ char *strchr(char*,char);
#define FNM_NOMATCH 1
#define FNM_ERROR 2
-# define Next(p, e, enc) (p + rb_enc_mbclen(p, e, enc))
-# define Inc(p, e, enc) ((p) = Next(p, e, enc))
+#define downcase(c) (nocase && ISUPPER(c) ? tolower(c) : (c))
+#define compare(c1, c2) (((unsigned char)(c1)) - ((unsigned char)(c2)))
+
+/* caution: in case *p == '\0'
+ Next(p) == p + 1 in single byte environment
+ Next(p) == p in multi byte environment
+*/
+#if defined(CharNext)
+# define Next(p) CharNext(p)
+#elif defined(DJGPP)
+# define Next(p) ((p) + mblen(p, RUBY_MBCHAR_MAXSIZE))
+#elif defined(__EMX__)
+# define Next(p) ((p) + emx_mblen(p))
+static inline int
+emx_mblen(const char *p)
+{
+ int n = mblen(p, RUBY_MBCHAR_MAXSIZE);
+ return (n < 0) ? 1 : n;
+}
+#endif
+
+#ifndef Next /* single byte environment */
+# define Next(p) ((p) + 1)
+# define Inc(p) (++(p))
+# define Compare(p1, p2) (compare(downcase(*(p1)), downcase(*(p2))))
+#else /* multi byte environment */
+# define Inc(p) ((p) = Next(p))
+# define Compare(p1, p2) (CompareImpl(p1, p2, nocase))
+static int
+CompareImpl(const char *p1, const char *p2, int nocase)
+{
+ const int len1 = Next(p1) - p1;
+ const int len2 = Next(p2) - p2;
+#ifdef _WIN32
+ char buf1[10], buf2[10]; /* large enough? */
+#endif
+
+ if (len1 < 0 || len2 < 0) {
+ rb_fatal("CompareImpl: negative len");
+ }
+
+ if (len1 == 0) return len2;
+ if (len2 == 0) return -len1;
+
+#ifdef _WIN32
+ if (nocase && rb_w32_iswinnt()) {
+ if (len1 > 1) {
+ if (len1 >= sizeof(buf1)) {
+ rb_fatal("CompareImpl: too large len");
+ }
+ memcpy(buf1, p1, len1);
+ buf1[len1] = '\0';
+ CharLower(buf1);
+ p1 = buf1; /* trick */
+ }
+ if (len2 > 1) {
+ if (len2 >= sizeof(buf2)) {
+ rb_fatal("CompareImpl: too large len");
+ }
+ memcpy(buf2, p2, len2);
+ buf2[len2] = '\0';
+ CharLower(buf2);
+ p2 = buf2; /* trick */
+ }
+ }
+#endif
+ if (len1 == 1)
+ if (len2 == 1)
+ return compare(downcase(*p1), downcase(*p2));
+ else {
+ const int ret = compare(downcase(*p1), *p2);
+ return ret ? ret : -1;
+ }
+ else
+ if (len2 == 1) {
+ const int ret = compare(*p1, downcase(*p2));
+ return ret ? ret : 1;
+ }
+ else {
+ const int ret = memcmp(p1, p2, len1 < len2 ? len1 : len2);
+ return ret ? ret : len1 - len2;
+ }
+}
+#endif /* environment */
static char *
-bracket(
- const char *p, /* pattern (next to '[') */
- const char *pend,
- const char *s, /* string */
- const char *send,
- int flags,
- rb_encoding *enc)
+bracket(p, s, flags)
+ const char *p; /* pattern (next to '[') */
+ const char *s; /* string */
+ int flags;
{
const int nocase = flags & FNM_CASEFOLD;
const int escape = !(flags & FNM_NOESCAPE);
- unsigned int c1, c2;
- int r;
+
int ok = 0, not = 0;
if (*p == '!' || *p == '^') {
@@ -109,42 +195,20 @@ bracket(
t1++;
if (!*t1)
return NULL;
- p = t1 + (r = rb_enc_mbclen(t1, pend, enc));
+ p = Next(t1);
if (p[0] == '-' && p[1] != ']') {
const char *t2 = p + 1;
- int r2;
if (escape && *t2 == '\\')
t2++;
if (!*t2)
return NULL;
- p = t2 + (r2 = rb_enc_mbclen(t2, pend, enc));
- if (ok) continue;
- if ((r <= (send-s) && memcmp(t1, s, r) == 0) ||
- (r2 <= (send-s) && memcmp(t2, s, r) == 0)) {
+ p = Next(t2);
+ if (!ok && Compare(t1, s) <= 0 && Compare(s, t2) <= 0)
ok = 1;
- continue;
- }
- c1 = rb_enc_codepoint(s, send, enc);
- if (nocase) c1 = rb_enc_toupper(c1, enc);
- c2 = rb_enc_codepoint(t1, pend, enc);
- if (nocase) c2 = rb_enc_toupper(c2, enc);
- if (c1 < c2) continue;
- c2 = rb_enc_codepoint(t2, pend, enc);
- if (nocase) c2 = rb_enc_toupper(c2, enc);
- if (c1 > c2) continue;
}
- else {
- if (ok) continue;
- if (r <= (send-s) && memcmp(t1, s, r) == 0) {
+ else
+ if (!ok && Compare(t1, s) == 0)
ok = 1;
- continue;
- }
- if (!nocase) continue;
- c1 = rb_enc_toupper(rb_enc_codepoint(s, send, enc), enc);
- c2 = rb_enc_toupper(rb_enc_codepoint(p, pend, enc), enc);
- if (c1 != c2) continue;
- }
- ok = 1;
}
return ok == not ? NULL : (char *)p + 1;
@@ -160,11 +224,10 @@ bracket(
#define RETURN(val) return *pcur = p, *scur = s, (val);
static int
-fnmatch_helper(
- const char **pcur, /* pattern */
- const char **scur, /* string */
- int flags,
- rb_encoding *enc)
+fnmatch_helper(pcur, scur, flags)
+ const char **pcur; /* pattern */
+ const char **scur; /* string */
+ int flags;
{
const int period = !(flags & FNM_DOTMATCH);
const int pathname = flags & FNM_PATHNAME;
@@ -175,11 +238,7 @@ fnmatch_helper(
const char *stmp = 0;
const char *p = *pcur;
- const char *pend = p + strlen(p);
const char *s = *scur;
- const char *send = s + strlen(s);
-
- int r;
if (period && *s == '.' && *UNESCAPE(p) != '.') /* leading period */
RETURN(FNM_NOMATCH);
@@ -202,16 +261,16 @@ fnmatch_helper(
if (ISEND(s))
RETURN(FNM_NOMATCH);
p++;
- Inc(s, send, enc);
+ Inc(s);
continue;
case '[': {
const char *t;
if (ISEND(s))
RETURN(FNM_NOMATCH);
- if ((t = bracket(p + 1, pend, s, send, flags, enc)) != 0) {
+ if ((t = bracket(p + 1, s, flags)) != 0) {
p = t;
- Inc(s, send, enc);
+ Inc(s);
continue;
}
goto failed;
@@ -224,26 +283,16 @@ fnmatch_helper(
RETURN(ISEND(p) ? 0 : FNM_NOMATCH);
if (ISEND(p))
goto failed;
- r = rb_enc_precise_mbclen(p, pend, enc);
- if (!MBCLEN_CHARFOUND_P(r))
- goto failed;
- if (r <= (send-s) && memcmp(p, s, r) == 0) {
- p += r;
- s += r;
- continue;
- }
- if (!nocase) goto failed;
- if (rb_enc_toupper(rb_enc_codepoint(p, pend, enc), enc) !=
- rb_enc_toupper(rb_enc_codepoint(s, send, enc), enc))
+ if (Compare(p, s) != 0)
goto failed;
- p += r;
- Inc(s, send, enc);
+ Inc(p);
+ Inc(s);
continue;
failed: /* try next '*' position */
if (ptmp && stmp) {
p = ptmp;
- Inc(stmp, send, enc); /* !ISEND(*stmp) */
+ Inc(stmp); /* !ISEND(*stmp) */
s = stmp;
continue;
}
@@ -252,15 +301,11 @@ fnmatch_helper(
}
static int
-fnmatch(
- const char *pattern,
- rb_encoding *enc,
- const char *string,
- int flags)
+fnmatch(p, s, flags)
+ const char *p; /* pattern */
+ const char *s; /* string */
+ int flags;
{
- const char *p = pattern;
- const char *s = string;
- const char *send = s + strlen(string);
const int period = !(flags & FNM_DOTMATCH);
const int pathname = flags & FNM_PATHNAME;
@@ -274,8 +319,8 @@ fnmatch(
ptmp = p;
stmp = s;
}
- if (fnmatch_helper(&p, &s, flags, enc) == 0) {
- while (*s && *s != '/') Inc(s, send, enc);
+ if (fnmatch_helper(&p, &s, flags) == 0) {
+ while (*s && *s != '/') Inc(s);
if (*p && *s) {
p++;
s++;
@@ -286,7 +331,7 @@ fnmatch(
}
/* failed : try next recursion */
if (ptmp && stmp && !(period && *stmp == '.')) {
- while (*stmp && *stmp != '/') Inc(stmp, send, enc);
+ while (*stmp && *stmp != '/') Inc(stmp);
if (*stmp) {
p = ptmp;
stmp++;
@@ -298,43 +343,39 @@ fnmatch(
}
}
else
- return fnmatch_helper(&p, &s, flags, enc);
+ return fnmatch_helper(&p, &s, flags);
}
VALUE rb_cDir;
struct dir_data {
DIR *dir;
- VALUE path;
- rb_encoding *enc;
+ char *path;
};
static void
-mark_dir(struct dir_data *dir)
-{
- rb_gc_mark(dir->path);
-}
-
-static void
-free_dir(struct dir_data *dir)
+free_dir(dir)
+ struct dir_data *dir;
{
if (dir) {
if (dir->dir) closedir(dir->dir);
+ if (dir->path) free(dir->path);
}
- xfree(dir);
+ free(dir);
}
-static VALUE dir_close(VALUE);
+static VALUE dir_close _((VALUE));
+static VALUE dir_s_alloc _((VALUE));
static VALUE
-dir_s_alloc(VALUE klass)
+dir_s_alloc(klass)
+ VALUE klass;
{
struct dir_data *dirp;
- VALUE obj = Data_Make_Struct(klass, struct dir_data, mark_dir, free_dir, dirp);
+ VALUE obj = Data_Make_Struct(klass, struct dir_data, 0, free_dir, dirp);
dirp->dir = NULL;
- dirp->path = Qnil;
- dirp->enc = NULL;
+ dirp->path = NULL;
return obj;
}
@@ -346,50 +387,28 @@ dir_s_alloc(VALUE klass)
* Returns a new directory object for the named directory.
*/
static VALUE
-dir_initialize(int argc, VALUE *argv, VALUE dir)
+dir_initialize(dir, dirname)
+ VALUE dir, dirname;
{
struct dir_data *dp;
- rb_encoding *fsenc;
- VALUE dirname, opt;
- static VALUE sym_enc;
-
- if (!sym_enc) {
- sym_enc = ID2SYM(rb_intern("encoding"));
- }
- fsenc = rb_filesystem_encoding();
-
- rb_scan_args(argc, argv, "11", &dirname, &opt);
-
- if (!NIL_P(opt)) {
- VALUE v, enc=Qnil;
- opt = rb_convert_type(opt, T_HASH, "Hash", "to_hash");
-
- v = rb_hash_aref(opt, sym_enc);
- if (!NIL_P(v)) enc = v;
-
- if (!NIL_P(enc)) {
- fsenc = rb_to_encoding(enc);
- }
- }
-
- FilePathValue(dirname);
+ SafeStringValue(dirname);
Data_Get_Struct(dir, struct dir_data, dp);
if (dp->dir) closedir(dp->dir);
+ if (dp->path) free(dp->path);
dp->dir = NULL;
- dp->path = Qnil;
- dp->enc = fsenc;
- dp->dir = opendir(RSTRING_PTR(dirname));
+ dp->path = NULL;
+ dp->dir = opendir(RSTRING(dirname)->ptr);
if (dp->dir == NULL) {
if (errno == EMFILE || errno == ENFILE) {
rb_gc();
- dp->dir = opendir(RSTRING_PTR(dirname));
+ dp->dir = opendir(RSTRING(dirname)->ptr);
}
if (dp->dir == NULL) {
- rb_sys_fail(RSTRING_PTR(dirname));
+ rb_sys_fail(RSTRING(dirname)->ptr);
}
}
- dp->path = rb_str_dup_frozen(dirname);
+ dp->path = strdup(RSTRING(dirname)->ptr);
return dir;
}
@@ -405,13 +424,15 @@ dir_initialize(int argc, VALUE *argv, VALUE dir)
* the block, and <code>Dir::open</code> returns the value of the
* block.
*/
+
static VALUE
-dir_s_open(int argc, VALUE *argv, VALUE klass)
+dir_s_open(klass, dirname)
+ VALUE klass, dirname;
{
struct dir_data *dp;
- VALUE dir = Data_Make_Struct(klass, struct dir_data, mark_dir, free_dir, dp);
+ VALUE dir = Data_Make_Struct(klass, struct dir_data, 0, free_dir, dp);
- dir_initialize(argc, argv, dir);
+ dir_initialize(dir, dirname);
if (rb_block_given_p()) {
return rb_ensure(rb_yield, dir, dir_close, dir);
}
@@ -420,16 +441,17 @@ dir_s_open(int argc, VALUE *argv, VALUE klass)
}
static void
-dir_closed(void)
+dir_closed()
{
rb_raise(rb_eIOError, "closed directory");
}
static void
-dir_check(VALUE dir)
+dir_check(dir)
+ VALUE dir;
{
- if (!OBJ_UNTRUSTED(dir) && rb_safe_level() >= 4)
- rb_raise(rb_eSecurityError, "Insecure: operation on trusted Dir");
+ if (!OBJ_TAINTED(dir) && rb_safe_level() >= 4)
+ rb_raise(rb_eSecurityError, "Insecure: operation on untainted Dir");
rb_check_frozen(dir);
}
@@ -439,7 +461,6 @@ dir_check(VALUE dir)
if (dirp->dir == NULL) dir_closed();\
} while (0)
-
/*
* call-seq:
* dir.inspect => string
@@ -447,14 +468,18 @@ dir_check(VALUE dir)
* Return a string describing this Dir object.
*/
static VALUE
-dir_inspect(VALUE dir)
+dir_inspect(dir)
+ VALUE dir;
{
struct dir_data *dirp;
Data_Get_Struct(dir, struct dir_data, dirp);
- if (!NIL_P(dirp->path)) {
+ if (dirp->path) {
const char *c = rb_obj_classname(dir);
- return rb_sprintf("#<%s:%s>", c, RSTRING_PTR(dirp->path));
+ int len = strlen(c) + strlen(dirp->path) + 4;
+ VALUE s = rb_str_new(0, len);
+ snprintf(RSTRING_PTR(s), len+1, "#<%s:%s>", c, dirp->path);
+ return s;
}
return rb_funcall(dir, rb_intern("to_s"), 0, 0);
}
@@ -469,28 +494,16 @@ dir_inspect(VALUE dir)
* d.path #=> ".."
*/
static VALUE
-dir_path(VALUE dir)
+dir_path(dir)
+ VALUE dir;
{
struct dir_data *dirp;
Data_Get_Struct(dir, struct dir_data, dirp);
- if (NIL_P(dirp->path)) return Qnil;
- return rb_str_dup(dirp->path);
+ if (!dirp->path) return Qnil;
+ return rb_str_new2(dirp->path);
}
-#if defined HAVE_READDIR_R
-# define READDIR(dir, enc, entry, dp) (readdir_r(dir, entry, &(dp)) == 0 && dp != 0)
-#elif defined _WIN32
-# define READDIR(dir, enc, entry, dp) ((dp = rb_w32_readdir_with_enc(dir, enc)) != 0)
-#else
-# define READDIR(dir, enc, entry, dp) ((dp = readdir(dir)) != 0)
-#endif
-#if defined HAVE_READDIR_R
-# define IF_HAVE_READDIR_R(something) something
-#else
-# define IF_HAVE_READDIR_R(something) /* nothing */
-#endif
-
/*
* call-seq:
* dir.read => string or nil
@@ -504,16 +517,17 @@ dir_path(VALUE dir)
* d.read #=> "config.h"
*/
static VALUE
-dir_read(VALUE dir)
+dir_read(dir)
+ VALUE dir;
{
struct dir_data *dirp;
struct dirent *dp;
- IF_HAVE_READDIR_R(struct dirent entry);
GetDIR(dir, dirp);
errno = 0;
- if (READDIR(dirp->dir, dirp->enc, &entry, dp)) {
- return rb_external_str_new_with_enc(dp->d_name, NAMLEN(dp), dirp->enc);
+ dp = readdir(dirp->dir);
+ if (dp) {
+ return rb_tainted_str_new(dp->d_name, NAMLEN(dp));
}
else if (errno == 0) { /* end of stream */
return Qnil;
@@ -542,23 +556,22 @@ dir_read(VALUE dir)
* Got main.rb
*/
static VALUE
-dir_each(VALUE dir)
+dir_each(dir)
+ VALUE dir;
{
struct dir_data *dirp;
struct dirent *dp;
- IF_HAVE_READDIR_R(struct dirent entry);
RETURN_ENUMERATOR(dir, 0, 0);
GetDIR(dir, dirp);
rewinddir(dirp->dir);
- while (READDIR(dirp->dir, dirp->enc, &entry, dp)) {
- rb_yield(rb_external_str_new_with_enc(dp->d_name, NAMLEN(dp), dirp->enc));
+ for (dp = readdir(dirp->dir); dp != NULL; dp = readdir(dirp->dir)) {
+ rb_yield(rb_tainted_str_new(dp->d_name, NAMLEN(dp)));
if (dirp->dir == NULL) dir_closed();
}
return dir;
}
-#ifdef HAVE_TELLDIR
/*
* call-seq:
* dir.pos => integer
@@ -573,20 +586,21 @@ dir_each(VALUE dir)
* d.tell #=> 12
*/
static VALUE
-dir_tell(VALUE dir)
+dir_tell(dir)
+ VALUE dir;
{
+#ifdef HAVE_TELLDIR
struct dir_data *dirp;
long pos;
GetDIR(dir, dirp);
pos = telldir(dirp->dir);
return rb_int2inum(pos);
-}
#else
-#define dir_tell rb_f_notimplement
+ rb_notimplement();
#endif
+}
-#ifdef HAVE_SEEKDIR
/*
* call-seq:
* dir.seek( integer ) => dir
@@ -602,18 +616,20 @@ dir_tell(VALUE dir)
* d.read #=> ".."
*/
static VALUE
-dir_seek(VALUE dir, VALUE pos)
+dir_seek(dir, pos)
+ VALUE dir, pos;
{
struct dir_data *dirp;
- long p = NUM2LONG(pos);
+ off_t p = NUM2OFFT(pos);
GetDIR(dir, dirp);
+#ifdef HAVE_SEEKDIR
seekdir(dirp->dir, p);
return dir;
-}
#else
-#define dir_seek rb_f_notimplement
+ rb_notimplement();
#endif
+}
/*
* call-seq:
@@ -630,7 +646,8 @@ dir_seek(VALUE dir, VALUE pos)
* d.read #=> ".."
*/
static VALUE
-dir_set_pos(VALUE dir, VALUE pos)
+dir_set_pos(dir, pos)
+ VALUE dir, pos;
{
dir_seek(dir, pos);
return pos;
@@ -648,11 +665,12 @@ dir_set_pos(VALUE dir, VALUE pos)
* d.read #=> "."
*/
static VALUE
-dir_rewind(VALUE dir)
+dir_rewind(dir)
+ VALUE dir;
{
struct dir_data *dirp;
- if (rb_safe_level() >= 4 && !OBJ_UNTRUSTED(dir)) {
+ if (rb_safe_level() >= 4 && !OBJ_TAINTED(dir)) {
rb_raise(rb_eSecurityError, "Insecure: can't close");
}
GetDIR(dir, dirp);
@@ -671,7 +689,8 @@ dir_rewind(VALUE dir)
* d.close #=> nil
*/
static VALUE
-dir_close(VALUE dir)
+dir_close(dir)
+ VALUE dir;
{
struct dir_data *dirp;
@@ -683,10 +702,11 @@ dir_close(VALUE dir)
}
static void
-dir_chdir(VALUE path)
+dir_chdir(path)
+ VALUE path;
{
- if (chdir(RSTRING_PTR(path)) < 0)
- rb_sys_fail(RSTRING_PTR(path));
+ if (chdir(RSTRING(path)->ptr) < 0)
+ rb_sys_fail(RSTRING(path)->ptr);
}
static int chdir_blocking = 0;
@@ -698,7 +718,8 @@ struct chdir_data {
};
static VALUE
-chdir_yield(struct chdir_data *args)
+chdir_yield(args)
+ struct chdir_data *args;
{
dir_chdir(args->new_path);
args->done = Qtrue;
@@ -709,7 +730,8 @@ chdir_yield(struct chdir_data *args)
}
static VALUE
-chdir_restore(struct chdir_data *args)
+chdir_restore(args)
+ struct chdir_data *args;
{
if (args->done) {
chdir_blocking--;
@@ -760,13 +782,16 @@ chdir_restore(struct chdir_data *args)
* /var/spool/mail
*/
static VALUE
-dir_s_chdir(int argc, VALUE *argv, VALUE obj)
+dir_s_chdir(argc, argv, obj)
+ int argc;
+ VALUE *argv;
+ VALUE obj;
{
VALUE path = Qnil;
rb_secure(2);
if (rb_scan_args(argc, argv, "01", &path) == 1) {
- FilePathValue(path);
+ SafeStringValue(path);
}
else {
const char *dist = getenv("HOME");
@@ -786,7 +811,7 @@ dir_s_chdir(int argc, VALUE *argv, VALUE obj)
struct chdir_data args;
char *cwd = my_getcwd();
- args.old_path = rb_tainted_str_new2(cwd); xfree(cwd);
+ args.old_path = rb_tainted_str_new2(cwd); free(cwd);
args.new_path = path;
args.done = Qfalse;
return rb_ensure(chdir_yield, (VALUE)&args, chdir_restore, (VALUE)&args);
@@ -808,7 +833,8 @@ dir_s_chdir(int argc, VALUE *argv, VALUE obj)
* Dir.getwd #=> "/tmp"
*/
static VALUE
-dir_s_getwd(VALUE dir)
+dir_s_getwd(dir)
+ VALUE dir;
{
char *path;
VALUE cwd;
@@ -816,26 +842,26 @@ dir_s_getwd(VALUE dir)
rb_secure(4);
path = my_getcwd();
cwd = rb_tainted_str_new2(path);
- rb_enc_associate(cwd, rb_filesystem_encoding());
- xfree(path);
+ free(path);
return cwd;
}
+static void check_dirname _((volatile VALUE *));
static void
-check_dirname(volatile VALUE *dir)
+check_dirname(dir)
+ volatile VALUE *dir;
{
char *path, *pend;
+ SafeStringValue(*dir);
rb_secure(2);
- FilePathValue(*dir);
- path = RSTRING_PTR(*dir);
+ path = RSTRING(*dir)->ptr;
if (path && *(pend = rb_path_end(rb_path_skip_prefix(path)))) {
*dir = rb_str_new(path, pend - path);
}
}
-#if defined(HAVE_CHROOT)
/*
* call-seq:
* Dir.chroot( string ) => 0
@@ -846,18 +872,21 @@ check_dirname(volatile VALUE *dir)
* information.
*/
static VALUE
-dir_s_chroot(VALUE dir, VALUE path)
+dir_s_chroot(dir, path)
+ VALUE dir, path;
{
+#if defined(HAVE_CHROOT) && !defined(__CHECKER__)
check_dirname(&path);
- if (chroot(RSTRING_PTR(path)) == -1)
- rb_sys_fail(RSTRING_PTR(path));
+ if (chroot(RSTRING(path)->ptr) == -1)
+ rb_sys_fail(RSTRING(path)->ptr);
return INT2FIX(0);
-}
#else
-#define dir_s_chroot rb_f_notimplement
+ rb_notimplement();
+ return Qnil; /* not reached */
#endif
+}
/*
* call-seq:
@@ -873,7 +902,10 @@ dir_s_chroot(VALUE dir, VALUE path)
*
*/
static VALUE
-dir_s_mkdir(int argc, VALUE *argv, VALUE obj)
+dir_s_mkdir(argc, argv, obj)
+ int argc;
+ VALUE *argv;
+ VALUE obj;
{
VALUE path, vmode;
int mode;
@@ -886,8 +918,8 @@ dir_s_mkdir(int argc, VALUE *argv, VALUE obj)
}
check_dirname(&path);
- if (mkdir(RSTRING_PTR(path), mode) == -1)
- rb_sys_fail(RSTRING_PTR(path));
+ if (mkdir(RSTRING(path)->ptr, mode) == -1)
+ rb_sys_fail(RSTRING(path)->ptr);
return INT2FIX(0);
}
@@ -902,29 +934,29 @@ dir_s_mkdir(int argc, VALUE *argv, VALUE obj)
* <code>SystemCallError</code> if the directory isn't empty.
*/
static VALUE
-dir_s_rmdir(VALUE obj, VALUE dir)
+dir_s_rmdir(obj, dir)
+ VALUE obj, dir;
{
check_dirname(&dir);
- if (rmdir(RSTRING_PTR(dir)) < 0)
- rb_sys_fail(RSTRING_PTR(dir));
+ if (rmdir(RSTRING(dir)->ptr) < 0)
+ rb_sys_fail(RSTRING(dir)->ptr);
return INT2FIX(0);
}
-static VALUE
-sys_warning_1(VALUE mesg)
+static void
+sys_warning_1(mesg)
+ const char* mesg;
{
- rb_sys_warning("%s", (const char *)mesg);
- return Qnil;
+ rb_sys_warning("%s", mesg);
}
-#define GLOB_VERBOSE (1U << (sizeof(int) * CHAR_BIT - 1))
+#define GLOB_VERBOSE (1UL << (sizeof(int) * CHAR_BIT - 1))
#define sys_warning(val) \
- (void)((flags & GLOB_VERBOSE) && rb_protect(sys_warning_1, (VALUE)(val), 0))
+ (void)((flags & GLOB_VERBOSE) && rb_protect((VALUE (*)_((VALUE)))sys_warning_1, (VALUE)(val), 0))
#define GLOB_ALLOC(type) (type *)malloc(sizeof(type))
#define GLOB_ALLOC_N(type, n) (type *)malloc(sizeof(type) * (n))
-#define GLOB_FREE(ptr) free(ptr)
#define GLOB_JUMP_TAG(status) ((status == -1) ? rb_memerror() : rb_jump_tag(status))
/*
@@ -967,13 +999,14 @@ do_opendir(const char *path, int flags)
/* Return nonzero if S has any special globbing chars in it. */
static int
-has_magic(const char *s, int flags, rb_encoding *enc)
+has_magic(s, flags)
+ const char *s;
+ int flags;
{
const int escape = !(flags & FNM_NOESCAPE);
const int nocase = flags & FNM_CASEFOLD;
register const char *p = s;
- register const char *pend = p + strlen(p);
register char c;
while ((c = *p++) != 0) {
@@ -993,7 +1026,7 @@ has_magic(const char *s, int flags, rb_encoding *enc)
return 1;
}
- p = Next(p-1, pend, enc);
+ p = Next(p-1);
}
return 0;
@@ -1001,12 +1034,11 @@ has_magic(const char *s, int flags, rb_encoding *enc)
/* Find separator in globbing pattern. */
static char *
-find_dirsep(const char *s, int flags, rb_encoding *enc)
+find_dirsep(const char *s, int flags)
{
const int escape = !(flags & FNM_NOESCAPE);
register const char *p = s;
- register const char *pend = p + strlen(p);
register char c;
int open = 0;
@@ -1030,7 +1062,7 @@ find_dirsep(const char *s, int flags, rb_encoding *enc)
continue;
}
- p = Next(p-1, pend, enc);
+ p = Next(p-1);
}
return (char *)p-1;
@@ -1038,9 +1070,9 @@ find_dirsep(const char *s, int flags, rb_encoding *enc)
/* Remove escaping backslashes */
static void
-remove_backslashes(char *p, rb_encoding *enc)
+remove_backslashes(p)
+ char *p;
{
- register const char *pend = p + strlen(p);
char *t = p;
char *s = p;
@@ -1052,7 +1084,7 @@ remove_backslashes(char *p, rb_encoding *enc)
s = ++p;
if (!*p) break;
}
- Inc(p, pend, enc);
+ Inc(p);
}
while (*p++);
@@ -1073,7 +1105,7 @@ struct glob_pattern {
static void glob_free_pattern(struct glob_pattern *list);
static struct glob_pattern *
-glob_make_pattern(const char *p, int flags, rb_encoding *enc)
+glob_make_pattern(const char *p, int flags)
{
struct glob_pattern *list, *tmp, **tail = &list;
int dirsep = 0; /* pattern is terminated with '/' */
@@ -1089,15 +1121,15 @@ glob_make_pattern(const char *p, int flags, rb_encoding *enc)
dirsep = 1;
}
else {
- const char *m = find_dirsep(p, flags, enc);
+ const char *m = find_dirsep(p, flags);
char *buf = GLOB_ALLOC_N(char, m-p+1);
if (!buf) {
- GLOB_FREE(tmp);
+ free(tmp);
goto error;
}
memcpy(buf, p, m-p);
buf[m-p] = '\0';
- tmp->type = has_magic(buf, flags, enc) ? MAGICAL : PLAIN;
+ tmp->type = has_magic(buf, flags) ? MAGICAL : PLAIN;
tmp->str = buf;
if (*m) {
dirsep = 1;
@@ -1134,8 +1166,8 @@ glob_free_pattern(struct glob_pattern *list)
struct glob_pattern *tmp = list;
list = list->next;
if (tmp->str)
- GLOB_FREE(tmp->str);
- GLOB_FREE(tmp);
+ free(tmp->str);
+ free(tmp);
}
}
@@ -1143,25 +1175,20 @@ static char *
join_path(const char *path, int dirsep, const char *name)
{
long len = strlen(path);
- long len2 = strlen(name)+(dirsep?1:0)+1;
- char *buf = GLOB_ALLOC_N(char, len+len2);
+ char *buf = GLOB_ALLOC_N(char, len+strlen(name)+(dirsep?1:0)+1);
if (!buf) return 0;
memcpy(buf, path, len);
if (dirsep) {
- buf[len++] = '/';
+ strcpy(buf+len, "/");
+ len++;
}
- buf[len] = '\0';
- strlcat(buf+len, name, len2);
+ strcpy(buf+len, name);
return buf;
}
enum answer { YES, NO, UNKNOWN };
-#ifndef S_ISDIR
-# define S_ISDIR(m) ((m & S_IFMT) == S_IFDIR)
-#endif
-
#ifndef S_ISLNK
# ifndef S_IFLNK
# define S_ISLNK(m) (0)
@@ -1170,36 +1197,43 @@ enum answer { YES, NO, UNKNOWN };
# endif
#endif
+#ifndef S_ISDIR
+# define S_ISDIR(m) ((m & S_IFMT) == S_IFDIR)
+#endif
+
struct glob_args {
- void (*func)(const char *, VALUE, void *);
- const char *path;
- VALUE value;
- rb_encoding *enc;
+ void (*func) _((const char*, VALUE));
+ const char *c;
+ VALUE v;
};
+static VALUE glob_func_caller _((VALUE));
+
static VALUE
-glob_func_caller(VALUE val)
+glob_func_caller(val)
+ VALUE val;
{
struct glob_args *args = (struct glob_args *)val;
- (*args->func)(args->path, args->value, args->enc);
+ (*args->func)(args->c, args->v);
return Qnil;
}
-#define glob_call_func(func, path, arg, enc) (*func)(path, arg, enc)
+#define glob_call_func(func, path, arg) (*func)(path, arg)
+
+static int glob_helper _((const char *, int, enum answer, enum answer, struct glob_pattern **, struct glob_pattern **, int, ruby_glob_func *, VALUE));
static int
-glob_helper(
- const char *path,
- int dirsep, /* '/' should be placed before appending child entry's name to 'path'. */
- enum answer exist, /* Does 'path' indicate an existing entry? */
- enum answer isdir, /* Does 'path' indicate a directory or a symlink to a directory? */
- struct glob_pattern **beg,
- struct glob_pattern **end,
- int flags,
- ruby_glob_func *func,
- VALUE arg,
- rb_encoding *enc)
+glob_helper(path, dirsep, exist, isdir, beg, end, flags, func, arg)
+ const char *path;
+ int dirsep; /* '/' should be placed before appending child entry's name to 'path'. */
+ enum answer exist; /* Does 'path' indicate an existing entry? */
+ enum answer isdir; /* Does 'path' indicate a directory or a symlink to a directory? */
+ struct glob_pattern **beg;
+ struct glob_pattern **end;
+ int flags;
+ ruby_glob_func *func;
+ VALUE arg;
{
struct stat st;
int status = 0;
@@ -1214,19 +1248,19 @@ glob_helper(
p = p->next;
}
switch (p->type) {
- case PLAIN:
+ case PLAIN:
plain = 1;
break;
- case MAGICAL:
+ case MAGICAL:
magical = 1;
break;
- case MATCH_ALL:
+ case MATCH_ALL:
match_all = 1;
break;
- case MATCH_DIR:
+ case MATCH_DIR:
match_dir = 1;
break;
- case RECURSIVE:
+ case RECURSIVE:
rb_bug("continuous RECURSIVEs");
}
}
@@ -1253,14 +1287,14 @@ glob_helper(
}
}
if (match_all && exist == YES) {
- status = glob_call_func(func, path, arg, enc);
+ status = glob_call_func(func, path, arg);
if (status) return status;
}
if (match_dir && isdir == YES) {
char *tmp = join_path(path, dirsep, "");
if (!tmp) return -1;
- status = glob_call_func(func, tmp, arg, enc);
- GLOB_FREE(tmp);
+ status = glob_call_func(func, tmp, arg);
+ free(tmp);
if (status) return status;
}
}
@@ -1269,12 +1303,10 @@ glob_helper(
if (magical || recursive) {
struct dirent *dp;
- DIR *dirp;
- IF_HAVE_READDIR_R(struct dirent entry);
- dirp = do_opendir(*path ? path : ".", flags);
+ DIR *dirp = do_opendir(*path ? path : ".", flags);
if (dirp == NULL) return 0;
- while (READDIR(dirp, enc, &entry, dp)) {
+ for (dp = readdir(dirp); dp != NULL; dp = readdir(dirp)) {
char *buf = join_path(path, dirsep, dp->d_name);
enum answer new_isdir = UNKNOWN;
@@ -1283,7 +1315,7 @@ glob_helper(
break;
}
if (recursive && strcmp(dp->d_name, ".") != 0 && strcmp(dp->d_name, "..") != 0
- && fnmatch("*", rb_usascii_encoding(), dp->d_name, flags) == 0) {
+ && fnmatch("*", dp->d_name, flags) == 0) {
#ifndef _WIN32
if (do_lstat(buf, &st, flags) == 0)
new_isdir = S_ISDIR(st.st_mode) ? YES : S_ISLNK(st.st_mode) ? UNKNOWN : NO;
@@ -1296,7 +1328,6 @@ glob_helper(
new_beg = new_end = GLOB_ALLOC_N(struct glob_pattern *, (end - beg) * 2);
if (!new_beg) {
- GLOB_FREE(buf);
status = -1;
break;
}
@@ -1309,15 +1340,14 @@ glob_helper(
p = p->next; /* 0 times recursion */
}
if (p->type == PLAIN || p->type == MAGICAL) {
- if (fnmatch(p->str, enc, dp->d_name, flags) == 0)
+ if (fnmatch(p->str, dp->d_name, flags) == 0)
*new_end++ = p->next;
}
}
- status = glob_helper(buf, 1, YES, new_isdir, new_beg, new_end,
- flags, func, arg, enc);
- GLOB_FREE(buf);
- GLOB_FREE(new_beg);
+ status = glob_helper(buf, 1, YES, new_isdir, new_beg, new_end, flags, func, arg);
+ free(buf);
+ free(new_beg);
if (status) break;
}
@@ -1335,57 +1365,59 @@ glob_helper(
if (*cur) {
char *buf;
char *name;
- size_t len = strlen((*cur)->str) + 1;
- name = GLOB_ALLOC_N(char, len);
+ name = GLOB_ALLOC_N(char, strlen((*cur)->str) + 1);
if (!name) {
status = -1;
break;
}
- memcpy(name, (*cur)->str, len);
- if (escape) remove_backslashes(name, enc);
+ strcpy(name, (*cur)->str);
+ if (escape) remove_backslashes(name);
new_beg = new_end = GLOB_ALLOC_N(struct glob_pattern *, end - beg);
if (!new_beg) {
- GLOB_FREE(name);
+ free(name);
status = -1;
break;
}
*new_end++ = (*cur)->next;
for (cur2 = cur + 1; cur2 < copy_end; ++cur2) {
- if (*cur2 && fnmatch((*cur2)->str, enc, name, flags) == 0) {
+ if (*cur2 && fnmatch((*cur2)->str, name, flags) == 0) {
*new_end++ = (*cur2)->next;
*cur2 = 0;
}
}
buf = join_path(path, dirsep, name);
- GLOB_FREE(name);
+ free(name);
if (!buf) {
- GLOB_FREE(new_beg);
+ free(new_beg);
status = -1;
break;
}
- status = glob_helper(buf, 1, UNKNOWN, UNKNOWN, new_beg,
- new_end, flags, func, arg, enc);
- GLOB_FREE(buf);
- GLOB_FREE(new_beg);
+ status = glob_helper(buf, 1, UNKNOWN, UNKNOWN, new_beg, new_end, flags, func, arg);
+ free(buf);
+ free(new_beg);
if (status) break;
}
}
- GLOB_FREE(copy_beg);
+ free(copy_beg);
}
return status;
}
static int
-ruby_glob0(const char *path, int flags, ruby_glob_func *func, VALUE arg, rb_encoding *enc)
+ruby_glob0(path, flags, func, arg)
+ const char *path;
+ int flags;
+ ruby_glob_func *func;
+ VALUE arg;
{
struct glob_pattern *list;
const char *root, *start;
char *buf;
- size_t n;
+ int n;
int status;
start = root = path;
@@ -1402,75 +1434,90 @@ ruby_glob0(const char *path, int flags, ruby_glob_func *func, VALUE arg, rb_enco
MEMCPY(buf, start, char, n);
buf[n] = '\0';
- list = glob_make_pattern(root, flags, enc);
+ list = glob_make_pattern(root, flags);
if (!list) {
- GLOB_FREE(buf);
+ free(buf);
return -1;
}
- status = glob_helper(buf, 0, UNKNOWN, UNKNOWN, &list, &list + 1, flags, func, arg, enc);
+ status = glob_helper(buf, 0, UNKNOWN, UNKNOWN, &list, &list + 1, flags, func, arg);
glob_free_pattern(list);
- GLOB_FREE(buf);
+ free(buf);
return status;
}
int
-ruby_glob(const char *path, int flags, ruby_glob_func *func, VALUE arg)
+ruby_glob(path, flags, func, arg)
+ const char *path;
+ int flags;
+ ruby_glob_func *func;
+ VALUE arg;
{
- return ruby_glob0(path, flags & ~GLOB_VERBOSE, func, arg,
- rb_ascii8bit_encoding());
+ return ruby_glob0(path, flags & ~GLOB_VERBOSE, func, arg);
}
+static int rb_glob_caller _((const char *, VALUE));
+
static int
-rb_glob_caller(const char *path, VALUE a, void *enc)
+rb_glob_caller(path, a)
+ const char *path;
+ VALUE a;
{
int status;
struct glob_args *args = (struct glob_args *)a;
- args->path = path;
+ args->c = path;
rb_protect(glob_func_caller, a, &status);
return status;
}
static int
-rb_glob2(const char *path, int flags,
- void (*func)(const char *, VALUE, void *), VALUE arg,
- rb_encoding* enc)
+rb_glob2(path, flags, func, arg)
+ const char *path;
+ int flags;
+ void (*func) _((const char *, VALUE));
+ VALUE arg;
{
struct glob_args args;
args.func = func;
- args.value = arg;
- args.enc = enc;
+ args.v = arg;
if (flags & FNM_SYSCASE) {
rb_warning("Dir.glob() ignores File::FNM_CASEFOLD");
}
- return ruby_glob0(path, flags | GLOB_VERBOSE, rb_glob_caller, (VALUE)&args,
- enc);
+ return ruby_glob0(path, flags | GLOB_VERBOSE, rb_glob_caller, (VALUE)&args);
}
void
-rb_glob(const char *path, void (*func)(const char *, VALUE, void *), VALUE arg)
+rb_glob(path, func, arg)
+ const char *path;
+ void (*func) _((const char*, VALUE));
+ VALUE arg;
{
- int status = rb_glob2(path, 0, func, arg, rb_ascii8bit_encoding());
+ int status = rb_glob2(path, 0, func, arg);
if (status) GLOB_JUMP_TAG(status);
}
+static void push_pattern _((const char* path, VALUE ary));
static void
-push_pattern(const char *path, VALUE ary, void *enc)
+push_pattern(path, ary)
+ const char *path;
+ VALUE ary;
{
- rb_ary_push(ary, rb_external_str_new_with_enc(path, strlen(path), enc));
+ rb_ary_push(ary, rb_tainted_str_new2(path));
}
-static int
-ruby_brace_expand(const char *str, int flags, ruby_glob_func *func, VALUE arg,
- rb_encoding *enc)
+int
+ruby_brace_expand(str, flags, func, arg)
+ const char *str;
+ int flags;
+ ruby_glob_func *func;
+ VALUE arg;
{
const int escape = !(flags & FNM_NOESCAPE);
const char *p = str;
- const char *pend = p + strlen(p);
const char *s = p;
const char *lbrace = 0, *rbrace = 0;
int nest = 0, status = 0;
@@ -1486,12 +1533,11 @@ ruby_brace_expand(const char *str, int flags, ruby_glob_func *func, VALUE arg,
if (*p == '\\' && escape) {
if (!*++p) break;
}
- Inc(p, pend, enc);
+ Inc(p);
}
if (lbrace && rbrace) {
- size_t len = strlen(s) + 1;
- char *buf = GLOB_ALLOC_N(char, len);
+ char *buf = GLOB_ALLOC_N(char, strlen(s) + 1);
long shift;
if (!buf) return -1;
@@ -1507,17 +1553,17 @@ ruby_brace_expand(const char *str, int flags, ruby_glob_func *func, VALUE arg,
if (*p == '\\' && escape) {
if (++p == rbrace) break;
}
- Inc(p, pend, enc);
+ Inc(p);
}
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);
+ strcpy(buf+shift+(p-t), rbrace+1);
+ status = ruby_brace_expand(buf, flags, func, arg);
if (status) break;
}
- GLOB_FREE(buf);
+ free(buf);
}
else if (!lbrace && !rbrace) {
- status = (*func)(s, arg, enc);
+ status = (*func)(s, arg);
}
return status;
@@ -1529,77 +1575,84 @@ struct brace_args {
int flags;
};
+static int glob_brace _((const char *, VALUE));
static int
-glob_brace(const char *path, VALUE val, void *enc)
+glob_brace(path, val)
+ const char *path;
+ VALUE val;
{
struct brace_args *arg = (struct brace_args *)val;
- return ruby_glob0(path, arg->flags, arg->func, arg->value, enc);
+ return ruby_glob0(path, arg->flags, arg->func, arg->value);
}
static int
-ruby_brace_glob0(const char *str, int flags, ruby_glob_func *func, VALUE arg,
- rb_encoding* enc)
+ruby_brace_glob0(str, flags, func, arg)
+ const char *str;
+ int flags;
+ ruby_glob_func *func;
+ VALUE arg;
{
struct brace_args args;
args.func = func;
args.value = arg;
args.flags = flags;
- return ruby_brace_expand(str, flags, glob_brace, (VALUE)&args, enc);
+ return ruby_brace_expand(str, flags, glob_brace, (VALUE)&args);
}
int
-ruby_brace_glob(const char *str, int flags, ruby_glob_func *func, VALUE arg)
+ruby_brace_glob(str, flags, func, arg)
+ const char *str;
+ int flags;
+ ruby_glob_func *func;
+ VALUE arg;
{
- return ruby_brace_glob0(str, flags & ~GLOB_VERBOSE, func, arg,
- rb_ascii8bit_encoding());
+ return ruby_brace_glob0(str, flags & ~GLOB_VERBOSE, func, arg);
}
static int
-push_glob(VALUE ary, VALUE str, int flags)
+push_glob(VALUE ary, const char *str, int flags)
{
struct glob_args args;
- rb_encoding *enc = rb_enc_get(str);
- if (enc == rb_usascii_encoding()) enc = rb_filesystem_encoding();
args.func = push_pattern;
- args.value = ary;
- args.enc = enc;
-
- return ruby_brace_glob0(StringValuePtr(str), flags | GLOB_VERBOSE,
- rb_glob_caller, (VALUE)&args, enc);
+ args.v = ary;
+ return ruby_brace_glob0(str, flags | GLOB_VERBOSE, rb_glob_caller, (VALUE)&args);
}
static VALUE
-rb_push_glob(VALUE str, int flags) /* '\0' is delimiter */
+rb_push_glob(str, flags) /* '\0' is delimiter */
+ VALUE str;
+ int flags;
{
long offset = 0;
VALUE ary;
- StringValue(str);
ary = rb_ary_new();
+ SafeStringValue(str);
while (offset < RSTRING_LEN(str)) {
+ int status = push_glob(ary, RSTRING(str)->ptr + offset, flags);
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 = RSTRING(str)->ptr + offset;
p += strlen(p) + 1;
- pend = RSTRING_PTR(str) + RSTRING_LEN(str);
+ pend = RSTRING(str)->ptr + RSTRING_LEN(str);
while (p < pend && !*p)
p++;
- offset = p - RSTRING_PTR(str);
+ offset = p - RSTRING(str)->ptr;
}
return ary;
}
static VALUE
-dir_globs(long argc, VALUE *argv, int flags)
+dir_globs(argc, argv, flags)
+ long argc;
+ VALUE *argv;
+ int flags;
{
VALUE ary = rb_ary_new();
long i;
@@ -1608,7 +1661,7 @@ dir_globs(long argc, VALUE *argv, int flags)
int status;
VALUE str = argv[i];
SafeStringValue(str);
- status = push_glob(ary, str, flags);
+ status = push_glob(ary, RSTRING(str)->ptr, flags);
if (status) GLOB_JUMP_TAG(status);
}
@@ -1621,18 +1674,18 @@ dir_globs(long argc, VALUE *argv, int flags)
* Dir[ string [, string ...] ] => array
*
* Equivalent to calling
- * <code>Dir.glob(</code><i>array,</i><code>0)</code> and
+ * <code>Dir.glob(</code><i>array,</i><code>0)</code> and
* <code>Dir.glob([</code><i>string,...</i><code>],0)</code>.
*
*/
static VALUE
dir_s_aref(int argc, VALUE *argv, VALUE obj)
-{
+ {
if (argc == 1) {
return rb_push_glob(argv[0], 0);
}
return dir_globs(argc, argv, 0);
-}
+ }
/*
* call-seq:
@@ -1653,7 +1706,7 @@ dir_s_aref(int argc, VALUE *argv, VALUE obj)
* match all files beginning with
* <code>c</code>; <code>*c</code> will match
* all files ending with <code>c</code>; and
- * <code>\*c\*</code> will match all files that
+ * <code>*c*</code> will match all files that
* have <code>c</code> in them (including at
* the beginning or end). Equivalent to
* <code>/ .* /x</code> in regexp.
@@ -1682,20 +1735,23 @@ dir_s_aref(int argc, VALUE *argv, VALUE obj)
*
* rbfiles = File.join("**", "*.rb")
* Dir.glob(rbfiles) #=> ["main.rb",
- * # "lib/song.rb",
- * # "lib/song/karaoke.rb"]
+ * "lib/song.rb",
+ * "lib/song/karaoke.rb"]
* libdirs = File.join("**", "lib")
* Dir.glob(libdirs) #=> ["lib"]
*
* librbfiles = File.join("**", "lib", "**", "*.rb")
* Dir.glob(librbfiles) #=> ["lib/song.rb",
- * # "lib/song/karaoke.rb"]
+ * "lib/song/karaoke.rb"]
*
* librbfiles = File.join("**", "lib", "*.rb")
* Dir.glob(librbfiles) #=> ["lib/song.rb"]
*/
static VALUE
-dir_s_glob(int argc, VALUE *argv, VALUE obj)
+dir_s_glob(argc, argv, obj)
+ int argc;
+ VALUE *argv;
+ VALUE obj;
{
VALUE str, rflags, ary;
int flags;
@@ -1722,9 +1778,10 @@ dir_s_glob(int argc, VALUE *argv, VALUE obj)
}
static VALUE
-dir_open_dir(int argc, VALUE *argv)
+dir_open_dir(path)
+ VALUE path;
{
- VALUE dir = rb_funcall2(rb_cDir, rb_intern("open"), argc, argv);
+ VALUE dir = rb_funcall(rb_cDir, rb_intern("open"), 1, path);
if (TYPE(dir) != T_DATA ||
RDATA(dir)->dfree != (RUBY_DATA_FUNC)free_dir) {
@@ -1753,12 +1810,13 @@ dir_open_dir(int argc, VALUE *argv)
*
*/
static VALUE
-dir_foreach(int argc, VALUE *argv, VALUE io)
+dir_foreach(io, dirname)
+ VALUE io, dirname;
{
VALUE dir;
- RETURN_ENUMERATOR(io, argc, argv);
- dir = dir_open_dir(argc, argv);
+ RETURN_ENUMERATOR(io, 1, &dirname);
+ dir = dir_open_dir(dirname);
rb_ensure(dir_each, dir, dir_close, dir);
return Qnil;
}
@@ -1775,11 +1833,12 @@ dir_foreach(int argc, VALUE *argv, VALUE io)
*
*/
static VALUE
-dir_entries(int argc, VALUE *argv, VALUE io)
+dir_entries(io, dirname)
+ VALUE io, dirname;
{
VALUE dir;
- dir = dir_open_dir(argc, argv);
+ dir = dir_open_dir(dirname);
return rb_ensure(rb_Array, dir, dir_close, dir);
}
@@ -1817,31 +1876,31 @@ dir_entries(int argc, VALUE *argv, VALUE io)
* parameters. The same glob pattern and flags are used by
* <code>Dir::glob</code>.
*
- * File.fnmatch('cat', 'cat') #=> true # match entire string
- * File.fnmatch('cat', 'category') #=> false # only match partial string
- * File.fnmatch('c{at,ub}s', 'cats') #=> false # { } isn't supported
+ * File.fnmatch('cat', 'cat') #=> true : match entire string
+ * File.fnmatch('cat', 'category') #=> false : only match partial string
+ * File.fnmatch('c{at,ub}s', 'cats') #=> false : { } isn't supported
*
- * File.fnmatch('c?t', 'cat') #=> true # '?' match only 1 character
- * File.fnmatch('c??t', 'cat') #=> false # ditto
- * File.fnmatch('c*', 'cats') #=> true # '*' match 0 or more characters
- * File.fnmatch('c*t', 'c/a/b/t') #=> true # ditto
- * File.fnmatch('ca[a-z]', 'cat') #=> true # inclusive bracket expression
- * File.fnmatch('ca[^t]', 'cat') #=> false # exclusive bracket expression ('^' or '!')
+ * File.fnmatch('c?t', 'cat') #=> true : '?' match only 1 character
+ * File.fnmatch('c??t', 'cat') #=> false : ditto
+ * File.fnmatch('c*', 'cats') #=> true : '*' match 0 or more characters
+ * File.fnmatch('c*t', 'c/a/b/t') #=> true : ditto
+ * File.fnmatch('ca[a-z]', 'cat') #=> true : inclusive bracket expression
+ * File.fnmatch('ca[^t]', 'cat') #=> false : exclusive bracket expression ('^' or '!')
*
- * File.fnmatch('cat', 'CAT') #=> false # case sensitive
- * File.fnmatch('cat', 'CAT', File::FNM_CASEFOLD) #=> true # case insensitive
+ * File.fnmatch('cat', 'CAT') #=> false : case sensitive
+ * File.fnmatch('cat', 'CAT', File::FNM_CASEFOLD) #=> true : case insensitive
*
- * File.fnmatch('?', '/', File::FNM_PATHNAME) #=> false # wildcard doesn't match '/' on FNM_PATHNAME
- * File.fnmatch('*', '/', File::FNM_PATHNAME) #=> false # ditto
- * File.fnmatch('[/]', '/', File::FNM_PATHNAME) #=> false # ditto
+ * File.fnmatch('?', '/', File::FNM_PATHNAME) #=> false : wildcard doesn't match '/' on FNM_PATHNAME
+ * File.fnmatch('*', '/', File::FNM_PATHNAME) #=> false : ditto
+ * File.fnmatch('[/]', '/', File::FNM_PATHNAME) #=> false : ditto
*
- * File.fnmatch('\?', '?') #=> true # escaped wildcard becomes ordinary
- * File.fnmatch('\a', 'a') #=> true # escaped ordinary remains ordinary
- * File.fnmatch('\a', '\a', File::FNM_NOESCAPE) #=> true # FNM_NOESACPE makes '\' ordinary
- * File.fnmatch('[\?]', '?') #=> true # can escape inside bracket expression
+ * File.fnmatch('\?', '?') #=> true : escaped wildcard becomes ordinary
+ * File.fnmatch('\a', 'a') #=> true : escaped ordinary remains ordinary
+ * File.fnmatch('\a', '\a', File::FNM_NOESCAPE) #=> true : FNM_NOESACPE makes '\' ordinary
+ * File.fnmatch('[\?]', '?') #=> true : can escape inside bracket expression
*
- * File.fnmatch('*', '.profile') #=> false # wildcard doesn't match leading
- * File.fnmatch('*', '.profile', File::FNM_DOTMATCH) #=> true # period by default.
+ * File.fnmatch('*', '.profile') #=> false : wildcard doesn't match leading
+ * File.fnmatch('*', '.profile', File::FNM_DOTMATCH) #=> true period by default.
* File.fnmatch('.*', '.profile') #=> true
*
* rbfiles = '**' '/' '*.rb' # you don't have to do like this. just write in single string.
@@ -1865,7 +1924,10 @@ dir_entries(int argc, VALUE *argv, VALUE io)
* File.fnmatch(pattern, 'a/.b/c/foo', File::FNM_PATHNAME | File::FNM_DOTMATCH) #=> true
*/
static VALUE
-file_s_fnmatch(int argc, VALUE *argv, VALUE obj)
+file_s_fnmatch(argc, argv, obj)
+ int argc;
+ VALUE *argv;
+ VALUE obj;
{
VALUE pattern, path;
VALUE rflags;
@@ -1877,39 +1939,14 @@ file_s_fnmatch(int argc, VALUE *argv, VALUE obj)
flags = 0;
StringValue(pattern);
- FilePathStringValue(path);
+ StringValue(path);
- if (fnmatch(RSTRING_PTR(pattern), rb_enc_get(pattern), RSTRING_PTR(path),
- flags) == 0)
+ if (fnmatch(RSTRING(pattern)->ptr, RSTRING(path)->ptr, flags) == 0)
return Qtrue;
return Qfalse;
}
-VALUE rb_home_dir(const char *user, VALUE result);
-
-/*
- * call-seq:
- * Dir.home() => "/home/me"
- * Dir.home("root") => "/root"
- *
- * Returns the home directory of the current user or the named user
- * if given.
- */
-static VALUE
-dir_s_home(int argc, VALUE *argv, VALUE obj)
-{
- VALUE user;
- const char *u = 0;
-
- rb_scan_args(argc, argv, "01", &user);
- if (!NIL_P(user)) {
- SafeStringValue(user);
- u = StringValueCStr(user);
- }
- return rb_home_dir(u, rb_str_new(0, 0));
-}
-
/*
* Objects of class <code>Dir</code> are directory streams representing
* directories in the underlying file system. They provide a variety of
@@ -1922,18 +1959,18 @@ dir_s_home(int argc, VALUE *argv, VALUE obj)
* (<code>.</code>).
*/
void
-Init_Dir(void)
+Init_Dir()
{
rb_cDir = rb_define_class("Dir", rb_cObject);
rb_include_module(rb_cDir, rb_mEnumerable);
rb_define_alloc_func(rb_cDir, dir_s_alloc);
- 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, "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_method(rb_cDir,"initialize", dir_initialize, -1);
+ rb_define_method(rb_cDir,"initialize", dir_initialize, 1);
rb_define_method(rb_cDir,"path", dir_path, 0);
rb_define_method(rb_cDir,"inspect", dir_inspect, 0);
rb_define_method(rb_cDir,"read", dir_read, 0);
@@ -1953,12 +1990,9 @@ Init_Dir(void)
rb_define_singleton_method(rb_cDir,"rmdir", dir_s_rmdir, 1);
rb_define_singleton_method(rb_cDir,"delete", dir_s_rmdir, 1);
rb_define_singleton_method(rb_cDir,"unlink", dir_s_rmdir, 1);
- rb_define_singleton_method(rb_cDir,"home", dir_s_home, -1);
rb_define_singleton_method(rb_cDir,"glob", dir_s_glob, -1);
rb_define_singleton_method(rb_cDir,"[]", dir_s_aref, -1);
- rb_define_singleton_method(rb_cDir,"exist?", rb_file_directory_p, 1); /* in file.c */
- rb_define_singleton_method(rb_cDir,"exists?", rb_file_directory_p, 1); /* in file.c */
rb_define_singleton_method(rb_cFile,"fnmatch", file_s_fnmatch, -1);
rb_define_singleton_method(rb_cFile,"fnmatch?", file_s_fnmatch, -1);
diff --git a/distruby.rb b/distruby.rb
new file mode 100644
index 0000000000..613da0eb9c
--- /dev/null
+++ b/distruby.rb
@@ -0,0 +1,59 @@
+#!./miniruby
+
+if RUBY_PATCHLEVEL.zero?
+ dirname = sprintf 'ruby-%s', RUBY_VERSION
+ tagname = dirname.gsub /ruby-(\d)\.(\d)\.(\d)/, 'v\1_\2_\3'
+else
+ dirname = sprintf 'ruby-%s-p%u', RUBY_VERSION, RUBY_PATCHLEVEL
+ tagname = dirname.gsub /ruby-(\d)\.(\d)\.(\d)-p/, 'v\1_\2_\3_'
+end
+tgzname = dirname + '.tar.gz'
+tbzname = dirname + '.tar.bz2'
+zipname = dirname + '.zip'
+repos = 'http://svn.ruby-lang.org/repos/ruby/tags/' + tagname
+
+STDERR.puts 'exporting sources...'
+system 'svn', 'export', '-q', repos, dirname
+Dir.chdir dirname do
+ STDERR.puts 'generating configure...'
+ system 'autoconf'
+ system 'rm', '-rf', 'autom4te.cache'
+
+ STDERR.puts 'generating parse.c...'
+ system 'bison', '-y', '-o', 'parse.c', 'parse.y'
+end
+
+STDERR.puts 'generating tarballs...'
+ENV['GZIP'] = '-9'
+system 'tar', 'chofzp', tgzname, dirname
+system 'tar', 'chojfp', tbzname, dirname
+system 'zip', '-q9r', zipname, dirname
+
+require 'digest/md5'
+require 'digest/sha2'
+for name in [tgzname, tbzname, zipname] do
+ open name, 'rb' do |fp|
+ str = fp.read
+ md5 = Digest::MD5.hexdigest str
+ sha = Digest::SHA256.hexdigest str
+ printf "MD5(%s)= %s\nSHA256(%s)= %s\nSIZE(%s)= %s\n\n",
+ name, md5,
+ name, sha,
+ name, str.size
+ end
+end
+
+
+
+#
+# Local Variables:
+# mode: ruby
+# code: utf-8
+# indent-tabs-mode: t
+# tab-width: 3
+# ruby-indent-level: 3
+# fill-column: 79
+# default-justification: full
+# End:
+# vi: ts=3 sw=3
+
diff --git a/djgpp/GNUmakefile.in b/djgpp/GNUmakefile.in
new file mode 100644
index 0000000000..0a7e1fb131
--- /dev/null
+++ b/djgpp/GNUmakefile.in
@@ -0,0 +1,2 @@
+include Makefile
+VPATH = $(srcdir) $(srcdir)/missing
diff --git a/djgpp/README.djgpp b/djgpp/README.djgpp
new file mode 100644
index 0000000000..f1f413a478
--- /dev/null
+++ b/djgpp/README.djgpp
@@ -0,0 +1,21 @@
+* How to compile and install on djgpp
+
+This is what you need to do to compile and install Ruby:
+
+ 1. Run configure.bat, which will generate config.h and Makefile
+ (GNU sed required).
+ Message like this is normal:
+ sed.exe: can't read 123456789: No such file or directory (ENOENT)
+
+ 2. Edit defines.h if you need. Probably this step will not need.
+
+ 3. Remove comment mark(#) before the module names from ext/Setup.dj (or
+ add module names if not present).
+
+ 4. Run make.
+
+ 5. Optionally, run 'make test' to check whether the compiled Ruby
+ interpreter works well. If you see the message "test succeeded",
+ your ruby works as it should (hopefully).
+
+ 6. Run 'make install'
diff --git a/djgpp/config.hin b/djgpp/config.hin
new file mode 100644
index 0000000000..8ee427c92f
--- /dev/null
+++ b/djgpp/config.hin
@@ -0,0 +1,114 @@
+
+#define PACKAGE_NAME ""
+#define PACKAGE_TARNAME ""
+#define PACKAGE_VERSION ""
+#define PACKAGE_STRING ""
+#define PACKAGE_BUGREPORT ""
+#define USE_BUILTIN_FRAME_ADDRESS 1
+#define STDC_HEADERS 1
+#define HAVE_SYS_TYPES_H 1
+#define HAVE_SYS_STAT_H 1
+#define HAVE_STDLIB_H 1
+#define HAVE_STRING_H 1
+#define HAVE_MEMORY_H 1
+#define HAVE_STRINGS_H 1
+#define HAVE_UNISTD_H 1
+#define HAVE_LONG_LONG 1
+#define HAVE_OFF_T 1
+#define SIZEOF_INT 4
+#define SIZEOF_SHORT 2
+#define SIZEOF_LONG 4
+#define SIZEOF_LONG_LONG 8
+#define SIZEOF___INT64 0
+#define SIZEOF_OFF_T 4
+#define SIZEOF_VOIDP 4
+#define SIZEOF_FLOAT 4
+#define SIZEOF_DOUBLE 8
+#define HAVE_PROTOTYPES 1
+#define TOKEN_PASTE(x,y) x##y
+#define HAVE_STDARG_PROTOTYPES 1
+#define NORETURN(x) x __attribute__ ((noreturn))
+#define HAVE_DECL_SYS_NERR 1
+#define HAVE_DIRENT_H 1
+#define STDC_HEADERS 1
+#define HAVE_SYS_WAIT_H 1
+#define HAVE_STDLIB_H 1
+#define HAVE_STRING_H 1
+#define HAVE_UNISTD_H 1
+#define HAVE_LIMITS_H 1
+#define HAVE_SYS_FILE_H 1
+#define HAVE_SYS_IOCTL_H 1
+#define HAVE_FCNTL_H 1
+#define HAVE_SYS_FCNTL_H 1
+#define HAVE_SYS_TIME_H 1
+#define HAVE_SYS_TIMES_H 1
+#define HAVE_SYS_PARAM_H 1
+#define HAVE_PWD_H 1
+#define HAVE_UTIME_H 1
+#define HAVE_MEMORY_H 1
+#define HAVE_DIRECT_H 1
+#define HAVE_SYS_RESOURCE_H 1
+#define HAVE_STRUCT_STAT_ST_BLKSIZE 1
+#define HAVE_ST_BLKSIZE 1
+#define HAVE_STRUCT_STAT_ST_RDEV 1
+#define HAVE_ST_RDEV 1
+#define GETGROUPS_T gid_t
+#define RETSIGTYPE void
+#define HAVE_ALLOCA 1
+#define HAVE_DUP2 1
+#define HAVE_MEMMOVE 1
+#define HAVE_MKDIR 1
+#define HAVE_STRCASECMP 1
+#define HAVE_STRNCASECMP 1
+#define HAVE_STRERROR 1
+#define HAVE_STRFTIME 1
+#define HAVE_STRCHR 1
+#define HAVE_STRSTR 1
+#define HAVE_STRTOUL 1
+#define HAVE_ISINF 1
+#define HAVE_ISNAN 1
+#define HAVE_FINITE 1
+#define HAVE_HYPOT 1
+#define HAVE_ACOSH 1
+#define HAVE_FMOD 1
+#define HAVE_WAITPID 1
+#define HAVE_FSYNC 1
+#define HAVE_TRUNCATE 1
+#define HAVE_CHSIZE 1
+#define HAVE_TIMES 1
+#define HAVE_UTIMES 1
+#define HAVE_FCNTL 1
+#define HAVE_SYMLINK 1
+#define HAVE_SETITIMER 1
+#define HAVE_PAUSE 1
+#define HAVE_GETPGRP 1
+#define HAVE_SETPGID 1
+#define HAVE_GETGROUPS 1
+#define HAVE_GETRLIMIT 1
+#define HAVE_SIGPROCMASK 1
+#define HAVE_SIGACTION 1
+#define HAVE_SETSID 1
+#define HAVE_TELLDIR 1
+#define HAVE_SEEKDIR 1
+#define HAVE_MKTIME 1
+#define HAVE_COSH 1
+#define HAVE_SINH 1
+#define HAVE_TANH 1
+#define HAVE_STRUCT_TM_TM_ZONE 1
+#define HAVE_TM_ZONE 1
+#define HAVE_STRUCT_TM_TM_GMTOFF 1
+#define POSIX_SIGNAL 1
+#define GETPGRP_VOID 1
+#define SETPGRP_VOID 1
+#define RSHIFT(x,y) ((x)>>(int)y)
+#define FILE_COUNT _cnt
+#define FILE_READPTR _ptr
+#define NEED_IO_FLUSH_BETWEEN_RW 1
+#define DEFAULT_KCODE KCODE_NONE
+#define DLEXT ".so"
+#define RUBY_LIB "/lib/ruby/@MAJOR@.@MINOR@"
+#define RUBY_SITE_LIB "/lib/ruby/site_ruby"
+#define RUBY_SITE_LIB2 "/lib/ruby/site_ruby/@MAJOR@.@MINOR@"
+#define RUBY_PLATFORM "i386-msdosdjgpp"
+#define RUBY_ARCHLIB "/lib/ruby/@MAJOR@.@MINOR@/i386-msdosdjgpp"
+#define RUBY_SITE_ARCHLIB "/lib/ruby/site_ruby/@MAJOR@.@MINOR@/i386-msdosdjgpp"
diff --git a/djgpp/config.sed b/djgpp/config.sed
new file mode 100644
index 0000000000..1805789520
--- /dev/null
+++ b/djgpp/config.sed
@@ -0,0 +1,128 @@
+/^SHELL/s,/bin/sh,$(COMSPEC),
+;s%/bin/rm%rm%
+;s%|| true%%
+;/\/dev\/null/ {
+;s,/dev/null 2>&1, nul,
+;s,2> /dev/null,,
+;}
+;/^config.status/ {
+; N;N;N;N;N;d
+;}
+:t
+ /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s,@srcdir@,.,g;t t
+s,@top_srcdir@,..,;t t
+s,@PATH_SEPARATOR@,:,;t t
+s,@PACKAGE_NAME@,,;t t
+s,@PACKAGE_TARNAME@,,;t t
+s,@PACKAGE_VERSION@,,;t t
+s,@PACKAGE_STRING@,,;t t
+s,@PACKAGE_BUGREPORT@,,;t t
+s,@exec_prefix@,${prefix},;t t
+s,@prefix@,/dev/env/DJDIR,;t t
+s%@program_transform_name@%s,^,,%;t t
+s,@bindir@,${exec_prefix}/bin,;t t
+s,@sbindir@,${exec_prefix}/sbin,;t t
+s,@libexecdir@,${exec_prefix}/libexec,;t t
+s,@datadir@,${prefix}/share,;t t
+s,@sysconfdir@,${prefix}/etc,;t t
+s,@sharedstatedir@,${prefix}/com,;t t
+s,@localstatedir@,${prefix}/var,;t t
+s,@libdir@,${exec_prefix}/lib,;t t
+s,@includedir@,${prefix}/include,;t t
+s,@oldincludedir@,/usr/include,;t t
+s,@infodir@,${prefix}/info,;t t
+s,@mandir@,${prefix}/man,;t t
+s,@build_alias@,i586-pc-msdosdjgpp,;t t
+s,@host_alias@,i586-pc-msdosdjgpp,;t t
+s,@target_alias@,i386-msdosdjgpp,;t t
+s,@DEFS@,,;t t
+s,@ECHO_C@,,;t t
+s,@ECHO_N@,-n,;t t
+s,@ECHO_T@,,;t t
+s,@LIBS@,-lm ,;t t
+s,@MAJOR@,1,;t t
+s,@MINOR@,7,;t t
+s,@TEENY@,3,;t t
+s,@build@,i586-pc-msdosdjgpp,;t t
+s,@build_cpu@,i586,;t t
+s,@build_vendor@,pc,;t t
+s,@build_os@,msdosdjgpp,;t t
+s,@host@,i586-pc-msdosdjgpp,;t t
+s,@host_cpu@,i586,;t t
+s,@host_vendor@,pc,;t t
+s,@host_os@,msdosdjgpp,;t t
+s,@target@,i386-pc-msdosdjgpp,;t t
+s,@target_cpu@,i386,;t t
+s,@target_vendor@,pc,;t t
+s,@target_os@,msdosdjgpp,;t t
+s,@CC@,gcc,;t t
+s,@ac_ct_CC@,,;t t
+s,@CFLAGS@,-Os,;t t
+s,@LDFLAGS@,,;t t
+s,@CPPFLAGS@,,;t t
+s,@EXEEXT@,.exe,;t t
+s,@OBJEXT@,o,;t t
+s,@CPP@,gcc -E,;t t
+s,@EGREP@,grep -E,;t t
+s,@GNU_LD@,yes,;t t
+s,@CPPOUTFILE@,-o conftest.i,;t t
+s,@OUTFLAG@,-o ,;t t
+s,@YACC@,bison -y,;t t
+s,@RANLIB@,ranlib,;t t
+s,@ac_ct_RANLIB@,,;t t
+s,@AR@,ar,;t t
+s,@ac_ct_AR@,,;t t
+s,@NM@,,;t t
+s,@ac_ct_NM@,,;t t
+s,@WINDRES@,,;t t
+s,@ac_ct_WINDRES@,,;t t
+s,@DLLWRAP@,,;t t
+s,@ac_ct_DLLWRAP@,,;t t
+s,@LN_S@,ln -s,;t t
+s,@SET_MAKE@,,;t t
+s,@LIBOBJS@,crypt.o flock.o vsnprintf.o,;t t
+s,@ALLOCA@,,;t t
+s,@XCFLAGS@,,;t t
+s,@XLDFLAGS@, -L.,;t t
+s,@DLDFLAGS@,,;t t
+s,@STATIC@,,;t t
+s,@CCDLFLAGS@,,;t t
+s,@LDSHARED@,ld,;t t
+s,@DLEXT@,so,;t t
+s,@DLEXT2@,,;t t
+s,@LIBEXT@,a,;t t
+s,@LINK_SO@,,;t t
+s,@LIBPATHFLAG@, -L%s,;t t
+s,@STRIP@,strip,;t t
+s,@EXTSTATIC@,,;t t
+s,@setup@,Setup.dj,;t t
+s,@MINIRUBY@,./miniruby,;t t
+s,@PREP@,,;t t
+s,@ARCHFILE@,,;t t
+s,@LIBRUBY_LDSHARED@,ld,;t t
+s,@LIBRUBY_DLDFLAGS@,,;t t
+s,@RUBY_INSTALL_NAME@,ruby,;t t
+s,@rubyw_install_name@,,;t t
+s,@RUBYW_INSTALL_NAME@,,;t t
+s,@RUBY_SO_NAME@,$(RUBY_INSTALL_NAME),;t t
+s,@LIBRUBY_A@,lib$(RUBY_INSTALL_NAME).a,;t t
+s,@LIBRUBY_SO@,lib$(RUBY_SO_NAME).so.$(MAJOR).$(MINOR).$(TEENY),;t t
+s,@LIBRUBY_ALIASES@,lib$(RUBY_SO_NAME).so,;t t
+s,@LIBRUBY@,$(LIBRUBY_A),;t t
+s,@LIBRUBYARG@,-l$(RUBY_INSTALL_NAME),;t t
+s,@SOLIBS@,,;t t
+s,@DLDLIBS@,-lc,;t t
+s,@ENABLE_SHARED@,no,;t t
+s,@MAINLIBS@,,;t t
+s,@COMMON_LIBS@,,;t t
+s,@COMMON_MACROS@,,;t t
+s,@COMMON_HEADERS@,,;t t
+s,@EXPORT_PREFIX@,,;t t
+s,@MAKEFILES@,Makefile,;t t
+s,@arch@,i386-msdosdjgpp,;t t
+s,@sitearch@,i386-msdosdjgpp,;t t
+s,@sitedir@,${prefix}/lib/ruby/site_ruby,;t t
+s,@configure_args@,,;t t
+/^,THIS_IS_DUMMY_PATTERN_/i\
+ac_given_srcdir=.
diff --git a/djgpp/configure.bat b/djgpp/configure.bat
new file mode 100755
index 0000000000..e6a5d79d4a
--- /dev/null
+++ b/djgpp/configure.bat
@@ -0,0 +1,20 @@
+@echo off
+if exist configure.bat cd ..
+if exist djgpp\version.sed goto exist
+ sed -n -f djgpp\mkver.sed < version.h > djgpp\version.sed
+:exist
+set _conv_=-f djgpp\config.sed -f djgpp\version.sed
+sed %_conv_% < Makefile.in > Makefile
+sed %_conv_% < djgpp\config.hin > config.h
+echo LFN check > 12345678
+sed -n /LFN/d 123456789 > nul
+if errorlevel 2 goto LFN
+ copy missing\vsnprintf.c missing\vsnprint.c > nul
+ copy djgpp\config.sed config.sta > nul
+goto end
+:LFN
+ copy djgpp\config.sed config.status > nul
+:end
+set _conv_=
+del 12345678
+echo Now you must run a make.
diff --git a/djgpp/mkver.sed b/djgpp/mkver.sed
new file mode 100644
index 0000000000..f29b9ddd3e
--- /dev/null
+++ b/djgpp/mkver.sed
@@ -0,0 +1 @@
+/RUBY_VERSION /s/^.*\([0-9][0-9]*\)\.\([0-9][0-9]*\)\.\([0-9][0-9]*\).*$/s,@MAJOR@,\1,;s,@MINOR@,\2,;s,@TEENY@,\3,/p
diff --git a/dln.c b/dln.c
index b939dc3460..5ba25b6415 100644
--- a/dln.c
+++ b/dln.c
@@ -3,19 +3,26 @@
dln.c -
$Author$
+ $Date$
created at: Tue Jan 18 17:05:06 JST 1994
- Copyright (C) 1993-2007 Yukihiro Matsumoto
+ Copyright (C) 1993-2003 Yukihiro Matsumoto
**********************************************************************/
-#include "ruby/ruby.h"
+#include "ruby.h"
#include "dln.h"
#ifdef HAVE_STDLIB_H
# include <stdlib.h>
#endif
+#ifdef __CHECKER__
+#undef HAVE_DLOPEN
+#undef USE_DLN_A_OUT
+#undef USE_DLN_DLOPEN
+#endif
+
#ifdef USE_DLN_A_OUT
char *dln_argv0;
#endif
@@ -36,10 +43,8 @@ void *xcalloc();
void *xrealloc();
#endif
-#define free(x) xfree(x)
-
#include <stdio.h>
-#if defined(_WIN32)
+#if defined(_WIN32) || defined(__VMS)
#include "missing/file.h"
#endif
#include <sys/types.h>
@@ -64,6 +69,18 @@ void *xrealloc();
char *getenv();
#endif
+#if defined(__VMS)
+#pragma builtins
+#include <dlfcn.h>
+#endif
+
+#ifdef __MACOS__
+# include <TextUtils.h>
+# include <CodeFragments.h>
+# include <Aliases.h>
+# include "macruby_private.h"
+#endif
+
#if defined(__APPLE__) && defined(__MACH__) /* Mac OS X */
# if defined(HAVE_DLOPEN)
/* Mac OS X with dlopen (10.3 or later) */
@@ -85,23 +102,29 @@ char *getenv();
#endif
#ifndef FUNCNAME_PATTERN
-# if defined(__hp9000s300) || ((defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__)) && !defined(__ELF__)) || defined(__BORLANDC__) || defined(NeXT) || defined(__WATCOMC__) || defined(MACOSX_DYLD)
+# if defined(__hp9000s300) || (defined(__NetBSD__) && !defined(__ELF__)) || defined(__BORLANDC__) || (defined(__FreeBSD__) && !defined(__ELF__)) || (defined(__OpenBSD__) && !defined(__ELF__)) || defined(NeXT) || defined(__WATCOMC__) || defined(MACOSX_DYLD)
# define FUNCNAME_PATTERN "_Init_%s"
# else
# define FUNCNAME_PATTERN "Init_%s"
# endif
#endif
-static size_t
-init_funcname_len(char **buf, const char *file)
+static int
+init_funcname_len(buf, file)
+ char **buf;
+ const char *file;
{
char *p;
const char *slash;
- size_t len;
+ int len;
/* Load the file as an object one */
for (slash = file-1; *file; file++) /* Find position of last '/' */
+#ifdef __MACOS__
+ if (*file == ':') slash = file;
+#else
if (*file == '/') slash = file;
+#endif
len = strlen(FUNCNAME_PATTERN) + strlen(slash + 1);
*buf = xmalloc(len);
@@ -115,13 +138,13 @@ init_funcname_len(char **buf, const char *file)
}
#define init_funcname(buf, file) do {\
- size_t len = init_funcname_len(buf, file);\
+ int len = init_funcname_len(buf, file);\
char *tmp = ALLOCA_N(char, len+1);\
if (!tmp) {\
free(*buf);\
rb_memerror();\
}\
- strlcpy(tmp, *buf, len + 1);\
+ strcpy(tmp, *buf);\
free(*buf);\
*buf = tmp;\
} while (0)
@@ -161,8 +184,8 @@ static int dln_init_p = 0;
#define INVALID_OBJECT(h) (N_MAGIC(h) != OMAGIC)
-#include "ruby/util.h"
-#include "ruby/st.h"
+#include "util.h"
+#include "st.h"
static st_table *sym_tbl;
static st_table *undef_tbl;
@@ -170,7 +193,10 @@ static st_table *undef_tbl;
static int load_lib();
static int
-load_header(int fd, struct exec *hdrp, long disp)
+load_header(fd, hdrp, disp)
+ int fd;
+ struct exec *hdrp;
+ long disp;
{
int size;
@@ -240,7 +266,10 @@ static int reloc_r_length[] = {
#endif
static struct relocation_info *
-load_reloc(int fd, struct exec *hdrp, long disp)
+load_reloc(fd, hdrp, disp)
+ int fd;
+ struct exec *hdrp;
+ long disp;
{
struct relocation_info *reloc;
int size;
@@ -263,7 +292,10 @@ load_reloc(int fd, struct exec *hdrp, long disp)
}
static struct nlist *
-load_sym(int fd, struct exec *hdrp, long disp)
+load_sym(fd, hdrp, disp)
+ int fd;
+ struct exec *hdrp;
+ long disp;
{
struct nlist * buffer;
struct nlist * sym;
@@ -304,7 +336,9 @@ load_sym(int fd, struct exec *hdrp, long disp)
}
static st_table *
-sym_hash(struct exec *hdrp, struct nlist *syms)
+sym_hash(hdrp, syms)
+ struct exec *hdrp;
+ struct nlist *syms;
{
st_table *tbl;
struct nlist *sym = syms;
@@ -324,16 +358,17 @@ sym_hash(struct exec *hdrp, struct nlist *syms)
}
static int
-dln_init(const char *prog)
+dln_init(prog)
+ const char *prog;
{
- char *file, fbuf[MAXPATHLEN];
+ char *file;
int fd;
struct exec hdr;
struct nlist *syms;
if (dln_init_p == 1) return 0;
- file = dln_find_exe_r(prog, NULL, fbuf, sizeof(fbuf));
+ file = dln_find_exe(prog, NULL);
if (file == NULL || (fd = open(file, O_RDONLY)) < 0) {
dln_errno = errno;
return -1;
@@ -398,7 +433,11 @@ dln_init(const char *prog)
}
static long
-load_text_data(int fd, struct exec *hdrp, int bss, long disp)
+load_text_data(fd, hdrp, bss, disp)
+ int fd;
+ struct exec *hdrp;
+ int bss;
+ long disp;
{
int size;
unsigned char* addr;
@@ -432,21 +471,22 @@ load_text_data(int fd, struct exec *hdrp, int bss, long disp)
}
static int
-undef_print(char *key, char *value)
+undef_print(key, value)
+ char *key, *value;
{
fprintf(stderr, " %s\n", key);
return ST_CONTINUE;
}
static void
-dln_print_undef(void)
+dln_print_undef()
{
fprintf(stderr, " Undefined symbols:\n");
st_foreach(undef_tbl, undef_print, NULL);
}
static void
-dln_undefined(void)
+dln_undefined()
{
if (undef_tbl->num_entries > 0) {
fprintf(stderr, "dln: Calling undefined function\n");
@@ -469,7 +509,10 @@ struct undef {
static st_table *reloc_tbl = NULL;
static void
-link_undef(const char *name, long base, struct relocation_info *reloc)
+link_undef(name, base, reloc)
+ const char *name;
+ long base;
+ struct relocation_info *reloc;
{
static int u_no = 0;
struct undef *obj;
@@ -502,7 +545,10 @@ struct reloc_arg {
};
static int
-reloc_undef(int no, struct undef *undef, struct reloc_arg *arg)
+reloc_undef(no, undef, arg)
+ int no;
+ struct undef *undef;
+ struct reloc_arg *arg;
{
int datum;
char *address;
@@ -563,7 +609,9 @@ reloc_undef(int no, struct undef *undef, struct reloc_arg *arg)
}
static void
-unlink_undef(const char *name, long value)
+unlink_undef(name, value)
+ const char *name;
+ long value;
{
struct reloc_arg arg;
@@ -578,7 +626,10 @@ struct indr_data {
};
static int
-reloc_repl(int no, struct undef *undef, struct indr_data *data)
+reloc_repl(no, undef, data)
+ int no;
+ struct undef *undef;
+ struct indr_data *data;
{
if (strcmp(data->name0, undef->name) == 0) {
free(undef->name);
@@ -589,7 +640,10 @@ reloc_repl(int no, struct undef *undef, struct indr_data *data)
#endif
static int
-load_1(int fd, long disp, const char *need_init)
+load_1(fd, disp, need_init)
+ int fd;
+ long disp;
+ const char *need_init;
{
static const char *libc = LIBC_NAME;
struct exec hdr;
@@ -760,7 +814,7 @@ load_1(int fd, long disp, const char *need_init)
}
} /* end.. look it up */
else { /* is static */
- switch (R_SYMBOL(rel)) {
+ switch (R_SYMBOL(rel)) {
case N_TEXT:
case N_DATA:
datum = block;
@@ -870,7 +924,10 @@ load_1(int fd, long disp, const char *need_init)
static int target_offset;
static int
-search_undef(const char *key, int value, st_table *lib_tbl)
+search_undef(key, value, lib_tbl)
+ const char *key;
+ int value;
+ st_table *lib_tbl;
{
long offset;
@@ -887,9 +944,10 @@ struct symdef {
char *dln_librrb_ary_path = DLN_DEFAULT_LIB_PATH;
static int
-load_lib(const char *lib)
+load_lib(lib)
+ const char *lib;
{
- char *path, *file, fbuf[MAXPATHLEN];
+ char *path, *file;
char armagic[SARMAG];
int fd, size;
struct ar_hdr ahdr;
@@ -920,7 +978,7 @@ load_lib(const char *lib)
path = getenv("DLN_LIBRARY_PATH");
if (path == NULL) path = dln_librrb_ary_path;
- file = dln_find_file_r(lib, path, fbuf, sizeof(fbuf));
+ file = dln_find_file(lib, path);
fd = open(file, O_RDONLY);
if (fd == -1) goto syserr;
size = read(fd, armagic, SARMAG);
@@ -1024,7 +1082,8 @@ load_lib(const char *lib)
}
static int
-load(const char *file)
+load(file)
+ const char *file;
{
int fd;
int result;
@@ -1049,7 +1108,8 @@ load(const char *file)
}
void*
-dln_sym(const char *name)
+dln_sym(name)
+ const char *name;
{
struct nlist *sym;
@@ -1061,7 +1121,12 @@ dln_sym(const char *name)
#endif /* USE_DLN_A_OUT */
#ifdef USE_DLN_DLOPEN
-# include <dlfcn.h>
+# if defined(__NetBSD__) && defined(__NetBSD_Version__) && __NetBSD_Version__ < 105000000
+# include <nlist.h>
+# include <link.h>
+# else
+# include <dlfcn.h>
+# endif
#endif
#ifdef __hpux
@@ -1094,8 +1159,17 @@ dln_sym(const char *name)
#include <windows.h>
#endif
+#ifdef _WIN32_WCE
+#undef FormatMessage
+#define FormatMessage FormatMessageA
+#undef LoadLibrary
+#define LoadLibrary LoadLibraryA
+#undef GetProcAddress
+#define GetProcAddress GetProcAddressA
+#endif
+
static const char *
-dln_strerror(void)
+dln_strerror()
{
#ifdef USE_DLN_A_OUT
char *strerror();
@@ -1152,7 +1226,7 @@ aix_loaderror(const char *pathname)
char *message[8], errbuf[1024];
int i,j;
- struct errtab {
+ struct errtab {
int errnum;
char *errstr;
} load_errtab[] = {
@@ -1175,7 +1249,7 @@ aix_loaderror(const char *pathname)
snprintf(errbuf, 1024, "load failed - %s ", pathname);
- if (!loadquery(1, &message[0], sizeof(message)))
+ if (!loadquery(1, &message[0], sizeof(message)))
ERRBUF_APPEND(strerror(errno));
for(i = 0; message[i] && *message[i]; i++) {
int nerr = atoi(message[i]);
@@ -1183,7 +1257,7 @@ aix_loaderror(const char *pathname)
if (nerr == load_errtab[i].errnum && load_errtab[i].errstr)
ERRBUF_APPEND(load_errtab[i].errstr);
}
- while (isdigit(*message[i])) message[i]++;
+ while (isdigit(*message[i])) message[i]++;
ERRBUF_APPEND(message[i]);
ERRBUF_APPEND("\n");
}
@@ -1193,10 +1267,24 @@ aix_loaderror(const char *pathname)
}
#endif
+#if defined(__VMS)
+#include <starlet.h>
+#include <rms.h>
+#include <stsdef.h>
+#include <unixlib.h>
+#include <descrip.h>
+#include <lib$routines.h>
+
+static char *vms_filespec;
+static int vms_fileact(char *filespec, int type);
+static long vms_fisexh(long *sigarr, long *mecarr);
+#endif
+
#endif /* NO_DLN_LOAD */
void*
-dln_load(const char *file)
+dln_load(file)
+ const char *file;
{
#ifdef NO_DLN_LOAD
rb_raise(rb_eLoadError, "this executable file can't load extension libraries");
@@ -1218,7 +1306,7 @@ dln_load(const char *file)
/* Load the file as an object one */
init_funcname(&buf, file);
- strlcpy(winfile, file, sizeof(winfile));
+ strcpy(winfile, file);
/* Load file */
if ((handle = LoadLibrary(winfile)) == NULL) {
@@ -1269,11 +1357,6 @@ dln_load(const char *file)
}
init_fct = (void(*)())dlsym(handle, buf);
-#if defined __SYMBIAN32__
- if (init_fct == NULL) {
- init_fct = (void(*)())dlsym(handle, "1"); /* Some Symbian versions do not support symbol table in DLL, ordinal numbers only */
- }
-#endif
if (init_fct == NULL) {
error = DLN_ERROR();
dlclose(handle);
@@ -1333,7 +1416,7 @@ dln_load(const char *file)
#define DLN_DEFINED
/*----------------------------------------------------
By SHIROYAMA Takayuki Psi@fortune.nest.or.jp
-
+
Special Thanks...
Yu tomoak-i@is.aist-nara.ac.jp,
Mi hisho@tasihara.nest.or.jp,
@@ -1348,9 +1431,9 @@ dln_load(const char *file)
char *object_files[2] = {NULL, NULL};
void (*init_fct)();
-
+
object_files[0] = (char*)file;
-
+
s = NXOpenFile(2,NX_WRITEONLY);
/* Load object file, if return value ==0 , load failed*/
@@ -1397,7 +1480,7 @@ dln_load(const char *file)
/* lookup the initial function */
if(!NSIsSymbolNameDefined(buf)) {
rb_loaderror("Failed to lookup Init function %.200s",file);
- }
+ }
init_fct = NSAddressOfSymbol(NSLookupAndBindSymbol(buf));
(*init_fct)();
@@ -1416,10 +1499,9 @@ dln_load(const char *file)
/* load extention module */
img_id = load_add_on(file);
if (img_id <= 0) {
- rb_loaderror("Failed to load add_on %.200s error_code=%x",
- file, img_id);
+ rb_loaderror("Failed to load %.200s", file);
}
-
+
/* find symbol for module initialize function. */
/* The Be Book KernelKit Images section described to use
B_SYMBOL_TYPE_TEXT for symbol of function, not
@@ -1432,8 +1514,8 @@ dln_load(const char *file)
if (err_stat != B_NO_ERROR) {
char real_name[MAXPATHLEN];
- strlcpy(real_name, buf, MAXPATHLEN);
- strlcat(real_name, "__Fv", MAXPATHLEN);
+ strcpy(real_name, buf);
+ strcat(real_name, "__Fv");
err_stat = get_image_symbol(img_id, real_name,
B_SYMBOL_TYPE_TEXT, (void **)&init_fct);
}
@@ -1454,6 +1536,105 @@ dln_load(const char *file)
}
#endif /* __BEOS__*/
+#ifdef __MACOS__ /* Mac OS 9 or before */
+# define DLN_DEFINED
+ {
+ OSErr err;
+ FSSpec libspec;
+ CFragConnectionID connID;
+ Ptr mainAddr;
+ char errMessage[1024];
+ Boolean isfolder, didsomething;
+ Str63 fragname;
+ Ptr symAddr;
+ CFragSymbolClass class;
+ void (*init_fct)();
+ char fullpath[MAXPATHLEN];
+
+ strcpy(fullpath, file);
+
+ /* resolve any aliases to find the real file */
+ c2pstr(fullpath);
+ (void)FSMakeFSSpec(0, 0, fullpath, &libspec);
+ err = ResolveAliasFile(&libspec, 1, &isfolder, &didsomething);
+ if (err) {
+ rb_loaderror("Unresolved Alias - %s", file);
+ }
+
+ /* Load the fragment (or return the connID if it is already loaded */
+ fragname[0] = 0;
+ err = GetDiskFragment(&libspec, 0, 0, fragname,
+ kLoadCFrag, &connID, &mainAddr,
+ errMessage);
+ if (err) {
+ p2cstr(errMessage);
+ rb_loaderror("%s - %s",errMessage , file);
+ }
+
+ /* Locate the address of the correct init function */
+ c2pstr(buf);
+ err = FindSymbol(connID, buf, &symAddr, &class);
+ if (err) {
+ rb_loaderror("Unresolved symbols - %s" , file);
+ }
+ init_fct = (void (*)())symAddr;
+ (*init_fct)();
+ return (void*)init_fct;
+ }
+#endif /* __MACOS__ */
+
+#if defined(__VMS)
+#define DLN_DEFINED
+ {
+ long status;
+ void (*init_fct)();
+ char *fname, *p1, *p2;
+
+ $DESCRIPTOR(fname_d, "");
+ $DESCRIPTOR(image_d, "");
+ $DESCRIPTOR(buf_d, "");
+
+ decc$to_vms(file, vms_fileact, 0, 0);
+
+ fname = (char *)__alloca(strlen(file)+1);
+ strcpy(fname,file);
+ if (p1 = strrchr(fname,'/'))
+ fname = p1 + 1;
+ if (p2 = strrchr(fname,'.'))
+ *p2 = '\0';
+
+ fname_d.dsc$w_length = strlen(fname);
+ fname_d.dsc$a_pointer = fname;
+ image_d.dsc$w_length = strlen(vms_filespec);
+ image_d.dsc$a_pointer = vms_filespec;
+ buf_d.dsc$w_length = strlen(buf);
+ buf_d.dsc$a_pointer = buf;
+
+ lib$establish(vms_fisexh);
+
+ status = lib$find_image_symbol (
+ &fname_d,
+ &buf_d,
+ &init_fct,
+ &image_d);
+
+ lib$establish(0);
+
+ if (status == RMS$_FNF) {
+ error = dln_strerror();
+ goto failed;
+ } else if (!$VMS_STATUS_SUCCESS(status)) {
+ error = DLN_ERROR();
+ goto failed;
+ }
+
+ /* Call the init code */
+ (*init_fct)();
+
+ return 1;
+ }
+#endif /* __VMS */
+
#ifndef DLN_DEFINED
rb_notimplement();
#endif
@@ -1469,131 +1650,76 @@ dln_load(const char *file)
return 0; /* dummy return */
}
-static char *dln_find_1(const char *fname, const char *path, char *buf, size_t size, int exe_flag);
+static char *dln_find_1();
char *
-dln_find_exe_r(const char *fname, const char *path, char *buf, size_t size)
+dln_find_exe(fname, path)
+ const char *fname;
+ const char *path;
{
if (!path) {
path = getenv(PATH_ENV);
}
if (!path) {
-#if defined(_WIN32)
+#if defined(MSDOS) || defined(_WIN32) || defined(__human68k__) || defined(__MACOS__)
path = "/usr/local/bin;/usr/ucb;/usr/bin;/bin;.";
#else
path = "/usr/local/bin:/usr/ucb:/usr/bin:/bin:.";
#endif
}
- return dln_find_1(fname, path, buf, size, 1);
+ return dln_find_1(fname, path, 1);
}
char *
-dln_find_file_r(const char *fname, const char *path, char *buf, size_t size)
+dln_find_file(fname, path)
+ const char *fname;
+ const char *path;
{
+#ifndef __MACOS__
if (!path) path = ".";
- return dln_find_1(fname, path, buf, size, 0);
+ return dln_find_1(fname, path, 0);
+#else
+ if (!path) path = ".";
+ return _macruby_path_conv_posix_to_macos(dln_find_1(fname, path, 0));
+#endif
}
static char fbuf[MAXPATHLEN];
-char *
-dln_find_exe(const char *fname, const char *path)
-{
- return dln_find_exe_r(fname, path, fbuf, sizeof(fbuf));
-}
-
-char *
-dln_find_file(const char *fname, const char *path)
-{
- return dln_find_file_r(fname, path, fbuf, sizeof(fbuf));
-}
-
static char *
-dln_find_1(const char *fname, const char *path, char *fbuf, size_t size,
- int exe_flag /* non 0 if looking for executable. */)
+dln_find_1(fname, path, exe_flag)
+ const char *fname;
+ const char *path;
+ int exe_flag; /* non 0 if looking for executable. */
{
register const char *dp;
register const char *ep;
register char *bp;
struct stat st;
- size_t i, fspace;
-#ifdef DOSISH
- static const char extension[][5] = {
- ".exe", ".com", ".cmd", ".bat",
- };
- size_t j;
- int is_abs = 0, has_path = 0;
- const char *ext = 0;
- const char *p = fname;
+#ifdef __MACOS__
+ const char* mac_fullpath;
#endif
-#define RETURN_IF(expr) if (expr) return (char *)fname;
-
- RETURN_IF(!fname);
+ if (!fname) return (char *)fname;
+ if (fname[0] == '/') return (char *)fname;
+ if (strncmp("./", fname, 2) == 0 || strncmp("../", fname, 3) == 0)
+ return (char *)fname;
+ if (exe_flag && strchr(fname, '/')) return (char *)fname;
#ifdef DOSISH
-# ifndef CharNext
-# define CharNext(p) ((p)+1)
-# endif
+ if (fname[0] == '\\') return (char *)fname;
# ifdef DOSISH_DRIVE_LETTER
- if (((p[0] | 0x20) - 'a') < 26 && p[1] == ':') {
- p += 2;
- is_abs = 1;
- }
+ if (strlen(fname) > 2 && fname[1] == ':') return (char *)fname;
# endif
- switch (*p) {
- case '/': case '\\':
- is_abs = 1;
- p++;
- }
- has_path = is_abs;
- while (*p) {
- switch (*p) {
- case '/': case '\\':
- has_path = 1;
- ext = 0;
- p++;
- break;
- case '.':
- ext = p;
- p++;
- break;
- default:
- p = CharNext(p);
- }
- }
- if (ext) {
- for (j = 0; STRCASECMP(ext, extension[j]); ) {
- if (++j == sizeof(extension) / sizeof(extension[0])) {
- ext = 0;
- break;
- }
- }
- }
- ep = bp = 0;
- if (!exe_flag) {
- RETURN_IF(is_abs);
- }
- else if (has_path) {
- RETURN_IF(ext);
- i = p - fname;
- if (i + 1 > size) goto toolong;
- fspace = size - i - 1;
- bp = fbuf;
- ep = p;
- memcpy(fbuf, fname, i + 1);
- goto needs_extension;
- }
+ if (strncmp(".\\", fname, 2) == 0 || strncmp("..\\", fname, 3) == 0)
+ return (char *)fname;
+ if (exe_flag && strchr(fname, '\\')) return (char *)fname;
#endif
- RETURN_IF(fname[0] == '/');
- RETURN_IF(strncmp("./", fname, 2) == 0 || strncmp("../", fname, 3) == 0);
- RETURN_IF(exe_flag && strchr(fname, '/'));
-
-#undef RETURN_IF
-
for (dp = path;; dp = ++ep) {
- register size_t l;
+ register int l;
+ int i;
+ int fspace;
/* extract a component */
ep = strchr(dp, PATH_SEP[0]);
@@ -1603,7 +1729,7 @@ dln_find_1(const char *fname, const char *path, char *fbuf, size_t size,
/* find the length of that component */
l = ep - dp;
bp = fbuf;
- fspace = size - 2;
+ fspace = sizeof fbuf - 2;
if (l > 0) {
/*
** If the length of the component is zero length,
@@ -1615,7 +1741,7 @@ dln_find_1(const char *fname, const char *path, char *fbuf, size_t size,
if (*dp == '~' && (l == 1 ||
#if defined(DOSISH)
- dp[1] == '\\' ||
+ dp[1] == '\\' ||
#endif
dp[1] == '/')) {
char *home;
@@ -1623,9 +1749,8 @@ dln_find_1(const char *fname, const char *path, char *fbuf, size_t size,
home = getenv("HOME");
if (home != NULL) {
i = strlen(home);
- if (fspace < i)
+ if ((fspace -= i) < 0)
goto toolong;
- fspace -= i;
memcpy(bp, home, i);
bp += i;
}
@@ -1633,9 +1758,8 @@ dln_find_1(const char *fname, const char *path, char *fbuf, size_t size,
l--;
}
if (l > 0) {
- if (fspace < l)
+ if ((fspace -= l) < 0)
goto toolong;
- fspace -= l;
memcpy(bp, dp, l);
bp += l;
}
@@ -1647,7 +1771,7 @@ dln_find_1(const char *fname, const char *path, char *fbuf, size_t size,
/* now append the file name */
i = strlen(fname);
- if (fspace < i) {
+ if ((fspace -= i) < 0) {
toolong:
fprintf(stderr, "openpath: pathname too long (ignored)\n");
*bp = '\0';
@@ -1655,12 +1779,26 @@ dln_find_1(const char *fname, const char *path, char *fbuf, size_t size,
fprintf(stderr, "\tFile \"%s\"\n", fname);
goto next;
}
- fspace -= i;
memcpy(bp, fname, i + 1);
#if defined(DOSISH)
- if (exe_flag && !ext) {
- needs_extension:
+ if (exe_flag) {
+ static const char extension[][5] = {
+#if defined(MSDOS)
+ ".com", ".exe", ".bat",
+#if defined(DJGPP)
+ ".btm", ".sh", ".ksh", ".pl", ".sed",
+#endif
+#elif defined(__EMX__) || defined(_WIN32)
+ ".exe", ".com", ".cmd", ".bat",
+/* end of __EMX__ or _WIN32 */
+#else
+ ".r", ".R", ".x", ".X", ".bat", ".BAT",
+/* __human68k__ */
+#endif
+ };
+ int j;
+
for (j = 0; j < sizeof(extension) / sizeof(extension[0]); j++) {
if (fspace < strlen(extension[j])) {
fprintf(stderr, "openpath: pathname too long (ignored)\n");
@@ -1668,20 +1806,38 @@ dln_find_1(const char *fname, const char *path, char *fbuf, size_t size,
fprintf(stderr, "\tFile \"%s%s\"\n", fname, extension[j]);
continue;
}
- strlcpy(bp + i, extension[j], fspace);
+ strcpy(bp + i, extension[j]);
+#ifndef __MACOS__
if (stat(fbuf, &st) == 0)
return fbuf;
+#else
+ if (mac_fullpath = _macruby_exist_file_in_libdir_as_posix_name(fbuf))
+ return mac_fullpath;
+
+#endif
}
goto next;
}
-#endif /* _WIN32 or __EMX__ */
+#endif /* MSDOS or _WIN32 or __human68k__ or __EMX__ */
+#ifndef __MACOS__
if (stat(fbuf, &st) == 0) {
if (exe_flag == 0) return fbuf;
/* looking for executable */
if (!S_ISDIR(st.st_mode) && eaccess(fbuf, X_OK) == 0)
return fbuf;
}
+#else
+ if (mac_fullpath = _macruby_exist_file_in_libdir_as_posix_name(fbuf)) {
+ if (exe_flag == 0) return mac_fullpath;
+ /* looking for executable */
+ if (stat(mac_fullpath, &st) == 0) {
+ if (!S_ISDIR(st.st_mode) && eaccess(mac_fullpath, X_OK) == 0)
+ return mac_fullpath;
+ }
+ }
+#endif
+
next:
/* if not, and no other alternatives, life is bleak */
if (*ep == '\0') {
@@ -1691,3 +1847,24 @@ dln_find_1(const char *fname, const char *path, char *fbuf, size_t size,
/* otherwise try the next component in the search path */
}
}
+
+#if defined(__VMS)
+
+/* action routine for decc$to_vms */
+static int vms_fileact(char *filespec, int type)
+{
+ if (vms_filespec)
+ free(vms_filespec);
+ vms_filespec = malloc(strlen(filespec)+1);
+ strcpy(vms_filespec, filespec);
+ return 1;
+}
+
+/* exception handler for LIB$FIND_IMAGE_SYMBOL */
+static long vms_fisexh(long *sigarr, long *mecarr)
+{
+ sys$unwind(1, 0);
+ return 1;
+}
+
+#endif /* __VMS */
diff --git a/dln.h b/dln.h
index 47ff3eaf59..182cf9f9f4 100644
--- a/dln.h
+++ b/dln.h
@@ -3,9 +3,10 @@
dln.h -
$Author$
+ $Date$
created at: Wed Jan 19 16:53:09 JST 1994
- Copyright (C) 1993-2007 Yukihiro Matsumoto
+ Copyright (C) 1993-2003 Yukihiro Matsumoto
**********************************************************************/
@@ -28,14 +29,12 @@
# define _(args) ()
#endif
-DEPRECATED(char *dln_find_exe(const char*,const char*));
-DEPRECATED(char *dln_find_file(const char*,const char*));
-char *dln_find_exe_r(const char*,const char*,char*,size_t);
-char *dln_find_file_r(const char*,const char*,char*,size_t);
+char *dln_find_exe _((const char*,const char*));
+char *dln_find_file _((const char*,const char*));
#ifdef USE_DLN_A_OUT
extern char *dln_argv0;
#endif
-void *dln_load(const char*);
+void *dln_load _((const char*));
#endif
diff --git a/dmyencoding.c b/dmyencoding.c
deleted file mode 100644
index 1bd1106e69..0000000000
--- a/dmyencoding.c
+++ /dev/null
@@ -1,2 +0,0 @@
-#define NO_LOCALE_CHARMAP 1
-#include "encoding.c"
diff --git a/dmyext.c b/dmyext.c
index 4d273f7faf..4120d493c3 100644
--- a/dmyext.c
+++ b/dmyext.c
@@ -1,4 +1,4 @@
void
-Init_ext(void)
+Init_ext()
{
}
diff --git a/doc/ChangeLog-YARV b/doc/ChangeLog-YARV
deleted file mode 100644
index c9d32916cf..0000000000
--- a/doc/ChangeLog-YARV
+++ /dev/null
@@ -1,6917 +0,0 @@
-# $Id: ChangeLog 590 2006-12-31 09:02:34Z ko1 $
-#
-# YARV ChangeLog
-# from Mon, 03 May 2004 01:24:19 +0900
-#
-
-Sun Dec 31 18:01:50 2006 Koichi Sasada <ko1@atdot.net>
-
- * bin/* : ruby/trunk/bin 11437
-
-
-Sun Dec 31 17:42:05 2006 Koichi Sasada <ko1@atdot.net>
-
- * eval.c : remove old Kernel#funcall definition
-
-
-2006-12-30(Sat) 07:59:26 +0900 Koichi Sasada <ko1@atdot.net>
-
- * catch up ruby/trunk 11437
-
- * eval_intern.h : reorder tag initialization
-
- * eval.c : fix to support __send!, funcall and prohibit funcall as
- send
-
- * eval_error.h, eval_jump.h, eval_safe.h : fix prototypes
-
- * eval_method.h, vm.c : check re-definition at rb_add_method()
-
- * yarvcore.h : fix typo
-
- * compile.c : fix white spaces
-
- * lib/delegate.rb : fix to support __send, ...
-
- * lib/getoptlong.rb : fix to work on YARV
-
- * lib/rss/parser.rb : use __send! instead of __send__
-
- * sample/test.rb : comment out codes which use |&b| type block parameter
-
- * ext/ripper/extconf.rb : turn off
-
- * test/ripper/test_files.rb, test_parser_events.rb,
- test_scanner_events.rb : fix to check it has ripper module
-
- * vm_dump.c : remove showing file path length limitation
-
- * yarvtest/test_eval.rb : use __send! instead of __send__
-
-
-2006-12-19(Tue) 11:46:08 +0900 Koichi Sasada <ko1@atdot.net>
-
- * doc/* : added
-
- * ext/openssl : added
-
- * ext/ripper : added
-
- * test/openssl : added
-
- * test/ripper : added
-
- * misc : added
-
- * rb/ -> tool/ : renamed
-
- * common.mk : fixed for above change
-
- * ruby_doc/* : move to topdir
-
- * sample/* : added
-
- * test2.rb : removed
-
-
-2006-12-15(Fri) 09:42:46 +0900 Koichi Sasada <ko1@atdot.net>
-
- * compile.c : remove obsolete codes
-
- * insns.def : fix a comment of getconstant
-
-
-2006-12-13(Wed) 16:26:06 +0900 Koichi Sasada <ko1@atdot.net>
-
- * blockinlining.c, compile.c, compile.h, debug.c, debug.h,
- insnhelper.h, insns.def, iseq.c, thread.c, thread_pthread.ci,
- thread_pthread.h, thread_win32.ci, thread_win32.h, vm.c, vm.h,
- vm_dump.c, vm_evalbody.ci, vm_opts.h.base, yarv.h,
- yarv_version.h, yarvcore.c, yarvcore.h :
- add a header includes copyright
-
-
-2006-12-12(Tue) 13:13:32 +0900 Koichi Sasada <ko1@atdot.net>
-
- * rb/insns2vm.rb : add PREFETCH() statement
-
- * vm.h : ditto
-
- * yarvcore.h : fix LIKELY(x) and
- remove main_thread_val field from yarv_vm_t
-
- * yarvcore.c : ditto
-
- * thread.c : support fork
-
- * eval_thread.c : ditto
-
- * process.c : ditto
-
- * signal.c : ditto
-
- * test/ruby/test_signal.rb :
-
- * thread_pthread.ci : rename timer thread functions
-
- * thread_win32.ci : ditto
-
-
-2006-11-10(Fri) 21:29:13 +0900 Koichi Sasada <ko1@atdot.net>
-
- * compile.c : fix to compile arguments
-
- * insns.def : fix to duplicate first array value on concatarray
- instruction
-
- * yarvtest/test_bin.rb : add a test for above change
-
- * sample/test.rb : fix to catch up Ruby HEAD (fix to remove test about
- module duplicate)
-
-
-2006-11-10(Fri) 12:49:11 +0900 Koichi Sasada <ko1@atdot.net>
-
- * vm_macro.def : fix to inherit visibility on
- NODE_SUPER method invocation
-
-
-2006-11-10(Fri) 09:13:46 +0900 Koichi Sasada <ko1@atdot.net>
-
- * class.c : revert module duplicate inclusion
-
- * parse.y : catch up current Ruby HEAD
-
- * node.h : ditto
-
- * compile.c : ditto
-
- * gc.c : ditto
-
- * iseq.c : ditto
-
- * eval_thread.c : define Continuation (null class)
-
- * vm_dump.c : fix to output backtrae to stderr
-
- * yarvtest/test_block.rb : remove unsupported test
-
- * yarvtest/test_class.rb : add a test about super
-
- * yarvtest/test_syntax.rb : add a test about case/when
-
-
-2006-11-09(Thu) 10:22:59 +0900 Koichi Sasada <ko1@atdot.net>
-
- * call_cfunc.h -> call_cfunc.ci : renamed
-
- * vm_evalbody.h, vm_evalbody.ci : ditto
-
- * thread_pthread.h, thread_pthread.ci : separate declaration and
- implementation
-
- * thread_win32.h, thread_win32.ci : ditto
-
- * thread.c : use *.ci instead of *.c as implementation
-
- * vm.c : ditto
-
- * common.mk : fix rules for above changes
-
-
-2006-11-08(Wed) 17:23:23 +0900 Koichi Sasada <ko1@atdot.net>
-
- * vm_dump.c : show C level backtrace (pointer only) with
- backtrace() function (glibc feature)
-
- * configure.in : ditto
-
- * yarvcore.c : add NSDR method (show C level backtrace)
-
- * error.c : fix indent
-
-
-2006-11-07(Tue) 13:17:10 +0900 Koichi Sasada <ko1@atdot.net>
-
- * eval.c (rb_set_errinfo) : added
-
- * ruby.h : ditto
-
- * version.h : fix version number
-
- * lib/webrick/utils.rb : fix to remove Thread.critical
-
- * ext/dbm, dl, gdbm, iconv, io, pty, sdbm : added
-
- * test/dbm, gdbm, io, logger, net, readline, sdbm, soap,
- webrick, win32ole, wsdl, xsd : added
-
-
-2006-11-06(Mon) 22:32:18 +0900 Koichi Sasada <ko1@atdot.net>
-
- * array.c : import Ruby HEAD
-
- * ext/socket/extconf.rb : ditto
-
- * ext/socket/socket.c : ditto
-
- * gc.c : ditto
-
- * lib/date.rb : ditto
-
- * lib/net/imap.rb : ditto
-
- * lib/rss/0.9.rb : ditto
-
- * lib/set.rb : ditto
-
- * lib/soap/mapping/rubytypeFactory.rb : ditto
-
- * lib/soap/mimemessage.rb : ditto
-
- * lib/soap/property.rb : ditto
-
- * lib/webrick/httprequest.rb : ditto
-
- * lib/webrick/httputils.rb : ditto
-
- * lib/xmlrpc/create.rb : ditto
-
- * lib/xsd/codegen/gensupport.rb : ditto
-
- * object.c : ditto
-
- * ruby.h : ditto
-
- * string.c : ditto
-
- * version.h : ditto
-
- * rb/ir.rb : fix to use "diffs" directory
-
- * vm_dump.c : add "const"
-
-
-2006-11-06(Mon) 16:36:47 +0900 Koichi Sasada <ko1@atdot.net>
-
- * eval_proc.c : remove "static" from external global variables
-
- * eval_thread.c : ditto
-
- * array.c : fix indent
-
- * insns.def : add a suitable cast
-
- * vm_macro.def : allow scalar value on splat arguments
-
- * yarvtest/test_block.rb : fix to synchronize Ruby HEAD
-
- * rb/insns2vm.rb : remove String#each for 1.9
-
- * template/vm.inc.tmpl : ditto (remove String#each_with_index)
-
-
-2006-11-06(Mon) 13:22:34 +0900 Koichi Sasada <ko1@atdot.net>
-
- * iseq.c : fixed GC debugging outputs
-
- * rb/parse.rb : fixed output format
-
-
-2006-11-04(Sat) 09:46:50 +0900 Koichi Sasada <ko1@atdot.net>
-
- * compile.c : fix to duplicate "#{'foo'}" string
-
- * yarvtest/test_bin.rb : add a test for above
-
- * ext/readline/readline.c : import Ruby HEAD
-
- * keywords : ditto
-
- * lex.c : ditto
-
- * parse.y : ditto
-
- * lib/mkmf.rb : ditto
-
- * test/ruby/test_hash.rb : fix to current specification
-
- * test/ruby/test_string.rb : ditto
-
-
-2006-11-03(Fri) 20:58:36 +0900 Koichi Sasada <ko1@atdot.net>
-
- * ext/nkf/nkf-utf8/utf8tbl.h : missed to add
-
- * configure.in : import ruby HEAD
-
- * test/ruby/test_array.rb : ditto
-
- * test/ruby/test_assignment.rb : ditto
-
- * test/ruby/test_clone.rb : ditto
-
- * test/socket/test_socket.rb : ditto
-
- * test/socket/test_unix.rb : ditto
-
- * test/strscan/test_stringscanner.rb : ditto
-
- * test/testunit/collector/test_dir.rb : ditto
-
-
-2006-11-03(Fri) 20:22:24 +0900 Koichi Sasada <ko1@atdot.net>
-
- * array.c : import current ruby HEAD and apply API changes
- This version has some known bugs
-
- * bignum.c : ditto
-
- * blockinlining.c : ditto
-
- * class.c : ditto
-
- * compile.c : ditto
-
- * dir.c : ditto
-
- * dln.c : ditto
-
- * enum.c : ditto
-
- * enumerator.c : ditto
-
- * error.c : ditto
-
- * eval.c : ditto
-
- * eval_error.h : ditto
-
- * eval_jump.h : ditto
-
- * eval_load.c : ditto
-
- * eval_proc.c : ditto
-
- * ext/*
-
- * file.c : ditto
-
- * gc.c : ditto
-
- * hash.c : ditto
-
- * insns.def : ditto
-
- * instruby.rb : ditto
-
- * intern.h : ditto
-
- * io.c : ditto
-
- * iseq.c : ditto
-
- * lib/*
-
- * marshal.c : ditto
-
- * math.c : ditto
-
- * missing/vsnprintf.c : ditto
-
- * mkconfig.rb : ditto
-
- * node.h : ditto
-
- * numeric.c : ditto
-
- * object.c : ditto
-
- * oniguruma.h : ditto
-
- * pack.c : ditto
-
- * parse.y : ditto
-
- * prec.c : ditto
-
- * process.c : ditto
-
- * random.c : ditto
-
- * range.c : ditto
-
- * rb/ir.rb : ditto
-
- * re.c : ditto
-
- * regcomp.c : ditto
-
- * regerror.c : ditto
-
- * regexec.c : ditto
-
- * regint.h : ditto
-
- * regparse.c : ditto
-
- * regparse.h : ditto
-
- * ruby.c : ditto
-
- * ruby.h : ditto
-
- * rubytest.rb : ditto
-
- * runruby.rb : ditto
-
- * sample/test.rb : ditto
-
- * signal.c : ditto
-
- * sprintf.c : ditto
-
- * st.c : ditto
-
- * st.h : ditto
-
- * string.c : ditto
-
- * struct.c : ditto
-
- * test/*
-
- * thread.c : ditto
-
- * time.c : ditto
-
- * util.c : ditto
-
- * variable.c : ditto
-
- * version.h : ditto
-
- * vm.c : ditto
-
- * vm_dump.c : ditto
-
- * vm_macro.def : ditto
-
- * win32/*
-
-
-2006-10-31(Tue) 22:47:50 +0900 Koichi Sasada <ko1@atdot.net>
-
- * parse.y : fix NEWHEAP bugs (import HEAD)
-
- * ruby.c, intern.h, yarvcore.c (rb_load_file) : change to
- return parsed node pointer
-
- * rb/ir.rb : add check mode
-
-
-2006-09-01(Fri) 22:05:28 +0900 Koichi Sasada <ko1@atdot.net>
-
- * compile.c : fix a bug of peephole optimization and enable
- regexp optimization
-
-
-2006-08-21(Mon) 05:27:48 +0900 Koichi Sasada <ko1@atdot.net>
-
- * lib/mathn.rb : remove "remove_method :gcd2"
-
- * opt_insn_unif.def : unset opt setting
-
- * opt_operand.def : ditto
-
-
-2006-08-18(Fri) 17:55:31 +0900 Koichi Sasada <ko1@atdot.net>
-
- * common.mk : add dependency of yarvcore.h to thread.o
-
- * gc.c : change comment line
-
- * thread.c : remove some line break
-
- * yarvcore.c : reoder initialize sequence to mark main thread
-
-
-2006-08-18(Fri) 16:51:34 +0900 Koichi Sasada <ko1@atdot.net>
-
- * yarvcore.h : add a support for cache values per thread
-
- * yarvcore.c : ditto
-
- * gc.c : ditto
-
- * thread.c : move a expression after acquiring lock
-
- * compile.c : add a cast to remove warning
-
-
-2006-08-18(Fri) 02:07:45 +0900 Koichi Sasada <ko1@atdot.net>
-
- * compile.c : fix to return rhs value on ATTRASGIN
-
- * insns.def (setn) : add insn setn
-
- * yarvtest/test_bin.rb : add tests for above
-
-
-2006-08-17(Thu) 22:46:08 +0900 Koichi Sasada <ko1@atdot.net>
-
- * vm.c : clear callee_id ([yarv-dev:1073])
-
-
-2006-08-17(Thu) 22:14:15 +0900 Koichi Sasada <ko1@atdot.net>
-
- * thread_pthread.h : fix error message
-
-
-2006-08-17(Thu) 12:23:52 +0900 Koichi Sasada <ko1@atdot.net>
-
- * eval.c : change initilize routine order ([yarv-dev:1067])
-
- * yarvcore.c (Init_yarv) : init th->machine_stack_start
-
- * thread_pthread.h : add malloc value check ([yarv-dev:1066])
-
- * insns.def (opt_eq) : fix typo ([yarv-dev:1072])
-
- * yarvtest/test_opts.rb : add a test for above
-
- * yarvtest/test_class.rb : add a test for last commit
-
-
-2006-08-17(Thu) 11:02:16 +0900 Koichi Sasada <ko1@atdot.net>
-
- * class.c (clone_method) : check undef-ed method ([yarv-dev:1068])
-
-
-2006-08-15(Tue) 15:07:43 +0900 Koichi Sasada <ko1@atdot.net>
-
- * insns.def : fix opt_plus routine ([yarv-dev-en:149])
-
- * yarvtest/test_opts.rb : add tests for above
-
-
-2006-08-06(Sun) 06:24:51 +0900 Koichi Sasada <ko1@atdot.net>
-
- * common.mk : fix build rule (build only ruby binary when benchmark)
-
- * yarvcore.[ch] : fix and add yarv_iseq_new_with_* API
-
- * blockinlining.c : ditto
-
- * compile.c : ditto
-
- * compile.h : ditto
-
- * iseq.c : ditto
-
- * eval_method.h : check redefinition for specialized instruction
-
- * insnhelper.h : ditto
-
- * insns.def : ditto
-
- * vm.c : ditto
-
- * vm.h : ditto
-
- * numeric.c : add Fixnum#succ
-
- * thread.c : remove duplicated method Thread#current
-
- * yarvcore.c : remove duplicated method Proc#clone
-
- * yarvtest/test_opts.rb : added
-
-
-2006-07-20(Thu) 04:10:13 +0900 Koichi Sasada <ko1@atdot.net>
-
- * compile.c : fix [yarv-dev:1041] problem (raise TypeError)
-
- * eval.c : rb_funcall2 send as NOEX_PRIVATE and check scope
-
-
-2006-07-20(Thu) 03:38:46 +0900 Koichi Sasada <ko1@atdot.net>
-
- * yarvcore.c : fix [yarv-dev:1040] bug
-
-
-2006-07-18(Tue) 18:45:52 +0900 Koichi Sasada <ko1@atdot.net>
-
- * some files : set property "svn:eol-style" as native
-
-
-2006-07-18(Tue) 18:35:55 +0900 Koichi Sasada <ko1@atdot.net>
-
- * gc.h : fix a static function name
-
- * vm.c : remove Japanese comments
-
- * yarvcore.c : add a comment
-
- * some files : set property "svn:eol-style" as native
-
-
-2006-07-18(Tue) 16:48:01 +0900 Koichi Sasada <ko1@atdot.net>
-
- * vm.c : remove unused code
-
- * compile.c : add checking value
-
- * iseq.c : ditto
-
- * yarvcore.c : fix yarv_th_eval prototype declaration
-
- * yarvtest/yarvtest.rb : use compile instead of parse method
-
-
-2006-07-12(Wed) 15:18:58 +0900 Koichi Sasada <ko1@atdot.net>
-
- * yarv_version.h : 0.4.1
-
- * Changes : ditto
-
-
-2006-07-12(Wed) 13:38:03 +0900 Koichi Sasada <ko1@atdot.net>
-
- * eval.c : fix indent
-
- * gc.h : fix syntax bug
-
- * thread_pthread.h : vanish warnning message
-
- * iseq.c : ditto
-
- * compile.c : ditto
-
- * thread.c : ditto
-
- * vm.c : ditto
-
- * yarvcore.c : prohibit tail call optimization to mark
- iseq object
-
- * yarvcore.h : add some allocator function declaration
-
- * yarvtest/test_eval.rb : remove output
-
-
-2006-07-12(Wed) 05:01:23 +0900 Koichi Sasada <ko1@atdot.net>
-
- * yarvcore.c : undef alloc funcs
-
- * eval_proc.c : ditto (use factory faction)
-
- * thread.c : ditto
-
- * vm.c : ditto
-
- * iseq.c : fix compile option creation
-
- * rb/allload.rb : use compile_file method
-
- * rb/compile.rb : ditto
-
- * rb/parse.rb : ditto
-
- * template/insnstbl.html : hide mail addr
-
-
-2006-07-11(Tue) 21:34:29 +0900 Minero Aoki <aamine@loveruby.net>
-
- * test/ruby/test_dir.rb: new test test_JVN_13947696.
-
-
-2006-07-11(Tue) 21:26:41 +0900 Minero Aoki <aamine@loveruby.net>
-
- * test/ruby/test_alias.rb: new test test_JVN_83768862.
-
-
-2006-07-11(Tue) 11:33:49 +0900 Koichi Sasada <ko1@atdot.net>
-
- * compile.c : fix compile error on C90
-
-
-2006-07-11(Tue) 10:40:23 +0900 Koichi Sasada <ko1@atdot.net>
-
- * disasm.c : removed
-
- * iseq.c : added
-
- * common.mk : ditto
-
- * blockinlining.c : Get*Val => Get*Ptr
-
- * eval.c : ditto
-
- * yarvcore.c : ditto
-
- * eval_proc.c : ditto
-
- * vm_dump.c : ditto
-
- * vm_macro.def : ditto
-
- * signal.c : ditto
-
- * vm.c : ditto
-
- * thread.c : ditto
-
- * compile.c : rename local variable insnobj => iobj
-
- * compile.c : support yarv_compile_option_t
-
- * gc.h : added
-
- * insns.def : use OPT_CHECKED_RUN instead of IGNORE_OPTIMIZE
-
- * rb/compile.rb : use compile option
-
- * template/optinsn.inc.tmpl : fix function name
-
- * vm_opts.h.base : change macros
-
- * rb/insns2vm.rb : ditto
-
- * yarv.h : fix yarvcore_eval_parsed parameter type
-
- * yarvcore.c : fix some interfaces (functions)
-
- * yarvcore.h : add a type yarv_compile_option_t
-
-
-2006-07-06(Thu) 13:45:20 +0900 Koichi Sasada <ko1@atdot.net>
-
- * lib/yasm.rb : pass builder object if block arity == 1
-
-
-2006-07-05(Wed) 11:23:50 +0900 Koichi Sasada <ko1@atdot.net>
-
- * lib/yasm.rb : fix method name
-
- * vm.c (th_set_top_stack) : check toplevel or not
-
-
-2006-07-04(Tue) 20:05:38 +0900 Koichi Sasada <ko1@atdot.net>
-
- * rb/compile.rb : added
-
- * yarvtest/yarvtest.rb : disable load/store test
-
-
-2006-07-04(Tue) 18:17:15 +0900 Koichi Sasada <ko1@atdot.net>
-
- * compile.c : fix some bugs about load iseq data
-
- * disasm.c : ditto (store)
-
- * eval.c (rb_f_local_variables) : fix bugs
-
- * insns.def : fix otp_ltlt condition bug
-
- * vm.c : ditto
-
- * yarvcore.c : rename some functions
-
- * yarvtest/yarvtest.rb : add iseq load/store tests
- (to enable this, remove comment)
-
-
-2006-07-03(Mon) 01:54:23 +0900 Koichi Sasada <ko1@atdot.net>
-
- * eval_thread.c : add parameter "th" to thread_set_raised
-
- * yarvcore.h : ditto
-
- * eval_intern.h : ditto
-
- * eval.c : ditto
-
- * eval_error.h : declare with ANSI style
-
- * disasm.c : rename iseq_iseq2simpledata() to iseq_data_to_ary
-
- * lib/yasm.rb : rename Instruction#to_simpledata to
- Instruction#to_a
-
- * yarvcore.c : ditto
-
- * vm.c : fix bug (Proc.new{|*args| p args}.call(1) #=> 1)
-
- * yarvtest/test_proc.rb : add a tests for above
-
-
-2006-06-21(Wed) 09:19:06 +0900 Koichi Sasada <ko1@atdot.net>
-
- * compile.c : remove yarv_iseq_t#catch_table_ary and
- add yarv_iseq_t#compile_data#catch_table_ary
-
- * compile.h : ditto
-
- * yarvcore.c : ditto
-
- * yarvcore.h : ditto
-
- * eval_thread.c : remove unused code
-
- * thread.c : add rb_gc_mark_threads() (from eval_thread.c)
-
-
-2006-05-31(Wed) 21:26:38 +0900 Koichi Sasada <ko1@atdot.net>
-
- * parse.y : prohibit tail call optimization to mark vparsr
- object
-
-
-2006-05-25(Thu) 15:37:11 +0900 Koichi Sasada <ko1@atdot.net>
-
- * blockinlining.c : support NEW_ATTRASGN node
-
- * class.c : skip undefined method to collect ([yarv-dev:999])
-
- * yarvtest/test_class.rb : add a test for above
-
- * compile.c : fix opt_regexpmatch1 condition
-
- * lib/monitor.rb : fix [yarv-dev:1009]
-
- * rb/insns2vm.rb : fix typo
-
- * thread.c : prohibit unlock by not mutex owner thread
-
- * vm_opts.h.base : change default option
-
-
-2006-05-18(Thu) 16:00:50 +0900 Koichi Sasada <ko1@atdot.net>
-
- * intern.h : fix prototype declarations for last re.c change
-
-
-2006-05-18(Thu) 12:12:03 +0900 Koichi Sasada <ko1@atdot.net>
-
- * rb/runruby.rb : added
-
- * thread.c (rb_thread_alone) : check if vm->living_threads
- is available
-
-
-2006-05-18(Thu) 12:05:35 +0900 Koichi Sasada <ko1@atdot.net>
-
- * signal.c : not mask SIGSEGV
-
- * thread.c : fix debug output on Win32
-
- * thread.c, thread_pthread.h : add some debug prints
-
- * yarvcore.c : mark machine registers on thread_mark
-
-
-2006-05-17(Wed) 18:09:20 +900 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * dir.c (sys_warning): should not call a vararg function
- rb_sys_warning() indirectly. [ruby-core:07886]
-
-
-2006-05-17(Wed) 16:41:41 +900 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * re.c (rb_reg_initialize): should not allow modifying literal
- regexps. frozen check moved from rb_reg_initialize_m as well.
-
- * re.c (rb_reg_initialize): should not modify untainted objects in
- safe levels higher than 3.
-
- * re.c (rb_memcmp): type change from char* to const void*.
-
- * dir.c (dir_close): should not close untainted dir stream.
-
- * dir.c (GetDIR): add tainted/frozen check for each dir operation.
-
-
-2006-05-07(Sun) 21:06:28 +0900 Koichi Sasada <ko1@atdot.net>
-
- * thread.c : remove Mutex#unlock_and_stop and add Mutex#sleep
-
- * lib/monitor.rb : ditto
-
- * lib/thread.rb : ditto
-
- * thread_pthread.h : fix stack size
-
- * thread_win32.h : fix sleep
-
- * yarvcore.h : disable to use get/setcontext
-
- * lib/webrick/server.rb : add experimental implementation
- using thraeds pool
-
-
-2006-05-05(Fri) 13:59:00 +0900 Koichi Sasada <ko1@atdot.net>
-
- * test/ruby/test_signal.rb : disable a test
-
- * thread.c : do trylock before lock on mutex_lock
-
- * thread_win32.h : use CriticalSection instead of Mutex
-
-
-2006-05-05(Fri) 03:03:22 +0900 Koichi Sasada <ko1@atdot.net>
-
- * common.mk : vtune rule make run test.rb
-
- * disasm.c : fix syntax errors (on VC)
-
- * yarvcore.c : ditto
-
- * lib/thread.rb : Mutex#synchronize is defined here
-
- * lib/*.rb : ditto
-
- * signal.c : separate pthread or not
-
- * thread.c : support lightweight wakeup
-
- * thread_pthread.h : ditto
-
- * thread_win32.h : ditto
-
- * yarvcore.h : ditto
-
- * yarvtest/test_thread.rb : restore last change
-
-
-2006-05-04(Thu) 18:11:43 +0900 Koichi Sasada <ko1@atdot.net>
-
- * eval_thread.c : remove rb_thread_interrupt
-
- * intern.h : ditto
-
- * signal.c : change signal transfer route
-
- * thread.c : ditto
-
- * thread_pthread.h : ditto
-
- * thread_win32.h : ditto
-
- * yarv.h : support GET_VM()
-
- * yarvcore.h : change yarv_thread_t/yarv_vm_t structure
-
- * yarvtest/test_thread.rb : decrease threads to test
-
-
-2006-05-04(Thu) 00:26:18 +0900 Koichi Sasada <ko1@atdot.net>
-
- * thread_pthread.h : experimental support of thread cache
-
-
-2006-04-25(Tue) 22:30:14 +0900 Koichi Sasada <ko1@atdot.net>
-
- * yarvcore.h : remove struct yarv_cmethod_info, add
- data structure for profiling and extend yarv_control_frame_t
-
- * vm.c : make pop_frame() and apply above change
-
- * eval.c : ditto
-
- * vm_dump.c : ditto
-
- * vm_macro.def : ditto
-
- * insns.def (leave): use pop_frame() instead of
- POP_CONTROL_STACK_FRAME() macro
-
- * insnhelper.h : remove some macros
-
- * yarvcore.c : change th_set_top_stack() prototype
-
-
-2006-04-18(Tue) 18:37:08 +0900 Koichi Sasada <ko1@atdot.net>
-
- * compile.c, disasm.c : support export/import exception
- information
-
- * yarvcore.h : change "struct catch_table_entry" member variable
- order
-
-
-2006-04-13(Thu) 17:11:30 +0900 Koichi Sasada <ko1@atdot.net>
-
- * bignum.c : import ruby 1.9 HEAD (Ruby 1.9.0 2006-04-08)
-
- * dir.c : ditto
-
- * enumerator.c : ditto
-
- * ext/.document : ditto
-
- * ext/extmk.rb : ditto
-
- * ext/nkf/lib/kconv.rb : ditto
-
- * ext/nkf/nkf-utf8/nkf.c : ditto
-
- * ext/nkf/nkf-utf8/utf8tbl.c : ditto
-
- * ext/nkf/nkf.c : ditto
-
- * ext/nkf/test.rb : ditto
-
- * ext/socket/.cvsignore : ditto
-
- * ext/win32ole/sample/excel2.rb : ditto
-
- * ext/win32ole/tests/testOLEMETHOD.rb : ditto
-
- * ext/win32ole/tests/testOLEPARAM.rb : ditto
-
- * ext/win32ole/tests/testOLETYPE.rb : ditto
-
- * ext/win32ole/tests/testOLETYPELIB.rb : ditto
-
- * ext/win32ole/tests/testOLEVARIABLE.rb : ditto
-
- * ext/win32ole/tests/testOLEVARIANT.rb : ditto
-
- * ext/win32ole/tests/testWIN32OLE.rb : ditto
-
- * ext/win32ole/tests/testall.rb : ditto
-
- * ext/win32ole/win32ole.c : ditto
-
- * gc.c : ditto
-
- * instruby.rb : ditto
-
- * io.c : ditto
-
- * lib/delegate.rb : ditto
-
- * lib/fileutils.rb : ditto
-
- * lib/find.rb : ditto
-
- * lib/irb/ruby-lex.rb : ditto
-
- * lib/mkmf.rb : ditto
-
- * lib/net/http.rb : ditto
-
- * lib/open-uri.rb : ditto
-
- * lib/pathname.rb : ditto
-
- * lib/rational.rb : ditto
-
- * lib/rdoc/parsers/parse_rb.rb : ditto
-
- * lib/rdoc/ri/ri_paths.rb : ditto
-
- * lib/resolv.rb : ditto
-
- * lib/test/unit/collector/objectspace.rb : ditto
-
- * lib/webrick/httpservlet/cgihandler.rb : ditto
-
- * math.c : ditto
-
- * mkconfig.rb : ditto
-
- * object.c : ditto
-
- * oniguruma.h : ditto
-
- * pack.c : ditto
-
- * parse.y : ditto
-
- * re.c : ditto
-
- * re.h : ditto
-
- * regcomp.c : ditto
-
- * regerror.c : ditto
-
- * regparse.c : ditto
-
- * ruby.h : ditto
-
- * rubytest.rb : ditto
-
- * runruby.rb : ditto
-
- * string.c : ditto
-
- * test/digest/test_digest.rb : ditto
-
- * test/pathname/test_pathname.rb : ditto
-
- * test/ruby/envutil.rb : ditto
-
- * test/ruby/test_float.rb : ditto
-
- * test/ruby/test_pack.rb : ditto
-
- * time.c : ditto
-
- * util.c : ditto
-
- * version.h : ditto
-
- * win32/mkexports.rb : ditto
-
- * win32/resource.rb : ditto
-
- * win32/win32.c : ditto
-
-
-2006-04-11(Tue) 11:26:53 +0900 Koichi Sasada <ko1@atdot.net>
-
- * rb/yasm.rb : move to lib/yasm.rb
-
-
-2006-04-09(Sun) 03:04:04 +0900 Koichi Sasada <ko1@atdot.net>
-
- * compile.c : change to accept method iseq object when loading from
- simple data
-
- * yarvcore.c : add a debug output
-
- * rb/yasm.rb : change some interfaces
-
-
-2006-04-07(Fri) 20:25:03 +0900 Koichi Sasada <ko1@atdot.net>
-
- * compile.c : fix miss about range of catch "next"
-
- * eval.c : add braces
-
-
-2006-04-07(Fri) 11:09:43 +0900 Koichi Sasada <ko1@atdot.net>
-
- * common.mk : fix some make rules
-
- * insns.def : rename some instructions name
-
- * rb/insns2vm.rb : change some operand type name
-
- * vm_evalbody.h : ditto
-
- * template/insns.inc.tmpl : add YARV_MAX_INSTRUCTION_SIZE macro
-
- * compile.c, disasm.c, yarvcore.c : support load/store iseq from/to simple
- data structure such as array, literals, and so on
-
- * rb/yasm.rb : supported
-
- * vm.c : change interface of eval_define_method
-
- * yarvcore.h : remove unused externals
-
-
-2006-03-08(Wed) 10:31:29 +0900 Minero Aoki <aamine@loveruby.net>
-
- * lib/delegate.rb (DelegateClass): do not delegate #send and
- #funcall.
-
-
-2006-02-27(Mon) 22:39:17 +0900 Minero Aoki <aamine@loveruby.net>
-
- * lib/thread.rb: last commit causes busy loop, revert it. [yarv-dev:990]
-
- * lib/thread.rb: non_block=true wrongly caused ThreadError.
-
-
-2006-02-27(Mon) 21:33:49 +0900 Koichi Sasada <ko1@atdot.net>
-
- * common.mk : fix to display command line
-
- * compile.c : fix comparison between a pointer and 0
-
- * debug.c : fix to output stder
-
- * disasm.c : add debug function
-
- * vm_dump.c : ditto
-
- * eval_proc.c : fix to skip class definition
-
- * ruby.h : fix T_VALUE to T_VALUES
-
- * gc.c : ditto
-
- * node.h : fix prototypes
-
- * vm.c : add VM_DEBUG macro
-
- * vm.c : fix compile error on VC++
-
- * vm.c : fix to inherit last lfp[0] on th_set_finish_env
-
- * vm.c : fix to add one svar location for any frame
-
- * vm_macro.def : ditto
-
- * yarvcore.h : add YARV_CLASS_SPECIAL_P() and YARV_BLOCK_PTR_P()
-
- * rdoc/ : removed
-
- * insns.def : fix to propagete throw state
-
-
-2006-02-27(Mon) 13:54:47 +0900 Minero Aoki <aamine@loveruby.net>
-
- * ext/syslog: imported from Ruby CVS trunk HEAD.
-
- * ext/racc: ditto.
-
-
-2006-02-27(Mon) 12:47:10 +0900 Minero Aoki <aamine@loveruby.net>
-
- * parse.y: follow coding style change.
-
-
-2006-02-27(Mon) 11:53:07 +0900 Minero Aoki <aamine@loveruby.net>
-
- * lib/README: imported from Ruby CVS trunk HEAD.
-
- * lib/gserver.rb: ditto.
-
- * lib/readbytes.rb: ditto.
-
- * lib/parsearg.rb: ditto.
-
- * lib/racc: ditto.
-
- * lib/rinda: ditto.
-
-
-2006-02-27(Mon) 11:27:19 +0900 Minero Aoki <aamine@loveruby.net>
-
- * lib/thread.rb (Queue#pop): faster code. [yarv-dev:973]
-
- * lib/thread.rb (Queue#pop): avoid to push same thread in to
- @waiting.
-
-
-2006-02-23(Thu) 23:32:53 +0900 Minero Aoki <aamine@loveruby.net>
-
- * lib/open3.rb: imported from Ruby CVS trunk HEAD (rev 1.12).
-
-
-2006-02-23(Thu) 15:10:09 +0900 Koichi Sasada <ko1@atdot.net>
-
- * eval.c : support rb_frame_self()
-
- * eval_intern.h (th_get_ruby_level_cfp) : return 0 if no cfp
-
- * eval_load.c : comment out scope set
-
- * yarvcore.c : fix to initialize/free process of iseq
-
- * vm.c (th_invoke_proc) : fix to set special cref always
-
- * yarvtest/test_proc.rb : add a test for above
-
-
-2006-02-22(Wed) 23:33:47 +0900 Koichi Sasada <ko1@atdot.net>
-
- * common.mk : add rule "runruby"
-
- * eval_thread.c : remove obsolete comment
-
- * eval.c : remove unused functions
-
- * signal.c : ditto
-
- * gc.c : add rb_register_mark_object() and use it
-
- * eval_load.c : ditto
-
- * eval_proc.c : ditto
-
- * ext/etc/etc.c : ditto
-
- * ext/win32ole/win32ole.c : ditto
-
- * ruby.h : ditto
-
- * yarvcore.h : ditto
-
- * thread.c : add rb_thread_run_parallel()
-
- * yarvcore.c : change bootstrap
-
-
-2006-02-22(Wed) 19:27:33 +0900 Koichi Sasada <ko1@atdot.net>
-
- * ext/win32ole/.cvsignore : removed
-
- * ext/win32ole/.document : ditto
-
-
-2006-02-22(Wed) 18:17:06 +0900 Koichi Sasada <ko1@atdot.net>
-
- * yarvcore.c : set Binding as YARVCore::VM::Binding
-
-
-2006-02-22(Wed) 12:54:45 +0900 Koichi Sasada <ko1@atdot.net>
-
- * ChangeLog : remove needless line
-
-
-2006-02-22(Wed) 12:49:02 +0900 Koichi Sasada <ko1@atdot.net>
-
- * rubysig.h : remove CHECK_INTS
-
- * eval.c : ditto
-
- * eval_load.c : ditto
-
- * ext/readline/readline.c : ditto
-
- * thread.c : ditto
-
- * win32/win32.c : ditto
-
- * yarv_version.h : 0.4.0
-
- * Changes : ditto
-
-
-2006-02-22(Wed) 11:36:04 +0900 Koichi Sasada <ko1@atdot.net>
-
- * test.rb : removed
-
-
-2006-02-22(Wed) 11:12:17 +0900 Koichi Sasada <ko1@atdot.net>
-
- * README : renewed
-
- * version.c : fixed version message
-
- * yarvext/ : removed
-
-
-2006-02-22(Wed) 10:33:04 +0900 Koichi Sasada <ko1@atdot.net>
-
- * lib/.document : imported from Ruby 1.9 HEAD
-
- * .document : ditto
-
- * ext/.document : ditto
-
- * lib/ftools.rb : ditto
-
- * lib/rdoc/ : ditto
-
- * eval_thread.c : remove unused functions
-
- * process.c : ditto
-
- * rb/insns2vm.rb : compare modified date of vm_opts.h and
- vm_opts.h.base
-
- * ruby.h : rename RValue to RValues
-
- * gc.c : ditto
-
- * vm.c : ditto
-
-
-2006-02-22(Wed) 06:32:10 +0900 Koichi Sasada <ko1@atdot.net>
-
- * configure.in : remove last commit
-
-
-2006-02-22(Wed) 06:18:53 +0900 Koichi Sasada <ko1@atdot.net>
-
- * configure.in : add default program prefix "-yarv"
-
-
-2006-02-22(Wed) 06:11:36 +0900 Koichi Sasada <ko1@atdot.net>
-
- * common.mk : change default rule (same as HEAD)
-
- * configure : removed
-
- * eval.c : remove last commit
-
- * vm.c : fix stack traverse
-
- * yarvcore.c : initialize top of control frame
-
- * version.c : 2.0
-
- * version.h : ditto
-
-
-2006-02-22(Wed) 04:50:42 +0900 Koichi Sasada <ko1@atdot.net>
-
- * eval.c : change to rewind C level control frame
-
- * vm.c : change to initialize cfp#proc and fix comparison of
- cfp and limit_cfp
-
- * yarvcore.c : remove last commit
-
-
-2006-02-22(Wed) 03:25:56 +0900 Koichi Sasada <ko1@atdot.net>
-
- * yarvcore.c : initialize each stack of thread
-
-
-2006-02-22(Wed) 00:02:08 +0900 Koichi Sasada <ko1@atdot.net>
-
- * thread.c : fix synchornize return value ([yarv-dev:957])
- and some synchornization error
-
- * thread_pthread.h : add debug helper function
-
-
-2006-02-21(Tue) 20:54:28 +0900 Koichi Sasada <ko1@atdot.net>
-
- * eval.c : fix place of rb_thread_terminate_all()
-
- * eval_thread.c : remove unused functions
-
- * yarv.h : remove GET_VM()
-
- * eval_jump.h : ditto
-
- * insns.def : ditto
-
- * vm_dump.c :
-
- * intern.h : change rb_thread_signal_raise/exit interface
-
- * signal.c : ditto
-
- * thread.c : ditto
-
- * test/ruby/test_beginendblock.rb : use block with IO.popen
-
- * thread_pthread.h : fix interrupt process
-
- * thread_win32.h : ditto
-
- * yarvcore.c : fix thread free process
-
- * yarvcore.h : remove yarv_vm_t#thread_critical, etc
-
-
-2006-02-21(Tue) 12:42:44 +0900 Koichi Sasada <ko1@atdot.net>
-
- * eval_thread.c : remove unused function rb_thread_schedule()
-
- * thread.c : rename yarv_thread_schedule to rb_thread_schedule()
-
- * thread.c, eval.c : fix to terminate all thread and barrier at
- eval.c#ruby_cleanup()
-
- * thread_win32.h : remove native_thread_cleanup()
-
- * thread_pthread.h : ditto
-
- * yarvcore.c : ditto
-
- * yarvtest/test_thread.rb : separete assersions to tests
-
-
-2006-02-21(Tue) 02:13:33 +900 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * parse.y (f_arglist): should set command_start = Qtrue for
- command body. [ruby-talk:180648]
-
-
-2006-02-20(Mon) 20:41:07 +0900 Koichi Sasada <ko1@atdot.net>
-
- * thread.c : fix to synchronize signal_thread_list access
- and fix typo
-
-
-2006-02-20(Mon) 17:54:58 +0900 Koichi Sasada <ko1@atdot.net>
-
- * eval_proc.c : remove unused Binding functions and
- set is_lambda of Proc used define_method
-
- * yarvcore.c : support Proc#dup/clone, Binding#dup/clone
-
- * sample/test.rb : remove unsupport features (Proc as Binding)
-
-
-2006-02-20(Mon) 16:28:59 +0900 Koichi Sasada <ko1@atdot.net>
-
- * common.mk : add a dependency to vm.c on eval_intern.h
-
- * eval_intern.h : fix to initialize tag->tag
-
- * yarvtest/test_jump.rb : add tests for above
-
- * eval_jump.h : use local variable
-
-
-2006-02-20(Mon) 15:13:24 +0900 Koichi Sasada <ko1@atdot.net>
-
- * benchmark/bm_vm3_thread_create_join.rb : added
-
- * test/yaml/test_yaml.rb : imported from Ruby CVS trunk HEAD
-
-
-2006-02-20(Mon) 14:49:46 +0900 Minero Aoki <aamine@loveruby.net>
-
- * lib/yaml.rb: imported from Ruby CVS trunk HEAD.
-
- * lib/yaml: ditto.
-
- * ext/syck: ditto.
-
-
-2006-02-20(Mon) 13:58:03 +0900 Koichi Sasada <ko1@atdot.net>
-
- * compile.c : support block parameter which is NODE_ATTRASGN
-
- * yarvtest/test_block.rb : add tests for above
-
- * compile.c : fix NODE_DASGN_CURR level check
-
- * compile.c : fix "||=" (at firtst, check "defined? val")
-
- * compile.c : fix NODE_MATCH3 (permute receiver and argument)
-
- * yarvtest/test_bin.rb : add tests for above
-
- * eval.c : add rb_each()
-
- * test/ruby/test_signal.rb : increment a timeout value
-
- * thread.c, yarvcore.h : fix "join" flow
-
- * thread_pthread.h : ditto
-
- * thread_win32.h : ditto
-
- * yarvtest/test_thread.rb : add a test for above
-
- * vm.h, vm.c, vm_dump.c, insns.def : add FRAME_MAGIC_LAMBDA and
- support return from lambda (especially retrun from method defined
- by "define_method")
-
- * yarvtest/test_method.rb : add a test for above
-
- * yarvcore.c : remove unused functions
-
-
-2006-02-20(Mon) 11:22:31 +0900 Minero Aoki <aamine@loveruby.net>
-
- * test/ruby/test_eval.rb: now Object#funcall is defined.
-
-
-2006-02-20(Mon) 11:04:32 +0900 Minero Aoki <aamine@loveruby.net>
-
- * lib/irb/lc/ja/CVS: removed.
-
-
-2006-02-20(Mon) 10:55:59 +0900 Minero Aoki <aamine@loveruby.net>
-
- * lib/mutex_m.rb: imported from Ruby CVS trunk HEAD.
-
- * lib/observer.rb: ditto.
-
- * lib/wsdl: ditto.
-
- * lib/monitor.rb: ditto (removing Thread.critical=).
-
- * lib/xsd: ditto.
-
- * lib/soap: ditto.
-
- * lib/drb.rb: ditto.
-
- * lib/drb: ditto.
-
-
-2006-02-20(Mon) 10:49:31 +0900 Minero Aoki <aamine@loveruby.net>
-
- * yarvcore.c (Init_yarvcore): fix typo (duo -> dup).
-
-
-2006-02-19(Sun) 01:27:08 +0900 Koichi Sasada <ko1@atdot.net>
-
- * vm.c : "return" from lambda{} break block
-
- * eval.c : Unsupport Proc as Binding
-
- * test/ruby/test_eval.rb : apply above changes
-
- * yarvcore.c : remove unused function yarv_yield_values()
-
-
-2006-02-18(Sat) 03:19:36 +0900 Koichi Sasada <ko1@atdot.net>
-
- * thread.c, insns.def : fix passing value when thread killed
-
- * yarvtest/test_thread.rb : add tests for above
-
-
-2006-02-19(Sun) 01:19:42 +0900 Minero Aoki <aamine@loveruby.net>
-
- * lib/thread.rb (SizedQueue): didn't work. This patch was
- contributed by yukimizake. [yarv-dev:916]
-
-
-2006-02-18(Sat) 03:19:36 +0900 Koichi Sasada <ko1@atdot.net>
-
- * thread.c, insns.def : fix passing value when thread killed
-
- * yarvtest/test_thread.rb : add tests for above
-
-
-2006-02-18(Sat) 02:40:18 +0900 Koichi Sasada <ko1@atdot.net>
-
- * insns.def, vm.c, vm_macro.def : change BMETHOD algorithm
- ([yarv-dev:914])
-
- * yarvtest/test_class.rb : add a test for above
-
-
-2006-02-17(Fri) 23:59:51 +0900 Koichi Sasada <ko1@atdot.net>
-
- * vm.c, yarv.h : change th_invoke_proc() interface
-
- * eval_proc.c : ditto
-
- * signal.c : ditto
-
- * thread.c : ditto
-
- * yarvcore.c : ditto
-
- * vm_macro.def : ditto and fix NODE_BMETHOD call
-
- * vm.c : change name ("th_set_env()" to "push_frame()") and
- change interface
-
- * insns.def : ditto
-
- * eval.c : remove proc_jump_error()
-
- * benchmark/bm_app_answer.rb : added
-
- * vm_opts.h.base : add optimize option
-
-
-2006-02-17(Fri) 13:37:57 +0900 Koichi Sasada <ko1@atdot.net>
-
- * eval.c, ruby.h : add rb_errinfo()
-
- * eval_error.h (error_pos) : fix process order
-
- * bin/erb : imported from ruby 1.9
-
- * bin/irb : ditto
-
- * bin/rdoc : ditto
-
- * bin/ri : ditto
-
- * bin/testrb : ditto
-
- * ext/curses/.cvsignore : ditto
-
- * ext/curses/curses.c : ditto
-
- * ext/curses/depend : ditto
-
- * ext/curses/extconf.rb : ditto
-
- * ext/curses/hello.rb : ditto
-
- * ext/curses/mouse.rb : ditto
-
- * ext/curses/rain.rb : ditto
-
- * ext/curses/view.rb : ditto
-
- * ext/curses/view2.rb : ditto
-
- * ext/fcntl/.cvsignore : ditto
-
- * ext/fcntl/depend : ditto
-
- * ext/fcntl/extconf.rb : ditto
-
- * ext/fcntl/fcntl.c : ditto
-
- * ext/readline/README : ditto
-
- * ext/readline/README.ja : ditto
-
- * ext/readline/depend : ditto
-
- * ext/readline/extconf.rb : ditto
-
- * ext/readline/readline.c : ditto
-
- * ext/win32ole/.document : ditto
-
- * ext/zlib/doc/zlib.rd : ditto
-
- * ext/zlib/extconf.rb : ditto
-
- * ext/zlib/zlib.c : ditto
-
- * lib/cgi/.document : ditto
-
- * lib/cgi/session.rb : ditto
-
- * lib/cgi/session/pstore.rb : ditto
-
- * lib/shell/builtin-command.rb : ditto
-
- * lib/shell/command-processor.rb : ditto
-
- * lib/shell/error.rb : ditto
-
- * lib/shell/filter.rb : ditto
-
- * lib/shell/process-controller.rb : ditto
-
- * lib/shell/system-command.rb : ditto
-
- * lib/shell/version.rb : ditto
-
- * lib/xmlrpc/.document : ditto
-
- * lib/xmlrpc/README.rdoc : ditto
-
- * lib/xmlrpc/README.txt : ditto
-
- * lib/xmlrpc/base64.rb : ditto
-
- * lib/xmlrpc/client.rb : ditto
-
- * lib/xmlrpc/config.rb : ditto
-
- * lib/xmlrpc/create.rb : ditto
-
- * lib/xmlrpc/datetime.rb : ditto
-
- * lib/xmlrpc/httpserver.rb : ditto
-
- * lib/xmlrpc/marshal.rb : ditto
-
- * lib/xmlrpc/parser.rb : ditto
-
- * lib/xmlrpc/server.rb : ditto
-
- * lib/xmlrpc/utils.rb : ditto
-
- * rdoc/README : ditto
-
- * rdoc/code_objects.rb : ditto
-
- * rdoc/diagram.rb : ditto
-
- * rdoc/dot/dot.rb : ditto
-
- * rdoc/generators/chm_generator.rb : ditto
-
- * rdoc/generators/html_generator.rb : ditto
-
- * rdoc/generators/ri_generator.rb : ditto
-
- * rdoc/generators/template/chm/chm.rb : ditto
-
- * rdoc/generators/template/html/hefss.rb : ditto
-
- * rdoc/generators/template/html/html.rb : ditto
-
- * rdoc/generators/template/html/kilmer.rb : ditto
-
- * rdoc/generators/template/html/old_html.rb : ditto
-
- * rdoc/generators/template/html/one_page_html.rb : ditto
-
- * rdoc/generators/template/xml/rdf.rb : ditto
-
- * rdoc/generators/template/xml/xml.rb : ditto
-
- * rdoc/generators/xml_generator.rb : ditto
-
- * rdoc/markup/sample/rdoc2latex.rb : ditto
-
- * rdoc/markup/sample/sample.rb : ditto
-
- * rdoc/markup/simple_markup.rb : ditto
-
- * rdoc/markup/simple_markup/fragments.rb : ditto
-
- * rdoc/markup/simple_markup/inline.rb : ditto
-
- * rdoc/markup/simple_markup/lines.rb : ditto
-
- * rdoc/markup/simple_markup/preprocess.rb : ditto
-
- * rdoc/markup/simple_markup/to_flow.rb : ditto
-
- * rdoc/markup/simple_markup/to_html.rb : ditto
-
- * rdoc/markup/simple_markup/to_latex.rb : ditto
-
- * rdoc/markup/test/AllTests.rb : ditto
-
- * rdoc/markup/test/TestInline.rb : ditto
-
- * rdoc/markup/test/TestParse.rb : ditto
-
- * rdoc/options.rb : ditto
-
- * rdoc/parsers/parse_c.rb : ditto
-
- * rdoc/parsers/parse_f95.rb : ditto
-
- * rdoc/parsers/parse_rb.rb : ditto
-
- * rdoc/parsers/parse_simple.rb : ditto
-
- * rdoc/parsers/parserfactory.rb : ditto
-
- * rdoc/rdoc.rb : ditto
-
- * rdoc/ri/ri_cache.rb : ditto
-
- * rdoc/ri/ri_descriptions.rb : ditto
-
- * rdoc/ri/ri_display.rb : ditto
-
- * rdoc/ri/ri_driver.rb : ditto
-
- * rdoc/ri/ri_formatter.rb : ditto
-
- * rdoc/ri/ri_options.rb : ditto
-
- * rdoc/ri/ri_paths.rb : ditto
-
- * rdoc/ri/ri_reader.rb : ditto
-
- * rdoc/ri/ri_util.rb : ditto
-
- * rdoc/ri/ri_writer.rb : ditto
-
- * rdoc/template.rb : ditto
-
- * rdoc/tokenstream.rb : ditto
-
- * rdoc/usage.rb : ditto
-
- * test/xmlrpc/data/bug_bool.expected : ditto
-
- * test/xmlrpc/data/bug_bool.xml : ditto
-
- * test/xmlrpc/data/bug_cdata.expected : ditto
-
- * test/xmlrpc/data/bug_cdata.xml : ditto
-
- * test/xmlrpc/data/bug_covert.expected : ditto
-
- * test/xmlrpc/data/bug_covert.xml : ditto
-
- * test/xmlrpc/data/datetime_iso8601.xml : ditto
-
- * test/xmlrpc/data/fault.xml : ditto
-
- * test/xmlrpc/data/value.expected : ditto
-
- * test/xmlrpc/data/value.xml : ditto
-
- * test/xmlrpc/data/xml1.expected : ditto
-
- * test/xmlrpc/data/xml1.xml : ditto
-
- * test/xmlrpc/test_datetime.rb : ditto
-
- * test/xmlrpc/test_features.rb : ditto
-
- * test/xmlrpc/test_marshal.rb : ditto
-
- * test/xmlrpc/test_parser.rb : ditto
-
- * test/xmlrpc/test_webrick_server.rb : ditto
-
- * test/xmlrpc/webrick_testing.rb : ditto
-
- * test/zlib/test_zlib.rb : ditto
-
-
-2006-02-17(Fri) 09:41:35 +900 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * thread.c (sleep_timeval): sleep should always sleep for
- specified amount of time. [ruby-talk:180067]
-
-
-2006-02-17(Fri) 02:20:32 +0900 Koichi Sasada <ko1@atdot.net>
-
- * eval_safe.h, ruby.h : remove ruby_safe_level and add
- rb_safe_level() and rb_set_safe_level_force()
-
- * eval.c : use above functions
-
- * eval_jump.h : ditto
-
- * eval_load.c : ditto
-
- * eval_method.h : ditto
-
- * eval_proc.c : ditto
-
- * eval_thread.c : ditto
-
- * gc.c : ditto
-
- * signal.c : ditto
-
- * variable.c : ditto
-
- * ext/win32ole/win32ole.c : ditto
-
- * vm.c (th_invoke_proc) : save and restore safe level
-
- * yarvtest/test_proc.rb : add tests for above
-
- * thread.c : remove unused functions
-
-
-2006-02-17(Fri) 01:08:23 +0900 Koichi Sasada <ko1@atdot.net>
-
- * compile.c, insns.def : remove a setspecial second unused operand
-
- * eval_load.c : remove unused variable th
-
- * eval_proc.c, yarvcore.c : remove some functions from eval_proc.c
- and move to yarvcore.c
-
- * insns.def : fix to delete warnings
-
- * sample/test.rb : comment out Proc#clone tests
-
- * version.c : add constant RUBY_VM_DATE
-
- * vm.c : fix some functions
-
-
-2006-02-16(Thu) 22:58:27 +0900 Koichi Sasada <ko1@atdot.net>
-
- * insns.def, vm.c : use th_yield_setup_args at yield and Proc#call
-
-
-2006-02-16(Thu) 19:51:52 +0900 Koichi Sasada <ko1@atdot.net>
-
- * compile.c : fix analysis of block parameter
-
- * disasm.c : remove rb_bug() (temporarily)
-
- * insns.def, vm.c : fix passing block parameter
-
- * sample/test.rb : add "Proc = YARVCore::VM::Proc"
-
- * test/ruby/test_readpartial.rb : disable on mswin32
-
- * test/socket/test_tcp.rb : ditto
-
- * thread.c : fix syntax error (for non GCC)
-
-
-2006-02-15(Wed) 22:34:04 +0900 Koichi Sasada <ko1@atdot.net>
-
- * eval_method.h : move rb_clear_cache_by_id position
-
- * thread.c : fix Thread#kill
-
- * test/ruby/test_readpartial.rb : enable tests except cygwin version
-
- * test/ruby/test_signal.rb : ditto and enable timeout
-
-
-2006-02-15(Wed) 22:13:29 +0900 Minero Aoki <aamine@loveruby.net>
-
- * lib/runit: forgot to commit.
-
-
-2006-02-15(Wed) 22:12:25 +0900 Minero Aoki <aamine@loveruby.net>
-
- * lib/weakref.rb: do not use Thread.critical=.
-
- * lib/singleton.rb: ditto.
-
- * lib/timeout.rb: ditto.
-
- * lib/thread.rb: ditto.
-
- * test/inlinetest.rb: forgot to commit.
-
-
-2006-02-15(Wed) 21:34:17 +0900 Minero Aoki <aamine@loveruby.net>
-
- * test/test_pp.rb: imported from Ruby CVS trunk HEAD.
-
- * test/test_shellwords.rb: ditto.
-
- * test/test_set.rb: ditto.
-
- * test/test_time.rb: ditto.
-
- * test/test_ipaddr.rb: ditto.
-
- * test/test_prettyprint.rb: ditto.
-
- * test/test_tsort.rb: ditto.
-
- * test/strscan: ditto.
-
- * test/testunit: ditto.
-
-
-2006-02-15(Wed) 20:03:21 +0900 Koichi Sasada <ko1@atdot.net>
-
- * eval_method.h : duplicate NODE_METHOD at make an alias
-
- * yarvtest/test_method.rb : add a test for above
-
-
-2006-02-15(Wed) 19:48:59 +0900 Minero Aoki <aamine@loveruby.net>
-
- * test/rss: imported from Ruby CVS trunk HEAD.
-
-
-2006-02-15(Wed) 19:47:51 +0900 Koichi Sasada <ko1@atdot.net>
-
- * insns.def, compile.c, vm.c : remove methoddef, singletonmethoddef
- instructions and make new insn definemethod
-
- * yarvcore.c : set toplevel visibility to private
-
-
-2006-02-15(Wed) 17:39:16 +0900 Koichi Sasada <ko1@atdot.net>
-
- * eval_intern.h :
-
- * eval_jump.h, vm.c : localjump_error() and jump_tag_but_local_jump()
- move to th_localjump_error and th_jump_tag_but_local_jump at vm.c
-
- * eval.c : ditto
-
- * eval_load.c : ditto
-
- * insns.def : ditto
-
- * vm.c : ditto
-
- * vm.c (th_make_jump_tag_but_local_jump) : added
-
- * opt_insn_unif.def : fix indnet (revert change)
-
- * opt_operand.def : ditto
-
- * rb/insns2vm.rb : fix error message
-
- * thread.c : raise exception at join if illegal local jump
-
-
-2006-02-15(Wed) 14:21:45 +900 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * ChangeLog: add local variables line to support Emacs.
-
- * eval.c (rb_obj_instance_exec): add new method from 1.9.
-
- * eval.c (rb_mod_module_exec): ditto.
-
- * eval.c (yield_under_i): should not pass self as an argument to
- the block for instance_eval. [ruby-core:07364]
-
- * eval.c (rb_obj_instance_eval): should be no singleton classes for
- true, false, and nil. [ruby-dev:28186]
-
-
-2006-02-14(Tue) 19:30:20 +0900 Koichi Sasada <ko1@atdot.net>
-
- * array.c : fix indent
-
- * eval.c : fix block_given
-
- * gc.c : add STACK_START and use it as a substitute for
- rb_gc_stack_start
-
- * vm.c : fix to raise error if th_yield doesn't have block given
-
- * yarvcore.c : fix to skip iseq mark array at ObjectSpace.each_object
-
-
-2006-02-14(Tue) 18:15:03 +0900 Koichi Sasada <ko1@atdot.net>
-
- * configure.in : enable pthread by deafult
-
- * ascii.c : import ruby 1.9 HEAD
-
- * bignum.c : ditto
-
- * compar.c : ditto
-
- * configure : ditto
-
- * defines.h : ditto
-
- * dln.c : ditto
-
- * dln.h : ditto
-
- * enum.c : ditto
-
- * enumerator.c : ditto
-
- * euc_jp.c : ditto
-
- * ext/win32ole/tests/testWIN32OLE.rb : ditto
-
- * ext/win32ole/win32ole.c : ditto
-
- * file.c : ditto
-
- * hash.c : ditto
-
- * io.c : ditto
-
- * lex.c : ditto
-
- * lib/irb/init.rb : ditto
-
- * lib/rexml/document.rb : ditto
-
- * main.c : ditto
-
- * marshal.c : ditto
-
- * math.c : ditto
-
- * missing.h : ditto
-
- * object.c : ditto
-
- * oniguruma.h : ditto
-
- * pack.c : ditto
-
- * process.c : ditto
-
- * random.c : ditto
-
- * range.c : ditto
-
- * rb/ir.rb : ditto
-
- * re.c : ditto
-
- * regcomp.c : ditto
-
- * regenc.c : ditto
-
- * regenc.h : ditto
-
- * regerror.c : ditto
-
- * regexec.c : ditto
-
- * regint.h : ditto
-
- * regparse.c : ditto
-
- * regparse.h : ditto
-
- * ruby.c : ditto
-
- * ruby.h : ditto
-
- * rubyio.h : ditto
-
- * sjis.c : ditto
-
- * sprintf.c : ditto
-
- * st.c : ditto
-
- * st.h : ditto
-
- * struct.c : ditto
-
- * test/ruby/envutil.rb : ditto
-
- * test/ruby/test_struct.rb : ditto
-
- * time.c : ditto
-
- * utf8.c : ditto
-
- * util.c : ditto
-
- * util.h : ditto
-
- * version.h : ditto
-
- * win32/Makefile.sub : ditto
-
- * win32/win32.c : ditto
-
-
-2006-02-14(Tue) 16:40:01 +0900 Koichi Sasada <ko1@atdot.net>
-
- * yarvcore.c, eval_proc.c : fix rb_proc_arity
-
- * eval.c : declare funcall same as send (temporarily)
-
- * lib/thread.rb : added
-
- * test/pathname/test_pathname.rb : imported from ruby 1.9
-
- * test/scanf/data.txt : ditto
-
- * test/scanf/test_scanf.rb : ditto
-
- * test/scanf/test_scanfblocks.rb : ditto
-
- * test/scanf/test_scanfio.rb : ditto
-
- * test/socket/test_socket.rb : ditto
-
- * test/socket/test_tcp.rb : ditto
-
- * test/socket/test_udp.rb : ditto
-
- * test/socket/test_unix.rb : ditto
-
- * test/stringio/test_stringio.rb : ditto
-
- * test/uri/test_common.rb : ditto
-
- * test/uri/test_ftp.rb : ditto
-
- * test/uri/test_generic.rb : ditto
-
- * test/uri/test_http.rb : ditto
-
- * test/uri/test_ldap.rb : ditto
-
- * test/uri/test_mailto.rb : ditto
-
-
-2006-02-14(Tue) 15:59:28 +0900 Koichi Sasada <ko1@atdot.net>
-
- * thread.c : Change Thread.critical warnning message
-
- * lib/webrick.rb : imported from ruby 1.9
-
- * lib/webrick/accesslog.rb : ditto
-
- * lib/webrick/cgi.rb : ditto
-
- * lib/webrick/compat.rb : ditto
-
- * lib/webrick/config.rb : ditto
-
- * lib/webrick/cookie.rb : ditto
-
- * lib/webrick/htmlutils.rb : ditto
-
- * lib/webrick/httpauth.rb : ditto
-
- * lib/webrick/httpauth/authenticator.rb : ditto
-
- * lib/webrick/httpauth/basicauth.rb : ditto
-
- * lib/webrick/httpauth/digestauth.rb : ditto
-
- * lib/webrick/httpauth/htdigest.rb : ditto
-
- * lib/webrick/httpauth/htgroup.rb : ditto
-
- * lib/webrick/httpauth/htpasswd.rb : ditto
-
- * lib/webrick/httpauth/userdb.rb : ditto
-
- * lib/webrick/httpproxy.rb : ditto
-
- * lib/webrick/httprequest.rb : ditto
-
- * lib/webrick/httpresponse.rb : ditto
-
- * lib/webrick/https.rb : ditto
-
- * lib/webrick/httpserver.rb : ditto
-
- * lib/webrick/httpservlet.rb : ditto
-
- * lib/webrick/httpservlet/abstract.rb : ditto
-
- * lib/webrick/httpservlet/cgi_runner.rb : ditto
-
- * lib/webrick/httpservlet/cgihandler.rb : ditto
-
- * lib/webrick/httpservlet/erbhandler.rb : ditto
-
- * lib/webrick/httpservlet/filehandler.rb : ditto
-
- * lib/webrick/httpservlet/prochandler.rb : ditto
-
- * lib/webrick/httpstatus.rb : ditto
-
- * lib/webrick/httputils.rb : ditto
-
- * lib/webrick/httpversion.rb : ditto
-
- * lib/webrick/log.rb : ditto
-
- * lib/webrick/server.rb : ditto
-
- * lib/webrick/ssl.rb : ditto
-
- * lib/webrick/utils.rb : ditto
-
- * lib/webrick/version.rb : ditto
-
-
-2006-02-14(Tue) 14:55:51 +0900 Koichi Sasada <ko1@atdot.net>
-
- * compile.c, insns.def : support "defined?($1)", ...
-
- * yarvtest/test_syntax.rb : add a test for above
-
- * rb/makedocs.rb : fix template directory path
-
- * vm.c : fix to handle break from proc
-
-
-2006-02-14(Tue) 12:42:59 +0900 Koichi Sasada <ko1@atdot.net>
-
- * eval.c : fix rb_iterate hook
-
- * yarvtest/test_block.rb : add a tests for above
-
- * vm.c : remove unused comment
-
-
-2006-02-14(Tue) 12:01:06 +0900 Koichi Sasada <ko1@atdot.net>
-
- * eval.c : fix to check passed block at block_given_p
-
- * eval_proc.c : fix to pass block at Method#call
-
- * runruby.rb : fix to apply ruby
-
- * test/runner.rb : GC.stress (comment out)
-
- * vm.c : fix indnet
-
-
-2006-02-14(Tue) 08:04:33 +0900 Minero Aoki <aamine@loveruby.net>
-
- * lib/tempfile.rb: use Mutex instead of Thread.critical.
-
- * lib/rss/dublincore.rb: |x,| -> |x,_| to avoid YARV bug (tmp).
-
- * lib/rexml: imported from ruby CVS trunk HEAD.
-
- * test/digest: ditto.
-
- * test/fileutils: ditto.
-
- * test/ostruct: ditto.
-
- * test/erb: ditto.
-
- * test/optparse: ditto.
-
- * test/ruby/test_signal.rb: turn off a test to avoid unknown error
- (tmp).
-
-
-2006-02-14(Tue) 07:52:03 +0900 Minero Aoki <aamine@loveruby.net>
-
- * test/digest: imported from ruby CVS trunk HEAD.
-
- * test/fileutils: ditto.
-
- * test/ostruct: ditto.
-
- * test/erb: ditto.
-
- * test/optparse: ditto.
-
-
-2006-02-14(Tue) 06:26:21 +0900 Koichi Sasada <ko1@atdot.net>
-
- * compile.c, parse.y : support BEGIN{} (remove local scope)
-
- * test/ruby/beginmainend.rb : fix to apply YARV's specification
-
- * test/ruby/test_beginendblock.rb : enable BEGIN{} test
-
- * signal.c : exit at double segv
-
- * insns.def (preexe) : remove instruction "preexe"
-
-
-2006-02-14(Tue) 05:53:56 +0900 Minero Aoki <aamine@loveruby.net>
-
- * eval.c (ruby_cleanup): th->errinfo contains a NODE while
- break'ing, check it before refering klass.
-
-
-2006-02-14(Tue) 05:45:07 +0900 Koichi Sasada <ko1@atdot.net>
-
- * insns.def : fix stack calc of send
-
- * sample/test.rb : remove SEGV causing code
-
-
-2006-02-14(Tue) 02:24:21 +0900 Minero Aoki <aamine@loveruby.net>
-
- * test/ruby/test_module.rb: list order is not a matter.
-
- * test/csv: imported from ruby CVS trunk HEAD.
-
-
-2006-02-14(Tue) 02:06:25 +0900 Minero Aoki <aamine@loveruby.net>
-
- * test/ruby/test_beginendblock.rb: unlock tests.
-
- * test/ruby/beginmainend.rb: new file (imported from ruby CVS
- trunk HEAD).
-
- * test/ruby/endblockwarn.rb: new file (imported from ruby CVS
- trunk HEAD).
-
- * test/ruby/test_file.rb: new file (imported from ruby CVS trunk
- HEAD).
-
-
-2006-02-14(Tue) 01:42:11 +0900 Koichi Sasada <ko1@atdot.net>
-
- * error.c : fix include file positon
-
- * test/ruby/test_signal.rb : skip test_exit_action on cygwin
-
-
-2006-02-14(Tue) 01:36:57 +0900 Minero Aoki <aamine@loveruby.net>
-
- * test/ruby/test_class.rb: new file (imported from rubicon).
-
-
-2006-02-14(Tue) 01:32:23 +0900 Minero Aoki <aamine@loveruby.net>
-
- * test/ruby/test_module.rb: ignore PP mixins.
-
-
-2006-02-14(Tue) 01:24:56 +0900 Minero Aoki <aamine@loveruby.net>
-
- * test/ruby/test_lambda.rb: removed (->(){...} syntax is
- obsolete).
-
-
-2006-02-14(Tue) 01:20:54 +0900 Minero Aoki <aamine@loveruby.net>
-
- * test/ruby/test_module.rb: import many tests from rubicon.
-
-
-2006-02-14(Tue) 01:06:57 +0900 Koichi Sasada <ko1@atdot.net>
-
- * compile.c : fix to avoid stack consistency error
-
- * yarvtest/test_exception.rb : add a test for above
-
-
-2006-02-14(Tue) 00:42:47 +0900 Koichi Sasada <ko1@atdot.net>
-
- * yarvcore.h, vm_macro.def : rename VM_CALL_SUPER to VM_CALL_SUPER_BIT
-
- * insns.def (send) : set a flag of super as fcall
-
- * yarvtest/test_class.rb : add a test for above
-
-
-2006-02-14(Tue) 00:31:24 +0900 Minero Aoki <aamine@loveruby.net>
-
- * test/ruby/test_eval.rb: fix typo.
-
- * test/ruby/test_signal.rb: unlock tests.
-
-
-2006-02-13(Mon) 23:53:27 +0900 Koichi Sasada <ko1@atdot.net>
-
- * insns.def, vm_macro.def : fix NODE_ZSUPER dispatch and
- fix error message when super without suitable method ([yarv-dev:846])
-
- * yarvcore.h : add VM_CALL_SUPER definition
-
- * yarvtest/test_method.rb : add a test of Module#private_class_method
-
-
-2006-02-13(Mon) 22:49:42 +0900 Koichi Sasada <ko1@atdot.net>
-
- * insns.def : traverse all iseq to find super method ([yarv-dev:859])
-
- * yarvtest/test_class.rb : add a test for above
-
- * yarvcore.c : add clear iseq->defined_method_id
-
- * signal.c : fix to prohibit double segv handler kicked
-
-
-2006-02-13(Mon) 22:09:12 +0900 Koichi Sasada <ko1@atdot.net>
-
- * compile.c : support NODE_DECL, NODE_CLASS with NODE_CLON3 prefix
-
- * yarvtest/test_class.rb : add tests for above
-
-
-2006-02-13(Mon) 21:20:57 +0900 Koichi Sasada <ko1@atdot.net>
-
- * compile.c : fix indent
-
- * compile.c : fix to prohibit "redo" from eval expression
-
-
-2006-02-13(Mon) 20:36:06 +0900 Koichi Sasada <ko1@atdot.net>
-
- * vm.c : fix constant search bug ([yarv-dev:788])
-
- * yarvtest/test_class.rb : add a test of [yarv-dev:788]
-
-
-2006-02-13(Mon) 18:09:28 +0900 Koichi Sasada <ko1@atdot.net>
-
- * test/ruby/test_clone.rb : enable tests with Class#clone
-
- * test/ruby/test_marshal.rb : ditto
-
-
-2006-02-13(Mon) 17:42:37 +0900 Koichi Sasada <ko1@atdot.net>
-
- * class.c : support Class#clone
-
- * compile.c, insns.def : remove popcref
-
- * yarvcore.h, vm.c, insns.def : remove yarv_thread_t#cref_stack
-
- * eval.c, eval_intern.h, eval_load.c : ditto
-
- * yarvtest/test_class.rb : add tests for singleton class
-
- * gc.c : remove "FRAME *" unused variable
-
- * insnhelper.h : fix COPY_CREF
-
- * rb/mklog.rb : add default message
-
- * vm_macro.def : support NODE_ZSUPER as method type
-
-
-2006-02-13(Mon) 00:11:17 +0900 Koichi Sasada <ko1@atdot.net>
-
- * blockinlining.c : refoctoring with CFLAGS+=-Wunused
-
- * eval.c : ditto
-
- * eval_intern.h : ditto
-
- * eval_load.c : ditto
-
- * eval_method.h : ditto
-
- * eval_proc.c : ditto
-
- * eval_thread.c : ditto
-
- * insns.def : ditto
-
- * parse.y : ditto
-
- * thread.c : ditto
-
- * vm.c : ditto
-
-
-2006-02-13(Mon) 02:32:34 +0900 Minero Aoki <aamine@loveruby.net>
-
- * test/ruby/test_const.rb: show better message.
-
- * test/ruby/test_eval.rb: ditto.
-
- * test/ruby/test_module.rb: new file.
-
-
-2006-02-12(Sun) 22:22:35 +0900 Koichi Sasada <ko1@atdot.net>
-
- * array.c : revert last commit
-
- * ascii.c : ditto
-
- * bignum.c : ditto
-
- * class.c : ditto
-
- * compar.c : ditto
-
- * defines.h : ditto
-
- * dir.c : ditto
-
- * dln.c : ditto
-
- * dln.h : ditto
-
- * enum.c : ditto
-
- * enumerator.c : ditto
-
- * error.c : ditto
-
- * euc_jp.c : ditto
-
- * file.c : ditto
-
- * gc.c : ditto
-
- * hash.c : ditto
-
- * intern.h : ditto
-
- * io.c : ditto
-
- * lex.c : ditto
-
- * main.c : ditto
-
- * marshal.c : ditto
-
- * math.c : ditto
-
- * missing.h : ditto
-
- * node.h : ditto
-
- * numeric.c : ditto
-
- * object.c : ditto
-
- * oniguruma.h : ditto
-
- * pack.c : ditto
-
- * prec.c : ditto
-
- * process.c : ditto
-
- * random.c : ditto
-
- * range.c : ditto
-
- * rb/mklog.rb : ditto
-
- * re.c : ditto
-
- * regcomp.c : ditto
-
- * regenc.c : ditto
-
- * regenc.h : ditto
-
- * regerror.c : ditto
-
- * regex.h : ditto
-
- * regexec.c : ditto
-
- * regint.h : ditto
-
- * regparse.c : ditto
-
- * regparse.h : ditto
-
- * ruby.c : ditto
-
- * ruby.h : ditto
-
- * rubyio.h : ditto
-
- * rubysig.h : ditto
-
- * signal.c : ditto
-
- * sjis.c : ditto
-
- * sprintf.c : ditto
-
- * st.c : ditto
-
- * st.h : ditto
-
- * string.c : ditto
-
- * struct.c : ditto
-
- * time.c : ditto
-
- * utf8.c : ditto
-
- * util.c : ditto
-
- * util.h : ditto
-
- * variable.c : ditto
-
- * version.c : ditto
-
-
-2006-02-12(Sun) 21:33:10 +0900 Koichi Sasada <ko1@atdot.net>
-
- * array.c : fix to ruby's indent
-
- * ascii.c : ditto
-
- * bignum.c : ditto
-
- * blockinlining.c : ditto
-
- * call_cfunc.h : ditto
-
- * class.c : ditto
-
- * compar.c : ditto
-
- * compile.c : ditto
-
- * compile.h : ditto
-
- * debug.c : ditto
-
- * debug.h : ditto
-
- * defines.h : ditto
-
- * dir.c : ditto
-
- * disasm.c : ditto
-
- * dln.c : ditto
-
- * dln.h : ditto
-
- * enum.c : ditto
-
- * enumerator.c : ditto
-
- * error.c : ditto
-
- * euc_jp.c : ditto
-
- * eval.c : ditto
-
- * eval_error.h : ditto
-
- * eval_intern.h : ditto
-
- * eval_jump.h : ditto
-
- * eval_load.c : ditto
-
- * eval_method.h : ditto
-
- * eval_proc.c : ditto
-
- * eval_safe.h : ditto
-
- * eval_thread.c : ditto
-
- * file.c : ditto
-
- * gc.c : ditto
-
- * hash.c : ditto
-
- * insnhelper.h : ditto
-
- * insns.def : ditto
-
- * intern.h : ditto
-
- * io.c : ditto
-
- * lex.c : ditto
-
- * main.c : ditto
-
- * marshal.c : ditto
-
- * math.c : ditto
-
- * missing.h : ditto
-
- * node.h : ditto
-
- * numeric.c : ditto
-
- * object.c : ditto
-
- * oniguruma.h : ditto
-
- * opt_insn_unif.def : ditto
-
- * opt_operand.def : ditto
-
- * pack.c : ditto
-
- * prec.c : ditto
-
- * process.c : ditto
-
- * random.c : ditto
-
- * range.c : ditto
-
- * re.c : ditto
-
- * re.h : ditto
-
- * regcomp.c : ditto
-
- * regenc.c : ditto
-
- * regenc.h : ditto
-
- * regerror.c : ditto
-
- * regex.h : ditto
-
- * regexec.c : ditto
-
- * regint.h : ditto
-
- * regparse.c : ditto
-
- * regparse.h : ditto
-
- * ruby.c : ditto
-
- * ruby.h : ditto
-
- * rubyio.h : ditto
-
- * rubysig.h : ditto
-
- * signal.c : ditto
-
- * sjis.c : ditto
-
- * sprintf.c : ditto
-
- * st.c : ditto
-
- * st.h : ditto
-
- * string.c : ditto
-
- * struct.c : ditto
-
- * test.rb : ditto
-
- * thread.c : ditto
-
- * thread_pthread.h : ditto
-
- * thread_win32.h : ditto
-
- * time.c : ditto
-
- * utf8.c : ditto
-
- * util.c : ditto
-
- * util.h : ditto
-
- * variable.c : ditto
-
- * version.c : ditto
-
- * vm.c : ditto
-
- * vm.h : ditto
-
- * vm_dump.c : ditto
-
- * vm_evalbody.h : ditto
-
- * vm_macro.def : ditto
-
- * yarv.h : ditto
-
- * yarv_version.h : ditto
-
- * yarvcore.c : ditto
-
- * yarvcore.h : ditto
-
-
-2006-02-12(Sun) 15:53:21 +0900 Koichi Sasada <ko1@atdot.net>
-
- * lib/abbrev.rb : added
-
- * lib/base64.rb : ditto
-
- * lib/cgi-lib.rb : ditto
-
- * lib/csv.rb : ditto
-
- * lib/date2.rb : ditto
-
- * lib/eregex.rb : ditto
-
- * lib/ipaddr.rb : ditto
-
- * lib/irb.rb : ditto
-
- * lib/irb/cmd/chws.rb : ditto
-
- * lib/irb/cmd/fork.rb : ditto
-
- * lib/irb/cmd/help.rb : ditto
-
- * lib/irb/cmd/load.rb : ditto
-
- * lib/irb/cmd/nop.rb : ditto
-
- * lib/irb/cmd/pushws.rb : ditto
-
- * lib/irb/cmd/subirb.rb : ditto
-
- * lib/irb/completion.rb : ditto
-
- * lib/irb/context.rb : ditto
-
- * lib/irb/ext/change-ws.rb : ditto
-
- * lib/irb/ext/history.rb : ditto
-
- * lib/irb/ext/loader.rb : ditto
-
- * lib/irb/ext/math-mode.rb : ditto
-
- * lib/irb/ext/multi-irb.rb : ditto
-
- * lib/irb/ext/save-history.rb : ditto
-
- * lib/irb/ext/tracer.rb : ditto
-
- * lib/irb/ext/use-loader.rb : ditto
-
- * lib/irb/ext/workspaces.rb : ditto
-
- * lib/irb/extend-command.rb : ditto
-
- * lib/irb/frame.rb : ditto
-
- * lib/irb/help.rb : ditto
-
- * lib/irb/init.rb : ditto
-
- * lib/irb/input-method.rb : ditto
-
- * lib/irb/lc/error.rb : ditto
-
- * lib/irb/lc/help-message : ditto
-
- * lib/irb/lc/ja/CVS/Entries : ditto
-
- * lib/irb/lc/ja/CVS/Repository : ditto
-
- * lib/irb/lc/ja/CVS/Root : ditto
-
- * lib/irb/lc/ja/error.rb : ditto
-
- * lib/irb/lc/ja/help-message : ditto
-
- * lib/irb/locale.rb : ditto
-
- * lib/irb/notifier.rb : ditto
-
- * lib/irb/output-method.rb : ditto
-
- * lib/irb/ruby-lex.rb : ditto
-
- * lib/irb/ruby-token.rb : ditto
-
- * lib/irb/slex.rb : ditto
-
- * lib/irb/version.rb : ditto
-
- * lib/irb/workspace.rb : ditto
-
- * lib/irb/ws-for-case-2.rb : ditto
-
- * lib/irb/xmp.rb : ditto
-
- * lib/jcode.rb : ditto
-
- * lib/logger.rb : ditto
-
- * lib/mailread.rb : ditto
-
- * lib/mathn.rb : ditto
-
- * lib/parsedate.rb : ditto
-
- * lib/pathname.rb : ditto
-
- * lib/ping.rb : ditto
-
- * lib/pstore.rb : ditto
-
- * lib/resolv-replace.rb : ditto
-
- * lib/resolv.rb : ditto
-
- * lib/rss.rb : ditto
-
- * lib/rss/0.9.rb : ditto
-
- * lib/rss/1.0.rb : ditto
-
- * lib/rss/2.0.rb : ditto
-
- * lib/rss/content.rb : ditto
-
- * lib/rss/converter.rb : ditto
-
- * lib/rss/dublincore.rb : ditto
-
- * lib/rss/image.rb : ditto
-
- * lib/rss/maker.rb : ditto
-
- * lib/rss/maker/0.9.rb : ditto
-
- * lib/rss/maker/1.0.rb : ditto
-
- * lib/rss/maker/2.0.rb : ditto
-
- * lib/rss/maker/base.rb : ditto
-
- * lib/rss/maker/content.rb : ditto
-
- * lib/rss/maker/dublincore.rb : ditto
-
- * lib/rss/maker/image.rb : ditto
-
- * lib/rss/maker/syndication.rb : ditto
-
- * lib/rss/maker/taxonomy.rb : ditto
-
- * lib/rss/maker/trackback.rb : ditto
-
- * lib/rss/parser.rb : ditto
-
- * lib/rss/rexmlparser.rb : ditto
-
- * lib/rss/rss.rb : ditto
-
- * lib/rss/syndication.rb : ditto
-
- * lib/rss/taxonomy.rb : ditto
-
- * lib/rss/trackback.rb : ditto
-
- * lib/rss/utils.rb : ditto
-
- * lib/rss/xml-stylesheet.rb : ditto
-
- * lib/rss/xmlparser.rb : ditto
-
- * lib/rss/xmlscanner.rb : ditto
-
- * lib/rubyunit.rb : ditto
-
- * lib/scanf.rb : ditto
-
- * lib/shell.rb : ditto
-
- * lib/singleton.rb : ditto
-
- * lib/tsort.rb : ditto
-
- * lib/weakref.rb : ditto
-
- * eval_jump.c : removed
-
-
-2006-02-12(Sun) 15:39:09 +0900 Koichi Sasada <ko1@atdot.net>
-
- * parse.y : fix to remove including env.h
-
- * yarvtest/test_exception.rb : fix syntax (add 'end')
-
-
-2006-02-12(Sun) 15:14:44 +0900 Koichi Sasada <ko1@atdot.net>
-
- * env.h : removed
-
- * common.mk : remove env.h dependency
-
- * compile.c, eval_intern.h : remove include env.h
-
- * vm.c : ditto
-
- * ruby.h, gc.c, error.c : remove T_SCOPE, T_VARMAP
-
- * parse.y, eval.c : use rb_parse_in_eval() instead of ruby_in_eval
-
- * yarvcore.c, yarvcore.h : add a prase_in_eval member to yarv_thread_t
-
- * insns.def : add push value to throw instruction
- for stack consistency
-
- * yarvtest/test_exception.rb : add a test for above
-
- * test/ruby/test_gc.rb : fix typo
-
-
-2006-02-12(Sun) 05:05:02 +0900 Koichi Sasada <ko1@atdot.net>
-
- * eval.c, eval_intern.h, eval_load.c, eval_proc.c, node.h,
- insnhelper.h, insns.def, vm.c, yarvcore.c, yarvcore.h :
- change cref data structure and unify ruby_class and ruby_cbase
- and some refoctoring
-
-
-2006-02-11(Sat) 23:41:11 +0900 Koichi Sasada <ko1@atdot.net>
-
- * insns.def (methoddef) : fix method declaration in method
-
- * thread.c : Thread.critical to show warning (no effect)
-
-
-2006-02-11(Sat) 20:20:18 +0900 Koichi Sasada <ko1@atdot.net>
-
- * insns.def : fix [yarv-dev:831]
-
- * yarvtest/test_class.rb : add a test for above
-
-
-2006-02-11(Sat) 14:29:01 +0900 Koichi Sasada <ko1@atdot.net>
-
- * rb/mklog.rb : use svk
-
- * error.c : remove newline
-
- * eval.c (rb_block_call) : added
-
- * eval_thread.c : remove some unused functions, comments
-
- * thread.c : add comments (move from eval_thread.c) and support Mutex
-
- * thread.c (rb_thread_select) : supported
-
- * thread_pthread.h (native_mutex_trylock) : added (macro)
-
- * thread_win32.h (native_mutex_trylock) : added
-
- * yarvcore.c : remove unused code
-
- * array.c : import ruby 1.9
-
- * compar.c : ditto
-
- * dln.c : ditto
-
- * enum.c : ditto
-
- * enumerator.c : ditto
-
- * ext/digest/digest.c : ditto
-
- * ext/digest/digest.h : ditto
-
- * ext/digest/sha2/sha2.c : ditto
-
- * ext/etc/etc.c : ditto
-
- * ext/win32ole/win32ole.c : ditto
-
- * hash.c : ditto
-
- * intern.h : ditto
-
- * io.c : ditto
-
- * main.c : ditto
-
- * missing.h : ditto
-
- * missing/flock.c : ditto
-
- * missing/isinf.c : ditto
-
- * missing/vsnprintf.c : ditto
-
- * lib/cgi.rb : ditto
-
- * lib/complex.rb : ditto
-
- * lib/delegate.rb : ditto
-
- * lib/erb.rb : ditto
-
- * lib/fileutils.rb : ditto
-
- * lib/matrix.rb : ditto
-
- * lib/mkmf.rb : ditto
-
- * lib/optparse.rb : ditto
-
- * lib/ostruct.rb : ditto
-
- * lib/pp.rb : ditto
-
- * lib/timeout.rb : ditto
-
- * lib/tmpdir.rb : ditto
-
- * lib/test/unit/autorunner.rb : ditto
-
- * node.h : ditto
-
- * object.c : ditto
-
- * parse.y : ditto
-
- * ruby.c : ditto
-
- * sample/test.rb : ditto
-
- * sprintf.c : ditto
-
- * st.c : ditto
-
- * test/ruby/test_whileuntil.rb : ditto
-
- * test/runner.rb : ditto
-
- * time.c : ditto
-
- * lib/net/.document : added
-
- * lib/net/ftp.rb : ditto
-
- * lib/net/http.rb : ditto
-
- * lib/net/https.rb : ditto
-
- * lib/net/imap.rb : ditto
-
- * lib/net/pop.rb : ditto
-
- * lib/net/protocol.rb : ditto
-
- * lib/net/smtp.rb : ditto
-
- * lib/net/telnet.rb : ditto
-
- * lib/open-uri.rb : ditto
-
-
-2006-02-10(Fri) 08:07:34 +0900 Koichi Sasada <ko1@atdot.net>
-
- * compile.c, insns.def, yarvcore.h : support defined?(private_method) and
- defined?(protected_method) (separate DEFINE_METHOD / DEFINE_FUNC)
-
- * yarvtest/test_syntax.rb : add a test for above
-
- * compile.c (iseq_compile_each) : fix NODE_RETURN bug
- (double ensure invoke)
-
- * yarvtest/test_flow.rb : add a test for above
-
- * eval.c (get_errinfo) : fix to search $!
-
- * yarvtest/test_exception.rb : add tests for above
-
- * eval_safe.h : support $SAFE
-
- * ext/socket/socket.c : import ruby 1.9
-
- * gc.c (gc_mark_children) : fix making T_VALUE
-
- * test/ruby/test_gc.rb : use GC.stress
-
- * signal.c (sighandler) : send interrupt signal if thread blocked
-
- * test/ruby/test_proc.rb : remove assert false
-
- * test/ruby/test_readpartial.rb : change fail message
-
- * test/ruby/test_signal.rb : remove assert false
-
- * thread.c (thread_start_func_2) : set local_lfp/local_svar
- at thread creation
-
- * thread_pthread.h : export native_thread_interrupt
-
- * thread_win32.h : export native_thread_interrupt
-
- * version.h : import ruby 1.9
-
- * vm.c (lfp_svar), yarvcore.h : fix to use Thread local svar
-
- * yarvtest/test_thread.rb : add a test for above
-
- * win32/Makefile.sub : import ruby 1.9
-
- * win32/dir.h : ditto
-
- * win32/setup.mak : ditto
-
- * win32/win32.c : ditto
-
- * yarvtest/yarvtest.rb : fix to remove using ARGV
-
-
-2006-02-10(Fri) 01:04:58 +0900 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * gc.c (rb_gc_call_finalizer_at_exit): turn on during_gc while
- invoking finalizers.
-
- * gc.c (rb_gc_finalize_deferred): ditto.
-
-
-2006-02-08(Wed) 23:17:44 +0900 Minero Aoki <aamine@loveruby.net>
-
- * test/ruby/test_proc.rb: method names were wrongly duplicated.
-
-
-2006-02-08(Wed) 21:30:01 +0900 Minero Aoki <aamine@loveruby.net>
-
- * ext/nkf: added (imported from ruby CVS trunk HEAD).
-
- * ext/nkf/depend: new file (rev 1.5).
-
- * ext/nkf/extconf.rb: new file (rev 1.2).
-
- * ext/nkf/nkf.c: new file (rev 1.12).
-
- * ext/nkf/test.rb: new file (rev 1.7).
-
- * ext/nkf/nkf-utf8/nkf.c: new file (rev 1.17).
-
- * ext/nkf/nkf-utf8/config.h: new file (rev 1.4).
-
- * ext/nkf/nkf-utf8/utf8tbl.c: new file (rev 1.6).
-
- * ext/nkf/lib/kconv.rb: new file (rev 1.13).
-
- * test/nkf: added (imported from ruby CVS trunk HEAD).
-
- * test/nkf/test_kconv.rb: new file (rev 1.1).
-
- * test/nkf/test_nkf.rb: new file (rev 1.1).
-
-
-2006-02-08(Wed) 21:07:36 +0900 Minero Aoki <aamine@loveruby.net>
-
- * lib/find.rb: new file (imported from ruby CVS trunk HEAD,
- rev 1.15).
-
-
-2006-02-07(Tue) 17:58:18 +0900 Koichi Sasada <ko1@atdot.net>
-
- * compile.c, insns.def : support BEGIN{} and add preexe instruction
-
- * insns.def : fix getspecial/setspecial instructions
- to catch up svar change
-
- * test/ruby/test_system.rb : remove stopper
-
- * thread.c (rb_thread_fd_writable) : add a debug output
-
- * thread.c (rb_thread_wait_fd) : add a debug output
-
- * vm.c (lfp_svar) : refactoring and fix some problems
-
- * vm_dump.c (yarv_bug) : add branch
-
- * yarv.h : remove unused declarations
-
- * yarvcore.c (vm_free) : VM object should not free by GC
-
-
-2006-02-07(Tue) 14:42:25 +0900 Koichi Sasada <ko1@atdot.net>
-
- * eval.c, eval_load.c : remove rb_thread_start_1()
-
- * eval.c : fix some prototypes and indents
-
- * eval_thread.c, thread.c : move some functions
- from eval_thread.c to thread.c
-
- * signal.c (sighandler) : add line braek in error message
-
- * yarvcore.c, yarvcore.h, thread.c : support ThreadGroup
-
- * ruby.h, gc.c, vm.c : make new basic type RValue and T_VALUE.
- RValue includes three values in itself. RValue is used as
- svar
-
-
-2006-02-06(Mon) 23:51:41 +0900 Minero Aoki <aamine@loveruby.net>
-
- * test/ruby/test_hash.rb: import many tests from rubicon.
-
-
-2006-02-04(Sat) 18:36:41 +0900 Minero Aoki <aamine@loveruby.net>
-
- * test/ruby/test_array.rb: import many tests from rubicon.
-
-
-2006-02-04(Sat) 17:47:44 +0900 Minero Aoki <aamine@loveruby.net>
-
- * test/ruby/test_signal.rb (test_exit_action): lib/timeout.rb is
- not implemented yet.
-
-
-2006-02-04(Sat) 17:42:31 +0900 Minero Aoki <aamine@loveruby.net>
-
- * test/ruby/test_readpartial.rb: lib/timeout.rb is not implemented
- yet.
-
-
-2006-02-04(Sat) 16:22:38 +0900 Minero Aoki <aamine@loveruby.net>
-
- * test/ruby/test_pipe.rb: remove useless require.
-
- * test/ruby/test_signal.rb: turn off the test case which causes
- segmentation fault (tmp).
-
-
-2006-02-04(Sat) 08:19:50 +0900 Koichi Sasada <ko1@atdot.net>
-
- * common.mk : add dependency to yarvcore.h on signal.o
-
- * compile.c (iseq_compile_each) : fix [yarv-dev:795] problem
- (prohibit "break", "next" jump from eval)
-
- * eval.c : fix indent
-
- * eval_thread.c, thread.c : remove some functions and move to thread.c
-
- * insns.def, vm.c : fix [yarv-dev:799] and [yarv-dev:800]
-
- * yarvtest/test_class.rb : add a test for above
-
- * test/ruby/test_gc.rb : remove GC.debug_flag control
-
- * test/ruby/test_readpartial.rb : disable
-
- * test/ruby/test_signal.rb : disable
-
- * thread.c : fix thread_debug() and many bugs
-
- * thread.c (yarv_thread_s_new) : move living_threads setting
-
- * thread.c (yarv_thread_join) : fix
-
- * thread_pthread.h : add type native_thread_data_t (dummy)
- and support interrupt blocking thread
-
- * thread_pthread.h (native_thread_apply_priority) : added
-
- * thread_win32.h : add type native_thread_data_t (dummy)
- and support interrupt blocking thread
-
- * yarvcore.h : use win32 thread system on cygwin and fix
- some struct members
-
- * yarvtest/test_thread.rb : added
-
-
-2006-02-03(Fri) 00:08:09 +0900 Minero Aoki <aamine@loveruby.net>
-
- * test/ruby/test_string.rb: import many tests from rubicon.
-
-
-2006-02-02(Thu) 23:20:13 +0900 Minero Aoki <aamine@loveruby.net>
-
- * test/ruby/envutil.rb: new file (imported from ruby trunk HEAD).
-
- * test/ruby/marshaltestlib.rb: ditto.
-
- * test/ruby/test_array.rb: ditto.
-
- * test/ruby/test_beginendblock.rb: ditto.
-
- * test/ruby/test_clone.rb: ditto.
-
- * test/ruby/test_dir.rb: ditto.
-
- * test/ruby/test_env.rb: ditto.
-
- * test/ruby/test_file.rb: ditto.
-
- * test/ruby/test_float.rb: ditto.
-
- * test/ruby/test_fnmatch.rb: ditto.
-
- * test/ruby/test_hash.rb: ditto.
-
- * test/ruby/test_io.rb: ditto.
-
- * test/ruby/test_marshal.rb: ditto.
-
- * test/ruby/test_math.rb: ditto.
-
- * test/ruby/test_pack.rb: ditto.
-
- * test/ruby/test_path.rb: ditto.
-
- * test/ruby/test_pipe.rb: ditto.
-
- * test/ruby/test_rand.rb: ditto.
-
- * test/ruby/test_range.rb: ditto.
-
- * test/ruby/test_readpartial.rb: ditto.
-
- * test/ruby/test_regexp.rb: ditto.
-
- * test/ruby/test_settracefunc.rb: ditto.
-
- * test/ruby/test_signal.rb: ditto.
-
- * test/ruby/test_sprintf.rb: ditto.
-
- * test/ruby/test_string.rb: ditto.
-
- * test/ruby/test_stringchar.rb: ditto.
-
- * test/ruby/test_struct.rb: ditto.
-
- * test/ruby/test_symbol.rb: ditto.
-
- * test/ruby/test_system.rb: ditto.
-
- * test/ruby/test_time.rb: ditto.
-
- * test/ruby/ut_eof.rb: ditto.
-
-
-2006-02-02(Thu) 22:53:44 +0900 Minero Aoki <aamine@loveruby.net>
-
- * test/ruby/test_proc.rb: test [yarv-dev:777].
-
-
-2006-02-01(Wed) 03:51:39 +0900 Koichi Sasada <ko1@atdot.net>
-
- * gc.c : add GC.debug_flag= method
-
- * insns.def : support method definition in method
-
- * yarvtest/test_method.rb : add tests for above
-
-
-2006-01-29(Sun) 11:40:26 +0900 Koichi Sasada <ko1@atdot.net>
-
- * eval_proc.c (proc_alloc) : fix [yarv-dev:777]
-
- * yarvtest/test_proc.rb : add a test for above
-
- * insns.def : fix [yarv-dev:782] and add YARV_CHECK_INTS()
-
- * yarvtest/test_class.rb : add a test for above
-
- * thread_win32.h : fix [yarv-dev-en:23]
-
- * vm.c (th_call0) : add YARV_CHECK_INTS()
-
-
-2006-01-09(Mon) 11:56:34 +0900 Minero Aoki <aamine@loveruby.net>
-
- * yarvcore.h: add prototype (remove warning).
-
- * vm.c (th_invoke_proc): make save variables volatile.
-
- * eval.c (eval): initialize local variables (remove warnings).
-
- * eval_thread.c (rb_exec_recursive): ditto.
-
- * yarvcore.c (thread_mark): ditto.
-
- * vm.c (th_invoke_proc): ditto.
-
- * eval.c: remove useless prototypes.
-
-
-2006-01-09(Mon) 10:25:12 +0900 Minero Aoki <aamine@loveruby.net>
-
- * eval_thread.c: rb_thread_join is required to build ruby on
- Linux.
-
- * compile.c: unify coding style.
-
- * yarvcore.c: ditto.
-
-
-2006-01-06(Fri) 09:21:34 +0900 Minero Aoki <aamine@loveruby.net>
-
- * vm.c: coding style change only.
-
-
-2006-01-04(Wed) 14:12:47 +0900 Koichi Sasada <ko1@atdot.net>
-
- * eval.c (ruby_init), eval_intern.h : use POP_TAG_INIT() at bootstrap
-
- * eval_thread.c : remove unused functions and comments
-
- * intern.h : expose rb_make_exception()
-
- * signal.c : support signal
-
- * thread.c (yarv_thread_execute_interrupts) : added
-
- * thread_pthread.h (thread_timer) : set interrupt_flag of
- current runnning threads
-
- * vm.c (th_invoke_proc) : jump with JUMP_TAG() if some exception
- occurres
-
- * yarv.h : add yarv_set_current_running_thread_raw() for bootstrap
-
- * yarvcore.c : add yarv_segv() and segv() method for test
-
- * yarvcore.c (Init_yarvcore) : set yarv_thread_t#running_thread
-
- * yarvcore.h : fix yarv_thread_t members
-
-
-2006-01-03(Tue) 22:25:04 +0900 Koichi Sasada <ko1@atdot.net>
-
- * disasm.c (insn_operand_intern) : fix to add child iseq
-
- * eval.c, gc.c : remove obsolete static variables (ruby_scope,
- ruby_dyna_vars, ruby_frame)
-
- * eval.c (rb_mod_s_constants) : use ruby_cref()
-
- * eval.c (eval) : use th_restore_klass()
-
- * eval_proc.c (rb_f_binding) : use th_store_klass()
-
- * insns.def (concatarray) : fix insn ([expr, *nil] => [expr])
-
- * vm.c (th_set_env), insnhelper.h : remove macro
-
- * vm.c (eval_get_cvar_base) : use get_cref
-
- * vm.c (th_make_proc) : use th_store_klass()
-
- * vm_macro.def (macro_eval_invoke_func) : fix option args size
-
- * vm_macro.def (macro_eval_invoke_func) : raise stack overflow error
-
- * yarvcore.h : add yarv_stored_klass_t type
-
- * yarvcore.c : fix mark functions around yarv_stored_klass_t
-
-
-2006-01-01(Sun) 05:14:26 +0900 Minero Aoki <aamine@loveruby.net>
-
- * lib/benchmark.rb: new file (imported from original ruby, rev
- 1.10).
-
-
-2006-01-01(Sun) 03:51:10 +0900 Minero Aoki <aamine@loveruby.net>
-
- * yarvcore.c: add prototype.
-
- * re.c: remove warning: long -> unsigned long.
-
- * debug.c: adjust coding style.
-
- * yarv.h: ditto.
-
-
-2006-01-01(Sun) 03:43:33 +0900 Minero Aoki <aamine@loveruby.net>
-
- * variable.c: add prototype.
-
- * eval.c: ditto.
-
- * eval_load.c: ditto.
-
-
-2006-01-01(Sun) 02:41:21 +0900 Koichi Sasada <ko1@atdot.net>
-
- * common.mk : add address analyse to vtune rule
-
- * rb/vtlh.rb : added for above
-
- * rb/insns2vm.rb, template/vm.inc.tmpl : insert #line directive
- to reference above
-
- * vm_macro.def (macro_eval_invoke_cfunc) : fix indent
-
- * yarvtest/test_method.rb : fix indent, spacing
- and add a test for alias
-
-
-2005-12-31(Sat) 12:42:05 +0900 Koichi Sasada <ko1@atdot.net>
-
- * common.mk : add Intel VTune rule (make vtune)
-
- * eval.c, yarvcore.h : fix to remove yarv_thread_t#local_*
-
- * parse.y (top_local_init_gen) : fix a problem ([yarv-dev:765])
-
- * yarvtest/test_eval.rb : add a test for above
-
- * vm.c (thread_eval) :remove unused function
-
- * yarvcore.c (Init_yarvcore) : remove YARVCore::Thread::eval method
-
- * yarvcore.c (thread_eval) : remove unused function
-
-
-2005-12-31(Sat) 06:05:00 +0900 Koichi Sasada <ko1@atdot.net>
-
- * vm.c (eval_search_super_klass) : pass block to method missing
-
- * vm_macro.def (macro_eval_invoke_method) : ditto
-
- * yarvtest/test_method.rb : add a test for above
-
-
-2005-12-31(Sat) 03:11:14 +0900 Koichi Sasada <ko1@atdot.net>
-
- * eval.c (eval), eval_proc.c (rb_f_binding) : save klass, etc to
- binding and use it at eval
-
- * eval_intern.h : ditto
-
- * yarvtest/test_eval.rb : add tests for above
-
- * yarvcore.c (th_get_special_cref) : added
-
- * yarvcore.h : add a prototype of above
-
- * vm.c (th_get_cref) : refactoring
-
- * vm.c (eval_get_ev_const) : fix SEGV at A::B (A is not class/module)
- ([yarv-dev:758])
-
- * yarvtest/test_bin.rb : add a test for above
-
- * rb/mklog.rb : use external diff command and show function name
-
-
-2005-12-30(Fri) 19:07:51 +0900 Koichi Sasada <ko1@atdot.net>
-
- * yarvcore.c, yarvcore.h, eval.c, eval_proc.c : support
- Ruby's Binding
-
- * yarvcore.c : support TOPLEVEL_BINDING
-
- * yarvtest/test_eval.rb : add tests for above
-
-
-2005-12-30(Fri) 13:12:28 +0900 Minero Aoki <aamine@loveruby.net>
-
- * test/ruby/test_eval.rb: more tests for
- module_eval/instance_eval.
-
-
-2005-12-30(Fri) 05:06:49 +0900 Koichi Sasada <ko1@atdot.net>
-
- * common.mk : add dependency (yarvcore.h) for gc.c
-
- * eval.c, eval_intern.h, eval_load.c, eval_method.h,
- insns.def, insnhelper.h, vm.c, yarvcore.c, yarvcore.h :
- re-write class reference
-
- * yarvtest/test_eval.rb : added
-
- * yarvtest/test_proc.rb :
-
-
-2005-12-29(Thu) 12:27:12 +0900 Koichi Sasada <ko1@atdot.net>
-
- * compile.c, yarvcore.h :
- remvoe needless yarv_iseq_t#rewind_frame_size
-
-
-2005-12-29(Thu) 11:17:58 +0900 Koichi Sasada <ko1@atdot.net>
-
- * common.mk : add dependency to test-all rule
-
- * eval.c (rb_sourceline), vm.c (th_get_sourceline) :
- fix to skip process if iseq is ifunc
-
- * test/ruby/test_lambda.rb : assert(fail, ...) instead of assert_fail
-
- * test/ruby/test_proc.rb : ditto
-
- * vm_dump.c : fix stack dump (iseq name)
-
- * vm_macro.def : store proc (block proc) to cfp#proc for GC mark
-
- * yarvcore.c : mark above on thread_mark
-
- * eval.c (exec_under) : replace block#self ([yarv-dev:751])
-
-
-2005-12-29(Thu) 01:56:46 +0900 Koichi Sasada <ko1@atdot.net>
-
- * vm.c : fix setting of Proc cref ([yarv-dev:741])
-
- * yarvcore.c : fix indent
-
-
-2005-12-29(Thu) 00:17:03 +0900 Koichi Sasada <ko1@atdot.net>
-
- * disasm.c : show (block) local variable simple (not as symbol)
-
- * gc.c : fix syntax error
-
-
-2005-12-28(Wed) 23:35:06 +0900 Koichi Sasada <ko1@atdot.net>
-
- * class.c (method_entry) : fixed for undefed method ([yarv-dev:743])
-
- * compile.c : fix errinfo dvar id (#$!)
- and fix NODE_ERRINFO compilation
-
- * eval_proc.c, yarvcore.c : support YARVCore::VM::Proc.new
-
- * insns.def : remove useless TODO comments
-
- * insns.def : fix to use strict array conversion on
- checkarrayinclude
-
- * insns.def : fix defined?(yield) ([yarv-dev:744])
-
- * yarvcore.h : change yarv_iseq_t layout
-
-
-2005-12-28(Wed) 16:49:55 +0900 Minero Aoki <aamine@loveruby.net>
-
- * test/ruby/test_eval.rb: add TODO comment.
-
- * test/ruby/test_iterator.rb: rename YARVCore::VM::Proc -> Proc
- (tmp).
-
- * test/ruby/test_lambda.rb: use assert_fail.
-
- * test/ruby/test_proc.rb: ditto.
-
-
-2005-12-28(Wed) 16:28:35 +0900 Minero Aoki <aamine@loveruby.net>
-
- * test/ruby/test_clone.rb: removed (tmp).
-
- * test/ruby/test_eval.rb: define missing method Object#funcall
- (tmp).
-
- * test/ruby/test_lambda.rb: turn off tests for "->".
-
- * test/ruby/test_proc.rb: turn off tests for |&b|.
-
- * test/ruby/test_proc.rb: turn off tests for $SAFE setter.
-
-
-2005-12-28(Wed) 15:31:46 +0900 Koichi Sasada <ko1@atdot.net>
-
- * compile.c : fix calculation of stack_max
-
- * eval.c (rb_iter) : fix block/retry handling
-
- * yarvtest/test_flow.rb : add tests for above
-
- * insns.def : fix block passing on super (super(&nil))
-
- * vm_macro.def, insns.def : fix convert method of object to array
-
- * yarvtest/test_method.rb : fix a test for above
-
- * vm.c : fix backtrace generate algorithm
-
-
-2005-12-28(Wed) 10:36:45 +0900 Koichi Sasada <ko1@atdot.net>
-
- * compile.c, compile.h : refactoring (remove self passing, etc)
-
- * disasm.c : support showing ID of method/dynamic local variables
-
- * rb/allload.rb : add verbose version (it's enable by $DEBUG)
-
- * template/insns.inc.tmpl, template/insns_info.inc.tmpl,
- template/minsns.inc.tmpl, template/opt_sc.inc.tmpl,
- template/optinsn.inc.tmpl, template/optunifs.inc.tmpl,
- template/vmtc.inc.tmpl : fix a comment
-
- * variable.c (mod_av_set) : fix to clear inline cache ([yarv-dev:720])
-
- * eval_method.h : fix to clear inline method cache
-
- * vm.c, rb/insns2vm.rb, template/insns_info.inc.tmpl, compile.c,
- insns.def, vm_evalbody.h, vm_macro.def :
- fix operands types (ulong -> num_t, ...)
-
- * vm_macro.def : fix to check SPECIAL_CONST_P() at splat array
- ([yarv-dev:722])
-
- * yarvcore.c : fix to throw syntax error
-
- * yarvcore.h, eval.c, eval_error.h, eval_jump.h :
- add yarv_vm_t#exit_code to fix problem at cleanup ([yarv-dev:723])
-
- * insns.def : fix to invoke zsuper in method defined by define_method
- ([yarv-dev:704])
-
- * yarvtest/test_class.rb : add tests for above
-
- * yarvtest/test_method.rb : fix comments
-
-
-2005-12-27(Tue) 01:52:07 +0900 Koichi Sasada <ko1@atdot.net>
-
- * array.c, intern.h, insns.def : expose rb_ary_replace and use it
- in insns.def
-
- * eval.c : fix to use SCOPE_* to NOEX_*
-
- * eval_intern.h : remove SCOPE_*
- and fix SCOPE_TEST() and SCOPE_SET(f)
-
- * eval_load.c : save and store klass and visibility
- at require and load
-
- * eval_method.h : fix undefed method node ([yarv-dev-en:8])
-
- * eval_proc.c : fix define_method ([yarv-dev:704])
-
- * insnhelper.h, vm.h : remove GET_VM_STATE_VERSION(),
- INC_VM_STATE_VERSION() and move these to vm.h
-
- * insns.def : supportintg visibility
-
- * node.h : remove NOEX_RECV
-
- * variable.c, vm.c : add rb_vm_change_state() and use it in
- remove_const
-
- * vm.c, insns.def, yarvcore.h, yarvcore.c : add eval_push_cref(),
- eval_pop_cref() and th_cref_init to manage current visibility
-
- * yarv.h : add a prototype of rb_vm_change_state()
-
- * yarvcore.h, insns.def : add defined_method_id and support
- super in define_method scope
-
- * yarvtest/test_class.rb : add tests for above
-
-
-2005-12-26(Mon) 20:44:38 +0900 Minero Aoki <aamine@loveruby.net>
-
- * test/ruby/test_basicinstructions.rb: new file.
-
-
-2005-12-26(Mon) 08:40:02 +0900 Koichi Sasada <ko1@atdot.net>
-
- * vm.c (eval_get_ev_const) : fix to skip nil
-
-
-2005-12-26(Mon) 08:27:15 +0900 Koichi Sasada <ko1@atdot.net>
-
- * insnhelper.h : fix GET_CVAR_EV_KLASS [yarv-dev:703]
-
-
-2005-12-26(Mon) 07:51:01 +0900 Koichi Sasada <ko1@atdot.net>
-
- * compile.c : add emptstack insn for all NODE_RETURN
- and optimize it if it's not needed
-
- * yarvtest/test_flow.rb : add a test for above
-
-
-2005-12-26(Mon) 07:08:22 +0900 Koichi Sasada <ko1@atdot.net>
-
- * eval.c, gc.c : add "gc_debug_flag" to debug gc
-
- * insns.def : add emptstack
-
- * compile.c, rb/insns2vm.rb, template/insns_info.inc.tmpl :
- change interface of insn_stack_increase
-
- * compile.c : fix return from ensure in method [yarv-dev:702]
-
- * yarvtest/test_flow.rb : add tests for above
-
-
-2005-12-26(Mon) 02:15:02 +0900 Minero Aoki <aamine@loveruby.net>
-
- * test/ruby/test_alias.rb: do not use unimplemented defined?.
-
-
-2005-12-26(Mon) 02:00:11 +0900 Minero Aoki <aamine@loveruby.net>
-
- * test/runner.rb: new file.
-
- * test/ruby/test_alias.rb: new file.
-
- * test/ruby/test_clone.rb: new file.
-
- * test/ruby/test_eval.rb: new file.
-
- * test/ruby/test_iterator.rb: new file.
-
- * test/ruby/test_lambda.rb: new file.
-
- * test/ruby/test_proc.rb: new file.
-
- * test/ruby/test_super.rb: new file.
-
- * test/ruby/test_assignment.rb: new file.
-
- * test/ruby/test_bignum.rb: new file.
-
- * test/ruby/test_call.rb: new file.
-
- * test/ruby/test_case.rb: new file.
-
- * test/ruby/test_condition.rb: new file.
-
- * test/ruby/test_const.rb: new file.
-
- * test/ruby/test_defined.rb: new file.
-
- * test/ruby/test_exception.rb: new file.
-
- * test/ruby/test_gc.rb: new file.
-
- * test/ruby/test_ifunless.rb: new file.
-
- * test/ruby/test_method.rb: new file.
-
- * test/ruby/test_trace.rb: new file.
-
- * test/ruby/test_variable.rb: new file.
-
- * test/ruby/test_whileuntil.rb: new file.
-
-
-2005-12-25(Sun) 07:40:08 +0900 Koichi Sasada <ko1@atdot.net>
-
- * blockinlining.c, compile.c : fix block inlining
-
- * rb/insns2vm.rb : fix to support tracing stack depth
- with operands unification
-
- * vm_dump.c : fix to print Qundef on stack dump
-
-
-2005-12-25(Sun) 01:45:55 +0900 Koichi Sasada <ko1@atdot.net>
-
- * insns.def, compile.c, rb/insns2vm.rb, template/insns_info.inc.tmpl :
- trace stack depth at compile time
- and use it as cont_sp for exception handling
-
- * yarvtest/test_exception.rb : add tests for above
-
- * yarvtest/test_flow.rb : ditto
-
- * Merry Xmas :)
-
-
-2005-12-24(Sat) 19:34:04 +0900 Koichi Sasada <ko1@atdot.net>
-
- * compile.c, compile.h : fix ADD_CATCH_ENTRY and add LABEL#sp
-
- * eval_jump.h : fix catch to remove illegal error
-
-
-2005-12-24(Sat) 09:05:23 +0900 Koichi Sasada <ko1@atdot.net>
-
- * eval_method.h : change data structure for RClass#m_tbl
-
- * class.c, eval.c, eval_proc.c : fix for above changes
-
- * node.h, gc.c : change NODE_FBODY, NODE_METHOD members
- for above changes
-
- * insns.def : support private/protected visibility
-
- * vm_macro.def : ditto
-
- * vm.c : ditto
-
- * thread.c : fix typo
-
- * thread_pthread.h : fix typo
-
- * thread_win32.h : fix typo
-
- * eval.c, yarvcore.h : add yarv_thread_t#method_missing_reason
- to pass method_missing reason and use it to build error message
-
- * compile.c : use ADD_CALL instead of ADD_SEND for
- NODE_X(D)STR, NODE_CONST (func)
-
-
-2005-12-22(Thu) 02:45:27 +0900 Koichi Sasada <ko1@atdot.net>
-
- * yarv_version.h, Changes : 0.3.3
-
-
-2005-12-20(Tue) 04:04:45 +0900 Koichi Sasada <ko1@atdot.net>
-
- * compile.c : fix self::Const access
-
- * yarvtest/test_bin.rb : add a test for above
-
-
-2005-12-20(Tue) 01:52:52 +0900 Koichi Sasada <ko1@atdot.net>
-
- * insns.def : fix to expand VALUES value
-
- * yarvtest/test_massign.rb : add a test for above
-
-
-2005-12-20(Tue) 01:32:35 +0900 Koichi Sasada <ko1@atdot.net>
-
- * insns.def, insnhelper.h : fix cvar in singleton method/class
-
- * yarvtest/test_bin.rb : add tests for above
-
-
-2005-12-20(Tue) 01:03:34 +0900 Koichi Sasada <ko1@atdot.net>
-
- * compile.c, yarvcore.h : support all defined?() syntax
-
- * compile.c : fix NODE_COLON2
-
- * yarvtest/test_bin.rb : add or fix tests for above
-
- * win32/* : update all
-
-
-2005-12-17(Sat) 10:46:08 +0900 Minero Aoki <aamine@loveruby.net>
-
- * vm_macro.def: fix printf type mismatch for LP64 system (again).
-
- * parse.y: introduce descriptive macro for special values of
- lvtbl->dvars.
-
-
-2005-12-17(Sat) 09:39:27 +0900 Minero Aoki <aamine@loveruby.net>
-
- * vm_macro.def (macro_eval_invoke_method): fix printf type mismatch
- for LP64 system.
-
-
-2005-12-14(Wed) 03:49:40 +0900 Koichi Sasada <ko1@atdot.net>
-
- * compile.c : change rescue/ensure iseq name
-
- * eval.c, intern.h : fix a prototype
-
- * insns.def, yarvcore.h : add trace_function
-
- * vm.c : fix deadly bug (illegal pointer cast)
-
- * vm_dump.c : remove unused local variables
-
- * vm_macro.def : add parameter size check
-
- * yarvtest/test_bin.rb : comment out 2 assertions
-
-
-2005-12-13(Tue) 03:55:27 +0900 Koichi Sasada <ko1@atdot.net>
-
- * eval_proc.c : fix indent
-
- * insns.def : fix getspecial instruction to return nil
- if no entry
-
- * yarvtest/test_syntax.rb : add a test for above
-
- * lib/un.rb : added
-
- * template/*.tmpl : fix typo
-
-
-2005-12-13(Mon) 01:38:17 +0900 Minero Aoki <aamine@loveruby.net>
-
- * yarv.h: add prototypes.
-
- * intern.h: ditto.
-
- * eval.c: ditto.
-
- * debug.c: ditto.
-
- * thread_pthread.h: fix printf type mismatch for LP64 system
- (Linux/AMD64).
-
- * variable.c: ditto.
-
- * object.c: ditto.
-
- * gc.c: ditto.
-
- * process.c: ditto.
-
- * error.c: ditto.
-
- * vm.c: ditto.
-
- * vm.h: ditto.
-
- * vm_dump.c: ditto.
-
- * disasm.c: ditto.
-
- * marshal.c: ditto.
-
- * eval_thread.c: ditto.
-
-
-2005-12-11(Sun) 22:00:34 +0900 Koichi Sasada <ko1@atdot.net>
-
- * insns.def : call "inherited" method when a class is inherited
-
- * yarvcore.h : fix yarv_iseq_t field layout
-
- * common.mk : add dependence on yarvcore.h to eval*.o files
-
- * compile.c : fix NODE_POSTEXE logic
-
- * insnhelper.h : use GC_GUARDED_PTR_REF instead of magic number
-
- * eval_proc.c : fix indent
-
- * configure : re-autoconf
-
-
-2005-12-10(Sat) 03:57:20 +0900 Koichi Sasada <ko1@atdot.net>
-
- * common.mk : fix blockinlining.o build rule
-
- * insns.def : remove logic for zsuper
-
- * template/optinsn.inc.tmpl :
-
- * vm.c : remove thread_yield_light_prepare, thread_yield_light_invoke
-
- * compile.c : support NODE_ZSUPER with optargs, restarg
-
- * yarvtest/test_class.rb : add tests for above
-
-
-2005-12-09(Fri) 01:13:37 +0900 Koichi Sasada <ko1@atdot.net>
-
- * array.c, numeric.c, range.c : add prototype of
- block inlining function
-
- * blockinlining.c, vm_opts.h.base : add block inlining flag
-
- * common.mk, debug.h, debug.c : add debug_breakpoint() for gdb
-
- * compile.c : fix to use size_t on compile_data_alloc(),
- fix illegal cast, fix to set arg_simple at compiling block,
-
- * compile.c, vm.c : fix NODE_NEXT, NODE_BREAK logic
-
- * yarvtest/test_flow.rb : add a test for above
-
- * yarvcore.c, yarvcore.h, compile.c, eval.c : remove
- yarv_iseq_t#root_iseq and add yarv_iseq_t#local_iseq and fix
- to use this member field
-
- * eval_method.h : fix indent
-
- * gc.c : fix indent
-
- * insns.def, compile.c : remove "zsuper" instruction (use "super"
- instead). This is because NODE_ZSUPER represent with only "super"
- instruction
-
- * yarvcore.c : add proc_arity
-
-
-2005-12-05(Mon) 03:58:30 +0900 Koichi Sasada <ko1@atdot.net>
-
- * array.c, blockinlining.c : support block inlining for Array#each
-
- * disasm.c : fix catch table format
-
- * insns.def : fix stack consistency error message
-
- * vm.c : fix to skip pushing value at "next"
-
- * yarvcore.h : move definision of
- "struct iseq_compile_data_ensure_node_stack" to compile.c
-
- * compile.c : fix ensure catch table creation
-
- * yarvtest/test_flow.rb : add tests for above
-
-
-2005-12-03(Sat) 22:27:08 +0900 Koichi Sasada <ko1@atdot.net>
-
- * blockinlining.c, compile.c, yarvcore.c, yarvcore.h,
- numeric.c, range.c : collect block inlining logic to blockinlining.c
-
-
-2005-12-03(Sat) 20:24:07 +0900 Koichi Sasada <ko1@atdot.net>
-
- * blockinlining.c, common.mk : add blockinlining.c
-
- * yarvcore.c, yarvcore.h, blockinlining.c, compile.c, compile.h,
- gc.c, node.h, numeric.c, range.c :
- support block inlining for Integer#times, Range#each
-
- * compile.c : fix to set block redo/next point at last,
- and fix NODE_OP_ASGN1
-
- * compile.c, vm.c : add specialized instruction "opt_le"
-
- * disasm.c : fix to show block, and to show catch type as string
- and change node_name logic
-
- * eval_thread.c : fix function type declaration
-
- * insns.def : add instruction "putundef", "opt_checkenv"
- to support block inlining and add stack check routine
-
- * lib/cgi.rb : add global variable $CGI_DONTINPUT
-
- * opt_operand.def : add some operand unification rules
-
- * rb/insns2vm.rb : fix operand unification logic for BLOCKISEQ
-
- * vm.c : fix exception handling routine (collect stack operations)
-
- * vm_macro.def : fix macro_eval_invoke_bmethod
-
- * yarvsubst.c : removed
-
- * yarvtest/test_syn.rb : rename to yarvtest/test_syntax.rb
-
- * yarvtest/yarvtest.rb : remove tempfile explicitly
-
-
-2005-11-30(Wed) 01:13:57 +0900 Koichi Sasada <ko1@atdot.net>
-
- * common.mk : add vm_opts.h rule
-
- * vm.c, insns.def : fix proc creation under class and block
- environment
-
-
-2005-11-29(Tue) 16:39:07 +0900 Koichi Sasada <ko1@atdot.net>
-
- * eval.c, eval_proc.c, vm.c, vm_macro.def :
- support define_method and invoke NODE_BMETHOD method
-
-
-2005-11-29(Tue) 13:18:06 +0900 Koichi Sasada <ko1@atdot.net>
-
- * compile.c : add iseq_add_mark_object, iseq_add_mark_object_compile_time
- and use it to mark objects on iseq
-
- * compile.h, compile.c : remove cast on NEW_CHILD_ISEQVAL, NEW_ISEQVAL
- and interface
-
- * compile.c, disasm.c, insns.def, vm_macro.def, rb/insns2vm.rb :
- add BLOCKISEQ parameter type
-
- * gc.c : fix garbage_collect to return true if only allocate memory
-
- * vm.c : fix insertion order of proc/env
-
- * vm_evalbody.h : add typedef yarv_iseq_t *BLOCKISEQ
-
- * yarvcore.c, yarvcore.c : add idTimes
-
- * yarvcore.c : fix proc_mark, env_mark around iseq mark
-
-
-2005-11-28(Mon) 09:02:57 +0900 Koichi Sasada <ko1@atdot.net>
-
- * compile.c, insns.def, vm_evalbody.h : support super
- with splat argument and block (and zsuper with block)
-
- * yarvtest/test_class.rb : add tests for above
-
- * compile.c, yarvcore.h, yarvcore.c, insns.def, time.c, string.c :
- add opt_succ insn
-
- * eval_method.h : fix indent
-
- * eval_thread.c : apply cast to vanish a warning
-
- * lib/tempfile.rb, lib/tmpdir.rb : added
-
- * vm.c : eval_method_missing added
-
- * vm_macro.def : refactoring
-
-
-2005-11-21(Mon) 21:21:33 +0900 Koichi Sasada <ko1@atdot.net>
-
- * compile.c, compile.h, yarvcore.c : remove "iseqobj"
- variables and rename to "iseq"
-
-
-2005-11-21(Mon) 07:31:50 +0900 Koichi Sasada <ko1@atdot.net>
-
- * compile.c : fix block parameter error
-
- * ext/* : added
-
- * lib/optparse* : added
-
- * benchmark/bm_so_sieve.rb : fix parameter
-
-
-
-2005-11-21(Mon) 03:47:28 +0900 Koichi Sasada <ko1@atdot.net>
-
- * compile.c : optimize condition in literal
-
- * thread_win32.h : fix win32 thread function prototype
-
-
-2005-11-20(Sun) 17:58:24 +0900 Koichi Sasada <ko1@atdot.net>
-
- * compile.c : fix NODE_AND/OR bug
-
- * eval.c : support rb_frame_this_func()
-
-
-2005-11-20(Sun) 12:32:31 +0900 Koichi Sasada <ko1@atdot.net>
-
- * compile.c, yarvcore.c, yarvcore.h : support NODE_OPT_N
-
- * compile.h : add macro ADD_CALL
-
- * debug.c : add debug_v() and change to use only printf
- on debug_id()
-
- * sample/test.rb :
-
- * vm.c : fix make_proc_from_block
-
-
-2005-11-19(Sat) 14:55:17 +0900 Koichi Sasada <ko1@atdot.net>
-
- * import ruby 1.9.0 (2005-11-18)
-
-
-2005-11-19(Sat) 06:08:37 +0900 Koichi Sasada <ko1@atdot.net>
-
- * lib/test : added
-
-
-2005-11-19(Sat) 05:48:50 +0900 Koichi Sasada <ko1@atdot.net>
-
- * compile.c : useless jump elimination (if/unless destination)
-
- * eval.c : rb_iter_break support,
- fix rb_iterate (clear errinfo if break)
-
- * eval_proc.c : support rb_node_arity (YARV_METHOD_NODE)
-
- * insns.def : change variable name
-
- * vm.c : fix th_invoke_yield and add th_iter_break()
-
- * vm_dump.c : fix yarv_bug()
-
- * yarvcore.c : fix proc_mark to check IFUNC node and add
- global ruby method SDR() for debug
-
- * yarvtest/test_syn.rb : add a test for all condition combination
-
-
-2005-11-15(Tue) 05:52:58 +0900 Koichi Sasada <ko1@atdot.net>
-
- * lib/forwardable.rb : added
-
- * common.mk : remove "vm.o : CFLAGS += -fno-crossjumping" rule
-
- * compile.c, yarvcore.h, insns.def : add FCALL/VCALL flag
-
- * compile.c, insns.def : add onceinlinecache instruction
-
- * eval.c : support $!, $@, raise (== raise $!)
-
- * opt_operand.def : add some unification rule (send flags)
-
- * vm.c : fix return process
-
- * vm_macro.def : fix option prameters
-
- * yarvtest/test_method.rb : add tests for above
-
-
-2005-11-15(Tue) 00:42:49 +0900 Koichi Sasada <ko1@atdot.net>
-
- * eval.c : support rb_frame_pop() and rb_frame_callee(),
- add rb_sourcefile(), rb_souceline(),
-
-
- * compile.c : support postposition while/until,
- fix block parameter index
-
- * yarvtest/test_syn.rb : add tests for above
-
- * yarvcore.c : fix env_mark
-
- * vm.h, yarvcore.h : move vm.h#cmethod_info to
- yarvcore.h#yarv_cmethod_info
-
- * vm.c : add th_get_sourceline()
-
- * eval_intern.h : fix PASS_PASSED_BLOCK()
-
- * eval_load.c : fix re-enter require (temporalily)
-
- * insns.def : permit re-open class when superclass is same
-
-
-2005-11-11(Fri) 01:20:15 +0900 Koichi Sasada <ko1@atdot.net>
-
- * common.mk : add "allload" rule
-
- * compile.c, yarvcore.h, insns.def, vm_macro.def, disasm.c :
- change arg_rest, arg_block offset (1)
-
- * insns.def : add postexe instruction
-
- * insns.def, vm.c : support rest block parameter
-
- * yarvtest/test_block.rb : add tests for above
-
- * rb/allload.rb : get path from ARGV
-
- * vm_opts.h.base : set default off
-
-
-2005-11-01(Tue) 08:28:19 +0900 Koichi Sasada <ko1@atdot.net>
-
- * benchmark/other-lang/eval.rb : fix path
-
- * lib/English.rb, lib/cgi.rb, lib/complex.rb, lib/delegate.rb :
- added
-
-
-2005-11-01(Tue) 08:18:33 +0900 Koichi Sasada <ko1@atdot.net>
-
- * compile.c : push and pop values after checkincludearray for
- stack caching
-
-
-2005-10-31(Mon) 15:37:09 +0900 Koichi Sasada <ko1@atdot.net>
-
- * benchmark/bm_app_mandelbrot.rb : added
-
- * benchmark/bm_app_factorial.rb : fixed parameter
-
- * benchmark/bm_so_count_words.rb, benchmark/run_rite.rb : use
- real file
-
- * common.mk : add "ext" rule, add some dependencies and add option
- to bench-each rule (renamed from bench-item)
-
- * compile.c : fix get_root_iseq_object (check iseq type),
- support splat case/when. support //o (regexp)
-
- * eval.c : support *_eval, fix rb_obj_call_init to pass block
-
- * eval_jump.h : support throw/catch
-
- * eval_load.c : save klass_nest_stack when require
-
- * eval_method.h : fix ruby_cbase()
-
- * insnhelper.h : GET_EV_KLASS checks toplevel or not
-
- * insns.def, yarvcore.c : fix singleton method definition and fix
- super class's method
-
- * lib/shellwords.rb : use String() instead of String.new()
-
- * vm.c : check class iseq or not when making Proc and
- add eval_search_super_klass function
-
- * vm.h : CMETHOD_INFO_P to yarvcore.h
-
- * vm_macro.def : splat if object type is T_ARRAY
-
- * vm_opts.h, vm_opts.h.base : rename to vm_opts.h.base
- insns2vm.rb will copy it to build directory
-
- * yarvcore.c : add Proc#[]
-
- * yarvcore.h : change INITIAL_ISEQ_COMPILE_DATA_STORAGE_BUFF_SIZE
- to 512
-
- * yarvtest/test_* : invalidate splat non array code (like: "*1")
-
- * yarvtest/yarvtest.rb : use tempfile instead of popen
-
-
-2005-10-28(Fri) 09:11:53 +0900 Koichi Sasada <ko1@atdot.net>
-
- * yarvtest/test_method.rb : fix test
-
-
-2005-10-28(Fri) 08:43:29 +0900 Koichi Sasada <ko1@atdot.net>
-
- * benchmark/run_rite.rb : add -I options to run benchmark
-
- * common.mk : pass options to some rules with RUNOPT
- and add -I options
-
- * compile.c : fix massign with constant
-
- * yarvtest/test_massign.rb : add tests for above
-
- * eval_load.c : fix load_wait()
-
- * eval_method.h : support ruby_cbase()
-
- * lib/*.rb : add or modify libraries to run on yarv
- * parse.y : change to ANSI C style
-
- * vm.c : fix making proc process under cfunc/ifunc environment
-
- * vm_macro.def : fix block pass
-
- * yarvtest/test_method.rb : add tests for above
-
- * yarvcore.c : add yarv_obj_is_proc()
-
- * eval.c : fix rb_obj_is_proc to use yarv_obj_is_proc()
-
-
-2005-10-27(Thu) 11:50:15 +0900 Koichi Sasada <ko1@atdot.net>
-
- * some files : import from ruby 1.9.0 (2005-10-12)
-
-
-2005-10-16(Sun) 14:50:02 +0900 Koichi Sasada <ko1@atdot.net>
-
- * insns.def, compile.c, yarvcore.h, yarvcore.c : add insns "bitblt" and "answer"
-
-
-2005-10-11(Tue) 17:01:13 +0900 Koichi Sasada <ko1@atdot.net>
-
- * yarv_version.h, Changes : 0.3.2
-
-
-2005-10-11(Tue) 13:35:25 +0900 Koichi Sasada <ko1@atdot.net>
-
- * insns.def : add YARV_CHECK_INTS()
-
- * thread.c, thread_pthread.h, thread_win32.h : kick timer thread
- when another thread kicked
-
- * vm.c : remove debug print
-
- * vm_opts.h : add OPT_CALL_THREADED_CODE
-
- * yarvtest/yarvtest.rb : remove "\r" from answer
-
-
-2005-10-07(Fri) 09:36:36 +0900 Koichi Sasada <ko1@atdot.net>
-
- * yarvcore.h : add member variable "interrupt_flag" to yarv_thread_t
-
-
-2005-10-05(Wed) 21:20:13 +0900 Koichi Sasada <ko1@atdot.net>
-
- * eva.c, eval_thread.c, ruby.h, eval_error.h, eval_jump.h,
- eval_load.c, thread.c, error.c, compile.h : remove ruby_errinfo
-
- * thread_win32.h, thread_pthread.h : set stack size to 4KB
-
- * vm.c : fix making env routine
-
- * vm_dump.c, vm.h : support frame type "EVAL" and fix magic number
-
- * yarvcore.c : fix some mark/free routine
-
-
-2005-10-05(Wed) 09:08:11 +0900 Koichi Sasada <ko1@atdot.net>
-
- * eval.c, eval_intern.h, vm.c, eval_jump.h, yarvcore.h :
- re-define PUSH/POP/EXEC/JUMP_TAG to use thread local tag
-
- * inits.c, yarvcore.c : fix boostrap
-
-
-2005-10-03(Mon) 22:28:24 +0900 Koichi Sasada <ko1@atdot.net>
-
- * compile.c : fix NODE_COLON2 bugs
-
- * compile.h : fix debug routine
-
- * disasm.c : add space between insn and operand
-
- * insns.def : add comment of classdef, singletonclassdef
-
- * vm.c, yarv.h : fix invoke_light routine
-
- * yarvcore.c : fix to mark each threads
-
-
-2005-10-02(Sun) 05:55:34 +0900 Koichi Sasada <ko1@atdot.net>
-
- * thread_pthread.h : add "system_working" global variable
-
-
-2005-10-02(Sun) 01:23:44 +0900 Koichi Sasada <ko1@atdot.net>
-
- * thread.c : add raw gets (for test), and fix indent
-
-
-2005-10-01(Sat) 23:06:21 +0900 Koichi Sasada <ko1@atdot.net>
-
- * thread_win32.h, common.mk : add thread_win32.h
-
- * thread.c : support _WIN32 thread
-
- * thread.c, thread_pthread.h : fix some interface
-
- * eval_thread.c : remove debug print
-
- * gc.c : fix stack region
-
- * win32/Makefile.sub : add -MD flag to LDFLAGS
-
- * yarvcore.c : fix mark and sweep debug print
-
- * yarvcore.h : fix VM#living_threads data type to st_table
-
-
-2005-10-01(Sat) 00:25:28 +0900 Koichi Sasada <ko1@atdot.net>
-
- * thread.c, yarvcore.h : rename GIL (Global Interpreter Lock) to
- GVL (Global VM Lock)
-
- * thread_pthread.h : fix pthread mutex initialize
-
-
-2005-09-30(Fri) 20:11:19 +0900 Koichi Sasada <ko1@atdot.net>
-
- * thread.c : support join with timeout
-
- * yarvcore.h : use GET_VM()
-
-
-2005-09-30(Fri) 14:59:29 +0900 Koichi Sasada <ko1@atdot.net>
-
- * thread.c, common.mk : add thread.c
-
- * thread.c, gc.c, eval_thread.c, yarvcore.c, yarvcore.h :
- support native thread (on pthread)
-
- * insns.def : add YARV_CHECK_INTS() check
-
- * yarv.h : add GET_VM() macro
-
-
-2005-09-29(Thu) 22:43:08 +0900 Koichi Sasada <ko1@atdot.net>
-
- * eval_intern.h, eval_thread.c : move thread_status to eval_intern.h
-
- * yarvcore.c : fix thread/vm value
-
- * yarvcore.h : add some parameter to yarv_thread_t
-
-
-2005-09-29(Thu) 01:52:33 +0900 Koichi Sasada <ko1@atdot.net>
-
- * compile.c, yarvcore.h : add line number on last end instruction
-
- * vm.c : fix line no detection
-
-
-2005-09-28(Wed) 00:02:10 +0900 Koichi Sasada <ko1@atdot.net>
-
- * common.mk, eval_load.c, eval.c, eval_intern.h : add eval_load.c
-
- * disasm.c : fix around block local variables
-
- * eval_proc.c : fix typo
-
-
-2005-09-27(Tue) 16:45:20 +0900 Koichi Sasada <ko1@atdot.net>
-
- * eval.c : remove debug print
-
-
-2005-09-27(Tue) 16:41:47 +0900 Koichi Sasada <ko1@atdot.net>
-
- * eval.c : support Kernel.local_variables
-
- * parse.y, yarvcore.c : move some functions
- (rb_(backref|lastline)_(get|set)) from parse.y to yarvcore.c
-
- * yarvcore.h : fix typo of YARV_PREVIOUS_CONTROL_FRAME
-
-
-2005-09-26(Mon) 18:51:29 +0900 Koichi Sasada <ko1@atdot.net>
-
- * eval.c, compile.c, parse.y, vm.c, yarvcore.h :
- eval() works with binding (Env)
-
- * vm.c : add th_set_eval_stack
-
- * yarvtest/test_syn.rb : remove an assert "defined?(local_var)"
-
-
-2005-09-25(Sun) 19:30:59 +0900 Koichi Sasada <ko1@atdot.net>
-
- * benchmark/bm_vm2_send.rb : added
-
- * common.mk : add rule "bench-item"
-
- * eval_intern.h : add PASS_PASSED_BLOCK()
-
- * eval_proc.c : support some functions
-
- * rb/mklog.rb : added
-
- * vm.c : fix prototype style and coding style
-
- * yarv.h : add some prototypes of functions
-
- * yarvcore.c, yarvcore.h, eval.c : yarv_thread_t#ifuncnode -> passed_block,
- and add yarv_proc_t#safe_level
-
-
-2005-09-25(Sun) 11:01:17 +0900 Koichi Sasada <ko1@atdot.net>
-
- * some files : import from ruby 1.9.0 (2005-09-25)
-
- * eval*, vm.c, vm_macro.def : remove frame, scope, ...
-
- * yarvcore.c : remove yarv_block_given_p()
-
- * yarvcore.h, insnhelper.h : move some macro from insnhelper.h to yarvcore.h
- to use these in eval.c
-
-
-2005-09-24(Sat) 15:51:42 +0900 Koichi Sasada <ko1@atdot.net>
-
- * eval* : remove dependency to ruby_dyna_vars and ruby_class
-
-
-2005-09-23(Fri) 20:39:14 +0900 Koichi Sasada <ko1@atdot.net>
-
- * eval_*.[ch] : split eval.c to some files
-
- * *.[ch] : import ruby 1.9.0 (2004-09-23)
-
- * parse.y : remove dependency to ruby_dyna_vars and ruby_scope
-
-
-2005-09-15(Thu) 16:51:06 +0900 Koichi Sasada <ko1@atdot.net>
-
- * compile.c, yarvcore.h : fix "for" scope
-
- * yarvtest/test_block.rb : add tests for above
-
-
-2005-09-14(Wed) 06:11:43 +0900 Koichi Sasada <ko1@atdot.net>
-
- * yarvcore.h, vm_evalbody.h, vm.h, vm_dump.c,
- compile.c, yarvcore.c : use #ifdef insted of #if for recognize
- vm options
-
- * vm_opts.h : fix default options
-
-
-2005-09-10(Sat) 14:10:08 +0900 Koichi Sasada <ko1@atdot.net>
-
- * vm_opts.h : added
-
- * yarvcore.h, rb/insns2vm.h : use vm_opts.h
-
-
-2005-09-10(Sat) 04:53:22 +0900 Koichi Sasada <ko1@atdot.net>
-
- * yarvcore.h, insns.def, compile.c : add DEFINED_YIELD
-
- * yarvtest/test_yield.rb : add test_1_ary_and_1_params
-
- * insns.def : fix splat and svalue
-
- * vm.c : fix to perform with proc with ifunc (incomplete)
-
- * sample/test.rb : added (comment out unsupported features)
-
- * common.mk : add rule "runtest"
-
-
-2005-09-09(Fri) 19:32:11 +0900 Koichi Sasada <ko1@atdot.net>
-
- * insns.def, compile.c : add splatarray
-
- * yarvtest/test_massign.rb : add tests for above
-
-
-2005-08-31(Wed) 22:55:15 +0900 Koichi Sasada <ko1@atdot.net>
-
- * yarvcore.c (yarvcore_eval_parsed): fix to return value
-
- * yarv_version.h, Changes : 0.3.1
-
-
-2005-08-20(Sat) 10:19:27 +0900 Koichi Sasada <ko1@atdot.net>
-
- * rb/ir.rb : add some check
-
- * import today's ruby HEAD
-
-
-2005-08-18(Thu) 23:29:52 +0900 Koichi Sasada <ko1@atdot.net>
-
- * common.mk : fix object file extension
-
- * rb/ir.rb : added (import ruby script)
-
- * rb/diff.rb : removed
-
- * import today's ruby HEAD
-
-
-2005-08-18(Thu) 12:59:38 +0900 Koichi Sasada <ko1@atdot.net>
-
- * common.mk : rule test -> test2, test1 -> test
-
- * compile.c : fix when clause bug and splat arugment
-
-
-2005-08-17(Wed) 05:22:31 +0900 Koichi Sasada <ko1@atdot.net>
-
- * compile.c : fix block local parameter setting routine and support
- massign in block parameter initialze
-
- * yarvtest/test_yield.rb : add tests for above
-
- * insns.def, compile.c : support array concat (ex: "[x, *y]")
-
- * yarvtest/test_bin.rb : add tests for above
-
-
-2005-08-16(Tue) 19:51:19 +0900 Koichi Sasada <ko1@atdot.net>
-
- * compile.c : support nested massign
-
- * yarvtest/test_massign.rb : add tests for above
-
-
-2005-08-16(Tue) 10:25:29 +0900 Koichi Sasada <ko1@atdot.net>
-
- * eval.c : support rb_yield_0 with 0 args
-
-
-2005-08-16(Tue) 09:09:21 +0900 Koichi Sasada <ko1@atdot.net>
-
- * lib/fileutils.rb : imported
-
- * insns.def : fix yield argument (same as last commit)
-
- * yarvtest/test_yield.rb : add tests for above
-
-
-2005-08-16(Tue) 08:29:47 +0900 Koichi Sasada <ko1@atdot.net>
-
- * eval.c : fix to support rb_yield_0 with multiple values
-
- * common.mk : add parse, run1p ruelse
-
- * compile.c : support yield with ARGSCAT/SPLAT
-
- * vm.c, insns.def : fix yield arguments to do compatible behaviour
-
- * yarvtest/test_yield.rb : added for above
-
-
-2005-08-16(Tue) 06:00:17 +0900 Koichi Sasada <ko1@atdot.net>
-
- * insns.def : fix to set klass_nest_stack on singleton
- method definition
-
- * yarvtest/test_method.rb : add a test for above
-
-
-2005-08-16(Tue) 05:34:48 +0900 Koichi Sasada <ko1@atdot.net>
-
- * test1.rb : added. gdb and run1 rule run this script
-
- * compile.c : fix error handled variable access
-
- * yarvtest/test_exception.rb : add tests for above
-
-
-2005-08-16(Tue) 04:26:08 +0900 Koichi Sasada <ko1@atdot.net>
-
- * base ruby : ruby 1.9.0 (2005-08-15)
-
-
-2005-08-16(Tue) 03:54:17 +0900 Koichi Sasada <ko1@atdot.net>
-
- * common.mk, Makefile.in : move some rules to common.mk
-
- * rb/diff.rb : added
-
- * yarvtest/yarvtest.rb : fix to compare output last value
-
-
-2005-08-15(Mon) 18:27:58 +0900 Koichi Sasada <ko1@atdot.net>
-
- * Changes : 0.3.0
-
-
-2005-08-15(Mon) 17:56:09 +0900 Koichi Sasada <ko1@atdot.net>
-
- * yarvcore.c : fix to add prototype
-
- * all files : propset svn:eol-style native
-
-
-2005-08-15(Mon) 10:48:53 +0900 Koichi Sasada <ko1@atdot.net>
-
- * eval.c : support rb_load
-
-
-2005-08-15(Mon) 09:42:01 +0900 Koichi Sasada <ko1@atdot.net>
-
- * yarvcore.h : define SDR()
-
- * vm_dump.c : stack_dump_raw() -> vm_stack_dump_raw()
-
- * yarvtest/yarvtest.rb : add rite test scheme
-
- * benchmark/run_rite.rb : added
-
- * yarvcore.c, inits.c : add Init_vm()
-
- * yarv.h : add some prototype declarations, GET_THREAD()
-
- * eval.c : remove unused functions
-
- * eval.c : support Kernel.eval, some schemes (same as evalc.patch)
-
-
-2005-08-15(Mon) 00:53:28 +0900 Koichi Sasada <ko1@atdot.net>
-
- * yarv_version.h : move configurations to yarvcore.h
-
- * yarvcore.c : remove VALUE yarv_get_current_running_thread() and
- add yarv_thread_t *yarv_get_current_running_thread(), ...
-
- * yarvcore.h : yarv_thread_t#vm -> vm_value
-
- * compile.c : fix "break from nested classes"
-
- * yarvext/extconf.rb : use have_func instead of defined?(YARV_PACHED)
-
- * depend : fix pass
-
- * eval.c : change to kick VM
-
- * version.c : fix to show yarv version
-
- * common.mk : fix dependent
-
- * inits.c : fix to kick Init_yarvcore
-
-
-2005-08-14(Sun) 02:05:15 +0900 Koichi Sasada <ko1@atdot.net>
-
- * README : add description
-
- * yarvext/depend : move to topdir/depend
-
-2005-08-14(Sun) 01:50:43 +0900 Koichi Sasada <ko1@atdot.net>
-
- * merge yarv to ruby (prepare)
-
- * make yarvext/ to build as extension
-
-
-2005-08-13(Sat) 09:36:26 +0900 Koichi Sasada <ko1@atdot.net>
-
- * evalc.patch, insns.def, compile.c : fix to support current
- ruby HEAD.
-
- * 0.2.3
-
-
-2005-08-08(Mon) 19:13:02 +0900 Koichi Sasada <ko1@atdot.net>
-
- * version.h, Changes : 0.2.2
-
-
-2005-08-08(Mon) 17:17:50 +0900 Koichi Sasada <ko1@atdot.net>
-
- * vm.h, vm.c, insns.def, yarvcore.h, yarvcore.c :
- remove yarv_iseq_t#iseq_dt and add yarv_iseq_t#encoded.
- use yarv_iseq_t#encoded anytime
-
- * vm_evalbody.h, vm.h, extconf.rb, version.h :
- support call threaded code (incomplete)
-
-
-2005-08-01(Mon) 05:26:12 +0900 Koichi Sasada <ko1@atdot.net>
-
- * yarvcore.c : support yield with multiple values
-
- * compile.c : fix dynavars
-
- * yarvcore.h : fix to mark defined method
-
-
-2005-07-31(Sun) 23:27:24 +0900 Koichi Sasada <ko1@atdot.net>
-
- * yarvcore.c, vm.c, insns.def : fix search object path
-
- * compile.c : fix "for" statement
-
- * vm_macro.def : fix rest, opt arguments
-
-
-2005-07-31(Sun) 14:52:06 +0900 Koichi Sasada <ko1@atdot.net>
-
- * vm_macro.def : fix block parameter
-
- * compile.c : fix to unuse compile_data->in_ensure
-
- * insns.def : add orphan check when return
-
-
-2005-07-31(Sun) 03:25:05 +0900 Koichi Sasada <ko1@atdot.net>
-
- * vm.c, compile.c, yarvcore.h, insns.def :
- support jump from rescue/ensure/class/module
-
- * test/test_flow.rb : add tests for above fix
-
-
-2005-07-30(Sat) 04:44:33 +0900 Koichi Sasada <ko1@atdot.net>
-
- * yarvcore.h : struct iseq_compile_data_ensure_node_stack is added
-
- * compile.c : insert ensure clause before break/next/redo
-
- * vm.c : fix return/break handling
-
- * yarv.h, vm.c : fix lightweight yield
-
- * vm.c, insns.def, vm_macro.def : change arguments of th_set_env (add sp)
-
- * test/test_flow.rb : added
-
- * test/yarvtest.rb : add ae_flow
-
- * compile.c, vm_macro.def : add tail-call/tail-recursion optimization
- (experimental)
-
-
-2005-07-29(Fri) 20:14:11 +0900 Koichi Sasada <ko1@atdot.net>
-
- * compile.c : make_name_for_block and make_name_with_str
- are added
-
- * insns.def : fix if unmatched size arg size to yield
-
- * test/test_block.rb : add test for above fix
-
- * vm.c : add th_backtrace_each and fix backtrace notation
-
- * yarvcore.c : set top level iseq name to "<main>"
-
-
-2005-07-29(Fri) 13:20:19 +0900 Koichi Sasada <ko1@atdot.net>
-
- * yarvcore.h : fix yarv_iseq_t to pass VC (cl)
-
- * vm_dump.c : ditto
-
- * compile.h : ditto
-
- * insnhelper.h : ditto
-
- * vm_evalbody.h : include 'math.h'
-
- * insns.def, vm.c : raise error when yield without block
-
- * vm.c : implement thread_backtrace
-
- * vm.c, yarvsubst.c, yarv.h : implement thread_yield_light_prepare and
- thread_yield_light_invoke
-
- * yarvcore.c : Integer#times uses yarv specific version
-
-
-2005-07-28(Thu) 21:35:09 +0900 Koichi Sasada <ko1@atdot.net>
-
- * yarvcore.c : add another mark function for thread/stack
-
- * vm_evalbody.h : fix register allocation for x86_64
-
- * vm.h : use asm for tc on x86_64
-
-
-2005-07-28(Thu) 20:17:09 +0900 Koichi Sasada <ko1@atdot.net>
-
- * yarvcore.c : add mark/free message to debug gc
-
- * insnhelper.h, insns.def, vm_macro.def : remove and
- add new RESTORE_REGS
-
- * vm_evalbody.h : fix register allocation
-
-
-2005-07-28(Thu) 02:00:42 +0900 Koichi Sasada <ko1@atdot.net>
-
- * vm.c, etc : change VM stack structure. re-write all
- vm functions to do it
-
- * vm_macro.def : added
-
-
-2005-07-08(Fri) 01:36:49 +0900 Koichi Sasada <ko1@atdot.net>
-
- * insns.def : don't use fmod on AMD64
-
-
-2005-07-08(Fri) 00:14:22 +0900 Koichi Sasada <ko1@atdot.net>
-
- * Changes : added
-
-
-2005-07-07(Thu) 23:54:37 +0900 Koichi Sasada <ko1@atdot.net>
-
- * version.h : 0.3.0
-
-
-2005-07-07(Thu) 23:52:03 +0900 Koichi Sasada <ko1@atdot.net>
-
- * 0.2.1 : released
-
-
-2005-07-07(Thu) 23:50:22 +0900 Koichi Sasada <ko1@atdot.net>
-
- * version.h : 0.2.1
-
-
-2005-07-07(Thu) 23:47:55 +0900 Koichi Sasada <ko1@atdot.net>
-
- * rb/insns2vm.rb, extconf.rb : add --[enable|disable]-opt-unify-all-combination
- and --disable-opts
-
- * vm.h : DISPATCH_ARCH_DEPEND_WAY is only enabled on GCC 3.x
-
-
-2005-07-06(Wed) 13:20:27 +0900 Koichi Sasada <ko1@atdot.net>
-
- * depend, rb/eval.rb : add ITEMS option to benchmark rule
-
- * benchmark/* : changed
-
- * benchmark/other-lang/* : added
-
-
-2005-07-04(Mon) 04:02:15 +0900 Koichi Sasada <ko1@atdot.net>
-
- * yarvcore.h. yarvcore.c : add idDIV, idMOD, idEq, idLength
-
- * compile.c, insns.def : add specialized insn for above method id
-
- * test/test_bin.rb : add tests for above
-
-
-2005-07-03(Sun) 20:31:09 +0900 Koichi Sasada <ko1@atdot.net>
-
- * yarvcore.c, yarvcore.h : remove cYarvThrowObject (unused)
-
- * yarvcore.c, yarvcore.h, insns.def :
- thread_object#stack_mark_poinetr
-
- * depend, rb/eval.rb : BOPT, TOPT -> OPT
-
-
-2005-07-03(Sun) 13:53:47 +0900 Koichi Sasada <ko1@atdot.net>
-
- * compile.c, compile.h : INSN_OBJECT, LABEL_OBJECT -> INSN, LABEL,
- ISEQ_LINK_ELEMENT, ISEQ_LINK_ANCHOR -> LINK_ELEMENT, LINK_ANCHOR,
- and some fixes
-
- * tmpl/optinsn.inc.tmpl : ditto
-
- * yarvcore.c, yarvcore.h : remove label_object, insn_object
- prepare_iseq_build, cleanup_iseq_build are added
-
- * insns.def : remove unused variable from send
-
-
-2005-07-02(Sat) 04:19:22 +0900 Koichi Sasada <ko1@atdot.net>
-
- * insns.def : add GC protect for opt_aset
-
-
-2005-07-02(Sat) 03:49:17 +0900 Koichi Sasada <ko1@atdot.net>
-
- * extconf.rb : add option -fno-reorder-blocks to vm.asm rule
-
- * insns.def : fix opt_aset bugs
-
- * test/test_bin.rb : add tests for aset, aref
-
-
-2005-07-02(Sat) 03:05:12 +0900 Koichi Sasada <ko1@atdot.net>
-
- * benchmark/run.rb : fix output
-
- * vm_evalbody.h : add register for x86_64
-
- * rb/asm_parse.rb : fix to shor size and length
-
-
-2005-07-02(Sat) 02:56:31 +0900 Koichi Sasada <ko1@atdot.net>
-
- * compile.c : move specialized instruction point (new_insn_send)
-
- * insns.def : add opt_aref, opt_aset
-
-
-2005-07-01(Fri) 11:04:11 +0900 Koichi Sasada <ko1@atdot.net>
-
- * compile.h : fix to pass VALUE type to new_insn_body
-
- * insnhelper.h : add cast
-
- * compile.c : fix getdynamic argument (0 == Qfalse -> I2F(0))
-
-
-2005-06-30(Thu) 23:34:10 +0900 Koichi Sasada <ko1@atdot.net>
-
- * rb/eval.rb : add and fix some rules
-
- * rb/insns2vm.rb : generate all
-
- * benchmark/run.rb : add -r (ruby only) option
-
-
-2005-06-30(Thu) 23:25:23 +0900 Koichi Sasada <ko1@atdot.net>
-
- * tmpl/vmtc.inc.tmpl : add const prefix
-
- * /rb/asm_parse.rb, extconf.rb : added and make assembler analised output
-
- * opt_operand.def : add send operands unification
-
- * insnhelper.h : add HEAP_CLASS_OF(obj)
-
- * insns.def : fix opt_plus, opt_ltlt
-
- * vm_evalbody.h : move _tag
-
- * benchmark/run.rb : fix file select
-
-
-2005-06-30(Thu) 06:07:04 +0900 Koichi Sasada <ko1@atdot.net>
-
- * extconf.rb : add collect-usage-analysis option
-
- * opt_operand.def, opt_insn_unif.def : add some rules
-
-
-2005-06-29(Wed) 23:28:44 +0900 Koichi Sasada <ko1@atdot.net>
-
- * yarvcore.h, extconf.rb, vm.h, compile.c :
- DISPATCH_DIRECT_THREADED_CODE, DISPATCH_THREADED_CODE
- -> OPT_DIRECT_THREADED_CODE, OPT_INDIRECT_THREADED_CODE.
- if at least one of then is defined, OPT_THREADED_CODE is defined
-
- * benchmark/* : fix name and parameters
-
- * rb/eval.rb : added for YARV evaluation
-
-
-2005-06-29(Wed) 16:16:52 +0900 Koichi Sasada <ko1@atdot.net>
-
- * benchmark/run.rb : fix output format
-
- * call_cfunc.inc -> call_cfunc.h
-
- * vm.h : add sign by asm statement
-
-
-2005-06-28(Tue) 22:28:40 +0900 Koichi Sasada <ko1@atdot.net>
-
- * vm.c : fix method search
-
-
-2005-06-28(Tue) 22:26:34 +0900 Koichi Sasada <ko1@atdot.net>
-
- * extconf.rb : fix options
-
-
-2005-06-28(Tue) 21:50:58 +0900 Koichi Sasada <ko1@atdot.net>
-
- * benchmark/run.rb : fix output format
-
-
-2005-06-28(Tue) 21:34:54 +0900 Koichi Sasada <ko1@atdot.net>
-
- * depend : add option TOPT to test rules
-
- * benchmark/run.rb : fix output format
-
-
-2005-06-28(Tue) 21:15:54 +0900 Koichi Sasada <ko1@atdot.net>
-
- * compile.c : fix opt_case_dispatch instruction
-
- * benchmark/run.rb : output all usertimes when exit benchmark
-
-
-2005-06-28(Tue) 20:35:55 +0900 Koichi Sasada <ko1@atdot.net>
-
- * extconf.rb, compile.c, tmpl/optinsn.inc.tmpl, vm.c :
- change extconf options
-
-2005-06-28(Tue) 13:20:59 +0900 Koichi Sasada <ko1@atdot.net>
-
- * benchmark/run.rb : add -y, --yarv-only option
-
- * depend : add BOPT to tbench rule
-
-
-2005-06-27(Mon) 23:31:12 +0900 Koichi Sasada <ko1@atdot.net>
-
- * depend : add gdb rule
-
- * vm.h : use inline assembler for x86 (to support gcc 3.4.x)
-
-
-2005-06-27(Mon) 20:04:10 +0900 Koichi Sasada <ko1@atdot.net>
-
- * yarvcore.c, compile.c, disasm.c : remove unused variables
-
- * vm.h, insnhelper.h, debug.h : fix to reduce warning
-
- * vm.c, vm_dump.c : move VM state dump (debug) functions to vm_dump.c
-
- * depend : adde reconf rule
-
- * insnhelper.h :
-
- * vm_evalbody.inc : rename to vm_evalbody.h
-
-
-2005-06-27(Mon) 16:50:31 +0900 Koichi Sasada <ko1@atdot.net>
-
- * insns2vm.rb : fix generating unif insn
-
- * compile.c : add useless pop/swap insn elimination with stack caching
-
- * depend : remove compiled.o dependency
-
-
-2005-06-26(Sun) 14:06:22 +0900 Koichi Sasada <ko1@atdot.net>
-
- * benchmark/run.rb : use tmpfile instead of popen
-
- * rb/insns2vm.rb : fix generating insn unification logic
-
- * opt_insn_unif.def : add some unification rules
-
- * compile.c : add verify_list function and fix unification logic
-
-
-2005-06-22(Wed) 12:58:26 +0900 Koichi Sasada <ko1@atdot.net>
-
- * yarvcore.h, yarvcore.c, insns.def, compile.c : add mult optimization
-
- * test/test_bin.rb : add test_fact
-
-
-2005-06-21(Tue) 22:34:07 +0900 Koichi Sasada <ko1@atdot.net>
-
- * yarvcore.h, compile.[ch], tmpl/optinsn.inc.tmpl, rb/insns2vm.rb :
- change data structure (don't use Ruby's array to represent a
- instruction sequence)
-
- * disasm.c : add separator
-
-
-2005-06-14(Tue) 07:48:58 +0900 Koichi Sasada <ko1@atdot.net>
-
- * compile.c : support "for" statement
-
- * test/test_block.rb : add test for above
-
- * yarvcore.[ch] : add global id idEach
-
-
-2005-06-08(Wed) 22:30:44 +0900 Koichi Sasada <ko1@atdot.net>
-
- * compile.c : add if/unless(L1) jump (L2) :L1 => unless/if(L2)
- optimize (condition reversal) and fix typo
-
-
-2005-06-07(Tue) 08:29:41 +0900 Koichi Sasada <ko1@atdot.net>
-
- * yarvcore.c : fix to remove compiler warning
-
- * version.h : 0.2.1
-
-
-2005-06-07(Tue) 08:16:22 +0900 Koichi Sasada <ko1@atdot.net>
-
- * yarvcore.h : iseq_link_element changed to double linked list
-
- * disasm.c : support dump struct iseq_link_element
-
- * compile.c : use double linked list instead of array
- for intermediate representation
-
-
-2005-06-06(Mon) 15:38:44 +0900 Koichi Sasada <ko1@atdot.net>
-
- * yarvcore.h, yarvcore.c : add link structure to insn and label object
-
- * compile.h, compile.c : remove some variables in function top scope
- of iseq_compile_each and some optimization (now working)
-
-
-2005-06-04(Sat) 16:12:59 +0900 Koichi Sasada <ko1@atdot.net>
-
- * compile.c : fix previous commit
-
-
-2005-06-04(Sat) 15:56:21 +0900 Koichi Sasada <ko1@atdot.net>
-
- * compile.c : fix stack caching (after jump state)
-
-
-2005-06-04(Sat) 09:12:13 +0900 Koichi Sasada <ko1@atdot.net>
-
- * compile.c : fix some point for previous commit
-
-
-2005-06-04(Sat) 07:31:21 +0900 Koichi Sasada <ko1@atdot.net>
-
- * compile.c, insns.def : optimize case/when statement
- (dispatch on constant time)
-
- * yarvcore.h, disasm.c, rb/insns2vm.rb : fixed for above
- (CDHASH)
-
- * test/test_syn.rb : add test for above
-
-
-2005-06-04(Sat) 03:41:29 +0900 Koichi Sasada <ko1@atdot.net>
-
- * yarvcore.h, yarvcore.c : add some temporary variable test
- (it'll be vanished)
-
- * compile.c : NODE_CASE optimize (use topn instead of dup/swap)
-
-
-2005-06-03(Fri) 00:54:38 +0900 Koichi Sasada <ko1@atdot.net>
-
- * compile.c : apply flow optimization for while/until statement
-
-
-2005-03-04(Fri) 19:34:32 +0900 Koichi Sasada <ko1@atdot.net>
-
- * rb/insns2vm.rb : fix category (comment)
-
- * depend : remove space betweeen target name and colon
-
-
-2005-03-04(Fri) 15:55:51 +0900 Koichi Sasada <ko1@atdot.net>
-
- * tmpl/yarvarch.ja : fix typo
-
-
-2005-03-04(Fri) 13:30:19 +0900 Koichi Sasada <ko1@atdot.net>
-
- * depend : add a rule for jitcompile.o
-
- * vm.h : fix a macro argument
-
- * version.h : 0.2.0
-
-
-2005-03-03(Thu) 08:35:14 +0900 Koichi Sasada <ko1@atdot.net>
-
- * extconf.rb : remove vm_evalbody.inc call_cfunc.inc from clean target
-
-
-2005-03-03(Thu) 00:54:15 +0900 Koichi Sasada <ko1@atdot.net>
-
- * tmpl/insns.inc.tmpl : fixed typo
-
- * insns.def : store th->pc to current pc
-
-
-2005-03-03(Thu) 00:31:47 +0900 Koichi Sasada <ko1@atdot.net>
-
- * tmpl/yarvarch.ja, doc/yarv.rb : write current architecture of yarv
-
-
-2005-03-01(Tue) 13:50:04 +0900 Koichi Sasada <ko1@atdot.net>
-
- * yarvcore.c (yarvcore_eval_parsed) : added
- (separeted from yarvcore_eval)
-
- * yarvcore.c, compile.c : iseq_translate_direct_threaded_code
- is moved to compile.c
-
- * depend : add rule for yasmdata.rb
-
- * rb/yasm.rb : support top-level and method-level assemble
-
-
-2005-02-26(Sat) 08:09:57 +0900 Koichi Sasada <ko1@atdot.net>
-
- * rb/insns2vm.rb, compile.c, vm.h : change type long to OFFSET
-
- * tmpl/yasmdata.rb.tmpl : added
-
- * rb/insns2vm.rb : add yasmdata_rb method
-
- * rb/yasm.rb : fix some interface (incomplete)
-
- * compile.c : iseq_setup added
-
- * yarvcore.c : YARVCore::InstructionSequence::Instruction#make added
-
-
-2005-02-24(Thu) 07:45:37 +0900 Koichi Sasada <ko1@atdot.net>
-
- * rb/yasm.rb : added
-
-
-2005-02-24(Thu) 01:13:33 +0900 Koichi Sasada <ko1@atdot.net>
-
- * compile.c : remove useless statements
-
-
-2005-02-24(Thu) 00:46:44 +0900 Koichi Sasada <ko1@atdot.net>
-
- * rb/insns2vm.rb (InsnInfo) : add @is_sc attr and remove
- is_sc method
-
- * compile.c : fix NODE_CASE/NODE_WHEN bug (cond at 'when'
- must not be popped)
-
- * compile.c : support NODE_OP_ASGN1 to &&= and ||=
-
- * test/test_bin.rb : add tests for above
-
-
-2005-02-23(Wed) 09:17:01 +0900 Koichi Sasada <ko1@atdot.net>
-
- * vm.c, yarvcore.c : thread_svar added and fix svar location
-
-
-2005-02-21(Mon) 08:38:02 +0900 Koichi Sasada <ko1@atdot.net>
-
- * yarvcore.h : make type "struct iseq_compile_data"
-
- * yarvcore.h : iseq_object#insn_info_ary to iseq_object#insn_info_tbl
-
-
-2005-02-21(Mon) 05:24:01 +0900 Koichi Sasada <ko1@atdot.net>
-
- * yarvcore.c (compile_string) : remove null check of node
-
-
-2005-02-19(Sat) 03:52:45 +0900 Koichi Sasada <ko1@atdot.net>
-
- * version.h : 0.1.1
-
-
-2005-02-18(Fri) 20:57:18 +0900 Koichi Sasada <ko1@atdot.net>
-
- * yarvcore.h, yarvcore.c : add idLTLT, idMethodMissing
-
- * compile.c : suopport lval (or others) block parameter
-
- * test/test_block.rb : add tests for above
-
- * insns.def (send) : support method_missing
-
- * test/test_method.rb : add tests for above
-
- * insns.def : opt_ltlt and
-
-
-2005-02-18(Fri) 08:54:40 +0900 Koichi Sasada <ko1@atdot.net>
-
- * benchmark/runc.rb : added
-
- * benchmark/contrib/pentomino.rb : added opt_ltlt
- and Float, String plus specialization
-
-
-2005-02-18(Fri) 07:49:42 +0900 Koichi Sasada <ko1@atdot.net>
-
- * compile.c : remove debug print
-
- * rb/aotcompile.rb : skip if yarvcore.so is not created
-
-
-2005-02-18(Fri) 06:46:13 +0900 Koichi Sasada <ko1@atdot.net>
-
- * compile.c : fix block passing
- and block argument
-
-
-2005-02-18(Fri) 05:52:41 +0900 Koichi Sasada <ko1@atdot.net>
-
- * vm.c : thread_get_ev_const, thread_get_ev_defined is added
- (separated from insns.def)
-
- * insnhelper.h : GET_EV_KLASS(klass) is added
- (separated from insns.def)
-
- * yarvcore.h, insns.def, compile.c : support defined? expression (limited)
-
- * test/test_syn.rb : tests for above is added
-
- * compile.c, insns.def : support block passed method dispatch
-
- * test/test_method.rb : tests for above is added
-
- * compile.h : CALL_ARGS_SPLAT is removed
-
-
-2005-02-16(Wed) 13:32:37 +0900 Koichi Sasada <ko1@atdot.net>
-
- * disasm.c : fix ID to String method
-
- * compile.c : NODE_SUPER, NODE_ZSUPER check 'poped'
- and NODE_RETURN check outer type
- and NODE_DREGX_ONCE supported (temporarily)
-
- * test/test_syn.rb : add a test
-
- * test/test_jump.rb : add a test
-
-
-2005-02-16(Wed) 06:07:41 +0900 Koichi Sasada <ko1@atdot.net>
-
- * compile.[hc] : use Symbol instead of Fixnum to represent ID
-
- * rb/insns2vm.rb : add attr_reader :insns, :insn_map
-
- * vm.h, rb/insns2vm.rb : END_INSN have one arg
-
- * jitcompile.c : jit compiler framework (experimental)
-
- * rb/aotcompile.rb : refactoring
-
- * compiled.c : add constant pool
-
- * vm_evalbody.inc, call_cfunc.inc, vm.c : separeted from vm.c
-
- * insns.def : fix return val
-
- * depend : add rules for compiled.o
-
-
-2005-02-14(Mon) 13:09:01 +0900 Koichi Sasada <ko1@atdot.net>
-
- * insnhelper.h, yarvcore.h: move YARV_METHOD_NODE to yarvcore.h
-
- * yarvcore.h : add 2 members jit_compiled and iseq_orig
- to struct iseq_object
-
- * yarvcore.c : add yarv_jitcompile and global function jitcompile
-
- * insns.def : insn opt_call_native_compiled added
-
- * jitcompile.c : added
-
-
-2005-02-12(Sat) 05:38:51 +0900 Koichi Sasada <ko1@atdot.net>
-
- * insns.def (putstring) : fixed to duplicate string object
-
- * rb/insns2vm.rb, tmpl/optunifs.inc.tmpl, compile.c : support
- instructions unification (aka super instruction)
-
- * opt_insn_unif.def : added for above
-
- * benchmark/bm_unif1.rb : added to measure efficiency of unification
-
- * depend : fixed for above
-
- * extconf.rb : add option --(enable|disalbe)-opt-insns-unification
-
-
-2005-02-11(Fri) 12:14:39 +0900 Koichi Sasada <ko1@atdot.net>
-
- * yarvcore.c, vm.c, insns.def : permit to access svar from
- cfunc environment
-
- * test/test_method.rb : add tests for above
-
-
-2005-02-09(Wed) 19:31:06 +0900 Koichi Sasada <ko1@atdot.net>
-
- * ite.rb : added (ruby -rite [script file])
-
-
-2005-02-09(Wed) 02:25:43 +0900 Koichi Sasada <ko1@atdot.net>
-
- * yarvcore.[hc] : add member compile_data (hash) to iseq_object
-
- * compile.c, yarvcore.h : check label is already set
-
- * compile.c, extconf.rb : support __goto__ and __label__ statement
-
-
-2005-01-25(Tue) 12:49:27 +0900 Koichi Sasada <ko1@atdot.net>
-
- * test/test_block.rb : add break test to test_times
-
-
-2005-01-25(Tue) 03:34:04 +0900 Koichi Sasada <ko1@atdot.net>
-
- * extconf.rb : check ruby version if yarv patch is applied or not
-
- * evalc.patch : fixed for rb_call_super and above check
-
-
-2005-01-25(Tue) 03:21:48 +0900 Koichi Sasada <ko1@atdot.net>
-
- * rb/insns2vm.rb : refactoring (mainly, make InsnsDef::InsnInfo
- to represent each instruction information)
-
- * depend, rb/makedocs.rb : fixed for above
-
- * yarvcore.c (thread_call_super) : added
-
- * vm.c (thread_call_super) : added
-
- * vm.h : add struct cmethod_info
-
- * insns.def, vm.c : use cmethod_info to represent C method info
-
- * insns.def : use iseq_object#klass_nest_stack
- to search super/zsuper's class
-
- * prosym.rb : removed
-
- * ToDo : write todo things on wiki
-
-
-
-2005-01-18(Tue) 23:44:47 +0900 Koichi Sasada <ko1@atdot.net>
-
- * benchmark/run.rb : check ENV['RUBY'] to use ruby binary
-
-
-2005-01-10(Mon) 08:44:40 +0900 Koichi Sasada <ko1@atdot.net>
-
- * version.h : 0.1.0
-
-
-2005-01-09(Sun) 22:01:29 +0900 Koichi Sasada <ko1@atdot.net>
-
- * repository : svn propset svn:eol-style native *.c *.h tmpl/*.tmpl
-
-
-2005-01-09(Sun) 21:48:38 +0900 Koichi Sasada <ko1@atdot.net>
-
- * yarvcore.c : FREE_UNLESS_NULL, MARK_UNLESS_NULL macros are added
-
- * yarvcore.c : some insn/label methods are added
-
- * yarvcore.h : add structure menber "insns_ary" to iseq_object
-
- * vm.c, insns.def (thread_eval_body) : return values with throw
-
- * prosym.rb : added
-
- * insns.def : add YARV_AOT_COMPILED and some procedure
-
- * depend : add compiled.c
-
- * compiled.c : added to build compiled Ruby program (C source)
- by AOT compiler
-
- * rb/aotcompile.rb : AOT compiler
-
- * aotct.rb, rb/aotctest.rb : test and benchmark AOT compiler
-
- * rb/allload.rb : added
-
-
-2005-01-09(Sun) 08:30:38 +0900 Koichi Sasada <ko1@atdot.net>
-
- * yarvcore.c (yarv_yield_values) : added
-
- * vm.c (thread_call0) : change interface. substitute rb_call0 in
- yarv environment
-
- * yarvcore.c (yarv_call0) : fix for above
-
- * yarvcore.c (yarv_call0_cfunc) : removed
-
- * yarvcore.c : change passing items for yarv_setup
-
- * evalc.patch : fix for above
-
- * benchmark/bm_lists.rb : fix (unsupport block passing)
-
- * benchmark/run.rb : use full path to ruby
-
- * insns.def (yield): raise error if argc > expected argc
-
-
-2005-01-08(Sat) 16:07:48 +0900 Koichi Sasada <ko1@atdot.net>
-
- * extconf.rb : add descrioptions
-
- * compile.c : fix bugs (getinlinecache operands)
-
- * yarvcore.c : initial value of yarvGlobalStateVersion
- to 1
-
-
-2005-01-08(Sat) 14:39:04 +0900 Koichi Sasada <ko1@atdot.net>
-
- * yarvcore.c, vm.c, evalc.patch : support making backtrace
- (incompatible with current ruby interpreter)
-
-
-2005-01-08(Sat) 11:25:46 +0900 Koichi Sasada <ko1@atdot.net>
-
- * evalc.patch : commit for previous commit change
-
- * yarvcore.h, compile.c, insns.def : MC to IC (inline cache),
- and changed to using IC by set/getinlinecache
-
-
-2005-01-08(Sat) 10:04:33 +0900 Koichi Sasada <ko1@atdot.net>
-
- * yarvcore.c : add global variable sym[IC]FUNC
-
- * yarvcore.c (yarv_iterate, yarv_call0_cfunc) : added
- (each called from rb_iterate, rb_call0 with NODE_CFUNC)
-
- * vm.c (stack_dump_raw) : fixed to prints more detail
-
- * vm.c (stack_dump_th, stack_dump_thobj) : added to
- dumps thread_object states (for VALUE, struct pointer)
-
- * vm.c (thread_dump_regs) : added
-
- * vm.c (thread_call0, thread_call0_cfunc, thread_invoke_yield,
- thread_invoke_yield_cfunc), insns.def (yield, send) :
- fixed, added to support IFUNC
-
- * vm.c, yarvcore.c, insns.def : change type purpose
- thread_object#block_ptr (it holds IFUNC block information,
- so this type was changed to 'NODE *')
-
- * vm.c (stack_dump_each) : fixed for above
-
- * test/test_block.rb (test_ifunc) : test for above
-
- * vm.c (get_block_objec, thread_make_env_object) : fixed bugs
-
- * test/test_bin.rb (test_xstr) : remove `ls` test
-
-
-2005-01-06(Thu) 21:35:18 +0900 Koichi Sasada <ko1@atdot.net>
-
- * yarv : trying to support NODE_IFUNC (rb_iterate)
-
-
-2005-01-05(Wed) 06:50:42 +0900 Koichi Sasada <ko1@atdot.net>
-
- * yarvcore.h, insns.def, disasm.c, rb/insns2vm.rb, compile.[ch] :
- support inline method cache
-
- * extconf.rb : add -*-inline-method-cache (default: enable)
-
- * test/test_method.rb : add a test for above
-
- * benchmark/bm_poly_method.rb : added
-
- * yarvcore.c : add option string
-
-
-2005-01-04(Tue) 17:15:41 +0900 Koichi Sasada <ko1@atdot.net>
-
- * insns.def, compile.c : add compile_array and duparray insn
- to optimize only literal array creation
-
- * benchmark/bm_array.rb : added
-
-
-2005-01-04(Tue) 10:02:40 +0900 Koichi Sasada <ko1@atdot.net>
-
- * README : fix version
-
-
-2005-01-04(Tue) 09:57:25 +0900 Koichi Sasada <ko1@atdot.net>
-
- * ToDo : reflect current status
-
-
-2005-01-04(Tue) 09:43:54 +0900 Koichi Sasada <ko1@atdot.net>
-
- * compile.c : support NODE_VALUES, NODE_ARGSCAT, NODE_SPLAT
-
- * test/test_massign.rb : add tests for above
-
- * benchmark/bm_swap.rb : added
-
-
-2005-01-04(Tue) 06:25:45 +0900 Koichi Sasada <ko1@atdot.net>
-
- * compile.h : COMPILE_ERROR break contol (instead of return)
-
- * compile.c : support NODE_MASGN
-
- * insns.def : change expandarray for massign and add topn insn
-
- * test/test_massign.rb : added
-
-
-2005-01-03(Mon) 21:20:28 +0900 Koichi Sasada <ko1@atdot.net>
-
- * vm.c : store block when create proc
-
- * test/test_proc.rb : add a test for above change
-
- * yarvcore.c : add global function "once"
-
-
-2005-01-02(Sun) 00:40:08 +0900 Koichi Sasada <ko1@atdot.net>
-
- * benchmark/bm_super.rb : fix bug (remove infinite loop)
-
-
-2005-01-01(Sat) 23:45:49 +0900 Koichi Sasada <ko1@atdot.net>
-
- * benchmark/bm_z?super.rb : added
-
-
-2005-01-01(Sat) 23:37:38 +0900 Koichi Sasada <ko1@atdot.net>
-
- * benchmark/bmx_so_object.rb : rename to benchmark/bm_so_object.rb
-
-
-2005-01-01(Sat) 23:19:02 +0900 Koichi Sasada <ko1@atdot.net>
-
- * compile.c : support NODE_OP_ASGN2, NODE_OP_ASGN_AND, NODE_OP_ASGN_OR,
- NODE_SUPER, NODE_ZSUPER, NODE_MATCH
-
- * insns.def : support super, zsuper (currently, super can't
- handle with block)
-
- * test/test_bin.rb : add test for op_asgin2, op_assgin_and/or
-
- * test/test_class.rb : add test for super, zsuper
-
-
-2005-01-01(Sat) 20:39:29 +0900 Koichi Sasada <ko1@atdot.net>
-
- * compile.c : support NODE_MATCH
-
- * yarvcore.c : fix yarv_svar bug (fix condition boundary)
-
- * insnhelper.h : save cfp/lfp/dfp vars to thread_object (th)
-
-
-2005-01-01(Sat) 20:03:10 +0900 Koichi Sasada <ko1@atdot.net>
-
- * version.h : 0.0.1
-
- * yarvcore.h : add idIntern declaration
-
- * insns.def : add getspecial, setspecial.
- implement getclassvariable, setclassvariable.
- store lfp before reg match (opt_regexpmatch1)
-
- * compile.c : support ditto, flipflop
-
- * yarvcore.c : support svar
-
- * test/test_syn.rb : add test for flipflop
-
- * test/test_bin.rb : add test for dsym, cvar, backref
-
-
-2005-01-01(Sat) 09:09:32 +0900 Koichi Sasada <ko1@atdot.net>
-
- * insns.def : add getspecial insn
-
- * compile.c : support NODE_NTH_REF, NODE_BACK_REF
-
-
-2005-01-01(Sat) 06:53:38 +0900 Koichi Sasada <ko1@atdot.net>
-
- * insns.def, compile.c : support alias, undef
-
- * test/test_method.rb : test for above
-
- * rb/insns2vm.rb : fix enbug
-
-
-2005-01-01(Sat) 06:00:32 +0900 Koichi Sasada <ko1@atdot.net>
-
- * test/test_jump.rb : add test (next with value)
-
- * yarvcore.h, yarvcore.c, compile.c, compile.h :
- raise compile error exception instead of rb_bug
-
- * yarvcore.c, evalc.patch : support "require"
-
- * test.rb : restore $" after evaluation with ruby
-
- * rb/insns2vm.rb : remove unnecesary each
-
-
-2004-12-17(Fri) 18:56:38 +0900 Koichi Sasada <ko1@atdot.net>
-
- * insns.def : fix newhash
-
-
-2004-12-15(Wed) 13:29:27 +0900 Koichi Sasada <ko1@atdot.net>
-
- * yarvcore.c : add version string
-
- * compile.c : fix rescure clause bug
-
-
-2004-12-14(Tue) 22:46:30 +0900 Koichi Sasada <ko1@atdot.net>
-
- * insns.def : add reput insn
-
- * vm.h : show stack cache registers when stack dump
-
- * rb/insns2vm.rb, compile.c : fix stack caching bugs
-
-
-2004-12-14(Tue) 00:51:58 +0900 Koichi Sasada <ko1@atdot.net>
-
- * insns2vm.rb, compile.c, tmpl/opt_sc.inc.tmpl : fix bugs
-
- * rb/mixc-asm.rb : added
-
-
-2004-12-14(Tue) 00:17:02 +0900 Koichi Sasada <ko1@atdot.net>
-
- * yarvcore.h, yarvcore.c, compile.c : fix SC bugs
- (SC state management)
-
- * extconf.rb : add option -[enable|disable]-opt-stack-caching
-
- * insns2vm.rb : accept CPPFLAGS options
-
- * vm.c : support restrore register for pc
-
-
-2004-12-13(Mon) 16:53:42 +0900 Koichi Sasada <ko1@atdot.net>
-
- * rb/insns2vm.rb : add macro INSN_IS_SC()
-
-
-2004-12-11(Sat) 10:51:44 +0900 Koichi Sasada <ko1@atdot.net>
-
- * insns.def, compile.c : support singleton method definition
-
- * test/test_method.rb : add test for above
-
-
-2004-12-11(Sat) 03:17:54 +0900 Koichi Sasada <ko1@atdot.net>
-
- * benchmark/*.rb : modify
-
- * extconf.rb : add $cleanfiles
-
-
-2004-12-08(Wed) 13:01:38 +0900 Koichi Sasada <ko1@atdot.net>
-
- * compile.c, insns.def : change to disable stack caching
-
-
-2004-12-07(Tue) 19:37:13 +0900 Koichi Sasada <ko1@atdot.net>
-
- * rb/insns2vm.rb : add default after
-
- * insns.def : fix to work on stack caching
-
-
-2004-12-07(Tue) 15:07:13 +0900 Koichi Sasada <ko1@atdot.net>
-
- * depend : add some dependency to *.inc files
-
- * vm.c : add "register" and asm("regname") descriptor
-
- * rb/insns2vm.rb, compile.c : add stack caching support
-
- * tmpl/opt_sc.inc.tmpl : added to above change
-
- * rb/makedocs.rb : fix file path
-
- * extconf.rb : fix option selection
-
-
-2004-12-06(Mon) 11:20:11 +0900 Koichi Sasada <ko1@atdot.net>
-
- * extconf.rb : add vm.asm target if compiler is gcc
-
-
-2004-12-06(Mon) 09:56:24 +0900 Koichi Sasada <ko1@atdot.net>
-
- * vm.h : rename method_frame's member block to block_ptr
-
- * extconf.rb : add "-fno-crossjumping" option when compiler
- is gcc
-
- * opt_operand.def : add unification insn send
-
- * rb/insns2vm.rb : define symbol instead of declare const
- variable (for more optmize on VC)
-
- * insns.def : move enter point in send
-
-
-2004-12-06(Mon) 04:53:51 +0900 Koichi Sasada <ko1@atdot.net>
-
- * compile.c, opt_operand.def, rb/insns2vm.rb, depend :
- support operand unification
-
-
-2004-12-05(Sun) 03:16:10 +0900 Koichi Sasada <ko1@atdot.net>
-
- * vm.c, insns.def : speed up throw/catch scheme
-
-
-2004-12-05(Sun) 01:47:05 +0900 Koichi Sasada <ko1@atdot.net>
-
- * vm.c : fix catch handler bugs
-
- * test/test_jump.rb : test_complex_jump added
-
-
-2004-12-03(Fri) 20:39:05 +0900 Koichi Sasada <ko1@atdot.net>
-
- * benchmark/contrib/mcq.rb : added
- (from URABE Syouhei)
-
-
-2004-12-03(Fri) 20:35:28 +0900 Koichi Sasada <ko1@atdot.net>
-
- * vm.c : support break in rb_yield block
-
-
-2004-12-03(Fri) 14:26:35 +0900 Koichi Sasada <ko1@atdot.net>
-
- * compile.c : support block local variable in current
- ruby specification (patche from Kent Sibilev)
-
- * insns.def : support attr_* (patch from Kent Sibilev)
-
-
-2004-12-02(Thu) 21:04:27 +0900 Koichi Sasada <ko1@atdot.net>
-
- * opt_operand.def : added
-
-
-2004-12-02(Thu) 13:20:41 +0900 Koichi Sasada <ko1@atdot.net>
-
- * yarvcore.c, vm.h, vm.c, insns.def, insnhelper.h, yarvutil.rb :
- add usage analisys framework
-
- * disasm.c : insn_operand_intern to separate function
-
- * benchmark/run.rb : run each benchmark on another process
-
-
-2004-12-01(Wed) 10:26:49 +0900 Koichi Sasada <ko1@atdot.net>
-
- * vm.c : yield check block is given
-
- * benchmark/bm_lists.rb : rename to bmx_lists.rb
- (because it's not work ... bug?)
-
- * insns.def : opt_* support other type calc
-
-
-2004-11-30(Tue) 16:14:54 +0900 Koichi Sasada <ko1@atdot.net>
-
- * benchmark/bm_so_array.rb : added
-
- * benchmark/bm_so_matrix.rb : added
-
-
-2004-11-30(Tue) 14:11:30 +0900 Koichi Sasada <ko1@atdot.net>
-
- * rb/getrev.rb : added
-
- * yarvcore.c : add YARVCore::REV, YARVCore::DATE constant
-
-
-2004-11-30(Tue) 13:05:42 +0900 Koichi Sasada <ko1@atdot.net>
-
- * compile.c : support NODE_OP_ASGN1 (incomplete)
-
- * insns.def : add dupn
-
-
-2004-11-30(Tue) 08:52:01 +0900 Koichi Sasada <ko1@atdot.net>
-
- * version.h : 0.0.0.f
-
-
-2004-11-30(Tue) 08:43:59 +0900 Koichi Sasada <ko1@atdot.net>
-
- * test/test_class.rb : add test_initialize and test_to_s
-
- * yarvsubst.c : use rb_funcall instead of yarv_funcall
-
- * evalc.patch : fix ruby's patch
-
- * benchmark/bm_so_*.rb : change naming rule. "bm_so_*" from
- language shootout
-
- * depend : tbench target item is ITEM env val (default: bmx_temp)
-
- * vm.c : show raw address if environment is in heap at dumping stack trace
-
- * vm.c : thread_call0 added
-
- * vm.c : fix thread_yield_light_invoke
-
- * yarv.h, yarvcore.c : remove yarv_funcall
-
-
-2004-11-29(Mon) 11:37:08 +0900 Koichi Sasada <ko1@atdot.net>
-
- * test/test/test_proc.rb : add test test_nestproc
-
- * yarvsubst.c : comment out yarv_Array_each
-
- * insns.def : restore lfp/dfp after call_cfunc
-
- * vm.c : fix stack dump routine
-
- * vm.c : impliment thread_funcall (temporarily)
-
- * yarv.h : add IS_YARV_WORKING(), SET_YARV_START(), SET_YARV_STOP()
-
- * yarvcore.c : remove check with yarv_in_work
-
- * evalc.patch : added
-
-
-2004-11-27(Sat) 00:19:52 +0900 Koichi Sasada <ko1@atdot.net>
-
- * yarvcore.c : free -> ruby_xfree
-
-
-2004-11-26(Fri) 02:11:11 +0900 Koichi Sasada <ko1@atdot.net>
-
- * vm,c : fix bug
-
-
-2004-11-22(Mon) 11:19:48 +0900 Koichi Sasada <ko1@atdot.net>
-
- * benchmark/bm_ackermann.rb, bm_proc.rb, bm_simpleiter.rb,
- bm_so_exception.rb, bm_wc.rb, wc.input added
-
-
-2004-11-22(Mon) 02:31:56 +0900 Koichi Sasada <ko1@atdot.net>
-
- * test/test_proc.rb : add some test
-
- * yarvcore.c, vm.c : support yield in C method (as rb_yield)
-
- * vm.c (thread_yield_light_(prepare|invoke)) : support lightweight
- yield
-
- * yarv.h : added
-
- * yarvcore.c, yarv.h : support yarv_is_working, yarv_block_given_p,
- yarv_yield, yarv_funcall (only dummy function)
-
- * vm.c : thread_eval_body changed return value
-
- * yarvsubst.c : added and add yarv_Integer_times, yarv_Array_each
-
- * yarvcore.h : block_ptr is added to struct thread_object
-
- * insns.def : pass block when C method call
-
- * insnhelper.h : add GET_ISEQOBJ(cfp) macro
-
-
-2004-11-21(Sun) 07:25:49 +0900 Koichi Sasada <ko1@atdot.net>
-
- * vm.c : support Proc#call
-
- * test/test_proc.rb : added
-
-
-2004-11-19(Fri) 18:04:10 +0900 Koichi Sasada <ko1@atdot.net>
-
- * insns.def, vm.c : support creating Proc object
-
-
-2004-11-15(Mon) 14:19:27 +0900 Koichi Sasada <ko1@atdot.net>
-
- * insns.def (send) : use clear_local_size to specify
- clear local table vars.
-
- * insns.def : block represent data shares lfp, dfp with frame data
-
-
-2004-11-13(Sat) 18:19:41 +0900 Koichi Sasada <ko1@atdot.net>
-
- * yarvcore.h, insns.def : add VM_CALL_ARGS_SPLAT_BIT and
- VM_CALL_ARGS_BLOCKARG_BIT
-
- * compile.c, compile.h : add ADD_SEND, ADD_SEND_R
-
-
-2004-11-10(Wed) 08:26:25 +0900 Koichi Sasada <ko1@atdot.net>
-
- * add "vm_" prefix to (block_object, proc_object, env_object)
-
-
-2004-11-03(Wed) 15:52:14 +0900 Koichi Sasada <ko1@atdot.net>
-
- * yarvcore.h, yarvcore.c, disasm.c, compile.c, insns.def, vm.c :
- fix to move x86_64 (illegal cast, etc)
-
-
-2004-11-01(Mon) 04:45:54 +0900 Koichi Sasada <ko1@atdot.net>
-
- * yarvcore.h, compile.c, debug.c, version.h :
- redesgin gc debug scheme (GC_CHECK())
-
- * yarvcore.c : mark iseqobj->current_block on GC
-
- * insns.def, compile.c : last "throw" in ensure/rescue block
- use operand throwobj and before this insn, use "getdynamic 0, 1"
-
- * benchmark/bm_temp.rb : move to benchmark bmx_temp.rb
-
- * depend : change some targets
-
-
-2004-10-25(Mon) 19:57:58 +0900 Koichi Sasada <ko1@atdot.net>
-
- * compile.c : push exception iseq to iseqobj->iseq_mark_ary
- to mark for GC
-
-
-2004-10-10(Sun) 16:25:03 +0900 Koichi Sasada <ko1@atdot.net>
-
- * compile.c : remove $_, $' area from method local frame
- and provide that's special method local variables pointer(LFP[-1])
-
- * disasm.c : change environment showing format
-
- * yarvcore.(h|c) : add YarvProc, YarvEnv
-
- * yarvcore.h : add arg_block field to iseq_object
- and init -1 as default value
-
-
-2004-09-30(Thu) 19:50:48 +0900 Koichi Sasada <ko1@atdot.net>
-
- * compile.c, insns.def : support passing splat argument
-
- * compile.c, insns.def : support rest argument
-
- * compile.c, insns.def : support optional argument initializer
-
- * test/test_method.rb : add tests for above
-
-
-2004-09-29(Wed) 10:50:03 +0900 Koichi Sasada <ko1@atdot.net>
-
- * compile.c : fix rescue clause popped
-
- * benchmark/bm_random.rb : move to benchmark/bmx_random.rb
-
-
-2004-09-29(Wed) 01:25:35 +0900 Koichi Sasada <ko1@atdot.net>
-
- * many many files: change stack frame design
-
-
-2004-09-16(Thu) 08:51:37 +0900 Koichi Sasada <ko1@atdot.net>
-
- * compile.c, yarvcore.h : support 'return' from method
- in ensure clause
-
-
-2004-09-13(Mon) 21:56:40 +0900 Koichi Sasada <ko1@atdot.net>
-
- * compile.c : support inline cache constant access
- on NODE_COLON2, NODE_COLON3
-
- * depend : add 'vtest' rule(verbose test)
-
-
-2004-09-13(Mon) 10:58:44 +0900 Koichi Sasada <ko1@atdot.net>
-
- * compile.c, yarvcore.h : support redo/next/break in
- while/until
-
-
-2004-09-13(Mon) 08:50:19 +0900 Koichi Sasada <ko1@atdot.net>
-
- * test/test_jump.rb : added(correctly)
-
- * benchamark/bm_(ensure|rescue|simplereturn).rb added
-
-
-2004-09-12(Sun) 23:30:20 +0900 Koichi Sasada <ko1@atdot.net>
-
- * test/test_jump.rb : added
-
- * insns.def, compile.c : add 'putnil' insn
-
- * compile.c : use '===' when rescue check
-
- * insns.def : remove 'rescuecheck' insn
-
- * compile.c : support retry in begin/rescue clause
-
- * ToDo : added
-
-
-2004-09-08(Wed) 12:34:04 +0900 Koichi Sasada <ko1@atdot.net>
-
- * yarvcore.h, yarvcore.c : add idThrow*
-
- * insns.def, compile.c, vm.c : support retry, break,
- next, redo, return(imcomplete)
-
-
-2004-09-03(Fri) 13:40:08 +0900 Koichi Sasada <ko1@atdot.net>
-
- * compile.c : add nop after rescue body
-
- * insns.def, vm.c : support stack rewind when thrown
-
-
-2004-09-01(Wed) 17:31:01 +0900 Koichi Sasada <ko1@atdot.net>
-
- * test/test_exception.rb : added
-
-
-2004-09-01(Wed) 13:15:14 +0900 Koichi Sasada <ko1@atdot.net>
-
- * vm.c, insns.def : implementing exception handling
-
-
-2004-09-01(Wed) 00:18:54 +0900 Koichi Sasada <ko1@atdot.net>
-
- * insns.def : add 'throw' insn
-
- * compile.c : support 'rescue' and 'ensure' clause
-
- * yarvcore.c, yarvcore.h : add 'catch_table' to iseq_struct
-
-
-2004-08-30(Mon) 19:06:12 +0900 Koichi Sasada <ko1@atdot.net>
-
- * compile.h : NEW_ISEQOBJ don't pass self as parent
-
- * compile.c : use NEW_CHILD_ISEQOBJ explicitly
-
-
-2004-08-29(Sun) 21:09:55 +0900 Koichi Sasada <ko1@atdot.net>
-
- * compile.c : trying to implement rescue/ensure
-
- * insns.def : fix yield bug(lfp, dfp link)
-
-
-2004-08-28(Sat) 13:52:15 +0900 Koichi Sasada <ko1@atdot.net>
-
- * compile.c : fix dvar bug
-
- * test/test_block.rb : add test
-
- * insns.def, insnhelper.h : remove unused source code
-
-
-2004-08-28(Sat) 08:51:26 +0900 Koichi Sasada <ko1@atdot.net>
-
- * compile.c : support NODE_DASGN
-
- * test/test_block.rb : add test
-
-
-2004-08-28(Sat) 08:13:04 +0900 Koichi Sasada <ko1@atdot.net>
-
- * compile.c, insns.def : support access to instance variable
-
- * test/test_class.rb : add test of instance variable
-
- * benchmark/bm_block.rb : added
-
-
-2004-08-28(Sat) 07:48:43 +0900 Koichi Sasada <ko1@atdot.net>
-
- * test/test_block.rb : fix block parameter name
-
-
-2004-08-28(Sat) 07:27:52 +0900 Koichi Sasada <ko1@atdot.net>
-
- * compile.c, insns.def : support method call with block
- and yield and add some functions
-
- * compile.c, insns.def : support dynavars accessor
-
- * test/test_block.rb : added
-
- * vm.c : fix block parameter stack dump
-
-
-2004-08-27(Fri) 23:56:47 +0900 Koichi Sasada <ko1@atdot.net>
-
- * compile.c(iseq_compile) : remove parameter iseqtype
- (this information can access via self)
-
-2004-08-27(Fri) 17:13:35 +0900 Koichi Sasada <ko1@atdot.net>
-
- * test/test_bin.rb : add test(absolute path constant)
-
- * yarvcore.h, compile.c(iseq_compile) : change parameter
-
- * insns.def(classdef) : fix bug
-
-
-2004-08-27(Fri) 04:53:13 +0900 Koichi Sasada <ko1@atdot.net>
-
- * insns.def : support setconstant, getconstant, classdef,
- moduledef
-
- * vm.h : fix debug levels and so on
-
- * vm.h : foo_WORD -> foo_WC
-
- * test/test_class.rb : added
-
-
-2004-08-25(Wed) 17:51:50 +0900 Koichi Sasada <ko1@atdot.net>
-
- * insns.def : fix getconstant/setconstant/classdef
-
-
-2004-08-25(Wed) 14:27:10 +0900 Koichi Sasada <ko1@atdot.net>
-
- * debug.[ch] : added
-
- * compile.c, disasm.c : use debug interface
-
- * compile.c : support some nodes
-
- * compile.c, rb/insns2vm.rb : remove TS_CPATH
-
- * insns.def : modify classdef/moduledef/singletonclassdef
- and add popcref
-
- * and others...
-
-
-2004-08-18(Wed) 20:16:45 +0900 Koichi Sasada <ko1@atdot.net>
-
- * compile.c : fix case/when statement with empty else clause
-
- * insns.def : enable compile
-
- * yarvcore.h : add class search path scheme
-
- * test/test_syn.rb : add switch/case test case
-
- * tmpl/yarvarch.ja : update documents
-
-
-2004-05-22(Sat) 01:30:44 +0900 Koichi Sasada <ko1@atdot.net>
-
- * yarvutil.rb : add eval_in_wrap
-
- * test/test_*.rb : change to use eval_in_wrap
-
-
-2004-05-20(Thu) 02:50:32 +0900 Koichi Sasada <ko1@atdot.net>
-
- * support global variables
-
- * benchmark/bm_*.rb : add some benchmarks
-
- * compile.c : support NODE_ATTRASGN
-
- * compile.c : add debugi(...)
-
-
-2004-05-19(Wed) 23:19:38 +0900 Koichi Sasada <ko1@atdot.net>
-
- * test/test_method.rb : added
-
-
-2004-05-19(Wed) 22:56:09 +0900 Koichi Sasada <ko1@atdot.net>
-
- * insns.def : fix typo
-
- * benchmark/run.rb : sort benchmark order by filename
-
- * extconf.rb : use --enable/disable-xxx
-
- * version.h : ditto(don't touch to change yarv options)
-
-
-2004-05-19(Wed) 21:18:55 +0900 Koichi Sasada <ko1@atdot.net>
-
- * yarvutil.rb : added
-
- * test.rb, test/*, benchmark/run.rb : use yarvutil.rb
-
- * version.h : USE_OPTIMIZED_REGEXP_MATCH added
-
- * yarvcore.h : add idEqTilde
-
- * yarvcore.c(yarvcore_parse, yarvcore_eval) : require file and line
- parameter
-
- * test/test_bin.rb : add regexp test
-
- * benchmark/bm_regexp.rb : added
-
-
-2004-05-19(Wed) 13:57:31 +0900 Koichi Sasada <ko1@atdot.net>
-
- * compile.c : add compile_dstr(self, node)
-
- * compile.c : support NODE_MATCH2, NODE_MATCH3, NODE_DXSTR
-
- * insns.def : add toregexp
-
-
-2004-05-18(Tue) 10:12:20 +0900 Koichi Sasada <ko1@atdot.net>
-
- * compile.c : support NODE_XDSTR
-
- * test/test_bin.rb : add test for above change
-
-
-2004-05-18(Tue) 09:46:33 +0900 Koichi Sasada <ko1@atdot.net>
-
- * insns.def(send) : store regs before call_cfunc
-
-
-2004-05-18(Tue) 08:55:17 +0900 Koichi Sasada <ko1@atdot.net>
-
- * compile.c : support NODE_DSTR, NODE_EVSTR
-
- * compile.c : support NODE_XSTR
-
- * insns.def : add tostring operation
-
- * rb/makedocs.rb : fix directory path
-
- * depend : add tbench rule
-
- * yarvcore.h : add 'exten ID idBackquote'
-
-
-2004-05-18(Tue) 00:09:48 +0900 Koichi Sasada <ko1@atdot.net>
-
- * version.h : add USE_OPTIMIZED_BASIC_OPERATION
-
- * yarvcore.h(struct thread_object) : add 'VALUE stat_insn_usage'
-
-
-2004-05-17(Mon) 11:28:55 +0900 Koichi Sasada <ko1@atdot.net>
-
- * version.h, insns.def, yarvcore.c : add FAKE_INLINE_METHOD_CACHE
-
-
-2004-05-17(Mon) 09:05:53 +0900 Koichi Sasada <ko1@atdot.net>
-
- * compile.c : fix generating opt_* insn process
-
-
-2004-05-17(Mon) 08:58:49 +0900 Koichi Sasada <ko1@atdot.net>
-
- * benchmark/(bm_tarai.rb, bm_fib.rb) : added
-
-
-2004-05-17(Mon) 08:20:12 +0900 Koichi Sasada <ko1@atdot.net>
-
- * benchmark/(bm_tak.rb, bm_reccount.rb) : added
-
- * insns.def : test method cache(incomplete)
-
- * insns.def : add expandarray insn
-
- * yarvcore.c(iseq_init) : add parameter 'parent'
-
-
-2004-05-17(Mon) 01:49:48 +0900 Koichi Sasada <ko1@atdot.net>
-
- * benchmark/run.rb, bm_factorial.rb, bm_whileloop.rb : added
-
- * insns.def(send) : set id to ruby_frame->orig_func
-
- * check behavior on mswin32 and cygwin
-
- * insns.def(send) : check stack overflow
-
-
-2004-05-16(Sun) 08:00:55 +0900 Koichi Sasada <ko1@atdot.net>
-
- * change frame structure(debugging)
-
-
-2004-05-14(Fri) 15:06:02 +0900 Koichi Sasada <ko1@atdot.net>
-
- * insns2vm.rb : support file name arguments
-
-
-2004-05-14(Fri) 04:33:09 +0900 Koichi Sasada <ko1@atdot.net>
-
- * insns.def : support (easy) constant
-
-
-2004-05-12(Wed) 01:51:48 +0900 Koichi Sasada <ko1@atdot.net>
-
- * rb/insns2vm.b : set directory prefix
-
- * disasm.c : fix bug
-
-
-2004-05-12(Wed) 00:00:17 +0900 Koichi Sasada <ko1@atdot.net>
-
- * vm.h, compiler.h, version.h : move *DEBUG defs to version.h
-
-
-2004-05-11(Tue) 23:00:11 +0900 Koichi Sasada <ko1@atdot.net>
-
- * vm.h, version.h, yarvcore.h : move gcc ver check to version.h
- and include version.h from yarvcore.h
-
-
-2004-05-11(Tue) 19:16:26 +0900 Koichi Sasada <ko1@atdot.net>
-
- * 0.0.0.d : imported
-
-
-Local variables:
-add-log-time-format: (lambda ()
- (let* ((time (current-time))
- (diff (+ (cadr time) 32400))
- (lo (% diff 65536))
- (hi (+ (car time) (/ diff 65536))))
- (format-time-string "%Y-%m-%d(%a) %H:%M:%S +900" (list hi lo) t)))
-indent-tabs-mode: t
-tab-width: 8
-end:
diff --git a/doc/NEWS-1.8.0 b/doc/NEWS-1.8.0
new file mode 100644
index 0000000000..b4445fa59f
--- /dev/null
+++ b/doc/NEWS-1.8.0
@@ -0,0 +1,837 @@
+= command line options
+
+: -W option
+
+ new option to specify warning level. -W0 to shut up warnings, -W1 for normal level,
+ -W2 for verbose level. -w equals to -W2.
+
+= language syntax
+
+: arbitrary delimited string array
+
+ %W(...) notation, word list literal like %w(...) with the
+ exception that #{} interpolation is allowed.
+
+: arbitrary delimited symbol literl
+
+ :"foo", :"foo#{bar}", etc.
+
+: expression interpolation in strings
+
+ Now arbitrary statements are allowed inside #{} interpolation
+ without escapes. In other hand, they can no longer access to
+ variables defined in eval.
+
+: negative number literals
+
+ Digits preceded minus sign is a literal integer.
+
+: array expansion
+
+ Fixed with the following behavior:
+
+ a = *[1]
+ p a #=> [1]
+
+ Now 1-element array in rhs is expanded properly.
+
+ a = *[1]
+ p a #=> 1
+
+: break and next
+
+ Extended to take an optional expression, which is used as a value
+ for termination.
+
+: direct assignment to Foo::Bar is allowed
+
+ also, you can define "class Foo::Bar; end".
+
+= language core
+
+: $stdin, $stdout, $stderr
+
+ can be assignable again. the original stdio are preserved as STDIN,
+ STDOUT, STDERR.
+
+: $VERBOSE now has 3 levels
+
+ nil - silence, false - medium (default), true - verbose
+
+: allocation framework
+
+ any instance of class can be allocated by class.allocate,
+ (except for a few classes).
+
+: comparison of exception classes in a rescue clause
+
+ changed to use Module#=== for comparing $! with the exception
+ class specified in each rescue clause.
+
+ as the previous behavior was to use kind_of?, the effect is limited
+ to the SystemCallError case. SystemCallError.=== has been newly
+ defined to return true when the two have the same errno. With this
+ change, SystemCallError's with the same errno, such as Errno::EAGAIN
+ and Errno::EWOULDBLOCK, can both be rescued by listing just one of
+ them.
+
+: constants lookup
+
+ improved at the performance of searching by using an internal hash
+ table.
+
+ calls const_missing method of the class/module, if constant is not
+ found in the look up path.
+
+: expression parenthesis in the first argument
+
+ altered to get the following code (note the space after p):
+
+ p ("xx"*2).to_i
+
+ Interpreted as:
+
+ p (("xx"*2).to_i)
+
+ Instead of:
+
+ (p("xx"*2)).to_i
+
+: implicit comparison in conditional expressions
+
+ Obsoleted except when it is used in -e.
+
+ : between Range and $.
+ Use explicit comparison instead.
+
+ : between Regexp and $_
+ Use the unary method ~/re/ instead.
+
+: to_str
+
+ added to get objects which define to_str() treated as String's.
+
+ now almost all the built-in methods try each argument with to_str()
+ when they expect it to be a String.
+
+ foo = Object.new
+ class <<foo
+ def to_str
+ "foo"
+ end
+ end
+ p File.open(foo)
+ => -:7:in `open': wrong argument type Object (expected String) (TypeError)
+ ruby 1.6.4 (2001-04-19) [i586-linux]
+ => -:7:in `open': No such file or directory - "foo" (Errno::ENOENT)
+ ruby 1.7.0 (2001-05-02) [i586-linux]
+
+: multiple assignment behavior
+
+ Fixed so that "*a = nil" results in "a == []".
+
+= changes in core class library
+
+: open
+
+ Extended so that when the third argument is permission flags it
+ calls open(2) instead of fopen(3).
+
+: sprintf
+
+ new format specifier "%p" is available.
+
+: lambda and proc
+
+ Proc object returns from these methods has the following attributes:
+
+ * strict argument number check
+ * break and return terminates the proc execution.
+
+: warn(message)
+
+ a method to give warnings.
+
+: abort()
+
+ takes optional terminate message argument.
+
+: Object#initialize_copy
+
+ copy constructor for clone and dup.
+
+: Object#instance_variable_set, Object#instance_variable_get
+
+ added.
+
+: Object#singleton_method_removed
+: Object#singleton_method_undefined
+
+ Added.
+
+: Array#transpose
+
+ added.
+
+: Array#fetch(index [, default])
+
+ Added. If a default value isn't given, raises index error if index
+ is out of range.
+
+: Array#insert(n, other, ...)
+
+ Added. [ruby-talk:14289]
+
+ This is much the same as (({ary[n,0] = [other,...]})) except
+ returing self.
+
+ ary = [0,1,2,3]
+ ary[2, 0] = [4, 5, 6]
+ p ary
+
+ ary = [0,1,2,3]
+ ary.insert(2, 4, 5, 6)
+ p ary
+
+: Array#sort!
+
+ Changed to always return self without checking whether the sequence
+ of the elements was modified or not.
+
+ Beware that this behavior is not guaranteed to continue in the
+ future. Do not rely on its return value. [ruby-dev:12506]
+
+: Array#filter
+
+ Previously deprecated, now removed. Use Array#collect!.
+
+: Array#pack, String#unpack
+
+ Allows comment in template strings.
+
+: Array#pack, String#unpack
+
+ New templates 'q' and 'Q' for 64bit integer (signed and unsigned respectively).
+
+: Array#new
+
+ Now takes block to fill initial values. E.g.
+
+ Array.new(10) { |i| i + 1 }
+ => [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
+
+: Array#fill
+
+ Takes block to get the values to fill.
+
+: Array#fetch
+
+ Takes block to get the default value.
+
+: Array#zip
+
+ added.
+
+: Hash#update
+
+ Takes block to resolve key conflict.
+
+: Hash#merge and Hash#merge!
+
+ update hash. Hash#merge! is a synonym of Hash#update.
+
+: String#split
+
+ if "sep" argument is a string, regular expression meta characters
+ are escaped internally.
+
+: String#rstrip
+
+ chop off NULs at the end of strings.
+
+: String#to_i
+
+ Now accepts optional base argument.
+
+ "101".to_i(10) => 101
+ "101".to_i(2) => 5
+ "101".to_i(8) => 65
+ "101".to_i(16) => 257
+
+ A base argument of 0 guesses at the base.
+
+ "101".to_i(0) => 101
+ "0b101".to_i(0) => 5
+ "0101".to_i(0) => 65
+ "0x101".to_i(0) => 257
+
+: String#[regexp, nth]
+
+ Extended to accepts optional second argument.
+
+ It tries match between self and REGEXP, then returns the
+ content of the NTH regexp register.
+
+: String#casecmp
+
+ Added. This is a case insensitive version of String#<=>.
+
+: String#chomp
+
+ If $/ == "\n", chops off last newlines (any of \n, \r, \r\n).
+
+: String#eql?
+
+ Changed to be always case sensitive.
+
+: String#insert(n, other)
+
+ Added.
+
+ This is much the same as (({str[n, 0] = other})) except returing
+ self.
+
+: String#lstrip, rstrip, lstrip!, rstrip!
+
+ Added. These strip only left or right part of a string.
+
+: String#match
+
+ Added.
+
+: String/Array methods
+
+ Returns an instance of receivers class.
+
+: String.new
+
+ The first argument becomes optional.
+
+: Symbol#intern
+
+ Added.
+
+: Symbol.all_symbols
+
+ Added. [ruby-dev:12921]
+
+: IO
+
+ 64bit off_t support by Janathan Baker.
+
+: IO#read
+: IO#sysread
+
+ takes optinal second argument for read buffer.
+
+: IO::sysopen
+
+ New method to get a raw file descriptor.
+
+: IO#sysseek
+
+ Added.
+
+: IO#fsync
+
+ new method that copies all in-memory parts of a file to disk and
+ waits until the device reports that all parts are on stable storage.
+ Implemented with fsync(2) or equivalent.
+
+: IO.open
+
+ Made public. Can only associate an IO object with a file number
+ like IO.new and IO.for_fd, but can take a block.
+
+: IO.for_fd
+
+ Added as a synonym for IO.new.
+
+: IO.read
+
+ Added. Like IO.readlines, except it returns the entire file as a
+ string. [ruby-talk:9460]
+
+: File#fnmatch, File::Constants::FNM_*
+
+ Added. Refer to the fnmatch(3) manpage for details.
+
+ Localism is FNM_DOTMATCH which has the opposite meaning of the
+ commonly known FNM_PERIOD, which does not exist in Ruby.
+
+ e.g.
+
+ # exclude files matching "*.bak" case-insensitively.
+ files.reject! {|fn| File.fnmatch?("*.bak", fn, File::FNM_CASEFOLD) }
+
+: File.lchmod
+: File.lchown
+
+ Added.
+
+: File.open, IO.open
+
+ File mode can be specified by flags like open(2),
+ e.g. File::open(path, File::CREAT|File::WRONLY).
+
+: Regexp#options
+
+ Added.
+
+: Regexp.last_match(n)
+
+ Extended to take an optional argument.
+
+: MatchData#captures
+
+ added.
+
+: Dir#path
+
+ Added.
+
+: Dir.chdir
+
+ Extended to take a block.
+
+: Dir.glob
+
+ Made to support meta-character escaping by a backslash. Wildcards
+ and spaces may now be escaped using a backslash.
+
+: Dir.open
+
+ Changed to return what the block returns when a block is given, just
+ as File.open does. (It always returned (({nil})) in 1.6 and
+ prior)
+
+: Dir.chdir
+
+ Changed to warn only when invoked from multiple threads or no block
+ is given. [ruby-dev:13823]
+
+ Dir.chdir('foo') {
+ Dir.chdir('bar') { # previously warned
+ puts Dir.pwd
+ }
+ }
+
+: Dir#pos=
+
+ Returns the new position instead of self.
+
+: Dir::glob
+
+ Now accepts optional FNM_* flags via the second argument, whereas
+ Dir::[] doesn't.
+
+ Dir.glob("makefile", File::FNM_CASEFOLD) #=> ['Makefile', 'makefile']
+
+: Class#inherited
+
+ Method is called when Class is inherited by another class.
+
+ class A; end
+ def A.inherited(by)
+ puts "A inherited by #{by.inspect}"
+ end
+ class B < A; end
+
+ Prints out "A inherited by B"
+
+: Module#include?
+
+ Added. [ruby-dev:13941]
+
+: Module#included
+
+ Added. This is a hook called after Module#append_feature.
+
+: Module#method_removed
+: Module#method_undefined
+
+ Added.
+
+: Module.new, Class.new
+
+ Extended to take block.
+
+: Time
+
+ Extended to accept a negative time_t. (Only when the platform
+ supports it)
+
+ p Time.at(-1)
+ => Thu Jan 01 08:59:59 JST 1970
+
+: Time#to_a
+: Time#zone
+
+ Made to return "UTC" under gmtime. It used to return a platform
+ dependent value, typically "GMT", in 1.6 and prior.
+
+: Marshal to use marshal_dump and marshal_load
+
+ if a dumping object responds to 'marshal_dump', Marshal.dump calls
+ it, and dumps object returned. Marshal.load allocates a new instance
+ using "allocate", then calls its "marshal_load" with dumped data.
+ Marshal format version is now 4.8 (was 4.6 in 1.6.8).
+
+: Marshal
+
+ Fixed not to dump anonymous classes/modules.
+
+ Fixed with loading modules.
+
+: Thread#group
+
+ new method to get belonging ThreadGroup.
+
+: Thread#terminate
+
+ synonym of Thread#exit
+
+: Thread#join
+
+ Optional argument limits maximum time to wait the thread in second.
+ And returns nil if timed out.
+
+: ThreagGroup#enclose
+
+ prohibits thread movement from/to enclosed groups.
+
+: Range#step([step=1])
+
+ Added.
+
+: SystemCallError
+
+ SystemCallError's "===" match (used in rescue also) is now based on its errno.
+
+: Interrupt
+
+ Made a subclass of SignalException. (It was a subclass of
+ Exception in 1.6 and prior)
+
+: NameError and NoMethodError
+
+ Moved and now NoMethodError < NameError < StandardError.
+
+: NoMethodError
+
+ Added. [ruby-dev:12763]
+
+: NotImplementError
+
+ Finally obsoleted. Use NotImplementedError.
+
+: SystemCallError.===
+
+ Added. (See the "Comparison of exception classes in a rescue clause"
+ paragraph above) [ruby-dev:12670]
+
+: SystemExit#status
+
+ Added.
+
+: Proc#==
+
+ Added.
+
+: Method#==
+
+ Added.
+
+: UnboundMethod is no longer subclass of Method
+
+ class hierarchy changed.
+
+: Enumerable#all?
+: Enumerable#any?
+: Enumerable#inject
+: Enumerable#sort_by
+
+ Added.
+
+: Math.acos(x)
+: Math.asin(x)
+: Math.atan(x)
+: Math.cosh(x)
+: Math.hypot(x,y)
+: Math.sinh(x)
+: Math.tanh(x)
+
+ Added.
+
+: Process.abort
+: Process.exit
+
+ synonym of Kernel#abort, and Kernel#exit respectively.
+
+: Process::detach(pid)
+
+ new method to detach child process. child process will be "wait"ed
+ automagically.
+
+: Process.times
+
+ Moved from Time.times. (Time.times still remains but emits a
+ warning)
+
+: Process.waitall
+
+ Added.
+
+: Process::Status
+
+ Added. (({$?})) is now an instance of this class.
+
+: Process::UID, Process::GID, Process::Sys,
+
+ Added.
+
+: Signal
+
+ Added. This module has module functions Signal.trap and Signal.list.
+
+= changes in bundled libraries
+
+: lib/cgi.rb
+
+ cgi[name] returns CGI::QueryExtension::Value that wraps string
+ value, no longer array.
+
+: lib/timeout
+
+ timeout "function" wrapped in Timeout module.
+
+: TCPServer#accept, UNIXServer#accept, Socket#accept
+
+ New methods to return an accepted socket fd.
+
+: Date and DateTime
+
+ lib/date.rb now provides both Date and DateTime.
+
+ Some methods have been renamed. But the old names are still alive.
+
+ Some new methods have been added (Date::parse, Date#strftime, etc.).
+
+ Date#mjd now returns the chronological modified Julian day number.
+
+ All facilities about tjd have been removed.
+
+: Curses
+
+ Updated. New methods and constants for using the mouse, character
+ attributes, colors and key codes have been added.
+
+: Net::HTTP
+
+ New version of Net::HTTP has introduced seriously incompatible
+ changes. For details, see document embedded in net/http.rb itself.
+
+: Socket.pack_sockaddr_in, Socket.unpack_sockaddr_in
+
+ Added. Utility for direct Socket access.
+
+: Socket.pack_sockaddr_un, Socket.unpack_sockaddr_un
+
+ Added. Utility for direct Socket access.
+
+: TCPServer#listen, UNIXServer#listen
+
+ Added.
+
+: TCPSocket.new
+: TCPSocket.open
+
+ Extended to take an address and a port number for the local side in
+ optional 3rd and 4th arguments.
+
+= newly bundled library
+
+: ext/bigdecimal
+
+ variable precision decimal number
+
+: ext/dl
+
+ an interface to the dynamic linker.
+
+: ext/enumerator
+
+ a helper module for the Enumerable interface.
+
+: ext/io/wait
+
+ IO wait methods.
+
+: ext/iconv
+
+ wrapper library of (({iconv})).
+
+: ext/openssl
+
+ OpenSSL for Ruby
+
+: ext/racc/cparse
+
+ Racc runtime library in C. (Racc is a parser generator for ruby)
+
+: ext/stringio
+
+ Pseudo (({IO})) class from/to (({String})).
+
+: ext/strscan
+
+ Fast string scanner library.
+
+: ext/syck
+
+ fast YAML parser.
+
+: lib/abbrev
+
+ creates an abbreviation table from a list
+
+: lib/benchmark
+
+ Ruby scripts benchmarker
+
+: lib/cgi/session/pstore
+
+ cgi/session back-end using pstore
+
+: lib/csv
+
+ reads/writes CSV files.
+
+: lib/date/format
+
+ strftime for Date class
+
+: lib/drb
+
+ dRuby or distributed Ruby
+
+: lib/fileutils
+
+ file utility library.
+
+: lib/generator
+
+ converts an internal iterator to an external iterator
+
+: lib/gserver
+
+ generic server used by xmlrpc
+
+: lib/ipaddr
+
+ manipulates IP address.
+
+: lib/multi-tk
+
+ to allow safe Tk, etc.
+
+: lib/open-uri
+
+ easy-to-use wrapper for net/http and net/ftp
+
+: lib/optparse
+
+ command line options utility library
+
+: lib/pathname
+
+ handles pathname in OO manner.
+
+: lib/pp
+
+ prettyprinter for Ruby objects
+
+: lib/prettyprint
+
+ implements prettyprint algorithm.
+
+: lib/profiler
+
+ library to implement -r "profile"
+
+: lib/racc/parser
+
+ RACC parser generator runtime in Ruby.
+
+: lib/scanf
+
+ scan string and retrieve object with format
+
+: lib/set
+
+ Set class
+
+: lib/runit
+
+ RubyUnit compatible layer for test/unit
+
+: lib/test/unit
+
+ unit testing framework for Ruby
+
+: lib/tmpdir
+
+ get temporary directory path.
+
+: lib/tsort
+
+ topological sorting library.
+
+: lib/rexml
+
+ REXML XML library
+
+: lib/webrick
+
+ generic internet server kit
+
+: lib/xmlrpc
+
+ simple RPC via XML
+
+: lib/un
+
+ used like 'ruby -run -e cp -- -p foo bar'. neat, isn't it?
+
+: lib/win32/registry
+
+ win32/registry is registry accessor
+
+: lib/yaml
+
+ YAML Ain't Mark-up Language
+
+= removed libraries
+
+: lib/ftplib
+
+ use net/ftp instead.
+
+: lib/telnet
+
+ use net/telnet instead.
+
+= new port
+
+: WindowsCE port
+: Win32 BCC
+
+= interpreter implementation
+
+: garbage collector
+
+ faster, but uses more memory for the worst case.
+
+: string concatenation
+
+ faster by avoiding too frequent realloc(3).
diff --git a/doc/NEWS-1.8.7 b/doc/NEWS-1.8.7
deleted file mode 100644
index 6a7a77211d..0000000000
--- a/doc/NEWS-1.8.7
+++ /dev/null
@@ -1,635 +0,0 @@
-= NEWS
-
-This document is a list of user visible feature changes made between
-releases except for bug fixes.
-
-Note that each entry is kept so brief that no reason behind or
-reference information is supplied with. For a full list of changes
-with all sufficient information, see the ChangeLog file.
-
-== Changes since the 1.8.6 release
-
-=== Configuration changes
-
-* default C flags
-
- Some C compiler flags may be added by default depending on your
- environment. Specify optflags=.. and warnflags=.. as necessary to
- override them.
-
-* vendor_ruby directory
-
- A new library directory named `vendor_ruby' is introduced in
- addition to `site_ruby'. The idea is to separate libraries
- installed by the package system (`vendor') from manually (`site')
- installed libraries preventing the former from getting overwritten
- by the latter, while preserving the user option to override vendor
- libraries with site libraries. (`site_ruby' takes precedence over
- `vendor_ruby')
-
- If you are a package maintainer, make each library package configure
- the library passing the `--vendor' option to `extconf.rb' so that
- the library files will get installed under `vendor_ruby'.
-
- You can change the directory locations using configure options such
- as `--with-sitedir=DIR' and `--with-vendordir=DIR'.
-
-=== Global constants
-
-* new constants
-
- * RUBY_COPYRIGHT
- * RUBY_DESCRIPTION
-
-=== Library updates (outstanding ones only)
-
-* new library
-
- * securerandom
-
-* builtin classes
-
- * Array#flatten
- * Array#flatten!
-
- Takes an optional argument that determines the level of recursion
- to flatten.
-
- * Array#eql?
- * Array#hash
- * Array#==
- * Array#<=>
-
- Handle recursive data properly.
-
- * Array#index
- * Array#rindex
-
- Take a block instead of an argument.
-
- * Array#collect!
- * Array#map!
- * Array#each
- * Array#each_index
- * Array#reverse_each
- * Array#reject
- * Array#reject!
- * Array#delete_if
-
- Return an enumerator if no block is given.
-
- Note that #map and #collect still return an array unlike Ruby 1.9
- to keep compatibility.
-
- * Array#pop
- * Array#shift
-
- Take an optional argument specifying the number of elements to
- remove.
-
- * Array#choice
- * Array#combination
- * Array#cycle
- * Array#drop
- * Array#drop_while
- * Array#permutation
- * Array#product
- * Array#shuffle
- * Array#shuffle!
- * Array#take,
- * Array#take_while
-
- New methods.
-
- * Binding#eval
-
- New method.
-
- * Dir#each
- * Dir#foreach
-
- Return an enumerator if no block is given.
-
- * Enumerable::Enumerator
-
- New class for various enumeration defined by the enumerator library.
-
- * Enumerable#each_slice
- * Enumerable#each_cons
- * Object#to_enum
- * Object#enum_for
-
- New methods for various enumeration defined by the enumerator library.
-
- * Enumerable#count
- * Enumerable#cycle
- * Enumerable#drop
- * Enumerable#drop_while
- * Enumerable#find_index
- * Enumerable#first
- * Enumerable#group_by
- * Enumerable#max_by
- * Enumerable#min_by
- * Enumerable#minmax
- * Enumerable#minmax_by
- * Enumerable#none?
- * Enumerable#one?
- * Enumerable#take
- * Enumerable#take_while
-
- New methods.
-
- * Enumerable#find
- * Enumerable#find_all
- * Enumerable#partition
- * Enumerable#reject
- * Enumerable#select
- * Enumerable#sort_by
-
- Return an enumerator if no block is given.
-
- Note that #map and #collect still return an array unlike Ruby 1.9
- to keep compatibility.
-
- * Enumerable#inject
-
- Accepts a binary operator instead of a block.
-
- * Enumerable#reduce
-
- New alias to #inject.
-
- * Hash#eql?
- * Hash#hash
- * Hash#==
-
- Handle recursive data properly.
-
- * Hash#delete_if
- * Hash#each
- * Hash#each_key
- * Hash#each_pair
- * Hash#each_value
- * Hash#reject!
- * Hash#select
- * ENV.delete_if
- * ENV.each
- * ENV.each_key
- * ENV.each_pair
- * ENV.each_value
- * ENV.reject!
- * ENV.select
-
- Return an enumerator if no block is given.
-
- * GC.stress
- * GC.stress=
-
- New methods.
-
- * Integer#ord
- * Integer#odd?
- * Integer#even?
- * Integer#pred
-
- New methods.
-
- * Integer#downto
- * Integer#times
- * Integer#upto
-
- Return an enumerator if no block is given.
-
- * IO#each
- * IO#each_line
- * IO#each_byte
- * IO.foreach
- * ARGF.each
- * ARGF.each_line
- * ARGF.each_byte
-
- Return an enumerator if no block is given.
-
- * IO#bytes
- * IO#chars
- * IO#each_char
- * IO#getbyte
- * IO#lines
- * IO#readbyte
- * ARGF.bytes
- * ARGF.chars
- * ARGF.each_char
- * ARGF.getbyte
- * ARGF.lines
- * ARGF.readbyte
-
- New methods.
-
- * Method#name
- * Method#owner
- * Method#receiver
- * UnboundMethod#name
- * UnboundMethod#owner
-
- New methods.
-
- * Module#class_exec
- * Module#module_exec
-
- New methods.
-
- * Numeric#step
-
- Return an enumerator if no block is given.
-
- * Object#instance_exec
- * Object#tap
-
- New methods.
-
- * ObjectSpace.each_object
-
- Return an enumerator if no block is given.
-
- * Process.exec implemented.
-
- * Range#each
- * Range#step
-
- Return an enumerator if no block is given.
-
- * Regexp.union accepts an array of patterns.
-
- * String#bytesize
-
- New method, returning the size in bytes. (alias length and size)
-
- * String#chars
- * String#each_char
- * String#partition
- * String#rpartition
- * String#start_with?
- * String#end_with?
-
- New methods. These are $KCODE aware unlike #index, #rindex and
- #include?.
-
- * String#each_byte
- * String#each
- * String#each_line
- * String#gsub(pattern)
-
- Return an enumerator if no block is given.
-
- * String#upto
-
- An optional second argument is added to specify if the last value
- should be included.
-
- * StopIteration
-
- New exception class that causes Kernel#loop to stop iteration when
- raised.
-
- * Struct#each
- * Struct#each_pair
-
- Return an enumerator if no block is given.
-
- * Symbol#to_proc
-
- New method.
-
- * __method__
-
- New global function that returns the name of the current method as
- a Symbol.
-
-* enumerator
-
- * Enumerator is now a built-in module. The #next and #rewind
- methods are implemented using the "generator" library. Use with
- care and be aware of the performance loss.
-
-* ipaddr
-
- * New methods
- * IPAddr#<=>
- * IPAddr#succ
-
- IPAddr objects are now comparable and enumerable having these
- methods. This also means that it is possible to have a Range
- object between two IPAddr objects.
-
- * IPAddr#to_range
-
- A new method to create a Range object for the (network) address.
-
- * Type coercion support
- * IPAddr#&
- * IPAddr#|
- * IPAddr#==
- * IPAddr#include?
-
- These methods now accept a string or an integer instead of an
- IPAddr object as the argument.
-
-* net/smtp
-
- * Support SSL/TLS.
-
-* openssl
-
- * New classes
- * OpenSSL::PKey::EC
- * OpenSSL::PKey::EC::Group
- * OpenSSL::PKey::EC::Point
- * OpenSSL::PKey::PKCS5
- * OpenSSL::SSL::Session
-
- * Documentation!
-
- * Various new methods (see documentation).
-
- * Remove redundant module namespace in Cipher, Digest, PKCS7, PKCS12.
- Compatibility classes are provided which will be removed in Ruby 1.9.
-
-* shellwords
-
- * Add methods for escaping shell-unsafe characters:
- * Shellwords.join
- * Shellwords.escape
- * Array#shelljoin
- * String#shellescape
-
- * Add shorthand methods:
- * Shellwords.split (alias shellwords)
- * String#shellsplit
-
-* stringio
-
- * StringIO#getbyte
- * StringIO#readbyte
-
- New methods. (aliases for compatibility with 1.9)
-
- * StringIO#each_char
- * StringIO#chars
-
- New methods.
-
- * StringIO#each
- * StringIO#each_line
- * StringIO#each_byte
-
- Return an enumerator if no block is given.
-
-* tempfile
-
- * Tempfile.open and Tempfile.new now accept a suffix for the
- temporary file to be created. To specify a suffix, pass an array
- of [basename, suffix] as the first argument.
-
- Tempfile.open(['image', 'jpg']) { |tempfile| ... }
-
-* tmpdir
-
- * New method:
-
- * Dir.mktmpdir
-
-* uri
-
- * added LDAPS scheme.
- * Change for RFC3986:
- * 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 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')
- * URI('http://a/b/c/d;p?q').merge('/../g') == URI('http://a/g')
- * URI('http://a/b/c/d;p?q').merge('../../../g') == URI('http://a/g')
- * URI('http://a/b/c/d;p?q').merge('../../../../g') == URI('http://a/g')
-
-* rss
-
- * 0.1.6 -> 0.2.4
-
- * Fix image module URI
-
- * Atom support
-
- * ITunes module support
-
- * Slash module support
-
- * content:encoded with RSS 2.0 support
-
-=== Interpreter Implementation
-
-* passing a block to a Proc [experimental]
-
- This implementation in current shape is known to be buggy/broken,
- especially with nested block invocation. Take this as an
- experimental feature.
-
-* stack trace
-
- On non-SystemStackError exception, full stack trace is shown.
-
-=== Compatibility issues (excluding feature bug fixes)
-
-* String#slice! had some unintentional bugs and they have been fixed
- because either they disagreed with documentation or their respective
- behavior of #slice. Unfortunately, this causes some
- incompatibilities in the following (somewhat rare) cases.
-
- * #slice! no longer expands the array when an out-of-boundary value
- is given.
-
- # Ruby 1.8.6
- a = [1,2]
- a.slice!(4,0) #=> nil
- a #=> [1,2,nil,nil]
-
- # Ruby 1.8.7
- a = [1,2]
- a.slice!(4,0) #=> nil
- a #=> [1,2]
-
- * #slice! no longer raises an exception but returns nil when a
- negative length or out-of-boundary negative position is given.
-
- # Ruby 1.8.6
- a = [1,2]
- a.slice!(1,-1) #=> (raises IndexError)
- a.slice!(-5,1) #=> (raises IndexError)
-
- # Ruby 1.8.7
- a = [1,2]
- a.slice!(1,-1) #=> nil
- a.slice!(-5,1) #=> nil
-
-* String#to_i, String#hex and String#oct no longer accept a sequence
- of underscores (`__') as part of a number.
-
- # Ruby 1.8.6
- '1__0'.to_i #=> 10
- '1__0'.to_i(2) #=> 2 # 0b10
- '1__0'.oct #=> 8 # 010
- '1__0'.hex #=> 16 # 0x10
-
- # Ruby 1.8.7
- '1__0'.to_i #=> 1
- '1__0'.to_i(2) #=> 1
- '1__0'.oct #=> 1
- '1__0'.hex #=> 1
-
- The old behavior was inconsistent with Ruby syntax and considered as
- a bug.
-
-* date
-
- * Date.parse
-
- '##.##.##' (where each '#' is a digit) is now taken as 'YY.MM.DD'
- instead of 'MM.DD.YY'. While the change may confuse you, you can
- always use Date.strptime() when you know what you are dealing
- with.
-
-* stringio
-
- * StringIO#each_byte
-
- The return value changed from nil to self. This is what the
- document says and the same as each_line() does.
-
-* tempfile
-
- * The file name format has changed. No dots are included by default
- in temporary file names any more. See above for how to specify a
- suffix.
-
-* uri
-
- * See above for details.
-
-== Changes since the 1.8.5 release
-
-=== New platforms/build tools support
-
-* IA64 HP-UX
-
-* Visual C++ 8 SP1
-
-* autoconf 2.6x
-
-=== Global constants
-
-* RUBY_PATCHLEVEL
-
- New constant since 1.8.5-p1.
-
-=== Library updates (outstanding ones only)
-
-* builtin classes
-
- * New method: Kernel#instance_variable_defined?
-
- * New method: Module#class_variable_defined?
-
- * New feature: Dir::glob() can now take an array of glob patterns.
-
-* date
-
- * Updated based on date2 4.0.3.
-
-* digest
-
- * New internal APIs for C and Ruby.
-
- * Support for autoloading.
-
- require 'digest'
-
- # autoloads digest/md5
- md = Digest::MD5.digest("string")
-
- * New digest class methods: file
-
- * New digest instance methods: clone, reset, new, inspect,
- digest_length (alias size or length), block_length()
-
- * New library: digest/bubblebabble
-
- * New function: Digest(name)
-
-* fileutils
-
- * New option for FileUtils.cp_r(): :remove_destination
-
-* nkf
-
- * Updated based on nkf as of 2007-01-28.
-
-* thread
-
- * Replaced with much faster mutex implementation in C. The former
- implementation, which is slow but considered to be stable, is
- available with a configure option `--disable-fastthread'.
-
-* tk
-
- * Updated Tile extension support based on Tile 0.7.8.
-
- * Support --without-X11 configure option for non-X11 versions of
- Tcl/Tk (e.g. Tcl/Tk Aqua).
-
- * New sample script: irbtkw.rbw -- IRB on Ruby/Tk. It has no trouble
- about STDIN blocking on Windows.
-
-* webrick
-
- * New method: WEBrick::Cookie.parse_set_cookies()
-
-=== Compatibility issues (excluding feature bug fixes)
-
-* builtin classes
-
- * String#intern now raises SecurityError when $SAFE level is greater
- than zero.
-
-* date
-
- * Time#to_date and Time#to_datetime are added as private methods.
- They cause name conflict error in ActiveSupport 1.4.1 and prior,
- which comes with Rails 1.2.2 and prior. Updating ActiveSupport
- and/or Rails to the latest versions fixes the problem.
-
-* digest
-
- * The constructor does no longer take an initial string to feed.
- The following examples show how to migrate:
-
- # Before
- md = Digest::MD5.new("string")
- # After (works with any version)
- md = Digest::MD5.new.update("string")
-
- # Before
- hd = Digest::MD5.new("string").hexdigest
- # After (works with any version)
- hd = Digest::MD5.hexdigest("string")
-
-* fileutils
-
- * A minor implementation change breaks Rake <=0.7.1.
- Updating Rake to 0.7.2 or higher fixes the problem.
-
-* tk
-
- * Tk::X_Scrollable (Y_Scrollable) is renamed to Tk::XScrollable
- (YScrollable). Tk::X_Scrollable (Y_Scrollable) is still available,
- but it is an alias name.
diff --git a/doc/NEWS-1.9.1 b/doc/NEWS-1.9.1
deleted file mode 100644
index 05752330eb..0000000000
--- a/doc/NEWS-1.9.1
+++ /dev/null
@@ -1,420 +0,0 @@
-= NEWS
-
-This document is a list of user visible feature changes made between
-releases except for bug fixes.
-
-Note that each entry is kept so brief that no reason behind or
-reference information is supplied with. For a full list of changes
-with all sufficient information, see the ChangeLog file.
-
-== Changes since the 1.8.7 release
-See doc/NEWS-1.8.7 for changes between 1.8.6 and 1.8.7.
-
-=== Compatibility issues
-
-* language core
-
- * New syntax and semantics
- o Block arguments are always local
- o New semantics for block arguments
- o defined? and local variables
- o Parser expects that your source code has only valid byte
- sequence in some character encoding. Use magic comments
- to tell the parser which encoding you use.
- o New semantics for constant definition in instance_eval
- or in module_eval.
-
- * Deprecated syntax
- o colon (:) instead of "then" in if/unless or case expression.
- o retry in a loop or an iterator.
-
-* builtin classes and objects
-
- * Kernel and Object
- o Kernel#methods and #singleton_methods used to return an
- array of strings but now they return an array of symbols.
- * Class and Module
- o Module#attr works as Module#attr_reader by default.
- Optional boolean argument is obsolete.
- o Module#instance_methods, #private_instance_methods and
- #public_instance_methods used to return an array of
- strings but now they return an array of symbols.
- o Extra subclassing check when binding UnboundMethods
-
- * Exceptions
- o Exceptions are equal to each other if they belong to
- the same class and have the same message and backtrace.
- o SystemStackError used to be a subclass of StandardError
- but not it is a direct subclass of Exception.
- o SecurityError: ditto
- o Removed Exception#to_str [Ruby2]
-
- * Enumerable and Enumerator
- o Enumerable::Enumerator, compatibility alias of Enumerator,
- is removed.
- o Enumerable#{map,collect} called without a block returns
- an enumerator.
- o Even more builtin and bundled libraries have been made to
- return an enumerator when called without a block.
- * Array
- o Array#nitems was removed (use count {|i| !i.nil?})
- o Array#choice was removed (use sample)
- o Array#[m,n] = nil places nil in the array.
- * Hash
- o Hash#to_s is equivalent to Hash#inspect
- o Semantics for Hash#each and Hash#each_pair
- o Hash#select returns a hash
- o Hash#key is the new name for #index which has been
- deprecated.
- o Hash preserves order. It enumerates its elements in the
- order in which the keys are inserted.
- o Most of the changes in Hash apply to hash like interfaces
- such as ENV and *DBM.
- * IO operations
- o Many methods used to act byte-wise but now some of those act
- character-wise. You can use alternate byte-wise methods.
- o IO#getc
- o Non-blocking IO
- o Kernel#open takes "t" for newline conversion
- o Kernel#open takes encoding specified
- o IO automatically converts byte sequence from a character
- encodings into another if specified.
- o StringIO#readpartial
- o IO.try_convert
- o IO.binread
- o IO.copy_stream
- o IO#binmode?
- o IO#close_on_exec= and IO#close_on_exec?
- o Limit input in IO#gets, IO#readline, IO#readlines,
- IO#each_line, IO#lines, IO.foreach, IO.readlines,
- StringIO#gets, StringIO#readline, StringIO#each,
- StringIO#readlines
- o IO#ungetc, StringIO#ungetc
- o IO#ungetbyte, StringIO#ungetbyte
- o IO#internal_encoding, IO#external_encoding,
- IO#set_encoding
- o IO.pipe takes encoding option
- o Directive %u behaves like %d for negative values in
- printf-style formatting.
- * File and Dir operations
- o #to_path is called as necessary in File.path, File.chmod,
- File.lchmod, File.chown, File.lchown, File.utime,
- File.unlink, etc..
- o File.world_readable?
- o File.world_writable?
- o Dir.[], Dir.glob
- o Dir.exist?
- o Dir.exists?
- * File::Stat
- o File::Stat#world_readable?
- o File::Stat#world_writable?
- * String
- o No longer an Enumerable: use each_line/lines for line
- oriented operation
- o Encoding-awareness
- o Character-wise semantics in many methods instead of
- byte-wise.
- o String#[]: Indexing a String with an integer returns a
- single character String instead of an integer.
- o String#[]=: No longer takes an integer as right
- side value. Note that "str[i] = ?c" because of
- the following change.
- o ?c is evaluated to a single character string
- instead of an integer.
- * Regexp
- o Encoding-awareness
- o Regexp matches only with strings which is encoded in a
- compatible character encoding to the regexp's.
- o Regexp#kcode is removed. use Regexp#encoding.
- * Symbols: restriction on literal symbols
- * Numeric
- o Numeric#div always rounds as Integer#div has done.
- o Numeric#fdiv: ditto.
- * Integer
- o Integer(nil) raises TypeError
- * Fixnum
- o Fixnum#id2name removed
- o Fixnum#to_sym removed
- * Struct
- o Struct#inspect
- * Time
- o New format in Time#to_s
- o Timezone information preserved on Marshal.dump/load
- * $SAFE and bound methods
- o New trusted/untrusted model in addition to
- tainted/untainted model.
-
- * Deprecation
- o $= (global flag for case-sensitiveness on string matching)
- o Kernel#to_a
- o Kernel#getc, #gsub, #sub
- o Kernel#callcc and Continuation now become 'continuation'
- bundled library.
- o Object#type
- o Removed Array and Hash #indices, #indexes
- o Hash#index
- o ENV.index
- o Process::Status#to_int
- o Numeric#rdiv
- o Precision is removed. Don't cry, it will be redesigned
- and come back in future version.
- o Symbol#to_int and Symbol#to_i
- o $KCODE is no longer effective. Use Encoding related
- features of each class.
- o VERSION and friends
-
-* bundled libraries
-
- * Pathname
- o No longer has #to_str nor #=~.
- * time and date
- o Time.parse and Date.parse interprets slashed numerical dates
- as "dd/mm/yyyy".
- * Readline
- o If Readline uses libedit, Readline::HISTORY[0] returns the
- first of the history.
- * Continuation
- o as above
-
- * Deprecation
- o Complex#image: use Complex#imag
- o All SSL-related class methods in Net::SMTP
- o Prime#cache, Prime#primes, Prime#primes_so_far
- o mailread library: use tmail gem.
- o cgi-lib library: use cgi.
- o date2 library: use date.
- o eregex library
- o finalize library: use ObjectSpace.define_finalizer if you
- really need a finalizer. really?
- o ftools library: use fileutils.
- o generator library: use Enumerator.
- o importenv library and Env library
- o jcode library: use multilingualization support of String
- o parsedate library
- o ping library
- o readbytes library
- o getopts library and parsearg library: use optparse or
- getoptlong.
- o soap, wsdl and xsd libraries: use soap4r gem.
- o Win32API library: use dl.
- o dl library: Reimplemented and API changed. use the new
- version of dl or ffi gem.
- o rubyunit library and runit library: use minitest or
- test/unit. Or use anything you love through RubyGems.
- o test/unit is reimplemented on top of minitest. This is
- not fully compatible with the original.
-
-=== Language core changes
-
- * New syntax and semantics
- o Magic comments to declare in which encoding your source
- code is written
- o New literal hash syntax and new syntax for hash style
- arguments
- o New syntax for lambdas
- o .() and calling Procs without #call/#[]
- o Block in block arguments
- o Block local variables
- o Mandatory arguments after optional arguments allowed
- o Multiple splats allowed
- o #[] can take splatted arguments, hash style arguments
- and a block.
- o New directives in printf-style formatted strings (%).
- o Newlines allowed before ternary colon operator (:) and
- method call dot operator (.)
- o Negative operators such as !, != and !~ are now
- overloadable
- o Encoding.default_external and default_internal
- o __ENCODING__: New pseudo variable to hold the current
- script's encoding
-
-=== Library updates
-
-* builtin classes and objects
- * Kernel and Object
- o BasicObject
- o Object#=~ returns nil instead of false by default.
- o Kernel#define_singleton_method
- o Kernel#load can load a library from the highest versions
- of gems by default.
- * Class and Module
- o Module#const_defined?, #const_get and #method_defined?
- take an optional parameter.
- o #class_variable_{set,get} are public.
- o Class of singleton classes
-
- * Errno::EXXX
- o All of those are always defined. Errno::EXXX will be
- defined as an alias to Errno::NOERROR if your platform
- does not have one.
-
- * Binding#eval
- * Blocks and Procs
- o Arity of blocks without arguments
- o proc is now a synonym of Proc.new
- o Proc#yield
- o Passing blocks to #[]
- o Proc#lambda?
- o Proc#curry
- * Fiber: coroutines/micro-threads
- * Thread
- o Thread.critical and Thread.critical= removed
- o Thread#exit!, Thread#kill! and Thread#terminate! removed.
-
- * Enumerable and Enumerator
- o Enumerator#enum_cons and Enumerator#enum_slice are
- removed. Use #each_cons and #each_slice without a block.
- o Enumerable#each_with_index can take optional arguments
- and passes them to #each.
- o Enumerable#each_with_object
- o Enumerator#with_object
- o Enumerator.new { ... }
- * Array
- o Array#delete returns a deleted element rather than a given
- object
- o Array#to_s is equivalent to Array#inspect
- o Array.try_convert
- o Array#pack('m0') complies with RFC 4648.
- * Hash
- o preserving item insertion order
- o Hash#default_proc=
- o Hash#_compare_by_identity and Hash#compare_by_identity?
- o Hash.try_convert
- o Hash#assoc
- o Hash#rassoc
- o Hash#flatten
- * Range
- o Range#cover?
- o Range#include? iterates over elements and compares the
- given value with each element unless the range is numeric.
- Use Range#cover? for the old behavior, i.e. comparison
- with boundary values.
- o Range#min, Range#max
-
- * File and Dir operations
- o New methods
- * Process
- o Process.spawn
- o Process.daemon
- * String
- o String#clear
- o String#ord
- o String#getbyte, String#setbyte
- o String#chars and String#each_char act as character-wise.
- o String#codepoints, String#each_codepoint
- o String#unpack with a block
- o String#hash
- o String.try_convert
- o String#encoding
- o String#force_encoding, String#encode and String#encode!
- o String#ascii_only?
- o String#valid_encoding?
- o String#match
- * Symbol
- o Zero-length symbols allowed
- o Symbol#intern
- o Symbol#encoding
- o Symbol methods similar to those in String
- * Regexp
- o Regexp#=== matches symbols
- o Regexp.try_convert
- o Regexp#match
- o Regexp#fixed_encoding?
- o Regexp#encoding
- o Regexp#named_captures
- o Regexp#names
- * MatchData
- o MatchData#names
- o MatchData#regexp
- * Encoding
- * Encoding::Converter
- o supports conversion between many encodings
- * Numeric
- o Numeric#upto, #downto, #times, #step
- o Numeric#real?, Complex#real?
- o Numeric#magnitude
- * Rational / Complex
- o They are in the core library now
- * Math
- o Math#log takes an optional argument.
- o Math#log2
- o Math#cbrt, Math#lgamma, Math#gamma
- * Time
- o Time.times removed. Use Process.times.
- o Time#sunday?
- o Time#monday?
- o Time#tuesday?
- o Time#wednesday?
- o Time#thursday?
- o Time#friday?
- o Time#saturday?
- o Time#tv_nsec and Time#nsec
- * Misc. new methods
- o RUBY_ENGINE to distinguish between Ruby processor implementation
- o public_method
- o public_send
- o GC.count
- o ObjectSpace.count_objects
- o Method#hash, Proc#hash
- o Method#source_location, UnboundMethod#source_location and
- Proc#source_location
- o __callee__
- o Elements in $LOAD_PATH and $LOADED_FEATURES are expanded
-
-* bundled libraries
- * RubyGems
- o Package management system for Ruby.
- o Integrated with Ruby's library loader.
- * Rake
- o Ruby make. A simple ruby build program with capabilities
- similar to make.
- * minitest
- o Our new testing library which is faster, cleaner and easier
- to read than the old test/unit.
- o You can introduce the old test/unit as testunit gem through
- RubyGems if you want.
- * CMath
- o Complex number version of Math
- * Prime
- o Extracted from Mathn and improved. You can easily enumerate
- prime numbers.
- o Prime.new is obsolete. Use its class methods.
- * ripper
- o Ruby script parser
- * Readline
- o Readline.vi_editing_mode?
- o Readline.emacs_editing_mode?
- o Readline::HISTORY.clear
- * Tk
- o TkXXX widget classes are removed and redefined as aliases of
- Tk::XXX classes.
- * RDoc
- o Updated to version 2.2.2. See:
- http://rubyforge.org/frs/shownotes.php?group_id=627&release_id=26434
-
-* commandline options
- * -E, --encoding
- * -U
- * --enable-gems, --disable-gems
- * --enable-rubyopt, --disable-rubyopt
- * long options are allowed in RUBYOPT environment variable.
-
-=== Implementation changes
-
-* Memory Diet
- * Object Compaction - Object, Array, String, Hash, Struct, Class,
- Module
- * st_table compaction (inlining small tables)
-* YARV
- * Ruby codes are compiled into opcodes before executed.
- * Native thread
-
-* Platform supports
- * Support levels
- (0) Supported
- (1) Best effort
- (2) Perhaps
- (3) Not supported
- * Dropped
- o No longer supports djgpp, bcc32, human68k, MacOS 9 or earlier,
- VMS nor Windows CE.
diff --git a/doc/forwardable.rd b/doc/forwardable.rd
index 0eca25b90a..7272c374b6 100644
--- a/doc/forwardable.rd
+++ b/doc/forwardable.rd
@@ -2,6 +2,7 @@
$Release Version: 1.1 $
$Revision$
+ $Date$
Original version by Tosh
=begin
diff --git a/doc/forwardable.rd.ja b/doc/forwardable.rd.ja
index 48186b111f..d928fddc5e 100644
--- a/doc/forwardable.rd.ja
+++ b/doc/forwardable.rd.ja
@@ -1,6 +1,7 @@
-- forwatable.rb
$Release Version: 1.1 $
$Revision$
+ $Date$
=begin
= Forwardable
diff --git a/doc/images/boottime-classes.png b/doc/images/boottime-classes.png
deleted file mode 100644
index b5fab75c41..0000000000
--- a/doc/images/boottime-classes.png
+++ /dev/null
Binary files differ
diff --git a/doc/irb/irb-tools.rd.ja b/doc/irb/irb-tools.rd.ja
index 7711f96e08..64d9ab29c8 100644
--- a/doc/irb/irb-tools.rd.ja
+++ b/doc/irb/irb-tools.rd.ja
@@ -1,6 +1,7 @@
irbϢޤޥɤȥ饤֥
$Release Version: 0.7.1 $
$Revision$
+ $Date$
by Keiju ISHITSUKA(Nihon Rational Co.,Ltd.)
=begin
diff --git a/doc/irb/irb.rd b/doc/irb/irb.rd
index 8468809d2b..a42cd46680 100644
--- a/doc/irb/irb.rd
+++ b/doc/irb/irb.rd
@@ -1,6 +1,7 @@
irb -- interactive ruby
$Release Version: 0.9 $
$Revision$
+ $Date$
by Keiju ISHITSUKA(keiju@ishitsuka.com)
by gotoken-san who is original translater from japanese version
diff --git a/doc/irb/irb.rd.ja b/doc/irb/irb.rd.ja
index 53f76180ec..338dcc644e 100644
--- a/doc/irb/irb.rd.ja
+++ b/doc/irb/irb.rd.ja
@@ -1,6 +1,7 @@
irb -- interactive ruby
$Release Version: 0.9.5 $
$Revision$
+ $Date$
by Keiju ISHITSUKA(keiju@ruby-lang.org)
=begin
= irbȤ?
diff --git a/doc/shell.rd b/doc/shell.rd
index 8a1f7c5a80..02ee1b020a 100644
--- a/doc/shell.rd
+++ b/doc/shell.rd
@@ -1,6 +1,7 @@
-- shell.rb
$Release Version: 0.6.0 $
$Revision$
+ $Date$
by Keiju ISHITSUKA(keiju@ishitsuka.com)
=begin
diff --git a/doc/shell.rd.ja b/doc/shell.rd.ja
index 33e5a9ed9b..073e71ea42 100644
--- a/doc/shell.rd.ja
+++ b/doc/shell.rd.ja
@@ -1,6 +1,7 @@
-- shell.rb
$Release Version: 0.6.0 $
$Revision$
+ $Date$
by Keiju ISHITSUKA(keiju@ishitsuka.com)
=begin
diff --git a/enc/Makefile.in b/enc/Makefile.in
deleted file mode 100644
index 8ba04f374a..0000000000
--- a/enc/Makefile.in
+++ /dev/null
@@ -1,63 +0,0 @@
-encsrcdir = @srcdir@
-topdir = .
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-libdir = @libdir@
-top_srcdir = $(encsrcdir:/enc=)
-srcdir = $(top_srcdir)
-arch = @arch@
-EXTOUT = @EXTOUT@
-hdrdir = $(srcdir)/include
-arch_hdrdir = $(EXTOUT)/include/$(arch)
-ENCSODIR = $(EXTOUT)/$(arch)/enc
-TRANSSODIR = $(ENCSODIR)/trans
-DLEXT = @DLEXT@
-OBJEXT = @OBJEXT@
-
-BUILTIN_ENCS = ascii.c us_ascii.c\
- unicode.c utf_8.c
-
-BUILTIN_TRANSES = newline.trans
-
-RUBY_SO_NAME = @RUBY_SO_NAME@
-LIBRUBY = @LIBRUBY@
-LIBRUBYARG_SHARED = @LIBRUBYARG_SHARED@
-LIBRUBYARG_STATIC = $(LIBRUBYARG_SHARED)
-
-empty =
-CC = @CC@
-OUTFLAG = @OUTFLAG@$(empty)
-COUTFLAG = @COUTFLAG@$(empty)
-CFLAGS = $(CCDLFLAGS) @CFLAGS@ @ARCH_FLAG@
-cflags = @cflags@
-optflags = @optflags@
-debugflags = @debugflags@
-warnflags = @warnflags@
-CCDLFLAGS = @CCDLFLAGS@
-INCFLAGS = -I. -I$(arch_hdrdir) -I$(hdrdir) -I$(top_srcdir)
-DEFS = @DEFS@
-CPPFLAGS = @CPPFLAGS@ -DONIG_ENC_REGISTER=rb_enc_register
-LDFLAGS = @LDFLAGS@
-LDSHARED = @LDSHARED@
-ldflags = $(LDFLAGS)
-dldflags = @DLDFLAGS@
-archflag = @ARCH_FLAG@
-DLDFLAGS = $(ldflags) $(dldflags) $(archflag)
-RUBY = $(MINIRUBY)
-
-WORKDIRS = $(ENCSODIR) $(TRANSSODIR) enc enc/trans
-
-RM = @RM@
-MAKEDIRS = @MAKEDIRS@
-
-.SUFFIXES: .trans
-
-all: make-workdir
-
-make-workdir:
- $(MAKEDIRS) $(WORKDIRS)
-
-clean:
-
-distclean: clean clean-srcs
- @$(RM) enc.mk
diff --git a/enc/ascii.c b/enc/ascii.c
deleted file mode 100644
index 3d62ec9bf7..0000000000
--- a/enc/ascii.c
+++ /dev/null
@@ -1,93 +0,0 @@
-/**********************************************************************
- ascii.c - Oniguruma (regular expression library)
-**********************************************************************/
-/*-
- * Copyright (c) 2002-2006 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"
-
-OnigEncodingDefine(ascii, ASCII) = {
- onigenc_single_byte_mbc_enc_len,
- "ASCII-8BIT",/* name */
- 1, /* max byte length */
- 1, /* min byte length */
- onigenc_is_mbc_newline_0x0a,
- onigenc_single_byte_mbc_to_code,
- onigenc_single_byte_code_to_mbclen,
- onigenc_single_byte_code_to_mbc,
- onigenc_ascii_mbc_case_fold,
- onigenc_ascii_apply_all_case_fold,
- onigenc_ascii_get_case_fold_codes_by_str,
- onigenc_minimum_property_name_to_ctype,
- onigenc_ascii_is_code_ctype,
- onigenc_not_support_get_ctype_code_range,
- onigenc_single_byte_left_adjust_char_head,
- onigenc_always_true_is_allowed_reverse_match
-};
-ENC_ALIAS("BINARY", "ASCII-8BIT")
-ENC_REPLICATE("IBM437", "ASCII-8BIT")
-ENC_ALIAS("CP437", "IBM437")
-ENC_REPLICATE("IBM737", "ASCII-8BIT")
-ENC_ALIAS("CP737", "IBM737")
-ENC_REPLICATE("IBM775", "ASCII-8BIT")
-ENC_ALIAS("CP775", "IBM775")
-ENC_REPLICATE("CP850", "ASCII-8BIT")
-ENC_ALIAS("IBM850", "CP850")
-ENC_REPLICATE("IBM852", "ASCII-8BIT")
-ENC_REPLICATE("CP852", "IBM852")
-ENC_REPLICATE("IBM855", "ASCII-8BIT")
-ENC_REPLICATE("CP855", "IBM855")
-ENC_REPLICATE("IBM857", "ASCII-8BIT")
-ENC_ALIAS("CP857", "IBM857")
-ENC_REPLICATE("IBM860", "ASCII-8BIT")
-ENC_ALIAS("CP860", "IBM860")
-ENC_REPLICATE("IBM861", "ASCII-8BIT")
-ENC_ALIAS("CP861", "IBM861")
-ENC_REPLICATE("IBM862", "ASCII-8BIT")
-ENC_ALIAS("CP862", "IBM862")
-ENC_REPLICATE("IBM863", "ASCII-8BIT")
-ENC_ALIAS("CP863", "IBM863")
-ENC_REPLICATE("IBM864", "ASCII-8BIT")
-ENC_ALIAS("CP864", "IBM864")
-ENC_REPLICATE("IBM865", "ASCII-8BIT")
-ENC_ALIAS("CP865", "IBM865")
-ENC_REPLICATE("IBM866", "ASCII-8BIT")
-ENC_ALIAS("CP866", "IBM866")
-ENC_REPLICATE("IBM869", "ASCII-8BIT")
-ENC_ALIAS("CP869", "IBM869")
-ENC_REPLICATE("Windows-1258", "ASCII-8BIT")
-ENC_ALIAS("CP1258", "Windows-1258")
-ENC_REPLICATE("GB1988", "ASCII-8BIT")
-ENC_REPLICATE("macCentEuro", "ASCII-8BIT")
-ENC_REPLICATE("macCroatian", "ASCII-8BIT")
-ENC_REPLICATE("macCyrillic", "ASCII-8BIT")
-ENC_REPLICATE("macGreek", "ASCII-8BIT")
-ENC_REPLICATE("macIceland", "ASCII-8BIT")
-ENC_REPLICATE("macRoman", "ASCII-8BIT")
-ENC_REPLICATE("macRomania", "ASCII-8BIT")
-ENC_REPLICATE("macThai", "ASCII-8BIT")
-ENC_REPLICATE("macTurkish", "ASCII-8BIT")
-ENC_REPLICATE("macUkraine", "ASCII-8BIT")
diff --git a/enc/big5.c b/enc/big5.c
deleted file mode 100644
index 9993f472e1..0000000000
--- a/enc/big5.c
+++ /dev/null
@@ -1,216 +0,0 @@
-/**********************************************************************
- big5.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"
-
-static const int EncLen_BIG5[] = {
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1
-};
-
-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, 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, 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 */ 1, 1, 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 */ 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, 1, 1, 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 */ 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, 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, A, A, F
- }
-};
-#undef A
-#undef F
-
-static int
-big5_mbc_enc_len(const UChar* p, const UChar* e, OnigEncoding enc ARG_UNUSED)
-{
- int firstbyte = *p++;
- state_t s = trans[0][firstbyte];
-#define RETURN(n) \
- return s == ACCEPT ? ONIGENC_CONSTRUCT_MBCLEN_CHARFOUND(n) : \
- ONIGENC_CONSTRUCT_MBCLEN_INVALID()
- if (s < 0) RETURN(1);
- if (p == e) return ONIGENC_CONSTRUCT_MBCLEN_NEEDMORE(EncLen_BIG5[firstbyte]-1);
- s = trans[s][*p++];
- RETURN(2);
-#undef RETURN
-}
-
-static OnigCodePoint
-big5_mbc_to_code(const UChar* p, const UChar* end, OnigEncoding enc)
-{
- return onigenc_mbn_mbc_to_code(enc, p, end);
-}
-
-static int
-big5_code_to_mbc(OnigCodePoint code, UChar *buf, OnigEncoding enc)
-{
- return onigenc_mb2_code_to_mbc(enc, code, buf);
-}
-
-static int
-big5_mbc_case_fold(OnigCaseFoldType flag, const UChar** pp, const UChar* end,
- UChar* lower, OnigEncoding enc)
-{
- return onigenc_mbn_mbc_case_fold(enc, flag,
- pp, end, lower);
-}
-
-#if 0
-static int
-big5_is_mbc_ambiguous(OnigCaseFoldType flag,
- const UChar** pp, const UChar* end, OnigEncoding enc)
-{
- return onigenc_mbn_is_mbc_ambiguous(enc, flag, pp, end);
-}
-#endif
-
-static int
-big5_is_code_ctype(OnigCodePoint code, unsigned int ctype, OnigEncoding enc)
-{
- return onigenc_mb2_is_code_ctype(enc, code, ctype);
-}
-
-static const char BIG5_CAN_BE_TRAIL_TABLE[256] = {
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0
-};
-
-#define BIG5_ISMB_FIRST(byte) (EncLen_BIG5[byte] > 1)
-#define BIG5_ISMB_TRAIL(byte) BIG5_CAN_BE_TRAIL_TABLE[(byte)]
-
-static UChar*
-big5_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 (BIG5_ISMB_TRAIL(*p)) {
- while (p > start) {
- if (! BIG5_ISMB_FIRST(*--p)) {
- p++;
- break;
- }
- }
- }
- len = enclen(enc, p, end);
- if (p + len > s) return (UChar* )p;
- p += len;
- return (UChar* )(p + ((s - p) & ~1));
-}
-
-static int
-big5_is_allowed_reverse_match(const UChar* s, const UChar* end ARG_UNUSED, OnigEncoding enc ARG_UNUSED)
-{
- const UChar c = *s;
-
- return (BIG5_ISMB_TRAIL(c) ? FALSE : TRUE);
-}
-
-OnigEncodingDefine(big5, BIG5) = {
- big5_mbc_enc_len,
- "Big5", /* name */
- 2, /* max enc length */
- 1, /* min enc length */
- onigenc_is_mbc_newline_0x0a,
- big5_mbc_to_code,
- onigenc_mb2_code_to_mbclen,
- big5_code_to_mbc,
- big5_mbc_case_fold,
- onigenc_ascii_apply_all_case_fold,
- onigenc_ascii_get_case_fold_codes_by_str,
- onigenc_minimum_property_name_to_ctype,
- big5_is_code_ctype,
- onigenc_not_support_get_ctype_code_range,
- big5_left_adjust_char_head,
- big5_is_allowed_reverse_match
-};
-ENC_ALIAS("CP950", "BIG5")
diff --git a/enc/cp949.c b/enc/cp949.c
deleted file mode 100644
index 009443aed4..0000000000
--- a/enc/cp949.c
+++ /dev/null
@@ -1,219 +0,0 @@
-/**********************************************************************
- cp949.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"
-
-static const int EncLen_CP949[] = {
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1
-};
-
-static const char CP949_CAN_BE_TRAIL_TABLE[256] = {
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0
-};
-
-#define CP949_ISMB_FIRST(byte) (EncLen_CP949[byte] > 1)
-#define CP949_ISMB_TRAIL(byte) CP949_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 */ A, 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 */ 1, 1, 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 */ 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, 1, 1, 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, 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, F, F, F, F, F,
- /* 6 */ F, 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, F, F, F, F, F,
- /* 8 */ F, 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, A, A, F
- }
-};
-#undef A
-#undef F
-
-static int
-cp949_mbc_enc_len(const UChar* p, const UChar* e, OnigEncoding enc ARG_UNUSED)
-{
- int firstbyte = *p++;
- state_t s = trans[0][firstbyte];
-#define RETURN(n) \
- return s == ACCEPT ? ONIGENC_CONSTRUCT_MBCLEN_CHARFOUND(n) : \
- ONIGENC_CONSTRUCT_MBCLEN_INVALID()
- if (s < 0) RETURN(1);
- if (p == e) return ONIGENC_CONSTRUCT_MBCLEN_NEEDMORE(EncLen_CP949[firstbyte]-1);
- s = trans[s][*p++];
- RETURN(2);
-#undef RETURN
-}
-
-static OnigCodePoint
-cp949_mbc_to_code(const UChar* p, const UChar* end, OnigEncoding enc)
-{
- return onigenc_mbn_mbc_to_code(enc, p, end);
-}
-
-static int
-cp949_code_to_mbc(OnigCodePoint code, UChar *buf, OnigEncoding enc)
-{
- return onigenc_mb2_code_to_mbc(enc, code, buf);
-}
-
-static int
-cp949_mbc_case_fold(OnigCaseFoldType flag, const UChar** pp, const UChar* end,
- UChar* lower, OnigEncoding enc)
-{
- return onigenc_mbn_mbc_case_fold(enc, flag,
- pp, end, lower);
-}
-
-#if 0
-static int
-cp949_is_mbc_ambiguous(OnigCaseFoldType flag,
- const UChar** pp, const UChar* end, OnigEncoding enc)
-{
- return onigenc_mbn_is_mbc_ambiguous(enc, flag, pp, end);
-}
-#endif
-
-static int
-cp949_is_code_ctype(OnigCodePoint code, unsigned int ctype, OnigEncoding enc)
-{
- return onigenc_mb2_is_code_ctype(enc, code, ctype);
-}
-
-static UChar*
-cp949_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 (CP949_ISMB_TRAIL(*p)) {
- while (p > start) {
- if (! CP949_ISMB_FIRST(*--p)) {
- p++;
- break;
- }
- }
- }
- len = enclen(enc, p, end);
- if (p + len > s) return (UChar* )p;
- p += len;
- return (UChar* )(p + ((s - p) & ~1));
-}
-
-static int
-cp949_is_allowed_reverse_match(const UChar* s, const UChar* end ARG_UNUSED, OnigEncoding enc ARG_UNUSED)
-{
- const UChar c = *s;
- return (CP949_ISMB_TRAIL(c) ? FALSE : TRUE);
-}
-
-OnigEncodingDefine(cp949, CP949) = {
- cp949_mbc_enc_len,
- "CP949", /* name */
- 2, /* max enc length */
- 1, /* min enc length */
- onigenc_is_mbc_newline_0x0a,
- cp949_mbc_to_code,
- onigenc_mb2_code_to_mbclen,
- cp949_code_to_mbc,
- cp949_mbc_case_fold,
- onigenc_ascii_apply_all_case_fold,
- onigenc_ascii_get_case_fold_codes_by_str,
- onigenc_minimum_property_name_to_ctype,
- cp949_is_code_ctype,
- onigenc_not_support_get_ctype_code_range,
- cp949_left_adjust_char_head,
- cp949_is_allowed_reverse_match
-};
-/*
- * Name: CP949
- * Link: http://www.microsoft.com/globaldev/reference/dbcs/949.mspx
- * Link: http://en.wikipedia.org/wiki/EUC-KR#EUC-KR
- */
diff --git a/enc/depend b/enc/depend
deleted file mode 100644
index 7186179ef0..0000000000
--- a/enc/depend
+++ /dev/null
@@ -1,143 +0,0 @@
-% CONFIG["DLDFLAGS"].sub!(/(\A|\s)(-\S+(?:\s*\w*)?\$\(TARGET\)\S*)/, '\1')
-% dldflags = $2
-% enable_shared = CONFIG['ENABLE_SHARED'] == 'yes'
-% deffile = (true if /\$\(DEFFILE\)/ =~ CONFIG["LINK_SO"])
-% encs = Dir.open($srcdir) {|d| d.grep(/.+\.c\z/)} - BUILTIN_ENCS
-% encs.each {|e| e.chomp!(".c")}
-% encs.reject! {|e| !ENC_PATTERNS.any? {|p| File.fnmatch?(p, e)}} if !ENC_PATTERNS.empty?
-% encs.reject! {|e| NOENC_PATTERNS.any? {|p| File.fnmatch?(p, e)}}
-% alphanumeric_order = proc {|e| e.scan(/(\d+)|(\D+)/).map {|n,a| a||[n.size,n.to_i]}.flatten}
-% encs = encs.sort_by(&alphanumeric_order)
-% encs.unshift(encs.delete("encdb"))
-% atrans = []
-% trans = Dir.open($srcdir+"/trans") {|d|
-% d.select {|e|
-% if e.chomp!('.trans')
-% atrans << e
-% true
-% elsif e.chomp!('.c')
-% true
-% end
-% }
-% }
-% trans -= BUILTIN_TRANSES
-% atrans -= BUILTIN_TRANSES
-% trans.uniq!
-% atrans = atrans.sort_by(&alphanumeric_order)
-% trans = trans.sort_by(&alphanumeric_order)
-% trans.unshift(trans.delete("transdb"))
-% trans.compact!
-% trans |= atrans
-% trans.map! {|e| "trans/#{e}"}
-% dependencies = encs + trans
-% cleanlibs = Shellwords.shellwords(CONFIG["cleanlibs"] || "")
-% cleanobjs = Shellwords.shellwords(CONFIG["cleanobjs"] || "")
-% cleanobjs << "$*.def" if deffile
-% rule_subst = CONFIG["RULE_SUBST"] || "%s"
-% transvpath = rule_subst.dup.sub!(/\{[^{}]+\}/, '$(TRANSVPATH)/') || "enc/trans/%s"
-% transvpath_prefix = (rule_subst.dup.sub!(/\{[^{}]+\}/, '{$(TRANSVPATH)}') || "") % ""
-% if File::ALT_SEPARATOR
-% pathrep = proc {|path| path.gsub('/', File::ALT_SEPARATOR).gsub(/\$\(([@<?*]\w?|\w+)\)/, "$(\\1:/=\\#{File::ALT_SEPARATOR})")}
-% else
-% pathrep = proc {|path| path}
-% end
-
-VPATH = <%=%w[$(arch_hdrdir)/ruby $(hdrdir)/ruby $(srcdir) $(encsrcdir)].join(CONFIG["PATH_SEPARATOR"])%>
-LIBPATH = <%=libpathflag($DEFLIBPATH)%>
-LIBS = <%=
-if enable_shared or RbConfig.expand(CONFIG["LIBRUBY"].dup) != RbConfig.expand(CONFIG["LIBRUBY_A"].dup)
- CONFIG['LIBRUBYARG']
-else
- ''
-end %> <%=CONFIG['LIBS']%> $(EXTLIBS)
-
-ENCOBJS = <%=encs.map {|e|"enc/#{e}.$(OBJEXT)"}.join(" \\\n\t ")%><%="\n" if encs.size>1%>
-ENCSOS = <%=encs.map {|e|"$(ENCSODIR)/#{e}.$(DLEXT)"}.join(" \\\n\t ")%><%="\n" if encs.size>1%>
-ENCCLEANLIBS = <%=cleanlibs.map {|clean|
- clean.gsub(/\$\*(\.\w+)?/) {"$(ENCOBJS#{$1 ? ":.#{CONFIG["OBJEXT"]}=#{$1}" : ""})"}
-}.join(" ")%>
-ENCCLEANOBJS = <%=cleanobjs.map {|clean|
- clean.gsub(/\$\*(\.\w+)?/) {"$(ENCOBJS#{$1 ? ":.#{CONFIG["OBJEXT"]}=#{$1}" : ""})"}
-}.join(" ")%>
-
-TRANSVPATH = $(srcdir)/enc/trans
-
-TRANSCSRCS = <%=atrans.map {|e| transvpath % "#{e}.c"}.join(" \\\n\t ")%><%="\n" if trans.size>1%>
-TRANSOBJS = <%=trans.map {|e|"enc/#{e}.$(OBJEXT)"}.join(" \\\n\t ")%><%="\n" if trans.size>1%>
-TRANSSOS = <%=trans.map {|e|"$(ENCSODIR)/#{e}.$(DLEXT)"}.join(" \\\n\t ")%><%="\n" if trans.size>1%>
-TRANSCLEANLIBS = <%=cleanlibs.map {|clean|
- clean.gsub(/\$\*(\.\w+)?/) {"$(TRANSOBJS#{$1 ? ":.#{CONFIG["OBJEXT"]}=#{$1}" : ""})"}
-}.join(" ")%>
-TRANSCLEANOBJS = <%=cleanobjs.map {|clean|
- clean.gsub(/\$\*(\.\w+)?/) {"$(TRANSOBJS#{$1 ? ":.#{CONFIG["OBJEXT"]}=#{$1}" : ""})"}
-}.join(" ")%>
-
-encs: all
-all: enc trans
-enc: $(ENCSOS)
-trans: $(TRANSSOS)
-
-srcs: $(TRANSCSRCS)
-
-<%=transvpath_prefix%>.trans<%=transvpath_prefix%>.c:
- $(MINIRUBY) "$(srcdir)/tool/transcode-tblgen.rb" -vo "$@" "$<"
-
-% unless encs.empty? or trans.empty?
-
-% unless encs.empty?
-$(ENCOBJS): regenc.h oniguruma.h config.h defines.h
-% end
-% unless trans.empty?
-$(TRANSOBJS): ruby.h intern.h config.h defines.h missing.h encoding.h oniguruma.h st.h transcode_data.h
-% end
-% atrans.each do |e|
-% src = "#{e}.trans"
-
-<%=transvpath % "#{e}.c"%>: <%= transvpath % "#{e}.trans"%>
-% src = [*IO.read(File.join($srcdir, "trans", src)).scan(/^\s*require\s+[\'\"]([^\'\"]*)/).flatten.map{|c|c+".rb"}]
-<%=transvpath % "#{e}.c"%>: <%= src.map {|e| transvpath % "#{e}"}.join(" ")%> $(srcdir)/tool/transcode-tblgen.rb
-% end
-
-% end
-% link_so = LINK_SO.gsub(/\n/, "\n\t")
-% link_so.gsub!(/(-(?:implib|pdb):\S+)-\$\(arch\)\./, '\1.')
-% dependencies.each do |e|
-% obj = "enc/#{e}.$(OBJEXT)"
-% df = ("enc/#{e}.def" if deffile)
-$(ENCSODIR)/<%=e%>.$(DLEXT): <%=obj%>
-% cmd = link_so.sub(/\$\(OBJS\)/) {obj}
-% base = File.basename(e)
-% cmd.sub!(/(?=\$\(DLDFLAGS\))/) {dldflags.sub(/\$\(TARGET\)/) {base} + " "} if dldflags
-% if df
- echo> <%=df%> EXPORTS
- echo>> <%=df%> <%=EXPORT_PREFIX%>Init_<%=base%>
-% cmd.sub!(/\$\(DEFFILE\)/) {df}
-% cmd.gsub!(/-(?:implib|pdb):/) {|s|"#{s}enc/#{e.sub(/[^\/]+\z/, '')}"}
-% end
- @$(MAKEDIRS) "$(@D)"
- <%=cmd%>
-
-% end
-% dependencies.each do |e|
-<%="enc/#{e}.$(OBJEXT)"%>: <%="$(encsrcdir)/#{e}.c"%>
- -@$(MAKEDIRS) "$(@D)"
- <%=COMPILE_C.gsub(/\$(\()?<(\:[^)]+)?(\))?/){"$(encsrcdir)/#{e}.c"}%>
-
-% end
-
-enc/encdb.$(OBJEXT): encdb.h
-enc/trans/transdb.$(OBJEXT): transdb.h
-
-clean:
-% %w[$(ENCSOS) $(ENCOBJS) $(ENCCLEANOBJS) $(ENCCLEANLIBS) $(TRANSSOS) $(TRANSOBJS) $(TRANSCLEANOBJS) $(TRANSCLEANLIBS)].each do |clean|
- @$(RM) <%=pathrep[clean]%>
-% end
-% %w[$(TRANSSODIR) $(ENCSODIR)].each do|dir|
- @-rmdir <%=pathrep[dir]%>
-% end
-
-clean-srcs:
- @$(RM) <%=pathrep['$(TRANSCSRCS)']%>
-% %w[enc/trans enc].each do|dir|
- @-rmdir <%=pathrep[dir]%>
-% end
diff --git a/enc/emacs_mule.c b/enc/emacs_mule.c
deleted file mode 100644
index be7f842259..0000000000
--- a/enc/emacs_mule.c
+++ /dev/null
@@ -1,340 +0,0 @@
-/**********************************************************************
- emacs_mule.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 "regint.h"
-
-
-#define emacsmule_islead(c) ((UChar )((c) - 0x81) > 0x9d - 0x81)
-
-/*
- CHARACTER := ASCII_CHAR | MULTIBYTE_CHAR
- MULTIBYTE_CHAR := PRIMARY_CHAR_1 | PRIMARY_CHAR_2
- | SECONDARY_CHAR_1 | SECONDARY_CHAR_2
- PRIMARY_CHAR_1 := LEADING_CODE_PRI C1
- PRIMARY_CHAR_2 := LEADING_CODE_PRI C1 C2
- SECONDARY_CHAR_1 := LEADING_CODE_SEC LEADING_CODE_EXT C1
- SECONDARY_CHAR_2 := LEADING_CODE_SEC LEADING_CODE_EXT C1 C2
- ASCII_CHAR := 0 | 1 | ... | 127
- LEADING_CODE_PRI := 129 | 130 | ... | 153
- LEADING_CODE_SEC := 154 | 155 | 156 | 157
- C1, C2, LEADING_CODE_EXT := 160 | 161 | ... | 255
- */
-
-static const int EncLen_EmacsMule[] = {
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 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,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-};
-
-typedef enum { FAILURE = -2, ACCEPT = -1, S0 = 0, S1, S2, S3, S4, S5, S6 } 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 */ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 4, 5, 6, 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, F, F, F,
- /* 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 */ 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 */ 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, A, A, A
- },
- { /* 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 */ 1, 1, 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 */ 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, 1, 1, 1
- },
- { /* 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 */ 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 */ 1, 1, 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 */ 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 */ 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 */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- /* 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 */ 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, F, F, F,
- /* f */ 2, 2, 2, 2, 2, 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, F, F, F,
- /* f */ F, F, F, F, F, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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_EmacsMule[firstbyte]-1);
- s = trans[s][*p++];
- if (s < 0) return s == ACCEPT ? ONIGENC_CONSTRUCT_MBCLEN_CHARFOUND(2) :
- ONIGENC_CONSTRUCT_MBCLEN_INVALID();
- if (p == e) return ONIGENC_CONSTRUCT_MBCLEN_NEEDMORE(EncLen_EmacsMule[firstbyte]-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(EncLen_EmacsMule[firstbyte]-3);
- s = trans[s][*p++];
- return s == ACCEPT ? ONIGENC_CONSTRUCT_MBCLEN_CHARFOUND(4) :
- ONIGENC_CONSTRUCT_MBCLEN_INVALID();
-}
-
-static OnigCodePoint
-mbc_to_code(const UChar* p, const UChar* end, OnigEncoding enc)
-{
- int c, i, len;
- OnigCodePoint n;
-
- len = enclen(enc, p, end);
- n = (OnigCodePoint )*p++;
- 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_mbclen(OnigCodePoint code, OnigEncoding enc ARG_UNUSED)
-{
- if (ONIGENC_IS_CODE_ASCII(code)) return 1;
- else if (code > 0xffffffff) return 0;
- else if ((code & 0xff000000) >= 0x80000000) return 4;
- else if ((code & 0xff0000) >= 0x800000) return 3;
- else if ((code & 0xff00) >= 0x8000) return 2;
- else
- return ONIGERR_INVALID_CODE_POINT_VALUE;
-}
-
-static int
-code_to_mbc(OnigCodePoint code, UChar *buf, OnigEncoding enc)
-{
- UChar *p = buf;
-
- if ((code & 0xff000000) != 0) *p++ = (UChar )(((code >> 24) & 0xff));
- if ((code & 0xff0000) != 0) *p++ = (UChar )(((code >> 16) & 0xff));
- if ((code & 0xff00) != 0) *p++ = (UChar )(((code >> 8) & 0xff));
- *p++ = (UChar )(code & 0xff);
-
- if (enclen(enc, buf, p) != (p - buf))
- return ONIGERR_INVALID_CODE_POINT_VALUE;
- return p - buf;
-}
-
-static int
-mbc_case_fold(OnigCaseFoldType flag,
- const UChar** pp, const UChar* end, UChar* lower,
- OnigEncoding enc)
-{
- int len;
- const UChar* p = *pp;
-
- if (ONIGENC_IS_MBC_ASCII(p)) {
- *lower = ONIGENC_ASCII_CODE_TO_LOWER_CASE(*p);
- (*pp)++;
- return 1;
- }
- else {
- int i;
-
- len = mbc_enc_len(p, end, enc);
- for (i = 0; i < len; i++) {
- *lower++ = *p++;
- }
- (*pp) += len;
- return len; /* return byte length of converted char to lower */
- }
-}
-
-static UChar*
-left_adjust_char_head(const UChar* start, const UChar* s, const UChar* end, OnigEncoding enc)
-{
- const UChar *p;
-
- if (s <= start) return (UChar* )s;
- p = s;
-
- while (!emacsmule_islead(*p) && p > start) p--;
- return (UChar* )p;
-}
-
-static int
-is_code_ctype(OnigCodePoint code, unsigned int ctype, OnigEncoding enc ARG_UNUSED)
-{
- if (code < 128)
- return ONIGENC_IS_ASCII_CODE_CTYPE(code, ctype);
- else
- return (code_to_mbclen(code, enc) > 1 ? TRUE : FALSE);
-}
-
-/*
- * Name: Emacs-Mule
- * Link: http://www.m17n.org/mule/pricai96/mule.en.html
- */
-OnigEncodingDefine(emacs_mule, Emacs_Mule) = {
- mbc_enc_len,
- "Emacs-Mule", /* name */
- 4, /* max enc length */
- 1, /* min enc length */
- onigenc_is_mbc_newline_0x0a,
- mbc_to_code,
- code_to_mbclen,
- code_to_mbc,
- mbc_case_fold,
- onigenc_ascii_apply_all_case_fold,
- onigenc_ascii_get_case_fold_codes_by_str,
- onigenc_minimum_property_name_to_ctype,
- is_code_ctype,
- onigenc_not_support_get_ctype_code_range,
- left_adjust_char_head,
- onigenc_always_true_is_allowed_reverse_match,
- 0
-};
-
-ENC_REPLICATE("stateless-ISO-2022-JP", "Emacs-Mule")
diff --git a/enc/encdb.c b/enc/encdb.c
deleted file mode 100644
index 35f4c93b55..0000000000
--- a/enc/encdb.c
+++ /dev/null
@@ -1,25 +0,0 @@
-/**********************************************************************
-
- enc/encdb.c -
-
- $Author$
- created at: Mon Apr 7 15:51:31 2008
-
- Copyright (C) 2008 Yukihiro Matsumoto
-
-**********************************************************************/
-
-int rb_encdb_replicate(const char *alias, const char *orig);
-int rb_encdb_alias(const char *alias, const char *orig);
-int rb_encdb_dummy(const char *name);
-void rb_encdb_declare(const char *name);
-#define ENC_REPLICATE(name, orig) rb_encdb_replicate(name, orig)
-#define ENC_ALIAS(name, orig) rb_encdb_alias(name, orig)
-#define ENC_DUMMY(name) rb_encdb_dummy(name)
-#define ENC_DEFINE(name) rb_encdb_declare(name)
-
-void
-Init_encdb(void)
-{
-#include "encdb.h"
-}
diff --git a/enc/euc_jp.c b/enc/euc_jp.c
deleted file mode 100644
index 21f30ad2f3..0000000000
--- a/enc/euc_jp.c
+++ /dev/null
@@ -1,388 +0,0 @@
-/**********************************************************************
- euc_jp.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 "regint.h"
-
-
-#define eucjp_islead(c) ((UChar )((c) - 0xa1) > 0xfe - 0xa1)
-
-static const int EncLen_EUCJP[] = {
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 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, 3,
- 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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1
-};
-
-typedef enum { FAILURE = -2, ACCEPT = -1, S0 = 0, S1, S2 } 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, 1, 2,
- /* 9 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
- /* a */ F, 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 */ 1, 1, 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 */ 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, 1, 1, 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 */ 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, 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, A, A, 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 */ F, 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 */ 1, 1, 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 */ 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, 1, 1, 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_EUCJP[firstbyte]-1);
- s = trans[s][*p++];
- if (s < 0) return s == ACCEPT ? ONIGENC_CONSTRUCT_MBCLEN_CHARFOUND(2) :
- ONIGENC_CONSTRUCT_MBCLEN_INVALID();
- if (p == e) return ONIGENC_CONSTRUCT_MBCLEN_NEEDMORE(EncLen_EUCJP[firstbyte]-2);
- s = trans[s][*p++];
- return s == ACCEPT ? ONIGENC_CONSTRUCT_MBCLEN_CHARFOUND(3) :
- ONIGENC_CONSTRUCT_MBCLEN_INVALID();
-}
-
-static OnigCodePoint
-mbc_to_code(const UChar* p, const UChar* end, OnigEncoding enc)
-{
- int c, i, len;
- OnigCodePoint n;
-
- len = enclen(enc, p, end);
- n = (OnigCodePoint )*p++;
- 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_mbclen(OnigCodePoint code, OnigEncoding enc ARG_UNUSED)
-{
- if (ONIGENC_IS_CODE_ASCII(code)) return 1;
- else if (code > 0xffffff) return 0;
- else if ((code & 0xff0000) >= 0x800000) return 3;
- else if ((code & 0xff00) >= 0x8000) return 2;
- else
- return ONIGERR_INVALID_CODE_POINT_VALUE;
-}
-
-#if 0
-static int
-code_to_mbc_first(OnigCodePoint code)
-{
- int first;
-
- if ((code & 0xff0000) != 0) {
- first = (code >> 16) & 0xff;
- }
- else if ((code & 0xff00) != 0) {
- first = (code >> 8) & 0xff;
- }
- else {
- return (int )code;
- }
- return first;
-}
-#endif
-
-static int
-code_to_mbc(OnigCodePoint code, UChar *buf, OnigEncoding enc)
-{
- UChar *p = buf;
-
- if ((code & 0xff0000) != 0) *p++ = (UChar )(((code >> 16) & 0xff));
- if ((code & 0xff00) != 0) *p++ = (UChar )(((code >> 8) & 0xff));
- *p++ = (UChar )(code & 0xff);
-
-#if 1
- if (enclen(enc, buf, p) != (p - buf))
- return ONIGERR_INVALID_CODE_POINT_VALUE;
-#endif
- return p - buf;
-}
-
-static int
-mbc_case_fold(OnigCaseFoldType flag,
- const UChar** pp, const UChar* end, UChar* lower,
- OnigEncoding enc)
-{
- int len;
- const UChar* p = *pp;
-
- if (ONIGENC_IS_MBC_ASCII(p)) {
- *lower = ONIGENC_ASCII_CODE_TO_LOWER_CASE(*p);
- (*pp)++;
- return 1;
- }
- else {
- int i;
-
- len = enclen(enc, p, end);
- for (i = 0; i < len; i++) {
- *lower++ = *p++;
- }
- (*pp) += len;
- return len; /* return byte length of converted char to lower */
- }
-}
-
-static UChar*
-left_adjust_char_head(const UChar* start, const UChar* s, const UChar* end, OnigEncoding enc)
-{
- /* In this encoding
- mb-trail bytes doesn't mix with single bytes.
- */
- const UChar *p;
- int len;
-
- if (s <= start) return (UChar* )s;
- p = s;
-
- while (!eucjp_islead(*p) && p > start) p--;
- len = enclen(enc, p, end);
- 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;
- if (c <= 0x7e || c == 0x8e || c == 0x8f)
- return TRUE;
- else
- return FALSE;
-}
-
-
-static int PropertyInited = 0;
-static const OnigCodePoint** PropertyList;
-static int PropertyListNum;
-static int PropertyListSize;
-static hash_table_type* PropertyNameTable;
-
-static const OnigCodePoint CR_Hiragana[] = {
- 1,
- 0xa4a1, 0xa4f3
-}; /* CR_Hiragana */
-
-static const OnigCodePoint CR_Katakana[] = {
- 3,
- 0xa5a1, 0xa5f6,
- 0xaaa6, 0xaaaf,
- 0xaab1, 0xaadd
-}; /* CR_Katakana */
-
-static int
-init_property_list(void)
-{
- int r;
-
- PROPERTY_LIST_ADD_PROP("Hiragana", CR_Hiragana);
- PROPERTY_LIST_ADD_PROP("Katakana", CR_Katakana);
- PropertyInited = 1;
-
- end:
- return r;
-}
-
-static int
-property_name_to_ctype(OnigEncoding enc, UChar* p, UChar* end)
-{
- st_data_t ctype;
-
- PROPERTY_LIST_INIT_CHECK;
-
- if (onig_st_lookup_strend(PropertyNameTable, p, end, &ctype) == 0) {
- return onigenc_minimum_property_name_to_ctype(enc, p, end);
- }
-
- return ctype;
-}
-
-static int
-is_code_ctype(OnigCodePoint code, unsigned int ctype, OnigEncoding enc ARG_UNUSED)
-{
- 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 (code_to_mbclen(code, enc) > 1 ? TRUE : FALSE);
- }
- }
- }
- else {
- PROPERTY_LIST_INIT_CHECK;
-
- 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;
-
- PROPERTY_LIST_INIT_CHECK;
-
- ctype -= (ONIGENC_MAX_STD_CTYPE + 1);
- if (ctype >= (OnigCtype )PropertyListNum)
- return ONIGERR_TYPE_BUG;
-
- *ranges = PropertyList[ctype];
- return 0;
- }
-}
-
-
-OnigEncodingDefine(euc_jp, EUC_JP) = {
- mbc_enc_len,
- "EUC-JP", /* name */
- 3, /* max enc length */
- 1, /* min enc length */
- onigenc_is_mbc_newline_0x0a,
- mbc_to_code,
- code_to_mbclen,
- code_to_mbc,
- mbc_case_fold,
- onigenc_ascii_apply_all_case_fold,
- onigenc_ascii_get_case_fold_codes_by_str,
- property_name_to_ctype,
- is_code_ctype,
- get_ctype_code_range,
- left_adjust_char_head,
- is_allowed_reverse_match,
- 0
-};
-/*
- * Name: EUC-JP
- * MIBenum: 18
- * Link: http://www.iana.org/assignments/character-sets
- * Link: http://home.m05.itscom.net/numa/cde/sjis-euc/sjis-euc.html
- */
-ENC_ALIAS("eucJP", "EUC-JP") /* UI-OSF Application Platform Profile for Japanese Environment Version 1.1 */
-
-/*
- * Name: eucJP-ms
- * Link: http://home.m05.itscom.net/numa/cde/ucs-conv/ucs-conv.html
- * Link: http://www2d.biglobe.ne.jp/~msyk/charcode/cp932/eucJP-ms.html
- * Link: http://ja.wikipedia.org/wiki/EUC-JP
- */
-ENC_REPLICATE("eucJP-ms", "EUC-JP") /* TOG/JVC CDE/Motif Technical WG */
-ENC_ALIAS("euc-jp-ms", "eucJP-ms")
-
-/*
- * Name: CP51932
- * Link: http://search.cpan.org/src/NARUSE/Encode-EUCJPMS-0.07/ucm/cp51932.ucm
- * Link: http://legacy-encoding.sourceforge.jp/wiki/index.php?cp51932
- * Link: http://msyk.at.webry.info/200511/article_2.html
- */
-ENC_REPLICATE("CP51932", "EUC-JP")
diff --git a/enc/euc_kr.c b/enc/euc_kr.c
deleted file mode 100644
index f20a57e69a..0000000000
--- a/enc/euc_kr.c
+++ /dev/null
@@ -1,192 +0,0 @@
-/**********************************************************************
- euc_kr.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"
-
-static const int EncLen_EUCKR[] = {
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1
-};
-
-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, 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, 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 */ 1, 1, 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 */ 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, 1, 1, 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 */ 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, 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, A, A, F
- }
-};
-#undef A
-#undef F
-
-static int
-euckr_mbc_enc_len(const UChar* p, const UChar* e, OnigEncoding enc ARG_UNUSED)
-{
- int firstbyte = *p++;
- state_t s = trans[0][firstbyte];
-#define RETURN(n) \
- return s == ACCEPT ? ONIGENC_CONSTRUCT_MBCLEN_CHARFOUND(n) : \
- ONIGENC_CONSTRUCT_MBCLEN_INVALID()
- if (s < 0) RETURN(1);
- if (p == e) return ONIGENC_CONSTRUCT_MBCLEN_NEEDMORE(EncLen_EUCKR[firstbyte]-1);
- s = trans[s][*p++];
- RETURN(2);
-#undef RETURN
-}
-
-static OnigCodePoint
-euckr_mbc_to_code(const UChar* p, const UChar* end, OnigEncoding enc)
-{
- return onigenc_mbn_mbc_to_code(enc, p, end);
-}
-
-static int
-euckr_code_to_mbc(OnigCodePoint code, UChar *buf, OnigEncoding enc)
-{
- return onigenc_mb2_code_to_mbc(enc, code, buf);
-}
-
-static int
-euckr_mbc_case_fold(OnigCaseFoldType flag, const UChar** pp, const UChar* end,
- UChar* lower, OnigEncoding enc)
-{
- return onigenc_mbn_mbc_case_fold(enc, flag,
- pp, end, lower);
-}
-
-#if 0
-static int
-euckr_is_mbc_ambiguous(OnigCaseFoldType flag,
- const UChar** pp, const UChar* end, OnigEncoding enc)
-{
- return onigenc_mbn_is_mbc_ambiguous(enc, flag, pp, end);
-}
-#endif
-
-static int
-euckr_is_code_ctype(OnigCodePoint code, unsigned int ctype, OnigEncoding enc)
-{
- return onigenc_mb2_is_code_ctype(enc, code, ctype);
-}
-
-#define euckr_islead(c) ((c) < 0xa1 || (c) == 0xff)
-
-static UChar*
-euckr_left_adjust_char_head(const UChar* start, const UChar* s, const UChar* end, OnigEncoding enc)
-{
- /* Assumed in this encoding,
- mb-trail bytes don't mix with single bytes.
- */
- const UChar *p;
- int len;
-
- if (s <= start) return (UChar* )s;
- p = s;
-
- while (!euckr_islead(*p) && p > start) p--;
- len = enclen(enc, p, end);
- if (p + len > s) return (UChar* )p;
- p += len;
- return (UChar* )(p + ((s - p) & ~1));
-}
-
-static int
-euckr_is_allowed_reverse_match(const UChar* s, const UChar* end ARG_UNUSED, OnigEncoding enc ARG_UNUSED)
-{
- const UChar c = *s;
- if (c <= 0x7e) return TRUE;
- else return FALSE;
-}
-
-OnigEncodingDefine(euc_kr, EUC_KR) = {
- euckr_mbc_enc_len,
- "EUC-KR", /* 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
-};
-ENC_ALIAS("eucKR", "EUC-KR")
diff --git a/enc/euc_tw.c b/enc/euc_tw.c
deleted file mode 100644
index d025a0dd45..0000000000
--- a/enc/euc_tw.c
+++ /dev/null
@@ -1,234 +0,0 @@
-/**********************************************************************
- euc_tw.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"
-
-static const int EncLen_EUCTW[] = {
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1
-};
-
-typedef enum { FAILURE = -2, ACCEPT = -1, S0 = 0, S1, S2, S3 } 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, 2, F,
- /* 9 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
- /* a */ F, 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 */ 1, 1, 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 */ 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, 1, 1, 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 */ 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, 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, A, A, 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 */ F, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- /* b */ 3, 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
- },
- { /* 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 */ 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, 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 */ 1, 1, 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 */ 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, 1, 1, F
- }
-};
-#undef A
-#undef F
-
-static int
-euctw_mbc_enc_len(const UChar* p, const UChar* e, OnigEncoding enc ARG_UNUSED)
-{
- int firstbyte = *p++;
- state_t s = trans[0][firstbyte];
-#define RETURN(n) \
- return s == ACCEPT ? ONIGENC_CONSTRUCT_MBCLEN_CHARFOUND(n) : \
- ONIGENC_CONSTRUCT_MBCLEN_INVALID()
- if (s < 0) RETURN(1);
- if (p == e) return ONIGENC_CONSTRUCT_MBCLEN_NEEDMORE(EncLen_EUCTW[firstbyte]-1);
- s = trans[s][*p++];
- if (s < 0) RETURN(2);
- if (p == e) return ONIGENC_CONSTRUCT_MBCLEN_NEEDMORE(4-2);
- s = trans[s][*p++];
- if (s < 0) RETURN(3);
- if (p == e) return ONIGENC_CONSTRUCT_MBCLEN_NEEDMORE(4-3);
- s = trans[s][*p++];
- RETURN(4);
-#undef RETURN
-}
-
-static OnigCodePoint
-euctw_mbc_to_code(const UChar* p, const UChar* end, OnigEncoding enc ARG_UNUSED)
-{
- return onigenc_mbn_mbc_to_code(enc, p, end);
-}
-
-static int
-euctw_code_to_mbc(OnigCodePoint code, UChar *buf, OnigEncoding enc)
-{
- return onigenc_mb4_code_to_mbc(enc, code, buf);
-}
-
-static int
-euctw_mbc_case_fold(OnigCaseFoldType flag, const UChar** pp, const UChar* end,
- UChar* lower, OnigEncoding enc)
-{
- return onigenc_mbn_mbc_case_fold(enc, flag,
- pp, end, lower);
-}
-
-#if 0
-static int
-euctw_is_mbc_ambiguous(OnigCaseFoldType flag,
- const UChar** pp, const UChar* end, OnigEncoding enc)
-{
- return onigenc_mbn_is_mbc_ambiguous(enc, flag, pp, end);
-}
-#endif
-
-static int
-euctw_is_code_ctype(OnigCodePoint code, unsigned int ctype, OnigEncoding enc)
-{
- return onigenc_mb4_is_code_ctype(enc, code, ctype);
-}
-
-#define euctw_islead(c) ((UChar )((c) - 0xa1) > 0xfe - 0xa1)
-
-static UChar*
-euctw_left_adjust_char_head(const UChar* start, const UChar* s, const UChar* end, OnigEncoding enc)
-{
- /* Assumed in this encoding,
- mb-trail bytes don't mix with single bytes.
- */
- const UChar *p;
- int len;
-
- if (s <= start) return (UChar* )s;
- p = s;
-
- while (!euctw_islead(*p) && p > start) p--;
- len = enclen(enc, p, end);
- if (p + len > s) return (UChar* )p;
- p += len;
- return (UChar* )(p + ((s - p) & ~1));
-}
-
-static int
-euctw_is_allowed_reverse_match(const UChar* s, const UChar* end ARG_UNUSED, OnigEncoding enc ARG_UNUSED)
-{
- const UChar c = *s;
- if (c <= 0x7e) return TRUE;
- else return FALSE;
-}
-
-OnigEncodingDefine(euc_tw, EUC_TW) = {
- euctw_mbc_enc_len,
- "EUC-TW", /* name */
- 4, /* max enc length */
- 1, /* min enc length */
- onigenc_is_mbc_newline_0x0a,
- euctw_mbc_to_code,
- onigenc_mb4_code_to_mbclen,
- euctw_code_to_mbc,
- euctw_mbc_case_fold,
- onigenc_ascii_apply_all_case_fold,
- onigenc_ascii_get_case_fold_codes_by_str,
- onigenc_minimum_property_name_to_ctype,
- euctw_is_code_ctype,
- onigenc_not_support_get_ctype_code_range,
- euctw_left_adjust_char_head,
- euctw_is_allowed_reverse_match
-};
-ENC_ALIAS("eucTW", "EUC-TW")
diff --git a/enc/gb18030.c b/enc/gb18030.c
deleted file mode 100644
index 16c8c1c17f..0000000000
--- a/enc/gb18030.c
+++ /dev/null
@@ -1,596 +0,0 @@
-/**********************************************************************
- gb18030.c - Oniguruma (regular expression library)
-**********************************************************************/
-/*-
- * Copyright (c) 2005-2007 KUBO Takehiro <kubo AT jiubao DOT org>
- * 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"
-
-#if 1
-#define DEBUG_GB18030(arg)
-#else
-#define DEBUG_GB18030(arg) printf arg
-#endif
-
-enum {
- C1, /* one-byte char */
- C2, /* one-byte or second of two-byte char */
- C4, /* one-byte or second or fourth of four-byte char */
- CM /* first of two- or four-byte char or second of two-byte char */
-};
-
-static const char GB18030_MAP[] = {
- C1, C1, C1, C1, C1, C1, C1, C1, C1, C1, C1, C1, C1, C1, C1, C1,
- C1, C1, C1, C1, C1, C1, C1, C1, C1, C1, C1, C1, C1, C1, C1, C1,
- C1, C1, C1, C1, C1, C1, C1, C1, C1, C1, C1, C1, C1, C1, C1, C1,
- C4, C4, C4, C4, C4, C4, C4, C4, C4, C4, C1, C1, C1, C1, C1, C1,
- C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, C2,
- C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, C2,
- C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, C2,
- C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, C1,
- C2, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM,
- CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM,
- CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM,
- CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM,
- CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM,
- CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM,
- CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM,
- CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, C1
-};
-
-typedef enum { FAILURE = -2, ACCEPT = -1, S0 = 0, S1, S2, S3 } 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 */ 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 */ 1, 1, 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 */ 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, 1, 1, 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 */ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, A, A, 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, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- /* 9 */ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- /* a */ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- /* b */ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- /* c */ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- /* d */ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- /* e */ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- /* f */ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 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 */ A, A, A, A, A, A, A, A, A, A, 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, 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
-gb18030_mbc_enc_len(const UChar* p, const UChar* e, OnigEncoding enc ARG_UNUSED)
-{
- int firstbyte = *p++;
- state_t s = trans[0][firstbyte];
-#define RETURN(n) \
- return s == ACCEPT ? ONIGENC_CONSTRUCT_MBCLEN_CHARFOUND(n) : \
- ONIGENC_CONSTRUCT_MBCLEN_INVALID()
- if (s < 0) RETURN(1);
- if (p == e) return ONIGENC_CONSTRUCT_MBCLEN_NEEDMORE(2-1);
- s = trans[s][*p++];
- if (s < 0) RETURN(2);
- if (p == e) return ONIGENC_CONSTRUCT_MBCLEN_NEEDMORE(4-2);
- s = trans[s][*p++];
- if (s < 0) RETURN(3);
- if (p == e) return ONIGENC_CONSTRUCT_MBCLEN_NEEDMORE(4-3);
- s = trans[s][*p++];
- RETURN(4);
-#undef RETURN
-}
-
-static OnigCodePoint
-gb18030_mbc_to_code(const UChar* p, const UChar* end, OnigEncoding enc)
-{
- int c, i, len;
- OnigCodePoint n;
-
- len = enclen(enc, p, end);
- n = (OnigCodePoint )(*p++);
- 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
-gb18030_code_to_mbc(OnigCodePoint code, UChar *buf, OnigEncoding enc)
-{
- return onigenc_mb4_code_to_mbc(enc, code, buf);
-}
-
-static int
-gb18030_mbc_case_fold(OnigCaseFoldType flag, const UChar** pp, const UChar* end,
- UChar* lower, OnigEncoding enc)
-{
- return onigenc_mbn_mbc_case_fold(enc, flag,
- pp, end, lower);
-}
-
-#if 0
-static int
-gb18030_is_mbc_ambiguous(OnigCaseFoldType flag,
- const UChar** pp, const UChar* end, OnigEncoding enc)
-{
- return onigenc_mbn_is_mbc_ambiguous(enc, flag, pp, end);
-}
-#endif
-
-static int
-gb18030_is_code_ctype(OnigCodePoint code, unsigned int ctype, OnigEncoding enc)
-{
- return onigenc_mb4_is_code_ctype(enc, code, ctype);
-}
-
-enum state {
- S_START,
- S_one_C2,
- S_one_C4,
- S_one_CM,
-
- S_odd_CM_one_CX,
- S_even_CM_one_CX,
-
- /* CMC4 : pair of "CM C4" */
- S_one_CMC4,
- S_odd_CMC4,
- S_one_C4_odd_CMC4,
- S_even_CMC4,
- S_one_C4_even_CMC4,
-
- S_odd_CM_odd_CMC4,
- S_even_CM_odd_CMC4,
-
- S_odd_CM_even_CMC4,
- S_even_CM_even_CMC4,
-
- /* C4CM : pair of "C4 CM" */
- S_odd_C4CM,
- S_one_CM_odd_C4CM,
- S_even_C4CM,
- S_one_CM_even_C4CM,
-
- S_even_CM_odd_C4CM,
- S_odd_CM_odd_C4CM,
- S_even_CM_even_C4CM,
- S_odd_CM_even_C4CM
-};
-
-static UChar*
-gb18030_left_adjust_char_head(const UChar* start, const UChar* s, const UChar* end, OnigEncoding enc)
-{
- const UChar *p;
- enum state state = S_START;
-
- DEBUG_GB18030(("----------------\n"));
- for (p = s; p >= start; p--) {
- DEBUG_GB18030(("state %d --(%02x)-->\n", state, *p));
- switch (state) {
- case S_START:
- switch (GB18030_MAP[*p]) {
- case C1:
- return (UChar *)s;
- case C2:
- state = S_one_C2; /* C2 */
- break;
- case C4:
- state = S_one_C4; /* C4 */
- break;
- case CM:
- state = S_one_CM; /* CM */
- break;
- }
- break;
- case S_one_C2: /* C2 */
- switch (GB18030_MAP[*p]) {
- case C1:
- case C2:
- case C4:
- return (UChar *)s;
- case CM:
- state = S_odd_CM_one_CX; /* CM C2 */
- break;
- }
- break;
- case S_one_C4: /* C4 */
- switch (GB18030_MAP[*p]) {
- case C1:
- case C2:
- case C4:
- return (UChar *)s;
- case CM:
- state = S_one_CMC4;
- break;
- }
- break;
- case S_one_CM: /* CM */
- switch (GB18030_MAP[*p]) {
- case C1:
- case C2:
- return (UChar *)s;
- case C4:
- state = S_odd_C4CM;
- break;
- case CM:
- state = S_odd_CM_one_CX; /* CM CM */
- break;
- }
- break;
-
- case S_odd_CM_one_CX: /* CM C2 */ /* CM CM */ /* CM CM CM C4 */
- switch (GB18030_MAP[*p]) {
- case C1:
- case C2:
- case C4:
- return (UChar *)(s - 1);
- case CM:
- state = S_even_CM_one_CX;
- break;
- }
- break;
- case S_even_CM_one_CX: /* CM CM C2 */ /* CM CM CM */ /* CM CM C4 */
- switch (GB18030_MAP[*p]) {
- case C1:
- case C2:
- case C4:
- return (UChar *)s;
- case CM:
- state = S_odd_CM_one_CX;
- break;
- }
- break;
-
- case S_one_CMC4: /* CM C4 */
- switch (GB18030_MAP[*p]) {
- case C1:
- case C2:
- return (UChar *)(s - 1);
- case C4:
- state = S_one_C4_odd_CMC4; /* C4 CM C4 */
- break;
- case CM:
- state = S_even_CM_one_CX; /* CM CM C4 */
- break;
- }
- break;
- case S_odd_CMC4: /* CM C4 CM C4 CM C4 */
- switch (GB18030_MAP[*p]) {
- case C1:
- case C2:
- return (UChar *)(s - 1);
- case C4:
- state = S_one_C4_odd_CMC4;
- break;
- case CM:
- state = S_odd_CM_odd_CMC4;
- break;
- }
- break;
- case S_one_C4_odd_CMC4: /* C4 CM C4 */
- switch (GB18030_MAP[*p]) {
- case C1:
- case C2:
- case C4:
- return (UChar *)(s - 1);
- case CM:
- state = S_even_CMC4; /* CM C4 CM C4 */
- break;
- }
- break;
- case S_even_CMC4: /* CM C4 CM C4 */
- switch (GB18030_MAP[*p]) {
- case C1:
- case C2:
- return (UChar *)(s - 3);
- case C4:
- state = S_one_C4_even_CMC4;
- break;
- case CM:
- state = S_odd_CM_even_CMC4;
- break;
- }
- break;
- case S_one_C4_even_CMC4: /* C4 CM C4 CM C4 */
- switch (GB18030_MAP[*p]) {
- case C1:
- case C2:
- case C4:
- return (UChar *)(s - 3);
- case CM:
- state = S_odd_CMC4;
- break;
- }
- break;
-
- case S_odd_CM_odd_CMC4: /* CM CM C4 CM C4 CM C4 */
- switch (GB18030_MAP[*p]) {
- case C1:
- case C2:
- case C4:
- return (UChar *)(s - 3);
- case CM:
- state = S_even_CM_odd_CMC4;
- break;
- }
- break;
- case S_even_CM_odd_CMC4: /* CM CM CM C4 CM C4 CM C4 */
- switch (GB18030_MAP[*p]) {
- case C1:
- case C2:
- case C4:
- return (UChar *)(s - 1);
- case CM:
- state = S_odd_CM_odd_CMC4;
- break;
- }
- break;
-
- case S_odd_CM_even_CMC4: /* CM CM C4 CM C4 */
- switch (GB18030_MAP[*p]) {
- case C1:
- case C2:
- case C4:
- return (UChar *)(s - 1);
- case CM:
- state = S_even_CM_even_CMC4;
- break;
- }
- break;
- case S_even_CM_even_CMC4: /* CM CM CM C4 CM C4 */
- switch (GB18030_MAP[*p]) {
- case C1:
- case C2:
- case C4:
- return (UChar *)(s - 3);
- case CM:
- state = S_odd_CM_even_CMC4;
- break;
- }
- break;
-
- case S_odd_C4CM: /* C4 CM */ /* C4 CM C4 CM C4 CM*/
- switch (GB18030_MAP[*p]) {
- case C1:
- case C2:
- case C4:
- return (UChar *)s;
- case CM:
- state = S_one_CM_odd_C4CM; /* CM C4 CM */
- break;
- }
- break;
- case S_one_CM_odd_C4CM: /* CM C4 CM */ /* CM C4 CM C4 CM C4 CM */
- switch (GB18030_MAP[*p]) {
- case C1:
- case C2:
- return (UChar *)(s - 2); /* |CM C4 CM */
- case C4:
- state = S_even_C4CM;
- break;
- case CM:
- state = S_even_CM_odd_C4CM;
- break;
- }
- break;
- case S_even_C4CM: /* C4 CM C4 CM */
- switch (GB18030_MAP[*p]) {
- case C1:
- case C2:
- case C4:
- return (UChar *)(s - 2); /* C4|CM C4 CM */
- case CM:
- state = S_one_CM_even_C4CM;
- break;
- }
- break;
- case S_one_CM_even_C4CM: /* CM C4 CM C4 CM */
- switch (GB18030_MAP[*p]) {
- case C1:
- case C2:
- return (UChar *)(s - 0); /*|CM C4 CM C4|CM */
- case C4:
- state = S_odd_C4CM;
- break;
- case CM:
- state = S_even_CM_even_C4CM;
- break;
- }
- break;
-
- case S_even_CM_odd_C4CM: /* CM CM C4 CM */
- switch (GB18030_MAP[*p]) {
- case C1:
- case C2:
- case C4:
- return (UChar *)(s - 0); /* |CM CM|C4|CM */
- case CM:
- state = S_odd_CM_odd_C4CM;
- break;
- }
- break;
- case S_odd_CM_odd_C4CM: /* CM CM CM C4 CM */
- switch (GB18030_MAP[*p]) {
- case C1:
- case C2:
- case C4:
- return (UChar *)(s - 2); /* |CM CM|CM C4 CM */
- case CM:
- state = S_even_CM_odd_C4CM;
- break;
- }
- break;
-
- case S_even_CM_even_C4CM: /* CM CM C4 CM C4 CM */
- switch (GB18030_MAP[*p]) {
- case C1:
- case C2:
- case C4:
- return (UChar *)(s - 2); /* |CM CM|C4|CM C4 CM */
- case CM:
- state = S_odd_CM_even_C4CM;
- break;
- }
- break;
- case S_odd_CM_even_C4CM: /* CM CM CM C4 CM C4 CM */
- switch (GB18030_MAP[*p]) {
- case C1:
- case C2:
- case C4:
- return (UChar *)(s - 0); /* |CM CM|CM C4 CM C4|CM */
- case CM:
- state = S_even_CM_even_C4CM;
- break;
- }
- break;
- }
- }
-
- DEBUG_GB18030(("state %d\n", state));
- switch (state) {
- case S_START: return (UChar *)(s - 0);
- case S_one_C2: return (UChar *)(s - 0);
- case S_one_C4: return (UChar *)(s - 0);
- case S_one_CM: return (UChar *)(s - 0);
-
- case S_odd_CM_one_CX: return (UChar *)(s - 1);
- case S_even_CM_one_CX: return (UChar *)(s - 0);
-
- case S_one_CMC4: return (UChar *)(s - 1);
- case S_odd_CMC4: return (UChar *)(s - 1);
- case S_one_C4_odd_CMC4: return (UChar *)(s - 1);
- case S_even_CMC4: return (UChar *)(s - 3);
- case S_one_C4_even_CMC4: return (UChar *)(s - 3);
-
- case S_odd_CM_odd_CMC4: return (UChar *)(s - 3);
- case S_even_CM_odd_CMC4: return (UChar *)(s - 1);
-
- case S_odd_CM_even_CMC4: return (UChar *)(s - 1);
- case S_even_CM_even_CMC4: return (UChar *)(s - 3);
-
- case S_odd_C4CM: return (UChar *)(s - 0);
- case S_one_CM_odd_C4CM: return (UChar *)(s - 2);
- case S_even_C4CM: return (UChar *)(s - 2);
- case S_one_CM_even_C4CM: return (UChar *)(s - 0);
-
- case S_even_CM_odd_C4CM: return (UChar *)(s - 0);
- case S_odd_CM_odd_C4CM: return (UChar *)(s - 2);
- case S_even_CM_even_C4CM: return (UChar *)(s - 2);
- case S_odd_CM_even_C4CM: return (UChar *)(s - 0);
- }
-
- return (UChar* )s; /* never come here. (escape warning) */
-}
-
-static int
-gb18030_is_allowed_reverse_match(const UChar* s, const UChar* end ARG_UNUSED, OnigEncoding enc ARG_UNUSED)
-{
- return GB18030_MAP[*s] == C1 ? TRUE : FALSE;
-}
-
-OnigEncodingDefine(gb18030, GB18030) = {
- gb18030_mbc_enc_len,
- "GB18030", /* name */
- 4, /* max enc length */
- 1, /* min enc length */
- onigenc_is_mbc_newline_0x0a,
- gb18030_mbc_to_code,
- onigenc_mb4_code_to_mbclen,
- gb18030_code_to_mbc,
- gb18030_mbc_case_fold,
- onigenc_ascii_apply_all_case_fold,
- onigenc_ascii_get_case_fold_codes_by_str,
- onigenc_minimum_property_name_to_ctype,
- gb18030_is_code_ctype,
- onigenc_not_support_get_ctype_code_range,
- gb18030_left_adjust_char_head,
- gb18030_is_allowed_reverse_match
-};
-
diff --git a/enc/gb2312.c b/enc/gb2312.c
deleted file mode 100644
index 6fc15735fc..0000000000
--- a/enc/gb2312.c
+++ /dev/null
@@ -1,13 +0,0 @@
-#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_ALIAS("EUC-CN", "GB2312")
-ENC_ALIAS("eucCN", "GB2312")
-ENC_REPLICATE("GB12345", "GB2312")
diff --git a/enc/gbk.c b/enc/gbk.c
deleted file mode 100644
index 3efb1bf636..0000000000
--- a/enc/gbk.c
+++ /dev/null
@@ -1,222 +0,0 @@
-/**********************************************************************
- gbk.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"
-
-static const int EncLen_GBK[] = {
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1
-};
-
-static const char GBK_CAN_BE_TRAIL_TABLE[256] = {
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0
-};
-
-#define GBK_ISMB_FIRST(byte) (EncLen_GBK[byte] > 1)
-#define GBK_ISMB_TRAIL(byte) GBK_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 */ A, 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 */ 1, 1, 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 */ 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, 1, 1, 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, A, A, F
- }
-};
-#undef A
-#undef F
-
-static int
-gbk_mbc_enc_len(const UChar* p, const UChar* e, OnigEncoding enc ARG_UNUSED)
-{
- int firstbyte = *p++;
- state_t s = trans[0][firstbyte];
-#define RETURN(n) \
- return s == ACCEPT ? ONIGENC_CONSTRUCT_MBCLEN_CHARFOUND(n) : \
- ONIGENC_CONSTRUCT_MBCLEN_INVALID()
- if (s < 0) RETURN(1);
- if (p == e) return ONIGENC_CONSTRUCT_MBCLEN_NEEDMORE(EncLen_GBK[firstbyte]-1);
- s = trans[s][*p++];
- RETURN(2);
-#undef RETURN
-}
-
-static OnigCodePoint
-gbk_mbc_to_code(const UChar* p, const UChar* end, OnigEncoding enc)
-{
- return onigenc_mbn_mbc_to_code(enc, p, end);
-}
-
-static int
-gbk_code_to_mbc(OnigCodePoint code, UChar *buf, OnigEncoding enc)
-{
- return onigenc_mb2_code_to_mbc(enc, code, buf);
-}
-
-static int
-gbk_mbc_case_fold(OnigCaseFoldType flag, const UChar** pp, const UChar* end,
- UChar* lower, OnigEncoding enc)
-{
- return onigenc_mbn_mbc_case_fold(enc, flag,
- pp, end, lower);
-}
-
-#if 0
-static int
-gbk_is_mbc_ambiguous(OnigCaseFoldType flag,
- const UChar** pp, const UChar* end, OnigEncoding enc)
-{
- return onigenc_mbn_is_mbc_ambiguous(enc, flag, pp, end);
-}
-#endif
-
-static int
-gbk_is_code_ctype(OnigCodePoint code, unsigned int ctype, OnigEncoding enc)
-{
- return onigenc_mb2_is_code_ctype(enc, code, ctype);
-}
-
-static UChar*
-gbk_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 (GBK_ISMB_TRAIL(*p)) {
- while (p > start) {
- if (! GBK_ISMB_FIRST(*--p)) {
- p++;
- break;
- }
- }
- }
- len = enclen(enc, p, end);
- if (p + len > s) return (UChar* )p;
- p += len;
- return (UChar* )(p + ((s - p) & ~1));
-}
-
-static int
-gbk_is_allowed_reverse_match(const UChar* s, const UChar* end ARG_UNUSED, OnigEncoding enc ARG_UNUSED)
-{
- const UChar c = *s;
- return (GBK_ISMB_TRAIL(c) ? FALSE : TRUE);
-}
-
-OnigEncodingDefine(gbk, GBK) = {
- gbk_mbc_enc_len,
- "GBK", /* name */
- 2, /* max enc length */
- 1, /* min enc length */
- onigenc_is_mbc_newline_0x0a,
- gbk_mbc_to_code,
- onigenc_mb2_code_to_mbclen,
- gbk_code_to_mbc,
- gbk_mbc_case_fold,
- onigenc_ascii_apply_all_case_fold,
- onigenc_ascii_get_case_fold_codes_by_str,
- onigenc_minimum_property_name_to_ctype,
- gbk_is_code_ctype,
- onigenc_not_support_get_ctype_code_range,
- gbk_left_adjust_char_head,
- gbk_is_allowed_reverse_match
-};
-/*
- * Name: GBK
- * MIBenum: 113
- * Link: http://www.iana.org/assignments/character-sets
- * Link: http://www.iana.org/assignments/charset-reg/GBK
- * Link: http://www.microsoft.com/globaldev/reference/dbcs/936.mspx
- */
-ENC_ALIAS("CP936", "GBK")
diff --git a/enc/iso_2022_jp.h b/enc/iso_2022_jp.h
deleted file mode 100644
index 8ba272bfa2..0000000000
--- a/enc/iso_2022_jp.h
+++ /dev/null
@@ -1,24 +0,0 @@
-#include "regenc.h"
-/* 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");
-ENC_ALIAS("ISO2022-JP2", "ISO-2022-JP-2");
-
-/* Windows Codepage 50221
- * a ISO-2022-JP variant.
- * This includes
- * * US-ASCII
- * * JIS X 0201 Katakana
- * * JIS X 0208
- * * NEC special characters
- * * NEC selected IBM extended characters
- * and this implementation doesn't include
- * * JIS X 0201 Latin
- * * User Defined Characters
- *
- * So this CP50221 has the same characters of CP51932.
- *
- * See http://legacy-encoding.sourceforge.jp/wiki/index.php?cp50221
- */
-ENC_REPLICATE("CP50221", "ISO-2022-JP");
diff --git a/enc/iso_8859_1.c b/enc/iso_8859_1.c
deleted file mode 100644
index b73f8ca379..0000000000
--- a/enc/iso_8859_1.c
+++ /dev/null
@@ -1,285 +0,0 @@
-/**********************************************************************
- iso8859_1.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"
-
-#define ENC_IS_ISO_8859_1_CTYPE(code,ctype) \
- ((EncISO_8859_1_CtypeTable[code] & CTYPE_TO_BIT(ctype)) != 0)
-
-static const unsigned short EncISO_8859_1_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, 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 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(
- sizeof(CaseFoldMap)/sizeof(OnigPairCaseFoldCodes), 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)
-{
- if (0x41 <= *p && *p <= 0x5a) {
- items[0].byte_len = 1;
- items[0].code_len = 1;
- items[0].code[0] = (OnigCodePoint )(*p + 0x20);
- if (*p == 0x53 && end > p + 1
- && (*(p+1) == 0x53 || *(p+1) == 0x73)) { /* SS */
- items[1].byte_len = 2;
- items[1].code_len = 1;
- items[1].code[0] = (OnigCodePoint )0xdf;
- return 2;
- }
- else
- return 1;
- }
- else if (0x61 <= *p && *p <= 0x7a) {
- items[0].byte_len = 1;
- items[0].code_len = 1;
- items[0].code[0] = (OnigCodePoint )(*p - 0x20);
- if (*p == 0x73 && end > p + 1
- && (*(p+1) == 0x73 || *(p+1) == 0x53)) { /* ss */
- items[1].byte_len = 2;
- items[1].code_len = 1;
- items[1].code[0] = (OnigCodePoint )0xdf;
- return 2;
- }
- else
- return 1;
- }
- else if (0xc0 <= *p && *p <= 0xcf) {
- items[0].byte_len = 1;
- items[0].code_len = 1;
- items[0].code[0] = (OnigCodePoint )(*p + 0x20);
- return 1;
- }
- else if (0xd0 <= *p && *p <= 0xdf) {
- if (*p == 0xdf) {
- items[0].byte_len = 1;
- items[0].code_len = 2;
- items[0].code[0] = (OnigCodePoint )'s';
- items[0].code[1] = (OnigCodePoint )'s';
-
- items[1].byte_len = 1;
- items[1].code_len = 2;
- items[1].code[0] = (OnigCodePoint )'S';
- items[1].code[1] = (OnigCodePoint )'S';
-
- items[2].byte_len = 1;
- items[2].code_len = 2;
- items[2].code[0] = (OnigCodePoint )'s';
- items[2].code[1] = (OnigCodePoint )'S';
-
- items[3].byte_len = 1;
- items[3].code_len = 2;
- items[3].code[0] = (OnigCodePoint )'S';
- items[3].code[1] = (OnigCodePoint )'s';
-
- return 4;
- }
- else if (*p != 0xd7) {
- items[0].byte_len = 1;
- items[0].code_len = 1;
- items[0].code[0] = (OnigCodePoint )(*p + 0x20);
- return 1;
- }
- }
- else if (0xe0 <= *p && *p <= 0xef) {
- items[0].byte_len = 1;
- items[0].code_len = 1;
- items[0].code[0] = (OnigCodePoint )(*p - 0x20);
- return 1;
- }
- else if (0xf0 <= *p && *p <= 0xfe) {
- if (*p != 0xf7) {
- items[0].byte_len = 1;
- items[0].code_len = 1;
- items[0].code[0] = (OnigCodePoint )(*p - 0x20);
- return 1;
- }
- }
-
- return 0;
-}
-
-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 == 0xdf && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {
- *lower++ = 's';
- *lower = 's';
- (*pp)++;
- return 2;
- }
-
- *lower = ONIGENC_ISO_8859_1_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 == 0xdf && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {
- (*pp)++;
- return TRUE;
- }
-
- (*pp)++;
- v = (EncISO_8859_1_CtypeTable[*p] & (BIT_CTYPE_UPPER | BIT_CTYPE_LOWER));
- if ((v | BIT_CTYPE_LOWER) != 0) {
- /* 0xdf, 0xaa, 0xb5, 0xba 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_ISO_8859_1_CTYPE(code, ctype);
- else
- return FALSE;
-}
-
-OnigEncodingDefine(iso_8859_1, ISO_8859_1) = {
- onigenc_single_byte_mbc_enc_len,
- "ISO-8859-1", /* 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
-};
-ENC_ALIAS("ISO8859-1", "ISO-8859-1")
-
-/*
- * Name: windows-1252
- * MIBenum: 2252
- * Link: http://www.iana.org/assignments/character-sets
- * Link: http://www.microsoft.com/globaldev/reference/sbcs/1252.mspx
- * Link: http://en.wikipedia.org/wiki/Windows-1252
- */
-ENC_REPLICATE("Windows-1252", "ISO-8859-1")
-ENC_ALIAS("CP1252", "Windows-1252")
diff --git a/enc/iso_8859_10.c b/enc/iso_8859_10.c
deleted file mode 100644
index 1643278dfd..0000000000
--- a/enc/iso_8859_10.c
+++ /dev/null
@@ -1,244 +0,0 @@
-/**********************************************************************
- iso8859_10.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"
-
-#define ENC_ISO_8859_10_TO_LOWER_CASE(c) EncISO_8859_10_ToLowerCaseTable[c]
-#define ENC_IS_ISO_8859_10_CTYPE(code,ctype) \
- ((EncISO_8859_10_CtypeTable[code] & CTYPE_TO_BIT(ctype)) != 0)
-
-static const UChar EncISO_8859_10_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', '\261', '\262', '\263', '\264', '\265', '\266', '\247',
- '\270', '\271', '\272', '\273', '\274', '\255', '\276', '\277',
- '\260', '\261', '\262', '\263', '\264', '\265', '\266', '\267',
- '\270', '\271', '\272', '\273', '\274', '\275', '\276', '\277',
- '\340', '\341', '\342', '\343', '\344', '\345', '\346', '\347',
- '\350', '\351', '\352', '\353', '\354', '\355', '\356', '\357',
- '\360', '\361', '\362', '\363', '\364', '\365', '\366', '\367',
- '\370', '\371', '\372', '\373', '\374', '\375', '\376', '\337',
- '\340', '\341', '\342', '\343', '\344', '\345', '\346', '\347',
- '\350', '\351', '\352', '\353', '\354', '\355', '\356', '\357',
- '\360', '\361', '\362', '\363', '\364', '\365', '\366', '\367',
- '\370', '\371', '\372', '\373', '\374', '\375', '\376', '\377'
-};
-
-static const unsigned short EncISO_8859_10_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, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x00a0,
- 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x01a0, 0x34a2, 0x34a2,
- 0x00a0, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x01a0,
- 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x01a0, 0x30e2, 0x30e2,
- 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2,
- 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2,
- 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 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
-};
-
-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 == 0xdf && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {
- *lower++ = 's';
- *lower = 's';
- (*pp)++;
- return 2;
- }
-
- *lower = ENC_ISO_8859_10_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 == 0xdf && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {
- (*pp)++;
- return TRUE;
- }
-
- (*pp)++;
- v = (EncISO_8859_10_CtypeTable[*p] & (BIT_CTYPE_UPPER | BIT_CTYPE_LOWER));
- if ((v | BIT_CTYPE_LOWER) != 0) {
- 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_ISO_8859_10_CTYPE(code, ctype);
- else
- return FALSE;
-}
-
-static const OnigPairCaseFoldCodes CaseFoldMap[] = {
- { 0xa1, 0xb1 },
- { 0xa2, 0xb2 },
- { 0xa3, 0xb3 },
- { 0xa4, 0xb4 },
- { 0xa5, 0xb5 },
- { 0xa6, 0xb6 },
- { 0xa8, 0xb8 },
- { 0xa9, 0xb9 },
- { 0xaa, 0xba },
- { 0xab, 0xbb },
- { 0xac, 0xbc },
- { 0xae, 0xbe },
- { 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 },
- { 0xd7, 0xf7 },
- { 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(
- sizeof(CaseFoldMap)/sizeof(OnigPairCaseFoldCodes), 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(
- sizeof(CaseFoldMap)/sizeof(OnigPairCaseFoldCodes), CaseFoldMap, 1,
- flag, p, end, items);
-}
-
-OnigEncodingDefine(iso_8859_10, ISO_8859_10) = {
- onigenc_single_byte_mbc_enc_len,
- "ISO-8859-10", /* 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
-};
-ENC_ALIAS("ISO8859-10", "ISO-8859-10")
diff --git a/enc/iso_8859_11.c b/enc/iso_8859_11.c
deleted file mode 100644
index 257d9d8919..0000000000
--- a/enc/iso_8859_11.c
+++ /dev/null
@@ -1,111 +0,0 @@
-/**********************************************************************
- iso8859_11.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"
-
-#define ENC_IS_ISO_8859_11_CTYPE(code,ctype) \
- ((EncISO_8859_11_CtypeTable[code] & CTYPE_TO_BIT(ctype)) != 0)
-
-static const unsigned short EncISO_8859_11_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, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2,
- 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2,
- 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2,
- 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2,
- 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2,
- 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2,
- 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2,
- 0x30a2, 0x30a2, 0x30a2, 0x0000, 0x0000, 0x0000, 0x0000, 0x30a2,
- 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2,
- 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2,
- 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2,
- 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x0000, 0x0000, 0x0000, 0x0000
-};
-
-static int
-is_code_ctype(OnigCodePoint code, unsigned int ctype, OnigEncoding enc ARG_UNUSED)
-{
- if (code < 256)
- return ENC_IS_ISO_8859_11_CTYPE(code, ctype);
- else
- return FALSE;
-}
-
-OnigEncodingDefine(iso_8859_11, ISO_8859_11) = {
- onigenc_single_byte_mbc_enc_len,
- "ISO-8859-11", /* 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,
- onigenc_ascii_mbc_case_fold,
- onigenc_ascii_apply_all_case_fold,
- onigenc_ascii_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
-};
-ENC_ALIAS("ISO8859-11", "ISO-8859-11")
-
-/*
- * Name: TIS-620
- * MIBenum: 2259
- * Link: http://en.wikipedia.org/wiki/Thai_Industrial_Standard_620-2533
- */
-ENC_REPLICATE("TIS-620", "ISO-8859-11")
-
-/*
- * Name: Windows-874
- * Link: http://www.microsoft.com/globaldev/reference/sbcs/874.mspx
- */
-ENC_REPLICATE("Windows-874", "ISO-8859-11")
-ENC_ALIAS("CP874", "Windows-874")
diff --git a/enc/iso_8859_13.c b/enc/iso_8859_13.c
deleted file mode 100644
index f29cb2e281..0000000000
--- a/enc/iso_8859_13.c
+++ /dev/null
@@ -1,243 +0,0 @@
-/**********************************************************************
- iso8859_13.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"
-
-#define ENC_ISO_8859_13_TO_LOWER_CASE(c) EncISO_8859_13_ToLowerCaseTable[c]
-#define ENC_IS_ISO_8859_13_CTYPE(code,ctype) \
- ((EncISO_8859_13_CtypeTable[code] & CTYPE_TO_BIT(ctype)) != 0)
-
-static const UChar EncISO_8859_13_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 EncISO_8859_13_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 == 0xdf && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {
- *lower++ = 's';
- *lower = 's';
- (*pp)++;
- return 2;
- }
-
- *lower = ENC_ISO_8859_13_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 == 0xdf && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {
- (*pp)++;
- return TRUE;
- }
-
- (*pp)++;
- v = (EncISO_8859_13_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_ISO_8859_13_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(
- sizeof(CaseFoldMap)/sizeof(OnigPairCaseFoldCodes), 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(
- sizeof(CaseFoldMap)/sizeof(OnigPairCaseFoldCodes), CaseFoldMap, 1,
- flag, p, end, items);
-}
-
-OnigEncodingDefine(iso_8859_13, ISO_8859_13) = {
- onigenc_single_byte_mbc_enc_len,
- "ISO-8859-13", /* 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
-};
-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
deleted file mode 100644
index be83f93f80..0000000000
--- a/enc/iso_8859_14.c
+++ /dev/null
@@ -1,246 +0,0 @@
-/**********************************************************************
- iso8859_14.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"
-
-#define ENC_ISO_8859_14_TO_LOWER_CASE(c) EncISO_8859_14_ToLowerCaseTable[c]
-#define ENC_IS_ISO_8859_14_CTYPE(code,ctype) \
- ((EncISO_8859_14_CtypeTable[code] & CTYPE_TO_BIT(ctype)) != 0)
-
-static const UChar EncISO_8859_14_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', '\242', '\242', '\243', '\245', '\245', '\253', '\247',
- '\270', '\251', '\272', '\253', '\274', '\255', '\256', '\377',
- '\261', '\261', '\263', '\263', '\265', '\265', '\266', '\271',
- '\270', '\271', '\272', '\277', '\274', '\276', '\276', '\277',
- '\340', '\341', '\342', '\343', '\344', '\345', '\346', '\347',
- '\350', '\351', '\352', '\353', '\354', '\355', '\356', '\357',
- '\360', '\361', '\362', '\363', '\364', '\365', '\366', '\367',
- '\370', '\371', '\372', '\373', '\374', '\375', '\376', '\337',
- '\340', '\341', '\342', '\343', '\344', '\345', '\346', '\347',
- '\350', '\351', '\352', '\353', '\354', '\355', '\356', '\357',
- '\360', '\361', '\362', '\363', '\364', '\365', '\366', '\367',
- '\370', '\371', '\372', '\373', '\374', '\375', '\376', '\377'
-};
-
-static const unsigned short EncISO_8859_14_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, 0x34a2, 0x30e2, 0x00a0, 0x34a2, 0x30e2, 0x34a2, 0x00a0,
- 0x34a2, 0x00a0, 0x34a2, 0x30e2, 0x34a2, 0x01a0, 0x00a0, 0x34a2,
- 0x34a2, 0x30e2, 0x34a2, 0x30e2, 0x34a2, 0x30e2, 0x00a0, 0x34a2,
- 0x30e2, 0x30e2, 0x30e2, 0x34a2, 0x30e2, 0x34a2, 0x30e2, 0x30e2,
- 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2,
- 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2,
- 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 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
-};
-
-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 == 0xdf && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {
- *lower++ = 's';
- *lower = 's';
- (*pp)++;
- return 2;
- }
-
- *lower = ENC_ISO_8859_14_TO_LOWER_CASE(*p);
- (*pp)++;
- return 1; /* return byte length of converted char to lower */
-}
-
-#if 0
-static int
-is_mbc_ambiguous(OnigCaseFoldType flag,
- const UChar** pp, const UChar* end)
-{
- int v;
- const UChar* p = *pp;
-
- if (*p == 0xdf && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {
- (*pp)++;
- return TRUE;
- }
-
- (*pp)++;
- v = (EncISO_8859_14_CtypeTable[*p] & (BIT_CTYPE_UPPER | BIT_CTYPE_LOWER));
- if ((v | BIT_CTYPE_LOWER) != 0) {
- 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_ISO_8859_14_CTYPE(code, ctype);
- else
- return FALSE;
-}
-
-static const OnigPairCaseFoldCodes CaseFoldMap[] = {
- { 0xa1, 0xa2 },
- { 0xa4, 0xa5 },
- { 0xa6, 0xab },
- { 0xa8, 0xb8 },
- { 0xaa, 0xba },
- { 0xac, 0xbc },
- { 0xaf, 0xff },
-
- { 0xb0, 0xb1 },
- { 0xb2, 0xb3 },
- { 0xb4, 0xb5 },
- { 0xb7, 0xb9 },
- { 0xbb, 0xbf },
- { 0xbd, 0xbe },
-
- { 0xc0, 0xe0 },
- { 0xc1, 0xe1 },
- { 0xc2, 0xe2 },
- { 0xc3, 0xe3 },
- { 0xc4, 0xe4 },
- { 0xc5, 0xe5 },
- { 0xc6, 0xe6 },
- { 0xc7, 0xe7 },
- { 0xc8, 0xe8 },
- { 0xc9, 0xe9 },
- { 0xca, 0xea },
- { 0xcb, 0xeb },
- { 0xcc, 0xec },
- { 0xcd, 0xed },
- { 0xce, 0xee },
- { 0xcf, 0xef },
-
- { 0xd0, 0xf0 },
- { 0xd1, 0xf1 },
- { 0xd2, 0xf2 },
- { 0xd3, 0xf3 },
- { 0xd4, 0xf4 },
- { 0xd5, 0xf5 },
- { 0xd6, 0xf6 },
- { 0xd7, 0xf7 },
- { 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(
- sizeof(CaseFoldMap)/sizeof(OnigPairCaseFoldCodes), 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(
- sizeof(CaseFoldMap)/sizeof(OnigPairCaseFoldCodes), CaseFoldMap, 1,
- flag, p, end, items);
-}
-
-OnigEncodingDefine(iso_8859_14, ISO_8859_14) = {
- onigenc_single_byte_mbc_enc_len,
- "ISO-8859-14", /* 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
-};
-ENC_ALIAS("ISO8859-14", "ISO-8859-14")
diff --git a/enc/iso_8859_15.c b/enc/iso_8859_15.c
deleted file mode 100644
index 2ec41b66c0..0000000000
--- a/enc/iso_8859_15.c
+++ /dev/null
@@ -1,240 +0,0 @@
-/**********************************************************************
- iso8859_15.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"
-
-#define ENC_ISO_8859_15_TO_LOWER_CASE(c) EncISO_8859_15_ToLowerCaseTable[c]
-#define ENC_IS_ISO_8859_15_CTYPE(code,ctype) \
- ((EncISO_8859_15_CtypeTable[code] & CTYPE_TO_BIT(ctype)) != 0)
-
-static const UChar EncISO_8859_15_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', '\250', '\247',
- '\250', '\251', '\252', '\253', '\254', '\255', '\256', '\257',
- '\260', '\261', '\262', '\263', '\270', '\265', '\266', '\267',
- '\270', '\271', '\272', '\273', '\275', '\275', '\377', '\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 EncISO_8859_15_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, 0x00a0, 0x34a2, 0x00a0,
- 0x30e2, 0x00a0, 0x30e2, 0x01a0, 0x00a0, 0x01a0, 0x00a0, 0x00a0,
- 0x00a0, 0x00a0, 0x10a0, 0x10a0, 0x34a2, 0x30e2, 0x00a0, 0x01a0,
- 0x30e2, 0x10a0, 0x30e2, 0x01a0, 0x34a2, 0x30e2, 0x34a2, 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 == 0xdf && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {
- *lower++ = 's';
- *lower = 's';
- (*pp)++;
- return 2;
- }
-
- *lower = ENC_ISO_8859_15_TO_LOWER_CASE(*p);
- (*pp)++;
- return 1; /* return byte length of converted char to lower */
-}
-
-#if 0
-static int
-is_mbc_ambiguous(OnigCaseFoldType flag,
- const UChar** pp, const UChar* end)
-{
- int v;
- const UChar* p = *pp;
-
- if (*p == 0xdf && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {
- (*pp)++;
- return TRUE;
- }
-
- (*pp)++;
- v = (EncISO_8859_15_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 == 0xb5 || *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_ISO_8859_15_CTYPE(code, ctype);
- else
- return FALSE;
-}
-
-static const OnigPairCaseFoldCodes CaseFoldMap[] = {
- { 0xa6, 0xa8 },
-
- { 0xb4, 0xb8 },
- { 0xbc, 0xbd },
- { 0xbe, 0xff },
-
- { 0xc0, 0xe0 },
- { 0xc1, 0xe1 },
- { 0xc2, 0xe2 },
- { 0xc3, 0xe3 },
- { 0xc4, 0xe4 },
- { 0xc5, 0xe5 },
- { 0xc6, 0xe6 },
- { 0xc7, 0xe7 },
- { 0xc8, 0xe8 },
- { 0xc9, 0xe9 },
- { 0xca, 0xea },
- { 0xcb, 0xeb },
- { 0xcc, 0xec },
- { 0xcd, 0xed },
- { 0xce, 0xee },
- { 0xcf, 0xef },
-
- { 0xd0, 0xf0 },
- { 0xd1, 0xf1 },
- { 0xd2, 0xf2 },
- { 0xd3, 0xf3 },
- { 0xd4, 0xf4 },
- { 0xd5, 0xf5 },
- { 0xd6, 0xf6 },
- { 0xd8, 0xf8 },
- { 0xd9, 0xf9 },
- { 0xda, 0xfa },
- { 0xdb, 0xfb },
- { 0xdc, 0xfc },
- { 0xdd, 0xfd },
- { 0xde, 0xfe }
-};
-
-static int
-apply_all_case_fold(OnigCaseFoldType flag,
- OnigApplyAllCaseFoldFunc f, void* arg,
- OnigEncoding enc ARG_UNUSED)
-{
- return onigenc_apply_all_case_fold_with_map(
- sizeof(CaseFoldMap)/sizeof(OnigPairCaseFoldCodes), CaseFoldMap, 1,
- flag, f, arg);
-}
-
-static int
-get_case_fold_codes_by_str(OnigCaseFoldType flag,
- const OnigUChar* p, const OnigUChar* end,
- OnigCaseFoldCodeItem items[],
- OnigEncoding enc ARG_UNUSED)
-{
- return onigenc_get_case_fold_codes_by_str_with_map(
- sizeof(CaseFoldMap)/sizeof(OnigPairCaseFoldCodes), CaseFoldMap, 1,
- flag, p, end, items);
-}
-
-OnigEncodingDefine(iso_8859_15, ISO_8859_15) = {
- onigenc_single_byte_mbc_enc_len,
- "ISO-8859-15", /* 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
-};
-ENC_ALIAS("ISO8859-15", "ISO-8859-15")
diff --git a/enc/iso_8859_16.c b/enc/iso_8859_16.c
deleted file mode 100644
index 3ddc1d91c6..0000000000
--- a/enc/iso_8859_16.c
+++ /dev/null
@@ -1,242 +0,0 @@
-/**********************************************************************
- iso8859_16.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"
-
-#define ENC_ISO_8859_16_TO_LOWER_CASE(c) EncISO_8859_16_ToLowerCaseTable[c]
-#define ENC_IS_ISO_8859_16_CTYPE(code,ctype) \
- ((EncISO_8859_16_CtypeTable[code] & CTYPE_TO_BIT(ctype)) != 0)
-
-static const UChar EncISO_8859_16_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', '\242', '\242', '\263', '\245', '\245', '\250', '\247',
- '\250', '\251', '\272', '\253', '\256', '\255', '\256', '\277',
- '\260', '\261', '\271', '\263', '\270', '\265', '\266', '\267',
- '\270', '\271', '\272', '\273', '\275', '\275', '\377', '\277',
- '\340', '\341', '\342', '\343', '\344', '\345', '\346', '\347',
- '\350', '\351', '\352', '\353', '\354', '\355', '\356', '\357',
- '\360', '\361', '\362', '\363', '\364', '\365', '\366', '\367',
- '\370', '\371', '\372', '\373', '\374', '\375', '\376', '\337',
- '\340', '\341', '\342', '\343', '\344', '\345', '\346', '\347',
- '\350', '\351', '\352', '\353', '\354', '\355', '\356', '\357',
- '\360', '\361', '\362', '\363', '\364', '\365', '\366', '\367',
- '\370', '\371', '\372', '\373', '\374', '\375', '\376', '\377'
-};
-
-static const unsigned short EncISO_8859_16_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, 0x34a2, 0x30e2, 0x34a2, 0x00a0, 0x01a0, 0x34a2, 0x00a0,
- 0x30e2, 0x00a0, 0x34a2, 0x01a0, 0x34a2, 0x01a0, 0x30e2, 0x34a2,
- 0x00a0, 0x00a0, 0x34a2, 0x30e2, 0x34a2, 0x01a0, 0x00a0, 0x01a0,
- 0x30e2, 0x30e2, 0x30e2, 0x01a0, 0x34a2, 0x30e2, 0x34a2, 0x30e2,
- 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2,
- 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2,
- 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 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
-};
-
-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 == 0xdf && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {
- *lower++ = 's';
- *lower = 's';
- (*pp)++;
- return 2;
- }
-
- *lower = ENC_ISO_8859_16_TO_LOWER_CASE(*p);
- (*pp)++;
- return 1; /* return byte length of converted char to lower */
-}
-
-#if 0
-static int
-is_mbc_ambiguous(OnigCaseFoldType flag, const UChar** pp, const UChar* end)
-{
- int v;
- const UChar* p = *pp;
-
- if (*p == 0xdf && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {
- (*pp)++;
- return TRUE;
- }
-
- (*pp)++;
- v = (EncISO_8859_16_CtypeTable[*p] & (BIT_CTYPE_UPPER | BIT_CTYPE_LOWER));
- if ((v | BIT_CTYPE_LOWER) != 0) {
- 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_ISO_8859_16_CTYPE(code, ctype);
- else
- return FALSE;
-}
-
-static const OnigPairCaseFoldCodes CaseFoldMap[] = {
- { 0xa1, 0xa2 },
- { 0xa3, 0xb3 },
- { 0xa6, 0xa8 },
- { 0xaa, 0xba },
- { 0xac, 0xae },
- { 0xaf, 0xbf },
-
- { 0xb2, 0xb9 },
- { 0xb4, 0xb8 },
- { 0xbc, 0xbd },
- { 0xbe, 0xff },
-
- { 0xc0, 0xe0 },
- { 0xc1, 0xe1 },
- { 0xc2, 0xe2 },
- { 0xc3, 0xe3 },
- { 0xc4, 0xe4 },
- { 0xc5, 0xe5 },
- { 0xc6, 0xe6 },
- { 0xc7, 0xe7 },
- { 0xc8, 0xe8 },
- { 0xc9, 0xe9 },
- { 0xca, 0xea },
- { 0xcb, 0xeb },
- { 0xcc, 0xec },
- { 0xcd, 0xed },
- { 0xce, 0xee },
- { 0xcf, 0xef },
-
- { 0xd0, 0xf0 },
- { 0xd1, 0xf1 },
- { 0xd2, 0xf2 },
- { 0xd3, 0xf3 },
- { 0xd4, 0xf4 },
- { 0xd5, 0xf5 },
- { 0xd6, 0xf6 },
- { 0xd7, 0xf7 },
- { 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(
- sizeof(CaseFoldMap)/sizeof(OnigPairCaseFoldCodes), 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(
- sizeof(CaseFoldMap)/sizeof(OnigPairCaseFoldCodes), CaseFoldMap, 1,
- flag, p, end, items);
-}
-
-OnigEncodingDefine(iso_8859_16, ISO_8859_16) = {
- onigenc_single_byte_mbc_enc_len,
- "ISO-8859-16", /* 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
-};
-ENC_ALIAS("ISO8859-16", "ISO-8859-16")
diff --git a/enc/iso_8859_2.c b/enc/iso_8859_2.c
deleted file mode 100644
index 9783f1cd02..0000000000
--- a/enc/iso_8859_2.c
+++ /dev/null
@@ -1,250 +0,0 @@
-/**********************************************************************
- iso8859_2.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"
-
-#define ENC_ISO_8859_2_TO_LOWER_CASE(c) EncISO_8859_2_ToLowerCaseTable[c]
-#define ENC_IS_ISO_8859_2_CTYPE(code,ctype) \
- ((EncISO_8859_2_CtypeTable[code] & CTYPE_TO_BIT(ctype)) != 0)
-
-static const UChar EncISO_8859_2_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', '\261', '\242', '\263', '\244', '\265', '\266', '\247',
- '\250', '\271', '\272', '\273', '\274', '\255', '\276', '\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 EncISO_8859_2_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, 0x34a2, 0x00a0, 0x34a2, 0x00a0, 0x34a2, 0x34a2, 0x00a0,
- 0x00a0, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x01a0, 0x34a2, 0x34a2,
- 0x00a0, 0x30e2, 0x00a0, 0x30e2, 0x00a0, 0x30e2, 0x30e2, 0x00a0,
- 0x00a0, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x00a0, 0x30e2, 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, 0x00a0
-};
-
-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 == 0xdf && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {
- *lower++ = 's';
- *lower = 's';
- (*pp)++;
- return 2;
- }
-
- *lower = ENC_ISO_8859_2_TO_LOWER_CASE(*p);
- (*pp)++;
- return 1; /* return byte length of converted char to lower */
-}
-
-#if 0
-static int
-is_mbc_ambiguous(OnigCaseFoldType flag, const UChar** pp, const UChar* end)
-{
- int v;
- const UChar* p = *pp;
-
- if (*p == 0xdf && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {
- (*pp)++;
- return TRUE;
- }
-
- (*pp)++;
- v = (EncISO_8859_2_CtypeTable[*p] & (BIT_CTYPE_UPPER | BIT_CTYPE_LOWER));
- if ((v | BIT_CTYPE_LOWER) != 0) {
- return TRUE;
- }
-
- return (v != 0 ? TRUE : FALSE);
-}
-#endif
-
-static const OnigPairCaseFoldCodes CaseFoldMap[] = {
- { 0xa1, 0xb1 },
- { 0xa3, 0xb3 },
- { 0xa5, 0xb5 },
- { 0xa6, 0xb6 },
- { 0xa9, 0xb9 },
- { 0xaa, 0xba },
- { 0xab, 0xbb },
- { 0xac, 0xbc },
- { 0xae, 0xbe },
- { 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(
- sizeof(CaseFoldMap)/sizeof(OnigPairCaseFoldCodes), 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(
- sizeof(CaseFoldMap)/sizeof(OnigPairCaseFoldCodes), CaseFoldMap, 1,
- flag, p, end, items);
-}
-
-static int
-is_code_ctype(OnigCodePoint code, unsigned int ctype, OnigEncoding enc ARG_UNUSED)
-{
- if (code < 256)
- return ENC_IS_ISO_8859_2_CTYPE(code, ctype);
- else
- return FALSE;
-}
-
-OnigEncodingDefine(iso_8859_2, ISO_8859_2) = {
- onigenc_single_byte_mbc_enc_len,
- "ISO-8859-2", /* 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
-};
-ENC_ALIAS("ISO8859-2", "ISO-8859-2")
-
-/*
- * Name: windows-1250
- * MIBenum: 2250
- * Link: http://www.iana.org/assignments/character-sets
- * Link: http://www.microsoft.com/globaldev/reference/sbcs/1250.mspx
- * Link: http://en.wikipedia.org/wiki/Windows-1250
- */
-ENC_REPLICATE("Windows-1250", "ISO-8859-2")
-ENC_ALIAS("CP1250", "Windows-1250")
diff --git a/enc/iso_8859_3.c b/enc/iso_8859_3.c
deleted file mode 100644
index 81c0c742b6..0000000000
--- a/enc/iso_8859_3.c
+++ /dev/null
@@ -1,240 +0,0 @@
-/**********************************************************************
- iso8859_3.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"
-
-#define ENC_ISO_8859_3_TO_LOWER_CASE(c) EncISO_8859_3_ToLowerCaseTable[c]
-#define ENC_IS_ISO_8859_3_CTYPE(code,ctype) \
- ((EncISO_8859_3_CtypeTable[code] & CTYPE_TO_BIT(ctype)) != 0)
-
-static const UChar EncISO_8859_3_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', '\261', '\242', '\243', '\244', '\245', '\266', '\247',
- '\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',
- '\350', '\351', '\352', '\353', '\354', '\355', '\356', '\357',
- '\320', '\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 EncISO_8859_3_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, 0x34a2, 0x00a0, 0x00a0, 0x00a0, 0x0000, 0x34a2, 0x00a0,
- 0x00a0, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x01a0, 0x0000, 0x34a2,
- 0x00a0, 0x30e2, 0x10a0, 0x10a0, 0x00a0, 0x30e2, 0x30e2, 0x01a0,
- 0x00a0, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x11a0, 0x0000, 0x30e2,
- 0x34a2, 0x34a2, 0x34a2, 0x0000, 0x34a2, 0x34a2, 0x34a2, 0x34a2,
- 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2,
- 0x0000, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x00a0,
- 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x30e2,
- 0x30e2, 0x30e2, 0x30e2, 0x0000, 0x30e2, 0x30e2, 0x30e2, 0x30e2,
- 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2,
- 0x0000, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x00a0,
- 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x00a0
-};
-
-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 == 0xdf && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {
- *lower++ = 's';
- *lower = 's';
- (*pp)++;
- return 2;
- }
-
- *lower = ENC_ISO_8859_3_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 == 0xdf && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {
- (*pp)++;
- return TRUE;
- }
-
- (*pp)++;
- v = (EncISO_8859_3_CtypeTable[*p] & (BIT_CTYPE_UPPER | BIT_CTYPE_LOWER));
- if ((v | BIT_CTYPE_LOWER) != 0) {
- /* 0xaa, 0xb5, 0xba 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_ISO_8859_3_CTYPE(code, ctype);
- else
- return FALSE;
-}
-
-static const OnigPairCaseFoldCodes CaseFoldMap[] = {
- { 0xa1, 0xb1 },
- { 0xa6, 0xb6 },
- { 0xa9, 0xb9 },
- { 0xaa, 0xba },
- { 0xab, 0xbb },
- { 0xac, 0xbc },
- { 0xaf, 0xbf },
-
- { 0xc0, 0xe0 },
- { 0xc1, 0xe1 },
- { 0xc2, 0xe2 },
- { 0xc4, 0xe4 },
- { 0xc5, 0xe5 },
- { 0xc6, 0xe6 },
- { 0xc7, 0xe7 },
- { 0xc8, 0xe8 },
- { 0xc9, 0xe9 },
- { 0xca, 0xea },
- { 0xcb, 0xeb },
- { 0xcc, 0xec },
- { 0xcd, 0xed },
- { 0xce, 0xee },
- { 0xcf, 0xef },
-
- { 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(
- sizeof(CaseFoldMap)/sizeof(OnigPairCaseFoldCodes), 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(
- sizeof(CaseFoldMap)/sizeof(OnigPairCaseFoldCodes), CaseFoldMap, 1,
- flag, p, end, items);
-}
-
-OnigEncodingDefine(iso_8859_3, ISO_8859_3) = {
- onigenc_single_byte_mbc_enc_len,
- "ISO-8859-3", /* 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
-};
-ENC_ALIAS("ISO8859-3", "ISO-8859-3")
diff --git a/enc/iso_8859_4.c b/enc/iso_8859_4.c
deleted file mode 100644
index ec71c4bcbf..0000000000
--- a/enc/iso_8859_4.c
+++ /dev/null
@@ -1,242 +0,0 @@
-/**********************************************************************
- iso8859_4.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"
-
-#define ENC_ISO_8859_4_TO_LOWER_CASE(c) EncISO_8859_4_ToLowerCaseTable[c]
-#define ENC_IS_ISO_8859_4_CTYPE(code,ctype) \
- ((EncISO_8859_4_CtypeTable[code] & CTYPE_TO_BIT(ctype)) != 0)
-
-static const UChar EncISO_8859_4_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', '\261', '\242', '\263', '\244', '\265', '\266', '\247',
- '\250', '\271', '\272', '\273', '\274', '\255', '\276', '\257',
- '\260', '\261', '\262', '\263', '\264', '\265', '\266', '\267',
- '\270', '\271', '\272', '\273', '\274', '\277', '\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 EncISO_8859_4_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, 0x34a2, 0x30e2, 0x34a2, 0x00a0, 0x34a2, 0x34a2, 0x00a0,
- 0x00a0, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x01a0, 0x34a2, 0x00a0,
- 0x00a0, 0x30e2, 0x00a0, 0x30e2, 0x00a0, 0x30e2, 0x30e2, 0x00a0,
- 0x00a0, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x34a2, 0x30e2, 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, 0x00a0
-};
-
-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 == 0xdf && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {
- *lower++ = 's';
- *lower = 's';
- (*pp)++;
- return 2;
- }
-
- *lower = ENC_ISO_8859_4_TO_LOWER_CASE(*p);
- (*pp)++;
- return 1; /* return byte length of converted char to lower */
-}
-
-#if 0
-static int
-is_mbc_ambiguous(OnigCaseFoldType flag, const UChar** pp, const UChar* end)
-{
- int v;
- const UChar* p = *pp;
-
- if (*p == 0xdf && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {
- (*pp)++;
- return TRUE;
- }
-
- (*pp)++;
- v = (EncISO_8859_4_CtypeTable[*p] & (BIT_CTYPE_UPPER | BIT_CTYPE_LOWER));
- if ((v | BIT_CTYPE_LOWER) != 0) {
- if (*p == 0xa2)
- 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_ISO_8859_4_CTYPE(code, ctype);
- else
- return FALSE;
-}
-
-static const OnigPairCaseFoldCodes CaseFoldMap[] = {
- { 0xa1, 0xb1 },
- { 0xa3, 0xb3 },
- { 0xa5, 0xb5 },
- { 0xa6, 0xb6 },
- { 0xa9, 0xb9 },
- { 0xaa, 0xba },
- { 0xab, 0xbb },
- { 0xac, 0xbc },
- { 0xae, 0xbe },
-
- { 0xc0, 0xe0 },
- { 0xc1, 0xe1 },
- { 0xc2, 0xe2 },
- { 0xc3, 0xe3 },
- { 0xc4, 0xe4 },
- { 0xc5, 0xe5 },
- { 0xc6, 0xe6 },
- { 0xc7, 0xe7 },
- { 0xc8, 0xe8 },
- { 0xc9, 0xe9 },
- { 0xca, 0xea },
- { 0xcb, 0xeb },
- { 0xcc, 0xec },
- { 0xcd, 0xed },
- { 0xce, 0xee },
- { 0xcf, 0xef },
-
- { 0xd0, 0xf0 },
- { 0xd1, 0xf1 },
- { 0xd2, 0xf2 },
- { 0xd3, 0xf3 },
- { 0xd4, 0xf4 },
- { 0xd5, 0xf5 },
- { 0xd6, 0xf6 },
- { 0xd8, 0xf8 },
- { 0xd9, 0xf9 },
- { 0xda, 0xfa },
- { 0xdb, 0xfb },
- { 0xdc, 0xfc },
- { 0xdd, 0xfd },
- { 0xde, 0xfe }
-};
-
-static int
-apply_all_case_fold(OnigCaseFoldType flag,
- OnigApplyAllCaseFoldFunc f, void* arg,
- OnigEncoding enc ARG_UNUSED)
-{
- return onigenc_apply_all_case_fold_with_map(
- sizeof(CaseFoldMap)/sizeof(OnigPairCaseFoldCodes), CaseFoldMap, 1,
- flag, f, arg);
-}
-
-static int
-get_case_fold_codes_by_str(OnigCaseFoldType flag,
- const OnigUChar* p, const OnigUChar* end,
- OnigCaseFoldCodeItem items[],
- OnigEncoding enc ARG_UNUSED)
-{
- return onigenc_get_case_fold_codes_by_str_with_map(
- sizeof(CaseFoldMap)/sizeof(OnigPairCaseFoldCodes), CaseFoldMap, 1,
- flag, p, end, items);
-}
-
-OnigEncodingDefine(iso_8859_4, ISO_8859_4) = {
- onigenc_single_byte_mbc_enc_len,
- "ISO-8859-4", /* 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
-};
-ENC_ALIAS("ISO8859-4", "ISO-8859-4")
diff --git a/enc/iso_8859_5.c b/enc/iso_8859_5.c
deleted file mode 100644
index 1550763323..0000000000
--- a/enc/iso_8859_5.c
+++ /dev/null
@@ -1,230 +0,0 @@
-/**********************************************************************
- iso8859_5.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"
-
-#define ENC_ISO_8859_5_TO_LOWER_CASE(c) EncISO_8859_5_ToLowerCaseTable[c]
-#define ENC_IS_ISO_8859_5_CTYPE(code,ctype) \
- ((EncISO_8859_5_CtypeTable[code] & CTYPE_TO_BIT(ctype)) != 0)
-
-static const UChar EncISO_8859_5_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', '\361', '\362', '\363', '\364', '\365', '\366', '\367',
- '\370', '\371', '\372', '\373', '\374', '\255', '\376', '\377',
- '\320', '\321', '\322', '\323', '\324', '\325', '\326', '\327',
- '\330', '\331', '\332', '\333', '\334', '\335', '\336', '\337',
- '\340', '\341', '\342', '\343', '\344', '\345', '\346', '\347',
- '\350', '\351', '\352', '\353', '\354', '\355', '\356', '\357',
- '\320', '\321', '\322', '\323', '\324', '\325', '\326', '\327',
- '\330', '\331', '\332', '\333', '\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 EncISO_8859_5_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, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2,
- 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x01a0, 0x34a2, 0x34a2,
- 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2,
- 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2,
- 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 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,
- 0x00a0, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2,
- 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x00a0, 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;
-
- *lower = ENC_ISO_8859_5_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 = (EncISO_8859_5_CtypeTable[*p] & (BIT_CTYPE_UPPER | BIT_CTYPE_LOWER));
- 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_ISO_8859_5_CTYPE(code, ctype);
- else
- return FALSE;
-}
-
-static const OnigPairCaseFoldCodes CaseFoldMap[] = {
- { 0xa1, 0xf1 },
- { 0xa2, 0xf2 },
- { 0xa3, 0xf3 },
- { 0xa4, 0xf4 },
- { 0xa5, 0xf5 },
- { 0xa6, 0xf6 },
- { 0xa7, 0xf7 },
- { 0xa8, 0xf8 },
- { 0xa9, 0xf9 },
- { 0xaa, 0xfa },
- { 0xab, 0xfb },
- { 0xac, 0xfc },
- { 0xae, 0xfe },
- { 0xaf, 0xff },
-
- { 0xb0, 0xd0 },
- { 0xb1, 0xd1 },
- { 0xb2, 0xd2 },
- { 0xb3, 0xd3 },
- { 0xb4, 0xd4 },
- { 0xb5, 0xd5 },
- { 0xb6, 0xd6 },
- { 0xb7, 0xd7 },
- { 0xb8, 0xd8 },
- { 0xb9, 0xd9 },
- { 0xba, 0xda },
- { 0xbb, 0xdb },
- { 0xbc, 0xdc },
- { 0xbd, 0xdd },
- { 0xbe, 0xde },
- { 0xbf, 0xdf },
-
- { 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 }
-};
-
-static int
-apply_all_case_fold(OnigCaseFoldType flag,
- OnigApplyAllCaseFoldFunc f, void* arg,
- OnigEncoding enc ARG_UNUSED)
-{
- return onigenc_apply_all_case_fold_with_map(
- sizeof(CaseFoldMap)/sizeof(OnigPairCaseFoldCodes), CaseFoldMap, 0,
- 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(
- sizeof(CaseFoldMap)/sizeof(OnigPairCaseFoldCodes), CaseFoldMap, 0,
- flag, p, end, items);
-}
-
-OnigEncodingDefine(iso_8859_5, ISO_8859_5) = {
- onigenc_single_byte_mbc_enc_len,
- "ISO-8859-5", /* 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
-};
-ENC_ALIAS("ISO8859-5", "ISO-8859-5")
diff --git a/enc/iso_8859_6.c b/enc/iso_8859_6.c
deleted file mode 100644
index 7384061a1f..0000000000
--- a/enc/iso_8859_6.c
+++ /dev/null
@@ -1,107 +0,0 @@
-/**********************************************************************
- iso8859_6.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"
-
-#define ENC_IS_ISO_8859_6_CTYPE(code,ctype) \
- ((EncISO_8859_6_CtypeTable[code] & CTYPE_TO_BIT(ctype)) != 0)
-
-static const unsigned short EncISO_8859_6_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, 0x0000, 0x0000, 0x0000, 0x00a0, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x01a0, 0x01a0, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x01a0, 0x0000, 0x0000, 0x0000, 0x01a0,
- 0x0000, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2,
- 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2,
- 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2,
- 0x30a2, 0x30a2, 0x30a2, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2,
- 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2,
- 0x30a2, 0x30a2, 0x30a2, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000
-};
-
-static int
-is_code_ctype(OnigCodePoint code, unsigned int ctype, OnigEncoding enc ARG_UNUSED)
-{
- if (code < 256)
- return ENC_IS_ISO_8859_6_CTYPE(code, ctype);
- else
- return FALSE;
-}
-
-OnigEncodingDefine(iso_8859_6, ISO_8859_6) = {
- onigenc_single_byte_mbc_enc_len,
- "ISO-8859-6", /* 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,
- onigenc_ascii_mbc_case_fold,
- onigenc_ascii_apply_all_case_fold,
- onigenc_ascii_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
-};
-ENC_ALIAS("ISO8859-6", "ISO-8859-6")
-
-/*
- * Name: windows-1256
- * MIBenum: 2256
- * Link: http://www.iana.org/assignments/character-sets
- * Link: http://www.microsoft.com/globaldev/reference/sbcs/1256.mspx
- * Link: http://en.wikipedia.org/wiki/Windows-1256
- */
-ENC_REPLICATE("Windows-1256", "ISO-8859-6")
-ENC_ALIAS("CP1256", "Windows-1256")
diff --git a/enc/iso_8859_7.c b/enc/iso_8859_7.c
deleted file mode 100644
index 2f916171db..0000000000
--- a/enc/iso_8859_7.c
+++ /dev/null
@@ -1,237 +0,0 @@
-/**********************************************************************
- iso8859_7.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"
-
-#define ENC_ISO_8859_7_TO_LOWER_CASE(c) EncISO_8859_7_ToLowerCaseTable[c]
-#define ENC_IS_ISO_8859_7_CTYPE(code,ctype) \
- ((EncISO_8859_7_CtypeTable[code] & CTYPE_TO_BIT(ctype)) != 0)
-
-static const UChar EncISO_8859_7_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',
- '\250', '\251', '\252', '\253', '\254', '\255', '\256', '\257',
- '\260', '\261', '\262', '\263', '\264', '\265', '\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 EncISO_8859_7_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, 0x01a0, 0x00a0, 0x0000, 0x0000, 0x00a0, 0x00a0,
- 0x00a0, 0x00a0, 0x0000, 0x01a0, 0x00a0, 0x01a0, 0x0000, 0x01a0,
- 0x00a0, 0x00a0, 0x10a0, 0x10a0, 0x00a0, 0x00a0, 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_ISO_8859_7_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 = (EncISO_8859_7_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_ISO_8859_7_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(
- sizeof(CaseFoldMap)/sizeof(OnigPairCaseFoldCodes), 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(
- sizeof(CaseFoldMap)/sizeof(OnigPairCaseFoldCodes), CaseFoldMap, 0,
- flag, p, end, items);
-}
-
-
-OnigEncodingDefine(iso_8859_7, ISO_8859_7) = {
- onigenc_single_byte_mbc_enc_len,
- "ISO-8859-7", /* 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
-};
-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
deleted file mode 100644
index bd0754c2b1..0000000000
--- a/enc/iso_8859_8.c
+++ /dev/null
@@ -1,107 +0,0 @@
-/**********************************************************************
- iso8859_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"
-
-#define ENC_IS_ISO_8859_8_CTYPE(code,ctype) \
- ((EncISO_8859_8_CtypeTable[code] & CTYPE_TO_BIT(ctype)) != 0)
-
-static const unsigned short EncISO_8859_8_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, 0x0000, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0,
- 0x00a0, 0x00a0, 0x00a0, 0x01a0, 0x00a0, 0x01a0, 0x00a0, 0x00a0,
- 0x00a0, 0x00a0, 0x10a0, 0x10a0, 0x00a0, 0x30e2, 0x00a0, 0x01a0,
- 0x00a0, 0x10a0, 0x00a0, 0x01a0, 0x10a0, 0x10a0, 0x10a0, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x01a0,
- 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2,
- 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2,
- 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2,
- 0x30a2, 0x30a2, 0x30a2, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000
-};
-
-static int
-is_code_ctype(OnigCodePoint code, unsigned int ctype, OnigEncoding enc ARG_UNUSED)
-{
- if (code < 256)
- return ENC_IS_ISO_8859_8_CTYPE(code, ctype);
- else
- return FALSE;
-}
-
-OnigEncodingDefine(iso_8859_8, ISO_8859_8) = {
- onigenc_single_byte_mbc_enc_len,
- "ISO-8859-8", /* 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,
- onigenc_ascii_mbc_case_fold,
- onigenc_ascii_apply_all_case_fold,
- onigenc_ascii_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
-};
-ENC_ALIAS("ISO8859-8", "ISO-8859-8")
-
-/*
- * Name: windows-1255
- * MIBenum: 2255
- * Link: http://www.iana.org/assignments/character-sets
- * Link: http://www.microsoft.com/globaldev/reference/sbcs/1255.mspx
- * Link: http://en.wikipedia.org/wiki/Windows-1255
- */
-ENC_REPLICATE("Windows-1255", "ISO-8859-8")
-ENC_ALIAS("CP1255", "Windows-1255")
diff --git a/enc/iso_8859_9.c b/enc/iso_8859_9.c
deleted file mode 100644
index 4d46e742e2..0000000000
--- a/enc/iso_8859_9.c
+++ /dev/null
@@ -1,243 +0,0 @@
-/**********************************************************************
- iso8859_9.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"
-
-#define ENC_ISO_8859_9_TO_LOWER_CASE(c) EncISO_8859_9_ToLowerCaseTable[c]
-#define ENC_IS_ISO_8859_9_CTYPE(code,ctype) \
- ((EncISO_8859_9_CtypeTable[code] & CTYPE_TO_BIT(ctype)) != 0)
-
-static const UChar EncISO_8859_9_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',
- '\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', '\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',
- '\370', '\371', '\372', '\373', '\374', '\375', '\376', '\377'
-};
-
-static const unsigned short EncISO_8859_9_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, 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 == 0xdf && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {
- *lower++ = 's';
- *lower = 's';
- (*pp)++;
- return 2;
- }
-
- *lower = ENC_ISO_8859_9_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 == 0xdf && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {
- (*pp)++;
- return TRUE;
- }
-
- (*pp)++;
- v = (EncISO_8859_9_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_ISO_8859_9_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(
- sizeof(CaseFoldMap)/sizeof(OnigPairCaseFoldCodes), 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(
- sizeof(CaseFoldMap)/sizeof(OnigPairCaseFoldCodes), CaseFoldMap, 1,
- flag, p, end, items);
-}
-
-OnigEncodingDefine(iso_8859_9, ISO_8859_9) = {
- onigenc_single_byte_mbc_enc_len,
- "ISO-8859-9", /* 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
-};
-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/koi8_r.c b/enc/koi8_r.c
deleted file mode 100644
index fb6e10eadc..0000000000
--- a/enc/koi8_r.c
+++ /dev/null
@@ -1,219 +0,0 @@
-/**********************************************************************
- koi8_r.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"
-
-#define ENC_KOI8_R_TO_LOWER_CASE(c) EncKOI8_R_ToLowerCaseTable[c]
-#define ENC_IS_KOI8_R_CTYPE(code,ctype) \
- ((EncKOI8_R_CtypeTable[code] & CTYPE_TO_BIT(ctype)) != 0)
-
-static const UChar EncKOI8_R_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',
- '\250', '\251', '\252', '\253', '\254', '\255', '\256', '\257',
- '\260', '\261', '\262', '\243', '\264', '\265', '\266', '\267',
- '\270', '\271', '\272', '\273', '\274', '\275', '\276', '\277',
- '\300', '\301', '\302', '\303', '\304', '\305', '\306', '\307',
- '\310', '\311', '\312', '\313', '\314', '\315', '\316', '\317',
- '\320', '\321', '\322', '\323', '\324', '\325', '\326', '\327',
- '\330', '\331', '\332', '\333', '\334', '\335', '\336', '\337',
- '\300', '\301', '\302', '\303', '\304', '\305', '\306', '\307',
- '\310', '\311', '\312', '\313', '\314', '\315', '\316', '\317',
- '\320', '\321', '\322', '\323', '\324', '\325', '\326', '\327',
- '\330', '\331', '\332', '\333', '\334', '\335', '\336', '\337'
-};
-
-static const unsigned short EncKOI8_R_CtypeTable[256] = {
- 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008,
- 0x4008, 0x420c, 0x4209, 0x4208, 0x4208, 0x4208, 0x4008, 0x4008,
- 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008,
- 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008,
- 0x4284, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0,
- 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0,
- 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0,
- 0x78b0, 0x78b0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0,
- 0x41a0, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x74a2,
- 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2,
- 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2,
- 0x74a2, 0x74a2, 0x74a2, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x51a0,
- 0x41a0, 0x78e2, 0x78e2, 0x78e2, 0x78e2, 0x78e2, 0x78e2, 0x70e2,
- 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2,
- 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2,
- 0x70e2, 0x70e2, 0x70e2, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x4008,
- 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0,
- 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0,
- 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0,
- 0x00a0, 0x00a0, 0x0284, 0x00a0, 0x00a0, 0x10a0, 0x01a0, 0x00a0,
- 0x00a0, 0x00a0, 0x00a0, 0x30e2, 0x00a0, 0x00a0, 0x00a0, 0x00a0,
- 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0,
- 0x00a0, 0x00a0, 0x00a0, 0x34a2, 0x00a0, 0x00a0, 0x00a0, 0x00a0,
- 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0,
- 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,
- 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2,
- 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2,
- 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2,
- 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2
-};
-
-static int
-koi8_r_mbc_case_fold(OnigCaseFoldType flag ARG_UNUSED,
- const UChar** pp, const UChar* end ARG_UNUSED,
- UChar* lower, OnigEncoding enc ARG_UNUSED)
-{
- const UChar* p = *pp;
-
- *lower = ENC_KOI8_R_TO_LOWER_CASE(*p);
- (*pp)++;
- return 1;
-}
-
-#if 0
-static int
-koi8_r_is_mbc_ambiguous(OnigCaseFoldType flag, const UChar** pp,
- const UChar* end, OnigEncoding enc ARG_UNUSED)
-{
- int v;
- const UChar* p = *pp;
-
- (*pp)++;
- v = (EncKOI8_R_CtypeTable[*p] & (BIT_CTYPE_UPPER | BIT_CTYPE_LOWER));
- return (v != 0 ? TRUE : FALSE);
-}
-#endif
-
-static int
-koi8_r_is_code_ctype(OnigCodePoint code, unsigned int ctype,
- OnigEncoding enc ARG_UNUSED)
-{
- if (code < 256)
- return ENC_IS_KOI8_R_CTYPE(code, ctype);
- else
- return FALSE;
-}
-
-static const OnigPairCaseFoldCodes CaseFoldMap[] = {
- { 0xa3, 0xb3 },
-
- { 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 },
- { 0xd7, 0xf7 },
- { 0xd8, 0xf8 },
- { 0xd9, 0xf9 },
- { 0xda, 0xfa },
- { 0xdb, 0xfb },
- { 0xdc, 0xfc },
- { 0xdd, 0xfd },
- { 0xde, 0xfe },
- { 0xdf, 0xff }
-};
-
-static int
-koi8_r_apply_all_case_fold(OnigCaseFoldType flag,
- OnigApplyAllCaseFoldFunc f,
- void* arg, OnigEncoding enc ARG_UNUSED)
-{
- return onigenc_apply_all_case_fold_with_map(
- sizeof(CaseFoldMap)/sizeof(OnigPairCaseFoldCodes), CaseFoldMap, 0,
- flag, f, arg);
-}
-
-static int
-koi8_r_get_case_fold_codes_by_str(OnigCaseFoldType flag,
- const OnigUChar* p, const OnigUChar* end,
- OnigCaseFoldCodeItem items[], OnigEncoding enc ARG_UNUSED)
-{
- return onigenc_get_case_fold_codes_by_str_with_map(
- sizeof(CaseFoldMap)/sizeof(OnigPairCaseFoldCodes), CaseFoldMap, 0,
- flag, p, end, items);
-}
-
-OnigEncodingDefine(koi8_r, KOI8_R) = {
- onigenc_single_byte_mbc_enc_len,
- "KOI8-R", /* 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,
- koi8_r_mbc_case_fold,
- koi8_r_apply_all_case_fold,
- koi8_r_get_case_fold_codes_by_str,
- onigenc_minimum_property_name_to_ctype,
- koi8_r_is_code_ctype,
- onigenc_not_support_get_ctype_code_range,
- onigenc_single_byte_left_adjust_char_head,
- onigenc_always_true_is_allowed_reverse_match
-};
-ENC_ALIAS("CP878", "KOI8-R")
-
diff --git a/enc/koi8_u.c b/enc/koi8_u.c
deleted file mode 100644
index 9bd363df12..0000000000
--- a/enc/koi8_u.c
+++ /dev/null
@@ -1,221 +0,0 @@
-/**********************************************************************
- koi8_u.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"
-
-#define ENC_KOI8_U_TO_LOWER_CASE(c) EncKOI8_U_ToLowerCaseTable[c]
-#define ENC_IS_KOI8_U_CTYPE(code,ctype) \
- ((EncKOI8_U_CtypeTable[code] & CTYPE_TO_BIT(ctype)) != 0)
-
-static const UChar EncKOI8_U_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',
- '\250', '\251', '\252', '\253', '\254', '\255', '\256', '\257',
- '\260', '\261', '\262', '\243', '\244', '\265', '\246', '\247',
- '\270', '\271', '\272', '\273', '\274', '\255', '\276', '\277',
- '\300', '\301', '\302', '\303', '\304', '\305', '\306', '\307',
- '\310', '\311', '\312', '\313', '\314', '\315', '\316', '\317',
- '\320', '\321', '\322', '\323', '\324', '\325', '\326', '\327',
- '\330', '\331', '\332', '\333', '\334', '\335', '\336', '\337',
- '\300', '\301', '\302', '\303', '\304', '\305', '\306', '\307',
- '\310', '\311', '\312', '\313', '\314', '\315', '\316', '\317',
- '\320', '\321', '\322', '\323', '\324', '\325', '\326', '\327',
- '\330', '\331', '\332', '\333', '\334', '\335', '\336', '\337'
-};
-
-static const unsigned short EncKOI8_U_CtypeTable[256] = {
- 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008,
- 0x4008, 0x420c, 0x4209, 0x4208, 0x4208, 0x4208, 0x4008, 0x4008,
- 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008,
- 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008,
- 0x4284, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0,
- 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0,
- 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0,
- 0x78b0, 0x78b0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0,
- 0x41a0, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x74a2,
- 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2,
- 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2,
- 0x74a2, 0x74a2, 0x74a2, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x51a0,
- 0x41a0, 0x78e2, 0x78e2, 0x78e2, 0x78e2, 0x78e2, 0x78e2, 0x70e2,
- 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2,
- 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2,
- 0x70e2, 0x70e2, 0x70e2, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x4008,
- 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0,
- 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0,
- 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0,
- 0x00a0, 0x00a0, 0x0284, 0x00a0, 0x00a0, 0x10a0, 0x01a0, 0x00a0,
- 0x00a0, 0x00a0, 0x00a0, 0x30e2, 0x30e2, 0x00a0, 0x30e2, 0x30e2,
- 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x30e2, 0x00a0, 0x00a0,
- 0x00a0, 0x00a0, 0x00a0, 0x34a2, 0x34a2, 0x00a0, 0x34a2, 0x34a2,
- 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x34a2, 0x00a0, 0x00a0,
- 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,
- 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2,
- 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2,
- 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2,
- 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2
-};
-
-static int
-koi8_u_mbc_case_fold(OnigCaseFoldType flag ARG_UNUSED,
- const UChar** pp, const UChar* end ARG_UNUSED,
- UChar* lower, OnigEncoding enc ARG_UNUSED)
-{
- const UChar* p = *pp;
-
- *lower = ENC_KOI8_U_TO_LOWER_CASE(*p);
- (*pp)++;
- return 1;
-}
-
-#if 0
-static int
-koi8_u_is_mbc_ambiguous(OnigCaseFoldType flag, const UChar** pp,
- const UChar* end, OnigEncoding enc ARG_UNUSED)
-{
- int v;
- const UChar* p = *pp;
-
- (*pp)++;
- v = (EncKOI8_U_CtypeTable[*p] & (BIT_CTYPE_UPPER | BIT_CTYPE_LOWER));
- return (v != 0 ? TRUE : FALSE);
-}
-#endif
-
-static int
-koi8_u_is_code_ctype(OnigCodePoint code, unsigned int ctype,
- OnigEncoding enc ARG_UNUSED)
-{
- if (code < 256)
- return ENC_IS_KOI8_U_CTYPE(code, ctype);
- else
- return FALSE;
-}
-
-static const OnigPairCaseFoldCodes CaseFoldMap[] = {
- { 0xa3, 0xb3 },
- { 0xa4, 0xb4 },
- { 0xa6, 0xb6 },
- { 0xa7, 0xb7 },
- { 0xad, 0xbd },
-
- { 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 },
- { 0xd7, 0xf7 },
- { 0xd8, 0xf8 },
- { 0xd9, 0xf9 },
- { 0xda, 0xfa },
- { 0xdb, 0xfb },
- { 0xdc, 0xfc },
- { 0xdd, 0xfd },
- { 0xde, 0xfe },
- { 0xdf, 0xff }
-};
-
-static int
-koi8_u_apply_all_case_fold(OnigCaseFoldType flag,
- OnigApplyAllCaseFoldFunc f,
- void* arg, OnigEncoding enc ARG_UNUSED)
-{
- return onigenc_apply_all_case_fold_with_map(
- sizeof(CaseFoldMap)/sizeof(OnigPairCaseFoldCodes), CaseFoldMap, 0,
- flag, f, arg);
-}
-
-static int
-koi8_u_get_case_fold_codes_by_str(OnigCaseFoldType flag,
- const OnigUChar* p, const OnigUChar* end,
- OnigCaseFoldCodeItem items[], OnigEncoding enc ARG_UNUSED)
-{
- return onigenc_get_case_fold_codes_by_str_with_map(
- sizeof(CaseFoldMap)/sizeof(OnigPairCaseFoldCodes), CaseFoldMap, 0,
- flag, p, end, items);
-}
-
-OnigEncodingDefine(koi8_u, KOI8_U) = {
- onigenc_single_byte_mbc_enc_len,
- "KOI8-U", /* 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,
- koi8_u_mbc_case_fold,
- koi8_u_apply_all_case_fold,
- koi8_u_get_case_fold_codes_by_str,
- onigenc_minimum_property_name_to_ctype,
- koi8_u_is_code_ctype,
- onigenc_not_support_get_ctype_code_range,
- onigenc_single_byte_left_adjust_char_head,
- onigenc_always_true_is_allowed_reverse_match
-};
diff --git a/enc/make_encmake.rb b/enc/make_encmake.rb
deleted file mode 100644
index 107a387571..0000000000
--- a/enc/make_encmake.rb
+++ /dev/null
@@ -1,50 +0,0 @@
-#! ./miniruby
-
-dir = File.expand_path("../..", __FILE__)
-$:.unshift(dir)
-$:.unshift(".")
-if $".grep(/mkmf/).empty?
- $" << "mkmf.rb"
- load File.expand_path("lib/mkmf.rb", dir)
-end
-require 'erb'
-
-CONFIG["MAKEDIRS"] ||= '@$(MINIRUBY) -run -e mkdir -- -p'
-
-BUILTIN_ENCS = []
-BUILTIN_TRANSES = []
-ENC_PATTERNS = []
-NOENC_PATTERNS = []
-
-until ARGV.empty?
- case ARGV[0]
- when /\A--builtin-encs=/
- BUILTIN_ENCS.concat $'.split.map {|e| File.basename(e, '.*') << '.c'}
- ARGV.shift
- when /\A--builtin-transes=/
- BUILTIN_TRANSES.concat $'.split.map {|e| File.basename(e, '.*') }
- ARGV.shift
- when /\A--encs=/
- ENC_PATTERNS.concat $'.split
- ARGV.shift
- when /\A--no-encs=/
- NOENC_PATTERNS.concat $'.split
- ARGV.shift
- else
- break
- end
-end
-
-if File.exist?(depend = File.join($srcdir, "depend"))
- erb = ERB.new(File.read(depend), nil, '%')
- erb.filename = depend
- tmp = erb.result(binding)
- dep = "\n#### depend ####\n\n" << depend_rules(tmp).join
-else
- dep = ""
-end
-mkin = File.read(File.join($srcdir, "Makefile.in"))
-mkin.gsub!(/@(#{CONFIG.keys.join('|')})@/) {CONFIG[$1]}
-open(ARGV[0], 'wb') {|f|
- f.puts mkin, dep
-}
diff --git a/enc/prelude.rb b/enc/prelude.rb
deleted file mode 100644
index 8ce59f957a..0000000000
--- a/enc/prelude.rb
+++ /dev/null
@@ -1,6 +0,0 @@
-%w'enc/encdb.so enc/trans/transdb.so'.each do |init|
- begin
- require(init)
- rescue LoadError
- end
-end
diff --git a/enc/shift_jis.c b/enc/shift_jis.c
deleted file mode 100644
index b4d8592a27..0000000000
--- a/enc/shift_jis.c
+++ /dev/null
@@ -1,399 +0,0 @@
-/**********************************************************************
- sjis.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 "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, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1
-};
-
-static const char SJIS_CAN_BE_TRAIL_TABLE[256] = {
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0
-};
-
-#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 0;
- }
- else if (code <= 0xffff) {
- return 2;
- }
- else
- return ONIGERR_INVALID_CODE_POINT_VALUE;
-}
-
-static OnigCodePoint
-mbc_to_code(const UChar* p, const UChar* end, OnigEncoding enc)
-{
- int c, i, len;
- OnigCodePoint n;
-
- len = enclen(enc, p, end);
- 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 (enclen(enc, buf) != (p - buf))
- return REGERR_INVALID_CODE_POINT_VALUE;
-#endif
- return p - buf;
-}
-
-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 {
- int i;
- int len = enclen(enc, p, end);
-
- for (i = 0; i < len; i++) {
- *lower++ = *p++;
- }
- (*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 = enclen(enc, p, end);
- 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 int PropertyInited = 0;
-static const OnigCodePoint** PropertyList;
-static int PropertyListNum;
-static int PropertyListSize;
-static hash_table_type* PropertyNameTable;
-
-static const OnigCodePoint CR_Hiragana[] = {
- 1,
- 0x829f, 0x82f1
-}; /* CR_Hiragana */
-
-static const OnigCodePoint CR_Katakana[] = {
- 4,
- 0x00a6, 0x00af,
- 0x00b1, 0x00dd,
- 0x8340, 0x837e,
- 0x8380, 0x8396,
-}; /* CR_Katakana */
-
-static int
-init_property_list(void)
-{
- int r;
-
- PROPERTY_LIST_ADD_PROP("Hiragana", CR_Hiragana);
- PROPERTY_LIST_ADD_PROP("Katakana", CR_Katakana);
- PropertyInited = 1;
-
- end:
- return r;
-}
-
-static int
-property_name_to_ctype(OnigEncoding enc, UChar* p, UChar* end)
-{
- st_data_t ctype;
-
- PROPERTY_LIST_INIT_CHECK;
-
- if (onig_st_lookup_strend(PropertyNameTable, p, end, &ctype) == 0) {
- return onigenc_minimum_property_name_to_ctype(enc, p, end);
- }
-
- return 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 {
- PROPERTY_LIST_INIT_CHECK;
-
- 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;
-
- PROPERTY_LIST_INIT_CHECK;
-
- ctype -= (ONIGENC_MAX_STD_CTYPE + 1);
- if (ctype >= (OnigCtype )PropertyListNum)
- return ONIGERR_TYPE_BUG;
-
- *ranges = PropertyList[ctype];
- return 0;
- }
-}
-
-OnigEncodingDefine(shift_jis, Shift_JIS) = {
- mbc_enc_len,
- "Shift_JIS", /* name */
- 2, /* max byte length */
- 1, /* min byte length */
- onigenc_is_mbc_newline_0x0a,
- mbc_to_code,
- code_to_mbclen,
- code_to_mbc,
- mbc_case_fold,
- onigenc_ascii_apply_all_case_fold,
- onigenc_ascii_get_case_fold_codes_by_str,
- property_name_to_ctype,
- is_code_ctype,
- get_ctype_code_range,
- left_adjust_char_head,
- is_allowed_reverse_match,
- 0
-};
-/*
- * Name: Shift_JIS
- * MIBenum: 17
- * Link: http://www.iana.org/assignments/character-sets
- * Link: http://ja.wikipedia.org/wiki/Shift_JIS
- */
-ENC_ALIAS("SJIS", "Shift_JIS")
-
-/*
- * Name: Windows-31J
- * MIBenum: 2024
- * Link: http://www.iana.org/assignments/character-sets
- * Link: http://www.microsoft.com/globaldev/reference/dbcs/932.mspx
- * Link: http://ja.wikipedia.org/wiki/Windows-31J
- * Link: http://source.icu-project.org/repos/icu/data/trunk/charset/data/ucm/windows-932-2000.ucm
- */
-ENC_REPLICATE("Windows-31J", "Shift_JIS")
-ENC_ALIAS("CP932", "Windows-31J")
-ENC_ALIAS("csWindows31J", "Windows-31J") /* IANA. IE6 don't accept Windows-31J but csWindows31J. */
-
-/*
- * Name: MacJapanese
- * Link: http://unicode.org/Public/MAPPINGS/VENDORS/APPLE/JAPANESE.TXT
- * Link: http://ja.wikipedia.org/wiki/MacJapanese
- */
-ENC_REPLICATE("MacJapanese", "Shift_JIS")
-ENC_ALIAS("MacJapan", "MacJapanese")
diff --git a/enc/trans/CP/CP932UDA%UCS.src b/enc/trans/CP/CP932UDA%UCS.src
deleted file mode 100644
index c49048510e..0000000000
--- a/enc/trans/CP/CP932UDA%UCS.src
+++ /dev/null
@@ -1,1912 +0,0 @@
-# $NetBSD: CP932UDA%UCS.src,v 1.1 2006/11/04 03:46:19 tnozaki Exp $
-
-TYPE ROWCOL
-NAME "CP932UDA/UCS"
-SRC_ZONE 0x7F-0x92 / 0x21-0x7E / 8
-OOB_MODE INVALID
-DST_INVALID 0xFFFE
-DST_UNIT_BITS 16
-
-BEGIN_MAP
-#
-# This mapping data is made from the mapping data provided by Unicode, Inc.
-# Original notice:
-#
-# Name: cp932 to Unicode table
-# Unicode version: 2.0
-# Table version: 2.01
-# Table format: Format A
-# Date: 04/15/98
-#
-# Contact: cpxlate@microsoft.com
-#
-# General notes: none
-#
-# Format: Three tab-separated columns
-# Column #1 is the cp932 code (in hex)
-# Column #2 is the Unicode (in hex as 0xXXXX)
-# Column #3 is the Unicode name (follows a comment sign, '#')
-#
-# The entries are in cp932 order
-#
-0x7F21 = 0xE000
-0x7F22 = 0xE001
-0x7F23 = 0xE002
-0x7F24 = 0xE003
-0x7F25 = 0xE004
-0x7F26 = 0xE005
-0x7F27 = 0xE006
-0x7F28 = 0xE007
-0x7F29 = 0xE008
-0x7F2A = 0xE009
-0x7F2B = 0xE00A
-0x7F2C = 0xE00B
-0x7F2D = 0xE00C
-0x7F2E = 0xE00D
-0x7F2F = 0xE00E
-0x7F30 = 0xE00F
-0x7F31 = 0xE010
-0x7F32 = 0xE011
-0x7F33 = 0xE012
-0x7F34 = 0xE013
-0x7F35 = 0xE014
-0x7F36 = 0xE015
-0x7F37 = 0xE016
-0x7F38 = 0xE017
-0x7F39 = 0xE018
-0x7F3A = 0xE019
-0x7F3B = 0xE01A
-0x7F3C = 0xE01B
-0x7F3D = 0xE01C
-0x7F3E = 0xE01D
-0x7F3F = 0xE01E
-0x7F40 = 0xE01F
-0x7F41 = 0xE020
-0x7F42 = 0xE021
-0x7F43 = 0xE022
-0x7F44 = 0xE023
-0x7F45 = 0xE024
-0x7F46 = 0xE025
-0x7F47 = 0xE026
-0x7F48 = 0xE027
-0x7F49 = 0xE028
-0x7F4A = 0xE029
-0x7F4B = 0xE02A
-0x7F4C = 0xE02B
-0x7F4D = 0xE02C
-0x7F4E = 0xE02D
-0x7F4F = 0xE02E
-0x7F50 = 0xE02F
-0x7F51 = 0xE030
-0x7F52 = 0xE031
-0x7F53 = 0xE032
-0x7F54 = 0xE033
-0x7F55 = 0xE034
-0x7F56 = 0xE035
-0x7F57 = 0xE036
-0x7F58 = 0xE037
-0x7F59 = 0xE038
-0x7F5A = 0xE039
-0x7F5B = 0xE03A
-0x7F5C = 0xE03B
-0x7F5D = 0xE03C
-0x7F5E = 0xE03D
-0x7F5F = 0xE03E
-0x7F60 = 0xE03F
-0x7F61 = 0xE040
-0x7F62 = 0xE041
-0x7F63 = 0xE042
-0x7F64 = 0xE043
-0x7F65 = 0xE044
-0x7F66 = 0xE045
-0x7F67 = 0xE046
-0x7F68 = 0xE047
-0x7F69 = 0xE048
-0x7F6A = 0xE049
-0x7F6B = 0xE04A
-0x7F6C = 0xE04B
-0x7F6D = 0xE04C
-0x7F6E = 0xE04D
-0x7F6F = 0xE04E
-0x7F70 = 0xE04F
-0x7F71 = 0xE050
-0x7F72 = 0xE051
-0x7F73 = 0xE052
-0x7F74 = 0xE053
-0x7F75 = 0xE054
-0x7F76 = 0xE055
-0x7F77 = 0xE056
-0x7F78 = 0xE057
-0x7F79 = 0xE058
-0x7F7A = 0xE059
-0x7F7B = 0xE05A
-0x7F7C = 0xE05B
-0x7F7D = 0xE05C
-0x7F7E = 0xE05D
-0x8021 = 0xE05E
-0x8022 = 0xE05F
-0x8023 = 0xE060
-0x8024 = 0xE061
-0x8025 = 0xE062
-0x8026 = 0xE063
-0x8027 = 0xE064
-0x8028 = 0xE065
-0x8029 = 0xE066
-0x802A = 0xE067
-0x802B = 0xE068
-0x802C = 0xE069
-0x802D = 0xE06A
-0x802E = 0xE06B
-0x802F = 0xE06C
-0x8030 = 0xE06D
-0x8031 = 0xE06E
-0x8032 = 0xE06F
-0x8033 = 0xE070
-0x8034 = 0xE071
-0x8035 = 0xE072
-0x8036 = 0xE073
-0x8037 = 0xE074
-0x8038 = 0xE075
-0x8039 = 0xE076
-0x803A = 0xE077
-0x803B = 0xE078
-0x803C = 0xE079
-0x803D = 0xE07A
-0x803E = 0xE07B
-0x803F = 0xE07C
-0x8040 = 0xE07D
-0x8041 = 0xE07E
-0x8042 = 0xE07F
-0x8043 = 0xE080
-0x8044 = 0xE081
-0x8045 = 0xE082
-0x8046 = 0xE083
-0x8047 = 0xE084
-0x8048 = 0xE085
-0x8049 = 0xE086
-0x804A = 0xE087
-0x804B = 0xE088
-0x804C = 0xE089
-0x804D = 0xE08A
-0x804E = 0xE08B
-0x804F = 0xE08C
-0x8050 = 0xE08D
-0x8051 = 0xE08E
-0x8052 = 0xE08F
-0x8053 = 0xE090
-0x8054 = 0xE091
-0x8055 = 0xE092
-0x8056 = 0xE093
-0x8057 = 0xE094
-0x8058 = 0xE095
-0x8059 = 0xE096
-0x805A = 0xE097
-0x805B = 0xE098
-0x805C = 0xE099
-0x805D = 0xE09A
-0x805E = 0xE09B
-0x805F = 0xE09C
-0x8060 = 0xE09D
-0x8061 = 0xE09E
-0x8062 = 0xE09F
-0x8063 = 0xE0A0
-0x8064 = 0xE0A1
-0x8065 = 0xE0A2
-0x8066 = 0xE0A3
-0x8067 = 0xE0A4
-0x8068 = 0xE0A5
-0x8069 = 0xE0A6
-0x806A = 0xE0A7
-0x806B = 0xE0A8
-0x806C = 0xE0A9
-0x806D = 0xE0AA
-0x806E = 0xE0AB
-0x806F = 0xE0AC
-0x8070 = 0xE0AD
-0x8071 = 0xE0AE
-0x8072 = 0xE0AF
-0x8073 = 0xE0B0
-0x8074 = 0xE0B1
-0x8075 = 0xE0B2
-0x8076 = 0xE0B3
-0x8077 = 0xE0B4
-0x8078 = 0xE0B5
-0x8079 = 0xE0B6
-0x807A = 0xE0B7
-0x807B = 0xE0B8
-0x807C = 0xE0B9
-0x807D = 0xE0BA
-0x807E = 0xE0BB
-0x8121 = 0xE0BC
-0x8122 = 0xE0BD
-0x8123 = 0xE0BE
-0x8124 = 0xE0BF
-0x8125 = 0xE0C0
-0x8126 = 0xE0C1
-0x8127 = 0xE0C2
-0x8128 = 0xE0C3
-0x8129 = 0xE0C4
-0x812A = 0xE0C5
-0x812B = 0xE0C6
-0x812C = 0xE0C7
-0x812D = 0xE0C8
-0x812E = 0xE0C9
-0x812F = 0xE0CA
-0x8130 = 0xE0CB
-0x8131 = 0xE0CC
-0x8132 = 0xE0CD
-0x8133 = 0xE0CE
-0x8134 = 0xE0CF
-0x8135 = 0xE0D0
-0x8136 = 0xE0D1
-0x8137 = 0xE0D2
-0x8138 = 0xE0D3
-0x8139 = 0xE0D4
-0x813A = 0xE0D5
-0x813B = 0xE0D6
-0x813C = 0xE0D7
-0x813D = 0xE0D8
-0x813E = 0xE0D9
-0x813F = 0xE0DA
-0x8140 = 0xE0DB
-0x8141 = 0xE0DC
-0x8142 = 0xE0DD
-0x8143 = 0xE0DE
-0x8144 = 0xE0DF
-0x8145 = 0xE0E0
-0x8146 = 0xE0E1
-0x8147 = 0xE0E2
-0x8148 = 0xE0E3
-0x8149 = 0xE0E4
-0x814A = 0xE0E5
-0x814B = 0xE0E6
-0x814C = 0xE0E7
-0x814D = 0xE0E8
-0x814E = 0xE0E9
-0x814F = 0xE0EA
-0x8150 = 0xE0EB
-0x8151 = 0xE0EC
-0x8152 = 0xE0ED
-0x8153 = 0xE0EE
-0x8154 = 0xE0EF
-0x8155 = 0xE0F0
-0x8156 = 0xE0F1
-0x8157 = 0xE0F2
-0x8158 = 0xE0F3
-0x8159 = 0xE0F4
-0x815A = 0xE0F5
-0x815B = 0xE0F6
-0x815C = 0xE0F7
-0x815D = 0xE0F8
-0x815E = 0xE0F9
-0x815F = 0xE0FA
-0x8160 = 0xE0FB
-0x8161 = 0xE0FC
-0x8162 = 0xE0FD
-0x8163 = 0xE0FE
-0x8164 = 0xE0FF
-0x8165 = 0xE100
-0x8166 = 0xE101
-0x8167 = 0xE102
-0x8168 = 0xE103
-0x8169 = 0xE104
-0x816A = 0xE105
-0x816B = 0xE106
-0x816C = 0xE107
-0x816D = 0xE108
-0x816E = 0xE109
-0x816F = 0xE10A
-0x8170 = 0xE10B
-0x8171 = 0xE10C
-0x8172 = 0xE10D
-0x8173 = 0xE10E
-0x8174 = 0xE10F
-0x8175 = 0xE110
-0x8176 = 0xE111
-0x8177 = 0xE112
-0x8178 = 0xE113
-0x8179 = 0xE114
-0x817A = 0xE115
-0x817B = 0xE116
-0x817C = 0xE117
-0x817D = 0xE118
-0x817E = 0xE119
-0x8221 = 0xE11A
-0x8222 = 0xE11B
-0x8223 = 0xE11C
-0x8224 = 0xE11D
-0x8225 = 0xE11E
-0x8226 = 0xE11F
-0x8227 = 0xE120
-0x8228 = 0xE121
-0x8229 = 0xE122
-0x822A = 0xE123
-0x822B = 0xE124
-0x822C = 0xE125
-0x822D = 0xE126
-0x822E = 0xE127
-0x822F = 0xE128
-0x8230 = 0xE129
-0x8231 = 0xE12A
-0x8232 = 0xE12B
-0x8233 = 0xE12C
-0x8234 = 0xE12D
-0x8235 = 0xE12E
-0x8236 = 0xE12F
-0x8237 = 0xE130
-0x8238 = 0xE131
-0x8239 = 0xE132
-0x823A = 0xE133
-0x823B = 0xE134
-0x823C = 0xE135
-0x823D = 0xE136
-0x823E = 0xE137
-0x823F = 0xE138
-0x8240 = 0xE139
-0x8241 = 0xE13A
-0x8242 = 0xE13B
-0x8243 = 0xE13C
-0x8244 = 0xE13D
-0x8245 = 0xE13E
-0x8246 = 0xE13F
-0x8247 = 0xE140
-0x8248 = 0xE141
-0x8249 = 0xE142
-0x824A = 0xE143
-0x824B = 0xE144
-0x824C = 0xE145
-0x824D = 0xE146
-0x824E = 0xE147
-0x824F = 0xE148
-0x8250 = 0xE149
-0x8251 = 0xE14A
-0x8252 = 0xE14B
-0x8253 = 0xE14C
-0x8254 = 0xE14D
-0x8255 = 0xE14E
-0x8256 = 0xE14F
-0x8257 = 0xE150
-0x8258 = 0xE151
-0x8259 = 0xE152
-0x825A = 0xE153
-0x825B = 0xE154
-0x825C = 0xE155
-0x825D = 0xE156
-0x825E = 0xE157
-0x825F = 0xE158
-0x8260 = 0xE159
-0x8261 = 0xE15A
-0x8262 = 0xE15B
-0x8263 = 0xE15C
-0x8264 = 0xE15D
-0x8265 = 0xE15E
-0x8266 = 0xE15F
-0x8267 = 0xE160
-0x8268 = 0xE161
-0x8269 = 0xE162
-0x826A = 0xE163
-0x826B = 0xE164
-0x826C = 0xE165
-0x826D = 0xE166
-0x826E = 0xE167
-0x826F = 0xE168
-0x8270 = 0xE169
-0x8271 = 0xE16A
-0x8272 = 0xE16B
-0x8273 = 0xE16C
-0x8274 = 0xE16D
-0x8275 = 0xE16E
-0x8276 = 0xE16F
-0x8277 = 0xE170
-0x8278 = 0xE171
-0x8279 = 0xE172
-0x827A = 0xE173
-0x827B = 0xE174
-0x827C = 0xE175
-0x827D = 0xE176
-0x827E = 0xE177
-0x8321 = 0xE178
-0x8322 = 0xE179
-0x8323 = 0xE17A
-0x8324 = 0xE17B
-0x8325 = 0xE17C
-0x8326 = 0xE17D
-0x8327 = 0xE17E
-0x8328 = 0xE17F
-0x8329 = 0xE180
-0x832A = 0xE181
-0x832B = 0xE182
-0x832C = 0xE183
-0x832D = 0xE184
-0x832E = 0xE185
-0x832F = 0xE186
-0x8330 = 0xE187
-0x8331 = 0xE188
-0x8332 = 0xE189
-0x8333 = 0xE18A
-0x8334 = 0xE18B
-0x8335 = 0xE18C
-0x8336 = 0xE18D
-0x8337 = 0xE18E
-0x8338 = 0xE18F
-0x8339 = 0xE190
-0x833A = 0xE191
-0x833B = 0xE192
-0x833C = 0xE193
-0x833D = 0xE194
-0x833E = 0xE195
-0x833F = 0xE196
-0x8340 = 0xE197
-0x8341 = 0xE198
-0x8342 = 0xE199
-0x8343 = 0xE19A
-0x8344 = 0xE19B
-0x8345 = 0xE19C
-0x8346 = 0xE19D
-0x8347 = 0xE19E
-0x8348 = 0xE19F
-0x8349 = 0xE1A0
-0x834A = 0xE1A1
-0x834B = 0xE1A2
-0x834C = 0xE1A3
-0x834D = 0xE1A4
-0x834E = 0xE1A5
-0x834F = 0xE1A6
-0x8350 = 0xE1A7
-0x8351 = 0xE1A8
-0x8352 = 0xE1A9
-0x8353 = 0xE1AA
-0x8354 = 0xE1AB
-0x8355 = 0xE1AC
-0x8356 = 0xE1AD
-0x8357 = 0xE1AE
-0x8358 = 0xE1AF
-0x8359 = 0xE1B0
-0x835A = 0xE1B1
-0x835B = 0xE1B2
-0x835C = 0xE1B3
-0x835D = 0xE1B4
-0x835E = 0xE1B5
-0x835F = 0xE1B6
-0x8360 = 0xE1B7
-0x8361 = 0xE1B8
-0x8362 = 0xE1B9
-0x8363 = 0xE1BA
-0x8364 = 0xE1BB
-0x8365 = 0xE1BC
-0x8366 = 0xE1BD
-0x8367 = 0xE1BE
-0x8368 = 0xE1BF
-0x8369 = 0xE1C0
-0x836A = 0xE1C1
-0x836B = 0xE1C2
-0x836C = 0xE1C3
-0x836D = 0xE1C4
-0x836E = 0xE1C5
-0x836F = 0xE1C6
-0x8370 = 0xE1C7
-0x8371 = 0xE1C8
-0x8372 = 0xE1C9
-0x8373 = 0xE1CA
-0x8374 = 0xE1CB
-0x8375 = 0xE1CC
-0x8376 = 0xE1CD
-0x8377 = 0xE1CE
-0x8378 = 0xE1CF
-0x8379 = 0xE1D0
-0x837A = 0xE1D1
-0x837B = 0xE1D2
-0x837C = 0xE1D3
-0x837D = 0xE1D4
-0x837E = 0xE1D5
-0x8421 = 0xE1D6
-0x8422 = 0xE1D7
-0x8423 = 0xE1D8
-0x8424 = 0xE1D9
-0x8425 = 0xE1DA
-0x8426 = 0xE1DB
-0x8427 = 0xE1DC
-0x8428 = 0xE1DD
-0x8429 = 0xE1DE
-0x842A = 0xE1DF
-0x842B = 0xE1E0
-0x842C = 0xE1E1
-0x842D = 0xE1E2
-0x842E = 0xE1E3
-0x842F = 0xE1E4
-0x8430 = 0xE1E5
-0x8431 = 0xE1E6
-0x8432 = 0xE1E7
-0x8433 = 0xE1E8
-0x8434 = 0xE1E9
-0x8435 = 0xE1EA
-0x8436 = 0xE1EB
-0x8437 = 0xE1EC
-0x8438 = 0xE1ED
-0x8439 = 0xE1EE
-0x843A = 0xE1EF
-0x843B = 0xE1F0
-0x843C = 0xE1F1
-0x843D = 0xE1F2
-0x843E = 0xE1F3
-0x843F = 0xE1F4
-0x8440 = 0xE1F5
-0x8441 = 0xE1F6
-0x8442 = 0xE1F7
-0x8443 = 0xE1F8
-0x8444 = 0xE1F9
-0x8445 = 0xE1FA
-0x8446 = 0xE1FB
-0x8447 = 0xE1FC
-0x8448 = 0xE1FD
-0x8449 = 0xE1FE
-0x844A = 0xE1FF
-0x844B = 0xE200
-0x844C = 0xE201
-0x844D = 0xE202
-0x844E = 0xE203
-0x844F = 0xE204
-0x8450 = 0xE205
-0x8451 = 0xE206
-0x8452 = 0xE207
-0x8453 = 0xE208
-0x8454 = 0xE209
-0x8455 = 0xE20A
-0x8456 = 0xE20B
-0x8457 = 0xE20C
-0x8458 = 0xE20D
-0x8459 = 0xE20E
-0x845A = 0xE20F
-0x845B = 0xE210
-0x845C = 0xE211
-0x845D = 0xE212
-0x845E = 0xE213
-0x845F = 0xE214
-0x8460 = 0xE215
-0x8461 = 0xE216
-0x8462 = 0xE217
-0x8463 = 0xE218
-0x8464 = 0xE219
-0x8465 = 0xE21A
-0x8466 = 0xE21B
-0x8467 = 0xE21C
-0x8468 = 0xE21D
-0x8469 = 0xE21E
-0x846A = 0xE21F
-0x846B = 0xE220
-0x846C = 0xE221
-0x846D = 0xE222
-0x846E = 0xE223
-0x846F = 0xE224
-0x8470 = 0xE225
-0x8471 = 0xE226
-0x8472 = 0xE227
-0x8473 = 0xE228
-0x8474 = 0xE229
-0x8475 = 0xE22A
-0x8476 = 0xE22B
-0x8477 = 0xE22C
-0x8478 = 0xE22D
-0x8479 = 0xE22E
-0x847A = 0xE22F
-0x847B = 0xE230
-0x847C = 0xE231
-0x847D = 0xE232
-0x847E = 0xE233
-0x8521 = 0xE234
-0x8522 = 0xE235
-0x8523 = 0xE236
-0x8524 = 0xE237
-0x8525 = 0xE238
-0x8526 = 0xE239
-0x8527 = 0xE23A
-0x8528 = 0xE23B
-0x8529 = 0xE23C
-0x852A = 0xE23D
-0x852B = 0xE23E
-0x852C = 0xE23F
-0x852D = 0xE240
-0x852E = 0xE241
-0x852F = 0xE242
-0x8530 = 0xE243
-0x8531 = 0xE244
-0x8532 = 0xE245
-0x8533 = 0xE246
-0x8534 = 0xE247
-0x8535 = 0xE248
-0x8536 = 0xE249
-0x8537 = 0xE24A
-0x8538 = 0xE24B
-0x8539 = 0xE24C
-0x853A = 0xE24D
-0x853B = 0xE24E
-0x853C = 0xE24F
-0x853D = 0xE250
-0x853E = 0xE251
-0x853F = 0xE252
-0x8540 = 0xE253
-0x8541 = 0xE254
-0x8542 = 0xE255
-0x8543 = 0xE256
-0x8544 = 0xE257
-0x8545 = 0xE258
-0x8546 = 0xE259
-0x8547 = 0xE25A
-0x8548 = 0xE25B
-0x8549 = 0xE25C
-0x854A = 0xE25D
-0x854B = 0xE25E
-0x854C = 0xE25F
-0x854D = 0xE260
-0x854E = 0xE261
-0x854F = 0xE262
-0x8550 = 0xE263
-0x8551 = 0xE264
-0x8552 = 0xE265
-0x8553 = 0xE266
-0x8554 = 0xE267
-0x8555 = 0xE268
-0x8556 = 0xE269
-0x8557 = 0xE26A
-0x8558 = 0xE26B
-0x8559 = 0xE26C
-0x855A = 0xE26D
-0x855B = 0xE26E
-0x855C = 0xE26F
-0x855D = 0xE270
-0x855E = 0xE271
-0x855F = 0xE272
-0x8560 = 0xE273
-0x8561 = 0xE274
-0x8562 = 0xE275
-0x8563 = 0xE276
-0x8564 = 0xE277
-0x8565 = 0xE278
-0x8566 = 0xE279
-0x8567 = 0xE27A
-0x8568 = 0xE27B
-0x8569 = 0xE27C
-0x856A = 0xE27D
-0x856B = 0xE27E
-0x856C = 0xE27F
-0x856D = 0xE280
-0x856E = 0xE281
-0x856F = 0xE282
-0x8570 = 0xE283
-0x8571 = 0xE284
-0x8572 = 0xE285
-0x8573 = 0xE286
-0x8574 = 0xE287
-0x8575 = 0xE288
-0x8576 = 0xE289
-0x8577 = 0xE28A
-0x8578 = 0xE28B
-0x8579 = 0xE28C
-0x857A = 0xE28D
-0x857B = 0xE28E
-0x857C = 0xE28F
-0x857D = 0xE290
-0x857E = 0xE291
-0x8621 = 0xE292
-0x8622 = 0xE293
-0x8623 = 0xE294
-0x8624 = 0xE295
-0x8625 = 0xE296
-0x8626 = 0xE297
-0x8627 = 0xE298
-0x8628 = 0xE299
-0x8629 = 0xE29A
-0x862A = 0xE29B
-0x862B = 0xE29C
-0x862C = 0xE29D
-0x862D = 0xE29E
-0x862E = 0xE29F
-0x862F = 0xE2A0
-0x8630 = 0xE2A1
-0x8631 = 0xE2A2
-0x8632 = 0xE2A3
-0x8633 = 0xE2A4
-0x8634 = 0xE2A5
-0x8635 = 0xE2A6
-0x8636 = 0xE2A7
-0x8637 = 0xE2A8
-0x8638 = 0xE2A9
-0x8639 = 0xE2AA
-0x863A = 0xE2AB
-0x863B = 0xE2AC
-0x863C = 0xE2AD
-0x863D = 0xE2AE
-0x863E = 0xE2AF
-0x863F = 0xE2B0
-0x8640 = 0xE2B1
-0x8641 = 0xE2B2
-0x8642 = 0xE2B3
-0x8643 = 0xE2B4
-0x8644 = 0xE2B5
-0x8645 = 0xE2B6
-0x8646 = 0xE2B7
-0x8647 = 0xE2B8
-0x8648 = 0xE2B9
-0x8649 = 0xE2BA
-0x864A = 0xE2BB
-0x864B = 0xE2BC
-0x864C = 0xE2BD
-0x864D = 0xE2BE
-0x864E = 0xE2BF
-0x864F = 0xE2C0
-0x8650 = 0xE2C1
-0x8651 = 0xE2C2
-0x8652 = 0xE2C3
-0x8653 = 0xE2C4
-0x8654 = 0xE2C5
-0x8655 = 0xE2C6
-0x8656 = 0xE2C7
-0x8657 = 0xE2C8
-0x8658 = 0xE2C9
-0x8659 = 0xE2CA
-0x865A = 0xE2CB
-0x865B = 0xE2CC
-0x865C = 0xE2CD
-0x865D = 0xE2CE
-0x865E = 0xE2CF
-0x865F = 0xE2D0
-0x8660 = 0xE2D1
-0x8661 = 0xE2D2
-0x8662 = 0xE2D3
-0x8663 = 0xE2D4
-0x8664 = 0xE2D5
-0x8665 = 0xE2D6
-0x8666 = 0xE2D7
-0x8667 = 0xE2D8
-0x8668 = 0xE2D9
-0x8669 = 0xE2DA
-0x866A = 0xE2DB
-0x866B = 0xE2DC
-0x866C = 0xE2DD
-0x866D = 0xE2DE
-0x866E = 0xE2DF
-0x866F = 0xE2E0
-0x8670 = 0xE2E1
-0x8671 = 0xE2E2
-0x8672 = 0xE2E3
-0x8673 = 0xE2E4
-0x8674 = 0xE2E5
-0x8675 = 0xE2E6
-0x8676 = 0xE2E7
-0x8677 = 0xE2E8
-0x8678 = 0xE2E9
-0x8679 = 0xE2EA
-0x867A = 0xE2EB
-0x867B = 0xE2EC
-0x867C = 0xE2ED
-0x867D = 0xE2EE
-0x867E = 0xE2EF
-0x8721 = 0xE2F0
-0x8722 = 0xE2F1
-0x8723 = 0xE2F2
-0x8724 = 0xE2F3
-0x8725 = 0xE2F4
-0x8726 = 0xE2F5
-0x8727 = 0xE2F6
-0x8728 = 0xE2F7
-0x8729 = 0xE2F8
-0x872A = 0xE2F9
-0x872B = 0xE2FA
-0x872C = 0xE2FB
-0x872D = 0xE2FC
-0x872E = 0xE2FD
-0x872F = 0xE2FE
-0x8730 = 0xE2FF
-0x8731 = 0xE300
-0x8732 = 0xE301
-0x8733 = 0xE302
-0x8734 = 0xE303
-0x8735 = 0xE304
-0x8736 = 0xE305
-0x8737 = 0xE306
-0x8738 = 0xE307
-0x8739 = 0xE308
-0x873A = 0xE309
-0x873B = 0xE30A
-0x873C = 0xE30B
-0x873D = 0xE30C
-0x873E = 0xE30D
-0x873F = 0xE30E
-0x8740 = 0xE30F
-0x8741 = 0xE310
-0x8742 = 0xE311
-0x8743 = 0xE312
-0x8744 = 0xE313
-0x8745 = 0xE314
-0x8746 = 0xE315
-0x8747 = 0xE316
-0x8748 = 0xE317
-0x8749 = 0xE318
-0x874A = 0xE319
-0x874B = 0xE31A
-0x874C = 0xE31B
-0x874D = 0xE31C
-0x874E = 0xE31D
-0x874F = 0xE31E
-0x8750 = 0xE31F
-0x8751 = 0xE320
-0x8752 = 0xE321
-0x8753 = 0xE322
-0x8754 = 0xE323
-0x8755 = 0xE324
-0x8756 = 0xE325
-0x8757 = 0xE326
-0x8758 = 0xE327
-0x8759 = 0xE328
-0x875A = 0xE329
-0x875B = 0xE32A
-0x875C = 0xE32B
-0x875D = 0xE32C
-0x875E = 0xE32D
-0x875F = 0xE32E
-0x8760 = 0xE32F
-0x8761 = 0xE330
-0x8762 = 0xE331
-0x8763 = 0xE332
-0x8764 = 0xE333
-0x8765 = 0xE334
-0x8766 = 0xE335
-0x8767 = 0xE336
-0x8768 = 0xE337
-0x8769 = 0xE338
-0x876A = 0xE339
-0x876B = 0xE33A
-0x876C = 0xE33B
-0x876D = 0xE33C
-0x876E = 0xE33D
-0x876F = 0xE33E
-0x8770 = 0xE33F
-0x8771 = 0xE340
-0x8772 = 0xE341
-0x8773 = 0xE342
-0x8774 = 0xE343
-0x8775 = 0xE344
-0x8776 = 0xE345
-0x8777 = 0xE346
-0x8778 = 0xE347
-0x8779 = 0xE348
-0x877A = 0xE349
-0x877B = 0xE34A
-0x877C = 0xE34B
-0x877D = 0xE34C
-0x877E = 0xE34D
-0x8821 = 0xE34E
-0x8822 = 0xE34F
-0x8823 = 0xE350
-0x8824 = 0xE351
-0x8825 = 0xE352
-0x8826 = 0xE353
-0x8827 = 0xE354
-0x8828 = 0xE355
-0x8829 = 0xE356
-0x882A = 0xE357
-0x882B = 0xE358
-0x882C = 0xE359
-0x882D = 0xE35A
-0x882E = 0xE35B
-0x882F = 0xE35C
-0x8830 = 0xE35D
-0x8831 = 0xE35E
-0x8832 = 0xE35F
-0x8833 = 0xE360
-0x8834 = 0xE361
-0x8835 = 0xE362
-0x8836 = 0xE363
-0x8837 = 0xE364
-0x8838 = 0xE365
-0x8839 = 0xE366
-0x883A = 0xE367
-0x883B = 0xE368
-0x883C = 0xE369
-0x883D = 0xE36A
-0x883E = 0xE36B
-0x883F = 0xE36C
-0x8840 = 0xE36D
-0x8841 = 0xE36E
-0x8842 = 0xE36F
-0x8843 = 0xE370
-0x8844 = 0xE371
-0x8845 = 0xE372
-0x8846 = 0xE373
-0x8847 = 0xE374
-0x8848 = 0xE375
-0x8849 = 0xE376
-0x884A = 0xE377
-0x884B = 0xE378
-0x884C = 0xE379
-0x884D = 0xE37A
-0x884E = 0xE37B
-0x884F = 0xE37C
-0x8850 = 0xE37D
-0x8851 = 0xE37E
-0x8852 = 0xE37F
-0x8853 = 0xE380
-0x8854 = 0xE381
-0x8855 = 0xE382
-0x8856 = 0xE383
-0x8857 = 0xE384
-0x8858 = 0xE385
-0x8859 = 0xE386
-0x885A = 0xE387
-0x885B = 0xE388
-0x885C = 0xE389
-0x885D = 0xE38A
-0x885E = 0xE38B
-0x885F = 0xE38C
-0x8860 = 0xE38D
-0x8861 = 0xE38E
-0x8862 = 0xE38F
-0x8863 = 0xE390
-0x8864 = 0xE391
-0x8865 = 0xE392
-0x8866 = 0xE393
-0x8867 = 0xE394
-0x8868 = 0xE395
-0x8869 = 0xE396
-0x886A = 0xE397
-0x886B = 0xE398
-0x886C = 0xE399
-0x886D = 0xE39A
-0x886E = 0xE39B
-0x886F = 0xE39C
-0x8870 = 0xE39D
-0x8871 = 0xE39E
-0x8872 = 0xE39F
-0x8873 = 0xE3A0
-0x8874 = 0xE3A1
-0x8875 = 0xE3A2
-0x8876 = 0xE3A3
-0x8877 = 0xE3A4
-0x8878 = 0xE3A5
-0x8879 = 0xE3A6
-0x887A = 0xE3A7
-0x887B = 0xE3A8
-0x887C = 0xE3A9
-0x887D = 0xE3AA
-0x887E = 0xE3AB
-0x8921 = 0xE3AC
-0x8922 = 0xE3AD
-0x8923 = 0xE3AE
-0x8924 = 0xE3AF
-0x8925 = 0xE3B0
-0x8926 = 0xE3B1
-0x8927 = 0xE3B2
-0x8928 = 0xE3B3
-0x8929 = 0xE3B4
-0x892A = 0xE3B5
-0x892B = 0xE3B6
-0x892C = 0xE3B7
-0x892D = 0xE3B8
-0x892E = 0xE3B9
-0x892F = 0xE3BA
-0x8930 = 0xE3BB
-0x8931 = 0xE3BC
-0x8932 = 0xE3BD
-0x8933 = 0xE3BE
-0x8934 = 0xE3BF
-0x8935 = 0xE3C0
-0x8936 = 0xE3C1
-0x8937 = 0xE3C2
-0x8938 = 0xE3C3
-0x8939 = 0xE3C4
-0x893A = 0xE3C5
-0x893B = 0xE3C6
-0x893C = 0xE3C7
-0x893D = 0xE3C8
-0x893E = 0xE3C9
-0x893F = 0xE3CA
-0x8940 = 0xE3CB
-0x8941 = 0xE3CC
-0x8942 = 0xE3CD
-0x8943 = 0xE3CE
-0x8944 = 0xE3CF
-0x8945 = 0xE3D0
-0x8946 = 0xE3D1
-0x8947 = 0xE3D2
-0x8948 = 0xE3D3
-0x8949 = 0xE3D4
-0x894A = 0xE3D5
-0x894B = 0xE3D6
-0x894C = 0xE3D7
-0x894D = 0xE3D8
-0x894E = 0xE3D9
-0x894F = 0xE3DA
-0x8950 = 0xE3DB
-0x8951 = 0xE3DC
-0x8952 = 0xE3DD
-0x8953 = 0xE3DE
-0x8954 = 0xE3DF
-0x8955 = 0xE3E0
-0x8956 = 0xE3E1
-0x8957 = 0xE3E2
-0x8958 = 0xE3E3
-0x8959 = 0xE3E4
-0x895A = 0xE3E5
-0x895B = 0xE3E6
-0x895C = 0xE3E7
-0x895D = 0xE3E8
-0x895E = 0xE3E9
-0x895F = 0xE3EA
-0x8960 = 0xE3EB
-0x8961 = 0xE3EC
-0x8962 = 0xE3ED
-0x8963 = 0xE3EE
-0x8964 = 0xE3EF
-0x8965 = 0xE3F0
-0x8966 = 0xE3F1
-0x8967 = 0xE3F2
-0x8968 = 0xE3F3
-0x8969 = 0xE3F4
-0x896A = 0xE3F5
-0x896B = 0xE3F6
-0x896C = 0xE3F7
-0x896D = 0xE3F8
-0x896E = 0xE3F9
-0x896F = 0xE3FA
-0x8970 = 0xE3FB
-0x8971 = 0xE3FC
-0x8972 = 0xE3FD
-0x8973 = 0xE3FE
-0x8974 = 0xE3FF
-0x8975 = 0xE400
-0x8976 = 0xE401
-0x8977 = 0xE402
-0x8978 = 0xE403
-0x8979 = 0xE404
-0x897A = 0xE405
-0x897B = 0xE406
-0x897C = 0xE407
-0x897D = 0xE408
-0x897E = 0xE409
-0x8A21 = 0xE40A
-0x8A22 = 0xE40B
-0x8A23 = 0xE40C
-0x8A24 = 0xE40D
-0x8A25 = 0xE40E
-0x8A26 = 0xE40F
-0x8A27 = 0xE410
-0x8A28 = 0xE411
-0x8A29 = 0xE412
-0x8A2A = 0xE413
-0x8A2B = 0xE414
-0x8A2C = 0xE415
-0x8A2D = 0xE416
-0x8A2E = 0xE417
-0x8A2F = 0xE418
-0x8A30 = 0xE419
-0x8A31 = 0xE41A
-0x8A32 = 0xE41B
-0x8A33 = 0xE41C
-0x8A34 = 0xE41D
-0x8A35 = 0xE41E
-0x8A36 = 0xE41F
-0x8A37 = 0xE420
-0x8A38 = 0xE421
-0x8A39 = 0xE422
-0x8A3A = 0xE423
-0x8A3B = 0xE424
-0x8A3C = 0xE425
-0x8A3D = 0xE426
-0x8A3E = 0xE427
-0x8A3F = 0xE428
-0x8A40 = 0xE429
-0x8A41 = 0xE42A
-0x8A42 = 0xE42B
-0x8A43 = 0xE42C
-0x8A44 = 0xE42D
-0x8A45 = 0xE42E
-0x8A46 = 0xE42F
-0x8A47 = 0xE430
-0x8A48 = 0xE431
-0x8A49 = 0xE432
-0x8A4A = 0xE433
-0x8A4B = 0xE434
-0x8A4C = 0xE435
-0x8A4D = 0xE436
-0x8A4E = 0xE437
-0x8A4F = 0xE438
-0x8A50 = 0xE439
-0x8A51 = 0xE43A
-0x8A52 = 0xE43B
-0x8A53 = 0xE43C
-0x8A54 = 0xE43D
-0x8A55 = 0xE43E
-0x8A56 = 0xE43F
-0x8A57 = 0xE440
-0x8A58 = 0xE441
-0x8A59 = 0xE442
-0x8A5A = 0xE443
-0x8A5B = 0xE444
-0x8A5C = 0xE445
-0x8A5D = 0xE446
-0x8A5E = 0xE447
-0x8A5F = 0xE448
-0x8A60 = 0xE449
-0x8A61 = 0xE44A
-0x8A62 = 0xE44B
-0x8A63 = 0xE44C
-0x8A64 = 0xE44D
-0x8A65 = 0xE44E
-0x8A66 = 0xE44F
-0x8A67 = 0xE450
-0x8A68 = 0xE451
-0x8A69 = 0xE452
-0x8A6A = 0xE453
-0x8A6B = 0xE454
-0x8A6C = 0xE455
-0x8A6D = 0xE456
-0x8A6E = 0xE457
-0x8A6F = 0xE458
-0x8A70 = 0xE459
-0x8A71 = 0xE45A
-0x8A72 = 0xE45B
-0x8A73 = 0xE45C
-0x8A74 = 0xE45D
-0x8A75 = 0xE45E
-0x8A76 = 0xE45F
-0x8A77 = 0xE460
-0x8A78 = 0xE461
-0x8A79 = 0xE462
-0x8A7A = 0xE463
-0x8A7B = 0xE464
-0x8A7C = 0xE465
-0x8A7D = 0xE466
-0x8A7E = 0xE467
-0x8B21 = 0xE468
-0x8B22 = 0xE469
-0x8B23 = 0xE46A
-0x8B24 = 0xE46B
-0x8B25 = 0xE46C
-0x8B26 = 0xE46D
-0x8B27 = 0xE46E
-0x8B28 = 0xE46F
-0x8B29 = 0xE470
-0x8B2A = 0xE471
-0x8B2B = 0xE472
-0x8B2C = 0xE473
-0x8B2D = 0xE474
-0x8B2E = 0xE475
-0x8B2F = 0xE476
-0x8B30 = 0xE477
-0x8B31 = 0xE478
-0x8B32 = 0xE479
-0x8B33 = 0xE47A
-0x8B34 = 0xE47B
-0x8B35 = 0xE47C
-0x8B36 = 0xE47D
-0x8B37 = 0xE47E
-0x8B38 = 0xE47F
-0x8B39 = 0xE480
-0x8B3A = 0xE481
-0x8B3B = 0xE482
-0x8B3C = 0xE483
-0x8B3D = 0xE484
-0x8B3E = 0xE485
-0x8B3F = 0xE486
-0x8B40 = 0xE487
-0x8B41 = 0xE488
-0x8B42 = 0xE489
-0x8B43 = 0xE48A
-0x8B44 = 0xE48B
-0x8B45 = 0xE48C
-0x8B46 = 0xE48D
-0x8B47 = 0xE48E
-0x8B48 = 0xE48F
-0x8B49 = 0xE490
-0x8B4A = 0xE491
-0x8B4B = 0xE492
-0x8B4C = 0xE493
-0x8B4D = 0xE494
-0x8B4E = 0xE495
-0x8B4F = 0xE496
-0x8B50 = 0xE497
-0x8B51 = 0xE498
-0x8B52 = 0xE499
-0x8B53 = 0xE49A
-0x8B54 = 0xE49B
-0x8B55 = 0xE49C
-0x8B56 = 0xE49D
-0x8B57 = 0xE49E
-0x8B58 = 0xE49F
-0x8B59 = 0xE4A0
-0x8B5A = 0xE4A1
-0x8B5B = 0xE4A2
-0x8B5C = 0xE4A3
-0x8B5D = 0xE4A4
-0x8B5E = 0xE4A5
-0x8B5F = 0xE4A6
-0x8B60 = 0xE4A7
-0x8B61 = 0xE4A8
-0x8B62 = 0xE4A9
-0x8B63 = 0xE4AA
-0x8B64 = 0xE4AB
-0x8B65 = 0xE4AC
-0x8B66 = 0xE4AD
-0x8B67 = 0xE4AE
-0x8B68 = 0xE4AF
-0x8B69 = 0xE4B0
-0x8B6A = 0xE4B1
-0x8B6B = 0xE4B2
-0x8B6C = 0xE4B3
-0x8B6D = 0xE4B4
-0x8B6E = 0xE4B5
-0x8B6F = 0xE4B6
-0x8B70 = 0xE4B7
-0x8B71 = 0xE4B8
-0x8B72 = 0xE4B9
-0x8B73 = 0xE4BA
-0x8B74 = 0xE4BB
-0x8B75 = 0xE4BC
-0x8B76 = 0xE4BD
-0x8B77 = 0xE4BE
-0x8B78 = 0xE4BF
-0x8B79 = 0xE4C0
-0x8B7A = 0xE4C1
-0x8B7B = 0xE4C2
-0x8B7C = 0xE4C3
-0x8B7D = 0xE4C4
-0x8B7E = 0xE4C5
-0x8C21 = 0xE4C6
-0x8C22 = 0xE4C7
-0x8C23 = 0xE4C8
-0x8C24 = 0xE4C9
-0x8C25 = 0xE4CA
-0x8C26 = 0xE4CB
-0x8C27 = 0xE4CC
-0x8C28 = 0xE4CD
-0x8C29 = 0xE4CE
-0x8C2A = 0xE4CF
-0x8C2B = 0xE4D0
-0x8C2C = 0xE4D1
-0x8C2D = 0xE4D2
-0x8C2E = 0xE4D3
-0x8C2F = 0xE4D4
-0x8C30 = 0xE4D5
-0x8C31 = 0xE4D6
-0x8C32 = 0xE4D7
-0x8C33 = 0xE4D8
-0x8C34 = 0xE4D9
-0x8C35 = 0xE4DA
-0x8C36 = 0xE4DB
-0x8C37 = 0xE4DC
-0x8C38 = 0xE4DD
-0x8C39 = 0xE4DE
-0x8C3A = 0xE4DF
-0x8C3B = 0xE4E0
-0x8C3C = 0xE4E1
-0x8C3D = 0xE4E2
-0x8C3E = 0xE4E3
-0x8C3F = 0xE4E4
-0x8C40 = 0xE4E5
-0x8C41 = 0xE4E6
-0x8C42 = 0xE4E7
-0x8C43 = 0xE4E8
-0x8C44 = 0xE4E9
-0x8C45 = 0xE4EA
-0x8C46 = 0xE4EB
-0x8C47 = 0xE4EC
-0x8C48 = 0xE4ED
-0x8C49 = 0xE4EE
-0x8C4A = 0xE4EF
-0x8C4B = 0xE4F0
-0x8C4C = 0xE4F1
-0x8C4D = 0xE4F2
-0x8C4E = 0xE4F3
-0x8C4F = 0xE4F4
-0x8C50 = 0xE4F5
-0x8C51 = 0xE4F6
-0x8C52 = 0xE4F7
-0x8C53 = 0xE4F8
-0x8C54 = 0xE4F9
-0x8C55 = 0xE4FA
-0x8C56 = 0xE4FB
-0x8C57 = 0xE4FC
-0x8C58 = 0xE4FD
-0x8C59 = 0xE4FE
-0x8C5A = 0xE4FF
-0x8C5B = 0xE500
-0x8C5C = 0xE501
-0x8C5D = 0xE502
-0x8C5E = 0xE503
-0x8C5F = 0xE504
-0x8C60 = 0xE505
-0x8C61 = 0xE506
-0x8C62 = 0xE507
-0x8C63 = 0xE508
-0x8C64 = 0xE509
-0x8C65 = 0xE50A
-0x8C66 = 0xE50B
-0x8C67 = 0xE50C
-0x8C68 = 0xE50D
-0x8C69 = 0xE50E
-0x8C6A = 0xE50F
-0x8C6B = 0xE510
-0x8C6C = 0xE511
-0x8C6D = 0xE512
-0x8C6E = 0xE513
-0x8C6F = 0xE514
-0x8C70 = 0xE515
-0x8C71 = 0xE516
-0x8C72 = 0xE517
-0x8C73 = 0xE518
-0x8C74 = 0xE519
-0x8C75 = 0xE51A
-0x8C76 = 0xE51B
-0x8C77 = 0xE51C
-0x8C78 = 0xE51D
-0x8C79 = 0xE51E
-0x8C7A = 0xE51F
-0x8C7B = 0xE520
-0x8C7C = 0xE521
-0x8C7D = 0xE522
-0x8C7E = 0xE523
-0x8D21 = 0xE524
-0x8D22 = 0xE525
-0x8D23 = 0xE526
-0x8D24 = 0xE527
-0x8D25 = 0xE528
-0x8D26 = 0xE529
-0x8D27 = 0xE52A
-0x8D28 = 0xE52B
-0x8D29 = 0xE52C
-0x8D2A = 0xE52D
-0x8D2B = 0xE52E
-0x8D2C = 0xE52F
-0x8D2D = 0xE530
-0x8D2E = 0xE531
-0x8D2F = 0xE532
-0x8D30 = 0xE533
-0x8D31 = 0xE534
-0x8D32 = 0xE535
-0x8D33 = 0xE536
-0x8D34 = 0xE537
-0x8D35 = 0xE538
-0x8D36 = 0xE539
-0x8D37 = 0xE53A
-0x8D38 = 0xE53B
-0x8D39 = 0xE53C
-0x8D3A = 0xE53D
-0x8D3B = 0xE53E
-0x8D3C = 0xE53F
-0x8D3D = 0xE540
-0x8D3E = 0xE541
-0x8D3F = 0xE542
-0x8D40 = 0xE543
-0x8D41 = 0xE544
-0x8D42 = 0xE545
-0x8D43 = 0xE546
-0x8D44 = 0xE547
-0x8D45 = 0xE548
-0x8D46 = 0xE549
-0x8D47 = 0xE54A
-0x8D48 = 0xE54B
-0x8D49 = 0xE54C
-0x8D4A = 0xE54D
-0x8D4B = 0xE54E
-0x8D4C = 0xE54F
-0x8D4D = 0xE550
-0x8D4E = 0xE551
-0x8D4F = 0xE552
-0x8D50 = 0xE553
-0x8D51 = 0xE554
-0x8D52 = 0xE555
-0x8D53 = 0xE556
-0x8D54 = 0xE557
-0x8D55 = 0xE558
-0x8D56 = 0xE559
-0x8D57 = 0xE55A
-0x8D58 = 0xE55B
-0x8D59 = 0xE55C
-0x8D5A = 0xE55D
-0x8D5B = 0xE55E
-0x8D5C = 0xE55F
-0x8D5D = 0xE560
-0x8D5E = 0xE561
-0x8D5F = 0xE562
-0x8D60 = 0xE563
-0x8D61 = 0xE564
-0x8D62 = 0xE565
-0x8D63 = 0xE566
-0x8D64 = 0xE567
-0x8D65 = 0xE568
-0x8D66 = 0xE569
-0x8D67 = 0xE56A
-0x8D68 = 0xE56B
-0x8D69 = 0xE56C
-0x8D6A = 0xE56D
-0x8D6B = 0xE56E
-0x8D6C = 0xE56F
-0x8D6D = 0xE570
-0x8D6E = 0xE571
-0x8D6F = 0xE572
-0x8D70 = 0xE573
-0x8D71 = 0xE574
-0x8D72 = 0xE575
-0x8D73 = 0xE576
-0x8D74 = 0xE577
-0x8D75 = 0xE578
-0x8D76 = 0xE579
-0x8D77 = 0xE57A
-0x8D78 = 0xE57B
-0x8D79 = 0xE57C
-0x8D7A = 0xE57D
-0x8D7B = 0xE57E
-0x8D7C = 0xE57F
-0x8D7D = 0xE580
-0x8D7E = 0xE581
-0x8E21 = 0xE582
-0x8E22 = 0xE583
-0x8E23 = 0xE584
-0x8E24 = 0xE585
-0x8E25 = 0xE586
-0x8E26 = 0xE587
-0x8E27 = 0xE588
-0x8E28 = 0xE589
-0x8E29 = 0xE58A
-0x8E2A = 0xE58B
-0x8E2B = 0xE58C
-0x8E2C = 0xE58D
-0x8E2D = 0xE58E
-0x8E2E = 0xE58F
-0x8E2F = 0xE590
-0x8E30 = 0xE591
-0x8E31 = 0xE592
-0x8E32 = 0xE593
-0x8E33 = 0xE594
-0x8E34 = 0xE595
-0x8E35 = 0xE596
-0x8E36 = 0xE597
-0x8E37 = 0xE598
-0x8E38 = 0xE599
-0x8E39 = 0xE59A
-0x8E3A = 0xE59B
-0x8E3B = 0xE59C
-0x8E3C = 0xE59D
-0x8E3D = 0xE59E
-0x8E3E = 0xE59F
-0x8E3F = 0xE5A0
-0x8E40 = 0xE5A1
-0x8E41 = 0xE5A2
-0x8E42 = 0xE5A3
-0x8E43 = 0xE5A4
-0x8E44 = 0xE5A5
-0x8E45 = 0xE5A6
-0x8E46 = 0xE5A7
-0x8E47 = 0xE5A8
-0x8E48 = 0xE5A9
-0x8E49 = 0xE5AA
-0x8E4A = 0xE5AB
-0x8E4B = 0xE5AC
-0x8E4C = 0xE5AD
-0x8E4D = 0xE5AE
-0x8E4E = 0xE5AF
-0x8E4F = 0xE5B0
-0x8E50 = 0xE5B1
-0x8E51 = 0xE5B2
-0x8E52 = 0xE5B3
-0x8E53 = 0xE5B4
-0x8E54 = 0xE5B5
-0x8E55 = 0xE5B6
-0x8E56 = 0xE5B7
-0x8E57 = 0xE5B8
-0x8E58 = 0xE5B9
-0x8E59 = 0xE5BA
-0x8E5A = 0xE5BB
-0x8E5B = 0xE5BC
-0x8E5C = 0xE5BD
-0x8E5D = 0xE5BE
-0x8E5E = 0xE5BF
-0x8E5F = 0xE5C0
-0x8E60 = 0xE5C1
-0x8E61 = 0xE5C2
-0x8E62 = 0xE5C3
-0x8E63 = 0xE5C4
-0x8E64 = 0xE5C5
-0x8E65 = 0xE5C6
-0x8E66 = 0xE5C7
-0x8E67 = 0xE5C8
-0x8E68 = 0xE5C9
-0x8E69 = 0xE5CA
-0x8E6A = 0xE5CB
-0x8E6B = 0xE5CC
-0x8E6C = 0xE5CD
-0x8E6D = 0xE5CE
-0x8E6E = 0xE5CF
-0x8E6F = 0xE5D0
-0x8E70 = 0xE5D1
-0x8E71 = 0xE5D2
-0x8E72 = 0xE5D3
-0x8E73 = 0xE5D4
-0x8E74 = 0xE5D5
-0x8E75 = 0xE5D6
-0x8E76 = 0xE5D7
-0x8E77 = 0xE5D8
-0x8E78 = 0xE5D9
-0x8E79 = 0xE5DA
-0x8E7A = 0xE5DB
-0x8E7B = 0xE5DC
-0x8E7C = 0xE5DD
-0x8E7D = 0xE5DE
-0x8E7E = 0xE5DF
-0x8F21 = 0xE5E0
-0x8F22 = 0xE5E1
-0x8F23 = 0xE5E2
-0x8F24 = 0xE5E3
-0x8F25 = 0xE5E4
-0x8F26 = 0xE5E5
-0x8F27 = 0xE5E6
-0x8F28 = 0xE5E7
-0x8F29 = 0xE5E8
-0x8F2A = 0xE5E9
-0x8F2B = 0xE5EA
-0x8F2C = 0xE5EB
-0x8F2D = 0xE5EC
-0x8F2E = 0xE5ED
-0x8F2F = 0xE5EE
-0x8F30 = 0xE5EF
-0x8F31 = 0xE5F0
-0x8F32 = 0xE5F1
-0x8F33 = 0xE5F2
-0x8F34 = 0xE5F3
-0x8F35 = 0xE5F4
-0x8F36 = 0xE5F5
-0x8F37 = 0xE5F6
-0x8F38 = 0xE5F7
-0x8F39 = 0xE5F8
-0x8F3A = 0xE5F9
-0x8F3B = 0xE5FA
-0x8F3C = 0xE5FB
-0x8F3D = 0xE5FC
-0x8F3E = 0xE5FD
-0x8F3F = 0xE5FE
-0x8F40 = 0xE5FF
-0x8F41 = 0xE600
-0x8F42 = 0xE601
-0x8F43 = 0xE602
-0x8F44 = 0xE603
-0x8F45 = 0xE604
-0x8F46 = 0xE605
-0x8F47 = 0xE606
-0x8F48 = 0xE607
-0x8F49 = 0xE608
-0x8F4A = 0xE609
-0x8F4B = 0xE60A
-0x8F4C = 0xE60B
-0x8F4D = 0xE60C
-0x8F4E = 0xE60D
-0x8F4F = 0xE60E
-0x8F50 = 0xE60F
-0x8F51 = 0xE610
-0x8F52 = 0xE611
-0x8F53 = 0xE612
-0x8F54 = 0xE613
-0x8F55 = 0xE614
-0x8F56 = 0xE615
-0x8F57 = 0xE616
-0x8F58 = 0xE617
-0x8F59 = 0xE618
-0x8F5A = 0xE619
-0x8F5B = 0xE61A
-0x8F5C = 0xE61B
-0x8F5D = 0xE61C
-0x8F5E = 0xE61D
-0x8F5F = 0xE61E
-0x8F60 = 0xE61F
-0x8F61 = 0xE620
-0x8F62 = 0xE621
-0x8F63 = 0xE622
-0x8F64 = 0xE623
-0x8F65 = 0xE624
-0x8F66 = 0xE625
-0x8F67 = 0xE626
-0x8F68 = 0xE627
-0x8F69 = 0xE628
-0x8F6A = 0xE629
-0x8F6B = 0xE62A
-0x8F6C = 0xE62B
-0x8F6D = 0xE62C
-0x8F6E = 0xE62D
-0x8F6F = 0xE62E
-0x8F70 = 0xE62F
-0x8F71 = 0xE630
-0x8F72 = 0xE631
-0x8F73 = 0xE632
-0x8F74 = 0xE633
-0x8F75 = 0xE634
-0x8F76 = 0xE635
-0x8F77 = 0xE636
-0x8F78 = 0xE637
-0x8F79 = 0xE638
-0x8F7A = 0xE639
-0x8F7B = 0xE63A
-0x8F7C = 0xE63B
-0x8F7D = 0xE63C
-0x8F7E = 0xE63D
-0x9021 = 0xE63E
-0x9022 = 0xE63F
-0x9023 = 0xE640
-0x9024 = 0xE641
-0x9025 = 0xE642
-0x9026 = 0xE643
-0x9027 = 0xE644
-0x9028 = 0xE645
-0x9029 = 0xE646
-0x902A = 0xE647
-0x902B = 0xE648
-0x902C = 0xE649
-0x902D = 0xE64A
-0x902E = 0xE64B
-0x902F = 0xE64C
-0x9030 = 0xE64D
-0x9031 = 0xE64E
-0x9032 = 0xE64F
-0x9033 = 0xE650
-0x9034 = 0xE651
-0x9035 = 0xE652
-0x9036 = 0xE653
-0x9037 = 0xE654
-0x9038 = 0xE655
-0x9039 = 0xE656
-0x903A = 0xE657
-0x903B = 0xE658
-0x903C = 0xE659
-0x903D = 0xE65A
-0x903E = 0xE65B
-0x903F = 0xE65C
-0x9040 = 0xE65D
-0x9041 = 0xE65E
-0x9042 = 0xE65F
-0x9043 = 0xE660
-0x9044 = 0xE661
-0x9045 = 0xE662
-0x9046 = 0xE663
-0x9047 = 0xE664
-0x9048 = 0xE665
-0x9049 = 0xE666
-0x904A = 0xE667
-0x904B = 0xE668
-0x904C = 0xE669
-0x904D = 0xE66A
-0x904E = 0xE66B
-0x904F = 0xE66C
-0x9050 = 0xE66D
-0x9051 = 0xE66E
-0x9052 = 0xE66F
-0x9053 = 0xE670
-0x9054 = 0xE671
-0x9055 = 0xE672
-0x9056 = 0xE673
-0x9057 = 0xE674
-0x9058 = 0xE675
-0x9059 = 0xE676
-0x905A = 0xE677
-0x905B = 0xE678
-0x905C = 0xE679
-0x905D = 0xE67A
-0x905E = 0xE67B
-0x905F = 0xE67C
-0x9060 = 0xE67D
-0x9061 = 0xE67E
-0x9062 = 0xE67F
-0x9063 = 0xE680
-0x9064 = 0xE681
-0x9065 = 0xE682
-0x9066 = 0xE683
-0x9067 = 0xE684
-0x9068 = 0xE685
-0x9069 = 0xE686
-0x906A = 0xE687
-0x906B = 0xE688
-0x906C = 0xE689
-0x906D = 0xE68A
-0x906E = 0xE68B
-0x906F = 0xE68C
-0x9070 = 0xE68D
-0x9071 = 0xE68E
-0x9072 = 0xE68F
-0x9073 = 0xE690
-0x9074 = 0xE691
-0x9075 = 0xE692
-0x9076 = 0xE693
-0x9077 = 0xE694
-0x9078 = 0xE695
-0x9079 = 0xE696
-0x907A = 0xE697
-0x907B = 0xE698
-0x907C = 0xE699
-0x907D = 0xE69A
-0x907E = 0xE69B
-0x9121 = 0xE69C
-0x9122 = 0xE69D
-0x9123 = 0xE69E
-0x9124 = 0xE69F
-0x9125 = 0xE6A0
-0x9126 = 0xE6A1
-0x9127 = 0xE6A2
-0x9128 = 0xE6A3
-0x9129 = 0xE6A4
-0x912A = 0xE6A5
-0x912B = 0xE6A6
-0x912C = 0xE6A7
-0x912D = 0xE6A8
-0x912E = 0xE6A9
-0x912F = 0xE6AA
-0x9130 = 0xE6AB
-0x9131 = 0xE6AC
-0x9132 = 0xE6AD
-0x9133 = 0xE6AE
-0x9134 = 0xE6AF
-0x9135 = 0xE6B0
-0x9136 = 0xE6B1
-0x9137 = 0xE6B2
-0x9138 = 0xE6B3
-0x9139 = 0xE6B4
-0x913A = 0xE6B5
-0x913B = 0xE6B6
-0x913C = 0xE6B7
-0x913D = 0xE6B8
-0x913E = 0xE6B9
-0x913F = 0xE6BA
-0x9140 = 0xE6BB
-0x9141 = 0xE6BC
-0x9142 = 0xE6BD
-0x9143 = 0xE6BE
-0x9144 = 0xE6BF
-0x9145 = 0xE6C0
-0x9146 = 0xE6C1
-0x9147 = 0xE6C2
-0x9148 = 0xE6C3
-0x9149 = 0xE6C4
-0x914A = 0xE6C5
-0x914B = 0xE6C6
-0x914C = 0xE6C7
-0x914D = 0xE6C8
-0x914E = 0xE6C9
-0x914F = 0xE6CA
-0x9150 = 0xE6CB
-0x9151 = 0xE6CC
-0x9152 = 0xE6CD
-0x9153 = 0xE6CE
-0x9154 = 0xE6CF
-0x9155 = 0xE6D0
-0x9156 = 0xE6D1
-0x9157 = 0xE6D2
-0x9158 = 0xE6D3
-0x9159 = 0xE6D4
-0x915A = 0xE6D5
-0x915B = 0xE6D6
-0x915C = 0xE6D7
-0x915D = 0xE6D8
-0x915E = 0xE6D9
-0x915F = 0xE6DA
-0x9160 = 0xE6DB
-0x9161 = 0xE6DC
-0x9162 = 0xE6DD
-0x9163 = 0xE6DE
-0x9164 = 0xE6DF
-0x9165 = 0xE6E0
-0x9166 = 0xE6E1
-0x9167 = 0xE6E2
-0x9168 = 0xE6E3
-0x9169 = 0xE6E4
-0x916A = 0xE6E5
-0x916B = 0xE6E6
-0x916C = 0xE6E7
-0x916D = 0xE6E8
-0x916E = 0xE6E9
-0x916F = 0xE6EA
-0x9170 = 0xE6EB
-0x9171 = 0xE6EC
-0x9172 = 0xE6ED
-0x9173 = 0xE6EE
-0x9174 = 0xE6EF
-0x9175 = 0xE6F0
-0x9176 = 0xE6F1
-0x9177 = 0xE6F2
-0x9178 = 0xE6F3
-0x9179 = 0xE6F4
-0x917A = 0xE6F5
-0x917B = 0xE6F6
-0x917C = 0xE6F7
-0x917D = 0xE6F8
-0x917E = 0xE6F9
-0x9221 = 0xE6FA
-0x9222 = 0xE6FB
-0x9223 = 0xE6FC
-0x9224 = 0xE6FD
-0x9225 = 0xE6FE
-0x9226 = 0xE6FF
-0x9227 = 0xE700
-0x9228 = 0xE701
-0x9229 = 0xE702
-0x922A = 0xE703
-0x922B = 0xE704
-0x922C = 0xE705
-0x922D = 0xE706
-0x922E = 0xE707
-0x922F = 0xE708
-0x9230 = 0xE709
-0x9231 = 0xE70A
-0x9232 = 0xE70B
-0x9233 = 0xE70C
-0x9234 = 0xE70D
-0x9235 = 0xE70E
-0x9236 = 0xE70F
-0x9237 = 0xE710
-0x9238 = 0xE711
-0x9239 = 0xE712
-0x923A = 0xE713
-0x923B = 0xE714
-0x923C = 0xE715
-0x923D = 0xE716
-0x923E = 0xE717
-0x923F = 0xE718
-0x9240 = 0xE719
-0x9241 = 0xE71A
-0x9242 = 0xE71B
-0x9243 = 0xE71C
-0x9244 = 0xE71D
-0x9245 = 0xE71E
-0x9246 = 0xE71F
-0x9247 = 0xE720
-0x9248 = 0xE721
-0x9249 = 0xE722
-0x924A = 0xE723
-0x924B = 0xE724
-0x924C = 0xE725
-0x924D = 0xE726
-0x924E = 0xE727
-0x924F = 0xE728
-0x9250 = 0xE729
-0x9251 = 0xE72A
-0x9252 = 0xE72B
-0x9253 = 0xE72C
-0x9254 = 0xE72D
-0x9255 = 0xE72E
-0x9256 = 0xE72F
-0x9257 = 0xE730
-0x9258 = 0xE731
-0x9259 = 0xE732
-0x925A = 0xE733
-0x925B = 0xE734
-0x925C = 0xE735
-0x925D = 0xE736
-0x925E = 0xE737
-0x925F = 0xE738
-0x9260 = 0xE739
-0x9261 = 0xE73A
-0x9262 = 0xE73B
-0x9263 = 0xE73C
-0x9264 = 0xE73D
-0x9265 = 0xE73E
-0x9266 = 0xE73F
-0x9267 = 0xE740
-0x9268 = 0xE741
-0x9269 = 0xE742
-0x926A = 0xE743
-0x926B = 0xE744
-0x926C = 0xE745
-0x926D = 0xE746
-0x926E = 0xE747
-0x926F = 0xE748
-0x9270 = 0xE749
-0x9271 = 0xE74A
-0x9272 = 0xE74B
-0x9273 = 0xE74C
-0x9274 = 0xE74D
-0x9275 = 0xE74E
-0x9276 = 0xE74F
-0x9277 = 0xE750
-0x9278 = 0xE751
-0x9279 = 0xE752
-0x927A = 0xE753
-0x927B = 0xE754
-0x927C = 0xE755
-0x927D = 0xE756
-0x927E = 0xE757
-END_MAP
diff --git a/enc/trans/CP/CP932VDC@IBM%UCS.src b/enc/trans/CP/CP932VDC@IBM%UCS.src
deleted file mode 100644
index 3b9b360dd4..0000000000
--- a/enc/trans/CP/CP932VDC@IBM%UCS.src
+++ /dev/null
@@ -1,420 +0,0 @@
-# $NetBSD: CP932VDC@IBM%UCS.src,v 1.1 2006/11/04 03:46:19 tnozaki Exp $
-
-TYPE ROWCOL
-NAME "CP932VDC:IBM/UCS"
-SRC_ZONE 0x93-0x97 / 0x21-0x7E / 8
-OOB_MODE INVALID
-DST_INVALID 0xFFFE
-DST_UNIT_BITS 16
-
-BEGIN_MAP
-#
-# This mapping data is made from the mapping data provided by Unicode, Inc.
-# Original notice:
-#
-# Name: cp932 to Unicode table
-# Unicode version: 2.0
-# Table version: 2.01
-# Table format: Format A
-# Date: 04/15/98
-#
-# Contact: cpxlate@microsoft.com
-#
-# General notes: none
-#
-# Format: Three tab-separated columns
-# Column #1 is the cp932 code (in hex)
-# Column #2 is the Unicode (in hex as 0xXXXX)
-# Column #3 is the Unicode name (follows a comment sign, '#')
-#
-# The entries are in cp932 order
-#
-0x9321 = 0x2170
-0x9322 = 0x2171
-0x9323 = 0x2172
-0x9324 = 0x2173
-0x9325 = 0x2174
-0x9326 = 0x2175
-0x9327 = 0x2176
-0x9328 = 0x2177
-0x9329 = 0x2178
-0x932A = 0x2179
-0x932B = 0x2160
-0x932C = 0x2161
-0x932D = 0x2162
-0x932E = 0x2163
-0x932F = 0x2164
-0x9330 = 0x2165
-0x9331 = 0x2166
-0x9332 = 0x2167
-0x9333 = 0x2168
-0x9334 = 0x2169
-0x9335 = 0xFFE2
-0x9336 = 0xFFE4
-0x9337 = 0xFF07
-0x9338 = 0xFF02
-0x9339 = 0x3231
-0x933A = 0x2116
-0x933B = 0x2121
-0x933C = 0x2235
-0x933D = 0x7E8A
-0x933E = 0x891C
-0x933F = 0x9348
-0x9340 = 0x9288
-0x9341 = 0x84DC
-0x9342 = 0x4FC9
-0x9343 = 0x70BB
-0x9344 = 0x6631
-0x9345 = 0x68C8
-0x9346 = 0x92F9
-0x9347 = 0x66FB
-0x9348 = 0x5F45
-0x9349 = 0x4E28
-0x934A = 0x4EE1
-0x934B = 0x4EFC
-0x934C = 0x4F00
-0x934D = 0x4F03
-0x934E = 0x4F39
-0x934F = 0x4F56
-0x9350 = 0x4F92
-0x9351 = 0x4F8A
-0x9352 = 0x4F9A
-0x9353 = 0x4F94
-0x9354 = 0x4FCD
-0x9355 = 0x5040
-0x9356 = 0x5022
-0x9357 = 0x4FFF
-0x9358 = 0x501E
-0x9359 = 0x5046
-0x935A = 0x5070
-0x935B = 0x5042
-0x935C = 0x5094
-0x935D = 0x50F4
-0x935E = 0x50D8
-0x935F = 0x514A
-0x9360 = 0x5164
-0x9361 = 0x519D
-0x9362 = 0x51BE
-0x9363 = 0x51EC
-0x9364 = 0x5215
-0x9365 = 0x529C
-0x9366 = 0x52A6
-0x9367 = 0x52C0
-0x9368 = 0x52DB
-0x9369 = 0x5300
-0x936A = 0x5307
-0x936B = 0x5324
-0x936C = 0x5372
-0x936D = 0x5393
-0x936E = 0x53B2
-0x936F = 0x53DD
-0x9370 = 0xFA0E
-0x9371 = 0x549C
-0x9372 = 0x548A
-0x9373 = 0x54A9
-0x9374 = 0x54FF
-0x9375 = 0x5586
-0x9376 = 0x5759
-0x9377 = 0x5765
-0x9378 = 0x57AC
-0x9379 = 0x57C8
-0x937A = 0x57C7
-0x937B = 0xFA0F
-0x937C = 0xFA10
-0x937D = 0x589E
-0x937E = 0x58B2
-0x9421 = 0x590B
-0x9422 = 0x5953
-0x9423 = 0x595B
-0x9424 = 0x595D
-0x9425 = 0x5963
-0x9426 = 0x59A4
-0x9427 = 0x59BA
-0x9428 = 0x5B56
-0x9429 = 0x5BC0
-0x942A = 0x752F
-0x942B = 0x5BD8
-0x942C = 0x5BEC
-0x942D = 0x5C1E
-0x942E = 0x5CA6
-0x942F = 0x5CBA
-0x9430 = 0x5CF5
-0x9431 = 0x5D27
-0x9432 = 0x5D53
-0x9433 = 0xFA11
-0x9434 = 0x5D42
-0x9435 = 0x5D6D
-0x9436 = 0x5DB8
-0x9437 = 0x5DB9
-0x9438 = 0x5DD0
-0x9439 = 0x5F21
-0x943A = 0x5F34
-0x943B = 0x5F67
-0x943C = 0x5FB7
-0x943D = 0x5FDE
-0x943E = 0x605D
-0x943F = 0x6085
-0x9440 = 0x608A
-0x9441 = 0x60DE
-0x9442 = 0x60D5
-0x9443 = 0x6120
-0x9444 = 0x60F2
-0x9445 = 0x6111
-0x9446 = 0x6137
-0x9447 = 0x6130
-0x9448 = 0x6198
-0x9449 = 0x6213
-0x944A = 0x62A6
-0x944B = 0x63F5
-0x944C = 0x6460
-0x944D = 0x649D
-0x944E = 0x64CE
-0x944F = 0x654E
-0x9450 = 0x6600
-0x9451 = 0x6615
-0x9452 = 0x663B
-0x9453 = 0x6609
-0x9454 = 0x662E
-0x9455 = 0x661E
-0x9456 = 0x6624
-0x9457 = 0x6665
-0x9458 = 0x6657
-0x9459 = 0x6659
-0x945A = 0xFA12
-0x945B = 0x6673
-0x945C = 0x6699
-0x945D = 0x66A0
-0x945E = 0x66B2
-0x945F = 0x66BF
-0x9460 = 0x66FA
-0x9461 = 0x670E
-0x9462 = 0xF929
-0x9463 = 0x6766
-0x9464 = 0x67BB
-0x9465 = 0x6852
-0x9466 = 0x67C0
-0x9467 = 0x6801
-0x9468 = 0x6844
-0x9469 = 0x68CF
-0x946A = 0xFA13
-0x946B = 0x6968
-0x946C = 0xFA14
-0x946D = 0x6998
-0x946E = 0x69E2
-0x946F = 0x6A30
-0x9470 = 0x6A6B
-0x9471 = 0x6A46
-0x9472 = 0x6A73
-0x9473 = 0x6A7E
-0x9474 = 0x6AE2
-0x9475 = 0x6AE4
-0x9476 = 0x6BD6
-0x9477 = 0x6C3F
-0x9478 = 0x6C5C
-0x9479 = 0x6C86
-0x947A = 0x6C6F
-0x947B = 0x6CDA
-0x947C = 0x6D04
-0x947D = 0x6D87
-0x947E = 0x6D6F
-0x9521 = 0x6D96
-0x9522 = 0x6DAC
-0x9523 = 0x6DCF
-0x9524 = 0x6DF8
-0x9525 = 0x6DF2
-0x9526 = 0x6DFC
-0x9527 = 0x6E39
-0x9528 = 0x6E5C
-0x9529 = 0x6E27
-0x952A = 0x6E3C
-0x952B = 0x6EBF
-0x952C = 0x6F88
-0x952D = 0x6FB5
-0x952E = 0x6FF5
-0x952F = 0x7005
-0x9530 = 0x7007
-0x9531 = 0x7028
-0x9532 = 0x7085
-0x9533 = 0x70AB
-0x9534 = 0x710F
-0x9535 = 0x7104
-0x9536 = 0x715C
-0x9537 = 0x7146
-0x9538 = 0x7147
-0x9539 = 0xFA15
-0x953A = 0x71C1
-0x953B = 0x71FE
-0x953C = 0x72B1
-0x953D = 0x72BE
-0x953E = 0x7324
-0x953F = 0xFA16
-0x9540 = 0x7377
-0x9541 = 0x73BD
-0x9542 = 0x73C9
-0x9543 = 0x73D6
-0x9544 = 0x73E3
-0x9545 = 0x73D2
-0x9546 = 0x7407
-0x9547 = 0x73F5
-0x9548 = 0x7426
-0x9549 = 0x742A
-0x954A = 0x7429
-0x954B = 0x742E
-0x954C = 0x7462
-0x954D = 0x7489
-0x954E = 0x749F
-0x954F = 0x7501
-0x9550 = 0x756F
-0x9551 = 0x7682
-0x9552 = 0x769C
-0x9553 = 0x769E
-0x9554 = 0x769B
-0x9555 = 0x76A6
-0x9556 = 0xFA17
-0x9557 = 0x7746
-0x9558 = 0x52AF
-0x9559 = 0x7821
-0x955A = 0x784E
-0x955B = 0x7864
-0x955C = 0x787A
-0x955D = 0x7930
-0x955E = 0xFA18
-0x955F = 0xFA19
-0x9560 = 0xFA1A
-0x9561 = 0x7994
-0x9562 = 0xFA1B
-0x9563 = 0x799B
-0x9564 = 0x7AD1
-0x9565 = 0x7AE7
-0x9566 = 0xFA1C
-0x9567 = 0x7AEB
-0x9568 = 0x7B9E
-0x9569 = 0xFA1D
-0x956A = 0x7D48
-0x956B = 0x7D5C
-0x956C = 0x7DB7
-0x956D = 0x7DA0
-0x956E = 0x7DD6
-0x956F = 0x7E52
-0x9570 = 0x7F47
-0x9571 = 0x7FA1
-0x9572 = 0xFA1E
-0x9573 = 0x8301
-0x9574 = 0x8362
-0x9575 = 0x837F
-0x9576 = 0x83C7
-0x9577 = 0x83F6
-0x9578 = 0x8448
-0x9579 = 0x84B4
-0x957A = 0x8553
-0x957B = 0x8559
-0x957C = 0x856B
-0x957D = 0xFA1F
-0x957E = 0x85B0
-0x9621 = 0xFA20
-0x9622 = 0xFA21
-0x9623 = 0x8807
-0x9624 = 0x88F5
-0x9625 = 0x8A12
-0x9626 = 0x8A37
-0x9627 = 0x8A79
-0x9628 = 0x8AA7
-0x9629 = 0x8ABE
-0x962A = 0x8ADF
-0x962B = 0xFA22
-0x962C = 0x8AF6
-0x962D = 0x8B53
-0x962E = 0x8B7F
-0x962F = 0x8CF0
-0x9630 = 0x8CF4
-0x9631 = 0x8D12
-0x9632 = 0x8D76
-0x9633 = 0xFA23
-0x9634 = 0x8ECF
-0x9635 = 0xFA24
-0x9636 = 0xFA25
-0x9637 = 0x9067
-0x9638 = 0x90DE
-0x9639 = 0xFA26
-0x963A = 0x9115
-0x963B = 0x9127
-0x963C = 0x91DA
-0x963D = 0x91D7
-0x963E = 0x91DE
-0x963F = 0x91ED
-0x9640 = 0x91EE
-0x9641 = 0x91E4
-0x9642 = 0x91E5
-0x9643 = 0x9206
-0x9644 = 0x9210
-0x9645 = 0x920A
-0x9646 = 0x923A
-0x9647 = 0x9240
-0x9648 = 0x923C
-0x9649 = 0x924E
-0x964A = 0x9259
-0x964B = 0x9251
-0x964C = 0x9239
-0x964D = 0x9267
-0x964E = 0x92A7
-0x964F = 0x9277
-0x9650 = 0x9278
-0x9651 = 0x92E7
-0x9652 = 0x92D7
-0x9653 = 0x92D9
-0x9654 = 0x92D0
-0x9655 = 0xFA27
-0x9656 = 0x92D5
-0x9657 = 0x92E0
-0x9658 = 0x92D3
-0x9659 = 0x9325
-0x965A = 0x9321
-0x965B = 0x92FB
-0x965C = 0xFA28
-0x965D = 0x931E
-0x965E = 0x92FF
-0x965F = 0x931D
-0x9660 = 0x9302
-0x9661 = 0x9370
-0x9662 = 0x9357
-0x9663 = 0x93A4
-0x9664 = 0x93C6
-0x9665 = 0x93DE
-0x9666 = 0x93F8
-0x9667 = 0x9431
-0x9668 = 0x9445
-0x9669 = 0x9448
-0x966A = 0x9592
-0x966B = 0xF9DC
-0x966C = 0xFA29
-0x966D = 0x969D
-0x966E = 0x96AF
-0x966F = 0x9733
-0x9670 = 0x973B
-0x9671 = 0x9743
-0x9672 = 0x974D
-0x9673 = 0x974F
-0x9674 = 0x9751
-0x9675 = 0x9755
-0x9676 = 0x9857
-0x9677 = 0x9865
-0x9678 = 0xFA2A
-0x9679 = 0xFA2B
-0x967A = 0x9927
-0x967B = 0xFA2C
-0x967C = 0x999E
-0x967D = 0x9A4E
-0x967E = 0x9AD9
-0x9721 = 0x9ADC
-0x9722 = 0x9B75
-0x9723 = 0x9B72
-0x9724 = 0x9B8F
-0x9725 = 0x9BB1
-0x9726 = 0x9BBB
-0x9727 = 0x9C00
-0x9728 = 0x9D70
-0x9729 = 0x9D6B
-0x972A = 0xFA2D
-0x972B = 0x9E19
-0x972C = 0x9ED1
-END_MAP
diff --git a/enc/trans/CP/CP932VDC@NEC_IBM%UCS.src b/enc/trans/CP/CP932VDC@NEC_IBM%UCS.src
deleted file mode 100644
index 7696d909e0..0000000000
--- a/enc/trans/CP/CP932VDC@NEC_IBM%UCS.src
+++ /dev/null
@@ -1,406 +0,0 @@
-# $NetBSD: CP932VDC@NEC_IBM%UCS.src,v 1.1 2006/11/04 03:46:19 tnozaki Exp $
-
-TYPE ROWCOL
-NAME "CP932VDC:NEC_IBM/UCS"
-SRC_ZONE 0x79-0x7C / 0x21-0x7E / 8
-OOB_MODE INVALID
-DST_INVALID 0xFFFE
-DST_UNIT_BITS 16
-
-BEGIN_MAP
-#
-# This mapping data is made from the mapping data provided by Unicode, Inc.
-# Original notice:
-#
-# Name: cp932 to Unicode table
-# Unicode version: 2.0
-# Table version: 2.01
-# Table format: Format A
-# Date: 04/15/98
-#
-# Contact: cpxlate@microsoft.com
-#
-# General notes: none
-#
-# Format: Three tab-separated columns
-# Column #1 is the cp932 code (in hex)
-# Column #2 is the Unicode (in hex as 0xXXXX)
-# Column #3 is the Unicode name (follows a comment sign, '#')
-#
-# The entries are in cp932 order
-#
-0x7921 = 0x7E8A
-0x7922 = 0x891C
-0x7923 = 0x9348
-0x7924 = 0x9288
-0x7925 = 0x84DC
-0x7926 = 0x4FC9
-0x7927 = 0x70BB
-0x7928 = 0x6631
-0x7929 = 0x68C8
-0x792A = 0x92F9
-0x792B = 0x66FB
-0x792C = 0x5F45
-0x792D = 0x4E28
-0x792E = 0x4EE1
-0x792F = 0x4EFC
-0x7930 = 0x4F00
-0x7931 = 0x4F03
-0x7932 = 0x4F39
-0x7933 = 0x4F56
-0x7934 = 0x4F92
-0x7935 = 0x4F8A
-0x7936 = 0x4F9A
-0x7937 = 0x4F94
-0x7938 = 0x4FCD
-0x7939 = 0x5040
-0x793A = 0x5022
-0x793B = 0x4FFF
-0x793C = 0x501E
-0x793D = 0x5046
-0x793E = 0x5070
-0x793F = 0x5042
-0x7940 = 0x5094
-0x7941 = 0x50F4
-0x7942 = 0x50D8
-0x7943 = 0x514A
-0x7944 = 0x5164
-0x7945 = 0x519D
-0x7946 = 0x51BE
-0x7947 = 0x51EC
-0x7948 = 0x5215
-0x7949 = 0x529C
-0x794A = 0x52A6
-0x794B = 0x52C0
-0x794C = 0x52DB
-0x794D = 0x5300
-0x794E = 0x5307
-0x794F = 0x5324
-0x7950 = 0x5372
-0x7951 = 0x5393
-0x7952 = 0x53B2
-0x7953 = 0x53DD
-0x7954 = 0xFA0E
-0x7955 = 0x549C
-0x7956 = 0x548A
-0x7957 = 0x54A9
-0x7958 = 0x54FF
-0x7959 = 0x5586
-0x795A = 0x5759
-0x795B = 0x5765
-0x795C = 0x57AC
-0x795D = 0x57C8
-0x795E = 0x57C7
-0x795F = 0xFA0F
-0x7960 = 0xFA10
-0x7961 = 0x589E
-0x7962 = 0x58B2
-0x7963 = 0x590B
-0x7964 = 0x5953
-0x7965 = 0x595B
-0x7966 = 0x595D
-0x7967 = 0x5963
-0x7968 = 0x59A4
-0x7969 = 0x59BA
-0x796A = 0x5B56
-0x796B = 0x5BC0
-0x796C = 0x752F
-0x796D = 0x5BD8
-0x796E = 0x5BEC
-0x796F = 0x5C1E
-0x7970 = 0x5CA6
-0x7971 = 0x5CBA
-0x7972 = 0x5CF5
-0x7973 = 0x5D27
-0x7974 = 0x5D53
-0x7975 = 0xFA11
-0x7976 = 0x5D42
-0x7977 = 0x5D6D
-0x7978 = 0x5DB8
-0x7979 = 0x5DB9
-0x797A = 0x5DD0
-0x797B = 0x5F21
-0x797C = 0x5F34
-0x797D = 0x5F67
-0x797E = 0x5FB7
-0x7A21 = 0x5FDE
-0x7A22 = 0x605D
-0x7A23 = 0x6085
-0x7A24 = 0x608A
-0x7A25 = 0x60DE
-0x7A26 = 0x60D5
-0x7A27 = 0x6120
-0x7A28 = 0x60F2
-0x7A29 = 0x6111
-0x7A2A = 0x6137
-0x7A2B = 0x6130
-0x7A2C = 0x6198
-0x7A2D = 0x6213
-0x7A2E = 0x62A6
-0x7A2F = 0x63F5
-0x7A30 = 0x6460
-0x7A31 = 0x649D
-0x7A32 = 0x64CE
-0x7A33 = 0x654E
-0x7A34 = 0x6600
-0x7A35 = 0x6615
-0x7A36 = 0x663B
-0x7A37 = 0x6609
-0x7A38 = 0x662E
-0x7A39 = 0x661E
-0x7A3A = 0x6624
-0x7A3B = 0x6665
-0x7A3C = 0x6657
-0x7A3D = 0x6659
-0x7A3E = 0xFA12
-0x7A3F = 0x6673
-0x7A40 = 0x6699
-0x7A41 = 0x66A0
-0x7A42 = 0x66B2
-0x7A43 = 0x66BF
-0x7A44 = 0x66FA
-0x7A45 = 0x670E
-0x7A46 = 0xF929
-0x7A47 = 0x6766
-0x7A48 = 0x67BB
-0x7A49 = 0x6852
-0x7A4A = 0x67C0
-0x7A4B = 0x6801
-0x7A4C = 0x6844
-0x7A4D = 0x68CF
-0x7A4E = 0xFA13
-0x7A4F = 0x6968
-0x7A50 = 0xFA14
-0x7A51 = 0x6998
-0x7A52 = 0x69E2
-0x7A53 = 0x6A30
-0x7A54 = 0x6A6B
-0x7A55 = 0x6A46
-0x7A56 = 0x6A73
-0x7A57 = 0x6A7E
-0x7A58 = 0x6AE2
-0x7A59 = 0x6AE4
-0x7A5A = 0x6BD6
-0x7A5B = 0x6C3F
-0x7A5C = 0x6C5C
-0x7A5D = 0x6C86
-0x7A5E = 0x6C6F
-0x7A5F = 0x6CDA
-0x7A60 = 0x6D04
-0x7A61 = 0x6D87
-0x7A62 = 0x6D6F
-0x7A63 = 0x6D96
-0x7A64 = 0x6DAC
-0x7A65 = 0x6DCF
-0x7A66 = 0x6DF8
-0x7A67 = 0x6DF2
-0x7A68 = 0x6DFC
-0x7A69 = 0x6E39
-0x7A6A = 0x6E5C
-0x7A6B = 0x6E27
-0x7A6C = 0x6E3C
-0x7A6D = 0x6EBF
-0x7A6E = 0x6F88
-0x7A6F = 0x6FB5
-0x7A70 = 0x6FF5
-0x7A71 = 0x7005
-0x7A72 = 0x7007
-0x7A73 = 0x7028
-0x7A74 = 0x7085
-0x7A75 = 0x70AB
-0x7A76 = 0x710F
-0x7A77 = 0x7104
-0x7A78 = 0x715C
-0x7A79 = 0x7146
-0x7A7A = 0x7147
-0x7A7B = 0xFA15
-0x7A7C = 0x71C1
-0x7A7D = 0x71FE
-0x7A7E = 0x72B1
-0x7B21 = 0x72BE
-0x7B22 = 0x7324
-0x7B23 = 0xFA16
-0x7B24 = 0x7377
-0x7B25 = 0x73BD
-0x7B26 = 0x73C9
-0x7B27 = 0x73D6
-0x7B28 = 0x73E3
-0x7B29 = 0x73D2
-0x7B2A = 0x7407
-0x7B2B = 0x73F5
-0x7B2C = 0x7426
-0x7B2D = 0x742A
-0x7B2E = 0x7429
-0x7B2F = 0x742E
-0x7B30 = 0x7462
-0x7B31 = 0x7489
-0x7B32 = 0x749F
-0x7B33 = 0x7501
-0x7B34 = 0x756F
-0x7B35 = 0x7682
-0x7B36 = 0x769C
-0x7B37 = 0x769E
-0x7B38 = 0x769B
-0x7B39 = 0x76A6
-0x7B3A = 0xFA17
-0x7B3B = 0x7746
-0x7B3C = 0x52AF
-0x7B3D = 0x7821
-0x7B3E = 0x784E
-0x7B3F = 0x7864
-0x7B40 = 0x787A
-0x7B41 = 0x7930
-0x7B42 = 0xFA18
-0x7B43 = 0xFA19
-0x7B44 = 0xFA1A
-0x7B45 = 0x7994
-0x7B46 = 0xFA1B
-0x7B47 = 0x799B
-0x7B48 = 0x7AD1
-0x7B49 = 0x7AE7
-0x7B4A = 0xFA1C
-0x7B4B = 0x7AEB
-0x7B4C = 0x7B9E
-0x7B4D = 0xFA1D
-0x7B4E = 0x7D48
-0x7B4F = 0x7D5C
-0x7B50 = 0x7DB7
-0x7B51 = 0x7DA0
-0x7B52 = 0x7DD6
-0x7B53 = 0x7E52
-0x7B54 = 0x7F47
-0x7B55 = 0x7FA1
-0x7B56 = 0xFA1E
-0x7B57 = 0x8301
-0x7B58 = 0x8362
-0x7B59 = 0x837F
-0x7B5A = 0x83C7
-0x7B5B = 0x83F6
-0x7B5C = 0x8448
-0x7B5D = 0x84B4
-0x7B5E = 0x8553
-0x7B5F = 0x8559
-0x7B60 = 0x856B
-0x7B61 = 0xFA1F
-0x7B62 = 0x85B0
-0x7B63 = 0xFA20
-0x7B64 = 0xFA21
-0x7B65 = 0x8807
-0x7B66 = 0x88F5
-0x7B67 = 0x8A12
-0x7B68 = 0x8A37
-0x7B69 = 0x8A79
-0x7B6A = 0x8AA7
-0x7B6B = 0x8ABE
-0x7B6C = 0x8ADF
-0x7B6D = 0xFA22
-0x7B6E = 0x8AF6
-0x7B6F = 0x8B53
-0x7B70 = 0x8B7F
-0x7B71 = 0x8CF0
-0x7B72 = 0x8CF4
-0x7B73 = 0x8D12
-0x7B74 = 0x8D76
-0x7B75 = 0xFA23
-0x7B76 = 0x8ECF
-0x7B77 = 0xFA24
-0x7B78 = 0xFA25
-0x7B79 = 0x9067
-0x7B7A = 0x90DE
-0x7B7B = 0xFA26
-0x7B7C = 0x9115
-0x7B7D = 0x9127
-0x7B7E = 0x91DA
-0x7C21 = 0x91D7
-0x7C22 = 0x91DE
-0x7C23 = 0x91ED
-0x7C24 = 0x91EE
-0x7C25 = 0x91E4
-0x7C26 = 0x91E5
-0x7C27 = 0x9206
-0x7C28 = 0x9210
-0x7C29 = 0x920A
-0x7C2A = 0x923A
-0x7C2B = 0x9240
-0x7C2C = 0x923C
-0x7C2D = 0x924E
-0x7C2E = 0x9259
-0x7C2F = 0x9251
-0x7C30 = 0x9239
-0x7C31 = 0x9267
-0x7C32 = 0x92A7
-0x7C33 = 0x9277
-0x7C34 = 0x9278
-0x7C35 = 0x92E7
-0x7C36 = 0x92D7
-0x7C37 = 0x92D9
-0x7C38 = 0x92D0
-0x7C39 = 0xFA27
-0x7C3A = 0x92D5
-0x7C3B = 0x92E0
-0x7C3C = 0x92D3
-0x7C3D = 0x9325
-0x7C3E = 0x9321
-0x7C3F = 0x92FB
-0x7C40 = 0xFA28
-0x7C41 = 0x931E
-0x7C42 = 0x92FF
-0x7C43 = 0x931D
-0x7C44 = 0x9302
-0x7C45 = 0x9370
-0x7C46 = 0x9357
-0x7C47 = 0x93A4
-0x7C48 = 0x93C6
-0x7C49 = 0x93DE
-0x7C4A = 0x93F8
-0x7C4B = 0x9431
-0x7C4C = 0x9445
-0x7C4D = 0x9448
-0x7C4E = 0x9592
-0x7C4F = 0xF9DC
-0x7C50 = 0xFA29
-0x7C51 = 0x969D
-0x7C52 = 0x96AF
-0x7C53 = 0x9733
-0x7C54 = 0x973B
-0x7C55 = 0x9743
-0x7C56 = 0x974D
-0x7C57 = 0x974F
-0x7C58 = 0x9751
-0x7C59 = 0x9755
-0x7C5A = 0x9857
-0x7C5B = 0x9865
-0x7C5C = 0xFA2A
-0x7C5D = 0xFA2B
-0x7C5E = 0x9927
-0x7C5F = 0xFA2C
-0x7C60 = 0x999E
-0x7C61 = 0x9A4E
-0x7C62 = 0x9AD9
-0x7C63 = 0x9ADC
-0x7C64 = 0x9B75
-0x7C65 = 0x9B72
-0x7C66 = 0x9B8F
-0x7C67 = 0x9BB1
-0x7C68 = 0x9BBB
-0x7C69 = 0x9C00
-0x7C6A = 0x9D70
-0x7C6B = 0x9D6B
-0x7C6C = 0xFA2D
-0x7C6D = 0x9E19
-0x7C6E = 0x9ED1
-0x7C71 = 0x2170
-0x7C72 = 0x2171
-0x7C73 = 0x2172
-0x7C74 = 0x2173
-0x7C75 = 0x2174
-0x7C76 = 0x2175
-0x7C77 = 0x2176
-0x7C78 = 0x2177
-0x7C79 = 0x2178
-0x7C7A = 0x2179
-0x7C7B = 0xFFE2
-0x7C7C = 0xFFE4
-0x7C7D = 0xFF07
-0x7C7E = 0xFF02
-END_MAP
diff --git a/enc/trans/CP/UCS%CP932UDA.src b/enc/trans/CP/UCS%CP932UDA.src
deleted file mode 100644
index f34e9ed829..0000000000
--- a/enc/trans/CP/UCS%CP932UDA.src
+++ /dev/null
@@ -1,1912 +0,0 @@
-# $NetBSD: UCS%CP932UDA.src,v 1.1 2006/11/04 03:46:19 tnozaki Exp $
-
-TYPE ROWCOL
-NAME "UCS/CP932UDA"
-SRC_ZONE 0xE000-0xE757
-OOB_MODE INVALID
-DST_INVALID 0xFFFF
-DST_UNIT_BITS 16
-
-BEGIN_MAP
-#
-# This mapping data is made from the mapping data provided by Unicode, Inc.
-# Original notice:
-#
-# Name: cp932 to Unicode table
-# Unicode version: 2.0
-# Table version: 2.01
-# Table format: Format A
-# Date: 04/15/98
-#
-# Contact: cpxlate@microsoft.com
-#
-# General notes: none
-#
-# Format: Three tab-separated columns
-# Column #1 is the cp932 code (in hex)
-# Column #2 is the Unicode (in hex as 0xXXXX)
-# Column #3 is the Unicode name (follows a comment sign, '#')
-#
-# The entries are in cp932 order
-#
-0xE000 = 0x7F21
-0xE001 = 0x7F22
-0xE002 = 0x7F23
-0xE003 = 0x7F24
-0xE004 = 0x7F25
-0xE005 = 0x7F26
-0xE006 = 0x7F27
-0xE007 = 0x7F28
-0xE008 = 0x7F29
-0xE009 = 0x7F2A
-0xE00A = 0x7F2B
-0xE00B = 0x7F2C
-0xE00C = 0x7F2D
-0xE00D = 0x7F2E
-0xE00E = 0x7F2F
-0xE00F = 0x7F30
-0xE010 = 0x7F31
-0xE011 = 0x7F32
-0xE012 = 0x7F33
-0xE013 = 0x7F34
-0xE014 = 0x7F35
-0xE015 = 0x7F36
-0xE016 = 0x7F37
-0xE017 = 0x7F38
-0xE018 = 0x7F39
-0xE019 = 0x7F3A
-0xE01A = 0x7F3B
-0xE01B = 0x7F3C
-0xE01C = 0x7F3D
-0xE01D = 0x7F3E
-0xE01E = 0x7F3F
-0xE01F = 0x7F40
-0xE020 = 0x7F41
-0xE021 = 0x7F42
-0xE022 = 0x7F43
-0xE023 = 0x7F44
-0xE024 = 0x7F45
-0xE025 = 0x7F46
-0xE026 = 0x7F47
-0xE027 = 0x7F48
-0xE028 = 0x7F49
-0xE029 = 0x7F4A
-0xE02A = 0x7F4B
-0xE02B = 0x7F4C
-0xE02C = 0x7F4D
-0xE02D = 0x7F4E
-0xE02E = 0x7F4F
-0xE02F = 0x7F50
-0xE030 = 0x7F51
-0xE031 = 0x7F52
-0xE032 = 0x7F53
-0xE033 = 0x7F54
-0xE034 = 0x7F55
-0xE035 = 0x7F56
-0xE036 = 0x7F57
-0xE037 = 0x7F58
-0xE038 = 0x7F59
-0xE039 = 0x7F5A
-0xE03A = 0x7F5B
-0xE03B = 0x7F5C
-0xE03C = 0x7F5D
-0xE03D = 0x7F5E
-0xE03E = 0x7F5F
-0xE03F = 0x7F60
-0xE040 = 0x7F61
-0xE041 = 0x7F62
-0xE042 = 0x7F63
-0xE043 = 0x7F64
-0xE044 = 0x7F65
-0xE045 = 0x7F66
-0xE046 = 0x7F67
-0xE047 = 0x7F68
-0xE048 = 0x7F69
-0xE049 = 0x7F6A
-0xE04A = 0x7F6B
-0xE04B = 0x7F6C
-0xE04C = 0x7F6D
-0xE04D = 0x7F6E
-0xE04E = 0x7F6F
-0xE04F = 0x7F70
-0xE050 = 0x7F71
-0xE051 = 0x7F72
-0xE052 = 0x7F73
-0xE053 = 0x7F74
-0xE054 = 0x7F75
-0xE055 = 0x7F76
-0xE056 = 0x7F77
-0xE057 = 0x7F78
-0xE058 = 0x7F79
-0xE059 = 0x7F7A
-0xE05A = 0x7F7B
-0xE05B = 0x7F7C
-0xE05C = 0x7F7D
-0xE05D = 0x7F7E
-0xE05E = 0x8021
-0xE05F = 0x8022
-0xE060 = 0x8023
-0xE061 = 0x8024
-0xE062 = 0x8025
-0xE063 = 0x8026
-0xE064 = 0x8027
-0xE065 = 0x8028
-0xE066 = 0x8029
-0xE067 = 0x802A
-0xE068 = 0x802B
-0xE069 = 0x802C
-0xE06A = 0x802D
-0xE06B = 0x802E
-0xE06C = 0x802F
-0xE06D = 0x8030
-0xE06E = 0x8031
-0xE06F = 0x8032
-0xE070 = 0x8033
-0xE071 = 0x8034
-0xE072 = 0x8035
-0xE073 = 0x8036
-0xE074 = 0x8037
-0xE075 = 0x8038
-0xE076 = 0x8039
-0xE077 = 0x803A
-0xE078 = 0x803B
-0xE079 = 0x803C
-0xE07A = 0x803D
-0xE07B = 0x803E
-0xE07C = 0x803F
-0xE07D = 0x8040
-0xE07E = 0x8041
-0xE07F = 0x8042
-0xE080 = 0x8043
-0xE081 = 0x8044
-0xE082 = 0x8045
-0xE083 = 0x8046
-0xE084 = 0x8047
-0xE085 = 0x8048
-0xE086 = 0x8049
-0xE087 = 0x804A
-0xE088 = 0x804B
-0xE089 = 0x804C
-0xE08A = 0x804D
-0xE08B = 0x804E
-0xE08C = 0x804F
-0xE08D = 0x8050
-0xE08E = 0x8051
-0xE08F = 0x8052
-0xE090 = 0x8053
-0xE091 = 0x8054
-0xE092 = 0x8055
-0xE093 = 0x8056
-0xE094 = 0x8057
-0xE095 = 0x8058
-0xE096 = 0x8059
-0xE097 = 0x805A
-0xE098 = 0x805B
-0xE099 = 0x805C
-0xE09A = 0x805D
-0xE09B = 0x805E
-0xE09C = 0x805F
-0xE09D = 0x8060
-0xE09E = 0x8061
-0xE09F = 0x8062
-0xE0A0 = 0x8063
-0xE0A1 = 0x8064
-0xE0A2 = 0x8065
-0xE0A3 = 0x8066
-0xE0A4 = 0x8067
-0xE0A5 = 0x8068
-0xE0A6 = 0x8069
-0xE0A7 = 0x806A
-0xE0A8 = 0x806B
-0xE0A9 = 0x806C
-0xE0AA = 0x806D
-0xE0AB = 0x806E
-0xE0AC = 0x806F
-0xE0AD = 0x8070
-0xE0AE = 0x8071
-0xE0AF = 0x8072
-0xE0B0 = 0x8073
-0xE0B1 = 0x8074
-0xE0B2 = 0x8075
-0xE0B3 = 0x8076
-0xE0B4 = 0x8077
-0xE0B5 = 0x8078
-0xE0B6 = 0x8079
-0xE0B7 = 0x807A
-0xE0B8 = 0x807B
-0xE0B9 = 0x807C
-0xE0BA = 0x807D
-0xE0BB = 0x807E
-0xE0BC = 0x8121
-0xE0BD = 0x8122
-0xE0BE = 0x8123
-0xE0BF = 0x8124
-0xE0C0 = 0x8125
-0xE0C1 = 0x8126
-0xE0C2 = 0x8127
-0xE0C3 = 0x8128
-0xE0C4 = 0x8129
-0xE0C5 = 0x812A
-0xE0C6 = 0x812B
-0xE0C7 = 0x812C
-0xE0C8 = 0x812D
-0xE0C9 = 0x812E
-0xE0CA = 0x812F
-0xE0CB = 0x8130
-0xE0CC = 0x8131
-0xE0CD = 0x8132
-0xE0CE = 0x8133
-0xE0CF = 0x8134
-0xE0D0 = 0x8135
-0xE0D1 = 0x8136
-0xE0D2 = 0x8137
-0xE0D3 = 0x8138
-0xE0D4 = 0x8139
-0xE0D5 = 0x813A
-0xE0D6 = 0x813B
-0xE0D7 = 0x813C
-0xE0D8 = 0x813D
-0xE0D9 = 0x813E
-0xE0DA = 0x813F
-0xE0DB = 0x8140
-0xE0DC = 0x8141
-0xE0DD = 0x8142
-0xE0DE = 0x8143
-0xE0DF = 0x8144
-0xE0E0 = 0x8145
-0xE0E1 = 0x8146
-0xE0E2 = 0x8147
-0xE0E3 = 0x8148
-0xE0E4 = 0x8149
-0xE0E5 = 0x814A
-0xE0E6 = 0x814B
-0xE0E7 = 0x814C
-0xE0E8 = 0x814D
-0xE0E9 = 0x814E
-0xE0EA = 0x814F
-0xE0EB = 0x8150
-0xE0EC = 0x8151
-0xE0ED = 0x8152
-0xE0EE = 0x8153
-0xE0EF = 0x8154
-0xE0F0 = 0x8155
-0xE0F1 = 0x8156
-0xE0F2 = 0x8157
-0xE0F3 = 0x8158
-0xE0F4 = 0x8159
-0xE0F5 = 0x815A
-0xE0F6 = 0x815B
-0xE0F7 = 0x815C
-0xE0F8 = 0x815D
-0xE0F9 = 0x815E
-0xE0FA = 0x815F
-0xE0FB = 0x8160
-0xE0FC = 0x8161
-0xE0FD = 0x8162
-0xE0FE = 0x8163
-0xE0FF = 0x8164
-0xE100 = 0x8165
-0xE101 = 0x8166
-0xE102 = 0x8167
-0xE103 = 0x8168
-0xE104 = 0x8169
-0xE105 = 0x816A
-0xE106 = 0x816B
-0xE107 = 0x816C
-0xE108 = 0x816D
-0xE109 = 0x816E
-0xE10A = 0x816F
-0xE10B = 0x8170
-0xE10C = 0x8171
-0xE10D = 0x8172
-0xE10E = 0x8173
-0xE10F = 0x8174
-0xE110 = 0x8175
-0xE111 = 0x8176
-0xE112 = 0x8177
-0xE113 = 0x8178
-0xE114 = 0x8179
-0xE115 = 0x817A
-0xE116 = 0x817B
-0xE117 = 0x817C
-0xE118 = 0x817D
-0xE119 = 0x817E
-0xE11A = 0x8221
-0xE11B = 0x8222
-0xE11C = 0x8223
-0xE11D = 0x8224
-0xE11E = 0x8225
-0xE11F = 0x8226
-0xE120 = 0x8227
-0xE121 = 0x8228
-0xE122 = 0x8229
-0xE123 = 0x822A
-0xE124 = 0x822B
-0xE125 = 0x822C
-0xE126 = 0x822D
-0xE127 = 0x822E
-0xE128 = 0x822F
-0xE129 = 0x8230
-0xE12A = 0x8231
-0xE12B = 0x8232
-0xE12C = 0x8233
-0xE12D = 0x8234
-0xE12E = 0x8235
-0xE12F = 0x8236
-0xE130 = 0x8237
-0xE131 = 0x8238
-0xE132 = 0x8239
-0xE133 = 0x823A
-0xE134 = 0x823B
-0xE135 = 0x823C
-0xE136 = 0x823D
-0xE137 = 0x823E
-0xE138 = 0x823F
-0xE139 = 0x8240
-0xE13A = 0x8241
-0xE13B = 0x8242
-0xE13C = 0x8243
-0xE13D = 0x8244
-0xE13E = 0x8245
-0xE13F = 0x8246
-0xE140 = 0x8247
-0xE141 = 0x8248
-0xE142 = 0x8249
-0xE143 = 0x824A
-0xE144 = 0x824B
-0xE145 = 0x824C
-0xE146 = 0x824D
-0xE147 = 0x824E
-0xE148 = 0x824F
-0xE149 = 0x8250
-0xE14A = 0x8251
-0xE14B = 0x8252
-0xE14C = 0x8253
-0xE14D = 0x8254
-0xE14E = 0x8255
-0xE14F = 0x8256
-0xE150 = 0x8257
-0xE151 = 0x8258
-0xE152 = 0x8259
-0xE153 = 0x825A
-0xE154 = 0x825B
-0xE155 = 0x825C
-0xE156 = 0x825D
-0xE157 = 0x825E
-0xE158 = 0x825F
-0xE159 = 0x8260
-0xE15A = 0x8261
-0xE15B = 0x8262
-0xE15C = 0x8263
-0xE15D = 0x8264
-0xE15E = 0x8265
-0xE15F = 0x8266
-0xE160 = 0x8267
-0xE161 = 0x8268
-0xE162 = 0x8269
-0xE163 = 0x826A
-0xE164 = 0x826B
-0xE165 = 0x826C
-0xE166 = 0x826D
-0xE167 = 0x826E
-0xE168 = 0x826F
-0xE169 = 0x8270
-0xE16A = 0x8271
-0xE16B = 0x8272
-0xE16C = 0x8273
-0xE16D = 0x8274
-0xE16E = 0x8275
-0xE16F = 0x8276
-0xE170 = 0x8277
-0xE171 = 0x8278
-0xE172 = 0x8279
-0xE173 = 0x827A
-0xE174 = 0x827B
-0xE175 = 0x827C
-0xE176 = 0x827D
-0xE177 = 0x827E
-0xE178 = 0x8321
-0xE179 = 0x8322
-0xE17A = 0x8323
-0xE17B = 0x8324
-0xE17C = 0x8325
-0xE17D = 0x8326
-0xE17E = 0x8327
-0xE17F = 0x8328
-0xE180 = 0x8329
-0xE181 = 0x832A
-0xE182 = 0x832B
-0xE183 = 0x832C
-0xE184 = 0x832D
-0xE185 = 0x832E
-0xE186 = 0x832F
-0xE187 = 0x8330
-0xE188 = 0x8331
-0xE189 = 0x8332
-0xE18A = 0x8333
-0xE18B = 0x8334
-0xE18C = 0x8335
-0xE18D = 0x8336
-0xE18E = 0x8337
-0xE18F = 0x8338
-0xE190 = 0x8339
-0xE191 = 0x833A
-0xE192 = 0x833B
-0xE193 = 0x833C
-0xE194 = 0x833D
-0xE195 = 0x833E
-0xE196 = 0x833F
-0xE197 = 0x8340
-0xE198 = 0x8341
-0xE199 = 0x8342
-0xE19A = 0x8343
-0xE19B = 0x8344
-0xE19C = 0x8345
-0xE19D = 0x8346
-0xE19E = 0x8347
-0xE19F = 0x8348
-0xE1A0 = 0x8349
-0xE1A1 = 0x834A
-0xE1A2 = 0x834B
-0xE1A3 = 0x834C
-0xE1A4 = 0x834D
-0xE1A5 = 0x834E
-0xE1A6 = 0x834F
-0xE1A7 = 0x8350
-0xE1A8 = 0x8351
-0xE1A9 = 0x8352
-0xE1AA = 0x8353
-0xE1AB = 0x8354
-0xE1AC = 0x8355
-0xE1AD = 0x8356
-0xE1AE = 0x8357
-0xE1AF = 0x8358
-0xE1B0 = 0x8359
-0xE1B1 = 0x835A
-0xE1B2 = 0x835B
-0xE1B3 = 0x835C
-0xE1B4 = 0x835D
-0xE1B5 = 0x835E
-0xE1B6 = 0x835F
-0xE1B7 = 0x8360
-0xE1B8 = 0x8361
-0xE1B9 = 0x8362
-0xE1BA = 0x8363
-0xE1BB = 0x8364
-0xE1BC = 0x8365
-0xE1BD = 0x8366
-0xE1BE = 0x8367
-0xE1BF = 0x8368
-0xE1C0 = 0x8369
-0xE1C1 = 0x836A
-0xE1C2 = 0x836B
-0xE1C3 = 0x836C
-0xE1C4 = 0x836D
-0xE1C5 = 0x836E
-0xE1C6 = 0x836F
-0xE1C7 = 0x8370
-0xE1C8 = 0x8371
-0xE1C9 = 0x8372
-0xE1CA = 0x8373
-0xE1CB = 0x8374
-0xE1CC = 0x8375
-0xE1CD = 0x8376
-0xE1CE = 0x8377
-0xE1CF = 0x8378
-0xE1D0 = 0x8379
-0xE1D1 = 0x837A
-0xE1D2 = 0x837B
-0xE1D3 = 0x837C
-0xE1D4 = 0x837D
-0xE1D5 = 0x837E
-0xE1D6 = 0x8421
-0xE1D7 = 0x8422
-0xE1D8 = 0x8423
-0xE1D9 = 0x8424
-0xE1DA = 0x8425
-0xE1DB = 0x8426
-0xE1DC = 0x8427
-0xE1DD = 0x8428
-0xE1DE = 0x8429
-0xE1DF = 0x842A
-0xE1E0 = 0x842B
-0xE1E1 = 0x842C
-0xE1E2 = 0x842D
-0xE1E3 = 0x842E
-0xE1E4 = 0x842F
-0xE1E5 = 0x8430
-0xE1E6 = 0x8431
-0xE1E7 = 0x8432
-0xE1E8 = 0x8433
-0xE1E9 = 0x8434
-0xE1EA = 0x8435
-0xE1EB = 0x8436
-0xE1EC = 0x8437
-0xE1ED = 0x8438
-0xE1EE = 0x8439
-0xE1EF = 0x843A
-0xE1F0 = 0x843B
-0xE1F1 = 0x843C
-0xE1F2 = 0x843D
-0xE1F3 = 0x843E
-0xE1F4 = 0x843F
-0xE1F5 = 0x8440
-0xE1F6 = 0x8441
-0xE1F7 = 0x8442
-0xE1F8 = 0x8443
-0xE1F9 = 0x8444
-0xE1FA = 0x8445
-0xE1FB = 0x8446
-0xE1FC = 0x8447
-0xE1FD = 0x8448
-0xE1FE = 0x8449
-0xE1FF = 0x844A
-0xE200 = 0x844B
-0xE201 = 0x844C
-0xE202 = 0x844D
-0xE203 = 0x844E
-0xE204 = 0x844F
-0xE205 = 0x8450
-0xE206 = 0x8451
-0xE207 = 0x8452
-0xE208 = 0x8453
-0xE209 = 0x8454
-0xE20A = 0x8455
-0xE20B = 0x8456
-0xE20C = 0x8457
-0xE20D = 0x8458
-0xE20E = 0x8459
-0xE20F = 0x845A
-0xE210 = 0x845B
-0xE211 = 0x845C
-0xE212 = 0x845D
-0xE213 = 0x845E
-0xE214 = 0x845F
-0xE215 = 0x8460
-0xE216 = 0x8461
-0xE217 = 0x8462
-0xE218 = 0x8463
-0xE219 = 0x8464
-0xE21A = 0x8465
-0xE21B = 0x8466
-0xE21C = 0x8467
-0xE21D = 0x8468
-0xE21E = 0x8469
-0xE21F = 0x846A
-0xE220 = 0x846B
-0xE221 = 0x846C
-0xE222 = 0x846D
-0xE223 = 0x846E
-0xE224 = 0x846F
-0xE225 = 0x8470
-0xE226 = 0x8471
-0xE227 = 0x8472
-0xE228 = 0x8473
-0xE229 = 0x8474
-0xE22A = 0x8475
-0xE22B = 0x8476
-0xE22C = 0x8477
-0xE22D = 0x8478
-0xE22E = 0x8479
-0xE22F = 0x847A
-0xE230 = 0x847B
-0xE231 = 0x847C
-0xE232 = 0x847D
-0xE233 = 0x847E
-0xE234 = 0x8521
-0xE235 = 0x8522
-0xE236 = 0x8523
-0xE237 = 0x8524
-0xE238 = 0x8525
-0xE239 = 0x8526
-0xE23A = 0x8527
-0xE23B = 0x8528
-0xE23C = 0x8529
-0xE23D = 0x852A
-0xE23E = 0x852B
-0xE23F = 0x852C
-0xE240 = 0x852D
-0xE241 = 0x852E
-0xE242 = 0x852F
-0xE243 = 0x8530
-0xE244 = 0x8531
-0xE245 = 0x8532
-0xE246 = 0x8533
-0xE247 = 0x8534
-0xE248 = 0x8535
-0xE249 = 0x8536
-0xE24A = 0x8537
-0xE24B = 0x8538
-0xE24C = 0x8539
-0xE24D = 0x853A
-0xE24E = 0x853B
-0xE24F = 0x853C
-0xE250 = 0x853D
-0xE251 = 0x853E
-0xE252 = 0x853F
-0xE253 = 0x8540
-0xE254 = 0x8541
-0xE255 = 0x8542
-0xE256 = 0x8543
-0xE257 = 0x8544
-0xE258 = 0x8545
-0xE259 = 0x8546
-0xE25A = 0x8547
-0xE25B = 0x8548
-0xE25C = 0x8549
-0xE25D = 0x854A
-0xE25E = 0x854B
-0xE25F = 0x854C
-0xE260 = 0x854D
-0xE261 = 0x854E
-0xE262 = 0x854F
-0xE263 = 0x8550
-0xE264 = 0x8551
-0xE265 = 0x8552
-0xE266 = 0x8553
-0xE267 = 0x8554
-0xE268 = 0x8555
-0xE269 = 0x8556
-0xE26A = 0x8557
-0xE26B = 0x8558
-0xE26C = 0x8559
-0xE26D = 0x855A
-0xE26E = 0x855B
-0xE26F = 0x855C
-0xE270 = 0x855D
-0xE271 = 0x855E
-0xE272 = 0x855F
-0xE273 = 0x8560
-0xE274 = 0x8561
-0xE275 = 0x8562
-0xE276 = 0x8563
-0xE277 = 0x8564
-0xE278 = 0x8565
-0xE279 = 0x8566
-0xE27A = 0x8567
-0xE27B = 0x8568
-0xE27C = 0x8569
-0xE27D = 0x856A
-0xE27E = 0x856B
-0xE27F = 0x856C
-0xE280 = 0x856D
-0xE281 = 0x856E
-0xE282 = 0x856F
-0xE283 = 0x8570
-0xE284 = 0x8571
-0xE285 = 0x8572
-0xE286 = 0x8573
-0xE287 = 0x8574
-0xE288 = 0x8575
-0xE289 = 0x8576
-0xE28A = 0x8577
-0xE28B = 0x8578
-0xE28C = 0x8579
-0xE28D = 0x857A
-0xE28E = 0x857B
-0xE28F = 0x857C
-0xE290 = 0x857D
-0xE291 = 0x857E
-0xE292 = 0x8621
-0xE293 = 0x8622
-0xE294 = 0x8623
-0xE295 = 0x8624
-0xE296 = 0x8625
-0xE297 = 0x8626
-0xE298 = 0x8627
-0xE299 = 0x8628
-0xE29A = 0x8629
-0xE29B = 0x862A
-0xE29C = 0x862B
-0xE29D = 0x862C
-0xE29E = 0x862D
-0xE29F = 0x862E
-0xE2A0 = 0x862F
-0xE2A1 = 0x8630
-0xE2A2 = 0x8631
-0xE2A3 = 0x8632
-0xE2A4 = 0x8633
-0xE2A5 = 0x8634
-0xE2A6 = 0x8635
-0xE2A7 = 0x8636
-0xE2A8 = 0x8637
-0xE2A9 = 0x8638
-0xE2AA = 0x8639
-0xE2AB = 0x863A
-0xE2AC = 0x863B
-0xE2AD = 0x863C
-0xE2AE = 0x863D
-0xE2AF = 0x863E
-0xE2B0 = 0x863F
-0xE2B1 = 0x8640
-0xE2B2 = 0x8641
-0xE2B3 = 0x8642
-0xE2B4 = 0x8643
-0xE2B5 = 0x8644
-0xE2B6 = 0x8645
-0xE2B7 = 0x8646
-0xE2B8 = 0x8647
-0xE2B9 = 0x8648
-0xE2BA = 0x8649
-0xE2BB = 0x864A
-0xE2BC = 0x864B
-0xE2BD = 0x864C
-0xE2BE = 0x864D
-0xE2BF = 0x864E
-0xE2C0 = 0x864F
-0xE2C1 = 0x8650
-0xE2C2 = 0x8651
-0xE2C3 = 0x8652
-0xE2C4 = 0x8653
-0xE2C5 = 0x8654
-0xE2C6 = 0x8655
-0xE2C7 = 0x8656
-0xE2C8 = 0x8657
-0xE2C9 = 0x8658
-0xE2CA = 0x8659
-0xE2CB = 0x865A
-0xE2CC = 0x865B
-0xE2CD = 0x865C
-0xE2CE = 0x865D
-0xE2CF = 0x865E
-0xE2D0 = 0x865F
-0xE2D1 = 0x8660
-0xE2D2 = 0x8661
-0xE2D3 = 0x8662
-0xE2D4 = 0x8663
-0xE2D5 = 0x8664
-0xE2D6 = 0x8665
-0xE2D7 = 0x8666
-0xE2D8 = 0x8667
-0xE2D9 = 0x8668
-0xE2DA = 0x8669
-0xE2DB = 0x866A
-0xE2DC = 0x866B
-0xE2DD = 0x866C
-0xE2DE = 0x866D
-0xE2DF = 0x866E
-0xE2E0 = 0x866F
-0xE2E1 = 0x8670
-0xE2E2 = 0x8671
-0xE2E3 = 0x8672
-0xE2E4 = 0x8673
-0xE2E5 = 0x8674
-0xE2E6 = 0x8675
-0xE2E7 = 0x8676
-0xE2E8 = 0x8677
-0xE2E9 = 0x8678
-0xE2EA = 0x8679
-0xE2EB = 0x867A
-0xE2EC = 0x867B
-0xE2ED = 0x867C
-0xE2EE = 0x867D
-0xE2EF = 0x867E
-0xE2F0 = 0x8721
-0xE2F1 = 0x8722
-0xE2F2 = 0x8723
-0xE2F3 = 0x8724
-0xE2F4 = 0x8725
-0xE2F5 = 0x8726
-0xE2F6 = 0x8727
-0xE2F7 = 0x8728
-0xE2F8 = 0x8729
-0xE2F9 = 0x872A
-0xE2FA = 0x872B
-0xE2FB = 0x872C
-0xE2FC = 0x872D
-0xE2FD = 0x872E
-0xE2FE = 0x872F
-0xE2FF = 0x8730
-0xE300 = 0x8731
-0xE301 = 0x8732
-0xE302 = 0x8733
-0xE303 = 0x8734
-0xE304 = 0x8735
-0xE305 = 0x8736
-0xE306 = 0x8737
-0xE307 = 0x8738
-0xE308 = 0x8739
-0xE309 = 0x873A
-0xE30A = 0x873B
-0xE30B = 0x873C
-0xE30C = 0x873D
-0xE30D = 0x873E
-0xE30E = 0x873F
-0xE30F = 0x8740
-0xE310 = 0x8741
-0xE311 = 0x8742
-0xE312 = 0x8743
-0xE313 = 0x8744
-0xE314 = 0x8745
-0xE315 = 0x8746
-0xE316 = 0x8747
-0xE317 = 0x8748
-0xE318 = 0x8749
-0xE319 = 0x874A
-0xE31A = 0x874B
-0xE31B = 0x874C
-0xE31C = 0x874D
-0xE31D = 0x874E
-0xE31E = 0x874F
-0xE31F = 0x8750
-0xE320 = 0x8751
-0xE321 = 0x8752
-0xE322 = 0x8753
-0xE323 = 0x8754
-0xE324 = 0x8755
-0xE325 = 0x8756
-0xE326 = 0x8757
-0xE327 = 0x8758
-0xE328 = 0x8759
-0xE329 = 0x875A
-0xE32A = 0x875B
-0xE32B = 0x875C
-0xE32C = 0x875D
-0xE32D = 0x875E
-0xE32E = 0x875F
-0xE32F = 0x8760
-0xE330 = 0x8761
-0xE331 = 0x8762
-0xE332 = 0x8763
-0xE333 = 0x8764
-0xE334 = 0x8765
-0xE335 = 0x8766
-0xE336 = 0x8767
-0xE337 = 0x8768
-0xE338 = 0x8769
-0xE339 = 0x876A
-0xE33A = 0x876B
-0xE33B = 0x876C
-0xE33C = 0x876D
-0xE33D = 0x876E
-0xE33E = 0x876F
-0xE33F = 0x8770
-0xE340 = 0x8771
-0xE341 = 0x8772
-0xE342 = 0x8773
-0xE343 = 0x8774
-0xE344 = 0x8775
-0xE345 = 0x8776
-0xE346 = 0x8777
-0xE347 = 0x8778
-0xE348 = 0x8779
-0xE349 = 0x877A
-0xE34A = 0x877B
-0xE34B = 0x877C
-0xE34C = 0x877D
-0xE34D = 0x877E
-0xE34E = 0x8821
-0xE34F = 0x8822
-0xE350 = 0x8823
-0xE351 = 0x8824
-0xE352 = 0x8825
-0xE353 = 0x8826
-0xE354 = 0x8827
-0xE355 = 0x8828
-0xE356 = 0x8829
-0xE357 = 0x882A
-0xE358 = 0x882B
-0xE359 = 0x882C
-0xE35A = 0x882D
-0xE35B = 0x882E
-0xE35C = 0x882F
-0xE35D = 0x8830
-0xE35E = 0x8831
-0xE35F = 0x8832
-0xE360 = 0x8833
-0xE361 = 0x8834
-0xE362 = 0x8835
-0xE363 = 0x8836
-0xE364 = 0x8837
-0xE365 = 0x8838
-0xE366 = 0x8839
-0xE367 = 0x883A
-0xE368 = 0x883B
-0xE369 = 0x883C
-0xE36A = 0x883D
-0xE36B = 0x883E
-0xE36C = 0x883F
-0xE36D = 0x8840
-0xE36E = 0x8841
-0xE36F = 0x8842
-0xE370 = 0x8843
-0xE371 = 0x8844
-0xE372 = 0x8845
-0xE373 = 0x8846
-0xE374 = 0x8847
-0xE375 = 0x8848
-0xE376 = 0x8849
-0xE377 = 0x884A
-0xE378 = 0x884B
-0xE379 = 0x884C
-0xE37A = 0x884D
-0xE37B = 0x884E
-0xE37C = 0x884F
-0xE37D = 0x8850
-0xE37E = 0x8851
-0xE37F = 0x8852
-0xE380 = 0x8853
-0xE381 = 0x8854
-0xE382 = 0x8855
-0xE383 = 0x8856
-0xE384 = 0x8857
-0xE385 = 0x8858
-0xE386 = 0x8859
-0xE387 = 0x885A
-0xE388 = 0x885B
-0xE389 = 0x885C
-0xE38A = 0x885D
-0xE38B = 0x885E
-0xE38C = 0x885F
-0xE38D = 0x8860
-0xE38E = 0x8861
-0xE38F = 0x8862
-0xE390 = 0x8863
-0xE391 = 0x8864
-0xE392 = 0x8865
-0xE393 = 0x8866
-0xE394 = 0x8867
-0xE395 = 0x8868
-0xE396 = 0x8869
-0xE397 = 0x886A
-0xE398 = 0x886B
-0xE399 = 0x886C
-0xE39A = 0x886D
-0xE39B = 0x886E
-0xE39C = 0x886F
-0xE39D = 0x8870
-0xE39E = 0x8871
-0xE39F = 0x8872
-0xE3A0 = 0x8873
-0xE3A1 = 0x8874
-0xE3A2 = 0x8875
-0xE3A3 = 0x8876
-0xE3A4 = 0x8877
-0xE3A5 = 0x8878
-0xE3A6 = 0x8879
-0xE3A7 = 0x887A
-0xE3A8 = 0x887B
-0xE3A9 = 0x887C
-0xE3AA = 0x887D
-0xE3AB = 0x887E
-0xE3AC = 0x8921
-0xE3AD = 0x8922
-0xE3AE = 0x8923
-0xE3AF = 0x8924
-0xE3B0 = 0x8925
-0xE3B1 = 0x8926
-0xE3B2 = 0x8927
-0xE3B3 = 0x8928
-0xE3B4 = 0x8929
-0xE3B5 = 0x892A
-0xE3B6 = 0x892B
-0xE3B7 = 0x892C
-0xE3B8 = 0x892D
-0xE3B9 = 0x892E
-0xE3BA = 0x892F
-0xE3BB = 0x8930
-0xE3BC = 0x8931
-0xE3BD = 0x8932
-0xE3BE = 0x8933
-0xE3BF = 0x8934
-0xE3C0 = 0x8935
-0xE3C1 = 0x8936
-0xE3C2 = 0x8937
-0xE3C3 = 0x8938
-0xE3C4 = 0x8939
-0xE3C5 = 0x893A
-0xE3C6 = 0x893B
-0xE3C7 = 0x893C
-0xE3C8 = 0x893D
-0xE3C9 = 0x893E
-0xE3CA = 0x893F
-0xE3CB = 0x8940
-0xE3CC = 0x8941
-0xE3CD = 0x8942
-0xE3CE = 0x8943
-0xE3CF = 0x8944
-0xE3D0 = 0x8945
-0xE3D1 = 0x8946
-0xE3D2 = 0x8947
-0xE3D3 = 0x8948
-0xE3D4 = 0x8949
-0xE3D5 = 0x894A
-0xE3D6 = 0x894B
-0xE3D7 = 0x894C
-0xE3D8 = 0x894D
-0xE3D9 = 0x894E
-0xE3DA = 0x894F
-0xE3DB = 0x8950
-0xE3DC = 0x8951
-0xE3DD = 0x8952
-0xE3DE = 0x8953
-0xE3DF = 0x8954
-0xE3E0 = 0x8955
-0xE3E1 = 0x8956
-0xE3E2 = 0x8957
-0xE3E3 = 0x8958
-0xE3E4 = 0x8959
-0xE3E5 = 0x895A
-0xE3E6 = 0x895B
-0xE3E7 = 0x895C
-0xE3E8 = 0x895D
-0xE3E9 = 0x895E
-0xE3EA = 0x895F
-0xE3EB = 0x8960
-0xE3EC = 0x8961
-0xE3ED = 0x8962
-0xE3EE = 0x8963
-0xE3EF = 0x8964
-0xE3F0 = 0x8965
-0xE3F1 = 0x8966
-0xE3F2 = 0x8967
-0xE3F3 = 0x8968
-0xE3F4 = 0x8969
-0xE3F5 = 0x896A
-0xE3F6 = 0x896B
-0xE3F7 = 0x896C
-0xE3F8 = 0x896D
-0xE3F9 = 0x896E
-0xE3FA = 0x896F
-0xE3FB = 0x8970
-0xE3FC = 0x8971
-0xE3FD = 0x8972
-0xE3FE = 0x8973
-0xE3FF = 0x8974
-0xE400 = 0x8975
-0xE401 = 0x8976
-0xE402 = 0x8977
-0xE403 = 0x8978
-0xE404 = 0x8979
-0xE405 = 0x897A
-0xE406 = 0x897B
-0xE407 = 0x897C
-0xE408 = 0x897D
-0xE409 = 0x897E
-0xE40A = 0x8A21
-0xE40B = 0x8A22
-0xE40C = 0x8A23
-0xE40D = 0x8A24
-0xE40E = 0x8A25
-0xE40F = 0x8A26
-0xE410 = 0x8A27
-0xE411 = 0x8A28
-0xE412 = 0x8A29
-0xE413 = 0x8A2A
-0xE414 = 0x8A2B
-0xE415 = 0x8A2C
-0xE416 = 0x8A2D
-0xE417 = 0x8A2E
-0xE418 = 0x8A2F
-0xE419 = 0x8A30
-0xE41A = 0x8A31
-0xE41B = 0x8A32
-0xE41C = 0x8A33
-0xE41D = 0x8A34
-0xE41E = 0x8A35
-0xE41F = 0x8A36
-0xE420 = 0x8A37
-0xE421 = 0x8A38
-0xE422 = 0x8A39
-0xE423 = 0x8A3A
-0xE424 = 0x8A3B
-0xE425 = 0x8A3C
-0xE426 = 0x8A3D
-0xE427 = 0x8A3E
-0xE428 = 0x8A3F
-0xE429 = 0x8A40
-0xE42A = 0x8A41
-0xE42B = 0x8A42
-0xE42C = 0x8A43
-0xE42D = 0x8A44
-0xE42E = 0x8A45
-0xE42F = 0x8A46
-0xE430 = 0x8A47
-0xE431 = 0x8A48
-0xE432 = 0x8A49
-0xE433 = 0x8A4A
-0xE434 = 0x8A4B
-0xE435 = 0x8A4C
-0xE436 = 0x8A4D
-0xE437 = 0x8A4E
-0xE438 = 0x8A4F
-0xE439 = 0x8A50
-0xE43A = 0x8A51
-0xE43B = 0x8A52
-0xE43C = 0x8A53
-0xE43D = 0x8A54
-0xE43E = 0x8A55
-0xE43F = 0x8A56
-0xE440 = 0x8A57
-0xE441 = 0x8A58
-0xE442 = 0x8A59
-0xE443 = 0x8A5A
-0xE444 = 0x8A5B
-0xE445 = 0x8A5C
-0xE446 = 0x8A5D
-0xE447 = 0x8A5E
-0xE448 = 0x8A5F
-0xE449 = 0x8A60
-0xE44A = 0x8A61
-0xE44B = 0x8A62
-0xE44C = 0x8A63
-0xE44D = 0x8A64
-0xE44E = 0x8A65
-0xE44F = 0x8A66
-0xE450 = 0x8A67
-0xE451 = 0x8A68
-0xE452 = 0x8A69
-0xE453 = 0x8A6A
-0xE454 = 0x8A6B
-0xE455 = 0x8A6C
-0xE456 = 0x8A6D
-0xE457 = 0x8A6E
-0xE458 = 0x8A6F
-0xE459 = 0x8A70
-0xE45A = 0x8A71
-0xE45B = 0x8A72
-0xE45C = 0x8A73
-0xE45D = 0x8A74
-0xE45E = 0x8A75
-0xE45F = 0x8A76
-0xE460 = 0x8A77
-0xE461 = 0x8A78
-0xE462 = 0x8A79
-0xE463 = 0x8A7A
-0xE464 = 0x8A7B
-0xE465 = 0x8A7C
-0xE466 = 0x8A7D
-0xE467 = 0x8A7E
-0xE468 = 0x8B21
-0xE469 = 0x8B22
-0xE46A = 0x8B23
-0xE46B = 0x8B24
-0xE46C = 0x8B25
-0xE46D = 0x8B26
-0xE46E = 0x8B27
-0xE46F = 0x8B28
-0xE470 = 0x8B29
-0xE471 = 0x8B2A
-0xE472 = 0x8B2B
-0xE473 = 0x8B2C
-0xE474 = 0x8B2D
-0xE475 = 0x8B2E
-0xE476 = 0x8B2F
-0xE477 = 0x8B30
-0xE478 = 0x8B31
-0xE479 = 0x8B32
-0xE47A = 0x8B33
-0xE47B = 0x8B34
-0xE47C = 0x8B35
-0xE47D = 0x8B36
-0xE47E = 0x8B37
-0xE47F = 0x8B38
-0xE480 = 0x8B39
-0xE481 = 0x8B3A
-0xE482 = 0x8B3B
-0xE483 = 0x8B3C
-0xE484 = 0x8B3D
-0xE485 = 0x8B3E
-0xE486 = 0x8B3F
-0xE487 = 0x8B40
-0xE488 = 0x8B41
-0xE489 = 0x8B42
-0xE48A = 0x8B43
-0xE48B = 0x8B44
-0xE48C = 0x8B45
-0xE48D = 0x8B46
-0xE48E = 0x8B47
-0xE48F = 0x8B48
-0xE490 = 0x8B49
-0xE491 = 0x8B4A
-0xE492 = 0x8B4B
-0xE493 = 0x8B4C
-0xE494 = 0x8B4D
-0xE495 = 0x8B4E
-0xE496 = 0x8B4F
-0xE497 = 0x8B50
-0xE498 = 0x8B51
-0xE499 = 0x8B52
-0xE49A = 0x8B53
-0xE49B = 0x8B54
-0xE49C = 0x8B55
-0xE49D = 0x8B56
-0xE49E = 0x8B57
-0xE49F = 0x8B58
-0xE4A0 = 0x8B59
-0xE4A1 = 0x8B5A
-0xE4A2 = 0x8B5B
-0xE4A3 = 0x8B5C
-0xE4A4 = 0x8B5D
-0xE4A5 = 0x8B5E
-0xE4A6 = 0x8B5F
-0xE4A7 = 0x8B60
-0xE4A8 = 0x8B61
-0xE4A9 = 0x8B62
-0xE4AA = 0x8B63
-0xE4AB = 0x8B64
-0xE4AC = 0x8B65
-0xE4AD = 0x8B66
-0xE4AE = 0x8B67
-0xE4AF = 0x8B68
-0xE4B0 = 0x8B69
-0xE4B1 = 0x8B6A
-0xE4B2 = 0x8B6B
-0xE4B3 = 0x8B6C
-0xE4B4 = 0x8B6D
-0xE4B5 = 0x8B6E
-0xE4B6 = 0x8B6F
-0xE4B7 = 0x8B70
-0xE4B8 = 0x8B71
-0xE4B9 = 0x8B72
-0xE4BA = 0x8B73
-0xE4BB = 0x8B74
-0xE4BC = 0x8B75
-0xE4BD = 0x8B76
-0xE4BE = 0x8B77
-0xE4BF = 0x8B78
-0xE4C0 = 0x8B79
-0xE4C1 = 0x8B7A
-0xE4C2 = 0x8B7B
-0xE4C3 = 0x8B7C
-0xE4C4 = 0x8B7D
-0xE4C5 = 0x8B7E
-0xE4C6 = 0x8C21
-0xE4C7 = 0x8C22
-0xE4C8 = 0x8C23
-0xE4C9 = 0x8C24
-0xE4CA = 0x8C25
-0xE4CB = 0x8C26
-0xE4CC = 0x8C27
-0xE4CD = 0x8C28
-0xE4CE = 0x8C29
-0xE4CF = 0x8C2A
-0xE4D0 = 0x8C2B
-0xE4D1 = 0x8C2C
-0xE4D2 = 0x8C2D
-0xE4D3 = 0x8C2E
-0xE4D4 = 0x8C2F
-0xE4D5 = 0x8C30
-0xE4D6 = 0x8C31
-0xE4D7 = 0x8C32
-0xE4D8 = 0x8C33
-0xE4D9 = 0x8C34
-0xE4DA = 0x8C35
-0xE4DB = 0x8C36
-0xE4DC = 0x8C37
-0xE4DD = 0x8C38
-0xE4DE = 0x8C39
-0xE4DF = 0x8C3A
-0xE4E0 = 0x8C3B
-0xE4E1 = 0x8C3C
-0xE4E2 = 0x8C3D
-0xE4E3 = 0x8C3E
-0xE4E4 = 0x8C3F
-0xE4E5 = 0x8C40
-0xE4E6 = 0x8C41
-0xE4E7 = 0x8C42
-0xE4E8 = 0x8C43
-0xE4E9 = 0x8C44
-0xE4EA = 0x8C45
-0xE4EB = 0x8C46
-0xE4EC = 0x8C47
-0xE4ED = 0x8C48
-0xE4EE = 0x8C49
-0xE4EF = 0x8C4A
-0xE4F0 = 0x8C4B
-0xE4F1 = 0x8C4C
-0xE4F2 = 0x8C4D
-0xE4F3 = 0x8C4E
-0xE4F4 = 0x8C4F
-0xE4F5 = 0x8C50
-0xE4F6 = 0x8C51
-0xE4F7 = 0x8C52
-0xE4F8 = 0x8C53
-0xE4F9 = 0x8C54
-0xE4FA = 0x8C55
-0xE4FB = 0x8C56
-0xE4FC = 0x8C57
-0xE4FD = 0x8C58
-0xE4FE = 0x8C59
-0xE4FF = 0x8C5A
-0xE500 = 0x8C5B
-0xE501 = 0x8C5C
-0xE502 = 0x8C5D
-0xE503 = 0x8C5E
-0xE504 = 0x8C5F
-0xE505 = 0x8C60
-0xE506 = 0x8C61
-0xE507 = 0x8C62
-0xE508 = 0x8C63
-0xE509 = 0x8C64
-0xE50A = 0x8C65
-0xE50B = 0x8C66
-0xE50C = 0x8C67
-0xE50D = 0x8C68
-0xE50E = 0x8C69
-0xE50F = 0x8C6A
-0xE510 = 0x8C6B
-0xE511 = 0x8C6C
-0xE512 = 0x8C6D
-0xE513 = 0x8C6E
-0xE514 = 0x8C6F
-0xE515 = 0x8C70
-0xE516 = 0x8C71
-0xE517 = 0x8C72
-0xE518 = 0x8C73
-0xE519 = 0x8C74
-0xE51A = 0x8C75
-0xE51B = 0x8C76
-0xE51C = 0x8C77
-0xE51D = 0x8C78
-0xE51E = 0x8C79
-0xE51F = 0x8C7A
-0xE520 = 0x8C7B
-0xE521 = 0x8C7C
-0xE522 = 0x8C7D
-0xE523 = 0x8C7E
-0xE524 = 0x8D21
-0xE525 = 0x8D22
-0xE526 = 0x8D23
-0xE527 = 0x8D24
-0xE528 = 0x8D25
-0xE529 = 0x8D26
-0xE52A = 0x8D27
-0xE52B = 0x8D28
-0xE52C = 0x8D29
-0xE52D = 0x8D2A
-0xE52E = 0x8D2B
-0xE52F = 0x8D2C
-0xE530 = 0x8D2D
-0xE531 = 0x8D2E
-0xE532 = 0x8D2F
-0xE533 = 0x8D30
-0xE534 = 0x8D31
-0xE535 = 0x8D32
-0xE536 = 0x8D33
-0xE537 = 0x8D34
-0xE538 = 0x8D35
-0xE539 = 0x8D36
-0xE53A = 0x8D37
-0xE53B = 0x8D38
-0xE53C = 0x8D39
-0xE53D = 0x8D3A
-0xE53E = 0x8D3B
-0xE53F = 0x8D3C
-0xE540 = 0x8D3D
-0xE541 = 0x8D3E
-0xE542 = 0x8D3F
-0xE543 = 0x8D40
-0xE544 = 0x8D41
-0xE545 = 0x8D42
-0xE546 = 0x8D43
-0xE547 = 0x8D44
-0xE548 = 0x8D45
-0xE549 = 0x8D46
-0xE54A = 0x8D47
-0xE54B = 0x8D48
-0xE54C = 0x8D49
-0xE54D = 0x8D4A
-0xE54E = 0x8D4B
-0xE54F = 0x8D4C
-0xE550 = 0x8D4D
-0xE551 = 0x8D4E
-0xE552 = 0x8D4F
-0xE553 = 0x8D50
-0xE554 = 0x8D51
-0xE555 = 0x8D52
-0xE556 = 0x8D53
-0xE557 = 0x8D54
-0xE558 = 0x8D55
-0xE559 = 0x8D56
-0xE55A = 0x8D57
-0xE55B = 0x8D58
-0xE55C = 0x8D59
-0xE55D = 0x8D5A
-0xE55E = 0x8D5B
-0xE55F = 0x8D5C
-0xE560 = 0x8D5D
-0xE561 = 0x8D5E
-0xE562 = 0x8D5F
-0xE563 = 0x8D60
-0xE564 = 0x8D61
-0xE565 = 0x8D62
-0xE566 = 0x8D63
-0xE567 = 0x8D64
-0xE568 = 0x8D65
-0xE569 = 0x8D66
-0xE56A = 0x8D67
-0xE56B = 0x8D68
-0xE56C = 0x8D69
-0xE56D = 0x8D6A
-0xE56E = 0x8D6B
-0xE56F = 0x8D6C
-0xE570 = 0x8D6D
-0xE571 = 0x8D6E
-0xE572 = 0x8D6F
-0xE573 = 0x8D70
-0xE574 = 0x8D71
-0xE575 = 0x8D72
-0xE576 = 0x8D73
-0xE577 = 0x8D74
-0xE578 = 0x8D75
-0xE579 = 0x8D76
-0xE57A = 0x8D77
-0xE57B = 0x8D78
-0xE57C = 0x8D79
-0xE57D = 0x8D7A
-0xE57E = 0x8D7B
-0xE57F = 0x8D7C
-0xE580 = 0x8D7D
-0xE581 = 0x8D7E
-0xE582 = 0x8E21
-0xE583 = 0x8E22
-0xE584 = 0x8E23
-0xE585 = 0x8E24
-0xE586 = 0x8E25
-0xE587 = 0x8E26
-0xE588 = 0x8E27
-0xE589 = 0x8E28
-0xE58A = 0x8E29
-0xE58B = 0x8E2A
-0xE58C = 0x8E2B
-0xE58D = 0x8E2C
-0xE58E = 0x8E2D
-0xE58F = 0x8E2E
-0xE590 = 0x8E2F
-0xE591 = 0x8E30
-0xE592 = 0x8E31
-0xE593 = 0x8E32
-0xE594 = 0x8E33
-0xE595 = 0x8E34
-0xE596 = 0x8E35
-0xE597 = 0x8E36
-0xE598 = 0x8E37
-0xE599 = 0x8E38
-0xE59A = 0x8E39
-0xE59B = 0x8E3A
-0xE59C = 0x8E3B
-0xE59D = 0x8E3C
-0xE59E = 0x8E3D
-0xE59F = 0x8E3E
-0xE5A0 = 0x8E3F
-0xE5A1 = 0x8E40
-0xE5A2 = 0x8E41
-0xE5A3 = 0x8E42
-0xE5A4 = 0x8E43
-0xE5A5 = 0x8E44
-0xE5A6 = 0x8E45
-0xE5A7 = 0x8E46
-0xE5A8 = 0x8E47
-0xE5A9 = 0x8E48
-0xE5AA = 0x8E49
-0xE5AB = 0x8E4A
-0xE5AC = 0x8E4B
-0xE5AD = 0x8E4C
-0xE5AE = 0x8E4D
-0xE5AF = 0x8E4E
-0xE5B0 = 0x8E4F
-0xE5B1 = 0x8E50
-0xE5B2 = 0x8E51
-0xE5B3 = 0x8E52
-0xE5B4 = 0x8E53
-0xE5B5 = 0x8E54
-0xE5B6 = 0x8E55
-0xE5B7 = 0x8E56
-0xE5B8 = 0x8E57
-0xE5B9 = 0x8E58
-0xE5BA = 0x8E59
-0xE5BB = 0x8E5A
-0xE5BC = 0x8E5B
-0xE5BD = 0x8E5C
-0xE5BE = 0x8E5D
-0xE5BF = 0x8E5E
-0xE5C0 = 0x8E5F
-0xE5C1 = 0x8E60
-0xE5C2 = 0x8E61
-0xE5C3 = 0x8E62
-0xE5C4 = 0x8E63
-0xE5C5 = 0x8E64
-0xE5C6 = 0x8E65
-0xE5C7 = 0x8E66
-0xE5C8 = 0x8E67
-0xE5C9 = 0x8E68
-0xE5CA = 0x8E69
-0xE5CB = 0x8E6A
-0xE5CC = 0x8E6B
-0xE5CD = 0x8E6C
-0xE5CE = 0x8E6D
-0xE5CF = 0x8E6E
-0xE5D0 = 0x8E6F
-0xE5D1 = 0x8E70
-0xE5D2 = 0x8E71
-0xE5D3 = 0x8E72
-0xE5D4 = 0x8E73
-0xE5D5 = 0x8E74
-0xE5D6 = 0x8E75
-0xE5D7 = 0x8E76
-0xE5D8 = 0x8E77
-0xE5D9 = 0x8E78
-0xE5DA = 0x8E79
-0xE5DB = 0x8E7A
-0xE5DC = 0x8E7B
-0xE5DD = 0x8E7C
-0xE5DE = 0x8E7D
-0xE5DF = 0x8E7E
-0xE5E0 = 0x8F21
-0xE5E1 = 0x8F22
-0xE5E2 = 0x8F23
-0xE5E3 = 0x8F24
-0xE5E4 = 0x8F25
-0xE5E5 = 0x8F26
-0xE5E6 = 0x8F27
-0xE5E7 = 0x8F28
-0xE5E8 = 0x8F29
-0xE5E9 = 0x8F2A
-0xE5EA = 0x8F2B
-0xE5EB = 0x8F2C
-0xE5EC = 0x8F2D
-0xE5ED = 0x8F2E
-0xE5EE = 0x8F2F
-0xE5EF = 0x8F30
-0xE5F0 = 0x8F31
-0xE5F1 = 0x8F32
-0xE5F2 = 0x8F33
-0xE5F3 = 0x8F34
-0xE5F4 = 0x8F35
-0xE5F5 = 0x8F36
-0xE5F6 = 0x8F37
-0xE5F7 = 0x8F38
-0xE5F8 = 0x8F39
-0xE5F9 = 0x8F3A
-0xE5FA = 0x8F3B
-0xE5FB = 0x8F3C
-0xE5FC = 0x8F3D
-0xE5FD = 0x8F3E
-0xE5FE = 0x8F3F
-0xE5FF = 0x8F40
-0xE600 = 0x8F41
-0xE601 = 0x8F42
-0xE602 = 0x8F43
-0xE603 = 0x8F44
-0xE604 = 0x8F45
-0xE605 = 0x8F46
-0xE606 = 0x8F47
-0xE607 = 0x8F48
-0xE608 = 0x8F49
-0xE609 = 0x8F4A
-0xE60A = 0x8F4B
-0xE60B = 0x8F4C
-0xE60C = 0x8F4D
-0xE60D = 0x8F4E
-0xE60E = 0x8F4F
-0xE60F = 0x8F50
-0xE610 = 0x8F51
-0xE611 = 0x8F52
-0xE612 = 0x8F53
-0xE613 = 0x8F54
-0xE614 = 0x8F55
-0xE615 = 0x8F56
-0xE616 = 0x8F57
-0xE617 = 0x8F58
-0xE618 = 0x8F59
-0xE619 = 0x8F5A
-0xE61A = 0x8F5B
-0xE61B = 0x8F5C
-0xE61C = 0x8F5D
-0xE61D = 0x8F5E
-0xE61E = 0x8F5F
-0xE61F = 0x8F60
-0xE620 = 0x8F61
-0xE621 = 0x8F62
-0xE622 = 0x8F63
-0xE623 = 0x8F64
-0xE624 = 0x8F65
-0xE625 = 0x8F66
-0xE626 = 0x8F67
-0xE627 = 0x8F68
-0xE628 = 0x8F69
-0xE629 = 0x8F6A
-0xE62A = 0x8F6B
-0xE62B = 0x8F6C
-0xE62C = 0x8F6D
-0xE62D = 0x8F6E
-0xE62E = 0x8F6F
-0xE62F = 0x8F70
-0xE630 = 0x8F71
-0xE631 = 0x8F72
-0xE632 = 0x8F73
-0xE633 = 0x8F74
-0xE634 = 0x8F75
-0xE635 = 0x8F76
-0xE636 = 0x8F77
-0xE637 = 0x8F78
-0xE638 = 0x8F79
-0xE639 = 0x8F7A
-0xE63A = 0x8F7B
-0xE63B = 0x8F7C
-0xE63C = 0x8F7D
-0xE63D = 0x8F7E
-0xE63E = 0x9021
-0xE63F = 0x9022
-0xE640 = 0x9023
-0xE641 = 0x9024
-0xE642 = 0x9025
-0xE643 = 0x9026
-0xE644 = 0x9027
-0xE645 = 0x9028
-0xE646 = 0x9029
-0xE647 = 0x902A
-0xE648 = 0x902B
-0xE649 = 0x902C
-0xE64A = 0x902D
-0xE64B = 0x902E
-0xE64C = 0x902F
-0xE64D = 0x9030
-0xE64E = 0x9031
-0xE64F = 0x9032
-0xE650 = 0x9033
-0xE651 = 0x9034
-0xE652 = 0x9035
-0xE653 = 0x9036
-0xE654 = 0x9037
-0xE655 = 0x9038
-0xE656 = 0x9039
-0xE657 = 0x903A
-0xE658 = 0x903B
-0xE659 = 0x903C
-0xE65A = 0x903D
-0xE65B = 0x903E
-0xE65C = 0x903F
-0xE65D = 0x9040
-0xE65E = 0x9041
-0xE65F = 0x9042
-0xE660 = 0x9043
-0xE661 = 0x9044
-0xE662 = 0x9045
-0xE663 = 0x9046
-0xE664 = 0x9047
-0xE665 = 0x9048
-0xE666 = 0x9049
-0xE667 = 0x904A
-0xE668 = 0x904B
-0xE669 = 0x904C
-0xE66A = 0x904D
-0xE66B = 0x904E
-0xE66C = 0x904F
-0xE66D = 0x9050
-0xE66E = 0x9051
-0xE66F = 0x9052
-0xE670 = 0x9053
-0xE671 = 0x9054
-0xE672 = 0x9055
-0xE673 = 0x9056
-0xE674 = 0x9057
-0xE675 = 0x9058
-0xE676 = 0x9059
-0xE677 = 0x905A
-0xE678 = 0x905B
-0xE679 = 0x905C
-0xE67A = 0x905D
-0xE67B = 0x905E
-0xE67C = 0x905F
-0xE67D = 0x9060
-0xE67E = 0x9061
-0xE67F = 0x9062
-0xE680 = 0x9063
-0xE681 = 0x9064
-0xE682 = 0x9065
-0xE683 = 0x9066
-0xE684 = 0x9067
-0xE685 = 0x9068
-0xE686 = 0x9069
-0xE687 = 0x906A
-0xE688 = 0x906B
-0xE689 = 0x906C
-0xE68A = 0x906D
-0xE68B = 0x906E
-0xE68C = 0x906F
-0xE68D = 0x9070
-0xE68E = 0x9071
-0xE68F = 0x9072
-0xE690 = 0x9073
-0xE691 = 0x9074
-0xE692 = 0x9075
-0xE693 = 0x9076
-0xE694 = 0x9077
-0xE695 = 0x9078
-0xE696 = 0x9079
-0xE697 = 0x907A
-0xE698 = 0x907B
-0xE699 = 0x907C
-0xE69A = 0x907D
-0xE69B = 0x907E
-0xE69C = 0x9121
-0xE69D = 0x9122
-0xE69E = 0x9123
-0xE69F = 0x9124
-0xE6A0 = 0x9125
-0xE6A1 = 0x9126
-0xE6A2 = 0x9127
-0xE6A3 = 0x9128
-0xE6A4 = 0x9129
-0xE6A5 = 0x912A
-0xE6A6 = 0x912B
-0xE6A7 = 0x912C
-0xE6A8 = 0x912D
-0xE6A9 = 0x912E
-0xE6AA = 0x912F
-0xE6AB = 0x9130
-0xE6AC = 0x9131
-0xE6AD = 0x9132
-0xE6AE = 0x9133
-0xE6AF = 0x9134
-0xE6B0 = 0x9135
-0xE6B1 = 0x9136
-0xE6B2 = 0x9137
-0xE6B3 = 0x9138
-0xE6B4 = 0x9139
-0xE6B5 = 0x913A
-0xE6B6 = 0x913B
-0xE6B7 = 0x913C
-0xE6B8 = 0x913D
-0xE6B9 = 0x913E
-0xE6BA = 0x913F
-0xE6BB = 0x9140
-0xE6BC = 0x9141
-0xE6BD = 0x9142
-0xE6BE = 0x9143
-0xE6BF = 0x9144
-0xE6C0 = 0x9145
-0xE6C1 = 0x9146
-0xE6C2 = 0x9147
-0xE6C3 = 0x9148
-0xE6C4 = 0x9149
-0xE6C5 = 0x914A
-0xE6C6 = 0x914B
-0xE6C7 = 0x914C
-0xE6C8 = 0x914D
-0xE6C9 = 0x914E
-0xE6CA = 0x914F
-0xE6CB = 0x9150
-0xE6CC = 0x9151
-0xE6CD = 0x9152
-0xE6CE = 0x9153
-0xE6CF = 0x9154
-0xE6D0 = 0x9155
-0xE6D1 = 0x9156
-0xE6D2 = 0x9157
-0xE6D3 = 0x9158
-0xE6D4 = 0x9159
-0xE6D5 = 0x915A
-0xE6D6 = 0x915B
-0xE6D7 = 0x915C
-0xE6D8 = 0x915D
-0xE6D9 = 0x915E
-0xE6DA = 0x915F
-0xE6DB = 0x9160
-0xE6DC = 0x9161
-0xE6DD = 0x9162
-0xE6DE = 0x9163
-0xE6DF = 0x9164
-0xE6E0 = 0x9165
-0xE6E1 = 0x9166
-0xE6E2 = 0x9167
-0xE6E3 = 0x9168
-0xE6E4 = 0x9169
-0xE6E5 = 0x916A
-0xE6E6 = 0x916B
-0xE6E7 = 0x916C
-0xE6E8 = 0x916D
-0xE6E9 = 0x916E
-0xE6EA = 0x916F
-0xE6EB = 0x9170
-0xE6EC = 0x9171
-0xE6ED = 0x9172
-0xE6EE = 0x9173
-0xE6EF = 0x9174
-0xE6F0 = 0x9175
-0xE6F1 = 0x9176
-0xE6F2 = 0x9177
-0xE6F3 = 0x9178
-0xE6F4 = 0x9179
-0xE6F5 = 0x917A
-0xE6F6 = 0x917B
-0xE6F7 = 0x917C
-0xE6F8 = 0x917D
-0xE6F9 = 0x917E
-0xE6FA = 0x9221
-0xE6FB = 0x9222
-0xE6FC = 0x9223
-0xE6FD = 0x9224
-0xE6FE = 0x9225
-0xE6FF = 0x9226
-0xE700 = 0x9227
-0xE701 = 0x9228
-0xE702 = 0x9229
-0xE703 = 0x922A
-0xE704 = 0x922B
-0xE705 = 0x922C
-0xE706 = 0x922D
-0xE707 = 0x922E
-0xE708 = 0x922F
-0xE709 = 0x9230
-0xE70A = 0x9231
-0xE70B = 0x9232
-0xE70C = 0x9233
-0xE70D = 0x9234
-0xE70E = 0x9235
-0xE70F = 0x9236
-0xE710 = 0x9237
-0xE711 = 0x9238
-0xE712 = 0x9239
-0xE713 = 0x923A
-0xE714 = 0x923B
-0xE715 = 0x923C
-0xE716 = 0x923D
-0xE717 = 0x923E
-0xE718 = 0x923F
-0xE719 = 0x9240
-0xE71A = 0x9241
-0xE71B = 0x9242
-0xE71C = 0x9243
-0xE71D = 0x9244
-0xE71E = 0x9245
-0xE71F = 0x9246
-0xE720 = 0x9247
-0xE721 = 0x9248
-0xE722 = 0x9249
-0xE723 = 0x924A
-0xE724 = 0x924B
-0xE725 = 0x924C
-0xE726 = 0x924D
-0xE727 = 0x924E
-0xE728 = 0x924F
-0xE729 = 0x9250
-0xE72A = 0x9251
-0xE72B = 0x9252
-0xE72C = 0x9253
-0xE72D = 0x9254
-0xE72E = 0x9255
-0xE72F = 0x9256
-0xE730 = 0x9257
-0xE731 = 0x9258
-0xE732 = 0x9259
-0xE733 = 0x925A
-0xE734 = 0x925B
-0xE735 = 0x925C
-0xE736 = 0x925D
-0xE737 = 0x925E
-0xE738 = 0x925F
-0xE739 = 0x9260
-0xE73A = 0x9261
-0xE73B = 0x9262
-0xE73C = 0x9263
-0xE73D = 0x9264
-0xE73E = 0x9265
-0xE73F = 0x9266
-0xE740 = 0x9267
-0xE741 = 0x9268
-0xE742 = 0x9269
-0xE743 = 0x926A
-0xE744 = 0x926B
-0xE745 = 0x926C
-0xE746 = 0x926D
-0xE747 = 0x926E
-0xE748 = 0x926F
-0xE749 = 0x9270
-0xE74A = 0x9271
-0xE74B = 0x9272
-0xE74C = 0x9273
-0xE74D = 0x9274
-0xE74E = 0x9275
-0xE74F = 0x9276
-0xE750 = 0x9277
-0xE751 = 0x9278
-0xE752 = 0x9279
-0xE753 = 0x927A
-0xE754 = 0x927B
-0xE755 = 0x927C
-0xE756 = 0x927D
-0xE757 = 0x927E
-END_MAP
diff --git a/enc/trans/CP/UCS%CP932VDC@IBM.src b/enc/trans/CP/UCS%CP932VDC@IBM.src
deleted file mode 100644
index 78e9b316b4..0000000000
--- a/enc/trans/CP/UCS%CP932VDC@IBM.src
+++ /dev/null
@@ -1,420 +0,0 @@
-# $NetBSD: UCS%CP932VDC@IBM.src,v 1.1 2006/11/04 03:46:19 tnozaki Exp $
-
-TYPE ROWCOL
-NAME "UCS/CP932VDC:IBM"
-SRC_ZONE 0x2116-0xFFE4
-OOB_MODE INVALID
-DST_INVALID 0xFFFF
-DST_UNIT_BITS 16
-
-BEGIN_MAP
-#
-# This mapping data is made from the mapping data provided by Unicode, Inc.
-# Original notice:
-#
-# Name: cp932 to Unicode table
-# Unicode version: 2.0
-# Table version: 2.01
-# Table format: Format A
-# Date: 04/15/98
-#
-# Contact: cpxlate@microsoft.com
-#
-# General notes: none
-#
-# Format: Three tab-separated columns
-# Column #1 is the cp932 code (in hex)
-# Column #2 is the Unicode (in hex as 0xXXXX)
-# Column #3 is the Unicode name (follows a comment sign, '#')
-#
-# The entries are in cp932 order
-#
-0x2116 = 0x933A
-0x2121 = 0x933B
-0x2160 = 0x932B
-0x2161 = 0x932C
-0x2162 = 0x932D
-0x2163 = 0x932E
-0x2164 = 0x932F
-0x2165 = 0x9330
-0x2166 = 0x9331
-0x2167 = 0x9332
-0x2168 = 0x9333
-0x2169 = 0x9334
-0x2170 = 0x9321
-0x2171 = 0x9322
-0x2172 = 0x9323
-0x2173 = 0x9324
-0x2174 = 0x9325
-0x2175 = 0x9326
-0x2176 = 0x9327
-0x2177 = 0x9328
-0x2178 = 0x9329
-0x2179 = 0x932A
-0x2235 = 0x933C
-0x3231 = 0x9339
-0x4E28 = 0x9349
-0x4EE1 = 0x934A
-0x4EFC = 0x934B
-0x4F00 = 0x934C
-0x4F03 = 0x934D
-0x4F39 = 0x934E
-0x4F56 = 0x934F
-0x4F8A = 0x9351
-0x4F92 = 0x9350
-0x4F94 = 0x9353
-0x4F9A = 0x9352
-0x4FC9 = 0x9342
-0x4FCD = 0x9354
-0x4FFF = 0x9357
-0x501E = 0x9358
-0x5022 = 0x9356
-0x5040 = 0x9355
-0x5042 = 0x935B
-0x5046 = 0x9359
-0x5070 = 0x935A
-0x5094 = 0x935C
-0x50D8 = 0x935E
-0x50F4 = 0x935D
-0x514A = 0x935F
-0x5164 = 0x9360
-0x519D = 0x9361
-0x51BE = 0x9362
-0x51EC = 0x9363
-0x5215 = 0x9364
-0x529C = 0x9365
-0x52A6 = 0x9366
-0x52AF = 0x9558
-0x52C0 = 0x9367
-0x52DB = 0x9368
-0x5300 = 0x9369
-0x5307 = 0x936A
-0x5324 = 0x936B
-0x5372 = 0x936C
-0x5393 = 0x936D
-0x53B2 = 0x936E
-0x53DD = 0x936F
-0x548A = 0x9372
-0x549C = 0x9371
-0x54A9 = 0x9373
-0x54FF = 0x9374
-0x5586 = 0x9375
-0x5759 = 0x9376
-0x5765 = 0x9377
-0x57AC = 0x9378
-0x57C7 = 0x937A
-0x57C8 = 0x9379
-0x589E = 0x937D
-0x58B2 = 0x937E
-0x590B = 0x9421
-0x5953 = 0x9422
-0x595B = 0x9423
-0x595D = 0x9424
-0x5963 = 0x9425
-0x59A4 = 0x9426
-0x59BA = 0x9427
-0x5B56 = 0x9428
-0x5BC0 = 0x9429
-0x5BD8 = 0x942B
-0x5BEC = 0x942C
-0x5C1E = 0x942D
-0x5CA6 = 0x942E
-0x5CBA = 0x942F
-0x5CF5 = 0x9430
-0x5D27 = 0x9431
-0x5D42 = 0x9434
-0x5D53 = 0x9432
-0x5D6D = 0x9435
-0x5DB8 = 0x9436
-0x5DB9 = 0x9437
-0x5DD0 = 0x9438
-0x5F21 = 0x9439
-0x5F34 = 0x943A
-0x5F45 = 0x9348
-0x5F67 = 0x943B
-0x5FB7 = 0x943C
-0x5FDE = 0x943D
-0x605D = 0x943E
-0x6085 = 0x943F
-0x608A = 0x9440
-0x60D5 = 0x9442
-0x60DE = 0x9441
-0x60F2 = 0x9444
-0x6111 = 0x9445
-0x6120 = 0x9443
-0x6130 = 0x9447
-0x6137 = 0x9446
-0x6198 = 0x9448
-0x6213 = 0x9449
-0x62A6 = 0x944A
-0x63F5 = 0x944B
-0x6460 = 0x944C
-0x649D = 0x944D
-0x64CE = 0x944E
-0x654E = 0x944F
-0x6600 = 0x9450
-0x6609 = 0x9453
-0x6615 = 0x9451
-0x661E = 0x9455
-0x6624 = 0x9456
-0x662E = 0x9454
-0x6631 = 0x9344
-0x663B = 0x9452
-0x6657 = 0x9458
-0x6659 = 0x9459
-0x6665 = 0x9457
-0x6673 = 0x945B
-0x6699 = 0x945C
-0x66A0 = 0x945D
-0x66B2 = 0x945E
-0x66BF = 0x945F
-0x66FA = 0x9460
-0x66FB = 0x9347
-0x670E = 0x9461
-0x6766 = 0x9463
-0x67BB = 0x9464
-0x67C0 = 0x9466
-0x6801 = 0x9467
-0x6844 = 0x9468
-0x6852 = 0x9465
-0x68C8 = 0x9345
-0x68CF = 0x9469
-0x6968 = 0x946B
-0x6998 = 0x946D
-0x69E2 = 0x946E
-0x6A30 = 0x946F
-0x6A46 = 0x9471
-0x6A6B = 0x9470
-0x6A73 = 0x9472
-0x6A7E = 0x9473
-0x6AE2 = 0x9474
-0x6AE4 = 0x9475
-0x6BD6 = 0x9476
-0x6C3F = 0x9477
-0x6C5C = 0x9478
-0x6C6F = 0x947A
-0x6C86 = 0x9479
-0x6CDA = 0x947B
-0x6D04 = 0x947C
-0x6D6F = 0x947E
-0x6D87 = 0x947D
-0x6D96 = 0x9521
-0x6DAC = 0x9522
-0x6DCF = 0x9523
-0x6DF2 = 0x9525
-0x6DF8 = 0x9524
-0x6DFC = 0x9526
-0x6E27 = 0x9529
-0x6E39 = 0x9527
-0x6E3C = 0x952A
-0x6E5C = 0x9528
-0x6EBF = 0x952B
-0x6F88 = 0x952C
-0x6FB5 = 0x952D
-0x6FF5 = 0x952E
-0x7005 = 0x952F
-0x7007 = 0x9530
-0x7028 = 0x9531
-0x7085 = 0x9532
-0x70AB = 0x9533
-0x70BB = 0x9343
-0x7104 = 0x9535
-0x710F = 0x9534
-0x7146 = 0x9537
-0x7147 = 0x9538
-0x715C = 0x9536
-0x71C1 = 0x953A
-0x71FE = 0x953B
-0x72B1 = 0x953C
-0x72BE = 0x953D
-0x7324 = 0x953E
-0x7377 = 0x9540
-0x73BD = 0x9541
-0x73C9 = 0x9542
-0x73D2 = 0x9545
-0x73D6 = 0x9543
-0x73E3 = 0x9544
-0x73F5 = 0x9547
-0x7407 = 0x9546
-0x7426 = 0x9548
-0x7429 = 0x954A
-0x742A = 0x9549
-0x742E = 0x954B
-0x7462 = 0x954C
-0x7489 = 0x954D
-0x749F = 0x954E
-0x7501 = 0x954F
-0x752F = 0x942A
-0x756F = 0x9550
-0x7682 = 0x9551
-0x769B = 0x9554
-0x769C = 0x9552
-0x769E = 0x9553
-0x76A6 = 0x9555
-0x7746 = 0x9557
-0x7821 = 0x9559
-0x784E = 0x955A
-0x7864 = 0x955B
-0x787A = 0x955C
-0x7930 = 0x955D
-0x7994 = 0x9561
-0x799B = 0x9563
-0x7AD1 = 0x9564
-0x7AE7 = 0x9565
-0x7AEB = 0x9567
-0x7B9E = 0x9568
-0x7D48 = 0x956A
-0x7D5C = 0x956B
-0x7DA0 = 0x956D
-0x7DB7 = 0x956C
-0x7DD6 = 0x956E
-0x7E52 = 0x956F
-0x7E8A = 0x933D
-0x7F47 = 0x9570
-0x7FA1 = 0x9571
-0x8301 = 0x9573
-0x8362 = 0x9574
-0x837F = 0x9575
-0x83C7 = 0x9576
-0x83F6 = 0x9577
-0x8448 = 0x9578
-0x84B4 = 0x9579
-0x84DC = 0x9341
-0x8553 = 0x957A
-0x8559 = 0x957B
-0x856B = 0x957C
-0x85B0 = 0x957E
-0x8807 = 0x9623
-0x88F5 = 0x9624
-0x891C = 0x933E
-0x8A12 = 0x9625
-0x8A37 = 0x9626
-0x8A79 = 0x9627
-0x8AA7 = 0x9628
-0x8ABE = 0x9629
-0x8ADF = 0x962A
-0x8AF6 = 0x962C
-0x8B53 = 0x962D
-0x8B7F = 0x962E
-0x8CF0 = 0x962F
-0x8CF4 = 0x9630
-0x8D12 = 0x9631
-0x8D76 = 0x9632
-0x8ECF = 0x9634
-0x9067 = 0x9637
-0x90DE = 0x9638
-0x9115 = 0x963A
-0x9127 = 0x963B
-0x91D7 = 0x963D
-0x91DA = 0x963C
-0x91DE = 0x963E
-0x91E4 = 0x9641
-0x91E5 = 0x9642
-0x91ED = 0x963F
-0x91EE = 0x9640
-0x9206 = 0x9643
-0x920A = 0x9645
-0x9210 = 0x9644
-0x9239 = 0x964C
-0x923A = 0x9646
-0x923C = 0x9648
-0x9240 = 0x9647
-0x924E = 0x9649
-0x9251 = 0x964B
-0x9259 = 0x964A
-0x9267 = 0x964D
-0x9277 = 0x964F
-0x9278 = 0x9650
-0x9288 = 0x9340
-0x92A7 = 0x964E
-0x92D0 = 0x9654
-0x92D3 = 0x9658
-0x92D5 = 0x9656
-0x92D7 = 0x9652
-0x92D9 = 0x9653
-0x92E0 = 0x9657
-0x92E7 = 0x9651
-0x92F9 = 0x9346
-0x92FB = 0x965B
-0x92FF = 0x965E
-0x9302 = 0x9660
-0x931D = 0x965F
-0x931E = 0x965D
-0x9321 = 0x965A
-0x9325 = 0x9659
-0x9348 = 0x933F
-0x9357 = 0x9662
-0x9370 = 0x9661
-0x93A4 = 0x9663
-0x93C6 = 0x9664
-0x93DE = 0x9665
-0x93F8 = 0x9666
-0x9431 = 0x9667
-0x9445 = 0x9668
-0x9448 = 0x9669
-0x9592 = 0x966A
-0x969D = 0x966D
-0x96AF = 0x966E
-0x9733 = 0x966F
-0x973B = 0x9670
-0x9743 = 0x9671
-0x974D = 0x9672
-0x974F = 0x9673
-0x9751 = 0x9674
-0x9755 = 0x9675
-0x9857 = 0x9676
-0x9865 = 0x9677
-0x9927 = 0x967A
-0x999E = 0x967C
-0x9A4E = 0x967D
-0x9AD9 = 0x967E
-0x9ADC = 0x9721
-0x9B72 = 0x9723
-0x9B75 = 0x9722
-0x9B8F = 0x9724
-0x9BB1 = 0x9725
-0x9BBB = 0x9726
-0x9C00 = 0x9727
-0x9D6B = 0x9729
-0x9D70 = 0x9728
-0x9E19 = 0x972B
-0x9ED1 = 0x972C
-0xF929 = 0x9462
-0xF9DC = 0x966B
-0xFA0E = 0x9370
-0xFA0F = 0x937B
-0xFA10 = 0x937C
-0xFA11 = 0x9433
-0xFA12 = 0x945A
-0xFA13 = 0x946A
-0xFA14 = 0x946C
-0xFA15 = 0x9539
-0xFA16 = 0x953F
-0xFA17 = 0x9556
-0xFA18 = 0x955E
-0xFA19 = 0x955F
-0xFA1A = 0x9560
-0xFA1B = 0x9562
-0xFA1C = 0x9566
-0xFA1D = 0x9569
-0xFA1E = 0x9572
-0xFA1F = 0x957D
-0xFA20 = 0x9621
-0xFA21 = 0x9622
-0xFA22 = 0x962B
-0xFA23 = 0x9633
-0xFA24 = 0x9635
-0xFA25 = 0x9636
-0xFA26 = 0x9639
-0xFA27 = 0x9655
-0xFA28 = 0x965C
-0xFA29 = 0x966C
-0xFA2A = 0x9678
-0xFA2B = 0x9679
-0xFA2C = 0x967B
-0xFA2D = 0x972A
-0xFF02 = 0x9338
-0xFF07 = 0x9337
-0xFFE2 = 0x9335
-0xFFE4 = 0x9336
-END_MAP
diff --git a/enc/trans/CP/UCS%CP932VDC@NEC_IBM.src b/enc/trans/CP/UCS%CP932VDC@NEC_IBM.src
deleted file mode 100644
index f94167aaa4..0000000000
--- a/enc/trans/CP/UCS%CP932VDC@NEC_IBM.src
+++ /dev/null
@@ -1,406 +0,0 @@
-# $NetBSD: UCS%CP932VDC@NEC_IBM.src,v 1.1 2006/11/04 03:46:19 tnozaki Exp $
-
-TYPE ROWCOL
-NAME "UCS/CP932VDC:NEC_IBM"
-SRC_ZONE 0x2170-0xFFE4
-OOB_MODE INVALID
-DST_INVALID 0xFFFF
-DST_UNIT_BITS 16
-
-BEGIN_MAP
-#
-# This mapping data is made from the mapping data provided by Unicode, Inc.
-# Original notice:
-#
-# Name: cp932 to Unicode table
-# Unicode version: 2.0
-# Table version: 2.01
-# Table format: Format A
-# Date: 04/15/98
-#
-# Contact: cpxlate@microsoft.com
-#
-# General notes: none
-#
-# Format: Three tab-separated columns
-# Column #1 is the cp932 code (in hex)
-# Column #2 is the Unicode (in hex as 0xXXXX)
-# Column #3 is the Unicode name (follows a comment sign, '#')
-#
-# The entries are in cp932 order
-#
-0x2170 = 0x7C71
-0x2171 = 0x7C72
-0x2172 = 0x7C73
-0x2173 = 0x7C74
-0x2174 = 0x7C75
-0x2175 = 0x7C76
-0x2176 = 0x7C77
-0x2177 = 0x7C78
-0x2178 = 0x7C79
-0x2179 = 0x7C7A
-0x4E28 = 0x792D
-0x4EE1 = 0x792E
-0x4EFC = 0x792F
-0x4F00 = 0x7930
-0x4F03 = 0x7931
-0x4F39 = 0x7932
-0x4F56 = 0x7933
-0x4F8A = 0x7935
-0x4F92 = 0x7934
-0x4F94 = 0x7937
-0x4F9A = 0x7936
-0x4FC9 = 0x7926
-0x4FCD = 0x7938
-0x4FFF = 0x793B
-0x501E = 0x793C
-0x5022 = 0x793A
-0x5040 = 0x7939
-0x5042 = 0x793F
-0x5046 = 0x793D
-0x5070 = 0x793E
-0x5094 = 0x7940
-0x50D8 = 0x7942
-0x50F4 = 0x7941
-0x514A = 0x7943
-0x5164 = 0x7944
-0x519D = 0x7945
-0x51BE = 0x7946
-0x51EC = 0x7947
-0x5215 = 0x7948
-0x529C = 0x7949
-0x52A6 = 0x794A
-0x52AF = 0x7B3C
-0x52C0 = 0x794B
-0x52DB = 0x794C
-0x5300 = 0x794D
-0x5307 = 0x794E
-0x5324 = 0x794F
-0x5372 = 0x7950
-0x5393 = 0x7951
-0x53B2 = 0x7952
-0x53DD = 0x7953
-0x548A = 0x7956
-0x549C = 0x7955
-0x54A9 = 0x7957
-0x54FF = 0x7958
-0x5586 = 0x7959
-0x5759 = 0x795A
-0x5765 = 0x795B
-0x57AC = 0x795C
-0x57C7 = 0x795E
-0x57C8 = 0x795D
-0x589E = 0x7961
-0x58B2 = 0x7962
-0x590B = 0x7963
-0x5953 = 0x7964
-0x595B = 0x7965
-0x595D = 0x7966
-0x5963 = 0x7967
-0x59A4 = 0x7968
-0x59BA = 0x7969
-0x5B56 = 0x796A
-0x5BC0 = 0x796B
-0x5BD8 = 0x796D
-0x5BEC = 0x796E
-0x5C1E = 0x796F
-0x5CA6 = 0x7970
-0x5CBA = 0x7971
-0x5CF5 = 0x7972
-0x5D27 = 0x7973
-0x5D42 = 0x7976
-0x5D53 = 0x7974
-0x5D6D = 0x7977
-0x5DB8 = 0x7978
-0x5DB9 = 0x7979
-0x5DD0 = 0x797A
-0x5F21 = 0x797B
-0x5F34 = 0x797C
-0x5F45 = 0x792C
-0x5F67 = 0x797D
-0x5FB7 = 0x797E
-0x5FDE = 0x7A21
-0x605D = 0x7A22
-0x6085 = 0x7A23
-0x608A = 0x7A24
-0x60D5 = 0x7A26
-0x60DE = 0x7A25
-0x60F2 = 0x7A28
-0x6111 = 0x7A29
-0x6120 = 0x7A27
-0x6130 = 0x7A2B
-0x6137 = 0x7A2A
-0x6198 = 0x7A2C
-0x6213 = 0x7A2D
-0x62A6 = 0x7A2E
-0x63F5 = 0x7A2F
-0x6460 = 0x7A30
-0x649D = 0x7A31
-0x64CE = 0x7A32
-0x654E = 0x7A33
-0x6600 = 0x7A34
-0x6609 = 0x7A37
-0x6615 = 0x7A35
-0x661E = 0x7A39
-0x6624 = 0x7A3A
-0x662E = 0x7A38
-0x6631 = 0x7928
-0x663B = 0x7A36
-0x6657 = 0x7A3C
-0x6659 = 0x7A3D
-0x6665 = 0x7A3B
-0x6673 = 0x7A3F
-0x6699 = 0x7A40
-0x66A0 = 0x7A41
-0x66B2 = 0x7A42
-0x66BF = 0x7A43
-0x66FA = 0x7A44
-0x66FB = 0x792B
-0x670E = 0x7A45
-0x6766 = 0x7A47
-0x67BB = 0x7A48
-0x67C0 = 0x7A4A
-0x6801 = 0x7A4B
-0x6844 = 0x7A4C
-0x6852 = 0x7A49
-0x68C8 = 0x7929
-0x68CF = 0x7A4D
-0x6968 = 0x7A4F
-0x6998 = 0x7A51
-0x69E2 = 0x7A52
-0x6A30 = 0x7A53
-0x6A46 = 0x7A55
-0x6A6B = 0x7A54
-0x6A73 = 0x7A56
-0x6A7E = 0x7A57
-0x6AE2 = 0x7A58
-0x6AE4 = 0x7A59
-0x6BD6 = 0x7A5A
-0x6C3F = 0x7A5B
-0x6C5C = 0x7A5C
-0x6C6F = 0x7A5E
-0x6C86 = 0x7A5D
-0x6CDA = 0x7A5F
-0x6D04 = 0x7A60
-0x6D6F = 0x7A62
-0x6D87 = 0x7A61
-0x6D96 = 0x7A63
-0x6DAC = 0x7A64
-0x6DCF = 0x7A65
-0x6DF2 = 0x7A67
-0x6DF8 = 0x7A66
-0x6DFC = 0x7A68
-0x6E27 = 0x7A6B
-0x6E39 = 0x7A69
-0x6E3C = 0x7A6C
-0x6E5C = 0x7A6A
-0x6EBF = 0x7A6D
-0x6F88 = 0x7A6E
-0x6FB5 = 0x7A6F
-0x6FF5 = 0x7A70
-0x7005 = 0x7A71
-0x7007 = 0x7A72
-0x7028 = 0x7A73
-0x7085 = 0x7A74
-0x70AB = 0x7A75
-0x70BB = 0x7927
-0x7104 = 0x7A77
-0x710F = 0x7A76
-0x7146 = 0x7A79
-0x7147 = 0x7A7A
-0x715C = 0x7A78
-0x71C1 = 0x7A7C
-0x71FE = 0x7A7D
-0x72B1 = 0x7A7E
-0x72BE = 0x7B21
-0x7324 = 0x7B22
-0x7377 = 0x7B24
-0x73BD = 0x7B25
-0x73C9 = 0x7B26
-0x73D2 = 0x7B29
-0x73D6 = 0x7B27
-0x73E3 = 0x7B28
-0x73F5 = 0x7B2B
-0x7407 = 0x7B2A
-0x7426 = 0x7B2C
-0x7429 = 0x7B2E
-0x742A = 0x7B2D
-0x742E = 0x7B2F
-0x7462 = 0x7B30
-0x7489 = 0x7B31
-0x749F = 0x7B32
-0x7501 = 0x7B33
-0x752F = 0x796C
-0x756F = 0x7B34
-0x7682 = 0x7B35
-0x769B = 0x7B38
-0x769C = 0x7B36
-0x769E = 0x7B37
-0x76A6 = 0x7B39
-0x7746 = 0x7B3B
-0x7821 = 0x7B3D
-0x784E = 0x7B3E
-0x7864 = 0x7B3F
-0x787A = 0x7B40
-0x7930 = 0x7B41
-0x7994 = 0x7B45
-0x799B = 0x7B47
-0x7AD1 = 0x7B48
-0x7AE7 = 0x7B49
-0x7AEB = 0x7B4B
-0x7B9E = 0x7B4C
-0x7D48 = 0x7B4E
-0x7D5C = 0x7B4F
-0x7DA0 = 0x7B51
-0x7DB7 = 0x7B50
-0x7DD6 = 0x7B52
-0x7E52 = 0x7B53
-0x7E8A = 0x7921
-0x7F47 = 0x7B54
-0x7FA1 = 0x7B55
-0x8301 = 0x7B57
-0x8362 = 0x7B58
-0x837F = 0x7B59
-0x83C7 = 0x7B5A
-0x83F6 = 0x7B5B
-0x8448 = 0x7B5C
-0x84B4 = 0x7B5D
-0x84DC = 0x7925
-0x8553 = 0x7B5E
-0x8559 = 0x7B5F
-0x856B = 0x7B60
-0x85B0 = 0x7B62
-0x8807 = 0x7B65
-0x88F5 = 0x7B66
-0x891C = 0x7922
-0x8A12 = 0x7B67
-0x8A37 = 0x7B68
-0x8A79 = 0x7B69
-0x8AA7 = 0x7B6A
-0x8ABE = 0x7B6B
-0x8ADF = 0x7B6C
-0x8AF6 = 0x7B6E
-0x8B53 = 0x7B6F
-0x8B7F = 0x7B70
-0x8CF0 = 0x7B71
-0x8CF4 = 0x7B72
-0x8D12 = 0x7B73
-0x8D76 = 0x7B74
-0x8ECF = 0x7B76
-0x9067 = 0x7B79
-0x90DE = 0x7B7A
-0x9115 = 0x7B7C
-0x9127 = 0x7B7D
-0x91D7 = 0x7C21
-0x91DA = 0x7B7E
-0x91DE = 0x7C22
-0x91E4 = 0x7C25
-0x91E5 = 0x7C26
-0x91ED = 0x7C23
-0x91EE = 0x7C24
-0x9206 = 0x7C27
-0x920A = 0x7C29
-0x9210 = 0x7C28
-0x9239 = 0x7C30
-0x923A = 0x7C2A
-0x923C = 0x7C2C
-0x9240 = 0x7C2B
-0x924E = 0x7C2D
-0x9251 = 0x7C2F
-0x9259 = 0x7C2E
-0x9267 = 0x7C31
-0x9277 = 0x7C33
-0x9278 = 0x7C34
-0x9288 = 0x7924
-0x92A7 = 0x7C32
-0x92D0 = 0x7C38
-0x92D3 = 0x7C3C
-0x92D5 = 0x7C3A
-0x92D7 = 0x7C36
-0x92D9 = 0x7C37
-0x92E0 = 0x7C3B
-0x92E7 = 0x7C35
-0x92F9 = 0x792A
-0x92FB = 0x7C3F
-0x92FF = 0x7C42
-0x9302 = 0x7C44
-0x931D = 0x7C43
-0x931E = 0x7C41
-0x9321 = 0x7C3E
-0x9325 = 0x7C3D
-0x9348 = 0x7923
-0x9357 = 0x7C46
-0x9370 = 0x7C45
-0x93A4 = 0x7C47
-0x93C6 = 0x7C48
-0x93DE = 0x7C49
-0x93F8 = 0x7C4A
-0x9431 = 0x7C4B
-0x9445 = 0x7C4C
-0x9448 = 0x7C4D
-0x9592 = 0x7C4E
-0x969D = 0x7C51
-0x96AF = 0x7C52
-0x9733 = 0x7C53
-0x973B = 0x7C54
-0x9743 = 0x7C55
-0x974D = 0x7C56
-0x974F = 0x7C57
-0x9751 = 0x7C58
-0x9755 = 0x7C59
-0x9857 = 0x7C5A
-0x9865 = 0x7C5B
-0x9927 = 0x7C5E
-0x999E = 0x7C60
-0x9A4E = 0x7C61
-0x9AD9 = 0x7C62
-0x9ADC = 0x7C63
-0x9B72 = 0x7C65
-0x9B75 = 0x7C64
-0x9B8F = 0x7C66
-0x9BB1 = 0x7C67
-0x9BBB = 0x7C68
-0x9C00 = 0x7C69
-0x9D6B = 0x7C6B
-0x9D70 = 0x7C6A
-0x9E19 = 0x7C6D
-0x9ED1 = 0x7C6E
-0xF929 = 0x7A46
-0xF9DC = 0x7C4F
-0xFA0E = 0x7954
-0xFA0F = 0x795F
-0xFA10 = 0x7960
-0xFA11 = 0x7975
-0xFA12 = 0x7A3E
-0xFA13 = 0x7A4E
-0xFA14 = 0x7A50
-0xFA15 = 0x7A7B
-0xFA16 = 0x7B23
-0xFA17 = 0x7B3A
-0xFA18 = 0x7B42
-0xFA19 = 0x7B43
-0xFA1A = 0x7B44
-0xFA1B = 0x7B46
-0xFA1C = 0x7B4A
-0xFA1D = 0x7B4D
-0xFA1E = 0x7B56
-0xFA1F = 0x7B61
-0xFA20 = 0x7B63
-0xFA21 = 0x7B64
-0xFA22 = 0x7B6D
-0xFA23 = 0x7B75
-0xFA24 = 0x7B77
-0xFA25 = 0x7B78
-0xFA26 = 0x7B7B
-0xFA27 = 0x7C39
-0xFA28 = 0x7C40
-0xFA29 = 0x7C50
-0xFA2A = 0x7C5C
-0xFA2B = 0x7C5D
-0xFA2C = 0x7C5F
-0xFA2D = 0x7C6C
-0xFF02 = 0x7C7E
-0xFF07 = 0x7C7D
-0xFFE2 = 0x7C7B
-0xFFE4 = 0x7C7C
-END_MAP
diff --git a/enc/trans/GB/GB12345%UCS.src b/enc/trans/GB/GB12345%UCS.src
deleted file mode 100644
index 0b4115bed9..0000000000
--- a/enc/trans/GB/GB12345%UCS.src
+++ /dev/null
@@ -1,7618 +0,0 @@
-# $NetBSD: GB12345%UCS.src,v 1.1 2006/11/23 03:25:24 tnozaki Exp $
-
-TYPE ROWCOL
-NAME "GB12345/UCS"
-SRC_ZONE 0x21-0x79 / 0x21-0x7E / 8
-OOB_MODE ILSEQ
-DST_ILSEQ 0xFFFE
-DST_UNIT_BITS 16
-
-BEGIN_MAP
-#
-# 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
-0x2122 = 0x3001
-0x2123 = 0x3002
-0x2124 = 0x00B7
-0x2125 = 0x02C9
-0x2126 = 0x02C7
-0x2127 = 0x00A8
-0x2128 = 0x3003
-0x2129 = 0x3005
-0x212A = 0x2014
-0x212B = 0xFF5E
-0x212C = 0x2016
-0x212D = 0x2026
-0x212E = 0x2018
-0x212F = 0x2019
-0x2130 = 0x201C
-0x2131 = 0x201D
-0x2132 = 0x3014
-0x2133 = 0x3015
-0x2134 = 0x3008
-0x2135 = 0x3009
-0x2136 = 0x300A
-0x2137 = 0x300B
-0x2138 = 0x300C
-0x2139 = 0x300D
-0x213A = 0x300E
-0x213B = 0x300F
-0x213C = 0x3016
-0x213D = 0x3017
-0x213E = 0x3010
-0x213F = 0x3011
-0x2140 = 0x00B1
-0x2141 = 0x00D7
-0x2142 = 0x00F7
-0x2143 = 0x2236
-0x2144 = 0x2227
-0x2145 = 0x2228
-0x2146 = 0x2211
-0x2147 = 0x220F
-0x2148 = 0x222A
-0x2149 = 0x2229
-0x214A = 0x2208
-0x214B = 0x2237
-0x214C = 0x221A
-0x214D = 0x22A5
-0x214E = 0x2225
-0x214F = 0x2220
-0x2150 = 0x2312
-0x2151 = 0x2299
-0x2152 = 0x222B
-0x2153 = 0x222E
-0x2154 = 0x2261
-0x2155 = 0x224C
-0x2156 = 0x2248
-0x2157 = 0x223D
-0x2158 = 0x221D
-0x2159 = 0x2260
-0x215A = 0x226E
-0x215B = 0x226F
-0x215C = 0x2264
-0x215D = 0x2265
-0x215E = 0x221E
-0x215F = 0x2235
-0x2160 = 0x2234
-0x2161 = 0x2642
-0x2162 = 0x2640
-0x2163 = 0x00B0
-0x2164 = 0x2032
-0x2165 = 0x2033
-0x2166 = 0x2103
-0x2167 = 0xFF04
-0x2168 = 0x00A4
-0x2169 = 0xFFE0
-0x216A = 0xFFE1
-0x216B = 0x2030
-0x216C = 0x00A7
-0x216D = 0x2116
-0x216E = 0x2606
-0x216F = 0x2605
-0x2170 = 0x25CB
-0x2171 = 0x25CF
-0x2172 = 0x25CE
-0x2173 = 0x25C7
-0x2174 = 0x25C6
-0x2175 = 0x25A1
-0x2176 = 0x25A0
-0x2177 = 0x25B3
-0x2178 = 0x25B2
-0x2179 = 0x203B
-0x217A = 0x2192
-0x217B = 0x2190
-0x217C = 0x2191
-0x217D = 0x2193
-0x217E = 0x3013
-0x2231 = 0x2488
-0x2232 = 0x2489
-0x2233 = 0x248A
-0x2234 = 0x248B
-0x2235 = 0x248C
-0x2236 = 0x248D
-0x2237 = 0x248E
-0x2238 = 0x248F
-0x2239 = 0x2490
-0x223A = 0x2491
-0x223B = 0x2492
-0x223C = 0x2493
-0x223D = 0x2494
-0x223E = 0x2495
-0x223F = 0x2496
-0x2240 = 0x2497
-0x2241 = 0x2498
-0x2242 = 0x2499
-0x2243 = 0x249A
-0x2244 = 0x249B
-0x2245 = 0x2474
-0x2246 = 0x2475
-0x2247 = 0x2476
-0x2248 = 0x2477
-0x2249 = 0x2478
-0x224A = 0x2479
-0x224B = 0x247A
-0x224C = 0x247B
-0x224D = 0x247C
-0x224E = 0x247D
-0x224F = 0x247E
-0x2250 = 0x247F
-0x2251 = 0x2480
-0x2252 = 0x2481
-0x2253 = 0x2482
-0x2254 = 0x2483
-0x2255 = 0x2484
-0x2256 = 0x2485
-0x2257 = 0x2486
-0x2258 = 0x2487
-0x2259 = 0x2460
-0x225A = 0x2461
-0x225B = 0x2462
-0x225C = 0x2463
-0x225D = 0x2464
-0x225E = 0x2465
-0x225F = 0x2466
-0x2260 = 0x2467
-0x2261 = 0x2468
-0x2262 = 0x2469
-0x2265 = 0x3220
-0x2266 = 0x3221
-0x2267 = 0x3222
-0x2268 = 0x3223
-0x2269 = 0x3224
-0x226A = 0x3225
-0x226B = 0x3226
-0x226C = 0x3227
-0x226D = 0x3228
-0x226E = 0x3229
-0x2271 = 0x2160
-0x2272 = 0x2161
-0x2273 = 0x2162
-0x2274 = 0x2163
-0x2275 = 0x2164
-0x2276 = 0x2165
-0x2277 = 0x2166
-0x2278 = 0x2167
-0x2279 = 0x2168
-0x227A = 0x2169
-0x227B = 0x216A
-0x227C = 0x216B
-0x2321 = 0xFF01
-0x2322 = 0xFF02
-0x2323 = 0xFF03
-0x2324 = 0xFFE5
-0x2325 = 0xFF05
-0x2326 = 0xFF06
-0x2327 = 0xFF07
-0x2328 = 0xFF08
-0x2329 = 0xFF09
-0x232A = 0xFF0A
-0x232B = 0xFF0B
-0x232C = 0xFF0C
-0x232D = 0xFF0D
-0x232E = 0xFF0E
-0x232F = 0xFF0F
-0x2330 = 0xFF10
-0x2331 = 0xFF11
-0x2332 = 0xFF12
-0x2333 = 0xFF13
-0x2334 = 0xFF14
-0x2335 = 0xFF15
-0x2336 = 0xFF16
-0x2337 = 0xFF17
-0x2338 = 0xFF18
-0x2339 = 0xFF19
-0x233A = 0xFF1A
-0x233B = 0xFF1B
-0x233C = 0xFF1C
-0x233D = 0xFF1D
-0x233E = 0xFF1E
-0x233F = 0xFF1F
-0x2340 = 0xFF20
-0x2341 = 0xFF21
-0x2342 = 0xFF22
-0x2343 = 0xFF23
-0x2344 = 0xFF24
-0x2345 = 0xFF25
-0x2346 = 0xFF26
-0x2347 = 0xFF27
-0x2348 = 0xFF28
-0x2349 = 0xFF29
-0x234A = 0xFF2A
-0x234B = 0xFF2B
-0x234C = 0xFF2C
-0x234D = 0xFF2D
-0x234E = 0xFF2E
-0x234F = 0xFF2F
-0x2350 = 0xFF30
-0x2351 = 0xFF31
-0x2352 = 0xFF32
-0x2353 = 0xFF33
-0x2354 = 0xFF34
-0x2355 = 0xFF35
-0x2356 = 0xFF36
-0x2357 = 0xFF37
-0x2358 = 0xFF38
-0x2359 = 0xFF39
-0x235A = 0xFF3A
-0x235B = 0xFF3B
-0x235C = 0xFF3C
-0x235D = 0xFF3D
-0x235E = 0xFF3E
-0x235F = 0xFF3F
-0x2360 = 0xFF40
-0x2361 = 0xFF41
-0x2362 = 0xFF42
-0x2363 = 0xFF43
-0x2364 = 0xFF44
-0x2365 = 0xFF45
-0x2366 = 0xFF46
-0x2367 = 0xFF47
-0x2368 = 0xFF48
-0x2369 = 0xFF49
-0x236A = 0xFF4A
-0x236B = 0xFF4B
-0x236C = 0xFF4C
-0x236D = 0xFF4D
-0x236E = 0xFF4E
-0x236F = 0xFF4F
-0x2370 = 0xFF50
-0x2371 = 0xFF51
-0x2372 = 0xFF52
-0x2373 = 0xFF53
-0x2374 = 0xFF54
-0x2375 = 0xFF55
-0x2376 = 0xFF56
-0x2377 = 0xFF57
-0x2378 = 0xFF58
-0x2379 = 0xFF59
-0x237A = 0xFF5A
-0x237B = 0xFF5B
-0x237C = 0xFF5C
-0x237D = 0xFF5D
-0x237E = 0xFFE3
-0x2421 = 0x3041
-0x2422 = 0x3042
-0x2423 = 0x3043
-0x2424 = 0x3044
-0x2425 = 0x3045
-0x2426 = 0x3046
-0x2427 = 0x3047
-0x2428 = 0x3048
-0x2429 = 0x3049
-0x242A = 0x304A
-0x242B = 0x304B
-0x242C = 0x304C
-0x242D = 0x304D
-0x242E = 0x304E
-0x242F = 0x304F
-0x2430 = 0x3050
-0x2431 = 0x3051
-0x2432 = 0x3052
-0x2433 = 0x3053
-0x2434 = 0x3054
-0x2435 = 0x3055
-0x2436 = 0x3056
-0x2437 = 0x3057
-0x2438 = 0x3058
-0x2439 = 0x3059
-0x243A = 0x305A
-0x243B = 0x305B
-0x243C = 0x305C
-0x243D = 0x305D
-0x243E = 0x305E
-0x243F = 0x305F
-0x2440 = 0x3060
-0x2441 = 0x3061
-0x2442 = 0x3062
-0x2443 = 0x3063
-0x2444 = 0x3064
-0x2445 = 0x3065
-0x2446 = 0x3066
-0x2447 = 0x3067
-0x2448 = 0x3068
-0x2449 = 0x3069
-0x244A = 0x306A
-0x244B = 0x306B
-0x244C = 0x306C
-0x244D = 0x306D
-0x244E = 0x306E
-0x244F = 0x306F
-0x2450 = 0x3070
-0x2451 = 0x3071
-0x2452 = 0x3072
-0x2453 = 0x3073
-0x2454 = 0x3074
-0x2455 = 0x3075
-0x2456 = 0x3076
-0x2457 = 0x3077
-0x2458 = 0x3078
-0x2459 = 0x3079
-0x245A = 0x307A
-0x245B = 0x307B
-0x245C = 0x307C
-0x245D = 0x307D
-0x245E = 0x307E
-0x245F = 0x307F
-0x2460 = 0x3080
-0x2461 = 0x3081
-0x2462 = 0x3082
-0x2463 = 0x3083
-0x2464 = 0x3084
-0x2465 = 0x3085
-0x2466 = 0x3086
-0x2467 = 0x3087
-0x2468 = 0x3088
-0x2469 = 0x3089
-0x246A = 0x308A
-0x246B = 0x308B
-0x246C = 0x308C
-0x246D = 0x308D
-0x246E = 0x308E
-0x246F = 0x308F
-0x2470 = 0x3090
-0x2471 = 0x3091
-0x2472 = 0x3092
-0x2473 = 0x3093
-0x2521 = 0x30A1
-0x2522 = 0x30A2
-0x2523 = 0x30A3
-0x2524 = 0x30A4
-0x2525 = 0x30A5
-0x2526 = 0x30A6
-0x2527 = 0x30A7
-0x2528 = 0x30A8
-0x2529 = 0x30A9
-0x252A = 0x30AA
-0x252B = 0x30AB
-0x252C = 0x30AC
-0x252D = 0x30AD
-0x252E = 0x30AE
-0x252F = 0x30AF
-0x2530 = 0x30B0
-0x2531 = 0x30B1
-0x2532 = 0x30B2
-0x2533 = 0x30B3
-0x2534 = 0x30B4
-0x2535 = 0x30B5
-0x2536 = 0x30B6
-0x2537 = 0x30B7
-0x2538 = 0x30B8
-0x2539 = 0x30B9
-0x253A = 0x30BA
-0x253B = 0x30BB
-0x253C = 0x30BC
-0x253D = 0x30BD
-0x253E = 0x30BE
-0x253F = 0x30BF
-0x2540 = 0x30C0
-0x2541 = 0x30C1
-0x2542 = 0x30C2
-0x2543 = 0x30C3
-0x2544 = 0x30C4
-0x2545 = 0x30C5
-0x2546 = 0x30C6
-0x2547 = 0x30C7
-0x2548 = 0x30C8
-0x2549 = 0x30C9
-0x254A = 0x30CA
-0x254B = 0x30CB
-0x254C = 0x30CC
-0x254D = 0x30CD
-0x254E = 0x30CE
-0x254F = 0x30CF
-0x2550 = 0x30D0
-0x2551 = 0x30D1
-0x2552 = 0x30D2
-0x2553 = 0x30D3
-0x2554 = 0x30D4
-0x2555 = 0x30D5
-0x2556 = 0x30D6
-0x2557 = 0x30D7
-0x2558 = 0x30D8
-0x2559 = 0x30D9
-0x255A = 0x30DA
-0x255B = 0x30DB
-0x255C = 0x30DC
-0x255D = 0x30DD
-0x255E = 0x30DE
-0x255F = 0x30DF
-0x2560 = 0x30E0
-0x2561 = 0x30E1
-0x2562 = 0x30E2
-0x2563 = 0x30E3
-0x2564 = 0x30E4
-0x2565 = 0x30E5
-0x2566 = 0x30E6
-0x2567 = 0x30E7
-0x2568 = 0x30E8
-0x2569 = 0x30E9
-0x256A = 0x30EA
-0x256B = 0x30EB
-0x256C = 0x30EC
-0x256D = 0x30ED
-0x256E = 0x30EE
-0x256F = 0x30EF
-0x2570 = 0x30F0
-0x2571 = 0x30F1
-0x2572 = 0x30F2
-0x2573 = 0x30F3
-0x2574 = 0x30F4
-0x2575 = 0x30F5
-0x2576 = 0x30F6
-0x2621 = 0x0391
-0x2622 = 0x0392
-0x2623 = 0x0393
-0x2624 = 0x0394
-0x2625 = 0x0395
-0x2626 = 0x0396
-0x2627 = 0x0397
-0x2628 = 0x0398
-0x2629 = 0x0399
-0x262A = 0x039A
-0x262B = 0x039B
-0x262C = 0x039C
-0x262D = 0x039D
-0x262E = 0x039E
-0x262F = 0x039F
-0x2630 = 0x03A0
-0x2631 = 0x03A1
-0x2632 = 0x03A3
-0x2633 = 0x03A4
-0x2634 = 0x03A5
-0x2635 = 0x03A6
-0x2636 = 0x03A7
-0x2637 = 0x03A8
-0x2638 = 0x03A9
-0x2641 = 0x03B1
-0x2642 = 0x03B2
-0x2643 = 0x03B3
-0x2644 = 0x03B4
-0x2645 = 0x03B5
-0x2646 = 0x03B6
-0x2647 = 0x03B7
-0x2648 = 0x03B8
-0x2649 = 0x03B9
-0x264A = 0x03BA
-0x264B = 0x03BB
-0x264C = 0x03BC
-0x264D = 0x03BD
-0x264E = 0x03BE
-0x264F = 0x03BF
-0x2650 = 0x03C0
-0x2651 = 0x03C1
-0x2652 = 0x03C3
-0x2653 = 0x03C4
-0x2654 = 0x03C5
-0x2655 = 0x03C6
-0x2656 = 0x03C7
-0x2657 = 0x03C8
-0x2658 = 0x03C9
-0x2721 = 0x0410
-0x2722 = 0x0411
-0x2723 = 0x0412
-0x2724 = 0x0413
-0x2725 = 0x0414
-0x2726 = 0x0415
-0x2727 = 0x0401
-0x2728 = 0x0416
-0x2729 = 0x0417
-0x272A = 0x0418
-0x272B = 0x0419
-0x272C = 0x041A
-0x272D = 0x041B
-0x272E = 0x041C
-0x272F = 0x041D
-0x2730 = 0x041E
-0x2731 = 0x041F
-0x2732 = 0x0420
-0x2733 = 0x0421
-0x2734 = 0x0422
-0x2735 = 0x0423
-0x2736 = 0x0424
-0x2737 = 0x0425
-0x2738 = 0x0426
-0x2739 = 0x0427
-0x273A = 0x0428
-0x273B = 0x0429
-0x273C = 0x042A
-0x273D = 0x042B
-0x273E = 0x042C
-0x273F = 0x042D
-0x2740 = 0x042E
-0x2741 = 0x042F
-0x2751 = 0x0430
-0x2752 = 0x0431
-0x2753 = 0x0432
-0x2754 = 0x0433
-0x2755 = 0x0434
-0x2756 = 0x0435
-0x2757 = 0x0451
-0x2758 = 0x0436
-0x2759 = 0x0437
-0x275A = 0x0438
-0x275B = 0x0439
-0x275C = 0x043A
-0x275D = 0x043B
-0x275E = 0x043C
-0x275F = 0x043D
-0x2760 = 0x043E
-0x2761 = 0x043F
-0x2762 = 0x0440
-0x2763 = 0x0441
-0x2764 = 0x0442
-0x2765 = 0x0443
-0x2766 = 0x0444
-0x2767 = 0x0445
-0x2768 = 0x0446
-0x2769 = 0x0447
-0x276A = 0x0448
-0x276B = 0x0449
-0x276C = 0x044A
-0x276D = 0x044B
-0x276E = 0x044C
-0x276F = 0x044D
-0x2770 = 0x044E
-0x2771 = 0x044F
-0x2821 = 0x0101
-0x2822 = 0x00E1
-0x2823 = 0x01CE
-0x2824 = 0x00E0
-0x2825 = 0x0113
-0x2826 = 0x00E9
-0x2827 = 0x011B
-0x2828 = 0x00E8
-0x2829 = 0x012B
-0x282A = 0x00ED
-0x282B = 0x01D0
-0x282C = 0x00EC
-0x282D = 0x014D
-0x282E = 0x00F3
-0x282F = 0x01D2
-0x2830 = 0x00F2
-0x2831 = 0x016B
-0x2832 = 0x00FA
-0x2833 = 0x01D4
-0x2834 = 0x00F9
-0x2835 = 0x01D6
-0x2836 = 0x01D8
-0x2837 = 0x01DA
-0x2838 = 0x01DC
-0x2839 = 0x00FC
-0x283A = 0x00EA
-0x2845 = 0x3105
-0x2846 = 0x3106
-0x2847 = 0x3107
-0x2848 = 0x3108
-0x2849 = 0x3109
-0x284A = 0x310A
-0x284B = 0x310B
-0x284C = 0x310C
-0x284D = 0x310D
-0x284E = 0x310E
-0x284F = 0x310F
-0x2850 = 0x3110
-0x2851 = 0x3111
-0x2852 = 0x3112
-0x2853 = 0x3113
-0x2854 = 0x3114
-0x2855 = 0x3115
-0x2856 = 0x3116
-0x2857 = 0x3117
-0x2858 = 0x3118
-0x2859 = 0x3119
-0x285A = 0x311A
-0x285B = 0x311B
-0x285C = 0x311C
-0x285D = 0x311D
-0x285E = 0x311E
-0x285F = 0x311F
-0x2860 = 0x3120
-0x2861 = 0x3121
-0x2862 = 0x3122
-0x2863 = 0x3123
-0x2864 = 0x3124
-0x2865 = 0x3125
-0x2866 = 0x3126
-0x2867 = 0x3127
-0x2868 = 0x3128
-0x2869 = 0x3129
-0x2924 = 0x2500
-0x2925 = 0x2501
-0x2926 = 0x2502
-0x2927 = 0x2503
-0x2928 = 0x2504
-0x2929 = 0x2505
-0x292A = 0x2506
-0x292B = 0x2507
-0x292C = 0x2508
-0x292D = 0x2509
-0x292E = 0x250A
-0x292F = 0x250B
-0x2930 = 0x250C
-0x2931 = 0x250D
-0x2932 = 0x250E
-0x2933 = 0x250F
-0x2934 = 0x2510
-0x2935 = 0x2511
-0x2936 = 0x2512
-0x2937 = 0x2513
-0x2938 = 0x2514
-0x2939 = 0x2515
-0x293A = 0x2516
-0x293B = 0x2517
-0x293C = 0x2518
-0x293D = 0x2519
-0x293E = 0x251A
-0x293F = 0x251B
-0x2940 = 0x251C
-0x2941 = 0x251D
-0x2942 = 0x251E
-0x2943 = 0x251F
-0x2944 = 0x2520
-0x2945 = 0x2521
-0x2946 = 0x2522
-0x2947 = 0x2523
-0x2948 = 0x2524
-0x2949 = 0x2525
-0x294A = 0x2526
-0x294B = 0x2527
-0x294C = 0x2528
-0x294D = 0x2529
-0x294E = 0x252A
-0x294F = 0x252B
-0x2950 = 0x252C
-0x2951 = 0x252D
-0x2952 = 0x252E
-0x2953 = 0x252F
-0x2954 = 0x2530
-0x2955 = 0x2531
-0x2956 = 0x2532
-0x2957 = 0x2533
-0x2958 = 0x2534
-0x2959 = 0x2535
-0x295A = 0x2536
-0x295B = 0x2537
-0x295C = 0x2538
-0x295D = 0x2539
-0x295E = 0x253A
-0x295F = 0x253B
-0x2960 = 0x253C
-0x2961 = 0x253D
-0x2962 = 0x253E
-0x2963 = 0x253F
-0x2964 = 0x2540
-0x2965 = 0x2541
-0x2966 = 0x2542
-0x2967 = 0x2543
-0x2968 = 0x2544
-0x2969 = 0x2545
-0x296A = 0x2546
-0x296B = 0x2547
-0x296C = 0x2548
-0x296D = 0x2549
-0x296E = 0x254A
-0x296F = 0x254B
-0x3021 = 0x554A
-0x3022 = 0x963F
-0x3023 = 0x57C3
-0x3024 = 0x6328
-0x3025 = 0x54CE
-0x3026 = 0x5509
-0x3027 = 0x54C0
-0x3028 = 0x769A
-0x3029 = 0x764C
-0x302A = 0x85F9
-0x302B = 0x77EE
-0x302C = 0x827E
-0x302D = 0x7919
-0x302E = 0x611B
-0x302F = 0x9698
-0x3030 = 0x978D
-0x3031 = 0x6C28
-0x3032 = 0x5B89
-0x3033 = 0x4FFA
-0x3034 = 0x6309
-0x3035 = 0x6697
-0x3036 = 0x5CB8
-0x3037 = 0x80FA
-0x3038 = 0x6848
-0x3039 = 0x9AAF
-0x303A = 0x6602
-0x303B = 0x76CE
-0x303C = 0x51F9
-0x303D = 0x6556
-0x303E = 0x71AC
-0x303F = 0x7FF1
-0x3040 = 0x8956
-0x3041 = 0x50B2
-0x3042 = 0x5965
-0x3043 = 0x61CA
-0x3044 = 0x6FB3
-0x3045 = 0x82AD
-0x3046 = 0x634C
-0x3047 = 0x6252
-0x3048 = 0x53ED
-0x3049 = 0x5427
-0x304A = 0x7B06
-0x304B = 0x516B
-0x304C = 0x75A4
-0x304D = 0x5DF4
-0x304E = 0x62D4
-0x304F = 0x8DCB
-0x3050 = 0x9776
-0x3051 = 0x628A
-0x3052 = 0x8019
-0x3053 = 0x58E9
-0x3054 = 0x9738
-0x3055 = 0x7F77
-0x3056 = 0x7238
-0x3057 = 0x767D
-0x3058 = 0x67CF
-0x3059 = 0x767E
-0x305A = 0x64FA
-0x305B = 0x4F70
-0x305C = 0x6557
-0x305D = 0x62DC
-0x305E = 0x7A17
-0x305F = 0x6591
-0x3060 = 0x73ED
-0x3061 = 0x642C
-0x3062 = 0x6273
-0x3063 = 0x822C
-0x3064 = 0x9812
-0x3065 = 0x677F
-0x3066 = 0x7248
-0x3067 = 0x626E
-0x3068 = 0x62CC
-0x3069 = 0x4F34
-0x306A = 0x74E3
-0x306B = 0x534A
-0x306C = 0x8FA6
-0x306D = 0x7D46
-0x306E = 0x90A6
-0x306F = 0x5E6B
-0x3070 = 0x6886
-0x3071 = 0x699C
-0x3072 = 0x8180
-0x3073 = 0x7D81
-0x3074 = 0x68D2
-0x3075 = 0x78C5
-0x3076 = 0x868C
-0x3077 = 0x938A
-0x3078 = 0x508D
-0x3079 = 0x8B17
-0x307A = 0x82DE
-0x307B = 0x80DE
-0x307C = 0x5305
-0x307D = 0x8912
-0x307E = 0x5265
-0x3121 = 0x8584
-0x3122 = 0x96F9
-0x3123 = 0x4FDD
-0x3124 = 0x5821
-0x3125 = 0x98FD
-0x3126 = 0x5BF6
-0x3127 = 0x62B1
-0x3128 = 0x5831
-0x3129 = 0x66B4
-0x312A = 0x8C79
-0x312B = 0x9B91
-0x312C = 0x7206
-0x312D = 0x676F
-0x312E = 0x7891
-0x312F = 0x60B2
-0x3130 = 0x5351
-0x3131 = 0x5317
-0x3132 = 0x8F29
-0x3133 = 0x80CC
-0x3134 = 0x8C9D
-0x3135 = 0x92C7
-0x3136 = 0x500D
-0x3137 = 0x72FD
-0x3138 = 0x5099
-0x3139 = 0x618A
-0x313A = 0x7119
-0x313B = 0x88AB
-0x313C = 0x5954
-0x313D = 0x82EF
-0x313E = 0x672C
-0x313F = 0x7B28
-0x3140 = 0x5D29
-0x3141 = 0x7DB3
-0x3142 = 0x752D
-0x3143 = 0x6CF5
-0x3144 = 0x8E66
-0x3145 = 0x8FF8
-0x3146 = 0x903C
-0x3147 = 0x9F3B
-0x3148 = 0x6BD4
-0x3149 = 0x9119
-0x314A = 0x7B46
-0x314B = 0x5F7C
-0x314C = 0x78A7
-0x314D = 0x84D6
-0x314E = 0x853D
-0x314F = 0x7562
-0x3150 = 0x6583
-0x3151 = 0x6BD6
-0x3152 = 0x5E63
-0x3153 = 0x5E87
-0x3154 = 0x75F9
-0x3155 = 0x9589
-0x3156 = 0x655D
-0x3157 = 0x5F0A
-0x3158 = 0x5FC5
-0x3159 = 0x8F9F
-0x315A = 0x58C1
-0x315B = 0x81C2
-0x315C = 0x907F
-0x315D = 0x965B
-0x315E = 0x97AD
-0x315F = 0x908A
-0x3160 = 0x7DE8
-0x3161 = 0x8CB6
-0x3162 = 0x6241
-0x3163 = 0x4FBF
-0x3164 = 0x8B8A
-0x3165 = 0x535E
-0x3166 = 0x8FA8
-0x3167 = 0x8FAF
-0x3168 = 0x8FAE
-0x3169 = 0x904D
-0x316A = 0x6A19
-0x316B = 0x5F6A
-0x316C = 0x8198
-0x316D = 0x8868
-0x316E = 0x9C49
-0x316F = 0x618B
-0x3170 = 0x522B
-0x3171 = 0x765F
-0x3172 = 0x5F6C
-0x3173 = 0x658C
-0x3174 = 0x7015
-0x3175 = 0x6FF1
-0x3176 = 0x8CD3
-0x3177 = 0x64EF
-0x3178 = 0x5175
-0x3179 = 0x51B0
-0x317A = 0x67C4
-0x317B = 0x4E19
-0x317C = 0x79C9
-0x317D = 0x9905
-0x317E = 0x70B3
-0x3221 = 0x75C5
-0x3222 = 0x5E76
-0x3223 = 0x73BB
-0x3224 = 0x83E0
-0x3225 = 0x64AD
-0x3226 = 0x64A5
-0x3227 = 0x9262
-0x3228 = 0x6CE2
-0x3229 = 0x535A
-0x322A = 0x52C3
-0x322B = 0x640F
-0x322C = 0x9251
-0x322D = 0x7B94
-0x322E = 0x4F2F
-0x322F = 0x5E1B
-0x3230 = 0x8236
-0x3231 = 0x8116
-0x3232 = 0x818A
-0x3233 = 0x6E24
-0x3234 = 0x6CCA
-0x3235 = 0x99C1
-0x3236 = 0x6355
-0x3237 = 0x535C
-0x3238 = 0x54FA
-0x3239 = 0x88DC
-0x323A = 0x57E0
-0x323B = 0x4E0D
-0x323C = 0x5E03
-0x323D = 0x6B65
-0x323E = 0x7C3F
-0x323F = 0x90E8
-0x3240 = 0x6016
-0x3241 = 0x64E6
-0x3242 = 0x731C
-0x3243 = 0x88C1
-0x3244 = 0x6750
-0x3245 = 0x624D
-0x3246 = 0x8CA1
-0x3247 = 0x776C
-0x3248 = 0x8E29
-0x3249 = 0x91C7
-0x324A = 0x5F69
-0x324B = 0x83DC
-0x324C = 0x8521
-0x324D = 0x9910
-0x324E = 0x53C3
-0x324F = 0x8836
-0x3250 = 0x6B98
-0x3251 = 0x615A
-0x3252 = 0x6158
-0x3253 = 0x71E6
-0x3254 = 0x84BC
-0x3255 = 0x8259
-0x3256 = 0x5009
-0x3257 = 0x6EC4
-0x3258 = 0x85CF
-0x3259 = 0x64CD
-0x325A = 0x7CD9
-0x325B = 0x69FD
-0x325C = 0x66F9
-0x325D = 0x8349
-0x325E = 0x53A0
-0x325F = 0x7B56
-0x3260 = 0x5074
-0x3261 = 0x518C
-0x3262 = 0x6E2C
-0x3263 = 0x5C64
-0x3264 = 0x8E6D
-0x3265 = 0x63D2
-0x3266 = 0x53C9
-0x3267 = 0x832C
-0x3268 = 0x8336
-0x3269 = 0x67E5
-0x326A = 0x78B4
-0x326B = 0x643D
-0x326C = 0x5BDF
-0x326D = 0x5C94
-0x326E = 0x5DEE
-0x326F = 0x8A6B
-0x3270 = 0x62C6
-0x3271 = 0x67F4
-0x3272 = 0x8C7A
-0x3273 = 0x6519
-0x3274 = 0x647B
-0x3275 = 0x87EC
-0x3276 = 0x995E
-0x3277 = 0x8B92
-0x3278 = 0x7E8F
-0x3279 = 0x93DF
-0x327A = 0x7523
-0x327B = 0x95E1
-0x327C = 0x986B
-0x327D = 0x660C
-0x327E = 0x7316
-0x3321 = 0x5834
-0x3322 = 0x5617
-0x3323 = 0x5E38
-0x3324 = 0x9577
-0x3325 = 0x511F
-0x3326 = 0x8178
-0x3327 = 0x5EE0
-0x3328 = 0x655E
-0x3329 = 0x66A2
-0x332A = 0x5531
-0x332B = 0x5021
-0x332C = 0x8D85
-0x332D = 0x6284
-0x332E = 0x9214
-0x332F = 0x671D
-0x3330 = 0x5632
-0x3331 = 0x6F6E
-0x3332 = 0x5DE2
-0x3333 = 0x5435
-0x3334 = 0x7092
-0x3335 = 0x8ECA
-0x3336 = 0x626F
-0x3337 = 0x64A4
-0x3338 = 0x63A3
-0x3339 = 0x5FB9
-0x333A = 0x6F88
-0x333B = 0x90F4
-0x333C = 0x81E3
-0x333D = 0x8FB0
-0x333E = 0x5875
-0x333F = 0x6668
-0x3340 = 0x5FF1
-0x3341 = 0x6C89
-0x3342 = 0x9673
-0x3343 = 0x8D81
-0x3344 = 0x896F
-0x3345 = 0x6491
-0x3346 = 0x7A31
-0x3347 = 0x57CE
-0x3348 = 0x6A59
-0x3349 = 0x6210
-0x334A = 0x5448
-0x334B = 0x4E58
-0x334C = 0x7A0B
-0x334D = 0x61F2
-0x334E = 0x6F84
-0x334F = 0x8AA0
-0x3350 = 0x627F
-0x3351 = 0x901E
-0x3352 = 0x9A01
-0x3353 = 0x79E4
-0x3354 = 0x5403
-0x3355 = 0x75F4
-0x3356 = 0x6301
-0x3357 = 0x5319
-0x3358 = 0x6C60
-0x3359 = 0x9072
-0x335A = 0x5F1B
-0x335B = 0x99B3
-0x335C = 0x803B
-0x335D = 0x9F52
-0x335E = 0x4F88
-0x335F = 0x5C3A
-0x3360 = 0x8D64
-0x3361 = 0x7FC5
-0x3362 = 0x65A5
-0x3363 = 0x71BE
-0x3364 = 0x5145
-0x3365 = 0x885D
-0x3366 = 0x87F2
-0x3367 = 0x5D07
-0x3368 = 0x5BF5
-0x3369 = 0x62BD
-0x336A = 0x916C
-0x336B = 0x7587
-0x336C = 0x8E8A
-0x336D = 0x7A20
-0x336E = 0x6101
-0x336F = 0x7C4C
-0x3370 = 0x4EC7
-0x3371 = 0x7DA2
-0x3372 = 0x7785
-0x3373 = 0x919C
-0x3374 = 0x81ED
-0x3375 = 0x521D
-0x3376 = 0x51FA
-0x3377 = 0x6A71
-0x3378 = 0x53A8
-0x3379 = 0x8E87
-0x337A = 0x92E4
-0x337B = 0x96DB
-0x337C = 0x6EC1
-0x337D = 0x9664
-0x337E = 0x695A
-0x3421 = 0x790E
-0x3422 = 0x5132
-0x3423 = 0x77D7
-0x3424 = 0x6410
-0x3425 = 0x89F8
-0x3426 = 0x8655
-0x3427 = 0x63E3
-0x3428 = 0x5DDD
-0x3429 = 0x7A7F
-0x342A = 0x693D
-0x342B = 0x50B3
-0x342C = 0x8239
-0x342D = 0x5598
-0x342E = 0x4E32
-0x342F = 0x7621
-0x3430 = 0x7A97
-0x3431 = 0x5E62
-0x3432 = 0x5E8A
-0x3433 = 0x95D6
-0x3434 = 0x5275
-0x3435 = 0x5439
-0x3436 = 0x708A
-0x3437 = 0x6376
-0x3438 = 0x9318
-0x3439 = 0x5782
-0x343A = 0x6625
-0x343B = 0x693F
-0x343C = 0x9187
-0x343D = 0x5507
-0x343E = 0x6DF3
-0x343F = 0x7D14
-0x3440 = 0x8822
-0x3441 = 0x6233
-0x3442 = 0x7DBD
-0x3443 = 0x75B5
-0x3444 = 0x8328
-0x3445 = 0x78C1
-0x3446 = 0x96CC
-0x3447 = 0x8FAD
-0x3448 = 0x6148
-0x3449 = 0x74F7
-0x344A = 0x8A5E
-0x344B = 0x6B64
-0x344C = 0x523A
-0x344D = 0x8CDC
-0x344E = 0x6B21
-0x344F = 0x8070
-0x3450 = 0x8471
-0x3451 = 0x56F1
-0x3452 = 0x5306
-0x3453 = 0x5F9E
-0x3454 = 0x53E2
-0x3455 = 0x51D1
-0x3456 = 0x7C97
-0x3457 = 0x918B
-0x3458 = 0x7C07
-0x3459 = 0x4FC3
-0x345A = 0x8EA5
-0x345B = 0x7BE1
-0x345C = 0x7AC4
-0x345D = 0x6467
-0x345E = 0x5D14
-0x345F = 0x50AC
-0x3460 = 0x8106
-0x3461 = 0x7601
-0x3462 = 0x7CB9
-0x3463 = 0x6DEC
-0x3464 = 0x7FE0
-0x3465 = 0x6751
-0x3466 = 0x5B58
-0x3467 = 0x5BF8
-0x3468 = 0x78CB
-0x3469 = 0x64AE
-0x346A = 0x6413
-0x346B = 0x63AA
-0x346C = 0x632B
-0x346D = 0x932F
-0x346E = 0x642D
-0x346F = 0x9054
-0x3470 = 0x7B54
-0x3471 = 0x7629
-0x3472 = 0x6253
-0x3473 = 0x5927
-0x3474 = 0x5446
-0x3475 = 0x6B79
-0x3476 = 0x50A3
-0x3477 = 0x6234
-0x3478 = 0x5E36
-0x3479 = 0x6B86
-0x347A = 0x4EE3
-0x347B = 0x8CB8
-0x347C = 0x888B
-0x347D = 0x5F85
-0x347E = 0x902E
-0x3521 = 0x6020
-0x3522 = 0x803D
-0x3523 = 0x64D4
-0x3524 = 0x4E39
-0x3525 = 0x55AE
-0x3526 = 0x9132
-0x3527 = 0x64A3
-0x3528 = 0x81BD
-0x3529 = 0x65E6
-0x352A = 0x6C2E
-0x352B = 0x4F46
-0x352C = 0x619A
-0x352D = 0x6DE1
-0x352E = 0x8A95
-0x352F = 0x5F48
-0x3530 = 0x86CB
-0x3531 = 0x7576
-0x3532 = 0x64CB
-0x3533 = 0x9EE8
-0x3534 = 0x8569
-0x3535 = 0x6A94
-0x3536 = 0x5200
-0x3537 = 0x6417
-0x3538 = 0x8E48
-0x3539 = 0x5012
-0x353A = 0x5CF6
-0x353B = 0x79B1
-0x353C = 0x5C0E
-0x353D = 0x5230
-0x353E = 0x7A3B
-0x353F = 0x60BC
-0x3540 = 0x9053
-0x3541 = 0x76D7
-0x3542 = 0x5FB7
-0x3543 = 0x5F97
-0x3544 = 0x7684
-0x3545 = 0x8E6C
-0x3546 = 0x71C8
-0x3547 = 0x767B
-0x3548 = 0x7B49
-0x3549 = 0x77AA
-0x354A = 0x51F3
-0x354B = 0x9127
-0x354C = 0x5824
-0x354D = 0x4F4E
-0x354E = 0x6EF4
-0x354F = 0x8FEA
-0x3550 = 0x6575
-0x3551 = 0x7B1B
-0x3552 = 0x72C4
-0x3553 = 0x6ECC
-0x3554 = 0x7FDF
-0x3555 = 0x5AE1
-0x3556 = 0x62B5
-0x3557 = 0x5E95
-0x3558 = 0x5730
-0x3559 = 0x8482
-0x355A = 0x7B2C
-0x355B = 0x5E1D
-0x355C = 0x5F1F
-0x355D = 0x905E
-0x355E = 0x7DE0
-0x355F = 0x985B
-0x3560 = 0x6382
-0x3561 = 0x6EC7
-0x3562 = 0x7898
-0x3563 = 0x9EDE
-0x3564 = 0x5178
-0x3565 = 0x975B
-0x3566 = 0x588A
-0x3567 = 0x96FB
-0x3568 = 0x4F43
-0x3569 = 0x7538
-0x356A = 0x5E97
-0x356B = 0x60E6
-0x356C = 0x5960
-0x356D = 0x6FB1
-0x356E = 0x6BBF
-0x356F = 0x7889
-0x3570 = 0x53FC
-0x3571 = 0x96D5
-0x3572 = 0x51CB
-0x3573 = 0x5201
-0x3574 = 0x6389
-0x3575 = 0x540A
-0x3576 = 0x91E3
-0x3577 = 0x8ABF
-0x3578 = 0x8DCC
-0x3579 = 0x7239
-0x357A = 0x789F
-0x357B = 0x8776
-0x357C = 0x8FED
-0x357D = 0x8ADC
-0x357E = 0x758A
-0x3621 = 0x4E01
-0x3622 = 0x76EF
-0x3623 = 0x53EE
-0x3624 = 0x91D8
-0x3625 = 0x9802
-0x3626 = 0x9F0E
-0x3627 = 0x9320
-0x3628 = 0x5B9A
-0x3629 = 0x8A02
-0x362A = 0x4E22
-0x362B = 0x6771
-0x362C = 0x51AC
-0x362D = 0x8463
-0x362E = 0x61C2
-0x362F = 0x52D5
-0x3630 = 0x68DF
-0x3631 = 0x4F97
-0x3632 = 0x606B
-0x3633 = 0x51CD
-0x3634 = 0x6D1E
-0x3635 = 0x515C
-0x3636 = 0x6296
-0x3637 = 0x9B25
-0x3638 = 0x9661
-0x3639 = 0x8C46
-0x363A = 0x9017
-0x363B = 0x75D8
-0x363C = 0x90FD
-0x363D = 0x7763
-0x363E = 0x6BD2
-0x363F = 0x72A2
-0x3640 = 0x7368
-0x3641 = 0x8B80
-0x3642 = 0x5835
-0x3643 = 0x7779
-0x3644 = 0x8CED
-0x3645 = 0x675C
-0x3646 = 0x934D
-0x3647 = 0x809A
-0x3648 = 0x5EA6
-0x3649 = 0x6E21
-0x364A = 0x5992
-0x364B = 0x7AEF
-0x364C = 0x77ED
-0x364D = 0x935B
-0x364E = 0x6BB5
-0x364F = 0x65B7
-0x3650 = 0x7DDE
-0x3651 = 0x5806
-0x3652 = 0x5151
-0x3653 = 0x968A
-0x3654 = 0x5C0D
-0x3655 = 0x58A9
-0x3656 = 0x5678
-0x3657 = 0x8E72
-0x3658 = 0x6566
-0x3659 = 0x9813
-0x365A = 0x56E4
-0x365B = 0x920D
-0x365C = 0x76FE
-0x365D = 0x9041
-0x365E = 0x6387
-0x365F = 0x54C6
-0x3660 = 0x591A
-0x3661 = 0x596A
-0x3662 = 0x579B
-0x3663 = 0x8EB2
-0x3664 = 0x6735
-0x3665 = 0x8DFA
-0x3666 = 0x8235
-0x3667 = 0x5241
-0x3668 = 0x60F0
-0x3669 = 0x58AE
-0x366A = 0x86FE
-0x366B = 0x5CE8
-0x366C = 0x9D5D
-0x366D = 0x4FC4
-0x366E = 0x984D
-0x366F = 0x8A1B
-0x3670 = 0x5A25
-0x3671 = 0x60E1
-0x3672 = 0x5384
-0x3673 = 0x627C
-0x3674 = 0x904F
-0x3675 = 0x9102
-0x3676 = 0x9913
-0x3677 = 0x6069
-0x3678 = 0x800C
-0x3679 = 0x5152
-0x367A = 0x8033
-0x367B = 0x723E
-0x367C = 0x990C
-0x367D = 0x6D31
-0x367E = 0x4E8C
-0x3721 = 0x8CB3
-0x3722 = 0x767C
-0x3723 = 0x7F70
-0x3724 = 0x7B4F
-0x3725 = 0x4F10
-0x3726 = 0x4E4F
-0x3727 = 0x95A5
-0x3728 = 0x6CD5
-0x3729 = 0x73D0
-0x372A = 0x85E9
-0x372B = 0x5E06
-0x372C = 0x756A
-0x372D = 0x7FFB
-0x372E = 0x6A0A
-0x372F = 0x792C
-0x3730 = 0x91E9
-0x3731 = 0x7E41
-0x3732 = 0x51E1
-0x3733 = 0x7169
-0x3734 = 0x53CD
-0x3735 = 0x8FD4
-0x3736 = 0x7BC4
-0x3737 = 0x8CA9
-0x3738 = 0x72AF
-0x3739 = 0x98EF
-0x373A = 0x6CDB
-0x373B = 0x574A
-0x373C = 0x82B3
-0x373D = 0x65B9
-0x373E = 0x80AA
-0x373F = 0x623F
-0x3740 = 0x9632
-0x3741 = 0x59A8
-0x3742 = 0x4EFF
-0x3743 = 0x8A2A
-0x3744 = 0x7D21
-0x3745 = 0x653E
-0x3746 = 0x83F2
-0x3747 = 0x975E
-0x3748 = 0x5561
-0x3749 = 0x98DB
-0x374A = 0x80A5
-0x374B = 0x532A
-0x374C = 0x8AB9
-0x374D = 0x5420
-0x374E = 0x80BA
-0x374F = 0x5EE2
-0x3750 = 0x6CB8
-0x3751 = 0x8CBB
-0x3752 = 0x82AC
-0x3753 = 0x915A
-0x3754 = 0x5429
-0x3755 = 0x6C1B
-0x3756 = 0x5206
-0x3757 = 0x7D1B
-0x3758 = 0x58B3
-0x3759 = 0x711A
-0x375A = 0x6C7E
-0x375B = 0x7C89
-0x375C = 0x596E
-0x375D = 0x4EFD
-0x375E = 0x5FFF
-0x375F = 0x61A4
-0x3760 = 0x7CDE
-0x3761 = 0x8C50
-0x3762 = 0x5C01
-0x3763 = 0x6953
-0x3764 = 0x8702
-0x3765 = 0x5CF0
-0x3766 = 0x92D2
-0x3767 = 0x98A8
-0x3768 = 0x760B
-0x3769 = 0x70FD
-0x376A = 0x9022
-0x376B = 0x99AE
-0x376C = 0x7E2B
-0x376D = 0x8AF7
-0x376E = 0x5949
-0x376F = 0x9CF3
-0x3770 = 0x4F5B
-0x3771 = 0x5426
-0x3772 = 0x592B
-0x3773 = 0x6577
-0x3774 = 0x819A
-0x3775 = 0x5B75
-0x3776 = 0x6276
-0x3777 = 0x62C2
-0x3778 = 0x8F3B
-0x3779 = 0x5E45
-0x377A = 0x6C1F
-0x377B = 0x7B26
-0x377C = 0x4F0F
-0x377D = 0x4FD8
-0x377E = 0x670D
-0x3821 = 0x6D6E
-0x3822 = 0x6DAA
-0x3823 = 0x798F
-0x3824 = 0x88B1
-0x3825 = 0x5F17
-0x3826 = 0x752B
-0x3827 = 0x64AB
-0x3828 = 0x8F14
-0x3829 = 0x4FEF
-0x382A = 0x91DC
-0x382B = 0x65A7
-0x382C = 0x812F
-0x382D = 0x8151
-0x382E = 0x5E9C
-0x382F = 0x8150
-0x3830 = 0x8D74
-0x3831 = 0x526F
-0x3832 = 0x8986
-0x3833 = 0x8CE6
-0x3834 = 0x5FA9
-0x3835 = 0x5085
-0x3836 = 0x4ED8
-0x3837 = 0x961C
-0x3838 = 0x7236
-0x3839 = 0x8179
-0x383A = 0x8CA0
-0x383B = 0x5BCC
-0x383C = 0x8A03
-0x383D = 0x9644
-0x383E = 0x5A66
-0x383F = 0x7E1B
-0x3840 = 0x5490
-0x3841 = 0x5676
-0x3842 = 0x560E
-0x3843 = 0x8A72
-0x3844 = 0x6539
-0x3845 = 0x6982
-0x3846 = 0x9223
-0x3847 = 0x84CB
-0x3848 = 0x6E89
-0x3849 = 0x5E79
-0x384A = 0x7518
-0x384B = 0x6746
-0x384C = 0x67D1
-0x384D = 0x7AFF
-0x384E = 0x809D
-0x384F = 0x8D95
-0x3850 = 0x611F
-0x3851 = 0x79C6
-0x3852 = 0x6562
-0x3853 = 0x8D1B
-0x3854 = 0x5CA1
-0x3855 = 0x525B
-0x3856 = 0x92FC
-0x3857 = 0x7F38
-0x3858 = 0x809B
-0x3859 = 0x7DB1
-0x385A = 0x5D17
-0x385B = 0x6E2F
-0x385C = 0x6760
-0x385D = 0x7BD9
-0x385E = 0x768B
-0x385F = 0x9AD8
-0x3860 = 0x818F
-0x3861 = 0x7F94
-0x3862 = 0x7CD5
-0x3863 = 0x641E
-0x3864 = 0x93AC
-0x3865 = 0x7A3F
-0x3866 = 0x544A
-0x3867 = 0x54E5
-0x3868 = 0x6B4C
-0x3869 = 0x64F1
-0x386A = 0x6208
-0x386B = 0x9D3F
-0x386C = 0x80F3
-0x386D = 0x7599
-0x386E = 0x5272
-0x386F = 0x9769
-0x3870 = 0x845B
-0x3871 = 0x683C
-0x3872 = 0x86E4
-0x3873 = 0x95A3
-0x3874 = 0x9694
-0x3875 = 0x927B
-0x3876 = 0x500B
-0x3877 = 0x5404
-0x3878 = 0x7D66
-0x3879 = 0x6839
-0x387A = 0x8DDF
-0x387B = 0x8015
-0x387C = 0x66F4
-0x387D = 0x5E9A
-0x387E = 0x7FB9
-0x3921 = 0x57C2
-0x3922 = 0x803F
-0x3923 = 0x6897
-0x3924 = 0x5DE5
-0x3925 = 0x653B
-0x3926 = 0x529F
-0x3927 = 0x606D
-0x3928 = 0x9F94
-0x3929 = 0x4F9B
-0x392A = 0x8EAC
-0x392B = 0x516C
-0x392C = 0x5BAB
-0x392D = 0x5F13
-0x392E = 0x978F
-0x392F = 0x6C5E
-0x3930 = 0x62F1
-0x3931 = 0x8CA2
-0x3932 = 0x5171
-0x3933 = 0x920E
-0x3934 = 0x52FE
-0x3935 = 0x6E9D
-0x3936 = 0x82DF
-0x3937 = 0x72D7
-0x3938 = 0x57A2
-0x3939 = 0x69CB
-0x393A = 0x8CFC
-0x393B = 0x591F
-0x393C = 0x8F9C
-0x393D = 0x83C7
-0x393E = 0x5495
-0x393F = 0x7B8D
-0x3940 = 0x4F30
-0x3941 = 0x6CBD
-0x3942 = 0x5B64
-0x3943 = 0x59D1
-0x3944 = 0x9F13
-0x3945 = 0x53E4
-0x3946 = 0x8831
-0x3947 = 0x9AA8
-0x3948 = 0x8C37
-0x3949 = 0x80A1
-0x394A = 0x6545
-0x394B = 0x9867
-0x394C = 0x56FA
-0x394D = 0x96C7
-0x394E = 0x522E
-0x394F = 0x74DC
-0x3950 = 0x526E
-0x3951 = 0x5BE1
-0x3952 = 0x6302
-0x3953 = 0x8902
-0x3954 = 0x4E56
-0x3955 = 0x62D0
-0x3956 = 0x602A
-0x3957 = 0x68FA
-0x3958 = 0x95DC
-0x3959 = 0x5B98
-0x395A = 0x51A0
-0x395B = 0x89C0
-0x395C = 0x7BA1
-0x395D = 0x9928
-0x395E = 0x7F50
-0x395F = 0x6163
-0x3960 = 0x704C
-0x3961 = 0x8CAB
-0x3962 = 0x5149
-0x3963 = 0x5EE3
-0x3964 = 0x901B
-0x3965 = 0x7470
-0x3966 = 0x898F
-0x3967 = 0x572D
-0x3968 = 0x7845
-0x3969 = 0x6B78
-0x396A = 0x9F9C
-0x396B = 0x95A8
-0x396C = 0x8ECC
-0x396D = 0x9B3C
-0x396E = 0x8A6D
-0x396F = 0x7678
-0x3970 = 0x6842
-0x3971 = 0x6AC3
-0x3972 = 0x8DEA
-0x3973 = 0x8CB4
-0x3974 = 0x528A
-0x3975 = 0x8F25
-0x3976 = 0x6EDA
-0x3977 = 0x68CD
-0x3978 = 0x934B
-0x3979 = 0x90ED
-0x397A = 0x570B
-0x397B = 0x679C
-0x397C = 0x88F9
-0x397D = 0x904E
-0x397E = 0x54C8
-0x3A21 = 0x9AB8
-0x3A22 = 0x5B69
-0x3A23 = 0x6D77
-0x3A24 = 0x6C26
-0x3A25 = 0x4EA5
-0x3A26 = 0x5BB3
-0x3A27 = 0x99ED
-0x3A28 = 0x9163
-0x3A29 = 0x61A8
-0x3A2A = 0x90AF
-0x3A2B = 0x97D3
-0x3A2C = 0x542B
-0x3A2D = 0x6DB5
-0x3A2E = 0x5BD2
-0x3A2F = 0x51FD
-0x3A30 = 0x558A
-0x3A31 = 0x7F55
-0x3A32 = 0x7FF0
-0x3A33 = 0x64BC
-0x3A34 = 0x634D
-0x3A35 = 0x65F1
-0x3A36 = 0x61BE
-0x3A37 = 0x608D
-0x3A38 = 0x710A
-0x3A39 = 0x6C57
-0x3A3A = 0x6F22
-0x3A3B = 0x592F
-0x3A3C = 0x676D
-0x3A3D = 0x822A
-0x3A3E = 0x58D5
-0x3A3F = 0x568E
-0x3A40 = 0x8C6A
-0x3A41 = 0x6BEB
-0x3A42 = 0x90DD
-0x3A43 = 0x597D
-0x3A44 = 0x8017
-0x3A45 = 0x865F
-0x3A46 = 0x6D69
-0x3A47 = 0x5475
-0x3A48 = 0x559D
-0x3A49 = 0x8377
-0x3A4A = 0x83CF
-0x3A4B = 0x6838
-0x3A4C = 0x79BE
-0x3A4D = 0x548C
-0x3A4E = 0x4F55
-0x3A4F = 0x5408
-0x3A50 = 0x76D2
-0x3A51 = 0x8C89
-0x3A52 = 0x95A1
-0x3A53 = 0x6CB3
-0x3A54 = 0x6DB8
-0x3A55 = 0x8D6B
-0x3A56 = 0x8910
-0x3A57 = 0x9DB4
-0x3A58 = 0x8CC0
-0x3A59 = 0x563F
-0x3A5A = 0x9ED1
-0x3A5B = 0x75D5
-0x3A5C = 0x5F88
-0x3A5D = 0x72E0
-0x3A5E = 0x6068
-0x3A5F = 0x54FC
-0x3A60 = 0x4EA8
-0x3A61 = 0x6A2A
-0x3A62 = 0x8861
-0x3A63 = 0x6052
-0x3A64 = 0x8F5F
-0x3A65 = 0x54C4
-0x3A66 = 0x70D8
-0x3A67 = 0x8679
-0x3A68 = 0x9D3B
-0x3A69 = 0x6D2A
-0x3A6A = 0x5B8F
-0x3A6B = 0x5F18
-0x3A6C = 0x7D05
-0x3A6D = 0x5589
-0x3A6E = 0x4FAF
-0x3A6F = 0x7334
-0x3A70 = 0x543C
-0x3A71 = 0x539A
-0x3A72 = 0x5019
-0x3A73 = 0x5F8C
-0x3A74 = 0x547C
-0x3A75 = 0x4E4E
-0x3A76 = 0x5FFD
-0x3A77 = 0x745A
-0x3A78 = 0x58FA
-0x3A79 = 0x846B
-0x3A7A = 0x80E1
-0x3A7B = 0x8774
-0x3A7C = 0x72D0
-0x3A7D = 0x7CCA
-0x3A7E = 0x6E56
-0x3B21 = 0x5F27
-0x3B22 = 0x864E
-0x3B23 = 0x552C
-0x3B24 = 0x8B77
-0x3B25 = 0x4E92
-0x3B26 = 0x6EEC
-0x3B27 = 0x6237
-0x3B28 = 0x82B1
-0x3B29 = 0x5629
-0x3B2A = 0x83EF
-0x3B2B = 0x733E
-0x3B2C = 0x6ED1
-0x3B2D = 0x756B
-0x3B2E = 0x5283
-0x3B2F = 0x5316
-0x3B30 = 0x8A71
-0x3B31 = 0x69D0
-0x3B32 = 0x5F8A
-0x3B33 = 0x61F7
-0x3B34 = 0x6DEE
-0x3B35 = 0x58DE
-0x3B36 = 0x6B61
-0x3B37 = 0x74B0
-0x3B38 = 0x6853
-0x3B39 = 0x9084
-0x3B3A = 0x7DE9
-0x3B3B = 0x63DB
-0x3B3C = 0x60A3
-0x3B3D = 0x559A
-0x3B3E = 0x7613
-0x3B3F = 0x8C62
-0x3B40 = 0x7165
-0x3B41 = 0x6E19
-0x3B42 = 0x5BA6
-0x3B43 = 0x5E7B
-0x3B44 = 0x8352
-0x3B45 = 0x614C
-0x3B46 = 0x9EC4
-0x3B47 = 0x78FA
-0x3B48 = 0x8757
-0x3B49 = 0x7C27
-0x3B4A = 0x7687
-0x3B4B = 0x51F0
-0x3B4C = 0x60F6
-0x3B4D = 0x714C
-0x3B4E = 0x6643
-0x3B4F = 0x5E4C
-0x3B50 = 0x604D
-0x3B51 = 0x8B0A
-0x3B52 = 0x7070
-0x3B53 = 0x63EE
-0x3B54 = 0x8F1D
-0x3B55 = 0x5FBD
-0x3B56 = 0x6062
-0x3B57 = 0x86D4
-0x3B58 = 0x56DE
-0x3B59 = 0x6BC1
-0x3B5A = 0x6094
-0x3B5B = 0x6167
-0x3B5C = 0x5349
-0x3B5D = 0x60E0
-0x3B5E = 0x6666
-0x3B5F = 0x8CC4
-0x3B60 = 0x7A62
-0x3B61 = 0x6703
-0x3B62 = 0x71F4
-0x3B63 = 0x532F
-0x3B64 = 0x8AF1
-0x3B65 = 0x8AA8
-0x3B66 = 0x7E6A
-0x3B67 = 0x8477
-0x3B68 = 0x660F
-0x3B69 = 0x5A5A
-0x3B6A = 0x9B42
-0x3B6B = 0x6E3E
-0x3B6C = 0x6DF7
-0x3B6D = 0x8C41
-0x3B6E = 0x6D3B
-0x3B6F = 0x4F19
-0x3B70 = 0x706B
-0x3B71 = 0x7372
-0x3B72 = 0x6216
-0x3B73 = 0x60D1
-0x3B74 = 0x970D
-0x3B75 = 0x8CA8
-0x3B76 = 0x798D
-0x3B77 = 0x64CA
-0x3B78 = 0x573E
-0x3B79 = 0x57FA
-0x3B7A = 0x6A5F
-0x3B7B = 0x7578
-0x3B7C = 0x7A3D
-0x3B7D = 0x7A4D
-0x3B7E = 0x7B95
-0x3C21 = 0x808C
-0x3C22 = 0x9951
-0x3C23 = 0x8FF9
-0x3C24 = 0x6FC0
-0x3C25 = 0x8B4F
-0x3C26 = 0x9DC4
-0x3C27 = 0x59EC
-0x3C28 = 0x7E3E
-0x3C29 = 0x7DDD
-0x3C2A = 0x5409
-0x3C2B = 0x6975
-0x3C2C = 0x68D8
-0x3C2D = 0x8F2F
-0x3C2E = 0x7C4D
-0x3C2F = 0x96C6
-0x3C30 = 0x53CA
-0x3C31 = 0x6025
-0x3C32 = 0x75BE
-0x3C33 = 0x6C72
-0x3C34 = 0x5373
-0x3C35 = 0x5AC9
-0x3C36 = 0x7D1A
-0x3C37 = 0x64E0
-0x3C38 = 0x5E7E
-0x3C39 = 0x810A
-0x3C3A = 0x5DF1
-0x3C3B = 0x858A
-0x3C3C = 0x6280
-0x3C3D = 0x5180
-0x3C3E = 0x5B63
-0x3C3F = 0x4F0E
-0x3C40 = 0x796D
-0x3C41 = 0x5291
-0x3C42 = 0x60B8
-0x3C43 = 0x6FDF
-0x3C44 = 0x5BC4
-0x3C45 = 0x5BC2
-0x3C46 = 0x8A08
-0x3C47 = 0x8A18
-0x3C48 = 0x65E2
-0x3C49 = 0x5FCC
-0x3C4A = 0x969B
-0x3C4B = 0x5993
-0x3C4C = 0x7E7C
-0x3C4D = 0x7D00
-0x3C4E = 0x5609
-0x3C4F = 0x67B7
-0x3C50 = 0x593E
-0x3C51 = 0x4F73
-0x3C52 = 0x5BB6
-0x3C53 = 0x52A0
-0x3C54 = 0x83A2
-0x3C55 = 0x9830
-0x3C56 = 0x8CC8
-0x3C57 = 0x7532
-0x3C58 = 0x9240
-0x3C59 = 0x5047
-0x3C5A = 0x7A3C
-0x3C5B = 0x50F9
-0x3C5C = 0x67B6
-0x3C5D = 0x99D5
-0x3C5E = 0x5AC1
-0x3C5F = 0x6BB2
-0x3C60 = 0x76E3
-0x3C61 = 0x5805
-0x3C62 = 0x5C16
-0x3C63 = 0x7B8B
-0x3C64 = 0x9593
-0x3C65 = 0x714E
-0x3C66 = 0x517C
-0x3C67 = 0x80A9
-0x3C68 = 0x8271
-0x3C69 = 0x5978
-0x3C6A = 0x7DD8
-0x3C6B = 0x7E6D
-0x3C6C = 0x6AA2
-0x3C6D = 0x67EC
-0x3C6E = 0x78B1
-0x3C6F = 0x9E7C
-0x3C70 = 0x63C0
-0x3C71 = 0x64BF
-0x3C72 = 0x7C21
-0x3C73 = 0x5109
-0x3C74 = 0x526A
-0x3C75 = 0x51CF
-0x3C76 = 0x85A6
-0x3C77 = 0x6ABB
-0x3C78 = 0x9452
-0x3C79 = 0x8E10
-0x3C7A = 0x8CE4
-0x3C7B = 0x898B
-0x3C7C = 0x9375
-0x3C7D = 0x7BAD
-0x3C7E = 0x4EF6
-0x3D21 = 0x5065
-0x3D22 = 0x8266
-0x3D23 = 0x528D
-0x3D24 = 0x991E
-0x3D25 = 0x6F38
-0x3D26 = 0x6FFA
-0x3D27 = 0x6F97
-0x3D28 = 0x5EFA
-0x3D29 = 0x50F5
-0x3D2A = 0x59DC
-0x3D2B = 0x5C07
-0x3D2C = 0x6F3F
-0x3D2D = 0x6C5F
-0x3D2E = 0x7586
-0x3D2F = 0x8523
-0x3D30 = 0x69F3
-0x3D31 = 0x596C
-0x3D32 = 0x8B1B
-0x3D33 = 0x5320
-0x3D34 = 0x91AC
-0x3D35 = 0x964D
-0x3D36 = 0x8549
-0x3D37 = 0x6912
-0x3D38 = 0x7901
-0x3D39 = 0x7126
-0x3D3A = 0x81A0
-0x3D3B = 0x4EA4
-0x3D3C = 0x90CA
-0x3D3D = 0x6F86
-0x3D3E = 0x9A55
-0x3D3F = 0x5B0C
-0x3D40 = 0x56BC
-0x3D41 = 0x652A
-0x3D42 = 0x9278
-0x3D43 = 0x77EF
-0x3D44 = 0x50E5
-0x3D45 = 0x811A
-0x3D46 = 0x72E1
-0x3D47 = 0x89D2
-0x3D48 = 0x9903
-0x3D49 = 0x7E73
-0x3D4A = 0x7D5E
-0x3D4B = 0x527F
-0x3D4C = 0x6559
-0x3D4D = 0x9175
-0x3D4E = 0x8F4E
-0x3D4F = 0x8F03
-0x3D50 = 0x53EB
-0x3D51 = 0x7A96
-0x3D52 = 0x63ED
-0x3D53 = 0x63A5
-0x3D54 = 0x7686
-0x3D55 = 0x79F8
-0x3D56 = 0x8857
-0x3D57 = 0x968E
-0x3D58 = 0x622A
-0x3D59 = 0x52AB
-0x3D5A = 0x7BC0
-0x3D5B = 0x6854
-0x3D5C = 0x6770
-0x3D5D = 0x6377
-0x3D5E = 0x776B
-0x3D5F = 0x7AED
-0x3D60 = 0x6F54
-0x3D61 = 0x7D50
-0x3D62 = 0x89E3
-0x3D63 = 0x59D0
-0x3D64 = 0x6212
-0x3D65 = 0x85C9
-0x3D66 = 0x82A5
-0x3D67 = 0x754C
-0x3D68 = 0x501F
-0x3D69 = 0x4ECB
-0x3D6A = 0x75A5
-0x3D6B = 0x8AA1
-0x3D6C = 0x5C4A
-0x3D6D = 0x5DFE
-0x3D6E = 0x7B4B
-0x3D6F = 0x65A4
-0x3D70 = 0x91D1
-0x3D71 = 0x4ECA
-0x3D72 = 0x6D25
-0x3D73 = 0x895F
-0x3D74 = 0x7DCA
-0x3D75 = 0x9326
-0x3D76 = 0x50C5
-0x3D77 = 0x8B39
-0x3D78 = 0x9032
-0x3D79 = 0x9773
-0x3D7A = 0x6649
-0x3D7B = 0x7981
-0x3D7C = 0x8FD1
-0x3D7D = 0x71FC
-0x3D7E = 0x6D78
-0x3E21 = 0x76E1
-0x3E22 = 0x52C1
-0x3E23 = 0x8346
-0x3E24 = 0x5162
-0x3E25 = 0x8396
-0x3E26 = 0x775B
-0x3E27 = 0x6676
-0x3E28 = 0x9BE8
-0x3E29 = 0x4EAC
-0x3E2A = 0x9A5A
-0x3E2B = 0x7CBE
-0x3E2C = 0x7CB3
-0x3E2D = 0x7D93
-0x3E2E = 0x4E95
-0x3E2F = 0x8B66
-0x3E30 = 0x666F
-0x3E31 = 0x9838
-0x3E32 = 0x975C
-0x3E33 = 0x5883
-0x3E34 = 0x656C
-0x3E35 = 0x93E1
-0x3E36 = 0x5F91
-0x3E37 = 0x75D9
-0x3E38 = 0x9756
-0x3E39 = 0x7ADF
-0x3E3A = 0x7AF6
-0x3E3B = 0x51C8
-0x3E3C = 0x70AF
-0x3E3D = 0x7A98
-0x3E3E = 0x63EA
-0x3E3F = 0x7A76
-0x3E40 = 0x7CFE
-0x3E41 = 0x7396
-0x3E42 = 0x97ED
-0x3E43 = 0x4E45
-0x3E44 = 0x7078
-0x3E45 = 0x4E5D
-0x3E46 = 0x9152
-0x3E47 = 0x53A9
-0x3E48 = 0x6551
-0x3E49 = 0x820A
-0x3E4A = 0x81FC
-0x3E4B = 0x8205
-0x3E4C = 0x548E
-0x3E4D = 0x5C31
-0x3E4E = 0x759A
-0x3E4F = 0x97A0
-0x3E50 = 0x62D8
-0x3E51 = 0x72D9
-0x3E52 = 0x75BD
-0x3E53 = 0x5C45
-0x3E54 = 0x99D2
-0x3E55 = 0x83CA
-0x3E56 = 0x5C40
-0x3E57 = 0x5480
-0x3E58 = 0x77E9
-0x3E59 = 0x8209
-0x3E5A = 0x6CAE
-0x3E5B = 0x805A
-0x3E5C = 0x62D2
-0x3E5D = 0x64DA
-0x3E5E = 0x5DE8
-0x3E5F = 0x5177
-0x3E60 = 0x8DDD
-0x3E61 = 0x8E1E
-0x3E62 = 0x92F8
-0x3E63 = 0x4FF1
-0x3E64 = 0x53E5
-0x3E65 = 0x61FC
-0x3E66 = 0x70AC
-0x3E67 = 0x5287
-0x3E68 = 0x6350
-0x3E69 = 0x9D51
-0x3E6A = 0x5A1F
-0x3E6B = 0x5026
-0x3E6C = 0x7737
-0x3E6D = 0x5377
-0x3E6E = 0x7D79
-0x3E6F = 0x6485
-0x3E70 = 0x652B
-0x3E71 = 0x6289
-0x3E72 = 0x6398
-0x3E73 = 0x5014
-0x3E74 = 0x7235
-0x3E75 = 0x89BA
-0x3E76 = 0x51B3
-0x3E77 = 0x8A23
-0x3E78 = 0x7D76
-0x3E79 = 0x5747
-0x3E7A = 0x83CC
-0x3E7B = 0x921E
-0x3E7C = 0x8ECD
-0x3E7D = 0x541B
-0x3E7E = 0x5CFB
-0x3F21 = 0x4FCA
-0x3F22 = 0x7AE3
-0x3F23 = 0x6D5A
-0x3F24 = 0x90E1
-0x3F25 = 0x99FF
-0x3F26 = 0x5580
-0x3F27 = 0x5496
-0x3F28 = 0x5361
-0x3F29 = 0x54AF
-0x3F2A = 0x958B
-0x3F2B = 0x63E9
-0x3F2C = 0x6977
-0x3F2D = 0x51F1
-0x3F2E = 0x6168
-0x3F2F = 0x520A
-0x3F30 = 0x582A
-0x3F31 = 0x52D8
-0x3F32 = 0x574E
-0x3F33 = 0x780D
-0x3F34 = 0x770B
-0x3F35 = 0x5EB7
-0x3F36 = 0x6177
-0x3F37 = 0x7CE0
-0x3F38 = 0x625B
-0x3F39 = 0x6297
-0x3F3A = 0x4EA2
-0x3F3B = 0x7095
-0x3F3C = 0x8003
-0x3F3D = 0x62F7
-0x3F3E = 0x70E4
-0x3F3F = 0x9760
-0x3F40 = 0x5777
-0x3F41 = 0x82DB
-0x3F42 = 0x67EF
-0x3F43 = 0x68F5
-0x3F44 = 0x78D5
-0x3F45 = 0x9846
-0x3F46 = 0x79D1
-0x3F47 = 0x6BBB
-0x3F48 = 0x54B3
-0x3F49 = 0x53EF
-0x3F4A = 0x6E34
-0x3F4B = 0x514B
-0x3F4C = 0x523B
-0x3F4D = 0x5BA2
-0x3F4E = 0x8AB2
-0x3F4F = 0x80AF
-0x3F50 = 0x5543
-0x3F51 = 0x58BE
-0x3F52 = 0x61C7
-0x3F53 = 0x5751
-0x3F54 = 0x542D
-0x3F55 = 0x7A7A
-0x3F56 = 0x6050
-0x3F57 = 0x5B54
-0x3F58 = 0x63A7
-0x3F59 = 0x6473
-0x3F5A = 0x53E3
-0x3F5B = 0x6263
-0x3F5C = 0x5BC7
-0x3F5D = 0x67AF
-0x3F5E = 0x54ED
-0x3F5F = 0x7A9F
-0x3F60 = 0x82E6
-0x3F61 = 0x9177
-0x3F62 = 0x5EAB
-0x3F63 = 0x8932
-0x3F64 = 0x8A87
-0x3F65 = 0x57AE
-0x3F66 = 0x630E
-0x3F67 = 0x8DE8
-0x3F68 = 0x80EF
-0x3F69 = 0x584A
-0x3F6A = 0x7B77
-0x3F6B = 0x5108
-0x3F6C = 0x5FEB
-0x3F6D = 0x5BEC
-0x3F6E = 0x6B3E
-0x3F6F = 0x5321
-0x3F70 = 0x7B50
-0x3F71 = 0x72C2
-0x3F72 = 0x6846
-0x3F73 = 0x7926
-0x3F74 = 0x7736
-0x3F75 = 0x66E0
-0x3F76 = 0x51B5
-0x3F77 = 0x8667
-0x3F78 = 0x76D4
-0x3F79 = 0x5DCB
-0x3F7A = 0x7ABA
-0x3F7B = 0x8475
-0x3F7C = 0x594E
-0x3F7D = 0x9B41
-0x3F7E = 0x5080
-0x4021 = 0x994B
-0x4022 = 0x6127
-0x4023 = 0x6F70
-0x4024 = 0x5764
-0x4025 = 0x6606
-0x4026 = 0x6346
-0x4027 = 0x56F0
-0x4028 = 0x62EC
-0x4029 = 0x64F4
-0x402A = 0x5ED3
-0x402B = 0x95CA
-0x402C = 0x5783
-0x402D = 0x62C9
-0x402E = 0x5587
-0x402F = 0x881F
-0x4030 = 0x81D8
-0x4031 = 0x8FA3
-0x4032 = 0x5566
-0x4033 = 0x840A
-0x4034 = 0x4F86
-0x4035 = 0x8CF4
-0x4036 = 0x85CD
-0x4037 = 0x5A6A
-0x4038 = 0x6B04
-0x4039 = 0x6514
-0x403A = 0x7C43
-0x403B = 0x95CC
-0x403C = 0x862D
-0x403D = 0x703E
-0x403E = 0x8B95
-0x403F = 0x652C
-0x4040 = 0x89BD
-0x4041 = 0x61F6
-0x4042 = 0x7E9C
-0x4043 = 0x721B
-0x4044 = 0x6FEB
-0x4045 = 0x7405
-0x4046 = 0x6994
-0x4047 = 0x72FC
-0x4048 = 0x5ECA
-0x4049 = 0x90CE
-0x404A = 0x6717
-0x404B = 0x6D6A
-0x404C = 0x6488
-0x404D = 0x52DE
-0x404E = 0x7262
-0x404F = 0x8001
-0x4050 = 0x4F6C
-0x4051 = 0x59E5
-0x4052 = 0x916A
-0x4053 = 0x70D9
-0x4054 = 0x6F87
-0x4055 = 0x52D2
-0x4056 = 0x6A02
-0x4057 = 0x96F7
-0x4058 = 0x9433
-0x4059 = 0x857E
-0x405A = 0x78CA
-0x405B = 0x7D2F
-0x405C = 0x5121
-0x405D = 0x58D8
-0x405E = 0x64C2
-0x405F = 0x808B
-0x4060 = 0x985E
-0x4061 = 0x6CEA
-0x4062 = 0x68F1
-0x4063 = 0x695E
-0x4064 = 0x51B7
-0x4065 = 0x5398
-0x4066 = 0x68A8
-0x4067 = 0x7281
-0x4068 = 0x9ECE
-0x4069 = 0x7C6C
-0x406A = 0x72F8
-0x406B = 0x96E2
-0x406C = 0x7055
-0x406D = 0x7406
-0x406E = 0x674E
-0x406F = 0x88CF
-0x4070 = 0x9BC9
-0x4071 = 0x79AE
-0x4072 = 0x8389
-0x4073 = 0x8354
-0x4074 = 0x540F
-0x4075 = 0x6817
-0x4076 = 0x9E97
-0x4077 = 0x53B2
-0x4078 = 0x52F5
-0x4079 = 0x792B
-0x407A = 0x6B77
-0x407B = 0x5229
-0x407C = 0x5088
-0x407D = 0x4F8B
-0x407E = 0x4FD0
-0x4121 = 0x75E2
-0x4122 = 0x7ACB
-0x4123 = 0x7C92
-0x4124 = 0x701D
-0x4125 = 0x96B8
-0x4126 = 0x529B
-0x4127 = 0x7483
-0x4128 = 0x54E9
-0x4129 = 0x5006
-0x412A = 0x806F
-0x412B = 0x84EE
-0x412C = 0x9023
-0x412D = 0x942E
-0x412E = 0x5EC9
-0x412F = 0x6190
-0x4130 = 0x6F23
-0x4131 = 0x7C3E
-0x4132 = 0x6582
-0x4133 = 0x81C9
-0x4134 = 0x93C8
-0x4135 = 0x6200
-0x4136 = 0x7149
-0x4137 = 0x7DF4
-0x4138 = 0x7CE7
-0x4139 = 0x51C9
-0x413A = 0x6881
-0x413B = 0x7CB1
-0x413C = 0x826F
-0x413D = 0x5169
-0x413E = 0x8F1B
-0x413F = 0x91CF
-0x4140 = 0x667E
-0x4141 = 0x4EAE
-0x4142 = 0x8AD2
-0x4143 = 0x64A9
-0x4144 = 0x804A
-0x4145 = 0x50DA
-0x4146 = 0x7642
-0x4147 = 0x71CE
-0x4148 = 0x5BE5
-0x4149 = 0x907C
-0x414A = 0x6F66
-0x414B = 0x4E86
-0x414C = 0x6482
-0x414D = 0x9410
-0x414E = 0x5ED6
-0x414F = 0x6599
-0x4150 = 0x5217
-0x4151 = 0x88C2
-0x4152 = 0x70C8
-0x4153 = 0x52A3
-0x4154 = 0x7375
-0x4155 = 0x7433
-0x4156 = 0x6797
-0x4157 = 0x78F7
-0x4158 = 0x9716
-0x4159 = 0x81E8
-0x415A = 0x9130
-0x415B = 0x9C57
-0x415C = 0x6DCB
-0x415D = 0x51DB
-0x415E = 0x8CC3
-0x415F = 0x541D
-0x4160 = 0x62CE
-0x4161 = 0x73B2
-0x4162 = 0x83F1
-0x4163 = 0x96F6
-0x4164 = 0x9F61
-0x4165 = 0x9234
-0x4166 = 0x4F36
-0x4167 = 0x7F9A
-0x4168 = 0x51CC
-0x4169 = 0x9748
-0x416A = 0x9675
-0x416B = 0x5DBA
-0x416C = 0x9818
-0x416D = 0x53E6
-0x416E = 0x4EE4
-0x416F = 0x6E9C
-0x4170 = 0x7409
-0x4171 = 0x69B4
-0x4172 = 0x786B
-0x4173 = 0x993E
-0x4174 = 0x7559
-0x4175 = 0x5289
-0x4176 = 0x7624
-0x4177 = 0x6D41
-0x4178 = 0x67F3
-0x4179 = 0x516D
-0x417A = 0x9F8D
-0x417B = 0x807E
-0x417C = 0x56A8
-0x417D = 0x7C60
-0x417E = 0x7ABF
-0x4221 = 0x9686
-0x4222 = 0x58DF
-0x4223 = 0x650F
-0x4224 = 0x96B4
-0x4225 = 0x6A13
-0x4226 = 0x5A41
-0x4227 = 0x645F
-0x4228 = 0x7C0D
-0x4229 = 0x6F0F
-0x422A = 0x964B
-0x422B = 0x8606
-0x422C = 0x76E7
-0x422D = 0x9871
-0x422E = 0x5EEC
-0x422F = 0x7210
-0x4230 = 0x64C4
-0x4231 = 0x6EF7
-0x4232 = 0x865C
-0x4233 = 0x9B6F
-0x4234 = 0x9E93
-0x4235 = 0x788C
-0x4236 = 0x9732
-0x4237 = 0x8DEF
-0x4238 = 0x8CC2
-0x4239 = 0x9E7F
-0x423A = 0x6F5E
-0x423B = 0x7984
-0x423C = 0x9332
-0x423D = 0x9678
-0x423E = 0x622E
-0x423F = 0x9A62
-0x4240 = 0x5415
-0x4241 = 0x92C1
-0x4242 = 0x4FA3
-0x4243 = 0x65C5
-0x4244 = 0x5C65
-0x4245 = 0x5C62
-0x4246 = 0x7E37
-0x4247 = 0x616E
-0x4248 = 0x6C2F
-0x4249 = 0x5F8B
-0x424A = 0x7387
-0x424B = 0x6FFE
-0x424C = 0x7DD1
-0x424D = 0x5DD2
-0x424E = 0x6523
-0x424F = 0x5B7F
-0x4250 = 0x7064
-0x4251 = 0x5375
-0x4252 = 0x4E82
-0x4253 = 0x63A0
-0x4254 = 0x7565
-0x4255 = 0x6384
-0x4256 = 0x8F2A
-0x4257 = 0x502B
-0x4258 = 0x4F96
-0x4259 = 0x6DEA
-0x425A = 0x7DB8
-0x425B = 0x8AD6
-0x425C = 0x863F
-0x425D = 0x87BA
-0x425E = 0x7F85
-0x425F = 0x908F
-0x4260 = 0x947C
-0x4261 = 0x7C6E
-0x4262 = 0x9A3E
-0x4263 = 0x88F8
-0x4264 = 0x843D
-0x4265 = 0x6D1B
-0x4266 = 0x99F1
-0x4267 = 0x7D61
-0x4268 = 0x5ABD
-0x4269 = 0x9EBB
-0x426A = 0x746A
-0x426B = 0x78BC
-0x426C = 0x879E
-0x426D = 0x99AC
-0x426E = 0x99E1
-0x426F = 0x561B
-0x4270 = 0x55CE
-0x4271 = 0x57CB
-0x4272 = 0x8CB7
-0x4273 = 0x9EA5
-0x4274 = 0x8CE3
-0x4275 = 0x9081
-0x4276 = 0x8109
-0x4277 = 0x779E
-0x4278 = 0x9945
-0x4279 = 0x883B
-0x427A = 0x6EFF
-0x427B = 0x8513
-0x427C = 0x66FC
-0x427D = 0x6162
-0x427E = 0x6F2B
-0x4321 = 0x8B3E
-0x4322 = 0x8292
-0x4323 = 0x832B
-0x4324 = 0x76F2
-0x4325 = 0x6C13
-0x4326 = 0x5FD9
-0x4327 = 0x83BD
-0x4328 = 0x732B
-0x4329 = 0x8305
-0x432A = 0x9328
-0x432B = 0x6BDB
-0x432C = 0x77DB
-0x432D = 0x925A
-0x432E = 0x536F
-0x432F = 0x8302
-0x4330 = 0x5192
-0x4331 = 0x5E3D
-0x4332 = 0x8C8C
-0x4333 = 0x8CBF
-0x4334 = 0x9EBD
-0x4335 = 0x73AB
-0x4336 = 0x679A
-0x4337 = 0x6885
-0x4338 = 0x9176
-0x4339 = 0x9709
-0x433A = 0x7164
-0x433B = 0x6CA1
-0x433C = 0x7709
-0x433D = 0x5A92
-0x433E = 0x9382
-0x433F = 0x6BCF
-0x4340 = 0x7F8E
-0x4341 = 0x6627
-0x4342 = 0x5BD0
-0x4343 = 0x59B9
-0x4344 = 0x5A9A
-0x4345 = 0x9580
-0x4346 = 0x60B6
-0x4347 = 0x5011
-0x4348 = 0x840C
-0x4349 = 0x8499
-0x434A = 0x6AAC
-0x434B = 0x76DF
-0x434C = 0x9333
-0x434D = 0x731B
-0x434E = 0x5922
-0x434F = 0x5B5F
-0x4350 = 0x772F
-0x4351 = 0x919A
-0x4352 = 0x9761
-0x4353 = 0x7CDC
-0x4354 = 0x8FF7
-0x4355 = 0x8B0E
-0x4356 = 0x5F4C
-0x4357 = 0x7C73
-0x4358 = 0x79D8
-0x4359 = 0x8993
-0x435A = 0x6CCC
-0x435B = 0x871C
-0x435C = 0x5BC6
-0x435D = 0x5E42
-0x435E = 0x68C9
-0x435F = 0x7720
-0x4360 = 0x7DBF
-0x4361 = 0x5195
-0x4362 = 0x514D
-0x4363 = 0x52C9
-0x4364 = 0x5A29
-0x4365 = 0x7DEC
-0x4366 = 0x9762
-0x4367 = 0x82D7
-0x4368 = 0x63CF
-0x4369 = 0x7784
-0x436A = 0x85D0
-0x436B = 0x79D2
-0x436C = 0x6E3A
-0x436D = 0x5EDF
-0x436E = 0x5999
-0x436F = 0x8511
-0x4370 = 0x6EC5
-0x4371 = 0x6C11
-0x4372 = 0x62BF
-0x4373 = 0x76BF
-0x4374 = 0x654F
-0x4375 = 0x61AB
-0x4376 = 0x95A9
-0x4377 = 0x660E
-0x4378 = 0x879F
-0x4379 = 0x9CF4
-0x437A = 0x9298
-0x437B = 0x540D
-0x437C = 0x547D
-0x437D = 0x8B2C
-0x437E = 0x6478
-0x4421 = 0x6479
-0x4422 = 0x8611
-0x4423 = 0x6A21
-0x4424 = 0x819C
-0x4425 = 0x78E8
-0x4426 = 0x6469
-0x4427 = 0x9B54
-0x4428 = 0x62B9
-0x4429 = 0x672B
-0x442A = 0x83AB
-0x442B = 0x58A8
-0x442C = 0x9ED8
-0x442D = 0x6CAB
-0x442E = 0x6F20
-0x442F = 0x5BDE
-0x4430 = 0x964C
-0x4431 = 0x8B00
-0x4432 = 0x725F
-0x4433 = 0x67D0
-0x4434 = 0x62C7
-0x4435 = 0x7261
-0x4436 = 0x755D
-0x4437 = 0x59C6
-0x4438 = 0x6BCD
-0x4439 = 0x5893
-0x443A = 0x66AE
-0x443B = 0x5E55
-0x443C = 0x52DF
-0x443D = 0x6155
-0x443E = 0x6728
-0x443F = 0x76EE
-0x4440 = 0x7766
-0x4441 = 0x7267
-0x4442 = 0x7A46
-0x4443 = 0x62FF
-0x4444 = 0x54EA
-0x4445 = 0x5450
-0x4446 = 0x9209
-0x4447 = 0x90A3
-0x4448 = 0x5A1C
-0x4449 = 0x7D0D
-0x444A = 0x6C16
-0x444B = 0x4E43
-0x444C = 0x5976
-0x444D = 0x8010
-0x444E = 0x5948
-0x444F = 0x5357
-0x4450 = 0x7537
-0x4451 = 0x96E3
-0x4452 = 0x56CA
-0x4453 = 0x6493
-0x4454 = 0x8166
-0x4455 = 0x60F1
-0x4456 = 0x9B27
-0x4457 = 0x6DD6
-0x4458 = 0x5462
-0x4459 = 0x9912
-0x445A = 0x5185
-0x445B = 0x5AE9
-0x445C = 0x80FD
-0x445D = 0x59AE
-0x445E = 0x9713
-0x445F = 0x502A
-0x4460 = 0x6CE5
-0x4461 = 0x5C3C
-0x4462 = 0x64EC
-0x4463 = 0x4F60
-0x4464 = 0x533F
-0x4465 = 0x81A9
-0x4466 = 0x9006
-0x4467 = 0x6EBA
-0x4468 = 0x852B
-0x4469 = 0x62C8
-0x446A = 0x5E74
-0x446B = 0x78BE
-0x446C = 0x6506
-0x446D = 0x637B
-0x446E = 0x5FF5
-0x446F = 0x5A18
-0x4470 = 0x91C0
-0x4471 = 0x9CE5
-0x4472 = 0x5C3F
-0x4473 = 0x634F
-0x4474 = 0x8076
-0x4475 = 0x5B7D
-0x4476 = 0x5699
-0x4477 = 0x9477
-0x4478 = 0x93B3
-0x4479 = 0x6D85
-0x447A = 0x60A8
-0x447B = 0x6AB8
-0x447C = 0x7370
-0x447D = 0x51DD
-0x447E = 0x5BE7
-0x4521 = 0x64F0
-0x4522 = 0x6FD8
-0x4523 = 0x725B
-0x4524 = 0x626D
-0x4525 = 0x9215
-0x4526 = 0x7D10
-0x4527 = 0x81BF
-0x4528 = 0x6FC3
-0x4529 = 0x8FB2
-0x452A = 0x5F04
-0x452B = 0x5974
-0x452C = 0x52AA
-0x452D = 0x6012
-0x452E = 0x5973
-0x452F = 0x6696
-0x4530 = 0x8650
-0x4531 = 0x7627
-0x4532 = 0x632A
-0x4533 = 0x61E6
-0x4534 = 0x7CEF
-0x4535 = 0x8AFE
-0x4536 = 0x54E6
-0x4537 = 0x6B50
-0x4538 = 0x9DD7
-0x4539 = 0x6BC6
-0x453A = 0x85D5
-0x453B = 0x5614
-0x453C = 0x5076
-0x453D = 0x6F1A
-0x453E = 0x556A
-0x453F = 0x8DB4
-0x4540 = 0x722C
-0x4541 = 0x5E15
-0x4542 = 0x6015
-0x4543 = 0x7436
-0x4544 = 0x62CD
-0x4545 = 0x6392
-0x4546 = 0x724C
-0x4547 = 0x5F98
-0x4548 = 0x6E43
-0x4549 = 0x6D3E
-0x454A = 0x6500
-0x454B = 0x6F58
-0x454C = 0x76E4
-0x454D = 0x78D0
-0x454E = 0x76FC
-0x454F = 0x7554
-0x4550 = 0x5224
-0x4551 = 0x53DB
-0x4552 = 0x4E53
-0x4553 = 0x9F90
-0x4554 = 0x65C1
-0x4555 = 0x802A
-0x4556 = 0x80D6
-0x4557 = 0x629B
-0x4558 = 0x5486
-0x4559 = 0x5228
-0x455A = 0x70AE
-0x455B = 0x888D
-0x455C = 0x8DD1
-0x455D = 0x6CE1
-0x455E = 0x5478
-0x455F = 0x80DA
-0x4560 = 0x57F9
-0x4561 = 0x88F4
-0x4562 = 0x8CE0
-0x4563 = 0x966A
-0x4564 = 0x914D
-0x4565 = 0x4F69
-0x4566 = 0x6C9B
-0x4567 = 0x5674
-0x4568 = 0x76C6
-0x4569 = 0x7830
-0x456A = 0x62A8
-0x456B = 0x70F9
-0x456C = 0x6F8E
-0x456D = 0x5F6D
-0x456E = 0x84EC
-0x456F = 0x68DA
-0x4570 = 0x787C
-0x4571 = 0x7BF7
-0x4572 = 0x81A8
-0x4573 = 0x670B
-0x4574 = 0x9D6C
-0x4575 = 0x6367
-0x4576 = 0x78B0
-0x4577 = 0x576F
-0x4578 = 0x7812
-0x4579 = 0x9739
-0x457A = 0x6279
-0x457B = 0x62AB
-0x457C = 0x5288
-0x457D = 0x7435
-0x457E = 0x6BD7
-0x4621 = 0x5564
-0x4622 = 0x813E
-0x4623 = 0x75B2
-0x4624 = 0x76AE
-0x4625 = 0x5339
-0x4626 = 0x75DE
-0x4627 = 0x50FB
-0x4628 = 0x5C41
-0x4629 = 0x8B6C
-0x462A = 0x7BC7
-0x462B = 0x504F
-0x462C = 0x7247
-0x462D = 0x9A19
-0x462E = 0x98C4
-0x462F = 0x6F02
-0x4630 = 0x74E2
-0x4631 = 0x7968
-0x4632 = 0x6487
-0x4633 = 0x77A5
-0x4634 = 0x62FC
-0x4635 = 0x983B
-0x4636 = 0x8CA7
-0x4637 = 0x54C1
-0x4638 = 0x8058
-0x4639 = 0x4E52
-0x463A = 0x576A
-0x463B = 0x860B
-0x463C = 0x840D
-0x463D = 0x5E73
-0x463E = 0x6191
-0x463F = 0x74F6
-0x4640 = 0x8A55
-0x4641 = 0x5C4F
-0x4642 = 0x5761
-0x4643 = 0x6F51
-0x4644 = 0x9817
-0x4645 = 0x5A46
-0x4646 = 0x7834
-0x4647 = 0x9B44
-0x4648 = 0x8FEB
-0x4649 = 0x7C95
-0x464A = 0x5256
-0x464B = 0x64B2
-0x464C = 0x92EA
-0x464D = 0x50D5
-0x464E = 0x8386
-0x464F = 0x8461
-0x4650 = 0x83E9
-0x4651 = 0x84B2
-0x4652 = 0x57D4
-0x4653 = 0x6A38
-0x4654 = 0x5703
-0x4655 = 0x666E
-0x4656 = 0x6D66
-0x4657 = 0x8B5C
-0x4658 = 0x66DD
-0x4659 = 0x7011
-0x465A = 0x671F
-0x465B = 0x6B3A
-0x465C = 0x68F2
-0x465D = 0x621A
-0x465E = 0x59BB
-0x465F = 0x4E03
-0x4660 = 0x51C4
-0x4661 = 0x6F06
-0x4662 = 0x67D2
-0x4663 = 0x6C8F
-0x4664 = 0x5176
-0x4665 = 0x68CB
-0x4666 = 0x5947
-0x4667 = 0x6B67
-0x4668 = 0x7566
-0x4669 = 0x5D0E
-0x466A = 0x81CD
-0x466B = 0x9F4A
-0x466C = 0x65D7
-0x466D = 0x7948
-0x466E = 0x7941
-0x466F = 0x9A0E
-0x4670 = 0x8D77
-0x4671 = 0x8C48
-0x4672 = 0x4E5E
-0x4673 = 0x4F01
-0x4674 = 0x5553
-0x4675 = 0x5951
-0x4676 = 0x780C
-0x4677 = 0x5668
-0x4678 = 0x6C23
-0x4679 = 0x8FC4
-0x467A = 0x68C4
-0x467B = 0x6C7D
-0x467C = 0x6CE3
-0x467D = 0x8A16
-0x467E = 0x6390
-0x4721 = 0x6070
-0x4722 = 0x6D3D
-0x4723 = 0x727D
-0x4724 = 0x6266
-0x4725 = 0x91FA
-0x4726 = 0x925B
-0x4727 = 0x5343
-0x4728 = 0x9077
-0x4729 = 0x7C3D
-0x472A = 0x4EDF
-0x472B = 0x8B19
-0x472C = 0x4E7E
-0x472D = 0x9ED4
-0x472E = 0x9322
-0x472F = 0x9257
-0x4730 = 0x524D
-0x4731 = 0x6F5B
-0x4732 = 0x9063
-0x4733 = 0x6DFA
-0x4734 = 0x8B74
-0x4735 = 0x5879
-0x4736 = 0x5D4C
-0x4737 = 0x6B20
-0x4738 = 0x6B49
-0x4739 = 0x69CD
-0x473A = 0x55C6
-0x473B = 0x8154
-0x473C = 0x7F8C
-0x473D = 0x58BB
-0x473E = 0x8594
-0x473F = 0x5F3A
-0x4740 = 0x6436
-0x4741 = 0x6A47
-0x4742 = 0x936C
-0x4743 = 0x6572
-0x4744 = 0x6084
-0x4745 = 0x6A4B
-0x4746 = 0x77A7
-0x4747 = 0x55AC
-0x4748 = 0x50D1
-0x4749 = 0x5DE7
-0x474A = 0x9798
-0x474B = 0x64AC
-0x474C = 0x7FF9
-0x474D = 0x5CED
-0x474E = 0x4FCF
-0x474F = 0x7AC5
-0x4750 = 0x5207
-0x4751 = 0x8304
-0x4752 = 0x4E14
-0x4753 = 0x602F
-0x4754 = 0x7ACA
-0x4755 = 0x6B3D
-0x4756 = 0x4FB5
-0x4757 = 0x89AA
-0x4758 = 0x79E6
-0x4759 = 0x7434
-0x475A = 0x52E4
-0x475B = 0x82B9
-0x475C = 0x64D2
-0x475D = 0x79BD
-0x475E = 0x5BE2
-0x475F = 0x6C81
-0x4760 = 0x9752
-0x4761 = 0x8F15
-0x4762 = 0x6C2B
-0x4763 = 0x50BE
-0x4764 = 0x537F
-0x4765 = 0x6E05
-0x4766 = 0x64CE
-0x4767 = 0x6674
-0x4768 = 0x6C30
-0x4769 = 0x60C5
-0x476A = 0x9803
-0x476B = 0x8ACB
-0x476C = 0x6176
-0x476D = 0x74CA
-0x476E = 0x7AAE
-0x476F = 0x79CB
-0x4770 = 0x4E18
-0x4771 = 0x90B1
-0x4772 = 0x7403
-0x4773 = 0x6C42
-0x4774 = 0x56DA
-0x4775 = 0x914B
-0x4776 = 0x6CC5
-0x4777 = 0x8DA8
-0x4778 = 0x5340
-0x4779 = 0x86C6
-0x477A = 0x66F2
-0x477B = 0x8EC0
-0x477C = 0x5C48
-0x477D = 0x9A45
-0x477E = 0x6E20
-0x4821 = 0x53D6
-0x4822 = 0x5A36
-0x4823 = 0x9F72
-0x4824 = 0x8DA3
-0x4825 = 0x53BB
-0x4826 = 0x5708
-0x4827 = 0x9874
-0x4828 = 0x6B0A
-0x4829 = 0x919B
-0x482A = 0x6CC9
-0x482B = 0x5168
-0x482C = 0x75CA
-0x482D = 0x62F3
-0x482E = 0x72AC
-0x482F = 0x5238
-0x4830 = 0x52F8
-0x4831 = 0x7F3A
-0x4832 = 0x7094
-0x4833 = 0x7638
-0x4834 = 0x5374
-0x4835 = 0x9D72
-0x4836 = 0x69B7
-0x4837 = 0x78BA
-0x4838 = 0x96C0
-0x4839 = 0x88D9
-0x483A = 0x7FA4
-0x483B = 0x7136
-0x483C = 0x71C3
-0x483D = 0x5189
-0x483E = 0x67D3
-0x483F = 0x74E4
-0x4840 = 0x58E4
-0x4841 = 0x6518
-0x4842 = 0x56B7
-0x4843 = 0x8B93
-0x4844 = 0x9952
-0x4845 = 0x64FE
-0x4846 = 0x7E5E
-0x4847 = 0x60F9
-0x4848 = 0x71B1
-0x4849 = 0x58EC
-0x484A = 0x4EC1
-0x484B = 0x4EBA
-0x484C = 0x5FCD
-0x484D = 0x97CC
-0x484E = 0x4EFB
-0x484F = 0x8A8D
-0x4850 = 0x5203
-0x4851 = 0x598A
-0x4852 = 0x7D09
-0x4853 = 0x6254
-0x4854 = 0x4ECD
-0x4855 = 0x65E5
-0x4856 = 0x620E
-0x4857 = 0x8338
-0x4858 = 0x84C9
-0x4859 = 0x69AE
-0x485A = 0x878D
-0x485B = 0x7194
-0x485C = 0x6EB6
-0x485D = 0x5BB9
-0x485E = 0x7D68
-0x485F = 0x5197
-0x4860 = 0x63C9
-0x4861 = 0x67D4
-0x4862 = 0x8089
-0x4863 = 0x8339
-0x4864 = 0x8815
-0x4865 = 0x5112
-0x4866 = 0x5B7A
-0x4867 = 0x5982
-0x4868 = 0x8FB1
-0x4869 = 0x4E73
-0x486A = 0x6C5D
-0x486B = 0x5165
-0x486C = 0x8925
-0x486D = 0x8EDF
-0x486E = 0x962E
-0x486F = 0x854A
-0x4870 = 0x745E
-0x4871 = 0x92ED
-0x4872 = 0x958F
-0x4873 = 0x6F64
-0x4874 = 0x82E5
-0x4875 = 0x5F31
-0x4876 = 0x6492
-0x4877 = 0x7051
-0x4878 = 0x85A9
-0x4879 = 0x816E
-0x487A = 0x9C13
-0x487B = 0x585E
-0x487C = 0x8CFD
-0x487D = 0x4E09
-0x487E = 0x53C1
-0x4921 = 0x5098
-0x4922 = 0x6563
-0x4923 = 0x6851
-0x4924 = 0x55D3
-0x4925 = 0x55AA
-0x4926 = 0x6414
-0x4927 = 0x9A37
-0x4928 = 0x6383
-0x4929 = 0x5AC2
-0x492A = 0x745F
-0x492B = 0x8272
-0x492C = 0x6F80
-0x492D = 0x68EE
-0x492E = 0x50E7
-0x492F = 0x838E
-0x4930 = 0x7802
-0x4931 = 0x6BBA
-0x4932 = 0x5239
-0x4933 = 0x6C99
-0x4934 = 0x7D17
-0x4935 = 0x50BB
-0x4936 = 0x5565
-0x4937 = 0x715E
-0x4938 = 0x7BE9
-0x4939 = 0x66EC
-0x493A = 0x73CA
-0x493B = 0x82EB
-0x493C = 0x6749
-0x493D = 0x5C71
-0x493E = 0x5220
-0x493F = 0x717D
-0x4940 = 0x886B
-0x4941 = 0x9583
-0x4942 = 0x965D
-0x4943 = 0x64C5
-0x4944 = 0x8D0D
-0x4945 = 0x81B3
-0x4946 = 0x5584
-0x4947 = 0x6C55
-0x4948 = 0x6247
-0x4949 = 0x7E55
-0x494A = 0x5892
-0x494B = 0x50B7
-0x494C = 0x5546
-0x494D = 0x8CDE
-0x494E = 0x664C
-0x494F = 0x4E0A
-0x4950 = 0x5C1A
-0x4951 = 0x88F3
-0x4952 = 0x68A2
-0x4953 = 0x634E
-0x4954 = 0x7A0D
-0x4955 = 0x71D2
-0x4956 = 0x828D
-0x4957 = 0x52FA
-0x4958 = 0x97F6
-0x4959 = 0x5C11
-0x495A = 0x54E8
-0x495B = 0x90B5
-0x495C = 0x7D39
-0x495D = 0x5962
-0x495E = 0x8CD2
-0x495F = 0x86C7
-0x4960 = 0x820C
-0x4961 = 0x6368
-0x4962 = 0x8D66
-0x4963 = 0x651D
-0x4964 = 0x5C04
-0x4965 = 0x61FE
-0x4966 = 0x6D89
-0x4967 = 0x793E
-0x4968 = 0x8A2D
-0x4969 = 0x7837
-0x496A = 0x7533
-0x496B = 0x547B
-0x496C = 0x4F38
-0x496D = 0x8EAB
-0x496E = 0x6DF1
-0x496F = 0x5A20
-0x4970 = 0x7D33
-0x4971 = 0x795E
-0x4972 = 0x6C88
-0x4973 = 0x5BE9
-0x4974 = 0x5B38
-0x4975 = 0x751A
-0x4976 = 0x814E
-0x4977 = 0x614E
-0x4978 = 0x6EF2
-0x4979 = 0x8072
-0x497A = 0x751F
-0x497B = 0x7525
-0x497C = 0x7272
-0x497D = 0x5347
-0x497E = 0x7E69
-0x4A21 = 0x7701
-0x4A22 = 0x76DB
-0x4A23 = 0x5269
-0x4A24 = 0x52DD
-0x4A25 = 0x8056
-0x4A26 = 0x5E2B
-0x4A27 = 0x5931
-0x4A28 = 0x7345
-0x4A29 = 0x65BD
-0x4A2A = 0x6FD5
-0x4A2B = 0x8A69
-0x4A2C = 0x5C38
-0x4A2D = 0x8671
-0x4A2E = 0x5341
-0x4A2F = 0x77F3
-0x4A30 = 0x62FE
-0x4A31 = 0x6642
-0x4A32 = 0x4EC0
-0x4A33 = 0x98DF
-0x4A34 = 0x8755
-0x4A35 = 0x5BE6
-0x4A36 = 0x8B58
-0x4A37 = 0x53F2
-0x4A38 = 0x77E2
-0x4A39 = 0x4F7F
-0x4A3A = 0x5C4E
-0x4A3B = 0x99DB
-0x4A3C = 0x59CB
-0x4A3D = 0x5F0F
-0x4A3E = 0x793A
-0x4A3F = 0x58EB
-0x4A40 = 0x4E16
-0x4A41 = 0x67FF
-0x4A42 = 0x4E8B
-0x4A43 = 0x62ED
-0x4A44 = 0x8A93
-0x4A45 = 0x901D
-0x4A46 = 0x52E2
-0x4A47 = 0x662F
-0x4A48 = 0x55DC
-0x4A49 = 0x566C
-0x4A4A = 0x9069
-0x4A4B = 0x4ED5
-0x4A4C = 0x4F8D
-0x4A4D = 0x91CB
-0x4A4E = 0x98FE
-0x4A4F = 0x6C0F
-0x4A50 = 0x5E02
-0x4A51 = 0x6043
-0x4A52 = 0x5BA4
-0x4A53 = 0x8996
-0x4A54 = 0x8A66
-0x4A55 = 0x6536
-0x4A56 = 0x624B
-0x4A57 = 0x9996
-0x4A58 = 0x5B88
-0x4A59 = 0x58FD
-0x4A5A = 0x6388
-0x4A5B = 0x552E
-0x4A5C = 0x53D7
-0x4A5D = 0x7626
-0x4A5E = 0x7378
-0x4A5F = 0x852C
-0x4A60 = 0x6A1E
-0x4A61 = 0x68B3
-0x4A62 = 0x6B8A
-0x4A63 = 0x6292
-0x4A64 = 0x8F38
-0x4A65 = 0x53D4
-0x4A66 = 0x8212
-0x4A67 = 0x6DD1
-0x4A68 = 0x758F
-0x4A69 = 0x66F8
-0x4A6A = 0x8D16
-0x4A6B = 0x5B70
-0x4A6C = 0x719F
-0x4A6D = 0x85AF
-0x4A6E = 0x6691
-0x4A6F = 0x66D9
-0x4A70 = 0x7F72
-0x4A71 = 0x8700
-0x4A72 = 0x9ECD
-0x4A73 = 0x9F20
-0x4A74 = 0x5C6C
-0x4A75 = 0x8853
-0x4A76 = 0x8FF0
-0x4A77 = 0x6A39
-0x4A78 = 0x675F
-0x4A79 = 0x620D
-0x4A7A = 0x7AEA
-0x4A7B = 0x5885
-0x4A7C = 0x5EB6
-0x4A7D = 0x6578
-0x4A7E = 0x6F31
-0x4B21 = 0x6055
-0x4B22 = 0x5237
-0x4B23 = 0x800D
-0x4B24 = 0x6454
-0x4B25 = 0x8870
-0x4B26 = 0x7529
-0x4B27 = 0x5E25
-0x4B28 = 0x6813
-0x4B29 = 0x62F4
-0x4B2A = 0x971C
-0x4B2B = 0x96D9
-0x4B2C = 0x723D
-0x4B2D = 0x8AB0
-0x4B2E = 0x6C34
-0x4B2F = 0x7761
-0x4B30 = 0x7A0E
-0x4B31 = 0x542E
-0x4B32 = 0x77AC
-0x4B33 = 0x9806
-0x4B34 = 0x821C
-0x4B35 = 0x8AAC
-0x4B36 = 0x78A9
-0x4B37 = 0x6714
-0x4B38 = 0x720D
-0x4B39 = 0x65AF
-0x4B3A = 0x6495
-0x4B3B = 0x5636
-0x4B3C = 0x601D
-0x4B3D = 0x79C1
-0x4B3E = 0x53F8
-0x4B3F = 0x7D72
-0x4B40 = 0x6B7B
-0x4B41 = 0x8086
-0x4B42 = 0x5BFA
-0x4B43 = 0x55E3
-0x4B44 = 0x56DB
-0x4B45 = 0x4F3A
-0x4B46 = 0x4F3C
-0x4B47 = 0x98FC
-0x4B48 = 0x5DF3
-0x4B49 = 0x9B06
-0x4B4A = 0x8073
-0x4B4B = 0x616B
-0x4B4C = 0x980C
-0x4B4D = 0x9001
-0x4B4E = 0x5B8B
-0x4B4F = 0x8A1F
-0x4B50 = 0x8AA6
-0x4B51 = 0x641C
-0x4B52 = 0x8258
-0x4B53 = 0x64FB
-0x4B54 = 0x55FD
-0x4B55 = 0x8607
-0x4B56 = 0x9165
-0x4B57 = 0x4FD7
-0x4B58 = 0x7D20
-0x4B59 = 0x901F
-0x4B5A = 0x7C9F
-0x4B5B = 0x50F3
-0x4B5C = 0x5851
-0x4B5D = 0x6EAF
-0x4B5E = 0x5BBF
-0x4B5F = 0x8A34
-0x4B60 = 0x8085
-0x4B61 = 0x9178
-0x4B62 = 0x849C
-0x4B63 = 0x7B97
-0x4B64 = 0x96D6
-0x4B65 = 0x968B
-0x4B66 = 0x96A8
-0x4B67 = 0x7D8F
-0x4B68 = 0x9AD3
-0x4B69 = 0x788E
-0x4B6A = 0x6B72
-0x4B6B = 0x7A57
-0x4B6C = 0x9042
-0x4B6D = 0x96A7
-0x4B6E = 0x795F
-0x4B6F = 0x5B6B
-0x4B70 = 0x640D
-0x4B71 = 0x7B0B
-0x4B72 = 0x84D1
-0x4B73 = 0x68AD
-0x4B74 = 0x5506
-0x4B75 = 0x7E2E
-0x4B76 = 0x7463
-0x4B77 = 0x7D22
-0x4B78 = 0x9396
-0x4B79 = 0x6240
-0x4B7A = 0x584C
-0x4B7B = 0x4ED6
-0x4B7C = 0x5B83
-0x4B7D = 0x5979
-0x4B7E = 0x5854
-0x4C21 = 0x737A
-0x4C22 = 0x64BB
-0x4C23 = 0x8E4B
-0x4C24 = 0x8E0F
-0x4C25 = 0x80CE
-0x4C26 = 0x82D4
-0x4C27 = 0x62AC
-0x4C28 = 0x81FA
-0x4C29 = 0x6CF0
-0x4C2A = 0x915E
-0x4C2B = 0x592A
-0x4C2C = 0x614B
-0x4C2D = 0x6C70
-0x4C2E = 0x574D
-0x4C2F = 0x6524
-0x4C30 = 0x8CAA
-0x4C31 = 0x7671
-0x4C32 = 0x7058
-0x4C33 = 0x58C7
-0x4C34 = 0x6A80
-0x4C35 = 0x75F0
-0x4C36 = 0x6F6D
-0x4C37 = 0x8B5A
-0x4C38 = 0x8AC7
-0x4C39 = 0x5766
-0x4C3A = 0x6BEF
-0x4C3B = 0x8892
-0x4C3C = 0x78B3
-0x4C3D = 0x63A2
-0x4C3E = 0x5606
-0x4C3F = 0x70AD
-0x4C40 = 0x6E6F
-0x4C41 = 0x5858
-0x4C42 = 0x642A
-0x4C43 = 0x5802
-0x4C44 = 0x68E0
-0x4C45 = 0x819B
-0x4C46 = 0x5510
-0x4C47 = 0x7CD6
-0x4C48 = 0x5018
-0x4C49 = 0x8EBA
-0x4C4A = 0x6DCC
-0x4C4B = 0x8D9F
-0x4C4C = 0x71D9
-0x4C4D = 0x638F
-0x4C4E = 0x6FE4
-0x4C4F = 0x6ED4
-0x4C50 = 0x7E27
-0x4C51 = 0x8404
-0x4C52 = 0x6843
-0x4C53 = 0x9003
-0x4C54 = 0x6DD8
-0x4C55 = 0x9676
-0x4C56 = 0x8A0E
-0x4C57 = 0x5957
-0x4C58 = 0x7279
-0x4C59 = 0x85E4
-0x4C5A = 0x9A30
-0x4C5B = 0x75BC
-0x4C5C = 0x8B04
-0x4C5D = 0x68AF
-0x4C5E = 0x5254
-0x4C5F = 0x8E22
-0x4C60 = 0x92BB
-0x4C61 = 0x63D0
-0x4C62 = 0x984C
-0x4C63 = 0x8E44
-0x4C64 = 0x557C
-0x4C65 = 0x9AD4
-0x4C66 = 0x66FF
-0x4C67 = 0x568F
-0x4C68 = 0x60D5
-0x4C69 = 0x6D95
-0x4C6A = 0x5243
-0x4C6B = 0x5C49
-0x4C6C = 0x5929
-0x4C6D = 0x6DFB
-0x4C6E = 0x586B
-0x4C6F = 0x7530
-0x4C70 = 0x751C
-0x4C71 = 0x606C
-0x4C72 = 0x8214
-0x4C73 = 0x8146
-0x4C74 = 0x6311
-0x4C75 = 0x689D
-0x4C76 = 0x8FE2
-0x4C77 = 0x773A
-0x4C78 = 0x8DF3
-0x4C79 = 0x8CBC
-0x4C7A = 0x9435
-0x4C7B = 0x5E16
-0x4C7C = 0x5EF3
-0x4C7D = 0x807D
-0x4C7E = 0x70F4
-0x4D21 = 0x6C40
-0x4D22 = 0x5EF7
-0x4D23 = 0x505C
-0x4D24 = 0x4EAD
-0x4D25 = 0x5EAD
-0x4D26 = 0x633A
-0x4D27 = 0x8247
-0x4D28 = 0x901A
-0x4D29 = 0x6850
-0x4D2A = 0x916E
-0x4D2B = 0x77B3
-0x4D2C = 0x540C
-0x4D2D = 0x9285
-0x4D2E = 0x5F64
-0x4D2F = 0x7AE5
-0x4D30 = 0x6876
-0x4D31 = 0x6345
-0x4D32 = 0x7B52
-0x4D33 = 0x7D71
-0x4D34 = 0x75DB
-0x4D35 = 0x5077
-0x4D36 = 0x6295
-0x4D37 = 0x982D
-0x4D38 = 0x900F
-0x4D39 = 0x51F8
-0x4D3A = 0x79C3
-0x4D3B = 0x7A81
-0x4D3C = 0x5716
-0x4D3D = 0x5F92
-0x4D3E = 0x9014
-0x4D3F = 0x5857
-0x4D40 = 0x5C60
-0x4D41 = 0x571F
-0x4D42 = 0x5410
-0x4D43 = 0x5154
-0x4D44 = 0x6E4D
-0x4D45 = 0x5718
-0x4D46 = 0x63A8
-0x4D47 = 0x983D
-0x4D48 = 0x817F
-0x4D49 = 0x8715
-0x4D4A = 0x892A
-0x4D4B = 0x9000
-0x4D4C = 0x541E
-0x4D4D = 0x5C6F
-0x4D4E = 0x81C0
-0x4D4F = 0x62D6
-0x4D50 = 0x6258
-0x4D51 = 0x8131
-0x4D52 = 0x9D15
-0x4D53 = 0x9640
-0x4D54 = 0x99B1
-0x4D55 = 0x99DD
-0x4D56 = 0x6A62
-0x4D57 = 0x59A5
-0x4D58 = 0x62D3
-0x4D59 = 0x553E
-0x4D5A = 0x6316
-0x4D5B = 0x54C7
-0x4D5C = 0x86D9
-0x4D5D = 0x7AAA
-0x4D5E = 0x5A03
-0x4D5F = 0x74E6
-0x4D60 = 0x896A
-0x4D61 = 0x6B6A
-0x4D62 = 0x5916
-0x4D63 = 0x8C4C
-0x4D64 = 0x5F4E
-0x4D65 = 0x7063
-0x4D66 = 0x73A9
-0x4D67 = 0x9811
-0x4D68 = 0x4E38
-0x4D69 = 0x70F7
-0x4D6A = 0x5B8C
-0x4D6B = 0x7897
-0x4D6C = 0x633D
-0x4D6D = 0x665A
-0x4D6E = 0x7696
-0x4D6F = 0x60CB
-0x4D70 = 0x5B9B
-0x4D71 = 0x5A49
-0x4D72 = 0x842C
-0x4D73 = 0x8155
-0x4D74 = 0x6C6A
-0x4D75 = 0x738B
-0x4D76 = 0x4EA1
-0x4D77 = 0x6789
-0x4D78 = 0x7DB2
-0x4D79 = 0x5F80
-0x4D7A = 0x65FA
-0x4D7B = 0x671B
-0x4D7C = 0x5FD8
-0x4D7D = 0x5984
-0x4D7E = 0x5A01
-0x4E21 = 0x5DCD
-0x4E22 = 0x5FAE
-0x4E23 = 0x5371
-0x4E24 = 0x97CB
-0x4E25 = 0x9055
-0x4E26 = 0x6845
-0x4E27 = 0x570D
-0x4E28 = 0x552F
-0x4E29 = 0x60DF
-0x4E2A = 0x7232
-0x4E2B = 0x6FF0
-0x4E2C = 0x7DAD
-0x4E2D = 0x8466
-0x4E2E = 0x840E
-0x4E2F = 0x59D4
-0x4E30 = 0x5049
-0x4E31 = 0x50DE
-0x4E32 = 0x5C3E
-0x4E33 = 0x7DEF
-0x4E34 = 0x672A
-0x4E35 = 0x851A
-0x4E36 = 0x5473
-0x4E37 = 0x754F
-0x4E38 = 0x80C3
-0x4E39 = 0x5582
-0x4E3A = 0x9B4F
-0x4E3B = 0x4F4D
-0x4E3C = 0x6E2D
-0x4E3D = 0x8B02
-0x4E3E = 0x5C09
-0x4E3F = 0x6170
-0x4E40 = 0x885B
-0x4E41 = 0x761F
-0x4E42 = 0x6E29
-0x4E43 = 0x868A
-0x4E44 = 0x6587
-0x4E45 = 0x805E
-0x4E46 = 0x7D0B
-0x4E47 = 0x543B
-0x4E48 = 0x7A69
-0x4E49 = 0x7D0A
-0x4E4A = 0x554F
-0x4E4B = 0x55E1
-0x4E4C = 0x7FC1
-0x4E4D = 0x74EE
-0x4E4E = 0x64BE
-0x4E4F = 0x8778
-0x4E50 = 0x6E26
-0x4E51 = 0x7AA9
-0x4E52 = 0x6211
-0x4E53 = 0x65A1
-0x4E54 = 0x5367
-0x4E55 = 0x63E1
-0x4E56 = 0x6C83
-0x4E57 = 0x5DEB
-0x4E58 = 0x55DA
-0x4E59 = 0x93A2
-0x4E5A = 0x70CF
-0x4E5B = 0x6C61
-0x4E5C = 0x8AA3
-0x4E5D = 0x5C4B
-0x4E5E = 0x7121
-0x4E5F = 0x856A
-0x4E60 = 0x68A7
-0x4E61 = 0x543E
-0x4E62 = 0x5434
-0x4E63 = 0x6BCB
-0x4E64 = 0x6B66
-0x4E65 = 0x4E94
-0x4E66 = 0x6342
-0x4E67 = 0x5348
-0x4E68 = 0x821E
-0x4E69 = 0x4F0D
-0x4E6A = 0x4FAE
-0x4E6B = 0x5862
-0x4E6C = 0x620A
-0x4E6D = 0x9727
-0x4E6E = 0x6664
-0x4E6F = 0x7269
-0x4E70 = 0x52FF
-0x4E71 = 0x52D9
-0x4E72 = 0x609F
-0x4E73 = 0x8AA4
-0x4E74 = 0x6614
-0x4E75 = 0x7199
-0x4E76 = 0x6790
-0x4E77 = 0x897F
-0x4E78 = 0x7852
-0x4E79 = 0x77FD
-0x4E7A = 0x6670
-0x4E7B = 0x563B
-0x4E7C = 0x5438
-0x4E7D = 0x932B
-0x4E7E = 0x72A7
-0x4F21 = 0x7A00
-0x4F22 = 0x606F
-0x4F23 = 0x5E0C
-0x4F24 = 0x6089
-0x4F25 = 0x819D
-0x4F26 = 0x5915
-0x4F27 = 0x60DC
-0x4F28 = 0x7184
-0x4F29 = 0x70EF
-0x4F2A = 0x6EAA
-0x4F2B = 0x6C50
-0x4F2C = 0x7280
-0x4F2D = 0x6A84
-0x4F2E = 0x8972
-0x4F2F = 0x5E2D
-0x4F30 = 0x7FD2
-0x4F31 = 0x5AB3
-0x4F32 = 0x559C
-0x4F33 = 0x9291
-0x4F34 = 0x6D17
-0x4F35 = 0x7CFB
-0x4F36 = 0x9699
-0x4F37 = 0x6232
-0x4F38 = 0x7D30
-0x4F39 = 0x778E
-0x4F3A = 0x8766
-0x4F3B = 0x5323
-0x4F3C = 0x971E
-0x4F3D = 0x8F44
-0x4F3E = 0x6687
-0x4F3F = 0x5CFD
-0x4F40 = 0x4FE0
-0x4F41 = 0x72F9
-0x4F42 = 0x4E0B
-0x4F43 = 0x53A6
-0x4F44 = 0x590F
-0x4F45 = 0x5687
-0x4F46 = 0x6380
-0x4F47 = 0x9341
-0x4F48 = 0x5148
-0x4F49 = 0x4ED9
-0x4F4A = 0x9BAE
-0x4F4B = 0x7E96
-0x4F4C = 0x54B8
-0x4F4D = 0x8CE2
-0x4F4E = 0x929C
-0x4F4F = 0x8237
-0x4F50 = 0x9591
-0x4F51 = 0x6D8E
-0x4F52 = 0x5F26
-0x4F53 = 0x5ACC
-0x4F54 = 0x986F
-0x4F55 = 0x96AA
-0x4F56 = 0x73FE
-0x4F57 = 0x737B
-0x4F58 = 0x7E23
-0x4F59 = 0x817A
-0x4F5A = 0x9921
-0x4F5B = 0x7FA1
-0x4F5C = 0x61B2
-0x4F5D = 0x9677
-0x4F5E = 0x9650
-0x4F5F = 0x7DAB
-0x4F60 = 0x76F8
-0x4F61 = 0x53A2
-0x4F62 = 0x9472
-0x4F63 = 0x9999
-0x4F64 = 0x7BB1
-0x4F65 = 0x8944
-0x4F66 = 0x6E58
-0x4F67 = 0x9109
-0x4F68 = 0x7FD4
-0x4F69 = 0x7965
-0x4F6A = 0x8A73
-0x4F6B = 0x60F3
-0x4F6C = 0x97FF
-0x4F6D = 0x4EAB
-0x4F6E = 0x9805
-0x4F6F = 0x5DF7
-0x4F70 = 0x6A61
-0x4F71 = 0x50CF
-0x4F72 = 0x5411
-0x4F73 = 0x8C61
-0x4F74 = 0x856D
-0x4F75 = 0x785D
-0x4F76 = 0x9704
-0x4F77 = 0x524A
-0x4F78 = 0x54EE
-0x4F79 = 0x56C2
-0x4F7A = 0x92B7
-0x4F7B = 0x6D88
-0x4F7C = 0x5BB5
-0x4F7D = 0x6DC6
-0x4F7E = 0x66C9
-0x5021 = 0x5C0F
-0x5022 = 0x5B5D
-0x5023 = 0x6821
-0x5024 = 0x8096
-0x5025 = 0x562F
-0x5026 = 0x7B11
-0x5027 = 0x6548
-0x5028 = 0x6954
-0x5029 = 0x4E9B
-0x502A = 0x6B47
-0x502B = 0x874E
-0x502C = 0x978B
-0x502D = 0x5354
-0x502E = 0x633E
-0x502F = 0x643A
-0x5030 = 0x90AA
-0x5031 = 0x659C
-0x5032 = 0x8105
-0x5033 = 0x8AE7
-0x5034 = 0x5BEB
-0x5035 = 0x68B0
-0x5036 = 0x5378
-0x5037 = 0x87F9
-0x5038 = 0x61C8
-0x5039 = 0x6CC4
-0x503A = 0x7009
-0x503B = 0x8B1D
-0x503C = 0x5C51
-0x503D = 0x85AA
-0x503E = 0x82AF
-0x503F = 0x92C5
-0x5040 = 0x6B23
-0x5041 = 0x8F9B
-0x5042 = 0x65B0
-0x5043 = 0x5FFB
-0x5044 = 0x5FC3
-0x5045 = 0x4FE1
-0x5046 = 0x91C1
-0x5047 = 0x661F
-0x5048 = 0x8165
-0x5049 = 0x7329
-0x504A = 0x60FA
-0x504B = 0x8208
-0x504C = 0x5211
-0x504D = 0x578B
-0x504E = 0x5F62
-0x504F = 0x90A2
-0x5050 = 0x884C
-0x5051 = 0x9192
-0x5052 = 0x5E78
-0x5053 = 0x674F
-0x5054 = 0x6027
-0x5055 = 0x59D3
-0x5056 = 0x5144
-0x5057 = 0x51F6
-0x5058 = 0x80F8
-0x5059 = 0x5308
-0x505A = 0x6C79
-0x505B = 0x96C4
-0x505C = 0x718A
-0x505D = 0x4F11
-0x505E = 0x4FEE
-0x505F = 0x7F9E
-0x5060 = 0x673D
-0x5061 = 0x55C5
-0x5062 = 0x92B9
-0x5063 = 0x79C0
-0x5064 = 0x8896
-0x5065 = 0x7D89
-0x5066 = 0x589F
-0x5067 = 0x620C
-0x5068 = 0x9700
-0x5069 = 0x865A
-0x506A = 0x5618
-0x506B = 0x9808
-0x506C = 0x5F90
-0x506D = 0x8A31
-0x506E = 0x84C4
-0x506F = 0x9157
-0x5070 = 0x53D9
-0x5071 = 0x65ED
-0x5072 = 0x5E8F
-0x5073 = 0x755C
-0x5074 = 0x6064
-0x5075 = 0x7D6E
-0x5076 = 0x5A7F
-0x5077 = 0x7DD2
-0x5078 = 0x7E8C
-0x5079 = 0x8ED2
-0x507A = 0x55A7
-0x507B = 0x5BA3
-0x507C = 0x61F8
-0x507D = 0x65CB
-0x507E = 0x7384
-0x5121 = 0x9078
-0x5122 = 0x766C
-0x5123 = 0x7729
-0x5124 = 0x7D62
-0x5125 = 0x9774
-0x5126 = 0x859B
-0x5127 = 0x5B78
-0x5128 = 0x7A74
-0x5129 = 0x96EA
-0x512A = 0x8840
-0x512B = 0x52DB
-0x512C = 0x718F
-0x512D = 0x5FAA
-0x512E = 0x65EC
-0x512F = 0x8A62
-0x5130 = 0x5C0B
-0x5131 = 0x99B4
-0x5132 = 0x5DE1
-0x5133 = 0x6B89
-0x5134 = 0x6C5B
-0x5135 = 0x8A13
-0x5136 = 0x8A0A
-0x5137 = 0x905C
-0x5138 = 0x8FC5
-0x5139 = 0x58D3
-0x513A = 0x62BC
-0x513B = 0x9D09
-0x513C = 0x9D28
-0x513D = 0x5440
-0x513E = 0x4E2B
-0x513F = 0x82BD
-0x5140 = 0x7259
-0x5141 = 0x869C
-0x5142 = 0x5D16
-0x5143 = 0x8859
-0x5144 = 0x6DAF
-0x5145 = 0x96C5
-0x5146 = 0x555E
-0x5147 = 0x4E9E
-0x5148 = 0x8A1D
-0x5149 = 0x7109
-0x514A = 0x54BD
-0x514B = 0x95B9
-0x514C = 0x70DF
-0x514D = 0x6DF9
-0x514E = 0x9E7D
-0x514F = 0x56B4
-0x5150 = 0x7814
-0x5151 = 0x8712
-0x5152 = 0x5CA9
-0x5153 = 0x5EF6
-0x5154 = 0x8A00
-0x5155 = 0x9854
-0x5156 = 0x95BB
-0x5157 = 0x708E
-0x5158 = 0x6CBF
-0x5159 = 0x5944
-0x515A = 0x63A9
-0x515B = 0x773C
-0x515C = 0x884D
-0x515D = 0x6F14
-0x515E = 0x8277
-0x515F = 0x5830
-0x5160 = 0x71D5
-0x5161 = 0x53AD
-0x5162 = 0x786F
-0x5163 = 0x96C1
-0x5164 = 0x5501
-0x5165 = 0x5F66
-0x5166 = 0x7130
-0x5167 = 0x5BB4
-0x5168 = 0x8AFA
-0x5169 = 0x9A57
-0x516A = 0x6B83
-0x516B = 0x592E
-0x516C = 0x9D26
-0x516D = 0x79E7
-0x516E = 0x694A
-0x516F = 0x63DA
-0x5170 = 0x4F6F
-0x5171 = 0x760D
-0x5172 = 0x7F8A
-0x5173 = 0x6D0B
-0x5174 = 0x967D
-0x5175 = 0x6C27
-0x5176 = 0x4EF0
-0x5177 = 0x7662
-0x5178 = 0x990A
-0x5179 = 0x6A23
-0x517A = 0x6F3E
-0x517B = 0x9080
-0x517C = 0x8170
-0x517D = 0x5996
-0x517E = 0x7476
-0x5221 = 0x6447
-0x5222 = 0x582F
-0x5223 = 0x9065
-0x5224 = 0x7A91
-0x5225 = 0x8B21
-0x5226 = 0x59DA
-0x5227 = 0x54AC
-0x5228 = 0x8200
-0x5229 = 0x85E5
-0x522A = 0x8981
-0x522B = 0x8000
-0x522C = 0x6930
-0x522D = 0x564E
-0x522E = 0x8036
-0x522F = 0x723A
-0x5230 = 0x91CE
-0x5231 = 0x51B6
-0x5232 = 0x4E5F
-0x5233 = 0x9801
-0x5234 = 0x6396
-0x5235 = 0x696D
-0x5236 = 0x8449
-0x5237 = 0x66F3
-0x5238 = 0x814B
-0x5239 = 0x591C
-0x523A = 0x6DB2
-0x523B = 0x4E00
-0x523C = 0x58F9
-0x523D = 0x91AB
-0x523E = 0x63D6
-0x523F = 0x92A5
-0x5240 = 0x4F9D
-0x5241 = 0x4F0A
-0x5242 = 0x8863
-0x5243 = 0x9824
-0x5244 = 0x5937
-0x5245 = 0x907A
-0x5246 = 0x79FB
-0x5247 = 0x5100
-0x5248 = 0x80F0
-0x5249 = 0x7591
-0x524A = 0x6C82
-0x524B = 0x5B9C
-0x524C = 0x59E8
-0x524D = 0x5F5D
-0x524E = 0x6905
-0x524F = 0x87FB
-0x5250 = 0x501A
-0x5251 = 0x5DF2
-0x5252 = 0x4E59
-0x5253 = 0x77E3
-0x5254 = 0x4EE5
-0x5255 = 0x85DD
-0x5256 = 0x6291
-0x5257 = 0x6613
-0x5258 = 0x9091
-0x5259 = 0x5C79
-0x525A = 0x5104
-0x525B = 0x5F79
-0x525C = 0x81C6
-0x525D = 0x9038
-0x525E = 0x8084
-0x525F = 0x75AB
-0x5260 = 0x4EA6
-0x5261 = 0x88D4
-0x5262 = 0x610F
-0x5263 = 0x6BC5
-0x5264 = 0x61B6
-0x5265 = 0x7FA9
-0x5266 = 0x76CA
-0x5267 = 0x6EA2
-0x5268 = 0x8A63
-0x5269 = 0x8B70
-0x526A = 0x8ABC
-0x526B = 0x8B6F
-0x526C = 0x5F02
-0x526D = 0x7FFC
-0x526E = 0x7FCC
-0x526F = 0x7E79
-0x5270 = 0x8335
-0x5271 = 0x852D
-0x5272 = 0x56E0
-0x5273 = 0x6BB7
-0x5274 = 0x97F3
-0x5275 = 0x9670
-0x5276 = 0x59FB
-0x5277 = 0x541F
-0x5278 = 0x9280
-0x5279 = 0x6DEB
-0x527A = 0x5BC5
-0x527B = 0x98F2
-0x527C = 0x5C39
-0x527D = 0x5F15
-0x527E = 0x96B1
-0x5321 = 0x5370
-0x5322 = 0x82F1
-0x5323 = 0x6AFB
-0x5324 = 0x5B30
-0x5325 = 0x9DF9
-0x5326 = 0x61C9
-0x5327 = 0x7E93
-0x5328 = 0x7469
-0x5329 = 0x87A2
-0x532A = 0x71DF
-0x532B = 0x7192
-0x532C = 0x8805
-0x532D = 0x8FCE
-0x532E = 0x8D0F
-0x532F = 0x76C8
-0x5330 = 0x5F71
-0x5331 = 0x7A4E
-0x5332 = 0x786C
-0x5333 = 0x6620
-0x5334 = 0x55B2
-0x5335 = 0x64C1
-0x5336 = 0x50AD
-0x5337 = 0x81C3
-0x5338 = 0x7670
-0x5339 = 0x5EB8
-0x533A = 0x96CD
-0x533B = 0x8E34
-0x533C = 0x86F9
-0x533D = 0x548F
-0x533E = 0x6CF3
-0x533F = 0x6D8C
-0x5340 = 0x6C38
-0x5341 = 0x607F
-0x5342 = 0x52C7
-0x5343 = 0x7528
-0x5344 = 0x5E7D
-0x5345 = 0x512A
-0x5346 = 0x60A0
-0x5347 = 0x6182
-0x5348 = 0x5C24
-0x5349 = 0x7531
-0x534A = 0x90F5
-0x534B = 0x923E
-0x534C = 0x7336
-0x534D = 0x6CB9
-0x534E = 0x6E38
-0x534F = 0x9149
-0x5350 = 0x6709
-0x5351 = 0x53CB
-0x5352 = 0x53F3
-0x5353 = 0x4F51
-0x5354 = 0x91C9
-0x5355 = 0x8A98
-0x5356 = 0x53C8
-0x5357 = 0x5E7C
-0x5358 = 0x8FC2
-0x5359 = 0x6DE4
-0x535A = 0x4E8E
-0x535B = 0x76C2
-0x535C = 0x6986
-0x535D = 0x865E
-0x535E = 0x611A
-0x535F = 0x8F3F
-0x5360 = 0x9918
-0x5361 = 0x4FDE
-0x5362 = 0x903E
-0x5363 = 0x9B5A
-0x5364 = 0x6109
-0x5365 = 0x6E1D
-0x5366 = 0x6F01
-0x5367 = 0x9685
-0x5368 = 0x4E88
-0x5369 = 0x5A31
-0x536A = 0x96E8
-0x536B = 0x8207
-0x536C = 0x5DBC
-0x536D = 0x79B9
-0x536E = 0x5B87
-0x536F = 0x8A9E
-0x5370 = 0x7FBD
-0x5371 = 0x7389
-0x5372 = 0x57DF
-0x5373 = 0x828B
-0x5374 = 0x9B31
-0x5375 = 0x5401
-0x5376 = 0x9047
-0x5377 = 0x55BB
-0x5378 = 0x5CEA
-0x5379 = 0x5FA1
-0x537A = 0x6108
-0x537B = 0x6B32
-0x537C = 0x7344
-0x537D = 0x80B2
-0x537E = 0x8B7D
-0x5421 = 0x6D74
-0x5422 = 0x5BD3
-0x5423 = 0x88D5
-0x5424 = 0x9810
-0x5425 = 0x8C6B
-0x5426 = 0x99AD
-0x5427 = 0x9D1B
-0x5428 = 0x6DF5
-0x5429 = 0x51A4
-0x542A = 0x5143
-0x542B = 0x57A3
-0x542C = 0x8881
-0x542D = 0x539F
-0x542E = 0x63F4
-0x542F = 0x8F45
-0x5430 = 0x5712
-0x5431 = 0x54E1
-0x5432 = 0x5713
-0x5433 = 0x733F
-0x5434 = 0x6E90
-0x5435 = 0x7DE3
-0x5436 = 0x9060
-0x5437 = 0x82D1
-0x5438 = 0x9858
-0x5439 = 0x6028
-0x543A = 0x9662
-0x543B = 0x66F0
-0x543C = 0x7D04
-0x543D = 0x8D8A
-0x543E = 0x8E8D
-0x543F = 0x9470
-0x5440 = 0x5CB3
-0x5441 = 0x7CA4
-0x5442 = 0x6708
-0x5443 = 0x60A6
-0x5444 = 0x95B2
-0x5445 = 0x8018
-0x5446 = 0x96F2
-0x5447 = 0x9116
-0x5448 = 0x5300
-0x5449 = 0x9695
-0x544A = 0x5141
-0x544B = 0x904B
-0x544C = 0x85F4
-0x544D = 0x9196
-0x544E = 0x6688
-0x544F = 0x97F5
-0x5450 = 0x5B55
-0x5451 = 0x531D
-0x5452 = 0x7838
-0x5453 = 0x96DC
-0x5454 = 0x683D
-0x5455 = 0x54C9
-0x5456 = 0x707E
-0x5457 = 0x5BB0
-0x5458 = 0x8F09
-0x5459 = 0x518D
-0x545A = 0x5728
-0x545B = 0x54B1
-0x545C = 0x6522
-0x545D = 0x66AB
-0x545E = 0x8D0A
-0x545F = 0x8D1C
-0x5460 = 0x81DF
-0x5461 = 0x846C
-0x5462 = 0x906D
-0x5463 = 0x7CDF
-0x5464 = 0x947F
-0x5465 = 0x85FB
-0x5466 = 0x68D7
-0x5467 = 0x65E9
-0x5468 = 0x6FA1
-0x5469 = 0x86A4
-0x546A = 0x8E81
-0x546B = 0x566A
-0x546C = 0x9020
-0x546D = 0x7682
-0x546E = 0x7AC8
-0x546F = 0x71E5
-0x5470 = 0x8CAC
-0x5471 = 0x64C7
-0x5472 = 0x5247
-0x5473 = 0x6FA4
-0x5474 = 0x8CCA
-0x5475 = 0x600E
-0x5476 = 0x589E
-0x5477 = 0x618E
-0x5478 = 0x66FE
-0x5479 = 0x8D08
-0x547A = 0x624E
-0x547B = 0x55B3
-0x547C = 0x6E23
-0x547D = 0x672D
-0x547E = 0x8ECB
-0x5521 = 0x9358
-0x5522 = 0x9598
-0x5523 = 0x7728
-0x5524 = 0x6805
-0x5525 = 0x69A8
-0x5526 = 0x548B
-0x5527 = 0x4E4D
-0x5528 = 0x70B8
-0x5529 = 0x8A50
-0x552A = 0x6458
-0x552B = 0x9F4B
-0x552C = 0x5B85
-0x552D = 0x7A84
-0x552E = 0x50B5
-0x552F = 0x5BE8
-0x5530 = 0x77BB
-0x5531 = 0x6C08
-0x5532 = 0x8A79
-0x5533 = 0x7C98
-0x5534 = 0x6CBE
-0x5535 = 0x76DE
-0x5536 = 0x65AC
-0x5537 = 0x8F3E
-0x5538 = 0x5D84
-0x5539 = 0x5C55
-0x553A = 0x8638
-0x553B = 0x68E7
-0x553C = 0x5360
-0x553D = 0x6230
-0x553E = 0x7AD9
-0x553F = 0x6E5B
-0x5540 = 0x7DBB
-0x5541 = 0x6A1F
-0x5542 = 0x7AE0
-0x5543 = 0x5F70
-0x5544 = 0x6F33
-0x5545 = 0x5F35
-0x5546 = 0x638C
-0x5547 = 0x6F32
-0x5548 = 0x6756
-0x5549 = 0x4E08
-0x554A = 0x5E33
-0x554B = 0x8CEC
-0x554C = 0x4ED7
-0x554D = 0x8139
-0x554E = 0x7634
-0x554F = 0x969C
-0x5550 = 0x62DB
-0x5551 = 0x662D
-0x5552 = 0x627E
-0x5553 = 0x6CBC
-0x5554 = 0x8D99
-0x5555 = 0x7167
-0x5556 = 0x7F69
-0x5557 = 0x5146
-0x5558 = 0x8087
-0x5559 = 0x53EC
-0x555A = 0x906E
-0x555B = 0x6298
-0x555C = 0x54F2
-0x555D = 0x87C4
-0x555E = 0x8F4D
-0x555F = 0x8005
-0x5560 = 0x937A
-0x5561 = 0x8517
-0x5562 = 0x9019
-0x5563 = 0x6D59
-0x5564 = 0x73CD
-0x5565 = 0x659F
-0x5566 = 0x771F
-0x5567 = 0x7504
-0x5568 = 0x7827
-0x5569 = 0x81FB
-0x556A = 0x8C9E
-0x556B = 0x91DD
-0x556C = 0x5075
-0x556D = 0x6795
-0x556E = 0x75B9
-0x556F = 0x8A3A
-0x5570 = 0x9707
-0x5571 = 0x632F
-0x5572 = 0x93AE
-0x5573 = 0x9663
-0x5574 = 0x84B8
-0x5575 = 0x6399
-0x5576 = 0x775C
-0x5577 = 0x5F81
-0x5578 = 0x7319
-0x5579 = 0x722D
-0x557A = 0x6014
-0x557B = 0x6574
-0x557C = 0x62EF
-0x557D = 0x6B63
-0x557E = 0x653F
-0x5621 = 0x5E40
-0x5622 = 0x7665
-0x5623 = 0x912D
-0x5624 = 0x8B49
-0x5625 = 0x829D
-0x5626 = 0x679D
-0x5627 = 0x652F
-0x5628 = 0x5431
-0x5629 = 0x8718
-0x562A = 0x77E5
-0x562B = 0x80A2
-0x562C = 0x8102
-0x562D = 0x6C41
-0x562E = 0x4E4B
-0x562F = 0x7E54
-0x5630 = 0x8077
-0x5631 = 0x76F4
-0x5632 = 0x690D
-0x5633 = 0x6B96
-0x5634 = 0x57F7
-0x5635 = 0x503C
-0x5636 = 0x4F84
-0x5637 = 0x5740
-0x5638 = 0x6307
-0x5639 = 0x6B62
-0x563A = 0x8DBE
-0x563B = 0x8879
-0x563C = 0x65E8
-0x563D = 0x7D19
-0x563E = 0x5FD7
-0x563F = 0x646F
-0x5640 = 0x64F2
-0x5641 = 0x81F3
-0x5642 = 0x81F4
-0x5643 = 0x7F6E
-0x5644 = 0x5E5F
-0x5645 = 0x5CD9
-0x5646 = 0x5236
-0x5647 = 0x667A
-0x5648 = 0x79E9
-0x5649 = 0x7A1A
-0x564A = 0x8CEA
-0x564B = 0x7099
-0x564C = 0x75D4
-0x564D = 0x6EEF
-0x564E = 0x6CBB
-0x564F = 0x7A92
-0x5650 = 0x4E2D
-0x5651 = 0x76C5
-0x5652 = 0x5FE0
-0x5653 = 0x9418
-0x5654 = 0x8877
-0x5655 = 0x7D42
-0x5656 = 0x7A2E
-0x5657 = 0x816B
-0x5658 = 0x91CD
-0x5659 = 0x4EF2
-0x565A = 0x8846
-0x565B = 0x821F
-0x565C = 0x5468
-0x565D = 0x5DDE
-0x565E = 0x6D32
-0x565F = 0x8B05
-0x5660 = 0x7CA5
-0x5661 = 0x8EF8
-0x5662 = 0x8098
-0x5663 = 0x5E1A
-0x5664 = 0x5492
-0x5665 = 0x76BA
-0x5666 = 0x5B99
-0x5667 = 0x665D
-0x5668 = 0x9A5F
-0x5669 = 0x73E0
-0x566A = 0x682A
-0x566B = 0x86DB
-0x566C = 0x6731
-0x566D = 0x732A
-0x566E = 0x8AF8
-0x566F = 0x8A85
-0x5670 = 0x9010
-0x5671 = 0x7AF9
-0x5672 = 0x71ED
-0x5673 = 0x716E
-0x5674 = 0x62C4
-0x5675 = 0x77DA
-0x5676 = 0x56D1
-0x5677 = 0x4E3B
-0x5678 = 0x8457
-0x5679 = 0x67F1
-0x567A = 0x52A9
-0x567B = 0x86C0
-0x567C = 0x8CAF
-0x567D = 0x9444
-0x567E = 0x7BC9
-0x5721 = 0x4F4F
-0x5722 = 0x6CE8
-0x5723 = 0x795D
-0x5724 = 0x99D0
-0x5725 = 0x6293
-0x5726 = 0x722A
-0x5727 = 0x62FD
-0x5728 = 0x5C08
-0x5729 = 0x78DA
-0x572A = 0x8F49
-0x572B = 0x64B0
-0x572C = 0x8CFA
-0x572D = 0x7BC6
-0x572E = 0x6A01
-0x572F = 0x838A
-0x5730 = 0x88DD
-0x5731 = 0x599D
-0x5732 = 0x649E
-0x5733 = 0x58EF
-0x5734 = 0x72C0
-0x5735 = 0x690E
-0x5736 = 0x9310
-0x5737 = 0x8FFD
-0x5738 = 0x8D05
-0x5739 = 0x589C
-0x573A = 0x7DB4
-0x573B = 0x8AC4
-0x573C = 0x6E96
-0x573D = 0x6349
-0x573E = 0x62D9
-0x573F = 0x5353
-0x5740 = 0x684C
-0x5741 = 0x7422
-0x5742 = 0x8301
-0x5743 = 0x914C
-0x5744 = 0x5544
-0x5745 = 0x7740
-0x5746 = 0x707C
-0x5747 = 0x6FC1
-0x5748 = 0x5179
-0x5749 = 0x54A8
-0x574A = 0x8CC7
-0x574B = 0x59FF
-0x574C = 0x6ECB
-0x574D = 0x6DC4
-0x574E = 0x5B5C
-0x574F = 0x7D2B
-0x5750 = 0x4ED4
-0x5751 = 0x7C7D
-0x5752 = 0x6ED3
-0x5753 = 0x5B50
-0x5754 = 0x81EA
-0x5755 = 0x6F2C
-0x5756 = 0x5B57
-0x5757 = 0x9B03
-0x5758 = 0x68D5
-0x5759 = 0x8E2A
-0x575A = 0x5B97
-0x575B = 0x7D9C
-0x575C = 0x7E3D
-0x575D = 0x7E31
-0x575E = 0x9112
-0x575F = 0x8D70
-0x5760 = 0x594F
-0x5761 = 0x63CD
-0x5762 = 0x79DF
-0x5763 = 0x8DB3
-0x5764 = 0x5352
-0x5765 = 0x65CF
-0x5766 = 0x7956
-0x5767 = 0x8A5B
-0x5768 = 0x963B
-0x5769 = 0x7D44
-0x576A = 0x947D
-0x576B = 0x7E82
-0x576C = 0x5634
-0x576D = 0x9189
-0x576E = 0x6700
-0x576F = 0x7F6A
-0x5770 = 0x5C0A
-0x5771 = 0x9075
-0x5772 = 0x6628
-0x5773 = 0x5DE6
-0x5774 = 0x4F50
-0x5775 = 0x67DE
-0x5776 = 0x505A
-0x5777 = 0x4F5C
-0x5778 = 0x5750
-0x5779 = 0x5EA7
-0x5821 = 0x4E8D
-0x5822 = 0x4E0C
-0x5823 = 0x5140
-0x5824 = 0x4E10
-0x5825 = 0x5EFF
-0x5826 = 0x5345
-0x5827 = 0x4E15
-0x5828 = 0x4E98
-0x5829 = 0x4E1E
-0x582A = 0x9B32
-0x582B = 0x5B6C
-0x582C = 0x5669
-0x582D = 0x4E28
-0x582E = 0x79BA
-0x582F = 0x4E3F
-0x5830 = 0x5315
-0x5831 = 0x4E47
-0x5832 = 0x592D
-0x5833 = 0x723B
-0x5834 = 0x536E
-0x5835 = 0x6C10
-0x5836 = 0x56DF
-0x5837 = 0x80E4
-0x5838 = 0x9997
-0x5839 = 0x6BD3
-0x583A = 0x777E
-0x583B = 0x9F17
-0x583C = 0x4E36
-0x583D = 0x4E9F
-0x583E = 0x9F10
-0x583F = 0x4E5C
-0x5840 = 0x4E69
-0x5841 = 0x4E93
-0x5842 = 0x8288
-0x5843 = 0x5B5B
-0x5844 = 0x55C7
-0x5845 = 0x560F
-0x5846 = 0x4EC4
-0x5847 = 0x5399
-0x5848 = 0x539D
-0x5849 = 0x53B4
-0x584A = 0x53A5
-0x584B = 0x53AE
-0x584C = 0x9768
-0x584D = 0x8D0B
-0x584E = 0x531A
-0x584F = 0x53F5
-0x5850 = 0x532D
-0x5851 = 0x5331
-0x5852 = 0x533E
-0x5853 = 0x8CFE
-0x5854 = 0x5366
-0x5855 = 0x5363
-0x5856 = 0x5202
-0x5857 = 0x5208
-0x5858 = 0x520E
-0x5859 = 0x5244
-0x585A = 0x5233
-0x585B = 0x528C
-0x585C = 0x5274
-0x585D = 0x524C
-0x585E = 0x525E
-0x585F = 0x5261
-0x5860 = 0x525C
-0x5861 = 0x84AF
-0x5862 = 0x527D
-0x5863 = 0x5282
-0x5864 = 0x5281
-0x5865 = 0x5290
-0x5866 = 0x5293
-0x5867 = 0x5182
-0x5868 = 0x7F54
-0x5869 = 0x4EBB
-0x586A = 0x4EC3
-0x586B = 0x4EC9
-0x586C = 0x4EC2
-0x586D = 0x4EE8
-0x586E = 0x4EE1
-0x586F = 0x4EEB
-0x5870 = 0x4EDE
-0x5871 = 0x50B4
-0x5872 = 0x4EF3
-0x5873 = 0x4F22
-0x5874 = 0x4F64
-0x5875 = 0x4EF5
-0x5876 = 0x5000
-0x5877 = 0x5096
-0x5878 = 0x4F09
-0x5879 = 0x4F47
-0x587A = 0x4F5E
-0x587B = 0x4F67
-0x587C = 0x6538
-0x587D = 0x4F5A
-0x587E = 0x4F5D
-0x5921 = 0x4F5F
-0x5922 = 0x4F57
-0x5923 = 0x4F32
-0x5924 = 0x4F3D
-0x5925 = 0x4F76
-0x5926 = 0x4F74
-0x5927 = 0x4F91
-0x5928 = 0x4F89
-0x5929 = 0x4F83
-0x592A = 0x4F8F
-0x592B = 0x4F7E
-0x592C = 0x4F7B
-0x592D = 0x5115
-0x592E = 0x4F7C
-0x592F = 0x5102
-0x5930 = 0x4F94
-0x5931 = 0x5114
-0x5932 = 0x513C
-0x5933 = 0x5137
-0x5934 = 0x4FC5
-0x5935 = 0x4FDA
-0x5936 = 0x4FE3
-0x5937 = 0x4FDC
-0x5938 = 0x4FD1
-0x5939 = 0x4FDF
-0x593A = 0x4FF8
-0x593B = 0x5029
-0x593C = 0x504C
-0x593D = 0x4FF3
-0x593E = 0x502C
-0x593F = 0x500F
-0x5940 = 0x502E
-0x5941 = 0x502D
-0x5942 = 0x4FFE
-0x5943 = 0x501C
-0x5944 = 0x500C
-0x5945 = 0x5025
-0x5946 = 0x5028
-0x5947 = 0x50E8
-0x5948 = 0x5043
-0x5949 = 0x5055
-0x594A = 0x5048
-0x594B = 0x504E
-0x594C = 0x506C
-0x594D = 0x50C2
-0x594E = 0x513B
-0x594F = 0x5110
-0x5950 = 0x513A
-0x5951 = 0x50BA
-0x5952 = 0x50D6
-0x5953 = 0x5106
-0x5954 = 0x50ED
-0x5955 = 0x50EC
-0x5956 = 0x50E6
-0x5957 = 0x50EE
-0x5958 = 0x5107
-0x5959 = 0x510B
-0x595A = 0x4EDD
-0x595B = 0x6C3D
-0x595C = 0x4F58
-0x595D = 0x50C9
-0x595E = 0x4FCE
-0x595F = 0x9FA0
-0x5960 = 0x6C46
-0x5961 = 0x7CF4
-0x5962 = 0x516E
-0x5963 = 0x5DFD
-0x5964 = 0x9ECC
-0x5965 = 0x9998
-0x5966 = 0x56C5
-0x5967 = 0x5914
-0x5968 = 0x52F9
-0x5969 = 0x530D
-0x596A = 0x8A07
-0x596B = 0x5310
-0x596C = 0x9CEC
-0x596D = 0x5919
-0x596E = 0x5155
-0x596F = 0x4EA0
-0x5970 = 0x5156
-0x5971 = 0x4EB3
-0x5972 = 0x886E
-0x5973 = 0x88A4
-0x5974 = 0x893B
-0x5975 = 0x81E0
-0x5976 = 0x88D2
-0x5977 = 0x7980
-0x5978 = 0x5B34
-0x5979 = 0x8803
-0x597A = 0x7FB8
-0x597B = 0x51AB
-0x597C = 0x51B1
-0x597D = 0x51BD
-0x597E = 0x51BC
-0x5A21 = 0x51C7
-0x5A22 = 0x5196
-0x5A23 = 0x51A2
-0x5A24 = 0x51A5
-0x5A25 = 0x8A01
-0x5A26 = 0x8A10
-0x5A27 = 0x8A0C
-0x5A28 = 0x8A15
-0x5A29 = 0x8B33
-0x5A2A = 0x8A4E
-0x5A2B = 0x8A25
-0x5A2C = 0x8A41
-0x5A2D = 0x8A36
-0x5A2E = 0x8A46
-0x5A2F = 0x8A54
-0x5A30 = 0x8A58
-0x5A31 = 0x8A52
-0x5A32 = 0x8A86
-0x5A33 = 0x8A84
-0x5A34 = 0x8A7F
-0x5A35 = 0x8A70
-0x5A36 = 0x8A7C
-0x5A37 = 0x8A75
-0x5A38 = 0x8A6C
-0x5A39 = 0x8A6E
-0x5A3A = 0x8ACD
-0x5A3B = 0x8AE2
-0x5A3C = 0x8A61
-0x5A3D = 0x8A9A
-0x5A3E = 0x8AA5
-0x5A3F = 0x8A91
-0x5A40 = 0x8A92
-0x5A41 = 0x8ACF
-0x5A42 = 0x8AD1
-0x5A43 = 0x8AC9
-0x5A44 = 0x8ADB
-0x5A45 = 0x8AD7
-0x5A46 = 0x8AC2
-0x5A47 = 0x8AB6
-0x5A48 = 0x8AF6
-0x5A49 = 0x8AEB
-0x5A4A = 0x8B14
-0x5A4B = 0x8B01
-0x5A4C = 0x8AE4
-0x5A4D = 0x8AED
-0x5A4E = 0x8AFC
-0x5A4F = 0x8AF3
-0x5A50 = 0x8AE6
-0x5A51 = 0x8AEE
-0x5A52 = 0x8ADE
-0x5A53 = 0x8B28
-0x5A54 = 0x8B9C
-0x5A55 = 0x8B16
-0x5A56 = 0x8B1A
-0x5A57 = 0x8B10
-0x5A58 = 0x8B2B
-0x5A59 = 0x8B2D
-0x5A5A = 0x8B56
-0x5A5B = 0x8B59
-0x5A5C = 0x8B4E
-0x5A5D = 0x8B9E
-0x5A5E = 0x8B6B
-0x5A5F = 0x8B96
-0x5A60 = 0x5369
-0x5A61 = 0x537A
-0x5A62 = 0x961D
-0x5A63 = 0x9622
-0x5A64 = 0x9621
-0x5A65 = 0x9631
-0x5A66 = 0x962A
-0x5A67 = 0x963D
-0x5A68 = 0x963C
-0x5A69 = 0x9642
-0x5A6A = 0x9658
-0x5A6B = 0x9654
-0x5A6C = 0x965F
-0x5A6D = 0x9689
-0x5A6E = 0x966C
-0x5A6F = 0x9672
-0x5A70 = 0x9674
-0x5A71 = 0x9688
-0x5A72 = 0x968D
-0x5A73 = 0x9697
-0x5A74 = 0x96B0
-0x5A75 = 0x9097
-0x5A76 = 0x909B
-0x5A77 = 0x913A
-0x5A78 = 0x9099
-0x5A79 = 0x9114
-0x5A7A = 0x90A1
-0x5A7B = 0x90B4
-0x5A7C = 0x90B3
-0x5A7D = 0x90B6
-0x5A7E = 0x9134
-0x5B21 = 0x90B8
-0x5B22 = 0x90B0
-0x5B23 = 0x90DF
-0x5B24 = 0x90C5
-0x5B25 = 0x90BE
-0x5B26 = 0x9136
-0x5B27 = 0x90C4
-0x5B28 = 0x90C7
-0x5B29 = 0x9106
-0x5B2A = 0x9148
-0x5B2B = 0x90E2
-0x5B2C = 0x90DC
-0x5B2D = 0x90D7
-0x5B2E = 0x90DB
-0x5B2F = 0x90EB
-0x5B30 = 0x90EF
-0x5B31 = 0x90FE
-0x5B32 = 0x9104
-0x5B33 = 0x9122
-0x5B34 = 0x911E
-0x5B35 = 0x9123
-0x5B36 = 0x9131
-0x5B37 = 0x912F
-0x5B38 = 0x9139
-0x5B39 = 0x9143
-0x5B3A = 0x9146
-0x5B3B = 0x82BB
-0x5B3C = 0x5950
-0x5B3D = 0x52F1
-0x5B3E = 0x52AC
-0x5B3F = 0x52AD
-0x5B40 = 0x52BE
-0x5B41 = 0x54FF
-0x5B42 = 0x52D0
-0x5B43 = 0x52D6
-0x5B44 = 0x52F0
-0x5B45 = 0x53DF
-0x5B46 = 0x71EE
-0x5B47 = 0x77CD
-0x5B48 = 0x5EF4
-0x5B49 = 0x51F5
-0x5B4A = 0x51FC
-0x5B4B = 0x9B2F
-0x5B4C = 0x53B6
-0x5B4D = 0x5F01
-0x5B4E = 0x755A
-0x5B4F = 0x5DF0
-0x5B50 = 0x574C
-0x5B51 = 0x580A
-0x5B52 = 0x57A1
-0x5B53 = 0x587E
-0x5B54 = 0x58BC
-0x5B55 = 0x58C5
-0x5B56 = 0x58D1
-0x5B57 = 0x5729
-0x5B58 = 0x572C
-0x5B59 = 0x572A
-0x5B5A = 0x5733
-0x5B5B = 0x58D9
-0x5B5C = 0x572E
-0x5B5D = 0x572F
-0x5B5E = 0x58E2
-0x5B5F = 0x573B
-0x5B60 = 0x5742
-0x5B61 = 0x5769
-0x5B62 = 0x58E0
-0x5B63 = 0x576B
-0x5B64 = 0x58DA
-0x5B65 = 0x577C
-0x5B66 = 0x577B
-0x5B67 = 0x5768
-0x5B68 = 0x576D
-0x5B69 = 0x5776
-0x5B6A = 0x5773
-0x5B6B = 0x57E1
-0x5B6C = 0x57A4
-0x5B6D = 0x578C
-0x5B6E = 0x584F
-0x5B6F = 0x57CF
-0x5B70 = 0x57A7
-0x5B71 = 0x5816
-0x5B72 = 0x5793
-0x5B73 = 0x57A0
-0x5B74 = 0x57D5
-0x5B75 = 0x5852
-0x5B76 = 0x581D
-0x5B77 = 0x5864
-0x5B78 = 0x57D2
-0x5B79 = 0x57B8
-0x5B7A = 0x57F4
-0x5B7B = 0x57EF
-0x5B7C = 0x57F8
-0x5B7D = 0x57E4
-0x5B7E = 0x57DD
-0x5C21 = 0x580B
-0x5C22 = 0x580D
-0x5C23 = 0x57FD
-0x5C24 = 0x57ED
-0x5C25 = 0x5800
-0x5C26 = 0x581E
-0x5C27 = 0x5819
-0x5C28 = 0x5844
-0x5C29 = 0x5820
-0x5C2A = 0x5865
-0x5C2B = 0x586C
-0x5C2C = 0x5881
-0x5C2D = 0x5889
-0x5C2E = 0x589A
-0x5C2F = 0x5880
-0x5C30 = 0x99A8
-0x5C31 = 0x9F19
-0x5C32 = 0x61FF
-0x5C33 = 0x8279
-0x5C34 = 0x827D
-0x5C35 = 0x827F
-0x5C36 = 0x828F
-0x5C37 = 0x828A
-0x5C38 = 0x82A8
-0x5C39 = 0x8284
-0x5C3A = 0x828E
-0x5C3B = 0x8291
-0x5C3C = 0x858C
-0x5C3D = 0x8299
-0x5C3E = 0x82AB
-0x5C3F = 0x8553
-0x5C40 = 0x82BE
-0x5C41 = 0x82B0
-0x5C42 = 0x85F6
-0x5C43 = 0x82CA
-0x5C44 = 0x82E3
-0x5C45 = 0x8298
-0x5C46 = 0x82B7
-0x5C47 = 0x82AE
-0x5C48 = 0x83A7
-0x5C49 = 0x8407
-0x5C4A = 0x84EF
-0x5C4B = 0x82A9
-0x5C4C = 0x82B4
-0x5C4D = 0x82A1
-0x5C4E = 0x82AA
-0x5C4F = 0x829F
-0x5C50 = 0x82C4
-0x5C51 = 0x82E7
-0x5C52 = 0x82A4
-0x5C53 = 0x82E1
-0x5C54 = 0x8309
-0x5C55 = 0x82F7
-0x5C56 = 0x82E4
-0x5C57 = 0x8622
-0x5C58 = 0x8307
-0x5C59 = 0x82DC
-0x5C5A = 0x82F4
-0x5C5B = 0x82D2
-0x5C5C = 0x82D8
-0x5C5D = 0x830C
-0x5C5E = 0x82FB
-0x5C5F = 0x82D3
-0x5C60 = 0x8526
-0x5C61 = 0x831A
-0x5C62 = 0x8306
-0x5C63 = 0x584B
-0x5C64 = 0x7162
-0x5C65 = 0x82E0
-0x5C66 = 0x82D5
-0x5C67 = 0x831C
-0x5C68 = 0x8351
-0x5C69 = 0x8558
-0x5C6A = 0x84FD
-0x5C6B = 0x8308
-0x5C6C = 0x8392
-0x5C6D = 0x833C
-0x5C6E = 0x8334
-0x5C6F = 0x8331
-0x5C70 = 0x839B
-0x5C71 = 0x854E
-0x5C72 = 0x832F
-0x5C73 = 0x834F
-0x5C74 = 0x8347
-0x5C75 = 0x8343
-0x5C76 = 0x8588
-0x5C77 = 0x8340
-0x5C78 = 0x8317
-0x5C79 = 0x85BA
-0x5C7A = 0x832D
-0x5C7B = 0x833A
-0x5C7C = 0x8333
-0x5C7D = 0x7296
-0x5C7E = 0x6ECE
-0x5D21 = 0x8541
-0x5D22 = 0x831B
-0x5D23 = 0x85CE
-0x5D24 = 0x8552
-0x5D25 = 0x84C0
-0x5D26 = 0x8452
-0x5D27 = 0x8464
-0x5D28 = 0x83B0
-0x5D29 = 0x8378
-0x5D2A = 0x8494
-0x5D2B = 0x8435
-0x5D2C = 0x83A0
-0x5D2D = 0x83AA
-0x5D2E = 0x8393
-0x5D2F = 0x839C
-0x5D30 = 0x8385
-0x5D31 = 0x837C
-0x5D32 = 0x859F
-0x5D33 = 0x83A9
-0x5D34 = 0x837D
-0x5D35 = 0x8555
-0x5D36 = 0x837B
-0x5D37 = 0x8398
-0x5D38 = 0x839E
-0x5D39 = 0x83A8
-0x5D3A = 0x9DAF
-0x5D3B = 0x8493
-0x5D3C = 0x83C1
-0x5D3D = 0x8401
-0x5D3E = 0x83E5
-0x5D3F = 0x83D8
-0x5D40 = 0x5807
-0x5D41 = 0x8418
-0x5D42 = 0x840B
-0x5D43 = 0x83DD
-0x5D44 = 0x83FD
-0x5D45 = 0x83D6
-0x5D46 = 0x841C
-0x5D47 = 0x8438
-0x5D48 = 0x8411
-0x5D49 = 0x8406
-0x5D4A = 0x83D4
-0x5D4B = 0x83DF
-0x5D4C = 0x840F
-0x5D4D = 0x8403
-0x5D4E = 0x83F8
-0x5D4F = 0x83F9
-0x5D50 = 0x83EA
-0x5D51 = 0x83C5
-0x5D52 = 0x83C0
-0x5D53 = 0x7E08
-0x5D54 = 0x83F0
-0x5D55 = 0x83E1
-0x5D56 = 0x845C
-0x5D57 = 0x8451
-0x5D58 = 0x845A
-0x5D59 = 0x8459
-0x5D5A = 0x8473
-0x5D5B = 0x8546
-0x5D5C = 0x8488
-0x5D5D = 0x847A
-0x5D5E = 0x8562
-0x5D5F = 0x8478
-0x5D60 = 0x843C
-0x5D61 = 0x8446
-0x5D62 = 0x8469
-0x5D63 = 0x8476
-0x5D64 = 0x851E
-0x5D65 = 0x848E
-0x5D66 = 0x8431
-0x5D67 = 0x846D
-0x5D68 = 0x84C1
-0x5D69 = 0x84CD
-0x5D6A = 0x84D0
-0x5D6B = 0x9A40
-0x5D6C = 0x84BD
-0x5D6D = 0x84D3
-0x5D6E = 0x84CA
-0x5D6F = 0x84BF
-0x5D70 = 0x84BA
-0x5D71 = 0x863A
-0x5D72 = 0x84A1
-0x5D73 = 0x84B9
-0x5D74 = 0x84B4
-0x5D75 = 0x8497
-0x5D76 = 0x93A3
-0x5D77 = 0x8577
-0x5D78 = 0x850C
-0x5D79 = 0x750D
-0x5D7A = 0x8538
-0x5D7B = 0x84F0
-0x5D7C = 0x861E
-0x5D7D = 0x851F
-0x5D7E = 0x85FA
-0x5E21 = 0x8556
-0x5E22 = 0x853B
-0x5E23 = 0x84FF
-0x5E24 = 0x84FC
-0x5E25 = 0x8559
-0x5E26 = 0x8548
-0x5E27 = 0x8568
-0x5E28 = 0x8564
-0x5E29 = 0x855E
-0x5E2A = 0x857A
-0x5E2B = 0x77A2
-0x5E2C = 0x8543
-0x5E2D = 0x8604
-0x5E2E = 0x857B
-0x5E2F = 0x85A4
-0x5E30 = 0x85A8
-0x5E31 = 0x8587
-0x5E32 = 0x858F
-0x5E33 = 0x8579
-0x5E34 = 0x85EA
-0x5E35 = 0x859C
-0x5E36 = 0x8585
-0x5E37 = 0x85B9
-0x5E38 = 0x85B7
-0x5E39 = 0x85B0
-0x5E3A = 0x861A
-0x5E3B = 0x85C1
-0x5E3C = 0x85DC
-0x5E3D = 0x85FF
-0x5E3E = 0x8627
-0x5E3F = 0x8605
-0x5E40 = 0x8629
-0x5E41 = 0x8616
-0x5E42 = 0x863C
-0x5E43 = 0x5EFE
-0x5E44 = 0x5F08
-0x5E45 = 0x593C
-0x5E46 = 0x5969
-0x5E47 = 0x8037
-0x5E48 = 0x5955
-0x5E49 = 0x595A
-0x5E4A = 0x5958
-0x5E4B = 0x530F
-0x5E4C = 0x5C22
-0x5E4D = 0x5C25
-0x5E4E = 0x5C2C
-0x5E4F = 0x5C37
-0x5E50 = 0x624C
-0x5E51 = 0x636B
-0x5E52 = 0x6476
-0x5E53 = 0x62BB
-0x5E54 = 0x62CA
-0x5E55 = 0x62DA
-0x5E56 = 0x62D7
-0x5E57 = 0x62EE
-0x5E58 = 0x649F
-0x5E59 = 0x62F6
-0x5E5A = 0x6339
-0x5E5B = 0x634B
-0x5E5C = 0x6343
-0x5E5D = 0x63AD
-0x5E5E = 0x63F6
-0x5E5F = 0x6371
-0x5E60 = 0x637A
-0x5E61 = 0x638E
-0x5E62 = 0x6451
-0x5E63 = 0x636D
-0x5E64 = 0x63AC
-0x5E65 = 0x638A
-0x5E66 = 0x6369
-0x5E67 = 0x63AE
-0x5E68 = 0x645C
-0x5E69 = 0x63F2
-0x5E6A = 0x63F8
-0x5E6B = 0x63E0
-0x5E6C = 0x64B3
-0x5E6D = 0x63C4
-0x5E6E = 0x63DE
-0x5E6F = 0x63CE
-0x5E70 = 0x6452
-0x5E71 = 0x63C6
-0x5E72 = 0x63BE
-0x5E73 = 0x6504
-0x5E74 = 0x6441
-0x5E75 = 0x640B
-0x5E76 = 0x641B
-0x5E77 = 0x6420
-0x5E78 = 0x640C
-0x5E79 = 0x6426
-0x5E7A = 0x6421
-0x5E7B = 0x645E
-0x5E7C = 0x6516
-0x5E7D = 0x646D
-0x5E7E = 0x6496
-0x5F21 = 0x647A
-0x5F22 = 0x64F7
-0x5F23 = 0x64FC
-0x5F24 = 0x6499
-0x5F25 = 0x651B
-0x5F26 = 0x64C0
-0x5F27 = 0x64D0
-0x5F28 = 0x64D7
-0x5F29 = 0x64E4
-0x5F2A = 0x64E2
-0x5F2B = 0x6509
-0x5F2C = 0x6525
-0x5F2D = 0x652E
-0x5F2E = 0x5F0B
-0x5F2F = 0x5FD2
-0x5F30 = 0x7519
-0x5F31 = 0x5F11
-0x5F32 = 0x535F
-0x5F33 = 0x53F1
-0x5F34 = 0x5630
-0x5F35 = 0x53E9
-0x5F36 = 0x53E8
-0x5F37 = 0x53FB
-0x5F38 = 0x5412
-0x5F39 = 0x5416
-0x5F3A = 0x5406
-0x5F3B = 0x544B
-0x5F3C = 0x5638
-0x5F3D = 0x56C8
-0x5F3E = 0x5454
-0x5F3F = 0x56A6
-0x5F40 = 0x5443
-0x5F41 = 0x5421
-0x5F42 = 0x5504
-0x5F43 = 0x54BC
-0x5F44 = 0x5423
-0x5F45 = 0x5432
-0x5F46 = 0x5482
-0x5F47 = 0x5494
-0x5F48 = 0x5477
-0x5F49 = 0x5471
-0x5F4A = 0x5464
-0x5F4B = 0x549A
-0x5F4C = 0x5680
-0x5F4D = 0x5484
-0x5F4E = 0x5476
-0x5F4F = 0x5466
-0x5F50 = 0x565D
-0x5F51 = 0x54D0
-0x5F52 = 0x54AD
-0x5F53 = 0x54C2
-0x5F54 = 0x54B4
-0x5F55 = 0x5660
-0x5F56 = 0x54A7
-0x5F57 = 0x54A6
-0x5F58 = 0x5635
-0x5F59 = 0x55F6
-0x5F5A = 0x5472
-0x5F5B = 0x54A3
-0x5F5C = 0x5666
-0x5F5D = 0x54BB
-0x5F5E = 0x54BF
-0x5F5F = 0x54CC
-0x5F60 = 0x5672
-0x5F61 = 0x54DA
-0x5F62 = 0x568C
-0x5F63 = 0x54A9
-0x5F64 = 0x54AA
-0x5F65 = 0x54A4
-0x5F66 = 0x5665
-0x5F67 = 0x54CF
-0x5F68 = 0x54DE
-0x5F69 = 0x561C
-0x5F6A = 0x54E7
-0x5F6B = 0x562E
-0x5F6C = 0x54FD
-0x5F6D = 0x5514
-0x5F6E = 0x54F3
-0x5F6F = 0x55E9
-0x5F70 = 0x5523
-0x5F71 = 0x550F
-0x5F72 = 0x5511
-0x5F73 = 0x5527
-0x5F74 = 0x552A
-0x5F75 = 0x5616
-0x5F76 = 0x558F
-0x5F77 = 0x55B5
-0x5F78 = 0x5549
-0x5F79 = 0x56C0
-0x5F7A = 0x5541
-0x5F7B = 0x5555
-0x5F7C = 0x553F
-0x5F7D = 0x5550
-0x5F7E = 0x553C
-0x6021 = 0x5537
-0x6022 = 0x5556
-0x6023 = 0x5575
-0x6024 = 0x5576
-0x6025 = 0x5577
-0x6026 = 0x5533
-0x6027 = 0x5530
-0x6028 = 0x555C
-0x6029 = 0x558B
-0x602A = 0x55D2
-0x602B = 0x5583
-0x602C = 0x55B1
-0x602D = 0x55B9
-0x602E = 0x5588
-0x602F = 0x5581
-0x6030 = 0x559F
-0x6031 = 0x557E
-0x6032 = 0x55D6
-0x6033 = 0x5591
-0x6034 = 0x557B
-0x6035 = 0x55DF
-0x6036 = 0x560D
-0x6037 = 0x56B3
-0x6038 = 0x5594
-0x6039 = 0x5599
-0x603A = 0x55EA
-0x603B = 0x55F7
-0x603C = 0x55C9
-0x603D = 0x561F
-0x603E = 0x55D1
-0x603F = 0x56C1
-0x6040 = 0x55EC
-0x6041 = 0x55D4
-0x6042 = 0x55E6
-0x6043 = 0x55DD
-0x6044 = 0x55C4
-0x6045 = 0x55EF
-0x6046 = 0x55E5
-0x6047 = 0x55F2
-0x6048 = 0x566F
-0x6049 = 0x55CC
-0x604A = 0x55CD
-0x604B = 0x55E8
-0x604C = 0x55F5
-0x604D = 0x55E4
-0x604E = 0x8F61
-0x604F = 0x561E
-0x6050 = 0x5608
-0x6051 = 0x560C
-0x6052 = 0x5601
-0x6053 = 0x56B6
-0x6054 = 0x5623
-0x6055 = 0x55FE
-0x6056 = 0x5600
-0x6057 = 0x5627
-0x6058 = 0x562D
-0x6059 = 0x5658
-0x605A = 0x5639
-0x605B = 0x5657
-0x605C = 0x562C
-0x605D = 0x564D
-0x605E = 0x5662
-0x605F = 0x5659
-0x6060 = 0x5695
-0x6061 = 0x564C
-0x6062 = 0x5654
-0x6063 = 0x5686
-0x6064 = 0x5664
-0x6065 = 0x5671
-0x6066 = 0x566B
-0x6067 = 0x567B
-0x6068 = 0x567C
-0x6069 = 0x5685
-0x606A = 0x5693
-0x606B = 0x56AF
-0x606C = 0x56D4
-0x606D = 0x56D7
-0x606E = 0x56DD
-0x606F = 0x56E1
-0x6070 = 0x5707
-0x6071 = 0x56EB
-0x6072 = 0x56F9
-0x6073 = 0x56FF
-0x6074 = 0x5704
-0x6075 = 0x570A
-0x6076 = 0x5709
-0x6077 = 0x571C
-0x6078 = 0x5E43
-0x6079 = 0x5E19
-0x607A = 0x5E14
-0x607B = 0x5E11
-0x607C = 0x5E6C
-0x607D = 0x5E58
-0x607E = 0x5E57
-0x6121 = 0x5E37
-0x6122 = 0x5E44
-0x6123 = 0x5E54
-0x6124 = 0x5E5B
-0x6125 = 0x5E5E
-0x6126 = 0x5E61
-0x6127 = 0x5C8C
-0x6128 = 0x5C7A
-0x6129 = 0x5C8D
-0x612A = 0x5C90
-0x612B = 0x5D87
-0x612C = 0x5C88
-0x612D = 0x5CF4
-0x612E = 0x5C99
-0x612F = 0x5C91
-0x6130 = 0x5D50
-0x6131 = 0x5C9C
-0x6132 = 0x5CB5
-0x6133 = 0x5CA2
-0x6134 = 0x5D2C
-0x6135 = 0x5CAC
-0x6136 = 0x5CAB
-0x6137 = 0x5CB1
-0x6138 = 0x5CA3
-0x6139 = 0x5CC1
-0x613A = 0x5CB7
-0x613B = 0x5DA7
-0x613C = 0x5CD2
-0x613D = 0x5DA0
-0x613E = 0x5CCB
-0x613F = 0x5D22
-0x6140 = 0x5D97
-0x6141 = 0x5D0D
-0x6142 = 0x5D27
-0x6143 = 0x5D26
-0x6144 = 0x5D2E
-0x6145 = 0x5D24
-0x6146 = 0x5D1E
-0x6147 = 0x5D06
-0x6148 = 0x5D1B
-0x6149 = 0x5DB8
-0x614A = 0x5D3E
-0x614B = 0x5D34
-0x614C = 0x5D3D
-0x614D = 0x5D6C
-0x614E = 0x5D5B
-0x614F = 0x5D6F
-0x6150 = 0x5D81
-0x6151 = 0x5D6B
-0x6152 = 0x5D4B
-0x6153 = 0x5D4A
-0x6154 = 0x5D69
-0x6155 = 0x5D74
-0x6156 = 0x5D82
-0x6157 = 0x5D99
-0x6158 = 0x5D9D
-0x6159 = 0x8C73
-0x615A = 0x5DB7
-0x615B = 0x5DD4
-0x615C = 0x5F73
-0x615D = 0x5F77
-0x615E = 0x5F82
-0x615F = 0x5F87
-0x6160 = 0x5F89
-0x6161 = 0x540E
-0x6162 = 0x5FA0
-0x6163 = 0x5F99
-0x6164 = 0x5F9C
-0x6165 = 0x5FA8
-0x6166 = 0x5FAD
-0x6167 = 0x5FB5
-0x6168 = 0x5FBC
-0x6169 = 0x8862
-0x616A = 0x5F61
-0x616B = 0x72AD
-0x616C = 0x72B0
-0x616D = 0x72B4
-0x616E = 0x7377
-0x616F = 0x7341
-0x6170 = 0x72C3
-0x6171 = 0x72C1
-0x6172 = 0x72CE
-0x6173 = 0x72CD
-0x6174 = 0x72D2
-0x6175 = 0x72E8
-0x6176 = 0x736A
-0x6177 = 0x72E9
-0x6178 = 0x733B
-0x6179 = 0x72F4
-0x617A = 0x72F7
-0x617B = 0x7301
-0x617C = 0x72F3
-0x617D = 0x736B
-0x617E = 0x72FA
-0x6221 = 0x72FB
-0x6222 = 0x7317
-0x6223 = 0x7313
-0x6224 = 0x7380
-0x6225 = 0x730A
-0x6226 = 0x731E
-0x6227 = 0x731D
-0x6228 = 0x737C
-0x6229 = 0x7322
-0x622A = 0x7339
-0x622B = 0x7325
-0x622C = 0x732C
-0x622D = 0x7338
-0x622E = 0x7331
-0x622F = 0x7350
-0x6230 = 0x734D
-0x6231 = 0x7357
-0x6232 = 0x7360
-0x6233 = 0x736C
-0x6234 = 0x736F
-0x6235 = 0x737E
-0x6236 = 0x821B
-0x6237 = 0x5925
-0x6238 = 0x98E7
-0x6239 = 0x5924
-0x623A = 0x5902
-0x623B = 0x98E0
-0x623C = 0x9933
-0x623D = 0x98E9
-0x623E = 0x993C
-0x623F = 0x98EA
-0x6240 = 0x98EB
-0x6241 = 0x98ED
-0x6242 = 0x98F4
-0x6243 = 0x9909
-0x6244 = 0x9911
-0x6245 = 0x4F59
-0x6246 = 0x991B
-0x6247 = 0x9937
-0x6248 = 0x993F
-0x6249 = 0x9943
-0x624A = 0x9948
-0x624B = 0x9949
-0x624C = 0x994A
-0x624D = 0x994C
-0x624E = 0x9962
-0x624F = 0x5E80
-0x6250 = 0x5EE1
-0x6251 = 0x5E8B
-0x6252 = 0x5E96
-0x6253 = 0x5EA5
-0x6254 = 0x5EA0
-0x6255 = 0x5EB9
-0x6256 = 0x5EB5
-0x6257 = 0x5EBE
-0x6258 = 0x5EB3
-0x6259 = 0x8CE1
-0x625A = 0x5ED2
-0x625B = 0x5ED1
-0x625C = 0x5EDB
-0x625D = 0x5EE8
-0x625E = 0x5EEA
-0x625F = 0x81BA
-0x6260 = 0x5FC4
-0x6261 = 0x5FC9
-0x6262 = 0x5FD6
-0x6263 = 0x61FA
-0x6264 = 0x61AE
-0x6265 = 0x5FEE
-0x6266 = 0x616A
-0x6267 = 0x5FE1
-0x6268 = 0x5FE4
-0x6269 = 0x613E
-0x626A = 0x60B5
-0x626B = 0x6134
-0x626C = 0x5FEA
-0x626D = 0x5FED
-0x626E = 0x5FF8
-0x626F = 0x6019
-0x6270 = 0x6035
-0x6271 = 0x6026
-0x6272 = 0x601B
-0x6273 = 0x600F
-0x6274 = 0x600D
-0x6275 = 0x6029
-0x6276 = 0x602B
-0x6277 = 0x600A
-0x6278 = 0x61CC
-0x6279 = 0x6021
-0x627A = 0x615F
-0x627B = 0x61E8
-0x627C = 0x60FB
-0x627D = 0x6137
-0x627E = 0x6042
-0x6321 = 0x606A
-0x6322 = 0x60F2
-0x6323 = 0x6096
-0x6324 = 0x609A
-0x6325 = 0x6173
-0x6326 = 0x609D
-0x6327 = 0x6083
-0x6328 = 0x6092
-0x6329 = 0x608C
-0x632A = 0x609B
-0x632B = 0x611C
-0x632C = 0x60BB
-0x632D = 0x60B1
-0x632E = 0x60DD
-0x632F = 0x60D8
-0x6330 = 0x60C6
-0x6331 = 0x60DA
-0x6332 = 0x60B4
-0x6333 = 0x6120
-0x6334 = 0x6192
-0x6335 = 0x6115
-0x6336 = 0x6123
-0x6337 = 0x60F4
-0x6338 = 0x6100
-0x6339 = 0x610E
-0x633A = 0x612B
-0x633B = 0x614A
-0x633C = 0x6175
-0x633D = 0x61AC
-0x633E = 0x6194
-0x633F = 0x61A7
-0x6340 = 0x61B7
-0x6341 = 0x61D4
-0x6342 = 0x61F5
-0x6343 = 0x5FDD
-0x6344 = 0x96B3
-0x6345 = 0x9582
-0x6346 = 0x9586
-0x6347 = 0x95C8
-0x6348 = 0x958E
-0x6349 = 0x9594
-0x634A = 0x958C
-0x634B = 0x95E5
-0x634C = 0x95AD
-0x634D = 0x95AB
-0x634E = 0x9B2E
-0x634F = 0x95AC
-0x6350 = 0x95BE
-0x6351 = 0x95B6
-0x6352 = 0x9B29
-0x6353 = 0x95BF
-0x6354 = 0x95BD
-0x6355 = 0x95BC
-0x6356 = 0x95C3
-0x6357 = 0x95CB
-0x6358 = 0x95D4
-0x6359 = 0x95D0
-0x635A = 0x95D5
-0x635B = 0x95DE
-0x635C = 0x4E2C
-0x635D = 0x723F
-0x635E = 0x6215
-0x635F = 0x6C35
-0x6360 = 0x6C54
-0x6361 = 0x6C5C
-0x6362 = 0x6C4A
-0x6363 = 0x7043
-0x6364 = 0x6C85
-0x6365 = 0x6C90
-0x6366 = 0x6C94
-0x6367 = 0x6C8C
-0x6368 = 0x6C68
-0x6369 = 0x6C69
-0x636A = 0x6C74
-0x636B = 0x6C76
-0x636C = 0x6C86
-0x636D = 0x6F59
-0x636E = 0x6CD0
-0x636F = 0x6CD4
-0x6370 = 0x6CAD
-0x6371 = 0x7027
-0x6372 = 0x7018
-0x6373 = 0x6CF1
-0x6374 = 0x6CD7
-0x6375 = 0x6CB2
-0x6376 = 0x6CE0
-0x6377 = 0x6CD6
-0x6378 = 0x6FFC
-0x6379 = 0x6CEB
-0x637A = 0x6CEE
-0x637B = 0x6CB1
-0x637C = 0x6CD3
-0x637D = 0x6CEF
-0x637E = 0x6D87
-0x6421 = 0x6D39
-0x6422 = 0x6D27
-0x6423 = 0x6D0C
-0x6424 = 0x6D79
-0x6425 = 0x6E5E
-0x6426 = 0x6D07
-0x6427 = 0x6D04
-0x6428 = 0x6D19
-0x6429 = 0x6D0E
-0x642A = 0x6D2B
-0x642B = 0x6FAE
-0x642C = 0x6D2E
-0x642D = 0x6D35
-0x642E = 0x6D1A
-0x642F = 0x700F
-0x6430 = 0x6EF8
-0x6431 = 0x6F6F
-0x6432 = 0x6D33
-0x6433 = 0x6D91
-0x6434 = 0x6D6F
-0x6435 = 0x6DF6
-0x6436 = 0x6F7F
-0x6437 = 0x6D5E
-0x6438 = 0x6D93
-0x6439 = 0x6D94
-0x643A = 0x6D5C
-0x643B = 0x6D60
-0x643C = 0x6D7C
-0x643D = 0x6D63
-0x643E = 0x6E1A
-0x643F = 0x6DC7
-0x6440 = 0x6DC5
-0x6441 = 0x6DDE
-0x6442 = 0x7006
-0x6443 = 0x6DBF
-0x6444 = 0x6DE0
-0x6445 = 0x6FA0
-0x6446 = 0x6DE6
-0x6447 = 0x6DDD
-0x6448 = 0x6DD9
-0x6449 = 0x700B
-0x644A = 0x6DAB
-0x644B = 0x6E0C
-0x644C = 0x6DAE
-0x644D = 0x6E2B
-0x644E = 0x6E6E
-0x644F = 0x6E4E
-0x6450 = 0x6E6B
-0x6451 = 0x6EB2
-0x6452 = 0x6E5F
-0x6453 = 0x6E86
-0x6454 = 0x6E53
-0x6455 = 0x6E54
-0x6456 = 0x6E32
-0x6457 = 0x6E25
-0x6458 = 0x6E44
-0x6459 = 0x7067
-0x645A = 0x6EB1
-0x645B = 0x6E98
-0x645C = 0x7044
-0x645D = 0x6F2D
-0x645E = 0x7005
-0x645F = 0x6EA5
-0x6460 = 0x6EA7
-0x6461 = 0x6EBD
-0x6462 = 0x6EBB
-0x6463 = 0x6EB7
-0x6464 = 0x6F77
-0x6465 = 0x6EB4
-0x6466 = 0x6ECF
-0x6467 = 0x6E8F
-0x6468 = 0x6EC2
-0x6469 = 0x6E9F
-0x646A = 0x6F62
-0x646B = 0x7020
-0x646C = 0x701F
-0x646D = 0x6F24
-0x646E = 0x6F15
-0x646F = 0x6EF9
-0x6470 = 0x6F2F
-0x6471 = 0x6F36
-0x6472 = 0x7032
-0x6473 = 0x6F74
-0x6474 = 0x6F2A
-0x6475 = 0x6F09
-0x6476 = 0x6F29
-0x6477 = 0x6F89
-0x6478 = 0x6F8D
-0x6479 = 0x6F8C
-0x647A = 0x6F78
-0x647B = 0x6F72
-0x647C = 0x6F7C
-0x647D = 0x6F7A
-0x647E = 0x7028
-0x6521 = 0x6FC9
-0x6522 = 0x6FA7
-0x6523 = 0x6FB9
-0x6524 = 0x6FB6
-0x6525 = 0x6FC2
-0x6526 = 0x6FE1
-0x6527 = 0x6FEE
-0x6528 = 0x6FDE
-0x6529 = 0x6FE0
-0x652A = 0x6FEF
-0x652B = 0x701A
-0x652C = 0x7023
-0x652D = 0x701B
-0x652E = 0x7039
-0x652F = 0x7035
-0x6530 = 0x705D
-0x6531 = 0x705E
-0x6532 = 0x5B80
-0x6533 = 0x5B84
-0x6534 = 0x5B95
-0x6535 = 0x5B93
-0x6536 = 0x5BA5
-0x6537 = 0x5BB8
-0x6538 = 0x752F
-0x6539 = 0x9A2B
-0x653A = 0x6434
-0x653B = 0x5BE4
-0x653C = 0x5BEE
-0x653D = 0x8930
-0x653E = 0x5BF0
-0x653F = 0x8E47
-0x6540 = 0x8B07
-0x6541 = 0x8FB6
-0x6542 = 0x8FD3
-0x6543 = 0x8FD5
-0x6544 = 0x8FE5
-0x6545 = 0x8FEE
-0x6546 = 0x8FE4
-0x6547 = 0x9087
-0x6548 = 0x8FE6
-0x6549 = 0x9015
-0x654A = 0x8FE8
-0x654B = 0x9005
-0x654C = 0x9004
-0x654D = 0x900B
-0x654E = 0x9090
-0x654F = 0x9011
-0x6550 = 0x900D
-0x6551 = 0x9016
-0x6552 = 0x9021
-0x6553 = 0x9035
-0x6554 = 0x9036
-0x6555 = 0x902D
-0x6556 = 0x902F
-0x6557 = 0x9044
-0x6558 = 0x9051
-0x6559 = 0x9052
-0x655A = 0x9050
-0x655B = 0x9068
-0x655C = 0x9058
-0x655D = 0x9062
-0x655E = 0x905B
-0x655F = 0x66B9
-0x6560 = 0x9074
-0x6561 = 0x907D
-0x6562 = 0x9082
-0x6563 = 0x9088
-0x6564 = 0x9083
-0x6565 = 0x908B
-0x6566 = 0x5F50
-0x6567 = 0x5F57
-0x6568 = 0x5F56
-0x6569 = 0x5F58
-0x656A = 0x5C3B
-0x656B = 0x54AB
-0x656C = 0x5C50
-0x656D = 0x5C59
-0x656E = 0x5B71
-0x656F = 0x5C63
-0x6570 = 0x5C68
-0x6571 = 0x7FBC
-0x6572 = 0x5F33
-0x6573 = 0x5F29
-0x6574 = 0x5F2D
-0x6575 = 0x8274
-0x6576 = 0x5F3C
-0x6577 = 0x9B3B
-0x6578 = 0x5C6E
-0x6579 = 0x5981
-0x657A = 0x5983
-0x657B = 0x598D
-0x657C = 0x5AF5
-0x657D = 0x5AD7
-0x657E = 0x59A3
-0x6621 = 0x5997
-0x6622 = 0x59CA
-0x6623 = 0x5B00
-0x6624 = 0x599E
-0x6625 = 0x59A4
-0x6626 = 0x59D2
-0x6627 = 0x59B2
-0x6628 = 0x59AF
-0x6629 = 0x59D7
-0x662A = 0x59BE
-0x662B = 0x5A6D
-0x662C = 0x5B08
-0x662D = 0x59DD
-0x662E = 0x5B4C
-0x662F = 0x59E3
-0x6630 = 0x59D8
-0x6631 = 0x59F9
-0x6632 = 0x5A0C
-0x6633 = 0x5A09
-0x6634 = 0x5AA7
-0x6635 = 0x5AFB
-0x6636 = 0x5A11
-0x6637 = 0x5A23
-0x6638 = 0x5A13
-0x6639 = 0x5A40
-0x663A = 0x5A67
-0x663B = 0x5A4A
-0x663C = 0x5A55
-0x663D = 0x5A3C
-0x663E = 0x5A62
-0x663F = 0x5B0B
-0x6640 = 0x80EC
-0x6641 = 0x5AAA
-0x6642 = 0x5A9B
-0x6643 = 0x5A77
-0x6644 = 0x5A7A
-0x6645 = 0x5ABE
-0x6646 = 0x5AEB
-0x6647 = 0x5AB2
-0x6648 = 0x5B21
-0x6649 = 0x5B2A
-0x664A = 0x5AB8
-0x664B = 0x5AE0
-0x664C = 0x5AE3
-0x664D = 0x5B19
-0x664E = 0x5AD6
-0x664F = 0x5AE6
-0x6650 = 0x5AD8
-0x6651 = 0x5ADC
-0x6652 = 0x5B09
-0x6653 = 0x5B17
-0x6654 = 0x5B16
-0x6655 = 0x5B32
-0x6656 = 0x5B37
-0x6657 = 0x5B40
-0x6658 = 0x5C15
-0x6659 = 0x5C1C
-0x665A = 0x5B5A
-0x665B = 0x5B65
-0x665C = 0x5B73
-0x665D = 0x5B51
-0x665E = 0x5B53
-0x665F = 0x5B62
-0x6660 = 0x99D4
-0x6661 = 0x99DF
-0x6662 = 0x99D9
-0x6663 = 0x9A36
-0x6664 = 0x9A5B
-0x6665 = 0x99D1
-0x6666 = 0x99D8
-0x6667 = 0x9A4D
-0x6668 = 0x9A4A
-0x6669 = 0x99E2
-0x666A = 0x9A6A
-0x666B = 0x9A0F
-0x666C = 0x9A0D
-0x666D = 0x9A05
-0x666E = 0x9A42
-0x666F = 0x9A2D
-0x6670 = 0x9A16
-0x6671 = 0x9A41
-0x6672 = 0x9A2E
-0x6673 = 0x9A38
-0x6674 = 0x9A43
-0x6675 = 0x9A44
-0x6676 = 0x9A4F
-0x6677 = 0x9A65
-0x6678 = 0x9A64
-0x6679 = 0x7CF9
-0x667A = 0x7D06
-0x667B = 0x7D02
-0x667C = 0x7D07
-0x667D = 0x7D08
-0x667E = 0x7E8A
-0x6721 = 0x7D1C
-0x6722 = 0x7D15
-0x6723 = 0x7D13
-0x6724 = 0x7D3A
-0x6725 = 0x7D32
-0x6726 = 0x7D31
-0x6727 = 0x7E10
-0x6728 = 0x7D3C
-0x6729 = 0x7D40
-0x672A = 0x7D3F
-0x672B = 0x7D5D
-0x672C = 0x7D4E
-0x672D = 0x7D73
-0x672E = 0x7D86
-0x672F = 0x7D83
-0x6730 = 0x7D88
-0x6731 = 0x7DBE
-0x6732 = 0x7DBA
-0x6733 = 0x7DCB
-0x6734 = 0x7DD4
-0x6735 = 0x7DC4
-0x6736 = 0x7D9E
-0x6737 = 0x7DAC
-0x6738 = 0x7DB9
-0x6739 = 0x7DA3
-0x673A = 0x7DB0
-0x673B = 0x7DC7
-0x673C = 0x7DD9
-0x673D = 0x7DD7
-0x673E = 0x7DF9
-0x673F = 0x7DF2
-0x6740 = 0x7E62
-0x6741 = 0x7DE6
-0x6742 = 0x7DF6
-0x6743 = 0x7DF1
-0x6744 = 0x7E0B
-0x6745 = 0x7DE1
-0x6746 = 0x7E09
-0x6747 = 0x7E1D
-0x6748 = 0x7E1F
-0x6749 = 0x7E1E
-0x674A = 0x7E2D
-0x674B = 0x7E0A
-0x674C = 0x7E11
-0x674D = 0x7E7D
-0x674E = 0x7E39
-0x674F = 0x7E35
-0x6750 = 0x7E32
-0x6751 = 0x7E46
-0x6752 = 0x7E45
-0x6753 = 0x7E88
-0x6754 = 0x7E5A
-0x6755 = 0x7E52
-0x6756 = 0x7E6E
-0x6757 = 0x7E7E
-0x6758 = 0x7E70
-0x6759 = 0x7E6F
-0x675A = 0x7E98
-0x675B = 0x5E7A
-0x675C = 0x757F
-0x675D = 0x5DDB
-0x675E = 0x753E
-0x675F = 0x9095
-0x6760 = 0x738E
-0x6761 = 0x74A3
-0x6762 = 0x744B
-0x6763 = 0x73A2
-0x6764 = 0x739F
-0x6765 = 0x73CF
-0x6766 = 0x73C2
-0x6767 = 0x74CF
-0x6768 = 0x73B7
-0x6769 = 0x73B3
-0x676A = 0x73C0
-0x676B = 0x73C9
-0x676C = 0x73C8
-0x676D = 0x73E5
-0x676E = 0x73D9
-0x676F = 0x980A
-0x6770 = 0x740A
-0x6771 = 0x73E9
-0x6772 = 0x73E7
-0x6773 = 0x73DE
-0x6774 = 0x74BD
-0x6775 = 0x743F
-0x6776 = 0x7489
-0x6777 = 0x742A
-0x6778 = 0x745B
-0x6779 = 0x7426
-0x677A = 0x7425
-0x677B = 0x7428
-0x677C = 0x7430
-0x677D = 0x742E
-0x677E = 0x742C
-0x6821 = 0x741B
-0x6822 = 0x741A
-0x6823 = 0x7441
-0x6824 = 0x745C
-0x6825 = 0x7457
-0x6826 = 0x7455
-0x6827 = 0x7459
-0x6828 = 0x74A6
-0x6829 = 0x746D
-0x682A = 0x747E
-0x682B = 0x749C
-0x682C = 0x74D4
-0x682D = 0x7480
-0x682E = 0x7481
-0x682F = 0x7487
-0x6830 = 0x748B
-0x6831 = 0x749E
-0x6832 = 0x74A8
-0x6833 = 0x74A9
-0x6834 = 0x7490
-0x6835 = 0x74A7
-0x6836 = 0x74DA
-0x6837 = 0x74BA
-0x6838 = 0x97D9
-0x6839 = 0x97DE
-0x683A = 0x97DC
-0x683B = 0x674C
-0x683C = 0x6753
-0x683D = 0x675E
-0x683E = 0x6748
-0x683F = 0x69AA
-0x6840 = 0x6AEA
-0x6841 = 0x6787
-0x6842 = 0x676A
-0x6843 = 0x6773
-0x6844 = 0x6798
-0x6845 = 0x6898
-0x6846 = 0x6775
-0x6847 = 0x68D6
-0x6848 = 0x6A05
-0x6849 = 0x689F
-0x684A = 0x678B
-0x684B = 0x6777
-0x684C = 0x677C
-0x684D = 0x67F0
-0x684E = 0x6ADB
-0x684F = 0x67D8
-0x6850 = 0x6AF3
-0x6851 = 0x67E9
-0x6852 = 0x67B0
-0x6853 = 0x6AE8
-0x6854 = 0x67D9
-0x6855 = 0x67B5
-0x6856 = 0x67DA
-0x6857 = 0x67B3
-0x6858 = 0x67DD
-0x6859 = 0x6800
-0x685A = 0x67C3
-0x685B = 0x67B8
-0x685C = 0x67E2
-0x685D = 0x6ADF
-0x685E = 0x67C1
-0x685F = 0x6A89
-0x6860 = 0x6832
-0x6861 = 0x6833
-0x6862 = 0x690F
-0x6863 = 0x6A48
-0x6864 = 0x684E
-0x6865 = 0x6968
-0x6866 = 0x6844
-0x6867 = 0x69BF
-0x6868 = 0x6883
-0x6869 = 0x681D
-0x686A = 0x6855
-0x686B = 0x6A3A
-0x686C = 0x6841
-0x686D = 0x6A9C
-0x686E = 0x6840
-0x686F = 0x6B12
-0x6870 = 0x684A
-0x6871 = 0x6849
-0x6872 = 0x6829
-0x6873 = 0x68B5
-0x6874 = 0x688F
-0x6875 = 0x6874
-0x6876 = 0x6877
-0x6877 = 0x6893
-0x6878 = 0x686B
-0x6879 = 0x6B1E
-0x687A = 0x696E
-0x687B = 0x68FC
-0x687C = 0x6ADD
-0x687D = 0x69E7
-0x687E = 0x68F9
-0x6921 = 0x6B0F
-0x6922 = 0x68F0
-0x6923 = 0x690B
-0x6924 = 0x6901
-0x6925 = 0x6957
-0x6926 = 0x68E3
-0x6927 = 0x6910
-0x6928 = 0x6971
-0x6929 = 0x6939
-0x692A = 0x6960
-0x692B = 0x6942
-0x692C = 0x695D
-0x692D = 0x6B16
-0x692E = 0x696B
-0x692F = 0x6980
-0x6930 = 0x6998
-0x6931 = 0x6978
-0x6932 = 0x6934
-0x6933 = 0x69CC
-0x6934 = 0x6AEC
-0x6935 = 0x6ADA
-0x6936 = 0x69CE
-0x6937 = 0x6AF8
-0x6938 = 0x6966
-0x6939 = 0x6963
-0x693A = 0x6979
-0x693B = 0x699B
-0x693C = 0x69A7
-0x693D = 0x69BB
-0x693E = 0x69AB
-0x693F = 0x69AD
-0x6940 = 0x69D4
-0x6941 = 0x69B1
-0x6942 = 0x69C1
-0x6943 = 0x69CA
-0x6944 = 0x6AB3
-0x6945 = 0x6995
-0x6946 = 0x6AE7
-0x6947 = 0x698D
-0x6948 = 0x69FF
-0x6949 = 0x6AA3
-0x694A = 0x69ED
-0x694B = 0x6A17
-0x694C = 0x6A18
-0x694D = 0x6A65
-0x694E = 0x69F2
-0x694F = 0x6A44
-0x6950 = 0x6A3E
-0x6951 = 0x6AA0
-0x6952 = 0x6A50
-0x6953 = 0x6A5B
-0x6954 = 0x6A35
-0x6955 = 0x6A8E
-0x6956 = 0x6AD3
-0x6957 = 0x6A3D
-0x6958 = 0x6A28
-0x6959 = 0x6A58
-0x695A = 0x6ADE
-0x695B = 0x6A91
-0x695C = 0x6A90
-0x695D = 0x6AA9
-0x695E = 0x6A97
-0x695F = 0x6AAB
-0x6960 = 0x7337
-0x6961 = 0x7352
-0x6962 = 0x6B81
-0x6963 = 0x6B82
-0x6964 = 0x6BA4
-0x6965 = 0x6B84
-0x6966 = 0x6B9E
-0x6967 = 0x6BAE
-0x6968 = 0x6B8D
-0x6969 = 0x6BAB
-0x696A = 0x6B9B
-0x696B = 0x6BAF
-0x696C = 0x6BAA
-0x696D = 0x8ED4
-0x696E = 0x8EDB
-0x696F = 0x8EF2
-0x6970 = 0x8EFB
-0x6971 = 0x8F64
-0x6972 = 0x8EF9
-0x6973 = 0x8EFC
-0x6974 = 0x8EEB
-0x6975 = 0x8EE4
-0x6976 = 0x8F62
-0x6977 = 0x8EFA
-0x6978 = 0x8EFE
-0x6979 = 0x8F0A
-0x697A = 0x8F07
-0x697B = 0x8F05
-0x697C = 0x8F12
-0x697D = 0x8F26
-0x697E = 0x8F1E
-0x6A21 = 0x8F1F
-0x6A22 = 0x8F1C
-0x6A23 = 0x8F33
-0x6A24 = 0x8F46
-0x6A25 = 0x8F54
-0x6A26 = 0x8ECE
-0x6A27 = 0x6214
-0x6A28 = 0x6227
-0x6A29 = 0x621B
-0x6A2A = 0x621F
-0x6A2B = 0x6222
-0x6A2C = 0x6221
-0x6A2D = 0x6225
-0x6A2E = 0x6224
-0x6A2F = 0x6229
-0x6A30 = 0x81E7
-0x6A31 = 0x750C
-0x6A32 = 0x74F4
-0x6A33 = 0x74FF
-0x6A34 = 0x750F
-0x6A35 = 0x7511
-0x6A36 = 0x7513
-0x6A37 = 0x6534
-0x6A38 = 0x65EE
-0x6A39 = 0x65EF
-0x6A3A = 0x65F0
-0x6A3B = 0x660A
-0x6A3C = 0x66C7
-0x6A3D = 0x6772
-0x6A3E = 0x6603
-0x6A3F = 0x6615
-0x6A40 = 0x6600
-0x6A41 = 0x7085
-0x6A42 = 0x66F7
-0x6A43 = 0x661D
-0x6A44 = 0x6634
-0x6A45 = 0x6631
-0x6A46 = 0x6636
-0x6A47 = 0x6635
-0x6A48 = 0x8006
-0x6A49 = 0x665F
-0x6A4A = 0x66C4
-0x6A4B = 0x6641
-0x6A4C = 0x664F
-0x6A4D = 0x6689
-0x6A4E = 0x6661
-0x6A4F = 0x6657
-0x6A50 = 0x6677
-0x6A51 = 0x6684
-0x6A52 = 0x668C
-0x6A53 = 0x66D6
-0x6A54 = 0x669D
-0x6A55 = 0x66BE
-0x6A56 = 0x66DB
-0x6A57 = 0x66DC
-0x6A58 = 0x66E6
-0x6A59 = 0x66E9
-0x6A5A = 0x8CC1
-0x6A5B = 0x8CB0
-0x6A5C = 0x8CBA
-0x6A5D = 0x8CBD
-0x6A5E = 0x8D04
-0x6A5F = 0x8CB2
-0x6A60 = 0x8CC5
-0x6A61 = 0x8D10
-0x6A62 = 0x8CD1
-0x6A63 = 0x8CDA
-0x6A64 = 0x8CD5
-0x6A65 = 0x8CEB
-0x6A66 = 0x8CE7
-0x6A67 = 0x8CFB
-0x6A68 = 0x8998
-0x6A69 = 0x89AC
-0x6A6A = 0x89A1
-0x6A6B = 0x89BF
-0x6A6C = 0x89A6
-0x6A6D = 0x89AF
-0x6A6E = 0x89B2
-0x6A6F = 0x89B7
-0x6A70 = 0x726E
-0x6A71 = 0x729F
-0x6A72 = 0x725D
-0x6A73 = 0x7266
-0x6A74 = 0x726F
-0x6A75 = 0x727E
-0x6A76 = 0x727F
-0x6A77 = 0x7284
-0x6A78 = 0x728B
-0x6A79 = 0x728D
-0x6A7A = 0x728F
-0x6A7B = 0x7292
-0x6A7C = 0x6308
-0x6A7D = 0x6332
-0x6A7E = 0x63B0
-0x6B21 = 0x643F
-0x6B22 = 0x64D8
-0x6B23 = 0x8004
-0x6B24 = 0x6BEA
-0x6B25 = 0x6BF3
-0x6B26 = 0x6BFD
-0x6B27 = 0x6BFF
-0x6B28 = 0x6BF9
-0x6B29 = 0x6C05
-0x6B2A = 0x6C0C
-0x6B2B = 0x6C06
-0x6B2C = 0x6C0D
-0x6B2D = 0x6C15
-0x6B2E = 0x6C18
-0x6B2F = 0x6C19
-0x6B30 = 0x6C1A
-0x6B31 = 0x6C21
-0x6B32 = 0x6C2C
-0x6B33 = 0x6C24
-0x6B34 = 0x6C2A
-0x6B35 = 0x6C32
-0x6B36 = 0x6535
-0x6B37 = 0x6555
-0x6B38 = 0x656B
-0x6B39 = 0x7258
-0x6B3A = 0x7252
-0x6B3B = 0x7256
-0x6B3C = 0x7230
-0x6B3D = 0x8662
-0x6B3E = 0x5216
-0x6B3F = 0x809F
-0x6B40 = 0x809C
-0x6B41 = 0x8093
-0x6B42 = 0x80BC
-0x6B43 = 0x670A
-0x6B44 = 0x80BD
-0x6B45 = 0x80B1
-0x6B46 = 0x80AB
-0x6B47 = 0x80AD
-0x6B48 = 0x80B4
-0x6B49 = 0x80B7
-0x6B4A = 0x6727
-0x6B4B = 0x8156
-0x6B4C = 0x80E9
-0x6B4D = 0x81DA
-0x6B4E = 0x80DB
-0x6B4F = 0x80C2
-0x6B50 = 0x80C4
-0x6B51 = 0x80D9
-0x6B52 = 0x80CD
-0x6B53 = 0x80D7
-0x6B54 = 0x6710
-0x6B55 = 0x80DD
-0x6B56 = 0x811B
-0x6B57 = 0x80F1
-0x6B58 = 0x80F4
-0x6B59 = 0x80ED
-0x6B5A = 0x81BE
-0x6B5B = 0x810E
-0x6B5C = 0x80F2
-0x6B5D = 0x80FC
-0x6B5E = 0x6715
-0x6B5F = 0x8112
-0x6B60 = 0x8C5A
-0x6B61 = 0x8161
-0x6B62 = 0x811E
-0x6B63 = 0x812C
-0x6B64 = 0x8118
-0x6B65 = 0x8132
-0x6B66 = 0x8148
-0x6B67 = 0x814C
-0x6B68 = 0x8153
-0x6B69 = 0x8174
-0x6B6A = 0x8159
-0x6B6B = 0x815A
-0x6B6C = 0x8171
-0x6B6D = 0x8160
-0x6B6E = 0x8169
-0x6B6F = 0x817C
-0x6B70 = 0x817D
-0x6B71 = 0x816D
-0x6B72 = 0x8167
-0x6B73 = 0x584D
-0x6B74 = 0x5AB5
-0x6B75 = 0x8188
-0x6B76 = 0x8182
-0x6B77 = 0x81CF
-0x6B78 = 0x6ED5
-0x6B79 = 0x81A3
-0x6B7A = 0x81AA
-0x6B7B = 0x81CC
-0x6B7C = 0x6726
-0x6B7D = 0x81CA
-0x6B7E = 0x81BB
-0x6C21 = 0x81C1
-0x6C22 = 0x81A6
-0x6C23 = 0x6B5F
-0x6C24 = 0x6B37
-0x6C25 = 0x6B39
-0x6C26 = 0x6B43
-0x6C27 = 0x6B46
-0x6C28 = 0x6B59
-0x6C29 = 0x98AE
-0x6C2A = 0x98AF
-0x6C2B = 0x98B6
-0x6C2C = 0x98BC
-0x6C2D = 0x98C6
-0x6C2E = 0x98C8
-0x6C2F = 0x6BB3
-0x6C30 = 0x5F40
-0x6C31 = 0x8F42
-0x6C32 = 0x89F3
-0x6C33 = 0x6590
-0x6C34 = 0x9F4F
-0x6C35 = 0x6595
-0x6C36 = 0x65BC
-0x6C37 = 0x65C6
-0x6C38 = 0x65C4
-0x6C39 = 0x65C3
-0x6C3A = 0x65CC
-0x6C3B = 0x65CE
-0x6C3C = 0x65D2
-0x6C3D = 0x65D6
-0x6C3E = 0x716C
-0x6C3F = 0x7152
-0x6C40 = 0x7096
-0x6C41 = 0x7197
-0x6C42 = 0x70BB
-0x6C43 = 0x70C0
-0x6C44 = 0x70B7
-0x6C45 = 0x70AB
-0x6C46 = 0x70B1
-0x6C47 = 0x71C1
-0x6C48 = 0x70CA
-0x6C49 = 0x7110
-0x6C4A = 0x7113
-0x6C4B = 0x71DC
-0x6C4C = 0x712F
-0x6C4D = 0x7131
-0x6C4E = 0x7173
-0x6C4F = 0x715C
-0x6C50 = 0x7168
-0x6C51 = 0x7145
-0x6C52 = 0x7172
-0x6C53 = 0x714A
-0x6C54 = 0x7178
-0x6C55 = 0x717A
-0x6C56 = 0x7198
-0x6C57 = 0x71B3
-0x6C58 = 0x71B5
-0x6C59 = 0x71A8
-0x6C5A = 0x71A0
-0x6C5B = 0x71E0
-0x6C5C = 0x71D4
-0x6C5D = 0x71E7
-0x6C5E = 0x71F9
-0x6C5F = 0x721D
-0x6C60 = 0x7228
-0x6C61 = 0x706C
-0x6C62 = 0x71FE
-0x6C63 = 0x7166
-0x6C64 = 0x71B9
-0x6C65 = 0x623E
-0x6C66 = 0x623D
-0x6C67 = 0x6243
-0x6C68 = 0x6248
-0x6C69 = 0x6249
-0x6C6A = 0x793B
-0x6C6B = 0x7940
-0x6C6C = 0x7946
-0x6C6D = 0x7949
-0x6C6E = 0x795B
-0x6C6F = 0x795C
-0x6C70 = 0x7953
-0x6C71 = 0x795A
-0x6C72 = 0x79B0
-0x6C73 = 0x7957
-0x6C74 = 0x7960
-0x6C75 = 0x798E
-0x6C76 = 0x7967
-0x6C77 = 0x797A
-0x6C78 = 0x79AA
-0x6C79 = 0x798A
-0x6C7A = 0x799A
-0x6C7B = 0x79A7
-0x6C7C = 0x79B3
-0x6C7D = 0x5FD1
-0x6C7E = 0x5FD0
-0x6D21 = 0x61DF
-0x6D22 = 0x605D
-0x6D23 = 0x605A
-0x6D24 = 0x6067
-0x6D25 = 0x6041
-0x6D26 = 0x6059
-0x6D27 = 0x6063
-0x6D28 = 0x6164
-0x6D29 = 0x6106
-0x6D2A = 0x610D
-0x6D2B = 0x615D
-0x6D2C = 0x61A9
-0x6D2D = 0x619D
-0x6D2E = 0x61CB
-0x6D2F = 0x61E3
-0x6D30 = 0x6207
-0x6D31 = 0x8080
-0x6D32 = 0x807F
-0x6D33 = 0x6C93
-0x6D34 = 0x6FA9
-0x6D35 = 0x6DFC
-0x6D36 = 0x78EF
-0x6D37 = 0x77F8
-0x6D38 = 0x78AD
-0x6D39 = 0x7809
-0x6D3A = 0x7868
-0x6D3B = 0x7818
-0x6D3C = 0x7811
-0x6D3D = 0x65AB
-0x6D3E = 0x782D
-0x6D3F = 0x78B8
-0x6D40 = 0x781D
-0x6D41 = 0x7839
-0x6D42 = 0x792A
-0x6D43 = 0x7931
-0x6D44 = 0x781F
-0x6D45 = 0x783C
-0x6D46 = 0x7825
-0x6D47 = 0x782C
-0x6D48 = 0x7823
-0x6D49 = 0x7829
-0x6D4A = 0x784E
-0x6D4B = 0x786D
-0x6D4C = 0x7864
-0x6D4D = 0x78FD
-0x6D4E = 0x7826
-0x6D4F = 0x7850
-0x6D50 = 0x7847
-0x6D51 = 0x784C
-0x6D52 = 0x786A
-0x6D53 = 0x78E7
-0x6D54 = 0x7893
-0x6D55 = 0x789A
-0x6D56 = 0x7887
-0x6D57 = 0x78E3
-0x6D58 = 0x78A1
-0x6D59 = 0x78A3
-0x6D5A = 0x78B2
-0x6D5B = 0x78B9
-0x6D5C = 0x78A5
-0x6D5D = 0x78D4
-0x6D5E = 0x78D9
-0x6D5F = 0x78C9
-0x6D60 = 0x78EC
-0x6D61 = 0x78F2
-0x6D62 = 0x7905
-0x6D63 = 0x78F4
-0x6D64 = 0x7913
-0x6D65 = 0x7924
-0x6D66 = 0x791E
-0x6D67 = 0x7934
-0x6D68 = 0x9F95
-0x6D69 = 0x9EF9
-0x6D6A = 0x9EFB
-0x6D6B = 0x9EFC
-0x6D6C = 0x76F1
-0x6D6D = 0x7704
-0x6D6E = 0x7798
-0x6D6F = 0x76F9
-0x6D70 = 0x7707
-0x6D71 = 0x7708
-0x6D72 = 0x771A
-0x6D73 = 0x7722
-0x6D74 = 0x7719
-0x6D75 = 0x772D
-0x6D76 = 0x7726
-0x6D77 = 0x7735
-0x6D78 = 0x7738
-0x6D79 = 0x775E
-0x6D7A = 0x77BC
-0x6D7B = 0x7747
-0x6D7C = 0x7743
-0x6D7D = 0x775A
-0x6D7E = 0x7768
-0x6E21 = 0x7762
-0x6E22 = 0x7765
-0x6E23 = 0x777F
-0x6E24 = 0x778D
-0x6E25 = 0x777D
-0x6E26 = 0x7780
-0x6E27 = 0x778C
-0x6E28 = 0x7791
-0x6E29 = 0x779F
-0x6E2A = 0x77A0
-0x6E2B = 0x77B0
-0x6E2C = 0x77B5
-0x6E2D = 0x77BD
-0x6E2E = 0x753A
-0x6E2F = 0x7540
-0x6E30 = 0x754E
-0x6E31 = 0x754B
-0x6E32 = 0x7548
-0x6E33 = 0x755B
-0x6E34 = 0x7572
-0x6E35 = 0x7579
-0x6E36 = 0x7583
-0x6E37 = 0x7F58
-0x6E38 = 0x7F61
-0x6E39 = 0x7F5F
-0x6E3A = 0x8A48
-0x6E3B = 0x7F68
-0x6E3C = 0x7F86
-0x6E3D = 0x7F71
-0x6E3E = 0x7F79
-0x6E3F = 0x7F88
-0x6E40 = 0x7F7E
-0x6E41 = 0x76CD
-0x6E42 = 0x76E5
-0x6E43 = 0x8832
-0x6E44 = 0x91D2
-0x6E45 = 0x91D3
-0x6E46 = 0x91D4
-0x6E47 = 0x91D9
-0x6E48 = 0x91D7
-0x6E49 = 0x91D5
-0x6E4A = 0x91F7
-0x6E4B = 0x91E7
-0x6E4C = 0x91E4
-0x6E4D = 0x9346
-0x6E4E = 0x91F5
-0x6E4F = 0x91F9
-0x6E50 = 0x9208
-0x6E51 = 0x9226
-0x6E52 = 0x9245
-0x6E53 = 0x9211
-0x6E54 = 0x9210
-0x6E55 = 0x9201
-0x6E56 = 0x9227
-0x6E57 = 0x9204
-0x6E58 = 0x9225
-0x6E59 = 0x9200
-0x6E5A = 0x923A
-0x6E5B = 0x9266
-0x6E5C = 0x9237
-0x6E5D = 0x9233
-0x6E5E = 0x9255
-0x6E5F = 0x923D
-0x6E60 = 0x9238
-0x6E61 = 0x925E
-0x6E62 = 0x926C
-0x6E63 = 0x926D
-0x6E64 = 0x923F
-0x6E65 = 0x9460
-0x6E66 = 0x9230
-0x6E67 = 0x9249
-0x6E68 = 0x9248
-0x6E69 = 0x924D
-0x6E6A = 0x922E
-0x6E6B = 0x9239
-0x6E6C = 0x9438
-0x6E6D = 0x92AC
-0x6E6E = 0x92A0
-0x6E6F = 0x927A
-0x6E70 = 0x92AA
-0x6E71 = 0x92EE
-0x6E72 = 0x92CF
-0x6E73 = 0x9403
-0x6E74 = 0x92E3
-0x6E75 = 0x943A
-0x6E76 = 0x92B1
-0x6E77 = 0x92A6
-0x6E78 = 0x93A7
-0x6E79 = 0x9296
-0x6E7A = 0x92CC
-0x6E7B = 0x92A9
-0x6E7C = 0x93F5
-0x6E7D = 0x9293
-0x6E7E = 0x927F
-0x6F21 = 0x93A9
-0x6F22 = 0x929A
-0x6F23 = 0x931A
-0x6F24 = 0x92AB
-0x6F25 = 0x9283
-0x6F26 = 0x940B
-0x6F27 = 0x92A8
-0x6F28 = 0x92A3
-0x6F29 = 0x9412
-0x6F2A = 0x9338
-0x6F2B = 0x92F1
-0x6F2C = 0x93D7
-0x6F2D = 0x92E5
-0x6F2E = 0x92F0
-0x6F2F = 0x92EF
-0x6F30 = 0x92E8
-0x6F31 = 0x92BC
-0x6F32 = 0x92DD
-0x6F33 = 0x92F6
-0x6F34 = 0x9426
-0x6F35 = 0x9427
-0x6F36 = 0x92C3
-0x6F37 = 0x92DF
-0x6F38 = 0x92E6
-0x6F39 = 0x9312
-0x6F3A = 0x9306
-0x6F3B = 0x9369
-0x6F3C = 0x931B
-0x6F3D = 0x9340
-0x6F3E = 0x9301
-0x6F3F = 0x9315
-0x6F40 = 0x932E
-0x6F41 = 0x9343
-0x6F42 = 0x9307
-0x6F43 = 0x9308
-0x6F44 = 0x931F
-0x6F45 = 0x9319
-0x6F46 = 0x9365
-0x6F47 = 0x9347
-0x6F48 = 0x9376
-0x6F49 = 0x9354
-0x6F4A = 0x9364
-0x6F4B = 0x93AA
-0x6F4C = 0x9370
-0x6F4D = 0x9384
-0x6F4E = 0x93E4
-0x6F4F = 0x93D8
-0x6F50 = 0x9428
-0x6F51 = 0x9387
-0x6F52 = 0x93CC
-0x6F53 = 0x9398
-0x6F54 = 0x93B8
-0x6F55 = 0x93BF
-0x6F56 = 0x93A6
-0x6F57 = 0x93B0
-0x6F58 = 0x93B5
-0x6F59 = 0x944C
-0x6F5A = 0x93E2
-0x6F5B = 0x93DC
-0x6F5C = 0x93DD
-0x6F5D = 0x93CD
-0x6F5E = 0x93DE
-0x6F5F = 0x93C3
-0x6F60 = 0x93C7
-0x6F61 = 0x93D1
-0x6F62 = 0x9414
-0x6F63 = 0x941D
-0x6F64 = 0x93F7
-0x6F65 = 0x9465
-0x6F66 = 0x9413
-0x6F67 = 0x946D
-0x6F68 = 0x9420
-0x6F69 = 0x9479
-0x6F6A = 0x93F9
-0x6F6B = 0x9419
-0x6F6C = 0x944A
-0x6F6D = 0x9432
-0x6F6E = 0x943F
-0x6F6F = 0x9454
-0x6F70 = 0x9463
-0x6F71 = 0x937E
-0x6F72 = 0x77E7
-0x6F73 = 0x77EC
-0x6F74 = 0x96C9
-0x6F75 = 0x79D5
-0x6F76 = 0x79ED
-0x6F77 = 0x79E3
-0x6F78 = 0x79EB
-0x6F79 = 0x7A06
-0x6F7A = 0x5D47
-0x6F7B = 0x7A03
-0x6F7C = 0x7A02
-0x6F7D = 0x7A1E
-0x6F7E = 0x7A14
-0x7021 = 0x7A39
-0x7022 = 0x7A37
-0x7023 = 0x7A61
-0x7024 = 0x9ECF
-0x7025 = 0x99A5
-0x7026 = 0x7A70
-0x7027 = 0x7688
-0x7028 = 0x768E
-0x7029 = 0x7693
-0x702A = 0x7699
-0x702B = 0x76A4
-0x702C = 0x74DE
-0x702D = 0x74E0
-0x702E = 0x752C
-0x702F = 0x9CE9
-0x7030 = 0x9CF6
-0x7031 = 0x9D07
-0x7032 = 0x9D06
-0x7033 = 0x9D23
-0x7034 = 0x9D87
-0x7035 = 0x9E15
-0x7036 = 0x9D1D
-0x7037 = 0x9D1F
-0x7038 = 0x9DE5
-0x7039 = 0x9D2F
-0x703A = 0x9DD9
-0x703B = 0x9D30
-0x703C = 0x9D42
-0x703D = 0x9E1E
-0x703E = 0x9D53
-0x703F = 0x9E1D
-0x7040 = 0x9D60
-0x7041 = 0x9D52
-0x7042 = 0x9DF3
-0x7043 = 0x9D5C
-0x7044 = 0x9D61
-0x7045 = 0x9D93
-0x7046 = 0x9D6A
-0x7047 = 0x9D6F
-0x7048 = 0x9D89
-0x7049 = 0x9D98
-0x704A = 0x9D9A
-0x704B = 0x9DC0
-0x704C = 0x9DA5
-0x704D = 0x9DA9
-0x704E = 0x9DC2
-0x704F = 0x9DBC
-0x7050 = 0x9E1A
-0x7051 = 0x9DD3
-0x7052 = 0x9DDA
-0x7053 = 0x9DEF
-0x7054 = 0x9DE6
-0x7055 = 0x9DF2
-0x7056 = 0x9DF8
-0x7057 = 0x9E0C
-0x7058 = 0x9DFA
-0x7059 = 0x9E1B
-0x705A = 0x7592
-0x705B = 0x7594
-0x705C = 0x7664
-0x705D = 0x7658
-0x705E = 0x759D
-0x705F = 0x7667
-0x7060 = 0x75A3
-0x7061 = 0x75B3
-0x7062 = 0x75B4
-0x7063 = 0x75B8
-0x7064 = 0x75C4
-0x7065 = 0x75B1
-0x7066 = 0x75B0
-0x7067 = 0x75C3
-0x7068 = 0x75C2
-0x7069 = 0x7602
-0x706A = 0x75CD
-0x706B = 0x75E3
-0x706C = 0x7646
-0x706D = 0x75E6
-0x706E = 0x75E4
-0x706F = 0x7647
-0x7070 = 0x75E7
-0x7071 = 0x7603
-0x7072 = 0x75F1
-0x7073 = 0x75FC
-0x7074 = 0x75FF
-0x7075 = 0x7610
-0x7076 = 0x7600
-0x7077 = 0x7649
-0x7078 = 0x760C
-0x7079 = 0x761E
-0x707A = 0x760A
-0x707B = 0x7625
-0x707C = 0x763B
-0x707D = 0x7615
-0x707E = 0x7619
-0x7121 = 0x761B
-0x7122 = 0x763C
-0x7123 = 0x7622
-0x7124 = 0x7620
-0x7125 = 0x7640
-0x7126 = 0x762D
-0x7127 = 0x7630
-0x7128 = 0x766D
-0x7129 = 0x7635
-0x712A = 0x7643
-0x712B = 0x766E
-0x712C = 0x7633
-0x712D = 0x764D
-0x712E = 0x7669
-0x712F = 0x7654
-0x7130 = 0x765C
-0x7131 = 0x7656
-0x7132 = 0x7672
-0x7133 = 0x766F
-0x7134 = 0x7FCA
-0x7135 = 0x7AE6
-0x7136 = 0x7A78
-0x7137 = 0x7A79
-0x7138 = 0x7A80
-0x7139 = 0x7A86
-0x713A = 0x7A88
-0x713B = 0x7A95
-0x713C = 0x7AC7
-0x713D = 0x7AA0
-0x713E = 0x7AAC
-0x713F = 0x7AA8
-0x7140 = 0x7AB6
-0x7141 = 0x7AB3
-0x7142 = 0x8864
-0x7143 = 0x8869
-0x7144 = 0x8872
-0x7145 = 0x887D
-0x7146 = 0x887F
-0x7147 = 0x8882
-0x7148 = 0x88A2
-0x7149 = 0x8960
-0x714A = 0x88B7
-0x714B = 0x88BC
-0x714C = 0x88C9
-0x714D = 0x8933
-0x714E = 0x88CE
-0x714F = 0x895D
-0x7150 = 0x8947
-0x7151 = 0x88F1
-0x7152 = 0x891A
-0x7153 = 0x88FC
-0x7154 = 0x88E8
-0x7155 = 0x88FE
-0x7156 = 0x88F0
-0x7157 = 0x8921
-0x7158 = 0x8919
-0x7159 = 0x8913
-0x715A = 0x8938
-0x715B = 0x890A
-0x715C = 0x8964
-0x715D = 0x892B
-0x715E = 0x8936
-0x715F = 0x8941
-0x7160 = 0x8966
-0x7161 = 0x897B
-0x7162 = 0x758B
-0x7163 = 0x80E5
-0x7164 = 0x76B8
-0x7165 = 0x76B4
-0x7166 = 0x77DC
-0x7167 = 0x8012
-0x7168 = 0x8014
-0x7169 = 0x8016
-0x716A = 0x801C
-0x716B = 0x8020
-0x716C = 0x802E
-0x716D = 0x8025
-0x716E = 0x8026
-0x716F = 0x802C
-0x7170 = 0x8029
-0x7171 = 0x8028
-0x7172 = 0x8031
-0x7173 = 0x800B
-0x7174 = 0x8035
-0x7175 = 0x8043
-0x7176 = 0x8046
-0x7177 = 0x8079
-0x7178 = 0x8052
-0x7179 = 0x8075
-0x717A = 0x8071
-0x717B = 0x8983
-0x717C = 0x9807
-0x717D = 0x980E
-0x717E = 0x980F
-0x7221 = 0x9821
-0x7222 = 0x981C
-0x7223 = 0x6F41
-0x7224 = 0x9826
-0x7225 = 0x9837
-0x7226 = 0x984E
-0x7227 = 0x9853
-0x7228 = 0x9873
-0x7229 = 0x9862
-0x722A = 0x9859
-0x722B = 0x9865
-0x722C = 0x986C
-0x722D = 0x9870
-0x722E = 0x864D
-0x722F = 0x8654
-0x7230 = 0x866C
-0x7231 = 0x87E3
-0x7232 = 0x8806
-0x7233 = 0x867A
-0x7234 = 0x867C
-0x7235 = 0x867B
-0x7236 = 0x86A8
-0x7237 = 0x868D
-0x7238 = 0x868B
-0x7239 = 0x8706
-0x723A = 0x869D
-0x723B = 0x86A7
-0x723C = 0x86A3
-0x723D = 0x86AA
-0x723E = 0x8693
-0x723F = 0x86A9
-0x7240 = 0x86B6
-0x7241 = 0x86C4
-0x7242 = 0x86B5
-0x7243 = 0x8823
-0x7244 = 0x86B0
-0x7245 = 0x86BA
-0x7246 = 0x86B1
-0x7247 = 0x86AF
-0x7248 = 0x86C9
-0x7249 = 0x87F6
-0x724A = 0x86B4
-0x724B = 0x86E9
-0x724C = 0x86FA
-0x724D = 0x87EF
-0x724E = 0x86ED
-0x724F = 0x8784
-0x7250 = 0x86D0
-0x7251 = 0x8713
-0x7252 = 0x86DE
-0x7253 = 0x8810
-0x7254 = 0x86DF
-0x7255 = 0x86D8
-0x7256 = 0x86D1
-0x7257 = 0x8703
-0x7258 = 0x8707
-0x7259 = 0x86F8
-0x725A = 0x8708
-0x725B = 0x870A
-0x725C = 0x870D
-0x725D = 0x8709
-0x725E = 0x8723
-0x725F = 0x873B
-0x7260 = 0x871E
-0x7261 = 0x8725
-0x7262 = 0x872E
-0x7263 = 0x871A
-0x7264 = 0x873E
-0x7265 = 0x87C8
-0x7266 = 0x8734
-0x7267 = 0x8731
-0x7268 = 0x8729
-0x7269 = 0x8737
-0x726A = 0x873F
-0x726B = 0x8782
-0x726C = 0x8722
-0x726D = 0x877D
-0x726E = 0x8811
-0x726F = 0x877B
-0x7270 = 0x8760
-0x7271 = 0x8770
-0x7272 = 0x874C
-0x7273 = 0x876E
-0x7274 = 0x878B
-0x7275 = 0x8753
-0x7276 = 0x8763
-0x7277 = 0x87BB
-0x7278 = 0x8764
-0x7279 = 0x8759
-0x727A = 0x8765
-0x727B = 0x8793
-0x727C = 0x87AF
-0x727D = 0x87CE
-0x727E = 0x87D2
-0x7321 = 0x87C6
-0x7322 = 0x8788
-0x7323 = 0x8785
-0x7324 = 0x87AD
-0x7325 = 0x8797
-0x7326 = 0x8783
-0x7327 = 0x87AB
-0x7328 = 0x87E5
-0x7329 = 0x87AC
-0x732A = 0x87B5
-0x732B = 0x87B3
-0x732C = 0x87CB
-0x732D = 0x87D3
-0x732E = 0x87BD
-0x732F = 0x87D1
-0x7330 = 0x87C0
-0x7331 = 0x87CA
-0x7332 = 0x87DB
-0x7333 = 0x87EA
-0x7334 = 0x87E0
-0x7335 = 0x87EE
-0x7336 = 0x8816
-0x7337 = 0x8813
-0x7338 = 0x87FE
-0x7339 = 0x880A
-0x733A = 0x881B
-0x733B = 0x8821
-0x733C = 0x8839
-0x733D = 0x883C
-0x733E = 0x7F36
-0x733F = 0x7F4C
-0x7340 = 0x7F44
-0x7341 = 0x7F45
-0x7342 = 0x8210
-0x7343 = 0x7AFA
-0x7344 = 0x7AFD
-0x7345 = 0x7B08
-0x7346 = 0x7BE4
-0x7347 = 0x7B04
-0x7348 = 0x7B67
-0x7349 = 0x7B0A
-0x734A = 0x7B2B
-0x734B = 0x7B0F
-0x734C = 0x7B47
-0x734D = 0x7B38
-0x734E = 0x7B2A
-0x734F = 0x7B19
-0x7350 = 0x7B2E
-0x7351 = 0x7B31
-0x7352 = 0x7B20
-0x7353 = 0x7B25
-0x7354 = 0x7B24
-0x7355 = 0x7B33
-0x7356 = 0x7C69
-0x7357 = 0x7B1E
-0x7358 = 0x7B58
-0x7359 = 0x7BF3
-0x735A = 0x7B45
-0x735B = 0x7B75
-0x735C = 0x7B4C
-0x735D = 0x7B8F
-0x735E = 0x7B60
-0x735F = 0x7B6E
-0x7360 = 0x7B7B
-0x7361 = 0x7B62
-0x7362 = 0x7B72
-0x7363 = 0x7B71
-0x7364 = 0x7B90
-0x7365 = 0x7C00
-0x7366 = 0x7BCB
-0x7367 = 0x7BB8
-0x7368 = 0x7BAC
-0x7369 = 0x7B9D
-0x736A = 0x7C5C
-0x736B = 0x7B85
-0x736C = 0x7C1E
-0x736D = 0x7B9C
-0x736E = 0x7BA2
-0x736F = 0x7C2B
-0x7370 = 0x7BB4
-0x7371 = 0x7C23
-0x7372 = 0x7BC1
-0x7373 = 0x7BCC
-0x7374 = 0x7BDD
-0x7375 = 0x7BDA
-0x7376 = 0x7BE5
-0x7377 = 0x7BE6
-0x7378 = 0x7BEA
-0x7379 = 0x7C0C
-0x737A = 0x7BFE
-0x737B = 0x7BFC
-0x737C = 0x7C0F
-0x737D = 0x7C6A
-0x737E = 0x7C0B
-0x7421 = 0x7C1F
-0x7422 = 0x7C2A
-0x7423 = 0x7C26
-0x7424 = 0x7C38
-0x7425 = 0x7C5F
-0x7426 = 0x7C40
-0x7427 = 0x81FE
-0x7428 = 0x8201
-0x7429 = 0x8202
-0x742A = 0x8204
-0x742B = 0x81EC
-0x742C = 0x8844
-0x742D = 0x8221
-0x742E = 0x8222
-0x742F = 0x8264
-0x7430 = 0x822D
-0x7431 = 0x822F
-0x7432 = 0x8228
-0x7433 = 0x822B
-0x7434 = 0x8238
-0x7435 = 0x826B
-0x7436 = 0x8233
-0x7437 = 0x8234
-0x7438 = 0x823E
-0x7439 = 0x8244
-0x743A = 0x8249
-0x743B = 0x824B
-0x743C = 0x824F
-0x743D = 0x825A
-0x743E = 0x825F
-0x743F = 0x8268
-0x7440 = 0x887E
-0x7441 = 0x88CA
-0x7442 = 0x8888
-0x7443 = 0x88D8
-0x7444 = 0x88DF
-0x7445 = 0x895E
-0x7446 = 0x7F9D
-0x7447 = 0x7FA5
-0x7448 = 0x7FA7
-0x7449 = 0x7FAF
-0x744A = 0x7FB0
-0x744B = 0x7FB2
-0x744C = 0x7C7C
-0x744D = 0x6549
-0x744E = 0x7C91
-0x744F = 0x7CF2
-0x7450 = 0x7CF6
-0x7451 = 0x7C9E
-0x7452 = 0x7CA2
-0x7453 = 0x7CB2
-0x7454 = 0x7CBC
-0x7455 = 0x7CBD
-0x7456 = 0x7CDD
-0x7457 = 0x7CC7
-0x7458 = 0x7CCC
-0x7459 = 0x7CCD
-0x745A = 0x7CC8
-0x745B = 0x7CC5
-0x745C = 0x7CD7
-0x745D = 0x7CE8
-0x745E = 0x826E
-0x745F = 0x66A8
-0x7460 = 0x7FBF
-0x7461 = 0x7FCE
-0x7462 = 0x7FD5
-0x7463 = 0x7FE5
-0x7464 = 0x7FE1
-0x7465 = 0x7FE6
-0x7466 = 0x7FE9
-0x7467 = 0x7FEE
-0x7468 = 0x7FF3
-0x7469 = 0x7CF8
-0x746A = 0x7E36
-0x746B = 0x7DA6
-0x746C = 0x7DAE
-0x746D = 0x7E47
-0x746E = 0x7E9B
-0x746F = 0x9EA9
-0x7470 = 0x9EB4
-0x7471 = 0x8D73
-0x7472 = 0x8D84
-0x7473 = 0x8D94
-0x7474 = 0x8D91
-0x7475 = 0x8DB2
-0x7476 = 0x8D67
-0x7477 = 0x8D6D
-0x7478 = 0x8C47
-0x7479 = 0x8C49
-0x747A = 0x914A
-0x747B = 0x9150
-0x747C = 0x914E
-0x747D = 0x914F
-0x747E = 0x9164
-0x7521 = 0x9162
-0x7522 = 0x9161
-0x7523 = 0x9170
-0x7524 = 0x9169
-0x7525 = 0x916F
-0x7526 = 0x91C5
-0x7527 = 0x91C3
-0x7528 = 0x9172
-0x7529 = 0x9174
-0x752A = 0x9179
-0x752B = 0x918C
-0x752C = 0x9185
-0x752D = 0x9190
-0x752E = 0x918D
-0x752F = 0x9191
-0x7530 = 0x91A2
-0x7531 = 0x91A3
-0x7532 = 0x91AA
-0x7533 = 0x91AD
-0x7534 = 0x91AE
-0x7535 = 0x91AF
-0x7536 = 0x91B5
-0x7537 = 0x91B4
-0x7538 = 0x91BA
-0x7539 = 0x8C55
-0x753A = 0x9E7A
-0x753B = 0x8E89
-0x753C = 0x8DEB
-0x753D = 0x8E05
-0x753E = 0x8E59
-0x753F = 0x8E69
-0x7540 = 0x8DB5
-0x7541 = 0x8DBF
-0x7542 = 0x8DBC
-0x7543 = 0x8DBA
-0x7544 = 0x8E4C
-0x7545 = 0x8DD6
-0x7546 = 0x8DD7
-0x7547 = 0x8DDA
-0x7548 = 0x8E92
-0x7549 = 0x8DCE
-0x754A = 0x8DCF
-0x754B = 0x8DDB
-0x754C = 0x8DC6
-0x754D = 0x8DEC
-0x754E = 0x8E7A
-0x754F = 0x8E55
-0x7550 = 0x8DE3
-0x7551 = 0x8E9A
-0x7552 = 0x8E8B
-0x7553 = 0x8DE4
-0x7554 = 0x8E09
-0x7555 = 0x8DFD
-0x7556 = 0x8E14
-0x7557 = 0x8E1D
-0x7558 = 0x8E1F
-0x7559 = 0x8E93
-0x755A = 0x8E2E
-0x755B = 0x8E23
-0x755C = 0x8E91
-0x755D = 0x8E3A
-0x755E = 0x8E40
-0x755F = 0x8E39
-0x7560 = 0x8E35
-0x7561 = 0x8E3D
-0x7562 = 0x8E31
-0x7563 = 0x8E49
-0x7564 = 0x8E41
-0x7565 = 0x8E42
-0x7566 = 0x8EA1
-0x7567 = 0x8E63
-0x7568 = 0x8E4A
-0x7569 = 0x8E70
-0x756A = 0x8E76
-0x756B = 0x8E7C
-0x756C = 0x8E6F
-0x756D = 0x8E74
-0x756E = 0x8E85
-0x756F = 0x8EAA
-0x7570 = 0x8E94
-0x7571 = 0x8E90
-0x7572 = 0x8EA6
-0x7573 = 0x8E9E
-0x7574 = 0x8C78
-0x7575 = 0x8C82
-0x7576 = 0x8C8A
-0x7577 = 0x8C85
-0x7578 = 0x8C98
-0x7579 = 0x8C94
-0x757A = 0x659B
-0x757B = 0x89D6
-0x757C = 0x89F4
-0x757D = 0x89DA
-0x757E = 0x89DC
-0x7621 = 0x89E5
-0x7622 = 0x89EB
-0x7623 = 0x89F6
-0x7624 = 0x8A3E
-0x7625 = 0x8B26
-0x7626 = 0x975A
-0x7627 = 0x96E9
-0x7628 = 0x9742
-0x7629 = 0x96EF
-0x762A = 0x9706
-0x762B = 0x973D
-0x762C = 0x9708
-0x762D = 0x970F
-0x762E = 0x970E
-0x762F = 0x972A
-0x7630 = 0x9744
-0x7631 = 0x9730
-0x7632 = 0x973E
-0x7633 = 0x9F54
-0x7634 = 0x9F5F
-0x7635 = 0x9F59
-0x7636 = 0x9F60
-0x7637 = 0x9F5C
-0x7638 = 0x9F66
-0x7639 = 0x9F6C
-0x763A = 0x9F6A
-0x763B = 0x9F77
-0x763C = 0x9EFD
-0x763D = 0x9EFF
-0x763E = 0x9F09
-0x763F = 0x96B9
-0x7640 = 0x96BC
-0x7641 = 0x96BD
-0x7642 = 0x96CE
-0x7643 = 0x96D2
-0x7644 = 0x77BF
-0x7645 = 0x8B8E
-0x7646 = 0x928E
-0x7647 = 0x947E
-0x7648 = 0x92C8
-0x7649 = 0x93E8
-0x764A = 0x936A
-0x764B = 0x93CA
-0x764C = 0x938F
-0x764D = 0x943E
-0x764E = 0x946B
-0x764F = 0x9B77
-0x7650 = 0x9B74
-0x7651 = 0x9B81
-0x7652 = 0x9B83
-0x7653 = 0x9B8E
-0x7654 = 0x9C78
-0x7655 = 0x7A4C
-0x7656 = 0x9B92
-0x7657 = 0x9C5F
-0x7658 = 0x9B90
-0x7659 = 0x9BAD
-0x765A = 0x9B9A
-0x765B = 0x9BAA
-0x765C = 0x9B9E
-0x765D = 0x9C6D
-0x765E = 0x9BAB
-0x765F = 0x9B9D
-0x7660 = 0x9C58
-0x7661 = 0x9BC1
-0x7662 = 0x9C7A
-0x7663 = 0x9C31
-0x7664 = 0x9C39
-0x7665 = 0x9C23
-0x7666 = 0x9C37
-0x7667 = 0x9BC0
-0x7668 = 0x9BCA
-0x7669 = 0x9BC7
-0x766A = 0x9BFD
-0x766B = 0x9BD6
-0x766C = 0x9BEA
-0x766D = 0x9BEB
-0x766E = 0x9BE1
-0x766F = 0x9BE4
-0x7670 = 0x9BE7
-0x7671 = 0x9BDD
-0x7672 = 0x9BE2
-0x7673 = 0x9BF0
-0x7674 = 0x9BDB
-0x7675 = 0x9BF4
-0x7676 = 0x9BD4
-0x7677 = 0x9C5D
-0x7678 = 0x9C08
-0x7679 = 0x9C10
-0x767A = 0x9C0D
-0x767B = 0x9C12
-0x767C = 0x9C09
-0x767D = 0x9BFF
-0x767E = 0x9C20
-0x7721 = 0x9C32
-0x7722 = 0x9C2D
-0x7723 = 0x9C28
-0x7724 = 0x9C25
-0x7725 = 0x9C29
-0x7726 = 0x9C33
-0x7727 = 0x9C3E
-0x7728 = 0x9C48
-0x7729 = 0x9C3B
-0x772A = 0x9C35
-0x772B = 0x9C45
-0x772C = 0x9C56
-0x772D = 0x9C54
-0x772E = 0x9C52
-0x772F = 0x9C67
-0x7730 = 0x977C
-0x7731 = 0x9785
-0x7732 = 0x97C3
-0x7733 = 0x97BD
-0x7734 = 0x9794
-0x7735 = 0x97C9
-0x7736 = 0x97AB
-0x7737 = 0x97A3
-0x7738 = 0x97B2
-0x7739 = 0x97B4
-0x773A = 0x9AB1
-0x773B = 0x9AB0
-0x773C = 0x9AB7
-0x773D = 0x9DBB
-0x773E = 0x9AB6
-0x773F = 0x9ABA
-0x7740 = 0x9ABC
-0x7741 = 0x9AC1
-0x7742 = 0x9AC0
-0x7743 = 0x9ACF
-0x7744 = 0x9AC2
-0x7745 = 0x9AD6
-0x7746 = 0x9AD5
-0x7747 = 0x9AD1
-0x7748 = 0x9B45
-0x7749 = 0x9B43
-0x774A = 0x9B58
-0x774B = 0x9B4E
-0x774C = 0x9B48
-0x774D = 0x9B4D
-0x774E = 0x9B51
-0x774F = 0x9957
-0x7750 = 0x995C
-0x7751 = 0x992E
-0x7752 = 0x9955
-0x7753 = 0x9954
-0x7754 = 0x9ADF
-0x7755 = 0x9AE1
-0x7756 = 0x9AE6
-0x7757 = 0x9AEF
-0x7758 = 0x9AEB
-0x7759 = 0x9AFB
-0x775A = 0x9AED
-0x775B = 0x9AF9
-0x775C = 0x9B08
-0x775D = 0x9B0F
-0x775E = 0x9B22
-0x775F = 0x9B1F
-0x7760 = 0x9B23
-0x7761 = 0x4E48
-0x7762 = 0x9EBE
-0x7763 = 0x7E3B
-0x7764 = 0x9E82
-0x7765 = 0x9E87
-0x7766 = 0x9E88
-0x7767 = 0x9E8B
-0x7768 = 0x9E92
-0x7769 = 0x93D6
-0x776A = 0x9E9D
-0x776B = 0x9E9F
-0x776C = 0x9EDB
-0x776D = 0x9EDC
-0x776E = 0x9EDD
-0x776F = 0x9EE0
-0x7770 = 0x9EDF
-0x7771 = 0x9EE2
-0x7772 = 0x9EF7
-0x7773 = 0x9EE7
-0x7774 = 0x9EE5
-0x7775 = 0x9EF2
-0x7776 = 0x9EEF
-0x7777 = 0x9F22
-0x7778 = 0x9F2C
-0x7779 = 0x9F2F
-0x777A = 0x9F39
-0x777B = 0x9F37
-0x777C = 0x9F3D
-0x777D = 0x9F3E
-0x777E = 0x9F44
-0x7821 = 0x896C
-0x7822 = 0x95C6
-0x7823 = 0x9336
-0x7824 = 0x5F46
-0x7825 = 0x8514
-0x7826 = 0x7E94
-0x7827 = 0x5382
-0x7828 = 0x51B2
-0x7829 = 0x4E11
-0x782A = 0x9F63
-0x782B = 0x5679
-0x782C = 0x515A
-0x782D = 0x6DC0
-0x782E = 0x9F15
-0x782F = 0x6597
-0x7830 = 0x5641
-0x7831 = 0x9AEE
-0x7832 = 0x8303
-0x7833 = 0x4E30
-0x7834 = 0x8907
-0x7835 = 0x5E72
-0x7836 = 0x7A40
-0x7837 = 0x98B3
-0x7838 = 0x5E7F
-0x7839 = 0x95A4
-0x783A = 0x9B0D
-0x783B = 0x5212
-0x783C = 0x8FF4
-0x783D = 0x5F59
-0x783E = 0x7A6B
-0x783F = 0x98E2
-0x7840 = 0x51E0
-0x7841 = 0x50A2
-0x7842 = 0x4EF7
-0x7843 = 0x8350
-0x7844 = 0x8591
-0x7845 = 0x5118
-0x7846 = 0x636E
-0x7847 = 0x6372
-0x7848 = 0x524B
-0x7849 = 0x5938
-0x784A = 0x774F
-0x784B = 0x8721
-0x784C = 0x814A
-0x784D = 0x7E8D
-0x784E = 0x91CC
-0x784F = 0x66C6
-0x7850 = 0x5E18
-0x7851 = 0x77AD
-0x7852 = 0x9E75
-0x7853 = 0x56C9
-0x7854 = 0x9EF4
-0x7855 = 0x6FDB
-0x7856 = 0x61DE
-0x7857 = 0x77C7
-0x7858 = 0x7030
-0x7859 = 0x9EB5
-0x785A = 0x884A
-0x785B = 0x95E2
-0x785C = 0x82F9
-0x785D = 0x51ED
-0x785E = 0x6251
-0x785F = 0x4EC6
-0x7860 = 0x6734
-0x7861 = 0x97C6
-0x7862 = 0x7C64
-0x7863 = 0x7E34
-0x7864 = 0x97A6
-0x7865 = 0x9EAF
-0x7866 = 0x786E
-0x7867 = 0x820D
-0x7868 = 0x672F
-0x7869 = 0x677E
-0x786A = 0x56CC
-0x786B = 0x53F0
-0x786C = 0x98B1
-0x786D = 0x6AAF
-0x786E = 0x7F4E
-0x786F = 0x6D82
-0x7870 = 0x7CF0
-0x7871 = 0x4E07
-0x7872 = 0x4FC2
-0x7873 = 0x7E6B
-0x7874 = 0x9E79
-0x7875 = 0x56AE
-0x7876 = 0x9B1A
-0x7877 = 0x846F
-0x7878 = 0x53F6
-0x7879 = 0x90C1
-0x787A = 0x79A6
-0x787B = 0x7C72
-0x787C = 0x613F
-0x787D = 0x4E91
-0x787E = 0x9AD2
-0x7921 = 0x75C7
-0x7922 = 0x96BB
-0x7923 = 0x53EA
-0x7924 = 0x7DFB
-0x7925 = 0x88FD
-0x7926 = 0x79CD
-0x7927 = 0x7843
-0x7928 = 0x7B51
-0x7929 = 0x51C6
-END_MAP
diff --git a/enc/trans/GB/GB2312%UCS.src b/enc/trans/GB/GB2312%UCS.src
deleted file mode 100644
index d196bab535..0000000000
--- a/enc/trans/GB/GB2312%UCS.src
+++ /dev/null
@@ -1,7535 +0,0 @@
-# $NetBSD: GB2312%UCS.src,v 1.4 2006/08/19 10:58:41 tnozaki Exp $
-
-TYPE ROWCOL
-NAME "GB2312/UCS"
-SRC_ZONE 0x21-0x77 / 0x21-0x7E / 8
-OOB_MODE ILSEQ
-DST_ILSEQ 0xFFFE
-DST_UNIT_BITS 16
-
-BEGIN_MAP
-#
-# 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.
-#
-#
-
-# GBK1
-0x2121 = 0x3000
-0x2122 = 0x3001
-0x2123 = 0x3002
-0x2124 = 0x00B7
-0x2125 = 0x02C9
-0x2126 = 0x02C7
-0x2127 = 0x00A8
-0x2128 = 0x3003
-0x2129 = 0x3005
-0x212A = 0x2014
-0x212B = 0xFF5E
-0x212C = 0x2016
-0x212D = 0x2026
-0x212E = 0x2018
-0x212F = 0x2019
-0x2130 = 0x201C
-0x2131 = 0x201D
-0x2132 = 0x3014
-0x2133 = 0x3015
-0x2134 = 0x3008
-0x2135 = 0x3009
-0x2136 = 0x300A
-0x2137 = 0x300B
-0x2138 = 0x300C
-0x2139 = 0x300D
-0x213A = 0x300E
-0x213B = 0x300F
-0x213C = 0x3016
-0x213D = 0x3017
-0x213E = 0x3010
-0x213F = 0x3011
-0x2140 = 0x00B1
-0x2141 = 0x00D7
-0x2142 = 0x00F7
-0x2143 = 0x2236
-0x2144 = 0x2227
-0x2145 = 0x2228
-0x2146 = 0x2211
-0x2147 = 0x220F
-0x2148 = 0x222A
-0x2149 = 0x2229
-0x214A = 0x2208
-0x214B = 0x2237
-0x214C = 0x221A
-0x214D = 0x22A5
-0x214E = 0x2225
-0x214F = 0x2220
-0x2150 = 0x2312
-0x2151 = 0x2299
-0x2152 = 0x222B
-0x2153 = 0x222E
-0x2154 = 0x2261
-0x2155 = 0x224C
-0x2156 = 0x2248
-0x2157 = 0x223D
-0x2158 = 0x221D
-0x2159 = 0x2260
-0x215A = 0x226E
-0x215B = 0x226F
-0x215C = 0x2264
-0x215D = 0x2265
-0x215E = 0x221E
-0x215F = 0x2235
-0x2160 = 0x2234
-0x2161 = 0x2642
-0x2162 = 0x2640
-0x2163 = 0x00B0
-0x2164 = 0x2032
-0x2165 = 0x2033
-0x2166 = 0x2103
-0x2167 = 0xFF04
-0x2168 = 0x00A4
-0x2169 = 0xFFE0
-0x216A = 0xFFE1
-0x216B = 0x2030
-0x216C = 0x00A7
-0x216D = 0x2116
-0x216E = 0x2606
-0x216F = 0x2605
-0x2170 = 0x25CB
-0x2171 = 0x25CF
-0x2172 = 0x25CE
-0x2173 = 0x25C7
-0x2174 = 0x25C6
-0x2175 = 0x25A1
-0x2176 = 0x25A0
-0x2177 = 0x25B3
-0x2178 = 0x25B2
-0x2179 = 0x203B
-0x217A = 0x2192
-0x217B = 0x2190
-0x217C = 0x2191
-0x217D = 0x2193
-0x217E = 0x3013
-0x2231 = 0x2488
-0x2232 = 0x2489
-0x2233 = 0x248A
-0x2234 = 0x248B
-0x2235 = 0x248C
-0x2236 = 0x248D
-0x2237 = 0x248E
-0x2238 = 0x248F
-0x2239 = 0x2490
-0x223A = 0x2491
-0x223B = 0x2492
-0x223C = 0x2493
-0x223D = 0x2494
-0x223E = 0x2495
-0x223F = 0x2496
-0x2240 = 0x2497
-0x2241 = 0x2498
-0x2242 = 0x2499
-0x2243 = 0x249A
-0x2244 = 0x249B
-0x2245 = 0x2474
-0x2246 = 0x2475
-0x2247 = 0x2476
-0x2248 = 0x2477
-0x2249 = 0x2478
-0x224A = 0x2479
-0x224B = 0x247A
-0x224C = 0x247B
-0x224D = 0x247C
-0x224E = 0x247D
-0x224F = 0x247E
-0x2250 = 0x247F
-0x2251 = 0x2480
-0x2252 = 0x2481
-0x2253 = 0x2482
-0x2254 = 0x2483
-0x2255 = 0x2484
-0x2256 = 0x2485
-0x2257 = 0x2486
-0x2258 = 0x2487
-0x2259 = 0x2460
-0x225A = 0x2461
-0x225B = 0x2462
-0x225C = 0x2463
-0x225D = 0x2464
-0x225E = 0x2465
-0x225F = 0x2466
-0x2260 = 0x2467
-0x2261 = 0x2468
-0x2262 = 0x2469
-0x2265 = 0x3220
-0x2266 = 0x3221
-0x2267 = 0x3222
-0x2268 = 0x3223
-0x2269 = 0x3224
-0x226A = 0x3225
-0x226B = 0x3226
-0x226C = 0x3227
-0x226D = 0x3228
-0x226E = 0x3229
-0x2271 = 0x2160
-0x2272 = 0x2161
-0x2273 = 0x2162
-0x2274 = 0x2163
-0x2275 = 0x2164
-0x2276 = 0x2165
-0x2277 = 0x2166
-0x2278 = 0x2167
-0x2279 = 0x2168
-0x227A = 0x2169
-0x227B = 0x216A
-0x227C = 0x216B
-0x2321 = 0xFF01
-0x2322 = 0xFF02
-0x2323 = 0xFF03
-0x2324 = 0xFFE5
-0x2325 = 0xFF05
-0x2326 = 0xFF06
-0x2327 = 0xFF07
-0x2328 = 0xFF08
-0x2329 = 0xFF09
-0x232A = 0xFF0A
-0x232B = 0xFF0B
-0x232C = 0xFF0C
-0x232D = 0xFF0D
-0x232E = 0xFF0E
-0x232F = 0xFF0F
-0x2330 = 0xFF10
-0x2331 = 0xFF11
-0x2332 = 0xFF12
-0x2333 = 0xFF13
-0x2334 = 0xFF14
-0x2335 = 0xFF15
-0x2336 = 0xFF16
-0x2337 = 0xFF17
-0x2338 = 0xFF18
-0x2339 = 0xFF19
-0x233A = 0xFF1A
-0x233B = 0xFF1B
-0x233C = 0xFF1C
-0x233D = 0xFF1D
-0x233E = 0xFF1E
-0x233F = 0xFF1F
-0x2340 = 0xFF20
-0x2341 = 0xFF21
-0x2342 = 0xFF22
-0x2343 = 0xFF23
-0x2344 = 0xFF24
-0x2345 = 0xFF25
-0x2346 = 0xFF26
-0x2347 = 0xFF27
-0x2348 = 0xFF28
-0x2349 = 0xFF29
-0x234A = 0xFF2A
-0x234B = 0xFF2B
-0x234C = 0xFF2C
-0x234D = 0xFF2D
-0x234E = 0xFF2E
-0x234F = 0xFF2F
-0x2350 = 0xFF30
-0x2351 = 0xFF31
-0x2352 = 0xFF32
-0x2353 = 0xFF33
-0x2354 = 0xFF34
-0x2355 = 0xFF35
-0x2356 = 0xFF36
-0x2357 = 0xFF37
-0x2358 = 0xFF38
-0x2359 = 0xFF39
-0x235A = 0xFF3A
-0x235B = 0xFF3B
-0x235C = 0xFF3C
-0x235D = 0xFF3D
-0x235E = 0xFF3E
-0x235F = 0xFF3F
-0x2360 = 0xFF40
-0x2361 = 0xFF41
-0x2362 = 0xFF42
-0x2363 = 0xFF43
-0x2364 = 0xFF44
-0x2365 = 0xFF45
-0x2366 = 0xFF46
-0x2367 = 0xFF47
-0x2368 = 0xFF48
-0x2369 = 0xFF49
-0x236A = 0xFF4A
-0x236B = 0xFF4B
-0x236C = 0xFF4C
-0x236D = 0xFF4D
-0x236E = 0xFF4E
-0x236F = 0xFF4F
-0x2370 = 0xFF50
-0x2371 = 0xFF51
-0x2372 = 0xFF52
-0x2373 = 0xFF53
-0x2374 = 0xFF54
-0x2375 = 0xFF55
-0x2376 = 0xFF56
-0x2377 = 0xFF57
-0x2378 = 0xFF58
-0x2379 = 0xFF59
-0x237A = 0xFF5A
-0x237B = 0xFF5B
-0x237C = 0xFF5C
-0x237D = 0xFF5D
-0x237E = 0xFFE3
-0x2421 = 0x3041
-0x2422 = 0x3042
-0x2423 = 0x3043
-0x2424 = 0x3044
-0x2425 = 0x3045
-0x2426 = 0x3046
-0x2427 = 0x3047
-0x2428 = 0x3048
-0x2429 = 0x3049
-0x242A = 0x304A
-0x242B = 0x304B
-0x242C = 0x304C
-0x242D = 0x304D
-0x242E = 0x304E
-0x242F = 0x304F
-0x2430 = 0x3050
-0x2431 = 0x3051
-0x2432 = 0x3052
-0x2433 = 0x3053
-0x2434 = 0x3054
-0x2435 = 0x3055
-0x2436 = 0x3056
-0x2437 = 0x3057
-0x2438 = 0x3058
-0x2439 = 0x3059
-0x243A = 0x305A
-0x243B = 0x305B
-0x243C = 0x305C
-0x243D = 0x305D
-0x243E = 0x305E
-0x243F = 0x305F
-0x2440 = 0x3060
-0x2441 = 0x3061
-0x2442 = 0x3062
-0x2443 = 0x3063
-0x2444 = 0x3064
-0x2445 = 0x3065
-0x2446 = 0x3066
-0x2447 = 0x3067
-0x2448 = 0x3068
-0x2449 = 0x3069
-0x244A = 0x306A
-0x244B = 0x306B
-0x244C = 0x306C
-0x244D = 0x306D
-0x244E = 0x306E
-0x244F = 0x306F
-0x2450 = 0x3070
-0x2451 = 0x3071
-0x2452 = 0x3072
-0x2453 = 0x3073
-0x2454 = 0x3074
-0x2455 = 0x3075
-0x2456 = 0x3076
-0x2457 = 0x3077
-0x2458 = 0x3078
-0x2459 = 0x3079
-0x245A = 0x307A
-0x245B = 0x307B
-0x245C = 0x307C
-0x245D = 0x307D
-0x245E = 0x307E
-0x245F = 0x307F
-0x2460 = 0x3080
-0x2461 = 0x3081
-0x2462 = 0x3082
-0x2463 = 0x3083
-0x2464 = 0x3084
-0x2465 = 0x3085
-0x2466 = 0x3086
-0x2467 = 0x3087
-0x2468 = 0x3088
-0x2469 = 0x3089
-0x246A = 0x308A
-0x246B = 0x308B
-0x246C = 0x308C
-0x246D = 0x308D
-0x246E = 0x308E
-0x246F = 0x308F
-0x2470 = 0x3090
-0x2471 = 0x3091
-0x2472 = 0x3092
-0x2473 = 0x3093
-0x2521 = 0x30A1
-0x2522 = 0x30A2
-0x2523 = 0x30A3
-0x2524 = 0x30A4
-0x2525 = 0x30A5
-0x2526 = 0x30A6
-0x2527 = 0x30A7
-0x2528 = 0x30A8
-0x2529 = 0x30A9
-0x252A = 0x30AA
-0x252B = 0x30AB
-0x252C = 0x30AC
-0x252D = 0x30AD
-0x252E = 0x30AE
-0x252F = 0x30AF
-0x2530 = 0x30B0
-0x2531 = 0x30B1
-0x2532 = 0x30B2
-0x2533 = 0x30B3
-0x2534 = 0x30B4
-0x2535 = 0x30B5
-0x2536 = 0x30B6
-0x2537 = 0x30B7
-0x2538 = 0x30B8
-0x2539 = 0x30B9
-0x253A = 0x30BA
-0x253B = 0x30BB
-0x253C = 0x30BC
-0x253D = 0x30BD
-0x253E = 0x30BE
-0x253F = 0x30BF
-0x2540 = 0x30C0
-0x2541 = 0x30C1
-0x2542 = 0x30C2
-0x2543 = 0x30C3
-0x2544 = 0x30C4
-0x2545 = 0x30C5
-0x2546 = 0x30C6
-0x2547 = 0x30C7
-0x2548 = 0x30C8
-0x2549 = 0x30C9
-0x254A = 0x30CA
-0x254B = 0x30CB
-0x254C = 0x30CC
-0x254D = 0x30CD
-0x254E = 0x30CE
-0x254F = 0x30CF
-0x2550 = 0x30D0
-0x2551 = 0x30D1
-0x2552 = 0x30D2
-0x2553 = 0x30D3
-0x2554 = 0x30D4
-0x2555 = 0x30D5
-0x2556 = 0x30D6
-0x2557 = 0x30D7
-0x2558 = 0x30D8
-0x2559 = 0x30D9
-0x255A = 0x30DA
-0x255B = 0x30DB
-0x255C = 0x30DC
-0x255D = 0x30DD
-0x255E = 0x30DE
-0x255F = 0x30DF
-0x2560 = 0x30E0
-0x2561 = 0x30E1
-0x2562 = 0x30E2
-0x2563 = 0x30E3
-0x2564 = 0x30E4
-0x2565 = 0x30E5
-0x2566 = 0x30E6
-0x2567 = 0x30E7
-0x2568 = 0x30E8
-0x2569 = 0x30E9
-0x256A = 0x30EA
-0x256B = 0x30EB
-0x256C = 0x30EC
-0x256D = 0x30ED
-0x256E = 0x30EE
-0x256F = 0x30EF
-0x2570 = 0x30F0
-0x2571 = 0x30F1
-0x2572 = 0x30F2
-0x2573 = 0x30F3
-0x2574 = 0x30F4
-0x2575 = 0x30F5
-0x2576 = 0x30F6
-0x2621 = 0x0391
-0x2622 = 0x0392
-0x2623 = 0x0393
-0x2624 = 0x0394
-0x2625 = 0x0395
-0x2626 = 0x0396
-0x2627 = 0x0397
-0x2628 = 0x0398
-0x2629 = 0x0399
-0x262A = 0x039A
-0x262B = 0x039B
-0x262C = 0x039C
-0x262D = 0x039D
-0x262E = 0x039E
-0x262F = 0x039F
-0x2630 = 0x03A0
-0x2631 = 0x03A1
-0x2632 = 0x03A3
-0x2633 = 0x03A4
-0x2634 = 0x03A5
-0x2635 = 0x03A6
-0x2636 = 0x03A7
-0x2637 = 0x03A8
-0x2638 = 0x03A9
-0x2641 = 0x03B1
-0x2642 = 0x03B2
-0x2643 = 0x03B3
-0x2644 = 0x03B4
-0x2645 = 0x03B5
-0x2646 = 0x03B6
-0x2647 = 0x03B7
-0x2648 = 0x03B8
-0x2649 = 0x03B9
-0x264A = 0x03BA
-0x264B = 0x03BB
-0x264C = 0x03BC
-0x264D = 0x03BD
-0x264E = 0x03BE
-0x264F = 0x03BF
-0x2650 = 0x03C0
-0x2651 = 0x03C1
-0x2652 = 0x03C3
-0x2653 = 0x03C4
-0x2654 = 0x03C5
-0x2655 = 0x03C6
-0x2656 = 0x03C7
-0x2657 = 0x03C8
-0x2658 = 0x03C9
-0x2721 = 0x0410
-0x2722 = 0x0411
-0x2723 = 0x0412
-0x2724 = 0x0413
-0x2725 = 0x0414
-0x2726 = 0x0415
-0x2727 = 0x0401
-0x2728 = 0x0416
-0x2729 = 0x0417
-0x272A = 0x0418
-0x272B = 0x0419
-0x272C = 0x041A
-0x272D = 0x041B
-0x272E = 0x041C
-0x272F = 0x041D
-0x2730 = 0x041E
-0x2731 = 0x041F
-0x2732 = 0x0420
-0x2733 = 0x0421
-0x2734 = 0x0422
-0x2735 = 0x0423
-0x2736 = 0x0424
-0x2737 = 0x0425
-0x2738 = 0x0426
-0x2739 = 0x0427
-0x273A = 0x0428
-0x273B = 0x0429
-0x273C = 0x042A
-0x273D = 0x042B
-0x273E = 0x042C
-0x273F = 0x042D
-0x2740 = 0x042E
-0x2741 = 0x042F
-0x2751 = 0x0430
-0x2752 = 0x0431
-0x2753 = 0x0432
-0x2754 = 0x0433
-0x2755 = 0x0434
-0x2756 = 0x0435
-0x2757 = 0x0451
-0x2758 = 0x0436
-0x2759 = 0x0437
-0x275A = 0x0438
-0x275B = 0x0439
-0x275C = 0x043A
-0x275D = 0x043B
-0x275E = 0x043C
-0x275F = 0x043D
-0x2760 = 0x043E
-0x2761 = 0x043F
-0x2762 = 0x0440
-0x2763 = 0x0441
-0x2764 = 0x0442
-0x2765 = 0x0443
-0x2766 = 0x0444
-0x2767 = 0x0445
-0x2768 = 0x0446
-0x2769 = 0x0447
-0x276A = 0x0448
-0x276B = 0x0449
-0x276C = 0x044A
-0x276D = 0x044B
-0x276E = 0x044C
-0x276F = 0x044D
-0x2770 = 0x044E
-0x2771 = 0x044F
-0x2821 = 0x0101
-0x2822 = 0x00E1
-0x2823 = 0x01CE
-0x2824 = 0x00E0
-0x2825 = 0x0113
-0x2826 = 0x00E9
-0x2827 = 0x011B
-0x2828 = 0x00E8
-0x2829 = 0x012B
-0x282A = 0x00ED
-0x282B = 0x01D0
-0x282C = 0x00EC
-0x282D = 0x014D
-0x282E = 0x00F3
-0x282F = 0x01D2
-0x2830 = 0x00F2
-0x2831 = 0x016B
-0x2832 = 0x00FA
-0x2833 = 0x01D4
-0x2834 = 0x00F9
-0x2835 = 0x01D6
-0x2836 = 0x01D8
-0x2837 = 0x01DA
-0x2838 = 0x01DC
-0x2839 = 0x00FC
-0x283A = 0x00EA
-0x2845 = 0x3105
-0x2846 = 0x3106
-0x2847 = 0x3107
-0x2848 = 0x3108
-0x2849 = 0x3109
-0x284A = 0x310A
-0x284B = 0x310B
-0x284C = 0x310C
-0x284D = 0x310D
-0x284E = 0x310E
-0x284F = 0x310F
-0x2850 = 0x3110
-0x2851 = 0x3111
-0x2852 = 0x3112
-0x2853 = 0x3113
-0x2854 = 0x3114
-0x2855 = 0x3115
-0x2856 = 0x3116
-0x2857 = 0x3117
-0x2858 = 0x3118
-0x2859 = 0x3119
-0x285A = 0x311A
-0x285B = 0x311B
-0x285C = 0x311C
-0x285D = 0x311D
-0x285E = 0x311E
-0x285F = 0x311F
-0x2860 = 0x3120
-0x2861 = 0x3121
-0x2862 = 0x3122
-0x2863 = 0x3123
-0x2864 = 0x3124
-0x2865 = 0x3125
-0x2866 = 0x3126
-0x2867 = 0x3127
-0x2868 = 0x3128
-0x2869 = 0x3129
-0x2924 = 0x2500
-0x2925 = 0x2501
-0x2926 = 0x2502
-0x2927 = 0x2503
-0x2928 = 0x2504
-0x2929 = 0x2505
-0x292A = 0x2506
-0x292B = 0x2507
-0x292C = 0x2508
-0x292D = 0x2509
-0x292E = 0x250A
-0x292F = 0x250B
-0x2930 = 0x250C
-0x2931 = 0x250D
-0x2932 = 0x250E
-0x2933 = 0x250F
-0x2934 = 0x2510
-0x2935 = 0x2511
-0x2936 = 0x2512
-0x2937 = 0x2513
-0x2938 = 0x2514
-0x2939 = 0x2515
-0x293A = 0x2516
-0x293B = 0x2517
-0x293C = 0x2518
-0x293D = 0x2519
-0x293E = 0x251A
-0x293F = 0x251B
-0x2940 = 0x251C
-0x2941 = 0x251D
-0x2942 = 0x251E
-0x2943 = 0x251F
-0x2944 = 0x2520
-0x2945 = 0x2521
-0x2946 = 0x2522
-0x2947 = 0x2523
-0x2948 = 0x2524
-0x2949 = 0x2525
-0x294A = 0x2526
-0x294B = 0x2527
-0x294C = 0x2528
-0x294D = 0x2529
-0x294E = 0x252A
-0x294F = 0x252B
-0x2950 = 0x252C
-0x2951 = 0x252D
-0x2952 = 0x252E
-0x2953 = 0x252F
-0x2954 = 0x2530
-0x2955 = 0x2531
-0x2956 = 0x2532
-0x2957 = 0x2533
-0x2958 = 0x2534
-0x2959 = 0x2535
-0x295A = 0x2536
-0x295B = 0x2537
-0x295C = 0x2538
-0x295D = 0x2539
-0x295E = 0x253A
-0x295F = 0x253B
-0x2960 = 0x253C
-0x2961 = 0x253D
-0x2962 = 0x253E
-0x2963 = 0x253F
-0x2964 = 0x2540
-0x2965 = 0x2541
-0x2966 = 0x2542
-0x2967 = 0x2543
-0x2968 = 0x2544
-0x2969 = 0x2545
-0x296A = 0x2546
-0x296B = 0x2547
-0x296C = 0x2548
-0x296D = 0x2549
-0x296E = 0x254A
-0x296F = 0x254B
-
-# GBK2 / GB2312 plane1
-0x3021 = 0x554A
-0x3022 = 0x963F
-0x3023 = 0x57C3
-0x3024 = 0x6328
-0x3025 = 0x54CE
-0x3026 = 0x5509
-0x3027 = 0x54C0
-0x3028 = 0x7691
-0x3029 = 0x764C
-0x302A = 0x853C
-0x302B = 0x77EE
-0x302C = 0x827E
-0x302D = 0x788D
-0x302E = 0x7231
-0x302F = 0x9698
-0x3030 = 0x978D
-0x3031 = 0x6C28
-0x3032 = 0x5B89
-0x3033 = 0x4FFA
-0x3034 = 0x6309
-0x3035 = 0x6697
-0x3036 = 0x5CB8
-0x3037 = 0x80FA
-0x3038 = 0x6848
-0x3039 = 0x80AE
-0x303A = 0x6602
-0x303B = 0x76CE
-0x303C = 0x51F9
-0x303D = 0x6556
-0x303E = 0x71AC
-0x303F = 0x7FF1
-0x3040 = 0x8884
-0x3041 = 0x50B2
-0x3042 = 0x5965
-0x3043 = 0x61CA
-0x3044 = 0x6FB3
-0x3045 = 0x82AD
-0x3046 = 0x634C
-0x3047 = 0x6252
-0x3048 = 0x53ED
-0x3049 = 0x5427
-0x304A = 0x7B06
-0x304B = 0x516B
-0x304C = 0x75A4
-0x304D = 0x5DF4
-0x304E = 0x62D4
-0x304F = 0x8DCB
-0x3050 = 0x9776
-0x3051 = 0x628A
-0x3052 = 0x8019
-0x3053 = 0x575D
-0x3054 = 0x9738
-0x3055 = 0x7F62
-0x3056 = 0x7238
-0x3057 = 0x767D
-0x3058 = 0x67CF
-0x3059 = 0x767E
-0x305A = 0x6446
-0x305B = 0x4F70
-0x305C = 0x8D25
-0x305D = 0x62DC
-0x305E = 0x7A17
-0x305F = 0x6591
-0x3060 = 0x73ED
-0x3061 = 0x642C
-0x3062 = 0x6273
-0x3063 = 0x822C
-0x3064 = 0x9881
-0x3065 = 0x677F
-0x3066 = 0x7248
-0x3067 = 0x626E
-0x3068 = 0x62CC
-0x3069 = 0x4F34
-0x306A = 0x74E3
-0x306B = 0x534A
-0x306C = 0x529E
-0x306D = 0x7ECA
-0x306E = 0x90A6
-0x306F = 0x5E2E
-0x3070 = 0x6886
-0x3071 = 0x699C
-0x3072 = 0x8180
-0x3073 = 0x7ED1
-0x3074 = 0x68D2
-0x3075 = 0x78C5
-0x3076 = 0x868C
-0x3077 = 0x9551
-0x3078 = 0x508D
-0x3079 = 0x8C24
-0x307A = 0x82DE
-0x307B = 0x80DE
-0x307C = 0x5305
-0x307D = 0x8912
-0x307E = 0x5265
-0x3121 = 0x8584
-0x3122 = 0x96F9
-0x3123 = 0x4FDD
-0x3124 = 0x5821
-0x3125 = 0x9971
-0x3126 = 0x5B9D
-0x3127 = 0x62B1
-0x3128 = 0x62A5
-0x3129 = 0x66B4
-0x312A = 0x8C79
-0x312B = 0x9C8D
-0x312C = 0x7206
-0x312D = 0x676F
-0x312E = 0x7891
-0x312F = 0x60B2
-0x3130 = 0x5351
-0x3131 = 0x5317
-0x3132 = 0x8F88
-0x3133 = 0x80CC
-0x3134 = 0x8D1D
-0x3135 = 0x94A1
-0x3136 = 0x500D
-0x3137 = 0x72C8
-0x3138 = 0x5907
-0x3139 = 0x60EB
-0x313A = 0x7119
-0x313B = 0x88AB
-0x313C = 0x5954
-0x313D = 0x82EF
-0x313E = 0x672C
-0x313F = 0x7B28
-0x3140 = 0x5D29
-0x3141 = 0x7EF7
-0x3142 = 0x752D
-0x3143 = 0x6CF5
-0x3144 = 0x8E66
-0x3145 = 0x8FF8
-0x3146 = 0x903C
-0x3147 = 0x9F3B
-0x3148 = 0x6BD4
-0x3149 = 0x9119
-0x314A = 0x7B14
-0x314B = 0x5F7C
-0x314C = 0x78A7
-0x314D = 0x84D6
-0x314E = 0x853D
-0x314F = 0x6BD5
-0x3150 = 0x6BD9
-0x3151 = 0x6BD6
-0x3152 = 0x5E01
-0x3153 = 0x5E87
-0x3154 = 0x75F9
-0x3155 = 0x95ED
-0x3156 = 0x655D
-0x3157 = 0x5F0A
-0x3158 = 0x5FC5
-0x3159 = 0x8F9F
-0x315A = 0x58C1
-0x315B = 0x81C2
-0x315C = 0x907F
-0x315D = 0x965B
-0x315E = 0x97AD
-0x315F = 0x8FB9
-0x3160 = 0x7F16
-0x3161 = 0x8D2C
-0x3162 = 0x6241
-0x3163 = 0x4FBF
-0x3164 = 0x53D8
-0x3165 = 0x535E
-0x3166 = 0x8FA8
-0x3167 = 0x8FA9
-0x3168 = 0x8FAB
-0x3169 = 0x904D
-0x316A = 0x6807
-0x316B = 0x5F6A
-0x316C = 0x8198
-0x316D = 0x8868
-0x316E = 0x9CD6
-0x316F = 0x618B
-0x3170 = 0x522B
-0x3171 = 0x762A
-0x3172 = 0x5F6C
-0x3173 = 0x658C
-0x3174 = 0x6FD2
-0x3175 = 0x6EE8
-0x3176 = 0x5BBE
-0x3177 = 0x6448
-0x3178 = 0x5175
-0x3179 = 0x51B0
-0x317A = 0x67C4
-0x317B = 0x4E19
-0x317C = 0x79C9
-0x317D = 0x997C
-0x317E = 0x70B3
-0x3221 = 0x75C5
-0x3222 = 0x5E76
-0x3223 = 0x73BB
-0x3224 = 0x83E0
-0x3225 = 0x64AD
-0x3226 = 0x62E8
-0x3227 = 0x94B5
-0x3228 = 0x6CE2
-0x3229 = 0x535A
-0x322A = 0x52C3
-0x322B = 0x640F
-0x322C = 0x94C2
-0x322D = 0x7B94
-0x322E = 0x4F2F
-0x322F = 0x5E1B
-0x3230 = 0x8236
-0x3231 = 0x8116
-0x3232 = 0x818A
-0x3233 = 0x6E24
-0x3234 = 0x6CCA
-0x3235 = 0x9A73
-0x3236 = 0x6355
-0x3237 = 0x535C
-0x3238 = 0x54FA
-0x3239 = 0x8865
-0x323A = 0x57E0
-0x323B = 0x4E0D
-0x323C = 0x5E03
-0x323D = 0x6B65
-0x323E = 0x7C3F
-0x323F = 0x90E8
-0x3240 = 0x6016
-0x3241 = 0x64E6
-0x3242 = 0x731C
-0x3243 = 0x88C1
-0x3244 = 0x6750
-0x3245 = 0x624D
-0x3246 = 0x8D22
-0x3247 = 0x776C
-0x3248 = 0x8E29
-0x3249 = 0x91C7
-0x324A = 0x5F69
-0x324B = 0x83DC
-0x324C = 0x8521
-0x324D = 0x9910
-0x324E = 0x53C2
-0x324F = 0x8695
-0x3250 = 0x6B8B
-0x3251 = 0x60ED
-0x3252 = 0x60E8
-0x3253 = 0x707F
-0x3254 = 0x82CD
-0x3255 = 0x8231
-0x3256 = 0x4ED3
-0x3257 = 0x6CA7
-0x3258 = 0x85CF
-0x3259 = 0x64CD
-0x325A = 0x7CD9
-0x325B = 0x69FD
-0x325C = 0x66F9
-0x325D = 0x8349
-0x325E = 0x5395
-0x325F = 0x7B56
-0x3260 = 0x4FA7
-0x3261 = 0x518C
-0x3262 = 0x6D4B
-0x3263 = 0x5C42
-0x3264 = 0x8E6D
-0x3265 = 0x63D2
-0x3266 = 0x53C9
-0x3267 = 0x832C
-0x3268 = 0x8336
-0x3269 = 0x67E5
-0x326A = 0x78B4
-0x326B = 0x643D
-0x326C = 0x5BDF
-0x326D = 0x5C94
-0x326E = 0x5DEE
-0x326F = 0x8BE7
-0x3270 = 0x62C6
-0x3271 = 0x67F4
-0x3272 = 0x8C7A
-0x3273 = 0x6400
-0x3274 = 0x63BA
-0x3275 = 0x8749
-0x3276 = 0x998B
-0x3277 = 0x8C17
-0x3278 = 0x7F20
-0x3279 = 0x94F2
-0x327A = 0x4EA7
-0x327B = 0x9610
-0x327C = 0x98A4
-0x327D = 0x660C
-0x327E = 0x7316
-0x3321 = 0x573A
-0x3322 = 0x5C1D
-0x3323 = 0x5E38
-0x3324 = 0x957F
-0x3325 = 0x507F
-0x3326 = 0x80A0
-0x3327 = 0x5382
-0x3328 = 0x655E
-0x3329 = 0x7545
-0x332A = 0x5531
-0x332B = 0x5021
-0x332C = 0x8D85
-0x332D = 0x6284
-0x332E = 0x949E
-0x332F = 0x671D
-0x3330 = 0x5632
-0x3331 = 0x6F6E
-0x3332 = 0x5DE2
-0x3333 = 0x5435
-0x3334 = 0x7092
-0x3335 = 0x8F66
-0x3336 = 0x626F
-0x3337 = 0x64A4
-0x3338 = 0x63A3
-0x3339 = 0x5F7B
-0x333A = 0x6F88
-0x333B = 0x90F4
-0x333C = 0x81E3
-0x333D = 0x8FB0
-0x333E = 0x5C18
-0x333F = 0x6668
-0x3340 = 0x5FF1
-0x3341 = 0x6C89
-0x3342 = 0x9648
-0x3343 = 0x8D81
-0x3344 = 0x886C
-0x3345 = 0x6491
-0x3346 = 0x79F0
-0x3347 = 0x57CE
-0x3348 = 0x6A59
-0x3349 = 0x6210
-0x334A = 0x5448
-0x334B = 0x4E58
-0x334C = 0x7A0B
-0x334D = 0x60E9
-0x334E = 0x6F84
-0x334F = 0x8BDA
-0x3350 = 0x627F
-0x3351 = 0x901E
-0x3352 = 0x9A8B
-0x3353 = 0x79E4
-0x3354 = 0x5403
-0x3355 = 0x75F4
-0x3356 = 0x6301
-0x3357 = 0x5319
-0x3358 = 0x6C60
-0x3359 = 0x8FDF
-0x335A = 0x5F1B
-0x335B = 0x9A70
-0x335C = 0x803B
-0x335D = 0x9F7F
-0x335E = 0x4F88
-0x335F = 0x5C3A
-0x3360 = 0x8D64
-0x3361 = 0x7FC5
-0x3362 = 0x65A5
-0x3363 = 0x70BD
-0x3364 = 0x5145
-0x3365 = 0x51B2
-0x3366 = 0x866B
-0x3367 = 0x5D07
-0x3368 = 0x5BA0
-0x3369 = 0x62BD
-0x336A = 0x916C
-0x336B = 0x7574
-0x336C = 0x8E0C
-0x336D = 0x7A20
-0x336E = 0x6101
-0x336F = 0x7B79
-0x3370 = 0x4EC7
-0x3371 = 0x7EF8
-0x3372 = 0x7785
-0x3373 = 0x4E11
-0x3374 = 0x81ED
-0x3375 = 0x521D
-0x3376 = 0x51FA
-0x3377 = 0x6A71
-0x3378 = 0x53A8
-0x3379 = 0x8E87
-0x337A = 0x9504
-0x337B = 0x96CF
-0x337C = 0x6EC1
-0x337D = 0x9664
-0x337E = 0x695A
-0x3421 = 0x7840
-0x3422 = 0x50A8
-0x3423 = 0x77D7
-0x3424 = 0x6410
-0x3425 = 0x89E6
-0x3426 = 0x5904
-0x3427 = 0x63E3
-0x3428 = 0x5DDD
-0x3429 = 0x7A7F
-0x342A = 0x693D
-0x342B = 0x4F20
-0x342C = 0x8239
-0x342D = 0x5598
-0x342E = 0x4E32
-0x342F = 0x75AE
-0x3430 = 0x7A97
-0x3431 = 0x5E62
-0x3432 = 0x5E8A
-0x3433 = 0x95EF
-0x3434 = 0x521B
-0x3435 = 0x5439
-0x3436 = 0x708A
-0x3437 = 0x6376
-0x3438 = 0x9524
-0x3439 = 0x5782
-0x343A = 0x6625
-0x343B = 0x693F
-0x343C = 0x9187
-0x343D = 0x5507
-0x343E = 0x6DF3
-0x343F = 0x7EAF
-0x3440 = 0x8822
-0x3441 = 0x6233
-0x3442 = 0x7EF0
-0x3443 = 0x75B5
-0x3444 = 0x8328
-0x3445 = 0x78C1
-0x3446 = 0x96CC
-0x3447 = 0x8F9E
-0x3448 = 0x6148
-0x3449 = 0x74F7
-0x344A = 0x8BCD
-0x344B = 0x6B64
-0x344C = 0x523A
-0x344D = 0x8D50
-0x344E = 0x6B21
-0x344F = 0x806A
-0x3450 = 0x8471
-0x3451 = 0x56F1
-0x3452 = 0x5306
-0x3453 = 0x4ECE
-0x3454 = 0x4E1B
-0x3455 = 0x51D1
-0x3456 = 0x7C97
-0x3457 = 0x918B
-0x3458 = 0x7C07
-0x3459 = 0x4FC3
-0x345A = 0x8E7F
-0x345B = 0x7BE1
-0x345C = 0x7A9C
-0x345D = 0x6467
-0x345E = 0x5D14
-0x345F = 0x50AC
-0x3460 = 0x8106
-0x3461 = 0x7601
-0x3462 = 0x7CB9
-0x3463 = 0x6DEC
-0x3464 = 0x7FE0
-0x3465 = 0x6751
-0x3466 = 0x5B58
-0x3467 = 0x5BF8
-0x3468 = 0x78CB
-0x3469 = 0x64AE
-0x346A = 0x6413
-0x346B = 0x63AA
-0x346C = 0x632B
-0x346D = 0x9519
-0x346E = 0x642D
-0x346F = 0x8FBE
-0x3470 = 0x7B54
-0x3471 = 0x7629
-0x3472 = 0x6253
-0x3473 = 0x5927
-0x3474 = 0x5446
-0x3475 = 0x6B79
-0x3476 = 0x50A3
-0x3477 = 0x6234
-0x3478 = 0x5E26
-0x3479 = 0x6B86
-0x347A = 0x4EE3
-0x347B = 0x8D37
-0x347C = 0x888B
-0x347D = 0x5F85
-0x347E = 0x902E
-0x3521 = 0x6020
-0x3522 = 0x803D
-0x3523 = 0x62C5
-0x3524 = 0x4E39
-0x3525 = 0x5355
-0x3526 = 0x90F8
-0x3527 = 0x63B8
-0x3528 = 0x80C6
-0x3529 = 0x65E6
-0x352A = 0x6C2E
-0x352B = 0x4F46
-0x352C = 0x60EE
-0x352D = 0x6DE1
-0x352E = 0x8BDE
-0x352F = 0x5F39
-0x3530 = 0x86CB
-0x3531 = 0x5F53
-0x3532 = 0x6321
-0x3533 = 0x515A
-0x3534 = 0x8361
-0x3535 = 0x6863
-0x3536 = 0x5200
-0x3537 = 0x6363
-0x3538 = 0x8E48
-0x3539 = 0x5012
-0x353A = 0x5C9B
-0x353B = 0x7977
-0x353C = 0x5BFC
-0x353D = 0x5230
-0x353E = 0x7A3B
-0x353F = 0x60BC
-0x3540 = 0x9053
-0x3541 = 0x76D7
-0x3542 = 0x5FB7
-0x3543 = 0x5F97
-0x3544 = 0x7684
-0x3545 = 0x8E6C
-0x3546 = 0x706F
-0x3547 = 0x767B
-0x3548 = 0x7B49
-0x3549 = 0x77AA
-0x354A = 0x51F3
-0x354B = 0x9093
-0x354C = 0x5824
-0x354D = 0x4F4E
-0x354E = 0x6EF4
-0x354F = 0x8FEA
-0x3550 = 0x654C
-0x3551 = 0x7B1B
-0x3552 = 0x72C4
-0x3553 = 0x6DA4
-0x3554 = 0x7FDF
-0x3555 = 0x5AE1
-0x3556 = 0x62B5
-0x3557 = 0x5E95
-0x3558 = 0x5730
-0x3559 = 0x8482
-0x355A = 0x7B2C
-0x355B = 0x5E1D
-0x355C = 0x5F1F
-0x355D = 0x9012
-0x355E = 0x7F14
-0x355F = 0x98A0
-0x3560 = 0x6382
-0x3561 = 0x6EC7
-0x3562 = 0x7898
-0x3563 = 0x70B9
-0x3564 = 0x5178
-0x3565 = 0x975B
-0x3566 = 0x57AB
-0x3567 = 0x7535
-0x3568 = 0x4F43
-0x3569 = 0x7538
-0x356A = 0x5E97
-0x356B = 0x60E6
-0x356C = 0x5960
-0x356D = 0x6DC0
-0x356E = 0x6BBF
-0x356F = 0x7889
-0x3570 = 0x53FC
-0x3571 = 0x96D5
-0x3572 = 0x51CB
-0x3573 = 0x5201
-0x3574 = 0x6389
-0x3575 = 0x540A
-0x3576 = 0x9493
-0x3577 = 0x8C03
-0x3578 = 0x8DCC
-0x3579 = 0x7239
-0x357A = 0x789F
-0x357B = 0x8776
-0x357C = 0x8FED
-0x357D = 0x8C0D
-0x357E = 0x53E0
-0x3621 = 0x4E01
-0x3622 = 0x76EF
-0x3623 = 0x53EE
-0x3624 = 0x9489
-0x3625 = 0x9876
-0x3626 = 0x9F0E
-0x3627 = 0x952D
-0x3628 = 0x5B9A
-0x3629 = 0x8BA2
-0x362A = 0x4E22
-0x362B = 0x4E1C
-0x362C = 0x51AC
-0x362D = 0x8463
-0x362E = 0x61C2
-0x362F = 0x52A8
-0x3630 = 0x680B
-0x3631 = 0x4F97
-0x3632 = 0x606B
-0x3633 = 0x51BB
-0x3634 = 0x6D1E
-0x3635 = 0x515C
-0x3636 = 0x6296
-0x3637 = 0x6597
-0x3638 = 0x9661
-0x3639 = 0x8C46
-0x363A = 0x9017
-0x363B = 0x75D8
-0x363C = 0x90FD
-0x363D = 0x7763
-0x363E = 0x6BD2
-0x363F = 0x728A
-0x3640 = 0x72EC
-0x3641 = 0x8BFB
-0x3642 = 0x5835
-0x3643 = 0x7779
-0x3644 = 0x8D4C
-0x3645 = 0x675C
-0x3646 = 0x9540
-0x3647 = 0x809A
-0x3648 = 0x5EA6
-0x3649 = 0x6E21
-0x364A = 0x5992
-0x364B = 0x7AEF
-0x364C = 0x77ED
-0x364D = 0x953B
-0x364E = 0x6BB5
-0x364F = 0x65AD
-0x3650 = 0x7F0E
-0x3651 = 0x5806
-0x3652 = 0x5151
-0x3653 = 0x961F
-0x3654 = 0x5BF9
-0x3655 = 0x58A9
-0x3656 = 0x5428
-0x3657 = 0x8E72
-0x3658 = 0x6566
-0x3659 = 0x987F
-0x365A = 0x56E4
-0x365B = 0x949D
-0x365C = 0x76FE
-0x365D = 0x9041
-0x365E = 0x6387
-0x365F = 0x54C6
-0x3660 = 0x591A
-0x3661 = 0x593A
-0x3662 = 0x579B
-0x3663 = 0x8EB2
-0x3664 = 0x6735
-0x3665 = 0x8DFA
-0x3666 = 0x8235
-0x3667 = 0x5241
-0x3668 = 0x60F0
-0x3669 = 0x5815
-0x366A = 0x86FE
-0x366B = 0x5CE8
-0x366C = 0x9E45
-0x366D = 0x4FC4
-0x366E = 0x989D
-0x366F = 0x8BB9
-0x3670 = 0x5A25
-0x3671 = 0x6076
-0x3672 = 0x5384
-0x3673 = 0x627C
-0x3674 = 0x904F
-0x3675 = 0x9102
-0x3676 = 0x997F
-0x3677 = 0x6069
-0x3678 = 0x800C
-0x3679 = 0x513F
-0x367A = 0x8033
-0x367B = 0x5C14
-0x367C = 0x9975
-0x367D = 0x6D31
-0x367E = 0x4E8C
-0x3721 = 0x8D30
-0x3722 = 0x53D1
-0x3723 = 0x7F5A
-0x3724 = 0x7B4F
-0x3725 = 0x4F10
-0x3726 = 0x4E4F
-0x3727 = 0x9600
-0x3728 = 0x6CD5
-0x3729 = 0x73D0
-0x372A = 0x85E9
-0x372B = 0x5E06
-0x372C = 0x756A
-0x372D = 0x7FFB
-0x372E = 0x6A0A
-0x372F = 0x77FE
-0x3730 = 0x9492
-0x3731 = 0x7E41
-0x3732 = 0x51E1
-0x3733 = 0x70E6
-0x3734 = 0x53CD
-0x3735 = 0x8FD4
-0x3736 = 0x8303
-0x3737 = 0x8D29
-0x3738 = 0x72AF
-0x3739 = 0x996D
-0x373A = 0x6CDB
-0x373B = 0x574A
-0x373C = 0x82B3
-0x373D = 0x65B9
-0x373E = 0x80AA
-0x373F = 0x623F
-0x3740 = 0x9632
-0x3741 = 0x59A8
-0x3742 = 0x4EFF
-0x3743 = 0x8BBF
-0x3744 = 0x7EBA
-0x3745 = 0x653E
-0x3746 = 0x83F2
-0x3747 = 0x975E
-0x3748 = 0x5561
-0x3749 = 0x98DE
-0x374A = 0x80A5
-0x374B = 0x532A
-0x374C = 0x8BFD
-0x374D = 0x5420
-0x374E = 0x80BA
-0x374F = 0x5E9F
-0x3750 = 0x6CB8
-0x3751 = 0x8D39
-0x3752 = 0x82AC
-0x3753 = 0x915A
-0x3754 = 0x5429
-0x3755 = 0x6C1B
-0x3756 = 0x5206
-0x3757 = 0x7EB7
-0x3758 = 0x575F
-0x3759 = 0x711A
-0x375A = 0x6C7E
-0x375B = 0x7C89
-0x375C = 0x594B
-0x375D = 0x4EFD
-0x375E = 0x5FFF
-0x375F = 0x6124
-0x3760 = 0x7CAA
-0x3761 = 0x4E30
-0x3762 = 0x5C01
-0x3763 = 0x67AB
-0x3764 = 0x8702
-0x3765 = 0x5CF0
-0x3766 = 0x950B
-0x3767 = 0x98CE
-0x3768 = 0x75AF
-0x3769 = 0x70FD
-0x376A = 0x9022
-0x376B = 0x51AF
-0x376C = 0x7F1D
-0x376D = 0x8BBD
-0x376E = 0x5949
-0x376F = 0x51E4
-0x3770 = 0x4F5B
-0x3771 = 0x5426
-0x3772 = 0x592B
-0x3773 = 0x6577
-0x3774 = 0x80A4
-0x3775 = 0x5B75
-0x3776 = 0x6276
-0x3777 = 0x62C2
-0x3778 = 0x8F90
-0x3779 = 0x5E45
-0x377A = 0x6C1F
-0x377B = 0x7B26
-0x377C = 0x4F0F
-0x377D = 0x4FD8
-0x377E = 0x670D
-0x3821 = 0x6D6E
-0x3822 = 0x6DAA
-0x3823 = 0x798F
-0x3824 = 0x88B1
-0x3825 = 0x5F17
-0x3826 = 0x752B
-0x3827 = 0x629A
-0x3828 = 0x8F85
-0x3829 = 0x4FEF
-0x382A = 0x91DC
-0x382B = 0x65A7
-0x382C = 0x812F
-0x382D = 0x8151
-0x382E = 0x5E9C
-0x382F = 0x8150
-0x3830 = 0x8D74
-0x3831 = 0x526F
-0x3832 = 0x8986
-0x3833 = 0x8D4B
-0x3834 = 0x590D
-0x3835 = 0x5085
-0x3836 = 0x4ED8
-0x3837 = 0x961C
-0x3838 = 0x7236
-0x3839 = 0x8179
-0x383A = 0x8D1F
-0x383B = 0x5BCC
-0x383C = 0x8BA3
-0x383D = 0x9644
-0x383E = 0x5987
-0x383F = 0x7F1A
-0x3840 = 0x5490
-0x3841 = 0x5676
-0x3842 = 0x560E
-0x3843 = 0x8BE5
-0x3844 = 0x6539
-0x3845 = 0x6982
-0x3846 = 0x9499
-0x3847 = 0x76D6
-0x3848 = 0x6E89
-0x3849 = 0x5E72
-0x384A = 0x7518
-0x384B = 0x6746
-0x384C = 0x67D1
-0x384D = 0x7AFF
-0x384E = 0x809D
-0x384F = 0x8D76
-0x3850 = 0x611F
-0x3851 = 0x79C6
-0x3852 = 0x6562
-0x3853 = 0x8D63
-0x3854 = 0x5188
-0x3855 = 0x521A
-0x3856 = 0x94A2
-0x3857 = 0x7F38
-0x3858 = 0x809B
-0x3859 = 0x7EB2
-0x385A = 0x5C97
-0x385B = 0x6E2F
-0x385C = 0x6760
-0x385D = 0x7BD9
-0x385E = 0x768B
-0x385F = 0x9AD8
-0x3860 = 0x818F
-0x3861 = 0x7F94
-0x3862 = 0x7CD5
-0x3863 = 0x641E
-0x3864 = 0x9550
-0x3865 = 0x7A3F
-0x3866 = 0x544A
-0x3867 = 0x54E5
-0x3868 = 0x6B4C
-0x3869 = 0x6401
-0x386A = 0x6208
-0x386B = 0x9E3D
-0x386C = 0x80F3
-0x386D = 0x7599
-0x386E = 0x5272
-0x386F = 0x9769
-0x3870 = 0x845B
-0x3871 = 0x683C
-0x3872 = 0x86E4
-0x3873 = 0x9601
-0x3874 = 0x9694
-0x3875 = 0x94EC
-0x3876 = 0x4E2A
-0x3877 = 0x5404
-0x3878 = 0x7ED9
-0x3879 = 0x6839
-0x387A = 0x8DDF
-0x387B = 0x8015
-0x387C = 0x66F4
-0x387D = 0x5E9A
-0x387E = 0x7FB9
-0x3921 = 0x57C2
-0x3922 = 0x803F
-0x3923 = 0x6897
-0x3924 = 0x5DE5
-0x3925 = 0x653B
-0x3926 = 0x529F
-0x3927 = 0x606D
-0x3928 = 0x9F9A
-0x3929 = 0x4F9B
-0x392A = 0x8EAC
-0x392B = 0x516C
-0x392C = 0x5BAB
-0x392D = 0x5F13
-0x392E = 0x5DE9
-0x392F = 0x6C5E
-0x3930 = 0x62F1
-0x3931 = 0x8D21
-0x3932 = 0x5171
-0x3933 = 0x94A9
-0x3934 = 0x52FE
-0x3935 = 0x6C9F
-0x3936 = 0x82DF
-0x3937 = 0x72D7
-0x3938 = 0x57A2
-0x3939 = 0x6784
-0x393A = 0x8D2D
-0x393B = 0x591F
-0x393C = 0x8F9C
-0x393D = 0x83C7
-0x393E = 0x5495
-0x393F = 0x7B8D
-0x3940 = 0x4F30
-0x3941 = 0x6CBD
-0x3942 = 0x5B64
-0x3943 = 0x59D1
-0x3944 = 0x9F13
-0x3945 = 0x53E4
-0x3946 = 0x86CA
-0x3947 = 0x9AA8
-0x3948 = 0x8C37
-0x3949 = 0x80A1
-0x394A = 0x6545
-0x394B = 0x987E
-0x394C = 0x56FA
-0x394D = 0x96C7
-0x394E = 0x522E
-0x394F = 0x74DC
-0x3950 = 0x5250
-0x3951 = 0x5BE1
-0x3952 = 0x6302
-0x3953 = 0x8902
-0x3954 = 0x4E56
-0x3955 = 0x62D0
-0x3956 = 0x602A
-0x3957 = 0x68FA
-0x3958 = 0x5173
-0x3959 = 0x5B98
-0x395A = 0x51A0
-0x395B = 0x89C2
-0x395C = 0x7BA1
-0x395D = 0x9986
-0x395E = 0x7F50
-0x395F = 0x60EF
-0x3960 = 0x704C
-0x3961 = 0x8D2F
-0x3962 = 0x5149
-0x3963 = 0x5E7F
-0x3964 = 0x901B
-0x3965 = 0x7470
-0x3966 = 0x89C4
-0x3967 = 0x572D
-0x3968 = 0x7845
-0x3969 = 0x5F52
-0x396A = 0x9F9F
-0x396B = 0x95FA
-0x396C = 0x8F68
-0x396D = 0x9B3C
-0x396E = 0x8BE1
-0x396F = 0x7678
-0x3970 = 0x6842
-0x3971 = 0x67DC
-0x3972 = 0x8DEA
-0x3973 = 0x8D35
-0x3974 = 0x523D
-0x3975 = 0x8F8A
-0x3976 = 0x6EDA
-0x3977 = 0x68CD
-0x3978 = 0x9505
-0x3979 = 0x90ED
-0x397A = 0x56FD
-0x397B = 0x679C
-0x397C = 0x88F9
-0x397D = 0x8FC7
-0x397E = 0x54C8
-0x3A21 = 0x9AB8
-0x3A22 = 0x5B69
-0x3A23 = 0x6D77
-0x3A24 = 0x6C26
-0x3A25 = 0x4EA5
-0x3A26 = 0x5BB3
-0x3A27 = 0x9A87
-0x3A28 = 0x9163
-0x3A29 = 0x61A8
-0x3A2A = 0x90AF
-0x3A2B = 0x97E9
-0x3A2C = 0x542B
-0x3A2D = 0x6DB5
-0x3A2E = 0x5BD2
-0x3A2F = 0x51FD
-0x3A30 = 0x558A
-0x3A31 = 0x7F55
-0x3A32 = 0x7FF0
-0x3A33 = 0x64BC
-0x3A34 = 0x634D
-0x3A35 = 0x65F1
-0x3A36 = 0x61BE
-0x3A37 = 0x608D
-0x3A38 = 0x710A
-0x3A39 = 0x6C57
-0x3A3A = 0x6C49
-0x3A3B = 0x592F
-0x3A3C = 0x676D
-0x3A3D = 0x822A
-0x3A3E = 0x58D5
-0x3A3F = 0x568E
-0x3A40 = 0x8C6A
-0x3A41 = 0x6BEB
-0x3A42 = 0x90DD
-0x3A43 = 0x597D
-0x3A44 = 0x8017
-0x3A45 = 0x53F7
-0x3A46 = 0x6D69
-0x3A47 = 0x5475
-0x3A48 = 0x559D
-0x3A49 = 0x8377
-0x3A4A = 0x83CF
-0x3A4B = 0x6838
-0x3A4C = 0x79BE
-0x3A4D = 0x548C
-0x3A4E = 0x4F55
-0x3A4F = 0x5408
-0x3A50 = 0x76D2
-0x3A51 = 0x8C89
-0x3A52 = 0x9602
-0x3A53 = 0x6CB3
-0x3A54 = 0x6DB8
-0x3A55 = 0x8D6B
-0x3A56 = 0x8910
-0x3A57 = 0x9E64
-0x3A58 = 0x8D3A
-0x3A59 = 0x563F
-0x3A5A = 0x9ED1
-0x3A5B = 0x75D5
-0x3A5C = 0x5F88
-0x3A5D = 0x72E0
-0x3A5E = 0x6068
-0x3A5F = 0x54FC
-0x3A60 = 0x4EA8
-0x3A61 = 0x6A2A
-0x3A62 = 0x8861
-0x3A63 = 0x6052
-0x3A64 = 0x8F70
-0x3A65 = 0x54C4
-0x3A66 = 0x70D8
-0x3A67 = 0x8679
-0x3A68 = 0x9E3F
-0x3A69 = 0x6D2A
-0x3A6A = 0x5B8F
-0x3A6B = 0x5F18
-0x3A6C = 0x7EA2
-0x3A6D = 0x5589
-0x3A6E = 0x4FAF
-0x3A6F = 0x7334
-0x3A70 = 0x543C
-0x3A71 = 0x539A
-0x3A72 = 0x5019
-0x3A73 = 0x540E
-0x3A74 = 0x547C
-0x3A75 = 0x4E4E
-0x3A76 = 0x5FFD
-0x3A77 = 0x745A
-0x3A78 = 0x58F6
-0x3A79 = 0x846B
-0x3A7A = 0x80E1
-0x3A7B = 0x8774
-0x3A7C = 0x72D0
-0x3A7D = 0x7CCA
-0x3A7E = 0x6E56
-0x3B21 = 0x5F27
-0x3B22 = 0x864E
-0x3B23 = 0x552C
-0x3B24 = 0x62A4
-0x3B25 = 0x4E92
-0x3B26 = 0x6CAA
-0x3B27 = 0x6237
-0x3B28 = 0x82B1
-0x3B29 = 0x54D7
-0x3B2A = 0x534E
-0x3B2B = 0x733E
-0x3B2C = 0x6ED1
-0x3B2D = 0x753B
-0x3B2E = 0x5212
-0x3B2F = 0x5316
-0x3B30 = 0x8BDD
-0x3B31 = 0x69D0
-0x3B32 = 0x5F8A
-0x3B33 = 0x6000
-0x3B34 = 0x6DEE
-0x3B35 = 0x574F
-0x3B36 = 0x6B22
-0x3B37 = 0x73AF
-0x3B38 = 0x6853
-0x3B39 = 0x8FD8
-0x3B3A = 0x7F13
-0x3B3B = 0x6362
-0x3B3C = 0x60A3
-0x3B3D = 0x5524
-0x3B3E = 0x75EA
-0x3B3F = 0x8C62
-0x3B40 = 0x7115
-0x3B41 = 0x6DA3
-0x3B42 = 0x5BA6
-0x3B43 = 0x5E7B
-0x3B44 = 0x8352
-0x3B45 = 0x614C
-0x3B46 = 0x9EC4
-0x3B47 = 0x78FA
-0x3B48 = 0x8757
-0x3B49 = 0x7C27
-0x3B4A = 0x7687
-0x3B4B = 0x51F0
-0x3B4C = 0x60F6
-0x3B4D = 0x714C
-0x3B4E = 0x6643
-0x3B4F = 0x5E4C
-0x3B50 = 0x604D
-0x3B51 = 0x8C0E
-0x3B52 = 0x7070
-0x3B53 = 0x6325
-0x3B54 = 0x8F89
-0x3B55 = 0x5FBD
-0x3B56 = 0x6062
-0x3B57 = 0x86D4
-0x3B58 = 0x56DE
-0x3B59 = 0x6BC1
-0x3B5A = 0x6094
-0x3B5B = 0x6167
-0x3B5C = 0x5349
-0x3B5D = 0x60E0
-0x3B5E = 0x6666
-0x3B5F = 0x8D3F
-0x3B60 = 0x79FD
-0x3B61 = 0x4F1A
-0x3B62 = 0x70E9
-0x3B63 = 0x6C47
-0x3B64 = 0x8BB3
-0x3B65 = 0x8BF2
-0x3B66 = 0x7ED8
-0x3B67 = 0x8364
-0x3B68 = 0x660F
-0x3B69 = 0x5A5A
-0x3B6A = 0x9B42
-0x3B6B = 0x6D51
-0x3B6C = 0x6DF7
-0x3B6D = 0x8C41
-0x3B6E = 0x6D3B
-0x3B6F = 0x4F19
-0x3B70 = 0x706B
-0x3B71 = 0x83B7
-0x3B72 = 0x6216
-0x3B73 = 0x60D1
-0x3B74 = 0x970D
-0x3B75 = 0x8D27
-0x3B76 = 0x7978
-0x3B77 = 0x51FB
-0x3B78 = 0x573E
-0x3B79 = 0x57FA
-0x3B7A = 0x673A
-0x3B7B = 0x7578
-0x3B7C = 0x7A3D
-0x3B7D = 0x79EF
-0x3B7E = 0x7B95
-0x3C21 = 0x808C
-0x3C22 = 0x9965
-0x3C23 = 0x8FF9
-0x3C24 = 0x6FC0
-0x3C25 = 0x8BA5
-0x3C26 = 0x9E21
-0x3C27 = 0x59EC
-0x3C28 = 0x7EE9
-0x3C29 = 0x7F09
-0x3C2A = 0x5409
-0x3C2B = 0x6781
-0x3C2C = 0x68D8
-0x3C2D = 0x8F91
-0x3C2E = 0x7C4D
-0x3C2F = 0x96C6
-0x3C30 = 0x53CA
-0x3C31 = 0x6025
-0x3C32 = 0x75BE
-0x3C33 = 0x6C72
-0x3C34 = 0x5373
-0x3C35 = 0x5AC9
-0x3C36 = 0x7EA7
-0x3C37 = 0x6324
-0x3C38 = 0x51E0
-0x3C39 = 0x810A
-0x3C3A = 0x5DF1
-0x3C3B = 0x84DF
-0x3C3C = 0x6280
-0x3C3D = 0x5180
-0x3C3E = 0x5B63
-0x3C3F = 0x4F0E
-0x3C40 = 0x796D
-0x3C41 = 0x5242
-0x3C42 = 0x60B8
-0x3C43 = 0x6D4E
-0x3C44 = 0x5BC4
-0x3C45 = 0x5BC2
-0x3C46 = 0x8BA1
-0x3C47 = 0x8BB0
-0x3C48 = 0x65E2
-0x3C49 = 0x5FCC
-0x3C4A = 0x9645
-0x3C4B = 0x5993
-0x3C4C = 0x7EE7
-0x3C4D = 0x7EAA
-0x3C4E = 0x5609
-0x3C4F = 0x67B7
-0x3C50 = 0x5939
-0x3C51 = 0x4F73
-0x3C52 = 0x5BB6
-0x3C53 = 0x52A0
-0x3C54 = 0x835A
-0x3C55 = 0x988A
-0x3C56 = 0x8D3E
-0x3C57 = 0x7532
-0x3C58 = 0x94BE
-0x3C59 = 0x5047
-0x3C5A = 0x7A3C
-0x3C5B = 0x4EF7
-0x3C5C = 0x67B6
-0x3C5D = 0x9A7E
-0x3C5E = 0x5AC1
-0x3C5F = 0x6B7C
-0x3C60 = 0x76D1
-0x3C61 = 0x575A
-0x3C62 = 0x5C16
-0x3C63 = 0x7B3A
-0x3C64 = 0x95F4
-0x3C65 = 0x714E
-0x3C66 = 0x517C
-0x3C67 = 0x80A9
-0x3C68 = 0x8270
-0x3C69 = 0x5978
-0x3C6A = 0x7F04
-0x3C6B = 0x8327
-0x3C6C = 0x68C0
-0x3C6D = 0x67EC
-0x3C6E = 0x78B1
-0x3C6F = 0x7877
-0x3C70 = 0x62E3
-0x3C71 = 0x6361
-0x3C72 = 0x7B80
-0x3C73 = 0x4FED
-0x3C74 = 0x526A
-0x3C75 = 0x51CF
-0x3C76 = 0x8350
-0x3C77 = 0x69DB
-0x3C78 = 0x9274
-0x3C79 = 0x8DF5
-0x3C7A = 0x8D31
-0x3C7B = 0x89C1
-0x3C7C = 0x952E
-0x3C7D = 0x7BAD
-0x3C7E = 0x4EF6
-0x3D21 = 0x5065
-0x3D22 = 0x8230
-0x3D23 = 0x5251
-0x3D24 = 0x996F
-0x3D25 = 0x6E10
-0x3D26 = 0x6E85
-0x3D27 = 0x6DA7
-0x3D28 = 0x5EFA
-0x3D29 = 0x50F5
-0x3D2A = 0x59DC
-0x3D2B = 0x5C06
-0x3D2C = 0x6D46
-0x3D2D = 0x6C5F
-0x3D2E = 0x7586
-0x3D2F = 0x848B
-0x3D30 = 0x6868
-0x3D31 = 0x5956
-0x3D32 = 0x8BB2
-0x3D33 = 0x5320
-0x3D34 = 0x9171
-0x3D35 = 0x964D
-0x3D36 = 0x8549
-0x3D37 = 0x6912
-0x3D38 = 0x7901
-0x3D39 = 0x7126
-0x3D3A = 0x80F6
-0x3D3B = 0x4EA4
-0x3D3C = 0x90CA
-0x3D3D = 0x6D47
-0x3D3E = 0x9A84
-0x3D3F = 0x5A07
-0x3D40 = 0x56BC
-0x3D41 = 0x6405
-0x3D42 = 0x94F0
-0x3D43 = 0x77EB
-0x3D44 = 0x4FA5
-0x3D45 = 0x811A
-0x3D46 = 0x72E1
-0x3D47 = 0x89D2
-0x3D48 = 0x997A
-0x3D49 = 0x7F34
-0x3D4A = 0x7EDE
-0x3D4B = 0x527F
-0x3D4C = 0x6559
-0x3D4D = 0x9175
-0x3D4E = 0x8F7F
-0x3D4F = 0x8F83
-0x3D50 = 0x53EB
-0x3D51 = 0x7A96
-0x3D52 = 0x63ED
-0x3D53 = 0x63A5
-0x3D54 = 0x7686
-0x3D55 = 0x79F8
-0x3D56 = 0x8857
-0x3D57 = 0x9636
-0x3D58 = 0x622A
-0x3D59 = 0x52AB
-0x3D5A = 0x8282
-0x3D5B = 0x6854
-0x3D5C = 0x6770
-0x3D5D = 0x6377
-0x3D5E = 0x776B
-0x3D5F = 0x7AED
-0x3D60 = 0x6D01
-0x3D61 = 0x7ED3
-0x3D62 = 0x89E3
-0x3D63 = 0x59D0
-0x3D64 = 0x6212
-0x3D65 = 0x85C9
-0x3D66 = 0x82A5
-0x3D67 = 0x754C
-0x3D68 = 0x501F
-0x3D69 = 0x4ECB
-0x3D6A = 0x75A5
-0x3D6B = 0x8BEB
-0x3D6C = 0x5C4A
-0x3D6D = 0x5DFE
-0x3D6E = 0x7B4B
-0x3D6F = 0x65A4
-0x3D70 = 0x91D1
-0x3D71 = 0x4ECA
-0x3D72 = 0x6D25
-0x3D73 = 0x895F
-0x3D74 = 0x7D27
-0x3D75 = 0x9526
-0x3D76 = 0x4EC5
-0x3D77 = 0x8C28
-0x3D78 = 0x8FDB
-0x3D79 = 0x9773
-0x3D7A = 0x664B
-0x3D7B = 0x7981
-0x3D7C = 0x8FD1
-0x3D7D = 0x70EC
-0x3D7E = 0x6D78
-0x3E21 = 0x5C3D
-0x3E22 = 0x52B2
-0x3E23 = 0x8346
-0x3E24 = 0x5162
-0x3E25 = 0x830E
-0x3E26 = 0x775B
-0x3E27 = 0x6676
-0x3E28 = 0x9CB8
-0x3E29 = 0x4EAC
-0x3E2A = 0x60CA
-0x3E2B = 0x7CBE
-0x3E2C = 0x7CB3
-0x3E2D = 0x7ECF
-0x3E2E = 0x4E95
-0x3E2F = 0x8B66
-0x3E30 = 0x666F
-0x3E31 = 0x9888
-0x3E32 = 0x9759
-0x3E33 = 0x5883
-0x3E34 = 0x656C
-0x3E35 = 0x955C
-0x3E36 = 0x5F84
-0x3E37 = 0x75C9
-0x3E38 = 0x9756
-0x3E39 = 0x7ADF
-0x3E3A = 0x7ADE
-0x3E3B = 0x51C0
-0x3E3C = 0x70AF
-0x3E3D = 0x7A98
-0x3E3E = 0x63EA
-0x3E3F = 0x7A76
-0x3E40 = 0x7EA0
-0x3E41 = 0x7396
-0x3E42 = 0x97ED
-0x3E43 = 0x4E45
-0x3E44 = 0x7078
-0x3E45 = 0x4E5D
-0x3E46 = 0x9152
-0x3E47 = 0x53A9
-0x3E48 = 0x6551
-0x3E49 = 0x65E7
-0x3E4A = 0x81FC
-0x3E4B = 0x8205
-0x3E4C = 0x548E
-0x3E4D = 0x5C31
-0x3E4E = 0x759A
-0x3E4F = 0x97A0
-0x3E50 = 0x62D8
-0x3E51 = 0x72D9
-0x3E52 = 0x75BD
-0x3E53 = 0x5C45
-0x3E54 = 0x9A79
-0x3E55 = 0x83CA
-0x3E56 = 0x5C40
-0x3E57 = 0x5480
-0x3E58 = 0x77E9
-0x3E59 = 0x4E3E
-0x3E5A = 0x6CAE
-0x3E5B = 0x805A
-0x3E5C = 0x62D2
-0x3E5D = 0x636E
-0x3E5E = 0x5DE8
-0x3E5F = 0x5177
-0x3E60 = 0x8DDD
-0x3E61 = 0x8E1E
-0x3E62 = 0x952F
-0x3E63 = 0x4FF1
-0x3E64 = 0x53E5
-0x3E65 = 0x60E7
-0x3E66 = 0x70AC
-0x3E67 = 0x5267
-0x3E68 = 0x6350
-0x3E69 = 0x9E43
-0x3E6A = 0x5A1F
-0x3E6B = 0x5026
-0x3E6C = 0x7737
-0x3E6D = 0x5377
-0x3E6E = 0x7EE2
-0x3E6F = 0x6485
-0x3E70 = 0x652B
-0x3E71 = 0x6289
-0x3E72 = 0x6398
-0x3E73 = 0x5014
-0x3E74 = 0x7235
-0x3E75 = 0x89C9
-0x3E76 = 0x51B3
-0x3E77 = 0x8BC0
-0x3E78 = 0x7EDD
-0x3E79 = 0x5747
-0x3E7A = 0x83CC
-0x3E7B = 0x94A7
-0x3E7C = 0x519B
-0x3E7D = 0x541B
-0x3E7E = 0x5CFB
-0x3F21 = 0x4FCA
-0x3F22 = 0x7AE3
-0x3F23 = 0x6D5A
-0x3F24 = 0x90E1
-0x3F25 = 0x9A8F
-0x3F26 = 0x5580
-0x3F27 = 0x5496
-0x3F28 = 0x5361
-0x3F29 = 0x54AF
-0x3F2A = 0x5F00
-0x3F2B = 0x63E9
-0x3F2C = 0x6977
-0x3F2D = 0x51EF
-0x3F2E = 0x6168
-0x3F2F = 0x520A
-0x3F30 = 0x582A
-0x3F31 = 0x52D8
-0x3F32 = 0x574E
-0x3F33 = 0x780D
-0x3F34 = 0x770B
-0x3F35 = 0x5EB7
-0x3F36 = 0x6177
-0x3F37 = 0x7CE0
-0x3F38 = 0x625B
-0x3F39 = 0x6297
-0x3F3A = 0x4EA2
-0x3F3B = 0x7095
-0x3F3C = 0x8003
-0x3F3D = 0x62F7
-0x3F3E = 0x70E4
-0x3F3F = 0x9760
-0x3F40 = 0x5777
-0x3F41 = 0x82DB
-0x3F42 = 0x67EF
-0x3F43 = 0x68F5
-0x3F44 = 0x78D5
-0x3F45 = 0x9897
-0x3F46 = 0x79D1
-0x3F47 = 0x58F3
-0x3F48 = 0x54B3
-0x3F49 = 0x53EF
-0x3F4A = 0x6E34
-0x3F4B = 0x514B
-0x3F4C = 0x523B
-0x3F4D = 0x5BA2
-0x3F4E = 0x8BFE
-0x3F4F = 0x80AF
-0x3F50 = 0x5543
-0x3F51 = 0x57A6
-0x3F52 = 0x6073
-0x3F53 = 0x5751
-0x3F54 = 0x542D
-0x3F55 = 0x7A7A
-0x3F56 = 0x6050
-0x3F57 = 0x5B54
-0x3F58 = 0x63A7
-0x3F59 = 0x62A0
-0x3F5A = 0x53E3
-0x3F5B = 0x6263
-0x3F5C = 0x5BC7
-0x3F5D = 0x67AF
-0x3F5E = 0x54ED
-0x3F5F = 0x7A9F
-0x3F60 = 0x82E6
-0x3F61 = 0x9177
-0x3F62 = 0x5E93
-0x3F63 = 0x88E4
-0x3F64 = 0x5938
-0x3F65 = 0x57AE
-0x3F66 = 0x630E
-0x3F67 = 0x8DE8
-0x3F68 = 0x80EF
-0x3F69 = 0x5757
-0x3F6A = 0x7B77
-0x3F6B = 0x4FA9
-0x3F6C = 0x5FEB
-0x3F6D = 0x5BBD
-0x3F6E = 0x6B3E
-0x3F6F = 0x5321
-0x3F70 = 0x7B50
-0x3F71 = 0x72C2
-0x3F72 = 0x6846
-0x3F73 = 0x77FF
-0x3F74 = 0x7736
-0x3F75 = 0x65F7
-0x3F76 = 0x51B5
-0x3F77 = 0x4E8F
-0x3F78 = 0x76D4
-0x3F79 = 0x5CBF
-0x3F7A = 0x7AA5
-0x3F7B = 0x8475
-0x3F7C = 0x594E
-0x3F7D = 0x9B41
-0x3F7E = 0x5080
-0x4021 = 0x9988
-0x4022 = 0x6127
-0x4023 = 0x6E83
-0x4024 = 0x5764
-0x4025 = 0x6606
-0x4026 = 0x6346
-0x4027 = 0x56F0
-0x4028 = 0x62EC
-0x4029 = 0x6269
-0x402A = 0x5ED3
-0x402B = 0x9614
-0x402C = 0x5783
-0x402D = 0x62C9
-0x402E = 0x5587
-0x402F = 0x8721
-0x4030 = 0x814A
-0x4031 = 0x8FA3
-0x4032 = 0x5566
-0x4033 = 0x83B1
-0x4034 = 0x6765
-0x4035 = 0x8D56
-0x4036 = 0x84DD
-0x4037 = 0x5A6A
-0x4038 = 0x680F
-0x4039 = 0x62E6
-0x403A = 0x7BEE
-0x403B = 0x9611
-0x403C = 0x5170
-0x403D = 0x6F9C
-0x403E = 0x8C30
-0x403F = 0x63FD
-0x4040 = 0x89C8
-0x4041 = 0x61D2
-0x4042 = 0x7F06
-0x4043 = 0x70C2
-0x4044 = 0x6EE5
-0x4045 = 0x7405
-0x4046 = 0x6994
-0x4047 = 0x72FC
-0x4048 = 0x5ECA
-0x4049 = 0x90CE
-0x404A = 0x6717
-0x404B = 0x6D6A
-0x404C = 0x635E
-0x404D = 0x52B3
-0x404E = 0x7262
-0x404F = 0x8001
-0x4050 = 0x4F6C
-0x4051 = 0x59E5
-0x4052 = 0x916A
-0x4053 = 0x70D9
-0x4054 = 0x6D9D
-0x4055 = 0x52D2
-0x4056 = 0x4E50
-0x4057 = 0x96F7
-0x4058 = 0x956D
-0x4059 = 0x857E
-0x405A = 0x78CA
-0x405B = 0x7D2F
-0x405C = 0x5121
-0x405D = 0x5792
-0x405E = 0x64C2
-0x405F = 0x808B
-0x4060 = 0x7C7B
-0x4061 = 0x6CEA
-0x4062 = 0x68F1
-0x4063 = 0x695E
-0x4064 = 0x51B7
-0x4065 = 0x5398
-0x4066 = 0x68A8
-0x4067 = 0x7281
-0x4068 = 0x9ECE
-0x4069 = 0x7BF1
-0x406A = 0x72F8
-0x406B = 0x79BB
-0x406C = 0x6F13
-0x406D = 0x7406
-0x406E = 0x674E
-0x406F = 0x91CC
-0x4070 = 0x9CA4
-0x4071 = 0x793C
-0x4072 = 0x8389
-0x4073 = 0x8354
-0x4074 = 0x540F
-0x4075 = 0x6817
-0x4076 = 0x4E3D
-0x4077 = 0x5389
-0x4078 = 0x52B1
-0x4079 = 0x783E
-0x407A = 0x5386
-0x407B = 0x5229
-0x407C = 0x5088
-0x407D = 0x4F8B
-0x407E = 0x4FD0
-0x4121 = 0x75E2
-0x4122 = 0x7ACB
-0x4123 = 0x7C92
-0x4124 = 0x6CA5
-0x4125 = 0x96B6
-0x4126 = 0x529B
-0x4127 = 0x7483
-0x4128 = 0x54E9
-0x4129 = 0x4FE9
-0x412A = 0x8054
-0x412B = 0x83B2
-0x412C = 0x8FDE
-0x412D = 0x9570
-0x412E = 0x5EC9
-0x412F = 0x601C
-0x4130 = 0x6D9F
-0x4131 = 0x5E18
-0x4132 = 0x655B
-0x4133 = 0x8138
-0x4134 = 0x94FE
-0x4135 = 0x604B
-0x4136 = 0x70BC
-0x4137 = 0x7EC3
-0x4138 = 0x7CAE
-0x4139 = 0x51C9
-0x413A = 0x6881
-0x413B = 0x7CB1
-0x413C = 0x826F
-0x413D = 0x4E24
-0x413E = 0x8F86
-0x413F = 0x91CF
-0x4140 = 0x667E
-0x4141 = 0x4EAE
-0x4142 = 0x8C05
-0x4143 = 0x64A9
-0x4144 = 0x804A
-0x4145 = 0x50DA
-0x4146 = 0x7597
-0x4147 = 0x71CE
-0x4148 = 0x5BE5
-0x4149 = 0x8FBD
-0x414A = 0x6F66
-0x414B = 0x4E86
-0x414C = 0x6482
-0x414D = 0x9563
-0x414E = 0x5ED6
-0x414F = 0x6599
-0x4150 = 0x5217
-0x4151 = 0x88C2
-0x4152 = 0x70C8
-0x4153 = 0x52A3
-0x4154 = 0x730E
-0x4155 = 0x7433
-0x4156 = 0x6797
-0x4157 = 0x78F7
-0x4158 = 0x9716
-0x4159 = 0x4E34
-0x415A = 0x90BB
-0x415B = 0x9CDE
-0x415C = 0x6DCB
-0x415D = 0x51DB
-0x415E = 0x8D41
-0x415F = 0x541D
-0x4160 = 0x62CE
-0x4161 = 0x73B2
-0x4162 = 0x83F1
-0x4163 = 0x96F6
-0x4164 = 0x9F84
-0x4165 = 0x94C3
-0x4166 = 0x4F36
-0x4167 = 0x7F9A
-0x4168 = 0x51CC
-0x4169 = 0x7075
-0x416A = 0x9675
-0x416B = 0x5CAD
-0x416C = 0x9886
-0x416D = 0x53E6
-0x416E = 0x4EE4
-0x416F = 0x6E9C
-0x4170 = 0x7409
-0x4171 = 0x69B4
-0x4172 = 0x786B
-0x4173 = 0x998F
-0x4174 = 0x7559
-0x4175 = 0x5218
-0x4176 = 0x7624
-0x4177 = 0x6D41
-0x4178 = 0x67F3
-0x4179 = 0x516D
-0x417A = 0x9F99
-0x417B = 0x804B
-0x417C = 0x5499
-0x417D = 0x7B3C
-0x417E = 0x7ABF
-0x4221 = 0x9686
-0x4222 = 0x5784
-0x4223 = 0x62E2
-0x4224 = 0x9647
-0x4225 = 0x697C
-0x4226 = 0x5A04
-0x4227 = 0x6402
-0x4228 = 0x7BD3
-0x4229 = 0x6F0F
-0x422A = 0x964B
-0x422B = 0x82A6
-0x422C = 0x5362
-0x422D = 0x9885
-0x422E = 0x5E90
-0x422F = 0x7089
-0x4230 = 0x63B3
-0x4231 = 0x5364
-0x4232 = 0x864F
-0x4233 = 0x9C81
-0x4234 = 0x9E93
-0x4235 = 0x788C
-0x4236 = 0x9732
-0x4237 = 0x8DEF
-0x4238 = 0x8D42
-0x4239 = 0x9E7F
-0x423A = 0x6F5E
-0x423B = 0x7984
-0x423C = 0x5F55
-0x423D = 0x9646
-0x423E = 0x622E
-0x423F = 0x9A74
-0x4240 = 0x5415
-0x4241 = 0x94DD
-0x4242 = 0x4FA3
-0x4243 = 0x65C5
-0x4244 = 0x5C65
-0x4245 = 0x5C61
-0x4246 = 0x7F15
-0x4247 = 0x8651
-0x4248 = 0x6C2F
-0x4249 = 0x5F8B
-0x424A = 0x7387
-0x424B = 0x6EE4
-0x424C = 0x7EFF
-0x424D = 0x5CE6
-0x424E = 0x631B
-0x424F = 0x5B6A
-0x4250 = 0x6EE6
-0x4251 = 0x5375
-0x4252 = 0x4E71
-0x4253 = 0x63A0
-0x4254 = 0x7565
-0x4255 = 0x62A1
-0x4256 = 0x8F6E
-0x4257 = 0x4F26
-0x4258 = 0x4ED1
-0x4259 = 0x6CA6
-0x425A = 0x7EB6
-0x425B = 0x8BBA
-0x425C = 0x841D
-0x425D = 0x87BA
-0x425E = 0x7F57
-0x425F = 0x903B
-0x4260 = 0x9523
-0x4261 = 0x7BA9
-0x4262 = 0x9AA1
-0x4263 = 0x88F8
-0x4264 = 0x843D
-0x4265 = 0x6D1B
-0x4266 = 0x9A86
-0x4267 = 0x7EDC
-0x4268 = 0x5988
-0x4269 = 0x9EBB
-0x426A = 0x739B
-0x426B = 0x7801
-0x426C = 0x8682
-0x426D = 0x9A6C
-0x426E = 0x9A82
-0x426F = 0x561B
-0x4270 = 0x5417
-0x4271 = 0x57CB
-0x4272 = 0x4E70
-0x4273 = 0x9EA6
-0x4274 = 0x5356
-0x4275 = 0x8FC8
-0x4276 = 0x8109
-0x4277 = 0x7792
-0x4278 = 0x9992
-0x4279 = 0x86EE
-0x427A = 0x6EE1
-0x427B = 0x8513
-0x427C = 0x66FC
-0x427D = 0x6162
-0x427E = 0x6F2B
-0x4321 = 0x8C29
-0x4322 = 0x8292
-0x4323 = 0x832B
-0x4324 = 0x76F2
-0x4325 = 0x6C13
-0x4326 = 0x5FD9
-0x4327 = 0x83BD
-0x4328 = 0x732B
-0x4329 = 0x8305
-0x432A = 0x951A
-0x432B = 0x6BDB
-0x432C = 0x77DB
-0x432D = 0x94C6
-0x432E = 0x536F
-0x432F = 0x8302
-0x4330 = 0x5192
-0x4331 = 0x5E3D
-0x4332 = 0x8C8C
-0x4333 = 0x8D38
-0x4334 = 0x4E48
-0x4335 = 0x73AB
-0x4336 = 0x679A
-0x4337 = 0x6885
-0x4338 = 0x9176
-0x4339 = 0x9709
-0x433A = 0x7164
-0x433B = 0x6CA1
-0x433C = 0x7709
-0x433D = 0x5A92
-0x433E = 0x9541
-0x433F = 0x6BCF
-0x4340 = 0x7F8E
-0x4341 = 0x6627
-0x4342 = 0x5BD0
-0x4343 = 0x59B9
-0x4344 = 0x5A9A
-0x4345 = 0x95E8
-0x4346 = 0x95F7
-0x4347 = 0x4EEC
-0x4348 = 0x840C
-0x4349 = 0x8499
-0x434A = 0x6AAC
-0x434B = 0x76DF
-0x434C = 0x9530
-0x434D = 0x731B
-0x434E = 0x68A6
-0x434F = 0x5B5F
-0x4350 = 0x772F
-0x4351 = 0x919A
-0x4352 = 0x9761
-0x4353 = 0x7CDC
-0x4354 = 0x8FF7
-0x4355 = 0x8C1C
-0x4356 = 0x5F25
-0x4357 = 0x7C73
-0x4358 = 0x79D8
-0x4359 = 0x89C5
-0x435A = 0x6CCC
-0x435B = 0x871C
-0x435C = 0x5BC6
-0x435D = 0x5E42
-0x435E = 0x68C9
-0x435F = 0x7720
-0x4360 = 0x7EF5
-0x4361 = 0x5195
-0x4362 = 0x514D
-0x4363 = 0x52C9
-0x4364 = 0x5A29
-0x4365 = 0x7F05
-0x4366 = 0x9762
-0x4367 = 0x82D7
-0x4368 = 0x63CF
-0x4369 = 0x7784
-0x436A = 0x85D0
-0x436B = 0x79D2
-0x436C = 0x6E3A
-0x436D = 0x5E99
-0x436E = 0x5999
-0x436F = 0x8511
-0x4370 = 0x706D
-0x4371 = 0x6C11
-0x4372 = 0x62BF
-0x4373 = 0x76BF
-0x4374 = 0x654F
-0x4375 = 0x60AF
-0x4376 = 0x95FD
-0x4377 = 0x660E
-0x4378 = 0x879F
-0x4379 = 0x9E23
-0x437A = 0x94ED
-0x437B = 0x540D
-0x437C = 0x547D
-0x437D = 0x8C2C
-0x437E = 0x6478
-0x4421 = 0x6479
-0x4422 = 0x8611
-0x4423 = 0x6A21
-0x4424 = 0x819C
-0x4425 = 0x78E8
-0x4426 = 0x6469
-0x4427 = 0x9B54
-0x4428 = 0x62B9
-0x4429 = 0x672B
-0x442A = 0x83AB
-0x442B = 0x58A8
-0x442C = 0x9ED8
-0x442D = 0x6CAB
-0x442E = 0x6F20
-0x442F = 0x5BDE
-0x4430 = 0x964C
-0x4431 = 0x8C0B
-0x4432 = 0x725F
-0x4433 = 0x67D0
-0x4434 = 0x62C7
-0x4435 = 0x7261
-0x4436 = 0x4EA9
-0x4437 = 0x59C6
-0x4438 = 0x6BCD
-0x4439 = 0x5893
-0x443A = 0x66AE
-0x443B = 0x5E55
-0x443C = 0x52DF
-0x443D = 0x6155
-0x443E = 0x6728
-0x443F = 0x76EE
-0x4440 = 0x7766
-0x4441 = 0x7267
-0x4442 = 0x7A46
-0x4443 = 0x62FF
-0x4444 = 0x54EA
-0x4445 = 0x5450
-0x4446 = 0x94A0
-0x4447 = 0x90A3
-0x4448 = 0x5A1C
-0x4449 = 0x7EB3
-0x444A = 0x6C16
-0x444B = 0x4E43
-0x444C = 0x5976
-0x444D = 0x8010
-0x444E = 0x5948
-0x444F = 0x5357
-0x4450 = 0x7537
-0x4451 = 0x96BE
-0x4452 = 0x56CA
-0x4453 = 0x6320
-0x4454 = 0x8111
-0x4455 = 0x607C
-0x4456 = 0x95F9
-0x4457 = 0x6DD6
-0x4458 = 0x5462
-0x4459 = 0x9981
-0x445A = 0x5185
-0x445B = 0x5AE9
-0x445C = 0x80FD
-0x445D = 0x59AE
-0x445E = 0x9713
-0x445F = 0x502A
-0x4460 = 0x6CE5
-0x4461 = 0x5C3C
-0x4462 = 0x62DF
-0x4463 = 0x4F60
-0x4464 = 0x533F
-0x4465 = 0x817B
-0x4466 = 0x9006
-0x4467 = 0x6EBA
-0x4468 = 0x852B
-0x4469 = 0x62C8
-0x446A = 0x5E74
-0x446B = 0x78BE
-0x446C = 0x64B5
-0x446D = 0x637B
-0x446E = 0x5FF5
-0x446F = 0x5A18
-0x4470 = 0x917F
-0x4471 = 0x9E1F
-0x4472 = 0x5C3F
-0x4473 = 0x634F
-0x4474 = 0x8042
-0x4475 = 0x5B7D
-0x4476 = 0x556E
-0x4477 = 0x954A
-0x4478 = 0x954D
-0x4479 = 0x6D85
-0x447A = 0x60A8
-0x447B = 0x67E0
-0x447C = 0x72DE
-0x447D = 0x51DD
-0x447E = 0x5B81
-0x4521 = 0x62E7
-0x4522 = 0x6CDE
-0x4523 = 0x725B
-0x4524 = 0x626D
-0x4525 = 0x94AE
-0x4526 = 0x7EBD
-0x4527 = 0x8113
-0x4528 = 0x6D53
-0x4529 = 0x519C
-0x452A = 0x5F04
-0x452B = 0x5974
-0x452C = 0x52AA
-0x452D = 0x6012
-0x452E = 0x5973
-0x452F = 0x6696
-0x4530 = 0x8650
-0x4531 = 0x759F
-0x4532 = 0x632A
-0x4533 = 0x61E6
-0x4534 = 0x7CEF
-0x4535 = 0x8BFA
-0x4536 = 0x54E6
-0x4537 = 0x6B27
-0x4538 = 0x9E25
-0x4539 = 0x6BB4
-0x453A = 0x85D5
-0x453B = 0x5455
-0x453C = 0x5076
-0x453D = 0x6CA4
-0x453E = 0x556A
-0x453F = 0x8DB4
-0x4540 = 0x722C
-0x4541 = 0x5E15
-0x4542 = 0x6015
-0x4543 = 0x7436
-0x4544 = 0x62CD
-0x4545 = 0x6392
-0x4546 = 0x724C
-0x4547 = 0x5F98
-0x4548 = 0x6E43
-0x4549 = 0x6D3E
-0x454A = 0x6500
-0x454B = 0x6F58
-0x454C = 0x76D8
-0x454D = 0x78D0
-0x454E = 0x76FC
-0x454F = 0x7554
-0x4550 = 0x5224
-0x4551 = 0x53DB
-0x4552 = 0x4E53
-0x4553 = 0x5E9E
-0x4554 = 0x65C1
-0x4555 = 0x802A
-0x4556 = 0x80D6
-0x4557 = 0x629B
-0x4558 = 0x5486
-0x4559 = 0x5228
-0x455A = 0x70AE
-0x455B = 0x888D
-0x455C = 0x8DD1
-0x455D = 0x6CE1
-0x455E = 0x5478
-0x455F = 0x80DA
-0x4560 = 0x57F9
-0x4561 = 0x88F4
-0x4562 = 0x8D54
-0x4563 = 0x966A
-0x4564 = 0x914D
-0x4565 = 0x4F69
-0x4566 = 0x6C9B
-0x4567 = 0x55B7
-0x4568 = 0x76C6
-0x4569 = 0x7830
-0x456A = 0x62A8
-0x456B = 0x70F9
-0x456C = 0x6F8E
-0x456D = 0x5F6D
-0x456E = 0x84EC
-0x456F = 0x68DA
-0x4570 = 0x787C
-0x4571 = 0x7BF7
-0x4572 = 0x81A8
-0x4573 = 0x670B
-0x4574 = 0x9E4F
-0x4575 = 0x6367
-0x4576 = 0x78B0
-0x4577 = 0x576F
-0x4578 = 0x7812
-0x4579 = 0x9739
-0x457A = 0x6279
-0x457B = 0x62AB
-0x457C = 0x5288
-0x457D = 0x7435
-0x457E = 0x6BD7
-0x4621 = 0x5564
-0x4622 = 0x813E
-0x4623 = 0x75B2
-0x4624 = 0x76AE
-0x4625 = 0x5339
-0x4626 = 0x75DE
-0x4627 = 0x50FB
-0x4628 = 0x5C41
-0x4629 = 0x8B6C
-0x462A = 0x7BC7
-0x462B = 0x504F
-0x462C = 0x7247
-0x462D = 0x9A97
-0x462E = 0x98D8
-0x462F = 0x6F02
-0x4630 = 0x74E2
-0x4631 = 0x7968
-0x4632 = 0x6487
-0x4633 = 0x77A5
-0x4634 = 0x62FC
-0x4635 = 0x9891
-0x4636 = 0x8D2B
-0x4637 = 0x54C1
-0x4638 = 0x8058
-0x4639 = 0x4E52
-0x463A = 0x576A
-0x463B = 0x82F9
-0x463C = 0x840D
-0x463D = 0x5E73
-0x463E = 0x51ED
-0x463F = 0x74F6
-0x4640 = 0x8BC4
-0x4641 = 0x5C4F
-0x4642 = 0x5761
-0x4643 = 0x6CFC
-0x4644 = 0x9887
-0x4645 = 0x5A46
-0x4646 = 0x7834
-0x4647 = 0x9B44
-0x4648 = 0x8FEB
-0x4649 = 0x7C95
-0x464A = 0x5256
-0x464B = 0x6251
-0x464C = 0x94FA
-0x464D = 0x4EC6
-0x464E = 0x8386
-0x464F = 0x8461
-0x4650 = 0x83E9
-0x4651 = 0x84B2
-0x4652 = 0x57D4
-0x4653 = 0x6734
-0x4654 = 0x5703
-0x4655 = 0x666E
-0x4656 = 0x6D66
-0x4657 = 0x8C31
-0x4658 = 0x66DD
-0x4659 = 0x7011
-0x465A = 0x671F
-0x465B = 0x6B3A
-0x465C = 0x6816
-0x465D = 0x621A
-0x465E = 0x59BB
-0x465F = 0x4E03
-0x4660 = 0x51C4
-0x4661 = 0x6F06
-0x4662 = 0x67D2
-0x4663 = 0x6C8F
-0x4664 = 0x5176
-0x4665 = 0x68CB
-0x4666 = 0x5947
-0x4667 = 0x6B67
-0x4668 = 0x7566
-0x4669 = 0x5D0E
-0x466A = 0x8110
-0x466B = 0x9F50
-0x466C = 0x65D7
-0x466D = 0x7948
-0x466E = 0x7941
-0x466F = 0x9A91
-0x4670 = 0x8D77
-0x4671 = 0x5C82
-0x4672 = 0x4E5E
-0x4673 = 0x4F01
-0x4674 = 0x542F
-0x4675 = 0x5951
-0x4676 = 0x780C
-0x4677 = 0x5668
-0x4678 = 0x6C14
-0x4679 = 0x8FC4
-0x467A = 0x5F03
-0x467B = 0x6C7D
-0x467C = 0x6CE3
-0x467D = 0x8BAB
-0x467E = 0x6390
-0x4721 = 0x6070
-0x4722 = 0x6D3D
-0x4723 = 0x7275
-0x4724 = 0x6266
-0x4725 = 0x948E
-0x4726 = 0x94C5
-0x4727 = 0x5343
-0x4728 = 0x8FC1
-0x4729 = 0x7B7E
-0x472A = 0x4EDF
-0x472B = 0x8C26
-0x472C = 0x4E7E
-0x472D = 0x9ED4
-0x472E = 0x94B1
-0x472F = 0x94B3
-0x4730 = 0x524D
-0x4731 = 0x6F5C
-0x4732 = 0x9063
-0x4733 = 0x6D45
-0x4734 = 0x8C34
-0x4735 = 0x5811
-0x4736 = 0x5D4C
-0x4737 = 0x6B20
-0x4738 = 0x6B49
-0x4739 = 0x67AA
-0x473A = 0x545B
-0x473B = 0x8154
-0x473C = 0x7F8C
-0x473D = 0x5899
-0x473E = 0x8537
-0x473F = 0x5F3A
-0x4740 = 0x62A2
-0x4741 = 0x6A47
-0x4742 = 0x9539
-0x4743 = 0x6572
-0x4744 = 0x6084
-0x4745 = 0x6865
-0x4746 = 0x77A7
-0x4747 = 0x4E54
-0x4748 = 0x4FA8
-0x4749 = 0x5DE7
-0x474A = 0x9798
-0x474B = 0x64AC
-0x474C = 0x7FD8
-0x474D = 0x5CED
-0x474E = 0x4FCF
-0x474F = 0x7A8D
-0x4750 = 0x5207
-0x4751 = 0x8304
-0x4752 = 0x4E14
-0x4753 = 0x602F
-0x4754 = 0x7A83
-0x4755 = 0x94A6
-0x4756 = 0x4FB5
-0x4757 = 0x4EB2
-0x4758 = 0x79E6
-0x4759 = 0x7434
-0x475A = 0x52E4
-0x475B = 0x82B9
-0x475C = 0x64D2
-0x475D = 0x79BD
-0x475E = 0x5BDD
-0x475F = 0x6C81
-0x4760 = 0x9752
-0x4761 = 0x8F7B
-0x4762 = 0x6C22
-0x4763 = 0x503E
-0x4764 = 0x537F
-0x4765 = 0x6E05
-0x4766 = 0x64CE
-0x4767 = 0x6674
-0x4768 = 0x6C30
-0x4769 = 0x60C5
-0x476A = 0x9877
-0x476B = 0x8BF7
-0x476C = 0x5E86
-0x476D = 0x743C
-0x476E = 0x7A77
-0x476F = 0x79CB
-0x4770 = 0x4E18
-0x4771 = 0x90B1
-0x4772 = 0x7403
-0x4773 = 0x6C42
-0x4774 = 0x56DA
-0x4775 = 0x914B
-0x4776 = 0x6CC5
-0x4777 = 0x8D8B
-0x4778 = 0x533A
-0x4779 = 0x86C6
-0x477A = 0x66F2
-0x477B = 0x8EAF
-0x477C = 0x5C48
-0x477D = 0x9A71
-0x477E = 0x6E20
-0x4821 = 0x53D6
-0x4822 = 0x5A36
-0x4823 = 0x9F8B
-0x4824 = 0x8DA3
-0x4825 = 0x53BB
-0x4826 = 0x5708
-0x4827 = 0x98A7
-0x4828 = 0x6743
-0x4829 = 0x919B
-0x482A = 0x6CC9
-0x482B = 0x5168
-0x482C = 0x75CA
-0x482D = 0x62F3
-0x482E = 0x72AC
-0x482F = 0x5238
-0x4830 = 0x529D
-0x4831 = 0x7F3A
-0x4832 = 0x7094
-0x4833 = 0x7638
-0x4834 = 0x5374
-0x4835 = 0x9E4A
-0x4836 = 0x69B7
-0x4837 = 0x786E
-0x4838 = 0x96C0
-0x4839 = 0x88D9
-0x483A = 0x7FA4
-0x483B = 0x7136
-0x483C = 0x71C3
-0x483D = 0x5189
-0x483E = 0x67D3
-0x483F = 0x74E4
-0x4840 = 0x58E4
-0x4841 = 0x6518
-0x4842 = 0x56B7
-0x4843 = 0x8BA9
-0x4844 = 0x9976
-0x4845 = 0x6270
-0x4846 = 0x7ED5
-0x4847 = 0x60F9
-0x4848 = 0x70ED
-0x4849 = 0x58EC
-0x484A = 0x4EC1
-0x484B = 0x4EBA
-0x484C = 0x5FCD
-0x484D = 0x97E7
-0x484E = 0x4EFB
-0x484F = 0x8BA4
-0x4850 = 0x5203
-0x4851 = 0x598A
-0x4852 = 0x7EAB
-0x4853 = 0x6254
-0x4854 = 0x4ECD
-0x4855 = 0x65E5
-0x4856 = 0x620E
-0x4857 = 0x8338
-0x4858 = 0x84C9
-0x4859 = 0x8363
-0x485A = 0x878D
-0x485B = 0x7194
-0x485C = 0x6EB6
-0x485D = 0x5BB9
-0x485E = 0x7ED2
-0x485F = 0x5197
-0x4860 = 0x63C9
-0x4861 = 0x67D4
-0x4862 = 0x8089
-0x4863 = 0x8339
-0x4864 = 0x8815
-0x4865 = 0x5112
-0x4866 = 0x5B7A
-0x4867 = 0x5982
-0x4868 = 0x8FB1
-0x4869 = 0x4E73
-0x486A = 0x6C5D
-0x486B = 0x5165
-0x486C = 0x8925
-0x486D = 0x8F6F
-0x486E = 0x962E
-0x486F = 0x854A
-0x4870 = 0x745E
-0x4871 = 0x9510
-0x4872 = 0x95F0
-0x4873 = 0x6DA6
-0x4874 = 0x82E5
-0x4875 = 0x5F31
-0x4876 = 0x6492
-0x4877 = 0x6D12
-0x4878 = 0x8428
-0x4879 = 0x816E
-0x487A = 0x9CC3
-0x487B = 0x585E
-0x487C = 0x8D5B
-0x487D = 0x4E09
-0x487E = 0x53C1
-0x4921 = 0x4F1E
-0x4922 = 0x6563
-0x4923 = 0x6851
-0x4924 = 0x55D3
-0x4925 = 0x4E27
-0x4926 = 0x6414
-0x4927 = 0x9A9A
-0x4928 = 0x626B
-0x4929 = 0x5AC2
-0x492A = 0x745F
-0x492B = 0x8272
-0x492C = 0x6DA9
-0x492D = 0x68EE
-0x492E = 0x50E7
-0x492F = 0x838E
-0x4930 = 0x7802
-0x4931 = 0x6740
-0x4932 = 0x5239
-0x4933 = 0x6C99
-0x4934 = 0x7EB1
-0x4935 = 0x50BB
-0x4936 = 0x5565
-0x4937 = 0x715E
-0x4938 = 0x7B5B
-0x4939 = 0x6652
-0x493A = 0x73CA
-0x493B = 0x82EB
-0x493C = 0x6749
-0x493D = 0x5C71
-0x493E = 0x5220
-0x493F = 0x717D
-0x4940 = 0x886B
-0x4941 = 0x95EA
-0x4942 = 0x9655
-0x4943 = 0x64C5
-0x4944 = 0x8D61
-0x4945 = 0x81B3
-0x4946 = 0x5584
-0x4947 = 0x6C55
-0x4948 = 0x6247
-0x4949 = 0x7F2E
-0x494A = 0x5892
-0x494B = 0x4F24
-0x494C = 0x5546
-0x494D = 0x8D4F
-0x494E = 0x664C
-0x494F = 0x4E0A
-0x4950 = 0x5C1A
-0x4951 = 0x88F3
-0x4952 = 0x68A2
-0x4953 = 0x634E
-0x4954 = 0x7A0D
-0x4955 = 0x70E7
-0x4956 = 0x828D
-0x4957 = 0x52FA
-0x4958 = 0x97F6
-0x4959 = 0x5C11
-0x495A = 0x54E8
-0x495B = 0x90B5
-0x495C = 0x7ECD
-0x495D = 0x5962
-0x495E = 0x8D4A
-0x495F = 0x86C7
-0x4960 = 0x820C
-0x4961 = 0x820D
-0x4962 = 0x8D66
-0x4963 = 0x6444
-0x4964 = 0x5C04
-0x4965 = 0x6151
-0x4966 = 0x6D89
-0x4967 = 0x793E
-0x4968 = 0x8BBE
-0x4969 = 0x7837
-0x496A = 0x7533
-0x496B = 0x547B
-0x496C = 0x4F38
-0x496D = 0x8EAB
-0x496E = 0x6DF1
-0x496F = 0x5A20
-0x4970 = 0x7EC5
-0x4971 = 0x795E
-0x4972 = 0x6C88
-0x4973 = 0x5BA1
-0x4974 = 0x5A76
-0x4975 = 0x751A
-0x4976 = 0x80BE
-0x4977 = 0x614E
-0x4978 = 0x6E17
-0x4979 = 0x58F0
-0x497A = 0x751F
-0x497B = 0x7525
-0x497C = 0x7272
-0x497D = 0x5347
-0x497E = 0x7EF3
-0x4A21 = 0x7701
-0x4A22 = 0x76DB
-0x4A23 = 0x5269
-0x4A24 = 0x80DC
-0x4A25 = 0x5723
-0x4A26 = 0x5E08
-0x4A27 = 0x5931
-0x4A28 = 0x72EE
-0x4A29 = 0x65BD
-0x4A2A = 0x6E7F
-0x4A2B = 0x8BD7
-0x4A2C = 0x5C38
-0x4A2D = 0x8671
-0x4A2E = 0x5341
-0x4A2F = 0x77F3
-0x4A30 = 0x62FE
-0x4A31 = 0x65F6
-0x4A32 = 0x4EC0
-0x4A33 = 0x98DF
-0x4A34 = 0x8680
-0x4A35 = 0x5B9E
-0x4A36 = 0x8BC6
-0x4A37 = 0x53F2
-0x4A38 = 0x77E2
-0x4A39 = 0x4F7F
-0x4A3A = 0x5C4E
-0x4A3B = 0x9A76
-0x4A3C = 0x59CB
-0x4A3D = 0x5F0F
-0x4A3E = 0x793A
-0x4A3F = 0x58EB
-0x4A40 = 0x4E16
-0x4A41 = 0x67FF
-0x4A42 = 0x4E8B
-0x4A43 = 0x62ED
-0x4A44 = 0x8A93
-0x4A45 = 0x901D
-0x4A46 = 0x52BF
-0x4A47 = 0x662F
-0x4A48 = 0x55DC
-0x4A49 = 0x566C
-0x4A4A = 0x9002
-0x4A4B = 0x4ED5
-0x4A4C = 0x4F8D
-0x4A4D = 0x91CA
-0x4A4E = 0x9970
-0x4A4F = 0x6C0F
-0x4A50 = 0x5E02
-0x4A51 = 0x6043
-0x4A52 = 0x5BA4
-0x4A53 = 0x89C6
-0x4A54 = 0x8BD5
-0x4A55 = 0x6536
-0x4A56 = 0x624B
-0x4A57 = 0x9996
-0x4A58 = 0x5B88
-0x4A59 = 0x5BFF
-0x4A5A = 0x6388
-0x4A5B = 0x552E
-0x4A5C = 0x53D7
-0x4A5D = 0x7626
-0x4A5E = 0x517D
-0x4A5F = 0x852C
-0x4A60 = 0x67A2
-0x4A61 = 0x68B3
-0x4A62 = 0x6B8A
-0x4A63 = 0x6292
-0x4A64 = 0x8F93
-0x4A65 = 0x53D4
-0x4A66 = 0x8212
-0x4A67 = 0x6DD1
-0x4A68 = 0x758F
-0x4A69 = 0x4E66
-0x4A6A = 0x8D4E
-0x4A6B = 0x5B70
-0x4A6C = 0x719F
-0x4A6D = 0x85AF
-0x4A6E = 0x6691
-0x4A6F = 0x66D9
-0x4A70 = 0x7F72
-0x4A71 = 0x8700
-0x4A72 = 0x9ECD
-0x4A73 = 0x9F20
-0x4A74 = 0x5C5E
-0x4A75 = 0x672F
-0x4A76 = 0x8FF0
-0x4A77 = 0x6811
-0x4A78 = 0x675F
-0x4A79 = 0x620D
-0x4A7A = 0x7AD6
-0x4A7B = 0x5885
-0x4A7C = 0x5EB6
-0x4A7D = 0x6570
-0x4A7E = 0x6F31
-0x4B21 = 0x6055
-0x4B22 = 0x5237
-0x4B23 = 0x800D
-0x4B24 = 0x6454
-0x4B25 = 0x8870
-0x4B26 = 0x7529
-0x4B27 = 0x5E05
-0x4B28 = 0x6813
-0x4B29 = 0x62F4
-0x4B2A = 0x971C
-0x4B2B = 0x53CC
-0x4B2C = 0x723D
-0x4B2D = 0x8C01
-0x4B2E = 0x6C34
-0x4B2F = 0x7761
-0x4B30 = 0x7A0E
-0x4B31 = 0x542E
-0x4B32 = 0x77AC
-0x4B33 = 0x987A
-0x4B34 = 0x821C
-0x4B35 = 0x8BF4
-0x4B36 = 0x7855
-0x4B37 = 0x6714
-0x4B38 = 0x70C1
-0x4B39 = 0x65AF
-0x4B3A = 0x6495
-0x4B3B = 0x5636
-0x4B3C = 0x601D
-0x4B3D = 0x79C1
-0x4B3E = 0x53F8
-0x4B3F = 0x4E1D
-0x4B40 = 0x6B7B
-0x4B41 = 0x8086
-0x4B42 = 0x5BFA
-0x4B43 = 0x55E3
-0x4B44 = 0x56DB
-0x4B45 = 0x4F3A
-0x4B46 = 0x4F3C
-0x4B47 = 0x9972
-0x4B48 = 0x5DF3
-0x4B49 = 0x677E
-0x4B4A = 0x8038
-0x4B4B = 0x6002
-0x4B4C = 0x9882
-0x4B4D = 0x9001
-0x4B4E = 0x5B8B
-0x4B4F = 0x8BBC
-0x4B50 = 0x8BF5
-0x4B51 = 0x641C
-0x4B52 = 0x8258
-0x4B53 = 0x64DE
-0x4B54 = 0x55FD
-0x4B55 = 0x82CF
-0x4B56 = 0x9165
-0x4B57 = 0x4FD7
-0x4B58 = 0x7D20
-0x4B59 = 0x901F
-0x4B5A = 0x7C9F
-0x4B5B = 0x50F3
-0x4B5C = 0x5851
-0x4B5D = 0x6EAF
-0x4B5E = 0x5BBF
-0x4B5F = 0x8BC9
-0x4B60 = 0x8083
-0x4B61 = 0x9178
-0x4B62 = 0x849C
-0x4B63 = 0x7B97
-0x4B64 = 0x867D
-0x4B65 = 0x968B
-0x4B66 = 0x968F
-0x4B67 = 0x7EE5
-0x4B68 = 0x9AD3
-0x4B69 = 0x788E
-0x4B6A = 0x5C81
-0x4B6B = 0x7A57
-0x4B6C = 0x9042
-0x4B6D = 0x96A7
-0x4B6E = 0x795F
-0x4B6F = 0x5B59
-0x4B70 = 0x635F
-0x4B71 = 0x7B0B
-0x4B72 = 0x84D1
-0x4B73 = 0x68AD
-0x4B74 = 0x5506
-0x4B75 = 0x7F29
-0x4B76 = 0x7410
-0x4B77 = 0x7D22
-0x4B78 = 0x9501
-0x4B79 = 0x6240
-0x4B7A = 0x584C
-0x4B7B = 0x4ED6
-0x4B7C = 0x5B83
-0x4B7D = 0x5979
-0x4B7E = 0x5854
-0x4C21 = 0x736D
-0x4C22 = 0x631E
-0x4C23 = 0x8E4B
-0x4C24 = 0x8E0F
-0x4C25 = 0x80CE
-0x4C26 = 0x82D4
-0x4C27 = 0x62AC
-0x4C28 = 0x53F0
-0x4C29 = 0x6CF0
-0x4C2A = 0x915E
-0x4C2B = 0x592A
-0x4C2C = 0x6001
-0x4C2D = 0x6C70
-0x4C2E = 0x574D
-0x4C2F = 0x644A
-0x4C30 = 0x8D2A
-0x4C31 = 0x762B
-0x4C32 = 0x6EE9
-0x4C33 = 0x575B
-0x4C34 = 0x6A80
-0x4C35 = 0x75F0
-0x4C36 = 0x6F6D
-0x4C37 = 0x8C2D
-0x4C38 = 0x8C08
-0x4C39 = 0x5766
-0x4C3A = 0x6BEF
-0x4C3B = 0x8892
-0x4C3C = 0x78B3
-0x4C3D = 0x63A2
-0x4C3E = 0x53F9
-0x4C3F = 0x70AD
-0x4C40 = 0x6C64
-0x4C41 = 0x5858
-0x4C42 = 0x642A
-0x4C43 = 0x5802
-0x4C44 = 0x68E0
-0x4C45 = 0x819B
-0x4C46 = 0x5510
-0x4C47 = 0x7CD6
-0x4C48 = 0x5018
-0x4C49 = 0x8EBA
-0x4C4A = 0x6DCC
-0x4C4B = 0x8D9F
-0x4C4C = 0x70EB
-0x4C4D = 0x638F
-0x4C4E = 0x6D9B
-0x4C4F = 0x6ED4
-0x4C50 = 0x7EE6
-0x4C51 = 0x8404
-0x4C52 = 0x6843
-0x4C53 = 0x9003
-0x4C54 = 0x6DD8
-0x4C55 = 0x9676
-0x4C56 = 0x8BA8
-0x4C57 = 0x5957
-0x4C58 = 0x7279
-0x4C59 = 0x85E4
-0x4C5A = 0x817E
-0x4C5B = 0x75BC
-0x4C5C = 0x8A8A
-0x4C5D = 0x68AF
-0x4C5E = 0x5254
-0x4C5F = 0x8E22
-0x4C60 = 0x9511
-0x4C61 = 0x63D0
-0x4C62 = 0x9898
-0x4C63 = 0x8E44
-0x4C64 = 0x557C
-0x4C65 = 0x4F53
-0x4C66 = 0x66FF
-0x4C67 = 0x568F
-0x4C68 = 0x60D5
-0x4C69 = 0x6D95
-0x4C6A = 0x5243
-0x4C6B = 0x5C49
-0x4C6C = 0x5929
-0x4C6D = 0x6DFB
-0x4C6E = 0x586B
-0x4C6F = 0x7530
-0x4C70 = 0x751C
-0x4C71 = 0x606C
-0x4C72 = 0x8214
-0x4C73 = 0x8146
-0x4C74 = 0x6311
-0x4C75 = 0x6761
-0x4C76 = 0x8FE2
-0x4C77 = 0x773A
-0x4C78 = 0x8DF3
-0x4C79 = 0x8D34
-0x4C7A = 0x94C1
-0x4C7B = 0x5E16
-0x4C7C = 0x5385
-0x4C7D = 0x542C
-0x4C7E = 0x70C3
-0x4D21 = 0x6C40
-0x4D22 = 0x5EF7
-0x4D23 = 0x505C
-0x4D24 = 0x4EAD
-0x4D25 = 0x5EAD
-0x4D26 = 0x633A
-0x4D27 = 0x8247
-0x4D28 = 0x901A
-0x4D29 = 0x6850
-0x4D2A = 0x916E
-0x4D2B = 0x77B3
-0x4D2C = 0x540C
-0x4D2D = 0x94DC
-0x4D2E = 0x5F64
-0x4D2F = 0x7AE5
-0x4D30 = 0x6876
-0x4D31 = 0x6345
-0x4D32 = 0x7B52
-0x4D33 = 0x7EDF
-0x4D34 = 0x75DB
-0x4D35 = 0x5077
-0x4D36 = 0x6295
-0x4D37 = 0x5934
-0x4D38 = 0x900F
-0x4D39 = 0x51F8
-0x4D3A = 0x79C3
-0x4D3B = 0x7A81
-0x4D3C = 0x56FE
-0x4D3D = 0x5F92
-0x4D3E = 0x9014
-0x4D3F = 0x6D82
-0x4D40 = 0x5C60
-0x4D41 = 0x571F
-0x4D42 = 0x5410
-0x4D43 = 0x5154
-0x4D44 = 0x6E4D
-0x4D45 = 0x56E2
-0x4D46 = 0x63A8
-0x4D47 = 0x9893
-0x4D48 = 0x817F
-0x4D49 = 0x8715
-0x4D4A = 0x892A
-0x4D4B = 0x9000
-0x4D4C = 0x541E
-0x4D4D = 0x5C6F
-0x4D4E = 0x81C0
-0x4D4F = 0x62D6
-0x4D50 = 0x6258
-0x4D51 = 0x8131
-0x4D52 = 0x9E35
-0x4D53 = 0x9640
-0x4D54 = 0x9A6E
-0x4D55 = 0x9A7C
-0x4D56 = 0x692D
-0x4D57 = 0x59A5
-0x4D58 = 0x62D3
-0x4D59 = 0x553E
-0x4D5A = 0x6316
-0x4D5B = 0x54C7
-0x4D5C = 0x86D9
-0x4D5D = 0x6D3C
-0x4D5E = 0x5A03
-0x4D5F = 0x74E6
-0x4D60 = 0x889C
-0x4D61 = 0x6B6A
-0x4D62 = 0x5916
-0x4D63 = 0x8C4C
-0x4D64 = 0x5F2F
-0x4D65 = 0x6E7E
-0x4D66 = 0x73A9
-0x4D67 = 0x987D
-0x4D68 = 0x4E38
-0x4D69 = 0x70F7
-0x4D6A = 0x5B8C
-0x4D6B = 0x7897
-0x4D6C = 0x633D
-0x4D6D = 0x665A
-0x4D6E = 0x7696
-0x4D6F = 0x60CB
-0x4D70 = 0x5B9B
-0x4D71 = 0x5A49
-0x4D72 = 0x4E07
-0x4D73 = 0x8155
-0x4D74 = 0x6C6A
-0x4D75 = 0x738B
-0x4D76 = 0x4EA1
-0x4D77 = 0x6789
-0x4D78 = 0x7F51
-0x4D79 = 0x5F80
-0x4D7A = 0x65FA
-0x4D7B = 0x671B
-0x4D7C = 0x5FD8
-0x4D7D = 0x5984
-0x4D7E = 0x5A01
-0x4E21 = 0x5DCD
-0x4E22 = 0x5FAE
-0x4E23 = 0x5371
-0x4E24 = 0x97E6
-0x4E25 = 0x8FDD
-0x4E26 = 0x6845
-0x4E27 = 0x56F4
-0x4E28 = 0x552F
-0x4E29 = 0x60DF
-0x4E2A = 0x4E3A
-0x4E2B = 0x6F4D
-0x4E2C = 0x7EF4
-0x4E2D = 0x82C7
-0x4E2E = 0x840E
-0x4E2F = 0x59D4
-0x4E30 = 0x4F1F
-0x4E31 = 0x4F2A
-0x4E32 = 0x5C3E
-0x4E33 = 0x7EAC
-0x4E34 = 0x672A
-0x4E35 = 0x851A
-0x4E36 = 0x5473
-0x4E37 = 0x754F
-0x4E38 = 0x80C3
-0x4E39 = 0x5582
-0x4E3A = 0x9B4F
-0x4E3B = 0x4F4D
-0x4E3C = 0x6E2D
-0x4E3D = 0x8C13
-0x4E3E = 0x5C09
-0x4E3F = 0x6170
-0x4E40 = 0x536B
-0x4E41 = 0x761F
-0x4E42 = 0x6E29
-0x4E43 = 0x868A
-0x4E44 = 0x6587
-0x4E45 = 0x95FB
-0x4E46 = 0x7EB9
-0x4E47 = 0x543B
-0x4E48 = 0x7A33
-0x4E49 = 0x7D0A
-0x4E4A = 0x95EE
-0x4E4B = 0x55E1
-0x4E4C = 0x7FC1
-0x4E4D = 0x74EE
-0x4E4E = 0x631D
-0x4E4F = 0x8717
-0x4E50 = 0x6DA1
-0x4E51 = 0x7A9D
-0x4E52 = 0x6211
-0x4E53 = 0x65A1
-0x4E54 = 0x5367
-0x4E55 = 0x63E1
-0x4E56 = 0x6C83
-0x4E57 = 0x5DEB
-0x4E58 = 0x545C
-0x4E59 = 0x94A8
-0x4E5A = 0x4E4C
-0x4E5B = 0x6C61
-0x4E5C = 0x8BEC
-0x4E5D = 0x5C4B
-0x4E5E = 0x65E0
-0x4E5F = 0x829C
-0x4E60 = 0x68A7
-0x4E61 = 0x543E
-0x4E62 = 0x5434
-0x4E63 = 0x6BCB
-0x4E64 = 0x6B66
-0x4E65 = 0x4E94
-0x4E66 = 0x6342
-0x4E67 = 0x5348
-0x4E68 = 0x821E
-0x4E69 = 0x4F0D
-0x4E6A = 0x4FAE
-0x4E6B = 0x575E
-0x4E6C = 0x620A
-0x4E6D = 0x96FE
-0x4E6E = 0x6664
-0x4E6F = 0x7269
-0x4E70 = 0x52FF
-0x4E71 = 0x52A1
-0x4E72 = 0x609F
-0x4E73 = 0x8BEF
-0x4E74 = 0x6614
-0x4E75 = 0x7199
-0x4E76 = 0x6790
-0x4E77 = 0x897F
-0x4E78 = 0x7852
-0x4E79 = 0x77FD
-0x4E7A = 0x6670
-0x4E7B = 0x563B
-0x4E7C = 0x5438
-0x4E7D = 0x9521
-0x4E7E = 0x727A
-0x4F21 = 0x7A00
-0x4F22 = 0x606F
-0x4F23 = 0x5E0C
-0x4F24 = 0x6089
-0x4F25 = 0x819D
-0x4F26 = 0x5915
-0x4F27 = 0x60DC
-0x4F28 = 0x7184
-0x4F29 = 0x70EF
-0x4F2A = 0x6EAA
-0x4F2B = 0x6C50
-0x4F2C = 0x7280
-0x4F2D = 0x6A84
-0x4F2E = 0x88AD
-0x4F2F = 0x5E2D
-0x4F30 = 0x4E60
-0x4F31 = 0x5AB3
-0x4F32 = 0x559C
-0x4F33 = 0x94E3
-0x4F34 = 0x6D17
-0x4F35 = 0x7CFB
-0x4F36 = 0x9699
-0x4F37 = 0x620F
-0x4F38 = 0x7EC6
-0x4F39 = 0x778E
-0x4F3A = 0x867E
-0x4F3B = 0x5323
-0x4F3C = 0x971E
-0x4F3D = 0x8F96
-0x4F3E = 0x6687
-0x4F3F = 0x5CE1
-0x4F40 = 0x4FA0
-0x4F41 = 0x72ED
-0x4F42 = 0x4E0B
-0x4F43 = 0x53A6
-0x4F44 = 0x590F
-0x4F45 = 0x5413
-0x4F46 = 0x6380
-0x4F47 = 0x9528
-0x4F48 = 0x5148
-0x4F49 = 0x4ED9
-0x4F4A = 0x9C9C
-0x4F4B = 0x7EA4
-0x4F4C = 0x54B8
-0x4F4D = 0x8D24
-0x4F4E = 0x8854
-0x4F4F = 0x8237
-0x4F50 = 0x95F2
-0x4F51 = 0x6D8E
-0x4F52 = 0x5F26
-0x4F53 = 0x5ACC
-0x4F54 = 0x663E
-0x4F55 = 0x9669
-0x4F56 = 0x73B0
-0x4F57 = 0x732E
-0x4F58 = 0x53BF
-0x4F59 = 0x817A
-0x4F5A = 0x9985
-0x4F5B = 0x7FA1
-0x4F5C = 0x5BAA
-0x4F5D = 0x9677
-0x4F5E = 0x9650
-0x4F5F = 0x7EBF
-0x4F60 = 0x76F8
-0x4F61 = 0x53A2
-0x4F62 = 0x9576
-0x4F63 = 0x9999
-0x4F64 = 0x7BB1
-0x4F65 = 0x8944
-0x4F66 = 0x6E58
-0x4F67 = 0x4E61
-0x4F68 = 0x7FD4
-0x4F69 = 0x7965
-0x4F6A = 0x8BE6
-0x4F6B = 0x60F3
-0x4F6C = 0x54CD
-0x4F6D = 0x4EAB
-0x4F6E = 0x9879
-0x4F6F = 0x5DF7
-0x4F70 = 0x6A61
-0x4F71 = 0x50CF
-0x4F72 = 0x5411
-0x4F73 = 0x8C61
-0x4F74 = 0x8427
-0x4F75 = 0x785D
-0x4F76 = 0x9704
-0x4F77 = 0x524A
-0x4F78 = 0x54EE
-0x4F79 = 0x56A3
-0x4F7A = 0x9500
-0x4F7B = 0x6D88
-0x4F7C = 0x5BB5
-0x4F7D = 0x6DC6
-0x4F7E = 0x6653
-0x5021 = 0x5C0F
-0x5022 = 0x5B5D
-0x5023 = 0x6821
-0x5024 = 0x8096
-0x5025 = 0x5578
-0x5026 = 0x7B11
-0x5027 = 0x6548
-0x5028 = 0x6954
-0x5029 = 0x4E9B
-0x502A = 0x6B47
-0x502B = 0x874E
-0x502C = 0x978B
-0x502D = 0x534F
-0x502E = 0x631F
-0x502F = 0x643A
-0x5030 = 0x90AA
-0x5031 = 0x659C
-0x5032 = 0x80C1
-0x5033 = 0x8C10
-0x5034 = 0x5199
-0x5035 = 0x68B0
-0x5036 = 0x5378
-0x5037 = 0x87F9
-0x5038 = 0x61C8
-0x5039 = 0x6CC4
-0x503A = 0x6CFB
-0x503B = 0x8C22
-0x503C = 0x5C51
-0x503D = 0x85AA
-0x503E = 0x82AF
-0x503F = 0x950C
-0x5040 = 0x6B23
-0x5041 = 0x8F9B
-0x5042 = 0x65B0
-0x5043 = 0x5FFB
-0x5044 = 0x5FC3
-0x5045 = 0x4FE1
-0x5046 = 0x8845
-0x5047 = 0x661F
-0x5048 = 0x8165
-0x5049 = 0x7329
-0x504A = 0x60FA
-0x504B = 0x5174
-0x504C = 0x5211
-0x504D = 0x578B
-0x504E = 0x5F62
-0x504F = 0x90A2
-0x5050 = 0x884C
-0x5051 = 0x9192
-0x5052 = 0x5E78
-0x5053 = 0x674F
-0x5054 = 0x6027
-0x5055 = 0x59D3
-0x5056 = 0x5144
-0x5057 = 0x51F6
-0x5058 = 0x80F8
-0x5059 = 0x5308
-0x505A = 0x6C79
-0x505B = 0x96C4
-0x505C = 0x718A
-0x505D = 0x4F11
-0x505E = 0x4FEE
-0x505F = 0x7F9E
-0x5060 = 0x673D
-0x5061 = 0x55C5
-0x5062 = 0x9508
-0x5063 = 0x79C0
-0x5064 = 0x8896
-0x5065 = 0x7EE3
-0x5066 = 0x589F
-0x5067 = 0x620C
-0x5068 = 0x9700
-0x5069 = 0x865A
-0x506A = 0x5618
-0x506B = 0x987B
-0x506C = 0x5F90
-0x506D = 0x8BB8
-0x506E = 0x84C4
-0x506F = 0x9157
-0x5070 = 0x53D9
-0x5071 = 0x65ED
-0x5072 = 0x5E8F
-0x5073 = 0x755C
-0x5074 = 0x6064
-0x5075 = 0x7D6E
-0x5076 = 0x5A7F
-0x5077 = 0x7EEA
-0x5078 = 0x7EED
-0x5079 = 0x8F69
-0x507A = 0x55A7
-0x507B = 0x5BA3
-0x507C = 0x60AC
-0x507D = 0x65CB
-0x507E = 0x7384
-0x5121 = 0x9009
-0x5122 = 0x7663
-0x5123 = 0x7729
-0x5124 = 0x7EDA
-0x5125 = 0x9774
-0x5126 = 0x859B
-0x5127 = 0x5B66
-0x5128 = 0x7A74
-0x5129 = 0x96EA
-0x512A = 0x8840
-0x512B = 0x52CB
-0x512C = 0x718F
-0x512D = 0x5FAA
-0x512E = 0x65EC
-0x512F = 0x8BE2
-0x5130 = 0x5BFB
-0x5131 = 0x9A6F
-0x5132 = 0x5DE1
-0x5133 = 0x6B89
-0x5134 = 0x6C5B
-0x5135 = 0x8BAD
-0x5136 = 0x8BAF
-0x5137 = 0x900A
-0x5138 = 0x8FC5
-0x5139 = 0x538B
-0x513A = 0x62BC
-0x513B = 0x9E26
-0x513C = 0x9E2D
-0x513D = 0x5440
-0x513E = 0x4E2B
-0x513F = 0x82BD
-0x5140 = 0x7259
-0x5141 = 0x869C
-0x5142 = 0x5D16
-0x5143 = 0x8859
-0x5144 = 0x6DAF
-0x5145 = 0x96C5
-0x5146 = 0x54D1
-0x5147 = 0x4E9A
-0x5148 = 0x8BB6
-0x5149 = 0x7109
-0x514A = 0x54BD
-0x514B = 0x9609
-0x514C = 0x70DF
-0x514D = 0x6DF9
-0x514E = 0x76D0
-0x514F = 0x4E25
-0x5150 = 0x7814
-0x5151 = 0x8712
-0x5152 = 0x5CA9
-0x5153 = 0x5EF6
-0x5154 = 0x8A00
-0x5155 = 0x989C
-0x5156 = 0x960E
-0x5157 = 0x708E
-0x5158 = 0x6CBF
-0x5159 = 0x5944
-0x515A = 0x63A9
-0x515B = 0x773C
-0x515C = 0x884D
-0x515D = 0x6F14
-0x515E = 0x8273
-0x515F = 0x5830
-0x5160 = 0x71D5
-0x5161 = 0x538C
-0x5162 = 0x781A
-0x5163 = 0x96C1
-0x5164 = 0x5501
-0x5165 = 0x5F66
-0x5166 = 0x7130
-0x5167 = 0x5BB4
-0x5168 = 0x8C1A
-0x5169 = 0x9A8C
-0x516A = 0x6B83
-0x516B = 0x592E
-0x516C = 0x9E2F
-0x516D = 0x79E7
-0x516E = 0x6768
-0x516F = 0x626C
-0x5170 = 0x4F6F
-0x5171 = 0x75A1
-0x5172 = 0x7F8A
-0x5173 = 0x6D0B
-0x5174 = 0x9633
-0x5175 = 0x6C27
-0x5176 = 0x4EF0
-0x5177 = 0x75D2
-0x5178 = 0x517B
-0x5179 = 0x6837
-0x517A = 0x6F3E
-0x517B = 0x9080
-0x517C = 0x8170
-0x517D = 0x5996
-0x517E = 0x7476
-0x5221 = 0x6447
-0x5222 = 0x5C27
-0x5223 = 0x9065
-0x5224 = 0x7A91
-0x5225 = 0x8C23
-0x5226 = 0x59DA
-0x5227 = 0x54AC
-0x5228 = 0x8200
-0x5229 = 0x836F
-0x522A = 0x8981
-0x522B = 0x8000
-0x522C = 0x6930
-0x522D = 0x564E
-0x522E = 0x8036
-0x522F = 0x7237
-0x5230 = 0x91CE
-0x5231 = 0x51B6
-0x5232 = 0x4E5F
-0x5233 = 0x9875
-0x5234 = 0x6396
-0x5235 = 0x4E1A
-0x5236 = 0x53F6
-0x5237 = 0x66F3
-0x5238 = 0x814B
-0x5239 = 0x591C
-0x523A = 0x6DB2
-0x523B = 0x4E00
-0x523C = 0x58F9
-0x523D = 0x533B
-0x523E = 0x63D6
-0x523F = 0x94F1
-0x5240 = 0x4F9D
-0x5241 = 0x4F0A
-0x5242 = 0x8863
-0x5243 = 0x9890
-0x5244 = 0x5937
-0x5245 = 0x9057
-0x5246 = 0x79FB
-0x5247 = 0x4EEA
-0x5248 = 0x80F0
-0x5249 = 0x7591
-0x524A = 0x6C82
-0x524B = 0x5B9C
-0x524C = 0x59E8
-0x524D = 0x5F5D
-0x524E = 0x6905
-0x524F = 0x8681
-0x5250 = 0x501A
-0x5251 = 0x5DF2
-0x5252 = 0x4E59
-0x5253 = 0x77E3
-0x5254 = 0x4EE5
-0x5255 = 0x827A
-0x5256 = 0x6291
-0x5257 = 0x6613
-0x5258 = 0x9091
-0x5259 = 0x5C79
-0x525A = 0x4EBF
-0x525B = 0x5F79
-0x525C = 0x81C6
-0x525D = 0x9038
-0x525E = 0x8084
-0x525F = 0x75AB
-0x5260 = 0x4EA6
-0x5261 = 0x88D4
-0x5262 = 0x610F
-0x5263 = 0x6BC5
-0x5264 = 0x5FC6
-0x5265 = 0x4E49
-0x5266 = 0x76CA
-0x5267 = 0x6EA2
-0x5268 = 0x8BE3
-0x5269 = 0x8BAE
-0x526A = 0x8C0A
-0x526B = 0x8BD1
-0x526C = 0x5F02
-0x526D = 0x7FFC
-0x526E = 0x7FCC
-0x526F = 0x7ECE
-0x5270 = 0x8335
-0x5271 = 0x836B
-0x5272 = 0x56E0
-0x5273 = 0x6BB7
-0x5274 = 0x97F3
-0x5275 = 0x9634
-0x5276 = 0x59FB
-0x5277 = 0x541F
-0x5278 = 0x94F6
-0x5279 = 0x6DEB
-0x527A = 0x5BC5
-0x527B = 0x996E
-0x527C = 0x5C39
-0x527D = 0x5F15
-0x527E = 0x9690
-0x5321 = 0x5370
-0x5322 = 0x82F1
-0x5323 = 0x6A31
-0x5324 = 0x5A74
-0x5325 = 0x9E70
-0x5326 = 0x5E94
-0x5327 = 0x7F28
-0x5328 = 0x83B9
-0x5329 = 0x8424
-0x532A = 0x8425
-0x532B = 0x8367
-0x532C = 0x8747
-0x532D = 0x8FCE
-0x532E = 0x8D62
-0x532F = 0x76C8
-0x5330 = 0x5F71
-0x5331 = 0x9896
-0x5332 = 0x786C
-0x5333 = 0x6620
-0x5334 = 0x54DF
-0x5335 = 0x62E5
-0x5336 = 0x4F63
-0x5337 = 0x81C3
-0x5338 = 0x75C8
-0x5339 = 0x5EB8
-0x533A = 0x96CD
-0x533B = 0x8E0A
-0x533C = 0x86F9
-0x533D = 0x548F
-0x533E = 0x6CF3
-0x533F = 0x6D8C
-0x5340 = 0x6C38
-0x5341 = 0x607F
-0x5342 = 0x52C7
-0x5343 = 0x7528
-0x5344 = 0x5E7D
-0x5345 = 0x4F18
-0x5346 = 0x60A0
-0x5347 = 0x5FE7
-0x5348 = 0x5C24
-0x5349 = 0x7531
-0x534A = 0x90AE
-0x534B = 0x94C0
-0x534C = 0x72B9
-0x534D = 0x6CB9
-0x534E = 0x6E38
-0x534F = 0x9149
-0x5350 = 0x6709
-0x5351 = 0x53CB
-0x5352 = 0x53F3
-0x5353 = 0x4F51
-0x5354 = 0x91C9
-0x5355 = 0x8BF1
-0x5356 = 0x53C8
-0x5357 = 0x5E7C
-0x5358 = 0x8FC2
-0x5359 = 0x6DE4
-0x535A = 0x4E8E
-0x535B = 0x76C2
-0x535C = 0x6986
-0x535D = 0x865E
-0x535E = 0x611A
-0x535F = 0x8206
-0x5360 = 0x4F59
-0x5361 = 0x4FDE
-0x5362 = 0x903E
-0x5363 = 0x9C7C
-0x5364 = 0x6109
-0x5365 = 0x6E1D
-0x5366 = 0x6E14
-0x5367 = 0x9685
-0x5368 = 0x4E88
-0x5369 = 0x5A31
-0x536A = 0x96E8
-0x536B = 0x4E0E
-0x536C = 0x5C7F
-0x536D = 0x79B9
-0x536E = 0x5B87
-0x536F = 0x8BED
-0x5370 = 0x7FBD
-0x5371 = 0x7389
-0x5372 = 0x57DF
-0x5373 = 0x828B
-0x5374 = 0x90C1
-0x5375 = 0x5401
-0x5376 = 0x9047
-0x5377 = 0x55BB
-0x5378 = 0x5CEA
-0x5379 = 0x5FA1
-0x537A = 0x6108
-0x537B = 0x6B32
-0x537C = 0x72F1
-0x537D = 0x80B2
-0x537E = 0x8A89
-0x5421 = 0x6D74
-0x5422 = 0x5BD3
-0x5423 = 0x88D5
-0x5424 = 0x9884
-0x5425 = 0x8C6B
-0x5426 = 0x9A6D
-0x5427 = 0x9E33
-0x5428 = 0x6E0A
-0x5429 = 0x51A4
-0x542A = 0x5143
-0x542B = 0x57A3
-0x542C = 0x8881
-0x542D = 0x539F
-0x542E = 0x63F4
-0x542F = 0x8F95
-0x5430 = 0x56ED
-0x5431 = 0x5458
-0x5432 = 0x5706
-0x5433 = 0x733F
-0x5434 = 0x6E90
-0x5435 = 0x7F18
-0x5436 = 0x8FDC
-0x5437 = 0x82D1
-0x5438 = 0x613F
-0x5439 = 0x6028
-0x543A = 0x9662
-0x543B = 0x66F0
-0x543C = 0x7EA6
-0x543D = 0x8D8A
-0x543E = 0x8DC3
-0x543F = 0x94A5
-0x5440 = 0x5CB3
-0x5441 = 0x7CA4
-0x5442 = 0x6708
-0x5443 = 0x60A6
-0x5444 = 0x9605
-0x5445 = 0x8018
-0x5446 = 0x4E91
-0x5447 = 0x90E7
-0x5448 = 0x5300
-0x5449 = 0x9668
-0x544A = 0x5141
-0x544B = 0x8FD0
-0x544C = 0x8574
-0x544D = 0x915D
-0x544E = 0x6655
-0x544F = 0x97F5
-0x5450 = 0x5B55
-0x5451 = 0x531D
-0x5452 = 0x7838
-0x5453 = 0x6742
-0x5454 = 0x683D
-0x5455 = 0x54C9
-0x5456 = 0x707E
-0x5457 = 0x5BB0
-0x5458 = 0x8F7D
-0x5459 = 0x518D
-0x545A = 0x5728
-0x545B = 0x54B1
-0x545C = 0x6512
-0x545D = 0x6682
-0x545E = 0x8D5E
-0x545F = 0x8D43
-0x5460 = 0x810F
-0x5461 = 0x846C
-0x5462 = 0x906D
-0x5463 = 0x7CDF
-0x5464 = 0x51FF
-0x5465 = 0x85FB
-0x5466 = 0x67A3
-0x5467 = 0x65E9
-0x5468 = 0x6FA1
-0x5469 = 0x86A4
-0x546A = 0x8E81
-0x546B = 0x566A
-0x546C = 0x9020
-0x546D = 0x7682
-0x546E = 0x7076
-0x546F = 0x71E5
-0x5470 = 0x8D23
-0x5471 = 0x62E9
-0x5472 = 0x5219
-0x5473 = 0x6CFD
-0x5474 = 0x8D3C
-0x5475 = 0x600E
-0x5476 = 0x589E
-0x5477 = 0x618E
-0x5478 = 0x66FE
-0x5479 = 0x8D60
-0x547A = 0x624E
-0x547B = 0x55B3
-0x547C = 0x6E23
-0x547D = 0x672D
-0x547E = 0x8F67
-0x5521 = 0x94E1
-0x5522 = 0x95F8
-0x5523 = 0x7728
-0x5524 = 0x6805
-0x5525 = 0x69A8
-0x5526 = 0x548B
-0x5527 = 0x4E4D
-0x5528 = 0x70B8
-0x5529 = 0x8BC8
-0x552A = 0x6458
-0x552B = 0x658B
-0x552C = 0x5B85
-0x552D = 0x7A84
-0x552E = 0x503A
-0x552F = 0x5BE8
-0x5530 = 0x77BB
-0x5531 = 0x6BE1
-0x5532 = 0x8A79
-0x5533 = 0x7C98
-0x5534 = 0x6CBE
-0x5535 = 0x76CF
-0x5536 = 0x65A9
-0x5537 = 0x8F97
-0x5538 = 0x5D2D
-0x5539 = 0x5C55
-0x553A = 0x8638
-0x553B = 0x6808
-0x553C = 0x5360
-0x553D = 0x6218
-0x553E = 0x7AD9
-0x553F = 0x6E5B
-0x5540 = 0x7EFD
-0x5541 = 0x6A1F
-0x5542 = 0x7AE0
-0x5543 = 0x5F70
-0x5544 = 0x6F33
-0x5545 = 0x5F20
-0x5546 = 0x638C
-0x5547 = 0x6DA8
-0x5548 = 0x6756
-0x5549 = 0x4E08
-0x554A = 0x5E10
-0x554B = 0x8D26
-0x554C = 0x4ED7
-0x554D = 0x80C0
-0x554E = 0x7634
-0x554F = 0x969C
-0x5550 = 0x62DB
-0x5551 = 0x662D
-0x5552 = 0x627E
-0x5553 = 0x6CBC
-0x5554 = 0x8D75
-0x5555 = 0x7167
-0x5556 = 0x7F69
-0x5557 = 0x5146
-0x5558 = 0x8087
-0x5559 = 0x53EC
-0x555A = 0x906E
-0x555B = 0x6298
-0x555C = 0x54F2
-0x555D = 0x86F0
-0x555E = 0x8F99
-0x555F = 0x8005
-0x5560 = 0x9517
-0x5561 = 0x8517
-0x5562 = 0x8FD9
-0x5563 = 0x6D59
-0x5564 = 0x73CD
-0x5565 = 0x659F
-0x5566 = 0x771F
-0x5567 = 0x7504
-0x5568 = 0x7827
-0x5569 = 0x81FB
-0x556A = 0x8D1E
-0x556B = 0x9488
-0x556C = 0x4FA6
-0x556D = 0x6795
-0x556E = 0x75B9
-0x556F = 0x8BCA
-0x5570 = 0x9707
-0x5571 = 0x632F
-0x5572 = 0x9547
-0x5573 = 0x9635
-0x5574 = 0x84B8
-0x5575 = 0x6323
-0x5576 = 0x7741
-0x5577 = 0x5F81
-0x5578 = 0x72F0
-0x5579 = 0x4E89
-0x557A = 0x6014
-0x557B = 0x6574
-0x557C = 0x62EF
-0x557D = 0x6B63
-0x557E = 0x653F
-0x5621 = 0x5E27
-0x5622 = 0x75C7
-0x5623 = 0x90D1
-0x5624 = 0x8BC1
-0x5625 = 0x829D
-0x5626 = 0x679D
-0x5627 = 0x652F
-0x5628 = 0x5431
-0x5629 = 0x8718
-0x562A = 0x77E5
-0x562B = 0x80A2
-0x562C = 0x8102
-0x562D = 0x6C41
-0x562E = 0x4E4B
-0x562F = 0x7EC7
-0x5630 = 0x804C
-0x5631 = 0x76F4
-0x5632 = 0x690D
-0x5633 = 0x6B96
-0x5634 = 0x6267
-0x5635 = 0x503C
-0x5636 = 0x4F84
-0x5637 = 0x5740
-0x5638 = 0x6307
-0x5639 = 0x6B62
-0x563A = 0x8DBE
-0x563B = 0x53EA
-0x563C = 0x65E8
-0x563D = 0x7EB8
-0x563E = 0x5FD7
-0x563F = 0x631A
-0x5640 = 0x63B7
-0x5641 = 0x81F3
-0x5642 = 0x81F4
-0x5643 = 0x7F6E
-0x5644 = 0x5E1C
-0x5645 = 0x5CD9
-0x5646 = 0x5236
-0x5647 = 0x667A
-0x5648 = 0x79E9
-0x5649 = 0x7A1A
-0x564A = 0x8D28
-0x564B = 0x7099
-0x564C = 0x75D4
-0x564D = 0x6EDE
-0x564E = 0x6CBB
-0x564F = 0x7A92
-0x5650 = 0x4E2D
-0x5651 = 0x76C5
-0x5652 = 0x5FE0
-0x5653 = 0x949F
-0x5654 = 0x8877
-0x5655 = 0x7EC8
-0x5656 = 0x79CD
-0x5657 = 0x80BF
-0x5658 = 0x91CD
-0x5659 = 0x4EF2
-0x565A = 0x4F17
-0x565B = 0x821F
-0x565C = 0x5468
-0x565D = 0x5DDE
-0x565E = 0x6D32
-0x565F = 0x8BCC
-0x5660 = 0x7CA5
-0x5661 = 0x8F74
-0x5662 = 0x8098
-0x5663 = 0x5E1A
-0x5664 = 0x5492
-0x5665 = 0x76B1
-0x5666 = 0x5B99
-0x5667 = 0x663C
-0x5668 = 0x9AA4
-0x5669 = 0x73E0
-0x566A = 0x682A
-0x566B = 0x86DB
-0x566C = 0x6731
-0x566D = 0x732A
-0x566E = 0x8BF8
-0x566F = 0x8BDB
-0x5670 = 0x9010
-0x5671 = 0x7AF9
-0x5672 = 0x70DB
-0x5673 = 0x716E
-0x5674 = 0x62C4
-0x5675 = 0x77A9
-0x5676 = 0x5631
-0x5677 = 0x4E3B
-0x5678 = 0x8457
-0x5679 = 0x67F1
-0x567A = 0x52A9
-0x567B = 0x86C0
-0x567C = 0x8D2E
-0x567D = 0x94F8
-0x567E = 0x7B51
-0x5721 = 0x4F4F
-0x5722 = 0x6CE8
-0x5723 = 0x795D
-0x5724 = 0x9A7B
-0x5725 = 0x6293
-0x5726 = 0x722A
-0x5727 = 0x62FD
-0x5728 = 0x4E13
-0x5729 = 0x7816
-0x572A = 0x8F6C
-0x572B = 0x64B0
-0x572C = 0x8D5A
-0x572D = 0x7BC6
-0x572E = 0x6869
-0x572F = 0x5E84
-0x5730 = 0x88C5
-0x5731 = 0x5986
-0x5732 = 0x649E
-0x5733 = 0x58EE
-0x5734 = 0x72B6
-0x5735 = 0x690E
-0x5736 = 0x9525
-0x5737 = 0x8FFD
-0x5738 = 0x8D58
-0x5739 = 0x5760
-0x573A = 0x7F00
-0x573B = 0x8C06
-0x573C = 0x51C6
-0x573D = 0x6349
-0x573E = 0x62D9
-0x573F = 0x5353
-0x5740 = 0x684C
-0x5741 = 0x7422
-0x5742 = 0x8301
-0x5743 = 0x914C
-0x5744 = 0x5544
-0x5745 = 0x7740
-0x5746 = 0x707C
-0x5747 = 0x6D4A
-0x5748 = 0x5179
-0x5749 = 0x54A8
-0x574A = 0x8D44
-0x574B = 0x59FF
-0x574C = 0x6ECB
-0x574D = 0x6DC4
-0x574E = 0x5B5C
-0x574F = 0x7D2B
-0x5750 = 0x4ED4
-0x5751 = 0x7C7D
-0x5752 = 0x6ED3
-0x5753 = 0x5B50
-0x5754 = 0x81EA
-0x5755 = 0x6E0D
-0x5756 = 0x5B57
-0x5757 = 0x9B03
-0x5758 = 0x68D5
-0x5759 = 0x8E2A
-0x575A = 0x5B97
-0x575B = 0x7EFC
-0x575C = 0x603B
-0x575D = 0x7EB5
-0x575E = 0x90B9
-0x575F = 0x8D70
-0x5760 = 0x594F
-0x5761 = 0x63CD
-0x5762 = 0x79DF
-0x5763 = 0x8DB3
-0x5764 = 0x5352
-0x5765 = 0x65CF
-0x5766 = 0x7956
-0x5767 = 0x8BC5
-0x5768 = 0x963B
-0x5769 = 0x7EC4
-0x576A = 0x94BB
-0x576B = 0x7E82
-0x576C = 0x5634
-0x576D = 0x9189
-0x576E = 0x6700
-0x576F = 0x7F6A
-0x5770 = 0x5C0A
-0x5771 = 0x9075
-0x5772 = 0x6628
-0x5773 = 0x5DE6
-0x5774 = 0x4F50
-0x5775 = 0x67DE
-0x5776 = 0x505A
-0x5777 = 0x4F5C
-0x5778 = 0x5750
-0x5779 = 0x5EA7
-
-# GBK2 / GB2312 plane2
-0x5821 = 0x4E8D
-0x5822 = 0x4E0C
-0x5823 = 0x5140
-0x5824 = 0x4E10
-0x5825 = 0x5EFF
-0x5826 = 0x5345
-0x5827 = 0x4E15
-0x5828 = 0x4E98
-0x5829 = 0x4E1E
-0x582A = 0x9B32
-0x582B = 0x5B6C
-0x582C = 0x5669
-0x582D = 0x4E28
-0x582E = 0x79BA
-0x582F = 0x4E3F
-0x5830 = 0x5315
-0x5831 = 0x4E47
-0x5832 = 0x592D
-0x5833 = 0x723B
-0x5834 = 0x536E
-0x5835 = 0x6C10
-0x5836 = 0x56DF
-0x5837 = 0x80E4
-0x5838 = 0x9997
-0x5839 = 0x6BD3
-0x583A = 0x777E
-0x583B = 0x9F17
-0x583C = 0x4E36
-0x583D = 0x4E9F
-0x583E = 0x9F10
-0x583F = 0x4E5C
-0x5840 = 0x4E69
-0x5841 = 0x4E93
-0x5842 = 0x8288
-0x5843 = 0x5B5B
-0x5844 = 0x556C
-0x5845 = 0x560F
-0x5846 = 0x4EC4
-0x5847 = 0x538D
-0x5848 = 0x539D
-0x5849 = 0x53A3
-0x584A = 0x53A5
-0x584B = 0x53AE
-0x584C = 0x9765
-0x584D = 0x8D5D
-0x584E = 0x531A
-0x584F = 0x53F5
-0x5850 = 0x5326
-0x5851 = 0x532E
-0x5852 = 0x533E
-0x5853 = 0x8D5C
-0x5854 = 0x5366
-0x5855 = 0x5363
-0x5856 = 0x5202
-0x5857 = 0x5208
-0x5858 = 0x520E
-0x5859 = 0x522D
-0x585A = 0x5233
-0x585B = 0x523F
-0x585C = 0x5240
-0x585D = 0x524C
-0x585E = 0x525E
-0x585F = 0x5261
-0x5860 = 0x525C
-0x5861 = 0x84AF
-0x5862 = 0x527D
-0x5863 = 0x5282
-0x5864 = 0x5281
-0x5865 = 0x5290
-0x5866 = 0x5293
-0x5867 = 0x5182
-0x5868 = 0x7F54
-0x5869 = 0x4EBB
-0x586A = 0x4EC3
-0x586B = 0x4EC9
-0x586C = 0x4EC2
-0x586D = 0x4EE8
-0x586E = 0x4EE1
-0x586F = 0x4EEB
-0x5870 = 0x4EDE
-0x5871 = 0x4F1B
-0x5872 = 0x4EF3
-0x5873 = 0x4F22
-0x5874 = 0x4F64
-0x5875 = 0x4EF5
-0x5876 = 0x4F25
-0x5877 = 0x4F27
-0x5878 = 0x4F09
-0x5879 = 0x4F2B
-0x587A = 0x4F5E
-0x587B = 0x4F67
-0x587C = 0x6538
-0x587D = 0x4F5A
-0x587E = 0x4F5D
-0x5921 = 0x4F5F
-0x5922 = 0x4F57
-0x5923 = 0x4F32
-0x5924 = 0x4F3D
-0x5925 = 0x4F76
-0x5926 = 0x4F74
-0x5927 = 0x4F91
-0x5928 = 0x4F89
-0x5929 = 0x4F83
-0x592A = 0x4F8F
-0x592B = 0x4F7E
-0x592C = 0x4F7B
-0x592D = 0x4FAA
-0x592E = 0x4F7C
-0x592F = 0x4FAC
-0x5930 = 0x4F94
-0x5931 = 0x4FE6
-0x5932 = 0x4FE8
-0x5933 = 0x4FEA
-0x5934 = 0x4FC5
-0x5935 = 0x4FDA
-0x5936 = 0x4FE3
-0x5937 = 0x4FDC
-0x5938 = 0x4FD1
-0x5939 = 0x4FDF
-0x593A = 0x4FF8
-0x593B = 0x5029
-0x593C = 0x504C
-0x593D = 0x4FF3
-0x593E = 0x502C
-0x593F = 0x500F
-0x5940 = 0x502E
-0x5941 = 0x502D
-0x5942 = 0x4FFE
-0x5943 = 0x501C
-0x5944 = 0x500C
-0x5945 = 0x5025
-0x5946 = 0x5028
-0x5947 = 0x507E
-0x5948 = 0x5043
-0x5949 = 0x5055
-0x594A = 0x5048
-0x594B = 0x504E
-0x594C = 0x506C
-0x594D = 0x507B
-0x594E = 0x50A5
-0x594F = 0x50A7
-0x5950 = 0x50A9
-0x5951 = 0x50BA
-0x5952 = 0x50D6
-0x5953 = 0x5106
-0x5954 = 0x50ED
-0x5955 = 0x50EC
-0x5956 = 0x50E6
-0x5957 = 0x50EE
-0x5958 = 0x5107
-0x5959 = 0x510B
-0x595A = 0x4EDD
-0x595B = 0x6C3D
-0x595C = 0x4F58
-0x595D = 0x4F65
-0x595E = 0x4FCE
-0x595F = 0x9FA0
-0x5960 = 0x6C46
-0x5961 = 0x7C74
-0x5962 = 0x516E
-0x5963 = 0x5DFD
-0x5964 = 0x9EC9
-0x5965 = 0x9998
-0x5966 = 0x5181
-0x5967 = 0x5914
-0x5968 = 0x52F9
-0x5969 = 0x530D
-0x596A = 0x8A07
-0x596B = 0x5310
-0x596C = 0x51EB
-0x596D = 0x5919
-0x596E = 0x5155
-0x596F = 0x4EA0
-0x5970 = 0x5156
-0x5971 = 0x4EB3
-0x5972 = 0x886E
-0x5973 = 0x88A4
-0x5974 = 0x4EB5
-0x5975 = 0x8114
-0x5976 = 0x88D2
-0x5977 = 0x7980
-0x5978 = 0x5B34
-0x5979 = 0x8803
-0x597A = 0x7FB8
-0x597B = 0x51AB
-0x597C = 0x51B1
-0x597D = 0x51BD
-0x597E = 0x51BC
-0x5A21 = 0x51C7
-0x5A22 = 0x5196
-0x5A23 = 0x51A2
-0x5A24 = 0x51A5
-0x5A25 = 0x8BA0
-0x5A26 = 0x8BA6
-0x5A27 = 0x8BA7
-0x5A28 = 0x8BAA
-0x5A29 = 0x8BB4
-0x5A2A = 0x8BB5
-0x5A2B = 0x8BB7
-0x5A2C = 0x8BC2
-0x5A2D = 0x8BC3
-0x5A2E = 0x8BCB
-0x5A2F = 0x8BCF
-0x5A30 = 0x8BCE
-0x5A31 = 0x8BD2
-0x5A32 = 0x8BD3
-0x5A33 = 0x8BD4
-0x5A34 = 0x8BD6
-0x5A35 = 0x8BD8
-0x5A36 = 0x8BD9
-0x5A37 = 0x8BDC
-0x5A38 = 0x8BDF
-0x5A39 = 0x8BE0
-0x5A3A = 0x8BE4
-0x5A3B = 0x8BE8
-0x5A3C = 0x8BE9
-0x5A3D = 0x8BEE
-0x5A3E = 0x8BF0
-0x5A3F = 0x8BF3
-0x5A40 = 0x8BF6
-0x5A41 = 0x8BF9
-0x5A42 = 0x8BFC
-0x5A43 = 0x8BFF
-0x5A44 = 0x8C00
-0x5A45 = 0x8C02
-0x5A46 = 0x8C04
-0x5A47 = 0x8C07
-0x5A48 = 0x8C0C
-0x5A49 = 0x8C0F
-0x5A4A = 0x8C11
-0x5A4B = 0x8C12
-0x5A4C = 0x8C14
-0x5A4D = 0x8C15
-0x5A4E = 0x8C16
-0x5A4F = 0x8C19
-0x5A50 = 0x8C1B
-0x5A51 = 0x8C18
-0x5A52 = 0x8C1D
-0x5A53 = 0x8C1F
-0x5A54 = 0x8C20
-0x5A55 = 0x8C21
-0x5A56 = 0x8C25
-0x5A57 = 0x8C27
-0x5A58 = 0x8C2A
-0x5A59 = 0x8C2B
-0x5A5A = 0x8C2E
-0x5A5B = 0x8C2F
-0x5A5C = 0x8C32
-0x5A5D = 0x8C33
-0x5A5E = 0x8C35
-0x5A5F = 0x8C36
-0x5A60 = 0x5369
-0x5A61 = 0x537A
-0x5A62 = 0x961D
-0x5A63 = 0x9622
-0x5A64 = 0x9621
-0x5A65 = 0x9631
-0x5A66 = 0x962A
-0x5A67 = 0x963D
-0x5A68 = 0x963C
-0x5A69 = 0x9642
-0x5A6A = 0x9649
-0x5A6B = 0x9654
-0x5A6C = 0x965F
-0x5A6D = 0x9667
-0x5A6E = 0x966C
-0x5A6F = 0x9672
-0x5A70 = 0x9674
-0x5A71 = 0x9688
-0x5A72 = 0x968D
-0x5A73 = 0x9697
-0x5A74 = 0x96B0
-0x5A75 = 0x9097
-0x5A76 = 0x909B
-0x5A77 = 0x909D
-0x5A78 = 0x9099
-0x5A79 = 0x90AC
-0x5A7A = 0x90A1
-0x5A7B = 0x90B4
-0x5A7C = 0x90B3
-0x5A7D = 0x90B6
-0x5A7E = 0x90BA
-0x5B21 = 0x90B8
-0x5B22 = 0x90B0
-0x5B23 = 0x90CF
-0x5B24 = 0x90C5
-0x5B25 = 0x90BE
-0x5B26 = 0x90D0
-0x5B27 = 0x90C4
-0x5B28 = 0x90C7
-0x5B29 = 0x90D3
-0x5B2A = 0x90E6
-0x5B2B = 0x90E2
-0x5B2C = 0x90DC
-0x5B2D = 0x90D7
-0x5B2E = 0x90DB
-0x5B2F = 0x90EB
-0x5B30 = 0x90EF
-0x5B31 = 0x90FE
-0x5B32 = 0x9104
-0x5B33 = 0x9122
-0x5B34 = 0x911E
-0x5B35 = 0x9123
-0x5B36 = 0x9131
-0x5B37 = 0x912F
-0x5B38 = 0x9139
-0x5B39 = 0x9143
-0x5B3A = 0x9146
-0x5B3B = 0x520D
-0x5B3C = 0x5942
-0x5B3D = 0x52A2
-0x5B3E = 0x52AC
-0x5B3F = 0x52AD
-0x5B40 = 0x52BE
-0x5B41 = 0x54FF
-0x5B42 = 0x52D0
-0x5B43 = 0x52D6
-0x5B44 = 0x52F0
-0x5B45 = 0x53DF
-0x5B46 = 0x71EE
-0x5B47 = 0x77CD
-0x5B48 = 0x5EF4
-0x5B49 = 0x51F5
-0x5B4A = 0x51FC
-0x5B4B = 0x9B2F
-0x5B4C = 0x53B6
-0x5B4D = 0x5F01
-0x5B4E = 0x755A
-0x5B4F = 0x5DEF
-0x5B50 = 0x574C
-0x5B51 = 0x57A9
-0x5B52 = 0x57A1
-0x5B53 = 0x587E
-0x5B54 = 0x58BC
-0x5B55 = 0x58C5
-0x5B56 = 0x58D1
-0x5B57 = 0x5729
-0x5B58 = 0x572C
-0x5B59 = 0x572A
-0x5B5A = 0x5733
-0x5B5B = 0x5739
-0x5B5C = 0x572E
-0x5B5D = 0x572F
-0x5B5E = 0x575C
-0x5B5F = 0x573B
-0x5B60 = 0x5742
-0x5B61 = 0x5769
-0x5B62 = 0x5785
-0x5B63 = 0x576B
-0x5B64 = 0x5786
-0x5B65 = 0x577C
-0x5B66 = 0x577B
-0x5B67 = 0x5768
-0x5B68 = 0x576D
-0x5B69 = 0x5776
-0x5B6A = 0x5773
-0x5B6B = 0x57AD
-0x5B6C = 0x57A4
-0x5B6D = 0x578C
-0x5B6E = 0x57B2
-0x5B6F = 0x57CF
-0x5B70 = 0x57A7
-0x5B71 = 0x57B4
-0x5B72 = 0x5793
-0x5B73 = 0x57A0
-0x5B74 = 0x57D5
-0x5B75 = 0x57D8
-0x5B76 = 0x57DA
-0x5B77 = 0x57D9
-0x5B78 = 0x57D2
-0x5B79 = 0x57B8
-0x5B7A = 0x57F4
-0x5B7B = 0x57EF
-0x5B7C = 0x57F8
-0x5B7D = 0x57E4
-0x5B7E = 0x57DD
-0x5C21 = 0x580B
-0x5C22 = 0x580D
-0x5C23 = 0x57FD
-0x5C24 = 0x57ED
-0x5C25 = 0x5800
-0x5C26 = 0x581E
-0x5C27 = 0x5819
-0x5C28 = 0x5844
-0x5C29 = 0x5820
-0x5C2A = 0x5865
-0x5C2B = 0x586C
-0x5C2C = 0x5881
-0x5C2D = 0x5889
-0x5C2E = 0x589A
-0x5C2F = 0x5880
-0x5C30 = 0x99A8
-0x5C31 = 0x9F19
-0x5C32 = 0x61FF
-0x5C33 = 0x8279
-0x5C34 = 0x827D
-0x5C35 = 0x827F
-0x5C36 = 0x828F
-0x5C37 = 0x828A
-0x5C38 = 0x82A8
-0x5C39 = 0x8284
-0x5C3A = 0x828E
-0x5C3B = 0x8291
-0x5C3C = 0x8297
-0x5C3D = 0x8299
-0x5C3E = 0x82AB
-0x5C3F = 0x82B8
-0x5C40 = 0x82BE
-0x5C41 = 0x82B0
-0x5C42 = 0x82C8
-0x5C43 = 0x82CA
-0x5C44 = 0x82E3
-0x5C45 = 0x8298
-0x5C46 = 0x82B7
-0x5C47 = 0x82AE
-0x5C48 = 0x82CB
-0x5C49 = 0x82CC
-0x5C4A = 0x82C1
-0x5C4B = 0x82A9
-0x5C4C = 0x82B4
-0x5C4D = 0x82A1
-0x5C4E = 0x82AA
-0x5C4F = 0x829F
-0x5C50 = 0x82C4
-0x5C51 = 0x82CE
-0x5C52 = 0x82A4
-0x5C53 = 0x82E1
-0x5C54 = 0x8309
-0x5C55 = 0x82F7
-0x5C56 = 0x82E4
-0x5C57 = 0x830F
-0x5C58 = 0x8307
-0x5C59 = 0x82DC
-0x5C5A = 0x82F4
-0x5C5B = 0x82D2
-0x5C5C = 0x82D8
-0x5C5D = 0x830C
-0x5C5E = 0x82FB
-0x5C5F = 0x82D3
-0x5C60 = 0x8311
-0x5C61 = 0x831A
-0x5C62 = 0x8306
-0x5C63 = 0x8314
-0x5C64 = 0x8315
-0x5C65 = 0x82E0
-0x5C66 = 0x82D5
-0x5C67 = 0x831C
-0x5C68 = 0x8351
-0x5C69 = 0x835B
-0x5C6A = 0x835C
-0x5C6B = 0x8308
-0x5C6C = 0x8392
-0x5C6D = 0x833C
-0x5C6E = 0x8334
-0x5C6F = 0x8331
-0x5C70 = 0x839B
-0x5C71 = 0x835E
-0x5C72 = 0x832F
-0x5C73 = 0x834F
-0x5C74 = 0x8347
-0x5C75 = 0x8343
-0x5C76 = 0x835F
-0x5C77 = 0x8340
-0x5C78 = 0x8317
-0x5C79 = 0x8360
-0x5C7A = 0x832D
-0x5C7B = 0x833A
-0x5C7C = 0x8333
-0x5C7D = 0x8366
-0x5C7E = 0x8365
-0x5D21 = 0x8368
-0x5D22 = 0x831B
-0x5D23 = 0x8369
-0x5D24 = 0x836C
-0x5D25 = 0x836A
-0x5D26 = 0x836D
-0x5D27 = 0x836E
-0x5D28 = 0x83B0
-0x5D29 = 0x8378
-0x5D2A = 0x83B3
-0x5D2B = 0x83B4
-0x5D2C = 0x83A0
-0x5D2D = 0x83AA
-0x5D2E = 0x8393
-0x5D2F = 0x839C
-0x5D30 = 0x8385
-0x5D31 = 0x837C
-0x5D32 = 0x83B6
-0x5D33 = 0x83A9
-0x5D34 = 0x837D
-0x5D35 = 0x83B8
-0x5D36 = 0x837B
-0x5D37 = 0x8398
-0x5D38 = 0x839E
-0x5D39 = 0x83A8
-0x5D3A = 0x83BA
-0x5D3B = 0x83BC
-0x5D3C = 0x83C1
-0x5D3D = 0x8401
-0x5D3E = 0x83E5
-0x5D3F = 0x83D8
-0x5D40 = 0x5807
-0x5D41 = 0x8418
-0x5D42 = 0x840B
-0x5D43 = 0x83DD
-0x5D44 = 0x83FD
-0x5D45 = 0x83D6
-0x5D46 = 0x841C
-0x5D47 = 0x8438
-0x5D48 = 0x8411
-0x5D49 = 0x8406
-0x5D4A = 0x83D4
-0x5D4B = 0x83DF
-0x5D4C = 0x840F
-0x5D4D = 0x8403
-0x5D4E = 0x83F8
-0x5D4F = 0x83F9
-0x5D50 = 0x83EA
-0x5D51 = 0x83C5
-0x5D52 = 0x83C0
-0x5D53 = 0x8426
-0x5D54 = 0x83F0
-0x5D55 = 0x83E1
-0x5D56 = 0x845C
-0x5D57 = 0x8451
-0x5D58 = 0x845A
-0x5D59 = 0x8459
-0x5D5A = 0x8473
-0x5D5B = 0x8487
-0x5D5C = 0x8488
-0x5D5D = 0x847A
-0x5D5E = 0x8489
-0x5D5F = 0x8478
-0x5D60 = 0x843C
-0x5D61 = 0x8446
-0x5D62 = 0x8469
-0x5D63 = 0x8476
-0x5D64 = 0x848C
-0x5D65 = 0x848E
-0x5D66 = 0x8431
-0x5D67 = 0x846D
-0x5D68 = 0x84C1
-0x5D69 = 0x84CD
-0x5D6A = 0x84D0
-0x5D6B = 0x84E6
-0x5D6C = 0x84BD
-0x5D6D = 0x84D3
-0x5D6E = 0x84CA
-0x5D6F = 0x84BF
-0x5D70 = 0x84BA
-0x5D71 = 0x84E0
-0x5D72 = 0x84A1
-0x5D73 = 0x84B9
-0x5D74 = 0x84B4
-0x5D75 = 0x8497
-0x5D76 = 0x84E5
-0x5D77 = 0x84E3
-0x5D78 = 0x850C
-0x5D79 = 0x750D
-0x5D7A = 0x8538
-0x5D7B = 0x84F0
-0x5D7C = 0x8539
-0x5D7D = 0x851F
-0x5D7E = 0x853A
-0x5E21 = 0x8556
-0x5E22 = 0x853B
-0x5E23 = 0x84FF
-0x5E24 = 0x84FC
-0x5E25 = 0x8559
-0x5E26 = 0x8548
-0x5E27 = 0x8568
-0x5E28 = 0x8564
-0x5E29 = 0x855E
-0x5E2A = 0x857A
-0x5E2B = 0x77A2
-0x5E2C = 0x8543
-0x5E2D = 0x8572
-0x5E2E = 0x857B
-0x5E2F = 0x85A4
-0x5E30 = 0x85A8
-0x5E31 = 0x8587
-0x5E32 = 0x858F
-0x5E33 = 0x8579
-0x5E34 = 0x85AE
-0x5E35 = 0x859C
-0x5E36 = 0x8585
-0x5E37 = 0x85B9
-0x5E38 = 0x85B7
-0x5E39 = 0x85B0
-0x5E3A = 0x85D3
-0x5E3B = 0x85C1
-0x5E3C = 0x85DC
-0x5E3D = 0x85FF
-0x5E3E = 0x8627
-0x5E3F = 0x8605
-0x5E40 = 0x8629
-0x5E41 = 0x8616
-0x5E42 = 0x863C
-0x5E43 = 0x5EFE
-0x5E44 = 0x5F08
-0x5E45 = 0x593C
-0x5E46 = 0x5941
-0x5E47 = 0x8037
-0x5E48 = 0x5955
-0x5E49 = 0x595A
-0x5E4A = 0x5958
-0x5E4B = 0x530F
-0x5E4C = 0x5C22
-0x5E4D = 0x5C25
-0x5E4E = 0x5C2C
-0x5E4F = 0x5C34
-0x5E50 = 0x624C
-0x5E51 = 0x626A
-0x5E52 = 0x629F
-0x5E53 = 0x62BB
-0x5E54 = 0x62CA
-0x5E55 = 0x62DA
-0x5E56 = 0x62D7
-0x5E57 = 0x62EE
-0x5E58 = 0x6322
-0x5E59 = 0x62F6
-0x5E5A = 0x6339
-0x5E5B = 0x634B
-0x5E5C = 0x6343
-0x5E5D = 0x63AD
-0x5E5E = 0x63F6
-0x5E5F = 0x6371
-0x5E60 = 0x637A
-0x5E61 = 0x638E
-0x5E62 = 0x63B4
-0x5E63 = 0x636D
-0x5E64 = 0x63AC
-0x5E65 = 0x638A
-0x5E66 = 0x6369
-0x5E67 = 0x63AE
-0x5E68 = 0x63BC
-0x5E69 = 0x63F2
-0x5E6A = 0x63F8
-0x5E6B = 0x63E0
-0x5E6C = 0x63FF
-0x5E6D = 0x63C4
-0x5E6E = 0x63DE
-0x5E6F = 0x63CE
-0x5E70 = 0x6452
-0x5E71 = 0x63C6
-0x5E72 = 0x63BE
-0x5E73 = 0x6445
-0x5E74 = 0x6441
-0x5E75 = 0x640B
-0x5E76 = 0x641B
-0x5E77 = 0x6420
-0x5E78 = 0x640C
-0x5E79 = 0x6426
-0x5E7A = 0x6421
-0x5E7B = 0x645E
-0x5E7C = 0x6484
-0x5E7D = 0x646D
-0x5E7E = 0x6496
-0x5F21 = 0x647A
-0x5F22 = 0x64B7
-0x5F23 = 0x64B8
-0x5F24 = 0x6499
-0x5F25 = 0x64BA
-0x5F26 = 0x64C0
-0x5F27 = 0x64D0
-0x5F28 = 0x64D7
-0x5F29 = 0x64E4
-0x5F2A = 0x64E2
-0x5F2B = 0x6509
-0x5F2C = 0x6525
-0x5F2D = 0x652E
-0x5F2E = 0x5F0B
-0x5F2F = 0x5FD2
-0x5F30 = 0x7519
-0x5F31 = 0x5F11
-0x5F32 = 0x535F
-0x5F33 = 0x53F1
-0x5F34 = 0x53FD
-0x5F35 = 0x53E9
-0x5F36 = 0x53E8
-0x5F37 = 0x53FB
-0x5F38 = 0x5412
-0x5F39 = 0x5416
-0x5F3A = 0x5406
-0x5F3B = 0x544B
-0x5F3C = 0x5452
-0x5F3D = 0x5453
-0x5F3E = 0x5454
-0x5F3F = 0x5456
-0x5F40 = 0x5443
-0x5F41 = 0x5421
-0x5F42 = 0x5457
-0x5F43 = 0x5459
-0x5F44 = 0x5423
-0x5F45 = 0x5432
-0x5F46 = 0x5482
-0x5F47 = 0x5494
-0x5F48 = 0x5477
-0x5F49 = 0x5471
-0x5F4A = 0x5464
-0x5F4B = 0x549A
-0x5F4C = 0x549B
-0x5F4D = 0x5484
-0x5F4E = 0x5476
-0x5F4F = 0x5466
-0x5F50 = 0x549D
-0x5F51 = 0x54D0
-0x5F52 = 0x54AD
-0x5F53 = 0x54C2
-0x5F54 = 0x54B4
-0x5F55 = 0x54D2
-0x5F56 = 0x54A7
-0x5F57 = 0x54A6
-0x5F58 = 0x54D3
-0x5F59 = 0x54D4
-0x5F5A = 0x5472
-0x5F5B = 0x54A3
-0x5F5C = 0x54D5
-0x5F5D = 0x54BB
-0x5F5E = 0x54BF
-0x5F5F = 0x54CC
-0x5F60 = 0x54D9
-0x5F61 = 0x54DA
-0x5F62 = 0x54DC
-0x5F63 = 0x54A9
-0x5F64 = 0x54AA
-0x5F65 = 0x54A4
-0x5F66 = 0x54DD
-0x5F67 = 0x54CF
-0x5F68 = 0x54DE
-0x5F69 = 0x551B
-0x5F6A = 0x54E7
-0x5F6B = 0x5520
-0x5F6C = 0x54FD
-0x5F6D = 0x5514
-0x5F6E = 0x54F3
-0x5F6F = 0x5522
-0x5F70 = 0x5523
-0x5F71 = 0x550F
-0x5F72 = 0x5511
-0x5F73 = 0x5527
-0x5F74 = 0x552A
-0x5F75 = 0x5567
-0x5F76 = 0x558F
-0x5F77 = 0x55B5
-0x5F78 = 0x5549
-0x5F79 = 0x556D
-0x5F7A = 0x5541
-0x5F7B = 0x5555
-0x5F7C = 0x553F
-0x5F7D = 0x5550
-0x5F7E = 0x553C
-0x6021 = 0x5537
-0x6022 = 0x5556
-0x6023 = 0x5575
-0x6024 = 0x5576
-0x6025 = 0x5577
-0x6026 = 0x5533
-0x6027 = 0x5530
-0x6028 = 0x555C
-0x6029 = 0x558B
-0x602A = 0x55D2
-0x602B = 0x5583
-0x602C = 0x55B1
-0x602D = 0x55B9
-0x602E = 0x5588
-0x602F = 0x5581
-0x6030 = 0x559F
-0x6031 = 0x557E
-0x6032 = 0x55D6
-0x6033 = 0x5591
-0x6034 = 0x557B
-0x6035 = 0x55DF
-0x6036 = 0x55BD
-0x6037 = 0x55BE
-0x6038 = 0x5594
-0x6039 = 0x5599
-0x603A = 0x55EA
-0x603B = 0x55F7
-0x603C = 0x55C9
-0x603D = 0x561F
-0x603E = 0x55D1
-0x603F = 0x55EB
-0x6040 = 0x55EC
-0x6041 = 0x55D4
-0x6042 = 0x55E6
-0x6043 = 0x55DD
-0x6044 = 0x55C4
-0x6045 = 0x55EF
-0x6046 = 0x55E5
-0x6047 = 0x55F2
-0x6048 = 0x55F3
-0x6049 = 0x55CC
-0x604A = 0x55CD
-0x604B = 0x55E8
-0x604C = 0x55F5
-0x604D = 0x55E4
-0x604E = 0x8F94
-0x604F = 0x561E
-0x6050 = 0x5608
-0x6051 = 0x560C
-0x6052 = 0x5601
-0x6053 = 0x5624
-0x6054 = 0x5623
-0x6055 = 0x55FE
-0x6056 = 0x5600
-0x6057 = 0x5627
-0x6058 = 0x562D
-0x6059 = 0x5658
-0x605A = 0x5639
-0x605B = 0x5657
-0x605C = 0x562C
-0x605D = 0x564D
-0x605E = 0x5662
-0x605F = 0x5659
-0x6060 = 0x565C
-0x6061 = 0x564C
-0x6062 = 0x5654
-0x6063 = 0x5686
-0x6064 = 0x5664
-0x6065 = 0x5671
-0x6066 = 0x566B
-0x6067 = 0x567B
-0x6068 = 0x567C
-0x6069 = 0x5685
-0x606A = 0x5693
-0x606B = 0x56AF
-0x606C = 0x56D4
-0x606D = 0x56D7
-0x606E = 0x56DD
-0x606F = 0x56E1
-0x6070 = 0x56F5
-0x6071 = 0x56EB
-0x6072 = 0x56F9
-0x6073 = 0x56FF
-0x6074 = 0x5704
-0x6075 = 0x570A
-0x6076 = 0x5709
-0x6077 = 0x571C
-0x6078 = 0x5E0F
-0x6079 = 0x5E19
-0x607A = 0x5E14
-0x607B = 0x5E11
-0x607C = 0x5E31
-0x607D = 0x5E3B
-0x607E = 0x5E3C
-0x6121 = 0x5E37
-0x6122 = 0x5E44
-0x6123 = 0x5E54
-0x6124 = 0x5E5B
-0x6125 = 0x5E5E
-0x6126 = 0x5E61
-0x6127 = 0x5C8C
-0x6128 = 0x5C7A
-0x6129 = 0x5C8D
-0x612A = 0x5C90
-0x612B = 0x5C96
-0x612C = 0x5C88
-0x612D = 0x5C98
-0x612E = 0x5C99
-0x612F = 0x5C91
-0x6130 = 0x5C9A
-0x6131 = 0x5C9C
-0x6132 = 0x5CB5
-0x6133 = 0x5CA2
-0x6134 = 0x5CBD
-0x6135 = 0x5CAC
-0x6136 = 0x5CAB
-0x6137 = 0x5CB1
-0x6138 = 0x5CA3
-0x6139 = 0x5CC1
-0x613A = 0x5CB7
-0x613B = 0x5CC4
-0x613C = 0x5CD2
-0x613D = 0x5CE4
-0x613E = 0x5CCB
-0x613F = 0x5CE5
-0x6140 = 0x5D02
-0x6141 = 0x5D03
-0x6142 = 0x5D27
-0x6143 = 0x5D26
-0x6144 = 0x5D2E
-0x6145 = 0x5D24
-0x6146 = 0x5D1E
-0x6147 = 0x5D06
-0x6148 = 0x5D1B
-0x6149 = 0x5D58
-0x614A = 0x5D3E
-0x614B = 0x5D34
-0x614C = 0x5D3D
-0x614D = 0x5D6C
-0x614E = 0x5D5B
-0x614F = 0x5D6F
-0x6150 = 0x5D5D
-0x6151 = 0x5D6B
-0x6152 = 0x5D4B
-0x6153 = 0x5D4A
-0x6154 = 0x5D69
-0x6155 = 0x5D74
-0x6156 = 0x5D82
-0x6157 = 0x5D99
-0x6158 = 0x5D9D
-0x6159 = 0x8C73
-0x615A = 0x5DB7
-0x615B = 0x5DC5
-0x615C = 0x5F73
-0x615D = 0x5F77
-0x615E = 0x5F82
-0x615F = 0x5F87
-0x6160 = 0x5F89
-0x6161 = 0x5F8C
-0x6162 = 0x5F95
-0x6163 = 0x5F99
-0x6164 = 0x5F9C
-0x6165 = 0x5FA8
-0x6166 = 0x5FAD
-0x6167 = 0x5FB5
-0x6168 = 0x5FBC
-0x6169 = 0x8862
-0x616A = 0x5F61
-0x616B = 0x72AD
-0x616C = 0x72B0
-0x616D = 0x72B4
-0x616E = 0x72B7
-0x616F = 0x72B8
-0x6170 = 0x72C3
-0x6171 = 0x72C1
-0x6172 = 0x72CE
-0x6173 = 0x72CD
-0x6174 = 0x72D2
-0x6175 = 0x72E8
-0x6176 = 0x72EF
-0x6177 = 0x72E9
-0x6178 = 0x72F2
-0x6179 = 0x72F4
-0x617A = 0x72F7
-0x617B = 0x7301
-0x617C = 0x72F3
-0x617D = 0x7303
-0x617E = 0x72FA
-0x6221 = 0x72FB
-0x6222 = 0x7317
-0x6223 = 0x7313
-0x6224 = 0x7321
-0x6225 = 0x730A
-0x6226 = 0x731E
-0x6227 = 0x731D
-0x6228 = 0x7315
-0x6229 = 0x7322
-0x622A = 0x7339
-0x622B = 0x7325
-0x622C = 0x732C
-0x622D = 0x7338
-0x622E = 0x7331
-0x622F = 0x7350
-0x6230 = 0x734D
-0x6231 = 0x7357
-0x6232 = 0x7360
-0x6233 = 0x736C
-0x6234 = 0x736F
-0x6235 = 0x737E
-0x6236 = 0x821B
-0x6237 = 0x5925
-0x6238 = 0x98E7
-0x6239 = 0x5924
-0x623A = 0x5902
-0x623B = 0x9963
-0x623C = 0x9967
-0x623D = 0x9968
-0x623E = 0x9969
-0x623F = 0x996A
-0x6240 = 0x996B
-0x6241 = 0x996C
-0x6242 = 0x9974
-0x6243 = 0x9977
-0x6244 = 0x997D
-0x6245 = 0x9980
-0x6246 = 0x9984
-0x6247 = 0x9987
-0x6248 = 0x998A
-0x6249 = 0x998D
-0x624A = 0x9990
-0x624B = 0x9991
-0x624C = 0x9993
-0x624D = 0x9994
-0x624E = 0x9995
-0x624F = 0x5E80
-0x6250 = 0x5E91
-0x6251 = 0x5E8B
-0x6252 = 0x5E96
-0x6253 = 0x5EA5
-0x6254 = 0x5EA0
-0x6255 = 0x5EB9
-0x6256 = 0x5EB5
-0x6257 = 0x5EBE
-0x6258 = 0x5EB3
-0x6259 = 0x8D53
-0x625A = 0x5ED2
-0x625B = 0x5ED1
-0x625C = 0x5EDB
-0x625D = 0x5EE8
-0x625E = 0x5EEA
-0x625F = 0x81BA
-0x6260 = 0x5FC4
-0x6261 = 0x5FC9
-0x6262 = 0x5FD6
-0x6263 = 0x5FCF
-0x6264 = 0x6003
-0x6265 = 0x5FEE
-0x6266 = 0x6004
-0x6267 = 0x5FE1
-0x6268 = 0x5FE4
-0x6269 = 0x5FFE
-0x626A = 0x6005
-0x626B = 0x6006
-0x626C = 0x5FEA
-0x626D = 0x5FED
-0x626E = 0x5FF8
-0x626F = 0x6019
-0x6270 = 0x6035
-0x6271 = 0x6026
-0x6272 = 0x601B
-0x6273 = 0x600F
-0x6274 = 0x600D
-0x6275 = 0x6029
-0x6276 = 0x602B
-0x6277 = 0x600A
-0x6278 = 0x603F
-0x6279 = 0x6021
-0x627A = 0x6078
-0x627B = 0x6079
-0x627C = 0x607B
-0x627D = 0x607A
-0x627E = 0x6042
-0x6321 = 0x606A
-0x6322 = 0x607D
-0x6323 = 0x6096
-0x6324 = 0x609A
-0x6325 = 0x60AD
-0x6326 = 0x609D
-0x6327 = 0x6083
-0x6328 = 0x6092
-0x6329 = 0x608C
-0x632A = 0x609B
-0x632B = 0x60EC
-0x632C = 0x60BB
-0x632D = 0x60B1
-0x632E = 0x60DD
-0x632F = 0x60D8
-0x6330 = 0x60C6
-0x6331 = 0x60DA
-0x6332 = 0x60B4
-0x6333 = 0x6120
-0x6334 = 0x6126
-0x6335 = 0x6115
-0x6336 = 0x6123
-0x6337 = 0x60F4
-0x6338 = 0x6100
-0x6339 = 0x610E
-0x633A = 0x612B
-0x633B = 0x614A
-0x633C = 0x6175
-0x633D = 0x61AC
-0x633E = 0x6194
-0x633F = 0x61A7
-0x6340 = 0x61B7
-0x6341 = 0x61D4
-0x6342 = 0x61F5
-0x6343 = 0x5FDD
-0x6344 = 0x96B3
-0x6345 = 0x95E9
-0x6346 = 0x95EB
-0x6347 = 0x95F1
-0x6348 = 0x95F3
-0x6349 = 0x95F5
-0x634A = 0x95F6
-0x634B = 0x95FC
-0x634C = 0x95FE
-0x634D = 0x9603
-0x634E = 0x9604
-0x634F = 0x9606
-0x6350 = 0x9608
-0x6351 = 0x960A
-0x6352 = 0x960B
-0x6353 = 0x960C
-0x6354 = 0x960D
-0x6355 = 0x960F
-0x6356 = 0x9612
-0x6357 = 0x9615
-0x6358 = 0x9616
-0x6359 = 0x9617
-0x635A = 0x9619
-0x635B = 0x961A
-0x635C = 0x4E2C
-0x635D = 0x723F
-0x635E = 0x6215
-0x635F = 0x6C35
-0x6360 = 0x6C54
-0x6361 = 0x6C5C
-0x6362 = 0x6C4A
-0x6363 = 0x6CA3
-0x6364 = 0x6C85
-0x6365 = 0x6C90
-0x6366 = 0x6C94
-0x6367 = 0x6C8C
-0x6368 = 0x6C68
-0x6369 = 0x6C69
-0x636A = 0x6C74
-0x636B = 0x6C76
-0x636C = 0x6C86
-0x636D = 0x6CA9
-0x636E = 0x6CD0
-0x636F = 0x6CD4
-0x6370 = 0x6CAD
-0x6371 = 0x6CF7
-0x6372 = 0x6CF8
-0x6373 = 0x6CF1
-0x6374 = 0x6CD7
-0x6375 = 0x6CB2
-0x6376 = 0x6CE0
-0x6377 = 0x6CD6
-0x6378 = 0x6CFA
-0x6379 = 0x6CEB
-0x637A = 0x6CEE
-0x637B = 0x6CB1
-0x637C = 0x6CD3
-0x637D = 0x6CEF
-0x637E = 0x6CFE
-0x6421 = 0x6D39
-0x6422 = 0x6D27
-0x6423 = 0x6D0C
-0x6424 = 0x6D43
-0x6425 = 0x6D48
-0x6426 = 0x6D07
-0x6427 = 0x6D04
-0x6428 = 0x6D19
-0x6429 = 0x6D0E
-0x642A = 0x6D2B
-0x642B = 0x6D4D
-0x642C = 0x6D2E
-0x642D = 0x6D35
-0x642E = 0x6D1A
-0x642F = 0x6D4F
-0x6430 = 0x6D52
-0x6431 = 0x6D54
-0x6432 = 0x6D33
-0x6433 = 0x6D91
-0x6434 = 0x6D6F
-0x6435 = 0x6D9E
-0x6436 = 0x6DA0
-0x6437 = 0x6D5E
-0x6438 = 0x6D93
-0x6439 = 0x6D94
-0x643A = 0x6D5C
-0x643B = 0x6D60
-0x643C = 0x6D7C
-0x643D = 0x6D63
-0x643E = 0x6E1A
-0x643F = 0x6DC7
-0x6440 = 0x6DC5
-0x6441 = 0x6DDE
-0x6442 = 0x6E0E
-0x6443 = 0x6DBF
-0x6444 = 0x6DE0
-0x6445 = 0x6E11
-0x6446 = 0x6DE6
-0x6447 = 0x6DDD
-0x6448 = 0x6DD9
-0x6449 = 0x6E16
-0x644A = 0x6DAB
-0x644B = 0x6E0C
-0x644C = 0x6DAE
-0x644D = 0x6E2B
-0x644E = 0x6E6E
-0x644F = 0x6E4E
-0x6450 = 0x6E6B
-0x6451 = 0x6EB2
-0x6452 = 0x6E5F
-0x6453 = 0x6E86
-0x6454 = 0x6E53
-0x6455 = 0x6E54
-0x6456 = 0x6E32
-0x6457 = 0x6E25
-0x6458 = 0x6E44
-0x6459 = 0x6EDF
-0x645A = 0x6EB1
-0x645B = 0x6E98
-0x645C = 0x6EE0
-0x645D = 0x6F2D
-0x645E = 0x6EE2
-0x645F = 0x6EA5
-0x6460 = 0x6EA7
-0x6461 = 0x6EBD
-0x6462 = 0x6EBB
-0x6463 = 0x6EB7
-0x6464 = 0x6ED7
-0x6465 = 0x6EB4
-0x6466 = 0x6ECF
-0x6467 = 0x6E8F
-0x6468 = 0x6EC2
-0x6469 = 0x6E9F
-0x646A = 0x6F62
-0x646B = 0x6F46
-0x646C = 0x6F47
-0x646D = 0x6F24
-0x646E = 0x6F15
-0x646F = 0x6EF9
-0x6470 = 0x6F2F
-0x6471 = 0x6F36
-0x6472 = 0x6F4B
-0x6473 = 0x6F74
-0x6474 = 0x6F2A
-0x6475 = 0x6F09
-0x6476 = 0x6F29
-0x6477 = 0x6F89
-0x6478 = 0x6F8D
-0x6479 = 0x6F8C
-0x647A = 0x6F78
-0x647B = 0x6F72
-0x647C = 0x6F7C
-0x647D = 0x6F7A
-0x647E = 0x6FD1
-0x6521 = 0x6FC9
-0x6522 = 0x6FA7
-0x6523 = 0x6FB9
-0x6524 = 0x6FB6
-0x6525 = 0x6FC2
-0x6526 = 0x6FE1
-0x6527 = 0x6FEE
-0x6528 = 0x6FDE
-0x6529 = 0x6FE0
-0x652A = 0x6FEF
-0x652B = 0x701A
-0x652C = 0x7023
-0x652D = 0x701B
-0x652E = 0x7039
-0x652F = 0x7035
-0x6530 = 0x704F
-0x6531 = 0x705E
-0x6532 = 0x5B80
-0x6533 = 0x5B84
-0x6534 = 0x5B95
-0x6535 = 0x5B93
-0x6536 = 0x5BA5
-0x6537 = 0x5BB8
-0x6538 = 0x752F
-0x6539 = 0x9A9E
-0x653A = 0x6434
-0x653B = 0x5BE4
-0x653C = 0x5BEE
-0x653D = 0x8930
-0x653E = 0x5BF0
-0x653F = 0x8E47
-0x6540 = 0x8B07
-0x6541 = 0x8FB6
-0x6542 = 0x8FD3
-0x6543 = 0x8FD5
-0x6544 = 0x8FE5
-0x6545 = 0x8FEE
-0x6546 = 0x8FE4
-0x6547 = 0x8FE9
-0x6548 = 0x8FE6
-0x6549 = 0x8FF3
-0x654A = 0x8FE8
-0x654B = 0x9005
-0x654C = 0x9004
-0x654D = 0x900B
-0x654E = 0x9026
-0x654F = 0x9011
-0x6550 = 0x900D
-0x6551 = 0x9016
-0x6552 = 0x9021
-0x6553 = 0x9035
-0x6554 = 0x9036
-0x6555 = 0x902D
-0x6556 = 0x902F
-0x6557 = 0x9044
-0x6558 = 0x9051
-0x6559 = 0x9052
-0x655A = 0x9050
-0x655B = 0x9068
-0x655C = 0x9058
-0x655D = 0x9062
-0x655E = 0x905B
-0x655F = 0x66B9
-0x6560 = 0x9074
-0x6561 = 0x907D
-0x6562 = 0x9082
-0x6563 = 0x9088
-0x6564 = 0x9083
-0x6565 = 0x908B
-0x6566 = 0x5F50
-0x6567 = 0x5F57
-0x6568 = 0x5F56
-0x6569 = 0x5F58
-0x656A = 0x5C3B
-0x656B = 0x54AB
-0x656C = 0x5C50
-0x656D = 0x5C59
-0x656E = 0x5B71
-0x656F = 0x5C63
-0x6570 = 0x5C66
-0x6571 = 0x7FBC
-0x6572 = 0x5F2A
-0x6573 = 0x5F29
-0x6574 = 0x5F2D
-0x6575 = 0x8274
-0x6576 = 0x5F3C
-0x6577 = 0x9B3B
-0x6578 = 0x5C6E
-0x6579 = 0x5981
-0x657A = 0x5983
-0x657B = 0x598D
-0x657C = 0x59A9
-0x657D = 0x59AA
-0x657E = 0x59A3
-0x6621 = 0x5997
-0x6622 = 0x59CA
-0x6623 = 0x59AB
-0x6624 = 0x599E
-0x6625 = 0x59A4
-0x6626 = 0x59D2
-0x6627 = 0x59B2
-0x6628 = 0x59AF
-0x6629 = 0x59D7
-0x662A = 0x59BE
-0x662B = 0x5A05
-0x662C = 0x5A06
-0x662D = 0x59DD
-0x662E = 0x5A08
-0x662F = 0x59E3
-0x6630 = 0x59D8
-0x6631 = 0x59F9
-0x6632 = 0x5A0C
-0x6633 = 0x5A09
-0x6634 = 0x5A32
-0x6635 = 0x5A34
-0x6636 = 0x5A11
-0x6637 = 0x5A23
-0x6638 = 0x5A13
-0x6639 = 0x5A40
-0x663A = 0x5A67
-0x663B = 0x5A4A
-0x663C = 0x5A55
-0x663D = 0x5A3C
-0x663E = 0x5A62
-0x663F = 0x5A75
-0x6640 = 0x80EC
-0x6641 = 0x5AAA
-0x6642 = 0x5A9B
-0x6643 = 0x5A77
-0x6644 = 0x5A7A
-0x6645 = 0x5ABE
-0x6646 = 0x5AEB
-0x6647 = 0x5AB2
-0x6648 = 0x5AD2
-0x6649 = 0x5AD4
-0x664A = 0x5AB8
-0x664B = 0x5AE0
-0x664C = 0x5AE3
-0x664D = 0x5AF1
-0x664E = 0x5AD6
-0x664F = 0x5AE6
-0x6650 = 0x5AD8
-0x6651 = 0x5ADC
-0x6652 = 0x5B09
-0x6653 = 0x5B17
-0x6654 = 0x5B16
-0x6655 = 0x5B32
-0x6656 = 0x5B37
-0x6657 = 0x5B40
-0x6658 = 0x5C15
-0x6659 = 0x5C1C
-0x665A = 0x5B5A
-0x665B = 0x5B65
-0x665C = 0x5B73
-0x665D = 0x5B51
-0x665E = 0x5B53
-0x665F = 0x5B62
-0x6660 = 0x9A75
-0x6661 = 0x9A77
-0x6662 = 0x9A78
-0x6663 = 0x9A7A
-0x6664 = 0x9A7F
-0x6665 = 0x9A7D
-0x6666 = 0x9A80
-0x6667 = 0x9A81
-0x6668 = 0x9A85
-0x6669 = 0x9A88
-0x666A = 0x9A8A
-0x666B = 0x9A90
-0x666C = 0x9A92
-0x666D = 0x9A93
-0x666E = 0x9A96
-0x666F = 0x9A98
-0x6670 = 0x9A9B
-0x6671 = 0x9A9C
-0x6672 = 0x9A9D
-0x6673 = 0x9A9F
-0x6674 = 0x9AA0
-0x6675 = 0x9AA2
-0x6676 = 0x9AA3
-0x6677 = 0x9AA5
-0x6678 = 0x9AA7
-0x6679 = 0x7E9F
-0x667A = 0x7EA1
-0x667B = 0x7EA3
-0x667C = 0x7EA5
-0x667D = 0x7EA8
-0x667E = 0x7EA9
-0x6721 = 0x7EAD
-0x6722 = 0x7EB0
-0x6723 = 0x7EBE
-0x6724 = 0x7EC0
-0x6725 = 0x7EC1
-0x6726 = 0x7EC2
-0x6727 = 0x7EC9
-0x6728 = 0x7ECB
-0x6729 = 0x7ECC
-0x672A = 0x7ED0
-0x672B = 0x7ED4
-0x672C = 0x7ED7
-0x672D = 0x7EDB
-0x672E = 0x7EE0
-0x672F = 0x7EE1
-0x6730 = 0x7EE8
-0x6731 = 0x7EEB
-0x6732 = 0x7EEE
-0x6733 = 0x7EEF
-0x6734 = 0x7EF1
-0x6735 = 0x7EF2
-0x6736 = 0x7F0D
-0x6737 = 0x7EF6
-0x6738 = 0x7EFA
-0x6739 = 0x7EFB
-0x673A = 0x7EFE
-0x673B = 0x7F01
-0x673C = 0x7F02
-0x673D = 0x7F03
-0x673E = 0x7F07
-0x673F = 0x7F08
-0x6740 = 0x7F0B
-0x6741 = 0x7F0C
-0x6742 = 0x7F0F
-0x6743 = 0x7F11
-0x6744 = 0x7F12
-0x6745 = 0x7F17
-0x6746 = 0x7F19
-0x6747 = 0x7F1C
-0x6748 = 0x7F1B
-0x6749 = 0x7F1F
-0x674A = 0x7F21
-0x674B = 0x7F22
-0x674C = 0x7F23
-0x674D = 0x7F24
-0x674E = 0x7F25
-0x674F = 0x7F26
-0x6750 = 0x7F27
-0x6751 = 0x7F2A
-0x6752 = 0x7F2B
-0x6753 = 0x7F2C
-0x6754 = 0x7F2D
-0x6755 = 0x7F2F
-0x6756 = 0x7F30
-0x6757 = 0x7F31
-0x6758 = 0x7F32
-0x6759 = 0x7F33
-0x675A = 0x7F35
-0x675B = 0x5E7A
-0x675C = 0x757F
-0x675D = 0x5DDB
-0x675E = 0x753E
-0x675F = 0x9095
-0x6760 = 0x738E
-0x6761 = 0x7391
-0x6762 = 0x73AE
-0x6763 = 0x73A2
-0x6764 = 0x739F
-0x6765 = 0x73CF
-0x6766 = 0x73C2
-0x6767 = 0x73D1
-0x6768 = 0x73B7
-0x6769 = 0x73B3
-0x676A = 0x73C0
-0x676B = 0x73C9
-0x676C = 0x73C8
-0x676D = 0x73E5
-0x676E = 0x73D9
-0x676F = 0x987C
-0x6770 = 0x740A
-0x6771 = 0x73E9
-0x6772 = 0x73E7
-0x6773 = 0x73DE
-0x6774 = 0x73BA
-0x6775 = 0x73F2
-0x6776 = 0x740F
-0x6777 = 0x742A
-0x6778 = 0x745B
-0x6779 = 0x7426
-0x677A = 0x7425
-0x677B = 0x7428
-0x677C = 0x7430
-0x677D = 0x742E
-0x677E = 0x742C
-0x6821 = 0x741B
-0x6822 = 0x741A
-0x6823 = 0x7441
-0x6824 = 0x745C
-0x6825 = 0x7457
-0x6826 = 0x7455
-0x6827 = 0x7459
-0x6828 = 0x7477
-0x6829 = 0x746D
-0x682A = 0x747E
-0x682B = 0x749C
-0x682C = 0x748E
-0x682D = 0x7480
-0x682E = 0x7481
-0x682F = 0x7487
-0x6830 = 0x748B
-0x6831 = 0x749E
-0x6832 = 0x74A8
-0x6833 = 0x74A9
-0x6834 = 0x7490
-0x6835 = 0x74A7
-0x6836 = 0x74D2
-0x6837 = 0x74BA
-0x6838 = 0x97EA
-0x6839 = 0x97EB
-0x683A = 0x97EC
-0x683B = 0x674C
-0x683C = 0x6753
-0x683D = 0x675E
-0x683E = 0x6748
-0x683F = 0x6769
-0x6840 = 0x67A5
-0x6841 = 0x6787
-0x6842 = 0x676A
-0x6843 = 0x6773
-0x6844 = 0x6798
-0x6845 = 0x67A7
-0x6846 = 0x6775
-0x6847 = 0x67A8
-0x6848 = 0x679E
-0x6849 = 0x67AD
-0x684A = 0x678B
-0x684B = 0x6777
-0x684C = 0x677C
-0x684D = 0x67F0
-0x684E = 0x6809
-0x684F = 0x67D8
-0x6850 = 0x680A
-0x6851 = 0x67E9
-0x6852 = 0x67B0
-0x6853 = 0x680C
-0x6854 = 0x67D9
-0x6855 = 0x67B5
-0x6856 = 0x67DA
-0x6857 = 0x67B3
-0x6858 = 0x67DD
-0x6859 = 0x6800
-0x685A = 0x67C3
-0x685B = 0x67B8
-0x685C = 0x67E2
-0x685D = 0x680E
-0x685E = 0x67C1
-0x685F = 0x67FD
-0x6860 = 0x6832
-0x6861 = 0x6833
-0x6862 = 0x6860
-0x6863 = 0x6861
-0x6864 = 0x684E
-0x6865 = 0x6862
-0x6866 = 0x6844
-0x6867 = 0x6864
-0x6868 = 0x6883
-0x6869 = 0x681D
-0x686A = 0x6855
-0x686B = 0x6866
-0x686C = 0x6841
-0x686D = 0x6867
-0x686E = 0x6840
-0x686F = 0x683E
-0x6870 = 0x684A
-0x6871 = 0x6849
-0x6872 = 0x6829
-0x6873 = 0x68B5
-0x6874 = 0x688F
-0x6875 = 0x6874
-0x6876 = 0x6877
-0x6877 = 0x6893
-0x6878 = 0x686B
-0x6879 = 0x68C2
-0x687A = 0x696E
-0x687B = 0x68FC
-0x687C = 0x691F
-0x687D = 0x6920
-0x687E = 0x68F9
-0x6921 = 0x6924
-0x6922 = 0x68F0
-0x6923 = 0x690B
-0x6924 = 0x6901
-0x6925 = 0x6957
-0x6926 = 0x68E3
-0x6927 = 0x6910
-0x6928 = 0x6971
-0x6929 = 0x6939
-0x692A = 0x6960
-0x692B = 0x6942
-0x692C = 0x695D
-0x692D = 0x6984
-0x692E = 0x696B
-0x692F = 0x6980
-0x6930 = 0x6998
-0x6931 = 0x6978
-0x6932 = 0x6934
-0x6933 = 0x69CC
-0x6934 = 0x6987
-0x6935 = 0x6988
-0x6936 = 0x69CE
-0x6937 = 0x6989
-0x6938 = 0x6966
-0x6939 = 0x6963
-0x693A = 0x6979
-0x693B = 0x699B
-0x693C = 0x69A7
-0x693D = 0x69BB
-0x693E = 0x69AB
-0x693F = 0x69AD
-0x6940 = 0x69D4
-0x6941 = 0x69B1
-0x6942 = 0x69C1
-0x6943 = 0x69CA
-0x6944 = 0x69DF
-0x6945 = 0x6995
-0x6946 = 0x69E0
-0x6947 = 0x698D
-0x6948 = 0x69FF
-0x6949 = 0x6A2F
-0x694A = 0x69ED
-0x694B = 0x6A17
-0x694C = 0x6A18
-0x694D = 0x6A65
-0x694E = 0x69F2
-0x694F = 0x6A44
-0x6950 = 0x6A3E
-0x6951 = 0x6AA0
-0x6952 = 0x6A50
-0x6953 = 0x6A5B
-0x6954 = 0x6A35
-0x6955 = 0x6A8E
-0x6956 = 0x6A79
-0x6957 = 0x6A3D
-0x6958 = 0x6A28
-0x6959 = 0x6A58
-0x695A = 0x6A7C
-0x695B = 0x6A91
-0x695C = 0x6A90
-0x695D = 0x6AA9
-0x695E = 0x6A97
-0x695F = 0x6AAB
-0x6960 = 0x7337
-0x6961 = 0x7352
-0x6962 = 0x6B81
-0x6963 = 0x6B82
-0x6964 = 0x6B87
-0x6965 = 0x6B84
-0x6966 = 0x6B92
-0x6967 = 0x6B93
-0x6968 = 0x6B8D
-0x6969 = 0x6B9A
-0x696A = 0x6B9B
-0x696B = 0x6BA1
-0x696C = 0x6BAA
-0x696D = 0x8F6B
-0x696E = 0x8F6D
-0x696F = 0x8F71
-0x6970 = 0x8F72
-0x6971 = 0x8F73
-0x6972 = 0x8F75
-0x6973 = 0x8F76
-0x6974 = 0x8F78
-0x6975 = 0x8F77
-0x6976 = 0x8F79
-0x6977 = 0x8F7A
-0x6978 = 0x8F7C
-0x6979 = 0x8F7E
-0x697A = 0x8F81
-0x697B = 0x8F82
-0x697C = 0x8F84
-0x697D = 0x8F87
-0x697E = 0x8F8B
-0x6A21 = 0x8F8D
-0x6A22 = 0x8F8E
-0x6A23 = 0x8F8F
-0x6A24 = 0x8F98
-0x6A25 = 0x8F9A
-0x6A26 = 0x8ECE
-0x6A27 = 0x620B
-0x6A28 = 0x6217
-0x6A29 = 0x621B
-0x6A2A = 0x621F
-0x6A2B = 0x6222
-0x6A2C = 0x6221
-0x6A2D = 0x6225
-0x6A2E = 0x6224
-0x6A2F = 0x622C
-0x6A30 = 0x81E7
-0x6A31 = 0x74EF
-0x6A32 = 0x74F4
-0x6A33 = 0x74FF
-0x6A34 = 0x750F
-0x6A35 = 0x7511
-0x6A36 = 0x7513
-0x6A37 = 0x6534
-0x6A38 = 0x65EE
-0x6A39 = 0x65EF
-0x6A3A = 0x65F0
-0x6A3B = 0x660A
-0x6A3C = 0x6619
-0x6A3D = 0x6772
-0x6A3E = 0x6603
-0x6A3F = 0x6615
-0x6A40 = 0x6600
-0x6A41 = 0x7085
-0x6A42 = 0x66F7
-0x6A43 = 0x661D
-0x6A44 = 0x6634
-0x6A45 = 0x6631
-0x6A46 = 0x6636
-0x6A47 = 0x6635
-0x6A48 = 0x8006
-0x6A49 = 0x665F
-0x6A4A = 0x6654
-0x6A4B = 0x6641
-0x6A4C = 0x664F
-0x6A4D = 0x6656
-0x6A4E = 0x6661
-0x6A4F = 0x6657
-0x6A50 = 0x6677
-0x6A51 = 0x6684
-0x6A52 = 0x668C
-0x6A53 = 0x66A7
-0x6A54 = 0x669D
-0x6A55 = 0x66BE
-0x6A56 = 0x66DB
-0x6A57 = 0x66DC
-0x6A58 = 0x66E6
-0x6A59 = 0x66E9
-0x6A5A = 0x8D32
-0x6A5B = 0x8D33
-0x6A5C = 0x8D36
-0x6A5D = 0x8D3B
-0x6A5E = 0x8D3D
-0x6A5F = 0x8D40
-0x6A60 = 0x8D45
-0x6A61 = 0x8D46
-0x6A62 = 0x8D48
-0x6A63 = 0x8D49
-0x6A64 = 0x8D47
-0x6A65 = 0x8D4D
-0x6A66 = 0x8D55
-0x6A67 = 0x8D59
-0x6A68 = 0x89C7
-0x6A69 = 0x89CA
-0x6A6A = 0x89CB
-0x6A6B = 0x89CC
-0x6A6C = 0x89CE
-0x6A6D = 0x89CF
-0x6A6E = 0x89D0
-0x6A6F = 0x89D1
-0x6A70 = 0x726E
-0x6A71 = 0x729F
-0x6A72 = 0x725D
-0x6A73 = 0x7266
-0x6A74 = 0x726F
-0x6A75 = 0x727E
-0x6A76 = 0x727F
-0x6A77 = 0x7284
-0x6A78 = 0x728B
-0x6A79 = 0x728D
-0x6A7A = 0x728F
-0x6A7B = 0x7292
-0x6A7C = 0x6308
-0x6A7D = 0x6332
-0x6A7E = 0x63B0
-0x6B21 = 0x643F
-0x6B22 = 0x64D8
-0x6B23 = 0x8004
-0x6B24 = 0x6BEA
-0x6B25 = 0x6BF3
-0x6B26 = 0x6BFD
-0x6B27 = 0x6BF5
-0x6B28 = 0x6BF9
-0x6B29 = 0x6C05
-0x6B2A = 0x6C07
-0x6B2B = 0x6C06
-0x6B2C = 0x6C0D
-0x6B2D = 0x6C15
-0x6B2E = 0x6C18
-0x6B2F = 0x6C19
-0x6B30 = 0x6C1A
-0x6B31 = 0x6C21
-0x6B32 = 0x6C29
-0x6B33 = 0x6C24
-0x6B34 = 0x6C2A
-0x6B35 = 0x6C32
-0x6B36 = 0x6535
-0x6B37 = 0x6555
-0x6B38 = 0x656B
-0x6B39 = 0x724D
-0x6B3A = 0x7252
-0x6B3B = 0x7256
-0x6B3C = 0x7230
-0x6B3D = 0x8662
-0x6B3E = 0x5216
-0x6B3F = 0x809F
-0x6B40 = 0x809C
-0x6B41 = 0x8093
-0x6B42 = 0x80BC
-0x6B43 = 0x670A
-0x6B44 = 0x80BD
-0x6B45 = 0x80B1
-0x6B46 = 0x80AB
-0x6B47 = 0x80AD
-0x6B48 = 0x80B4
-0x6B49 = 0x80B7
-0x6B4A = 0x80E7
-0x6B4B = 0x80E8
-0x6B4C = 0x80E9
-0x6B4D = 0x80EA
-0x6B4E = 0x80DB
-0x6B4F = 0x80C2
-0x6B50 = 0x80C4
-0x6B51 = 0x80D9
-0x6B52 = 0x80CD
-0x6B53 = 0x80D7
-0x6B54 = 0x6710
-0x6B55 = 0x80DD
-0x6B56 = 0x80EB
-0x6B57 = 0x80F1
-0x6B58 = 0x80F4
-0x6B59 = 0x80ED
-0x6B5A = 0x810D
-0x6B5B = 0x810E
-0x6B5C = 0x80F2
-0x6B5D = 0x80FC
-0x6B5E = 0x6715
-0x6B5F = 0x8112
-0x6B60 = 0x8C5A
-0x6B61 = 0x8136
-0x6B62 = 0x811E
-0x6B63 = 0x812C
-0x6B64 = 0x8118
-0x6B65 = 0x8132
-0x6B66 = 0x8148
-0x6B67 = 0x814C
-0x6B68 = 0x8153
-0x6B69 = 0x8174
-0x6B6A = 0x8159
-0x6B6B = 0x815A
-0x6B6C = 0x8171
-0x6B6D = 0x8160
-0x6B6E = 0x8169
-0x6B6F = 0x817C
-0x6B70 = 0x817D
-0x6B71 = 0x816D
-0x6B72 = 0x8167
-0x6B73 = 0x584D
-0x6B74 = 0x5AB5
-0x6B75 = 0x8188
-0x6B76 = 0x8182
-0x6B77 = 0x8191
-0x6B78 = 0x6ED5
-0x6B79 = 0x81A3
-0x6B7A = 0x81AA
-0x6B7B = 0x81CC
-0x6B7C = 0x6726
-0x6B7D = 0x81CA
-0x6B7E = 0x81BB
-0x6C21 = 0x81C1
-0x6C22 = 0x81A6
-0x6C23 = 0x6B24
-0x6C24 = 0x6B37
-0x6C25 = 0x6B39
-0x6C26 = 0x6B43
-0x6C27 = 0x6B46
-0x6C28 = 0x6B59
-0x6C29 = 0x98D1
-0x6C2A = 0x98D2
-0x6C2B = 0x98D3
-0x6C2C = 0x98D5
-0x6C2D = 0x98D9
-0x6C2E = 0x98DA
-0x6C2F = 0x6BB3
-0x6C30 = 0x5F40
-0x6C31 = 0x6BC2
-0x6C32 = 0x89F3
-0x6C33 = 0x6590
-0x6C34 = 0x9F51
-0x6C35 = 0x6593
-0x6C36 = 0x65BC
-0x6C37 = 0x65C6
-0x6C38 = 0x65C4
-0x6C39 = 0x65C3
-0x6C3A = 0x65CC
-0x6C3B = 0x65CE
-0x6C3C = 0x65D2
-0x6C3D = 0x65D6
-0x6C3E = 0x7080
-0x6C3F = 0x709C
-0x6C40 = 0x7096
-0x6C41 = 0x709D
-0x6C42 = 0x70BB
-0x6C43 = 0x70C0
-0x6C44 = 0x70B7
-0x6C45 = 0x70AB
-0x6C46 = 0x70B1
-0x6C47 = 0x70E8
-0x6C48 = 0x70CA
-0x6C49 = 0x7110
-0x6C4A = 0x7113
-0x6C4B = 0x7116
-0x6C4C = 0x712F
-0x6C4D = 0x7131
-0x6C4E = 0x7173
-0x6C4F = 0x715C
-0x6C50 = 0x7168
-0x6C51 = 0x7145
-0x6C52 = 0x7172
-0x6C53 = 0x714A
-0x6C54 = 0x7178
-0x6C55 = 0x717A
-0x6C56 = 0x7198
-0x6C57 = 0x71B3
-0x6C58 = 0x71B5
-0x6C59 = 0x71A8
-0x6C5A = 0x71A0
-0x6C5B = 0x71E0
-0x6C5C = 0x71D4
-0x6C5D = 0x71E7
-0x6C5E = 0x71F9
-0x6C5F = 0x721D
-0x6C60 = 0x7228
-0x6C61 = 0x706C
-0x6C62 = 0x7118
-0x6C63 = 0x7166
-0x6C64 = 0x71B9
-0x6C65 = 0x623E
-0x6C66 = 0x623D
-0x6C67 = 0x6243
-0x6C68 = 0x6248
-0x6C69 = 0x6249
-0x6C6A = 0x793B
-0x6C6B = 0x7940
-0x6C6C = 0x7946
-0x6C6D = 0x7949
-0x6C6E = 0x795B
-0x6C6F = 0x795C
-0x6C70 = 0x7953
-0x6C71 = 0x795A
-0x6C72 = 0x7962
-0x6C73 = 0x7957
-0x6C74 = 0x7960
-0x6C75 = 0x796F
-0x6C76 = 0x7967
-0x6C77 = 0x797A
-0x6C78 = 0x7985
-0x6C79 = 0x798A
-0x6C7A = 0x799A
-0x6C7B = 0x79A7
-0x6C7C = 0x79B3
-0x6C7D = 0x5FD1
-0x6C7E = 0x5FD0
-0x6D21 = 0x603C
-0x6D22 = 0x605D
-0x6D23 = 0x605A
-0x6D24 = 0x6067
-0x6D25 = 0x6041
-0x6D26 = 0x6059
-0x6D27 = 0x6063
-0x6D28 = 0x60AB
-0x6D29 = 0x6106
-0x6D2A = 0x610D
-0x6D2B = 0x615D
-0x6D2C = 0x61A9
-0x6D2D = 0x619D
-0x6D2E = 0x61CB
-0x6D2F = 0x61D1
-0x6D30 = 0x6206
-0x6D31 = 0x8080
-0x6D32 = 0x807F
-0x6D33 = 0x6C93
-0x6D34 = 0x6CF6
-0x6D35 = 0x6DFC
-0x6D36 = 0x77F6
-0x6D37 = 0x77F8
-0x6D38 = 0x7800
-0x6D39 = 0x7809
-0x6D3A = 0x7817
-0x6D3B = 0x7818
-0x6D3C = 0x7811
-0x6D3D = 0x65AB
-0x6D3E = 0x782D
-0x6D3F = 0x781C
-0x6D40 = 0x781D
-0x6D41 = 0x7839
-0x6D42 = 0x783A
-0x6D43 = 0x783B
-0x6D44 = 0x781F
-0x6D45 = 0x783C
-0x6D46 = 0x7825
-0x6D47 = 0x782C
-0x6D48 = 0x7823
-0x6D49 = 0x7829
-0x6D4A = 0x784E
-0x6D4B = 0x786D
-0x6D4C = 0x7856
-0x6D4D = 0x7857
-0x6D4E = 0x7826
-0x6D4F = 0x7850
-0x6D50 = 0x7847
-0x6D51 = 0x784C
-0x6D52 = 0x786A
-0x6D53 = 0x789B
-0x6D54 = 0x7893
-0x6D55 = 0x789A
-0x6D56 = 0x7887
-0x6D57 = 0x789C
-0x6D58 = 0x78A1
-0x6D59 = 0x78A3
-0x6D5A = 0x78B2
-0x6D5B = 0x78B9
-0x6D5C = 0x78A5
-0x6D5D = 0x78D4
-0x6D5E = 0x78D9
-0x6D5F = 0x78C9
-0x6D60 = 0x78EC
-0x6D61 = 0x78F2
-0x6D62 = 0x7905
-0x6D63 = 0x78F4
-0x6D64 = 0x7913
-0x6D65 = 0x7924
-0x6D66 = 0x791E
-0x6D67 = 0x7934
-0x6D68 = 0x9F9B
-0x6D69 = 0x9EF9
-0x6D6A = 0x9EFB
-0x6D6B = 0x9EFC
-0x6D6C = 0x76F1
-0x6D6D = 0x7704
-0x6D6E = 0x770D
-0x6D6F = 0x76F9
-0x6D70 = 0x7707
-0x6D71 = 0x7708
-0x6D72 = 0x771A
-0x6D73 = 0x7722
-0x6D74 = 0x7719
-0x6D75 = 0x772D
-0x6D76 = 0x7726
-0x6D77 = 0x7735
-0x6D78 = 0x7738
-0x6D79 = 0x7750
-0x6D7A = 0x7751
-0x6D7B = 0x7747
-0x6D7C = 0x7743
-0x6D7D = 0x775A
-0x6D7E = 0x7768
-0x6E21 = 0x7762
-0x6E22 = 0x7765
-0x6E23 = 0x777F
-0x6E24 = 0x778D
-0x6E25 = 0x777D
-0x6E26 = 0x7780
-0x6E27 = 0x778C
-0x6E28 = 0x7791
-0x6E29 = 0x779F
-0x6E2A = 0x77A0
-0x6E2B = 0x77B0
-0x6E2C = 0x77B5
-0x6E2D = 0x77BD
-0x6E2E = 0x753A
-0x6E2F = 0x7540
-0x6E30 = 0x754E
-0x6E31 = 0x754B
-0x6E32 = 0x7548
-0x6E33 = 0x755B
-0x6E34 = 0x7572
-0x6E35 = 0x7579
-0x6E36 = 0x7583
-0x6E37 = 0x7F58
-0x6E38 = 0x7F61
-0x6E39 = 0x7F5F
-0x6E3A = 0x8A48
-0x6E3B = 0x7F68
-0x6E3C = 0x7F74
-0x6E3D = 0x7F71
-0x6E3E = 0x7F79
-0x6E3F = 0x7F81
-0x6E40 = 0x7F7E
-0x6E41 = 0x76CD
-0x6E42 = 0x76E5
-0x6E43 = 0x8832
-0x6E44 = 0x9485
-0x6E45 = 0x9486
-0x6E46 = 0x9487
-0x6E47 = 0x948B
-0x6E48 = 0x948A
-0x6E49 = 0x948C
-0x6E4A = 0x948D
-0x6E4B = 0x948F
-0x6E4C = 0x9490
-0x6E4D = 0x9494
-0x6E4E = 0x9497
-0x6E4F = 0x9495
-0x6E50 = 0x949A
-0x6E51 = 0x949B
-0x6E52 = 0x949C
-0x6E53 = 0x94A3
-0x6E54 = 0x94A4
-0x6E55 = 0x94AB
-0x6E56 = 0x94AA
-0x6E57 = 0x94AD
-0x6E58 = 0x94AC
-0x6E59 = 0x94AF
-0x6E5A = 0x94B0
-0x6E5B = 0x94B2
-0x6E5C = 0x94B4
-0x6E5D = 0x94B6
-0x6E5E = 0x94B7
-0x6E5F = 0x94B8
-0x6E60 = 0x94B9
-0x6E61 = 0x94BA
-0x6E62 = 0x94BC
-0x6E63 = 0x94BD
-0x6E64 = 0x94BF
-0x6E65 = 0x94C4
-0x6E66 = 0x94C8
-0x6E67 = 0x94C9
-0x6E68 = 0x94CA
-0x6E69 = 0x94CB
-0x6E6A = 0x94CC
-0x6E6B = 0x94CD
-0x6E6C = 0x94CE
-0x6E6D = 0x94D0
-0x6E6E = 0x94D1
-0x6E6F = 0x94D2
-0x6E70 = 0x94D5
-0x6E71 = 0x94D6
-0x6E72 = 0x94D7
-0x6E73 = 0x94D9
-0x6E74 = 0x94D8
-0x6E75 = 0x94DB
-0x6E76 = 0x94DE
-0x6E77 = 0x94DF
-0x6E78 = 0x94E0
-0x6E79 = 0x94E2
-0x6E7A = 0x94E4
-0x6E7B = 0x94E5
-0x6E7C = 0x94E7
-0x6E7D = 0x94E8
-0x6E7E = 0x94EA
-0x6F21 = 0x94E9
-0x6F22 = 0x94EB
-0x6F23 = 0x94EE
-0x6F24 = 0x94EF
-0x6F25 = 0x94F3
-0x6F26 = 0x94F4
-0x6F27 = 0x94F5
-0x6F28 = 0x94F7
-0x6F29 = 0x94F9
-0x6F2A = 0x94FC
-0x6F2B = 0x94FD
-0x6F2C = 0x94FF
-0x6F2D = 0x9503
-0x6F2E = 0x9502
-0x6F2F = 0x9506
-0x6F30 = 0x9507
-0x6F31 = 0x9509
-0x6F32 = 0x950A
-0x6F33 = 0x950D
-0x6F34 = 0x950E
-0x6F35 = 0x950F
-0x6F36 = 0x9512
-0x6F37 = 0x9513
-0x6F38 = 0x9514
-0x6F39 = 0x9515
-0x6F3A = 0x9516
-0x6F3B = 0x9518
-0x6F3C = 0x951B
-0x6F3D = 0x951D
-0x6F3E = 0x951E
-0x6F3F = 0x951F
-0x6F40 = 0x9522
-0x6F41 = 0x952A
-0x6F42 = 0x952B
-0x6F43 = 0x9529
-0x6F44 = 0x952C
-0x6F45 = 0x9531
-0x6F46 = 0x9532
-0x6F47 = 0x9534
-0x6F48 = 0x9536
-0x6F49 = 0x9537
-0x6F4A = 0x9538
-0x6F4B = 0x953C
-0x6F4C = 0x953E
-0x6F4D = 0x953F
-0x6F4E = 0x9542
-0x6F4F = 0x9535
-0x6F50 = 0x9544
-0x6F51 = 0x9545
-0x6F52 = 0x9546
-0x6F53 = 0x9549
-0x6F54 = 0x954C
-0x6F55 = 0x954E
-0x6F56 = 0x954F
-0x6F57 = 0x9552
-0x6F58 = 0x9553
-0x6F59 = 0x9554
-0x6F5A = 0x9556
-0x6F5B = 0x9557
-0x6F5C = 0x9558
-0x6F5D = 0x9559
-0x6F5E = 0x955B
-0x6F5F = 0x955E
-0x6F60 = 0x955F
-0x6F61 = 0x955D
-0x6F62 = 0x9561
-0x6F63 = 0x9562
-0x6F64 = 0x9564
-0x6F65 = 0x9565
-0x6F66 = 0x9566
-0x6F67 = 0x9567
-0x6F68 = 0x9568
-0x6F69 = 0x9569
-0x6F6A = 0x956A
-0x6F6B = 0x956B
-0x6F6C = 0x956C
-0x6F6D = 0x956F
-0x6F6E = 0x9571
-0x6F6F = 0x9572
-0x6F70 = 0x9573
-0x6F71 = 0x953A
-0x6F72 = 0x77E7
-0x6F73 = 0x77EC
-0x6F74 = 0x96C9
-0x6F75 = 0x79D5
-0x6F76 = 0x79ED
-0x6F77 = 0x79E3
-0x6F78 = 0x79EB
-0x6F79 = 0x7A06
-0x6F7A = 0x5D47
-0x6F7B = 0x7A03
-0x6F7C = 0x7A02
-0x6F7D = 0x7A1E
-0x6F7E = 0x7A14
-0x7021 = 0x7A39
-0x7022 = 0x7A37
-0x7023 = 0x7A51
-0x7024 = 0x9ECF
-0x7025 = 0x99A5
-0x7026 = 0x7A70
-0x7027 = 0x7688
-0x7028 = 0x768E
-0x7029 = 0x7693
-0x702A = 0x7699
-0x702B = 0x76A4
-0x702C = 0x74DE
-0x702D = 0x74E0
-0x702E = 0x752C
-0x702F = 0x9E20
-0x7030 = 0x9E22
-0x7031 = 0x9E28
-0x7032 = 0x9E29
-0x7033 = 0x9E2A
-0x7034 = 0x9E2B
-0x7035 = 0x9E2C
-0x7036 = 0x9E32
-0x7037 = 0x9E31
-0x7038 = 0x9E36
-0x7039 = 0x9E38
-0x703A = 0x9E37
-0x703B = 0x9E39
-0x703C = 0x9E3A
-0x703D = 0x9E3E
-0x703E = 0x9E41
-0x703F = 0x9E42
-0x7040 = 0x9E44
-0x7041 = 0x9E46
-0x7042 = 0x9E47
-0x7043 = 0x9E48
-0x7044 = 0x9E49
-0x7045 = 0x9E4B
-0x7046 = 0x9E4C
-0x7047 = 0x9E4E
-0x7048 = 0x9E51
-0x7049 = 0x9E55
-0x704A = 0x9E57
-0x704B = 0x9E5A
-0x704C = 0x9E5B
-0x704D = 0x9E5C
-0x704E = 0x9E5E
-0x704F = 0x9E63
-0x7050 = 0x9E66
-0x7051 = 0x9E67
-0x7052 = 0x9E68
-0x7053 = 0x9E69
-0x7054 = 0x9E6A
-0x7055 = 0x9E6B
-0x7056 = 0x9E6C
-0x7057 = 0x9E71
-0x7058 = 0x9E6D
-0x7059 = 0x9E73
-0x705A = 0x7592
-0x705B = 0x7594
-0x705C = 0x7596
-0x705D = 0x75A0
-0x705E = 0x759D
-0x705F = 0x75AC
-0x7060 = 0x75A3
-0x7061 = 0x75B3
-0x7062 = 0x75B4
-0x7063 = 0x75B8
-0x7064 = 0x75C4
-0x7065 = 0x75B1
-0x7066 = 0x75B0
-0x7067 = 0x75C3
-0x7068 = 0x75C2
-0x7069 = 0x75D6
-0x706A = 0x75CD
-0x706B = 0x75E3
-0x706C = 0x75E8
-0x706D = 0x75E6
-0x706E = 0x75E4
-0x706F = 0x75EB
-0x7070 = 0x75E7
-0x7071 = 0x7603
-0x7072 = 0x75F1
-0x7073 = 0x75FC
-0x7074 = 0x75FF
-0x7075 = 0x7610
-0x7076 = 0x7600
-0x7077 = 0x7605
-0x7078 = 0x760C
-0x7079 = 0x7617
-0x707A = 0x760A
-0x707B = 0x7625
-0x707C = 0x7618
-0x707D = 0x7615
-0x707E = 0x7619
-0x7121 = 0x761B
-0x7122 = 0x763C
-0x7123 = 0x7622
-0x7124 = 0x7620
-0x7125 = 0x7640
-0x7126 = 0x762D
-0x7127 = 0x7630
-0x7128 = 0x763F
-0x7129 = 0x7635
-0x712A = 0x7643
-0x712B = 0x763E
-0x712C = 0x7633
-0x712D = 0x764D
-0x712E = 0x765E
-0x712F = 0x7654
-0x7130 = 0x765C
-0x7131 = 0x7656
-0x7132 = 0x766B
-0x7133 = 0x766F
-0x7134 = 0x7FCA
-0x7135 = 0x7AE6
-0x7136 = 0x7A78
-0x7137 = 0x7A79
-0x7138 = 0x7A80
-0x7139 = 0x7A86
-0x713A = 0x7A88
-0x713B = 0x7A95
-0x713C = 0x7AA6
-0x713D = 0x7AA0
-0x713E = 0x7AAC
-0x713F = 0x7AA8
-0x7140 = 0x7AAD
-0x7141 = 0x7AB3
-0x7142 = 0x8864
-0x7143 = 0x8869
-0x7144 = 0x8872
-0x7145 = 0x887D
-0x7146 = 0x887F
-0x7147 = 0x8882
-0x7148 = 0x88A2
-0x7149 = 0x88C6
-0x714A = 0x88B7
-0x714B = 0x88BC
-0x714C = 0x88C9
-0x714D = 0x88E2
-0x714E = 0x88CE
-0x714F = 0x88E3
-0x7150 = 0x88E5
-0x7151 = 0x88F1
-0x7152 = 0x891A
-0x7153 = 0x88FC
-0x7154 = 0x88E8
-0x7155 = 0x88FE
-0x7156 = 0x88F0
-0x7157 = 0x8921
-0x7158 = 0x8919
-0x7159 = 0x8913
-0x715A = 0x891B
-0x715B = 0x890A
-0x715C = 0x8934
-0x715D = 0x892B
-0x715E = 0x8936
-0x715F = 0x8941
-0x7160 = 0x8966
-0x7161 = 0x897B
-0x7162 = 0x758B
-0x7163 = 0x80E5
-0x7164 = 0x76B2
-0x7165 = 0x76B4
-0x7166 = 0x77DC
-0x7167 = 0x8012
-0x7168 = 0x8014
-0x7169 = 0x8016
-0x716A = 0x801C
-0x716B = 0x8020
-0x716C = 0x8022
-0x716D = 0x8025
-0x716E = 0x8026
-0x716F = 0x8027
-0x7170 = 0x8029
-0x7171 = 0x8028
-0x7172 = 0x8031
-0x7173 = 0x800B
-0x7174 = 0x8035
-0x7175 = 0x8043
-0x7176 = 0x8046
-0x7177 = 0x804D
-0x7178 = 0x8052
-0x7179 = 0x8069
-0x717A = 0x8071
-0x717B = 0x8983
-0x717C = 0x9878
-0x717D = 0x9880
-0x717E = 0x9883
-0x7221 = 0x9889
-0x7222 = 0x988C
-0x7223 = 0x988D
-0x7224 = 0x988F
-0x7225 = 0x9894
-0x7226 = 0x989A
-0x7227 = 0x989B
-0x7228 = 0x989E
-0x7229 = 0x989F
-0x722A = 0x98A1
-0x722B = 0x98A2
-0x722C = 0x98A5
-0x722D = 0x98A6
-0x722E = 0x864D
-0x722F = 0x8654
-0x7230 = 0x866C
-0x7231 = 0x866E
-0x7232 = 0x867F
-0x7233 = 0x867A
-0x7234 = 0x867C
-0x7235 = 0x867B
-0x7236 = 0x86A8
-0x7237 = 0x868D
-0x7238 = 0x868B
-0x7239 = 0x86AC
-0x723A = 0x869D
-0x723B = 0x86A7
-0x723C = 0x86A3
-0x723D = 0x86AA
-0x723E = 0x8693
-0x723F = 0x86A9
-0x7240 = 0x86B6
-0x7241 = 0x86C4
-0x7242 = 0x86B5
-0x7243 = 0x86CE
-0x7244 = 0x86B0
-0x7245 = 0x86BA
-0x7246 = 0x86B1
-0x7247 = 0x86AF
-0x7248 = 0x86C9
-0x7249 = 0x86CF
-0x724A = 0x86B4
-0x724B = 0x86E9
-0x724C = 0x86F1
-0x724D = 0x86F2
-0x724E = 0x86ED
-0x724F = 0x86F3
-0x7250 = 0x86D0
-0x7251 = 0x8713
-0x7252 = 0x86DE
-0x7253 = 0x86F4
-0x7254 = 0x86DF
-0x7255 = 0x86D8
-0x7256 = 0x86D1
-0x7257 = 0x8703
-0x7258 = 0x8707
-0x7259 = 0x86F8
-0x725A = 0x8708
-0x725B = 0x870A
-0x725C = 0x870D
-0x725D = 0x8709
-0x725E = 0x8723
-0x725F = 0x873B
-0x7260 = 0x871E
-0x7261 = 0x8725
-0x7262 = 0x872E
-0x7263 = 0x871A
-0x7264 = 0x873E
-0x7265 = 0x8748
-0x7266 = 0x8734
-0x7267 = 0x8731
-0x7268 = 0x8729
-0x7269 = 0x8737
-0x726A = 0x873F
-0x726B = 0x8782
-0x726C = 0x8722
-0x726D = 0x877D
-0x726E = 0x877E
-0x726F = 0x877B
-0x7270 = 0x8760
-0x7271 = 0x8770
-0x7272 = 0x874C
-0x7273 = 0x876E
-0x7274 = 0x878B
-0x7275 = 0x8753
-0x7276 = 0x8763
-0x7277 = 0x877C
-0x7278 = 0x8764
-0x7279 = 0x8759
-0x727A = 0x8765
-0x727B = 0x8793
-0x727C = 0x87AF
-0x727D = 0x87A8
-0x727E = 0x87D2
-0x7321 = 0x87C6
-0x7322 = 0x8788
-0x7323 = 0x8785
-0x7324 = 0x87AD
-0x7325 = 0x8797
-0x7326 = 0x8783
-0x7327 = 0x87AB
-0x7328 = 0x87E5
-0x7329 = 0x87AC
-0x732A = 0x87B5
-0x732B = 0x87B3
-0x732C = 0x87CB
-0x732D = 0x87D3
-0x732E = 0x87BD
-0x732F = 0x87D1
-0x7330 = 0x87C0
-0x7331 = 0x87CA
-0x7332 = 0x87DB
-0x7333 = 0x87EA
-0x7334 = 0x87E0
-0x7335 = 0x87EE
-0x7336 = 0x8816
-0x7337 = 0x8813
-0x7338 = 0x87FE
-0x7339 = 0x880A
-0x733A = 0x881B
-0x733B = 0x8821
-0x733C = 0x8839
-0x733D = 0x883C
-0x733E = 0x7F36
-0x733F = 0x7F42
-0x7340 = 0x7F44
-0x7341 = 0x7F45
-0x7342 = 0x8210
-0x7343 = 0x7AFA
-0x7344 = 0x7AFD
-0x7345 = 0x7B08
-0x7346 = 0x7B03
-0x7347 = 0x7B04
-0x7348 = 0x7B15
-0x7349 = 0x7B0A
-0x734A = 0x7B2B
-0x734B = 0x7B0F
-0x734C = 0x7B47
-0x734D = 0x7B38
-0x734E = 0x7B2A
-0x734F = 0x7B19
-0x7350 = 0x7B2E
-0x7351 = 0x7B31
-0x7352 = 0x7B20
-0x7353 = 0x7B25
-0x7354 = 0x7B24
-0x7355 = 0x7B33
-0x7356 = 0x7B3E
-0x7357 = 0x7B1E
-0x7358 = 0x7B58
-0x7359 = 0x7B5A
-0x735A = 0x7B45
-0x735B = 0x7B75
-0x735C = 0x7B4C
-0x735D = 0x7B5D
-0x735E = 0x7B60
-0x735F = 0x7B6E
-0x7360 = 0x7B7B
-0x7361 = 0x7B62
-0x7362 = 0x7B72
-0x7363 = 0x7B71
-0x7364 = 0x7B90
-0x7365 = 0x7BA6
-0x7366 = 0x7BA7
-0x7367 = 0x7BB8
-0x7368 = 0x7BAC
-0x7369 = 0x7B9D
-0x736A = 0x7BA8
-0x736B = 0x7B85
-0x736C = 0x7BAA
-0x736D = 0x7B9C
-0x736E = 0x7BA2
-0x736F = 0x7BAB
-0x7370 = 0x7BB4
-0x7371 = 0x7BD1
-0x7372 = 0x7BC1
-0x7373 = 0x7BCC
-0x7374 = 0x7BDD
-0x7375 = 0x7BDA
-0x7376 = 0x7BE5
-0x7377 = 0x7BE6
-0x7378 = 0x7BEA
-0x7379 = 0x7C0C
-0x737A = 0x7BFE
-0x737B = 0x7BFC
-0x737C = 0x7C0F
-0x737D = 0x7C16
-0x737E = 0x7C0B
-0x7421 = 0x7C1F
-0x7422 = 0x7C2A
-0x7423 = 0x7C26
-0x7424 = 0x7C38
-0x7425 = 0x7C41
-0x7426 = 0x7C40
-0x7427 = 0x81FE
-0x7428 = 0x8201
-0x7429 = 0x8202
-0x742A = 0x8204
-0x742B = 0x81EC
-0x742C = 0x8844
-0x742D = 0x8221
-0x742E = 0x8222
-0x742F = 0x8223
-0x7430 = 0x822D
-0x7431 = 0x822F
-0x7432 = 0x8228
-0x7433 = 0x822B
-0x7434 = 0x8238
-0x7435 = 0x823B
-0x7436 = 0x8233
-0x7437 = 0x8234
-0x7438 = 0x823E
-0x7439 = 0x8244
-0x743A = 0x8249
-0x743B = 0x824B
-0x743C = 0x824F
-0x743D = 0x825A
-0x743E = 0x825F
-0x743F = 0x8268
-0x7440 = 0x887E
-0x7441 = 0x8885
-0x7442 = 0x8888
-0x7443 = 0x88D8
-0x7444 = 0x88DF
-0x7445 = 0x895E
-0x7446 = 0x7F9D
-0x7447 = 0x7F9F
-0x7448 = 0x7FA7
-0x7449 = 0x7FAF
-0x744A = 0x7FB0
-0x744B = 0x7FB2
-0x744C = 0x7C7C
-0x744D = 0x6549
-0x744E = 0x7C91
-0x744F = 0x7C9D
-0x7450 = 0x7C9C
-0x7451 = 0x7C9E
-0x7452 = 0x7CA2
-0x7453 = 0x7CB2
-0x7454 = 0x7CBC
-0x7455 = 0x7CBD
-0x7456 = 0x7CC1
-0x7457 = 0x7CC7
-0x7458 = 0x7CCC
-0x7459 = 0x7CCD
-0x745A = 0x7CC8
-0x745B = 0x7CC5
-0x745C = 0x7CD7
-0x745D = 0x7CE8
-0x745E = 0x826E
-0x745F = 0x66A8
-0x7460 = 0x7FBF
-0x7461 = 0x7FCE
-0x7462 = 0x7FD5
-0x7463 = 0x7FE5
-0x7464 = 0x7FE1
-0x7465 = 0x7FE6
-0x7466 = 0x7FE9
-0x7467 = 0x7FEE
-0x7468 = 0x7FF3
-0x7469 = 0x7CF8
-0x746A = 0x7D77
-0x746B = 0x7DA6
-0x746C = 0x7DAE
-0x746D = 0x7E47
-0x746E = 0x7E9B
-0x746F = 0x9EB8
-0x7470 = 0x9EB4
-0x7471 = 0x8D73
-0x7472 = 0x8D84
-0x7473 = 0x8D94
-0x7474 = 0x8D91
-0x7475 = 0x8DB1
-0x7476 = 0x8D67
-0x7477 = 0x8D6D
-0x7478 = 0x8C47
-0x7479 = 0x8C49
-0x747A = 0x914A
-0x747B = 0x9150
-0x747C = 0x914E
-0x747D = 0x914F
-0x747E = 0x9164
-0x7521 = 0x9162
-0x7522 = 0x9161
-0x7523 = 0x9170
-0x7524 = 0x9169
-0x7525 = 0x916F
-0x7526 = 0x917D
-0x7527 = 0x917E
-0x7528 = 0x9172
-0x7529 = 0x9174
-0x752A = 0x9179
-0x752B = 0x918C
-0x752C = 0x9185
-0x752D = 0x9190
-0x752E = 0x918D
-0x752F = 0x9191
-0x7530 = 0x91A2
-0x7531 = 0x91A3
-0x7532 = 0x91AA
-0x7533 = 0x91AD
-0x7534 = 0x91AE
-0x7535 = 0x91AF
-0x7536 = 0x91B5
-0x7537 = 0x91B4
-0x7538 = 0x91BA
-0x7539 = 0x8C55
-0x753A = 0x9E7E
-0x753B = 0x8DB8
-0x753C = 0x8DEB
-0x753D = 0x8E05
-0x753E = 0x8E59
-0x753F = 0x8E69
-0x7540 = 0x8DB5
-0x7541 = 0x8DBF
-0x7542 = 0x8DBC
-0x7543 = 0x8DBA
-0x7544 = 0x8DC4
-0x7545 = 0x8DD6
-0x7546 = 0x8DD7
-0x7547 = 0x8DDA
-0x7548 = 0x8DDE
-0x7549 = 0x8DCE
-0x754A = 0x8DCF
-0x754B = 0x8DDB
-0x754C = 0x8DC6
-0x754D = 0x8DEC
-0x754E = 0x8DF7
-0x754F = 0x8DF8
-0x7550 = 0x8DE3
-0x7551 = 0x8DF9
-0x7552 = 0x8DFB
-0x7553 = 0x8DE4
-0x7554 = 0x8E09
-0x7555 = 0x8DFD
-0x7556 = 0x8E14
-0x7557 = 0x8E1D
-0x7558 = 0x8E1F
-0x7559 = 0x8E2C
-0x755A = 0x8E2E
-0x755B = 0x8E23
-0x755C = 0x8E2F
-0x755D = 0x8E3A
-0x755E = 0x8E40
-0x755F = 0x8E39
-0x7560 = 0x8E35
-0x7561 = 0x8E3D
-0x7562 = 0x8E31
-0x7563 = 0x8E49
-0x7564 = 0x8E41
-0x7565 = 0x8E42
-0x7566 = 0x8E51
-0x7567 = 0x8E52
-0x7568 = 0x8E4A
-0x7569 = 0x8E70
-0x756A = 0x8E76
-0x756B = 0x8E7C
-0x756C = 0x8E6F
-0x756D = 0x8E74
-0x756E = 0x8E85
-0x756F = 0x8E8F
-0x7570 = 0x8E94
-0x7571 = 0x8E90
-0x7572 = 0x8E9C
-0x7573 = 0x8E9E
-0x7574 = 0x8C78
-0x7575 = 0x8C82
-0x7576 = 0x8C8A
-0x7577 = 0x8C85
-0x7578 = 0x8C98
-0x7579 = 0x8C94
-0x757A = 0x659B
-0x757B = 0x89D6
-0x757C = 0x89DE
-0x757D = 0x89DA
-0x757E = 0x89DC
-0x7621 = 0x89E5
-0x7622 = 0x89EB
-0x7623 = 0x89EF
-0x7624 = 0x8A3E
-0x7625 = 0x8B26
-0x7626 = 0x9753
-0x7627 = 0x96E9
-0x7628 = 0x96F3
-0x7629 = 0x96EF
-0x762A = 0x9706
-0x762B = 0x9701
-0x762C = 0x9708
-0x762D = 0x970F
-0x762E = 0x970E
-0x762F = 0x972A
-0x7630 = 0x972D
-0x7631 = 0x9730
-0x7632 = 0x973E
-0x7633 = 0x9F80
-0x7634 = 0x9F83
-0x7635 = 0x9F85
-0x7636 = 0x9F86
-0x7637 = 0x9F87
-0x7638 = 0x9F88
-0x7639 = 0x9F89
-0x763A = 0x9F8A
-0x763B = 0x9F8C
-0x763C = 0x9EFE
-0x763D = 0x9F0B
-0x763E = 0x9F0D
-0x763F = 0x96B9
-0x7640 = 0x96BC
-0x7641 = 0x96BD
-0x7642 = 0x96CE
-0x7643 = 0x96D2
-0x7644 = 0x77BF
-0x7645 = 0x96E0
-0x7646 = 0x928E
-0x7647 = 0x92AE
-0x7648 = 0x92C8
-0x7649 = 0x933E
-0x764A = 0x936A
-0x764B = 0x93CA
-0x764C = 0x938F
-0x764D = 0x943E
-0x764E = 0x946B
-0x764F = 0x9C7F
-0x7650 = 0x9C82
-0x7651 = 0x9C85
-0x7652 = 0x9C86
-0x7653 = 0x9C87
-0x7654 = 0x9C88
-0x7655 = 0x7A23
-0x7656 = 0x9C8B
-0x7657 = 0x9C8E
-0x7658 = 0x9C90
-0x7659 = 0x9C91
-0x765A = 0x9C92
-0x765B = 0x9C94
-0x765C = 0x9C95
-0x765D = 0x9C9A
-0x765E = 0x9C9B
-0x765F = 0x9C9E
-0x7660 = 0x9C9F
-0x7661 = 0x9CA0
-0x7662 = 0x9CA1
-0x7663 = 0x9CA2
-0x7664 = 0x9CA3
-0x7665 = 0x9CA5
-0x7666 = 0x9CA6
-0x7667 = 0x9CA7
-0x7668 = 0x9CA8
-0x7669 = 0x9CA9
-0x766A = 0x9CAB
-0x766B = 0x9CAD
-0x766C = 0x9CAE
-0x766D = 0x9CB0
-0x766E = 0x9CB1
-0x766F = 0x9CB2
-0x7670 = 0x9CB3
-0x7671 = 0x9CB4
-0x7672 = 0x9CB5
-0x7673 = 0x9CB6
-0x7674 = 0x9CB7
-0x7675 = 0x9CBA
-0x7676 = 0x9CBB
-0x7677 = 0x9CBC
-0x7678 = 0x9CBD
-0x7679 = 0x9CC4
-0x767A = 0x9CC5
-0x767B = 0x9CC6
-0x767C = 0x9CC7
-0x767D = 0x9CCA
-0x767E = 0x9CCB
-0x7721 = 0x9CCC
-0x7722 = 0x9CCD
-0x7723 = 0x9CCE
-0x7724 = 0x9CCF
-0x7725 = 0x9CD0
-0x7726 = 0x9CD3
-0x7727 = 0x9CD4
-0x7728 = 0x9CD5
-0x7729 = 0x9CD7
-0x772A = 0x9CD8
-0x772B = 0x9CD9
-0x772C = 0x9CDC
-0x772D = 0x9CDD
-0x772E = 0x9CDF
-0x772F = 0x9CE2
-0x7730 = 0x977C
-0x7731 = 0x9785
-0x7732 = 0x9791
-0x7733 = 0x9792
-0x7734 = 0x9794
-0x7735 = 0x97AF
-0x7736 = 0x97AB
-0x7737 = 0x97A3
-0x7738 = 0x97B2
-0x7739 = 0x97B4
-0x773A = 0x9AB1
-0x773B = 0x9AB0
-0x773C = 0x9AB7
-0x773D = 0x9E58
-0x773E = 0x9AB6
-0x773F = 0x9ABA
-0x7740 = 0x9ABC
-0x7741 = 0x9AC1
-0x7742 = 0x9AC0
-0x7743 = 0x9AC5
-0x7744 = 0x9AC2
-0x7745 = 0x9ACB
-0x7746 = 0x9ACC
-0x7747 = 0x9AD1
-0x7748 = 0x9B45
-0x7749 = 0x9B43
-0x774A = 0x9B47
-0x774B = 0x9B49
-0x774C = 0x9B48
-0x774D = 0x9B4D
-0x774E = 0x9B51
-0x774F = 0x98E8
-0x7750 = 0x990D
-0x7751 = 0x992E
-0x7752 = 0x9955
-0x7753 = 0x9954
-0x7754 = 0x9ADF
-0x7755 = 0x9AE1
-0x7756 = 0x9AE6
-0x7757 = 0x9AEF
-0x7758 = 0x9AEB
-0x7759 = 0x9AFB
-0x775A = 0x9AED
-0x775B = 0x9AF9
-0x775C = 0x9B08
-0x775D = 0x9B0F
-0x775E = 0x9B13
-0x775F = 0x9B1F
-0x7760 = 0x9B23
-0x7761 = 0x9EBD
-0x7762 = 0x9EBE
-0x7763 = 0x7E3B
-0x7764 = 0x9E82
-0x7765 = 0x9E87
-0x7766 = 0x9E88
-0x7767 = 0x9E8B
-0x7768 = 0x9E92
-0x7769 = 0x93D6
-0x776A = 0x9E9D
-0x776B = 0x9E9F
-0x776C = 0x9EDB
-0x776D = 0x9EDC
-0x776E = 0x9EDD
-0x776F = 0x9EE0
-0x7770 = 0x9EDF
-0x7771 = 0x9EE2
-0x7772 = 0x9EE9
-0x7773 = 0x9EE7
-0x7774 = 0x9EE5
-0x7775 = 0x9EEA
-0x7776 = 0x9EEF
-0x7777 = 0x9F22
-0x7778 = 0x9F2C
-0x7779 = 0x9F2F
-0x777A = 0x9F39
-0x777B = 0x9F37
-0x777C = 0x9F3D
-0x777D = 0x9F3E
-0x777E = 0x9F44
-END_MAP
diff --git a/enc/trans/GB/UCS%GB12345.src b/enc/trans/GB/UCS%GB12345.src
deleted file mode 100644
index 8ec8318438..0000000000
--- a/enc/trans/GB/UCS%GB12345.src
+++ /dev/null
@@ -1,7620 +0,0 @@
-# $NetBSD: UCS%GB12345.src,v 1.1 2006/11/23 03:25:24 tnozaki Exp $
-
-TYPE ROWCOL
-NAME "UCS/GB12345"
-SRC_ZONE 0x00A4 - 0xFFE5
-OOB_MODE INVALID
-DST_INVALID 0xFFFF
-DST_UNIT_BITS 16
-
-BEGIN_MAP
-#
-# 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
-0x00A7 = 0x216C
-0x00A8 = 0x2127
-0x00B0 = 0x2163
-0x00B1 = 0x2140
-0x00B7 = 0x2124
-0x00D7 = 0x2141
-0x00E0 = 0x2824
-0x00E1 = 0x2822
-0x00E8 = 0x2828
-0x00E9 = 0x2826
-0x00EA = 0x283A
-0x00EC = 0x282C
-0x00ED = 0x282A
-0x00F2 = 0x2830
-0x00F3 = 0x282E
-0x00F7 = 0x2142
-0x00F9 = 0x2834
-0x00FA = 0x2832
-0x00FC = 0x2839
-0x0101 = 0x2821
-0x0113 = 0x2825
-0x011B = 0x2827
-0x012B = 0x2829
-0x014D = 0x282D
-0x016B = 0x2831
-0x01CE = 0x2823
-0x01D0 = 0x282B
-0x01D2 = 0x282F
-0x01D4 = 0x2833
-0x01D6 = 0x2835
-0x01D8 = 0x2836
-0x01DA = 0x2837
-0x01DC = 0x2838
-0x02C7 = 0x2126
-0x02C9 = 0x2125
-0x0391 = 0x2621
-0x0392 = 0x2622
-0x0393 = 0x2623
-0x0394 = 0x2624
-0x0395 = 0x2625
-0x0396 = 0x2626
-0x0397 = 0x2627
-0x0398 = 0x2628
-0x0399 = 0x2629
-0x039A = 0x262A
-0x039B = 0x262B
-0x039C = 0x262C
-0x039D = 0x262D
-0x039E = 0x262E
-0x039F = 0x262F
-0x03A0 = 0x2630
-0x03A1 = 0x2631
-0x03A3 = 0x2632
-0x03A4 = 0x2633
-0x03A5 = 0x2634
-0x03A6 = 0x2635
-0x03A7 = 0x2636
-0x03A8 = 0x2637
-0x03A9 = 0x2638
-0x03B1 = 0x2641
-0x03B2 = 0x2642
-0x03B3 = 0x2643
-0x03B4 = 0x2644
-0x03B5 = 0x2645
-0x03B6 = 0x2646
-0x03B7 = 0x2647
-0x03B8 = 0x2648
-0x03B9 = 0x2649
-0x03BA = 0x264A
-0x03BB = 0x264B
-0x03BC = 0x264C
-0x03BD = 0x264D
-0x03BE = 0x264E
-0x03BF = 0x264F
-0x03C0 = 0x2650
-0x03C1 = 0x2651
-0x03C3 = 0x2652
-0x03C4 = 0x2653
-0x03C5 = 0x2654
-0x03C6 = 0x2655
-0x03C7 = 0x2656
-0x03C8 = 0x2657
-0x03C9 = 0x2658
-0x0401 = 0x2727
-0x0410 = 0x2721
-0x0411 = 0x2722
-0x0412 = 0x2723
-0x0413 = 0x2724
-0x0414 = 0x2725
-0x0415 = 0x2726
-0x0416 = 0x2728
-0x0417 = 0x2729
-0x0418 = 0x272A
-0x0419 = 0x272B
-0x041A = 0x272C
-0x041B = 0x272D
-0x041C = 0x272E
-0x041D = 0x272F
-0x041E = 0x2730
-0x041F = 0x2731
-0x0420 = 0x2732
-0x0421 = 0x2733
-0x0422 = 0x2734
-0x0423 = 0x2735
-0x0424 = 0x2736
-0x0425 = 0x2737
-0x0426 = 0x2738
-0x0427 = 0x2739
-0x0428 = 0x273A
-0x0429 = 0x273B
-0x042A = 0x273C
-0x042B = 0x273D
-0x042C = 0x273E
-0x042D = 0x273F
-0x042E = 0x2740
-0x042F = 0x2741
-0x0430 = 0x2751
-0x0431 = 0x2752
-0x0432 = 0x2753
-0x0433 = 0x2754
-0x0434 = 0x2755
-0x0435 = 0x2756
-0x0436 = 0x2758
-0x0437 = 0x2759
-0x0438 = 0x275A
-0x0439 = 0x275B
-0x043A = 0x275C
-0x043B = 0x275D
-0x043C = 0x275E
-0x043D = 0x275F
-0x043E = 0x2760
-0x043F = 0x2761
-0x0440 = 0x2762
-0x0441 = 0x2763
-0x0442 = 0x2764
-0x0443 = 0x2765
-0x0444 = 0x2766
-0x0445 = 0x2767
-0x0446 = 0x2768
-0x0447 = 0x2769
-0x0448 = 0x276A
-0x0449 = 0x276B
-0x044A = 0x276C
-0x044B = 0x276D
-0x044C = 0x276E
-0x044D = 0x276F
-0x044E = 0x2770
-0x044F = 0x2771
-0x0451 = 0x2757
-0x2014 = 0x212A
-0x2015 = 0x212A # fallback -> 0x2014
-0x2016 = 0x212C
-0x2018 = 0x212E
-0x2019 = 0x212F
-0x201C = 0x2130
-0x201D = 0x2131
-0x2026 = 0x212D
-0x2030 = 0x216B
-0x2032 = 0x2164
-0x2033 = 0x2165
-0x203B = 0x2179
-0x2103 = 0x2166
-0x2116 = 0x216D
-0x2160 = 0x2271
-0x2161 = 0x2272
-0x2162 = 0x2273
-0x2163 = 0x2274
-0x2164 = 0x2275
-0x2165 = 0x2276
-0x2166 = 0x2277
-0x2167 = 0x2278
-0x2168 = 0x2279
-0x2169 = 0x227A
-0x216A = 0x227B
-0x216B = 0x227C
-0x2190 = 0x217B
-0x2191 = 0x217C
-0x2192 = 0x217A
-0x2193 = 0x217D
-0x2208 = 0x214A
-0x220F = 0x2147
-0x2211 = 0x2146
-0x221A = 0x214C
-0x221D = 0x2158
-0x221E = 0x215E
-0x2220 = 0x214F
-0x2225 = 0x214E
-0x2227 = 0x2144
-0x2228 = 0x2145
-0x2229 = 0x2149
-0x222A = 0x2148
-0x222B = 0x2152
-0x222E = 0x2153
-0x2234 = 0x2160
-0x2235 = 0x215F
-0x2236 = 0x2143
-0x2237 = 0x214B
-0x223D = 0x2157
-0x2248 = 0x2156
-0x224C = 0x2155
-0x2260 = 0x2159
-0x2261 = 0x2154
-0x2264 = 0x215C
-0x2265 = 0x215D
-0x226E = 0x215A
-0x226F = 0x215B
-0x2299 = 0x2151
-0x22A5 = 0x214D
-0x2312 = 0x2150
-0x2460 = 0x2259
-0x2461 = 0x225A
-0x2462 = 0x225B
-0x2463 = 0x225C
-0x2464 = 0x225D
-0x2465 = 0x225E
-0x2466 = 0x225F
-0x2467 = 0x2260
-0x2468 = 0x2261
-0x2469 = 0x2262
-0x2474 = 0x2245
-0x2475 = 0x2246
-0x2476 = 0x2247
-0x2477 = 0x2248
-0x2478 = 0x2249
-0x2479 = 0x224A
-0x247A = 0x224B
-0x247B = 0x224C
-0x247C = 0x224D
-0x247D = 0x224E
-0x247E = 0x224F
-0x247F = 0x2250
-0x2480 = 0x2251
-0x2481 = 0x2252
-0x2482 = 0x2253
-0x2483 = 0x2254
-0x2484 = 0x2255
-0x2485 = 0x2256
-0x2486 = 0x2257
-0x2487 = 0x2258
-0x2488 = 0x2231
-0x2489 = 0x2232
-0x248A = 0x2233
-0x248B = 0x2234
-0x248C = 0x2235
-0x248D = 0x2236
-0x248E = 0x2237
-0x248F = 0x2238
-0x2490 = 0x2239
-0x2491 = 0x223A
-0x2492 = 0x223B
-0x2493 = 0x223C
-0x2494 = 0x223D
-0x2495 = 0x223E
-0x2496 = 0x223F
-0x2497 = 0x2240
-0x2498 = 0x2241
-0x2499 = 0x2242
-0x249A = 0x2243
-0x249B = 0x2244
-0x2500 = 0x2924
-0x2501 = 0x2925
-0x2502 = 0x2926
-0x2503 = 0x2927
-0x2504 = 0x2928
-0x2505 = 0x2929
-0x2506 = 0x292A
-0x2507 = 0x292B
-0x2508 = 0x292C
-0x2509 = 0x292D
-0x250A = 0x292E
-0x250B = 0x292F
-0x250C = 0x2930
-0x250D = 0x2931
-0x250E = 0x2932
-0x250F = 0x2933
-0x2510 = 0x2934
-0x2511 = 0x2935
-0x2512 = 0x2936
-0x2513 = 0x2937
-0x2514 = 0x2938
-0x2515 = 0x2939
-0x2516 = 0x293A
-0x2517 = 0x293B
-0x2518 = 0x293C
-0x2519 = 0x293D
-0x251A = 0x293E
-0x251B = 0x293F
-0x251C = 0x2940
-0x251D = 0x2941
-0x251E = 0x2942
-0x251F = 0x2943
-0x2520 = 0x2944
-0x2521 = 0x2945
-0x2522 = 0x2946
-0x2523 = 0x2947
-0x2524 = 0x2948
-0x2525 = 0x2949
-0x2526 = 0x294A
-0x2527 = 0x294B
-0x2528 = 0x294C
-0x2529 = 0x294D
-0x252A = 0x294E
-0x252B = 0x294F
-0x252C = 0x2950
-0x252D = 0x2951
-0x252E = 0x2952
-0x252F = 0x2953
-0x2530 = 0x2954
-0x2531 = 0x2955
-0x2532 = 0x2956
-0x2533 = 0x2957
-0x2534 = 0x2958
-0x2535 = 0x2959
-0x2536 = 0x295A
-0x2537 = 0x295B
-0x2538 = 0x295C
-0x2539 = 0x295D
-0x253A = 0x295E
-0x253B = 0x295F
-0x253C = 0x2960
-0x253D = 0x2961
-0x253E = 0x2962
-0x253F = 0x2963
-0x2540 = 0x2964
-0x2541 = 0x2965
-0x2542 = 0x2966
-0x2543 = 0x2967
-0x2544 = 0x2968
-0x2545 = 0x2969
-0x2546 = 0x296A
-0x2547 = 0x296B
-0x2548 = 0x296C
-0x2549 = 0x296D
-0x254A = 0x296E
-0x254B = 0x296F
-0x25A0 = 0x2176
-0x25A1 = 0x2175
-0x25B2 = 0x2178
-0x25B3 = 0x2177
-0x25C6 = 0x2174
-0x25C7 = 0x2173
-0x25CB = 0x2170
-0x25CE = 0x2172
-0x25CF = 0x2171
-0x2605 = 0x216F
-0x2606 = 0x216E
-0x2640 = 0x2162
-0x2642 = 0x2161
-0x3000 = 0x2121
-0x3001 = 0x2122
-0x3002 = 0x2123
-0x3003 = 0x2128
-0x3005 = 0x2129
-0x3008 = 0x2134
-0x3009 = 0x2135
-0x300A = 0x2136
-0x300B = 0x2137
-0x300C = 0x2138
-0x300D = 0x2139
-0x300E = 0x213A
-0x300F = 0x213B
-0x3010 = 0x213E
-0x3011 = 0x213F
-0x3013 = 0x217E
-0x3014 = 0x2132
-0x3015 = 0x2133
-0x3016 = 0x213C
-0x3017 = 0x213D
-0x3041 = 0x2421
-0x3042 = 0x2422
-0x3043 = 0x2423
-0x3044 = 0x2424
-0x3045 = 0x2425
-0x3046 = 0x2426
-0x3047 = 0x2427
-0x3048 = 0x2428
-0x3049 = 0x2429
-0x304A = 0x242A
-0x304B = 0x242B
-0x304C = 0x242C
-0x304D = 0x242D
-0x304E = 0x242E
-0x304F = 0x242F
-0x3050 = 0x2430
-0x3051 = 0x2431
-0x3052 = 0x2432
-0x3053 = 0x2433
-0x3054 = 0x2434
-0x3055 = 0x2435
-0x3056 = 0x2436
-0x3057 = 0x2437
-0x3058 = 0x2438
-0x3059 = 0x2439
-0x305A = 0x243A
-0x305B = 0x243B
-0x305C = 0x243C
-0x305D = 0x243D
-0x305E = 0x243E
-0x305F = 0x243F
-0x3060 = 0x2440
-0x3061 = 0x2441
-0x3062 = 0x2442
-0x3063 = 0x2443
-0x3064 = 0x2444
-0x3065 = 0x2445
-0x3066 = 0x2446
-0x3067 = 0x2447
-0x3068 = 0x2448
-0x3069 = 0x2449
-0x306A = 0x244A
-0x306B = 0x244B
-0x306C = 0x244C
-0x306D = 0x244D
-0x306E = 0x244E
-0x306F = 0x244F
-0x3070 = 0x2450
-0x3071 = 0x2451
-0x3072 = 0x2452
-0x3073 = 0x2453
-0x3074 = 0x2454
-0x3075 = 0x2455
-0x3076 = 0x2456
-0x3077 = 0x2457
-0x3078 = 0x2458
-0x3079 = 0x2459
-0x307A = 0x245A
-0x307B = 0x245B
-0x307C = 0x245C
-0x307D = 0x245D
-0x307E = 0x245E
-0x307F = 0x245F
-0x3080 = 0x2460
-0x3081 = 0x2461
-0x3082 = 0x2462
-0x3083 = 0x2463
-0x3084 = 0x2464
-0x3085 = 0x2465
-0x3086 = 0x2466
-0x3087 = 0x2467
-0x3088 = 0x2468
-0x3089 = 0x2469
-0x308A = 0x246A
-0x308B = 0x246B
-0x308C = 0x246C
-0x308D = 0x246D
-0x308E = 0x246E
-0x308F = 0x246F
-0x3090 = 0x2470
-0x3091 = 0x2471
-0x3092 = 0x2472
-0x3093 = 0x2473
-0x30A1 = 0x2521
-0x30A2 = 0x2522
-0x30A3 = 0x2523
-0x30A4 = 0x2524
-0x30A5 = 0x2525
-0x30A6 = 0x2526
-0x30A7 = 0x2527
-0x30A8 = 0x2528
-0x30A9 = 0x2529
-0x30AA = 0x252A
-0x30AB = 0x252B
-0x30AC = 0x252C
-0x30AD = 0x252D
-0x30AE = 0x252E
-0x30AF = 0x252F
-0x30B0 = 0x2530
-0x30B1 = 0x2531
-0x30B2 = 0x2532
-0x30B3 = 0x2533
-0x30B4 = 0x2534
-0x30B5 = 0x2535
-0x30B6 = 0x2536
-0x30B7 = 0x2537
-0x30B8 = 0x2538
-0x30B9 = 0x2539
-0x30BA = 0x253A
-0x30BB = 0x253B
-0x30BC = 0x253C
-0x30BD = 0x253D
-0x30BE = 0x253E
-0x30BF = 0x253F
-0x30C0 = 0x2540
-0x30C1 = 0x2541
-0x30C2 = 0x2542
-0x30C3 = 0x2543
-0x30C4 = 0x2544
-0x30C5 = 0x2545
-0x30C6 = 0x2546
-0x30C7 = 0x2547
-0x30C8 = 0x2548
-0x30C9 = 0x2549
-0x30CA = 0x254A
-0x30CB = 0x254B
-0x30CC = 0x254C
-0x30CD = 0x254D
-0x30CE = 0x254E
-0x30CF = 0x254F
-0x30D0 = 0x2550
-0x30D1 = 0x2551
-0x30D2 = 0x2552
-0x30D3 = 0x2553
-0x30D4 = 0x2554
-0x30D5 = 0x2555
-0x30D6 = 0x2556
-0x30D7 = 0x2557
-0x30D8 = 0x2558
-0x30D9 = 0x2559
-0x30DA = 0x255A
-0x30DB = 0x255B
-0x30DC = 0x255C
-0x30DD = 0x255D
-0x30DE = 0x255E
-0x30DF = 0x255F
-0x30E0 = 0x2560
-0x30E1 = 0x2561
-0x30E2 = 0x2562
-0x30E3 = 0x2563
-0x30E4 = 0x2564
-0x30E5 = 0x2565
-0x30E6 = 0x2566
-0x30E7 = 0x2567
-0x30E8 = 0x2568
-0x30E9 = 0x2569
-0x30EA = 0x256A
-0x30EB = 0x256B
-0x30EC = 0x256C
-0x30ED = 0x256D
-0x30EE = 0x256E
-0x30EF = 0x256F
-0x30F0 = 0x2570
-0x30F1 = 0x2571
-0x30F2 = 0x2572
-0x30F3 = 0x2573
-0x30F4 = 0x2574
-0x30F5 = 0x2575
-0x30F6 = 0x2576
-0x30FB = 0x2124 # fallback -> 0x00B7
-0x3105 = 0x2845
-0x3106 = 0x2846
-0x3107 = 0x2847
-0x3108 = 0x2848
-0x3109 = 0x2849
-0x310A = 0x284A
-0x310B = 0x284B
-0x310C = 0x284C
-0x310D = 0x284D
-0x310E = 0x284E
-0x310F = 0x284F
-0x3110 = 0x2850
-0x3111 = 0x2851
-0x3112 = 0x2852
-0x3113 = 0x2853
-0x3114 = 0x2854
-0x3115 = 0x2855
-0x3116 = 0x2856
-0x3117 = 0x2857
-0x3118 = 0x2858
-0x3119 = 0x2859
-0x311A = 0x285A
-0x311B = 0x285B
-0x311C = 0x285C
-0x311D = 0x285D
-0x311E = 0x285E
-0x311F = 0x285F
-0x3120 = 0x2860
-0x3121 = 0x2861
-0x3122 = 0x2862
-0x3123 = 0x2863
-0x3124 = 0x2864
-0x3125 = 0x2865
-0x3126 = 0x2866
-0x3127 = 0x2867
-0x3128 = 0x2868
-0x3129 = 0x2869
-0x3220 = 0x2265
-0x3221 = 0x2266
-0x3222 = 0x2267
-0x3223 = 0x2268
-0x3224 = 0x2269
-0x3225 = 0x226A
-0x3226 = 0x226B
-0x3227 = 0x226C
-0x3228 = 0x226D
-0x3229 = 0x226E
-0x4E00 = 0x523B
-0x4E01 = 0x3621
-0x4E03 = 0x465F
-0x4E07 = 0x7871
-0x4E08 = 0x5549
-0x4E09 = 0x487D
-0x4E0A = 0x494F
-0x4E0B = 0x4F42
-0x4E0C = 0x5822
-0x4E0D = 0x323B
-0x4E10 = 0x5824
-0x4E11 = 0x7829
-0x4E14 = 0x4752
-0x4E15 = 0x5827
-0x4E16 = 0x4A40
-0x4E18 = 0x4770
-0x4E19 = 0x317B
-0x4E1E = 0x5829
-0x4E22 = 0x362A
-0x4E28 = 0x582D
-0x4E2B = 0x513E
-0x4E2C = 0x635C
-0x4E2D = 0x5650
-0x4E30 = 0x7833
-0x4E32 = 0x342E
-0x4E36 = 0x583C
-0x4E38 = 0x4D68
-0x4E39 = 0x3524
-0x4E3B = 0x5677
-0x4E3F = 0x582F
-0x4E43 = 0x444B
-0x4E45 = 0x3E43
-0x4E47 = 0x5831
-0x4E48 = 0x7761
-0x4E4B = 0x562E
-0x4E4D = 0x5527
-0x4E4E = 0x3A75
-0x4E4F = 0x3726
-0x4E52 = 0x4639
-0x4E53 = 0x4552
-0x4E56 = 0x3954
-0x4E58 = 0x334B
-0x4E59 = 0x5252
-0x4E5C = 0x583F
-0x4E5D = 0x3E45
-0x4E5E = 0x4672
-0x4E5F = 0x5232
-0x4E69 = 0x5840
-0x4E73 = 0x4869
-0x4E7E = 0x472C
-0x4E82 = 0x4252
-0x4E86 = 0x414B
-0x4E88 = 0x5368
-0x4E8B = 0x4A42
-0x4E8C = 0x367E
-0x4E8D = 0x5821
-0x4E8E = 0x535A
-0x4E91 = 0x787D
-0x4E92 = 0x3B25
-0x4E93 = 0x5841
-0x4E94 = 0x4E65
-0x4E95 = 0x3E2E
-0x4E98 = 0x5828
-0x4E9B = 0x5029
-0x4E9E = 0x5147
-0x4E9F = 0x583D
-0x4EA0 = 0x596F
-0x4EA1 = 0x4D76
-0x4EA2 = 0x3F3A
-0x4EA4 = 0x3D3B
-0x4EA5 = 0x3A25
-0x4EA6 = 0x5260
-0x4EA8 = 0x3A60
-0x4EAB = 0x4F6D
-0x4EAC = 0x3E29
-0x4EAD = 0x4D24
-0x4EAE = 0x4141
-0x4EB3 = 0x5971
-0x4EBA = 0x484B
-0x4EBB = 0x5869
-0x4EC0 = 0x4A32
-0x4EC1 = 0x484A
-0x4EC2 = 0x586C
-0x4EC3 = 0x586A
-0x4EC4 = 0x5846
-0x4EC6 = 0x785F
-0x4EC7 = 0x3370
-0x4EC9 = 0x586B
-0x4ECA = 0x3D71
-0x4ECB = 0x3D69
-0x4ECD = 0x4854
-0x4ED4 = 0x5750
-0x4ED5 = 0x4A4B
-0x4ED6 = 0x4B7B
-0x4ED7 = 0x554C
-0x4ED8 = 0x3836
-0x4ED9 = 0x4F49
-0x4EDD = 0x595A
-0x4EDE = 0x5870
-0x4EDF = 0x472A
-0x4EE1 = 0x586E
-0x4EE3 = 0x347A
-0x4EE4 = 0x416E
-0x4EE5 = 0x5254
-0x4EE8 = 0x586D
-0x4EEB = 0x586F
-0x4EF0 = 0x5176
-0x4EF2 = 0x5659
-0x4EF3 = 0x5872
-0x4EF5 = 0x5875
-0x4EF6 = 0x3C7E
-0x4EF7 = 0x7842
-0x4EFB = 0x484E
-0x4EFD = 0x375D
-0x4EFF = 0x3742
-0x4F01 = 0x4673
-0x4F09 = 0x5878
-0x4F0A = 0x5241
-0x4F0D = 0x4E69
-0x4F0E = 0x3C3F
-0x4F0F = 0x377C
-0x4F10 = 0x3725
-0x4F11 = 0x505D
-0x4F19 = 0x3B6F
-0x4F22 = 0x5873
-0x4F2F = 0x322E
-0x4F30 = 0x3940
-0x4F32 = 0x5923
-0x4F34 = 0x3069
-0x4F36 = 0x4166
-0x4F38 = 0x496C
-0x4F3A = 0x4B45
-0x4F3C = 0x4B46
-0x4F3D = 0x5924
-0x4F43 = 0x3568
-0x4F46 = 0x352B
-0x4F47 = 0x5879
-0x4F4D = 0x4E3B
-0x4F4E = 0x354D
-0x4F4F = 0x5721
-0x4F50 = 0x5774
-0x4F51 = 0x5353
-0x4F55 = 0x3A4E
-0x4F57 = 0x5922
-0x4F58 = 0x595C
-0x4F59 = 0x6245
-0x4F5A = 0x587D
-0x4F5B = 0x3770
-0x4F5C = 0x5777
-0x4F5D = 0x587E
-0x4F5E = 0x587A
-0x4F5F = 0x5921
-0x4F60 = 0x4463
-0x4F64 = 0x5874
-0x4F67 = 0x587B
-0x4F69 = 0x4565
-0x4F6C = 0x4050
-0x4F6F = 0x5170
-0x4F70 = 0x305B
-0x4F73 = 0x3C51
-0x4F74 = 0x5926
-0x4F76 = 0x5925
-0x4F7B = 0x592C
-0x4F7C = 0x592E
-0x4F7E = 0x592B
-0x4F7F = 0x4A39
-0x4F83 = 0x5929
-0x4F84 = 0x5636
-0x4F86 = 0x4034
-0x4F88 = 0x335E
-0x4F89 = 0x5928
-0x4F8B = 0x407D
-0x4F8D = 0x4A4C
-0x4F8F = 0x592A
-0x4F91 = 0x5927
-0x4F94 = 0x5930
-0x4F96 = 0x4258
-0x4F97 = 0x3631
-0x4F9B = 0x3929
-0x4F9D = 0x5240
-0x4FA3 = 0x4242
-0x4FAE = 0x4E6A
-0x4FAF = 0x3A6E
-0x4FB5 = 0x4756
-0x4FBF = 0x3163
-0x4FC2 = 0x7872
-0x4FC3 = 0x3459
-0x4FC4 = 0x366D
-0x4FC5 = 0x5934
-0x4FCA = 0x3F21
-0x4FCE = 0x595E
-0x4FCF = 0x474E
-0x4FD0 = 0x407E
-0x4FD1 = 0x5938
-0x4FD7 = 0x4B57
-0x4FD8 = 0x377D
-0x4FDA = 0x5935
-0x4FDC = 0x5937
-0x4FDD = 0x3123
-0x4FDE = 0x5361
-0x4FDF = 0x5939
-0x4FE0 = 0x4F40
-0x4FE1 = 0x5045
-0x4FE3 = 0x5936
-0x4FEE = 0x505E
-0x4FEF = 0x3829
-0x4FF1 = 0x3E63
-0x4FF3 = 0x593D
-0x4FF8 = 0x593A
-0x4FFA = 0x3033
-0x4FFE = 0x5942
-0x5000 = 0x5876
-0x5006 = 0x4129
-0x5009 = 0x3256
-0x500B = 0x3876
-0x500C = 0x5944
-0x500D = 0x3136
-0x500F = 0x593F
-0x5011 = 0x4347
-0x5012 = 0x3539
-0x5014 = 0x3E73
-0x5018 = 0x4C48
-0x5019 = 0x3A72
-0x501A = 0x5250
-0x501C = 0x5943
-0x501F = 0x3D68
-0x5021 = 0x332B
-0x5025 = 0x5945
-0x5026 = 0x3E6B
-0x5028 = 0x5946
-0x5029 = 0x593B
-0x502A = 0x445F
-0x502B = 0x4257
-0x502C = 0x593E
-0x502D = 0x5941
-0x502E = 0x5940
-0x503C = 0x5635
-0x5043 = 0x5948
-0x5047 = 0x3C59
-0x5048 = 0x594A
-0x5049 = 0x4E30
-0x504C = 0x593C
-0x504E = 0x594B
-0x504F = 0x462B
-0x5055 = 0x5949
-0x505A = 0x5776
-0x505C = 0x4D23
-0x5065 = 0x3D21
-0x506C = 0x594C
-0x5074 = 0x3260
-0x5075 = 0x556C
-0x5076 = 0x453C
-0x5077 = 0x4D35
-0x5080 = 0x3F7E
-0x5085 = 0x3835
-0x5088 = 0x407C
-0x508D = 0x3078
-0x5096 = 0x5877
-0x5098 = 0x4921
-0x5099 = 0x3138
-0x50A2 = 0x7841
-0x50A3 = 0x3476
-0x50AC = 0x345F
-0x50AD = 0x5336
-0x50B2 = 0x3041
-0x50B3 = 0x342B
-0x50B4 = 0x5871
-0x50B5 = 0x552E
-0x50B7 = 0x494B
-0x50BA = 0x5951
-0x50BB = 0x4935
-0x50BE = 0x4763
-0x50C2 = 0x594D
-0x50C5 = 0x3D76
-0x50C9 = 0x595D
-0x50CF = 0x4F71
-0x50D1 = 0x4748
-0x50D5 = 0x464D
-0x50D6 = 0x5952
-0x50DA = 0x4145
-0x50DE = 0x4E31
-0x50E5 = 0x3D44
-0x50E6 = 0x5956
-0x50E7 = 0x492E
-0x50E8 = 0x5947
-0x50EC = 0x5955
-0x50ED = 0x5954
-0x50EE = 0x5957
-0x50F3 = 0x4B5B
-0x50F5 = 0x3D29
-0x50F9 = 0x3C5B
-0x50FB = 0x4627
-0x5100 = 0x5247
-0x5102 = 0x592F
-0x5104 = 0x525A
-0x5106 = 0x5953
-0x5107 = 0x5958
-0x5108 = 0x3F6B
-0x5109 = 0x3C73
-0x510B = 0x5959
-0x5110 = 0x594F
-0x5112 = 0x4865
-0x5114 = 0x5931
-0x5115 = 0x592D
-0x5118 = 0x7845
-0x511F = 0x3325
-0x5121 = 0x405C
-0x512A = 0x5345
-0x5132 = 0x3422
-0x5137 = 0x5933
-0x513A = 0x5950
-0x513B = 0x594E
-0x513C = 0x5932
-0x5140 = 0x5823
-0x5141 = 0x544A
-0x5143 = 0x542A
-0x5144 = 0x5056
-0x5145 = 0x3364
-0x5146 = 0x5557
-0x5148 = 0x4F48
-0x5149 = 0x3962
-0x514B = 0x3F4B
-0x514D = 0x4362
-0x5151 = 0x3652
-0x5152 = 0x3679
-0x5154 = 0x4D43
-0x5155 = 0x596E
-0x5156 = 0x5970
-0x515A = 0x782C
-0x515C = 0x3635
-0x5162 = 0x3E24
-0x5165 = 0x486B
-0x5168 = 0x482B
-0x5169 = 0x413D
-0x516B = 0x304B
-0x516C = 0x392B
-0x516D = 0x4179
-0x516E = 0x5962
-0x5171 = 0x3932
-0x5175 = 0x3178
-0x5176 = 0x4664
-0x5177 = 0x3E5F
-0x5178 = 0x3564
-0x5179 = 0x5748
-0x517C = 0x3C66
-0x5180 = 0x3C3D
-0x5182 = 0x5867
-0x5185 = 0x445A
-0x5189 = 0x483D
-0x518C = 0x3261
-0x518D = 0x5459
-0x5192 = 0x4330
-0x5195 = 0x4361
-0x5196 = 0x5A22
-0x5197 = 0x485F
-0x51A0 = 0x395A
-0x51A2 = 0x5A23
-0x51A4 = 0x5429
-0x51A5 = 0x5A24
-0x51AB = 0x597B
-0x51AC = 0x362C
-0x51B0 = 0x3179
-0x51B1 = 0x597C
-0x51B2 = 0x7828
-0x51B3 = 0x3E76
-0x51B5 = 0x3F76
-0x51B6 = 0x5231
-0x51B7 = 0x4064
-0x51BC = 0x597E
-0x51BD = 0x597D
-0x51C4 = 0x4660
-0x51C6 = 0x7929
-0x51C7 = 0x5A21
-0x51C8 = 0x3E3B
-0x51C9 = 0x4139
-0x51CB = 0x3572
-0x51CC = 0x4168
-0x51CD = 0x3633
-0x51CF = 0x3C75
-0x51D1 = 0x3455
-0x51DB = 0x415D
-0x51DD = 0x447D
-0x51E0 = 0x7840
-0x51E1 = 0x3732
-0x51ED = 0x785D
-0x51F0 = 0x3B4B
-0x51F1 = 0x3F2D
-0x51F3 = 0x354A
-0x51F5 = 0x5B49
-0x51F6 = 0x5057
-0x51F8 = 0x4D39
-0x51F9 = 0x303C
-0x51FA = 0x3376
-0x51FC = 0x5B4A
-0x51FD = 0x3A2F
-0x5200 = 0x3536
-0x5201 = 0x3573
-0x5202 = 0x5856
-0x5203 = 0x4850
-0x5206 = 0x3756
-0x5207 = 0x4750
-0x5208 = 0x5857
-0x520A = 0x3F2F
-0x520E = 0x5858
-0x5211 = 0x504C
-0x5212 = 0x783B
-0x5216 = 0x6B3E
-0x5217 = 0x4150
-0x521D = 0x3375
-0x5220 = 0x493E
-0x5224 = 0x4550
-0x5228 = 0x4559
-0x5229 = 0x407B
-0x522B = 0x3170
-0x522E = 0x394E
-0x5230 = 0x353D
-0x5233 = 0x585A
-0x5236 = 0x5646
-0x5237 = 0x4B22
-0x5238 = 0x482F
-0x5239 = 0x4932
-0x523A = 0x344C
-0x523B = 0x3F4C
-0x5241 = 0x3667
-0x5243 = 0x4C6A
-0x5244 = 0x5859
-0x5247 = 0x5472
-0x524A = 0x4F77
-0x524B = 0x7848
-0x524C = 0x585D
-0x524D = 0x4730
-0x5254 = 0x4C5E
-0x5256 = 0x464A
-0x525B = 0x3855
-0x525C = 0x5860
-0x525E = 0x585E
-0x5261 = 0x585F
-0x5265 = 0x307E
-0x5269 = 0x4A23
-0x526A = 0x3C74
-0x526E = 0x3950
-0x526F = 0x3831
-0x5272 = 0x386E
-0x5274 = 0x585C
-0x5275 = 0x3434
-0x527D = 0x5862
-0x527F = 0x3D4B
-0x5281 = 0x5864
-0x5282 = 0x5863
-0x5283 = 0x3B2E
-0x5287 = 0x3E67
-0x5288 = 0x457C
-0x5289 = 0x4175
-0x528A = 0x3974
-0x528C = 0x585B
-0x528D = 0x3D23
-0x5290 = 0x5865
-0x5291 = 0x3C41
-0x5293 = 0x5866
-0x529B = 0x4126
-0x529F = 0x3926
-0x52A0 = 0x3C53
-0x52A3 = 0x4153
-0x52A9 = 0x567A
-0x52AA = 0x452C
-0x52AB = 0x3D59
-0x52AC = 0x5B3E
-0x52AD = 0x5B3F
-0x52BE = 0x5B40
-0x52C1 = 0x3E22
-0x52C3 = 0x322A
-0x52C7 = 0x5342
-0x52C9 = 0x4363
-0x52D0 = 0x5B42
-0x52D2 = 0x4055
-0x52D5 = 0x362F
-0x52D6 = 0x5B43
-0x52D8 = 0x3F31
-0x52D9 = 0x4E71
-0x52DB = 0x512B
-0x52DD = 0x4A24
-0x52DE = 0x404D
-0x52DF = 0x443C
-0x52E2 = 0x4A46
-0x52E4 = 0x475A
-0x52F0 = 0x5B44
-0x52F1 = 0x5B3D
-0x52F5 = 0x4078
-0x52F8 = 0x4830
-0x52F9 = 0x5968
-0x52FA = 0x4957
-0x52FE = 0x3934
-0x52FF = 0x4E70
-0x5300 = 0x5448
-0x5305 = 0x307C
-0x5306 = 0x3452
-0x5308 = 0x5059
-0x530D = 0x5969
-0x530F = 0x5E4B
-0x5310 = 0x596B
-0x5315 = 0x5830
-0x5316 = 0x3B2F
-0x5317 = 0x3131
-0x5319 = 0x3357
-0x531A = 0x584E
-0x531D = 0x5451
-0x5320 = 0x3D33
-0x5321 = 0x3F6F
-0x5323 = 0x4F3B
-0x532A = 0x374B
-0x532D = 0x5850
-0x532F = 0x3B63
-0x5331 = 0x5851
-0x5339 = 0x4625
-0x533E = 0x5852
-0x533F = 0x4464
-0x5340 = 0x4778
-0x5341 = 0x4A2E
-0x5343 = 0x4727
-0x5345 = 0x5826
-0x5347 = 0x497D
-0x5348 = 0x4E67
-0x5349 = 0x3B5C
-0x534A = 0x306B
-0x5351 = 0x3130
-0x5352 = 0x5764
-0x5353 = 0x573F
-0x5354 = 0x502D
-0x5357 = 0x444F
-0x535A = 0x3229
-0x535C = 0x3237
-0x535E = 0x3165
-0x535F = 0x5F32
-0x5360 = 0x553C
-0x5361 = 0x3F28
-0x5363 = 0x5855
-0x5366 = 0x5854
-0x5367 = 0x4E54
-0x5369 = 0x5A60
-0x536E = 0x5834
-0x536F = 0x432E
-0x5370 = 0x5321
-0x5371 = 0x4E23
-0x5373 = 0x3C34
-0x5374 = 0x4834
-0x5375 = 0x4251
-0x5377 = 0x3E6D
-0x5378 = 0x5036
-0x537A = 0x5A61
-0x537F = 0x4764
-0x5382 = 0x7827
-0x5384 = 0x3672
-0x5398 = 0x4065
-0x5399 = 0x5847
-0x539A = 0x3A71
-0x539D = 0x5848
-0x539F = 0x542D
-0x53A0 = 0x325E
-0x53A2 = 0x4F61
-0x53A5 = 0x584A
-0x53A6 = 0x4F43
-0x53A8 = 0x3378
-0x53A9 = 0x3E47
-0x53AD = 0x5161
-0x53AE = 0x584B
-0x53B2 = 0x4077
-0x53B4 = 0x5849
-0x53B6 = 0x5B4C
-0x53BB = 0x4825
-0x53C1 = 0x487E
-0x53C3 = 0x324E
-0x53C8 = 0x5356
-0x53C9 = 0x3266
-0x53CA = 0x3C30
-0x53CB = 0x5351
-0x53CD = 0x3734
-0x53D4 = 0x4A65
-0x53D6 = 0x4821
-0x53D7 = 0x4A5C
-0x53D9 = 0x5070
-0x53DB = 0x4551
-0x53DF = 0x5B45
-0x53E2 = 0x3454
-0x53E3 = 0x3F5A
-0x53E4 = 0x3945
-0x53E5 = 0x3E64
-0x53E6 = 0x416D
-0x53E8 = 0x5F36
-0x53E9 = 0x5F35
-0x53EA = 0x7923
-0x53EB = 0x3D50
-0x53EC = 0x5559
-0x53ED = 0x3048
-0x53EE = 0x3623
-0x53EF = 0x3F49
-0x53F0 = 0x786B
-0x53F1 = 0x5F33
-0x53F2 = 0x4A37
-0x53F3 = 0x5352
-0x53F5 = 0x584F
-0x53F6 = 0x7878
-0x53F8 = 0x4B3E
-0x53FB = 0x5F37
-0x53FC = 0x3570
-0x5401 = 0x5375
-0x5403 = 0x3354
-0x5404 = 0x3877
-0x5406 = 0x5F3A
-0x5408 = 0x3A4F
-0x5409 = 0x3C2A
-0x540A = 0x3575
-0x540C = 0x4D2C
-0x540D = 0x437B
-0x540E = 0x6161
-0x540F = 0x4074
-0x5410 = 0x4D42
-0x5411 = 0x4F72
-0x5412 = 0x5F38
-0x5415 = 0x4240
-0x5416 = 0x5F39
-0x541B = 0x3E7D
-0x541D = 0x415F
-0x541E = 0x4D4C
-0x541F = 0x5277
-0x5420 = 0x374D
-0x5421 = 0x5F41
-0x5423 = 0x5F44
-0x5426 = 0x3771
-0x5427 = 0x3049
-0x5429 = 0x3754
-0x542B = 0x3A2C
-0x542D = 0x3F54
-0x542E = 0x4B31
-0x5431 = 0x5628
-0x5432 = 0x5F45
-0x5434 = 0x4E62
-0x5435 = 0x3333
-0x5438 = 0x4E7C
-0x5439 = 0x3435
-0x543B = 0x4E47
-0x543C = 0x3A70
-0x543E = 0x4E61
-0x5440 = 0x513D
-0x5443 = 0x5F40
-0x5446 = 0x3474
-0x5448 = 0x334A
-0x544A = 0x3866
-0x544B = 0x5F3B
-0x5450 = 0x4445
-0x5454 = 0x5F3E
-0x5462 = 0x4458
-0x5464 = 0x5F4A
-0x5466 = 0x5F4F
-0x5468 = 0x565C
-0x5471 = 0x5F49
-0x5472 = 0x5F5A
-0x5473 = 0x4E36
-0x5475 = 0x3A47
-0x5476 = 0x5F4E
-0x5477 = 0x5F48
-0x5478 = 0x455E
-0x547B = 0x496B
-0x547C = 0x3A74
-0x547D = 0x437C
-0x5480 = 0x3E57
-0x5482 = 0x5F46
-0x5484 = 0x5F4D
-0x5486 = 0x4558
-0x548B = 0x5526
-0x548C = 0x3A4D
-0x548E = 0x3E4C
-0x548F = 0x533D
-0x5490 = 0x3840
-0x5492 = 0x5664
-0x5494 = 0x5F47
-0x5495 = 0x393E
-0x5496 = 0x3F27
-0x549A = 0x5F4B
-0x54A3 = 0x5F5B
-0x54A4 = 0x5F65
-0x54A6 = 0x5F57
-0x54A7 = 0x5F56
-0x54A8 = 0x5749
-0x54A9 = 0x5F63
-0x54AA = 0x5F64
-0x54AB = 0x656B
-0x54AC = 0x5227
-0x54AD = 0x5F52
-0x54AF = 0x3F29
-0x54B1 = 0x545B
-0x54B3 = 0x3F48
-0x54B4 = 0x5F54
-0x54B8 = 0x4F4C
-0x54BB = 0x5F5D
-0x54BC = 0x5F43
-0x54BD = 0x514A
-0x54BF = 0x5F5E
-0x54C0 = 0x3027
-0x54C1 = 0x4637
-0x54C2 = 0x5F53
-0x54C4 = 0x3A65
-0x54C6 = 0x365F
-0x54C7 = 0x4D5B
-0x54C8 = 0x397E
-0x54C9 = 0x5455
-0x54CC = 0x5F5F
-0x54CE = 0x3025
-0x54CF = 0x5F67
-0x54D0 = 0x5F51
-0x54DA = 0x5F61
-0x54DE = 0x5F68
-0x54E1 = 0x5431
-0x54E5 = 0x3867
-0x54E6 = 0x4536
-0x54E7 = 0x5F6A
-0x54E8 = 0x495A
-0x54E9 = 0x4128
-0x54EA = 0x4444
-0x54ED = 0x3F5E
-0x54EE = 0x4F78
-0x54F2 = 0x555C
-0x54F3 = 0x5F6E
-0x54FA = 0x3238
-0x54FC = 0x3A5F
-0x54FD = 0x5F6C
-0x54FF = 0x5B41
-0x5501 = 0x5164
-0x5504 = 0x5F42
-0x5506 = 0x4B74
-0x5507 = 0x343D
-0x5509 = 0x3026
-0x550F = 0x5F71
-0x5510 = 0x4C46
-0x5511 = 0x5F72
-0x5514 = 0x5F6D
-0x5523 = 0x5F70
-0x5527 = 0x5F73
-0x552A = 0x5F74
-0x552C = 0x3B23
-0x552E = 0x4A5B
-0x552F = 0x4E28
-0x5530 = 0x6027
-0x5531 = 0x332A
-0x5533 = 0x6026
-0x5537 = 0x6021
-0x553C = 0x5F7E
-0x553E = 0x4D59
-0x553F = 0x5F7C
-0x5541 = 0x5F7A
-0x5543 = 0x3F50
-0x5544 = 0x5744
-0x5546 = 0x494C
-0x5549 = 0x5F78
-0x554A = 0x3021
-0x554F = 0x4E4A
-0x5550 = 0x5F7D
-0x5553 = 0x4674
-0x5555 = 0x5F7B
-0x5556 = 0x6022
-0x555C = 0x6028
-0x555E = 0x5146
-0x5561 = 0x3748
-0x5564 = 0x4621
-0x5565 = 0x4936
-0x5566 = 0x4032
-0x556A = 0x453E
-0x5575 = 0x6023
-0x5576 = 0x6024
-0x5577 = 0x6025
-0x557B = 0x6034
-0x557C = 0x4C64
-0x557E = 0x6031
-0x5580 = 0x3F26
-0x5581 = 0x602F
-0x5582 = 0x4E39
-0x5583 = 0x602B
-0x5584 = 0x4946
-0x5587 = 0x402E
-0x5588 = 0x602E
-0x5589 = 0x3A6D
-0x558A = 0x3A30
-0x558B = 0x6029
-0x558F = 0x5F76
-0x5591 = 0x6033
-0x5594 = 0x6038
-0x5598 = 0x342D
-0x5599 = 0x6039
-0x559A = 0x3B3D
-0x559C = 0x4F32
-0x559D = 0x3A48
-0x559F = 0x6030
-0x55A7 = 0x507A
-0x55AA = 0x4925
-0x55AC = 0x4747
-0x55AE = 0x3525
-0x55B1 = 0x602C
-0x55B2 = 0x5334
-0x55B3 = 0x547B
-0x55B5 = 0x5F77
-0x55B9 = 0x602D
-0x55BB = 0x5377
-0x55C4 = 0x6044
-0x55C5 = 0x5061
-0x55C6 = 0x473A
-0x55C7 = 0x5844
-0x55C9 = 0x603C
-0x55CC = 0x6049
-0x55CD = 0x604A
-0x55CE = 0x4270
-0x55D1 = 0x603E
-0x55D2 = 0x602A
-0x55D3 = 0x4924
-0x55D4 = 0x6041
-0x55D6 = 0x6032
-0x55DA = 0x4E58
-0x55DC = 0x4A48
-0x55DD = 0x6043
-0x55DF = 0x6035
-0x55E1 = 0x4E4B
-0x55E3 = 0x4B43
-0x55E4 = 0x604D
-0x55E5 = 0x6046
-0x55E6 = 0x6042
-0x55E8 = 0x604B
-0x55E9 = 0x5F6F
-0x55EA = 0x603A
-0x55EC = 0x6040
-0x55EF = 0x6045
-0x55F2 = 0x6047
-0x55F5 = 0x604C
-0x55F6 = 0x5F59
-0x55F7 = 0x603B
-0x55FD = 0x4B54
-0x55FE = 0x6055
-0x5600 = 0x6056
-0x5601 = 0x6052
-0x5606 = 0x4C3E
-0x5608 = 0x6050
-0x5609 = 0x3C4E
-0x560C = 0x6051
-0x560D = 0x6036
-0x560E = 0x3842
-0x560F = 0x5845
-0x5614 = 0x453B
-0x5616 = 0x5F75
-0x5617 = 0x3322
-0x5618 = 0x506A
-0x561B = 0x426F
-0x561C = 0x5F69
-0x561E = 0x604F
-0x561F = 0x603D
-0x5623 = 0x6054
-0x5627 = 0x6057
-0x5629 = 0x3B29
-0x562C = 0x605C
-0x562D = 0x6058
-0x562E = 0x5F6B
-0x562F = 0x5025
-0x5630 = 0x5F34
-0x5632 = 0x3330
-0x5634 = 0x576C
-0x5635 = 0x5F58
-0x5636 = 0x4B3B
-0x5638 = 0x5F3C
-0x5639 = 0x605A
-0x563B = 0x4E7B
-0x563F = 0x3A59
-0x5641 = 0x7830
-0x564C = 0x6061
-0x564D = 0x605D
-0x564E = 0x522D
-0x5654 = 0x6062
-0x5657 = 0x605B
-0x5658 = 0x6059
-0x5659 = 0x605F
-0x565D = 0x5F50
-0x5660 = 0x5F55
-0x5662 = 0x605E
-0x5664 = 0x6064
-0x5665 = 0x5F66
-0x5666 = 0x5F5C
-0x5668 = 0x4677
-0x5669 = 0x582C
-0x566A = 0x546B
-0x566B = 0x6066
-0x566C = 0x4A49
-0x566F = 0x6048
-0x5671 = 0x6065
-0x5672 = 0x5F60
-0x5674 = 0x4567
-0x5676 = 0x3841
-0x5678 = 0x3656
-0x5679 = 0x782B
-0x567B = 0x6067
-0x567C = 0x6068
-0x5680 = 0x5F4C
-0x5685 = 0x6069
-0x5686 = 0x6063
-0x5687 = 0x4F45
-0x568C = 0x5F62
-0x568E = 0x3A3F
-0x568F = 0x4C67
-0x5693 = 0x606A
-0x5695 = 0x6060
-0x5699 = 0x4476
-0x56A6 = 0x5F3F
-0x56A8 = 0x417C
-0x56AE = 0x7875
-0x56AF = 0x606B
-0x56B3 = 0x6037
-0x56B4 = 0x514F
-0x56B6 = 0x6053
-0x56B7 = 0x4842
-0x56BC = 0x3D40
-0x56C0 = 0x5F79
-0x56C1 = 0x603F
-0x56C2 = 0x4F79
-0x56C5 = 0x5966
-0x56C8 = 0x5F3D
-0x56C9 = 0x7853
-0x56CA = 0x4452
-0x56CC = 0x786A
-0x56D1 = 0x5676
-0x56D4 = 0x606C
-0x56D7 = 0x606D
-0x56DA = 0x4774
-0x56DB = 0x4B44
-0x56DD = 0x606E
-0x56DE = 0x3B58
-0x56DF = 0x5836
-0x56E0 = 0x5272
-0x56E1 = 0x606F
-0x56E4 = 0x365A
-0x56EB = 0x6071
-0x56F0 = 0x4027
-0x56F1 = 0x3451
-0x56F9 = 0x6072
-0x56FA = 0x394C
-0x56FF = 0x6073
-0x5703 = 0x4654
-0x5704 = 0x6074
-0x5707 = 0x6070
-0x5708 = 0x4826
-0x5709 = 0x6076
-0x570A = 0x6075
-0x570B = 0x397A
-0x570D = 0x4E27
-0x5712 = 0x5430
-0x5713 = 0x5432
-0x5716 = 0x4D3C
-0x5718 = 0x4D45
-0x571C = 0x6077
-0x571F = 0x4D41
-0x5728 = 0x545A
-0x5729 = 0x5B57
-0x572A = 0x5B59
-0x572C = 0x5B58
-0x572D = 0x3967
-0x572E = 0x5B5C
-0x572F = 0x5B5D
-0x5730 = 0x3558
-0x5733 = 0x5B5A
-0x573B = 0x5B5F
-0x573E = 0x3B78
-0x5740 = 0x5637
-0x5742 = 0x5B60
-0x5747 = 0x3E79
-0x574A = 0x373B
-0x574C = 0x5B50
-0x574D = 0x4C2E
-0x574E = 0x3F32
-0x5750 = 0x5778
-0x5751 = 0x3F53
-0x5761 = 0x4642
-0x5764 = 0x4024
-0x5766 = 0x4C39
-0x5768 = 0x5B67
-0x5769 = 0x5B61
-0x576A = 0x463A
-0x576B = 0x5B63
-0x576D = 0x5B68
-0x576F = 0x4577
-0x5773 = 0x5B6A
-0x5776 = 0x5B69
-0x5777 = 0x3F40
-0x577B = 0x5B66
-0x577C = 0x5B65
-0x5782 = 0x3439
-0x5783 = 0x402C
-0x578B = 0x504D
-0x578C = 0x5B6D
-0x5793 = 0x5B72
-0x579B = 0x3662
-0x57A0 = 0x5B73
-0x57A1 = 0x5B52
-0x57A2 = 0x3938
-0x57A3 = 0x542B
-0x57A4 = 0x5B6C
-0x57A7 = 0x5B70
-0x57AE = 0x3F65
-0x57B8 = 0x5B79
-0x57C2 = 0x3921
-0x57C3 = 0x3023
-0x57CB = 0x4271
-0x57CE = 0x3347
-0x57CF = 0x5B6F
-0x57D2 = 0x5B78
-0x57D4 = 0x4652
-0x57D5 = 0x5B74
-0x57DD = 0x5B7E
-0x57DF = 0x5372
-0x57E0 = 0x323A
-0x57E1 = 0x5B6B
-0x57E4 = 0x5B7D
-0x57ED = 0x5C24
-0x57EF = 0x5B7B
-0x57F4 = 0x5B7A
-0x57F7 = 0x5634
-0x57F8 = 0x5B7C
-0x57F9 = 0x4560
-0x57FA = 0x3B79
-0x57FD = 0x5C23
-0x5800 = 0x5C25
-0x5802 = 0x4C43
-0x5805 = 0x3C61
-0x5806 = 0x3651
-0x5807 = 0x5D40
-0x580A = 0x5B51
-0x580B = 0x5C21
-0x580D = 0x5C22
-0x5816 = 0x5B71
-0x5819 = 0x5C27
-0x581D = 0x5B76
-0x581E = 0x5C26
-0x5820 = 0x5C29
-0x5821 = 0x3124
-0x5824 = 0x354C
-0x582A = 0x3F30
-0x582F = 0x5222
-0x5830 = 0x515F
-0x5831 = 0x3128
-0x5834 = 0x3321
-0x5835 = 0x3642
-0x5844 = 0x5C28
-0x584A = 0x3F69
-0x584B = 0x5C63
-0x584C = 0x4B7A
-0x584D = 0x6B73
-0x584F = 0x5B6E
-0x5851 = 0x4B5C
-0x5852 = 0x5B75
-0x5854 = 0x4B7E
-0x5857 = 0x4D3F
-0x5858 = 0x4C41
-0x585E = 0x487B
-0x5862 = 0x4E6B
-0x5864 = 0x5B77
-0x5865 = 0x5C2A
-0x586B = 0x4C6E
-0x586C = 0x5C2B
-0x5875 = 0x333E
-0x5879 = 0x4735
-0x587E = 0x5B53
-0x5880 = 0x5C2F
-0x5881 = 0x5C2C
-0x5883 = 0x3E33
-0x5885 = 0x4A7B
-0x5889 = 0x5C2D
-0x588A = 0x3566
-0x5892 = 0x494A
-0x5893 = 0x4439
-0x589A = 0x5C2E
-0x589C = 0x5739
-0x589E = 0x5476
-0x589F = 0x5066
-0x58A8 = 0x442B
-0x58A9 = 0x3655
-0x58AE = 0x3669
-0x58B3 = 0x3758
-0x58BB = 0x473D
-0x58BC = 0x5B54
-0x58BE = 0x3F51
-0x58C1 = 0x315A
-0x58C5 = 0x5B55
-0x58C7 = 0x4C33
-0x58D1 = 0x5B56
-0x58D3 = 0x5139
-0x58D5 = 0x3A3E
-0x58D8 = 0x405D
-0x58D9 = 0x5B5B
-0x58DA = 0x5B64
-0x58DE = 0x3B35
-0x58DF = 0x4222
-0x58E0 = 0x5B62
-0x58E2 = 0x5B5E
-0x58E4 = 0x4840
-0x58E9 = 0x3053
-0x58EB = 0x4A3F
-0x58EC = 0x4849
-0x58EF = 0x5733
-0x58F9 = 0x523C
-0x58FA = 0x3A78
-0x58FD = 0x4A59
-0x5902 = 0x623A
-0x590F = 0x4F44
-0x5914 = 0x5967
-0x5915 = 0x4F26
-0x5916 = 0x4D62
-0x5919 = 0x596D
-0x591A = 0x3660
-0x591C = 0x5239
-0x591F = 0x393B
-0x5922 = 0x434E
-0x5924 = 0x6239
-0x5925 = 0x6237
-0x5927 = 0x3473
-0x5929 = 0x4C6C
-0x592A = 0x4C2B
-0x592B = 0x3772
-0x592D = 0x5832
-0x592E = 0x516B
-0x592F = 0x3A3B
-0x5931 = 0x4A27
-0x5937 = 0x5244
-0x5938 = 0x7849
-0x593C = 0x5E45
-0x593E = 0x3C50
-0x5944 = 0x5159
-0x5947 = 0x4666
-0x5948 = 0x444E
-0x5949 = 0x376E
-0x594E = 0x3F7C
-0x594F = 0x5760
-0x5950 = 0x5B3C
-0x5951 = 0x4675
-0x5954 = 0x313C
-0x5955 = 0x5E48
-0x5957 = 0x4C57
-0x5958 = 0x5E4A
-0x595A = 0x5E49
-0x5960 = 0x356C
-0x5962 = 0x495D
-0x5965 = 0x3042
-0x5969 = 0x5E46
-0x596A = 0x3661
-0x596C = 0x3D31
-0x596E = 0x375C
-0x5973 = 0x452E
-0x5974 = 0x452B
-0x5976 = 0x444C
-0x5978 = 0x3C69
-0x5979 = 0x4B7D
-0x597D = 0x3A43
-0x5981 = 0x6579
-0x5982 = 0x4867
-0x5983 = 0x657A
-0x5984 = 0x4D7D
-0x598A = 0x4851
-0x598D = 0x657B
-0x5992 = 0x364A
-0x5993 = 0x3C4B
-0x5996 = 0x517D
-0x5997 = 0x6621
-0x5999 = 0x436E
-0x599D = 0x5731
-0x599E = 0x6624
-0x59A3 = 0x657E
-0x59A4 = 0x6625
-0x59A5 = 0x4D57
-0x59A8 = 0x3741
-0x59AE = 0x445D
-0x59AF = 0x6628
-0x59B2 = 0x6627
-0x59B9 = 0x4343
-0x59BB = 0x465E
-0x59BE = 0x662A
-0x59C6 = 0x4437
-0x59CA = 0x6622
-0x59CB = 0x4A3C
-0x59D0 = 0x3D63
-0x59D1 = 0x3943
-0x59D2 = 0x6626
-0x59D3 = 0x5055
-0x59D4 = 0x4E2F
-0x59D7 = 0x6629
-0x59D8 = 0x6630
-0x59DA = 0x5226
-0x59DC = 0x3D2A
-0x59DD = 0x662D
-0x59E3 = 0x662F
-0x59E5 = 0x4051
-0x59E8 = 0x524C
-0x59EC = 0x3C27
-0x59F9 = 0x6631
-0x59FB = 0x5276
-0x59FF = 0x574B
-0x5A01 = 0x4D7E
-0x5A03 = 0x4D5E
-0x5A09 = 0x6633
-0x5A0C = 0x6632
-0x5A11 = 0x6636
-0x5A13 = 0x6638
-0x5A18 = 0x446F
-0x5A1C = 0x4448
-0x5A1F = 0x3E6A
-0x5A20 = 0x496F
-0x5A23 = 0x6637
-0x5A25 = 0x3670
-0x5A29 = 0x4364
-0x5A31 = 0x5369
-0x5A36 = 0x4822
-0x5A3C = 0x663D
-0x5A40 = 0x6639
-0x5A41 = 0x4226
-0x5A46 = 0x4645
-0x5A49 = 0x4D71
-0x5A4A = 0x663B
-0x5A55 = 0x663C
-0x5A5A = 0x3B69
-0x5A62 = 0x663E
-0x5A66 = 0x383E
-0x5A67 = 0x663A
-0x5A6A = 0x4037
-0x5A6D = 0x662B
-0x5A77 = 0x6643
-0x5A7A = 0x6644
-0x5A7F = 0x5076
-0x5A92 = 0x433D
-0x5A9A = 0x4344
-0x5A9B = 0x6642
-0x5AA7 = 0x6634
-0x5AAA = 0x6641
-0x5AB2 = 0x6647
-0x5AB3 = 0x4F31
-0x5AB5 = 0x6B74
-0x5AB8 = 0x664A
-0x5ABD = 0x4268
-0x5ABE = 0x6645
-0x5AC1 = 0x3C5E
-0x5AC2 = 0x4929
-0x5AC9 = 0x3C35
-0x5ACC = 0x4F53
-0x5AD6 = 0x664E
-0x5AD7 = 0x657D
-0x5AD8 = 0x6650
-0x5ADC = 0x6651
-0x5AE0 = 0x664B
-0x5AE1 = 0x3555
-0x5AE3 = 0x664C
-0x5AE6 = 0x664F
-0x5AE9 = 0x445B
-0x5AEB = 0x6646
-0x5AF5 = 0x657C
-0x5AFB = 0x6635
-0x5B00 = 0x6623
-0x5B08 = 0x662C
-0x5B09 = 0x6652
-0x5B0B = 0x663F
-0x5B0C = 0x3D3F
-0x5B16 = 0x6654
-0x5B17 = 0x6653
-0x5B19 = 0x664D
-0x5B21 = 0x6648
-0x5B2A = 0x6649
-0x5B30 = 0x5324
-0x5B32 = 0x6655
-0x5B34 = 0x5978
-0x5B37 = 0x6656
-0x5B38 = 0x4974
-0x5B40 = 0x6657
-0x5B4C = 0x662E
-0x5B50 = 0x5753
-0x5B51 = 0x665D
-0x5B53 = 0x665E
-0x5B54 = 0x3F57
-0x5B55 = 0x5450
-0x5B57 = 0x5756
-0x5B58 = 0x3466
-0x5B5A = 0x665A
-0x5B5B = 0x5843
-0x5B5C = 0x574E
-0x5B5D = 0x5022
-0x5B5F = 0x434F
-0x5B62 = 0x665F
-0x5B63 = 0x3C3E
-0x5B64 = 0x3942
-0x5B65 = 0x665B
-0x5B69 = 0x3A22
-0x5B6B = 0x4B6F
-0x5B6C = 0x582B
-0x5B70 = 0x4A6B
-0x5B71 = 0x656E
-0x5B73 = 0x665C
-0x5B75 = 0x3775
-0x5B78 = 0x5127
-0x5B7A = 0x4866
-0x5B7D = 0x4475
-0x5B7F = 0x424F
-0x5B80 = 0x6532
-0x5B83 = 0x4B7C
-0x5B84 = 0x6533
-0x5B85 = 0x552C
-0x5B87 = 0x536E
-0x5B88 = 0x4A58
-0x5B89 = 0x3032
-0x5B8B = 0x4B4E
-0x5B8C = 0x4D6A
-0x5B8F = 0x3A6A
-0x5B93 = 0x6535
-0x5B95 = 0x6534
-0x5B97 = 0x575A
-0x5B98 = 0x3959
-0x5B99 = 0x5666
-0x5B9A = 0x3628
-0x5B9B = 0x4D70
-0x5B9C = 0x524B
-0x5BA2 = 0x3F4D
-0x5BA3 = 0x507B
-0x5BA4 = 0x4A52
-0x5BA5 = 0x6536
-0x5BA6 = 0x3B42
-0x5BAB = 0x392C
-0x5BB0 = 0x5457
-0x5BB3 = 0x3A26
-0x5BB4 = 0x5167
-0x5BB5 = 0x4F7C
-0x5BB6 = 0x3C52
-0x5BB8 = 0x6537
-0x5BB9 = 0x485D
-0x5BBF = 0x4B5E
-0x5BC2 = 0x3C45
-0x5BC4 = 0x3C44
-0x5BC5 = 0x527A
-0x5BC6 = 0x435C
-0x5BC7 = 0x3F5C
-0x5BCC = 0x383B
-0x5BD0 = 0x4342
-0x5BD2 = 0x3A2E
-0x5BD3 = 0x5422
-0x5BDE = 0x442F
-0x5BDF = 0x326C
-0x5BE1 = 0x3951
-0x5BE2 = 0x475E
-0x5BE4 = 0x653B
-0x5BE5 = 0x4148
-0x5BE6 = 0x4A35
-0x5BE7 = 0x447E
-0x5BE8 = 0x552F
-0x5BE9 = 0x4973
-0x5BEB = 0x5034
-0x5BEC = 0x3F6D
-0x5BEE = 0x653C
-0x5BF0 = 0x653E
-0x5BF5 = 0x3368
-0x5BF6 = 0x3126
-0x5BF8 = 0x3467
-0x5BFA = 0x4B42
-0x5C01 = 0x3762
-0x5C04 = 0x4964
-0x5C07 = 0x3D2B
-0x5C08 = 0x5728
-0x5C09 = 0x4E3E
-0x5C0A = 0x5770
-0x5C0B = 0x5130
-0x5C0D = 0x3654
-0x5C0E = 0x353C
-0x5C0F = 0x5021
-0x5C11 = 0x4959
-0x5C15 = 0x6658
-0x5C16 = 0x3C62
-0x5C1A = 0x4950
-0x5C1C = 0x6659
-0x5C22 = 0x5E4C
-0x5C24 = 0x5348
-0x5C25 = 0x5E4D
-0x5C2C = 0x5E4E
-0x5C31 = 0x3E4D
-0x5C37 = 0x5E4F
-0x5C38 = 0x4A2C
-0x5C39 = 0x527C
-0x5C3A = 0x335F
-0x5C3B = 0x656A
-0x5C3C = 0x4461
-0x5C3E = 0x4E32
-0x5C3F = 0x4472
-0x5C40 = 0x3E56
-0x5C41 = 0x4628
-0x5C45 = 0x3E53
-0x5C48 = 0x477C
-0x5C49 = 0x4C6B
-0x5C4A = 0x3D6C
-0x5C4B = 0x4E5D
-0x5C4E = 0x4A3A
-0x5C4F = 0x4641
-0x5C50 = 0x656C
-0x5C51 = 0x503C
-0x5C55 = 0x5539
-0x5C59 = 0x656D
-0x5C60 = 0x4D40
-0x5C62 = 0x4245
-0x5C63 = 0x656F
-0x5C64 = 0x3263
-0x5C65 = 0x4244
-0x5C68 = 0x6570
-0x5C6C = 0x4A74
-0x5C6E = 0x6578
-0x5C6F = 0x4D4D
-0x5C71 = 0x493D
-0x5C79 = 0x5259
-0x5C7A = 0x6128
-0x5C88 = 0x612C
-0x5C8C = 0x6127
-0x5C8D = 0x6129
-0x5C90 = 0x612A
-0x5C91 = 0x612F
-0x5C94 = 0x326D
-0x5C99 = 0x612E
-0x5C9C = 0x6131
-0x5CA1 = 0x3854
-0x5CA2 = 0x6133
-0x5CA3 = 0x6138
-0x5CA9 = 0x5152
-0x5CAB = 0x6136
-0x5CAC = 0x6135
-0x5CB1 = 0x6137
-0x5CB3 = 0x5440
-0x5CB5 = 0x6132
-0x5CB7 = 0x613A
-0x5CB8 = 0x3036
-0x5CC1 = 0x6139
-0x5CCB = 0x613E
-0x5CD2 = 0x613C
-0x5CD9 = 0x5645
-0x5CE8 = 0x366B
-0x5CEA = 0x5378
-0x5CED = 0x474D
-0x5CF0 = 0x3765
-0x5CF4 = 0x612D
-0x5CF6 = 0x353A
-0x5CFB = 0x3E7E
-0x5CFD = 0x4F3F
-0x5D06 = 0x6147
-0x5D07 = 0x3367
-0x5D0D = 0x6141
-0x5D0E = 0x4669
-0x5D14 = 0x345E
-0x5D16 = 0x5142
-0x5D17 = 0x385A
-0x5D1B = 0x6148
-0x5D1E = 0x6146
-0x5D22 = 0x613F
-0x5D24 = 0x6145
-0x5D26 = 0x6143
-0x5D27 = 0x6142
-0x5D29 = 0x3140
-0x5D2C = 0x6134
-0x5D2E = 0x6144
-0x5D34 = 0x614B
-0x5D3D = 0x614C
-0x5D3E = 0x614A
-0x5D47 = 0x6F7A
-0x5D4A = 0x6153
-0x5D4B = 0x6152
-0x5D4C = 0x4736
-0x5D50 = 0x6130
-0x5D5B = 0x614E
-0x5D69 = 0x6154
-0x5D6B = 0x6151
-0x5D6C = 0x614D
-0x5D6F = 0x614F
-0x5D74 = 0x6155
-0x5D81 = 0x6150
-0x5D82 = 0x6156
-0x5D84 = 0x5538
-0x5D87 = 0x612B
-0x5D97 = 0x6140
-0x5D99 = 0x6157
-0x5D9D = 0x6158
-0x5DA0 = 0x613D
-0x5DA7 = 0x613B
-0x5DB7 = 0x615A
-0x5DB8 = 0x6149
-0x5DBA = 0x416B
-0x5DBC = 0x536C
-0x5DCB = 0x3F79
-0x5DCD = 0x4E21
-0x5DD2 = 0x424D
-0x5DD4 = 0x615B
-0x5DDB = 0x675D
-0x5DDD = 0x3428
-0x5DDE = 0x565D
-0x5DE1 = 0x5132
-0x5DE2 = 0x3332
-0x5DE5 = 0x3924
-0x5DE6 = 0x5773
-0x5DE7 = 0x4749
-0x5DE8 = 0x3E5E
-0x5DEB = 0x4E57
-0x5DEE = 0x326E
-0x5DF0 = 0x5B4F
-0x5DF1 = 0x3C3A
-0x5DF2 = 0x5251
-0x5DF3 = 0x4B48
-0x5DF4 = 0x304D
-0x5DF7 = 0x4F6F
-0x5DFD = 0x5963
-0x5DFE = 0x3D6D
-0x5E02 = 0x4A50
-0x5E03 = 0x323C
-0x5E06 = 0x372B
-0x5E0C = 0x4F23
-0x5E11 = 0x607B
-0x5E14 = 0x607A
-0x5E15 = 0x4541
-0x5E16 = 0x4C7B
-0x5E18 = 0x7850
-0x5E19 = 0x6079
-0x5E1A = 0x5663
-0x5E1B = 0x322F
-0x5E1D = 0x355B
-0x5E25 = 0x4B27
-0x5E2B = 0x4A26
-0x5E2D = 0x4F2F
-0x5E33 = 0x554A
-0x5E36 = 0x3478
-0x5E37 = 0x6121
-0x5E38 = 0x3323
-0x5E3D = 0x4331
-0x5E40 = 0x5621
-0x5E42 = 0x435D
-0x5E43 = 0x6078
-0x5E44 = 0x6122
-0x5E45 = 0x3779
-0x5E4C = 0x3B4F
-0x5E54 = 0x6123
-0x5E55 = 0x443B
-0x5E57 = 0x607E
-0x5E58 = 0x607D
-0x5E5B = 0x6124
-0x5E5E = 0x6125
-0x5E5F = 0x5644
-0x5E61 = 0x6126
-0x5E62 = 0x3431
-0x5E63 = 0x3152
-0x5E6B = 0x306F
-0x5E6C = 0x607C
-0x5E72 = 0x7835
-0x5E73 = 0x463D
-0x5E74 = 0x446A
-0x5E76 = 0x3222
-0x5E78 = 0x5052
-0x5E79 = 0x3849
-0x5E7A = 0x675B
-0x5E7B = 0x3B43
-0x5E7C = 0x5357
-0x5E7D = 0x5344
-0x5E7E = 0x3C38
-0x5E7F = 0x7838
-0x5E80 = 0x624F
-0x5E87 = 0x3153
-0x5E8A = 0x3432
-0x5E8B = 0x6251
-0x5E8F = 0x5072
-0x5E95 = 0x3557
-0x5E96 = 0x6252
-0x5E97 = 0x356A
-0x5E9A = 0x387D
-0x5E9C = 0x382E
-0x5EA0 = 0x6254
-0x5EA5 = 0x6253
-0x5EA6 = 0x3648
-0x5EA7 = 0x5779
-0x5EAB = 0x3F62
-0x5EAD = 0x4D25
-0x5EB3 = 0x6258
-0x5EB5 = 0x6256
-0x5EB6 = 0x4A7C
-0x5EB7 = 0x3F35
-0x5EB8 = 0x5339
-0x5EB9 = 0x6255
-0x5EBE = 0x6257
-0x5EC9 = 0x412E
-0x5ECA = 0x4048
-0x5ED1 = 0x625B
-0x5ED2 = 0x625A
-0x5ED3 = 0x402A
-0x5ED6 = 0x414E
-0x5EDB = 0x625C
-0x5EDF = 0x436D
-0x5EE0 = 0x3327
-0x5EE1 = 0x6250
-0x5EE2 = 0x374F
-0x5EE3 = 0x3963
-0x5EE8 = 0x625D
-0x5EEA = 0x625E
-0x5EEC = 0x422E
-0x5EF3 = 0x4C7C
-0x5EF4 = 0x5B48
-0x5EF6 = 0x5153
-0x5EF7 = 0x4D22
-0x5EFA = 0x3D28
-0x5EFE = 0x5E43
-0x5EFF = 0x5825
-0x5F01 = 0x5B4D
-0x5F02 = 0x526C
-0x5F04 = 0x452A
-0x5F08 = 0x5E44
-0x5F0A = 0x3157
-0x5F0B = 0x5F2E
-0x5F0F = 0x4A3D
-0x5F11 = 0x5F31
-0x5F13 = 0x392D
-0x5F15 = 0x527D
-0x5F17 = 0x3825
-0x5F18 = 0x3A6B
-0x5F1B = 0x335A
-0x5F1F = 0x355C
-0x5F26 = 0x4F52
-0x5F27 = 0x3B21
-0x5F29 = 0x6573
-0x5F2D = 0x6574
-0x5F31 = 0x4875
-0x5F33 = 0x6572
-0x5F35 = 0x5545
-0x5F3A = 0x473F
-0x5F3C = 0x6576
-0x5F40 = 0x6C30
-0x5F46 = 0x7824
-0x5F48 = 0x352F
-0x5F4C = 0x4356
-0x5F4E = 0x4D64
-0x5F50 = 0x6566
-0x5F56 = 0x6568
-0x5F57 = 0x6567
-0x5F58 = 0x6569
-0x5F59 = 0x783D
-0x5F5D = 0x524D
-0x5F61 = 0x616A
-0x5F62 = 0x504E
-0x5F64 = 0x4D2E
-0x5F66 = 0x5165
-0x5F69 = 0x324A
-0x5F6A = 0x316B
-0x5F6C = 0x3172
-0x5F6D = 0x456D
-0x5F70 = 0x5543
-0x5F71 = 0x5330
-0x5F73 = 0x615C
-0x5F77 = 0x615D
-0x5F79 = 0x525B
-0x5F7C = 0x314B
-0x5F80 = 0x4D79
-0x5F81 = 0x5577
-0x5F82 = 0x615E
-0x5F85 = 0x347D
-0x5F87 = 0x615F
-0x5F88 = 0x3A5C
-0x5F89 = 0x6160
-0x5F8A = 0x3B32
-0x5F8B = 0x4249
-0x5F8C = 0x3A73
-0x5F90 = 0x506C
-0x5F91 = 0x3E36
-0x5F92 = 0x4D3D
-0x5F97 = 0x3543
-0x5F98 = 0x4547
-0x5F99 = 0x6163
-0x5F9C = 0x6164
-0x5F9E = 0x3453
-0x5FA0 = 0x6162
-0x5FA1 = 0x5379
-0x5FA8 = 0x6165
-0x5FA9 = 0x3834
-0x5FAA = 0x512D
-0x5FAD = 0x6166
-0x5FAE = 0x4E22
-0x5FB5 = 0x6167
-0x5FB7 = 0x3542
-0x5FB9 = 0x3339
-0x5FBC = 0x6168
-0x5FBD = 0x3B55
-0x5FC3 = 0x5044
-0x5FC4 = 0x6260
-0x5FC5 = 0x3158
-0x5FC9 = 0x6261
-0x5FCC = 0x3C49
-0x5FCD = 0x484C
-0x5FD0 = 0x6C7E
-0x5FD1 = 0x6C7D
-0x5FD2 = 0x5F2F
-0x5FD6 = 0x6262
-0x5FD7 = 0x563E
-0x5FD8 = 0x4D7C
-0x5FD9 = 0x4326
-0x5FDD = 0x6343
-0x5FE0 = 0x5652
-0x5FE1 = 0x6267
-0x5FE4 = 0x6268
-0x5FEA = 0x626C
-0x5FEB = 0x3F6C
-0x5FED = 0x626D
-0x5FEE = 0x6265
-0x5FF1 = 0x3340
-0x5FF5 = 0x446E
-0x5FF8 = 0x626E
-0x5FFB = 0x5043
-0x5FFD = 0x3A76
-0x5FFF = 0x375E
-0x600A = 0x6277
-0x600D = 0x6274
-0x600E = 0x5475
-0x600F = 0x6273
-0x6012 = 0x452D
-0x6014 = 0x557A
-0x6015 = 0x4542
-0x6016 = 0x3240
-0x6019 = 0x626F
-0x601B = 0x6272
-0x601D = 0x4B3C
-0x6020 = 0x3521
-0x6021 = 0x6279
-0x6025 = 0x3C31
-0x6026 = 0x6271
-0x6027 = 0x5054
-0x6028 = 0x5439
-0x6029 = 0x6275
-0x602A = 0x3956
-0x602B = 0x6276
-0x602F = 0x4753
-0x6035 = 0x6270
-0x6041 = 0x6D25
-0x6042 = 0x627E
-0x6043 = 0x4A51
-0x604D = 0x3B50
-0x6050 = 0x3F56
-0x6052 = 0x3A63
-0x6055 = 0x4B21
-0x6059 = 0x6D26
-0x605A = 0x6D23
-0x605D = 0x6D22
-0x6062 = 0x3B56
-0x6063 = 0x6D27
-0x6064 = 0x5074
-0x6067 = 0x6D24
-0x6068 = 0x3A5E
-0x6069 = 0x3677
-0x606A = 0x6321
-0x606B = 0x3632
-0x606C = 0x4C71
-0x606D = 0x3927
-0x606F = 0x4F22
-0x6070 = 0x4721
-0x607F = 0x5341
-0x6083 = 0x6327
-0x6084 = 0x4744
-0x6089 = 0x4F24
-0x608C = 0x6329
-0x608D = 0x3A37
-0x6092 = 0x6328
-0x6094 = 0x3B5A
-0x6096 = 0x6323
-0x609A = 0x6324
-0x609B = 0x632A
-0x609D = 0x6326
-0x609F = 0x4E72
-0x60A0 = 0x5346
-0x60A3 = 0x3B3C
-0x60A6 = 0x5443
-0x60A8 = 0x447A
-0x60B1 = 0x632D
-0x60B2 = 0x312F
-0x60B4 = 0x6332
-0x60B5 = 0x626A
-0x60B6 = 0x4346
-0x60B8 = 0x3C42
-0x60BB = 0x632C
-0x60BC = 0x353F
-0x60C5 = 0x4769
-0x60C6 = 0x6330
-0x60CB = 0x4D6F
-0x60D1 = 0x3B73
-0x60D5 = 0x4C68
-0x60D8 = 0x632F
-0x60DA = 0x6331
-0x60DC = 0x4F27
-0x60DD = 0x632E
-0x60DF = 0x4E29
-0x60E0 = 0x3B5D
-0x60E1 = 0x3671
-0x60E6 = 0x356B
-0x60F0 = 0x3668
-0x60F1 = 0x4455
-0x60F2 = 0x6322
-0x60F3 = 0x4F6B
-0x60F4 = 0x6337
-0x60F6 = 0x3B4C
-0x60F9 = 0x4847
-0x60FA = 0x504A
-0x60FB = 0x627C
-0x6100 = 0x6338
-0x6101 = 0x336E
-0x6106 = 0x6D29
-0x6108 = 0x537A
-0x6109 = 0x5364
-0x610D = 0x6D2A
-0x610E = 0x6339
-0x610F = 0x5262
-0x6115 = 0x6335
-0x611A = 0x535E
-0x611B = 0x302E
-0x611C = 0x632B
-0x611F = 0x3850
-0x6120 = 0x6333
-0x6123 = 0x6336
-0x6127 = 0x4022
-0x612B = 0x633A
-0x6134 = 0x626B
-0x6137 = 0x627D
-0x613E = 0x6269
-0x613F = 0x787C
-0x6148 = 0x3448
-0x614A = 0x633B
-0x614B = 0x4C2C
-0x614C = 0x3B45
-0x614E = 0x4977
-0x6155 = 0x443D
-0x6158 = 0x3252
-0x615A = 0x3251
-0x615D = 0x6D2B
-0x615F = 0x627A
-0x6162 = 0x427D
-0x6163 = 0x395F
-0x6164 = 0x6D28
-0x6167 = 0x3B5B
-0x6168 = 0x3F2E
-0x616A = 0x6266
-0x616B = 0x4B4B
-0x616E = 0x4247
-0x6170 = 0x4E3F
-0x6173 = 0x6325
-0x6175 = 0x633C
-0x6176 = 0x476C
-0x6177 = 0x3F36
-0x6182 = 0x5347
-0x618A = 0x3139
-0x618B = 0x316F
-0x618E = 0x5477
-0x6190 = 0x412F
-0x6191 = 0x463E
-0x6192 = 0x6334
-0x6194 = 0x633E
-0x619A = 0x352C
-0x619D = 0x6D2D
-0x61A4 = 0x375F
-0x61A7 = 0x633F
-0x61A8 = 0x3A29
-0x61A9 = 0x6D2C
-0x61AB = 0x4375
-0x61AC = 0x633D
-0x61AE = 0x6264
-0x61B2 = 0x4F5C
-0x61B6 = 0x5264
-0x61B7 = 0x6340
-0x61BE = 0x3A36
-0x61C2 = 0x362E
-0x61C7 = 0x3F52
-0x61C8 = 0x5038
-0x61C9 = 0x5326
-0x61CA = 0x3043
-0x61CB = 0x6D2E
-0x61CC = 0x6278
-0x61D4 = 0x6341
-0x61DE = 0x7856
-0x61DF = 0x6D21
-0x61E3 = 0x6D2F
-0x61E6 = 0x4533
-0x61E8 = 0x627B
-0x61F2 = 0x334D
-0x61F5 = 0x6342
-0x61F6 = 0x4041
-0x61F7 = 0x3B33
-0x61F8 = 0x507C
-0x61FA = 0x6263
-0x61FC = 0x3E65
-0x61FE = 0x4965
-0x61FF = 0x5C32
-0x6200 = 0x4135
-0x6207 = 0x6D30
-0x6208 = 0x386A
-0x620A = 0x4E6C
-0x620C = 0x5067
-0x620D = 0x4A79
-0x620E = 0x4856
-0x6210 = 0x3349
-0x6211 = 0x4E52
-0x6212 = 0x3D64
-0x6214 = 0x6A27
-0x6215 = 0x635E
-0x6216 = 0x3B72
-0x621A = 0x465D
-0x621B = 0x6A29
-0x621F = 0x6A2A
-0x6221 = 0x6A2C
-0x6222 = 0x6A2B
-0x6224 = 0x6A2E
-0x6225 = 0x6A2D
-0x6227 = 0x6A28
-0x6229 = 0x6A2F
-0x622A = 0x3D58
-0x622E = 0x423E
-0x6230 = 0x553D
-0x6232 = 0x4F37
-0x6233 = 0x3441
-0x6234 = 0x3477
-0x6237 = 0x3B27
-0x623D = 0x6C66
-0x623E = 0x6C65
-0x623F = 0x373F
-0x6240 = 0x4B79
-0x6241 = 0x3162
-0x6243 = 0x6C67
-0x6247 = 0x4948
-0x6248 = 0x6C68
-0x6249 = 0x6C69
-0x624B = 0x4A56
-0x624C = 0x5E50
-0x624D = 0x3245
-0x624E = 0x547A
-0x6251 = 0x785E
-0x6252 = 0x3047
-0x6253 = 0x3472
-0x6254 = 0x4853
-0x6258 = 0x4D50
-0x625B = 0x3F38
-0x6263 = 0x3F5B
-0x6266 = 0x4724
-0x626D = 0x4524
-0x626E = 0x3067
-0x626F = 0x3336
-0x6273 = 0x3062
-0x6276 = 0x3776
-0x6279 = 0x457A
-0x627C = 0x3673
-0x627E = 0x5552
-0x627F = 0x3350
-0x6280 = 0x3C3C
-0x6284 = 0x332D
-0x6289 = 0x3E71
-0x628A = 0x3051
-0x6291 = 0x5256
-0x6292 = 0x4A63
-0x6293 = 0x5725
-0x6295 = 0x4D36
-0x6296 = 0x3636
-0x6297 = 0x3F39
-0x6298 = 0x555B
-0x629B = 0x4557
-0x62A8 = 0x456A
-0x62AB = 0x457B
-0x62AC = 0x4C27
-0x62B1 = 0x3127
-0x62B5 = 0x3556
-0x62B9 = 0x4428
-0x62BB = 0x5E53
-0x62BC = 0x513A
-0x62BD = 0x3369
-0x62BF = 0x4372
-0x62C2 = 0x3777
-0x62C4 = 0x5674
-0x62C6 = 0x3270
-0x62C7 = 0x4434
-0x62C8 = 0x4469
-0x62C9 = 0x402D
-0x62CA = 0x5E54
-0x62CC = 0x3068
-0x62CD = 0x4544
-0x62CE = 0x4160
-0x62D0 = 0x3955
-0x62D2 = 0x3E5C
-0x62D3 = 0x4D58
-0x62D4 = 0x304E
-0x62D6 = 0x4D4F
-0x62D7 = 0x5E56
-0x62D8 = 0x3E50
-0x62D9 = 0x573E
-0x62DA = 0x5E55
-0x62DB = 0x5550
-0x62DC = 0x305D
-0x62EC = 0x4028
-0x62ED = 0x4A43
-0x62EE = 0x5E57
-0x62EF = 0x557C
-0x62F1 = 0x3930
-0x62F3 = 0x482D
-0x62F4 = 0x4B29
-0x62F6 = 0x5E59
-0x62F7 = 0x3F3D
-0x62FC = 0x4634
-0x62FD = 0x5727
-0x62FE = 0x4A30
-0x62FF = 0x4443
-0x6301 = 0x3356
-0x6302 = 0x3952
-0x6307 = 0x5638
-0x6308 = 0x6A7C
-0x6309 = 0x3034
-0x630E = 0x3F66
-0x6311 = 0x4C74
-0x6316 = 0x4D5A
-0x6328 = 0x3024
-0x632A = 0x4532
-0x632B = 0x346C
-0x632F = 0x5571
-0x6332 = 0x6A7D
-0x6339 = 0x5E5A
-0x633A = 0x4D26
-0x633D = 0x4D6C
-0x633E = 0x502E
-0x6342 = 0x4E66
-0x6343 = 0x5E5C
-0x6345 = 0x4D31
-0x6346 = 0x4026
-0x6349 = 0x573D
-0x634B = 0x5E5B
-0x634C = 0x3046
-0x634D = 0x3A34
-0x634E = 0x4953
-0x634F = 0x4473
-0x6350 = 0x3E68
-0x6355 = 0x3236
-0x6367 = 0x4575
-0x6368 = 0x4961
-0x6369 = 0x5E66
-0x636B = 0x5E51
-0x636D = 0x5E63
-0x636E = 0x7846
-0x6371 = 0x5E5F
-0x6372 = 0x7847
-0x6376 = 0x3437
-0x6377 = 0x3D5D
-0x637A = 0x5E60
-0x637B = 0x446D
-0x6380 = 0x4F46
-0x6382 = 0x3560
-0x6383 = 0x4928
-0x6384 = 0x4255
-0x6387 = 0x365E
-0x6388 = 0x4A5A
-0x6389 = 0x3574
-0x638A = 0x5E65
-0x638C = 0x5546
-0x638E = 0x5E61
-0x638F = 0x4C4D
-0x6390 = 0x467E
-0x6392 = 0x4545
-0x6396 = 0x5234
-0x6398 = 0x3E72
-0x6399 = 0x5575
-0x63A0 = 0x4253
-0x63A2 = 0x4C3D
-0x63A3 = 0x3338
-0x63A5 = 0x3D53
-0x63A7 = 0x3F58
-0x63A8 = 0x4D46
-0x63A9 = 0x515A
-0x63AA = 0x346B
-0x63AC = 0x5E64
-0x63AD = 0x5E5D
-0x63AE = 0x5E67
-0x63B0 = 0x6A7E
-0x63BE = 0x5E72
-0x63C0 = 0x3C70
-0x63C4 = 0x5E6D
-0x63C6 = 0x5E71
-0x63C9 = 0x4860
-0x63CD = 0x5761
-0x63CE = 0x5E6F
-0x63CF = 0x4368
-0x63D0 = 0x4C61
-0x63D2 = 0x3265
-0x63D6 = 0x523E
-0x63DA = 0x516F
-0x63DB = 0x3B3B
-0x63DE = 0x5E6E
-0x63E0 = 0x5E6B
-0x63E1 = 0x4E55
-0x63E3 = 0x3427
-0x63E9 = 0x3F2B
-0x63EA = 0x3E3E
-0x63ED = 0x3D52
-0x63EE = 0x3B53
-0x63F2 = 0x5E69
-0x63F4 = 0x542E
-0x63F6 = 0x5E5E
-0x63F8 = 0x5E6A
-0x640B = 0x5E75
-0x640C = 0x5E78
-0x640D = 0x4B70
-0x640F = 0x322B
-0x6410 = 0x3424
-0x6413 = 0x346A
-0x6414 = 0x4926
-0x6417 = 0x3537
-0x641B = 0x5E76
-0x641C = 0x4B51
-0x641E = 0x3863
-0x6420 = 0x5E77
-0x6421 = 0x5E7A
-0x6426 = 0x5E79
-0x642A = 0x4C42
-0x642C = 0x3061
-0x642D = 0x346E
-0x6434 = 0x653A
-0x6436 = 0x4740
-0x643A = 0x502F
-0x643D = 0x326B
-0x643F = 0x6B21
-0x6441 = 0x5E74
-0x6447 = 0x5221
-0x6451 = 0x5E62
-0x6452 = 0x5E70
-0x6454 = 0x4B24
-0x6458 = 0x552A
-0x645C = 0x5E68
-0x645E = 0x5E7B
-0x645F = 0x4227
-0x6467 = 0x345D
-0x6469 = 0x4426
-0x646D = 0x5E7D
-0x646F = 0x563F
-0x6473 = 0x3F59
-0x6476 = 0x5E52
-0x6478 = 0x437E
-0x6479 = 0x4421
-0x647A = 0x5F21
-0x647B = 0x3274
-0x6482 = 0x414C
-0x6485 = 0x3E6F
-0x6487 = 0x4632
-0x6488 = 0x404C
-0x6491 = 0x3345
-0x6492 = 0x4876
-0x6493 = 0x4453
-0x6495 = 0x4B3A
-0x6496 = 0x5E7E
-0x6499 = 0x5F24
-0x649E = 0x5732
-0x649F = 0x5E58
-0x64A3 = 0x3527
-0x64A4 = 0x3337
-0x64A5 = 0x3226
-0x64A9 = 0x4143
-0x64AB = 0x3827
-0x64AC = 0x474B
-0x64AD = 0x3225
-0x64AE = 0x3469
-0x64B0 = 0x572B
-0x64B2 = 0x464B
-0x64B3 = 0x5E6C
-0x64BB = 0x4C22
-0x64BC = 0x3A33
-0x64BE = 0x4E4E
-0x64BF = 0x3C71
-0x64C0 = 0x5F26
-0x64C1 = 0x5335
-0x64C2 = 0x405E
-0x64C4 = 0x4230
-0x64C5 = 0x4943
-0x64C7 = 0x5471
-0x64CA = 0x3B77
-0x64CB = 0x3532
-0x64CD = 0x3259
-0x64CE = 0x4766
-0x64D0 = 0x5F27
-0x64D2 = 0x475C
-0x64D4 = 0x3523
-0x64D7 = 0x5F28
-0x64D8 = 0x6B22
-0x64DA = 0x3E5D
-0x64E0 = 0x3C37
-0x64E2 = 0x5F2A
-0x64E4 = 0x5F29
-0x64E6 = 0x3241
-0x64EC = 0x4462
-0x64EF = 0x3177
-0x64F0 = 0x4521
-0x64F1 = 0x3869
-0x64F2 = 0x5640
-0x64F4 = 0x4029
-0x64F7 = 0x5F22
-0x64FA = 0x305A
-0x64FB = 0x4B53
-0x64FC = 0x5F23
-0x64FE = 0x4845
-0x6500 = 0x454A
-0x6504 = 0x5E73
-0x6506 = 0x446C
-0x6509 = 0x5F2B
-0x650F = 0x4223
-0x6514 = 0x4039
-0x6516 = 0x5E7C
-0x6518 = 0x4841
-0x6519 = 0x3273
-0x651B = 0x5F25
-0x651D = 0x4963
-0x6522 = 0x545C
-0x6523 = 0x424E
-0x6524 = 0x4C2F
-0x6525 = 0x5F2C
-0x652A = 0x3D41
-0x652B = 0x3E70
-0x652C = 0x403F
-0x652E = 0x5F2D
-0x652F = 0x5627
-0x6534 = 0x6A37
-0x6535 = 0x6B36
-0x6536 = 0x4A55
-0x6538 = 0x587C
-0x6539 = 0x3844
-0x653B = 0x3925
-0x653E = 0x3745
-0x653F = 0x557E
-0x6545 = 0x394A
-0x6548 = 0x5027
-0x6549 = 0x744D
-0x654F = 0x4374
-0x6551 = 0x3E48
-0x6555 = 0x6B37
-0x6556 = 0x303D
-0x6557 = 0x305C
-0x6559 = 0x3D4C
-0x655D = 0x3156
-0x655E = 0x3328
-0x6562 = 0x3852
-0x6563 = 0x4922
-0x6566 = 0x3658
-0x656B = 0x6B38
-0x656C = 0x3E34
-0x6572 = 0x4743
-0x6574 = 0x557B
-0x6575 = 0x3550
-0x6577 = 0x3773
-0x6578 = 0x4A7D
-0x6582 = 0x4132
-0x6583 = 0x3150
-0x6587 = 0x4E44
-0x658C = 0x3173
-0x6590 = 0x6C33
-0x6591 = 0x305F
-0x6595 = 0x6C35
-0x6597 = 0x782F
-0x6599 = 0x414F
-0x659B = 0x757A
-0x659C = 0x5031
-0x659F = 0x5565
-0x65A1 = 0x4E53
-0x65A4 = 0x3D6F
-0x65A5 = 0x3362
-0x65A7 = 0x382B
-0x65AB = 0x6D3D
-0x65AC = 0x5536
-0x65AF = 0x4B39
-0x65B0 = 0x5042
-0x65B7 = 0x364F
-0x65B9 = 0x373D
-0x65BC = 0x6C36
-0x65BD = 0x4A29
-0x65C1 = 0x4554
-0x65C3 = 0x6C39
-0x65C4 = 0x6C38
-0x65C5 = 0x4243
-0x65C6 = 0x6C37
-0x65CB = 0x507D
-0x65CC = 0x6C3A
-0x65CE = 0x6C3B
-0x65CF = 0x5765
-0x65D2 = 0x6C3C
-0x65D6 = 0x6C3D
-0x65D7 = 0x466C
-0x65E2 = 0x3C48
-0x65E5 = 0x4855
-0x65E6 = 0x3529
-0x65E8 = 0x563C
-0x65E9 = 0x5467
-0x65EC = 0x512E
-0x65ED = 0x5071
-0x65EE = 0x6A38
-0x65EF = 0x6A39
-0x65F0 = 0x6A3A
-0x65F1 = 0x3A35
-0x65FA = 0x4D7A
-0x6600 = 0x6A40
-0x6602 = 0x303A
-0x6603 = 0x6A3E
-0x6606 = 0x4025
-0x660A = 0x6A3B
-0x660C = 0x327D
-0x660E = 0x4377
-0x660F = 0x3B68
-0x6613 = 0x5257
-0x6614 = 0x4E74
-0x6615 = 0x6A3F
-0x661D = 0x6A43
-0x661F = 0x5047
-0x6620 = 0x5333
-0x6625 = 0x343A
-0x6627 = 0x4341
-0x6628 = 0x5772
-0x662D = 0x5551
-0x662F = 0x4A47
-0x6631 = 0x6A45
-0x6634 = 0x6A44
-0x6635 = 0x6A47
-0x6636 = 0x6A46
-0x6641 = 0x6A4B
-0x6642 = 0x4A31
-0x6643 = 0x3B4E
-0x6649 = 0x3D7A
-0x664C = 0x494E
-0x664F = 0x6A4C
-0x6657 = 0x6A4F
-0x665A = 0x4D6D
-0x665D = 0x5667
-0x665F = 0x6A49
-0x6661 = 0x6A4E
-0x6664 = 0x4E6E
-0x6666 = 0x3B5E
-0x6668 = 0x333F
-0x666E = 0x4655
-0x666F = 0x3E30
-0x6670 = 0x4E7A
-0x6674 = 0x4767
-0x6676 = 0x3E27
-0x6677 = 0x6A50
-0x667A = 0x5647
-0x667E = 0x4140
-0x6684 = 0x6A51
-0x6687 = 0x4F3E
-0x6688 = 0x544E
-0x6689 = 0x6A4D
-0x668C = 0x6A52
-0x6691 = 0x4A6E
-0x6696 = 0x452F
-0x6697 = 0x3035
-0x669D = 0x6A54
-0x66A2 = 0x3329
-0x66A8 = 0x745F
-0x66AB = 0x545D
-0x66AE = 0x443A
-0x66B4 = 0x3129
-0x66B9 = 0x655F
-0x66BE = 0x6A55
-0x66C4 = 0x6A4A
-0x66C6 = 0x784F
-0x66C7 = 0x6A3C
-0x66C9 = 0x4F7E
-0x66D6 = 0x6A53
-0x66D9 = 0x4A6F
-0x66DB = 0x6A56
-0x66DC = 0x6A57
-0x66DD = 0x4658
-0x66E0 = 0x3F75
-0x66E6 = 0x6A58
-0x66E9 = 0x6A59
-0x66EC = 0x4939
-0x66F0 = 0x543B
-0x66F2 = 0x477A
-0x66F3 = 0x5237
-0x66F4 = 0x387C
-0x66F7 = 0x6A42
-0x66F8 = 0x4A69
-0x66F9 = 0x325C
-0x66FC = 0x427C
-0x66FE = 0x5478
-0x66FF = 0x4C66
-0x6700 = 0x576E
-0x6703 = 0x3B61
-0x6708 = 0x5442
-0x6709 = 0x5350
-0x670A = 0x6B43
-0x670B = 0x4573
-0x670D = 0x377E
-0x6710 = 0x6B54
-0x6714 = 0x4B37
-0x6715 = 0x6B5E
-0x6717 = 0x404A
-0x671B = 0x4D7B
-0x671D = 0x332F
-0x671F = 0x465A
-0x6726 = 0x6B7C
-0x6727 = 0x6B4A
-0x6728 = 0x443E
-0x672A = 0x4E34
-0x672B = 0x4429
-0x672C = 0x313E
-0x672D = 0x547D
-0x672F = 0x7868
-0x6731 = 0x566C
-0x6734 = 0x7860
-0x6735 = 0x3664
-0x673D = 0x5060
-0x6746 = 0x384B
-0x6748 = 0x683E
-0x6749 = 0x493C
-0x674C = 0x683B
-0x674E = 0x406E
-0x674F = 0x5053
-0x6750 = 0x3244
-0x6751 = 0x3465
-0x6753 = 0x683C
-0x6756 = 0x5548
-0x675C = 0x3645
-0x675E = 0x683D
-0x675F = 0x4A78
-0x6760 = 0x385C
-0x676A = 0x6842
-0x676D = 0x3A3C
-0x676F = 0x312D
-0x6770 = 0x3D5C
-0x6771 = 0x362B
-0x6772 = 0x6A3D
-0x6773 = 0x6843
-0x6775 = 0x6846
-0x6777 = 0x684B
-0x677C = 0x684C
-0x677E = 0x7869
-0x677F = 0x3065
-0x6787 = 0x6841
-0x6789 = 0x4D77
-0x678B = 0x684A
-0x6790 = 0x4E76
-0x6795 = 0x556D
-0x6797 = 0x4156
-0x6798 = 0x6844
-0x679A = 0x4336
-0x679C = 0x397B
-0x679D = 0x5626
-0x67AF = 0x3F5D
-0x67B0 = 0x6852
-0x67B3 = 0x6857
-0x67B5 = 0x6855
-0x67B6 = 0x3C5C
-0x67B7 = 0x3C4F
-0x67B8 = 0x685B
-0x67C1 = 0x685E
-0x67C3 = 0x685A
-0x67C4 = 0x317A
-0x67CF = 0x3058
-0x67D0 = 0x4433
-0x67D1 = 0x384C
-0x67D2 = 0x4662
-0x67D3 = 0x483E
-0x67D4 = 0x4861
-0x67D8 = 0x684F
-0x67D9 = 0x6854
-0x67DA = 0x6856
-0x67DD = 0x6858
-0x67DE = 0x5775
-0x67E2 = 0x685C
-0x67E5 = 0x3269
-0x67E9 = 0x6851
-0x67EC = 0x3C6D
-0x67EF = 0x3F42
-0x67F0 = 0x684D
-0x67F1 = 0x5679
-0x67F3 = 0x4178
-0x67F4 = 0x3271
-0x67FF = 0x4A41
-0x6800 = 0x6859
-0x6805 = 0x5524
-0x6813 = 0x4B28
-0x6817 = 0x4075
-0x681D = 0x6869
-0x6821 = 0x5023
-0x6829 = 0x6872
-0x682A = 0x566A
-0x6832 = 0x6860
-0x6833 = 0x6861
-0x6838 = 0x3A4B
-0x6839 = 0x3879
-0x683C = 0x3871
-0x683D = 0x5454
-0x6840 = 0x686E
-0x6841 = 0x686C
-0x6842 = 0x3970
-0x6843 = 0x4C52
-0x6844 = 0x6866
-0x6845 = 0x4E26
-0x6846 = 0x3F72
-0x6848 = 0x3038
-0x6849 = 0x6871
-0x684A = 0x6870
-0x684C = 0x5740
-0x684E = 0x6864
-0x6850 = 0x4D29
-0x6851 = 0x4923
-0x6853 = 0x3B38
-0x6854 = 0x3D5B
-0x6855 = 0x686A
-0x686B = 0x6878
-0x6874 = 0x6875
-0x6876 = 0x4D30
-0x6877 = 0x6876
-0x6881 = 0x413A
-0x6883 = 0x6868
-0x6885 = 0x4337
-0x6886 = 0x3070
-0x688F = 0x6874
-0x6893 = 0x6877
-0x6897 = 0x3923
-0x6898 = 0x6845
-0x689D = 0x4C75
-0x689F = 0x6849
-0x68A2 = 0x4952
-0x68A7 = 0x4E60
-0x68A8 = 0x4066
-0x68AD = 0x4B73
-0x68AF = 0x4C5D
-0x68B0 = 0x5035
-0x68B3 = 0x4A61
-0x68B5 = 0x6873
-0x68C4 = 0x467A
-0x68C9 = 0x435E
-0x68CB = 0x4665
-0x68CD = 0x3977
-0x68D2 = 0x3074
-0x68D5 = 0x5758
-0x68D6 = 0x6847
-0x68D7 = 0x5466
-0x68D8 = 0x3C2C
-0x68DA = 0x456F
-0x68DF = 0x3630
-0x68E0 = 0x4C44
-0x68E3 = 0x6926
-0x68E7 = 0x553B
-0x68EE = 0x492D
-0x68F0 = 0x6922
-0x68F1 = 0x4062
-0x68F2 = 0x465C
-0x68F5 = 0x3F43
-0x68F9 = 0x687E
-0x68FA = 0x3957
-0x68FC = 0x687B
-0x6901 = 0x6924
-0x6905 = 0x524E
-0x690B = 0x6923
-0x690D = 0x5632
-0x690E = 0x5735
-0x690F = 0x6862
-0x6910 = 0x6927
-0x6912 = 0x3D37
-0x6930 = 0x522C
-0x6934 = 0x6932
-0x6939 = 0x6929
-0x693D = 0x342A
-0x693F = 0x343B
-0x6942 = 0x692B
-0x694A = 0x516E
-0x6953 = 0x3763
-0x6954 = 0x5028
-0x6957 = 0x6925
-0x695A = 0x337E
-0x695D = 0x692C
-0x695E = 0x4063
-0x6960 = 0x692A
-0x6963 = 0x6939
-0x6966 = 0x6938
-0x6968 = 0x6865
-0x696B = 0x692E
-0x696D = 0x5235
-0x696E = 0x687A
-0x6971 = 0x6928
-0x6975 = 0x3C2B
-0x6977 = 0x3F2C
-0x6978 = 0x6931
-0x6979 = 0x693A
-0x6980 = 0x692F
-0x6982 = 0x3845
-0x6986 = 0x535C
-0x698D = 0x6947
-0x6994 = 0x4046
-0x6995 = 0x6945
-0x6998 = 0x6930
-0x699B = 0x693B
-0x699C = 0x3071
-0x69A7 = 0x693C
-0x69A8 = 0x5525
-0x69AA = 0x683F
-0x69AB = 0x693E
-0x69AD = 0x693F
-0x69AE = 0x4859
-0x69B1 = 0x6941
-0x69B4 = 0x4171
-0x69B7 = 0x4836
-0x69BB = 0x693D
-0x69BF = 0x6867
-0x69C1 = 0x6942
-0x69CA = 0x6943
-0x69CB = 0x3939
-0x69CC = 0x6933
-0x69CD = 0x4739
-0x69CE = 0x6936
-0x69D0 = 0x3B31
-0x69D4 = 0x6940
-0x69E7 = 0x687D
-0x69ED = 0x694A
-0x69F2 = 0x694E
-0x69F3 = 0x3D30
-0x69FD = 0x325B
-0x69FF = 0x6948
-0x6A01 = 0x572E
-0x6A02 = 0x4056
-0x6A05 = 0x6848
-0x6A0A = 0x372E
-0x6A13 = 0x4225
-0x6A17 = 0x694B
-0x6A18 = 0x694C
-0x6A19 = 0x316A
-0x6A1E = 0x4A60
-0x6A1F = 0x5541
-0x6A21 = 0x4423
-0x6A23 = 0x5179
-0x6A28 = 0x6958
-0x6A2A = 0x3A61
-0x6A35 = 0x6954
-0x6A38 = 0x4653
-0x6A39 = 0x4A77
-0x6A3A = 0x686B
-0x6A3D = 0x6957
-0x6A3E = 0x6950
-0x6A44 = 0x694F
-0x6A47 = 0x4741
-0x6A48 = 0x6863
-0x6A4B = 0x4745
-0x6A50 = 0x6952
-0x6A58 = 0x6959
-0x6A59 = 0x3348
-0x6A5B = 0x6953
-0x6A5F = 0x3B7A
-0x6A61 = 0x4F70
-0x6A62 = 0x4D56
-0x6A65 = 0x694D
-0x6A71 = 0x3377
-0x6A80 = 0x4C34
-0x6A84 = 0x4F2D
-0x6A89 = 0x685F
-0x6A8E = 0x6955
-0x6A90 = 0x695C
-0x6A91 = 0x695B
-0x6A94 = 0x3535
-0x6A97 = 0x695E
-0x6A9C = 0x686D
-0x6AA0 = 0x6951
-0x6AA2 = 0x3C6C
-0x6AA3 = 0x6949
-0x6AA9 = 0x695D
-0x6AAB = 0x695F
-0x6AAC = 0x434A
-0x6AAF = 0x786D
-0x6AB3 = 0x6944
-0x6AB8 = 0x447B
-0x6ABB = 0x3C77
-0x6AC3 = 0x3971
-0x6AD3 = 0x6956
-0x6ADA = 0x6935
-0x6ADB = 0x684E
-0x6ADD = 0x687C
-0x6ADE = 0x695A
-0x6ADF = 0x685D
-0x6AE7 = 0x6946
-0x6AE8 = 0x6853
-0x6AEA = 0x6840
-0x6AEC = 0x6934
-0x6AF3 = 0x6850
-0x6AF8 = 0x6937
-0x6AFB = 0x5323
-0x6B04 = 0x4038
-0x6B0A = 0x4828
-0x6B0F = 0x6921
-0x6B12 = 0x686F
-0x6B16 = 0x692D
-0x6B1E = 0x6879
-0x6B20 = 0x4737
-0x6B21 = 0x344E
-0x6B23 = 0x5040
-0x6B32 = 0x537B
-0x6B37 = 0x6C24
-0x6B39 = 0x6C25
-0x6B3A = 0x465B
-0x6B3D = 0x4755
-0x6B3E = 0x3F6E
-0x6B43 = 0x6C26
-0x6B46 = 0x6C27
-0x6B47 = 0x502A
-0x6B49 = 0x4738
-0x6B4C = 0x3868
-0x6B50 = 0x4537
-0x6B59 = 0x6C28
-0x6B5F = 0x6C23
-0x6B61 = 0x3B36
-0x6B62 = 0x5639
-0x6B63 = 0x557D
-0x6B64 = 0x344B
-0x6B65 = 0x323D
-0x6B66 = 0x4E64
-0x6B67 = 0x4667
-0x6B6A = 0x4D61
-0x6B72 = 0x4B6A
-0x6B77 = 0x407A
-0x6B78 = 0x3969
-0x6B79 = 0x3475
-0x6B7B = 0x4B40
-0x6B81 = 0x6962
-0x6B82 = 0x6963
-0x6B83 = 0x516A
-0x6B84 = 0x6965
-0x6B86 = 0x3479
-0x6B89 = 0x5133
-0x6B8A = 0x4A62
-0x6B8D = 0x6968
-0x6B96 = 0x5633
-0x6B98 = 0x3250
-0x6B9B = 0x696A
-0x6B9E = 0x6966
-0x6BA4 = 0x6964
-0x6BAA = 0x696C
-0x6BAB = 0x6969
-0x6BAE = 0x6967
-0x6BAF = 0x696B
-0x6BB2 = 0x3C5F
-0x6BB3 = 0x6C2F
-0x6BB5 = 0x364E
-0x6BB7 = 0x5273
-0x6BBA = 0x4931
-0x6BBB = 0x3F47
-0x6BBF = 0x356E
-0x6BC1 = 0x3B59
-0x6BC5 = 0x5263
-0x6BC6 = 0x4539
-0x6BCB = 0x4E63
-0x6BCD = 0x4438
-0x6BCF = 0x433F
-0x6BD2 = 0x363E
-0x6BD3 = 0x5839
-0x6BD4 = 0x3148
-0x6BD6 = 0x3151
-0x6BD7 = 0x457E
-0x6BDB = 0x432B
-0x6BEA = 0x6B24
-0x6BEB = 0x3A41
-0x6BEF = 0x4C3A
-0x6BF3 = 0x6B25
-0x6BF9 = 0x6B28
-0x6BFD = 0x6B26
-0x6BFF = 0x6B27
-0x6C05 = 0x6B29
-0x6C06 = 0x6B2B
-0x6C08 = 0x5531
-0x6C0C = 0x6B2A
-0x6C0D = 0x6B2C
-0x6C0F = 0x4A4F
-0x6C10 = 0x5835
-0x6C11 = 0x4371
-0x6C13 = 0x4325
-0x6C15 = 0x6B2D
-0x6C16 = 0x444A
-0x6C18 = 0x6B2E
-0x6C19 = 0x6B2F
-0x6C1A = 0x6B30
-0x6C1B = 0x3755
-0x6C1F = 0x377A
-0x6C21 = 0x6B31
-0x6C23 = 0x4678
-0x6C24 = 0x6B33
-0x6C26 = 0x3A24
-0x6C27 = 0x5175
-0x6C28 = 0x3031
-0x6C2A = 0x6B34
-0x6C2B = 0x4762
-0x6C2C = 0x6B32
-0x6C2E = 0x352A
-0x6C2F = 0x4248
-0x6C30 = 0x4768
-0x6C32 = 0x6B35
-0x6C34 = 0x4B2E
-0x6C35 = 0x635F
-0x6C38 = 0x5340
-0x6C3D = 0x595B
-0x6C40 = 0x4D21
-0x6C41 = 0x562D
-0x6C42 = 0x4773
-0x6C46 = 0x5960
-0x6C4A = 0x6362
-0x6C50 = 0x4F2B
-0x6C54 = 0x6360
-0x6C55 = 0x4947
-0x6C57 = 0x3A39
-0x6C5B = 0x5134
-0x6C5C = 0x6361
-0x6C5D = 0x486A
-0x6C5E = 0x392F
-0x6C5F = 0x3D2D
-0x6C60 = 0x3358
-0x6C61 = 0x4E5B
-0x6C68 = 0x6368
-0x6C69 = 0x6369
-0x6C6A = 0x4D74
-0x6C70 = 0x4C2D
-0x6C72 = 0x3C33
-0x6C74 = 0x636A
-0x6C76 = 0x636B
-0x6C79 = 0x505A
-0x6C7D = 0x467B
-0x6C7E = 0x375A
-0x6C81 = 0x475F
-0x6C82 = 0x524A
-0x6C83 = 0x4E56
-0x6C85 = 0x6364
-0x6C86 = 0x636C
-0x6C88 = 0x4972
-0x6C89 = 0x3341
-0x6C8C = 0x6367
-0x6C8F = 0x4663
-0x6C90 = 0x6365
-0x6C93 = 0x6D33
-0x6C94 = 0x6366
-0x6C99 = 0x4933
-0x6C9B = 0x4566
-0x6CA1 = 0x433B
-0x6CAB = 0x442D
-0x6CAD = 0x6370
-0x6CAE = 0x3E5A
-0x6CB1 = 0x637B
-0x6CB2 = 0x6375
-0x6CB3 = 0x3A53
-0x6CB8 = 0x3750
-0x6CB9 = 0x534D
-0x6CBB = 0x564E
-0x6CBC = 0x5553
-0x6CBD = 0x3941
-0x6CBE = 0x5534
-0x6CBF = 0x5158
-0x6CC4 = 0x5039
-0x6CC5 = 0x4776
-0x6CC9 = 0x482A
-0x6CCA = 0x3234
-0x6CCC = 0x435A
-0x6CD0 = 0x636E
-0x6CD3 = 0x637C
-0x6CD4 = 0x636F
-0x6CD5 = 0x3728
-0x6CD6 = 0x6377
-0x6CD7 = 0x6374
-0x6CDB = 0x373A
-0x6CE0 = 0x6376
-0x6CE1 = 0x455D
-0x6CE2 = 0x3228
-0x6CE3 = 0x467C
-0x6CE5 = 0x4460
-0x6CE8 = 0x5722
-0x6CEA = 0x4061
-0x6CEB = 0x6379
-0x6CEE = 0x637A
-0x6CEF = 0x637D
-0x6CF0 = 0x4C29
-0x6CF1 = 0x6373
-0x6CF3 = 0x533E
-0x6CF5 = 0x3143
-0x6D04 = 0x6427
-0x6D07 = 0x6426
-0x6D0B = 0x5173
-0x6D0C = 0x6423
-0x6D0E = 0x6429
-0x6D17 = 0x4F34
-0x6D19 = 0x6428
-0x6D1A = 0x642E
-0x6D1B = 0x4265
-0x6D1E = 0x3634
-0x6D25 = 0x3D72
-0x6D27 = 0x6422
-0x6D2A = 0x3A69
-0x6D2B = 0x642A
-0x6D2E = 0x642C
-0x6D31 = 0x367D
-0x6D32 = 0x565E
-0x6D33 = 0x6432
-0x6D35 = 0x642D
-0x6D39 = 0x6421
-0x6D3B = 0x3B6E
-0x6D3D = 0x4722
-0x6D3E = 0x4549
-0x6D41 = 0x4177
-0x6D59 = 0x5563
-0x6D5A = 0x3F23
-0x6D5C = 0x643A
-0x6D5E = 0x6437
-0x6D60 = 0x643B
-0x6D63 = 0x643D
-0x6D66 = 0x4656
-0x6D69 = 0x3A46
-0x6D6A = 0x404B
-0x6D6E = 0x3821
-0x6D6F = 0x6434
-0x6D74 = 0x5421
-0x6D77 = 0x3A23
-0x6D78 = 0x3D7E
-0x6D79 = 0x6424
-0x6D7C = 0x643C
-0x6D82 = 0x786F
-0x6D85 = 0x4479
-0x6D87 = 0x637E
-0x6D88 = 0x4F7B
-0x6D89 = 0x4966
-0x6D8C = 0x533F
-0x6D8E = 0x4F51
-0x6D91 = 0x6433
-0x6D93 = 0x6438
-0x6D94 = 0x6439
-0x6D95 = 0x4C69
-0x6DAA = 0x3822
-0x6DAB = 0x644A
-0x6DAE = 0x644C
-0x6DAF = 0x5144
-0x6DB2 = 0x523A
-0x6DB5 = 0x3A2D
-0x6DB8 = 0x3A54
-0x6DBF = 0x6443
-0x6DC0 = 0x782D
-0x6DC4 = 0x574D
-0x6DC5 = 0x6440
-0x6DC6 = 0x4F7D
-0x6DC7 = 0x643F
-0x6DCB = 0x415C
-0x6DCC = 0x4C4A
-0x6DD1 = 0x4A67
-0x6DD6 = 0x4457
-0x6DD8 = 0x4C54
-0x6DD9 = 0x6448
-0x6DDD = 0x6447
-0x6DDE = 0x6441
-0x6DE0 = 0x6444
-0x6DE1 = 0x352D
-0x6DE4 = 0x5359
-0x6DE6 = 0x6446
-0x6DEA = 0x4259
-0x6DEB = 0x5279
-0x6DEC = 0x3463
-0x6DEE = 0x3B34
-0x6DF1 = 0x496E
-0x6DF3 = 0x343E
-0x6DF5 = 0x5428
-0x6DF6 = 0x6435
-0x6DF7 = 0x3B6C
-0x6DF9 = 0x514D
-0x6DFA = 0x4733
-0x6DFB = 0x4C6D
-0x6DFC = 0x6D35
-0x6E05 = 0x4765
-0x6E0C = 0x644B
-0x6E19 = 0x3B41
-0x6E1A = 0x643E
-0x6E1D = 0x5365
-0x6E20 = 0x477E
-0x6E21 = 0x3649
-0x6E23 = 0x547C
-0x6E24 = 0x3233
-0x6E25 = 0x6457
-0x6E26 = 0x4E50
-0x6E29 = 0x4E42
-0x6E2B = 0x644D
-0x6E2C = 0x3262
-0x6E2D = 0x4E3C
-0x6E2F = 0x385B
-0x6E32 = 0x6456
-0x6E34 = 0x3F4A
-0x6E38 = 0x534E
-0x6E3A = 0x436C
-0x6E3E = 0x3B6B
-0x6E43 = 0x4548
-0x6E44 = 0x6458
-0x6E4D = 0x4D44
-0x6E4E = 0x644F
-0x6E53 = 0x6454
-0x6E54 = 0x6455
-0x6E56 = 0x3A7E
-0x6E58 = 0x4F66
-0x6E5B = 0x553F
-0x6E5E = 0x6425
-0x6E5F = 0x6452
-0x6E6B = 0x6450
-0x6E6E = 0x644E
-0x6E6F = 0x4C40
-0x6E86 = 0x6453
-0x6E89 = 0x3848
-0x6E8F = 0x6467
-0x6E90 = 0x5434
-0x6E96 = 0x573C
-0x6E98 = 0x645B
-0x6E9C = 0x416F
-0x6E9D = 0x3935
-0x6E9F = 0x6469
-0x6EA2 = 0x5267
-0x6EA5 = 0x645F
-0x6EA7 = 0x6460
-0x6EAA = 0x4F2A
-0x6EAF = 0x4B5D
-0x6EB1 = 0x645A
-0x6EB2 = 0x6451
-0x6EB4 = 0x6465
-0x6EB6 = 0x485C
-0x6EB7 = 0x6463
-0x6EBA = 0x4467
-0x6EBB = 0x6462
-0x6EBD = 0x6461
-0x6EC1 = 0x337C
-0x6EC2 = 0x6468
-0x6EC4 = 0x3257
-0x6EC5 = 0x4370
-0x6EC7 = 0x3561
-0x6ECB = 0x574C
-0x6ECC = 0x3553
-0x6ECE = 0x5C7E
-0x6ECF = 0x6466
-0x6ED1 = 0x3B2C
-0x6ED3 = 0x5752
-0x6ED4 = 0x4C4F
-0x6ED5 = 0x6B78
-0x6EDA = 0x3976
-0x6EEC = 0x3B26
-0x6EEF = 0x564D
-0x6EF2 = 0x4978
-0x6EF4 = 0x354E
-0x6EF7 = 0x4231
-0x6EF8 = 0x6430
-0x6EF9 = 0x646F
-0x6EFF = 0x427A
-0x6F01 = 0x5366
-0x6F02 = 0x462F
-0x6F06 = 0x4661
-0x6F09 = 0x6475
-0x6F0F = 0x4229
-0x6F14 = 0x515D
-0x6F15 = 0x646E
-0x6F1A = 0x453D
-0x6F20 = 0x442E
-0x6F22 = 0x3A3A
-0x6F23 = 0x4130
-0x6F24 = 0x646D
-0x6F29 = 0x6476
-0x6F2A = 0x6474
-0x6F2B = 0x427E
-0x6F2C = 0x5755
-0x6F2D = 0x645D
-0x6F2F = 0x6470
-0x6F31 = 0x4A7E
-0x6F32 = 0x5547
-0x6F33 = 0x5544
-0x6F36 = 0x6471
-0x6F38 = 0x3D25
-0x6F3E = 0x517A
-0x6F3F = 0x3D2C
-0x6F41 = 0x7223
-0x6F51 = 0x4643
-0x6F54 = 0x3D60
-0x6F58 = 0x454B
-0x6F59 = 0x636D
-0x6F5B = 0x4731
-0x6F5E = 0x423A
-0x6F62 = 0x646A
-0x6F64 = 0x4873
-0x6F66 = 0x414A
-0x6F6D = 0x4C36
-0x6F6E = 0x3331
-0x6F6F = 0x6431
-0x6F70 = 0x4023
-0x6F72 = 0x647B
-0x6F74 = 0x6473
-0x6F77 = 0x6464
-0x6F78 = 0x647A
-0x6F7A = 0x647D
-0x6F7C = 0x647C
-0x6F7F = 0x6436
-0x6F80 = 0x492C
-0x6F84 = 0x334E
-0x6F86 = 0x3D3D
-0x6F87 = 0x4054
-0x6F88 = 0x333A
-0x6F89 = 0x6477
-0x6F8C = 0x6479
-0x6F8D = 0x6478
-0x6F8E = 0x456C
-0x6F97 = 0x3D27
-0x6FA0 = 0x6445
-0x6FA1 = 0x5468
-0x6FA4 = 0x5473
-0x6FA7 = 0x6522
-0x6FA9 = 0x6D34
-0x6FAE = 0x642B
-0x6FB1 = 0x356D
-0x6FB3 = 0x3044
-0x6FB6 = 0x6524
-0x6FB9 = 0x6523
-0x6FC0 = 0x3C24
-0x6FC1 = 0x5747
-0x6FC2 = 0x6525
-0x6FC3 = 0x4528
-0x6FC9 = 0x6521
-0x6FD5 = 0x4A2A
-0x6FD8 = 0x4522
-0x6FDB = 0x7855
-0x6FDE = 0x6528
-0x6FDF = 0x3C43
-0x6FE0 = 0x6529
-0x6FE1 = 0x6526
-0x6FE4 = 0x4C4E
-0x6FEB = 0x4044
-0x6FEE = 0x6527
-0x6FEF = 0x652A
-0x6FF0 = 0x4E2B
-0x6FF1 = 0x3175
-0x6FFA = 0x3D26
-0x6FFC = 0x6378
-0x6FFE = 0x424B
-0x7005 = 0x645E
-0x7006 = 0x6442
-0x7009 = 0x503A
-0x700B = 0x6449
-0x700F = 0x642F
-0x7011 = 0x4659
-0x7015 = 0x3174
-0x7018 = 0x6372
-0x701A = 0x652B
-0x701B = 0x652D
-0x701D = 0x4124
-0x701F = 0x646C
-0x7020 = 0x646B
-0x7023 = 0x652C
-0x7027 = 0x6371
-0x7028 = 0x647E
-0x7030 = 0x7858
-0x7032 = 0x6472
-0x7035 = 0x652F
-0x7039 = 0x652E
-0x703E = 0x403D
-0x7043 = 0x6363
-0x7044 = 0x645C
-0x704C = 0x3960
-0x7051 = 0x4877
-0x7055 = 0x406C
-0x7058 = 0x4C32
-0x705D = 0x6530
-0x705E = 0x6531
-0x7063 = 0x4D65
-0x7064 = 0x4250
-0x7067 = 0x6459
-0x706B = 0x3B70
-0x706C = 0x6C61
-0x7070 = 0x3B52
-0x7078 = 0x3E44
-0x707C = 0x5746
-0x707E = 0x5456
-0x7085 = 0x6A41
-0x708A = 0x3436
-0x708E = 0x5157
-0x7092 = 0x3334
-0x7094 = 0x4832
-0x7095 = 0x3F3B
-0x7096 = 0x6C40
-0x7099 = 0x564B
-0x70AB = 0x6C45
-0x70AC = 0x3E66
-0x70AD = 0x4C3F
-0x70AE = 0x455A
-0x70AF = 0x3E3C
-0x70B1 = 0x6C46
-0x70B3 = 0x317E
-0x70B7 = 0x6C44
-0x70B8 = 0x5528
-0x70BB = 0x6C42
-0x70C0 = 0x6C43
-0x70C8 = 0x4152
-0x70CA = 0x6C48
-0x70CF = 0x4E5A
-0x70D8 = 0x3A66
-0x70D9 = 0x4053
-0x70DF = 0x514C
-0x70E4 = 0x3F3E
-0x70EF = 0x4F29
-0x70F4 = 0x4C7E
-0x70F7 = 0x4D69
-0x70F9 = 0x456B
-0x70FD = 0x3769
-0x7109 = 0x5149
-0x710A = 0x3A38
-0x7110 = 0x6C49
-0x7113 = 0x6C4A
-0x7119 = 0x313A
-0x711A = 0x3759
-0x7121 = 0x4E5E
-0x7126 = 0x3D39
-0x712F = 0x6C4C
-0x7130 = 0x5166
-0x7131 = 0x6C4D
-0x7136 = 0x483B
-0x7145 = 0x6C51
-0x7149 = 0x4136
-0x714A = 0x6C53
-0x714C = 0x3B4D
-0x714E = 0x3C65
-0x7152 = 0x6C3F
-0x715C = 0x6C4F
-0x715E = 0x4937
-0x7162 = 0x5C64
-0x7164 = 0x433A
-0x7165 = 0x3B40
-0x7166 = 0x6C63
-0x7167 = 0x5555
-0x7168 = 0x6C50
-0x7169 = 0x3733
-0x716C = 0x6C3E
-0x716E = 0x5673
-0x7172 = 0x6C52
-0x7173 = 0x6C4E
-0x7178 = 0x6C54
-0x717A = 0x6C55
-0x717D = 0x493F
-0x7184 = 0x4F28
-0x718A = 0x505C
-0x718F = 0x512C
-0x7192 = 0x532B
-0x7194 = 0x485B
-0x7197 = 0x6C41
-0x7198 = 0x6C56
-0x7199 = 0x4E75
-0x719F = 0x4A6C
-0x71A0 = 0x6C5A
-0x71A8 = 0x6C59
-0x71AC = 0x303E
-0x71B1 = 0x4848
-0x71B3 = 0x6C57
-0x71B5 = 0x6C58
-0x71B9 = 0x6C64
-0x71BE = 0x3363
-0x71C1 = 0x6C47
-0x71C3 = 0x483C
-0x71C8 = 0x3546
-0x71CE = 0x4147
-0x71D2 = 0x4955
-0x71D4 = 0x6C5C
-0x71D5 = 0x5160
-0x71D9 = 0x4C4C
-0x71DC = 0x6C4B
-0x71DF = 0x532A
-0x71E0 = 0x6C5B
-0x71E5 = 0x546F
-0x71E6 = 0x3253
-0x71E7 = 0x6C5D
-0x71ED = 0x5672
-0x71EE = 0x5B46
-0x71F4 = 0x3B62
-0x71F9 = 0x6C5E
-0x71FC = 0x3D7D
-0x71FE = 0x6C62
-0x7206 = 0x312C
-0x720D = 0x4B38
-0x7210 = 0x422F
-0x721B = 0x4043
-0x721D = 0x6C5F
-0x7228 = 0x6C60
-0x722A = 0x5726
-0x722C = 0x4540
-0x722D = 0x5579
-0x7230 = 0x6B3C
-0x7232 = 0x4E2A
-0x7235 = 0x3E74
-0x7236 = 0x3838
-0x7238 = 0x3056
-0x7239 = 0x3579
-0x723A = 0x522F
-0x723B = 0x5833
-0x723D = 0x4B2C
-0x723E = 0x367B
-0x723F = 0x635D
-0x7247 = 0x462C
-0x7248 = 0x3066
-0x724C = 0x4546
-0x7252 = 0x6B3A
-0x7256 = 0x6B3B
-0x7258 = 0x6B39
-0x7259 = 0x5140
-0x725B = 0x4523
-0x725D = 0x6A72
-0x725F = 0x4432
-0x7261 = 0x4435
-0x7262 = 0x404E
-0x7266 = 0x6A73
-0x7267 = 0x4441
-0x7269 = 0x4E6F
-0x726E = 0x6A70
-0x726F = 0x6A74
-0x7272 = 0x497C
-0x7279 = 0x4C58
-0x727D = 0x4723
-0x727E = 0x6A75
-0x727F = 0x6A76
-0x7280 = 0x4F2C
-0x7281 = 0x4067
-0x7284 = 0x6A77
-0x728B = 0x6A78
-0x728D = 0x6A79
-0x728F = 0x6A7A
-0x7292 = 0x6A7B
-0x7296 = 0x5C7D
-0x729F = 0x6A71
-0x72A2 = 0x363F
-0x72A7 = 0x4E7E
-0x72AC = 0x482E
-0x72AD = 0x616B
-0x72AF = 0x3738
-0x72B0 = 0x616C
-0x72B4 = 0x616D
-0x72C0 = 0x5734
-0x72C1 = 0x6171
-0x72C2 = 0x3F71
-0x72C3 = 0x6170
-0x72C4 = 0x3552
-0x72CD = 0x6173
-0x72CE = 0x6172
-0x72D0 = 0x3A7C
-0x72D2 = 0x6174
-0x72D7 = 0x3937
-0x72D9 = 0x3E51
-0x72E0 = 0x3A5D
-0x72E1 = 0x3D46
-0x72E8 = 0x6175
-0x72E9 = 0x6177
-0x72F3 = 0x617C
-0x72F4 = 0x6179
-0x72F7 = 0x617A
-0x72F8 = 0x406A
-0x72F9 = 0x4F41
-0x72FA = 0x617E
-0x72FB = 0x6221
-0x72FC = 0x4047
-0x72FD = 0x3137
-0x7301 = 0x617B
-0x730A = 0x6225
-0x7313 = 0x6223
-0x7316 = 0x327E
-0x7317 = 0x6222
-0x7319 = 0x5578
-0x731B = 0x434D
-0x731C = 0x3242
-0x731D = 0x6227
-0x731E = 0x6226
-0x7322 = 0x6229
-0x7325 = 0x622B
-0x7329 = 0x5049
-0x732A = 0x566D
-0x732B = 0x4328
-0x732C = 0x622C
-0x7331 = 0x622E
-0x7334 = 0x3A6F
-0x7336 = 0x534C
-0x7337 = 0x6960
-0x7338 = 0x622D
-0x7339 = 0x622A
-0x733B = 0x6178
-0x733E = 0x3B2B
-0x733F = 0x5433
-0x7341 = 0x616F
-0x7344 = 0x537C
-0x7345 = 0x4A28
-0x734D = 0x6230
-0x7350 = 0x622F
-0x7352 = 0x6961
-0x7357 = 0x6231
-0x7360 = 0x6232
-0x7368 = 0x3640
-0x736A = 0x6176
-0x736B = 0x617D
-0x736C = 0x6233
-0x736F = 0x6234
-0x7370 = 0x447C
-0x7372 = 0x3B71
-0x7375 = 0x4154
-0x7377 = 0x616E
-0x7378 = 0x4A5E
-0x737A = 0x4C21
-0x737B = 0x4F57
-0x737C = 0x6228
-0x737E = 0x6235
-0x7380 = 0x6224
-0x7384 = 0x507E
-0x7387 = 0x424A
-0x7389 = 0x5371
-0x738B = 0x4D75
-0x738E = 0x6760
-0x7396 = 0x3E41
-0x739F = 0x6764
-0x73A2 = 0x6763
-0x73A9 = 0x4D66
-0x73AB = 0x4335
-0x73B2 = 0x4161
-0x73B3 = 0x6769
-0x73B7 = 0x6768
-0x73BB = 0x3223
-0x73C0 = 0x676A
-0x73C2 = 0x6766
-0x73C8 = 0x676C
-0x73C9 = 0x676B
-0x73CA = 0x493A
-0x73CD = 0x5564
-0x73CF = 0x6765
-0x73D0 = 0x3729
-0x73D9 = 0x676E
-0x73DE = 0x6773
-0x73E0 = 0x5669
-0x73E5 = 0x676D
-0x73E7 = 0x6772
-0x73E9 = 0x6771
-0x73ED = 0x3060
-0x73FE = 0x4F56
-0x7403 = 0x4772
-0x7405 = 0x4045
-0x7406 = 0x406D
-0x7409 = 0x4170
-0x740A = 0x6770
-0x741A = 0x6822
-0x741B = 0x6821
-0x7422 = 0x5741
-0x7425 = 0x677A
-0x7426 = 0x6779
-0x7428 = 0x677B
-0x742A = 0x6777
-0x742C = 0x677E
-0x742E = 0x677D
-0x7430 = 0x677C
-0x7433 = 0x4155
-0x7434 = 0x4759
-0x7435 = 0x457D
-0x7436 = 0x4543
-0x743F = 0x6775
-0x7441 = 0x6823
-0x744B = 0x6762
-0x7455 = 0x6826
-0x7457 = 0x6825
-0x7459 = 0x6827
-0x745A = 0x3A77
-0x745B = 0x6778
-0x745C = 0x6824
-0x745E = 0x4870
-0x745F = 0x492A
-0x7463 = 0x4B76
-0x7469 = 0x5328
-0x746A = 0x426A
-0x746D = 0x6829
-0x7470 = 0x3965
-0x7476 = 0x517E
-0x747E = 0x682A
-0x7480 = 0x682D
-0x7481 = 0x682E
-0x7483 = 0x4127
-0x7487 = 0x682F
-0x7489 = 0x6776
-0x748B = 0x6830
-0x7490 = 0x6834
-0x749C = 0x682B
-0x749E = 0x6831
-0x74A3 = 0x6761
-0x74A6 = 0x6828
-0x74A7 = 0x6835
-0x74A8 = 0x6832
-0x74A9 = 0x6833
-0x74B0 = 0x3B37
-0x74BA = 0x6837
-0x74BD = 0x6774
-0x74CA = 0x476D
-0x74CF = 0x6767
-0x74D4 = 0x682C
-0x74DA = 0x6836
-0x74DC = 0x394F
-0x74DE = 0x702C
-0x74E0 = 0x702D
-0x74E2 = 0x4630
-0x74E3 = 0x306A
-0x74E4 = 0x483F
-0x74E6 = 0x4D5F
-0x74EE = 0x4E4D
-0x74F4 = 0x6A32
-0x74F6 = 0x463F
-0x74F7 = 0x3449
-0x74FF = 0x6A33
-0x7504 = 0x5567
-0x750C = 0x6A31
-0x750D = 0x5D79
-0x750F = 0x6A34
-0x7511 = 0x6A35
-0x7513 = 0x6A36
-0x7518 = 0x384A
-0x7519 = 0x5F30
-0x751A = 0x4975
-0x751C = 0x4C70
-0x751F = 0x497A
-0x7523 = 0x327A
-0x7525 = 0x497B
-0x7528 = 0x5343
-0x7529 = 0x4B26
-0x752B = 0x3826
-0x752C = 0x702E
-0x752D = 0x3142
-0x752F = 0x6538
-0x7530 = 0x4C6F
-0x7531 = 0x5349
-0x7532 = 0x3C57
-0x7533 = 0x496A
-0x7537 = 0x4450
-0x7538 = 0x3569
-0x753A = 0x6E2E
-0x753E = 0x675E
-0x7540 = 0x6E2F
-0x7548 = 0x6E32
-0x754B = 0x6E31
-0x754C = 0x3D67
-0x754E = 0x6E30
-0x754F = 0x4E37
-0x7554 = 0x454F
-0x7559 = 0x4174
-0x755A = 0x5B4E
-0x755B = 0x6E33
-0x755C = 0x5073
-0x755D = 0x4436
-0x7562 = 0x314F
-0x7565 = 0x4254
-0x7566 = 0x4668
-0x756A = 0x372C
-0x756B = 0x3B2D
-0x7572 = 0x6E34
-0x7576 = 0x3531
-0x7578 = 0x3B7B
-0x7579 = 0x6E35
-0x757F = 0x675C
-0x7583 = 0x6E36
-0x7586 = 0x3D2E
-0x7587 = 0x336B
-0x758A = 0x357E
-0x758B = 0x7162
-0x758F = 0x4A68
-0x7591 = 0x5249
-0x7592 = 0x705A
-0x7594 = 0x705B
-0x7599 = 0x386D
-0x759A = 0x3E4E
-0x759D = 0x705E
-0x75A3 = 0x7060
-0x75A4 = 0x304C
-0x75A5 = 0x3D6A
-0x75AB = 0x525F
-0x75B0 = 0x7066
-0x75B1 = 0x7065
-0x75B2 = 0x4623
-0x75B3 = 0x7061
-0x75B4 = 0x7062
-0x75B5 = 0x3443
-0x75B8 = 0x7063
-0x75B9 = 0x556E
-0x75BC = 0x4C5B
-0x75BD = 0x3E52
-0x75BE = 0x3C32
-0x75C2 = 0x7068
-0x75C3 = 0x7067
-0x75C4 = 0x7064
-0x75C5 = 0x3221
-0x75C7 = 0x7921
-0x75CA = 0x482C
-0x75CD = 0x706A
-0x75D4 = 0x564C
-0x75D5 = 0x3A5B
-0x75D8 = 0x363B
-0x75D9 = 0x3E37
-0x75DB = 0x4D34
-0x75DE = 0x4626
-0x75E2 = 0x4121
-0x75E3 = 0x706B
-0x75E4 = 0x706E
-0x75E6 = 0x706D
-0x75E7 = 0x7070
-0x75F0 = 0x4C35
-0x75F1 = 0x7072
-0x75F4 = 0x3355
-0x75F9 = 0x3154
-0x75FC = 0x7073
-0x75FF = 0x7074
-0x7600 = 0x7076
-0x7601 = 0x3461
-0x7602 = 0x7069
-0x7603 = 0x7071
-0x760A = 0x707A
-0x760B = 0x3768
-0x760C = 0x7078
-0x760D = 0x5171
-0x7610 = 0x7075
-0x7613 = 0x3B3E
-0x7615 = 0x707D
-0x7619 = 0x707E
-0x761B = 0x7121
-0x761E = 0x7079
-0x761F = 0x4E41
-0x7620 = 0x7124
-0x7621 = 0x342F
-0x7622 = 0x7123
-0x7624 = 0x4176
-0x7625 = 0x707B
-0x7626 = 0x4A5D
-0x7627 = 0x4531
-0x7629 = 0x3471
-0x762D = 0x7126
-0x7630 = 0x7127
-0x7633 = 0x712C
-0x7634 = 0x554E
-0x7635 = 0x7129
-0x7638 = 0x4833
-0x763B = 0x707C
-0x763C = 0x7122
-0x7640 = 0x7125
-0x7642 = 0x4146
-0x7643 = 0x712A
-0x7646 = 0x706C
-0x7647 = 0x706F
-0x7649 = 0x7077
-0x764C = 0x3029
-0x764D = 0x712D
-0x7654 = 0x712F
-0x7656 = 0x7131
-0x7658 = 0x705D
-0x765C = 0x7130
-0x765F = 0x3171
-0x7662 = 0x5177
-0x7664 = 0x705C
-0x7665 = 0x5622
-0x7667 = 0x705F
-0x7669 = 0x712E
-0x766C = 0x5122
-0x766D = 0x7128
-0x766E = 0x712B
-0x766F = 0x7133
-0x7670 = 0x5338
-0x7671 = 0x4C31
-0x7672 = 0x7132
-0x7678 = 0x396F
-0x767B = 0x3547
-0x767C = 0x3722
-0x767D = 0x3057
-0x767E = 0x3059
-0x7682 = 0x546D
-0x7684 = 0x3544
-0x7686 = 0x3D54
-0x7687 = 0x3B4A
-0x7688 = 0x7027
-0x768B = 0x385E
-0x768E = 0x7028
-0x7693 = 0x7029
-0x7696 = 0x4D6E
-0x7699 = 0x702A
-0x769A = 0x3028
-0x76A4 = 0x702B
-0x76AE = 0x4624
-0x76B4 = 0x7165
-0x76B8 = 0x7164
-0x76BA = 0x5665
-0x76BF = 0x4373
-0x76C2 = 0x535B
-0x76C5 = 0x5651
-0x76C6 = 0x4568
-0x76C8 = 0x532F
-0x76CA = 0x5266
-0x76CD = 0x6E41
-0x76CE = 0x303B
-0x76D2 = 0x3A50
-0x76D4 = 0x3F78
-0x76D7 = 0x3541
-0x76DB = 0x4A22
-0x76DE = 0x5535
-0x76DF = 0x434B
-0x76E1 = 0x3E21
-0x76E3 = 0x3C60
-0x76E4 = 0x454C
-0x76E5 = 0x6E42
-0x76E7 = 0x422C
-0x76EE = 0x443F
-0x76EF = 0x3622
-0x76F1 = 0x6D6C
-0x76F2 = 0x4324
-0x76F4 = 0x5631
-0x76F8 = 0x4F60
-0x76F9 = 0x6D6F
-0x76FC = 0x454E
-0x76FE = 0x365C
-0x7701 = 0x4A21
-0x7704 = 0x6D6D
-0x7707 = 0x6D70
-0x7708 = 0x6D71
-0x7709 = 0x433C
-0x770B = 0x3F34
-0x7719 = 0x6D74
-0x771A = 0x6D72
-0x771F = 0x5566
-0x7720 = 0x435F
-0x7722 = 0x6D73
-0x7726 = 0x6D76
-0x7728 = 0x5523
-0x7729 = 0x5123
-0x772D = 0x6D75
-0x772F = 0x4350
-0x7735 = 0x6D77
-0x7736 = 0x3F74
-0x7737 = 0x3E6C
-0x7738 = 0x6D78
-0x773A = 0x4C77
-0x773C = 0x515B
-0x7740 = 0x5745
-0x7743 = 0x6D7C
-0x7747 = 0x6D7B
-0x774F = 0x784A
-0x775A = 0x6D7D
-0x775B = 0x3E26
-0x775C = 0x5576
-0x775E = 0x6D79
-0x7761 = 0x4B2F
-0x7762 = 0x6E21
-0x7763 = 0x363D
-0x7765 = 0x6E22
-0x7766 = 0x4440
-0x7768 = 0x6D7E
-0x776B = 0x3D5E
-0x776C = 0x3247
-0x7779 = 0x3643
-0x777D = 0x6E25
-0x777E = 0x583A
-0x777F = 0x6E23
-0x7780 = 0x6E26
-0x7784 = 0x4369
-0x7785 = 0x3372
-0x778C = 0x6E27
-0x778D = 0x6E24
-0x778E = 0x4F39
-0x7791 = 0x6E28
-0x7798 = 0x6D6E
-0x779E = 0x4277
-0x779F = 0x6E29
-0x77A0 = 0x6E2A
-0x77A2 = 0x5E2B
-0x77A5 = 0x4633
-0x77A7 = 0x4746
-0x77AA = 0x3549
-0x77AC = 0x4B32
-0x77AD = 0x7851
-0x77B0 = 0x6E2B
-0x77B3 = 0x4D2B
-0x77B5 = 0x6E2C
-0x77BB = 0x5530
-0x77BC = 0x6D7A
-0x77BD = 0x6E2D
-0x77BF = 0x7644
-0x77C7 = 0x7857
-0x77CD = 0x5B47
-0x77D7 = 0x3423
-0x77DA = 0x5675
-0x77DB = 0x432C
-0x77DC = 0x7166
-0x77E2 = 0x4A38
-0x77E3 = 0x5253
-0x77E5 = 0x562A
-0x77E7 = 0x6F72
-0x77E9 = 0x3E58
-0x77EC = 0x6F73
-0x77ED = 0x364C
-0x77EE = 0x302B
-0x77EF = 0x3D43
-0x77F3 = 0x4A2F
-0x77F8 = 0x6D37
-0x77FD = 0x4E79
-0x7802 = 0x4930
-0x7809 = 0x6D39
-0x780C = 0x4676
-0x780D = 0x3F33
-0x7811 = 0x6D3C
-0x7812 = 0x4578
-0x7814 = 0x5150
-0x7818 = 0x6D3B
-0x781D = 0x6D40
-0x781F = 0x6D44
-0x7823 = 0x6D48
-0x7825 = 0x6D46
-0x7826 = 0x6D4E
-0x7827 = 0x5568
-0x7829 = 0x6D49
-0x782C = 0x6D47
-0x782D = 0x6D3E
-0x7830 = 0x4569
-0x7834 = 0x4646
-0x7837 = 0x4969
-0x7838 = 0x5452
-0x7839 = 0x6D41
-0x783C = 0x6D45
-0x7843 = 0x7927
-0x7845 = 0x3968
-0x7847 = 0x6D50
-0x784C = 0x6D51
-0x784E = 0x6D4A
-0x7850 = 0x6D4F
-0x7852 = 0x4E78
-0x785D = 0x4F75
-0x7864 = 0x6D4C
-0x7868 = 0x6D3A
-0x786A = 0x6D52
-0x786B = 0x4172
-0x786C = 0x5332
-0x786D = 0x6D4B
-0x786E = 0x7866
-0x786F = 0x5162
-0x787C = 0x4570
-0x7887 = 0x6D56
-0x7889 = 0x356F
-0x788C = 0x4235
-0x788E = 0x4B69
-0x7891 = 0x312E
-0x7893 = 0x6D54
-0x7897 = 0x4D6B
-0x7898 = 0x3562
-0x789A = 0x6D55
-0x789F = 0x357A
-0x78A1 = 0x6D58
-0x78A3 = 0x6D59
-0x78A5 = 0x6D5C
-0x78A7 = 0x314C
-0x78A9 = 0x4B36
-0x78AD = 0x6D38
-0x78B0 = 0x4576
-0x78B1 = 0x3C6E
-0x78B2 = 0x6D5A
-0x78B3 = 0x4C3C
-0x78B4 = 0x326A
-0x78B8 = 0x6D3F
-0x78B9 = 0x6D5B
-0x78BA = 0x4837
-0x78BC = 0x426B
-0x78BE = 0x446B
-0x78C1 = 0x3445
-0x78C5 = 0x3075
-0x78C9 = 0x6D5F
-0x78CA = 0x405A
-0x78CB = 0x3468
-0x78D0 = 0x454D
-0x78D4 = 0x6D5D
-0x78D5 = 0x3F44
-0x78D9 = 0x6D5E
-0x78DA = 0x5729
-0x78E3 = 0x6D57
-0x78E7 = 0x6D53
-0x78E8 = 0x4425
-0x78EC = 0x6D60
-0x78EF = 0x6D36
-0x78F2 = 0x6D61
-0x78F4 = 0x6D63
-0x78F7 = 0x4157
-0x78FA = 0x3B47
-0x78FD = 0x6D4D
-0x7901 = 0x3D38
-0x7905 = 0x6D62
-0x790E = 0x3421
-0x7913 = 0x6D64
-0x7919 = 0x302D
-0x791E = 0x6D66
-0x7924 = 0x6D65
-0x7926 = 0x3F73
-0x792A = 0x6D42
-0x792B = 0x4079
-0x792C = 0x372F
-0x7931 = 0x6D43
-0x7934 = 0x6D67
-0x793A = 0x4A3E
-0x793B = 0x6C6A
-0x793E = 0x4967
-0x7940 = 0x6C6B
-0x7941 = 0x466E
-0x7946 = 0x6C6C
-0x7948 = 0x466D
-0x7949 = 0x6C6D
-0x7953 = 0x6C70
-0x7956 = 0x5766
-0x7957 = 0x6C73
-0x795A = 0x6C71
-0x795B = 0x6C6E
-0x795C = 0x6C6F
-0x795D = 0x5723
-0x795E = 0x4971
-0x795F = 0x4B6E
-0x7960 = 0x6C74
-0x7965 = 0x4F69
-0x7967 = 0x6C76
-0x7968 = 0x4631
-0x796D = 0x3C40
-0x797A = 0x6C77
-0x7980 = 0x5977
-0x7981 = 0x3D7B
-0x7984 = 0x423B
-0x798A = 0x6C79
-0x798D = 0x3B76
-0x798E = 0x6C75
-0x798F = 0x3823
-0x799A = 0x6C7A
-0x79A6 = 0x787A
-0x79A7 = 0x6C7B
-0x79AA = 0x6C78
-0x79AE = 0x4071
-0x79B0 = 0x6C72
-0x79B1 = 0x353B
-0x79B3 = 0x6C7C
-0x79B9 = 0x536D
-0x79BA = 0x582E
-0x79BD = 0x475D
-0x79BE = 0x3A4C
-0x79C0 = 0x5063
-0x79C1 = 0x4B3D
-0x79C3 = 0x4D3A
-0x79C6 = 0x3851
-0x79C9 = 0x317C
-0x79CB = 0x476F
-0x79CD = 0x7926
-0x79D1 = 0x3F46
-0x79D2 = 0x436B
-0x79D5 = 0x6F75
-0x79D8 = 0x4358
-0x79DF = 0x5762
-0x79E3 = 0x6F77
-0x79E4 = 0x3353
-0x79E6 = 0x4758
-0x79E7 = 0x516D
-0x79E9 = 0x5648
-0x79EB = 0x6F78
-0x79ED = 0x6F76
-0x79F8 = 0x3D55
-0x79FB = 0x5246
-0x7A00 = 0x4F21
-0x7A02 = 0x6F7C
-0x7A03 = 0x6F7B
-0x7A06 = 0x6F79
-0x7A0B = 0x334C
-0x7A0D = 0x4954
-0x7A0E = 0x4B30
-0x7A14 = 0x6F7E
-0x7A17 = 0x305E
-0x7A1A = 0x5649
-0x7A1E = 0x6F7D
-0x7A20 = 0x336D
-0x7A2E = 0x5656
-0x7A31 = 0x3346
-0x7A37 = 0x7022
-0x7A39 = 0x7021
-0x7A3B = 0x353E
-0x7A3C = 0x3C5A
-0x7A3D = 0x3B7C
-0x7A3F = 0x3865
-0x7A40 = 0x7836
-0x7A46 = 0x4442
-0x7A4C = 0x7655
-0x7A4D = 0x3B7D
-0x7A4E = 0x5331
-0x7A57 = 0x4B6B
-0x7A61 = 0x7023
-0x7A62 = 0x3B60
-0x7A69 = 0x4E48
-0x7A6B = 0x783E
-0x7A70 = 0x7026
-0x7A74 = 0x5128
-0x7A76 = 0x3E3F
-0x7A78 = 0x7136
-0x7A79 = 0x7137
-0x7A7A = 0x3F55
-0x7A7F = 0x3429
-0x7A80 = 0x7138
-0x7A81 = 0x4D3B
-0x7A84 = 0x552D
-0x7A86 = 0x7139
-0x7A88 = 0x713A
-0x7A91 = 0x5224
-0x7A92 = 0x564F
-0x7A95 = 0x713B
-0x7A96 = 0x3D51
-0x7A97 = 0x3430
-0x7A98 = 0x3E3D
-0x7A9F = 0x3F5F
-0x7AA0 = 0x713D
-0x7AA8 = 0x713F
-0x7AA9 = 0x4E51
-0x7AAA = 0x4D5D
-0x7AAC = 0x713E
-0x7AAE = 0x476E
-0x7AB3 = 0x7141
-0x7AB6 = 0x7140
-0x7ABA = 0x3F7A
-0x7ABF = 0x417E
-0x7AC4 = 0x345C
-0x7AC5 = 0x474F
-0x7AC7 = 0x713C
-0x7AC8 = 0x546E
-0x7ACA = 0x4754
-0x7ACB = 0x4122
-0x7AD9 = 0x553E
-0x7ADF = 0x3E39
-0x7AE0 = 0x5542
-0x7AE3 = 0x3F22
-0x7AE5 = 0x4D2F
-0x7AE6 = 0x7135
-0x7AEA = 0x4A7A
-0x7AED = 0x3D5F
-0x7AEF = 0x364B
-0x7AF6 = 0x3E3A
-0x7AF9 = 0x5671
-0x7AFA = 0x7343
-0x7AFD = 0x7344
-0x7AFF = 0x384D
-0x7B04 = 0x7347
-0x7B06 = 0x304A
-0x7B08 = 0x7345
-0x7B0A = 0x7349
-0x7B0B = 0x4B71
-0x7B0F = 0x734B
-0x7B11 = 0x5026
-0x7B19 = 0x734F
-0x7B1B = 0x3551
-0x7B1E = 0x7357
-0x7B20 = 0x7352
-0x7B24 = 0x7354
-0x7B25 = 0x7353
-0x7B26 = 0x377B
-0x7B28 = 0x313F
-0x7B2A = 0x734E
-0x7B2B = 0x734A
-0x7B2C = 0x355A
-0x7B2E = 0x7350
-0x7B31 = 0x7351
-0x7B33 = 0x7355
-0x7B38 = 0x734D
-0x7B45 = 0x735A
-0x7B46 = 0x314A
-0x7B47 = 0x734C
-0x7B49 = 0x3548
-0x7B4B = 0x3D6E
-0x7B4C = 0x735C
-0x7B4F = 0x3724
-0x7B50 = 0x3F70
-0x7B51 = 0x7928
-0x7B52 = 0x4D32
-0x7B54 = 0x3470
-0x7B56 = 0x325F
-0x7B58 = 0x7358
-0x7B60 = 0x735E
-0x7B62 = 0x7361
-0x7B67 = 0x7348
-0x7B6E = 0x735F
-0x7B71 = 0x7363
-0x7B72 = 0x7362
-0x7B75 = 0x735B
-0x7B77 = 0x3F6A
-0x7B7B = 0x7360
-0x7B85 = 0x736B
-0x7B8B = 0x3C63
-0x7B8D = 0x393F
-0x7B8F = 0x735D
-0x7B90 = 0x7364
-0x7B94 = 0x322D
-0x7B95 = 0x3B7E
-0x7B97 = 0x4B63
-0x7B9C = 0x736D
-0x7B9D = 0x7369
-0x7BA1 = 0x395C
-0x7BA2 = 0x736E
-0x7BAC = 0x7368
-0x7BAD = 0x3C7D
-0x7BB1 = 0x4F64
-0x7BB4 = 0x7370
-0x7BB8 = 0x7367
-0x7BC0 = 0x3D5A
-0x7BC1 = 0x7372
-0x7BC4 = 0x3736
-0x7BC6 = 0x572D
-0x7BC7 = 0x462A
-0x7BC9 = 0x567E
-0x7BCB = 0x7366
-0x7BCC = 0x7373
-0x7BD9 = 0x385D
-0x7BDA = 0x7375
-0x7BDD = 0x7374
-0x7BE1 = 0x345B
-0x7BE4 = 0x7346
-0x7BE5 = 0x7376
-0x7BE6 = 0x7377
-0x7BE9 = 0x4938
-0x7BEA = 0x7378
-0x7BF3 = 0x7359
-0x7BF7 = 0x4571
-0x7BFC = 0x737B
-0x7BFE = 0x737A
-0x7C00 = 0x7365
-0x7C07 = 0x3458
-0x7C0B = 0x737E
-0x7C0C = 0x7379
-0x7C0D = 0x4228
-0x7C0F = 0x737C
-0x7C1E = 0x736C
-0x7C1F = 0x7421
-0x7C21 = 0x3C72
-0x7C23 = 0x7371
-0x7C26 = 0x7423
-0x7C27 = 0x3B49
-0x7C2A = 0x7422
-0x7C2B = 0x736F
-0x7C38 = 0x7424
-0x7C3D = 0x4729
-0x7C3E = 0x4131
-0x7C3F = 0x323E
-0x7C40 = 0x7426
-0x7C43 = 0x403A
-0x7C4C = 0x336F
-0x7C4D = 0x3C2E
-0x7C5C = 0x736A
-0x7C5F = 0x7425
-0x7C60 = 0x417D
-0x7C64 = 0x7862
-0x7C69 = 0x7356
-0x7C6A = 0x737D
-0x7C6C = 0x4069
-0x7C6E = 0x4261
-0x7C72 = 0x787B
-0x7C73 = 0x4357
-0x7C7C = 0x744C
-0x7C7D = 0x5751
-0x7C89 = 0x375B
-0x7C91 = 0x744E
-0x7C92 = 0x4123
-0x7C95 = 0x4649
-0x7C97 = 0x3456
-0x7C98 = 0x5533
-0x7C9E = 0x7451
-0x7C9F = 0x4B5A
-0x7CA2 = 0x7452
-0x7CA4 = 0x5441
-0x7CA5 = 0x5660
-0x7CB1 = 0x413B
-0x7CB2 = 0x7453
-0x7CB3 = 0x3E2C
-0x7CB9 = 0x3462
-0x7CBC = 0x7454
-0x7CBD = 0x7455
-0x7CBE = 0x3E2B
-0x7CC5 = 0x745B
-0x7CC7 = 0x7457
-0x7CC8 = 0x745A
-0x7CCA = 0x3A7D
-0x7CCC = 0x7458
-0x7CCD = 0x7459
-0x7CD5 = 0x3862
-0x7CD6 = 0x4C47
-0x7CD7 = 0x745C
-0x7CD9 = 0x325A
-0x7CDC = 0x4353
-0x7CDD = 0x7456
-0x7CDE = 0x3760
-0x7CDF = 0x5463
-0x7CE0 = 0x3F37
-0x7CE7 = 0x4138
-0x7CE8 = 0x745D
-0x7CEF = 0x4534
-0x7CF0 = 0x7870
-0x7CF2 = 0x744F
-0x7CF4 = 0x5961
-0x7CF6 = 0x7450
-0x7CF8 = 0x7469
-0x7CF9 = 0x6679
-0x7CFB = 0x4F35
-0x7CFE = 0x3E40
-0x7D00 = 0x3C4D
-0x7D02 = 0x667B
-0x7D04 = 0x543C
-0x7D05 = 0x3A6C
-0x7D06 = 0x667A
-0x7D07 = 0x667C
-0x7D08 = 0x667D
-0x7D09 = 0x4852
-0x7D0A = 0x4E49
-0x7D0B = 0x4E46
-0x7D0D = 0x4449
-0x7D10 = 0x4526
-0x7D13 = 0x6723
-0x7D14 = 0x343F
-0x7D15 = 0x6722
-0x7D17 = 0x4934
-0x7D19 = 0x563D
-0x7D1A = 0x3C36
-0x7D1B = 0x3757
-0x7D1C = 0x6721
-0x7D20 = 0x4B58
-0x7D21 = 0x3744
-0x7D22 = 0x4B77
-0x7D2B = 0x574F
-0x7D2F = 0x405B
-0x7D30 = 0x4F38
-0x7D31 = 0x6726
-0x7D32 = 0x6725
-0x7D33 = 0x4970
-0x7D39 = 0x495C
-0x7D3A = 0x6724
-0x7D3C = 0x6728
-0x7D3F = 0x672A
-0x7D40 = 0x6729
-0x7D42 = 0x5655
-0x7D44 = 0x5769
-0x7D46 = 0x306D
-0x7D4E = 0x672C
-0x7D50 = 0x3D61
-0x7D5D = 0x672B
-0x7D5E = 0x3D4A
-0x7D61 = 0x4267
-0x7D62 = 0x5124
-0x7D66 = 0x3878
-0x7D68 = 0x485E
-0x7D6E = 0x5075
-0x7D71 = 0x4D33
-0x7D72 = 0x4B3F
-0x7D73 = 0x672D
-0x7D76 = 0x3E78
-0x7D79 = 0x3E6E
-0x7D81 = 0x3073
-0x7D83 = 0x672F
-0x7D86 = 0x672E
-0x7D88 = 0x6730
-0x7D89 = 0x5065
-0x7D8F = 0x4B67
-0x7D93 = 0x3E2D
-0x7D9C = 0x575B
-0x7D9E = 0x6736
-0x7DA2 = 0x3371
-0x7DA3 = 0x6739
-0x7DA6 = 0x746B
-0x7DAB = 0x4F5F
-0x7DAC = 0x6737
-0x7DAD = 0x4E2C
-0x7DAE = 0x746C
-0x7DB0 = 0x673A
-0x7DB1 = 0x3859
-0x7DB2 = 0x4D78
-0x7DB3 = 0x3141
-0x7DB4 = 0x573A
-0x7DB8 = 0x425A
-0x7DB9 = 0x6738
-0x7DBA = 0x6732
-0x7DBB = 0x5540
-0x7DBD = 0x3442
-0x7DBE = 0x6731
-0x7DBF = 0x4360
-0x7DC4 = 0x6735
-0x7DC7 = 0x673B
-0x7DCA = 0x3D74
-0x7DCB = 0x6733
-0x7DD1 = 0x424C
-0x7DD2 = 0x5077
-0x7DD4 = 0x6734
-0x7DD7 = 0x673D
-0x7DD8 = 0x3C6A
-0x7DD9 = 0x673C
-0x7DDD = 0x3C29
-0x7DDE = 0x3650
-0x7DE0 = 0x355E
-0x7DE1 = 0x6745
-0x7DE3 = 0x5435
-0x7DE6 = 0x6741
-0x7DE8 = 0x3160
-0x7DE9 = 0x3B3A
-0x7DEC = 0x4365
-0x7DEF = 0x4E33
-0x7DF1 = 0x6743
-0x7DF2 = 0x673F
-0x7DF4 = 0x4137
-0x7DF6 = 0x6742
-0x7DF9 = 0x673E
-0x7DFB = 0x7924
-0x7E08 = 0x5D53
-0x7E09 = 0x6746
-0x7E0A = 0x674B
-0x7E0B = 0x6744
-0x7E10 = 0x6727
-0x7E11 = 0x674C
-0x7E1B = 0x383F
-0x7E1D = 0x6747
-0x7E1E = 0x6749
-0x7E1F = 0x6748
-0x7E23 = 0x4F58
-0x7E27 = 0x4C50
-0x7E2B = 0x376C
-0x7E2D = 0x674A
-0x7E2E = 0x4B75
-0x7E31 = 0x575D
-0x7E32 = 0x6750
-0x7E34 = 0x7863
-0x7E35 = 0x674F
-0x7E36 = 0x746A
-0x7E37 = 0x4246
-0x7E39 = 0x674E
-0x7E3B = 0x7763
-0x7E3D = 0x575C
-0x7E3E = 0x3C28
-0x7E41 = 0x3731
-0x7E45 = 0x6752
-0x7E46 = 0x6751
-0x7E47 = 0x746D
-0x7E52 = 0x6755
-0x7E54 = 0x562F
-0x7E55 = 0x4949
-0x7E5A = 0x6754
-0x7E5E = 0x4846
-0x7E62 = 0x6740
-0x7E69 = 0x497E
-0x7E6A = 0x3B66
-0x7E6B = 0x7873
-0x7E6D = 0x3C6B
-0x7E6E = 0x6756
-0x7E6F = 0x6759
-0x7E70 = 0x6758
-0x7E73 = 0x3D49
-0x7E79 = 0x526F
-0x7E7C = 0x3C4C
-0x7E7D = 0x674D
-0x7E7E = 0x6757
-0x7E82 = 0x576B
-0x7E88 = 0x6753
-0x7E8A = 0x667E
-0x7E8C = 0x5078
-0x7E8D = 0x784D
-0x7E8F = 0x3278
-0x7E93 = 0x5327
-0x7E94 = 0x7826
-0x7E96 = 0x4F4B
-0x7E98 = 0x675A
-0x7E9B = 0x746E
-0x7E9C = 0x4042
-0x7F36 = 0x733E
-0x7F38 = 0x3857
-0x7F3A = 0x4831
-0x7F44 = 0x7340
-0x7F45 = 0x7341
-0x7F4C = 0x733F
-0x7F4E = 0x786E
-0x7F50 = 0x395E
-0x7F54 = 0x5868
-0x7F55 = 0x3A31
-0x7F58 = 0x6E37
-0x7F5F = 0x6E39
-0x7F61 = 0x6E38
-0x7F68 = 0x6E3B
-0x7F69 = 0x5556
-0x7F6A = 0x576F
-0x7F6E = 0x5643
-0x7F70 = 0x3723
-0x7F71 = 0x6E3D
-0x7F72 = 0x4A70
-0x7F77 = 0x3055
-0x7F79 = 0x6E3E
-0x7F7E = 0x6E40
-0x7F85 = 0x425E
-0x7F86 = 0x6E3C
-0x7F88 = 0x6E3F
-0x7F8A = 0x5172
-0x7F8C = 0x473C
-0x7F8E = 0x4340
-0x7F94 = 0x3861
-0x7F9A = 0x4167
-0x7F9D = 0x7446
-0x7F9E = 0x505F
-0x7FA1 = 0x4F5B
-0x7FA4 = 0x483A
-0x7FA5 = 0x7447
-0x7FA7 = 0x7448
-0x7FA9 = 0x5265
-0x7FAF = 0x7449
-0x7FB0 = 0x744A
-0x7FB2 = 0x744B
-0x7FB8 = 0x597A
-0x7FB9 = 0x387E
-0x7FBC = 0x6571
-0x7FBD = 0x5370
-0x7FBF = 0x7460
-0x7FC1 = 0x4E4C
-0x7FC5 = 0x3361
-0x7FCA = 0x7134
-0x7FCC = 0x526E
-0x7FCE = 0x7461
-0x7FD2 = 0x4F30
-0x7FD4 = 0x4F68
-0x7FD5 = 0x7462
-0x7FDF = 0x3554
-0x7FE0 = 0x3464
-0x7FE1 = 0x7464
-0x7FE5 = 0x7463
-0x7FE6 = 0x7465
-0x7FE9 = 0x7466
-0x7FEE = 0x7467
-0x7FF0 = 0x3A32
-0x7FF1 = 0x303F
-0x7FF3 = 0x7468
-0x7FF9 = 0x474C
-0x7FFB = 0x372D
-0x7FFC = 0x526D
-0x8000 = 0x522B
-0x8001 = 0x404F
-0x8003 = 0x3F3C
-0x8004 = 0x6B23
-0x8005 = 0x555F
-0x8006 = 0x6A48
-0x800B = 0x7173
-0x800C = 0x3678
-0x800D = 0x4B23
-0x8010 = 0x444D
-0x8012 = 0x7167
-0x8014 = 0x7168
-0x8015 = 0x387B
-0x8016 = 0x7169
-0x8017 = 0x3A44
-0x8018 = 0x5445
-0x8019 = 0x3052
-0x801C = 0x716A
-0x8020 = 0x716B
-0x8025 = 0x716D
-0x8026 = 0x716E
-0x8028 = 0x7171
-0x8029 = 0x7170
-0x802A = 0x4555
-0x802C = 0x716F
-0x802E = 0x716C
-0x8031 = 0x7172
-0x8033 = 0x367A
-0x8035 = 0x7174
-0x8036 = 0x522E
-0x8037 = 0x5E47
-0x803B = 0x335C
-0x803D = 0x3522
-0x803F = 0x3922
-0x8043 = 0x7175
-0x8046 = 0x7176
-0x804A = 0x4144
-0x8052 = 0x7178
-0x8056 = 0x4A25
-0x8058 = 0x4638
-0x805A = 0x3E5B
-0x805E = 0x4E45
-0x806F = 0x412A
-0x8070 = 0x344F
-0x8071 = 0x717A
-0x8072 = 0x4979
-0x8073 = 0x4B4A
-0x8075 = 0x7179
-0x8076 = 0x4474
-0x8077 = 0x5630
-0x8079 = 0x7177
-0x807D = 0x4C7D
-0x807E = 0x417B
-0x807F = 0x6D32
-0x8080 = 0x6D31
-0x8084 = 0x525E
-0x8085 = 0x4B60
-0x8086 = 0x4B41
-0x8087 = 0x5558
-0x8089 = 0x4862
-0x808B = 0x405F
-0x808C = 0x3C21
-0x8093 = 0x6B41
-0x8096 = 0x5024
-0x8098 = 0x5662
-0x809A = 0x3647
-0x809B = 0x3858
-0x809C = 0x6B40
-0x809D = 0x384E
-0x809F = 0x6B3F
-0x80A1 = 0x3949
-0x80A2 = 0x562B
-0x80A5 = 0x374A
-0x80A9 = 0x3C67
-0x80AA = 0x373E
-0x80AB = 0x6B46
-0x80AD = 0x6B47
-0x80AF = 0x3F4F
-0x80B1 = 0x6B45
-0x80B2 = 0x537D
-0x80B4 = 0x6B48
-0x80B7 = 0x6B49
-0x80BA = 0x374E
-0x80BC = 0x6B42
-0x80BD = 0x6B44
-0x80C2 = 0x6B4F
-0x80C3 = 0x4E38
-0x80C4 = 0x6B50
-0x80CC = 0x3133
-0x80CD = 0x6B52
-0x80CE = 0x4C25
-0x80D6 = 0x4556
-0x80D7 = 0x6B53
-0x80D9 = 0x6B51
-0x80DA = 0x455F
-0x80DB = 0x6B4E
-0x80DD = 0x6B55
-0x80DE = 0x307B
-0x80E1 = 0x3A7A
-0x80E4 = 0x5837
-0x80E5 = 0x7163
-0x80E9 = 0x6B4C
-0x80EC = 0x6640
-0x80ED = 0x6B59
-0x80EF = 0x3F68
-0x80F0 = 0x5248
-0x80F1 = 0x6B57
-0x80F2 = 0x6B5C
-0x80F3 = 0x386C
-0x80F4 = 0x6B58
-0x80F8 = 0x5058
-0x80FA = 0x3037
-0x80FC = 0x6B5D
-0x80FD = 0x445C
-0x8102 = 0x562C
-0x8105 = 0x5032
-0x8106 = 0x3460
-0x8109 = 0x4276
-0x810A = 0x3C39
-0x810E = 0x6B5B
-0x8112 = 0x6B5F
-0x8116 = 0x3231
-0x8118 = 0x6B64
-0x811A = 0x3D45
-0x811B = 0x6B56
-0x811E = 0x6B62
-0x812C = 0x6B63
-0x812F = 0x382C
-0x8131 = 0x4D51
-0x8132 = 0x6B65
-0x8139 = 0x554D
-0x813E = 0x4622
-0x8146 = 0x4C73
-0x8148 = 0x6B66
-0x814A = 0x784C
-0x814B = 0x5238
-0x814C = 0x6B67
-0x814E = 0x4976
-0x8150 = 0x382F
-0x8151 = 0x382D
-0x8153 = 0x6B68
-0x8154 = 0x473B
-0x8155 = 0x4D73
-0x8156 = 0x6B4B
-0x8159 = 0x6B6A
-0x815A = 0x6B6B
-0x8160 = 0x6B6D
-0x8161 = 0x6B61
-0x8165 = 0x5048
-0x8166 = 0x4454
-0x8167 = 0x6B72
-0x8169 = 0x6B6E
-0x816B = 0x5657
-0x816D = 0x6B71
-0x816E = 0x4879
-0x8170 = 0x517C
-0x8171 = 0x6B6C
-0x8174 = 0x6B69
-0x8178 = 0x3326
-0x8179 = 0x3839
-0x817A = 0x4F59
-0x817C = 0x6B6F
-0x817D = 0x6B70
-0x817F = 0x4D48
-0x8180 = 0x3072
-0x8182 = 0x6B76
-0x8188 = 0x6B75
-0x818A = 0x3232
-0x818F = 0x3860
-0x8198 = 0x316C
-0x819A = 0x3774
-0x819B = 0x4C45
-0x819C = 0x4424
-0x819D = 0x4F25
-0x81A0 = 0x3D3A
-0x81A3 = 0x6B79
-0x81A6 = 0x6C22
-0x81A8 = 0x4572
-0x81A9 = 0x4465
-0x81AA = 0x6B7A
-0x81B3 = 0x4945
-0x81BA = 0x625F
-0x81BB = 0x6B7E
-0x81BD = 0x3528
-0x81BE = 0x6B5A
-0x81BF = 0x4527
-0x81C0 = 0x4D4E
-0x81C1 = 0x6C21
-0x81C2 = 0x315B
-0x81C3 = 0x5337
-0x81C6 = 0x525C
-0x81C9 = 0x4133
-0x81CA = 0x6B7D
-0x81CC = 0x6B7B
-0x81CD = 0x466A
-0x81CF = 0x6B77
-0x81D8 = 0x4030
-0x81DA = 0x6B4D
-0x81DF = 0x5460
-0x81E0 = 0x5975
-0x81E3 = 0x333C
-0x81E7 = 0x6A30
-0x81E8 = 0x4159
-0x81EA = 0x5754
-0x81EC = 0x742B
-0x81ED = 0x3374
-0x81F3 = 0x5641
-0x81F4 = 0x5642
-0x81FA = 0x4C28
-0x81FB = 0x5569
-0x81FC = 0x3E4A
-0x81FE = 0x7427
-0x8200 = 0x5228
-0x8201 = 0x7428
-0x8202 = 0x7429
-0x8204 = 0x742A
-0x8205 = 0x3E4B
-0x8207 = 0x536B
-0x8208 = 0x504B
-0x8209 = 0x3E59
-0x820A = 0x3E49
-0x820C = 0x4960
-0x820D = 0x7867
-0x8210 = 0x7342
-0x8212 = 0x4A66
-0x8214 = 0x4C72
-0x821B = 0x6236
-0x821C = 0x4B34
-0x821E = 0x4E68
-0x821F = 0x565B
-0x8221 = 0x742D
-0x8222 = 0x742E
-0x8228 = 0x7432
-0x822A = 0x3A3D
-0x822B = 0x7433
-0x822C = 0x3063
-0x822D = 0x7430
-0x822F = 0x7431
-0x8233 = 0x7436
-0x8234 = 0x7437
-0x8235 = 0x3666
-0x8236 = 0x3230
-0x8237 = 0x4F4F
-0x8238 = 0x7434
-0x8239 = 0x342C
-0x823E = 0x7438
-0x8244 = 0x7439
-0x8247 = 0x4D27
-0x8249 = 0x743A
-0x824B = 0x743B
-0x824F = 0x743C
-0x8258 = 0x4B52
-0x8259 = 0x3255
-0x825A = 0x743D
-0x825F = 0x743E
-0x8264 = 0x742F
-0x8266 = 0x3D22
-0x8268 = 0x743F
-0x826B = 0x7435
-0x826E = 0x745E
-0x826F = 0x413C
-0x8271 = 0x3C68
-0x8272 = 0x492B
-0x8274 = 0x6575
-0x8277 = 0x515E
-0x8279 = 0x5C33
-0x827D = 0x5C34
-0x827E = 0x302C
-0x827F = 0x5C35
-0x8284 = 0x5C39
-0x8288 = 0x5842
-0x828A = 0x5C37
-0x828B = 0x5373
-0x828D = 0x4956
-0x828E = 0x5C3A
-0x828F = 0x5C36
-0x8291 = 0x5C3B
-0x8292 = 0x4322
-0x8298 = 0x5C45
-0x8299 = 0x5C3D
-0x829D = 0x5625
-0x829F = 0x5C4F
-0x82A1 = 0x5C4D
-0x82A4 = 0x5C52
-0x82A5 = 0x3D66
-0x82A8 = 0x5C38
-0x82A9 = 0x5C4B
-0x82AA = 0x5C4E
-0x82AB = 0x5C3E
-0x82AC = 0x3752
-0x82AD = 0x3045
-0x82AE = 0x5C47
-0x82AF = 0x503E
-0x82B0 = 0x5C41
-0x82B1 = 0x3B28
-0x82B3 = 0x373C
-0x82B4 = 0x5C4C
-0x82B7 = 0x5C46
-0x82B9 = 0x475B
-0x82BB = 0x5B3B
-0x82BD = 0x513F
-0x82BE = 0x5C40
-0x82C4 = 0x5C50
-0x82CA = 0x5C43
-0x82D1 = 0x5437
-0x82D2 = 0x5C5B
-0x82D3 = 0x5C5F
-0x82D4 = 0x4C26
-0x82D5 = 0x5C66
-0x82D7 = 0x4367
-0x82D8 = 0x5C5C
-0x82DB = 0x3F41
-0x82DC = 0x5C59
-0x82DE = 0x307A
-0x82DF = 0x3936
-0x82E0 = 0x5C65
-0x82E1 = 0x5C53
-0x82E3 = 0x5C44
-0x82E4 = 0x5C56
-0x82E5 = 0x4874
-0x82E6 = 0x3F60
-0x82E7 = 0x5C51
-0x82EB = 0x493B
-0x82EF = 0x313D
-0x82F1 = 0x5322
-0x82F4 = 0x5C5A
-0x82F7 = 0x5C55
-0x82F9 = 0x785C
-0x82FB = 0x5C5E
-0x8301 = 0x5742
-0x8302 = 0x432F
-0x8303 = 0x7832
-0x8304 = 0x4751
-0x8305 = 0x4329
-0x8306 = 0x5C62
-0x8307 = 0x5C58
-0x8308 = 0x5C6B
-0x8309 = 0x5C54
-0x830C = 0x5C5D
-0x8317 = 0x5C78
-0x831A = 0x5C61
-0x831B = 0x5D22
-0x831C = 0x5C67
-0x8328 = 0x3444
-0x832B = 0x4323
-0x832C = 0x3267
-0x832D = 0x5C7A
-0x832F = 0x5C72
-0x8331 = 0x5C6F
-0x8333 = 0x5C7C
-0x8334 = 0x5C6E
-0x8335 = 0x5270
-0x8336 = 0x3268
-0x8338 = 0x4857
-0x8339 = 0x4863
-0x833A = 0x5C7B
-0x833C = 0x5C6D
-0x8340 = 0x5C77
-0x8343 = 0x5C75
-0x8346 = 0x3E23
-0x8347 = 0x5C74
-0x8349 = 0x325D
-0x834F = 0x5C73
-0x8350 = 0x7843
-0x8351 = 0x5C68
-0x8352 = 0x3B44
-0x8354 = 0x4073
-0x8377 = 0x3A49
-0x8378 = 0x5D29
-0x837B = 0x5D36
-0x837C = 0x5D31
-0x837D = 0x5D34
-0x8385 = 0x5D30
-0x8386 = 0x464E
-0x8389 = 0x4072
-0x838A = 0x572F
-0x838E = 0x492F
-0x8392 = 0x5C6C
-0x8393 = 0x5D2E
-0x8396 = 0x3E25
-0x8398 = 0x5D37
-0x839B = 0x5C70
-0x839C = 0x5D2F
-0x839E = 0x5D38
-0x83A0 = 0x5D2C
-0x83A2 = 0x3C54
-0x83A7 = 0x5C48
-0x83A8 = 0x5D39
-0x83A9 = 0x5D33
-0x83AA = 0x5D2D
-0x83AB = 0x442A
-0x83B0 = 0x5D28
-0x83BD = 0x4327
-0x83C0 = 0x5D52
-0x83C1 = 0x5D3C
-0x83C5 = 0x5D51
-0x83C7 = 0x393D
-0x83CA = 0x3E55
-0x83CC = 0x3E7A
-0x83CF = 0x3A4A
-0x83D4 = 0x5D4A
-0x83D6 = 0x5D45
-0x83D8 = 0x5D3F
-0x83DC = 0x324B
-0x83DD = 0x5D43
-0x83DF = 0x5D4B
-0x83E0 = 0x3224
-0x83E1 = 0x5D55
-0x83E5 = 0x5D3E
-0x83E9 = 0x4650
-0x83EA = 0x5D50
-0x83EF = 0x3B2A
-0x83F0 = 0x5D54
-0x83F1 = 0x4162
-0x83F2 = 0x3746
-0x83F8 = 0x5D4E
-0x83F9 = 0x5D4F
-0x83FD = 0x5D44
-0x8401 = 0x5D3D
-0x8403 = 0x5D4D
-0x8404 = 0x4C51
-0x8406 = 0x5D49
-0x8407 = 0x5C49
-0x840A = 0x4033
-0x840B = 0x5D42
-0x840C = 0x4348
-0x840D = 0x463C
-0x840E = 0x4E2E
-0x840F = 0x5D4C
-0x8411 = 0x5D48
-0x8418 = 0x5D41
-0x841C = 0x5D46
-0x842C = 0x4D72
-0x8431 = 0x5D66
-0x8435 = 0x5D2B
-0x8438 = 0x5D47
-0x843C = 0x5D60
-0x843D = 0x4264
-0x8446 = 0x5D61
-0x8449 = 0x5236
-0x8451 = 0x5D57
-0x8452 = 0x5D26
-0x8457 = 0x5678
-0x8459 = 0x5D59
-0x845A = 0x5D58
-0x845B = 0x3870
-0x845C = 0x5D56
-0x8461 = 0x464F
-0x8463 = 0x362D
-0x8464 = 0x5D27
-0x8466 = 0x4E2D
-0x8469 = 0x5D62
-0x846B = 0x3A79
-0x846C = 0x5461
-0x846D = 0x5D67
-0x846F = 0x7877
-0x8471 = 0x3450
-0x8473 = 0x5D5A
-0x8475 = 0x3F7B
-0x8476 = 0x5D63
-0x8477 = 0x3B67
-0x8478 = 0x5D5F
-0x847A = 0x5D5D
-0x8482 = 0x3559
-0x8488 = 0x5D5C
-0x848E = 0x5D65
-0x8493 = 0x5D3B
-0x8494 = 0x5D2A
-0x8497 = 0x5D75
-0x8499 = 0x4349
-0x849C = 0x4B62
-0x84A1 = 0x5D72
-0x84AF = 0x5861
-0x84B2 = 0x4651
-0x84B4 = 0x5D74
-0x84B8 = 0x5574
-0x84B9 = 0x5D73
-0x84BA = 0x5D70
-0x84BC = 0x3254
-0x84BD = 0x5D6C
-0x84BF = 0x5D6F
-0x84C0 = 0x5D25
-0x84C1 = 0x5D68
-0x84C4 = 0x506E
-0x84C9 = 0x4858
-0x84CA = 0x5D6E
-0x84CB = 0x3847
-0x84CD = 0x5D69
-0x84D0 = 0x5D6A
-0x84D1 = 0x4B72
-0x84D3 = 0x5D6D
-0x84D6 = 0x314D
-0x84EC = 0x456E
-0x84EE = 0x412B
-0x84EF = 0x5C4A
-0x84F0 = 0x5D7B
-0x84FC = 0x5E24
-0x84FD = 0x5C6A
-0x84FF = 0x5E23
-0x850C = 0x5D78
-0x8511 = 0x436F
-0x8513 = 0x427B
-0x8514 = 0x7825
-0x8517 = 0x5561
-0x851A = 0x4E35
-0x851E = 0x5D64
-0x851F = 0x5D7D
-0x8521 = 0x324C
-0x8523 = 0x3D2F
-0x8526 = 0x5C60
-0x852B = 0x4468
-0x852C = 0x4A5F
-0x852D = 0x5271
-0x8538 = 0x5D7A
-0x853B = 0x5E22
-0x853D = 0x314E
-0x8541 = 0x5D21
-0x8543 = 0x5E2C
-0x8546 = 0x5D5B
-0x8548 = 0x5E26
-0x8549 = 0x3D36
-0x854A = 0x486F
-0x854E = 0x5C71
-0x8552 = 0x5D24
-0x8553 = 0x5C3F
-0x8555 = 0x5D35
-0x8556 = 0x5E21
-0x8558 = 0x5C69
-0x8559 = 0x5E25
-0x855E = 0x5E29
-0x8562 = 0x5D5E
-0x8564 = 0x5E28
-0x8568 = 0x5E27
-0x8569 = 0x3534
-0x856A = 0x4E5F
-0x856D = 0x4F74
-0x8577 = 0x5D77
-0x8579 = 0x5E33
-0x857A = 0x5E2A
-0x857B = 0x5E2E
-0x857E = 0x4059
-0x8584 = 0x3121
-0x8585 = 0x5E36
-0x8587 = 0x5E31
-0x8588 = 0x5C76
-0x858A = 0x3C3B
-0x858C = 0x5C3C
-0x858F = 0x5E32
-0x8591 = 0x7844
-0x8594 = 0x473E
-0x859B = 0x5126
-0x859C = 0x5E35
-0x859F = 0x5D32
-0x85A4 = 0x5E2F
-0x85A6 = 0x3C76
-0x85A8 = 0x5E30
-0x85A9 = 0x4878
-0x85AA = 0x503D
-0x85AF = 0x4A6D
-0x85B0 = 0x5E39
-0x85B7 = 0x5E38
-0x85B9 = 0x5E37
-0x85BA = 0x5C79
-0x85C1 = 0x5E3B
-0x85C9 = 0x3D65
-0x85CD = 0x4036
-0x85CE = 0x5D23
-0x85CF = 0x3258
-0x85D0 = 0x436A
-0x85D5 = 0x453A
-0x85DC = 0x5E3C
-0x85DD = 0x5255
-0x85E4 = 0x4C59
-0x85E5 = 0x5229
-0x85E9 = 0x372A
-0x85EA = 0x5E34
-0x85F4 = 0x544C
-0x85F6 = 0x5C42
-0x85F9 = 0x302A
-0x85FA = 0x5D7E
-0x85FB = 0x5465
-0x85FF = 0x5E3D
-0x8604 = 0x5E2D
-0x8605 = 0x5E3F
-0x8606 = 0x422B
-0x8607 = 0x4B55
-0x860B = 0x463B
-0x8611 = 0x4422
-0x8616 = 0x5E41
-0x861A = 0x5E3A
-0x861E = 0x5D7C
-0x8622 = 0x5C57
-0x8627 = 0x5E3E
-0x8629 = 0x5E40
-0x862D = 0x403C
-0x8638 = 0x553A
-0x863A = 0x5D71
-0x863C = 0x5E42
-0x863F = 0x425C
-0x864D = 0x722E
-0x864E = 0x3B22
-0x8650 = 0x4530
-0x8654 = 0x722F
-0x8655 = 0x3426
-0x865A = 0x5069
-0x865C = 0x4232
-0x865E = 0x535D
-0x865F = 0x3A45
-0x8662 = 0x6B3D
-0x8667 = 0x3F77
-0x866C = 0x7230
-0x8671 = 0x4A2D
-0x8679 = 0x3A67
-0x867A = 0x7233
-0x867B = 0x7235
-0x867C = 0x7234
-0x868A = 0x4E43
-0x868B = 0x7238
-0x868C = 0x3076
-0x868D = 0x7237
-0x8693 = 0x723E
-0x869C = 0x5141
-0x869D = 0x723A
-0x86A3 = 0x723C
-0x86A4 = 0x5469
-0x86A7 = 0x723B
-0x86A8 = 0x7236
-0x86A9 = 0x723F
-0x86AA = 0x723D
-0x86AF = 0x7247
-0x86B0 = 0x7244
-0x86B1 = 0x7246
-0x86B4 = 0x724A
-0x86B5 = 0x7242
-0x86B6 = 0x7240
-0x86BA = 0x7245
-0x86C0 = 0x567B
-0x86C4 = 0x7241
-0x86C6 = 0x4779
-0x86C7 = 0x495F
-0x86C9 = 0x7248
-0x86CB = 0x3530
-0x86D0 = 0x7250
-0x86D1 = 0x7256
-0x86D4 = 0x3B57
-0x86D8 = 0x7255
-0x86D9 = 0x4D5C
-0x86DB = 0x566B
-0x86DE = 0x7252
-0x86DF = 0x7254
-0x86E4 = 0x3872
-0x86E9 = 0x724B
-0x86ED = 0x724E
-0x86F8 = 0x7259
-0x86F9 = 0x533C
-0x86FA = 0x724C
-0x86FE = 0x366A
-0x8700 = 0x4A71
-0x8702 = 0x3764
-0x8703 = 0x7257
-0x8706 = 0x7239
-0x8707 = 0x7258
-0x8708 = 0x725A
-0x8709 = 0x725D
-0x870A = 0x725B
-0x870D = 0x725C
-0x8712 = 0x5151
-0x8713 = 0x7251
-0x8715 = 0x4D49
-0x8718 = 0x5629
-0x871A = 0x7263
-0x871C = 0x435B
-0x871E = 0x7260
-0x8721 = 0x784B
-0x8722 = 0x726C
-0x8723 = 0x725E
-0x8725 = 0x7261
-0x8729 = 0x7268
-0x872E = 0x7262
-0x8731 = 0x7267
-0x8734 = 0x7266
-0x8737 = 0x7269
-0x873B = 0x725F
-0x873E = 0x7264
-0x873F = 0x726A
-0x874C = 0x7272
-0x874E = 0x502B
-0x8753 = 0x7275
-0x8755 = 0x4A34
-0x8757 = 0x3B48
-0x8759 = 0x7279
-0x8760 = 0x7270
-0x8763 = 0x7276
-0x8764 = 0x7278
-0x8765 = 0x727A
-0x8766 = 0x4F3A
-0x876E = 0x7273
-0x8770 = 0x7271
-0x8774 = 0x3A7B
-0x8776 = 0x357B
-0x8778 = 0x4E4F
-0x877B = 0x726F
-0x877D = 0x726D
-0x8782 = 0x726B
-0x8783 = 0x7326
-0x8784 = 0x724F
-0x8785 = 0x7323
-0x8788 = 0x7322
-0x878B = 0x7274
-0x878D = 0x485A
-0x8793 = 0x727B
-0x8797 = 0x7325
-0x879E = 0x426C
-0x879F = 0x4378
-0x87A2 = 0x5329
-0x87AB = 0x7327
-0x87AC = 0x7329
-0x87AD = 0x7324
-0x87AF = 0x727C
-0x87B3 = 0x732B
-0x87B5 = 0x732A
-0x87BA = 0x425D
-0x87BB = 0x7277
-0x87BD = 0x732E
-0x87C0 = 0x7330
-0x87C4 = 0x555D
-0x87C6 = 0x7321
-0x87C8 = 0x7265
-0x87CA = 0x7331
-0x87CB = 0x732C
-0x87CE = 0x727D
-0x87D1 = 0x732F
-0x87D2 = 0x727E
-0x87D3 = 0x732D
-0x87DB = 0x7332
-0x87E0 = 0x7334
-0x87E3 = 0x7231
-0x87E5 = 0x7328
-0x87EA = 0x7333
-0x87EC = 0x3275
-0x87EE = 0x7335
-0x87EF = 0x724D
-0x87F2 = 0x3366
-0x87F6 = 0x7249
-0x87F9 = 0x5037
-0x87FB = 0x524F
-0x87FE = 0x7338
-0x8803 = 0x5979
-0x8805 = 0x532C
-0x8806 = 0x7232
-0x880A = 0x7339
-0x8810 = 0x7253
-0x8811 = 0x726E
-0x8813 = 0x7337
-0x8815 = 0x4864
-0x8816 = 0x7336
-0x881B = 0x733A
-0x881F = 0x402F
-0x8821 = 0x733B
-0x8822 = 0x3440
-0x8823 = 0x7243
-0x8831 = 0x3946
-0x8832 = 0x6E43
-0x8836 = 0x324F
-0x8839 = 0x733C
-0x883B = 0x4279
-0x883C = 0x733D
-0x8840 = 0x512A
-0x8844 = 0x742C
-0x8846 = 0x565A
-0x884A = 0x785A
-0x884C = 0x5050
-0x884D = 0x515C
-0x8853 = 0x4A75
-0x8857 = 0x3D56
-0x8859 = 0x5143
-0x885B = 0x4E40
-0x885D = 0x3365
-0x8861 = 0x3A62
-0x8862 = 0x6169
-0x8863 = 0x5242
-0x8864 = 0x7142
-0x8868 = 0x316D
-0x8869 = 0x7143
-0x886B = 0x4940
-0x886E = 0x5972
-0x8870 = 0x4B25
-0x8872 = 0x7144
-0x8877 = 0x5654
-0x8879 = 0x563B
-0x887D = 0x7145
-0x887E = 0x7440
-0x887F = 0x7146
-0x8881 = 0x542C
-0x8882 = 0x7147
-0x8888 = 0x7442
-0x888B = 0x347C
-0x888D = 0x455B
-0x8892 = 0x4C3B
-0x8896 = 0x5064
-0x88A2 = 0x7148
-0x88A4 = 0x5973
-0x88AB = 0x313B
-0x88B1 = 0x3824
-0x88B7 = 0x714A
-0x88BC = 0x714B
-0x88C1 = 0x3243
-0x88C2 = 0x4151
-0x88C9 = 0x714C
-0x88CA = 0x7441
-0x88CE = 0x714E
-0x88CF = 0x406F
-0x88D2 = 0x5976
-0x88D4 = 0x5261
-0x88D5 = 0x5423
-0x88D8 = 0x7443
-0x88D9 = 0x4839
-0x88DC = 0x3239
-0x88DD = 0x5730
-0x88DF = 0x7444
-0x88E8 = 0x7154
-0x88F0 = 0x7156
-0x88F1 = 0x7151
-0x88F3 = 0x4951
-0x88F4 = 0x4561
-0x88F8 = 0x4263
-0x88F9 = 0x397C
-0x88FC = 0x7153
-0x88FD = 0x7925
-0x88FE = 0x7155
-0x8902 = 0x3953
-0x8907 = 0x7834
-0x890A = 0x715B
-0x8910 = 0x3A56
-0x8912 = 0x307D
-0x8913 = 0x7159
-0x8919 = 0x7158
-0x891A = 0x7152
-0x8921 = 0x7157
-0x8925 = 0x486C
-0x892A = 0x4D4A
-0x892B = 0x715D
-0x8930 = 0x653D
-0x8932 = 0x3F63
-0x8933 = 0x714D
-0x8936 = 0x715E
-0x8938 = 0x715A
-0x893B = 0x5974
-0x8941 = 0x715F
-0x8944 = 0x4F65
-0x8947 = 0x7150
-0x8956 = 0x3040
-0x895D = 0x714F
-0x895E = 0x7445
-0x895F = 0x3D73
-0x8960 = 0x7149
-0x8964 = 0x715C
-0x8966 = 0x7160
-0x896A = 0x4D60
-0x896C = 0x7821
-0x896F = 0x3344
-0x8972 = 0x4F2E
-0x897B = 0x7161
-0x897F = 0x4E77
-0x8981 = 0x522A
-0x8983 = 0x717B
-0x8986 = 0x3832
-0x898B = 0x3C7B
-0x898F = 0x3966
-0x8993 = 0x4359
-0x8996 = 0x4A53
-0x8998 = 0x6A68
-0x89A1 = 0x6A6A
-0x89A6 = 0x6A6C
-0x89AA = 0x4757
-0x89AC = 0x6A69
-0x89AF = 0x6A6D
-0x89B2 = 0x6A6E
-0x89B7 = 0x6A6F
-0x89BA = 0x3E75
-0x89BD = 0x4040
-0x89BF = 0x6A6B
-0x89C0 = 0x395B
-0x89D2 = 0x3D47
-0x89D6 = 0x757B
-0x89DA = 0x757D
-0x89DC = 0x757E
-0x89E3 = 0x3D62
-0x89E5 = 0x7621
-0x89EB = 0x7622
-0x89F3 = 0x6C32
-0x89F4 = 0x757C
-0x89F6 = 0x7623
-0x89F8 = 0x3425
-0x8A00 = 0x5154
-0x8A01 = 0x5A25
-0x8A02 = 0x3629
-0x8A03 = 0x383C
-0x8A07 = 0x596A
-0x8A08 = 0x3C46
-0x8A0A = 0x5136
-0x8A0C = 0x5A27
-0x8A0E = 0x4C56
-0x8A10 = 0x5A26
-0x8A13 = 0x5135
-0x8A15 = 0x5A28
-0x8A16 = 0x467D
-0x8A18 = 0x3C47
-0x8A1B = 0x366F
-0x8A1D = 0x5148
-0x8A1F = 0x4B4F
-0x8A23 = 0x3E77
-0x8A25 = 0x5A2B
-0x8A2A = 0x3743
-0x8A2D = 0x4968
-0x8A31 = 0x506D
-0x8A34 = 0x4B5F
-0x8A36 = 0x5A2D
-0x8A3A = 0x556F
-0x8A3E = 0x7624
-0x8A41 = 0x5A2C
-0x8A46 = 0x5A2E
-0x8A48 = 0x6E3A
-0x8A4E = 0x5A2A
-0x8A50 = 0x5529
-0x8A52 = 0x5A31
-0x8A54 = 0x5A2F
-0x8A55 = 0x4640
-0x8A58 = 0x5A30
-0x8A5B = 0x5767
-0x8A5E = 0x344A
-0x8A61 = 0x5A3C
-0x8A62 = 0x512F
-0x8A63 = 0x5268
-0x8A66 = 0x4A54
-0x8A69 = 0x4A2B
-0x8A6B = 0x326F
-0x8A6C = 0x5A38
-0x8A6D = 0x396E
-0x8A6E = 0x5A39
-0x8A70 = 0x5A35
-0x8A71 = 0x3B30
-0x8A72 = 0x3843
-0x8A73 = 0x4F6A
-0x8A75 = 0x5A37
-0x8A79 = 0x5532
-0x8A7C = 0x5A36
-0x8A7F = 0x5A34
-0x8A84 = 0x5A33
-0x8A85 = 0x566F
-0x8A86 = 0x5A32
-0x8A87 = 0x3F64
-0x8A8D = 0x484F
-0x8A91 = 0x5A3F
-0x8A92 = 0x5A40
-0x8A93 = 0x4A44
-0x8A95 = 0x352E
-0x8A98 = 0x5355
-0x8A9A = 0x5A3D
-0x8A9E = 0x536F
-0x8AA0 = 0x334F
-0x8AA1 = 0x3D6B
-0x8AA3 = 0x4E5C
-0x8AA4 = 0x4E73
-0x8AA5 = 0x5A3E
-0x8AA6 = 0x4B50
-0x8AA8 = 0x3B65
-0x8AAC = 0x4B35
-0x8AB0 = 0x4B2D
-0x8AB2 = 0x3F4E
-0x8AB6 = 0x5A47
-0x8AB9 = 0x374C
-0x8ABC = 0x526A
-0x8ABF = 0x3577
-0x8AC2 = 0x5A46
-0x8AC4 = 0x573B
-0x8AC7 = 0x4C38
-0x8AC9 = 0x5A43
-0x8ACB = 0x476B
-0x8ACD = 0x5A3A
-0x8ACF = 0x5A41
-0x8AD1 = 0x5A42
-0x8AD2 = 0x4142
-0x8AD6 = 0x425B
-0x8AD7 = 0x5A45
-0x8ADB = 0x5A44
-0x8ADC = 0x357D
-0x8ADE = 0x5A52
-0x8AE2 = 0x5A3B
-0x8AE4 = 0x5A4C
-0x8AE6 = 0x5A50
-0x8AE7 = 0x5033
-0x8AEB = 0x5A49
-0x8AED = 0x5A4D
-0x8AEE = 0x5A51
-0x8AF1 = 0x3B64
-0x8AF3 = 0x5A4F
-0x8AF6 = 0x5A48
-0x8AF7 = 0x376D
-0x8AF8 = 0x566E
-0x8AFA = 0x5168
-0x8AFC = 0x5A4E
-0x8AFE = 0x4535
-0x8B00 = 0x4431
-0x8B01 = 0x5A4B
-0x8B02 = 0x4E3D
-0x8B04 = 0x4C5C
-0x8B05 = 0x565F
-0x8B07 = 0x6540
-0x8B0A = 0x3B51
-0x8B0E = 0x4355
-0x8B10 = 0x5A57
-0x8B14 = 0x5A4A
-0x8B16 = 0x5A55
-0x8B17 = 0x3079
-0x8B19 = 0x472B
-0x8B1A = 0x5A56
-0x8B1B = 0x3D32
-0x8B1D = 0x503B
-0x8B21 = 0x5225
-0x8B26 = 0x7625
-0x8B28 = 0x5A53
-0x8B2B = 0x5A58
-0x8B2C = 0x437D
-0x8B2D = 0x5A59
-0x8B33 = 0x5A29
-0x8B39 = 0x3D77
-0x8B3E = 0x4321
-0x8B49 = 0x5624
-0x8B4E = 0x5A5C
-0x8B4F = 0x3C25
-0x8B56 = 0x5A5A
-0x8B58 = 0x4A36
-0x8B59 = 0x5A5B
-0x8B5A = 0x4C37
-0x8B5C = 0x4657
-0x8B66 = 0x3E2F
-0x8B6B = 0x5A5E
-0x8B6C = 0x4629
-0x8B6F = 0x526B
-0x8B70 = 0x5269
-0x8B74 = 0x4734
-0x8B77 = 0x3B24
-0x8B7D = 0x537E
-0x8B80 = 0x3641
-0x8B8A = 0x3164
-0x8B8E = 0x7645
-0x8B92 = 0x3277
-0x8B93 = 0x4843
-0x8B95 = 0x403E
-0x8B96 = 0x5A5F
-0x8B9C = 0x5A54
-0x8B9E = 0x5A5D
-0x8C37 = 0x3948
-0x8C41 = 0x3B6D
-0x8C46 = 0x3639
-0x8C47 = 0x7478
-0x8C48 = 0x4671
-0x8C49 = 0x7479
-0x8C4C = 0x4D63
-0x8C50 = 0x3761
-0x8C55 = 0x7539
-0x8C5A = 0x6B60
-0x8C61 = 0x4F73
-0x8C62 = 0x3B3F
-0x8C6A = 0x3A40
-0x8C6B = 0x5425
-0x8C73 = 0x6159
-0x8C78 = 0x7574
-0x8C79 = 0x312A
-0x8C7A = 0x3272
-0x8C82 = 0x7575
-0x8C85 = 0x7577
-0x8C89 = 0x3A51
-0x8C8A = 0x7576
-0x8C8C = 0x4332
-0x8C94 = 0x7579
-0x8C98 = 0x7578
-0x8C9D = 0x3134
-0x8C9E = 0x556A
-0x8CA0 = 0x383A
-0x8CA1 = 0x3246
-0x8CA2 = 0x3931
-0x8CA7 = 0x4636
-0x8CA8 = 0x3B75
-0x8CA9 = 0x3737
-0x8CAA = 0x4C30
-0x8CAB = 0x3961
-0x8CAC = 0x5470
-0x8CAF = 0x567C
-0x8CB0 = 0x6A5B
-0x8CB2 = 0x6A5F
-0x8CB3 = 0x3721
-0x8CB4 = 0x3973
-0x8CB6 = 0x3161
-0x8CB7 = 0x4272
-0x8CB8 = 0x347B
-0x8CBA = 0x6A5C
-0x8CBB = 0x3751
-0x8CBC = 0x4C79
-0x8CBD = 0x6A5D
-0x8CBF = 0x4333
-0x8CC0 = 0x3A58
-0x8CC1 = 0x6A5A
-0x8CC2 = 0x4238
-0x8CC3 = 0x415E
-0x8CC4 = 0x3B5F
-0x8CC5 = 0x6A60
-0x8CC7 = 0x574A
-0x8CC8 = 0x3C56
-0x8CCA = 0x5474
-0x8CD1 = 0x6A62
-0x8CD2 = 0x495E
-0x8CD3 = 0x3176
-0x8CD5 = 0x6A64
-0x8CDA = 0x6A63
-0x8CDC = 0x344D
-0x8CDE = 0x494D
-0x8CE0 = 0x4562
-0x8CE1 = 0x6259
-0x8CE2 = 0x4F4D
-0x8CE3 = 0x4274
-0x8CE4 = 0x3C7A
-0x8CE6 = 0x3833
-0x8CE7 = 0x6A66
-0x8CEA = 0x564A
-0x8CEB = 0x6A65
-0x8CEC = 0x554B
-0x8CED = 0x3644
-0x8CF4 = 0x4035
-0x8CFA = 0x572C
-0x8CFB = 0x6A67
-0x8CFC = 0x393A
-0x8CFD = 0x487C
-0x8CFE = 0x5853
-0x8D04 = 0x6A5E
-0x8D05 = 0x5738
-0x8D08 = 0x5479
-0x8D0A = 0x545E
-0x8D0B = 0x584D
-0x8D0D = 0x4944
-0x8D0F = 0x532E
-0x8D10 = 0x6A61
-0x8D16 = 0x4A6A
-0x8D1B = 0x3853
-0x8D1C = 0x545F
-0x8D64 = 0x3360
-0x8D66 = 0x4962
-0x8D67 = 0x7476
-0x8D6B = 0x3A55
-0x8D6D = 0x7477
-0x8D70 = 0x575F
-0x8D73 = 0x7471
-0x8D74 = 0x3830
-0x8D77 = 0x4670
-0x8D81 = 0x3343
-0x8D84 = 0x7472
-0x8D85 = 0x332C
-0x8D8A = 0x543D
-0x8D91 = 0x7474
-0x8D94 = 0x7473
-0x8D95 = 0x384F
-0x8D99 = 0x5554
-0x8D9F = 0x4C4B
-0x8DA3 = 0x4824
-0x8DA8 = 0x4777
-0x8DB2 = 0x7475
-0x8DB3 = 0x5763
-0x8DB4 = 0x453F
-0x8DB5 = 0x7540
-0x8DBA = 0x7543
-0x8DBC = 0x7542
-0x8DBE = 0x563A
-0x8DBF = 0x7541
-0x8DC6 = 0x754C
-0x8DCB = 0x304F
-0x8DCC = 0x3578
-0x8DCE = 0x7549
-0x8DCF = 0x754A
-0x8DD1 = 0x455C
-0x8DD6 = 0x7545
-0x8DD7 = 0x7546
-0x8DDA = 0x7547
-0x8DDB = 0x754B
-0x8DDD = 0x3E60
-0x8DDF = 0x387A
-0x8DE3 = 0x7550
-0x8DE4 = 0x7553
-0x8DE8 = 0x3F67
-0x8DEA = 0x3972
-0x8DEB = 0x753C
-0x8DEC = 0x754D
-0x8DEF = 0x4237
-0x8DF3 = 0x4C78
-0x8DFA = 0x3665
-0x8DFD = 0x7555
-0x8E05 = 0x753D
-0x8E09 = 0x7554
-0x8E0F = 0x4C24
-0x8E10 = 0x3C79
-0x8E14 = 0x7556
-0x8E1D = 0x7557
-0x8E1E = 0x3E61
-0x8E1F = 0x7558
-0x8E22 = 0x4C5F
-0x8E23 = 0x755B
-0x8E29 = 0x3248
-0x8E2A = 0x5759
-0x8E2E = 0x755A
-0x8E31 = 0x7562
-0x8E34 = 0x533B
-0x8E35 = 0x7560
-0x8E39 = 0x755F
-0x8E3A = 0x755D
-0x8E3D = 0x7561
-0x8E40 = 0x755E
-0x8E41 = 0x7564
-0x8E42 = 0x7565
-0x8E44 = 0x4C63
-0x8E47 = 0x653F
-0x8E48 = 0x3538
-0x8E49 = 0x7563
-0x8E4A = 0x7568
-0x8E4B = 0x4C23
-0x8E4C = 0x7544
-0x8E55 = 0x754F
-0x8E59 = 0x753E
-0x8E63 = 0x7567
-0x8E66 = 0x3144
-0x8E69 = 0x753F
-0x8E6C = 0x3545
-0x8E6D = 0x3264
-0x8E6F = 0x756C
-0x8E70 = 0x7569
-0x8E72 = 0x3657
-0x8E74 = 0x756D
-0x8E76 = 0x756A
-0x8E7A = 0x754E
-0x8E7C = 0x756B
-0x8E81 = 0x546A
-0x8E85 = 0x756E
-0x8E87 = 0x3379
-0x8E89 = 0x753B
-0x8E8A = 0x336C
-0x8E8B = 0x7552
-0x8E8D = 0x543E
-0x8E90 = 0x7571
-0x8E91 = 0x755C
-0x8E92 = 0x7548
-0x8E93 = 0x7559
-0x8E94 = 0x7570
-0x8E9A = 0x7551
-0x8E9E = 0x7573
-0x8EA1 = 0x7566
-0x8EA5 = 0x345A
-0x8EA6 = 0x7572
-0x8EAA = 0x756F
-0x8EAB = 0x496D
-0x8EAC = 0x392A
-0x8EB2 = 0x3663
-0x8EBA = 0x4C49
-0x8EC0 = 0x477B
-0x8ECA = 0x3335
-0x8ECB = 0x547E
-0x8ECC = 0x396C
-0x8ECD = 0x3E7C
-0x8ECE = 0x6A26
-0x8ED2 = 0x5079
-0x8ED4 = 0x696D
-0x8EDB = 0x696E
-0x8EDF = 0x486D
-0x8EE4 = 0x6975
-0x8EEB = 0x6974
-0x8EF2 = 0x696F
-0x8EF8 = 0x5661
-0x8EF9 = 0x6972
-0x8EFA = 0x6977
-0x8EFB = 0x6970
-0x8EFC = 0x6973
-0x8EFE = 0x6978
-0x8F03 = 0x3D4F
-0x8F05 = 0x697B
-0x8F07 = 0x697A
-0x8F09 = 0x5458
-0x8F0A = 0x6979
-0x8F12 = 0x697C
-0x8F14 = 0x3828
-0x8F15 = 0x4761
-0x8F1B = 0x413E
-0x8F1C = 0x6A22
-0x8F1D = 0x3B54
-0x8F1E = 0x697E
-0x8F1F = 0x6A21
-0x8F25 = 0x3975
-0x8F26 = 0x697D
-0x8F29 = 0x3132
-0x8F2A = 0x4256
-0x8F2F = 0x3C2D
-0x8F33 = 0x6A23
-0x8F38 = 0x4A64
-0x8F3B = 0x3778
-0x8F3E = 0x5537
-0x8F3F = 0x535F
-0x8F42 = 0x6C31
-0x8F44 = 0x4F3D
-0x8F45 = 0x542F
-0x8F46 = 0x6A24
-0x8F49 = 0x572A
-0x8F4D = 0x555E
-0x8F4E = 0x3D4E
-0x8F54 = 0x6A25
-0x8F5F = 0x3A64
-0x8F61 = 0x604E
-0x8F62 = 0x6976
-0x8F64 = 0x6971
-0x8F9B = 0x5041
-0x8F9C = 0x393C
-0x8F9F = 0x3159
-0x8FA3 = 0x4031
-0x8FA6 = 0x306C
-0x8FA8 = 0x3166
-0x8FAD = 0x3447
-0x8FAE = 0x3168
-0x8FAF = 0x3167
-0x8FB0 = 0x333D
-0x8FB1 = 0x4868
-0x8FB2 = 0x4529
-0x8FB6 = 0x6541
-0x8FC2 = 0x5358
-0x8FC4 = 0x4679
-0x8FC5 = 0x5138
-0x8FCE = 0x532D
-0x8FD1 = 0x3D7C
-0x8FD3 = 0x6542
-0x8FD4 = 0x3735
-0x8FD5 = 0x6543
-0x8FE2 = 0x4C76
-0x8FE4 = 0x6546
-0x8FE5 = 0x6544
-0x8FE6 = 0x6548
-0x8FE8 = 0x654A
-0x8FEA = 0x354F
-0x8FEB = 0x4648
-0x8FED = 0x357C
-0x8FEE = 0x6545
-0x8FF0 = 0x4A76
-0x8FF4 = 0x783C
-0x8FF7 = 0x4354
-0x8FF8 = 0x3145
-0x8FF9 = 0x3C23
-0x8FFD = 0x5737
-0x9000 = 0x4D4B
-0x9001 = 0x4B4D
-0x9003 = 0x4C53
-0x9004 = 0x654C
-0x9005 = 0x654B
-0x9006 = 0x4466
-0x900B = 0x654D
-0x900D = 0x6550
-0x900F = 0x4D38
-0x9010 = 0x5670
-0x9011 = 0x654F
-0x9014 = 0x4D3E
-0x9015 = 0x6549
-0x9016 = 0x6551
-0x9017 = 0x363A
-0x9019 = 0x5562
-0x901A = 0x4D28
-0x901B = 0x3964
-0x901D = 0x4A45
-0x901E = 0x3351
-0x901F = 0x4B59
-0x9020 = 0x546C
-0x9021 = 0x6552
-0x9022 = 0x376A
-0x9023 = 0x412C
-0x902D = 0x6555
-0x902E = 0x347E
-0x902F = 0x6556
-0x9032 = 0x3D78
-0x9035 = 0x6553
-0x9036 = 0x6554
-0x9038 = 0x525D
-0x903C = 0x3146
-0x903E = 0x5362
-0x9041 = 0x365D
-0x9042 = 0x4B6C
-0x9044 = 0x6557
-0x9047 = 0x5376
-0x904B = 0x544B
-0x904D = 0x3169
-0x904E = 0x397D
-0x904F = 0x3674
-0x9050 = 0x655A
-0x9051 = 0x6558
-0x9052 = 0x6559
-0x9053 = 0x3540
-0x9054 = 0x346F
-0x9055 = 0x4E25
-0x9058 = 0x655C
-0x905B = 0x655E
-0x905C = 0x5137
-0x905E = 0x355D
-0x9060 = 0x5436
-0x9062 = 0x655D
-0x9063 = 0x4732
-0x9065 = 0x5223
-0x9068 = 0x655B
-0x9069 = 0x4A4A
-0x906D = 0x5462
-0x906E = 0x555A
-0x9072 = 0x3359
-0x9074 = 0x6560
-0x9075 = 0x5771
-0x9077 = 0x4728
-0x9078 = 0x5121
-0x907A = 0x5245
-0x907C = 0x4149
-0x907D = 0x6561
-0x907F = 0x315C
-0x9080 = 0x517B
-0x9081 = 0x4275
-0x9082 = 0x6562
-0x9083 = 0x6564
-0x9084 = 0x3B39
-0x9087 = 0x6547
-0x9088 = 0x6563
-0x908A = 0x315F
-0x908B = 0x6565
-0x908F = 0x425F
-0x9090 = 0x654E
-0x9091 = 0x5258
-0x9095 = 0x675F
-0x9097 = 0x5A75
-0x9099 = 0x5A78
-0x909B = 0x5A76
-0x90A1 = 0x5A7A
-0x90A2 = 0x504F
-0x90A3 = 0x4447
-0x90A6 = 0x306E
-0x90AA = 0x5030
-0x90AF = 0x3A2A
-0x90B0 = 0x5B22
-0x90B1 = 0x4771
-0x90B3 = 0x5A7C
-0x90B4 = 0x5A7B
-0x90B5 = 0x495B
-0x90B6 = 0x5A7D
-0x90B8 = 0x5B21
-0x90BE = 0x5B25
-0x90C1 = 0x7879
-0x90C4 = 0x5B27
-0x90C5 = 0x5B24
-0x90C7 = 0x5B28
-0x90CA = 0x3D3C
-0x90CE = 0x4049
-0x90D7 = 0x5B2D
-0x90DB = 0x5B2E
-0x90DC = 0x5B2C
-0x90DD = 0x3A42
-0x90DF = 0x5B23
-0x90E1 = 0x3F24
-0x90E2 = 0x5B2B
-0x90E8 = 0x323F
-0x90EB = 0x5B2F
-0x90ED = 0x3979
-0x90EF = 0x5B30
-0x90F4 = 0x333B
-0x90F5 = 0x534A
-0x90FD = 0x363C
-0x90FE = 0x5B31
-0x9102 = 0x3675
-0x9104 = 0x5B32
-0x9106 = 0x5B29
-0x9109 = 0x4F67
-0x9112 = 0x575E
-0x9114 = 0x5A79
-0x9116 = 0x5447
-0x9119 = 0x3149
-0x911E = 0x5B34
-0x9122 = 0x5B33
-0x9123 = 0x5B35
-0x9127 = 0x354B
-0x912D = 0x5623
-0x912F = 0x5B37
-0x9130 = 0x415A
-0x9131 = 0x5B36
-0x9132 = 0x3526
-0x9134 = 0x5A7E
-0x9136 = 0x5B26
-0x9139 = 0x5B38
-0x913A = 0x5A77
-0x9143 = 0x5B39
-0x9146 = 0x5B3A
-0x9148 = 0x5B2A
-0x9149 = 0x534F
-0x914A = 0x747A
-0x914B = 0x4775
-0x914C = 0x5743
-0x914D = 0x4564
-0x914E = 0x747C
-0x914F = 0x747D
-0x9150 = 0x747B
-0x9152 = 0x3E46
-0x9157 = 0x506F
-0x915A = 0x3753
-0x915E = 0x4C2A
-0x9161 = 0x7522
-0x9162 = 0x7521
-0x9163 = 0x3A28
-0x9164 = 0x747E
-0x9165 = 0x4B56
-0x9169 = 0x7524
-0x916A = 0x4052
-0x916C = 0x336A
-0x916E = 0x4D2A
-0x916F = 0x7525
-0x9170 = 0x7523
-0x9172 = 0x7528
-0x9174 = 0x7529
-0x9175 = 0x3D4D
-0x9176 = 0x4338
-0x9177 = 0x3F61
-0x9178 = 0x4B61
-0x9179 = 0x752A
-0x9185 = 0x752C
-0x9187 = 0x343C
-0x9189 = 0x576D
-0x918B = 0x3457
-0x918C = 0x752B
-0x918D = 0x752E
-0x9190 = 0x752D
-0x9191 = 0x752F
-0x9192 = 0x5051
-0x9196 = 0x544D
-0x919A = 0x4351
-0x919B = 0x4829
-0x919C = 0x3373
-0x91A2 = 0x7530
-0x91A3 = 0x7531
-0x91AA = 0x7532
-0x91AB = 0x523D
-0x91AC = 0x3D34
-0x91AD = 0x7533
-0x91AE = 0x7534
-0x91AF = 0x7535
-0x91B4 = 0x7537
-0x91B5 = 0x7536
-0x91BA = 0x7538
-0x91C0 = 0x4470
-0x91C1 = 0x5046
-0x91C3 = 0x7527
-0x91C5 = 0x7526
-0x91C7 = 0x3249
-0x91C9 = 0x5354
-0x91CB = 0x4A4D
-0x91CC = 0x784E
-0x91CD = 0x5658
-0x91CE = 0x5230
-0x91CF = 0x413F
-0x91D1 = 0x3D70
-0x91D2 = 0x6E44
-0x91D3 = 0x6E45
-0x91D4 = 0x6E46
-0x91D5 = 0x6E49
-0x91D7 = 0x6E48
-0x91D8 = 0x3624
-0x91D9 = 0x6E47
-0x91DC = 0x382A
-0x91DD = 0x556B
-0x91E3 = 0x3576
-0x91E4 = 0x6E4C
-0x91E7 = 0x6E4B
-0x91E9 = 0x3730
-0x91F5 = 0x6E4E
-0x91F7 = 0x6E4A
-0x91F9 = 0x6E4F
-0x91FA = 0x4725
-0x9200 = 0x6E59
-0x9201 = 0x6E55
-0x9204 = 0x6E57
-0x9208 = 0x6E50
-0x9209 = 0x4446
-0x920D = 0x365B
-0x920E = 0x3933
-0x9210 = 0x6E54
-0x9211 = 0x6E53
-0x9214 = 0x332E
-0x9215 = 0x4525
-0x921E = 0x3E7B
-0x9223 = 0x3846
-0x9225 = 0x6E58
-0x9226 = 0x6E51
-0x9227 = 0x6E56
-0x922E = 0x6E6A
-0x9230 = 0x6E66
-0x9233 = 0x6E5D
-0x9234 = 0x4165
-0x9237 = 0x6E5C
-0x9238 = 0x6E60
-0x9239 = 0x6E6B
-0x923A = 0x6E5A
-0x923D = 0x6E5F
-0x923E = 0x534B
-0x923F = 0x6E64
-0x9240 = 0x3C58
-0x9245 = 0x6E52
-0x9248 = 0x6E68
-0x9249 = 0x6E67
-0x924D = 0x6E69
-0x9251 = 0x322C
-0x9255 = 0x6E5E
-0x9257 = 0x472F
-0x925A = 0x432D
-0x925B = 0x4726
-0x925E = 0x6E61
-0x9262 = 0x3227
-0x9266 = 0x6E5B
-0x926C = 0x6E62
-0x926D = 0x6E63
-0x9278 = 0x3D42
-0x927A = 0x6E6F
-0x927B = 0x3875
-0x927F = 0x6E7E
-0x9280 = 0x5278
-0x9283 = 0x6F25
-0x9285 = 0x4D2D
-0x928E = 0x7646
-0x9291 = 0x4F33
-0x9293 = 0x6E7D
-0x9296 = 0x6E79
-0x9298 = 0x437A
-0x929A = 0x6F22
-0x929C = 0x4F4E
-0x92A0 = 0x6E6E
-0x92A3 = 0x6F28
-0x92A5 = 0x523F
-0x92A6 = 0x6E77
-0x92A8 = 0x6F27
-0x92A9 = 0x6E7B
-0x92AA = 0x6E70
-0x92AB = 0x6F24
-0x92AC = 0x6E6D
-0x92B1 = 0x6E76
-0x92B7 = 0x4F7A
-0x92B9 = 0x5062
-0x92BB = 0x4C60
-0x92BC = 0x6F31
-0x92C1 = 0x4241
-0x92C3 = 0x6F36
-0x92C5 = 0x503F
-0x92C7 = 0x3135
-0x92C8 = 0x7648
-0x92CC = 0x6E7A
-0x92CF = 0x6E72
-0x92D2 = 0x3766
-0x92DD = 0x6F32
-0x92DF = 0x6F37
-0x92E3 = 0x6E74
-0x92E4 = 0x337A
-0x92E5 = 0x6F2D
-0x92E6 = 0x6F38
-0x92E8 = 0x6F30
-0x92EA = 0x464C
-0x92ED = 0x4871
-0x92EE = 0x6E71
-0x92EF = 0x6F2F
-0x92F0 = 0x6F2E
-0x92F1 = 0x6F2B
-0x92F6 = 0x6F33
-0x92F8 = 0x3E62
-0x92FC = 0x3856
-0x9301 = 0x6F3E
-0x9306 = 0x6F3A
-0x9307 = 0x6F42
-0x9308 = 0x6F43
-0x9310 = 0x5736
-0x9312 = 0x6F39
-0x9315 = 0x6F3F
-0x9318 = 0x3438
-0x9319 = 0x6F45
-0x931A = 0x6F23
-0x931B = 0x6F3C
-0x931F = 0x6F44
-0x9320 = 0x3627
-0x9322 = 0x472E
-0x9326 = 0x3D75
-0x9328 = 0x432A
-0x932B = 0x4E7D
-0x932E = 0x6F40
-0x932F = 0x346D
-0x9332 = 0x423C
-0x9333 = 0x434C
-0x9336 = 0x7823
-0x9338 = 0x6F2A
-0x9340 = 0x6F3D
-0x9341 = 0x4F47
-0x9343 = 0x6F41
-0x9346 = 0x6E4D
-0x9347 = 0x6F47
-0x934B = 0x3978
-0x934D = 0x3646
-0x9354 = 0x6F49
-0x9358 = 0x5521
-0x935B = 0x364D
-0x9364 = 0x6F4A
-0x9365 = 0x6F46
-0x9369 = 0x6F3B
-0x936A = 0x764A
-0x936C = 0x4742
-0x9370 = 0x6F4C
-0x9375 = 0x3C7C
-0x9376 = 0x6F48
-0x937A = 0x5560
-0x937E = 0x6F71
-0x9382 = 0x433E
-0x9384 = 0x6F4D
-0x9387 = 0x6F51
-0x938A = 0x3077
-0x938F = 0x764C
-0x9396 = 0x4B78
-0x9398 = 0x6F53
-0x93A2 = 0x4E59
-0x93A3 = 0x5D76
-0x93A6 = 0x6F56
-0x93A7 = 0x6E78
-0x93A9 = 0x6F21
-0x93AA = 0x6F4B
-0x93AC = 0x3864
-0x93AE = 0x5572
-0x93B0 = 0x6F57
-0x93B3 = 0x4478
-0x93B5 = 0x6F58
-0x93B8 = 0x6F54
-0x93BF = 0x6F55
-0x93C3 = 0x6F5F
-0x93C7 = 0x6F60
-0x93C8 = 0x4134
-0x93CA = 0x764B
-0x93CC = 0x6F52
-0x93CD = 0x6F5D
-0x93D1 = 0x6F61
-0x93D6 = 0x7769
-0x93D7 = 0x6F2C
-0x93D8 = 0x6F4F
-0x93DC = 0x6F5B
-0x93DD = 0x6F5C
-0x93DE = 0x6F5E
-0x93DF = 0x3279
-0x93E1 = 0x3E35
-0x93E2 = 0x6F5A
-0x93E4 = 0x6F4E
-0x93E8 = 0x7649
-0x93F5 = 0x6E7C
-0x93F7 = 0x6F64
-0x93F9 = 0x6F6A
-0x9403 = 0x6E73
-0x940B = 0x6F26
-0x9410 = 0x414D
-0x9412 = 0x6F29
-0x9413 = 0x6F66
-0x9414 = 0x6F62
-0x9418 = 0x5653
-0x9419 = 0x6F6B
-0x941D = 0x6F63
-0x9420 = 0x6F68
-0x9426 = 0x6F34
-0x9427 = 0x6F35
-0x9428 = 0x6F50
-0x942E = 0x412D
-0x9432 = 0x6F6D
-0x9433 = 0x4058
-0x9435 = 0x4C7A
-0x9438 = 0x6E6C
-0x943A = 0x6E75
-0x943E = 0x764D
-0x943F = 0x6F6E
-0x9444 = 0x567D
-0x944A = 0x6F6C
-0x944C = 0x6F59
-0x9452 = 0x3C78
-0x9454 = 0x6F6F
-0x9460 = 0x6E65
-0x9463 = 0x6F70
-0x9465 = 0x6F65
-0x946B = 0x764E
-0x946D = 0x6F67
-0x9470 = 0x543F
-0x9472 = 0x4F62
-0x9477 = 0x4477
-0x9479 = 0x6F69
-0x947C = 0x4260
-0x947D = 0x576A
-0x947E = 0x7647
-0x947F = 0x5464
-0x9577 = 0x3324
-0x9580 = 0x4345
-0x9582 = 0x6345
-0x9583 = 0x4941
-0x9586 = 0x6346
-0x9589 = 0x3155
-0x958B = 0x3F2A
-0x958C = 0x634A
-0x958E = 0x6348
-0x958F = 0x4872
-0x9591 = 0x4F50
-0x9593 = 0x3C64
-0x9594 = 0x6349
-0x9598 = 0x5522
-0x95A1 = 0x3A52
-0x95A3 = 0x3873
-0x95A4 = 0x7839
-0x95A5 = 0x3727
-0x95A8 = 0x396B
-0x95A9 = 0x4376
-0x95AB = 0x634D
-0x95AC = 0x634F
-0x95AD = 0x634C
-0x95B2 = 0x5444
-0x95B6 = 0x6351
-0x95B9 = 0x514B
-0x95BB = 0x5156
-0x95BC = 0x6355
-0x95BD = 0x6354
-0x95BE = 0x6350
-0x95BF = 0x6353
-0x95C3 = 0x6356
-0x95C6 = 0x7822
-0x95C8 = 0x6347
-0x95CA = 0x402B
-0x95CB = 0x6357
-0x95CC = 0x403B
-0x95D0 = 0x6359
-0x95D4 = 0x6358
-0x95D5 = 0x635A
-0x95D6 = 0x3433
-0x95DC = 0x3958
-0x95DE = 0x635B
-0x95E1 = 0x327B
-0x95E2 = 0x785B
-0x95E5 = 0x634B
-0x961C = 0x3837
-0x961D = 0x5A62
-0x9621 = 0x5A64
-0x9622 = 0x5A63
-0x962A = 0x5A66
-0x962E = 0x486E
-0x9631 = 0x5A65
-0x9632 = 0x3740
-0x963B = 0x5768
-0x963C = 0x5A68
-0x963D = 0x5A67
-0x963F = 0x3022
-0x9640 = 0x4D53
-0x9642 = 0x5A69
-0x9644 = 0x383D
-0x964B = 0x422A
-0x964C = 0x4430
-0x964D = 0x3D35
-0x9650 = 0x4F5E
-0x9654 = 0x5A6B
-0x9658 = 0x5A6A
-0x965B = 0x315D
-0x965D = 0x4942
-0x965F = 0x5A6C
-0x9661 = 0x3638
-0x9662 = 0x543A
-0x9663 = 0x5573
-0x9664 = 0x337D
-0x966A = 0x4563
-0x966C = 0x5A6E
-0x9670 = 0x5275
-0x9672 = 0x5A6F
-0x9673 = 0x3342
-0x9674 = 0x5A70
-0x9675 = 0x416A
-0x9676 = 0x4C55
-0x9677 = 0x4F5D
-0x9678 = 0x423D
-0x967D = 0x5174
-0x9685 = 0x5367
-0x9686 = 0x4221
-0x9688 = 0x5A71
-0x9689 = 0x5A6D
-0x968A = 0x3653
-0x968B = 0x4B65
-0x968D = 0x5A72
-0x968E = 0x3D57
-0x9694 = 0x3874
-0x9695 = 0x5449
-0x9697 = 0x5A73
-0x9698 = 0x302F
-0x9699 = 0x4F36
-0x969B = 0x3C4A
-0x969C = 0x554F
-0x96A7 = 0x4B6D
-0x96A8 = 0x4B66
-0x96AA = 0x4F55
-0x96B0 = 0x5A74
-0x96B1 = 0x527E
-0x96B3 = 0x6344
-0x96B4 = 0x4224
-0x96B8 = 0x4125
-0x96B9 = 0x763F
-0x96BB = 0x7922
-0x96BC = 0x7640
-0x96BD = 0x7641
-0x96C0 = 0x4838
-0x96C1 = 0x5163
-0x96C4 = 0x505B
-0x96C5 = 0x5145
-0x96C6 = 0x3C2F
-0x96C7 = 0x394D
-0x96C9 = 0x6F74
-0x96CC = 0x3446
-0x96CD = 0x533A
-0x96CE = 0x7642
-0x96D2 = 0x7643
-0x96D5 = 0x3571
-0x96D6 = 0x4B64
-0x96D9 = 0x4B2B
-0x96DB = 0x337B
-0x96DC = 0x5453
-0x96E2 = 0x406B
-0x96E3 = 0x4451
-0x96E8 = 0x536A
-0x96E9 = 0x7627
-0x96EA = 0x5129
-0x96EF = 0x7629
-0x96F2 = 0x5446
-0x96F6 = 0x4163
-0x96F7 = 0x4057
-0x96F9 = 0x3122
-0x96FB = 0x3567
-0x9700 = 0x5068
-0x9704 = 0x4F76
-0x9706 = 0x762A
-0x9707 = 0x5570
-0x9708 = 0x762C
-0x9709 = 0x4339
-0x970D = 0x3B74
-0x970E = 0x762E
-0x970F = 0x762D
-0x9713 = 0x445E
-0x9716 = 0x4158
-0x971C = 0x4B2A
-0x971E = 0x4F3C
-0x9727 = 0x4E6D
-0x972A = 0x762F
-0x9730 = 0x7631
-0x9732 = 0x4236
-0x9738 = 0x3054
-0x9739 = 0x4579
-0x973D = 0x762B
-0x973E = 0x7632
-0x9742 = 0x7628
-0x9744 = 0x7630
-0x9748 = 0x4169
-0x9752 = 0x4760
-0x9756 = 0x3E38
-0x975A = 0x7626
-0x975B = 0x3565
-0x975C = 0x3E32
-0x975E = 0x3747
-0x9760 = 0x3F3F
-0x9761 = 0x4352
-0x9762 = 0x4366
-0x9768 = 0x584C
-0x9769 = 0x386F
-0x9773 = 0x3D79
-0x9774 = 0x5125
-0x9776 = 0x3050
-0x977C = 0x7730
-0x9785 = 0x7731
-0x978B = 0x502C
-0x978D = 0x3030
-0x978F = 0x392E
-0x9794 = 0x7734
-0x9798 = 0x474A
-0x97A0 = 0x3E4F
-0x97A3 = 0x7737
-0x97A6 = 0x7864
-0x97AB = 0x7736
-0x97AD = 0x315E
-0x97B2 = 0x7738
-0x97B4 = 0x7739
-0x97BD = 0x7733
-0x97C3 = 0x7732
-0x97C6 = 0x7861
-0x97C9 = 0x7735
-0x97CB = 0x4E24
-0x97CC = 0x484D
-0x97D3 = 0x3A2B
-0x97D9 = 0x6838
-0x97DC = 0x683A
-0x97DE = 0x6839
-0x97ED = 0x3E42
-0x97F3 = 0x5274
-0x97F5 = 0x544F
-0x97F6 = 0x4958
-0x97FF = 0x4F6C
-0x9801 = 0x5233
-0x9802 = 0x3625
-0x9803 = 0x476A
-0x9805 = 0x4F6E
-0x9806 = 0x4B33
-0x9807 = 0x717C
-0x9808 = 0x506B
-0x980A = 0x676F
-0x980C = 0x4B4C
-0x980E = 0x717D
-0x980F = 0x717E
-0x9810 = 0x5424
-0x9811 = 0x4D67
-0x9812 = 0x3064
-0x9813 = 0x3659
-0x9817 = 0x4644
-0x9818 = 0x416C
-0x981C = 0x7222
-0x9821 = 0x7221
-0x9824 = 0x5243
-0x9826 = 0x7224
-0x982D = 0x4D37
-0x9830 = 0x3C55
-0x9837 = 0x7225
-0x9838 = 0x3E31
-0x983B = 0x4635
-0x983D = 0x4D47
-0x9846 = 0x3F45
-0x984C = 0x4C62
-0x984D = 0x366E
-0x984E = 0x7226
-0x9853 = 0x7227
-0x9854 = 0x5155
-0x9858 = 0x5438
-0x9859 = 0x722A
-0x985B = 0x355F
-0x985E = 0x4060
-0x9862 = 0x7229
-0x9865 = 0x722B
-0x9867 = 0x394B
-0x986B = 0x327C
-0x986C = 0x722C
-0x986F = 0x4F54
-0x9870 = 0x722D
-0x9871 = 0x422D
-0x9873 = 0x7228
-0x9874 = 0x4827
-0x98A8 = 0x3767
-0x98AE = 0x6C29
-0x98AF = 0x6C2A
-0x98B1 = 0x786C
-0x98B3 = 0x7837
-0x98B6 = 0x6C2B
-0x98BC = 0x6C2C
-0x98C4 = 0x462E
-0x98C6 = 0x6C2D
-0x98C8 = 0x6C2E
-0x98DB = 0x3749
-0x98DF = 0x4A33
-0x98E0 = 0x623B
-0x98E2 = 0x783F
-0x98E7 = 0x6238
-0x98E9 = 0x623D
-0x98EA = 0x623F
-0x98EB = 0x6240
-0x98ED = 0x6241
-0x98EF = 0x3739
-0x98F2 = 0x527B
-0x98F4 = 0x6242
-0x98FC = 0x4B47
-0x98FD = 0x3125
-0x98FE = 0x4A4E
-0x9903 = 0x3D48
-0x9905 = 0x317D
-0x9909 = 0x6243
-0x990A = 0x5178
-0x990C = 0x367C
-0x9910 = 0x324D
-0x9911 = 0x6244
-0x9912 = 0x4459
-0x9913 = 0x3676
-0x9918 = 0x5360
-0x991B = 0x6246
-0x991E = 0x3D24
-0x9921 = 0x4F5A
-0x9928 = 0x395D
-0x992E = 0x7751
-0x9933 = 0x623C
-0x9937 = 0x6247
-0x993C = 0x623E
-0x993E = 0x4173
-0x993F = 0x6248
-0x9943 = 0x6249
-0x9945 = 0x4278
-0x9948 = 0x624A
-0x9949 = 0x624B
-0x994A = 0x624C
-0x994B = 0x4021
-0x994C = 0x624D
-0x9951 = 0x3C22
-0x9952 = 0x4844
-0x9954 = 0x7753
-0x9955 = 0x7752
-0x9957 = 0x774F
-0x995C = 0x7750
-0x995E = 0x3276
-0x9962 = 0x624E
-0x9996 = 0x4A57
-0x9997 = 0x5838
-0x9998 = 0x5965
-0x9999 = 0x4F63
-0x99A5 = 0x7025
-0x99A8 = 0x5C30
-0x99AC = 0x426D
-0x99AD = 0x5426
-0x99AE = 0x376B
-0x99B1 = 0x4D54
-0x99B3 = 0x335B
-0x99B4 = 0x5131
-0x99C1 = 0x3235
-0x99D0 = 0x5724
-0x99D1 = 0x6665
-0x99D2 = 0x3E54
-0x99D4 = 0x6660
-0x99D5 = 0x3C5D
-0x99D8 = 0x6666
-0x99D9 = 0x6662
-0x99DB = 0x4A3B
-0x99DD = 0x4D55
-0x99DF = 0x6661
-0x99E1 = 0x426E
-0x99E2 = 0x6669
-0x99ED = 0x3A27
-0x99F1 = 0x4266
-0x99FF = 0x3F25
-0x9A01 = 0x3352
-0x9A05 = 0x666D
-0x9A0D = 0x666C
-0x9A0E = 0x466F
-0x9A0F = 0x666B
-0x9A16 = 0x6670
-0x9A19 = 0x462D
-0x9A2B = 0x6539
-0x9A2D = 0x666F
-0x9A2E = 0x6672
-0x9A30 = 0x4C5A
-0x9A36 = 0x6663
-0x9A37 = 0x4927
-0x9A38 = 0x6673
-0x9A3E = 0x4262
-0x9A40 = 0x5D6B
-0x9A41 = 0x6671
-0x9A42 = 0x666E
-0x9A43 = 0x6674
-0x9A44 = 0x6675
-0x9A45 = 0x477D
-0x9A4A = 0x6668
-0x9A4D = 0x6667
-0x9A4F = 0x6676
-0x9A55 = 0x3D3E
-0x9A57 = 0x5169
-0x9A5A = 0x3E2A
-0x9A5B = 0x6664
-0x9A5F = 0x5668
-0x9A62 = 0x423F
-0x9A64 = 0x6678
-0x9A65 = 0x6677
-0x9A6A = 0x666A
-0x9AA8 = 0x3947
-0x9AAF = 0x3039
-0x9AB0 = 0x773B
-0x9AB1 = 0x773A
-0x9AB6 = 0x773E
-0x9AB7 = 0x773C
-0x9AB8 = 0x3A21
-0x9ABA = 0x773F
-0x9ABC = 0x7740
-0x9AC0 = 0x7742
-0x9AC1 = 0x7741
-0x9AC2 = 0x7744
-0x9ACF = 0x7743
-0x9AD1 = 0x7747
-0x9AD2 = 0x787E
-0x9AD3 = 0x4B68
-0x9AD4 = 0x4C65
-0x9AD5 = 0x7746
-0x9AD6 = 0x7745
-0x9AD8 = 0x385F
-0x9ADF = 0x7754
-0x9AE1 = 0x7755
-0x9AE6 = 0x7756
-0x9AEB = 0x7758
-0x9AED = 0x775A
-0x9AEE = 0x7831
-0x9AEF = 0x7757
-0x9AF9 = 0x775B
-0x9AFB = 0x7759
-0x9B03 = 0x5757
-0x9B06 = 0x4B49
-0x9B08 = 0x775C
-0x9B0D = 0x783A
-0x9B0F = 0x775D
-0x9B1A = 0x7876
-0x9B1F = 0x775F
-0x9B22 = 0x775E
-0x9B23 = 0x7760
-0x9B25 = 0x3637
-0x9B27 = 0x4456
-0x9B29 = 0x6352
-0x9B2E = 0x634E
-0x9B2F = 0x5B4B
-0x9B31 = 0x5374
-0x9B32 = 0x582A
-0x9B3B = 0x6577
-0x9B3C = 0x396D
-0x9B41 = 0x3F7D
-0x9B42 = 0x3B6A
-0x9B43 = 0x7749
-0x9B44 = 0x4647
-0x9B45 = 0x7748
-0x9B48 = 0x774C
-0x9B4D = 0x774D
-0x9B4E = 0x774B
-0x9B4F = 0x4E3A
-0x9B51 = 0x774E
-0x9B54 = 0x4427
-0x9B58 = 0x774A
-0x9B5A = 0x5363
-0x9B6F = 0x4233
-0x9B74 = 0x7650
-0x9B77 = 0x764F
-0x9B81 = 0x7651
-0x9B83 = 0x7652
-0x9B8E = 0x7653
-0x9B90 = 0x7658
-0x9B91 = 0x312B
-0x9B92 = 0x7656
-0x9B9A = 0x765A
-0x9B9D = 0x765F
-0x9B9E = 0x765C
-0x9BAA = 0x765B
-0x9BAB = 0x765E
-0x9BAD = 0x7659
-0x9BAE = 0x4F4A
-0x9BC0 = 0x7667
-0x9BC1 = 0x7661
-0x9BC7 = 0x7669
-0x9BC9 = 0x4070
-0x9BCA = 0x7668
-0x9BD4 = 0x7676
-0x9BD6 = 0x766B
-0x9BDB = 0x7674
-0x9BDD = 0x7671
-0x9BE1 = 0x766E
-0x9BE2 = 0x7672
-0x9BE4 = 0x766F
-0x9BE7 = 0x7670
-0x9BE8 = 0x3E28
-0x9BEA = 0x766C
-0x9BEB = 0x766D
-0x9BF0 = 0x7673
-0x9BF4 = 0x7675
-0x9BFD = 0x766A
-0x9BFF = 0x767D
-0x9C08 = 0x7678
-0x9C09 = 0x767C
-0x9C0D = 0x767A
-0x9C10 = 0x7679
-0x9C12 = 0x767B
-0x9C13 = 0x487A
-0x9C20 = 0x767E
-0x9C23 = 0x7665
-0x9C25 = 0x7724
-0x9C28 = 0x7723
-0x9C29 = 0x7725
-0x9C2D = 0x7722
-0x9C31 = 0x7663
-0x9C32 = 0x7721
-0x9C33 = 0x7726
-0x9C35 = 0x772A
-0x9C37 = 0x7666
-0x9C39 = 0x7664
-0x9C3B = 0x7729
-0x9C3E = 0x7727
-0x9C45 = 0x772B
-0x9C48 = 0x7728
-0x9C49 = 0x316E
-0x9C52 = 0x772E
-0x9C54 = 0x772D
-0x9C56 = 0x772C
-0x9C57 = 0x415B
-0x9C58 = 0x7660
-0x9C5D = 0x7677
-0x9C5F = 0x7657
-0x9C67 = 0x772F
-0x9C6D = 0x765D
-0x9C78 = 0x7654
-0x9C7A = 0x7662
-0x9CE5 = 0x4471
-0x9CE9 = 0x702F
-0x9CEC = 0x596C
-0x9CF3 = 0x376F
-0x9CF4 = 0x4379
-0x9CF6 = 0x7030
-0x9D06 = 0x7032
-0x9D07 = 0x7031
-0x9D09 = 0x513B
-0x9D15 = 0x4D52
-0x9D1B = 0x5427
-0x9D1D = 0x7036
-0x9D1F = 0x7037
-0x9D23 = 0x7033
-0x9D26 = 0x516C
-0x9D28 = 0x513C
-0x9D2F = 0x7039
-0x9D30 = 0x703B
-0x9D3B = 0x3A68
-0x9D3F = 0x386B
-0x9D42 = 0x703C
-0x9D51 = 0x3E69
-0x9D52 = 0x7041
-0x9D53 = 0x703E
-0x9D5C = 0x7043
-0x9D5D = 0x366C
-0x9D60 = 0x7040
-0x9D61 = 0x7044
-0x9D6A = 0x7046
-0x9D6C = 0x4574
-0x9D6F = 0x7047
-0x9D72 = 0x4835
-0x9D87 = 0x7034
-0x9D89 = 0x7048
-0x9D93 = 0x7045
-0x9D98 = 0x7049
-0x9D9A = 0x704A
-0x9DA5 = 0x704C
-0x9DA9 = 0x704D
-0x9DAF = 0x5D3A
-0x9DB4 = 0x3A57
-0x9DBB = 0x773D
-0x9DBC = 0x704F
-0x9DC0 = 0x704B
-0x9DC2 = 0x704E
-0x9DC4 = 0x3C26
-0x9DD3 = 0x7051
-0x9DD7 = 0x4538
-0x9DD9 = 0x703A
-0x9DDA = 0x7052
-0x9DE5 = 0x7038
-0x9DE6 = 0x7054
-0x9DEF = 0x7053
-0x9DF2 = 0x7055
-0x9DF3 = 0x7042
-0x9DF8 = 0x7056
-0x9DF9 = 0x5325
-0x9DFA = 0x7058
-0x9E0C = 0x7057
-0x9E15 = 0x7035
-0x9E1A = 0x7050
-0x9E1B = 0x7059
-0x9E1D = 0x703F
-0x9E1E = 0x703D
-0x9E75 = 0x7852
-0x9E79 = 0x7874
-0x9E7A = 0x753A
-0x9E7C = 0x3C6F
-0x9E7D = 0x514E
-0x9E7F = 0x4239
-0x9E82 = 0x7764
-0x9E87 = 0x7765
-0x9E88 = 0x7766
-0x9E8B = 0x7767
-0x9E92 = 0x7768
-0x9E93 = 0x4234
-0x9E97 = 0x4076
-0x9E9D = 0x776A
-0x9E9F = 0x776B
-0x9EA5 = 0x4273
-0x9EA9 = 0x746F
-0x9EAF = 0x7865
-0x9EB4 = 0x7470
-0x9EB5 = 0x7859
-0x9EBB = 0x4269
-0x9EBD = 0x4334
-0x9EBE = 0x7762
-0x9EC4 = 0x3B46
-0x9ECC = 0x5964
-0x9ECD = 0x4A72
-0x9ECE = 0x4068
-0x9ECF = 0x7024
-0x9ED1 = 0x3A5A
-0x9ED4 = 0x472D
-0x9ED8 = 0x442C
-0x9EDB = 0x776C
-0x9EDC = 0x776D
-0x9EDD = 0x776E
-0x9EDE = 0x3563
-0x9EDF = 0x7770
-0x9EE0 = 0x776F
-0x9EE2 = 0x7771
-0x9EE5 = 0x7774
-0x9EE7 = 0x7773
-0x9EE8 = 0x3533
-0x9EEF = 0x7776
-0x9EF2 = 0x7775
-0x9EF4 = 0x7854
-0x9EF7 = 0x7772
-0x9EF9 = 0x6D69
-0x9EFB = 0x6D6A
-0x9EFC = 0x6D6B
-0x9EFD = 0x763C
-0x9EFF = 0x763D
-0x9F09 = 0x763E
-0x9F0E = 0x3626
-0x9F10 = 0x583E
-0x9F13 = 0x3944
-0x9F15 = 0x782E
-0x9F17 = 0x583B
-0x9F19 = 0x5C31
-0x9F20 = 0x4A73
-0x9F22 = 0x7777
-0x9F2C = 0x7778
-0x9F2F = 0x7779
-0x9F37 = 0x777B
-0x9F39 = 0x777A
-0x9F3B = 0x3147
-0x9F3D = 0x777C
-0x9F3E = 0x777D
-0x9F44 = 0x777E
-0x9F4A = 0x466B
-0x9F4B = 0x552B
-0x9F4F = 0x6C34
-0x9F52 = 0x335D
-0x9F54 = 0x7633
-0x9F59 = 0x7635
-0x9F5C = 0x7637
-0x9F5F = 0x7634
-0x9F60 = 0x7636
-0x9F61 = 0x4164
-0x9F63 = 0x782A
-0x9F66 = 0x7638
-0x9F6A = 0x763A
-0x9F6C = 0x7639
-0x9F72 = 0x4823
-0x9F77 = 0x763B
-0x9F8D = 0x417A
-0x9F90 = 0x4553
-0x9F94 = 0x3928
-0x9F95 = 0x6D68
-0x9F9C = 0x396A
-0x9FA0 = 0x595F
-0xFF01 = 0x2321
-0xFF02 = 0x2322
-0xFF03 = 0x2323
-0xFF04 = 0x2167
-0xFF05 = 0x2325
-0xFF06 = 0x2326
-0xFF07 = 0x2327
-0xFF08 = 0x2328
-0xFF09 = 0x2329
-0xFF0A = 0x232A
-0xFF0B = 0x232B
-0xFF0C = 0x232C
-0xFF0D = 0x232D
-0xFF0E = 0x232E
-0xFF0F = 0x232F
-0xFF10 = 0x2330
-0xFF11 = 0x2331
-0xFF12 = 0x2332
-0xFF13 = 0x2333
-0xFF14 = 0x2334
-0xFF15 = 0x2335
-0xFF16 = 0x2336
-0xFF17 = 0x2337
-0xFF18 = 0x2338
-0xFF19 = 0x2339
-0xFF1A = 0x233A
-0xFF1B = 0x233B
-0xFF1C = 0x233C
-0xFF1D = 0x233D
-0xFF1E = 0x233E
-0xFF1F = 0x233F
-0xFF20 = 0x2340
-0xFF21 = 0x2341
-0xFF22 = 0x2342
-0xFF23 = 0x2343
-0xFF24 = 0x2344
-0xFF25 = 0x2345
-0xFF26 = 0x2346
-0xFF27 = 0x2347
-0xFF28 = 0x2348
-0xFF29 = 0x2349
-0xFF2A = 0x234A
-0xFF2B = 0x234B
-0xFF2C = 0x234C
-0xFF2D = 0x234D
-0xFF2E = 0x234E
-0xFF2F = 0x234F
-0xFF30 = 0x2350
-0xFF31 = 0x2351
-0xFF32 = 0x2352
-0xFF33 = 0x2353
-0xFF34 = 0x2354
-0xFF35 = 0x2355
-0xFF36 = 0x2356
-0xFF37 = 0x2357
-0xFF38 = 0x2358
-0xFF39 = 0x2359
-0xFF3A = 0x235A
-0xFF3B = 0x235B
-0xFF3C = 0x235C
-0xFF3D = 0x235D
-0xFF3E = 0x235E
-0xFF3F = 0x235F
-0xFF40 = 0x2360
-0xFF41 = 0x2361
-0xFF42 = 0x2362
-0xFF43 = 0x2363
-0xFF44 = 0x2364
-0xFF45 = 0x2365
-0xFF46 = 0x2366
-0xFF47 = 0x2367
-0xFF48 = 0x2368
-0xFF49 = 0x2369
-0xFF4A = 0x236A
-0xFF4B = 0x236B
-0xFF4C = 0x236C
-0xFF4D = 0x236D
-0xFF4E = 0x236E
-0xFF4F = 0x236F
-0xFF50 = 0x2370
-0xFF51 = 0x2371
-0xFF52 = 0x2372
-0xFF53 = 0x2373
-0xFF54 = 0x2374
-0xFF55 = 0x2375
-0xFF56 = 0x2376
-0xFF57 = 0x2377
-0xFF58 = 0x2378
-0xFF59 = 0x2379
-0xFF5A = 0x237A
-0xFF5B = 0x237B
-0xFF5C = 0x237C
-0xFF5D = 0x237D
-0xFF5E = 0x212B
-0xFFE0 = 0x2169
-0xFFE1 = 0x216A
-0xFFE3 = 0x237E
-0xFFE5 = 0x2324
-END_MAP
diff --git a/enc/trans/GB/UCS%GB2312.src b/enc/trans/GB/UCS%GB2312.src
deleted file mode 100644
index 3293fea604..0000000000
--- a/enc/trans/GB/UCS%GB2312.src
+++ /dev/null
@@ -1,7531 +0,0 @@
-# $NetBSD: UCS%GB2312.src,v 1.6 2006/11/22 20:22:30 tnozaki Exp $
-
-TYPE ROWCOL
-NAME "UCS/GB2312"
-SRC_ZONE 0x00A4 - 0xFFE5
-OOB_MODE INVALID
-DST_INVALID 0xFFFF
-DST_UNIT_BITS 16
-
-BEGIN_MAP
-#
-# 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
-0x00A7 = 0x216C
-0x00A8 = 0x2127
-0x00B0 = 0x2163
-0x00B1 = 0x2140
-0x00B7 = 0x2124
-0x00D7 = 0x2141
-0x00E0 = 0x2824
-0x00E1 = 0x2822
-0x00E8 = 0x2828
-0x00E9 = 0x2826
-0x00EA = 0x283A
-0x00EC = 0x282C
-0x00ED = 0x282A
-0x00F2 = 0x2830
-0x00F3 = 0x282E
-0x00F7 = 0x2142
-0x00F9 = 0x2834
-0x00FA = 0x2832
-0x00FC = 0x2839
-0x0101 = 0x2821
-0x0113 = 0x2825
-0x011B = 0x2827
-0x012B = 0x2829
-0x014D = 0x282D
-0x016B = 0x2831
-0x01CE = 0x2823
-0x01D0 = 0x282B
-0x01D2 = 0x282F
-0x01D4 = 0x2833
-0x01D6 = 0x2835
-0x01D8 = 0x2836
-0x01DA = 0x2837
-0x01DC = 0x2838
-0x02C7 = 0x2126
-0x02C9 = 0x2125
-0x0391 = 0x2621
-0x0392 = 0x2622
-0x0393 = 0x2623
-0x0394 = 0x2624
-0x0395 = 0x2625
-0x0396 = 0x2626
-0x0397 = 0x2627
-0x0398 = 0x2628
-0x0399 = 0x2629
-0x039A = 0x262A
-0x039B = 0x262B
-0x039C = 0x262C
-0x039D = 0x262D
-0x039E = 0x262E
-0x039F = 0x262F
-0x03A0 = 0x2630
-0x03A1 = 0x2631
-0x03A3 = 0x2632
-0x03A4 = 0x2633
-0x03A5 = 0x2634
-0x03A6 = 0x2635
-0x03A7 = 0x2636
-0x03A8 = 0x2637
-0x03A9 = 0x2638
-0x03B1 = 0x2641
-0x03B2 = 0x2642
-0x03B3 = 0x2643
-0x03B4 = 0x2644
-0x03B5 = 0x2645
-0x03B6 = 0x2646
-0x03B7 = 0x2647
-0x03B8 = 0x2648
-0x03B9 = 0x2649
-0x03BA = 0x264A
-0x03BB = 0x264B
-0x03BC = 0x264C
-0x03BD = 0x264D
-0x03BE = 0x264E
-0x03BF = 0x264F
-0x03C0 = 0x2650
-0x03C1 = 0x2651
-0x03C3 = 0x2652
-0x03C4 = 0x2653
-0x03C5 = 0x2654
-0x03C6 = 0x2655
-0x03C7 = 0x2656
-0x03C8 = 0x2657
-0x03C9 = 0x2658
-0x0401 = 0x2727
-0x0410 = 0x2721
-0x0411 = 0x2722
-0x0412 = 0x2723
-0x0413 = 0x2724
-0x0414 = 0x2725
-0x0415 = 0x2726
-0x0416 = 0x2728
-0x0417 = 0x2729
-0x0418 = 0x272A
-0x0419 = 0x272B
-0x041A = 0x272C
-0x041B = 0x272D
-0x041C = 0x272E
-0x041D = 0x272F
-0x041E = 0x2730
-0x041F = 0x2731
-0x0420 = 0x2732
-0x0421 = 0x2733
-0x0422 = 0x2734
-0x0423 = 0x2735
-0x0424 = 0x2736
-0x0425 = 0x2737
-0x0426 = 0x2738
-0x0427 = 0x2739
-0x0428 = 0x273A
-0x0429 = 0x273B
-0x042A = 0x273C
-0x042B = 0x273D
-0x042C = 0x273E
-0x042D = 0x273F
-0x042E = 0x2740
-0x042F = 0x2741
-0x0430 = 0x2751
-0x0431 = 0x2752
-0x0432 = 0x2753
-0x0433 = 0x2754
-0x0434 = 0x2755
-0x0435 = 0x2756
-0x0436 = 0x2758
-0x0437 = 0x2759
-0x0438 = 0x275A
-0x0439 = 0x275B
-0x043A = 0x275C
-0x043B = 0x275D
-0x043C = 0x275E
-0x043D = 0x275F
-0x043E = 0x2760
-0x043F = 0x2761
-0x0440 = 0x2762
-0x0441 = 0x2763
-0x0442 = 0x2764
-0x0443 = 0x2765
-0x0444 = 0x2766
-0x0445 = 0x2767
-0x0446 = 0x2768
-0x0447 = 0x2769
-0x0448 = 0x276A
-0x0449 = 0x276B
-0x044A = 0x276C
-0x044B = 0x276D
-0x044C = 0x276E
-0x044D = 0x276F
-0x044E = 0x2770
-0x044F = 0x2771
-0x0451 = 0x2757
-0x2014 = 0x212A
-0x2015 = 0x212A # fallback -> 0x2014
-0x2016 = 0x212C
-0x2018 = 0x212E
-0x2019 = 0x212F
-0x201C = 0x2130
-0x201D = 0x2131
-0x2026 = 0x212D
-0x2030 = 0x216B
-0x2032 = 0x2164
-0x2033 = 0x2165
-0x203B = 0x2179
-0x2103 = 0x2166
-0x2116 = 0x216D
-0x2160 = 0x2271
-0x2161 = 0x2272
-0x2162 = 0x2273
-0x2163 = 0x2274
-0x2164 = 0x2275
-0x2165 = 0x2276
-0x2166 = 0x2277
-0x2167 = 0x2278
-0x2168 = 0x2279
-0x2169 = 0x227A
-0x216A = 0x227B
-0x216B = 0x227C
-0x2190 = 0x217B
-0x2191 = 0x217C
-0x2192 = 0x217A
-0x2193 = 0x217D
-0x2208 = 0x214A
-0x220F = 0x2147
-0x2211 = 0x2146
-0x221A = 0x214C
-0x221D = 0x2158
-0x221E = 0x215E
-0x2220 = 0x214F
-0x2225 = 0x214E
-0x2227 = 0x2144
-0x2228 = 0x2145
-0x2229 = 0x2149
-0x222A = 0x2148
-0x222B = 0x2152
-0x222E = 0x2153
-0x2234 = 0x2160
-0x2235 = 0x215F
-0x2236 = 0x2143
-0x2237 = 0x214B
-0x223D = 0x2157
-0x2248 = 0x2156
-0x224C = 0x2155
-0x2260 = 0x2159
-0x2261 = 0x2154
-0x2264 = 0x215C
-0x2265 = 0x215D
-0x226E = 0x215A
-0x226F = 0x215B
-0x2299 = 0x2151
-0x22A5 = 0x214D
-0x2312 = 0x2150
-0x2460 = 0x2259
-0x2461 = 0x225A
-0x2462 = 0x225B
-0x2463 = 0x225C
-0x2464 = 0x225D
-0x2465 = 0x225E
-0x2466 = 0x225F
-0x2467 = 0x2260
-0x2468 = 0x2261
-0x2469 = 0x2262
-0x2474 = 0x2245
-0x2475 = 0x2246
-0x2476 = 0x2247
-0x2477 = 0x2248
-0x2478 = 0x2249
-0x2479 = 0x224A
-0x247A = 0x224B
-0x247B = 0x224C
-0x247C = 0x224D
-0x247D = 0x224E
-0x247E = 0x224F
-0x247F = 0x2250
-0x2480 = 0x2251
-0x2481 = 0x2252
-0x2482 = 0x2253
-0x2483 = 0x2254
-0x2484 = 0x2255
-0x2485 = 0x2256
-0x2486 = 0x2257
-0x2487 = 0x2258
-0x2488 = 0x2231
-0x2489 = 0x2232
-0x248A = 0x2233
-0x248B = 0x2234
-0x248C = 0x2235
-0x248D = 0x2236
-0x248E = 0x2237
-0x248F = 0x2238
-0x2490 = 0x2239
-0x2491 = 0x223A
-0x2492 = 0x223B
-0x2493 = 0x223C
-0x2494 = 0x223D
-0x2495 = 0x223E
-0x2496 = 0x223F
-0x2497 = 0x2240
-0x2498 = 0x2241
-0x2499 = 0x2242
-0x249A = 0x2243
-0x249B = 0x2244
-0x2500 = 0x2924
-0x2501 = 0x2925
-0x2502 = 0x2926
-0x2503 = 0x2927
-0x2504 = 0x2928
-0x2505 = 0x2929
-0x2506 = 0x292A
-0x2507 = 0x292B
-0x2508 = 0x292C
-0x2509 = 0x292D
-0x250A = 0x292E
-0x250B = 0x292F
-0x250C = 0x2930
-0x250D = 0x2931
-0x250E = 0x2932
-0x250F = 0x2933
-0x2510 = 0x2934
-0x2511 = 0x2935
-0x2512 = 0x2936
-0x2513 = 0x2937
-0x2514 = 0x2938
-0x2515 = 0x2939
-0x2516 = 0x293A
-0x2517 = 0x293B
-0x2518 = 0x293C
-0x2519 = 0x293D
-0x251A = 0x293E
-0x251B = 0x293F
-0x251C = 0x2940
-0x251D = 0x2941
-0x251E = 0x2942
-0x251F = 0x2943
-0x2520 = 0x2944
-0x2521 = 0x2945
-0x2522 = 0x2946
-0x2523 = 0x2947
-0x2524 = 0x2948
-0x2525 = 0x2949
-0x2526 = 0x294A
-0x2527 = 0x294B
-0x2528 = 0x294C
-0x2529 = 0x294D
-0x252A = 0x294E
-0x252B = 0x294F
-0x252C = 0x2950
-0x252D = 0x2951
-0x252E = 0x2952
-0x252F = 0x2953
-0x2530 = 0x2954
-0x2531 = 0x2955
-0x2532 = 0x2956
-0x2533 = 0x2957
-0x2534 = 0x2958
-0x2535 = 0x2959
-0x2536 = 0x295A
-0x2537 = 0x295B
-0x2538 = 0x295C
-0x2539 = 0x295D
-0x253A = 0x295E
-0x253B = 0x295F
-0x253C = 0x2960
-0x253D = 0x2961
-0x253E = 0x2962
-0x253F = 0x2963
-0x2540 = 0x2964
-0x2541 = 0x2965
-0x2542 = 0x2966
-0x2543 = 0x2967
-0x2544 = 0x2968
-0x2545 = 0x2969
-0x2546 = 0x296A
-0x2547 = 0x296B
-0x2548 = 0x296C
-0x2549 = 0x296D
-0x254A = 0x296E
-0x254B = 0x296F
-0x25A0 = 0x2176
-0x25A1 = 0x2175
-0x25B2 = 0x2178
-0x25B3 = 0x2177
-0x25C6 = 0x2174
-0x25C7 = 0x2173
-0x25CB = 0x2170
-0x25CE = 0x2172
-0x25CF = 0x2171
-0x2605 = 0x216F
-0x2606 = 0x216E
-0x2640 = 0x2162
-0x2642 = 0x2161
-0x3000 = 0x2121
-0x3001 = 0x2122
-0x3002 = 0x2123
-0x3003 = 0x2128
-0x3005 = 0x2129
-0x3008 = 0x2134
-0x3009 = 0x2135
-0x300A = 0x2136
-0x300B = 0x2137
-0x300C = 0x2138
-0x300D = 0x2139
-0x300E = 0x213A
-0x300F = 0x213B
-0x3010 = 0x213E
-0x3011 = 0x213F
-0x3013 = 0x217E
-0x3014 = 0x2132
-0x3015 = 0x2133
-0x3016 = 0x213C
-0x3017 = 0x213D
-0x3041 = 0x2421
-0x3042 = 0x2422
-0x3043 = 0x2423
-0x3044 = 0x2424
-0x3045 = 0x2425
-0x3046 = 0x2426
-0x3047 = 0x2427
-0x3048 = 0x2428
-0x3049 = 0x2429
-0x304A = 0x242A
-0x304B = 0x242B
-0x304C = 0x242C
-0x304D = 0x242D
-0x304E = 0x242E
-0x304F = 0x242F
-0x3050 = 0x2430
-0x3051 = 0x2431
-0x3052 = 0x2432
-0x3053 = 0x2433
-0x3054 = 0x2434
-0x3055 = 0x2435
-0x3056 = 0x2436
-0x3057 = 0x2437
-0x3058 = 0x2438
-0x3059 = 0x2439
-0x305A = 0x243A
-0x305B = 0x243B
-0x305C = 0x243C
-0x305D = 0x243D
-0x305E = 0x243E
-0x305F = 0x243F
-0x3060 = 0x2440
-0x3061 = 0x2441
-0x3062 = 0x2442
-0x3063 = 0x2443
-0x3064 = 0x2444
-0x3065 = 0x2445
-0x3066 = 0x2446
-0x3067 = 0x2447
-0x3068 = 0x2448
-0x3069 = 0x2449
-0x306A = 0x244A
-0x306B = 0x244B
-0x306C = 0x244C
-0x306D = 0x244D
-0x306E = 0x244E
-0x306F = 0x244F
-0x3070 = 0x2450
-0x3071 = 0x2451
-0x3072 = 0x2452
-0x3073 = 0x2453
-0x3074 = 0x2454
-0x3075 = 0x2455
-0x3076 = 0x2456
-0x3077 = 0x2457
-0x3078 = 0x2458
-0x3079 = 0x2459
-0x307A = 0x245A
-0x307B = 0x245B
-0x307C = 0x245C
-0x307D = 0x245D
-0x307E = 0x245E
-0x307F = 0x245F
-0x3080 = 0x2460
-0x3081 = 0x2461
-0x3082 = 0x2462
-0x3083 = 0x2463
-0x3084 = 0x2464
-0x3085 = 0x2465
-0x3086 = 0x2466
-0x3087 = 0x2467
-0x3088 = 0x2468
-0x3089 = 0x2469
-0x308A = 0x246A
-0x308B = 0x246B
-0x308C = 0x246C
-0x308D = 0x246D
-0x308E = 0x246E
-0x308F = 0x246F
-0x3090 = 0x2470
-0x3091 = 0x2471
-0x3092 = 0x2472
-0x3093 = 0x2473
-0x30A1 = 0x2521
-0x30A2 = 0x2522
-0x30A3 = 0x2523
-0x30A4 = 0x2524
-0x30A5 = 0x2525
-0x30A6 = 0x2526
-0x30A7 = 0x2527
-0x30A8 = 0x2528
-0x30A9 = 0x2529
-0x30AA = 0x252A
-0x30AB = 0x252B
-0x30AC = 0x252C
-0x30AD = 0x252D
-0x30AE = 0x252E
-0x30AF = 0x252F
-0x30B0 = 0x2530
-0x30B1 = 0x2531
-0x30B2 = 0x2532
-0x30B3 = 0x2533
-0x30B4 = 0x2534
-0x30B5 = 0x2535
-0x30B6 = 0x2536
-0x30B7 = 0x2537
-0x30B8 = 0x2538
-0x30B9 = 0x2539
-0x30BA = 0x253A
-0x30BB = 0x253B
-0x30BC = 0x253C
-0x30BD = 0x253D
-0x30BE = 0x253E
-0x30BF = 0x253F
-0x30C0 = 0x2540
-0x30C1 = 0x2541
-0x30C2 = 0x2542
-0x30C3 = 0x2543
-0x30C4 = 0x2544
-0x30C5 = 0x2545
-0x30C6 = 0x2546
-0x30C7 = 0x2547
-0x30C8 = 0x2548
-0x30C9 = 0x2549
-0x30CA = 0x254A
-0x30CB = 0x254B
-0x30CC = 0x254C
-0x30CD = 0x254D
-0x30CE = 0x254E
-0x30CF = 0x254F
-0x30D0 = 0x2550
-0x30D1 = 0x2551
-0x30D2 = 0x2552
-0x30D3 = 0x2553
-0x30D4 = 0x2554
-0x30D5 = 0x2555
-0x30D6 = 0x2556
-0x30D7 = 0x2557
-0x30D8 = 0x2558
-0x30D9 = 0x2559
-0x30DA = 0x255A
-0x30DB = 0x255B
-0x30DC = 0x255C
-0x30DD = 0x255D
-0x30DE = 0x255E
-0x30DF = 0x255F
-0x30E0 = 0x2560
-0x30E1 = 0x2561
-0x30E2 = 0x2562
-0x30E3 = 0x2563
-0x30E4 = 0x2564
-0x30E5 = 0x2565
-0x30E6 = 0x2566
-0x30E7 = 0x2567
-0x30E8 = 0x2568
-0x30E9 = 0x2569
-0x30EA = 0x256A
-0x30EB = 0x256B
-0x30EC = 0x256C
-0x30ED = 0x256D
-0x30EE = 0x256E
-0x30EF = 0x256F
-0x30F0 = 0x2570
-0x30F1 = 0x2571
-0x30F2 = 0x2572
-0x30F3 = 0x2573
-0x30F4 = 0x2574
-0x30F5 = 0x2575
-0x30F6 = 0x2576
-0x30FB = 0x2124 # fallback -> 0x00B7
-0x3105 = 0x2845
-0x3106 = 0x2846
-0x3107 = 0x2847
-0x3108 = 0x2848
-0x3109 = 0x2849
-0x310A = 0x284A
-0x310B = 0x284B
-0x310C = 0x284C
-0x310D = 0x284D
-0x310E = 0x284E
-0x310F = 0x284F
-0x3110 = 0x2850
-0x3111 = 0x2851
-0x3112 = 0x2852
-0x3113 = 0x2853
-0x3114 = 0x2854
-0x3115 = 0x2855
-0x3116 = 0x2856
-0x3117 = 0x2857
-0x3118 = 0x2858
-0x3119 = 0x2859
-0x311A = 0x285A
-0x311B = 0x285B
-0x311C = 0x285C
-0x311D = 0x285D
-0x311E = 0x285E
-0x311F = 0x285F
-0x3120 = 0x2860
-0x3121 = 0x2861
-0x3122 = 0x2862
-0x3123 = 0x2863
-0x3124 = 0x2864
-0x3125 = 0x2865
-0x3126 = 0x2866
-0x3127 = 0x2867
-0x3128 = 0x2868
-0x3129 = 0x2869
-0x3220 = 0x2265
-0x3221 = 0x2266
-0x3222 = 0x2267
-0x3223 = 0x2268
-0x3224 = 0x2269
-0x3225 = 0x226A
-0x3226 = 0x226B
-0x3227 = 0x226C
-0x3228 = 0x226D
-0x3229 = 0x226E
-0x4E00 = 0x523B
-0x4E01 = 0x3621
-0x4E03 = 0x465F
-0x4E07 = 0x4D72
-0x4E08 = 0x5549
-0x4E09 = 0x487D
-0x4E0A = 0x494F
-0x4E0B = 0x4F42
-0x4E0C = 0x5822
-0x4E0D = 0x323B
-0x4E0E = 0x536B
-0x4E10 = 0x5824
-0x4E11 = 0x3373
-0x4E13 = 0x5728
-0x4E14 = 0x4752
-0x4E15 = 0x5827
-0x4E16 = 0x4A40
-0x4E18 = 0x4770
-0x4E19 = 0x317B
-0x4E1A = 0x5235
-0x4E1B = 0x3454
-0x4E1C = 0x362B
-0x4E1D = 0x4B3F
-0x4E1E = 0x5829
-0x4E22 = 0x362A
-0x4E24 = 0x413D
-0x4E25 = 0x514F
-0x4E27 = 0x4925
-0x4E28 = 0x582D
-0x4E2A = 0x3876
-0x4E2B = 0x513E
-0x4E2C = 0x635C
-0x4E2D = 0x5650
-0x4E30 = 0x3761
-0x4E32 = 0x342E
-0x4E34 = 0x4159
-0x4E36 = 0x583C
-0x4E38 = 0x4D68
-0x4E39 = 0x3524
-0x4E3A = 0x4E2A
-0x4E3B = 0x5677
-0x4E3D = 0x4076
-0x4E3E = 0x3E59
-0x4E3F = 0x582F
-0x4E43 = 0x444B
-0x4E45 = 0x3E43
-0x4E47 = 0x5831
-0x4E48 = 0x4334
-0x4E49 = 0x5265
-0x4E4B = 0x562E
-0x4E4C = 0x4E5A
-0x4E4D = 0x5527
-0x4E4E = 0x3A75
-0x4E4F = 0x3726
-0x4E50 = 0x4056
-0x4E52 = 0x4639
-0x4E53 = 0x4552
-0x4E54 = 0x4747
-0x4E56 = 0x3954
-0x4E58 = 0x334B
-0x4E59 = 0x5252
-0x4E5C = 0x583F
-0x4E5D = 0x3E45
-0x4E5E = 0x4672
-0x4E5F = 0x5232
-0x4E60 = 0x4F30
-0x4E61 = 0x4F67
-0x4E66 = 0x4A69
-0x4E69 = 0x5840
-0x4E70 = 0x4272
-0x4E71 = 0x4252
-0x4E73 = 0x4869
-0x4E7E = 0x472C
-0x4E86 = 0x414B
-0x4E88 = 0x5368
-0x4E89 = 0x5579
-0x4E8B = 0x4A42
-0x4E8C = 0x367E
-0x4E8D = 0x5821
-0x4E8E = 0x535A
-0x4E8F = 0x3F77
-0x4E91 = 0x5446
-0x4E92 = 0x3B25
-0x4E93 = 0x5841
-0x4E94 = 0x4E65
-0x4E95 = 0x3E2E
-0x4E98 = 0x5828
-0x4E9A = 0x5147
-0x4E9B = 0x5029
-0x4E9F = 0x583D
-0x4EA0 = 0x596F
-0x4EA1 = 0x4D76
-0x4EA2 = 0x3F3A
-0x4EA4 = 0x3D3B
-0x4EA5 = 0x3A25
-0x4EA6 = 0x5260
-0x4EA7 = 0x327A
-0x4EA8 = 0x3A60
-0x4EA9 = 0x4436
-0x4EAB = 0x4F6D
-0x4EAC = 0x3E29
-0x4EAD = 0x4D24
-0x4EAE = 0x4141
-0x4EB2 = 0x4757
-0x4EB3 = 0x5971
-0x4EB5 = 0x5974
-0x4EBA = 0x484B
-0x4EBB = 0x5869
-0x4EBF = 0x525A
-0x4EC0 = 0x4A32
-0x4EC1 = 0x484A
-0x4EC2 = 0x586C
-0x4EC3 = 0x586A
-0x4EC4 = 0x5846
-0x4EC5 = 0x3D76
-0x4EC6 = 0x464D
-0x4EC7 = 0x3370
-0x4EC9 = 0x586B
-0x4ECA = 0x3D71
-0x4ECB = 0x3D69
-0x4ECD = 0x4854
-0x4ECE = 0x3453
-0x4ED1 = 0x4258
-0x4ED3 = 0x3256
-0x4ED4 = 0x5750
-0x4ED5 = 0x4A4B
-0x4ED6 = 0x4B7B
-0x4ED7 = 0x554C
-0x4ED8 = 0x3836
-0x4ED9 = 0x4F49
-0x4EDD = 0x595A
-0x4EDE = 0x5870
-0x4EDF = 0x472A
-0x4EE1 = 0x586E
-0x4EE3 = 0x347A
-0x4EE4 = 0x416E
-0x4EE5 = 0x5254
-0x4EE8 = 0x586D
-0x4EEA = 0x5247
-0x4EEB = 0x586F
-0x4EEC = 0x4347
-0x4EF0 = 0x5176
-0x4EF2 = 0x5659
-0x4EF3 = 0x5872
-0x4EF5 = 0x5875
-0x4EF6 = 0x3C7E
-0x4EF7 = 0x3C5B
-0x4EFB = 0x484E
-0x4EFD = 0x375D
-0x4EFF = 0x3742
-0x4F01 = 0x4673
-0x4F09 = 0x5878
-0x4F0A = 0x5241
-0x4F0D = 0x4E69
-0x4F0E = 0x3C3F
-0x4F0F = 0x377C
-0x4F10 = 0x3725
-0x4F11 = 0x505D
-0x4F17 = 0x565A
-0x4F18 = 0x5345
-0x4F19 = 0x3B6F
-0x4F1A = 0x3B61
-0x4F1B = 0x5871
-0x4F1E = 0x4921
-0x4F1F = 0x4E30
-0x4F20 = 0x342B
-0x4F22 = 0x5873
-0x4F24 = 0x494B
-0x4F25 = 0x5876
-0x4F26 = 0x4257
-0x4F27 = 0x5877
-0x4F2A = 0x4E31
-0x4F2B = 0x5879
-0x4F2F = 0x322E
-0x4F30 = 0x3940
-0x4F32 = 0x5923
-0x4F34 = 0x3069
-0x4F36 = 0x4166
-0x4F38 = 0x496C
-0x4F3A = 0x4B45
-0x4F3C = 0x4B46
-0x4F3D = 0x5924
-0x4F43 = 0x3568
-0x4F46 = 0x352B
-0x4F4D = 0x4E3B
-0x4F4E = 0x354D
-0x4F4F = 0x5721
-0x4F50 = 0x5774
-0x4F51 = 0x5353
-0x4F53 = 0x4C65
-0x4F55 = 0x3A4E
-0x4F57 = 0x5922
-0x4F58 = 0x595C
-0x4F59 = 0x5360
-0x4F5A = 0x587D
-0x4F5B = 0x3770
-0x4F5C = 0x5777
-0x4F5D = 0x587E
-0x4F5E = 0x587A
-0x4F5F = 0x5921
-0x4F60 = 0x4463
-0x4F63 = 0x5336
-0x4F64 = 0x5874
-0x4F65 = 0x595D
-0x4F67 = 0x587B
-0x4F69 = 0x4565
-0x4F6C = 0x4050
-0x4F6F = 0x5170
-0x4F70 = 0x305B
-0x4F73 = 0x3C51
-0x4F74 = 0x5926
-0x4F76 = 0x5925
-0x4F7B = 0x592C
-0x4F7C = 0x592E
-0x4F7E = 0x592B
-0x4F7F = 0x4A39
-0x4F83 = 0x5929
-0x4F84 = 0x5636
-0x4F88 = 0x335E
-0x4F89 = 0x5928
-0x4F8B = 0x407D
-0x4F8D = 0x4A4C
-0x4F8F = 0x592A
-0x4F91 = 0x5927
-0x4F94 = 0x5930
-0x4F97 = 0x3631
-0x4F9B = 0x3929
-0x4F9D = 0x5240
-0x4FA0 = 0x4F40
-0x4FA3 = 0x4242
-0x4FA5 = 0x3D44
-0x4FA6 = 0x556C
-0x4FA7 = 0x3260
-0x4FA8 = 0x4748
-0x4FA9 = 0x3F6B
-0x4FAA = 0x592D
-0x4FAC = 0x592F
-0x4FAE = 0x4E6A
-0x4FAF = 0x3A6E
-0x4FB5 = 0x4756
-0x4FBF = 0x3163
-0x4FC3 = 0x3459
-0x4FC4 = 0x366D
-0x4FC5 = 0x5934
-0x4FCA = 0x3F21
-0x4FCE = 0x595E
-0x4FCF = 0x474E
-0x4FD0 = 0x407E
-0x4FD1 = 0x5938
-0x4FD7 = 0x4B57
-0x4FD8 = 0x377D
-0x4FDA = 0x5935
-0x4FDC = 0x5937
-0x4FDD = 0x3123
-0x4FDE = 0x5361
-0x4FDF = 0x5939
-0x4FE1 = 0x5045
-0x4FE3 = 0x5936
-0x4FE6 = 0x5931
-0x4FE8 = 0x5932
-0x4FE9 = 0x4129
-0x4FEA = 0x5933
-0x4FED = 0x3C73
-0x4FEE = 0x505E
-0x4FEF = 0x3829
-0x4FF1 = 0x3E63
-0x4FF3 = 0x593D
-0x4FF8 = 0x593A
-0x4FFA = 0x3033
-0x4FFE = 0x5942
-0x500C = 0x5944
-0x500D = 0x3136
-0x500F = 0x593F
-0x5012 = 0x3539
-0x5014 = 0x3E73
-0x5018 = 0x4C48
-0x5019 = 0x3A72
-0x501A = 0x5250
-0x501C = 0x5943
-0x501F = 0x3D68
-0x5021 = 0x332B
-0x5025 = 0x5945
-0x5026 = 0x3E6B
-0x5028 = 0x5946
-0x5029 = 0x593B
-0x502A = 0x445F
-0x502C = 0x593E
-0x502D = 0x5941
-0x502E = 0x5940
-0x503A = 0x552E
-0x503C = 0x5635
-0x503E = 0x4763
-0x5043 = 0x5948
-0x5047 = 0x3C59
-0x5048 = 0x594A
-0x504C = 0x593C
-0x504E = 0x594B
-0x504F = 0x462B
-0x5055 = 0x5949
-0x505A = 0x5776
-0x505C = 0x4D23
-0x5065 = 0x3D21
-0x506C = 0x594C
-0x5076 = 0x453C
-0x5077 = 0x4D35
-0x507B = 0x594D
-0x507E = 0x5947
-0x507F = 0x3325
-0x5080 = 0x3F7E
-0x5085 = 0x3835
-0x5088 = 0x407C
-0x508D = 0x3078
-0x50A3 = 0x3476
-0x50A5 = 0x594E
-0x50A7 = 0x594F
-0x50A8 = 0x3422
-0x50A9 = 0x5950
-0x50AC = 0x345F
-0x50B2 = 0x3041
-0x50BA = 0x5951
-0x50BB = 0x4935
-0x50CF = 0x4F71
-0x50D6 = 0x5952
-0x50DA = 0x4145
-0x50E6 = 0x5956
-0x50E7 = 0x492E
-0x50EC = 0x5955
-0x50ED = 0x5954
-0x50EE = 0x5957
-0x50F3 = 0x4B5B
-0x50F5 = 0x3D29
-0x50FB = 0x4627
-0x5106 = 0x5953
-0x5107 = 0x5958
-0x510B = 0x5959
-0x5112 = 0x4865
-0x5121 = 0x405C
-0x513F = 0x3679
-0x5140 = 0x5823
-0x5141 = 0x544A
-0x5143 = 0x542A
-0x5144 = 0x5056
-0x5145 = 0x3364
-0x5146 = 0x5557
-0x5148 = 0x4F48
-0x5149 = 0x3962
-0x514B = 0x3F4B
-0x514D = 0x4362
-0x5151 = 0x3652
-0x5154 = 0x4D43
-0x5155 = 0x596E
-0x5156 = 0x5970
-0x515A = 0x3533
-0x515C = 0x3635
-0x5162 = 0x3E24
-0x5165 = 0x486B
-0x5168 = 0x482B
-0x516B = 0x304B
-0x516C = 0x392B
-0x516D = 0x4179
-0x516E = 0x5962
-0x5170 = 0x403C
-0x5171 = 0x3932
-0x5173 = 0x3958
-0x5174 = 0x504B
-0x5175 = 0x3178
-0x5176 = 0x4664
-0x5177 = 0x3E5F
-0x5178 = 0x3564
-0x5179 = 0x5748
-0x517B = 0x5178
-0x517C = 0x3C66
-0x517D = 0x4A5E
-0x5180 = 0x3C3D
-0x5181 = 0x5966
-0x5182 = 0x5867
-0x5185 = 0x445A
-0x5188 = 0x3854
-0x5189 = 0x483D
-0x518C = 0x3261
-0x518D = 0x5459
-0x5192 = 0x4330
-0x5195 = 0x4361
-0x5196 = 0x5A22
-0x5197 = 0x485F
-0x5199 = 0x5034
-0x519B = 0x3E7C
-0x519C = 0x4529
-0x51A0 = 0x395A
-0x51A2 = 0x5A23
-0x51A4 = 0x5429
-0x51A5 = 0x5A24
-0x51AB = 0x597B
-0x51AC = 0x362C
-0x51AF = 0x376B
-0x51B0 = 0x3179
-0x51B1 = 0x597C
-0x51B2 = 0x3365
-0x51B3 = 0x3E76
-0x51B5 = 0x3F76
-0x51B6 = 0x5231
-0x51B7 = 0x4064
-0x51BB = 0x3633
-0x51BC = 0x597E
-0x51BD = 0x597D
-0x51C0 = 0x3E3B
-0x51C4 = 0x4660
-0x51C6 = 0x573C
-0x51C7 = 0x5A21
-0x51C9 = 0x4139
-0x51CB = 0x3572
-0x51CC = 0x4168
-0x51CF = 0x3C75
-0x51D1 = 0x3455
-0x51DB = 0x415D
-0x51DD = 0x447D
-0x51E0 = 0x3C38
-0x51E1 = 0x3732
-0x51E4 = 0x376F
-0x51EB = 0x596C
-0x51ED = 0x463E
-0x51EF = 0x3F2D
-0x51F0 = 0x3B4B
-0x51F3 = 0x354A
-0x51F5 = 0x5B49
-0x51F6 = 0x5057
-0x51F8 = 0x4D39
-0x51F9 = 0x303C
-0x51FA = 0x3376
-0x51FB = 0x3B77
-0x51FC = 0x5B4A
-0x51FD = 0x3A2F
-0x51FF = 0x5464
-0x5200 = 0x3536
-0x5201 = 0x3573
-0x5202 = 0x5856
-0x5203 = 0x4850
-0x5206 = 0x3756
-0x5207 = 0x4750
-0x5208 = 0x5857
-0x520A = 0x3F2F
-0x520D = 0x5B3B
-0x520E = 0x5858
-0x5211 = 0x504C
-0x5212 = 0x3B2E
-0x5216 = 0x6B3E
-0x5217 = 0x4150
-0x5218 = 0x4175
-0x5219 = 0x5472
-0x521A = 0x3855
-0x521B = 0x3434
-0x521D = 0x3375
-0x5220 = 0x493E
-0x5224 = 0x4550
-0x5228 = 0x4559
-0x5229 = 0x407B
-0x522B = 0x3170
-0x522D = 0x5859
-0x522E = 0x394E
-0x5230 = 0x353D
-0x5233 = 0x585A
-0x5236 = 0x5646
-0x5237 = 0x4B22
-0x5238 = 0x482F
-0x5239 = 0x4932
-0x523A = 0x344C
-0x523B = 0x3F4C
-0x523D = 0x3974
-0x523F = 0x585B
-0x5240 = 0x585C
-0x5241 = 0x3667
-0x5242 = 0x3C41
-0x5243 = 0x4C6A
-0x524A = 0x4F77
-0x524C = 0x585D
-0x524D = 0x4730
-0x5250 = 0x3950
-0x5251 = 0x3D23
-0x5254 = 0x4C5E
-0x5256 = 0x464A
-0x525C = 0x5860
-0x525E = 0x585E
-0x5261 = 0x585F
-0x5265 = 0x307E
-0x5267 = 0x3E67
-0x5269 = 0x4A23
-0x526A = 0x3C74
-0x526F = 0x3831
-0x5272 = 0x386E
-0x527D = 0x5862
-0x527F = 0x3D4B
-0x5281 = 0x5864
-0x5282 = 0x5863
-0x5288 = 0x457C
-0x5290 = 0x5865
-0x5293 = 0x5866
-0x529B = 0x4126
-0x529D = 0x4830
-0x529E = 0x306C
-0x529F = 0x3926
-0x52A0 = 0x3C53
-0x52A1 = 0x4E71
-0x52A2 = 0x5B3D
-0x52A3 = 0x4153
-0x52A8 = 0x362F
-0x52A9 = 0x567A
-0x52AA = 0x452C
-0x52AB = 0x3D59
-0x52AC = 0x5B3E
-0x52AD = 0x5B3F
-0x52B1 = 0x4078
-0x52B2 = 0x3E22
-0x52B3 = 0x404D
-0x52BE = 0x5B40
-0x52BF = 0x4A46
-0x52C3 = 0x322A
-0x52C7 = 0x5342
-0x52C9 = 0x4363
-0x52CB = 0x512B
-0x52D0 = 0x5B42
-0x52D2 = 0x4055
-0x52D6 = 0x5B43
-0x52D8 = 0x3F31
-0x52DF = 0x443C
-0x52E4 = 0x475A
-0x52F0 = 0x5B44
-0x52F9 = 0x5968
-0x52FA = 0x4957
-0x52FE = 0x3934
-0x52FF = 0x4E70
-0x5300 = 0x5448
-0x5305 = 0x307C
-0x5306 = 0x3452
-0x5308 = 0x5059
-0x530D = 0x5969
-0x530F = 0x5E4B
-0x5310 = 0x596B
-0x5315 = 0x5830
-0x5316 = 0x3B2F
-0x5317 = 0x3131
-0x5319 = 0x3357
-0x531A = 0x584E
-0x531D = 0x5451
-0x5320 = 0x3D33
-0x5321 = 0x3F6F
-0x5323 = 0x4F3B
-0x5326 = 0x5850
-0x532A = 0x374B
-0x532E = 0x5851
-0x5339 = 0x4625
-0x533A = 0x4778
-0x533B = 0x523D
-0x533E = 0x5852
-0x533F = 0x4464
-0x5341 = 0x4A2E
-0x5343 = 0x4727
-0x5345 = 0x5826
-0x5347 = 0x497D
-0x5348 = 0x4E67
-0x5349 = 0x3B5C
-0x534A = 0x306B
-0x534E = 0x3B2A
-0x534F = 0x502D
-0x5351 = 0x3130
-0x5352 = 0x5764
-0x5353 = 0x573F
-0x5355 = 0x3525
-0x5356 = 0x4274
-0x5357 = 0x444F
-0x535A = 0x3229
-0x535C = 0x3237
-0x535E = 0x3165
-0x535F = 0x5F32
-0x5360 = 0x553C
-0x5361 = 0x3F28
-0x5362 = 0x422C
-0x5363 = 0x5855
-0x5364 = 0x4231
-0x5366 = 0x5854
-0x5367 = 0x4E54
-0x5369 = 0x5A60
-0x536B = 0x4E40
-0x536E = 0x5834
-0x536F = 0x432E
-0x5370 = 0x5321
-0x5371 = 0x4E23
-0x5373 = 0x3C34
-0x5374 = 0x4834
-0x5375 = 0x4251
-0x5377 = 0x3E6D
-0x5378 = 0x5036
-0x537A = 0x5A61
-0x537F = 0x4764
-0x5382 = 0x3327
-0x5384 = 0x3672
-0x5385 = 0x4C7C
-0x5386 = 0x407A
-0x5389 = 0x4077
-0x538B = 0x5139
-0x538C = 0x5161
-0x538D = 0x5847
-0x5395 = 0x325E
-0x5398 = 0x4065
-0x539A = 0x3A71
-0x539D = 0x5848
-0x539F = 0x542D
-0x53A2 = 0x4F61
-0x53A3 = 0x5849
-0x53A5 = 0x584A
-0x53A6 = 0x4F43
-0x53A8 = 0x3378
-0x53A9 = 0x3E47
-0x53AE = 0x584B
-0x53B6 = 0x5B4C
-0x53BB = 0x4825
-0x53BF = 0x4F58
-0x53C1 = 0x487E
-0x53C2 = 0x324E
-0x53C8 = 0x5356
-0x53C9 = 0x3266
-0x53CA = 0x3C30
-0x53CB = 0x5351
-0x53CC = 0x4B2B
-0x53CD = 0x3734
-0x53D1 = 0x3722
-0x53D4 = 0x4A65
-0x53D6 = 0x4821
-0x53D7 = 0x4A5C
-0x53D8 = 0x3164
-0x53D9 = 0x5070
-0x53DB = 0x4551
-0x53DF = 0x5B45
-0x53E0 = 0x357E
-0x53E3 = 0x3F5A
-0x53E4 = 0x3945
-0x53E5 = 0x3E64
-0x53E6 = 0x416D
-0x53E8 = 0x5F36
-0x53E9 = 0x5F35
-0x53EA = 0x563B
-0x53EB = 0x3D50
-0x53EC = 0x5559
-0x53ED = 0x3048
-0x53EE = 0x3623
-0x53EF = 0x3F49
-0x53F0 = 0x4C28
-0x53F1 = 0x5F33
-0x53F2 = 0x4A37
-0x53F3 = 0x5352
-0x53F5 = 0x584F
-0x53F6 = 0x5236
-0x53F7 = 0x3A45
-0x53F8 = 0x4B3E
-0x53F9 = 0x4C3E
-0x53FB = 0x5F37
-0x53FC = 0x3570
-0x53FD = 0x5F34
-0x5401 = 0x5375
-0x5403 = 0x3354
-0x5404 = 0x3877
-0x5406 = 0x5F3A
-0x5408 = 0x3A4F
-0x5409 = 0x3C2A
-0x540A = 0x3575
-0x540C = 0x4D2C
-0x540D = 0x437B
-0x540E = 0x3A73
-0x540F = 0x4074
-0x5410 = 0x4D42
-0x5411 = 0x4F72
-0x5412 = 0x5F38
-0x5413 = 0x4F45
-0x5415 = 0x4240
-0x5416 = 0x5F39
-0x5417 = 0x4270
-0x541B = 0x3E7D
-0x541D = 0x415F
-0x541E = 0x4D4C
-0x541F = 0x5277
-0x5420 = 0x374D
-0x5421 = 0x5F41
-0x5423 = 0x5F44
-0x5426 = 0x3771
-0x5427 = 0x3049
-0x5428 = 0x3656
-0x5429 = 0x3754
-0x542B = 0x3A2C
-0x542C = 0x4C7D
-0x542D = 0x3F54
-0x542E = 0x4B31
-0x542F = 0x4674
-0x5431 = 0x5628
-0x5432 = 0x5F45
-0x5434 = 0x4E62
-0x5435 = 0x3333
-0x5438 = 0x4E7C
-0x5439 = 0x3435
-0x543B = 0x4E47
-0x543C = 0x3A70
-0x543E = 0x4E61
-0x5440 = 0x513D
-0x5443 = 0x5F40
-0x5446 = 0x3474
-0x5448 = 0x334A
-0x544A = 0x3866
-0x544B = 0x5F3B
-0x5450 = 0x4445
-0x5452 = 0x5F3C
-0x5453 = 0x5F3D
-0x5454 = 0x5F3E
-0x5455 = 0x453B
-0x5456 = 0x5F3F
-0x5457 = 0x5F42
-0x5458 = 0x5431
-0x5459 = 0x5F43
-0x545B = 0x473A
-0x545C = 0x4E58
-0x5462 = 0x4458
-0x5464 = 0x5F4A
-0x5466 = 0x5F4F
-0x5468 = 0x565C
-0x5471 = 0x5F49
-0x5472 = 0x5F5A
-0x5473 = 0x4E36
-0x5475 = 0x3A47
-0x5476 = 0x5F4E
-0x5477 = 0x5F48
-0x5478 = 0x455E
-0x547B = 0x496B
-0x547C = 0x3A74
-0x547D = 0x437C
-0x5480 = 0x3E57
-0x5482 = 0x5F46
-0x5484 = 0x5F4D
-0x5486 = 0x4558
-0x548B = 0x5526
-0x548C = 0x3A4D
-0x548E = 0x3E4C
-0x548F = 0x533D
-0x5490 = 0x3840
-0x5492 = 0x5664
-0x5494 = 0x5F47
-0x5495 = 0x393E
-0x5496 = 0x3F27
-0x5499 = 0x417C
-0x549A = 0x5F4B
-0x549B = 0x5F4C
-0x549D = 0x5F50
-0x54A3 = 0x5F5B
-0x54A4 = 0x5F65
-0x54A6 = 0x5F57
-0x54A7 = 0x5F56
-0x54A8 = 0x5749
-0x54A9 = 0x5F63
-0x54AA = 0x5F64
-0x54AB = 0x656B
-0x54AC = 0x5227
-0x54AD = 0x5F52
-0x54AF = 0x3F29
-0x54B1 = 0x545B
-0x54B3 = 0x3F48
-0x54B4 = 0x5F54
-0x54B8 = 0x4F4C
-0x54BB = 0x5F5D
-0x54BD = 0x514A
-0x54BF = 0x5F5E
-0x54C0 = 0x3027
-0x54C1 = 0x4637
-0x54C2 = 0x5F53
-0x54C4 = 0x3A65
-0x54C6 = 0x365F
-0x54C7 = 0x4D5B
-0x54C8 = 0x397E
-0x54C9 = 0x5455
-0x54CC = 0x5F5F
-0x54CD = 0x4F6C
-0x54CE = 0x3025
-0x54CF = 0x5F67
-0x54D0 = 0x5F51
-0x54D1 = 0x5146
-0x54D2 = 0x5F55
-0x54D3 = 0x5F58
-0x54D4 = 0x5F59
-0x54D5 = 0x5F5C
-0x54D7 = 0x3B29
-0x54D9 = 0x5F60
-0x54DA = 0x5F61
-0x54DC = 0x5F62
-0x54DD = 0x5F66
-0x54DE = 0x5F68
-0x54DF = 0x5334
-0x54E5 = 0x3867
-0x54E6 = 0x4536
-0x54E7 = 0x5F6A
-0x54E8 = 0x495A
-0x54E9 = 0x4128
-0x54EA = 0x4444
-0x54ED = 0x3F5E
-0x54EE = 0x4F78
-0x54F2 = 0x555C
-0x54F3 = 0x5F6E
-0x54FA = 0x3238
-0x54FC = 0x3A5F
-0x54FD = 0x5F6C
-0x54FF = 0x5B41
-0x5501 = 0x5164
-0x5506 = 0x4B74
-0x5507 = 0x343D
-0x5509 = 0x3026
-0x550F = 0x5F71
-0x5510 = 0x4C46
-0x5511 = 0x5F72
-0x5514 = 0x5F6D
-0x551B = 0x5F69
-0x5520 = 0x5F6B
-0x5522 = 0x5F6F
-0x5523 = 0x5F70
-0x5524 = 0x3B3D
-0x5527 = 0x5F73
-0x552A = 0x5F74
-0x552C = 0x3B23
-0x552E = 0x4A5B
-0x552F = 0x4E28
-0x5530 = 0x6027
-0x5531 = 0x332A
-0x5533 = 0x6026
-0x5537 = 0x6021
-0x553C = 0x5F7E
-0x553E = 0x4D59
-0x553F = 0x5F7C
-0x5541 = 0x5F7A
-0x5543 = 0x3F50
-0x5544 = 0x5744
-0x5546 = 0x494C
-0x5549 = 0x5F78
-0x554A = 0x3021
-0x5550 = 0x5F7D
-0x5555 = 0x5F7B
-0x5556 = 0x6022
-0x555C = 0x6028
-0x5561 = 0x3748
-0x5564 = 0x4621
-0x5565 = 0x4936
-0x5566 = 0x4032
-0x5567 = 0x5F75
-0x556A = 0x453E
-0x556C = 0x5844
-0x556D = 0x5F79
-0x556E = 0x4476
-0x5575 = 0x6023
-0x5576 = 0x6024
-0x5577 = 0x6025
-0x5578 = 0x5025
-0x557B = 0x6034
-0x557C = 0x4C64
-0x557E = 0x6031
-0x5580 = 0x3F26
-0x5581 = 0x602F
-0x5582 = 0x4E39
-0x5583 = 0x602B
-0x5584 = 0x4946
-0x5587 = 0x402E
-0x5588 = 0x602E
-0x5589 = 0x3A6D
-0x558A = 0x3A30
-0x558B = 0x6029
-0x558F = 0x5F76
-0x5591 = 0x6033
-0x5594 = 0x6038
-0x5598 = 0x342D
-0x5599 = 0x6039
-0x559C = 0x4F32
-0x559D = 0x3A48
-0x559F = 0x6030
-0x55A7 = 0x507A
-0x55B1 = 0x602C
-0x55B3 = 0x547B
-0x55B5 = 0x5F77
-0x55B7 = 0x4567
-0x55B9 = 0x602D
-0x55BB = 0x5377
-0x55BD = 0x6036
-0x55BE = 0x6037
-0x55C4 = 0x6044
-0x55C5 = 0x5061
-0x55C9 = 0x603C
-0x55CC = 0x6049
-0x55CD = 0x604A
-0x55D1 = 0x603E
-0x55D2 = 0x602A
-0x55D3 = 0x4924
-0x55D4 = 0x6041
-0x55D6 = 0x6032
-0x55DC = 0x4A48
-0x55DD = 0x6043
-0x55DF = 0x6035
-0x55E1 = 0x4E4B
-0x55E3 = 0x4B43
-0x55E4 = 0x604D
-0x55E5 = 0x6046
-0x55E6 = 0x6042
-0x55E8 = 0x604B
-0x55EA = 0x603A
-0x55EB = 0x603F
-0x55EC = 0x6040
-0x55EF = 0x6045
-0x55F2 = 0x6047
-0x55F3 = 0x6048
-0x55F5 = 0x604C
-0x55F7 = 0x603B
-0x55FD = 0x4B54
-0x55FE = 0x6055
-0x5600 = 0x6056
-0x5601 = 0x6052
-0x5608 = 0x6050
-0x5609 = 0x3C4E
-0x560C = 0x6051
-0x560E = 0x3842
-0x560F = 0x5845
-0x5618 = 0x506A
-0x561B = 0x426F
-0x561E = 0x604F
-0x561F = 0x603D
-0x5623 = 0x6054
-0x5624 = 0x6053
-0x5627 = 0x6057
-0x562C = 0x605C
-0x562D = 0x6058
-0x5631 = 0x5676
-0x5632 = 0x3330
-0x5634 = 0x576C
-0x5636 = 0x4B3B
-0x5639 = 0x605A
-0x563B = 0x4E7B
-0x563F = 0x3A59
-0x564C = 0x6061
-0x564D = 0x605D
-0x564E = 0x522D
-0x5654 = 0x6062
-0x5657 = 0x605B
-0x5658 = 0x6059
-0x5659 = 0x605F
-0x565C = 0x6060
-0x5662 = 0x605E
-0x5664 = 0x6064
-0x5668 = 0x4677
-0x5669 = 0x582C
-0x566A = 0x546B
-0x566B = 0x6066
-0x566C = 0x4A49
-0x5671 = 0x6065
-0x5676 = 0x3841
-0x567B = 0x6067
-0x567C = 0x6068
-0x5685 = 0x6069
-0x5686 = 0x6063
-0x568E = 0x3A3F
-0x568F = 0x4C67
-0x5693 = 0x606A
-0x56A3 = 0x4F79
-0x56AF = 0x606B
-0x56B7 = 0x4842
-0x56BC = 0x3D40
-0x56CA = 0x4452
-0x56D4 = 0x606C
-0x56D7 = 0x606D
-0x56DA = 0x4774
-0x56DB = 0x4B44
-0x56DD = 0x606E
-0x56DE = 0x3B58
-0x56DF = 0x5836
-0x56E0 = 0x5272
-0x56E1 = 0x606F
-0x56E2 = 0x4D45
-0x56E4 = 0x365A
-0x56EB = 0x6071
-0x56ED = 0x5430
-0x56F0 = 0x4027
-0x56F1 = 0x3451
-0x56F4 = 0x4E27
-0x56F5 = 0x6070
-0x56F9 = 0x6072
-0x56FA = 0x394C
-0x56FD = 0x397A
-0x56FE = 0x4D3C
-0x56FF = 0x6073
-0x5703 = 0x4654
-0x5704 = 0x6074
-0x5706 = 0x5432
-0x5708 = 0x4826
-0x5709 = 0x6076
-0x570A = 0x6075
-0x571C = 0x6077
-0x571F = 0x4D41
-0x5723 = 0x4A25
-0x5728 = 0x545A
-0x5729 = 0x5B57
-0x572A = 0x5B59
-0x572C = 0x5B58
-0x572D = 0x3967
-0x572E = 0x5B5C
-0x572F = 0x5B5D
-0x5730 = 0x3558
-0x5733 = 0x5B5A
-0x5739 = 0x5B5B
-0x573A = 0x3321
-0x573B = 0x5B5F
-0x573E = 0x3B78
-0x5740 = 0x5637
-0x5742 = 0x5B60
-0x5747 = 0x3E79
-0x574A = 0x373B
-0x574C = 0x5B50
-0x574D = 0x4C2E
-0x574E = 0x3F32
-0x574F = 0x3B35
-0x5750 = 0x5778
-0x5751 = 0x3F53
-0x5757 = 0x3F69
-0x575A = 0x3C61
-0x575B = 0x4C33
-0x575C = 0x5B5E
-0x575D = 0x3053
-0x575E = 0x4E6B
-0x575F = 0x3758
-0x5760 = 0x5739
-0x5761 = 0x4642
-0x5764 = 0x4024
-0x5766 = 0x4C39
-0x5768 = 0x5B67
-0x5769 = 0x5B61
-0x576A = 0x463A
-0x576B = 0x5B63
-0x576D = 0x5B68
-0x576F = 0x4577
-0x5773 = 0x5B6A
-0x5776 = 0x5B69
-0x5777 = 0x3F40
-0x577B = 0x5B66
-0x577C = 0x5B65
-0x5782 = 0x3439
-0x5783 = 0x402C
-0x5784 = 0x4222
-0x5785 = 0x5B62
-0x5786 = 0x5B64
-0x578B = 0x504D
-0x578C = 0x5B6D
-0x5792 = 0x405D
-0x5793 = 0x5B72
-0x579B = 0x3662
-0x57A0 = 0x5B73
-0x57A1 = 0x5B52
-0x57A2 = 0x3938
-0x57A3 = 0x542B
-0x57A4 = 0x5B6C
-0x57A6 = 0x3F51
-0x57A7 = 0x5B70
-0x57A9 = 0x5B51
-0x57AB = 0x3566
-0x57AD = 0x5B6B
-0x57AE = 0x3F65
-0x57B2 = 0x5B6E
-0x57B4 = 0x5B71
-0x57B8 = 0x5B79
-0x57C2 = 0x3921
-0x57C3 = 0x3023
-0x57CB = 0x4271
-0x57CE = 0x3347
-0x57CF = 0x5B6F
-0x57D2 = 0x5B78
-0x57D4 = 0x4652
-0x57D5 = 0x5B74
-0x57D8 = 0x5B75
-0x57D9 = 0x5B77
-0x57DA = 0x5B76
-0x57DD = 0x5B7E
-0x57DF = 0x5372
-0x57E0 = 0x323A
-0x57E4 = 0x5B7D
-0x57ED = 0x5C24
-0x57EF = 0x5B7B
-0x57F4 = 0x5B7A
-0x57F8 = 0x5B7C
-0x57F9 = 0x4560
-0x57FA = 0x3B79
-0x57FD = 0x5C23
-0x5800 = 0x5C25
-0x5802 = 0x4C43
-0x5806 = 0x3651
-0x5807 = 0x5D40
-0x580B = 0x5C21
-0x580D = 0x5C22
-0x5811 = 0x4735
-0x5815 = 0x3669
-0x5819 = 0x5C27
-0x581E = 0x5C26
-0x5820 = 0x5C29
-0x5821 = 0x3124
-0x5824 = 0x354C
-0x582A = 0x3F30
-0x5830 = 0x515F
-0x5835 = 0x3642
-0x5844 = 0x5C28
-0x584C = 0x4B7A
-0x584D = 0x6B73
-0x5851 = 0x4B5C
-0x5854 = 0x4B7E
-0x5858 = 0x4C41
-0x585E = 0x487B
-0x5865 = 0x5C2A
-0x586B = 0x4C6E
-0x586C = 0x5C2B
-0x587E = 0x5B53
-0x5880 = 0x5C2F
-0x5881 = 0x5C2C
-0x5883 = 0x3E33
-0x5885 = 0x4A7B
-0x5889 = 0x5C2D
-0x5892 = 0x494A
-0x5893 = 0x4439
-0x5899 = 0x473D
-0x589A = 0x5C2E
-0x589E = 0x5476
-0x589F = 0x5066
-0x58A8 = 0x442B
-0x58A9 = 0x3655
-0x58BC = 0x5B54
-0x58C1 = 0x315A
-0x58C5 = 0x5B55
-0x58D1 = 0x5B56
-0x58D5 = 0x3A3E
-0x58E4 = 0x4840
-0x58EB = 0x4A3F
-0x58EC = 0x4849
-0x58EE = 0x5733
-0x58F0 = 0x4979
-0x58F3 = 0x3F47
-0x58F6 = 0x3A78
-0x58F9 = 0x523C
-0x5902 = 0x623A
-0x5904 = 0x3426
-0x5907 = 0x3138
-0x590D = 0x3834
-0x590F = 0x4F44
-0x5914 = 0x5967
-0x5915 = 0x4F26
-0x5916 = 0x4D62
-0x5919 = 0x596D
-0x591A = 0x3660
-0x591C = 0x5239
-0x591F = 0x393B
-0x5924 = 0x6239
-0x5925 = 0x6237
-0x5927 = 0x3473
-0x5929 = 0x4C6C
-0x592A = 0x4C2B
-0x592B = 0x3772
-0x592D = 0x5832
-0x592E = 0x516B
-0x592F = 0x3A3B
-0x5931 = 0x4A27
-0x5934 = 0x4D37
-0x5937 = 0x5244
-0x5938 = 0x3F64
-0x5939 = 0x3C50
-0x593A = 0x3661
-0x593C = 0x5E45
-0x5941 = 0x5E46
-0x5942 = 0x5B3C
-0x5944 = 0x5159
-0x5947 = 0x4666
-0x5948 = 0x444E
-0x5949 = 0x376E
-0x594B = 0x375C
-0x594E = 0x3F7C
-0x594F = 0x5760
-0x5951 = 0x4675
-0x5954 = 0x313C
-0x5955 = 0x5E48
-0x5956 = 0x3D31
-0x5957 = 0x4C57
-0x5958 = 0x5E4A
-0x595A = 0x5E49
-0x5960 = 0x356C
-0x5962 = 0x495D
-0x5965 = 0x3042
-0x5973 = 0x452E
-0x5974 = 0x452B
-0x5976 = 0x444C
-0x5978 = 0x3C69
-0x5979 = 0x4B7D
-0x597D = 0x3A43
-0x5981 = 0x6579
-0x5982 = 0x4867
-0x5983 = 0x657A
-0x5984 = 0x4D7D
-0x5986 = 0x5731
-0x5987 = 0x383E
-0x5988 = 0x4268
-0x598A = 0x4851
-0x598D = 0x657B
-0x5992 = 0x364A
-0x5993 = 0x3C4B
-0x5996 = 0x517D
-0x5997 = 0x6621
-0x5999 = 0x436E
-0x599E = 0x6624
-0x59A3 = 0x657E
-0x59A4 = 0x6625
-0x59A5 = 0x4D57
-0x59A8 = 0x3741
-0x59A9 = 0x657C
-0x59AA = 0x657D
-0x59AB = 0x6623
-0x59AE = 0x445D
-0x59AF = 0x6628
-0x59B2 = 0x6627
-0x59B9 = 0x4343
-0x59BB = 0x465E
-0x59BE = 0x662A
-0x59C6 = 0x4437
-0x59CA = 0x6622
-0x59CB = 0x4A3C
-0x59D0 = 0x3D63
-0x59D1 = 0x3943
-0x59D2 = 0x6626
-0x59D3 = 0x5055
-0x59D4 = 0x4E2F
-0x59D7 = 0x6629
-0x59D8 = 0x6630
-0x59DA = 0x5226
-0x59DC = 0x3D2A
-0x59DD = 0x662D
-0x59E3 = 0x662F
-0x59E5 = 0x4051
-0x59E8 = 0x524C
-0x59EC = 0x3C27
-0x59F9 = 0x6631
-0x59FB = 0x5276
-0x59FF = 0x574B
-0x5A01 = 0x4D7E
-0x5A03 = 0x4D5E
-0x5A04 = 0x4226
-0x5A05 = 0x662B
-0x5A06 = 0x662C
-0x5A07 = 0x3D3F
-0x5A08 = 0x662E
-0x5A09 = 0x6633
-0x5A0C = 0x6632
-0x5A11 = 0x6636
-0x5A13 = 0x6638
-0x5A18 = 0x446F
-0x5A1C = 0x4448
-0x5A1F = 0x3E6A
-0x5A20 = 0x496F
-0x5A23 = 0x6637
-0x5A25 = 0x3670
-0x5A29 = 0x4364
-0x5A31 = 0x5369
-0x5A32 = 0x6634
-0x5A34 = 0x6635
-0x5A36 = 0x4822
-0x5A3C = 0x663D
-0x5A40 = 0x6639
-0x5A46 = 0x4645
-0x5A49 = 0x4D71
-0x5A4A = 0x663B
-0x5A55 = 0x663C
-0x5A5A = 0x3B69
-0x5A62 = 0x663E
-0x5A67 = 0x663A
-0x5A6A = 0x4037
-0x5A74 = 0x5324
-0x5A75 = 0x663F
-0x5A76 = 0x4974
-0x5A77 = 0x6643
-0x5A7A = 0x6644
-0x5A7F = 0x5076
-0x5A92 = 0x433D
-0x5A9A = 0x4344
-0x5A9B = 0x6642
-0x5AAA = 0x6641
-0x5AB2 = 0x6647
-0x5AB3 = 0x4F31
-0x5AB5 = 0x6B74
-0x5AB8 = 0x664A
-0x5ABE = 0x6645
-0x5AC1 = 0x3C5E
-0x5AC2 = 0x4929
-0x5AC9 = 0x3C35
-0x5ACC = 0x4F53
-0x5AD2 = 0x6648
-0x5AD4 = 0x6649
-0x5AD6 = 0x664E
-0x5AD8 = 0x6650
-0x5ADC = 0x6651
-0x5AE0 = 0x664B
-0x5AE1 = 0x3555
-0x5AE3 = 0x664C
-0x5AE6 = 0x664F
-0x5AE9 = 0x445B
-0x5AEB = 0x6646
-0x5AF1 = 0x664D
-0x5B09 = 0x6652
-0x5B16 = 0x6654
-0x5B17 = 0x6653
-0x5B32 = 0x6655
-0x5B34 = 0x5978
-0x5B37 = 0x6656
-0x5B40 = 0x6657
-0x5B50 = 0x5753
-0x5B51 = 0x665D
-0x5B53 = 0x665E
-0x5B54 = 0x3F57
-0x5B55 = 0x5450
-0x5B57 = 0x5756
-0x5B58 = 0x3466
-0x5B59 = 0x4B6F
-0x5B5A = 0x665A
-0x5B5B = 0x5843
-0x5B5C = 0x574E
-0x5B5D = 0x5022
-0x5B5F = 0x434F
-0x5B62 = 0x665F
-0x5B63 = 0x3C3E
-0x5B64 = 0x3942
-0x5B65 = 0x665B
-0x5B66 = 0x5127
-0x5B69 = 0x3A22
-0x5B6A = 0x424F
-0x5B6C = 0x582B
-0x5B70 = 0x4A6B
-0x5B71 = 0x656E
-0x5B73 = 0x665C
-0x5B75 = 0x3775
-0x5B7A = 0x4866
-0x5B7D = 0x4475
-0x5B80 = 0x6532
-0x5B81 = 0x447E
-0x5B83 = 0x4B7C
-0x5B84 = 0x6533
-0x5B85 = 0x552C
-0x5B87 = 0x536E
-0x5B88 = 0x4A58
-0x5B89 = 0x3032
-0x5B8B = 0x4B4E
-0x5B8C = 0x4D6A
-0x5B8F = 0x3A6A
-0x5B93 = 0x6535
-0x5B95 = 0x6534
-0x5B97 = 0x575A
-0x5B98 = 0x3959
-0x5B99 = 0x5666
-0x5B9A = 0x3628
-0x5B9B = 0x4D70
-0x5B9C = 0x524B
-0x5B9D = 0x3126
-0x5B9E = 0x4A35
-0x5BA0 = 0x3368
-0x5BA1 = 0x4973
-0x5BA2 = 0x3F4D
-0x5BA3 = 0x507B
-0x5BA4 = 0x4A52
-0x5BA5 = 0x6536
-0x5BA6 = 0x3B42
-0x5BAA = 0x4F5C
-0x5BAB = 0x392C
-0x5BB0 = 0x5457
-0x5BB3 = 0x3A26
-0x5BB4 = 0x5167
-0x5BB5 = 0x4F7C
-0x5BB6 = 0x3C52
-0x5BB8 = 0x6537
-0x5BB9 = 0x485D
-0x5BBD = 0x3F6D
-0x5BBE = 0x3176
-0x5BBF = 0x4B5E
-0x5BC2 = 0x3C45
-0x5BC4 = 0x3C44
-0x5BC5 = 0x527A
-0x5BC6 = 0x435C
-0x5BC7 = 0x3F5C
-0x5BCC = 0x383B
-0x5BD0 = 0x4342
-0x5BD2 = 0x3A2E
-0x5BD3 = 0x5422
-0x5BDD = 0x475E
-0x5BDE = 0x442F
-0x5BDF = 0x326C
-0x5BE1 = 0x3951
-0x5BE4 = 0x653B
-0x5BE5 = 0x4148
-0x5BE8 = 0x552F
-0x5BEE = 0x653C
-0x5BF0 = 0x653E
-0x5BF8 = 0x3467
-0x5BF9 = 0x3654
-0x5BFA = 0x4B42
-0x5BFB = 0x5130
-0x5BFC = 0x353C
-0x5BFF = 0x4A59
-0x5C01 = 0x3762
-0x5C04 = 0x4964
-0x5C06 = 0x3D2B
-0x5C09 = 0x4E3E
-0x5C0A = 0x5770
-0x5C0F = 0x5021
-0x5C11 = 0x4959
-0x5C14 = 0x367B
-0x5C15 = 0x6658
-0x5C16 = 0x3C62
-0x5C18 = 0x333E
-0x5C1A = 0x4950
-0x5C1C = 0x6659
-0x5C1D = 0x3322
-0x5C22 = 0x5E4C
-0x5C24 = 0x5348
-0x5C25 = 0x5E4D
-0x5C27 = 0x5222
-0x5C2C = 0x5E4E
-0x5C31 = 0x3E4D
-0x5C34 = 0x5E4F
-0x5C38 = 0x4A2C
-0x5C39 = 0x527C
-0x5C3A = 0x335F
-0x5C3B = 0x656A
-0x5C3C = 0x4461
-0x5C3D = 0x3E21
-0x5C3E = 0x4E32
-0x5C3F = 0x4472
-0x5C40 = 0x3E56
-0x5C41 = 0x4628
-0x5C42 = 0x3263
-0x5C45 = 0x3E53
-0x5C48 = 0x477C
-0x5C49 = 0x4C6B
-0x5C4A = 0x3D6C
-0x5C4B = 0x4E5D
-0x5C4E = 0x4A3A
-0x5C4F = 0x4641
-0x5C50 = 0x656C
-0x5C51 = 0x503C
-0x5C55 = 0x5539
-0x5C59 = 0x656D
-0x5C5E = 0x4A74
-0x5C60 = 0x4D40
-0x5C61 = 0x4245
-0x5C63 = 0x656F
-0x5C65 = 0x4244
-0x5C66 = 0x6570
-0x5C6E = 0x6578
-0x5C6F = 0x4D4D
-0x5C71 = 0x493D
-0x5C79 = 0x5259
-0x5C7A = 0x6128
-0x5C7F = 0x536C
-0x5C81 = 0x4B6A
-0x5C82 = 0x4671
-0x5C88 = 0x612C
-0x5C8C = 0x6127
-0x5C8D = 0x6129
-0x5C90 = 0x612A
-0x5C91 = 0x612F
-0x5C94 = 0x326D
-0x5C96 = 0x612B
-0x5C97 = 0x385A
-0x5C98 = 0x612D
-0x5C99 = 0x612E
-0x5C9A = 0x6130
-0x5C9B = 0x353A
-0x5C9C = 0x6131
-0x5CA2 = 0x6133
-0x5CA3 = 0x6138
-0x5CA9 = 0x5152
-0x5CAB = 0x6136
-0x5CAC = 0x6135
-0x5CAD = 0x416B
-0x5CB1 = 0x6137
-0x5CB3 = 0x5440
-0x5CB5 = 0x6132
-0x5CB7 = 0x613A
-0x5CB8 = 0x3036
-0x5CBD = 0x6134
-0x5CBF = 0x3F79
-0x5CC1 = 0x6139
-0x5CC4 = 0x613B
-0x5CCB = 0x613E
-0x5CD2 = 0x613C
-0x5CD9 = 0x5645
-0x5CE1 = 0x4F3F
-0x5CE4 = 0x613D
-0x5CE5 = 0x613F
-0x5CE6 = 0x424D
-0x5CE8 = 0x366B
-0x5CEA = 0x5378
-0x5CED = 0x474D
-0x5CF0 = 0x3765
-0x5CFB = 0x3E7E
-0x5D02 = 0x6140
-0x5D03 = 0x6141
-0x5D06 = 0x6147
-0x5D07 = 0x3367
-0x5D0E = 0x4669
-0x5D14 = 0x345E
-0x5D16 = 0x5142
-0x5D1B = 0x6148
-0x5D1E = 0x6146
-0x5D24 = 0x6145
-0x5D26 = 0x6143
-0x5D27 = 0x6142
-0x5D29 = 0x3140
-0x5D2D = 0x5538
-0x5D2E = 0x6144
-0x5D34 = 0x614B
-0x5D3D = 0x614C
-0x5D3E = 0x614A
-0x5D47 = 0x6F7A
-0x5D4A = 0x6153
-0x5D4B = 0x6152
-0x5D4C = 0x4736
-0x5D58 = 0x6149
-0x5D5B = 0x614E
-0x5D5D = 0x6150
-0x5D69 = 0x6154
-0x5D6B = 0x6151
-0x5D6C = 0x614D
-0x5D6F = 0x614F
-0x5D74 = 0x6155
-0x5D82 = 0x6156
-0x5D99 = 0x6157
-0x5D9D = 0x6158
-0x5DB7 = 0x615A
-0x5DC5 = 0x615B
-0x5DCD = 0x4E21
-0x5DDB = 0x675D
-0x5DDD = 0x3428
-0x5DDE = 0x565D
-0x5DE1 = 0x5132
-0x5DE2 = 0x3332
-0x5DE5 = 0x3924
-0x5DE6 = 0x5773
-0x5DE7 = 0x4749
-0x5DE8 = 0x3E5E
-0x5DE9 = 0x392E
-0x5DEB = 0x4E57
-0x5DEE = 0x326E
-0x5DEF = 0x5B4F
-0x5DF1 = 0x3C3A
-0x5DF2 = 0x5251
-0x5DF3 = 0x4B48
-0x5DF4 = 0x304D
-0x5DF7 = 0x4F6F
-0x5DFD = 0x5963
-0x5DFE = 0x3D6D
-0x5E01 = 0x3152
-0x5E02 = 0x4A50
-0x5E03 = 0x323C
-0x5E05 = 0x4B27
-0x5E06 = 0x372B
-0x5E08 = 0x4A26
-0x5E0C = 0x4F23
-0x5E0F = 0x6078
-0x5E10 = 0x554A
-0x5E11 = 0x607B
-0x5E14 = 0x607A
-0x5E15 = 0x4541
-0x5E16 = 0x4C7B
-0x5E18 = 0x4131
-0x5E19 = 0x6079
-0x5E1A = 0x5663
-0x5E1B = 0x322F
-0x5E1C = 0x5644
-0x5E1D = 0x355B
-0x5E26 = 0x3478
-0x5E27 = 0x5621
-0x5E2D = 0x4F2F
-0x5E2E = 0x306F
-0x5E31 = 0x607C
-0x5E37 = 0x6121
-0x5E38 = 0x3323
-0x5E3B = 0x607D
-0x5E3C = 0x607E
-0x5E3D = 0x4331
-0x5E42 = 0x435D
-0x5E44 = 0x6122
-0x5E45 = 0x3779
-0x5E4C = 0x3B4F
-0x5E54 = 0x6123
-0x5E55 = 0x443B
-0x5E5B = 0x6124
-0x5E5E = 0x6125
-0x5E61 = 0x6126
-0x5E62 = 0x3431
-0x5E72 = 0x3849
-0x5E73 = 0x463D
-0x5E74 = 0x446A
-0x5E76 = 0x3222
-0x5E78 = 0x5052
-0x5E7A = 0x675B
-0x5E7B = 0x3B43
-0x5E7C = 0x5357
-0x5E7D = 0x5344
-0x5E7F = 0x3963
-0x5E80 = 0x624F
-0x5E84 = 0x572F
-0x5E86 = 0x476C
-0x5E87 = 0x3153
-0x5E8A = 0x3432
-0x5E8B = 0x6251
-0x5E8F = 0x5072
-0x5E90 = 0x422E
-0x5E91 = 0x6250
-0x5E93 = 0x3F62
-0x5E94 = 0x5326
-0x5E95 = 0x3557
-0x5E96 = 0x6252
-0x5E97 = 0x356A
-0x5E99 = 0x436D
-0x5E9A = 0x387D
-0x5E9C = 0x382E
-0x5E9E = 0x4553
-0x5E9F = 0x374F
-0x5EA0 = 0x6254
-0x5EA5 = 0x6253
-0x5EA6 = 0x3648
-0x5EA7 = 0x5779
-0x5EAD = 0x4D25
-0x5EB3 = 0x6258
-0x5EB5 = 0x6256
-0x5EB6 = 0x4A7C
-0x5EB7 = 0x3F35
-0x5EB8 = 0x5339
-0x5EB9 = 0x6255
-0x5EBE = 0x6257
-0x5EC9 = 0x412E
-0x5ECA = 0x4048
-0x5ED1 = 0x625B
-0x5ED2 = 0x625A
-0x5ED3 = 0x402A
-0x5ED6 = 0x414E
-0x5EDB = 0x625C
-0x5EE8 = 0x625D
-0x5EEA = 0x625E
-0x5EF4 = 0x5B48
-0x5EF6 = 0x5153
-0x5EF7 = 0x4D22
-0x5EFA = 0x3D28
-0x5EFE = 0x5E43
-0x5EFF = 0x5825
-0x5F00 = 0x3F2A
-0x5F01 = 0x5B4D
-0x5F02 = 0x526C
-0x5F03 = 0x467A
-0x5F04 = 0x452A
-0x5F08 = 0x5E44
-0x5F0A = 0x3157
-0x5F0B = 0x5F2E
-0x5F0F = 0x4A3D
-0x5F11 = 0x5F31
-0x5F13 = 0x392D
-0x5F15 = 0x527D
-0x5F17 = 0x3825
-0x5F18 = 0x3A6B
-0x5F1B = 0x335A
-0x5F1F = 0x355C
-0x5F20 = 0x5545
-0x5F25 = 0x4356
-0x5F26 = 0x4F52
-0x5F27 = 0x3B21
-0x5F29 = 0x6573
-0x5F2A = 0x6572
-0x5F2D = 0x6574
-0x5F2F = 0x4D64
-0x5F31 = 0x4875
-0x5F39 = 0x352F
-0x5F3A = 0x473F
-0x5F3C = 0x6576
-0x5F40 = 0x6C30
-0x5F50 = 0x6566
-0x5F52 = 0x3969
-0x5F53 = 0x3531
-0x5F55 = 0x423C
-0x5F56 = 0x6568
-0x5F57 = 0x6567
-0x5F58 = 0x6569
-0x5F5D = 0x524D
-0x5F61 = 0x616A
-0x5F62 = 0x504E
-0x5F64 = 0x4D2E
-0x5F66 = 0x5165
-0x5F69 = 0x324A
-0x5F6A = 0x316B
-0x5F6C = 0x3172
-0x5F6D = 0x456D
-0x5F70 = 0x5543
-0x5F71 = 0x5330
-0x5F73 = 0x615C
-0x5F77 = 0x615D
-0x5F79 = 0x525B
-0x5F7B = 0x3339
-0x5F7C = 0x314B
-0x5F80 = 0x4D79
-0x5F81 = 0x5577
-0x5F82 = 0x615E
-0x5F84 = 0x3E36
-0x5F85 = 0x347D
-0x5F87 = 0x615F
-0x5F88 = 0x3A5C
-0x5F89 = 0x6160
-0x5F8A = 0x3B32
-0x5F8B = 0x4249
-0x5F8C = 0x6161
-0x5F90 = 0x506C
-0x5F92 = 0x4D3D
-0x5F95 = 0x6162
-0x5F97 = 0x3543
-0x5F98 = 0x4547
-0x5F99 = 0x6163
-0x5F9C = 0x6164
-0x5FA1 = 0x5379
-0x5FA8 = 0x6165
-0x5FAA = 0x512D
-0x5FAD = 0x6166
-0x5FAE = 0x4E22
-0x5FB5 = 0x6167
-0x5FB7 = 0x3542
-0x5FBC = 0x6168
-0x5FBD = 0x3B55
-0x5FC3 = 0x5044
-0x5FC4 = 0x6260
-0x5FC5 = 0x3158
-0x5FC6 = 0x5264
-0x5FC9 = 0x6261
-0x5FCC = 0x3C49
-0x5FCD = 0x484C
-0x5FCF = 0x6263
-0x5FD0 = 0x6C7E
-0x5FD1 = 0x6C7D
-0x5FD2 = 0x5F2F
-0x5FD6 = 0x6262
-0x5FD7 = 0x563E
-0x5FD8 = 0x4D7C
-0x5FD9 = 0x4326
-0x5FDD = 0x6343
-0x5FE0 = 0x5652
-0x5FE1 = 0x6267
-0x5FE4 = 0x6268
-0x5FE7 = 0x5347
-0x5FEA = 0x626C
-0x5FEB = 0x3F6C
-0x5FED = 0x626D
-0x5FEE = 0x6265
-0x5FF1 = 0x3340
-0x5FF5 = 0x446E
-0x5FF8 = 0x626E
-0x5FFB = 0x5043
-0x5FFD = 0x3A76
-0x5FFE = 0x6269
-0x5FFF = 0x375E
-0x6000 = 0x3B33
-0x6001 = 0x4C2C
-0x6002 = 0x4B4B
-0x6003 = 0x6264
-0x6004 = 0x6266
-0x6005 = 0x626A
-0x6006 = 0x626B
-0x600A = 0x6277
-0x600D = 0x6274
-0x600E = 0x5475
-0x600F = 0x6273
-0x6012 = 0x452D
-0x6014 = 0x557A
-0x6015 = 0x4542
-0x6016 = 0x3240
-0x6019 = 0x626F
-0x601B = 0x6272
-0x601C = 0x412F
-0x601D = 0x4B3C
-0x6020 = 0x3521
-0x6021 = 0x6279
-0x6025 = 0x3C31
-0x6026 = 0x6271
-0x6027 = 0x5054
-0x6028 = 0x5439
-0x6029 = 0x6275
-0x602A = 0x3956
-0x602B = 0x6276
-0x602F = 0x4753
-0x6035 = 0x6270
-0x603B = 0x575C
-0x603C = 0x6D21
-0x603F = 0x6278
-0x6041 = 0x6D25
-0x6042 = 0x627E
-0x6043 = 0x4A51
-0x604B = 0x4135
-0x604D = 0x3B50
-0x6050 = 0x3F56
-0x6052 = 0x3A63
-0x6055 = 0x4B21
-0x6059 = 0x6D26
-0x605A = 0x6D23
-0x605D = 0x6D22
-0x6062 = 0x3B56
-0x6063 = 0x6D27
-0x6064 = 0x5074
-0x6067 = 0x6D24
-0x6068 = 0x3A5E
-0x6069 = 0x3677
-0x606A = 0x6321
-0x606B = 0x3632
-0x606C = 0x4C71
-0x606D = 0x3927
-0x606F = 0x4F22
-0x6070 = 0x4721
-0x6073 = 0x3F52
-0x6076 = 0x3671
-0x6078 = 0x627A
-0x6079 = 0x627B
-0x607A = 0x627D
-0x607B = 0x627C
-0x607C = 0x4455
-0x607D = 0x6322
-0x607F = 0x5341
-0x6083 = 0x6327
-0x6084 = 0x4744
-0x6089 = 0x4F24
-0x608C = 0x6329
-0x608D = 0x3A37
-0x6092 = 0x6328
-0x6094 = 0x3B5A
-0x6096 = 0x6323
-0x609A = 0x6324
-0x609B = 0x632A
-0x609D = 0x6326
-0x609F = 0x4E72
-0x60A0 = 0x5346
-0x60A3 = 0x3B3C
-0x60A6 = 0x5443
-0x60A8 = 0x447A
-0x60AB = 0x6D28
-0x60AC = 0x507C
-0x60AD = 0x6325
-0x60AF = 0x4375
-0x60B1 = 0x632D
-0x60B2 = 0x312F
-0x60B4 = 0x6332
-0x60B8 = 0x3C42
-0x60BB = 0x632C
-0x60BC = 0x353F
-0x60C5 = 0x4769
-0x60C6 = 0x6330
-0x60CA = 0x3E2A
-0x60CB = 0x4D6F
-0x60D1 = 0x3B73
-0x60D5 = 0x4C68
-0x60D8 = 0x632F
-0x60DA = 0x6331
-0x60DC = 0x4F27
-0x60DD = 0x632E
-0x60DF = 0x4E29
-0x60E0 = 0x3B5D
-0x60E6 = 0x356B
-0x60E7 = 0x3E65
-0x60E8 = 0x3252
-0x60E9 = 0x334D
-0x60EB = 0x3139
-0x60EC = 0x632B
-0x60ED = 0x3251
-0x60EE = 0x352C
-0x60EF = 0x395F
-0x60F0 = 0x3668
-0x60F3 = 0x4F6B
-0x60F4 = 0x6337
-0x60F6 = 0x3B4C
-0x60F9 = 0x4847
-0x60FA = 0x504A
-0x6100 = 0x6338
-0x6101 = 0x336E
-0x6106 = 0x6D29
-0x6108 = 0x537A
-0x6109 = 0x5364
-0x610D = 0x6D2A
-0x610E = 0x6339
-0x610F = 0x5262
-0x6115 = 0x6335
-0x611A = 0x535E
-0x611F = 0x3850
-0x6120 = 0x6333
-0x6123 = 0x6336
-0x6124 = 0x375F
-0x6126 = 0x6334
-0x6127 = 0x4022
-0x612B = 0x633A
-0x613F = 0x5438
-0x6148 = 0x3448
-0x614A = 0x633B
-0x614C = 0x3B45
-0x614E = 0x4977
-0x6151 = 0x4965
-0x6155 = 0x443D
-0x615D = 0x6D2B
-0x6162 = 0x427D
-0x6167 = 0x3B5B
-0x6168 = 0x3F2E
-0x6170 = 0x4E3F
-0x6175 = 0x633C
-0x6177 = 0x3F36
-0x618B = 0x316F
-0x618E = 0x5477
-0x6194 = 0x633E
-0x619D = 0x6D2D
-0x61A7 = 0x633F
-0x61A8 = 0x3A29
-0x61A9 = 0x6D2C
-0x61AC = 0x633D
-0x61B7 = 0x6340
-0x61BE = 0x3A36
-0x61C2 = 0x362E
-0x61C8 = 0x5038
-0x61CA = 0x3043
-0x61CB = 0x6D2E
-0x61D1 = 0x6D2F
-0x61D2 = 0x4041
-0x61D4 = 0x6341
-0x61E6 = 0x4533
-0x61F5 = 0x6342
-0x61FF = 0x5C32
-0x6206 = 0x6D30
-0x6208 = 0x386A
-0x620A = 0x4E6C
-0x620B = 0x6A27
-0x620C = 0x5067
-0x620D = 0x4A79
-0x620E = 0x4856
-0x620F = 0x4F37
-0x6210 = 0x3349
-0x6211 = 0x4E52
-0x6212 = 0x3D64
-0x6215 = 0x635E
-0x6216 = 0x3B72
-0x6217 = 0x6A28
-0x6218 = 0x553D
-0x621A = 0x465D
-0x621B = 0x6A29
-0x621F = 0x6A2A
-0x6221 = 0x6A2C
-0x6222 = 0x6A2B
-0x6224 = 0x6A2E
-0x6225 = 0x6A2D
-0x622A = 0x3D58
-0x622C = 0x6A2F
-0x622E = 0x423E
-0x6233 = 0x3441
-0x6234 = 0x3477
-0x6237 = 0x3B27
-0x623D = 0x6C66
-0x623E = 0x6C65
-0x623F = 0x373F
-0x6240 = 0x4B79
-0x6241 = 0x3162
-0x6243 = 0x6C67
-0x6247 = 0x4948
-0x6248 = 0x6C68
-0x6249 = 0x6C69
-0x624B = 0x4A56
-0x624C = 0x5E50
-0x624D = 0x3245
-0x624E = 0x547A
-0x6251 = 0x464B
-0x6252 = 0x3047
-0x6253 = 0x3472
-0x6254 = 0x4853
-0x6258 = 0x4D50
-0x625B = 0x3F38
-0x6263 = 0x3F5B
-0x6266 = 0x4724
-0x6267 = 0x5634
-0x6269 = 0x4029
-0x626A = 0x5E51
-0x626B = 0x4928
-0x626C = 0x516F
-0x626D = 0x4524
-0x626E = 0x3067
-0x626F = 0x3336
-0x6270 = 0x4845
-0x6273 = 0x3062
-0x6276 = 0x3776
-0x6279 = 0x457A
-0x627C = 0x3673
-0x627E = 0x5552
-0x627F = 0x3350
-0x6280 = 0x3C3C
-0x6284 = 0x332D
-0x6289 = 0x3E71
-0x628A = 0x3051
-0x6291 = 0x5256
-0x6292 = 0x4A63
-0x6293 = 0x5725
-0x6295 = 0x4D36
-0x6296 = 0x3636
-0x6297 = 0x3F39
-0x6298 = 0x555B
-0x629A = 0x3827
-0x629B = 0x4557
-0x629F = 0x5E52
-0x62A0 = 0x3F59
-0x62A1 = 0x4255
-0x62A2 = 0x4740
-0x62A4 = 0x3B24
-0x62A5 = 0x3128
-0x62A8 = 0x456A
-0x62AB = 0x457B
-0x62AC = 0x4C27
-0x62B1 = 0x3127
-0x62B5 = 0x3556
-0x62B9 = 0x4428
-0x62BB = 0x5E53
-0x62BC = 0x513A
-0x62BD = 0x3369
-0x62BF = 0x4372
-0x62C2 = 0x3777
-0x62C4 = 0x5674
-0x62C5 = 0x3523
-0x62C6 = 0x3270
-0x62C7 = 0x4434
-0x62C8 = 0x4469
-0x62C9 = 0x402D
-0x62CA = 0x5E54
-0x62CC = 0x3068
-0x62CD = 0x4544
-0x62CE = 0x4160
-0x62D0 = 0x3955
-0x62D2 = 0x3E5C
-0x62D3 = 0x4D58
-0x62D4 = 0x304E
-0x62D6 = 0x4D4F
-0x62D7 = 0x5E56
-0x62D8 = 0x3E50
-0x62D9 = 0x573E
-0x62DA = 0x5E55
-0x62DB = 0x5550
-0x62DC = 0x305D
-0x62DF = 0x4462
-0x62E2 = 0x4223
-0x62E3 = 0x3C70
-0x62E5 = 0x5335
-0x62E6 = 0x4039
-0x62E7 = 0x4521
-0x62E8 = 0x3226
-0x62E9 = 0x5471
-0x62EC = 0x4028
-0x62ED = 0x4A43
-0x62EE = 0x5E57
-0x62EF = 0x557C
-0x62F1 = 0x3930
-0x62F3 = 0x482D
-0x62F4 = 0x4B29
-0x62F6 = 0x5E59
-0x62F7 = 0x3F3D
-0x62FC = 0x4634
-0x62FD = 0x5727
-0x62FE = 0x4A30
-0x62FF = 0x4443
-0x6301 = 0x3356
-0x6302 = 0x3952
-0x6307 = 0x5638
-0x6308 = 0x6A7C
-0x6309 = 0x3034
-0x630E = 0x3F66
-0x6311 = 0x4C74
-0x6316 = 0x4D5A
-0x631A = 0x563F
-0x631B = 0x424E
-0x631D = 0x4E4E
-0x631E = 0x4C22
-0x631F = 0x502E
-0x6320 = 0x4453
-0x6321 = 0x3532
-0x6322 = 0x5E58
-0x6323 = 0x5575
-0x6324 = 0x3C37
-0x6325 = 0x3B53
-0x6328 = 0x3024
-0x632A = 0x4532
-0x632B = 0x346C
-0x632F = 0x5571
-0x6332 = 0x6A7D
-0x6339 = 0x5E5A
-0x633A = 0x4D26
-0x633D = 0x4D6C
-0x6342 = 0x4E66
-0x6343 = 0x5E5C
-0x6345 = 0x4D31
-0x6346 = 0x4026
-0x6349 = 0x573D
-0x634B = 0x5E5B
-0x634C = 0x3046
-0x634D = 0x3A34
-0x634E = 0x4953
-0x634F = 0x4473
-0x6350 = 0x3E68
-0x6355 = 0x3236
-0x635E = 0x404C
-0x635F = 0x4B70
-0x6361 = 0x3C71
-0x6362 = 0x3B3B
-0x6363 = 0x3537
-0x6367 = 0x4575
-0x6369 = 0x5E66
-0x636D = 0x5E63
-0x636E = 0x3E5D
-0x6371 = 0x5E5F
-0x6376 = 0x3437
-0x6377 = 0x3D5D
-0x637A = 0x5E60
-0x637B = 0x446D
-0x6380 = 0x4F46
-0x6382 = 0x3560
-0x6387 = 0x365E
-0x6388 = 0x4A5A
-0x6389 = 0x3574
-0x638A = 0x5E65
-0x638C = 0x5546
-0x638E = 0x5E61
-0x638F = 0x4C4D
-0x6390 = 0x467E
-0x6392 = 0x4545
-0x6396 = 0x5234
-0x6398 = 0x3E72
-0x63A0 = 0x4253
-0x63A2 = 0x4C3D
-0x63A3 = 0x3338
-0x63A5 = 0x3D53
-0x63A7 = 0x3F58
-0x63A8 = 0x4D46
-0x63A9 = 0x515A
-0x63AA = 0x346B
-0x63AC = 0x5E64
-0x63AD = 0x5E5D
-0x63AE = 0x5E67
-0x63B0 = 0x6A7E
-0x63B3 = 0x4230
-0x63B4 = 0x5E62
-0x63B7 = 0x5640
-0x63B8 = 0x3527
-0x63BA = 0x3274
-0x63BC = 0x5E68
-0x63BE = 0x5E72
-0x63C4 = 0x5E6D
-0x63C6 = 0x5E71
-0x63C9 = 0x4860
-0x63CD = 0x5761
-0x63CE = 0x5E6F
-0x63CF = 0x4368
-0x63D0 = 0x4C61
-0x63D2 = 0x3265
-0x63D6 = 0x523E
-0x63DE = 0x5E6E
-0x63E0 = 0x5E6B
-0x63E1 = 0x4E55
-0x63E3 = 0x3427
-0x63E9 = 0x3F2B
-0x63EA = 0x3E3E
-0x63ED = 0x3D52
-0x63F2 = 0x5E69
-0x63F4 = 0x542E
-0x63F6 = 0x5E5E
-0x63F8 = 0x5E6A
-0x63FD = 0x403F
-0x63FF = 0x5E6C
-0x6400 = 0x3273
-0x6401 = 0x3869
-0x6402 = 0x4227
-0x6405 = 0x3D41
-0x640B = 0x5E75
-0x640C = 0x5E78
-0x640F = 0x322B
-0x6410 = 0x3424
-0x6413 = 0x346A
-0x6414 = 0x4926
-0x641B = 0x5E76
-0x641C = 0x4B51
-0x641E = 0x3863
-0x6420 = 0x5E77
-0x6421 = 0x5E7A
-0x6426 = 0x5E79
-0x642A = 0x4C42
-0x642C = 0x3061
-0x642D = 0x346E
-0x6434 = 0x653A
-0x643A = 0x502F
-0x643D = 0x326B
-0x643F = 0x6B21
-0x6441 = 0x5E74
-0x6444 = 0x4963
-0x6445 = 0x5E73
-0x6446 = 0x305A
-0x6447 = 0x5221
-0x6448 = 0x3177
-0x644A = 0x4C2F
-0x6452 = 0x5E70
-0x6454 = 0x4B24
-0x6458 = 0x552A
-0x645E = 0x5E7B
-0x6467 = 0x345D
-0x6469 = 0x4426
-0x646D = 0x5E7D
-0x6478 = 0x437E
-0x6479 = 0x4421
-0x647A = 0x5F21
-0x6482 = 0x414C
-0x6484 = 0x5E7C
-0x6485 = 0x3E6F
-0x6487 = 0x4632
-0x6491 = 0x3345
-0x6492 = 0x4876
-0x6495 = 0x4B3A
-0x6496 = 0x5E7E
-0x6499 = 0x5F24
-0x649E = 0x5732
-0x64A4 = 0x3337
-0x64A9 = 0x4143
-0x64AC = 0x474B
-0x64AD = 0x3225
-0x64AE = 0x3469
-0x64B0 = 0x572B
-0x64B5 = 0x446C
-0x64B7 = 0x5F22
-0x64B8 = 0x5F23
-0x64BA = 0x5F25
-0x64BC = 0x3A33
-0x64C0 = 0x5F26
-0x64C2 = 0x405E
-0x64C5 = 0x4943
-0x64CD = 0x3259
-0x64CE = 0x4766
-0x64D0 = 0x5F27
-0x64D2 = 0x475C
-0x64D7 = 0x5F28
-0x64D8 = 0x6B22
-0x64DE = 0x4B53
-0x64E2 = 0x5F2A
-0x64E4 = 0x5F29
-0x64E6 = 0x3241
-0x6500 = 0x454A
-0x6509 = 0x5F2B
-0x6512 = 0x545C
-0x6518 = 0x4841
-0x6525 = 0x5F2C
-0x652B = 0x3E70
-0x652E = 0x5F2D
-0x652F = 0x5627
-0x6534 = 0x6A37
-0x6535 = 0x6B36
-0x6536 = 0x4A55
-0x6538 = 0x587C
-0x6539 = 0x3844
-0x653B = 0x3925
-0x653E = 0x3745
-0x653F = 0x557E
-0x6545 = 0x394A
-0x6548 = 0x5027
-0x6549 = 0x744D
-0x654C = 0x3550
-0x654F = 0x4374
-0x6551 = 0x3E48
-0x6555 = 0x6B37
-0x6556 = 0x303D
-0x6559 = 0x3D4C
-0x655B = 0x4132
-0x655D = 0x3156
-0x655E = 0x3328
-0x6562 = 0x3852
-0x6563 = 0x4922
-0x6566 = 0x3658
-0x656B = 0x6B38
-0x656C = 0x3E34
-0x6570 = 0x4A7D
-0x6572 = 0x4743
-0x6574 = 0x557B
-0x6577 = 0x3773
-0x6587 = 0x4E44
-0x658B = 0x552B
-0x658C = 0x3173
-0x6590 = 0x6C33
-0x6591 = 0x305F
-0x6593 = 0x6C35
-0x6597 = 0x3637
-0x6599 = 0x414F
-0x659B = 0x757A
-0x659C = 0x5031
-0x659F = 0x5565
-0x65A1 = 0x4E53
-0x65A4 = 0x3D6F
-0x65A5 = 0x3362
-0x65A7 = 0x382B
-0x65A9 = 0x5536
-0x65AB = 0x6D3D
-0x65AD = 0x364F
-0x65AF = 0x4B39
-0x65B0 = 0x5042
-0x65B9 = 0x373D
-0x65BC = 0x6C36
-0x65BD = 0x4A29
-0x65C1 = 0x4554
-0x65C3 = 0x6C39
-0x65C4 = 0x6C38
-0x65C5 = 0x4243
-0x65C6 = 0x6C37
-0x65CB = 0x507D
-0x65CC = 0x6C3A
-0x65CE = 0x6C3B
-0x65CF = 0x5765
-0x65D2 = 0x6C3C
-0x65D6 = 0x6C3D
-0x65D7 = 0x466C
-0x65E0 = 0x4E5E
-0x65E2 = 0x3C48
-0x65E5 = 0x4855
-0x65E6 = 0x3529
-0x65E7 = 0x3E49
-0x65E8 = 0x563C
-0x65E9 = 0x5467
-0x65EC = 0x512E
-0x65ED = 0x5071
-0x65EE = 0x6A38
-0x65EF = 0x6A39
-0x65F0 = 0x6A3A
-0x65F1 = 0x3A35
-0x65F6 = 0x4A31
-0x65F7 = 0x3F75
-0x65FA = 0x4D7A
-0x6600 = 0x6A40
-0x6602 = 0x303A
-0x6603 = 0x6A3E
-0x6606 = 0x4025
-0x660A = 0x6A3B
-0x660C = 0x327D
-0x660E = 0x4377
-0x660F = 0x3B68
-0x6613 = 0x5257
-0x6614 = 0x4E74
-0x6615 = 0x6A3F
-0x6619 = 0x6A3C
-0x661D = 0x6A43
-0x661F = 0x5047
-0x6620 = 0x5333
-0x6625 = 0x343A
-0x6627 = 0x4341
-0x6628 = 0x5772
-0x662D = 0x5551
-0x662F = 0x4A47
-0x6631 = 0x6A45
-0x6634 = 0x6A44
-0x6635 = 0x6A47
-0x6636 = 0x6A46
-0x663C = 0x5667
-0x663E = 0x4F54
-0x6641 = 0x6A4B
-0x6643 = 0x3B4E
-0x664B = 0x3D7A
-0x664C = 0x494E
-0x664F = 0x6A4C
-0x6652 = 0x4939
-0x6653 = 0x4F7E
-0x6654 = 0x6A4A
-0x6655 = 0x544E
-0x6656 = 0x6A4D
-0x6657 = 0x6A4F
-0x665A = 0x4D6D
-0x665F = 0x6A49
-0x6661 = 0x6A4E
-0x6664 = 0x4E6E
-0x6666 = 0x3B5E
-0x6668 = 0x333F
-0x666E = 0x4655
-0x666F = 0x3E30
-0x6670 = 0x4E7A
-0x6674 = 0x4767
-0x6676 = 0x3E27
-0x6677 = 0x6A50
-0x667A = 0x5647
-0x667E = 0x4140
-0x6682 = 0x545D
-0x6684 = 0x6A51
-0x6687 = 0x4F3E
-0x668C = 0x6A52
-0x6691 = 0x4A6E
-0x6696 = 0x452F
-0x6697 = 0x3035
-0x669D = 0x6A54
-0x66A7 = 0x6A53
-0x66A8 = 0x745F
-0x66AE = 0x443A
-0x66B4 = 0x3129
-0x66B9 = 0x655F
-0x66BE = 0x6A55
-0x66D9 = 0x4A6F
-0x66DB = 0x6A56
-0x66DC = 0x6A57
-0x66DD = 0x4658
-0x66E6 = 0x6A58
-0x66E9 = 0x6A59
-0x66F0 = 0x543B
-0x66F2 = 0x477A
-0x66F3 = 0x5237
-0x66F4 = 0x387C
-0x66F7 = 0x6A42
-0x66F9 = 0x325C
-0x66FC = 0x427C
-0x66FE = 0x5478
-0x66FF = 0x4C66
-0x6700 = 0x576E
-0x6708 = 0x5442
-0x6709 = 0x5350
-0x670A = 0x6B43
-0x670B = 0x4573
-0x670D = 0x377E
-0x6710 = 0x6B54
-0x6714 = 0x4B37
-0x6715 = 0x6B5E
-0x6717 = 0x404A
-0x671B = 0x4D7B
-0x671D = 0x332F
-0x671F = 0x465A
-0x6726 = 0x6B7C
-0x6728 = 0x443E
-0x672A = 0x4E34
-0x672B = 0x4429
-0x672C = 0x313E
-0x672D = 0x547D
-0x672F = 0x4A75
-0x6731 = 0x566C
-0x6734 = 0x4653
-0x6735 = 0x3664
-0x673A = 0x3B7A
-0x673D = 0x5060
-0x6740 = 0x4931
-0x6742 = 0x5453
-0x6743 = 0x4828
-0x6746 = 0x384B
-0x6748 = 0x683E
-0x6749 = 0x493C
-0x674C = 0x683B
-0x674E = 0x406E
-0x674F = 0x5053
-0x6750 = 0x3244
-0x6751 = 0x3465
-0x6753 = 0x683C
-0x6756 = 0x5548
-0x675C = 0x3645
-0x675E = 0x683D
-0x675F = 0x4A78
-0x6760 = 0x385C
-0x6761 = 0x4C75
-0x6765 = 0x4034
-0x6768 = 0x516E
-0x6769 = 0x683F
-0x676A = 0x6842
-0x676D = 0x3A3C
-0x676F = 0x312D
-0x6770 = 0x3D5C
-0x6772 = 0x6A3D
-0x6773 = 0x6843
-0x6775 = 0x6846
-0x6777 = 0x684B
-0x677C = 0x684C
-0x677E = 0x4B49
-0x677F = 0x3065
-0x6781 = 0x3C2B
-0x6784 = 0x3939
-0x6787 = 0x6841
-0x6789 = 0x4D77
-0x678B = 0x684A
-0x6790 = 0x4E76
-0x6795 = 0x556D
-0x6797 = 0x4156
-0x6798 = 0x6844
-0x679A = 0x4336
-0x679C = 0x397B
-0x679D = 0x5626
-0x679E = 0x6848
-0x67A2 = 0x4A60
-0x67A3 = 0x5466
-0x67A5 = 0x6840
-0x67A7 = 0x6845
-0x67A8 = 0x6847
-0x67AA = 0x4739
-0x67AB = 0x3763
-0x67AD = 0x6849
-0x67AF = 0x3F5D
-0x67B0 = 0x6852
-0x67B3 = 0x6857
-0x67B5 = 0x6855
-0x67B6 = 0x3C5C
-0x67B7 = 0x3C4F
-0x67B8 = 0x685B
-0x67C1 = 0x685E
-0x67C3 = 0x685A
-0x67C4 = 0x317A
-0x67CF = 0x3058
-0x67D0 = 0x4433
-0x67D1 = 0x384C
-0x67D2 = 0x4662
-0x67D3 = 0x483E
-0x67D4 = 0x4861
-0x67D8 = 0x684F
-0x67D9 = 0x6854
-0x67DA = 0x6856
-0x67DC = 0x3971
-0x67DD = 0x6858
-0x67DE = 0x5775
-0x67E0 = 0x447B
-0x67E2 = 0x685C
-0x67E5 = 0x3269
-0x67E9 = 0x6851
-0x67EC = 0x3C6D
-0x67EF = 0x3F42
-0x67F0 = 0x684D
-0x67F1 = 0x5679
-0x67F3 = 0x4178
-0x67F4 = 0x3271
-0x67FD = 0x685F
-0x67FF = 0x4A41
-0x6800 = 0x6859
-0x6805 = 0x5524
-0x6807 = 0x316A
-0x6808 = 0x553B
-0x6809 = 0x684E
-0x680A = 0x6850
-0x680B = 0x3630
-0x680C = 0x6853
-0x680E = 0x685D
-0x680F = 0x4038
-0x6811 = 0x4A77
-0x6813 = 0x4B28
-0x6816 = 0x465C
-0x6817 = 0x4075
-0x681D = 0x6869
-0x6821 = 0x5023
-0x6829 = 0x6872
-0x682A = 0x566A
-0x6832 = 0x6860
-0x6833 = 0x6861
-0x6837 = 0x5179
-0x6838 = 0x3A4B
-0x6839 = 0x3879
-0x683C = 0x3871
-0x683D = 0x5454
-0x683E = 0x686F
-0x6840 = 0x686E
-0x6841 = 0x686C
-0x6842 = 0x3970
-0x6843 = 0x4C52
-0x6844 = 0x6866
-0x6845 = 0x4E26
-0x6846 = 0x3F72
-0x6848 = 0x3038
-0x6849 = 0x6871
-0x684A = 0x6870
-0x684C = 0x5740
-0x684E = 0x6864
-0x6850 = 0x4D29
-0x6851 = 0x4923
-0x6853 = 0x3B38
-0x6854 = 0x3D5B
-0x6855 = 0x686A
-0x6860 = 0x6862
-0x6861 = 0x6863
-0x6862 = 0x6865
-0x6863 = 0x3535
-0x6864 = 0x6867
-0x6865 = 0x4745
-0x6866 = 0x686B
-0x6867 = 0x686D
-0x6868 = 0x3D30
-0x6869 = 0x572E
-0x686B = 0x6878
-0x6874 = 0x6875
-0x6876 = 0x4D30
-0x6877 = 0x6876
-0x6881 = 0x413A
-0x6883 = 0x6868
-0x6885 = 0x4337
-0x6886 = 0x3070
-0x688F = 0x6874
-0x6893 = 0x6877
-0x6897 = 0x3923
-0x68A2 = 0x4952
-0x68A6 = 0x434E
-0x68A7 = 0x4E60
-0x68A8 = 0x4066
-0x68AD = 0x4B73
-0x68AF = 0x4C5D
-0x68B0 = 0x5035
-0x68B3 = 0x4A61
-0x68B5 = 0x6873
-0x68C0 = 0x3C6C
-0x68C2 = 0x6879
-0x68C9 = 0x435E
-0x68CB = 0x4665
-0x68CD = 0x3977
-0x68D2 = 0x3074
-0x68D5 = 0x5758
-0x68D8 = 0x3C2C
-0x68DA = 0x456F
-0x68E0 = 0x4C44
-0x68E3 = 0x6926
-0x68EE = 0x492D
-0x68F0 = 0x6922
-0x68F1 = 0x4062
-0x68F5 = 0x3F43
-0x68F9 = 0x687E
-0x68FA = 0x3957
-0x68FC = 0x687B
-0x6901 = 0x6924
-0x6905 = 0x524E
-0x690B = 0x6923
-0x690D = 0x5632
-0x690E = 0x5735
-0x6910 = 0x6927
-0x6912 = 0x3D37
-0x691F = 0x687C
-0x6920 = 0x687D
-0x6924 = 0x6921
-0x692D = 0x4D56
-0x6930 = 0x522C
-0x6934 = 0x6932
-0x6939 = 0x6929
-0x693D = 0x342A
-0x693F = 0x343B
-0x6942 = 0x692B
-0x6954 = 0x5028
-0x6957 = 0x6925
-0x695A = 0x337E
-0x695D = 0x692C
-0x695E = 0x4063
-0x6960 = 0x692A
-0x6963 = 0x6939
-0x6966 = 0x6938
-0x696B = 0x692E
-0x696E = 0x687A
-0x6971 = 0x6928
-0x6977 = 0x3F2C
-0x6978 = 0x6931
-0x6979 = 0x693A
-0x697C = 0x4225
-0x6980 = 0x692F
-0x6982 = 0x3845
-0x6984 = 0x692D
-0x6986 = 0x535C
-0x6987 = 0x6934
-0x6988 = 0x6935
-0x6989 = 0x6937
-0x698D = 0x6947
-0x6994 = 0x4046
-0x6995 = 0x6945
-0x6998 = 0x6930
-0x699B = 0x693B
-0x699C = 0x3071
-0x69A7 = 0x693C
-0x69A8 = 0x5525
-0x69AB = 0x693E
-0x69AD = 0x693F
-0x69B1 = 0x6941
-0x69B4 = 0x4171
-0x69B7 = 0x4836
-0x69BB = 0x693D
-0x69C1 = 0x6942
-0x69CA = 0x6943
-0x69CC = 0x6933
-0x69CE = 0x6936
-0x69D0 = 0x3B31
-0x69D4 = 0x6940
-0x69DB = 0x3C77
-0x69DF = 0x6944
-0x69E0 = 0x6946
-0x69ED = 0x694A
-0x69F2 = 0x694E
-0x69FD = 0x325B
-0x69FF = 0x6948
-0x6A0A = 0x372E
-0x6A17 = 0x694B
-0x6A18 = 0x694C
-0x6A1F = 0x5541
-0x6A21 = 0x4423
-0x6A28 = 0x6958
-0x6A2A = 0x3A61
-0x6A2F = 0x6949
-0x6A31 = 0x5323
-0x6A35 = 0x6954
-0x6A3D = 0x6957
-0x6A3E = 0x6950
-0x6A44 = 0x694F
-0x6A47 = 0x4741
-0x6A50 = 0x6952
-0x6A58 = 0x6959
-0x6A59 = 0x3348
-0x6A5B = 0x6953
-0x6A61 = 0x4F70
-0x6A65 = 0x694D
-0x6A71 = 0x3377
-0x6A79 = 0x6956
-0x6A7C = 0x695A
-0x6A80 = 0x4C34
-0x6A84 = 0x4F2D
-0x6A8E = 0x6955
-0x6A90 = 0x695C
-0x6A91 = 0x695B
-0x6A97 = 0x695E
-0x6AA0 = 0x6951
-0x6AA9 = 0x695D
-0x6AAB = 0x695F
-0x6AAC = 0x434A
-0x6B20 = 0x4737
-0x6B21 = 0x344E
-0x6B22 = 0x3B36
-0x6B23 = 0x5040
-0x6B24 = 0x6C23
-0x6B27 = 0x4537
-0x6B32 = 0x537B
-0x6B37 = 0x6C24
-0x6B39 = 0x6C25
-0x6B3A = 0x465B
-0x6B3E = 0x3F6E
-0x6B43 = 0x6C26
-0x6B46 = 0x6C27
-0x6B47 = 0x502A
-0x6B49 = 0x4738
-0x6B4C = 0x3868
-0x6B59 = 0x6C28
-0x6B62 = 0x5639
-0x6B63 = 0x557D
-0x6B64 = 0x344B
-0x6B65 = 0x323D
-0x6B66 = 0x4E64
-0x6B67 = 0x4667
-0x6B6A = 0x4D61
-0x6B79 = 0x3475
-0x6B7B = 0x4B40
-0x6B7C = 0x3C5F
-0x6B81 = 0x6962
-0x6B82 = 0x6963
-0x6B83 = 0x516A
-0x6B84 = 0x6965
-0x6B86 = 0x3479
-0x6B87 = 0x6964
-0x6B89 = 0x5133
-0x6B8A = 0x4A62
-0x6B8B = 0x3250
-0x6B8D = 0x6968
-0x6B92 = 0x6966
-0x6B93 = 0x6967
-0x6B96 = 0x5633
-0x6B9A = 0x6969
-0x6B9B = 0x696A
-0x6BA1 = 0x696B
-0x6BAA = 0x696C
-0x6BB3 = 0x6C2F
-0x6BB4 = 0x4539
-0x6BB5 = 0x364E
-0x6BB7 = 0x5273
-0x6BBF = 0x356E
-0x6BC1 = 0x3B59
-0x6BC2 = 0x6C31
-0x6BC5 = 0x5263
-0x6BCB = 0x4E63
-0x6BCD = 0x4438
-0x6BCF = 0x433F
-0x6BD2 = 0x363E
-0x6BD3 = 0x5839
-0x6BD4 = 0x3148
-0x6BD5 = 0x314F
-0x6BD6 = 0x3151
-0x6BD7 = 0x457E
-0x6BD9 = 0x3150
-0x6BDB = 0x432B
-0x6BE1 = 0x5531
-0x6BEA = 0x6B24
-0x6BEB = 0x3A41
-0x6BEF = 0x4C3A
-0x6BF3 = 0x6B25
-0x6BF5 = 0x6B27
-0x6BF9 = 0x6B28
-0x6BFD = 0x6B26
-0x6C05 = 0x6B29
-0x6C06 = 0x6B2B
-0x6C07 = 0x6B2A
-0x6C0D = 0x6B2C
-0x6C0F = 0x4A4F
-0x6C10 = 0x5835
-0x6C11 = 0x4371
-0x6C13 = 0x4325
-0x6C14 = 0x4678
-0x6C15 = 0x6B2D
-0x6C16 = 0x444A
-0x6C18 = 0x6B2E
-0x6C19 = 0x6B2F
-0x6C1A = 0x6B30
-0x6C1B = 0x3755
-0x6C1F = 0x377A
-0x6C21 = 0x6B31
-0x6C22 = 0x4762
-0x6C24 = 0x6B33
-0x6C26 = 0x3A24
-0x6C27 = 0x5175
-0x6C28 = 0x3031
-0x6C29 = 0x6B32
-0x6C2A = 0x6B34
-0x6C2E = 0x352A
-0x6C2F = 0x4248
-0x6C30 = 0x4768
-0x6C32 = 0x6B35
-0x6C34 = 0x4B2E
-0x6C35 = 0x635F
-0x6C38 = 0x5340
-0x6C3D = 0x595B
-0x6C40 = 0x4D21
-0x6C41 = 0x562D
-0x6C42 = 0x4773
-0x6C46 = 0x5960
-0x6C47 = 0x3B63
-0x6C49 = 0x3A3A
-0x6C4A = 0x6362
-0x6C50 = 0x4F2B
-0x6C54 = 0x6360
-0x6C55 = 0x4947
-0x6C57 = 0x3A39
-0x6C5B = 0x5134
-0x6C5C = 0x6361
-0x6C5D = 0x486A
-0x6C5E = 0x392F
-0x6C5F = 0x3D2D
-0x6C60 = 0x3358
-0x6C61 = 0x4E5B
-0x6C64 = 0x4C40
-0x6C68 = 0x6368
-0x6C69 = 0x6369
-0x6C6A = 0x4D74
-0x6C70 = 0x4C2D
-0x6C72 = 0x3C33
-0x6C74 = 0x636A
-0x6C76 = 0x636B
-0x6C79 = 0x505A
-0x6C7D = 0x467B
-0x6C7E = 0x375A
-0x6C81 = 0x475F
-0x6C82 = 0x524A
-0x6C83 = 0x4E56
-0x6C85 = 0x6364
-0x6C86 = 0x636C
-0x6C88 = 0x4972
-0x6C89 = 0x3341
-0x6C8C = 0x6367
-0x6C8F = 0x4663
-0x6C90 = 0x6365
-0x6C93 = 0x6D33
-0x6C94 = 0x6366
-0x6C99 = 0x4933
-0x6C9B = 0x4566
-0x6C9F = 0x3935
-0x6CA1 = 0x433B
-0x6CA3 = 0x6363
-0x6CA4 = 0x453D
-0x6CA5 = 0x4124
-0x6CA6 = 0x4259
-0x6CA7 = 0x3257
-0x6CA9 = 0x636D
-0x6CAA = 0x3B26
-0x6CAB = 0x442D
-0x6CAD = 0x6370
-0x6CAE = 0x3E5A
-0x6CB1 = 0x637B
-0x6CB2 = 0x6375
-0x6CB3 = 0x3A53
-0x6CB8 = 0x3750
-0x6CB9 = 0x534D
-0x6CBB = 0x564E
-0x6CBC = 0x5553
-0x6CBD = 0x3941
-0x6CBE = 0x5534
-0x6CBF = 0x5158
-0x6CC4 = 0x5039
-0x6CC5 = 0x4776
-0x6CC9 = 0x482A
-0x6CCA = 0x3234
-0x6CCC = 0x435A
-0x6CD0 = 0x636E
-0x6CD3 = 0x637C
-0x6CD4 = 0x636F
-0x6CD5 = 0x3728
-0x6CD6 = 0x6377
-0x6CD7 = 0x6374
-0x6CDB = 0x373A
-0x6CDE = 0x4522
-0x6CE0 = 0x6376
-0x6CE1 = 0x455D
-0x6CE2 = 0x3228
-0x6CE3 = 0x467C
-0x6CE5 = 0x4460
-0x6CE8 = 0x5722
-0x6CEA = 0x4061
-0x6CEB = 0x6379
-0x6CEE = 0x637A
-0x6CEF = 0x637D
-0x6CF0 = 0x4C29
-0x6CF1 = 0x6373
-0x6CF3 = 0x533E
-0x6CF5 = 0x3143
-0x6CF6 = 0x6D34
-0x6CF7 = 0x6371
-0x6CF8 = 0x6372
-0x6CFA = 0x6378
-0x6CFB = 0x503A
-0x6CFC = 0x4643
-0x6CFD = 0x5473
-0x6CFE = 0x637E
-0x6D01 = 0x3D60
-0x6D04 = 0x6427
-0x6D07 = 0x6426
-0x6D0B = 0x5173
-0x6D0C = 0x6423
-0x6D0E = 0x6429
-0x6D12 = 0x4877
-0x6D17 = 0x4F34
-0x6D19 = 0x6428
-0x6D1A = 0x642E
-0x6D1B = 0x4265
-0x6D1E = 0x3634
-0x6D25 = 0x3D72
-0x6D27 = 0x6422
-0x6D2A = 0x3A69
-0x6D2B = 0x642A
-0x6D2E = 0x642C
-0x6D31 = 0x367D
-0x6D32 = 0x565E
-0x6D33 = 0x6432
-0x6D35 = 0x642D
-0x6D39 = 0x6421
-0x6D3B = 0x3B6E
-0x6D3C = 0x4D5D
-0x6D3D = 0x4722
-0x6D3E = 0x4549
-0x6D41 = 0x4177
-0x6D43 = 0x6424
-0x6D45 = 0x4733
-0x6D46 = 0x3D2C
-0x6D47 = 0x3D3D
-0x6D48 = 0x6425
-0x6D4A = 0x5747
-0x6D4B = 0x3262
-0x6D4D = 0x642B
-0x6D4E = 0x3C43
-0x6D4F = 0x642F
-0x6D51 = 0x3B6B
-0x6D52 = 0x6430
-0x6D53 = 0x4528
-0x6D54 = 0x6431
-0x6D59 = 0x5563
-0x6D5A = 0x3F23
-0x6D5C = 0x643A
-0x6D5E = 0x6437
-0x6D60 = 0x643B
-0x6D63 = 0x643D
-0x6D66 = 0x4656
-0x6D69 = 0x3A46
-0x6D6A = 0x404B
-0x6D6E = 0x3821
-0x6D6F = 0x6434
-0x6D74 = 0x5421
-0x6D77 = 0x3A23
-0x6D78 = 0x3D7E
-0x6D7C = 0x643C
-0x6D82 = 0x4D3F
-0x6D85 = 0x4479
-0x6D88 = 0x4F7B
-0x6D89 = 0x4966
-0x6D8C = 0x533F
-0x6D8E = 0x4F51
-0x6D91 = 0x6433
-0x6D93 = 0x6438
-0x6D94 = 0x6439
-0x6D95 = 0x4C69
-0x6D9B = 0x4C4E
-0x6D9D = 0x4054
-0x6D9E = 0x6435
-0x6D9F = 0x4130
-0x6DA0 = 0x6436
-0x6DA1 = 0x4E50
-0x6DA3 = 0x3B41
-0x6DA4 = 0x3553
-0x6DA6 = 0x4873
-0x6DA7 = 0x3D27
-0x6DA8 = 0x5547
-0x6DA9 = 0x492C
-0x6DAA = 0x3822
-0x6DAB = 0x644A
-0x6DAE = 0x644C
-0x6DAF = 0x5144
-0x6DB2 = 0x523A
-0x6DB5 = 0x3A2D
-0x6DB8 = 0x3A54
-0x6DBF = 0x6443
-0x6DC0 = 0x356D
-0x6DC4 = 0x574D
-0x6DC5 = 0x6440
-0x6DC6 = 0x4F7D
-0x6DC7 = 0x643F
-0x6DCB = 0x415C
-0x6DCC = 0x4C4A
-0x6DD1 = 0x4A67
-0x6DD6 = 0x4457
-0x6DD8 = 0x4C54
-0x6DD9 = 0x6448
-0x6DDD = 0x6447
-0x6DDE = 0x6441
-0x6DE0 = 0x6444
-0x6DE1 = 0x352D
-0x6DE4 = 0x5359
-0x6DE6 = 0x6446
-0x6DEB = 0x5279
-0x6DEC = 0x3463
-0x6DEE = 0x3B34
-0x6DF1 = 0x496E
-0x6DF3 = 0x343E
-0x6DF7 = 0x3B6C
-0x6DF9 = 0x514D
-0x6DFB = 0x4C6D
-0x6DFC = 0x6D35
-0x6E05 = 0x4765
-0x6E0A = 0x5428
-0x6E0C = 0x644B
-0x6E0D = 0x5755
-0x6E0E = 0x6442
-0x6E10 = 0x3D25
-0x6E11 = 0x6445
-0x6E14 = 0x5366
-0x6E16 = 0x6449
-0x6E17 = 0x4978
-0x6E1A = 0x643E
-0x6E1D = 0x5365
-0x6E20 = 0x477E
-0x6E21 = 0x3649
-0x6E23 = 0x547C
-0x6E24 = 0x3233
-0x6E25 = 0x6457
-0x6E29 = 0x4E42
-0x6E2B = 0x644D
-0x6E2D = 0x4E3C
-0x6E2F = 0x385B
-0x6E32 = 0x6456
-0x6E34 = 0x3F4A
-0x6E38 = 0x534E
-0x6E3A = 0x436C
-0x6E43 = 0x4548
-0x6E44 = 0x6458
-0x6E4D = 0x4D44
-0x6E4E = 0x644F
-0x6E53 = 0x6454
-0x6E54 = 0x6455
-0x6E56 = 0x3A7E
-0x6E58 = 0x4F66
-0x6E5B = 0x553F
-0x6E5F = 0x6452
-0x6E6B = 0x6450
-0x6E6E = 0x644E
-0x6E7E = 0x4D65
-0x6E7F = 0x4A2A
-0x6E83 = 0x4023
-0x6E85 = 0x3D26
-0x6E86 = 0x6453
-0x6E89 = 0x3848
-0x6E8F = 0x6467
-0x6E90 = 0x5434
-0x6E98 = 0x645B
-0x6E9C = 0x416F
-0x6E9F = 0x6469
-0x6EA2 = 0x5267
-0x6EA5 = 0x645F
-0x6EA7 = 0x6460
-0x6EAA = 0x4F2A
-0x6EAF = 0x4B5D
-0x6EB1 = 0x645A
-0x6EB2 = 0x6451
-0x6EB4 = 0x6465
-0x6EB6 = 0x485C
-0x6EB7 = 0x6463
-0x6EBA = 0x4467
-0x6EBB = 0x6462
-0x6EBD = 0x6461
-0x6EC1 = 0x337C
-0x6EC2 = 0x6468
-0x6EC7 = 0x3561
-0x6ECB = 0x574C
-0x6ECF = 0x6466
-0x6ED1 = 0x3B2C
-0x6ED3 = 0x5752
-0x6ED4 = 0x4C4F
-0x6ED5 = 0x6B78
-0x6ED7 = 0x6464
-0x6EDA = 0x3976
-0x6EDE = 0x564D
-0x6EDF = 0x6459
-0x6EE0 = 0x645C
-0x6EE1 = 0x427A
-0x6EE2 = 0x645E
-0x6EE4 = 0x424B
-0x6EE5 = 0x4044
-0x6EE6 = 0x4250
-0x6EE8 = 0x3175
-0x6EE9 = 0x4C32
-0x6EF4 = 0x354E
-0x6EF9 = 0x646F
-0x6F02 = 0x462F
-0x6F06 = 0x4661
-0x6F09 = 0x6475
-0x6F0F = 0x4229
-0x6F13 = 0x406C
-0x6F14 = 0x515D
-0x6F15 = 0x646E
-0x6F20 = 0x442E
-0x6F24 = 0x646D
-0x6F29 = 0x6476
-0x6F2A = 0x6474
-0x6F2B = 0x427E
-0x6F2D = 0x645D
-0x6F2F = 0x6470
-0x6F31 = 0x4A7E
-0x6F33 = 0x5544
-0x6F36 = 0x6471
-0x6F3E = 0x517A
-0x6F46 = 0x646B
-0x6F47 = 0x646C
-0x6F4B = 0x6472
-0x6F4D = 0x4E2B
-0x6F58 = 0x454B
-0x6F5C = 0x4731
-0x6F5E = 0x423A
-0x6F62 = 0x646A
-0x6F66 = 0x414A
-0x6F6D = 0x4C36
-0x6F6E = 0x3331
-0x6F72 = 0x647B
-0x6F74 = 0x6473
-0x6F78 = 0x647A
-0x6F7A = 0x647D
-0x6F7C = 0x647C
-0x6F84 = 0x334E
-0x6F88 = 0x333A
-0x6F89 = 0x6477
-0x6F8C = 0x6479
-0x6F8D = 0x6478
-0x6F8E = 0x456C
-0x6F9C = 0x403D
-0x6FA1 = 0x5468
-0x6FA7 = 0x6522
-0x6FB3 = 0x3044
-0x6FB6 = 0x6524
-0x6FB9 = 0x6523
-0x6FC0 = 0x3C24
-0x6FC2 = 0x6525
-0x6FC9 = 0x6521
-0x6FD1 = 0x647E
-0x6FD2 = 0x3174
-0x6FDE = 0x6528
-0x6FE0 = 0x6529
-0x6FE1 = 0x6526
-0x6FEE = 0x6527
-0x6FEF = 0x652A
-0x7011 = 0x4659
-0x701A = 0x652B
-0x701B = 0x652D
-0x7023 = 0x652C
-0x7035 = 0x652F
-0x7039 = 0x652E
-0x704C = 0x3960
-0x704F = 0x6530
-0x705E = 0x6531
-0x706B = 0x3B70
-0x706C = 0x6C61
-0x706D = 0x4370
-0x706F = 0x3546
-0x7070 = 0x3B52
-0x7075 = 0x4169
-0x7076 = 0x546E
-0x7078 = 0x3E44
-0x707C = 0x5746
-0x707E = 0x5456
-0x707F = 0x3253
-0x7080 = 0x6C3E
-0x7085 = 0x6A41
-0x7089 = 0x422F
-0x708A = 0x3436
-0x708E = 0x5157
-0x7092 = 0x3334
-0x7094 = 0x4832
-0x7095 = 0x3F3B
-0x7096 = 0x6C40
-0x7099 = 0x564B
-0x709C = 0x6C3F
-0x709D = 0x6C41
-0x70AB = 0x6C45
-0x70AC = 0x3E66
-0x70AD = 0x4C3F
-0x70AE = 0x455A
-0x70AF = 0x3E3C
-0x70B1 = 0x6C46
-0x70B3 = 0x317E
-0x70B7 = 0x6C44
-0x70B8 = 0x5528
-0x70B9 = 0x3563
-0x70BB = 0x6C42
-0x70BC = 0x4136
-0x70BD = 0x3363
-0x70C0 = 0x6C43
-0x70C1 = 0x4B38
-0x70C2 = 0x4043
-0x70C3 = 0x4C7E
-0x70C8 = 0x4152
-0x70CA = 0x6C48
-0x70D8 = 0x3A66
-0x70D9 = 0x4053
-0x70DB = 0x5672
-0x70DF = 0x514C
-0x70E4 = 0x3F3E
-0x70E6 = 0x3733
-0x70E7 = 0x4955
-0x70E8 = 0x6C47
-0x70E9 = 0x3B62
-0x70EB = 0x4C4C
-0x70EC = 0x3D7D
-0x70ED = 0x4848
-0x70EF = 0x4F29
-0x70F7 = 0x4D69
-0x70F9 = 0x456B
-0x70FD = 0x3769
-0x7109 = 0x5149
-0x710A = 0x3A38
-0x7110 = 0x6C49
-0x7113 = 0x6C4A
-0x7115 = 0x3B40
-0x7116 = 0x6C4B
-0x7118 = 0x6C62
-0x7119 = 0x313A
-0x711A = 0x3759
-0x7126 = 0x3D39
-0x712F = 0x6C4C
-0x7130 = 0x5166
-0x7131 = 0x6C4D
-0x7136 = 0x483B
-0x7145 = 0x6C51
-0x714A = 0x6C53
-0x714C = 0x3B4D
-0x714E = 0x3C65
-0x715C = 0x6C4F
-0x715E = 0x4937
-0x7164 = 0x433A
-0x7166 = 0x6C63
-0x7167 = 0x5555
-0x7168 = 0x6C50
-0x716E = 0x5673
-0x7172 = 0x6C52
-0x7173 = 0x6C4E
-0x7178 = 0x6C54
-0x717A = 0x6C55
-0x717D = 0x493F
-0x7184 = 0x4F28
-0x718A = 0x505C
-0x718F = 0x512C
-0x7194 = 0x485B
-0x7198 = 0x6C56
-0x7199 = 0x4E75
-0x719F = 0x4A6C
-0x71A0 = 0x6C5A
-0x71A8 = 0x6C59
-0x71AC = 0x303E
-0x71B3 = 0x6C57
-0x71B5 = 0x6C58
-0x71B9 = 0x6C64
-0x71C3 = 0x483C
-0x71CE = 0x4147
-0x71D4 = 0x6C5C
-0x71D5 = 0x5160
-0x71E0 = 0x6C5B
-0x71E5 = 0x546F
-0x71E7 = 0x6C5D
-0x71EE = 0x5B46
-0x71F9 = 0x6C5E
-0x7206 = 0x312C
-0x721D = 0x6C5F
-0x7228 = 0x6C60
-0x722A = 0x5726
-0x722C = 0x4540
-0x7230 = 0x6B3C
-0x7231 = 0x302E
-0x7235 = 0x3E74
-0x7236 = 0x3838
-0x7237 = 0x522F
-0x7238 = 0x3056
-0x7239 = 0x3579
-0x723B = 0x5833
-0x723D = 0x4B2C
-0x723F = 0x635D
-0x7247 = 0x462C
-0x7248 = 0x3066
-0x724C = 0x4546
-0x724D = 0x6B39
-0x7252 = 0x6B3A
-0x7256 = 0x6B3B
-0x7259 = 0x5140
-0x725B = 0x4523
-0x725D = 0x6A72
-0x725F = 0x4432
-0x7261 = 0x4435
-0x7262 = 0x404E
-0x7266 = 0x6A73
-0x7267 = 0x4441
-0x7269 = 0x4E6F
-0x726E = 0x6A70
-0x726F = 0x6A74
-0x7272 = 0x497C
-0x7275 = 0x4723
-0x7279 = 0x4C58
-0x727A = 0x4E7E
-0x727E = 0x6A75
-0x727F = 0x6A76
-0x7280 = 0x4F2C
-0x7281 = 0x4067
-0x7284 = 0x6A77
-0x728A = 0x363F
-0x728B = 0x6A78
-0x728D = 0x6A79
-0x728F = 0x6A7A
-0x7292 = 0x6A7B
-0x729F = 0x6A71
-0x72AC = 0x482E
-0x72AD = 0x616B
-0x72AF = 0x3738
-0x72B0 = 0x616C
-0x72B4 = 0x616D
-0x72B6 = 0x5734
-0x72B7 = 0x616E
-0x72B8 = 0x616F
-0x72B9 = 0x534C
-0x72C1 = 0x6171
-0x72C2 = 0x3F71
-0x72C3 = 0x6170
-0x72C4 = 0x3552
-0x72C8 = 0x3137
-0x72CD = 0x6173
-0x72CE = 0x6172
-0x72D0 = 0x3A7C
-0x72D2 = 0x6174
-0x72D7 = 0x3937
-0x72D9 = 0x3E51
-0x72DE = 0x447C
-0x72E0 = 0x3A5D
-0x72E1 = 0x3D46
-0x72E8 = 0x6175
-0x72E9 = 0x6177
-0x72EC = 0x3640
-0x72ED = 0x4F41
-0x72EE = 0x4A28
-0x72EF = 0x6176
-0x72F0 = 0x5578
-0x72F1 = 0x537C
-0x72F2 = 0x6178
-0x72F3 = 0x617C
-0x72F4 = 0x6179
-0x72F7 = 0x617A
-0x72F8 = 0x406A
-0x72FA = 0x617E
-0x72FB = 0x6221
-0x72FC = 0x4047
-0x7301 = 0x617B
-0x7303 = 0x617D
-0x730A = 0x6225
-0x730E = 0x4154
-0x7313 = 0x6223
-0x7315 = 0x6228
-0x7316 = 0x327E
-0x7317 = 0x6222
-0x731B = 0x434D
-0x731C = 0x3242
-0x731D = 0x6227
-0x731E = 0x6226
-0x7321 = 0x6224
-0x7322 = 0x6229
-0x7325 = 0x622B
-0x7329 = 0x5049
-0x732A = 0x566D
-0x732B = 0x4328
-0x732C = 0x622C
-0x732E = 0x4F57
-0x7331 = 0x622E
-0x7334 = 0x3A6F
-0x7337 = 0x6960
-0x7338 = 0x622D
-0x7339 = 0x622A
-0x733E = 0x3B2B
-0x733F = 0x5433
-0x734D = 0x6230
-0x7350 = 0x622F
-0x7352 = 0x6961
-0x7357 = 0x6231
-0x7360 = 0x6232
-0x736C = 0x6233
-0x736D = 0x4C21
-0x736F = 0x6234
-0x737E = 0x6235
-0x7384 = 0x507E
-0x7387 = 0x424A
-0x7389 = 0x5371
-0x738B = 0x4D75
-0x738E = 0x6760
-0x7391 = 0x6761
-0x7396 = 0x3E41
-0x739B = 0x426A
-0x739F = 0x6764
-0x73A2 = 0x6763
-0x73A9 = 0x4D66
-0x73AB = 0x4335
-0x73AE = 0x6762
-0x73AF = 0x3B37
-0x73B0 = 0x4F56
-0x73B2 = 0x4161
-0x73B3 = 0x6769
-0x73B7 = 0x6768
-0x73BA = 0x6774
-0x73BB = 0x3223
-0x73C0 = 0x676A
-0x73C2 = 0x6766
-0x73C8 = 0x676C
-0x73C9 = 0x676B
-0x73CA = 0x493A
-0x73CD = 0x5564
-0x73CF = 0x6765
-0x73D0 = 0x3729
-0x73D1 = 0x6767
-0x73D9 = 0x676E
-0x73DE = 0x6773
-0x73E0 = 0x5669
-0x73E5 = 0x676D
-0x73E7 = 0x6772
-0x73E9 = 0x6771
-0x73ED = 0x3060
-0x73F2 = 0x6775
-0x7403 = 0x4772
-0x7405 = 0x4045
-0x7406 = 0x406D
-0x7409 = 0x4170
-0x740A = 0x6770
-0x740F = 0x6776
-0x7410 = 0x4B76
-0x741A = 0x6822
-0x741B = 0x6821
-0x7422 = 0x5741
-0x7425 = 0x677A
-0x7426 = 0x6779
-0x7428 = 0x677B
-0x742A = 0x6777
-0x742C = 0x677E
-0x742E = 0x677D
-0x7430 = 0x677C
-0x7433 = 0x4155
-0x7434 = 0x4759
-0x7435 = 0x457D
-0x7436 = 0x4543
-0x743C = 0x476D
-0x7441 = 0x6823
-0x7455 = 0x6826
-0x7457 = 0x6825
-0x7459 = 0x6827
-0x745A = 0x3A77
-0x745B = 0x6778
-0x745C = 0x6824
-0x745E = 0x4870
-0x745F = 0x492A
-0x746D = 0x6829
-0x7470 = 0x3965
-0x7476 = 0x517E
-0x7477 = 0x6828
-0x747E = 0x682A
-0x7480 = 0x682D
-0x7481 = 0x682E
-0x7483 = 0x4127
-0x7487 = 0x682F
-0x748B = 0x6830
-0x748E = 0x682C
-0x7490 = 0x6834
-0x749C = 0x682B
-0x749E = 0x6831
-0x74A7 = 0x6835
-0x74A8 = 0x6832
-0x74A9 = 0x6833
-0x74BA = 0x6837
-0x74D2 = 0x6836
-0x74DC = 0x394F
-0x74DE = 0x702C
-0x74E0 = 0x702D
-0x74E2 = 0x4630
-0x74E3 = 0x306A
-0x74E4 = 0x483F
-0x74E6 = 0x4D5F
-0x74EE = 0x4E4D
-0x74EF = 0x6A31
-0x74F4 = 0x6A32
-0x74F6 = 0x463F
-0x74F7 = 0x3449
-0x74FF = 0x6A33
-0x7504 = 0x5567
-0x750D = 0x5D79
-0x750F = 0x6A34
-0x7511 = 0x6A35
-0x7513 = 0x6A36
-0x7518 = 0x384A
-0x7519 = 0x5F30
-0x751A = 0x4975
-0x751C = 0x4C70
-0x751F = 0x497A
-0x7525 = 0x497B
-0x7528 = 0x5343
-0x7529 = 0x4B26
-0x752B = 0x3826
-0x752C = 0x702E
-0x752D = 0x3142
-0x752F = 0x6538
-0x7530 = 0x4C6F
-0x7531 = 0x5349
-0x7532 = 0x3C57
-0x7533 = 0x496A
-0x7535 = 0x3567
-0x7537 = 0x4450
-0x7538 = 0x3569
-0x753A = 0x6E2E
-0x753B = 0x3B2D
-0x753E = 0x675E
-0x7540 = 0x6E2F
-0x7545 = 0x3329
-0x7548 = 0x6E32
-0x754B = 0x6E31
-0x754C = 0x3D67
-0x754E = 0x6E30
-0x754F = 0x4E37
-0x7554 = 0x454F
-0x7559 = 0x4174
-0x755A = 0x5B4E
-0x755B = 0x6E33
-0x755C = 0x5073
-0x7565 = 0x4254
-0x7566 = 0x4668
-0x756A = 0x372C
-0x7572 = 0x6E34
-0x7574 = 0x336B
-0x7578 = 0x3B7B
-0x7579 = 0x6E35
-0x757F = 0x675C
-0x7583 = 0x6E36
-0x7586 = 0x3D2E
-0x758B = 0x7162
-0x758F = 0x4A68
-0x7591 = 0x5249
-0x7592 = 0x705A
-0x7594 = 0x705B
-0x7596 = 0x705C
-0x7597 = 0x4146
-0x7599 = 0x386D
-0x759A = 0x3E4E
-0x759D = 0x705E
-0x759F = 0x4531
-0x75A0 = 0x705D
-0x75A1 = 0x5171
-0x75A3 = 0x7060
-0x75A4 = 0x304C
-0x75A5 = 0x3D6A
-0x75AB = 0x525F
-0x75AC = 0x705F
-0x75AE = 0x342F
-0x75AF = 0x3768
-0x75B0 = 0x7066
-0x75B1 = 0x7065
-0x75B2 = 0x4623
-0x75B3 = 0x7061
-0x75B4 = 0x7062
-0x75B5 = 0x3443
-0x75B8 = 0x7063
-0x75B9 = 0x556E
-0x75BC = 0x4C5B
-0x75BD = 0x3E52
-0x75BE = 0x3C32
-0x75C2 = 0x7068
-0x75C3 = 0x7067
-0x75C4 = 0x7064
-0x75C5 = 0x3221
-0x75C7 = 0x5622
-0x75C8 = 0x5338
-0x75C9 = 0x3E37
-0x75CA = 0x482C
-0x75CD = 0x706A
-0x75D2 = 0x5177
-0x75D4 = 0x564C
-0x75D5 = 0x3A5B
-0x75D6 = 0x7069
-0x75D8 = 0x363B
-0x75DB = 0x4D34
-0x75DE = 0x4626
-0x75E2 = 0x4121
-0x75E3 = 0x706B
-0x75E4 = 0x706E
-0x75E6 = 0x706D
-0x75E7 = 0x7070
-0x75E8 = 0x706C
-0x75EA = 0x3B3E
-0x75EB = 0x706F
-0x75F0 = 0x4C35
-0x75F1 = 0x7072
-0x75F4 = 0x3355
-0x75F9 = 0x3154
-0x75FC = 0x7073
-0x75FF = 0x7074
-0x7600 = 0x7076
-0x7601 = 0x3461
-0x7603 = 0x7071
-0x7605 = 0x7077
-0x760A = 0x707A
-0x760C = 0x7078
-0x7610 = 0x7075
-0x7615 = 0x707D
-0x7617 = 0x7079
-0x7618 = 0x707C
-0x7619 = 0x707E
-0x761B = 0x7121
-0x761F = 0x4E41
-0x7620 = 0x7124
-0x7622 = 0x7123
-0x7624 = 0x4176
-0x7625 = 0x707B
-0x7626 = 0x4A5D
-0x7629 = 0x3471
-0x762A = 0x3171
-0x762B = 0x4C31
-0x762D = 0x7126
-0x7630 = 0x7127
-0x7633 = 0x712C
-0x7634 = 0x554E
-0x7635 = 0x7129
-0x7638 = 0x4833
-0x763C = 0x7122
-0x763E = 0x712B
-0x763F = 0x7128
-0x7640 = 0x7125
-0x7643 = 0x712A
-0x764C = 0x3029
-0x764D = 0x712D
-0x7654 = 0x712F
-0x7656 = 0x7131
-0x765C = 0x7130
-0x765E = 0x712E
-0x7663 = 0x5122
-0x766B = 0x7132
-0x766F = 0x7133
-0x7678 = 0x396F
-0x767B = 0x3547
-0x767D = 0x3057
-0x767E = 0x3059
-0x7682 = 0x546D
-0x7684 = 0x3544
-0x7686 = 0x3D54
-0x7687 = 0x3B4A
-0x7688 = 0x7027
-0x768B = 0x385E
-0x768E = 0x7028
-0x7691 = 0x3028
-0x7693 = 0x7029
-0x7696 = 0x4D6E
-0x7699 = 0x702A
-0x76A4 = 0x702B
-0x76AE = 0x4624
-0x76B1 = 0x5665
-0x76B2 = 0x7164
-0x76B4 = 0x7165
-0x76BF = 0x4373
-0x76C2 = 0x535B
-0x76C5 = 0x5651
-0x76C6 = 0x4568
-0x76C8 = 0x532F
-0x76CA = 0x5266
-0x76CD = 0x6E41
-0x76CE = 0x303B
-0x76CF = 0x5535
-0x76D0 = 0x514E
-0x76D1 = 0x3C60
-0x76D2 = 0x3A50
-0x76D4 = 0x3F78
-0x76D6 = 0x3847
-0x76D7 = 0x3541
-0x76D8 = 0x454C
-0x76DB = 0x4A22
-0x76DF = 0x434B
-0x76E5 = 0x6E42
-0x76EE = 0x443F
-0x76EF = 0x3622
-0x76F1 = 0x6D6C
-0x76F2 = 0x4324
-0x76F4 = 0x5631
-0x76F8 = 0x4F60
-0x76F9 = 0x6D6F
-0x76FC = 0x454E
-0x76FE = 0x365C
-0x7701 = 0x4A21
-0x7704 = 0x6D6D
-0x7707 = 0x6D70
-0x7708 = 0x6D71
-0x7709 = 0x433C
-0x770B = 0x3F34
-0x770D = 0x6D6E
-0x7719 = 0x6D74
-0x771A = 0x6D72
-0x771F = 0x5566
-0x7720 = 0x435F
-0x7722 = 0x6D73
-0x7726 = 0x6D76
-0x7728 = 0x5523
-0x7729 = 0x5123
-0x772D = 0x6D75
-0x772F = 0x4350
-0x7735 = 0x6D77
-0x7736 = 0x3F74
-0x7737 = 0x3E6C
-0x7738 = 0x6D78
-0x773A = 0x4C77
-0x773C = 0x515B
-0x7740 = 0x5745
-0x7741 = 0x5576
-0x7743 = 0x6D7C
-0x7747 = 0x6D7B
-0x7750 = 0x6D79
-0x7751 = 0x6D7A
-0x775A = 0x6D7D
-0x775B = 0x3E26
-0x7761 = 0x4B2F
-0x7762 = 0x6E21
-0x7763 = 0x363D
-0x7765 = 0x6E22
-0x7766 = 0x4440
-0x7768 = 0x6D7E
-0x776B = 0x3D5E
-0x776C = 0x3247
-0x7779 = 0x3643
-0x777D = 0x6E25
-0x777E = 0x583A
-0x777F = 0x6E23
-0x7780 = 0x6E26
-0x7784 = 0x4369
-0x7785 = 0x3372
-0x778C = 0x6E27
-0x778D = 0x6E24
-0x778E = 0x4F39
-0x7791 = 0x6E28
-0x7792 = 0x4277
-0x779F = 0x6E29
-0x77A0 = 0x6E2A
-0x77A2 = 0x5E2B
-0x77A5 = 0x4633
-0x77A7 = 0x4746
-0x77A9 = 0x5675
-0x77AA = 0x3549
-0x77AC = 0x4B32
-0x77B0 = 0x6E2B
-0x77B3 = 0x4D2B
-0x77B5 = 0x6E2C
-0x77BB = 0x5530
-0x77BD = 0x6E2D
-0x77BF = 0x7644
-0x77CD = 0x5B47
-0x77D7 = 0x3423
-0x77DB = 0x432C
-0x77DC = 0x7166
-0x77E2 = 0x4A38
-0x77E3 = 0x5253
-0x77E5 = 0x562A
-0x77E7 = 0x6F72
-0x77E9 = 0x3E58
-0x77EB = 0x3D43
-0x77EC = 0x6F73
-0x77ED = 0x364C
-0x77EE = 0x302B
-0x77F3 = 0x4A2F
-0x77F6 = 0x6D36
-0x77F8 = 0x6D37
-0x77FD = 0x4E79
-0x77FE = 0x372F
-0x77FF = 0x3F73
-0x7800 = 0x6D38
-0x7801 = 0x426B
-0x7802 = 0x4930
-0x7809 = 0x6D39
-0x780C = 0x4676
-0x780D = 0x3F33
-0x7811 = 0x6D3C
-0x7812 = 0x4578
-0x7814 = 0x5150
-0x7816 = 0x5729
-0x7817 = 0x6D3A
-0x7818 = 0x6D3B
-0x781A = 0x5162
-0x781C = 0x6D3F
-0x781D = 0x6D40
-0x781F = 0x6D44
-0x7823 = 0x6D48
-0x7825 = 0x6D46
-0x7826 = 0x6D4E
-0x7827 = 0x5568
-0x7829 = 0x6D49
-0x782C = 0x6D47
-0x782D = 0x6D3E
-0x7830 = 0x4569
-0x7834 = 0x4646
-0x7837 = 0x4969
-0x7838 = 0x5452
-0x7839 = 0x6D41
-0x783A = 0x6D42
-0x783B = 0x6D43
-0x783C = 0x6D45
-0x783E = 0x4079
-0x7840 = 0x3421
-0x7845 = 0x3968
-0x7847 = 0x6D50
-0x784C = 0x6D51
-0x784E = 0x6D4A
-0x7850 = 0x6D4F
-0x7852 = 0x4E78
-0x7855 = 0x4B36
-0x7856 = 0x6D4C
-0x7857 = 0x6D4D
-0x785D = 0x4F75
-0x786A = 0x6D52
-0x786B = 0x4172
-0x786C = 0x5332
-0x786D = 0x6D4B
-0x786E = 0x4837
-0x7877 = 0x3C6F
-0x787C = 0x4570
-0x7887 = 0x6D56
-0x7889 = 0x356F
-0x788C = 0x4235
-0x788D = 0x302D
-0x788E = 0x4B69
-0x7891 = 0x312E
-0x7893 = 0x6D54
-0x7897 = 0x4D6B
-0x7898 = 0x3562
-0x789A = 0x6D55
-0x789B = 0x6D53
-0x789C = 0x6D57
-0x789F = 0x357A
-0x78A1 = 0x6D58
-0x78A3 = 0x6D59
-0x78A5 = 0x6D5C
-0x78A7 = 0x314C
-0x78B0 = 0x4576
-0x78B1 = 0x3C6E
-0x78B2 = 0x6D5A
-0x78B3 = 0x4C3C
-0x78B4 = 0x326A
-0x78B9 = 0x6D5B
-0x78BE = 0x446B
-0x78C1 = 0x3445
-0x78C5 = 0x3075
-0x78C9 = 0x6D5F
-0x78CA = 0x405A
-0x78CB = 0x3468
-0x78D0 = 0x454D
-0x78D4 = 0x6D5D
-0x78D5 = 0x3F44
-0x78D9 = 0x6D5E
-0x78E8 = 0x4425
-0x78EC = 0x6D60
-0x78F2 = 0x6D61
-0x78F4 = 0x6D63
-0x78F7 = 0x4157
-0x78FA = 0x3B47
-0x7901 = 0x3D38
-0x7905 = 0x6D62
-0x7913 = 0x6D64
-0x791E = 0x6D66
-0x7924 = 0x6D65
-0x7934 = 0x6D67
-0x793A = 0x4A3E
-0x793B = 0x6C6A
-0x793C = 0x4071
-0x793E = 0x4967
-0x7940 = 0x6C6B
-0x7941 = 0x466E
-0x7946 = 0x6C6C
-0x7948 = 0x466D
-0x7949 = 0x6C6D
-0x7953 = 0x6C70
-0x7956 = 0x5766
-0x7957 = 0x6C73
-0x795A = 0x6C71
-0x795B = 0x6C6E
-0x795C = 0x6C6F
-0x795D = 0x5723
-0x795E = 0x4971
-0x795F = 0x4B6E
-0x7960 = 0x6C74
-0x7962 = 0x6C72
-0x7965 = 0x4F69
-0x7967 = 0x6C76
-0x7968 = 0x4631
-0x796D = 0x3C40
-0x796F = 0x6C75
-0x7977 = 0x353B
-0x7978 = 0x3B76
-0x797A = 0x6C77
-0x7980 = 0x5977
-0x7981 = 0x3D7B
-0x7984 = 0x423B
-0x7985 = 0x6C78
-0x798A = 0x6C79
-0x798F = 0x3823
-0x799A = 0x6C7A
-0x79A7 = 0x6C7B
-0x79B3 = 0x6C7C
-0x79B9 = 0x536D
-0x79BA = 0x582E
-0x79BB = 0x406B
-0x79BD = 0x475D
-0x79BE = 0x3A4C
-0x79C0 = 0x5063
-0x79C1 = 0x4B3D
-0x79C3 = 0x4D3A
-0x79C6 = 0x3851
-0x79C9 = 0x317C
-0x79CB = 0x476F
-0x79CD = 0x5656
-0x79D1 = 0x3F46
-0x79D2 = 0x436B
-0x79D5 = 0x6F75
-0x79D8 = 0x4358
-0x79DF = 0x5762
-0x79E3 = 0x6F77
-0x79E4 = 0x3353
-0x79E6 = 0x4758
-0x79E7 = 0x516D
-0x79E9 = 0x5648
-0x79EB = 0x6F78
-0x79ED = 0x6F76
-0x79EF = 0x3B7D
-0x79F0 = 0x3346
-0x79F8 = 0x3D55
-0x79FB = 0x5246
-0x79FD = 0x3B60
-0x7A00 = 0x4F21
-0x7A02 = 0x6F7C
-0x7A03 = 0x6F7B
-0x7A06 = 0x6F79
-0x7A0B = 0x334C
-0x7A0D = 0x4954
-0x7A0E = 0x4B30
-0x7A14 = 0x6F7E
-0x7A17 = 0x305E
-0x7A1A = 0x5649
-0x7A1E = 0x6F7D
-0x7A20 = 0x336D
-0x7A23 = 0x7655
-0x7A33 = 0x4E48
-0x7A37 = 0x7022
-0x7A39 = 0x7021
-0x7A3B = 0x353E
-0x7A3C = 0x3C5A
-0x7A3D = 0x3B7C
-0x7A3F = 0x3865
-0x7A46 = 0x4442
-0x7A51 = 0x7023
-0x7A57 = 0x4B6B
-0x7A70 = 0x7026
-0x7A74 = 0x5128
-0x7A76 = 0x3E3F
-0x7A77 = 0x476E
-0x7A78 = 0x7136
-0x7A79 = 0x7137
-0x7A7A = 0x3F55
-0x7A7F = 0x3429
-0x7A80 = 0x7138
-0x7A81 = 0x4D3B
-0x7A83 = 0x4754
-0x7A84 = 0x552D
-0x7A86 = 0x7139
-0x7A88 = 0x713A
-0x7A8D = 0x474F
-0x7A91 = 0x5224
-0x7A92 = 0x564F
-0x7A95 = 0x713B
-0x7A96 = 0x3D51
-0x7A97 = 0x3430
-0x7A98 = 0x3E3D
-0x7A9C = 0x345C
-0x7A9D = 0x4E51
-0x7A9F = 0x3F5F
-0x7AA0 = 0x713D
-0x7AA5 = 0x3F7A
-0x7AA6 = 0x713C
-0x7AA8 = 0x713F
-0x7AAC = 0x713E
-0x7AAD = 0x7140
-0x7AB3 = 0x7141
-0x7ABF = 0x417E
-0x7ACB = 0x4122
-0x7AD6 = 0x4A7A
-0x7AD9 = 0x553E
-0x7ADE = 0x3E3A
-0x7ADF = 0x3E39
-0x7AE0 = 0x5542
-0x7AE3 = 0x3F22
-0x7AE5 = 0x4D2F
-0x7AE6 = 0x7135
-0x7AED = 0x3D5F
-0x7AEF = 0x364B
-0x7AF9 = 0x5671
-0x7AFA = 0x7343
-0x7AFD = 0x7344
-0x7AFF = 0x384D
-0x7B03 = 0x7346
-0x7B04 = 0x7347
-0x7B06 = 0x304A
-0x7B08 = 0x7345
-0x7B0A = 0x7349
-0x7B0B = 0x4B71
-0x7B0F = 0x734B
-0x7B11 = 0x5026
-0x7B14 = 0x314A
-0x7B15 = 0x7348
-0x7B19 = 0x734F
-0x7B1B = 0x3551
-0x7B1E = 0x7357
-0x7B20 = 0x7352
-0x7B24 = 0x7354
-0x7B25 = 0x7353
-0x7B26 = 0x377B
-0x7B28 = 0x313F
-0x7B2A = 0x734E
-0x7B2B = 0x734A
-0x7B2C = 0x355A
-0x7B2E = 0x7350
-0x7B31 = 0x7351
-0x7B33 = 0x7355
-0x7B38 = 0x734D
-0x7B3A = 0x3C63
-0x7B3C = 0x417D
-0x7B3E = 0x7356
-0x7B45 = 0x735A
-0x7B47 = 0x734C
-0x7B49 = 0x3548
-0x7B4B = 0x3D6E
-0x7B4C = 0x735C
-0x7B4F = 0x3724
-0x7B50 = 0x3F70
-0x7B51 = 0x567E
-0x7B52 = 0x4D32
-0x7B54 = 0x3470
-0x7B56 = 0x325F
-0x7B58 = 0x7358
-0x7B5A = 0x7359
-0x7B5B = 0x4938
-0x7B5D = 0x735D
-0x7B60 = 0x735E
-0x7B62 = 0x7361
-0x7B6E = 0x735F
-0x7B71 = 0x7363
-0x7B72 = 0x7362
-0x7B75 = 0x735B
-0x7B77 = 0x3F6A
-0x7B79 = 0x336F
-0x7B7B = 0x7360
-0x7B7E = 0x4729
-0x7B80 = 0x3C72
-0x7B85 = 0x736B
-0x7B8D = 0x393F
-0x7B90 = 0x7364
-0x7B94 = 0x322D
-0x7B95 = 0x3B7E
-0x7B97 = 0x4B63
-0x7B9C = 0x736D
-0x7B9D = 0x7369
-0x7BA1 = 0x395C
-0x7BA2 = 0x736E
-0x7BA6 = 0x7365
-0x7BA7 = 0x7366
-0x7BA8 = 0x736A
-0x7BA9 = 0x4261
-0x7BAA = 0x736C
-0x7BAB = 0x736F
-0x7BAC = 0x7368
-0x7BAD = 0x3C7D
-0x7BB1 = 0x4F64
-0x7BB4 = 0x7370
-0x7BB8 = 0x7367
-0x7BC1 = 0x7372
-0x7BC6 = 0x572D
-0x7BC7 = 0x462A
-0x7BCC = 0x7373
-0x7BD1 = 0x7371
-0x7BD3 = 0x4228
-0x7BD9 = 0x385D
-0x7BDA = 0x7375
-0x7BDD = 0x7374
-0x7BE1 = 0x345B
-0x7BE5 = 0x7376
-0x7BE6 = 0x7377
-0x7BEA = 0x7378
-0x7BEE = 0x403A
-0x7BF1 = 0x4069
-0x7BF7 = 0x4571
-0x7BFC = 0x737B
-0x7BFE = 0x737A
-0x7C07 = 0x3458
-0x7C0B = 0x737E
-0x7C0C = 0x7379
-0x7C0F = 0x737C
-0x7C16 = 0x737D
-0x7C1F = 0x7421
-0x7C26 = 0x7423
-0x7C27 = 0x3B49
-0x7C2A = 0x7422
-0x7C38 = 0x7424
-0x7C3F = 0x323E
-0x7C40 = 0x7426
-0x7C41 = 0x7425
-0x7C4D = 0x3C2E
-0x7C73 = 0x4357
-0x7C74 = 0x5961
-0x7C7B = 0x4060
-0x7C7C = 0x744C
-0x7C7D = 0x5751
-0x7C89 = 0x375B
-0x7C91 = 0x744E
-0x7C92 = 0x4123
-0x7C95 = 0x4649
-0x7C97 = 0x3456
-0x7C98 = 0x5533
-0x7C9C = 0x7450
-0x7C9D = 0x744F
-0x7C9E = 0x7451
-0x7C9F = 0x4B5A
-0x7CA2 = 0x7452
-0x7CA4 = 0x5441
-0x7CA5 = 0x5660
-0x7CAA = 0x3760
-0x7CAE = 0x4138
-0x7CB1 = 0x413B
-0x7CB2 = 0x7453
-0x7CB3 = 0x3E2C
-0x7CB9 = 0x3462
-0x7CBC = 0x7454
-0x7CBD = 0x7455
-0x7CBE = 0x3E2B
-0x7CC1 = 0x7456
-0x7CC5 = 0x745B
-0x7CC7 = 0x7457
-0x7CC8 = 0x745A
-0x7CCA = 0x3A7D
-0x7CCC = 0x7458
-0x7CCD = 0x7459
-0x7CD5 = 0x3862
-0x7CD6 = 0x4C47
-0x7CD7 = 0x745C
-0x7CD9 = 0x325A
-0x7CDC = 0x4353
-0x7CDF = 0x5463
-0x7CE0 = 0x3F37
-0x7CE8 = 0x745D
-0x7CEF = 0x4534
-0x7CF8 = 0x7469
-0x7CFB = 0x4F35
-0x7D0A = 0x4E49
-0x7D20 = 0x4B58
-0x7D22 = 0x4B77
-0x7D27 = 0x3D74
-0x7D2B = 0x574F
-0x7D2F = 0x405B
-0x7D6E = 0x5075
-0x7D77 = 0x746A
-0x7DA6 = 0x746B
-0x7DAE = 0x746C
-0x7E3B = 0x7763
-0x7E41 = 0x3731
-0x7E47 = 0x746D
-0x7E82 = 0x576B
-0x7E9B = 0x746E
-0x7E9F = 0x6679
-0x7EA0 = 0x3E40
-0x7EA1 = 0x667A
-0x7EA2 = 0x3A6C
-0x7EA3 = 0x667B
-0x7EA4 = 0x4F4B
-0x7EA5 = 0x667C
-0x7EA6 = 0x543C
-0x7EA7 = 0x3C36
-0x7EA8 = 0x667D
-0x7EA9 = 0x667E
-0x7EAA = 0x3C4D
-0x7EAB = 0x4852
-0x7EAC = 0x4E33
-0x7EAD = 0x6721
-0x7EAF = 0x343F
-0x7EB0 = 0x6722
-0x7EB1 = 0x4934
-0x7EB2 = 0x3859
-0x7EB3 = 0x4449
-0x7EB5 = 0x575D
-0x7EB6 = 0x425A
-0x7EB7 = 0x3757
-0x7EB8 = 0x563D
-0x7EB9 = 0x4E46
-0x7EBA = 0x3744
-0x7EBD = 0x4526
-0x7EBE = 0x6723
-0x7EBF = 0x4F5F
-0x7EC0 = 0x6724
-0x7EC1 = 0x6725
-0x7EC2 = 0x6726
-0x7EC3 = 0x4137
-0x7EC4 = 0x5769
-0x7EC5 = 0x4970
-0x7EC6 = 0x4F38
-0x7EC7 = 0x562F
-0x7EC8 = 0x5655
-0x7EC9 = 0x6727
-0x7ECA = 0x306D
-0x7ECB = 0x6728
-0x7ECC = 0x6729
-0x7ECD = 0x495C
-0x7ECE = 0x526F
-0x7ECF = 0x3E2D
-0x7ED0 = 0x672A
-0x7ED1 = 0x3073
-0x7ED2 = 0x485E
-0x7ED3 = 0x3D61
-0x7ED4 = 0x672B
-0x7ED5 = 0x4846
-0x7ED7 = 0x672C
-0x7ED8 = 0x3B66
-0x7ED9 = 0x3878
-0x7EDA = 0x5124
-0x7EDB = 0x672D
-0x7EDC = 0x4267
-0x7EDD = 0x3E78
-0x7EDE = 0x3D4A
-0x7EDF = 0x4D33
-0x7EE0 = 0x672E
-0x7EE1 = 0x672F
-0x7EE2 = 0x3E6E
-0x7EE3 = 0x5065
-0x7EE5 = 0x4B67
-0x7EE6 = 0x4C50
-0x7EE7 = 0x3C4C
-0x7EE8 = 0x6730
-0x7EE9 = 0x3C28
-0x7EEA = 0x5077
-0x7EEB = 0x6731
-0x7EED = 0x5078
-0x7EEE = 0x6732
-0x7EEF = 0x6733
-0x7EF0 = 0x3442
-0x7EF1 = 0x6734
-0x7EF2 = 0x6735
-0x7EF3 = 0x497E
-0x7EF4 = 0x4E2C
-0x7EF5 = 0x4360
-0x7EF6 = 0x6737
-0x7EF7 = 0x3141
-0x7EF8 = 0x3371
-0x7EFA = 0x6738
-0x7EFB = 0x6739
-0x7EFC = 0x575B
-0x7EFD = 0x5540
-0x7EFE = 0x673A
-0x7EFF = 0x424C
-0x7F00 = 0x573A
-0x7F01 = 0x673B
-0x7F02 = 0x673C
-0x7F03 = 0x673D
-0x7F04 = 0x3C6A
-0x7F05 = 0x4365
-0x7F06 = 0x4042
-0x7F07 = 0x673E
-0x7F08 = 0x673F
-0x7F09 = 0x3C29
-0x7F0B = 0x6740
-0x7F0C = 0x6741
-0x7F0D = 0x6736
-0x7F0E = 0x3650
-0x7F0F = 0x6742
-0x7F11 = 0x6743
-0x7F12 = 0x6744
-0x7F13 = 0x3B3A
-0x7F14 = 0x355E
-0x7F15 = 0x4246
-0x7F16 = 0x3160
-0x7F17 = 0x6745
-0x7F18 = 0x5435
-0x7F19 = 0x6746
-0x7F1A = 0x383F
-0x7F1B = 0x6748
-0x7F1C = 0x6747
-0x7F1D = 0x376C
-0x7F1F = 0x6749
-0x7F20 = 0x3278
-0x7F21 = 0x674A
-0x7F22 = 0x674B
-0x7F23 = 0x674C
-0x7F24 = 0x674D
-0x7F25 = 0x674E
-0x7F26 = 0x674F
-0x7F27 = 0x6750
-0x7F28 = 0x5327
-0x7F29 = 0x4B75
-0x7F2A = 0x6751
-0x7F2B = 0x6752
-0x7F2C = 0x6753
-0x7F2D = 0x6754
-0x7F2E = 0x4949
-0x7F2F = 0x6755
-0x7F30 = 0x6756
-0x7F31 = 0x6757
-0x7F32 = 0x6758
-0x7F33 = 0x6759
-0x7F34 = 0x3D49
-0x7F35 = 0x675A
-0x7F36 = 0x733E
-0x7F38 = 0x3857
-0x7F3A = 0x4831
-0x7F42 = 0x733F
-0x7F44 = 0x7340
-0x7F45 = 0x7341
-0x7F50 = 0x395E
-0x7F51 = 0x4D78
-0x7F54 = 0x5868
-0x7F55 = 0x3A31
-0x7F57 = 0x425E
-0x7F58 = 0x6E37
-0x7F5A = 0x3723
-0x7F5F = 0x6E39
-0x7F61 = 0x6E38
-0x7F62 = 0x3055
-0x7F68 = 0x6E3B
-0x7F69 = 0x5556
-0x7F6A = 0x576F
-0x7F6E = 0x5643
-0x7F71 = 0x6E3D
-0x7F72 = 0x4A70
-0x7F74 = 0x6E3C
-0x7F79 = 0x6E3E
-0x7F7E = 0x6E40
-0x7F81 = 0x6E3F
-0x7F8A = 0x5172
-0x7F8C = 0x473C
-0x7F8E = 0x4340
-0x7F94 = 0x3861
-0x7F9A = 0x4167
-0x7F9D = 0x7446
-0x7F9E = 0x505F
-0x7F9F = 0x7447
-0x7FA1 = 0x4F5B
-0x7FA4 = 0x483A
-0x7FA7 = 0x7448
-0x7FAF = 0x7449
-0x7FB0 = 0x744A
-0x7FB2 = 0x744B
-0x7FB8 = 0x597A
-0x7FB9 = 0x387E
-0x7FBC = 0x6571
-0x7FBD = 0x5370
-0x7FBF = 0x7460
-0x7FC1 = 0x4E4C
-0x7FC5 = 0x3361
-0x7FCA = 0x7134
-0x7FCC = 0x526E
-0x7FCE = 0x7461
-0x7FD4 = 0x4F68
-0x7FD5 = 0x7462
-0x7FD8 = 0x474C
-0x7FDF = 0x3554
-0x7FE0 = 0x3464
-0x7FE1 = 0x7464
-0x7FE5 = 0x7463
-0x7FE6 = 0x7465
-0x7FE9 = 0x7466
-0x7FEE = 0x7467
-0x7FF0 = 0x3A32
-0x7FF1 = 0x303F
-0x7FF3 = 0x7468
-0x7FFB = 0x372D
-0x7FFC = 0x526D
-0x8000 = 0x522B
-0x8001 = 0x404F
-0x8003 = 0x3F3C
-0x8004 = 0x6B23
-0x8005 = 0x555F
-0x8006 = 0x6A48
-0x800B = 0x7173
-0x800C = 0x3678
-0x800D = 0x4B23
-0x8010 = 0x444D
-0x8012 = 0x7167
-0x8014 = 0x7168
-0x8015 = 0x387B
-0x8016 = 0x7169
-0x8017 = 0x3A44
-0x8018 = 0x5445
-0x8019 = 0x3052
-0x801C = 0x716A
-0x8020 = 0x716B
-0x8022 = 0x716C
-0x8025 = 0x716D
-0x8026 = 0x716E
-0x8027 = 0x716F
-0x8028 = 0x7171
-0x8029 = 0x7170
-0x802A = 0x4555
-0x8031 = 0x7172
-0x8033 = 0x367A
-0x8035 = 0x7174
-0x8036 = 0x522E
-0x8037 = 0x5E47
-0x8038 = 0x4B4A
-0x803B = 0x335C
-0x803D = 0x3522
-0x803F = 0x3922
-0x8042 = 0x4474
-0x8043 = 0x7175
-0x8046 = 0x7176
-0x804A = 0x4144
-0x804B = 0x417B
-0x804C = 0x5630
-0x804D = 0x7177
-0x8052 = 0x7178
-0x8054 = 0x412A
-0x8058 = 0x4638
-0x805A = 0x3E5B
-0x8069 = 0x7179
-0x806A = 0x344F
-0x8071 = 0x717A
-0x807F = 0x6D32
-0x8080 = 0x6D31
-0x8083 = 0x4B60
-0x8084 = 0x525E
-0x8086 = 0x4B41
-0x8087 = 0x5558
-0x8089 = 0x4862
-0x808B = 0x405F
-0x808C = 0x3C21
-0x8093 = 0x6B41
-0x8096 = 0x5024
-0x8098 = 0x5662
-0x809A = 0x3647
-0x809B = 0x3858
-0x809C = 0x6B40
-0x809D = 0x384E
-0x809F = 0x6B3F
-0x80A0 = 0x3326
-0x80A1 = 0x3949
-0x80A2 = 0x562B
-0x80A4 = 0x3774
-0x80A5 = 0x374A
-0x80A9 = 0x3C67
-0x80AA = 0x373E
-0x80AB = 0x6B46
-0x80AD = 0x6B47
-0x80AE = 0x3039
-0x80AF = 0x3F4F
-0x80B1 = 0x6B45
-0x80B2 = 0x537D
-0x80B4 = 0x6B48
-0x80B7 = 0x6B49
-0x80BA = 0x374E
-0x80BC = 0x6B42
-0x80BD = 0x6B44
-0x80BE = 0x4976
-0x80BF = 0x5657
-0x80C0 = 0x554D
-0x80C1 = 0x5032
-0x80C2 = 0x6B4F
-0x80C3 = 0x4E38
-0x80C4 = 0x6B50
-0x80C6 = 0x3528
-0x80CC = 0x3133
-0x80CD = 0x6B52
-0x80CE = 0x4C25
-0x80D6 = 0x4556
-0x80D7 = 0x6B53
-0x80D9 = 0x6B51
-0x80DA = 0x455F
-0x80DB = 0x6B4E
-0x80DC = 0x4A24
-0x80DD = 0x6B55
-0x80DE = 0x307B
-0x80E1 = 0x3A7A
-0x80E4 = 0x5837
-0x80E5 = 0x7163
-0x80E7 = 0x6B4A
-0x80E8 = 0x6B4B
-0x80E9 = 0x6B4C
-0x80EA = 0x6B4D
-0x80EB = 0x6B56
-0x80EC = 0x6640
-0x80ED = 0x6B59
-0x80EF = 0x3F68
-0x80F0 = 0x5248
-0x80F1 = 0x6B57
-0x80F2 = 0x6B5C
-0x80F3 = 0x386C
-0x80F4 = 0x6B58
-0x80F6 = 0x3D3A
-0x80F8 = 0x5058
-0x80FA = 0x3037
-0x80FC = 0x6B5D
-0x80FD = 0x445C
-0x8102 = 0x562C
-0x8106 = 0x3460
-0x8109 = 0x4276
-0x810A = 0x3C39
-0x810D = 0x6B5A
-0x810E = 0x6B5B
-0x810F = 0x5460
-0x8110 = 0x466A
-0x8111 = 0x4454
-0x8112 = 0x6B5F
-0x8113 = 0x4527
-0x8114 = 0x5975
-0x8116 = 0x3231
-0x8118 = 0x6B64
-0x811A = 0x3D45
-0x811E = 0x6B62
-0x812C = 0x6B63
-0x812F = 0x382C
-0x8131 = 0x4D51
-0x8132 = 0x6B65
-0x8136 = 0x6B61
-0x8138 = 0x4133
-0x813E = 0x4622
-0x8146 = 0x4C73
-0x8148 = 0x6B66
-0x814A = 0x4030
-0x814B = 0x5238
-0x814C = 0x6B67
-0x8150 = 0x382F
-0x8151 = 0x382D
-0x8153 = 0x6B68
-0x8154 = 0x473B
-0x8155 = 0x4D73
-0x8159 = 0x6B6A
-0x815A = 0x6B6B
-0x8160 = 0x6B6D
-0x8165 = 0x5048
-0x8167 = 0x6B72
-0x8169 = 0x6B6E
-0x816D = 0x6B71
-0x816E = 0x4879
-0x8170 = 0x517C
-0x8171 = 0x6B6C
-0x8174 = 0x6B69
-0x8179 = 0x3839
-0x817A = 0x4F59
-0x817B = 0x4465
-0x817C = 0x6B6F
-0x817D = 0x6B70
-0x817E = 0x4C5A
-0x817F = 0x4D48
-0x8180 = 0x3072
-0x8182 = 0x6B76
-0x8188 = 0x6B75
-0x818A = 0x3232
-0x818F = 0x3860
-0x8191 = 0x6B77
-0x8198 = 0x316C
-0x819B = 0x4C45
-0x819C = 0x4424
-0x819D = 0x4F25
-0x81A3 = 0x6B79
-0x81A6 = 0x6C22
-0x81A8 = 0x4572
-0x81AA = 0x6B7A
-0x81B3 = 0x4945
-0x81BA = 0x625F
-0x81BB = 0x6B7E
-0x81C0 = 0x4D4E
-0x81C1 = 0x6C21
-0x81C2 = 0x315B
-0x81C3 = 0x5337
-0x81C6 = 0x525C
-0x81CA = 0x6B7D
-0x81CC = 0x6B7B
-0x81E3 = 0x333C
-0x81E7 = 0x6A30
-0x81EA = 0x5754
-0x81EC = 0x742B
-0x81ED = 0x3374
-0x81F3 = 0x5641
-0x81F4 = 0x5642
-0x81FB = 0x5569
-0x81FC = 0x3E4A
-0x81FE = 0x7427
-0x8200 = 0x5228
-0x8201 = 0x7428
-0x8202 = 0x7429
-0x8204 = 0x742A
-0x8205 = 0x3E4B
-0x8206 = 0x535F
-0x820C = 0x4960
-0x820D = 0x4961
-0x8210 = 0x7342
-0x8212 = 0x4A66
-0x8214 = 0x4C72
-0x821B = 0x6236
-0x821C = 0x4B34
-0x821E = 0x4E68
-0x821F = 0x565B
-0x8221 = 0x742D
-0x8222 = 0x742E
-0x8223 = 0x742F
-0x8228 = 0x7432
-0x822A = 0x3A3D
-0x822B = 0x7433
-0x822C = 0x3063
-0x822D = 0x7430
-0x822F = 0x7431
-0x8230 = 0x3D22
-0x8231 = 0x3255
-0x8233 = 0x7436
-0x8234 = 0x7437
-0x8235 = 0x3666
-0x8236 = 0x3230
-0x8237 = 0x4F4F
-0x8238 = 0x7434
-0x8239 = 0x342C
-0x823B = 0x7435
-0x823E = 0x7438
-0x8244 = 0x7439
-0x8247 = 0x4D27
-0x8249 = 0x743A
-0x824B = 0x743B
-0x824F = 0x743C
-0x8258 = 0x4B52
-0x825A = 0x743D
-0x825F = 0x743E
-0x8268 = 0x743F
-0x826E = 0x745E
-0x826F = 0x413C
-0x8270 = 0x3C68
-0x8272 = 0x492B
-0x8273 = 0x515E
-0x8274 = 0x6575
-0x8279 = 0x5C33
-0x827A = 0x5255
-0x827D = 0x5C34
-0x827E = 0x302C
-0x827F = 0x5C35
-0x8282 = 0x3D5A
-0x8284 = 0x5C39
-0x8288 = 0x5842
-0x828A = 0x5C37
-0x828B = 0x5373
-0x828D = 0x4956
-0x828E = 0x5C3A
-0x828F = 0x5C36
-0x8291 = 0x5C3B
-0x8292 = 0x4322
-0x8297 = 0x5C3C
-0x8298 = 0x5C45
-0x8299 = 0x5C3D
-0x829C = 0x4E5F
-0x829D = 0x5625
-0x829F = 0x5C4F
-0x82A1 = 0x5C4D
-0x82A4 = 0x5C52
-0x82A5 = 0x3D66
-0x82A6 = 0x422B
-0x82A8 = 0x5C38
-0x82A9 = 0x5C4B
-0x82AA = 0x5C4E
-0x82AB = 0x5C3E
-0x82AC = 0x3752
-0x82AD = 0x3045
-0x82AE = 0x5C47
-0x82AF = 0x503E
-0x82B0 = 0x5C41
-0x82B1 = 0x3B28
-0x82B3 = 0x373C
-0x82B4 = 0x5C4C
-0x82B7 = 0x5C46
-0x82B8 = 0x5C3F
-0x82B9 = 0x475B
-0x82BD = 0x513F
-0x82BE = 0x5C40
-0x82C1 = 0x5C4A
-0x82C4 = 0x5C50
-0x82C7 = 0x4E2D
-0x82C8 = 0x5C42
-0x82CA = 0x5C43
-0x82CB = 0x5C48
-0x82CC = 0x5C49
-0x82CD = 0x3254
-0x82CE = 0x5C51
-0x82CF = 0x4B55
-0x82D1 = 0x5437
-0x82D2 = 0x5C5B
-0x82D3 = 0x5C5F
-0x82D4 = 0x4C26
-0x82D5 = 0x5C66
-0x82D7 = 0x4367
-0x82D8 = 0x5C5C
-0x82DB = 0x3F41
-0x82DC = 0x5C59
-0x82DE = 0x307A
-0x82DF = 0x3936
-0x82E0 = 0x5C65
-0x82E1 = 0x5C53
-0x82E3 = 0x5C44
-0x82E4 = 0x5C56
-0x82E5 = 0x4874
-0x82E6 = 0x3F60
-0x82EB = 0x493B
-0x82EF = 0x313D
-0x82F1 = 0x5322
-0x82F4 = 0x5C5A
-0x82F7 = 0x5C55
-0x82F9 = 0x463B
-0x82FB = 0x5C5E
-0x8301 = 0x5742
-0x8302 = 0x432F
-0x8303 = 0x3736
-0x8304 = 0x4751
-0x8305 = 0x4329
-0x8306 = 0x5C62
-0x8307 = 0x5C58
-0x8308 = 0x5C6B
-0x8309 = 0x5C54
-0x830C = 0x5C5D
-0x830E = 0x3E25
-0x830F = 0x5C57
-0x8311 = 0x5C60
-0x8314 = 0x5C63
-0x8315 = 0x5C64
-0x8317 = 0x5C78
-0x831A = 0x5C61
-0x831B = 0x5D22
-0x831C = 0x5C67
-0x8327 = 0x3C6B
-0x8328 = 0x3444
-0x832B = 0x4323
-0x832C = 0x3267
-0x832D = 0x5C7A
-0x832F = 0x5C72
-0x8331 = 0x5C6F
-0x8333 = 0x5C7C
-0x8334 = 0x5C6E
-0x8335 = 0x5270
-0x8336 = 0x3268
-0x8338 = 0x4857
-0x8339 = 0x4863
-0x833A = 0x5C7B
-0x833C = 0x5C6D
-0x8340 = 0x5C77
-0x8343 = 0x5C75
-0x8346 = 0x3E23
-0x8347 = 0x5C74
-0x8349 = 0x325D
-0x834F = 0x5C73
-0x8350 = 0x3C76
-0x8351 = 0x5C68
-0x8352 = 0x3B44
-0x8354 = 0x4073
-0x835A = 0x3C54
-0x835B = 0x5C69
-0x835C = 0x5C6A
-0x835E = 0x5C71
-0x835F = 0x5C76
-0x8360 = 0x5C79
-0x8361 = 0x3534
-0x8363 = 0x4859
-0x8364 = 0x3B67
-0x8365 = 0x5C7E
-0x8366 = 0x5C7D
-0x8367 = 0x532B
-0x8368 = 0x5D21
-0x8369 = 0x5D23
-0x836A = 0x5D25
-0x836B = 0x5271
-0x836C = 0x5D24
-0x836D = 0x5D26
-0x836E = 0x5D27
-0x836F = 0x5229
-0x8377 = 0x3A49
-0x8378 = 0x5D29
-0x837B = 0x5D36
-0x837C = 0x5D31
-0x837D = 0x5D34
-0x8385 = 0x5D30
-0x8386 = 0x464E
-0x8389 = 0x4072
-0x838E = 0x492F
-0x8392 = 0x5C6C
-0x8393 = 0x5D2E
-0x8398 = 0x5D37
-0x839B = 0x5C70
-0x839C = 0x5D2F
-0x839E = 0x5D38
-0x83A0 = 0x5D2C
-0x83A8 = 0x5D39
-0x83A9 = 0x5D33
-0x83AA = 0x5D2D
-0x83AB = 0x442A
-0x83B0 = 0x5D28
-0x83B1 = 0x4033
-0x83B2 = 0x412B
-0x83B3 = 0x5D2A
-0x83B4 = 0x5D2B
-0x83B6 = 0x5D32
-0x83B7 = 0x3B71
-0x83B8 = 0x5D35
-0x83B9 = 0x5328
-0x83BA = 0x5D3A
-0x83BC = 0x5D3B
-0x83BD = 0x4327
-0x83C0 = 0x5D52
-0x83C1 = 0x5D3C
-0x83C5 = 0x5D51
-0x83C7 = 0x393D
-0x83CA = 0x3E55
-0x83CC = 0x3E7A
-0x83CF = 0x3A4A
-0x83D4 = 0x5D4A
-0x83D6 = 0x5D45
-0x83D8 = 0x5D3F
-0x83DC = 0x324B
-0x83DD = 0x5D43
-0x83DF = 0x5D4B
-0x83E0 = 0x3224
-0x83E1 = 0x5D55
-0x83E5 = 0x5D3E
-0x83E9 = 0x4650
-0x83EA = 0x5D50
-0x83F0 = 0x5D54
-0x83F1 = 0x4162
-0x83F2 = 0x3746
-0x83F8 = 0x5D4E
-0x83F9 = 0x5D4F
-0x83FD = 0x5D44
-0x8401 = 0x5D3D
-0x8403 = 0x5D4D
-0x8404 = 0x4C51
-0x8406 = 0x5D49
-0x840B = 0x5D42
-0x840C = 0x4348
-0x840D = 0x463C
-0x840E = 0x4E2E
-0x840F = 0x5D4C
-0x8411 = 0x5D48
-0x8418 = 0x5D41
-0x841C = 0x5D46
-0x841D = 0x425C
-0x8424 = 0x5329
-0x8425 = 0x532A
-0x8426 = 0x5D53
-0x8427 = 0x4F74
-0x8428 = 0x4878
-0x8431 = 0x5D66
-0x8438 = 0x5D47
-0x843C = 0x5D60
-0x843D = 0x4264
-0x8446 = 0x5D61
-0x8451 = 0x5D57
-0x8457 = 0x5678
-0x8459 = 0x5D59
-0x845A = 0x5D58
-0x845B = 0x3870
-0x845C = 0x5D56
-0x8461 = 0x464F
-0x8463 = 0x362D
-0x8469 = 0x5D62
-0x846B = 0x3A79
-0x846C = 0x5461
-0x846D = 0x5D67
-0x8471 = 0x3450
-0x8473 = 0x5D5A
-0x8475 = 0x3F7B
-0x8476 = 0x5D63
-0x8478 = 0x5D5F
-0x847A = 0x5D5D
-0x8482 = 0x3559
-0x8487 = 0x5D5B
-0x8488 = 0x5D5C
-0x8489 = 0x5D5E
-0x848B = 0x3D2F
-0x848C = 0x5D64
-0x848E = 0x5D65
-0x8497 = 0x5D75
-0x8499 = 0x4349
-0x849C = 0x4B62
-0x84A1 = 0x5D72
-0x84AF = 0x5861
-0x84B2 = 0x4651
-0x84B4 = 0x5D74
-0x84B8 = 0x5574
-0x84B9 = 0x5D73
-0x84BA = 0x5D70
-0x84BD = 0x5D6C
-0x84BF = 0x5D6F
-0x84C1 = 0x5D68
-0x84C4 = 0x506E
-0x84C9 = 0x4858
-0x84CA = 0x5D6E
-0x84CD = 0x5D69
-0x84D0 = 0x5D6A
-0x84D1 = 0x4B72
-0x84D3 = 0x5D6D
-0x84D6 = 0x314D
-0x84DD = 0x4036
-0x84DF = 0x3C3B
-0x84E0 = 0x5D71
-0x84E3 = 0x5D77
-0x84E5 = 0x5D76
-0x84E6 = 0x5D6B
-0x84EC = 0x456E
-0x84F0 = 0x5D7B
-0x84FC = 0x5E24
-0x84FF = 0x5E23
-0x850C = 0x5D78
-0x8511 = 0x436F
-0x8513 = 0x427B
-0x8517 = 0x5561
-0x851A = 0x4E35
-0x851F = 0x5D7D
-0x8521 = 0x324C
-0x852B = 0x4468
-0x852C = 0x4A5F
-0x8537 = 0x473E
-0x8538 = 0x5D7A
-0x8539 = 0x5D7C
-0x853A = 0x5D7E
-0x853B = 0x5E22
-0x853C = 0x302A
-0x853D = 0x314E
-0x8543 = 0x5E2C
-0x8548 = 0x5E26
-0x8549 = 0x3D36
-0x854A = 0x486F
-0x8556 = 0x5E21
-0x8559 = 0x5E25
-0x855E = 0x5E29
-0x8564 = 0x5E28
-0x8568 = 0x5E27
-0x8572 = 0x5E2D
-0x8574 = 0x544C
-0x8579 = 0x5E33
-0x857A = 0x5E2A
-0x857B = 0x5E2E
-0x857E = 0x4059
-0x8584 = 0x3121
-0x8585 = 0x5E36
-0x8587 = 0x5E31
-0x858F = 0x5E32
-0x859B = 0x5126
-0x859C = 0x5E35
-0x85A4 = 0x5E2F
-0x85A8 = 0x5E30
-0x85AA = 0x503D
-0x85AE = 0x5E34
-0x85AF = 0x4A6D
-0x85B0 = 0x5E39
-0x85B7 = 0x5E38
-0x85B9 = 0x5E37
-0x85C1 = 0x5E3B
-0x85C9 = 0x3D65
-0x85CF = 0x3258
-0x85D0 = 0x436A
-0x85D3 = 0x5E3A
-0x85D5 = 0x453A
-0x85DC = 0x5E3C
-0x85E4 = 0x4C59
-0x85E9 = 0x372A
-0x85FB = 0x5465
-0x85FF = 0x5E3D
-0x8605 = 0x5E3F
-0x8611 = 0x4422
-0x8616 = 0x5E41
-0x8627 = 0x5E3E
-0x8629 = 0x5E40
-0x8638 = 0x553A
-0x863C = 0x5E42
-0x864D = 0x722E
-0x864E = 0x3B22
-0x864F = 0x4232
-0x8650 = 0x4530
-0x8651 = 0x4247
-0x8654 = 0x722F
-0x865A = 0x5069
-0x865E = 0x535D
-0x8662 = 0x6B3D
-0x866B = 0x3366
-0x866C = 0x7230
-0x866E = 0x7231
-0x8671 = 0x4A2D
-0x8679 = 0x3A67
-0x867A = 0x7233
-0x867B = 0x7235
-0x867C = 0x7234
-0x867D = 0x4B64
-0x867E = 0x4F3A
-0x867F = 0x7232
-0x8680 = 0x4A34
-0x8681 = 0x524F
-0x8682 = 0x426C
-0x868A = 0x4E43
-0x868B = 0x7238
-0x868C = 0x3076
-0x868D = 0x7237
-0x8693 = 0x723E
-0x8695 = 0x324F
-0x869C = 0x5141
-0x869D = 0x723A
-0x86A3 = 0x723C
-0x86A4 = 0x5469
-0x86A7 = 0x723B
-0x86A8 = 0x7236
-0x86A9 = 0x723F
-0x86AA = 0x723D
-0x86AC = 0x7239
-0x86AF = 0x7247
-0x86B0 = 0x7244
-0x86B1 = 0x7246
-0x86B4 = 0x724A
-0x86B5 = 0x7242
-0x86B6 = 0x7240
-0x86BA = 0x7245
-0x86C0 = 0x567B
-0x86C4 = 0x7241
-0x86C6 = 0x4779
-0x86C7 = 0x495F
-0x86C9 = 0x7248
-0x86CA = 0x3946
-0x86CB = 0x3530
-0x86CE = 0x7243
-0x86CF = 0x7249
-0x86D0 = 0x7250
-0x86D1 = 0x7256
-0x86D4 = 0x3B57
-0x86D8 = 0x7255
-0x86D9 = 0x4D5C
-0x86DB = 0x566B
-0x86DE = 0x7252
-0x86DF = 0x7254
-0x86E4 = 0x3872
-0x86E9 = 0x724B
-0x86ED = 0x724E
-0x86EE = 0x4279
-0x86F0 = 0x555D
-0x86F1 = 0x724C
-0x86F2 = 0x724D
-0x86F3 = 0x724F
-0x86F4 = 0x7253
-0x86F8 = 0x7259
-0x86F9 = 0x533C
-0x86FE = 0x366A
-0x8700 = 0x4A71
-0x8702 = 0x3764
-0x8703 = 0x7257
-0x8707 = 0x7258
-0x8708 = 0x725A
-0x8709 = 0x725D
-0x870A = 0x725B
-0x870D = 0x725C
-0x8712 = 0x5151
-0x8713 = 0x7251
-0x8715 = 0x4D49
-0x8717 = 0x4E4F
-0x8718 = 0x5629
-0x871A = 0x7263
-0x871C = 0x435B
-0x871E = 0x7260
-0x8721 = 0x402F
-0x8722 = 0x726C
-0x8723 = 0x725E
-0x8725 = 0x7261
-0x8729 = 0x7268
-0x872E = 0x7262
-0x8731 = 0x7267
-0x8734 = 0x7266
-0x8737 = 0x7269
-0x873B = 0x725F
-0x873E = 0x7264
-0x873F = 0x726A
-0x8747 = 0x532C
-0x8748 = 0x7265
-0x8749 = 0x3275
-0x874C = 0x7272
-0x874E = 0x502B
-0x8753 = 0x7275
-0x8757 = 0x3B48
-0x8759 = 0x7279
-0x8760 = 0x7270
-0x8763 = 0x7276
-0x8764 = 0x7278
-0x8765 = 0x727A
-0x876E = 0x7273
-0x8770 = 0x7271
-0x8774 = 0x3A7B
-0x8776 = 0x357B
-0x877B = 0x726F
-0x877C = 0x7277
-0x877D = 0x726D
-0x877E = 0x726E
-0x8782 = 0x726B
-0x8783 = 0x7326
-0x8785 = 0x7323
-0x8788 = 0x7322
-0x878B = 0x7274
-0x878D = 0x485A
-0x8793 = 0x727B
-0x8797 = 0x7325
-0x879F = 0x4378
-0x87A8 = 0x727D
-0x87AB = 0x7327
-0x87AC = 0x7329
-0x87AD = 0x7324
-0x87AF = 0x727C
-0x87B3 = 0x732B
-0x87B5 = 0x732A
-0x87BA = 0x425D
-0x87BD = 0x732E
-0x87C0 = 0x7330
-0x87C6 = 0x7321
-0x87CA = 0x7331
-0x87CB = 0x732C
-0x87D1 = 0x732F
-0x87D2 = 0x727E
-0x87D3 = 0x732D
-0x87DB = 0x7332
-0x87E0 = 0x7334
-0x87E5 = 0x7328
-0x87EA = 0x7333
-0x87EE = 0x7335
-0x87F9 = 0x5037
-0x87FE = 0x7338
-0x8803 = 0x5979
-0x880A = 0x7339
-0x8813 = 0x7337
-0x8815 = 0x4864
-0x8816 = 0x7336
-0x881B = 0x733A
-0x8821 = 0x733B
-0x8822 = 0x3440
-0x8832 = 0x6E43
-0x8839 = 0x733C
-0x883C = 0x733D
-0x8840 = 0x512A
-0x8844 = 0x742C
-0x8845 = 0x5046
-0x884C = 0x5050
-0x884D = 0x515C
-0x8854 = 0x4F4E
-0x8857 = 0x3D56
-0x8859 = 0x5143
-0x8861 = 0x3A62
-0x8862 = 0x6169
-0x8863 = 0x5242
-0x8864 = 0x7142
-0x8865 = 0x3239
-0x8868 = 0x316D
-0x8869 = 0x7143
-0x886B = 0x4940
-0x886C = 0x3344
-0x886E = 0x5972
-0x8870 = 0x4B25
-0x8872 = 0x7144
-0x8877 = 0x5654
-0x887D = 0x7145
-0x887E = 0x7440
-0x887F = 0x7146
-0x8881 = 0x542C
-0x8882 = 0x7147
-0x8884 = 0x3040
-0x8885 = 0x7441
-0x8888 = 0x7442
-0x888B = 0x347C
-0x888D = 0x455B
-0x8892 = 0x4C3B
-0x8896 = 0x5064
-0x889C = 0x4D60
-0x88A2 = 0x7148
-0x88A4 = 0x5973
-0x88AB = 0x313B
-0x88AD = 0x4F2E
-0x88B1 = 0x3824
-0x88B7 = 0x714A
-0x88BC = 0x714B
-0x88C1 = 0x3243
-0x88C2 = 0x4151
-0x88C5 = 0x5730
-0x88C6 = 0x7149
-0x88C9 = 0x714C
-0x88CE = 0x714E
-0x88D2 = 0x5976
-0x88D4 = 0x5261
-0x88D5 = 0x5423
-0x88D8 = 0x7443
-0x88D9 = 0x4839
-0x88DF = 0x7444
-0x88E2 = 0x714D
-0x88E3 = 0x714F
-0x88E4 = 0x3F63
-0x88E5 = 0x7150
-0x88E8 = 0x7154
-0x88F0 = 0x7156
-0x88F1 = 0x7151
-0x88F3 = 0x4951
-0x88F4 = 0x4561
-0x88F8 = 0x4263
-0x88F9 = 0x397C
-0x88FC = 0x7153
-0x88FE = 0x7155
-0x8902 = 0x3953
-0x890A = 0x715B
-0x8910 = 0x3A56
-0x8912 = 0x307D
-0x8913 = 0x7159
-0x8919 = 0x7158
-0x891A = 0x7152
-0x891B = 0x715A
-0x8921 = 0x7157
-0x8925 = 0x486C
-0x892A = 0x4D4A
-0x892B = 0x715D
-0x8930 = 0x653D
-0x8934 = 0x715C
-0x8936 = 0x715E
-0x8941 = 0x715F
-0x8944 = 0x4F65
-0x895E = 0x7445
-0x895F = 0x3D73
-0x8966 = 0x7160
-0x897B = 0x7161
-0x897F = 0x4E77
-0x8981 = 0x522A
-0x8983 = 0x717B
-0x8986 = 0x3832
-0x89C1 = 0x3C7B
-0x89C2 = 0x395B
-0x89C4 = 0x3966
-0x89C5 = 0x4359
-0x89C6 = 0x4A53
-0x89C7 = 0x6A68
-0x89C8 = 0x4040
-0x89C9 = 0x3E75
-0x89CA = 0x6A69
-0x89CB = 0x6A6A
-0x89CC = 0x6A6B
-0x89CE = 0x6A6C
-0x89CF = 0x6A6D
-0x89D0 = 0x6A6E
-0x89D1 = 0x6A6F
-0x89D2 = 0x3D47
-0x89D6 = 0x757B
-0x89DA = 0x757D
-0x89DC = 0x757E
-0x89DE = 0x757C
-0x89E3 = 0x3D62
-0x89E5 = 0x7621
-0x89E6 = 0x3425
-0x89EB = 0x7622
-0x89EF = 0x7623
-0x89F3 = 0x6C32
-0x8A00 = 0x5154
-0x8A07 = 0x596A
-0x8A3E = 0x7624
-0x8A48 = 0x6E3A
-0x8A79 = 0x5532
-0x8A89 = 0x537E
-0x8A8A = 0x4C5C
-0x8A93 = 0x4A44
-0x8B07 = 0x6540
-0x8B26 = 0x7625
-0x8B66 = 0x3E2F
-0x8B6C = 0x4629
-0x8BA0 = 0x5A25
-0x8BA1 = 0x3C46
-0x8BA2 = 0x3629
-0x8BA3 = 0x383C
-0x8BA4 = 0x484F
-0x8BA5 = 0x3C25
-0x8BA6 = 0x5A26
-0x8BA7 = 0x5A27
-0x8BA8 = 0x4C56
-0x8BA9 = 0x4843
-0x8BAA = 0x5A28
-0x8BAB = 0x467D
-0x8BAD = 0x5135
-0x8BAE = 0x5269
-0x8BAF = 0x5136
-0x8BB0 = 0x3C47
-0x8BB2 = 0x3D32
-0x8BB3 = 0x3B64
-0x8BB4 = 0x5A29
-0x8BB5 = 0x5A2A
-0x8BB6 = 0x5148
-0x8BB7 = 0x5A2B
-0x8BB8 = 0x506D
-0x8BB9 = 0x366F
-0x8BBA = 0x425B
-0x8BBC = 0x4B4F
-0x8BBD = 0x376D
-0x8BBE = 0x4968
-0x8BBF = 0x3743
-0x8BC0 = 0x3E77
-0x8BC1 = 0x5624
-0x8BC2 = 0x5A2C
-0x8BC3 = 0x5A2D
-0x8BC4 = 0x4640
-0x8BC5 = 0x5767
-0x8BC6 = 0x4A36
-0x8BC8 = 0x5529
-0x8BC9 = 0x4B5F
-0x8BCA = 0x556F
-0x8BCB = 0x5A2E
-0x8BCC = 0x565F
-0x8BCD = 0x344A
-0x8BCE = 0x5A30
-0x8BCF = 0x5A2F
-0x8BD1 = 0x526B
-0x8BD2 = 0x5A31
-0x8BD3 = 0x5A32
-0x8BD4 = 0x5A33
-0x8BD5 = 0x4A54
-0x8BD6 = 0x5A34
-0x8BD7 = 0x4A2B
-0x8BD8 = 0x5A35
-0x8BD9 = 0x5A36
-0x8BDA = 0x334F
-0x8BDB = 0x566F
-0x8BDC = 0x5A37
-0x8BDD = 0x3B30
-0x8BDE = 0x352E
-0x8BDF = 0x5A38
-0x8BE0 = 0x5A39
-0x8BE1 = 0x396E
-0x8BE2 = 0x512F
-0x8BE3 = 0x5268
-0x8BE4 = 0x5A3A
-0x8BE5 = 0x3843
-0x8BE6 = 0x4F6A
-0x8BE7 = 0x326F
-0x8BE8 = 0x5A3B
-0x8BE9 = 0x5A3C
-0x8BEB = 0x3D6B
-0x8BEC = 0x4E5C
-0x8BED = 0x536F
-0x8BEE = 0x5A3D
-0x8BEF = 0x4E73
-0x8BF0 = 0x5A3E
-0x8BF1 = 0x5355
-0x8BF2 = 0x3B65
-0x8BF3 = 0x5A3F
-0x8BF4 = 0x4B35
-0x8BF5 = 0x4B50
-0x8BF6 = 0x5A40
-0x8BF7 = 0x476B
-0x8BF8 = 0x566E
-0x8BF9 = 0x5A41
-0x8BFA = 0x4535
-0x8BFB = 0x3641
-0x8BFC = 0x5A42
-0x8BFD = 0x374C
-0x8BFE = 0x3F4E
-0x8BFF = 0x5A43
-0x8C00 = 0x5A44
-0x8C01 = 0x4B2D
-0x8C02 = 0x5A45
-0x8C03 = 0x3577
-0x8C04 = 0x5A46
-0x8C05 = 0x4142
-0x8C06 = 0x573B
-0x8C07 = 0x5A47
-0x8C08 = 0x4C38
-0x8C0A = 0x526A
-0x8C0B = 0x4431
-0x8C0C = 0x5A48
-0x8C0D = 0x357D
-0x8C0E = 0x3B51
-0x8C0F = 0x5A49
-0x8C10 = 0x5033
-0x8C11 = 0x5A4A
-0x8C12 = 0x5A4B
-0x8C13 = 0x4E3D
-0x8C14 = 0x5A4C
-0x8C15 = 0x5A4D
-0x8C16 = 0x5A4E
-0x8C17 = 0x3277
-0x8C18 = 0x5A51
-0x8C19 = 0x5A4F
-0x8C1A = 0x5168
-0x8C1B = 0x5A50
-0x8C1C = 0x4355
-0x8C1D = 0x5A52
-0x8C1F = 0x5A53
-0x8C20 = 0x5A54
-0x8C21 = 0x5A55
-0x8C22 = 0x503B
-0x8C23 = 0x5225
-0x8C24 = 0x3079
-0x8C25 = 0x5A56
-0x8C26 = 0x472B
-0x8C27 = 0x5A57
-0x8C28 = 0x3D77
-0x8C29 = 0x4321
-0x8C2A = 0x5A58
-0x8C2B = 0x5A59
-0x8C2C = 0x437D
-0x8C2D = 0x4C37
-0x8C2E = 0x5A5A
-0x8C2F = 0x5A5B
-0x8C30 = 0x403E
-0x8C31 = 0x4657
-0x8C32 = 0x5A5C
-0x8C33 = 0x5A5D
-0x8C34 = 0x4734
-0x8C35 = 0x5A5E
-0x8C36 = 0x5A5F
-0x8C37 = 0x3948
-0x8C41 = 0x3B6D
-0x8C46 = 0x3639
-0x8C47 = 0x7478
-0x8C49 = 0x7479
-0x8C4C = 0x4D63
-0x8C55 = 0x7539
-0x8C5A = 0x6B60
-0x8C61 = 0x4F73
-0x8C62 = 0x3B3F
-0x8C6A = 0x3A40
-0x8C6B = 0x5425
-0x8C73 = 0x6159
-0x8C78 = 0x7574
-0x8C79 = 0x312A
-0x8C7A = 0x3272
-0x8C82 = 0x7575
-0x8C85 = 0x7577
-0x8C89 = 0x3A51
-0x8C8A = 0x7576
-0x8C8C = 0x4332
-0x8C94 = 0x7579
-0x8C98 = 0x7578
-0x8D1D = 0x3134
-0x8D1E = 0x556A
-0x8D1F = 0x383A
-0x8D21 = 0x3931
-0x8D22 = 0x3246
-0x8D23 = 0x5470
-0x8D24 = 0x4F4D
-0x8D25 = 0x305C
-0x8D26 = 0x554B
-0x8D27 = 0x3B75
-0x8D28 = 0x564A
-0x8D29 = 0x3737
-0x8D2A = 0x4C30
-0x8D2B = 0x4636
-0x8D2C = 0x3161
-0x8D2D = 0x393A
-0x8D2E = 0x567C
-0x8D2F = 0x3961
-0x8D30 = 0x3721
-0x8D31 = 0x3C7A
-0x8D32 = 0x6A5A
-0x8D33 = 0x6A5B
-0x8D34 = 0x4C79
-0x8D35 = 0x3973
-0x8D36 = 0x6A5C
-0x8D37 = 0x347B
-0x8D38 = 0x4333
-0x8D39 = 0x3751
-0x8D3A = 0x3A58
-0x8D3B = 0x6A5D
-0x8D3C = 0x5474
-0x8D3D = 0x6A5E
-0x8D3E = 0x3C56
-0x8D3F = 0x3B5F
-0x8D40 = 0x6A5F
-0x8D41 = 0x415E
-0x8D42 = 0x4238
-0x8D43 = 0x545F
-0x8D44 = 0x574A
-0x8D45 = 0x6A60
-0x8D46 = 0x6A61
-0x8D47 = 0x6A64
-0x8D48 = 0x6A62
-0x8D49 = 0x6A63
-0x8D4A = 0x495E
-0x8D4B = 0x3833
-0x8D4C = 0x3644
-0x8D4D = 0x6A65
-0x8D4E = 0x4A6A
-0x8D4F = 0x494D
-0x8D50 = 0x344D
-0x8D53 = 0x6259
-0x8D54 = 0x4562
-0x8D55 = 0x6A66
-0x8D56 = 0x4035
-0x8D58 = 0x5738
-0x8D59 = 0x6A67
-0x8D5A = 0x572C
-0x8D5B = 0x487C
-0x8D5C = 0x5853
-0x8D5D = 0x584D
-0x8D5E = 0x545E
-0x8D60 = 0x5479
-0x8D61 = 0x4944
-0x8D62 = 0x532E
-0x8D63 = 0x3853
-0x8D64 = 0x3360
-0x8D66 = 0x4962
-0x8D67 = 0x7476
-0x8D6B = 0x3A55
-0x8D6D = 0x7477
-0x8D70 = 0x575F
-0x8D73 = 0x7471
-0x8D74 = 0x3830
-0x8D75 = 0x5554
-0x8D76 = 0x384F
-0x8D77 = 0x4670
-0x8D81 = 0x3343
-0x8D84 = 0x7472
-0x8D85 = 0x332C
-0x8D8A = 0x543D
-0x8D8B = 0x4777
-0x8D91 = 0x7474
-0x8D94 = 0x7473
-0x8D9F = 0x4C4B
-0x8DA3 = 0x4824
-0x8DB1 = 0x7475
-0x8DB3 = 0x5763
-0x8DB4 = 0x453F
-0x8DB5 = 0x7540
-0x8DB8 = 0x753B
-0x8DBA = 0x7543
-0x8DBC = 0x7542
-0x8DBE = 0x563A
-0x8DBF = 0x7541
-0x8DC3 = 0x543E
-0x8DC4 = 0x7544
-0x8DC6 = 0x754C
-0x8DCB = 0x304F
-0x8DCC = 0x3578
-0x8DCE = 0x7549
-0x8DCF = 0x754A
-0x8DD1 = 0x455C
-0x8DD6 = 0x7545
-0x8DD7 = 0x7546
-0x8DDA = 0x7547
-0x8DDB = 0x754B
-0x8DDD = 0x3E60
-0x8DDE = 0x7548
-0x8DDF = 0x387A
-0x8DE3 = 0x7550
-0x8DE4 = 0x7553
-0x8DE8 = 0x3F67
-0x8DEA = 0x3972
-0x8DEB = 0x753C
-0x8DEC = 0x754D
-0x8DEF = 0x4237
-0x8DF3 = 0x4C78
-0x8DF5 = 0x3C79
-0x8DF7 = 0x754E
-0x8DF8 = 0x754F
-0x8DF9 = 0x7551
-0x8DFA = 0x3665
-0x8DFB = 0x7552
-0x8DFD = 0x7555
-0x8E05 = 0x753D
-0x8E09 = 0x7554
-0x8E0A = 0x533B
-0x8E0C = 0x336C
-0x8E0F = 0x4C24
-0x8E14 = 0x7556
-0x8E1D = 0x7557
-0x8E1E = 0x3E61
-0x8E1F = 0x7558
-0x8E22 = 0x4C5F
-0x8E23 = 0x755B
-0x8E29 = 0x3248
-0x8E2A = 0x5759
-0x8E2C = 0x7559
-0x8E2E = 0x755A
-0x8E2F = 0x755C
-0x8E31 = 0x7562
-0x8E35 = 0x7560
-0x8E39 = 0x755F
-0x8E3A = 0x755D
-0x8E3D = 0x7561
-0x8E40 = 0x755E
-0x8E41 = 0x7564
-0x8E42 = 0x7565
-0x8E44 = 0x4C63
-0x8E47 = 0x653F
-0x8E48 = 0x3538
-0x8E49 = 0x7563
-0x8E4A = 0x7568
-0x8E4B = 0x4C23
-0x8E51 = 0x7566
-0x8E52 = 0x7567
-0x8E59 = 0x753E
-0x8E66 = 0x3144
-0x8E69 = 0x753F
-0x8E6C = 0x3545
-0x8E6D = 0x3264
-0x8E6F = 0x756C
-0x8E70 = 0x7569
-0x8E72 = 0x3657
-0x8E74 = 0x756D
-0x8E76 = 0x756A
-0x8E7C = 0x756B
-0x8E7F = 0x345A
-0x8E81 = 0x546A
-0x8E85 = 0x756E
-0x8E87 = 0x3379
-0x8E8F = 0x756F
-0x8E90 = 0x7571
-0x8E94 = 0x7570
-0x8E9C = 0x7572
-0x8E9E = 0x7573
-0x8EAB = 0x496D
-0x8EAC = 0x392A
-0x8EAF = 0x477B
-0x8EB2 = 0x3663
-0x8EBA = 0x4C49
-0x8ECE = 0x6A26
-0x8F66 = 0x3335
-0x8F67 = 0x547E
-0x8F68 = 0x396C
-0x8F69 = 0x5079
-0x8F6B = 0x696D
-0x8F6C = 0x572A
-0x8F6D = 0x696E
-0x8F6E = 0x4256
-0x8F6F = 0x486D
-0x8F70 = 0x3A64
-0x8F71 = 0x696F
-0x8F72 = 0x6970
-0x8F73 = 0x6971
-0x8F74 = 0x5661
-0x8F75 = 0x6972
-0x8F76 = 0x6973
-0x8F77 = 0x6975
-0x8F78 = 0x6974
-0x8F79 = 0x6976
-0x8F7A = 0x6977
-0x8F7B = 0x4761
-0x8F7C = 0x6978
-0x8F7D = 0x5458
-0x8F7E = 0x6979
-0x8F7F = 0x3D4E
-0x8F81 = 0x697A
-0x8F82 = 0x697B
-0x8F83 = 0x3D4F
-0x8F84 = 0x697C
-0x8F85 = 0x3828
-0x8F86 = 0x413E
-0x8F87 = 0x697D
-0x8F88 = 0x3132
-0x8F89 = 0x3B54
-0x8F8A = 0x3975
-0x8F8B = 0x697E
-0x8F8D = 0x6A21
-0x8F8E = 0x6A22
-0x8F8F = 0x6A23
-0x8F90 = 0x3778
-0x8F91 = 0x3C2D
-0x8F93 = 0x4A64
-0x8F94 = 0x604E
-0x8F95 = 0x542F
-0x8F96 = 0x4F3D
-0x8F97 = 0x5537
-0x8F98 = 0x6A24
-0x8F99 = 0x555E
-0x8F9A = 0x6A25
-0x8F9B = 0x5041
-0x8F9C = 0x393C
-0x8F9E = 0x3447
-0x8F9F = 0x3159
-0x8FA3 = 0x4031
-0x8FA8 = 0x3166
-0x8FA9 = 0x3167
-0x8FAB = 0x3168
-0x8FB0 = 0x333D
-0x8FB1 = 0x4868
-0x8FB6 = 0x6541
-0x8FB9 = 0x315F
-0x8FBD = 0x4149
-0x8FBE = 0x346F
-0x8FC1 = 0x4728
-0x8FC2 = 0x5358
-0x8FC4 = 0x4679
-0x8FC5 = 0x5138
-0x8FC7 = 0x397D
-0x8FC8 = 0x4275
-0x8FCE = 0x532D
-0x8FD0 = 0x544B
-0x8FD1 = 0x3D7C
-0x8FD3 = 0x6542
-0x8FD4 = 0x3735
-0x8FD5 = 0x6543
-0x8FD8 = 0x3B39
-0x8FD9 = 0x5562
-0x8FDB = 0x3D78
-0x8FDC = 0x5436
-0x8FDD = 0x4E25
-0x8FDE = 0x412C
-0x8FDF = 0x3359
-0x8FE2 = 0x4C76
-0x8FE4 = 0x6546
-0x8FE5 = 0x6544
-0x8FE6 = 0x6548
-0x8FE8 = 0x654A
-0x8FE9 = 0x6547
-0x8FEA = 0x354F
-0x8FEB = 0x4648
-0x8FED = 0x357C
-0x8FEE = 0x6545
-0x8FF0 = 0x4A76
-0x8FF3 = 0x6549
-0x8FF7 = 0x4354
-0x8FF8 = 0x3145
-0x8FF9 = 0x3C23
-0x8FFD = 0x5737
-0x9000 = 0x4D4B
-0x9001 = 0x4B4D
-0x9002 = 0x4A4A
-0x9003 = 0x4C53
-0x9004 = 0x654C
-0x9005 = 0x654B
-0x9006 = 0x4466
-0x9009 = 0x5121
-0x900A = 0x5137
-0x900B = 0x654D
-0x900D = 0x6550
-0x900F = 0x4D38
-0x9010 = 0x5670
-0x9011 = 0x654F
-0x9012 = 0x355D
-0x9014 = 0x4D3E
-0x9016 = 0x6551
-0x9017 = 0x363A
-0x901A = 0x4D28
-0x901B = 0x3964
-0x901D = 0x4A45
-0x901E = 0x3351
-0x901F = 0x4B59
-0x9020 = 0x546C
-0x9021 = 0x6552
-0x9022 = 0x376A
-0x9026 = 0x654E
-0x902D = 0x6555
-0x902E = 0x347E
-0x902F = 0x6556
-0x9035 = 0x6553
-0x9036 = 0x6554
-0x9038 = 0x525D
-0x903B = 0x425F
-0x903C = 0x3146
-0x903E = 0x5362
-0x9041 = 0x365D
-0x9042 = 0x4B6C
-0x9044 = 0x6557
-0x9047 = 0x5376
-0x904D = 0x3169
-0x904F = 0x3674
-0x9050 = 0x655A
-0x9051 = 0x6558
-0x9052 = 0x6559
-0x9053 = 0x3540
-0x9057 = 0x5245
-0x9058 = 0x655C
-0x905B = 0x655E
-0x9062 = 0x655D
-0x9063 = 0x4732
-0x9065 = 0x5223
-0x9068 = 0x655B
-0x906D = 0x5462
-0x906E = 0x555A
-0x9074 = 0x6560
-0x9075 = 0x5771
-0x907D = 0x6561
-0x907F = 0x315C
-0x9080 = 0x517B
-0x9082 = 0x6562
-0x9083 = 0x6564
-0x9088 = 0x6563
-0x908B = 0x6565
-0x9091 = 0x5258
-0x9093 = 0x354B
-0x9095 = 0x675F
-0x9097 = 0x5A75
-0x9099 = 0x5A78
-0x909B = 0x5A76
-0x909D = 0x5A77
-0x90A1 = 0x5A7A
-0x90A2 = 0x504F
-0x90A3 = 0x4447
-0x90A6 = 0x306E
-0x90AA = 0x5030
-0x90AC = 0x5A79
-0x90AE = 0x534A
-0x90AF = 0x3A2A
-0x90B0 = 0x5B22
-0x90B1 = 0x4771
-0x90B3 = 0x5A7C
-0x90B4 = 0x5A7B
-0x90B5 = 0x495B
-0x90B6 = 0x5A7D
-0x90B8 = 0x5B21
-0x90B9 = 0x575E
-0x90BA = 0x5A7E
-0x90BB = 0x415A
-0x90BE = 0x5B25
-0x90C1 = 0x5374
-0x90C4 = 0x5B27
-0x90C5 = 0x5B24
-0x90C7 = 0x5B28
-0x90CA = 0x3D3C
-0x90CE = 0x4049
-0x90CF = 0x5B23
-0x90D0 = 0x5B26
-0x90D1 = 0x5623
-0x90D3 = 0x5B29
-0x90D7 = 0x5B2D
-0x90DB = 0x5B2E
-0x90DC = 0x5B2C
-0x90DD = 0x3A42
-0x90E1 = 0x3F24
-0x90E2 = 0x5B2B
-0x90E6 = 0x5B2A
-0x90E7 = 0x5447
-0x90E8 = 0x323F
-0x90EB = 0x5B2F
-0x90ED = 0x3979
-0x90EF = 0x5B30
-0x90F4 = 0x333B
-0x90F8 = 0x3526
-0x90FD = 0x363C
-0x90FE = 0x5B31
-0x9102 = 0x3675
-0x9104 = 0x5B32
-0x9119 = 0x3149
-0x911E = 0x5B34
-0x9122 = 0x5B33
-0x9123 = 0x5B35
-0x912F = 0x5B37
-0x9131 = 0x5B36
-0x9139 = 0x5B38
-0x9143 = 0x5B39
-0x9146 = 0x5B3A
-0x9149 = 0x534F
-0x914A = 0x747A
-0x914B = 0x4775
-0x914C = 0x5743
-0x914D = 0x4564
-0x914E = 0x747C
-0x914F = 0x747D
-0x9150 = 0x747B
-0x9152 = 0x3E46
-0x9157 = 0x506F
-0x915A = 0x3753
-0x915D = 0x544D
-0x915E = 0x4C2A
-0x9161 = 0x7522
-0x9162 = 0x7521
-0x9163 = 0x3A28
-0x9164 = 0x747E
-0x9165 = 0x4B56
-0x9169 = 0x7524
-0x916A = 0x4052
-0x916C = 0x336A
-0x916E = 0x4D2A
-0x916F = 0x7525
-0x9170 = 0x7523
-0x9171 = 0x3D34
-0x9172 = 0x7528
-0x9174 = 0x7529
-0x9175 = 0x3D4D
-0x9176 = 0x4338
-0x9177 = 0x3F61
-0x9178 = 0x4B61
-0x9179 = 0x752A
-0x917D = 0x7526
-0x917E = 0x7527
-0x917F = 0x4470
-0x9185 = 0x752C
-0x9187 = 0x343C
-0x9189 = 0x576D
-0x918B = 0x3457
-0x918C = 0x752B
-0x918D = 0x752E
-0x9190 = 0x752D
-0x9191 = 0x752F
-0x9192 = 0x5051
-0x919A = 0x4351
-0x919B = 0x4829
-0x91A2 = 0x7530
-0x91A3 = 0x7531
-0x91AA = 0x7532
-0x91AD = 0x7533
-0x91AE = 0x7534
-0x91AF = 0x7535
-0x91B4 = 0x7537
-0x91B5 = 0x7536
-0x91BA = 0x7538
-0x91C7 = 0x3249
-0x91C9 = 0x5354
-0x91CA = 0x4A4D
-0x91CC = 0x406F
-0x91CD = 0x5658
-0x91CE = 0x5230
-0x91CF = 0x413F
-0x91D1 = 0x3D70
-0x91DC = 0x382A
-0x9274 = 0x3C78
-0x928E = 0x7646
-0x92AE = 0x7647
-0x92C8 = 0x7648
-0x933E = 0x7649
-0x936A = 0x764A
-0x938F = 0x764C
-0x93CA = 0x764B
-0x93D6 = 0x7769
-0x943E = 0x764D
-0x946B = 0x764E
-0x9485 = 0x6E44
-0x9486 = 0x6E45
-0x9487 = 0x6E46
-0x9488 = 0x556B
-0x9489 = 0x3624
-0x948A = 0x6E48
-0x948B = 0x6E47
-0x948C = 0x6E49
-0x948D = 0x6E4A
-0x948E = 0x4725
-0x948F = 0x6E4B
-0x9490 = 0x6E4C
-0x9492 = 0x3730
-0x9493 = 0x3576
-0x9494 = 0x6E4D
-0x9495 = 0x6E4F
-0x9497 = 0x6E4E
-0x9499 = 0x3846
-0x949A = 0x6E50
-0x949B = 0x6E51
-0x949C = 0x6E52
-0x949D = 0x365B
-0x949E = 0x332E
-0x949F = 0x5653
-0x94A0 = 0x4446
-0x94A1 = 0x3135
-0x94A2 = 0x3856
-0x94A3 = 0x6E53
-0x94A4 = 0x6E54
-0x94A5 = 0x543F
-0x94A6 = 0x4755
-0x94A7 = 0x3E7B
-0x94A8 = 0x4E59
-0x94A9 = 0x3933
-0x94AA = 0x6E56
-0x94AB = 0x6E55
-0x94AC = 0x6E58
-0x94AD = 0x6E57
-0x94AE = 0x4525
-0x94AF = 0x6E59
-0x94B0 = 0x6E5A
-0x94B1 = 0x472E
-0x94B2 = 0x6E5B
-0x94B3 = 0x472F
-0x94B4 = 0x6E5C
-0x94B5 = 0x3227
-0x94B6 = 0x6E5D
-0x94B7 = 0x6E5E
-0x94B8 = 0x6E5F
-0x94B9 = 0x6E60
-0x94BA = 0x6E61
-0x94BB = 0x576A
-0x94BC = 0x6E62
-0x94BD = 0x6E63
-0x94BE = 0x3C58
-0x94BF = 0x6E64
-0x94C0 = 0x534B
-0x94C1 = 0x4C7A
-0x94C2 = 0x322C
-0x94C3 = 0x4165
-0x94C4 = 0x6E65
-0x94C5 = 0x4726
-0x94C6 = 0x432D
-0x94C8 = 0x6E66
-0x94C9 = 0x6E67
-0x94CA = 0x6E68
-0x94CB = 0x6E69
-0x94CC = 0x6E6A
-0x94CD = 0x6E6B
-0x94CE = 0x6E6C
-0x94D0 = 0x6E6D
-0x94D1 = 0x6E6E
-0x94D2 = 0x6E6F
-0x94D5 = 0x6E70
-0x94D6 = 0x6E71
-0x94D7 = 0x6E72
-0x94D8 = 0x6E74
-0x94D9 = 0x6E73
-0x94DB = 0x6E75
-0x94DC = 0x4D2D
-0x94DD = 0x4241
-0x94DE = 0x6E76
-0x94DF = 0x6E77
-0x94E0 = 0x6E78
-0x94E1 = 0x5521
-0x94E2 = 0x6E79
-0x94E3 = 0x4F33
-0x94E4 = 0x6E7A
-0x94E5 = 0x6E7B
-0x94E7 = 0x6E7C
-0x94E8 = 0x6E7D
-0x94E9 = 0x6F21
-0x94EA = 0x6E7E
-0x94EB = 0x6F22
-0x94EC = 0x3875
-0x94ED = 0x437A
-0x94EE = 0x6F23
-0x94EF = 0x6F24
-0x94F0 = 0x3D42
-0x94F1 = 0x523F
-0x94F2 = 0x3279
-0x94F3 = 0x6F25
-0x94F4 = 0x6F26
-0x94F5 = 0x6F27
-0x94F6 = 0x5278
-0x94F7 = 0x6F28
-0x94F8 = 0x567D
-0x94F9 = 0x6F29
-0x94FA = 0x464C
-0x94FC = 0x6F2A
-0x94FD = 0x6F2B
-0x94FE = 0x4134
-0x94FF = 0x6F2C
-0x9500 = 0x4F7A
-0x9501 = 0x4B78
-0x9502 = 0x6F2E
-0x9503 = 0x6F2D
-0x9504 = 0x337A
-0x9505 = 0x3978
-0x9506 = 0x6F2F
-0x9507 = 0x6F30
-0x9508 = 0x5062
-0x9509 = 0x6F31
-0x950A = 0x6F32
-0x950B = 0x3766
-0x950C = 0x503F
-0x950D = 0x6F33
-0x950E = 0x6F34
-0x950F = 0x6F35
-0x9510 = 0x4871
-0x9511 = 0x4C60
-0x9512 = 0x6F36
-0x9513 = 0x6F37
-0x9514 = 0x6F38
-0x9515 = 0x6F39
-0x9516 = 0x6F3A
-0x9517 = 0x5560
-0x9518 = 0x6F3B
-0x9519 = 0x346D
-0x951A = 0x432A
-0x951B = 0x6F3C
-0x951D = 0x6F3D
-0x951E = 0x6F3E
-0x951F = 0x6F3F
-0x9521 = 0x4E7D
-0x9522 = 0x6F40
-0x9523 = 0x4260
-0x9524 = 0x3438
-0x9525 = 0x5736
-0x9526 = 0x3D75
-0x9528 = 0x4F47
-0x9529 = 0x6F43
-0x952A = 0x6F41
-0x952B = 0x6F42
-0x952C = 0x6F44
-0x952D = 0x3627
-0x952E = 0x3C7C
-0x952F = 0x3E62
-0x9530 = 0x434C
-0x9531 = 0x6F45
-0x9532 = 0x6F46
-0x9534 = 0x6F47
-0x9535 = 0x6F4F
-0x9536 = 0x6F48
-0x9537 = 0x6F49
-0x9538 = 0x6F4A
-0x9539 = 0x4742
-0x953A = 0x6F71
-0x953B = 0x364D
-0x953C = 0x6F4B
-0x953E = 0x6F4C
-0x953F = 0x6F4D
-0x9540 = 0x3646
-0x9541 = 0x433E
-0x9542 = 0x6F4E
-0x9544 = 0x6F50
-0x9545 = 0x6F51
-0x9546 = 0x6F52
-0x9547 = 0x5572
-0x9549 = 0x6F53
-0x954A = 0x4477
-0x954C = 0x6F54
-0x954D = 0x4478
-0x954E = 0x6F55
-0x954F = 0x6F56
-0x9550 = 0x3864
-0x9551 = 0x3077
-0x9552 = 0x6F57
-0x9553 = 0x6F58
-0x9554 = 0x6F59
-0x9556 = 0x6F5A
-0x9557 = 0x6F5B
-0x9558 = 0x6F5C
-0x9559 = 0x6F5D
-0x955B = 0x6F5E
-0x955C = 0x3E35
-0x955D = 0x6F61
-0x955E = 0x6F5F
-0x955F = 0x6F60
-0x9561 = 0x6F62
-0x9562 = 0x6F63
-0x9563 = 0x414D
-0x9564 = 0x6F64
-0x9565 = 0x6F65
-0x9566 = 0x6F66
-0x9567 = 0x6F67
-0x9568 = 0x6F68
-0x9569 = 0x6F69
-0x956A = 0x6F6A
-0x956B = 0x6F6B
-0x956C = 0x6F6C
-0x956D = 0x4058
-0x956F = 0x6F6D
-0x9570 = 0x412D
-0x9571 = 0x6F6E
-0x9572 = 0x6F6F
-0x9573 = 0x6F70
-0x9576 = 0x4F62
-0x957F = 0x3324
-0x95E8 = 0x4345
-0x95E9 = 0x6345
-0x95EA = 0x4941
-0x95EB = 0x6346
-0x95ED = 0x3155
-0x95EE = 0x4E4A
-0x95EF = 0x3433
-0x95F0 = 0x4872
-0x95F1 = 0x6347
-0x95F2 = 0x4F50
-0x95F3 = 0x6348
-0x95F4 = 0x3C64
-0x95F5 = 0x6349
-0x95F6 = 0x634A
-0x95F7 = 0x4346
-0x95F8 = 0x5522
-0x95F9 = 0x4456
-0x95FA = 0x396B
-0x95FB = 0x4E45
-0x95FC = 0x634B
-0x95FD = 0x4376
-0x95FE = 0x634C
-0x9600 = 0x3727
-0x9601 = 0x3873
-0x9602 = 0x3A52
-0x9603 = 0x634D
-0x9604 = 0x634E
-0x9605 = 0x5444
-0x9606 = 0x634F
-0x9608 = 0x6350
-0x9609 = 0x514B
-0x960A = 0x6351
-0x960B = 0x6352
-0x960C = 0x6353
-0x960D = 0x6354
-0x960E = 0x5156
-0x960F = 0x6355
-0x9610 = 0x327B
-0x9611 = 0x403B
-0x9612 = 0x6356
-0x9614 = 0x402B
-0x9615 = 0x6357
-0x9616 = 0x6358
-0x9617 = 0x6359
-0x9619 = 0x635A
-0x961A = 0x635B
-0x961C = 0x3837
-0x961D = 0x5A62
-0x961F = 0x3653
-0x9621 = 0x5A64
-0x9622 = 0x5A63
-0x962A = 0x5A66
-0x962E = 0x486E
-0x9631 = 0x5A65
-0x9632 = 0x3740
-0x9633 = 0x5174
-0x9634 = 0x5275
-0x9635 = 0x5573
-0x9636 = 0x3D57
-0x963B = 0x5768
-0x963C = 0x5A68
-0x963D = 0x5A67
-0x963F = 0x3022
-0x9640 = 0x4D53
-0x9642 = 0x5A69
-0x9644 = 0x383D
-0x9645 = 0x3C4A
-0x9646 = 0x423D
-0x9647 = 0x4224
-0x9648 = 0x3342
-0x9649 = 0x5A6A
-0x964B = 0x422A
-0x964C = 0x4430
-0x964D = 0x3D35
-0x9650 = 0x4F5E
-0x9654 = 0x5A6B
-0x9655 = 0x4942
-0x965B = 0x315D
-0x965F = 0x5A6C
-0x9661 = 0x3638
-0x9662 = 0x543A
-0x9664 = 0x337D
-0x9667 = 0x5A6D
-0x9668 = 0x5449
-0x9669 = 0x4F55
-0x966A = 0x4563
-0x966C = 0x5A6E
-0x9672 = 0x5A6F
-0x9674 = 0x5A70
-0x9675 = 0x416A
-0x9676 = 0x4C55
-0x9677 = 0x4F5D
-0x9685 = 0x5367
-0x9686 = 0x4221
-0x9688 = 0x5A71
-0x968B = 0x4B65
-0x968D = 0x5A72
-0x968F = 0x4B66
-0x9690 = 0x527E
-0x9694 = 0x3874
-0x9697 = 0x5A73
-0x9698 = 0x302F
-0x9699 = 0x4F36
-0x969C = 0x554F
-0x96A7 = 0x4B6D
-0x96B0 = 0x5A74
-0x96B3 = 0x6344
-0x96B6 = 0x4125
-0x96B9 = 0x763F
-0x96BC = 0x7640
-0x96BD = 0x7641
-0x96BE = 0x4451
-0x96C0 = 0x4838
-0x96C1 = 0x5163
-0x96C4 = 0x505B
-0x96C5 = 0x5145
-0x96C6 = 0x3C2F
-0x96C7 = 0x394D
-0x96C9 = 0x6F74
-0x96CC = 0x3446
-0x96CD = 0x533A
-0x96CE = 0x7642
-0x96CF = 0x337B
-0x96D2 = 0x7643
-0x96D5 = 0x3571
-0x96E0 = 0x7645
-0x96E8 = 0x536A
-0x96E9 = 0x7627
-0x96EA = 0x5129
-0x96EF = 0x7629
-0x96F3 = 0x7628
-0x96F6 = 0x4163
-0x96F7 = 0x4057
-0x96F9 = 0x3122
-0x96FE = 0x4E6D
-0x9700 = 0x5068
-0x9701 = 0x762B
-0x9704 = 0x4F76
-0x9706 = 0x762A
-0x9707 = 0x5570
-0x9708 = 0x762C
-0x9709 = 0x4339
-0x970D = 0x3B74
-0x970E = 0x762E
-0x970F = 0x762D
-0x9713 = 0x445E
-0x9716 = 0x4158
-0x971C = 0x4B2A
-0x971E = 0x4F3C
-0x972A = 0x762F
-0x972D = 0x7630
-0x9730 = 0x7631
-0x9732 = 0x4236
-0x9738 = 0x3054
-0x9739 = 0x4579
-0x973E = 0x7632
-0x9752 = 0x4760
-0x9753 = 0x7626
-0x9756 = 0x3E38
-0x9759 = 0x3E32
-0x975B = 0x3565
-0x975E = 0x3747
-0x9760 = 0x3F3F
-0x9761 = 0x4352
-0x9762 = 0x4366
-0x9765 = 0x584C
-0x9769 = 0x386F
-0x9773 = 0x3D79
-0x9774 = 0x5125
-0x9776 = 0x3050
-0x977C = 0x7730
-0x9785 = 0x7731
-0x978B = 0x502C
-0x978D = 0x3030
-0x9791 = 0x7732
-0x9792 = 0x7733
-0x9794 = 0x7734
-0x9798 = 0x474A
-0x97A0 = 0x3E4F
-0x97A3 = 0x7737
-0x97AB = 0x7736
-0x97AD = 0x315E
-0x97AF = 0x7735
-0x97B2 = 0x7738
-0x97B4 = 0x7739
-0x97E6 = 0x4E24
-0x97E7 = 0x484D
-0x97E9 = 0x3A2B
-0x97EA = 0x6838
-0x97EB = 0x6839
-0x97EC = 0x683A
-0x97ED = 0x3E42
-0x97F3 = 0x5274
-0x97F5 = 0x544F
-0x97F6 = 0x4958
-0x9875 = 0x5233
-0x9876 = 0x3625
-0x9877 = 0x476A
-0x9878 = 0x717C
-0x9879 = 0x4F6E
-0x987A = 0x4B33
-0x987B = 0x506B
-0x987C = 0x676F
-0x987D = 0x4D67
-0x987E = 0x394B
-0x987F = 0x3659
-0x9880 = 0x717D
-0x9881 = 0x3064
-0x9882 = 0x4B4C
-0x9883 = 0x717E
-0x9884 = 0x5424
-0x9885 = 0x422D
-0x9886 = 0x416C
-0x9887 = 0x4644
-0x9888 = 0x3E31
-0x9889 = 0x7221
-0x988A = 0x3C55
-0x988C = 0x7222
-0x988D = 0x7223
-0x988F = 0x7224
-0x9890 = 0x5243
-0x9891 = 0x4635
-0x9893 = 0x4D47
-0x9894 = 0x7225
-0x9896 = 0x5331
-0x9897 = 0x3F45
-0x9898 = 0x4C62
-0x989A = 0x7226
-0x989B = 0x7227
-0x989C = 0x5155
-0x989D = 0x366E
-0x989E = 0x7228
-0x989F = 0x7229
-0x98A0 = 0x355F
-0x98A1 = 0x722A
-0x98A2 = 0x722B
-0x98A4 = 0x327C
-0x98A5 = 0x722C
-0x98A6 = 0x722D
-0x98A7 = 0x4827
-0x98CE = 0x3767
-0x98D1 = 0x6C29
-0x98D2 = 0x6C2A
-0x98D3 = 0x6C2B
-0x98D5 = 0x6C2C
-0x98D8 = 0x462E
-0x98D9 = 0x6C2D
-0x98DA = 0x6C2E
-0x98DE = 0x3749
-0x98DF = 0x4A33
-0x98E7 = 0x6238
-0x98E8 = 0x774F
-0x990D = 0x7750
-0x9910 = 0x324D
-0x992E = 0x7751
-0x9954 = 0x7753
-0x9955 = 0x7752
-0x9963 = 0x623B
-0x9965 = 0x3C22
-0x9967 = 0x623C
-0x9968 = 0x623D
-0x9969 = 0x623E
-0x996A = 0x623F
-0x996B = 0x6240
-0x996C = 0x6241
-0x996D = 0x3739
-0x996E = 0x527B
-0x996F = 0x3D24
-0x9970 = 0x4A4E
-0x9971 = 0x3125
-0x9972 = 0x4B47
-0x9974 = 0x6242
-0x9975 = 0x367C
-0x9976 = 0x4844
-0x9977 = 0x6243
-0x997A = 0x3D48
-0x997C = 0x317D
-0x997D = 0x6244
-0x997F = 0x3676
-0x9980 = 0x6245
-0x9981 = 0x4459
-0x9984 = 0x6246
-0x9985 = 0x4F5A
-0x9986 = 0x395D
-0x9987 = 0x6247
-0x9988 = 0x4021
-0x998A = 0x6248
-0x998B = 0x3276
-0x998D = 0x6249
-0x998F = 0x4173
-0x9990 = 0x624A
-0x9991 = 0x624B
-0x9992 = 0x4278
-0x9993 = 0x624C
-0x9994 = 0x624D
-0x9995 = 0x624E
-0x9996 = 0x4A57
-0x9997 = 0x5838
-0x9998 = 0x5965
-0x9999 = 0x4F63
-0x99A5 = 0x7025
-0x99A8 = 0x5C30
-0x9A6C = 0x426D
-0x9A6D = 0x5426
-0x9A6E = 0x4D54
-0x9A6F = 0x5131
-0x9A70 = 0x335B
-0x9A71 = 0x477D
-0x9A73 = 0x3235
-0x9A74 = 0x423F
-0x9A75 = 0x6660
-0x9A76 = 0x4A3B
-0x9A77 = 0x6661
-0x9A78 = 0x6662
-0x9A79 = 0x3E54
-0x9A7A = 0x6663
-0x9A7B = 0x5724
-0x9A7C = 0x4D55
-0x9A7D = 0x6665
-0x9A7E = 0x3C5D
-0x9A7F = 0x6664
-0x9A80 = 0x6666
-0x9A81 = 0x6667
-0x9A82 = 0x426E
-0x9A84 = 0x3D3E
-0x9A85 = 0x6668
-0x9A86 = 0x4266
-0x9A87 = 0x3A27
-0x9A88 = 0x6669
-0x9A8A = 0x666A
-0x9A8B = 0x3352
-0x9A8C = 0x5169
-0x9A8F = 0x3F25
-0x9A90 = 0x666B
-0x9A91 = 0x466F
-0x9A92 = 0x666C
-0x9A93 = 0x666D
-0x9A96 = 0x666E
-0x9A97 = 0x462D
-0x9A98 = 0x666F
-0x9A9A = 0x4927
-0x9A9B = 0x6670
-0x9A9C = 0x6671
-0x9A9D = 0x6672
-0x9A9E = 0x6539
-0x9A9F = 0x6673
-0x9AA0 = 0x6674
-0x9AA1 = 0x4262
-0x9AA2 = 0x6675
-0x9AA3 = 0x6676
-0x9AA4 = 0x5668
-0x9AA5 = 0x6677
-0x9AA7 = 0x6678
-0x9AA8 = 0x3947
-0x9AB0 = 0x773B
-0x9AB1 = 0x773A
-0x9AB6 = 0x773E
-0x9AB7 = 0x773C
-0x9AB8 = 0x3A21
-0x9ABA = 0x773F
-0x9ABC = 0x7740
-0x9AC0 = 0x7742
-0x9AC1 = 0x7741
-0x9AC2 = 0x7744
-0x9AC5 = 0x7743
-0x9ACB = 0x7745
-0x9ACC = 0x7746
-0x9AD1 = 0x7747
-0x9AD3 = 0x4B68
-0x9AD8 = 0x385F
-0x9ADF = 0x7754
-0x9AE1 = 0x7755
-0x9AE6 = 0x7756
-0x9AEB = 0x7758
-0x9AED = 0x775A
-0x9AEF = 0x7757
-0x9AF9 = 0x775B
-0x9AFB = 0x7759
-0x9B03 = 0x5757
-0x9B08 = 0x775C
-0x9B0F = 0x775D
-0x9B13 = 0x775E
-0x9B1F = 0x775F
-0x9B23 = 0x7760
-0x9B2F = 0x5B4B
-0x9B32 = 0x582A
-0x9B3B = 0x6577
-0x9B3C = 0x396D
-0x9B41 = 0x3F7D
-0x9B42 = 0x3B6A
-0x9B43 = 0x7749
-0x9B44 = 0x4647
-0x9B45 = 0x7748
-0x9B47 = 0x774A
-0x9B48 = 0x774C
-0x9B49 = 0x774B
-0x9B4D = 0x774D
-0x9B4F = 0x4E3A
-0x9B51 = 0x774E
-0x9B54 = 0x4427
-0x9C7C = 0x5363
-0x9C7F = 0x764F
-0x9C81 = 0x4233
-0x9C82 = 0x7650
-0x9C85 = 0x7651
-0x9C86 = 0x7652
-0x9C87 = 0x7653
-0x9C88 = 0x7654
-0x9C8B = 0x7656
-0x9C8D = 0x312B
-0x9C8E = 0x7657
-0x9C90 = 0x7658
-0x9C91 = 0x7659
-0x9C92 = 0x765A
-0x9C94 = 0x765B
-0x9C95 = 0x765C
-0x9C9A = 0x765D
-0x9C9B = 0x765E
-0x9C9C = 0x4F4A
-0x9C9E = 0x765F
-0x9C9F = 0x7660
-0x9CA0 = 0x7661
-0x9CA1 = 0x7662
-0x9CA2 = 0x7663
-0x9CA3 = 0x7664
-0x9CA4 = 0x4070
-0x9CA5 = 0x7665
-0x9CA6 = 0x7666
-0x9CA7 = 0x7667
-0x9CA8 = 0x7668
-0x9CA9 = 0x7669
-0x9CAB = 0x766A
-0x9CAD = 0x766B
-0x9CAE = 0x766C
-0x9CB0 = 0x766D
-0x9CB1 = 0x766E
-0x9CB2 = 0x766F
-0x9CB3 = 0x7670
-0x9CB4 = 0x7671
-0x9CB5 = 0x7672
-0x9CB6 = 0x7673
-0x9CB7 = 0x7674
-0x9CB8 = 0x3E28
-0x9CBA = 0x7675
-0x9CBB = 0x7676
-0x9CBC = 0x7677
-0x9CBD = 0x7678
-0x9CC3 = 0x487A
-0x9CC4 = 0x7679
-0x9CC5 = 0x767A
-0x9CC6 = 0x767B
-0x9CC7 = 0x767C
-0x9CCA = 0x767D
-0x9CCB = 0x767E
-0x9CCC = 0x7721
-0x9CCD = 0x7722
-0x9CCE = 0x7723
-0x9CCF = 0x7724
-0x9CD0 = 0x7725
-0x9CD3 = 0x7726
-0x9CD4 = 0x7727
-0x9CD5 = 0x7728
-0x9CD6 = 0x316E
-0x9CD7 = 0x7729
-0x9CD8 = 0x772A
-0x9CD9 = 0x772B
-0x9CDC = 0x772C
-0x9CDD = 0x772D
-0x9CDE = 0x415B
-0x9CDF = 0x772E
-0x9CE2 = 0x772F
-0x9E1F = 0x4471
-0x9E20 = 0x702F
-0x9E21 = 0x3C26
-0x9E22 = 0x7030
-0x9E23 = 0x4379
-0x9E25 = 0x4538
-0x9E26 = 0x513B
-0x9E28 = 0x7031
-0x9E29 = 0x7032
-0x9E2A = 0x7033
-0x9E2B = 0x7034
-0x9E2C = 0x7035
-0x9E2D = 0x513C
-0x9E2F = 0x516C
-0x9E31 = 0x7037
-0x9E32 = 0x7036
-0x9E33 = 0x5427
-0x9E35 = 0x4D52
-0x9E36 = 0x7038
-0x9E37 = 0x703A
-0x9E38 = 0x7039
-0x9E39 = 0x703B
-0x9E3A = 0x703C
-0x9E3D = 0x386B
-0x9E3E = 0x703D
-0x9E3F = 0x3A68
-0x9E41 = 0x703E
-0x9E42 = 0x703F
-0x9E43 = 0x3E69
-0x9E44 = 0x7040
-0x9E45 = 0x366C
-0x9E46 = 0x7041
-0x9E47 = 0x7042
-0x9E48 = 0x7043
-0x9E49 = 0x7044
-0x9E4A = 0x4835
-0x9E4B = 0x7045
-0x9E4C = 0x7046
-0x9E4E = 0x7047
-0x9E4F = 0x4574
-0x9E51 = 0x7048
-0x9E55 = 0x7049
-0x9E57 = 0x704A
-0x9E58 = 0x773D
-0x9E5A = 0x704B
-0x9E5B = 0x704C
-0x9E5C = 0x704D
-0x9E5E = 0x704E
-0x9E63 = 0x704F
-0x9E64 = 0x3A57
-0x9E66 = 0x7050
-0x9E67 = 0x7051
-0x9E68 = 0x7052
-0x9E69 = 0x7053
-0x9E6A = 0x7054
-0x9E6B = 0x7055
-0x9E6C = 0x7056
-0x9E6D = 0x7058
-0x9E70 = 0x5325
-0x9E71 = 0x7057
-0x9E73 = 0x7059
-0x9E7E = 0x753A
-0x9E7F = 0x4239
-0x9E82 = 0x7764
-0x9E87 = 0x7765
-0x9E88 = 0x7766
-0x9E8B = 0x7767
-0x9E92 = 0x7768
-0x9E93 = 0x4234
-0x9E9D = 0x776A
-0x9E9F = 0x776B
-0x9EA6 = 0x4273
-0x9EB4 = 0x7470
-0x9EB8 = 0x746F
-0x9EBB = 0x4269
-0x9EBD = 0x7761
-0x9EBE = 0x7762
-0x9EC4 = 0x3B46
-0x9EC9 = 0x5964
-0x9ECD = 0x4A72
-0x9ECE = 0x4068
-0x9ECF = 0x7024
-0x9ED1 = 0x3A5A
-0x9ED4 = 0x472D
-0x9ED8 = 0x442C
-0x9EDB = 0x776C
-0x9EDC = 0x776D
-0x9EDD = 0x776E
-0x9EDF = 0x7770
-0x9EE0 = 0x776F
-0x9EE2 = 0x7771
-0x9EE5 = 0x7774
-0x9EE7 = 0x7773
-0x9EE9 = 0x7772
-0x9EEA = 0x7775
-0x9EEF = 0x7776
-0x9EF9 = 0x6D69
-0x9EFB = 0x6D6A
-0x9EFC = 0x6D6B
-0x9EFE = 0x763C
-0x9F0B = 0x763D
-0x9F0D = 0x763E
-0x9F0E = 0x3626
-0x9F10 = 0x583E
-0x9F13 = 0x3944
-0x9F17 = 0x583B
-0x9F19 = 0x5C31
-0x9F20 = 0x4A73
-0x9F22 = 0x7777
-0x9F2C = 0x7778
-0x9F2F = 0x7779
-0x9F37 = 0x777B
-0x9F39 = 0x777A
-0x9F3B = 0x3147
-0x9F3D = 0x777C
-0x9F3E = 0x777D
-0x9F44 = 0x777E
-0x9F50 = 0x466B
-0x9F51 = 0x6C34
-0x9F7F = 0x335D
-0x9F80 = 0x7633
-0x9F83 = 0x7634
-0x9F84 = 0x4164
-0x9F85 = 0x7635
-0x9F86 = 0x7636
-0x9F87 = 0x7637
-0x9F88 = 0x7638
-0x9F89 = 0x7639
-0x9F8A = 0x763A
-0x9F8B = 0x4823
-0x9F8C = 0x763B
-0x9F99 = 0x417A
-0x9F9A = 0x3928
-0x9F9B = 0x6D68
-0x9F9F = 0x396A
-0x9FA0 = 0x595F
-0xFF01 = 0x2321
-0xFF02 = 0x2322
-0xFF03 = 0x2323
-0xFF04 = 0x2167
-0xFF05 = 0x2325
-0xFF06 = 0x2326
-0xFF07 = 0x2327
-0xFF08 = 0x2328
-0xFF09 = 0x2329
-0xFF0A = 0x232A
-0xFF0B = 0x232B
-0xFF0C = 0x232C
-0xFF0D = 0x232D
-0xFF0E = 0x232E
-0xFF0F = 0x232F
-0xFF10 = 0x2330
-0xFF11 = 0x2331
-0xFF12 = 0x2332
-0xFF13 = 0x2333
-0xFF14 = 0x2334
-0xFF15 = 0x2335
-0xFF16 = 0x2336
-0xFF17 = 0x2337
-0xFF18 = 0x2338
-0xFF19 = 0x2339
-0xFF1A = 0x233A
-0xFF1B = 0x233B
-0xFF1C = 0x233C
-0xFF1D = 0x233D
-0xFF1E = 0x233E
-0xFF1F = 0x233F
-0xFF20 = 0x2340
-0xFF21 = 0x2341
-0xFF22 = 0x2342
-0xFF23 = 0x2343
-0xFF24 = 0x2344
-0xFF25 = 0x2345
-0xFF26 = 0x2346
-0xFF27 = 0x2347
-0xFF28 = 0x2348
-0xFF29 = 0x2349
-0xFF2A = 0x234A
-0xFF2B = 0x234B
-0xFF2C = 0x234C
-0xFF2D = 0x234D
-0xFF2E = 0x234E
-0xFF2F = 0x234F
-0xFF30 = 0x2350
-0xFF31 = 0x2351
-0xFF32 = 0x2352
-0xFF33 = 0x2353
-0xFF34 = 0x2354
-0xFF35 = 0x2355
-0xFF36 = 0x2356
-0xFF37 = 0x2357
-0xFF38 = 0x2358
-0xFF39 = 0x2359
-0xFF3A = 0x235A
-0xFF3B = 0x235B
-0xFF3C = 0x235C
-0xFF3D = 0x235D
-0xFF3E = 0x235E
-0xFF3F = 0x235F
-0xFF40 = 0x2360
-0xFF41 = 0x2361
-0xFF42 = 0x2362
-0xFF43 = 0x2363
-0xFF44 = 0x2364
-0xFF45 = 0x2365
-0xFF46 = 0x2366
-0xFF47 = 0x2367
-0xFF48 = 0x2368
-0xFF49 = 0x2369
-0xFF4A = 0x236A
-0xFF4B = 0x236B
-0xFF4C = 0x236C
-0xFF4D = 0x236D
-0xFF4E = 0x236E
-0xFF4F = 0x236F
-0xFF50 = 0x2370
-0xFF51 = 0x2371
-0xFF52 = 0x2372
-0xFF53 = 0x2373
-0xFF54 = 0x2374
-0xFF55 = 0x2375
-0xFF56 = 0x2376
-0xFF57 = 0x2377
-0xFF58 = 0x2378
-0xFF59 = 0x2379
-0xFF5A = 0x237A
-0xFF5B = 0x237B
-0xFF5C = 0x237C
-0xFF5D = 0x237D
-0xFF5E = 0x212B
-0xFFE0 = 0x2169
-0xFFE1 = 0x216A
-0xFFE3 = 0x237E
-0xFFE5 = 0x2324
-END_MAP
diff --git a/enc/trans/JIS/JISX0201-KANA%UCS.src b/enc/trans/JIS/JISX0201-KANA%UCS.src
deleted file mode 100644
index d25b580fed..0000000000
--- a/enc/trans/JIS/JISX0201-KANA%UCS.src
+++ /dev/null
@@ -1,127 +0,0 @@
-# $NetBSD: JISX0201-KANA%UCS.src,v 1.3 2006/10/26 16:19:02 tnozaki Exp $
-
-TYPE ROWCOL
-NAME JISX0201-KANA/UCS
-SRC_ZONE 0x21-0x5F
-OOB_MODE ILSEQ
-DST_ILSEQ 0xFFFE
-DST_UNIT_BITS 16
-
-BEGIN_MAP
-#
-# This mapping data is made from the mapping data provided by Unicode, Inc.
-# Original notice:
-#
-# Name: JIS X 0201 (1976) to Unicode 1.1 Table
-# Unicode version: 1.1
-# Table version: 0.9
-# Table format: Format A
-# Date: 8 March 1994
-#
-# Copyright (c) 1991-1994 Unicode, Inc. All Rights reserved.
-#
-# This file is provided as-is by Unicode, Inc. (The Unicode Consortium).
-# No claims are made as to fitness for any particular purpose. No
-# warranties of any kind are expressed or implied. The recipient
-# agrees to determine applicability of information provided. If this
-# file has been provided on magnetic media by Unicode, Inc., the sole
-# remedy for any claim will be exchange of defective media within 90
-# days of receipt.
-#
-# Recipient is granted the right to make copies in any form for
-# internal distribution and to freely use the information supplied
-# in the creation of products supporting Unicode. Unicode, Inc.
-# specifically excludes the right to re-distribute this file directly
-# to third parties or other organizations whether for profit or not.
-#
-# General notes:
-#
-#
-# This table contains one set of mappings from JIS X 0201 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 JIS X 0201 and Unicode, consult the
-# VENDORS mapping data. Normative information on the mapping between
-# JIS X 0201 and Unicode may be found in the Unihan.txt file in the
-# latest Unicode Character Database.
-#
-# If you have carefully considered the fact that the mappings in
-# this table are only one possible set of mappings between JIS X 0201 and
-# Unicode and have no normative status, but still feel that you
-# have located an error in the table that requires fixing, you may
-# report any such error to errata@unicode.org.
-#
-#
-# Format: Three tab-separated columns
-# Column #1 is the shift JIS code (in hex as 0xXX)
-# Column #2 is the Unicode (in hex as 0xXXXX)
-# Column #3 the Unicode (ISO 10646) name (follows a comment sign)
-#
-# The entries are in JIS order
-#
-#
-0x21 = 0xFF61
-0x22 = 0xFF62
-0x23 = 0xFF63
-0x24 = 0xFF64
-0x25 = 0xFF65
-0x26 = 0xFF66
-0x27 = 0xFF67
-0x28 = 0xFF68
-0x29 = 0xFF69
-0x2A = 0xFF6A
-0x2B = 0xFF6B
-0x2C = 0xFF6C
-0x2D = 0xFF6D
-0x2E = 0xFF6E
-0x2F = 0xFF6F
-0x30 = 0xFF70
-0x31 = 0xFF71
-0x32 = 0xFF72
-0x33 = 0xFF73
-0x34 = 0xFF74
-0x35 = 0xFF75
-0x36 = 0xFF76
-0x37 = 0xFF77
-0x38 = 0xFF78
-0x39 = 0xFF79
-0x3A = 0xFF7A
-0x3B = 0xFF7B
-0x3C = 0xFF7C
-0x3D = 0xFF7D
-0x3E = 0xFF7E
-0x3F = 0xFF7F
-0x40 = 0xFF80
-0x41 = 0xFF81
-0x42 = 0xFF82
-0x43 = 0xFF83
-0x44 = 0xFF84
-0x45 = 0xFF85
-0x46 = 0xFF86
-0x47 = 0xFF87
-0x48 = 0xFF88
-0x49 = 0xFF89
-0x4A = 0xFF8A
-0x4B = 0xFF8B
-0x4C = 0xFF8C
-0x4D = 0xFF8D
-0x4E = 0xFF8E
-0x4F = 0xFF8F
-0x50 = 0xFF90
-0x51 = 0xFF91
-0x52 = 0xFF92
-0x53 = 0xFF93
-0x54 = 0xFF94
-0x55 = 0xFF95
-0x56 = 0xFF96
-0x57 = 0xFF97
-0x58 = 0xFF98
-0x59 = 0xFF99
-0x5A = 0xFF9A
-0x5B = 0xFF9B
-0x5C = 0xFF9C
-0x5D = 0xFF9D
-0x5E = 0xFF9E
-0x5F = 0xFF9F
-END_MAP
diff --git a/enc/trans/JIS/JISX0208@1990%UCS.src b/enc/trans/JIS/JISX0208@1990%UCS.src
deleted file mode 100644
index c2cacd422e..0000000000
--- a/enc/trans/JIS/JISX0208@1990%UCS.src
+++ /dev/null
@@ -1,6972 +0,0 @@
-# $NetBSD: JISX0208@1990%UCS.src,v 1.5 2006/12/02 14:36:13 tnozaki Exp $
-
-TYPE ROWCOL
-NAME JISX0208:1990/UCS
-SRC_ZONE 0x21-0x74 / 0x21-0x7E / 8
-OOB_MODE ILSEQ
-DST_ILSEQ 0xFFFE
-DST_UNIT_BITS 16
-
-BEGIN_MAP
-#
-# This mapping data is made from the mapping data provided by Unicode, Inc.
-# Original notice:
-#
-# Name: JIS X 0208 (1990) to Unicode
-# Unicode version: 1.1
-# Table version: 0.9
-# Table format: Format A
-# Date: 8 March 1994
-#
-# Copyright (c) 1991-1994 Unicode, Inc. All Rights reserved.
-#
-# This file is provided as-is by Unicode, Inc. (The Unicode Consortium).
-# No claims are made as to fitness for any particular purpose. No
-# warranties of any kind are expressed or implied. The recipient
-# agrees to determine applicability of information provided. If this
-# file has been provided on magnetic media by Unicode, Inc., the sole
-# remedy for any claim will be exchange of defective media within 90
-# days of receipt.
-#
-# Recipient is granted the right to make copies in any form for
-# internal distribution and to freely use the information supplied
-# in the creation of products supporting Unicode. Unicode, Inc.
-# specifically excludes the right to re-distribute this file directly
-# to third parties or other organizations whether for profit or not.
-#
-# General notes:
-#
-#
-# This table contains one set of mappings from JIS X 0208 (1990) 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 JIS X 0208 (1990) and Unicode, consult the
-# VENDORS mapping data. Normative information on the mapping between
-# JIS X 0208 (1990) and Unicode may be found in the Unihan.txt file in the
-# latest Unicode Character Database.
-#
-# If you have carefully considered the fact that the mappings in
-# this table are only one possible set of mappings between JIS X 0208 (1990)
-# and Unicode and have no normative status, but still feel that you
-# have located an error in the table that requires fixing, you may
-# report any such error to errata@unicode.org.
-#
-#
-# Format: Four tab-separated columns
-# Column #1 is the shift-JIS code (in hex)
-# Column #2 is the JIS X 0208 code (in hex as 0xXXXX)
-# Column #3 is the Unicode (in hex as 0xXXXX)
-# Column #4 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 JIS X 0208 order
-#
-# The following algorithms can be used to change the hex form
-# of JIS 0208 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;
-# 0x7426 -> 0x5406 -> 8406
-#
-# The kanji mappings are a normative part of ISO/IEC 10646. The
-# non-kanji mappings are provisional, pending definition of
-# official mappings by Japanese standards bodies
-#
-# Any comments or problems, contact <John_Jenkins@taligent.com>
-#
-#
-# NetBSD specific modification:
-# 2003-08-18 : change the conversion for reverse solidus (0x2140).
-# Unicode Inc.'s table converts it to U+005C,
-# but this may conflict in the case of compound encoding,
-# e.g. EUC-JP. Instead, we use U+FF3C.
-#
-0x2121 = 0x3000
-0x2122 = 0x3001
-0x2123 = 0x3002
-0x2124 = 0xFF0C
-0x2125 = 0xFF0E
-0x2126 = 0x30FB
-0x2127 = 0xFF1A
-0x2128 = 0xFF1B
-0x2129 = 0xFF1F
-0x212A = 0xFF01
-0x212B = 0x309B
-0x212C = 0x309C
-0x212D = 0x00B4
-0x212E = 0xFF40
-0x212F = 0x00A8
-0x2130 = 0xFF3E
-0x2131 = 0xFFE3
-0x2132 = 0xFF3F
-0x2133 = 0x30FD
-0x2134 = 0x30FE
-0x2135 = 0x309D
-0x2136 = 0x309E
-0x2137 = 0x3003
-0x2138 = 0x4EDD
-0x2139 = 0x3005
-0x213A = 0x3006
-0x213B = 0x3007
-0x213C = 0x30FC
-0x213D = 0x2014
-0x213E = 0x2010
-0x213F = 0xFF0F
-0x2140 = 0xFF3C
-0x2141 = 0x301C
-0x2142 = 0x2016
-0x2143 = 0xFF5C
-0x2144 = 0x2026
-0x2145 = 0x2025
-0x2146 = 0x2018
-0x2147 = 0x2019
-0x2148 = 0x201C
-0x2149 = 0x201D
-0x214A = 0xFF08
-0x214B = 0xFF09
-0x214C = 0x3014
-0x214D = 0x3015
-0x214E = 0xFF3B
-0x214F = 0xFF3D
-0x2150 = 0xFF5B
-0x2151 = 0xFF5D
-0x2152 = 0x3008
-0x2153 = 0x3009
-0x2154 = 0x300A
-0x2155 = 0x300B
-0x2156 = 0x300C
-0x2157 = 0x300D
-0x2158 = 0x300E
-0x2159 = 0x300F
-0x215A = 0x3010
-0x215B = 0x3011
-0x215C = 0xFF0B
-0x215D = 0x2212
-0x215E = 0x00B1
-0x215F = 0x00D7
-0x2160 = 0x00F7
-0x2161 = 0xFF1D
-0x2162 = 0x2260
-0x2163 = 0xFF1C
-0x2164 = 0xFF1E
-0x2165 = 0x2266
-0x2166 = 0x2267
-0x2167 = 0x221E
-0x2168 = 0x2234
-0x2169 = 0x2642
-0x216A = 0x2640
-0x216B = 0x00B0
-0x216C = 0x2032
-0x216D = 0x2033
-0x216E = 0x2103
-0x216F = 0xFFE5
-0x2170 = 0xFF04
-0x2171 = 0x00A2
-0x2172 = 0x00A3
-0x2173 = 0xFF05
-0x2174 = 0xFF03
-0x2175 = 0xFF06
-0x2176 = 0xFF0A
-0x2177 = 0xFF20
-0x2178 = 0x00A7
-0x2179 = 0x2606
-0x217A = 0x2605
-0x217B = 0x25CB
-0x217C = 0x25CF
-0x217D = 0x25CE
-0x217E = 0x25C7
-0x2221 = 0x25C6
-0x2222 = 0x25A1
-0x2223 = 0x25A0
-0x2224 = 0x25B3
-0x2225 = 0x25B2
-0x2226 = 0x25BD
-0x2227 = 0x25BC
-0x2228 = 0x203B
-0x2229 = 0x3012
-0x222A = 0x2192
-0x222B = 0x2190
-0x222C = 0x2191
-0x222D = 0x2193
-0x222E = 0x3013
-0x223A = 0x2208
-0x223B = 0x220B
-0x223C = 0x2286
-0x223D = 0x2287
-0x223E = 0x2282
-0x223F = 0x2283
-0x2240 = 0x222A
-0x2241 = 0x2229
-0x224A = 0x2227
-0x224B = 0x2228
-0x224C = 0x00AC
-0x224D = 0x21D2
-0x224E = 0x21D4
-0x224F = 0x2200
-0x2250 = 0x2203
-0x225C = 0x2220
-0x225D = 0x22A5
-0x225E = 0x2312
-0x225F = 0x2202
-0x2260 = 0x2207
-0x2261 = 0x2261
-0x2262 = 0x2252
-0x2263 = 0x226A
-0x2264 = 0x226B
-0x2265 = 0x221A
-0x2266 = 0x223D
-0x2267 = 0x221D
-0x2268 = 0x2235
-0x2269 = 0x222B
-0x226A = 0x222C
-0x2272 = 0x212B
-0x2273 = 0x2030
-0x2274 = 0x266F
-0x2275 = 0x266D
-0x2276 = 0x266A
-0x2277 = 0x2020
-0x2278 = 0x2021
-0x2279 = 0x00B6
-0x227E = 0x25EF
-0x2330 = 0xFF10
-0x2331 = 0xFF11
-0x2332 = 0xFF12
-0x2333 = 0xFF13
-0x2334 = 0xFF14
-0x2335 = 0xFF15
-0x2336 = 0xFF16
-0x2337 = 0xFF17
-0x2338 = 0xFF18
-0x2339 = 0xFF19
-0x2341 = 0xFF21
-0x2342 = 0xFF22
-0x2343 = 0xFF23
-0x2344 = 0xFF24
-0x2345 = 0xFF25
-0x2346 = 0xFF26
-0x2347 = 0xFF27
-0x2348 = 0xFF28
-0x2349 = 0xFF29
-0x234A = 0xFF2A
-0x234B = 0xFF2B
-0x234C = 0xFF2C
-0x234D = 0xFF2D
-0x234E = 0xFF2E
-0x234F = 0xFF2F
-0x2350 = 0xFF30
-0x2351 = 0xFF31
-0x2352 = 0xFF32
-0x2353 = 0xFF33
-0x2354 = 0xFF34
-0x2355 = 0xFF35
-0x2356 = 0xFF36
-0x2357 = 0xFF37
-0x2358 = 0xFF38
-0x2359 = 0xFF39
-0x235A = 0xFF3A
-0x2361 = 0xFF41
-0x2362 = 0xFF42
-0x2363 = 0xFF43
-0x2364 = 0xFF44
-0x2365 = 0xFF45
-0x2366 = 0xFF46
-0x2367 = 0xFF47
-0x2368 = 0xFF48
-0x2369 = 0xFF49
-0x236A = 0xFF4A
-0x236B = 0xFF4B
-0x236C = 0xFF4C
-0x236D = 0xFF4D
-0x236E = 0xFF4E
-0x236F = 0xFF4F
-0x2370 = 0xFF50
-0x2371 = 0xFF51
-0x2372 = 0xFF52
-0x2373 = 0xFF53
-0x2374 = 0xFF54
-0x2375 = 0xFF55
-0x2376 = 0xFF56
-0x2377 = 0xFF57
-0x2378 = 0xFF58
-0x2379 = 0xFF59
-0x237A = 0xFF5A
-0x2421 = 0x3041
-0x2422 = 0x3042
-0x2423 = 0x3043
-0x2424 = 0x3044
-0x2425 = 0x3045
-0x2426 = 0x3046
-0x2427 = 0x3047
-0x2428 = 0x3048
-0x2429 = 0x3049
-0x242A = 0x304A
-0x242B = 0x304B
-0x242C = 0x304C
-0x242D = 0x304D
-0x242E = 0x304E
-0x242F = 0x304F
-0x2430 = 0x3050
-0x2431 = 0x3051
-0x2432 = 0x3052
-0x2433 = 0x3053
-0x2434 = 0x3054
-0x2435 = 0x3055
-0x2436 = 0x3056
-0x2437 = 0x3057
-0x2438 = 0x3058
-0x2439 = 0x3059
-0x243A = 0x305A
-0x243B = 0x305B
-0x243C = 0x305C
-0x243D = 0x305D
-0x243E = 0x305E
-0x243F = 0x305F
-0x2440 = 0x3060
-0x2441 = 0x3061
-0x2442 = 0x3062
-0x2443 = 0x3063
-0x2444 = 0x3064
-0x2445 = 0x3065
-0x2446 = 0x3066
-0x2447 = 0x3067
-0x2448 = 0x3068
-0x2449 = 0x3069
-0x244A = 0x306A
-0x244B = 0x306B
-0x244C = 0x306C
-0x244D = 0x306D
-0x244E = 0x306E
-0x244F = 0x306F
-0x2450 = 0x3070
-0x2451 = 0x3071
-0x2452 = 0x3072
-0x2453 = 0x3073
-0x2454 = 0x3074
-0x2455 = 0x3075
-0x2456 = 0x3076
-0x2457 = 0x3077
-0x2458 = 0x3078
-0x2459 = 0x3079
-0x245A = 0x307A
-0x245B = 0x307B
-0x245C = 0x307C
-0x245D = 0x307D
-0x245E = 0x307E
-0x245F = 0x307F
-0x2460 = 0x3080
-0x2461 = 0x3081
-0x2462 = 0x3082
-0x2463 = 0x3083
-0x2464 = 0x3084
-0x2465 = 0x3085
-0x2466 = 0x3086
-0x2467 = 0x3087
-0x2468 = 0x3088
-0x2469 = 0x3089
-0x246A = 0x308A
-0x246B = 0x308B
-0x246C = 0x308C
-0x246D = 0x308D
-0x246E = 0x308E
-0x246F = 0x308F
-0x2470 = 0x3090
-0x2471 = 0x3091
-0x2472 = 0x3092
-0x2473 = 0x3093
-0x2521 = 0x30A1
-0x2522 = 0x30A2
-0x2523 = 0x30A3
-0x2524 = 0x30A4
-0x2525 = 0x30A5
-0x2526 = 0x30A6
-0x2527 = 0x30A7
-0x2528 = 0x30A8
-0x2529 = 0x30A9
-0x252A = 0x30AA
-0x252B = 0x30AB
-0x252C = 0x30AC
-0x252D = 0x30AD
-0x252E = 0x30AE
-0x252F = 0x30AF
-0x2530 = 0x30B0
-0x2531 = 0x30B1
-0x2532 = 0x30B2
-0x2533 = 0x30B3
-0x2534 = 0x30B4
-0x2535 = 0x30B5
-0x2536 = 0x30B6
-0x2537 = 0x30B7
-0x2538 = 0x30B8
-0x2539 = 0x30B9
-0x253A = 0x30BA
-0x253B = 0x30BB
-0x253C = 0x30BC
-0x253D = 0x30BD
-0x253E = 0x30BE
-0x253F = 0x30BF
-0x2540 = 0x30C0
-0x2541 = 0x30C1
-0x2542 = 0x30C2
-0x2543 = 0x30C3
-0x2544 = 0x30C4
-0x2545 = 0x30C5
-0x2546 = 0x30C6
-0x2547 = 0x30C7
-0x2548 = 0x30C8
-0x2549 = 0x30C9
-0x254A = 0x30CA
-0x254B = 0x30CB
-0x254C = 0x30CC
-0x254D = 0x30CD
-0x254E = 0x30CE
-0x254F = 0x30CF
-0x2550 = 0x30D0
-0x2551 = 0x30D1
-0x2552 = 0x30D2
-0x2553 = 0x30D3
-0x2554 = 0x30D4
-0x2555 = 0x30D5
-0x2556 = 0x30D6
-0x2557 = 0x30D7
-0x2558 = 0x30D8
-0x2559 = 0x30D9
-0x255A = 0x30DA
-0x255B = 0x30DB
-0x255C = 0x30DC
-0x255D = 0x30DD
-0x255E = 0x30DE
-0x255F = 0x30DF
-0x2560 = 0x30E0
-0x2561 = 0x30E1
-0x2562 = 0x30E2
-0x2563 = 0x30E3
-0x2564 = 0x30E4
-0x2565 = 0x30E5
-0x2566 = 0x30E6
-0x2567 = 0x30E7
-0x2568 = 0x30E8
-0x2569 = 0x30E9
-0x256A = 0x30EA
-0x256B = 0x30EB
-0x256C = 0x30EC
-0x256D = 0x30ED
-0x256E = 0x30EE
-0x256F = 0x30EF
-0x2570 = 0x30F0
-0x2571 = 0x30F1
-0x2572 = 0x30F2
-0x2573 = 0x30F3
-0x2574 = 0x30F4
-0x2575 = 0x30F5
-0x2576 = 0x30F6
-0x2621 = 0x0391
-0x2622 = 0x0392
-0x2623 = 0x0393
-0x2624 = 0x0394
-0x2625 = 0x0395
-0x2626 = 0x0396
-0x2627 = 0x0397
-0x2628 = 0x0398
-0x2629 = 0x0399
-0x262A = 0x039A
-0x262B = 0x039B
-0x262C = 0x039C
-0x262D = 0x039D
-0x262E = 0x039E
-0x262F = 0x039F
-0x2630 = 0x03A0
-0x2631 = 0x03A1
-0x2632 = 0x03A3
-0x2633 = 0x03A4
-0x2634 = 0x03A5
-0x2635 = 0x03A6
-0x2636 = 0x03A7
-0x2637 = 0x03A8
-0x2638 = 0x03A9
-0x2641 = 0x03B1
-0x2642 = 0x03B2
-0x2643 = 0x03B3
-0x2644 = 0x03B4
-0x2645 = 0x03B5
-0x2646 = 0x03B6
-0x2647 = 0x03B7
-0x2648 = 0x03B8
-0x2649 = 0x03B9
-0x264A = 0x03BA
-0x264B = 0x03BB
-0x264C = 0x03BC
-0x264D = 0x03BD
-0x264E = 0x03BE
-0x264F = 0x03BF
-0x2650 = 0x03C0
-0x2651 = 0x03C1
-0x2652 = 0x03C3
-0x2653 = 0x03C4
-0x2654 = 0x03C5
-0x2655 = 0x03C6
-0x2656 = 0x03C7
-0x2657 = 0x03C8
-0x2658 = 0x03C9
-0x2721 = 0x0410
-0x2722 = 0x0411
-0x2723 = 0x0412
-0x2724 = 0x0413
-0x2725 = 0x0414
-0x2726 = 0x0415
-0x2727 = 0x0401
-0x2728 = 0x0416
-0x2729 = 0x0417
-0x272A = 0x0418
-0x272B = 0x0419
-0x272C = 0x041A
-0x272D = 0x041B
-0x272E = 0x041C
-0x272F = 0x041D
-0x2730 = 0x041E
-0x2731 = 0x041F
-0x2732 = 0x0420
-0x2733 = 0x0421
-0x2734 = 0x0422
-0x2735 = 0x0423
-0x2736 = 0x0424
-0x2737 = 0x0425
-0x2738 = 0x0426
-0x2739 = 0x0427
-0x273A = 0x0428
-0x273B = 0x0429
-0x273C = 0x042A
-0x273D = 0x042B
-0x273E = 0x042C
-0x273F = 0x042D
-0x2740 = 0x042E
-0x2741 = 0x042F
-0x2751 = 0x0430
-0x2752 = 0x0431
-0x2753 = 0x0432
-0x2754 = 0x0433
-0x2755 = 0x0434
-0x2756 = 0x0435
-0x2757 = 0x0451
-0x2758 = 0x0436
-0x2759 = 0x0437
-0x275A = 0x0438
-0x275B = 0x0439
-0x275C = 0x043A
-0x275D = 0x043B
-0x275E = 0x043C
-0x275F = 0x043D
-0x2760 = 0x043E
-0x2761 = 0x043F
-0x2762 = 0x0440
-0x2763 = 0x0441
-0x2764 = 0x0442
-0x2765 = 0x0443
-0x2766 = 0x0444
-0x2767 = 0x0445
-0x2768 = 0x0446
-0x2769 = 0x0447
-0x276A = 0x0448
-0x276B = 0x0449
-0x276C = 0x044A
-0x276D = 0x044B
-0x276E = 0x044C
-0x276F = 0x044D
-0x2770 = 0x044E
-0x2771 = 0x044F
-0x2821 = 0x2500
-0x2822 = 0x2502
-0x2823 = 0x250C
-0x2824 = 0x2510
-0x2825 = 0x2518
-0x2826 = 0x2514
-0x2827 = 0x251C
-0x2828 = 0x252C
-0x2829 = 0x2524
-0x282A = 0x2534
-0x282B = 0x253C
-0x282C = 0x2501
-0x282D = 0x2503
-0x282E = 0x250F
-0x282F = 0x2513
-0x2830 = 0x251B
-0x2831 = 0x2517
-0x2832 = 0x2523
-0x2833 = 0x2533
-0x2834 = 0x252B
-0x2835 = 0x253B
-0x2836 = 0x254B
-0x2837 = 0x2520
-0x2838 = 0x252F
-0x2839 = 0x2528
-0x283A = 0x2537
-0x283B = 0x253F
-0x283C = 0x251D
-0x283D = 0x2530
-0x283E = 0x2525
-0x283F = 0x2538
-0x2840 = 0x2542
-0x3021 = 0x4E9C
-0x3022 = 0x5516
-0x3023 = 0x5A03
-0x3024 = 0x963F
-0x3025 = 0x54C0
-0x3026 = 0x611B
-0x3027 = 0x6328
-0x3028 = 0x59F6
-0x3029 = 0x9022
-0x302A = 0x8475
-0x302B = 0x831C
-0x302C = 0x7A50
-0x302D = 0x60AA
-0x302E = 0x63E1
-0x302F = 0x6E25
-0x3030 = 0x65ED
-0x3031 = 0x8466
-0x3032 = 0x82A6
-0x3033 = 0x9BF5
-0x3034 = 0x6893
-0x3035 = 0x5727
-0x3036 = 0x65A1
-0x3037 = 0x6271
-0x3038 = 0x5B9B
-0x3039 = 0x59D0
-0x303A = 0x867B
-0x303B = 0x98F4
-0x303C = 0x7D62
-0x303D = 0x7DBE
-0x303E = 0x9B8E
-0x303F = 0x6216
-0x3040 = 0x7C9F
-0x3041 = 0x88B7
-0x3042 = 0x5B89
-0x3043 = 0x5EB5
-0x3044 = 0x6309
-0x3045 = 0x6697
-0x3046 = 0x6848
-0x3047 = 0x95C7
-0x3048 = 0x978D
-0x3049 = 0x674F
-0x304A = 0x4EE5
-0x304B = 0x4F0A
-0x304C = 0x4F4D
-0x304D = 0x4F9D
-0x304E = 0x5049
-0x304F = 0x56F2
-0x3050 = 0x5937
-0x3051 = 0x59D4
-0x3052 = 0x5A01
-0x3053 = 0x5C09
-0x3054 = 0x60DF
-0x3055 = 0x610F
-0x3056 = 0x6170
-0x3057 = 0x6613
-0x3058 = 0x6905
-0x3059 = 0x70BA
-0x305A = 0x754F
-0x305B = 0x7570
-0x305C = 0x79FB
-0x305D = 0x7DAD
-0x305E = 0x7DEF
-0x305F = 0x80C3
-0x3060 = 0x840E
-0x3061 = 0x8863
-0x3062 = 0x8B02
-0x3063 = 0x9055
-0x3064 = 0x907A
-0x3065 = 0x533B
-0x3066 = 0x4E95
-0x3067 = 0x4EA5
-0x3068 = 0x57DF
-0x3069 = 0x80B2
-0x306A = 0x90C1
-0x306B = 0x78EF
-0x306C = 0x4E00
-0x306D = 0x58F1
-0x306E = 0x6EA2
-0x306F = 0x9038
-0x3070 = 0x7A32
-0x3071 = 0x8328
-0x3072 = 0x828B
-0x3073 = 0x9C2F
-0x3074 = 0x5141
-0x3075 = 0x5370
-0x3076 = 0x54BD
-0x3077 = 0x54E1
-0x3078 = 0x56E0
-0x3079 = 0x59FB
-0x307A = 0x5F15
-0x307B = 0x98F2
-0x307C = 0x6DEB
-0x307D = 0x80E4
-0x307E = 0x852D
-0x3121 = 0x9662
-0x3122 = 0x9670
-0x3123 = 0x96A0
-0x3124 = 0x97FB
-0x3125 = 0x540B
-0x3126 = 0x53F3
-0x3127 = 0x5B87
-0x3128 = 0x70CF
-0x3129 = 0x7FBD
-0x312A = 0x8FC2
-0x312B = 0x96E8
-0x312C = 0x536F
-0x312D = 0x9D5C
-0x312E = 0x7ABA
-0x312F = 0x4E11
-0x3130 = 0x7893
-0x3131 = 0x81FC
-0x3132 = 0x6E26
-0x3133 = 0x5618
-0x3134 = 0x5504
-0x3135 = 0x6B1D
-0x3136 = 0x851A
-0x3137 = 0x9C3B
-0x3138 = 0x59E5
-0x3139 = 0x53A9
-0x313A = 0x6D66
-0x313B = 0x74DC
-0x313C = 0x958F
-0x313D = 0x5642
-0x313E = 0x4E91
-0x313F = 0x904B
-0x3140 = 0x96F2
-0x3141 = 0x834F
-0x3142 = 0x990C
-0x3143 = 0x53E1
-0x3144 = 0x55B6
-0x3145 = 0x5B30
-0x3146 = 0x5F71
-0x3147 = 0x6620
-0x3148 = 0x66F3
-0x3149 = 0x6804
-0x314A = 0x6C38
-0x314B = 0x6CF3
-0x314C = 0x6D29
-0x314D = 0x745B
-0x314E = 0x76C8
-0x314F = 0x7A4E
-0x3150 = 0x9834
-0x3151 = 0x82F1
-0x3152 = 0x885B
-0x3153 = 0x8A60
-0x3154 = 0x92ED
-0x3155 = 0x6DB2
-0x3156 = 0x75AB
-0x3157 = 0x76CA
-0x3158 = 0x99C5
-0x3159 = 0x60A6
-0x315A = 0x8B01
-0x315B = 0x8D8A
-0x315C = 0x95B2
-0x315D = 0x698E
-0x315E = 0x53AD
-0x315F = 0x5186
-0x3160 = 0x5712
-0x3161 = 0x5830
-0x3162 = 0x5944
-0x3163 = 0x5BB4
-0x3164 = 0x5EF6
-0x3165 = 0x6028
-0x3166 = 0x63A9
-0x3167 = 0x63F4
-0x3168 = 0x6CBF
-0x3169 = 0x6F14
-0x316A = 0x708E
-0x316B = 0x7114
-0x316C = 0x7159
-0x316D = 0x71D5
-0x316E = 0x733F
-0x316F = 0x7E01
-0x3170 = 0x8276
-0x3171 = 0x82D1
-0x3172 = 0x8597
-0x3173 = 0x9060
-0x3174 = 0x925B
-0x3175 = 0x9D1B
-0x3176 = 0x5869
-0x3177 = 0x65BC
-0x3178 = 0x6C5A
-0x3179 = 0x7525
-0x317A = 0x51F9
-0x317B = 0x592E
-0x317C = 0x5965
-0x317D = 0x5F80
-0x317E = 0x5FDC
-0x3221 = 0x62BC
-0x3222 = 0x65FA
-0x3223 = 0x6A2A
-0x3224 = 0x6B27
-0x3225 = 0x6BB4
-0x3226 = 0x738B
-0x3227 = 0x7FC1
-0x3228 = 0x8956
-0x3229 = 0x9D2C
-0x322A = 0x9D0E
-0x322B = 0x9EC4
-0x322C = 0x5CA1
-0x322D = 0x6C96
-0x322E = 0x837B
-0x322F = 0x5104
-0x3230 = 0x5C4B
-0x3231 = 0x61B6
-0x3232 = 0x81C6
-0x3233 = 0x6876
-0x3234 = 0x7261
-0x3235 = 0x4E59
-0x3236 = 0x4FFA
-0x3237 = 0x5378
-0x3238 = 0x6069
-0x3239 = 0x6E29
-0x323A = 0x7A4F
-0x323B = 0x97F3
-0x323C = 0x4E0B
-0x323D = 0x5316
-0x323E = 0x4EEE
-0x323F = 0x4F55
-0x3240 = 0x4F3D
-0x3241 = 0x4FA1
-0x3242 = 0x4F73
-0x3243 = 0x52A0
-0x3244 = 0x53EF
-0x3245 = 0x5609
-0x3246 = 0x590F
-0x3247 = 0x5AC1
-0x3248 = 0x5BB6
-0x3249 = 0x5BE1
-0x324A = 0x79D1
-0x324B = 0x6687
-0x324C = 0x679C
-0x324D = 0x67B6
-0x324E = 0x6B4C
-0x324F = 0x6CB3
-0x3250 = 0x706B
-0x3251 = 0x73C2
-0x3252 = 0x798D
-0x3253 = 0x79BE
-0x3254 = 0x7A3C
-0x3255 = 0x7B87
-0x3256 = 0x82B1
-0x3257 = 0x82DB
-0x3258 = 0x8304
-0x3259 = 0x8377
-0x325A = 0x83EF
-0x325B = 0x83D3
-0x325C = 0x8766
-0x325D = 0x8AB2
-0x325E = 0x5629
-0x325F = 0x8CA8
-0x3260 = 0x8FE6
-0x3261 = 0x904E
-0x3262 = 0x971E
-0x3263 = 0x868A
-0x3264 = 0x4FC4
-0x3265 = 0x5CE8
-0x3266 = 0x6211
-0x3267 = 0x7259
-0x3268 = 0x753B
-0x3269 = 0x81E5
-0x326A = 0x82BD
-0x326B = 0x86FE
-0x326C = 0x8CC0
-0x326D = 0x96C5
-0x326E = 0x9913
-0x326F = 0x99D5
-0x3270 = 0x4ECB
-0x3271 = 0x4F1A
-0x3272 = 0x89E3
-0x3273 = 0x56DE
-0x3274 = 0x584A
-0x3275 = 0x58CA
-0x3276 = 0x5EFB
-0x3277 = 0x5FEB
-0x3278 = 0x602A
-0x3279 = 0x6094
-0x327A = 0x6062
-0x327B = 0x61D0
-0x327C = 0x6212
-0x327D = 0x62D0
-0x327E = 0x6539
-0x3321 = 0x9B41
-0x3322 = 0x6666
-0x3323 = 0x68B0
-0x3324 = 0x6D77
-0x3325 = 0x7070
-0x3326 = 0x754C
-0x3327 = 0x7686
-0x3328 = 0x7D75
-0x3329 = 0x82A5
-0x332A = 0x87F9
-0x332B = 0x958B
-0x332C = 0x968E
-0x332D = 0x8C9D
-0x332E = 0x51F1
-0x332F = 0x52BE
-0x3330 = 0x5916
-0x3331 = 0x54B3
-0x3332 = 0x5BB3
-0x3333 = 0x5D16
-0x3334 = 0x6168
-0x3335 = 0x6982
-0x3336 = 0x6DAF
-0x3337 = 0x788D
-0x3338 = 0x84CB
-0x3339 = 0x8857
-0x333A = 0x8A72
-0x333B = 0x93A7
-0x333C = 0x9AB8
-0x333D = 0x6D6C
-0x333E = 0x99A8
-0x333F = 0x86D9
-0x3340 = 0x57A3
-0x3341 = 0x67FF
-0x3342 = 0x86CE
-0x3343 = 0x920E
-0x3344 = 0x5283
-0x3345 = 0x5687
-0x3346 = 0x5404
-0x3347 = 0x5ED3
-0x3348 = 0x62E1
-0x3349 = 0x64B9
-0x334A = 0x683C
-0x334B = 0x6838
-0x334C = 0x6BBB
-0x334D = 0x7372
-0x334E = 0x78BA
-0x334F = 0x7A6B
-0x3350 = 0x899A
-0x3351 = 0x89D2
-0x3352 = 0x8D6B
-0x3353 = 0x8F03
-0x3354 = 0x90ED
-0x3355 = 0x95A3
-0x3356 = 0x9694
-0x3357 = 0x9769
-0x3358 = 0x5B66
-0x3359 = 0x5CB3
-0x335A = 0x697D
-0x335B = 0x984D
-0x335C = 0x984E
-0x335D = 0x639B
-0x335E = 0x7B20
-0x335F = 0x6A2B
-0x3360 = 0x6A7F
-0x3361 = 0x68B6
-0x3362 = 0x9C0D
-0x3363 = 0x6F5F
-0x3364 = 0x5272
-0x3365 = 0x559D
-0x3366 = 0x6070
-0x3367 = 0x62EC
-0x3368 = 0x6D3B
-0x3369 = 0x6E07
-0x336A = 0x6ED1
-0x336B = 0x845B
-0x336C = 0x8910
-0x336D = 0x8F44
-0x336E = 0x4E14
-0x336F = 0x9C39
-0x3370 = 0x53F6
-0x3371 = 0x691B
-0x3372 = 0x6A3A
-0x3373 = 0x9784
-0x3374 = 0x682A
-0x3375 = 0x515C
-0x3376 = 0x7AC3
-0x3377 = 0x84B2
-0x3378 = 0x91DC
-0x3379 = 0x938C
-0x337A = 0x565B
-0x337B = 0x9D28
-0x337C = 0x6822
-0x337D = 0x8305
-0x337E = 0x8431
-0x3421 = 0x7CA5
-0x3422 = 0x5208
-0x3423 = 0x82C5
-0x3424 = 0x74E6
-0x3425 = 0x4E7E
-0x3426 = 0x4F83
-0x3427 = 0x51A0
-0x3428 = 0x5BD2
-0x3429 = 0x520A
-0x342A = 0x52D8
-0x342B = 0x52E7
-0x342C = 0x5DFB
-0x342D = 0x559A
-0x342E = 0x582A
-0x342F = 0x59E6
-0x3430 = 0x5B8C
-0x3431 = 0x5B98
-0x3432 = 0x5BDB
-0x3433 = 0x5E72
-0x3434 = 0x5E79
-0x3435 = 0x60A3
-0x3436 = 0x611F
-0x3437 = 0x6163
-0x3438 = 0x61BE
-0x3439 = 0x63DB
-0x343A = 0x6562
-0x343B = 0x67D1
-0x343C = 0x6853
-0x343D = 0x68FA
-0x343E = 0x6B3E
-0x343F = 0x6B53
-0x3440 = 0x6C57
-0x3441 = 0x6F22
-0x3442 = 0x6F97
-0x3443 = 0x6F45
-0x3444 = 0x74B0
-0x3445 = 0x7518
-0x3446 = 0x76E3
-0x3447 = 0x770B
-0x3448 = 0x7AFF
-0x3449 = 0x7BA1
-0x344A = 0x7C21
-0x344B = 0x7DE9
-0x344C = 0x7F36
-0x344D = 0x7FF0
-0x344E = 0x809D
-0x344F = 0x8266
-0x3450 = 0x839E
-0x3451 = 0x89B3
-0x3452 = 0x8ACC
-0x3453 = 0x8CAB
-0x3454 = 0x9084
-0x3455 = 0x9451
-0x3456 = 0x9593
-0x3457 = 0x9591
-0x3458 = 0x95A2
-0x3459 = 0x9665
-0x345A = 0x97D3
-0x345B = 0x9928
-0x345C = 0x8218
-0x345D = 0x4E38
-0x345E = 0x542B
-0x345F = 0x5CB8
-0x3460 = 0x5DCC
-0x3461 = 0x73A9
-0x3462 = 0x764C
-0x3463 = 0x773C
-0x3464 = 0x5CA9
-0x3465 = 0x7FEB
-0x3466 = 0x8D0B
-0x3467 = 0x96C1
-0x3468 = 0x9811
-0x3469 = 0x9854
-0x346A = 0x9858
-0x346B = 0x4F01
-0x346C = 0x4F0E
-0x346D = 0x5371
-0x346E = 0x559C
-0x346F = 0x5668
-0x3470 = 0x57FA
-0x3471 = 0x5947
-0x3472 = 0x5B09
-0x3473 = 0x5BC4
-0x3474 = 0x5C90
-0x3475 = 0x5E0C
-0x3476 = 0x5E7E
-0x3477 = 0x5FCC
-0x3478 = 0x63EE
-0x3479 = 0x673A
-0x347A = 0x65D7
-0x347B = 0x65E2
-0x347C = 0x671F
-0x347D = 0x68CB
-0x347E = 0x68C4
-0x3521 = 0x6A5F
-0x3522 = 0x5E30
-0x3523 = 0x6BC5
-0x3524 = 0x6C17
-0x3525 = 0x6C7D
-0x3526 = 0x757F
-0x3527 = 0x7948
-0x3528 = 0x5B63
-0x3529 = 0x7A00
-0x352A = 0x7D00
-0x352B = 0x5FBD
-0x352C = 0x898F
-0x352D = 0x8A18
-0x352E = 0x8CB4
-0x352F = 0x8D77
-0x3530 = 0x8ECC
-0x3531 = 0x8F1D
-0x3532 = 0x98E2
-0x3533 = 0x9A0E
-0x3534 = 0x9B3C
-0x3535 = 0x4E80
-0x3536 = 0x507D
-0x3537 = 0x5100
-0x3538 = 0x5993
-0x3539 = 0x5B9C
-0x353A = 0x622F
-0x353B = 0x6280
-0x353C = 0x64EC
-0x353D = 0x6B3A
-0x353E = 0x72A0
-0x353F = 0x7591
-0x3540 = 0x7947
-0x3541 = 0x7FA9
-0x3542 = 0x87FB
-0x3543 = 0x8ABC
-0x3544 = 0x8B70
-0x3545 = 0x63AC
-0x3546 = 0x83CA
-0x3547 = 0x97A0
-0x3548 = 0x5409
-0x3549 = 0x5403
-0x354A = 0x55AB
-0x354B = 0x6854
-0x354C = 0x6A58
-0x354D = 0x8A70
-0x354E = 0x7827
-0x354F = 0x6775
-0x3550 = 0x9ECD
-0x3551 = 0x5374
-0x3552 = 0x5BA2
-0x3553 = 0x811A
-0x3554 = 0x8650
-0x3555 = 0x9006
-0x3556 = 0x4E18
-0x3557 = 0x4E45
-0x3558 = 0x4EC7
-0x3559 = 0x4F11
-0x355A = 0x53CA
-0x355B = 0x5438
-0x355C = 0x5BAE
-0x355D = 0x5F13
-0x355E = 0x6025
-0x355F = 0x6551
-0x3560 = 0x673D
-0x3561 = 0x6C42
-0x3562 = 0x6C72
-0x3563 = 0x6CE3
-0x3564 = 0x7078
-0x3565 = 0x7403
-0x3566 = 0x7A76
-0x3567 = 0x7AAE
-0x3568 = 0x7B08
-0x3569 = 0x7D1A
-0x356A = 0x7CFE
-0x356B = 0x7D66
-0x356C = 0x65E7
-0x356D = 0x725B
-0x356E = 0x53BB
-0x356F = 0x5C45
-0x3570 = 0x5DE8
-0x3571 = 0x62D2
-0x3572 = 0x62E0
-0x3573 = 0x6319
-0x3574 = 0x6E20
-0x3575 = 0x865A
-0x3576 = 0x8A31
-0x3577 = 0x8DDD
-0x3578 = 0x92F8
-0x3579 = 0x6F01
-0x357A = 0x79A6
-0x357B = 0x9B5A
-0x357C = 0x4EA8
-0x357D = 0x4EAB
-0x357E = 0x4EAC
-0x3621 = 0x4F9B
-0x3622 = 0x4FA0
-0x3623 = 0x50D1
-0x3624 = 0x5147
-0x3625 = 0x7AF6
-0x3626 = 0x5171
-0x3627 = 0x51F6
-0x3628 = 0x5354
-0x3629 = 0x5321
-0x362A = 0x537F
-0x362B = 0x53EB
-0x362C = 0x55AC
-0x362D = 0x5883
-0x362E = 0x5CE1
-0x362F = 0x5F37
-0x3630 = 0x5F4A
-0x3631 = 0x602F
-0x3632 = 0x6050
-0x3633 = 0x606D
-0x3634 = 0x631F
-0x3635 = 0x6559
-0x3636 = 0x6A4B
-0x3637 = 0x6CC1
-0x3638 = 0x72C2
-0x3639 = 0x72ED
-0x363A = 0x77EF
-0x363B = 0x80F8
-0x363C = 0x8105
-0x363D = 0x8208
-0x363E = 0x854E
-0x363F = 0x90F7
-0x3640 = 0x93E1
-0x3641 = 0x97FF
-0x3642 = 0x9957
-0x3643 = 0x9A5A
-0x3644 = 0x4EF0
-0x3645 = 0x51DD
-0x3646 = 0x5C2D
-0x3647 = 0x6681
-0x3648 = 0x696D
-0x3649 = 0x5C40
-0x364A = 0x66F2
-0x364B = 0x6975
-0x364C = 0x7389
-0x364D = 0x6850
-0x364E = 0x7C81
-0x364F = 0x50C5
-0x3650 = 0x52E4
-0x3651 = 0x5747
-0x3652 = 0x5DFE
-0x3653 = 0x9326
-0x3654 = 0x65A4
-0x3655 = 0x6B23
-0x3656 = 0x6B3D
-0x3657 = 0x7434
-0x3658 = 0x7981
-0x3659 = 0x79BD
-0x365A = 0x7B4B
-0x365B = 0x7DCA
-0x365C = 0x82B9
-0x365D = 0x83CC
-0x365E = 0x887F
-0x365F = 0x895F
-0x3660 = 0x8B39
-0x3661 = 0x8FD1
-0x3662 = 0x91D1
-0x3663 = 0x541F
-0x3664 = 0x9280
-0x3665 = 0x4E5D
-0x3666 = 0x5036
-0x3667 = 0x53E5
-0x3668 = 0x533A
-0x3669 = 0x72D7
-0x366A = 0x7396
-0x366B = 0x77E9
-0x366C = 0x82E6
-0x366D = 0x8EAF
-0x366E = 0x99C6
-0x366F = 0x99C8
-0x3670 = 0x99D2
-0x3671 = 0x5177
-0x3672 = 0x611A
-0x3673 = 0x865E
-0x3674 = 0x55B0
-0x3675 = 0x7A7A
-0x3676 = 0x5076
-0x3677 = 0x5BD3
-0x3678 = 0x9047
-0x3679 = 0x9685
-0x367A = 0x4E32
-0x367B = 0x6ADB
-0x367C = 0x91E7
-0x367D = 0x5C51
-0x367E = 0x5C48
-0x3721 = 0x6398
-0x3722 = 0x7A9F
-0x3723 = 0x6C93
-0x3724 = 0x9774
-0x3725 = 0x8F61
-0x3726 = 0x7AAA
-0x3727 = 0x718A
-0x3728 = 0x9688
-0x3729 = 0x7C82
-0x372A = 0x6817
-0x372B = 0x7E70
-0x372C = 0x6851
-0x372D = 0x936C
-0x372E = 0x52F2
-0x372F = 0x541B
-0x3730 = 0x85AB
-0x3731 = 0x8A13
-0x3732 = 0x7FA4
-0x3733 = 0x8ECD
-0x3734 = 0x90E1
-0x3735 = 0x5366
-0x3736 = 0x8888
-0x3737 = 0x7941
-0x3738 = 0x4FC2
-0x3739 = 0x50BE
-0x373A = 0x5211
-0x373B = 0x5144
-0x373C = 0x5553
-0x373D = 0x572D
-0x373E = 0x73EA
-0x373F = 0x578B
-0x3740 = 0x5951
-0x3741 = 0x5F62
-0x3742 = 0x5F84
-0x3743 = 0x6075
-0x3744 = 0x6176
-0x3745 = 0x6167
-0x3746 = 0x61A9
-0x3747 = 0x63B2
-0x3748 = 0x643A
-0x3749 = 0x656C
-0x374A = 0x666F
-0x374B = 0x6842
-0x374C = 0x6E13
-0x374D = 0x7566
-0x374E = 0x7A3D
-0x374F = 0x7CFB
-0x3750 = 0x7D4C
-0x3751 = 0x7D99
-0x3752 = 0x7E4B
-0x3753 = 0x7F6B
-0x3754 = 0x830E
-0x3755 = 0x834A
-0x3756 = 0x86CD
-0x3757 = 0x8A08
-0x3758 = 0x8A63
-0x3759 = 0x8B66
-0x375A = 0x8EFD
-0x375B = 0x981A
-0x375C = 0x9D8F
-0x375D = 0x82B8
-0x375E = 0x8FCE
-0x375F = 0x9BE8
-0x3760 = 0x5287
-0x3761 = 0x621F
-0x3762 = 0x6483
-0x3763 = 0x6FC0
-0x3764 = 0x9699
-0x3765 = 0x6841
-0x3766 = 0x5091
-0x3767 = 0x6B20
-0x3768 = 0x6C7A
-0x3769 = 0x6F54
-0x376A = 0x7A74
-0x376B = 0x7D50
-0x376C = 0x8840
-0x376D = 0x8A23
-0x376E = 0x6708
-0x376F = 0x4EF6
-0x3770 = 0x5039
-0x3771 = 0x5026
-0x3772 = 0x5065
-0x3773 = 0x517C
-0x3774 = 0x5238
-0x3775 = 0x5263
-0x3776 = 0x55A7
-0x3777 = 0x570F
-0x3778 = 0x5805
-0x3779 = 0x5ACC
-0x377A = 0x5EFA
-0x377B = 0x61B2
-0x377C = 0x61F8
-0x377D = 0x62F3
-0x377E = 0x6372
-0x3821 = 0x691C
-0x3822 = 0x6A29
-0x3823 = 0x727D
-0x3824 = 0x72AC
-0x3825 = 0x732E
-0x3826 = 0x7814
-0x3827 = 0x786F
-0x3828 = 0x7D79
-0x3829 = 0x770C
-0x382A = 0x80A9
-0x382B = 0x898B
-0x382C = 0x8B19
-0x382D = 0x8CE2
-0x382E = 0x8ED2
-0x382F = 0x9063
-0x3830 = 0x9375
-0x3831 = 0x967A
-0x3832 = 0x9855
-0x3833 = 0x9A13
-0x3834 = 0x9E78
-0x3835 = 0x5143
-0x3836 = 0x539F
-0x3837 = 0x53B3
-0x3838 = 0x5E7B
-0x3839 = 0x5F26
-0x383A = 0x6E1B
-0x383B = 0x6E90
-0x383C = 0x7384
-0x383D = 0x73FE
-0x383E = 0x7D43
-0x383F = 0x8237
-0x3840 = 0x8A00
-0x3841 = 0x8AFA
-0x3842 = 0x9650
-0x3843 = 0x4E4E
-0x3844 = 0x500B
-0x3845 = 0x53E4
-0x3846 = 0x547C
-0x3847 = 0x56FA
-0x3848 = 0x59D1
-0x3849 = 0x5B64
-0x384A = 0x5DF1
-0x384B = 0x5EAB
-0x384C = 0x5F27
-0x384D = 0x6238
-0x384E = 0x6545
-0x384F = 0x67AF
-0x3850 = 0x6E56
-0x3851 = 0x72D0
-0x3852 = 0x7CCA
-0x3853 = 0x88B4
-0x3854 = 0x80A1
-0x3855 = 0x80E1
-0x3856 = 0x83F0
-0x3857 = 0x864E
-0x3858 = 0x8A87
-0x3859 = 0x8DE8
-0x385A = 0x9237
-0x385B = 0x96C7
-0x385C = 0x9867
-0x385D = 0x9F13
-0x385E = 0x4E94
-0x385F = 0x4E92
-0x3860 = 0x4F0D
-0x3861 = 0x5348
-0x3862 = 0x5449
-0x3863 = 0x543E
-0x3864 = 0x5A2F
-0x3865 = 0x5F8C
-0x3866 = 0x5FA1
-0x3867 = 0x609F
-0x3868 = 0x68A7
-0x3869 = 0x6A8E
-0x386A = 0x745A
-0x386B = 0x7881
-0x386C = 0x8A9E
-0x386D = 0x8AA4
-0x386E = 0x8B77
-0x386F = 0x9190
-0x3870 = 0x4E5E
-0x3871 = 0x9BC9
-0x3872 = 0x4EA4
-0x3873 = 0x4F7C
-0x3874 = 0x4FAF
-0x3875 = 0x5019
-0x3876 = 0x5016
-0x3877 = 0x5149
-0x3878 = 0x516C
-0x3879 = 0x529F
-0x387A = 0x52B9
-0x387B = 0x52FE
-0x387C = 0x539A
-0x387D = 0x53E3
-0x387E = 0x5411
-0x3921 = 0x540E
-0x3922 = 0x5589
-0x3923 = 0x5751
-0x3924 = 0x57A2
-0x3925 = 0x597D
-0x3926 = 0x5B54
-0x3927 = 0x5B5D
-0x3928 = 0x5B8F
-0x3929 = 0x5DE5
-0x392A = 0x5DE7
-0x392B = 0x5DF7
-0x392C = 0x5E78
-0x392D = 0x5E83
-0x392E = 0x5E9A
-0x392F = 0x5EB7
-0x3930 = 0x5F18
-0x3931 = 0x6052
-0x3932 = 0x614C
-0x3933 = 0x6297
-0x3934 = 0x62D8
-0x3935 = 0x63A7
-0x3936 = 0x653B
-0x3937 = 0x6602
-0x3938 = 0x6643
-0x3939 = 0x66F4
-0x393A = 0x676D
-0x393B = 0x6821
-0x393C = 0x6897
-0x393D = 0x69CB
-0x393E = 0x6C5F
-0x393F = 0x6D2A
-0x3940 = 0x6D69
-0x3941 = 0x6E2F
-0x3942 = 0x6E9D
-0x3943 = 0x7532
-0x3944 = 0x7687
-0x3945 = 0x786C
-0x3946 = 0x7A3F
-0x3947 = 0x7CE0
-0x3948 = 0x7D05
-0x3949 = 0x7D18
-0x394A = 0x7D5E
-0x394B = 0x7DB1
-0x394C = 0x8015
-0x394D = 0x8003
-0x394E = 0x80AF
-0x394F = 0x80B1
-0x3950 = 0x8154
-0x3951 = 0x818F
-0x3952 = 0x822A
-0x3953 = 0x8352
-0x3954 = 0x884C
-0x3955 = 0x8861
-0x3956 = 0x8B1B
-0x3957 = 0x8CA2
-0x3958 = 0x8CFC
-0x3959 = 0x90CA
-0x395A = 0x9175
-0x395B = 0x9271
-0x395C = 0x783F
-0x395D = 0x92FC
-0x395E = 0x95A4
-0x395F = 0x964D
-0x3960 = 0x9805
-0x3961 = 0x9999
-0x3962 = 0x9AD8
-0x3963 = 0x9D3B
-0x3964 = 0x525B
-0x3965 = 0x52AB
-0x3966 = 0x53F7
-0x3967 = 0x5408
-0x3968 = 0x58D5
-0x3969 = 0x62F7
-0x396A = 0x6FE0
-0x396B = 0x8C6A
-0x396C = 0x8F5F
-0x396D = 0x9EB9
-0x396E = 0x514B
-0x396F = 0x523B
-0x3970 = 0x544A
-0x3971 = 0x56FD
-0x3972 = 0x7A40
-0x3973 = 0x9177
-0x3974 = 0x9D60
-0x3975 = 0x9ED2
-0x3976 = 0x7344
-0x3977 = 0x6F09
-0x3978 = 0x8170
-0x3979 = 0x7511
-0x397A = 0x5FFD
-0x397B = 0x60DA
-0x397C = 0x9AA8
-0x397D = 0x72DB
-0x397E = 0x8FBC
-0x3A21 = 0x6B64
-0x3A22 = 0x9803
-0x3A23 = 0x4ECA
-0x3A24 = 0x56F0
-0x3A25 = 0x5764
-0x3A26 = 0x58BE
-0x3A27 = 0x5A5A
-0x3A28 = 0x6068
-0x3A29 = 0x61C7
-0x3A2A = 0x660F
-0x3A2B = 0x6606
-0x3A2C = 0x6839
-0x3A2D = 0x68B1
-0x3A2E = 0x6DF7
-0x3A2F = 0x75D5
-0x3A30 = 0x7D3A
-0x3A31 = 0x826E
-0x3A32 = 0x9B42
-0x3A33 = 0x4E9B
-0x3A34 = 0x4F50
-0x3A35 = 0x53C9
-0x3A36 = 0x5506
-0x3A37 = 0x5D6F
-0x3A38 = 0x5DE6
-0x3A39 = 0x5DEE
-0x3A3A = 0x67FB
-0x3A3B = 0x6C99
-0x3A3C = 0x7473
-0x3A3D = 0x7802
-0x3A3E = 0x8A50
-0x3A3F = 0x9396
-0x3A40 = 0x88DF
-0x3A41 = 0x5750
-0x3A42 = 0x5EA7
-0x3A43 = 0x632B
-0x3A44 = 0x50B5
-0x3A45 = 0x50AC
-0x3A46 = 0x518D
-0x3A47 = 0x6700
-0x3A48 = 0x54C9
-0x3A49 = 0x585E
-0x3A4A = 0x59BB
-0x3A4B = 0x5BB0
-0x3A4C = 0x5F69
-0x3A4D = 0x624D
-0x3A4E = 0x63A1
-0x3A4F = 0x683D
-0x3A50 = 0x6B73
-0x3A51 = 0x6E08
-0x3A52 = 0x707D
-0x3A53 = 0x91C7
-0x3A54 = 0x7280
-0x3A55 = 0x7815
-0x3A56 = 0x7826
-0x3A57 = 0x796D
-0x3A58 = 0x658E
-0x3A59 = 0x7D30
-0x3A5A = 0x83DC
-0x3A5B = 0x88C1
-0x3A5C = 0x8F09
-0x3A5D = 0x969B
-0x3A5E = 0x5264
-0x3A5F = 0x5728
-0x3A60 = 0x6750
-0x3A61 = 0x7F6A
-0x3A62 = 0x8CA1
-0x3A63 = 0x51B4
-0x3A64 = 0x5742
-0x3A65 = 0x962A
-0x3A66 = 0x583A
-0x3A67 = 0x698A
-0x3A68 = 0x80B4
-0x3A69 = 0x54B2
-0x3A6A = 0x5D0E
-0x3A6B = 0x57FC
-0x3A6C = 0x7895
-0x3A6D = 0x9DFA
-0x3A6E = 0x4F5C
-0x3A6F = 0x524A
-0x3A70 = 0x548B
-0x3A71 = 0x643E
-0x3A72 = 0x6628
-0x3A73 = 0x6714
-0x3A74 = 0x67F5
-0x3A75 = 0x7A84
-0x3A76 = 0x7B56
-0x3A77 = 0x7D22
-0x3A78 = 0x932F
-0x3A79 = 0x685C
-0x3A7A = 0x9BAD
-0x3A7B = 0x7B39
-0x3A7C = 0x5319
-0x3A7D = 0x518A
-0x3A7E = 0x5237
-0x3B21 = 0x5BDF
-0x3B22 = 0x62F6
-0x3B23 = 0x64AE
-0x3B24 = 0x64E6
-0x3B25 = 0x672D
-0x3B26 = 0x6BBA
-0x3B27 = 0x85A9
-0x3B28 = 0x96D1
-0x3B29 = 0x7690
-0x3B2A = 0x9BD6
-0x3B2B = 0x634C
-0x3B2C = 0x9306
-0x3B2D = 0x9BAB
-0x3B2E = 0x76BF
-0x3B2F = 0x6652
-0x3B30 = 0x4E09
-0x3B31 = 0x5098
-0x3B32 = 0x53C2
-0x3B33 = 0x5C71
-0x3B34 = 0x60E8
-0x3B35 = 0x6492
-0x3B36 = 0x6563
-0x3B37 = 0x685F
-0x3B38 = 0x71E6
-0x3B39 = 0x73CA
-0x3B3A = 0x7523
-0x3B3B = 0x7B97
-0x3B3C = 0x7E82
-0x3B3D = 0x8695
-0x3B3E = 0x8B83
-0x3B3F = 0x8CDB
-0x3B40 = 0x9178
-0x3B41 = 0x9910
-0x3B42 = 0x65AC
-0x3B43 = 0x66AB
-0x3B44 = 0x6B8B
-0x3B45 = 0x4ED5
-0x3B46 = 0x4ED4
-0x3B47 = 0x4F3A
-0x3B48 = 0x4F7F
-0x3B49 = 0x523A
-0x3B4A = 0x53F8
-0x3B4B = 0x53F2
-0x3B4C = 0x55E3
-0x3B4D = 0x56DB
-0x3B4E = 0x58EB
-0x3B4F = 0x59CB
-0x3B50 = 0x59C9
-0x3B51 = 0x59FF
-0x3B52 = 0x5B50
-0x3B53 = 0x5C4D
-0x3B54 = 0x5E02
-0x3B55 = 0x5E2B
-0x3B56 = 0x5FD7
-0x3B57 = 0x601D
-0x3B58 = 0x6307
-0x3B59 = 0x652F
-0x3B5A = 0x5B5C
-0x3B5B = 0x65AF
-0x3B5C = 0x65BD
-0x3B5D = 0x65E8
-0x3B5E = 0x679D
-0x3B5F = 0x6B62
-0x3B60 = 0x6B7B
-0x3B61 = 0x6C0F
-0x3B62 = 0x7345
-0x3B63 = 0x7949
-0x3B64 = 0x79C1
-0x3B65 = 0x7CF8
-0x3B66 = 0x7D19
-0x3B67 = 0x7D2B
-0x3B68 = 0x80A2
-0x3B69 = 0x8102
-0x3B6A = 0x81F3
-0x3B6B = 0x8996
-0x3B6C = 0x8A5E
-0x3B6D = 0x8A69
-0x3B6E = 0x8A66
-0x3B6F = 0x8A8C
-0x3B70 = 0x8AEE
-0x3B71 = 0x8CC7
-0x3B72 = 0x8CDC
-0x3B73 = 0x96CC
-0x3B74 = 0x98FC
-0x3B75 = 0x6B6F
-0x3B76 = 0x4E8B
-0x3B77 = 0x4F3C
-0x3B78 = 0x4F8D
-0x3B79 = 0x5150
-0x3B7A = 0x5B57
-0x3B7B = 0x5BFA
-0x3B7C = 0x6148
-0x3B7D = 0x6301
-0x3B7E = 0x6642
-0x3C21 = 0x6B21
-0x3C22 = 0x6ECB
-0x3C23 = 0x6CBB
-0x3C24 = 0x723E
-0x3C25 = 0x74BD
-0x3C26 = 0x75D4
-0x3C27 = 0x78C1
-0x3C28 = 0x793A
-0x3C29 = 0x800C
-0x3C2A = 0x8033
-0x3C2B = 0x81EA
-0x3C2C = 0x8494
-0x3C2D = 0x8F9E
-0x3C2E = 0x6C50
-0x3C2F = 0x9E7F
-0x3C30 = 0x5F0F
-0x3C31 = 0x8B58
-0x3C32 = 0x9D2B
-0x3C33 = 0x7AFA
-0x3C34 = 0x8EF8
-0x3C35 = 0x5B8D
-0x3C36 = 0x96EB
-0x3C37 = 0x4E03
-0x3C38 = 0x53F1
-0x3C39 = 0x57F7
-0x3C3A = 0x5931
-0x3C3B = 0x5AC9
-0x3C3C = 0x5BA4
-0x3C3D = 0x6089
-0x3C3E = 0x6E7F
-0x3C3F = 0x6F06
-0x3C40 = 0x75BE
-0x3C41 = 0x8CEA
-0x3C42 = 0x5B9F
-0x3C43 = 0x8500
-0x3C44 = 0x7BE0
-0x3C45 = 0x5072
-0x3C46 = 0x67F4
-0x3C47 = 0x829D
-0x3C48 = 0x5C61
-0x3C49 = 0x854A
-0x3C4A = 0x7E1E
-0x3C4B = 0x820E
-0x3C4C = 0x5199
-0x3C4D = 0x5C04
-0x3C4E = 0x6368
-0x3C4F = 0x8D66
-0x3C50 = 0x659C
-0x3C51 = 0x716E
-0x3C52 = 0x793E
-0x3C53 = 0x7D17
-0x3C54 = 0x8005
-0x3C55 = 0x8B1D
-0x3C56 = 0x8ECA
-0x3C57 = 0x906E
-0x3C58 = 0x86C7
-0x3C59 = 0x90AA
-0x3C5A = 0x501F
-0x3C5B = 0x52FA
-0x3C5C = 0x5C3A
-0x3C5D = 0x6753
-0x3C5E = 0x707C
-0x3C5F = 0x7235
-0x3C60 = 0x914C
-0x3C61 = 0x91C8
-0x3C62 = 0x932B
-0x3C63 = 0x82E5
-0x3C64 = 0x5BC2
-0x3C65 = 0x5F31
-0x3C66 = 0x60F9
-0x3C67 = 0x4E3B
-0x3C68 = 0x53D6
-0x3C69 = 0x5B88
-0x3C6A = 0x624B
-0x3C6B = 0x6731
-0x3C6C = 0x6B8A
-0x3C6D = 0x72E9
-0x3C6E = 0x73E0
-0x3C6F = 0x7A2E
-0x3C70 = 0x816B
-0x3C71 = 0x8DA3
-0x3C72 = 0x9152
-0x3C73 = 0x9996
-0x3C74 = 0x5112
-0x3C75 = 0x53D7
-0x3C76 = 0x546A
-0x3C77 = 0x5BFF
-0x3C78 = 0x6388
-0x3C79 = 0x6A39
-0x3C7A = 0x7DAC
-0x3C7B = 0x9700
-0x3C7C = 0x56DA
-0x3C7D = 0x53CE
-0x3C7E = 0x5468
-0x3D21 = 0x5B97
-0x3D22 = 0x5C31
-0x3D23 = 0x5DDE
-0x3D24 = 0x4FEE
-0x3D25 = 0x6101
-0x3D26 = 0x62FE
-0x3D27 = 0x6D32
-0x3D28 = 0x79C0
-0x3D29 = 0x79CB
-0x3D2A = 0x7D42
-0x3D2B = 0x7E4D
-0x3D2C = 0x7FD2
-0x3D2D = 0x81ED
-0x3D2E = 0x821F
-0x3D2F = 0x8490
-0x3D30 = 0x8846
-0x3D31 = 0x8972
-0x3D32 = 0x8B90
-0x3D33 = 0x8E74
-0x3D34 = 0x8F2F
-0x3D35 = 0x9031
-0x3D36 = 0x914B
-0x3D37 = 0x916C
-0x3D38 = 0x96C6
-0x3D39 = 0x919C
-0x3D3A = 0x4EC0
-0x3D3B = 0x4F4F
-0x3D3C = 0x5145
-0x3D3D = 0x5341
-0x3D3E = 0x5F93
-0x3D3F = 0x620E
-0x3D40 = 0x67D4
-0x3D41 = 0x6C41
-0x3D42 = 0x6E0B
-0x3D43 = 0x7363
-0x3D44 = 0x7E26
-0x3D45 = 0x91CD
-0x3D46 = 0x9283
-0x3D47 = 0x53D4
-0x3D48 = 0x5919
-0x3D49 = 0x5BBF
-0x3D4A = 0x6DD1
-0x3D4B = 0x795D
-0x3D4C = 0x7E2E
-0x3D4D = 0x7C9B
-0x3D4E = 0x587E
-0x3D4F = 0x719F
-0x3D50 = 0x51FA
-0x3D51 = 0x8853
-0x3D52 = 0x8FF0
-0x3D53 = 0x4FCA
-0x3D54 = 0x5CFB
-0x3D55 = 0x6625
-0x3D56 = 0x77AC
-0x3D57 = 0x7AE3
-0x3D58 = 0x821C
-0x3D59 = 0x99FF
-0x3D5A = 0x51C6
-0x3D5B = 0x5FAA
-0x3D5C = 0x65EC
-0x3D5D = 0x696F
-0x3D5E = 0x6B89
-0x3D5F = 0x6DF3
-0x3D60 = 0x6E96
-0x3D61 = 0x6F64
-0x3D62 = 0x76FE
-0x3D63 = 0x7D14
-0x3D64 = 0x5DE1
-0x3D65 = 0x9075
-0x3D66 = 0x9187
-0x3D67 = 0x9806
-0x3D68 = 0x51E6
-0x3D69 = 0x521D
-0x3D6A = 0x6240
-0x3D6B = 0x6691
-0x3D6C = 0x66D9
-0x3D6D = 0x6E1A
-0x3D6E = 0x5EB6
-0x3D6F = 0x7DD2
-0x3D70 = 0x7F72
-0x3D71 = 0x66F8
-0x3D72 = 0x85AF
-0x3D73 = 0x85F7
-0x3D74 = 0x8AF8
-0x3D75 = 0x52A9
-0x3D76 = 0x53D9
-0x3D77 = 0x5973
-0x3D78 = 0x5E8F
-0x3D79 = 0x5F90
-0x3D7A = 0x6055
-0x3D7B = 0x92E4
-0x3D7C = 0x9664
-0x3D7D = 0x50B7
-0x3D7E = 0x511F
-0x3E21 = 0x52DD
-0x3E22 = 0x5320
-0x3E23 = 0x5347
-0x3E24 = 0x53EC
-0x3E25 = 0x54E8
-0x3E26 = 0x5546
-0x3E27 = 0x5531
-0x3E28 = 0x5617
-0x3E29 = 0x5968
-0x3E2A = 0x59BE
-0x3E2B = 0x5A3C
-0x3E2C = 0x5BB5
-0x3E2D = 0x5C06
-0x3E2E = 0x5C0F
-0x3E2F = 0x5C11
-0x3E30 = 0x5C1A
-0x3E31 = 0x5E84
-0x3E32 = 0x5E8A
-0x3E33 = 0x5EE0
-0x3E34 = 0x5F70
-0x3E35 = 0x627F
-0x3E36 = 0x6284
-0x3E37 = 0x62DB
-0x3E38 = 0x638C
-0x3E39 = 0x6377
-0x3E3A = 0x6607
-0x3E3B = 0x660C
-0x3E3C = 0x662D
-0x3E3D = 0x6676
-0x3E3E = 0x677E
-0x3E3F = 0x68A2
-0x3E40 = 0x6A1F
-0x3E41 = 0x6A35
-0x3E42 = 0x6CBC
-0x3E43 = 0x6D88
-0x3E44 = 0x6E09
-0x3E45 = 0x6E58
-0x3E46 = 0x713C
-0x3E47 = 0x7126
-0x3E48 = 0x7167
-0x3E49 = 0x75C7
-0x3E4A = 0x7701
-0x3E4B = 0x785D
-0x3E4C = 0x7901
-0x3E4D = 0x7965
-0x3E4E = 0x79F0
-0x3E4F = 0x7AE0
-0x3E50 = 0x7B11
-0x3E51 = 0x7CA7
-0x3E52 = 0x7D39
-0x3E53 = 0x8096
-0x3E54 = 0x83D6
-0x3E55 = 0x848B
-0x3E56 = 0x8549
-0x3E57 = 0x885D
-0x3E58 = 0x88F3
-0x3E59 = 0x8A1F
-0x3E5A = 0x8A3C
-0x3E5B = 0x8A54
-0x3E5C = 0x8A73
-0x3E5D = 0x8C61
-0x3E5E = 0x8CDE
-0x3E5F = 0x91A4
-0x3E60 = 0x9266
-0x3E61 = 0x937E
-0x3E62 = 0x9418
-0x3E63 = 0x969C
-0x3E64 = 0x9798
-0x3E65 = 0x4E0A
-0x3E66 = 0x4E08
-0x3E67 = 0x4E1E
-0x3E68 = 0x4E57
-0x3E69 = 0x5197
-0x3E6A = 0x5270
-0x3E6B = 0x57CE
-0x3E6C = 0x5834
-0x3E6D = 0x58CC
-0x3E6E = 0x5B22
-0x3E6F = 0x5E38
-0x3E70 = 0x60C5
-0x3E71 = 0x64FE
-0x3E72 = 0x6761
-0x3E73 = 0x6756
-0x3E74 = 0x6D44
-0x3E75 = 0x72B6
-0x3E76 = 0x7573
-0x3E77 = 0x7A63
-0x3E78 = 0x84B8
-0x3E79 = 0x8B72
-0x3E7A = 0x91B8
-0x3E7B = 0x9320
-0x3E7C = 0x5631
-0x3E7D = 0x57F4
-0x3E7E = 0x98FE
-0x3F21 = 0x62ED
-0x3F22 = 0x690D
-0x3F23 = 0x6B96
-0x3F24 = 0x71ED
-0x3F25 = 0x7E54
-0x3F26 = 0x8077
-0x3F27 = 0x8272
-0x3F28 = 0x89E6
-0x3F29 = 0x98DF
-0x3F2A = 0x8755
-0x3F2B = 0x8FB1
-0x3F2C = 0x5C3B
-0x3F2D = 0x4F38
-0x3F2E = 0x4FE1
-0x3F2F = 0x4FB5
-0x3F30 = 0x5507
-0x3F31 = 0x5A20
-0x3F32 = 0x5BDD
-0x3F33 = 0x5BE9
-0x3F34 = 0x5FC3
-0x3F35 = 0x614E
-0x3F36 = 0x632F
-0x3F37 = 0x65B0
-0x3F38 = 0x664B
-0x3F39 = 0x68EE
-0x3F3A = 0x699B
-0x3F3B = 0x6D78
-0x3F3C = 0x6DF1
-0x3F3D = 0x7533
-0x3F3E = 0x75B9
-0x3F3F = 0x771F
-0x3F40 = 0x795E
-0x3F41 = 0x79E6
-0x3F42 = 0x7D33
-0x3F43 = 0x81E3
-0x3F44 = 0x82AF
-0x3F45 = 0x85AA
-0x3F46 = 0x89AA
-0x3F47 = 0x8A3A
-0x3F48 = 0x8EAB
-0x3F49 = 0x8F9B
-0x3F4A = 0x9032
-0x3F4B = 0x91DD
-0x3F4C = 0x9707
-0x3F4D = 0x4EBA
-0x3F4E = 0x4EC1
-0x3F4F = 0x5203
-0x3F50 = 0x5875
-0x3F51 = 0x58EC
-0x3F52 = 0x5C0B
-0x3F53 = 0x751A
-0x3F54 = 0x5C3D
-0x3F55 = 0x814E
-0x3F56 = 0x8A0A
-0x3F57 = 0x8FC5
-0x3F58 = 0x9663
-0x3F59 = 0x976D
-0x3F5A = 0x7B25
-0x3F5B = 0x8ACF
-0x3F5C = 0x9808
-0x3F5D = 0x9162
-0x3F5E = 0x56F3
-0x3F5F = 0x53A8
-0x3F60 = 0x9017
-0x3F61 = 0x5439
-0x3F62 = 0x5782
-0x3F63 = 0x5E25
-0x3F64 = 0x63A8
-0x3F65 = 0x6C34
-0x3F66 = 0x708A
-0x3F67 = 0x7761
-0x3F68 = 0x7C8B
-0x3F69 = 0x7FE0
-0x3F6A = 0x8870
-0x3F6B = 0x9042
-0x3F6C = 0x9154
-0x3F6D = 0x9310
-0x3F6E = 0x9318
-0x3F6F = 0x968F
-0x3F70 = 0x745E
-0x3F71 = 0x9AC4
-0x3F72 = 0x5D07
-0x3F73 = 0x5D69
-0x3F74 = 0x6570
-0x3F75 = 0x67A2
-0x3F76 = 0x8DA8
-0x3F77 = 0x96DB
-0x3F78 = 0x636E
-0x3F79 = 0x6749
-0x3F7A = 0x6919
-0x3F7B = 0x83C5
-0x3F7C = 0x9817
-0x3F7D = 0x96C0
-0x3F7E = 0x88FE
-0x4021 = 0x6F84
-0x4022 = 0x647A
-0x4023 = 0x5BF8
-0x4024 = 0x4E16
-0x4025 = 0x702C
-0x4026 = 0x755D
-0x4027 = 0x662F
-0x4028 = 0x51C4
-0x4029 = 0x5236
-0x402A = 0x52E2
-0x402B = 0x59D3
-0x402C = 0x5F81
-0x402D = 0x6027
-0x402E = 0x6210
-0x402F = 0x653F
-0x4030 = 0x6574
-0x4031 = 0x661F
-0x4032 = 0x6674
-0x4033 = 0x68F2
-0x4034 = 0x6816
-0x4035 = 0x6B63
-0x4036 = 0x6E05
-0x4037 = 0x7272
-0x4038 = 0x751F
-0x4039 = 0x76DB
-0x403A = 0x7CBE
-0x403B = 0x8056
-0x403C = 0x58F0
-0x403D = 0x88FD
-0x403E = 0x897F
-0x403F = 0x8AA0
-0x4040 = 0x8A93
-0x4041 = 0x8ACB
-0x4042 = 0x901D
-0x4043 = 0x9192
-0x4044 = 0x9752
-0x4045 = 0x9759
-0x4046 = 0x6589
-0x4047 = 0x7A0E
-0x4048 = 0x8106
-0x4049 = 0x96BB
-0x404A = 0x5E2D
-0x404B = 0x60DC
-0x404C = 0x621A
-0x404D = 0x65A5
-0x404E = 0x6614
-0x404F = 0x6790
-0x4050 = 0x77F3
-0x4051 = 0x7A4D
-0x4052 = 0x7C4D
-0x4053 = 0x7E3E
-0x4054 = 0x810A
-0x4055 = 0x8CAC
-0x4056 = 0x8D64
-0x4057 = 0x8DE1
-0x4058 = 0x8E5F
-0x4059 = 0x78A9
-0x405A = 0x5207
-0x405B = 0x62D9
-0x405C = 0x63A5
-0x405D = 0x6442
-0x405E = 0x6298
-0x405F = 0x8A2D
-0x4060 = 0x7A83
-0x4061 = 0x7BC0
-0x4062 = 0x8AAC
-0x4063 = 0x96EA
-0x4064 = 0x7D76
-0x4065 = 0x820C
-0x4066 = 0x8749
-0x4067 = 0x4ED9
-0x4068 = 0x5148
-0x4069 = 0x5343
-0x406A = 0x5360
-0x406B = 0x5BA3
-0x406C = 0x5C02
-0x406D = 0x5C16
-0x406E = 0x5DDD
-0x406F = 0x6226
-0x4070 = 0x6247
-0x4071 = 0x64B0
-0x4072 = 0x6813
-0x4073 = 0x6834
-0x4074 = 0x6CC9
-0x4075 = 0x6D45
-0x4076 = 0x6D17
-0x4077 = 0x67D3
-0x4078 = 0x6F5C
-0x4079 = 0x714E
-0x407A = 0x717D
-0x407B = 0x65CB
-0x407C = 0x7A7F
-0x407D = 0x7BAD
-0x407E = 0x7DDA
-0x4121 = 0x7E4A
-0x4122 = 0x7FA8
-0x4123 = 0x817A
-0x4124 = 0x821B
-0x4125 = 0x8239
-0x4126 = 0x85A6
-0x4127 = 0x8A6E
-0x4128 = 0x8CCE
-0x4129 = 0x8DF5
-0x412A = 0x9078
-0x412B = 0x9077
-0x412C = 0x92AD
-0x412D = 0x9291
-0x412E = 0x9583
-0x412F = 0x9BAE
-0x4130 = 0x524D
-0x4131 = 0x5584
-0x4132 = 0x6F38
-0x4133 = 0x7136
-0x4134 = 0x5168
-0x4135 = 0x7985
-0x4136 = 0x7E55
-0x4137 = 0x81B3
-0x4138 = 0x7CCE
-0x4139 = 0x564C
-0x413A = 0x5851
-0x413B = 0x5CA8
-0x413C = 0x63AA
-0x413D = 0x66FE
-0x413E = 0x66FD
-0x413F = 0x695A
-0x4140 = 0x72D9
-0x4141 = 0x758F
-0x4142 = 0x758E
-0x4143 = 0x790E
-0x4144 = 0x7956
-0x4145 = 0x79DF
-0x4146 = 0x7C97
-0x4147 = 0x7D20
-0x4148 = 0x7D44
-0x4149 = 0x8607
-0x414A = 0x8A34
-0x414B = 0x963B
-0x414C = 0x9061
-0x414D = 0x9F20
-0x414E = 0x50E7
-0x414F = 0x5275
-0x4150 = 0x53CC
-0x4151 = 0x53E2
-0x4152 = 0x5009
-0x4153 = 0x55AA
-0x4154 = 0x58EE
-0x4155 = 0x594F
-0x4156 = 0x723D
-0x4157 = 0x5B8B
-0x4158 = 0x5C64
-0x4159 = 0x531D
-0x415A = 0x60E3
-0x415B = 0x60F3
-0x415C = 0x635C
-0x415D = 0x6383
-0x415E = 0x633F
-0x415F = 0x63BB
-0x4160 = 0x64CD
-0x4161 = 0x65E9
-0x4162 = 0x66F9
-0x4163 = 0x5DE3
-0x4164 = 0x69CD
-0x4165 = 0x69FD
-0x4166 = 0x6F15
-0x4167 = 0x71E5
-0x4168 = 0x4E89
-0x4169 = 0x75E9
-0x416A = 0x76F8
-0x416B = 0x7A93
-0x416C = 0x7CDF
-0x416D = 0x7DCF
-0x416E = 0x7D9C
-0x416F = 0x8061
-0x4170 = 0x8349
-0x4171 = 0x8358
-0x4172 = 0x846C
-0x4173 = 0x84BC
-0x4174 = 0x85FB
-0x4175 = 0x88C5
-0x4176 = 0x8D70
-0x4177 = 0x9001
-0x4178 = 0x906D
-0x4179 = 0x9397
-0x417A = 0x971C
-0x417B = 0x9A12
-0x417C = 0x50CF
-0x417D = 0x5897
-0x417E = 0x618E
-0x4221 = 0x81D3
-0x4222 = 0x8535
-0x4223 = 0x8D08
-0x4224 = 0x9020
-0x4225 = 0x4FC3
-0x4226 = 0x5074
-0x4227 = 0x5247
-0x4228 = 0x5373
-0x4229 = 0x606F
-0x422A = 0x6349
-0x422B = 0x675F
-0x422C = 0x6E2C
-0x422D = 0x8DB3
-0x422E = 0x901F
-0x422F = 0x4FD7
-0x4230 = 0x5C5E
-0x4231 = 0x8CCA
-0x4232 = 0x65CF
-0x4233 = 0x7D9A
-0x4234 = 0x5352
-0x4235 = 0x8896
-0x4236 = 0x5176
-0x4237 = 0x63C3
-0x4238 = 0x5B58
-0x4239 = 0x5B6B
-0x423A = 0x5C0A
-0x423B = 0x640D
-0x423C = 0x6751
-0x423D = 0x905C
-0x423E = 0x4ED6
-0x423F = 0x591A
-0x4240 = 0x592A
-0x4241 = 0x6C70
-0x4242 = 0x8A51
-0x4243 = 0x553E
-0x4244 = 0x5815
-0x4245 = 0x59A5
-0x4246 = 0x60F0
-0x4247 = 0x6253
-0x4248 = 0x67C1
-0x4249 = 0x8235
-0x424A = 0x6955
-0x424B = 0x9640
-0x424C = 0x99C4
-0x424D = 0x9A28
-0x424E = 0x4F53
-0x424F = 0x5806
-0x4250 = 0x5BFE
-0x4251 = 0x8010
-0x4252 = 0x5CB1
-0x4253 = 0x5E2F
-0x4254 = 0x5F85
-0x4255 = 0x6020
-0x4256 = 0x614B
-0x4257 = 0x6234
-0x4258 = 0x66FF
-0x4259 = 0x6CF0
-0x425A = 0x6EDE
-0x425B = 0x80CE
-0x425C = 0x817F
-0x425D = 0x82D4
-0x425E = 0x888B
-0x425F = 0x8CB8
-0x4260 = 0x9000
-0x4261 = 0x902E
-0x4262 = 0x968A
-0x4263 = 0x9EDB
-0x4264 = 0x9BDB
-0x4265 = 0x4EE3
-0x4266 = 0x53F0
-0x4267 = 0x5927
-0x4268 = 0x7B2C
-0x4269 = 0x918D
-0x426A = 0x984C
-0x426B = 0x9DF9
-0x426C = 0x6EDD
-0x426D = 0x7027
-0x426E = 0x5353
-0x426F = 0x5544
-0x4270 = 0x5B85
-0x4271 = 0x6258
-0x4272 = 0x629E
-0x4273 = 0x62D3
-0x4274 = 0x6CA2
-0x4275 = 0x6FEF
-0x4276 = 0x7422
-0x4277 = 0x8A17
-0x4278 = 0x9438
-0x4279 = 0x6FC1
-0x427A = 0x8AFE
-0x427B = 0x8338
-0x427C = 0x51E7
-0x427D = 0x86F8
-0x427E = 0x53EA
-0x4321 = 0x53E9
-0x4322 = 0x4F46
-0x4323 = 0x9054
-0x4324 = 0x8FB0
-0x4325 = 0x596A
-0x4326 = 0x8131
-0x4327 = 0x5DFD
-0x4328 = 0x7AEA
-0x4329 = 0x8FBF
-0x432A = 0x68DA
-0x432B = 0x8C37
-0x432C = 0x72F8
-0x432D = 0x9C48
-0x432E = 0x6A3D
-0x432F = 0x8AB0
-0x4330 = 0x4E39
-0x4331 = 0x5358
-0x4332 = 0x5606
-0x4333 = 0x5766
-0x4334 = 0x62C5
-0x4335 = 0x63A2
-0x4336 = 0x65E6
-0x4337 = 0x6B4E
-0x4338 = 0x6DE1
-0x4339 = 0x6E5B
-0x433A = 0x70AD
-0x433B = 0x77ED
-0x433C = 0x7AEF
-0x433D = 0x7BAA
-0x433E = 0x7DBB
-0x433F = 0x803D
-0x4340 = 0x80C6
-0x4341 = 0x86CB
-0x4342 = 0x8A95
-0x4343 = 0x935B
-0x4344 = 0x56E3
-0x4345 = 0x58C7
-0x4346 = 0x5F3E
-0x4347 = 0x65AD
-0x4348 = 0x6696
-0x4349 = 0x6A80
-0x434A = 0x6BB5
-0x434B = 0x7537
-0x434C = 0x8AC7
-0x434D = 0x5024
-0x434E = 0x77E5
-0x434F = 0x5730
-0x4350 = 0x5F1B
-0x4351 = 0x6065
-0x4352 = 0x667A
-0x4353 = 0x6C60
-0x4354 = 0x75F4
-0x4355 = 0x7A1A
-0x4356 = 0x7F6E
-0x4357 = 0x81F4
-0x4358 = 0x8718
-0x4359 = 0x9045
-0x435A = 0x99B3
-0x435B = 0x7BC9
-0x435C = 0x755C
-0x435D = 0x7AF9
-0x435E = 0x7B51
-0x435F = 0x84C4
-0x4360 = 0x9010
-0x4361 = 0x79E9
-0x4362 = 0x7A92
-0x4363 = 0x8336
-0x4364 = 0x5AE1
-0x4365 = 0x7740
-0x4366 = 0x4E2D
-0x4367 = 0x4EF2
-0x4368 = 0x5B99
-0x4369 = 0x5FE0
-0x436A = 0x62BD
-0x436B = 0x663C
-0x436C = 0x67F1
-0x436D = 0x6CE8
-0x436E = 0x866B
-0x436F = 0x8877
-0x4370 = 0x8A3B
-0x4371 = 0x914E
-0x4372 = 0x92F3
-0x4373 = 0x99D0
-0x4374 = 0x6A17
-0x4375 = 0x7026
-0x4376 = 0x732A
-0x4377 = 0x82E7
-0x4378 = 0x8457
-0x4379 = 0x8CAF
-0x437A = 0x4E01
-0x437B = 0x5146
-0x437C = 0x51CB
-0x437D = 0x558B
-0x437E = 0x5BF5
-0x4421 = 0x5E16
-0x4422 = 0x5E33
-0x4423 = 0x5E81
-0x4424 = 0x5F14
-0x4425 = 0x5F35
-0x4426 = 0x5F6B
-0x4427 = 0x5FB4
-0x4428 = 0x61F2
-0x4429 = 0x6311
-0x442A = 0x66A2
-0x442B = 0x671D
-0x442C = 0x6F6E
-0x442D = 0x7252
-0x442E = 0x753A
-0x442F = 0x773A
-0x4430 = 0x8074
-0x4431 = 0x8139
-0x4432 = 0x8178
-0x4433 = 0x8776
-0x4434 = 0x8ABF
-0x4435 = 0x8ADC
-0x4436 = 0x8D85
-0x4437 = 0x8DF3
-0x4438 = 0x929A
-0x4439 = 0x9577
-0x443A = 0x9802
-0x443B = 0x9CE5
-0x443C = 0x52C5
-0x443D = 0x6357
-0x443E = 0x76F4
-0x443F = 0x6715
-0x4440 = 0x6C88
-0x4441 = 0x73CD
-0x4442 = 0x8CC3
-0x4443 = 0x93AE
-0x4444 = 0x9673
-0x4445 = 0x6D25
-0x4446 = 0x589C
-0x4447 = 0x690E
-0x4448 = 0x69CC
-0x4449 = 0x8FFD
-0x444A = 0x939A
-0x444B = 0x75DB
-0x444C = 0x901A
-0x444D = 0x585A
-0x444E = 0x6802
-0x444F = 0x63B4
-0x4450 = 0x69FB
-0x4451 = 0x4F43
-0x4452 = 0x6F2C
-0x4453 = 0x67D8
-0x4454 = 0x8FBB
-0x4455 = 0x8526
-0x4456 = 0x7DB4
-0x4457 = 0x9354
-0x4458 = 0x693F
-0x4459 = 0x6F70
-0x445A = 0x576A
-0x445B = 0x58F7
-0x445C = 0x5B2C
-0x445D = 0x7D2C
-0x445E = 0x722A
-0x445F = 0x540A
-0x4460 = 0x91E3
-0x4461 = 0x9DB4
-0x4462 = 0x4EAD
-0x4463 = 0x4F4E
-0x4464 = 0x505C
-0x4465 = 0x5075
-0x4466 = 0x5243
-0x4467 = 0x8C9E
-0x4468 = 0x5448
-0x4469 = 0x5824
-0x446A = 0x5B9A
-0x446B = 0x5E1D
-0x446C = 0x5E95
-0x446D = 0x5EAD
-0x446E = 0x5EF7
-0x446F = 0x5F1F
-0x4470 = 0x608C
-0x4471 = 0x62B5
-0x4472 = 0x633A
-0x4473 = 0x63D0
-0x4474 = 0x68AF
-0x4475 = 0x6C40
-0x4476 = 0x7887
-0x4477 = 0x798E
-0x4478 = 0x7A0B
-0x4479 = 0x7DE0
-0x447A = 0x8247
-0x447B = 0x8A02
-0x447C = 0x8AE6
-0x447D = 0x8E44
-0x447E = 0x9013
-0x4521 = 0x90B8
-0x4522 = 0x912D
-0x4523 = 0x91D8
-0x4524 = 0x9F0E
-0x4525 = 0x6CE5
-0x4526 = 0x6458
-0x4527 = 0x64E2
-0x4528 = 0x6575
-0x4529 = 0x6EF4
-0x452A = 0x7684
-0x452B = 0x7B1B
-0x452C = 0x9069
-0x452D = 0x93D1
-0x452E = 0x6EBA
-0x452F = 0x54F2
-0x4530 = 0x5FB9
-0x4531 = 0x64A4
-0x4532 = 0x8F4D
-0x4533 = 0x8FED
-0x4534 = 0x9244
-0x4535 = 0x5178
-0x4536 = 0x586B
-0x4537 = 0x5929
-0x4538 = 0x5C55
-0x4539 = 0x5E97
-0x453A = 0x6DFB
-0x453B = 0x7E8F
-0x453C = 0x751C
-0x453D = 0x8CBC
-0x453E = 0x8EE2
-0x453F = 0x985B
-0x4540 = 0x70B9
-0x4541 = 0x4F1D
-0x4542 = 0x6BBF
-0x4543 = 0x6FB1
-0x4544 = 0x7530
-0x4545 = 0x96FB
-0x4546 = 0x514E
-0x4547 = 0x5410
-0x4548 = 0x5835
-0x4549 = 0x5857
-0x454A = 0x59AC
-0x454B = 0x5C60
-0x454C = 0x5F92
-0x454D = 0x6597
-0x454E = 0x675C
-0x454F = 0x6E21
-0x4550 = 0x767B
-0x4551 = 0x83DF
-0x4552 = 0x8CED
-0x4553 = 0x9014
-0x4554 = 0x90FD
-0x4555 = 0x934D
-0x4556 = 0x7825
-0x4557 = 0x783A
-0x4558 = 0x52AA
-0x4559 = 0x5EA6
-0x455A = 0x571F
-0x455B = 0x5974
-0x455C = 0x6012
-0x455D = 0x5012
-0x455E = 0x515A
-0x455F = 0x51AC
-0x4560 = 0x51CD
-0x4561 = 0x5200
-0x4562 = 0x5510
-0x4563 = 0x5854
-0x4564 = 0x5858
-0x4565 = 0x5957
-0x4566 = 0x5B95
-0x4567 = 0x5CF6
-0x4568 = 0x5D8B
-0x4569 = 0x60BC
-0x456A = 0x6295
-0x456B = 0x642D
-0x456C = 0x6771
-0x456D = 0x6843
-0x456E = 0x68BC
-0x456F = 0x68DF
-0x4570 = 0x76D7
-0x4571 = 0x6DD8
-0x4572 = 0x6E6F
-0x4573 = 0x6D9B
-0x4574 = 0x706F
-0x4575 = 0x71C8
-0x4576 = 0x5F53
-0x4577 = 0x75D8
-0x4578 = 0x7977
-0x4579 = 0x7B49
-0x457A = 0x7B54
-0x457B = 0x7B52
-0x457C = 0x7CD6
-0x457D = 0x7D71
-0x457E = 0x5230
-0x4621 = 0x8463
-0x4622 = 0x8569
-0x4623 = 0x85E4
-0x4624 = 0x8A0E
-0x4625 = 0x8B04
-0x4626 = 0x8C46
-0x4627 = 0x8E0F
-0x4628 = 0x9003
-0x4629 = 0x900F
-0x462A = 0x9419
-0x462B = 0x9676
-0x462C = 0x982D
-0x462D = 0x9A30
-0x462E = 0x95D8
-0x462F = 0x50CD
-0x4630 = 0x52D5
-0x4631 = 0x540C
-0x4632 = 0x5802
-0x4633 = 0x5C0E
-0x4634 = 0x61A7
-0x4635 = 0x649E
-0x4636 = 0x6D1E
-0x4637 = 0x77B3
-0x4638 = 0x7AE5
-0x4639 = 0x80F4
-0x463A = 0x8404
-0x463B = 0x9053
-0x463C = 0x9285
-0x463D = 0x5CE0
-0x463E = 0x9D07
-0x463F = 0x533F
-0x4640 = 0x5F97
-0x4641 = 0x5FB3
-0x4642 = 0x6D9C
-0x4643 = 0x7279
-0x4644 = 0x7763
-0x4645 = 0x79BF
-0x4646 = 0x7BE4
-0x4647 = 0x6BD2
-0x4648 = 0x72EC
-0x4649 = 0x8AAD
-0x464A = 0x6803
-0x464B = 0x6A61
-0x464C = 0x51F8
-0x464D = 0x7A81
-0x464E = 0x6934
-0x464F = 0x5C4A
-0x4650 = 0x9CF6
-0x4651 = 0x82EB
-0x4652 = 0x5BC5
-0x4653 = 0x9149
-0x4654 = 0x701E
-0x4655 = 0x5678
-0x4656 = 0x5C6F
-0x4657 = 0x60C7
-0x4658 = 0x6566
-0x4659 = 0x6C8C
-0x465A = 0x8C5A
-0x465B = 0x9041
-0x465C = 0x9813
-0x465D = 0x5451
-0x465E = 0x66C7
-0x465F = 0x920D
-0x4660 = 0x5948
-0x4661 = 0x90A3
-0x4662 = 0x5185
-0x4663 = 0x4E4D
-0x4664 = 0x51EA
-0x4665 = 0x8599
-0x4666 = 0x8B0E
-0x4667 = 0x7058
-0x4668 = 0x637A
-0x4669 = 0x934B
-0x466A = 0x6962
-0x466B = 0x99B4
-0x466C = 0x7E04
-0x466D = 0x7577
-0x466E = 0x5357
-0x466F = 0x6960
-0x4670 = 0x8EDF
-0x4671 = 0x96E3
-0x4672 = 0x6C5D
-0x4673 = 0x4E8C
-0x4674 = 0x5C3C
-0x4675 = 0x5F10
-0x4676 = 0x8FE9
-0x4677 = 0x5302
-0x4678 = 0x8CD1
-0x4679 = 0x8089
-0x467A = 0x8679
-0x467B = 0x5EFF
-0x467C = 0x65E5
-0x467D = 0x4E73
-0x467E = 0x5165
-0x4721 = 0x5982
-0x4722 = 0x5C3F
-0x4723 = 0x97EE
-0x4724 = 0x4EFB
-0x4725 = 0x598A
-0x4726 = 0x5FCD
-0x4727 = 0x8A8D
-0x4728 = 0x6FE1
-0x4729 = 0x79B0
-0x472A = 0x7962
-0x472B = 0x5BE7
-0x472C = 0x8471
-0x472D = 0x732B
-0x472E = 0x71B1
-0x472F = 0x5E74
-0x4730 = 0x5FF5
-0x4731 = 0x637B
-0x4732 = 0x649A
-0x4733 = 0x71C3
-0x4734 = 0x7C98
-0x4735 = 0x4E43
-0x4736 = 0x5EFC
-0x4737 = 0x4E4B
-0x4738 = 0x57DC
-0x4739 = 0x56A2
-0x473A = 0x60A9
-0x473B = 0x6FC3
-0x473C = 0x7D0D
-0x473D = 0x80FD
-0x473E = 0x8133
-0x473F = 0x81BF
-0x4740 = 0x8FB2
-0x4741 = 0x8997
-0x4742 = 0x86A4
-0x4743 = 0x5DF4
-0x4744 = 0x628A
-0x4745 = 0x64AD
-0x4746 = 0x8987
-0x4747 = 0x6777
-0x4748 = 0x6CE2
-0x4749 = 0x6D3E
-0x474A = 0x7436
-0x474B = 0x7834
-0x474C = 0x5A46
-0x474D = 0x7F75
-0x474E = 0x82AD
-0x474F = 0x99AC
-0x4750 = 0x4FF3
-0x4751 = 0x5EC3
-0x4752 = 0x62DD
-0x4753 = 0x6392
-0x4754 = 0x6557
-0x4755 = 0x676F
-0x4756 = 0x76C3
-0x4757 = 0x724C
-0x4758 = 0x80CC
-0x4759 = 0x80BA
-0x475A = 0x8F29
-0x475B = 0x914D
-0x475C = 0x500D
-0x475D = 0x57F9
-0x475E = 0x5A92
-0x475F = 0x6885
-0x4760 = 0x6973
-0x4761 = 0x7164
-0x4762 = 0x72FD
-0x4763 = 0x8CB7
-0x4764 = 0x58F2
-0x4765 = 0x8CE0
-0x4766 = 0x966A
-0x4767 = 0x9019
-0x4768 = 0x877F
-0x4769 = 0x79E4
-0x476A = 0x77E7
-0x476B = 0x8429
-0x476C = 0x4F2F
-0x476D = 0x5265
-0x476E = 0x535A
-0x476F = 0x62CD
-0x4770 = 0x67CF
-0x4771 = 0x6CCA
-0x4772 = 0x767D
-0x4773 = 0x7B94
-0x4774 = 0x7C95
-0x4775 = 0x8236
-0x4776 = 0x8584
-0x4777 = 0x8FEB
-0x4778 = 0x66DD
-0x4779 = 0x6F20
-0x477A = 0x7206
-0x477B = 0x7E1B
-0x477C = 0x83AB
-0x477D = 0x99C1
-0x477E = 0x9EA6
-0x4821 = 0x51FD
-0x4822 = 0x7BB1
-0x4823 = 0x7872
-0x4824 = 0x7BB8
-0x4825 = 0x8087
-0x4826 = 0x7B48
-0x4827 = 0x6AE8
-0x4828 = 0x5E61
-0x4829 = 0x808C
-0x482A = 0x7551
-0x482B = 0x7560
-0x482C = 0x516B
-0x482D = 0x9262
-0x482E = 0x6E8C
-0x482F = 0x767A
-0x4830 = 0x9197
-0x4831 = 0x9AEA
-0x4832 = 0x4F10
-0x4833 = 0x7F70
-0x4834 = 0x629C
-0x4835 = 0x7B4F
-0x4836 = 0x95A5
-0x4837 = 0x9CE9
-0x4838 = 0x567A
-0x4839 = 0x5859
-0x483A = 0x86E4
-0x483B = 0x96BC
-0x483C = 0x4F34
-0x483D = 0x5224
-0x483E = 0x534A
-0x483F = 0x53CD
-0x4840 = 0x53DB
-0x4841 = 0x5E06
-0x4842 = 0x642C
-0x4843 = 0x6591
-0x4844 = 0x677F
-0x4845 = 0x6C3E
-0x4846 = 0x6C4E
-0x4847 = 0x7248
-0x4848 = 0x72AF
-0x4849 = 0x73ED
-0x484A = 0x7554
-0x484B = 0x7E41
-0x484C = 0x822C
-0x484D = 0x85E9
-0x484E = 0x8CA9
-0x484F = 0x7BC4
-0x4850 = 0x91C6
-0x4851 = 0x7169
-0x4852 = 0x9812
-0x4853 = 0x98EF
-0x4854 = 0x633D
-0x4855 = 0x6669
-0x4856 = 0x756A
-0x4857 = 0x76E4
-0x4858 = 0x78D0
-0x4859 = 0x8543
-0x485A = 0x86EE
-0x485B = 0x532A
-0x485C = 0x5351
-0x485D = 0x5426
-0x485E = 0x5983
-0x485F = 0x5E87
-0x4860 = 0x5F7C
-0x4861 = 0x60B2
-0x4862 = 0x6249
-0x4863 = 0x6279
-0x4864 = 0x62AB
-0x4865 = 0x6590
-0x4866 = 0x6BD4
-0x4867 = 0x6CCC
-0x4868 = 0x75B2
-0x4869 = 0x76AE
-0x486A = 0x7891
-0x486B = 0x79D8
-0x486C = 0x7DCB
-0x486D = 0x7F77
-0x486E = 0x80A5
-0x486F = 0x88AB
-0x4870 = 0x8AB9
-0x4871 = 0x8CBB
-0x4872 = 0x907F
-0x4873 = 0x975E
-0x4874 = 0x98DB
-0x4875 = 0x6A0B
-0x4876 = 0x7C38
-0x4877 = 0x5099
-0x4878 = 0x5C3E
-0x4879 = 0x5FAE
-0x487A = 0x6787
-0x487B = 0x6BD8
-0x487C = 0x7435
-0x487D = 0x7709
-0x487E = 0x7F8E
-0x4921 = 0x9F3B
-0x4922 = 0x67CA
-0x4923 = 0x7A17
-0x4924 = 0x5339
-0x4925 = 0x758B
-0x4926 = 0x9AED
-0x4927 = 0x5F66
-0x4928 = 0x819D
-0x4929 = 0x83F1
-0x492A = 0x8098
-0x492B = 0x5F3C
-0x492C = 0x5FC5
-0x492D = 0x7562
-0x492E = 0x7B46
-0x492F = 0x903C
-0x4930 = 0x6867
-0x4931 = 0x59EB
-0x4932 = 0x5A9B
-0x4933 = 0x7D10
-0x4934 = 0x767E
-0x4935 = 0x8B2C
-0x4936 = 0x4FF5
-0x4937 = 0x5F6A
-0x4938 = 0x6A19
-0x4939 = 0x6C37
-0x493A = 0x6F02
-0x493B = 0x74E2
-0x493C = 0x7968
-0x493D = 0x8868
-0x493E = 0x8A55
-0x493F = 0x8C79
-0x4940 = 0x5EDF
-0x4941 = 0x63CF
-0x4942 = 0x75C5
-0x4943 = 0x79D2
-0x4944 = 0x82D7
-0x4945 = 0x9328
-0x4946 = 0x92F2
-0x4947 = 0x849C
-0x4948 = 0x86ED
-0x4949 = 0x9C2D
-0x494A = 0x54C1
-0x494B = 0x5F6C
-0x494C = 0x658C
-0x494D = 0x6D5C
-0x494E = 0x7015
-0x494F = 0x8CA7
-0x4950 = 0x8CD3
-0x4951 = 0x983B
-0x4952 = 0x654F
-0x4953 = 0x74F6
-0x4954 = 0x4E0D
-0x4955 = 0x4ED8
-0x4956 = 0x57E0
-0x4957 = 0x592B
-0x4958 = 0x5A66
-0x4959 = 0x5BCC
-0x495A = 0x51A8
-0x495B = 0x5E03
-0x495C = 0x5E9C
-0x495D = 0x6016
-0x495E = 0x6276
-0x495F = 0x6577
-0x4960 = 0x65A7
-0x4961 = 0x666E
-0x4962 = 0x6D6E
-0x4963 = 0x7236
-0x4964 = 0x7B26
-0x4965 = 0x8150
-0x4966 = 0x819A
-0x4967 = 0x8299
-0x4968 = 0x8B5C
-0x4969 = 0x8CA0
-0x496A = 0x8CE6
-0x496B = 0x8D74
-0x496C = 0x961C
-0x496D = 0x9644
-0x496E = 0x4FAE
-0x496F = 0x64AB
-0x4970 = 0x6B66
-0x4971 = 0x821E
-0x4972 = 0x8461
-0x4973 = 0x856A
-0x4974 = 0x90E8
-0x4975 = 0x5C01
-0x4976 = 0x6953
-0x4977 = 0x98A8
-0x4978 = 0x847A
-0x4979 = 0x8557
-0x497A = 0x4F0F
-0x497B = 0x526F
-0x497C = 0x5FA9
-0x497D = 0x5E45
-0x497E = 0x670D
-0x4A21 = 0x798F
-0x4A22 = 0x8179
-0x4A23 = 0x8907
-0x4A24 = 0x8986
-0x4A25 = 0x6DF5
-0x4A26 = 0x5F17
-0x4A27 = 0x6255
-0x4A28 = 0x6CB8
-0x4A29 = 0x4ECF
-0x4A2A = 0x7269
-0x4A2B = 0x9B92
-0x4A2C = 0x5206
-0x4A2D = 0x543B
-0x4A2E = 0x5674
-0x4A2F = 0x58B3
-0x4A30 = 0x61A4
-0x4A31 = 0x626E
-0x4A32 = 0x711A
-0x4A33 = 0x596E
-0x4A34 = 0x7C89
-0x4A35 = 0x7CDE
-0x4A36 = 0x7D1B
-0x4A37 = 0x96F0
-0x4A38 = 0x6587
-0x4A39 = 0x805E
-0x4A3A = 0x4E19
-0x4A3B = 0x4F75
-0x4A3C = 0x5175
-0x4A3D = 0x5840
-0x4A3E = 0x5E63
-0x4A3F = 0x5E73
-0x4A40 = 0x5F0A
-0x4A41 = 0x67C4
-0x4A42 = 0x4E26
-0x4A43 = 0x853D
-0x4A44 = 0x9589
-0x4A45 = 0x965B
-0x4A46 = 0x7C73
-0x4A47 = 0x9801
-0x4A48 = 0x50FB
-0x4A49 = 0x58C1
-0x4A4A = 0x7656
-0x4A4B = 0x78A7
-0x4A4C = 0x5225
-0x4A4D = 0x77A5
-0x4A4E = 0x8511
-0x4A4F = 0x7B86
-0x4A50 = 0x504F
-0x4A51 = 0x5909
-0x4A52 = 0x7247
-0x4A53 = 0x7BC7
-0x4A54 = 0x7DE8
-0x4A55 = 0x8FBA
-0x4A56 = 0x8FD4
-0x4A57 = 0x904D
-0x4A58 = 0x4FBF
-0x4A59 = 0x52C9
-0x4A5A = 0x5A29
-0x4A5B = 0x5F01
-0x4A5C = 0x97AD
-0x4A5D = 0x4FDD
-0x4A5E = 0x8217
-0x4A5F = 0x92EA
-0x4A60 = 0x5703
-0x4A61 = 0x6355
-0x4A62 = 0x6B69
-0x4A63 = 0x752B
-0x4A64 = 0x88DC
-0x4A65 = 0x8F14
-0x4A66 = 0x7A42
-0x4A67 = 0x52DF
-0x4A68 = 0x5893
-0x4A69 = 0x6155
-0x4A6A = 0x620A
-0x4A6B = 0x66AE
-0x4A6C = 0x6BCD
-0x4A6D = 0x7C3F
-0x4A6E = 0x83E9
-0x4A6F = 0x5023
-0x4A70 = 0x4FF8
-0x4A71 = 0x5305
-0x4A72 = 0x5446
-0x4A73 = 0x5831
-0x4A74 = 0x5949
-0x4A75 = 0x5B9D
-0x4A76 = 0x5CF0
-0x4A77 = 0x5CEF
-0x4A78 = 0x5D29
-0x4A79 = 0x5E96
-0x4A7A = 0x62B1
-0x4A7B = 0x6367
-0x4A7C = 0x653E
-0x4A7D = 0x65B9
-0x4A7E = 0x670B
-0x4B21 = 0x6CD5
-0x4B22 = 0x6CE1
-0x4B23 = 0x70F9
-0x4B24 = 0x7832
-0x4B25 = 0x7E2B
-0x4B26 = 0x80DE
-0x4B27 = 0x82B3
-0x4B28 = 0x840C
-0x4B29 = 0x84EC
-0x4B2A = 0x8702
-0x4B2B = 0x8912
-0x4B2C = 0x8A2A
-0x4B2D = 0x8C4A
-0x4B2E = 0x90A6
-0x4B2F = 0x92D2
-0x4B30 = 0x98FD
-0x4B31 = 0x9CF3
-0x4B32 = 0x9D6C
-0x4B33 = 0x4E4F
-0x4B34 = 0x4EA1
-0x4B35 = 0x508D
-0x4B36 = 0x5256
-0x4B37 = 0x574A
-0x4B38 = 0x59A8
-0x4B39 = 0x5E3D
-0x4B3A = 0x5FD8
-0x4B3B = 0x5FD9
-0x4B3C = 0x623F
-0x4B3D = 0x66B4
-0x4B3E = 0x671B
-0x4B3F = 0x67D0
-0x4B40 = 0x68D2
-0x4B41 = 0x5192
-0x4B42 = 0x7D21
-0x4B43 = 0x80AA
-0x4B44 = 0x81A8
-0x4B45 = 0x8B00
-0x4B46 = 0x8C8C
-0x4B47 = 0x8CBF
-0x4B48 = 0x927E
-0x4B49 = 0x9632
-0x4B4A = 0x5420
-0x4B4B = 0x982C
-0x4B4C = 0x5317
-0x4B4D = 0x50D5
-0x4B4E = 0x535C
-0x4B4F = 0x58A8
-0x4B50 = 0x64B2
-0x4B51 = 0x6734
-0x4B52 = 0x7267
-0x4B53 = 0x7766
-0x4B54 = 0x7A46
-0x4B55 = 0x91E6
-0x4B56 = 0x52C3
-0x4B57 = 0x6CA1
-0x4B58 = 0x6B86
-0x4B59 = 0x5800
-0x4B5A = 0x5E4C
-0x4B5B = 0x5954
-0x4B5C = 0x672C
-0x4B5D = 0x7FFB
-0x4B5E = 0x51E1
-0x4B5F = 0x76C6
-0x4B60 = 0x6469
-0x4B61 = 0x78E8
-0x4B62 = 0x9B54
-0x4B63 = 0x9EBB
-0x4B64 = 0x57CB
-0x4B65 = 0x59B9
-0x4B66 = 0x6627
-0x4B67 = 0x679A
-0x4B68 = 0x6BCE
-0x4B69 = 0x54E9
-0x4B6A = 0x69D9
-0x4B6B = 0x5E55
-0x4B6C = 0x819C
-0x4B6D = 0x6795
-0x4B6E = 0x9BAA
-0x4B6F = 0x67FE
-0x4B70 = 0x9C52
-0x4B71 = 0x685D
-0x4B72 = 0x4EA6
-0x4B73 = 0x4FE3
-0x4B74 = 0x53C8
-0x4B75 = 0x62B9
-0x4B76 = 0x672B
-0x4B77 = 0x6CAB
-0x4B78 = 0x8FC4
-0x4B79 = 0x4FAD
-0x4B7A = 0x7E6D
-0x4B7B = 0x9EBF
-0x4B7C = 0x4E07
-0x4B7D = 0x6162
-0x4B7E = 0x6E80
-0x4C21 = 0x6F2B
-0x4C22 = 0x8513
-0x4C23 = 0x5473
-0x4C24 = 0x672A
-0x4C25 = 0x9B45
-0x4C26 = 0x5DF3
-0x4C27 = 0x7B95
-0x4C28 = 0x5CAC
-0x4C29 = 0x5BC6
-0x4C2A = 0x871C
-0x4C2B = 0x6E4A
-0x4C2C = 0x84D1
-0x4C2D = 0x7A14
-0x4C2E = 0x8108
-0x4C2F = 0x5999
-0x4C30 = 0x7C8D
-0x4C31 = 0x6C11
-0x4C32 = 0x7720
-0x4C33 = 0x52D9
-0x4C34 = 0x5922
-0x4C35 = 0x7121
-0x4C36 = 0x725F
-0x4C37 = 0x77DB
-0x4C38 = 0x9727
-0x4C39 = 0x9D61
-0x4C3A = 0x690B
-0x4C3B = 0x5A7F
-0x4C3C = 0x5A18
-0x4C3D = 0x51A5
-0x4C3E = 0x540D
-0x4C3F = 0x547D
-0x4C40 = 0x660E
-0x4C41 = 0x76DF
-0x4C42 = 0x8FF7
-0x4C43 = 0x9298
-0x4C44 = 0x9CF4
-0x4C45 = 0x59EA
-0x4C46 = 0x725D
-0x4C47 = 0x6EC5
-0x4C48 = 0x514D
-0x4C49 = 0x68C9
-0x4C4A = 0x7DBF
-0x4C4B = 0x7DEC
-0x4C4C = 0x9762
-0x4C4D = 0x9EBA
-0x4C4E = 0x6478
-0x4C4F = 0x6A21
-0x4C50 = 0x8302
-0x4C51 = 0x5984
-0x4C52 = 0x5B5F
-0x4C53 = 0x6BDB
-0x4C54 = 0x731B
-0x4C55 = 0x76F2
-0x4C56 = 0x7DB2
-0x4C57 = 0x8017
-0x4C58 = 0x8499
-0x4C59 = 0x5132
-0x4C5A = 0x6728
-0x4C5B = 0x9ED9
-0x4C5C = 0x76EE
-0x4C5D = 0x6762
-0x4C5E = 0x52FF
-0x4C5F = 0x9905
-0x4C60 = 0x5C24
-0x4C61 = 0x623B
-0x4C62 = 0x7C7E
-0x4C63 = 0x8CB0
-0x4C64 = 0x554F
-0x4C65 = 0x60B6
-0x4C66 = 0x7D0B
-0x4C67 = 0x9580
-0x4C68 = 0x5301
-0x4C69 = 0x4E5F
-0x4C6A = 0x51B6
-0x4C6B = 0x591C
-0x4C6C = 0x723A
-0x4C6D = 0x8036
-0x4C6E = 0x91CE
-0x4C6F = 0x5F25
-0x4C70 = 0x77E2
-0x4C71 = 0x5384
-0x4C72 = 0x5F79
-0x4C73 = 0x7D04
-0x4C74 = 0x85AC
-0x4C75 = 0x8A33
-0x4C76 = 0x8E8D
-0x4C77 = 0x9756
-0x4C78 = 0x67F3
-0x4C79 = 0x85AE
-0x4C7A = 0x9453
-0x4C7B = 0x6109
-0x4C7C = 0x6108
-0x4C7D = 0x6CB9
-0x4C7E = 0x7652
-0x4D21 = 0x8AED
-0x4D22 = 0x8F38
-0x4D23 = 0x552F
-0x4D24 = 0x4F51
-0x4D25 = 0x512A
-0x4D26 = 0x52C7
-0x4D27 = 0x53CB
-0x4D28 = 0x5BA5
-0x4D29 = 0x5E7D
-0x4D2A = 0x60A0
-0x4D2B = 0x6182
-0x4D2C = 0x63D6
-0x4D2D = 0x6709
-0x4D2E = 0x67DA
-0x4D2F = 0x6E67
-0x4D30 = 0x6D8C
-0x4D31 = 0x7336
-0x4D32 = 0x7337
-0x4D33 = 0x7531
-0x4D34 = 0x7950
-0x4D35 = 0x88D5
-0x4D36 = 0x8A98
-0x4D37 = 0x904A
-0x4D38 = 0x9091
-0x4D39 = 0x90F5
-0x4D3A = 0x96C4
-0x4D3B = 0x878D
-0x4D3C = 0x5915
-0x4D3D = 0x4E88
-0x4D3E = 0x4F59
-0x4D3F = 0x4E0E
-0x4D40 = 0x8A89
-0x4D41 = 0x8F3F
-0x4D42 = 0x9810
-0x4D43 = 0x50AD
-0x4D44 = 0x5E7C
-0x4D45 = 0x5996
-0x4D46 = 0x5BB9
-0x4D47 = 0x5EB8
-0x4D48 = 0x63DA
-0x4D49 = 0x63FA
-0x4D4A = 0x64C1
-0x4D4B = 0x66DC
-0x4D4C = 0x694A
-0x4D4D = 0x69D8
-0x4D4E = 0x6D0B
-0x4D4F = 0x6EB6
-0x4D50 = 0x7194
-0x4D51 = 0x7528
-0x4D52 = 0x7AAF
-0x4D53 = 0x7F8A
-0x4D54 = 0x8000
-0x4D55 = 0x8449
-0x4D56 = 0x84C9
-0x4D57 = 0x8981
-0x4D58 = 0x8B21
-0x4D59 = 0x8E0A
-0x4D5A = 0x9065
-0x4D5B = 0x967D
-0x4D5C = 0x990A
-0x4D5D = 0x617E
-0x4D5E = 0x6291
-0x4D5F = 0x6B32
-0x4D60 = 0x6C83
-0x4D61 = 0x6D74
-0x4D62 = 0x7FCC
-0x4D63 = 0x7FFC
-0x4D64 = 0x6DC0
-0x4D65 = 0x7F85
-0x4D66 = 0x87BA
-0x4D67 = 0x88F8
-0x4D68 = 0x6765
-0x4D69 = 0x83B1
-0x4D6A = 0x983C
-0x4D6B = 0x96F7
-0x4D6C = 0x6D1B
-0x4D6D = 0x7D61
-0x4D6E = 0x843D
-0x4D6F = 0x916A
-0x4D70 = 0x4E71
-0x4D71 = 0x5375
-0x4D72 = 0x5D50
-0x4D73 = 0x6B04
-0x4D74 = 0x6FEB
-0x4D75 = 0x85CD
-0x4D76 = 0x862D
-0x4D77 = 0x89A7
-0x4D78 = 0x5229
-0x4D79 = 0x540F
-0x4D7A = 0x5C65
-0x4D7B = 0x674E
-0x4D7C = 0x68A8
-0x4D7D = 0x7406
-0x4D7E = 0x7483
-0x4E21 = 0x75E2
-0x4E22 = 0x88CF
-0x4E23 = 0x88E1
-0x4E24 = 0x91CC
-0x4E25 = 0x96E2
-0x4E26 = 0x9678
-0x4E27 = 0x5F8B
-0x4E28 = 0x7387
-0x4E29 = 0x7ACB
-0x4E2A = 0x844E
-0x4E2B = 0x63A0
-0x4E2C = 0x7565
-0x4E2D = 0x5289
-0x4E2E = 0x6D41
-0x4E2F = 0x6E9C
-0x4E30 = 0x7409
-0x4E31 = 0x7559
-0x4E32 = 0x786B
-0x4E33 = 0x7C92
-0x4E34 = 0x9686
-0x4E35 = 0x7ADC
-0x4E36 = 0x9F8D
-0x4E37 = 0x4FB6
-0x4E38 = 0x616E
-0x4E39 = 0x65C5
-0x4E3A = 0x865C
-0x4E3B = 0x4E86
-0x4E3C = 0x4EAE
-0x4E3D = 0x50DA
-0x4E3E = 0x4E21
-0x4E3F = 0x51CC
-0x4E40 = 0x5BEE
-0x4E41 = 0x6599
-0x4E42 = 0x6881
-0x4E43 = 0x6DBC
-0x4E44 = 0x731F
-0x4E45 = 0x7642
-0x4E46 = 0x77AD
-0x4E47 = 0x7A1C
-0x4E48 = 0x7CE7
-0x4E49 = 0x826F
-0x4E4A = 0x8AD2
-0x4E4B = 0x907C
-0x4E4C = 0x91CF
-0x4E4D = 0x9675
-0x4E4E = 0x9818
-0x4E4F = 0x529B
-0x4E50 = 0x7DD1
-0x4E51 = 0x502B
-0x4E52 = 0x5398
-0x4E53 = 0x6797
-0x4E54 = 0x6DCB
-0x4E55 = 0x71D0
-0x4E56 = 0x7433
-0x4E57 = 0x81E8
-0x4E58 = 0x8F2A
-0x4E59 = 0x96A3
-0x4E5A = 0x9C57
-0x4E5B = 0x9E9F
-0x4E5C = 0x7460
-0x4E5D = 0x5841
-0x4E5E = 0x6D99
-0x4E5F = 0x7D2F
-0x4E60 = 0x985E
-0x4E61 = 0x4EE4
-0x4E62 = 0x4F36
-0x4E63 = 0x4F8B
-0x4E64 = 0x51B7
-0x4E65 = 0x52B1
-0x4E66 = 0x5DBA
-0x4E67 = 0x601C
-0x4E68 = 0x73B2
-0x4E69 = 0x793C
-0x4E6A = 0x82D3
-0x4E6B = 0x9234
-0x4E6C = 0x96B7
-0x4E6D = 0x96F6
-0x4E6E = 0x970A
-0x4E6F = 0x9E97
-0x4E70 = 0x9F62
-0x4E71 = 0x66A6
-0x4E72 = 0x6B74
-0x4E73 = 0x5217
-0x4E74 = 0x52A3
-0x4E75 = 0x70C8
-0x4E76 = 0x88C2
-0x4E77 = 0x5EC9
-0x4E78 = 0x604B
-0x4E79 = 0x6190
-0x4E7A = 0x6F23
-0x4E7B = 0x7149
-0x4E7C = 0x7C3E
-0x4E7D = 0x7DF4
-0x4E7E = 0x806F
-0x4F21 = 0x84EE
-0x4F22 = 0x9023
-0x4F23 = 0x932C
-0x4F24 = 0x5442
-0x4F25 = 0x9B6F
-0x4F26 = 0x6AD3
-0x4F27 = 0x7089
-0x4F28 = 0x8CC2
-0x4F29 = 0x8DEF
-0x4F2A = 0x9732
-0x4F2B = 0x52B4
-0x4F2C = 0x5A41
-0x4F2D = 0x5ECA
-0x4F2E = 0x5F04
-0x4F2F = 0x6717
-0x4F30 = 0x697C
-0x4F31 = 0x6994
-0x4F32 = 0x6D6A
-0x4F33 = 0x6F0F
-0x4F34 = 0x7262
-0x4F35 = 0x72FC
-0x4F36 = 0x7BED
-0x4F37 = 0x8001
-0x4F38 = 0x807E
-0x4F39 = 0x874B
-0x4F3A = 0x90CE
-0x4F3B = 0x516D
-0x4F3C = 0x9E93
-0x4F3D = 0x7984
-0x4F3E = 0x808B
-0x4F3F = 0x9332
-0x4F40 = 0x8AD6
-0x4F41 = 0x502D
-0x4F42 = 0x548C
-0x4F43 = 0x8A71
-0x4F44 = 0x6B6A
-0x4F45 = 0x8CC4
-0x4F46 = 0x8107
-0x4F47 = 0x60D1
-0x4F48 = 0x67A0
-0x4F49 = 0x9DF2
-0x4F4A = 0x4E99
-0x4F4B = 0x4E98
-0x4F4C = 0x9C10
-0x4F4D = 0x8A6B
-0x4F4E = 0x85C1
-0x4F4F = 0x8568
-0x4F50 = 0x6900
-0x4F51 = 0x6E7E
-0x4F52 = 0x7897
-0x4F53 = 0x8155
-0x5021 = 0x5F0C
-0x5022 = 0x4E10
-0x5023 = 0x4E15
-0x5024 = 0x4E2A
-0x5025 = 0x4E31
-0x5026 = 0x4E36
-0x5027 = 0x4E3C
-0x5028 = 0x4E3F
-0x5029 = 0x4E42
-0x502A = 0x4E56
-0x502B = 0x4E58
-0x502C = 0x4E82
-0x502D = 0x4E85
-0x502E = 0x8C6B
-0x502F = 0x4E8A
-0x5030 = 0x8212
-0x5031 = 0x5F0D
-0x5032 = 0x4E8E
-0x5033 = 0x4E9E
-0x5034 = 0x4E9F
-0x5035 = 0x4EA0
-0x5036 = 0x4EA2
-0x5037 = 0x4EB0
-0x5038 = 0x4EB3
-0x5039 = 0x4EB6
-0x503A = 0x4ECE
-0x503B = 0x4ECD
-0x503C = 0x4EC4
-0x503D = 0x4EC6
-0x503E = 0x4EC2
-0x503F = 0x4ED7
-0x5040 = 0x4EDE
-0x5041 = 0x4EED
-0x5042 = 0x4EDF
-0x5043 = 0x4EF7
-0x5044 = 0x4F09
-0x5045 = 0x4F5A
-0x5046 = 0x4F30
-0x5047 = 0x4F5B
-0x5048 = 0x4F5D
-0x5049 = 0x4F57
-0x504A = 0x4F47
-0x504B = 0x4F76
-0x504C = 0x4F88
-0x504D = 0x4F8F
-0x504E = 0x4F98
-0x504F = 0x4F7B
-0x5050 = 0x4F69
-0x5051 = 0x4F70
-0x5052 = 0x4F91
-0x5053 = 0x4F6F
-0x5054 = 0x4F86
-0x5055 = 0x4F96
-0x5056 = 0x5118
-0x5057 = 0x4FD4
-0x5058 = 0x4FDF
-0x5059 = 0x4FCE
-0x505A = 0x4FD8
-0x505B = 0x4FDB
-0x505C = 0x4FD1
-0x505D = 0x4FDA
-0x505E = 0x4FD0
-0x505F = 0x4FE4
-0x5060 = 0x4FE5
-0x5061 = 0x501A
-0x5062 = 0x5028
-0x5063 = 0x5014
-0x5064 = 0x502A
-0x5065 = 0x5025
-0x5066 = 0x5005
-0x5067 = 0x4F1C
-0x5068 = 0x4FF6
-0x5069 = 0x5021
-0x506A = 0x5029
-0x506B = 0x502C
-0x506C = 0x4FFE
-0x506D = 0x4FEF
-0x506E = 0x5011
-0x506F = 0x5006
-0x5070 = 0x5043
-0x5071 = 0x5047
-0x5072 = 0x6703
-0x5073 = 0x5055
-0x5074 = 0x5050
-0x5075 = 0x5048
-0x5076 = 0x505A
-0x5077 = 0x5056
-0x5078 = 0x506C
-0x5079 = 0x5078
-0x507A = 0x5080
-0x507B = 0x509A
-0x507C = 0x5085
-0x507D = 0x50B4
-0x507E = 0x50B2
-0x5121 = 0x50C9
-0x5122 = 0x50CA
-0x5123 = 0x50B3
-0x5124 = 0x50C2
-0x5125 = 0x50D6
-0x5126 = 0x50DE
-0x5127 = 0x50E5
-0x5128 = 0x50ED
-0x5129 = 0x50E3
-0x512A = 0x50EE
-0x512B = 0x50F9
-0x512C = 0x50F5
-0x512D = 0x5109
-0x512E = 0x5101
-0x512F = 0x5102
-0x5130 = 0x5116
-0x5131 = 0x5115
-0x5132 = 0x5114
-0x5133 = 0x511A
-0x5134 = 0x5121
-0x5135 = 0x513A
-0x5136 = 0x5137
-0x5137 = 0x513C
-0x5138 = 0x513B
-0x5139 = 0x513F
-0x513A = 0x5140
-0x513B = 0x5152
-0x513C = 0x514C
-0x513D = 0x5154
-0x513E = 0x5162
-0x513F = 0x7AF8
-0x5140 = 0x5169
-0x5141 = 0x516A
-0x5142 = 0x516E
-0x5143 = 0x5180
-0x5144 = 0x5182
-0x5145 = 0x56D8
-0x5146 = 0x518C
-0x5147 = 0x5189
-0x5148 = 0x518F
-0x5149 = 0x5191
-0x514A = 0x5193
-0x514B = 0x5195
-0x514C = 0x5196
-0x514D = 0x51A4
-0x514E = 0x51A6
-0x514F = 0x51A2
-0x5150 = 0x51A9
-0x5151 = 0x51AA
-0x5152 = 0x51AB
-0x5153 = 0x51B3
-0x5154 = 0x51B1
-0x5155 = 0x51B2
-0x5156 = 0x51B0
-0x5157 = 0x51B5
-0x5158 = 0x51BD
-0x5159 = 0x51C5
-0x515A = 0x51C9
-0x515B = 0x51DB
-0x515C = 0x51E0
-0x515D = 0x8655
-0x515E = 0x51E9
-0x515F = 0x51ED
-0x5160 = 0x51F0
-0x5161 = 0x51F5
-0x5162 = 0x51FE
-0x5163 = 0x5204
-0x5164 = 0x520B
-0x5165 = 0x5214
-0x5166 = 0x520E
-0x5167 = 0x5227
-0x5168 = 0x522A
-0x5169 = 0x522E
-0x516A = 0x5233
-0x516B = 0x5239
-0x516C = 0x524F
-0x516D = 0x5244
-0x516E = 0x524B
-0x516F = 0x524C
-0x5170 = 0x525E
-0x5171 = 0x5254
-0x5172 = 0x526A
-0x5173 = 0x5274
-0x5174 = 0x5269
-0x5175 = 0x5273
-0x5176 = 0x527F
-0x5177 = 0x527D
-0x5178 = 0x528D
-0x5179 = 0x5294
-0x517A = 0x5292
-0x517B = 0x5271
-0x517C = 0x5288
-0x517D = 0x5291
-0x517E = 0x8FA8
-0x5221 = 0x8FA7
-0x5222 = 0x52AC
-0x5223 = 0x52AD
-0x5224 = 0x52BC
-0x5225 = 0x52B5
-0x5226 = 0x52C1
-0x5227 = 0x52CD
-0x5228 = 0x52D7
-0x5229 = 0x52DE
-0x522A = 0x52E3
-0x522B = 0x52E6
-0x522C = 0x98ED
-0x522D = 0x52E0
-0x522E = 0x52F3
-0x522F = 0x52F5
-0x5230 = 0x52F8
-0x5231 = 0x52F9
-0x5232 = 0x5306
-0x5233 = 0x5308
-0x5234 = 0x7538
-0x5235 = 0x530D
-0x5236 = 0x5310
-0x5237 = 0x530F
-0x5238 = 0x5315
-0x5239 = 0x531A
-0x523A = 0x5323
-0x523B = 0x532F
-0x523C = 0x5331
-0x523D = 0x5333
-0x523E = 0x5338
-0x523F = 0x5340
-0x5240 = 0x5346
-0x5241 = 0x5345
-0x5242 = 0x4E17
-0x5243 = 0x5349
-0x5244 = 0x534D
-0x5245 = 0x51D6
-0x5246 = 0x535E
-0x5247 = 0x5369
-0x5248 = 0x536E
-0x5249 = 0x5918
-0x524A = 0x537B
-0x524B = 0x5377
-0x524C = 0x5382
-0x524D = 0x5396
-0x524E = 0x53A0
-0x524F = 0x53A6
-0x5250 = 0x53A5
-0x5251 = 0x53AE
-0x5252 = 0x53B0
-0x5253 = 0x53B6
-0x5254 = 0x53C3
-0x5255 = 0x7C12
-0x5256 = 0x96D9
-0x5257 = 0x53DF
-0x5258 = 0x66FC
-0x5259 = 0x71EE
-0x525A = 0x53EE
-0x525B = 0x53E8
-0x525C = 0x53ED
-0x525D = 0x53FA
-0x525E = 0x5401
-0x525F = 0x543D
-0x5260 = 0x5440
-0x5261 = 0x542C
-0x5262 = 0x542D
-0x5263 = 0x543C
-0x5264 = 0x542E
-0x5265 = 0x5436
-0x5266 = 0x5429
-0x5267 = 0x541D
-0x5268 = 0x544E
-0x5269 = 0x548F
-0x526A = 0x5475
-0x526B = 0x548E
-0x526C = 0x545F
-0x526D = 0x5471
-0x526E = 0x5477
-0x526F = 0x5470
-0x5270 = 0x5492
-0x5271 = 0x547B
-0x5272 = 0x5480
-0x5273 = 0x5476
-0x5274 = 0x5484
-0x5275 = 0x5490
-0x5276 = 0x5486
-0x5277 = 0x54C7
-0x5278 = 0x54A2
-0x5279 = 0x54B8
-0x527A = 0x54A5
-0x527B = 0x54AC
-0x527C = 0x54C4
-0x527D = 0x54C8
-0x527E = 0x54A8
-0x5321 = 0x54AB
-0x5322 = 0x54C2
-0x5323 = 0x54A4
-0x5324 = 0x54BE
-0x5325 = 0x54BC
-0x5326 = 0x54D8
-0x5327 = 0x54E5
-0x5328 = 0x54E6
-0x5329 = 0x550F
-0x532A = 0x5514
-0x532B = 0x54FD
-0x532C = 0x54EE
-0x532D = 0x54ED
-0x532E = 0x54FA
-0x532F = 0x54E2
-0x5330 = 0x5539
-0x5331 = 0x5540
-0x5332 = 0x5563
-0x5333 = 0x554C
-0x5334 = 0x552E
-0x5335 = 0x555C
-0x5336 = 0x5545
-0x5337 = 0x5556
-0x5338 = 0x5557
-0x5339 = 0x5538
-0x533A = 0x5533
-0x533B = 0x555D
-0x533C = 0x5599
-0x533D = 0x5580
-0x533E = 0x54AF
-0x533F = 0x558A
-0x5340 = 0x559F
-0x5341 = 0x557B
-0x5342 = 0x557E
-0x5343 = 0x5598
-0x5344 = 0x559E
-0x5345 = 0x55AE
-0x5346 = 0x557C
-0x5347 = 0x5583
-0x5348 = 0x55A9
-0x5349 = 0x5587
-0x534A = 0x55A8
-0x534B = 0x55DA
-0x534C = 0x55C5
-0x534D = 0x55DF
-0x534E = 0x55C4
-0x534F = 0x55DC
-0x5350 = 0x55E4
-0x5351 = 0x55D4
-0x5352 = 0x5614
-0x5353 = 0x55F7
-0x5354 = 0x5616
-0x5355 = 0x55FE
-0x5356 = 0x55FD
-0x5357 = 0x561B
-0x5358 = 0x55F9
-0x5359 = 0x564E
-0x535A = 0x5650
-0x535B = 0x71DF
-0x535C = 0x5634
-0x535D = 0x5636
-0x535E = 0x5632
-0x535F = 0x5638
-0x5360 = 0x566B
-0x5361 = 0x5664
-0x5362 = 0x562F
-0x5363 = 0x566C
-0x5364 = 0x566A
-0x5365 = 0x5686
-0x5366 = 0x5680
-0x5367 = 0x568A
-0x5368 = 0x56A0
-0x5369 = 0x5694
-0x536A = 0x568F
-0x536B = 0x56A5
-0x536C = 0x56AE
-0x536D = 0x56B6
-0x536E = 0x56B4
-0x536F = 0x56C2
-0x5370 = 0x56BC
-0x5371 = 0x56C1
-0x5372 = 0x56C3
-0x5373 = 0x56C0
-0x5374 = 0x56C8
-0x5375 = 0x56CE
-0x5376 = 0x56D1
-0x5377 = 0x56D3
-0x5378 = 0x56D7
-0x5379 = 0x56EE
-0x537A = 0x56F9
-0x537B = 0x5700
-0x537C = 0x56FF
-0x537D = 0x5704
-0x537E = 0x5709
-0x5421 = 0x5708
-0x5422 = 0x570B
-0x5423 = 0x570D
-0x5424 = 0x5713
-0x5425 = 0x5718
-0x5426 = 0x5716
-0x5427 = 0x55C7
-0x5428 = 0x571C
-0x5429 = 0x5726
-0x542A = 0x5737
-0x542B = 0x5738
-0x542C = 0x574E
-0x542D = 0x573B
-0x542E = 0x5740
-0x542F = 0x574F
-0x5430 = 0x5769
-0x5431 = 0x57C0
-0x5432 = 0x5788
-0x5433 = 0x5761
-0x5434 = 0x577F
-0x5435 = 0x5789
-0x5436 = 0x5793
-0x5437 = 0x57A0
-0x5438 = 0x57B3
-0x5439 = 0x57A4
-0x543A = 0x57AA
-0x543B = 0x57B0
-0x543C = 0x57C3
-0x543D = 0x57C6
-0x543E = 0x57D4
-0x543F = 0x57D2
-0x5440 = 0x57D3
-0x5441 = 0x580A
-0x5442 = 0x57D6
-0x5443 = 0x57E3
-0x5444 = 0x580B
-0x5445 = 0x5819
-0x5446 = 0x581D
-0x5447 = 0x5872
-0x5448 = 0x5821
-0x5449 = 0x5862
-0x544A = 0x584B
-0x544B = 0x5870
-0x544C = 0x6BC0
-0x544D = 0x5852
-0x544E = 0x583D
-0x544F = 0x5879
-0x5450 = 0x5885
-0x5451 = 0x58B9
-0x5452 = 0x589F
-0x5453 = 0x58AB
-0x5454 = 0x58BA
-0x5455 = 0x58DE
-0x5456 = 0x58BB
-0x5457 = 0x58B8
-0x5458 = 0x58AE
-0x5459 = 0x58C5
-0x545A = 0x58D3
-0x545B = 0x58D1
-0x545C = 0x58D7
-0x545D = 0x58D9
-0x545E = 0x58D8
-0x545F = 0x58E5
-0x5460 = 0x58DC
-0x5461 = 0x58E4
-0x5462 = 0x58DF
-0x5463 = 0x58EF
-0x5464 = 0x58FA
-0x5465 = 0x58F9
-0x5466 = 0x58FB
-0x5467 = 0x58FC
-0x5468 = 0x58FD
-0x5469 = 0x5902
-0x546A = 0x590A
-0x546B = 0x5910
-0x546C = 0x591B
-0x546D = 0x68A6
-0x546E = 0x5925
-0x546F = 0x592C
-0x5470 = 0x592D
-0x5471 = 0x5932
-0x5472 = 0x5938
-0x5473 = 0x593E
-0x5474 = 0x7AD2
-0x5475 = 0x5955
-0x5476 = 0x5950
-0x5477 = 0x594E
-0x5478 = 0x595A
-0x5479 = 0x5958
-0x547A = 0x5962
-0x547B = 0x5960
-0x547C = 0x5967
-0x547D = 0x596C
-0x547E = 0x5969
-0x5521 = 0x5978
-0x5522 = 0x5981
-0x5523 = 0x599D
-0x5524 = 0x4F5E
-0x5525 = 0x4FAB
-0x5526 = 0x59A3
-0x5527 = 0x59B2
-0x5528 = 0x59C6
-0x5529 = 0x59E8
-0x552A = 0x59DC
-0x552B = 0x598D
-0x552C = 0x59D9
-0x552D = 0x59DA
-0x552E = 0x5A25
-0x552F = 0x5A1F
-0x5530 = 0x5A11
-0x5531 = 0x5A1C
-0x5532 = 0x5A09
-0x5533 = 0x5A1A
-0x5534 = 0x5A40
-0x5535 = 0x5A6C
-0x5536 = 0x5A49
-0x5537 = 0x5A35
-0x5538 = 0x5A36
-0x5539 = 0x5A62
-0x553A = 0x5A6A
-0x553B = 0x5A9A
-0x553C = 0x5ABC
-0x553D = 0x5ABE
-0x553E = 0x5ACB
-0x553F = 0x5AC2
-0x5540 = 0x5ABD
-0x5541 = 0x5AE3
-0x5542 = 0x5AD7
-0x5543 = 0x5AE6
-0x5544 = 0x5AE9
-0x5545 = 0x5AD6
-0x5546 = 0x5AFA
-0x5547 = 0x5AFB
-0x5548 = 0x5B0C
-0x5549 = 0x5B0B
-0x554A = 0x5B16
-0x554B = 0x5B32
-0x554C = 0x5AD0
-0x554D = 0x5B2A
-0x554E = 0x5B36
-0x554F = 0x5B3E
-0x5550 = 0x5B43
-0x5551 = 0x5B45
-0x5552 = 0x5B40
-0x5553 = 0x5B51
-0x5554 = 0x5B55
-0x5555 = 0x5B5A
-0x5556 = 0x5B5B
-0x5557 = 0x5B65
-0x5558 = 0x5B69
-0x5559 = 0x5B70
-0x555A = 0x5B73
-0x555B = 0x5B75
-0x555C = 0x5B78
-0x555D = 0x6588
-0x555E = 0x5B7A
-0x555F = 0x5B80
-0x5560 = 0x5B83
-0x5561 = 0x5BA6
-0x5562 = 0x5BB8
-0x5563 = 0x5BC3
-0x5564 = 0x5BC7
-0x5565 = 0x5BC9
-0x5566 = 0x5BD4
-0x5567 = 0x5BD0
-0x5568 = 0x5BE4
-0x5569 = 0x5BE6
-0x556A = 0x5BE2
-0x556B = 0x5BDE
-0x556C = 0x5BE5
-0x556D = 0x5BEB
-0x556E = 0x5BF0
-0x556F = 0x5BF6
-0x5570 = 0x5BF3
-0x5571 = 0x5C05
-0x5572 = 0x5C07
-0x5573 = 0x5C08
-0x5574 = 0x5C0D
-0x5575 = 0x5C13
-0x5576 = 0x5C20
-0x5577 = 0x5C22
-0x5578 = 0x5C28
-0x5579 = 0x5C38
-0x557A = 0x5C39
-0x557B = 0x5C41
-0x557C = 0x5C46
-0x557D = 0x5C4E
-0x557E = 0x5C53
-0x5621 = 0x5C50
-0x5622 = 0x5C4F
-0x5623 = 0x5B71
-0x5624 = 0x5C6C
-0x5625 = 0x5C6E
-0x5626 = 0x4E62
-0x5627 = 0x5C76
-0x5628 = 0x5C79
-0x5629 = 0x5C8C
-0x562A = 0x5C91
-0x562B = 0x5C94
-0x562C = 0x599B
-0x562D = 0x5CAB
-0x562E = 0x5CBB
-0x562F = 0x5CB6
-0x5630 = 0x5CBC
-0x5631 = 0x5CB7
-0x5632 = 0x5CC5
-0x5633 = 0x5CBE
-0x5634 = 0x5CC7
-0x5635 = 0x5CD9
-0x5636 = 0x5CE9
-0x5637 = 0x5CFD
-0x5638 = 0x5CFA
-0x5639 = 0x5CED
-0x563A = 0x5D8C
-0x563B = 0x5CEA
-0x563C = 0x5D0B
-0x563D = 0x5D15
-0x563E = 0x5D17
-0x563F = 0x5D5C
-0x5640 = 0x5D1F
-0x5641 = 0x5D1B
-0x5642 = 0x5D11
-0x5643 = 0x5D14
-0x5644 = 0x5D22
-0x5645 = 0x5D1A
-0x5646 = 0x5D19
-0x5647 = 0x5D18
-0x5648 = 0x5D4C
-0x5649 = 0x5D52
-0x564A = 0x5D4E
-0x564B = 0x5D4B
-0x564C = 0x5D6C
-0x564D = 0x5D73
-0x564E = 0x5D76
-0x564F = 0x5D87
-0x5650 = 0x5D84
-0x5651 = 0x5D82
-0x5652 = 0x5DA2
-0x5653 = 0x5D9D
-0x5654 = 0x5DAC
-0x5655 = 0x5DAE
-0x5656 = 0x5DBD
-0x5657 = 0x5D90
-0x5658 = 0x5DB7
-0x5659 = 0x5DBC
-0x565A = 0x5DC9
-0x565B = 0x5DCD
-0x565C = 0x5DD3
-0x565D = 0x5DD2
-0x565E = 0x5DD6
-0x565F = 0x5DDB
-0x5660 = 0x5DEB
-0x5661 = 0x5DF2
-0x5662 = 0x5DF5
-0x5663 = 0x5E0B
-0x5664 = 0x5E1A
-0x5665 = 0x5E19
-0x5666 = 0x5E11
-0x5667 = 0x5E1B
-0x5668 = 0x5E36
-0x5669 = 0x5E37
-0x566A = 0x5E44
-0x566B = 0x5E43
-0x566C = 0x5E40
-0x566D = 0x5E4E
-0x566E = 0x5E57
-0x566F = 0x5E54
-0x5670 = 0x5E5F
-0x5671 = 0x5E62
-0x5672 = 0x5E64
-0x5673 = 0x5E47
-0x5674 = 0x5E75
-0x5675 = 0x5E76
-0x5676 = 0x5E7A
-0x5677 = 0x9EBC
-0x5678 = 0x5E7F
-0x5679 = 0x5EA0
-0x567A = 0x5EC1
-0x567B = 0x5EC2
-0x567C = 0x5EC8
-0x567D = 0x5ED0
-0x567E = 0x5ECF
-0x5721 = 0x5ED6
-0x5722 = 0x5EE3
-0x5723 = 0x5EDD
-0x5724 = 0x5EDA
-0x5725 = 0x5EDB
-0x5726 = 0x5EE2
-0x5727 = 0x5EE1
-0x5728 = 0x5EE8
-0x5729 = 0x5EE9
-0x572A = 0x5EEC
-0x572B = 0x5EF1
-0x572C = 0x5EF3
-0x572D = 0x5EF0
-0x572E = 0x5EF4
-0x572F = 0x5EF8
-0x5730 = 0x5EFE
-0x5731 = 0x5F03
-0x5732 = 0x5F09
-0x5733 = 0x5F5D
-0x5734 = 0x5F5C
-0x5735 = 0x5F0B
-0x5736 = 0x5F11
-0x5737 = 0x5F16
-0x5738 = 0x5F29
-0x5739 = 0x5F2D
-0x573A = 0x5F38
-0x573B = 0x5F41
-0x573C = 0x5F48
-0x573D = 0x5F4C
-0x573E = 0x5F4E
-0x573F = 0x5F2F
-0x5740 = 0x5F51
-0x5741 = 0x5F56
-0x5742 = 0x5F57
-0x5743 = 0x5F59
-0x5744 = 0x5F61
-0x5745 = 0x5F6D
-0x5746 = 0x5F73
-0x5747 = 0x5F77
-0x5748 = 0x5F83
-0x5749 = 0x5F82
-0x574A = 0x5F7F
-0x574B = 0x5F8A
-0x574C = 0x5F88
-0x574D = 0x5F91
-0x574E = 0x5F87
-0x574F = 0x5F9E
-0x5750 = 0x5F99
-0x5751 = 0x5F98
-0x5752 = 0x5FA0
-0x5753 = 0x5FA8
-0x5754 = 0x5FAD
-0x5755 = 0x5FBC
-0x5756 = 0x5FD6
-0x5757 = 0x5FFB
-0x5758 = 0x5FE4
-0x5759 = 0x5FF8
-0x575A = 0x5FF1
-0x575B = 0x5FDD
-0x575C = 0x60B3
-0x575D = 0x5FFF
-0x575E = 0x6021
-0x575F = 0x6060
-0x5760 = 0x6019
-0x5761 = 0x6010
-0x5762 = 0x6029
-0x5763 = 0x600E
-0x5764 = 0x6031
-0x5765 = 0x601B
-0x5766 = 0x6015
-0x5767 = 0x602B
-0x5768 = 0x6026
-0x5769 = 0x600F
-0x576A = 0x603A
-0x576B = 0x605A
-0x576C = 0x6041
-0x576D = 0x606A
-0x576E = 0x6077
-0x576F = 0x605F
-0x5770 = 0x604A
-0x5771 = 0x6046
-0x5772 = 0x604D
-0x5773 = 0x6063
-0x5774 = 0x6043
-0x5775 = 0x6064
-0x5776 = 0x6042
-0x5777 = 0x606C
-0x5778 = 0x606B
-0x5779 = 0x6059
-0x577A = 0x6081
-0x577B = 0x608D
-0x577C = 0x60E7
-0x577D = 0x6083
-0x577E = 0x609A
-0x5821 = 0x6084
-0x5822 = 0x609B
-0x5823 = 0x6096
-0x5824 = 0x6097
-0x5825 = 0x6092
-0x5826 = 0x60A7
-0x5827 = 0x608B
-0x5828 = 0x60E1
-0x5829 = 0x60B8
-0x582A = 0x60E0
-0x582B = 0x60D3
-0x582C = 0x60B4
-0x582D = 0x5FF0
-0x582E = 0x60BD
-0x582F = 0x60C6
-0x5830 = 0x60B5
-0x5831 = 0x60D8
-0x5832 = 0x614D
-0x5833 = 0x6115
-0x5834 = 0x6106
-0x5835 = 0x60F6
-0x5836 = 0x60F7
-0x5837 = 0x6100
-0x5838 = 0x60F4
-0x5839 = 0x60FA
-0x583A = 0x6103
-0x583B = 0x6121
-0x583C = 0x60FB
-0x583D = 0x60F1
-0x583E = 0x610D
-0x583F = 0x610E
-0x5840 = 0x6147
-0x5841 = 0x613E
-0x5842 = 0x6128
-0x5843 = 0x6127
-0x5844 = 0x614A
-0x5845 = 0x613F
-0x5846 = 0x613C
-0x5847 = 0x612C
-0x5848 = 0x6134
-0x5849 = 0x613D
-0x584A = 0x6142
-0x584B = 0x6144
-0x584C = 0x6173
-0x584D = 0x6177
-0x584E = 0x6158
-0x584F = 0x6159
-0x5850 = 0x615A
-0x5851 = 0x616B
-0x5852 = 0x6174
-0x5853 = 0x616F
-0x5854 = 0x6165
-0x5855 = 0x6171
-0x5856 = 0x615F
-0x5857 = 0x615D
-0x5858 = 0x6153
-0x5859 = 0x6175
-0x585A = 0x6199
-0x585B = 0x6196
-0x585C = 0x6187
-0x585D = 0x61AC
-0x585E = 0x6194
-0x585F = 0x619A
-0x5860 = 0x618A
-0x5861 = 0x6191
-0x5862 = 0x61AB
-0x5863 = 0x61AE
-0x5864 = 0x61CC
-0x5865 = 0x61CA
-0x5866 = 0x61C9
-0x5867 = 0x61F7
-0x5868 = 0x61C8
-0x5869 = 0x61C3
-0x586A = 0x61C6
-0x586B = 0x61BA
-0x586C = 0x61CB
-0x586D = 0x7F79
-0x586E = 0x61CD
-0x586F = 0x61E6
-0x5870 = 0x61E3
-0x5871 = 0x61F6
-0x5872 = 0x61FA
-0x5873 = 0x61F4
-0x5874 = 0x61FF
-0x5875 = 0x61FD
-0x5876 = 0x61FC
-0x5877 = 0x61FE
-0x5878 = 0x6200
-0x5879 = 0x6208
-0x587A = 0x6209
-0x587B = 0x620D
-0x587C = 0x620C
-0x587D = 0x6214
-0x587E = 0x621B
-0x5921 = 0x621E
-0x5922 = 0x6221
-0x5923 = 0x622A
-0x5924 = 0x622E
-0x5925 = 0x6230
-0x5926 = 0x6232
-0x5927 = 0x6233
-0x5928 = 0x6241
-0x5929 = 0x624E
-0x592A = 0x625E
-0x592B = 0x6263
-0x592C = 0x625B
-0x592D = 0x6260
-0x592E = 0x6268
-0x592F = 0x627C
-0x5930 = 0x6282
-0x5931 = 0x6289
-0x5932 = 0x627E
-0x5933 = 0x6292
-0x5934 = 0x6293
-0x5935 = 0x6296
-0x5936 = 0x62D4
-0x5937 = 0x6283
-0x5938 = 0x6294
-0x5939 = 0x62D7
-0x593A = 0x62D1
-0x593B = 0x62BB
-0x593C = 0x62CF
-0x593D = 0x62FF
-0x593E = 0x62C6
-0x593F = 0x64D4
-0x5940 = 0x62C8
-0x5941 = 0x62DC
-0x5942 = 0x62CC
-0x5943 = 0x62CA
-0x5944 = 0x62C2
-0x5945 = 0x62C7
-0x5946 = 0x629B
-0x5947 = 0x62C9
-0x5948 = 0x630C
-0x5949 = 0x62EE
-0x594A = 0x62F1
-0x594B = 0x6327
-0x594C = 0x6302
-0x594D = 0x6308
-0x594E = 0x62EF
-0x594F = 0x62F5
-0x5950 = 0x6350
-0x5951 = 0x633E
-0x5952 = 0x634D
-0x5953 = 0x641C
-0x5954 = 0x634F
-0x5955 = 0x6396
-0x5956 = 0x638E
-0x5957 = 0x6380
-0x5958 = 0x63AB
-0x5959 = 0x6376
-0x595A = 0x63A3
-0x595B = 0x638F
-0x595C = 0x6389
-0x595D = 0x639F
-0x595E = 0x63B5
-0x595F = 0x636B
-0x5960 = 0x6369
-0x5961 = 0x63BE
-0x5962 = 0x63E9
-0x5963 = 0x63C0
-0x5964 = 0x63C6
-0x5965 = 0x63E3
-0x5966 = 0x63C9
-0x5967 = 0x63D2
-0x5968 = 0x63F6
-0x5969 = 0x63C4
-0x596A = 0x6416
-0x596B = 0x6434
-0x596C = 0x6406
-0x596D = 0x6413
-0x596E = 0x6426
-0x596F = 0x6436
-0x5970 = 0x651D
-0x5971 = 0x6417
-0x5972 = 0x6428
-0x5973 = 0x640F
-0x5974 = 0x6467
-0x5975 = 0x646F
-0x5976 = 0x6476
-0x5977 = 0x644E
-0x5978 = 0x652A
-0x5979 = 0x6495
-0x597A = 0x6493
-0x597B = 0x64A5
-0x597C = 0x64A9
-0x597D = 0x6488
-0x597E = 0x64BC
-0x5A21 = 0x64DA
-0x5A22 = 0x64D2
-0x5A23 = 0x64C5
-0x5A24 = 0x64C7
-0x5A25 = 0x64BB
-0x5A26 = 0x64D8
-0x5A27 = 0x64C2
-0x5A28 = 0x64F1
-0x5A29 = 0x64E7
-0x5A2A = 0x8209
-0x5A2B = 0x64E0
-0x5A2C = 0x64E1
-0x5A2D = 0x62AC
-0x5A2E = 0x64E3
-0x5A2F = 0x64EF
-0x5A30 = 0x652C
-0x5A31 = 0x64F6
-0x5A32 = 0x64F4
-0x5A33 = 0x64F2
-0x5A34 = 0x64FA
-0x5A35 = 0x6500
-0x5A36 = 0x64FD
-0x5A37 = 0x6518
-0x5A38 = 0x651C
-0x5A39 = 0x6505
-0x5A3A = 0x6524
-0x5A3B = 0x6523
-0x5A3C = 0x652B
-0x5A3D = 0x6534
-0x5A3E = 0x6535
-0x5A3F = 0x6537
-0x5A40 = 0x6536
-0x5A41 = 0x6538
-0x5A42 = 0x754B
-0x5A43 = 0x6548
-0x5A44 = 0x6556
-0x5A45 = 0x6555
-0x5A46 = 0x654D
-0x5A47 = 0x6558
-0x5A48 = 0x655E
-0x5A49 = 0x655D
-0x5A4A = 0x6572
-0x5A4B = 0x6578
-0x5A4C = 0x6582
-0x5A4D = 0x6583
-0x5A4E = 0x8B8A
-0x5A4F = 0x659B
-0x5A50 = 0x659F
-0x5A51 = 0x65AB
-0x5A52 = 0x65B7
-0x5A53 = 0x65C3
-0x5A54 = 0x65C6
-0x5A55 = 0x65C1
-0x5A56 = 0x65C4
-0x5A57 = 0x65CC
-0x5A58 = 0x65D2
-0x5A59 = 0x65DB
-0x5A5A = 0x65D9
-0x5A5B = 0x65E0
-0x5A5C = 0x65E1
-0x5A5D = 0x65F1
-0x5A5E = 0x6772
-0x5A5F = 0x660A
-0x5A60 = 0x6603
-0x5A61 = 0x65FB
-0x5A62 = 0x6773
-0x5A63 = 0x6635
-0x5A64 = 0x6636
-0x5A65 = 0x6634
-0x5A66 = 0x661C
-0x5A67 = 0x664F
-0x5A68 = 0x6644
-0x5A69 = 0x6649
-0x5A6A = 0x6641
-0x5A6B = 0x665E
-0x5A6C = 0x665D
-0x5A6D = 0x6664
-0x5A6E = 0x6667
-0x5A6F = 0x6668
-0x5A70 = 0x665F
-0x5A71 = 0x6662
-0x5A72 = 0x6670
-0x5A73 = 0x6683
-0x5A74 = 0x6688
-0x5A75 = 0x668E
-0x5A76 = 0x6689
-0x5A77 = 0x6684
-0x5A78 = 0x6698
-0x5A79 = 0x669D
-0x5A7A = 0x66C1
-0x5A7B = 0x66B9
-0x5A7C = 0x66C9
-0x5A7D = 0x66BE
-0x5A7E = 0x66BC
-0x5B21 = 0x66C4
-0x5B22 = 0x66B8
-0x5B23 = 0x66D6
-0x5B24 = 0x66DA
-0x5B25 = 0x66E0
-0x5B26 = 0x663F
-0x5B27 = 0x66E6
-0x5B28 = 0x66E9
-0x5B29 = 0x66F0
-0x5B2A = 0x66F5
-0x5B2B = 0x66F7
-0x5B2C = 0x670F
-0x5B2D = 0x6716
-0x5B2E = 0x671E
-0x5B2F = 0x6726
-0x5B30 = 0x6727
-0x5B31 = 0x9738
-0x5B32 = 0x672E
-0x5B33 = 0x673F
-0x5B34 = 0x6736
-0x5B35 = 0x6741
-0x5B36 = 0x6738
-0x5B37 = 0x6737
-0x5B38 = 0x6746
-0x5B39 = 0x675E
-0x5B3A = 0x6760
-0x5B3B = 0x6759
-0x5B3C = 0x6763
-0x5B3D = 0x6764
-0x5B3E = 0x6789
-0x5B3F = 0x6770
-0x5B40 = 0x67A9
-0x5B41 = 0x677C
-0x5B42 = 0x676A
-0x5B43 = 0x678C
-0x5B44 = 0x678B
-0x5B45 = 0x67A6
-0x5B46 = 0x67A1
-0x5B47 = 0x6785
-0x5B48 = 0x67B7
-0x5B49 = 0x67EF
-0x5B4A = 0x67B4
-0x5B4B = 0x67EC
-0x5B4C = 0x67B3
-0x5B4D = 0x67E9
-0x5B4E = 0x67B8
-0x5B4F = 0x67E4
-0x5B50 = 0x67DE
-0x5B51 = 0x67DD
-0x5B52 = 0x67E2
-0x5B53 = 0x67EE
-0x5B54 = 0x67B9
-0x5B55 = 0x67CE
-0x5B56 = 0x67C6
-0x5B57 = 0x67E7
-0x5B58 = 0x6A9C
-0x5B59 = 0x681E
-0x5B5A = 0x6846
-0x5B5B = 0x6829
-0x5B5C = 0x6840
-0x5B5D = 0x684D
-0x5B5E = 0x6832
-0x5B5F = 0x684E
-0x5B60 = 0x68B3
-0x5B61 = 0x682B
-0x5B62 = 0x6859
-0x5B63 = 0x6863
-0x5B64 = 0x6877
-0x5B65 = 0x687F
-0x5B66 = 0x689F
-0x5B67 = 0x688F
-0x5B68 = 0x68AD
-0x5B69 = 0x6894
-0x5B6A = 0x689D
-0x5B6B = 0x689B
-0x5B6C = 0x6883
-0x5B6D = 0x6AAE
-0x5B6E = 0x68B9
-0x5B6F = 0x6874
-0x5B70 = 0x68B5
-0x5B71 = 0x68A0
-0x5B72 = 0x68BA
-0x5B73 = 0x690F
-0x5B74 = 0x688D
-0x5B75 = 0x687E
-0x5B76 = 0x6901
-0x5B77 = 0x68CA
-0x5B78 = 0x6908
-0x5B79 = 0x68D8
-0x5B7A = 0x6922
-0x5B7B = 0x6926
-0x5B7C = 0x68E1
-0x5B7D = 0x690C
-0x5B7E = 0x68CD
-0x5C21 = 0x68D4
-0x5C22 = 0x68E7
-0x5C23 = 0x68D5
-0x5C24 = 0x6936
-0x5C25 = 0x6912
-0x5C26 = 0x6904
-0x5C27 = 0x68D7
-0x5C28 = 0x68E3
-0x5C29 = 0x6925
-0x5C2A = 0x68F9
-0x5C2B = 0x68E0
-0x5C2C = 0x68EF
-0x5C2D = 0x6928
-0x5C2E = 0x692A
-0x5C2F = 0x691A
-0x5C30 = 0x6923
-0x5C31 = 0x6921
-0x5C32 = 0x68C6
-0x5C33 = 0x6979
-0x5C34 = 0x6977
-0x5C35 = 0x695C
-0x5C36 = 0x6978
-0x5C37 = 0x696B
-0x5C38 = 0x6954
-0x5C39 = 0x697E
-0x5C3A = 0x696E
-0x5C3B = 0x6939
-0x5C3C = 0x6974
-0x5C3D = 0x693D
-0x5C3E = 0x6959
-0x5C3F = 0x6930
-0x5C40 = 0x6961
-0x5C41 = 0x695E
-0x5C42 = 0x695D
-0x5C43 = 0x6981
-0x5C44 = 0x696A
-0x5C45 = 0x69B2
-0x5C46 = 0x69AE
-0x5C47 = 0x69D0
-0x5C48 = 0x69BF
-0x5C49 = 0x69C1
-0x5C4A = 0x69D3
-0x5C4B = 0x69BE
-0x5C4C = 0x69CE
-0x5C4D = 0x5BE8
-0x5C4E = 0x69CA
-0x5C4F = 0x69DD
-0x5C50 = 0x69BB
-0x5C51 = 0x69C3
-0x5C52 = 0x69A7
-0x5C53 = 0x6A2E
-0x5C54 = 0x6991
-0x5C55 = 0x69A0
-0x5C56 = 0x699C
-0x5C57 = 0x6995
-0x5C58 = 0x69B4
-0x5C59 = 0x69DE
-0x5C5A = 0x69E8
-0x5C5B = 0x6A02
-0x5C5C = 0x6A1B
-0x5C5D = 0x69FF
-0x5C5E = 0x6B0A
-0x5C5F = 0x69F9
-0x5C60 = 0x69F2
-0x5C61 = 0x69E7
-0x5C62 = 0x6A05
-0x5C63 = 0x69B1
-0x5C64 = 0x6A1E
-0x5C65 = 0x69ED
-0x5C66 = 0x6A14
-0x5C67 = 0x69EB
-0x5C68 = 0x6A0A
-0x5C69 = 0x6A12
-0x5C6A = 0x6AC1
-0x5C6B = 0x6A23
-0x5C6C = 0x6A13
-0x5C6D = 0x6A44
-0x5C6E = 0x6A0C
-0x5C6F = 0x6A72
-0x5C70 = 0x6A36
-0x5C71 = 0x6A78
-0x5C72 = 0x6A47
-0x5C73 = 0x6A62
-0x5C74 = 0x6A59
-0x5C75 = 0x6A66
-0x5C76 = 0x6A48
-0x5C77 = 0x6A38
-0x5C78 = 0x6A22
-0x5C79 = 0x6A90
-0x5C7A = 0x6A8D
-0x5C7B = 0x6AA0
-0x5C7C = 0x6A84
-0x5C7D = 0x6AA2
-0x5C7E = 0x6AA3
-0x5D21 = 0x6A97
-0x5D22 = 0x8617
-0x5D23 = 0x6ABB
-0x5D24 = 0x6AC3
-0x5D25 = 0x6AC2
-0x5D26 = 0x6AB8
-0x5D27 = 0x6AB3
-0x5D28 = 0x6AAC
-0x5D29 = 0x6ADE
-0x5D2A = 0x6AD1
-0x5D2B = 0x6ADF
-0x5D2C = 0x6AAA
-0x5D2D = 0x6ADA
-0x5D2E = 0x6AEA
-0x5D2F = 0x6AFB
-0x5D30 = 0x6B05
-0x5D31 = 0x8616
-0x5D32 = 0x6AFA
-0x5D33 = 0x6B12
-0x5D34 = 0x6B16
-0x5D35 = 0x9B31
-0x5D36 = 0x6B1F
-0x5D37 = 0x6B38
-0x5D38 = 0x6B37
-0x5D39 = 0x76DC
-0x5D3A = 0x6B39
-0x5D3B = 0x98EE
-0x5D3C = 0x6B47
-0x5D3D = 0x6B43
-0x5D3E = 0x6B49
-0x5D3F = 0x6B50
-0x5D40 = 0x6B59
-0x5D41 = 0x6B54
-0x5D42 = 0x6B5B
-0x5D43 = 0x6B5F
-0x5D44 = 0x6B61
-0x5D45 = 0x6B78
-0x5D46 = 0x6B79
-0x5D47 = 0x6B7F
-0x5D48 = 0x6B80
-0x5D49 = 0x6B84
-0x5D4A = 0x6B83
-0x5D4B = 0x6B8D
-0x5D4C = 0x6B98
-0x5D4D = 0x6B95
-0x5D4E = 0x6B9E
-0x5D4F = 0x6BA4
-0x5D50 = 0x6BAA
-0x5D51 = 0x6BAB
-0x5D52 = 0x6BAF
-0x5D53 = 0x6BB2
-0x5D54 = 0x6BB1
-0x5D55 = 0x6BB3
-0x5D56 = 0x6BB7
-0x5D57 = 0x6BBC
-0x5D58 = 0x6BC6
-0x5D59 = 0x6BCB
-0x5D5A = 0x6BD3
-0x5D5B = 0x6BDF
-0x5D5C = 0x6BEC
-0x5D5D = 0x6BEB
-0x5D5E = 0x6BF3
-0x5D5F = 0x6BEF
-0x5D60 = 0x9EBE
-0x5D61 = 0x6C08
-0x5D62 = 0x6C13
-0x5D63 = 0x6C14
-0x5D64 = 0x6C1B
-0x5D65 = 0x6C24
-0x5D66 = 0x6C23
-0x5D67 = 0x6C5E
-0x5D68 = 0x6C55
-0x5D69 = 0x6C62
-0x5D6A = 0x6C6A
-0x5D6B = 0x6C82
-0x5D6C = 0x6C8D
-0x5D6D = 0x6C9A
-0x5D6E = 0x6C81
-0x5D6F = 0x6C9B
-0x5D70 = 0x6C7E
-0x5D71 = 0x6C68
-0x5D72 = 0x6C73
-0x5D73 = 0x6C92
-0x5D74 = 0x6C90
-0x5D75 = 0x6CC4
-0x5D76 = 0x6CF1
-0x5D77 = 0x6CD3
-0x5D78 = 0x6CBD
-0x5D79 = 0x6CD7
-0x5D7A = 0x6CC5
-0x5D7B = 0x6CDD
-0x5D7C = 0x6CAE
-0x5D7D = 0x6CB1
-0x5D7E = 0x6CBE
-0x5E21 = 0x6CBA
-0x5E22 = 0x6CDB
-0x5E23 = 0x6CEF
-0x5E24 = 0x6CD9
-0x5E25 = 0x6CEA
-0x5E26 = 0x6D1F
-0x5E27 = 0x884D
-0x5E28 = 0x6D36
-0x5E29 = 0x6D2B
-0x5E2A = 0x6D3D
-0x5E2B = 0x6D38
-0x5E2C = 0x6D19
-0x5E2D = 0x6D35
-0x5E2E = 0x6D33
-0x5E2F = 0x6D12
-0x5E30 = 0x6D0C
-0x5E31 = 0x6D63
-0x5E32 = 0x6D93
-0x5E33 = 0x6D64
-0x5E34 = 0x6D5A
-0x5E35 = 0x6D79
-0x5E36 = 0x6D59
-0x5E37 = 0x6D8E
-0x5E38 = 0x6D95
-0x5E39 = 0x6FE4
-0x5E3A = 0x6D85
-0x5E3B = 0x6DF9
-0x5E3C = 0x6E15
-0x5E3D = 0x6E0A
-0x5E3E = 0x6DB5
-0x5E3F = 0x6DC7
-0x5E40 = 0x6DE6
-0x5E41 = 0x6DB8
-0x5E42 = 0x6DC6
-0x5E43 = 0x6DEC
-0x5E44 = 0x6DDE
-0x5E45 = 0x6DCC
-0x5E46 = 0x6DE8
-0x5E47 = 0x6DD2
-0x5E48 = 0x6DC5
-0x5E49 = 0x6DFA
-0x5E4A = 0x6DD9
-0x5E4B = 0x6DE4
-0x5E4C = 0x6DD5
-0x5E4D = 0x6DEA
-0x5E4E = 0x6DEE
-0x5E4F = 0x6E2D
-0x5E50 = 0x6E6E
-0x5E51 = 0x6E2E
-0x5E52 = 0x6E19
-0x5E53 = 0x6E72
-0x5E54 = 0x6E5F
-0x5E55 = 0x6E3E
-0x5E56 = 0x6E23
-0x5E57 = 0x6E6B
-0x5E58 = 0x6E2B
-0x5E59 = 0x6E76
-0x5E5A = 0x6E4D
-0x5E5B = 0x6E1F
-0x5E5C = 0x6E43
-0x5E5D = 0x6E3A
-0x5E5E = 0x6E4E
-0x5E5F = 0x6E24
-0x5E60 = 0x6EFF
-0x5E61 = 0x6E1D
-0x5E62 = 0x6E38
-0x5E63 = 0x6E82
-0x5E64 = 0x6EAA
-0x5E65 = 0x6E98
-0x5E66 = 0x6EC9
-0x5E67 = 0x6EB7
-0x5E68 = 0x6ED3
-0x5E69 = 0x6EBD
-0x5E6A = 0x6EAF
-0x5E6B = 0x6EC4
-0x5E6C = 0x6EB2
-0x5E6D = 0x6ED4
-0x5E6E = 0x6ED5
-0x5E6F = 0x6E8F
-0x5E70 = 0x6EA5
-0x5E71 = 0x6EC2
-0x5E72 = 0x6E9F
-0x5E73 = 0x6F41
-0x5E74 = 0x6F11
-0x5E75 = 0x704C
-0x5E76 = 0x6EEC
-0x5E77 = 0x6EF8
-0x5E78 = 0x6EFE
-0x5E79 = 0x6F3F
-0x5E7A = 0x6EF2
-0x5E7B = 0x6F31
-0x5E7C = 0x6EEF
-0x5E7D = 0x6F32
-0x5E7E = 0x6ECC
-0x5F21 = 0x6F3E
-0x5F22 = 0x6F13
-0x5F23 = 0x6EF7
-0x5F24 = 0x6F86
-0x5F25 = 0x6F7A
-0x5F26 = 0x6F78
-0x5F27 = 0x6F81
-0x5F28 = 0x6F80
-0x5F29 = 0x6F6F
-0x5F2A = 0x6F5B
-0x5F2B = 0x6FF3
-0x5F2C = 0x6F6D
-0x5F2D = 0x6F82
-0x5F2E = 0x6F7C
-0x5F2F = 0x6F58
-0x5F30 = 0x6F8E
-0x5F31 = 0x6F91
-0x5F32 = 0x6FC2
-0x5F33 = 0x6F66
-0x5F34 = 0x6FB3
-0x5F35 = 0x6FA3
-0x5F36 = 0x6FA1
-0x5F37 = 0x6FA4
-0x5F38 = 0x6FB9
-0x5F39 = 0x6FC6
-0x5F3A = 0x6FAA
-0x5F3B = 0x6FDF
-0x5F3C = 0x6FD5
-0x5F3D = 0x6FEC
-0x5F3E = 0x6FD4
-0x5F3F = 0x6FD8
-0x5F40 = 0x6FF1
-0x5F41 = 0x6FEE
-0x5F42 = 0x6FDB
-0x5F43 = 0x7009
-0x5F44 = 0x700B
-0x5F45 = 0x6FFA
-0x5F46 = 0x7011
-0x5F47 = 0x7001
-0x5F48 = 0x700F
-0x5F49 = 0x6FFE
-0x5F4A = 0x701B
-0x5F4B = 0x701A
-0x5F4C = 0x6F74
-0x5F4D = 0x701D
-0x5F4E = 0x7018
-0x5F4F = 0x701F
-0x5F50 = 0x7030
-0x5F51 = 0x703E
-0x5F52 = 0x7032
-0x5F53 = 0x7051
-0x5F54 = 0x7063
-0x5F55 = 0x7099
-0x5F56 = 0x7092
-0x5F57 = 0x70AF
-0x5F58 = 0x70F1
-0x5F59 = 0x70AC
-0x5F5A = 0x70B8
-0x5F5B = 0x70B3
-0x5F5C = 0x70AE
-0x5F5D = 0x70DF
-0x5F5E = 0x70CB
-0x5F5F = 0x70DD
-0x5F60 = 0x70D9
-0x5F61 = 0x7109
-0x5F62 = 0x70FD
-0x5F63 = 0x711C
-0x5F64 = 0x7119
-0x5F65 = 0x7165
-0x5F66 = 0x7155
-0x5F67 = 0x7188
-0x5F68 = 0x7166
-0x5F69 = 0x7162
-0x5F6A = 0x714C
-0x5F6B = 0x7156
-0x5F6C = 0x716C
-0x5F6D = 0x718F
-0x5F6E = 0x71FB
-0x5F6F = 0x7184
-0x5F70 = 0x7195
-0x5F71 = 0x71A8
-0x5F72 = 0x71AC
-0x5F73 = 0x71D7
-0x5F74 = 0x71B9
-0x5F75 = 0x71BE
-0x5F76 = 0x71D2
-0x5F77 = 0x71C9
-0x5F78 = 0x71D4
-0x5F79 = 0x71CE
-0x5F7A = 0x71E0
-0x5F7B = 0x71EC
-0x5F7C = 0x71E7
-0x5F7D = 0x71F5
-0x5F7E = 0x71FC
-0x6021 = 0x71F9
-0x6022 = 0x71FF
-0x6023 = 0x720D
-0x6024 = 0x7210
-0x6025 = 0x721B
-0x6026 = 0x7228
-0x6027 = 0x722D
-0x6028 = 0x722C
-0x6029 = 0x7230
-0x602A = 0x7232
-0x602B = 0x723B
-0x602C = 0x723C
-0x602D = 0x723F
-0x602E = 0x7240
-0x602F = 0x7246
-0x6030 = 0x724B
-0x6031 = 0x7258
-0x6032 = 0x7274
-0x6033 = 0x727E
-0x6034 = 0x7282
-0x6035 = 0x7281
-0x6036 = 0x7287
-0x6037 = 0x7292
-0x6038 = 0x7296
-0x6039 = 0x72A2
-0x603A = 0x72A7
-0x603B = 0x72B9
-0x603C = 0x72B2
-0x603D = 0x72C3
-0x603E = 0x72C6
-0x603F = 0x72C4
-0x6040 = 0x72CE
-0x6041 = 0x72D2
-0x6042 = 0x72E2
-0x6043 = 0x72E0
-0x6044 = 0x72E1
-0x6045 = 0x72F9
-0x6046 = 0x72F7
-0x6047 = 0x500F
-0x6048 = 0x7317
-0x6049 = 0x730A
-0x604A = 0x731C
-0x604B = 0x7316
-0x604C = 0x731D
-0x604D = 0x7334
-0x604E = 0x732F
-0x604F = 0x7329
-0x6050 = 0x7325
-0x6051 = 0x733E
-0x6052 = 0x734E
-0x6053 = 0x734F
-0x6054 = 0x9ED8
-0x6055 = 0x7357
-0x6056 = 0x736A
-0x6057 = 0x7368
-0x6058 = 0x7370
-0x6059 = 0x7378
-0x605A = 0x7375
-0x605B = 0x737B
-0x605C = 0x737A
-0x605D = 0x73C8
-0x605E = 0x73B3
-0x605F = 0x73CE
-0x6060 = 0x73BB
-0x6061 = 0x73C0
-0x6062 = 0x73E5
-0x6063 = 0x73EE
-0x6064 = 0x73DE
-0x6065 = 0x74A2
-0x6066 = 0x7405
-0x6067 = 0x746F
-0x6068 = 0x7425
-0x6069 = 0x73F8
-0x606A = 0x7432
-0x606B = 0x743A
-0x606C = 0x7455
-0x606D = 0x743F
-0x606E = 0x745F
-0x606F = 0x7459
-0x6070 = 0x7441
-0x6071 = 0x745C
-0x6072 = 0x7469
-0x6073 = 0x7470
-0x6074 = 0x7463
-0x6075 = 0x746A
-0x6076 = 0x7476
-0x6077 = 0x747E
-0x6078 = 0x748B
-0x6079 = 0x749E
-0x607A = 0x74A7
-0x607B = 0x74CA
-0x607C = 0x74CF
-0x607D = 0x74D4
-0x607E = 0x73F1
-0x6121 = 0x74E0
-0x6122 = 0x74E3
-0x6123 = 0x74E7
-0x6124 = 0x74E9
-0x6125 = 0x74EE
-0x6126 = 0x74F2
-0x6127 = 0x74F0
-0x6128 = 0x74F1
-0x6129 = 0x74F8
-0x612A = 0x74F7
-0x612B = 0x7504
-0x612C = 0x7503
-0x612D = 0x7505
-0x612E = 0x750C
-0x612F = 0x750E
-0x6130 = 0x750D
-0x6131 = 0x7515
-0x6132 = 0x7513
-0x6133 = 0x751E
-0x6134 = 0x7526
-0x6135 = 0x752C
-0x6136 = 0x753C
-0x6137 = 0x7544
-0x6138 = 0x754D
-0x6139 = 0x754A
-0x613A = 0x7549
-0x613B = 0x755B
-0x613C = 0x7546
-0x613D = 0x755A
-0x613E = 0x7569
-0x613F = 0x7564
-0x6140 = 0x7567
-0x6141 = 0x756B
-0x6142 = 0x756D
-0x6143 = 0x7578
-0x6144 = 0x7576
-0x6145 = 0x7586
-0x6146 = 0x7587
-0x6147 = 0x7574
-0x6148 = 0x758A
-0x6149 = 0x7589
-0x614A = 0x7582
-0x614B = 0x7594
-0x614C = 0x759A
-0x614D = 0x759D
-0x614E = 0x75A5
-0x614F = 0x75A3
-0x6150 = 0x75C2
-0x6151 = 0x75B3
-0x6152 = 0x75C3
-0x6153 = 0x75B5
-0x6154 = 0x75BD
-0x6155 = 0x75B8
-0x6156 = 0x75BC
-0x6157 = 0x75B1
-0x6158 = 0x75CD
-0x6159 = 0x75CA
-0x615A = 0x75D2
-0x615B = 0x75D9
-0x615C = 0x75E3
-0x615D = 0x75DE
-0x615E = 0x75FE
-0x615F = 0x75FF
-0x6160 = 0x75FC
-0x6161 = 0x7601
-0x6162 = 0x75F0
-0x6163 = 0x75FA
-0x6164 = 0x75F2
-0x6165 = 0x75F3
-0x6166 = 0x760B
-0x6167 = 0x760D
-0x6168 = 0x7609
-0x6169 = 0x761F
-0x616A = 0x7627
-0x616B = 0x7620
-0x616C = 0x7621
-0x616D = 0x7622
-0x616E = 0x7624
-0x616F = 0x7634
-0x6170 = 0x7630
-0x6171 = 0x763B
-0x6172 = 0x7647
-0x6173 = 0x7648
-0x6174 = 0x7646
-0x6175 = 0x765C
-0x6176 = 0x7658
-0x6177 = 0x7661
-0x6178 = 0x7662
-0x6179 = 0x7668
-0x617A = 0x7669
-0x617B = 0x766A
-0x617C = 0x7667
-0x617D = 0x766C
-0x617E = 0x7670
-0x6221 = 0x7672
-0x6222 = 0x7676
-0x6223 = 0x7678
-0x6224 = 0x767C
-0x6225 = 0x7680
-0x6226 = 0x7683
-0x6227 = 0x7688
-0x6228 = 0x768B
-0x6229 = 0x768E
-0x622A = 0x7696
-0x622B = 0x7693
-0x622C = 0x7699
-0x622D = 0x769A
-0x622E = 0x76B0
-0x622F = 0x76B4
-0x6230 = 0x76B8
-0x6231 = 0x76B9
-0x6232 = 0x76BA
-0x6233 = 0x76C2
-0x6234 = 0x76CD
-0x6235 = 0x76D6
-0x6236 = 0x76D2
-0x6237 = 0x76DE
-0x6238 = 0x76E1
-0x6239 = 0x76E5
-0x623A = 0x76E7
-0x623B = 0x76EA
-0x623C = 0x862F
-0x623D = 0x76FB
-0x623E = 0x7708
-0x623F = 0x7707
-0x6240 = 0x7704
-0x6241 = 0x7729
-0x6242 = 0x7724
-0x6243 = 0x771E
-0x6244 = 0x7725
-0x6245 = 0x7726
-0x6246 = 0x771B
-0x6247 = 0x7737
-0x6248 = 0x7738
-0x6249 = 0x7747
-0x624A = 0x775A
-0x624B = 0x7768
-0x624C = 0x776B
-0x624D = 0x775B
-0x624E = 0x7765
-0x624F = 0x777F
-0x6250 = 0x777E
-0x6251 = 0x7779
-0x6252 = 0x778E
-0x6253 = 0x778B
-0x6254 = 0x7791
-0x6255 = 0x77A0
-0x6256 = 0x779E
-0x6257 = 0x77B0
-0x6258 = 0x77B6
-0x6259 = 0x77B9
-0x625A = 0x77BF
-0x625B = 0x77BC
-0x625C = 0x77BD
-0x625D = 0x77BB
-0x625E = 0x77C7
-0x625F = 0x77CD
-0x6260 = 0x77D7
-0x6261 = 0x77DA
-0x6262 = 0x77DC
-0x6263 = 0x77E3
-0x6264 = 0x77EE
-0x6265 = 0x77FC
-0x6266 = 0x780C
-0x6267 = 0x7812
-0x6268 = 0x7926
-0x6269 = 0x7820
-0x626A = 0x792A
-0x626B = 0x7845
-0x626C = 0x788E
-0x626D = 0x7874
-0x626E = 0x7886
-0x626F = 0x787C
-0x6270 = 0x789A
-0x6271 = 0x788C
-0x6272 = 0x78A3
-0x6273 = 0x78B5
-0x6274 = 0x78AA
-0x6275 = 0x78AF
-0x6276 = 0x78D1
-0x6277 = 0x78C6
-0x6278 = 0x78CB
-0x6279 = 0x78D4
-0x627A = 0x78BE
-0x627B = 0x78BC
-0x627C = 0x78C5
-0x627D = 0x78CA
-0x627E = 0x78EC
-0x6321 = 0x78E7
-0x6322 = 0x78DA
-0x6323 = 0x78FD
-0x6324 = 0x78F4
-0x6325 = 0x7907
-0x6326 = 0x7912
-0x6327 = 0x7911
-0x6328 = 0x7919
-0x6329 = 0x792C
-0x632A = 0x792B
-0x632B = 0x7940
-0x632C = 0x7960
-0x632D = 0x7957
-0x632E = 0x795F
-0x632F = 0x795A
-0x6330 = 0x7955
-0x6331 = 0x7953
-0x6332 = 0x797A
-0x6333 = 0x797F
-0x6334 = 0x798A
-0x6335 = 0x799D
-0x6336 = 0x79A7
-0x6337 = 0x9F4B
-0x6338 = 0x79AA
-0x6339 = 0x79AE
-0x633A = 0x79B3
-0x633B = 0x79B9
-0x633C = 0x79BA
-0x633D = 0x79C9
-0x633E = 0x79D5
-0x633F = 0x79E7
-0x6340 = 0x79EC
-0x6341 = 0x79E1
-0x6342 = 0x79E3
-0x6343 = 0x7A08
-0x6344 = 0x7A0D
-0x6345 = 0x7A18
-0x6346 = 0x7A19
-0x6347 = 0x7A20
-0x6348 = 0x7A1F
-0x6349 = 0x7980
-0x634A = 0x7A31
-0x634B = 0x7A3B
-0x634C = 0x7A3E
-0x634D = 0x7A37
-0x634E = 0x7A43
-0x634F = 0x7A57
-0x6350 = 0x7A49
-0x6351 = 0x7A61
-0x6352 = 0x7A62
-0x6353 = 0x7A69
-0x6354 = 0x9F9D
-0x6355 = 0x7A70
-0x6356 = 0x7A79
-0x6357 = 0x7A7D
-0x6358 = 0x7A88
-0x6359 = 0x7A97
-0x635A = 0x7A95
-0x635B = 0x7A98
-0x635C = 0x7A96
-0x635D = 0x7AA9
-0x635E = 0x7AC8
-0x635F = 0x7AB0
-0x6360 = 0x7AB6
-0x6361 = 0x7AC5
-0x6362 = 0x7AC4
-0x6363 = 0x7ABF
-0x6364 = 0x9083
-0x6365 = 0x7AC7
-0x6366 = 0x7ACA
-0x6367 = 0x7ACD
-0x6368 = 0x7ACF
-0x6369 = 0x7AD5
-0x636A = 0x7AD3
-0x636B = 0x7AD9
-0x636C = 0x7ADA
-0x636D = 0x7ADD
-0x636E = 0x7AE1
-0x636F = 0x7AE2
-0x6370 = 0x7AE6
-0x6371 = 0x7AED
-0x6372 = 0x7AF0
-0x6373 = 0x7B02
-0x6374 = 0x7B0F
-0x6375 = 0x7B0A
-0x6376 = 0x7B06
-0x6377 = 0x7B33
-0x6378 = 0x7B18
-0x6379 = 0x7B19
-0x637A = 0x7B1E
-0x637B = 0x7B35
-0x637C = 0x7B28
-0x637D = 0x7B36
-0x637E = 0x7B50
-0x6421 = 0x7B7A
-0x6422 = 0x7B04
-0x6423 = 0x7B4D
-0x6424 = 0x7B0B
-0x6425 = 0x7B4C
-0x6426 = 0x7B45
-0x6427 = 0x7B75
-0x6428 = 0x7B65
-0x6429 = 0x7B74
-0x642A = 0x7B67
-0x642B = 0x7B70
-0x642C = 0x7B71
-0x642D = 0x7B6C
-0x642E = 0x7B6E
-0x642F = 0x7B9D
-0x6430 = 0x7B98
-0x6431 = 0x7B9F
-0x6432 = 0x7B8D
-0x6433 = 0x7B9C
-0x6434 = 0x7B9A
-0x6435 = 0x7B8B
-0x6436 = 0x7B92
-0x6437 = 0x7B8F
-0x6438 = 0x7B5D
-0x6439 = 0x7B99
-0x643A = 0x7BCB
-0x643B = 0x7BC1
-0x643C = 0x7BCC
-0x643D = 0x7BCF
-0x643E = 0x7BB4
-0x643F = 0x7BC6
-0x6440 = 0x7BDD
-0x6441 = 0x7BE9
-0x6442 = 0x7C11
-0x6443 = 0x7C14
-0x6444 = 0x7BE6
-0x6445 = 0x7BE5
-0x6446 = 0x7C60
-0x6447 = 0x7C00
-0x6448 = 0x7C07
-0x6449 = 0x7C13
-0x644A = 0x7BF3
-0x644B = 0x7BF7
-0x644C = 0x7C17
-0x644D = 0x7C0D
-0x644E = 0x7BF6
-0x644F = 0x7C23
-0x6450 = 0x7C27
-0x6451 = 0x7C2A
-0x6452 = 0x7C1F
-0x6453 = 0x7C37
-0x6454 = 0x7C2B
-0x6455 = 0x7C3D
-0x6456 = 0x7C4C
-0x6457 = 0x7C43
-0x6458 = 0x7C54
-0x6459 = 0x7C4F
-0x645A = 0x7C40
-0x645B = 0x7C50
-0x645C = 0x7C58
-0x645D = 0x7C5F
-0x645E = 0x7C64
-0x645F = 0x7C56
-0x6460 = 0x7C65
-0x6461 = 0x7C6C
-0x6462 = 0x7C75
-0x6463 = 0x7C83
-0x6464 = 0x7C90
-0x6465 = 0x7CA4
-0x6466 = 0x7CAD
-0x6467 = 0x7CA2
-0x6468 = 0x7CAB
-0x6469 = 0x7CA1
-0x646A = 0x7CA8
-0x646B = 0x7CB3
-0x646C = 0x7CB2
-0x646D = 0x7CB1
-0x646E = 0x7CAE
-0x646F = 0x7CB9
-0x6470 = 0x7CBD
-0x6471 = 0x7CC0
-0x6472 = 0x7CC5
-0x6473 = 0x7CC2
-0x6474 = 0x7CD8
-0x6475 = 0x7CD2
-0x6476 = 0x7CDC
-0x6477 = 0x7CE2
-0x6478 = 0x9B3B
-0x6479 = 0x7CEF
-0x647A = 0x7CF2
-0x647B = 0x7CF4
-0x647C = 0x7CF6
-0x647D = 0x7CFA
-0x647E = 0x7D06
-0x6521 = 0x7D02
-0x6522 = 0x7D1C
-0x6523 = 0x7D15
-0x6524 = 0x7D0A
-0x6525 = 0x7D45
-0x6526 = 0x7D4B
-0x6527 = 0x7D2E
-0x6528 = 0x7D32
-0x6529 = 0x7D3F
-0x652A = 0x7D35
-0x652B = 0x7D46
-0x652C = 0x7D73
-0x652D = 0x7D56
-0x652E = 0x7D4E
-0x652F = 0x7D72
-0x6530 = 0x7D68
-0x6531 = 0x7D6E
-0x6532 = 0x7D4F
-0x6533 = 0x7D63
-0x6534 = 0x7D93
-0x6535 = 0x7D89
-0x6536 = 0x7D5B
-0x6537 = 0x7D8F
-0x6538 = 0x7D7D
-0x6539 = 0x7D9B
-0x653A = 0x7DBA
-0x653B = 0x7DAE
-0x653C = 0x7DA3
-0x653D = 0x7DB5
-0x653E = 0x7DC7
-0x653F = 0x7DBD
-0x6540 = 0x7DAB
-0x6541 = 0x7E3D
-0x6542 = 0x7DA2
-0x6543 = 0x7DAF
-0x6544 = 0x7DDC
-0x6545 = 0x7DB8
-0x6546 = 0x7D9F
-0x6547 = 0x7DB0
-0x6548 = 0x7DD8
-0x6549 = 0x7DDD
-0x654A = 0x7DE4
-0x654B = 0x7DDE
-0x654C = 0x7DFB
-0x654D = 0x7DF2
-0x654E = 0x7DE1
-0x654F = 0x7E05
-0x6550 = 0x7E0A
-0x6551 = 0x7E23
-0x6552 = 0x7E21
-0x6553 = 0x7E12
-0x6554 = 0x7E31
-0x6555 = 0x7E1F
-0x6556 = 0x7E09
-0x6557 = 0x7E0B
-0x6558 = 0x7E22
-0x6559 = 0x7E46
-0x655A = 0x7E66
-0x655B = 0x7E3B
-0x655C = 0x7E35
-0x655D = 0x7E39
-0x655E = 0x7E43
-0x655F = 0x7E37
-0x6560 = 0x7E32
-0x6561 = 0x7E3A
-0x6562 = 0x7E67
-0x6563 = 0x7E5D
-0x6564 = 0x7E56
-0x6565 = 0x7E5E
-0x6566 = 0x7E59
-0x6567 = 0x7E5A
-0x6568 = 0x7E79
-0x6569 = 0x7E6A
-0x656A = 0x7E69
-0x656B = 0x7E7C
-0x656C = 0x7E7B
-0x656D = 0x7E83
-0x656E = 0x7DD5
-0x656F = 0x7E7D
-0x6570 = 0x8FAE
-0x6571 = 0x7E7F
-0x6572 = 0x7E88
-0x6573 = 0x7E89
-0x6574 = 0x7E8C
-0x6575 = 0x7E92
-0x6576 = 0x7E90
-0x6577 = 0x7E93
-0x6578 = 0x7E94
-0x6579 = 0x7E96
-0x657A = 0x7E8E
-0x657B = 0x7E9B
-0x657C = 0x7E9C
-0x657D = 0x7F38
-0x657E = 0x7F3A
-0x6621 = 0x7F45
-0x6622 = 0x7F4C
-0x6623 = 0x7F4D
-0x6624 = 0x7F4E
-0x6625 = 0x7F50
-0x6626 = 0x7F51
-0x6627 = 0x7F55
-0x6628 = 0x7F54
-0x6629 = 0x7F58
-0x662A = 0x7F5F
-0x662B = 0x7F60
-0x662C = 0x7F68
-0x662D = 0x7F69
-0x662E = 0x7F67
-0x662F = 0x7F78
-0x6630 = 0x7F82
-0x6631 = 0x7F86
-0x6632 = 0x7F83
-0x6633 = 0x7F88
-0x6634 = 0x7F87
-0x6635 = 0x7F8C
-0x6636 = 0x7F94
-0x6637 = 0x7F9E
-0x6638 = 0x7F9D
-0x6639 = 0x7F9A
-0x663A = 0x7FA3
-0x663B = 0x7FAF
-0x663C = 0x7FB2
-0x663D = 0x7FB9
-0x663E = 0x7FAE
-0x663F = 0x7FB6
-0x6640 = 0x7FB8
-0x6641 = 0x8B71
-0x6642 = 0x7FC5
-0x6643 = 0x7FC6
-0x6644 = 0x7FCA
-0x6645 = 0x7FD5
-0x6646 = 0x7FD4
-0x6647 = 0x7FE1
-0x6648 = 0x7FE6
-0x6649 = 0x7FE9
-0x664A = 0x7FF3
-0x664B = 0x7FF9
-0x664C = 0x98DC
-0x664D = 0x8006
-0x664E = 0x8004
-0x664F = 0x800B
-0x6650 = 0x8012
-0x6651 = 0x8018
-0x6652 = 0x8019
-0x6653 = 0x801C
-0x6654 = 0x8021
-0x6655 = 0x8028
-0x6656 = 0x803F
-0x6657 = 0x803B
-0x6658 = 0x804A
-0x6659 = 0x8046
-0x665A = 0x8052
-0x665B = 0x8058
-0x665C = 0x805A
-0x665D = 0x805F
-0x665E = 0x8062
-0x665F = 0x8068
-0x6660 = 0x8073
-0x6661 = 0x8072
-0x6662 = 0x8070
-0x6663 = 0x8076
-0x6664 = 0x8079
-0x6665 = 0x807D
-0x6666 = 0x807F
-0x6667 = 0x8084
-0x6668 = 0x8086
-0x6669 = 0x8085
-0x666A = 0x809B
-0x666B = 0x8093
-0x666C = 0x809A
-0x666D = 0x80AD
-0x666E = 0x5190
-0x666F = 0x80AC
-0x6670 = 0x80DB
-0x6671 = 0x80E5
-0x6672 = 0x80D9
-0x6673 = 0x80DD
-0x6674 = 0x80C4
-0x6675 = 0x80DA
-0x6676 = 0x80D6
-0x6677 = 0x8109
-0x6678 = 0x80EF
-0x6679 = 0x80F1
-0x667A = 0x811B
-0x667B = 0x8129
-0x667C = 0x8123
-0x667D = 0x812F
-0x667E = 0x814B
-0x6721 = 0x968B
-0x6722 = 0x8146
-0x6723 = 0x813E
-0x6724 = 0x8153
-0x6725 = 0x8151
-0x6726 = 0x80FC
-0x6727 = 0x8171
-0x6728 = 0x816E
-0x6729 = 0x8165
-0x672A = 0x8166
-0x672B = 0x8174
-0x672C = 0x8183
-0x672D = 0x8188
-0x672E = 0x818A
-0x672F = 0x8180
-0x6730 = 0x8182
-0x6731 = 0x81A0
-0x6732 = 0x8195
-0x6733 = 0x81A4
-0x6734 = 0x81A3
-0x6735 = 0x815F
-0x6736 = 0x8193
-0x6737 = 0x81A9
-0x6738 = 0x81B0
-0x6739 = 0x81B5
-0x673A = 0x81BE
-0x673B = 0x81B8
-0x673C = 0x81BD
-0x673D = 0x81C0
-0x673E = 0x81C2
-0x673F = 0x81BA
-0x6740 = 0x81C9
-0x6741 = 0x81CD
-0x6742 = 0x81D1
-0x6743 = 0x81D9
-0x6744 = 0x81D8
-0x6745 = 0x81C8
-0x6746 = 0x81DA
-0x6747 = 0x81DF
-0x6748 = 0x81E0
-0x6749 = 0x81E7
-0x674A = 0x81FA
-0x674B = 0x81FB
-0x674C = 0x81FE
-0x674D = 0x8201
-0x674E = 0x8202
-0x674F = 0x8205
-0x6750 = 0x8207
-0x6751 = 0x820A
-0x6752 = 0x820D
-0x6753 = 0x8210
-0x6754 = 0x8216
-0x6755 = 0x8229
-0x6756 = 0x822B
-0x6757 = 0x8238
-0x6758 = 0x8233
-0x6759 = 0x8240
-0x675A = 0x8259
-0x675B = 0x8258
-0x675C = 0x825D
-0x675D = 0x825A
-0x675E = 0x825F
-0x675F = 0x8264
-0x6760 = 0x8262
-0x6761 = 0x8268
-0x6762 = 0x826A
-0x6763 = 0x826B
-0x6764 = 0x822E
-0x6765 = 0x8271
-0x6766 = 0x8277
-0x6767 = 0x8278
-0x6768 = 0x827E
-0x6769 = 0x828D
-0x676A = 0x8292
-0x676B = 0x82AB
-0x676C = 0x829F
-0x676D = 0x82BB
-0x676E = 0x82AC
-0x676F = 0x82E1
-0x6770 = 0x82E3
-0x6771 = 0x82DF
-0x6772 = 0x82D2
-0x6773 = 0x82F4
-0x6774 = 0x82F3
-0x6775 = 0x82FA
-0x6776 = 0x8393
-0x6777 = 0x8303
-0x6778 = 0x82FB
-0x6779 = 0x82F9
-0x677A = 0x82DE
-0x677B = 0x8306
-0x677C = 0x82DC
-0x677D = 0x8309
-0x677E = 0x82D9
-0x6821 = 0x8335
-0x6822 = 0x8334
-0x6823 = 0x8316
-0x6824 = 0x8332
-0x6825 = 0x8331
-0x6826 = 0x8340
-0x6827 = 0x8339
-0x6828 = 0x8350
-0x6829 = 0x8345
-0x682A = 0x832F
-0x682B = 0x832B
-0x682C = 0x8317
-0x682D = 0x8318
-0x682E = 0x8385
-0x682F = 0x839A
-0x6830 = 0x83AA
-0x6831 = 0x839F
-0x6832 = 0x83A2
-0x6833 = 0x8396
-0x6834 = 0x8323
-0x6835 = 0x838E
-0x6836 = 0x8387
-0x6837 = 0x838A
-0x6838 = 0x837C
-0x6839 = 0x83B5
-0x683A = 0x8373
-0x683B = 0x8375
-0x683C = 0x83A0
-0x683D = 0x8389
-0x683E = 0x83A8
-0x683F = 0x83F4
-0x6840 = 0x8413
-0x6841 = 0x83EB
-0x6842 = 0x83CE
-0x6843 = 0x83FD
-0x6844 = 0x8403
-0x6845 = 0x83D8
-0x6846 = 0x840B
-0x6847 = 0x83C1
-0x6848 = 0x83F7
-0x6849 = 0x8407
-0x684A = 0x83E0
-0x684B = 0x83F2
-0x684C = 0x840D
-0x684D = 0x8422
-0x684E = 0x8420
-0x684F = 0x83BD
-0x6850 = 0x8438
-0x6851 = 0x8506
-0x6852 = 0x83FB
-0x6853 = 0x846D
-0x6854 = 0x842A
-0x6855 = 0x843C
-0x6856 = 0x855A
-0x6857 = 0x8484
-0x6858 = 0x8477
-0x6859 = 0x846B
-0x685A = 0x84AD
-0x685B = 0x846E
-0x685C = 0x8482
-0x685D = 0x8469
-0x685E = 0x8446
-0x685F = 0x842C
-0x6860 = 0x846F
-0x6861 = 0x8479
-0x6862 = 0x8435
-0x6863 = 0x84CA
-0x6864 = 0x8462
-0x6865 = 0x84B9
-0x6866 = 0x84BF
-0x6867 = 0x849F
-0x6868 = 0x84D9
-0x6869 = 0x84CD
-0x686A = 0x84BB
-0x686B = 0x84DA
-0x686C = 0x84D0
-0x686D = 0x84C1
-0x686E = 0x84C6
-0x686F = 0x84D6
-0x6870 = 0x84A1
-0x6871 = 0x8521
-0x6872 = 0x84FF
-0x6873 = 0x84F4
-0x6874 = 0x8517
-0x6875 = 0x8518
-0x6876 = 0x852C
-0x6877 = 0x851F
-0x6878 = 0x8515
-0x6879 = 0x8514
-0x687A = 0x84FC
-0x687B = 0x8540
-0x687C = 0x8563
-0x687D = 0x8558
-0x687E = 0x8548
-0x6921 = 0x8541
-0x6922 = 0x8602
-0x6923 = 0x854B
-0x6924 = 0x8555
-0x6925 = 0x8580
-0x6926 = 0x85A4
-0x6927 = 0x8588
-0x6928 = 0x8591
-0x6929 = 0x858A
-0x692A = 0x85A8
-0x692B = 0x856D
-0x692C = 0x8594
-0x692D = 0x859B
-0x692E = 0x85EA
-0x692F = 0x8587
-0x6930 = 0x859C
-0x6931 = 0x8577
-0x6932 = 0x857E
-0x6933 = 0x8590
-0x6934 = 0x85C9
-0x6935 = 0x85BA
-0x6936 = 0x85CF
-0x6937 = 0x85B9
-0x6938 = 0x85D0
-0x6939 = 0x85D5
-0x693A = 0x85DD
-0x693B = 0x85E5
-0x693C = 0x85DC
-0x693D = 0x85F9
-0x693E = 0x860A
-0x693F = 0x8613
-0x6940 = 0x860B
-0x6941 = 0x85FE
-0x6942 = 0x85FA
-0x6943 = 0x8606
-0x6944 = 0x8622
-0x6945 = 0x861A
-0x6946 = 0x8630
-0x6947 = 0x863F
-0x6948 = 0x864D
-0x6949 = 0x4E55
-0x694A = 0x8654
-0x694B = 0x865F
-0x694C = 0x8667
-0x694D = 0x8671
-0x694E = 0x8693
-0x694F = 0x86A3
-0x6950 = 0x86A9
-0x6951 = 0x86AA
-0x6952 = 0x868B
-0x6953 = 0x868C
-0x6954 = 0x86B6
-0x6955 = 0x86AF
-0x6956 = 0x86C4
-0x6957 = 0x86C6
-0x6958 = 0x86B0
-0x6959 = 0x86C9
-0x695A = 0x8823
-0x695B = 0x86AB
-0x695C = 0x86D4
-0x695D = 0x86DE
-0x695E = 0x86E9
-0x695F = 0x86EC
-0x6960 = 0x86DF
-0x6961 = 0x86DB
-0x6962 = 0x86EF
-0x6963 = 0x8712
-0x6964 = 0x8706
-0x6965 = 0x8708
-0x6966 = 0x8700
-0x6967 = 0x8703
-0x6968 = 0x86FB
-0x6969 = 0x8711
-0x696A = 0x8709
-0x696B = 0x870D
-0x696C = 0x86F9
-0x696D = 0x870A
-0x696E = 0x8734
-0x696F = 0x873F
-0x6970 = 0x8737
-0x6971 = 0x873B
-0x6972 = 0x8725
-0x6973 = 0x8729
-0x6974 = 0x871A
-0x6975 = 0x8760
-0x6976 = 0x875F
-0x6977 = 0x8778
-0x6978 = 0x874C
-0x6979 = 0x874E
-0x697A = 0x8774
-0x697B = 0x8757
-0x697C = 0x8768
-0x697D = 0x876E
-0x697E = 0x8759
-0x6A21 = 0x8753
-0x6A22 = 0x8763
-0x6A23 = 0x876A
-0x6A24 = 0x8805
-0x6A25 = 0x87A2
-0x6A26 = 0x879F
-0x6A27 = 0x8782
-0x6A28 = 0x87AF
-0x6A29 = 0x87CB
-0x6A2A = 0x87BD
-0x6A2B = 0x87C0
-0x6A2C = 0x87D0
-0x6A2D = 0x96D6
-0x6A2E = 0x87AB
-0x6A2F = 0x87C4
-0x6A30 = 0x87B3
-0x6A31 = 0x87C7
-0x6A32 = 0x87C6
-0x6A33 = 0x87BB
-0x6A34 = 0x87EF
-0x6A35 = 0x87F2
-0x6A36 = 0x87E0
-0x6A37 = 0x880F
-0x6A38 = 0x880D
-0x6A39 = 0x87FE
-0x6A3A = 0x87F6
-0x6A3B = 0x87F7
-0x6A3C = 0x880E
-0x6A3D = 0x87D2
-0x6A3E = 0x8811
-0x6A3F = 0x8816
-0x6A40 = 0x8815
-0x6A41 = 0x8822
-0x6A42 = 0x8821
-0x6A43 = 0x8831
-0x6A44 = 0x8836
-0x6A45 = 0x8839
-0x6A46 = 0x8827
-0x6A47 = 0x883B
-0x6A48 = 0x8844
-0x6A49 = 0x8842
-0x6A4A = 0x8852
-0x6A4B = 0x8859
-0x6A4C = 0x885E
-0x6A4D = 0x8862
-0x6A4E = 0x886B
-0x6A4F = 0x8881
-0x6A50 = 0x887E
-0x6A51 = 0x889E
-0x6A52 = 0x8875
-0x6A53 = 0x887D
-0x6A54 = 0x88B5
-0x6A55 = 0x8872
-0x6A56 = 0x8882
-0x6A57 = 0x8897
-0x6A58 = 0x8892
-0x6A59 = 0x88AE
-0x6A5A = 0x8899
-0x6A5B = 0x88A2
-0x6A5C = 0x888D
-0x6A5D = 0x88A4
-0x6A5E = 0x88B0
-0x6A5F = 0x88BF
-0x6A60 = 0x88B1
-0x6A61 = 0x88C3
-0x6A62 = 0x88C4
-0x6A63 = 0x88D4
-0x6A64 = 0x88D8
-0x6A65 = 0x88D9
-0x6A66 = 0x88DD
-0x6A67 = 0x88F9
-0x6A68 = 0x8902
-0x6A69 = 0x88FC
-0x6A6A = 0x88F4
-0x6A6B = 0x88E8
-0x6A6C = 0x88F2
-0x6A6D = 0x8904
-0x6A6E = 0x890C
-0x6A6F = 0x890A
-0x6A70 = 0x8913
-0x6A71 = 0x8943
-0x6A72 = 0x891E
-0x6A73 = 0x8925
-0x6A74 = 0x892A
-0x6A75 = 0x892B
-0x6A76 = 0x8941
-0x6A77 = 0x8944
-0x6A78 = 0x893B
-0x6A79 = 0x8936
-0x6A7A = 0x8938
-0x6A7B = 0x894C
-0x6A7C = 0x891D
-0x6A7D = 0x8960
-0x6A7E = 0x895E
-0x6B21 = 0x8966
-0x6B22 = 0x8964
-0x6B23 = 0x896D
-0x6B24 = 0x896A
-0x6B25 = 0x896F
-0x6B26 = 0x8974
-0x6B27 = 0x8977
-0x6B28 = 0x897E
-0x6B29 = 0x8983
-0x6B2A = 0x8988
-0x6B2B = 0x898A
-0x6B2C = 0x8993
-0x6B2D = 0x8998
-0x6B2E = 0x89A1
-0x6B2F = 0x89A9
-0x6B30 = 0x89A6
-0x6B31 = 0x89AC
-0x6B32 = 0x89AF
-0x6B33 = 0x89B2
-0x6B34 = 0x89BA
-0x6B35 = 0x89BD
-0x6B36 = 0x89BF
-0x6B37 = 0x89C0
-0x6B38 = 0x89DA
-0x6B39 = 0x89DC
-0x6B3A = 0x89DD
-0x6B3B = 0x89E7
-0x6B3C = 0x89F4
-0x6B3D = 0x89F8
-0x6B3E = 0x8A03
-0x6B3F = 0x8A16
-0x6B40 = 0x8A10
-0x6B41 = 0x8A0C
-0x6B42 = 0x8A1B
-0x6B43 = 0x8A1D
-0x6B44 = 0x8A25
-0x6B45 = 0x8A36
-0x6B46 = 0x8A41
-0x6B47 = 0x8A5B
-0x6B48 = 0x8A52
-0x6B49 = 0x8A46
-0x6B4A = 0x8A48
-0x6B4B = 0x8A7C
-0x6B4C = 0x8A6D
-0x6B4D = 0x8A6C
-0x6B4E = 0x8A62
-0x6B4F = 0x8A85
-0x6B50 = 0x8A82
-0x6B51 = 0x8A84
-0x6B52 = 0x8AA8
-0x6B53 = 0x8AA1
-0x6B54 = 0x8A91
-0x6B55 = 0x8AA5
-0x6B56 = 0x8AA6
-0x6B57 = 0x8A9A
-0x6B58 = 0x8AA3
-0x6B59 = 0x8AC4
-0x6B5A = 0x8ACD
-0x6B5B = 0x8AC2
-0x6B5C = 0x8ADA
-0x6B5D = 0x8AEB
-0x6B5E = 0x8AF3
-0x6B5F = 0x8AE7
-0x6B60 = 0x8AE4
-0x6B61 = 0x8AF1
-0x6B62 = 0x8B14
-0x6B63 = 0x8AE0
-0x6B64 = 0x8AE2
-0x6B65 = 0x8AF7
-0x6B66 = 0x8ADE
-0x6B67 = 0x8ADB
-0x6B68 = 0x8B0C
-0x6B69 = 0x8B07
-0x6B6A = 0x8B1A
-0x6B6B = 0x8AE1
-0x6B6C = 0x8B16
-0x6B6D = 0x8B10
-0x6B6E = 0x8B17
-0x6B6F = 0x8B20
-0x6B70 = 0x8B33
-0x6B71 = 0x97AB
-0x6B72 = 0x8B26
-0x6B73 = 0x8B2B
-0x6B74 = 0x8B3E
-0x6B75 = 0x8B28
-0x6B76 = 0x8B41
-0x6B77 = 0x8B4C
-0x6B78 = 0x8B4F
-0x6B79 = 0x8B4E
-0x6B7A = 0x8B49
-0x6B7B = 0x8B56
-0x6B7C = 0x8B5B
-0x6B7D = 0x8B5A
-0x6B7E = 0x8B6B
-0x6C21 = 0x8B5F
-0x6C22 = 0x8B6C
-0x6C23 = 0x8B6F
-0x6C24 = 0x8B74
-0x6C25 = 0x8B7D
-0x6C26 = 0x8B80
-0x6C27 = 0x8B8C
-0x6C28 = 0x8B8E
-0x6C29 = 0x8B92
-0x6C2A = 0x8B93
-0x6C2B = 0x8B96
-0x6C2C = 0x8B99
-0x6C2D = 0x8B9A
-0x6C2E = 0x8C3A
-0x6C2F = 0x8C41
-0x6C30 = 0x8C3F
-0x6C31 = 0x8C48
-0x6C32 = 0x8C4C
-0x6C33 = 0x8C4E
-0x6C34 = 0x8C50
-0x6C35 = 0x8C55
-0x6C36 = 0x8C62
-0x6C37 = 0x8C6C
-0x6C38 = 0x8C78
-0x6C39 = 0x8C7A
-0x6C3A = 0x8C82
-0x6C3B = 0x8C89
-0x6C3C = 0x8C85
-0x6C3D = 0x8C8A
-0x6C3E = 0x8C8D
-0x6C3F = 0x8C8E
-0x6C40 = 0x8C94
-0x6C41 = 0x8C7C
-0x6C42 = 0x8C98
-0x6C43 = 0x621D
-0x6C44 = 0x8CAD
-0x6C45 = 0x8CAA
-0x6C46 = 0x8CBD
-0x6C47 = 0x8CB2
-0x6C48 = 0x8CB3
-0x6C49 = 0x8CAE
-0x6C4A = 0x8CB6
-0x6C4B = 0x8CC8
-0x6C4C = 0x8CC1
-0x6C4D = 0x8CE4
-0x6C4E = 0x8CE3
-0x6C4F = 0x8CDA
-0x6C50 = 0x8CFD
-0x6C51 = 0x8CFA
-0x6C52 = 0x8CFB
-0x6C53 = 0x8D04
-0x6C54 = 0x8D05
-0x6C55 = 0x8D0A
-0x6C56 = 0x8D07
-0x6C57 = 0x8D0F
-0x6C58 = 0x8D0D
-0x6C59 = 0x8D10
-0x6C5A = 0x9F4E
-0x6C5B = 0x8D13
-0x6C5C = 0x8CCD
-0x6C5D = 0x8D14
-0x6C5E = 0x8D16
-0x6C5F = 0x8D67
-0x6C60 = 0x8D6D
-0x6C61 = 0x8D71
-0x6C62 = 0x8D73
-0x6C63 = 0x8D81
-0x6C64 = 0x8D99
-0x6C65 = 0x8DC2
-0x6C66 = 0x8DBE
-0x6C67 = 0x8DBA
-0x6C68 = 0x8DCF
-0x6C69 = 0x8DDA
-0x6C6A = 0x8DD6
-0x6C6B = 0x8DCC
-0x6C6C = 0x8DDB
-0x6C6D = 0x8DCB
-0x6C6E = 0x8DEA
-0x6C6F = 0x8DEB
-0x6C70 = 0x8DDF
-0x6C71 = 0x8DE3
-0x6C72 = 0x8DFC
-0x6C73 = 0x8E08
-0x6C74 = 0x8E09
-0x6C75 = 0x8DFF
-0x6C76 = 0x8E1D
-0x6C77 = 0x8E1E
-0x6C78 = 0x8E10
-0x6C79 = 0x8E1F
-0x6C7A = 0x8E42
-0x6C7B = 0x8E35
-0x6C7C = 0x8E30
-0x6C7D = 0x8E34
-0x6C7E = 0x8E4A
-0x6D21 = 0x8E47
-0x6D22 = 0x8E49
-0x6D23 = 0x8E4C
-0x6D24 = 0x8E50
-0x6D25 = 0x8E48
-0x6D26 = 0x8E59
-0x6D27 = 0x8E64
-0x6D28 = 0x8E60
-0x6D29 = 0x8E2A
-0x6D2A = 0x8E63
-0x6D2B = 0x8E55
-0x6D2C = 0x8E76
-0x6D2D = 0x8E72
-0x6D2E = 0x8E7C
-0x6D2F = 0x8E81
-0x6D30 = 0x8E87
-0x6D31 = 0x8E85
-0x6D32 = 0x8E84
-0x6D33 = 0x8E8B
-0x6D34 = 0x8E8A
-0x6D35 = 0x8E93
-0x6D36 = 0x8E91
-0x6D37 = 0x8E94
-0x6D38 = 0x8E99
-0x6D39 = 0x8EAA
-0x6D3A = 0x8EA1
-0x6D3B = 0x8EAC
-0x6D3C = 0x8EB0
-0x6D3D = 0x8EC6
-0x6D3E = 0x8EB1
-0x6D3F = 0x8EBE
-0x6D40 = 0x8EC5
-0x6D41 = 0x8EC8
-0x6D42 = 0x8ECB
-0x6D43 = 0x8EDB
-0x6D44 = 0x8EE3
-0x6D45 = 0x8EFC
-0x6D46 = 0x8EFB
-0x6D47 = 0x8EEB
-0x6D48 = 0x8EFE
-0x6D49 = 0x8F0A
-0x6D4A = 0x8F05
-0x6D4B = 0x8F15
-0x6D4C = 0x8F12
-0x6D4D = 0x8F19
-0x6D4E = 0x8F13
-0x6D4F = 0x8F1C
-0x6D50 = 0x8F1F
-0x6D51 = 0x8F1B
-0x6D52 = 0x8F0C
-0x6D53 = 0x8F26
-0x6D54 = 0x8F33
-0x6D55 = 0x8F3B
-0x6D56 = 0x8F39
-0x6D57 = 0x8F45
-0x6D58 = 0x8F42
-0x6D59 = 0x8F3E
-0x6D5A = 0x8F4C
-0x6D5B = 0x8F49
-0x6D5C = 0x8F46
-0x6D5D = 0x8F4E
-0x6D5E = 0x8F57
-0x6D5F = 0x8F5C
-0x6D60 = 0x8F62
-0x6D61 = 0x8F63
-0x6D62 = 0x8F64
-0x6D63 = 0x8F9C
-0x6D64 = 0x8F9F
-0x6D65 = 0x8FA3
-0x6D66 = 0x8FAD
-0x6D67 = 0x8FAF
-0x6D68 = 0x8FB7
-0x6D69 = 0x8FDA
-0x6D6A = 0x8FE5
-0x6D6B = 0x8FE2
-0x6D6C = 0x8FEA
-0x6D6D = 0x8FEF
-0x6D6E = 0x9087
-0x6D6F = 0x8FF4
-0x6D70 = 0x9005
-0x6D71 = 0x8FF9
-0x6D72 = 0x8FFA
-0x6D73 = 0x9011
-0x6D74 = 0x9015
-0x6D75 = 0x9021
-0x6D76 = 0x900D
-0x6D77 = 0x901E
-0x6D78 = 0x9016
-0x6D79 = 0x900B
-0x6D7A = 0x9027
-0x6D7B = 0x9036
-0x6D7C = 0x9035
-0x6D7D = 0x9039
-0x6D7E = 0x8FF8
-0x6E21 = 0x904F
-0x6E22 = 0x9050
-0x6E23 = 0x9051
-0x6E24 = 0x9052
-0x6E25 = 0x900E
-0x6E26 = 0x9049
-0x6E27 = 0x903E
-0x6E28 = 0x9056
-0x6E29 = 0x9058
-0x6E2A = 0x905E
-0x6E2B = 0x9068
-0x6E2C = 0x906F
-0x6E2D = 0x9076
-0x6E2E = 0x96A8
-0x6E2F = 0x9072
-0x6E30 = 0x9082
-0x6E31 = 0x907D
-0x6E32 = 0x9081
-0x6E33 = 0x9080
-0x6E34 = 0x908A
-0x6E35 = 0x9089
-0x6E36 = 0x908F
-0x6E37 = 0x90A8
-0x6E38 = 0x90AF
-0x6E39 = 0x90B1
-0x6E3A = 0x90B5
-0x6E3B = 0x90E2
-0x6E3C = 0x90E4
-0x6E3D = 0x6248
-0x6E3E = 0x90DB
-0x6E3F = 0x9102
-0x6E40 = 0x9112
-0x6E41 = 0x9119
-0x6E42 = 0x9132
-0x6E43 = 0x9130
-0x6E44 = 0x914A
-0x6E45 = 0x9156
-0x6E46 = 0x9158
-0x6E47 = 0x9163
-0x6E48 = 0x9165
-0x6E49 = 0x9169
-0x6E4A = 0x9173
-0x6E4B = 0x9172
-0x6E4C = 0x918B
-0x6E4D = 0x9189
-0x6E4E = 0x9182
-0x6E4F = 0x91A2
-0x6E50 = 0x91AB
-0x6E51 = 0x91AF
-0x6E52 = 0x91AA
-0x6E53 = 0x91B5
-0x6E54 = 0x91B4
-0x6E55 = 0x91BA
-0x6E56 = 0x91C0
-0x6E57 = 0x91C1
-0x6E58 = 0x91C9
-0x6E59 = 0x91CB
-0x6E5A = 0x91D0
-0x6E5B = 0x91D6
-0x6E5C = 0x91DF
-0x6E5D = 0x91E1
-0x6E5E = 0x91DB
-0x6E5F = 0x91FC
-0x6E60 = 0x91F5
-0x6E61 = 0x91F6
-0x6E62 = 0x921E
-0x6E63 = 0x91FF
-0x6E64 = 0x9214
-0x6E65 = 0x922C
-0x6E66 = 0x9215
-0x6E67 = 0x9211
-0x6E68 = 0x925E
-0x6E69 = 0x9257
-0x6E6A = 0x9245
-0x6E6B = 0x9249
-0x6E6C = 0x9264
-0x6E6D = 0x9248
-0x6E6E = 0x9295
-0x6E6F = 0x923F
-0x6E70 = 0x924B
-0x6E71 = 0x9250
-0x6E72 = 0x929C
-0x6E73 = 0x9296
-0x6E74 = 0x9293
-0x6E75 = 0x929B
-0x6E76 = 0x925A
-0x6E77 = 0x92CF
-0x6E78 = 0x92B9
-0x6E79 = 0x92B7
-0x6E7A = 0x92E9
-0x6E7B = 0x930F
-0x6E7C = 0x92FA
-0x6E7D = 0x9344
-0x6E7E = 0x932E
-0x6F21 = 0x9319
-0x6F22 = 0x9322
-0x6F23 = 0x931A
-0x6F24 = 0x9323
-0x6F25 = 0x933A
-0x6F26 = 0x9335
-0x6F27 = 0x933B
-0x6F28 = 0x935C
-0x6F29 = 0x9360
-0x6F2A = 0x937C
-0x6F2B = 0x936E
-0x6F2C = 0x9356
-0x6F2D = 0x93B0
-0x6F2E = 0x93AC
-0x6F2F = 0x93AD
-0x6F30 = 0x9394
-0x6F31 = 0x93B9
-0x6F32 = 0x93D6
-0x6F33 = 0x93D7
-0x6F34 = 0x93E8
-0x6F35 = 0x93E5
-0x6F36 = 0x93D8
-0x6F37 = 0x93C3
-0x6F38 = 0x93DD
-0x6F39 = 0x93D0
-0x6F3A = 0x93C8
-0x6F3B = 0x93E4
-0x6F3C = 0x941A
-0x6F3D = 0x9414
-0x6F3E = 0x9413
-0x6F3F = 0x9403
-0x6F40 = 0x9407
-0x6F41 = 0x9410
-0x6F42 = 0x9436
-0x6F43 = 0x942B
-0x6F44 = 0x9435
-0x6F45 = 0x9421
-0x6F46 = 0x943A
-0x6F47 = 0x9441
-0x6F48 = 0x9452
-0x6F49 = 0x9444
-0x6F4A = 0x945B
-0x6F4B = 0x9460
-0x6F4C = 0x9462
-0x6F4D = 0x945E
-0x6F4E = 0x946A
-0x6F4F = 0x9229
-0x6F50 = 0x9470
-0x6F51 = 0x9475
-0x6F52 = 0x9477
-0x6F53 = 0x947D
-0x6F54 = 0x945A
-0x6F55 = 0x947C
-0x6F56 = 0x947E
-0x6F57 = 0x9481
-0x6F58 = 0x947F
-0x6F59 = 0x9582
-0x6F5A = 0x9587
-0x6F5B = 0x958A
-0x6F5C = 0x9594
-0x6F5D = 0x9596
-0x6F5E = 0x9598
-0x6F5F = 0x9599
-0x6F60 = 0x95A0
-0x6F61 = 0x95A8
-0x6F62 = 0x95A7
-0x6F63 = 0x95AD
-0x6F64 = 0x95BC
-0x6F65 = 0x95BB
-0x6F66 = 0x95B9
-0x6F67 = 0x95BE
-0x6F68 = 0x95CA
-0x6F69 = 0x6FF6
-0x6F6A = 0x95C3
-0x6F6B = 0x95CD
-0x6F6C = 0x95CC
-0x6F6D = 0x95D5
-0x6F6E = 0x95D4
-0x6F6F = 0x95D6
-0x6F70 = 0x95DC
-0x6F71 = 0x95E1
-0x6F72 = 0x95E5
-0x6F73 = 0x95E2
-0x6F74 = 0x9621
-0x6F75 = 0x9628
-0x6F76 = 0x962E
-0x6F77 = 0x962F
-0x6F78 = 0x9642
-0x6F79 = 0x964C
-0x6F7A = 0x964F
-0x6F7B = 0x964B
-0x6F7C = 0x9677
-0x6F7D = 0x965C
-0x6F7E = 0x965E
-0x7021 = 0x965D
-0x7022 = 0x965F
-0x7023 = 0x9666
-0x7024 = 0x9672
-0x7025 = 0x966C
-0x7026 = 0x968D
-0x7027 = 0x9698
-0x7028 = 0x9695
-0x7029 = 0x9697
-0x702A = 0x96AA
-0x702B = 0x96A7
-0x702C = 0x96B1
-0x702D = 0x96B2
-0x702E = 0x96B0
-0x702F = 0x96B4
-0x7030 = 0x96B6
-0x7031 = 0x96B8
-0x7032 = 0x96B9
-0x7033 = 0x96CE
-0x7034 = 0x96CB
-0x7035 = 0x96C9
-0x7036 = 0x96CD
-0x7037 = 0x894D
-0x7038 = 0x96DC
-0x7039 = 0x970D
-0x703A = 0x96D5
-0x703B = 0x96F9
-0x703C = 0x9704
-0x703D = 0x9706
-0x703E = 0x9708
-0x703F = 0x9713
-0x7040 = 0x970E
-0x7041 = 0x9711
-0x7042 = 0x970F
-0x7043 = 0x9716
-0x7044 = 0x9719
-0x7045 = 0x9724
-0x7046 = 0x972A
-0x7047 = 0x9730
-0x7048 = 0x9739
-0x7049 = 0x973D
-0x704A = 0x973E
-0x704B = 0x9744
-0x704C = 0x9746
-0x704D = 0x9748
-0x704E = 0x9742
-0x704F = 0x9749
-0x7050 = 0x975C
-0x7051 = 0x9760
-0x7052 = 0x9764
-0x7053 = 0x9766
-0x7054 = 0x9768
-0x7055 = 0x52D2
-0x7056 = 0x976B
-0x7057 = 0x9771
-0x7058 = 0x9779
-0x7059 = 0x9785
-0x705A = 0x977C
-0x705B = 0x9781
-0x705C = 0x977A
-0x705D = 0x9786
-0x705E = 0x978B
-0x705F = 0x978F
-0x7060 = 0x9790
-0x7061 = 0x979C
-0x7062 = 0x97A8
-0x7063 = 0x97A6
-0x7064 = 0x97A3
-0x7065 = 0x97B3
-0x7066 = 0x97B4
-0x7067 = 0x97C3
-0x7068 = 0x97C6
-0x7069 = 0x97C8
-0x706A = 0x97CB
-0x706B = 0x97DC
-0x706C = 0x97ED
-0x706D = 0x9F4F
-0x706E = 0x97F2
-0x706F = 0x7ADF
-0x7070 = 0x97F6
-0x7071 = 0x97F5
-0x7072 = 0x980F
-0x7073 = 0x980C
-0x7074 = 0x9838
-0x7075 = 0x9824
-0x7076 = 0x9821
-0x7077 = 0x9837
-0x7078 = 0x983D
-0x7079 = 0x9846
-0x707A = 0x984F
-0x707B = 0x984B
-0x707C = 0x986B
-0x707D = 0x986F
-0x707E = 0x9870
-0x7121 = 0x9871
-0x7122 = 0x9874
-0x7123 = 0x9873
-0x7124 = 0x98AA
-0x7125 = 0x98AF
-0x7126 = 0x98B1
-0x7127 = 0x98B6
-0x7128 = 0x98C4
-0x7129 = 0x98C3
-0x712A = 0x98C6
-0x712B = 0x98E9
-0x712C = 0x98EB
-0x712D = 0x9903
-0x712E = 0x9909
-0x712F = 0x9912
-0x7130 = 0x9914
-0x7131 = 0x9918
-0x7132 = 0x9921
-0x7133 = 0x991D
-0x7134 = 0x991E
-0x7135 = 0x9924
-0x7136 = 0x9920
-0x7137 = 0x992C
-0x7138 = 0x992E
-0x7139 = 0x993D
-0x713A = 0x993E
-0x713B = 0x9942
-0x713C = 0x9949
-0x713D = 0x9945
-0x713E = 0x9950
-0x713F = 0x994B
-0x7140 = 0x9951
-0x7141 = 0x9952
-0x7142 = 0x994C
-0x7143 = 0x9955
-0x7144 = 0x9997
-0x7145 = 0x9998
-0x7146 = 0x99A5
-0x7147 = 0x99AD
-0x7148 = 0x99AE
-0x7149 = 0x99BC
-0x714A = 0x99DF
-0x714B = 0x99DB
-0x714C = 0x99DD
-0x714D = 0x99D8
-0x714E = 0x99D1
-0x714F = 0x99ED
-0x7150 = 0x99EE
-0x7151 = 0x99F1
-0x7152 = 0x99F2
-0x7153 = 0x99FB
-0x7154 = 0x99F8
-0x7155 = 0x9A01
-0x7156 = 0x9A0F
-0x7157 = 0x9A05
-0x7158 = 0x99E2
-0x7159 = 0x9A19
-0x715A = 0x9A2B
-0x715B = 0x9A37
-0x715C = 0x9A45
-0x715D = 0x9A42
-0x715E = 0x9A40
-0x715F = 0x9A43
-0x7160 = 0x9A3E
-0x7161 = 0x9A55
-0x7162 = 0x9A4D
-0x7163 = 0x9A5B
-0x7164 = 0x9A57
-0x7165 = 0x9A5F
-0x7166 = 0x9A62
-0x7167 = 0x9A65
-0x7168 = 0x9A64
-0x7169 = 0x9A69
-0x716A = 0x9A6B
-0x716B = 0x9A6A
-0x716C = 0x9AAD
-0x716D = 0x9AB0
-0x716E = 0x9ABC
-0x716F = 0x9AC0
-0x7170 = 0x9ACF
-0x7171 = 0x9AD1
-0x7172 = 0x9AD3
-0x7173 = 0x9AD4
-0x7174 = 0x9ADE
-0x7175 = 0x9ADF
-0x7176 = 0x9AE2
-0x7177 = 0x9AE3
-0x7178 = 0x9AE6
-0x7179 = 0x9AEF
-0x717A = 0x9AEB
-0x717B = 0x9AEE
-0x717C = 0x9AF4
-0x717D = 0x9AF1
-0x717E = 0x9AF7
-0x7221 = 0x9AFB
-0x7222 = 0x9B06
-0x7223 = 0x9B18
-0x7224 = 0x9B1A
-0x7225 = 0x9B1F
-0x7226 = 0x9B22
-0x7227 = 0x9B23
-0x7228 = 0x9B25
-0x7229 = 0x9B27
-0x722A = 0x9B28
-0x722B = 0x9B29
-0x722C = 0x9B2A
-0x722D = 0x9B2E
-0x722E = 0x9B2F
-0x722F = 0x9B32
-0x7230 = 0x9B44
-0x7231 = 0x9B43
-0x7232 = 0x9B4F
-0x7233 = 0x9B4D
-0x7234 = 0x9B4E
-0x7235 = 0x9B51
-0x7236 = 0x9B58
-0x7237 = 0x9B74
-0x7238 = 0x9B93
-0x7239 = 0x9B83
-0x723A = 0x9B91
-0x723B = 0x9B96
-0x723C = 0x9B97
-0x723D = 0x9B9F
-0x723E = 0x9BA0
-0x723F = 0x9BA8
-0x7240 = 0x9BB4
-0x7241 = 0x9BC0
-0x7242 = 0x9BCA
-0x7243 = 0x9BB9
-0x7244 = 0x9BC6
-0x7245 = 0x9BCF
-0x7246 = 0x9BD1
-0x7247 = 0x9BD2
-0x7248 = 0x9BE3
-0x7249 = 0x9BE2
-0x724A = 0x9BE4
-0x724B = 0x9BD4
-0x724C = 0x9BE1
-0x724D = 0x9C3A
-0x724E = 0x9BF2
-0x724F = 0x9BF1
-0x7250 = 0x9BF0
-0x7251 = 0x9C15
-0x7252 = 0x9C14
-0x7253 = 0x9C09
-0x7254 = 0x9C13
-0x7255 = 0x9C0C
-0x7256 = 0x9C06
-0x7257 = 0x9C08
-0x7258 = 0x9C12
-0x7259 = 0x9C0A
-0x725A = 0x9C04
-0x725B = 0x9C2E
-0x725C = 0x9C1B
-0x725D = 0x9C25
-0x725E = 0x9C24
-0x725F = 0x9C21
-0x7260 = 0x9C30
-0x7261 = 0x9C47
-0x7262 = 0x9C32
-0x7263 = 0x9C46
-0x7264 = 0x9C3E
-0x7265 = 0x9C5A
-0x7266 = 0x9C60
-0x7267 = 0x9C67
-0x7268 = 0x9C76
-0x7269 = 0x9C78
-0x726A = 0x9CE7
-0x726B = 0x9CEC
-0x726C = 0x9CF0
-0x726D = 0x9D09
-0x726E = 0x9D08
-0x726F = 0x9CEB
-0x7270 = 0x9D03
-0x7271 = 0x9D06
-0x7272 = 0x9D2A
-0x7273 = 0x9D26
-0x7274 = 0x9DAF
-0x7275 = 0x9D23
-0x7276 = 0x9D1F
-0x7277 = 0x9D44
-0x7278 = 0x9D15
-0x7279 = 0x9D12
-0x727A = 0x9D41
-0x727B = 0x9D3F
-0x727C = 0x9D3E
-0x727D = 0x9D46
-0x727E = 0x9D48
-0x7321 = 0x9D5D
-0x7322 = 0x9D5E
-0x7323 = 0x9D64
-0x7324 = 0x9D51
-0x7325 = 0x9D50
-0x7326 = 0x9D59
-0x7327 = 0x9D72
-0x7328 = 0x9D89
-0x7329 = 0x9D87
-0x732A = 0x9DAB
-0x732B = 0x9D6F
-0x732C = 0x9D7A
-0x732D = 0x9D9A
-0x732E = 0x9DA4
-0x732F = 0x9DA9
-0x7330 = 0x9DB2
-0x7331 = 0x9DC4
-0x7332 = 0x9DC1
-0x7333 = 0x9DBB
-0x7334 = 0x9DB8
-0x7335 = 0x9DBA
-0x7336 = 0x9DC6
-0x7337 = 0x9DCF
-0x7338 = 0x9DC2
-0x7339 = 0x9DD9
-0x733A = 0x9DD3
-0x733B = 0x9DF8
-0x733C = 0x9DE6
-0x733D = 0x9DED
-0x733E = 0x9DEF
-0x733F = 0x9DFD
-0x7340 = 0x9E1A
-0x7341 = 0x9E1B
-0x7342 = 0x9E1E
-0x7343 = 0x9E75
-0x7344 = 0x9E79
-0x7345 = 0x9E7D
-0x7346 = 0x9E81
-0x7347 = 0x9E88
-0x7348 = 0x9E8B
-0x7349 = 0x9E8C
-0x734A = 0x9E92
-0x734B = 0x9E95
-0x734C = 0x9E91
-0x734D = 0x9E9D
-0x734E = 0x9EA5
-0x734F = 0x9EA9
-0x7350 = 0x9EB8
-0x7351 = 0x9EAA
-0x7352 = 0x9EAD
-0x7353 = 0x9761
-0x7354 = 0x9ECC
-0x7355 = 0x9ECE
-0x7356 = 0x9ECF
-0x7357 = 0x9ED0
-0x7358 = 0x9ED4
-0x7359 = 0x9EDC
-0x735A = 0x9EDE
-0x735B = 0x9EDD
-0x735C = 0x9EE0
-0x735D = 0x9EE5
-0x735E = 0x9EE8
-0x735F = 0x9EEF
-0x7360 = 0x9EF4
-0x7361 = 0x9EF6
-0x7362 = 0x9EF7
-0x7363 = 0x9EF9
-0x7364 = 0x9EFB
-0x7365 = 0x9EFC
-0x7366 = 0x9EFD
-0x7367 = 0x9F07
-0x7368 = 0x9F08
-0x7369 = 0x76B7
-0x736A = 0x9F15
-0x736B = 0x9F21
-0x736C = 0x9F2C
-0x736D = 0x9F3E
-0x736E = 0x9F4A
-0x736F = 0x9F52
-0x7370 = 0x9F54
-0x7371 = 0x9F63
-0x7372 = 0x9F5F
-0x7373 = 0x9F60
-0x7374 = 0x9F61
-0x7375 = 0x9F66
-0x7376 = 0x9F67
-0x7377 = 0x9F6C
-0x7378 = 0x9F6A
-0x7379 = 0x9F77
-0x737A = 0x9F72
-0x737B = 0x9F76
-0x737C = 0x9F95
-0x737D = 0x9F9C
-0x737E = 0x9FA0
-0x7421 = 0x582F
-0x7422 = 0x69C7
-0x7423 = 0x9059
-0x7424 = 0x7464
-0x7425 = 0x51DC
-0x7426 = 0x7199
-END_MAP
diff --git a/enc/trans/JIS/JISX0208@MS%UCS.src b/enc/trans/JIS/JISX0208@MS%UCS.src
deleted file mode 100644
index 768e037f5d..0000000000
--- a/enc/trans/JIS/JISX0208@MS%UCS.src
+++ /dev/null
@@ -1,6893 +0,0 @@
-# $NetBSD: JISX0208@MS%UCS.src,v 1.1 2003/07/19 20:20:40 tshiozak Exp $
-
-TYPE ROWCOL
-NAME "JISX0208:MS/UCS"
-SRC_ZONE 0x21-0x7E / 0x21-0x7E / 8
-OOB_MODE ILSEQ
-DST_ILSEQ 0xFFFE
-DST_UNIT_BITS 16
-
-BEGIN_MAP
-#
-# This data is derived from http://www.opengroup.or.jp/jvc/cde/
-#
-0x2121 = 0x3000
-0x2122 = 0x3001
-0x2123 = 0x3002
-0x2124 = 0xFF0C
-0x2125 = 0xFF0E
-0x2126 = 0x30FB
-0x2127 = 0xFF1A
-0x2128 = 0xFF1B
-0x2129 = 0xFF1F
-0x212A = 0xFF01
-0x212B = 0x309B
-0x212C = 0x309C
-0x212D = 0x00B4
-0x212E = 0xFF40
-0x212F = 0x00A8
-0x2130 = 0xFF3E
-0x2131 = 0xFFE3
-0x2132 = 0xFF3F
-0x2133 = 0x30FD
-0x2134 = 0x30FE
-0x2135 = 0x309D
-0x2136 = 0x309E
-0x2137 = 0x3003
-0x2138 = 0x4EDD
-0x2139 = 0x3005
-0x213A = 0x3006
-0x213B = 0x3007
-0x213C = 0x30FC
-0x213D = 0x2015
-0x213E = 0x2010
-0x213F = 0xFF0F
-0x2140 = 0xFF3C
-0x2141 = 0xFF5E
-0x2142 = 0x2225
-0x2143 = 0xFF5C
-0x2144 = 0x2026
-0x2145 = 0x2025
-0x2146 = 0x2018
-0x2147 = 0x2019
-0x2148 = 0x201C
-0x2149 = 0x201D
-0x214A = 0xFF08
-0x214B = 0xFF09
-0x214C = 0x3014
-0x214D = 0x3015
-0x214E = 0xFF3B
-0x214F = 0xFF3D
-0x2150 = 0xFF5B
-0x2151 = 0xFF5D
-0x2152 = 0x3008
-0x2153 = 0x3009
-0x2154 = 0x300A
-0x2155 = 0x300B
-0x2156 = 0x300C
-0x2157 = 0x300D
-0x2158 = 0x300E
-0x2159 = 0x300F
-0x215A = 0x3010
-0x215B = 0x3011
-0x215C = 0xFF0B
-0x215D = 0xFF0D
-0x215E = 0x00B1
-0x215F = 0x00D7
-0x2160 = 0x00F7
-0x2161 = 0xFF1D
-0x2162 = 0x2260
-0x2163 = 0xFF1C
-0x2164 = 0xFF1E
-0x2165 = 0x2266
-0x2166 = 0x2267
-0x2167 = 0x221E
-0x2168 = 0x2234
-0x2169 = 0x2642
-0x216A = 0x2640
-0x216B = 0x00B0
-0x216C = 0x2032
-0x216D = 0x2033
-0x216E = 0x2103
-0x216F = 0xFFE5
-0x2170 = 0xFF04
-0x2171 = 0xFFE0
-0x2172 = 0xFFE1
-0x2173 = 0xFF05
-0x2174 = 0xFF03
-0x2175 = 0xFF06
-0x2176 = 0xFF0A
-0x2177 = 0xFF20
-0x2178 = 0x00A7
-0x2179 = 0x2606
-0x217A = 0x2605
-0x217B = 0x25CB
-0x217C = 0x25CF
-0x217D = 0x25CE
-0x217E = 0x25C7
-0x2221 = 0x25C6
-0x2222 = 0x25A1
-0x2223 = 0x25A0
-0x2224 = 0x25B3
-0x2225 = 0x25B2
-0x2226 = 0x25BD
-0x2227 = 0x25BC
-0x2228 = 0x203B
-0x2229 = 0x3012
-0x222A = 0x2192
-0x222B = 0x2190
-0x222C = 0x2191
-0x222D = 0x2193
-0x222E = 0x3013
-0x223A = 0x2208
-0x223B = 0x220B
-0x223C = 0x2286
-0x223D = 0x2287
-0x223E = 0x2282
-0x223F = 0x2283
-0x2240 = 0x222A
-0x2241 = 0x2229
-0x224A = 0x2227
-0x224B = 0x2228
-0x224C = 0xFFE2
-0x224D = 0x21D2
-0x224E = 0x21D4
-0x224F = 0x2200
-0x2250 = 0x2203
-0x225C = 0x2220
-0x225D = 0x22A5
-0x225E = 0x2312
-0x225F = 0x2202
-0x2260 = 0x2207
-0x2261 = 0x2261
-0x2262 = 0x2252
-0x2263 = 0x226A
-0x2264 = 0x226B
-0x2265 = 0x221A
-0x2266 = 0x223D
-0x2267 = 0x221D
-0x2268 = 0x2235
-0x2269 = 0x222B
-0x226A = 0x222C
-0x2272 = 0x212B
-0x2273 = 0x2030
-0x2274 = 0x266F
-0x2275 = 0x266D
-0x2276 = 0x266A
-0x2277 = 0x2020
-0x2278 = 0x2021
-0x2279 = 0x00B6
-0x227E = 0x25EF
-0x2330 = 0xFF10
-0x2331 = 0xFF11
-0x2332 = 0xFF12
-0x2333 = 0xFF13
-0x2334 = 0xFF14
-0x2335 = 0xFF15
-0x2336 = 0xFF16
-0x2337 = 0xFF17
-0x2338 = 0xFF18
-0x2339 = 0xFF19
-0x2341 = 0xFF21
-0x2342 = 0xFF22
-0x2343 = 0xFF23
-0x2344 = 0xFF24
-0x2345 = 0xFF25
-0x2346 = 0xFF26
-0x2347 = 0xFF27
-0x2348 = 0xFF28
-0x2349 = 0xFF29
-0x234A = 0xFF2A
-0x234B = 0xFF2B
-0x234C = 0xFF2C
-0x234D = 0xFF2D
-0x234E = 0xFF2E
-0x234F = 0xFF2F
-0x2350 = 0xFF30
-0x2351 = 0xFF31
-0x2352 = 0xFF32
-0x2353 = 0xFF33
-0x2354 = 0xFF34
-0x2355 = 0xFF35
-0x2356 = 0xFF36
-0x2357 = 0xFF37
-0x2358 = 0xFF38
-0x2359 = 0xFF39
-0x235A = 0xFF3A
-0x2361 = 0xFF41
-0x2362 = 0xFF42
-0x2363 = 0xFF43
-0x2364 = 0xFF44
-0x2365 = 0xFF45
-0x2366 = 0xFF46
-0x2367 = 0xFF47
-0x2368 = 0xFF48
-0x2369 = 0xFF49
-0x236A = 0xFF4A
-0x236B = 0xFF4B
-0x236C = 0xFF4C
-0x236D = 0xFF4D
-0x236E = 0xFF4E
-0x236F = 0xFF4F
-0x2370 = 0xFF50
-0x2371 = 0xFF51
-0x2372 = 0xFF52
-0x2373 = 0xFF53
-0x2374 = 0xFF54
-0x2375 = 0xFF55
-0x2376 = 0xFF56
-0x2377 = 0xFF57
-0x2378 = 0xFF58
-0x2379 = 0xFF59
-0x237A = 0xFF5A
-0x2421 = 0x3041
-0x2422 = 0x3042
-0x2423 = 0x3043
-0x2424 = 0x3044
-0x2425 = 0x3045
-0x2426 = 0x3046
-0x2427 = 0x3047
-0x2428 = 0x3048
-0x2429 = 0x3049
-0x242A = 0x304A
-0x242B = 0x304B
-0x242C = 0x304C
-0x242D = 0x304D
-0x242E = 0x304E
-0x242F = 0x304F
-0x2430 = 0x3050
-0x2431 = 0x3051
-0x2432 = 0x3052
-0x2433 = 0x3053
-0x2434 = 0x3054
-0x2435 = 0x3055
-0x2436 = 0x3056
-0x2437 = 0x3057
-0x2438 = 0x3058
-0x2439 = 0x3059
-0x243A = 0x305A
-0x243B = 0x305B
-0x243C = 0x305C
-0x243D = 0x305D
-0x243E = 0x305E
-0x243F = 0x305F
-0x2440 = 0x3060
-0x2441 = 0x3061
-0x2442 = 0x3062
-0x2443 = 0x3063
-0x2444 = 0x3064
-0x2445 = 0x3065
-0x2446 = 0x3066
-0x2447 = 0x3067
-0x2448 = 0x3068
-0x2449 = 0x3069
-0x244A = 0x306A
-0x244B = 0x306B
-0x244C = 0x306C
-0x244D = 0x306D
-0x244E = 0x306E
-0x244F = 0x306F
-0x2450 = 0x3070
-0x2451 = 0x3071
-0x2452 = 0x3072
-0x2453 = 0x3073
-0x2454 = 0x3074
-0x2455 = 0x3075
-0x2456 = 0x3076
-0x2457 = 0x3077
-0x2458 = 0x3078
-0x2459 = 0x3079
-0x245A = 0x307A
-0x245B = 0x307B
-0x245C = 0x307C
-0x245D = 0x307D
-0x245E = 0x307E
-0x245F = 0x307F
-0x2460 = 0x3080
-0x2461 = 0x3081
-0x2462 = 0x3082
-0x2463 = 0x3083
-0x2464 = 0x3084
-0x2465 = 0x3085
-0x2466 = 0x3086
-0x2467 = 0x3087
-0x2468 = 0x3088
-0x2469 = 0x3089
-0x246A = 0x308A
-0x246B = 0x308B
-0x246C = 0x308C
-0x246D = 0x308D
-0x246E = 0x308E
-0x246F = 0x308F
-0x2470 = 0x3090
-0x2471 = 0x3091
-0x2472 = 0x3092
-0x2473 = 0x3093
-0x2521 = 0x30A1
-0x2522 = 0x30A2
-0x2523 = 0x30A3
-0x2524 = 0x30A4
-0x2525 = 0x30A5
-0x2526 = 0x30A6
-0x2527 = 0x30A7
-0x2528 = 0x30A8
-0x2529 = 0x30A9
-0x252A = 0x30AA
-0x252B = 0x30AB
-0x252C = 0x30AC
-0x252D = 0x30AD
-0x252E = 0x30AE
-0x252F = 0x30AF
-0x2530 = 0x30B0
-0x2531 = 0x30B1
-0x2532 = 0x30B2
-0x2533 = 0x30B3
-0x2534 = 0x30B4
-0x2535 = 0x30B5
-0x2536 = 0x30B6
-0x2537 = 0x30B7
-0x2538 = 0x30B8
-0x2539 = 0x30B9
-0x253A = 0x30BA
-0x253B = 0x30BB
-0x253C = 0x30BC
-0x253D = 0x30BD
-0x253E = 0x30BE
-0x253F = 0x30BF
-0x2540 = 0x30C0
-0x2541 = 0x30C1
-0x2542 = 0x30C2
-0x2543 = 0x30C3
-0x2544 = 0x30C4
-0x2545 = 0x30C5
-0x2546 = 0x30C6
-0x2547 = 0x30C7
-0x2548 = 0x30C8
-0x2549 = 0x30C9
-0x254A = 0x30CA
-0x254B = 0x30CB
-0x254C = 0x30CC
-0x254D = 0x30CD
-0x254E = 0x30CE
-0x254F = 0x30CF
-0x2550 = 0x30D0
-0x2551 = 0x30D1
-0x2552 = 0x30D2
-0x2553 = 0x30D3
-0x2554 = 0x30D4
-0x2555 = 0x30D5
-0x2556 = 0x30D6
-0x2557 = 0x30D7
-0x2558 = 0x30D8
-0x2559 = 0x30D9
-0x255A = 0x30DA
-0x255B = 0x30DB
-0x255C = 0x30DC
-0x255D = 0x30DD
-0x255E = 0x30DE
-0x255F = 0x30DF
-0x2560 = 0x30E0
-0x2561 = 0x30E1
-0x2562 = 0x30E2
-0x2563 = 0x30E3
-0x2564 = 0x30E4
-0x2565 = 0x30E5
-0x2566 = 0x30E6
-0x2567 = 0x30E7
-0x2568 = 0x30E8
-0x2569 = 0x30E9
-0x256A = 0x30EA
-0x256B = 0x30EB
-0x256C = 0x30EC
-0x256D = 0x30ED
-0x256E = 0x30EE
-0x256F = 0x30EF
-0x2570 = 0x30F0
-0x2571 = 0x30F1
-0x2572 = 0x30F2
-0x2573 = 0x30F3
-0x2574 = 0x30F4
-0x2575 = 0x30F5
-0x2576 = 0x30F6
-0x2621 = 0x0391
-0x2622 = 0x0392
-0x2623 = 0x0393
-0x2624 = 0x0394
-0x2625 = 0x0395
-0x2626 = 0x0396
-0x2627 = 0x0397
-0x2628 = 0x0398
-0x2629 = 0x0399
-0x262A = 0x039A
-0x262B = 0x039B
-0x262C = 0x039C
-0x262D = 0x039D
-0x262E = 0x039E
-0x262F = 0x039F
-0x2630 = 0x03A0
-0x2631 = 0x03A1
-0x2632 = 0x03A3
-0x2633 = 0x03A4
-0x2634 = 0x03A5
-0x2635 = 0x03A6
-0x2636 = 0x03A7
-0x2637 = 0x03A8
-0x2638 = 0x03A9
-0x2641 = 0x03B1
-0x2642 = 0x03B2
-0x2643 = 0x03B3
-0x2644 = 0x03B4
-0x2645 = 0x03B5
-0x2646 = 0x03B6
-0x2647 = 0x03B7
-0x2648 = 0x03B8
-0x2649 = 0x03B9
-0x264A = 0x03BA
-0x264B = 0x03BB
-0x264C = 0x03BC
-0x264D = 0x03BD
-0x264E = 0x03BE
-0x264F = 0x03BF
-0x2650 = 0x03C0
-0x2651 = 0x03C1
-0x2652 = 0x03C3
-0x2653 = 0x03C4
-0x2654 = 0x03C5
-0x2655 = 0x03C6
-0x2656 = 0x03C7
-0x2657 = 0x03C8
-0x2658 = 0x03C9
-0x2721 = 0x0410
-0x2722 = 0x0411
-0x2723 = 0x0412
-0x2724 = 0x0413
-0x2725 = 0x0414
-0x2726 = 0x0415
-0x2727 = 0x0401
-0x2728 = 0x0416
-0x2729 = 0x0417
-0x272A = 0x0418
-0x272B = 0x0419
-0x272C = 0x041A
-0x272D = 0x041B
-0x272E = 0x041C
-0x272F = 0x041D
-0x2730 = 0x041E
-0x2731 = 0x041F
-0x2732 = 0x0420
-0x2733 = 0x0421
-0x2734 = 0x0422
-0x2735 = 0x0423
-0x2736 = 0x0424
-0x2737 = 0x0425
-0x2738 = 0x0426
-0x2739 = 0x0427
-0x273A = 0x0428
-0x273B = 0x0429
-0x273C = 0x042A
-0x273D = 0x042B
-0x273E = 0x042C
-0x273F = 0x042D
-0x2740 = 0x042E
-0x2741 = 0x042F
-0x2751 = 0x0430
-0x2752 = 0x0431
-0x2753 = 0x0432
-0x2754 = 0x0433
-0x2755 = 0x0434
-0x2756 = 0x0435
-0x2757 = 0x0451
-0x2758 = 0x0436
-0x2759 = 0x0437
-0x275A = 0x0438
-0x275B = 0x0439
-0x275C = 0x043A
-0x275D = 0x043B
-0x275E = 0x043C
-0x275F = 0x043D
-0x2760 = 0x043E
-0x2761 = 0x043F
-0x2762 = 0x0440
-0x2763 = 0x0441
-0x2764 = 0x0442
-0x2765 = 0x0443
-0x2766 = 0x0444
-0x2767 = 0x0445
-0x2768 = 0x0446
-0x2769 = 0x0447
-0x276A = 0x0448
-0x276B = 0x0449
-0x276C = 0x044A
-0x276D = 0x044B
-0x276E = 0x044C
-0x276F = 0x044D
-0x2770 = 0x044E
-0x2771 = 0x044F
-0x2821 = 0x2500
-0x2822 = 0x2502
-0x2823 = 0x250C
-0x2824 = 0x2510
-0x2825 = 0x2518
-0x2826 = 0x2514
-0x2827 = 0x251C
-0x2828 = 0x252C
-0x2829 = 0x2524
-0x282A = 0x2534
-0x282B = 0x253C
-0x282C = 0x2501
-0x282D = 0x2503
-0x282E = 0x250F
-0x282F = 0x2513
-0x2830 = 0x251B
-0x2831 = 0x2517
-0x2832 = 0x2523
-0x2833 = 0x2533
-0x2834 = 0x252B
-0x2835 = 0x253B
-0x2836 = 0x254B
-0x2837 = 0x2520
-0x2838 = 0x252F
-0x2839 = 0x2528
-0x283A = 0x2537
-0x283B = 0x253F
-0x283C = 0x251D
-0x283D = 0x2530
-0x283E = 0x2525
-0x283F = 0x2538
-0x2840 = 0x2542
-0x3021 = 0x4E9C
-0x3022 = 0x5516
-0x3023 = 0x5A03
-0x3024 = 0x963F
-0x3025 = 0x54C0
-0x3026 = 0x611B
-0x3027 = 0x6328
-0x3028 = 0x59F6
-0x3029 = 0x9022
-0x302A = 0x8475
-0x302B = 0x831C
-0x302C = 0x7A50
-0x302D = 0x60AA
-0x302E = 0x63E1
-0x302F = 0x6E25
-0x3030 = 0x65ED
-0x3031 = 0x8466
-0x3032 = 0x82A6
-0x3033 = 0x9BF5
-0x3034 = 0x6893
-0x3035 = 0x5727
-0x3036 = 0x65A1
-0x3037 = 0x6271
-0x3038 = 0x5B9B
-0x3039 = 0x59D0
-0x303A = 0x867B
-0x303B = 0x98F4
-0x303C = 0x7D62
-0x303D = 0x7DBE
-0x303E = 0x9B8E
-0x303F = 0x6216
-0x3040 = 0x7C9F
-0x3041 = 0x88B7
-0x3042 = 0x5B89
-0x3043 = 0x5EB5
-0x3044 = 0x6309
-0x3045 = 0x6697
-0x3046 = 0x6848
-0x3047 = 0x95C7
-0x3048 = 0x978D
-0x3049 = 0x674F
-0x304A = 0x4EE5
-0x304B = 0x4F0A
-0x304C = 0x4F4D
-0x304D = 0x4F9D
-0x304E = 0x5049
-0x304F = 0x56F2
-0x3050 = 0x5937
-0x3051 = 0x59D4
-0x3052 = 0x5A01
-0x3053 = 0x5C09
-0x3054 = 0x60DF
-0x3055 = 0x610F
-0x3056 = 0x6170
-0x3057 = 0x6613
-0x3058 = 0x6905
-0x3059 = 0x70BA
-0x305A = 0x754F
-0x305B = 0x7570
-0x305C = 0x79FB
-0x305D = 0x7DAD
-0x305E = 0x7DEF
-0x305F = 0x80C3
-0x3060 = 0x840E
-0x3061 = 0x8863
-0x3062 = 0x8B02
-0x3063 = 0x9055
-0x3064 = 0x907A
-0x3065 = 0x533B
-0x3066 = 0x4E95
-0x3067 = 0x4EA5
-0x3068 = 0x57DF
-0x3069 = 0x80B2
-0x306A = 0x90C1
-0x306B = 0x78EF
-0x306C = 0x4E00
-0x306D = 0x58F1
-0x306E = 0x6EA2
-0x306F = 0x9038
-0x3070 = 0x7A32
-0x3071 = 0x8328
-0x3072 = 0x828B
-0x3073 = 0x9C2F
-0x3074 = 0x5141
-0x3075 = 0x5370
-0x3076 = 0x54BD
-0x3077 = 0x54E1
-0x3078 = 0x56E0
-0x3079 = 0x59FB
-0x307A = 0x5F15
-0x307B = 0x98F2
-0x307C = 0x6DEB
-0x307D = 0x80E4
-0x307E = 0x852D
-0x3121 = 0x9662
-0x3122 = 0x9670
-0x3123 = 0x96A0
-0x3124 = 0x97FB
-0x3125 = 0x540B
-0x3126 = 0x53F3
-0x3127 = 0x5B87
-0x3128 = 0x70CF
-0x3129 = 0x7FBD
-0x312A = 0x8FC2
-0x312B = 0x96E8
-0x312C = 0x536F
-0x312D = 0x9D5C
-0x312E = 0x7ABA
-0x312F = 0x4E11
-0x3130 = 0x7893
-0x3131 = 0x81FC
-0x3132 = 0x6E26
-0x3133 = 0x5618
-0x3134 = 0x5504
-0x3135 = 0x6B1D
-0x3136 = 0x851A
-0x3137 = 0x9C3B
-0x3138 = 0x59E5
-0x3139 = 0x53A9
-0x313A = 0x6D66
-0x313B = 0x74DC
-0x313C = 0x958F
-0x313D = 0x5642
-0x313E = 0x4E91
-0x313F = 0x904B
-0x3140 = 0x96F2
-0x3141 = 0x834F
-0x3142 = 0x990C
-0x3143 = 0x53E1
-0x3144 = 0x55B6
-0x3145 = 0x5B30
-0x3146 = 0x5F71
-0x3147 = 0x6620
-0x3148 = 0x66F3
-0x3149 = 0x6804
-0x314A = 0x6C38
-0x314B = 0x6CF3
-0x314C = 0x6D29
-0x314D = 0x745B
-0x314E = 0x76C8
-0x314F = 0x7A4E
-0x3150 = 0x9834
-0x3151 = 0x82F1
-0x3152 = 0x885B
-0x3153 = 0x8A60
-0x3154 = 0x92ED
-0x3155 = 0x6DB2
-0x3156 = 0x75AB
-0x3157 = 0x76CA
-0x3158 = 0x99C5
-0x3159 = 0x60A6
-0x315A = 0x8B01
-0x315B = 0x8D8A
-0x315C = 0x95B2
-0x315D = 0x698E
-0x315E = 0x53AD
-0x315F = 0x5186
-0x3160 = 0x5712
-0x3161 = 0x5830
-0x3162 = 0x5944
-0x3163 = 0x5BB4
-0x3164 = 0x5EF6
-0x3165 = 0x6028
-0x3166 = 0x63A9
-0x3167 = 0x63F4
-0x3168 = 0x6CBF
-0x3169 = 0x6F14
-0x316A = 0x708E
-0x316B = 0x7114
-0x316C = 0x7159
-0x316D = 0x71D5
-0x316E = 0x733F
-0x316F = 0x7E01
-0x3170 = 0x8276
-0x3171 = 0x82D1
-0x3172 = 0x8597
-0x3173 = 0x9060
-0x3174 = 0x925B
-0x3175 = 0x9D1B
-0x3176 = 0x5869
-0x3177 = 0x65BC
-0x3178 = 0x6C5A
-0x3179 = 0x7525
-0x317A = 0x51F9
-0x317B = 0x592E
-0x317C = 0x5965
-0x317D = 0x5F80
-0x317E = 0x5FDC
-0x3221 = 0x62BC
-0x3222 = 0x65FA
-0x3223 = 0x6A2A
-0x3224 = 0x6B27
-0x3225 = 0x6BB4
-0x3226 = 0x738B
-0x3227 = 0x7FC1
-0x3228 = 0x8956
-0x3229 = 0x9D2C
-0x322A = 0x9D0E
-0x322B = 0x9EC4
-0x322C = 0x5CA1
-0x322D = 0x6C96
-0x322E = 0x837B
-0x322F = 0x5104
-0x3230 = 0x5C4B
-0x3231 = 0x61B6
-0x3232 = 0x81C6
-0x3233 = 0x6876
-0x3234 = 0x7261
-0x3235 = 0x4E59
-0x3236 = 0x4FFA
-0x3237 = 0x5378
-0x3238 = 0x6069
-0x3239 = 0x6E29
-0x323A = 0x7A4F
-0x323B = 0x97F3
-0x323C = 0x4E0B
-0x323D = 0x5316
-0x323E = 0x4EEE
-0x323F = 0x4F55
-0x3240 = 0x4F3D
-0x3241 = 0x4FA1
-0x3242 = 0x4F73
-0x3243 = 0x52A0
-0x3244 = 0x53EF
-0x3245 = 0x5609
-0x3246 = 0x590F
-0x3247 = 0x5AC1
-0x3248 = 0x5BB6
-0x3249 = 0x5BE1
-0x324A = 0x79D1
-0x324B = 0x6687
-0x324C = 0x679C
-0x324D = 0x67B6
-0x324E = 0x6B4C
-0x324F = 0x6CB3
-0x3250 = 0x706B
-0x3251 = 0x73C2
-0x3252 = 0x798D
-0x3253 = 0x79BE
-0x3254 = 0x7A3C
-0x3255 = 0x7B87
-0x3256 = 0x82B1
-0x3257 = 0x82DB
-0x3258 = 0x8304
-0x3259 = 0x8377
-0x325A = 0x83EF
-0x325B = 0x83D3
-0x325C = 0x8766
-0x325D = 0x8AB2
-0x325E = 0x5629
-0x325F = 0x8CA8
-0x3260 = 0x8FE6
-0x3261 = 0x904E
-0x3262 = 0x971E
-0x3263 = 0x868A
-0x3264 = 0x4FC4
-0x3265 = 0x5CE8
-0x3266 = 0x6211
-0x3267 = 0x7259
-0x3268 = 0x753B
-0x3269 = 0x81E5
-0x326A = 0x82BD
-0x326B = 0x86FE
-0x326C = 0x8CC0
-0x326D = 0x96C5
-0x326E = 0x9913
-0x326F = 0x99D5
-0x3270 = 0x4ECB
-0x3271 = 0x4F1A
-0x3272 = 0x89E3
-0x3273 = 0x56DE
-0x3274 = 0x584A
-0x3275 = 0x58CA
-0x3276 = 0x5EFB
-0x3277 = 0x5FEB
-0x3278 = 0x602A
-0x3279 = 0x6094
-0x327A = 0x6062
-0x327B = 0x61D0
-0x327C = 0x6212
-0x327D = 0x62D0
-0x327E = 0x6539
-0x3321 = 0x9B41
-0x3322 = 0x6666
-0x3323 = 0x68B0
-0x3324 = 0x6D77
-0x3325 = 0x7070
-0x3326 = 0x754C
-0x3327 = 0x7686
-0x3328 = 0x7D75
-0x3329 = 0x82A5
-0x332A = 0x87F9
-0x332B = 0x958B
-0x332C = 0x968E
-0x332D = 0x8C9D
-0x332E = 0x51F1
-0x332F = 0x52BE
-0x3330 = 0x5916
-0x3331 = 0x54B3
-0x3332 = 0x5BB3
-0x3333 = 0x5D16
-0x3334 = 0x6168
-0x3335 = 0x6982
-0x3336 = 0x6DAF
-0x3337 = 0x788D
-0x3338 = 0x84CB
-0x3339 = 0x8857
-0x333A = 0x8A72
-0x333B = 0x93A7
-0x333C = 0x9AB8
-0x333D = 0x6D6C
-0x333E = 0x99A8
-0x333F = 0x86D9
-0x3340 = 0x57A3
-0x3341 = 0x67FF
-0x3342 = 0x86CE
-0x3343 = 0x920E
-0x3344 = 0x5283
-0x3345 = 0x5687
-0x3346 = 0x5404
-0x3347 = 0x5ED3
-0x3348 = 0x62E1
-0x3349 = 0x64B9
-0x334A = 0x683C
-0x334B = 0x6838
-0x334C = 0x6BBB
-0x334D = 0x7372
-0x334E = 0x78BA
-0x334F = 0x7A6B
-0x3350 = 0x899A
-0x3351 = 0x89D2
-0x3352 = 0x8D6B
-0x3353 = 0x8F03
-0x3354 = 0x90ED
-0x3355 = 0x95A3
-0x3356 = 0x9694
-0x3357 = 0x9769
-0x3358 = 0x5B66
-0x3359 = 0x5CB3
-0x335A = 0x697D
-0x335B = 0x984D
-0x335C = 0x984E
-0x335D = 0x639B
-0x335E = 0x7B20
-0x335F = 0x6A2B
-0x3360 = 0x6A7F
-0x3361 = 0x68B6
-0x3362 = 0x9C0D
-0x3363 = 0x6F5F
-0x3364 = 0x5272
-0x3365 = 0x559D
-0x3366 = 0x6070
-0x3367 = 0x62EC
-0x3368 = 0x6D3B
-0x3369 = 0x6E07
-0x336A = 0x6ED1
-0x336B = 0x845B
-0x336C = 0x8910
-0x336D = 0x8F44
-0x336E = 0x4E14
-0x336F = 0x9C39
-0x3370 = 0x53F6
-0x3371 = 0x691B
-0x3372 = 0x6A3A
-0x3373 = 0x9784
-0x3374 = 0x682A
-0x3375 = 0x515C
-0x3376 = 0x7AC3
-0x3377 = 0x84B2
-0x3378 = 0x91DC
-0x3379 = 0x938C
-0x337A = 0x565B
-0x337B = 0x9D28
-0x337C = 0x6822
-0x337D = 0x8305
-0x337E = 0x8431
-0x3421 = 0x7CA5
-0x3422 = 0x5208
-0x3423 = 0x82C5
-0x3424 = 0x74E6
-0x3425 = 0x4E7E
-0x3426 = 0x4F83
-0x3427 = 0x51A0
-0x3428 = 0x5BD2
-0x3429 = 0x520A
-0x342A = 0x52D8
-0x342B = 0x52E7
-0x342C = 0x5DFB
-0x342D = 0x559A
-0x342E = 0x582A
-0x342F = 0x59E6
-0x3430 = 0x5B8C
-0x3431 = 0x5B98
-0x3432 = 0x5BDB
-0x3433 = 0x5E72
-0x3434 = 0x5E79
-0x3435 = 0x60A3
-0x3436 = 0x611F
-0x3437 = 0x6163
-0x3438 = 0x61BE
-0x3439 = 0x63DB
-0x343A = 0x6562
-0x343B = 0x67D1
-0x343C = 0x6853
-0x343D = 0x68FA
-0x343E = 0x6B3E
-0x343F = 0x6B53
-0x3440 = 0x6C57
-0x3441 = 0x6F22
-0x3442 = 0x6F97
-0x3443 = 0x6F45
-0x3444 = 0x74B0
-0x3445 = 0x7518
-0x3446 = 0x76E3
-0x3447 = 0x770B
-0x3448 = 0x7AFF
-0x3449 = 0x7BA1
-0x344A = 0x7C21
-0x344B = 0x7DE9
-0x344C = 0x7F36
-0x344D = 0x7FF0
-0x344E = 0x809D
-0x344F = 0x8266
-0x3450 = 0x839E
-0x3451 = 0x89B3
-0x3452 = 0x8ACC
-0x3453 = 0x8CAB
-0x3454 = 0x9084
-0x3455 = 0x9451
-0x3456 = 0x9593
-0x3457 = 0x9591
-0x3458 = 0x95A2
-0x3459 = 0x9665
-0x345A = 0x97D3
-0x345B = 0x9928
-0x345C = 0x8218
-0x345D = 0x4E38
-0x345E = 0x542B
-0x345F = 0x5CB8
-0x3460 = 0x5DCC
-0x3461 = 0x73A9
-0x3462 = 0x764C
-0x3463 = 0x773C
-0x3464 = 0x5CA9
-0x3465 = 0x7FEB
-0x3466 = 0x8D0B
-0x3467 = 0x96C1
-0x3468 = 0x9811
-0x3469 = 0x9854
-0x346A = 0x9858
-0x346B = 0x4F01
-0x346C = 0x4F0E
-0x346D = 0x5371
-0x346E = 0x559C
-0x346F = 0x5668
-0x3470 = 0x57FA
-0x3471 = 0x5947
-0x3472 = 0x5B09
-0x3473 = 0x5BC4
-0x3474 = 0x5C90
-0x3475 = 0x5E0C
-0x3476 = 0x5E7E
-0x3477 = 0x5FCC
-0x3478 = 0x63EE
-0x3479 = 0x673A
-0x347A = 0x65D7
-0x347B = 0x65E2
-0x347C = 0x671F
-0x347D = 0x68CB
-0x347E = 0x68C4
-0x3521 = 0x6A5F
-0x3522 = 0x5E30
-0x3523 = 0x6BC5
-0x3524 = 0x6C17
-0x3525 = 0x6C7D
-0x3526 = 0x757F
-0x3527 = 0x7948
-0x3528 = 0x5B63
-0x3529 = 0x7A00
-0x352A = 0x7D00
-0x352B = 0x5FBD
-0x352C = 0x898F
-0x352D = 0x8A18
-0x352E = 0x8CB4
-0x352F = 0x8D77
-0x3530 = 0x8ECC
-0x3531 = 0x8F1D
-0x3532 = 0x98E2
-0x3533 = 0x9A0E
-0x3534 = 0x9B3C
-0x3535 = 0x4E80
-0x3536 = 0x507D
-0x3537 = 0x5100
-0x3538 = 0x5993
-0x3539 = 0x5B9C
-0x353A = 0x622F
-0x353B = 0x6280
-0x353C = 0x64EC
-0x353D = 0x6B3A
-0x353E = 0x72A0
-0x353F = 0x7591
-0x3540 = 0x7947
-0x3541 = 0x7FA9
-0x3542 = 0x87FB
-0x3543 = 0x8ABC
-0x3544 = 0x8B70
-0x3545 = 0x63AC
-0x3546 = 0x83CA
-0x3547 = 0x97A0
-0x3548 = 0x5409
-0x3549 = 0x5403
-0x354A = 0x55AB
-0x354B = 0x6854
-0x354C = 0x6A58
-0x354D = 0x8A70
-0x354E = 0x7827
-0x354F = 0x6775
-0x3550 = 0x9ECD
-0x3551 = 0x5374
-0x3552 = 0x5BA2
-0x3553 = 0x811A
-0x3554 = 0x8650
-0x3555 = 0x9006
-0x3556 = 0x4E18
-0x3557 = 0x4E45
-0x3558 = 0x4EC7
-0x3559 = 0x4F11
-0x355A = 0x53CA
-0x355B = 0x5438
-0x355C = 0x5BAE
-0x355D = 0x5F13
-0x355E = 0x6025
-0x355F = 0x6551
-0x3560 = 0x673D
-0x3561 = 0x6C42
-0x3562 = 0x6C72
-0x3563 = 0x6CE3
-0x3564 = 0x7078
-0x3565 = 0x7403
-0x3566 = 0x7A76
-0x3567 = 0x7AAE
-0x3568 = 0x7B08
-0x3569 = 0x7D1A
-0x356A = 0x7CFE
-0x356B = 0x7D66
-0x356C = 0x65E7
-0x356D = 0x725B
-0x356E = 0x53BB
-0x356F = 0x5C45
-0x3570 = 0x5DE8
-0x3571 = 0x62D2
-0x3572 = 0x62E0
-0x3573 = 0x6319
-0x3574 = 0x6E20
-0x3575 = 0x865A
-0x3576 = 0x8A31
-0x3577 = 0x8DDD
-0x3578 = 0x92F8
-0x3579 = 0x6F01
-0x357A = 0x79A6
-0x357B = 0x9B5A
-0x357C = 0x4EA8
-0x357D = 0x4EAB
-0x357E = 0x4EAC
-0x3621 = 0x4F9B
-0x3622 = 0x4FA0
-0x3623 = 0x50D1
-0x3624 = 0x5147
-0x3625 = 0x7AF6
-0x3626 = 0x5171
-0x3627 = 0x51F6
-0x3628 = 0x5354
-0x3629 = 0x5321
-0x362A = 0x537F
-0x362B = 0x53EB
-0x362C = 0x55AC
-0x362D = 0x5883
-0x362E = 0x5CE1
-0x362F = 0x5F37
-0x3630 = 0x5F4A
-0x3631 = 0x602F
-0x3632 = 0x6050
-0x3633 = 0x606D
-0x3634 = 0x631F
-0x3635 = 0x6559
-0x3636 = 0x6A4B
-0x3637 = 0x6CC1
-0x3638 = 0x72C2
-0x3639 = 0x72ED
-0x363A = 0x77EF
-0x363B = 0x80F8
-0x363C = 0x8105
-0x363D = 0x8208
-0x363E = 0x854E
-0x363F = 0x90F7
-0x3640 = 0x93E1
-0x3641 = 0x97FF
-0x3642 = 0x9957
-0x3643 = 0x9A5A
-0x3644 = 0x4EF0
-0x3645 = 0x51DD
-0x3646 = 0x5C2D
-0x3647 = 0x6681
-0x3648 = 0x696D
-0x3649 = 0x5C40
-0x364A = 0x66F2
-0x364B = 0x6975
-0x364C = 0x7389
-0x364D = 0x6850
-0x364E = 0x7C81
-0x364F = 0x50C5
-0x3650 = 0x52E4
-0x3651 = 0x5747
-0x3652 = 0x5DFE
-0x3653 = 0x9326
-0x3654 = 0x65A4
-0x3655 = 0x6B23
-0x3656 = 0x6B3D
-0x3657 = 0x7434
-0x3658 = 0x7981
-0x3659 = 0x79BD
-0x365A = 0x7B4B
-0x365B = 0x7DCA
-0x365C = 0x82B9
-0x365D = 0x83CC
-0x365E = 0x887F
-0x365F = 0x895F
-0x3660 = 0x8B39
-0x3661 = 0x8FD1
-0x3662 = 0x91D1
-0x3663 = 0x541F
-0x3664 = 0x9280
-0x3665 = 0x4E5D
-0x3666 = 0x5036
-0x3667 = 0x53E5
-0x3668 = 0x533A
-0x3669 = 0x72D7
-0x366A = 0x7396
-0x366B = 0x77E9
-0x366C = 0x82E6
-0x366D = 0x8EAF
-0x366E = 0x99C6
-0x366F = 0x99C8
-0x3670 = 0x99D2
-0x3671 = 0x5177
-0x3672 = 0x611A
-0x3673 = 0x865E
-0x3674 = 0x55B0
-0x3675 = 0x7A7A
-0x3676 = 0x5076
-0x3677 = 0x5BD3
-0x3678 = 0x9047
-0x3679 = 0x9685
-0x367A = 0x4E32
-0x367B = 0x6ADB
-0x367C = 0x91E7
-0x367D = 0x5C51
-0x367E = 0x5C48
-0x3721 = 0x6398
-0x3722 = 0x7A9F
-0x3723 = 0x6C93
-0x3724 = 0x9774
-0x3725 = 0x8F61
-0x3726 = 0x7AAA
-0x3727 = 0x718A
-0x3728 = 0x9688
-0x3729 = 0x7C82
-0x372A = 0x6817
-0x372B = 0x7E70
-0x372C = 0x6851
-0x372D = 0x936C
-0x372E = 0x52F2
-0x372F = 0x541B
-0x3730 = 0x85AB
-0x3731 = 0x8A13
-0x3732 = 0x7FA4
-0x3733 = 0x8ECD
-0x3734 = 0x90E1
-0x3735 = 0x5366
-0x3736 = 0x8888
-0x3737 = 0x7941
-0x3738 = 0x4FC2
-0x3739 = 0x50BE
-0x373A = 0x5211
-0x373B = 0x5144
-0x373C = 0x5553
-0x373D = 0x572D
-0x373E = 0x73EA
-0x373F = 0x578B
-0x3740 = 0x5951
-0x3741 = 0x5F62
-0x3742 = 0x5F84
-0x3743 = 0x6075
-0x3744 = 0x6176
-0x3745 = 0x6167
-0x3746 = 0x61A9
-0x3747 = 0x63B2
-0x3748 = 0x643A
-0x3749 = 0x656C
-0x374A = 0x666F
-0x374B = 0x6842
-0x374C = 0x6E13
-0x374D = 0x7566
-0x374E = 0x7A3D
-0x374F = 0x7CFB
-0x3750 = 0x7D4C
-0x3751 = 0x7D99
-0x3752 = 0x7E4B
-0x3753 = 0x7F6B
-0x3754 = 0x830E
-0x3755 = 0x834A
-0x3756 = 0x86CD
-0x3757 = 0x8A08
-0x3758 = 0x8A63
-0x3759 = 0x8B66
-0x375A = 0x8EFD
-0x375B = 0x981A
-0x375C = 0x9D8F
-0x375D = 0x82B8
-0x375E = 0x8FCE
-0x375F = 0x9BE8
-0x3760 = 0x5287
-0x3761 = 0x621F
-0x3762 = 0x6483
-0x3763 = 0x6FC0
-0x3764 = 0x9699
-0x3765 = 0x6841
-0x3766 = 0x5091
-0x3767 = 0x6B20
-0x3768 = 0x6C7A
-0x3769 = 0x6F54
-0x376A = 0x7A74
-0x376B = 0x7D50
-0x376C = 0x8840
-0x376D = 0x8A23
-0x376E = 0x6708
-0x376F = 0x4EF6
-0x3770 = 0x5039
-0x3771 = 0x5026
-0x3772 = 0x5065
-0x3773 = 0x517C
-0x3774 = 0x5238
-0x3775 = 0x5263
-0x3776 = 0x55A7
-0x3777 = 0x570F
-0x3778 = 0x5805
-0x3779 = 0x5ACC
-0x377A = 0x5EFA
-0x377B = 0x61B2
-0x377C = 0x61F8
-0x377D = 0x62F3
-0x377E = 0x6372
-0x3821 = 0x691C
-0x3822 = 0x6A29
-0x3823 = 0x727D
-0x3824 = 0x72AC
-0x3825 = 0x732E
-0x3826 = 0x7814
-0x3827 = 0x786F
-0x3828 = 0x7D79
-0x3829 = 0x770C
-0x382A = 0x80A9
-0x382B = 0x898B
-0x382C = 0x8B19
-0x382D = 0x8CE2
-0x382E = 0x8ED2
-0x382F = 0x9063
-0x3830 = 0x9375
-0x3831 = 0x967A
-0x3832 = 0x9855
-0x3833 = 0x9A13
-0x3834 = 0x9E78
-0x3835 = 0x5143
-0x3836 = 0x539F
-0x3837 = 0x53B3
-0x3838 = 0x5E7B
-0x3839 = 0x5F26
-0x383A = 0x6E1B
-0x383B = 0x6E90
-0x383C = 0x7384
-0x383D = 0x73FE
-0x383E = 0x7D43
-0x383F = 0x8237
-0x3840 = 0x8A00
-0x3841 = 0x8AFA
-0x3842 = 0x9650
-0x3843 = 0x4E4E
-0x3844 = 0x500B
-0x3845 = 0x53E4
-0x3846 = 0x547C
-0x3847 = 0x56FA
-0x3848 = 0x59D1
-0x3849 = 0x5B64
-0x384A = 0x5DF1
-0x384B = 0x5EAB
-0x384C = 0x5F27
-0x384D = 0x6238
-0x384E = 0x6545
-0x384F = 0x67AF
-0x3850 = 0x6E56
-0x3851 = 0x72D0
-0x3852 = 0x7CCA
-0x3853 = 0x88B4
-0x3854 = 0x80A1
-0x3855 = 0x80E1
-0x3856 = 0x83F0
-0x3857 = 0x864E
-0x3858 = 0x8A87
-0x3859 = 0x8DE8
-0x385A = 0x9237
-0x385B = 0x96C7
-0x385C = 0x9867
-0x385D = 0x9F13
-0x385E = 0x4E94
-0x385F = 0x4E92
-0x3860 = 0x4F0D
-0x3861 = 0x5348
-0x3862 = 0x5449
-0x3863 = 0x543E
-0x3864 = 0x5A2F
-0x3865 = 0x5F8C
-0x3866 = 0x5FA1
-0x3867 = 0x609F
-0x3868 = 0x68A7
-0x3869 = 0x6A8E
-0x386A = 0x745A
-0x386B = 0x7881
-0x386C = 0x8A9E
-0x386D = 0x8AA4
-0x386E = 0x8B77
-0x386F = 0x9190
-0x3870 = 0x4E5E
-0x3871 = 0x9BC9
-0x3872 = 0x4EA4
-0x3873 = 0x4F7C
-0x3874 = 0x4FAF
-0x3875 = 0x5019
-0x3876 = 0x5016
-0x3877 = 0x5149
-0x3878 = 0x516C
-0x3879 = 0x529F
-0x387A = 0x52B9
-0x387B = 0x52FE
-0x387C = 0x539A
-0x387D = 0x53E3
-0x387E = 0x5411
-0x3921 = 0x540E
-0x3922 = 0x5589
-0x3923 = 0x5751
-0x3924 = 0x57A2
-0x3925 = 0x597D
-0x3926 = 0x5B54
-0x3927 = 0x5B5D
-0x3928 = 0x5B8F
-0x3929 = 0x5DE5
-0x392A = 0x5DE7
-0x392B = 0x5DF7
-0x392C = 0x5E78
-0x392D = 0x5E83
-0x392E = 0x5E9A
-0x392F = 0x5EB7
-0x3930 = 0x5F18
-0x3931 = 0x6052
-0x3932 = 0x614C
-0x3933 = 0x6297
-0x3934 = 0x62D8
-0x3935 = 0x63A7
-0x3936 = 0x653B
-0x3937 = 0x6602
-0x3938 = 0x6643
-0x3939 = 0x66F4
-0x393A = 0x676D
-0x393B = 0x6821
-0x393C = 0x6897
-0x393D = 0x69CB
-0x393E = 0x6C5F
-0x393F = 0x6D2A
-0x3940 = 0x6D69
-0x3941 = 0x6E2F
-0x3942 = 0x6E9D
-0x3943 = 0x7532
-0x3944 = 0x7687
-0x3945 = 0x786C
-0x3946 = 0x7A3F
-0x3947 = 0x7CE0
-0x3948 = 0x7D05
-0x3949 = 0x7D18
-0x394A = 0x7D5E
-0x394B = 0x7DB1
-0x394C = 0x8015
-0x394D = 0x8003
-0x394E = 0x80AF
-0x394F = 0x80B1
-0x3950 = 0x8154
-0x3951 = 0x818F
-0x3952 = 0x822A
-0x3953 = 0x8352
-0x3954 = 0x884C
-0x3955 = 0x8861
-0x3956 = 0x8B1B
-0x3957 = 0x8CA2
-0x3958 = 0x8CFC
-0x3959 = 0x90CA
-0x395A = 0x9175
-0x395B = 0x9271
-0x395C = 0x783F
-0x395D = 0x92FC
-0x395E = 0x95A4
-0x395F = 0x964D
-0x3960 = 0x9805
-0x3961 = 0x9999
-0x3962 = 0x9AD8
-0x3963 = 0x9D3B
-0x3964 = 0x525B
-0x3965 = 0x52AB
-0x3966 = 0x53F7
-0x3967 = 0x5408
-0x3968 = 0x58D5
-0x3969 = 0x62F7
-0x396A = 0x6FE0
-0x396B = 0x8C6A
-0x396C = 0x8F5F
-0x396D = 0x9EB9
-0x396E = 0x514B
-0x396F = 0x523B
-0x3970 = 0x544A
-0x3971 = 0x56FD
-0x3972 = 0x7A40
-0x3973 = 0x9177
-0x3974 = 0x9D60
-0x3975 = 0x9ED2
-0x3976 = 0x7344
-0x3977 = 0x6F09
-0x3978 = 0x8170
-0x3979 = 0x7511
-0x397A = 0x5FFD
-0x397B = 0x60DA
-0x397C = 0x9AA8
-0x397D = 0x72DB
-0x397E = 0x8FBC
-0x3A21 = 0x6B64
-0x3A22 = 0x9803
-0x3A23 = 0x4ECA
-0x3A24 = 0x56F0
-0x3A25 = 0x5764
-0x3A26 = 0x58BE
-0x3A27 = 0x5A5A
-0x3A28 = 0x6068
-0x3A29 = 0x61C7
-0x3A2A = 0x660F
-0x3A2B = 0x6606
-0x3A2C = 0x6839
-0x3A2D = 0x68B1
-0x3A2E = 0x6DF7
-0x3A2F = 0x75D5
-0x3A30 = 0x7D3A
-0x3A31 = 0x826E
-0x3A32 = 0x9B42
-0x3A33 = 0x4E9B
-0x3A34 = 0x4F50
-0x3A35 = 0x53C9
-0x3A36 = 0x5506
-0x3A37 = 0x5D6F
-0x3A38 = 0x5DE6
-0x3A39 = 0x5DEE
-0x3A3A = 0x67FB
-0x3A3B = 0x6C99
-0x3A3C = 0x7473
-0x3A3D = 0x7802
-0x3A3E = 0x8A50
-0x3A3F = 0x9396
-0x3A40 = 0x88DF
-0x3A41 = 0x5750
-0x3A42 = 0x5EA7
-0x3A43 = 0x632B
-0x3A44 = 0x50B5
-0x3A45 = 0x50AC
-0x3A46 = 0x518D
-0x3A47 = 0x6700
-0x3A48 = 0x54C9
-0x3A49 = 0x585E
-0x3A4A = 0x59BB
-0x3A4B = 0x5BB0
-0x3A4C = 0x5F69
-0x3A4D = 0x624D
-0x3A4E = 0x63A1
-0x3A4F = 0x683D
-0x3A50 = 0x6B73
-0x3A51 = 0x6E08
-0x3A52 = 0x707D
-0x3A53 = 0x91C7
-0x3A54 = 0x7280
-0x3A55 = 0x7815
-0x3A56 = 0x7826
-0x3A57 = 0x796D
-0x3A58 = 0x658E
-0x3A59 = 0x7D30
-0x3A5A = 0x83DC
-0x3A5B = 0x88C1
-0x3A5C = 0x8F09
-0x3A5D = 0x969B
-0x3A5E = 0x5264
-0x3A5F = 0x5728
-0x3A60 = 0x6750
-0x3A61 = 0x7F6A
-0x3A62 = 0x8CA1
-0x3A63 = 0x51B4
-0x3A64 = 0x5742
-0x3A65 = 0x962A
-0x3A66 = 0x583A
-0x3A67 = 0x698A
-0x3A68 = 0x80B4
-0x3A69 = 0x54B2
-0x3A6A = 0x5D0E
-0x3A6B = 0x57FC
-0x3A6C = 0x7895
-0x3A6D = 0x9DFA
-0x3A6E = 0x4F5C
-0x3A6F = 0x524A
-0x3A70 = 0x548B
-0x3A71 = 0x643E
-0x3A72 = 0x6628
-0x3A73 = 0x6714
-0x3A74 = 0x67F5
-0x3A75 = 0x7A84
-0x3A76 = 0x7B56
-0x3A77 = 0x7D22
-0x3A78 = 0x932F
-0x3A79 = 0x685C
-0x3A7A = 0x9BAD
-0x3A7B = 0x7B39
-0x3A7C = 0x5319
-0x3A7D = 0x518A
-0x3A7E = 0x5237
-0x3B21 = 0x5BDF
-0x3B22 = 0x62F6
-0x3B23 = 0x64AE
-0x3B24 = 0x64E6
-0x3B25 = 0x672D
-0x3B26 = 0x6BBA
-0x3B27 = 0x85A9
-0x3B28 = 0x96D1
-0x3B29 = 0x7690
-0x3B2A = 0x9BD6
-0x3B2B = 0x634C
-0x3B2C = 0x9306
-0x3B2D = 0x9BAB
-0x3B2E = 0x76BF
-0x3B2F = 0x6652
-0x3B30 = 0x4E09
-0x3B31 = 0x5098
-0x3B32 = 0x53C2
-0x3B33 = 0x5C71
-0x3B34 = 0x60E8
-0x3B35 = 0x6492
-0x3B36 = 0x6563
-0x3B37 = 0x685F
-0x3B38 = 0x71E6
-0x3B39 = 0x73CA
-0x3B3A = 0x7523
-0x3B3B = 0x7B97
-0x3B3C = 0x7E82
-0x3B3D = 0x8695
-0x3B3E = 0x8B83
-0x3B3F = 0x8CDB
-0x3B40 = 0x9178
-0x3B41 = 0x9910
-0x3B42 = 0x65AC
-0x3B43 = 0x66AB
-0x3B44 = 0x6B8B
-0x3B45 = 0x4ED5
-0x3B46 = 0x4ED4
-0x3B47 = 0x4F3A
-0x3B48 = 0x4F7F
-0x3B49 = 0x523A
-0x3B4A = 0x53F8
-0x3B4B = 0x53F2
-0x3B4C = 0x55E3
-0x3B4D = 0x56DB
-0x3B4E = 0x58EB
-0x3B4F = 0x59CB
-0x3B50 = 0x59C9
-0x3B51 = 0x59FF
-0x3B52 = 0x5B50
-0x3B53 = 0x5C4D
-0x3B54 = 0x5E02
-0x3B55 = 0x5E2B
-0x3B56 = 0x5FD7
-0x3B57 = 0x601D
-0x3B58 = 0x6307
-0x3B59 = 0x652F
-0x3B5A = 0x5B5C
-0x3B5B = 0x65AF
-0x3B5C = 0x65BD
-0x3B5D = 0x65E8
-0x3B5E = 0x679D
-0x3B5F = 0x6B62
-0x3B60 = 0x6B7B
-0x3B61 = 0x6C0F
-0x3B62 = 0x7345
-0x3B63 = 0x7949
-0x3B64 = 0x79C1
-0x3B65 = 0x7CF8
-0x3B66 = 0x7D19
-0x3B67 = 0x7D2B
-0x3B68 = 0x80A2
-0x3B69 = 0x8102
-0x3B6A = 0x81F3
-0x3B6B = 0x8996
-0x3B6C = 0x8A5E
-0x3B6D = 0x8A69
-0x3B6E = 0x8A66
-0x3B6F = 0x8A8C
-0x3B70 = 0x8AEE
-0x3B71 = 0x8CC7
-0x3B72 = 0x8CDC
-0x3B73 = 0x96CC
-0x3B74 = 0x98FC
-0x3B75 = 0x6B6F
-0x3B76 = 0x4E8B
-0x3B77 = 0x4F3C
-0x3B78 = 0x4F8D
-0x3B79 = 0x5150
-0x3B7A = 0x5B57
-0x3B7B = 0x5BFA
-0x3B7C = 0x6148
-0x3B7D = 0x6301
-0x3B7E = 0x6642
-0x3C21 = 0x6B21
-0x3C22 = 0x6ECB
-0x3C23 = 0x6CBB
-0x3C24 = 0x723E
-0x3C25 = 0x74BD
-0x3C26 = 0x75D4
-0x3C27 = 0x78C1
-0x3C28 = 0x793A
-0x3C29 = 0x800C
-0x3C2A = 0x8033
-0x3C2B = 0x81EA
-0x3C2C = 0x8494
-0x3C2D = 0x8F9E
-0x3C2E = 0x6C50
-0x3C2F = 0x9E7F
-0x3C30 = 0x5F0F
-0x3C31 = 0x8B58
-0x3C32 = 0x9D2B
-0x3C33 = 0x7AFA
-0x3C34 = 0x8EF8
-0x3C35 = 0x5B8D
-0x3C36 = 0x96EB
-0x3C37 = 0x4E03
-0x3C38 = 0x53F1
-0x3C39 = 0x57F7
-0x3C3A = 0x5931
-0x3C3B = 0x5AC9
-0x3C3C = 0x5BA4
-0x3C3D = 0x6089
-0x3C3E = 0x6E7F
-0x3C3F = 0x6F06
-0x3C40 = 0x75BE
-0x3C41 = 0x8CEA
-0x3C42 = 0x5B9F
-0x3C43 = 0x8500
-0x3C44 = 0x7BE0
-0x3C45 = 0x5072
-0x3C46 = 0x67F4
-0x3C47 = 0x829D
-0x3C48 = 0x5C61
-0x3C49 = 0x854A
-0x3C4A = 0x7E1E
-0x3C4B = 0x820E
-0x3C4C = 0x5199
-0x3C4D = 0x5C04
-0x3C4E = 0x6368
-0x3C4F = 0x8D66
-0x3C50 = 0x659C
-0x3C51 = 0x716E
-0x3C52 = 0x793E
-0x3C53 = 0x7D17
-0x3C54 = 0x8005
-0x3C55 = 0x8B1D
-0x3C56 = 0x8ECA
-0x3C57 = 0x906E
-0x3C58 = 0x86C7
-0x3C59 = 0x90AA
-0x3C5A = 0x501F
-0x3C5B = 0x52FA
-0x3C5C = 0x5C3A
-0x3C5D = 0x6753
-0x3C5E = 0x707C
-0x3C5F = 0x7235
-0x3C60 = 0x914C
-0x3C61 = 0x91C8
-0x3C62 = 0x932B
-0x3C63 = 0x82E5
-0x3C64 = 0x5BC2
-0x3C65 = 0x5F31
-0x3C66 = 0x60F9
-0x3C67 = 0x4E3B
-0x3C68 = 0x53D6
-0x3C69 = 0x5B88
-0x3C6A = 0x624B
-0x3C6B = 0x6731
-0x3C6C = 0x6B8A
-0x3C6D = 0x72E9
-0x3C6E = 0x73E0
-0x3C6F = 0x7A2E
-0x3C70 = 0x816B
-0x3C71 = 0x8DA3
-0x3C72 = 0x9152
-0x3C73 = 0x9996
-0x3C74 = 0x5112
-0x3C75 = 0x53D7
-0x3C76 = 0x546A
-0x3C77 = 0x5BFF
-0x3C78 = 0x6388
-0x3C79 = 0x6A39
-0x3C7A = 0x7DAC
-0x3C7B = 0x9700
-0x3C7C = 0x56DA
-0x3C7D = 0x53CE
-0x3C7E = 0x5468
-0x3D21 = 0x5B97
-0x3D22 = 0x5C31
-0x3D23 = 0x5DDE
-0x3D24 = 0x4FEE
-0x3D25 = 0x6101
-0x3D26 = 0x62FE
-0x3D27 = 0x6D32
-0x3D28 = 0x79C0
-0x3D29 = 0x79CB
-0x3D2A = 0x7D42
-0x3D2B = 0x7E4D
-0x3D2C = 0x7FD2
-0x3D2D = 0x81ED
-0x3D2E = 0x821F
-0x3D2F = 0x8490
-0x3D30 = 0x8846
-0x3D31 = 0x8972
-0x3D32 = 0x8B90
-0x3D33 = 0x8E74
-0x3D34 = 0x8F2F
-0x3D35 = 0x9031
-0x3D36 = 0x914B
-0x3D37 = 0x916C
-0x3D38 = 0x96C6
-0x3D39 = 0x919C
-0x3D3A = 0x4EC0
-0x3D3B = 0x4F4F
-0x3D3C = 0x5145
-0x3D3D = 0x5341
-0x3D3E = 0x5F93
-0x3D3F = 0x620E
-0x3D40 = 0x67D4
-0x3D41 = 0x6C41
-0x3D42 = 0x6E0B
-0x3D43 = 0x7363
-0x3D44 = 0x7E26
-0x3D45 = 0x91CD
-0x3D46 = 0x9283
-0x3D47 = 0x53D4
-0x3D48 = 0x5919
-0x3D49 = 0x5BBF
-0x3D4A = 0x6DD1
-0x3D4B = 0x795D
-0x3D4C = 0x7E2E
-0x3D4D = 0x7C9B
-0x3D4E = 0x587E
-0x3D4F = 0x719F
-0x3D50 = 0x51FA
-0x3D51 = 0x8853
-0x3D52 = 0x8FF0
-0x3D53 = 0x4FCA
-0x3D54 = 0x5CFB
-0x3D55 = 0x6625
-0x3D56 = 0x77AC
-0x3D57 = 0x7AE3
-0x3D58 = 0x821C
-0x3D59 = 0x99FF
-0x3D5A = 0x51C6
-0x3D5B = 0x5FAA
-0x3D5C = 0x65EC
-0x3D5D = 0x696F
-0x3D5E = 0x6B89
-0x3D5F = 0x6DF3
-0x3D60 = 0x6E96
-0x3D61 = 0x6F64
-0x3D62 = 0x76FE
-0x3D63 = 0x7D14
-0x3D64 = 0x5DE1
-0x3D65 = 0x9075
-0x3D66 = 0x9187
-0x3D67 = 0x9806
-0x3D68 = 0x51E6
-0x3D69 = 0x521D
-0x3D6A = 0x6240
-0x3D6B = 0x6691
-0x3D6C = 0x66D9
-0x3D6D = 0x6E1A
-0x3D6E = 0x5EB6
-0x3D6F = 0x7DD2
-0x3D70 = 0x7F72
-0x3D71 = 0x66F8
-0x3D72 = 0x85AF
-0x3D73 = 0x85F7
-0x3D74 = 0x8AF8
-0x3D75 = 0x52A9
-0x3D76 = 0x53D9
-0x3D77 = 0x5973
-0x3D78 = 0x5E8F
-0x3D79 = 0x5F90
-0x3D7A = 0x6055
-0x3D7B = 0x92E4
-0x3D7C = 0x9664
-0x3D7D = 0x50B7
-0x3D7E = 0x511F
-0x3E21 = 0x52DD
-0x3E22 = 0x5320
-0x3E23 = 0x5347
-0x3E24 = 0x53EC
-0x3E25 = 0x54E8
-0x3E26 = 0x5546
-0x3E27 = 0x5531
-0x3E28 = 0x5617
-0x3E29 = 0x5968
-0x3E2A = 0x59BE
-0x3E2B = 0x5A3C
-0x3E2C = 0x5BB5
-0x3E2D = 0x5C06
-0x3E2E = 0x5C0F
-0x3E2F = 0x5C11
-0x3E30 = 0x5C1A
-0x3E31 = 0x5E84
-0x3E32 = 0x5E8A
-0x3E33 = 0x5EE0
-0x3E34 = 0x5F70
-0x3E35 = 0x627F
-0x3E36 = 0x6284
-0x3E37 = 0x62DB
-0x3E38 = 0x638C
-0x3E39 = 0x6377
-0x3E3A = 0x6607
-0x3E3B = 0x660C
-0x3E3C = 0x662D
-0x3E3D = 0x6676
-0x3E3E = 0x677E
-0x3E3F = 0x68A2
-0x3E40 = 0x6A1F
-0x3E41 = 0x6A35
-0x3E42 = 0x6CBC
-0x3E43 = 0x6D88
-0x3E44 = 0x6E09
-0x3E45 = 0x6E58
-0x3E46 = 0x713C
-0x3E47 = 0x7126
-0x3E48 = 0x7167
-0x3E49 = 0x75C7
-0x3E4A = 0x7701
-0x3E4B = 0x785D
-0x3E4C = 0x7901
-0x3E4D = 0x7965
-0x3E4E = 0x79F0
-0x3E4F = 0x7AE0
-0x3E50 = 0x7B11
-0x3E51 = 0x7CA7
-0x3E52 = 0x7D39
-0x3E53 = 0x8096
-0x3E54 = 0x83D6
-0x3E55 = 0x848B
-0x3E56 = 0x8549
-0x3E57 = 0x885D
-0x3E58 = 0x88F3
-0x3E59 = 0x8A1F
-0x3E5A = 0x8A3C
-0x3E5B = 0x8A54
-0x3E5C = 0x8A73
-0x3E5D = 0x8C61
-0x3E5E = 0x8CDE
-0x3E5F = 0x91A4
-0x3E60 = 0x9266
-0x3E61 = 0x937E
-0x3E62 = 0x9418
-0x3E63 = 0x969C
-0x3E64 = 0x9798
-0x3E65 = 0x4E0A
-0x3E66 = 0x4E08
-0x3E67 = 0x4E1E
-0x3E68 = 0x4E57
-0x3E69 = 0x5197
-0x3E6A = 0x5270
-0x3E6B = 0x57CE
-0x3E6C = 0x5834
-0x3E6D = 0x58CC
-0x3E6E = 0x5B22
-0x3E6F = 0x5E38
-0x3E70 = 0x60C5
-0x3E71 = 0x64FE
-0x3E72 = 0x6761
-0x3E73 = 0x6756
-0x3E74 = 0x6D44
-0x3E75 = 0x72B6
-0x3E76 = 0x7573
-0x3E77 = 0x7A63
-0x3E78 = 0x84B8
-0x3E79 = 0x8B72
-0x3E7A = 0x91B8
-0x3E7B = 0x9320
-0x3E7C = 0x5631
-0x3E7D = 0x57F4
-0x3E7E = 0x98FE
-0x3F21 = 0x62ED
-0x3F22 = 0x690D
-0x3F23 = 0x6B96
-0x3F24 = 0x71ED
-0x3F25 = 0x7E54
-0x3F26 = 0x8077
-0x3F27 = 0x8272
-0x3F28 = 0x89E6
-0x3F29 = 0x98DF
-0x3F2A = 0x8755
-0x3F2B = 0x8FB1
-0x3F2C = 0x5C3B
-0x3F2D = 0x4F38
-0x3F2E = 0x4FE1
-0x3F2F = 0x4FB5
-0x3F30 = 0x5507
-0x3F31 = 0x5A20
-0x3F32 = 0x5BDD
-0x3F33 = 0x5BE9
-0x3F34 = 0x5FC3
-0x3F35 = 0x614E
-0x3F36 = 0x632F
-0x3F37 = 0x65B0
-0x3F38 = 0x664B
-0x3F39 = 0x68EE
-0x3F3A = 0x699B
-0x3F3B = 0x6D78
-0x3F3C = 0x6DF1
-0x3F3D = 0x7533
-0x3F3E = 0x75B9
-0x3F3F = 0x771F
-0x3F40 = 0x795E
-0x3F41 = 0x79E6
-0x3F42 = 0x7D33
-0x3F43 = 0x81E3
-0x3F44 = 0x82AF
-0x3F45 = 0x85AA
-0x3F46 = 0x89AA
-0x3F47 = 0x8A3A
-0x3F48 = 0x8EAB
-0x3F49 = 0x8F9B
-0x3F4A = 0x9032
-0x3F4B = 0x91DD
-0x3F4C = 0x9707
-0x3F4D = 0x4EBA
-0x3F4E = 0x4EC1
-0x3F4F = 0x5203
-0x3F50 = 0x5875
-0x3F51 = 0x58EC
-0x3F52 = 0x5C0B
-0x3F53 = 0x751A
-0x3F54 = 0x5C3D
-0x3F55 = 0x814E
-0x3F56 = 0x8A0A
-0x3F57 = 0x8FC5
-0x3F58 = 0x9663
-0x3F59 = 0x976D
-0x3F5A = 0x7B25
-0x3F5B = 0x8ACF
-0x3F5C = 0x9808
-0x3F5D = 0x9162
-0x3F5E = 0x56F3
-0x3F5F = 0x53A8
-0x3F60 = 0x9017
-0x3F61 = 0x5439
-0x3F62 = 0x5782
-0x3F63 = 0x5E25
-0x3F64 = 0x63A8
-0x3F65 = 0x6C34
-0x3F66 = 0x708A
-0x3F67 = 0x7761
-0x3F68 = 0x7C8B
-0x3F69 = 0x7FE0
-0x3F6A = 0x8870
-0x3F6B = 0x9042
-0x3F6C = 0x9154
-0x3F6D = 0x9310
-0x3F6E = 0x9318
-0x3F6F = 0x968F
-0x3F70 = 0x745E
-0x3F71 = 0x9AC4
-0x3F72 = 0x5D07
-0x3F73 = 0x5D69
-0x3F74 = 0x6570
-0x3F75 = 0x67A2
-0x3F76 = 0x8DA8
-0x3F77 = 0x96DB
-0x3F78 = 0x636E
-0x3F79 = 0x6749
-0x3F7A = 0x6919
-0x3F7B = 0x83C5
-0x3F7C = 0x9817
-0x3F7D = 0x96C0
-0x3F7E = 0x88FE
-0x4021 = 0x6F84
-0x4022 = 0x647A
-0x4023 = 0x5BF8
-0x4024 = 0x4E16
-0x4025 = 0x702C
-0x4026 = 0x755D
-0x4027 = 0x662F
-0x4028 = 0x51C4
-0x4029 = 0x5236
-0x402A = 0x52E2
-0x402B = 0x59D3
-0x402C = 0x5F81
-0x402D = 0x6027
-0x402E = 0x6210
-0x402F = 0x653F
-0x4030 = 0x6574
-0x4031 = 0x661F
-0x4032 = 0x6674
-0x4033 = 0x68F2
-0x4034 = 0x6816
-0x4035 = 0x6B63
-0x4036 = 0x6E05
-0x4037 = 0x7272
-0x4038 = 0x751F
-0x4039 = 0x76DB
-0x403A = 0x7CBE
-0x403B = 0x8056
-0x403C = 0x58F0
-0x403D = 0x88FD
-0x403E = 0x897F
-0x403F = 0x8AA0
-0x4040 = 0x8A93
-0x4041 = 0x8ACB
-0x4042 = 0x901D
-0x4043 = 0x9192
-0x4044 = 0x9752
-0x4045 = 0x9759
-0x4046 = 0x6589
-0x4047 = 0x7A0E
-0x4048 = 0x8106
-0x4049 = 0x96BB
-0x404A = 0x5E2D
-0x404B = 0x60DC
-0x404C = 0x621A
-0x404D = 0x65A5
-0x404E = 0x6614
-0x404F = 0x6790
-0x4050 = 0x77F3
-0x4051 = 0x7A4D
-0x4052 = 0x7C4D
-0x4053 = 0x7E3E
-0x4054 = 0x810A
-0x4055 = 0x8CAC
-0x4056 = 0x8D64
-0x4057 = 0x8DE1
-0x4058 = 0x8E5F
-0x4059 = 0x78A9
-0x405A = 0x5207
-0x405B = 0x62D9
-0x405C = 0x63A5
-0x405D = 0x6442
-0x405E = 0x6298
-0x405F = 0x8A2D
-0x4060 = 0x7A83
-0x4061 = 0x7BC0
-0x4062 = 0x8AAC
-0x4063 = 0x96EA
-0x4064 = 0x7D76
-0x4065 = 0x820C
-0x4066 = 0x8749
-0x4067 = 0x4ED9
-0x4068 = 0x5148
-0x4069 = 0x5343
-0x406A = 0x5360
-0x406B = 0x5BA3
-0x406C = 0x5C02
-0x406D = 0x5C16
-0x406E = 0x5DDD
-0x406F = 0x6226
-0x4070 = 0x6247
-0x4071 = 0x64B0
-0x4072 = 0x6813
-0x4073 = 0x6834
-0x4074 = 0x6CC9
-0x4075 = 0x6D45
-0x4076 = 0x6D17
-0x4077 = 0x67D3
-0x4078 = 0x6F5C
-0x4079 = 0x714E
-0x407A = 0x717D
-0x407B = 0x65CB
-0x407C = 0x7A7F
-0x407D = 0x7BAD
-0x407E = 0x7DDA
-0x4121 = 0x7E4A
-0x4122 = 0x7FA8
-0x4123 = 0x817A
-0x4124 = 0x821B
-0x4125 = 0x8239
-0x4126 = 0x85A6
-0x4127 = 0x8A6E
-0x4128 = 0x8CCE
-0x4129 = 0x8DF5
-0x412A = 0x9078
-0x412B = 0x9077
-0x412C = 0x92AD
-0x412D = 0x9291
-0x412E = 0x9583
-0x412F = 0x9BAE
-0x4130 = 0x524D
-0x4131 = 0x5584
-0x4132 = 0x6F38
-0x4133 = 0x7136
-0x4134 = 0x5168
-0x4135 = 0x7985
-0x4136 = 0x7E55
-0x4137 = 0x81B3
-0x4138 = 0x7CCE
-0x4139 = 0x564C
-0x413A = 0x5851
-0x413B = 0x5CA8
-0x413C = 0x63AA
-0x413D = 0x66FE
-0x413E = 0x66FD
-0x413F = 0x695A
-0x4140 = 0x72D9
-0x4141 = 0x758F
-0x4142 = 0x758E
-0x4143 = 0x790E
-0x4144 = 0x7956
-0x4145 = 0x79DF
-0x4146 = 0x7C97
-0x4147 = 0x7D20
-0x4148 = 0x7D44
-0x4149 = 0x8607
-0x414A = 0x8A34
-0x414B = 0x963B
-0x414C = 0x9061
-0x414D = 0x9F20
-0x414E = 0x50E7
-0x414F = 0x5275
-0x4150 = 0x53CC
-0x4151 = 0x53E2
-0x4152 = 0x5009
-0x4153 = 0x55AA
-0x4154 = 0x58EE
-0x4155 = 0x594F
-0x4156 = 0x723D
-0x4157 = 0x5B8B
-0x4158 = 0x5C64
-0x4159 = 0x531D
-0x415A = 0x60E3
-0x415B = 0x60F3
-0x415C = 0x635C
-0x415D = 0x6383
-0x415E = 0x633F
-0x415F = 0x63BB
-0x4160 = 0x64CD
-0x4161 = 0x65E9
-0x4162 = 0x66F9
-0x4163 = 0x5DE3
-0x4164 = 0x69CD
-0x4165 = 0x69FD
-0x4166 = 0x6F15
-0x4167 = 0x71E5
-0x4168 = 0x4E89
-0x4169 = 0x75E9
-0x416A = 0x76F8
-0x416B = 0x7A93
-0x416C = 0x7CDF
-0x416D = 0x7DCF
-0x416E = 0x7D9C
-0x416F = 0x8061
-0x4170 = 0x8349
-0x4171 = 0x8358
-0x4172 = 0x846C
-0x4173 = 0x84BC
-0x4174 = 0x85FB
-0x4175 = 0x88C5
-0x4176 = 0x8D70
-0x4177 = 0x9001
-0x4178 = 0x906D
-0x4179 = 0x9397
-0x417A = 0x971C
-0x417B = 0x9A12
-0x417C = 0x50CF
-0x417D = 0x5897
-0x417E = 0x618E
-0x4221 = 0x81D3
-0x4222 = 0x8535
-0x4223 = 0x8D08
-0x4224 = 0x9020
-0x4225 = 0x4FC3
-0x4226 = 0x5074
-0x4227 = 0x5247
-0x4228 = 0x5373
-0x4229 = 0x606F
-0x422A = 0x6349
-0x422B = 0x675F
-0x422C = 0x6E2C
-0x422D = 0x8DB3
-0x422E = 0x901F
-0x422F = 0x4FD7
-0x4230 = 0x5C5E
-0x4231 = 0x8CCA
-0x4232 = 0x65CF
-0x4233 = 0x7D9A
-0x4234 = 0x5352
-0x4235 = 0x8896
-0x4236 = 0x5176
-0x4237 = 0x63C3
-0x4238 = 0x5B58
-0x4239 = 0x5B6B
-0x423A = 0x5C0A
-0x423B = 0x640D
-0x423C = 0x6751
-0x423D = 0x905C
-0x423E = 0x4ED6
-0x423F = 0x591A
-0x4240 = 0x592A
-0x4241 = 0x6C70
-0x4242 = 0x8A51
-0x4243 = 0x553E
-0x4244 = 0x5815
-0x4245 = 0x59A5
-0x4246 = 0x60F0
-0x4247 = 0x6253
-0x4248 = 0x67C1
-0x4249 = 0x8235
-0x424A = 0x6955
-0x424B = 0x9640
-0x424C = 0x99C4
-0x424D = 0x9A28
-0x424E = 0x4F53
-0x424F = 0x5806
-0x4250 = 0x5BFE
-0x4251 = 0x8010
-0x4252 = 0x5CB1
-0x4253 = 0x5E2F
-0x4254 = 0x5F85
-0x4255 = 0x6020
-0x4256 = 0x614B
-0x4257 = 0x6234
-0x4258 = 0x66FF
-0x4259 = 0x6CF0
-0x425A = 0x6EDE
-0x425B = 0x80CE
-0x425C = 0x817F
-0x425D = 0x82D4
-0x425E = 0x888B
-0x425F = 0x8CB8
-0x4260 = 0x9000
-0x4261 = 0x902E
-0x4262 = 0x968A
-0x4263 = 0x9EDB
-0x4264 = 0x9BDB
-0x4265 = 0x4EE3
-0x4266 = 0x53F0
-0x4267 = 0x5927
-0x4268 = 0x7B2C
-0x4269 = 0x918D
-0x426A = 0x984C
-0x426B = 0x9DF9
-0x426C = 0x6EDD
-0x426D = 0x7027
-0x426E = 0x5353
-0x426F = 0x5544
-0x4270 = 0x5B85
-0x4271 = 0x6258
-0x4272 = 0x629E
-0x4273 = 0x62D3
-0x4274 = 0x6CA2
-0x4275 = 0x6FEF
-0x4276 = 0x7422
-0x4277 = 0x8A17
-0x4278 = 0x9438
-0x4279 = 0x6FC1
-0x427A = 0x8AFE
-0x427B = 0x8338
-0x427C = 0x51E7
-0x427D = 0x86F8
-0x427E = 0x53EA
-0x4321 = 0x53E9
-0x4322 = 0x4F46
-0x4323 = 0x9054
-0x4324 = 0x8FB0
-0x4325 = 0x596A
-0x4326 = 0x8131
-0x4327 = 0x5DFD
-0x4328 = 0x7AEA
-0x4329 = 0x8FBF
-0x432A = 0x68DA
-0x432B = 0x8C37
-0x432C = 0x72F8
-0x432D = 0x9C48
-0x432E = 0x6A3D
-0x432F = 0x8AB0
-0x4330 = 0x4E39
-0x4331 = 0x5358
-0x4332 = 0x5606
-0x4333 = 0x5766
-0x4334 = 0x62C5
-0x4335 = 0x63A2
-0x4336 = 0x65E6
-0x4337 = 0x6B4E
-0x4338 = 0x6DE1
-0x4339 = 0x6E5B
-0x433A = 0x70AD
-0x433B = 0x77ED
-0x433C = 0x7AEF
-0x433D = 0x7BAA
-0x433E = 0x7DBB
-0x433F = 0x803D
-0x4340 = 0x80C6
-0x4341 = 0x86CB
-0x4342 = 0x8A95
-0x4343 = 0x935B
-0x4344 = 0x56E3
-0x4345 = 0x58C7
-0x4346 = 0x5F3E
-0x4347 = 0x65AD
-0x4348 = 0x6696
-0x4349 = 0x6A80
-0x434A = 0x6BB5
-0x434B = 0x7537
-0x434C = 0x8AC7
-0x434D = 0x5024
-0x434E = 0x77E5
-0x434F = 0x5730
-0x4350 = 0x5F1B
-0x4351 = 0x6065
-0x4352 = 0x667A
-0x4353 = 0x6C60
-0x4354 = 0x75F4
-0x4355 = 0x7A1A
-0x4356 = 0x7F6E
-0x4357 = 0x81F4
-0x4358 = 0x8718
-0x4359 = 0x9045
-0x435A = 0x99B3
-0x435B = 0x7BC9
-0x435C = 0x755C
-0x435D = 0x7AF9
-0x435E = 0x7B51
-0x435F = 0x84C4
-0x4360 = 0x9010
-0x4361 = 0x79E9
-0x4362 = 0x7A92
-0x4363 = 0x8336
-0x4364 = 0x5AE1
-0x4365 = 0x7740
-0x4366 = 0x4E2D
-0x4367 = 0x4EF2
-0x4368 = 0x5B99
-0x4369 = 0x5FE0
-0x436A = 0x62BD
-0x436B = 0x663C
-0x436C = 0x67F1
-0x436D = 0x6CE8
-0x436E = 0x866B
-0x436F = 0x8877
-0x4370 = 0x8A3B
-0x4371 = 0x914E
-0x4372 = 0x92F3
-0x4373 = 0x99D0
-0x4374 = 0x6A17
-0x4375 = 0x7026
-0x4376 = 0x732A
-0x4377 = 0x82E7
-0x4378 = 0x8457
-0x4379 = 0x8CAF
-0x437A = 0x4E01
-0x437B = 0x5146
-0x437C = 0x51CB
-0x437D = 0x558B
-0x437E = 0x5BF5
-0x4421 = 0x5E16
-0x4422 = 0x5E33
-0x4423 = 0x5E81
-0x4424 = 0x5F14
-0x4425 = 0x5F35
-0x4426 = 0x5F6B
-0x4427 = 0x5FB4
-0x4428 = 0x61F2
-0x4429 = 0x6311
-0x442A = 0x66A2
-0x442B = 0x671D
-0x442C = 0x6F6E
-0x442D = 0x7252
-0x442E = 0x753A
-0x442F = 0x773A
-0x4430 = 0x8074
-0x4431 = 0x8139
-0x4432 = 0x8178
-0x4433 = 0x8776
-0x4434 = 0x8ABF
-0x4435 = 0x8ADC
-0x4436 = 0x8D85
-0x4437 = 0x8DF3
-0x4438 = 0x929A
-0x4439 = 0x9577
-0x443A = 0x9802
-0x443B = 0x9CE5
-0x443C = 0x52C5
-0x443D = 0x6357
-0x443E = 0x76F4
-0x443F = 0x6715
-0x4440 = 0x6C88
-0x4441 = 0x73CD
-0x4442 = 0x8CC3
-0x4443 = 0x93AE
-0x4444 = 0x9673
-0x4445 = 0x6D25
-0x4446 = 0x589C
-0x4447 = 0x690E
-0x4448 = 0x69CC
-0x4449 = 0x8FFD
-0x444A = 0x939A
-0x444B = 0x75DB
-0x444C = 0x901A
-0x444D = 0x585A
-0x444E = 0x6802
-0x444F = 0x63B4
-0x4450 = 0x69FB
-0x4451 = 0x4F43
-0x4452 = 0x6F2C
-0x4453 = 0x67D8
-0x4454 = 0x8FBB
-0x4455 = 0x8526
-0x4456 = 0x7DB4
-0x4457 = 0x9354
-0x4458 = 0x693F
-0x4459 = 0x6F70
-0x445A = 0x576A
-0x445B = 0x58F7
-0x445C = 0x5B2C
-0x445D = 0x7D2C
-0x445E = 0x722A
-0x445F = 0x540A
-0x4460 = 0x91E3
-0x4461 = 0x9DB4
-0x4462 = 0x4EAD
-0x4463 = 0x4F4E
-0x4464 = 0x505C
-0x4465 = 0x5075
-0x4466 = 0x5243
-0x4467 = 0x8C9E
-0x4468 = 0x5448
-0x4469 = 0x5824
-0x446A = 0x5B9A
-0x446B = 0x5E1D
-0x446C = 0x5E95
-0x446D = 0x5EAD
-0x446E = 0x5EF7
-0x446F = 0x5F1F
-0x4470 = 0x608C
-0x4471 = 0x62B5
-0x4472 = 0x633A
-0x4473 = 0x63D0
-0x4474 = 0x68AF
-0x4475 = 0x6C40
-0x4476 = 0x7887
-0x4477 = 0x798E
-0x4478 = 0x7A0B
-0x4479 = 0x7DE0
-0x447A = 0x8247
-0x447B = 0x8A02
-0x447C = 0x8AE6
-0x447D = 0x8E44
-0x447E = 0x9013
-0x4521 = 0x90B8
-0x4522 = 0x912D
-0x4523 = 0x91D8
-0x4524 = 0x9F0E
-0x4525 = 0x6CE5
-0x4526 = 0x6458
-0x4527 = 0x64E2
-0x4528 = 0x6575
-0x4529 = 0x6EF4
-0x452A = 0x7684
-0x452B = 0x7B1B
-0x452C = 0x9069
-0x452D = 0x93D1
-0x452E = 0x6EBA
-0x452F = 0x54F2
-0x4530 = 0x5FB9
-0x4531 = 0x64A4
-0x4532 = 0x8F4D
-0x4533 = 0x8FED
-0x4534 = 0x9244
-0x4535 = 0x5178
-0x4536 = 0x586B
-0x4537 = 0x5929
-0x4538 = 0x5C55
-0x4539 = 0x5E97
-0x453A = 0x6DFB
-0x453B = 0x7E8F
-0x453C = 0x751C
-0x453D = 0x8CBC
-0x453E = 0x8EE2
-0x453F = 0x985B
-0x4540 = 0x70B9
-0x4541 = 0x4F1D
-0x4542 = 0x6BBF
-0x4543 = 0x6FB1
-0x4544 = 0x7530
-0x4545 = 0x96FB
-0x4546 = 0x514E
-0x4547 = 0x5410
-0x4548 = 0x5835
-0x4549 = 0x5857
-0x454A = 0x59AC
-0x454B = 0x5C60
-0x454C = 0x5F92
-0x454D = 0x6597
-0x454E = 0x675C
-0x454F = 0x6E21
-0x4550 = 0x767B
-0x4551 = 0x83DF
-0x4552 = 0x8CED
-0x4553 = 0x9014
-0x4554 = 0x90FD
-0x4555 = 0x934D
-0x4556 = 0x7825
-0x4557 = 0x783A
-0x4558 = 0x52AA
-0x4559 = 0x5EA6
-0x455A = 0x571F
-0x455B = 0x5974
-0x455C = 0x6012
-0x455D = 0x5012
-0x455E = 0x515A
-0x455F = 0x51AC
-0x4560 = 0x51CD
-0x4561 = 0x5200
-0x4562 = 0x5510
-0x4563 = 0x5854
-0x4564 = 0x5858
-0x4565 = 0x5957
-0x4566 = 0x5B95
-0x4567 = 0x5CF6
-0x4568 = 0x5D8B
-0x4569 = 0x60BC
-0x456A = 0x6295
-0x456B = 0x642D
-0x456C = 0x6771
-0x456D = 0x6843
-0x456E = 0x68BC
-0x456F = 0x68DF
-0x4570 = 0x76D7
-0x4571 = 0x6DD8
-0x4572 = 0x6E6F
-0x4573 = 0x6D9B
-0x4574 = 0x706F
-0x4575 = 0x71C8
-0x4576 = 0x5F53
-0x4577 = 0x75D8
-0x4578 = 0x7977
-0x4579 = 0x7B49
-0x457A = 0x7B54
-0x457B = 0x7B52
-0x457C = 0x7CD6
-0x457D = 0x7D71
-0x457E = 0x5230
-0x4621 = 0x8463
-0x4622 = 0x8569
-0x4623 = 0x85E4
-0x4624 = 0x8A0E
-0x4625 = 0x8B04
-0x4626 = 0x8C46
-0x4627 = 0x8E0F
-0x4628 = 0x9003
-0x4629 = 0x900F
-0x462A = 0x9419
-0x462B = 0x9676
-0x462C = 0x982D
-0x462D = 0x9A30
-0x462E = 0x95D8
-0x462F = 0x50CD
-0x4630 = 0x52D5
-0x4631 = 0x540C
-0x4632 = 0x5802
-0x4633 = 0x5C0E
-0x4634 = 0x61A7
-0x4635 = 0x649E
-0x4636 = 0x6D1E
-0x4637 = 0x77B3
-0x4638 = 0x7AE5
-0x4639 = 0x80F4
-0x463A = 0x8404
-0x463B = 0x9053
-0x463C = 0x9285
-0x463D = 0x5CE0
-0x463E = 0x9D07
-0x463F = 0x533F
-0x4640 = 0x5F97
-0x4641 = 0x5FB3
-0x4642 = 0x6D9C
-0x4643 = 0x7279
-0x4644 = 0x7763
-0x4645 = 0x79BF
-0x4646 = 0x7BE4
-0x4647 = 0x6BD2
-0x4648 = 0x72EC
-0x4649 = 0x8AAD
-0x464A = 0x6803
-0x464B = 0x6A61
-0x464C = 0x51F8
-0x464D = 0x7A81
-0x464E = 0x6934
-0x464F = 0x5C4A
-0x4650 = 0x9CF6
-0x4651 = 0x82EB
-0x4652 = 0x5BC5
-0x4653 = 0x9149
-0x4654 = 0x701E
-0x4655 = 0x5678
-0x4656 = 0x5C6F
-0x4657 = 0x60C7
-0x4658 = 0x6566
-0x4659 = 0x6C8C
-0x465A = 0x8C5A
-0x465B = 0x9041
-0x465C = 0x9813
-0x465D = 0x5451
-0x465E = 0x66C7
-0x465F = 0x920D
-0x4660 = 0x5948
-0x4661 = 0x90A3
-0x4662 = 0x5185
-0x4663 = 0x4E4D
-0x4664 = 0x51EA
-0x4665 = 0x8599
-0x4666 = 0x8B0E
-0x4667 = 0x7058
-0x4668 = 0x637A
-0x4669 = 0x934B
-0x466A = 0x6962
-0x466B = 0x99B4
-0x466C = 0x7E04
-0x466D = 0x7577
-0x466E = 0x5357
-0x466F = 0x6960
-0x4670 = 0x8EDF
-0x4671 = 0x96E3
-0x4672 = 0x6C5D
-0x4673 = 0x4E8C
-0x4674 = 0x5C3C
-0x4675 = 0x5F10
-0x4676 = 0x8FE9
-0x4677 = 0x5302
-0x4678 = 0x8CD1
-0x4679 = 0x8089
-0x467A = 0x8679
-0x467B = 0x5EFF
-0x467C = 0x65E5
-0x467D = 0x4E73
-0x467E = 0x5165
-0x4721 = 0x5982
-0x4722 = 0x5C3F
-0x4723 = 0x97EE
-0x4724 = 0x4EFB
-0x4725 = 0x598A
-0x4726 = 0x5FCD
-0x4727 = 0x8A8D
-0x4728 = 0x6FE1
-0x4729 = 0x79B0
-0x472A = 0x7962
-0x472B = 0x5BE7
-0x472C = 0x8471
-0x472D = 0x732B
-0x472E = 0x71B1
-0x472F = 0x5E74
-0x4730 = 0x5FF5
-0x4731 = 0x637B
-0x4732 = 0x649A
-0x4733 = 0x71C3
-0x4734 = 0x7C98
-0x4735 = 0x4E43
-0x4736 = 0x5EFC
-0x4737 = 0x4E4B
-0x4738 = 0x57DC
-0x4739 = 0x56A2
-0x473A = 0x60A9
-0x473B = 0x6FC3
-0x473C = 0x7D0D
-0x473D = 0x80FD
-0x473E = 0x8133
-0x473F = 0x81BF
-0x4740 = 0x8FB2
-0x4741 = 0x8997
-0x4742 = 0x86A4
-0x4743 = 0x5DF4
-0x4744 = 0x628A
-0x4745 = 0x64AD
-0x4746 = 0x8987
-0x4747 = 0x6777
-0x4748 = 0x6CE2
-0x4749 = 0x6D3E
-0x474A = 0x7436
-0x474B = 0x7834
-0x474C = 0x5A46
-0x474D = 0x7F75
-0x474E = 0x82AD
-0x474F = 0x99AC
-0x4750 = 0x4FF3
-0x4751 = 0x5EC3
-0x4752 = 0x62DD
-0x4753 = 0x6392
-0x4754 = 0x6557
-0x4755 = 0x676F
-0x4756 = 0x76C3
-0x4757 = 0x724C
-0x4758 = 0x80CC
-0x4759 = 0x80BA
-0x475A = 0x8F29
-0x475B = 0x914D
-0x475C = 0x500D
-0x475D = 0x57F9
-0x475E = 0x5A92
-0x475F = 0x6885
-0x4760 = 0x6973
-0x4761 = 0x7164
-0x4762 = 0x72FD
-0x4763 = 0x8CB7
-0x4764 = 0x58F2
-0x4765 = 0x8CE0
-0x4766 = 0x966A
-0x4767 = 0x9019
-0x4768 = 0x877F
-0x4769 = 0x79E4
-0x476A = 0x77E7
-0x476B = 0x8429
-0x476C = 0x4F2F
-0x476D = 0x5265
-0x476E = 0x535A
-0x476F = 0x62CD
-0x4770 = 0x67CF
-0x4771 = 0x6CCA
-0x4772 = 0x767D
-0x4773 = 0x7B94
-0x4774 = 0x7C95
-0x4775 = 0x8236
-0x4776 = 0x8584
-0x4777 = 0x8FEB
-0x4778 = 0x66DD
-0x4779 = 0x6F20
-0x477A = 0x7206
-0x477B = 0x7E1B
-0x477C = 0x83AB
-0x477D = 0x99C1
-0x477E = 0x9EA6
-0x4821 = 0x51FD
-0x4822 = 0x7BB1
-0x4823 = 0x7872
-0x4824 = 0x7BB8
-0x4825 = 0x8087
-0x4826 = 0x7B48
-0x4827 = 0x6AE8
-0x4828 = 0x5E61
-0x4829 = 0x808C
-0x482A = 0x7551
-0x482B = 0x7560
-0x482C = 0x516B
-0x482D = 0x9262
-0x482E = 0x6E8C
-0x482F = 0x767A
-0x4830 = 0x9197
-0x4831 = 0x9AEA
-0x4832 = 0x4F10
-0x4833 = 0x7F70
-0x4834 = 0x629C
-0x4835 = 0x7B4F
-0x4836 = 0x95A5
-0x4837 = 0x9CE9
-0x4838 = 0x567A
-0x4839 = 0x5859
-0x483A = 0x86E4
-0x483B = 0x96BC
-0x483C = 0x4F34
-0x483D = 0x5224
-0x483E = 0x534A
-0x483F = 0x53CD
-0x4840 = 0x53DB
-0x4841 = 0x5E06
-0x4842 = 0x642C
-0x4843 = 0x6591
-0x4844 = 0x677F
-0x4845 = 0x6C3E
-0x4846 = 0x6C4E
-0x4847 = 0x7248
-0x4848 = 0x72AF
-0x4849 = 0x73ED
-0x484A = 0x7554
-0x484B = 0x7E41
-0x484C = 0x822C
-0x484D = 0x85E9
-0x484E = 0x8CA9
-0x484F = 0x7BC4
-0x4850 = 0x91C6
-0x4851 = 0x7169
-0x4852 = 0x9812
-0x4853 = 0x98EF
-0x4854 = 0x633D
-0x4855 = 0x6669
-0x4856 = 0x756A
-0x4857 = 0x76E4
-0x4858 = 0x78D0
-0x4859 = 0x8543
-0x485A = 0x86EE
-0x485B = 0x532A
-0x485C = 0x5351
-0x485D = 0x5426
-0x485E = 0x5983
-0x485F = 0x5E87
-0x4860 = 0x5F7C
-0x4861 = 0x60B2
-0x4862 = 0x6249
-0x4863 = 0x6279
-0x4864 = 0x62AB
-0x4865 = 0x6590
-0x4866 = 0x6BD4
-0x4867 = 0x6CCC
-0x4868 = 0x75B2
-0x4869 = 0x76AE
-0x486A = 0x7891
-0x486B = 0x79D8
-0x486C = 0x7DCB
-0x486D = 0x7F77
-0x486E = 0x80A5
-0x486F = 0x88AB
-0x4870 = 0x8AB9
-0x4871 = 0x8CBB
-0x4872 = 0x907F
-0x4873 = 0x975E
-0x4874 = 0x98DB
-0x4875 = 0x6A0B
-0x4876 = 0x7C38
-0x4877 = 0x5099
-0x4878 = 0x5C3E
-0x4879 = 0x5FAE
-0x487A = 0x6787
-0x487B = 0x6BD8
-0x487C = 0x7435
-0x487D = 0x7709
-0x487E = 0x7F8E
-0x4921 = 0x9F3B
-0x4922 = 0x67CA
-0x4923 = 0x7A17
-0x4924 = 0x5339
-0x4925 = 0x758B
-0x4926 = 0x9AED
-0x4927 = 0x5F66
-0x4928 = 0x819D
-0x4929 = 0x83F1
-0x492A = 0x8098
-0x492B = 0x5F3C
-0x492C = 0x5FC5
-0x492D = 0x7562
-0x492E = 0x7B46
-0x492F = 0x903C
-0x4930 = 0x6867
-0x4931 = 0x59EB
-0x4932 = 0x5A9B
-0x4933 = 0x7D10
-0x4934 = 0x767E
-0x4935 = 0x8B2C
-0x4936 = 0x4FF5
-0x4937 = 0x5F6A
-0x4938 = 0x6A19
-0x4939 = 0x6C37
-0x493A = 0x6F02
-0x493B = 0x74E2
-0x493C = 0x7968
-0x493D = 0x8868
-0x493E = 0x8A55
-0x493F = 0x8C79
-0x4940 = 0x5EDF
-0x4941 = 0x63CF
-0x4942 = 0x75C5
-0x4943 = 0x79D2
-0x4944 = 0x82D7
-0x4945 = 0x9328
-0x4946 = 0x92F2
-0x4947 = 0x849C
-0x4948 = 0x86ED
-0x4949 = 0x9C2D
-0x494A = 0x54C1
-0x494B = 0x5F6C
-0x494C = 0x658C
-0x494D = 0x6D5C
-0x494E = 0x7015
-0x494F = 0x8CA7
-0x4950 = 0x8CD3
-0x4951 = 0x983B
-0x4952 = 0x654F
-0x4953 = 0x74F6
-0x4954 = 0x4E0D
-0x4955 = 0x4ED8
-0x4956 = 0x57E0
-0x4957 = 0x592B
-0x4958 = 0x5A66
-0x4959 = 0x5BCC
-0x495A = 0x51A8
-0x495B = 0x5E03
-0x495C = 0x5E9C
-0x495D = 0x6016
-0x495E = 0x6276
-0x495F = 0x6577
-0x4960 = 0x65A7
-0x4961 = 0x666E
-0x4962 = 0x6D6E
-0x4963 = 0x7236
-0x4964 = 0x7B26
-0x4965 = 0x8150
-0x4966 = 0x819A
-0x4967 = 0x8299
-0x4968 = 0x8B5C
-0x4969 = 0x8CA0
-0x496A = 0x8CE6
-0x496B = 0x8D74
-0x496C = 0x961C
-0x496D = 0x9644
-0x496E = 0x4FAE
-0x496F = 0x64AB
-0x4970 = 0x6B66
-0x4971 = 0x821E
-0x4972 = 0x8461
-0x4973 = 0x856A
-0x4974 = 0x90E8
-0x4975 = 0x5C01
-0x4976 = 0x6953
-0x4977 = 0x98A8
-0x4978 = 0x847A
-0x4979 = 0x8557
-0x497A = 0x4F0F
-0x497B = 0x526F
-0x497C = 0x5FA9
-0x497D = 0x5E45
-0x497E = 0x670D
-0x4A21 = 0x798F
-0x4A22 = 0x8179
-0x4A23 = 0x8907
-0x4A24 = 0x8986
-0x4A25 = 0x6DF5
-0x4A26 = 0x5F17
-0x4A27 = 0x6255
-0x4A28 = 0x6CB8
-0x4A29 = 0x4ECF
-0x4A2A = 0x7269
-0x4A2B = 0x9B92
-0x4A2C = 0x5206
-0x4A2D = 0x543B
-0x4A2E = 0x5674
-0x4A2F = 0x58B3
-0x4A30 = 0x61A4
-0x4A31 = 0x626E
-0x4A32 = 0x711A
-0x4A33 = 0x596E
-0x4A34 = 0x7C89
-0x4A35 = 0x7CDE
-0x4A36 = 0x7D1B
-0x4A37 = 0x96F0
-0x4A38 = 0x6587
-0x4A39 = 0x805E
-0x4A3A = 0x4E19
-0x4A3B = 0x4F75
-0x4A3C = 0x5175
-0x4A3D = 0x5840
-0x4A3E = 0x5E63
-0x4A3F = 0x5E73
-0x4A40 = 0x5F0A
-0x4A41 = 0x67C4
-0x4A42 = 0x4E26
-0x4A43 = 0x853D
-0x4A44 = 0x9589
-0x4A45 = 0x965B
-0x4A46 = 0x7C73
-0x4A47 = 0x9801
-0x4A48 = 0x50FB
-0x4A49 = 0x58C1
-0x4A4A = 0x7656
-0x4A4B = 0x78A7
-0x4A4C = 0x5225
-0x4A4D = 0x77A5
-0x4A4E = 0x8511
-0x4A4F = 0x7B86
-0x4A50 = 0x504F
-0x4A51 = 0x5909
-0x4A52 = 0x7247
-0x4A53 = 0x7BC7
-0x4A54 = 0x7DE8
-0x4A55 = 0x8FBA
-0x4A56 = 0x8FD4
-0x4A57 = 0x904D
-0x4A58 = 0x4FBF
-0x4A59 = 0x52C9
-0x4A5A = 0x5A29
-0x4A5B = 0x5F01
-0x4A5C = 0x97AD
-0x4A5D = 0x4FDD
-0x4A5E = 0x8217
-0x4A5F = 0x92EA
-0x4A60 = 0x5703
-0x4A61 = 0x6355
-0x4A62 = 0x6B69
-0x4A63 = 0x752B
-0x4A64 = 0x88DC
-0x4A65 = 0x8F14
-0x4A66 = 0x7A42
-0x4A67 = 0x52DF
-0x4A68 = 0x5893
-0x4A69 = 0x6155
-0x4A6A = 0x620A
-0x4A6B = 0x66AE
-0x4A6C = 0x6BCD
-0x4A6D = 0x7C3F
-0x4A6E = 0x83E9
-0x4A6F = 0x5023
-0x4A70 = 0x4FF8
-0x4A71 = 0x5305
-0x4A72 = 0x5446
-0x4A73 = 0x5831
-0x4A74 = 0x5949
-0x4A75 = 0x5B9D
-0x4A76 = 0x5CF0
-0x4A77 = 0x5CEF
-0x4A78 = 0x5D29
-0x4A79 = 0x5E96
-0x4A7A = 0x62B1
-0x4A7B = 0x6367
-0x4A7C = 0x653E
-0x4A7D = 0x65B9
-0x4A7E = 0x670B
-0x4B21 = 0x6CD5
-0x4B22 = 0x6CE1
-0x4B23 = 0x70F9
-0x4B24 = 0x7832
-0x4B25 = 0x7E2B
-0x4B26 = 0x80DE
-0x4B27 = 0x82B3
-0x4B28 = 0x840C
-0x4B29 = 0x84EC
-0x4B2A = 0x8702
-0x4B2B = 0x8912
-0x4B2C = 0x8A2A
-0x4B2D = 0x8C4A
-0x4B2E = 0x90A6
-0x4B2F = 0x92D2
-0x4B30 = 0x98FD
-0x4B31 = 0x9CF3
-0x4B32 = 0x9D6C
-0x4B33 = 0x4E4F
-0x4B34 = 0x4EA1
-0x4B35 = 0x508D
-0x4B36 = 0x5256
-0x4B37 = 0x574A
-0x4B38 = 0x59A8
-0x4B39 = 0x5E3D
-0x4B3A = 0x5FD8
-0x4B3B = 0x5FD9
-0x4B3C = 0x623F
-0x4B3D = 0x66B4
-0x4B3E = 0x671B
-0x4B3F = 0x67D0
-0x4B40 = 0x68D2
-0x4B41 = 0x5192
-0x4B42 = 0x7D21
-0x4B43 = 0x80AA
-0x4B44 = 0x81A8
-0x4B45 = 0x8B00
-0x4B46 = 0x8C8C
-0x4B47 = 0x8CBF
-0x4B48 = 0x927E
-0x4B49 = 0x9632
-0x4B4A = 0x5420
-0x4B4B = 0x982C
-0x4B4C = 0x5317
-0x4B4D = 0x50D5
-0x4B4E = 0x535C
-0x4B4F = 0x58A8
-0x4B50 = 0x64B2
-0x4B51 = 0x6734
-0x4B52 = 0x7267
-0x4B53 = 0x7766
-0x4B54 = 0x7A46
-0x4B55 = 0x91E6
-0x4B56 = 0x52C3
-0x4B57 = 0x6CA1
-0x4B58 = 0x6B86
-0x4B59 = 0x5800
-0x4B5A = 0x5E4C
-0x4B5B = 0x5954
-0x4B5C = 0x672C
-0x4B5D = 0x7FFB
-0x4B5E = 0x51E1
-0x4B5F = 0x76C6
-0x4B60 = 0x6469
-0x4B61 = 0x78E8
-0x4B62 = 0x9B54
-0x4B63 = 0x9EBB
-0x4B64 = 0x57CB
-0x4B65 = 0x59B9
-0x4B66 = 0x6627
-0x4B67 = 0x679A
-0x4B68 = 0x6BCE
-0x4B69 = 0x54E9
-0x4B6A = 0x69D9
-0x4B6B = 0x5E55
-0x4B6C = 0x819C
-0x4B6D = 0x6795
-0x4B6E = 0x9BAA
-0x4B6F = 0x67FE
-0x4B70 = 0x9C52
-0x4B71 = 0x685D
-0x4B72 = 0x4EA6
-0x4B73 = 0x4FE3
-0x4B74 = 0x53C8
-0x4B75 = 0x62B9
-0x4B76 = 0x672B
-0x4B77 = 0x6CAB
-0x4B78 = 0x8FC4
-0x4B79 = 0x4FAD
-0x4B7A = 0x7E6D
-0x4B7B = 0x9EBF
-0x4B7C = 0x4E07
-0x4B7D = 0x6162
-0x4B7E = 0x6E80
-0x4C21 = 0x6F2B
-0x4C22 = 0x8513
-0x4C23 = 0x5473
-0x4C24 = 0x672A
-0x4C25 = 0x9B45
-0x4C26 = 0x5DF3
-0x4C27 = 0x7B95
-0x4C28 = 0x5CAC
-0x4C29 = 0x5BC6
-0x4C2A = 0x871C
-0x4C2B = 0x6E4A
-0x4C2C = 0x84D1
-0x4C2D = 0x7A14
-0x4C2E = 0x8108
-0x4C2F = 0x5999
-0x4C30 = 0x7C8D
-0x4C31 = 0x6C11
-0x4C32 = 0x7720
-0x4C33 = 0x52D9
-0x4C34 = 0x5922
-0x4C35 = 0x7121
-0x4C36 = 0x725F
-0x4C37 = 0x77DB
-0x4C38 = 0x9727
-0x4C39 = 0x9D61
-0x4C3A = 0x690B
-0x4C3B = 0x5A7F
-0x4C3C = 0x5A18
-0x4C3D = 0x51A5
-0x4C3E = 0x540D
-0x4C3F = 0x547D
-0x4C40 = 0x660E
-0x4C41 = 0x76DF
-0x4C42 = 0x8FF7
-0x4C43 = 0x9298
-0x4C44 = 0x9CF4
-0x4C45 = 0x59EA
-0x4C46 = 0x725D
-0x4C47 = 0x6EC5
-0x4C48 = 0x514D
-0x4C49 = 0x68C9
-0x4C4A = 0x7DBF
-0x4C4B = 0x7DEC
-0x4C4C = 0x9762
-0x4C4D = 0x9EBA
-0x4C4E = 0x6478
-0x4C4F = 0x6A21
-0x4C50 = 0x8302
-0x4C51 = 0x5984
-0x4C52 = 0x5B5F
-0x4C53 = 0x6BDB
-0x4C54 = 0x731B
-0x4C55 = 0x76F2
-0x4C56 = 0x7DB2
-0x4C57 = 0x8017
-0x4C58 = 0x8499
-0x4C59 = 0x5132
-0x4C5A = 0x6728
-0x4C5B = 0x9ED9
-0x4C5C = 0x76EE
-0x4C5D = 0x6762
-0x4C5E = 0x52FF
-0x4C5F = 0x9905
-0x4C60 = 0x5C24
-0x4C61 = 0x623B
-0x4C62 = 0x7C7E
-0x4C63 = 0x8CB0
-0x4C64 = 0x554F
-0x4C65 = 0x60B6
-0x4C66 = 0x7D0B
-0x4C67 = 0x9580
-0x4C68 = 0x5301
-0x4C69 = 0x4E5F
-0x4C6A = 0x51B6
-0x4C6B = 0x591C
-0x4C6C = 0x723A
-0x4C6D = 0x8036
-0x4C6E = 0x91CE
-0x4C6F = 0x5F25
-0x4C70 = 0x77E2
-0x4C71 = 0x5384
-0x4C72 = 0x5F79
-0x4C73 = 0x7D04
-0x4C74 = 0x85AC
-0x4C75 = 0x8A33
-0x4C76 = 0x8E8D
-0x4C77 = 0x9756
-0x4C78 = 0x67F3
-0x4C79 = 0x85AE
-0x4C7A = 0x9453
-0x4C7B = 0x6109
-0x4C7C = 0x6108
-0x4C7D = 0x6CB9
-0x4C7E = 0x7652
-0x4D21 = 0x8AED
-0x4D22 = 0x8F38
-0x4D23 = 0x552F
-0x4D24 = 0x4F51
-0x4D25 = 0x512A
-0x4D26 = 0x52C7
-0x4D27 = 0x53CB
-0x4D28 = 0x5BA5
-0x4D29 = 0x5E7D
-0x4D2A = 0x60A0
-0x4D2B = 0x6182
-0x4D2C = 0x63D6
-0x4D2D = 0x6709
-0x4D2E = 0x67DA
-0x4D2F = 0x6E67
-0x4D30 = 0x6D8C
-0x4D31 = 0x7336
-0x4D32 = 0x7337
-0x4D33 = 0x7531
-0x4D34 = 0x7950
-0x4D35 = 0x88D5
-0x4D36 = 0x8A98
-0x4D37 = 0x904A
-0x4D38 = 0x9091
-0x4D39 = 0x90F5
-0x4D3A = 0x96C4
-0x4D3B = 0x878D
-0x4D3C = 0x5915
-0x4D3D = 0x4E88
-0x4D3E = 0x4F59
-0x4D3F = 0x4E0E
-0x4D40 = 0x8A89
-0x4D41 = 0x8F3F
-0x4D42 = 0x9810
-0x4D43 = 0x50AD
-0x4D44 = 0x5E7C
-0x4D45 = 0x5996
-0x4D46 = 0x5BB9
-0x4D47 = 0x5EB8
-0x4D48 = 0x63DA
-0x4D49 = 0x63FA
-0x4D4A = 0x64C1
-0x4D4B = 0x66DC
-0x4D4C = 0x694A
-0x4D4D = 0x69D8
-0x4D4E = 0x6D0B
-0x4D4F = 0x6EB6
-0x4D50 = 0x7194
-0x4D51 = 0x7528
-0x4D52 = 0x7AAF
-0x4D53 = 0x7F8A
-0x4D54 = 0x8000
-0x4D55 = 0x8449
-0x4D56 = 0x84C9
-0x4D57 = 0x8981
-0x4D58 = 0x8B21
-0x4D59 = 0x8E0A
-0x4D5A = 0x9065
-0x4D5B = 0x967D
-0x4D5C = 0x990A
-0x4D5D = 0x617E
-0x4D5E = 0x6291
-0x4D5F = 0x6B32
-0x4D60 = 0x6C83
-0x4D61 = 0x6D74
-0x4D62 = 0x7FCC
-0x4D63 = 0x7FFC
-0x4D64 = 0x6DC0
-0x4D65 = 0x7F85
-0x4D66 = 0x87BA
-0x4D67 = 0x88F8
-0x4D68 = 0x6765
-0x4D69 = 0x83B1
-0x4D6A = 0x983C
-0x4D6B = 0x96F7
-0x4D6C = 0x6D1B
-0x4D6D = 0x7D61
-0x4D6E = 0x843D
-0x4D6F = 0x916A
-0x4D70 = 0x4E71
-0x4D71 = 0x5375
-0x4D72 = 0x5D50
-0x4D73 = 0x6B04
-0x4D74 = 0x6FEB
-0x4D75 = 0x85CD
-0x4D76 = 0x862D
-0x4D77 = 0x89A7
-0x4D78 = 0x5229
-0x4D79 = 0x540F
-0x4D7A = 0x5C65
-0x4D7B = 0x674E
-0x4D7C = 0x68A8
-0x4D7D = 0x7406
-0x4D7E = 0x7483
-0x4E21 = 0x75E2
-0x4E22 = 0x88CF
-0x4E23 = 0x88E1
-0x4E24 = 0x91CC
-0x4E25 = 0x96E2
-0x4E26 = 0x9678
-0x4E27 = 0x5F8B
-0x4E28 = 0x7387
-0x4E29 = 0x7ACB
-0x4E2A = 0x844E
-0x4E2B = 0x63A0
-0x4E2C = 0x7565
-0x4E2D = 0x5289
-0x4E2E = 0x6D41
-0x4E2F = 0x6E9C
-0x4E30 = 0x7409
-0x4E31 = 0x7559
-0x4E32 = 0x786B
-0x4E33 = 0x7C92
-0x4E34 = 0x9686
-0x4E35 = 0x7ADC
-0x4E36 = 0x9F8D
-0x4E37 = 0x4FB6
-0x4E38 = 0x616E
-0x4E39 = 0x65C5
-0x4E3A = 0x865C
-0x4E3B = 0x4E86
-0x4E3C = 0x4EAE
-0x4E3D = 0x50DA
-0x4E3E = 0x4E21
-0x4E3F = 0x51CC
-0x4E40 = 0x5BEE
-0x4E41 = 0x6599
-0x4E42 = 0x6881
-0x4E43 = 0x6DBC
-0x4E44 = 0x731F
-0x4E45 = 0x7642
-0x4E46 = 0x77AD
-0x4E47 = 0x7A1C
-0x4E48 = 0x7CE7
-0x4E49 = 0x826F
-0x4E4A = 0x8AD2
-0x4E4B = 0x907C
-0x4E4C = 0x91CF
-0x4E4D = 0x9675
-0x4E4E = 0x9818
-0x4E4F = 0x529B
-0x4E50 = 0x7DD1
-0x4E51 = 0x502B
-0x4E52 = 0x5398
-0x4E53 = 0x6797
-0x4E54 = 0x6DCB
-0x4E55 = 0x71D0
-0x4E56 = 0x7433
-0x4E57 = 0x81E8
-0x4E58 = 0x8F2A
-0x4E59 = 0x96A3
-0x4E5A = 0x9C57
-0x4E5B = 0x9E9F
-0x4E5C = 0x7460
-0x4E5D = 0x5841
-0x4E5E = 0x6D99
-0x4E5F = 0x7D2F
-0x4E60 = 0x985E
-0x4E61 = 0x4EE4
-0x4E62 = 0x4F36
-0x4E63 = 0x4F8B
-0x4E64 = 0x51B7
-0x4E65 = 0x52B1
-0x4E66 = 0x5DBA
-0x4E67 = 0x601C
-0x4E68 = 0x73B2
-0x4E69 = 0x793C
-0x4E6A = 0x82D3
-0x4E6B = 0x9234
-0x4E6C = 0x96B7
-0x4E6D = 0x96F6
-0x4E6E = 0x970A
-0x4E6F = 0x9E97
-0x4E70 = 0x9F62
-0x4E71 = 0x66A6
-0x4E72 = 0x6B74
-0x4E73 = 0x5217
-0x4E74 = 0x52A3
-0x4E75 = 0x70C8
-0x4E76 = 0x88C2
-0x4E77 = 0x5EC9
-0x4E78 = 0x604B
-0x4E79 = 0x6190
-0x4E7A = 0x6F23
-0x4E7B = 0x7149
-0x4E7C = 0x7C3E
-0x4E7D = 0x7DF4
-0x4E7E = 0x806F
-0x4F21 = 0x84EE
-0x4F22 = 0x9023
-0x4F23 = 0x932C
-0x4F24 = 0x5442
-0x4F25 = 0x9B6F
-0x4F26 = 0x6AD3
-0x4F27 = 0x7089
-0x4F28 = 0x8CC2
-0x4F29 = 0x8DEF
-0x4F2A = 0x9732
-0x4F2B = 0x52B4
-0x4F2C = 0x5A41
-0x4F2D = 0x5ECA
-0x4F2E = 0x5F04
-0x4F2F = 0x6717
-0x4F30 = 0x697C
-0x4F31 = 0x6994
-0x4F32 = 0x6D6A
-0x4F33 = 0x6F0F
-0x4F34 = 0x7262
-0x4F35 = 0x72FC
-0x4F36 = 0x7BED
-0x4F37 = 0x8001
-0x4F38 = 0x807E
-0x4F39 = 0x874B
-0x4F3A = 0x90CE
-0x4F3B = 0x516D
-0x4F3C = 0x9E93
-0x4F3D = 0x7984
-0x4F3E = 0x808B
-0x4F3F = 0x9332
-0x4F40 = 0x8AD6
-0x4F41 = 0x502D
-0x4F42 = 0x548C
-0x4F43 = 0x8A71
-0x4F44 = 0x6B6A
-0x4F45 = 0x8CC4
-0x4F46 = 0x8107
-0x4F47 = 0x60D1
-0x4F48 = 0x67A0
-0x4F49 = 0x9DF2
-0x4F4A = 0x4E99
-0x4F4B = 0x4E98
-0x4F4C = 0x9C10
-0x4F4D = 0x8A6B
-0x4F4E = 0x85C1
-0x4F4F = 0x8568
-0x4F50 = 0x6900
-0x4F51 = 0x6E7E
-0x4F52 = 0x7897
-0x4F53 = 0x8155
-0x5021 = 0x5F0C
-0x5022 = 0x4E10
-0x5023 = 0x4E15
-0x5024 = 0x4E2A
-0x5025 = 0x4E31
-0x5026 = 0x4E36
-0x5027 = 0x4E3C
-0x5028 = 0x4E3F
-0x5029 = 0x4E42
-0x502A = 0x4E56
-0x502B = 0x4E58
-0x502C = 0x4E82
-0x502D = 0x4E85
-0x502E = 0x8C6B
-0x502F = 0x4E8A
-0x5030 = 0x8212
-0x5031 = 0x5F0D
-0x5032 = 0x4E8E
-0x5033 = 0x4E9E
-0x5034 = 0x4E9F
-0x5035 = 0x4EA0
-0x5036 = 0x4EA2
-0x5037 = 0x4EB0
-0x5038 = 0x4EB3
-0x5039 = 0x4EB6
-0x503A = 0x4ECE
-0x503B = 0x4ECD
-0x503C = 0x4EC4
-0x503D = 0x4EC6
-0x503E = 0x4EC2
-0x503F = 0x4ED7
-0x5040 = 0x4EDE
-0x5041 = 0x4EED
-0x5042 = 0x4EDF
-0x5043 = 0x4EF7
-0x5044 = 0x4F09
-0x5045 = 0x4F5A
-0x5046 = 0x4F30
-0x5047 = 0x4F5B
-0x5048 = 0x4F5D
-0x5049 = 0x4F57
-0x504A = 0x4F47
-0x504B = 0x4F76
-0x504C = 0x4F88
-0x504D = 0x4F8F
-0x504E = 0x4F98
-0x504F = 0x4F7B
-0x5050 = 0x4F69
-0x5051 = 0x4F70
-0x5052 = 0x4F91
-0x5053 = 0x4F6F
-0x5054 = 0x4F86
-0x5055 = 0x4F96
-0x5056 = 0x5118
-0x5057 = 0x4FD4
-0x5058 = 0x4FDF
-0x5059 = 0x4FCE
-0x505A = 0x4FD8
-0x505B = 0x4FDB
-0x505C = 0x4FD1
-0x505D = 0x4FDA
-0x505E = 0x4FD0
-0x505F = 0x4FE4
-0x5060 = 0x4FE5
-0x5061 = 0x501A
-0x5062 = 0x5028
-0x5063 = 0x5014
-0x5064 = 0x502A
-0x5065 = 0x5025
-0x5066 = 0x5005
-0x5067 = 0x4F1C
-0x5068 = 0x4FF6
-0x5069 = 0x5021
-0x506A = 0x5029
-0x506B = 0x502C
-0x506C = 0x4FFE
-0x506D = 0x4FEF
-0x506E = 0x5011
-0x506F = 0x5006
-0x5070 = 0x5043
-0x5071 = 0x5047
-0x5072 = 0x6703
-0x5073 = 0x5055
-0x5074 = 0x5050
-0x5075 = 0x5048
-0x5076 = 0x505A
-0x5077 = 0x5056
-0x5078 = 0x506C
-0x5079 = 0x5078
-0x507A = 0x5080
-0x507B = 0x509A
-0x507C = 0x5085
-0x507D = 0x50B4
-0x507E = 0x50B2
-0x5121 = 0x50C9
-0x5122 = 0x50CA
-0x5123 = 0x50B3
-0x5124 = 0x50C2
-0x5125 = 0x50D6
-0x5126 = 0x50DE
-0x5127 = 0x50E5
-0x5128 = 0x50ED
-0x5129 = 0x50E3
-0x512A = 0x50EE
-0x512B = 0x50F9
-0x512C = 0x50F5
-0x512D = 0x5109
-0x512E = 0x5101
-0x512F = 0x5102
-0x5130 = 0x5116
-0x5131 = 0x5115
-0x5132 = 0x5114
-0x5133 = 0x511A
-0x5134 = 0x5121
-0x5135 = 0x513A
-0x5136 = 0x5137
-0x5137 = 0x513C
-0x5138 = 0x513B
-0x5139 = 0x513F
-0x513A = 0x5140
-0x513B = 0x5152
-0x513C = 0x514C
-0x513D = 0x5154
-0x513E = 0x5162
-0x513F = 0x7AF8
-0x5140 = 0x5169
-0x5141 = 0x516A
-0x5142 = 0x516E
-0x5143 = 0x5180
-0x5144 = 0x5182
-0x5145 = 0x56D8
-0x5146 = 0x518C
-0x5147 = 0x5189
-0x5148 = 0x518F
-0x5149 = 0x5191
-0x514A = 0x5193
-0x514B = 0x5195
-0x514C = 0x5196
-0x514D = 0x51A4
-0x514E = 0x51A6
-0x514F = 0x51A2
-0x5150 = 0x51A9
-0x5151 = 0x51AA
-0x5152 = 0x51AB
-0x5153 = 0x51B3
-0x5154 = 0x51B1
-0x5155 = 0x51B2
-0x5156 = 0x51B0
-0x5157 = 0x51B5
-0x5158 = 0x51BD
-0x5159 = 0x51C5
-0x515A = 0x51C9
-0x515B = 0x51DB
-0x515C = 0x51E0
-0x515D = 0x8655
-0x515E = 0x51E9
-0x515F = 0x51ED
-0x5160 = 0x51F0
-0x5161 = 0x51F5
-0x5162 = 0x51FE
-0x5163 = 0x5204
-0x5164 = 0x520B
-0x5165 = 0x5214
-0x5166 = 0x520E
-0x5167 = 0x5227
-0x5168 = 0x522A
-0x5169 = 0x522E
-0x516A = 0x5233
-0x516B = 0x5239
-0x516C = 0x524F
-0x516D = 0x5244
-0x516E = 0x524B
-0x516F = 0x524C
-0x5170 = 0x525E
-0x5171 = 0x5254
-0x5172 = 0x526A
-0x5173 = 0x5274
-0x5174 = 0x5269
-0x5175 = 0x5273
-0x5176 = 0x527F
-0x5177 = 0x527D
-0x5178 = 0x528D
-0x5179 = 0x5294
-0x517A = 0x5292
-0x517B = 0x5271
-0x517C = 0x5288
-0x517D = 0x5291
-0x517E = 0x8FA8
-0x5221 = 0x8FA7
-0x5222 = 0x52AC
-0x5223 = 0x52AD
-0x5224 = 0x52BC
-0x5225 = 0x52B5
-0x5226 = 0x52C1
-0x5227 = 0x52CD
-0x5228 = 0x52D7
-0x5229 = 0x52DE
-0x522A = 0x52E3
-0x522B = 0x52E6
-0x522C = 0x98ED
-0x522D = 0x52E0
-0x522E = 0x52F3
-0x522F = 0x52F5
-0x5230 = 0x52F8
-0x5231 = 0x52F9
-0x5232 = 0x5306
-0x5233 = 0x5308
-0x5234 = 0x7538
-0x5235 = 0x530D
-0x5236 = 0x5310
-0x5237 = 0x530F
-0x5238 = 0x5315
-0x5239 = 0x531A
-0x523A = 0x5323
-0x523B = 0x532F
-0x523C = 0x5331
-0x523D = 0x5333
-0x523E = 0x5338
-0x523F = 0x5340
-0x5240 = 0x5346
-0x5241 = 0x5345
-0x5242 = 0x4E17
-0x5243 = 0x5349
-0x5244 = 0x534D
-0x5245 = 0x51D6
-0x5246 = 0x535E
-0x5247 = 0x5369
-0x5248 = 0x536E
-0x5249 = 0x5918
-0x524A = 0x537B
-0x524B = 0x5377
-0x524C = 0x5382
-0x524D = 0x5396
-0x524E = 0x53A0
-0x524F = 0x53A6
-0x5250 = 0x53A5
-0x5251 = 0x53AE
-0x5252 = 0x53B0
-0x5253 = 0x53B6
-0x5254 = 0x53C3
-0x5255 = 0x7C12
-0x5256 = 0x96D9
-0x5257 = 0x53DF
-0x5258 = 0x66FC
-0x5259 = 0x71EE
-0x525A = 0x53EE
-0x525B = 0x53E8
-0x525C = 0x53ED
-0x525D = 0x53FA
-0x525E = 0x5401
-0x525F = 0x543D
-0x5260 = 0x5440
-0x5261 = 0x542C
-0x5262 = 0x542D
-0x5263 = 0x543C
-0x5264 = 0x542E
-0x5265 = 0x5436
-0x5266 = 0x5429
-0x5267 = 0x541D
-0x5268 = 0x544E
-0x5269 = 0x548F
-0x526A = 0x5475
-0x526B = 0x548E
-0x526C = 0x545F
-0x526D = 0x5471
-0x526E = 0x5477
-0x526F = 0x5470
-0x5270 = 0x5492
-0x5271 = 0x547B
-0x5272 = 0x5480
-0x5273 = 0x5476
-0x5274 = 0x5484
-0x5275 = 0x5490
-0x5276 = 0x5486
-0x5277 = 0x54C7
-0x5278 = 0x54A2
-0x5279 = 0x54B8
-0x527A = 0x54A5
-0x527B = 0x54AC
-0x527C = 0x54C4
-0x527D = 0x54C8
-0x527E = 0x54A8
-0x5321 = 0x54AB
-0x5322 = 0x54C2
-0x5323 = 0x54A4
-0x5324 = 0x54BE
-0x5325 = 0x54BC
-0x5326 = 0x54D8
-0x5327 = 0x54E5
-0x5328 = 0x54E6
-0x5329 = 0x550F
-0x532A = 0x5514
-0x532B = 0x54FD
-0x532C = 0x54EE
-0x532D = 0x54ED
-0x532E = 0x54FA
-0x532F = 0x54E2
-0x5330 = 0x5539
-0x5331 = 0x5540
-0x5332 = 0x5563
-0x5333 = 0x554C
-0x5334 = 0x552E
-0x5335 = 0x555C
-0x5336 = 0x5545
-0x5337 = 0x5556
-0x5338 = 0x5557
-0x5339 = 0x5538
-0x533A = 0x5533
-0x533B = 0x555D
-0x533C = 0x5599
-0x533D = 0x5580
-0x533E = 0x54AF
-0x533F = 0x558A
-0x5340 = 0x559F
-0x5341 = 0x557B
-0x5342 = 0x557E
-0x5343 = 0x5598
-0x5344 = 0x559E
-0x5345 = 0x55AE
-0x5346 = 0x557C
-0x5347 = 0x5583
-0x5348 = 0x55A9
-0x5349 = 0x5587
-0x534A = 0x55A8
-0x534B = 0x55DA
-0x534C = 0x55C5
-0x534D = 0x55DF
-0x534E = 0x55C4
-0x534F = 0x55DC
-0x5350 = 0x55E4
-0x5351 = 0x55D4
-0x5352 = 0x5614
-0x5353 = 0x55F7
-0x5354 = 0x5616
-0x5355 = 0x55FE
-0x5356 = 0x55FD
-0x5357 = 0x561B
-0x5358 = 0x55F9
-0x5359 = 0x564E
-0x535A = 0x5650
-0x535B = 0x71DF
-0x535C = 0x5634
-0x535D = 0x5636
-0x535E = 0x5632
-0x535F = 0x5638
-0x5360 = 0x566B
-0x5361 = 0x5664
-0x5362 = 0x562F
-0x5363 = 0x566C
-0x5364 = 0x566A
-0x5365 = 0x5686
-0x5366 = 0x5680
-0x5367 = 0x568A
-0x5368 = 0x56A0
-0x5369 = 0x5694
-0x536A = 0x568F
-0x536B = 0x56A5
-0x536C = 0x56AE
-0x536D = 0x56B6
-0x536E = 0x56B4
-0x536F = 0x56C2
-0x5370 = 0x56BC
-0x5371 = 0x56C1
-0x5372 = 0x56C3
-0x5373 = 0x56C0
-0x5374 = 0x56C8
-0x5375 = 0x56CE
-0x5376 = 0x56D1
-0x5377 = 0x56D3
-0x5378 = 0x56D7
-0x5379 = 0x56EE
-0x537A = 0x56F9
-0x537B = 0x5700
-0x537C = 0x56FF
-0x537D = 0x5704
-0x537E = 0x5709
-0x5421 = 0x5708
-0x5422 = 0x570B
-0x5423 = 0x570D
-0x5424 = 0x5713
-0x5425 = 0x5718
-0x5426 = 0x5716
-0x5427 = 0x55C7
-0x5428 = 0x571C
-0x5429 = 0x5726
-0x542A = 0x5737
-0x542B = 0x5738
-0x542C = 0x574E
-0x542D = 0x573B
-0x542E = 0x5740
-0x542F = 0x574F
-0x5430 = 0x5769
-0x5431 = 0x57C0
-0x5432 = 0x5788
-0x5433 = 0x5761
-0x5434 = 0x577F
-0x5435 = 0x5789
-0x5436 = 0x5793
-0x5437 = 0x57A0
-0x5438 = 0x57B3
-0x5439 = 0x57A4
-0x543A = 0x57AA
-0x543B = 0x57B0
-0x543C = 0x57C3
-0x543D = 0x57C6
-0x543E = 0x57D4
-0x543F = 0x57D2
-0x5440 = 0x57D3
-0x5441 = 0x580A
-0x5442 = 0x57D6
-0x5443 = 0x57E3
-0x5444 = 0x580B
-0x5445 = 0x5819
-0x5446 = 0x581D
-0x5447 = 0x5872
-0x5448 = 0x5821
-0x5449 = 0x5862
-0x544A = 0x584B
-0x544B = 0x5870
-0x544C = 0x6BC0
-0x544D = 0x5852
-0x544E = 0x583D
-0x544F = 0x5879
-0x5450 = 0x5885
-0x5451 = 0x58B9
-0x5452 = 0x589F
-0x5453 = 0x58AB
-0x5454 = 0x58BA
-0x5455 = 0x58DE
-0x5456 = 0x58BB
-0x5457 = 0x58B8
-0x5458 = 0x58AE
-0x5459 = 0x58C5
-0x545A = 0x58D3
-0x545B = 0x58D1
-0x545C = 0x58D7
-0x545D = 0x58D9
-0x545E = 0x58D8
-0x545F = 0x58E5
-0x5460 = 0x58DC
-0x5461 = 0x58E4
-0x5462 = 0x58DF
-0x5463 = 0x58EF
-0x5464 = 0x58FA
-0x5465 = 0x58F9
-0x5466 = 0x58FB
-0x5467 = 0x58FC
-0x5468 = 0x58FD
-0x5469 = 0x5902
-0x546A = 0x590A
-0x546B = 0x5910
-0x546C = 0x591B
-0x546D = 0x68A6
-0x546E = 0x5925
-0x546F = 0x592C
-0x5470 = 0x592D
-0x5471 = 0x5932
-0x5472 = 0x5938
-0x5473 = 0x593E
-0x5474 = 0x7AD2
-0x5475 = 0x5955
-0x5476 = 0x5950
-0x5477 = 0x594E
-0x5478 = 0x595A
-0x5479 = 0x5958
-0x547A = 0x5962
-0x547B = 0x5960
-0x547C = 0x5967
-0x547D = 0x596C
-0x547E = 0x5969
-0x5521 = 0x5978
-0x5522 = 0x5981
-0x5523 = 0x599D
-0x5524 = 0x4F5E
-0x5525 = 0x4FAB
-0x5526 = 0x59A3
-0x5527 = 0x59B2
-0x5528 = 0x59C6
-0x5529 = 0x59E8
-0x552A = 0x59DC
-0x552B = 0x598D
-0x552C = 0x59D9
-0x552D = 0x59DA
-0x552E = 0x5A25
-0x552F = 0x5A1F
-0x5530 = 0x5A11
-0x5531 = 0x5A1C
-0x5532 = 0x5A09
-0x5533 = 0x5A1A
-0x5534 = 0x5A40
-0x5535 = 0x5A6C
-0x5536 = 0x5A49
-0x5537 = 0x5A35
-0x5538 = 0x5A36
-0x5539 = 0x5A62
-0x553A = 0x5A6A
-0x553B = 0x5A9A
-0x553C = 0x5ABC
-0x553D = 0x5ABE
-0x553E = 0x5ACB
-0x553F = 0x5AC2
-0x5540 = 0x5ABD
-0x5541 = 0x5AE3
-0x5542 = 0x5AD7
-0x5543 = 0x5AE6
-0x5544 = 0x5AE9
-0x5545 = 0x5AD6
-0x5546 = 0x5AFA
-0x5547 = 0x5AFB
-0x5548 = 0x5B0C
-0x5549 = 0x5B0B
-0x554A = 0x5B16
-0x554B = 0x5B32
-0x554C = 0x5AD0
-0x554D = 0x5B2A
-0x554E = 0x5B36
-0x554F = 0x5B3E
-0x5550 = 0x5B43
-0x5551 = 0x5B45
-0x5552 = 0x5B40
-0x5553 = 0x5B51
-0x5554 = 0x5B55
-0x5555 = 0x5B5A
-0x5556 = 0x5B5B
-0x5557 = 0x5B65
-0x5558 = 0x5B69
-0x5559 = 0x5B70
-0x555A = 0x5B73
-0x555B = 0x5B75
-0x555C = 0x5B78
-0x555D = 0x6588
-0x555E = 0x5B7A
-0x555F = 0x5B80
-0x5560 = 0x5B83
-0x5561 = 0x5BA6
-0x5562 = 0x5BB8
-0x5563 = 0x5BC3
-0x5564 = 0x5BC7
-0x5565 = 0x5BC9
-0x5566 = 0x5BD4
-0x5567 = 0x5BD0
-0x5568 = 0x5BE4
-0x5569 = 0x5BE6
-0x556A = 0x5BE2
-0x556B = 0x5BDE
-0x556C = 0x5BE5
-0x556D = 0x5BEB
-0x556E = 0x5BF0
-0x556F = 0x5BF6
-0x5570 = 0x5BF3
-0x5571 = 0x5C05
-0x5572 = 0x5C07
-0x5573 = 0x5C08
-0x5574 = 0x5C0D
-0x5575 = 0x5C13
-0x5576 = 0x5C20
-0x5577 = 0x5C22
-0x5578 = 0x5C28
-0x5579 = 0x5C38
-0x557A = 0x5C39
-0x557B = 0x5C41
-0x557C = 0x5C46
-0x557D = 0x5C4E
-0x557E = 0x5C53
-0x5621 = 0x5C50
-0x5622 = 0x5C4F
-0x5623 = 0x5B71
-0x5624 = 0x5C6C
-0x5625 = 0x5C6E
-0x5626 = 0x4E62
-0x5627 = 0x5C76
-0x5628 = 0x5C79
-0x5629 = 0x5C8C
-0x562A = 0x5C91
-0x562B = 0x5C94
-0x562C = 0x599B
-0x562D = 0x5CAB
-0x562E = 0x5CBB
-0x562F = 0x5CB6
-0x5630 = 0x5CBC
-0x5631 = 0x5CB7
-0x5632 = 0x5CC5
-0x5633 = 0x5CBE
-0x5634 = 0x5CC7
-0x5635 = 0x5CD9
-0x5636 = 0x5CE9
-0x5637 = 0x5CFD
-0x5638 = 0x5CFA
-0x5639 = 0x5CED
-0x563A = 0x5D8C
-0x563B = 0x5CEA
-0x563C = 0x5D0B
-0x563D = 0x5D15
-0x563E = 0x5D17
-0x563F = 0x5D5C
-0x5640 = 0x5D1F
-0x5641 = 0x5D1B
-0x5642 = 0x5D11
-0x5643 = 0x5D14
-0x5644 = 0x5D22
-0x5645 = 0x5D1A
-0x5646 = 0x5D19
-0x5647 = 0x5D18
-0x5648 = 0x5D4C
-0x5649 = 0x5D52
-0x564A = 0x5D4E
-0x564B = 0x5D4B
-0x564C = 0x5D6C
-0x564D = 0x5D73
-0x564E = 0x5D76
-0x564F = 0x5D87
-0x5650 = 0x5D84
-0x5651 = 0x5D82
-0x5652 = 0x5DA2
-0x5653 = 0x5D9D
-0x5654 = 0x5DAC
-0x5655 = 0x5DAE
-0x5656 = 0x5DBD
-0x5657 = 0x5D90
-0x5658 = 0x5DB7
-0x5659 = 0x5DBC
-0x565A = 0x5DC9
-0x565B = 0x5DCD
-0x565C = 0x5DD3
-0x565D = 0x5DD2
-0x565E = 0x5DD6
-0x565F = 0x5DDB
-0x5660 = 0x5DEB
-0x5661 = 0x5DF2
-0x5662 = 0x5DF5
-0x5663 = 0x5E0B
-0x5664 = 0x5E1A
-0x5665 = 0x5E19
-0x5666 = 0x5E11
-0x5667 = 0x5E1B
-0x5668 = 0x5E36
-0x5669 = 0x5E37
-0x566A = 0x5E44
-0x566B = 0x5E43
-0x566C = 0x5E40
-0x566D = 0x5E4E
-0x566E = 0x5E57
-0x566F = 0x5E54
-0x5670 = 0x5E5F
-0x5671 = 0x5E62
-0x5672 = 0x5E64
-0x5673 = 0x5E47
-0x5674 = 0x5E75
-0x5675 = 0x5E76
-0x5676 = 0x5E7A
-0x5677 = 0x9EBC
-0x5678 = 0x5E7F
-0x5679 = 0x5EA0
-0x567A = 0x5EC1
-0x567B = 0x5EC2
-0x567C = 0x5EC8
-0x567D = 0x5ED0
-0x567E = 0x5ECF
-0x5721 = 0x5ED6
-0x5722 = 0x5EE3
-0x5723 = 0x5EDD
-0x5724 = 0x5EDA
-0x5725 = 0x5EDB
-0x5726 = 0x5EE2
-0x5727 = 0x5EE1
-0x5728 = 0x5EE8
-0x5729 = 0x5EE9
-0x572A = 0x5EEC
-0x572B = 0x5EF1
-0x572C = 0x5EF3
-0x572D = 0x5EF0
-0x572E = 0x5EF4
-0x572F = 0x5EF8
-0x5730 = 0x5EFE
-0x5731 = 0x5F03
-0x5732 = 0x5F09
-0x5733 = 0x5F5D
-0x5734 = 0x5F5C
-0x5735 = 0x5F0B
-0x5736 = 0x5F11
-0x5737 = 0x5F16
-0x5738 = 0x5F29
-0x5739 = 0x5F2D
-0x573A = 0x5F38
-0x573B = 0x5F41
-0x573C = 0x5F48
-0x573D = 0x5F4C
-0x573E = 0x5F4E
-0x573F = 0x5F2F
-0x5740 = 0x5F51
-0x5741 = 0x5F56
-0x5742 = 0x5F57
-0x5743 = 0x5F59
-0x5744 = 0x5F61
-0x5745 = 0x5F6D
-0x5746 = 0x5F73
-0x5747 = 0x5F77
-0x5748 = 0x5F83
-0x5749 = 0x5F82
-0x574A = 0x5F7F
-0x574B = 0x5F8A
-0x574C = 0x5F88
-0x574D = 0x5F91
-0x574E = 0x5F87
-0x574F = 0x5F9E
-0x5750 = 0x5F99
-0x5751 = 0x5F98
-0x5752 = 0x5FA0
-0x5753 = 0x5FA8
-0x5754 = 0x5FAD
-0x5755 = 0x5FBC
-0x5756 = 0x5FD6
-0x5757 = 0x5FFB
-0x5758 = 0x5FE4
-0x5759 = 0x5FF8
-0x575A = 0x5FF1
-0x575B = 0x5FDD
-0x575C = 0x60B3
-0x575D = 0x5FFF
-0x575E = 0x6021
-0x575F = 0x6060
-0x5760 = 0x6019
-0x5761 = 0x6010
-0x5762 = 0x6029
-0x5763 = 0x600E
-0x5764 = 0x6031
-0x5765 = 0x601B
-0x5766 = 0x6015
-0x5767 = 0x602B
-0x5768 = 0x6026
-0x5769 = 0x600F
-0x576A = 0x603A
-0x576B = 0x605A
-0x576C = 0x6041
-0x576D = 0x606A
-0x576E = 0x6077
-0x576F = 0x605F
-0x5770 = 0x604A
-0x5771 = 0x6046
-0x5772 = 0x604D
-0x5773 = 0x6063
-0x5774 = 0x6043
-0x5775 = 0x6064
-0x5776 = 0x6042
-0x5777 = 0x606C
-0x5778 = 0x606B
-0x5779 = 0x6059
-0x577A = 0x6081
-0x577B = 0x608D
-0x577C = 0x60E7
-0x577D = 0x6083
-0x577E = 0x609A
-0x5821 = 0x6084
-0x5822 = 0x609B
-0x5823 = 0x6096
-0x5824 = 0x6097
-0x5825 = 0x6092
-0x5826 = 0x60A7
-0x5827 = 0x608B
-0x5828 = 0x60E1
-0x5829 = 0x60B8
-0x582A = 0x60E0
-0x582B = 0x60D3
-0x582C = 0x60B4
-0x582D = 0x5FF0
-0x582E = 0x60BD
-0x582F = 0x60C6
-0x5830 = 0x60B5
-0x5831 = 0x60D8
-0x5832 = 0x614D
-0x5833 = 0x6115
-0x5834 = 0x6106
-0x5835 = 0x60F6
-0x5836 = 0x60F7
-0x5837 = 0x6100
-0x5838 = 0x60F4
-0x5839 = 0x60FA
-0x583A = 0x6103
-0x583B = 0x6121
-0x583C = 0x60FB
-0x583D = 0x60F1
-0x583E = 0x610D
-0x583F = 0x610E
-0x5840 = 0x6147
-0x5841 = 0x613E
-0x5842 = 0x6128
-0x5843 = 0x6127
-0x5844 = 0x614A
-0x5845 = 0x613F
-0x5846 = 0x613C
-0x5847 = 0x612C
-0x5848 = 0x6134
-0x5849 = 0x613D
-0x584A = 0x6142
-0x584B = 0x6144
-0x584C = 0x6173
-0x584D = 0x6177
-0x584E = 0x6158
-0x584F = 0x6159
-0x5850 = 0x615A
-0x5851 = 0x616B
-0x5852 = 0x6174
-0x5853 = 0x616F
-0x5854 = 0x6165
-0x5855 = 0x6171
-0x5856 = 0x615F
-0x5857 = 0x615D
-0x5858 = 0x6153
-0x5859 = 0x6175
-0x585A = 0x6199
-0x585B = 0x6196
-0x585C = 0x6187
-0x585D = 0x61AC
-0x585E = 0x6194
-0x585F = 0x619A
-0x5860 = 0x618A
-0x5861 = 0x6191
-0x5862 = 0x61AB
-0x5863 = 0x61AE
-0x5864 = 0x61CC
-0x5865 = 0x61CA
-0x5866 = 0x61C9
-0x5867 = 0x61F7
-0x5868 = 0x61C8
-0x5869 = 0x61C3
-0x586A = 0x61C6
-0x586B = 0x61BA
-0x586C = 0x61CB
-0x586D = 0x7F79
-0x586E = 0x61CD
-0x586F = 0x61E6
-0x5870 = 0x61E3
-0x5871 = 0x61F6
-0x5872 = 0x61FA
-0x5873 = 0x61F4
-0x5874 = 0x61FF
-0x5875 = 0x61FD
-0x5876 = 0x61FC
-0x5877 = 0x61FE
-0x5878 = 0x6200
-0x5879 = 0x6208
-0x587A = 0x6209
-0x587B = 0x620D
-0x587C = 0x620C
-0x587D = 0x6214
-0x587E = 0x621B
-0x5921 = 0x621E
-0x5922 = 0x6221
-0x5923 = 0x622A
-0x5924 = 0x622E
-0x5925 = 0x6230
-0x5926 = 0x6232
-0x5927 = 0x6233
-0x5928 = 0x6241
-0x5929 = 0x624E
-0x592A = 0x625E
-0x592B = 0x6263
-0x592C = 0x625B
-0x592D = 0x6260
-0x592E = 0x6268
-0x592F = 0x627C
-0x5930 = 0x6282
-0x5931 = 0x6289
-0x5932 = 0x627E
-0x5933 = 0x6292
-0x5934 = 0x6293
-0x5935 = 0x6296
-0x5936 = 0x62D4
-0x5937 = 0x6283
-0x5938 = 0x6294
-0x5939 = 0x62D7
-0x593A = 0x62D1
-0x593B = 0x62BB
-0x593C = 0x62CF
-0x593D = 0x62FF
-0x593E = 0x62C6
-0x593F = 0x64D4
-0x5940 = 0x62C8
-0x5941 = 0x62DC
-0x5942 = 0x62CC
-0x5943 = 0x62CA
-0x5944 = 0x62C2
-0x5945 = 0x62C7
-0x5946 = 0x629B
-0x5947 = 0x62C9
-0x5948 = 0x630C
-0x5949 = 0x62EE
-0x594A = 0x62F1
-0x594B = 0x6327
-0x594C = 0x6302
-0x594D = 0x6308
-0x594E = 0x62EF
-0x594F = 0x62F5
-0x5950 = 0x6350
-0x5951 = 0x633E
-0x5952 = 0x634D
-0x5953 = 0x641C
-0x5954 = 0x634F
-0x5955 = 0x6396
-0x5956 = 0x638E
-0x5957 = 0x6380
-0x5958 = 0x63AB
-0x5959 = 0x6376
-0x595A = 0x63A3
-0x595B = 0x638F
-0x595C = 0x6389
-0x595D = 0x639F
-0x595E = 0x63B5
-0x595F = 0x636B
-0x5960 = 0x6369
-0x5961 = 0x63BE
-0x5962 = 0x63E9
-0x5963 = 0x63C0
-0x5964 = 0x63C6
-0x5965 = 0x63E3
-0x5966 = 0x63C9
-0x5967 = 0x63D2
-0x5968 = 0x63F6
-0x5969 = 0x63C4
-0x596A = 0x6416
-0x596B = 0x6434
-0x596C = 0x6406
-0x596D = 0x6413
-0x596E = 0x6426
-0x596F = 0x6436
-0x5970 = 0x651D
-0x5971 = 0x6417
-0x5972 = 0x6428
-0x5973 = 0x640F
-0x5974 = 0x6467
-0x5975 = 0x646F
-0x5976 = 0x6476
-0x5977 = 0x644E
-0x5978 = 0x652A
-0x5979 = 0x6495
-0x597A = 0x6493
-0x597B = 0x64A5
-0x597C = 0x64A9
-0x597D = 0x6488
-0x597E = 0x64BC
-0x5A21 = 0x64DA
-0x5A22 = 0x64D2
-0x5A23 = 0x64C5
-0x5A24 = 0x64C7
-0x5A25 = 0x64BB
-0x5A26 = 0x64D8
-0x5A27 = 0x64C2
-0x5A28 = 0x64F1
-0x5A29 = 0x64E7
-0x5A2A = 0x8209
-0x5A2B = 0x64E0
-0x5A2C = 0x64E1
-0x5A2D = 0x62AC
-0x5A2E = 0x64E3
-0x5A2F = 0x64EF
-0x5A30 = 0x652C
-0x5A31 = 0x64F6
-0x5A32 = 0x64F4
-0x5A33 = 0x64F2
-0x5A34 = 0x64FA
-0x5A35 = 0x6500
-0x5A36 = 0x64FD
-0x5A37 = 0x6518
-0x5A38 = 0x651C
-0x5A39 = 0x6505
-0x5A3A = 0x6524
-0x5A3B = 0x6523
-0x5A3C = 0x652B
-0x5A3D = 0x6534
-0x5A3E = 0x6535
-0x5A3F = 0x6537
-0x5A40 = 0x6536
-0x5A41 = 0x6538
-0x5A42 = 0x754B
-0x5A43 = 0x6548
-0x5A44 = 0x6556
-0x5A45 = 0x6555
-0x5A46 = 0x654D
-0x5A47 = 0x6558
-0x5A48 = 0x655E
-0x5A49 = 0x655D
-0x5A4A = 0x6572
-0x5A4B = 0x6578
-0x5A4C = 0x6582
-0x5A4D = 0x6583
-0x5A4E = 0x8B8A
-0x5A4F = 0x659B
-0x5A50 = 0x659F
-0x5A51 = 0x65AB
-0x5A52 = 0x65B7
-0x5A53 = 0x65C3
-0x5A54 = 0x65C6
-0x5A55 = 0x65C1
-0x5A56 = 0x65C4
-0x5A57 = 0x65CC
-0x5A58 = 0x65D2
-0x5A59 = 0x65DB
-0x5A5A = 0x65D9
-0x5A5B = 0x65E0
-0x5A5C = 0x65E1
-0x5A5D = 0x65F1
-0x5A5E = 0x6772
-0x5A5F = 0x660A
-0x5A60 = 0x6603
-0x5A61 = 0x65FB
-0x5A62 = 0x6773
-0x5A63 = 0x6635
-0x5A64 = 0x6636
-0x5A65 = 0x6634
-0x5A66 = 0x661C
-0x5A67 = 0x664F
-0x5A68 = 0x6644
-0x5A69 = 0x6649
-0x5A6A = 0x6641
-0x5A6B = 0x665E
-0x5A6C = 0x665D
-0x5A6D = 0x6664
-0x5A6E = 0x6667
-0x5A6F = 0x6668
-0x5A70 = 0x665F
-0x5A71 = 0x6662
-0x5A72 = 0x6670
-0x5A73 = 0x6683
-0x5A74 = 0x6688
-0x5A75 = 0x668E
-0x5A76 = 0x6689
-0x5A77 = 0x6684
-0x5A78 = 0x6698
-0x5A79 = 0x669D
-0x5A7A = 0x66C1
-0x5A7B = 0x66B9
-0x5A7C = 0x66C9
-0x5A7D = 0x66BE
-0x5A7E = 0x66BC
-0x5B21 = 0x66C4
-0x5B22 = 0x66B8
-0x5B23 = 0x66D6
-0x5B24 = 0x66DA
-0x5B25 = 0x66E0
-0x5B26 = 0x663F
-0x5B27 = 0x66E6
-0x5B28 = 0x66E9
-0x5B29 = 0x66F0
-0x5B2A = 0x66F5
-0x5B2B = 0x66F7
-0x5B2C = 0x670F
-0x5B2D = 0x6716
-0x5B2E = 0x671E
-0x5B2F = 0x6726
-0x5B30 = 0x6727
-0x5B31 = 0x9738
-0x5B32 = 0x672E
-0x5B33 = 0x673F
-0x5B34 = 0x6736
-0x5B35 = 0x6741
-0x5B36 = 0x6738
-0x5B37 = 0x6737
-0x5B38 = 0x6746
-0x5B39 = 0x675E
-0x5B3A = 0x6760
-0x5B3B = 0x6759
-0x5B3C = 0x6763
-0x5B3D = 0x6764
-0x5B3E = 0x6789
-0x5B3F = 0x6770
-0x5B40 = 0x67A9
-0x5B41 = 0x677C
-0x5B42 = 0x676A
-0x5B43 = 0x678C
-0x5B44 = 0x678B
-0x5B45 = 0x67A6
-0x5B46 = 0x67A1
-0x5B47 = 0x6785
-0x5B48 = 0x67B7
-0x5B49 = 0x67EF
-0x5B4A = 0x67B4
-0x5B4B = 0x67EC
-0x5B4C = 0x67B3
-0x5B4D = 0x67E9
-0x5B4E = 0x67B8
-0x5B4F = 0x67E4
-0x5B50 = 0x67DE
-0x5B51 = 0x67DD
-0x5B52 = 0x67E2
-0x5B53 = 0x67EE
-0x5B54 = 0x67B9
-0x5B55 = 0x67CE
-0x5B56 = 0x67C6
-0x5B57 = 0x67E7
-0x5B58 = 0x6A9C
-0x5B59 = 0x681E
-0x5B5A = 0x6846
-0x5B5B = 0x6829
-0x5B5C = 0x6840
-0x5B5D = 0x684D
-0x5B5E = 0x6832
-0x5B5F = 0x684E
-0x5B60 = 0x68B3
-0x5B61 = 0x682B
-0x5B62 = 0x6859
-0x5B63 = 0x6863
-0x5B64 = 0x6877
-0x5B65 = 0x687F
-0x5B66 = 0x689F
-0x5B67 = 0x688F
-0x5B68 = 0x68AD
-0x5B69 = 0x6894
-0x5B6A = 0x689D
-0x5B6B = 0x689B
-0x5B6C = 0x6883
-0x5B6D = 0x6AAE
-0x5B6E = 0x68B9
-0x5B6F = 0x6874
-0x5B70 = 0x68B5
-0x5B71 = 0x68A0
-0x5B72 = 0x68BA
-0x5B73 = 0x690F
-0x5B74 = 0x688D
-0x5B75 = 0x687E
-0x5B76 = 0x6901
-0x5B77 = 0x68CA
-0x5B78 = 0x6908
-0x5B79 = 0x68D8
-0x5B7A = 0x6922
-0x5B7B = 0x6926
-0x5B7C = 0x68E1
-0x5B7D = 0x690C
-0x5B7E = 0x68CD
-0x5C21 = 0x68D4
-0x5C22 = 0x68E7
-0x5C23 = 0x68D5
-0x5C24 = 0x6936
-0x5C25 = 0x6912
-0x5C26 = 0x6904
-0x5C27 = 0x68D7
-0x5C28 = 0x68E3
-0x5C29 = 0x6925
-0x5C2A = 0x68F9
-0x5C2B = 0x68E0
-0x5C2C = 0x68EF
-0x5C2D = 0x6928
-0x5C2E = 0x692A
-0x5C2F = 0x691A
-0x5C30 = 0x6923
-0x5C31 = 0x6921
-0x5C32 = 0x68C6
-0x5C33 = 0x6979
-0x5C34 = 0x6977
-0x5C35 = 0x695C
-0x5C36 = 0x6978
-0x5C37 = 0x696B
-0x5C38 = 0x6954
-0x5C39 = 0x697E
-0x5C3A = 0x696E
-0x5C3B = 0x6939
-0x5C3C = 0x6974
-0x5C3D = 0x693D
-0x5C3E = 0x6959
-0x5C3F = 0x6930
-0x5C40 = 0x6961
-0x5C41 = 0x695E
-0x5C42 = 0x695D
-0x5C43 = 0x6981
-0x5C44 = 0x696A
-0x5C45 = 0x69B2
-0x5C46 = 0x69AE
-0x5C47 = 0x69D0
-0x5C48 = 0x69BF
-0x5C49 = 0x69C1
-0x5C4A = 0x69D3
-0x5C4B = 0x69BE
-0x5C4C = 0x69CE
-0x5C4D = 0x5BE8
-0x5C4E = 0x69CA
-0x5C4F = 0x69DD
-0x5C50 = 0x69BB
-0x5C51 = 0x69C3
-0x5C52 = 0x69A7
-0x5C53 = 0x6A2E
-0x5C54 = 0x6991
-0x5C55 = 0x69A0
-0x5C56 = 0x699C
-0x5C57 = 0x6995
-0x5C58 = 0x69B4
-0x5C59 = 0x69DE
-0x5C5A = 0x69E8
-0x5C5B = 0x6A02
-0x5C5C = 0x6A1B
-0x5C5D = 0x69FF
-0x5C5E = 0x6B0A
-0x5C5F = 0x69F9
-0x5C60 = 0x69F2
-0x5C61 = 0x69E7
-0x5C62 = 0x6A05
-0x5C63 = 0x69B1
-0x5C64 = 0x6A1E
-0x5C65 = 0x69ED
-0x5C66 = 0x6A14
-0x5C67 = 0x69EB
-0x5C68 = 0x6A0A
-0x5C69 = 0x6A12
-0x5C6A = 0x6AC1
-0x5C6B = 0x6A23
-0x5C6C = 0x6A13
-0x5C6D = 0x6A44
-0x5C6E = 0x6A0C
-0x5C6F = 0x6A72
-0x5C70 = 0x6A36
-0x5C71 = 0x6A78
-0x5C72 = 0x6A47
-0x5C73 = 0x6A62
-0x5C74 = 0x6A59
-0x5C75 = 0x6A66
-0x5C76 = 0x6A48
-0x5C77 = 0x6A38
-0x5C78 = 0x6A22
-0x5C79 = 0x6A90
-0x5C7A = 0x6A8D
-0x5C7B = 0x6AA0
-0x5C7C = 0x6A84
-0x5C7D = 0x6AA2
-0x5C7E = 0x6AA3
-0x5D21 = 0x6A97
-0x5D22 = 0x8617
-0x5D23 = 0x6ABB
-0x5D24 = 0x6AC3
-0x5D25 = 0x6AC2
-0x5D26 = 0x6AB8
-0x5D27 = 0x6AB3
-0x5D28 = 0x6AAC
-0x5D29 = 0x6ADE
-0x5D2A = 0x6AD1
-0x5D2B = 0x6ADF
-0x5D2C = 0x6AAA
-0x5D2D = 0x6ADA
-0x5D2E = 0x6AEA
-0x5D2F = 0x6AFB
-0x5D30 = 0x6B05
-0x5D31 = 0x8616
-0x5D32 = 0x6AFA
-0x5D33 = 0x6B12
-0x5D34 = 0x6B16
-0x5D35 = 0x9B31
-0x5D36 = 0x6B1F
-0x5D37 = 0x6B38
-0x5D38 = 0x6B37
-0x5D39 = 0x76DC
-0x5D3A = 0x6B39
-0x5D3B = 0x98EE
-0x5D3C = 0x6B47
-0x5D3D = 0x6B43
-0x5D3E = 0x6B49
-0x5D3F = 0x6B50
-0x5D40 = 0x6B59
-0x5D41 = 0x6B54
-0x5D42 = 0x6B5B
-0x5D43 = 0x6B5F
-0x5D44 = 0x6B61
-0x5D45 = 0x6B78
-0x5D46 = 0x6B79
-0x5D47 = 0x6B7F
-0x5D48 = 0x6B80
-0x5D49 = 0x6B84
-0x5D4A = 0x6B83
-0x5D4B = 0x6B8D
-0x5D4C = 0x6B98
-0x5D4D = 0x6B95
-0x5D4E = 0x6B9E
-0x5D4F = 0x6BA4
-0x5D50 = 0x6BAA
-0x5D51 = 0x6BAB
-0x5D52 = 0x6BAF
-0x5D53 = 0x6BB2
-0x5D54 = 0x6BB1
-0x5D55 = 0x6BB3
-0x5D56 = 0x6BB7
-0x5D57 = 0x6BBC
-0x5D58 = 0x6BC6
-0x5D59 = 0x6BCB
-0x5D5A = 0x6BD3
-0x5D5B = 0x6BDF
-0x5D5C = 0x6BEC
-0x5D5D = 0x6BEB
-0x5D5E = 0x6BF3
-0x5D5F = 0x6BEF
-0x5D60 = 0x9EBE
-0x5D61 = 0x6C08
-0x5D62 = 0x6C13
-0x5D63 = 0x6C14
-0x5D64 = 0x6C1B
-0x5D65 = 0x6C24
-0x5D66 = 0x6C23
-0x5D67 = 0x6C5E
-0x5D68 = 0x6C55
-0x5D69 = 0x6C62
-0x5D6A = 0x6C6A
-0x5D6B = 0x6C82
-0x5D6C = 0x6C8D
-0x5D6D = 0x6C9A
-0x5D6E = 0x6C81
-0x5D6F = 0x6C9B
-0x5D70 = 0x6C7E
-0x5D71 = 0x6C68
-0x5D72 = 0x6C73
-0x5D73 = 0x6C92
-0x5D74 = 0x6C90
-0x5D75 = 0x6CC4
-0x5D76 = 0x6CF1
-0x5D77 = 0x6CD3
-0x5D78 = 0x6CBD
-0x5D79 = 0x6CD7
-0x5D7A = 0x6CC5
-0x5D7B = 0x6CDD
-0x5D7C = 0x6CAE
-0x5D7D = 0x6CB1
-0x5D7E = 0x6CBE
-0x5E21 = 0x6CBA
-0x5E22 = 0x6CDB
-0x5E23 = 0x6CEF
-0x5E24 = 0x6CD9
-0x5E25 = 0x6CEA
-0x5E26 = 0x6D1F
-0x5E27 = 0x884D
-0x5E28 = 0x6D36
-0x5E29 = 0x6D2B
-0x5E2A = 0x6D3D
-0x5E2B = 0x6D38
-0x5E2C = 0x6D19
-0x5E2D = 0x6D35
-0x5E2E = 0x6D33
-0x5E2F = 0x6D12
-0x5E30 = 0x6D0C
-0x5E31 = 0x6D63
-0x5E32 = 0x6D93
-0x5E33 = 0x6D64
-0x5E34 = 0x6D5A
-0x5E35 = 0x6D79
-0x5E36 = 0x6D59
-0x5E37 = 0x6D8E
-0x5E38 = 0x6D95
-0x5E39 = 0x6FE4
-0x5E3A = 0x6D85
-0x5E3B = 0x6DF9
-0x5E3C = 0x6E15
-0x5E3D = 0x6E0A
-0x5E3E = 0x6DB5
-0x5E3F = 0x6DC7
-0x5E40 = 0x6DE6
-0x5E41 = 0x6DB8
-0x5E42 = 0x6DC6
-0x5E43 = 0x6DEC
-0x5E44 = 0x6DDE
-0x5E45 = 0x6DCC
-0x5E46 = 0x6DE8
-0x5E47 = 0x6DD2
-0x5E48 = 0x6DC5
-0x5E49 = 0x6DFA
-0x5E4A = 0x6DD9
-0x5E4B = 0x6DE4
-0x5E4C = 0x6DD5
-0x5E4D = 0x6DEA
-0x5E4E = 0x6DEE
-0x5E4F = 0x6E2D
-0x5E50 = 0x6E6E
-0x5E51 = 0x6E2E
-0x5E52 = 0x6E19
-0x5E53 = 0x6E72
-0x5E54 = 0x6E5F
-0x5E55 = 0x6E3E
-0x5E56 = 0x6E23
-0x5E57 = 0x6E6B
-0x5E58 = 0x6E2B
-0x5E59 = 0x6E76
-0x5E5A = 0x6E4D
-0x5E5B = 0x6E1F
-0x5E5C = 0x6E43
-0x5E5D = 0x6E3A
-0x5E5E = 0x6E4E
-0x5E5F = 0x6E24
-0x5E60 = 0x6EFF
-0x5E61 = 0x6E1D
-0x5E62 = 0x6E38
-0x5E63 = 0x6E82
-0x5E64 = 0x6EAA
-0x5E65 = 0x6E98
-0x5E66 = 0x6EC9
-0x5E67 = 0x6EB7
-0x5E68 = 0x6ED3
-0x5E69 = 0x6EBD
-0x5E6A = 0x6EAF
-0x5E6B = 0x6EC4
-0x5E6C = 0x6EB2
-0x5E6D = 0x6ED4
-0x5E6E = 0x6ED5
-0x5E6F = 0x6E8F
-0x5E70 = 0x6EA5
-0x5E71 = 0x6EC2
-0x5E72 = 0x6E9F
-0x5E73 = 0x6F41
-0x5E74 = 0x6F11
-0x5E75 = 0x704C
-0x5E76 = 0x6EEC
-0x5E77 = 0x6EF8
-0x5E78 = 0x6EFE
-0x5E79 = 0x6F3F
-0x5E7A = 0x6EF2
-0x5E7B = 0x6F31
-0x5E7C = 0x6EEF
-0x5E7D = 0x6F32
-0x5E7E = 0x6ECC
-0x5F21 = 0x6F3E
-0x5F22 = 0x6F13
-0x5F23 = 0x6EF7
-0x5F24 = 0x6F86
-0x5F25 = 0x6F7A
-0x5F26 = 0x6F78
-0x5F27 = 0x6F81
-0x5F28 = 0x6F80
-0x5F29 = 0x6F6F
-0x5F2A = 0x6F5B
-0x5F2B = 0x6FF3
-0x5F2C = 0x6F6D
-0x5F2D = 0x6F82
-0x5F2E = 0x6F7C
-0x5F2F = 0x6F58
-0x5F30 = 0x6F8E
-0x5F31 = 0x6F91
-0x5F32 = 0x6FC2
-0x5F33 = 0x6F66
-0x5F34 = 0x6FB3
-0x5F35 = 0x6FA3
-0x5F36 = 0x6FA1
-0x5F37 = 0x6FA4
-0x5F38 = 0x6FB9
-0x5F39 = 0x6FC6
-0x5F3A = 0x6FAA
-0x5F3B = 0x6FDF
-0x5F3C = 0x6FD5
-0x5F3D = 0x6FEC
-0x5F3E = 0x6FD4
-0x5F3F = 0x6FD8
-0x5F40 = 0x6FF1
-0x5F41 = 0x6FEE
-0x5F42 = 0x6FDB
-0x5F43 = 0x7009
-0x5F44 = 0x700B
-0x5F45 = 0x6FFA
-0x5F46 = 0x7011
-0x5F47 = 0x7001
-0x5F48 = 0x700F
-0x5F49 = 0x6FFE
-0x5F4A = 0x701B
-0x5F4B = 0x701A
-0x5F4C = 0x6F74
-0x5F4D = 0x701D
-0x5F4E = 0x7018
-0x5F4F = 0x701F
-0x5F50 = 0x7030
-0x5F51 = 0x703E
-0x5F52 = 0x7032
-0x5F53 = 0x7051
-0x5F54 = 0x7063
-0x5F55 = 0x7099
-0x5F56 = 0x7092
-0x5F57 = 0x70AF
-0x5F58 = 0x70F1
-0x5F59 = 0x70AC
-0x5F5A = 0x70B8
-0x5F5B = 0x70B3
-0x5F5C = 0x70AE
-0x5F5D = 0x70DF
-0x5F5E = 0x70CB
-0x5F5F = 0x70DD
-0x5F60 = 0x70D9
-0x5F61 = 0x7109
-0x5F62 = 0x70FD
-0x5F63 = 0x711C
-0x5F64 = 0x7119
-0x5F65 = 0x7165
-0x5F66 = 0x7155
-0x5F67 = 0x7188
-0x5F68 = 0x7166
-0x5F69 = 0x7162
-0x5F6A = 0x714C
-0x5F6B = 0x7156
-0x5F6C = 0x716C
-0x5F6D = 0x718F
-0x5F6E = 0x71FB
-0x5F6F = 0x7184
-0x5F70 = 0x7195
-0x5F71 = 0x71A8
-0x5F72 = 0x71AC
-0x5F73 = 0x71D7
-0x5F74 = 0x71B9
-0x5F75 = 0x71BE
-0x5F76 = 0x71D2
-0x5F77 = 0x71C9
-0x5F78 = 0x71D4
-0x5F79 = 0x71CE
-0x5F7A = 0x71E0
-0x5F7B = 0x71EC
-0x5F7C = 0x71E7
-0x5F7D = 0x71F5
-0x5F7E = 0x71FC
-0x6021 = 0x71F9
-0x6022 = 0x71FF
-0x6023 = 0x720D
-0x6024 = 0x7210
-0x6025 = 0x721B
-0x6026 = 0x7228
-0x6027 = 0x722D
-0x6028 = 0x722C
-0x6029 = 0x7230
-0x602A = 0x7232
-0x602B = 0x723B
-0x602C = 0x723C
-0x602D = 0x723F
-0x602E = 0x7240
-0x602F = 0x7246
-0x6030 = 0x724B
-0x6031 = 0x7258
-0x6032 = 0x7274
-0x6033 = 0x727E
-0x6034 = 0x7282
-0x6035 = 0x7281
-0x6036 = 0x7287
-0x6037 = 0x7292
-0x6038 = 0x7296
-0x6039 = 0x72A2
-0x603A = 0x72A7
-0x603B = 0x72B9
-0x603C = 0x72B2
-0x603D = 0x72C3
-0x603E = 0x72C6
-0x603F = 0x72C4
-0x6040 = 0x72CE
-0x6041 = 0x72D2
-0x6042 = 0x72E2
-0x6043 = 0x72E0
-0x6044 = 0x72E1
-0x6045 = 0x72F9
-0x6046 = 0x72F7
-0x6047 = 0x500F
-0x6048 = 0x7317
-0x6049 = 0x730A
-0x604A = 0x731C
-0x604B = 0x7316
-0x604C = 0x731D
-0x604D = 0x7334
-0x604E = 0x732F
-0x604F = 0x7329
-0x6050 = 0x7325
-0x6051 = 0x733E
-0x6052 = 0x734E
-0x6053 = 0x734F
-0x6054 = 0x9ED8
-0x6055 = 0x7357
-0x6056 = 0x736A
-0x6057 = 0x7368
-0x6058 = 0x7370
-0x6059 = 0x7378
-0x605A = 0x7375
-0x605B = 0x737B
-0x605C = 0x737A
-0x605D = 0x73C8
-0x605E = 0x73B3
-0x605F = 0x73CE
-0x6060 = 0x73BB
-0x6061 = 0x73C0
-0x6062 = 0x73E5
-0x6063 = 0x73EE
-0x6064 = 0x73DE
-0x6065 = 0x74A2
-0x6066 = 0x7405
-0x6067 = 0x746F
-0x6068 = 0x7425
-0x6069 = 0x73F8
-0x606A = 0x7432
-0x606B = 0x743A
-0x606C = 0x7455
-0x606D = 0x743F
-0x606E = 0x745F
-0x606F = 0x7459
-0x6070 = 0x7441
-0x6071 = 0x745C
-0x6072 = 0x7469
-0x6073 = 0x7470
-0x6074 = 0x7463
-0x6075 = 0x746A
-0x6076 = 0x7476
-0x6077 = 0x747E
-0x6078 = 0x748B
-0x6079 = 0x749E
-0x607A = 0x74A7
-0x607B = 0x74CA
-0x607C = 0x74CF
-0x607D = 0x74D4
-0x607E = 0x73F1
-0x6121 = 0x74E0
-0x6122 = 0x74E3
-0x6123 = 0x74E7
-0x6124 = 0x74E9
-0x6125 = 0x74EE
-0x6126 = 0x74F2
-0x6127 = 0x74F0
-0x6128 = 0x74F1
-0x6129 = 0x74F8
-0x612A = 0x74F7
-0x612B = 0x7504
-0x612C = 0x7503
-0x612D = 0x7505
-0x612E = 0x750C
-0x612F = 0x750E
-0x6130 = 0x750D
-0x6131 = 0x7515
-0x6132 = 0x7513
-0x6133 = 0x751E
-0x6134 = 0x7526
-0x6135 = 0x752C
-0x6136 = 0x753C
-0x6137 = 0x7544
-0x6138 = 0x754D
-0x6139 = 0x754A
-0x613A = 0x7549
-0x613B = 0x755B
-0x613C = 0x7546
-0x613D = 0x755A
-0x613E = 0x7569
-0x613F = 0x7564
-0x6140 = 0x7567
-0x6141 = 0x756B
-0x6142 = 0x756D
-0x6143 = 0x7578
-0x6144 = 0x7576
-0x6145 = 0x7586
-0x6146 = 0x7587
-0x6147 = 0x7574
-0x6148 = 0x758A
-0x6149 = 0x7589
-0x614A = 0x7582
-0x614B = 0x7594
-0x614C = 0x759A
-0x614D = 0x759D
-0x614E = 0x75A5
-0x614F = 0x75A3
-0x6150 = 0x75C2
-0x6151 = 0x75B3
-0x6152 = 0x75C3
-0x6153 = 0x75B5
-0x6154 = 0x75BD
-0x6155 = 0x75B8
-0x6156 = 0x75BC
-0x6157 = 0x75B1
-0x6158 = 0x75CD
-0x6159 = 0x75CA
-0x615A = 0x75D2
-0x615B = 0x75D9
-0x615C = 0x75E3
-0x615D = 0x75DE
-0x615E = 0x75FE
-0x615F = 0x75FF
-0x6160 = 0x75FC
-0x6161 = 0x7601
-0x6162 = 0x75F0
-0x6163 = 0x75FA
-0x6164 = 0x75F2
-0x6165 = 0x75F3
-0x6166 = 0x760B
-0x6167 = 0x760D
-0x6168 = 0x7609
-0x6169 = 0x761F
-0x616A = 0x7627
-0x616B = 0x7620
-0x616C = 0x7621
-0x616D = 0x7622
-0x616E = 0x7624
-0x616F = 0x7634
-0x6170 = 0x7630
-0x6171 = 0x763B
-0x6172 = 0x7647
-0x6173 = 0x7648
-0x6174 = 0x7646
-0x6175 = 0x765C
-0x6176 = 0x7658
-0x6177 = 0x7661
-0x6178 = 0x7662
-0x6179 = 0x7668
-0x617A = 0x7669
-0x617B = 0x766A
-0x617C = 0x7667
-0x617D = 0x766C
-0x617E = 0x7670
-0x6221 = 0x7672
-0x6222 = 0x7676
-0x6223 = 0x7678
-0x6224 = 0x767C
-0x6225 = 0x7680
-0x6226 = 0x7683
-0x6227 = 0x7688
-0x6228 = 0x768B
-0x6229 = 0x768E
-0x622A = 0x7696
-0x622B = 0x7693
-0x622C = 0x7699
-0x622D = 0x769A
-0x622E = 0x76B0
-0x622F = 0x76B4
-0x6230 = 0x76B8
-0x6231 = 0x76B9
-0x6232 = 0x76BA
-0x6233 = 0x76C2
-0x6234 = 0x76CD
-0x6235 = 0x76D6
-0x6236 = 0x76D2
-0x6237 = 0x76DE
-0x6238 = 0x76E1
-0x6239 = 0x76E5
-0x623A = 0x76E7
-0x623B = 0x76EA
-0x623C = 0x862F
-0x623D = 0x76FB
-0x623E = 0x7708
-0x623F = 0x7707
-0x6240 = 0x7704
-0x6241 = 0x7729
-0x6242 = 0x7724
-0x6243 = 0x771E
-0x6244 = 0x7725
-0x6245 = 0x7726
-0x6246 = 0x771B
-0x6247 = 0x7737
-0x6248 = 0x7738
-0x6249 = 0x7747
-0x624A = 0x775A
-0x624B = 0x7768
-0x624C = 0x776B
-0x624D = 0x775B
-0x624E = 0x7765
-0x624F = 0x777F
-0x6250 = 0x777E
-0x6251 = 0x7779
-0x6252 = 0x778E
-0x6253 = 0x778B
-0x6254 = 0x7791
-0x6255 = 0x77A0
-0x6256 = 0x779E
-0x6257 = 0x77B0
-0x6258 = 0x77B6
-0x6259 = 0x77B9
-0x625A = 0x77BF
-0x625B = 0x77BC
-0x625C = 0x77BD
-0x625D = 0x77BB
-0x625E = 0x77C7
-0x625F = 0x77CD
-0x6260 = 0x77D7
-0x6261 = 0x77DA
-0x6262 = 0x77DC
-0x6263 = 0x77E3
-0x6264 = 0x77EE
-0x6265 = 0x77FC
-0x6266 = 0x780C
-0x6267 = 0x7812
-0x6268 = 0x7926
-0x6269 = 0x7820
-0x626A = 0x792A
-0x626B = 0x7845
-0x626C = 0x788E
-0x626D = 0x7874
-0x626E = 0x7886
-0x626F = 0x787C
-0x6270 = 0x789A
-0x6271 = 0x788C
-0x6272 = 0x78A3
-0x6273 = 0x78B5
-0x6274 = 0x78AA
-0x6275 = 0x78AF
-0x6276 = 0x78D1
-0x6277 = 0x78C6
-0x6278 = 0x78CB
-0x6279 = 0x78D4
-0x627A = 0x78BE
-0x627B = 0x78BC
-0x627C = 0x78C5
-0x627D = 0x78CA
-0x627E = 0x78EC
-0x6321 = 0x78E7
-0x6322 = 0x78DA
-0x6323 = 0x78FD
-0x6324 = 0x78F4
-0x6325 = 0x7907
-0x6326 = 0x7912
-0x6327 = 0x7911
-0x6328 = 0x7919
-0x6329 = 0x792C
-0x632A = 0x792B
-0x632B = 0x7940
-0x632C = 0x7960
-0x632D = 0x7957
-0x632E = 0x795F
-0x632F = 0x795A
-0x6330 = 0x7955
-0x6331 = 0x7953
-0x6332 = 0x797A
-0x6333 = 0x797F
-0x6334 = 0x798A
-0x6335 = 0x799D
-0x6336 = 0x79A7
-0x6337 = 0x9F4B
-0x6338 = 0x79AA
-0x6339 = 0x79AE
-0x633A = 0x79B3
-0x633B = 0x79B9
-0x633C = 0x79BA
-0x633D = 0x79C9
-0x633E = 0x79D5
-0x633F = 0x79E7
-0x6340 = 0x79EC
-0x6341 = 0x79E1
-0x6342 = 0x79E3
-0x6343 = 0x7A08
-0x6344 = 0x7A0D
-0x6345 = 0x7A18
-0x6346 = 0x7A19
-0x6347 = 0x7A20
-0x6348 = 0x7A1F
-0x6349 = 0x7980
-0x634A = 0x7A31
-0x634B = 0x7A3B
-0x634C = 0x7A3E
-0x634D = 0x7A37
-0x634E = 0x7A43
-0x634F = 0x7A57
-0x6350 = 0x7A49
-0x6351 = 0x7A61
-0x6352 = 0x7A62
-0x6353 = 0x7A69
-0x6354 = 0x9F9D
-0x6355 = 0x7A70
-0x6356 = 0x7A79
-0x6357 = 0x7A7D
-0x6358 = 0x7A88
-0x6359 = 0x7A97
-0x635A = 0x7A95
-0x635B = 0x7A98
-0x635C = 0x7A96
-0x635D = 0x7AA9
-0x635E = 0x7AC8
-0x635F = 0x7AB0
-0x6360 = 0x7AB6
-0x6361 = 0x7AC5
-0x6362 = 0x7AC4
-0x6363 = 0x7ABF
-0x6364 = 0x9083
-0x6365 = 0x7AC7
-0x6366 = 0x7ACA
-0x6367 = 0x7ACD
-0x6368 = 0x7ACF
-0x6369 = 0x7AD5
-0x636A = 0x7AD3
-0x636B = 0x7AD9
-0x636C = 0x7ADA
-0x636D = 0x7ADD
-0x636E = 0x7AE1
-0x636F = 0x7AE2
-0x6370 = 0x7AE6
-0x6371 = 0x7AED
-0x6372 = 0x7AF0
-0x6373 = 0x7B02
-0x6374 = 0x7B0F
-0x6375 = 0x7B0A
-0x6376 = 0x7B06
-0x6377 = 0x7B33
-0x6378 = 0x7B18
-0x6379 = 0x7B19
-0x637A = 0x7B1E
-0x637B = 0x7B35
-0x637C = 0x7B28
-0x637D = 0x7B36
-0x637E = 0x7B50
-0x6421 = 0x7B7A
-0x6422 = 0x7B04
-0x6423 = 0x7B4D
-0x6424 = 0x7B0B
-0x6425 = 0x7B4C
-0x6426 = 0x7B45
-0x6427 = 0x7B75
-0x6428 = 0x7B65
-0x6429 = 0x7B74
-0x642A = 0x7B67
-0x642B = 0x7B70
-0x642C = 0x7B71
-0x642D = 0x7B6C
-0x642E = 0x7B6E
-0x642F = 0x7B9D
-0x6430 = 0x7B98
-0x6431 = 0x7B9F
-0x6432 = 0x7B8D
-0x6433 = 0x7B9C
-0x6434 = 0x7B9A
-0x6435 = 0x7B8B
-0x6436 = 0x7B92
-0x6437 = 0x7B8F
-0x6438 = 0x7B5D
-0x6439 = 0x7B99
-0x643A = 0x7BCB
-0x643B = 0x7BC1
-0x643C = 0x7BCC
-0x643D = 0x7BCF
-0x643E = 0x7BB4
-0x643F = 0x7BC6
-0x6440 = 0x7BDD
-0x6441 = 0x7BE9
-0x6442 = 0x7C11
-0x6443 = 0x7C14
-0x6444 = 0x7BE6
-0x6445 = 0x7BE5
-0x6446 = 0x7C60
-0x6447 = 0x7C00
-0x6448 = 0x7C07
-0x6449 = 0x7C13
-0x644A = 0x7BF3
-0x644B = 0x7BF7
-0x644C = 0x7C17
-0x644D = 0x7C0D
-0x644E = 0x7BF6
-0x644F = 0x7C23
-0x6450 = 0x7C27
-0x6451 = 0x7C2A
-0x6452 = 0x7C1F
-0x6453 = 0x7C37
-0x6454 = 0x7C2B
-0x6455 = 0x7C3D
-0x6456 = 0x7C4C
-0x6457 = 0x7C43
-0x6458 = 0x7C54
-0x6459 = 0x7C4F
-0x645A = 0x7C40
-0x645B = 0x7C50
-0x645C = 0x7C58
-0x645D = 0x7C5F
-0x645E = 0x7C64
-0x645F = 0x7C56
-0x6460 = 0x7C65
-0x6461 = 0x7C6C
-0x6462 = 0x7C75
-0x6463 = 0x7C83
-0x6464 = 0x7C90
-0x6465 = 0x7CA4
-0x6466 = 0x7CAD
-0x6467 = 0x7CA2
-0x6468 = 0x7CAB
-0x6469 = 0x7CA1
-0x646A = 0x7CA8
-0x646B = 0x7CB3
-0x646C = 0x7CB2
-0x646D = 0x7CB1
-0x646E = 0x7CAE
-0x646F = 0x7CB9
-0x6470 = 0x7CBD
-0x6471 = 0x7CC0
-0x6472 = 0x7CC5
-0x6473 = 0x7CC2
-0x6474 = 0x7CD8
-0x6475 = 0x7CD2
-0x6476 = 0x7CDC
-0x6477 = 0x7CE2
-0x6478 = 0x9B3B
-0x6479 = 0x7CEF
-0x647A = 0x7CF2
-0x647B = 0x7CF4
-0x647C = 0x7CF6
-0x647D = 0x7CFA
-0x647E = 0x7D06
-0x6521 = 0x7D02
-0x6522 = 0x7D1C
-0x6523 = 0x7D15
-0x6524 = 0x7D0A
-0x6525 = 0x7D45
-0x6526 = 0x7D4B
-0x6527 = 0x7D2E
-0x6528 = 0x7D32
-0x6529 = 0x7D3F
-0x652A = 0x7D35
-0x652B = 0x7D46
-0x652C = 0x7D73
-0x652D = 0x7D56
-0x652E = 0x7D4E
-0x652F = 0x7D72
-0x6530 = 0x7D68
-0x6531 = 0x7D6E
-0x6532 = 0x7D4F
-0x6533 = 0x7D63
-0x6534 = 0x7D93
-0x6535 = 0x7D89
-0x6536 = 0x7D5B
-0x6537 = 0x7D8F
-0x6538 = 0x7D7D
-0x6539 = 0x7D9B
-0x653A = 0x7DBA
-0x653B = 0x7DAE
-0x653C = 0x7DA3
-0x653D = 0x7DB5
-0x653E = 0x7DC7
-0x653F = 0x7DBD
-0x6540 = 0x7DAB
-0x6541 = 0x7E3D
-0x6542 = 0x7DA2
-0x6543 = 0x7DAF
-0x6544 = 0x7DDC
-0x6545 = 0x7DB8
-0x6546 = 0x7D9F
-0x6547 = 0x7DB0
-0x6548 = 0x7DD8
-0x6549 = 0x7DDD
-0x654A = 0x7DE4
-0x654B = 0x7DDE
-0x654C = 0x7DFB
-0x654D = 0x7DF2
-0x654E = 0x7DE1
-0x654F = 0x7E05
-0x6550 = 0x7E0A
-0x6551 = 0x7E23
-0x6552 = 0x7E21
-0x6553 = 0x7E12
-0x6554 = 0x7E31
-0x6555 = 0x7E1F
-0x6556 = 0x7E09
-0x6557 = 0x7E0B
-0x6558 = 0x7E22
-0x6559 = 0x7E46
-0x655A = 0x7E66
-0x655B = 0x7E3B
-0x655C = 0x7E35
-0x655D = 0x7E39
-0x655E = 0x7E43
-0x655F = 0x7E37
-0x6560 = 0x7E32
-0x6561 = 0x7E3A
-0x6562 = 0x7E67
-0x6563 = 0x7E5D
-0x6564 = 0x7E56
-0x6565 = 0x7E5E
-0x6566 = 0x7E59
-0x6567 = 0x7E5A
-0x6568 = 0x7E79
-0x6569 = 0x7E6A
-0x656A = 0x7E69
-0x656B = 0x7E7C
-0x656C = 0x7E7B
-0x656D = 0x7E83
-0x656E = 0x7DD5
-0x656F = 0x7E7D
-0x6570 = 0x8FAE
-0x6571 = 0x7E7F
-0x6572 = 0x7E88
-0x6573 = 0x7E89
-0x6574 = 0x7E8C
-0x6575 = 0x7E92
-0x6576 = 0x7E90
-0x6577 = 0x7E93
-0x6578 = 0x7E94
-0x6579 = 0x7E96
-0x657A = 0x7E8E
-0x657B = 0x7E9B
-0x657C = 0x7E9C
-0x657D = 0x7F38
-0x657E = 0x7F3A
-0x6621 = 0x7F45
-0x6622 = 0x7F4C
-0x6623 = 0x7F4D
-0x6624 = 0x7F4E
-0x6625 = 0x7F50
-0x6626 = 0x7F51
-0x6627 = 0x7F55
-0x6628 = 0x7F54
-0x6629 = 0x7F58
-0x662A = 0x7F5F
-0x662B = 0x7F60
-0x662C = 0x7F68
-0x662D = 0x7F69
-0x662E = 0x7F67
-0x662F = 0x7F78
-0x6630 = 0x7F82
-0x6631 = 0x7F86
-0x6632 = 0x7F83
-0x6633 = 0x7F88
-0x6634 = 0x7F87
-0x6635 = 0x7F8C
-0x6636 = 0x7F94
-0x6637 = 0x7F9E
-0x6638 = 0x7F9D
-0x6639 = 0x7F9A
-0x663A = 0x7FA3
-0x663B = 0x7FAF
-0x663C = 0x7FB2
-0x663D = 0x7FB9
-0x663E = 0x7FAE
-0x663F = 0x7FB6
-0x6640 = 0x7FB8
-0x6641 = 0x8B71
-0x6642 = 0x7FC5
-0x6643 = 0x7FC6
-0x6644 = 0x7FCA
-0x6645 = 0x7FD5
-0x6646 = 0x7FD4
-0x6647 = 0x7FE1
-0x6648 = 0x7FE6
-0x6649 = 0x7FE9
-0x664A = 0x7FF3
-0x664B = 0x7FF9
-0x664C = 0x98DC
-0x664D = 0x8006
-0x664E = 0x8004
-0x664F = 0x800B
-0x6650 = 0x8012
-0x6651 = 0x8018
-0x6652 = 0x8019
-0x6653 = 0x801C
-0x6654 = 0x8021
-0x6655 = 0x8028
-0x6656 = 0x803F
-0x6657 = 0x803B
-0x6658 = 0x804A
-0x6659 = 0x8046
-0x665A = 0x8052
-0x665B = 0x8058
-0x665C = 0x805A
-0x665D = 0x805F
-0x665E = 0x8062
-0x665F = 0x8068
-0x6660 = 0x8073
-0x6661 = 0x8072
-0x6662 = 0x8070
-0x6663 = 0x8076
-0x6664 = 0x8079
-0x6665 = 0x807D
-0x6666 = 0x807F
-0x6667 = 0x8084
-0x6668 = 0x8086
-0x6669 = 0x8085
-0x666A = 0x809B
-0x666B = 0x8093
-0x666C = 0x809A
-0x666D = 0x80AD
-0x666E = 0x5190
-0x666F = 0x80AC
-0x6670 = 0x80DB
-0x6671 = 0x80E5
-0x6672 = 0x80D9
-0x6673 = 0x80DD
-0x6674 = 0x80C4
-0x6675 = 0x80DA
-0x6676 = 0x80D6
-0x6677 = 0x8109
-0x6678 = 0x80EF
-0x6679 = 0x80F1
-0x667A = 0x811B
-0x667B = 0x8129
-0x667C = 0x8123
-0x667D = 0x812F
-0x667E = 0x814B
-0x6721 = 0x968B
-0x6722 = 0x8146
-0x6723 = 0x813E
-0x6724 = 0x8153
-0x6725 = 0x8151
-0x6726 = 0x80FC
-0x6727 = 0x8171
-0x6728 = 0x816E
-0x6729 = 0x8165
-0x672A = 0x8166
-0x672B = 0x8174
-0x672C = 0x8183
-0x672D = 0x8188
-0x672E = 0x818A
-0x672F = 0x8180
-0x6730 = 0x8182
-0x6731 = 0x81A0
-0x6732 = 0x8195
-0x6733 = 0x81A4
-0x6734 = 0x81A3
-0x6735 = 0x815F
-0x6736 = 0x8193
-0x6737 = 0x81A9
-0x6738 = 0x81B0
-0x6739 = 0x81B5
-0x673A = 0x81BE
-0x673B = 0x81B8
-0x673C = 0x81BD
-0x673D = 0x81C0
-0x673E = 0x81C2
-0x673F = 0x81BA
-0x6740 = 0x81C9
-0x6741 = 0x81CD
-0x6742 = 0x81D1
-0x6743 = 0x81D9
-0x6744 = 0x81D8
-0x6745 = 0x81C8
-0x6746 = 0x81DA
-0x6747 = 0x81DF
-0x6748 = 0x81E0
-0x6749 = 0x81E7
-0x674A = 0x81FA
-0x674B = 0x81FB
-0x674C = 0x81FE
-0x674D = 0x8201
-0x674E = 0x8202
-0x674F = 0x8205
-0x6750 = 0x8207
-0x6751 = 0x820A
-0x6752 = 0x820D
-0x6753 = 0x8210
-0x6754 = 0x8216
-0x6755 = 0x8229
-0x6756 = 0x822B
-0x6757 = 0x8238
-0x6758 = 0x8233
-0x6759 = 0x8240
-0x675A = 0x8259
-0x675B = 0x8258
-0x675C = 0x825D
-0x675D = 0x825A
-0x675E = 0x825F
-0x675F = 0x8264
-0x6760 = 0x8262
-0x6761 = 0x8268
-0x6762 = 0x826A
-0x6763 = 0x826B
-0x6764 = 0x822E
-0x6765 = 0x8271
-0x6766 = 0x8277
-0x6767 = 0x8278
-0x6768 = 0x827E
-0x6769 = 0x828D
-0x676A = 0x8292
-0x676B = 0x82AB
-0x676C = 0x829F
-0x676D = 0x82BB
-0x676E = 0x82AC
-0x676F = 0x82E1
-0x6770 = 0x82E3
-0x6771 = 0x82DF
-0x6772 = 0x82D2
-0x6773 = 0x82F4
-0x6774 = 0x82F3
-0x6775 = 0x82FA
-0x6776 = 0x8393
-0x6777 = 0x8303
-0x6778 = 0x82FB
-0x6779 = 0x82F9
-0x677A = 0x82DE
-0x677B = 0x8306
-0x677C = 0x82DC
-0x677D = 0x8309
-0x677E = 0x82D9
-0x6821 = 0x8335
-0x6822 = 0x8334
-0x6823 = 0x8316
-0x6824 = 0x8332
-0x6825 = 0x8331
-0x6826 = 0x8340
-0x6827 = 0x8339
-0x6828 = 0x8350
-0x6829 = 0x8345
-0x682A = 0x832F
-0x682B = 0x832B
-0x682C = 0x8317
-0x682D = 0x8318
-0x682E = 0x8385
-0x682F = 0x839A
-0x6830 = 0x83AA
-0x6831 = 0x839F
-0x6832 = 0x83A2
-0x6833 = 0x8396
-0x6834 = 0x8323
-0x6835 = 0x838E
-0x6836 = 0x8387
-0x6837 = 0x838A
-0x6838 = 0x837C
-0x6839 = 0x83B5
-0x683A = 0x8373
-0x683B = 0x8375
-0x683C = 0x83A0
-0x683D = 0x8389
-0x683E = 0x83A8
-0x683F = 0x83F4
-0x6840 = 0x8413
-0x6841 = 0x83EB
-0x6842 = 0x83CE
-0x6843 = 0x83FD
-0x6844 = 0x8403
-0x6845 = 0x83D8
-0x6846 = 0x840B
-0x6847 = 0x83C1
-0x6848 = 0x83F7
-0x6849 = 0x8407
-0x684A = 0x83E0
-0x684B = 0x83F2
-0x684C = 0x840D
-0x684D = 0x8422
-0x684E = 0x8420
-0x684F = 0x83BD
-0x6850 = 0x8438
-0x6851 = 0x8506
-0x6852 = 0x83FB
-0x6853 = 0x846D
-0x6854 = 0x842A
-0x6855 = 0x843C
-0x6856 = 0x855A
-0x6857 = 0x8484
-0x6858 = 0x8477
-0x6859 = 0x846B
-0x685A = 0x84AD
-0x685B = 0x846E
-0x685C = 0x8482
-0x685D = 0x8469
-0x685E = 0x8446
-0x685F = 0x842C
-0x6860 = 0x846F
-0x6861 = 0x8479
-0x6862 = 0x8435
-0x6863 = 0x84CA
-0x6864 = 0x8462
-0x6865 = 0x84B9
-0x6866 = 0x84BF
-0x6867 = 0x849F
-0x6868 = 0x84D9
-0x6869 = 0x84CD
-0x686A = 0x84BB
-0x686B = 0x84DA
-0x686C = 0x84D0
-0x686D = 0x84C1
-0x686E = 0x84C6
-0x686F = 0x84D6
-0x6870 = 0x84A1
-0x6871 = 0x8521
-0x6872 = 0x84FF
-0x6873 = 0x84F4
-0x6874 = 0x8517
-0x6875 = 0x8518
-0x6876 = 0x852C
-0x6877 = 0x851F
-0x6878 = 0x8515
-0x6879 = 0x8514
-0x687A = 0x84FC
-0x687B = 0x8540
-0x687C = 0x8563
-0x687D = 0x8558
-0x687E = 0x8548
-0x6921 = 0x8541
-0x6922 = 0x8602
-0x6923 = 0x854B
-0x6924 = 0x8555
-0x6925 = 0x8580
-0x6926 = 0x85A4
-0x6927 = 0x8588
-0x6928 = 0x8591
-0x6929 = 0x858A
-0x692A = 0x85A8
-0x692B = 0x856D
-0x692C = 0x8594
-0x692D = 0x859B
-0x692E = 0x85EA
-0x692F = 0x8587
-0x6930 = 0x859C
-0x6931 = 0x8577
-0x6932 = 0x857E
-0x6933 = 0x8590
-0x6934 = 0x85C9
-0x6935 = 0x85BA
-0x6936 = 0x85CF
-0x6937 = 0x85B9
-0x6938 = 0x85D0
-0x6939 = 0x85D5
-0x693A = 0x85DD
-0x693B = 0x85E5
-0x693C = 0x85DC
-0x693D = 0x85F9
-0x693E = 0x860A
-0x693F = 0x8613
-0x6940 = 0x860B
-0x6941 = 0x85FE
-0x6942 = 0x85FA
-0x6943 = 0x8606
-0x6944 = 0x8622
-0x6945 = 0x861A
-0x6946 = 0x8630
-0x6947 = 0x863F
-0x6948 = 0x864D
-0x6949 = 0x4E55
-0x694A = 0x8654
-0x694B = 0x865F
-0x694C = 0x8667
-0x694D = 0x8671
-0x694E = 0x8693
-0x694F = 0x86A3
-0x6950 = 0x86A9
-0x6951 = 0x86AA
-0x6952 = 0x868B
-0x6953 = 0x868C
-0x6954 = 0x86B6
-0x6955 = 0x86AF
-0x6956 = 0x86C4
-0x6957 = 0x86C6
-0x6958 = 0x86B0
-0x6959 = 0x86C9
-0x695A = 0x8823
-0x695B = 0x86AB
-0x695C = 0x86D4
-0x695D = 0x86DE
-0x695E = 0x86E9
-0x695F = 0x86EC
-0x6960 = 0x86DF
-0x6961 = 0x86DB
-0x6962 = 0x86EF
-0x6963 = 0x8712
-0x6964 = 0x8706
-0x6965 = 0x8708
-0x6966 = 0x8700
-0x6967 = 0x8703
-0x6968 = 0x86FB
-0x6969 = 0x8711
-0x696A = 0x8709
-0x696B = 0x870D
-0x696C = 0x86F9
-0x696D = 0x870A
-0x696E = 0x8734
-0x696F = 0x873F
-0x6970 = 0x8737
-0x6971 = 0x873B
-0x6972 = 0x8725
-0x6973 = 0x8729
-0x6974 = 0x871A
-0x6975 = 0x8760
-0x6976 = 0x875F
-0x6977 = 0x8778
-0x6978 = 0x874C
-0x6979 = 0x874E
-0x697A = 0x8774
-0x697B = 0x8757
-0x697C = 0x8768
-0x697D = 0x876E
-0x697E = 0x8759
-0x6A21 = 0x8753
-0x6A22 = 0x8763
-0x6A23 = 0x876A
-0x6A24 = 0x8805
-0x6A25 = 0x87A2
-0x6A26 = 0x879F
-0x6A27 = 0x8782
-0x6A28 = 0x87AF
-0x6A29 = 0x87CB
-0x6A2A = 0x87BD
-0x6A2B = 0x87C0
-0x6A2C = 0x87D0
-0x6A2D = 0x96D6
-0x6A2E = 0x87AB
-0x6A2F = 0x87C4
-0x6A30 = 0x87B3
-0x6A31 = 0x87C7
-0x6A32 = 0x87C6
-0x6A33 = 0x87BB
-0x6A34 = 0x87EF
-0x6A35 = 0x87F2
-0x6A36 = 0x87E0
-0x6A37 = 0x880F
-0x6A38 = 0x880D
-0x6A39 = 0x87FE
-0x6A3A = 0x87F6
-0x6A3B = 0x87F7
-0x6A3C = 0x880E
-0x6A3D = 0x87D2
-0x6A3E = 0x8811
-0x6A3F = 0x8816
-0x6A40 = 0x8815
-0x6A41 = 0x8822
-0x6A42 = 0x8821
-0x6A43 = 0x8831
-0x6A44 = 0x8836
-0x6A45 = 0x8839
-0x6A46 = 0x8827
-0x6A47 = 0x883B
-0x6A48 = 0x8844
-0x6A49 = 0x8842
-0x6A4A = 0x8852
-0x6A4B = 0x8859
-0x6A4C = 0x885E
-0x6A4D = 0x8862
-0x6A4E = 0x886B
-0x6A4F = 0x8881
-0x6A50 = 0x887E
-0x6A51 = 0x889E
-0x6A52 = 0x8875
-0x6A53 = 0x887D
-0x6A54 = 0x88B5
-0x6A55 = 0x8872
-0x6A56 = 0x8882
-0x6A57 = 0x8897
-0x6A58 = 0x8892
-0x6A59 = 0x88AE
-0x6A5A = 0x8899
-0x6A5B = 0x88A2
-0x6A5C = 0x888D
-0x6A5D = 0x88A4
-0x6A5E = 0x88B0
-0x6A5F = 0x88BF
-0x6A60 = 0x88B1
-0x6A61 = 0x88C3
-0x6A62 = 0x88C4
-0x6A63 = 0x88D4
-0x6A64 = 0x88D8
-0x6A65 = 0x88D9
-0x6A66 = 0x88DD
-0x6A67 = 0x88F9
-0x6A68 = 0x8902
-0x6A69 = 0x88FC
-0x6A6A = 0x88F4
-0x6A6B = 0x88E8
-0x6A6C = 0x88F2
-0x6A6D = 0x8904
-0x6A6E = 0x890C
-0x6A6F = 0x890A
-0x6A70 = 0x8913
-0x6A71 = 0x8943
-0x6A72 = 0x891E
-0x6A73 = 0x8925
-0x6A74 = 0x892A
-0x6A75 = 0x892B
-0x6A76 = 0x8941
-0x6A77 = 0x8944
-0x6A78 = 0x893B
-0x6A79 = 0x8936
-0x6A7A = 0x8938
-0x6A7B = 0x894C
-0x6A7C = 0x891D
-0x6A7D = 0x8960
-0x6A7E = 0x895E
-0x6B21 = 0x8966
-0x6B22 = 0x8964
-0x6B23 = 0x896D
-0x6B24 = 0x896A
-0x6B25 = 0x896F
-0x6B26 = 0x8974
-0x6B27 = 0x8977
-0x6B28 = 0x897E
-0x6B29 = 0x8983
-0x6B2A = 0x8988
-0x6B2B = 0x898A
-0x6B2C = 0x8993
-0x6B2D = 0x8998
-0x6B2E = 0x89A1
-0x6B2F = 0x89A9
-0x6B30 = 0x89A6
-0x6B31 = 0x89AC
-0x6B32 = 0x89AF
-0x6B33 = 0x89B2
-0x6B34 = 0x89BA
-0x6B35 = 0x89BD
-0x6B36 = 0x89BF
-0x6B37 = 0x89C0
-0x6B38 = 0x89DA
-0x6B39 = 0x89DC
-0x6B3A = 0x89DD
-0x6B3B = 0x89E7
-0x6B3C = 0x89F4
-0x6B3D = 0x89F8
-0x6B3E = 0x8A03
-0x6B3F = 0x8A16
-0x6B40 = 0x8A10
-0x6B41 = 0x8A0C
-0x6B42 = 0x8A1B
-0x6B43 = 0x8A1D
-0x6B44 = 0x8A25
-0x6B45 = 0x8A36
-0x6B46 = 0x8A41
-0x6B47 = 0x8A5B
-0x6B48 = 0x8A52
-0x6B49 = 0x8A46
-0x6B4A = 0x8A48
-0x6B4B = 0x8A7C
-0x6B4C = 0x8A6D
-0x6B4D = 0x8A6C
-0x6B4E = 0x8A62
-0x6B4F = 0x8A85
-0x6B50 = 0x8A82
-0x6B51 = 0x8A84
-0x6B52 = 0x8AA8
-0x6B53 = 0x8AA1
-0x6B54 = 0x8A91
-0x6B55 = 0x8AA5
-0x6B56 = 0x8AA6
-0x6B57 = 0x8A9A
-0x6B58 = 0x8AA3
-0x6B59 = 0x8AC4
-0x6B5A = 0x8ACD
-0x6B5B = 0x8AC2
-0x6B5C = 0x8ADA
-0x6B5D = 0x8AEB
-0x6B5E = 0x8AF3
-0x6B5F = 0x8AE7
-0x6B60 = 0x8AE4
-0x6B61 = 0x8AF1
-0x6B62 = 0x8B14
-0x6B63 = 0x8AE0
-0x6B64 = 0x8AE2
-0x6B65 = 0x8AF7
-0x6B66 = 0x8ADE
-0x6B67 = 0x8ADB
-0x6B68 = 0x8B0C
-0x6B69 = 0x8B07
-0x6B6A = 0x8B1A
-0x6B6B = 0x8AE1
-0x6B6C = 0x8B16
-0x6B6D = 0x8B10
-0x6B6E = 0x8B17
-0x6B6F = 0x8B20
-0x6B70 = 0x8B33
-0x6B71 = 0x97AB
-0x6B72 = 0x8B26
-0x6B73 = 0x8B2B
-0x6B74 = 0x8B3E
-0x6B75 = 0x8B28
-0x6B76 = 0x8B41
-0x6B77 = 0x8B4C
-0x6B78 = 0x8B4F
-0x6B79 = 0x8B4E
-0x6B7A = 0x8B49
-0x6B7B = 0x8B56
-0x6B7C = 0x8B5B
-0x6B7D = 0x8B5A
-0x6B7E = 0x8B6B
-0x6C21 = 0x8B5F
-0x6C22 = 0x8B6C
-0x6C23 = 0x8B6F
-0x6C24 = 0x8B74
-0x6C25 = 0x8B7D
-0x6C26 = 0x8B80
-0x6C27 = 0x8B8C
-0x6C28 = 0x8B8E
-0x6C29 = 0x8B92
-0x6C2A = 0x8B93
-0x6C2B = 0x8B96
-0x6C2C = 0x8B99
-0x6C2D = 0x8B9A
-0x6C2E = 0x8C3A
-0x6C2F = 0x8C41
-0x6C30 = 0x8C3F
-0x6C31 = 0x8C48
-0x6C32 = 0x8C4C
-0x6C33 = 0x8C4E
-0x6C34 = 0x8C50
-0x6C35 = 0x8C55
-0x6C36 = 0x8C62
-0x6C37 = 0x8C6C
-0x6C38 = 0x8C78
-0x6C39 = 0x8C7A
-0x6C3A = 0x8C82
-0x6C3B = 0x8C89
-0x6C3C = 0x8C85
-0x6C3D = 0x8C8A
-0x6C3E = 0x8C8D
-0x6C3F = 0x8C8E
-0x6C40 = 0x8C94
-0x6C41 = 0x8C7C
-0x6C42 = 0x8C98
-0x6C43 = 0x621D
-0x6C44 = 0x8CAD
-0x6C45 = 0x8CAA
-0x6C46 = 0x8CBD
-0x6C47 = 0x8CB2
-0x6C48 = 0x8CB3
-0x6C49 = 0x8CAE
-0x6C4A = 0x8CB6
-0x6C4B = 0x8CC8
-0x6C4C = 0x8CC1
-0x6C4D = 0x8CE4
-0x6C4E = 0x8CE3
-0x6C4F = 0x8CDA
-0x6C50 = 0x8CFD
-0x6C51 = 0x8CFA
-0x6C52 = 0x8CFB
-0x6C53 = 0x8D04
-0x6C54 = 0x8D05
-0x6C55 = 0x8D0A
-0x6C56 = 0x8D07
-0x6C57 = 0x8D0F
-0x6C58 = 0x8D0D
-0x6C59 = 0x8D10
-0x6C5A = 0x9F4E
-0x6C5B = 0x8D13
-0x6C5C = 0x8CCD
-0x6C5D = 0x8D14
-0x6C5E = 0x8D16
-0x6C5F = 0x8D67
-0x6C60 = 0x8D6D
-0x6C61 = 0x8D71
-0x6C62 = 0x8D73
-0x6C63 = 0x8D81
-0x6C64 = 0x8D99
-0x6C65 = 0x8DC2
-0x6C66 = 0x8DBE
-0x6C67 = 0x8DBA
-0x6C68 = 0x8DCF
-0x6C69 = 0x8DDA
-0x6C6A = 0x8DD6
-0x6C6B = 0x8DCC
-0x6C6C = 0x8DDB
-0x6C6D = 0x8DCB
-0x6C6E = 0x8DEA
-0x6C6F = 0x8DEB
-0x6C70 = 0x8DDF
-0x6C71 = 0x8DE3
-0x6C72 = 0x8DFC
-0x6C73 = 0x8E08
-0x6C74 = 0x8E09
-0x6C75 = 0x8DFF
-0x6C76 = 0x8E1D
-0x6C77 = 0x8E1E
-0x6C78 = 0x8E10
-0x6C79 = 0x8E1F
-0x6C7A = 0x8E42
-0x6C7B = 0x8E35
-0x6C7C = 0x8E30
-0x6C7D = 0x8E34
-0x6C7E = 0x8E4A
-0x6D21 = 0x8E47
-0x6D22 = 0x8E49
-0x6D23 = 0x8E4C
-0x6D24 = 0x8E50
-0x6D25 = 0x8E48
-0x6D26 = 0x8E59
-0x6D27 = 0x8E64
-0x6D28 = 0x8E60
-0x6D29 = 0x8E2A
-0x6D2A = 0x8E63
-0x6D2B = 0x8E55
-0x6D2C = 0x8E76
-0x6D2D = 0x8E72
-0x6D2E = 0x8E7C
-0x6D2F = 0x8E81
-0x6D30 = 0x8E87
-0x6D31 = 0x8E85
-0x6D32 = 0x8E84
-0x6D33 = 0x8E8B
-0x6D34 = 0x8E8A
-0x6D35 = 0x8E93
-0x6D36 = 0x8E91
-0x6D37 = 0x8E94
-0x6D38 = 0x8E99
-0x6D39 = 0x8EAA
-0x6D3A = 0x8EA1
-0x6D3B = 0x8EAC
-0x6D3C = 0x8EB0
-0x6D3D = 0x8EC6
-0x6D3E = 0x8EB1
-0x6D3F = 0x8EBE
-0x6D40 = 0x8EC5
-0x6D41 = 0x8EC8
-0x6D42 = 0x8ECB
-0x6D43 = 0x8EDB
-0x6D44 = 0x8EE3
-0x6D45 = 0x8EFC
-0x6D46 = 0x8EFB
-0x6D47 = 0x8EEB
-0x6D48 = 0x8EFE
-0x6D49 = 0x8F0A
-0x6D4A = 0x8F05
-0x6D4B = 0x8F15
-0x6D4C = 0x8F12
-0x6D4D = 0x8F19
-0x6D4E = 0x8F13
-0x6D4F = 0x8F1C
-0x6D50 = 0x8F1F
-0x6D51 = 0x8F1B
-0x6D52 = 0x8F0C
-0x6D53 = 0x8F26
-0x6D54 = 0x8F33
-0x6D55 = 0x8F3B
-0x6D56 = 0x8F39
-0x6D57 = 0x8F45
-0x6D58 = 0x8F42
-0x6D59 = 0x8F3E
-0x6D5A = 0x8F4C
-0x6D5B = 0x8F49
-0x6D5C = 0x8F46
-0x6D5D = 0x8F4E
-0x6D5E = 0x8F57
-0x6D5F = 0x8F5C
-0x6D60 = 0x8F62
-0x6D61 = 0x8F63
-0x6D62 = 0x8F64
-0x6D63 = 0x8F9C
-0x6D64 = 0x8F9F
-0x6D65 = 0x8FA3
-0x6D66 = 0x8FAD
-0x6D67 = 0x8FAF
-0x6D68 = 0x8FB7
-0x6D69 = 0x8FDA
-0x6D6A = 0x8FE5
-0x6D6B = 0x8FE2
-0x6D6C = 0x8FEA
-0x6D6D = 0x8FEF
-0x6D6E = 0x9087
-0x6D6F = 0x8FF4
-0x6D70 = 0x9005
-0x6D71 = 0x8FF9
-0x6D72 = 0x8FFA
-0x6D73 = 0x9011
-0x6D74 = 0x9015
-0x6D75 = 0x9021
-0x6D76 = 0x900D
-0x6D77 = 0x901E
-0x6D78 = 0x9016
-0x6D79 = 0x900B
-0x6D7A = 0x9027
-0x6D7B = 0x9036
-0x6D7C = 0x9035
-0x6D7D = 0x9039
-0x6D7E = 0x8FF8
-0x6E21 = 0x904F
-0x6E22 = 0x9050
-0x6E23 = 0x9051
-0x6E24 = 0x9052
-0x6E25 = 0x900E
-0x6E26 = 0x9049
-0x6E27 = 0x903E
-0x6E28 = 0x9056
-0x6E29 = 0x9058
-0x6E2A = 0x905E
-0x6E2B = 0x9068
-0x6E2C = 0x906F
-0x6E2D = 0x9076
-0x6E2E = 0x96A8
-0x6E2F = 0x9072
-0x6E30 = 0x9082
-0x6E31 = 0x907D
-0x6E32 = 0x9081
-0x6E33 = 0x9080
-0x6E34 = 0x908A
-0x6E35 = 0x9089
-0x6E36 = 0x908F
-0x6E37 = 0x90A8
-0x6E38 = 0x90AF
-0x6E39 = 0x90B1
-0x6E3A = 0x90B5
-0x6E3B = 0x90E2
-0x6E3C = 0x90E4
-0x6E3D = 0x6248
-0x6E3E = 0x90DB
-0x6E3F = 0x9102
-0x6E40 = 0x9112
-0x6E41 = 0x9119
-0x6E42 = 0x9132
-0x6E43 = 0x9130
-0x6E44 = 0x914A
-0x6E45 = 0x9156
-0x6E46 = 0x9158
-0x6E47 = 0x9163
-0x6E48 = 0x9165
-0x6E49 = 0x9169
-0x6E4A = 0x9173
-0x6E4B = 0x9172
-0x6E4C = 0x918B
-0x6E4D = 0x9189
-0x6E4E = 0x9182
-0x6E4F = 0x91A2
-0x6E50 = 0x91AB
-0x6E51 = 0x91AF
-0x6E52 = 0x91AA
-0x6E53 = 0x91B5
-0x6E54 = 0x91B4
-0x6E55 = 0x91BA
-0x6E56 = 0x91C0
-0x6E57 = 0x91C1
-0x6E58 = 0x91C9
-0x6E59 = 0x91CB
-0x6E5A = 0x91D0
-0x6E5B = 0x91D6
-0x6E5C = 0x91DF
-0x6E5D = 0x91E1
-0x6E5E = 0x91DB
-0x6E5F = 0x91FC
-0x6E60 = 0x91F5
-0x6E61 = 0x91F6
-0x6E62 = 0x921E
-0x6E63 = 0x91FF
-0x6E64 = 0x9214
-0x6E65 = 0x922C
-0x6E66 = 0x9215
-0x6E67 = 0x9211
-0x6E68 = 0x925E
-0x6E69 = 0x9257
-0x6E6A = 0x9245
-0x6E6B = 0x9249
-0x6E6C = 0x9264
-0x6E6D = 0x9248
-0x6E6E = 0x9295
-0x6E6F = 0x923F
-0x6E70 = 0x924B
-0x6E71 = 0x9250
-0x6E72 = 0x929C
-0x6E73 = 0x9296
-0x6E74 = 0x9293
-0x6E75 = 0x929B
-0x6E76 = 0x925A
-0x6E77 = 0x92CF
-0x6E78 = 0x92B9
-0x6E79 = 0x92B7
-0x6E7A = 0x92E9
-0x6E7B = 0x930F
-0x6E7C = 0x92FA
-0x6E7D = 0x9344
-0x6E7E = 0x932E
-0x6F21 = 0x9319
-0x6F22 = 0x9322
-0x6F23 = 0x931A
-0x6F24 = 0x9323
-0x6F25 = 0x933A
-0x6F26 = 0x9335
-0x6F27 = 0x933B
-0x6F28 = 0x935C
-0x6F29 = 0x9360
-0x6F2A = 0x937C
-0x6F2B = 0x936E
-0x6F2C = 0x9356
-0x6F2D = 0x93B0
-0x6F2E = 0x93AC
-0x6F2F = 0x93AD
-0x6F30 = 0x9394
-0x6F31 = 0x93B9
-0x6F32 = 0x93D6
-0x6F33 = 0x93D7
-0x6F34 = 0x93E8
-0x6F35 = 0x93E5
-0x6F36 = 0x93D8
-0x6F37 = 0x93C3
-0x6F38 = 0x93DD
-0x6F39 = 0x93D0
-0x6F3A = 0x93C8
-0x6F3B = 0x93E4
-0x6F3C = 0x941A
-0x6F3D = 0x9414
-0x6F3E = 0x9413
-0x6F3F = 0x9403
-0x6F40 = 0x9407
-0x6F41 = 0x9410
-0x6F42 = 0x9436
-0x6F43 = 0x942B
-0x6F44 = 0x9435
-0x6F45 = 0x9421
-0x6F46 = 0x943A
-0x6F47 = 0x9441
-0x6F48 = 0x9452
-0x6F49 = 0x9444
-0x6F4A = 0x945B
-0x6F4B = 0x9460
-0x6F4C = 0x9462
-0x6F4D = 0x945E
-0x6F4E = 0x946A
-0x6F4F = 0x9229
-0x6F50 = 0x9470
-0x6F51 = 0x9475
-0x6F52 = 0x9477
-0x6F53 = 0x947D
-0x6F54 = 0x945A
-0x6F55 = 0x947C
-0x6F56 = 0x947E
-0x6F57 = 0x9481
-0x6F58 = 0x947F
-0x6F59 = 0x9582
-0x6F5A = 0x9587
-0x6F5B = 0x958A
-0x6F5C = 0x9594
-0x6F5D = 0x9596
-0x6F5E = 0x9598
-0x6F5F = 0x9599
-0x6F60 = 0x95A0
-0x6F61 = 0x95A8
-0x6F62 = 0x95A7
-0x6F63 = 0x95AD
-0x6F64 = 0x95BC
-0x6F65 = 0x95BB
-0x6F66 = 0x95B9
-0x6F67 = 0x95BE
-0x6F68 = 0x95CA
-0x6F69 = 0x6FF6
-0x6F6A = 0x95C3
-0x6F6B = 0x95CD
-0x6F6C = 0x95CC
-0x6F6D = 0x95D5
-0x6F6E = 0x95D4
-0x6F6F = 0x95D6
-0x6F70 = 0x95DC
-0x6F71 = 0x95E1
-0x6F72 = 0x95E5
-0x6F73 = 0x95E2
-0x6F74 = 0x9621
-0x6F75 = 0x9628
-0x6F76 = 0x962E
-0x6F77 = 0x962F
-0x6F78 = 0x9642
-0x6F79 = 0x964C
-0x6F7A = 0x964F
-0x6F7B = 0x964B
-0x6F7C = 0x9677
-0x6F7D = 0x965C
-0x6F7E = 0x965E
-0x7021 = 0x965D
-0x7022 = 0x965F
-0x7023 = 0x9666
-0x7024 = 0x9672
-0x7025 = 0x966C
-0x7026 = 0x968D
-0x7027 = 0x9698
-0x7028 = 0x9695
-0x7029 = 0x9697
-0x702A = 0x96AA
-0x702B = 0x96A7
-0x702C = 0x96B1
-0x702D = 0x96B2
-0x702E = 0x96B0
-0x702F = 0x96B4
-0x7030 = 0x96B6
-0x7031 = 0x96B8
-0x7032 = 0x96B9
-0x7033 = 0x96CE
-0x7034 = 0x96CB
-0x7035 = 0x96C9
-0x7036 = 0x96CD
-0x7037 = 0x894D
-0x7038 = 0x96DC
-0x7039 = 0x970D
-0x703A = 0x96D5
-0x703B = 0x96F9
-0x703C = 0x9704
-0x703D = 0x9706
-0x703E = 0x9708
-0x703F = 0x9713
-0x7040 = 0x970E
-0x7041 = 0x9711
-0x7042 = 0x970F
-0x7043 = 0x9716
-0x7044 = 0x9719
-0x7045 = 0x9724
-0x7046 = 0x972A
-0x7047 = 0x9730
-0x7048 = 0x9739
-0x7049 = 0x973D
-0x704A = 0x973E
-0x704B = 0x9744
-0x704C = 0x9746
-0x704D = 0x9748
-0x704E = 0x9742
-0x704F = 0x9749
-0x7050 = 0x975C
-0x7051 = 0x9760
-0x7052 = 0x9764
-0x7053 = 0x9766
-0x7054 = 0x9768
-0x7055 = 0x52D2
-0x7056 = 0x976B
-0x7057 = 0x9771
-0x7058 = 0x9779
-0x7059 = 0x9785
-0x705A = 0x977C
-0x705B = 0x9781
-0x705C = 0x977A
-0x705D = 0x9786
-0x705E = 0x978B
-0x705F = 0x978F
-0x7060 = 0x9790
-0x7061 = 0x979C
-0x7062 = 0x97A8
-0x7063 = 0x97A6
-0x7064 = 0x97A3
-0x7065 = 0x97B3
-0x7066 = 0x97B4
-0x7067 = 0x97C3
-0x7068 = 0x97C6
-0x7069 = 0x97C8
-0x706A = 0x97CB
-0x706B = 0x97DC
-0x706C = 0x97ED
-0x706D = 0x9F4F
-0x706E = 0x97F2
-0x706F = 0x7ADF
-0x7070 = 0x97F6
-0x7071 = 0x97F5
-0x7072 = 0x980F
-0x7073 = 0x980C
-0x7074 = 0x9838
-0x7075 = 0x9824
-0x7076 = 0x9821
-0x7077 = 0x9837
-0x7078 = 0x983D
-0x7079 = 0x9846
-0x707A = 0x984F
-0x707B = 0x984B
-0x707C = 0x986B
-0x707D = 0x986F
-0x707E = 0x9870
-0x7121 = 0x9871
-0x7122 = 0x9874
-0x7123 = 0x9873
-0x7124 = 0x98AA
-0x7125 = 0x98AF
-0x7126 = 0x98B1
-0x7127 = 0x98B6
-0x7128 = 0x98C4
-0x7129 = 0x98C3
-0x712A = 0x98C6
-0x712B = 0x98E9
-0x712C = 0x98EB
-0x712D = 0x9903
-0x712E = 0x9909
-0x712F = 0x9912
-0x7130 = 0x9914
-0x7131 = 0x9918
-0x7132 = 0x9921
-0x7133 = 0x991D
-0x7134 = 0x991E
-0x7135 = 0x9924
-0x7136 = 0x9920
-0x7137 = 0x992C
-0x7138 = 0x992E
-0x7139 = 0x993D
-0x713A = 0x993E
-0x713B = 0x9942
-0x713C = 0x9949
-0x713D = 0x9945
-0x713E = 0x9950
-0x713F = 0x994B
-0x7140 = 0x9951
-0x7141 = 0x9952
-0x7142 = 0x994C
-0x7143 = 0x9955
-0x7144 = 0x9997
-0x7145 = 0x9998
-0x7146 = 0x99A5
-0x7147 = 0x99AD
-0x7148 = 0x99AE
-0x7149 = 0x99BC
-0x714A = 0x99DF
-0x714B = 0x99DB
-0x714C = 0x99DD
-0x714D = 0x99D8
-0x714E = 0x99D1
-0x714F = 0x99ED
-0x7150 = 0x99EE
-0x7151 = 0x99F1
-0x7152 = 0x99F2
-0x7153 = 0x99FB
-0x7154 = 0x99F8
-0x7155 = 0x9A01
-0x7156 = 0x9A0F
-0x7157 = 0x9A05
-0x7158 = 0x99E2
-0x7159 = 0x9A19
-0x715A = 0x9A2B
-0x715B = 0x9A37
-0x715C = 0x9A45
-0x715D = 0x9A42
-0x715E = 0x9A40
-0x715F = 0x9A43
-0x7160 = 0x9A3E
-0x7161 = 0x9A55
-0x7162 = 0x9A4D
-0x7163 = 0x9A5B
-0x7164 = 0x9A57
-0x7165 = 0x9A5F
-0x7166 = 0x9A62
-0x7167 = 0x9A65
-0x7168 = 0x9A64
-0x7169 = 0x9A69
-0x716A = 0x9A6B
-0x716B = 0x9A6A
-0x716C = 0x9AAD
-0x716D = 0x9AB0
-0x716E = 0x9ABC
-0x716F = 0x9AC0
-0x7170 = 0x9ACF
-0x7171 = 0x9AD1
-0x7172 = 0x9AD3
-0x7173 = 0x9AD4
-0x7174 = 0x9ADE
-0x7175 = 0x9ADF
-0x7176 = 0x9AE2
-0x7177 = 0x9AE3
-0x7178 = 0x9AE6
-0x7179 = 0x9AEF
-0x717A = 0x9AEB
-0x717B = 0x9AEE
-0x717C = 0x9AF4
-0x717D = 0x9AF1
-0x717E = 0x9AF7
-0x7221 = 0x9AFB
-0x7222 = 0x9B06
-0x7223 = 0x9B18
-0x7224 = 0x9B1A
-0x7225 = 0x9B1F
-0x7226 = 0x9B22
-0x7227 = 0x9B23
-0x7228 = 0x9B25
-0x7229 = 0x9B27
-0x722A = 0x9B28
-0x722B = 0x9B29
-0x722C = 0x9B2A
-0x722D = 0x9B2E
-0x722E = 0x9B2F
-0x722F = 0x9B32
-0x7230 = 0x9B44
-0x7231 = 0x9B43
-0x7232 = 0x9B4F
-0x7233 = 0x9B4D
-0x7234 = 0x9B4E
-0x7235 = 0x9B51
-0x7236 = 0x9B58
-0x7237 = 0x9B74
-0x7238 = 0x9B93
-0x7239 = 0x9B83
-0x723A = 0x9B91
-0x723B = 0x9B96
-0x723C = 0x9B97
-0x723D = 0x9B9F
-0x723E = 0x9BA0
-0x723F = 0x9BA8
-0x7240 = 0x9BB4
-0x7241 = 0x9BC0
-0x7242 = 0x9BCA
-0x7243 = 0x9BB9
-0x7244 = 0x9BC6
-0x7245 = 0x9BCF
-0x7246 = 0x9BD1
-0x7247 = 0x9BD2
-0x7248 = 0x9BE3
-0x7249 = 0x9BE2
-0x724A = 0x9BE4
-0x724B = 0x9BD4
-0x724C = 0x9BE1
-0x724D = 0x9C3A
-0x724E = 0x9BF2
-0x724F = 0x9BF1
-0x7250 = 0x9BF0
-0x7251 = 0x9C15
-0x7252 = 0x9C14
-0x7253 = 0x9C09
-0x7254 = 0x9C13
-0x7255 = 0x9C0C
-0x7256 = 0x9C06
-0x7257 = 0x9C08
-0x7258 = 0x9C12
-0x7259 = 0x9C0A
-0x725A = 0x9C04
-0x725B = 0x9C2E
-0x725C = 0x9C1B
-0x725D = 0x9C25
-0x725E = 0x9C24
-0x725F = 0x9C21
-0x7260 = 0x9C30
-0x7261 = 0x9C47
-0x7262 = 0x9C32
-0x7263 = 0x9C46
-0x7264 = 0x9C3E
-0x7265 = 0x9C5A
-0x7266 = 0x9C60
-0x7267 = 0x9C67
-0x7268 = 0x9C76
-0x7269 = 0x9C78
-0x726A = 0x9CE7
-0x726B = 0x9CEC
-0x726C = 0x9CF0
-0x726D = 0x9D09
-0x726E = 0x9D08
-0x726F = 0x9CEB
-0x7270 = 0x9D03
-0x7271 = 0x9D06
-0x7272 = 0x9D2A
-0x7273 = 0x9D26
-0x7274 = 0x9DAF
-0x7275 = 0x9D23
-0x7276 = 0x9D1F
-0x7277 = 0x9D44
-0x7278 = 0x9D15
-0x7279 = 0x9D12
-0x727A = 0x9D41
-0x727B = 0x9D3F
-0x727C = 0x9D3E
-0x727D = 0x9D46
-0x727E = 0x9D48
-0x7321 = 0x9D5D
-0x7322 = 0x9D5E
-0x7323 = 0x9D64
-0x7324 = 0x9D51
-0x7325 = 0x9D50
-0x7326 = 0x9D59
-0x7327 = 0x9D72
-0x7328 = 0x9D89
-0x7329 = 0x9D87
-0x732A = 0x9DAB
-0x732B = 0x9D6F
-0x732C = 0x9D7A
-0x732D = 0x9D9A
-0x732E = 0x9DA4
-0x732F = 0x9DA9
-0x7330 = 0x9DB2
-0x7331 = 0x9DC4
-0x7332 = 0x9DC1
-0x7333 = 0x9DBB
-0x7334 = 0x9DB8
-0x7335 = 0x9DBA
-0x7336 = 0x9DC6
-0x7337 = 0x9DCF
-0x7338 = 0x9DC2
-0x7339 = 0x9DD9
-0x733A = 0x9DD3
-0x733B = 0x9DF8
-0x733C = 0x9DE6
-0x733D = 0x9DED
-0x733E = 0x9DEF
-0x733F = 0x9DFD
-0x7340 = 0x9E1A
-0x7341 = 0x9E1B
-0x7342 = 0x9E1E
-0x7343 = 0x9E75
-0x7344 = 0x9E79
-0x7345 = 0x9E7D
-0x7346 = 0x9E81
-0x7347 = 0x9E88
-0x7348 = 0x9E8B
-0x7349 = 0x9E8C
-0x734A = 0x9E92
-0x734B = 0x9E95
-0x734C = 0x9E91
-0x734D = 0x9E9D
-0x734E = 0x9EA5
-0x734F = 0x9EA9
-0x7350 = 0x9EB8
-0x7351 = 0x9EAA
-0x7352 = 0x9EAD
-0x7353 = 0x9761
-0x7354 = 0x9ECC
-0x7355 = 0x9ECE
-0x7356 = 0x9ECF
-0x7357 = 0x9ED0
-0x7358 = 0x9ED4
-0x7359 = 0x9EDC
-0x735A = 0x9EDE
-0x735B = 0x9EDD
-0x735C = 0x9EE0
-0x735D = 0x9EE5
-0x735E = 0x9EE8
-0x735F = 0x9EEF
-0x7360 = 0x9EF4
-0x7361 = 0x9EF6
-0x7362 = 0x9EF7
-0x7363 = 0x9EF9
-0x7364 = 0x9EFB
-0x7365 = 0x9EFC
-0x7366 = 0x9EFD
-0x7367 = 0x9F07
-0x7368 = 0x9F08
-0x7369 = 0x76B7
-0x736A = 0x9F15
-0x736B = 0x9F21
-0x736C = 0x9F2C
-0x736D = 0x9F3E
-0x736E = 0x9F4A
-0x736F = 0x9F52
-0x7370 = 0x9F54
-0x7371 = 0x9F63
-0x7372 = 0x9F5F
-0x7373 = 0x9F60
-0x7374 = 0x9F61
-0x7375 = 0x9F66
-0x7376 = 0x9F67
-0x7377 = 0x9F6C
-0x7378 = 0x9F6A
-0x7379 = 0x9F77
-0x737A = 0x9F72
-0x737B = 0x9F76
-0x737C = 0x9F95
-0x737D = 0x9F9C
-0x737E = 0x9FA0
-0x7421 = 0x582F
-0x7422 = 0x69C7
-0x7423 = 0x9059
-0x7424 = 0x7464
-0x7425 = 0x51DC
-0x7426 = 0x7199
-END_MAP
diff --git a/enc/trans/JIS/JISX0208UDC%UCS.src b/enc/trans/JIS/JISX0208UDC%UCS.src
deleted file mode 100644
index 9f5dd94090..0000000000
--- a/enc/trans/JIS/JISX0208UDC%UCS.src
+++ /dev/null
@@ -1,954 +0,0 @@
-# $NetBSD: JISX0208UDC%UCS.src,v 1.1 2003/07/19 20:20:40 tshiozak Exp $
-
-TYPE ROWCOL
-NAME "JISX0208UDC/UCS"
-SRC_ZONE 0x75-0x7E / 0x21-0x7E / 8
-OOB_MODE INVALID
-DST_INVALID 0xFFFE
-DST_UNIT_BITS 16
-
-BEGIN_MAP
-#
-# This data is derived from http://www.opengroup.or.jp/jvc/cde/
-#
-0x7521 = 0xE000
-0x7522 = 0xE001
-0x7523 = 0xE002
-0x7524 = 0xE003
-0x7525 = 0xE004
-0x7526 = 0xE005
-0x7527 = 0xE006
-0x7528 = 0xE007
-0x7529 = 0xE008
-0x752A = 0xE009
-0x752B = 0xE00A
-0x752C = 0xE00B
-0x752D = 0xE00C
-0x752E = 0xE00D
-0x752F = 0xE00E
-0x7530 = 0xE00F
-0x7531 = 0xE010
-0x7532 = 0xE011
-0x7533 = 0xE012
-0x7534 = 0xE013
-0x7535 = 0xE014
-0x7536 = 0xE015
-0x7537 = 0xE016
-0x7538 = 0xE017
-0x7539 = 0xE018
-0x753A = 0xE019
-0x753B = 0xE01A
-0x753C = 0xE01B
-0x753D = 0xE01C
-0x753E = 0xE01D
-0x753F = 0xE01E
-0x7540 = 0xE01F
-0x7541 = 0xE020
-0x7542 = 0xE021
-0x7543 = 0xE022
-0x7544 = 0xE023
-0x7545 = 0xE024
-0x7546 = 0xE025
-0x7547 = 0xE026
-0x7548 = 0xE027
-0x7549 = 0xE028
-0x754A = 0xE029
-0x754B = 0xE02A
-0x754C = 0xE02B
-0x754D = 0xE02C
-0x754E = 0xE02D
-0x754F = 0xE02E
-0x7550 = 0xE02F
-0x7551 = 0xE030
-0x7552 = 0xE031
-0x7553 = 0xE032
-0x7554 = 0xE033
-0x7555 = 0xE034
-0x7556 = 0xE035
-0x7557 = 0xE036
-0x7558 = 0xE037
-0x7559 = 0xE038
-0x755A = 0xE039
-0x755B = 0xE03A
-0x755C = 0xE03B
-0x755D = 0xE03C
-0x755E = 0xE03D
-0x755F = 0xE03E
-0x7560 = 0xE03F
-0x7561 = 0xE040
-0x7562 = 0xE041
-0x7563 = 0xE042
-0x7564 = 0xE043
-0x7565 = 0xE044
-0x7566 = 0xE045
-0x7567 = 0xE046
-0x7568 = 0xE047
-0x7569 = 0xE048
-0x756A = 0xE049
-0x756B = 0xE04A
-0x756C = 0xE04B
-0x756D = 0xE04C
-0x756E = 0xE04D
-0x756F = 0xE04E
-0x7570 = 0xE04F
-0x7571 = 0xE050
-0x7572 = 0xE051
-0x7573 = 0xE052
-0x7574 = 0xE053
-0x7575 = 0xE054
-0x7576 = 0xE055
-0x7577 = 0xE056
-0x7578 = 0xE057
-0x7579 = 0xE058
-0x757A = 0xE059
-0x757B = 0xE05A
-0x757C = 0xE05B
-0x757D = 0xE05C
-0x757E = 0xE05D
-0x7621 = 0xE05E
-0x7622 = 0xE05F
-0x7623 = 0xE060
-0x7624 = 0xE061
-0x7625 = 0xE062
-0x7626 = 0xE063
-0x7627 = 0xE064
-0x7628 = 0xE065
-0x7629 = 0xE066
-0x762A = 0xE067
-0x762B = 0xE068
-0x762C = 0xE069
-0x762D = 0xE06A
-0x762E = 0xE06B
-0x762F = 0xE06C
-0x7630 = 0xE06D
-0x7631 = 0xE06E
-0x7632 = 0xE06F
-0x7633 = 0xE070
-0x7634 = 0xE071
-0x7635 = 0xE072
-0x7636 = 0xE073
-0x7637 = 0xE074
-0x7638 = 0xE075
-0x7639 = 0xE076
-0x763A = 0xE077
-0x763B = 0xE078
-0x763C = 0xE079
-0x763D = 0xE07A
-0x763E = 0xE07B
-0x763F = 0xE07C
-0x7640 = 0xE07D
-0x7641 = 0xE07E
-0x7642 = 0xE07F
-0x7643 = 0xE080
-0x7644 = 0xE081
-0x7645 = 0xE082
-0x7646 = 0xE083
-0x7647 = 0xE084
-0x7648 = 0xE085
-0x7649 = 0xE086
-0x764A = 0xE087
-0x764B = 0xE088
-0x764C = 0xE089
-0x764D = 0xE08A
-0x764E = 0xE08B
-0x764F = 0xE08C
-0x7650 = 0xE08D
-0x7651 = 0xE08E
-0x7652 = 0xE08F
-0x7653 = 0xE090
-0x7654 = 0xE091
-0x7655 = 0xE092
-0x7656 = 0xE093
-0x7657 = 0xE094
-0x7658 = 0xE095
-0x7659 = 0xE096
-0x765A = 0xE097
-0x765B = 0xE098
-0x765C = 0xE099
-0x765D = 0xE09A
-0x765E = 0xE09B
-0x765F = 0xE09C
-0x7660 = 0xE09D
-0x7661 = 0xE09E
-0x7662 = 0xE09F
-0x7663 = 0xE0A0
-0x7664 = 0xE0A1
-0x7665 = 0xE0A2
-0x7666 = 0xE0A3
-0x7667 = 0xE0A4
-0x7668 = 0xE0A5
-0x7669 = 0xE0A6
-0x766A = 0xE0A7
-0x766B = 0xE0A8
-0x766C = 0xE0A9
-0x766D = 0xE0AA
-0x766E = 0xE0AB
-0x766F = 0xE0AC
-0x7670 = 0xE0AD
-0x7671 = 0xE0AE
-0x7672 = 0xE0AF
-0x7673 = 0xE0B0
-0x7674 = 0xE0B1
-0x7675 = 0xE0B2
-0x7676 = 0xE0B3
-0x7677 = 0xE0B4
-0x7678 = 0xE0B5
-0x7679 = 0xE0B6
-0x767A = 0xE0B7
-0x767B = 0xE0B8
-0x767C = 0xE0B9
-0x767D = 0xE0BA
-0x767E = 0xE0BB
-0x7721 = 0xE0BC
-0x7722 = 0xE0BD
-0x7723 = 0xE0BE
-0x7724 = 0xE0BF
-0x7725 = 0xE0C0
-0x7726 = 0xE0C1
-0x7727 = 0xE0C2
-0x7728 = 0xE0C3
-0x7729 = 0xE0C4
-0x772A = 0xE0C5
-0x772B = 0xE0C6
-0x772C = 0xE0C7
-0x772D = 0xE0C8
-0x772E = 0xE0C9
-0x772F = 0xE0CA
-0x7730 = 0xE0CB
-0x7731 = 0xE0CC
-0x7732 = 0xE0CD
-0x7733 = 0xE0CE
-0x7734 = 0xE0CF
-0x7735 = 0xE0D0
-0x7736 = 0xE0D1
-0x7737 = 0xE0D2
-0x7738 = 0xE0D3
-0x7739 = 0xE0D4
-0x773A = 0xE0D5
-0x773B = 0xE0D6
-0x773C = 0xE0D7
-0x773D = 0xE0D8
-0x773E = 0xE0D9
-0x773F = 0xE0DA
-0x7740 = 0xE0DB
-0x7741 = 0xE0DC
-0x7742 = 0xE0DD
-0x7743 = 0xE0DE
-0x7744 = 0xE0DF
-0x7745 = 0xE0E0
-0x7746 = 0xE0E1
-0x7747 = 0xE0E2
-0x7748 = 0xE0E3
-0x7749 = 0xE0E4
-0x774A = 0xE0E5
-0x774B = 0xE0E6
-0x774C = 0xE0E7
-0x774D = 0xE0E8
-0x774E = 0xE0E9
-0x774F = 0xE0EA
-0x7750 = 0xE0EB
-0x7751 = 0xE0EC
-0x7752 = 0xE0ED
-0x7753 = 0xE0EE
-0x7754 = 0xE0EF
-0x7755 = 0xE0F0
-0x7756 = 0xE0F1
-0x7757 = 0xE0F2
-0x7758 = 0xE0F3
-0x7759 = 0xE0F4
-0x775A = 0xE0F5
-0x775B = 0xE0F6
-0x775C = 0xE0F7
-0x775D = 0xE0F8
-0x775E = 0xE0F9
-0x775F = 0xE0FA
-0x7760 = 0xE0FB
-0x7761 = 0xE0FC
-0x7762 = 0xE0FD
-0x7763 = 0xE0FE
-0x7764 = 0xE0FF
-0x7765 = 0xE100
-0x7766 = 0xE101
-0x7767 = 0xE102
-0x7768 = 0xE103
-0x7769 = 0xE104
-0x776A = 0xE105
-0x776B = 0xE106
-0x776C = 0xE107
-0x776D = 0xE108
-0x776E = 0xE109
-0x776F = 0xE10A
-0x7770 = 0xE10B
-0x7771 = 0xE10C
-0x7772 = 0xE10D
-0x7773 = 0xE10E
-0x7774 = 0xE10F
-0x7775 = 0xE110
-0x7776 = 0xE111
-0x7777 = 0xE112
-0x7778 = 0xE113
-0x7779 = 0xE114
-0x777A = 0xE115
-0x777B = 0xE116
-0x777C = 0xE117
-0x777D = 0xE118
-0x777E = 0xE119
-0x7821 = 0xE11A
-0x7822 = 0xE11B
-0x7823 = 0xE11C
-0x7824 = 0xE11D
-0x7825 = 0xE11E
-0x7826 = 0xE11F
-0x7827 = 0xE120
-0x7828 = 0xE121
-0x7829 = 0xE122
-0x782A = 0xE123
-0x782B = 0xE124
-0x782C = 0xE125
-0x782D = 0xE126
-0x782E = 0xE127
-0x782F = 0xE128
-0x7830 = 0xE129
-0x7831 = 0xE12A
-0x7832 = 0xE12B
-0x7833 = 0xE12C
-0x7834 = 0xE12D
-0x7835 = 0xE12E
-0x7836 = 0xE12F
-0x7837 = 0xE130
-0x7838 = 0xE131
-0x7839 = 0xE132
-0x783A = 0xE133
-0x783B = 0xE134
-0x783C = 0xE135
-0x783D = 0xE136
-0x783E = 0xE137
-0x783F = 0xE138
-0x7840 = 0xE139
-0x7841 = 0xE13A
-0x7842 = 0xE13B
-0x7843 = 0xE13C
-0x7844 = 0xE13D
-0x7845 = 0xE13E
-0x7846 = 0xE13F
-0x7847 = 0xE140
-0x7848 = 0xE141
-0x7849 = 0xE142
-0x784A = 0xE143
-0x784B = 0xE144
-0x784C = 0xE145
-0x784D = 0xE146
-0x784E = 0xE147
-0x784F = 0xE148
-0x7850 = 0xE149
-0x7851 = 0xE14A
-0x7852 = 0xE14B
-0x7853 = 0xE14C
-0x7854 = 0xE14D
-0x7855 = 0xE14E
-0x7856 = 0xE14F
-0x7857 = 0xE150
-0x7858 = 0xE151
-0x7859 = 0xE152
-0x785A = 0xE153
-0x785B = 0xE154
-0x785C = 0xE155
-0x785D = 0xE156
-0x785E = 0xE157
-0x785F = 0xE158
-0x7860 = 0xE159
-0x7861 = 0xE15A
-0x7862 = 0xE15B
-0x7863 = 0xE15C
-0x7864 = 0xE15D
-0x7865 = 0xE15E
-0x7866 = 0xE15F
-0x7867 = 0xE160
-0x7868 = 0xE161
-0x7869 = 0xE162
-0x786A = 0xE163
-0x786B = 0xE164
-0x786C = 0xE165
-0x786D = 0xE166
-0x786E = 0xE167
-0x786F = 0xE168
-0x7870 = 0xE169
-0x7871 = 0xE16A
-0x7872 = 0xE16B
-0x7873 = 0xE16C
-0x7874 = 0xE16D
-0x7875 = 0xE16E
-0x7876 = 0xE16F
-0x7877 = 0xE170
-0x7878 = 0xE171
-0x7879 = 0xE172
-0x787A = 0xE173
-0x787B = 0xE174
-0x787C = 0xE175
-0x787D = 0xE176
-0x787E = 0xE177
-0x7921 = 0xE178
-0x7922 = 0xE179
-0x7923 = 0xE17A
-0x7924 = 0xE17B
-0x7925 = 0xE17C
-0x7926 = 0xE17D
-0x7927 = 0xE17E
-0x7928 = 0xE17F
-0x7929 = 0xE180
-0x792A = 0xE181
-0x792B = 0xE182
-0x792C = 0xE183
-0x792D = 0xE184
-0x792E = 0xE185
-0x792F = 0xE186
-0x7930 = 0xE187
-0x7931 = 0xE188
-0x7932 = 0xE189
-0x7933 = 0xE18A
-0x7934 = 0xE18B
-0x7935 = 0xE18C
-0x7936 = 0xE18D
-0x7937 = 0xE18E
-0x7938 = 0xE18F
-0x7939 = 0xE190
-0x793A = 0xE191
-0x793B = 0xE192
-0x793C = 0xE193
-0x793D = 0xE194
-0x793E = 0xE195
-0x793F = 0xE196
-0x7940 = 0xE197
-0x7941 = 0xE198
-0x7942 = 0xE199
-0x7943 = 0xE19A
-0x7944 = 0xE19B
-0x7945 = 0xE19C
-0x7946 = 0xE19D
-0x7947 = 0xE19E
-0x7948 = 0xE19F
-0x7949 = 0xE1A0
-0x794A = 0xE1A1
-0x794B = 0xE1A2
-0x794C = 0xE1A3
-0x794D = 0xE1A4
-0x794E = 0xE1A5
-0x794F = 0xE1A6
-0x7950 = 0xE1A7
-0x7951 = 0xE1A8
-0x7952 = 0xE1A9
-0x7953 = 0xE1AA
-0x7954 = 0xE1AB
-0x7955 = 0xE1AC
-0x7956 = 0xE1AD
-0x7957 = 0xE1AE
-0x7958 = 0xE1AF
-0x7959 = 0xE1B0
-0x795A = 0xE1B1
-0x795B = 0xE1B2
-0x795C = 0xE1B3
-0x795D = 0xE1B4
-0x795E = 0xE1B5
-0x795F = 0xE1B6
-0x7960 = 0xE1B7
-0x7961 = 0xE1B8
-0x7962 = 0xE1B9
-0x7963 = 0xE1BA
-0x7964 = 0xE1BB
-0x7965 = 0xE1BC
-0x7966 = 0xE1BD
-0x7967 = 0xE1BE
-0x7968 = 0xE1BF
-0x7969 = 0xE1C0
-0x796A = 0xE1C1
-0x796B = 0xE1C2
-0x796C = 0xE1C3
-0x796D = 0xE1C4
-0x796E = 0xE1C5
-0x796F = 0xE1C6
-0x7970 = 0xE1C7
-0x7971 = 0xE1C8
-0x7972 = 0xE1C9
-0x7973 = 0xE1CA
-0x7974 = 0xE1CB
-0x7975 = 0xE1CC
-0x7976 = 0xE1CD
-0x7977 = 0xE1CE
-0x7978 = 0xE1CF
-0x7979 = 0xE1D0
-0x797A = 0xE1D1
-0x797B = 0xE1D2
-0x797C = 0xE1D3
-0x797D = 0xE1D4
-0x797E = 0xE1D5
-0x7A21 = 0xE1D6
-0x7A22 = 0xE1D7
-0x7A23 = 0xE1D8
-0x7A24 = 0xE1D9
-0x7A25 = 0xE1DA
-0x7A26 = 0xE1DB
-0x7A27 = 0xE1DC
-0x7A28 = 0xE1DD
-0x7A29 = 0xE1DE
-0x7A2A = 0xE1DF
-0x7A2B = 0xE1E0
-0x7A2C = 0xE1E1
-0x7A2D = 0xE1E2
-0x7A2E = 0xE1E3
-0x7A2F = 0xE1E4
-0x7A30 = 0xE1E5
-0x7A31 = 0xE1E6
-0x7A32 = 0xE1E7
-0x7A33 = 0xE1E8
-0x7A34 = 0xE1E9
-0x7A35 = 0xE1EA
-0x7A36 = 0xE1EB
-0x7A37 = 0xE1EC
-0x7A38 = 0xE1ED
-0x7A39 = 0xE1EE
-0x7A3A = 0xE1EF
-0x7A3B = 0xE1F0
-0x7A3C = 0xE1F1
-0x7A3D = 0xE1F2
-0x7A3E = 0xE1F3
-0x7A3F = 0xE1F4
-0x7A40 = 0xE1F5
-0x7A41 = 0xE1F6
-0x7A42 = 0xE1F7
-0x7A43 = 0xE1F8
-0x7A44 = 0xE1F9
-0x7A45 = 0xE1FA
-0x7A46 = 0xE1FB
-0x7A47 = 0xE1FC
-0x7A48 = 0xE1FD
-0x7A49 = 0xE1FE
-0x7A4A = 0xE1FF
-0x7A4B = 0xE200
-0x7A4C = 0xE201
-0x7A4D = 0xE202
-0x7A4E = 0xE203
-0x7A4F = 0xE204
-0x7A50 = 0xE205
-0x7A51 = 0xE206
-0x7A52 = 0xE207
-0x7A53 = 0xE208
-0x7A54 = 0xE209
-0x7A55 = 0xE20A
-0x7A56 = 0xE20B
-0x7A57 = 0xE20C
-0x7A58 = 0xE20D
-0x7A59 = 0xE20E
-0x7A5A = 0xE20F
-0x7A5B = 0xE210
-0x7A5C = 0xE211
-0x7A5D = 0xE212
-0x7A5E = 0xE213
-0x7A5F = 0xE214
-0x7A60 = 0xE215
-0x7A61 = 0xE216
-0x7A62 = 0xE217
-0x7A63 = 0xE218
-0x7A64 = 0xE219
-0x7A65 = 0xE21A
-0x7A66 = 0xE21B
-0x7A67 = 0xE21C
-0x7A68 = 0xE21D
-0x7A69 = 0xE21E
-0x7A6A = 0xE21F
-0x7A6B = 0xE220
-0x7A6C = 0xE221
-0x7A6D = 0xE222
-0x7A6E = 0xE223
-0x7A6F = 0xE224
-0x7A70 = 0xE225
-0x7A71 = 0xE226
-0x7A72 = 0xE227
-0x7A73 = 0xE228
-0x7A74 = 0xE229
-0x7A75 = 0xE22A
-0x7A76 = 0xE22B
-0x7A77 = 0xE22C
-0x7A78 = 0xE22D
-0x7A79 = 0xE22E
-0x7A7A = 0xE22F
-0x7A7B = 0xE230
-0x7A7C = 0xE231
-0x7A7D = 0xE232
-0x7A7E = 0xE233
-0x7B21 = 0xE234
-0x7B22 = 0xE235
-0x7B23 = 0xE236
-0x7B24 = 0xE237
-0x7B25 = 0xE238
-0x7B26 = 0xE239
-0x7B27 = 0xE23A
-0x7B28 = 0xE23B
-0x7B29 = 0xE23C
-0x7B2A = 0xE23D
-0x7B2B = 0xE23E
-0x7B2C = 0xE23F
-0x7B2D = 0xE240
-0x7B2E = 0xE241
-0x7B2F = 0xE242
-0x7B30 = 0xE243
-0x7B31 = 0xE244
-0x7B32 = 0xE245
-0x7B33 = 0xE246
-0x7B34 = 0xE247
-0x7B35 = 0xE248
-0x7B36 = 0xE249
-0x7B37 = 0xE24A
-0x7B38 = 0xE24B
-0x7B39 = 0xE24C
-0x7B3A = 0xE24D
-0x7B3B = 0xE24E
-0x7B3C = 0xE24F
-0x7B3D = 0xE250
-0x7B3E = 0xE251
-0x7B3F = 0xE252
-0x7B40 = 0xE253
-0x7B41 = 0xE254
-0x7B42 = 0xE255
-0x7B43 = 0xE256
-0x7B44 = 0xE257
-0x7B45 = 0xE258
-0x7B46 = 0xE259
-0x7B47 = 0xE25A
-0x7B48 = 0xE25B
-0x7B49 = 0xE25C
-0x7B4A = 0xE25D
-0x7B4B = 0xE25E
-0x7B4C = 0xE25F
-0x7B4D = 0xE260
-0x7B4E = 0xE261
-0x7B4F = 0xE262
-0x7B50 = 0xE263
-0x7B51 = 0xE264
-0x7B52 = 0xE265
-0x7B53 = 0xE266
-0x7B54 = 0xE267
-0x7B55 = 0xE268
-0x7B56 = 0xE269
-0x7B57 = 0xE26A
-0x7B58 = 0xE26B
-0x7B59 = 0xE26C
-0x7B5A = 0xE26D
-0x7B5B = 0xE26E
-0x7B5C = 0xE26F
-0x7B5D = 0xE270
-0x7B5E = 0xE271
-0x7B5F = 0xE272
-0x7B60 = 0xE273
-0x7B61 = 0xE274
-0x7B62 = 0xE275
-0x7B63 = 0xE276
-0x7B64 = 0xE277
-0x7B65 = 0xE278
-0x7B66 = 0xE279
-0x7B67 = 0xE27A
-0x7B68 = 0xE27B
-0x7B69 = 0xE27C
-0x7B6A = 0xE27D
-0x7B6B = 0xE27E
-0x7B6C = 0xE27F
-0x7B6D = 0xE280
-0x7B6E = 0xE281
-0x7B6F = 0xE282
-0x7B70 = 0xE283
-0x7B71 = 0xE284
-0x7B72 = 0xE285
-0x7B73 = 0xE286
-0x7B74 = 0xE287
-0x7B75 = 0xE288
-0x7B76 = 0xE289
-0x7B77 = 0xE28A
-0x7B78 = 0xE28B
-0x7B79 = 0xE28C
-0x7B7A = 0xE28D
-0x7B7B = 0xE28E
-0x7B7C = 0xE28F
-0x7B7D = 0xE290
-0x7B7E = 0xE291
-0x7C21 = 0xE292
-0x7C22 = 0xE293
-0x7C23 = 0xE294
-0x7C24 = 0xE295
-0x7C25 = 0xE296
-0x7C26 = 0xE297
-0x7C27 = 0xE298
-0x7C28 = 0xE299
-0x7C29 = 0xE29A
-0x7C2A = 0xE29B
-0x7C2B = 0xE29C
-0x7C2C = 0xE29D
-0x7C2D = 0xE29E
-0x7C2E = 0xE29F
-0x7C2F = 0xE2A0
-0x7C30 = 0xE2A1
-0x7C31 = 0xE2A2
-0x7C32 = 0xE2A3
-0x7C33 = 0xE2A4
-0x7C34 = 0xE2A5
-0x7C35 = 0xE2A6
-0x7C36 = 0xE2A7
-0x7C37 = 0xE2A8
-0x7C38 = 0xE2A9
-0x7C39 = 0xE2AA
-0x7C3A = 0xE2AB
-0x7C3B = 0xE2AC
-0x7C3C = 0xE2AD
-0x7C3D = 0xE2AE
-0x7C3E = 0xE2AF
-0x7C3F = 0xE2B0
-0x7C40 = 0xE2B1
-0x7C41 = 0xE2B2
-0x7C42 = 0xE2B3
-0x7C43 = 0xE2B4
-0x7C44 = 0xE2B5
-0x7C45 = 0xE2B6
-0x7C46 = 0xE2B7
-0x7C47 = 0xE2B8
-0x7C48 = 0xE2B9
-0x7C49 = 0xE2BA
-0x7C4A = 0xE2BB
-0x7C4B = 0xE2BC
-0x7C4C = 0xE2BD
-0x7C4D = 0xE2BE
-0x7C4E = 0xE2BF
-0x7C4F = 0xE2C0
-0x7C50 = 0xE2C1
-0x7C51 = 0xE2C2
-0x7C52 = 0xE2C3
-0x7C53 = 0xE2C4
-0x7C54 = 0xE2C5
-0x7C55 = 0xE2C6
-0x7C56 = 0xE2C7
-0x7C57 = 0xE2C8
-0x7C58 = 0xE2C9
-0x7C59 = 0xE2CA
-0x7C5A = 0xE2CB
-0x7C5B = 0xE2CC
-0x7C5C = 0xE2CD
-0x7C5D = 0xE2CE
-0x7C5E = 0xE2CF
-0x7C5F = 0xE2D0
-0x7C60 = 0xE2D1
-0x7C61 = 0xE2D2
-0x7C62 = 0xE2D3
-0x7C63 = 0xE2D4
-0x7C64 = 0xE2D5
-0x7C65 = 0xE2D6
-0x7C66 = 0xE2D7
-0x7C67 = 0xE2D8
-0x7C68 = 0xE2D9
-0x7C69 = 0xE2DA
-0x7C6A = 0xE2DB
-0x7C6B = 0xE2DC
-0x7C6C = 0xE2DD
-0x7C6D = 0xE2DE
-0x7C6E = 0xE2DF
-0x7C6F = 0xE2E0
-0x7C70 = 0xE2E1
-0x7C71 = 0xE2E2
-0x7C72 = 0xE2E3
-0x7C73 = 0xE2E4
-0x7C74 = 0xE2E5
-0x7C75 = 0xE2E6
-0x7C76 = 0xE2E7
-0x7C77 = 0xE2E8
-0x7C78 = 0xE2E9
-0x7C79 = 0xE2EA
-0x7C7A = 0xE2EB
-0x7C7B = 0xE2EC
-0x7C7C = 0xE2ED
-0x7C7D = 0xE2EE
-0x7C7E = 0xE2EF
-0x7D21 = 0xE2F0
-0x7D22 = 0xE2F1
-0x7D23 = 0xE2F2
-0x7D24 = 0xE2F3
-0x7D25 = 0xE2F4
-0x7D26 = 0xE2F5
-0x7D27 = 0xE2F6
-0x7D28 = 0xE2F7
-0x7D29 = 0xE2F8
-0x7D2A = 0xE2F9
-0x7D2B = 0xE2FA
-0x7D2C = 0xE2FB
-0x7D2D = 0xE2FC
-0x7D2E = 0xE2FD
-0x7D2F = 0xE2FE
-0x7D30 = 0xE2FF
-0x7D31 = 0xE300
-0x7D32 = 0xE301
-0x7D33 = 0xE302
-0x7D34 = 0xE303
-0x7D35 = 0xE304
-0x7D36 = 0xE305
-0x7D37 = 0xE306
-0x7D38 = 0xE307
-0x7D39 = 0xE308
-0x7D3A = 0xE309
-0x7D3B = 0xE30A
-0x7D3C = 0xE30B
-0x7D3D = 0xE30C
-0x7D3E = 0xE30D
-0x7D3F = 0xE30E
-0x7D40 = 0xE30F
-0x7D41 = 0xE310
-0x7D42 = 0xE311
-0x7D43 = 0xE312
-0x7D44 = 0xE313
-0x7D45 = 0xE314
-0x7D46 = 0xE315
-0x7D47 = 0xE316
-0x7D48 = 0xE317
-0x7D49 = 0xE318
-0x7D4A = 0xE319
-0x7D4B = 0xE31A
-0x7D4C = 0xE31B
-0x7D4D = 0xE31C
-0x7D4E = 0xE31D
-0x7D4F = 0xE31E
-0x7D50 = 0xE31F
-0x7D51 = 0xE320
-0x7D52 = 0xE321
-0x7D53 = 0xE322
-0x7D54 = 0xE323
-0x7D55 = 0xE324
-0x7D56 = 0xE325
-0x7D57 = 0xE326
-0x7D58 = 0xE327
-0x7D59 = 0xE328
-0x7D5A = 0xE329
-0x7D5B = 0xE32A
-0x7D5C = 0xE32B
-0x7D5D = 0xE32C
-0x7D5E = 0xE32D
-0x7D5F = 0xE32E
-0x7D60 = 0xE32F
-0x7D61 = 0xE330
-0x7D62 = 0xE331
-0x7D63 = 0xE332
-0x7D64 = 0xE333
-0x7D65 = 0xE334
-0x7D66 = 0xE335
-0x7D67 = 0xE336
-0x7D68 = 0xE337
-0x7D69 = 0xE338
-0x7D6A = 0xE339
-0x7D6B = 0xE33A
-0x7D6C = 0xE33B
-0x7D6D = 0xE33C
-0x7D6E = 0xE33D
-0x7D6F = 0xE33E
-0x7D70 = 0xE33F
-0x7D71 = 0xE340
-0x7D72 = 0xE341
-0x7D73 = 0xE342
-0x7D74 = 0xE343
-0x7D75 = 0xE344
-0x7D76 = 0xE345
-0x7D77 = 0xE346
-0x7D78 = 0xE347
-0x7D79 = 0xE348
-0x7D7A = 0xE349
-0x7D7B = 0xE34A
-0x7D7C = 0xE34B
-0x7D7D = 0xE34C
-0x7D7E = 0xE34D
-0x7E21 = 0xE34E
-0x7E22 = 0xE34F
-0x7E23 = 0xE350
-0x7E24 = 0xE351
-0x7E25 = 0xE352
-0x7E26 = 0xE353
-0x7E27 = 0xE354
-0x7E28 = 0xE355
-0x7E29 = 0xE356
-0x7E2A = 0xE357
-0x7E2B = 0xE358
-0x7E2C = 0xE359
-0x7E2D = 0xE35A
-0x7E2E = 0xE35B
-0x7E2F = 0xE35C
-0x7E30 = 0xE35D
-0x7E31 = 0xE35E
-0x7E32 = 0xE35F
-0x7E33 = 0xE360
-0x7E34 = 0xE361
-0x7E35 = 0xE362
-0x7E36 = 0xE363
-0x7E37 = 0xE364
-0x7E38 = 0xE365
-0x7E39 = 0xE366
-0x7E3A = 0xE367
-0x7E3B = 0xE368
-0x7E3C = 0xE369
-0x7E3D = 0xE36A
-0x7E3E = 0xE36B
-0x7E3F = 0xE36C
-0x7E40 = 0xE36D
-0x7E41 = 0xE36E
-0x7E42 = 0xE36F
-0x7E43 = 0xE370
-0x7E44 = 0xE371
-0x7E45 = 0xE372
-0x7E46 = 0xE373
-0x7E47 = 0xE374
-0x7E48 = 0xE375
-0x7E49 = 0xE376
-0x7E4A = 0xE377
-0x7E4B = 0xE378
-0x7E4C = 0xE379
-0x7E4D = 0xE37A
-0x7E4E = 0xE37B
-0x7E4F = 0xE37C
-0x7E50 = 0xE37D
-0x7E51 = 0xE37E
-0x7E52 = 0xE37F
-0x7E53 = 0xE380
-0x7E54 = 0xE381
-0x7E55 = 0xE382
-0x7E56 = 0xE383
-0x7E57 = 0xE384
-0x7E58 = 0xE385
-0x7E59 = 0xE386
-0x7E5A = 0xE387
-0x7E5B = 0xE388
-0x7E5C = 0xE389
-0x7E5D = 0xE38A
-0x7E5E = 0xE38B
-0x7E5F = 0xE38C
-0x7E60 = 0xE38D
-0x7E61 = 0xE38E
-0x7E62 = 0xE38F
-0x7E63 = 0xE390
-0x7E64 = 0xE391
-0x7E65 = 0xE392
-0x7E66 = 0xE393
-0x7E67 = 0xE394
-0x7E68 = 0xE395
-0x7E69 = 0xE396
-0x7E6A = 0xE397
-0x7E6B = 0xE398
-0x7E6C = 0xE399
-0x7E6D = 0xE39A
-0x7E6E = 0xE39B
-0x7E6F = 0xE39C
-0x7E70 = 0xE39D
-0x7E71 = 0xE39E
-0x7E72 = 0xE39F
-0x7E73 = 0xE3A0
-0x7E74 = 0xE3A1
-0x7E75 = 0xE3A2
-0x7E76 = 0xE3A3
-0x7E77 = 0xE3A4
-0x7E78 = 0xE3A5
-0x7E79 = 0xE3A6
-0x7E7A = 0xE3A7
-0x7E7B = 0xE3A8
-0x7E7C = 0xE3A9
-0x7E7D = 0xE3AA
-0x7E7E = 0xE3AB
-END_MAP
diff --git a/enc/trans/JIS/JISX0208VDC@NEC%UCS.src b/enc/trans/JIS/JISX0208VDC@NEC%UCS.src
deleted file mode 100644
index bf7ea7b67a..0000000000
--- a/enc/trans/JIS/JISX0208VDC@NEC%UCS.src
+++ /dev/null
@@ -1,97 +0,0 @@
-# $NetBSD: JISX0208VDC@NEC%UCS.src,v 1.1 2003/07/19 20:20:41 tshiozak Exp $
-
-TYPE ROWCOL
-NAME "JISX0208VDC:NEC/UCS"
-SRC_ZONE 0x2D21 - 0x2D7C
-OOB_MODE INVALID
-DST_INVALID 0xFFFE
-DST_UNIT_BITS 16
-
-BEGIN_MAP
-#
-# This data is derived from http://www.opengroup.or.jp/jvc/cde/
-#
-0x2D21 = 0x2460
-0x2D22 = 0x2461
-0x2D23 = 0x2462
-0x2D24 = 0x2463
-0x2D25 = 0x2464
-0x2D26 = 0x2465
-0x2D27 = 0x2466
-0x2D28 = 0x2467
-0x2D29 = 0x2468
-0x2D2A = 0x2469
-0x2D2B = 0x246A
-0x2D2C = 0x246B
-0x2D2D = 0x246C
-0x2D2E = 0x246D
-0x2D2F = 0x246E
-0x2D30 = 0x246F
-0x2D31 = 0x2470
-0x2D32 = 0x2471
-0x2D33 = 0x2472
-0x2D34 = 0x2473
-0x2D35 = 0x2160
-0x2D36 = 0x2161
-0x2D37 = 0x2162
-0x2D38 = 0x2163
-0x2D39 = 0x2164
-0x2D3A = 0x2165
-0x2D3B = 0x2166
-0x2D3C = 0x2167
-0x2D3D = 0x2168
-0x2D3E = 0x2169
-0x2D40 = 0x3349
-0x2D41 = 0x3314
-0x2D42 = 0x3322
-0x2D43 = 0x334D
-0x2D44 = 0x3318
-0x2D45 = 0x3327
-0x2D46 = 0x3303
-0x2D47 = 0x3336
-0x2D48 = 0x3351
-0x2D49 = 0x3357
-0x2D4A = 0x330D
-0x2D4B = 0x3326
-0x2D4C = 0x3323
-0x2D4D = 0x332B
-0x2D4E = 0x334A
-0x2D4F = 0x333B
-0x2D50 = 0x339C
-0x2D51 = 0x339D
-0x2D52 = 0x339E
-0x2D53 = 0x338E
-0x2D54 = 0x338F
-0x2D55 = 0x33C4
-0x2D56 = 0x33A1
-0x2D5F = 0x337B
-0x2D60 = 0x301D
-0x2D61 = 0x301F
-0x2D62 = 0x2116
-0x2D63 = 0x33CD
-0x2D64 = 0x2121
-0x2D65 = 0x32A4
-0x2D66 = 0x32A5
-0x2D67 = 0x32A6
-0x2D68 = 0x32A7
-0x2D69 = 0x32A8
-0x2D6A = 0x3231
-0x2D6B = 0x3232
-0x2D6C = 0x3239
-0x2D6D = 0x337E
-0x2D6E = 0x337D
-0x2D6F = 0x337C
-0x2D70 = 0x2252
-0x2D71 = 0x2261
-0x2D72 = 0x222B
-0x2D73 = 0x222E
-0x2D74 = 0x2211
-0x2D75 = 0x221A
-0x2D76 = 0x22A5
-0x2D77 = 0x2220
-0x2D78 = 0x221F
-0x2D79 = 0x22BF
-0x2D7A = 0x2235
-0x2D7B = 0x2229
-0x2D7C = 0x222A
-END_MAP
diff --git a/enc/trans/JIS/JISX0212%UCS.src b/enc/trans/JIS/JISX0212%UCS.src
deleted file mode 100644
index cf4e7ecf62..0000000000
--- a/enc/trans/JIS/JISX0212%UCS.src
+++ /dev/null
@@ -1,6167 +0,0 @@
-# $NetBSD: JISX0212%UCS.src,v 1.2 2003/07/12 16:11:10 tshiozak Exp $
-
-TYPE ROWCOL
-NAME JISX0212/UCS
-SRC_ZONE 0x21-0x7E / 0x21-0x7E / 8
-OOB_MODE ILSEQ
-DST_ILSEQ 0xFFFE
-DST_UNIT_BITS 16
-
-BEGIN_MAP
-#
-# This mapping data is made from the mapping data provided by Unicode, Inc.
-# Original notice:
-#
-# Name: JIS X 0212 (1990) to Unicode
-# Unicode version: 1.1
-# Table version: 0.9
-# Table format: Format A
-# Date: 8 March 1994
-#
-# Copyright (c) 1991-1994 Unicode, Inc. All Rights reserved.
-#
-# This file is provided as-is by Unicode, Inc. (The Unicode Consortium).
-# No claims are made as to fitness for any particular purpose. No
-# warranties of any kind are expressed or implied. The recipient
-# agrees to determine applicability of information provided. If this
-# file has been provided on magnetic media by Unicode, Inc., the sole
-# remedy for any claim will be exchange of defective media within 90
-# days of receipt.
-#
-# Recipient is granted the right to make copies in any form for
-# internal distribution and to freely use the information supplied
-# in the creation of products supporting Unicode. Unicode, Inc.
-# specifically excludes the right to re-distribute this file directly
-# to third parties or other organizations whether for profit or not.
-#
-# General notes:
-#
-#
-# This table contains one set of mappings from JIS X 0212 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 JIS X 0212 and Unicode, consult the
-# VENDORS mapping data. Normative information on the mapping between
-# JIS X 0212 and Unicode may be found in the Unihan.txt file in the
-# latest Unicode Character Database.
-#
-# If you have carefully considered the fact that the mappings in
-# this table are only one possible set of mappings between JIS X 0212 and
-# Unicode and have no normative status, but still feel that you
-# have located an error in the table that requires fixing, you may
-# report any such error to errata@unicode.org.
-#
-#
-# Format: Three tab-separated columns
-# Column #1 is the JIS X 0212 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 JIS X 0212 order
-#
-# The following algorithms can be used to change the hex form
-# of JIS 0212 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;
-# 0x6D63 -> 0x4D43 -> 7767
-#
-# The kanji mappings are a normative part of ISO/IEC 10646. The
-# non-kanji mappings are provisional, pending definition of
-# official mappings by Japanese standards bodies
-#
-# Any comments or problems, contact <John_Jenkins@taligent.com>
-#
-# Notes:
-#
-# 1. JIS X 0212 apparently unified the following two symbols
-# into a single character at 0x2922:
-#
-# LATIN CAPITAL LETTER D WITH STROKE
-# LATIN CAPITAL LETTER ETH
-#
-# However, JIS X 0212 maintains the distinction between
-# the lowercase forms of these two elements at 0x2942 and 0x2943.
-# 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.
-#
-0x222F = 0x02D8
-0x2230 = 0x02C7
-0x2231 = 0x00B8
-0x2232 = 0x02D9
-0x2233 = 0x02DD
-0x2234 = 0x00AF
-0x2235 = 0x02DB
-0x2236 = 0x02DA
-0x2237 = 0x007E
-0x2238 = 0x0384
-0x2239 = 0x0385
-0x2242 = 0x00A1
-0x2243 = 0x00A6
-0x2244 = 0x00BF
-0x226B = 0x00BA
-0x226C = 0x00AA
-0x226D = 0x00A9
-0x226E = 0x00AE
-0x226F = 0x2122
-0x2270 = 0x00A4
-0x2271 = 0x2116
-0x2661 = 0x0386
-0x2662 = 0x0388
-0x2663 = 0x0389
-0x2664 = 0x038A
-0x2665 = 0x03AA
-0x2667 = 0x038C
-0x2669 = 0x038E
-0x266A = 0x03AB
-0x266C = 0x038F
-0x2671 = 0x03AC
-0x2672 = 0x03AD
-0x2673 = 0x03AE
-0x2674 = 0x03AF
-0x2675 = 0x03CA
-0x2676 = 0x0390
-0x2677 = 0x03CC
-0x2678 = 0x03C2
-0x2679 = 0x03CD
-0x267A = 0x03CB
-0x267B = 0x03B0
-0x267C = 0x03CE
-0x2742 = 0x0402
-0x2743 = 0x0403
-0x2744 = 0x0404
-0x2745 = 0x0405
-0x2746 = 0x0406
-0x2747 = 0x0407
-0x2748 = 0x0408
-0x2749 = 0x0409
-0x274A = 0x040A
-0x274B = 0x040B
-0x274C = 0x040C
-0x274D = 0x040E
-0x274E = 0x040F
-0x2772 = 0x0452
-0x2773 = 0x0453
-0x2774 = 0x0454
-0x2775 = 0x0455
-0x2776 = 0x0456
-0x2777 = 0x0457
-0x2778 = 0x0458
-0x2779 = 0x0459
-0x277A = 0x045A
-0x277B = 0x045B
-0x277C = 0x045C
-0x277D = 0x045E
-0x277E = 0x045F
-0x2921 = 0x00C6
-0x2922 = 0x0110
-0x2924 = 0x0126
-0x2926 = 0x0132
-0x2928 = 0x0141
-0x2929 = 0x013F
-0x292B = 0x014A
-0x292C = 0x00D8
-0x292D = 0x0152
-0x292F = 0x0166
-0x2930 = 0x00DE
-0x2941 = 0x00E6
-0x2942 = 0x0111
-0x2943 = 0x00F0
-0x2944 = 0x0127
-0x2945 = 0x0131
-0x2946 = 0x0133
-0x2947 = 0x0138
-0x2948 = 0x0142
-0x2949 = 0x0140
-0x294A = 0x0149
-0x294B = 0x014B
-0x294C = 0x00F8
-0x294D = 0x0153
-0x294E = 0x00DF
-0x294F = 0x0167
-0x2950 = 0x00FE
-0x2A21 = 0x00C1
-0x2A22 = 0x00C0
-0x2A23 = 0x00C4
-0x2A24 = 0x00C2
-0x2A25 = 0x0102
-0x2A26 = 0x01CD
-0x2A27 = 0x0100
-0x2A28 = 0x0104
-0x2A29 = 0x00C5
-0x2A2A = 0x00C3
-0x2A2B = 0x0106
-0x2A2C = 0x0108
-0x2A2D = 0x010C
-0x2A2E = 0x00C7
-0x2A2F = 0x010A
-0x2A30 = 0x010E
-0x2A31 = 0x00C9
-0x2A32 = 0x00C8
-0x2A33 = 0x00CB
-0x2A34 = 0x00CA
-0x2A35 = 0x011A
-0x2A36 = 0x0116
-0x2A37 = 0x0112
-0x2A38 = 0x0118
-0x2A3A = 0x011C
-0x2A3B = 0x011E
-0x2A3C = 0x0122
-0x2A3D = 0x0120
-0x2A3E = 0x0124
-0x2A3F = 0x00CD
-0x2A40 = 0x00CC
-0x2A41 = 0x00CF
-0x2A42 = 0x00CE
-0x2A43 = 0x01CF
-0x2A44 = 0x0130
-0x2A45 = 0x012A
-0x2A46 = 0x012E
-0x2A47 = 0x0128
-0x2A48 = 0x0134
-0x2A49 = 0x0136
-0x2A4A = 0x0139
-0x2A4B = 0x013D
-0x2A4C = 0x013B
-0x2A4D = 0x0143
-0x2A4E = 0x0147
-0x2A4F = 0x0145
-0x2A50 = 0x00D1
-0x2A51 = 0x00D3
-0x2A52 = 0x00D2
-0x2A53 = 0x00D6
-0x2A54 = 0x00D4
-0x2A55 = 0x01D1
-0x2A56 = 0x0150
-0x2A57 = 0x014C
-0x2A58 = 0x00D5
-0x2A59 = 0x0154
-0x2A5A = 0x0158
-0x2A5B = 0x0156
-0x2A5C = 0x015A
-0x2A5D = 0x015C
-0x2A5E = 0x0160
-0x2A5F = 0x015E
-0x2A60 = 0x0164
-0x2A61 = 0x0162
-0x2A62 = 0x00DA
-0x2A63 = 0x00D9
-0x2A64 = 0x00DC
-0x2A65 = 0x00DB
-0x2A66 = 0x016C
-0x2A67 = 0x01D3
-0x2A68 = 0x0170
-0x2A69 = 0x016A
-0x2A6A = 0x0172
-0x2A6B = 0x016E
-0x2A6C = 0x0168
-0x2A6D = 0x01D7
-0x2A6E = 0x01DB
-0x2A6F = 0x01D9
-0x2A70 = 0x01D5
-0x2A71 = 0x0174
-0x2A72 = 0x00DD
-0x2A73 = 0x0178
-0x2A74 = 0x0176
-0x2A75 = 0x0179
-0x2A76 = 0x017D
-0x2A77 = 0x017B
-0x2B21 = 0x00E1
-0x2B22 = 0x00E0
-0x2B23 = 0x00E4
-0x2B24 = 0x00E2
-0x2B25 = 0x0103
-0x2B26 = 0x01CE
-0x2B27 = 0x0101
-0x2B28 = 0x0105
-0x2B29 = 0x00E5
-0x2B2A = 0x00E3
-0x2B2B = 0x0107
-0x2B2C = 0x0109
-0x2B2D = 0x010D
-0x2B2E = 0x00E7
-0x2B2F = 0x010B
-0x2B30 = 0x010F
-0x2B31 = 0x00E9
-0x2B32 = 0x00E8
-0x2B33 = 0x00EB
-0x2B34 = 0x00EA
-0x2B35 = 0x011B
-0x2B36 = 0x0117
-0x2B37 = 0x0113
-0x2B38 = 0x0119
-0x2B39 = 0x01F5
-0x2B3A = 0x011D
-0x2B3B = 0x011F
-0x2B3D = 0x0121
-0x2B3E = 0x0125
-0x2B3F = 0x00ED
-0x2B40 = 0x00EC
-0x2B41 = 0x00EF
-0x2B42 = 0x00EE
-0x2B43 = 0x01D0
-0x2B45 = 0x012B
-0x2B46 = 0x012F
-0x2B47 = 0x0129
-0x2B48 = 0x0135
-0x2B49 = 0x0137
-0x2B4A = 0x013A
-0x2B4B = 0x013E
-0x2B4C = 0x013C
-0x2B4D = 0x0144
-0x2B4E = 0x0148
-0x2B4F = 0x0146
-0x2B50 = 0x00F1
-0x2B51 = 0x00F3
-0x2B52 = 0x00F2
-0x2B53 = 0x00F6
-0x2B54 = 0x00F4
-0x2B55 = 0x01D2
-0x2B56 = 0x0151
-0x2B57 = 0x014D
-0x2B58 = 0x00F5
-0x2B59 = 0x0155
-0x2B5A = 0x0159
-0x2B5B = 0x0157
-0x2B5C = 0x015B
-0x2B5D = 0x015D
-0x2B5E = 0x0161
-0x2B5F = 0x015F
-0x2B60 = 0x0165
-0x2B61 = 0x0163
-0x2B62 = 0x00FA
-0x2B63 = 0x00F9
-0x2B64 = 0x00FC
-0x2B65 = 0x00FB
-0x2B66 = 0x016D
-0x2B67 = 0x01D4
-0x2B68 = 0x0171
-0x2B69 = 0x016B
-0x2B6A = 0x0173
-0x2B6B = 0x016F
-0x2B6C = 0x0169
-0x2B6D = 0x01D8
-0x2B6E = 0x01DC
-0x2B6F = 0x01DA
-0x2B70 = 0x01D6
-0x2B71 = 0x0175
-0x2B72 = 0x00FD
-0x2B73 = 0x00FF
-0x2B74 = 0x0177
-0x2B75 = 0x017A
-0x2B76 = 0x017E
-0x2B77 = 0x017C
-0x3021 = 0x4E02
-0x3022 = 0x4E04
-0x3023 = 0x4E05
-0x3024 = 0x4E0C
-0x3025 = 0x4E12
-0x3026 = 0x4E1F
-0x3027 = 0x4E23
-0x3028 = 0x4E24
-0x3029 = 0x4E28
-0x302A = 0x4E2B
-0x302B = 0x4E2E
-0x302C = 0x4E2F
-0x302D = 0x4E30
-0x302E = 0x4E35
-0x302F = 0x4E40
-0x3030 = 0x4E41
-0x3031 = 0x4E44
-0x3032 = 0x4E47
-0x3033 = 0x4E51
-0x3034 = 0x4E5A
-0x3035 = 0x4E5C
-0x3036 = 0x4E63
-0x3037 = 0x4E68
-0x3038 = 0x4E69
-0x3039 = 0x4E74
-0x303A = 0x4E75
-0x303B = 0x4E79
-0x303C = 0x4E7F
-0x303D = 0x4E8D
-0x303E = 0x4E96
-0x303F = 0x4E97
-0x3040 = 0x4E9D
-0x3041 = 0x4EAF
-0x3042 = 0x4EB9
-0x3043 = 0x4EC3
-0x3044 = 0x4ED0
-0x3045 = 0x4EDA
-0x3046 = 0x4EDB
-0x3047 = 0x4EE0
-0x3048 = 0x4EE1
-0x3049 = 0x4EE2
-0x304A = 0x4EE8
-0x304B = 0x4EEF
-0x304C = 0x4EF1
-0x304D = 0x4EF3
-0x304E = 0x4EF5
-0x304F = 0x4EFD
-0x3050 = 0x4EFE
-0x3051 = 0x4EFF
-0x3052 = 0x4F00
-0x3053 = 0x4F02
-0x3054 = 0x4F03
-0x3055 = 0x4F08
-0x3056 = 0x4F0B
-0x3057 = 0x4F0C
-0x3058 = 0x4F12
-0x3059 = 0x4F15
-0x305A = 0x4F16
-0x305B = 0x4F17
-0x305C = 0x4F19
-0x305D = 0x4F2E
-0x305E = 0x4F31
-0x305F = 0x4F60
-0x3060 = 0x4F33
-0x3061 = 0x4F35
-0x3062 = 0x4F37
-0x3063 = 0x4F39
-0x3064 = 0x4F3B
-0x3065 = 0x4F3E
-0x3066 = 0x4F40
-0x3067 = 0x4F42
-0x3068 = 0x4F48
-0x3069 = 0x4F49
-0x306A = 0x4F4B
-0x306B = 0x4F4C
-0x306C = 0x4F52
-0x306D = 0x4F54
-0x306E = 0x4F56
-0x306F = 0x4F58
-0x3070 = 0x4F5F
-0x3071 = 0x4F63
-0x3072 = 0x4F6A
-0x3073 = 0x4F6C
-0x3074 = 0x4F6E
-0x3075 = 0x4F71
-0x3076 = 0x4F77
-0x3077 = 0x4F78
-0x3078 = 0x4F79
-0x3079 = 0x4F7A
-0x307A = 0x4F7D
-0x307B = 0x4F7E
-0x307C = 0x4F81
-0x307D = 0x4F82
-0x307E = 0x4F84
-0x3121 = 0x4F85
-0x3122 = 0x4F89
-0x3123 = 0x4F8A
-0x3124 = 0x4F8C
-0x3125 = 0x4F8E
-0x3126 = 0x4F90
-0x3127 = 0x4F92
-0x3128 = 0x4F93
-0x3129 = 0x4F94
-0x312A = 0x4F97
-0x312B = 0x4F99
-0x312C = 0x4F9A
-0x312D = 0x4F9E
-0x312E = 0x4F9F
-0x312F = 0x4FB2
-0x3130 = 0x4FB7
-0x3131 = 0x4FB9
-0x3132 = 0x4FBB
-0x3133 = 0x4FBC
-0x3134 = 0x4FBD
-0x3135 = 0x4FBE
-0x3136 = 0x4FC0
-0x3137 = 0x4FC1
-0x3138 = 0x4FC5
-0x3139 = 0x4FC6
-0x313A = 0x4FC8
-0x313B = 0x4FC9
-0x313C = 0x4FCB
-0x313D = 0x4FCC
-0x313E = 0x4FCD
-0x313F = 0x4FCF
-0x3140 = 0x4FD2
-0x3141 = 0x4FDC
-0x3142 = 0x4FE0
-0x3143 = 0x4FE2
-0x3144 = 0x4FF0
-0x3145 = 0x4FF2
-0x3146 = 0x4FFC
-0x3147 = 0x4FFD
-0x3148 = 0x4FFF
-0x3149 = 0x5000
-0x314A = 0x5001
-0x314B = 0x5004
-0x314C = 0x5007
-0x314D = 0x500A
-0x314E = 0x500C
-0x314F = 0x500E
-0x3150 = 0x5010
-0x3151 = 0x5013
-0x3152 = 0x5017
-0x3153 = 0x5018
-0x3154 = 0x501B
-0x3155 = 0x501C
-0x3156 = 0x501D
-0x3157 = 0x501E
-0x3158 = 0x5022
-0x3159 = 0x5027
-0x315A = 0x502E
-0x315B = 0x5030
-0x315C = 0x5032
-0x315D = 0x5033
-0x315E = 0x5035
-0x315F = 0x5040
-0x3160 = 0x5041
-0x3161 = 0x5042
-0x3162 = 0x5045
-0x3163 = 0x5046
-0x3164 = 0x504A
-0x3165 = 0x504C
-0x3166 = 0x504E
-0x3167 = 0x5051
-0x3168 = 0x5052
-0x3169 = 0x5053
-0x316A = 0x5057
-0x316B = 0x5059
-0x316C = 0x505F
-0x316D = 0x5060
-0x316E = 0x5062
-0x316F = 0x5063
-0x3170 = 0x5066
-0x3171 = 0x5067
-0x3172 = 0x506A
-0x3173 = 0x506D
-0x3174 = 0x5070
-0x3175 = 0x5071
-0x3176 = 0x503B
-0x3177 = 0x5081
-0x3178 = 0x5083
-0x3179 = 0x5084
-0x317A = 0x5086
-0x317B = 0x508A
-0x317C = 0x508E
-0x317D = 0x508F
-0x317E = 0x5090
-0x3221 = 0x5092
-0x3222 = 0x5093
-0x3223 = 0x5094
-0x3224 = 0x5096
-0x3225 = 0x509B
-0x3226 = 0x509C
-0x3227 = 0x509E
-0x3228 = 0x509F
-0x3229 = 0x50A0
-0x322A = 0x50A1
-0x322B = 0x50A2
-0x322C = 0x50AA
-0x322D = 0x50AF
-0x322E = 0x50B0
-0x322F = 0x50B9
-0x3230 = 0x50BA
-0x3231 = 0x50BD
-0x3232 = 0x50C0
-0x3233 = 0x50C3
-0x3234 = 0x50C4
-0x3235 = 0x50C7
-0x3236 = 0x50CC
-0x3237 = 0x50CE
-0x3238 = 0x50D0
-0x3239 = 0x50D3
-0x323A = 0x50D4
-0x323B = 0x50D8
-0x323C = 0x50DC
-0x323D = 0x50DD
-0x323E = 0x50DF
-0x323F = 0x50E2
-0x3240 = 0x50E4
-0x3241 = 0x50E6
-0x3242 = 0x50E8
-0x3243 = 0x50E9
-0x3244 = 0x50EF
-0x3245 = 0x50F1
-0x3246 = 0x50F6
-0x3247 = 0x50FA
-0x3248 = 0x50FE
-0x3249 = 0x5103
-0x324A = 0x5106
-0x324B = 0x5107
-0x324C = 0x5108
-0x324D = 0x510B
-0x324E = 0x510C
-0x324F = 0x510D
-0x3250 = 0x510E
-0x3251 = 0x50F2
-0x3252 = 0x5110
-0x3253 = 0x5117
-0x3254 = 0x5119
-0x3255 = 0x511B
-0x3256 = 0x511C
-0x3257 = 0x511D
-0x3258 = 0x511E
-0x3259 = 0x5123
-0x325A = 0x5127
-0x325B = 0x5128
-0x325C = 0x512C
-0x325D = 0x512D
-0x325E = 0x512F
-0x325F = 0x5131
-0x3260 = 0x5133
-0x3261 = 0x5134
-0x3262 = 0x5135
-0x3263 = 0x5138
-0x3264 = 0x5139
-0x3265 = 0x5142
-0x3266 = 0x514A
-0x3267 = 0x514F
-0x3268 = 0x5153
-0x3269 = 0x5155
-0x326A = 0x5157
-0x326B = 0x5158
-0x326C = 0x515F
-0x326D = 0x5164
-0x326E = 0x5166
-0x326F = 0x517E
-0x3270 = 0x5183
-0x3271 = 0x5184
-0x3272 = 0x518B
-0x3273 = 0x518E
-0x3274 = 0x5198
-0x3275 = 0x519D
-0x3276 = 0x51A1
-0x3277 = 0x51A3
-0x3278 = 0x51AD
-0x3279 = 0x51B8
-0x327A = 0x51BA
-0x327B = 0x51BC
-0x327C = 0x51BE
-0x327D = 0x51BF
-0x327E = 0x51C2
-0x3321 = 0x51C8
-0x3322 = 0x51CF
-0x3323 = 0x51D1
-0x3324 = 0x51D2
-0x3325 = 0x51D3
-0x3326 = 0x51D5
-0x3327 = 0x51D8
-0x3328 = 0x51DE
-0x3329 = 0x51E2
-0x332A = 0x51E5
-0x332B = 0x51EE
-0x332C = 0x51F2
-0x332D = 0x51F3
-0x332E = 0x51F4
-0x332F = 0x51F7
-0x3330 = 0x5201
-0x3331 = 0x5202
-0x3332 = 0x5205
-0x3333 = 0x5212
-0x3334 = 0x5213
-0x3335 = 0x5215
-0x3336 = 0x5216
-0x3337 = 0x5218
-0x3338 = 0x5222
-0x3339 = 0x5228
-0x333A = 0x5231
-0x333B = 0x5232
-0x333C = 0x5235
-0x333D = 0x523C
-0x333E = 0x5245
-0x333F = 0x5249
-0x3340 = 0x5255
-0x3341 = 0x5257
-0x3342 = 0x5258
-0x3343 = 0x525A
-0x3344 = 0x525C
-0x3345 = 0x525F
-0x3346 = 0x5260
-0x3347 = 0x5261
-0x3348 = 0x5266
-0x3349 = 0x526E
-0x334A = 0x5277
-0x334B = 0x5278
-0x334C = 0x5279
-0x334D = 0x5280
-0x334E = 0x5282
-0x334F = 0x5285
-0x3350 = 0x528A
-0x3351 = 0x528C
-0x3352 = 0x5293
-0x3353 = 0x5295
-0x3354 = 0x5296
-0x3355 = 0x5297
-0x3356 = 0x5298
-0x3357 = 0x529A
-0x3358 = 0x529C
-0x3359 = 0x52A4
-0x335A = 0x52A5
-0x335B = 0x52A6
-0x335C = 0x52A7
-0x335D = 0x52AF
-0x335E = 0x52B0
-0x335F = 0x52B6
-0x3360 = 0x52B7
-0x3361 = 0x52B8
-0x3362 = 0x52BA
-0x3363 = 0x52BB
-0x3364 = 0x52BD
-0x3365 = 0x52C0
-0x3366 = 0x52C4
-0x3367 = 0x52C6
-0x3368 = 0x52C8
-0x3369 = 0x52CC
-0x336A = 0x52CF
-0x336B = 0x52D1
-0x336C = 0x52D4
-0x336D = 0x52D6
-0x336E = 0x52DB
-0x336F = 0x52DC
-0x3370 = 0x52E1
-0x3371 = 0x52E5
-0x3372 = 0x52E8
-0x3373 = 0x52E9
-0x3374 = 0x52EA
-0x3375 = 0x52EC
-0x3376 = 0x52F0
-0x3377 = 0x52F1
-0x3378 = 0x52F4
-0x3379 = 0x52F6
-0x337A = 0x52F7
-0x337B = 0x5300
-0x337C = 0x5303
-0x337D = 0x530A
-0x337E = 0x530B
-0x3421 = 0x530C
-0x3422 = 0x5311
-0x3423 = 0x5313
-0x3424 = 0x5318
-0x3425 = 0x531B
-0x3426 = 0x531C
-0x3427 = 0x531E
-0x3428 = 0x531F
-0x3429 = 0x5325
-0x342A = 0x5327
-0x342B = 0x5328
-0x342C = 0x5329
-0x342D = 0x532B
-0x342E = 0x532C
-0x342F = 0x532D
-0x3430 = 0x5330
-0x3431 = 0x5332
-0x3432 = 0x5335
-0x3433 = 0x533C
-0x3434 = 0x533D
-0x3435 = 0x533E
-0x3436 = 0x5342
-0x3437 = 0x534C
-0x3438 = 0x534B
-0x3439 = 0x5359
-0x343A = 0x535B
-0x343B = 0x5361
-0x343C = 0x5363
-0x343D = 0x5365
-0x343E = 0x536C
-0x343F = 0x536D
-0x3440 = 0x5372
-0x3441 = 0x5379
-0x3442 = 0x537E
-0x3443 = 0x5383
-0x3444 = 0x5387
-0x3445 = 0x5388
-0x3446 = 0x538E
-0x3447 = 0x5393
-0x3448 = 0x5394
-0x3449 = 0x5399
-0x344A = 0x539D
-0x344B = 0x53A1
-0x344C = 0x53A4
-0x344D = 0x53AA
-0x344E = 0x53AB
-0x344F = 0x53AF
-0x3450 = 0x53B2
-0x3451 = 0x53B4
-0x3452 = 0x53B5
-0x3453 = 0x53B7
-0x3454 = 0x53B8
-0x3455 = 0x53BA
-0x3456 = 0x53BD
-0x3457 = 0x53C0
-0x3458 = 0x53C5
-0x3459 = 0x53CF
-0x345A = 0x53D2
-0x345B = 0x53D3
-0x345C = 0x53D5
-0x345D = 0x53DA
-0x345E = 0x53DD
-0x345F = 0x53DE
-0x3460 = 0x53E0
-0x3461 = 0x53E6
-0x3462 = 0x53E7
-0x3463 = 0x53F5
-0x3464 = 0x5402
-0x3465 = 0x5413
-0x3466 = 0x541A
-0x3467 = 0x5421
-0x3468 = 0x5427
-0x3469 = 0x5428
-0x346A = 0x542A
-0x346B = 0x542F
-0x346C = 0x5431
-0x346D = 0x5434
-0x346E = 0x5435
-0x346F = 0x5443
-0x3470 = 0x5444
-0x3471 = 0x5447
-0x3472 = 0x544D
-0x3473 = 0x544F
-0x3474 = 0x545E
-0x3475 = 0x5462
-0x3476 = 0x5464
-0x3477 = 0x5466
-0x3478 = 0x5467
-0x3479 = 0x5469
-0x347A = 0x546B
-0x347B = 0x546D
-0x347C = 0x546E
-0x347D = 0x5474
-0x347E = 0x547F
-0x3521 = 0x5481
-0x3522 = 0x5483
-0x3523 = 0x5485
-0x3524 = 0x5488
-0x3525 = 0x5489
-0x3526 = 0x548D
-0x3527 = 0x5491
-0x3528 = 0x5495
-0x3529 = 0x5496
-0x352A = 0x549C
-0x352B = 0x549F
-0x352C = 0x54A1
-0x352D = 0x54A6
-0x352E = 0x54A7
-0x352F = 0x54A9
-0x3530 = 0x54AA
-0x3531 = 0x54AD
-0x3532 = 0x54AE
-0x3533 = 0x54B1
-0x3534 = 0x54B7
-0x3535 = 0x54B9
-0x3536 = 0x54BA
-0x3537 = 0x54BB
-0x3538 = 0x54BF
-0x3539 = 0x54C6
-0x353A = 0x54CA
-0x353B = 0x54CD
-0x353C = 0x54CE
-0x353D = 0x54E0
-0x353E = 0x54EA
-0x353F = 0x54EC
-0x3540 = 0x54EF
-0x3541 = 0x54F6
-0x3542 = 0x54FC
-0x3543 = 0x54FE
-0x3544 = 0x54FF
-0x3545 = 0x5500
-0x3546 = 0x5501
-0x3547 = 0x5505
-0x3548 = 0x5508
-0x3549 = 0x5509
-0x354A = 0x550C
-0x354B = 0x550D
-0x354C = 0x550E
-0x354D = 0x5515
-0x354E = 0x552A
-0x354F = 0x552B
-0x3550 = 0x5532
-0x3551 = 0x5535
-0x3552 = 0x5536
-0x3553 = 0x553B
-0x3554 = 0x553C
-0x3555 = 0x553D
-0x3556 = 0x5541
-0x3557 = 0x5547
-0x3558 = 0x5549
-0x3559 = 0x554A
-0x355A = 0x554D
-0x355B = 0x5550
-0x355C = 0x5551
-0x355D = 0x5558
-0x355E = 0x555A
-0x355F = 0x555B
-0x3560 = 0x555E
-0x3561 = 0x5560
-0x3562 = 0x5561
-0x3563 = 0x5564
-0x3564 = 0x5566
-0x3565 = 0x557F
-0x3566 = 0x5581
-0x3567 = 0x5582
-0x3568 = 0x5586
-0x3569 = 0x5588
-0x356A = 0x558E
-0x356B = 0x558F
-0x356C = 0x5591
-0x356D = 0x5592
-0x356E = 0x5593
-0x356F = 0x5594
-0x3570 = 0x5597
-0x3571 = 0x55A3
-0x3572 = 0x55A4
-0x3573 = 0x55AD
-0x3574 = 0x55B2
-0x3575 = 0x55BF
-0x3576 = 0x55C1
-0x3577 = 0x55C3
-0x3578 = 0x55C6
-0x3579 = 0x55C9
-0x357A = 0x55CB
-0x357B = 0x55CC
-0x357C = 0x55CE
-0x357D = 0x55D1
-0x357E = 0x55D2
-0x3621 = 0x55D3
-0x3622 = 0x55D7
-0x3623 = 0x55D8
-0x3624 = 0x55DB
-0x3625 = 0x55DE
-0x3626 = 0x55E2
-0x3627 = 0x55E9
-0x3628 = 0x55F6
-0x3629 = 0x55FF
-0x362A = 0x5605
-0x362B = 0x5608
-0x362C = 0x560A
-0x362D = 0x560D
-0x362E = 0x560E
-0x362F = 0x560F
-0x3630 = 0x5610
-0x3631 = 0x5611
-0x3632 = 0x5612
-0x3633 = 0x5619
-0x3634 = 0x562C
-0x3635 = 0x5630
-0x3636 = 0x5633
-0x3637 = 0x5635
-0x3638 = 0x5637
-0x3639 = 0x5639
-0x363A = 0x563B
-0x363B = 0x563C
-0x363C = 0x563D
-0x363D = 0x563F
-0x363E = 0x5640
-0x363F = 0x5641
-0x3640 = 0x5643
-0x3641 = 0x5644
-0x3642 = 0x5646
-0x3643 = 0x5649
-0x3644 = 0x564B
-0x3645 = 0x564D
-0x3646 = 0x564F
-0x3647 = 0x5654
-0x3648 = 0x565E
-0x3649 = 0x5660
-0x364A = 0x5661
-0x364B = 0x5662
-0x364C = 0x5663
-0x364D = 0x5666
-0x364E = 0x5669
-0x364F = 0x566D
-0x3650 = 0x566F
-0x3651 = 0x5671
-0x3652 = 0x5672
-0x3653 = 0x5675
-0x3654 = 0x5684
-0x3655 = 0x5685
-0x3656 = 0x5688
-0x3657 = 0x568B
-0x3658 = 0x568C
-0x3659 = 0x5695
-0x365A = 0x5699
-0x365B = 0x569A
-0x365C = 0x569D
-0x365D = 0x569E
-0x365E = 0x569F
-0x365F = 0x56A6
-0x3660 = 0x56A7
-0x3661 = 0x56A8
-0x3662 = 0x56A9
-0x3663 = 0x56AB
-0x3664 = 0x56AC
-0x3665 = 0x56AD
-0x3666 = 0x56B1
-0x3667 = 0x56B3
-0x3668 = 0x56B7
-0x3669 = 0x56BE
-0x366A = 0x56C5
-0x366B = 0x56C9
-0x366C = 0x56CA
-0x366D = 0x56CB
-0x366E = 0x56CF
-0x366F = 0x56D0
-0x3670 = 0x56CC
-0x3671 = 0x56CD
-0x3672 = 0x56D9
-0x3673 = 0x56DC
-0x3674 = 0x56DD
-0x3675 = 0x56DF
-0x3676 = 0x56E1
-0x3677 = 0x56E4
-0x3678 = 0x56E5
-0x3679 = 0x56E6
-0x367A = 0x56E7
-0x367B = 0x56E8
-0x367C = 0x56F1
-0x367D = 0x56EB
-0x367E = 0x56ED
-0x3721 = 0x56F6
-0x3722 = 0x56F7
-0x3723 = 0x5701
-0x3724 = 0x5702
-0x3725 = 0x5707
-0x3726 = 0x570A
-0x3727 = 0x570C
-0x3728 = 0x5711
-0x3729 = 0x5715
-0x372A = 0x571A
-0x372B = 0x571B
-0x372C = 0x571D
-0x372D = 0x5720
-0x372E = 0x5722
-0x372F = 0x5723
-0x3730 = 0x5724
-0x3731 = 0x5725
-0x3732 = 0x5729
-0x3733 = 0x572A
-0x3734 = 0x572C
-0x3735 = 0x572E
-0x3736 = 0x572F
-0x3737 = 0x5733
-0x3738 = 0x5734
-0x3739 = 0x573D
-0x373A = 0x573E
-0x373B = 0x573F
-0x373C = 0x5745
-0x373D = 0x5746
-0x373E = 0x574C
-0x373F = 0x574D
-0x3740 = 0x5752
-0x3741 = 0x5762
-0x3742 = 0x5765
-0x3743 = 0x5767
-0x3744 = 0x5768
-0x3745 = 0x576B
-0x3746 = 0x576D
-0x3747 = 0x576E
-0x3748 = 0x576F
-0x3749 = 0x5770
-0x374A = 0x5771
-0x374B = 0x5773
-0x374C = 0x5774
-0x374D = 0x5775
-0x374E = 0x5777
-0x374F = 0x5779
-0x3750 = 0x577A
-0x3751 = 0x577B
-0x3752 = 0x577C
-0x3753 = 0x577E
-0x3754 = 0x5781
-0x3755 = 0x5783
-0x3756 = 0x578C
-0x3757 = 0x5794
-0x3758 = 0x5797
-0x3759 = 0x5799
-0x375A = 0x579A
-0x375B = 0x579C
-0x375C = 0x579D
-0x375D = 0x579E
-0x375E = 0x579F
-0x375F = 0x57A1
-0x3760 = 0x5795
-0x3761 = 0x57A7
-0x3762 = 0x57A8
-0x3763 = 0x57A9
-0x3764 = 0x57AC
-0x3765 = 0x57B8
-0x3766 = 0x57BD
-0x3767 = 0x57C7
-0x3768 = 0x57C8
-0x3769 = 0x57CC
-0x376A = 0x57CF
-0x376B = 0x57D5
-0x376C = 0x57DD
-0x376D = 0x57DE
-0x376E = 0x57E4
-0x376F = 0x57E6
-0x3770 = 0x57E7
-0x3771 = 0x57E9
-0x3772 = 0x57ED
-0x3773 = 0x57F0
-0x3774 = 0x57F5
-0x3775 = 0x57F6
-0x3776 = 0x57F8
-0x3777 = 0x57FD
-0x3778 = 0x57FE
-0x3779 = 0x57FF
-0x377A = 0x5803
-0x377B = 0x5804
-0x377C = 0x5808
-0x377D = 0x5809
-0x377E = 0x57E1
-0x3821 = 0x580C
-0x3822 = 0x580D
-0x3823 = 0x581B
-0x3824 = 0x581E
-0x3825 = 0x581F
-0x3826 = 0x5820
-0x3827 = 0x5826
-0x3828 = 0x5827
-0x3829 = 0x582D
-0x382A = 0x5832
-0x382B = 0x5839
-0x382C = 0x583F
-0x382D = 0x5849
-0x382E = 0x584C
-0x382F = 0x584D
-0x3830 = 0x584F
-0x3831 = 0x5850
-0x3832 = 0x5855
-0x3833 = 0x585F
-0x3834 = 0x5861
-0x3835 = 0x5864
-0x3836 = 0x5867
-0x3837 = 0x5868
-0x3838 = 0x5878
-0x3839 = 0x587C
-0x383A = 0x587F
-0x383B = 0x5880
-0x383C = 0x5881
-0x383D = 0x5887
-0x383E = 0x5888
-0x383F = 0x5889
-0x3840 = 0x588A
-0x3841 = 0x588C
-0x3842 = 0x588D
-0x3843 = 0x588F
-0x3844 = 0x5890
-0x3845 = 0x5894
-0x3846 = 0x5896
-0x3847 = 0x589D
-0x3848 = 0x58A0
-0x3849 = 0x58A1
-0x384A = 0x58A2
-0x384B = 0x58A6
-0x384C = 0x58A9
-0x384D = 0x58B1
-0x384E = 0x58B2
-0x384F = 0x58C4
-0x3850 = 0x58BC
-0x3851 = 0x58C2
-0x3852 = 0x58C8
-0x3853 = 0x58CD
-0x3854 = 0x58CE
-0x3855 = 0x58D0
-0x3856 = 0x58D2
-0x3857 = 0x58D4
-0x3858 = 0x58D6
-0x3859 = 0x58DA
-0x385A = 0x58DD
-0x385B = 0x58E1
-0x385C = 0x58E2
-0x385D = 0x58E9
-0x385E = 0x58F3
-0x385F = 0x5905
-0x3860 = 0x5906
-0x3861 = 0x590B
-0x3862 = 0x590C
-0x3863 = 0x5912
-0x3864 = 0x5913
-0x3865 = 0x5914
-0x3866 = 0x8641
-0x3867 = 0x591D
-0x3868 = 0x5921
-0x3869 = 0x5923
-0x386A = 0x5924
-0x386B = 0x5928
-0x386C = 0x592F
-0x386D = 0x5930
-0x386E = 0x5933
-0x386F = 0x5935
-0x3870 = 0x5936
-0x3871 = 0x593F
-0x3872 = 0x5943
-0x3873 = 0x5946
-0x3874 = 0x5952
-0x3875 = 0x5953
-0x3876 = 0x5959
-0x3877 = 0x595B
-0x3878 = 0x595D
-0x3879 = 0x595E
-0x387A = 0x595F
-0x387B = 0x5961
-0x387C = 0x5963
-0x387D = 0x596B
-0x387E = 0x596D
-0x3921 = 0x596F
-0x3922 = 0x5972
-0x3923 = 0x5975
-0x3924 = 0x5976
-0x3925 = 0x5979
-0x3926 = 0x597B
-0x3927 = 0x597C
-0x3928 = 0x598B
-0x3929 = 0x598C
-0x392A = 0x598E
-0x392B = 0x5992
-0x392C = 0x5995
-0x392D = 0x5997
-0x392E = 0x599F
-0x392F = 0x59A4
-0x3930 = 0x59A7
-0x3931 = 0x59AD
-0x3932 = 0x59AE
-0x3933 = 0x59AF
-0x3934 = 0x59B0
-0x3935 = 0x59B3
-0x3936 = 0x59B7
-0x3937 = 0x59BA
-0x3938 = 0x59BC
-0x3939 = 0x59C1
-0x393A = 0x59C3
-0x393B = 0x59C4
-0x393C = 0x59C8
-0x393D = 0x59CA
-0x393E = 0x59CD
-0x393F = 0x59D2
-0x3940 = 0x59DD
-0x3941 = 0x59DE
-0x3942 = 0x59DF
-0x3943 = 0x59E3
-0x3944 = 0x59E4
-0x3945 = 0x59E7
-0x3946 = 0x59EE
-0x3947 = 0x59EF
-0x3948 = 0x59F1
-0x3949 = 0x59F2
-0x394A = 0x59F4
-0x394B = 0x59F7
-0x394C = 0x5A00
-0x394D = 0x5A04
-0x394E = 0x5A0C
-0x394F = 0x5A0D
-0x3950 = 0x5A0E
-0x3951 = 0x5A12
-0x3952 = 0x5A13
-0x3953 = 0x5A1E
-0x3954 = 0x5A23
-0x3955 = 0x5A24
-0x3956 = 0x5A27
-0x3957 = 0x5A28
-0x3958 = 0x5A2A
-0x3959 = 0x5A2D
-0x395A = 0x5A30
-0x395B = 0x5A44
-0x395C = 0x5A45
-0x395D = 0x5A47
-0x395E = 0x5A48
-0x395F = 0x5A4C
-0x3960 = 0x5A50
-0x3961 = 0x5A55
-0x3962 = 0x5A5E
-0x3963 = 0x5A63
-0x3964 = 0x5A65
-0x3965 = 0x5A67
-0x3966 = 0x5A6D
-0x3967 = 0x5A77
-0x3968 = 0x5A7A
-0x3969 = 0x5A7B
-0x396A = 0x5A7E
-0x396B = 0x5A8B
-0x396C = 0x5A90
-0x396D = 0x5A93
-0x396E = 0x5A96
-0x396F = 0x5A99
-0x3970 = 0x5A9C
-0x3971 = 0x5A9E
-0x3972 = 0x5A9F
-0x3973 = 0x5AA0
-0x3974 = 0x5AA2
-0x3975 = 0x5AA7
-0x3976 = 0x5AAC
-0x3977 = 0x5AB1
-0x3978 = 0x5AB2
-0x3979 = 0x5AB3
-0x397A = 0x5AB5
-0x397B = 0x5AB8
-0x397C = 0x5ABA
-0x397D = 0x5ABB
-0x397E = 0x5ABF
-0x3A21 = 0x5AC4
-0x3A22 = 0x5AC6
-0x3A23 = 0x5AC8
-0x3A24 = 0x5ACF
-0x3A25 = 0x5ADA
-0x3A26 = 0x5ADC
-0x3A27 = 0x5AE0
-0x3A28 = 0x5AE5
-0x3A29 = 0x5AEA
-0x3A2A = 0x5AEE
-0x3A2B = 0x5AF5
-0x3A2C = 0x5AF6
-0x3A2D = 0x5AFD
-0x3A2E = 0x5B00
-0x3A2F = 0x5B01
-0x3A30 = 0x5B08
-0x3A31 = 0x5B17
-0x3A32 = 0x5B34
-0x3A33 = 0x5B19
-0x3A34 = 0x5B1B
-0x3A35 = 0x5B1D
-0x3A36 = 0x5B21
-0x3A37 = 0x5B25
-0x3A38 = 0x5B2D
-0x3A39 = 0x5B38
-0x3A3A = 0x5B41
-0x3A3B = 0x5B4B
-0x3A3C = 0x5B4C
-0x3A3D = 0x5B52
-0x3A3E = 0x5B56
-0x3A3F = 0x5B5E
-0x3A40 = 0x5B68
-0x3A41 = 0x5B6E
-0x3A42 = 0x5B6F
-0x3A43 = 0x5B7C
-0x3A44 = 0x5B7D
-0x3A45 = 0x5B7E
-0x3A46 = 0x5B7F
-0x3A47 = 0x5B81
-0x3A48 = 0x5B84
-0x3A49 = 0x5B86
-0x3A4A = 0x5B8A
-0x3A4B = 0x5B8E
-0x3A4C = 0x5B90
-0x3A4D = 0x5B91
-0x3A4E = 0x5B93
-0x3A4F = 0x5B94
-0x3A50 = 0x5B96
-0x3A51 = 0x5BA8
-0x3A52 = 0x5BA9
-0x3A53 = 0x5BAC
-0x3A54 = 0x5BAD
-0x3A55 = 0x5BAF
-0x3A56 = 0x5BB1
-0x3A57 = 0x5BB2
-0x3A58 = 0x5BB7
-0x3A59 = 0x5BBA
-0x3A5A = 0x5BBC
-0x3A5B = 0x5BC0
-0x3A5C = 0x5BC1
-0x3A5D = 0x5BCD
-0x3A5E = 0x5BCF
-0x3A5F = 0x5BD6
-0x3A60 = 0x5BD7
-0x3A61 = 0x5BD8
-0x3A62 = 0x5BD9
-0x3A63 = 0x5BDA
-0x3A64 = 0x5BE0
-0x3A65 = 0x5BEF
-0x3A66 = 0x5BF1
-0x3A67 = 0x5BF4
-0x3A68 = 0x5BFD
-0x3A69 = 0x5C0C
-0x3A6A = 0x5C17
-0x3A6B = 0x5C1E
-0x3A6C = 0x5C1F
-0x3A6D = 0x5C23
-0x3A6E = 0x5C26
-0x3A6F = 0x5C29
-0x3A70 = 0x5C2B
-0x3A71 = 0x5C2C
-0x3A72 = 0x5C2E
-0x3A73 = 0x5C30
-0x3A74 = 0x5C32
-0x3A75 = 0x5C35
-0x3A76 = 0x5C36
-0x3A77 = 0x5C59
-0x3A78 = 0x5C5A
-0x3A79 = 0x5C5C
-0x3A7A = 0x5C62
-0x3A7B = 0x5C63
-0x3A7C = 0x5C67
-0x3A7D = 0x5C68
-0x3A7E = 0x5C69
-0x3B21 = 0x5C6D
-0x3B22 = 0x5C70
-0x3B23 = 0x5C74
-0x3B24 = 0x5C75
-0x3B25 = 0x5C7A
-0x3B26 = 0x5C7B
-0x3B27 = 0x5C7C
-0x3B28 = 0x5C7D
-0x3B29 = 0x5C87
-0x3B2A = 0x5C88
-0x3B2B = 0x5C8A
-0x3B2C = 0x5C8F
-0x3B2D = 0x5C92
-0x3B2E = 0x5C9D
-0x3B2F = 0x5C9F
-0x3B30 = 0x5CA0
-0x3B31 = 0x5CA2
-0x3B32 = 0x5CA3
-0x3B33 = 0x5CA6
-0x3B34 = 0x5CAA
-0x3B35 = 0x5CB2
-0x3B36 = 0x5CB4
-0x3B37 = 0x5CB5
-0x3B38 = 0x5CBA
-0x3B39 = 0x5CC9
-0x3B3A = 0x5CCB
-0x3B3B = 0x5CD2
-0x3B3C = 0x5CDD
-0x3B3D = 0x5CD7
-0x3B3E = 0x5CEE
-0x3B3F = 0x5CF1
-0x3B40 = 0x5CF2
-0x3B41 = 0x5CF4
-0x3B42 = 0x5D01
-0x3B43 = 0x5D06
-0x3B44 = 0x5D0D
-0x3B45 = 0x5D12
-0x3B46 = 0x5D2B
-0x3B47 = 0x5D23
-0x3B48 = 0x5D24
-0x3B49 = 0x5D26
-0x3B4A = 0x5D27
-0x3B4B = 0x5D31
-0x3B4C = 0x5D34
-0x3B4D = 0x5D39
-0x3B4E = 0x5D3D
-0x3B4F = 0x5D3F
-0x3B50 = 0x5D42
-0x3B51 = 0x5D43
-0x3B52 = 0x5D46
-0x3B53 = 0x5D48
-0x3B54 = 0x5D55
-0x3B55 = 0x5D51
-0x3B56 = 0x5D59
-0x3B57 = 0x5D4A
-0x3B58 = 0x5D5F
-0x3B59 = 0x5D60
-0x3B5A = 0x5D61
-0x3B5B = 0x5D62
-0x3B5C = 0x5D64
-0x3B5D = 0x5D6A
-0x3B5E = 0x5D6D
-0x3B5F = 0x5D70
-0x3B60 = 0x5D79
-0x3B61 = 0x5D7A
-0x3B62 = 0x5D7E
-0x3B63 = 0x5D7F
-0x3B64 = 0x5D81
-0x3B65 = 0x5D83
-0x3B66 = 0x5D88
-0x3B67 = 0x5D8A
-0x3B68 = 0x5D92
-0x3B69 = 0x5D93
-0x3B6A = 0x5D94
-0x3B6B = 0x5D95
-0x3B6C = 0x5D99
-0x3B6D = 0x5D9B
-0x3B6E = 0x5D9F
-0x3B6F = 0x5DA0
-0x3B70 = 0x5DA7
-0x3B71 = 0x5DAB
-0x3B72 = 0x5DB0
-0x3B73 = 0x5DB4
-0x3B74 = 0x5DB8
-0x3B75 = 0x5DB9
-0x3B76 = 0x5DC3
-0x3B77 = 0x5DC7
-0x3B78 = 0x5DCB
-0x3B79 = 0x5DD0
-0x3B7A = 0x5DCE
-0x3B7B = 0x5DD8
-0x3B7C = 0x5DD9
-0x3B7D = 0x5DE0
-0x3B7E = 0x5DE4
-0x3C21 = 0x5DE9
-0x3C22 = 0x5DF8
-0x3C23 = 0x5DF9
-0x3C24 = 0x5E00
-0x3C25 = 0x5E07
-0x3C26 = 0x5E0D
-0x3C27 = 0x5E12
-0x3C28 = 0x5E14
-0x3C29 = 0x5E15
-0x3C2A = 0x5E18
-0x3C2B = 0x5E1F
-0x3C2C = 0x5E20
-0x3C2D = 0x5E2E
-0x3C2E = 0x5E28
-0x3C2F = 0x5E32
-0x3C30 = 0x5E35
-0x3C31 = 0x5E3E
-0x3C32 = 0x5E4B
-0x3C33 = 0x5E50
-0x3C34 = 0x5E49
-0x3C35 = 0x5E51
-0x3C36 = 0x5E56
-0x3C37 = 0x5E58
-0x3C38 = 0x5E5B
-0x3C39 = 0x5E5C
-0x3C3A = 0x5E5E
-0x3C3B = 0x5E68
-0x3C3C = 0x5E6A
-0x3C3D = 0x5E6B
-0x3C3E = 0x5E6C
-0x3C3F = 0x5E6D
-0x3C40 = 0x5E6E
-0x3C41 = 0x5E70
-0x3C42 = 0x5E80
-0x3C43 = 0x5E8B
-0x3C44 = 0x5E8E
-0x3C45 = 0x5EA2
-0x3C46 = 0x5EA4
-0x3C47 = 0x5EA5
-0x3C48 = 0x5EA8
-0x3C49 = 0x5EAA
-0x3C4A = 0x5EAC
-0x3C4B = 0x5EB1
-0x3C4C = 0x5EB3
-0x3C4D = 0x5EBD
-0x3C4E = 0x5EBE
-0x3C4F = 0x5EBF
-0x3C50 = 0x5EC6
-0x3C51 = 0x5ECC
-0x3C52 = 0x5ECB
-0x3C53 = 0x5ECE
-0x3C54 = 0x5ED1
-0x3C55 = 0x5ED2
-0x3C56 = 0x5ED4
-0x3C57 = 0x5ED5
-0x3C58 = 0x5EDC
-0x3C59 = 0x5EDE
-0x3C5A = 0x5EE5
-0x3C5B = 0x5EEB
-0x3C5C = 0x5F02
-0x3C5D = 0x5F06
-0x3C5E = 0x5F07
-0x3C5F = 0x5F08
-0x3C60 = 0x5F0E
-0x3C61 = 0x5F19
-0x3C62 = 0x5F1C
-0x3C63 = 0x5F1D
-0x3C64 = 0x5F21
-0x3C65 = 0x5F22
-0x3C66 = 0x5F23
-0x3C67 = 0x5F24
-0x3C68 = 0x5F28
-0x3C69 = 0x5F2B
-0x3C6A = 0x5F2C
-0x3C6B = 0x5F2E
-0x3C6C = 0x5F30
-0x3C6D = 0x5F34
-0x3C6E = 0x5F36
-0x3C6F = 0x5F3B
-0x3C70 = 0x5F3D
-0x3C71 = 0x5F3F
-0x3C72 = 0x5F40
-0x3C73 = 0x5F44
-0x3C74 = 0x5F45
-0x3C75 = 0x5F47
-0x3C76 = 0x5F4D
-0x3C77 = 0x5F50
-0x3C78 = 0x5F54
-0x3C79 = 0x5F58
-0x3C7A = 0x5F5B
-0x3C7B = 0x5F60
-0x3C7C = 0x5F63
-0x3C7D = 0x5F64
-0x3C7E = 0x5F67
-0x3D21 = 0x5F6F
-0x3D22 = 0x5F72
-0x3D23 = 0x5F74
-0x3D24 = 0x5F75
-0x3D25 = 0x5F78
-0x3D26 = 0x5F7A
-0x3D27 = 0x5F7D
-0x3D28 = 0x5F7E
-0x3D29 = 0x5F89
-0x3D2A = 0x5F8D
-0x3D2B = 0x5F8F
-0x3D2C = 0x5F96
-0x3D2D = 0x5F9C
-0x3D2E = 0x5F9D
-0x3D2F = 0x5FA2
-0x3D30 = 0x5FA7
-0x3D31 = 0x5FAB
-0x3D32 = 0x5FA4
-0x3D33 = 0x5FAC
-0x3D34 = 0x5FAF
-0x3D35 = 0x5FB0
-0x3D36 = 0x5FB1
-0x3D37 = 0x5FB8
-0x3D38 = 0x5FC4
-0x3D39 = 0x5FC7
-0x3D3A = 0x5FC8
-0x3D3B = 0x5FC9
-0x3D3C = 0x5FCB
-0x3D3D = 0x5FD0
-0x3D3E = 0x5FD1
-0x3D3F = 0x5FD2
-0x3D40 = 0x5FD3
-0x3D41 = 0x5FD4
-0x3D42 = 0x5FDE
-0x3D43 = 0x5FE1
-0x3D44 = 0x5FE2
-0x3D45 = 0x5FE8
-0x3D46 = 0x5FE9
-0x3D47 = 0x5FEA
-0x3D48 = 0x5FEC
-0x3D49 = 0x5FED
-0x3D4A = 0x5FEE
-0x3D4B = 0x5FEF
-0x3D4C = 0x5FF2
-0x3D4D = 0x5FF3
-0x3D4E = 0x5FF6
-0x3D4F = 0x5FFA
-0x3D50 = 0x5FFC
-0x3D51 = 0x6007
-0x3D52 = 0x600A
-0x3D53 = 0x600D
-0x3D54 = 0x6013
-0x3D55 = 0x6014
-0x3D56 = 0x6017
-0x3D57 = 0x6018
-0x3D58 = 0x601A
-0x3D59 = 0x601F
-0x3D5A = 0x6024
-0x3D5B = 0x602D
-0x3D5C = 0x6033
-0x3D5D = 0x6035
-0x3D5E = 0x6040
-0x3D5F = 0x6047
-0x3D60 = 0x6048
-0x3D61 = 0x6049
-0x3D62 = 0x604C
-0x3D63 = 0x6051
-0x3D64 = 0x6054
-0x3D65 = 0x6056
-0x3D66 = 0x6057
-0x3D67 = 0x605D
-0x3D68 = 0x6061
-0x3D69 = 0x6067
-0x3D6A = 0x6071
-0x3D6B = 0x607E
-0x3D6C = 0x607F
-0x3D6D = 0x6082
-0x3D6E = 0x6086
-0x3D6F = 0x6088
-0x3D70 = 0x608A
-0x3D71 = 0x608E
-0x3D72 = 0x6091
-0x3D73 = 0x6093
-0x3D74 = 0x6095
-0x3D75 = 0x6098
-0x3D76 = 0x609D
-0x3D77 = 0x609E
-0x3D78 = 0x60A2
-0x3D79 = 0x60A4
-0x3D7A = 0x60A5
-0x3D7B = 0x60A8
-0x3D7C = 0x60B0
-0x3D7D = 0x60B1
-0x3D7E = 0x60B7
-0x3E21 = 0x60BB
-0x3E22 = 0x60BE
-0x3E23 = 0x60C2
-0x3E24 = 0x60C4
-0x3E25 = 0x60C8
-0x3E26 = 0x60C9
-0x3E27 = 0x60CA
-0x3E28 = 0x60CB
-0x3E29 = 0x60CE
-0x3E2A = 0x60CF
-0x3E2B = 0x60D4
-0x3E2C = 0x60D5
-0x3E2D = 0x60D9
-0x3E2E = 0x60DB
-0x3E2F = 0x60DD
-0x3E30 = 0x60DE
-0x3E31 = 0x60E2
-0x3E32 = 0x60E5
-0x3E33 = 0x60F2
-0x3E34 = 0x60F5
-0x3E35 = 0x60F8
-0x3E36 = 0x60FC
-0x3E37 = 0x60FD
-0x3E38 = 0x6102
-0x3E39 = 0x6107
-0x3E3A = 0x610A
-0x3E3B = 0x610C
-0x3E3C = 0x6110
-0x3E3D = 0x6111
-0x3E3E = 0x6112
-0x3E3F = 0x6113
-0x3E40 = 0x6114
-0x3E41 = 0x6116
-0x3E42 = 0x6117
-0x3E43 = 0x6119
-0x3E44 = 0x611C
-0x3E45 = 0x611E
-0x3E46 = 0x6122
-0x3E47 = 0x612A
-0x3E48 = 0x612B
-0x3E49 = 0x6130
-0x3E4A = 0x6131
-0x3E4B = 0x6135
-0x3E4C = 0x6136
-0x3E4D = 0x6137
-0x3E4E = 0x6139
-0x3E4F = 0x6141
-0x3E50 = 0x6145
-0x3E51 = 0x6146
-0x3E52 = 0x6149
-0x3E53 = 0x615E
-0x3E54 = 0x6160
-0x3E55 = 0x616C
-0x3E56 = 0x6172
-0x3E57 = 0x6178
-0x3E58 = 0x617B
-0x3E59 = 0x617C
-0x3E5A = 0x617F
-0x3E5B = 0x6180
-0x3E5C = 0x6181
-0x3E5D = 0x6183
-0x3E5E = 0x6184
-0x3E5F = 0x618B
-0x3E60 = 0x618D
-0x3E61 = 0x6192
-0x3E62 = 0x6193
-0x3E63 = 0x6197
-0x3E64 = 0x6198
-0x3E65 = 0x619C
-0x3E66 = 0x619D
-0x3E67 = 0x619F
-0x3E68 = 0x61A0
-0x3E69 = 0x61A5
-0x3E6A = 0x61A8
-0x3E6B = 0x61AA
-0x3E6C = 0x61AD
-0x3E6D = 0x61B8
-0x3E6E = 0x61B9
-0x3E6F = 0x61BC
-0x3E70 = 0x61C0
-0x3E71 = 0x61C1
-0x3E72 = 0x61C2
-0x3E73 = 0x61CE
-0x3E74 = 0x61CF
-0x3E75 = 0x61D5
-0x3E76 = 0x61DC
-0x3E77 = 0x61DD
-0x3E78 = 0x61DE
-0x3E79 = 0x61DF
-0x3E7A = 0x61E1
-0x3E7B = 0x61E2
-0x3E7C = 0x61E7
-0x3E7D = 0x61E9
-0x3E7E = 0x61E5
-0x3F21 = 0x61EC
-0x3F22 = 0x61ED
-0x3F23 = 0x61EF
-0x3F24 = 0x6201
-0x3F25 = 0x6203
-0x3F26 = 0x6204
-0x3F27 = 0x6207
-0x3F28 = 0x6213
-0x3F29 = 0x6215
-0x3F2A = 0x621C
-0x3F2B = 0x6220
-0x3F2C = 0x6222
-0x3F2D = 0x6223
-0x3F2E = 0x6227
-0x3F2F = 0x6229
-0x3F30 = 0x622B
-0x3F31 = 0x6239
-0x3F32 = 0x623D
-0x3F33 = 0x6242
-0x3F34 = 0x6243
-0x3F35 = 0x6244
-0x3F36 = 0x6246
-0x3F37 = 0x624C
-0x3F38 = 0x6250
-0x3F39 = 0x6251
-0x3F3A = 0x6252
-0x3F3B = 0x6254
-0x3F3C = 0x6256
-0x3F3D = 0x625A
-0x3F3E = 0x625C
-0x3F3F = 0x6264
-0x3F40 = 0x626D
-0x3F41 = 0x626F
-0x3F42 = 0x6273
-0x3F43 = 0x627A
-0x3F44 = 0x627D
-0x3F45 = 0x628D
-0x3F46 = 0x628E
-0x3F47 = 0x628F
-0x3F48 = 0x6290
-0x3F49 = 0x62A6
-0x3F4A = 0x62A8
-0x3F4B = 0x62B3
-0x3F4C = 0x62B6
-0x3F4D = 0x62B7
-0x3F4E = 0x62BA
-0x3F4F = 0x62BE
-0x3F50 = 0x62BF
-0x3F51 = 0x62C4
-0x3F52 = 0x62CE
-0x3F53 = 0x62D5
-0x3F54 = 0x62D6
-0x3F55 = 0x62DA
-0x3F56 = 0x62EA
-0x3F57 = 0x62F2
-0x3F58 = 0x62F4
-0x3F59 = 0x62FC
-0x3F5A = 0x62FD
-0x3F5B = 0x6303
-0x3F5C = 0x6304
-0x3F5D = 0x630A
-0x3F5E = 0x630B
-0x3F5F = 0x630D
-0x3F60 = 0x6310
-0x3F61 = 0x6313
-0x3F62 = 0x6316
-0x3F63 = 0x6318
-0x3F64 = 0x6329
-0x3F65 = 0x632A
-0x3F66 = 0x632D
-0x3F67 = 0x6335
-0x3F68 = 0x6336
-0x3F69 = 0x6339
-0x3F6A = 0x633C
-0x3F6B = 0x6341
-0x3F6C = 0x6342
-0x3F6D = 0x6343
-0x3F6E = 0x6344
-0x3F6F = 0x6346
-0x3F70 = 0x634A
-0x3F71 = 0x634B
-0x3F72 = 0x634E
-0x3F73 = 0x6352
-0x3F74 = 0x6353
-0x3F75 = 0x6354
-0x3F76 = 0x6358
-0x3F77 = 0x635B
-0x3F78 = 0x6365
-0x3F79 = 0x6366
-0x3F7A = 0x636C
-0x3F7B = 0x636D
-0x3F7C = 0x6371
-0x3F7D = 0x6374
-0x3F7E = 0x6375
-0x4021 = 0x6378
-0x4022 = 0x637C
-0x4023 = 0x637D
-0x4024 = 0x637F
-0x4025 = 0x6382
-0x4026 = 0x6384
-0x4027 = 0x6387
-0x4028 = 0x638A
-0x4029 = 0x6390
-0x402A = 0x6394
-0x402B = 0x6395
-0x402C = 0x6399
-0x402D = 0x639A
-0x402E = 0x639E
-0x402F = 0x63A4
-0x4030 = 0x63A6
-0x4031 = 0x63AD
-0x4032 = 0x63AE
-0x4033 = 0x63AF
-0x4034 = 0x63BD
-0x4035 = 0x63C1
-0x4036 = 0x63C5
-0x4037 = 0x63C8
-0x4038 = 0x63CE
-0x4039 = 0x63D1
-0x403A = 0x63D3
-0x403B = 0x63D4
-0x403C = 0x63D5
-0x403D = 0x63DC
-0x403E = 0x63E0
-0x403F = 0x63E5
-0x4040 = 0x63EA
-0x4041 = 0x63EC
-0x4042 = 0x63F2
-0x4043 = 0x63F3
-0x4044 = 0x63F5
-0x4045 = 0x63F8
-0x4046 = 0x63F9
-0x4047 = 0x6409
-0x4048 = 0x640A
-0x4049 = 0x6410
-0x404A = 0x6412
-0x404B = 0x6414
-0x404C = 0x6418
-0x404D = 0x641E
-0x404E = 0x6420
-0x404F = 0x6422
-0x4050 = 0x6424
-0x4051 = 0x6425
-0x4052 = 0x6429
-0x4053 = 0x642A
-0x4054 = 0x642F
-0x4055 = 0x6430
-0x4056 = 0x6435
-0x4057 = 0x643D
-0x4058 = 0x643F
-0x4059 = 0x644B
-0x405A = 0x644F
-0x405B = 0x6451
-0x405C = 0x6452
-0x405D = 0x6453
-0x405E = 0x6454
-0x405F = 0x645A
-0x4060 = 0x645B
-0x4061 = 0x645C
-0x4062 = 0x645D
-0x4063 = 0x645F
-0x4064 = 0x6460
-0x4065 = 0x6461
-0x4066 = 0x6463
-0x4067 = 0x646D
-0x4068 = 0x6473
-0x4069 = 0x6474
-0x406A = 0x647B
-0x406B = 0x647D
-0x406C = 0x6485
-0x406D = 0x6487
-0x406E = 0x648F
-0x406F = 0x6490
-0x4070 = 0x6491
-0x4071 = 0x6498
-0x4072 = 0x6499
-0x4073 = 0x649B
-0x4074 = 0x649D
-0x4075 = 0x649F
-0x4076 = 0x64A1
-0x4077 = 0x64A3
-0x4078 = 0x64A6
-0x4079 = 0x64A8
-0x407A = 0x64AC
-0x407B = 0x64B3
-0x407C = 0x64BD
-0x407D = 0x64BE
-0x407E = 0x64BF
-0x4121 = 0x64C4
-0x4122 = 0x64C9
-0x4123 = 0x64CA
-0x4124 = 0x64CB
-0x4125 = 0x64CC
-0x4126 = 0x64CE
-0x4127 = 0x64D0
-0x4128 = 0x64D1
-0x4129 = 0x64D5
-0x412A = 0x64D7
-0x412B = 0x64E4
-0x412C = 0x64E5
-0x412D = 0x64E9
-0x412E = 0x64EA
-0x412F = 0x64ED
-0x4130 = 0x64F0
-0x4131 = 0x64F5
-0x4132 = 0x64F7
-0x4133 = 0x64FB
-0x4134 = 0x64FF
-0x4135 = 0x6501
-0x4136 = 0x6504
-0x4137 = 0x6508
-0x4138 = 0x6509
-0x4139 = 0x650A
-0x413A = 0x650F
-0x413B = 0x6513
-0x413C = 0x6514
-0x413D = 0x6516
-0x413E = 0x6519
-0x413F = 0x651B
-0x4140 = 0x651E
-0x4141 = 0x651F
-0x4142 = 0x6522
-0x4143 = 0x6526
-0x4144 = 0x6529
-0x4145 = 0x652E
-0x4146 = 0x6531
-0x4147 = 0x653A
-0x4148 = 0x653C
-0x4149 = 0x653D
-0x414A = 0x6543
-0x414B = 0x6547
-0x414C = 0x6549
-0x414D = 0x6550
-0x414E = 0x6552
-0x414F = 0x6554
-0x4150 = 0x655F
-0x4151 = 0x6560
-0x4152 = 0x6567
-0x4153 = 0x656B
-0x4154 = 0x657A
-0x4155 = 0x657D
-0x4156 = 0x6581
-0x4157 = 0x6585
-0x4158 = 0x658A
-0x4159 = 0x6592
-0x415A = 0x6595
-0x415B = 0x6598
-0x415C = 0x659D
-0x415D = 0x65A0
-0x415E = 0x65A3
-0x415F = 0x65A6
-0x4160 = 0x65AE
-0x4161 = 0x65B2
-0x4162 = 0x65B3
-0x4163 = 0x65B4
-0x4164 = 0x65BF
-0x4165 = 0x65C2
-0x4166 = 0x65C8
-0x4167 = 0x65C9
-0x4168 = 0x65CE
-0x4169 = 0x65D0
-0x416A = 0x65D4
-0x416B = 0x65D6
-0x416C = 0x65D8
-0x416D = 0x65DF
-0x416E = 0x65F0
-0x416F = 0x65F2
-0x4170 = 0x65F4
-0x4171 = 0x65F5
-0x4172 = 0x65F9
-0x4173 = 0x65FE
-0x4174 = 0x65FF
-0x4175 = 0x6600
-0x4176 = 0x6604
-0x4177 = 0x6608
-0x4178 = 0x6609
-0x4179 = 0x660D
-0x417A = 0x6611
-0x417B = 0x6612
-0x417C = 0x6615
-0x417D = 0x6616
-0x417E = 0x661D
-0x4221 = 0x661E
-0x4222 = 0x6621
-0x4223 = 0x6622
-0x4224 = 0x6623
-0x4225 = 0x6624
-0x4226 = 0x6626
-0x4227 = 0x6629
-0x4228 = 0x662A
-0x4229 = 0x662B
-0x422A = 0x662C
-0x422B = 0x662E
-0x422C = 0x6630
-0x422D = 0x6631
-0x422E = 0x6633
-0x422F = 0x6639
-0x4230 = 0x6637
-0x4231 = 0x6640
-0x4232 = 0x6645
-0x4233 = 0x6646
-0x4234 = 0x664A
-0x4235 = 0x664C
-0x4236 = 0x6651
-0x4237 = 0x664E
-0x4238 = 0x6657
-0x4239 = 0x6658
-0x423A = 0x6659
-0x423B = 0x665B
-0x423C = 0x665C
-0x423D = 0x6660
-0x423E = 0x6661
-0x423F = 0x66FB
-0x4240 = 0x666A
-0x4241 = 0x666B
-0x4242 = 0x666C
-0x4243 = 0x667E
-0x4244 = 0x6673
-0x4245 = 0x6675
-0x4246 = 0x667F
-0x4247 = 0x6677
-0x4248 = 0x6678
-0x4249 = 0x6679
-0x424A = 0x667B
-0x424B = 0x6680
-0x424C = 0x667C
-0x424D = 0x668B
-0x424E = 0x668C
-0x424F = 0x668D
-0x4250 = 0x6690
-0x4251 = 0x6692
-0x4252 = 0x6699
-0x4253 = 0x669A
-0x4254 = 0x669B
-0x4255 = 0x669C
-0x4256 = 0x669F
-0x4257 = 0x66A0
-0x4258 = 0x66A4
-0x4259 = 0x66AD
-0x425A = 0x66B1
-0x425B = 0x66B2
-0x425C = 0x66B5
-0x425D = 0x66BB
-0x425E = 0x66BF
-0x425F = 0x66C0
-0x4260 = 0x66C2
-0x4261 = 0x66C3
-0x4262 = 0x66C8
-0x4263 = 0x66CC
-0x4264 = 0x66CE
-0x4265 = 0x66CF
-0x4266 = 0x66D4
-0x4267 = 0x66DB
-0x4268 = 0x66DF
-0x4269 = 0x66E8
-0x426A = 0x66EB
-0x426B = 0x66EC
-0x426C = 0x66EE
-0x426D = 0x66FA
-0x426E = 0x6705
-0x426F = 0x6707
-0x4270 = 0x670E
-0x4271 = 0x6713
-0x4272 = 0x6719
-0x4273 = 0x671C
-0x4274 = 0x6720
-0x4275 = 0x6722
-0x4276 = 0x6733
-0x4277 = 0x673E
-0x4278 = 0x6745
-0x4279 = 0x6747
-0x427A = 0x6748
-0x427B = 0x674C
-0x427C = 0x6754
-0x427D = 0x6755
-0x427E = 0x675D
-0x4321 = 0x6766
-0x4322 = 0x676C
-0x4323 = 0x676E
-0x4324 = 0x6774
-0x4325 = 0x6776
-0x4326 = 0x677B
-0x4327 = 0x6781
-0x4328 = 0x6784
-0x4329 = 0x678E
-0x432A = 0x678F
-0x432B = 0x6791
-0x432C = 0x6793
-0x432D = 0x6796
-0x432E = 0x6798
-0x432F = 0x6799
-0x4330 = 0x679B
-0x4331 = 0x67B0
-0x4332 = 0x67B1
-0x4333 = 0x67B2
-0x4334 = 0x67B5
-0x4335 = 0x67BB
-0x4336 = 0x67BC
-0x4337 = 0x67BD
-0x4338 = 0x67F9
-0x4339 = 0x67C0
-0x433A = 0x67C2
-0x433B = 0x67C3
-0x433C = 0x67C5
-0x433D = 0x67C8
-0x433E = 0x67C9
-0x433F = 0x67D2
-0x4340 = 0x67D7
-0x4341 = 0x67D9
-0x4342 = 0x67DC
-0x4343 = 0x67E1
-0x4344 = 0x67E6
-0x4345 = 0x67F0
-0x4346 = 0x67F2
-0x4347 = 0x67F6
-0x4348 = 0x67F7
-0x4349 = 0x6852
-0x434A = 0x6814
-0x434B = 0x6819
-0x434C = 0x681D
-0x434D = 0x681F
-0x434E = 0x6828
-0x434F = 0x6827
-0x4350 = 0x682C
-0x4351 = 0x682D
-0x4352 = 0x682F
-0x4353 = 0x6830
-0x4354 = 0x6831
-0x4355 = 0x6833
-0x4356 = 0x683B
-0x4357 = 0x683F
-0x4358 = 0x6844
-0x4359 = 0x6845
-0x435A = 0x684A
-0x435B = 0x684C
-0x435C = 0x6855
-0x435D = 0x6857
-0x435E = 0x6858
-0x435F = 0x685B
-0x4360 = 0x686B
-0x4361 = 0x686E
-0x4362 = 0x686F
-0x4363 = 0x6870
-0x4364 = 0x6871
-0x4365 = 0x6872
-0x4366 = 0x6875
-0x4367 = 0x6879
-0x4368 = 0x687A
-0x4369 = 0x687B
-0x436A = 0x687C
-0x436B = 0x6882
-0x436C = 0x6884
-0x436D = 0x6886
-0x436E = 0x6888
-0x436F = 0x6896
-0x4370 = 0x6898
-0x4371 = 0x689A
-0x4372 = 0x689C
-0x4373 = 0x68A1
-0x4374 = 0x68A3
-0x4375 = 0x68A5
-0x4376 = 0x68A9
-0x4377 = 0x68AA
-0x4378 = 0x68AE
-0x4379 = 0x68B2
-0x437A = 0x68BB
-0x437B = 0x68C5
-0x437C = 0x68C8
-0x437D = 0x68CC
-0x437E = 0x68CF
-0x4421 = 0x68D0
-0x4422 = 0x68D1
-0x4423 = 0x68D3
-0x4424 = 0x68D6
-0x4425 = 0x68D9
-0x4426 = 0x68DC
-0x4427 = 0x68DD
-0x4428 = 0x68E5
-0x4429 = 0x68E8
-0x442A = 0x68EA
-0x442B = 0x68EB
-0x442C = 0x68EC
-0x442D = 0x68ED
-0x442E = 0x68F0
-0x442F = 0x68F1
-0x4430 = 0x68F5
-0x4431 = 0x68F6
-0x4432 = 0x68FB
-0x4433 = 0x68FC
-0x4434 = 0x68FD
-0x4435 = 0x6906
-0x4436 = 0x6909
-0x4437 = 0x690A
-0x4438 = 0x6910
-0x4439 = 0x6911
-0x443A = 0x6913
-0x443B = 0x6916
-0x443C = 0x6917
-0x443D = 0x6931
-0x443E = 0x6933
-0x443F = 0x6935
-0x4440 = 0x6938
-0x4441 = 0x693B
-0x4442 = 0x6942
-0x4443 = 0x6945
-0x4444 = 0x6949
-0x4445 = 0x694E
-0x4446 = 0x6957
-0x4447 = 0x695B
-0x4448 = 0x6963
-0x4449 = 0x6964
-0x444A = 0x6965
-0x444B = 0x6966
-0x444C = 0x6968
-0x444D = 0x6969
-0x444E = 0x696C
-0x444F = 0x6970
-0x4450 = 0x6971
-0x4451 = 0x6972
-0x4452 = 0x697A
-0x4453 = 0x697B
-0x4454 = 0x697F
-0x4455 = 0x6980
-0x4456 = 0x698D
-0x4457 = 0x6992
-0x4458 = 0x6996
-0x4459 = 0x6998
-0x445A = 0x69A1
-0x445B = 0x69A5
-0x445C = 0x69A6
-0x445D = 0x69A8
-0x445E = 0x69AB
-0x445F = 0x69AD
-0x4460 = 0x69AF
-0x4461 = 0x69B7
-0x4462 = 0x69B8
-0x4463 = 0x69BA
-0x4464 = 0x69BC
-0x4465 = 0x69C5
-0x4466 = 0x69C8
-0x4467 = 0x69D1
-0x4468 = 0x69D6
-0x4469 = 0x69D7
-0x446A = 0x69E2
-0x446B = 0x69E5
-0x446C = 0x69EE
-0x446D = 0x69EF
-0x446E = 0x69F1
-0x446F = 0x69F3
-0x4470 = 0x69F5
-0x4471 = 0x69FE
-0x4472 = 0x6A00
-0x4473 = 0x6A01
-0x4474 = 0x6A03
-0x4475 = 0x6A0F
-0x4476 = 0x6A11
-0x4477 = 0x6A15
-0x4478 = 0x6A1A
-0x4479 = 0x6A1D
-0x447A = 0x6A20
-0x447B = 0x6A24
-0x447C = 0x6A28
-0x447D = 0x6A30
-0x447E = 0x6A32
-0x4521 = 0x6A34
-0x4522 = 0x6A37
-0x4523 = 0x6A3B
-0x4524 = 0x6A3E
-0x4525 = 0x6A3F
-0x4526 = 0x6A45
-0x4527 = 0x6A46
-0x4528 = 0x6A49
-0x4529 = 0x6A4A
-0x452A = 0x6A4E
-0x452B = 0x6A50
-0x452C = 0x6A51
-0x452D = 0x6A52
-0x452E = 0x6A55
-0x452F = 0x6A56
-0x4530 = 0x6A5B
-0x4531 = 0x6A64
-0x4532 = 0x6A67
-0x4533 = 0x6A6A
-0x4534 = 0x6A71
-0x4535 = 0x6A73
-0x4536 = 0x6A7E
-0x4537 = 0x6A81
-0x4538 = 0x6A83
-0x4539 = 0x6A86
-0x453A = 0x6A87
-0x453B = 0x6A89
-0x453C = 0x6A8B
-0x453D = 0x6A91
-0x453E = 0x6A9B
-0x453F = 0x6A9D
-0x4540 = 0x6A9E
-0x4541 = 0x6A9F
-0x4542 = 0x6AA5
-0x4543 = 0x6AAB
-0x4544 = 0x6AAF
-0x4545 = 0x6AB0
-0x4546 = 0x6AB1
-0x4547 = 0x6AB4
-0x4548 = 0x6ABD
-0x4549 = 0x6ABE
-0x454A = 0x6ABF
-0x454B = 0x6AC6
-0x454C = 0x6AC9
-0x454D = 0x6AC8
-0x454E = 0x6ACC
-0x454F = 0x6AD0
-0x4550 = 0x6AD4
-0x4551 = 0x6AD5
-0x4552 = 0x6AD6
-0x4553 = 0x6ADC
-0x4554 = 0x6ADD
-0x4555 = 0x6AE4
-0x4556 = 0x6AE7
-0x4557 = 0x6AEC
-0x4558 = 0x6AF0
-0x4559 = 0x6AF1
-0x455A = 0x6AF2
-0x455B = 0x6AFC
-0x455C = 0x6AFD
-0x455D = 0x6B02
-0x455E = 0x6B03
-0x455F = 0x6B06
-0x4560 = 0x6B07
-0x4561 = 0x6B09
-0x4562 = 0x6B0F
-0x4563 = 0x6B10
-0x4564 = 0x6B11
-0x4565 = 0x6B17
-0x4566 = 0x6B1B
-0x4567 = 0x6B1E
-0x4568 = 0x6B24
-0x4569 = 0x6B28
-0x456A = 0x6B2B
-0x456B = 0x6B2C
-0x456C = 0x6B2F
-0x456D = 0x6B35
-0x456E = 0x6B36
-0x456F = 0x6B3B
-0x4570 = 0x6B3F
-0x4571 = 0x6B46
-0x4572 = 0x6B4A
-0x4573 = 0x6B4D
-0x4574 = 0x6B52
-0x4575 = 0x6B56
-0x4576 = 0x6B58
-0x4577 = 0x6B5D
-0x4578 = 0x6B60
-0x4579 = 0x6B67
-0x457A = 0x6B6B
-0x457B = 0x6B6E
-0x457C = 0x6B70
-0x457D = 0x6B75
-0x457E = 0x6B7D
-0x4621 = 0x6B7E
-0x4622 = 0x6B82
-0x4623 = 0x6B85
-0x4624 = 0x6B97
-0x4625 = 0x6B9B
-0x4626 = 0x6B9F
-0x4627 = 0x6BA0
-0x4628 = 0x6BA2
-0x4629 = 0x6BA3
-0x462A = 0x6BA8
-0x462B = 0x6BA9
-0x462C = 0x6BAC
-0x462D = 0x6BAD
-0x462E = 0x6BAE
-0x462F = 0x6BB0
-0x4630 = 0x6BB8
-0x4631 = 0x6BB9
-0x4632 = 0x6BBD
-0x4633 = 0x6BBE
-0x4634 = 0x6BC3
-0x4635 = 0x6BC4
-0x4636 = 0x6BC9
-0x4637 = 0x6BCC
-0x4638 = 0x6BD6
-0x4639 = 0x6BDA
-0x463A = 0x6BE1
-0x463B = 0x6BE3
-0x463C = 0x6BE6
-0x463D = 0x6BE7
-0x463E = 0x6BEE
-0x463F = 0x6BF1
-0x4640 = 0x6BF7
-0x4641 = 0x6BF9
-0x4642 = 0x6BFF
-0x4643 = 0x6C02
-0x4644 = 0x6C04
-0x4645 = 0x6C05
-0x4646 = 0x6C09
-0x4647 = 0x6C0D
-0x4648 = 0x6C0E
-0x4649 = 0x6C10
-0x464A = 0x6C12
-0x464B = 0x6C19
-0x464C = 0x6C1F
-0x464D = 0x6C26
-0x464E = 0x6C27
-0x464F = 0x6C28
-0x4650 = 0x6C2C
-0x4651 = 0x6C2E
-0x4652 = 0x6C33
-0x4653 = 0x6C35
-0x4654 = 0x6C36
-0x4655 = 0x6C3A
-0x4656 = 0x6C3B
-0x4657 = 0x6C3F
-0x4658 = 0x6C4A
-0x4659 = 0x6C4B
-0x465A = 0x6C4D
-0x465B = 0x6C4F
-0x465C = 0x6C52
-0x465D = 0x6C54
-0x465E = 0x6C59
-0x465F = 0x6C5B
-0x4660 = 0x6C5C
-0x4661 = 0x6C6B
-0x4662 = 0x6C6D
-0x4663 = 0x6C6F
-0x4664 = 0x6C74
-0x4665 = 0x6C76
-0x4666 = 0x6C78
-0x4667 = 0x6C79
-0x4668 = 0x6C7B
-0x4669 = 0x6C85
-0x466A = 0x6C86
-0x466B = 0x6C87
-0x466C = 0x6C89
-0x466D = 0x6C94
-0x466E = 0x6C95
-0x466F = 0x6C97
-0x4670 = 0x6C98
-0x4671 = 0x6C9C
-0x4672 = 0x6C9F
-0x4673 = 0x6CB0
-0x4674 = 0x6CB2
-0x4675 = 0x6CB4
-0x4676 = 0x6CC2
-0x4677 = 0x6CC6
-0x4678 = 0x6CCD
-0x4679 = 0x6CCF
-0x467A = 0x6CD0
-0x467B = 0x6CD1
-0x467C = 0x6CD2
-0x467D = 0x6CD4
-0x467E = 0x6CD6
-0x4721 = 0x6CDA
-0x4722 = 0x6CDC
-0x4723 = 0x6CE0
-0x4724 = 0x6CE7
-0x4725 = 0x6CE9
-0x4726 = 0x6CEB
-0x4727 = 0x6CEC
-0x4728 = 0x6CEE
-0x4729 = 0x6CF2
-0x472A = 0x6CF4
-0x472B = 0x6D04
-0x472C = 0x6D07
-0x472D = 0x6D0A
-0x472E = 0x6D0E
-0x472F = 0x6D0F
-0x4730 = 0x6D11
-0x4731 = 0x6D13
-0x4732 = 0x6D1A
-0x4733 = 0x6D26
-0x4734 = 0x6D27
-0x4735 = 0x6D28
-0x4736 = 0x6C67
-0x4737 = 0x6D2E
-0x4738 = 0x6D2F
-0x4739 = 0x6D31
-0x473A = 0x6D39
-0x473B = 0x6D3C
-0x473C = 0x6D3F
-0x473D = 0x6D57
-0x473E = 0x6D5E
-0x473F = 0x6D5F
-0x4740 = 0x6D61
-0x4741 = 0x6D65
-0x4742 = 0x6D67
-0x4743 = 0x6D6F
-0x4744 = 0x6D70
-0x4745 = 0x6D7C
-0x4746 = 0x6D82
-0x4747 = 0x6D87
-0x4748 = 0x6D91
-0x4749 = 0x6D92
-0x474A = 0x6D94
-0x474B = 0x6D96
-0x474C = 0x6D97
-0x474D = 0x6D98
-0x474E = 0x6DAA
-0x474F = 0x6DAC
-0x4750 = 0x6DB4
-0x4751 = 0x6DB7
-0x4752 = 0x6DB9
-0x4753 = 0x6DBD
-0x4754 = 0x6DBF
-0x4755 = 0x6DC4
-0x4756 = 0x6DC8
-0x4757 = 0x6DCA
-0x4758 = 0x6DCE
-0x4759 = 0x6DCF
-0x475A = 0x6DD6
-0x475B = 0x6DDB
-0x475C = 0x6DDD
-0x475D = 0x6DDF
-0x475E = 0x6DE0
-0x475F = 0x6DE2
-0x4760 = 0x6DE5
-0x4761 = 0x6DE9
-0x4762 = 0x6DEF
-0x4763 = 0x6DF0
-0x4764 = 0x6DF4
-0x4765 = 0x6DF6
-0x4766 = 0x6DFC
-0x4767 = 0x6E00
-0x4768 = 0x6E04
-0x4769 = 0x6E1E
-0x476A = 0x6E22
-0x476B = 0x6E27
-0x476C = 0x6E32
-0x476D = 0x6E36
-0x476E = 0x6E39
-0x476F = 0x6E3B
-0x4770 = 0x6E3C
-0x4771 = 0x6E44
-0x4772 = 0x6E45
-0x4773 = 0x6E48
-0x4774 = 0x6E49
-0x4775 = 0x6E4B
-0x4776 = 0x6E4F
-0x4777 = 0x6E51
-0x4778 = 0x6E52
-0x4779 = 0x6E53
-0x477A = 0x6E54
-0x477B = 0x6E57
-0x477C = 0x6E5C
-0x477D = 0x6E5D
-0x477E = 0x6E5E
-0x4821 = 0x6E62
-0x4822 = 0x6E63
-0x4823 = 0x6E68
-0x4824 = 0x6E73
-0x4825 = 0x6E7B
-0x4826 = 0x6E7D
-0x4827 = 0x6E8D
-0x4828 = 0x6E93
-0x4829 = 0x6E99
-0x482A = 0x6EA0
-0x482B = 0x6EA7
-0x482C = 0x6EAD
-0x482D = 0x6EAE
-0x482E = 0x6EB1
-0x482F = 0x6EB3
-0x4830 = 0x6EBB
-0x4831 = 0x6EBF
-0x4832 = 0x6EC0
-0x4833 = 0x6EC1
-0x4834 = 0x6EC3
-0x4835 = 0x6EC7
-0x4836 = 0x6EC8
-0x4837 = 0x6ECA
-0x4838 = 0x6ECD
-0x4839 = 0x6ECE
-0x483A = 0x6ECF
-0x483B = 0x6EEB
-0x483C = 0x6EED
-0x483D = 0x6EEE
-0x483E = 0x6EF9
-0x483F = 0x6EFB
-0x4840 = 0x6EFD
-0x4841 = 0x6F04
-0x4842 = 0x6F08
-0x4843 = 0x6F0A
-0x4844 = 0x6F0C
-0x4845 = 0x6F0D
-0x4846 = 0x6F16
-0x4847 = 0x6F18
-0x4848 = 0x6F1A
-0x4849 = 0x6F1B
-0x484A = 0x6F26
-0x484B = 0x6F29
-0x484C = 0x6F2A
-0x484D = 0x6F2F
-0x484E = 0x6F30
-0x484F = 0x6F33
-0x4850 = 0x6F36
-0x4851 = 0x6F3B
-0x4852 = 0x6F3C
-0x4853 = 0x6F2D
-0x4854 = 0x6F4F
-0x4855 = 0x6F51
-0x4856 = 0x6F52
-0x4857 = 0x6F53
-0x4858 = 0x6F57
-0x4859 = 0x6F59
-0x485A = 0x6F5A
-0x485B = 0x6F5D
-0x485C = 0x6F5E
-0x485D = 0x6F61
-0x485E = 0x6F62
-0x485F = 0x6F68
-0x4860 = 0x6F6C
-0x4861 = 0x6F7D
-0x4862 = 0x6F7E
-0x4863 = 0x6F83
-0x4864 = 0x6F87
-0x4865 = 0x6F88
-0x4866 = 0x6F8B
-0x4867 = 0x6F8C
-0x4868 = 0x6F8D
-0x4869 = 0x6F90
-0x486A = 0x6F92
-0x486B = 0x6F93
-0x486C = 0x6F94
-0x486D = 0x6F96
-0x486E = 0x6F9A
-0x486F = 0x6F9F
-0x4870 = 0x6FA0
-0x4871 = 0x6FA5
-0x4872 = 0x6FA6
-0x4873 = 0x6FA7
-0x4874 = 0x6FA8
-0x4875 = 0x6FAE
-0x4876 = 0x6FAF
-0x4877 = 0x6FB0
-0x4878 = 0x6FB5
-0x4879 = 0x6FB6
-0x487A = 0x6FBC
-0x487B = 0x6FC5
-0x487C = 0x6FC7
-0x487D = 0x6FC8
-0x487E = 0x6FCA
-0x4921 = 0x6FDA
-0x4922 = 0x6FDE
-0x4923 = 0x6FE8
-0x4924 = 0x6FE9
-0x4925 = 0x6FF0
-0x4926 = 0x6FF5
-0x4927 = 0x6FF9
-0x4928 = 0x6FFC
-0x4929 = 0x6FFD
-0x492A = 0x7000
-0x492B = 0x7005
-0x492C = 0x7006
-0x492D = 0x7007
-0x492E = 0x700D
-0x492F = 0x7017
-0x4930 = 0x7020
-0x4931 = 0x7023
-0x4932 = 0x702F
-0x4933 = 0x7034
-0x4934 = 0x7037
-0x4935 = 0x7039
-0x4936 = 0x703C
-0x4937 = 0x7043
-0x4938 = 0x7044
-0x4939 = 0x7048
-0x493A = 0x7049
-0x493B = 0x704A
-0x493C = 0x704B
-0x493D = 0x7054
-0x493E = 0x7055
-0x493F = 0x705D
-0x4940 = 0x705E
-0x4941 = 0x704E
-0x4942 = 0x7064
-0x4943 = 0x7065
-0x4944 = 0x706C
-0x4945 = 0x706E
-0x4946 = 0x7075
-0x4947 = 0x7076
-0x4948 = 0x707E
-0x4949 = 0x7081
-0x494A = 0x7085
-0x494B = 0x7086
-0x494C = 0x7094
-0x494D = 0x7095
-0x494E = 0x7096
-0x494F = 0x7097
-0x4950 = 0x7098
-0x4951 = 0x709B
-0x4952 = 0x70A4
-0x4953 = 0x70AB
-0x4954 = 0x70B0
-0x4955 = 0x70B1
-0x4956 = 0x70B4
-0x4957 = 0x70B7
-0x4958 = 0x70CA
-0x4959 = 0x70D1
-0x495A = 0x70D3
-0x495B = 0x70D4
-0x495C = 0x70D5
-0x495D = 0x70D6
-0x495E = 0x70D8
-0x495F = 0x70DC
-0x4960 = 0x70E4
-0x4961 = 0x70FA
-0x4962 = 0x7103
-0x4963 = 0x7104
-0x4964 = 0x7105
-0x4965 = 0x7106
-0x4966 = 0x7107
-0x4967 = 0x710B
-0x4968 = 0x710C
-0x4969 = 0x710F
-0x496A = 0x711E
-0x496B = 0x7120
-0x496C = 0x712B
-0x496D = 0x712D
-0x496E = 0x712F
-0x496F = 0x7130
-0x4970 = 0x7131
-0x4971 = 0x7138
-0x4972 = 0x7141
-0x4973 = 0x7145
-0x4974 = 0x7146
-0x4975 = 0x7147
-0x4976 = 0x714A
-0x4977 = 0x714B
-0x4978 = 0x7150
-0x4979 = 0x7152
-0x497A = 0x7157
-0x497B = 0x715A
-0x497C = 0x715C
-0x497D = 0x715E
-0x497E = 0x7160
-0x4A21 = 0x7168
-0x4A22 = 0x7179
-0x4A23 = 0x7180
-0x4A24 = 0x7185
-0x4A25 = 0x7187
-0x4A26 = 0x718C
-0x4A27 = 0x7192
-0x4A28 = 0x719A
-0x4A29 = 0x719B
-0x4A2A = 0x71A0
-0x4A2B = 0x71A2
-0x4A2C = 0x71AF
-0x4A2D = 0x71B0
-0x4A2E = 0x71B2
-0x4A2F = 0x71B3
-0x4A30 = 0x71BA
-0x4A31 = 0x71BF
-0x4A32 = 0x71C0
-0x4A33 = 0x71C1
-0x4A34 = 0x71C4
-0x4A35 = 0x71CB
-0x4A36 = 0x71CC
-0x4A37 = 0x71D3
-0x4A38 = 0x71D6
-0x4A39 = 0x71D9
-0x4A3A = 0x71DA
-0x4A3B = 0x71DC
-0x4A3C = 0x71F8
-0x4A3D = 0x71FE
-0x4A3E = 0x7200
-0x4A3F = 0x7207
-0x4A40 = 0x7208
-0x4A41 = 0x7209
-0x4A42 = 0x7213
-0x4A43 = 0x7217
-0x4A44 = 0x721A
-0x4A45 = 0x721D
-0x4A46 = 0x721F
-0x4A47 = 0x7224
-0x4A48 = 0x722B
-0x4A49 = 0x722F
-0x4A4A = 0x7234
-0x4A4B = 0x7238
-0x4A4C = 0x7239
-0x4A4D = 0x7241
-0x4A4E = 0x7242
-0x4A4F = 0x7243
-0x4A50 = 0x7245
-0x4A51 = 0x724E
-0x4A52 = 0x724F
-0x4A53 = 0x7250
-0x4A54 = 0x7253
-0x4A55 = 0x7255
-0x4A56 = 0x7256
-0x4A57 = 0x725A
-0x4A58 = 0x725C
-0x4A59 = 0x725E
-0x4A5A = 0x7260
-0x4A5B = 0x7263
-0x4A5C = 0x7268
-0x4A5D = 0x726B
-0x4A5E = 0x726E
-0x4A5F = 0x726F
-0x4A60 = 0x7271
-0x4A61 = 0x7277
-0x4A62 = 0x7278
-0x4A63 = 0x727B
-0x4A64 = 0x727C
-0x4A65 = 0x727F
-0x4A66 = 0x7284
-0x4A67 = 0x7289
-0x4A68 = 0x728D
-0x4A69 = 0x728E
-0x4A6A = 0x7293
-0x4A6B = 0x729B
-0x4A6C = 0x72A8
-0x4A6D = 0x72AD
-0x4A6E = 0x72AE
-0x4A6F = 0x72B1
-0x4A70 = 0x72B4
-0x4A71 = 0x72BE
-0x4A72 = 0x72C1
-0x4A73 = 0x72C7
-0x4A74 = 0x72C9
-0x4A75 = 0x72CC
-0x4A76 = 0x72D5
-0x4A77 = 0x72D6
-0x4A78 = 0x72D8
-0x4A79 = 0x72DF
-0x4A7A = 0x72E5
-0x4A7B = 0x72F3
-0x4A7C = 0x72F4
-0x4A7D = 0x72FA
-0x4A7E = 0x72FB
-0x4B21 = 0x72FE
-0x4B22 = 0x7302
-0x4B23 = 0x7304
-0x4B24 = 0x7305
-0x4B25 = 0x7307
-0x4B26 = 0x730B
-0x4B27 = 0x730D
-0x4B28 = 0x7312
-0x4B29 = 0x7313
-0x4B2A = 0x7318
-0x4B2B = 0x7319
-0x4B2C = 0x731E
-0x4B2D = 0x7322
-0x4B2E = 0x7324
-0x4B2F = 0x7327
-0x4B30 = 0x7328
-0x4B31 = 0x732C
-0x4B32 = 0x7331
-0x4B33 = 0x7332
-0x4B34 = 0x7335
-0x4B35 = 0x733A
-0x4B36 = 0x733B
-0x4B37 = 0x733D
-0x4B38 = 0x7343
-0x4B39 = 0x734D
-0x4B3A = 0x7350
-0x4B3B = 0x7352
-0x4B3C = 0x7356
-0x4B3D = 0x7358
-0x4B3E = 0x735D
-0x4B3F = 0x735E
-0x4B40 = 0x735F
-0x4B41 = 0x7360
-0x4B42 = 0x7366
-0x4B43 = 0x7367
-0x4B44 = 0x7369
-0x4B45 = 0x736B
-0x4B46 = 0x736C
-0x4B47 = 0x736E
-0x4B48 = 0x736F
-0x4B49 = 0x7371
-0x4B4A = 0x7377
-0x4B4B = 0x7379
-0x4B4C = 0x737C
-0x4B4D = 0x7380
-0x4B4E = 0x7381
-0x4B4F = 0x7383
-0x4B50 = 0x7385
-0x4B51 = 0x7386
-0x4B52 = 0x738E
-0x4B53 = 0x7390
-0x4B54 = 0x7393
-0x4B55 = 0x7395
-0x4B56 = 0x7397
-0x4B57 = 0x7398
-0x4B58 = 0x739C
-0x4B59 = 0x739E
-0x4B5A = 0x739F
-0x4B5B = 0x73A0
-0x4B5C = 0x73A2
-0x4B5D = 0x73A5
-0x4B5E = 0x73A6
-0x4B5F = 0x73AA
-0x4B60 = 0x73AB
-0x4B61 = 0x73AD
-0x4B62 = 0x73B5
-0x4B63 = 0x73B7
-0x4B64 = 0x73B9
-0x4B65 = 0x73BC
-0x4B66 = 0x73BD
-0x4B67 = 0x73BF
-0x4B68 = 0x73C5
-0x4B69 = 0x73C6
-0x4B6A = 0x73C9
-0x4B6B = 0x73CB
-0x4B6C = 0x73CC
-0x4B6D = 0x73CF
-0x4B6E = 0x73D2
-0x4B6F = 0x73D3
-0x4B70 = 0x73D6
-0x4B71 = 0x73D9
-0x4B72 = 0x73DD
-0x4B73 = 0x73E1
-0x4B74 = 0x73E3
-0x4B75 = 0x73E6
-0x4B76 = 0x73E7
-0x4B77 = 0x73E9
-0x4B78 = 0x73F4
-0x4B79 = 0x73F5
-0x4B7A = 0x73F7
-0x4B7B = 0x73F9
-0x4B7C = 0x73FA
-0x4B7D = 0x73FB
-0x4B7E = 0x73FD
-0x4C21 = 0x73FF
-0x4C22 = 0x7400
-0x4C23 = 0x7401
-0x4C24 = 0x7404
-0x4C25 = 0x7407
-0x4C26 = 0x740A
-0x4C27 = 0x7411
-0x4C28 = 0x741A
-0x4C29 = 0x741B
-0x4C2A = 0x7424
-0x4C2B = 0x7426
-0x4C2C = 0x7428
-0x4C2D = 0x7429
-0x4C2E = 0x742A
-0x4C2F = 0x742B
-0x4C30 = 0x742C
-0x4C31 = 0x742D
-0x4C32 = 0x742E
-0x4C33 = 0x742F
-0x4C34 = 0x7430
-0x4C35 = 0x7431
-0x4C36 = 0x7439
-0x4C37 = 0x7440
-0x4C38 = 0x7443
-0x4C39 = 0x7444
-0x4C3A = 0x7446
-0x4C3B = 0x7447
-0x4C3C = 0x744B
-0x4C3D = 0x744D
-0x4C3E = 0x7451
-0x4C3F = 0x7452
-0x4C40 = 0x7457
-0x4C41 = 0x745D
-0x4C42 = 0x7462
-0x4C43 = 0x7466
-0x4C44 = 0x7467
-0x4C45 = 0x7468
-0x4C46 = 0x746B
-0x4C47 = 0x746D
-0x4C48 = 0x746E
-0x4C49 = 0x7471
-0x4C4A = 0x7472
-0x4C4B = 0x7480
-0x4C4C = 0x7481
-0x4C4D = 0x7485
-0x4C4E = 0x7486
-0x4C4F = 0x7487
-0x4C50 = 0x7489
-0x4C51 = 0x748F
-0x4C52 = 0x7490
-0x4C53 = 0x7491
-0x4C54 = 0x7492
-0x4C55 = 0x7498
-0x4C56 = 0x7499
-0x4C57 = 0x749A
-0x4C58 = 0x749C
-0x4C59 = 0x749F
-0x4C5A = 0x74A0
-0x4C5B = 0x74A1
-0x4C5C = 0x74A3
-0x4C5D = 0x74A6
-0x4C5E = 0x74A8
-0x4C5F = 0x74A9
-0x4C60 = 0x74AA
-0x4C61 = 0x74AB
-0x4C62 = 0x74AE
-0x4C63 = 0x74AF
-0x4C64 = 0x74B1
-0x4C65 = 0x74B2
-0x4C66 = 0x74B5
-0x4C67 = 0x74B9
-0x4C68 = 0x74BB
-0x4C69 = 0x74BF
-0x4C6A = 0x74C8
-0x4C6B = 0x74C9
-0x4C6C = 0x74CC
-0x4C6D = 0x74D0
-0x4C6E = 0x74D3
-0x4C6F = 0x74D8
-0x4C70 = 0x74DA
-0x4C71 = 0x74DB
-0x4C72 = 0x74DE
-0x4C73 = 0x74DF
-0x4C74 = 0x74E4
-0x4C75 = 0x74E8
-0x4C76 = 0x74EA
-0x4C77 = 0x74EB
-0x4C78 = 0x74EF
-0x4C79 = 0x74F4
-0x4C7A = 0x74FA
-0x4C7B = 0x74FB
-0x4C7C = 0x74FC
-0x4C7D = 0x74FF
-0x4C7E = 0x7506
-0x4D21 = 0x7512
-0x4D22 = 0x7516
-0x4D23 = 0x7517
-0x4D24 = 0x7520
-0x4D25 = 0x7521
-0x4D26 = 0x7524
-0x4D27 = 0x7527
-0x4D28 = 0x7529
-0x4D29 = 0x752A
-0x4D2A = 0x752F
-0x4D2B = 0x7536
-0x4D2C = 0x7539
-0x4D2D = 0x753D
-0x4D2E = 0x753E
-0x4D2F = 0x753F
-0x4D30 = 0x7540
-0x4D31 = 0x7543
-0x4D32 = 0x7547
-0x4D33 = 0x7548
-0x4D34 = 0x754E
-0x4D35 = 0x7550
-0x4D36 = 0x7552
-0x4D37 = 0x7557
-0x4D38 = 0x755E
-0x4D39 = 0x755F
-0x4D3A = 0x7561
-0x4D3B = 0x756F
-0x4D3C = 0x7571
-0x4D3D = 0x7579
-0x4D3E = 0x757A
-0x4D3F = 0x757B
-0x4D40 = 0x757C
-0x4D41 = 0x757D
-0x4D42 = 0x757E
-0x4D43 = 0x7581
-0x4D44 = 0x7585
-0x4D45 = 0x7590
-0x4D46 = 0x7592
-0x4D47 = 0x7593
-0x4D48 = 0x7595
-0x4D49 = 0x7599
-0x4D4A = 0x759C
-0x4D4B = 0x75A2
-0x4D4C = 0x75A4
-0x4D4D = 0x75B4
-0x4D4E = 0x75BA
-0x4D4F = 0x75BF
-0x4D50 = 0x75C0
-0x4D51 = 0x75C1
-0x4D52 = 0x75C4
-0x4D53 = 0x75C6
-0x4D54 = 0x75CC
-0x4D55 = 0x75CE
-0x4D56 = 0x75CF
-0x4D57 = 0x75D7
-0x4D58 = 0x75DC
-0x4D59 = 0x75DF
-0x4D5A = 0x75E0
-0x4D5B = 0x75E1
-0x4D5C = 0x75E4
-0x4D5D = 0x75E7
-0x4D5E = 0x75EC
-0x4D5F = 0x75EE
-0x4D60 = 0x75EF
-0x4D61 = 0x75F1
-0x4D62 = 0x75F9
-0x4D63 = 0x7600
-0x4D64 = 0x7602
-0x4D65 = 0x7603
-0x4D66 = 0x7604
-0x4D67 = 0x7607
-0x4D68 = 0x7608
-0x4D69 = 0x760A
-0x4D6A = 0x760C
-0x4D6B = 0x760F
-0x4D6C = 0x7612
-0x4D6D = 0x7613
-0x4D6E = 0x7615
-0x4D6F = 0x7616
-0x4D70 = 0x7619
-0x4D71 = 0x761B
-0x4D72 = 0x761C
-0x4D73 = 0x761D
-0x4D74 = 0x761E
-0x4D75 = 0x7623
-0x4D76 = 0x7625
-0x4D77 = 0x7626
-0x4D78 = 0x7629
-0x4D79 = 0x762D
-0x4D7A = 0x7632
-0x4D7B = 0x7633
-0x4D7C = 0x7635
-0x4D7D = 0x7638
-0x4D7E = 0x7639
-0x4E21 = 0x763A
-0x4E22 = 0x763C
-0x4E23 = 0x764A
-0x4E24 = 0x7640
-0x4E25 = 0x7641
-0x4E26 = 0x7643
-0x4E27 = 0x7644
-0x4E28 = 0x7645
-0x4E29 = 0x7649
-0x4E2A = 0x764B
-0x4E2B = 0x7655
-0x4E2C = 0x7659
-0x4E2D = 0x765F
-0x4E2E = 0x7664
-0x4E2F = 0x7665
-0x4E30 = 0x766D
-0x4E31 = 0x766E
-0x4E32 = 0x766F
-0x4E33 = 0x7671
-0x4E34 = 0x7674
-0x4E35 = 0x7681
-0x4E36 = 0x7685
-0x4E37 = 0x768C
-0x4E38 = 0x768D
-0x4E39 = 0x7695
-0x4E3A = 0x769B
-0x4E3B = 0x769C
-0x4E3C = 0x769D
-0x4E3D = 0x769F
-0x4E3E = 0x76A0
-0x4E3F = 0x76A2
-0x4E40 = 0x76A3
-0x4E41 = 0x76A4
-0x4E42 = 0x76A5
-0x4E43 = 0x76A6
-0x4E44 = 0x76A7
-0x4E45 = 0x76A8
-0x4E46 = 0x76AA
-0x4E47 = 0x76AD
-0x4E48 = 0x76BD
-0x4E49 = 0x76C1
-0x4E4A = 0x76C5
-0x4E4B = 0x76C9
-0x4E4C = 0x76CB
-0x4E4D = 0x76CC
-0x4E4E = 0x76CE
-0x4E4F = 0x76D4
-0x4E50 = 0x76D9
-0x4E51 = 0x76E0
-0x4E52 = 0x76E6
-0x4E53 = 0x76E8
-0x4E54 = 0x76EC
-0x4E55 = 0x76F0
-0x4E56 = 0x76F1
-0x4E57 = 0x76F6
-0x4E58 = 0x76F9
-0x4E59 = 0x76FC
-0x4E5A = 0x7700
-0x4E5B = 0x7706
-0x4E5C = 0x770A
-0x4E5D = 0x770E
-0x4E5E = 0x7712
-0x4E5F = 0x7714
-0x4E60 = 0x7715
-0x4E61 = 0x7717
-0x4E62 = 0x7719
-0x4E63 = 0x771A
-0x4E64 = 0x771C
-0x4E65 = 0x7722
-0x4E66 = 0x7728
-0x4E67 = 0x772D
-0x4E68 = 0x772E
-0x4E69 = 0x772F
-0x4E6A = 0x7734
-0x4E6B = 0x7735
-0x4E6C = 0x7736
-0x4E6D = 0x7739
-0x4E6E = 0x773D
-0x4E6F = 0x773E
-0x4E70 = 0x7742
-0x4E71 = 0x7745
-0x4E72 = 0x7746
-0x4E73 = 0x774A
-0x4E74 = 0x774D
-0x4E75 = 0x774E
-0x4E76 = 0x774F
-0x4E77 = 0x7752
-0x4E78 = 0x7756
-0x4E79 = 0x7757
-0x4E7A = 0x775C
-0x4E7B = 0x775E
-0x4E7C = 0x775F
-0x4E7D = 0x7760
-0x4E7E = 0x7762
-0x4F21 = 0x7764
-0x4F22 = 0x7767
-0x4F23 = 0x776A
-0x4F24 = 0x776C
-0x4F25 = 0x7770
-0x4F26 = 0x7772
-0x4F27 = 0x7773
-0x4F28 = 0x7774
-0x4F29 = 0x777A
-0x4F2A = 0x777D
-0x4F2B = 0x7780
-0x4F2C = 0x7784
-0x4F2D = 0x778C
-0x4F2E = 0x778D
-0x4F2F = 0x7794
-0x4F30 = 0x7795
-0x4F31 = 0x7796
-0x4F32 = 0x779A
-0x4F33 = 0x779F
-0x4F34 = 0x77A2
-0x4F35 = 0x77A7
-0x4F36 = 0x77AA
-0x4F37 = 0x77AE
-0x4F38 = 0x77AF
-0x4F39 = 0x77B1
-0x4F3A = 0x77B5
-0x4F3B = 0x77BE
-0x4F3C = 0x77C3
-0x4F3D = 0x77C9
-0x4F3E = 0x77D1
-0x4F3F = 0x77D2
-0x4F40 = 0x77D5
-0x4F41 = 0x77D9
-0x4F42 = 0x77DE
-0x4F43 = 0x77DF
-0x4F44 = 0x77E0
-0x4F45 = 0x77E4
-0x4F46 = 0x77E6
-0x4F47 = 0x77EA
-0x4F48 = 0x77EC
-0x4F49 = 0x77F0
-0x4F4A = 0x77F1
-0x4F4B = 0x77F4
-0x4F4C = 0x77F8
-0x4F4D = 0x77FB
-0x4F4E = 0x7805
-0x4F4F = 0x7806
-0x4F50 = 0x7809
-0x4F51 = 0x780D
-0x4F52 = 0x780E
-0x4F53 = 0x7811
-0x4F54 = 0x781D
-0x4F55 = 0x7821
-0x4F56 = 0x7822
-0x4F57 = 0x7823
-0x4F58 = 0x782D
-0x4F59 = 0x782E
-0x4F5A = 0x7830
-0x4F5B = 0x7835
-0x4F5C = 0x7837
-0x4F5D = 0x7843
-0x4F5E = 0x7844
-0x4F5F = 0x7847
-0x4F60 = 0x7848
-0x4F61 = 0x784C
-0x4F62 = 0x784E
-0x4F63 = 0x7852
-0x4F64 = 0x785C
-0x4F65 = 0x785E
-0x4F66 = 0x7860
-0x4F67 = 0x7861
-0x4F68 = 0x7863
-0x4F69 = 0x7864
-0x4F6A = 0x7868
-0x4F6B = 0x786A
-0x4F6C = 0x786E
-0x4F6D = 0x787A
-0x4F6E = 0x787E
-0x4F6F = 0x788A
-0x4F70 = 0x788F
-0x4F71 = 0x7894
-0x4F72 = 0x7898
-0x4F73 = 0x78A1
-0x4F74 = 0x789D
-0x4F75 = 0x789E
-0x4F76 = 0x789F
-0x4F77 = 0x78A4
-0x4F78 = 0x78A8
-0x4F79 = 0x78AC
-0x4F7A = 0x78AD
-0x4F7B = 0x78B0
-0x4F7C = 0x78B1
-0x4F7D = 0x78B2
-0x4F7E = 0x78B3
-0x5021 = 0x78BB
-0x5022 = 0x78BD
-0x5023 = 0x78BF
-0x5024 = 0x78C7
-0x5025 = 0x78C8
-0x5026 = 0x78C9
-0x5027 = 0x78CC
-0x5028 = 0x78CE
-0x5029 = 0x78D2
-0x502A = 0x78D3
-0x502B = 0x78D5
-0x502C = 0x78D6
-0x502D = 0x78E4
-0x502E = 0x78DB
-0x502F = 0x78DF
-0x5030 = 0x78E0
-0x5031 = 0x78E1
-0x5032 = 0x78E6
-0x5033 = 0x78EA
-0x5034 = 0x78F2
-0x5035 = 0x78F3
-0x5036 = 0x7900
-0x5037 = 0x78F6
-0x5038 = 0x78F7
-0x5039 = 0x78FA
-0x503A = 0x78FB
-0x503B = 0x78FF
-0x503C = 0x7906
-0x503D = 0x790C
-0x503E = 0x7910
-0x503F = 0x791A
-0x5040 = 0x791C
-0x5041 = 0x791E
-0x5042 = 0x791F
-0x5043 = 0x7920
-0x5044 = 0x7925
-0x5045 = 0x7927
-0x5046 = 0x7929
-0x5047 = 0x792D
-0x5048 = 0x7931
-0x5049 = 0x7934
-0x504A = 0x7935
-0x504B = 0x793B
-0x504C = 0x793D
-0x504D = 0x793F
-0x504E = 0x7944
-0x504F = 0x7945
-0x5050 = 0x7946
-0x5051 = 0x794A
-0x5052 = 0x794B
-0x5053 = 0x794F
-0x5054 = 0x7951
-0x5055 = 0x7954
-0x5056 = 0x7958
-0x5057 = 0x795B
-0x5058 = 0x795C
-0x5059 = 0x7967
-0x505A = 0x7969
-0x505B = 0x796B
-0x505C = 0x7972
-0x505D = 0x7979
-0x505E = 0x797B
-0x505F = 0x797C
-0x5060 = 0x797E
-0x5061 = 0x798B
-0x5062 = 0x798C
-0x5063 = 0x7991
-0x5064 = 0x7993
-0x5065 = 0x7994
-0x5066 = 0x7995
-0x5067 = 0x7996
-0x5068 = 0x7998
-0x5069 = 0x799B
-0x506A = 0x799C
-0x506B = 0x79A1
-0x506C = 0x79A8
-0x506D = 0x79A9
-0x506E = 0x79AB
-0x506F = 0x79AF
-0x5070 = 0x79B1
-0x5071 = 0x79B4
-0x5072 = 0x79B8
-0x5073 = 0x79BB
-0x5074 = 0x79C2
-0x5075 = 0x79C4
-0x5076 = 0x79C7
-0x5077 = 0x79C8
-0x5078 = 0x79CA
-0x5079 = 0x79CF
-0x507A = 0x79D4
-0x507B = 0x79D6
-0x507C = 0x79DA
-0x507D = 0x79DD
-0x507E = 0x79DE
-0x5121 = 0x79E0
-0x5122 = 0x79E2
-0x5123 = 0x79E5
-0x5124 = 0x79EA
-0x5125 = 0x79EB
-0x5126 = 0x79ED
-0x5127 = 0x79F1
-0x5128 = 0x79F8
-0x5129 = 0x79FC
-0x512A = 0x7A02
-0x512B = 0x7A03
-0x512C = 0x7A07
-0x512D = 0x7A09
-0x512E = 0x7A0A
-0x512F = 0x7A0C
-0x5130 = 0x7A11
-0x5131 = 0x7A15
-0x5132 = 0x7A1B
-0x5133 = 0x7A1E
-0x5134 = 0x7A21
-0x5135 = 0x7A27
-0x5136 = 0x7A2B
-0x5137 = 0x7A2D
-0x5138 = 0x7A2F
-0x5139 = 0x7A30
-0x513A = 0x7A34
-0x513B = 0x7A35
-0x513C = 0x7A38
-0x513D = 0x7A39
-0x513E = 0x7A3A
-0x513F = 0x7A44
-0x5140 = 0x7A45
-0x5141 = 0x7A47
-0x5142 = 0x7A48
-0x5143 = 0x7A4C
-0x5144 = 0x7A55
-0x5145 = 0x7A56
-0x5146 = 0x7A59
-0x5147 = 0x7A5C
-0x5148 = 0x7A5D
-0x5149 = 0x7A5F
-0x514A = 0x7A60
-0x514B = 0x7A65
-0x514C = 0x7A67
-0x514D = 0x7A6A
-0x514E = 0x7A6D
-0x514F = 0x7A75
-0x5150 = 0x7A78
-0x5151 = 0x7A7E
-0x5152 = 0x7A80
-0x5153 = 0x7A82
-0x5154 = 0x7A85
-0x5155 = 0x7A86
-0x5156 = 0x7A8A
-0x5157 = 0x7A8B
-0x5158 = 0x7A90
-0x5159 = 0x7A91
-0x515A = 0x7A94
-0x515B = 0x7A9E
-0x515C = 0x7AA0
-0x515D = 0x7AA3
-0x515E = 0x7AAC
-0x515F = 0x7AB3
-0x5160 = 0x7AB5
-0x5161 = 0x7AB9
-0x5162 = 0x7ABB
-0x5163 = 0x7ABC
-0x5164 = 0x7AC6
-0x5165 = 0x7AC9
-0x5166 = 0x7ACC
-0x5167 = 0x7ACE
-0x5168 = 0x7AD1
-0x5169 = 0x7ADB
-0x516A = 0x7AE8
-0x516B = 0x7AE9
-0x516C = 0x7AEB
-0x516D = 0x7AEC
-0x516E = 0x7AF1
-0x516F = 0x7AF4
-0x5170 = 0x7AFB
-0x5171 = 0x7AFD
-0x5172 = 0x7AFE
-0x5173 = 0x7B07
-0x5174 = 0x7B14
-0x5175 = 0x7B1F
-0x5176 = 0x7B23
-0x5177 = 0x7B27
-0x5178 = 0x7B29
-0x5179 = 0x7B2A
-0x517A = 0x7B2B
-0x517B = 0x7B2D
-0x517C = 0x7B2E
-0x517D = 0x7B2F
-0x517E = 0x7B30
-0x5221 = 0x7B31
-0x5222 = 0x7B34
-0x5223 = 0x7B3D
-0x5224 = 0x7B3F
-0x5225 = 0x7B40
-0x5226 = 0x7B41
-0x5227 = 0x7B47
-0x5228 = 0x7B4E
-0x5229 = 0x7B55
-0x522A = 0x7B60
-0x522B = 0x7B64
-0x522C = 0x7B66
-0x522D = 0x7B69
-0x522E = 0x7B6A
-0x522F = 0x7B6D
-0x5230 = 0x7B6F
-0x5231 = 0x7B72
-0x5232 = 0x7B73
-0x5233 = 0x7B77
-0x5234 = 0x7B84
-0x5235 = 0x7B89
-0x5236 = 0x7B8E
-0x5237 = 0x7B90
-0x5238 = 0x7B91
-0x5239 = 0x7B96
-0x523A = 0x7B9B
-0x523B = 0x7B9E
-0x523C = 0x7BA0
-0x523D = 0x7BA5
-0x523E = 0x7BAC
-0x523F = 0x7BAF
-0x5240 = 0x7BB0
-0x5241 = 0x7BB2
-0x5242 = 0x7BB5
-0x5243 = 0x7BB6
-0x5244 = 0x7BBA
-0x5245 = 0x7BBB
-0x5246 = 0x7BBC
-0x5247 = 0x7BBD
-0x5248 = 0x7BC2
-0x5249 = 0x7BC5
-0x524A = 0x7BC8
-0x524B = 0x7BCA
-0x524C = 0x7BD4
-0x524D = 0x7BD6
-0x524E = 0x7BD7
-0x524F = 0x7BD9
-0x5250 = 0x7BDA
-0x5251 = 0x7BDB
-0x5252 = 0x7BE8
-0x5253 = 0x7BEA
-0x5254 = 0x7BF2
-0x5255 = 0x7BF4
-0x5256 = 0x7BF5
-0x5257 = 0x7BF8
-0x5258 = 0x7BF9
-0x5259 = 0x7BFA
-0x525A = 0x7BFC
-0x525B = 0x7BFE
-0x525C = 0x7C01
-0x525D = 0x7C02
-0x525E = 0x7C03
-0x525F = 0x7C04
-0x5260 = 0x7C06
-0x5261 = 0x7C09
-0x5262 = 0x7C0B
-0x5263 = 0x7C0C
-0x5264 = 0x7C0E
-0x5265 = 0x7C0F
-0x5266 = 0x7C19
-0x5267 = 0x7C1B
-0x5268 = 0x7C20
-0x5269 = 0x7C25
-0x526A = 0x7C26
-0x526B = 0x7C28
-0x526C = 0x7C2C
-0x526D = 0x7C31
-0x526E = 0x7C33
-0x526F = 0x7C34
-0x5270 = 0x7C36
-0x5271 = 0x7C39
-0x5272 = 0x7C3A
-0x5273 = 0x7C46
-0x5274 = 0x7C4A
-0x5275 = 0x7C55
-0x5276 = 0x7C51
-0x5277 = 0x7C52
-0x5278 = 0x7C53
-0x5279 = 0x7C59
-0x527A = 0x7C5A
-0x527B = 0x7C5B
-0x527C = 0x7C5C
-0x527D = 0x7C5D
-0x527E = 0x7C5E
-0x5321 = 0x7C61
-0x5322 = 0x7C63
-0x5323 = 0x7C67
-0x5324 = 0x7C69
-0x5325 = 0x7C6D
-0x5326 = 0x7C6E
-0x5327 = 0x7C70
-0x5328 = 0x7C72
-0x5329 = 0x7C79
-0x532A = 0x7C7C
-0x532B = 0x7C7D
-0x532C = 0x7C86
-0x532D = 0x7C87
-0x532E = 0x7C8F
-0x532F = 0x7C94
-0x5330 = 0x7C9E
-0x5331 = 0x7CA0
-0x5332 = 0x7CA6
-0x5333 = 0x7CB0
-0x5334 = 0x7CB6
-0x5335 = 0x7CB7
-0x5336 = 0x7CBA
-0x5337 = 0x7CBB
-0x5338 = 0x7CBC
-0x5339 = 0x7CBF
-0x533A = 0x7CC4
-0x533B = 0x7CC7
-0x533C = 0x7CC8
-0x533D = 0x7CC9
-0x533E = 0x7CCD
-0x533F = 0x7CCF
-0x5340 = 0x7CD3
-0x5341 = 0x7CD4
-0x5342 = 0x7CD5
-0x5343 = 0x7CD7
-0x5344 = 0x7CD9
-0x5345 = 0x7CDA
-0x5346 = 0x7CDD
-0x5347 = 0x7CE6
-0x5348 = 0x7CE9
-0x5349 = 0x7CEB
-0x534A = 0x7CF5
-0x534B = 0x7D03
-0x534C = 0x7D07
-0x534D = 0x7D08
-0x534E = 0x7D09
-0x534F = 0x7D0F
-0x5350 = 0x7D11
-0x5351 = 0x7D12
-0x5352 = 0x7D13
-0x5353 = 0x7D16
-0x5354 = 0x7D1D
-0x5355 = 0x7D1E
-0x5356 = 0x7D23
-0x5357 = 0x7D26
-0x5358 = 0x7D2A
-0x5359 = 0x7D2D
-0x535A = 0x7D31
-0x535B = 0x7D3C
-0x535C = 0x7D3D
-0x535D = 0x7D3E
-0x535E = 0x7D40
-0x535F = 0x7D41
-0x5360 = 0x7D47
-0x5361 = 0x7D48
-0x5362 = 0x7D4D
-0x5363 = 0x7D51
-0x5364 = 0x7D53
-0x5365 = 0x7D57
-0x5366 = 0x7D59
-0x5367 = 0x7D5A
-0x5368 = 0x7D5C
-0x5369 = 0x7D5D
-0x536A = 0x7D65
-0x536B = 0x7D67
-0x536C = 0x7D6A
-0x536D = 0x7D70
-0x536E = 0x7D78
-0x536F = 0x7D7A
-0x5370 = 0x7D7B
-0x5371 = 0x7D7F
-0x5372 = 0x7D81
-0x5373 = 0x7D82
-0x5374 = 0x7D83
-0x5375 = 0x7D85
-0x5376 = 0x7D86
-0x5377 = 0x7D88
-0x5378 = 0x7D8B
-0x5379 = 0x7D8C
-0x537A = 0x7D8D
-0x537B = 0x7D91
-0x537C = 0x7D96
-0x537D = 0x7D97
-0x537E = 0x7D9D
-0x5421 = 0x7D9E
-0x5422 = 0x7DA6
-0x5423 = 0x7DA7
-0x5424 = 0x7DAA
-0x5425 = 0x7DB3
-0x5426 = 0x7DB6
-0x5427 = 0x7DB7
-0x5428 = 0x7DB9
-0x5429 = 0x7DC2
-0x542A = 0x7DC3
-0x542B = 0x7DC4
-0x542C = 0x7DC5
-0x542D = 0x7DC6
-0x542E = 0x7DCC
-0x542F = 0x7DCD
-0x5430 = 0x7DCE
-0x5431 = 0x7DD7
-0x5432 = 0x7DD9
-0x5433 = 0x7E00
-0x5434 = 0x7DE2
-0x5435 = 0x7DE5
-0x5436 = 0x7DE6
-0x5437 = 0x7DEA
-0x5438 = 0x7DEB
-0x5439 = 0x7DED
-0x543A = 0x7DF1
-0x543B = 0x7DF5
-0x543C = 0x7DF6
-0x543D = 0x7DF9
-0x543E = 0x7DFA
-0x543F = 0x7E08
-0x5440 = 0x7E10
-0x5441 = 0x7E11
-0x5442 = 0x7E15
-0x5443 = 0x7E17
-0x5444 = 0x7E1C
-0x5445 = 0x7E1D
-0x5446 = 0x7E20
-0x5447 = 0x7E27
-0x5448 = 0x7E28
-0x5449 = 0x7E2C
-0x544A = 0x7E2D
-0x544B = 0x7E2F
-0x544C = 0x7E33
-0x544D = 0x7E36
-0x544E = 0x7E3F
-0x544F = 0x7E44
-0x5450 = 0x7E45
-0x5451 = 0x7E47
-0x5452 = 0x7E4E
-0x5453 = 0x7E50
-0x5454 = 0x7E52
-0x5455 = 0x7E58
-0x5456 = 0x7E5F
-0x5457 = 0x7E61
-0x5458 = 0x7E62
-0x5459 = 0x7E65
-0x545A = 0x7E6B
-0x545B = 0x7E6E
-0x545C = 0x7E6F
-0x545D = 0x7E73
-0x545E = 0x7E78
-0x545F = 0x7E7E
-0x5460 = 0x7E81
-0x5461 = 0x7E86
-0x5462 = 0x7E87
-0x5463 = 0x7E8A
-0x5464 = 0x7E8D
-0x5465 = 0x7E91
-0x5466 = 0x7E95
-0x5467 = 0x7E98
-0x5468 = 0x7E9A
-0x5469 = 0x7E9D
-0x546A = 0x7E9E
-0x546B = 0x7F3C
-0x546C = 0x7F3B
-0x546D = 0x7F3D
-0x546E = 0x7F3E
-0x546F = 0x7F3F
-0x5470 = 0x7F43
-0x5471 = 0x7F44
-0x5472 = 0x7F47
-0x5473 = 0x7F4F
-0x5474 = 0x7F52
-0x5475 = 0x7F53
-0x5476 = 0x7F5B
-0x5477 = 0x7F5C
-0x5478 = 0x7F5D
-0x5479 = 0x7F61
-0x547A = 0x7F63
-0x547B = 0x7F64
-0x547C = 0x7F65
-0x547D = 0x7F66
-0x547E = 0x7F6D
-0x5521 = 0x7F71
-0x5522 = 0x7F7D
-0x5523 = 0x7F7E
-0x5524 = 0x7F7F
-0x5525 = 0x7F80
-0x5526 = 0x7F8B
-0x5527 = 0x7F8D
-0x5528 = 0x7F8F
-0x5529 = 0x7F90
-0x552A = 0x7F91
-0x552B = 0x7F96
-0x552C = 0x7F97
-0x552D = 0x7F9C
-0x552E = 0x7FA1
-0x552F = 0x7FA2
-0x5530 = 0x7FA6
-0x5531 = 0x7FAA
-0x5532 = 0x7FAD
-0x5533 = 0x7FB4
-0x5534 = 0x7FBC
-0x5535 = 0x7FBF
-0x5536 = 0x7FC0
-0x5537 = 0x7FC3
-0x5538 = 0x7FC8
-0x5539 = 0x7FCE
-0x553A = 0x7FCF
-0x553B = 0x7FDB
-0x553C = 0x7FDF
-0x553D = 0x7FE3
-0x553E = 0x7FE5
-0x553F = 0x7FE8
-0x5540 = 0x7FEC
-0x5541 = 0x7FEE
-0x5542 = 0x7FEF
-0x5543 = 0x7FF2
-0x5544 = 0x7FFA
-0x5545 = 0x7FFD
-0x5546 = 0x7FFE
-0x5547 = 0x7FFF
-0x5548 = 0x8007
-0x5549 = 0x8008
-0x554A = 0x800A
-0x554B = 0x800D
-0x554C = 0x800E
-0x554D = 0x800F
-0x554E = 0x8011
-0x554F = 0x8013
-0x5550 = 0x8014
-0x5551 = 0x8016
-0x5552 = 0x801D
-0x5553 = 0x801E
-0x5554 = 0x801F
-0x5555 = 0x8020
-0x5556 = 0x8024
-0x5557 = 0x8026
-0x5558 = 0x802C
-0x5559 = 0x802E
-0x555A = 0x8030
-0x555B = 0x8034
-0x555C = 0x8035
-0x555D = 0x8037
-0x555E = 0x8039
-0x555F = 0x803A
-0x5560 = 0x803C
-0x5561 = 0x803E
-0x5562 = 0x8040
-0x5563 = 0x8044
-0x5564 = 0x8060
-0x5565 = 0x8064
-0x5566 = 0x8066
-0x5567 = 0x806D
-0x5568 = 0x8071
-0x5569 = 0x8075
-0x556A = 0x8081
-0x556B = 0x8088
-0x556C = 0x808E
-0x556D = 0x809C
-0x556E = 0x809E
-0x556F = 0x80A6
-0x5570 = 0x80A7
-0x5571 = 0x80AB
-0x5572 = 0x80B8
-0x5573 = 0x80B9
-0x5574 = 0x80C8
-0x5575 = 0x80CD
-0x5576 = 0x80CF
-0x5577 = 0x80D2
-0x5578 = 0x80D4
-0x5579 = 0x80D5
-0x557A = 0x80D7
-0x557B = 0x80D8
-0x557C = 0x80E0
-0x557D = 0x80ED
-0x557E = 0x80EE
-0x5621 = 0x80F0
-0x5622 = 0x80F2
-0x5623 = 0x80F3
-0x5624 = 0x80F6
-0x5625 = 0x80F9
-0x5626 = 0x80FA
-0x5627 = 0x80FE
-0x5628 = 0x8103
-0x5629 = 0x810B
-0x562A = 0x8116
-0x562B = 0x8117
-0x562C = 0x8118
-0x562D = 0x811C
-0x562E = 0x811E
-0x562F = 0x8120
-0x5630 = 0x8124
-0x5631 = 0x8127
-0x5632 = 0x812C
-0x5633 = 0x8130
-0x5634 = 0x8135
-0x5635 = 0x813A
-0x5636 = 0x813C
-0x5637 = 0x8145
-0x5638 = 0x8147
-0x5639 = 0x814A
-0x563A = 0x814C
-0x563B = 0x8152
-0x563C = 0x8157
-0x563D = 0x8160
-0x563E = 0x8161
-0x563F = 0x8167
-0x5640 = 0x8168
-0x5641 = 0x8169
-0x5642 = 0x816D
-0x5643 = 0x816F
-0x5644 = 0x8177
-0x5645 = 0x8181
-0x5646 = 0x8190
-0x5647 = 0x8184
-0x5648 = 0x8185
-0x5649 = 0x8186
-0x564A = 0x818B
-0x564B = 0x818E
-0x564C = 0x8196
-0x564D = 0x8198
-0x564E = 0x819B
-0x564F = 0x819E
-0x5650 = 0x81A2
-0x5651 = 0x81AE
-0x5652 = 0x81B2
-0x5653 = 0x81B4
-0x5654 = 0x81BB
-0x5655 = 0x81CB
-0x5656 = 0x81C3
-0x5657 = 0x81C5
-0x5658 = 0x81CA
-0x5659 = 0x81CE
-0x565A = 0x81CF
-0x565B = 0x81D5
-0x565C = 0x81D7
-0x565D = 0x81DB
-0x565E = 0x81DD
-0x565F = 0x81DE
-0x5660 = 0x81E1
-0x5661 = 0x81E4
-0x5662 = 0x81EB
-0x5663 = 0x81EC
-0x5664 = 0x81F0
-0x5665 = 0x81F1
-0x5666 = 0x81F2
-0x5667 = 0x81F5
-0x5668 = 0x81F6
-0x5669 = 0x81F8
-0x566A = 0x81F9
-0x566B = 0x81FD
-0x566C = 0x81FF
-0x566D = 0x8200
-0x566E = 0x8203
-0x566F = 0x820F
-0x5670 = 0x8213
-0x5671 = 0x8214
-0x5672 = 0x8219
-0x5673 = 0x821A
-0x5674 = 0x821D
-0x5675 = 0x8221
-0x5676 = 0x8222
-0x5677 = 0x8228
-0x5678 = 0x8232
-0x5679 = 0x8234
-0x567A = 0x823A
-0x567B = 0x8243
-0x567C = 0x8244
-0x567D = 0x8245
-0x567E = 0x8246
-0x5721 = 0x824B
-0x5722 = 0x824E
-0x5723 = 0x824F
-0x5724 = 0x8251
-0x5725 = 0x8256
-0x5726 = 0x825C
-0x5727 = 0x8260
-0x5728 = 0x8263
-0x5729 = 0x8267
-0x572A = 0x826D
-0x572B = 0x8274
-0x572C = 0x827B
-0x572D = 0x827D
-0x572E = 0x827F
-0x572F = 0x8280
-0x5730 = 0x8281
-0x5731 = 0x8283
-0x5732 = 0x8284
-0x5733 = 0x8287
-0x5734 = 0x8289
-0x5735 = 0x828A
-0x5736 = 0x828E
-0x5737 = 0x8291
-0x5738 = 0x8294
-0x5739 = 0x8296
-0x573A = 0x8298
-0x573B = 0x829A
-0x573C = 0x829B
-0x573D = 0x82A0
-0x573E = 0x82A1
-0x573F = 0x82A3
-0x5740 = 0x82A4
-0x5741 = 0x82A7
-0x5742 = 0x82A8
-0x5743 = 0x82A9
-0x5744 = 0x82AA
-0x5745 = 0x82AE
-0x5746 = 0x82B0
-0x5747 = 0x82B2
-0x5748 = 0x82B4
-0x5749 = 0x82B7
-0x574A = 0x82BA
-0x574B = 0x82BC
-0x574C = 0x82BE
-0x574D = 0x82BF
-0x574E = 0x82C6
-0x574F = 0x82D0
-0x5750 = 0x82D5
-0x5751 = 0x82DA
-0x5752 = 0x82E0
-0x5753 = 0x82E2
-0x5754 = 0x82E4
-0x5755 = 0x82E8
-0x5756 = 0x82EA
-0x5757 = 0x82ED
-0x5758 = 0x82EF
-0x5759 = 0x82F6
-0x575A = 0x82F7
-0x575B = 0x82FD
-0x575C = 0x82FE
-0x575D = 0x8300
-0x575E = 0x8301
-0x575F = 0x8307
-0x5760 = 0x8308
-0x5761 = 0x830A
-0x5762 = 0x830B
-0x5763 = 0x8354
-0x5764 = 0x831B
-0x5765 = 0x831D
-0x5766 = 0x831E
-0x5767 = 0x831F
-0x5768 = 0x8321
-0x5769 = 0x8322
-0x576A = 0x832C
-0x576B = 0x832D
-0x576C = 0x832E
-0x576D = 0x8330
-0x576E = 0x8333
-0x576F = 0x8337
-0x5770 = 0x833A
-0x5771 = 0x833C
-0x5772 = 0x833D
-0x5773 = 0x8342
-0x5774 = 0x8343
-0x5775 = 0x8344
-0x5776 = 0x8347
-0x5777 = 0x834D
-0x5778 = 0x834E
-0x5779 = 0x8351
-0x577A = 0x8355
-0x577B = 0x8356
-0x577C = 0x8357
-0x577D = 0x8370
-0x577E = 0x8378
-0x5821 = 0x837D
-0x5822 = 0x837F
-0x5823 = 0x8380
-0x5824 = 0x8382
-0x5825 = 0x8384
-0x5826 = 0x8386
-0x5827 = 0x838D
-0x5828 = 0x8392
-0x5829 = 0x8394
-0x582A = 0x8395
-0x582B = 0x8398
-0x582C = 0x8399
-0x582D = 0x839B
-0x582E = 0x839C
-0x582F = 0x839D
-0x5830 = 0x83A6
-0x5831 = 0x83A7
-0x5832 = 0x83A9
-0x5833 = 0x83AC
-0x5834 = 0x83BE
-0x5835 = 0x83BF
-0x5836 = 0x83C0
-0x5837 = 0x83C7
-0x5838 = 0x83C9
-0x5839 = 0x83CF
-0x583A = 0x83D0
-0x583B = 0x83D1
-0x583C = 0x83D4
-0x583D = 0x83DD
-0x583E = 0x8353
-0x583F = 0x83E8
-0x5840 = 0x83EA
-0x5841 = 0x83F6
-0x5842 = 0x83F8
-0x5843 = 0x83F9
-0x5844 = 0x83FC
-0x5845 = 0x8401
-0x5846 = 0x8406
-0x5847 = 0x840A
-0x5848 = 0x840F
-0x5849 = 0x8411
-0x584A = 0x8415
-0x584B = 0x8419
-0x584C = 0x83AD
-0x584D = 0x842F
-0x584E = 0x8439
-0x584F = 0x8445
-0x5850 = 0x8447
-0x5851 = 0x8448
-0x5852 = 0x844A
-0x5853 = 0x844D
-0x5854 = 0x844F
-0x5855 = 0x8451
-0x5856 = 0x8452
-0x5857 = 0x8456
-0x5858 = 0x8458
-0x5859 = 0x8459
-0x585A = 0x845A
-0x585B = 0x845C
-0x585C = 0x8460
-0x585D = 0x8464
-0x585E = 0x8465
-0x585F = 0x8467
-0x5860 = 0x846A
-0x5861 = 0x8470
-0x5862 = 0x8473
-0x5863 = 0x8474
-0x5864 = 0x8476
-0x5865 = 0x8478
-0x5866 = 0x847C
-0x5867 = 0x847D
-0x5868 = 0x8481
-0x5869 = 0x8485
-0x586A = 0x8492
-0x586B = 0x8493
-0x586C = 0x8495
-0x586D = 0x849E
-0x586E = 0x84A6
-0x586F = 0x84A8
-0x5870 = 0x84A9
-0x5871 = 0x84AA
-0x5872 = 0x84AF
-0x5873 = 0x84B1
-0x5874 = 0x84B4
-0x5875 = 0x84BA
-0x5876 = 0x84BD
-0x5877 = 0x84BE
-0x5878 = 0x84C0
-0x5879 = 0x84C2
-0x587A = 0x84C7
-0x587B = 0x84C8
-0x587C = 0x84CC
-0x587D = 0x84CF
-0x587E = 0x84D3
-0x5921 = 0x84DC
-0x5922 = 0x84E7
-0x5923 = 0x84EA
-0x5924 = 0x84EF
-0x5925 = 0x84F0
-0x5926 = 0x84F1
-0x5927 = 0x84F2
-0x5928 = 0x84F7
-0x5929 = 0x8532
-0x592A = 0x84FA
-0x592B = 0x84FB
-0x592C = 0x84FD
-0x592D = 0x8502
-0x592E = 0x8503
-0x592F = 0x8507
-0x5930 = 0x850C
-0x5931 = 0x850E
-0x5932 = 0x8510
-0x5933 = 0x851C
-0x5934 = 0x851E
-0x5935 = 0x8522
-0x5936 = 0x8523
-0x5937 = 0x8524
-0x5938 = 0x8525
-0x5939 = 0x8527
-0x593A = 0x852A
-0x593B = 0x852B
-0x593C = 0x852F
-0x593D = 0x8533
-0x593E = 0x8534
-0x593F = 0x8536
-0x5940 = 0x853F
-0x5941 = 0x8546
-0x5942 = 0x854F
-0x5943 = 0x8550
-0x5944 = 0x8551
-0x5945 = 0x8552
-0x5946 = 0x8553
-0x5947 = 0x8556
-0x5948 = 0x8559
-0x5949 = 0x855C
-0x594A = 0x855D
-0x594B = 0x855E
-0x594C = 0x855F
-0x594D = 0x8560
-0x594E = 0x8561
-0x594F = 0x8562
-0x5950 = 0x8564
-0x5951 = 0x856B
-0x5952 = 0x856F
-0x5953 = 0x8579
-0x5954 = 0x857A
-0x5955 = 0x857B
-0x5956 = 0x857D
-0x5957 = 0x857F
-0x5958 = 0x8581
-0x5959 = 0x8585
-0x595A = 0x8586
-0x595B = 0x8589
-0x595C = 0x858B
-0x595D = 0x858C
-0x595E = 0x858F
-0x595F = 0x8593
-0x5960 = 0x8598
-0x5961 = 0x859D
-0x5962 = 0x859F
-0x5963 = 0x85A0
-0x5964 = 0x85A2
-0x5965 = 0x85A5
-0x5966 = 0x85A7
-0x5967 = 0x85B4
-0x5968 = 0x85B6
-0x5969 = 0x85B7
-0x596A = 0x85B8
-0x596B = 0x85BC
-0x596C = 0x85BD
-0x596D = 0x85BE
-0x596E = 0x85BF
-0x596F = 0x85C2
-0x5970 = 0x85C7
-0x5971 = 0x85CA
-0x5972 = 0x85CB
-0x5973 = 0x85CE
-0x5974 = 0x85AD
-0x5975 = 0x85D8
-0x5976 = 0x85DA
-0x5977 = 0x85DF
-0x5978 = 0x85E0
-0x5979 = 0x85E6
-0x597A = 0x85E8
-0x597B = 0x85ED
-0x597C = 0x85F3
-0x597D = 0x85F6
-0x597E = 0x85FC
-0x5A21 = 0x85FF
-0x5A22 = 0x8600
-0x5A23 = 0x8604
-0x5A24 = 0x8605
-0x5A25 = 0x860D
-0x5A26 = 0x860E
-0x5A27 = 0x8610
-0x5A28 = 0x8611
-0x5A29 = 0x8612
-0x5A2A = 0x8618
-0x5A2B = 0x8619
-0x5A2C = 0x861B
-0x5A2D = 0x861E
-0x5A2E = 0x8621
-0x5A2F = 0x8627
-0x5A30 = 0x8629
-0x5A31 = 0x8636
-0x5A32 = 0x8638
-0x5A33 = 0x863A
-0x5A34 = 0x863C
-0x5A35 = 0x863D
-0x5A36 = 0x8640
-0x5A37 = 0x8642
-0x5A38 = 0x8646
-0x5A39 = 0x8652
-0x5A3A = 0x8653
-0x5A3B = 0x8656
-0x5A3C = 0x8657
-0x5A3D = 0x8658
-0x5A3E = 0x8659
-0x5A3F = 0x865D
-0x5A40 = 0x8660
-0x5A41 = 0x8661
-0x5A42 = 0x8662
-0x5A43 = 0x8663
-0x5A44 = 0x8664
-0x5A45 = 0x8669
-0x5A46 = 0x866C
-0x5A47 = 0x866F
-0x5A48 = 0x8675
-0x5A49 = 0x8676
-0x5A4A = 0x8677
-0x5A4B = 0x867A
-0x5A4C = 0x868D
-0x5A4D = 0x8691
-0x5A4E = 0x8696
-0x5A4F = 0x8698
-0x5A50 = 0x869A
-0x5A51 = 0x869C
-0x5A52 = 0x86A1
-0x5A53 = 0x86A6
-0x5A54 = 0x86A7
-0x5A55 = 0x86A8
-0x5A56 = 0x86AD
-0x5A57 = 0x86B1
-0x5A58 = 0x86B3
-0x5A59 = 0x86B4
-0x5A5A = 0x86B5
-0x5A5B = 0x86B7
-0x5A5C = 0x86B8
-0x5A5D = 0x86B9
-0x5A5E = 0x86BF
-0x5A5F = 0x86C0
-0x5A60 = 0x86C1
-0x5A61 = 0x86C3
-0x5A62 = 0x86C5
-0x5A63 = 0x86D1
-0x5A64 = 0x86D2
-0x5A65 = 0x86D5
-0x5A66 = 0x86D7
-0x5A67 = 0x86DA
-0x5A68 = 0x86DC
-0x5A69 = 0x86E0
-0x5A6A = 0x86E3
-0x5A6B = 0x86E5
-0x5A6C = 0x86E7
-0x5A6D = 0x8688
-0x5A6E = 0x86FA
-0x5A6F = 0x86FC
-0x5A70 = 0x86FD
-0x5A71 = 0x8704
-0x5A72 = 0x8705
-0x5A73 = 0x8707
-0x5A74 = 0x870B
-0x5A75 = 0x870E
-0x5A76 = 0x870F
-0x5A77 = 0x8710
-0x5A78 = 0x8713
-0x5A79 = 0x8714
-0x5A7A = 0x8719
-0x5A7B = 0x871E
-0x5A7C = 0x871F
-0x5A7D = 0x8721
-0x5A7E = 0x8723
-0x5B21 = 0x8728
-0x5B22 = 0x872E
-0x5B23 = 0x872F
-0x5B24 = 0x8731
-0x5B25 = 0x8732
-0x5B26 = 0x8739
-0x5B27 = 0x873A
-0x5B28 = 0x873C
-0x5B29 = 0x873D
-0x5B2A = 0x873E
-0x5B2B = 0x8740
-0x5B2C = 0x8743
-0x5B2D = 0x8745
-0x5B2E = 0x874D
-0x5B2F = 0x8758
-0x5B30 = 0x875D
-0x5B31 = 0x8761
-0x5B32 = 0x8764
-0x5B33 = 0x8765
-0x5B34 = 0x876F
-0x5B35 = 0x8771
-0x5B36 = 0x8772
-0x5B37 = 0x877B
-0x5B38 = 0x8783
-0x5B39 = 0x8784
-0x5B3A = 0x8785
-0x5B3B = 0x8786
-0x5B3C = 0x8787
-0x5B3D = 0x8788
-0x5B3E = 0x8789
-0x5B3F = 0x878B
-0x5B40 = 0x878C
-0x5B41 = 0x8790
-0x5B42 = 0x8793
-0x5B43 = 0x8795
-0x5B44 = 0x8797
-0x5B45 = 0x8798
-0x5B46 = 0x8799
-0x5B47 = 0x879E
-0x5B48 = 0x87A0
-0x5B49 = 0x87A3
-0x5B4A = 0x87A7
-0x5B4B = 0x87AC
-0x5B4C = 0x87AD
-0x5B4D = 0x87AE
-0x5B4E = 0x87B1
-0x5B4F = 0x87B5
-0x5B50 = 0x87BE
-0x5B51 = 0x87BF
-0x5B52 = 0x87C1
-0x5B53 = 0x87C8
-0x5B54 = 0x87C9
-0x5B55 = 0x87CA
-0x5B56 = 0x87CE
-0x5B57 = 0x87D5
-0x5B58 = 0x87D6
-0x5B59 = 0x87D9
-0x5B5A = 0x87DA
-0x5B5B = 0x87DC
-0x5B5C = 0x87DF
-0x5B5D = 0x87E2
-0x5B5E = 0x87E3
-0x5B5F = 0x87E4
-0x5B60 = 0x87EA
-0x5B61 = 0x87EB
-0x5B62 = 0x87ED
-0x5B63 = 0x87F1
-0x5B64 = 0x87F3
-0x5B65 = 0x87F8
-0x5B66 = 0x87FA
-0x5B67 = 0x87FF
-0x5B68 = 0x8801
-0x5B69 = 0x8803
-0x5B6A = 0x8806
-0x5B6B = 0x8809
-0x5B6C = 0x880A
-0x5B6D = 0x880B
-0x5B6E = 0x8810
-0x5B6F = 0x8819
-0x5B70 = 0x8812
-0x5B71 = 0x8813
-0x5B72 = 0x8814
-0x5B73 = 0x8818
-0x5B74 = 0x881A
-0x5B75 = 0x881B
-0x5B76 = 0x881C
-0x5B77 = 0x881E
-0x5B78 = 0x881F
-0x5B79 = 0x8828
-0x5B7A = 0x882D
-0x5B7B = 0x882E
-0x5B7C = 0x8830
-0x5B7D = 0x8832
-0x5B7E = 0x8835
-0x5C21 = 0x883A
-0x5C22 = 0x883C
-0x5C23 = 0x8841
-0x5C24 = 0x8843
-0x5C25 = 0x8845
-0x5C26 = 0x8848
-0x5C27 = 0x8849
-0x5C28 = 0x884A
-0x5C29 = 0x884B
-0x5C2A = 0x884E
-0x5C2B = 0x8851
-0x5C2C = 0x8855
-0x5C2D = 0x8856
-0x5C2E = 0x8858
-0x5C2F = 0x885A
-0x5C30 = 0x885C
-0x5C31 = 0x885F
-0x5C32 = 0x8860
-0x5C33 = 0x8864
-0x5C34 = 0x8869
-0x5C35 = 0x8871
-0x5C36 = 0x8879
-0x5C37 = 0x887B
-0x5C38 = 0x8880
-0x5C39 = 0x8898
-0x5C3A = 0x889A
-0x5C3B = 0x889B
-0x5C3C = 0x889C
-0x5C3D = 0x889F
-0x5C3E = 0x88A0
-0x5C3F = 0x88A8
-0x5C40 = 0x88AA
-0x5C41 = 0x88BA
-0x5C42 = 0x88BD
-0x5C43 = 0x88BE
-0x5C44 = 0x88C0
-0x5C45 = 0x88CA
-0x5C46 = 0x88CB
-0x5C47 = 0x88CC
-0x5C48 = 0x88CD
-0x5C49 = 0x88CE
-0x5C4A = 0x88D1
-0x5C4B = 0x88D2
-0x5C4C = 0x88D3
-0x5C4D = 0x88DB
-0x5C4E = 0x88DE
-0x5C4F = 0x88E7
-0x5C50 = 0x88EF
-0x5C51 = 0x88F0
-0x5C52 = 0x88F1
-0x5C53 = 0x88F5
-0x5C54 = 0x88F7
-0x5C55 = 0x8901
-0x5C56 = 0x8906
-0x5C57 = 0x890D
-0x5C58 = 0x890E
-0x5C59 = 0x890F
-0x5C5A = 0x8915
-0x5C5B = 0x8916
-0x5C5C = 0x8918
-0x5C5D = 0x8919
-0x5C5E = 0x891A
-0x5C5F = 0x891C
-0x5C60 = 0x8920
-0x5C61 = 0x8926
-0x5C62 = 0x8927
-0x5C63 = 0x8928
-0x5C64 = 0x8930
-0x5C65 = 0x8931
-0x5C66 = 0x8932
-0x5C67 = 0x8935
-0x5C68 = 0x8939
-0x5C69 = 0x893A
-0x5C6A = 0x893E
-0x5C6B = 0x8940
-0x5C6C = 0x8942
-0x5C6D = 0x8945
-0x5C6E = 0x8946
-0x5C6F = 0x8949
-0x5C70 = 0x894F
-0x5C71 = 0x8952
-0x5C72 = 0x8957
-0x5C73 = 0x895A
-0x5C74 = 0x895B
-0x5C75 = 0x895C
-0x5C76 = 0x8961
-0x5C77 = 0x8962
-0x5C78 = 0x8963
-0x5C79 = 0x896B
-0x5C7A = 0x896E
-0x5C7B = 0x8970
-0x5C7C = 0x8973
-0x5C7D = 0x8975
-0x5C7E = 0x897A
-0x5D21 = 0x897B
-0x5D22 = 0x897C
-0x5D23 = 0x897D
-0x5D24 = 0x8989
-0x5D25 = 0x898D
-0x5D26 = 0x8990
-0x5D27 = 0x8994
-0x5D28 = 0x8995
-0x5D29 = 0x899B
-0x5D2A = 0x899C
-0x5D2B = 0x899F
-0x5D2C = 0x89A0
-0x5D2D = 0x89A5
-0x5D2E = 0x89B0
-0x5D2F = 0x89B4
-0x5D30 = 0x89B5
-0x5D31 = 0x89B6
-0x5D32 = 0x89B7
-0x5D33 = 0x89BC
-0x5D34 = 0x89D4
-0x5D35 = 0x89D5
-0x5D36 = 0x89D6
-0x5D37 = 0x89D7
-0x5D38 = 0x89D8
-0x5D39 = 0x89E5
-0x5D3A = 0x89E9
-0x5D3B = 0x89EB
-0x5D3C = 0x89ED
-0x5D3D = 0x89F1
-0x5D3E = 0x89F3
-0x5D3F = 0x89F6
-0x5D40 = 0x89F9
-0x5D41 = 0x89FD
-0x5D42 = 0x89FF
-0x5D43 = 0x8A04
-0x5D44 = 0x8A05
-0x5D45 = 0x8A07
-0x5D46 = 0x8A0F
-0x5D47 = 0x8A11
-0x5D48 = 0x8A12
-0x5D49 = 0x8A14
-0x5D4A = 0x8A15
-0x5D4B = 0x8A1E
-0x5D4C = 0x8A20
-0x5D4D = 0x8A22
-0x5D4E = 0x8A24
-0x5D4F = 0x8A26
-0x5D50 = 0x8A2B
-0x5D51 = 0x8A2C
-0x5D52 = 0x8A2F
-0x5D53 = 0x8A35
-0x5D54 = 0x8A37
-0x5D55 = 0x8A3D
-0x5D56 = 0x8A3E
-0x5D57 = 0x8A40
-0x5D58 = 0x8A43
-0x5D59 = 0x8A45
-0x5D5A = 0x8A47
-0x5D5B = 0x8A49
-0x5D5C = 0x8A4D
-0x5D5D = 0x8A4E
-0x5D5E = 0x8A53
-0x5D5F = 0x8A56
-0x5D60 = 0x8A57
-0x5D61 = 0x8A58
-0x5D62 = 0x8A5C
-0x5D63 = 0x8A5D
-0x5D64 = 0x8A61
-0x5D65 = 0x8A65
-0x5D66 = 0x8A67
-0x5D67 = 0x8A75
-0x5D68 = 0x8A76
-0x5D69 = 0x8A77
-0x5D6A = 0x8A79
-0x5D6B = 0x8A7A
-0x5D6C = 0x8A7B
-0x5D6D = 0x8A7E
-0x5D6E = 0x8A7F
-0x5D6F = 0x8A80
-0x5D70 = 0x8A83
-0x5D71 = 0x8A86
-0x5D72 = 0x8A8B
-0x5D73 = 0x8A8F
-0x5D74 = 0x8A90
-0x5D75 = 0x8A92
-0x5D76 = 0x8A96
-0x5D77 = 0x8A97
-0x5D78 = 0x8A99
-0x5D79 = 0x8A9F
-0x5D7A = 0x8AA7
-0x5D7B = 0x8AA9
-0x5D7C = 0x8AAE
-0x5D7D = 0x8AAF
-0x5D7E = 0x8AB3
-0x5E21 = 0x8AB6
-0x5E22 = 0x8AB7
-0x5E23 = 0x8ABB
-0x5E24 = 0x8ABE
-0x5E25 = 0x8AC3
-0x5E26 = 0x8AC6
-0x5E27 = 0x8AC8
-0x5E28 = 0x8AC9
-0x5E29 = 0x8ACA
-0x5E2A = 0x8AD1
-0x5E2B = 0x8AD3
-0x5E2C = 0x8AD4
-0x5E2D = 0x8AD5
-0x5E2E = 0x8AD7
-0x5E2F = 0x8ADD
-0x5E30 = 0x8ADF
-0x5E31 = 0x8AEC
-0x5E32 = 0x8AF0
-0x5E33 = 0x8AF4
-0x5E34 = 0x8AF5
-0x5E35 = 0x8AF6
-0x5E36 = 0x8AFC
-0x5E37 = 0x8AFF
-0x5E38 = 0x8B05
-0x5E39 = 0x8B06
-0x5E3A = 0x8B0B
-0x5E3B = 0x8B11
-0x5E3C = 0x8B1C
-0x5E3D = 0x8B1E
-0x5E3E = 0x8B1F
-0x5E3F = 0x8B0A
-0x5E40 = 0x8B2D
-0x5E41 = 0x8B30
-0x5E42 = 0x8B37
-0x5E43 = 0x8B3C
-0x5E44 = 0x8B42
-0x5E45 = 0x8B43
-0x5E46 = 0x8B44
-0x5E47 = 0x8B45
-0x5E48 = 0x8B46
-0x5E49 = 0x8B48
-0x5E4A = 0x8B52
-0x5E4B = 0x8B53
-0x5E4C = 0x8B54
-0x5E4D = 0x8B59
-0x5E4E = 0x8B4D
-0x5E4F = 0x8B5E
-0x5E50 = 0x8B63
-0x5E51 = 0x8B6D
-0x5E52 = 0x8B76
-0x5E53 = 0x8B78
-0x5E54 = 0x8B79
-0x5E55 = 0x8B7C
-0x5E56 = 0x8B7E
-0x5E57 = 0x8B81
-0x5E58 = 0x8B84
-0x5E59 = 0x8B85
-0x5E5A = 0x8B8B
-0x5E5B = 0x8B8D
-0x5E5C = 0x8B8F
-0x5E5D = 0x8B94
-0x5E5E = 0x8B95
-0x5E5F = 0x8B9C
-0x5E60 = 0x8B9E
-0x5E61 = 0x8B9F
-0x5E62 = 0x8C38
-0x5E63 = 0x8C39
-0x5E64 = 0x8C3D
-0x5E65 = 0x8C3E
-0x5E66 = 0x8C45
-0x5E67 = 0x8C47
-0x5E68 = 0x8C49
-0x5E69 = 0x8C4B
-0x5E6A = 0x8C4F
-0x5E6B = 0x8C51
-0x5E6C = 0x8C53
-0x5E6D = 0x8C54
-0x5E6E = 0x8C57
-0x5E6F = 0x8C58
-0x5E70 = 0x8C5B
-0x5E71 = 0x8C5D
-0x5E72 = 0x8C59
-0x5E73 = 0x8C63
-0x5E74 = 0x8C64
-0x5E75 = 0x8C66
-0x5E76 = 0x8C68
-0x5E77 = 0x8C69
-0x5E78 = 0x8C6D
-0x5E79 = 0x8C73
-0x5E7A = 0x8C75
-0x5E7B = 0x8C76
-0x5E7C = 0x8C7B
-0x5E7D = 0x8C7E
-0x5E7E = 0x8C86
-0x5F21 = 0x8C87
-0x5F22 = 0x8C8B
-0x5F23 = 0x8C90
-0x5F24 = 0x8C92
-0x5F25 = 0x8C93
-0x5F26 = 0x8C99
-0x5F27 = 0x8C9B
-0x5F28 = 0x8C9C
-0x5F29 = 0x8CA4
-0x5F2A = 0x8CB9
-0x5F2B = 0x8CBA
-0x5F2C = 0x8CC5
-0x5F2D = 0x8CC6
-0x5F2E = 0x8CC9
-0x5F2F = 0x8CCB
-0x5F30 = 0x8CCF
-0x5F31 = 0x8CD6
-0x5F32 = 0x8CD5
-0x5F33 = 0x8CD9
-0x5F34 = 0x8CDD
-0x5F35 = 0x8CE1
-0x5F36 = 0x8CE8
-0x5F37 = 0x8CEC
-0x5F38 = 0x8CEF
-0x5F39 = 0x8CF0
-0x5F3A = 0x8CF2
-0x5F3B = 0x8CF5
-0x5F3C = 0x8CF7
-0x5F3D = 0x8CF8
-0x5F3E = 0x8CFE
-0x5F3F = 0x8CFF
-0x5F40 = 0x8D01
-0x5F41 = 0x8D03
-0x5F42 = 0x8D09
-0x5F43 = 0x8D12
-0x5F44 = 0x8D17
-0x5F45 = 0x8D1B
-0x5F46 = 0x8D65
-0x5F47 = 0x8D69
-0x5F48 = 0x8D6C
-0x5F49 = 0x8D6E
-0x5F4A = 0x8D7F
-0x5F4B = 0x8D82
-0x5F4C = 0x8D84
-0x5F4D = 0x8D88
-0x5F4E = 0x8D8D
-0x5F4F = 0x8D90
-0x5F50 = 0x8D91
-0x5F51 = 0x8D95
-0x5F52 = 0x8D9E
-0x5F53 = 0x8D9F
-0x5F54 = 0x8DA0
-0x5F55 = 0x8DA6
-0x5F56 = 0x8DAB
-0x5F57 = 0x8DAC
-0x5F58 = 0x8DAF
-0x5F59 = 0x8DB2
-0x5F5A = 0x8DB5
-0x5F5B = 0x8DB7
-0x5F5C = 0x8DB9
-0x5F5D = 0x8DBB
-0x5F5E = 0x8DC0
-0x5F5F = 0x8DC5
-0x5F60 = 0x8DC6
-0x5F61 = 0x8DC7
-0x5F62 = 0x8DC8
-0x5F63 = 0x8DCA
-0x5F64 = 0x8DCE
-0x5F65 = 0x8DD1
-0x5F66 = 0x8DD4
-0x5F67 = 0x8DD5
-0x5F68 = 0x8DD7
-0x5F69 = 0x8DD9
-0x5F6A = 0x8DE4
-0x5F6B = 0x8DE5
-0x5F6C = 0x8DE7
-0x5F6D = 0x8DEC
-0x5F6E = 0x8DF0
-0x5F6F = 0x8DBC
-0x5F70 = 0x8DF1
-0x5F71 = 0x8DF2
-0x5F72 = 0x8DF4
-0x5F73 = 0x8DFD
-0x5F74 = 0x8E01
-0x5F75 = 0x8E04
-0x5F76 = 0x8E05
-0x5F77 = 0x8E06
-0x5F78 = 0x8E0B
-0x5F79 = 0x8E11
-0x5F7A = 0x8E14
-0x5F7B = 0x8E16
-0x5F7C = 0x8E20
-0x5F7D = 0x8E21
-0x5F7E = 0x8E22
-0x6021 = 0x8E23
-0x6022 = 0x8E26
-0x6023 = 0x8E27
-0x6024 = 0x8E31
-0x6025 = 0x8E33
-0x6026 = 0x8E36
-0x6027 = 0x8E37
-0x6028 = 0x8E38
-0x6029 = 0x8E39
-0x602A = 0x8E3D
-0x602B = 0x8E40
-0x602C = 0x8E41
-0x602D = 0x8E4B
-0x602E = 0x8E4D
-0x602F = 0x8E4E
-0x6030 = 0x8E4F
-0x6031 = 0x8E54
-0x6032 = 0x8E5B
-0x6033 = 0x8E5C
-0x6034 = 0x8E5D
-0x6035 = 0x8E5E
-0x6036 = 0x8E61
-0x6037 = 0x8E62
-0x6038 = 0x8E69
-0x6039 = 0x8E6C
-0x603A = 0x8E6D
-0x603B = 0x8E6F
-0x603C = 0x8E70
-0x603D = 0x8E71
-0x603E = 0x8E79
-0x603F = 0x8E7A
-0x6040 = 0x8E7B
-0x6041 = 0x8E82
-0x6042 = 0x8E83
-0x6043 = 0x8E89
-0x6044 = 0x8E90
-0x6045 = 0x8E92
-0x6046 = 0x8E95
-0x6047 = 0x8E9A
-0x6048 = 0x8E9B
-0x6049 = 0x8E9D
-0x604A = 0x8E9E
-0x604B = 0x8EA2
-0x604C = 0x8EA7
-0x604D = 0x8EA9
-0x604E = 0x8EAD
-0x604F = 0x8EAE
-0x6050 = 0x8EB3
-0x6051 = 0x8EB5
-0x6052 = 0x8EBA
-0x6053 = 0x8EBB
-0x6054 = 0x8EC0
-0x6055 = 0x8EC1
-0x6056 = 0x8EC3
-0x6057 = 0x8EC4
-0x6058 = 0x8EC7
-0x6059 = 0x8ECF
-0x605A = 0x8ED1
-0x605B = 0x8ED4
-0x605C = 0x8EDC
-0x605D = 0x8EE8
-0x605E = 0x8EEE
-0x605F = 0x8EF0
-0x6060 = 0x8EF1
-0x6061 = 0x8EF7
-0x6062 = 0x8EF9
-0x6063 = 0x8EFA
-0x6064 = 0x8EED
-0x6065 = 0x8F00
-0x6066 = 0x8F02
-0x6067 = 0x8F07
-0x6068 = 0x8F08
-0x6069 = 0x8F0F
-0x606A = 0x8F10
-0x606B = 0x8F16
-0x606C = 0x8F17
-0x606D = 0x8F18
-0x606E = 0x8F1E
-0x606F = 0x8F20
-0x6070 = 0x8F21
-0x6071 = 0x8F23
-0x6072 = 0x8F25
-0x6073 = 0x8F27
-0x6074 = 0x8F28
-0x6075 = 0x8F2C
-0x6076 = 0x8F2D
-0x6077 = 0x8F2E
-0x6078 = 0x8F34
-0x6079 = 0x8F35
-0x607A = 0x8F36
-0x607B = 0x8F37
-0x607C = 0x8F3A
-0x607D = 0x8F40
-0x607E = 0x8F41
-0x6121 = 0x8F43
-0x6122 = 0x8F47
-0x6123 = 0x8F4F
-0x6124 = 0x8F51
-0x6125 = 0x8F52
-0x6126 = 0x8F53
-0x6127 = 0x8F54
-0x6128 = 0x8F55
-0x6129 = 0x8F58
-0x612A = 0x8F5D
-0x612B = 0x8F5E
-0x612C = 0x8F65
-0x612D = 0x8F9D
-0x612E = 0x8FA0
-0x612F = 0x8FA1
-0x6130 = 0x8FA4
-0x6131 = 0x8FA5
-0x6132 = 0x8FA6
-0x6133 = 0x8FB5
-0x6134 = 0x8FB6
-0x6135 = 0x8FB8
-0x6136 = 0x8FBE
-0x6137 = 0x8FC0
-0x6138 = 0x8FC1
-0x6139 = 0x8FC6
-0x613A = 0x8FCA
-0x613B = 0x8FCB
-0x613C = 0x8FCD
-0x613D = 0x8FD0
-0x613E = 0x8FD2
-0x613F = 0x8FD3
-0x6140 = 0x8FD5
-0x6141 = 0x8FE0
-0x6142 = 0x8FE3
-0x6143 = 0x8FE4
-0x6144 = 0x8FE8
-0x6145 = 0x8FEE
-0x6146 = 0x8FF1
-0x6147 = 0x8FF5
-0x6148 = 0x8FF6
-0x6149 = 0x8FFB
-0x614A = 0x8FFE
-0x614B = 0x9002
-0x614C = 0x9004
-0x614D = 0x9008
-0x614E = 0x900C
-0x614F = 0x9018
-0x6150 = 0x901B
-0x6151 = 0x9028
-0x6152 = 0x9029
-0x6153 = 0x902F
-0x6154 = 0x902A
-0x6155 = 0x902C
-0x6156 = 0x902D
-0x6157 = 0x9033
-0x6158 = 0x9034
-0x6159 = 0x9037
-0x615A = 0x903F
-0x615B = 0x9043
-0x615C = 0x9044
-0x615D = 0x904C
-0x615E = 0x905B
-0x615F = 0x905D
-0x6160 = 0x9062
-0x6161 = 0x9066
-0x6162 = 0x9067
-0x6163 = 0x906C
-0x6164 = 0x9070
-0x6165 = 0x9074
-0x6166 = 0x9079
-0x6167 = 0x9085
-0x6168 = 0x9088
-0x6169 = 0x908B
-0x616A = 0x908C
-0x616B = 0x908E
-0x616C = 0x9090
-0x616D = 0x9095
-0x616E = 0x9097
-0x616F = 0x9098
-0x6170 = 0x9099
-0x6171 = 0x909B
-0x6172 = 0x90A0
-0x6173 = 0x90A1
-0x6174 = 0x90A2
-0x6175 = 0x90A5
-0x6176 = 0x90B0
-0x6177 = 0x90B2
-0x6178 = 0x90B3
-0x6179 = 0x90B4
-0x617A = 0x90B6
-0x617B = 0x90BD
-0x617C = 0x90CC
-0x617D = 0x90BE
-0x617E = 0x90C3
-0x6221 = 0x90C4
-0x6222 = 0x90C5
-0x6223 = 0x90C7
-0x6224 = 0x90C8
-0x6225 = 0x90D5
-0x6226 = 0x90D7
-0x6227 = 0x90D8
-0x6228 = 0x90D9
-0x6229 = 0x90DC
-0x622A = 0x90DD
-0x622B = 0x90DF
-0x622C = 0x90E5
-0x622D = 0x90D2
-0x622E = 0x90F6
-0x622F = 0x90EB
-0x6230 = 0x90EF
-0x6231 = 0x90F0
-0x6232 = 0x90F4
-0x6233 = 0x90FE
-0x6234 = 0x90FF
-0x6235 = 0x9100
-0x6236 = 0x9104
-0x6237 = 0x9105
-0x6238 = 0x9106
-0x6239 = 0x9108
-0x623A = 0x910D
-0x623B = 0x9110
-0x623C = 0x9114
-0x623D = 0x9116
-0x623E = 0x9117
-0x623F = 0x9118
-0x6240 = 0x911A
-0x6241 = 0x911C
-0x6242 = 0x911E
-0x6243 = 0x9120
-0x6244 = 0x9125
-0x6245 = 0x9122
-0x6246 = 0x9123
-0x6247 = 0x9127
-0x6248 = 0x9129
-0x6249 = 0x912E
-0x624A = 0x912F
-0x624B = 0x9131
-0x624C = 0x9134
-0x624D = 0x9136
-0x624E = 0x9137
-0x624F = 0x9139
-0x6250 = 0x913A
-0x6251 = 0x913C
-0x6252 = 0x913D
-0x6253 = 0x9143
-0x6254 = 0x9147
-0x6255 = 0x9148
-0x6256 = 0x914F
-0x6257 = 0x9153
-0x6258 = 0x9157
-0x6259 = 0x9159
-0x625A = 0x915A
-0x625B = 0x915B
-0x625C = 0x9161
-0x625D = 0x9164
-0x625E = 0x9167
-0x625F = 0x916D
-0x6260 = 0x9174
-0x6261 = 0x9179
-0x6262 = 0x917A
-0x6263 = 0x917B
-0x6264 = 0x9181
-0x6265 = 0x9183
-0x6266 = 0x9185
-0x6267 = 0x9186
-0x6268 = 0x918A
-0x6269 = 0x918E
-0x626A = 0x9191
-0x626B = 0x9193
-0x626C = 0x9194
-0x626D = 0x9195
-0x626E = 0x9198
-0x626F = 0x919E
-0x6270 = 0x91A1
-0x6271 = 0x91A6
-0x6272 = 0x91A8
-0x6273 = 0x91AC
-0x6274 = 0x91AD
-0x6275 = 0x91AE
-0x6276 = 0x91B0
-0x6277 = 0x91B1
-0x6278 = 0x91B2
-0x6279 = 0x91B3
-0x627A = 0x91B6
-0x627B = 0x91BB
-0x627C = 0x91BC
-0x627D = 0x91BD
-0x627E = 0x91BF
-0x6321 = 0x91C2
-0x6322 = 0x91C3
-0x6323 = 0x91C5
-0x6324 = 0x91D3
-0x6325 = 0x91D4
-0x6326 = 0x91D7
-0x6327 = 0x91D9
-0x6328 = 0x91DA
-0x6329 = 0x91DE
-0x632A = 0x91E4
-0x632B = 0x91E5
-0x632C = 0x91E9
-0x632D = 0x91EA
-0x632E = 0x91EC
-0x632F = 0x91ED
-0x6330 = 0x91EE
-0x6331 = 0x91EF
-0x6332 = 0x91F0
-0x6333 = 0x91F1
-0x6334 = 0x91F7
-0x6335 = 0x91F9
-0x6336 = 0x91FB
-0x6337 = 0x91FD
-0x6338 = 0x9200
-0x6339 = 0x9201
-0x633A = 0x9204
-0x633B = 0x9205
-0x633C = 0x9206
-0x633D = 0x9207
-0x633E = 0x9209
-0x633F = 0x920A
-0x6340 = 0x920C
-0x6341 = 0x9210
-0x6342 = 0x9212
-0x6343 = 0x9213
-0x6344 = 0x9216
-0x6345 = 0x9218
-0x6346 = 0x921C
-0x6347 = 0x921D
-0x6348 = 0x9223
-0x6349 = 0x9224
-0x634A = 0x9225
-0x634B = 0x9226
-0x634C = 0x9228
-0x634D = 0x922E
-0x634E = 0x922F
-0x634F = 0x9230
-0x6350 = 0x9233
-0x6351 = 0x9235
-0x6352 = 0x9236
-0x6353 = 0x9238
-0x6354 = 0x9239
-0x6355 = 0x923A
-0x6356 = 0x923C
-0x6357 = 0x923E
-0x6358 = 0x9240
-0x6359 = 0x9242
-0x635A = 0x9243
-0x635B = 0x9246
-0x635C = 0x9247
-0x635D = 0x924A
-0x635E = 0x924D
-0x635F = 0x924E
-0x6360 = 0x924F
-0x6361 = 0x9251
-0x6362 = 0x9258
-0x6363 = 0x9259
-0x6364 = 0x925C
-0x6365 = 0x925D
-0x6366 = 0x9260
-0x6367 = 0x9261
-0x6368 = 0x9265
-0x6369 = 0x9267
-0x636A = 0x9268
-0x636B = 0x9269
-0x636C = 0x926E
-0x636D = 0x926F
-0x636E = 0x9270
-0x636F = 0x9275
-0x6370 = 0x9276
-0x6371 = 0x9277
-0x6372 = 0x9278
-0x6373 = 0x9279
-0x6374 = 0x927B
-0x6375 = 0x927C
-0x6376 = 0x927D
-0x6377 = 0x927F
-0x6378 = 0x9288
-0x6379 = 0x9289
-0x637A = 0x928A
-0x637B = 0x928D
-0x637C = 0x928E
-0x637D = 0x9292
-0x637E = 0x9297
-0x6421 = 0x9299
-0x6422 = 0x929F
-0x6423 = 0x92A0
-0x6424 = 0x92A4
-0x6425 = 0x92A5
-0x6426 = 0x92A7
-0x6427 = 0x92A8
-0x6428 = 0x92AB
-0x6429 = 0x92AF
-0x642A = 0x92B2
-0x642B = 0x92B6
-0x642C = 0x92B8
-0x642D = 0x92BA
-0x642E = 0x92BB
-0x642F = 0x92BC
-0x6430 = 0x92BD
-0x6431 = 0x92BF
-0x6432 = 0x92C0
-0x6433 = 0x92C1
-0x6434 = 0x92C2
-0x6435 = 0x92C3
-0x6436 = 0x92C5
-0x6437 = 0x92C6
-0x6438 = 0x92C7
-0x6439 = 0x92C8
-0x643A = 0x92CB
-0x643B = 0x92CC
-0x643C = 0x92CD
-0x643D = 0x92CE
-0x643E = 0x92D0
-0x643F = 0x92D3
-0x6440 = 0x92D5
-0x6441 = 0x92D7
-0x6442 = 0x92D8
-0x6443 = 0x92D9
-0x6444 = 0x92DC
-0x6445 = 0x92DD
-0x6446 = 0x92DF
-0x6447 = 0x92E0
-0x6448 = 0x92E1
-0x6449 = 0x92E3
-0x644A = 0x92E5
-0x644B = 0x92E7
-0x644C = 0x92E8
-0x644D = 0x92EC
-0x644E = 0x92EE
-0x644F = 0x92F0
-0x6450 = 0x92F9
-0x6451 = 0x92FB
-0x6452 = 0x92FF
-0x6453 = 0x9300
-0x6454 = 0x9302
-0x6455 = 0x9308
-0x6456 = 0x930D
-0x6457 = 0x9311
-0x6458 = 0x9314
-0x6459 = 0x9315
-0x645A = 0x931C
-0x645B = 0x931D
-0x645C = 0x931E
-0x645D = 0x931F
-0x645E = 0x9321
-0x645F = 0x9324
-0x6460 = 0x9325
-0x6461 = 0x9327
-0x6462 = 0x9329
-0x6463 = 0x932A
-0x6464 = 0x9333
-0x6465 = 0x9334
-0x6466 = 0x9336
-0x6467 = 0x9337
-0x6468 = 0x9347
-0x6469 = 0x9348
-0x646A = 0x9349
-0x646B = 0x9350
-0x646C = 0x9351
-0x646D = 0x9352
-0x646E = 0x9355
-0x646F = 0x9357
-0x6470 = 0x9358
-0x6471 = 0x935A
-0x6472 = 0x935E
-0x6473 = 0x9364
-0x6474 = 0x9365
-0x6475 = 0x9367
-0x6476 = 0x9369
-0x6477 = 0x936A
-0x6478 = 0x936D
-0x6479 = 0x936F
-0x647A = 0x9370
-0x647B = 0x9371
-0x647C = 0x9373
-0x647D = 0x9374
-0x647E = 0x9376
-0x6521 = 0x937A
-0x6522 = 0x937D
-0x6523 = 0x937F
-0x6524 = 0x9380
-0x6525 = 0x9381
-0x6526 = 0x9382
-0x6527 = 0x9388
-0x6528 = 0x938A
-0x6529 = 0x938B
-0x652A = 0x938D
-0x652B = 0x938F
-0x652C = 0x9392
-0x652D = 0x9395
-0x652E = 0x9398
-0x652F = 0x939B
-0x6530 = 0x939E
-0x6531 = 0x93A1
-0x6532 = 0x93A3
-0x6533 = 0x93A4
-0x6534 = 0x93A6
-0x6535 = 0x93A8
-0x6536 = 0x93AB
-0x6537 = 0x93B4
-0x6538 = 0x93B5
-0x6539 = 0x93B6
-0x653A = 0x93BA
-0x653B = 0x93A9
-0x653C = 0x93C1
-0x653D = 0x93C4
-0x653E = 0x93C5
-0x653F = 0x93C6
-0x6540 = 0x93C7
-0x6541 = 0x93C9
-0x6542 = 0x93CA
-0x6543 = 0x93CB
-0x6544 = 0x93CC
-0x6545 = 0x93CD
-0x6546 = 0x93D3
-0x6547 = 0x93D9
-0x6548 = 0x93DC
-0x6549 = 0x93DE
-0x654A = 0x93DF
-0x654B = 0x93E2
-0x654C = 0x93E6
-0x654D = 0x93E7
-0x654E = 0x93F9
-0x654F = 0x93F7
-0x6550 = 0x93F8
-0x6551 = 0x93FA
-0x6552 = 0x93FB
-0x6553 = 0x93FD
-0x6554 = 0x9401
-0x6555 = 0x9402
-0x6556 = 0x9404
-0x6557 = 0x9408
-0x6558 = 0x9409
-0x6559 = 0x940D
-0x655A = 0x940E
-0x655B = 0x940F
-0x655C = 0x9415
-0x655D = 0x9416
-0x655E = 0x9417
-0x655F = 0x941F
-0x6560 = 0x942E
-0x6561 = 0x942F
-0x6562 = 0x9431
-0x6563 = 0x9432
-0x6564 = 0x9433
-0x6565 = 0x9434
-0x6566 = 0x943B
-0x6567 = 0x943F
-0x6568 = 0x943D
-0x6569 = 0x9443
-0x656A = 0x9445
-0x656B = 0x9448
-0x656C = 0x944A
-0x656D = 0x944C
-0x656E = 0x9455
-0x656F = 0x9459
-0x6570 = 0x945C
-0x6571 = 0x945F
-0x6572 = 0x9461
-0x6573 = 0x9463
-0x6574 = 0x9468
-0x6575 = 0x946B
-0x6576 = 0x946D
-0x6577 = 0x946E
-0x6578 = 0x946F
-0x6579 = 0x9471
-0x657A = 0x9472
-0x657B = 0x9484
-0x657C = 0x9483
-0x657D = 0x9578
-0x657E = 0x9579
-0x6621 = 0x957E
-0x6622 = 0x9584
-0x6623 = 0x9588
-0x6624 = 0x958C
-0x6625 = 0x958D
-0x6626 = 0x958E
-0x6627 = 0x959D
-0x6628 = 0x959E
-0x6629 = 0x959F
-0x662A = 0x95A1
-0x662B = 0x95A6
-0x662C = 0x95A9
-0x662D = 0x95AB
-0x662E = 0x95AC
-0x662F = 0x95B4
-0x6630 = 0x95B6
-0x6631 = 0x95BA
-0x6632 = 0x95BD
-0x6633 = 0x95BF
-0x6634 = 0x95C6
-0x6635 = 0x95C8
-0x6636 = 0x95C9
-0x6637 = 0x95CB
-0x6638 = 0x95D0
-0x6639 = 0x95D1
-0x663A = 0x95D2
-0x663B = 0x95D3
-0x663C = 0x95D9
-0x663D = 0x95DA
-0x663E = 0x95DD
-0x663F = 0x95DE
-0x6640 = 0x95DF
-0x6641 = 0x95E0
-0x6642 = 0x95E4
-0x6643 = 0x95E6
-0x6644 = 0x961D
-0x6645 = 0x961E
-0x6646 = 0x9622
-0x6647 = 0x9624
-0x6648 = 0x9625
-0x6649 = 0x9626
-0x664A = 0x962C
-0x664B = 0x9631
-0x664C = 0x9633
-0x664D = 0x9637
-0x664E = 0x9638
-0x664F = 0x9639
-0x6650 = 0x963A
-0x6651 = 0x963C
-0x6652 = 0x963D
-0x6653 = 0x9641
-0x6654 = 0x9652
-0x6655 = 0x9654
-0x6656 = 0x9656
-0x6657 = 0x9657
-0x6658 = 0x9658
-0x6659 = 0x9661
-0x665A = 0x966E
-0x665B = 0x9674
-0x665C = 0x967B
-0x665D = 0x967C
-0x665E = 0x967E
-0x665F = 0x967F
-0x6660 = 0x9681
-0x6661 = 0x9682
-0x6662 = 0x9683
-0x6663 = 0x9684
-0x6664 = 0x9689
-0x6665 = 0x9691
-0x6666 = 0x9696
-0x6667 = 0x969A
-0x6668 = 0x969D
-0x6669 = 0x969F
-0x666A = 0x96A4
-0x666B = 0x96A5
-0x666C = 0x96A6
-0x666D = 0x96A9
-0x666E = 0x96AE
-0x666F = 0x96AF
-0x6670 = 0x96B3
-0x6671 = 0x96BA
-0x6672 = 0x96CA
-0x6673 = 0x96D2
-0x6674 = 0x5DB2
-0x6675 = 0x96D8
-0x6676 = 0x96DA
-0x6677 = 0x96DD
-0x6678 = 0x96DE
-0x6679 = 0x96DF
-0x667A = 0x96E9
-0x667B = 0x96EF
-0x667C = 0x96F1
-0x667D = 0x96FA
-0x667E = 0x9702
-0x6721 = 0x9703
-0x6722 = 0x9705
-0x6723 = 0x9709
-0x6724 = 0x971A
-0x6725 = 0x971B
-0x6726 = 0x971D
-0x6727 = 0x9721
-0x6728 = 0x9722
-0x6729 = 0x9723
-0x672A = 0x9728
-0x672B = 0x9731
-0x672C = 0x9733
-0x672D = 0x9741
-0x672E = 0x9743
-0x672F = 0x974A
-0x6730 = 0x974E
-0x6731 = 0x974F
-0x6732 = 0x9755
-0x6733 = 0x9757
-0x6734 = 0x9758
-0x6735 = 0x975A
-0x6736 = 0x975B
-0x6737 = 0x9763
-0x6738 = 0x9767
-0x6739 = 0x976A
-0x673A = 0x976E
-0x673B = 0x9773
-0x673C = 0x9776
-0x673D = 0x9777
-0x673E = 0x9778
-0x673F = 0x977B
-0x6740 = 0x977D
-0x6741 = 0x977F
-0x6742 = 0x9780
-0x6743 = 0x9789
-0x6744 = 0x9795
-0x6745 = 0x9796
-0x6746 = 0x9797
-0x6747 = 0x9799
-0x6748 = 0x979A
-0x6749 = 0x979E
-0x674A = 0x979F
-0x674B = 0x97A2
-0x674C = 0x97AC
-0x674D = 0x97AE
-0x674E = 0x97B1
-0x674F = 0x97B2
-0x6750 = 0x97B5
-0x6751 = 0x97B6
-0x6752 = 0x97B8
-0x6753 = 0x97B9
-0x6754 = 0x97BA
-0x6755 = 0x97BC
-0x6756 = 0x97BE
-0x6757 = 0x97BF
-0x6758 = 0x97C1
-0x6759 = 0x97C4
-0x675A = 0x97C5
-0x675B = 0x97C7
-0x675C = 0x97C9
-0x675D = 0x97CA
-0x675E = 0x97CC
-0x675F = 0x97CD
-0x6760 = 0x97CE
-0x6761 = 0x97D0
-0x6762 = 0x97D1
-0x6763 = 0x97D4
-0x6764 = 0x97D7
-0x6765 = 0x97D8
-0x6766 = 0x97D9
-0x6767 = 0x97DD
-0x6768 = 0x97DE
-0x6769 = 0x97E0
-0x676A = 0x97DB
-0x676B = 0x97E1
-0x676C = 0x97E4
-0x676D = 0x97EF
-0x676E = 0x97F1
-0x676F = 0x97F4
-0x6770 = 0x97F7
-0x6771 = 0x97F8
-0x6772 = 0x97FA
-0x6773 = 0x9807
-0x6774 = 0x980A
-0x6775 = 0x9819
-0x6776 = 0x980D
-0x6777 = 0x980E
-0x6778 = 0x9814
-0x6779 = 0x9816
-0x677A = 0x981C
-0x677B = 0x981E
-0x677C = 0x9820
-0x677D = 0x9823
-0x677E = 0x9826
-0x6821 = 0x982B
-0x6822 = 0x982E
-0x6823 = 0x982F
-0x6824 = 0x9830
-0x6825 = 0x9832
-0x6826 = 0x9833
-0x6827 = 0x9835
-0x6828 = 0x9825
-0x6829 = 0x983E
-0x682A = 0x9844
-0x682B = 0x9847
-0x682C = 0x984A
-0x682D = 0x9851
-0x682E = 0x9852
-0x682F = 0x9853
-0x6830 = 0x9856
-0x6831 = 0x9857
-0x6832 = 0x9859
-0x6833 = 0x985A
-0x6834 = 0x9862
-0x6835 = 0x9863
-0x6836 = 0x9865
-0x6837 = 0x9866
-0x6838 = 0x986A
-0x6839 = 0x986C
-0x683A = 0x98AB
-0x683B = 0x98AD
-0x683C = 0x98AE
-0x683D = 0x98B0
-0x683E = 0x98B4
-0x683F = 0x98B7
-0x6840 = 0x98B8
-0x6841 = 0x98BA
-0x6842 = 0x98BB
-0x6843 = 0x98BF
-0x6844 = 0x98C2
-0x6845 = 0x98C5
-0x6846 = 0x98C8
-0x6847 = 0x98CC
-0x6848 = 0x98E1
-0x6849 = 0x98E3
-0x684A = 0x98E5
-0x684B = 0x98E6
-0x684C = 0x98E7
-0x684D = 0x98EA
-0x684E = 0x98F3
-0x684F = 0x98F6
-0x6850 = 0x9902
-0x6851 = 0x9907
-0x6852 = 0x9908
-0x6853 = 0x9911
-0x6854 = 0x9915
-0x6855 = 0x9916
-0x6856 = 0x9917
-0x6857 = 0x991A
-0x6858 = 0x991B
-0x6859 = 0x991C
-0x685A = 0x991F
-0x685B = 0x9922
-0x685C = 0x9926
-0x685D = 0x9927
-0x685E = 0x992B
-0x685F = 0x9931
-0x6860 = 0x9932
-0x6861 = 0x9933
-0x6862 = 0x9934
-0x6863 = 0x9935
-0x6864 = 0x9939
-0x6865 = 0x993A
-0x6866 = 0x993B
-0x6867 = 0x993C
-0x6868 = 0x9940
-0x6869 = 0x9941
-0x686A = 0x9946
-0x686B = 0x9947
-0x686C = 0x9948
-0x686D = 0x994D
-0x686E = 0x994E
-0x686F = 0x9954
-0x6870 = 0x9958
-0x6871 = 0x9959
-0x6872 = 0x995B
-0x6873 = 0x995C
-0x6874 = 0x995E
-0x6875 = 0x995F
-0x6876 = 0x9960
-0x6877 = 0x999B
-0x6878 = 0x999D
-0x6879 = 0x999F
-0x687A = 0x99A6
-0x687B = 0x99B0
-0x687C = 0x99B1
-0x687D = 0x99B2
-0x687E = 0x99B5
-0x6921 = 0x99B9
-0x6922 = 0x99BA
-0x6923 = 0x99BD
-0x6924 = 0x99BF
-0x6925 = 0x99C3
-0x6926 = 0x99C9
-0x6927 = 0x99D3
-0x6928 = 0x99D4
-0x6929 = 0x99D9
-0x692A = 0x99DA
-0x692B = 0x99DC
-0x692C = 0x99DE
-0x692D = 0x99E7
-0x692E = 0x99EA
-0x692F = 0x99EB
-0x6930 = 0x99EC
-0x6931 = 0x99F0
-0x6932 = 0x99F4
-0x6933 = 0x99F5
-0x6934 = 0x99F9
-0x6935 = 0x99FD
-0x6936 = 0x99FE
-0x6937 = 0x9A02
-0x6938 = 0x9A03
-0x6939 = 0x9A04
-0x693A = 0x9A0B
-0x693B = 0x9A0C
-0x693C = 0x9A10
-0x693D = 0x9A11
-0x693E = 0x9A16
-0x693F = 0x9A1E
-0x6940 = 0x9A20
-0x6941 = 0x9A22
-0x6942 = 0x9A23
-0x6943 = 0x9A24
-0x6944 = 0x9A27
-0x6945 = 0x9A2D
-0x6946 = 0x9A2E
-0x6947 = 0x9A33
-0x6948 = 0x9A35
-0x6949 = 0x9A36
-0x694A = 0x9A38
-0x694B = 0x9A47
-0x694C = 0x9A41
-0x694D = 0x9A44
-0x694E = 0x9A4A
-0x694F = 0x9A4B
-0x6950 = 0x9A4C
-0x6951 = 0x9A4E
-0x6952 = 0x9A51
-0x6953 = 0x9A54
-0x6954 = 0x9A56
-0x6955 = 0x9A5D
-0x6956 = 0x9AAA
-0x6957 = 0x9AAC
-0x6958 = 0x9AAE
-0x6959 = 0x9AAF
-0x695A = 0x9AB2
-0x695B = 0x9AB4
-0x695C = 0x9AB5
-0x695D = 0x9AB6
-0x695E = 0x9AB9
-0x695F = 0x9ABB
-0x6960 = 0x9ABE
-0x6961 = 0x9ABF
-0x6962 = 0x9AC1
-0x6963 = 0x9AC3
-0x6964 = 0x9AC6
-0x6965 = 0x9AC8
-0x6966 = 0x9ACE
-0x6967 = 0x9AD0
-0x6968 = 0x9AD2
-0x6969 = 0x9AD5
-0x696A = 0x9AD6
-0x696B = 0x9AD7
-0x696C = 0x9ADB
-0x696D = 0x9ADC
-0x696E = 0x9AE0
-0x696F = 0x9AE4
-0x6970 = 0x9AE5
-0x6971 = 0x9AE7
-0x6972 = 0x9AE9
-0x6973 = 0x9AEC
-0x6974 = 0x9AF2
-0x6975 = 0x9AF3
-0x6976 = 0x9AF5
-0x6977 = 0x9AF9
-0x6978 = 0x9AFA
-0x6979 = 0x9AFD
-0x697A = 0x9AFF
-0x697B = 0x9B00
-0x697C = 0x9B01
-0x697D = 0x9B02
-0x697E = 0x9B03
-0x6A21 = 0x9B04
-0x6A22 = 0x9B05
-0x6A23 = 0x9B08
-0x6A24 = 0x9B09
-0x6A25 = 0x9B0B
-0x6A26 = 0x9B0C
-0x6A27 = 0x9B0D
-0x6A28 = 0x9B0E
-0x6A29 = 0x9B10
-0x6A2A = 0x9B12
-0x6A2B = 0x9B16
-0x6A2C = 0x9B19
-0x6A2D = 0x9B1B
-0x6A2E = 0x9B1C
-0x6A2F = 0x9B20
-0x6A30 = 0x9B26
-0x6A31 = 0x9B2B
-0x6A32 = 0x9B2D
-0x6A33 = 0x9B33
-0x6A34 = 0x9B34
-0x6A35 = 0x9B35
-0x6A36 = 0x9B37
-0x6A37 = 0x9B39
-0x6A38 = 0x9B3A
-0x6A39 = 0x9B3D
-0x6A3A = 0x9B48
-0x6A3B = 0x9B4B
-0x6A3C = 0x9B4C
-0x6A3D = 0x9B55
-0x6A3E = 0x9B56
-0x6A3F = 0x9B57
-0x6A40 = 0x9B5B
-0x6A41 = 0x9B5E
-0x6A42 = 0x9B61
-0x6A43 = 0x9B63
-0x6A44 = 0x9B65
-0x6A45 = 0x9B66
-0x6A46 = 0x9B68
-0x6A47 = 0x9B6A
-0x6A48 = 0x9B6B
-0x6A49 = 0x9B6C
-0x6A4A = 0x9B6D
-0x6A4B = 0x9B6E
-0x6A4C = 0x9B73
-0x6A4D = 0x9B75
-0x6A4E = 0x9B77
-0x6A4F = 0x9B78
-0x6A50 = 0x9B79
-0x6A51 = 0x9B7F
-0x6A52 = 0x9B80
-0x6A53 = 0x9B84
-0x6A54 = 0x9B85
-0x6A55 = 0x9B86
-0x6A56 = 0x9B87
-0x6A57 = 0x9B89
-0x6A58 = 0x9B8A
-0x6A59 = 0x9B8B
-0x6A5A = 0x9B8D
-0x6A5B = 0x9B8F
-0x6A5C = 0x9B90
-0x6A5D = 0x9B94
-0x6A5E = 0x9B9A
-0x6A5F = 0x9B9D
-0x6A60 = 0x9B9E
-0x6A61 = 0x9BA6
-0x6A62 = 0x9BA7
-0x6A63 = 0x9BA9
-0x6A64 = 0x9BAC
-0x6A65 = 0x9BB0
-0x6A66 = 0x9BB1
-0x6A67 = 0x9BB2
-0x6A68 = 0x9BB7
-0x6A69 = 0x9BB8
-0x6A6A = 0x9BBB
-0x6A6B = 0x9BBC
-0x6A6C = 0x9BBE
-0x6A6D = 0x9BBF
-0x6A6E = 0x9BC1
-0x6A6F = 0x9BC7
-0x6A70 = 0x9BC8
-0x6A71 = 0x9BCE
-0x6A72 = 0x9BD0
-0x6A73 = 0x9BD7
-0x6A74 = 0x9BD8
-0x6A75 = 0x9BDD
-0x6A76 = 0x9BDF
-0x6A77 = 0x9BE5
-0x6A78 = 0x9BE7
-0x6A79 = 0x9BEA
-0x6A7A = 0x9BEB
-0x6A7B = 0x9BEF
-0x6A7C = 0x9BF3
-0x6A7D = 0x9BF7
-0x6A7E = 0x9BF8
-0x6B21 = 0x9BF9
-0x6B22 = 0x9BFA
-0x6B23 = 0x9BFD
-0x6B24 = 0x9BFF
-0x6B25 = 0x9C00
-0x6B26 = 0x9C02
-0x6B27 = 0x9C0B
-0x6B28 = 0x9C0F
-0x6B29 = 0x9C11
-0x6B2A = 0x9C16
-0x6B2B = 0x9C18
-0x6B2C = 0x9C19
-0x6B2D = 0x9C1A
-0x6B2E = 0x9C1C
-0x6B2F = 0x9C1E
-0x6B30 = 0x9C22
-0x6B31 = 0x9C23
-0x6B32 = 0x9C26
-0x6B33 = 0x9C27
-0x6B34 = 0x9C28
-0x6B35 = 0x9C29
-0x6B36 = 0x9C2A
-0x6B37 = 0x9C31
-0x6B38 = 0x9C35
-0x6B39 = 0x9C36
-0x6B3A = 0x9C37
-0x6B3B = 0x9C3D
-0x6B3C = 0x9C41
-0x6B3D = 0x9C43
-0x6B3E = 0x9C44
-0x6B3F = 0x9C45
-0x6B40 = 0x9C49
-0x6B41 = 0x9C4A
-0x6B42 = 0x9C4E
-0x6B43 = 0x9C4F
-0x6B44 = 0x9C50
-0x6B45 = 0x9C53
-0x6B46 = 0x9C54
-0x6B47 = 0x9C56
-0x6B48 = 0x9C58
-0x6B49 = 0x9C5B
-0x6B4A = 0x9C5D
-0x6B4B = 0x9C5E
-0x6B4C = 0x9C5F
-0x6B4D = 0x9C63
-0x6B4E = 0x9C69
-0x6B4F = 0x9C6A
-0x6B50 = 0x9C5C
-0x6B51 = 0x9C6B
-0x6B52 = 0x9C68
-0x6B53 = 0x9C6E
-0x6B54 = 0x9C70
-0x6B55 = 0x9C72
-0x6B56 = 0x9C75
-0x6B57 = 0x9C77
-0x6B58 = 0x9C7B
-0x6B59 = 0x9CE6
-0x6B5A = 0x9CF2
-0x6B5B = 0x9CF7
-0x6B5C = 0x9CF9
-0x6B5D = 0x9D0B
-0x6B5E = 0x9D02
-0x6B5F = 0x9D11
-0x6B60 = 0x9D17
-0x6B61 = 0x9D18
-0x6B62 = 0x9D1C
-0x6B63 = 0x9D1D
-0x6B64 = 0x9D1E
-0x6B65 = 0x9D2F
-0x6B66 = 0x9D30
-0x6B67 = 0x9D32
-0x6B68 = 0x9D33
-0x6B69 = 0x9D34
-0x6B6A = 0x9D3A
-0x6B6B = 0x9D3C
-0x6B6C = 0x9D45
-0x6B6D = 0x9D3D
-0x6B6E = 0x9D42
-0x6B6F = 0x9D43
-0x6B70 = 0x9D47
-0x6B71 = 0x9D4A
-0x6B72 = 0x9D53
-0x6B73 = 0x9D54
-0x6B74 = 0x9D5F
-0x6B75 = 0x9D63
-0x6B76 = 0x9D62
-0x6B77 = 0x9D65
-0x6B78 = 0x9D69
-0x6B79 = 0x9D6A
-0x6B7A = 0x9D6B
-0x6B7B = 0x9D70
-0x6B7C = 0x9D76
-0x6B7D = 0x9D77
-0x6B7E = 0x9D7B
-0x6C21 = 0x9D7C
-0x6C22 = 0x9D7E
-0x6C23 = 0x9D83
-0x6C24 = 0x9D84
-0x6C25 = 0x9D86
-0x6C26 = 0x9D8A
-0x6C27 = 0x9D8D
-0x6C28 = 0x9D8E
-0x6C29 = 0x9D92
-0x6C2A = 0x9D93
-0x6C2B = 0x9D95
-0x6C2C = 0x9D96
-0x6C2D = 0x9D97
-0x6C2E = 0x9D98
-0x6C2F = 0x9DA1
-0x6C30 = 0x9DAA
-0x6C31 = 0x9DAC
-0x6C32 = 0x9DAE
-0x6C33 = 0x9DB1
-0x6C34 = 0x9DB5
-0x6C35 = 0x9DB9
-0x6C36 = 0x9DBC
-0x6C37 = 0x9DBF
-0x6C38 = 0x9DC3
-0x6C39 = 0x9DC7
-0x6C3A = 0x9DC9
-0x6C3B = 0x9DCA
-0x6C3C = 0x9DD4
-0x6C3D = 0x9DD5
-0x6C3E = 0x9DD6
-0x6C3F = 0x9DD7
-0x6C40 = 0x9DDA
-0x6C41 = 0x9DDE
-0x6C42 = 0x9DDF
-0x6C43 = 0x9DE0
-0x6C44 = 0x9DE5
-0x6C45 = 0x9DE7
-0x6C46 = 0x9DE9
-0x6C47 = 0x9DEB
-0x6C48 = 0x9DEE
-0x6C49 = 0x9DF0
-0x6C4A = 0x9DF3
-0x6C4B = 0x9DF4
-0x6C4C = 0x9DFE
-0x6C4D = 0x9E0A
-0x6C4E = 0x9E02
-0x6C4F = 0x9E07
-0x6C50 = 0x9E0E
-0x6C51 = 0x9E10
-0x6C52 = 0x9E11
-0x6C53 = 0x9E12
-0x6C54 = 0x9E15
-0x6C55 = 0x9E16
-0x6C56 = 0x9E19
-0x6C57 = 0x9E1C
-0x6C58 = 0x9E1D
-0x6C59 = 0x9E7A
-0x6C5A = 0x9E7B
-0x6C5B = 0x9E7C
-0x6C5C = 0x9E80
-0x6C5D = 0x9E82
-0x6C5E = 0x9E83
-0x6C5F = 0x9E84
-0x6C60 = 0x9E85
-0x6C61 = 0x9E87
-0x6C62 = 0x9E8E
-0x6C63 = 0x9E8F
-0x6C64 = 0x9E96
-0x6C65 = 0x9E98
-0x6C66 = 0x9E9B
-0x6C67 = 0x9E9E
-0x6C68 = 0x9EA4
-0x6C69 = 0x9EA8
-0x6C6A = 0x9EAC
-0x6C6B = 0x9EAE
-0x6C6C = 0x9EAF
-0x6C6D = 0x9EB0
-0x6C6E = 0x9EB3
-0x6C6F = 0x9EB4
-0x6C70 = 0x9EB5
-0x6C71 = 0x9EC6
-0x6C72 = 0x9EC8
-0x6C73 = 0x9ECB
-0x6C74 = 0x9ED5
-0x6C75 = 0x9EDF
-0x6C76 = 0x9EE4
-0x6C77 = 0x9EE7
-0x6C78 = 0x9EEC
-0x6C79 = 0x9EED
-0x6C7A = 0x9EEE
-0x6C7B = 0x9EF0
-0x6C7C = 0x9EF1
-0x6C7D = 0x9EF2
-0x6C7E = 0x9EF5
-0x6D21 = 0x9EF8
-0x6D22 = 0x9EFF
-0x6D23 = 0x9F02
-0x6D24 = 0x9F03
-0x6D25 = 0x9F09
-0x6D26 = 0x9F0F
-0x6D27 = 0x9F10
-0x6D28 = 0x9F11
-0x6D29 = 0x9F12
-0x6D2A = 0x9F14
-0x6D2B = 0x9F16
-0x6D2C = 0x9F17
-0x6D2D = 0x9F19
-0x6D2E = 0x9F1A
-0x6D2F = 0x9F1B
-0x6D30 = 0x9F1F
-0x6D31 = 0x9F22
-0x6D32 = 0x9F26
-0x6D33 = 0x9F2A
-0x6D34 = 0x9F2B
-0x6D35 = 0x9F2F
-0x6D36 = 0x9F31
-0x6D37 = 0x9F32
-0x6D38 = 0x9F34
-0x6D39 = 0x9F37
-0x6D3A = 0x9F39
-0x6D3B = 0x9F3A
-0x6D3C = 0x9F3C
-0x6D3D = 0x9F3D
-0x6D3E = 0x9F3F
-0x6D3F = 0x9F41
-0x6D40 = 0x9F43
-0x6D41 = 0x9F44
-0x6D42 = 0x9F45
-0x6D43 = 0x9F46
-0x6D44 = 0x9F47
-0x6D45 = 0x9F53
-0x6D46 = 0x9F55
-0x6D47 = 0x9F56
-0x6D48 = 0x9F57
-0x6D49 = 0x9F58
-0x6D4A = 0x9F5A
-0x6D4B = 0x9F5D
-0x6D4C = 0x9F5E
-0x6D4D = 0x9F68
-0x6D4E = 0x9F69
-0x6D4F = 0x9F6D
-0x6D50 = 0x9F6E
-0x6D51 = 0x9F6F
-0x6D52 = 0x9F70
-0x6D53 = 0x9F71
-0x6D54 = 0x9F73
-0x6D55 = 0x9F75
-0x6D56 = 0x9F7A
-0x6D57 = 0x9F7D
-0x6D58 = 0x9F8F
-0x6D59 = 0x9F90
-0x6D5A = 0x9F91
-0x6D5B = 0x9F92
-0x6D5C = 0x9F94
-0x6D5D = 0x9F96
-0x6D5E = 0x9F97
-0x6D5F = 0x9F9E
-0x6D60 = 0x9FA1
-0x6D61 = 0x9FA2
-0x6D62 = 0x9FA3
-0x6D63 = 0x9FA5
-END_MAP
diff --git a/enc/trans/JIS/JISX0212@MS%UCS.src b/enc/trans/JIS/JISX0212@MS%UCS.src
deleted file mode 100644
index cd05e26d3a..0000000000
--- a/enc/trans/JIS/JISX0212@MS%UCS.src
+++ /dev/null
@@ -1,6081 +0,0 @@
-# $NetBSD: JISX0212@MS%UCS.src,v 1.1 2003/07/19 20:20:41 tshiozak Exp $
-
-TYPE ROWCOL
-NAME "JISX0212:MS/UCS"
-SRC_ZONE 0x21-0x7E / 0x21-0x7E / 8
-OOB_MODE ILSEQ
-DST_ILSEQ 0xFFFE
-DST_UNIT_BITS 16
-
-BEGIN_MAP
-#
-# This data is derived from http://www.opengroup.or.jp/jvc/cde/
-#
-0x222F = 0x02D8
-0x2230 = 0x02C7
-0x2231 = 0x00B8
-0x2232 = 0x02D9
-0x2233 = 0x02DD
-0x2234 = 0x00AF
-0x2235 = 0x02DB
-0x2236 = 0x02DA
-0x2237 = 0xFF5E
-0x2238 = 0x0384
-0x2239 = 0x0385
-0x2242 = 0x00A1
-0x2243 = 0xFFE4
-0x2244 = 0x00BF
-0x226B = 0x00BA
-0x226C = 0x00AA
-0x226D = 0x00A9
-0x226E = 0x00AE
-0x226F = 0x2122
-0x2270 = 0x00A4
-0x2271 = 0x2116
-0x2661 = 0x0386
-0x2662 = 0x0388
-0x2663 = 0x0389
-0x2664 = 0x038A
-0x2665 = 0x03AA
-0x2667 = 0x038C
-0x2669 = 0x038E
-0x266A = 0x03AB
-0x266C = 0x038F
-0x2671 = 0x03AC
-0x2672 = 0x03AD
-0x2673 = 0x03AE
-0x2674 = 0x03AF
-0x2675 = 0x03CA
-0x2676 = 0x0390
-0x2677 = 0x03CC
-0x2678 = 0x03C2
-0x2679 = 0x03CD
-0x267A = 0x03CB
-0x267B = 0x03B0
-0x267C = 0x03CE
-0x2742 = 0x0402
-0x2743 = 0x0403
-0x2744 = 0x0404
-0x2745 = 0x0405
-0x2746 = 0x0406
-0x2747 = 0x0407
-0x2748 = 0x0408
-0x2749 = 0x0409
-0x274A = 0x040A
-0x274B = 0x040B
-0x274C = 0x040C
-0x274D = 0x040E
-0x274E = 0x040F
-0x2772 = 0x0452
-0x2773 = 0x0453
-0x2774 = 0x0454
-0x2775 = 0x0455
-0x2776 = 0x0456
-0x2777 = 0x0457
-0x2778 = 0x0458
-0x2779 = 0x0459
-0x277A = 0x045A
-0x277B = 0x045B
-0x277C = 0x045C
-0x277D = 0x045E
-0x277E = 0x045F
-0x2921 = 0x00C6
-0x2922 = 0x0110
-0x2924 = 0x0126
-0x2926 = 0x0132
-0x2928 = 0x0141
-0x2929 = 0x013F
-0x292B = 0x014A
-0x292C = 0x00D8
-0x292D = 0x0152
-0x292F = 0x0166
-0x2930 = 0x00DE
-0x2941 = 0x00E6
-0x2942 = 0x0111
-0x2943 = 0x00F0
-0x2944 = 0x0127
-0x2945 = 0x0131
-0x2946 = 0x0133
-0x2947 = 0x0138
-0x2948 = 0x0142
-0x2949 = 0x0140
-0x294A = 0x0149
-0x294B = 0x014B
-0x294C = 0x00F8
-0x294D = 0x0153
-0x294E = 0x00DF
-0x294F = 0x0167
-0x2950 = 0x00FE
-0x2A21 = 0x00C1
-0x2A22 = 0x00C0
-0x2A23 = 0x00C4
-0x2A24 = 0x00C2
-0x2A25 = 0x0102
-0x2A26 = 0x01CD
-0x2A27 = 0x0100
-0x2A28 = 0x0104
-0x2A29 = 0x00C5
-0x2A2A = 0x00C3
-0x2A2B = 0x0106
-0x2A2C = 0x0108
-0x2A2D = 0x010C
-0x2A2E = 0x00C7
-0x2A2F = 0x010A
-0x2A30 = 0x010E
-0x2A31 = 0x00C9
-0x2A32 = 0x00C8
-0x2A33 = 0x00CB
-0x2A34 = 0x00CA
-0x2A35 = 0x011A
-0x2A36 = 0x0116
-0x2A37 = 0x0112
-0x2A38 = 0x0118
-0x2A3A = 0x011C
-0x2A3B = 0x011E
-0x2A3C = 0x0122
-0x2A3D = 0x0120
-0x2A3E = 0x0124
-0x2A3F = 0x00CD
-0x2A40 = 0x00CC
-0x2A41 = 0x00CF
-0x2A42 = 0x00CE
-0x2A43 = 0x01CF
-0x2A44 = 0x0130
-0x2A45 = 0x012A
-0x2A46 = 0x012E
-0x2A47 = 0x0128
-0x2A48 = 0x0134
-0x2A49 = 0x0136
-0x2A4A = 0x0139
-0x2A4B = 0x013D
-0x2A4C = 0x013B
-0x2A4D = 0x0143
-0x2A4E = 0x0147
-0x2A4F = 0x0145
-0x2A50 = 0x00D1
-0x2A51 = 0x00D3
-0x2A52 = 0x00D2
-0x2A53 = 0x00D6
-0x2A54 = 0x00D4
-0x2A55 = 0x01D1
-0x2A56 = 0x0150
-0x2A57 = 0x014C
-0x2A58 = 0x00D5
-0x2A59 = 0x0154
-0x2A5A = 0x0158
-0x2A5B = 0x0156
-0x2A5C = 0x015A
-0x2A5D = 0x015C
-0x2A5E = 0x0160
-0x2A5F = 0x015E
-0x2A60 = 0x0164
-0x2A61 = 0x0162
-0x2A62 = 0x00DA
-0x2A63 = 0x00D9
-0x2A64 = 0x00DC
-0x2A65 = 0x00DB
-0x2A66 = 0x016C
-0x2A67 = 0x01D3
-0x2A68 = 0x0170
-0x2A69 = 0x016A
-0x2A6A = 0x0172
-0x2A6B = 0x016E
-0x2A6C = 0x0168
-0x2A6D = 0x01D7
-0x2A6E = 0x01DB
-0x2A6F = 0x01D9
-0x2A70 = 0x01D5
-0x2A71 = 0x0174
-0x2A72 = 0x00DD
-0x2A73 = 0x0178
-0x2A74 = 0x0176
-0x2A75 = 0x0179
-0x2A76 = 0x017D
-0x2A77 = 0x017B
-0x2B21 = 0x00E1
-0x2B22 = 0x00E0
-0x2B23 = 0x00E4
-0x2B24 = 0x00E2
-0x2B25 = 0x0103
-0x2B26 = 0x01CE
-0x2B27 = 0x0101
-0x2B28 = 0x0105
-0x2B29 = 0x00E5
-0x2B2A = 0x00E3
-0x2B2B = 0x0107
-0x2B2C = 0x0109
-0x2B2D = 0x010D
-0x2B2E = 0x00E7
-0x2B2F = 0x010B
-0x2B30 = 0x010F
-0x2B31 = 0x00E9
-0x2B32 = 0x00E8
-0x2B33 = 0x00EB
-0x2B34 = 0x00EA
-0x2B35 = 0x011B
-0x2B36 = 0x0117
-0x2B37 = 0x0113
-0x2B38 = 0x0119
-0x2B39 = 0x01F5
-0x2B3A = 0x011D
-0x2B3B = 0x011F
-0x2B3D = 0x0121
-0x2B3E = 0x0125
-0x2B3F = 0x00ED
-0x2B40 = 0x00EC
-0x2B41 = 0x00EF
-0x2B42 = 0x00EE
-0x2B43 = 0x01D0
-0x2B45 = 0x012B
-0x2B46 = 0x012F
-0x2B47 = 0x0129
-0x2B48 = 0x0135
-0x2B49 = 0x0137
-0x2B4A = 0x013A
-0x2B4B = 0x013E
-0x2B4C = 0x013C
-0x2B4D = 0x0144
-0x2B4E = 0x0148
-0x2B4F = 0x0146
-0x2B50 = 0x00F1
-0x2B51 = 0x00F3
-0x2B52 = 0x00F2
-0x2B53 = 0x00F6
-0x2B54 = 0x00F4
-0x2B55 = 0x01D2
-0x2B56 = 0x0151
-0x2B57 = 0x014D
-0x2B58 = 0x00F5
-0x2B59 = 0x0155
-0x2B5A = 0x0159
-0x2B5B = 0x0157
-0x2B5C = 0x015B
-0x2B5D = 0x015D
-0x2B5E = 0x0161
-0x2B5F = 0x015F
-0x2B60 = 0x0165
-0x2B61 = 0x0163
-0x2B62 = 0x00FA
-0x2B63 = 0x00F9
-0x2B64 = 0x00FC
-0x2B65 = 0x00FB
-0x2B66 = 0x016D
-0x2B67 = 0x01D4
-0x2B68 = 0x0171
-0x2B69 = 0x016B
-0x2B6A = 0x0173
-0x2B6B = 0x016F
-0x2B6C = 0x0169
-0x2B6D = 0x01D8
-0x2B6E = 0x01DC
-0x2B6F = 0x01DA
-0x2B70 = 0x01D6
-0x2B71 = 0x0175
-0x2B72 = 0x00FD
-0x2B73 = 0x00FF
-0x2B74 = 0x0177
-0x2B75 = 0x017A
-0x2B76 = 0x017E
-0x2B77 = 0x017C
-0x3021 = 0x4E02
-0x3022 = 0x4E04
-0x3023 = 0x4E05
-0x3024 = 0x4E0C
-0x3025 = 0x4E12
-0x3026 = 0x4E1F
-0x3027 = 0x4E23
-0x3028 = 0x4E24
-0x3029 = 0x4E28
-0x302A = 0x4E2B
-0x302B = 0x4E2E
-0x302C = 0x4E2F
-0x302D = 0x4E30
-0x302E = 0x4E35
-0x302F = 0x4E40
-0x3030 = 0x4E41
-0x3031 = 0x4E44
-0x3032 = 0x4E47
-0x3033 = 0x4E51
-0x3034 = 0x4E5A
-0x3035 = 0x4E5C
-0x3036 = 0x4E63
-0x3037 = 0x4E68
-0x3038 = 0x4E69
-0x3039 = 0x4E74
-0x303A = 0x4E75
-0x303B = 0x4E79
-0x303C = 0x4E7F
-0x303D = 0x4E8D
-0x303E = 0x4E96
-0x303F = 0x4E97
-0x3040 = 0x4E9D
-0x3041 = 0x4EAF
-0x3042 = 0x4EB9
-0x3043 = 0x4EC3
-0x3044 = 0x4ED0
-0x3045 = 0x4EDA
-0x3046 = 0x4EDB
-0x3047 = 0x4EE0
-0x3048 = 0x4EE1
-0x3049 = 0x4EE2
-0x304A = 0x4EE8
-0x304B = 0x4EEF
-0x304C = 0x4EF1
-0x304D = 0x4EF3
-0x304E = 0x4EF5
-0x304F = 0x4EFD
-0x3050 = 0x4EFE
-0x3051 = 0x4EFF
-0x3052 = 0x4F00
-0x3053 = 0x4F02
-0x3054 = 0x4F03
-0x3055 = 0x4F08
-0x3056 = 0x4F0B
-0x3057 = 0x4F0C
-0x3058 = 0x4F12
-0x3059 = 0x4F15
-0x305A = 0x4F16
-0x305B = 0x4F17
-0x305C = 0x4F19
-0x305D = 0x4F2E
-0x305E = 0x4F31
-0x305F = 0x4F60
-0x3060 = 0x4F33
-0x3061 = 0x4F35
-0x3062 = 0x4F37
-0x3063 = 0x4F39
-0x3064 = 0x4F3B
-0x3065 = 0x4F3E
-0x3066 = 0x4F40
-0x3067 = 0x4F42
-0x3068 = 0x4F48
-0x3069 = 0x4F49
-0x306A = 0x4F4B
-0x306B = 0x4F4C
-0x306C = 0x4F52
-0x306D = 0x4F54
-0x306E = 0x4F56
-0x306F = 0x4F58
-0x3070 = 0x4F5F
-0x3071 = 0x4F63
-0x3072 = 0x4F6A
-0x3073 = 0x4F6C
-0x3074 = 0x4F6E
-0x3075 = 0x4F71
-0x3076 = 0x4F77
-0x3077 = 0x4F78
-0x3078 = 0x4F79
-0x3079 = 0x4F7A
-0x307A = 0x4F7D
-0x307B = 0x4F7E
-0x307C = 0x4F81
-0x307D = 0x4F82
-0x307E = 0x4F84
-0x3121 = 0x4F85
-0x3122 = 0x4F89
-0x3123 = 0x4F8A
-0x3124 = 0x4F8C
-0x3125 = 0x4F8E
-0x3126 = 0x4F90
-0x3127 = 0x4F92
-0x3128 = 0x4F93
-0x3129 = 0x4F94
-0x312A = 0x4F97
-0x312B = 0x4F99
-0x312C = 0x4F9A
-0x312D = 0x4F9E
-0x312E = 0x4F9F
-0x312F = 0x4FB2
-0x3130 = 0x4FB7
-0x3131 = 0x4FB9
-0x3132 = 0x4FBB
-0x3133 = 0x4FBC
-0x3134 = 0x4FBD
-0x3135 = 0x4FBE
-0x3136 = 0x4FC0
-0x3137 = 0x4FC1
-0x3138 = 0x4FC5
-0x3139 = 0x4FC6
-0x313A = 0x4FC8
-0x313B = 0x4FC9
-0x313C = 0x4FCB
-0x313D = 0x4FCC
-0x313E = 0x4FCD
-0x313F = 0x4FCF
-0x3140 = 0x4FD2
-0x3141 = 0x4FDC
-0x3142 = 0x4FE0
-0x3143 = 0x4FE2
-0x3144 = 0x4FF0
-0x3145 = 0x4FF2
-0x3146 = 0x4FFC
-0x3147 = 0x4FFD
-0x3148 = 0x4FFF
-0x3149 = 0x5000
-0x314A = 0x5001
-0x314B = 0x5004
-0x314C = 0x5007
-0x314D = 0x500A
-0x314E = 0x500C
-0x314F = 0x500E
-0x3150 = 0x5010
-0x3151 = 0x5013
-0x3152 = 0x5017
-0x3153 = 0x5018
-0x3154 = 0x501B
-0x3155 = 0x501C
-0x3156 = 0x501D
-0x3157 = 0x501E
-0x3158 = 0x5022
-0x3159 = 0x5027
-0x315A = 0x502E
-0x315B = 0x5030
-0x315C = 0x5032
-0x315D = 0x5033
-0x315E = 0x5035
-0x315F = 0x5040
-0x3160 = 0x5041
-0x3161 = 0x5042
-0x3162 = 0x5045
-0x3163 = 0x5046
-0x3164 = 0x504A
-0x3165 = 0x504C
-0x3166 = 0x504E
-0x3167 = 0x5051
-0x3168 = 0x5052
-0x3169 = 0x5053
-0x316A = 0x5057
-0x316B = 0x5059
-0x316C = 0x505F
-0x316D = 0x5060
-0x316E = 0x5062
-0x316F = 0x5063
-0x3170 = 0x5066
-0x3171 = 0x5067
-0x3172 = 0x506A
-0x3173 = 0x506D
-0x3174 = 0x5070
-0x3175 = 0x5071
-0x3176 = 0x503B
-0x3177 = 0x5081
-0x3178 = 0x5083
-0x3179 = 0x5084
-0x317A = 0x5086
-0x317B = 0x508A
-0x317C = 0x508E
-0x317D = 0x508F
-0x317E = 0x5090
-0x3221 = 0x5092
-0x3222 = 0x5093
-0x3223 = 0x5094
-0x3224 = 0x5096
-0x3225 = 0x509B
-0x3226 = 0x509C
-0x3227 = 0x509E
-0x3228 = 0x509F
-0x3229 = 0x50A0
-0x322A = 0x50A1
-0x322B = 0x50A2
-0x322C = 0x50AA
-0x322D = 0x50AF
-0x322E = 0x50B0
-0x322F = 0x50B9
-0x3230 = 0x50BA
-0x3231 = 0x50BD
-0x3232 = 0x50C0
-0x3233 = 0x50C3
-0x3234 = 0x50C4
-0x3235 = 0x50C7
-0x3236 = 0x50CC
-0x3237 = 0x50CE
-0x3238 = 0x50D0
-0x3239 = 0x50D3
-0x323A = 0x50D4
-0x323B = 0x50D8
-0x323C = 0x50DC
-0x323D = 0x50DD
-0x323E = 0x50DF
-0x323F = 0x50E2
-0x3240 = 0x50E4
-0x3241 = 0x50E6
-0x3242 = 0x50E8
-0x3243 = 0x50E9
-0x3244 = 0x50EF
-0x3245 = 0x50F1
-0x3246 = 0x50F6
-0x3247 = 0x50FA
-0x3248 = 0x50FE
-0x3249 = 0x5103
-0x324A = 0x5106
-0x324B = 0x5107
-0x324C = 0x5108
-0x324D = 0x510B
-0x324E = 0x510C
-0x324F = 0x510D
-0x3250 = 0x510E
-0x3251 = 0x50F2
-0x3252 = 0x5110
-0x3253 = 0x5117
-0x3254 = 0x5119
-0x3255 = 0x511B
-0x3256 = 0x511C
-0x3257 = 0x511D
-0x3258 = 0x511E
-0x3259 = 0x5123
-0x325A = 0x5127
-0x325B = 0x5128
-0x325C = 0x512C
-0x325D = 0x512D
-0x325E = 0x512F
-0x325F = 0x5131
-0x3260 = 0x5133
-0x3261 = 0x5134
-0x3262 = 0x5135
-0x3263 = 0x5138
-0x3264 = 0x5139
-0x3265 = 0x5142
-0x3266 = 0x514A
-0x3267 = 0x514F
-0x3268 = 0x5153
-0x3269 = 0x5155
-0x326A = 0x5157
-0x326B = 0x5158
-0x326C = 0x515F
-0x326D = 0x5164
-0x326E = 0x5166
-0x326F = 0x517E
-0x3270 = 0x5183
-0x3271 = 0x5184
-0x3272 = 0x518B
-0x3273 = 0x518E
-0x3274 = 0x5198
-0x3275 = 0x519D
-0x3276 = 0x51A1
-0x3277 = 0x51A3
-0x3278 = 0x51AD
-0x3279 = 0x51B8
-0x327A = 0x51BA
-0x327B = 0x51BC
-0x327C = 0x51BE
-0x327D = 0x51BF
-0x327E = 0x51C2
-0x3321 = 0x51C8
-0x3322 = 0x51CF
-0x3323 = 0x51D1
-0x3324 = 0x51D2
-0x3325 = 0x51D3
-0x3326 = 0x51D5
-0x3327 = 0x51D8
-0x3328 = 0x51DE
-0x3329 = 0x51E2
-0x332A = 0x51E5
-0x332B = 0x51EE
-0x332C = 0x51F2
-0x332D = 0x51F3
-0x332E = 0x51F4
-0x332F = 0x51F7
-0x3330 = 0x5201
-0x3331 = 0x5202
-0x3332 = 0x5205
-0x3333 = 0x5212
-0x3334 = 0x5213
-0x3335 = 0x5215
-0x3336 = 0x5216
-0x3337 = 0x5218
-0x3338 = 0x5222
-0x3339 = 0x5228
-0x333A = 0x5231
-0x333B = 0x5232
-0x333C = 0x5235
-0x333D = 0x523C
-0x333E = 0x5245
-0x333F = 0x5249
-0x3340 = 0x5255
-0x3341 = 0x5257
-0x3342 = 0x5258
-0x3343 = 0x525A
-0x3344 = 0x525C
-0x3345 = 0x525F
-0x3346 = 0x5260
-0x3347 = 0x5261
-0x3348 = 0x5266
-0x3349 = 0x526E
-0x334A = 0x5277
-0x334B = 0x5278
-0x334C = 0x5279
-0x334D = 0x5280
-0x334E = 0x5282
-0x334F = 0x5285
-0x3350 = 0x528A
-0x3351 = 0x528C
-0x3352 = 0x5293
-0x3353 = 0x5295
-0x3354 = 0x5296
-0x3355 = 0x5297
-0x3356 = 0x5298
-0x3357 = 0x529A
-0x3358 = 0x529C
-0x3359 = 0x52A4
-0x335A = 0x52A5
-0x335B = 0x52A6
-0x335C = 0x52A7
-0x335D = 0x52AF
-0x335E = 0x52B0
-0x335F = 0x52B6
-0x3360 = 0x52B7
-0x3361 = 0x52B8
-0x3362 = 0x52BA
-0x3363 = 0x52BB
-0x3364 = 0x52BD
-0x3365 = 0x52C0
-0x3366 = 0x52C4
-0x3367 = 0x52C6
-0x3368 = 0x52C8
-0x3369 = 0x52CC
-0x336A = 0x52CF
-0x336B = 0x52D1
-0x336C = 0x52D4
-0x336D = 0x52D6
-0x336E = 0x52DB
-0x336F = 0x52DC
-0x3370 = 0x52E1
-0x3371 = 0x52E5
-0x3372 = 0x52E8
-0x3373 = 0x52E9
-0x3374 = 0x52EA
-0x3375 = 0x52EC
-0x3376 = 0x52F0
-0x3377 = 0x52F1
-0x3378 = 0x52F4
-0x3379 = 0x52F6
-0x337A = 0x52F7
-0x337B = 0x5300
-0x337C = 0x5303
-0x337D = 0x530A
-0x337E = 0x530B
-0x3421 = 0x530C
-0x3422 = 0x5311
-0x3423 = 0x5313
-0x3424 = 0x5318
-0x3425 = 0x531B
-0x3426 = 0x531C
-0x3427 = 0x531E
-0x3428 = 0x531F
-0x3429 = 0x5325
-0x342A = 0x5327
-0x342B = 0x5328
-0x342C = 0x5329
-0x342D = 0x532B
-0x342E = 0x532C
-0x342F = 0x532D
-0x3430 = 0x5330
-0x3431 = 0x5332
-0x3432 = 0x5335
-0x3433 = 0x533C
-0x3434 = 0x533D
-0x3435 = 0x533E
-0x3436 = 0x5342
-0x3437 = 0x534C
-0x3438 = 0x534B
-0x3439 = 0x5359
-0x343A = 0x535B
-0x343B = 0x5361
-0x343C = 0x5363
-0x343D = 0x5365
-0x343E = 0x536C
-0x343F = 0x536D
-0x3440 = 0x5372
-0x3441 = 0x5379
-0x3442 = 0x537E
-0x3443 = 0x5383
-0x3444 = 0x5387
-0x3445 = 0x5388
-0x3446 = 0x538E
-0x3447 = 0x5393
-0x3448 = 0x5394
-0x3449 = 0x5399
-0x344A = 0x539D
-0x344B = 0x53A1
-0x344C = 0x53A4
-0x344D = 0x53AA
-0x344E = 0x53AB
-0x344F = 0x53AF
-0x3450 = 0x53B2
-0x3451 = 0x53B4
-0x3452 = 0x53B5
-0x3453 = 0x53B7
-0x3454 = 0x53B8
-0x3455 = 0x53BA
-0x3456 = 0x53BD
-0x3457 = 0x53C0
-0x3458 = 0x53C5
-0x3459 = 0x53CF
-0x345A = 0x53D2
-0x345B = 0x53D3
-0x345C = 0x53D5
-0x345D = 0x53DA
-0x345E = 0x53DD
-0x345F = 0x53DE
-0x3460 = 0x53E0
-0x3461 = 0x53E6
-0x3462 = 0x53E7
-0x3463 = 0x53F5
-0x3464 = 0x5402
-0x3465 = 0x5413
-0x3466 = 0x541A
-0x3467 = 0x5421
-0x3468 = 0x5427
-0x3469 = 0x5428
-0x346A = 0x542A
-0x346B = 0x542F
-0x346C = 0x5431
-0x346D = 0x5434
-0x346E = 0x5435
-0x346F = 0x5443
-0x3470 = 0x5444
-0x3471 = 0x5447
-0x3472 = 0x544D
-0x3473 = 0x544F
-0x3474 = 0x545E
-0x3475 = 0x5462
-0x3476 = 0x5464
-0x3477 = 0x5466
-0x3478 = 0x5467
-0x3479 = 0x5469
-0x347A = 0x546B
-0x347B = 0x546D
-0x347C = 0x546E
-0x347D = 0x5474
-0x347E = 0x547F
-0x3521 = 0x5481
-0x3522 = 0x5483
-0x3523 = 0x5485
-0x3524 = 0x5488
-0x3525 = 0x5489
-0x3526 = 0x548D
-0x3527 = 0x5491
-0x3528 = 0x5495
-0x3529 = 0x5496
-0x352A = 0x549C
-0x352B = 0x549F
-0x352C = 0x54A1
-0x352D = 0x54A6
-0x352E = 0x54A7
-0x352F = 0x54A9
-0x3530 = 0x54AA
-0x3531 = 0x54AD
-0x3532 = 0x54AE
-0x3533 = 0x54B1
-0x3534 = 0x54B7
-0x3535 = 0x54B9
-0x3536 = 0x54BA
-0x3537 = 0x54BB
-0x3538 = 0x54BF
-0x3539 = 0x54C6
-0x353A = 0x54CA
-0x353B = 0x54CD
-0x353C = 0x54CE
-0x353D = 0x54E0
-0x353E = 0x54EA
-0x353F = 0x54EC
-0x3540 = 0x54EF
-0x3541 = 0x54F6
-0x3542 = 0x54FC
-0x3543 = 0x54FE
-0x3544 = 0x54FF
-0x3545 = 0x5500
-0x3546 = 0x5501
-0x3547 = 0x5505
-0x3548 = 0x5508
-0x3549 = 0x5509
-0x354A = 0x550C
-0x354B = 0x550D
-0x354C = 0x550E
-0x354D = 0x5515
-0x354E = 0x552A
-0x354F = 0x552B
-0x3550 = 0x5532
-0x3551 = 0x5535
-0x3552 = 0x5536
-0x3553 = 0x553B
-0x3554 = 0x553C
-0x3555 = 0x553D
-0x3556 = 0x5541
-0x3557 = 0x5547
-0x3558 = 0x5549
-0x3559 = 0x554A
-0x355A = 0x554D
-0x355B = 0x5550
-0x355C = 0x5551
-0x355D = 0x5558
-0x355E = 0x555A
-0x355F = 0x555B
-0x3560 = 0x555E
-0x3561 = 0x5560
-0x3562 = 0x5561
-0x3563 = 0x5564
-0x3564 = 0x5566
-0x3565 = 0x557F
-0x3566 = 0x5581
-0x3567 = 0x5582
-0x3568 = 0x5586
-0x3569 = 0x5588
-0x356A = 0x558E
-0x356B = 0x558F
-0x356C = 0x5591
-0x356D = 0x5592
-0x356E = 0x5593
-0x356F = 0x5594
-0x3570 = 0x5597
-0x3571 = 0x55A3
-0x3572 = 0x55A4
-0x3573 = 0x55AD
-0x3574 = 0x55B2
-0x3575 = 0x55BF
-0x3576 = 0x55C1
-0x3577 = 0x55C3
-0x3578 = 0x55C6
-0x3579 = 0x55C9
-0x357A = 0x55CB
-0x357B = 0x55CC
-0x357C = 0x55CE
-0x357D = 0x55D1
-0x357E = 0x55D2
-0x3621 = 0x55D3
-0x3622 = 0x55D7
-0x3623 = 0x55D8
-0x3624 = 0x55DB
-0x3625 = 0x55DE
-0x3626 = 0x55E2
-0x3627 = 0x55E9
-0x3628 = 0x55F6
-0x3629 = 0x55FF
-0x362A = 0x5605
-0x362B = 0x5608
-0x362C = 0x560A
-0x362D = 0x560D
-0x362E = 0x560E
-0x362F = 0x560F
-0x3630 = 0x5610
-0x3631 = 0x5611
-0x3632 = 0x5612
-0x3633 = 0x5619
-0x3634 = 0x562C
-0x3635 = 0x5630
-0x3636 = 0x5633
-0x3637 = 0x5635
-0x3638 = 0x5637
-0x3639 = 0x5639
-0x363A = 0x563B
-0x363B = 0x563C
-0x363C = 0x563D
-0x363D = 0x563F
-0x363E = 0x5640
-0x363F = 0x5641
-0x3640 = 0x5643
-0x3641 = 0x5644
-0x3642 = 0x5646
-0x3643 = 0x5649
-0x3644 = 0x564B
-0x3645 = 0x564D
-0x3646 = 0x564F
-0x3647 = 0x5654
-0x3648 = 0x565E
-0x3649 = 0x5660
-0x364A = 0x5661
-0x364B = 0x5662
-0x364C = 0x5663
-0x364D = 0x5666
-0x364E = 0x5669
-0x364F = 0x566D
-0x3650 = 0x566F
-0x3651 = 0x5671
-0x3652 = 0x5672
-0x3653 = 0x5675
-0x3654 = 0x5684
-0x3655 = 0x5685
-0x3656 = 0x5688
-0x3657 = 0x568B
-0x3658 = 0x568C
-0x3659 = 0x5695
-0x365A = 0x5699
-0x365B = 0x569A
-0x365C = 0x569D
-0x365D = 0x569E
-0x365E = 0x569F
-0x365F = 0x56A6
-0x3660 = 0x56A7
-0x3661 = 0x56A8
-0x3662 = 0x56A9
-0x3663 = 0x56AB
-0x3664 = 0x56AC
-0x3665 = 0x56AD
-0x3666 = 0x56B1
-0x3667 = 0x56B3
-0x3668 = 0x56B7
-0x3669 = 0x56BE
-0x366A = 0x56C5
-0x366B = 0x56C9
-0x366C = 0x56CA
-0x366D = 0x56CB
-0x366E = 0x56CF
-0x366F = 0x56D0
-0x3670 = 0x56CC
-0x3671 = 0x56CD
-0x3672 = 0x56D9
-0x3673 = 0x56DC
-0x3674 = 0x56DD
-0x3675 = 0x56DF
-0x3676 = 0x56E1
-0x3677 = 0x56E4
-0x3678 = 0x56E5
-0x3679 = 0x56E6
-0x367A = 0x56E7
-0x367B = 0x56E8
-0x367C = 0x56F1
-0x367D = 0x56EB
-0x367E = 0x56ED
-0x3721 = 0x56F6
-0x3722 = 0x56F7
-0x3723 = 0x5701
-0x3724 = 0x5702
-0x3725 = 0x5707
-0x3726 = 0x570A
-0x3727 = 0x570C
-0x3728 = 0x5711
-0x3729 = 0x5715
-0x372A = 0x571A
-0x372B = 0x571B
-0x372C = 0x571D
-0x372D = 0x5720
-0x372E = 0x5722
-0x372F = 0x5723
-0x3730 = 0x5724
-0x3731 = 0x5725
-0x3732 = 0x5729
-0x3733 = 0x572A
-0x3734 = 0x572C
-0x3735 = 0x572E
-0x3736 = 0x572F
-0x3737 = 0x5733
-0x3738 = 0x5734
-0x3739 = 0x573D
-0x373A = 0x573E
-0x373B = 0x573F
-0x373C = 0x5745
-0x373D = 0x5746
-0x373E = 0x574C
-0x373F = 0x574D
-0x3740 = 0x5752
-0x3741 = 0x5762
-0x3742 = 0x5765
-0x3743 = 0x5767
-0x3744 = 0x5768
-0x3745 = 0x576B
-0x3746 = 0x576D
-0x3747 = 0x576E
-0x3748 = 0x576F
-0x3749 = 0x5770
-0x374A = 0x5771
-0x374B = 0x5773
-0x374C = 0x5774
-0x374D = 0x5775
-0x374E = 0x5777
-0x374F = 0x5779
-0x3750 = 0x577A
-0x3751 = 0x577B
-0x3752 = 0x577C
-0x3753 = 0x577E
-0x3754 = 0x5781
-0x3755 = 0x5783
-0x3756 = 0x578C
-0x3757 = 0x5794
-0x3758 = 0x5797
-0x3759 = 0x5799
-0x375A = 0x579A
-0x375B = 0x579C
-0x375C = 0x579D
-0x375D = 0x579E
-0x375E = 0x579F
-0x375F = 0x57A1
-0x3760 = 0x5795
-0x3761 = 0x57A7
-0x3762 = 0x57A8
-0x3763 = 0x57A9
-0x3764 = 0x57AC
-0x3765 = 0x57B8
-0x3766 = 0x57BD
-0x3767 = 0x57C7
-0x3768 = 0x57C8
-0x3769 = 0x57CC
-0x376A = 0x57CF
-0x376B = 0x57D5
-0x376C = 0x57DD
-0x376D = 0x57DE
-0x376E = 0x57E4
-0x376F = 0x57E6
-0x3770 = 0x57E7
-0x3771 = 0x57E9
-0x3772 = 0x57ED
-0x3773 = 0x57F0
-0x3774 = 0x57F5
-0x3775 = 0x57F6
-0x3776 = 0x57F8
-0x3777 = 0x57FD
-0x3778 = 0x57FE
-0x3779 = 0x57FF
-0x377A = 0x5803
-0x377B = 0x5804
-0x377C = 0x5808
-0x377D = 0x5809
-0x377E = 0x57E1
-0x3821 = 0x580C
-0x3822 = 0x580D
-0x3823 = 0x581B
-0x3824 = 0x581E
-0x3825 = 0x581F
-0x3826 = 0x5820
-0x3827 = 0x5826
-0x3828 = 0x5827
-0x3829 = 0x582D
-0x382A = 0x5832
-0x382B = 0x5839
-0x382C = 0x583F
-0x382D = 0x5849
-0x382E = 0x584C
-0x382F = 0x584D
-0x3830 = 0x584F
-0x3831 = 0x5850
-0x3832 = 0x5855
-0x3833 = 0x585F
-0x3834 = 0x5861
-0x3835 = 0x5864
-0x3836 = 0x5867
-0x3837 = 0x5868
-0x3838 = 0x5878
-0x3839 = 0x587C
-0x383A = 0x587F
-0x383B = 0x5880
-0x383C = 0x5881
-0x383D = 0x5887
-0x383E = 0x5888
-0x383F = 0x5889
-0x3840 = 0x588A
-0x3841 = 0x588C
-0x3842 = 0x588D
-0x3843 = 0x588F
-0x3844 = 0x5890
-0x3845 = 0x5894
-0x3846 = 0x5896
-0x3847 = 0x589D
-0x3848 = 0x58A0
-0x3849 = 0x58A1
-0x384A = 0x58A2
-0x384B = 0x58A6
-0x384C = 0x58A9
-0x384D = 0x58B1
-0x384E = 0x58B2
-0x384F = 0x58C4
-0x3850 = 0x58BC
-0x3851 = 0x58C2
-0x3852 = 0x58C8
-0x3853 = 0x58CD
-0x3854 = 0x58CE
-0x3855 = 0x58D0
-0x3856 = 0x58D2
-0x3857 = 0x58D4
-0x3858 = 0x58D6
-0x3859 = 0x58DA
-0x385A = 0x58DD
-0x385B = 0x58E1
-0x385C = 0x58E2
-0x385D = 0x58E9
-0x385E = 0x58F3
-0x385F = 0x5905
-0x3860 = 0x5906
-0x3861 = 0x590B
-0x3862 = 0x590C
-0x3863 = 0x5912
-0x3864 = 0x5913
-0x3865 = 0x5914
-0x3866 = 0x8641
-0x3867 = 0x591D
-0x3868 = 0x5921
-0x3869 = 0x5923
-0x386A = 0x5924
-0x386B = 0x5928
-0x386C = 0x592F
-0x386D = 0x5930
-0x386E = 0x5933
-0x386F = 0x5935
-0x3870 = 0x5936
-0x3871 = 0x593F
-0x3872 = 0x5943
-0x3873 = 0x5946
-0x3874 = 0x5952
-0x3875 = 0x5953
-0x3876 = 0x5959
-0x3877 = 0x595B
-0x3878 = 0x595D
-0x3879 = 0x595E
-0x387A = 0x595F
-0x387B = 0x5961
-0x387C = 0x5963
-0x387D = 0x596B
-0x387E = 0x596D
-0x3921 = 0x596F
-0x3922 = 0x5972
-0x3923 = 0x5975
-0x3924 = 0x5976
-0x3925 = 0x5979
-0x3926 = 0x597B
-0x3927 = 0x597C
-0x3928 = 0x598B
-0x3929 = 0x598C
-0x392A = 0x598E
-0x392B = 0x5992
-0x392C = 0x5995
-0x392D = 0x5997
-0x392E = 0x599F
-0x392F = 0x59A4
-0x3930 = 0x59A7
-0x3931 = 0x59AD
-0x3932 = 0x59AE
-0x3933 = 0x59AF
-0x3934 = 0x59B0
-0x3935 = 0x59B3
-0x3936 = 0x59B7
-0x3937 = 0x59BA
-0x3938 = 0x59BC
-0x3939 = 0x59C1
-0x393A = 0x59C3
-0x393B = 0x59C4
-0x393C = 0x59C8
-0x393D = 0x59CA
-0x393E = 0x59CD
-0x393F = 0x59D2
-0x3940 = 0x59DD
-0x3941 = 0x59DE
-0x3942 = 0x59DF
-0x3943 = 0x59E3
-0x3944 = 0x59E4
-0x3945 = 0x59E7
-0x3946 = 0x59EE
-0x3947 = 0x59EF
-0x3948 = 0x59F1
-0x3949 = 0x59F2
-0x394A = 0x59F4
-0x394B = 0x59F7
-0x394C = 0x5A00
-0x394D = 0x5A04
-0x394E = 0x5A0C
-0x394F = 0x5A0D
-0x3950 = 0x5A0E
-0x3951 = 0x5A12
-0x3952 = 0x5A13
-0x3953 = 0x5A1E
-0x3954 = 0x5A23
-0x3955 = 0x5A24
-0x3956 = 0x5A27
-0x3957 = 0x5A28
-0x3958 = 0x5A2A
-0x3959 = 0x5A2D
-0x395A = 0x5A30
-0x395B = 0x5A44
-0x395C = 0x5A45
-0x395D = 0x5A47
-0x395E = 0x5A48
-0x395F = 0x5A4C
-0x3960 = 0x5A50
-0x3961 = 0x5A55
-0x3962 = 0x5A5E
-0x3963 = 0x5A63
-0x3964 = 0x5A65
-0x3965 = 0x5A67
-0x3966 = 0x5A6D
-0x3967 = 0x5A77
-0x3968 = 0x5A7A
-0x3969 = 0x5A7B
-0x396A = 0x5A7E
-0x396B = 0x5A8B
-0x396C = 0x5A90
-0x396D = 0x5A93
-0x396E = 0x5A96
-0x396F = 0x5A99
-0x3970 = 0x5A9C
-0x3971 = 0x5A9E
-0x3972 = 0x5A9F
-0x3973 = 0x5AA0
-0x3974 = 0x5AA2
-0x3975 = 0x5AA7
-0x3976 = 0x5AAC
-0x3977 = 0x5AB1
-0x3978 = 0x5AB2
-0x3979 = 0x5AB3
-0x397A = 0x5AB5
-0x397B = 0x5AB8
-0x397C = 0x5ABA
-0x397D = 0x5ABB
-0x397E = 0x5ABF
-0x3A21 = 0x5AC4
-0x3A22 = 0x5AC6
-0x3A23 = 0x5AC8
-0x3A24 = 0x5ACF
-0x3A25 = 0x5ADA
-0x3A26 = 0x5ADC
-0x3A27 = 0x5AE0
-0x3A28 = 0x5AE5
-0x3A29 = 0x5AEA
-0x3A2A = 0x5AEE
-0x3A2B = 0x5AF5
-0x3A2C = 0x5AF6
-0x3A2D = 0x5AFD
-0x3A2E = 0x5B00
-0x3A2F = 0x5B01
-0x3A30 = 0x5B08
-0x3A31 = 0x5B17
-0x3A32 = 0x5B34
-0x3A33 = 0x5B19
-0x3A34 = 0x5B1B
-0x3A35 = 0x5B1D
-0x3A36 = 0x5B21
-0x3A37 = 0x5B25
-0x3A38 = 0x5B2D
-0x3A39 = 0x5B38
-0x3A3A = 0x5B41
-0x3A3B = 0x5B4B
-0x3A3C = 0x5B4C
-0x3A3D = 0x5B52
-0x3A3E = 0x5B56
-0x3A3F = 0x5B5E
-0x3A40 = 0x5B68
-0x3A41 = 0x5B6E
-0x3A42 = 0x5B6F
-0x3A43 = 0x5B7C
-0x3A44 = 0x5B7D
-0x3A45 = 0x5B7E
-0x3A46 = 0x5B7F
-0x3A47 = 0x5B81
-0x3A48 = 0x5B84
-0x3A49 = 0x5B86
-0x3A4A = 0x5B8A
-0x3A4B = 0x5B8E
-0x3A4C = 0x5B90
-0x3A4D = 0x5B91
-0x3A4E = 0x5B93
-0x3A4F = 0x5B94
-0x3A50 = 0x5B96
-0x3A51 = 0x5BA8
-0x3A52 = 0x5BA9
-0x3A53 = 0x5BAC
-0x3A54 = 0x5BAD
-0x3A55 = 0x5BAF
-0x3A56 = 0x5BB1
-0x3A57 = 0x5BB2
-0x3A58 = 0x5BB7
-0x3A59 = 0x5BBA
-0x3A5A = 0x5BBC
-0x3A5B = 0x5BC0
-0x3A5C = 0x5BC1
-0x3A5D = 0x5BCD
-0x3A5E = 0x5BCF
-0x3A5F = 0x5BD6
-0x3A60 = 0x5BD7
-0x3A61 = 0x5BD8
-0x3A62 = 0x5BD9
-0x3A63 = 0x5BDA
-0x3A64 = 0x5BE0
-0x3A65 = 0x5BEF
-0x3A66 = 0x5BF1
-0x3A67 = 0x5BF4
-0x3A68 = 0x5BFD
-0x3A69 = 0x5C0C
-0x3A6A = 0x5C17
-0x3A6B = 0x5C1E
-0x3A6C = 0x5C1F
-0x3A6D = 0x5C23
-0x3A6E = 0x5C26
-0x3A6F = 0x5C29
-0x3A70 = 0x5C2B
-0x3A71 = 0x5C2C
-0x3A72 = 0x5C2E
-0x3A73 = 0x5C30
-0x3A74 = 0x5C32
-0x3A75 = 0x5C35
-0x3A76 = 0x5C36
-0x3A77 = 0x5C59
-0x3A78 = 0x5C5A
-0x3A79 = 0x5C5C
-0x3A7A = 0x5C62
-0x3A7B = 0x5C63
-0x3A7C = 0x5C67
-0x3A7D = 0x5C68
-0x3A7E = 0x5C69
-0x3B21 = 0x5C6D
-0x3B22 = 0x5C70
-0x3B23 = 0x5C74
-0x3B24 = 0x5C75
-0x3B25 = 0x5C7A
-0x3B26 = 0x5C7B
-0x3B27 = 0x5C7C
-0x3B28 = 0x5C7D
-0x3B29 = 0x5C87
-0x3B2A = 0x5C88
-0x3B2B = 0x5C8A
-0x3B2C = 0x5C8F
-0x3B2D = 0x5C92
-0x3B2E = 0x5C9D
-0x3B2F = 0x5C9F
-0x3B30 = 0x5CA0
-0x3B31 = 0x5CA2
-0x3B32 = 0x5CA3
-0x3B33 = 0x5CA6
-0x3B34 = 0x5CAA
-0x3B35 = 0x5CB2
-0x3B36 = 0x5CB4
-0x3B37 = 0x5CB5
-0x3B38 = 0x5CBA
-0x3B39 = 0x5CC9
-0x3B3A = 0x5CCB
-0x3B3B = 0x5CD2
-0x3B3C = 0x5CDD
-0x3B3D = 0x5CD7
-0x3B3E = 0x5CEE
-0x3B3F = 0x5CF1
-0x3B40 = 0x5CF2
-0x3B41 = 0x5CF4
-0x3B42 = 0x5D01
-0x3B43 = 0x5D06
-0x3B44 = 0x5D0D
-0x3B45 = 0x5D12
-0x3B46 = 0x5D2B
-0x3B47 = 0x5D23
-0x3B48 = 0x5D24
-0x3B49 = 0x5D26
-0x3B4A = 0x5D27
-0x3B4B = 0x5D31
-0x3B4C = 0x5D34
-0x3B4D = 0x5D39
-0x3B4E = 0x5D3D
-0x3B4F = 0x5D3F
-0x3B50 = 0x5D42
-0x3B51 = 0x5D43
-0x3B52 = 0x5D46
-0x3B53 = 0x5D48
-0x3B54 = 0x5D55
-0x3B55 = 0x5D51
-0x3B56 = 0x5D59
-0x3B57 = 0x5D4A
-0x3B58 = 0x5D5F
-0x3B59 = 0x5D60
-0x3B5A = 0x5D61
-0x3B5B = 0x5D62
-0x3B5C = 0x5D64
-0x3B5D = 0x5D6A
-0x3B5E = 0x5D6D
-0x3B5F = 0x5D70
-0x3B60 = 0x5D79
-0x3B61 = 0x5D7A
-0x3B62 = 0x5D7E
-0x3B63 = 0x5D7F
-0x3B64 = 0x5D81
-0x3B65 = 0x5D83
-0x3B66 = 0x5D88
-0x3B67 = 0x5D8A
-0x3B68 = 0x5D92
-0x3B69 = 0x5D93
-0x3B6A = 0x5D94
-0x3B6B = 0x5D95
-0x3B6C = 0x5D99
-0x3B6D = 0x5D9B
-0x3B6E = 0x5D9F
-0x3B6F = 0x5DA0
-0x3B70 = 0x5DA7
-0x3B71 = 0x5DAB
-0x3B72 = 0x5DB0
-0x3B73 = 0x5DB4
-0x3B74 = 0x5DB8
-0x3B75 = 0x5DB9
-0x3B76 = 0x5DC3
-0x3B77 = 0x5DC7
-0x3B78 = 0x5DCB
-0x3B79 = 0x5DD0
-0x3B7A = 0x5DCE
-0x3B7B = 0x5DD8
-0x3B7C = 0x5DD9
-0x3B7D = 0x5DE0
-0x3B7E = 0x5DE4
-0x3C21 = 0x5DE9
-0x3C22 = 0x5DF8
-0x3C23 = 0x5DF9
-0x3C24 = 0x5E00
-0x3C25 = 0x5E07
-0x3C26 = 0x5E0D
-0x3C27 = 0x5E12
-0x3C28 = 0x5E14
-0x3C29 = 0x5E15
-0x3C2A = 0x5E18
-0x3C2B = 0x5E1F
-0x3C2C = 0x5E20
-0x3C2D = 0x5E2E
-0x3C2E = 0x5E28
-0x3C2F = 0x5E32
-0x3C30 = 0x5E35
-0x3C31 = 0x5E3E
-0x3C32 = 0x5E4B
-0x3C33 = 0x5E50
-0x3C34 = 0x5E49
-0x3C35 = 0x5E51
-0x3C36 = 0x5E56
-0x3C37 = 0x5E58
-0x3C38 = 0x5E5B
-0x3C39 = 0x5E5C
-0x3C3A = 0x5E5E
-0x3C3B = 0x5E68
-0x3C3C = 0x5E6A
-0x3C3D = 0x5E6B
-0x3C3E = 0x5E6C
-0x3C3F = 0x5E6D
-0x3C40 = 0x5E6E
-0x3C41 = 0x5E70
-0x3C42 = 0x5E80
-0x3C43 = 0x5E8B
-0x3C44 = 0x5E8E
-0x3C45 = 0x5EA2
-0x3C46 = 0x5EA4
-0x3C47 = 0x5EA5
-0x3C48 = 0x5EA8
-0x3C49 = 0x5EAA
-0x3C4A = 0x5EAC
-0x3C4B = 0x5EB1
-0x3C4C = 0x5EB3
-0x3C4D = 0x5EBD
-0x3C4E = 0x5EBE
-0x3C4F = 0x5EBF
-0x3C50 = 0x5EC6
-0x3C51 = 0x5ECC
-0x3C52 = 0x5ECB
-0x3C53 = 0x5ECE
-0x3C54 = 0x5ED1
-0x3C55 = 0x5ED2
-0x3C56 = 0x5ED4
-0x3C57 = 0x5ED5
-0x3C58 = 0x5EDC
-0x3C59 = 0x5EDE
-0x3C5A = 0x5EE5
-0x3C5B = 0x5EEB
-0x3C5C = 0x5F02
-0x3C5D = 0x5F06
-0x3C5E = 0x5F07
-0x3C5F = 0x5F08
-0x3C60 = 0x5F0E
-0x3C61 = 0x5F19
-0x3C62 = 0x5F1C
-0x3C63 = 0x5F1D
-0x3C64 = 0x5F21
-0x3C65 = 0x5F22
-0x3C66 = 0x5F23
-0x3C67 = 0x5F24
-0x3C68 = 0x5F28
-0x3C69 = 0x5F2B
-0x3C6A = 0x5F2C
-0x3C6B = 0x5F2E
-0x3C6C = 0x5F30
-0x3C6D = 0x5F34
-0x3C6E = 0x5F36
-0x3C6F = 0x5F3B
-0x3C70 = 0x5F3D
-0x3C71 = 0x5F3F
-0x3C72 = 0x5F40
-0x3C73 = 0x5F44
-0x3C74 = 0x5F45
-0x3C75 = 0x5F47
-0x3C76 = 0x5F4D
-0x3C77 = 0x5F50
-0x3C78 = 0x5F54
-0x3C79 = 0x5F58
-0x3C7A = 0x5F5B
-0x3C7B = 0x5F60
-0x3C7C = 0x5F63
-0x3C7D = 0x5F64
-0x3C7E = 0x5F67
-0x3D21 = 0x5F6F
-0x3D22 = 0x5F72
-0x3D23 = 0x5F74
-0x3D24 = 0x5F75
-0x3D25 = 0x5F78
-0x3D26 = 0x5F7A
-0x3D27 = 0x5F7D
-0x3D28 = 0x5F7E
-0x3D29 = 0x5F89
-0x3D2A = 0x5F8D
-0x3D2B = 0x5F8F
-0x3D2C = 0x5F96
-0x3D2D = 0x5F9C
-0x3D2E = 0x5F9D
-0x3D2F = 0x5FA2
-0x3D30 = 0x5FA7
-0x3D31 = 0x5FAB
-0x3D32 = 0x5FA4
-0x3D33 = 0x5FAC
-0x3D34 = 0x5FAF
-0x3D35 = 0x5FB0
-0x3D36 = 0x5FB1
-0x3D37 = 0x5FB8
-0x3D38 = 0x5FC4
-0x3D39 = 0x5FC7
-0x3D3A = 0x5FC8
-0x3D3B = 0x5FC9
-0x3D3C = 0x5FCB
-0x3D3D = 0x5FD0
-0x3D3E = 0x5FD1
-0x3D3F = 0x5FD2
-0x3D40 = 0x5FD3
-0x3D41 = 0x5FD4
-0x3D42 = 0x5FDE
-0x3D43 = 0x5FE1
-0x3D44 = 0x5FE2
-0x3D45 = 0x5FE8
-0x3D46 = 0x5FE9
-0x3D47 = 0x5FEA
-0x3D48 = 0x5FEC
-0x3D49 = 0x5FED
-0x3D4A = 0x5FEE
-0x3D4B = 0x5FEF
-0x3D4C = 0x5FF2
-0x3D4D = 0x5FF3
-0x3D4E = 0x5FF6
-0x3D4F = 0x5FFA
-0x3D50 = 0x5FFC
-0x3D51 = 0x6007
-0x3D52 = 0x600A
-0x3D53 = 0x600D
-0x3D54 = 0x6013
-0x3D55 = 0x6014
-0x3D56 = 0x6017
-0x3D57 = 0x6018
-0x3D58 = 0x601A
-0x3D59 = 0x601F
-0x3D5A = 0x6024
-0x3D5B = 0x602D
-0x3D5C = 0x6033
-0x3D5D = 0x6035
-0x3D5E = 0x6040
-0x3D5F = 0x6047
-0x3D60 = 0x6048
-0x3D61 = 0x6049
-0x3D62 = 0x604C
-0x3D63 = 0x6051
-0x3D64 = 0x6054
-0x3D65 = 0x6056
-0x3D66 = 0x6057
-0x3D67 = 0x605D
-0x3D68 = 0x6061
-0x3D69 = 0x6067
-0x3D6A = 0x6071
-0x3D6B = 0x607E
-0x3D6C = 0x607F
-0x3D6D = 0x6082
-0x3D6E = 0x6086
-0x3D6F = 0x6088
-0x3D70 = 0x608A
-0x3D71 = 0x608E
-0x3D72 = 0x6091
-0x3D73 = 0x6093
-0x3D74 = 0x6095
-0x3D75 = 0x6098
-0x3D76 = 0x609D
-0x3D77 = 0x609E
-0x3D78 = 0x60A2
-0x3D79 = 0x60A4
-0x3D7A = 0x60A5
-0x3D7B = 0x60A8
-0x3D7C = 0x60B0
-0x3D7D = 0x60B1
-0x3D7E = 0x60B7
-0x3E21 = 0x60BB
-0x3E22 = 0x60BE
-0x3E23 = 0x60C2
-0x3E24 = 0x60C4
-0x3E25 = 0x60C8
-0x3E26 = 0x60C9
-0x3E27 = 0x60CA
-0x3E28 = 0x60CB
-0x3E29 = 0x60CE
-0x3E2A = 0x60CF
-0x3E2B = 0x60D4
-0x3E2C = 0x60D5
-0x3E2D = 0x60D9
-0x3E2E = 0x60DB
-0x3E2F = 0x60DD
-0x3E30 = 0x60DE
-0x3E31 = 0x60E2
-0x3E32 = 0x60E5
-0x3E33 = 0x60F2
-0x3E34 = 0x60F5
-0x3E35 = 0x60F8
-0x3E36 = 0x60FC
-0x3E37 = 0x60FD
-0x3E38 = 0x6102
-0x3E39 = 0x6107
-0x3E3A = 0x610A
-0x3E3B = 0x610C
-0x3E3C = 0x6110
-0x3E3D = 0x6111
-0x3E3E = 0x6112
-0x3E3F = 0x6113
-0x3E40 = 0x6114
-0x3E41 = 0x6116
-0x3E42 = 0x6117
-0x3E43 = 0x6119
-0x3E44 = 0x611C
-0x3E45 = 0x611E
-0x3E46 = 0x6122
-0x3E47 = 0x612A
-0x3E48 = 0x612B
-0x3E49 = 0x6130
-0x3E4A = 0x6131
-0x3E4B = 0x6135
-0x3E4C = 0x6136
-0x3E4D = 0x6137
-0x3E4E = 0x6139
-0x3E4F = 0x6141
-0x3E50 = 0x6145
-0x3E51 = 0x6146
-0x3E52 = 0x6149
-0x3E53 = 0x615E
-0x3E54 = 0x6160
-0x3E55 = 0x616C
-0x3E56 = 0x6172
-0x3E57 = 0x6178
-0x3E58 = 0x617B
-0x3E59 = 0x617C
-0x3E5A = 0x617F
-0x3E5B = 0x6180
-0x3E5C = 0x6181
-0x3E5D = 0x6183
-0x3E5E = 0x6184
-0x3E5F = 0x618B
-0x3E60 = 0x618D
-0x3E61 = 0x6192
-0x3E62 = 0x6193
-0x3E63 = 0x6197
-0x3E64 = 0x6198
-0x3E65 = 0x619C
-0x3E66 = 0x619D
-0x3E67 = 0x619F
-0x3E68 = 0x61A0
-0x3E69 = 0x61A5
-0x3E6A = 0x61A8
-0x3E6B = 0x61AA
-0x3E6C = 0x61AD
-0x3E6D = 0x61B8
-0x3E6E = 0x61B9
-0x3E6F = 0x61BC
-0x3E70 = 0x61C0
-0x3E71 = 0x61C1
-0x3E72 = 0x61C2
-0x3E73 = 0x61CE
-0x3E74 = 0x61CF
-0x3E75 = 0x61D5
-0x3E76 = 0x61DC
-0x3E77 = 0x61DD
-0x3E78 = 0x61DE
-0x3E79 = 0x61DF
-0x3E7A = 0x61E1
-0x3E7B = 0x61E2
-0x3E7C = 0x61E7
-0x3E7D = 0x61E9
-0x3E7E = 0x61E5
-0x3F21 = 0x61EC
-0x3F22 = 0x61ED
-0x3F23 = 0x61EF
-0x3F24 = 0x6201
-0x3F25 = 0x6203
-0x3F26 = 0x6204
-0x3F27 = 0x6207
-0x3F28 = 0x6213
-0x3F29 = 0x6215
-0x3F2A = 0x621C
-0x3F2B = 0x6220
-0x3F2C = 0x6222
-0x3F2D = 0x6223
-0x3F2E = 0x6227
-0x3F2F = 0x6229
-0x3F30 = 0x622B
-0x3F31 = 0x6239
-0x3F32 = 0x623D
-0x3F33 = 0x6242
-0x3F34 = 0x6243
-0x3F35 = 0x6244
-0x3F36 = 0x6246
-0x3F37 = 0x624C
-0x3F38 = 0x6250
-0x3F39 = 0x6251
-0x3F3A = 0x6252
-0x3F3B = 0x6254
-0x3F3C = 0x6256
-0x3F3D = 0x625A
-0x3F3E = 0x625C
-0x3F3F = 0x6264
-0x3F40 = 0x626D
-0x3F41 = 0x626F
-0x3F42 = 0x6273
-0x3F43 = 0x627A
-0x3F44 = 0x627D
-0x3F45 = 0x628D
-0x3F46 = 0x628E
-0x3F47 = 0x628F
-0x3F48 = 0x6290
-0x3F49 = 0x62A6
-0x3F4A = 0x62A8
-0x3F4B = 0x62B3
-0x3F4C = 0x62B6
-0x3F4D = 0x62B7
-0x3F4E = 0x62BA
-0x3F4F = 0x62BE
-0x3F50 = 0x62BF
-0x3F51 = 0x62C4
-0x3F52 = 0x62CE
-0x3F53 = 0x62D5
-0x3F54 = 0x62D6
-0x3F55 = 0x62DA
-0x3F56 = 0x62EA
-0x3F57 = 0x62F2
-0x3F58 = 0x62F4
-0x3F59 = 0x62FC
-0x3F5A = 0x62FD
-0x3F5B = 0x6303
-0x3F5C = 0x6304
-0x3F5D = 0x630A
-0x3F5E = 0x630B
-0x3F5F = 0x630D
-0x3F60 = 0x6310
-0x3F61 = 0x6313
-0x3F62 = 0x6316
-0x3F63 = 0x6318
-0x3F64 = 0x6329
-0x3F65 = 0x632A
-0x3F66 = 0x632D
-0x3F67 = 0x6335
-0x3F68 = 0x6336
-0x3F69 = 0x6339
-0x3F6A = 0x633C
-0x3F6B = 0x6341
-0x3F6C = 0x6342
-0x3F6D = 0x6343
-0x3F6E = 0x6344
-0x3F6F = 0x6346
-0x3F70 = 0x634A
-0x3F71 = 0x634B
-0x3F72 = 0x634E
-0x3F73 = 0x6352
-0x3F74 = 0x6353
-0x3F75 = 0x6354
-0x3F76 = 0x6358
-0x3F77 = 0x635B
-0x3F78 = 0x6365
-0x3F79 = 0x6366
-0x3F7A = 0x636C
-0x3F7B = 0x636D
-0x3F7C = 0x6371
-0x3F7D = 0x6374
-0x3F7E = 0x6375
-0x4021 = 0x6378
-0x4022 = 0x637C
-0x4023 = 0x637D
-0x4024 = 0x637F
-0x4025 = 0x6382
-0x4026 = 0x6384
-0x4027 = 0x6387
-0x4028 = 0x638A
-0x4029 = 0x6390
-0x402A = 0x6394
-0x402B = 0x6395
-0x402C = 0x6399
-0x402D = 0x639A
-0x402E = 0x639E
-0x402F = 0x63A4
-0x4030 = 0x63A6
-0x4031 = 0x63AD
-0x4032 = 0x63AE
-0x4033 = 0x63AF
-0x4034 = 0x63BD
-0x4035 = 0x63C1
-0x4036 = 0x63C5
-0x4037 = 0x63C8
-0x4038 = 0x63CE
-0x4039 = 0x63D1
-0x403A = 0x63D3
-0x403B = 0x63D4
-0x403C = 0x63D5
-0x403D = 0x63DC
-0x403E = 0x63E0
-0x403F = 0x63E5
-0x4040 = 0x63EA
-0x4041 = 0x63EC
-0x4042 = 0x63F2
-0x4043 = 0x63F3
-0x4044 = 0x63F5
-0x4045 = 0x63F8
-0x4046 = 0x63F9
-0x4047 = 0x6409
-0x4048 = 0x640A
-0x4049 = 0x6410
-0x404A = 0x6412
-0x404B = 0x6414
-0x404C = 0x6418
-0x404D = 0x641E
-0x404E = 0x6420
-0x404F = 0x6422
-0x4050 = 0x6424
-0x4051 = 0x6425
-0x4052 = 0x6429
-0x4053 = 0x642A
-0x4054 = 0x642F
-0x4055 = 0x6430
-0x4056 = 0x6435
-0x4057 = 0x643D
-0x4058 = 0x643F
-0x4059 = 0x644B
-0x405A = 0x644F
-0x405B = 0x6451
-0x405C = 0x6452
-0x405D = 0x6453
-0x405E = 0x6454
-0x405F = 0x645A
-0x4060 = 0x645B
-0x4061 = 0x645C
-0x4062 = 0x645D
-0x4063 = 0x645F
-0x4064 = 0x6460
-0x4065 = 0x6461
-0x4066 = 0x6463
-0x4067 = 0x646D
-0x4068 = 0x6473
-0x4069 = 0x6474
-0x406A = 0x647B
-0x406B = 0x647D
-0x406C = 0x6485
-0x406D = 0x6487
-0x406E = 0x648F
-0x406F = 0x6490
-0x4070 = 0x6491
-0x4071 = 0x6498
-0x4072 = 0x6499
-0x4073 = 0x649B
-0x4074 = 0x649D
-0x4075 = 0x649F
-0x4076 = 0x64A1
-0x4077 = 0x64A3
-0x4078 = 0x64A6
-0x4079 = 0x64A8
-0x407A = 0x64AC
-0x407B = 0x64B3
-0x407C = 0x64BD
-0x407D = 0x64BE
-0x407E = 0x64BF
-0x4121 = 0x64C4
-0x4122 = 0x64C9
-0x4123 = 0x64CA
-0x4124 = 0x64CB
-0x4125 = 0x64CC
-0x4126 = 0x64CE
-0x4127 = 0x64D0
-0x4128 = 0x64D1
-0x4129 = 0x64D5
-0x412A = 0x64D7
-0x412B = 0x64E4
-0x412C = 0x64E5
-0x412D = 0x64E9
-0x412E = 0x64EA
-0x412F = 0x64ED
-0x4130 = 0x64F0
-0x4131 = 0x64F5
-0x4132 = 0x64F7
-0x4133 = 0x64FB
-0x4134 = 0x64FF
-0x4135 = 0x6501
-0x4136 = 0x6504
-0x4137 = 0x6508
-0x4138 = 0x6509
-0x4139 = 0x650A
-0x413A = 0x650F
-0x413B = 0x6513
-0x413C = 0x6514
-0x413D = 0x6516
-0x413E = 0x6519
-0x413F = 0x651B
-0x4140 = 0x651E
-0x4141 = 0x651F
-0x4142 = 0x6522
-0x4143 = 0x6526
-0x4144 = 0x6529
-0x4145 = 0x652E
-0x4146 = 0x6531
-0x4147 = 0x653A
-0x4148 = 0x653C
-0x4149 = 0x653D
-0x414A = 0x6543
-0x414B = 0x6547
-0x414C = 0x6549
-0x414D = 0x6550
-0x414E = 0x6552
-0x414F = 0x6554
-0x4150 = 0x655F
-0x4151 = 0x6560
-0x4152 = 0x6567
-0x4153 = 0x656B
-0x4154 = 0x657A
-0x4155 = 0x657D
-0x4156 = 0x6581
-0x4157 = 0x6585
-0x4158 = 0x658A
-0x4159 = 0x6592
-0x415A = 0x6595
-0x415B = 0x6598
-0x415C = 0x659D
-0x415D = 0x65A0
-0x415E = 0x65A3
-0x415F = 0x65A6
-0x4160 = 0x65AE
-0x4161 = 0x65B2
-0x4162 = 0x65B3
-0x4163 = 0x65B4
-0x4164 = 0x65BF
-0x4165 = 0x65C2
-0x4166 = 0x65C8
-0x4167 = 0x65C9
-0x4168 = 0x65CE
-0x4169 = 0x65D0
-0x416A = 0x65D4
-0x416B = 0x65D6
-0x416C = 0x65D8
-0x416D = 0x65DF
-0x416E = 0x65F0
-0x416F = 0x65F2
-0x4170 = 0x65F4
-0x4171 = 0x65F5
-0x4172 = 0x65F9
-0x4173 = 0x65FE
-0x4174 = 0x65FF
-0x4175 = 0x6600
-0x4176 = 0x6604
-0x4177 = 0x6608
-0x4178 = 0x6609
-0x4179 = 0x660D
-0x417A = 0x6611
-0x417B = 0x6612
-0x417C = 0x6615
-0x417D = 0x6616
-0x417E = 0x661D
-0x4221 = 0x661E
-0x4222 = 0x6621
-0x4223 = 0x6622
-0x4224 = 0x6623
-0x4225 = 0x6624
-0x4226 = 0x6626
-0x4227 = 0x6629
-0x4228 = 0x662A
-0x4229 = 0x662B
-0x422A = 0x662C
-0x422B = 0x662E
-0x422C = 0x6630
-0x422D = 0x6631
-0x422E = 0x6633
-0x422F = 0x6639
-0x4230 = 0x6637
-0x4231 = 0x6640
-0x4232 = 0x6645
-0x4233 = 0x6646
-0x4234 = 0x664A
-0x4235 = 0x664C
-0x4236 = 0x6651
-0x4237 = 0x664E
-0x4238 = 0x6657
-0x4239 = 0x6658
-0x423A = 0x6659
-0x423B = 0x665B
-0x423C = 0x665C
-0x423D = 0x6660
-0x423E = 0x6661
-0x423F = 0x66FB
-0x4240 = 0x666A
-0x4241 = 0x666B
-0x4242 = 0x666C
-0x4243 = 0x667E
-0x4244 = 0x6673
-0x4245 = 0x6675
-0x4246 = 0x667F
-0x4247 = 0x6677
-0x4248 = 0x6678
-0x4249 = 0x6679
-0x424A = 0x667B
-0x424B = 0x6680
-0x424C = 0x667C
-0x424D = 0x668B
-0x424E = 0x668C
-0x424F = 0x668D
-0x4250 = 0x6690
-0x4251 = 0x6692
-0x4252 = 0x6699
-0x4253 = 0x669A
-0x4254 = 0x669B
-0x4255 = 0x669C
-0x4256 = 0x669F
-0x4257 = 0x66A0
-0x4258 = 0x66A4
-0x4259 = 0x66AD
-0x425A = 0x66B1
-0x425B = 0x66B2
-0x425C = 0x66B5
-0x425D = 0x66BB
-0x425E = 0x66BF
-0x425F = 0x66C0
-0x4260 = 0x66C2
-0x4261 = 0x66C3
-0x4262 = 0x66C8
-0x4263 = 0x66CC
-0x4264 = 0x66CE
-0x4265 = 0x66CF
-0x4266 = 0x66D4
-0x4267 = 0x66DB
-0x4268 = 0x66DF
-0x4269 = 0x66E8
-0x426A = 0x66EB
-0x426B = 0x66EC
-0x426C = 0x66EE
-0x426D = 0x66FA
-0x426E = 0x6705
-0x426F = 0x6707
-0x4270 = 0x670E
-0x4271 = 0x6713
-0x4272 = 0x6719
-0x4273 = 0x671C
-0x4274 = 0x6720
-0x4275 = 0x6722
-0x4276 = 0x6733
-0x4277 = 0x673E
-0x4278 = 0x6745
-0x4279 = 0x6747
-0x427A = 0x6748
-0x427B = 0x674C
-0x427C = 0x6754
-0x427D = 0x6755
-0x427E = 0x675D
-0x4321 = 0x6766
-0x4322 = 0x676C
-0x4323 = 0x676E
-0x4324 = 0x6774
-0x4325 = 0x6776
-0x4326 = 0x677B
-0x4327 = 0x6781
-0x4328 = 0x6784
-0x4329 = 0x678E
-0x432A = 0x678F
-0x432B = 0x6791
-0x432C = 0x6793
-0x432D = 0x6796
-0x432E = 0x6798
-0x432F = 0x6799
-0x4330 = 0x679B
-0x4331 = 0x67B0
-0x4332 = 0x67B1
-0x4333 = 0x67B2
-0x4334 = 0x67B5
-0x4335 = 0x67BB
-0x4336 = 0x67BC
-0x4337 = 0x67BD
-0x4338 = 0x67F9
-0x4339 = 0x67C0
-0x433A = 0x67C2
-0x433B = 0x67C3
-0x433C = 0x67C5
-0x433D = 0x67C8
-0x433E = 0x67C9
-0x433F = 0x67D2
-0x4340 = 0x67D7
-0x4341 = 0x67D9
-0x4342 = 0x67DC
-0x4343 = 0x67E1
-0x4344 = 0x67E6
-0x4345 = 0x67F0
-0x4346 = 0x67F2
-0x4347 = 0x67F6
-0x4348 = 0x67F7
-0x4349 = 0x6852
-0x434A = 0x6814
-0x434B = 0x6819
-0x434C = 0x681D
-0x434D = 0x681F
-0x434E = 0x6828
-0x434F = 0x6827
-0x4350 = 0x682C
-0x4351 = 0x682D
-0x4352 = 0x682F
-0x4353 = 0x6830
-0x4354 = 0x6831
-0x4355 = 0x6833
-0x4356 = 0x683B
-0x4357 = 0x683F
-0x4358 = 0x6844
-0x4359 = 0x6845
-0x435A = 0x684A
-0x435B = 0x684C
-0x435C = 0x6855
-0x435D = 0x6857
-0x435E = 0x6858
-0x435F = 0x685B
-0x4360 = 0x686B
-0x4361 = 0x686E
-0x4362 = 0x686F
-0x4363 = 0x6870
-0x4364 = 0x6871
-0x4365 = 0x6872
-0x4366 = 0x6875
-0x4367 = 0x6879
-0x4368 = 0x687A
-0x4369 = 0x687B
-0x436A = 0x687C
-0x436B = 0x6882
-0x436C = 0x6884
-0x436D = 0x6886
-0x436E = 0x6888
-0x436F = 0x6896
-0x4370 = 0x6898
-0x4371 = 0x689A
-0x4372 = 0x689C
-0x4373 = 0x68A1
-0x4374 = 0x68A3
-0x4375 = 0x68A5
-0x4376 = 0x68A9
-0x4377 = 0x68AA
-0x4378 = 0x68AE
-0x4379 = 0x68B2
-0x437A = 0x68BB
-0x437B = 0x68C5
-0x437C = 0x68C8
-0x437D = 0x68CC
-0x437E = 0x68CF
-0x4421 = 0x68D0
-0x4422 = 0x68D1
-0x4423 = 0x68D3
-0x4424 = 0x68D6
-0x4425 = 0x68D9
-0x4426 = 0x68DC
-0x4427 = 0x68DD
-0x4428 = 0x68E5
-0x4429 = 0x68E8
-0x442A = 0x68EA
-0x442B = 0x68EB
-0x442C = 0x68EC
-0x442D = 0x68ED
-0x442E = 0x68F0
-0x442F = 0x68F1
-0x4430 = 0x68F5
-0x4431 = 0x68F6
-0x4432 = 0x68FB
-0x4433 = 0x68FC
-0x4434 = 0x68FD
-0x4435 = 0x6906
-0x4436 = 0x6909
-0x4437 = 0x690A
-0x4438 = 0x6910
-0x4439 = 0x6911
-0x443A = 0x6913
-0x443B = 0x6916
-0x443C = 0x6917
-0x443D = 0x6931
-0x443E = 0x6933
-0x443F = 0x6935
-0x4440 = 0x6938
-0x4441 = 0x693B
-0x4442 = 0x6942
-0x4443 = 0x6945
-0x4444 = 0x6949
-0x4445 = 0x694E
-0x4446 = 0x6957
-0x4447 = 0x695B
-0x4448 = 0x6963
-0x4449 = 0x6964
-0x444A = 0x6965
-0x444B = 0x6966
-0x444C = 0x6968
-0x444D = 0x6969
-0x444E = 0x696C
-0x444F = 0x6970
-0x4450 = 0x6971
-0x4451 = 0x6972
-0x4452 = 0x697A
-0x4453 = 0x697B
-0x4454 = 0x697F
-0x4455 = 0x6980
-0x4456 = 0x698D
-0x4457 = 0x6992
-0x4458 = 0x6996
-0x4459 = 0x6998
-0x445A = 0x69A1
-0x445B = 0x69A5
-0x445C = 0x69A6
-0x445D = 0x69A8
-0x445E = 0x69AB
-0x445F = 0x69AD
-0x4460 = 0x69AF
-0x4461 = 0x69B7
-0x4462 = 0x69B8
-0x4463 = 0x69BA
-0x4464 = 0x69BC
-0x4465 = 0x69C5
-0x4466 = 0x69C8
-0x4467 = 0x69D1
-0x4468 = 0x69D6
-0x4469 = 0x69D7
-0x446A = 0x69E2
-0x446B = 0x69E5
-0x446C = 0x69EE
-0x446D = 0x69EF
-0x446E = 0x69F1
-0x446F = 0x69F3
-0x4470 = 0x69F5
-0x4471 = 0x69FE
-0x4472 = 0x6A00
-0x4473 = 0x6A01
-0x4474 = 0x6A03
-0x4475 = 0x6A0F
-0x4476 = 0x6A11
-0x4477 = 0x6A15
-0x4478 = 0x6A1A
-0x4479 = 0x6A1D
-0x447A = 0x6A20
-0x447B = 0x6A24
-0x447C = 0x6A28
-0x447D = 0x6A30
-0x447E = 0x6A32
-0x4521 = 0x6A34
-0x4522 = 0x6A37
-0x4523 = 0x6A3B
-0x4524 = 0x6A3E
-0x4525 = 0x6A3F
-0x4526 = 0x6A45
-0x4527 = 0x6A46
-0x4528 = 0x6A49
-0x4529 = 0x6A4A
-0x452A = 0x6A4E
-0x452B = 0x6A50
-0x452C = 0x6A51
-0x452D = 0x6A52
-0x452E = 0x6A55
-0x452F = 0x6A56
-0x4530 = 0x6A5B
-0x4531 = 0x6A64
-0x4532 = 0x6A67
-0x4533 = 0x6A6A
-0x4534 = 0x6A71
-0x4535 = 0x6A73
-0x4536 = 0x6A7E
-0x4537 = 0x6A81
-0x4538 = 0x6A83
-0x4539 = 0x6A86
-0x453A = 0x6A87
-0x453B = 0x6A89
-0x453C = 0x6A8B
-0x453D = 0x6A91
-0x453E = 0x6A9B
-0x453F = 0x6A9D
-0x4540 = 0x6A9E
-0x4541 = 0x6A9F
-0x4542 = 0x6AA5
-0x4543 = 0x6AAB
-0x4544 = 0x6AAF
-0x4545 = 0x6AB0
-0x4546 = 0x6AB1
-0x4547 = 0x6AB4
-0x4548 = 0x6ABD
-0x4549 = 0x6ABE
-0x454A = 0x6ABF
-0x454B = 0x6AC6
-0x454C = 0x6AC9
-0x454D = 0x6AC8
-0x454E = 0x6ACC
-0x454F = 0x6AD0
-0x4550 = 0x6AD4
-0x4551 = 0x6AD5
-0x4552 = 0x6AD6
-0x4553 = 0x6ADC
-0x4554 = 0x6ADD
-0x4555 = 0x6AE4
-0x4556 = 0x6AE7
-0x4557 = 0x6AEC
-0x4558 = 0x6AF0
-0x4559 = 0x6AF1
-0x455A = 0x6AF2
-0x455B = 0x6AFC
-0x455C = 0x6AFD
-0x455D = 0x6B02
-0x455E = 0x6B03
-0x455F = 0x6B06
-0x4560 = 0x6B07
-0x4561 = 0x6B09
-0x4562 = 0x6B0F
-0x4563 = 0x6B10
-0x4564 = 0x6B11
-0x4565 = 0x6B17
-0x4566 = 0x6B1B
-0x4567 = 0x6B1E
-0x4568 = 0x6B24
-0x4569 = 0x6B28
-0x456A = 0x6B2B
-0x456B = 0x6B2C
-0x456C = 0x6B2F
-0x456D = 0x6B35
-0x456E = 0x6B36
-0x456F = 0x6B3B
-0x4570 = 0x6B3F
-0x4571 = 0x6B46
-0x4572 = 0x6B4A
-0x4573 = 0x6B4D
-0x4574 = 0x6B52
-0x4575 = 0x6B56
-0x4576 = 0x6B58
-0x4577 = 0x6B5D
-0x4578 = 0x6B60
-0x4579 = 0x6B67
-0x457A = 0x6B6B
-0x457B = 0x6B6E
-0x457C = 0x6B70
-0x457D = 0x6B75
-0x457E = 0x6B7D
-0x4621 = 0x6B7E
-0x4622 = 0x6B82
-0x4623 = 0x6B85
-0x4624 = 0x6B97
-0x4625 = 0x6B9B
-0x4626 = 0x6B9F
-0x4627 = 0x6BA0
-0x4628 = 0x6BA2
-0x4629 = 0x6BA3
-0x462A = 0x6BA8
-0x462B = 0x6BA9
-0x462C = 0x6BAC
-0x462D = 0x6BAD
-0x462E = 0x6BAE
-0x462F = 0x6BB0
-0x4630 = 0x6BB8
-0x4631 = 0x6BB9
-0x4632 = 0x6BBD
-0x4633 = 0x6BBE
-0x4634 = 0x6BC3
-0x4635 = 0x6BC4
-0x4636 = 0x6BC9
-0x4637 = 0x6BCC
-0x4638 = 0x6BD6
-0x4639 = 0x6BDA
-0x463A = 0x6BE1
-0x463B = 0x6BE3
-0x463C = 0x6BE6
-0x463D = 0x6BE7
-0x463E = 0x6BEE
-0x463F = 0x6BF1
-0x4640 = 0x6BF7
-0x4641 = 0x6BF9
-0x4642 = 0x6BFF
-0x4643 = 0x6C02
-0x4644 = 0x6C04
-0x4645 = 0x6C05
-0x4646 = 0x6C09
-0x4647 = 0x6C0D
-0x4648 = 0x6C0E
-0x4649 = 0x6C10
-0x464A = 0x6C12
-0x464B = 0x6C19
-0x464C = 0x6C1F
-0x464D = 0x6C26
-0x464E = 0x6C27
-0x464F = 0x6C28
-0x4650 = 0x6C2C
-0x4651 = 0x6C2E
-0x4652 = 0x6C33
-0x4653 = 0x6C35
-0x4654 = 0x6C36
-0x4655 = 0x6C3A
-0x4656 = 0x6C3B
-0x4657 = 0x6C3F
-0x4658 = 0x6C4A
-0x4659 = 0x6C4B
-0x465A = 0x6C4D
-0x465B = 0x6C4F
-0x465C = 0x6C52
-0x465D = 0x6C54
-0x465E = 0x6C59
-0x465F = 0x6C5B
-0x4660 = 0x6C5C
-0x4661 = 0x6C6B
-0x4662 = 0x6C6D
-0x4663 = 0x6C6F
-0x4664 = 0x6C74
-0x4665 = 0x6C76
-0x4666 = 0x6C78
-0x4667 = 0x6C79
-0x4668 = 0x6C7B
-0x4669 = 0x6C85
-0x466A = 0x6C86
-0x466B = 0x6C87
-0x466C = 0x6C89
-0x466D = 0x6C94
-0x466E = 0x6C95
-0x466F = 0x6C97
-0x4670 = 0x6C98
-0x4671 = 0x6C9C
-0x4672 = 0x6C9F
-0x4673 = 0x6CB0
-0x4674 = 0x6CB2
-0x4675 = 0x6CB4
-0x4676 = 0x6CC2
-0x4677 = 0x6CC6
-0x4678 = 0x6CCD
-0x4679 = 0x6CCF
-0x467A = 0x6CD0
-0x467B = 0x6CD1
-0x467C = 0x6CD2
-0x467D = 0x6CD4
-0x467E = 0x6CD6
-0x4721 = 0x6CDA
-0x4722 = 0x6CDC
-0x4723 = 0x6CE0
-0x4724 = 0x6CE7
-0x4725 = 0x6CE9
-0x4726 = 0x6CEB
-0x4727 = 0x6CEC
-0x4728 = 0x6CEE
-0x4729 = 0x6CF2
-0x472A = 0x6CF4
-0x472B = 0x6D04
-0x472C = 0x6D07
-0x472D = 0x6D0A
-0x472E = 0x6D0E
-0x472F = 0x6D0F
-0x4730 = 0x6D11
-0x4731 = 0x6D13
-0x4732 = 0x6D1A
-0x4733 = 0x6D26
-0x4734 = 0x6D27
-0x4735 = 0x6D28
-0x4736 = 0x6C67
-0x4737 = 0x6D2E
-0x4738 = 0x6D2F
-0x4739 = 0x6D31
-0x473A = 0x6D39
-0x473B = 0x6D3C
-0x473C = 0x6D3F
-0x473D = 0x6D57
-0x473E = 0x6D5E
-0x473F = 0x6D5F
-0x4740 = 0x6D61
-0x4741 = 0x6D65
-0x4742 = 0x6D67
-0x4743 = 0x6D6F
-0x4744 = 0x6D70
-0x4745 = 0x6D7C
-0x4746 = 0x6D82
-0x4747 = 0x6D87
-0x4748 = 0x6D91
-0x4749 = 0x6D92
-0x474A = 0x6D94
-0x474B = 0x6D96
-0x474C = 0x6D97
-0x474D = 0x6D98
-0x474E = 0x6DAA
-0x474F = 0x6DAC
-0x4750 = 0x6DB4
-0x4751 = 0x6DB7
-0x4752 = 0x6DB9
-0x4753 = 0x6DBD
-0x4754 = 0x6DBF
-0x4755 = 0x6DC4
-0x4756 = 0x6DC8
-0x4757 = 0x6DCA
-0x4758 = 0x6DCE
-0x4759 = 0x6DCF
-0x475A = 0x6DD6
-0x475B = 0x6DDB
-0x475C = 0x6DDD
-0x475D = 0x6DDF
-0x475E = 0x6DE0
-0x475F = 0x6DE2
-0x4760 = 0x6DE5
-0x4761 = 0x6DE9
-0x4762 = 0x6DEF
-0x4763 = 0x6DF0
-0x4764 = 0x6DF4
-0x4765 = 0x6DF6
-0x4766 = 0x6DFC
-0x4767 = 0x6E00
-0x4768 = 0x6E04
-0x4769 = 0x6E1E
-0x476A = 0x6E22
-0x476B = 0x6E27
-0x476C = 0x6E32
-0x476D = 0x6E36
-0x476E = 0x6E39
-0x476F = 0x6E3B
-0x4770 = 0x6E3C
-0x4771 = 0x6E44
-0x4772 = 0x6E45
-0x4773 = 0x6E48
-0x4774 = 0x6E49
-0x4775 = 0x6E4B
-0x4776 = 0x6E4F
-0x4777 = 0x6E51
-0x4778 = 0x6E52
-0x4779 = 0x6E53
-0x477A = 0x6E54
-0x477B = 0x6E57
-0x477C = 0x6E5C
-0x477D = 0x6E5D
-0x477E = 0x6E5E
-0x4821 = 0x6E62
-0x4822 = 0x6E63
-0x4823 = 0x6E68
-0x4824 = 0x6E73
-0x4825 = 0x6E7B
-0x4826 = 0x6E7D
-0x4827 = 0x6E8D
-0x4828 = 0x6E93
-0x4829 = 0x6E99
-0x482A = 0x6EA0
-0x482B = 0x6EA7
-0x482C = 0x6EAD
-0x482D = 0x6EAE
-0x482E = 0x6EB1
-0x482F = 0x6EB3
-0x4830 = 0x6EBB
-0x4831 = 0x6EBF
-0x4832 = 0x6EC0
-0x4833 = 0x6EC1
-0x4834 = 0x6EC3
-0x4835 = 0x6EC7
-0x4836 = 0x6EC8
-0x4837 = 0x6ECA
-0x4838 = 0x6ECD
-0x4839 = 0x6ECE
-0x483A = 0x6ECF
-0x483B = 0x6EEB
-0x483C = 0x6EED
-0x483D = 0x6EEE
-0x483E = 0x6EF9
-0x483F = 0x6EFB
-0x4840 = 0x6EFD
-0x4841 = 0x6F04
-0x4842 = 0x6F08
-0x4843 = 0x6F0A
-0x4844 = 0x6F0C
-0x4845 = 0x6F0D
-0x4846 = 0x6F16
-0x4847 = 0x6F18
-0x4848 = 0x6F1A
-0x4849 = 0x6F1B
-0x484A = 0x6F26
-0x484B = 0x6F29
-0x484C = 0x6F2A
-0x484D = 0x6F2F
-0x484E = 0x6F30
-0x484F = 0x6F33
-0x4850 = 0x6F36
-0x4851 = 0x6F3B
-0x4852 = 0x6F3C
-0x4853 = 0x6F2D
-0x4854 = 0x6F4F
-0x4855 = 0x6F51
-0x4856 = 0x6F52
-0x4857 = 0x6F53
-0x4858 = 0x6F57
-0x4859 = 0x6F59
-0x485A = 0x6F5A
-0x485B = 0x6F5D
-0x485C = 0x6F5E
-0x485D = 0x6F61
-0x485E = 0x6F62
-0x485F = 0x6F68
-0x4860 = 0x6F6C
-0x4861 = 0x6F7D
-0x4862 = 0x6F7E
-0x4863 = 0x6F83
-0x4864 = 0x6F87
-0x4865 = 0x6F88
-0x4866 = 0x6F8B
-0x4867 = 0x6F8C
-0x4868 = 0x6F8D
-0x4869 = 0x6F90
-0x486A = 0x6F92
-0x486B = 0x6F93
-0x486C = 0x6F94
-0x486D = 0x6F96
-0x486E = 0x6F9A
-0x486F = 0x6F9F
-0x4870 = 0x6FA0
-0x4871 = 0x6FA5
-0x4872 = 0x6FA6
-0x4873 = 0x6FA7
-0x4874 = 0x6FA8
-0x4875 = 0x6FAE
-0x4876 = 0x6FAF
-0x4877 = 0x6FB0
-0x4878 = 0x6FB5
-0x4879 = 0x6FB6
-0x487A = 0x6FBC
-0x487B = 0x6FC5
-0x487C = 0x6FC7
-0x487D = 0x6FC8
-0x487E = 0x6FCA
-0x4921 = 0x6FDA
-0x4922 = 0x6FDE
-0x4923 = 0x6FE8
-0x4924 = 0x6FE9
-0x4925 = 0x6FF0
-0x4926 = 0x6FF5
-0x4927 = 0x6FF9
-0x4928 = 0x6FFC
-0x4929 = 0x6FFD
-0x492A = 0x7000
-0x492B = 0x7005
-0x492C = 0x7006
-0x492D = 0x7007
-0x492E = 0x700D
-0x492F = 0x7017
-0x4930 = 0x7020
-0x4931 = 0x7023
-0x4932 = 0x702F
-0x4933 = 0x7034
-0x4934 = 0x7037
-0x4935 = 0x7039
-0x4936 = 0x703C
-0x4937 = 0x7043
-0x4938 = 0x7044
-0x4939 = 0x7048
-0x493A = 0x7049
-0x493B = 0x704A
-0x493C = 0x704B
-0x493D = 0x7054
-0x493E = 0x7055
-0x493F = 0x705D
-0x4940 = 0x705E
-0x4941 = 0x704E
-0x4942 = 0x7064
-0x4943 = 0x7065
-0x4944 = 0x706C
-0x4945 = 0x706E
-0x4946 = 0x7075
-0x4947 = 0x7076
-0x4948 = 0x707E
-0x4949 = 0x7081
-0x494A = 0x7085
-0x494B = 0x7086
-0x494C = 0x7094
-0x494D = 0x7095
-0x494E = 0x7096
-0x494F = 0x7097
-0x4950 = 0x7098
-0x4951 = 0x709B
-0x4952 = 0x70A4
-0x4953 = 0x70AB
-0x4954 = 0x70B0
-0x4955 = 0x70B1
-0x4956 = 0x70B4
-0x4957 = 0x70B7
-0x4958 = 0x70CA
-0x4959 = 0x70D1
-0x495A = 0x70D3
-0x495B = 0x70D4
-0x495C = 0x70D5
-0x495D = 0x70D6
-0x495E = 0x70D8
-0x495F = 0x70DC
-0x4960 = 0x70E4
-0x4961 = 0x70FA
-0x4962 = 0x7103
-0x4963 = 0x7104
-0x4964 = 0x7105
-0x4965 = 0x7106
-0x4966 = 0x7107
-0x4967 = 0x710B
-0x4968 = 0x710C
-0x4969 = 0x710F
-0x496A = 0x711E
-0x496B = 0x7120
-0x496C = 0x712B
-0x496D = 0x712D
-0x496E = 0x712F
-0x496F = 0x7130
-0x4970 = 0x7131
-0x4971 = 0x7138
-0x4972 = 0x7141
-0x4973 = 0x7145
-0x4974 = 0x7146
-0x4975 = 0x7147
-0x4976 = 0x714A
-0x4977 = 0x714B
-0x4978 = 0x7150
-0x4979 = 0x7152
-0x497A = 0x7157
-0x497B = 0x715A
-0x497C = 0x715C
-0x497D = 0x715E
-0x497E = 0x7160
-0x4A21 = 0x7168
-0x4A22 = 0x7179
-0x4A23 = 0x7180
-0x4A24 = 0x7185
-0x4A25 = 0x7187
-0x4A26 = 0x718C
-0x4A27 = 0x7192
-0x4A28 = 0x719A
-0x4A29 = 0x719B
-0x4A2A = 0x71A0
-0x4A2B = 0x71A2
-0x4A2C = 0x71AF
-0x4A2D = 0x71B0
-0x4A2E = 0x71B2
-0x4A2F = 0x71B3
-0x4A30 = 0x71BA
-0x4A31 = 0x71BF
-0x4A32 = 0x71C0
-0x4A33 = 0x71C1
-0x4A34 = 0x71C4
-0x4A35 = 0x71CB
-0x4A36 = 0x71CC
-0x4A37 = 0x71D3
-0x4A38 = 0x71D6
-0x4A39 = 0x71D9
-0x4A3A = 0x71DA
-0x4A3B = 0x71DC
-0x4A3C = 0x71F8
-0x4A3D = 0x71FE
-0x4A3E = 0x7200
-0x4A3F = 0x7207
-0x4A40 = 0x7208
-0x4A41 = 0x7209
-0x4A42 = 0x7213
-0x4A43 = 0x7217
-0x4A44 = 0x721A
-0x4A45 = 0x721D
-0x4A46 = 0x721F
-0x4A47 = 0x7224
-0x4A48 = 0x722B
-0x4A49 = 0x722F
-0x4A4A = 0x7234
-0x4A4B = 0x7238
-0x4A4C = 0x7239
-0x4A4D = 0x7241
-0x4A4E = 0x7242
-0x4A4F = 0x7243
-0x4A50 = 0x7245
-0x4A51 = 0x724E
-0x4A52 = 0x724F
-0x4A53 = 0x7250
-0x4A54 = 0x7253
-0x4A55 = 0x7255
-0x4A56 = 0x7256
-0x4A57 = 0x725A
-0x4A58 = 0x725C
-0x4A59 = 0x725E
-0x4A5A = 0x7260
-0x4A5B = 0x7263
-0x4A5C = 0x7268
-0x4A5D = 0x726B
-0x4A5E = 0x726E
-0x4A5F = 0x726F
-0x4A60 = 0x7271
-0x4A61 = 0x7277
-0x4A62 = 0x7278
-0x4A63 = 0x727B
-0x4A64 = 0x727C
-0x4A65 = 0x727F
-0x4A66 = 0x7284
-0x4A67 = 0x7289
-0x4A68 = 0x728D
-0x4A69 = 0x728E
-0x4A6A = 0x7293
-0x4A6B = 0x729B
-0x4A6C = 0x72A8
-0x4A6D = 0x72AD
-0x4A6E = 0x72AE
-0x4A6F = 0x72B1
-0x4A70 = 0x72B4
-0x4A71 = 0x72BE
-0x4A72 = 0x72C1
-0x4A73 = 0x72C7
-0x4A74 = 0x72C9
-0x4A75 = 0x72CC
-0x4A76 = 0x72D5
-0x4A77 = 0x72D6
-0x4A78 = 0x72D8
-0x4A79 = 0x72DF
-0x4A7A = 0x72E5
-0x4A7B = 0x72F3
-0x4A7C = 0x72F4
-0x4A7D = 0x72FA
-0x4A7E = 0x72FB
-0x4B21 = 0x72FE
-0x4B22 = 0x7302
-0x4B23 = 0x7304
-0x4B24 = 0x7305
-0x4B25 = 0x7307
-0x4B26 = 0x730B
-0x4B27 = 0x730D
-0x4B28 = 0x7312
-0x4B29 = 0x7313
-0x4B2A = 0x7318
-0x4B2B = 0x7319
-0x4B2C = 0x731E
-0x4B2D = 0x7322
-0x4B2E = 0x7324
-0x4B2F = 0x7327
-0x4B30 = 0x7328
-0x4B31 = 0x732C
-0x4B32 = 0x7331
-0x4B33 = 0x7332
-0x4B34 = 0x7335
-0x4B35 = 0x733A
-0x4B36 = 0x733B
-0x4B37 = 0x733D
-0x4B38 = 0x7343
-0x4B39 = 0x734D
-0x4B3A = 0x7350
-0x4B3B = 0x7352
-0x4B3C = 0x7356
-0x4B3D = 0x7358
-0x4B3E = 0x735D
-0x4B3F = 0x735E
-0x4B40 = 0x735F
-0x4B41 = 0x7360
-0x4B42 = 0x7366
-0x4B43 = 0x7367
-0x4B44 = 0x7369
-0x4B45 = 0x736B
-0x4B46 = 0x736C
-0x4B47 = 0x736E
-0x4B48 = 0x736F
-0x4B49 = 0x7371
-0x4B4A = 0x7377
-0x4B4B = 0x7379
-0x4B4C = 0x737C
-0x4B4D = 0x7380
-0x4B4E = 0x7381
-0x4B4F = 0x7383
-0x4B50 = 0x7385
-0x4B51 = 0x7386
-0x4B52 = 0x738E
-0x4B53 = 0x7390
-0x4B54 = 0x7393
-0x4B55 = 0x7395
-0x4B56 = 0x7397
-0x4B57 = 0x7398
-0x4B58 = 0x739C
-0x4B59 = 0x739E
-0x4B5A = 0x739F
-0x4B5B = 0x73A0
-0x4B5C = 0x73A2
-0x4B5D = 0x73A5
-0x4B5E = 0x73A6
-0x4B5F = 0x73AA
-0x4B60 = 0x73AB
-0x4B61 = 0x73AD
-0x4B62 = 0x73B5
-0x4B63 = 0x73B7
-0x4B64 = 0x73B9
-0x4B65 = 0x73BC
-0x4B66 = 0x73BD
-0x4B67 = 0x73BF
-0x4B68 = 0x73C5
-0x4B69 = 0x73C6
-0x4B6A = 0x73C9
-0x4B6B = 0x73CB
-0x4B6C = 0x73CC
-0x4B6D = 0x73CF
-0x4B6E = 0x73D2
-0x4B6F = 0x73D3
-0x4B70 = 0x73D6
-0x4B71 = 0x73D9
-0x4B72 = 0x73DD
-0x4B73 = 0x73E1
-0x4B74 = 0x73E3
-0x4B75 = 0x73E6
-0x4B76 = 0x73E7
-0x4B77 = 0x73E9
-0x4B78 = 0x73F4
-0x4B79 = 0x73F5
-0x4B7A = 0x73F7
-0x4B7B = 0x73F9
-0x4B7C = 0x73FA
-0x4B7D = 0x73FB
-0x4B7E = 0x73FD
-0x4C21 = 0x73FF
-0x4C22 = 0x7400
-0x4C23 = 0x7401
-0x4C24 = 0x7404
-0x4C25 = 0x7407
-0x4C26 = 0x740A
-0x4C27 = 0x7411
-0x4C28 = 0x741A
-0x4C29 = 0x741B
-0x4C2A = 0x7424
-0x4C2B = 0x7426
-0x4C2C = 0x7428
-0x4C2D = 0x7429
-0x4C2E = 0x742A
-0x4C2F = 0x742B
-0x4C30 = 0x742C
-0x4C31 = 0x742D
-0x4C32 = 0x742E
-0x4C33 = 0x742F
-0x4C34 = 0x7430
-0x4C35 = 0x7431
-0x4C36 = 0x7439
-0x4C37 = 0x7440
-0x4C38 = 0x7443
-0x4C39 = 0x7444
-0x4C3A = 0x7446
-0x4C3B = 0x7447
-0x4C3C = 0x744B
-0x4C3D = 0x744D
-0x4C3E = 0x7451
-0x4C3F = 0x7452
-0x4C40 = 0x7457
-0x4C41 = 0x745D
-0x4C42 = 0x7462
-0x4C43 = 0x7466
-0x4C44 = 0x7467
-0x4C45 = 0x7468
-0x4C46 = 0x746B
-0x4C47 = 0x746D
-0x4C48 = 0x746E
-0x4C49 = 0x7471
-0x4C4A = 0x7472
-0x4C4B = 0x7480
-0x4C4C = 0x7481
-0x4C4D = 0x7485
-0x4C4E = 0x7486
-0x4C4F = 0x7487
-0x4C50 = 0x7489
-0x4C51 = 0x748F
-0x4C52 = 0x7490
-0x4C53 = 0x7491
-0x4C54 = 0x7492
-0x4C55 = 0x7498
-0x4C56 = 0x7499
-0x4C57 = 0x749A
-0x4C58 = 0x749C
-0x4C59 = 0x749F
-0x4C5A = 0x74A0
-0x4C5B = 0x74A1
-0x4C5C = 0x74A3
-0x4C5D = 0x74A6
-0x4C5E = 0x74A8
-0x4C5F = 0x74A9
-0x4C60 = 0x74AA
-0x4C61 = 0x74AB
-0x4C62 = 0x74AE
-0x4C63 = 0x74AF
-0x4C64 = 0x74B1
-0x4C65 = 0x74B2
-0x4C66 = 0x74B5
-0x4C67 = 0x74B9
-0x4C68 = 0x74BB
-0x4C69 = 0x74BF
-0x4C6A = 0x74C8
-0x4C6B = 0x74C9
-0x4C6C = 0x74CC
-0x4C6D = 0x74D0
-0x4C6E = 0x74D3
-0x4C6F = 0x74D8
-0x4C70 = 0x74DA
-0x4C71 = 0x74DB
-0x4C72 = 0x74DE
-0x4C73 = 0x74DF
-0x4C74 = 0x74E4
-0x4C75 = 0x74E8
-0x4C76 = 0x74EA
-0x4C77 = 0x74EB
-0x4C78 = 0x74EF
-0x4C79 = 0x74F4
-0x4C7A = 0x74FA
-0x4C7B = 0x74FB
-0x4C7C = 0x74FC
-0x4C7D = 0x74FF
-0x4C7E = 0x7506
-0x4D21 = 0x7512
-0x4D22 = 0x7516
-0x4D23 = 0x7517
-0x4D24 = 0x7520
-0x4D25 = 0x7521
-0x4D26 = 0x7524
-0x4D27 = 0x7527
-0x4D28 = 0x7529
-0x4D29 = 0x752A
-0x4D2A = 0x752F
-0x4D2B = 0x7536
-0x4D2C = 0x7539
-0x4D2D = 0x753D
-0x4D2E = 0x753E
-0x4D2F = 0x753F
-0x4D30 = 0x7540
-0x4D31 = 0x7543
-0x4D32 = 0x7547
-0x4D33 = 0x7548
-0x4D34 = 0x754E
-0x4D35 = 0x7550
-0x4D36 = 0x7552
-0x4D37 = 0x7557
-0x4D38 = 0x755E
-0x4D39 = 0x755F
-0x4D3A = 0x7561
-0x4D3B = 0x756F
-0x4D3C = 0x7571
-0x4D3D = 0x7579
-0x4D3E = 0x757A
-0x4D3F = 0x757B
-0x4D40 = 0x757C
-0x4D41 = 0x757D
-0x4D42 = 0x757E
-0x4D43 = 0x7581
-0x4D44 = 0x7585
-0x4D45 = 0x7590
-0x4D46 = 0x7592
-0x4D47 = 0x7593
-0x4D48 = 0x7595
-0x4D49 = 0x7599
-0x4D4A = 0x759C
-0x4D4B = 0x75A2
-0x4D4C = 0x75A4
-0x4D4D = 0x75B4
-0x4D4E = 0x75BA
-0x4D4F = 0x75BF
-0x4D50 = 0x75C0
-0x4D51 = 0x75C1
-0x4D52 = 0x75C4
-0x4D53 = 0x75C6
-0x4D54 = 0x75CC
-0x4D55 = 0x75CE
-0x4D56 = 0x75CF
-0x4D57 = 0x75D7
-0x4D58 = 0x75DC
-0x4D59 = 0x75DF
-0x4D5A = 0x75E0
-0x4D5B = 0x75E1
-0x4D5C = 0x75E4
-0x4D5D = 0x75E7
-0x4D5E = 0x75EC
-0x4D5F = 0x75EE
-0x4D60 = 0x75EF
-0x4D61 = 0x75F1
-0x4D62 = 0x75F9
-0x4D63 = 0x7600
-0x4D64 = 0x7602
-0x4D65 = 0x7603
-0x4D66 = 0x7604
-0x4D67 = 0x7607
-0x4D68 = 0x7608
-0x4D69 = 0x760A
-0x4D6A = 0x760C
-0x4D6B = 0x760F
-0x4D6C = 0x7612
-0x4D6D = 0x7613
-0x4D6E = 0x7615
-0x4D6F = 0x7616
-0x4D70 = 0x7619
-0x4D71 = 0x761B
-0x4D72 = 0x761C
-0x4D73 = 0x761D
-0x4D74 = 0x761E
-0x4D75 = 0x7623
-0x4D76 = 0x7625
-0x4D77 = 0x7626
-0x4D78 = 0x7629
-0x4D79 = 0x762D
-0x4D7A = 0x7632
-0x4D7B = 0x7633
-0x4D7C = 0x7635
-0x4D7D = 0x7638
-0x4D7E = 0x7639
-0x4E21 = 0x763A
-0x4E22 = 0x763C
-0x4E23 = 0x764A
-0x4E24 = 0x7640
-0x4E25 = 0x7641
-0x4E26 = 0x7643
-0x4E27 = 0x7644
-0x4E28 = 0x7645
-0x4E29 = 0x7649
-0x4E2A = 0x764B
-0x4E2B = 0x7655
-0x4E2C = 0x7659
-0x4E2D = 0x765F
-0x4E2E = 0x7664
-0x4E2F = 0x7665
-0x4E30 = 0x766D
-0x4E31 = 0x766E
-0x4E32 = 0x766F
-0x4E33 = 0x7671
-0x4E34 = 0x7674
-0x4E35 = 0x7681
-0x4E36 = 0x7685
-0x4E37 = 0x768C
-0x4E38 = 0x768D
-0x4E39 = 0x7695
-0x4E3A = 0x769B
-0x4E3B = 0x769C
-0x4E3C = 0x769D
-0x4E3D = 0x769F
-0x4E3E = 0x76A0
-0x4E3F = 0x76A2
-0x4E40 = 0x76A3
-0x4E41 = 0x76A4
-0x4E42 = 0x76A5
-0x4E43 = 0x76A6
-0x4E44 = 0x76A7
-0x4E45 = 0x76A8
-0x4E46 = 0x76AA
-0x4E47 = 0x76AD
-0x4E48 = 0x76BD
-0x4E49 = 0x76C1
-0x4E4A = 0x76C5
-0x4E4B = 0x76C9
-0x4E4C = 0x76CB
-0x4E4D = 0x76CC
-0x4E4E = 0x76CE
-0x4E4F = 0x76D4
-0x4E50 = 0x76D9
-0x4E51 = 0x76E0
-0x4E52 = 0x76E6
-0x4E53 = 0x76E8
-0x4E54 = 0x76EC
-0x4E55 = 0x76F0
-0x4E56 = 0x76F1
-0x4E57 = 0x76F6
-0x4E58 = 0x76F9
-0x4E59 = 0x76FC
-0x4E5A = 0x7700
-0x4E5B = 0x7706
-0x4E5C = 0x770A
-0x4E5D = 0x770E
-0x4E5E = 0x7712
-0x4E5F = 0x7714
-0x4E60 = 0x7715
-0x4E61 = 0x7717
-0x4E62 = 0x7719
-0x4E63 = 0x771A
-0x4E64 = 0x771C
-0x4E65 = 0x7722
-0x4E66 = 0x7728
-0x4E67 = 0x772D
-0x4E68 = 0x772E
-0x4E69 = 0x772F
-0x4E6A = 0x7734
-0x4E6B = 0x7735
-0x4E6C = 0x7736
-0x4E6D = 0x7739
-0x4E6E = 0x773D
-0x4E6F = 0x773E
-0x4E70 = 0x7742
-0x4E71 = 0x7745
-0x4E72 = 0x7746
-0x4E73 = 0x774A
-0x4E74 = 0x774D
-0x4E75 = 0x774E
-0x4E76 = 0x774F
-0x4E77 = 0x7752
-0x4E78 = 0x7756
-0x4E79 = 0x7757
-0x4E7A = 0x775C
-0x4E7B = 0x775E
-0x4E7C = 0x775F
-0x4E7D = 0x7760
-0x4E7E = 0x7762
-0x4F21 = 0x7764
-0x4F22 = 0x7767
-0x4F23 = 0x776A
-0x4F24 = 0x776C
-0x4F25 = 0x7770
-0x4F26 = 0x7772
-0x4F27 = 0x7773
-0x4F28 = 0x7774
-0x4F29 = 0x777A
-0x4F2A = 0x777D
-0x4F2B = 0x7780
-0x4F2C = 0x7784
-0x4F2D = 0x778C
-0x4F2E = 0x778D
-0x4F2F = 0x7794
-0x4F30 = 0x7795
-0x4F31 = 0x7796
-0x4F32 = 0x779A
-0x4F33 = 0x779F
-0x4F34 = 0x77A2
-0x4F35 = 0x77A7
-0x4F36 = 0x77AA
-0x4F37 = 0x77AE
-0x4F38 = 0x77AF
-0x4F39 = 0x77B1
-0x4F3A = 0x77B5
-0x4F3B = 0x77BE
-0x4F3C = 0x77C3
-0x4F3D = 0x77C9
-0x4F3E = 0x77D1
-0x4F3F = 0x77D2
-0x4F40 = 0x77D5
-0x4F41 = 0x77D9
-0x4F42 = 0x77DE
-0x4F43 = 0x77DF
-0x4F44 = 0x77E0
-0x4F45 = 0x77E4
-0x4F46 = 0x77E6
-0x4F47 = 0x77EA
-0x4F48 = 0x77EC
-0x4F49 = 0x77F0
-0x4F4A = 0x77F1
-0x4F4B = 0x77F4
-0x4F4C = 0x77F8
-0x4F4D = 0x77FB
-0x4F4E = 0x7805
-0x4F4F = 0x7806
-0x4F50 = 0x7809
-0x4F51 = 0x780D
-0x4F52 = 0x780E
-0x4F53 = 0x7811
-0x4F54 = 0x781D
-0x4F55 = 0x7821
-0x4F56 = 0x7822
-0x4F57 = 0x7823
-0x4F58 = 0x782D
-0x4F59 = 0x782E
-0x4F5A = 0x7830
-0x4F5B = 0x7835
-0x4F5C = 0x7837
-0x4F5D = 0x7843
-0x4F5E = 0x7844
-0x4F5F = 0x7847
-0x4F60 = 0x7848
-0x4F61 = 0x784C
-0x4F62 = 0x784E
-0x4F63 = 0x7852
-0x4F64 = 0x785C
-0x4F65 = 0x785E
-0x4F66 = 0x7860
-0x4F67 = 0x7861
-0x4F68 = 0x7863
-0x4F69 = 0x7864
-0x4F6A = 0x7868
-0x4F6B = 0x786A
-0x4F6C = 0x786E
-0x4F6D = 0x787A
-0x4F6E = 0x787E
-0x4F6F = 0x788A
-0x4F70 = 0x788F
-0x4F71 = 0x7894
-0x4F72 = 0x7898
-0x4F73 = 0x78A1
-0x4F74 = 0x789D
-0x4F75 = 0x789E
-0x4F76 = 0x789F
-0x4F77 = 0x78A4
-0x4F78 = 0x78A8
-0x4F79 = 0x78AC
-0x4F7A = 0x78AD
-0x4F7B = 0x78B0
-0x4F7C = 0x78B1
-0x4F7D = 0x78B2
-0x4F7E = 0x78B3
-0x5021 = 0x78BB
-0x5022 = 0x78BD
-0x5023 = 0x78BF
-0x5024 = 0x78C7
-0x5025 = 0x78C8
-0x5026 = 0x78C9
-0x5027 = 0x78CC
-0x5028 = 0x78CE
-0x5029 = 0x78D2
-0x502A = 0x78D3
-0x502B = 0x78D5
-0x502C = 0x78D6
-0x502D = 0x78E4
-0x502E = 0x78DB
-0x502F = 0x78DF
-0x5030 = 0x78E0
-0x5031 = 0x78E1
-0x5032 = 0x78E6
-0x5033 = 0x78EA
-0x5034 = 0x78F2
-0x5035 = 0x78F3
-0x5036 = 0x7900
-0x5037 = 0x78F6
-0x5038 = 0x78F7
-0x5039 = 0x78FA
-0x503A = 0x78FB
-0x503B = 0x78FF
-0x503C = 0x7906
-0x503D = 0x790C
-0x503E = 0x7910
-0x503F = 0x791A
-0x5040 = 0x791C
-0x5041 = 0x791E
-0x5042 = 0x791F
-0x5043 = 0x7920
-0x5044 = 0x7925
-0x5045 = 0x7927
-0x5046 = 0x7929
-0x5047 = 0x792D
-0x5048 = 0x7931
-0x5049 = 0x7934
-0x504A = 0x7935
-0x504B = 0x793B
-0x504C = 0x793D
-0x504D = 0x793F
-0x504E = 0x7944
-0x504F = 0x7945
-0x5050 = 0x7946
-0x5051 = 0x794A
-0x5052 = 0x794B
-0x5053 = 0x794F
-0x5054 = 0x7951
-0x5055 = 0x7954
-0x5056 = 0x7958
-0x5057 = 0x795B
-0x5058 = 0x795C
-0x5059 = 0x7967
-0x505A = 0x7969
-0x505B = 0x796B
-0x505C = 0x7972
-0x505D = 0x7979
-0x505E = 0x797B
-0x505F = 0x797C
-0x5060 = 0x797E
-0x5061 = 0x798B
-0x5062 = 0x798C
-0x5063 = 0x7991
-0x5064 = 0x7993
-0x5065 = 0x7994
-0x5066 = 0x7995
-0x5067 = 0x7996
-0x5068 = 0x7998
-0x5069 = 0x799B
-0x506A = 0x799C
-0x506B = 0x79A1
-0x506C = 0x79A8
-0x506D = 0x79A9
-0x506E = 0x79AB
-0x506F = 0x79AF
-0x5070 = 0x79B1
-0x5071 = 0x79B4
-0x5072 = 0x79B8
-0x5073 = 0x79BB
-0x5074 = 0x79C2
-0x5075 = 0x79C4
-0x5076 = 0x79C7
-0x5077 = 0x79C8
-0x5078 = 0x79CA
-0x5079 = 0x79CF
-0x507A = 0x79D4
-0x507B = 0x79D6
-0x507C = 0x79DA
-0x507D = 0x79DD
-0x507E = 0x79DE
-0x5121 = 0x79E0
-0x5122 = 0x79E2
-0x5123 = 0x79E5
-0x5124 = 0x79EA
-0x5125 = 0x79EB
-0x5126 = 0x79ED
-0x5127 = 0x79F1
-0x5128 = 0x79F8
-0x5129 = 0x79FC
-0x512A = 0x7A02
-0x512B = 0x7A03
-0x512C = 0x7A07
-0x512D = 0x7A09
-0x512E = 0x7A0A
-0x512F = 0x7A0C
-0x5130 = 0x7A11
-0x5131 = 0x7A15
-0x5132 = 0x7A1B
-0x5133 = 0x7A1E
-0x5134 = 0x7A21
-0x5135 = 0x7A27
-0x5136 = 0x7A2B
-0x5137 = 0x7A2D
-0x5138 = 0x7A2F
-0x5139 = 0x7A30
-0x513A = 0x7A34
-0x513B = 0x7A35
-0x513C = 0x7A38
-0x513D = 0x7A39
-0x513E = 0x7A3A
-0x513F = 0x7A44
-0x5140 = 0x7A45
-0x5141 = 0x7A47
-0x5142 = 0x7A48
-0x5143 = 0x7A4C
-0x5144 = 0x7A55
-0x5145 = 0x7A56
-0x5146 = 0x7A59
-0x5147 = 0x7A5C
-0x5148 = 0x7A5D
-0x5149 = 0x7A5F
-0x514A = 0x7A60
-0x514B = 0x7A65
-0x514C = 0x7A67
-0x514D = 0x7A6A
-0x514E = 0x7A6D
-0x514F = 0x7A75
-0x5150 = 0x7A78
-0x5151 = 0x7A7E
-0x5152 = 0x7A80
-0x5153 = 0x7A82
-0x5154 = 0x7A85
-0x5155 = 0x7A86
-0x5156 = 0x7A8A
-0x5157 = 0x7A8B
-0x5158 = 0x7A90
-0x5159 = 0x7A91
-0x515A = 0x7A94
-0x515B = 0x7A9E
-0x515C = 0x7AA0
-0x515D = 0x7AA3
-0x515E = 0x7AAC
-0x515F = 0x7AB3
-0x5160 = 0x7AB5
-0x5161 = 0x7AB9
-0x5162 = 0x7ABB
-0x5163 = 0x7ABC
-0x5164 = 0x7AC6
-0x5165 = 0x7AC9
-0x5166 = 0x7ACC
-0x5167 = 0x7ACE
-0x5168 = 0x7AD1
-0x5169 = 0x7ADB
-0x516A = 0x7AE8
-0x516B = 0x7AE9
-0x516C = 0x7AEB
-0x516D = 0x7AEC
-0x516E = 0x7AF1
-0x516F = 0x7AF4
-0x5170 = 0x7AFB
-0x5171 = 0x7AFD
-0x5172 = 0x7AFE
-0x5173 = 0x7B07
-0x5174 = 0x7B14
-0x5175 = 0x7B1F
-0x5176 = 0x7B23
-0x5177 = 0x7B27
-0x5178 = 0x7B29
-0x5179 = 0x7B2A
-0x517A = 0x7B2B
-0x517B = 0x7B2D
-0x517C = 0x7B2E
-0x517D = 0x7B2F
-0x517E = 0x7B30
-0x5221 = 0x7B31
-0x5222 = 0x7B34
-0x5223 = 0x7B3D
-0x5224 = 0x7B3F
-0x5225 = 0x7B40
-0x5226 = 0x7B41
-0x5227 = 0x7B47
-0x5228 = 0x7B4E
-0x5229 = 0x7B55
-0x522A = 0x7B60
-0x522B = 0x7B64
-0x522C = 0x7B66
-0x522D = 0x7B69
-0x522E = 0x7B6A
-0x522F = 0x7B6D
-0x5230 = 0x7B6F
-0x5231 = 0x7B72
-0x5232 = 0x7B73
-0x5233 = 0x7B77
-0x5234 = 0x7B84
-0x5235 = 0x7B89
-0x5236 = 0x7B8E
-0x5237 = 0x7B90
-0x5238 = 0x7B91
-0x5239 = 0x7B96
-0x523A = 0x7B9B
-0x523B = 0x7B9E
-0x523C = 0x7BA0
-0x523D = 0x7BA5
-0x523E = 0x7BAC
-0x523F = 0x7BAF
-0x5240 = 0x7BB0
-0x5241 = 0x7BB2
-0x5242 = 0x7BB5
-0x5243 = 0x7BB6
-0x5244 = 0x7BBA
-0x5245 = 0x7BBB
-0x5246 = 0x7BBC
-0x5247 = 0x7BBD
-0x5248 = 0x7BC2
-0x5249 = 0x7BC5
-0x524A = 0x7BC8
-0x524B = 0x7BCA
-0x524C = 0x7BD4
-0x524D = 0x7BD6
-0x524E = 0x7BD7
-0x524F = 0x7BD9
-0x5250 = 0x7BDA
-0x5251 = 0x7BDB
-0x5252 = 0x7BE8
-0x5253 = 0x7BEA
-0x5254 = 0x7BF2
-0x5255 = 0x7BF4
-0x5256 = 0x7BF5
-0x5257 = 0x7BF8
-0x5258 = 0x7BF9
-0x5259 = 0x7BFA
-0x525A = 0x7BFC
-0x525B = 0x7BFE
-0x525C = 0x7C01
-0x525D = 0x7C02
-0x525E = 0x7C03
-0x525F = 0x7C04
-0x5260 = 0x7C06
-0x5261 = 0x7C09
-0x5262 = 0x7C0B
-0x5263 = 0x7C0C
-0x5264 = 0x7C0E
-0x5265 = 0x7C0F
-0x5266 = 0x7C19
-0x5267 = 0x7C1B
-0x5268 = 0x7C20
-0x5269 = 0x7C25
-0x526A = 0x7C26
-0x526B = 0x7C28
-0x526C = 0x7C2C
-0x526D = 0x7C31
-0x526E = 0x7C33
-0x526F = 0x7C34
-0x5270 = 0x7C36
-0x5271 = 0x7C39
-0x5272 = 0x7C3A
-0x5273 = 0x7C46
-0x5274 = 0x7C4A
-0x5275 = 0x7C55
-0x5276 = 0x7C51
-0x5277 = 0x7C52
-0x5278 = 0x7C53
-0x5279 = 0x7C59
-0x527A = 0x7C5A
-0x527B = 0x7C5B
-0x527C = 0x7C5C
-0x527D = 0x7C5D
-0x527E = 0x7C5E
-0x5321 = 0x7C61
-0x5322 = 0x7C63
-0x5323 = 0x7C67
-0x5324 = 0x7C69
-0x5325 = 0x7C6D
-0x5326 = 0x7C6E
-0x5327 = 0x7C70
-0x5328 = 0x7C72
-0x5329 = 0x7C79
-0x532A = 0x7C7C
-0x532B = 0x7C7D
-0x532C = 0x7C86
-0x532D = 0x7C87
-0x532E = 0x7C8F
-0x532F = 0x7C94
-0x5330 = 0x7C9E
-0x5331 = 0x7CA0
-0x5332 = 0x7CA6
-0x5333 = 0x7CB0
-0x5334 = 0x7CB6
-0x5335 = 0x7CB7
-0x5336 = 0x7CBA
-0x5337 = 0x7CBB
-0x5338 = 0x7CBC
-0x5339 = 0x7CBF
-0x533A = 0x7CC4
-0x533B = 0x7CC7
-0x533C = 0x7CC8
-0x533D = 0x7CC9
-0x533E = 0x7CCD
-0x533F = 0x7CCF
-0x5340 = 0x7CD3
-0x5341 = 0x7CD4
-0x5342 = 0x7CD5
-0x5343 = 0x7CD7
-0x5344 = 0x7CD9
-0x5345 = 0x7CDA
-0x5346 = 0x7CDD
-0x5347 = 0x7CE6
-0x5348 = 0x7CE9
-0x5349 = 0x7CEB
-0x534A = 0x7CF5
-0x534B = 0x7D03
-0x534C = 0x7D07
-0x534D = 0x7D08
-0x534E = 0x7D09
-0x534F = 0x7D0F
-0x5350 = 0x7D11
-0x5351 = 0x7D12
-0x5352 = 0x7D13
-0x5353 = 0x7D16
-0x5354 = 0x7D1D
-0x5355 = 0x7D1E
-0x5356 = 0x7D23
-0x5357 = 0x7D26
-0x5358 = 0x7D2A
-0x5359 = 0x7D2D
-0x535A = 0x7D31
-0x535B = 0x7D3C
-0x535C = 0x7D3D
-0x535D = 0x7D3E
-0x535E = 0x7D40
-0x535F = 0x7D41
-0x5360 = 0x7D47
-0x5361 = 0x7D48
-0x5362 = 0x7D4D
-0x5363 = 0x7D51
-0x5364 = 0x7D53
-0x5365 = 0x7D57
-0x5366 = 0x7D59
-0x5367 = 0x7D5A
-0x5368 = 0x7D5C
-0x5369 = 0x7D5D
-0x536A = 0x7D65
-0x536B = 0x7D67
-0x536C = 0x7D6A
-0x536D = 0x7D70
-0x536E = 0x7D78
-0x536F = 0x7D7A
-0x5370 = 0x7D7B
-0x5371 = 0x7D7F
-0x5372 = 0x7D81
-0x5373 = 0x7D82
-0x5374 = 0x7D83
-0x5375 = 0x7D85
-0x5376 = 0x7D86
-0x5377 = 0x7D88
-0x5378 = 0x7D8B
-0x5379 = 0x7D8C
-0x537A = 0x7D8D
-0x537B = 0x7D91
-0x537C = 0x7D96
-0x537D = 0x7D97
-0x537E = 0x7D9D
-0x5421 = 0x7D9E
-0x5422 = 0x7DA6
-0x5423 = 0x7DA7
-0x5424 = 0x7DAA
-0x5425 = 0x7DB3
-0x5426 = 0x7DB6
-0x5427 = 0x7DB7
-0x5428 = 0x7DB9
-0x5429 = 0x7DC2
-0x542A = 0x7DC3
-0x542B = 0x7DC4
-0x542C = 0x7DC5
-0x542D = 0x7DC6
-0x542E = 0x7DCC
-0x542F = 0x7DCD
-0x5430 = 0x7DCE
-0x5431 = 0x7DD7
-0x5432 = 0x7DD9
-0x5433 = 0x7E00
-0x5434 = 0x7DE2
-0x5435 = 0x7DE5
-0x5436 = 0x7DE6
-0x5437 = 0x7DEA
-0x5438 = 0x7DEB
-0x5439 = 0x7DED
-0x543A = 0x7DF1
-0x543B = 0x7DF5
-0x543C = 0x7DF6
-0x543D = 0x7DF9
-0x543E = 0x7DFA
-0x543F = 0x7E08
-0x5440 = 0x7E10
-0x5441 = 0x7E11
-0x5442 = 0x7E15
-0x5443 = 0x7E17
-0x5444 = 0x7E1C
-0x5445 = 0x7E1D
-0x5446 = 0x7E20
-0x5447 = 0x7E27
-0x5448 = 0x7E28
-0x5449 = 0x7E2C
-0x544A = 0x7E2D
-0x544B = 0x7E2F
-0x544C = 0x7E33
-0x544D = 0x7E36
-0x544E = 0x7E3F
-0x544F = 0x7E44
-0x5450 = 0x7E45
-0x5451 = 0x7E47
-0x5452 = 0x7E4E
-0x5453 = 0x7E50
-0x5454 = 0x7E52
-0x5455 = 0x7E58
-0x5456 = 0x7E5F
-0x5457 = 0x7E61
-0x5458 = 0x7E62
-0x5459 = 0x7E65
-0x545A = 0x7E6B
-0x545B = 0x7E6E
-0x545C = 0x7E6F
-0x545D = 0x7E73
-0x545E = 0x7E78
-0x545F = 0x7E7E
-0x5460 = 0x7E81
-0x5461 = 0x7E86
-0x5462 = 0x7E87
-0x5463 = 0x7E8A
-0x5464 = 0x7E8D
-0x5465 = 0x7E91
-0x5466 = 0x7E95
-0x5467 = 0x7E98
-0x5468 = 0x7E9A
-0x5469 = 0x7E9D
-0x546A = 0x7E9E
-0x546B = 0x7F3C
-0x546C = 0x7F3B
-0x546D = 0x7F3D
-0x546E = 0x7F3E
-0x546F = 0x7F3F
-0x5470 = 0x7F43
-0x5471 = 0x7F44
-0x5472 = 0x7F47
-0x5473 = 0x7F4F
-0x5474 = 0x7F52
-0x5475 = 0x7F53
-0x5476 = 0x7F5B
-0x5477 = 0x7F5C
-0x5478 = 0x7F5D
-0x5479 = 0x7F61
-0x547A = 0x7F63
-0x547B = 0x7F64
-0x547C = 0x7F65
-0x547D = 0x7F66
-0x547E = 0x7F6D
-0x5521 = 0x7F71
-0x5522 = 0x7F7D
-0x5523 = 0x7F7E
-0x5524 = 0x7F7F
-0x5525 = 0x7F80
-0x5526 = 0x7F8B
-0x5527 = 0x7F8D
-0x5528 = 0x7F8F
-0x5529 = 0x7F90
-0x552A = 0x7F91
-0x552B = 0x7F96
-0x552C = 0x7F97
-0x552D = 0x7F9C
-0x552E = 0x7FA1
-0x552F = 0x7FA2
-0x5530 = 0x7FA6
-0x5531 = 0x7FAA
-0x5532 = 0x7FAD
-0x5533 = 0x7FB4
-0x5534 = 0x7FBC
-0x5535 = 0x7FBF
-0x5536 = 0x7FC0
-0x5537 = 0x7FC3
-0x5538 = 0x7FC8
-0x5539 = 0x7FCE
-0x553A = 0x7FCF
-0x553B = 0x7FDB
-0x553C = 0x7FDF
-0x553D = 0x7FE3
-0x553E = 0x7FE5
-0x553F = 0x7FE8
-0x5540 = 0x7FEC
-0x5541 = 0x7FEE
-0x5542 = 0x7FEF
-0x5543 = 0x7FF2
-0x5544 = 0x7FFA
-0x5545 = 0x7FFD
-0x5546 = 0x7FFE
-0x5547 = 0x7FFF
-0x5548 = 0x8007
-0x5549 = 0x8008
-0x554A = 0x800A
-0x554B = 0x800D
-0x554C = 0x800E
-0x554D = 0x800F
-0x554E = 0x8011
-0x554F = 0x8013
-0x5550 = 0x8014
-0x5551 = 0x8016
-0x5552 = 0x801D
-0x5553 = 0x801E
-0x5554 = 0x801F
-0x5555 = 0x8020
-0x5556 = 0x8024
-0x5557 = 0x8026
-0x5558 = 0x802C
-0x5559 = 0x802E
-0x555A = 0x8030
-0x555B = 0x8034
-0x555C = 0x8035
-0x555D = 0x8037
-0x555E = 0x8039
-0x555F = 0x803A
-0x5560 = 0x803C
-0x5561 = 0x803E
-0x5562 = 0x8040
-0x5563 = 0x8044
-0x5564 = 0x8060
-0x5565 = 0x8064
-0x5566 = 0x8066
-0x5567 = 0x806D
-0x5568 = 0x8071
-0x5569 = 0x8075
-0x556A = 0x8081
-0x556B = 0x8088
-0x556C = 0x808E
-0x556D = 0x809C
-0x556E = 0x809E
-0x556F = 0x80A6
-0x5570 = 0x80A7
-0x5571 = 0x80AB
-0x5572 = 0x80B8
-0x5573 = 0x80B9
-0x5574 = 0x80C8
-0x5575 = 0x80CD
-0x5576 = 0x80CF
-0x5577 = 0x80D2
-0x5578 = 0x80D4
-0x5579 = 0x80D5
-0x557A = 0x80D7
-0x557B = 0x80D8
-0x557C = 0x80E0
-0x557D = 0x80ED
-0x557E = 0x80EE
-0x5621 = 0x80F0
-0x5622 = 0x80F2
-0x5623 = 0x80F3
-0x5624 = 0x80F6
-0x5625 = 0x80F9
-0x5626 = 0x80FA
-0x5627 = 0x80FE
-0x5628 = 0x8103
-0x5629 = 0x810B
-0x562A = 0x8116
-0x562B = 0x8117
-0x562C = 0x8118
-0x562D = 0x811C
-0x562E = 0x811E
-0x562F = 0x8120
-0x5630 = 0x8124
-0x5631 = 0x8127
-0x5632 = 0x812C
-0x5633 = 0x8130
-0x5634 = 0x8135
-0x5635 = 0x813A
-0x5636 = 0x813C
-0x5637 = 0x8145
-0x5638 = 0x8147
-0x5639 = 0x814A
-0x563A = 0x814C
-0x563B = 0x8152
-0x563C = 0x8157
-0x563D = 0x8160
-0x563E = 0x8161
-0x563F = 0x8167
-0x5640 = 0x8168
-0x5641 = 0x8169
-0x5642 = 0x816D
-0x5643 = 0x816F
-0x5644 = 0x8177
-0x5645 = 0x8181
-0x5646 = 0x8190
-0x5647 = 0x8184
-0x5648 = 0x8185
-0x5649 = 0x8186
-0x564A = 0x818B
-0x564B = 0x818E
-0x564C = 0x8196
-0x564D = 0x8198
-0x564E = 0x819B
-0x564F = 0x819E
-0x5650 = 0x81A2
-0x5651 = 0x81AE
-0x5652 = 0x81B2
-0x5653 = 0x81B4
-0x5654 = 0x81BB
-0x5655 = 0x81CB
-0x5656 = 0x81C3
-0x5657 = 0x81C5
-0x5658 = 0x81CA
-0x5659 = 0x81CE
-0x565A = 0x81CF
-0x565B = 0x81D5
-0x565C = 0x81D7
-0x565D = 0x81DB
-0x565E = 0x81DD
-0x565F = 0x81DE
-0x5660 = 0x81E1
-0x5661 = 0x81E4
-0x5662 = 0x81EB
-0x5663 = 0x81EC
-0x5664 = 0x81F0
-0x5665 = 0x81F1
-0x5666 = 0x81F2
-0x5667 = 0x81F5
-0x5668 = 0x81F6
-0x5669 = 0x81F8
-0x566A = 0x81F9
-0x566B = 0x81FD
-0x566C = 0x81FF
-0x566D = 0x8200
-0x566E = 0x8203
-0x566F = 0x820F
-0x5670 = 0x8213
-0x5671 = 0x8214
-0x5672 = 0x8219
-0x5673 = 0x821A
-0x5674 = 0x821D
-0x5675 = 0x8221
-0x5676 = 0x8222
-0x5677 = 0x8228
-0x5678 = 0x8232
-0x5679 = 0x8234
-0x567A = 0x823A
-0x567B = 0x8243
-0x567C = 0x8244
-0x567D = 0x8245
-0x567E = 0x8246
-0x5721 = 0x824B
-0x5722 = 0x824E
-0x5723 = 0x824F
-0x5724 = 0x8251
-0x5725 = 0x8256
-0x5726 = 0x825C
-0x5727 = 0x8260
-0x5728 = 0x8263
-0x5729 = 0x8267
-0x572A = 0x826D
-0x572B = 0x8274
-0x572C = 0x827B
-0x572D = 0x827D
-0x572E = 0x827F
-0x572F = 0x8280
-0x5730 = 0x8281
-0x5731 = 0x8283
-0x5732 = 0x8284
-0x5733 = 0x8287
-0x5734 = 0x8289
-0x5735 = 0x828A
-0x5736 = 0x828E
-0x5737 = 0x8291
-0x5738 = 0x8294
-0x5739 = 0x8296
-0x573A = 0x8298
-0x573B = 0x829A
-0x573C = 0x829B
-0x573D = 0x82A0
-0x573E = 0x82A1
-0x573F = 0x82A3
-0x5740 = 0x82A4
-0x5741 = 0x82A7
-0x5742 = 0x82A8
-0x5743 = 0x82A9
-0x5744 = 0x82AA
-0x5745 = 0x82AE
-0x5746 = 0x82B0
-0x5747 = 0x82B2
-0x5748 = 0x82B4
-0x5749 = 0x82B7
-0x574A = 0x82BA
-0x574B = 0x82BC
-0x574C = 0x82BE
-0x574D = 0x82BF
-0x574E = 0x82C6
-0x574F = 0x82D0
-0x5750 = 0x82D5
-0x5751 = 0x82DA
-0x5752 = 0x82E0
-0x5753 = 0x82E2
-0x5754 = 0x82E4
-0x5755 = 0x82E8
-0x5756 = 0x82EA
-0x5757 = 0x82ED
-0x5758 = 0x82EF
-0x5759 = 0x82F6
-0x575A = 0x82F7
-0x575B = 0x82FD
-0x575C = 0x82FE
-0x575D = 0x8300
-0x575E = 0x8301
-0x575F = 0x8307
-0x5760 = 0x8308
-0x5761 = 0x830A
-0x5762 = 0x830B
-0x5763 = 0x8354
-0x5764 = 0x831B
-0x5765 = 0x831D
-0x5766 = 0x831E
-0x5767 = 0x831F
-0x5768 = 0x8321
-0x5769 = 0x8322
-0x576A = 0x832C
-0x576B = 0x832D
-0x576C = 0x832E
-0x576D = 0x8330
-0x576E = 0x8333
-0x576F = 0x8337
-0x5770 = 0x833A
-0x5771 = 0x833C
-0x5772 = 0x833D
-0x5773 = 0x8342
-0x5774 = 0x8343
-0x5775 = 0x8344
-0x5776 = 0x8347
-0x5777 = 0x834D
-0x5778 = 0x834E
-0x5779 = 0x8351
-0x577A = 0x8355
-0x577B = 0x8356
-0x577C = 0x8357
-0x577D = 0x8370
-0x577E = 0x8378
-0x5821 = 0x837D
-0x5822 = 0x837F
-0x5823 = 0x8380
-0x5824 = 0x8382
-0x5825 = 0x8384
-0x5826 = 0x8386
-0x5827 = 0x838D
-0x5828 = 0x8392
-0x5829 = 0x8394
-0x582A = 0x8395
-0x582B = 0x8398
-0x582C = 0x8399
-0x582D = 0x839B
-0x582E = 0x839C
-0x582F = 0x839D
-0x5830 = 0x83A6
-0x5831 = 0x83A7
-0x5832 = 0x83A9
-0x5833 = 0x83AC
-0x5834 = 0x83BE
-0x5835 = 0x83BF
-0x5836 = 0x83C0
-0x5837 = 0x83C7
-0x5838 = 0x83C9
-0x5839 = 0x83CF
-0x583A = 0x83D0
-0x583B = 0x83D1
-0x583C = 0x83D4
-0x583D = 0x83DD
-0x583E = 0x8353
-0x583F = 0x83E8
-0x5840 = 0x83EA
-0x5841 = 0x83F6
-0x5842 = 0x83F8
-0x5843 = 0x83F9
-0x5844 = 0x83FC
-0x5845 = 0x8401
-0x5846 = 0x8406
-0x5847 = 0x840A
-0x5848 = 0x840F
-0x5849 = 0x8411
-0x584A = 0x8415
-0x584B = 0x8419
-0x584C = 0x83AD
-0x584D = 0x842F
-0x584E = 0x8439
-0x584F = 0x8445
-0x5850 = 0x8447
-0x5851 = 0x8448
-0x5852 = 0x844A
-0x5853 = 0x844D
-0x5854 = 0x844F
-0x5855 = 0x8451
-0x5856 = 0x8452
-0x5857 = 0x8456
-0x5858 = 0x8458
-0x5859 = 0x8459
-0x585A = 0x845A
-0x585B = 0x845C
-0x585C = 0x8460
-0x585D = 0x8464
-0x585E = 0x8465
-0x585F = 0x8467
-0x5860 = 0x846A
-0x5861 = 0x8470
-0x5862 = 0x8473
-0x5863 = 0x8474
-0x5864 = 0x8476
-0x5865 = 0x8478
-0x5866 = 0x847C
-0x5867 = 0x847D
-0x5868 = 0x8481
-0x5869 = 0x8485
-0x586A = 0x8492
-0x586B = 0x8493
-0x586C = 0x8495
-0x586D = 0x849E
-0x586E = 0x84A6
-0x586F = 0x84A8
-0x5870 = 0x84A9
-0x5871 = 0x84AA
-0x5872 = 0x84AF
-0x5873 = 0x84B1
-0x5874 = 0x84B4
-0x5875 = 0x84BA
-0x5876 = 0x84BD
-0x5877 = 0x84BE
-0x5878 = 0x84C0
-0x5879 = 0x84C2
-0x587A = 0x84C7
-0x587B = 0x84C8
-0x587C = 0x84CC
-0x587D = 0x84CF
-0x587E = 0x84D3
-0x5921 = 0x84DC
-0x5922 = 0x84E7
-0x5923 = 0x84EA
-0x5924 = 0x84EF
-0x5925 = 0x84F0
-0x5926 = 0x84F1
-0x5927 = 0x84F2
-0x5928 = 0x84F7
-0x5929 = 0x8532
-0x592A = 0x84FA
-0x592B = 0x84FB
-0x592C = 0x84FD
-0x592D = 0x8502
-0x592E = 0x8503
-0x592F = 0x8507
-0x5930 = 0x850C
-0x5931 = 0x850E
-0x5932 = 0x8510
-0x5933 = 0x851C
-0x5934 = 0x851E
-0x5935 = 0x8522
-0x5936 = 0x8523
-0x5937 = 0x8524
-0x5938 = 0x8525
-0x5939 = 0x8527
-0x593A = 0x852A
-0x593B = 0x852B
-0x593C = 0x852F
-0x593D = 0x8533
-0x593E = 0x8534
-0x593F = 0x8536
-0x5940 = 0x853F
-0x5941 = 0x8546
-0x5942 = 0x854F
-0x5943 = 0x8550
-0x5944 = 0x8551
-0x5945 = 0x8552
-0x5946 = 0x8553
-0x5947 = 0x8556
-0x5948 = 0x8559
-0x5949 = 0x855C
-0x594A = 0x855D
-0x594B = 0x855E
-0x594C = 0x855F
-0x594D = 0x8560
-0x594E = 0x8561
-0x594F = 0x8562
-0x5950 = 0x8564
-0x5951 = 0x856B
-0x5952 = 0x856F
-0x5953 = 0x8579
-0x5954 = 0x857A
-0x5955 = 0x857B
-0x5956 = 0x857D
-0x5957 = 0x857F
-0x5958 = 0x8581
-0x5959 = 0x8585
-0x595A = 0x8586
-0x595B = 0x8589
-0x595C = 0x858B
-0x595D = 0x858C
-0x595E = 0x858F
-0x595F = 0x8593
-0x5960 = 0x8598
-0x5961 = 0x859D
-0x5962 = 0x859F
-0x5963 = 0x85A0
-0x5964 = 0x85A2
-0x5965 = 0x85A5
-0x5966 = 0x85A7
-0x5967 = 0x85B4
-0x5968 = 0x85B6
-0x5969 = 0x85B7
-0x596A = 0x85B8
-0x596B = 0x85BC
-0x596C = 0x85BD
-0x596D = 0x85BE
-0x596E = 0x85BF
-0x596F = 0x85C2
-0x5970 = 0x85C7
-0x5971 = 0x85CA
-0x5972 = 0x85CB
-0x5973 = 0x85CE
-0x5974 = 0x85AD
-0x5975 = 0x85D8
-0x5976 = 0x85DA
-0x5977 = 0x85DF
-0x5978 = 0x85E0
-0x5979 = 0x85E6
-0x597A = 0x85E8
-0x597B = 0x85ED
-0x597C = 0x85F3
-0x597D = 0x85F6
-0x597E = 0x85FC
-0x5A21 = 0x85FF
-0x5A22 = 0x8600
-0x5A23 = 0x8604
-0x5A24 = 0x8605
-0x5A25 = 0x860D
-0x5A26 = 0x860E
-0x5A27 = 0x8610
-0x5A28 = 0x8611
-0x5A29 = 0x8612
-0x5A2A = 0x8618
-0x5A2B = 0x8619
-0x5A2C = 0x861B
-0x5A2D = 0x861E
-0x5A2E = 0x8621
-0x5A2F = 0x8627
-0x5A30 = 0x8629
-0x5A31 = 0x8636
-0x5A32 = 0x8638
-0x5A33 = 0x863A
-0x5A34 = 0x863C
-0x5A35 = 0x863D
-0x5A36 = 0x8640
-0x5A37 = 0x8642
-0x5A38 = 0x8646
-0x5A39 = 0x8652
-0x5A3A = 0x8653
-0x5A3B = 0x8656
-0x5A3C = 0x8657
-0x5A3D = 0x8658
-0x5A3E = 0x8659
-0x5A3F = 0x865D
-0x5A40 = 0x8660
-0x5A41 = 0x8661
-0x5A42 = 0x8662
-0x5A43 = 0x8663
-0x5A44 = 0x8664
-0x5A45 = 0x8669
-0x5A46 = 0x866C
-0x5A47 = 0x866F
-0x5A48 = 0x8675
-0x5A49 = 0x8676
-0x5A4A = 0x8677
-0x5A4B = 0x867A
-0x5A4C = 0x868D
-0x5A4D = 0x8691
-0x5A4E = 0x8696
-0x5A4F = 0x8698
-0x5A50 = 0x869A
-0x5A51 = 0x869C
-0x5A52 = 0x86A1
-0x5A53 = 0x86A6
-0x5A54 = 0x86A7
-0x5A55 = 0x86A8
-0x5A56 = 0x86AD
-0x5A57 = 0x86B1
-0x5A58 = 0x86B3
-0x5A59 = 0x86B4
-0x5A5A = 0x86B5
-0x5A5B = 0x86B7
-0x5A5C = 0x86B8
-0x5A5D = 0x86B9
-0x5A5E = 0x86BF
-0x5A5F = 0x86C0
-0x5A60 = 0x86C1
-0x5A61 = 0x86C3
-0x5A62 = 0x86C5
-0x5A63 = 0x86D1
-0x5A64 = 0x86D2
-0x5A65 = 0x86D5
-0x5A66 = 0x86D7
-0x5A67 = 0x86DA
-0x5A68 = 0x86DC
-0x5A69 = 0x86E0
-0x5A6A = 0x86E3
-0x5A6B = 0x86E5
-0x5A6C = 0x86E7
-0x5A6D = 0x8688
-0x5A6E = 0x86FA
-0x5A6F = 0x86FC
-0x5A70 = 0x86FD
-0x5A71 = 0x8704
-0x5A72 = 0x8705
-0x5A73 = 0x8707
-0x5A74 = 0x870B
-0x5A75 = 0x870E
-0x5A76 = 0x870F
-0x5A77 = 0x8710
-0x5A78 = 0x8713
-0x5A79 = 0x8714
-0x5A7A = 0x8719
-0x5A7B = 0x871E
-0x5A7C = 0x871F
-0x5A7D = 0x8721
-0x5A7E = 0x8723
-0x5B21 = 0x8728
-0x5B22 = 0x872E
-0x5B23 = 0x872F
-0x5B24 = 0x8731
-0x5B25 = 0x8732
-0x5B26 = 0x8739
-0x5B27 = 0x873A
-0x5B28 = 0x873C
-0x5B29 = 0x873D
-0x5B2A = 0x873E
-0x5B2B = 0x8740
-0x5B2C = 0x8743
-0x5B2D = 0x8745
-0x5B2E = 0x874D
-0x5B2F = 0x8758
-0x5B30 = 0x875D
-0x5B31 = 0x8761
-0x5B32 = 0x8764
-0x5B33 = 0x8765
-0x5B34 = 0x876F
-0x5B35 = 0x8771
-0x5B36 = 0x8772
-0x5B37 = 0x877B
-0x5B38 = 0x8783
-0x5B39 = 0x8784
-0x5B3A = 0x8785
-0x5B3B = 0x8786
-0x5B3C = 0x8787
-0x5B3D = 0x8788
-0x5B3E = 0x8789
-0x5B3F = 0x878B
-0x5B40 = 0x878C
-0x5B41 = 0x8790
-0x5B42 = 0x8793
-0x5B43 = 0x8795
-0x5B44 = 0x8797
-0x5B45 = 0x8798
-0x5B46 = 0x8799
-0x5B47 = 0x879E
-0x5B48 = 0x87A0
-0x5B49 = 0x87A3
-0x5B4A = 0x87A7
-0x5B4B = 0x87AC
-0x5B4C = 0x87AD
-0x5B4D = 0x87AE
-0x5B4E = 0x87B1
-0x5B4F = 0x87B5
-0x5B50 = 0x87BE
-0x5B51 = 0x87BF
-0x5B52 = 0x87C1
-0x5B53 = 0x87C8
-0x5B54 = 0x87C9
-0x5B55 = 0x87CA
-0x5B56 = 0x87CE
-0x5B57 = 0x87D5
-0x5B58 = 0x87D6
-0x5B59 = 0x87D9
-0x5B5A = 0x87DA
-0x5B5B = 0x87DC
-0x5B5C = 0x87DF
-0x5B5D = 0x87E2
-0x5B5E = 0x87E3
-0x5B5F = 0x87E4
-0x5B60 = 0x87EA
-0x5B61 = 0x87EB
-0x5B62 = 0x87ED
-0x5B63 = 0x87F1
-0x5B64 = 0x87F3
-0x5B65 = 0x87F8
-0x5B66 = 0x87FA
-0x5B67 = 0x87FF
-0x5B68 = 0x8801
-0x5B69 = 0x8803
-0x5B6A = 0x8806
-0x5B6B = 0x8809
-0x5B6C = 0x880A
-0x5B6D = 0x880B
-0x5B6E = 0x8810
-0x5B6F = 0x8819
-0x5B70 = 0x8812
-0x5B71 = 0x8813
-0x5B72 = 0x8814
-0x5B73 = 0x8818
-0x5B74 = 0x881A
-0x5B75 = 0x881B
-0x5B76 = 0x881C
-0x5B77 = 0x881E
-0x5B78 = 0x881F
-0x5B79 = 0x8828
-0x5B7A = 0x882D
-0x5B7B = 0x882E
-0x5B7C = 0x8830
-0x5B7D = 0x8832
-0x5B7E = 0x8835
-0x5C21 = 0x883A
-0x5C22 = 0x883C
-0x5C23 = 0x8841
-0x5C24 = 0x8843
-0x5C25 = 0x8845
-0x5C26 = 0x8848
-0x5C27 = 0x8849
-0x5C28 = 0x884A
-0x5C29 = 0x884B
-0x5C2A = 0x884E
-0x5C2B = 0x8851
-0x5C2C = 0x8855
-0x5C2D = 0x8856
-0x5C2E = 0x8858
-0x5C2F = 0x885A
-0x5C30 = 0x885C
-0x5C31 = 0x885F
-0x5C32 = 0x8860
-0x5C33 = 0x8864
-0x5C34 = 0x8869
-0x5C35 = 0x8871
-0x5C36 = 0x8879
-0x5C37 = 0x887B
-0x5C38 = 0x8880
-0x5C39 = 0x8898
-0x5C3A = 0x889A
-0x5C3B = 0x889B
-0x5C3C = 0x889C
-0x5C3D = 0x889F
-0x5C3E = 0x88A0
-0x5C3F = 0x88A8
-0x5C40 = 0x88AA
-0x5C41 = 0x88BA
-0x5C42 = 0x88BD
-0x5C43 = 0x88BE
-0x5C44 = 0x88C0
-0x5C45 = 0x88CA
-0x5C46 = 0x88CB
-0x5C47 = 0x88CC
-0x5C48 = 0x88CD
-0x5C49 = 0x88CE
-0x5C4A = 0x88D1
-0x5C4B = 0x88D2
-0x5C4C = 0x88D3
-0x5C4D = 0x88DB
-0x5C4E = 0x88DE
-0x5C4F = 0x88E7
-0x5C50 = 0x88EF
-0x5C51 = 0x88F0
-0x5C52 = 0x88F1
-0x5C53 = 0x88F5
-0x5C54 = 0x88F7
-0x5C55 = 0x8901
-0x5C56 = 0x8906
-0x5C57 = 0x890D
-0x5C58 = 0x890E
-0x5C59 = 0x890F
-0x5C5A = 0x8915
-0x5C5B = 0x8916
-0x5C5C = 0x8918
-0x5C5D = 0x8919
-0x5C5E = 0x891A
-0x5C5F = 0x891C
-0x5C60 = 0x8920
-0x5C61 = 0x8926
-0x5C62 = 0x8927
-0x5C63 = 0x8928
-0x5C64 = 0x8930
-0x5C65 = 0x8931
-0x5C66 = 0x8932
-0x5C67 = 0x8935
-0x5C68 = 0x8939
-0x5C69 = 0x893A
-0x5C6A = 0x893E
-0x5C6B = 0x8940
-0x5C6C = 0x8942
-0x5C6D = 0x8945
-0x5C6E = 0x8946
-0x5C6F = 0x8949
-0x5C70 = 0x894F
-0x5C71 = 0x8952
-0x5C72 = 0x8957
-0x5C73 = 0x895A
-0x5C74 = 0x895B
-0x5C75 = 0x895C
-0x5C76 = 0x8961
-0x5C77 = 0x8962
-0x5C78 = 0x8963
-0x5C79 = 0x896B
-0x5C7A = 0x896E
-0x5C7B = 0x8970
-0x5C7C = 0x8973
-0x5C7D = 0x8975
-0x5C7E = 0x897A
-0x5D21 = 0x897B
-0x5D22 = 0x897C
-0x5D23 = 0x897D
-0x5D24 = 0x8989
-0x5D25 = 0x898D
-0x5D26 = 0x8990
-0x5D27 = 0x8994
-0x5D28 = 0x8995
-0x5D29 = 0x899B
-0x5D2A = 0x899C
-0x5D2B = 0x899F
-0x5D2C = 0x89A0
-0x5D2D = 0x89A5
-0x5D2E = 0x89B0
-0x5D2F = 0x89B4
-0x5D30 = 0x89B5
-0x5D31 = 0x89B6
-0x5D32 = 0x89B7
-0x5D33 = 0x89BC
-0x5D34 = 0x89D4
-0x5D35 = 0x89D5
-0x5D36 = 0x89D6
-0x5D37 = 0x89D7
-0x5D38 = 0x89D8
-0x5D39 = 0x89E5
-0x5D3A = 0x89E9
-0x5D3B = 0x89EB
-0x5D3C = 0x89ED
-0x5D3D = 0x89F1
-0x5D3E = 0x89F3
-0x5D3F = 0x89F6
-0x5D40 = 0x89F9
-0x5D41 = 0x89FD
-0x5D42 = 0x89FF
-0x5D43 = 0x8A04
-0x5D44 = 0x8A05
-0x5D45 = 0x8A07
-0x5D46 = 0x8A0F
-0x5D47 = 0x8A11
-0x5D48 = 0x8A12
-0x5D49 = 0x8A14
-0x5D4A = 0x8A15
-0x5D4B = 0x8A1E
-0x5D4C = 0x8A20
-0x5D4D = 0x8A22
-0x5D4E = 0x8A24
-0x5D4F = 0x8A26
-0x5D50 = 0x8A2B
-0x5D51 = 0x8A2C
-0x5D52 = 0x8A2F
-0x5D53 = 0x8A35
-0x5D54 = 0x8A37
-0x5D55 = 0x8A3D
-0x5D56 = 0x8A3E
-0x5D57 = 0x8A40
-0x5D58 = 0x8A43
-0x5D59 = 0x8A45
-0x5D5A = 0x8A47
-0x5D5B = 0x8A49
-0x5D5C = 0x8A4D
-0x5D5D = 0x8A4E
-0x5D5E = 0x8A53
-0x5D5F = 0x8A56
-0x5D60 = 0x8A57
-0x5D61 = 0x8A58
-0x5D62 = 0x8A5C
-0x5D63 = 0x8A5D
-0x5D64 = 0x8A61
-0x5D65 = 0x8A65
-0x5D66 = 0x8A67
-0x5D67 = 0x8A75
-0x5D68 = 0x8A76
-0x5D69 = 0x8A77
-0x5D6A = 0x8A79
-0x5D6B = 0x8A7A
-0x5D6C = 0x8A7B
-0x5D6D = 0x8A7E
-0x5D6E = 0x8A7F
-0x5D6F = 0x8A80
-0x5D70 = 0x8A83
-0x5D71 = 0x8A86
-0x5D72 = 0x8A8B
-0x5D73 = 0x8A8F
-0x5D74 = 0x8A90
-0x5D75 = 0x8A92
-0x5D76 = 0x8A96
-0x5D77 = 0x8A97
-0x5D78 = 0x8A99
-0x5D79 = 0x8A9F
-0x5D7A = 0x8AA7
-0x5D7B = 0x8AA9
-0x5D7C = 0x8AAE
-0x5D7D = 0x8AAF
-0x5D7E = 0x8AB3
-0x5E21 = 0x8AB6
-0x5E22 = 0x8AB7
-0x5E23 = 0x8ABB
-0x5E24 = 0x8ABE
-0x5E25 = 0x8AC3
-0x5E26 = 0x8AC6
-0x5E27 = 0x8AC8
-0x5E28 = 0x8AC9
-0x5E29 = 0x8ACA
-0x5E2A = 0x8AD1
-0x5E2B = 0x8AD3
-0x5E2C = 0x8AD4
-0x5E2D = 0x8AD5
-0x5E2E = 0x8AD7
-0x5E2F = 0x8ADD
-0x5E30 = 0x8ADF
-0x5E31 = 0x8AEC
-0x5E32 = 0x8AF0
-0x5E33 = 0x8AF4
-0x5E34 = 0x8AF5
-0x5E35 = 0x8AF6
-0x5E36 = 0x8AFC
-0x5E37 = 0x8AFF
-0x5E38 = 0x8B05
-0x5E39 = 0x8B06
-0x5E3A = 0x8B0B
-0x5E3B = 0x8B11
-0x5E3C = 0x8B1C
-0x5E3D = 0x8B1E
-0x5E3E = 0x8B1F
-0x5E3F = 0x8B0A
-0x5E40 = 0x8B2D
-0x5E41 = 0x8B30
-0x5E42 = 0x8B37
-0x5E43 = 0x8B3C
-0x5E44 = 0x8B42
-0x5E45 = 0x8B43
-0x5E46 = 0x8B44
-0x5E47 = 0x8B45
-0x5E48 = 0x8B46
-0x5E49 = 0x8B48
-0x5E4A = 0x8B52
-0x5E4B = 0x8B53
-0x5E4C = 0x8B54
-0x5E4D = 0x8B59
-0x5E4E = 0x8B4D
-0x5E4F = 0x8B5E
-0x5E50 = 0x8B63
-0x5E51 = 0x8B6D
-0x5E52 = 0x8B76
-0x5E53 = 0x8B78
-0x5E54 = 0x8B79
-0x5E55 = 0x8B7C
-0x5E56 = 0x8B7E
-0x5E57 = 0x8B81
-0x5E58 = 0x8B84
-0x5E59 = 0x8B85
-0x5E5A = 0x8B8B
-0x5E5B = 0x8B8D
-0x5E5C = 0x8B8F
-0x5E5D = 0x8B94
-0x5E5E = 0x8B95
-0x5E5F = 0x8B9C
-0x5E60 = 0x8B9E
-0x5E61 = 0x8B9F
-0x5E62 = 0x8C38
-0x5E63 = 0x8C39
-0x5E64 = 0x8C3D
-0x5E65 = 0x8C3E
-0x5E66 = 0x8C45
-0x5E67 = 0x8C47
-0x5E68 = 0x8C49
-0x5E69 = 0x8C4B
-0x5E6A = 0x8C4F
-0x5E6B = 0x8C51
-0x5E6C = 0x8C53
-0x5E6D = 0x8C54
-0x5E6E = 0x8C57
-0x5E6F = 0x8C58
-0x5E70 = 0x8C5B
-0x5E71 = 0x8C5D
-0x5E72 = 0x8C59
-0x5E73 = 0x8C63
-0x5E74 = 0x8C64
-0x5E75 = 0x8C66
-0x5E76 = 0x8C68
-0x5E77 = 0x8C69
-0x5E78 = 0x8C6D
-0x5E79 = 0x8C73
-0x5E7A = 0x8C75
-0x5E7B = 0x8C76
-0x5E7C = 0x8C7B
-0x5E7D = 0x8C7E
-0x5E7E = 0x8C86
-0x5F21 = 0x8C87
-0x5F22 = 0x8C8B
-0x5F23 = 0x8C90
-0x5F24 = 0x8C92
-0x5F25 = 0x8C93
-0x5F26 = 0x8C99
-0x5F27 = 0x8C9B
-0x5F28 = 0x8C9C
-0x5F29 = 0x8CA4
-0x5F2A = 0x8CB9
-0x5F2B = 0x8CBA
-0x5F2C = 0x8CC5
-0x5F2D = 0x8CC6
-0x5F2E = 0x8CC9
-0x5F2F = 0x8CCB
-0x5F30 = 0x8CCF
-0x5F31 = 0x8CD6
-0x5F32 = 0x8CD5
-0x5F33 = 0x8CD9
-0x5F34 = 0x8CDD
-0x5F35 = 0x8CE1
-0x5F36 = 0x8CE8
-0x5F37 = 0x8CEC
-0x5F38 = 0x8CEF
-0x5F39 = 0x8CF0
-0x5F3A = 0x8CF2
-0x5F3B = 0x8CF5
-0x5F3C = 0x8CF7
-0x5F3D = 0x8CF8
-0x5F3E = 0x8CFE
-0x5F3F = 0x8CFF
-0x5F40 = 0x8D01
-0x5F41 = 0x8D03
-0x5F42 = 0x8D09
-0x5F43 = 0x8D12
-0x5F44 = 0x8D17
-0x5F45 = 0x8D1B
-0x5F46 = 0x8D65
-0x5F47 = 0x8D69
-0x5F48 = 0x8D6C
-0x5F49 = 0x8D6E
-0x5F4A = 0x8D7F
-0x5F4B = 0x8D82
-0x5F4C = 0x8D84
-0x5F4D = 0x8D88
-0x5F4E = 0x8D8D
-0x5F4F = 0x8D90
-0x5F50 = 0x8D91
-0x5F51 = 0x8D95
-0x5F52 = 0x8D9E
-0x5F53 = 0x8D9F
-0x5F54 = 0x8DA0
-0x5F55 = 0x8DA6
-0x5F56 = 0x8DAB
-0x5F57 = 0x8DAC
-0x5F58 = 0x8DAF
-0x5F59 = 0x8DB2
-0x5F5A = 0x8DB5
-0x5F5B = 0x8DB7
-0x5F5C = 0x8DB9
-0x5F5D = 0x8DBB
-0x5F5E = 0x8DC0
-0x5F5F = 0x8DC5
-0x5F60 = 0x8DC6
-0x5F61 = 0x8DC7
-0x5F62 = 0x8DC8
-0x5F63 = 0x8DCA
-0x5F64 = 0x8DCE
-0x5F65 = 0x8DD1
-0x5F66 = 0x8DD4
-0x5F67 = 0x8DD5
-0x5F68 = 0x8DD7
-0x5F69 = 0x8DD9
-0x5F6A = 0x8DE4
-0x5F6B = 0x8DE5
-0x5F6C = 0x8DE7
-0x5F6D = 0x8DEC
-0x5F6E = 0x8DF0
-0x5F6F = 0x8DBC
-0x5F70 = 0x8DF1
-0x5F71 = 0x8DF2
-0x5F72 = 0x8DF4
-0x5F73 = 0x8DFD
-0x5F74 = 0x8E01
-0x5F75 = 0x8E04
-0x5F76 = 0x8E05
-0x5F77 = 0x8E06
-0x5F78 = 0x8E0B
-0x5F79 = 0x8E11
-0x5F7A = 0x8E14
-0x5F7B = 0x8E16
-0x5F7C = 0x8E20
-0x5F7D = 0x8E21
-0x5F7E = 0x8E22
-0x6021 = 0x8E23
-0x6022 = 0x8E26
-0x6023 = 0x8E27
-0x6024 = 0x8E31
-0x6025 = 0x8E33
-0x6026 = 0x8E36
-0x6027 = 0x8E37
-0x6028 = 0x8E38
-0x6029 = 0x8E39
-0x602A = 0x8E3D
-0x602B = 0x8E40
-0x602C = 0x8E41
-0x602D = 0x8E4B
-0x602E = 0x8E4D
-0x602F = 0x8E4E
-0x6030 = 0x8E4F
-0x6031 = 0x8E54
-0x6032 = 0x8E5B
-0x6033 = 0x8E5C
-0x6034 = 0x8E5D
-0x6035 = 0x8E5E
-0x6036 = 0x8E61
-0x6037 = 0x8E62
-0x6038 = 0x8E69
-0x6039 = 0x8E6C
-0x603A = 0x8E6D
-0x603B = 0x8E6F
-0x603C = 0x8E70
-0x603D = 0x8E71
-0x603E = 0x8E79
-0x603F = 0x8E7A
-0x6040 = 0x8E7B
-0x6041 = 0x8E82
-0x6042 = 0x8E83
-0x6043 = 0x8E89
-0x6044 = 0x8E90
-0x6045 = 0x8E92
-0x6046 = 0x8E95
-0x6047 = 0x8E9A
-0x6048 = 0x8E9B
-0x6049 = 0x8E9D
-0x604A = 0x8E9E
-0x604B = 0x8EA2
-0x604C = 0x8EA7
-0x604D = 0x8EA9
-0x604E = 0x8EAD
-0x604F = 0x8EAE
-0x6050 = 0x8EB3
-0x6051 = 0x8EB5
-0x6052 = 0x8EBA
-0x6053 = 0x8EBB
-0x6054 = 0x8EC0
-0x6055 = 0x8EC1
-0x6056 = 0x8EC3
-0x6057 = 0x8EC4
-0x6058 = 0x8EC7
-0x6059 = 0x8ECF
-0x605A = 0x8ED1
-0x605B = 0x8ED4
-0x605C = 0x8EDC
-0x605D = 0x8EE8
-0x605E = 0x8EEE
-0x605F = 0x8EF0
-0x6060 = 0x8EF1
-0x6061 = 0x8EF7
-0x6062 = 0x8EF9
-0x6063 = 0x8EFA
-0x6064 = 0x8EED
-0x6065 = 0x8F00
-0x6066 = 0x8F02
-0x6067 = 0x8F07
-0x6068 = 0x8F08
-0x6069 = 0x8F0F
-0x606A = 0x8F10
-0x606B = 0x8F16
-0x606C = 0x8F17
-0x606D = 0x8F18
-0x606E = 0x8F1E
-0x606F = 0x8F20
-0x6070 = 0x8F21
-0x6071 = 0x8F23
-0x6072 = 0x8F25
-0x6073 = 0x8F27
-0x6074 = 0x8F28
-0x6075 = 0x8F2C
-0x6076 = 0x8F2D
-0x6077 = 0x8F2E
-0x6078 = 0x8F34
-0x6079 = 0x8F35
-0x607A = 0x8F36
-0x607B = 0x8F37
-0x607C = 0x8F3A
-0x607D = 0x8F40
-0x607E = 0x8F41
-0x6121 = 0x8F43
-0x6122 = 0x8F47
-0x6123 = 0x8F4F
-0x6124 = 0x8F51
-0x6125 = 0x8F52
-0x6126 = 0x8F53
-0x6127 = 0x8F54
-0x6128 = 0x8F55
-0x6129 = 0x8F58
-0x612A = 0x8F5D
-0x612B = 0x8F5E
-0x612C = 0x8F65
-0x612D = 0x8F9D
-0x612E = 0x8FA0
-0x612F = 0x8FA1
-0x6130 = 0x8FA4
-0x6131 = 0x8FA5
-0x6132 = 0x8FA6
-0x6133 = 0x8FB5
-0x6134 = 0x8FB6
-0x6135 = 0x8FB8
-0x6136 = 0x8FBE
-0x6137 = 0x8FC0
-0x6138 = 0x8FC1
-0x6139 = 0x8FC6
-0x613A = 0x8FCA
-0x613B = 0x8FCB
-0x613C = 0x8FCD
-0x613D = 0x8FD0
-0x613E = 0x8FD2
-0x613F = 0x8FD3
-0x6140 = 0x8FD5
-0x6141 = 0x8FE0
-0x6142 = 0x8FE3
-0x6143 = 0x8FE4
-0x6144 = 0x8FE8
-0x6145 = 0x8FEE
-0x6146 = 0x8FF1
-0x6147 = 0x8FF5
-0x6148 = 0x8FF6
-0x6149 = 0x8FFB
-0x614A = 0x8FFE
-0x614B = 0x9002
-0x614C = 0x9004
-0x614D = 0x9008
-0x614E = 0x900C
-0x614F = 0x9018
-0x6150 = 0x901B
-0x6151 = 0x9028
-0x6152 = 0x9029
-0x6153 = 0x902F
-0x6154 = 0x902A
-0x6155 = 0x902C
-0x6156 = 0x902D
-0x6157 = 0x9033
-0x6158 = 0x9034
-0x6159 = 0x9037
-0x615A = 0x903F
-0x615B = 0x9043
-0x615C = 0x9044
-0x615D = 0x904C
-0x615E = 0x905B
-0x615F = 0x905D
-0x6160 = 0x9062
-0x6161 = 0x9066
-0x6162 = 0x9067
-0x6163 = 0x906C
-0x6164 = 0x9070
-0x6165 = 0x9074
-0x6166 = 0x9079
-0x6167 = 0x9085
-0x6168 = 0x9088
-0x6169 = 0x908B
-0x616A = 0x908C
-0x616B = 0x908E
-0x616C = 0x9090
-0x616D = 0x9095
-0x616E = 0x9097
-0x616F = 0x9098
-0x6170 = 0x9099
-0x6171 = 0x909B
-0x6172 = 0x90A0
-0x6173 = 0x90A1
-0x6174 = 0x90A2
-0x6175 = 0x90A5
-0x6176 = 0x90B0
-0x6177 = 0x90B2
-0x6178 = 0x90B3
-0x6179 = 0x90B4
-0x617A = 0x90B6
-0x617B = 0x90BD
-0x617C = 0x90CC
-0x617D = 0x90BE
-0x617E = 0x90C3
-0x6221 = 0x90C4
-0x6222 = 0x90C5
-0x6223 = 0x90C7
-0x6224 = 0x90C8
-0x6225 = 0x90D5
-0x6226 = 0x90D7
-0x6227 = 0x90D8
-0x6228 = 0x90D9
-0x6229 = 0x90DC
-0x622A = 0x90DD
-0x622B = 0x90DF
-0x622C = 0x90E5
-0x622D = 0x90D2
-0x622E = 0x90F6
-0x622F = 0x90EB
-0x6230 = 0x90EF
-0x6231 = 0x90F0
-0x6232 = 0x90F4
-0x6233 = 0x90FE
-0x6234 = 0x90FF
-0x6235 = 0x9100
-0x6236 = 0x9104
-0x6237 = 0x9105
-0x6238 = 0x9106
-0x6239 = 0x9108
-0x623A = 0x910D
-0x623B = 0x9110
-0x623C = 0x9114
-0x623D = 0x9116
-0x623E = 0x9117
-0x623F = 0x9118
-0x6240 = 0x911A
-0x6241 = 0x911C
-0x6242 = 0x911E
-0x6243 = 0x9120
-0x6244 = 0x9125
-0x6245 = 0x9122
-0x6246 = 0x9123
-0x6247 = 0x9127
-0x6248 = 0x9129
-0x6249 = 0x912E
-0x624A = 0x912F
-0x624B = 0x9131
-0x624C = 0x9134
-0x624D = 0x9136
-0x624E = 0x9137
-0x624F = 0x9139
-0x6250 = 0x913A
-0x6251 = 0x913C
-0x6252 = 0x913D
-0x6253 = 0x9143
-0x6254 = 0x9147
-0x6255 = 0x9148
-0x6256 = 0x914F
-0x6257 = 0x9153
-0x6258 = 0x9157
-0x6259 = 0x9159
-0x625A = 0x915A
-0x625B = 0x915B
-0x625C = 0x9161
-0x625D = 0x9164
-0x625E = 0x9167
-0x625F = 0x916D
-0x6260 = 0x9174
-0x6261 = 0x9179
-0x6262 = 0x917A
-0x6263 = 0x917B
-0x6264 = 0x9181
-0x6265 = 0x9183
-0x6266 = 0x9185
-0x6267 = 0x9186
-0x6268 = 0x918A
-0x6269 = 0x918E
-0x626A = 0x9191
-0x626B = 0x9193
-0x626C = 0x9194
-0x626D = 0x9195
-0x626E = 0x9198
-0x626F = 0x919E
-0x6270 = 0x91A1
-0x6271 = 0x91A6
-0x6272 = 0x91A8
-0x6273 = 0x91AC
-0x6274 = 0x91AD
-0x6275 = 0x91AE
-0x6276 = 0x91B0
-0x6277 = 0x91B1
-0x6278 = 0x91B2
-0x6279 = 0x91B3
-0x627A = 0x91B6
-0x627B = 0x91BB
-0x627C = 0x91BC
-0x627D = 0x91BD
-0x627E = 0x91BF
-0x6321 = 0x91C2
-0x6322 = 0x91C3
-0x6323 = 0x91C5
-0x6324 = 0x91D3
-0x6325 = 0x91D4
-0x6326 = 0x91D7
-0x6327 = 0x91D9
-0x6328 = 0x91DA
-0x6329 = 0x91DE
-0x632A = 0x91E4
-0x632B = 0x91E5
-0x632C = 0x91E9
-0x632D = 0x91EA
-0x632E = 0x91EC
-0x632F = 0x91ED
-0x6330 = 0x91EE
-0x6331 = 0x91EF
-0x6332 = 0x91F0
-0x6333 = 0x91F1
-0x6334 = 0x91F7
-0x6335 = 0x91F9
-0x6336 = 0x91FB
-0x6337 = 0x91FD
-0x6338 = 0x9200
-0x6339 = 0x9201
-0x633A = 0x9204
-0x633B = 0x9205
-0x633C = 0x9206
-0x633D = 0x9207
-0x633E = 0x9209
-0x633F = 0x920A
-0x6340 = 0x920C
-0x6341 = 0x9210
-0x6342 = 0x9212
-0x6343 = 0x9213
-0x6344 = 0x9216
-0x6345 = 0x9218
-0x6346 = 0x921C
-0x6347 = 0x921D
-0x6348 = 0x9223
-0x6349 = 0x9224
-0x634A = 0x9225
-0x634B = 0x9226
-0x634C = 0x9228
-0x634D = 0x922E
-0x634E = 0x922F
-0x634F = 0x9230
-0x6350 = 0x9233
-0x6351 = 0x9235
-0x6352 = 0x9236
-0x6353 = 0x9238
-0x6354 = 0x9239
-0x6355 = 0x923A
-0x6356 = 0x923C
-0x6357 = 0x923E
-0x6358 = 0x9240
-0x6359 = 0x9242
-0x635A = 0x9243
-0x635B = 0x9246
-0x635C = 0x9247
-0x635D = 0x924A
-0x635E = 0x924D
-0x635F = 0x924E
-0x6360 = 0x924F
-0x6361 = 0x9251
-0x6362 = 0x9258
-0x6363 = 0x9259
-0x6364 = 0x925C
-0x6365 = 0x925D
-0x6366 = 0x9260
-0x6367 = 0x9261
-0x6368 = 0x9265
-0x6369 = 0x9267
-0x636A = 0x9268
-0x636B = 0x9269
-0x636C = 0x926E
-0x636D = 0x926F
-0x636E = 0x9270
-0x636F = 0x9275
-0x6370 = 0x9276
-0x6371 = 0x9277
-0x6372 = 0x9278
-0x6373 = 0x9279
-0x6374 = 0x927B
-0x6375 = 0x927C
-0x6376 = 0x927D
-0x6377 = 0x927F
-0x6378 = 0x9288
-0x6379 = 0x9289
-0x637A = 0x928A
-0x637B = 0x928D
-0x637C = 0x928E
-0x637D = 0x9292
-0x637E = 0x9297
-0x6421 = 0x9299
-0x6422 = 0x929F
-0x6423 = 0x92A0
-0x6424 = 0x92A4
-0x6425 = 0x92A5
-0x6426 = 0x92A7
-0x6427 = 0x92A8
-0x6428 = 0x92AB
-0x6429 = 0x92AF
-0x642A = 0x92B2
-0x642B = 0x92B6
-0x642C = 0x92B8
-0x642D = 0x92BA
-0x642E = 0x92BB
-0x642F = 0x92BC
-0x6430 = 0x92BD
-0x6431 = 0x92BF
-0x6432 = 0x92C0
-0x6433 = 0x92C1
-0x6434 = 0x92C2
-0x6435 = 0x92C3
-0x6436 = 0x92C5
-0x6437 = 0x92C6
-0x6438 = 0x92C7
-0x6439 = 0x92C8
-0x643A = 0x92CB
-0x643B = 0x92CC
-0x643C = 0x92CD
-0x643D = 0x92CE
-0x643E = 0x92D0
-0x643F = 0x92D3
-0x6440 = 0x92D5
-0x6441 = 0x92D7
-0x6442 = 0x92D8
-0x6443 = 0x92D9
-0x6444 = 0x92DC
-0x6445 = 0x92DD
-0x6446 = 0x92DF
-0x6447 = 0x92E0
-0x6448 = 0x92E1
-0x6449 = 0x92E3
-0x644A = 0x92E5
-0x644B = 0x92E7
-0x644C = 0x92E8
-0x644D = 0x92EC
-0x644E = 0x92EE
-0x644F = 0x92F0
-0x6450 = 0x92F9
-0x6451 = 0x92FB
-0x6452 = 0x92FF
-0x6453 = 0x9300
-0x6454 = 0x9302
-0x6455 = 0x9308
-0x6456 = 0x930D
-0x6457 = 0x9311
-0x6458 = 0x9314
-0x6459 = 0x9315
-0x645A = 0x931C
-0x645B = 0x931D
-0x645C = 0x931E
-0x645D = 0x931F
-0x645E = 0x9321
-0x645F = 0x9324
-0x6460 = 0x9325
-0x6461 = 0x9327
-0x6462 = 0x9329
-0x6463 = 0x932A
-0x6464 = 0x9333
-0x6465 = 0x9334
-0x6466 = 0x9336
-0x6467 = 0x9337
-0x6468 = 0x9347
-0x6469 = 0x9348
-0x646A = 0x9349
-0x646B = 0x9350
-0x646C = 0x9351
-0x646D = 0x9352
-0x646E = 0x9355
-0x646F = 0x9357
-0x6470 = 0x9358
-0x6471 = 0x935A
-0x6472 = 0x935E
-0x6473 = 0x9364
-0x6474 = 0x9365
-0x6475 = 0x9367
-0x6476 = 0x9369
-0x6477 = 0x936A
-0x6478 = 0x936D
-0x6479 = 0x936F
-0x647A = 0x9370
-0x647B = 0x9371
-0x647C = 0x9373
-0x647D = 0x9374
-0x647E = 0x9376
-0x6521 = 0x937A
-0x6522 = 0x937D
-0x6523 = 0x937F
-0x6524 = 0x9380
-0x6525 = 0x9381
-0x6526 = 0x9382
-0x6527 = 0x9388
-0x6528 = 0x938A
-0x6529 = 0x938B
-0x652A = 0x938D
-0x652B = 0x938F
-0x652C = 0x9392
-0x652D = 0x9395
-0x652E = 0x9398
-0x652F = 0x939B
-0x6530 = 0x939E
-0x6531 = 0x93A1
-0x6532 = 0x93A3
-0x6533 = 0x93A4
-0x6534 = 0x93A6
-0x6535 = 0x93A8
-0x6536 = 0x93AB
-0x6537 = 0x93B4
-0x6538 = 0x93B5
-0x6539 = 0x93B6
-0x653A = 0x93BA
-0x653B = 0x93A9
-0x653C = 0x93C1
-0x653D = 0x93C4
-0x653E = 0x93C5
-0x653F = 0x93C6
-0x6540 = 0x93C7
-0x6541 = 0x93C9
-0x6542 = 0x93CA
-0x6543 = 0x93CB
-0x6544 = 0x93CC
-0x6545 = 0x93CD
-0x6546 = 0x93D3
-0x6547 = 0x93D9
-0x6548 = 0x93DC
-0x6549 = 0x93DE
-0x654A = 0x93DF
-0x654B = 0x93E2
-0x654C = 0x93E6
-0x654D = 0x93E7
-0x654E = 0x93F9
-0x654F = 0x93F7
-0x6550 = 0x93F8
-0x6551 = 0x93FA
-0x6552 = 0x93FB
-0x6553 = 0x93FD
-0x6554 = 0x9401
-0x6555 = 0x9402
-0x6556 = 0x9404
-0x6557 = 0x9408
-0x6558 = 0x9409
-0x6559 = 0x940D
-0x655A = 0x940E
-0x655B = 0x940F
-0x655C = 0x9415
-0x655D = 0x9416
-0x655E = 0x9417
-0x655F = 0x941F
-0x6560 = 0x942E
-0x6561 = 0x942F
-0x6562 = 0x9431
-0x6563 = 0x9432
-0x6564 = 0x9433
-0x6565 = 0x9434
-0x6566 = 0x943B
-0x6567 = 0x943F
-0x6568 = 0x943D
-0x6569 = 0x9443
-0x656A = 0x9445
-0x656B = 0x9448
-0x656C = 0x944A
-0x656D = 0x944C
-0x656E = 0x9455
-0x656F = 0x9459
-0x6570 = 0x945C
-0x6571 = 0x945F
-0x6572 = 0x9461
-0x6573 = 0x9463
-0x6574 = 0x9468
-0x6575 = 0x946B
-0x6576 = 0x946D
-0x6577 = 0x946E
-0x6578 = 0x946F
-0x6579 = 0x9471
-0x657A = 0x9472
-0x657B = 0x9484
-0x657C = 0x9483
-0x657D = 0x9578
-0x657E = 0x9579
-0x6621 = 0x957E
-0x6622 = 0x9584
-0x6623 = 0x9588
-0x6624 = 0x958C
-0x6625 = 0x958D
-0x6626 = 0x958E
-0x6627 = 0x959D
-0x6628 = 0x959E
-0x6629 = 0x959F
-0x662A = 0x95A1
-0x662B = 0x95A6
-0x662C = 0x95A9
-0x662D = 0x95AB
-0x662E = 0x95AC
-0x662F = 0x95B4
-0x6630 = 0x95B6
-0x6631 = 0x95BA
-0x6632 = 0x95BD
-0x6633 = 0x95BF
-0x6634 = 0x95C6
-0x6635 = 0x95C8
-0x6636 = 0x95C9
-0x6637 = 0x95CB
-0x6638 = 0x95D0
-0x6639 = 0x95D1
-0x663A = 0x95D2
-0x663B = 0x95D3
-0x663C = 0x95D9
-0x663D = 0x95DA
-0x663E = 0x95DD
-0x663F = 0x95DE
-0x6640 = 0x95DF
-0x6641 = 0x95E0
-0x6642 = 0x95E4
-0x6643 = 0x95E6
-0x6644 = 0x961D
-0x6645 = 0x961E
-0x6646 = 0x9622
-0x6647 = 0x9624
-0x6648 = 0x9625
-0x6649 = 0x9626
-0x664A = 0x962C
-0x664B = 0x9631
-0x664C = 0x9633
-0x664D = 0x9637
-0x664E = 0x9638
-0x664F = 0x9639
-0x6650 = 0x963A
-0x6651 = 0x963C
-0x6652 = 0x963D
-0x6653 = 0x9641
-0x6654 = 0x9652
-0x6655 = 0x9654
-0x6656 = 0x9656
-0x6657 = 0x9657
-0x6658 = 0x9658
-0x6659 = 0x9661
-0x665A = 0x966E
-0x665B = 0x9674
-0x665C = 0x967B
-0x665D = 0x967C
-0x665E = 0x967E
-0x665F = 0x967F
-0x6660 = 0x9681
-0x6661 = 0x9682
-0x6662 = 0x9683
-0x6663 = 0x9684
-0x6664 = 0x9689
-0x6665 = 0x9691
-0x6666 = 0x9696
-0x6667 = 0x969A
-0x6668 = 0x969D
-0x6669 = 0x969F
-0x666A = 0x96A4
-0x666B = 0x96A5
-0x666C = 0x96A6
-0x666D = 0x96A9
-0x666E = 0x96AE
-0x666F = 0x96AF
-0x6670 = 0x96B3
-0x6671 = 0x96BA
-0x6672 = 0x96CA
-0x6673 = 0x96D2
-0x6674 = 0x5DB2
-0x6675 = 0x96D8
-0x6676 = 0x96DA
-0x6677 = 0x96DD
-0x6678 = 0x96DE
-0x6679 = 0x96DF
-0x667A = 0x96E9
-0x667B = 0x96EF
-0x667C = 0x96F1
-0x667D = 0x96FA
-0x667E = 0x9702
-0x6721 = 0x9703
-0x6722 = 0x9705
-0x6723 = 0x9709
-0x6724 = 0x971A
-0x6725 = 0x971B
-0x6726 = 0x971D
-0x6727 = 0x9721
-0x6728 = 0x9722
-0x6729 = 0x9723
-0x672A = 0x9728
-0x672B = 0x9731
-0x672C = 0x9733
-0x672D = 0x9741
-0x672E = 0x9743
-0x672F = 0x974A
-0x6730 = 0x974E
-0x6731 = 0x974F
-0x6732 = 0x9755
-0x6733 = 0x9757
-0x6734 = 0x9758
-0x6735 = 0x975A
-0x6736 = 0x975B
-0x6737 = 0x9763
-0x6738 = 0x9767
-0x6739 = 0x976A
-0x673A = 0x976E
-0x673B = 0x9773
-0x673C = 0x9776
-0x673D = 0x9777
-0x673E = 0x9778
-0x673F = 0x977B
-0x6740 = 0x977D
-0x6741 = 0x977F
-0x6742 = 0x9780
-0x6743 = 0x9789
-0x6744 = 0x9795
-0x6745 = 0x9796
-0x6746 = 0x9797
-0x6747 = 0x9799
-0x6748 = 0x979A
-0x6749 = 0x979E
-0x674A = 0x979F
-0x674B = 0x97A2
-0x674C = 0x97AC
-0x674D = 0x97AE
-0x674E = 0x97B1
-0x674F = 0x97B2
-0x6750 = 0x97B5
-0x6751 = 0x97B6
-0x6752 = 0x97B8
-0x6753 = 0x97B9
-0x6754 = 0x97BA
-0x6755 = 0x97BC
-0x6756 = 0x97BE
-0x6757 = 0x97BF
-0x6758 = 0x97C1
-0x6759 = 0x97C4
-0x675A = 0x97C5
-0x675B = 0x97C7
-0x675C = 0x97C9
-0x675D = 0x97CA
-0x675E = 0x97CC
-0x675F = 0x97CD
-0x6760 = 0x97CE
-0x6761 = 0x97D0
-0x6762 = 0x97D1
-0x6763 = 0x97D4
-0x6764 = 0x97D7
-0x6765 = 0x97D8
-0x6766 = 0x97D9
-0x6767 = 0x97DD
-0x6768 = 0x97DE
-0x6769 = 0x97E0
-0x676A = 0x97DB
-0x676B = 0x97E1
-0x676C = 0x97E4
-0x676D = 0x97EF
-0x676E = 0x97F1
-0x676F = 0x97F4
-0x6770 = 0x97F7
-0x6771 = 0x97F8
-0x6772 = 0x97FA
-0x6773 = 0x9807
-0x6774 = 0x980A
-0x6775 = 0x9819
-0x6776 = 0x980D
-0x6777 = 0x980E
-0x6778 = 0x9814
-0x6779 = 0x9816
-0x677A = 0x981C
-0x677B = 0x981E
-0x677C = 0x9820
-0x677D = 0x9823
-0x677E = 0x9826
-0x6821 = 0x982B
-0x6822 = 0x982E
-0x6823 = 0x982F
-0x6824 = 0x9830
-0x6825 = 0x9832
-0x6826 = 0x9833
-0x6827 = 0x9835
-0x6828 = 0x9825
-0x6829 = 0x983E
-0x682A = 0x9844
-0x682B = 0x9847
-0x682C = 0x984A
-0x682D = 0x9851
-0x682E = 0x9852
-0x682F = 0x9853
-0x6830 = 0x9856
-0x6831 = 0x9857
-0x6832 = 0x9859
-0x6833 = 0x985A
-0x6834 = 0x9862
-0x6835 = 0x9863
-0x6836 = 0x9865
-0x6837 = 0x9866
-0x6838 = 0x986A
-0x6839 = 0x986C
-0x683A = 0x98AB
-0x683B = 0x98AD
-0x683C = 0x98AE
-0x683D = 0x98B0
-0x683E = 0x98B4
-0x683F = 0x98B7
-0x6840 = 0x98B8
-0x6841 = 0x98BA
-0x6842 = 0x98BB
-0x6843 = 0x98BF
-0x6844 = 0x98C2
-0x6845 = 0x98C5
-0x6846 = 0x98C8
-0x6847 = 0x98CC
-0x6848 = 0x98E1
-0x6849 = 0x98E3
-0x684A = 0x98E5
-0x684B = 0x98E6
-0x684C = 0x98E7
-0x684D = 0x98EA
-0x684E = 0x98F3
-0x684F = 0x98F6
-0x6850 = 0x9902
-0x6851 = 0x9907
-0x6852 = 0x9908
-0x6853 = 0x9911
-0x6854 = 0x9915
-0x6855 = 0x9916
-0x6856 = 0x9917
-0x6857 = 0x991A
-0x6858 = 0x991B
-0x6859 = 0x991C
-0x685A = 0x991F
-0x685B = 0x9922
-0x685C = 0x9926
-0x685D = 0x9927
-0x685E = 0x992B
-0x685F = 0x9931
-0x6860 = 0x9932
-0x6861 = 0x9933
-0x6862 = 0x9934
-0x6863 = 0x9935
-0x6864 = 0x9939
-0x6865 = 0x993A
-0x6866 = 0x993B
-0x6867 = 0x993C
-0x6868 = 0x9940
-0x6869 = 0x9941
-0x686A = 0x9946
-0x686B = 0x9947
-0x686C = 0x9948
-0x686D = 0x994D
-0x686E = 0x994E
-0x686F = 0x9954
-0x6870 = 0x9958
-0x6871 = 0x9959
-0x6872 = 0x995B
-0x6873 = 0x995C
-0x6874 = 0x995E
-0x6875 = 0x995F
-0x6876 = 0x9960
-0x6877 = 0x999B
-0x6878 = 0x999D
-0x6879 = 0x999F
-0x687A = 0x99A6
-0x687B = 0x99B0
-0x687C = 0x99B1
-0x687D = 0x99B2
-0x687E = 0x99B5
-0x6921 = 0x99B9
-0x6922 = 0x99BA
-0x6923 = 0x99BD
-0x6924 = 0x99BF
-0x6925 = 0x99C3
-0x6926 = 0x99C9
-0x6927 = 0x99D3
-0x6928 = 0x99D4
-0x6929 = 0x99D9
-0x692A = 0x99DA
-0x692B = 0x99DC
-0x692C = 0x99DE
-0x692D = 0x99E7
-0x692E = 0x99EA
-0x692F = 0x99EB
-0x6930 = 0x99EC
-0x6931 = 0x99F0
-0x6932 = 0x99F4
-0x6933 = 0x99F5
-0x6934 = 0x99F9
-0x6935 = 0x99FD
-0x6936 = 0x99FE
-0x6937 = 0x9A02
-0x6938 = 0x9A03
-0x6939 = 0x9A04
-0x693A = 0x9A0B
-0x693B = 0x9A0C
-0x693C = 0x9A10
-0x693D = 0x9A11
-0x693E = 0x9A16
-0x693F = 0x9A1E
-0x6940 = 0x9A20
-0x6941 = 0x9A22
-0x6942 = 0x9A23
-0x6943 = 0x9A24
-0x6944 = 0x9A27
-0x6945 = 0x9A2D
-0x6946 = 0x9A2E
-0x6947 = 0x9A33
-0x6948 = 0x9A35
-0x6949 = 0x9A36
-0x694A = 0x9A38
-0x694B = 0x9A47
-0x694C = 0x9A41
-0x694D = 0x9A44
-0x694E = 0x9A4A
-0x694F = 0x9A4B
-0x6950 = 0x9A4C
-0x6951 = 0x9A4E
-0x6952 = 0x9A51
-0x6953 = 0x9A54
-0x6954 = 0x9A56
-0x6955 = 0x9A5D
-0x6956 = 0x9AAA
-0x6957 = 0x9AAC
-0x6958 = 0x9AAE
-0x6959 = 0x9AAF
-0x695A = 0x9AB2
-0x695B = 0x9AB4
-0x695C = 0x9AB5
-0x695D = 0x9AB6
-0x695E = 0x9AB9
-0x695F = 0x9ABB
-0x6960 = 0x9ABE
-0x6961 = 0x9ABF
-0x6962 = 0x9AC1
-0x6963 = 0x9AC3
-0x6964 = 0x9AC6
-0x6965 = 0x9AC8
-0x6966 = 0x9ACE
-0x6967 = 0x9AD0
-0x6968 = 0x9AD2
-0x6969 = 0x9AD5
-0x696A = 0x9AD6
-0x696B = 0x9AD7
-0x696C = 0x9ADB
-0x696D = 0x9ADC
-0x696E = 0x9AE0
-0x696F = 0x9AE4
-0x6970 = 0x9AE5
-0x6971 = 0x9AE7
-0x6972 = 0x9AE9
-0x6973 = 0x9AEC
-0x6974 = 0x9AF2
-0x6975 = 0x9AF3
-0x6976 = 0x9AF5
-0x6977 = 0x9AF9
-0x6978 = 0x9AFA
-0x6979 = 0x9AFD
-0x697A = 0x9AFF
-0x697B = 0x9B00
-0x697C = 0x9B01
-0x697D = 0x9B02
-0x697E = 0x9B03
-0x6A21 = 0x9B04
-0x6A22 = 0x9B05
-0x6A23 = 0x9B08
-0x6A24 = 0x9B09
-0x6A25 = 0x9B0B
-0x6A26 = 0x9B0C
-0x6A27 = 0x9B0D
-0x6A28 = 0x9B0E
-0x6A29 = 0x9B10
-0x6A2A = 0x9B12
-0x6A2B = 0x9B16
-0x6A2C = 0x9B19
-0x6A2D = 0x9B1B
-0x6A2E = 0x9B1C
-0x6A2F = 0x9B20
-0x6A30 = 0x9B26
-0x6A31 = 0x9B2B
-0x6A32 = 0x9B2D
-0x6A33 = 0x9B33
-0x6A34 = 0x9B34
-0x6A35 = 0x9B35
-0x6A36 = 0x9B37
-0x6A37 = 0x9B39
-0x6A38 = 0x9B3A
-0x6A39 = 0x9B3D
-0x6A3A = 0x9B48
-0x6A3B = 0x9B4B
-0x6A3C = 0x9B4C
-0x6A3D = 0x9B55
-0x6A3E = 0x9B56
-0x6A3F = 0x9B57
-0x6A40 = 0x9B5B
-0x6A41 = 0x9B5E
-0x6A42 = 0x9B61
-0x6A43 = 0x9B63
-0x6A44 = 0x9B65
-0x6A45 = 0x9B66
-0x6A46 = 0x9B68
-0x6A47 = 0x9B6A
-0x6A48 = 0x9B6B
-0x6A49 = 0x9B6C
-0x6A4A = 0x9B6D
-0x6A4B = 0x9B6E
-0x6A4C = 0x9B73
-0x6A4D = 0x9B75
-0x6A4E = 0x9B77
-0x6A4F = 0x9B78
-0x6A50 = 0x9B79
-0x6A51 = 0x9B7F
-0x6A52 = 0x9B80
-0x6A53 = 0x9B84
-0x6A54 = 0x9B85
-0x6A55 = 0x9B86
-0x6A56 = 0x9B87
-0x6A57 = 0x9B89
-0x6A58 = 0x9B8A
-0x6A59 = 0x9B8B
-0x6A5A = 0x9B8D
-0x6A5B = 0x9B8F
-0x6A5C = 0x9B90
-0x6A5D = 0x9B94
-0x6A5E = 0x9B9A
-0x6A5F = 0x9B9D
-0x6A60 = 0x9B9E
-0x6A61 = 0x9BA6
-0x6A62 = 0x9BA7
-0x6A63 = 0x9BA9
-0x6A64 = 0x9BAC
-0x6A65 = 0x9BB0
-0x6A66 = 0x9BB1
-0x6A67 = 0x9BB2
-0x6A68 = 0x9BB7
-0x6A69 = 0x9BB8
-0x6A6A = 0x9BBB
-0x6A6B = 0x9BBC
-0x6A6C = 0x9BBE
-0x6A6D = 0x9BBF
-0x6A6E = 0x9BC1
-0x6A6F = 0x9BC7
-0x6A70 = 0x9BC8
-0x6A71 = 0x9BCE
-0x6A72 = 0x9BD0
-0x6A73 = 0x9BD7
-0x6A74 = 0x9BD8
-0x6A75 = 0x9BDD
-0x6A76 = 0x9BDF
-0x6A77 = 0x9BE5
-0x6A78 = 0x9BE7
-0x6A79 = 0x9BEA
-0x6A7A = 0x9BEB
-0x6A7B = 0x9BEF
-0x6A7C = 0x9BF3
-0x6A7D = 0x9BF7
-0x6A7E = 0x9BF8
-0x6B21 = 0x9BF9
-0x6B22 = 0x9BFA
-0x6B23 = 0x9BFD
-0x6B24 = 0x9BFF
-0x6B25 = 0x9C00
-0x6B26 = 0x9C02
-0x6B27 = 0x9C0B
-0x6B28 = 0x9C0F
-0x6B29 = 0x9C11
-0x6B2A = 0x9C16
-0x6B2B = 0x9C18
-0x6B2C = 0x9C19
-0x6B2D = 0x9C1A
-0x6B2E = 0x9C1C
-0x6B2F = 0x9C1E
-0x6B30 = 0x9C22
-0x6B31 = 0x9C23
-0x6B32 = 0x9C26
-0x6B33 = 0x9C27
-0x6B34 = 0x9C28
-0x6B35 = 0x9C29
-0x6B36 = 0x9C2A
-0x6B37 = 0x9C31
-0x6B38 = 0x9C35
-0x6B39 = 0x9C36
-0x6B3A = 0x9C37
-0x6B3B = 0x9C3D
-0x6B3C = 0x9C41
-0x6B3D = 0x9C43
-0x6B3E = 0x9C44
-0x6B3F = 0x9C45
-0x6B40 = 0x9C49
-0x6B41 = 0x9C4A
-0x6B42 = 0x9C4E
-0x6B43 = 0x9C4F
-0x6B44 = 0x9C50
-0x6B45 = 0x9C53
-0x6B46 = 0x9C54
-0x6B47 = 0x9C56
-0x6B48 = 0x9C58
-0x6B49 = 0x9C5B
-0x6B4A = 0x9C5D
-0x6B4B = 0x9C5E
-0x6B4C = 0x9C5F
-0x6B4D = 0x9C63
-0x6B4E = 0x9C69
-0x6B4F = 0x9C6A
-0x6B50 = 0x9C5C
-0x6B51 = 0x9C6B
-0x6B52 = 0x9C68
-0x6B53 = 0x9C6E
-0x6B54 = 0x9C70
-0x6B55 = 0x9C72
-0x6B56 = 0x9C75
-0x6B57 = 0x9C77
-0x6B58 = 0x9C7B
-0x6B59 = 0x9CE6
-0x6B5A = 0x9CF2
-0x6B5B = 0x9CF7
-0x6B5C = 0x9CF9
-0x6B5D = 0x9D0B
-0x6B5E = 0x9D02
-0x6B5F = 0x9D11
-0x6B60 = 0x9D17
-0x6B61 = 0x9D18
-0x6B62 = 0x9D1C
-0x6B63 = 0x9D1D
-0x6B64 = 0x9D1E
-0x6B65 = 0x9D2F
-0x6B66 = 0x9D30
-0x6B67 = 0x9D32
-0x6B68 = 0x9D33
-0x6B69 = 0x9D34
-0x6B6A = 0x9D3A
-0x6B6B = 0x9D3C
-0x6B6C = 0x9D45
-0x6B6D = 0x9D3D
-0x6B6E = 0x9D42
-0x6B6F = 0x9D43
-0x6B70 = 0x9D47
-0x6B71 = 0x9D4A
-0x6B72 = 0x9D53
-0x6B73 = 0x9D54
-0x6B74 = 0x9D5F
-0x6B75 = 0x9D63
-0x6B76 = 0x9D62
-0x6B77 = 0x9D65
-0x6B78 = 0x9D69
-0x6B79 = 0x9D6A
-0x6B7A = 0x9D6B
-0x6B7B = 0x9D70
-0x6B7C = 0x9D76
-0x6B7D = 0x9D77
-0x6B7E = 0x9D7B
-0x6C21 = 0x9D7C
-0x6C22 = 0x9D7E
-0x6C23 = 0x9D83
-0x6C24 = 0x9D84
-0x6C25 = 0x9D86
-0x6C26 = 0x9D8A
-0x6C27 = 0x9D8D
-0x6C28 = 0x9D8E
-0x6C29 = 0x9D92
-0x6C2A = 0x9D93
-0x6C2B = 0x9D95
-0x6C2C = 0x9D96
-0x6C2D = 0x9D97
-0x6C2E = 0x9D98
-0x6C2F = 0x9DA1
-0x6C30 = 0x9DAA
-0x6C31 = 0x9DAC
-0x6C32 = 0x9DAE
-0x6C33 = 0x9DB1
-0x6C34 = 0x9DB5
-0x6C35 = 0x9DB9
-0x6C36 = 0x9DBC
-0x6C37 = 0x9DBF
-0x6C38 = 0x9DC3
-0x6C39 = 0x9DC7
-0x6C3A = 0x9DC9
-0x6C3B = 0x9DCA
-0x6C3C = 0x9DD4
-0x6C3D = 0x9DD5
-0x6C3E = 0x9DD6
-0x6C3F = 0x9DD7
-0x6C40 = 0x9DDA
-0x6C41 = 0x9DDE
-0x6C42 = 0x9DDF
-0x6C43 = 0x9DE0
-0x6C44 = 0x9DE5
-0x6C45 = 0x9DE7
-0x6C46 = 0x9DE9
-0x6C47 = 0x9DEB
-0x6C48 = 0x9DEE
-0x6C49 = 0x9DF0
-0x6C4A = 0x9DF3
-0x6C4B = 0x9DF4
-0x6C4C = 0x9DFE
-0x6C4D = 0x9E0A
-0x6C4E = 0x9E02
-0x6C4F = 0x9E07
-0x6C50 = 0x9E0E
-0x6C51 = 0x9E10
-0x6C52 = 0x9E11
-0x6C53 = 0x9E12
-0x6C54 = 0x9E15
-0x6C55 = 0x9E16
-0x6C56 = 0x9E19
-0x6C57 = 0x9E1C
-0x6C58 = 0x9E1D
-0x6C59 = 0x9E7A
-0x6C5A = 0x9E7B
-0x6C5B = 0x9E7C
-0x6C5C = 0x9E80
-0x6C5D = 0x9E82
-0x6C5E = 0x9E83
-0x6C5F = 0x9E84
-0x6C60 = 0x9E85
-0x6C61 = 0x9E87
-0x6C62 = 0x9E8E
-0x6C63 = 0x9E8F
-0x6C64 = 0x9E96
-0x6C65 = 0x9E98
-0x6C66 = 0x9E9B
-0x6C67 = 0x9E9E
-0x6C68 = 0x9EA4
-0x6C69 = 0x9EA8
-0x6C6A = 0x9EAC
-0x6C6B = 0x9EAE
-0x6C6C = 0x9EAF
-0x6C6D = 0x9EB0
-0x6C6E = 0x9EB3
-0x6C6F = 0x9EB4
-0x6C70 = 0x9EB5
-0x6C71 = 0x9EC6
-0x6C72 = 0x9EC8
-0x6C73 = 0x9ECB
-0x6C74 = 0x9ED5
-0x6C75 = 0x9EDF
-0x6C76 = 0x9EE4
-0x6C77 = 0x9EE7
-0x6C78 = 0x9EEC
-0x6C79 = 0x9EED
-0x6C7A = 0x9EEE
-0x6C7B = 0x9EF0
-0x6C7C = 0x9EF1
-0x6C7D = 0x9EF2
-0x6C7E = 0x9EF5
-0x6D21 = 0x9EF8
-0x6D22 = 0x9EFF
-0x6D23 = 0x9F02
-0x6D24 = 0x9F03
-0x6D25 = 0x9F09
-0x6D26 = 0x9F0F
-0x6D27 = 0x9F10
-0x6D28 = 0x9F11
-0x6D29 = 0x9F12
-0x6D2A = 0x9F14
-0x6D2B = 0x9F16
-0x6D2C = 0x9F17
-0x6D2D = 0x9F19
-0x6D2E = 0x9F1A
-0x6D2F = 0x9F1B
-0x6D30 = 0x9F1F
-0x6D31 = 0x9F22
-0x6D32 = 0x9F26
-0x6D33 = 0x9F2A
-0x6D34 = 0x9F2B
-0x6D35 = 0x9F2F
-0x6D36 = 0x9F31
-0x6D37 = 0x9F32
-0x6D38 = 0x9F34
-0x6D39 = 0x9F37
-0x6D3A = 0x9F39
-0x6D3B = 0x9F3A
-0x6D3C = 0x9F3C
-0x6D3D = 0x9F3D
-0x6D3E = 0x9F3F
-0x6D3F = 0x9F41
-0x6D40 = 0x9F43
-0x6D41 = 0x9F44
-0x6D42 = 0x9F45
-0x6D43 = 0x9F46
-0x6D44 = 0x9F47
-0x6D45 = 0x9F53
-0x6D46 = 0x9F55
-0x6D47 = 0x9F56
-0x6D48 = 0x9F57
-0x6D49 = 0x9F58
-0x6D4A = 0x9F5A
-0x6D4B = 0x9F5D
-0x6D4C = 0x9F5E
-0x6D4D = 0x9F68
-0x6D4E = 0x9F69
-0x6D4F = 0x9F6D
-0x6D50 = 0x9F6E
-0x6D51 = 0x9F6F
-0x6D52 = 0x9F70
-0x6D53 = 0x9F71
-0x6D54 = 0x9F73
-0x6D55 = 0x9F75
-0x6D56 = 0x9F7A
-0x6D57 = 0x9F7D
-0x6D58 = 0x9F8F
-0x6D59 = 0x9F90
-0x6D5A = 0x9F91
-0x6D5B = 0x9F92
-0x6D5C = 0x9F94
-0x6D5D = 0x9F96
-0x6D5E = 0x9F97
-0x6D5F = 0x9F9E
-0x6D60 = 0x9FA1
-0x6D61 = 0x9FA2
-0x6D62 = 0x9FA3
-0x6D63 = 0x9FA5
-END_MAP
diff --git a/enc/trans/JIS/JISX0212UDC%UCS.src b/enc/trans/JIS/JISX0212UDC%UCS.src
deleted file mode 100644
index d9e8cd7cd3..0000000000
--- a/enc/trans/JIS/JISX0212UDC%UCS.src
+++ /dev/null
@@ -1,954 +0,0 @@
-# $NetBSD: JISX0212UDC%UCS.src,v 1.1 2003/07/19 20:20:41 tshiozak Exp $
-
-TYPE ROWCOL
-NAME "JISX0212UDC/UCS"
-SRC_ZONE 0x75 - 0xFE / 0x21 - 0x7E / 8
-OOB_MODE INVALID
-DST_INVALID 0xFFFE
-DST_UNIT_BITS 16
-
-BEGIN_MAP
-#
-# This data is derived from http://www.opengroup.or.jp/jvc/cde/
-#
-0x7521 = 0xE3AC
-0x7522 = 0xE3AD
-0x7523 = 0xE3AE
-0x7524 = 0xE3AF
-0x7525 = 0xE3B0
-0x7526 = 0xE3B1
-0x7527 = 0xE3B2
-0x7528 = 0xE3B3
-0x7529 = 0xE3B4
-0x752A = 0xE3B5
-0x752B = 0xE3B6
-0x752C = 0xE3B7
-0x752D = 0xE3B8
-0x752E = 0xE3B9
-0x752F = 0xE3BA
-0x7530 = 0xE3BB
-0x7531 = 0xE3BC
-0x7532 = 0xE3BD
-0x7533 = 0xE3BE
-0x7534 = 0xE3BF
-0x7535 = 0xE3C0
-0x7536 = 0xE3C1
-0x7537 = 0xE3C2
-0x7538 = 0xE3C3
-0x7539 = 0xE3C4
-0x753A = 0xE3C5
-0x753B = 0xE3C6
-0x753C = 0xE3C7
-0x753D = 0xE3C8
-0x753E = 0xE3C9
-0x753F = 0xE3CA
-0x7540 = 0xE3CB
-0x7541 = 0xE3CC
-0x7542 = 0xE3CD
-0x7543 = 0xE3CE
-0x7544 = 0xE3CF
-0x7545 = 0xE3D0
-0x7546 = 0xE3D1
-0x7547 = 0xE3D2
-0x7548 = 0xE3D3
-0x7549 = 0xE3D4
-0x754A = 0xE3D5
-0x754B = 0xE3D6
-0x754C = 0xE3D7
-0x754D = 0xE3D8
-0x754E = 0xE3D9
-0x754F = 0xE3DA
-0x7550 = 0xE3DB
-0x7551 = 0xE3DC
-0x7552 = 0xE3DD
-0x7553 = 0xE3DE
-0x7554 = 0xE3DF
-0x7555 = 0xE3E0
-0x7556 = 0xE3E1
-0x7557 = 0xE3E2
-0x7558 = 0xE3E3
-0x7559 = 0xE3E4
-0x755A = 0xE3E5
-0x755B = 0xE3E6
-0x755C = 0xE3E7
-0x755D = 0xE3E8
-0x755E = 0xE3E9
-0x755F = 0xE3EA
-0x7560 = 0xE3EB
-0x7561 = 0xE3EC
-0x7562 = 0xE3ED
-0x7563 = 0xE3EE
-0x7564 = 0xE3EF
-0x7565 = 0xE3F0
-0x7566 = 0xE3F1
-0x7567 = 0xE3F2
-0x7568 = 0xE3F3
-0x7569 = 0xE3F4
-0x756A = 0xE3F5
-0x756B = 0xE3F6
-0x756C = 0xE3F7
-0x756D = 0xE3F8
-0x756E = 0xE3F9
-0x756F = 0xE3FA
-0x7570 = 0xE3FB
-0x7571 = 0xE3FC
-0x7572 = 0xE3FD
-0x7573 = 0xE3FE
-0x7574 = 0xE3FF
-0x7575 = 0xE400
-0x7576 = 0xE401
-0x7577 = 0xE402
-0x7578 = 0xE403
-0x7579 = 0xE404
-0x757A = 0xE405
-0x757B = 0xE406
-0x757C = 0xE407
-0x757D = 0xE408
-0x757E = 0xE409
-0x7621 = 0xE40A
-0x7622 = 0xE40B
-0x7623 = 0xE40C
-0x7624 = 0xE40D
-0x7625 = 0xE40E
-0x7626 = 0xE40F
-0x7627 = 0xE410
-0x7628 = 0xE411
-0x7629 = 0xE412
-0x762A = 0xE413
-0x762B = 0xE414
-0x762C = 0xE415
-0x762D = 0xE416
-0x762E = 0xE417
-0x762F = 0xE418
-0x7630 = 0xE419
-0x7631 = 0xE41A
-0x7632 = 0xE41B
-0x7633 = 0xE41C
-0x7634 = 0xE41D
-0x7635 = 0xE41E
-0x7636 = 0xE41F
-0x7637 = 0xE420
-0x7638 = 0xE421
-0x7639 = 0xE422
-0x763A = 0xE423
-0x763B = 0xE424
-0x763C = 0xE425
-0x763D = 0xE426
-0x763E = 0xE427
-0x763F = 0xE428
-0x7640 = 0xE429
-0x7641 = 0xE42A
-0x7642 = 0xE42B
-0x7643 = 0xE42C
-0x7644 = 0xE42D
-0x7645 = 0xE42E
-0x7646 = 0xE42F
-0x7647 = 0xE430
-0x7648 = 0xE431
-0x7649 = 0xE432
-0x764A = 0xE433
-0x764B = 0xE434
-0x764C = 0xE435
-0x764D = 0xE436
-0x764E = 0xE437
-0x764F = 0xE438
-0x7650 = 0xE439
-0x7651 = 0xE43A
-0x7652 = 0xE43B
-0x7653 = 0xE43C
-0x7654 = 0xE43D
-0x7655 = 0xE43E
-0x7656 = 0xE43F
-0x7657 = 0xE440
-0x7658 = 0xE441
-0x7659 = 0xE442
-0x765A = 0xE443
-0x765B = 0xE444
-0x765C = 0xE445
-0x765D = 0xE446
-0x765E = 0xE447
-0x765F = 0xE448
-0x7660 = 0xE449
-0x7661 = 0xE44A
-0x7662 = 0xE44B
-0x7663 = 0xE44C
-0x7664 = 0xE44D
-0x7665 = 0xE44E
-0x7666 = 0xE44F
-0x7667 = 0xE450
-0x7668 = 0xE451
-0x7669 = 0xE452
-0x766A = 0xE453
-0x766B = 0xE454
-0x766C = 0xE455
-0x766D = 0xE456
-0x766E = 0xE457
-0x766F = 0xE458
-0x7670 = 0xE459
-0x7671 = 0xE45A
-0x7672 = 0xE45B
-0x7673 = 0xE45C
-0x7674 = 0xE45D
-0x7675 = 0xE45E
-0x7676 = 0xE45F
-0x7677 = 0xE460
-0x7678 = 0xE461
-0x7679 = 0xE462
-0x767A = 0xE463
-0x767B = 0xE464
-0x767C = 0xE465
-0x767D = 0xE466
-0x767E = 0xE467
-0x7721 = 0xE468
-0x7722 = 0xE469
-0x7723 = 0xE46A
-0x7724 = 0xE46B
-0x7725 = 0xE46C
-0x7726 = 0xE46D
-0x7727 = 0xE46E
-0x7728 = 0xE46F
-0x7729 = 0xE470
-0x772A = 0xE471
-0x772B = 0xE472
-0x772C = 0xE473
-0x772D = 0xE474
-0x772E = 0xE475
-0x772F = 0xE476
-0x7730 = 0xE477
-0x7731 = 0xE478
-0x7732 = 0xE479
-0x7733 = 0xE47A
-0x7734 = 0xE47B
-0x7735 = 0xE47C
-0x7736 = 0xE47D
-0x7737 = 0xE47E
-0x7738 = 0xE47F
-0x7739 = 0xE480
-0x773A = 0xE481
-0x773B = 0xE482
-0x773C = 0xE483
-0x773D = 0xE484
-0x773E = 0xE485
-0x773F = 0xE486
-0x7740 = 0xE487
-0x7741 = 0xE488
-0x7742 = 0xE489
-0x7743 = 0xE48A
-0x7744 = 0xE48B
-0x7745 = 0xE48C
-0x7746 = 0xE48D
-0x7747 = 0xE48E
-0x7748 = 0xE48F
-0x7749 = 0xE490
-0x774A = 0xE491
-0x774B = 0xE492
-0x774C = 0xE493
-0x774D = 0xE494
-0x774E = 0xE495
-0x774F = 0xE496
-0x7750 = 0xE497
-0x7751 = 0xE498
-0x7752 = 0xE499
-0x7753 = 0xE49A
-0x7754 = 0xE49B
-0x7755 = 0xE49C
-0x7756 = 0xE49D
-0x7757 = 0xE49E
-0x7758 = 0xE49F
-0x7759 = 0xE4A0
-0x775A = 0xE4A1
-0x775B = 0xE4A2
-0x775C = 0xE4A3
-0x775D = 0xE4A4
-0x775E = 0xE4A5
-0x775F = 0xE4A6
-0x7760 = 0xE4A7
-0x7761 = 0xE4A8
-0x7762 = 0xE4A9
-0x7763 = 0xE4AA
-0x7764 = 0xE4AB
-0x7765 = 0xE4AC
-0x7766 = 0xE4AD
-0x7767 = 0xE4AE
-0x7768 = 0xE4AF
-0x7769 = 0xE4B0
-0x776A = 0xE4B1
-0x776B = 0xE4B2
-0x776C = 0xE4B3
-0x776D = 0xE4B4
-0x776E = 0xE4B5
-0x776F = 0xE4B6
-0x7770 = 0xE4B7
-0x7771 = 0xE4B8
-0x7772 = 0xE4B9
-0x7773 = 0xE4BA
-0x7774 = 0xE4BB
-0x7775 = 0xE4BC
-0x7776 = 0xE4BD
-0x7777 = 0xE4BE
-0x7778 = 0xE4BF
-0x7779 = 0xE4C0
-0x777A = 0xE4C1
-0x777B = 0xE4C2
-0x777C = 0xE4C3
-0x777D = 0xE4C4
-0x777E = 0xE4C5
-0x7821 = 0xE4C6
-0x7822 = 0xE4C7
-0x7823 = 0xE4C8
-0x7824 = 0xE4C9
-0x7825 = 0xE4CA
-0x7826 = 0xE4CB
-0x7827 = 0xE4CC
-0x7828 = 0xE4CD
-0x7829 = 0xE4CE
-0x782A = 0xE4CF
-0x782B = 0xE4D0
-0x782C = 0xE4D1
-0x782D = 0xE4D2
-0x782E = 0xE4D3
-0x782F = 0xE4D4
-0x7830 = 0xE4D5
-0x7831 = 0xE4D6
-0x7832 = 0xE4D7
-0x7833 = 0xE4D8
-0x7834 = 0xE4D9
-0x7835 = 0xE4DA
-0x7836 = 0xE4DB
-0x7837 = 0xE4DC
-0x7838 = 0xE4DD
-0x7839 = 0xE4DE
-0x783A = 0xE4DF
-0x783B = 0xE4E0
-0x783C = 0xE4E1
-0x783D = 0xE4E2
-0x783E = 0xE4E3
-0x783F = 0xE4E4
-0x7840 = 0xE4E5
-0x7841 = 0xE4E6
-0x7842 = 0xE4E7
-0x7843 = 0xE4E8
-0x7844 = 0xE4E9
-0x7845 = 0xE4EA
-0x7846 = 0xE4EB
-0x7847 = 0xE4EC
-0x7848 = 0xE4ED
-0x7849 = 0xE4EE
-0x784A = 0xE4EF
-0x784B = 0xE4F0
-0x784C = 0xE4F1
-0x784D = 0xE4F2
-0x784E = 0xE4F3
-0x784F = 0xE4F4
-0x7850 = 0xE4F5
-0x7851 = 0xE4F6
-0x7852 = 0xE4F7
-0x7853 = 0xE4F8
-0x7854 = 0xE4F9
-0x7855 = 0xE4FA
-0x7856 = 0xE4FB
-0x7857 = 0xE4FC
-0x7858 = 0xE4FD
-0x7859 = 0xE4FE
-0x785A = 0xE4FF
-0x785B = 0xE500
-0x785C = 0xE501
-0x785D = 0xE502
-0x785E = 0xE503
-0x785F = 0xE504
-0x7860 = 0xE505
-0x7861 = 0xE506
-0x7862 = 0xE507
-0x7863 = 0xE508
-0x7864 = 0xE509
-0x7865 = 0xE50A
-0x7866 = 0xE50B
-0x7867 = 0xE50C
-0x7868 = 0xE50D
-0x7869 = 0xE50E
-0x786A = 0xE50F
-0x786B = 0xE510
-0x786C = 0xE511
-0x786D = 0xE512
-0x786E = 0xE513
-0x786F = 0xE514
-0x7870 = 0xE515
-0x7871 = 0xE516
-0x7872 = 0xE517
-0x7873 = 0xE518
-0x7874 = 0xE519
-0x7875 = 0xE51A
-0x7876 = 0xE51B
-0x7877 = 0xE51C
-0x7878 = 0xE51D
-0x7879 = 0xE51E
-0x787A = 0xE51F
-0x787B = 0xE520
-0x787C = 0xE521
-0x787D = 0xE522
-0x787E = 0xE523
-0x7921 = 0xE524
-0x7922 = 0xE525
-0x7923 = 0xE526
-0x7924 = 0xE527
-0x7925 = 0xE528
-0x7926 = 0xE529
-0x7927 = 0xE52A
-0x7928 = 0xE52B
-0x7929 = 0xE52C
-0x792A = 0xE52D
-0x792B = 0xE52E
-0x792C = 0xE52F
-0x792D = 0xE530
-0x792E = 0xE531
-0x792F = 0xE532
-0x7930 = 0xE533
-0x7931 = 0xE534
-0x7932 = 0xE535
-0x7933 = 0xE536
-0x7934 = 0xE537
-0x7935 = 0xE538
-0x7936 = 0xE539
-0x7937 = 0xE53A
-0x7938 = 0xE53B
-0x7939 = 0xE53C
-0x793A = 0xE53D
-0x793B = 0xE53E
-0x793C = 0xE53F
-0x793D = 0xE540
-0x793E = 0xE541
-0x793F = 0xE542
-0x7940 = 0xE543
-0x7941 = 0xE544
-0x7942 = 0xE545
-0x7943 = 0xE546
-0x7944 = 0xE547
-0x7945 = 0xE548
-0x7946 = 0xE549
-0x7947 = 0xE54A
-0x7948 = 0xE54B
-0x7949 = 0xE54C
-0x794A = 0xE54D
-0x794B = 0xE54E
-0x794C = 0xE54F
-0x794D = 0xE550
-0x794E = 0xE551
-0x794F = 0xE552
-0x7950 = 0xE553
-0x7951 = 0xE554
-0x7952 = 0xE555
-0x7953 = 0xE556
-0x7954 = 0xE557
-0x7955 = 0xE558
-0x7956 = 0xE559
-0x7957 = 0xE55A
-0x7958 = 0xE55B
-0x7959 = 0xE55C
-0x795A = 0xE55D
-0x795B = 0xE55E
-0x795C = 0xE55F
-0x795D = 0xE560
-0x795E = 0xE561
-0x795F = 0xE562
-0x7960 = 0xE563
-0x7961 = 0xE564
-0x7962 = 0xE565
-0x7963 = 0xE566
-0x7964 = 0xE567
-0x7965 = 0xE568
-0x7966 = 0xE569
-0x7967 = 0xE56A
-0x7968 = 0xE56B
-0x7969 = 0xE56C
-0x796A = 0xE56D
-0x796B = 0xE56E
-0x796C = 0xE56F
-0x796D = 0xE570
-0x796E = 0xE571
-0x796F = 0xE572
-0x7970 = 0xE573
-0x7971 = 0xE574
-0x7972 = 0xE575
-0x7973 = 0xE576
-0x7974 = 0xE577
-0x7975 = 0xE578
-0x7976 = 0xE579
-0x7977 = 0xE57A
-0x7978 = 0xE57B
-0x7979 = 0xE57C
-0x797A = 0xE57D
-0x797B = 0xE57E
-0x797C = 0xE57F
-0x797D = 0xE580
-0x797E = 0xE581
-0x7A21 = 0xE582
-0x7A22 = 0xE583
-0x7A23 = 0xE584
-0x7A24 = 0xE585
-0x7A25 = 0xE586
-0x7A26 = 0xE587
-0x7A27 = 0xE588
-0x7A28 = 0xE589
-0x7A29 = 0xE58A
-0x7A2A = 0xE58B
-0x7A2B = 0xE58C
-0x7A2C = 0xE58D
-0x7A2D = 0xE58E
-0x7A2E = 0xE58F
-0x7A2F = 0xE590
-0x7A30 = 0xE591
-0x7A31 = 0xE592
-0x7A32 = 0xE593
-0x7A33 = 0xE594
-0x7A34 = 0xE595
-0x7A35 = 0xE596
-0x7A36 = 0xE597
-0x7A37 = 0xE598
-0x7A38 = 0xE599
-0x7A39 = 0xE59A
-0x7A3A = 0xE59B
-0x7A3B = 0xE59C
-0x7A3C = 0xE59D
-0x7A3D = 0xE59E
-0x7A3E = 0xE59F
-0x7A3F = 0xE5A0
-0x7A40 = 0xE5A1
-0x7A41 = 0xE5A2
-0x7A42 = 0xE5A3
-0x7A43 = 0xE5A4
-0x7A44 = 0xE5A5
-0x7A45 = 0xE5A6
-0x7A46 = 0xE5A7
-0x7A47 = 0xE5A8
-0x7A48 = 0xE5A9
-0x7A49 = 0xE5AA
-0x7A4A = 0xE5AB
-0x7A4B = 0xE5AC
-0x7A4C = 0xE5AD
-0x7A4D = 0xE5AE
-0x7A4E = 0xE5AF
-0x7A4F = 0xE5B0
-0x7A50 = 0xE5B1
-0x7A51 = 0xE5B2
-0x7A52 = 0xE5B3
-0x7A53 = 0xE5B4
-0x7A54 = 0xE5B5
-0x7A55 = 0xE5B6
-0x7A56 = 0xE5B7
-0x7A57 = 0xE5B8
-0x7A58 = 0xE5B9
-0x7A59 = 0xE5BA
-0x7A5A = 0xE5BB
-0x7A5B = 0xE5BC
-0x7A5C = 0xE5BD
-0x7A5D = 0xE5BE
-0x7A5E = 0xE5BF
-0x7A5F = 0xE5C0
-0x7A60 = 0xE5C1
-0x7A61 = 0xE5C2
-0x7A62 = 0xE5C3
-0x7A63 = 0xE5C4
-0x7A64 = 0xE5C5
-0x7A65 = 0xE5C6
-0x7A66 = 0xE5C7
-0x7A67 = 0xE5C8
-0x7A68 = 0xE5C9
-0x7A69 = 0xE5CA
-0x7A6A = 0xE5CB
-0x7A6B = 0xE5CC
-0x7A6C = 0xE5CD
-0x7A6D = 0xE5CE
-0x7A6E = 0xE5CF
-0x7A6F = 0xE5D0
-0x7A70 = 0xE5D1
-0x7A71 = 0xE5D2
-0x7A72 = 0xE5D3
-0x7A73 = 0xE5D4
-0x7A74 = 0xE5D5
-0x7A75 = 0xE5D6
-0x7A76 = 0xE5D7
-0x7A77 = 0xE5D8
-0x7A78 = 0xE5D9
-0x7A79 = 0xE5DA
-0x7A7A = 0xE5DB
-0x7A7B = 0xE5DC
-0x7A7C = 0xE5DD
-0x7A7D = 0xE5DE
-0x7A7E = 0xE5DF
-0x7B21 = 0xE5E0
-0x7B22 = 0xE5E1
-0x7B23 = 0xE5E2
-0x7B24 = 0xE5E3
-0x7B25 = 0xE5E4
-0x7B26 = 0xE5E5
-0x7B27 = 0xE5E6
-0x7B28 = 0xE5E7
-0x7B29 = 0xE5E8
-0x7B2A = 0xE5E9
-0x7B2B = 0xE5EA
-0x7B2C = 0xE5EB
-0x7B2D = 0xE5EC
-0x7B2E = 0xE5ED
-0x7B2F = 0xE5EE
-0x7B30 = 0xE5EF
-0x7B31 = 0xE5F0
-0x7B32 = 0xE5F1
-0x7B33 = 0xE5F2
-0x7B34 = 0xE5F3
-0x7B35 = 0xE5F4
-0x7B36 = 0xE5F5
-0x7B37 = 0xE5F6
-0x7B38 = 0xE5F7
-0x7B39 = 0xE5F8
-0x7B3A = 0xE5F9
-0x7B3B = 0xE5FA
-0x7B3C = 0xE5FB
-0x7B3D = 0xE5FC
-0x7B3E = 0xE5FD
-0x7B3F = 0xE5FE
-0x7B40 = 0xE5FF
-0x7B41 = 0xE600
-0x7B42 = 0xE601
-0x7B43 = 0xE602
-0x7B44 = 0xE603
-0x7B45 = 0xE604
-0x7B46 = 0xE605
-0x7B47 = 0xE606
-0x7B48 = 0xE607
-0x7B49 = 0xE608
-0x7B4A = 0xE609
-0x7B4B = 0xE60A
-0x7B4C = 0xE60B
-0x7B4D = 0xE60C
-0x7B4E = 0xE60D
-0x7B4F = 0xE60E
-0x7B50 = 0xE60F
-0x7B51 = 0xE610
-0x7B52 = 0xE611
-0x7B53 = 0xE612
-0x7B54 = 0xE613
-0x7B55 = 0xE614
-0x7B56 = 0xE615
-0x7B57 = 0xE616
-0x7B58 = 0xE617
-0x7B59 = 0xE618
-0x7B5A = 0xE619
-0x7B5B = 0xE61A
-0x7B5C = 0xE61B
-0x7B5D = 0xE61C
-0x7B5E = 0xE61D
-0x7B5F = 0xE61E
-0x7B60 = 0xE61F
-0x7B61 = 0xE620
-0x7B62 = 0xE621
-0x7B63 = 0xE622
-0x7B64 = 0xE623
-0x7B65 = 0xE624
-0x7B66 = 0xE625
-0x7B67 = 0xE626
-0x7B68 = 0xE627
-0x7B69 = 0xE628
-0x7B6A = 0xE629
-0x7B6B = 0xE62A
-0x7B6C = 0xE62B
-0x7B6D = 0xE62C
-0x7B6E = 0xE62D
-0x7B6F = 0xE62E
-0x7B70 = 0xE62F
-0x7B71 = 0xE630
-0x7B72 = 0xE631
-0x7B73 = 0xE632
-0x7B74 = 0xE633
-0x7B75 = 0xE634
-0x7B76 = 0xE635
-0x7B77 = 0xE636
-0x7B78 = 0xE637
-0x7B79 = 0xE638
-0x7B7A = 0xE639
-0x7B7B = 0xE63A
-0x7B7C = 0xE63B
-0x7B7D = 0xE63C
-0x7B7E = 0xE63D
-0x7C21 = 0xE63E
-0x7C22 = 0xE63F
-0x7C23 = 0xE640
-0x7C24 = 0xE641
-0x7C25 = 0xE642
-0x7C26 = 0xE643
-0x7C27 = 0xE644
-0x7C28 = 0xE645
-0x7C29 = 0xE646
-0x7C2A = 0xE647
-0x7C2B = 0xE648
-0x7C2C = 0xE649
-0x7C2D = 0xE64A
-0x7C2E = 0xE64B
-0x7C2F = 0xE64C
-0x7C30 = 0xE64D
-0x7C31 = 0xE64E
-0x7C32 = 0xE64F
-0x7C33 = 0xE650
-0x7C34 = 0xE651
-0x7C35 = 0xE652
-0x7C36 = 0xE653
-0x7C37 = 0xE654
-0x7C38 = 0xE655
-0x7C39 = 0xE656
-0x7C3A = 0xE657
-0x7C3B = 0xE658
-0x7C3C = 0xE659
-0x7C3D = 0xE65A
-0x7C3E = 0xE65B
-0x7C3F = 0xE65C
-0x7C40 = 0xE65D
-0x7C41 = 0xE65E
-0x7C42 = 0xE65F
-0x7C43 = 0xE660
-0x7C44 = 0xE661
-0x7C45 = 0xE662
-0x7C46 = 0xE663
-0x7C47 = 0xE664
-0x7C48 = 0xE665
-0x7C49 = 0xE666
-0x7C4A = 0xE667
-0x7C4B = 0xE668
-0x7C4C = 0xE669
-0x7C4D = 0xE66A
-0x7C4E = 0xE66B
-0x7C4F = 0xE66C
-0x7C50 = 0xE66D
-0x7C51 = 0xE66E
-0x7C52 = 0xE66F
-0x7C53 = 0xE670
-0x7C54 = 0xE671
-0x7C55 = 0xE672
-0x7C56 = 0xE673
-0x7C57 = 0xE674
-0x7C58 = 0xE675
-0x7C59 = 0xE676
-0x7C5A = 0xE677
-0x7C5B = 0xE678
-0x7C5C = 0xE679
-0x7C5D = 0xE67A
-0x7C5E = 0xE67B
-0x7C5F = 0xE67C
-0x7C60 = 0xE67D
-0x7C61 = 0xE67E
-0x7C62 = 0xE67F
-0x7C63 = 0xE680
-0x7C64 = 0xE681
-0x7C65 = 0xE682
-0x7C66 = 0xE683
-0x7C67 = 0xE684
-0x7C68 = 0xE685
-0x7C69 = 0xE686
-0x7C6A = 0xE687
-0x7C6B = 0xE688
-0x7C6C = 0xE689
-0x7C6D = 0xE68A
-0x7C6E = 0xE68B
-0x7C6F = 0xE68C
-0x7C70 = 0xE68D
-0x7C71 = 0xE68E
-0x7C72 = 0xE68F
-0x7C73 = 0xE690
-0x7C74 = 0xE691
-0x7C75 = 0xE692
-0x7C76 = 0xE693
-0x7C77 = 0xE694
-0x7C78 = 0xE695
-0x7C79 = 0xE696
-0x7C7A = 0xE697
-0x7C7B = 0xE698
-0x7C7C = 0xE699
-0x7C7D = 0xE69A
-0x7C7E = 0xE69B
-0x7D21 = 0xE69C
-0x7D22 = 0xE69D
-0x7D23 = 0xE69E
-0x7D24 = 0xE69F
-0x7D25 = 0xE6A0
-0x7D26 = 0xE6A1
-0x7D27 = 0xE6A2
-0x7D28 = 0xE6A3
-0x7D29 = 0xE6A4
-0x7D2A = 0xE6A5
-0x7D2B = 0xE6A6
-0x7D2C = 0xE6A7
-0x7D2D = 0xE6A8
-0x7D2E = 0xE6A9
-0x7D2F = 0xE6AA
-0x7D30 = 0xE6AB
-0x7D31 = 0xE6AC
-0x7D32 = 0xE6AD
-0x7D33 = 0xE6AE
-0x7D34 = 0xE6AF
-0x7D35 = 0xE6B0
-0x7D36 = 0xE6B1
-0x7D37 = 0xE6B2
-0x7D38 = 0xE6B3
-0x7D39 = 0xE6B4
-0x7D3A = 0xE6B5
-0x7D3B = 0xE6B6
-0x7D3C = 0xE6B7
-0x7D3D = 0xE6B8
-0x7D3E = 0xE6B9
-0x7D3F = 0xE6BA
-0x7D40 = 0xE6BB
-0x7D41 = 0xE6BC
-0x7D42 = 0xE6BD
-0x7D43 = 0xE6BE
-0x7D44 = 0xE6BF
-0x7D45 = 0xE6C0
-0x7D46 = 0xE6C1
-0x7D47 = 0xE6C2
-0x7D48 = 0xE6C3
-0x7D49 = 0xE6C4
-0x7D4A = 0xE6C5
-0x7D4B = 0xE6C6
-0x7D4C = 0xE6C7
-0x7D4D = 0xE6C8
-0x7D4E = 0xE6C9
-0x7D4F = 0xE6CA
-0x7D50 = 0xE6CB
-0x7D51 = 0xE6CC
-0x7D52 = 0xE6CD
-0x7D53 = 0xE6CE
-0x7D54 = 0xE6CF
-0x7D55 = 0xE6D0
-0x7D56 = 0xE6D1
-0x7D57 = 0xE6D2
-0x7D58 = 0xE6D3
-0x7D59 = 0xE6D4
-0x7D5A = 0xE6D5
-0x7D5B = 0xE6D6
-0x7D5C = 0xE6D7
-0x7D5D = 0xE6D8
-0x7D5E = 0xE6D9
-0x7D5F = 0xE6DA
-0x7D60 = 0xE6DB
-0x7D61 = 0xE6DC
-0x7D62 = 0xE6DD
-0x7D63 = 0xE6DE
-0x7D64 = 0xE6DF
-0x7D65 = 0xE6E0
-0x7D66 = 0xE6E1
-0x7D67 = 0xE6E2
-0x7D68 = 0xE6E3
-0x7D69 = 0xE6E4
-0x7D6A = 0xE6E5
-0x7D6B = 0xE6E6
-0x7D6C = 0xE6E7
-0x7D6D = 0xE6E8
-0x7D6E = 0xE6E9
-0x7D6F = 0xE6EA
-0x7D70 = 0xE6EB
-0x7D71 = 0xE6EC
-0x7D72 = 0xE6ED
-0x7D73 = 0xE6EE
-0x7D74 = 0xE6EF
-0x7D75 = 0xE6F0
-0x7D76 = 0xE6F1
-0x7D77 = 0xE6F2
-0x7D78 = 0xE6F3
-0x7D79 = 0xE6F4
-0x7D7A = 0xE6F5
-0x7D7B = 0xE6F6
-0x7D7C = 0xE6F7
-0x7D7D = 0xE6F8
-0x7D7E = 0xE6F9
-0x7E21 = 0xE6FA
-0x7E22 = 0xE6FB
-0x7E23 = 0xE6FC
-0x7E24 = 0xE6FD
-0x7E25 = 0xE6FE
-0x7E26 = 0xE6FF
-0x7E27 = 0xE700
-0x7E28 = 0xE701
-0x7E29 = 0xE702
-0x7E2A = 0xE703
-0x7E2B = 0xE704
-0x7E2C = 0xE705
-0x7E2D = 0xE706
-0x7E2E = 0xE707
-0x7E2F = 0xE708
-0x7E30 = 0xE709
-0x7E31 = 0xE70A
-0x7E32 = 0xE70B
-0x7E33 = 0xE70C
-0x7E34 = 0xE70D
-0x7E35 = 0xE70E
-0x7E36 = 0xE70F
-0x7E37 = 0xE710
-0x7E38 = 0xE711
-0x7E39 = 0xE712
-0x7E3A = 0xE713
-0x7E3B = 0xE714
-0x7E3C = 0xE715
-0x7E3D = 0xE716
-0x7E3E = 0xE717
-0x7E3F = 0xE718
-0x7E40 = 0xE719
-0x7E41 = 0xE71A
-0x7E42 = 0xE71B
-0x7E43 = 0xE71C
-0x7E44 = 0xE71D
-0x7E45 = 0xE71E
-0x7E46 = 0xE71F
-0x7E47 = 0xE720
-0x7E48 = 0xE721
-0x7E49 = 0xE722
-0x7E4A = 0xE723
-0x7E4B = 0xE724
-0x7E4C = 0xE725
-0x7E4D = 0xE726
-0x7E4E = 0xE727
-0x7E4F = 0xE728
-0x7E50 = 0xE729
-0x7E51 = 0xE72A
-0x7E52 = 0xE72B
-0x7E53 = 0xE72C
-0x7E54 = 0xE72D
-0x7E55 = 0xE72E
-0x7E56 = 0xE72F
-0x7E57 = 0xE730
-0x7E58 = 0xE731
-0x7E59 = 0xE732
-0x7E5A = 0xE733
-0x7E5B = 0xE734
-0x7E5C = 0xE735
-0x7E5D = 0xE736
-0x7E5E = 0xE737
-0x7E5F = 0xE738
-0x7E60 = 0xE739
-0x7E61 = 0xE73A
-0x7E62 = 0xE73B
-0x7E63 = 0xE73C
-0x7E64 = 0xE73D
-0x7E65 = 0xE73E
-0x7E66 = 0xE73F
-0x7E67 = 0xE740
-0x7E68 = 0xE741
-0x7E69 = 0xE742
-0x7E6A = 0xE743
-0x7E6B = 0xE744
-0x7E6C = 0xE745
-0x7E6D = 0xE746
-0x7E6E = 0xE747
-0x7E6F = 0xE748
-0x7E70 = 0xE749
-0x7E71 = 0xE74A
-0x7E72 = 0xE74B
-0x7E73 = 0xE74C
-0x7E74 = 0xE74D
-0x7E75 = 0xE74E
-0x7E76 = 0xE74F
-0x7E77 = 0xE750
-0x7E78 = 0xE751
-0x7E79 = 0xE752
-0x7E7A = 0xE753
-0x7E7B = 0xE754
-0x7E7C = 0xE755
-0x7E7D = 0xE756
-0x7E7E = 0xE757
-END_MAP
diff --git a/enc/trans/JIS/JISX0212VDC@IBM%UCS.src b/enc/trans/JIS/JISX0212VDC@IBM%UCS.src
deleted file mode 100644
index 6f73ed3617..0000000000
--- a/enc/trans/JIS/JISX0212VDC@IBM%UCS.src
+++ /dev/null
@@ -1,120 +0,0 @@
-# $NetBSD: JISX0212VDC@IBM%UCS.src,v 1.1 2003/07/19 20:20:41 tshiozak Exp $
-
-TYPE ROWCOL
-NAME "JISX0212VDC:IBM/UCS"
-SRC_ZONE 0x7321 - 0x747E
-OOB_MODE INVALID
-DST_INVALID 0xFFFE
-DST_UNIT_BITS 16
-
-BEGIN_MAP
-#
-# This data is derived from http://www.opengroup.or.jp/jvc/cde/
-#
-0x7373 = 0x2170
-0x7374 = 0x2171
-0x7375 = 0x2172
-0x7376 = 0x2173
-0x7377 = 0x2174
-0x7378 = 0x2175
-0x7379 = 0x2176
-0x737A = 0x2177
-0x737B = 0x2178
-0x737C = 0x2179
-0x737D = 0x2160
-0x737E = 0x2161
-0x7421 = 0x2162
-0x7422 = 0x2163
-0x7423 = 0x2164
-0x7424 = 0x2165
-0x7425 = 0x2166
-0x7426 = 0x2167
-0x7427 = 0x2168
-0x7428 = 0x2169
-0x7429 = 0xFF07
-0x742A = 0xFF02
-0x742B = 0x3231
-0x742C = 0x2116
-0x742D = 0x2121
-0x742E = 0x70BB
-0x742F = 0x4EFC
-0x7430 = 0x50F4
-0x7431 = 0x51EC
-0x7432 = 0x5307
-0x7433 = 0x5324
-0x7434 = 0xFA0E
-0x7435 = 0x548A
-0x7436 = 0x5759
-0x7437 = 0xFA0F
-0x7438 = 0xFA10
-0x7439 = 0x589E
-0x743A = 0x5BEC
-0x743B = 0x5CF5
-0x743C = 0x5D53
-0x743D = 0xFA11
-0x743E = 0x5FB7
-0x743F = 0x6085
-0x7440 = 0x6120
-0x7441 = 0x654E
-0x7442 = 0x663B
-0x7443 = 0x6665
-0x7444 = 0xFA12
-0x7445 = 0xF929
-0x7446 = 0x6801
-0x7447 = 0xFA13
-0x7448 = 0xFA14
-0x7449 = 0x6A6B
-0x744A = 0x6AE2
-0x744B = 0x6DF8
-0x744C = 0x6DF2
-0x744D = 0x7028
-0x744E = 0xFA15
-0x744F = 0xFA16
-0x7450 = 0x7501
-0x7451 = 0x7682
-0x7452 = 0x769E
-0x7453 = 0xFA17
-0x7454 = 0x7930
-0x7455 = 0xFA18
-0x7456 = 0xFA19
-0x7457 = 0xFA1A
-0x7458 = 0xFA1B
-0x7459 = 0x7AE7
-0x745A = 0xFA1C
-0x745B = 0xFA1D
-0x745C = 0x7DA0
-0x745D = 0x7DD6
-0x745E = 0xFA1E
-0x745F = 0x8362
-0x7460 = 0xFA1F
-0x7461 = 0x85B0
-0x7462 = 0xFA20
-0x7463 = 0xFA21
-0x7464 = 0x8807
-0x7465 = 0xFA22
-0x7466 = 0x8B7F
-0x7467 = 0x8CF4
-0x7468 = 0x8D76
-0x7469 = 0xFA23
-0x746A = 0xFA24
-0x746B = 0xFA25
-0x746C = 0x90DE
-0x746D = 0xFA26
-0x746E = 0x9115
-0x746F = 0xFA27
-0x7470 = 0xFA28
-0x7471 = 0x9592
-0x7472 = 0xF9DC
-0x7473 = 0xFA29
-0x7474 = 0x973B
-0x7475 = 0x974D
-0x7476 = 0x9751
-0x7477 = 0xFA2A
-0x7478 = 0xFA2B
-0x7479 = 0xFA2C
-0x747A = 0x999E
-0x747B = 0x9AD9
-0x747C = 0x9B72
-0x747D = 0xFA2D
-0x747E = 0x9ED1
-END_MAP
diff --git a/enc/trans/JIS/UCS%JISX0201-KANA.src b/enc/trans/JIS/UCS%JISX0201-KANA.src
deleted file mode 100644
index 57ae00f23b..0000000000
--- a/enc/trans/JIS/UCS%JISX0201-KANA.src
+++ /dev/null
@@ -1,127 +0,0 @@
-# $NetBSD: UCS%JISX0201-KANA.src,v 1.5 2006/10/26 16:04:21 tnozaki Exp $
-
-TYPE ROWCOL
-NAME "UCS/JISX0201-KANA"
-SRC_ZONE 0xFF60 - 0xFF9F
-OOB_MODE INVALID
-DST_INVALID 0xFF
-DST_UNIT_BITS 8
-
-BEGIN_MAP
-#
-# This mapping data is made from the mapping data provided by Unicode, Inc.
-# Original notice:
-#
-# Name: JIS X 0201 (1976) to Unicode 1.1 Table
-# Unicode version: 1.1
-# Table version: 0.9
-# Table format: Format A
-# Date: 8 March 1994
-#
-# Copyright (c) 1991-1994 Unicode, Inc. All Rights reserved.
-#
-# This file is provided as-is by Unicode, Inc. (The Unicode Consortium).
-# No claims are made as to fitness for any particular purpose. No
-# warranties of any kind are expressed or implied. The recipient
-# agrees to determine applicability of information provided. If this
-# file has been provided on magnetic media by Unicode, Inc., the sole
-# remedy for any claim will be exchange of defective media within 90
-# days of receipt.
-#
-# Recipient is granted the right to make copies in any form for
-# internal distribution and to freely use the information supplied
-# in the creation of products supporting Unicode. Unicode, Inc.
-# specifically excludes the right to re-distribute this file directly
-# to third parties or other organizations whether for profit or not.
-#
-# General notes:
-#
-#
-# This table contains one set of mappings from JIS X 0201 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 JIS X 0201 and Unicode, consult the
-# VENDORS mapping data. Normative information on the mapping between
-# JIS X 0201 and Unicode may be found in the Unihan.txt file in the
-# latest Unicode Character Database.
-#
-# If you have carefully considered the fact that the mappings in
-# this table are only one possible set of mappings between JIS X 0201 and
-# Unicode and have no normative status, but still feel that you
-# have located an error in the table that requires fixing, you may
-# report any such error to errata@unicode.org.
-#
-#
-# Format: Three tab-separated columns
-# Column #1 is the shift JIS code (in hex as 0xXX)
-# Column #2 is the Unicode (in hex as 0xXXXX)
-# Column #3 the Unicode (ISO 10646) name (follows a comment sign)
-#
-# The entries are in JIS order
-#
-#
-0xFF61 = 0x21
-0xFF62 = 0x22
-0xFF63 = 0x23
-0xFF64 = 0x24
-0xFF65 = 0x25
-0xFF66 = 0x26
-0xFF67 = 0x27
-0xFF68 = 0x28
-0xFF69 = 0x29
-0xFF6A = 0x2A
-0xFF6B = 0x2B
-0xFF6C = 0x2C
-0xFF6D = 0x2D
-0xFF6E = 0x2E
-0xFF6F = 0x2F
-0xFF70 = 0x30
-0xFF71 = 0x31
-0xFF72 = 0x32
-0xFF73 = 0x33
-0xFF74 = 0x34
-0xFF75 = 0x35
-0xFF76 = 0x36
-0xFF77 = 0x37
-0xFF78 = 0x38
-0xFF79 = 0x39
-0xFF7A = 0x3A
-0xFF7B = 0x3B
-0xFF7C = 0x3C
-0xFF7D = 0x3D
-0xFF7E = 0x3E
-0xFF7F = 0x3F
-0xFF80 = 0x40
-0xFF81 = 0x41
-0xFF82 = 0x42
-0xFF83 = 0x43
-0xFF84 = 0x44
-0xFF85 = 0x45
-0xFF86 = 0x46
-0xFF87 = 0x47
-0xFF88 = 0x48
-0xFF89 = 0x49
-0xFF8A = 0x4A
-0xFF8B = 0x4B
-0xFF8C = 0x4C
-0xFF8D = 0x4D
-0xFF8E = 0x4E
-0xFF8F = 0x4F
-0xFF90 = 0x50
-0xFF91 = 0x51
-0xFF92 = 0x52
-0xFF93 = 0x53
-0xFF94 = 0x54
-0xFF95 = 0x55
-0xFF96 = 0x56
-0xFF97 = 0x57
-0xFF98 = 0x58
-0xFF99 = 0x59
-0xFF9A = 0x5A
-0xFF9B = 0x5B
-0xFF9C = 0x5C
-0xFF9D = 0x5D
-0xFF9E = 0x5E
-0xFF9F = 0x5F
-END_MAP
diff --git a/enc/trans/JIS/UCS%JISX0208@1990.src b/enc/trans/JIS/UCS%JISX0208@1990.src
deleted file mode 100644
index 977171ccda..0000000000
--- a/enc/trans/JIS/UCS%JISX0208@1990.src
+++ /dev/null
@@ -1,6974 +0,0 @@
-# $NetBSD: UCS%JISX0208@1990.src,v 1.7 2006/11/29 15:45:26 tnozaki Exp $
-
-TYPE ROWCOL
-NAME "UCS/JISX0208:1990"
-SRC_ZONE 0x005C - 0xFFE5
-OOB_MODE INVALID
-DST_INVALID 0xFFFF
-DST_UNIT_BITS 16
-
-BEGIN_MAP
-#
-# This mapping data is made from the mapping data provided by Unicode, Inc.
-# Original notice:
-#
-# Name: JIS X 0208 (1990) to Unicode
-# Unicode version: 1.1
-# Table version: 0.9
-# Table format: Format A
-# Date: 8 March 1994
-#
-# Copyright (c) 1991-1994 Unicode, Inc. All Rights reserved.
-#
-# This file is provided as-is by Unicode, Inc. (The Unicode Consortium).
-# No claims are made as to fitness for any particular purpose. No
-# warranties of any kind are expressed or implied. The recipient
-# agrees to determine applicability of information provided. If this
-# file has been provided on magnetic media by Unicode, Inc., the sole
-# remedy for any claim will be exchange of defective media within 90
-# days of receipt.
-#
-# Recipient is granted the right to make copies in any form for
-# internal distribution and to freely use the information supplied
-# in the creation of products supporting Unicode. Unicode, Inc.
-# specifically excludes the right to re-distribute this file directly
-# to third parties or other organizations whether for profit or not.
-#
-# General notes:
-#
-#
-# This table contains one set of mappings from JIS X 0208 (1990) 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 JIS X 0208 (1990) and Unicode, consult the
-# VENDORS mapping data. Normative information on the mapping between
-# JIS X 0208 (1990) and Unicode may be found in the Unihan.txt file in the
-# latest Unicode Character Database.
-#
-# If you have carefully considered the fact that the mappings in
-# this table are only one possible set of mappings between JIS X 0208 (1990)
-# and Unicode and have no normative status, but still feel that you
-# have located an error in the table that requires fixing, you may
-# report any such error to errata@unicode.org.
-#
-#
-# Format: Four tab-separated columns
-# Column #1 is the shift-JIS code (in hex)
-# Column #2 is the JIS X 0208 code (in hex as 0xXXXX)
-# Column #3 is the Unicode (in hex as 0xXXXX)
-# Column #4 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 JIS X 0208 order
-#
-# The following algorithms can be used to change the hex form
-# of JIS 0208 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;
-# 0x7426 -> 0x5406 -> 8406
-#
-# The kanji mappings are a normative part of ISO/IEC 10646. The
-# non-kanji mappings are provisional, pending definition of
-# official mappings by Japanese standards bodies
-#
-# Any comments or problems, contact <John_Jenkins@taligent.com>
-#
-#
-# NetBSD specific modification:
-# 2003-08-18 : add U+FF3C -> 0x2140 conversion.
-# see UCS%JISX0208@1990.src.
-#
-# Ruby specific modification:
-# 2008-08-31 : remove U+005C -> 0x2140 conversion.
-#
-0x00A2 = 0x2171
-0x00A3 = 0x2172
-0x00A7 = 0x2178
-0x00A8 = 0x212F
-0x00AC = 0x224C
-0x00B0 = 0x216B
-0x00B1 = 0x215E
-0x00B4 = 0x212D
-0x00B6 = 0x2279
-0x00D7 = 0x215F
-0x00F7 = 0x2160
-0x0391 = 0x2621
-0x0392 = 0x2622
-0x0393 = 0x2623
-0x0394 = 0x2624
-0x0395 = 0x2625
-0x0396 = 0x2626
-0x0397 = 0x2627
-0x0398 = 0x2628
-0x0399 = 0x2629
-0x039A = 0x262A
-0x039B = 0x262B
-0x039C = 0x262C
-0x039D = 0x262D
-0x039E = 0x262E
-0x039F = 0x262F
-0x03A0 = 0x2630
-0x03A1 = 0x2631
-0x03A3 = 0x2632
-0x03A4 = 0x2633
-0x03A5 = 0x2634
-0x03A6 = 0x2635
-0x03A7 = 0x2636
-0x03A8 = 0x2637
-0x03A9 = 0x2638
-0x03B1 = 0x2641
-0x03B2 = 0x2642
-0x03B3 = 0x2643
-0x03B4 = 0x2644
-0x03B5 = 0x2645
-0x03B6 = 0x2646
-0x03B7 = 0x2647
-0x03B8 = 0x2648
-0x03B9 = 0x2649
-0x03BA = 0x264A
-0x03BB = 0x264B
-0x03BC = 0x264C
-0x03BD = 0x264D
-0x03BE = 0x264E
-0x03BF = 0x264F
-0x03C0 = 0x2650
-0x03C1 = 0x2651
-0x03C3 = 0x2652
-0x03C4 = 0x2653
-0x03C5 = 0x2654
-0x03C6 = 0x2655
-0x03C7 = 0x2656
-0x03C8 = 0x2657
-0x03C9 = 0x2658
-0x0401 = 0x2727
-0x0410 = 0x2721
-0x0411 = 0x2722
-0x0412 = 0x2723
-0x0413 = 0x2724
-0x0414 = 0x2725
-0x0415 = 0x2726
-0x0416 = 0x2728
-0x0417 = 0x2729
-0x0418 = 0x272A
-0x0419 = 0x272B
-0x041A = 0x272C
-0x041B = 0x272D
-0x041C = 0x272E
-0x041D = 0x272F
-0x041E = 0x2730
-0x041F = 0x2731
-0x0420 = 0x2732
-0x0421 = 0x2733
-0x0422 = 0x2734
-0x0423 = 0x2735
-0x0424 = 0x2736
-0x0425 = 0x2737
-0x0426 = 0x2738
-0x0427 = 0x2739
-0x0428 = 0x273A
-0x0429 = 0x273B
-0x042A = 0x273C
-0x042B = 0x273D
-0x042C = 0x273E
-0x042D = 0x273F
-0x042E = 0x2740
-0x042F = 0x2741
-0x0430 = 0x2751
-0x0431 = 0x2752
-0x0432 = 0x2753
-0x0433 = 0x2754
-0x0434 = 0x2755
-0x0435 = 0x2756
-0x0436 = 0x2758
-0x0437 = 0x2759
-0x0438 = 0x275A
-0x0439 = 0x275B
-0x043A = 0x275C
-0x043B = 0x275D
-0x043C = 0x275E
-0x043D = 0x275F
-0x043E = 0x2760
-0x043F = 0x2761
-0x0440 = 0x2762
-0x0441 = 0x2763
-0x0442 = 0x2764
-0x0443 = 0x2765
-0x0444 = 0x2766
-0x0445 = 0x2767
-0x0446 = 0x2768
-0x0447 = 0x2769
-0x0448 = 0x276A
-0x0449 = 0x276B
-0x044A = 0x276C
-0x044B = 0x276D
-0x044C = 0x276E
-0x044D = 0x276F
-0x044E = 0x2770
-0x044F = 0x2771
-0x0451 = 0x2757
-0x2010 = 0x213E
-0x2014 = 0x213D
-0x2015 = 0x213D
-0x2016 = 0x2142
-0x2018 = 0x2146
-0x2019 = 0x2147
-0x201C = 0x2148
-0x201D = 0x2149
-0x2020 = 0x2277
-0x2021 = 0x2278
-0x2025 = 0x2145
-0x2026 = 0x2144
-0x2030 = 0x2273
-0x2032 = 0x216C
-0x2033 = 0x216D
-0x203B = 0x2228
-0x2103 = 0x216E
-0x212B = 0x2272
-0x2190 = 0x222B
-0x2191 = 0x222C
-0x2192 = 0x222A
-0x2193 = 0x222D
-0x21D2 = 0x224D
-0x21D4 = 0x224E
-0x2200 = 0x224F
-0x2202 = 0x225F
-0x2203 = 0x2250
-0x2207 = 0x2260
-0x2208 = 0x223A
-0x220B = 0x223B
-0x2212 = 0x215D
-0x221A = 0x2265
-0x221D = 0x2267
-0x221E = 0x2167
-0x2220 = 0x225C
-0x2227 = 0x224A
-0x2228 = 0x224B
-0x2229 = 0x2241
-0x222A = 0x2240
-0x222B = 0x2269
-0x222C = 0x226A
-0x2234 = 0x2168
-0x2235 = 0x2268
-0x223D = 0x2266
-0x2252 = 0x2262
-0x2260 = 0x2162
-0x2261 = 0x2261
-0x2266 = 0x2165
-0x2267 = 0x2166
-0x226A = 0x2263
-0x226B = 0x2264
-0x2282 = 0x223E
-0x2283 = 0x223F
-0x2286 = 0x223C
-0x2287 = 0x223D
-0x22A5 = 0x225D
-0x2312 = 0x225E
-0x2500 = 0x2821
-0x2501 = 0x282C
-0x2502 = 0x2822
-0x2503 = 0x282D
-0x250C = 0x2823
-0x250F = 0x282E
-0x2510 = 0x2824
-0x2513 = 0x282F
-0x2514 = 0x2826
-0x2517 = 0x2831
-0x2518 = 0x2825
-0x251B = 0x2830
-0x251C = 0x2827
-0x251D = 0x283C
-0x2520 = 0x2837
-0x2523 = 0x2832
-0x2524 = 0x2829
-0x2525 = 0x283E
-0x2528 = 0x2839
-0x252B = 0x2834
-0x252C = 0x2828
-0x252F = 0x2838
-0x2530 = 0x283D
-0x2533 = 0x2833
-0x2534 = 0x282A
-0x2537 = 0x283A
-0x2538 = 0x283F
-0x253B = 0x2835
-0x253C = 0x282B
-0x253F = 0x283B
-0x2542 = 0x2840
-0x254B = 0x2836
-0x25A0 = 0x2223
-0x25A1 = 0x2222
-0x25B2 = 0x2225
-0x25B3 = 0x2224
-0x25BC = 0x2227
-0x25BD = 0x2226
-0x25C6 = 0x2221
-0x25C7 = 0x217E
-0x25CB = 0x217B
-0x25CE = 0x217D
-0x25CF = 0x217C
-0x25EF = 0x227E
-0x2605 = 0x217A
-0x2606 = 0x2179
-0x2640 = 0x216A
-0x2642 = 0x2169
-0x266A = 0x2276
-0x266D = 0x2275
-0x266F = 0x2274
-0x3000 = 0x2121
-0x3001 = 0x2122
-0x3002 = 0x2123
-0x3003 = 0x2137
-0x3005 = 0x2139
-0x3006 = 0x213A
-0x3007 = 0x213B
-0x3008 = 0x2152
-0x3009 = 0x2153
-0x300A = 0x2154
-0x300B = 0x2155
-0x300C = 0x2156
-0x300D = 0x2157
-0x300E = 0x2158
-0x300F = 0x2159
-0x3010 = 0x215A
-0x3011 = 0x215B
-0x3012 = 0x2229
-0x3013 = 0x222E
-0x3014 = 0x214C
-0x3015 = 0x214D
-0x301C = 0x2141
-0x3041 = 0x2421
-0x3042 = 0x2422
-0x3043 = 0x2423
-0x3044 = 0x2424
-0x3045 = 0x2425
-0x3046 = 0x2426
-0x3047 = 0x2427
-0x3048 = 0x2428
-0x3049 = 0x2429
-0x304A = 0x242A
-0x304B = 0x242B
-0x304C = 0x242C
-0x304D = 0x242D
-0x304E = 0x242E
-0x304F = 0x242F
-0x3050 = 0x2430
-0x3051 = 0x2431
-0x3052 = 0x2432
-0x3053 = 0x2433
-0x3054 = 0x2434
-0x3055 = 0x2435
-0x3056 = 0x2436
-0x3057 = 0x2437
-0x3058 = 0x2438
-0x3059 = 0x2439
-0x305A = 0x243A
-0x305B = 0x243B
-0x305C = 0x243C
-0x305D = 0x243D
-0x305E = 0x243E
-0x305F = 0x243F
-0x3060 = 0x2440
-0x3061 = 0x2441
-0x3062 = 0x2442
-0x3063 = 0x2443
-0x3064 = 0x2444
-0x3065 = 0x2445
-0x3066 = 0x2446
-0x3067 = 0x2447
-0x3068 = 0x2448
-0x3069 = 0x2449
-0x306A = 0x244A
-0x306B = 0x244B
-0x306C = 0x244C
-0x306D = 0x244D
-0x306E = 0x244E
-0x306F = 0x244F
-0x3070 = 0x2450
-0x3071 = 0x2451
-0x3072 = 0x2452
-0x3073 = 0x2453
-0x3074 = 0x2454
-0x3075 = 0x2455
-0x3076 = 0x2456
-0x3077 = 0x2457
-0x3078 = 0x2458
-0x3079 = 0x2459
-0x307A = 0x245A
-0x307B = 0x245B
-0x307C = 0x245C
-0x307D = 0x245D
-0x307E = 0x245E
-0x307F = 0x245F
-0x3080 = 0x2460
-0x3081 = 0x2461
-0x3082 = 0x2462
-0x3083 = 0x2463
-0x3084 = 0x2464
-0x3085 = 0x2465
-0x3086 = 0x2466
-0x3087 = 0x2467
-0x3088 = 0x2468
-0x3089 = 0x2469
-0x308A = 0x246A
-0x308B = 0x246B
-0x308C = 0x246C
-0x308D = 0x246D
-0x308E = 0x246E
-0x308F = 0x246F
-0x3090 = 0x2470
-0x3091 = 0x2471
-0x3092 = 0x2472
-0x3093 = 0x2473
-0x309B = 0x212B
-0x309C = 0x212C
-0x309D = 0x2135
-0x309E = 0x2136
-0x30A1 = 0x2521
-0x30A2 = 0x2522
-0x30A3 = 0x2523
-0x30A4 = 0x2524
-0x30A5 = 0x2525
-0x30A6 = 0x2526
-0x30A7 = 0x2527
-0x30A8 = 0x2528
-0x30A9 = 0x2529
-0x30AA = 0x252A
-0x30AB = 0x252B
-0x30AC = 0x252C
-0x30AD = 0x252D
-0x30AE = 0x252E
-0x30AF = 0x252F
-0x30B0 = 0x2530
-0x30B1 = 0x2531
-0x30B2 = 0x2532
-0x30B3 = 0x2533
-0x30B4 = 0x2534
-0x30B5 = 0x2535
-0x30B6 = 0x2536
-0x30B7 = 0x2537
-0x30B8 = 0x2538
-0x30B9 = 0x2539
-0x30BA = 0x253A
-0x30BB = 0x253B
-0x30BC = 0x253C
-0x30BD = 0x253D
-0x30BE = 0x253E
-0x30BF = 0x253F
-0x30C0 = 0x2540
-0x30C1 = 0x2541
-0x30C2 = 0x2542
-0x30C3 = 0x2543
-0x30C4 = 0x2544
-0x30C5 = 0x2545
-0x30C6 = 0x2546
-0x30C7 = 0x2547
-0x30C8 = 0x2548
-0x30C9 = 0x2549
-0x30CA = 0x254A
-0x30CB = 0x254B
-0x30CC = 0x254C
-0x30CD = 0x254D
-0x30CE = 0x254E
-0x30CF = 0x254F
-0x30D0 = 0x2550
-0x30D1 = 0x2551
-0x30D2 = 0x2552
-0x30D3 = 0x2553
-0x30D4 = 0x2554
-0x30D5 = 0x2555
-0x30D6 = 0x2556
-0x30D7 = 0x2557
-0x30D8 = 0x2558
-0x30D9 = 0x2559
-0x30DA = 0x255A
-0x30DB = 0x255B
-0x30DC = 0x255C
-0x30DD = 0x255D
-0x30DE = 0x255E
-0x30DF = 0x255F
-0x30E0 = 0x2560
-0x30E1 = 0x2561
-0x30E2 = 0x2562
-0x30E3 = 0x2563
-0x30E4 = 0x2564
-0x30E5 = 0x2565
-0x30E6 = 0x2566
-0x30E7 = 0x2567
-0x30E8 = 0x2568
-0x30E9 = 0x2569
-0x30EA = 0x256A
-0x30EB = 0x256B
-0x30EC = 0x256C
-0x30ED = 0x256D
-0x30EE = 0x256E
-0x30EF = 0x256F
-0x30F0 = 0x2570
-0x30F1 = 0x2571
-0x30F2 = 0x2572
-0x30F3 = 0x2573
-0x30F4 = 0x2574
-0x30F5 = 0x2575
-0x30F6 = 0x2576
-0x30FB = 0x2126
-0x30FC = 0x213C
-0x30FD = 0x2133
-0x30FE = 0x2134
-0x4E00 = 0x306C
-0x4E01 = 0x437A
-0x4E03 = 0x3C37
-0x4E07 = 0x4B7C
-0x4E08 = 0x3E66
-0x4E09 = 0x3B30
-0x4E0A = 0x3E65
-0x4E0B = 0x323C
-0x4E0D = 0x4954
-0x4E0E = 0x4D3F
-0x4E10 = 0x5022
-0x4E11 = 0x312F
-0x4E14 = 0x336E
-0x4E15 = 0x5023
-0x4E16 = 0x4024
-0x4E17 = 0x5242
-0x4E18 = 0x3556
-0x4E19 = 0x4A3A
-0x4E1E = 0x3E67
-0x4E21 = 0x4E3E
-0x4E26 = 0x4A42
-0x4E2A = 0x5024
-0x4E2D = 0x4366
-0x4E31 = 0x5025
-0x4E32 = 0x367A
-0x4E36 = 0x5026
-0x4E38 = 0x345D
-0x4E39 = 0x4330
-0x4E3B = 0x3C67
-0x4E3C = 0x5027
-0x4E3F = 0x5028
-0x4E42 = 0x5029
-0x4E43 = 0x4735
-0x4E45 = 0x3557
-0x4E4B = 0x4737
-0x4E4D = 0x4663
-0x4E4E = 0x3843
-0x4E4F = 0x4B33
-0x4E55 = 0x6949
-0x4E56 = 0x502A
-0x4E57 = 0x3E68
-0x4E58 = 0x502B
-0x4E59 = 0x3235
-0x4E5D = 0x3665
-0x4E5E = 0x3870
-0x4E5F = 0x4C69
-0x4E62 = 0x5626
-0x4E71 = 0x4D70
-0x4E73 = 0x467D
-0x4E7E = 0x3425
-0x4E80 = 0x3535
-0x4E82 = 0x502C
-0x4E85 = 0x502D
-0x4E86 = 0x4E3B
-0x4E88 = 0x4D3D
-0x4E89 = 0x4168
-0x4E8A = 0x502F
-0x4E8B = 0x3B76
-0x4E8C = 0x4673
-0x4E8E = 0x5032
-0x4E91 = 0x313E
-0x4E92 = 0x385F
-0x4E94 = 0x385E
-0x4E95 = 0x3066
-0x4E98 = 0x4F4B
-0x4E99 = 0x4F4A
-0x4E9B = 0x3A33
-0x4E9C = 0x3021
-0x4E9E = 0x5033
-0x4E9F = 0x5034
-0x4EA0 = 0x5035
-0x4EA1 = 0x4B34
-0x4EA2 = 0x5036
-0x4EA4 = 0x3872
-0x4EA5 = 0x3067
-0x4EA6 = 0x4B72
-0x4EA8 = 0x357C
-0x4EAB = 0x357D
-0x4EAC = 0x357E
-0x4EAD = 0x4462
-0x4EAE = 0x4E3C
-0x4EB0 = 0x5037
-0x4EB3 = 0x5038
-0x4EB6 = 0x5039
-0x4EBA = 0x3F4D
-0x4EC0 = 0x3D3A
-0x4EC1 = 0x3F4E
-0x4EC2 = 0x503E
-0x4EC4 = 0x503C
-0x4EC6 = 0x503D
-0x4EC7 = 0x3558
-0x4ECA = 0x3A23
-0x4ECB = 0x3270
-0x4ECD = 0x503B
-0x4ECE = 0x503A
-0x4ECF = 0x4A29
-0x4ED4 = 0x3B46
-0x4ED5 = 0x3B45
-0x4ED6 = 0x423E
-0x4ED7 = 0x503F
-0x4ED8 = 0x4955
-0x4ED9 = 0x4067
-0x4EDD = 0x2138
-0x4EDE = 0x5040
-0x4EDF = 0x5042
-0x4EE3 = 0x4265
-0x4EE4 = 0x4E61
-0x4EE5 = 0x304A
-0x4EED = 0x5041
-0x4EEE = 0x323E
-0x4EF0 = 0x3644
-0x4EF2 = 0x4367
-0x4EF6 = 0x376F
-0x4EF7 = 0x5043
-0x4EFB = 0x4724
-0x4F01 = 0x346B
-0x4F09 = 0x5044
-0x4F0A = 0x304B
-0x4F0D = 0x3860
-0x4F0E = 0x346C
-0x4F0F = 0x497A
-0x4F10 = 0x4832
-0x4F11 = 0x3559
-0x4F1A = 0x3271
-0x4F1C = 0x5067
-0x4F1D = 0x4541
-0x4F2F = 0x476C
-0x4F30 = 0x5046
-0x4F34 = 0x483C
-0x4F36 = 0x4E62
-0x4F38 = 0x3F2D
-0x4F3A = 0x3B47
-0x4F3C = 0x3B77
-0x4F3D = 0x3240
-0x4F43 = 0x4451
-0x4F46 = 0x4322
-0x4F47 = 0x504A
-0x4F4D = 0x304C
-0x4F4E = 0x4463
-0x4F4F = 0x3D3B
-0x4F50 = 0x3A34
-0x4F51 = 0x4D24
-0x4F53 = 0x424E
-0x4F55 = 0x323F
-0x4F57 = 0x5049
-0x4F59 = 0x4D3E
-0x4F5A = 0x5045
-0x4F5B = 0x5047
-0x4F5C = 0x3A6E
-0x4F5D = 0x5048
-0x4F5E = 0x5524
-0x4F69 = 0x5050
-0x4F6F = 0x5053
-0x4F70 = 0x5051
-0x4F73 = 0x3242
-0x4F75 = 0x4A3B
-0x4F76 = 0x504B
-0x4F7B = 0x504F
-0x4F7C = 0x3873
-0x4F7F = 0x3B48
-0x4F83 = 0x3426
-0x4F86 = 0x5054
-0x4F88 = 0x504C
-0x4F8B = 0x4E63
-0x4F8D = 0x3B78
-0x4F8F = 0x504D
-0x4F91 = 0x5052
-0x4F96 = 0x5055
-0x4F98 = 0x504E
-0x4F9B = 0x3621
-0x4F9D = 0x304D
-0x4FA0 = 0x3622
-0x4FA1 = 0x3241
-0x4FAB = 0x5525
-0x4FAD = 0x4B79
-0x4FAE = 0x496E
-0x4FAF = 0x3874
-0x4FB5 = 0x3F2F
-0x4FB6 = 0x4E37
-0x4FBF = 0x4A58
-0x4FC2 = 0x3738
-0x4FC3 = 0x4225
-0x4FC4 = 0x3264
-0x4FCA = 0x3D53
-0x4FCE = 0x5059
-0x4FD0 = 0x505E
-0x4FD1 = 0x505C
-0x4FD4 = 0x5057
-0x4FD7 = 0x422F
-0x4FD8 = 0x505A
-0x4FDA = 0x505D
-0x4FDB = 0x505B
-0x4FDD = 0x4A5D
-0x4FDF = 0x5058
-0x4FE1 = 0x3F2E
-0x4FE3 = 0x4B73
-0x4FE4 = 0x505F
-0x4FE5 = 0x5060
-0x4FEE = 0x3D24
-0x4FEF = 0x506D
-0x4FF3 = 0x4750
-0x4FF5 = 0x4936
-0x4FF6 = 0x5068
-0x4FF8 = 0x4A70
-0x4FFA = 0x3236
-0x4FFE = 0x506C
-0x5005 = 0x5066
-0x5006 = 0x506F
-0x5009 = 0x4152
-0x500B = 0x3844
-0x500D = 0x475C
-0x500F = 0x6047
-0x5011 = 0x506E
-0x5012 = 0x455D
-0x5014 = 0x5063
-0x5016 = 0x3876
-0x5019 = 0x3875
-0x501A = 0x5061
-0x501F = 0x3C5A
-0x5021 = 0x5069
-0x5023 = 0x4A6F
-0x5024 = 0x434D
-0x5025 = 0x5065
-0x5026 = 0x3771
-0x5028 = 0x5062
-0x5029 = 0x506A
-0x502A = 0x5064
-0x502B = 0x4E51
-0x502C = 0x506B
-0x502D = 0x4F41
-0x5036 = 0x3666
-0x5039 = 0x3770
-0x5043 = 0x5070
-0x5047 = 0x5071
-0x5048 = 0x5075
-0x5049 = 0x304E
-0x504F = 0x4A50
-0x5050 = 0x5074
-0x5055 = 0x5073
-0x5056 = 0x5077
-0x505A = 0x5076
-0x505C = 0x4464
-0x5065 = 0x3772
-0x506C = 0x5078
-0x5072 = 0x3C45
-0x5074 = 0x4226
-0x5075 = 0x4465
-0x5076 = 0x3676
-0x5078 = 0x5079
-0x507D = 0x3536
-0x5080 = 0x507A
-0x5085 = 0x507C
-0x508D = 0x4B35
-0x5091 = 0x3766
-0x5098 = 0x3B31
-0x5099 = 0x4877
-0x509A = 0x507B
-0x50AC = 0x3A45
-0x50AD = 0x4D43
-0x50B2 = 0x507E
-0x50B3 = 0x5123
-0x50B4 = 0x507D
-0x50B5 = 0x3A44
-0x50B7 = 0x3D7D
-0x50BE = 0x3739
-0x50C2 = 0x5124
-0x50C5 = 0x364F
-0x50C9 = 0x5121
-0x50CA = 0x5122
-0x50CD = 0x462F
-0x50CF = 0x417C
-0x50D1 = 0x3623
-0x50D5 = 0x4B4D
-0x50D6 = 0x5125
-0x50DA = 0x4E3D
-0x50DE = 0x5126
-0x50E3 = 0x5129
-0x50E5 = 0x5127
-0x50E7 = 0x414E
-0x50ED = 0x5128
-0x50EE = 0x512A
-0x50F5 = 0x512C
-0x50F9 = 0x512B
-0x50FB = 0x4A48
-0x5100 = 0x3537
-0x5101 = 0x512E
-0x5102 = 0x512F
-0x5104 = 0x322F
-0x5109 = 0x512D
-0x5112 = 0x3C74
-0x5114 = 0x5132
-0x5115 = 0x5131
-0x5116 = 0x5130
-0x5118 = 0x5056
-0x511A = 0x5133
-0x511F = 0x3D7E
-0x5121 = 0x5134
-0x512A = 0x4D25
-0x5132 = 0x4C59
-0x5137 = 0x5136
-0x513A = 0x5135
-0x513B = 0x5138
-0x513C = 0x5137
-0x513F = 0x5139
-0x5140 = 0x513A
-0x5141 = 0x3074
-0x5143 = 0x3835
-0x5144 = 0x373B
-0x5145 = 0x3D3C
-0x5146 = 0x437B
-0x5147 = 0x3624
-0x5148 = 0x4068
-0x5149 = 0x3877
-0x514B = 0x396E
-0x514C = 0x513C
-0x514D = 0x4C48
-0x514E = 0x4546
-0x5150 = 0x3B79
-0x5152 = 0x513B
-0x5154 = 0x513D
-0x515A = 0x455E
-0x515C = 0x3375
-0x5162 = 0x513E
-0x5165 = 0x467E
-0x5168 = 0x4134
-0x5169 = 0x5140
-0x516A = 0x5141
-0x516B = 0x482C
-0x516C = 0x3878
-0x516D = 0x4F3B
-0x516E = 0x5142
-0x5171 = 0x3626
-0x5175 = 0x4A3C
-0x5176 = 0x4236
-0x5177 = 0x3671
-0x5178 = 0x4535
-0x517C = 0x3773
-0x5180 = 0x5143
-0x5182 = 0x5144
-0x5185 = 0x4662
-0x5186 = 0x315F
-0x5189 = 0x5147
-0x518A = 0x3A7D
-0x518C = 0x5146
-0x518D = 0x3A46
-0x518F = 0x5148
-0x5190 = 0x666E
-0x5191 = 0x5149
-0x5192 = 0x4B41
-0x5193 = 0x514A
-0x5195 = 0x514B
-0x5196 = 0x514C
-0x5197 = 0x3E69
-0x5199 = 0x3C4C
-0x51A0 = 0x3427
-0x51A2 = 0x514F
-0x51A4 = 0x514D
-0x51A5 = 0x4C3D
-0x51A6 = 0x514E
-0x51A8 = 0x495A
-0x51A9 = 0x5150
-0x51AA = 0x5151
-0x51AB = 0x5152
-0x51AC = 0x455F
-0x51B0 = 0x5156
-0x51B1 = 0x5154
-0x51B2 = 0x5155
-0x51B3 = 0x5153
-0x51B4 = 0x3A63
-0x51B5 = 0x5157
-0x51B6 = 0x4C6A
-0x51B7 = 0x4E64
-0x51BD = 0x5158
-0x51C4 = 0x4028
-0x51C5 = 0x5159
-0x51C6 = 0x3D5A
-0x51C9 = 0x515A
-0x51CB = 0x437C
-0x51CC = 0x4E3F
-0x51CD = 0x4560
-0x51D6 = 0x5245
-0x51DB = 0x515B
-0x51DC = 0x7425
-0x51DD = 0x3645
-0x51E0 = 0x515C
-0x51E1 = 0x4B5E
-0x51E6 = 0x3D68
-0x51E7 = 0x427C
-0x51E9 = 0x515E
-0x51EA = 0x4664
-0x51ED = 0x515F
-0x51F0 = 0x5160
-0x51F1 = 0x332E
-0x51F5 = 0x5161
-0x51F6 = 0x3627
-0x51F8 = 0x464C
-0x51F9 = 0x317A
-0x51FA = 0x3D50
-0x51FD = 0x4821
-0x51FE = 0x5162
-0x5200 = 0x4561
-0x5203 = 0x3F4F
-0x5204 = 0x5163
-0x5206 = 0x4A2C
-0x5207 = 0x405A
-0x5208 = 0x3422
-0x520A = 0x3429
-0x520B = 0x5164
-0x520E = 0x5166
-0x5211 = 0x373A
-0x5214 = 0x5165
-0x5217 = 0x4E73
-0x521D = 0x3D69
-0x5224 = 0x483D
-0x5225 = 0x4A4C
-0x5227 = 0x5167
-0x5229 = 0x4D78
-0x522A = 0x5168
-0x522E = 0x5169
-0x5230 = 0x457E
-0x5233 = 0x516A
-0x5236 = 0x4029
-0x5237 = 0x3A7E
-0x5238 = 0x3774
-0x5239 = 0x516B
-0x523A = 0x3B49
-0x523B = 0x396F
-0x5243 = 0x4466
-0x5244 = 0x516D
-0x5247 = 0x4227
-0x524A = 0x3A6F
-0x524B = 0x516E
-0x524C = 0x516F
-0x524D = 0x4130
-0x524F = 0x516C
-0x5254 = 0x5171
-0x5256 = 0x4B36
-0x525B = 0x3964
-0x525E = 0x5170
-0x5263 = 0x3775
-0x5264 = 0x3A5E
-0x5265 = 0x476D
-0x5269 = 0x5174
-0x526A = 0x5172
-0x526F = 0x497B
-0x5270 = 0x3E6A
-0x5271 = 0x517B
-0x5272 = 0x3364
-0x5273 = 0x5175
-0x5274 = 0x5173
-0x5275 = 0x414F
-0x527D = 0x5177
-0x527F = 0x5176
-0x5283 = 0x3344
-0x5287 = 0x3760
-0x5288 = 0x517C
-0x5289 = 0x4E2D
-0x528D = 0x5178
-0x5291 = 0x517D
-0x5292 = 0x517A
-0x5294 = 0x5179
-0x529B = 0x4E4F
-0x529F = 0x3879
-0x52A0 = 0x3243
-0x52A3 = 0x4E74
-0x52A9 = 0x3D75
-0x52AA = 0x4558
-0x52AB = 0x3965
-0x52AC = 0x5222
-0x52AD = 0x5223
-0x52B1 = 0x4E65
-0x52B4 = 0x4F2B
-0x52B5 = 0x5225
-0x52B9 = 0x387A
-0x52BC = 0x5224
-0x52BE = 0x332F
-0x52C1 = 0x5226
-0x52C3 = 0x4B56
-0x52C5 = 0x443C
-0x52C7 = 0x4D26
-0x52C9 = 0x4A59
-0x52CD = 0x5227
-0x52D2 = 0x7055
-0x52D5 = 0x4630
-0x52D7 = 0x5228
-0x52D8 = 0x342A
-0x52D9 = 0x4C33
-0x52DD = 0x3E21
-0x52DE = 0x5229
-0x52DF = 0x4A67
-0x52E0 = 0x522D
-0x52E2 = 0x402A
-0x52E3 = 0x522A
-0x52E4 = 0x3650
-0x52E6 = 0x522B
-0x52E7 = 0x342B
-0x52F2 = 0x372E
-0x52F3 = 0x522E
-0x52F5 = 0x522F
-0x52F8 = 0x5230
-0x52F9 = 0x5231
-0x52FA = 0x3C5B
-0x52FE = 0x387B
-0x52FF = 0x4C5E
-0x5301 = 0x4C68
-0x5302 = 0x4677
-0x5305 = 0x4A71
-0x5306 = 0x5232
-0x5308 = 0x5233
-0x530D = 0x5235
-0x530F = 0x5237
-0x5310 = 0x5236
-0x5315 = 0x5238
-0x5316 = 0x323D
-0x5317 = 0x4B4C
-0x5319 = 0x3A7C
-0x531A = 0x5239
-0x531D = 0x4159
-0x5320 = 0x3E22
-0x5321 = 0x3629
-0x5323 = 0x523A
-0x532A = 0x485B
-0x532F = 0x523B
-0x5331 = 0x523C
-0x5333 = 0x523D
-0x5338 = 0x523E
-0x5339 = 0x4924
-0x533A = 0x3668
-0x533B = 0x3065
-0x533F = 0x463F
-0x5340 = 0x523F
-0x5341 = 0x3D3D
-0x5343 = 0x4069
-0x5345 = 0x5241
-0x5346 = 0x5240
-0x5347 = 0x3E23
-0x5348 = 0x3861
-0x5349 = 0x5243
-0x534A = 0x483E
-0x534D = 0x5244
-0x5351 = 0x485C
-0x5352 = 0x4234
-0x5353 = 0x426E
-0x5354 = 0x3628
-0x5357 = 0x466E
-0x5358 = 0x4331
-0x535A = 0x476E
-0x535C = 0x4B4E
-0x535E = 0x5246
-0x5360 = 0x406A
-0x5366 = 0x3735
-0x5369 = 0x5247
-0x536E = 0x5248
-0x536F = 0x312C
-0x5370 = 0x3075
-0x5371 = 0x346D
-0x5373 = 0x4228
-0x5374 = 0x3551
-0x5375 = 0x4D71
-0x5377 = 0x524B
-0x5378 = 0x3237
-0x537B = 0x524A
-0x537F = 0x362A
-0x5382 = 0x524C
-0x5384 = 0x4C71
-0x5396 = 0x524D
-0x5398 = 0x4E52
-0x539A = 0x387C
-0x539F = 0x3836
-0x53A0 = 0x524E
-0x53A5 = 0x5250
-0x53A6 = 0x524F
-0x53A8 = 0x3F5F
-0x53A9 = 0x3139
-0x53AD = 0x315E
-0x53AE = 0x5251
-0x53B0 = 0x5252
-0x53B3 = 0x3837
-0x53B6 = 0x5253
-0x53BB = 0x356E
-0x53C2 = 0x3B32
-0x53C3 = 0x5254
-0x53C8 = 0x4B74
-0x53C9 = 0x3A35
-0x53CA = 0x355A
-0x53CB = 0x4D27
-0x53CC = 0x4150
-0x53CD = 0x483F
-0x53CE = 0x3C7D
-0x53D4 = 0x3D47
-0x53D6 = 0x3C68
-0x53D7 = 0x3C75
-0x53D9 = 0x3D76
-0x53DB = 0x4840
-0x53DF = 0x5257
-0x53E1 = 0x3143
-0x53E2 = 0x4151
-0x53E3 = 0x387D
-0x53E4 = 0x3845
-0x53E5 = 0x3667
-0x53E8 = 0x525B
-0x53E9 = 0x4321
-0x53EA = 0x427E
-0x53EB = 0x362B
-0x53EC = 0x3E24
-0x53ED = 0x525C
-0x53EE = 0x525A
-0x53EF = 0x3244
-0x53F0 = 0x4266
-0x53F1 = 0x3C38
-0x53F2 = 0x3B4B
-0x53F3 = 0x3126
-0x53F6 = 0x3370
-0x53F7 = 0x3966
-0x53F8 = 0x3B4A
-0x53FA = 0x525D
-0x5401 = 0x525E
-0x5403 = 0x3549
-0x5404 = 0x3346
-0x5408 = 0x3967
-0x5409 = 0x3548
-0x540A = 0x445F
-0x540B = 0x3125
-0x540C = 0x4631
-0x540D = 0x4C3E
-0x540E = 0x3921
-0x540F = 0x4D79
-0x5410 = 0x4547
-0x5411 = 0x387E
-0x541B = 0x372F
-0x541D = 0x5267
-0x541F = 0x3663
-0x5420 = 0x4B4A
-0x5426 = 0x485D
-0x5429 = 0x5266
-0x542B = 0x345E
-0x542C = 0x5261
-0x542D = 0x5262
-0x542E = 0x5264
-0x5436 = 0x5265
-0x5438 = 0x355B
-0x5439 = 0x3F61
-0x543B = 0x4A2D
-0x543C = 0x5263
-0x543D = 0x525F
-0x543E = 0x3863
-0x5440 = 0x5260
-0x5442 = 0x4F24
-0x5446 = 0x4A72
-0x5448 = 0x4468
-0x5449 = 0x3862
-0x544A = 0x3970
-0x544E = 0x5268
-0x5451 = 0x465D
-0x545F = 0x526C
-0x5468 = 0x3C7E
-0x546A = 0x3C76
-0x5470 = 0x526F
-0x5471 = 0x526D
-0x5473 = 0x4C23
-0x5475 = 0x526A
-0x5476 = 0x5273
-0x5477 = 0x526E
-0x547B = 0x5271
-0x547C = 0x3846
-0x547D = 0x4C3F
-0x5480 = 0x5272
-0x5484 = 0x5274
-0x5486 = 0x5276
-0x548B = 0x3A70
-0x548C = 0x4F42
-0x548E = 0x526B
-0x548F = 0x5269
-0x5490 = 0x5275
-0x5492 = 0x5270
-0x54A2 = 0x5278
-0x54A4 = 0x5323
-0x54A5 = 0x527A
-0x54A8 = 0x527E
-0x54AB = 0x5321
-0x54AC = 0x527B
-0x54AF = 0x533E
-0x54B2 = 0x3A69
-0x54B3 = 0x3331
-0x54B8 = 0x5279
-0x54BC = 0x5325
-0x54BD = 0x3076
-0x54BE = 0x5324
-0x54C0 = 0x3025
-0x54C1 = 0x494A
-0x54C2 = 0x5322
-0x54C4 = 0x527C
-0x54C7 = 0x5277
-0x54C8 = 0x527D
-0x54C9 = 0x3A48
-0x54D8 = 0x5326
-0x54E1 = 0x3077
-0x54E2 = 0x532F
-0x54E5 = 0x5327
-0x54E6 = 0x5328
-0x54E8 = 0x3E25
-0x54E9 = 0x4B69
-0x54ED = 0x532D
-0x54EE = 0x532C
-0x54F2 = 0x452F
-0x54FA = 0x532E
-0x54FD = 0x532B
-0x5504 = 0x3134
-0x5506 = 0x3A36
-0x5507 = 0x3F30
-0x550F = 0x5329
-0x5510 = 0x4562
-0x5514 = 0x532A
-0x5516 = 0x3022
-0x552E = 0x5334
-0x552F = 0x4D23
-0x5531 = 0x3E27
-0x5533 = 0x533A
-0x5538 = 0x5339
-0x5539 = 0x5330
-0x553E = 0x4243
-0x5540 = 0x5331
-0x5544 = 0x426F
-0x5545 = 0x5336
-0x5546 = 0x3E26
-0x554C = 0x5333
-0x554F = 0x4C64
-0x5553 = 0x373C
-0x5556 = 0x5337
-0x5557 = 0x5338
-0x555C = 0x5335
-0x555D = 0x533B
-0x5563 = 0x5332
-0x557B = 0x5341
-0x557C = 0x5346
-0x557E = 0x5342
-0x5580 = 0x533D
-0x5583 = 0x5347
-0x5584 = 0x4131
-0x5587 = 0x5349
-0x5589 = 0x3922
-0x558A = 0x533F
-0x558B = 0x437D
-0x5598 = 0x5343
-0x5599 = 0x533C
-0x559A = 0x342D
-0x559C = 0x346E
-0x559D = 0x3365
-0x559E = 0x5344
-0x559F = 0x5340
-0x55A7 = 0x3776
-0x55A8 = 0x534A
-0x55A9 = 0x5348
-0x55AA = 0x4153
-0x55AB = 0x354A
-0x55AC = 0x362C
-0x55AE = 0x5345
-0x55B0 = 0x3674
-0x55B6 = 0x3144
-0x55C4 = 0x534E
-0x55C5 = 0x534C
-0x55C7 = 0x5427
-0x55D4 = 0x5351
-0x55DA = 0x534B
-0x55DC = 0x534F
-0x55DF = 0x534D
-0x55E3 = 0x3B4C
-0x55E4 = 0x5350
-0x55F7 = 0x5353
-0x55F9 = 0x5358
-0x55FD = 0x5356
-0x55FE = 0x5355
-0x5606 = 0x4332
-0x5609 = 0x3245
-0x5614 = 0x5352
-0x5616 = 0x5354
-0x5617 = 0x3E28
-0x5618 = 0x3133
-0x561B = 0x5357
-0x5629 = 0x325E
-0x562F = 0x5362
-0x5631 = 0x3E7C
-0x5632 = 0x535E
-0x5634 = 0x535C
-0x5636 = 0x535D
-0x5638 = 0x535F
-0x5642 = 0x313D
-0x564C = 0x4139
-0x564E = 0x5359
-0x5650 = 0x535A
-0x565B = 0x337A
-0x5664 = 0x5361
-0x5668 = 0x346F
-0x566A = 0x5364
-0x566B = 0x5360
-0x566C = 0x5363
-0x5674 = 0x4A2E
-0x5678 = 0x4655
-0x567A = 0x4838
-0x5680 = 0x5366
-0x5686 = 0x5365
-0x5687 = 0x3345
-0x568A = 0x5367
-0x568F = 0x536A
-0x5694 = 0x5369
-0x56A0 = 0x5368
-0x56A2 = 0x4739
-0x56A5 = 0x536B
-0x56AE = 0x536C
-0x56B4 = 0x536E
-0x56B6 = 0x536D
-0x56BC = 0x5370
-0x56C0 = 0x5373
-0x56C1 = 0x5371
-0x56C2 = 0x536F
-0x56C3 = 0x5372
-0x56C8 = 0x5374
-0x56CE = 0x5375
-0x56D1 = 0x5376
-0x56D3 = 0x5377
-0x56D7 = 0x5378
-0x56D8 = 0x5145
-0x56DA = 0x3C7C
-0x56DB = 0x3B4D
-0x56DE = 0x3273
-0x56E0 = 0x3078
-0x56E3 = 0x4344
-0x56EE = 0x5379
-0x56F0 = 0x3A24
-0x56F2 = 0x304F
-0x56F3 = 0x3F5E
-0x56F9 = 0x537A
-0x56FA = 0x3847
-0x56FD = 0x3971
-0x56FF = 0x537C
-0x5700 = 0x537B
-0x5703 = 0x4A60
-0x5704 = 0x537D
-0x5708 = 0x5421
-0x5709 = 0x537E
-0x570B = 0x5422
-0x570D = 0x5423
-0x570F = 0x3777
-0x5712 = 0x3160
-0x5713 = 0x5424
-0x5716 = 0x5426
-0x5718 = 0x5425
-0x571C = 0x5428
-0x571F = 0x455A
-0x5726 = 0x5429
-0x5727 = 0x3035
-0x5728 = 0x3A5F
-0x572D = 0x373D
-0x5730 = 0x434F
-0x5737 = 0x542A
-0x5738 = 0x542B
-0x573B = 0x542D
-0x5740 = 0x542E
-0x5742 = 0x3A64
-0x5747 = 0x3651
-0x574A = 0x4B37
-0x574E = 0x542C
-0x574F = 0x542F
-0x5750 = 0x3A41
-0x5751 = 0x3923
-0x5761 = 0x5433
-0x5764 = 0x3A25
-0x5766 = 0x4333
-0x5769 = 0x5430
-0x576A = 0x445A
-0x577F = 0x5434
-0x5782 = 0x3F62
-0x5788 = 0x5432
-0x5789 = 0x5435
-0x578B = 0x373F
-0x5793 = 0x5436
-0x57A0 = 0x5437
-0x57A2 = 0x3924
-0x57A3 = 0x3340
-0x57A4 = 0x5439
-0x57AA = 0x543A
-0x57B0 = 0x543B
-0x57B3 = 0x5438
-0x57C0 = 0x5431
-0x57C3 = 0x543C
-0x57C6 = 0x543D
-0x57CB = 0x4B64
-0x57CE = 0x3E6B
-0x57D2 = 0x543F
-0x57D3 = 0x5440
-0x57D4 = 0x543E
-0x57D6 = 0x5442
-0x57DC = 0x4738
-0x57DF = 0x3068
-0x57E0 = 0x4956
-0x57E3 = 0x5443
-0x57F4 = 0x3E7D
-0x57F7 = 0x3C39
-0x57F9 = 0x475D
-0x57FA = 0x3470
-0x57FC = 0x3A6B
-0x5800 = 0x4B59
-0x5802 = 0x4632
-0x5805 = 0x3778
-0x5806 = 0x424F
-0x580A = 0x5441
-0x580B = 0x5444
-0x5815 = 0x4244
-0x5819 = 0x5445
-0x581D = 0x5446
-0x5821 = 0x5448
-0x5824 = 0x4469
-0x582A = 0x342E
-0x582F = 0x7421
-0x5830 = 0x3161
-0x5831 = 0x4A73
-0x5834 = 0x3E6C
-0x5835 = 0x4548
-0x583A = 0x3A66
-0x583D = 0x544E
-0x5840 = 0x4A3D
-0x5841 = 0x4E5D
-0x584A = 0x3274
-0x584B = 0x544A
-0x5851 = 0x413A
-0x5852 = 0x544D
-0x5854 = 0x4563
-0x5857 = 0x4549
-0x5858 = 0x4564
-0x5859 = 0x4839
-0x585A = 0x444D
-0x585E = 0x3A49
-0x5862 = 0x5449
-0x5869 = 0x3176
-0x586B = 0x4536
-0x5870 = 0x544B
-0x5872 = 0x5447
-0x5875 = 0x3F50
-0x5879 = 0x544F
-0x587E = 0x3D4E
-0x5883 = 0x362D
-0x5885 = 0x5450
-0x5893 = 0x4A68
-0x5897 = 0x417D
-0x589C = 0x4446
-0x589F = 0x5452
-0x58A8 = 0x4B4F
-0x58AB = 0x5453
-0x58AE = 0x5458
-0x58B3 = 0x4A2F
-0x58B8 = 0x5457
-0x58B9 = 0x5451
-0x58BA = 0x5454
-0x58BB = 0x5456
-0x58BE = 0x3A26
-0x58C1 = 0x4A49
-0x58C5 = 0x5459
-0x58C7 = 0x4345
-0x58CA = 0x3275
-0x58CC = 0x3E6D
-0x58D1 = 0x545B
-0x58D3 = 0x545A
-0x58D5 = 0x3968
-0x58D7 = 0x545C
-0x58D8 = 0x545E
-0x58D9 = 0x545D
-0x58DC = 0x5460
-0x58DE = 0x5455
-0x58DF = 0x5462
-0x58E4 = 0x5461
-0x58E5 = 0x545F
-0x58EB = 0x3B4E
-0x58EC = 0x3F51
-0x58EE = 0x4154
-0x58EF = 0x5463
-0x58F0 = 0x403C
-0x58F1 = 0x306D
-0x58F2 = 0x4764
-0x58F7 = 0x445B
-0x58F9 = 0x5465
-0x58FA = 0x5464
-0x58FB = 0x5466
-0x58FC = 0x5467
-0x58FD = 0x5468
-0x5902 = 0x5469
-0x5909 = 0x4A51
-0x590A = 0x546A
-0x590F = 0x3246
-0x5910 = 0x546B
-0x5915 = 0x4D3C
-0x5916 = 0x3330
-0x5918 = 0x5249
-0x5919 = 0x3D48
-0x591A = 0x423F
-0x591B = 0x546C
-0x591C = 0x4C6B
-0x5922 = 0x4C34
-0x5925 = 0x546E
-0x5927 = 0x4267
-0x5929 = 0x4537
-0x592A = 0x4240
-0x592B = 0x4957
-0x592C = 0x546F
-0x592D = 0x5470
-0x592E = 0x317B
-0x5931 = 0x3C3A
-0x5932 = 0x5471
-0x5937 = 0x3050
-0x5938 = 0x5472
-0x593E = 0x5473
-0x5944 = 0x3162
-0x5947 = 0x3471
-0x5948 = 0x4660
-0x5949 = 0x4A74
-0x594E = 0x5477
-0x594F = 0x4155
-0x5950 = 0x5476
-0x5951 = 0x3740
-0x5954 = 0x4B5B
-0x5955 = 0x5475
-0x5957 = 0x4565
-0x5958 = 0x5479
-0x595A = 0x5478
-0x5960 = 0x547B
-0x5962 = 0x547A
-0x5965 = 0x317C
-0x5967 = 0x547C
-0x5968 = 0x3E29
-0x5969 = 0x547E
-0x596A = 0x4325
-0x596C = 0x547D
-0x596E = 0x4A33
-0x5973 = 0x3D77
-0x5974 = 0x455B
-0x5978 = 0x5521
-0x597D = 0x3925
-0x5981 = 0x5522
-0x5982 = 0x4721
-0x5983 = 0x485E
-0x5984 = 0x4C51
-0x598A = 0x4725
-0x598D = 0x552B
-0x5993 = 0x3538
-0x5996 = 0x4D45
-0x5999 = 0x4C2F
-0x599B = 0x562C
-0x599D = 0x5523
-0x59A3 = 0x5526
-0x59A5 = 0x4245
-0x59A8 = 0x4B38
-0x59AC = 0x454A
-0x59B2 = 0x5527
-0x59B9 = 0x4B65
-0x59BB = 0x3A4A
-0x59BE = 0x3E2A
-0x59C6 = 0x5528
-0x59C9 = 0x3B50
-0x59CB = 0x3B4F
-0x59D0 = 0x3039
-0x59D1 = 0x3848
-0x59D3 = 0x402B
-0x59D4 = 0x3051
-0x59D9 = 0x552C
-0x59DA = 0x552D
-0x59DC = 0x552A
-0x59E5 = 0x3138
-0x59E6 = 0x342F
-0x59E8 = 0x5529
-0x59EA = 0x4C45
-0x59EB = 0x4931
-0x59F6 = 0x3028
-0x59FB = 0x3079
-0x59FF = 0x3B51
-0x5A01 = 0x3052
-0x5A03 = 0x3023
-0x5A09 = 0x5532
-0x5A11 = 0x5530
-0x5A18 = 0x4C3C
-0x5A1A = 0x5533
-0x5A1C = 0x5531
-0x5A1F = 0x552F
-0x5A20 = 0x3F31
-0x5A25 = 0x552E
-0x5A29 = 0x4A5A
-0x5A2F = 0x3864
-0x5A35 = 0x5537
-0x5A36 = 0x5538
-0x5A3C = 0x3E2B
-0x5A40 = 0x5534
-0x5A41 = 0x4F2C
-0x5A46 = 0x474C
-0x5A49 = 0x5536
-0x5A5A = 0x3A27
-0x5A62 = 0x5539
-0x5A66 = 0x4958
-0x5A6A = 0x553A
-0x5A6C = 0x5535
-0x5A7F = 0x4C3B
-0x5A92 = 0x475E
-0x5A9A = 0x553B
-0x5A9B = 0x4932
-0x5ABC = 0x553C
-0x5ABD = 0x5540
-0x5ABE = 0x553D
-0x5AC1 = 0x3247
-0x5AC2 = 0x553F
-0x5AC9 = 0x3C3B
-0x5ACB = 0x553E
-0x5ACC = 0x3779
-0x5AD0 = 0x554C
-0x5AD6 = 0x5545
-0x5AD7 = 0x5542
-0x5AE1 = 0x4364
-0x5AE3 = 0x5541
-0x5AE6 = 0x5543
-0x5AE9 = 0x5544
-0x5AFA = 0x5546
-0x5AFB = 0x5547
-0x5B09 = 0x3472
-0x5B0B = 0x5549
-0x5B0C = 0x5548
-0x5B16 = 0x554A
-0x5B22 = 0x3E6E
-0x5B2A = 0x554D
-0x5B2C = 0x445C
-0x5B30 = 0x3145
-0x5B32 = 0x554B
-0x5B36 = 0x554E
-0x5B3E = 0x554F
-0x5B40 = 0x5552
-0x5B43 = 0x5550
-0x5B45 = 0x5551
-0x5B50 = 0x3B52
-0x5B51 = 0x5553
-0x5B54 = 0x3926
-0x5B55 = 0x5554
-0x5B57 = 0x3B7A
-0x5B58 = 0x4238
-0x5B5A = 0x5555
-0x5B5B = 0x5556
-0x5B5C = 0x3B5A
-0x5B5D = 0x3927
-0x5B5F = 0x4C52
-0x5B63 = 0x3528
-0x5B64 = 0x3849
-0x5B65 = 0x5557
-0x5B66 = 0x3358
-0x5B69 = 0x5558
-0x5B6B = 0x4239
-0x5B70 = 0x5559
-0x5B71 = 0x5623
-0x5B73 = 0x555A
-0x5B75 = 0x555B
-0x5B78 = 0x555C
-0x5B7A = 0x555E
-0x5B80 = 0x555F
-0x5B83 = 0x5560
-0x5B85 = 0x4270
-0x5B87 = 0x3127
-0x5B88 = 0x3C69
-0x5B89 = 0x3042
-0x5B8B = 0x4157
-0x5B8C = 0x3430
-0x5B8D = 0x3C35
-0x5B8F = 0x3928
-0x5B95 = 0x4566
-0x5B97 = 0x3D21
-0x5B98 = 0x3431
-0x5B99 = 0x4368
-0x5B9A = 0x446A
-0x5B9B = 0x3038
-0x5B9C = 0x3539
-0x5B9D = 0x4A75
-0x5B9F = 0x3C42
-0x5BA2 = 0x3552
-0x5BA3 = 0x406B
-0x5BA4 = 0x3C3C
-0x5BA5 = 0x4D28
-0x5BA6 = 0x5561
-0x5BAE = 0x355C
-0x5BB0 = 0x3A4B
-0x5BB3 = 0x3332
-0x5BB4 = 0x3163
-0x5BB5 = 0x3E2C
-0x5BB6 = 0x3248
-0x5BB8 = 0x5562
-0x5BB9 = 0x4D46
-0x5BBF = 0x3D49
-0x5BC2 = 0x3C64
-0x5BC3 = 0x5563
-0x5BC4 = 0x3473
-0x5BC5 = 0x4652
-0x5BC6 = 0x4C29
-0x5BC7 = 0x5564
-0x5BC9 = 0x5565
-0x5BCC = 0x4959
-0x5BD0 = 0x5567
-0x5BD2 = 0x3428
-0x5BD3 = 0x3677
-0x5BD4 = 0x5566
-0x5BDB = 0x3432
-0x5BDD = 0x3F32
-0x5BDE = 0x556B
-0x5BDF = 0x3B21
-0x5BE1 = 0x3249
-0x5BE2 = 0x556A
-0x5BE4 = 0x5568
-0x5BE5 = 0x556C
-0x5BE6 = 0x5569
-0x5BE7 = 0x472B
-0x5BE8 = 0x5C4D
-0x5BE9 = 0x3F33
-0x5BEB = 0x556D
-0x5BEE = 0x4E40
-0x5BF0 = 0x556E
-0x5BF3 = 0x5570
-0x5BF5 = 0x437E
-0x5BF6 = 0x556F
-0x5BF8 = 0x4023
-0x5BFA = 0x3B7B
-0x5BFE = 0x4250
-0x5BFF = 0x3C77
-0x5C01 = 0x4975
-0x5C02 = 0x406C
-0x5C04 = 0x3C4D
-0x5C05 = 0x5571
-0x5C06 = 0x3E2D
-0x5C07 = 0x5572
-0x5C08 = 0x5573
-0x5C09 = 0x3053
-0x5C0A = 0x423A
-0x5C0B = 0x3F52
-0x5C0D = 0x5574
-0x5C0E = 0x4633
-0x5C0F = 0x3E2E
-0x5C11 = 0x3E2F
-0x5C13 = 0x5575
-0x5C16 = 0x406D
-0x5C1A = 0x3E30
-0x5C20 = 0x5576
-0x5C22 = 0x5577
-0x5C24 = 0x4C60
-0x5C28 = 0x5578
-0x5C2D = 0x3646
-0x5C31 = 0x3D22
-0x5C38 = 0x5579
-0x5C39 = 0x557A
-0x5C3A = 0x3C5C
-0x5C3B = 0x3F2C
-0x5C3C = 0x4674
-0x5C3D = 0x3F54
-0x5C3E = 0x4878
-0x5C3F = 0x4722
-0x5C40 = 0x3649
-0x5C41 = 0x557B
-0x5C45 = 0x356F
-0x5C46 = 0x557C
-0x5C48 = 0x367E
-0x5C4A = 0x464F
-0x5C4B = 0x3230
-0x5C4D = 0x3B53
-0x5C4E = 0x557D
-0x5C4F = 0x5622
-0x5C50 = 0x5621
-0x5C51 = 0x367D
-0x5C53 = 0x557E
-0x5C55 = 0x4538
-0x5C5E = 0x4230
-0x5C60 = 0x454B
-0x5C61 = 0x3C48
-0x5C64 = 0x4158
-0x5C65 = 0x4D7A
-0x5C6C = 0x5624
-0x5C6E = 0x5625
-0x5C6F = 0x4656
-0x5C71 = 0x3B33
-0x5C76 = 0x5627
-0x5C79 = 0x5628
-0x5C8C = 0x5629
-0x5C90 = 0x3474
-0x5C91 = 0x562A
-0x5C94 = 0x562B
-0x5CA1 = 0x322C
-0x5CA8 = 0x413B
-0x5CA9 = 0x3464
-0x5CAB = 0x562D
-0x5CAC = 0x4C28
-0x5CB1 = 0x4252
-0x5CB3 = 0x3359
-0x5CB6 = 0x562F
-0x5CB7 = 0x5631
-0x5CB8 = 0x345F
-0x5CBB = 0x562E
-0x5CBC = 0x5630
-0x5CBE = 0x5633
-0x5CC5 = 0x5632
-0x5CC7 = 0x5634
-0x5CD9 = 0x5635
-0x5CE0 = 0x463D
-0x5CE1 = 0x362E
-0x5CE8 = 0x3265
-0x5CE9 = 0x5636
-0x5CEA = 0x563B
-0x5CED = 0x5639
-0x5CEF = 0x4A77
-0x5CF0 = 0x4A76
-0x5CF6 = 0x4567
-0x5CFA = 0x5638
-0x5CFB = 0x3D54
-0x5CFD = 0x5637
-0x5D07 = 0x3F72
-0x5D0B = 0x563C
-0x5D0E = 0x3A6A
-0x5D11 = 0x5642
-0x5D14 = 0x5643
-0x5D15 = 0x563D
-0x5D16 = 0x3333
-0x5D17 = 0x563E
-0x5D18 = 0x5647
-0x5D19 = 0x5646
-0x5D1A = 0x5645
-0x5D1B = 0x5641
-0x5D1F = 0x5640
-0x5D22 = 0x5644
-0x5D29 = 0x4A78
-0x5D4B = 0x564B
-0x5D4C = 0x5648
-0x5D4E = 0x564A
-0x5D50 = 0x4D72
-0x5D52 = 0x5649
-0x5D5C = 0x563F
-0x5D69 = 0x3F73
-0x5D6C = 0x564C
-0x5D6F = 0x3A37
-0x5D73 = 0x564D
-0x5D76 = 0x564E
-0x5D82 = 0x5651
-0x5D84 = 0x5650
-0x5D87 = 0x564F
-0x5D8B = 0x4568
-0x5D8C = 0x563A
-0x5D90 = 0x5657
-0x5D9D = 0x5653
-0x5DA2 = 0x5652
-0x5DAC = 0x5654
-0x5DAE = 0x5655
-0x5DB7 = 0x5658
-0x5DBA = 0x4E66
-0x5DBC = 0x5659
-0x5DBD = 0x5656
-0x5DC9 = 0x565A
-0x5DCC = 0x3460
-0x5DCD = 0x565B
-0x5DD2 = 0x565D
-0x5DD3 = 0x565C
-0x5DD6 = 0x565E
-0x5DDB = 0x565F
-0x5DDD = 0x406E
-0x5DDE = 0x3D23
-0x5DE1 = 0x3D64
-0x5DE3 = 0x4163
-0x5DE5 = 0x3929
-0x5DE6 = 0x3A38
-0x5DE7 = 0x392A
-0x5DE8 = 0x3570
-0x5DEB = 0x5660
-0x5DEE = 0x3A39
-0x5DF1 = 0x384A
-0x5DF2 = 0x5661
-0x5DF3 = 0x4C26
-0x5DF4 = 0x4743
-0x5DF5 = 0x5662
-0x5DF7 = 0x392B
-0x5DFB = 0x342C
-0x5DFD = 0x4327
-0x5DFE = 0x3652
-0x5E02 = 0x3B54
-0x5E03 = 0x495B
-0x5E06 = 0x4841
-0x5E0B = 0x5663
-0x5E0C = 0x3475
-0x5E11 = 0x5666
-0x5E16 = 0x4421
-0x5E19 = 0x5665
-0x5E1A = 0x5664
-0x5E1B = 0x5667
-0x5E1D = 0x446B
-0x5E25 = 0x3F63
-0x5E2B = 0x3B55
-0x5E2D = 0x404A
-0x5E2F = 0x4253
-0x5E30 = 0x3522
-0x5E33 = 0x4422
-0x5E36 = 0x5668
-0x5E37 = 0x5669
-0x5E38 = 0x3E6F
-0x5E3D = 0x4B39
-0x5E40 = 0x566C
-0x5E43 = 0x566B
-0x5E44 = 0x566A
-0x5E45 = 0x497D
-0x5E47 = 0x5673
-0x5E4C = 0x4B5A
-0x5E4E = 0x566D
-0x5E54 = 0x566F
-0x5E55 = 0x4B6B
-0x5E57 = 0x566E
-0x5E5F = 0x5670
-0x5E61 = 0x4828
-0x5E62 = 0x5671
-0x5E63 = 0x4A3E
-0x5E64 = 0x5672
-0x5E72 = 0x3433
-0x5E73 = 0x4A3F
-0x5E74 = 0x472F
-0x5E75 = 0x5674
-0x5E76 = 0x5675
-0x5E78 = 0x392C
-0x5E79 = 0x3434
-0x5E7A = 0x5676
-0x5E7B = 0x3838
-0x5E7C = 0x4D44
-0x5E7D = 0x4D29
-0x5E7E = 0x3476
-0x5E7F = 0x5678
-0x5E81 = 0x4423
-0x5E83 = 0x392D
-0x5E84 = 0x3E31
-0x5E87 = 0x485F
-0x5E8A = 0x3E32
-0x5E8F = 0x3D78
-0x5E95 = 0x446C
-0x5E96 = 0x4A79
-0x5E97 = 0x4539
-0x5E9A = 0x392E
-0x5E9C = 0x495C
-0x5EA0 = 0x5679
-0x5EA6 = 0x4559
-0x5EA7 = 0x3A42
-0x5EAB = 0x384B
-0x5EAD = 0x446D
-0x5EB5 = 0x3043
-0x5EB6 = 0x3D6E
-0x5EB7 = 0x392F
-0x5EB8 = 0x4D47
-0x5EC1 = 0x567A
-0x5EC2 = 0x567B
-0x5EC3 = 0x4751
-0x5EC8 = 0x567C
-0x5EC9 = 0x4E77
-0x5ECA = 0x4F2D
-0x5ECF = 0x567E
-0x5ED0 = 0x567D
-0x5ED3 = 0x3347
-0x5ED6 = 0x5721
-0x5EDA = 0x5724
-0x5EDB = 0x5725
-0x5EDD = 0x5723
-0x5EDF = 0x4940
-0x5EE0 = 0x3E33
-0x5EE1 = 0x5727
-0x5EE2 = 0x5726
-0x5EE3 = 0x5722
-0x5EE8 = 0x5728
-0x5EE9 = 0x5729
-0x5EEC = 0x572A
-0x5EF0 = 0x572D
-0x5EF1 = 0x572B
-0x5EF3 = 0x572C
-0x5EF4 = 0x572E
-0x5EF6 = 0x3164
-0x5EF7 = 0x446E
-0x5EF8 = 0x572F
-0x5EFA = 0x377A
-0x5EFB = 0x3276
-0x5EFC = 0x4736
-0x5EFE = 0x5730
-0x5EFF = 0x467B
-0x5F01 = 0x4A5B
-0x5F03 = 0x5731
-0x5F04 = 0x4F2E
-0x5F09 = 0x5732
-0x5F0A = 0x4A40
-0x5F0B = 0x5735
-0x5F0C = 0x5021
-0x5F0D = 0x5031
-0x5F0F = 0x3C30
-0x5F10 = 0x4675
-0x5F11 = 0x5736
-0x5F13 = 0x355D
-0x5F14 = 0x4424
-0x5F15 = 0x307A
-0x5F16 = 0x5737
-0x5F17 = 0x4A26
-0x5F18 = 0x3930
-0x5F1B = 0x4350
-0x5F1F = 0x446F
-0x5F25 = 0x4C6F
-0x5F26 = 0x3839
-0x5F27 = 0x384C
-0x5F29 = 0x5738
-0x5F2D = 0x5739
-0x5F2F = 0x573F
-0x5F31 = 0x3C65
-0x5F35 = 0x4425
-0x5F37 = 0x362F
-0x5F38 = 0x573A
-0x5F3C = 0x492B
-0x5F3E = 0x4346
-0x5F41 = 0x573B
-0x5F48 = 0x573C
-0x5F4A = 0x3630
-0x5F4C = 0x573D
-0x5F4E = 0x573E
-0x5F51 = 0x5740
-0x5F53 = 0x4576
-0x5F56 = 0x5741
-0x5F57 = 0x5742
-0x5F59 = 0x5743
-0x5F5C = 0x5734
-0x5F5D = 0x5733
-0x5F61 = 0x5744
-0x5F62 = 0x3741
-0x5F66 = 0x4927
-0x5F69 = 0x3A4C
-0x5F6A = 0x4937
-0x5F6B = 0x4426
-0x5F6C = 0x494B
-0x5F6D = 0x5745
-0x5F70 = 0x3E34
-0x5F71 = 0x3146
-0x5F73 = 0x5746
-0x5F77 = 0x5747
-0x5F79 = 0x4C72
-0x5F7C = 0x4860
-0x5F7F = 0x574A
-0x5F80 = 0x317D
-0x5F81 = 0x402C
-0x5F82 = 0x5749
-0x5F83 = 0x5748
-0x5F84 = 0x3742
-0x5F85 = 0x4254
-0x5F87 = 0x574E
-0x5F88 = 0x574C
-0x5F8A = 0x574B
-0x5F8B = 0x4E27
-0x5F8C = 0x3865
-0x5F90 = 0x3D79
-0x5F91 = 0x574D
-0x5F92 = 0x454C
-0x5F93 = 0x3D3E
-0x5F97 = 0x4640
-0x5F98 = 0x5751
-0x5F99 = 0x5750
-0x5F9E = 0x574F
-0x5FA0 = 0x5752
-0x5FA1 = 0x3866
-0x5FA8 = 0x5753
-0x5FA9 = 0x497C
-0x5FAA = 0x3D5B
-0x5FAD = 0x5754
-0x5FAE = 0x4879
-0x5FB3 = 0x4641
-0x5FB4 = 0x4427
-0x5FB9 = 0x4530
-0x5FBC = 0x5755
-0x5FBD = 0x352B
-0x5FC3 = 0x3F34
-0x5FC5 = 0x492C
-0x5FCC = 0x3477
-0x5FCD = 0x4726
-0x5FD6 = 0x5756
-0x5FD7 = 0x3B56
-0x5FD8 = 0x4B3A
-0x5FD9 = 0x4B3B
-0x5FDC = 0x317E
-0x5FDD = 0x575B
-0x5FE0 = 0x4369
-0x5FE4 = 0x5758
-0x5FEB = 0x3277
-0x5FF0 = 0x582D
-0x5FF1 = 0x575A
-0x5FF5 = 0x4730
-0x5FF8 = 0x5759
-0x5FFB = 0x5757
-0x5FFD = 0x397A
-0x5FFF = 0x575D
-0x600E = 0x5763
-0x600F = 0x5769
-0x6010 = 0x5761
-0x6012 = 0x455C
-0x6015 = 0x5766
-0x6016 = 0x495D
-0x6019 = 0x5760
-0x601B = 0x5765
-0x601C = 0x4E67
-0x601D = 0x3B57
-0x6020 = 0x4255
-0x6021 = 0x575E
-0x6025 = 0x355E
-0x6026 = 0x5768
-0x6027 = 0x402D
-0x6028 = 0x3165
-0x6029 = 0x5762
-0x602A = 0x3278
-0x602B = 0x5767
-0x602F = 0x3631
-0x6031 = 0x5764
-0x603A = 0x576A
-0x6041 = 0x576C
-0x6042 = 0x5776
-0x6043 = 0x5774
-0x6046 = 0x5771
-0x604A = 0x5770
-0x604B = 0x4E78
-0x604D = 0x5772
-0x6050 = 0x3632
-0x6052 = 0x3931
-0x6055 = 0x3D7A
-0x6059 = 0x5779
-0x605A = 0x576B
-0x605F = 0x576F
-0x6060 = 0x575F
-0x6062 = 0x327A
-0x6063 = 0x5773
-0x6064 = 0x5775
-0x6065 = 0x4351
-0x6068 = 0x3A28
-0x6069 = 0x3238
-0x606A = 0x576D
-0x606B = 0x5778
-0x606C = 0x5777
-0x606D = 0x3633
-0x606F = 0x4229
-0x6070 = 0x3366
-0x6075 = 0x3743
-0x6077 = 0x576E
-0x6081 = 0x577A
-0x6083 = 0x577D
-0x6084 = 0x5821
-0x6089 = 0x3C3D
-0x608B = 0x5827
-0x608C = 0x4470
-0x608D = 0x577B
-0x6092 = 0x5825
-0x6094 = 0x3279
-0x6096 = 0x5823
-0x6097 = 0x5824
-0x609A = 0x577E
-0x609B = 0x5822
-0x609F = 0x3867
-0x60A0 = 0x4D2A
-0x60A3 = 0x3435
-0x60A6 = 0x3159
-0x60A7 = 0x5826
-0x60A9 = 0x473A
-0x60AA = 0x302D
-0x60B2 = 0x4861
-0x60B3 = 0x575C
-0x60B4 = 0x582C
-0x60B5 = 0x5830
-0x60B6 = 0x4C65
-0x60B8 = 0x5829
-0x60BC = 0x4569
-0x60BD = 0x582E
-0x60C5 = 0x3E70
-0x60C6 = 0x582F
-0x60C7 = 0x4657
-0x60D1 = 0x4F47
-0x60D3 = 0x582B
-0x60D8 = 0x5831
-0x60DA = 0x397B
-0x60DC = 0x404B
-0x60DF = 0x3054
-0x60E0 = 0x582A
-0x60E1 = 0x5828
-0x60E3 = 0x415A
-0x60E7 = 0x577C
-0x60E8 = 0x3B34
-0x60F0 = 0x4246
-0x60F1 = 0x583D
-0x60F3 = 0x415B
-0x60F4 = 0x5838
-0x60F6 = 0x5835
-0x60F7 = 0x5836
-0x60F9 = 0x3C66
-0x60FA = 0x5839
-0x60FB = 0x583C
-0x6100 = 0x5837
-0x6101 = 0x3D25
-0x6103 = 0x583A
-0x6106 = 0x5834
-0x6108 = 0x4C7C
-0x6109 = 0x4C7B
-0x610D = 0x583E
-0x610E = 0x583F
-0x610F = 0x3055
-0x6115 = 0x5833
-0x611A = 0x3672
-0x611B = 0x3026
-0x611F = 0x3436
-0x6121 = 0x583B
-0x6127 = 0x5843
-0x6128 = 0x5842
-0x612C = 0x5847
-0x6134 = 0x5848
-0x613C = 0x5846
-0x613D = 0x5849
-0x613E = 0x5841
-0x613F = 0x5845
-0x6142 = 0x584A
-0x6144 = 0x584B
-0x6147 = 0x5840
-0x6148 = 0x3B7C
-0x614A = 0x5844
-0x614B = 0x4256
-0x614C = 0x3932
-0x614D = 0x5832
-0x614E = 0x3F35
-0x6153 = 0x5858
-0x6155 = 0x4A69
-0x6158 = 0x584E
-0x6159 = 0x584F
-0x615A = 0x5850
-0x615D = 0x5857
-0x615F = 0x5856
-0x6162 = 0x4B7D
-0x6163 = 0x3437
-0x6165 = 0x5854
-0x6167 = 0x3745
-0x6168 = 0x3334
-0x616B = 0x5851
-0x616E = 0x4E38
-0x616F = 0x5853
-0x6170 = 0x3056
-0x6171 = 0x5855
-0x6173 = 0x584C
-0x6174 = 0x5852
-0x6175 = 0x5859
-0x6176 = 0x3744
-0x6177 = 0x584D
-0x617E = 0x4D5D
-0x6182 = 0x4D2B
-0x6187 = 0x585C
-0x618A = 0x5860
-0x618E = 0x417E
-0x6190 = 0x4E79
-0x6191 = 0x5861
-0x6194 = 0x585E
-0x6196 = 0x585B
-0x6199 = 0x585A
-0x619A = 0x585F
-0x61A4 = 0x4A30
-0x61A7 = 0x4634
-0x61A9 = 0x3746
-0x61AB = 0x5862
-0x61AC = 0x585D
-0x61AE = 0x5863
-0x61B2 = 0x377B
-0x61B6 = 0x3231
-0x61BA = 0x586B
-0x61BE = 0x3438
-0x61C3 = 0x5869
-0x61C6 = 0x586A
-0x61C7 = 0x3A29
-0x61C8 = 0x5868
-0x61C9 = 0x5866
-0x61CA = 0x5865
-0x61CB = 0x586C
-0x61CC = 0x5864
-0x61CD = 0x586E
-0x61D0 = 0x327B
-0x61E3 = 0x5870
-0x61E6 = 0x586F
-0x61F2 = 0x4428
-0x61F4 = 0x5873
-0x61F6 = 0x5871
-0x61F7 = 0x5867
-0x61F8 = 0x377C
-0x61FA = 0x5872
-0x61FC = 0x5876
-0x61FD = 0x5875
-0x61FE = 0x5877
-0x61FF = 0x5874
-0x6200 = 0x5878
-0x6208 = 0x5879
-0x6209 = 0x587A
-0x620A = 0x4A6A
-0x620C = 0x587C
-0x620D = 0x587B
-0x620E = 0x3D3F
-0x6210 = 0x402E
-0x6211 = 0x3266
-0x6212 = 0x327C
-0x6214 = 0x587D
-0x6216 = 0x303F
-0x621A = 0x404C
-0x621B = 0x587E
-0x621D = 0x6C43
-0x621E = 0x5921
-0x621F = 0x3761
-0x6221 = 0x5922
-0x6226 = 0x406F
-0x622A = 0x5923
-0x622E = 0x5924
-0x622F = 0x353A
-0x6230 = 0x5925
-0x6232 = 0x5926
-0x6233 = 0x5927
-0x6234 = 0x4257
-0x6238 = 0x384D
-0x623B = 0x4C61
-0x623F = 0x4B3C
-0x6240 = 0x3D6A
-0x6241 = 0x5928
-0x6247 = 0x4070
-0x6248 = 0x6E3D
-0x6249 = 0x4862
-0x624B = 0x3C6A
-0x624D = 0x3A4D
-0x624E = 0x5929
-0x6253 = 0x4247
-0x6255 = 0x4A27
-0x6258 = 0x4271
-0x625B = 0x592C
-0x625E = 0x592A
-0x6260 = 0x592D
-0x6263 = 0x592B
-0x6268 = 0x592E
-0x626E = 0x4A31
-0x6271 = 0x3037
-0x6276 = 0x495E
-0x6279 = 0x4863
-0x627C = 0x592F
-0x627E = 0x5932
-0x627F = 0x3E35
-0x6280 = 0x353B
-0x6282 = 0x5930
-0x6283 = 0x5937
-0x6284 = 0x3E36
-0x6289 = 0x5931
-0x628A = 0x4744
-0x6291 = 0x4D5E
-0x6292 = 0x5933
-0x6293 = 0x5934
-0x6294 = 0x5938
-0x6295 = 0x456A
-0x6296 = 0x5935
-0x6297 = 0x3933
-0x6298 = 0x405E
-0x629B = 0x5946
-0x629C = 0x4834
-0x629E = 0x4272
-0x62AB = 0x4864
-0x62AC = 0x5A2D
-0x62B1 = 0x4A7A
-0x62B5 = 0x4471
-0x62B9 = 0x4B75
-0x62BB = 0x593B
-0x62BC = 0x3221
-0x62BD = 0x436A
-0x62C2 = 0x5944
-0x62C5 = 0x4334
-0x62C6 = 0x593E
-0x62C7 = 0x5945
-0x62C8 = 0x5940
-0x62C9 = 0x5947
-0x62CA = 0x5943
-0x62CC = 0x5942
-0x62CD = 0x476F
-0x62CF = 0x593C
-0x62D0 = 0x327D
-0x62D1 = 0x593A
-0x62D2 = 0x3571
-0x62D3 = 0x4273
-0x62D4 = 0x5936
-0x62D7 = 0x5939
-0x62D8 = 0x3934
-0x62D9 = 0x405B
-0x62DB = 0x3E37
-0x62DC = 0x5941
-0x62DD = 0x4752
-0x62E0 = 0x3572
-0x62E1 = 0x3348
-0x62EC = 0x3367
-0x62ED = 0x3F21
-0x62EE = 0x5949
-0x62EF = 0x594E
-0x62F1 = 0x594A
-0x62F3 = 0x377D
-0x62F5 = 0x594F
-0x62F6 = 0x3B22
-0x62F7 = 0x3969
-0x62FE = 0x3D26
-0x62FF = 0x593D
-0x6301 = 0x3B7D
-0x6302 = 0x594C
-0x6307 = 0x3B58
-0x6308 = 0x594D
-0x6309 = 0x3044
-0x630C = 0x5948
-0x6311 = 0x4429
-0x6319 = 0x3573
-0x631F = 0x3634
-0x6327 = 0x594B
-0x6328 = 0x3027
-0x632B = 0x3A43
-0x632F = 0x3F36
-0x633A = 0x4472
-0x633D = 0x4854
-0x633E = 0x5951
-0x633F = 0x415E
-0x6349 = 0x422A
-0x634C = 0x3B2B
-0x634D = 0x5952
-0x634F = 0x5954
-0x6350 = 0x5950
-0x6355 = 0x4A61
-0x6357 = 0x443D
-0x635C = 0x415C
-0x6367 = 0x4A7B
-0x6368 = 0x3C4E
-0x6369 = 0x5960
-0x636B = 0x595F
-0x636E = 0x3F78
-0x6372 = 0x377E
-0x6376 = 0x5959
-0x6377 = 0x3E39
-0x637A = 0x4668
-0x637B = 0x4731
-0x6380 = 0x5957
-0x6383 = 0x415D
-0x6388 = 0x3C78
-0x6389 = 0x595C
-0x638C = 0x3E38
-0x638E = 0x5956
-0x638F = 0x595B
-0x6392 = 0x4753
-0x6396 = 0x5955
-0x6398 = 0x3721
-0x639B = 0x335D
-0x639F = 0x595D
-0x63A0 = 0x4E2B
-0x63A1 = 0x3A4E
-0x63A2 = 0x4335
-0x63A3 = 0x595A
-0x63A5 = 0x405C
-0x63A7 = 0x3935
-0x63A8 = 0x3F64
-0x63A9 = 0x3166
-0x63AA = 0x413C
-0x63AB = 0x5958
-0x63AC = 0x3545
-0x63B2 = 0x3747
-0x63B4 = 0x444F
-0x63B5 = 0x595E
-0x63BB = 0x415F
-0x63BE = 0x5961
-0x63C0 = 0x5963
-0x63C3 = 0x4237
-0x63C4 = 0x5969
-0x63C6 = 0x5964
-0x63C9 = 0x5966
-0x63CF = 0x4941
-0x63D0 = 0x4473
-0x63D2 = 0x5967
-0x63D6 = 0x4D2C
-0x63DA = 0x4D48
-0x63DB = 0x3439
-0x63E1 = 0x302E
-0x63E3 = 0x5965
-0x63E9 = 0x5962
-0x63EE = 0x3478
-0x63F4 = 0x3167
-0x63F6 = 0x5968
-0x63FA = 0x4D49
-0x6406 = 0x596C
-0x640D = 0x423B
-0x640F = 0x5973
-0x6413 = 0x596D
-0x6416 = 0x596A
-0x6417 = 0x5971
-0x641C = 0x5953
-0x6426 = 0x596E
-0x6428 = 0x5972
-0x642C = 0x4842
-0x642D = 0x456B
-0x6434 = 0x596B
-0x6436 = 0x596F
-0x643A = 0x3748
-0x643E = 0x3A71
-0x6442 = 0x405D
-0x644E = 0x5977
-0x6458 = 0x4526
-0x6467 = 0x5974
-0x6469 = 0x4B60
-0x646F = 0x5975
-0x6476 = 0x5976
-0x6478 = 0x4C4E
-0x647A = 0x4022
-0x6483 = 0x3762
-0x6488 = 0x597D
-0x6492 = 0x3B35
-0x6493 = 0x597A
-0x6495 = 0x5979
-0x649A = 0x4732
-0x649E = 0x4635
-0x64A4 = 0x4531
-0x64A5 = 0x597B
-0x64A9 = 0x597C
-0x64AB = 0x496F
-0x64AD = 0x4745
-0x64AE = 0x3B23
-0x64B0 = 0x4071
-0x64B2 = 0x4B50
-0x64B9 = 0x3349
-0x64BB = 0x5A25
-0x64BC = 0x597E
-0x64C1 = 0x4D4A
-0x64C2 = 0x5A27
-0x64C5 = 0x5A23
-0x64C7 = 0x5A24
-0x64CD = 0x4160
-0x64D2 = 0x5A22
-0x64D4 = 0x593F
-0x64D8 = 0x5A26
-0x64DA = 0x5A21
-0x64E0 = 0x5A2B
-0x64E1 = 0x5A2C
-0x64E2 = 0x4527
-0x64E3 = 0x5A2E
-0x64E6 = 0x3B24
-0x64E7 = 0x5A29
-0x64EC = 0x353C
-0x64EF = 0x5A2F
-0x64F1 = 0x5A28
-0x64F2 = 0x5A33
-0x64F4 = 0x5A32
-0x64F6 = 0x5A31
-0x64FA = 0x5A34
-0x64FD = 0x5A36
-0x64FE = 0x3E71
-0x6500 = 0x5A35
-0x6505 = 0x5A39
-0x6518 = 0x5A37
-0x651C = 0x5A38
-0x651D = 0x5970
-0x6523 = 0x5A3B
-0x6524 = 0x5A3A
-0x652A = 0x5978
-0x652B = 0x5A3C
-0x652C = 0x5A30
-0x652F = 0x3B59
-0x6534 = 0x5A3D
-0x6535 = 0x5A3E
-0x6536 = 0x5A40
-0x6537 = 0x5A3F
-0x6538 = 0x5A41
-0x6539 = 0x327E
-0x653B = 0x3936
-0x653E = 0x4A7C
-0x653F = 0x402F
-0x6545 = 0x384E
-0x6548 = 0x5A43
-0x654D = 0x5A46
-0x654F = 0x4952
-0x6551 = 0x355F
-0x6555 = 0x5A45
-0x6556 = 0x5A44
-0x6557 = 0x4754
-0x6558 = 0x5A47
-0x6559 = 0x3635
-0x655D = 0x5A49
-0x655E = 0x5A48
-0x6562 = 0x343A
-0x6563 = 0x3B36
-0x6566 = 0x4658
-0x656C = 0x3749
-0x6570 = 0x3F74
-0x6572 = 0x5A4A
-0x6574 = 0x4030
-0x6575 = 0x4528
-0x6577 = 0x495F
-0x6578 = 0x5A4B
-0x6582 = 0x5A4C
-0x6583 = 0x5A4D
-0x6587 = 0x4A38
-0x6588 = 0x555D
-0x6589 = 0x4046
-0x658C = 0x494C
-0x658E = 0x3A58
-0x6590 = 0x4865
-0x6591 = 0x4843
-0x6597 = 0x454D
-0x6599 = 0x4E41
-0x659B = 0x5A4F
-0x659C = 0x3C50
-0x659F = 0x5A50
-0x65A1 = 0x3036
-0x65A4 = 0x3654
-0x65A5 = 0x404D
-0x65A7 = 0x4960
-0x65AB = 0x5A51
-0x65AC = 0x3B42
-0x65AD = 0x4347
-0x65AF = 0x3B5B
-0x65B0 = 0x3F37
-0x65B7 = 0x5A52
-0x65B9 = 0x4A7D
-0x65BC = 0x3177
-0x65BD = 0x3B5C
-0x65C1 = 0x5A55
-0x65C3 = 0x5A53
-0x65C4 = 0x5A56
-0x65C5 = 0x4E39
-0x65C6 = 0x5A54
-0x65CB = 0x407B
-0x65CC = 0x5A57
-0x65CF = 0x4232
-0x65D2 = 0x5A58
-0x65D7 = 0x347A
-0x65D9 = 0x5A5A
-0x65DB = 0x5A59
-0x65E0 = 0x5A5B
-0x65E1 = 0x5A5C
-0x65E2 = 0x347B
-0x65E5 = 0x467C
-0x65E6 = 0x4336
-0x65E7 = 0x356C
-0x65E8 = 0x3B5D
-0x65E9 = 0x4161
-0x65EC = 0x3D5C
-0x65ED = 0x3030
-0x65F1 = 0x5A5D
-0x65FA = 0x3222
-0x65FB = 0x5A61
-0x6602 = 0x3937
-0x6603 = 0x5A60
-0x6606 = 0x3A2B
-0x6607 = 0x3E3A
-0x660A = 0x5A5F
-0x660C = 0x3E3B
-0x660E = 0x4C40
-0x660F = 0x3A2A
-0x6613 = 0x3057
-0x6614 = 0x404E
-0x661C = 0x5A66
-0x661F = 0x4031
-0x6620 = 0x3147
-0x6625 = 0x3D55
-0x6627 = 0x4B66
-0x6628 = 0x3A72
-0x662D = 0x3E3C
-0x662F = 0x4027
-0x6634 = 0x5A65
-0x6635 = 0x5A63
-0x6636 = 0x5A64
-0x663C = 0x436B
-0x663F = 0x5B26
-0x6641 = 0x5A6A
-0x6642 = 0x3B7E
-0x6643 = 0x3938
-0x6644 = 0x5A68
-0x6649 = 0x5A69
-0x664B = 0x3F38
-0x664F = 0x5A67
-0x6652 = 0x3B2F
-0x665D = 0x5A6C
-0x665E = 0x5A6B
-0x665F = 0x5A70
-0x6662 = 0x5A71
-0x6664 = 0x5A6D
-0x6666 = 0x3322
-0x6667 = 0x5A6E
-0x6668 = 0x5A6F
-0x6669 = 0x4855
-0x666E = 0x4961
-0x666F = 0x374A
-0x6670 = 0x5A72
-0x6674 = 0x4032
-0x6676 = 0x3E3D
-0x667A = 0x4352
-0x6681 = 0x3647
-0x6683 = 0x5A73
-0x6684 = 0x5A77
-0x6687 = 0x324B
-0x6688 = 0x5A74
-0x6689 = 0x5A76
-0x668E = 0x5A75
-0x6691 = 0x3D6B
-0x6696 = 0x4348
-0x6697 = 0x3045
-0x6698 = 0x5A78
-0x669D = 0x5A79
-0x66A2 = 0x442A
-0x66A6 = 0x4E71
-0x66AB = 0x3B43
-0x66AE = 0x4A6B
-0x66B4 = 0x4B3D
-0x66B8 = 0x5B22
-0x66B9 = 0x5A7B
-0x66BC = 0x5A7E
-0x66BE = 0x5A7D
-0x66C1 = 0x5A7A
-0x66C4 = 0x5B21
-0x66C7 = 0x465E
-0x66C9 = 0x5A7C
-0x66D6 = 0x5B23
-0x66D9 = 0x3D6C
-0x66DA = 0x5B24
-0x66DC = 0x4D4B
-0x66DD = 0x4778
-0x66E0 = 0x5B25
-0x66E6 = 0x5B27
-0x66E9 = 0x5B28
-0x66F0 = 0x5B29
-0x66F2 = 0x364A
-0x66F3 = 0x3148
-0x66F4 = 0x3939
-0x66F5 = 0x5B2A
-0x66F7 = 0x5B2B
-0x66F8 = 0x3D71
-0x66F9 = 0x4162
-0x66FC = 0x5258
-0x66FD = 0x413E
-0x66FE = 0x413D
-0x66FF = 0x4258
-0x6700 = 0x3A47
-0x6703 = 0x5072
-0x6708 = 0x376E
-0x6709 = 0x4D2D
-0x670B = 0x4A7E
-0x670D = 0x497E
-0x670F = 0x5B2C
-0x6714 = 0x3A73
-0x6715 = 0x443F
-0x6716 = 0x5B2D
-0x6717 = 0x4F2F
-0x671B = 0x4B3E
-0x671D = 0x442B
-0x671E = 0x5B2E
-0x671F = 0x347C
-0x6726 = 0x5B2F
-0x6727 = 0x5B30
-0x6728 = 0x4C5A
-0x672A = 0x4C24
-0x672B = 0x4B76
-0x672C = 0x4B5C
-0x672D = 0x3B25
-0x672E = 0x5B32
-0x6731 = 0x3C6B
-0x6734 = 0x4B51
-0x6736 = 0x5B34
-0x6737 = 0x5B37
-0x6738 = 0x5B36
-0x673A = 0x3479
-0x673D = 0x3560
-0x673F = 0x5B33
-0x6741 = 0x5B35
-0x6746 = 0x5B38
-0x6749 = 0x3F79
-0x674E = 0x4D7B
-0x674F = 0x3049
-0x6750 = 0x3A60
-0x6751 = 0x423C
-0x6753 = 0x3C5D
-0x6756 = 0x3E73
-0x6759 = 0x5B3B
-0x675C = 0x454E
-0x675E = 0x5B39
-0x675F = 0x422B
-0x6760 = 0x5B3A
-0x6761 = 0x3E72
-0x6762 = 0x4C5D
-0x6763 = 0x5B3C
-0x6764 = 0x5B3D
-0x6765 = 0x4D68
-0x676A = 0x5B42
-0x676D = 0x393A
-0x676F = 0x4755
-0x6770 = 0x5B3F
-0x6771 = 0x456C
-0x6772 = 0x5A5E
-0x6773 = 0x5A62
-0x6775 = 0x354F
-0x6777 = 0x4747
-0x677C = 0x5B41
-0x677E = 0x3E3E
-0x677F = 0x4844
-0x6785 = 0x5B47
-0x6787 = 0x487A
-0x6789 = 0x5B3E
-0x678B = 0x5B44
-0x678C = 0x5B43
-0x6790 = 0x404F
-0x6795 = 0x4B6D
-0x6797 = 0x4E53
-0x679A = 0x4B67
-0x679C = 0x324C
-0x679D = 0x3B5E
-0x67A0 = 0x4F48
-0x67A1 = 0x5B46
-0x67A2 = 0x3F75
-0x67A6 = 0x5B45
-0x67A9 = 0x5B40
-0x67AF = 0x384F
-0x67B3 = 0x5B4C
-0x67B4 = 0x5B4A
-0x67B6 = 0x324D
-0x67B7 = 0x5B48
-0x67B8 = 0x5B4E
-0x67B9 = 0x5B54
-0x67C1 = 0x4248
-0x67C4 = 0x4A41
-0x67C6 = 0x5B56
-0x67CA = 0x4922
-0x67CE = 0x5B55
-0x67CF = 0x4770
-0x67D0 = 0x4B3F
-0x67D1 = 0x343B
-0x67D3 = 0x4077
-0x67D4 = 0x3D40
-0x67D8 = 0x4453
-0x67DA = 0x4D2E
-0x67DD = 0x5B51
-0x67DE = 0x5B50
-0x67E2 = 0x5B52
-0x67E4 = 0x5B4F
-0x67E7 = 0x5B57
-0x67E9 = 0x5B4D
-0x67EC = 0x5B4B
-0x67EE = 0x5B53
-0x67EF = 0x5B49
-0x67F1 = 0x436C
-0x67F3 = 0x4C78
-0x67F4 = 0x3C46
-0x67F5 = 0x3A74
-0x67FB = 0x3A3A
-0x67FE = 0x4B6F
-0x67FF = 0x3341
-0x6802 = 0x444E
-0x6803 = 0x464A
-0x6804 = 0x3149
-0x6813 = 0x4072
-0x6816 = 0x4034
-0x6817 = 0x372A
-0x681E = 0x5B59
-0x6821 = 0x393B
-0x6822 = 0x337C
-0x6829 = 0x5B5B
-0x682A = 0x3374
-0x682B = 0x5B61
-0x6832 = 0x5B5E
-0x6834 = 0x4073
-0x6838 = 0x334B
-0x6839 = 0x3A2C
-0x683C = 0x334A
-0x683D = 0x3A4F
-0x6840 = 0x5B5C
-0x6841 = 0x3765
-0x6842 = 0x374B
-0x6843 = 0x456D
-0x6846 = 0x5B5A
-0x6848 = 0x3046
-0x684D = 0x5B5D
-0x684E = 0x5B5F
-0x6850 = 0x364D
-0x6851 = 0x372C
-0x6853 = 0x343C
-0x6854 = 0x354B
-0x6859 = 0x5B62
-0x685C = 0x3A79
-0x685D = 0x4B71
-0x685F = 0x3B37
-0x6863 = 0x5B63
-0x6867 = 0x4930
-0x6874 = 0x5B6F
-0x6876 = 0x3233
-0x6877 = 0x5B64
-0x687E = 0x5B75
-0x687F = 0x5B65
-0x6881 = 0x4E42
-0x6883 = 0x5B6C
-0x6885 = 0x475F
-0x688D = 0x5B74
-0x688F = 0x5B67
-0x6893 = 0x3034
-0x6894 = 0x5B69
-0x6897 = 0x393C
-0x689B = 0x5B6B
-0x689D = 0x5B6A
-0x689F = 0x5B66
-0x68A0 = 0x5B71
-0x68A2 = 0x3E3F
-0x68A6 = 0x546D
-0x68A7 = 0x3868
-0x68A8 = 0x4D7C
-0x68AD = 0x5B68
-0x68AF = 0x4474
-0x68B0 = 0x3323
-0x68B1 = 0x3A2D
-0x68B3 = 0x5B60
-0x68B5 = 0x5B70
-0x68B6 = 0x3361
-0x68B9 = 0x5B6E
-0x68BA = 0x5B72
-0x68BC = 0x456E
-0x68C4 = 0x347E
-0x68C6 = 0x5C32
-0x68C9 = 0x4C49
-0x68CA = 0x5B77
-0x68CB = 0x347D
-0x68CD = 0x5B7E
-0x68D2 = 0x4B40
-0x68D4 = 0x5C21
-0x68D5 = 0x5C23
-0x68D7 = 0x5C27
-0x68D8 = 0x5B79
-0x68DA = 0x432A
-0x68DF = 0x456F
-0x68E0 = 0x5C2B
-0x68E1 = 0x5B7C
-0x68E3 = 0x5C28
-0x68E7 = 0x5C22
-0x68EE = 0x3F39
-0x68EF = 0x5C2C
-0x68F2 = 0x4033
-0x68F9 = 0x5C2A
-0x68FA = 0x343D
-0x6900 = 0x4F50
-0x6901 = 0x5B76
-0x6904 = 0x5C26
-0x6905 = 0x3058
-0x6908 = 0x5B78
-0x690B = 0x4C3A
-0x690C = 0x5B7D
-0x690D = 0x3F22
-0x690E = 0x4447
-0x690F = 0x5B73
-0x6912 = 0x5C25
-0x6919 = 0x3F7A
-0x691A = 0x5C2F
-0x691B = 0x3371
-0x691C = 0x3821
-0x6921 = 0x5C31
-0x6922 = 0x5B7A
-0x6923 = 0x5C30
-0x6925 = 0x5C29
-0x6926 = 0x5B7B
-0x6928 = 0x5C2D
-0x692A = 0x5C2E
-0x6930 = 0x5C3F
-0x6934 = 0x464E
-0x6936 = 0x5C24
-0x6939 = 0x5C3B
-0x693D = 0x5C3D
-0x693F = 0x4458
-0x694A = 0x4D4C
-0x6953 = 0x4976
-0x6954 = 0x5C38
-0x6955 = 0x424A
-0x6959 = 0x5C3E
-0x695A = 0x413F
-0x695C = 0x5C35
-0x695D = 0x5C42
-0x695E = 0x5C41
-0x6960 = 0x466F
-0x6961 = 0x5C40
-0x6962 = 0x466A
-0x696A = 0x5C44
-0x696B = 0x5C37
-0x696D = 0x3648
-0x696E = 0x5C3A
-0x696F = 0x3D5D
-0x6973 = 0x4760
-0x6974 = 0x5C3C
-0x6975 = 0x364B
-0x6977 = 0x5C34
-0x6978 = 0x5C36
-0x6979 = 0x5C33
-0x697C = 0x4F30
-0x697D = 0x335A
-0x697E = 0x5C39
-0x6981 = 0x5C43
-0x6982 = 0x3335
-0x698A = 0x3A67
-0x698E = 0x315D
-0x6991 = 0x5C54
-0x6994 = 0x4F31
-0x6995 = 0x5C57
-0x699B = 0x3F3A
-0x699C = 0x5C56
-0x69A0 = 0x5C55
-0x69A7 = 0x5C52
-0x69AE = 0x5C46
-0x69B1 = 0x5C63
-0x69B2 = 0x5C45
-0x69B4 = 0x5C58
-0x69BB = 0x5C50
-0x69BE = 0x5C4B
-0x69BF = 0x5C48
-0x69C1 = 0x5C49
-0x69C3 = 0x5C51
-0x69C7 = 0x7422
-0x69CA = 0x5C4E
-0x69CB = 0x393D
-0x69CC = 0x4448
-0x69CD = 0x4164
-0x69CE = 0x5C4C
-0x69D0 = 0x5C47
-0x69D3 = 0x5C4A
-0x69D8 = 0x4D4D
-0x69D9 = 0x4B6A
-0x69DD = 0x5C4F
-0x69DE = 0x5C59
-0x69E7 = 0x5C61
-0x69E8 = 0x5C5A
-0x69EB = 0x5C67
-0x69ED = 0x5C65
-0x69F2 = 0x5C60
-0x69F9 = 0x5C5F
-0x69FB = 0x4450
-0x69FD = 0x4165
-0x69FF = 0x5C5D
-0x6A02 = 0x5C5B
-0x6A05 = 0x5C62
-0x6A0A = 0x5C68
-0x6A0B = 0x4875
-0x6A0C = 0x5C6E
-0x6A12 = 0x5C69
-0x6A13 = 0x5C6C
-0x6A14 = 0x5C66
-0x6A17 = 0x4374
-0x6A19 = 0x4938
-0x6A1B = 0x5C5C
-0x6A1E = 0x5C64
-0x6A1F = 0x3E40
-0x6A21 = 0x4C4F
-0x6A22 = 0x5C78
-0x6A23 = 0x5C6B
-0x6A29 = 0x3822
-0x6A2A = 0x3223
-0x6A2B = 0x335F
-0x6A2E = 0x5C53
-0x6A35 = 0x3E41
-0x6A36 = 0x5C70
-0x6A38 = 0x5C77
-0x6A39 = 0x3C79
-0x6A3A = 0x3372
-0x6A3D = 0x432E
-0x6A44 = 0x5C6D
-0x6A47 = 0x5C72
-0x6A48 = 0x5C76
-0x6A4B = 0x3636
-0x6A58 = 0x354C
-0x6A59 = 0x5C74
-0x6A5F = 0x3521
-0x6A61 = 0x464B
-0x6A62 = 0x5C73
-0x6A66 = 0x5C75
-0x6A72 = 0x5C6F
-0x6A78 = 0x5C71
-0x6A7F = 0x3360
-0x6A80 = 0x4349
-0x6A84 = 0x5C7C
-0x6A8D = 0x5C7A
-0x6A8E = 0x3869
-0x6A90 = 0x5C79
-0x6A97 = 0x5D21
-0x6A9C = 0x5B58
-0x6AA0 = 0x5C7B
-0x6AA2 = 0x5C7D
-0x6AA3 = 0x5C7E
-0x6AAA = 0x5D2C
-0x6AAC = 0x5D28
-0x6AAE = 0x5B6D
-0x6AB3 = 0x5D27
-0x6AB8 = 0x5D26
-0x6ABB = 0x5D23
-0x6AC1 = 0x5C6A
-0x6AC2 = 0x5D25
-0x6AC3 = 0x5D24
-0x6AD1 = 0x5D2A
-0x6AD3 = 0x4F26
-0x6ADA = 0x5D2D
-0x6ADB = 0x367B
-0x6ADE = 0x5D29
-0x6ADF = 0x5D2B
-0x6AE8 = 0x4827
-0x6AEA = 0x5D2E
-0x6AFA = 0x5D32
-0x6AFB = 0x5D2F
-0x6B04 = 0x4D73
-0x6B05 = 0x5D30
-0x6B0A = 0x5C5E
-0x6B12 = 0x5D33
-0x6B16 = 0x5D34
-0x6B1D = 0x3135
-0x6B1F = 0x5D36
-0x6B20 = 0x3767
-0x6B21 = 0x3C21
-0x6B23 = 0x3655
-0x6B27 = 0x3224
-0x6B32 = 0x4D5F
-0x6B37 = 0x5D38
-0x6B38 = 0x5D37
-0x6B39 = 0x5D3A
-0x6B3A = 0x353D
-0x6B3D = 0x3656
-0x6B3E = 0x343E
-0x6B43 = 0x5D3D
-0x6B47 = 0x5D3C
-0x6B49 = 0x5D3E
-0x6B4C = 0x324E
-0x6B4E = 0x4337
-0x6B50 = 0x5D3F
-0x6B53 = 0x343F
-0x6B54 = 0x5D41
-0x6B59 = 0x5D40
-0x6B5B = 0x5D42
-0x6B5F = 0x5D43
-0x6B61 = 0x5D44
-0x6B62 = 0x3B5F
-0x6B63 = 0x4035
-0x6B64 = 0x3A21
-0x6B66 = 0x4970
-0x6B69 = 0x4A62
-0x6B6A = 0x4F44
-0x6B6F = 0x3B75
-0x6B73 = 0x3A50
-0x6B74 = 0x4E72
-0x6B78 = 0x5D45
-0x6B79 = 0x5D46
-0x6B7B = 0x3B60
-0x6B7F = 0x5D47
-0x6B80 = 0x5D48
-0x6B83 = 0x5D4A
-0x6B84 = 0x5D49
-0x6B86 = 0x4B58
-0x6B89 = 0x3D5E
-0x6B8A = 0x3C6C
-0x6B8B = 0x3B44
-0x6B8D = 0x5D4B
-0x6B95 = 0x5D4D
-0x6B96 = 0x3F23
-0x6B98 = 0x5D4C
-0x6B9E = 0x5D4E
-0x6BA4 = 0x5D4F
-0x6BAA = 0x5D50
-0x6BAB = 0x5D51
-0x6BAF = 0x5D52
-0x6BB1 = 0x5D54
-0x6BB2 = 0x5D53
-0x6BB3 = 0x5D55
-0x6BB4 = 0x3225
-0x6BB5 = 0x434A
-0x6BB7 = 0x5D56
-0x6BBA = 0x3B26
-0x6BBB = 0x334C
-0x6BBC = 0x5D57
-0x6BBF = 0x4542
-0x6BC0 = 0x544C
-0x6BC5 = 0x3523
-0x6BC6 = 0x5D58
-0x6BCB = 0x5D59
-0x6BCD = 0x4A6C
-0x6BCE = 0x4B68
-0x6BD2 = 0x4647
-0x6BD3 = 0x5D5A
-0x6BD4 = 0x4866
-0x6BD8 = 0x487B
-0x6BDB = 0x4C53
-0x6BDF = 0x5D5B
-0x6BEB = 0x5D5D
-0x6BEC = 0x5D5C
-0x6BEF = 0x5D5F
-0x6BF3 = 0x5D5E
-0x6C08 = 0x5D61
-0x6C0F = 0x3B61
-0x6C11 = 0x4C31
-0x6C13 = 0x5D62
-0x6C14 = 0x5D63
-0x6C17 = 0x3524
-0x6C1B = 0x5D64
-0x6C23 = 0x5D66
-0x6C24 = 0x5D65
-0x6C34 = 0x3F65
-0x6C37 = 0x4939
-0x6C38 = 0x314A
-0x6C3E = 0x4845
-0x6C40 = 0x4475
-0x6C41 = 0x3D41
-0x6C42 = 0x3561
-0x6C4E = 0x4846
-0x6C50 = 0x3C2E
-0x6C55 = 0x5D68
-0x6C57 = 0x3440
-0x6C5A = 0x3178
-0x6C5D = 0x4672
-0x6C5E = 0x5D67
-0x6C5F = 0x393E
-0x6C60 = 0x4353
-0x6C62 = 0x5D69
-0x6C68 = 0x5D71
-0x6C6A = 0x5D6A
-0x6C70 = 0x4241
-0x6C72 = 0x3562
-0x6C73 = 0x5D72
-0x6C7A = 0x3768
-0x6C7D = 0x3525
-0x6C7E = 0x5D70
-0x6C81 = 0x5D6E
-0x6C82 = 0x5D6B
-0x6C83 = 0x4D60
-0x6C88 = 0x4440
-0x6C8C = 0x4659
-0x6C8D = 0x5D6C
-0x6C90 = 0x5D74
-0x6C92 = 0x5D73
-0x6C93 = 0x3723
-0x6C96 = 0x322D
-0x6C99 = 0x3A3B
-0x6C9A = 0x5D6D
-0x6C9B = 0x5D6F
-0x6CA1 = 0x4B57
-0x6CA2 = 0x4274
-0x6CAB = 0x4B77
-0x6CAE = 0x5D7C
-0x6CB1 = 0x5D7D
-0x6CB3 = 0x324F
-0x6CB8 = 0x4A28
-0x6CB9 = 0x4C7D
-0x6CBA = 0x5E21
-0x6CBB = 0x3C23
-0x6CBC = 0x3E42
-0x6CBD = 0x5D78
-0x6CBE = 0x5D7E
-0x6CBF = 0x3168
-0x6CC1 = 0x3637
-0x6CC4 = 0x5D75
-0x6CC5 = 0x5D7A
-0x6CC9 = 0x4074
-0x6CCA = 0x4771
-0x6CCC = 0x4867
-0x6CD3 = 0x5D77
-0x6CD5 = 0x4B21
-0x6CD7 = 0x5D79
-0x6CD9 = 0x5E24
-0x6CDB = 0x5E22
-0x6CDD = 0x5D7B
-0x6CE1 = 0x4B22
-0x6CE2 = 0x4748
-0x6CE3 = 0x3563
-0x6CE5 = 0x4525
-0x6CE8 = 0x436D
-0x6CEA = 0x5E25
-0x6CEF = 0x5E23
-0x6CF0 = 0x4259
-0x6CF1 = 0x5D76
-0x6CF3 = 0x314B
-0x6D0B = 0x4D4E
-0x6D0C = 0x5E30
-0x6D12 = 0x5E2F
-0x6D17 = 0x4076
-0x6D19 = 0x5E2C
-0x6D1B = 0x4D6C
-0x6D1E = 0x4636
-0x6D1F = 0x5E26
-0x6D25 = 0x4445
-0x6D29 = 0x314C
-0x6D2A = 0x393F
-0x6D2B = 0x5E29
-0x6D32 = 0x3D27
-0x6D33 = 0x5E2E
-0x6D35 = 0x5E2D
-0x6D36 = 0x5E28
-0x6D38 = 0x5E2B
-0x6D3B = 0x3368
-0x6D3D = 0x5E2A
-0x6D3E = 0x4749
-0x6D41 = 0x4E2E
-0x6D44 = 0x3E74
-0x6D45 = 0x4075
-0x6D59 = 0x5E36
-0x6D5A = 0x5E34
-0x6D5C = 0x494D
-0x6D63 = 0x5E31
-0x6D64 = 0x5E33
-0x6D66 = 0x313A
-0x6D69 = 0x3940
-0x6D6A = 0x4F32
-0x6D6C = 0x333D
-0x6D6E = 0x4962
-0x6D74 = 0x4D61
-0x6D77 = 0x3324
-0x6D78 = 0x3F3B
-0x6D79 = 0x5E35
-0x6D85 = 0x5E3A
-0x6D88 = 0x3E43
-0x6D8C = 0x4D30
-0x6D8E = 0x5E37
-0x6D93 = 0x5E32
-0x6D95 = 0x5E38
-0x6D99 = 0x4E5E
-0x6D9B = 0x4573
-0x6D9C = 0x4642
-0x6DAF = 0x3336
-0x6DB2 = 0x3155
-0x6DB5 = 0x5E3E
-0x6DB8 = 0x5E41
-0x6DBC = 0x4E43
-0x6DC0 = 0x4D64
-0x6DC5 = 0x5E48
-0x6DC6 = 0x5E42
-0x6DC7 = 0x5E3F
-0x6DCB = 0x4E54
-0x6DCC = 0x5E45
-0x6DD1 = 0x3D4A
-0x6DD2 = 0x5E47
-0x6DD5 = 0x5E4C
-0x6DD8 = 0x4571
-0x6DD9 = 0x5E4A
-0x6DDE = 0x5E44
-0x6DE1 = 0x4338
-0x6DE4 = 0x5E4B
-0x6DE6 = 0x5E40
-0x6DE8 = 0x5E46
-0x6DEA = 0x5E4D
-0x6DEB = 0x307C
-0x6DEC = 0x5E43
-0x6DEE = 0x5E4E
-0x6DF1 = 0x3F3C
-0x6DF3 = 0x3D5F
-0x6DF5 = 0x4A25
-0x6DF7 = 0x3A2E
-0x6DF9 = 0x5E3B
-0x6DFA = 0x5E49
-0x6DFB = 0x453A
-0x6E05 = 0x4036
-0x6E07 = 0x3369
-0x6E08 = 0x3A51
-0x6E09 = 0x3E44
-0x6E0A = 0x5E3D
-0x6E0B = 0x3D42
-0x6E13 = 0x374C
-0x6E15 = 0x5E3C
-0x6E19 = 0x5E52
-0x6E1A = 0x3D6D
-0x6E1B = 0x383A
-0x6E1D = 0x5E61
-0x6E1F = 0x5E5B
-0x6E20 = 0x3574
-0x6E21 = 0x454F
-0x6E23 = 0x5E56
-0x6E24 = 0x5E5F
-0x6E25 = 0x302F
-0x6E26 = 0x3132
-0x6E29 = 0x3239
-0x6E2B = 0x5E58
-0x6E2C = 0x422C
-0x6E2D = 0x5E4F
-0x6E2E = 0x5E51
-0x6E2F = 0x3941
-0x6E38 = 0x5E62
-0x6E3A = 0x5E5D
-0x6E3E = 0x5E55
-0x6E43 = 0x5E5C
-0x6E4A = 0x4C2B
-0x6E4D = 0x5E5A
-0x6E4E = 0x5E5E
-0x6E56 = 0x3850
-0x6E58 = 0x3E45
-0x6E5B = 0x4339
-0x6E5F = 0x5E54
-0x6E67 = 0x4D2F
-0x6E6B = 0x5E57
-0x6E6E = 0x5E50
-0x6E6F = 0x4572
-0x6E72 = 0x5E53
-0x6E76 = 0x5E59
-0x6E7E = 0x4F51
-0x6E7F = 0x3C3E
-0x6E80 = 0x4B7E
-0x6E82 = 0x5E63
-0x6E8C = 0x482E
-0x6E8F = 0x5E6F
-0x6E90 = 0x383B
-0x6E96 = 0x3D60
-0x6E98 = 0x5E65
-0x6E9C = 0x4E2F
-0x6E9D = 0x3942
-0x6E9F = 0x5E72
-0x6EA2 = 0x306E
-0x6EA5 = 0x5E70
-0x6EAA = 0x5E64
-0x6EAF = 0x5E6A
-0x6EB2 = 0x5E6C
-0x6EB6 = 0x4D4F
-0x6EB7 = 0x5E67
-0x6EBA = 0x452E
-0x6EBD = 0x5E69
-0x6EC2 = 0x5E71
-0x6EC4 = 0x5E6B
-0x6EC5 = 0x4C47
-0x6EC9 = 0x5E66
-0x6ECB = 0x3C22
-0x6ECC = 0x5E7E
-0x6ED1 = 0x336A
-0x6ED3 = 0x5E68
-0x6ED4 = 0x5E6D
-0x6ED5 = 0x5E6E
-0x6EDD = 0x426C
-0x6EDE = 0x425A
-0x6EEC = 0x5E76
-0x6EEF = 0x5E7C
-0x6EF2 = 0x5E7A
-0x6EF4 = 0x4529
-0x6EF7 = 0x5F23
-0x6EF8 = 0x5E77
-0x6EFE = 0x5E78
-0x6EFF = 0x5E60
-0x6F01 = 0x3579
-0x6F02 = 0x493A
-0x6F06 = 0x3C3F
-0x6F09 = 0x3977
-0x6F0F = 0x4F33
-0x6F11 = 0x5E74
-0x6F13 = 0x5F22
-0x6F14 = 0x3169
-0x6F15 = 0x4166
-0x6F20 = 0x4779
-0x6F22 = 0x3441
-0x6F23 = 0x4E7A
-0x6F2B = 0x4C21
-0x6F2C = 0x4452
-0x6F31 = 0x5E7B
-0x6F32 = 0x5E7D
-0x6F38 = 0x4132
-0x6F3E = 0x5F21
-0x6F3F = 0x5E79
-0x6F41 = 0x5E73
-0x6F45 = 0x3443
-0x6F54 = 0x3769
-0x6F58 = 0x5F2F
-0x6F5B = 0x5F2A
-0x6F5C = 0x4078
-0x6F5F = 0x3363
-0x6F64 = 0x3D61
-0x6F66 = 0x5F33
-0x6F6D = 0x5F2C
-0x6F6E = 0x442C
-0x6F6F = 0x5F29
-0x6F70 = 0x4459
-0x6F74 = 0x5F4C
-0x6F78 = 0x5F26
-0x6F7A = 0x5F25
-0x6F7C = 0x5F2E
-0x6F80 = 0x5F28
-0x6F81 = 0x5F27
-0x6F82 = 0x5F2D
-0x6F84 = 0x4021
-0x6F86 = 0x5F24
-0x6F8E = 0x5F30
-0x6F91 = 0x5F31
-0x6F97 = 0x3442
-0x6FA1 = 0x5F36
-0x6FA3 = 0x5F35
-0x6FA4 = 0x5F37
-0x6FAA = 0x5F3A
-0x6FB1 = 0x4543
-0x6FB3 = 0x5F34
-0x6FB9 = 0x5F38
-0x6FC0 = 0x3763
-0x6FC1 = 0x4279
-0x6FC2 = 0x5F32
-0x6FC3 = 0x473B
-0x6FC6 = 0x5F39
-0x6FD4 = 0x5F3E
-0x6FD5 = 0x5F3C
-0x6FD8 = 0x5F3F
-0x6FDB = 0x5F42
-0x6FDF = 0x5F3B
-0x6FE0 = 0x396A
-0x6FE1 = 0x4728
-0x6FE4 = 0x5E39
-0x6FEB = 0x4D74
-0x6FEC = 0x5F3D
-0x6FEE = 0x5F41
-0x6FEF = 0x4275
-0x6FF1 = 0x5F40
-0x6FF3 = 0x5F2B
-0x6FF6 = 0x6F69
-0x6FFA = 0x5F45
-0x6FFE = 0x5F49
-0x7001 = 0x5F47
-0x7009 = 0x5F43
-0x700B = 0x5F44
-0x700F = 0x5F48
-0x7011 = 0x5F46
-0x7015 = 0x494E
-0x7018 = 0x5F4E
-0x701A = 0x5F4B
-0x701B = 0x5F4A
-0x701D = 0x5F4D
-0x701E = 0x4654
-0x701F = 0x5F4F
-0x7026 = 0x4375
-0x7027 = 0x426D
-0x702C = 0x4025
-0x7030 = 0x5F50
-0x7032 = 0x5F52
-0x703E = 0x5F51
-0x704C = 0x5E75
-0x7051 = 0x5F53
-0x7058 = 0x4667
-0x7063 = 0x5F54
-0x706B = 0x3250
-0x706F = 0x4574
-0x7070 = 0x3325
-0x7078 = 0x3564
-0x707C = 0x3C5E
-0x707D = 0x3A52
-0x7089 = 0x4F27
-0x708A = 0x3F66
-0x708E = 0x316A
-0x7092 = 0x5F56
-0x7099 = 0x5F55
-0x70AC = 0x5F59
-0x70AD = 0x433A
-0x70AE = 0x5F5C
-0x70AF = 0x5F57
-0x70B3 = 0x5F5B
-0x70B8 = 0x5F5A
-0x70B9 = 0x4540
-0x70BA = 0x3059
-0x70C8 = 0x4E75
-0x70CB = 0x5F5E
-0x70CF = 0x3128
-0x70D9 = 0x5F60
-0x70DD = 0x5F5F
-0x70DF = 0x5F5D
-0x70F1 = 0x5F58
-0x70F9 = 0x4B23
-0x70FD = 0x5F62
-0x7109 = 0x5F61
-0x7114 = 0x316B
-0x7119 = 0x5F64
-0x711A = 0x4A32
-0x711C = 0x5F63
-0x7121 = 0x4C35
-0x7126 = 0x3E47
-0x7136 = 0x4133
-0x713C = 0x3E46
-0x7149 = 0x4E7B
-0x714C = 0x5F6A
-0x714E = 0x4079
-0x7155 = 0x5F66
-0x7156 = 0x5F6B
-0x7159 = 0x316C
-0x7162 = 0x5F69
-0x7164 = 0x4761
-0x7165 = 0x5F65
-0x7166 = 0x5F68
-0x7167 = 0x3E48
-0x7169 = 0x4851
-0x716C = 0x5F6C
-0x716E = 0x3C51
-0x717D = 0x407A
-0x7184 = 0x5F6F
-0x7188 = 0x5F67
-0x718A = 0x3727
-0x718F = 0x5F6D
-0x7194 = 0x4D50
-0x7195 = 0x5F70
-0x7199 = 0x7426
-0x719F = 0x3D4F
-0x71A8 = 0x5F71
-0x71AC = 0x5F72
-0x71B1 = 0x472E
-0x71B9 = 0x5F74
-0x71BE = 0x5F75
-0x71C3 = 0x4733
-0x71C8 = 0x4575
-0x71C9 = 0x5F77
-0x71CE = 0x5F79
-0x71D0 = 0x4E55
-0x71D2 = 0x5F76
-0x71D4 = 0x5F78
-0x71D5 = 0x316D
-0x71D7 = 0x5F73
-0x71DF = 0x535B
-0x71E0 = 0x5F7A
-0x71E5 = 0x4167
-0x71E6 = 0x3B38
-0x71E7 = 0x5F7C
-0x71EC = 0x5F7B
-0x71ED = 0x3F24
-0x71EE = 0x5259
-0x71F5 = 0x5F7D
-0x71F9 = 0x6021
-0x71FB = 0x5F6E
-0x71FC = 0x5F7E
-0x71FF = 0x6022
-0x7206 = 0x477A
-0x720D = 0x6023
-0x7210 = 0x6024
-0x721B = 0x6025
-0x7228 = 0x6026
-0x722A = 0x445E
-0x722C = 0x6028
-0x722D = 0x6027
-0x7230 = 0x6029
-0x7232 = 0x602A
-0x7235 = 0x3C5F
-0x7236 = 0x4963
-0x723A = 0x4C6C
-0x723B = 0x602B
-0x723C = 0x602C
-0x723D = 0x4156
-0x723E = 0x3C24
-0x723F = 0x602D
-0x7240 = 0x602E
-0x7246 = 0x602F
-0x7247 = 0x4A52
-0x7248 = 0x4847
-0x724B = 0x6030
-0x724C = 0x4757
-0x7252 = 0x442D
-0x7258 = 0x6031
-0x7259 = 0x3267
-0x725B = 0x356D
-0x725D = 0x4C46
-0x725F = 0x4C36
-0x7261 = 0x3234
-0x7262 = 0x4F34
-0x7267 = 0x4B52
-0x7269 = 0x4A2A
-0x7272 = 0x4037
-0x7274 = 0x6032
-0x7279 = 0x4643
-0x727D = 0x3823
-0x727E = 0x6033
-0x7280 = 0x3A54
-0x7281 = 0x6035
-0x7282 = 0x6034
-0x7287 = 0x6036
-0x7292 = 0x6037
-0x7296 = 0x6038
-0x72A0 = 0x353E
-0x72A2 = 0x6039
-0x72A7 = 0x603A
-0x72AC = 0x3824
-0x72AF = 0x4848
-0x72B2 = 0x603C
-0x72B6 = 0x3E75
-0x72B9 = 0x603B
-0x72C2 = 0x3638
-0x72C3 = 0x603D
-0x72C4 = 0x603F
-0x72C6 = 0x603E
-0x72CE = 0x6040
-0x72D0 = 0x3851
-0x72D2 = 0x6041
-0x72D7 = 0x3669
-0x72D9 = 0x4140
-0x72DB = 0x397D
-0x72E0 = 0x6043
-0x72E1 = 0x6044
-0x72E2 = 0x6042
-0x72E9 = 0x3C6D
-0x72EC = 0x4648
-0x72ED = 0x3639
-0x72F7 = 0x6046
-0x72F8 = 0x432C
-0x72F9 = 0x6045
-0x72FC = 0x4F35
-0x72FD = 0x4762
-0x730A = 0x6049
-0x7316 = 0x604B
-0x7317 = 0x6048
-0x731B = 0x4C54
-0x731C = 0x604A
-0x731D = 0x604C
-0x731F = 0x4E44
-0x7325 = 0x6050
-0x7329 = 0x604F
-0x732A = 0x4376
-0x732B = 0x472D
-0x732E = 0x3825
-0x732F = 0x604E
-0x7334 = 0x604D
-0x7336 = 0x4D31
-0x7337 = 0x4D32
-0x733E = 0x6051
-0x733F = 0x316E
-0x7344 = 0x3976
-0x7345 = 0x3B62
-0x734E = 0x6052
-0x734F = 0x6053
-0x7357 = 0x6055
-0x7363 = 0x3D43
-0x7368 = 0x6057
-0x736A = 0x6056
-0x7370 = 0x6058
-0x7372 = 0x334D
-0x7375 = 0x605A
-0x7378 = 0x6059
-0x737A = 0x605C
-0x737B = 0x605B
-0x7384 = 0x383C
-0x7387 = 0x4E28
-0x7389 = 0x364C
-0x738B = 0x3226
-0x7396 = 0x366A
-0x73A9 = 0x3461
-0x73B2 = 0x4E68
-0x73B3 = 0x605E
-0x73BB = 0x6060
-0x73C0 = 0x6061
-0x73C2 = 0x3251
-0x73C8 = 0x605D
-0x73CA = 0x3B39
-0x73CD = 0x4441
-0x73CE = 0x605F
-0x73DE = 0x6064
-0x73E0 = 0x3C6E
-0x73E5 = 0x6062
-0x73EA = 0x373E
-0x73ED = 0x4849
-0x73EE = 0x6063
-0x73F1 = 0x607E
-0x73F8 = 0x6069
-0x73FE = 0x383D
-0x7403 = 0x3565
-0x7405 = 0x6066
-0x7406 = 0x4D7D
-0x7409 = 0x4E30
-0x7422 = 0x4276
-0x7425 = 0x6068
-0x7432 = 0x606A
-0x7433 = 0x4E56
-0x7434 = 0x3657
-0x7435 = 0x487C
-0x7436 = 0x474A
-0x743A = 0x606B
-0x743F = 0x606D
-0x7441 = 0x6070
-0x7455 = 0x606C
-0x7459 = 0x606F
-0x745A = 0x386A
-0x745B = 0x314D
-0x745C = 0x6071
-0x745E = 0x3F70
-0x745F = 0x606E
-0x7460 = 0x4E5C
-0x7463 = 0x6074
-0x7464 = 0x7424
-0x7469 = 0x6072
-0x746A = 0x6075
-0x746F = 0x6067
-0x7470 = 0x6073
-0x7473 = 0x3A3C
-0x7476 = 0x6076
-0x747E = 0x6077
-0x7483 = 0x4D7E
-0x748B = 0x6078
-0x749E = 0x6079
-0x74A2 = 0x6065
-0x74A7 = 0x607A
-0x74B0 = 0x3444
-0x74BD = 0x3C25
-0x74CA = 0x607B
-0x74CF = 0x607C
-0x74D4 = 0x607D
-0x74DC = 0x313B
-0x74E0 = 0x6121
-0x74E2 = 0x493B
-0x74E3 = 0x6122
-0x74E6 = 0x3424
-0x74E7 = 0x6123
-0x74E9 = 0x6124
-0x74EE = 0x6125
-0x74F0 = 0x6127
-0x74F1 = 0x6128
-0x74F2 = 0x6126
-0x74F6 = 0x4953
-0x74F7 = 0x612A
-0x74F8 = 0x6129
-0x7503 = 0x612C
-0x7504 = 0x612B
-0x7505 = 0x612D
-0x750C = 0x612E
-0x750D = 0x6130
-0x750E = 0x612F
-0x7511 = 0x3979
-0x7513 = 0x6132
-0x7515 = 0x6131
-0x7518 = 0x3445
-0x751A = 0x3F53
-0x751C = 0x453C
-0x751E = 0x6133
-0x751F = 0x4038
-0x7523 = 0x3B3A
-0x7525 = 0x3179
-0x7526 = 0x6134
-0x7528 = 0x4D51
-0x752B = 0x4A63
-0x752C = 0x6135
-0x7530 = 0x4544
-0x7531 = 0x4D33
-0x7532 = 0x3943
-0x7533 = 0x3F3D
-0x7537 = 0x434B
-0x7538 = 0x5234
-0x753A = 0x442E
-0x753B = 0x3268
-0x753C = 0x6136
-0x7544 = 0x6137
-0x7546 = 0x613C
-0x7549 = 0x613A
-0x754A = 0x6139
-0x754B = 0x5A42
-0x754C = 0x3326
-0x754D = 0x6138
-0x754F = 0x305A
-0x7551 = 0x482A
-0x7554 = 0x484A
-0x7559 = 0x4E31
-0x755A = 0x613D
-0x755B = 0x613B
-0x755C = 0x435C
-0x755D = 0x4026
-0x7560 = 0x482B
-0x7562 = 0x492D
-0x7564 = 0x613F
-0x7565 = 0x4E2C
-0x7566 = 0x374D
-0x7567 = 0x6140
-0x7569 = 0x613E
-0x756A = 0x4856
-0x756B = 0x6141
-0x756D = 0x6142
-0x7570 = 0x305B
-0x7573 = 0x3E76
-0x7574 = 0x6147
-0x7576 = 0x6144
-0x7577 = 0x466D
-0x7578 = 0x6143
-0x757F = 0x3526
-0x7582 = 0x614A
-0x7586 = 0x6145
-0x7587 = 0x6146
-0x7589 = 0x6149
-0x758A = 0x6148
-0x758B = 0x4925
-0x758E = 0x4142
-0x758F = 0x4141
-0x7591 = 0x353F
-0x7594 = 0x614B
-0x759A = 0x614C
-0x759D = 0x614D
-0x75A3 = 0x614F
-0x75A5 = 0x614E
-0x75AB = 0x3156
-0x75B1 = 0x6157
-0x75B2 = 0x4868
-0x75B3 = 0x6151
-0x75B5 = 0x6153
-0x75B8 = 0x6155
-0x75B9 = 0x3F3E
-0x75BC = 0x6156
-0x75BD = 0x6154
-0x75BE = 0x3C40
-0x75C2 = 0x6150
-0x75C3 = 0x6152
-0x75C5 = 0x4942
-0x75C7 = 0x3E49
-0x75CA = 0x6159
-0x75CD = 0x6158
-0x75D2 = 0x615A
-0x75D4 = 0x3C26
-0x75D5 = 0x3A2F
-0x75D8 = 0x4577
-0x75D9 = 0x615B
-0x75DB = 0x444B
-0x75DE = 0x615D
-0x75E2 = 0x4E21
-0x75E3 = 0x615C
-0x75E9 = 0x4169
-0x75F0 = 0x6162
-0x75F2 = 0x6164
-0x75F3 = 0x6165
-0x75F4 = 0x4354
-0x75FA = 0x6163
-0x75FC = 0x6160
-0x75FE = 0x615E
-0x75FF = 0x615F
-0x7601 = 0x6161
-0x7609 = 0x6168
-0x760B = 0x6166
-0x760D = 0x6167
-0x761F = 0x6169
-0x7620 = 0x616B
-0x7621 = 0x616C
-0x7622 = 0x616D
-0x7624 = 0x616E
-0x7627 = 0x616A
-0x7630 = 0x6170
-0x7634 = 0x616F
-0x763B = 0x6171
-0x7642 = 0x4E45
-0x7646 = 0x6174
-0x7647 = 0x6172
-0x7648 = 0x6173
-0x764C = 0x3462
-0x7652 = 0x4C7E
-0x7656 = 0x4A4A
-0x7658 = 0x6176
-0x765C = 0x6175
-0x7661 = 0x6177
-0x7662 = 0x6178
-0x7667 = 0x617C
-0x7668 = 0x6179
-0x7669 = 0x617A
-0x766A = 0x617B
-0x766C = 0x617D
-0x7670 = 0x617E
-0x7672 = 0x6221
-0x7676 = 0x6222
-0x7678 = 0x6223
-0x767A = 0x482F
-0x767B = 0x4550
-0x767C = 0x6224
-0x767D = 0x4772
-0x767E = 0x4934
-0x7680 = 0x6225
-0x7683 = 0x6226
-0x7684 = 0x452A
-0x7686 = 0x3327
-0x7687 = 0x3944
-0x7688 = 0x6227
-0x768B = 0x6228
-0x768E = 0x6229
-0x7690 = 0x3B29
-0x7693 = 0x622B
-0x7696 = 0x622A
-0x7699 = 0x622C
-0x769A = 0x622D
-0x76AE = 0x4869
-0x76B0 = 0x622E
-0x76B4 = 0x622F
-0x76B7 = 0x7369
-0x76B8 = 0x6230
-0x76B9 = 0x6231
-0x76BA = 0x6232
-0x76BF = 0x3B2E
-0x76C2 = 0x6233
-0x76C3 = 0x4756
-0x76C6 = 0x4B5F
-0x76C8 = 0x314E
-0x76CA = 0x3157
-0x76CD = 0x6234
-0x76D2 = 0x6236
-0x76D6 = 0x6235
-0x76D7 = 0x4570
-0x76DB = 0x4039
-0x76DC = 0x5D39
-0x76DE = 0x6237
-0x76DF = 0x4C41
-0x76E1 = 0x6238
-0x76E3 = 0x3446
-0x76E4 = 0x4857
-0x76E5 = 0x6239
-0x76E7 = 0x623A
-0x76EA = 0x623B
-0x76EE = 0x4C5C
-0x76F2 = 0x4C55
-0x76F4 = 0x443E
-0x76F8 = 0x416A
-0x76FB = 0x623D
-0x76FE = 0x3D62
-0x7701 = 0x3E4A
-0x7704 = 0x6240
-0x7707 = 0x623F
-0x7708 = 0x623E
-0x7709 = 0x487D
-0x770B = 0x3447
-0x770C = 0x3829
-0x771B = 0x6246
-0x771E = 0x6243
-0x771F = 0x3F3F
-0x7720 = 0x4C32
-0x7724 = 0x6242
-0x7725 = 0x6244
-0x7726 = 0x6245
-0x7729 = 0x6241
-0x7737 = 0x6247
-0x7738 = 0x6248
-0x773A = 0x442F
-0x773C = 0x3463
-0x7740 = 0x4365
-0x7747 = 0x6249
-0x775A = 0x624A
-0x775B = 0x624D
-0x7761 = 0x3F67
-0x7763 = 0x4644
-0x7765 = 0x624E
-0x7766 = 0x4B53
-0x7768 = 0x624B
-0x776B = 0x624C
-0x7779 = 0x6251
-0x777E = 0x6250
-0x777F = 0x624F
-0x778B = 0x6253
-0x778E = 0x6252
-0x7791 = 0x6254
-0x779E = 0x6256
-0x77A0 = 0x6255
-0x77A5 = 0x4A4D
-0x77AC = 0x3D56
-0x77AD = 0x4E46
-0x77B0 = 0x6257
-0x77B3 = 0x4637
-0x77B6 = 0x6258
-0x77B9 = 0x6259
-0x77BB = 0x625D
-0x77BC = 0x625B
-0x77BD = 0x625C
-0x77BF = 0x625A
-0x77C7 = 0x625E
-0x77CD = 0x625F
-0x77D7 = 0x6260
-0x77DA = 0x6261
-0x77DB = 0x4C37
-0x77DC = 0x6262
-0x77E2 = 0x4C70
-0x77E3 = 0x6263
-0x77E5 = 0x434E
-0x77E7 = 0x476A
-0x77E9 = 0x366B
-0x77ED = 0x433B
-0x77EE = 0x6264
-0x77EF = 0x363A
-0x77F3 = 0x4050
-0x77FC = 0x6265
-0x7802 = 0x3A3D
-0x780C = 0x6266
-0x7812 = 0x6267
-0x7814 = 0x3826
-0x7815 = 0x3A55
-0x7820 = 0x6269
-0x7825 = 0x4556
-0x7826 = 0x3A56
-0x7827 = 0x354E
-0x7832 = 0x4B24
-0x7834 = 0x474B
-0x783A = 0x4557
-0x783F = 0x395C
-0x7845 = 0x626B
-0x785D = 0x3E4B
-0x786B = 0x4E32
-0x786C = 0x3945
-0x786F = 0x3827
-0x7872 = 0x4823
-0x7874 = 0x626D
-0x787C = 0x626F
-0x7881 = 0x386B
-0x7886 = 0x626E
-0x7887 = 0x4476
-0x788C = 0x6271
-0x788D = 0x3337
-0x788E = 0x626C
-0x7891 = 0x486A
-0x7893 = 0x3130
-0x7895 = 0x3A6C
-0x7897 = 0x4F52
-0x789A = 0x6270
-0x78A3 = 0x6272
-0x78A7 = 0x4A4B
-0x78A9 = 0x4059
-0x78AA = 0x6274
-0x78AF = 0x6275
-0x78B5 = 0x6273
-0x78BA = 0x334E
-0x78BC = 0x627B
-0x78BE = 0x627A
-0x78C1 = 0x3C27
-0x78C5 = 0x627C
-0x78C6 = 0x6277
-0x78CA = 0x627D
-0x78CB = 0x6278
-0x78D0 = 0x4858
-0x78D1 = 0x6276
-0x78D4 = 0x6279
-0x78DA = 0x6322
-0x78E7 = 0x6321
-0x78E8 = 0x4B61
-0x78EC = 0x627E
-0x78EF = 0x306B
-0x78F4 = 0x6324
-0x78FD = 0x6323
-0x7901 = 0x3E4C
-0x7907 = 0x6325
-0x790E = 0x4143
-0x7911 = 0x6327
-0x7912 = 0x6326
-0x7919 = 0x6328
-0x7926 = 0x6268
-0x792A = 0x626A
-0x792B = 0x632A
-0x792C = 0x6329
-0x793A = 0x3C28
-0x793C = 0x4E69
-0x793E = 0x3C52
-0x7940 = 0x632B
-0x7941 = 0x3737
-0x7947 = 0x3540
-0x7948 = 0x3527
-0x7949 = 0x3B63
-0x7950 = 0x4D34
-0x7953 = 0x6331
-0x7955 = 0x6330
-0x7956 = 0x4144
-0x7957 = 0x632D
-0x795A = 0x632F
-0x795D = 0x3D4B
-0x795E = 0x3F40
-0x795F = 0x632E
-0x7960 = 0x632C
-0x7962 = 0x472A
-0x7965 = 0x3E4D
-0x7968 = 0x493C
-0x796D = 0x3A57
-0x7977 = 0x4578
-0x797A = 0x6332
-0x797F = 0x6333
-0x7980 = 0x6349
-0x7981 = 0x3658
-0x7984 = 0x4F3D
-0x7985 = 0x4135
-0x798A = 0x6334
-0x798D = 0x3252
-0x798E = 0x4477
-0x798F = 0x4A21
-0x799D = 0x6335
-0x79A6 = 0x357A
-0x79A7 = 0x6336
-0x79AA = 0x6338
-0x79AE = 0x6339
-0x79B0 = 0x4729
-0x79B3 = 0x633A
-0x79B9 = 0x633B
-0x79BA = 0x633C
-0x79BD = 0x3659
-0x79BE = 0x3253
-0x79BF = 0x4645
-0x79C0 = 0x3D28
-0x79C1 = 0x3B64
-0x79C9 = 0x633D
-0x79CB = 0x3D29
-0x79D1 = 0x324A
-0x79D2 = 0x4943
-0x79D5 = 0x633E
-0x79D8 = 0x486B
-0x79DF = 0x4145
-0x79E1 = 0x6341
-0x79E3 = 0x6342
-0x79E4 = 0x4769
-0x79E6 = 0x3F41
-0x79E7 = 0x633F
-0x79E9 = 0x4361
-0x79EC = 0x6340
-0x79F0 = 0x3E4E
-0x79FB = 0x305C
-0x7A00 = 0x3529
-0x7A08 = 0x6343
-0x7A0B = 0x4478
-0x7A0D = 0x6344
-0x7A0E = 0x4047
-0x7A14 = 0x4C2D
-0x7A17 = 0x4923
-0x7A18 = 0x6345
-0x7A19 = 0x6346
-0x7A1A = 0x4355
-0x7A1C = 0x4E47
-0x7A1F = 0x6348
-0x7A20 = 0x6347
-0x7A2E = 0x3C6F
-0x7A31 = 0x634A
-0x7A32 = 0x3070
-0x7A37 = 0x634D
-0x7A3B = 0x634B
-0x7A3C = 0x3254
-0x7A3D = 0x374E
-0x7A3E = 0x634C
-0x7A3F = 0x3946
-0x7A40 = 0x3972
-0x7A42 = 0x4A66
-0x7A43 = 0x634E
-0x7A46 = 0x4B54
-0x7A49 = 0x6350
-0x7A4D = 0x4051
-0x7A4E = 0x314F
-0x7A4F = 0x323A
-0x7A50 = 0x302C
-0x7A57 = 0x634F
-0x7A61 = 0x6351
-0x7A62 = 0x6352
-0x7A63 = 0x3E77
-0x7A69 = 0x6353
-0x7A6B = 0x334F
-0x7A70 = 0x6355
-0x7A74 = 0x376A
-0x7A76 = 0x3566
-0x7A79 = 0x6356
-0x7A7A = 0x3675
-0x7A7D = 0x6357
-0x7A7F = 0x407C
-0x7A81 = 0x464D
-0x7A83 = 0x4060
-0x7A84 = 0x3A75
-0x7A88 = 0x6358
-0x7A92 = 0x4362
-0x7A93 = 0x416B
-0x7A95 = 0x635A
-0x7A96 = 0x635C
-0x7A97 = 0x6359
-0x7A98 = 0x635B
-0x7A9F = 0x3722
-0x7AA9 = 0x635D
-0x7AAA = 0x3726
-0x7AAE = 0x3567
-0x7AAF = 0x4D52
-0x7AB0 = 0x635F
-0x7AB6 = 0x6360
-0x7ABA = 0x312E
-0x7ABF = 0x6363
-0x7AC3 = 0x3376
-0x7AC4 = 0x6362
-0x7AC5 = 0x6361
-0x7AC7 = 0x6365
-0x7AC8 = 0x635E
-0x7ACA = 0x6366
-0x7ACB = 0x4E29
-0x7ACD = 0x6367
-0x7ACF = 0x6368
-0x7AD2 = 0x5474
-0x7AD3 = 0x636A
-0x7AD5 = 0x6369
-0x7AD9 = 0x636B
-0x7ADA = 0x636C
-0x7ADC = 0x4E35
-0x7ADD = 0x636D
-0x7ADF = 0x706F
-0x7AE0 = 0x3E4F
-0x7AE1 = 0x636E
-0x7AE2 = 0x636F
-0x7AE3 = 0x3D57
-0x7AE5 = 0x4638
-0x7AE6 = 0x6370
-0x7AEA = 0x4328
-0x7AED = 0x6371
-0x7AEF = 0x433C
-0x7AF0 = 0x6372
-0x7AF6 = 0x3625
-0x7AF8 = 0x513F
-0x7AF9 = 0x435D
-0x7AFA = 0x3C33
-0x7AFF = 0x3448
-0x7B02 = 0x6373
-0x7B04 = 0x6422
-0x7B06 = 0x6376
-0x7B08 = 0x3568
-0x7B0A = 0x6375
-0x7B0B = 0x6424
-0x7B0F = 0x6374
-0x7B11 = 0x3E50
-0x7B18 = 0x6378
-0x7B19 = 0x6379
-0x7B1B = 0x452B
-0x7B1E = 0x637A
-0x7B20 = 0x335E
-0x7B25 = 0x3F5A
-0x7B26 = 0x4964
-0x7B28 = 0x637C
-0x7B2C = 0x4268
-0x7B33 = 0x6377
-0x7B35 = 0x637B
-0x7B36 = 0x637D
-0x7B39 = 0x3A7B
-0x7B45 = 0x6426
-0x7B46 = 0x492E
-0x7B48 = 0x4826
-0x7B49 = 0x4579
-0x7B4B = 0x365A
-0x7B4C = 0x6425
-0x7B4D = 0x6423
-0x7B4F = 0x4835
-0x7B50 = 0x637E
-0x7B51 = 0x435E
-0x7B52 = 0x457B
-0x7B54 = 0x457A
-0x7B56 = 0x3A76
-0x7B5D = 0x6438
-0x7B65 = 0x6428
-0x7B67 = 0x642A
-0x7B6C = 0x642D
-0x7B6E = 0x642E
-0x7B70 = 0x642B
-0x7B71 = 0x642C
-0x7B74 = 0x6429
-0x7B75 = 0x6427
-0x7B7A = 0x6421
-0x7B86 = 0x4A4F
-0x7B87 = 0x3255
-0x7B8B = 0x6435
-0x7B8D = 0x6432
-0x7B8F = 0x6437
-0x7B92 = 0x6436
-0x7B94 = 0x4773
-0x7B95 = 0x4C27
-0x7B97 = 0x3B3B
-0x7B98 = 0x6430
-0x7B99 = 0x6439
-0x7B9A = 0x6434
-0x7B9C = 0x6433
-0x7B9D = 0x642F
-0x7B9F = 0x6431
-0x7BA1 = 0x3449
-0x7BAA = 0x433D
-0x7BAD = 0x407D
-0x7BB1 = 0x4822
-0x7BB4 = 0x643E
-0x7BB8 = 0x4824
-0x7BC0 = 0x4061
-0x7BC1 = 0x643B
-0x7BC4 = 0x484F
-0x7BC6 = 0x643F
-0x7BC7 = 0x4A53
-0x7BC9 = 0x435B
-0x7BCB = 0x643A
-0x7BCC = 0x643C
-0x7BCF = 0x643D
-0x7BDD = 0x6440
-0x7BE0 = 0x3C44
-0x7BE4 = 0x4646
-0x7BE5 = 0x6445
-0x7BE6 = 0x6444
-0x7BE9 = 0x6441
-0x7BED = 0x4F36
-0x7BF3 = 0x644A
-0x7BF6 = 0x644E
-0x7BF7 = 0x644B
-0x7C00 = 0x6447
-0x7C07 = 0x6448
-0x7C0D = 0x644D
-0x7C11 = 0x6442
-0x7C12 = 0x5255
-0x7C13 = 0x6449
-0x7C14 = 0x6443
-0x7C17 = 0x644C
-0x7C1F = 0x6452
-0x7C21 = 0x344A
-0x7C23 = 0x644F
-0x7C27 = 0x6450
-0x7C2A = 0x6451
-0x7C2B = 0x6454
-0x7C37 = 0x6453
-0x7C38 = 0x4876
-0x7C3D = 0x6455
-0x7C3E = 0x4E7C
-0x7C3F = 0x4A6D
-0x7C40 = 0x645A
-0x7C43 = 0x6457
-0x7C4C = 0x6456
-0x7C4D = 0x4052
-0x7C4F = 0x6459
-0x7C50 = 0x645B
-0x7C54 = 0x6458
-0x7C56 = 0x645F
-0x7C58 = 0x645C
-0x7C5F = 0x645D
-0x7C60 = 0x6446
-0x7C64 = 0x645E
-0x7C65 = 0x6460
-0x7C6C = 0x6461
-0x7C73 = 0x4A46
-0x7C75 = 0x6462
-0x7C7E = 0x4C62
-0x7C81 = 0x364E
-0x7C82 = 0x3729
-0x7C83 = 0x6463
-0x7C89 = 0x4A34
-0x7C8B = 0x3F68
-0x7C8D = 0x4C30
-0x7C90 = 0x6464
-0x7C92 = 0x4E33
-0x7C95 = 0x4774
-0x7C97 = 0x4146
-0x7C98 = 0x4734
-0x7C9B = 0x3D4D
-0x7C9F = 0x3040
-0x7CA1 = 0x6469
-0x7CA2 = 0x6467
-0x7CA4 = 0x6465
-0x7CA5 = 0x3421
-0x7CA7 = 0x3E51
-0x7CA8 = 0x646A
-0x7CAB = 0x6468
-0x7CAD = 0x6466
-0x7CAE = 0x646E
-0x7CB1 = 0x646D
-0x7CB2 = 0x646C
-0x7CB3 = 0x646B
-0x7CB9 = 0x646F
-0x7CBD = 0x6470
-0x7CBE = 0x403A
-0x7CC0 = 0x6471
-0x7CC2 = 0x6473
-0x7CC5 = 0x6472
-0x7CCA = 0x3852
-0x7CCE = 0x4138
-0x7CD2 = 0x6475
-0x7CD6 = 0x457C
-0x7CD8 = 0x6474
-0x7CDC = 0x6476
-0x7CDE = 0x4A35
-0x7CDF = 0x416C
-0x7CE0 = 0x3947
-0x7CE2 = 0x6477
-0x7CE7 = 0x4E48
-0x7CEF = 0x6479
-0x7CF2 = 0x647A
-0x7CF4 = 0x647B
-0x7CF6 = 0x647C
-0x7CF8 = 0x3B65
-0x7CFA = 0x647D
-0x7CFB = 0x374F
-0x7CFE = 0x356A
-0x7D00 = 0x352A
-0x7D02 = 0x6521
-0x7D04 = 0x4C73
-0x7D05 = 0x3948
-0x7D06 = 0x647E
-0x7D0A = 0x6524
-0x7D0B = 0x4C66
-0x7D0D = 0x473C
-0x7D10 = 0x4933
-0x7D14 = 0x3D63
-0x7D15 = 0x6523
-0x7D17 = 0x3C53
-0x7D18 = 0x3949
-0x7D19 = 0x3B66
-0x7D1A = 0x3569
-0x7D1B = 0x4A36
-0x7D1C = 0x6522
-0x7D20 = 0x4147
-0x7D21 = 0x4B42
-0x7D22 = 0x3A77
-0x7D2B = 0x3B67
-0x7D2C = 0x445D
-0x7D2E = 0x6527
-0x7D2F = 0x4E5F
-0x7D30 = 0x3A59
-0x7D32 = 0x6528
-0x7D33 = 0x3F42
-0x7D35 = 0x652A
-0x7D39 = 0x3E52
-0x7D3A = 0x3A30
-0x7D3F = 0x6529
-0x7D42 = 0x3D2A
-0x7D43 = 0x383E
-0x7D44 = 0x4148
-0x7D45 = 0x6525
-0x7D46 = 0x652B
-0x7D4B = 0x6526
-0x7D4C = 0x3750
-0x7D4E = 0x652E
-0x7D4F = 0x6532
-0x7D50 = 0x376B
-0x7D56 = 0x652D
-0x7D5B = 0x6536
-0x7D5E = 0x394A
-0x7D61 = 0x4D6D
-0x7D62 = 0x303C
-0x7D63 = 0x6533
-0x7D66 = 0x356B
-0x7D68 = 0x6530
-0x7D6E = 0x6531
-0x7D71 = 0x457D
-0x7D72 = 0x652F
-0x7D73 = 0x652C
-0x7D75 = 0x3328
-0x7D76 = 0x4064
-0x7D79 = 0x3828
-0x7D7D = 0x6538
-0x7D89 = 0x6535
-0x7D8F = 0x6537
-0x7D93 = 0x6534
-0x7D99 = 0x3751
-0x7D9A = 0x4233
-0x7D9B = 0x6539
-0x7D9C = 0x416E
-0x7D9F = 0x6546
-0x7DA2 = 0x6542
-0x7DA3 = 0x653C
-0x7DAB = 0x6540
-0x7DAC = 0x3C7A
-0x7DAD = 0x305D
-0x7DAE = 0x653B
-0x7DAF = 0x6543
-0x7DB0 = 0x6547
-0x7DB1 = 0x394B
-0x7DB2 = 0x4C56
-0x7DB4 = 0x4456
-0x7DB5 = 0x653D
-0x7DB8 = 0x6545
-0x7DBA = 0x653A
-0x7DBB = 0x433E
-0x7DBD = 0x653F
-0x7DBE = 0x303D
-0x7DBF = 0x4C4A
-0x7DC7 = 0x653E
-0x7DCA = 0x365B
-0x7DCB = 0x486C
-0x7DCF = 0x416D
-0x7DD1 = 0x4E50
-0x7DD2 = 0x3D6F
-0x7DD5 = 0x656E
-0x7DD8 = 0x6548
-0x7DDA = 0x407E
-0x7DDC = 0x6544
-0x7DDD = 0x6549
-0x7DDE = 0x654B
-0x7DE0 = 0x4479
-0x7DE1 = 0x654E
-0x7DE4 = 0x654A
-0x7DE8 = 0x4A54
-0x7DE9 = 0x344B
-0x7DEC = 0x4C4B
-0x7DEF = 0x305E
-0x7DF2 = 0x654D
-0x7DF4 = 0x4E7D
-0x7DFB = 0x654C
-0x7E01 = 0x316F
-0x7E04 = 0x466C
-0x7E05 = 0x654F
-0x7E09 = 0x6556
-0x7E0A = 0x6550
-0x7E0B = 0x6557
-0x7E12 = 0x6553
-0x7E1B = 0x477B
-0x7E1E = 0x3C4A
-0x7E1F = 0x6555
-0x7E21 = 0x6552
-0x7E22 = 0x6558
-0x7E23 = 0x6551
-0x7E26 = 0x3D44
-0x7E2B = 0x4B25
-0x7E2E = 0x3D4C
-0x7E31 = 0x6554
-0x7E32 = 0x6560
-0x7E35 = 0x655C
-0x7E37 = 0x655F
-0x7E39 = 0x655D
-0x7E3A = 0x6561
-0x7E3B = 0x655B
-0x7E3D = 0x6541
-0x7E3E = 0x4053
-0x7E41 = 0x484B
-0x7E43 = 0x655E
-0x7E46 = 0x6559
-0x7E4A = 0x4121
-0x7E4B = 0x3752
-0x7E4D = 0x3D2B
-0x7E54 = 0x3F25
-0x7E55 = 0x4136
-0x7E56 = 0x6564
-0x7E59 = 0x6566
-0x7E5A = 0x6567
-0x7E5D = 0x6563
-0x7E5E = 0x6565
-0x7E66 = 0x655A
-0x7E67 = 0x6562
-0x7E69 = 0x656A
-0x7E6A = 0x6569
-0x7E6D = 0x4B7A
-0x7E70 = 0x372B
-0x7E79 = 0x6568
-0x7E7B = 0x656C
-0x7E7C = 0x656B
-0x7E7D = 0x656F
-0x7E7F = 0x6571
-0x7E82 = 0x3B3C
-0x7E83 = 0x656D
-0x7E88 = 0x6572
-0x7E89 = 0x6573
-0x7E8C = 0x6574
-0x7E8E = 0x657A
-0x7E8F = 0x453B
-0x7E90 = 0x6576
-0x7E92 = 0x6575
-0x7E93 = 0x6577
-0x7E94 = 0x6578
-0x7E96 = 0x6579
-0x7E9B = 0x657B
-0x7E9C = 0x657C
-0x7F36 = 0x344C
-0x7F38 = 0x657D
-0x7F3A = 0x657E
-0x7F45 = 0x6621
-0x7F4C = 0x6622
-0x7F4D = 0x6623
-0x7F4E = 0x6624
-0x7F50 = 0x6625
-0x7F51 = 0x6626
-0x7F54 = 0x6628
-0x7F55 = 0x6627
-0x7F58 = 0x6629
-0x7F5F = 0x662A
-0x7F60 = 0x662B
-0x7F67 = 0x662E
-0x7F68 = 0x662C
-0x7F69 = 0x662D
-0x7F6A = 0x3A61
-0x7F6B = 0x3753
-0x7F6E = 0x4356
-0x7F70 = 0x4833
-0x7F72 = 0x3D70
-0x7F75 = 0x474D
-0x7F77 = 0x486D
-0x7F78 = 0x662F
-0x7F79 = 0x586D
-0x7F82 = 0x6630
-0x7F83 = 0x6632
-0x7F85 = 0x4D65
-0x7F86 = 0x6631
-0x7F87 = 0x6634
-0x7F88 = 0x6633
-0x7F8A = 0x4D53
-0x7F8C = 0x6635
-0x7F8E = 0x487E
-0x7F94 = 0x6636
-0x7F9A = 0x6639
-0x7F9D = 0x6638
-0x7F9E = 0x6637
-0x7FA3 = 0x663A
-0x7FA4 = 0x3732
-0x7FA8 = 0x4122
-0x7FA9 = 0x3541
-0x7FAE = 0x663E
-0x7FAF = 0x663B
-0x7FB2 = 0x663C
-0x7FB6 = 0x663F
-0x7FB8 = 0x6640
-0x7FB9 = 0x663D
-0x7FBD = 0x3129
-0x7FC1 = 0x3227
-0x7FC5 = 0x6642
-0x7FC6 = 0x6643
-0x7FCA = 0x6644
-0x7FCC = 0x4D62
-0x7FD2 = 0x3D2C
-0x7FD4 = 0x6646
-0x7FD5 = 0x6645
-0x7FE0 = 0x3F69
-0x7FE1 = 0x6647
-0x7FE6 = 0x6648
-0x7FE9 = 0x6649
-0x7FEB = 0x3465
-0x7FF0 = 0x344D
-0x7FF3 = 0x664A
-0x7FF9 = 0x664B
-0x7FFB = 0x4B5D
-0x7FFC = 0x4D63
-0x8000 = 0x4D54
-0x8001 = 0x4F37
-0x8003 = 0x394D
-0x8004 = 0x664E
-0x8005 = 0x3C54
-0x8006 = 0x664D
-0x800B = 0x664F
-0x800C = 0x3C29
-0x8010 = 0x4251
-0x8012 = 0x6650
-0x8015 = 0x394C
-0x8017 = 0x4C57
-0x8018 = 0x6651
-0x8019 = 0x6652
-0x801C = 0x6653
-0x8021 = 0x6654
-0x8028 = 0x6655
-0x8033 = 0x3C2A
-0x8036 = 0x4C6D
-0x803B = 0x6657
-0x803D = 0x433F
-0x803F = 0x6656
-0x8046 = 0x6659
-0x804A = 0x6658
-0x8052 = 0x665A
-0x8056 = 0x403B
-0x8058 = 0x665B
-0x805A = 0x665C
-0x805E = 0x4A39
-0x805F = 0x665D
-0x8061 = 0x416F
-0x8062 = 0x665E
-0x8068 = 0x665F
-0x806F = 0x4E7E
-0x8070 = 0x6662
-0x8072 = 0x6661
-0x8073 = 0x6660
-0x8074 = 0x4430
-0x8076 = 0x6663
-0x8077 = 0x3F26
-0x8079 = 0x6664
-0x807D = 0x6665
-0x807E = 0x4F38
-0x807F = 0x6666
-0x8084 = 0x6667
-0x8085 = 0x6669
-0x8086 = 0x6668
-0x8087 = 0x4825
-0x8089 = 0x4679
-0x808B = 0x4F3E
-0x808C = 0x4829
-0x8093 = 0x666B
-0x8096 = 0x3E53
-0x8098 = 0x492A
-0x809A = 0x666C
-0x809B = 0x666A
-0x809D = 0x344E
-0x80A1 = 0x3854
-0x80A2 = 0x3B68
-0x80A5 = 0x486E
-0x80A9 = 0x382A
-0x80AA = 0x4B43
-0x80AC = 0x666F
-0x80AD = 0x666D
-0x80AF = 0x394E
-0x80B1 = 0x394F
-0x80B2 = 0x3069
-0x80B4 = 0x3A68
-0x80BA = 0x4759
-0x80C3 = 0x305F
-0x80C4 = 0x6674
-0x80C6 = 0x4340
-0x80CC = 0x4758
-0x80CE = 0x425B
-0x80D6 = 0x6676
-0x80D9 = 0x6672
-0x80DA = 0x6675
-0x80DB = 0x6670
-0x80DD = 0x6673
-0x80DE = 0x4B26
-0x80E1 = 0x3855
-0x80E4 = 0x307D
-0x80E5 = 0x6671
-0x80EF = 0x6678
-0x80F1 = 0x6679
-0x80F4 = 0x4639
-0x80F8 = 0x363B
-0x80FC = 0x6726
-0x80FD = 0x473D
-0x8102 = 0x3B69
-0x8105 = 0x363C
-0x8106 = 0x4048
-0x8107 = 0x4F46
-0x8108 = 0x4C2E
-0x8109 = 0x6677
-0x810A = 0x4054
-0x811A = 0x3553
-0x811B = 0x667A
-0x8123 = 0x667C
-0x8129 = 0x667B
-0x812F = 0x667D
-0x8131 = 0x4326
-0x8133 = 0x473E
-0x8139 = 0x4431
-0x813E = 0x6723
-0x8146 = 0x6722
-0x814B = 0x667E
-0x814E = 0x3F55
-0x8150 = 0x4965
-0x8151 = 0x6725
-0x8153 = 0x6724
-0x8154 = 0x3950
-0x8155 = 0x4F53
-0x815F = 0x6735
-0x8165 = 0x6729
-0x8166 = 0x672A
-0x816B = 0x3C70
-0x816E = 0x6728
-0x8170 = 0x3978
-0x8171 = 0x6727
-0x8174 = 0x672B
-0x8178 = 0x4432
-0x8179 = 0x4A22
-0x817A = 0x4123
-0x817F = 0x425C
-0x8180 = 0x672F
-0x8182 = 0x6730
-0x8183 = 0x672C
-0x8188 = 0x672D
-0x818A = 0x672E
-0x818F = 0x3951
-0x8193 = 0x6736
-0x8195 = 0x6732
-0x819A = 0x4966
-0x819C = 0x4B6C
-0x819D = 0x4928
-0x81A0 = 0x6731
-0x81A3 = 0x6734
-0x81A4 = 0x6733
-0x81A8 = 0x4B44
-0x81A9 = 0x6737
-0x81B0 = 0x6738
-0x81B3 = 0x4137
-0x81B5 = 0x6739
-0x81B8 = 0x673B
-0x81BA = 0x673F
-0x81BD = 0x673C
-0x81BE = 0x673A
-0x81BF = 0x473F
-0x81C0 = 0x673D
-0x81C2 = 0x673E
-0x81C6 = 0x3232
-0x81C8 = 0x6745
-0x81C9 = 0x6740
-0x81CD = 0x6741
-0x81D1 = 0x6742
-0x81D3 = 0x4221
-0x81D8 = 0x6744
-0x81D9 = 0x6743
-0x81DA = 0x6746
-0x81DF = 0x6747
-0x81E0 = 0x6748
-0x81E3 = 0x3F43
-0x81E5 = 0x3269
-0x81E7 = 0x6749
-0x81E8 = 0x4E57
-0x81EA = 0x3C2B
-0x81ED = 0x3D2D
-0x81F3 = 0x3B6A
-0x81F4 = 0x4357
-0x81FA = 0x674A
-0x81FB = 0x674B
-0x81FC = 0x3131
-0x81FE = 0x674C
-0x8201 = 0x674D
-0x8202 = 0x674E
-0x8205 = 0x674F
-0x8207 = 0x6750
-0x8208 = 0x363D
-0x8209 = 0x5A2A
-0x820A = 0x6751
-0x820C = 0x4065
-0x820D = 0x6752
-0x820E = 0x3C4B
-0x8210 = 0x6753
-0x8212 = 0x5030
-0x8216 = 0x6754
-0x8217 = 0x4A5E
-0x8218 = 0x345C
-0x821B = 0x4124
-0x821C = 0x3D58
-0x821E = 0x4971
-0x821F = 0x3D2E
-0x8229 = 0x6755
-0x822A = 0x3952
-0x822B = 0x6756
-0x822C = 0x484C
-0x822E = 0x6764
-0x8233 = 0x6758
-0x8235 = 0x4249
-0x8236 = 0x4775
-0x8237 = 0x383F
-0x8238 = 0x6757
-0x8239 = 0x4125
-0x8240 = 0x6759
-0x8247 = 0x447A
-0x8258 = 0x675B
-0x8259 = 0x675A
-0x825A = 0x675D
-0x825D = 0x675C
-0x825F = 0x675E
-0x8262 = 0x6760
-0x8264 = 0x675F
-0x8266 = 0x344F
-0x8268 = 0x6761
-0x826A = 0x6762
-0x826B = 0x6763
-0x826E = 0x3A31
-0x826F = 0x4E49
-0x8271 = 0x6765
-0x8272 = 0x3F27
-0x8276 = 0x3170
-0x8277 = 0x6766
-0x8278 = 0x6767
-0x827E = 0x6768
-0x828B = 0x3072
-0x828D = 0x6769
-0x8292 = 0x676A
-0x8299 = 0x4967
-0x829D = 0x3C47
-0x829F = 0x676C
-0x82A5 = 0x3329
-0x82A6 = 0x3032
-0x82AB = 0x676B
-0x82AC = 0x676E
-0x82AD = 0x474E
-0x82AF = 0x3F44
-0x82B1 = 0x3256
-0x82B3 = 0x4B27
-0x82B8 = 0x375D
-0x82B9 = 0x365C
-0x82BB = 0x676D
-0x82BD = 0x326A
-0x82C5 = 0x3423
-0x82D1 = 0x3171
-0x82D2 = 0x6772
-0x82D3 = 0x4E6A
-0x82D4 = 0x425D
-0x82D7 = 0x4944
-0x82D9 = 0x677E
-0x82DB = 0x3257
-0x82DC = 0x677C
-0x82DE = 0x677A
-0x82DF = 0x6771
-0x82E1 = 0x676F
-0x82E3 = 0x6770
-0x82E5 = 0x3C63
-0x82E6 = 0x366C
-0x82E7 = 0x4377
-0x82EB = 0x4651
-0x82F1 = 0x3151
-0x82F3 = 0x6774
-0x82F4 = 0x6773
-0x82F9 = 0x6779
-0x82FA = 0x6775
-0x82FB = 0x6778
-0x8302 = 0x4C50
-0x8303 = 0x6777
-0x8304 = 0x3258
-0x8305 = 0x337D
-0x8306 = 0x677B
-0x8309 = 0x677D
-0x830E = 0x3754
-0x8316 = 0x6823
-0x8317 = 0x682C
-0x8318 = 0x682D
-0x831C = 0x302B
-0x8323 = 0x6834
-0x8328 = 0x3071
-0x832B = 0x682B
-0x832F = 0x682A
-0x8331 = 0x6825
-0x8332 = 0x6824
-0x8334 = 0x6822
-0x8335 = 0x6821
-0x8336 = 0x4363
-0x8338 = 0x427B
-0x8339 = 0x6827
-0x8340 = 0x6826
-0x8345 = 0x6829
-0x8349 = 0x4170
-0x834A = 0x3755
-0x834F = 0x3141
-0x8350 = 0x6828
-0x8352 = 0x3953
-0x8358 = 0x4171
-0x8373 = 0x683A
-0x8375 = 0x683B
-0x8377 = 0x3259
-0x837B = 0x322E
-0x837C = 0x6838
-0x8385 = 0x682E
-0x8387 = 0x6836
-0x8389 = 0x683D
-0x838A = 0x6837
-0x838E = 0x6835
-0x8393 = 0x6776
-0x8396 = 0x6833
-0x839A = 0x682F
-0x839E = 0x3450
-0x839F = 0x6831
-0x83A0 = 0x683C
-0x83A2 = 0x6832
-0x83A8 = 0x683E
-0x83AA = 0x6830
-0x83AB = 0x477C
-0x83B1 = 0x4D69
-0x83B5 = 0x6839
-0x83BD = 0x684F
-0x83C1 = 0x6847
-0x83C5 = 0x3F7B
-0x83CA = 0x3546
-0x83CC = 0x365D
-0x83CE = 0x6842
-0x83D3 = 0x325B
-0x83D6 = 0x3E54
-0x83D8 = 0x6845
-0x83DC = 0x3A5A
-0x83DF = 0x4551
-0x83E0 = 0x684A
-0x83E9 = 0x4A6E
-0x83EB = 0x6841
-0x83EF = 0x325A
-0x83F0 = 0x3856
-0x83F1 = 0x4929
-0x83F2 = 0x684B
-0x83F4 = 0x683F
-0x83F7 = 0x6848
-0x83FB = 0x6852
-0x83FD = 0x6843
-0x8403 = 0x6844
-0x8404 = 0x463A
-0x8407 = 0x6849
-0x840B = 0x6846
-0x840C = 0x4B28
-0x840D = 0x684C
-0x840E = 0x3060
-0x8413 = 0x6840
-0x8420 = 0x684E
-0x8422 = 0x684D
-0x8429 = 0x476B
-0x842A = 0x6854
-0x842C = 0x685F
-0x8431 = 0x337E
-0x8435 = 0x6862
-0x8438 = 0x6850
-0x843C = 0x6855
-0x843D = 0x4D6E
-0x8446 = 0x685E
-0x8449 = 0x4D55
-0x844E = 0x4E2A
-0x8457 = 0x4378
-0x845B = 0x336B
-0x8461 = 0x4972
-0x8462 = 0x6864
-0x8463 = 0x4621
-0x8466 = 0x3031
-0x8469 = 0x685D
-0x846B = 0x6859
-0x846C = 0x4172
-0x846D = 0x6853
-0x846E = 0x685B
-0x846F = 0x6860
-0x8471 = 0x472C
-0x8475 = 0x302A
-0x8477 = 0x6858
-0x8479 = 0x6861
-0x847A = 0x4978
-0x8482 = 0x685C
-0x8484 = 0x6857
-0x848B = 0x3E55
-0x8490 = 0x3D2F
-0x8494 = 0x3C2C
-0x8499 = 0x4C58
-0x849C = 0x4947
-0x849F = 0x6867
-0x84A1 = 0x6870
-0x84AD = 0x685A
-0x84B2 = 0x3377
-0x84B8 = 0x3E78
-0x84B9 = 0x6865
-0x84BB = 0x686A
-0x84BC = 0x4173
-0x84BF = 0x6866
-0x84C1 = 0x686D
-0x84C4 = 0x435F
-0x84C6 = 0x686E
-0x84C9 = 0x4D56
-0x84CA = 0x6863
-0x84CB = 0x3338
-0x84CD = 0x6869
-0x84D0 = 0x686C
-0x84D1 = 0x4C2C
-0x84D6 = 0x686F
-0x84D9 = 0x6868
-0x84DA = 0x686B
-0x84EC = 0x4B29
-0x84EE = 0x4F21
-0x84F4 = 0x6873
-0x84FC = 0x687A
-0x84FF = 0x6872
-0x8500 = 0x3C43
-0x8506 = 0x6851
-0x8511 = 0x4A4E
-0x8513 = 0x4C22
-0x8514 = 0x6879
-0x8515 = 0x6878
-0x8517 = 0x6874
-0x8518 = 0x6875
-0x851A = 0x3136
-0x851F = 0x6877
-0x8521 = 0x6871
-0x8526 = 0x4455
-0x852C = 0x6876
-0x852D = 0x307E
-0x8535 = 0x4222
-0x853D = 0x4A43
-0x8540 = 0x687B
-0x8541 = 0x6921
-0x8543 = 0x4859
-0x8548 = 0x687E
-0x8549 = 0x3E56
-0x854A = 0x3C49
-0x854B = 0x6923
-0x854E = 0x363E
-0x8555 = 0x6924
-0x8557 = 0x4979
-0x8558 = 0x687D
-0x855A = 0x6856
-0x8563 = 0x687C
-0x8568 = 0x4F4F
-0x8569 = 0x4622
-0x856A = 0x4973
-0x856D = 0x692B
-0x8577 = 0x6931
-0x857E = 0x6932
-0x8580 = 0x6925
-0x8584 = 0x4776
-0x8587 = 0x692F
-0x8588 = 0x6927
-0x858A = 0x6929
-0x8590 = 0x6933
-0x8591 = 0x6928
-0x8594 = 0x692C
-0x8597 = 0x3172
-0x8599 = 0x4665
-0x859B = 0x692D
-0x859C = 0x6930
-0x85A4 = 0x6926
-0x85A6 = 0x4126
-0x85A8 = 0x692A
-0x85A9 = 0x3B27
-0x85AA = 0x3F45
-0x85AB = 0x3730
-0x85AC = 0x4C74
-0x85AE = 0x4C79
-0x85AF = 0x3D72
-0x85B9 = 0x6937
-0x85BA = 0x6935
-0x85C1 = 0x4F4E
-0x85C9 = 0x6934
-0x85CD = 0x4D75
-0x85CF = 0x6936
-0x85D0 = 0x6938
-0x85D5 = 0x6939
-0x85DC = 0x693C
-0x85DD = 0x693A
-0x85E4 = 0x4623
-0x85E5 = 0x693B
-0x85E9 = 0x484D
-0x85EA = 0x692E
-0x85F7 = 0x3D73
-0x85F9 = 0x693D
-0x85FA = 0x6942
-0x85FB = 0x4174
-0x85FE = 0x6941
-0x8602 = 0x6922
-0x8606 = 0x6943
-0x8607 = 0x4149
-0x860A = 0x693E
-0x860B = 0x6940
-0x8613 = 0x693F
-0x8616 = 0x5D31
-0x8617 = 0x5D22
-0x861A = 0x6945
-0x8622 = 0x6944
-0x862D = 0x4D76
-0x862F = 0x623C
-0x8630 = 0x6946
-0x863F = 0x6947
-0x864D = 0x6948
-0x864E = 0x3857
-0x8650 = 0x3554
-0x8654 = 0x694A
-0x8655 = 0x515D
-0x865A = 0x3575
-0x865C = 0x4E3A
-0x865E = 0x3673
-0x865F = 0x694B
-0x8667 = 0x694C
-0x866B = 0x436E
-0x8671 = 0x694D
-0x8679 = 0x467A
-0x867B = 0x303A
-0x868A = 0x3263
-0x868B = 0x6952
-0x868C = 0x6953
-0x8693 = 0x694E
-0x8695 = 0x3B3D
-0x86A3 = 0x694F
-0x86A4 = 0x4742
-0x86A9 = 0x6950
-0x86AA = 0x6951
-0x86AB = 0x695B
-0x86AF = 0x6955
-0x86B0 = 0x6958
-0x86B6 = 0x6954
-0x86C4 = 0x6956
-0x86C6 = 0x6957
-0x86C7 = 0x3C58
-0x86C9 = 0x6959
-0x86CB = 0x4341
-0x86CD = 0x3756
-0x86CE = 0x3342
-0x86D4 = 0x695C
-0x86D9 = 0x333F
-0x86DB = 0x6961
-0x86DE = 0x695D
-0x86DF = 0x6960
-0x86E4 = 0x483A
-0x86E9 = 0x695E
-0x86EC = 0x695F
-0x86ED = 0x4948
-0x86EE = 0x485A
-0x86EF = 0x6962
-0x86F8 = 0x427D
-0x86F9 = 0x696C
-0x86FB = 0x6968
-0x86FE = 0x326B
-0x8700 = 0x6966
-0x8702 = 0x4B2A
-0x8703 = 0x6967
-0x8706 = 0x6964
-0x8708 = 0x6965
-0x8709 = 0x696A
-0x870A = 0x696D
-0x870D = 0x696B
-0x8711 = 0x6969
-0x8712 = 0x6963
-0x8718 = 0x4358
-0x871A = 0x6974
-0x871C = 0x4C2A
-0x8725 = 0x6972
-0x8729 = 0x6973
-0x8734 = 0x696E
-0x8737 = 0x6970
-0x873B = 0x6971
-0x873F = 0x696F
-0x8749 = 0x4066
-0x874B = 0x4F39
-0x874C = 0x6978
-0x874E = 0x6979
-0x8753 = 0x6A21
-0x8755 = 0x3F2A
-0x8757 = 0x697B
-0x8759 = 0x697E
-0x875F = 0x6976
-0x8760 = 0x6975
-0x8763 = 0x6A22
-0x8766 = 0x325C
-0x8768 = 0x697C
-0x876A = 0x6A23
-0x876E = 0x697D
-0x8774 = 0x697A
-0x8776 = 0x4433
-0x8778 = 0x6977
-0x877F = 0x4768
-0x8782 = 0x6A27
-0x878D = 0x4D3B
-0x879F = 0x6A26
-0x87A2 = 0x6A25
-0x87AB = 0x6A2E
-0x87AF = 0x6A28
-0x87B3 = 0x6A30
-0x87BA = 0x4D66
-0x87BB = 0x6A33
-0x87BD = 0x6A2A
-0x87C0 = 0x6A2B
-0x87C4 = 0x6A2F
-0x87C6 = 0x6A32
-0x87C7 = 0x6A31
-0x87CB = 0x6A29
-0x87D0 = 0x6A2C
-0x87D2 = 0x6A3D
-0x87E0 = 0x6A36
-0x87EF = 0x6A34
-0x87F2 = 0x6A35
-0x87F6 = 0x6A3A
-0x87F7 = 0x6A3B
-0x87F9 = 0x332A
-0x87FB = 0x3542
-0x87FE = 0x6A39
-0x8805 = 0x6A24
-0x880D = 0x6A38
-0x880E = 0x6A3C
-0x880F = 0x6A37
-0x8811 = 0x6A3E
-0x8815 = 0x6A40
-0x8816 = 0x6A3F
-0x8821 = 0x6A42
-0x8822 = 0x6A41
-0x8823 = 0x695A
-0x8827 = 0x6A46
-0x8831 = 0x6A43
-0x8836 = 0x6A44
-0x8839 = 0x6A45
-0x883B = 0x6A47
-0x8840 = 0x376C
-0x8842 = 0x6A49
-0x8844 = 0x6A48
-0x8846 = 0x3D30
-0x884C = 0x3954
-0x884D = 0x5E27
-0x8852 = 0x6A4A
-0x8853 = 0x3D51
-0x8857 = 0x3339
-0x8859 = 0x6A4B
-0x885B = 0x3152
-0x885D = 0x3E57
-0x885E = 0x6A4C
-0x8861 = 0x3955
-0x8862 = 0x6A4D
-0x8863 = 0x3061
-0x8868 = 0x493D
-0x886B = 0x6A4E
-0x8870 = 0x3F6A
-0x8872 = 0x6A55
-0x8875 = 0x6A52
-0x8877 = 0x436F
-0x887D = 0x6A53
-0x887E = 0x6A50
-0x887F = 0x365E
-0x8881 = 0x6A4F
-0x8882 = 0x6A56
-0x8888 = 0x3736
-0x888B = 0x425E
-0x888D = 0x6A5C
-0x8892 = 0x6A58
-0x8896 = 0x4235
-0x8897 = 0x6A57
-0x8899 = 0x6A5A
-0x889E = 0x6A51
-0x88A2 = 0x6A5B
-0x88A4 = 0x6A5D
-0x88AB = 0x486F
-0x88AE = 0x6A59
-0x88B0 = 0x6A5E
-0x88B1 = 0x6A60
-0x88B4 = 0x3853
-0x88B5 = 0x6A54
-0x88B7 = 0x3041
-0x88BF = 0x6A5F
-0x88C1 = 0x3A5B
-0x88C2 = 0x4E76
-0x88C3 = 0x6A61
-0x88C4 = 0x6A62
-0x88C5 = 0x4175
-0x88CF = 0x4E22
-0x88D4 = 0x6A63
-0x88D5 = 0x4D35
-0x88D8 = 0x6A64
-0x88D9 = 0x6A65
-0x88DC = 0x4A64
-0x88DD = 0x6A66
-0x88DF = 0x3A40
-0x88E1 = 0x4E23
-0x88E8 = 0x6A6B
-0x88F2 = 0x6A6C
-0x88F3 = 0x3E58
-0x88F4 = 0x6A6A
-0x88F8 = 0x4D67
-0x88F9 = 0x6A67
-0x88FC = 0x6A69
-0x88FD = 0x403D
-0x88FE = 0x3F7E
-0x8902 = 0x6A68
-0x8904 = 0x6A6D
-0x8907 = 0x4A23
-0x890A = 0x6A6F
-0x890C = 0x6A6E
-0x8910 = 0x336C
-0x8912 = 0x4B2B
-0x8913 = 0x6A70
-0x891D = 0x6A7C
-0x891E = 0x6A72
-0x8925 = 0x6A73
-0x892A = 0x6A74
-0x892B = 0x6A75
-0x8936 = 0x6A79
-0x8938 = 0x6A7A
-0x893B = 0x6A78
-0x8941 = 0x6A76
-0x8943 = 0x6A71
-0x8944 = 0x6A77
-0x894C = 0x6A7B
-0x894D = 0x7037
-0x8956 = 0x3228
-0x895E = 0x6A7E
-0x895F = 0x365F
-0x8960 = 0x6A7D
-0x8964 = 0x6B22
-0x8966 = 0x6B21
-0x896A = 0x6B24
-0x896D = 0x6B23
-0x896F = 0x6B25
-0x8972 = 0x3D31
-0x8974 = 0x6B26
-0x8977 = 0x6B27
-0x897E = 0x6B28
-0x897F = 0x403E
-0x8981 = 0x4D57
-0x8983 = 0x6B29
-0x8986 = 0x4A24
-0x8987 = 0x4746
-0x8988 = 0x6B2A
-0x898A = 0x6B2B
-0x898B = 0x382B
-0x898F = 0x352C
-0x8993 = 0x6B2C
-0x8996 = 0x3B6B
-0x8997 = 0x4741
-0x8998 = 0x6B2D
-0x899A = 0x3350
-0x89A1 = 0x6B2E
-0x89A6 = 0x6B30
-0x89A7 = 0x4D77
-0x89A9 = 0x6B2F
-0x89AA = 0x3F46
-0x89AC = 0x6B31
-0x89AF = 0x6B32
-0x89B2 = 0x6B33
-0x89B3 = 0x3451
-0x89BA = 0x6B34
-0x89BD = 0x6B35
-0x89BF = 0x6B36
-0x89C0 = 0x6B37
-0x89D2 = 0x3351
-0x89DA = 0x6B38
-0x89DC = 0x6B39
-0x89DD = 0x6B3A
-0x89E3 = 0x3272
-0x89E6 = 0x3F28
-0x89E7 = 0x6B3B
-0x89F4 = 0x6B3C
-0x89F8 = 0x6B3D
-0x8A00 = 0x3840
-0x8A02 = 0x447B
-0x8A03 = 0x6B3E
-0x8A08 = 0x3757
-0x8A0A = 0x3F56
-0x8A0C = 0x6B41
-0x8A0E = 0x4624
-0x8A10 = 0x6B40
-0x8A13 = 0x3731
-0x8A16 = 0x6B3F
-0x8A17 = 0x4277
-0x8A18 = 0x352D
-0x8A1B = 0x6B42
-0x8A1D = 0x6B43
-0x8A1F = 0x3E59
-0x8A23 = 0x376D
-0x8A25 = 0x6B44
-0x8A2A = 0x4B2C
-0x8A2D = 0x405F
-0x8A31 = 0x3576
-0x8A33 = 0x4C75
-0x8A34 = 0x414A
-0x8A36 = 0x6B45
-0x8A3A = 0x3F47
-0x8A3B = 0x4370
-0x8A3C = 0x3E5A
-0x8A41 = 0x6B46
-0x8A46 = 0x6B49
-0x8A48 = 0x6B4A
-0x8A50 = 0x3A3E
-0x8A51 = 0x4242
-0x8A52 = 0x6B48
-0x8A54 = 0x3E5B
-0x8A55 = 0x493E
-0x8A5B = 0x6B47
-0x8A5E = 0x3B6C
-0x8A60 = 0x3153
-0x8A62 = 0x6B4E
-0x8A63 = 0x3758
-0x8A66 = 0x3B6E
-0x8A69 = 0x3B6D
-0x8A6B = 0x4F4D
-0x8A6C = 0x6B4D
-0x8A6D = 0x6B4C
-0x8A6E = 0x4127
-0x8A70 = 0x354D
-0x8A71 = 0x4F43
-0x8A72 = 0x333A
-0x8A73 = 0x3E5C
-0x8A7C = 0x6B4B
-0x8A82 = 0x6B50
-0x8A84 = 0x6B51
-0x8A85 = 0x6B4F
-0x8A87 = 0x3858
-0x8A89 = 0x4D40
-0x8A8C = 0x3B6F
-0x8A8D = 0x4727
-0x8A91 = 0x6B54
-0x8A93 = 0x4040
-0x8A95 = 0x4342
-0x8A98 = 0x4D36
-0x8A9A = 0x6B57
-0x8A9E = 0x386C
-0x8AA0 = 0x403F
-0x8AA1 = 0x6B53
-0x8AA3 = 0x6B58
-0x8AA4 = 0x386D
-0x8AA5 = 0x6B55
-0x8AA6 = 0x6B56
-0x8AA8 = 0x6B52
-0x8AAC = 0x4062
-0x8AAD = 0x4649
-0x8AB0 = 0x432F
-0x8AB2 = 0x325D
-0x8AB9 = 0x4870
-0x8ABC = 0x3543
-0x8ABF = 0x4434
-0x8AC2 = 0x6B5B
-0x8AC4 = 0x6B59
-0x8AC7 = 0x434C
-0x8ACB = 0x4041
-0x8ACC = 0x3452
-0x8ACD = 0x6B5A
-0x8ACF = 0x3F5B
-0x8AD2 = 0x4E4A
-0x8AD6 = 0x4F40
-0x8ADA = 0x6B5C
-0x8ADB = 0x6B67
-0x8ADC = 0x4435
-0x8ADE = 0x6B66
-0x8AE0 = 0x6B63
-0x8AE1 = 0x6B6B
-0x8AE2 = 0x6B64
-0x8AE4 = 0x6B60
-0x8AE6 = 0x447C
-0x8AE7 = 0x6B5F
-0x8AEB = 0x6B5D
-0x8AED = 0x4D21
-0x8AEE = 0x3B70
-0x8AF1 = 0x6B61
-0x8AF3 = 0x6B5E
-0x8AF7 = 0x6B65
-0x8AF8 = 0x3D74
-0x8AFA = 0x3841
-0x8AFE = 0x427A
-0x8B00 = 0x4B45
-0x8B01 = 0x315A
-0x8B02 = 0x3062
-0x8B04 = 0x4625
-0x8B07 = 0x6B69
-0x8B0C = 0x6B68
-0x8B0E = 0x4666
-0x8B10 = 0x6B6D
-0x8B14 = 0x6B62
-0x8B16 = 0x6B6C
-0x8B17 = 0x6B6E
-0x8B19 = 0x382C
-0x8B1A = 0x6B6A
-0x8B1B = 0x3956
-0x8B1D = 0x3C55
-0x8B20 = 0x6B6F
-0x8B21 = 0x4D58
-0x8B26 = 0x6B72
-0x8B28 = 0x6B75
-0x8B2B = 0x6B73
-0x8B2C = 0x4935
-0x8B33 = 0x6B70
-0x8B39 = 0x3660
-0x8B3E = 0x6B74
-0x8B41 = 0x6B76
-0x8B49 = 0x6B7A
-0x8B4C = 0x6B77
-0x8B4E = 0x6B79
-0x8B4F = 0x6B78
-0x8B56 = 0x6B7B
-0x8B58 = 0x3C31
-0x8B5A = 0x6B7D
-0x8B5B = 0x6B7C
-0x8B5C = 0x4968
-0x8B5F = 0x6C21
-0x8B66 = 0x3759
-0x8B6B = 0x6B7E
-0x8B6C = 0x6C22
-0x8B6F = 0x6C23
-0x8B70 = 0x3544
-0x8B71 = 0x6641
-0x8B72 = 0x3E79
-0x8B74 = 0x6C24
-0x8B77 = 0x386E
-0x8B7D = 0x6C25
-0x8B80 = 0x6C26
-0x8B83 = 0x3B3E
-0x8B8A = 0x5A4E
-0x8B8C = 0x6C27
-0x8B8E = 0x6C28
-0x8B90 = 0x3D32
-0x8B92 = 0x6C29
-0x8B93 = 0x6C2A
-0x8B96 = 0x6C2B
-0x8B99 = 0x6C2C
-0x8B9A = 0x6C2D
-0x8C37 = 0x432B
-0x8C3A = 0x6C2E
-0x8C3F = 0x6C30
-0x8C41 = 0x6C2F
-0x8C46 = 0x4626
-0x8C48 = 0x6C31
-0x8C4A = 0x4B2D
-0x8C4C = 0x6C32
-0x8C4E = 0x6C33
-0x8C50 = 0x6C34
-0x8C55 = 0x6C35
-0x8C5A = 0x465A
-0x8C61 = 0x3E5D
-0x8C62 = 0x6C36
-0x8C6A = 0x396B
-0x8C6B = 0x502E
-0x8C6C = 0x6C37
-0x8C78 = 0x6C38
-0x8C79 = 0x493F
-0x8C7A = 0x6C39
-0x8C7C = 0x6C41
-0x8C82 = 0x6C3A
-0x8C85 = 0x6C3C
-0x8C89 = 0x6C3B
-0x8C8A = 0x6C3D
-0x8C8C = 0x4B46
-0x8C8D = 0x6C3E
-0x8C8E = 0x6C3F
-0x8C94 = 0x6C40
-0x8C98 = 0x6C42
-0x8C9D = 0x332D
-0x8C9E = 0x4467
-0x8CA0 = 0x4969
-0x8CA1 = 0x3A62
-0x8CA2 = 0x3957
-0x8CA7 = 0x494F
-0x8CA8 = 0x325F
-0x8CA9 = 0x484E
-0x8CAA = 0x6C45
-0x8CAB = 0x3453
-0x8CAC = 0x4055
-0x8CAD = 0x6C44
-0x8CAE = 0x6C49
-0x8CAF = 0x4379
-0x8CB0 = 0x4C63
-0x8CB2 = 0x6C47
-0x8CB3 = 0x6C48
-0x8CB4 = 0x352E
-0x8CB6 = 0x6C4A
-0x8CB7 = 0x4763
-0x8CB8 = 0x425F
-0x8CBB = 0x4871
-0x8CBC = 0x453D
-0x8CBD = 0x6C46
-0x8CBF = 0x4B47
-0x8CC0 = 0x326C
-0x8CC1 = 0x6C4C
-0x8CC2 = 0x4F28
-0x8CC3 = 0x4442
-0x8CC4 = 0x4F45
-0x8CC7 = 0x3B71
-0x8CC8 = 0x6C4B
-0x8CCA = 0x4231
-0x8CCD = 0x6C5C
-0x8CCE = 0x4128
-0x8CD1 = 0x4678
-0x8CD3 = 0x4950
-0x8CDA = 0x6C4F
-0x8CDB = 0x3B3F
-0x8CDC = 0x3B72
-0x8CDE = 0x3E5E
-0x8CE0 = 0x4765
-0x8CE2 = 0x382D
-0x8CE3 = 0x6C4E
-0x8CE4 = 0x6C4D
-0x8CE6 = 0x496A
-0x8CEA = 0x3C41
-0x8CED = 0x4552
-0x8CFA = 0x6C51
-0x8CFB = 0x6C52
-0x8CFC = 0x3958
-0x8CFD = 0x6C50
-0x8D04 = 0x6C53
-0x8D05 = 0x6C54
-0x8D07 = 0x6C56
-0x8D08 = 0x4223
-0x8D0A = 0x6C55
-0x8D0B = 0x3466
-0x8D0D = 0x6C58
-0x8D0F = 0x6C57
-0x8D10 = 0x6C59
-0x8D13 = 0x6C5B
-0x8D14 = 0x6C5D
-0x8D16 = 0x6C5E
-0x8D64 = 0x4056
-0x8D66 = 0x3C4F
-0x8D67 = 0x6C5F
-0x8D6B = 0x3352
-0x8D6D = 0x6C60
-0x8D70 = 0x4176
-0x8D71 = 0x6C61
-0x8D73 = 0x6C62
-0x8D74 = 0x496B
-0x8D77 = 0x352F
-0x8D81 = 0x6C63
-0x8D85 = 0x4436
-0x8D8A = 0x315B
-0x8D99 = 0x6C64
-0x8DA3 = 0x3C71
-0x8DA8 = 0x3F76
-0x8DB3 = 0x422D
-0x8DBA = 0x6C67
-0x8DBE = 0x6C66
-0x8DC2 = 0x6C65
-0x8DCB = 0x6C6D
-0x8DCC = 0x6C6B
-0x8DCF = 0x6C68
-0x8DD6 = 0x6C6A
-0x8DDA = 0x6C69
-0x8DDB = 0x6C6C
-0x8DDD = 0x3577
-0x8DDF = 0x6C70
-0x8DE1 = 0x4057
-0x8DE3 = 0x6C71
-0x8DE8 = 0x3859
-0x8DEA = 0x6C6E
-0x8DEB = 0x6C6F
-0x8DEF = 0x4F29
-0x8DF3 = 0x4437
-0x8DF5 = 0x4129
-0x8DFC = 0x6C72
-0x8DFF = 0x6C75
-0x8E08 = 0x6C73
-0x8E09 = 0x6C74
-0x8E0A = 0x4D59
-0x8E0F = 0x4627
-0x8E10 = 0x6C78
-0x8E1D = 0x6C76
-0x8E1E = 0x6C77
-0x8E1F = 0x6C79
-0x8E2A = 0x6D29
-0x8E30 = 0x6C7C
-0x8E34 = 0x6C7D
-0x8E35 = 0x6C7B
-0x8E42 = 0x6C7A
-0x8E44 = 0x447D
-0x8E47 = 0x6D21
-0x8E48 = 0x6D25
-0x8E49 = 0x6D22
-0x8E4A = 0x6C7E
-0x8E4C = 0x6D23
-0x8E50 = 0x6D24
-0x8E55 = 0x6D2B
-0x8E59 = 0x6D26
-0x8E5F = 0x4058
-0x8E60 = 0x6D28
-0x8E63 = 0x6D2A
-0x8E64 = 0x6D27
-0x8E72 = 0x6D2D
-0x8E74 = 0x3D33
-0x8E76 = 0x6D2C
-0x8E7C = 0x6D2E
-0x8E81 = 0x6D2F
-0x8E84 = 0x6D32
-0x8E85 = 0x6D31
-0x8E87 = 0x6D30
-0x8E8A = 0x6D34
-0x8E8B = 0x6D33
-0x8E8D = 0x4C76
-0x8E91 = 0x6D36
-0x8E93 = 0x6D35
-0x8E94 = 0x6D37
-0x8E99 = 0x6D38
-0x8EA1 = 0x6D3A
-0x8EAA = 0x6D39
-0x8EAB = 0x3F48
-0x8EAC = 0x6D3B
-0x8EAF = 0x366D
-0x8EB0 = 0x6D3C
-0x8EB1 = 0x6D3E
-0x8EBE = 0x6D3F
-0x8EC5 = 0x6D40
-0x8EC6 = 0x6D3D
-0x8EC8 = 0x6D41
-0x8ECA = 0x3C56
-0x8ECB = 0x6D42
-0x8ECC = 0x3530
-0x8ECD = 0x3733
-0x8ED2 = 0x382E
-0x8EDB = 0x6D43
-0x8EDF = 0x4670
-0x8EE2 = 0x453E
-0x8EE3 = 0x6D44
-0x8EEB = 0x6D47
-0x8EF8 = 0x3C34
-0x8EFB = 0x6D46
-0x8EFC = 0x6D45
-0x8EFD = 0x375A
-0x8EFE = 0x6D48
-0x8F03 = 0x3353
-0x8F05 = 0x6D4A
-0x8F09 = 0x3A5C
-0x8F0A = 0x6D49
-0x8F0C = 0x6D52
-0x8F12 = 0x6D4C
-0x8F13 = 0x6D4E
-0x8F14 = 0x4A65
-0x8F15 = 0x6D4B
-0x8F19 = 0x6D4D
-0x8F1B = 0x6D51
-0x8F1C = 0x6D4F
-0x8F1D = 0x3531
-0x8F1F = 0x6D50
-0x8F26 = 0x6D53
-0x8F29 = 0x475A
-0x8F2A = 0x4E58
-0x8F2F = 0x3D34
-0x8F33 = 0x6D54
-0x8F38 = 0x4D22
-0x8F39 = 0x6D56
-0x8F3B = 0x6D55
-0x8F3E = 0x6D59
-0x8F3F = 0x4D41
-0x8F42 = 0x6D58
-0x8F44 = 0x336D
-0x8F45 = 0x6D57
-0x8F46 = 0x6D5C
-0x8F49 = 0x6D5B
-0x8F4C = 0x6D5A
-0x8F4D = 0x4532
-0x8F4E = 0x6D5D
-0x8F57 = 0x6D5E
-0x8F5C = 0x6D5F
-0x8F5F = 0x396C
-0x8F61 = 0x3725
-0x8F62 = 0x6D60
-0x8F63 = 0x6D61
-0x8F64 = 0x6D62
-0x8F9B = 0x3F49
-0x8F9C = 0x6D63
-0x8F9E = 0x3C2D
-0x8F9F = 0x6D64
-0x8FA3 = 0x6D65
-0x8FA7 = 0x5221
-0x8FA8 = 0x517E
-0x8FAD = 0x6D66
-0x8FAE = 0x6570
-0x8FAF = 0x6D67
-0x8FB0 = 0x4324
-0x8FB1 = 0x3F2B
-0x8FB2 = 0x4740
-0x8FB7 = 0x6D68
-0x8FBA = 0x4A55
-0x8FBB = 0x4454
-0x8FBC = 0x397E
-0x8FBF = 0x4329
-0x8FC2 = 0x312A
-0x8FC4 = 0x4B78
-0x8FC5 = 0x3F57
-0x8FCE = 0x375E
-0x8FD1 = 0x3661
-0x8FD4 = 0x4A56
-0x8FDA = 0x6D69
-0x8FE2 = 0x6D6B
-0x8FE5 = 0x6D6A
-0x8FE6 = 0x3260
-0x8FE9 = 0x4676
-0x8FEA = 0x6D6C
-0x8FEB = 0x4777
-0x8FED = 0x4533
-0x8FEF = 0x6D6D
-0x8FF0 = 0x3D52
-0x8FF4 = 0x6D6F
-0x8FF7 = 0x4C42
-0x8FF8 = 0x6D7E
-0x8FF9 = 0x6D71
-0x8FFA = 0x6D72
-0x8FFD = 0x4449
-0x9000 = 0x4260
-0x9001 = 0x4177
-0x9003 = 0x4628
-0x9005 = 0x6D70
-0x9006 = 0x3555
-0x900B = 0x6D79
-0x900D = 0x6D76
-0x900E = 0x6E25
-0x900F = 0x4629
-0x9010 = 0x4360
-0x9011 = 0x6D73
-0x9013 = 0x447E
-0x9014 = 0x4553
-0x9015 = 0x6D74
-0x9016 = 0x6D78
-0x9017 = 0x3F60
-0x9019 = 0x4767
-0x901A = 0x444C
-0x901D = 0x4042
-0x901E = 0x6D77
-0x901F = 0x422E
-0x9020 = 0x4224
-0x9021 = 0x6D75
-0x9022 = 0x3029
-0x9023 = 0x4F22
-0x9027 = 0x6D7A
-0x902E = 0x4261
-0x9031 = 0x3D35
-0x9032 = 0x3F4A
-0x9035 = 0x6D7C
-0x9036 = 0x6D7B
-0x9038 = 0x306F
-0x9039 = 0x6D7D
-0x903C = 0x492F
-0x903E = 0x6E27
-0x9041 = 0x465B
-0x9042 = 0x3F6B
-0x9045 = 0x4359
-0x9047 = 0x3678
-0x9049 = 0x6E26
-0x904A = 0x4D37
-0x904B = 0x313F
-0x904D = 0x4A57
-0x904E = 0x3261
-0x904F = 0x6E21
-0x9050 = 0x6E22
-0x9051 = 0x6E23
-0x9052 = 0x6E24
-0x9053 = 0x463B
-0x9054 = 0x4323
-0x9055 = 0x3063
-0x9056 = 0x6E28
-0x9058 = 0x6E29
-0x9059 = 0x7423
-0x905C = 0x423D
-0x905E = 0x6E2A
-0x9060 = 0x3173
-0x9061 = 0x414C
-0x9063 = 0x382F
-0x9065 = 0x4D5A
-0x9068 = 0x6E2B
-0x9069 = 0x452C
-0x906D = 0x4178
-0x906E = 0x3C57
-0x906F = 0x6E2C
-0x9072 = 0x6E2F
-0x9075 = 0x3D65
-0x9076 = 0x6E2D
-0x9077 = 0x412B
-0x9078 = 0x412A
-0x907A = 0x3064
-0x907C = 0x4E4B
-0x907D = 0x6E31
-0x907F = 0x4872
-0x9080 = 0x6E33
-0x9081 = 0x6E32
-0x9082 = 0x6E30
-0x9083 = 0x6364
-0x9084 = 0x3454
-0x9087 = 0x6D6E
-0x9089 = 0x6E35
-0x908A = 0x6E34
-0x908F = 0x6E36
-0x9091 = 0x4D38
-0x90A3 = 0x4661
-0x90A6 = 0x4B2E
-0x90A8 = 0x6E37
-0x90AA = 0x3C59
-0x90AF = 0x6E38
-0x90B1 = 0x6E39
-0x90B5 = 0x6E3A
-0x90B8 = 0x4521
-0x90C1 = 0x306A
-0x90CA = 0x3959
-0x90CE = 0x4F3A
-0x90DB = 0x6E3E
-0x90E1 = 0x3734
-0x90E2 = 0x6E3B
-0x90E4 = 0x6E3C
-0x90E8 = 0x4974
-0x90ED = 0x3354
-0x90F5 = 0x4D39
-0x90F7 = 0x363F
-0x90FD = 0x4554
-0x9102 = 0x6E3F
-0x9112 = 0x6E40
-0x9119 = 0x6E41
-0x912D = 0x4522
-0x9130 = 0x6E43
-0x9132 = 0x6E42
-0x9149 = 0x4653
-0x914A = 0x6E44
-0x914B = 0x3D36
-0x914C = 0x3C60
-0x914D = 0x475B
-0x914E = 0x4371
-0x9152 = 0x3C72
-0x9154 = 0x3F6C
-0x9156 = 0x6E45
-0x9158 = 0x6E46
-0x9162 = 0x3F5D
-0x9163 = 0x6E47
-0x9165 = 0x6E48
-0x9169 = 0x6E49
-0x916A = 0x4D6F
-0x916C = 0x3D37
-0x9172 = 0x6E4B
-0x9173 = 0x6E4A
-0x9175 = 0x395A
-0x9177 = 0x3973
-0x9178 = 0x3B40
-0x9182 = 0x6E4E
-0x9187 = 0x3D66
-0x9189 = 0x6E4D
-0x918B = 0x6E4C
-0x918D = 0x4269
-0x9190 = 0x386F
-0x9192 = 0x4043
-0x9197 = 0x4830
-0x919C = 0x3D39
-0x91A2 = 0x6E4F
-0x91A4 = 0x3E5F
-0x91AA = 0x6E52
-0x91AB = 0x6E50
-0x91AF = 0x6E51
-0x91B4 = 0x6E54
-0x91B5 = 0x6E53
-0x91B8 = 0x3E7A
-0x91BA = 0x6E55
-0x91C0 = 0x6E56
-0x91C1 = 0x6E57
-0x91C6 = 0x4850
-0x91C7 = 0x3A53
-0x91C8 = 0x3C61
-0x91C9 = 0x6E58
-0x91CB = 0x6E59
-0x91CC = 0x4E24
-0x91CD = 0x3D45
-0x91CE = 0x4C6E
-0x91CF = 0x4E4C
-0x91D0 = 0x6E5A
-0x91D1 = 0x3662
-0x91D6 = 0x6E5B
-0x91D8 = 0x4523
-0x91DB = 0x6E5E
-0x91DC = 0x3378
-0x91DD = 0x3F4B
-0x91DF = 0x6E5C
-0x91E1 = 0x6E5D
-0x91E3 = 0x4460
-0x91E6 = 0x4B55
-0x91E7 = 0x367C
-0x91F5 = 0x6E60
-0x91F6 = 0x6E61
-0x91FC = 0x6E5F
-0x91FF = 0x6E63
-0x920D = 0x465F
-0x920E = 0x3343
-0x9211 = 0x6E67
-0x9214 = 0x6E64
-0x9215 = 0x6E66
-0x921E = 0x6E62
-0x9229 = 0x6F4F
-0x922C = 0x6E65
-0x9234 = 0x4E6B
-0x9237 = 0x385A
-0x923F = 0x6E6F
-0x9244 = 0x4534
-0x9245 = 0x6E6A
-0x9248 = 0x6E6D
-0x9249 = 0x6E6B
-0x924B = 0x6E70
-0x9250 = 0x6E71
-0x9257 = 0x6E69
-0x925A = 0x6E76
-0x925B = 0x3174
-0x925E = 0x6E68
-0x9262 = 0x482D
-0x9264 = 0x6E6C
-0x9266 = 0x3E60
-0x9271 = 0x395B
-0x927E = 0x4B48
-0x9280 = 0x3664
-0x9283 = 0x3D46
-0x9285 = 0x463C
-0x9291 = 0x412D
-0x9293 = 0x6E74
-0x9295 = 0x6E6E
-0x9296 = 0x6E73
-0x9298 = 0x4C43
-0x929A = 0x4438
-0x929B = 0x6E75
-0x929C = 0x6E72
-0x92AD = 0x412C
-0x92B7 = 0x6E79
-0x92B9 = 0x6E78
-0x92CF = 0x6E77
-0x92D2 = 0x4B2F
-0x92E4 = 0x3D7B
-0x92E9 = 0x6E7A
-0x92EA = 0x4A5F
-0x92ED = 0x3154
-0x92F2 = 0x4946
-0x92F3 = 0x4372
-0x92F8 = 0x3578
-0x92FA = 0x6E7C
-0x92FC = 0x395D
-0x9306 = 0x3B2C
-0x930F = 0x6E7B
-0x9310 = 0x3F6D
-0x9318 = 0x3F6E
-0x9319 = 0x6F21
-0x931A = 0x6F23
-0x9320 = 0x3E7B
-0x9322 = 0x6F22
-0x9323 = 0x6F24
-0x9326 = 0x3653
-0x9328 = 0x4945
-0x932B = 0x3C62
-0x932C = 0x4F23
-0x932E = 0x6E7E
-0x932F = 0x3A78
-0x9332 = 0x4F3F
-0x9335 = 0x6F26
-0x933A = 0x6F25
-0x933B = 0x6F27
-0x9344 = 0x6E7D
-0x934B = 0x4669
-0x934D = 0x4555
-0x9354 = 0x4457
-0x9356 = 0x6F2C
-0x935B = 0x4343
-0x935C = 0x6F28
-0x9360 = 0x6F29
-0x936C = 0x372D
-0x936E = 0x6F2B
-0x9375 = 0x3830
-0x937C = 0x6F2A
-0x937E = 0x3E61
-0x938C = 0x3379
-0x9394 = 0x6F30
-0x9396 = 0x3A3F
-0x9397 = 0x4179
-0x939A = 0x444A
-0x93A7 = 0x333B
-0x93AC = 0x6F2E
-0x93AD = 0x6F2F
-0x93AE = 0x4443
-0x93B0 = 0x6F2D
-0x93B9 = 0x6F31
-0x93C3 = 0x6F37
-0x93C8 = 0x6F3A
-0x93D0 = 0x6F39
-0x93D1 = 0x452D
-0x93D6 = 0x6F32
-0x93D7 = 0x6F33
-0x93D8 = 0x6F36
-0x93DD = 0x6F38
-0x93E1 = 0x3640
-0x93E4 = 0x6F3B
-0x93E5 = 0x6F35
-0x93E8 = 0x6F34
-0x9403 = 0x6F3F
-0x9407 = 0x6F40
-0x9410 = 0x6F41
-0x9413 = 0x6F3E
-0x9414 = 0x6F3D
-0x9418 = 0x3E62
-0x9419 = 0x462A
-0x941A = 0x6F3C
-0x9421 = 0x6F45
-0x942B = 0x6F43
-0x9435 = 0x6F44
-0x9436 = 0x6F42
-0x9438 = 0x4278
-0x943A = 0x6F46
-0x9441 = 0x6F47
-0x9444 = 0x6F49
-0x9451 = 0x3455
-0x9452 = 0x6F48
-0x9453 = 0x4C7A
-0x945A = 0x6F54
-0x945B = 0x6F4A
-0x945E = 0x6F4D
-0x9460 = 0x6F4B
-0x9462 = 0x6F4C
-0x946A = 0x6F4E
-0x9470 = 0x6F50
-0x9475 = 0x6F51
-0x9477 = 0x6F52
-0x947C = 0x6F55
-0x947D = 0x6F53
-0x947E = 0x6F56
-0x947F = 0x6F58
-0x9481 = 0x6F57
-0x9577 = 0x4439
-0x9580 = 0x4C67
-0x9582 = 0x6F59
-0x9583 = 0x412E
-0x9587 = 0x6F5A
-0x9589 = 0x4A44
-0x958A = 0x6F5B
-0x958B = 0x332B
-0x958F = 0x313C
-0x9591 = 0x3457
-0x9593 = 0x3456
-0x9594 = 0x6F5C
-0x9596 = 0x6F5D
-0x9598 = 0x6F5E
-0x9599 = 0x6F5F
-0x95A0 = 0x6F60
-0x95A2 = 0x3458
-0x95A3 = 0x3355
-0x95A4 = 0x395E
-0x95A5 = 0x4836
-0x95A7 = 0x6F62
-0x95A8 = 0x6F61
-0x95AD = 0x6F63
-0x95B2 = 0x315C
-0x95B9 = 0x6F66
-0x95BB = 0x6F65
-0x95BC = 0x6F64
-0x95BE = 0x6F67
-0x95C3 = 0x6F6A
-0x95C7 = 0x3047
-0x95CA = 0x6F68
-0x95CC = 0x6F6C
-0x95CD = 0x6F6B
-0x95D4 = 0x6F6E
-0x95D5 = 0x6F6D
-0x95D6 = 0x6F6F
-0x95D8 = 0x462E
-0x95DC = 0x6F70
-0x95E1 = 0x6F71
-0x95E2 = 0x6F73
-0x95E5 = 0x6F72
-0x961C = 0x496C
-0x9621 = 0x6F74
-0x9628 = 0x6F75
-0x962A = 0x3A65
-0x962E = 0x6F76
-0x962F = 0x6F77
-0x9632 = 0x4B49
-0x963B = 0x414B
-0x963F = 0x3024
-0x9640 = 0x424B
-0x9642 = 0x6F78
-0x9644 = 0x496D
-0x964B = 0x6F7B
-0x964C = 0x6F79
-0x964D = 0x395F
-0x964F = 0x6F7A
-0x9650 = 0x3842
-0x965B = 0x4A45
-0x965C = 0x6F7D
-0x965D = 0x7021
-0x965E = 0x6F7E
-0x965F = 0x7022
-0x9662 = 0x3121
-0x9663 = 0x3F58
-0x9664 = 0x3D7C
-0x9665 = 0x3459
-0x9666 = 0x7023
-0x966A = 0x4766
-0x966C = 0x7025
-0x9670 = 0x3122
-0x9672 = 0x7024
-0x9673 = 0x4444
-0x9675 = 0x4E4D
-0x9676 = 0x462B
-0x9677 = 0x6F7C
-0x9678 = 0x4E26
-0x967A = 0x3831
-0x967D = 0x4D5B
-0x9685 = 0x3679
-0x9686 = 0x4E34
-0x9688 = 0x3728
-0x968A = 0x4262
-0x968B = 0x6721
-0x968D = 0x7026
-0x968E = 0x332C
-0x968F = 0x3F6F
-0x9694 = 0x3356
-0x9695 = 0x7028
-0x9697 = 0x7029
-0x9698 = 0x7027
-0x9699 = 0x3764
-0x969B = 0x3A5D
-0x969C = 0x3E63
-0x96A0 = 0x3123
-0x96A3 = 0x4E59
-0x96A7 = 0x702B
-0x96A8 = 0x6E2E
-0x96AA = 0x702A
-0x96B0 = 0x702E
-0x96B1 = 0x702C
-0x96B2 = 0x702D
-0x96B4 = 0x702F
-0x96B6 = 0x7030
-0x96B7 = 0x4E6C
-0x96B8 = 0x7031
-0x96B9 = 0x7032
-0x96BB = 0x4049
-0x96BC = 0x483B
-0x96C0 = 0x3F7D
-0x96C1 = 0x3467
-0x96C4 = 0x4D3A
-0x96C5 = 0x326D
-0x96C6 = 0x3D38
-0x96C7 = 0x385B
-0x96C9 = 0x7035
-0x96CB = 0x7034
-0x96CC = 0x3B73
-0x96CD = 0x7036
-0x96CE = 0x7033
-0x96D1 = 0x3B28
-0x96D5 = 0x703A
-0x96D6 = 0x6A2D
-0x96D9 = 0x5256
-0x96DB = 0x3F77
-0x96DC = 0x7038
-0x96E2 = 0x4E25
-0x96E3 = 0x4671
-0x96E8 = 0x312B
-0x96EA = 0x4063
-0x96EB = 0x3C36
-0x96F0 = 0x4A37
-0x96F2 = 0x3140
-0x96F6 = 0x4E6D
-0x96F7 = 0x4D6B
-0x96F9 = 0x703B
-0x96FB = 0x4545
-0x9700 = 0x3C7B
-0x9704 = 0x703C
-0x9706 = 0x703D
-0x9707 = 0x3F4C
-0x9708 = 0x703E
-0x970A = 0x4E6E
-0x970D = 0x7039
-0x970E = 0x7040
-0x970F = 0x7042
-0x9711 = 0x7041
-0x9713 = 0x703F
-0x9716 = 0x7043
-0x9719 = 0x7044
-0x971C = 0x417A
-0x971E = 0x3262
-0x9724 = 0x7045
-0x9727 = 0x4C38
-0x972A = 0x7046
-0x9730 = 0x7047
-0x9732 = 0x4F2A
-0x9738 = 0x5B31
-0x9739 = 0x7048
-0x973D = 0x7049
-0x973E = 0x704A
-0x9742 = 0x704E
-0x9744 = 0x704B
-0x9746 = 0x704C
-0x9748 = 0x704D
-0x9749 = 0x704F
-0x9752 = 0x4044
-0x9756 = 0x4C77
-0x9759 = 0x4045
-0x975C = 0x7050
-0x975E = 0x4873
-0x9760 = 0x7051
-0x9761 = 0x7353
-0x9762 = 0x4C4C
-0x9764 = 0x7052
-0x9766 = 0x7053
-0x9768 = 0x7054
-0x9769 = 0x3357
-0x976B = 0x7056
-0x976D = 0x3F59
-0x9771 = 0x7057
-0x9774 = 0x3724
-0x9779 = 0x7058
-0x977A = 0x705C
-0x977C = 0x705A
-0x9781 = 0x705B
-0x9784 = 0x3373
-0x9785 = 0x7059
-0x9786 = 0x705D
-0x978B = 0x705E
-0x978D = 0x3048
-0x978F = 0x705F
-0x9790 = 0x7060
-0x9798 = 0x3E64
-0x979C = 0x7061
-0x97A0 = 0x3547
-0x97A3 = 0x7064
-0x97A6 = 0x7063
-0x97A8 = 0x7062
-0x97AB = 0x6B71
-0x97AD = 0x4A5C
-0x97B3 = 0x7065
-0x97B4 = 0x7066
-0x97C3 = 0x7067
-0x97C6 = 0x7068
-0x97C8 = 0x7069
-0x97CB = 0x706A
-0x97D3 = 0x345A
-0x97DC = 0x706B
-0x97ED = 0x706C
-0x97EE = 0x4723
-0x97F2 = 0x706E
-0x97F3 = 0x323B
-0x97F5 = 0x7071
-0x97F6 = 0x7070
-0x97FB = 0x3124
-0x97FF = 0x3641
-0x9801 = 0x4A47
-0x9802 = 0x443A
-0x9803 = 0x3A22
-0x9805 = 0x3960
-0x9806 = 0x3D67
-0x9808 = 0x3F5C
-0x980C = 0x7073
-0x980F = 0x7072
-0x9810 = 0x4D42
-0x9811 = 0x3468
-0x9812 = 0x4852
-0x9813 = 0x465C
-0x9817 = 0x3F7C
-0x9818 = 0x4E4E
-0x981A = 0x375B
-0x9821 = 0x7076
-0x9824 = 0x7075
-0x982C = 0x4B4B
-0x982D = 0x462C
-0x9834 = 0x3150
-0x9837 = 0x7077
-0x9838 = 0x7074
-0x983B = 0x4951
-0x983C = 0x4D6A
-0x983D = 0x7078
-0x9846 = 0x7079
-0x984B = 0x707B
-0x984C = 0x426A
-0x984D = 0x335B
-0x984E = 0x335C
-0x984F = 0x707A
-0x9854 = 0x3469
-0x9855 = 0x3832
-0x9858 = 0x346A
-0x985B = 0x453F
-0x985E = 0x4E60
-0x9867 = 0x385C
-0x986B = 0x707C
-0x986F = 0x707D
-0x9870 = 0x707E
-0x9871 = 0x7121
-0x9873 = 0x7123
-0x9874 = 0x7122
-0x98A8 = 0x4977
-0x98AA = 0x7124
-0x98AF = 0x7125
-0x98B1 = 0x7126
-0x98B6 = 0x7127
-0x98C3 = 0x7129
-0x98C4 = 0x7128
-0x98C6 = 0x712A
-0x98DB = 0x4874
-0x98DC = 0x664C
-0x98DF = 0x3F29
-0x98E2 = 0x3532
-0x98E9 = 0x712B
-0x98EB = 0x712C
-0x98ED = 0x522C
-0x98EE = 0x5D3B
-0x98EF = 0x4853
-0x98F2 = 0x307B
-0x98F4 = 0x303B
-0x98FC = 0x3B74
-0x98FD = 0x4B30
-0x98FE = 0x3E7E
-0x9903 = 0x712D
-0x9905 = 0x4C5F
-0x9909 = 0x712E
-0x990A = 0x4D5C
-0x990C = 0x3142
-0x9910 = 0x3B41
-0x9912 = 0x712F
-0x9913 = 0x326E
-0x9914 = 0x7130
-0x9918 = 0x7131
-0x991D = 0x7133
-0x991E = 0x7134
-0x9920 = 0x7136
-0x9921 = 0x7132
-0x9924 = 0x7135
-0x9928 = 0x345B
-0x992C = 0x7137
-0x992E = 0x7138
-0x993D = 0x7139
-0x993E = 0x713A
-0x9942 = 0x713B
-0x9945 = 0x713D
-0x9949 = 0x713C
-0x994B = 0x713F
-0x994C = 0x7142
-0x9950 = 0x713E
-0x9951 = 0x7140
-0x9952 = 0x7141
-0x9955 = 0x7143
-0x9957 = 0x3642
-0x9996 = 0x3C73
-0x9997 = 0x7144
-0x9998 = 0x7145
-0x9999 = 0x3961
-0x99A5 = 0x7146
-0x99A8 = 0x333E
-0x99AC = 0x474F
-0x99AD = 0x7147
-0x99AE = 0x7148
-0x99B3 = 0x435A
-0x99B4 = 0x466B
-0x99BC = 0x7149
-0x99C1 = 0x477D
-0x99C4 = 0x424C
-0x99C5 = 0x3158
-0x99C6 = 0x366E
-0x99C8 = 0x366F
-0x99D0 = 0x4373
-0x99D1 = 0x714E
-0x99D2 = 0x3670
-0x99D5 = 0x326F
-0x99D8 = 0x714D
-0x99DB = 0x714B
-0x99DD = 0x714C
-0x99DF = 0x714A
-0x99E2 = 0x7158
-0x99ED = 0x714F
-0x99EE = 0x7150
-0x99F1 = 0x7151
-0x99F2 = 0x7152
-0x99F8 = 0x7154
-0x99FB = 0x7153
-0x99FF = 0x3D59
-0x9A01 = 0x7155
-0x9A05 = 0x7157
-0x9A0E = 0x3533
-0x9A0F = 0x7156
-0x9A12 = 0x417B
-0x9A13 = 0x3833
-0x9A19 = 0x7159
-0x9A28 = 0x424D
-0x9A2B = 0x715A
-0x9A30 = 0x462D
-0x9A37 = 0x715B
-0x9A3E = 0x7160
-0x9A40 = 0x715E
-0x9A42 = 0x715D
-0x9A43 = 0x715F
-0x9A45 = 0x715C
-0x9A4D = 0x7162
-0x9A55 = 0x7161
-0x9A57 = 0x7164
-0x9A5A = 0x3643
-0x9A5B = 0x7163
-0x9A5F = 0x7165
-0x9A62 = 0x7166
-0x9A64 = 0x7168
-0x9A65 = 0x7167
-0x9A69 = 0x7169
-0x9A6A = 0x716B
-0x9A6B = 0x716A
-0x9AA8 = 0x397C
-0x9AAD = 0x716C
-0x9AB0 = 0x716D
-0x9AB8 = 0x333C
-0x9ABC = 0x716E
-0x9AC0 = 0x716F
-0x9AC4 = 0x3F71
-0x9ACF = 0x7170
-0x9AD1 = 0x7171
-0x9AD3 = 0x7172
-0x9AD4 = 0x7173
-0x9AD8 = 0x3962
-0x9ADE = 0x7174
-0x9ADF = 0x7175
-0x9AE2 = 0x7176
-0x9AE3 = 0x7177
-0x9AE6 = 0x7178
-0x9AEA = 0x4831
-0x9AEB = 0x717A
-0x9AED = 0x4926
-0x9AEE = 0x717B
-0x9AEF = 0x7179
-0x9AF1 = 0x717D
-0x9AF4 = 0x717C
-0x9AF7 = 0x717E
-0x9AFB = 0x7221
-0x9B06 = 0x7222
-0x9B18 = 0x7223
-0x9B1A = 0x7224
-0x9B1F = 0x7225
-0x9B22 = 0x7226
-0x9B23 = 0x7227
-0x9B25 = 0x7228
-0x9B27 = 0x7229
-0x9B28 = 0x722A
-0x9B29 = 0x722B
-0x9B2A = 0x722C
-0x9B2E = 0x722D
-0x9B2F = 0x722E
-0x9B31 = 0x5D35
-0x9B32 = 0x722F
-0x9B3B = 0x6478
-0x9B3C = 0x3534
-0x9B41 = 0x3321
-0x9B42 = 0x3A32
-0x9B43 = 0x7231
-0x9B44 = 0x7230
-0x9B45 = 0x4C25
-0x9B4D = 0x7233
-0x9B4E = 0x7234
-0x9B4F = 0x7232
-0x9B51 = 0x7235
-0x9B54 = 0x4B62
-0x9B58 = 0x7236
-0x9B5A = 0x357B
-0x9B6F = 0x4F25
-0x9B74 = 0x7237
-0x9B83 = 0x7239
-0x9B8E = 0x303E
-0x9B91 = 0x723A
-0x9B92 = 0x4A2B
-0x9B93 = 0x7238
-0x9B96 = 0x723B
-0x9B97 = 0x723C
-0x9B9F = 0x723D
-0x9BA0 = 0x723E
-0x9BA8 = 0x723F
-0x9BAA = 0x4B6E
-0x9BAB = 0x3B2D
-0x9BAD = 0x3A7A
-0x9BAE = 0x412F
-0x9BB4 = 0x7240
-0x9BB9 = 0x7243
-0x9BC0 = 0x7241
-0x9BC6 = 0x7244
-0x9BC9 = 0x3871
-0x9BCA = 0x7242
-0x9BCF = 0x7245
-0x9BD1 = 0x7246
-0x9BD2 = 0x7247
-0x9BD4 = 0x724B
-0x9BD6 = 0x3B2A
-0x9BDB = 0x4264
-0x9BE1 = 0x724C
-0x9BE2 = 0x7249
-0x9BE3 = 0x7248
-0x9BE4 = 0x724A
-0x9BE8 = 0x375F
-0x9BF0 = 0x7250
-0x9BF1 = 0x724F
-0x9BF2 = 0x724E
-0x9BF5 = 0x3033
-0x9C04 = 0x725A
-0x9C06 = 0x7256
-0x9C08 = 0x7257
-0x9C09 = 0x7253
-0x9C0A = 0x7259
-0x9C0C = 0x7255
-0x9C0D = 0x3362
-0x9C10 = 0x4F4C
-0x9C12 = 0x7258
-0x9C13 = 0x7254
-0x9C14 = 0x7252
-0x9C15 = 0x7251
-0x9C1B = 0x725C
-0x9C21 = 0x725F
-0x9C24 = 0x725E
-0x9C25 = 0x725D
-0x9C2D = 0x4949
-0x9C2E = 0x725B
-0x9C2F = 0x3073
-0x9C30 = 0x7260
-0x9C32 = 0x7262
-0x9C39 = 0x336F
-0x9C3A = 0x724D
-0x9C3B = 0x3137
-0x9C3E = 0x7264
-0x9C46 = 0x7263
-0x9C47 = 0x7261
-0x9C48 = 0x432D
-0x9C52 = 0x4B70
-0x9C57 = 0x4E5A
-0x9C5A = 0x7265
-0x9C60 = 0x7266
-0x9C67 = 0x7267
-0x9C76 = 0x7268
-0x9C78 = 0x7269
-0x9CE5 = 0x443B
-0x9CE7 = 0x726A
-0x9CE9 = 0x4837
-0x9CEB = 0x726F
-0x9CEC = 0x726B
-0x9CF0 = 0x726C
-0x9CF3 = 0x4B31
-0x9CF4 = 0x4C44
-0x9CF6 = 0x4650
-0x9D03 = 0x7270
-0x9D06 = 0x7271
-0x9D07 = 0x463E
-0x9D08 = 0x726E
-0x9D09 = 0x726D
-0x9D0E = 0x322A
-0x9D12 = 0x7279
-0x9D15 = 0x7278
-0x9D1B = 0x3175
-0x9D1F = 0x7276
-0x9D23 = 0x7275
-0x9D26 = 0x7273
-0x9D28 = 0x337B
-0x9D2A = 0x7272
-0x9D2B = 0x3C32
-0x9D2C = 0x3229
-0x9D3B = 0x3963
-0x9D3E = 0x727C
-0x9D3F = 0x727B
-0x9D41 = 0x727A
-0x9D44 = 0x7277
-0x9D46 = 0x727D
-0x9D48 = 0x727E
-0x9D50 = 0x7325
-0x9D51 = 0x7324
-0x9D59 = 0x7326
-0x9D5C = 0x312D
-0x9D5D = 0x7321
-0x9D5E = 0x7322
-0x9D60 = 0x3974
-0x9D61 = 0x4C39
-0x9D64 = 0x7323
-0x9D6C = 0x4B32
-0x9D6F = 0x732B
-0x9D72 = 0x7327
-0x9D7A = 0x732C
-0x9D87 = 0x7329
-0x9D89 = 0x7328
-0x9D8F = 0x375C
-0x9D9A = 0x732D
-0x9DA4 = 0x732E
-0x9DA9 = 0x732F
-0x9DAB = 0x732A
-0x9DAF = 0x7274
-0x9DB2 = 0x7330
-0x9DB4 = 0x4461
-0x9DB8 = 0x7334
-0x9DBA = 0x7335
-0x9DBB = 0x7333
-0x9DC1 = 0x7332
-0x9DC2 = 0x7338
-0x9DC4 = 0x7331
-0x9DC6 = 0x7336
-0x9DCF = 0x7337
-0x9DD3 = 0x733A
-0x9DD9 = 0x7339
-0x9DE6 = 0x733C
-0x9DED = 0x733D
-0x9DEF = 0x733E
-0x9DF2 = 0x4F49
-0x9DF8 = 0x733B
-0x9DF9 = 0x426B
-0x9DFA = 0x3A6D
-0x9DFD = 0x733F
-0x9E1A = 0x7340
-0x9E1B = 0x7341
-0x9E1E = 0x7342
-0x9E75 = 0x7343
-0x9E78 = 0x3834
-0x9E79 = 0x7344
-0x9E7D = 0x7345
-0x9E7F = 0x3C2F
-0x9E81 = 0x7346
-0x9E88 = 0x7347
-0x9E8B = 0x7348
-0x9E8C = 0x7349
-0x9E91 = 0x734C
-0x9E92 = 0x734A
-0x9E93 = 0x4F3C
-0x9E95 = 0x734B
-0x9E97 = 0x4E6F
-0x9E9D = 0x734D
-0x9E9F = 0x4E5B
-0x9EA5 = 0x734E
-0x9EA6 = 0x477E
-0x9EA9 = 0x734F
-0x9EAA = 0x7351
-0x9EAD = 0x7352
-0x9EB8 = 0x7350
-0x9EB9 = 0x396D
-0x9EBA = 0x4C4D
-0x9EBB = 0x4B63
-0x9EBC = 0x5677
-0x9EBE = 0x5D60
-0x9EBF = 0x4B7B
-0x9EC4 = 0x322B
-0x9ECC = 0x7354
-0x9ECD = 0x3550
-0x9ECE = 0x7355
-0x9ECF = 0x7356
-0x9ED0 = 0x7357
-0x9ED2 = 0x3975
-0x9ED4 = 0x7358
-0x9ED8 = 0x6054
-0x9ED9 = 0x4C5B
-0x9EDB = 0x4263
-0x9EDC = 0x7359
-0x9EDD = 0x735B
-0x9EDE = 0x735A
-0x9EE0 = 0x735C
-0x9EE5 = 0x735D
-0x9EE8 = 0x735E
-0x9EEF = 0x735F
-0x9EF4 = 0x7360
-0x9EF6 = 0x7361
-0x9EF7 = 0x7362
-0x9EF9 = 0x7363
-0x9EFB = 0x7364
-0x9EFC = 0x7365
-0x9EFD = 0x7366
-0x9F07 = 0x7367
-0x9F08 = 0x7368
-0x9F0E = 0x4524
-0x9F13 = 0x385D
-0x9F15 = 0x736A
-0x9F20 = 0x414D
-0x9F21 = 0x736B
-0x9F2C = 0x736C
-0x9F3B = 0x4921
-0x9F3E = 0x736D
-0x9F4A = 0x736E
-0x9F4B = 0x6337
-0x9F4E = 0x6C5A
-0x9F4F = 0x706D
-0x9F52 = 0x736F
-0x9F54 = 0x7370
-0x9F5F = 0x7372
-0x9F60 = 0x7373
-0x9F61 = 0x7374
-0x9F62 = 0x4E70
-0x9F63 = 0x7371
-0x9F66 = 0x7375
-0x9F67 = 0x7376
-0x9F6A = 0x7378
-0x9F6C = 0x7377
-0x9F72 = 0x737A
-0x9F76 = 0x737B
-0x9F77 = 0x7379
-0x9F8D = 0x4E36
-0x9F95 = 0x737C
-0x9F9C = 0x737D
-0x9F9D = 0x6354
-0x9FA0 = 0x737E
-0xFF01 = 0x212A
-0xFF03 = 0x2174
-0xFF04 = 0x2170
-0xFF05 = 0x2173
-0xFF06 = 0x2175
-0xFF08 = 0x214A
-0xFF09 = 0x214B
-0xFF0A = 0x2176
-0xFF0B = 0x215C
-0xFF0C = 0x2124
-0xFF0E = 0x2125
-0xFF0F = 0x213F
-0xFF10 = 0x2330
-0xFF11 = 0x2331
-0xFF12 = 0x2332
-0xFF13 = 0x2333
-0xFF14 = 0x2334
-0xFF15 = 0x2335
-0xFF16 = 0x2336
-0xFF17 = 0x2337
-0xFF18 = 0x2338
-0xFF19 = 0x2339
-0xFF1A = 0x2127
-0xFF1B = 0x2128
-0xFF1C = 0x2163
-0xFF1D = 0x2161
-0xFF1E = 0x2164
-0xFF1F = 0x2129
-0xFF20 = 0x2177
-0xFF21 = 0x2341
-0xFF22 = 0x2342
-0xFF23 = 0x2343
-0xFF24 = 0x2344
-0xFF25 = 0x2345
-0xFF26 = 0x2346
-0xFF27 = 0x2347
-0xFF28 = 0x2348
-0xFF29 = 0x2349
-0xFF2A = 0x234A
-0xFF2B = 0x234B
-0xFF2C = 0x234C
-0xFF2D = 0x234D
-0xFF2E = 0x234E
-0xFF2F = 0x234F
-0xFF30 = 0x2350
-0xFF31 = 0x2351
-0xFF32 = 0x2352
-0xFF33 = 0x2353
-0xFF34 = 0x2354
-0xFF35 = 0x2355
-0xFF36 = 0x2356
-0xFF37 = 0x2357
-0xFF38 = 0x2358
-0xFF39 = 0x2359
-0xFF3A = 0x235A
-0xFF3B = 0x214E
-0xFF3C = 0x2140
-0xFF3D = 0x214F
-0xFF3E = 0x2130
-0xFF3F = 0x2132
-0xFF40 = 0x212E
-0xFF41 = 0x2361
-0xFF42 = 0x2362
-0xFF43 = 0x2363
-0xFF44 = 0x2364
-0xFF45 = 0x2365
-0xFF46 = 0x2366
-0xFF47 = 0x2367
-0xFF48 = 0x2368
-0xFF49 = 0x2369
-0xFF4A = 0x236A
-0xFF4B = 0x236B
-0xFF4C = 0x236C
-0xFF4D = 0x236D
-0xFF4E = 0x236E
-0xFF4F = 0x236F
-0xFF50 = 0x2370
-0xFF51 = 0x2371
-0xFF52 = 0x2372
-0xFF53 = 0x2373
-0xFF54 = 0x2374
-0xFF55 = 0x2375
-0xFF56 = 0x2376
-0xFF57 = 0x2377
-0xFF58 = 0x2378
-0xFF59 = 0x2379
-0xFF5A = 0x237A
-0xFF5B = 0x2150
-0xFF5C = 0x2143
-0xFF5D = 0x2151
-0xFFE3 = 0x2131
-0xFFE5 = 0x216F
-END_MAP
diff --git a/enc/trans/JIS/UCS%JISX0208@MS.src b/enc/trans/JIS/UCS%JISX0208@MS.src
deleted file mode 100644
index 7fa662ee96..0000000000
--- a/enc/trans/JIS/UCS%JISX0208@MS.src
+++ /dev/null
@@ -1,6894 +0,0 @@
-# $NetBSD: UCS%JISX0208@MS.src,v 1.1 2003/07/19 20:20:42 tshiozak Exp $
-
-TYPE ROWCOL
-NAME "UCS/JISX0208:MS"
-SRC_ZONE 0x0000 - 0xFFFF
-OOB_MODE INVALID
-DST_INVALID 0xFFFF
-DST_UNIT_BITS 16
-
-BEGIN_MAP
-0x0000 - 0xFFFF = INVALID
-#
-# This data is derived from http://www.opengroup.or.jp/jvc/cde/
-#
-0x00A7 = 0x2178
-0x00A8 = 0x212F
-0x00B0 = 0x216B
-0x00B1 = 0x215E
-0x00B4 = 0x212D
-0x00B6 = 0x2279
-0x00D7 = 0x215F
-0x00F7 = 0x2160
-0x0391 = 0x2621
-0x0392 = 0x2622
-0x0393 = 0x2623
-0x0394 = 0x2624
-0x0395 = 0x2625
-0x0396 = 0x2626
-0x0397 = 0x2627
-0x0398 = 0x2628
-0x0399 = 0x2629
-0x039A = 0x262A
-0x039B = 0x262B
-0x039C = 0x262C
-0x039D = 0x262D
-0x039E = 0x262E
-0x039F = 0x262F
-0x03A0 = 0x2630
-0x03A1 = 0x2631
-0x03A3 = 0x2632
-0x03A4 = 0x2633
-0x03A5 = 0x2634
-0x03A6 = 0x2635
-0x03A7 = 0x2636
-0x03A8 = 0x2637
-0x03A9 = 0x2638
-0x03B1 = 0x2641
-0x03B2 = 0x2642
-0x03B3 = 0x2643
-0x03B4 = 0x2644
-0x03B5 = 0x2645
-0x03B6 = 0x2646
-0x03B7 = 0x2647
-0x03B8 = 0x2648
-0x03B9 = 0x2649
-0x03BA = 0x264A
-0x03BB = 0x264B
-0x03BC = 0x264C
-0x03BD = 0x264D
-0x03BE = 0x264E
-0x03BF = 0x264F
-0x03C0 = 0x2650
-0x03C1 = 0x2651
-0x03C3 = 0x2652
-0x03C4 = 0x2653
-0x03C5 = 0x2654
-0x03C6 = 0x2655
-0x03C7 = 0x2656
-0x03C8 = 0x2657
-0x03C9 = 0x2658
-0x0401 = 0x2727
-0x0410 = 0x2721
-0x0411 = 0x2722
-0x0412 = 0x2723
-0x0413 = 0x2724
-0x0414 = 0x2725
-0x0415 = 0x2726
-0x0416 = 0x2728
-0x0417 = 0x2729
-0x0418 = 0x272A
-0x0419 = 0x272B
-0x041A = 0x272C
-0x041B = 0x272D
-0x041C = 0x272E
-0x041D = 0x272F
-0x041E = 0x2730
-0x041F = 0x2731
-0x0420 = 0x2732
-0x0421 = 0x2733
-0x0422 = 0x2734
-0x0423 = 0x2735
-0x0424 = 0x2736
-0x0425 = 0x2737
-0x0426 = 0x2738
-0x0427 = 0x2739
-0x0428 = 0x273A
-0x0429 = 0x273B
-0x042A = 0x273C
-0x042B = 0x273D
-0x042C = 0x273E
-0x042D = 0x273F
-0x042E = 0x2740
-0x042F = 0x2741
-0x0430 = 0x2751
-0x0431 = 0x2752
-0x0432 = 0x2753
-0x0433 = 0x2754
-0x0434 = 0x2755
-0x0435 = 0x2756
-0x0436 = 0x2758
-0x0437 = 0x2759
-0x0438 = 0x275A
-0x0439 = 0x275B
-0x043A = 0x275C
-0x043B = 0x275D
-0x043C = 0x275E
-0x043D = 0x275F
-0x043E = 0x2760
-0x043F = 0x2761
-0x0440 = 0x2762
-0x0441 = 0x2763
-0x0442 = 0x2764
-0x0443 = 0x2765
-0x0444 = 0x2766
-0x0445 = 0x2767
-0x0446 = 0x2768
-0x0447 = 0x2769
-0x0448 = 0x276A
-0x0449 = 0x276B
-0x044A = 0x276C
-0x044B = 0x276D
-0x044C = 0x276E
-0x044D = 0x276F
-0x044E = 0x2770
-0x044F = 0x2771
-0x0451 = 0x2757
-0x2010 = 0x213E
-0x2015 = 0x213D
-0x2018 = 0x2146
-0x2019 = 0x2147
-0x201C = 0x2148
-0x201D = 0x2149
-0x2020 = 0x2277
-0x2021 = 0x2278
-0x2025 = 0x2145
-0x2026 = 0x2144
-0x2030 = 0x2273
-0x2032 = 0x216C
-0x2033 = 0x216D
-0x203B = 0x2228
-0x2103 = 0x216E
-0x212B = 0x2272
-0x2190 = 0x222B
-0x2191 = 0x222C
-0x2192 = 0x222A
-0x2193 = 0x222D
-0x21D2 = 0x224D
-0x21D4 = 0x224E
-0x2200 = 0x224F
-0x2202 = 0x225F
-0x2203 = 0x2250
-0x2207 = 0x2260
-0x2208 = 0x223A
-0x220B = 0x223B
-0x221A = 0x2265
-0x221D = 0x2267
-0x221E = 0x2167
-0x2220 = 0x225C
-0x2225 = 0x2142
-0x2227 = 0x224A
-0x2228 = 0x224B
-0x2229 = 0x2241
-0x222A = 0x2240
-0x222B = 0x2269
-0x222C = 0x226A
-0x2234 = 0x2168
-0x2235 = 0x2268
-0x223D = 0x2266
-0x2252 = 0x2262
-0x2260 = 0x2162
-0x2261 = 0x2261
-0x2266 = 0x2165
-0x2267 = 0x2166
-0x226A = 0x2263
-0x226B = 0x2264
-0x2282 = 0x223E
-0x2283 = 0x223F
-0x2286 = 0x223C
-0x2287 = 0x223D
-0x22A5 = 0x225D
-0x2312 = 0x225E
-0x2500 = 0x2821
-0x2501 = 0x282C
-0x2502 = 0x2822
-0x2503 = 0x282D
-0x250C = 0x2823
-0x250F = 0x282E
-0x2510 = 0x2824
-0x2513 = 0x282F
-0x2514 = 0x2826
-0x2517 = 0x2831
-0x2518 = 0x2825
-0x251B = 0x2830
-0x251C = 0x2827
-0x251D = 0x283C
-0x2520 = 0x2837
-0x2523 = 0x2832
-0x2524 = 0x2829
-0x2525 = 0x283E
-0x2528 = 0x2839
-0x252B = 0x2834
-0x252C = 0x2828
-0x252F = 0x2838
-0x2530 = 0x283D
-0x2533 = 0x2833
-0x2534 = 0x282A
-0x2537 = 0x283A
-0x2538 = 0x283F
-0x253B = 0x2835
-0x253C = 0x282B
-0x253F = 0x283B
-0x2542 = 0x2840
-0x254B = 0x2836
-0x25A0 = 0x2223
-0x25A1 = 0x2222
-0x25B2 = 0x2225
-0x25B3 = 0x2224
-0x25BC = 0x2227
-0x25BD = 0x2226
-0x25C6 = 0x2221
-0x25C7 = 0x217E
-0x25CB = 0x217B
-0x25CE = 0x217D
-0x25CF = 0x217C
-0x25EF = 0x227E
-0x2605 = 0x217A
-0x2606 = 0x2179
-0x2640 = 0x216A
-0x2642 = 0x2169
-0x266A = 0x2276
-0x266D = 0x2275
-0x266F = 0x2274
-0x3000 = 0x2121
-0x3001 = 0x2122
-0x3002 = 0x2123
-0x3003 = 0x2137
-0x3005 = 0x2139
-0x3006 = 0x213A
-0x3007 = 0x213B
-0x3008 = 0x2152
-0x3009 = 0x2153
-0x300A = 0x2154
-0x300B = 0x2155
-0x300C = 0x2156
-0x300D = 0x2157
-0x300E = 0x2158
-0x300F = 0x2159
-0x3010 = 0x215A
-0x3011 = 0x215B
-0x3012 = 0x2229
-0x3013 = 0x222E
-0x3014 = 0x214C
-0x3015 = 0x214D
-0x3041 = 0x2421
-0x3042 = 0x2422
-0x3043 = 0x2423
-0x3044 = 0x2424
-0x3045 = 0x2425
-0x3046 = 0x2426
-0x3047 = 0x2427
-0x3048 = 0x2428
-0x3049 = 0x2429
-0x304A = 0x242A
-0x304B = 0x242B
-0x304C = 0x242C
-0x304D = 0x242D
-0x304E = 0x242E
-0x304F = 0x242F
-0x3050 = 0x2430
-0x3051 = 0x2431
-0x3052 = 0x2432
-0x3053 = 0x2433
-0x3054 = 0x2434
-0x3055 = 0x2435
-0x3056 = 0x2436
-0x3057 = 0x2437
-0x3058 = 0x2438
-0x3059 = 0x2439
-0x305A = 0x243A
-0x305B = 0x243B
-0x305C = 0x243C
-0x305D = 0x243D
-0x305E = 0x243E
-0x305F = 0x243F
-0x3060 = 0x2440
-0x3061 = 0x2441
-0x3062 = 0x2442
-0x3063 = 0x2443
-0x3064 = 0x2444
-0x3065 = 0x2445
-0x3066 = 0x2446
-0x3067 = 0x2447
-0x3068 = 0x2448
-0x3069 = 0x2449
-0x306A = 0x244A
-0x306B = 0x244B
-0x306C = 0x244C
-0x306D = 0x244D
-0x306E = 0x244E
-0x306F = 0x244F
-0x3070 = 0x2450
-0x3071 = 0x2451
-0x3072 = 0x2452
-0x3073 = 0x2453
-0x3074 = 0x2454
-0x3075 = 0x2455
-0x3076 = 0x2456
-0x3077 = 0x2457
-0x3078 = 0x2458
-0x3079 = 0x2459
-0x307A = 0x245A
-0x307B = 0x245B
-0x307C = 0x245C
-0x307D = 0x245D
-0x307E = 0x245E
-0x307F = 0x245F
-0x3080 = 0x2460
-0x3081 = 0x2461
-0x3082 = 0x2462
-0x3083 = 0x2463
-0x3084 = 0x2464
-0x3085 = 0x2465
-0x3086 = 0x2466
-0x3087 = 0x2467
-0x3088 = 0x2468
-0x3089 = 0x2469
-0x308A = 0x246A
-0x308B = 0x246B
-0x308C = 0x246C
-0x308D = 0x246D
-0x308E = 0x246E
-0x308F = 0x246F
-0x3090 = 0x2470
-0x3091 = 0x2471
-0x3092 = 0x2472
-0x3093 = 0x2473
-0x309B = 0x212B
-0x309C = 0x212C
-0x309D = 0x2135
-0x309E = 0x2136
-0x30A1 = 0x2521
-0x30A2 = 0x2522
-0x30A3 = 0x2523
-0x30A4 = 0x2524
-0x30A5 = 0x2525
-0x30A6 = 0x2526
-0x30A7 = 0x2527
-0x30A8 = 0x2528
-0x30A9 = 0x2529
-0x30AA = 0x252A
-0x30AB = 0x252B
-0x30AC = 0x252C
-0x30AD = 0x252D
-0x30AE = 0x252E
-0x30AF = 0x252F
-0x30B0 = 0x2530
-0x30B1 = 0x2531
-0x30B2 = 0x2532
-0x30B3 = 0x2533
-0x30B4 = 0x2534
-0x30B5 = 0x2535
-0x30B6 = 0x2536
-0x30B7 = 0x2537
-0x30B8 = 0x2538
-0x30B9 = 0x2539
-0x30BA = 0x253A
-0x30BB = 0x253B
-0x30BC = 0x253C
-0x30BD = 0x253D
-0x30BE = 0x253E
-0x30BF = 0x253F
-0x30C0 = 0x2540
-0x30C1 = 0x2541
-0x30C2 = 0x2542
-0x30C3 = 0x2543
-0x30C4 = 0x2544
-0x30C5 = 0x2545
-0x30C6 = 0x2546
-0x30C7 = 0x2547
-0x30C8 = 0x2548
-0x30C9 = 0x2549
-0x30CA = 0x254A
-0x30CB = 0x254B
-0x30CC = 0x254C
-0x30CD = 0x254D
-0x30CE = 0x254E
-0x30CF = 0x254F
-0x30D0 = 0x2550
-0x30D1 = 0x2551
-0x30D2 = 0x2552
-0x30D3 = 0x2553
-0x30D4 = 0x2554
-0x30D5 = 0x2555
-0x30D6 = 0x2556
-0x30D7 = 0x2557
-0x30D8 = 0x2558
-0x30D9 = 0x2559
-0x30DA = 0x255A
-0x30DB = 0x255B
-0x30DC = 0x255C
-0x30DD = 0x255D
-0x30DE = 0x255E
-0x30DF = 0x255F
-0x30E0 = 0x2560
-0x30E1 = 0x2561
-0x30E2 = 0x2562
-0x30E3 = 0x2563
-0x30E4 = 0x2564
-0x30E5 = 0x2565
-0x30E6 = 0x2566
-0x30E7 = 0x2567
-0x30E8 = 0x2568
-0x30E9 = 0x2569
-0x30EA = 0x256A
-0x30EB = 0x256B
-0x30EC = 0x256C
-0x30ED = 0x256D
-0x30EE = 0x256E
-0x30EF = 0x256F
-0x30F0 = 0x2570
-0x30F1 = 0x2571
-0x30F2 = 0x2572
-0x30F3 = 0x2573
-0x30F4 = 0x2574
-0x30F5 = 0x2575
-0x30F6 = 0x2576
-0x30FB = 0x2126
-0x30FC = 0x213C
-0x30FD = 0x2133
-0x30FE = 0x2134
-0x4E00 = 0x306C
-0x4E01 = 0x437A
-0x4E03 = 0x3C37
-0x4E07 = 0x4B7C
-0x4E08 = 0x3E66
-0x4E09 = 0x3B30
-0x4E0A = 0x3E65
-0x4E0B = 0x323C
-0x4E0D = 0x4954
-0x4E0E = 0x4D3F
-0x4E10 = 0x5022
-0x4E11 = 0x312F
-0x4E14 = 0x336E
-0x4E15 = 0x5023
-0x4E16 = 0x4024
-0x4E17 = 0x5242
-0x4E18 = 0x3556
-0x4E19 = 0x4A3A
-0x4E1E = 0x3E67
-0x4E21 = 0x4E3E
-0x4E26 = 0x4A42
-0x4E2A = 0x5024
-0x4E2D = 0x4366
-0x4E31 = 0x5025
-0x4E32 = 0x367A
-0x4E36 = 0x5026
-0x4E38 = 0x345D
-0x4E39 = 0x4330
-0x4E3B = 0x3C67
-0x4E3C = 0x5027
-0x4E3F = 0x5028
-0x4E42 = 0x5029
-0x4E43 = 0x4735
-0x4E45 = 0x3557
-0x4E4B = 0x4737
-0x4E4D = 0x4663
-0x4E4E = 0x3843
-0x4E4F = 0x4B33
-0x4E55 = 0x6949
-0x4E56 = 0x502A
-0x4E57 = 0x3E68
-0x4E58 = 0x502B
-0x4E59 = 0x3235
-0x4E5D = 0x3665
-0x4E5E = 0x3870
-0x4E5F = 0x4C69
-0x4E62 = 0x5626
-0x4E71 = 0x4D70
-0x4E73 = 0x467D
-0x4E7E = 0x3425
-0x4E80 = 0x3535
-0x4E82 = 0x502C
-0x4E85 = 0x502D
-0x4E86 = 0x4E3B
-0x4E88 = 0x4D3D
-0x4E89 = 0x4168
-0x4E8A = 0x502F
-0x4E8B = 0x3B76
-0x4E8C = 0x4673
-0x4E8E = 0x5032
-0x4E91 = 0x313E
-0x4E92 = 0x385F
-0x4E94 = 0x385E
-0x4E95 = 0x3066
-0x4E98 = 0x4F4B
-0x4E99 = 0x4F4A
-0x4E9B = 0x3A33
-0x4E9C = 0x3021
-0x4E9E = 0x5033
-0x4E9F = 0x5034
-0x4EA0 = 0x5035
-0x4EA1 = 0x4B34
-0x4EA2 = 0x5036
-0x4EA4 = 0x3872
-0x4EA5 = 0x3067
-0x4EA6 = 0x4B72
-0x4EA8 = 0x357C
-0x4EAB = 0x357D
-0x4EAC = 0x357E
-0x4EAD = 0x4462
-0x4EAE = 0x4E3C
-0x4EB0 = 0x5037
-0x4EB3 = 0x5038
-0x4EB6 = 0x5039
-0x4EBA = 0x3F4D
-0x4EC0 = 0x3D3A
-0x4EC1 = 0x3F4E
-0x4EC2 = 0x503E
-0x4EC4 = 0x503C
-0x4EC6 = 0x503D
-0x4EC7 = 0x3558
-0x4ECA = 0x3A23
-0x4ECB = 0x3270
-0x4ECD = 0x503B
-0x4ECE = 0x503A
-0x4ECF = 0x4A29
-0x4ED4 = 0x3B46
-0x4ED5 = 0x3B45
-0x4ED6 = 0x423E
-0x4ED7 = 0x503F
-0x4ED8 = 0x4955
-0x4ED9 = 0x4067
-0x4EDD = 0x2138
-0x4EDE = 0x5040
-0x4EDF = 0x5042
-0x4EE3 = 0x4265
-0x4EE4 = 0x4E61
-0x4EE5 = 0x304A
-0x4EED = 0x5041
-0x4EEE = 0x323E
-0x4EF0 = 0x3644
-0x4EF2 = 0x4367
-0x4EF6 = 0x376F
-0x4EF7 = 0x5043
-0x4EFB = 0x4724
-0x4F01 = 0x346B
-0x4F09 = 0x5044
-0x4F0A = 0x304B
-0x4F0D = 0x3860
-0x4F0E = 0x346C
-0x4F0F = 0x497A
-0x4F10 = 0x4832
-0x4F11 = 0x3559
-0x4F1A = 0x3271
-0x4F1C = 0x5067
-0x4F1D = 0x4541
-0x4F2F = 0x476C
-0x4F30 = 0x5046
-0x4F34 = 0x483C
-0x4F36 = 0x4E62
-0x4F38 = 0x3F2D
-0x4F3A = 0x3B47
-0x4F3C = 0x3B77
-0x4F3D = 0x3240
-0x4F43 = 0x4451
-0x4F46 = 0x4322
-0x4F47 = 0x504A
-0x4F4D = 0x304C
-0x4F4E = 0x4463
-0x4F4F = 0x3D3B
-0x4F50 = 0x3A34
-0x4F51 = 0x4D24
-0x4F53 = 0x424E
-0x4F55 = 0x323F
-0x4F57 = 0x5049
-0x4F59 = 0x4D3E
-0x4F5A = 0x5045
-0x4F5B = 0x5047
-0x4F5C = 0x3A6E
-0x4F5D = 0x5048
-0x4F5E = 0x5524
-0x4F69 = 0x5050
-0x4F6F = 0x5053
-0x4F70 = 0x5051
-0x4F73 = 0x3242
-0x4F75 = 0x4A3B
-0x4F76 = 0x504B
-0x4F7B = 0x504F
-0x4F7C = 0x3873
-0x4F7F = 0x3B48
-0x4F83 = 0x3426
-0x4F86 = 0x5054
-0x4F88 = 0x504C
-0x4F8B = 0x4E63
-0x4F8D = 0x3B78
-0x4F8F = 0x504D
-0x4F91 = 0x5052
-0x4F96 = 0x5055
-0x4F98 = 0x504E
-0x4F9B = 0x3621
-0x4F9D = 0x304D
-0x4FA0 = 0x3622
-0x4FA1 = 0x3241
-0x4FAB = 0x5525
-0x4FAD = 0x4B79
-0x4FAE = 0x496E
-0x4FAF = 0x3874
-0x4FB5 = 0x3F2F
-0x4FB6 = 0x4E37
-0x4FBF = 0x4A58
-0x4FC2 = 0x3738
-0x4FC3 = 0x4225
-0x4FC4 = 0x3264
-0x4FCA = 0x3D53
-0x4FCE = 0x5059
-0x4FD0 = 0x505E
-0x4FD1 = 0x505C
-0x4FD4 = 0x5057
-0x4FD7 = 0x422F
-0x4FD8 = 0x505A
-0x4FDA = 0x505D
-0x4FDB = 0x505B
-0x4FDD = 0x4A5D
-0x4FDF = 0x5058
-0x4FE1 = 0x3F2E
-0x4FE3 = 0x4B73
-0x4FE4 = 0x505F
-0x4FE5 = 0x5060
-0x4FEE = 0x3D24
-0x4FEF = 0x506D
-0x4FF3 = 0x4750
-0x4FF5 = 0x4936
-0x4FF6 = 0x5068
-0x4FF8 = 0x4A70
-0x4FFA = 0x3236
-0x4FFE = 0x506C
-0x5005 = 0x5066
-0x5006 = 0x506F
-0x5009 = 0x4152
-0x500B = 0x3844
-0x500D = 0x475C
-0x500F = 0x6047
-0x5011 = 0x506E
-0x5012 = 0x455D
-0x5014 = 0x5063
-0x5016 = 0x3876
-0x5019 = 0x3875
-0x501A = 0x5061
-0x501F = 0x3C5A
-0x5021 = 0x5069
-0x5023 = 0x4A6F
-0x5024 = 0x434D
-0x5025 = 0x5065
-0x5026 = 0x3771
-0x5028 = 0x5062
-0x5029 = 0x506A
-0x502A = 0x5064
-0x502B = 0x4E51
-0x502C = 0x506B
-0x502D = 0x4F41
-0x5036 = 0x3666
-0x5039 = 0x3770
-0x5043 = 0x5070
-0x5047 = 0x5071
-0x5048 = 0x5075
-0x5049 = 0x304E
-0x504F = 0x4A50
-0x5050 = 0x5074
-0x5055 = 0x5073
-0x5056 = 0x5077
-0x505A = 0x5076
-0x505C = 0x4464
-0x5065 = 0x3772
-0x506C = 0x5078
-0x5072 = 0x3C45
-0x5074 = 0x4226
-0x5075 = 0x4465
-0x5076 = 0x3676
-0x5078 = 0x5079
-0x507D = 0x3536
-0x5080 = 0x507A
-0x5085 = 0x507C
-0x508D = 0x4B35
-0x5091 = 0x3766
-0x5098 = 0x3B31
-0x5099 = 0x4877
-0x509A = 0x507B
-0x50AC = 0x3A45
-0x50AD = 0x4D43
-0x50B2 = 0x507E
-0x50B3 = 0x5123
-0x50B4 = 0x507D
-0x50B5 = 0x3A44
-0x50B7 = 0x3D7D
-0x50BE = 0x3739
-0x50C2 = 0x5124
-0x50C5 = 0x364F
-0x50C9 = 0x5121
-0x50CA = 0x5122
-0x50CD = 0x462F
-0x50CF = 0x417C
-0x50D1 = 0x3623
-0x50D5 = 0x4B4D
-0x50D6 = 0x5125
-0x50DA = 0x4E3D
-0x50DE = 0x5126
-0x50E3 = 0x5129
-0x50E5 = 0x5127
-0x50E7 = 0x414E
-0x50ED = 0x5128
-0x50EE = 0x512A
-0x50F5 = 0x512C
-0x50F9 = 0x512B
-0x50FB = 0x4A48
-0x5100 = 0x3537
-0x5101 = 0x512E
-0x5102 = 0x512F
-0x5104 = 0x322F
-0x5109 = 0x512D
-0x5112 = 0x3C74
-0x5114 = 0x5132
-0x5115 = 0x5131
-0x5116 = 0x5130
-0x5118 = 0x5056
-0x511A = 0x5133
-0x511F = 0x3D7E
-0x5121 = 0x5134
-0x512A = 0x4D25
-0x5132 = 0x4C59
-0x5137 = 0x5136
-0x513A = 0x5135
-0x513B = 0x5138
-0x513C = 0x5137
-0x513F = 0x5139
-0x5140 = 0x513A
-0x5141 = 0x3074
-0x5143 = 0x3835
-0x5144 = 0x373B
-0x5145 = 0x3D3C
-0x5146 = 0x437B
-0x5147 = 0x3624
-0x5148 = 0x4068
-0x5149 = 0x3877
-0x514B = 0x396E
-0x514C = 0x513C
-0x514D = 0x4C48
-0x514E = 0x4546
-0x5150 = 0x3B79
-0x5152 = 0x513B
-0x5154 = 0x513D
-0x515A = 0x455E
-0x515C = 0x3375
-0x5162 = 0x513E
-0x5165 = 0x467E
-0x5168 = 0x4134
-0x5169 = 0x5140
-0x516A = 0x5141
-0x516B = 0x482C
-0x516C = 0x3878
-0x516D = 0x4F3B
-0x516E = 0x5142
-0x5171 = 0x3626
-0x5175 = 0x4A3C
-0x5176 = 0x4236
-0x5177 = 0x3671
-0x5178 = 0x4535
-0x517C = 0x3773
-0x5180 = 0x5143
-0x5182 = 0x5144
-0x5185 = 0x4662
-0x5186 = 0x315F
-0x5189 = 0x5147
-0x518A = 0x3A7D
-0x518C = 0x5146
-0x518D = 0x3A46
-0x518F = 0x5148
-0x5190 = 0x666E
-0x5191 = 0x5149
-0x5192 = 0x4B41
-0x5193 = 0x514A
-0x5195 = 0x514B
-0x5196 = 0x514C
-0x5197 = 0x3E69
-0x5199 = 0x3C4C
-0x51A0 = 0x3427
-0x51A2 = 0x514F
-0x51A4 = 0x514D
-0x51A5 = 0x4C3D
-0x51A6 = 0x514E
-0x51A8 = 0x495A
-0x51A9 = 0x5150
-0x51AA = 0x5151
-0x51AB = 0x5152
-0x51AC = 0x455F
-0x51B0 = 0x5156
-0x51B1 = 0x5154
-0x51B2 = 0x5155
-0x51B3 = 0x5153
-0x51B4 = 0x3A63
-0x51B5 = 0x5157
-0x51B6 = 0x4C6A
-0x51B7 = 0x4E64
-0x51BD = 0x5158
-0x51C4 = 0x4028
-0x51C5 = 0x5159
-0x51C6 = 0x3D5A
-0x51C9 = 0x515A
-0x51CB = 0x437C
-0x51CC = 0x4E3F
-0x51CD = 0x4560
-0x51D6 = 0x5245
-0x51DB = 0x515B
-0x51DC = 0x7425
-0x51DD = 0x3645
-0x51E0 = 0x515C
-0x51E1 = 0x4B5E
-0x51E6 = 0x3D68
-0x51E7 = 0x427C
-0x51E9 = 0x515E
-0x51EA = 0x4664
-0x51ED = 0x515F
-0x51F0 = 0x5160
-0x51F1 = 0x332E
-0x51F5 = 0x5161
-0x51F6 = 0x3627
-0x51F8 = 0x464C
-0x51F9 = 0x317A
-0x51FA = 0x3D50
-0x51FD = 0x4821
-0x51FE = 0x5162
-0x5200 = 0x4561
-0x5203 = 0x3F4F
-0x5204 = 0x5163
-0x5206 = 0x4A2C
-0x5207 = 0x405A
-0x5208 = 0x3422
-0x520A = 0x3429
-0x520B = 0x5164
-0x520E = 0x5166
-0x5211 = 0x373A
-0x5214 = 0x5165
-0x5217 = 0x4E73
-0x521D = 0x3D69
-0x5224 = 0x483D
-0x5225 = 0x4A4C
-0x5227 = 0x5167
-0x5229 = 0x4D78
-0x522A = 0x5168
-0x522E = 0x5169
-0x5230 = 0x457E
-0x5233 = 0x516A
-0x5236 = 0x4029
-0x5237 = 0x3A7E
-0x5238 = 0x3774
-0x5239 = 0x516B
-0x523A = 0x3B49
-0x523B = 0x396F
-0x5243 = 0x4466
-0x5244 = 0x516D
-0x5247 = 0x4227
-0x524A = 0x3A6F
-0x524B = 0x516E
-0x524C = 0x516F
-0x524D = 0x4130
-0x524F = 0x516C
-0x5254 = 0x5171
-0x5256 = 0x4B36
-0x525B = 0x3964
-0x525E = 0x5170
-0x5263 = 0x3775
-0x5264 = 0x3A5E
-0x5265 = 0x476D
-0x5269 = 0x5174
-0x526A = 0x5172
-0x526F = 0x497B
-0x5270 = 0x3E6A
-0x5271 = 0x517B
-0x5272 = 0x3364
-0x5273 = 0x5175
-0x5274 = 0x5173
-0x5275 = 0x414F
-0x527D = 0x5177
-0x527F = 0x5176
-0x5283 = 0x3344
-0x5287 = 0x3760
-0x5288 = 0x517C
-0x5289 = 0x4E2D
-0x528D = 0x5178
-0x5291 = 0x517D
-0x5292 = 0x517A
-0x5294 = 0x5179
-0x529B = 0x4E4F
-0x529F = 0x3879
-0x52A0 = 0x3243
-0x52A3 = 0x4E74
-0x52A9 = 0x3D75
-0x52AA = 0x4558
-0x52AB = 0x3965
-0x52AC = 0x5222
-0x52AD = 0x5223
-0x52B1 = 0x4E65
-0x52B4 = 0x4F2B
-0x52B5 = 0x5225
-0x52B9 = 0x387A
-0x52BC = 0x5224
-0x52BE = 0x332F
-0x52C1 = 0x5226
-0x52C3 = 0x4B56
-0x52C5 = 0x443C
-0x52C7 = 0x4D26
-0x52C9 = 0x4A59
-0x52CD = 0x5227
-0x52D2 = 0x7055
-0x52D5 = 0x4630
-0x52D7 = 0x5228
-0x52D8 = 0x342A
-0x52D9 = 0x4C33
-0x52DD = 0x3E21
-0x52DE = 0x5229
-0x52DF = 0x4A67
-0x52E0 = 0x522D
-0x52E2 = 0x402A
-0x52E3 = 0x522A
-0x52E4 = 0x3650
-0x52E6 = 0x522B
-0x52E7 = 0x342B
-0x52F2 = 0x372E
-0x52F3 = 0x522E
-0x52F5 = 0x522F
-0x52F8 = 0x5230
-0x52F9 = 0x5231
-0x52FA = 0x3C5B
-0x52FE = 0x387B
-0x52FF = 0x4C5E
-0x5301 = 0x4C68
-0x5302 = 0x4677
-0x5305 = 0x4A71
-0x5306 = 0x5232
-0x5308 = 0x5233
-0x530D = 0x5235
-0x530F = 0x5237
-0x5310 = 0x5236
-0x5315 = 0x5238
-0x5316 = 0x323D
-0x5317 = 0x4B4C
-0x5319 = 0x3A7C
-0x531A = 0x5239
-0x531D = 0x4159
-0x5320 = 0x3E22
-0x5321 = 0x3629
-0x5323 = 0x523A
-0x532A = 0x485B
-0x532F = 0x523B
-0x5331 = 0x523C
-0x5333 = 0x523D
-0x5338 = 0x523E
-0x5339 = 0x4924
-0x533A = 0x3668
-0x533B = 0x3065
-0x533F = 0x463F
-0x5340 = 0x523F
-0x5341 = 0x3D3D
-0x5343 = 0x4069
-0x5345 = 0x5241
-0x5346 = 0x5240
-0x5347 = 0x3E23
-0x5348 = 0x3861
-0x5349 = 0x5243
-0x534A = 0x483E
-0x534D = 0x5244
-0x5351 = 0x485C
-0x5352 = 0x4234
-0x5353 = 0x426E
-0x5354 = 0x3628
-0x5357 = 0x466E
-0x5358 = 0x4331
-0x535A = 0x476E
-0x535C = 0x4B4E
-0x535E = 0x5246
-0x5360 = 0x406A
-0x5366 = 0x3735
-0x5369 = 0x5247
-0x536E = 0x5248
-0x536F = 0x312C
-0x5370 = 0x3075
-0x5371 = 0x346D
-0x5373 = 0x4228
-0x5374 = 0x3551
-0x5375 = 0x4D71
-0x5377 = 0x524B
-0x5378 = 0x3237
-0x537B = 0x524A
-0x537F = 0x362A
-0x5382 = 0x524C
-0x5384 = 0x4C71
-0x5396 = 0x524D
-0x5398 = 0x4E52
-0x539A = 0x387C
-0x539F = 0x3836
-0x53A0 = 0x524E
-0x53A5 = 0x5250
-0x53A6 = 0x524F
-0x53A8 = 0x3F5F
-0x53A9 = 0x3139
-0x53AD = 0x315E
-0x53AE = 0x5251
-0x53B0 = 0x5252
-0x53B3 = 0x3837
-0x53B6 = 0x5253
-0x53BB = 0x356E
-0x53C2 = 0x3B32
-0x53C3 = 0x5254
-0x53C8 = 0x4B74
-0x53C9 = 0x3A35
-0x53CA = 0x355A
-0x53CB = 0x4D27
-0x53CC = 0x4150
-0x53CD = 0x483F
-0x53CE = 0x3C7D
-0x53D4 = 0x3D47
-0x53D6 = 0x3C68
-0x53D7 = 0x3C75
-0x53D9 = 0x3D76
-0x53DB = 0x4840
-0x53DF = 0x5257
-0x53E1 = 0x3143
-0x53E2 = 0x4151
-0x53E3 = 0x387D
-0x53E4 = 0x3845
-0x53E5 = 0x3667
-0x53E8 = 0x525B
-0x53E9 = 0x4321
-0x53EA = 0x427E
-0x53EB = 0x362B
-0x53EC = 0x3E24
-0x53ED = 0x525C
-0x53EE = 0x525A
-0x53EF = 0x3244
-0x53F0 = 0x4266
-0x53F1 = 0x3C38
-0x53F2 = 0x3B4B
-0x53F3 = 0x3126
-0x53F6 = 0x3370
-0x53F7 = 0x3966
-0x53F8 = 0x3B4A
-0x53FA = 0x525D
-0x5401 = 0x525E
-0x5403 = 0x3549
-0x5404 = 0x3346
-0x5408 = 0x3967
-0x5409 = 0x3548
-0x540A = 0x445F
-0x540B = 0x3125
-0x540C = 0x4631
-0x540D = 0x4C3E
-0x540E = 0x3921
-0x540F = 0x4D79
-0x5410 = 0x4547
-0x5411 = 0x387E
-0x541B = 0x372F
-0x541D = 0x5267
-0x541F = 0x3663
-0x5420 = 0x4B4A
-0x5426 = 0x485D
-0x5429 = 0x5266
-0x542B = 0x345E
-0x542C = 0x5261
-0x542D = 0x5262
-0x542E = 0x5264
-0x5436 = 0x5265
-0x5438 = 0x355B
-0x5439 = 0x3F61
-0x543B = 0x4A2D
-0x543C = 0x5263
-0x543D = 0x525F
-0x543E = 0x3863
-0x5440 = 0x5260
-0x5442 = 0x4F24
-0x5446 = 0x4A72
-0x5448 = 0x4468
-0x5449 = 0x3862
-0x544A = 0x3970
-0x544E = 0x5268
-0x5451 = 0x465D
-0x545F = 0x526C
-0x5468 = 0x3C7E
-0x546A = 0x3C76
-0x5470 = 0x526F
-0x5471 = 0x526D
-0x5473 = 0x4C23
-0x5475 = 0x526A
-0x5476 = 0x5273
-0x5477 = 0x526E
-0x547B = 0x5271
-0x547C = 0x3846
-0x547D = 0x4C3F
-0x5480 = 0x5272
-0x5484 = 0x5274
-0x5486 = 0x5276
-0x548B = 0x3A70
-0x548C = 0x4F42
-0x548E = 0x526B
-0x548F = 0x5269
-0x5490 = 0x5275
-0x5492 = 0x5270
-0x54A2 = 0x5278
-0x54A4 = 0x5323
-0x54A5 = 0x527A
-0x54A8 = 0x527E
-0x54AB = 0x5321
-0x54AC = 0x527B
-0x54AF = 0x533E
-0x54B2 = 0x3A69
-0x54B3 = 0x3331
-0x54B8 = 0x5279
-0x54BC = 0x5325
-0x54BD = 0x3076
-0x54BE = 0x5324
-0x54C0 = 0x3025
-0x54C1 = 0x494A
-0x54C2 = 0x5322
-0x54C4 = 0x527C
-0x54C7 = 0x5277
-0x54C8 = 0x527D
-0x54C9 = 0x3A48
-0x54D8 = 0x5326
-0x54E1 = 0x3077
-0x54E2 = 0x532F
-0x54E5 = 0x5327
-0x54E6 = 0x5328
-0x54E8 = 0x3E25
-0x54E9 = 0x4B69
-0x54ED = 0x532D
-0x54EE = 0x532C
-0x54F2 = 0x452F
-0x54FA = 0x532E
-0x54FD = 0x532B
-0x5504 = 0x3134
-0x5506 = 0x3A36
-0x5507 = 0x3F30
-0x550F = 0x5329
-0x5510 = 0x4562
-0x5514 = 0x532A
-0x5516 = 0x3022
-0x552E = 0x5334
-0x552F = 0x4D23
-0x5531 = 0x3E27
-0x5533 = 0x533A
-0x5538 = 0x5339
-0x5539 = 0x5330
-0x553E = 0x4243
-0x5540 = 0x5331
-0x5544 = 0x426F
-0x5545 = 0x5336
-0x5546 = 0x3E26
-0x554C = 0x5333
-0x554F = 0x4C64
-0x5553 = 0x373C
-0x5556 = 0x5337
-0x5557 = 0x5338
-0x555C = 0x5335
-0x555D = 0x533B
-0x5563 = 0x5332
-0x557B = 0x5341
-0x557C = 0x5346
-0x557E = 0x5342
-0x5580 = 0x533D
-0x5583 = 0x5347
-0x5584 = 0x4131
-0x5587 = 0x5349
-0x5589 = 0x3922
-0x558A = 0x533F
-0x558B = 0x437D
-0x5598 = 0x5343
-0x5599 = 0x533C
-0x559A = 0x342D
-0x559C = 0x346E
-0x559D = 0x3365
-0x559E = 0x5344
-0x559F = 0x5340
-0x55A7 = 0x3776
-0x55A8 = 0x534A
-0x55A9 = 0x5348
-0x55AA = 0x4153
-0x55AB = 0x354A
-0x55AC = 0x362C
-0x55AE = 0x5345
-0x55B0 = 0x3674
-0x55B6 = 0x3144
-0x55C4 = 0x534E
-0x55C5 = 0x534C
-0x55C7 = 0x5427
-0x55D4 = 0x5351
-0x55DA = 0x534B
-0x55DC = 0x534F
-0x55DF = 0x534D
-0x55E3 = 0x3B4C
-0x55E4 = 0x5350
-0x55F7 = 0x5353
-0x55F9 = 0x5358
-0x55FD = 0x5356
-0x55FE = 0x5355
-0x5606 = 0x4332
-0x5609 = 0x3245
-0x5614 = 0x5352
-0x5616 = 0x5354
-0x5617 = 0x3E28
-0x5618 = 0x3133
-0x561B = 0x5357
-0x5629 = 0x325E
-0x562F = 0x5362
-0x5631 = 0x3E7C
-0x5632 = 0x535E
-0x5634 = 0x535C
-0x5636 = 0x535D
-0x5638 = 0x535F
-0x5642 = 0x313D
-0x564C = 0x4139
-0x564E = 0x5359
-0x5650 = 0x535A
-0x565B = 0x337A
-0x5664 = 0x5361
-0x5668 = 0x346F
-0x566A = 0x5364
-0x566B = 0x5360
-0x566C = 0x5363
-0x5674 = 0x4A2E
-0x5678 = 0x4655
-0x567A = 0x4838
-0x5680 = 0x5366
-0x5686 = 0x5365
-0x5687 = 0x3345
-0x568A = 0x5367
-0x568F = 0x536A
-0x5694 = 0x5369
-0x56A0 = 0x5368
-0x56A2 = 0x4739
-0x56A5 = 0x536B
-0x56AE = 0x536C
-0x56B4 = 0x536E
-0x56B6 = 0x536D
-0x56BC = 0x5370
-0x56C0 = 0x5373
-0x56C1 = 0x5371
-0x56C2 = 0x536F
-0x56C3 = 0x5372
-0x56C8 = 0x5374
-0x56CE = 0x5375
-0x56D1 = 0x5376
-0x56D3 = 0x5377
-0x56D7 = 0x5378
-0x56D8 = 0x5145
-0x56DA = 0x3C7C
-0x56DB = 0x3B4D
-0x56DE = 0x3273
-0x56E0 = 0x3078
-0x56E3 = 0x4344
-0x56EE = 0x5379
-0x56F0 = 0x3A24
-0x56F2 = 0x304F
-0x56F3 = 0x3F5E
-0x56F9 = 0x537A
-0x56FA = 0x3847
-0x56FD = 0x3971
-0x56FF = 0x537C
-0x5700 = 0x537B
-0x5703 = 0x4A60
-0x5704 = 0x537D
-0x5708 = 0x5421
-0x5709 = 0x537E
-0x570B = 0x5422
-0x570D = 0x5423
-0x570F = 0x3777
-0x5712 = 0x3160
-0x5713 = 0x5424
-0x5716 = 0x5426
-0x5718 = 0x5425
-0x571C = 0x5428
-0x571F = 0x455A
-0x5726 = 0x5429
-0x5727 = 0x3035
-0x5728 = 0x3A5F
-0x572D = 0x373D
-0x5730 = 0x434F
-0x5737 = 0x542A
-0x5738 = 0x542B
-0x573B = 0x542D
-0x5740 = 0x542E
-0x5742 = 0x3A64
-0x5747 = 0x3651
-0x574A = 0x4B37
-0x574E = 0x542C
-0x574F = 0x542F
-0x5750 = 0x3A41
-0x5751 = 0x3923
-0x5761 = 0x5433
-0x5764 = 0x3A25
-0x5766 = 0x4333
-0x5769 = 0x5430
-0x576A = 0x445A
-0x577F = 0x5434
-0x5782 = 0x3F62
-0x5788 = 0x5432
-0x5789 = 0x5435
-0x578B = 0x373F
-0x5793 = 0x5436
-0x57A0 = 0x5437
-0x57A2 = 0x3924
-0x57A3 = 0x3340
-0x57A4 = 0x5439
-0x57AA = 0x543A
-0x57B0 = 0x543B
-0x57B3 = 0x5438
-0x57C0 = 0x5431
-0x57C3 = 0x543C
-0x57C6 = 0x543D
-0x57CB = 0x4B64
-0x57CE = 0x3E6B
-0x57D2 = 0x543F
-0x57D3 = 0x5440
-0x57D4 = 0x543E
-0x57D6 = 0x5442
-0x57DC = 0x4738
-0x57DF = 0x3068
-0x57E0 = 0x4956
-0x57E3 = 0x5443
-0x57F4 = 0x3E7D
-0x57F7 = 0x3C39
-0x57F9 = 0x475D
-0x57FA = 0x3470
-0x57FC = 0x3A6B
-0x5800 = 0x4B59
-0x5802 = 0x4632
-0x5805 = 0x3778
-0x5806 = 0x424F
-0x580A = 0x5441
-0x580B = 0x5444
-0x5815 = 0x4244
-0x5819 = 0x5445
-0x581D = 0x5446
-0x5821 = 0x5448
-0x5824 = 0x4469
-0x582A = 0x342E
-0x582F = 0x7421
-0x5830 = 0x3161
-0x5831 = 0x4A73
-0x5834 = 0x3E6C
-0x5835 = 0x4548
-0x583A = 0x3A66
-0x583D = 0x544E
-0x5840 = 0x4A3D
-0x5841 = 0x4E5D
-0x584A = 0x3274
-0x584B = 0x544A
-0x5851 = 0x413A
-0x5852 = 0x544D
-0x5854 = 0x4563
-0x5857 = 0x4549
-0x5858 = 0x4564
-0x5859 = 0x4839
-0x585A = 0x444D
-0x585E = 0x3A49
-0x5862 = 0x5449
-0x5869 = 0x3176
-0x586B = 0x4536
-0x5870 = 0x544B
-0x5872 = 0x5447
-0x5875 = 0x3F50
-0x5879 = 0x544F
-0x587E = 0x3D4E
-0x5883 = 0x362D
-0x5885 = 0x5450
-0x5893 = 0x4A68
-0x5897 = 0x417D
-0x589C = 0x4446
-0x589F = 0x5452
-0x58A8 = 0x4B4F
-0x58AB = 0x5453
-0x58AE = 0x5458
-0x58B3 = 0x4A2F
-0x58B8 = 0x5457
-0x58B9 = 0x5451
-0x58BA = 0x5454
-0x58BB = 0x5456
-0x58BE = 0x3A26
-0x58C1 = 0x4A49
-0x58C5 = 0x5459
-0x58C7 = 0x4345
-0x58CA = 0x3275
-0x58CC = 0x3E6D
-0x58D1 = 0x545B
-0x58D3 = 0x545A
-0x58D5 = 0x3968
-0x58D7 = 0x545C
-0x58D8 = 0x545E
-0x58D9 = 0x545D
-0x58DC = 0x5460
-0x58DE = 0x5455
-0x58DF = 0x5462
-0x58E4 = 0x5461
-0x58E5 = 0x545F
-0x58EB = 0x3B4E
-0x58EC = 0x3F51
-0x58EE = 0x4154
-0x58EF = 0x5463
-0x58F0 = 0x403C
-0x58F1 = 0x306D
-0x58F2 = 0x4764
-0x58F7 = 0x445B
-0x58F9 = 0x5465
-0x58FA = 0x5464
-0x58FB = 0x5466
-0x58FC = 0x5467
-0x58FD = 0x5468
-0x5902 = 0x5469
-0x5909 = 0x4A51
-0x590A = 0x546A
-0x590F = 0x3246
-0x5910 = 0x546B
-0x5915 = 0x4D3C
-0x5916 = 0x3330
-0x5918 = 0x5249
-0x5919 = 0x3D48
-0x591A = 0x423F
-0x591B = 0x546C
-0x591C = 0x4C6B
-0x5922 = 0x4C34
-0x5925 = 0x546E
-0x5927 = 0x4267
-0x5929 = 0x4537
-0x592A = 0x4240
-0x592B = 0x4957
-0x592C = 0x546F
-0x592D = 0x5470
-0x592E = 0x317B
-0x5931 = 0x3C3A
-0x5932 = 0x5471
-0x5937 = 0x3050
-0x5938 = 0x5472
-0x593E = 0x5473
-0x5944 = 0x3162
-0x5947 = 0x3471
-0x5948 = 0x4660
-0x5949 = 0x4A74
-0x594E = 0x5477
-0x594F = 0x4155
-0x5950 = 0x5476
-0x5951 = 0x3740
-0x5954 = 0x4B5B
-0x5955 = 0x5475
-0x5957 = 0x4565
-0x5958 = 0x5479
-0x595A = 0x5478
-0x5960 = 0x547B
-0x5962 = 0x547A
-0x5965 = 0x317C
-0x5967 = 0x547C
-0x5968 = 0x3E29
-0x5969 = 0x547E
-0x596A = 0x4325
-0x596C = 0x547D
-0x596E = 0x4A33
-0x5973 = 0x3D77
-0x5974 = 0x455B
-0x5978 = 0x5521
-0x597D = 0x3925
-0x5981 = 0x5522
-0x5982 = 0x4721
-0x5983 = 0x485E
-0x5984 = 0x4C51
-0x598A = 0x4725
-0x598D = 0x552B
-0x5993 = 0x3538
-0x5996 = 0x4D45
-0x5999 = 0x4C2F
-0x599B = 0x562C
-0x599D = 0x5523
-0x59A3 = 0x5526
-0x59A5 = 0x4245
-0x59A8 = 0x4B38
-0x59AC = 0x454A
-0x59B2 = 0x5527
-0x59B9 = 0x4B65
-0x59BB = 0x3A4A
-0x59BE = 0x3E2A
-0x59C6 = 0x5528
-0x59C9 = 0x3B50
-0x59CB = 0x3B4F
-0x59D0 = 0x3039
-0x59D1 = 0x3848
-0x59D3 = 0x402B
-0x59D4 = 0x3051
-0x59D9 = 0x552C
-0x59DA = 0x552D
-0x59DC = 0x552A
-0x59E5 = 0x3138
-0x59E6 = 0x342F
-0x59E8 = 0x5529
-0x59EA = 0x4C45
-0x59EB = 0x4931
-0x59F6 = 0x3028
-0x59FB = 0x3079
-0x59FF = 0x3B51
-0x5A01 = 0x3052
-0x5A03 = 0x3023
-0x5A09 = 0x5532
-0x5A11 = 0x5530
-0x5A18 = 0x4C3C
-0x5A1A = 0x5533
-0x5A1C = 0x5531
-0x5A1F = 0x552F
-0x5A20 = 0x3F31
-0x5A25 = 0x552E
-0x5A29 = 0x4A5A
-0x5A2F = 0x3864
-0x5A35 = 0x5537
-0x5A36 = 0x5538
-0x5A3C = 0x3E2B
-0x5A40 = 0x5534
-0x5A41 = 0x4F2C
-0x5A46 = 0x474C
-0x5A49 = 0x5536
-0x5A5A = 0x3A27
-0x5A62 = 0x5539
-0x5A66 = 0x4958
-0x5A6A = 0x553A
-0x5A6C = 0x5535
-0x5A7F = 0x4C3B
-0x5A92 = 0x475E
-0x5A9A = 0x553B
-0x5A9B = 0x4932
-0x5ABC = 0x553C
-0x5ABD = 0x5540
-0x5ABE = 0x553D
-0x5AC1 = 0x3247
-0x5AC2 = 0x553F
-0x5AC9 = 0x3C3B
-0x5ACB = 0x553E
-0x5ACC = 0x3779
-0x5AD0 = 0x554C
-0x5AD6 = 0x5545
-0x5AD7 = 0x5542
-0x5AE1 = 0x4364
-0x5AE3 = 0x5541
-0x5AE6 = 0x5543
-0x5AE9 = 0x5544
-0x5AFA = 0x5546
-0x5AFB = 0x5547
-0x5B09 = 0x3472
-0x5B0B = 0x5549
-0x5B0C = 0x5548
-0x5B16 = 0x554A
-0x5B22 = 0x3E6E
-0x5B2A = 0x554D
-0x5B2C = 0x445C
-0x5B30 = 0x3145
-0x5B32 = 0x554B
-0x5B36 = 0x554E
-0x5B3E = 0x554F
-0x5B40 = 0x5552
-0x5B43 = 0x5550
-0x5B45 = 0x5551
-0x5B50 = 0x3B52
-0x5B51 = 0x5553
-0x5B54 = 0x3926
-0x5B55 = 0x5554
-0x5B57 = 0x3B7A
-0x5B58 = 0x4238
-0x5B5A = 0x5555
-0x5B5B = 0x5556
-0x5B5C = 0x3B5A
-0x5B5D = 0x3927
-0x5B5F = 0x4C52
-0x5B63 = 0x3528
-0x5B64 = 0x3849
-0x5B65 = 0x5557
-0x5B66 = 0x3358
-0x5B69 = 0x5558
-0x5B6B = 0x4239
-0x5B70 = 0x5559
-0x5B71 = 0x5623
-0x5B73 = 0x555A
-0x5B75 = 0x555B
-0x5B78 = 0x555C
-0x5B7A = 0x555E
-0x5B80 = 0x555F
-0x5B83 = 0x5560
-0x5B85 = 0x4270
-0x5B87 = 0x3127
-0x5B88 = 0x3C69
-0x5B89 = 0x3042
-0x5B8B = 0x4157
-0x5B8C = 0x3430
-0x5B8D = 0x3C35
-0x5B8F = 0x3928
-0x5B95 = 0x4566
-0x5B97 = 0x3D21
-0x5B98 = 0x3431
-0x5B99 = 0x4368
-0x5B9A = 0x446A
-0x5B9B = 0x3038
-0x5B9C = 0x3539
-0x5B9D = 0x4A75
-0x5B9F = 0x3C42
-0x5BA2 = 0x3552
-0x5BA3 = 0x406B
-0x5BA4 = 0x3C3C
-0x5BA5 = 0x4D28
-0x5BA6 = 0x5561
-0x5BAE = 0x355C
-0x5BB0 = 0x3A4B
-0x5BB3 = 0x3332
-0x5BB4 = 0x3163
-0x5BB5 = 0x3E2C
-0x5BB6 = 0x3248
-0x5BB8 = 0x5562
-0x5BB9 = 0x4D46
-0x5BBF = 0x3D49
-0x5BC2 = 0x3C64
-0x5BC3 = 0x5563
-0x5BC4 = 0x3473
-0x5BC5 = 0x4652
-0x5BC6 = 0x4C29
-0x5BC7 = 0x5564
-0x5BC9 = 0x5565
-0x5BCC = 0x4959
-0x5BD0 = 0x5567
-0x5BD2 = 0x3428
-0x5BD3 = 0x3677
-0x5BD4 = 0x5566
-0x5BDB = 0x3432
-0x5BDD = 0x3F32
-0x5BDE = 0x556B
-0x5BDF = 0x3B21
-0x5BE1 = 0x3249
-0x5BE2 = 0x556A
-0x5BE4 = 0x5568
-0x5BE5 = 0x556C
-0x5BE6 = 0x5569
-0x5BE7 = 0x472B
-0x5BE8 = 0x5C4D
-0x5BE9 = 0x3F33
-0x5BEB = 0x556D
-0x5BEE = 0x4E40
-0x5BF0 = 0x556E
-0x5BF3 = 0x5570
-0x5BF5 = 0x437E
-0x5BF6 = 0x556F
-0x5BF8 = 0x4023
-0x5BFA = 0x3B7B
-0x5BFE = 0x4250
-0x5BFF = 0x3C77
-0x5C01 = 0x4975
-0x5C02 = 0x406C
-0x5C04 = 0x3C4D
-0x5C05 = 0x5571
-0x5C06 = 0x3E2D
-0x5C07 = 0x5572
-0x5C08 = 0x5573
-0x5C09 = 0x3053
-0x5C0A = 0x423A
-0x5C0B = 0x3F52
-0x5C0D = 0x5574
-0x5C0E = 0x4633
-0x5C0F = 0x3E2E
-0x5C11 = 0x3E2F
-0x5C13 = 0x5575
-0x5C16 = 0x406D
-0x5C1A = 0x3E30
-0x5C20 = 0x5576
-0x5C22 = 0x5577
-0x5C24 = 0x4C60
-0x5C28 = 0x5578
-0x5C2D = 0x3646
-0x5C31 = 0x3D22
-0x5C38 = 0x5579
-0x5C39 = 0x557A
-0x5C3A = 0x3C5C
-0x5C3B = 0x3F2C
-0x5C3C = 0x4674
-0x5C3D = 0x3F54
-0x5C3E = 0x4878
-0x5C3F = 0x4722
-0x5C40 = 0x3649
-0x5C41 = 0x557B
-0x5C45 = 0x356F
-0x5C46 = 0x557C
-0x5C48 = 0x367E
-0x5C4A = 0x464F
-0x5C4B = 0x3230
-0x5C4D = 0x3B53
-0x5C4E = 0x557D
-0x5C4F = 0x5622
-0x5C50 = 0x5621
-0x5C51 = 0x367D
-0x5C53 = 0x557E
-0x5C55 = 0x4538
-0x5C5E = 0x4230
-0x5C60 = 0x454B
-0x5C61 = 0x3C48
-0x5C64 = 0x4158
-0x5C65 = 0x4D7A
-0x5C6C = 0x5624
-0x5C6E = 0x5625
-0x5C6F = 0x4656
-0x5C71 = 0x3B33
-0x5C76 = 0x5627
-0x5C79 = 0x5628
-0x5C8C = 0x5629
-0x5C90 = 0x3474
-0x5C91 = 0x562A
-0x5C94 = 0x562B
-0x5CA1 = 0x322C
-0x5CA8 = 0x413B
-0x5CA9 = 0x3464
-0x5CAB = 0x562D
-0x5CAC = 0x4C28
-0x5CB1 = 0x4252
-0x5CB3 = 0x3359
-0x5CB6 = 0x562F
-0x5CB7 = 0x5631
-0x5CB8 = 0x345F
-0x5CBB = 0x562E
-0x5CBC = 0x5630
-0x5CBE = 0x5633
-0x5CC5 = 0x5632
-0x5CC7 = 0x5634
-0x5CD9 = 0x5635
-0x5CE0 = 0x463D
-0x5CE1 = 0x362E
-0x5CE8 = 0x3265
-0x5CE9 = 0x5636
-0x5CEA = 0x563B
-0x5CED = 0x5639
-0x5CEF = 0x4A77
-0x5CF0 = 0x4A76
-0x5CF6 = 0x4567
-0x5CFA = 0x5638
-0x5CFB = 0x3D54
-0x5CFD = 0x5637
-0x5D07 = 0x3F72
-0x5D0B = 0x563C
-0x5D0E = 0x3A6A
-0x5D11 = 0x5642
-0x5D14 = 0x5643
-0x5D15 = 0x563D
-0x5D16 = 0x3333
-0x5D17 = 0x563E
-0x5D18 = 0x5647
-0x5D19 = 0x5646
-0x5D1A = 0x5645
-0x5D1B = 0x5641
-0x5D1F = 0x5640
-0x5D22 = 0x5644
-0x5D29 = 0x4A78
-0x5D4B = 0x564B
-0x5D4C = 0x5648
-0x5D4E = 0x564A
-0x5D50 = 0x4D72
-0x5D52 = 0x5649
-0x5D5C = 0x563F
-0x5D69 = 0x3F73
-0x5D6C = 0x564C
-0x5D6F = 0x3A37
-0x5D73 = 0x564D
-0x5D76 = 0x564E
-0x5D82 = 0x5651
-0x5D84 = 0x5650
-0x5D87 = 0x564F
-0x5D8B = 0x4568
-0x5D8C = 0x563A
-0x5D90 = 0x5657
-0x5D9D = 0x5653
-0x5DA2 = 0x5652
-0x5DAC = 0x5654
-0x5DAE = 0x5655
-0x5DB7 = 0x5658
-0x5DBA = 0x4E66
-0x5DBC = 0x5659
-0x5DBD = 0x5656
-0x5DC9 = 0x565A
-0x5DCC = 0x3460
-0x5DCD = 0x565B
-0x5DD2 = 0x565D
-0x5DD3 = 0x565C
-0x5DD6 = 0x565E
-0x5DDB = 0x565F
-0x5DDD = 0x406E
-0x5DDE = 0x3D23
-0x5DE1 = 0x3D64
-0x5DE3 = 0x4163
-0x5DE5 = 0x3929
-0x5DE6 = 0x3A38
-0x5DE7 = 0x392A
-0x5DE8 = 0x3570
-0x5DEB = 0x5660
-0x5DEE = 0x3A39
-0x5DF1 = 0x384A
-0x5DF2 = 0x5661
-0x5DF3 = 0x4C26
-0x5DF4 = 0x4743
-0x5DF5 = 0x5662
-0x5DF7 = 0x392B
-0x5DFB = 0x342C
-0x5DFD = 0x4327
-0x5DFE = 0x3652
-0x5E02 = 0x3B54
-0x5E03 = 0x495B
-0x5E06 = 0x4841
-0x5E0B = 0x5663
-0x5E0C = 0x3475
-0x5E11 = 0x5666
-0x5E16 = 0x4421
-0x5E19 = 0x5665
-0x5E1A = 0x5664
-0x5E1B = 0x5667
-0x5E1D = 0x446B
-0x5E25 = 0x3F63
-0x5E2B = 0x3B55
-0x5E2D = 0x404A
-0x5E2F = 0x4253
-0x5E30 = 0x3522
-0x5E33 = 0x4422
-0x5E36 = 0x5668
-0x5E37 = 0x5669
-0x5E38 = 0x3E6F
-0x5E3D = 0x4B39
-0x5E40 = 0x566C
-0x5E43 = 0x566B
-0x5E44 = 0x566A
-0x5E45 = 0x497D
-0x5E47 = 0x5673
-0x5E4C = 0x4B5A
-0x5E4E = 0x566D
-0x5E54 = 0x566F
-0x5E55 = 0x4B6B
-0x5E57 = 0x566E
-0x5E5F = 0x5670
-0x5E61 = 0x4828
-0x5E62 = 0x5671
-0x5E63 = 0x4A3E
-0x5E64 = 0x5672
-0x5E72 = 0x3433
-0x5E73 = 0x4A3F
-0x5E74 = 0x472F
-0x5E75 = 0x5674
-0x5E76 = 0x5675
-0x5E78 = 0x392C
-0x5E79 = 0x3434
-0x5E7A = 0x5676
-0x5E7B = 0x3838
-0x5E7C = 0x4D44
-0x5E7D = 0x4D29
-0x5E7E = 0x3476
-0x5E7F = 0x5678
-0x5E81 = 0x4423
-0x5E83 = 0x392D
-0x5E84 = 0x3E31
-0x5E87 = 0x485F
-0x5E8A = 0x3E32
-0x5E8F = 0x3D78
-0x5E95 = 0x446C
-0x5E96 = 0x4A79
-0x5E97 = 0x4539
-0x5E9A = 0x392E
-0x5E9C = 0x495C
-0x5EA0 = 0x5679
-0x5EA6 = 0x4559
-0x5EA7 = 0x3A42
-0x5EAB = 0x384B
-0x5EAD = 0x446D
-0x5EB5 = 0x3043
-0x5EB6 = 0x3D6E
-0x5EB7 = 0x392F
-0x5EB8 = 0x4D47
-0x5EC1 = 0x567A
-0x5EC2 = 0x567B
-0x5EC3 = 0x4751
-0x5EC8 = 0x567C
-0x5EC9 = 0x4E77
-0x5ECA = 0x4F2D
-0x5ECF = 0x567E
-0x5ED0 = 0x567D
-0x5ED3 = 0x3347
-0x5ED6 = 0x5721
-0x5EDA = 0x5724
-0x5EDB = 0x5725
-0x5EDD = 0x5723
-0x5EDF = 0x4940
-0x5EE0 = 0x3E33
-0x5EE1 = 0x5727
-0x5EE2 = 0x5726
-0x5EE3 = 0x5722
-0x5EE8 = 0x5728
-0x5EE9 = 0x5729
-0x5EEC = 0x572A
-0x5EF0 = 0x572D
-0x5EF1 = 0x572B
-0x5EF3 = 0x572C
-0x5EF4 = 0x572E
-0x5EF6 = 0x3164
-0x5EF7 = 0x446E
-0x5EF8 = 0x572F
-0x5EFA = 0x377A
-0x5EFB = 0x3276
-0x5EFC = 0x4736
-0x5EFE = 0x5730
-0x5EFF = 0x467B
-0x5F01 = 0x4A5B
-0x5F03 = 0x5731
-0x5F04 = 0x4F2E
-0x5F09 = 0x5732
-0x5F0A = 0x4A40
-0x5F0B = 0x5735
-0x5F0C = 0x5021
-0x5F0D = 0x5031
-0x5F0F = 0x3C30
-0x5F10 = 0x4675
-0x5F11 = 0x5736
-0x5F13 = 0x355D
-0x5F14 = 0x4424
-0x5F15 = 0x307A
-0x5F16 = 0x5737
-0x5F17 = 0x4A26
-0x5F18 = 0x3930
-0x5F1B = 0x4350
-0x5F1F = 0x446F
-0x5F25 = 0x4C6F
-0x5F26 = 0x3839
-0x5F27 = 0x384C
-0x5F29 = 0x5738
-0x5F2D = 0x5739
-0x5F2F = 0x573F
-0x5F31 = 0x3C65
-0x5F35 = 0x4425
-0x5F37 = 0x362F
-0x5F38 = 0x573A
-0x5F3C = 0x492B
-0x5F3E = 0x4346
-0x5F41 = 0x573B
-0x5F48 = 0x573C
-0x5F4A = 0x3630
-0x5F4C = 0x573D
-0x5F4E = 0x573E
-0x5F51 = 0x5740
-0x5F53 = 0x4576
-0x5F56 = 0x5741
-0x5F57 = 0x5742
-0x5F59 = 0x5743
-0x5F5C = 0x5734
-0x5F5D = 0x5733
-0x5F61 = 0x5744
-0x5F62 = 0x3741
-0x5F66 = 0x4927
-0x5F69 = 0x3A4C
-0x5F6A = 0x4937
-0x5F6B = 0x4426
-0x5F6C = 0x494B
-0x5F6D = 0x5745
-0x5F70 = 0x3E34
-0x5F71 = 0x3146
-0x5F73 = 0x5746
-0x5F77 = 0x5747
-0x5F79 = 0x4C72
-0x5F7C = 0x4860
-0x5F7F = 0x574A
-0x5F80 = 0x317D
-0x5F81 = 0x402C
-0x5F82 = 0x5749
-0x5F83 = 0x5748
-0x5F84 = 0x3742
-0x5F85 = 0x4254
-0x5F87 = 0x574E
-0x5F88 = 0x574C
-0x5F8A = 0x574B
-0x5F8B = 0x4E27
-0x5F8C = 0x3865
-0x5F90 = 0x3D79
-0x5F91 = 0x574D
-0x5F92 = 0x454C
-0x5F93 = 0x3D3E
-0x5F97 = 0x4640
-0x5F98 = 0x5751
-0x5F99 = 0x5750
-0x5F9E = 0x574F
-0x5FA0 = 0x5752
-0x5FA1 = 0x3866
-0x5FA8 = 0x5753
-0x5FA9 = 0x497C
-0x5FAA = 0x3D5B
-0x5FAD = 0x5754
-0x5FAE = 0x4879
-0x5FB3 = 0x4641
-0x5FB4 = 0x4427
-0x5FB9 = 0x4530
-0x5FBC = 0x5755
-0x5FBD = 0x352B
-0x5FC3 = 0x3F34
-0x5FC5 = 0x492C
-0x5FCC = 0x3477
-0x5FCD = 0x4726
-0x5FD6 = 0x5756
-0x5FD7 = 0x3B56
-0x5FD8 = 0x4B3A
-0x5FD9 = 0x4B3B
-0x5FDC = 0x317E
-0x5FDD = 0x575B
-0x5FE0 = 0x4369
-0x5FE4 = 0x5758
-0x5FEB = 0x3277
-0x5FF0 = 0x582D
-0x5FF1 = 0x575A
-0x5FF5 = 0x4730
-0x5FF8 = 0x5759
-0x5FFB = 0x5757
-0x5FFD = 0x397A
-0x5FFF = 0x575D
-0x600E = 0x5763
-0x600F = 0x5769
-0x6010 = 0x5761
-0x6012 = 0x455C
-0x6015 = 0x5766
-0x6016 = 0x495D
-0x6019 = 0x5760
-0x601B = 0x5765
-0x601C = 0x4E67
-0x601D = 0x3B57
-0x6020 = 0x4255
-0x6021 = 0x575E
-0x6025 = 0x355E
-0x6026 = 0x5768
-0x6027 = 0x402D
-0x6028 = 0x3165
-0x6029 = 0x5762
-0x602A = 0x3278
-0x602B = 0x5767
-0x602F = 0x3631
-0x6031 = 0x5764
-0x603A = 0x576A
-0x6041 = 0x576C
-0x6042 = 0x5776
-0x6043 = 0x5774
-0x6046 = 0x5771
-0x604A = 0x5770
-0x604B = 0x4E78
-0x604D = 0x5772
-0x6050 = 0x3632
-0x6052 = 0x3931
-0x6055 = 0x3D7A
-0x6059 = 0x5779
-0x605A = 0x576B
-0x605F = 0x576F
-0x6060 = 0x575F
-0x6062 = 0x327A
-0x6063 = 0x5773
-0x6064 = 0x5775
-0x6065 = 0x4351
-0x6068 = 0x3A28
-0x6069 = 0x3238
-0x606A = 0x576D
-0x606B = 0x5778
-0x606C = 0x5777
-0x606D = 0x3633
-0x606F = 0x4229
-0x6070 = 0x3366
-0x6075 = 0x3743
-0x6077 = 0x576E
-0x6081 = 0x577A
-0x6083 = 0x577D
-0x6084 = 0x5821
-0x6089 = 0x3C3D
-0x608B = 0x5827
-0x608C = 0x4470
-0x608D = 0x577B
-0x6092 = 0x5825
-0x6094 = 0x3279
-0x6096 = 0x5823
-0x6097 = 0x5824
-0x609A = 0x577E
-0x609B = 0x5822
-0x609F = 0x3867
-0x60A0 = 0x4D2A
-0x60A3 = 0x3435
-0x60A6 = 0x3159
-0x60A7 = 0x5826
-0x60A9 = 0x473A
-0x60AA = 0x302D
-0x60B2 = 0x4861
-0x60B3 = 0x575C
-0x60B4 = 0x582C
-0x60B5 = 0x5830
-0x60B6 = 0x4C65
-0x60B8 = 0x5829
-0x60BC = 0x4569
-0x60BD = 0x582E
-0x60C5 = 0x3E70
-0x60C6 = 0x582F
-0x60C7 = 0x4657
-0x60D1 = 0x4F47
-0x60D3 = 0x582B
-0x60D8 = 0x5831
-0x60DA = 0x397B
-0x60DC = 0x404B
-0x60DF = 0x3054
-0x60E0 = 0x582A
-0x60E1 = 0x5828
-0x60E3 = 0x415A
-0x60E7 = 0x577C
-0x60E8 = 0x3B34
-0x60F0 = 0x4246
-0x60F1 = 0x583D
-0x60F3 = 0x415B
-0x60F4 = 0x5838
-0x60F6 = 0x5835
-0x60F7 = 0x5836
-0x60F9 = 0x3C66
-0x60FA = 0x5839
-0x60FB = 0x583C
-0x6100 = 0x5837
-0x6101 = 0x3D25
-0x6103 = 0x583A
-0x6106 = 0x5834
-0x6108 = 0x4C7C
-0x6109 = 0x4C7B
-0x610D = 0x583E
-0x610E = 0x583F
-0x610F = 0x3055
-0x6115 = 0x5833
-0x611A = 0x3672
-0x611B = 0x3026
-0x611F = 0x3436
-0x6121 = 0x583B
-0x6127 = 0x5843
-0x6128 = 0x5842
-0x612C = 0x5847
-0x6134 = 0x5848
-0x613C = 0x5846
-0x613D = 0x5849
-0x613E = 0x5841
-0x613F = 0x5845
-0x6142 = 0x584A
-0x6144 = 0x584B
-0x6147 = 0x5840
-0x6148 = 0x3B7C
-0x614A = 0x5844
-0x614B = 0x4256
-0x614C = 0x3932
-0x614D = 0x5832
-0x614E = 0x3F35
-0x6153 = 0x5858
-0x6155 = 0x4A69
-0x6158 = 0x584E
-0x6159 = 0x584F
-0x615A = 0x5850
-0x615D = 0x5857
-0x615F = 0x5856
-0x6162 = 0x4B7D
-0x6163 = 0x3437
-0x6165 = 0x5854
-0x6167 = 0x3745
-0x6168 = 0x3334
-0x616B = 0x5851
-0x616E = 0x4E38
-0x616F = 0x5853
-0x6170 = 0x3056
-0x6171 = 0x5855
-0x6173 = 0x584C
-0x6174 = 0x5852
-0x6175 = 0x5859
-0x6176 = 0x3744
-0x6177 = 0x584D
-0x617E = 0x4D5D
-0x6182 = 0x4D2B
-0x6187 = 0x585C
-0x618A = 0x5860
-0x618E = 0x417E
-0x6190 = 0x4E79
-0x6191 = 0x5861
-0x6194 = 0x585E
-0x6196 = 0x585B
-0x6199 = 0x585A
-0x619A = 0x585F
-0x61A4 = 0x4A30
-0x61A7 = 0x4634
-0x61A9 = 0x3746
-0x61AB = 0x5862
-0x61AC = 0x585D
-0x61AE = 0x5863
-0x61B2 = 0x377B
-0x61B6 = 0x3231
-0x61BA = 0x586B
-0x61BE = 0x3438
-0x61C3 = 0x5869
-0x61C6 = 0x586A
-0x61C7 = 0x3A29
-0x61C8 = 0x5868
-0x61C9 = 0x5866
-0x61CA = 0x5865
-0x61CB = 0x586C
-0x61CC = 0x5864
-0x61CD = 0x586E
-0x61D0 = 0x327B
-0x61E3 = 0x5870
-0x61E6 = 0x586F
-0x61F2 = 0x4428
-0x61F4 = 0x5873
-0x61F6 = 0x5871
-0x61F7 = 0x5867
-0x61F8 = 0x377C
-0x61FA = 0x5872
-0x61FC = 0x5876
-0x61FD = 0x5875
-0x61FE = 0x5877
-0x61FF = 0x5874
-0x6200 = 0x5878
-0x6208 = 0x5879
-0x6209 = 0x587A
-0x620A = 0x4A6A
-0x620C = 0x587C
-0x620D = 0x587B
-0x620E = 0x3D3F
-0x6210 = 0x402E
-0x6211 = 0x3266
-0x6212 = 0x327C
-0x6214 = 0x587D
-0x6216 = 0x303F
-0x621A = 0x404C
-0x621B = 0x587E
-0x621D = 0x6C43
-0x621E = 0x5921
-0x621F = 0x3761
-0x6221 = 0x5922
-0x6226 = 0x406F
-0x622A = 0x5923
-0x622E = 0x5924
-0x622F = 0x353A
-0x6230 = 0x5925
-0x6232 = 0x5926
-0x6233 = 0x5927
-0x6234 = 0x4257
-0x6238 = 0x384D
-0x623B = 0x4C61
-0x623F = 0x4B3C
-0x6240 = 0x3D6A
-0x6241 = 0x5928
-0x6247 = 0x4070
-0x6248 = 0x6E3D
-0x6249 = 0x4862
-0x624B = 0x3C6A
-0x624D = 0x3A4D
-0x624E = 0x5929
-0x6253 = 0x4247
-0x6255 = 0x4A27
-0x6258 = 0x4271
-0x625B = 0x592C
-0x625E = 0x592A
-0x6260 = 0x592D
-0x6263 = 0x592B
-0x6268 = 0x592E
-0x626E = 0x4A31
-0x6271 = 0x3037
-0x6276 = 0x495E
-0x6279 = 0x4863
-0x627C = 0x592F
-0x627E = 0x5932
-0x627F = 0x3E35
-0x6280 = 0x353B
-0x6282 = 0x5930
-0x6283 = 0x5937
-0x6284 = 0x3E36
-0x6289 = 0x5931
-0x628A = 0x4744
-0x6291 = 0x4D5E
-0x6292 = 0x5933
-0x6293 = 0x5934
-0x6294 = 0x5938
-0x6295 = 0x456A
-0x6296 = 0x5935
-0x6297 = 0x3933
-0x6298 = 0x405E
-0x629B = 0x5946
-0x629C = 0x4834
-0x629E = 0x4272
-0x62AB = 0x4864
-0x62AC = 0x5A2D
-0x62B1 = 0x4A7A
-0x62B5 = 0x4471
-0x62B9 = 0x4B75
-0x62BB = 0x593B
-0x62BC = 0x3221
-0x62BD = 0x436A
-0x62C2 = 0x5944
-0x62C5 = 0x4334
-0x62C6 = 0x593E
-0x62C7 = 0x5945
-0x62C8 = 0x5940
-0x62C9 = 0x5947
-0x62CA = 0x5943
-0x62CC = 0x5942
-0x62CD = 0x476F
-0x62CF = 0x593C
-0x62D0 = 0x327D
-0x62D1 = 0x593A
-0x62D2 = 0x3571
-0x62D3 = 0x4273
-0x62D4 = 0x5936
-0x62D7 = 0x5939
-0x62D8 = 0x3934
-0x62D9 = 0x405B
-0x62DB = 0x3E37
-0x62DC = 0x5941
-0x62DD = 0x4752
-0x62E0 = 0x3572
-0x62E1 = 0x3348
-0x62EC = 0x3367
-0x62ED = 0x3F21
-0x62EE = 0x5949
-0x62EF = 0x594E
-0x62F1 = 0x594A
-0x62F3 = 0x377D
-0x62F5 = 0x594F
-0x62F6 = 0x3B22
-0x62F7 = 0x3969
-0x62FE = 0x3D26
-0x62FF = 0x593D
-0x6301 = 0x3B7D
-0x6302 = 0x594C
-0x6307 = 0x3B58
-0x6308 = 0x594D
-0x6309 = 0x3044
-0x630C = 0x5948
-0x6311 = 0x4429
-0x6319 = 0x3573
-0x631F = 0x3634
-0x6327 = 0x594B
-0x6328 = 0x3027
-0x632B = 0x3A43
-0x632F = 0x3F36
-0x633A = 0x4472
-0x633D = 0x4854
-0x633E = 0x5951
-0x633F = 0x415E
-0x6349 = 0x422A
-0x634C = 0x3B2B
-0x634D = 0x5952
-0x634F = 0x5954
-0x6350 = 0x5950
-0x6355 = 0x4A61
-0x6357 = 0x443D
-0x635C = 0x415C
-0x6367 = 0x4A7B
-0x6368 = 0x3C4E
-0x6369 = 0x5960
-0x636B = 0x595F
-0x636E = 0x3F78
-0x6372 = 0x377E
-0x6376 = 0x5959
-0x6377 = 0x3E39
-0x637A = 0x4668
-0x637B = 0x4731
-0x6380 = 0x5957
-0x6383 = 0x415D
-0x6388 = 0x3C78
-0x6389 = 0x595C
-0x638C = 0x3E38
-0x638E = 0x5956
-0x638F = 0x595B
-0x6392 = 0x4753
-0x6396 = 0x5955
-0x6398 = 0x3721
-0x639B = 0x335D
-0x639F = 0x595D
-0x63A0 = 0x4E2B
-0x63A1 = 0x3A4E
-0x63A2 = 0x4335
-0x63A3 = 0x595A
-0x63A5 = 0x405C
-0x63A7 = 0x3935
-0x63A8 = 0x3F64
-0x63A9 = 0x3166
-0x63AA = 0x413C
-0x63AB = 0x5958
-0x63AC = 0x3545
-0x63B2 = 0x3747
-0x63B4 = 0x444F
-0x63B5 = 0x595E
-0x63BB = 0x415F
-0x63BE = 0x5961
-0x63C0 = 0x5963
-0x63C3 = 0x4237
-0x63C4 = 0x5969
-0x63C6 = 0x5964
-0x63C9 = 0x5966
-0x63CF = 0x4941
-0x63D0 = 0x4473
-0x63D2 = 0x5967
-0x63D6 = 0x4D2C
-0x63DA = 0x4D48
-0x63DB = 0x3439
-0x63E1 = 0x302E
-0x63E3 = 0x5965
-0x63E9 = 0x5962
-0x63EE = 0x3478
-0x63F4 = 0x3167
-0x63F6 = 0x5968
-0x63FA = 0x4D49
-0x6406 = 0x596C
-0x640D = 0x423B
-0x640F = 0x5973
-0x6413 = 0x596D
-0x6416 = 0x596A
-0x6417 = 0x5971
-0x641C = 0x5953
-0x6426 = 0x596E
-0x6428 = 0x5972
-0x642C = 0x4842
-0x642D = 0x456B
-0x6434 = 0x596B
-0x6436 = 0x596F
-0x643A = 0x3748
-0x643E = 0x3A71
-0x6442 = 0x405D
-0x644E = 0x5977
-0x6458 = 0x4526
-0x6467 = 0x5974
-0x6469 = 0x4B60
-0x646F = 0x5975
-0x6476 = 0x5976
-0x6478 = 0x4C4E
-0x647A = 0x4022
-0x6483 = 0x3762
-0x6488 = 0x597D
-0x6492 = 0x3B35
-0x6493 = 0x597A
-0x6495 = 0x5979
-0x649A = 0x4732
-0x649E = 0x4635
-0x64A4 = 0x4531
-0x64A5 = 0x597B
-0x64A9 = 0x597C
-0x64AB = 0x496F
-0x64AD = 0x4745
-0x64AE = 0x3B23
-0x64B0 = 0x4071
-0x64B2 = 0x4B50
-0x64B9 = 0x3349
-0x64BB = 0x5A25
-0x64BC = 0x597E
-0x64C1 = 0x4D4A
-0x64C2 = 0x5A27
-0x64C5 = 0x5A23
-0x64C7 = 0x5A24
-0x64CD = 0x4160
-0x64D2 = 0x5A22
-0x64D4 = 0x593F
-0x64D8 = 0x5A26
-0x64DA = 0x5A21
-0x64E0 = 0x5A2B
-0x64E1 = 0x5A2C
-0x64E2 = 0x4527
-0x64E3 = 0x5A2E
-0x64E6 = 0x3B24
-0x64E7 = 0x5A29
-0x64EC = 0x353C
-0x64EF = 0x5A2F
-0x64F1 = 0x5A28
-0x64F2 = 0x5A33
-0x64F4 = 0x5A32
-0x64F6 = 0x5A31
-0x64FA = 0x5A34
-0x64FD = 0x5A36
-0x64FE = 0x3E71
-0x6500 = 0x5A35
-0x6505 = 0x5A39
-0x6518 = 0x5A37
-0x651C = 0x5A38
-0x651D = 0x5970
-0x6523 = 0x5A3B
-0x6524 = 0x5A3A
-0x652A = 0x5978
-0x652B = 0x5A3C
-0x652C = 0x5A30
-0x652F = 0x3B59
-0x6534 = 0x5A3D
-0x6535 = 0x5A3E
-0x6536 = 0x5A40
-0x6537 = 0x5A3F
-0x6538 = 0x5A41
-0x6539 = 0x327E
-0x653B = 0x3936
-0x653E = 0x4A7C
-0x653F = 0x402F
-0x6545 = 0x384E
-0x6548 = 0x5A43
-0x654D = 0x5A46
-0x654F = 0x4952
-0x6551 = 0x355F
-0x6555 = 0x5A45
-0x6556 = 0x5A44
-0x6557 = 0x4754
-0x6558 = 0x5A47
-0x6559 = 0x3635
-0x655D = 0x5A49
-0x655E = 0x5A48
-0x6562 = 0x343A
-0x6563 = 0x3B36
-0x6566 = 0x4658
-0x656C = 0x3749
-0x6570 = 0x3F74
-0x6572 = 0x5A4A
-0x6574 = 0x4030
-0x6575 = 0x4528
-0x6577 = 0x495F
-0x6578 = 0x5A4B
-0x6582 = 0x5A4C
-0x6583 = 0x5A4D
-0x6587 = 0x4A38
-0x6588 = 0x555D
-0x6589 = 0x4046
-0x658C = 0x494C
-0x658E = 0x3A58
-0x6590 = 0x4865
-0x6591 = 0x4843
-0x6597 = 0x454D
-0x6599 = 0x4E41
-0x659B = 0x5A4F
-0x659C = 0x3C50
-0x659F = 0x5A50
-0x65A1 = 0x3036
-0x65A4 = 0x3654
-0x65A5 = 0x404D
-0x65A7 = 0x4960
-0x65AB = 0x5A51
-0x65AC = 0x3B42
-0x65AD = 0x4347
-0x65AF = 0x3B5B
-0x65B0 = 0x3F37
-0x65B7 = 0x5A52
-0x65B9 = 0x4A7D
-0x65BC = 0x3177
-0x65BD = 0x3B5C
-0x65C1 = 0x5A55
-0x65C3 = 0x5A53
-0x65C4 = 0x5A56
-0x65C5 = 0x4E39
-0x65C6 = 0x5A54
-0x65CB = 0x407B
-0x65CC = 0x5A57
-0x65CF = 0x4232
-0x65D2 = 0x5A58
-0x65D7 = 0x347A
-0x65D9 = 0x5A5A
-0x65DB = 0x5A59
-0x65E0 = 0x5A5B
-0x65E1 = 0x5A5C
-0x65E2 = 0x347B
-0x65E5 = 0x467C
-0x65E6 = 0x4336
-0x65E7 = 0x356C
-0x65E8 = 0x3B5D
-0x65E9 = 0x4161
-0x65EC = 0x3D5C
-0x65ED = 0x3030
-0x65F1 = 0x5A5D
-0x65FA = 0x3222
-0x65FB = 0x5A61
-0x6602 = 0x3937
-0x6603 = 0x5A60
-0x6606 = 0x3A2B
-0x6607 = 0x3E3A
-0x660A = 0x5A5F
-0x660C = 0x3E3B
-0x660E = 0x4C40
-0x660F = 0x3A2A
-0x6613 = 0x3057
-0x6614 = 0x404E
-0x661C = 0x5A66
-0x661F = 0x4031
-0x6620 = 0x3147
-0x6625 = 0x3D55
-0x6627 = 0x4B66
-0x6628 = 0x3A72
-0x662D = 0x3E3C
-0x662F = 0x4027
-0x6634 = 0x5A65
-0x6635 = 0x5A63
-0x6636 = 0x5A64
-0x663C = 0x436B
-0x663F = 0x5B26
-0x6641 = 0x5A6A
-0x6642 = 0x3B7E
-0x6643 = 0x3938
-0x6644 = 0x5A68
-0x6649 = 0x5A69
-0x664B = 0x3F38
-0x664F = 0x5A67
-0x6652 = 0x3B2F
-0x665D = 0x5A6C
-0x665E = 0x5A6B
-0x665F = 0x5A70
-0x6662 = 0x5A71
-0x6664 = 0x5A6D
-0x6666 = 0x3322
-0x6667 = 0x5A6E
-0x6668 = 0x5A6F
-0x6669 = 0x4855
-0x666E = 0x4961
-0x666F = 0x374A
-0x6670 = 0x5A72
-0x6674 = 0x4032
-0x6676 = 0x3E3D
-0x667A = 0x4352
-0x6681 = 0x3647
-0x6683 = 0x5A73
-0x6684 = 0x5A77
-0x6687 = 0x324B
-0x6688 = 0x5A74
-0x6689 = 0x5A76
-0x668E = 0x5A75
-0x6691 = 0x3D6B
-0x6696 = 0x4348
-0x6697 = 0x3045
-0x6698 = 0x5A78
-0x669D = 0x5A79
-0x66A2 = 0x442A
-0x66A6 = 0x4E71
-0x66AB = 0x3B43
-0x66AE = 0x4A6B
-0x66B4 = 0x4B3D
-0x66B8 = 0x5B22
-0x66B9 = 0x5A7B
-0x66BC = 0x5A7E
-0x66BE = 0x5A7D
-0x66C1 = 0x5A7A
-0x66C4 = 0x5B21
-0x66C7 = 0x465E
-0x66C9 = 0x5A7C
-0x66D6 = 0x5B23
-0x66D9 = 0x3D6C
-0x66DA = 0x5B24
-0x66DC = 0x4D4B
-0x66DD = 0x4778
-0x66E0 = 0x5B25
-0x66E6 = 0x5B27
-0x66E9 = 0x5B28
-0x66F0 = 0x5B29
-0x66F2 = 0x364A
-0x66F3 = 0x3148
-0x66F4 = 0x3939
-0x66F5 = 0x5B2A
-0x66F7 = 0x5B2B
-0x66F8 = 0x3D71
-0x66F9 = 0x4162
-0x66FC = 0x5258
-0x66FD = 0x413E
-0x66FE = 0x413D
-0x66FF = 0x4258
-0x6700 = 0x3A47
-0x6703 = 0x5072
-0x6708 = 0x376E
-0x6709 = 0x4D2D
-0x670B = 0x4A7E
-0x670D = 0x497E
-0x670F = 0x5B2C
-0x6714 = 0x3A73
-0x6715 = 0x443F
-0x6716 = 0x5B2D
-0x6717 = 0x4F2F
-0x671B = 0x4B3E
-0x671D = 0x442B
-0x671E = 0x5B2E
-0x671F = 0x347C
-0x6726 = 0x5B2F
-0x6727 = 0x5B30
-0x6728 = 0x4C5A
-0x672A = 0x4C24
-0x672B = 0x4B76
-0x672C = 0x4B5C
-0x672D = 0x3B25
-0x672E = 0x5B32
-0x6731 = 0x3C6B
-0x6734 = 0x4B51
-0x6736 = 0x5B34
-0x6737 = 0x5B37
-0x6738 = 0x5B36
-0x673A = 0x3479
-0x673D = 0x3560
-0x673F = 0x5B33
-0x6741 = 0x5B35
-0x6746 = 0x5B38
-0x6749 = 0x3F79
-0x674E = 0x4D7B
-0x674F = 0x3049
-0x6750 = 0x3A60
-0x6751 = 0x423C
-0x6753 = 0x3C5D
-0x6756 = 0x3E73
-0x6759 = 0x5B3B
-0x675C = 0x454E
-0x675E = 0x5B39
-0x675F = 0x422B
-0x6760 = 0x5B3A
-0x6761 = 0x3E72
-0x6762 = 0x4C5D
-0x6763 = 0x5B3C
-0x6764 = 0x5B3D
-0x6765 = 0x4D68
-0x676A = 0x5B42
-0x676D = 0x393A
-0x676F = 0x4755
-0x6770 = 0x5B3F
-0x6771 = 0x456C
-0x6772 = 0x5A5E
-0x6773 = 0x5A62
-0x6775 = 0x354F
-0x6777 = 0x4747
-0x677C = 0x5B41
-0x677E = 0x3E3E
-0x677F = 0x4844
-0x6785 = 0x5B47
-0x6787 = 0x487A
-0x6789 = 0x5B3E
-0x678B = 0x5B44
-0x678C = 0x5B43
-0x6790 = 0x404F
-0x6795 = 0x4B6D
-0x6797 = 0x4E53
-0x679A = 0x4B67
-0x679C = 0x324C
-0x679D = 0x3B5E
-0x67A0 = 0x4F48
-0x67A1 = 0x5B46
-0x67A2 = 0x3F75
-0x67A6 = 0x5B45
-0x67A9 = 0x5B40
-0x67AF = 0x384F
-0x67B3 = 0x5B4C
-0x67B4 = 0x5B4A
-0x67B6 = 0x324D
-0x67B7 = 0x5B48
-0x67B8 = 0x5B4E
-0x67B9 = 0x5B54
-0x67C1 = 0x4248
-0x67C4 = 0x4A41
-0x67C6 = 0x5B56
-0x67CA = 0x4922
-0x67CE = 0x5B55
-0x67CF = 0x4770
-0x67D0 = 0x4B3F
-0x67D1 = 0x343B
-0x67D3 = 0x4077
-0x67D4 = 0x3D40
-0x67D8 = 0x4453
-0x67DA = 0x4D2E
-0x67DD = 0x5B51
-0x67DE = 0x5B50
-0x67E2 = 0x5B52
-0x67E4 = 0x5B4F
-0x67E7 = 0x5B57
-0x67E9 = 0x5B4D
-0x67EC = 0x5B4B
-0x67EE = 0x5B53
-0x67EF = 0x5B49
-0x67F1 = 0x436C
-0x67F3 = 0x4C78
-0x67F4 = 0x3C46
-0x67F5 = 0x3A74
-0x67FB = 0x3A3A
-0x67FE = 0x4B6F
-0x67FF = 0x3341
-0x6802 = 0x444E
-0x6803 = 0x464A
-0x6804 = 0x3149
-0x6813 = 0x4072
-0x6816 = 0x4034
-0x6817 = 0x372A
-0x681E = 0x5B59
-0x6821 = 0x393B
-0x6822 = 0x337C
-0x6829 = 0x5B5B
-0x682A = 0x3374
-0x682B = 0x5B61
-0x6832 = 0x5B5E
-0x6834 = 0x4073
-0x6838 = 0x334B
-0x6839 = 0x3A2C
-0x683C = 0x334A
-0x683D = 0x3A4F
-0x6840 = 0x5B5C
-0x6841 = 0x3765
-0x6842 = 0x374B
-0x6843 = 0x456D
-0x6846 = 0x5B5A
-0x6848 = 0x3046
-0x684D = 0x5B5D
-0x684E = 0x5B5F
-0x6850 = 0x364D
-0x6851 = 0x372C
-0x6853 = 0x343C
-0x6854 = 0x354B
-0x6859 = 0x5B62
-0x685C = 0x3A79
-0x685D = 0x4B71
-0x685F = 0x3B37
-0x6863 = 0x5B63
-0x6867 = 0x4930
-0x6874 = 0x5B6F
-0x6876 = 0x3233
-0x6877 = 0x5B64
-0x687E = 0x5B75
-0x687F = 0x5B65
-0x6881 = 0x4E42
-0x6883 = 0x5B6C
-0x6885 = 0x475F
-0x688D = 0x5B74
-0x688F = 0x5B67
-0x6893 = 0x3034
-0x6894 = 0x5B69
-0x6897 = 0x393C
-0x689B = 0x5B6B
-0x689D = 0x5B6A
-0x689F = 0x5B66
-0x68A0 = 0x5B71
-0x68A2 = 0x3E3F
-0x68A6 = 0x546D
-0x68A7 = 0x3868
-0x68A8 = 0x4D7C
-0x68AD = 0x5B68
-0x68AF = 0x4474
-0x68B0 = 0x3323
-0x68B1 = 0x3A2D
-0x68B3 = 0x5B60
-0x68B5 = 0x5B70
-0x68B6 = 0x3361
-0x68B9 = 0x5B6E
-0x68BA = 0x5B72
-0x68BC = 0x456E
-0x68C4 = 0x347E
-0x68C6 = 0x5C32
-0x68C9 = 0x4C49
-0x68CA = 0x5B77
-0x68CB = 0x347D
-0x68CD = 0x5B7E
-0x68D2 = 0x4B40
-0x68D4 = 0x5C21
-0x68D5 = 0x5C23
-0x68D7 = 0x5C27
-0x68D8 = 0x5B79
-0x68DA = 0x432A
-0x68DF = 0x456F
-0x68E0 = 0x5C2B
-0x68E1 = 0x5B7C
-0x68E3 = 0x5C28
-0x68E7 = 0x5C22
-0x68EE = 0x3F39
-0x68EF = 0x5C2C
-0x68F2 = 0x4033
-0x68F9 = 0x5C2A
-0x68FA = 0x343D
-0x6900 = 0x4F50
-0x6901 = 0x5B76
-0x6904 = 0x5C26
-0x6905 = 0x3058
-0x6908 = 0x5B78
-0x690B = 0x4C3A
-0x690C = 0x5B7D
-0x690D = 0x3F22
-0x690E = 0x4447
-0x690F = 0x5B73
-0x6912 = 0x5C25
-0x6919 = 0x3F7A
-0x691A = 0x5C2F
-0x691B = 0x3371
-0x691C = 0x3821
-0x6921 = 0x5C31
-0x6922 = 0x5B7A
-0x6923 = 0x5C30
-0x6925 = 0x5C29
-0x6926 = 0x5B7B
-0x6928 = 0x5C2D
-0x692A = 0x5C2E
-0x6930 = 0x5C3F
-0x6934 = 0x464E
-0x6936 = 0x5C24
-0x6939 = 0x5C3B
-0x693D = 0x5C3D
-0x693F = 0x4458
-0x694A = 0x4D4C
-0x6953 = 0x4976
-0x6954 = 0x5C38
-0x6955 = 0x424A
-0x6959 = 0x5C3E
-0x695A = 0x413F
-0x695C = 0x5C35
-0x695D = 0x5C42
-0x695E = 0x5C41
-0x6960 = 0x466F
-0x6961 = 0x5C40
-0x6962 = 0x466A
-0x696A = 0x5C44
-0x696B = 0x5C37
-0x696D = 0x3648
-0x696E = 0x5C3A
-0x696F = 0x3D5D
-0x6973 = 0x4760
-0x6974 = 0x5C3C
-0x6975 = 0x364B
-0x6977 = 0x5C34
-0x6978 = 0x5C36
-0x6979 = 0x5C33
-0x697C = 0x4F30
-0x697D = 0x335A
-0x697E = 0x5C39
-0x6981 = 0x5C43
-0x6982 = 0x3335
-0x698A = 0x3A67
-0x698E = 0x315D
-0x6991 = 0x5C54
-0x6994 = 0x4F31
-0x6995 = 0x5C57
-0x699B = 0x3F3A
-0x699C = 0x5C56
-0x69A0 = 0x5C55
-0x69A7 = 0x5C52
-0x69AE = 0x5C46
-0x69B1 = 0x5C63
-0x69B2 = 0x5C45
-0x69B4 = 0x5C58
-0x69BB = 0x5C50
-0x69BE = 0x5C4B
-0x69BF = 0x5C48
-0x69C1 = 0x5C49
-0x69C3 = 0x5C51
-0x69C7 = 0x7422
-0x69CA = 0x5C4E
-0x69CB = 0x393D
-0x69CC = 0x4448
-0x69CD = 0x4164
-0x69CE = 0x5C4C
-0x69D0 = 0x5C47
-0x69D3 = 0x5C4A
-0x69D8 = 0x4D4D
-0x69D9 = 0x4B6A
-0x69DD = 0x5C4F
-0x69DE = 0x5C59
-0x69E7 = 0x5C61
-0x69E8 = 0x5C5A
-0x69EB = 0x5C67
-0x69ED = 0x5C65
-0x69F2 = 0x5C60
-0x69F9 = 0x5C5F
-0x69FB = 0x4450
-0x69FD = 0x4165
-0x69FF = 0x5C5D
-0x6A02 = 0x5C5B
-0x6A05 = 0x5C62
-0x6A0A = 0x5C68
-0x6A0B = 0x4875
-0x6A0C = 0x5C6E
-0x6A12 = 0x5C69
-0x6A13 = 0x5C6C
-0x6A14 = 0x5C66
-0x6A17 = 0x4374
-0x6A19 = 0x4938
-0x6A1B = 0x5C5C
-0x6A1E = 0x5C64
-0x6A1F = 0x3E40
-0x6A21 = 0x4C4F
-0x6A22 = 0x5C78
-0x6A23 = 0x5C6B
-0x6A29 = 0x3822
-0x6A2A = 0x3223
-0x6A2B = 0x335F
-0x6A2E = 0x5C53
-0x6A35 = 0x3E41
-0x6A36 = 0x5C70
-0x6A38 = 0x5C77
-0x6A39 = 0x3C79
-0x6A3A = 0x3372
-0x6A3D = 0x432E
-0x6A44 = 0x5C6D
-0x6A47 = 0x5C72
-0x6A48 = 0x5C76
-0x6A4B = 0x3636
-0x6A58 = 0x354C
-0x6A59 = 0x5C74
-0x6A5F = 0x3521
-0x6A61 = 0x464B
-0x6A62 = 0x5C73
-0x6A66 = 0x5C75
-0x6A72 = 0x5C6F
-0x6A78 = 0x5C71
-0x6A7F = 0x3360
-0x6A80 = 0x4349
-0x6A84 = 0x5C7C
-0x6A8D = 0x5C7A
-0x6A8E = 0x3869
-0x6A90 = 0x5C79
-0x6A97 = 0x5D21
-0x6A9C = 0x5B58
-0x6AA0 = 0x5C7B
-0x6AA2 = 0x5C7D
-0x6AA3 = 0x5C7E
-0x6AAA = 0x5D2C
-0x6AAC = 0x5D28
-0x6AAE = 0x5B6D
-0x6AB3 = 0x5D27
-0x6AB8 = 0x5D26
-0x6ABB = 0x5D23
-0x6AC1 = 0x5C6A
-0x6AC2 = 0x5D25
-0x6AC3 = 0x5D24
-0x6AD1 = 0x5D2A
-0x6AD3 = 0x4F26
-0x6ADA = 0x5D2D
-0x6ADB = 0x367B
-0x6ADE = 0x5D29
-0x6ADF = 0x5D2B
-0x6AE8 = 0x4827
-0x6AEA = 0x5D2E
-0x6AFA = 0x5D32
-0x6AFB = 0x5D2F
-0x6B04 = 0x4D73
-0x6B05 = 0x5D30
-0x6B0A = 0x5C5E
-0x6B12 = 0x5D33
-0x6B16 = 0x5D34
-0x6B1D = 0x3135
-0x6B1F = 0x5D36
-0x6B20 = 0x3767
-0x6B21 = 0x3C21
-0x6B23 = 0x3655
-0x6B27 = 0x3224
-0x6B32 = 0x4D5F
-0x6B37 = 0x5D38
-0x6B38 = 0x5D37
-0x6B39 = 0x5D3A
-0x6B3A = 0x353D
-0x6B3D = 0x3656
-0x6B3E = 0x343E
-0x6B43 = 0x5D3D
-0x6B47 = 0x5D3C
-0x6B49 = 0x5D3E
-0x6B4C = 0x324E
-0x6B4E = 0x4337
-0x6B50 = 0x5D3F
-0x6B53 = 0x343F
-0x6B54 = 0x5D41
-0x6B59 = 0x5D40
-0x6B5B = 0x5D42
-0x6B5F = 0x5D43
-0x6B61 = 0x5D44
-0x6B62 = 0x3B5F
-0x6B63 = 0x4035
-0x6B64 = 0x3A21
-0x6B66 = 0x4970
-0x6B69 = 0x4A62
-0x6B6A = 0x4F44
-0x6B6F = 0x3B75
-0x6B73 = 0x3A50
-0x6B74 = 0x4E72
-0x6B78 = 0x5D45
-0x6B79 = 0x5D46
-0x6B7B = 0x3B60
-0x6B7F = 0x5D47
-0x6B80 = 0x5D48
-0x6B83 = 0x5D4A
-0x6B84 = 0x5D49
-0x6B86 = 0x4B58
-0x6B89 = 0x3D5E
-0x6B8A = 0x3C6C
-0x6B8B = 0x3B44
-0x6B8D = 0x5D4B
-0x6B95 = 0x5D4D
-0x6B96 = 0x3F23
-0x6B98 = 0x5D4C
-0x6B9E = 0x5D4E
-0x6BA4 = 0x5D4F
-0x6BAA = 0x5D50
-0x6BAB = 0x5D51
-0x6BAF = 0x5D52
-0x6BB1 = 0x5D54
-0x6BB2 = 0x5D53
-0x6BB3 = 0x5D55
-0x6BB4 = 0x3225
-0x6BB5 = 0x434A
-0x6BB7 = 0x5D56
-0x6BBA = 0x3B26
-0x6BBB = 0x334C
-0x6BBC = 0x5D57
-0x6BBF = 0x4542
-0x6BC0 = 0x544C
-0x6BC5 = 0x3523
-0x6BC6 = 0x5D58
-0x6BCB = 0x5D59
-0x6BCD = 0x4A6C
-0x6BCE = 0x4B68
-0x6BD2 = 0x4647
-0x6BD3 = 0x5D5A
-0x6BD4 = 0x4866
-0x6BD8 = 0x487B
-0x6BDB = 0x4C53
-0x6BDF = 0x5D5B
-0x6BEB = 0x5D5D
-0x6BEC = 0x5D5C
-0x6BEF = 0x5D5F
-0x6BF3 = 0x5D5E
-0x6C08 = 0x5D61
-0x6C0F = 0x3B61
-0x6C11 = 0x4C31
-0x6C13 = 0x5D62
-0x6C14 = 0x5D63
-0x6C17 = 0x3524
-0x6C1B = 0x5D64
-0x6C23 = 0x5D66
-0x6C24 = 0x5D65
-0x6C34 = 0x3F65
-0x6C37 = 0x4939
-0x6C38 = 0x314A
-0x6C3E = 0x4845
-0x6C40 = 0x4475
-0x6C41 = 0x3D41
-0x6C42 = 0x3561
-0x6C4E = 0x4846
-0x6C50 = 0x3C2E
-0x6C55 = 0x5D68
-0x6C57 = 0x3440
-0x6C5A = 0x3178
-0x6C5D = 0x4672
-0x6C5E = 0x5D67
-0x6C5F = 0x393E
-0x6C60 = 0x4353
-0x6C62 = 0x5D69
-0x6C68 = 0x5D71
-0x6C6A = 0x5D6A
-0x6C70 = 0x4241
-0x6C72 = 0x3562
-0x6C73 = 0x5D72
-0x6C7A = 0x3768
-0x6C7D = 0x3525
-0x6C7E = 0x5D70
-0x6C81 = 0x5D6E
-0x6C82 = 0x5D6B
-0x6C83 = 0x4D60
-0x6C88 = 0x4440
-0x6C8C = 0x4659
-0x6C8D = 0x5D6C
-0x6C90 = 0x5D74
-0x6C92 = 0x5D73
-0x6C93 = 0x3723
-0x6C96 = 0x322D
-0x6C99 = 0x3A3B
-0x6C9A = 0x5D6D
-0x6C9B = 0x5D6F
-0x6CA1 = 0x4B57
-0x6CA2 = 0x4274
-0x6CAB = 0x4B77
-0x6CAE = 0x5D7C
-0x6CB1 = 0x5D7D
-0x6CB3 = 0x324F
-0x6CB8 = 0x4A28
-0x6CB9 = 0x4C7D
-0x6CBA = 0x5E21
-0x6CBB = 0x3C23
-0x6CBC = 0x3E42
-0x6CBD = 0x5D78
-0x6CBE = 0x5D7E
-0x6CBF = 0x3168
-0x6CC1 = 0x3637
-0x6CC4 = 0x5D75
-0x6CC5 = 0x5D7A
-0x6CC9 = 0x4074
-0x6CCA = 0x4771
-0x6CCC = 0x4867
-0x6CD3 = 0x5D77
-0x6CD5 = 0x4B21
-0x6CD7 = 0x5D79
-0x6CD9 = 0x5E24
-0x6CDB = 0x5E22
-0x6CDD = 0x5D7B
-0x6CE1 = 0x4B22
-0x6CE2 = 0x4748
-0x6CE3 = 0x3563
-0x6CE5 = 0x4525
-0x6CE8 = 0x436D
-0x6CEA = 0x5E25
-0x6CEF = 0x5E23
-0x6CF0 = 0x4259
-0x6CF1 = 0x5D76
-0x6CF3 = 0x314B
-0x6D0B = 0x4D4E
-0x6D0C = 0x5E30
-0x6D12 = 0x5E2F
-0x6D17 = 0x4076
-0x6D19 = 0x5E2C
-0x6D1B = 0x4D6C
-0x6D1E = 0x4636
-0x6D1F = 0x5E26
-0x6D25 = 0x4445
-0x6D29 = 0x314C
-0x6D2A = 0x393F
-0x6D2B = 0x5E29
-0x6D32 = 0x3D27
-0x6D33 = 0x5E2E
-0x6D35 = 0x5E2D
-0x6D36 = 0x5E28
-0x6D38 = 0x5E2B
-0x6D3B = 0x3368
-0x6D3D = 0x5E2A
-0x6D3E = 0x4749
-0x6D41 = 0x4E2E
-0x6D44 = 0x3E74
-0x6D45 = 0x4075
-0x6D59 = 0x5E36
-0x6D5A = 0x5E34
-0x6D5C = 0x494D
-0x6D63 = 0x5E31
-0x6D64 = 0x5E33
-0x6D66 = 0x313A
-0x6D69 = 0x3940
-0x6D6A = 0x4F32
-0x6D6C = 0x333D
-0x6D6E = 0x4962
-0x6D74 = 0x4D61
-0x6D77 = 0x3324
-0x6D78 = 0x3F3B
-0x6D79 = 0x5E35
-0x6D85 = 0x5E3A
-0x6D88 = 0x3E43
-0x6D8C = 0x4D30
-0x6D8E = 0x5E37
-0x6D93 = 0x5E32
-0x6D95 = 0x5E38
-0x6D99 = 0x4E5E
-0x6D9B = 0x4573
-0x6D9C = 0x4642
-0x6DAF = 0x3336
-0x6DB2 = 0x3155
-0x6DB5 = 0x5E3E
-0x6DB8 = 0x5E41
-0x6DBC = 0x4E43
-0x6DC0 = 0x4D64
-0x6DC5 = 0x5E48
-0x6DC6 = 0x5E42
-0x6DC7 = 0x5E3F
-0x6DCB = 0x4E54
-0x6DCC = 0x5E45
-0x6DD1 = 0x3D4A
-0x6DD2 = 0x5E47
-0x6DD5 = 0x5E4C
-0x6DD8 = 0x4571
-0x6DD9 = 0x5E4A
-0x6DDE = 0x5E44
-0x6DE1 = 0x4338
-0x6DE4 = 0x5E4B
-0x6DE6 = 0x5E40
-0x6DE8 = 0x5E46
-0x6DEA = 0x5E4D
-0x6DEB = 0x307C
-0x6DEC = 0x5E43
-0x6DEE = 0x5E4E
-0x6DF1 = 0x3F3C
-0x6DF3 = 0x3D5F
-0x6DF5 = 0x4A25
-0x6DF7 = 0x3A2E
-0x6DF9 = 0x5E3B
-0x6DFA = 0x5E49
-0x6DFB = 0x453A
-0x6E05 = 0x4036
-0x6E07 = 0x3369
-0x6E08 = 0x3A51
-0x6E09 = 0x3E44
-0x6E0A = 0x5E3D
-0x6E0B = 0x3D42
-0x6E13 = 0x374C
-0x6E15 = 0x5E3C
-0x6E19 = 0x5E52
-0x6E1A = 0x3D6D
-0x6E1B = 0x383A
-0x6E1D = 0x5E61
-0x6E1F = 0x5E5B
-0x6E20 = 0x3574
-0x6E21 = 0x454F
-0x6E23 = 0x5E56
-0x6E24 = 0x5E5F
-0x6E25 = 0x302F
-0x6E26 = 0x3132
-0x6E29 = 0x3239
-0x6E2B = 0x5E58
-0x6E2C = 0x422C
-0x6E2D = 0x5E4F
-0x6E2E = 0x5E51
-0x6E2F = 0x3941
-0x6E38 = 0x5E62
-0x6E3A = 0x5E5D
-0x6E3E = 0x5E55
-0x6E43 = 0x5E5C
-0x6E4A = 0x4C2B
-0x6E4D = 0x5E5A
-0x6E4E = 0x5E5E
-0x6E56 = 0x3850
-0x6E58 = 0x3E45
-0x6E5B = 0x4339
-0x6E5F = 0x5E54
-0x6E67 = 0x4D2F
-0x6E6B = 0x5E57
-0x6E6E = 0x5E50
-0x6E6F = 0x4572
-0x6E72 = 0x5E53
-0x6E76 = 0x5E59
-0x6E7E = 0x4F51
-0x6E7F = 0x3C3E
-0x6E80 = 0x4B7E
-0x6E82 = 0x5E63
-0x6E8C = 0x482E
-0x6E8F = 0x5E6F
-0x6E90 = 0x383B
-0x6E96 = 0x3D60
-0x6E98 = 0x5E65
-0x6E9C = 0x4E2F
-0x6E9D = 0x3942
-0x6E9F = 0x5E72
-0x6EA2 = 0x306E
-0x6EA5 = 0x5E70
-0x6EAA = 0x5E64
-0x6EAF = 0x5E6A
-0x6EB2 = 0x5E6C
-0x6EB6 = 0x4D4F
-0x6EB7 = 0x5E67
-0x6EBA = 0x452E
-0x6EBD = 0x5E69
-0x6EC2 = 0x5E71
-0x6EC4 = 0x5E6B
-0x6EC5 = 0x4C47
-0x6EC9 = 0x5E66
-0x6ECB = 0x3C22
-0x6ECC = 0x5E7E
-0x6ED1 = 0x336A
-0x6ED3 = 0x5E68
-0x6ED4 = 0x5E6D
-0x6ED5 = 0x5E6E
-0x6EDD = 0x426C
-0x6EDE = 0x425A
-0x6EEC = 0x5E76
-0x6EEF = 0x5E7C
-0x6EF2 = 0x5E7A
-0x6EF4 = 0x4529
-0x6EF7 = 0x5F23
-0x6EF8 = 0x5E77
-0x6EFE = 0x5E78
-0x6EFF = 0x5E60
-0x6F01 = 0x3579
-0x6F02 = 0x493A
-0x6F06 = 0x3C3F
-0x6F09 = 0x3977
-0x6F0F = 0x4F33
-0x6F11 = 0x5E74
-0x6F13 = 0x5F22
-0x6F14 = 0x3169
-0x6F15 = 0x4166
-0x6F20 = 0x4779
-0x6F22 = 0x3441
-0x6F23 = 0x4E7A
-0x6F2B = 0x4C21
-0x6F2C = 0x4452
-0x6F31 = 0x5E7B
-0x6F32 = 0x5E7D
-0x6F38 = 0x4132
-0x6F3E = 0x5F21
-0x6F3F = 0x5E79
-0x6F41 = 0x5E73
-0x6F45 = 0x3443
-0x6F54 = 0x3769
-0x6F58 = 0x5F2F
-0x6F5B = 0x5F2A
-0x6F5C = 0x4078
-0x6F5F = 0x3363
-0x6F64 = 0x3D61
-0x6F66 = 0x5F33
-0x6F6D = 0x5F2C
-0x6F6E = 0x442C
-0x6F6F = 0x5F29
-0x6F70 = 0x4459
-0x6F74 = 0x5F4C
-0x6F78 = 0x5F26
-0x6F7A = 0x5F25
-0x6F7C = 0x5F2E
-0x6F80 = 0x5F28
-0x6F81 = 0x5F27
-0x6F82 = 0x5F2D
-0x6F84 = 0x4021
-0x6F86 = 0x5F24
-0x6F8E = 0x5F30
-0x6F91 = 0x5F31
-0x6F97 = 0x3442
-0x6FA1 = 0x5F36
-0x6FA3 = 0x5F35
-0x6FA4 = 0x5F37
-0x6FAA = 0x5F3A
-0x6FB1 = 0x4543
-0x6FB3 = 0x5F34
-0x6FB9 = 0x5F38
-0x6FC0 = 0x3763
-0x6FC1 = 0x4279
-0x6FC2 = 0x5F32
-0x6FC3 = 0x473B
-0x6FC6 = 0x5F39
-0x6FD4 = 0x5F3E
-0x6FD5 = 0x5F3C
-0x6FD8 = 0x5F3F
-0x6FDB = 0x5F42
-0x6FDF = 0x5F3B
-0x6FE0 = 0x396A
-0x6FE1 = 0x4728
-0x6FE4 = 0x5E39
-0x6FEB = 0x4D74
-0x6FEC = 0x5F3D
-0x6FEE = 0x5F41
-0x6FEF = 0x4275
-0x6FF1 = 0x5F40
-0x6FF3 = 0x5F2B
-0x6FF6 = 0x6F69
-0x6FFA = 0x5F45
-0x6FFE = 0x5F49
-0x7001 = 0x5F47
-0x7009 = 0x5F43
-0x700B = 0x5F44
-0x700F = 0x5F48
-0x7011 = 0x5F46
-0x7015 = 0x494E
-0x7018 = 0x5F4E
-0x701A = 0x5F4B
-0x701B = 0x5F4A
-0x701D = 0x5F4D
-0x701E = 0x4654
-0x701F = 0x5F4F
-0x7026 = 0x4375
-0x7027 = 0x426D
-0x702C = 0x4025
-0x7030 = 0x5F50
-0x7032 = 0x5F52
-0x703E = 0x5F51
-0x704C = 0x5E75
-0x7051 = 0x5F53
-0x7058 = 0x4667
-0x7063 = 0x5F54
-0x706B = 0x3250
-0x706F = 0x4574
-0x7070 = 0x3325
-0x7078 = 0x3564
-0x707C = 0x3C5E
-0x707D = 0x3A52
-0x7089 = 0x4F27
-0x708A = 0x3F66
-0x708E = 0x316A
-0x7092 = 0x5F56
-0x7099 = 0x5F55
-0x70AC = 0x5F59
-0x70AD = 0x433A
-0x70AE = 0x5F5C
-0x70AF = 0x5F57
-0x70B3 = 0x5F5B
-0x70B8 = 0x5F5A
-0x70B9 = 0x4540
-0x70BA = 0x3059
-0x70C8 = 0x4E75
-0x70CB = 0x5F5E
-0x70CF = 0x3128
-0x70D9 = 0x5F60
-0x70DD = 0x5F5F
-0x70DF = 0x5F5D
-0x70F1 = 0x5F58
-0x70F9 = 0x4B23
-0x70FD = 0x5F62
-0x7109 = 0x5F61
-0x7114 = 0x316B
-0x7119 = 0x5F64
-0x711A = 0x4A32
-0x711C = 0x5F63
-0x7121 = 0x4C35
-0x7126 = 0x3E47
-0x7136 = 0x4133
-0x713C = 0x3E46
-0x7149 = 0x4E7B
-0x714C = 0x5F6A
-0x714E = 0x4079
-0x7155 = 0x5F66
-0x7156 = 0x5F6B
-0x7159 = 0x316C
-0x7162 = 0x5F69
-0x7164 = 0x4761
-0x7165 = 0x5F65
-0x7166 = 0x5F68
-0x7167 = 0x3E48
-0x7169 = 0x4851
-0x716C = 0x5F6C
-0x716E = 0x3C51
-0x717D = 0x407A
-0x7184 = 0x5F6F
-0x7188 = 0x5F67
-0x718A = 0x3727
-0x718F = 0x5F6D
-0x7194 = 0x4D50
-0x7195 = 0x5F70
-0x7199 = 0x7426
-0x719F = 0x3D4F
-0x71A8 = 0x5F71
-0x71AC = 0x5F72
-0x71B1 = 0x472E
-0x71B9 = 0x5F74
-0x71BE = 0x5F75
-0x71C3 = 0x4733
-0x71C8 = 0x4575
-0x71C9 = 0x5F77
-0x71CE = 0x5F79
-0x71D0 = 0x4E55
-0x71D2 = 0x5F76
-0x71D4 = 0x5F78
-0x71D5 = 0x316D
-0x71D7 = 0x5F73
-0x71DF = 0x535B
-0x71E0 = 0x5F7A
-0x71E5 = 0x4167
-0x71E6 = 0x3B38
-0x71E7 = 0x5F7C
-0x71EC = 0x5F7B
-0x71ED = 0x3F24
-0x71EE = 0x5259
-0x71F5 = 0x5F7D
-0x71F9 = 0x6021
-0x71FB = 0x5F6E
-0x71FC = 0x5F7E
-0x71FF = 0x6022
-0x7206 = 0x477A
-0x720D = 0x6023
-0x7210 = 0x6024
-0x721B = 0x6025
-0x7228 = 0x6026
-0x722A = 0x445E
-0x722C = 0x6028
-0x722D = 0x6027
-0x7230 = 0x6029
-0x7232 = 0x602A
-0x7235 = 0x3C5F
-0x7236 = 0x4963
-0x723A = 0x4C6C
-0x723B = 0x602B
-0x723C = 0x602C
-0x723D = 0x4156
-0x723E = 0x3C24
-0x723F = 0x602D
-0x7240 = 0x602E
-0x7246 = 0x602F
-0x7247 = 0x4A52
-0x7248 = 0x4847
-0x724B = 0x6030
-0x724C = 0x4757
-0x7252 = 0x442D
-0x7258 = 0x6031
-0x7259 = 0x3267
-0x725B = 0x356D
-0x725D = 0x4C46
-0x725F = 0x4C36
-0x7261 = 0x3234
-0x7262 = 0x4F34
-0x7267 = 0x4B52
-0x7269 = 0x4A2A
-0x7272 = 0x4037
-0x7274 = 0x6032
-0x7279 = 0x4643
-0x727D = 0x3823
-0x727E = 0x6033
-0x7280 = 0x3A54
-0x7281 = 0x6035
-0x7282 = 0x6034
-0x7287 = 0x6036
-0x7292 = 0x6037
-0x7296 = 0x6038
-0x72A0 = 0x353E
-0x72A2 = 0x6039
-0x72A7 = 0x603A
-0x72AC = 0x3824
-0x72AF = 0x4848
-0x72B2 = 0x603C
-0x72B6 = 0x3E75
-0x72B9 = 0x603B
-0x72C2 = 0x3638
-0x72C3 = 0x603D
-0x72C4 = 0x603F
-0x72C6 = 0x603E
-0x72CE = 0x6040
-0x72D0 = 0x3851
-0x72D2 = 0x6041
-0x72D7 = 0x3669
-0x72D9 = 0x4140
-0x72DB = 0x397D
-0x72E0 = 0x6043
-0x72E1 = 0x6044
-0x72E2 = 0x6042
-0x72E9 = 0x3C6D
-0x72EC = 0x4648
-0x72ED = 0x3639
-0x72F7 = 0x6046
-0x72F8 = 0x432C
-0x72F9 = 0x6045
-0x72FC = 0x4F35
-0x72FD = 0x4762
-0x730A = 0x6049
-0x7316 = 0x604B
-0x7317 = 0x6048
-0x731B = 0x4C54
-0x731C = 0x604A
-0x731D = 0x604C
-0x731F = 0x4E44
-0x7325 = 0x6050
-0x7329 = 0x604F
-0x732A = 0x4376
-0x732B = 0x472D
-0x732E = 0x3825
-0x732F = 0x604E
-0x7334 = 0x604D
-0x7336 = 0x4D31
-0x7337 = 0x4D32
-0x733E = 0x6051
-0x733F = 0x316E
-0x7344 = 0x3976
-0x7345 = 0x3B62
-0x734E = 0x6052
-0x734F = 0x6053
-0x7357 = 0x6055
-0x7363 = 0x3D43
-0x7368 = 0x6057
-0x736A = 0x6056
-0x7370 = 0x6058
-0x7372 = 0x334D
-0x7375 = 0x605A
-0x7378 = 0x6059
-0x737A = 0x605C
-0x737B = 0x605B
-0x7384 = 0x383C
-0x7387 = 0x4E28
-0x7389 = 0x364C
-0x738B = 0x3226
-0x7396 = 0x366A
-0x73A9 = 0x3461
-0x73B2 = 0x4E68
-0x73B3 = 0x605E
-0x73BB = 0x6060
-0x73C0 = 0x6061
-0x73C2 = 0x3251
-0x73C8 = 0x605D
-0x73CA = 0x3B39
-0x73CD = 0x4441
-0x73CE = 0x605F
-0x73DE = 0x6064
-0x73E0 = 0x3C6E
-0x73E5 = 0x6062
-0x73EA = 0x373E
-0x73ED = 0x4849
-0x73EE = 0x6063
-0x73F1 = 0x607E
-0x73F8 = 0x6069
-0x73FE = 0x383D
-0x7403 = 0x3565
-0x7405 = 0x6066
-0x7406 = 0x4D7D
-0x7409 = 0x4E30
-0x7422 = 0x4276
-0x7425 = 0x6068
-0x7432 = 0x606A
-0x7433 = 0x4E56
-0x7434 = 0x3657
-0x7435 = 0x487C
-0x7436 = 0x474A
-0x743A = 0x606B
-0x743F = 0x606D
-0x7441 = 0x6070
-0x7455 = 0x606C
-0x7459 = 0x606F
-0x745A = 0x386A
-0x745B = 0x314D
-0x745C = 0x6071
-0x745E = 0x3F70
-0x745F = 0x606E
-0x7460 = 0x4E5C
-0x7463 = 0x6074
-0x7464 = 0x7424
-0x7469 = 0x6072
-0x746A = 0x6075
-0x746F = 0x6067
-0x7470 = 0x6073
-0x7473 = 0x3A3C
-0x7476 = 0x6076
-0x747E = 0x6077
-0x7483 = 0x4D7E
-0x748B = 0x6078
-0x749E = 0x6079
-0x74A2 = 0x6065
-0x74A7 = 0x607A
-0x74B0 = 0x3444
-0x74BD = 0x3C25
-0x74CA = 0x607B
-0x74CF = 0x607C
-0x74D4 = 0x607D
-0x74DC = 0x313B
-0x74E0 = 0x6121
-0x74E2 = 0x493B
-0x74E3 = 0x6122
-0x74E6 = 0x3424
-0x74E7 = 0x6123
-0x74E9 = 0x6124
-0x74EE = 0x6125
-0x74F0 = 0x6127
-0x74F1 = 0x6128
-0x74F2 = 0x6126
-0x74F6 = 0x4953
-0x74F7 = 0x612A
-0x74F8 = 0x6129
-0x7503 = 0x612C
-0x7504 = 0x612B
-0x7505 = 0x612D
-0x750C = 0x612E
-0x750D = 0x6130
-0x750E = 0x612F
-0x7511 = 0x3979
-0x7513 = 0x6132
-0x7515 = 0x6131
-0x7518 = 0x3445
-0x751A = 0x3F53
-0x751C = 0x453C
-0x751E = 0x6133
-0x751F = 0x4038
-0x7523 = 0x3B3A
-0x7525 = 0x3179
-0x7526 = 0x6134
-0x7528 = 0x4D51
-0x752B = 0x4A63
-0x752C = 0x6135
-0x7530 = 0x4544
-0x7531 = 0x4D33
-0x7532 = 0x3943
-0x7533 = 0x3F3D
-0x7537 = 0x434B
-0x7538 = 0x5234
-0x753A = 0x442E
-0x753B = 0x3268
-0x753C = 0x6136
-0x7544 = 0x6137
-0x7546 = 0x613C
-0x7549 = 0x613A
-0x754A = 0x6139
-0x754B = 0x5A42
-0x754C = 0x3326
-0x754D = 0x6138
-0x754F = 0x305A
-0x7551 = 0x482A
-0x7554 = 0x484A
-0x7559 = 0x4E31
-0x755A = 0x613D
-0x755B = 0x613B
-0x755C = 0x435C
-0x755D = 0x4026
-0x7560 = 0x482B
-0x7562 = 0x492D
-0x7564 = 0x613F
-0x7565 = 0x4E2C
-0x7566 = 0x374D
-0x7567 = 0x6140
-0x7569 = 0x613E
-0x756A = 0x4856
-0x756B = 0x6141
-0x756D = 0x6142
-0x7570 = 0x305B
-0x7573 = 0x3E76
-0x7574 = 0x6147
-0x7576 = 0x6144
-0x7577 = 0x466D
-0x7578 = 0x6143
-0x757F = 0x3526
-0x7582 = 0x614A
-0x7586 = 0x6145
-0x7587 = 0x6146
-0x7589 = 0x6149
-0x758A = 0x6148
-0x758B = 0x4925
-0x758E = 0x4142
-0x758F = 0x4141
-0x7591 = 0x353F
-0x7594 = 0x614B
-0x759A = 0x614C
-0x759D = 0x614D
-0x75A3 = 0x614F
-0x75A5 = 0x614E
-0x75AB = 0x3156
-0x75B1 = 0x6157
-0x75B2 = 0x4868
-0x75B3 = 0x6151
-0x75B5 = 0x6153
-0x75B8 = 0x6155
-0x75B9 = 0x3F3E
-0x75BC = 0x6156
-0x75BD = 0x6154
-0x75BE = 0x3C40
-0x75C2 = 0x6150
-0x75C3 = 0x6152
-0x75C5 = 0x4942
-0x75C7 = 0x3E49
-0x75CA = 0x6159
-0x75CD = 0x6158
-0x75D2 = 0x615A
-0x75D4 = 0x3C26
-0x75D5 = 0x3A2F
-0x75D8 = 0x4577
-0x75D9 = 0x615B
-0x75DB = 0x444B
-0x75DE = 0x615D
-0x75E2 = 0x4E21
-0x75E3 = 0x615C
-0x75E9 = 0x4169
-0x75F0 = 0x6162
-0x75F2 = 0x6164
-0x75F3 = 0x6165
-0x75F4 = 0x4354
-0x75FA = 0x6163
-0x75FC = 0x6160
-0x75FE = 0x615E
-0x75FF = 0x615F
-0x7601 = 0x6161
-0x7609 = 0x6168
-0x760B = 0x6166
-0x760D = 0x6167
-0x761F = 0x6169
-0x7620 = 0x616B
-0x7621 = 0x616C
-0x7622 = 0x616D
-0x7624 = 0x616E
-0x7627 = 0x616A
-0x7630 = 0x6170
-0x7634 = 0x616F
-0x763B = 0x6171
-0x7642 = 0x4E45
-0x7646 = 0x6174
-0x7647 = 0x6172
-0x7648 = 0x6173
-0x764C = 0x3462
-0x7652 = 0x4C7E
-0x7656 = 0x4A4A
-0x7658 = 0x6176
-0x765C = 0x6175
-0x7661 = 0x6177
-0x7662 = 0x6178
-0x7667 = 0x617C
-0x7668 = 0x6179
-0x7669 = 0x617A
-0x766A = 0x617B
-0x766C = 0x617D
-0x7670 = 0x617E
-0x7672 = 0x6221
-0x7676 = 0x6222
-0x7678 = 0x6223
-0x767A = 0x482F
-0x767B = 0x4550
-0x767C = 0x6224
-0x767D = 0x4772
-0x767E = 0x4934
-0x7680 = 0x6225
-0x7683 = 0x6226
-0x7684 = 0x452A
-0x7686 = 0x3327
-0x7687 = 0x3944
-0x7688 = 0x6227
-0x768B = 0x6228
-0x768E = 0x6229
-0x7690 = 0x3B29
-0x7693 = 0x622B
-0x7696 = 0x622A
-0x7699 = 0x622C
-0x769A = 0x622D
-0x76AE = 0x4869
-0x76B0 = 0x622E
-0x76B4 = 0x622F
-0x76B7 = 0x7369
-0x76B8 = 0x6230
-0x76B9 = 0x6231
-0x76BA = 0x6232
-0x76BF = 0x3B2E
-0x76C2 = 0x6233
-0x76C3 = 0x4756
-0x76C6 = 0x4B5F
-0x76C8 = 0x314E
-0x76CA = 0x3157
-0x76CD = 0x6234
-0x76D2 = 0x6236
-0x76D6 = 0x6235
-0x76D7 = 0x4570
-0x76DB = 0x4039
-0x76DC = 0x5D39
-0x76DE = 0x6237
-0x76DF = 0x4C41
-0x76E1 = 0x6238
-0x76E3 = 0x3446
-0x76E4 = 0x4857
-0x76E5 = 0x6239
-0x76E7 = 0x623A
-0x76EA = 0x623B
-0x76EE = 0x4C5C
-0x76F2 = 0x4C55
-0x76F4 = 0x443E
-0x76F8 = 0x416A
-0x76FB = 0x623D
-0x76FE = 0x3D62
-0x7701 = 0x3E4A
-0x7704 = 0x6240
-0x7707 = 0x623F
-0x7708 = 0x623E
-0x7709 = 0x487D
-0x770B = 0x3447
-0x770C = 0x3829
-0x771B = 0x6246
-0x771E = 0x6243
-0x771F = 0x3F3F
-0x7720 = 0x4C32
-0x7724 = 0x6242
-0x7725 = 0x6244
-0x7726 = 0x6245
-0x7729 = 0x6241
-0x7737 = 0x6247
-0x7738 = 0x6248
-0x773A = 0x442F
-0x773C = 0x3463
-0x7740 = 0x4365
-0x7747 = 0x6249
-0x775A = 0x624A
-0x775B = 0x624D
-0x7761 = 0x3F67
-0x7763 = 0x4644
-0x7765 = 0x624E
-0x7766 = 0x4B53
-0x7768 = 0x624B
-0x776B = 0x624C
-0x7779 = 0x6251
-0x777E = 0x6250
-0x777F = 0x624F
-0x778B = 0x6253
-0x778E = 0x6252
-0x7791 = 0x6254
-0x779E = 0x6256
-0x77A0 = 0x6255
-0x77A5 = 0x4A4D
-0x77AC = 0x3D56
-0x77AD = 0x4E46
-0x77B0 = 0x6257
-0x77B3 = 0x4637
-0x77B6 = 0x6258
-0x77B9 = 0x6259
-0x77BB = 0x625D
-0x77BC = 0x625B
-0x77BD = 0x625C
-0x77BF = 0x625A
-0x77C7 = 0x625E
-0x77CD = 0x625F
-0x77D7 = 0x6260
-0x77DA = 0x6261
-0x77DB = 0x4C37
-0x77DC = 0x6262
-0x77E2 = 0x4C70
-0x77E3 = 0x6263
-0x77E5 = 0x434E
-0x77E7 = 0x476A
-0x77E9 = 0x366B
-0x77ED = 0x433B
-0x77EE = 0x6264
-0x77EF = 0x363A
-0x77F3 = 0x4050
-0x77FC = 0x6265
-0x7802 = 0x3A3D
-0x780C = 0x6266
-0x7812 = 0x6267
-0x7814 = 0x3826
-0x7815 = 0x3A55
-0x7820 = 0x6269
-0x7825 = 0x4556
-0x7826 = 0x3A56
-0x7827 = 0x354E
-0x7832 = 0x4B24
-0x7834 = 0x474B
-0x783A = 0x4557
-0x783F = 0x395C
-0x7845 = 0x626B
-0x785D = 0x3E4B
-0x786B = 0x4E32
-0x786C = 0x3945
-0x786F = 0x3827
-0x7872 = 0x4823
-0x7874 = 0x626D
-0x787C = 0x626F
-0x7881 = 0x386B
-0x7886 = 0x626E
-0x7887 = 0x4476
-0x788C = 0x6271
-0x788D = 0x3337
-0x788E = 0x626C
-0x7891 = 0x486A
-0x7893 = 0x3130
-0x7895 = 0x3A6C
-0x7897 = 0x4F52
-0x789A = 0x6270
-0x78A3 = 0x6272
-0x78A7 = 0x4A4B
-0x78A9 = 0x4059
-0x78AA = 0x6274
-0x78AF = 0x6275
-0x78B5 = 0x6273
-0x78BA = 0x334E
-0x78BC = 0x627B
-0x78BE = 0x627A
-0x78C1 = 0x3C27
-0x78C5 = 0x627C
-0x78C6 = 0x6277
-0x78CA = 0x627D
-0x78CB = 0x6278
-0x78D0 = 0x4858
-0x78D1 = 0x6276
-0x78D4 = 0x6279
-0x78DA = 0x6322
-0x78E7 = 0x6321
-0x78E8 = 0x4B61
-0x78EC = 0x627E
-0x78EF = 0x306B
-0x78F4 = 0x6324
-0x78FD = 0x6323
-0x7901 = 0x3E4C
-0x7907 = 0x6325
-0x790E = 0x4143
-0x7911 = 0x6327
-0x7912 = 0x6326
-0x7919 = 0x6328
-0x7926 = 0x6268
-0x792A = 0x626A
-0x792B = 0x632A
-0x792C = 0x6329
-0x793A = 0x3C28
-0x793C = 0x4E69
-0x793E = 0x3C52
-0x7940 = 0x632B
-0x7941 = 0x3737
-0x7947 = 0x3540
-0x7948 = 0x3527
-0x7949 = 0x3B63
-0x7950 = 0x4D34
-0x7953 = 0x6331
-0x7955 = 0x6330
-0x7956 = 0x4144
-0x7957 = 0x632D
-0x795A = 0x632F
-0x795D = 0x3D4B
-0x795E = 0x3F40
-0x795F = 0x632E
-0x7960 = 0x632C
-0x7962 = 0x472A
-0x7965 = 0x3E4D
-0x7968 = 0x493C
-0x796D = 0x3A57
-0x7977 = 0x4578
-0x797A = 0x6332
-0x797F = 0x6333
-0x7980 = 0x6349
-0x7981 = 0x3658
-0x7984 = 0x4F3D
-0x7985 = 0x4135
-0x798A = 0x6334
-0x798D = 0x3252
-0x798E = 0x4477
-0x798F = 0x4A21
-0x799D = 0x6335
-0x79A6 = 0x357A
-0x79A7 = 0x6336
-0x79AA = 0x6338
-0x79AE = 0x6339
-0x79B0 = 0x4729
-0x79B3 = 0x633A
-0x79B9 = 0x633B
-0x79BA = 0x633C
-0x79BD = 0x3659
-0x79BE = 0x3253
-0x79BF = 0x4645
-0x79C0 = 0x3D28
-0x79C1 = 0x3B64
-0x79C9 = 0x633D
-0x79CB = 0x3D29
-0x79D1 = 0x324A
-0x79D2 = 0x4943
-0x79D5 = 0x633E
-0x79D8 = 0x486B
-0x79DF = 0x4145
-0x79E1 = 0x6341
-0x79E3 = 0x6342
-0x79E4 = 0x4769
-0x79E6 = 0x3F41
-0x79E7 = 0x633F
-0x79E9 = 0x4361
-0x79EC = 0x6340
-0x79F0 = 0x3E4E
-0x79FB = 0x305C
-0x7A00 = 0x3529
-0x7A08 = 0x6343
-0x7A0B = 0x4478
-0x7A0D = 0x6344
-0x7A0E = 0x4047
-0x7A14 = 0x4C2D
-0x7A17 = 0x4923
-0x7A18 = 0x6345
-0x7A19 = 0x6346
-0x7A1A = 0x4355
-0x7A1C = 0x4E47
-0x7A1F = 0x6348
-0x7A20 = 0x6347
-0x7A2E = 0x3C6F
-0x7A31 = 0x634A
-0x7A32 = 0x3070
-0x7A37 = 0x634D
-0x7A3B = 0x634B
-0x7A3C = 0x3254
-0x7A3D = 0x374E
-0x7A3E = 0x634C
-0x7A3F = 0x3946
-0x7A40 = 0x3972
-0x7A42 = 0x4A66
-0x7A43 = 0x634E
-0x7A46 = 0x4B54
-0x7A49 = 0x6350
-0x7A4D = 0x4051
-0x7A4E = 0x314F
-0x7A4F = 0x323A
-0x7A50 = 0x302C
-0x7A57 = 0x634F
-0x7A61 = 0x6351
-0x7A62 = 0x6352
-0x7A63 = 0x3E77
-0x7A69 = 0x6353
-0x7A6B = 0x334F
-0x7A70 = 0x6355
-0x7A74 = 0x376A
-0x7A76 = 0x3566
-0x7A79 = 0x6356
-0x7A7A = 0x3675
-0x7A7D = 0x6357
-0x7A7F = 0x407C
-0x7A81 = 0x464D
-0x7A83 = 0x4060
-0x7A84 = 0x3A75
-0x7A88 = 0x6358
-0x7A92 = 0x4362
-0x7A93 = 0x416B
-0x7A95 = 0x635A
-0x7A96 = 0x635C
-0x7A97 = 0x6359
-0x7A98 = 0x635B
-0x7A9F = 0x3722
-0x7AA9 = 0x635D
-0x7AAA = 0x3726
-0x7AAE = 0x3567
-0x7AAF = 0x4D52
-0x7AB0 = 0x635F
-0x7AB6 = 0x6360
-0x7ABA = 0x312E
-0x7ABF = 0x6363
-0x7AC3 = 0x3376
-0x7AC4 = 0x6362
-0x7AC5 = 0x6361
-0x7AC7 = 0x6365
-0x7AC8 = 0x635E
-0x7ACA = 0x6366
-0x7ACB = 0x4E29
-0x7ACD = 0x6367
-0x7ACF = 0x6368
-0x7AD2 = 0x5474
-0x7AD3 = 0x636A
-0x7AD5 = 0x6369
-0x7AD9 = 0x636B
-0x7ADA = 0x636C
-0x7ADC = 0x4E35
-0x7ADD = 0x636D
-0x7ADF = 0x706F
-0x7AE0 = 0x3E4F
-0x7AE1 = 0x636E
-0x7AE2 = 0x636F
-0x7AE3 = 0x3D57
-0x7AE5 = 0x4638
-0x7AE6 = 0x6370
-0x7AEA = 0x4328
-0x7AED = 0x6371
-0x7AEF = 0x433C
-0x7AF0 = 0x6372
-0x7AF6 = 0x3625
-0x7AF8 = 0x513F
-0x7AF9 = 0x435D
-0x7AFA = 0x3C33
-0x7AFF = 0x3448
-0x7B02 = 0x6373
-0x7B04 = 0x6422
-0x7B06 = 0x6376
-0x7B08 = 0x3568
-0x7B0A = 0x6375
-0x7B0B = 0x6424
-0x7B0F = 0x6374
-0x7B11 = 0x3E50
-0x7B18 = 0x6378
-0x7B19 = 0x6379
-0x7B1B = 0x452B
-0x7B1E = 0x637A
-0x7B20 = 0x335E
-0x7B25 = 0x3F5A
-0x7B26 = 0x4964
-0x7B28 = 0x637C
-0x7B2C = 0x4268
-0x7B33 = 0x6377
-0x7B35 = 0x637B
-0x7B36 = 0x637D
-0x7B39 = 0x3A7B
-0x7B45 = 0x6426
-0x7B46 = 0x492E
-0x7B48 = 0x4826
-0x7B49 = 0x4579
-0x7B4B = 0x365A
-0x7B4C = 0x6425
-0x7B4D = 0x6423
-0x7B4F = 0x4835
-0x7B50 = 0x637E
-0x7B51 = 0x435E
-0x7B52 = 0x457B
-0x7B54 = 0x457A
-0x7B56 = 0x3A76
-0x7B5D = 0x6438
-0x7B65 = 0x6428
-0x7B67 = 0x642A
-0x7B6C = 0x642D
-0x7B6E = 0x642E
-0x7B70 = 0x642B
-0x7B71 = 0x642C
-0x7B74 = 0x6429
-0x7B75 = 0x6427
-0x7B7A = 0x6421
-0x7B86 = 0x4A4F
-0x7B87 = 0x3255
-0x7B8B = 0x6435
-0x7B8D = 0x6432
-0x7B8F = 0x6437
-0x7B92 = 0x6436
-0x7B94 = 0x4773
-0x7B95 = 0x4C27
-0x7B97 = 0x3B3B
-0x7B98 = 0x6430
-0x7B99 = 0x6439
-0x7B9A = 0x6434
-0x7B9C = 0x6433
-0x7B9D = 0x642F
-0x7B9F = 0x6431
-0x7BA1 = 0x3449
-0x7BAA = 0x433D
-0x7BAD = 0x407D
-0x7BB1 = 0x4822
-0x7BB4 = 0x643E
-0x7BB8 = 0x4824
-0x7BC0 = 0x4061
-0x7BC1 = 0x643B
-0x7BC4 = 0x484F
-0x7BC6 = 0x643F
-0x7BC7 = 0x4A53
-0x7BC9 = 0x435B
-0x7BCB = 0x643A
-0x7BCC = 0x643C
-0x7BCF = 0x643D
-0x7BDD = 0x6440
-0x7BE0 = 0x3C44
-0x7BE4 = 0x4646
-0x7BE5 = 0x6445
-0x7BE6 = 0x6444
-0x7BE9 = 0x6441
-0x7BED = 0x4F36
-0x7BF3 = 0x644A
-0x7BF6 = 0x644E
-0x7BF7 = 0x644B
-0x7C00 = 0x6447
-0x7C07 = 0x6448
-0x7C0D = 0x644D
-0x7C11 = 0x6442
-0x7C12 = 0x5255
-0x7C13 = 0x6449
-0x7C14 = 0x6443
-0x7C17 = 0x644C
-0x7C1F = 0x6452
-0x7C21 = 0x344A
-0x7C23 = 0x644F
-0x7C27 = 0x6450
-0x7C2A = 0x6451
-0x7C2B = 0x6454
-0x7C37 = 0x6453
-0x7C38 = 0x4876
-0x7C3D = 0x6455
-0x7C3E = 0x4E7C
-0x7C3F = 0x4A6D
-0x7C40 = 0x645A
-0x7C43 = 0x6457
-0x7C4C = 0x6456
-0x7C4D = 0x4052
-0x7C4F = 0x6459
-0x7C50 = 0x645B
-0x7C54 = 0x6458
-0x7C56 = 0x645F
-0x7C58 = 0x645C
-0x7C5F = 0x645D
-0x7C60 = 0x6446
-0x7C64 = 0x645E
-0x7C65 = 0x6460
-0x7C6C = 0x6461
-0x7C73 = 0x4A46
-0x7C75 = 0x6462
-0x7C7E = 0x4C62
-0x7C81 = 0x364E
-0x7C82 = 0x3729
-0x7C83 = 0x6463
-0x7C89 = 0x4A34
-0x7C8B = 0x3F68
-0x7C8D = 0x4C30
-0x7C90 = 0x6464
-0x7C92 = 0x4E33
-0x7C95 = 0x4774
-0x7C97 = 0x4146
-0x7C98 = 0x4734
-0x7C9B = 0x3D4D
-0x7C9F = 0x3040
-0x7CA1 = 0x6469
-0x7CA2 = 0x6467
-0x7CA4 = 0x6465
-0x7CA5 = 0x3421
-0x7CA7 = 0x3E51
-0x7CA8 = 0x646A
-0x7CAB = 0x6468
-0x7CAD = 0x6466
-0x7CAE = 0x646E
-0x7CB1 = 0x646D
-0x7CB2 = 0x646C
-0x7CB3 = 0x646B
-0x7CB9 = 0x646F
-0x7CBD = 0x6470
-0x7CBE = 0x403A
-0x7CC0 = 0x6471
-0x7CC2 = 0x6473
-0x7CC5 = 0x6472
-0x7CCA = 0x3852
-0x7CCE = 0x4138
-0x7CD2 = 0x6475
-0x7CD6 = 0x457C
-0x7CD8 = 0x6474
-0x7CDC = 0x6476
-0x7CDE = 0x4A35
-0x7CDF = 0x416C
-0x7CE0 = 0x3947
-0x7CE2 = 0x6477
-0x7CE7 = 0x4E48
-0x7CEF = 0x6479
-0x7CF2 = 0x647A
-0x7CF4 = 0x647B
-0x7CF6 = 0x647C
-0x7CF8 = 0x3B65
-0x7CFA = 0x647D
-0x7CFB = 0x374F
-0x7CFE = 0x356A
-0x7D00 = 0x352A
-0x7D02 = 0x6521
-0x7D04 = 0x4C73
-0x7D05 = 0x3948
-0x7D06 = 0x647E
-0x7D0A = 0x6524
-0x7D0B = 0x4C66
-0x7D0D = 0x473C
-0x7D10 = 0x4933
-0x7D14 = 0x3D63
-0x7D15 = 0x6523
-0x7D17 = 0x3C53
-0x7D18 = 0x3949
-0x7D19 = 0x3B66
-0x7D1A = 0x3569
-0x7D1B = 0x4A36
-0x7D1C = 0x6522
-0x7D20 = 0x4147
-0x7D21 = 0x4B42
-0x7D22 = 0x3A77
-0x7D2B = 0x3B67
-0x7D2C = 0x445D
-0x7D2E = 0x6527
-0x7D2F = 0x4E5F
-0x7D30 = 0x3A59
-0x7D32 = 0x6528
-0x7D33 = 0x3F42
-0x7D35 = 0x652A
-0x7D39 = 0x3E52
-0x7D3A = 0x3A30
-0x7D3F = 0x6529
-0x7D42 = 0x3D2A
-0x7D43 = 0x383E
-0x7D44 = 0x4148
-0x7D45 = 0x6525
-0x7D46 = 0x652B
-0x7D4B = 0x6526
-0x7D4C = 0x3750
-0x7D4E = 0x652E
-0x7D4F = 0x6532
-0x7D50 = 0x376B
-0x7D56 = 0x652D
-0x7D5B = 0x6536
-0x7D5E = 0x394A
-0x7D61 = 0x4D6D
-0x7D62 = 0x303C
-0x7D63 = 0x6533
-0x7D66 = 0x356B
-0x7D68 = 0x6530
-0x7D6E = 0x6531
-0x7D71 = 0x457D
-0x7D72 = 0x652F
-0x7D73 = 0x652C
-0x7D75 = 0x3328
-0x7D76 = 0x4064
-0x7D79 = 0x3828
-0x7D7D = 0x6538
-0x7D89 = 0x6535
-0x7D8F = 0x6537
-0x7D93 = 0x6534
-0x7D99 = 0x3751
-0x7D9A = 0x4233
-0x7D9B = 0x6539
-0x7D9C = 0x416E
-0x7D9F = 0x6546
-0x7DA2 = 0x6542
-0x7DA3 = 0x653C
-0x7DAB = 0x6540
-0x7DAC = 0x3C7A
-0x7DAD = 0x305D
-0x7DAE = 0x653B
-0x7DAF = 0x6543
-0x7DB0 = 0x6547
-0x7DB1 = 0x394B
-0x7DB2 = 0x4C56
-0x7DB4 = 0x4456
-0x7DB5 = 0x653D
-0x7DB8 = 0x6545
-0x7DBA = 0x653A
-0x7DBB = 0x433E
-0x7DBD = 0x653F
-0x7DBE = 0x303D
-0x7DBF = 0x4C4A
-0x7DC7 = 0x653E
-0x7DCA = 0x365B
-0x7DCB = 0x486C
-0x7DCF = 0x416D
-0x7DD1 = 0x4E50
-0x7DD2 = 0x3D6F
-0x7DD5 = 0x656E
-0x7DD8 = 0x6548
-0x7DDA = 0x407E
-0x7DDC = 0x6544
-0x7DDD = 0x6549
-0x7DDE = 0x654B
-0x7DE0 = 0x4479
-0x7DE1 = 0x654E
-0x7DE4 = 0x654A
-0x7DE8 = 0x4A54
-0x7DE9 = 0x344B
-0x7DEC = 0x4C4B
-0x7DEF = 0x305E
-0x7DF2 = 0x654D
-0x7DF4 = 0x4E7D
-0x7DFB = 0x654C
-0x7E01 = 0x316F
-0x7E04 = 0x466C
-0x7E05 = 0x654F
-0x7E09 = 0x6556
-0x7E0A = 0x6550
-0x7E0B = 0x6557
-0x7E12 = 0x6553
-0x7E1B = 0x477B
-0x7E1E = 0x3C4A
-0x7E1F = 0x6555
-0x7E21 = 0x6552
-0x7E22 = 0x6558
-0x7E23 = 0x6551
-0x7E26 = 0x3D44
-0x7E2B = 0x4B25
-0x7E2E = 0x3D4C
-0x7E31 = 0x6554
-0x7E32 = 0x6560
-0x7E35 = 0x655C
-0x7E37 = 0x655F
-0x7E39 = 0x655D
-0x7E3A = 0x6561
-0x7E3B = 0x655B
-0x7E3D = 0x6541
-0x7E3E = 0x4053
-0x7E41 = 0x484B
-0x7E43 = 0x655E
-0x7E46 = 0x6559
-0x7E4A = 0x4121
-0x7E4B = 0x3752
-0x7E4D = 0x3D2B
-0x7E54 = 0x3F25
-0x7E55 = 0x4136
-0x7E56 = 0x6564
-0x7E59 = 0x6566
-0x7E5A = 0x6567
-0x7E5D = 0x6563
-0x7E5E = 0x6565
-0x7E66 = 0x655A
-0x7E67 = 0x6562
-0x7E69 = 0x656A
-0x7E6A = 0x6569
-0x7E6D = 0x4B7A
-0x7E70 = 0x372B
-0x7E79 = 0x6568
-0x7E7B = 0x656C
-0x7E7C = 0x656B
-0x7E7D = 0x656F
-0x7E7F = 0x6571
-0x7E82 = 0x3B3C
-0x7E83 = 0x656D
-0x7E88 = 0x6572
-0x7E89 = 0x6573
-0x7E8C = 0x6574
-0x7E8E = 0x657A
-0x7E8F = 0x453B
-0x7E90 = 0x6576
-0x7E92 = 0x6575
-0x7E93 = 0x6577
-0x7E94 = 0x6578
-0x7E96 = 0x6579
-0x7E9B = 0x657B
-0x7E9C = 0x657C
-0x7F36 = 0x344C
-0x7F38 = 0x657D
-0x7F3A = 0x657E
-0x7F45 = 0x6621
-0x7F4C = 0x6622
-0x7F4D = 0x6623
-0x7F4E = 0x6624
-0x7F50 = 0x6625
-0x7F51 = 0x6626
-0x7F54 = 0x6628
-0x7F55 = 0x6627
-0x7F58 = 0x6629
-0x7F5F = 0x662A
-0x7F60 = 0x662B
-0x7F67 = 0x662E
-0x7F68 = 0x662C
-0x7F69 = 0x662D
-0x7F6A = 0x3A61
-0x7F6B = 0x3753
-0x7F6E = 0x4356
-0x7F70 = 0x4833
-0x7F72 = 0x3D70
-0x7F75 = 0x474D
-0x7F77 = 0x486D
-0x7F78 = 0x662F
-0x7F79 = 0x586D
-0x7F82 = 0x6630
-0x7F83 = 0x6632
-0x7F85 = 0x4D65
-0x7F86 = 0x6631
-0x7F87 = 0x6634
-0x7F88 = 0x6633
-0x7F8A = 0x4D53
-0x7F8C = 0x6635
-0x7F8E = 0x487E
-0x7F94 = 0x6636
-0x7F9A = 0x6639
-0x7F9D = 0x6638
-0x7F9E = 0x6637
-0x7FA3 = 0x663A
-0x7FA4 = 0x3732
-0x7FA8 = 0x4122
-0x7FA9 = 0x3541
-0x7FAE = 0x663E
-0x7FAF = 0x663B
-0x7FB2 = 0x663C
-0x7FB6 = 0x663F
-0x7FB8 = 0x6640
-0x7FB9 = 0x663D
-0x7FBD = 0x3129
-0x7FC1 = 0x3227
-0x7FC5 = 0x6642
-0x7FC6 = 0x6643
-0x7FCA = 0x6644
-0x7FCC = 0x4D62
-0x7FD2 = 0x3D2C
-0x7FD4 = 0x6646
-0x7FD5 = 0x6645
-0x7FE0 = 0x3F69
-0x7FE1 = 0x6647
-0x7FE6 = 0x6648
-0x7FE9 = 0x6649
-0x7FEB = 0x3465
-0x7FF0 = 0x344D
-0x7FF3 = 0x664A
-0x7FF9 = 0x664B
-0x7FFB = 0x4B5D
-0x7FFC = 0x4D63
-0x8000 = 0x4D54
-0x8001 = 0x4F37
-0x8003 = 0x394D
-0x8004 = 0x664E
-0x8005 = 0x3C54
-0x8006 = 0x664D
-0x800B = 0x664F
-0x800C = 0x3C29
-0x8010 = 0x4251
-0x8012 = 0x6650
-0x8015 = 0x394C
-0x8017 = 0x4C57
-0x8018 = 0x6651
-0x8019 = 0x6652
-0x801C = 0x6653
-0x8021 = 0x6654
-0x8028 = 0x6655
-0x8033 = 0x3C2A
-0x8036 = 0x4C6D
-0x803B = 0x6657
-0x803D = 0x433F
-0x803F = 0x6656
-0x8046 = 0x6659
-0x804A = 0x6658
-0x8052 = 0x665A
-0x8056 = 0x403B
-0x8058 = 0x665B
-0x805A = 0x665C
-0x805E = 0x4A39
-0x805F = 0x665D
-0x8061 = 0x416F
-0x8062 = 0x665E
-0x8068 = 0x665F
-0x806F = 0x4E7E
-0x8070 = 0x6662
-0x8072 = 0x6661
-0x8073 = 0x6660
-0x8074 = 0x4430
-0x8076 = 0x6663
-0x8077 = 0x3F26
-0x8079 = 0x6664
-0x807D = 0x6665
-0x807E = 0x4F38
-0x807F = 0x6666
-0x8084 = 0x6667
-0x8085 = 0x6669
-0x8086 = 0x6668
-0x8087 = 0x4825
-0x8089 = 0x4679
-0x808B = 0x4F3E
-0x808C = 0x4829
-0x8093 = 0x666B
-0x8096 = 0x3E53
-0x8098 = 0x492A
-0x809A = 0x666C
-0x809B = 0x666A
-0x809D = 0x344E
-0x80A1 = 0x3854
-0x80A2 = 0x3B68
-0x80A5 = 0x486E
-0x80A9 = 0x382A
-0x80AA = 0x4B43
-0x80AC = 0x666F
-0x80AD = 0x666D
-0x80AF = 0x394E
-0x80B1 = 0x394F
-0x80B2 = 0x3069
-0x80B4 = 0x3A68
-0x80BA = 0x4759
-0x80C3 = 0x305F
-0x80C4 = 0x6674
-0x80C6 = 0x4340
-0x80CC = 0x4758
-0x80CE = 0x425B
-0x80D6 = 0x6676
-0x80D9 = 0x6672
-0x80DA = 0x6675
-0x80DB = 0x6670
-0x80DD = 0x6673
-0x80DE = 0x4B26
-0x80E1 = 0x3855
-0x80E4 = 0x307D
-0x80E5 = 0x6671
-0x80EF = 0x6678
-0x80F1 = 0x6679
-0x80F4 = 0x4639
-0x80F8 = 0x363B
-0x80FC = 0x6726
-0x80FD = 0x473D
-0x8102 = 0x3B69
-0x8105 = 0x363C
-0x8106 = 0x4048
-0x8107 = 0x4F46
-0x8108 = 0x4C2E
-0x8109 = 0x6677
-0x810A = 0x4054
-0x811A = 0x3553
-0x811B = 0x667A
-0x8123 = 0x667C
-0x8129 = 0x667B
-0x812F = 0x667D
-0x8131 = 0x4326
-0x8133 = 0x473E
-0x8139 = 0x4431
-0x813E = 0x6723
-0x8146 = 0x6722
-0x814B = 0x667E
-0x814E = 0x3F55
-0x8150 = 0x4965
-0x8151 = 0x6725
-0x8153 = 0x6724
-0x8154 = 0x3950
-0x8155 = 0x4F53
-0x815F = 0x6735
-0x8165 = 0x6729
-0x8166 = 0x672A
-0x816B = 0x3C70
-0x816E = 0x6728
-0x8170 = 0x3978
-0x8171 = 0x6727
-0x8174 = 0x672B
-0x8178 = 0x4432
-0x8179 = 0x4A22
-0x817A = 0x4123
-0x817F = 0x425C
-0x8180 = 0x672F
-0x8182 = 0x6730
-0x8183 = 0x672C
-0x8188 = 0x672D
-0x818A = 0x672E
-0x818F = 0x3951
-0x8193 = 0x6736
-0x8195 = 0x6732
-0x819A = 0x4966
-0x819C = 0x4B6C
-0x819D = 0x4928
-0x81A0 = 0x6731
-0x81A3 = 0x6734
-0x81A4 = 0x6733
-0x81A8 = 0x4B44
-0x81A9 = 0x6737
-0x81B0 = 0x6738
-0x81B3 = 0x4137
-0x81B5 = 0x6739
-0x81B8 = 0x673B
-0x81BA = 0x673F
-0x81BD = 0x673C
-0x81BE = 0x673A
-0x81BF = 0x473F
-0x81C0 = 0x673D
-0x81C2 = 0x673E
-0x81C6 = 0x3232
-0x81C8 = 0x6745
-0x81C9 = 0x6740
-0x81CD = 0x6741
-0x81D1 = 0x6742
-0x81D3 = 0x4221
-0x81D8 = 0x6744
-0x81D9 = 0x6743
-0x81DA = 0x6746
-0x81DF = 0x6747
-0x81E0 = 0x6748
-0x81E3 = 0x3F43
-0x81E5 = 0x3269
-0x81E7 = 0x6749
-0x81E8 = 0x4E57
-0x81EA = 0x3C2B
-0x81ED = 0x3D2D
-0x81F3 = 0x3B6A
-0x81F4 = 0x4357
-0x81FA = 0x674A
-0x81FB = 0x674B
-0x81FC = 0x3131
-0x81FE = 0x674C
-0x8201 = 0x674D
-0x8202 = 0x674E
-0x8205 = 0x674F
-0x8207 = 0x6750
-0x8208 = 0x363D
-0x8209 = 0x5A2A
-0x820A = 0x6751
-0x820C = 0x4065
-0x820D = 0x6752
-0x820E = 0x3C4B
-0x8210 = 0x6753
-0x8212 = 0x5030
-0x8216 = 0x6754
-0x8217 = 0x4A5E
-0x8218 = 0x345C
-0x821B = 0x4124
-0x821C = 0x3D58
-0x821E = 0x4971
-0x821F = 0x3D2E
-0x8229 = 0x6755
-0x822A = 0x3952
-0x822B = 0x6756
-0x822C = 0x484C
-0x822E = 0x6764
-0x8233 = 0x6758
-0x8235 = 0x4249
-0x8236 = 0x4775
-0x8237 = 0x383F
-0x8238 = 0x6757
-0x8239 = 0x4125
-0x8240 = 0x6759
-0x8247 = 0x447A
-0x8258 = 0x675B
-0x8259 = 0x675A
-0x825A = 0x675D
-0x825D = 0x675C
-0x825F = 0x675E
-0x8262 = 0x6760
-0x8264 = 0x675F
-0x8266 = 0x344F
-0x8268 = 0x6761
-0x826A = 0x6762
-0x826B = 0x6763
-0x826E = 0x3A31
-0x826F = 0x4E49
-0x8271 = 0x6765
-0x8272 = 0x3F27
-0x8276 = 0x3170
-0x8277 = 0x6766
-0x8278 = 0x6767
-0x827E = 0x6768
-0x828B = 0x3072
-0x828D = 0x6769
-0x8292 = 0x676A
-0x8299 = 0x4967
-0x829D = 0x3C47
-0x829F = 0x676C
-0x82A5 = 0x3329
-0x82A6 = 0x3032
-0x82AB = 0x676B
-0x82AC = 0x676E
-0x82AD = 0x474E
-0x82AF = 0x3F44
-0x82B1 = 0x3256
-0x82B3 = 0x4B27
-0x82B8 = 0x375D
-0x82B9 = 0x365C
-0x82BB = 0x676D
-0x82BD = 0x326A
-0x82C5 = 0x3423
-0x82D1 = 0x3171
-0x82D2 = 0x6772
-0x82D3 = 0x4E6A
-0x82D4 = 0x425D
-0x82D7 = 0x4944
-0x82D9 = 0x677E
-0x82DB = 0x3257
-0x82DC = 0x677C
-0x82DE = 0x677A
-0x82DF = 0x6771
-0x82E1 = 0x676F
-0x82E3 = 0x6770
-0x82E5 = 0x3C63
-0x82E6 = 0x366C
-0x82E7 = 0x4377
-0x82EB = 0x4651
-0x82F1 = 0x3151
-0x82F3 = 0x6774
-0x82F4 = 0x6773
-0x82F9 = 0x6779
-0x82FA = 0x6775
-0x82FB = 0x6778
-0x8302 = 0x4C50
-0x8303 = 0x6777
-0x8304 = 0x3258
-0x8305 = 0x337D
-0x8306 = 0x677B
-0x8309 = 0x677D
-0x830E = 0x3754
-0x8316 = 0x6823
-0x8317 = 0x682C
-0x8318 = 0x682D
-0x831C = 0x302B
-0x8323 = 0x6834
-0x8328 = 0x3071
-0x832B = 0x682B
-0x832F = 0x682A
-0x8331 = 0x6825
-0x8332 = 0x6824
-0x8334 = 0x6822
-0x8335 = 0x6821
-0x8336 = 0x4363
-0x8338 = 0x427B
-0x8339 = 0x6827
-0x8340 = 0x6826
-0x8345 = 0x6829
-0x8349 = 0x4170
-0x834A = 0x3755
-0x834F = 0x3141
-0x8350 = 0x6828
-0x8352 = 0x3953
-0x8358 = 0x4171
-0x8373 = 0x683A
-0x8375 = 0x683B
-0x8377 = 0x3259
-0x837B = 0x322E
-0x837C = 0x6838
-0x8385 = 0x682E
-0x8387 = 0x6836
-0x8389 = 0x683D
-0x838A = 0x6837
-0x838E = 0x6835
-0x8393 = 0x6776
-0x8396 = 0x6833
-0x839A = 0x682F
-0x839E = 0x3450
-0x839F = 0x6831
-0x83A0 = 0x683C
-0x83A2 = 0x6832
-0x83A8 = 0x683E
-0x83AA = 0x6830
-0x83AB = 0x477C
-0x83B1 = 0x4D69
-0x83B5 = 0x6839
-0x83BD = 0x684F
-0x83C1 = 0x6847
-0x83C5 = 0x3F7B
-0x83CA = 0x3546
-0x83CC = 0x365D
-0x83CE = 0x6842
-0x83D3 = 0x325B
-0x83D6 = 0x3E54
-0x83D8 = 0x6845
-0x83DC = 0x3A5A
-0x83DF = 0x4551
-0x83E0 = 0x684A
-0x83E9 = 0x4A6E
-0x83EB = 0x6841
-0x83EF = 0x325A
-0x83F0 = 0x3856
-0x83F1 = 0x4929
-0x83F2 = 0x684B
-0x83F4 = 0x683F
-0x83F7 = 0x6848
-0x83FB = 0x6852
-0x83FD = 0x6843
-0x8403 = 0x6844
-0x8404 = 0x463A
-0x8407 = 0x6849
-0x840B = 0x6846
-0x840C = 0x4B28
-0x840D = 0x684C
-0x840E = 0x3060
-0x8413 = 0x6840
-0x8420 = 0x684E
-0x8422 = 0x684D
-0x8429 = 0x476B
-0x842A = 0x6854
-0x842C = 0x685F
-0x8431 = 0x337E
-0x8435 = 0x6862
-0x8438 = 0x6850
-0x843C = 0x6855
-0x843D = 0x4D6E
-0x8446 = 0x685E
-0x8449 = 0x4D55
-0x844E = 0x4E2A
-0x8457 = 0x4378
-0x845B = 0x336B
-0x8461 = 0x4972
-0x8462 = 0x6864
-0x8463 = 0x4621
-0x8466 = 0x3031
-0x8469 = 0x685D
-0x846B = 0x6859
-0x846C = 0x4172
-0x846D = 0x6853
-0x846E = 0x685B
-0x846F = 0x6860
-0x8471 = 0x472C
-0x8475 = 0x302A
-0x8477 = 0x6858
-0x8479 = 0x6861
-0x847A = 0x4978
-0x8482 = 0x685C
-0x8484 = 0x6857
-0x848B = 0x3E55
-0x8490 = 0x3D2F
-0x8494 = 0x3C2C
-0x8499 = 0x4C58
-0x849C = 0x4947
-0x849F = 0x6867
-0x84A1 = 0x6870
-0x84AD = 0x685A
-0x84B2 = 0x3377
-0x84B8 = 0x3E78
-0x84B9 = 0x6865
-0x84BB = 0x686A
-0x84BC = 0x4173
-0x84BF = 0x6866
-0x84C1 = 0x686D
-0x84C4 = 0x435F
-0x84C6 = 0x686E
-0x84C9 = 0x4D56
-0x84CA = 0x6863
-0x84CB = 0x3338
-0x84CD = 0x6869
-0x84D0 = 0x686C
-0x84D1 = 0x4C2C
-0x84D6 = 0x686F
-0x84D9 = 0x6868
-0x84DA = 0x686B
-0x84EC = 0x4B29
-0x84EE = 0x4F21
-0x84F4 = 0x6873
-0x84FC = 0x687A
-0x84FF = 0x6872
-0x8500 = 0x3C43
-0x8506 = 0x6851
-0x8511 = 0x4A4E
-0x8513 = 0x4C22
-0x8514 = 0x6879
-0x8515 = 0x6878
-0x8517 = 0x6874
-0x8518 = 0x6875
-0x851A = 0x3136
-0x851F = 0x6877
-0x8521 = 0x6871
-0x8526 = 0x4455
-0x852C = 0x6876
-0x852D = 0x307E
-0x8535 = 0x4222
-0x853D = 0x4A43
-0x8540 = 0x687B
-0x8541 = 0x6921
-0x8543 = 0x4859
-0x8548 = 0x687E
-0x8549 = 0x3E56
-0x854A = 0x3C49
-0x854B = 0x6923
-0x854E = 0x363E
-0x8555 = 0x6924
-0x8557 = 0x4979
-0x8558 = 0x687D
-0x855A = 0x6856
-0x8563 = 0x687C
-0x8568 = 0x4F4F
-0x8569 = 0x4622
-0x856A = 0x4973
-0x856D = 0x692B
-0x8577 = 0x6931
-0x857E = 0x6932
-0x8580 = 0x6925
-0x8584 = 0x4776
-0x8587 = 0x692F
-0x8588 = 0x6927
-0x858A = 0x6929
-0x8590 = 0x6933
-0x8591 = 0x6928
-0x8594 = 0x692C
-0x8597 = 0x3172
-0x8599 = 0x4665
-0x859B = 0x692D
-0x859C = 0x6930
-0x85A4 = 0x6926
-0x85A6 = 0x4126
-0x85A8 = 0x692A
-0x85A9 = 0x3B27
-0x85AA = 0x3F45
-0x85AB = 0x3730
-0x85AC = 0x4C74
-0x85AE = 0x4C79
-0x85AF = 0x3D72
-0x85B9 = 0x6937
-0x85BA = 0x6935
-0x85C1 = 0x4F4E
-0x85C9 = 0x6934
-0x85CD = 0x4D75
-0x85CF = 0x6936
-0x85D0 = 0x6938
-0x85D5 = 0x6939
-0x85DC = 0x693C
-0x85DD = 0x693A
-0x85E4 = 0x4623
-0x85E5 = 0x693B
-0x85E9 = 0x484D
-0x85EA = 0x692E
-0x85F7 = 0x3D73
-0x85F9 = 0x693D
-0x85FA = 0x6942
-0x85FB = 0x4174
-0x85FE = 0x6941
-0x8602 = 0x6922
-0x8606 = 0x6943
-0x8607 = 0x4149
-0x860A = 0x693E
-0x860B = 0x6940
-0x8613 = 0x693F
-0x8616 = 0x5D31
-0x8617 = 0x5D22
-0x861A = 0x6945
-0x8622 = 0x6944
-0x862D = 0x4D76
-0x862F = 0x623C
-0x8630 = 0x6946
-0x863F = 0x6947
-0x864D = 0x6948
-0x864E = 0x3857
-0x8650 = 0x3554
-0x8654 = 0x694A
-0x8655 = 0x515D
-0x865A = 0x3575
-0x865C = 0x4E3A
-0x865E = 0x3673
-0x865F = 0x694B
-0x8667 = 0x694C
-0x866B = 0x436E
-0x8671 = 0x694D
-0x8679 = 0x467A
-0x867B = 0x303A
-0x868A = 0x3263
-0x868B = 0x6952
-0x868C = 0x6953
-0x8693 = 0x694E
-0x8695 = 0x3B3D
-0x86A3 = 0x694F
-0x86A4 = 0x4742
-0x86A9 = 0x6950
-0x86AA = 0x6951
-0x86AB = 0x695B
-0x86AF = 0x6955
-0x86B0 = 0x6958
-0x86B6 = 0x6954
-0x86C4 = 0x6956
-0x86C6 = 0x6957
-0x86C7 = 0x3C58
-0x86C9 = 0x6959
-0x86CB = 0x4341
-0x86CD = 0x3756
-0x86CE = 0x3342
-0x86D4 = 0x695C
-0x86D9 = 0x333F
-0x86DB = 0x6961
-0x86DE = 0x695D
-0x86DF = 0x6960
-0x86E4 = 0x483A
-0x86E9 = 0x695E
-0x86EC = 0x695F
-0x86ED = 0x4948
-0x86EE = 0x485A
-0x86EF = 0x6962
-0x86F8 = 0x427D
-0x86F9 = 0x696C
-0x86FB = 0x6968
-0x86FE = 0x326B
-0x8700 = 0x6966
-0x8702 = 0x4B2A
-0x8703 = 0x6967
-0x8706 = 0x6964
-0x8708 = 0x6965
-0x8709 = 0x696A
-0x870A = 0x696D
-0x870D = 0x696B
-0x8711 = 0x6969
-0x8712 = 0x6963
-0x8718 = 0x4358
-0x871A = 0x6974
-0x871C = 0x4C2A
-0x8725 = 0x6972
-0x8729 = 0x6973
-0x8734 = 0x696E
-0x8737 = 0x6970
-0x873B = 0x6971
-0x873F = 0x696F
-0x8749 = 0x4066
-0x874B = 0x4F39
-0x874C = 0x6978
-0x874E = 0x6979
-0x8753 = 0x6A21
-0x8755 = 0x3F2A
-0x8757 = 0x697B
-0x8759 = 0x697E
-0x875F = 0x6976
-0x8760 = 0x6975
-0x8763 = 0x6A22
-0x8766 = 0x325C
-0x8768 = 0x697C
-0x876A = 0x6A23
-0x876E = 0x697D
-0x8774 = 0x697A
-0x8776 = 0x4433
-0x8778 = 0x6977
-0x877F = 0x4768
-0x8782 = 0x6A27
-0x878D = 0x4D3B
-0x879F = 0x6A26
-0x87A2 = 0x6A25
-0x87AB = 0x6A2E
-0x87AF = 0x6A28
-0x87B3 = 0x6A30
-0x87BA = 0x4D66
-0x87BB = 0x6A33
-0x87BD = 0x6A2A
-0x87C0 = 0x6A2B
-0x87C4 = 0x6A2F
-0x87C6 = 0x6A32
-0x87C7 = 0x6A31
-0x87CB = 0x6A29
-0x87D0 = 0x6A2C
-0x87D2 = 0x6A3D
-0x87E0 = 0x6A36
-0x87EF = 0x6A34
-0x87F2 = 0x6A35
-0x87F6 = 0x6A3A
-0x87F7 = 0x6A3B
-0x87F9 = 0x332A
-0x87FB = 0x3542
-0x87FE = 0x6A39
-0x8805 = 0x6A24
-0x880D = 0x6A38
-0x880E = 0x6A3C
-0x880F = 0x6A37
-0x8811 = 0x6A3E
-0x8815 = 0x6A40
-0x8816 = 0x6A3F
-0x8821 = 0x6A42
-0x8822 = 0x6A41
-0x8823 = 0x695A
-0x8827 = 0x6A46
-0x8831 = 0x6A43
-0x8836 = 0x6A44
-0x8839 = 0x6A45
-0x883B = 0x6A47
-0x8840 = 0x376C
-0x8842 = 0x6A49
-0x8844 = 0x6A48
-0x8846 = 0x3D30
-0x884C = 0x3954
-0x884D = 0x5E27
-0x8852 = 0x6A4A
-0x8853 = 0x3D51
-0x8857 = 0x3339
-0x8859 = 0x6A4B
-0x885B = 0x3152
-0x885D = 0x3E57
-0x885E = 0x6A4C
-0x8861 = 0x3955
-0x8862 = 0x6A4D
-0x8863 = 0x3061
-0x8868 = 0x493D
-0x886B = 0x6A4E
-0x8870 = 0x3F6A
-0x8872 = 0x6A55
-0x8875 = 0x6A52
-0x8877 = 0x436F
-0x887D = 0x6A53
-0x887E = 0x6A50
-0x887F = 0x365E
-0x8881 = 0x6A4F
-0x8882 = 0x6A56
-0x8888 = 0x3736
-0x888B = 0x425E
-0x888D = 0x6A5C
-0x8892 = 0x6A58
-0x8896 = 0x4235
-0x8897 = 0x6A57
-0x8899 = 0x6A5A
-0x889E = 0x6A51
-0x88A2 = 0x6A5B
-0x88A4 = 0x6A5D
-0x88AB = 0x486F
-0x88AE = 0x6A59
-0x88B0 = 0x6A5E
-0x88B1 = 0x6A60
-0x88B4 = 0x3853
-0x88B5 = 0x6A54
-0x88B7 = 0x3041
-0x88BF = 0x6A5F
-0x88C1 = 0x3A5B
-0x88C2 = 0x4E76
-0x88C3 = 0x6A61
-0x88C4 = 0x6A62
-0x88C5 = 0x4175
-0x88CF = 0x4E22
-0x88D4 = 0x6A63
-0x88D5 = 0x4D35
-0x88D8 = 0x6A64
-0x88D9 = 0x6A65
-0x88DC = 0x4A64
-0x88DD = 0x6A66
-0x88DF = 0x3A40
-0x88E1 = 0x4E23
-0x88E8 = 0x6A6B
-0x88F2 = 0x6A6C
-0x88F3 = 0x3E58
-0x88F4 = 0x6A6A
-0x88F8 = 0x4D67
-0x88F9 = 0x6A67
-0x88FC = 0x6A69
-0x88FD = 0x403D
-0x88FE = 0x3F7E
-0x8902 = 0x6A68
-0x8904 = 0x6A6D
-0x8907 = 0x4A23
-0x890A = 0x6A6F
-0x890C = 0x6A6E
-0x8910 = 0x336C
-0x8912 = 0x4B2B
-0x8913 = 0x6A70
-0x891D = 0x6A7C
-0x891E = 0x6A72
-0x8925 = 0x6A73
-0x892A = 0x6A74
-0x892B = 0x6A75
-0x8936 = 0x6A79
-0x8938 = 0x6A7A
-0x893B = 0x6A78
-0x8941 = 0x6A76
-0x8943 = 0x6A71
-0x8944 = 0x6A77
-0x894C = 0x6A7B
-0x894D = 0x7037
-0x8956 = 0x3228
-0x895E = 0x6A7E
-0x895F = 0x365F
-0x8960 = 0x6A7D
-0x8964 = 0x6B22
-0x8966 = 0x6B21
-0x896A = 0x6B24
-0x896D = 0x6B23
-0x896F = 0x6B25
-0x8972 = 0x3D31
-0x8974 = 0x6B26
-0x8977 = 0x6B27
-0x897E = 0x6B28
-0x897F = 0x403E
-0x8981 = 0x4D57
-0x8983 = 0x6B29
-0x8986 = 0x4A24
-0x8987 = 0x4746
-0x8988 = 0x6B2A
-0x898A = 0x6B2B
-0x898B = 0x382B
-0x898F = 0x352C
-0x8993 = 0x6B2C
-0x8996 = 0x3B6B
-0x8997 = 0x4741
-0x8998 = 0x6B2D
-0x899A = 0x3350
-0x89A1 = 0x6B2E
-0x89A6 = 0x6B30
-0x89A7 = 0x4D77
-0x89A9 = 0x6B2F
-0x89AA = 0x3F46
-0x89AC = 0x6B31
-0x89AF = 0x6B32
-0x89B2 = 0x6B33
-0x89B3 = 0x3451
-0x89BA = 0x6B34
-0x89BD = 0x6B35
-0x89BF = 0x6B36
-0x89C0 = 0x6B37
-0x89D2 = 0x3351
-0x89DA = 0x6B38
-0x89DC = 0x6B39
-0x89DD = 0x6B3A
-0x89E3 = 0x3272
-0x89E6 = 0x3F28
-0x89E7 = 0x6B3B
-0x89F4 = 0x6B3C
-0x89F8 = 0x6B3D
-0x8A00 = 0x3840
-0x8A02 = 0x447B
-0x8A03 = 0x6B3E
-0x8A08 = 0x3757
-0x8A0A = 0x3F56
-0x8A0C = 0x6B41
-0x8A0E = 0x4624
-0x8A10 = 0x6B40
-0x8A13 = 0x3731
-0x8A16 = 0x6B3F
-0x8A17 = 0x4277
-0x8A18 = 0x352D
-0x8A1B = 0x6B42
-0x8A1D = 0x6B43
-0x8A1F = 0x3E59
-0x8A23 = 0x376D
-0x8A25 = 0x6B44
-0x8A2A = 0x4B2C
-0x8A2D = 0x405F
-0x8A31 = 0x3576
-0x8A33 = 0x4C75
-0x8A34 = 0x414A
-0x8A36 = 0x6B45
-0x8A3A = 0x3F47
-0x8A3B = 0x4370
-0x8A3C = 0x3E5A
-0x8A41 = 0x6B46
-0x8A46 = 0x6B49
-0x8A48 = 0x6B4A
-0x8A50 = 0x3A3E
-0x8A51 = 0x4242
-0x8A52 = 0x6B48
-0x8A54 = 0x3E5B
-0x8A55 = 0x493E
-0x8A5B = 0x6B47
-0x8A5E = 0x3B6C
-0x8A60 = 0x3153
-0x8A62 = 0x6B4E
-0x8A63 = 0x3758
-0x8A66 = 0x3B6E
-0x8A69 = 0x3B6D
-0x8A6B = 0x4F4D
-0x8A6C = 0x6B4D
-0x8A6D = 0x6B4C
-0x8A6E = 0x4127
-0x8A70 = 0x354D
-0x8A71 = 0x4F43
-0x8A72 = 0x333A
-0x8A73 = 0x3E5C
-0x8A7C = 0x6B4B
-0x8A82 = 0x6B50
-0x8A84 = 0x6B51
-0x8A85 = 0x6B4F
-0x8A87 = 0x3858
-0x8A89 = 0x4D40
-0x8A8C = 0x3B6F
-0x8A8D = 0x4727
-0x8A91 = 0x6B54
-0x8A93 = 0x4040
-0x8A95 = 0x4342
-0x8A98 = 0x4D36
-0x8A9A = 0x6B57
-0x8A9E = 0x386C
-0x8AA0 = 0x403F
-0x8AA1 = 0x6B53
-0x8AA3 = 0x6B58
-0x8AA4 = 0x386D
-0x8AA5 = 0x6B55
-0x8AA6 = 0x6B56
-0x8AA8 = 0x6B52
-0x8AAC = 0x4062
-0x8AAD = 0x4649
-0x8AB0 = 0x432F
-0x8AB2 = 0x325D
-0x8AB9 = 0x4870
-0x8ABC = 0x3543
-0x8ABF = 0x4434
-0x8AC2 = 0x6B5B
-0x8AC4 = 0x6B59
-0x8AC7 = 0x434C
-0x8ACB = 0x4041
-0x8ACC = 0x3452
-0x8ACD = 0x6B5A
-0x8ACF = 0x3F5B
-0x8AD2 = 0x4E4A
-0x8AD6 = 0x4F40
-0x8ADA = 0x6B5C
-0x8ADB = 0x6B67
-0x8ADC = 0x4435
-0x8ADE = 0x6B66
-0x8AE0 = 0x6B63
-0x8AE1 = 0x6B6B
-0x8AE2 = 0x6B64
-0x8AE4 = 0x6B60
-0x8AE6 = 0x447C
-0x8AE7 = 0x6B5F
-0x8AEB = 0x6B5D
-0x8AED = 0x4D21
-0x8AEE = 0x3B70
-0x8AF1 = 0x6B61
-0x8AF3 = 0x6B5E
-0x8AF7 = 0x6B65
-0x8AF8 = 0x3D74
-0x8AFA = 0x3841
-0x8AFE = 0x427A
-0x8B00 = 0x4B45
-0x8B01 = 0x315A
-0x8B02 = 0x3062
-0x8B04 = 0x4625
-0x8B07 = 0x6B69
-0x8B0C = 0x6B68
-0x8B0E = 0x4666
-0x8B10 = 0x6B6D
-0x8B14 = 0x6B62
-0x8B16 = 0x6B6C
-0x8B17 = 0x6B6E
-0x8B19 = 0x382C
-0x8B1A = 0x6B6A
-0x8B1B = 0x3956
-0x8B1D = 0x3C55
-0x8B20 = 0x6B6F
-0x8B21 = 0x4D58
-0x8B26 = 0x6B72
-0x8B28 = 0x6B75
-0x8B2B = 0x6B73
-0x8B2C = 0x4935
-0x8B33 = 0x6B70
-0x8B39 = 0x3660
-0x8B3E = 0x6B74
-0x8B41 = 0x6B76
-0x8B49 = 0x6B7A
-0x8B4C = 0x6B77
-0x8B4E = 0x6B79
-0x8B4F = 0x6B78
-0x8B56 = 0x6B7B
-0x8B58 = 0x3C31
-0x8B5A = 0x6B7D
-0x8B5B = 0x6B7C
-0x8B5C = 0x4968
-0x8B5F = 0x6C21
-0x8B66 = 0x3759
-0x8B6B = 0x6B7E
-0x8B6C = 0x6C22
-0x8B6F = 0x6C23
-0x8B70 = 0x3544
-0x8B71 = 0x6641
-0x8B72 = 0x3E79
-0x8B74 = 0x6C24
-0x8B77 = 0x386E
-0x8B7D = 0x6C25
-0x8B80 = 0x6C26
-0x8B83 = 0x3B3E
-0x8B8A = 0x5A4E
-0x8B8C = 0x6C27
-0x8B8E = 0x6C28
-0x8B90 = 0x3D32
-0x8B92 = 0x6C29
-0x8B93 = 0x6C2A
-0x8B96 = 0x6C2B
-0x8B99 = 0x6C2C
-0x8B9A = 0x6C2D
-0x8C37 = 0x432B
-0x8C3A = 0x6C2E
-0x8C3F = 0x6C30
-0x8C41 = 0x6C2F
-0x8C46 = 0x4626
-0x8C48 = 0x6C31
-0x8C4A = 0x4B2D
-0x8C4C = 0x6C32
-0x8C4E = 0x6C33
-0x8C50 = 0x6C34
-0x8C55 = 0x6C35
-0x8C5A = 0x465A
-0x8C61 = 0x3E5D
-0x8C62 = 0x6C36
-0x8C6A = 0x396B
-0x8C6B = 0x502E
-0x8C6C = 0x6C37
-0x8C78 = 0x6C38
-0x8C79 = 0x493F
-0x8C7A = 0x6C39
-0x8C7C = 0x6C41
-0x8C82 = 0x6C3A
-0x8C85 = 0x6C3C
-0x8C89 = 0x6C3B
-0x8C8A = 0x6C3D
-0x8C8C = 0x4B46
-0x8C8D = 0x6C3E
-0x8C8E = 0x6C3F
-0x8C94 = 0x6C40
-0x8C98 = 0x6C42
-0x8C9D = 0x332D
-0x8C9E = 0x4467
-0x8CA0 = 0x4969
-0x8CA1 = 0x3A62
-0x8CA2 = 0x3957
-0x8CA7 = 0x494F
-0x8CA8 = 0x325F
-0x8CA9 = 0x484E
-0x8CAA = 0x6C45
-0x8CAB = 0x3453
-0x8CAC = 0x4055
-0x8CAD = 0x6C44
-0x8CAE = 0x6C49
-0x8CAF = 0x4379
-0x8CB0 = 0x4C63
-0x8CB2 = 0x6C47
-0x8CB3 = 0x6C48
-0x8CB4 = 0x352E
-0x8CB6 = 0x6C4A
-0x8CB7 = 0x4763
-0x8CB8 = 0x425F
-0x8CBB = 0x4871
-0x8CBC = 0x453D
-0x8CBD = 0x6C46
-0x8CBF = 0x4B47
-0x8CC0 = 0x326C
-0x8CC1 = 0x6C4C
-0x8CC2 = 0x4F28
-0x8CC3 = 0x4442
-0x8CC4 = 0x4F45
-0x8CC7 = 0x3B71
-0x8CC8 = 0x6C4B
-0x8CCA = 0x4231
-0x8CCD = 0x6C5C
-0x8CCE = 0x4128
-0x8CD1 = 0x4678
-0x8CD3 = 0x4950
-0x8CDA = 0x6C4F
-0x8CDB = 0x3B3F
-0x8CDC = 0x3B72
-0x8CDE = 0x3E5E
-0x8CE0 = 0x4765
-0x8CE2 = 0x382D
-0x8CE3 = 0x6C4E
-0x8CE4 = 0x6C4D
-0x8CE6 = 0x496A
-0x8CEA = 0x3C41
-0x8CED = 0x4552
-0x8CFA = 0x6C51
-0x8CFB = 0x6C52
-0x8CFC = 0x3958
-0x8CFD = 0x6C50
-0x8D04 = 0x6C53
-0x8D05 = 0x6C54
-0x8D07 = 0x6C56
-0x8D08 = 0x4223
-0x8D0A = 0x6C55
-0x8D0B = 0x3466
-0x8D0D = 0x6C58
-0x8D0F = 0x6C57
-0x8D10 = 0x6C59
-0x8D13 = 0x6C5B
-0x8D14 = 0x6C5D
-0x8D16 = 0x6C5E
-0x8D64 = 0x4056
-0x8D66 = 0x3C4F
-0x8D67 = 0x6C5F
-0x8D6B = 0x3352
-0x8D6D = 0x6C60
-0x8D70 = 0x4176
-0x8D71 = 0x6C61
-0x8D73 = 0x6C62
-0x8D74 = 0x496B
-0x8D77 = 0x352F
-0x8D81 = 0x6C63
-0x8D85 = 0x4436
-0x8D8A = 0x315B
-0x8D99 = 0x6C64
-0x8DA3 = 0x3C71
-0x8DA8 = 0x3F76
-0x8DB3 = 0x422D
-0x8DBA = 0x6C67
-0x8DBE = 0x6C66
-0x8DC2 = 0x6C65
-0x8DCB = 0x6C6D
-0x8DCC = 0x6C6B
-0x8DCF = 0x6C68
-0x8DD6 = 0x6C6A
-0x8DDA = 0x6C69
-0x8DDB = 0x6C6C
-0x8DDD = 0x3577
-0x8DDF = 0x6C70
-0x8DE1 = 0x4057
-0x8DE3 = 0x6C71
-0x8DE8 = 0x3859
-0x8DEA = 0x6C6E
-0x8DEB = 0x6C6F
-0x8DEF = 0x4F29
-0x8DF3 = 0x4437
-0x8DF5 = 0x4129
-0x8DFC = 0x6C72
-0x8DFF = 0x6C75
-0x8E08 = 0x6C73
-0x8E09 = 0x6C74
-0x8E0A = 0x4D59
-0x8E0F = 0x4627
-0x8E10 = 0x6C78
-0x8E1D = 0x6C76
-0x8E1E = 0x6C77
-0x8E1F = 0x6C79
-0x8E2A = 0x6D29
-0x8E30 = 0x6C7C
-0x8E34 = 0x6C7D
-0x8E35 = 0x6C7B
-0x8E42 = 0x6C7A
-0x8E44 = 0x447D
-0x8E47 = 0x6D21
-0x8E48 = 0x6D25
-0x8E49 = 0x6D22
-0x8E4A = 0x6C7E
-0x8E4C = 0x6D23
-0x8E50 = 0x6D24
-0x8E55 = 0x6D2B
-0x8E59 = 0x6D26
-0x8E5F = 0x4058
-0x8E60 = 0x6D28
-0x8E63 = 0x6D2A
-0x8E64 = 0x6D27
-0x8E72 = 0x6D2D
-0x8E74 = 0x3D33
-0x8E76 = 0x6D2C
-0x8E7C = 0x6D2E
-0x8E81 = 0x6D2F
-0x8E84 = 0x6D32
-0x8E85 = 0x6D31
-0x8E87 = 0x6D30
-0x8E8A = 0x6D34
-0x8E8B = 0x6D33
-0x8E8D = 0x4C76
-0x8E91 = 0x6D36
-0x8E93 = 0x6D35
-0x8E94 = 0x6D37
-0x8E99 = 0x6D38
-0x8EA1 = 0x6D3A
-0x8EAA = 0x6D39
-0x8EAB = 0x3F48
-0x8EAC = 0x6D3B
-0x8EAF = 0x366D
-0x8EB0 = 0x6D3C
-0x8EB1 = 0x6D3E
-0x8EBE = 0x6D3F
-0x8EC5 = 0x6D40
-0x8EC6 = 0x6D3D
-0x8EC8 = 0x6D41
-0x8ECA = 0x3C56
-0x8ECB = 0x6D42
-0x8ECC = 0x3530
-0x8ECD = 0x3733
-0x8ED2 = 0x382E
-0x8EDB = 0x6D43
-0x8EDF = 0x4670
-0x8EE2 = 0x453E
-0x8EE3 = 0x6D44
-0x8EEB = 0x6D47
-0x8EF8 = 0x3C34
-0x8EFB = 0x6D46
-0x8EFC = 0x6D45
-0x8EFD = 0x375A
-0x8EFE = 0x6D48
-0x8F03 = 0x3353
-0x8F05 = 0x6D4A
-0x8F09 = 0x3A5C
-0x8F0A = 0x6D49
-0x8F0C = 0x6D52
-0x8F12 = 0x6D4C
-0x8F13 = 0x6D4E
-0x8F14 = 0x4A65
-0x8F15 = 0x6D4B
-0x8F19 = 0x6D4D
-0x8F1B = 0x6D51
-0x8F1C = 0x6D4F
-0x8F1D = 0x3531
-0x8F1F = 0x6D50
-0x8F26 = 0x6D53
-0x8F29 = 0x475A
-0x8F2A = 0x4E58
-0x8F2F = 0x3D34
-0x8F33 = 0x6D54
-0x8F38 = 0x4D22
-0x8F39 = 0x6D56
-0x8F3B = 0x6D55
-0x8F3E = 0x6D59
-0x8F3F = 0x4D41
-0x8F42 = 0x6D58
-0x8F44 = 0x336D
-0x8F45 = 0x6D57
-0x8F46 = 0x6D5C
-0x8F49 = 0x6D5B
-0x8F4C = 0x6D5A
-0x8F4D = 0x4532
-0x8F4E = 0x6D5D
-0x8F57 = 0x6D5E
-0x8F5C = 0x6D5F
-0x8F5F = 0x396C
-0x8F61 = 0x3725
-0x8F62 = 0x6D60
-0x8F63 = 0x6D61
-0x8F64 = 0x6D62
-0x8F9B = 0x3F49
-0x8F9C = 0x6D63
-0x8F9E = 0x3C2D
-0x8F9F = 0x6D64
-0x8FA3 = 0x6D65
-0x8FA7 = 0x5221
-0x8FA8 = 0x517E
-0x8FAD = 0x6D66
-0x8FAE = 0x6570
-0x8FAF = 0x6D67
-0x8FB0 = 0x4324
-0x8FB1 = 0x3F2B
-0x8FB2 = 0x4740
-0x8FB7 = 0x6D68
-0x8FBA = 0x4A55
-0x8FBB = 0x4454
-0x8FBC = 0x397E
-0x8FBF = 0x4329
-0x8FC2 = 0x312A
-0x8FC4 = 0x4B78
-0x8FC5 = 0x3F57
-0x8FCE = 0x375E
-0x8FD1 = 0x3661
-0x8FD4 = 0x4A56
-0x8FDA = 0x6D69
-0x8FE2 = 0x6D6B
-0x8FE5 = 0x6D6A
-0x8FE6 = 0x3260
-0x8FE9 = 0x4676
-0x8FEA = 0x6D6C
-0x8FEB = 0x4777
-0x8FED = 0x4533
-0x8FEF = 0x6D6D
-0x8FF0 = 0x3D52
-0x8FF4 = 0x6D6F
-0x8FF7 = 0x4C42
-0x8FF8 = 0x6D7E
-0x8FF9 = 0x6D71
-0x8FFA = 0x6D72
-0x8FFD = 0x4449
-0x9000 = 0x4260
-0x9001 = 0x4177
-0x9003 = 0x4628
-0x9005 = 0x6D70
-0x9006 = 0x3555
-0x900B = 0x6D79
-0x900D = 0x6D76
-0x900E = 0x6E25
-0x900F = 0x4629
-0x9010 = 0x4360
-0x9011 = 0x6D73
-0x9013 = 0x447E
-0x9014 = 0x4553
-0x9015 = 0x6D74
-0x9016 = 0x6D78
-0x9017 = 0x3F60
-0x9019 = 0x4767
-0x901A = 0x444C
-0x901D = 0x4042
-0x901E = 0x6D77
-0x901F = 0x422E
-0x9020 = 0x4224
-0x9021 = 0x6D75
-0x9022 = 0x3029
-0x9023 = 0x4F22
-0x9027 = 0x6D7A
-0x902E = 0x4261
-0x9031 = 0x3D35
-0x9032 = 0x3F4A
-0x9035 = 0x6D7C
-0x9036 = 0x6D7B
-0x9038 = 0x306F
-0x9039 = 0x6D7D
-0x903C = 0x492F
-0x903E = 0x6E27
-0x9041 = 0x465B
-0x9042 = 0x3F6B
-0x9045 = 0x4359
-0x9047 = 0x3678
-0x9049 = 0x6E26
-0x904A = 0x4D37
-0x904B = 0x313F
-0x904D = 0x4A57
-0x904E = 0x3261
-0x904F = 0x6E21
-0x9050 = 0x6E22
-0x9051 = 0x6E23
-0x9052 = 0x6E24
-0x9053 = 0x463B
-0x9054 = 0x4323
-0x9055 = 0x3063
-0x9056 = 0x6E28
-0x9058 = 0x6E29
-0x9059 = 0x7423
-0x905C = 0x423D
-0x905E = 0x6E2A
-0x9060 = 0x3173
-0x9061 = 0x414C
-0x9063 = 0x382F
-0x9065 = 0x4D5A
-0x9068 = 0x6E2B
-0x9069 = 0x452C
-0x906D = 0x4178
-0x906E = 0x3C57
-0x906F = 0x6E2C
-0x9072 = 0x6E2F
-0x9075 = 0x3D65
-0x9076 = 0x6E2D
-0x9077 = 0x412B
-0x9078 = 0x412A
-0x907A = 0x3064
-0x907C = 0x4E4B
-0x907D = 0x6E31
-0x907F = 0x4872
-0x9080 = 0x6E33
-0x9081 = 0x6E32
-0x9082 = 0x6E30
-0x9083 = 0x6364
-0x9084 = 0x3454
-0x9087 = 0x6D6E
-0x9089 = 0x6E35
-0x908A = 0x6E34
-0x908F = 0x6E36
-0x9091 = 0x4D38
-0x90A3 = 0x4661
-0x90A6 = 0x4B2E
-0x90A8 = 0x6E37
-0x90AA = 0x3C59
-0x90AF = 0x6E38
-0x90B1 = 0x6E39
-0x90B5 = 0x6E3A
-0x90B8 = 0x4521
-0x90C1 = 0x306A
-0x90CA = 0x3959
-0x90CE = 0x4F3A
-0x90DB = 0x6E3E
-0x90E1 = 0x3734
-0x90E2 = 0x6E3B
-0x90E4 = 0x6E3C
-0x90E8 = 0x4974
-0x90ED = 0x3354
-0x90F5 = 0x4D39
-0x90F7 = 0x363F
-0x90FD = 0x4554
-0x9102 = 0x6E3F
-0x9112 = 0x6E40
-0x9119 = 0x6E41
-0x912D = 0x4522
-0x9130 = 0x6E43
-0x9132 = 0x6E42
-0x9149 = 0x4653
-0x914A = 0x6E44
-0x914B = 0x3D36
-0x914C = 0x3C60
-0x914D = 0x475B
-0x914E = 0x4371
-0x9152 = 0x3C72
-0x9154 = 0x3F6C
-0x9156 = 0x6E45
-0x9158 = 0x6E46
-0x9162 = 0x3F5D
-0x9163 = 0x6E47
-0x9165 = 0x6E48
-0x9169 = 0x6E49
-0x916A = 0x4D6F
-0x916C = 0x3D37
-0x9172 = 0x6E4B
-0x9173 = 0x6E4A
-0x9175 = 0x395A
-0x9177 = 0x3973
-0x9178 = 0x3B40
-0x9182 = 0x6E4E
-0x9187 = 0x3D66
-0x9189 = 0x6E4D
-0x918B = 0x6E4C
-0x918D = 0x4269
-0x9190 = 0x386F
-0x9192 = 0x4043
-0x9197 = 0x4830
-0x919C = 0x3D39
-0x91A2 = 0x6E4F
-0x91A4 = 0x3E5F
-0x91AA = 0x6E52
-0x91AB = 0x6E50
-0x91AF = 0x6E51
-0x91B4 = 0x6E54
-0x91B5 = 0x6E53
-0x91B8 = 0x3E7A
-0x91BA = 0x6E55
-0x91C0 = 0x6E56
-0x91C1 = 0x6E57
-0x91C6 = 0x4850
-0x91C7 = 0x3A53
-0x91C8 = 0x3C61
-0x91C9 = 0x6E58
-0x91CB = 0x6E59
-0x91CC = 0x4E24
-0x91CD = 0x3D45
-0x91CE = 0x4C6E
-0x91CF = 0x4E4C
-0x91D0 = 0x6E5A
-0x91D1 = 0x3662
-0x91D6 = 0x6E5B
-0x91D8 = 0x4523
-0x91DB = 0x6E5E
-0x91DC = 0x3378
-0x91DD = 0x3F4B
-0x91DF = 0x6E5C
-0x91E1 = 0x6E5D
-0x91E3 = 0x4460
-0x91E6 = 0x4B55
-0x91E7 = 0x367C
-0x91F5 = 0x6E60
-0x91F6 = 0x6E61
-0x91FC = 0x6E5F
-0x91FF = 0x6E63
-0x920D = 0x465F
-0x920E = 0x3343
-0x9211 = 0x6E67
-0x9214 = 0x6E64
-0x9215 = 0x6E66
-0x921E = 0x6E62
-0x9229 = 0x6F4F
-0x922C = 0x6E65
-0x9234 = 0x4E6B
-0x9237 = 0x385A
-0x923F = 0x6E6F
-0x9244 = 0x4534
-0x9245 = 0x6E6A
-0x9248 = 0x6E6D
-0x9249 = 0x6E6B
-0x924B = 0x6E70
-0x9250 = 0x6E71
-0x9257 = 0x6E69
-0x925A = 0x6E76
-0x925B = 0x3174
-0x925E = 0x6E68
-0x9262 = 0x482D
-0x9264 = 0x6E6C
-0x9266 = 0x3E60
-0x9271 = 0x395B
-0x927E = 0x4B48
-0x9280 = 0x3664
-0x9283 = 0x3D46
-0x9285 = 0x463C
-0x9291 = 0x412D
-0x9293 = 0x6E74
-0x9295 = 0x6E6E
-0x9296 = 0x6E73
-0x9298 = 0x4C43
-0x929A = 0x4438
-0x929B = 0x6E75
-0x929C = 0x6E72
-0x92AD = 0x412C
-0x92B7 = 0x6E79
-0x92B9 = 0x6E78
-0x92CF = 0x6E77
-0x92D2 = 0x4B2F
-0x92E4 = 0x3D7B
-0x92E9 = 0x6E7A
-0x92EA = 0x4A5F
-0x92ED = 0x3154
-0x92F2 = 0x4946
-0x92F3 = 0x4372
-0x92F8 = 0x3578
-0x92FA = 0x6E7C
-0x92FC = 0x395D
-0x9306 = 0x3B2C
-0x930F = 0x6E7B
-0x9310 = 0x3F6D
-0x9318 = 0x3F6E
-0x9319 = 0x6F21
-0x931A = 0x6F23
-0x9320 = 0x3E7B
-0x9322 = 0x6F22
-0x9323 = 0x6F24
-0x9326 = 0x3653
-0x9328 = 0x4945
-0x932B = 0x3C62
-0x932C = 0x4F23
-0x932E = 0x6E7E
-0x932F = 0x3A78
-0x9332 = 0x4F3F
-0x9335 = 0x6F26
-0x933A = 0x6F25
-0x933B = 0x6F27
-0x9344 = 0x6E7D
-0x934B = 0x4669
-0x934D = 0x4555
-0x9354 = 0x4457
-0x9356 = 0x6F2C
-0x935B = 0x4343
-0x935C = 0x6F28
-0x9360 = 0x6F29
-0x936C = 0x372D
-0x936E = 0x6F2B
-0x9375 = 0x3830
-0x937C = 0x6F2A
-0x937E = 0x3E61
-0x938C = 0x3379
-0x9394 = 0x6F30
-0x9396 = 0x3A3F
-0x9397 = 0x4179
-0x939A = 0x444A
-0x93A7 = 0x333B
-0x93AC = 0x6F2E
-0x93AD = 0x6F2F
-0x93AE = 0x4443
-0x93B0 = 0x6F2D
-0x93B9 = 0x6F31
-0x93C3 = 0x6F37
-0x93C8 = 0x6F3A
-0x93D0 = 0x6F39
-0x93D1 = 0x452D
-0x93D6 = 0x6F32
-0x93D7 = 0x6F33
-0x93D8 = 0x6F36
-0x93DD = 0x6F38
-0x93E1 = 0x3640
-0x93E4 = 0x6F3B
-0x93E5 = 0x6F35
-0x93E8 = 0x6F34
-0x9403 = 0x6F3F
-0x9407 = 0x6F40
-0x9410 = 0x6F41
-0x9413 = 0x6F3E
-0x9414 = 0x6F3D
-0x9418 = 0x3E62
-0x9419 = 0x462A
-0x941A = 0x6F3C
-0x9421 = 0x6F45
-0x942B = 0x6F43
-0x9435 = 0x6F44
-0x9436 = 0x6F42
-0x9438 = 0x4278
-0x943A = 0x6F46
-0x9441 = 0x6F47
-0x9444 = 0x6F49
-0x9451 = 0x3455
-0x9452 = 0x6F48
-0x9453 = 0x4C7A
-0x945A = 0x6F54
-0x945B = 0x6F4A
-0x945E = 0x6F4D
-0x9460 = 0x6F4B
-0x9462 = 0x6F4C
-0x946A = 0x6F4E
-0x9470 = 0x6F50
-0x9475 = 0x6F51
-0x9477 = 0x6F52
-0x947C = 0x6F55
-0x947D = 0x6F53
-0x947E = 0x6F56
-0x947F = 0x6F58
-0x9481 = 0x6F57
-0x9577 = 0x4439
-0x9580 = 0x4C67
-0x9582 = 0x6F59
-0x9583 = 0x412E
-0x9587 = 0x6F5A
-0x9589 = 0x4A44
-0x958A = 0x6F5B
-0x958B = 0x332B
-0x958F = 0x313C
-0x9591 = 0x3457
-0x9593 = 0x3456
-0x9594 = 0x6F5C
-0x9596 = 0x6F5D
-0x9598 = 0x6F5E
-0x9599 = 0x6F5F
-0x95A0 = 0x6F60
-0x95A2 = 0x3458
-0x95A3 = 0x3355
-0x95A4 = 0x395E
-0x95A5 = 0x4836
-0x95A7 = 0x6F62
-0x95A8 = 0x6F61
-0x95AD = 0x6F63
-0x95B2 = 0x315C
-0x95B9 = 0x6F66
-0x95BB = 0x6F65
-0x95BC = 0x6F64
-0x95BE = 0x6F67
-0x95C3 = 0x6F6A
-0x95C7 = 0x3047
-0x95CA = 0x6F68
-0x95CC = 0x6F6C
-0x95CD = 0x6F6B
-0x95D4 = 0x6F6E
-0x95D5 = 0x6F6D
-0x95D6 = 0x6F6F
-0x95D8 = 0x462E
-0x95DC = 0x6F70
-0x95E1 = 0x6F71
-0x95E2 = 0x6F73
-0x95E5 = 0x6F72
-0x961C = 0x496C
-0x9621 = 0x6F74
-0x9628 = 0x6F75
-0x962A = 0x3A65
-0x962E = 0x6F76
-0x962F = 0x6F77
-0x9632 = 0x4B49
-0x963B = 0x414B
-0x963F = 0x3024
-0x9640 = 0x424B
-0x9642 = 0x6F78
-0x9644 = 0x496D
-0x964B = 0x6F7B
-0x964C = 0x6F79
-0x964D = 0x395F
-0x964F = 0x6F7A
-0x9650 = 0x3842
-0x965B = 0x4A45
-0x965C = 0x6F7D
-0x965D = 0x7021
-0x965E = 0x6F7E
-0x965F = 0x7022
-0x9662 = 0x3121
-0x9663 = 0x3F58
-0x9664 = 0x3D7C
-0x9665 = 0x3459
-0x9666 = 0x7023
-0x966A = 0x4766
-0x966C = 0x7025
-0x9670 = 0x3122
-0x9672 = 0x7024
-0x9673 = 0x4444
-0x9675 = 0x4E4D
-0x9676 = 0x462B
-0x9677 = 0x6F7C
-0x9678 = 0x4E26
-0x967A = 0x3831
-0x967D = 0x4D5B
-0x9685 = 0x3679
-0x9686 = 0x4E34
-0x9688 = 0x3728
-0x968A = 0x4262
-0x968B = 0x6721
-0x968D = 0x7026
-0x968E = 0x332C
-0x968F = 0x3F6F
-0x9694 = 0x3356
-0x9695 = 0x7028
-0x9697 = 0x7029
-0x9698 = 0x7027
-0x9699 = 0x3764
-0x969B = 0x3A5D
-0x969C = 0x3E63
-0x96A0 = 0x3123
-0x96A3 = 0x4E59
-0x96A7 = 0x702B
-0x96A8 = 0x6E2E
-0x96AA = 0x702A
-0x96B0 = 0x702E
-0x96B1 = 0x702C
-0x96B2 = 0x702D
-0x96B4 = 0x702F
-0x96B6 = 0x7030
-0x96B7 = 0x4E6C
-0x96B8 = 0x7031
-0x96B9 = 0x7032
-0x96BB = 0x4049
-0x96BC = 0x483B
-0x96C0 = 0x3F7D
-0x96C1 = 0x3467
-0x96C4 = 0x4D3A
-0x96C5 = 0x326D
-0x96C6 = 0x3D38
-0x96C7 = 0x385B
-0x96C9 = 0x7035
-0x96CB = 0x7034
-0x96CC = 0x3B73
-0x96CD = 0x7036
-0x96CE = 0x7033
-0x96D1 = 0x3B28
-0x96D5 = 0x703A
-0x96D6 = 0x6A2D
-0x96D9 = 0x5256
-0x96DB = 0x3F77
-0x96DC = 0x7038
-0x96E2 = 0x4E25
-0x96E3 = 0x4671
-0x96E8 = 0x312B
-0x96EA = 0x4063
-0x96EB = 0x3C36
-0x96F0 = 0x4A37
-0x96F2 = 0x3140
-0x96F6 = 0x4E6D
-0x96F7 = 0x4D6B
-0x96F9 = 0x703B
-0x96FB = 0x4545
-0x9700 = 0x3C7B
-0x9704 = 0x703C
-0x9706 = 0x703D
-0x9707 = 0x3F4C
-0x9708 = 0x703E
-0x970A = 0x4E6E
-0x970D = 0x7039
-0x970E = 0x7040
-0x970F = 0x7042
-0x9711 = 0x7041
-0x9713 = 0x703F
-0x9716 = 0x7043
-0x9719 = 0x7044
-0x971C = 0x417A
-0x971E = 0x3262
-0x9724 = 0x7045
-0x9727 = 0x4C38
-0x972A = 0x7046
-0x9730 = 0x7047
-0x9732 = 0x4F2A
-0x9738 = 0x5B31
-0x9739 = 0x7048
-0x973D = 0x7049
-0x973E = 0x704A
-0x9742 = 0x704E
-0x9744 = 0x704B
-0x9746 = 0x704C
-0x9748 = 0x704D
-0x9749 = 0x704F
-0x9752 = 0x4044
-0x9756 = 0x4C77
-0x9759 = 0x4045
-0x975C = 0x7050
-0x975E = 0x4873
-0x9760 = 0x7051
-0x9761 = 0x7353
-0x9762 = 0x4C4C
-0x9764 = 0x7052
-0x9766 = 0x7053
-0x9768 = 0x7054
-0x9769 = 0x3357
-0x976B = 0x7056
-0x976D = 0x3F59
-0x9771 = 0x7057
-0x9774 = 0x3724
-0x9779 = 0x7058
-0x977A = 0x705C
-0x977C = 0x705A
-0x9781 = 0x705B
-0x9784 = 0x3373
-0x9785 = 0x7059
-0x9786 = 0x705D
-0x978B = 0x705E
-0x978D = 0x3048
-0x978F = 0x705F
-0x9790 = 0x7060
-0x9798 = 0x3E64
-0x979C = 0x7061
-0x97A0 = 0x3547
-0x97A3 = 0x7064
-0x97A6 = 0x7063
-0x97A8 = 0x7062
-0x97AB = 0x6B71
-0x97AD = 0x4A5C
-0x97B3 = 0x7065
-0x97B4 = 0x7066
-0x97C3 = 0x7067
-0x97C6 = 0x7068
-0x97C8 = 0x7069
-0x97CB = 0x706A
-0x97D3 = 0x345A
-0x97DC = 0x706B
-0x97ED = 0x706C
-0x97EE = 0x4723
-0x97F2 = 0x706E
-0x97F3 = 0x323B
-0x97F5 = 0x7071
-0x97F6 = 0x7070
-0x97FB = 0x3124
-0x97FF = 0x3641
-0x9801 = 0x4A47
-0x9802 = 0x443A
-0x9803 = 0x3A22
-0x9805 = 0x3960
-0x9806 = 0x3D67
-0x9808 = 0x3F5C
-0x980C = 0x7073
-0x980F = 0x7072
-0x9810 = 0x4D42
-0x9811 = 0x3468
-0x9812 = 0x4852
-0x9813 = 0x465C
-0x9817 = 0x3F7C
-0x9818 = 0x4E4E
-0x981A = 0x375B
-0x9821 = 0x7076
-0x9824 = 0x7075
-0x982C = 0x4B4B
-0x982D = 0x462C
-0x9834 = 0x3150
-0x9837 = 0x7077
-0x9838 = 0x7074
-0x983B = 0x4951
-0x983C = 0x4D6A
-0x983D = 0x7078
-0x9846 = 0x7079
-0x984B = 0x707B
-0x984C = 0x426A
-0x984D = 0x335B
-0x984E = 0x335C
-0x984F = 0x707A
-0x9854 = 0x3469
-0x9855 = 0x3832
-0x9858 = 0x346A
-0x985B = 0x453F
-0x985E = 0x4E60
-0x9867 = 0x385C
-0x986B = 0x707C
-0x986F = 0x707D
-0x9870 = 0x707E
-0x9871 = 0x7121
-0x9873 = 0x7123
-0x9874 = 0x7122
-0x98A8 = 0x4977
-0x98AA = 0x7124
-0x98AF = 0x7125
-0x98B1 = 0x7126
-0x98B6 = 0x7127
-0x98C3 = 0x7129
-0x98C4 = 0x7128
-0x98C6 = 0x712A
-0x98DB = 0x4874
-0x98DC = 0x664C
-0x98DF = 0x3F29
-0x98E2 = 0x3532
-0x98E9 = 0x712B
-0x98EB = 0x712C
-0x98ED = 0x522C
-0x98EE = 0x5D3B
-0x98EF = 0x4853
-0x98F2 = 0x307B
-0x98F4 = 0x303B
-0x98FC = 0x3B74
-0x98FD = 0x4B30
-0x98FE = 0x3E7E
-0x9903 = 0x712D
-0x9905 = 0x4C5F
-0x9909 = 0x712E
-0x990A = 0x4D5C
-0x990C = 0x3142
-0x9910 = 0x3B41
-0x9912 = 0x712F
-0x9913 = 0x326E
-0x9914 = 0x7130
-0x9918 = 0x7131
-0x991D = 0x7133
-0x991E = 0x7134
-0x9920 = 0x7136
-0x9921 = 0x7132
-0x9924 = 0x7135
-0x9928 = 0x345B
-0x992C = 0x7137
-0x992E = 0x7138
-0x993D = 0x7139
-0x993E = 0x713A
-0x9942 = 0x713B
-0x9945 = 0x713D
-0x9949 = 0x713C
-0x994B = 0x713F
-0x994C = 0x7142
-0x9950 = 0x713E
-0x9951 = 0x7140
-0x9952 = 0x7141
-0x9955 = 0x7143
-0x9957 = 0x3642
-0x9996 = 0x3C73
-0x9997 = 0x7144
-0x9998 = 0x7145
-0x9999 = 0x3961
-0x99A5 = 0x7146
-0x99A8 = 0x333E
-0x99AC = 0x474F
-0x99AD = 0x7147
-0x99AE = 0x7148
-0x99B3 = 0x435A
-0x99B4 = 0x466B
-0x99BC = 0x7149
-0x99C1 = 0x477D
-0x99C4 = 0x424C
-0x99C5 = 0x3158
-0x99C6 = 0x366E
-0x99C8 = 0x366F
-0x99D0 = 0x4373
-0x99D1 = 0x714E
-0x99D2 = 0x3670
-0x99D5 = 0x326F
-0x99D8 = 0x714D
-0x99DB = 0x714B
-0x99DD = 0x714C
-0x99DF = 0x714A
-0x99E2 = 0x7158
-0x99ED = 0x714F
-0x99EE = 0x7150
-0x99F1 = 0x7151
-0x99F2 = 0x7152
-0x99F8 = 0x7154
-0x99FB = 0x7153
-0x99FF = 0x3D59
-0x9A01 = 0x7155
-0x9A05 = 0x7157
-0x9A0E = 0x3533
-0x9A0F = 0x7156
-0x9A12 = 0x417B
-0x9A13 = 0x3833
-0x9A19 = 0x7159
-0x9A28 = 0x424D
-0x9A2B = 0x715A
-0x9A30 = 0x462D
-0x9A37 = 0x715B
-0x9A3E = 0x7160
-0x9A40 = 0x715E
-0x9A42 = 0x715D
-0x9A43 = 0x715F
-0x9A45 = 0x715C
-0x9A4D = 0x7162
-0x9A55 = 0x7161
-0x9A57 = 0x7164
-0x9A5A = 0x3643
-0x9A5B = 0x7163
-0x9A5F = 0x7165
-0x9A62 = 0x7166
-0x9A64 = 0x7168
-0x9A65 = 0x7167
-0x9A69 = 0x7169
-0x9A6A = 0x716B
-0x9A6B = 0x716A
-0x9AA8 = 0x397C
-0x9AAD = 0x716C
-0x9AB0 = 0x716D
-0x9AB8 = 0x333C
-0x9ABC = 0x716E
-0x9AC0 = 0x716F
-0x9AC4 = 0x3F71
-0x9ACF = 0x7170
-0x9AD1 = 0x7171
-0x9AD3 = 0x7172
-0x9AD4 = 0x7173
-0x9AD8 = 0x3962
-0x9ADE = 0x7174
-0x9ADF = 0x7175
-0x9AE2 = 0x7176
-0x9AE3 = 0x7177
-0x9AE6 = 0x7178
-0x9AEA = 0x4831
-0x9AEB = 0x717A
-0x9AED = 0x4926
-0x9AEE = 0x717B
-0x9AEF = 0x7179
-0x9AF1 = 0x717D
-0x9AF4 = 0x717C
-0x9AF7 = 0x717E
-0x9AFB = 0x7221
-0x9B06 = 0x7222
-0x9B18 = 0x7223
-0x9B1A = 0x7224
-0x9B1F = 0x7225
-0x9B22 = 0x7226
-0x9B23 = 0x7227
-0x9B25 = 0x7228
-0x9B27 = 0x7229
-0x9B28 = 0x722A
-0x9B29 = 0x722B
-0x9B2A = 0x722C
-0x9B2E = 0x722D
-0x9B2F = 0x722E
-0x9B31 = 0x5D35
-0x9B32 = 0x722F
-0x9B3B = 0x6478
-0x9B3C = 0x3534
-0x9B41 = 0x3321
-0x9B42 = 0x3A32
-0x9B43 = 0x7231
-0x9B44 = 0x7230
-0x9B45 = 0x4C25
-0x9B4D = 0x7233
-0x9B4E = 0x7234
-0x9B4F = 0x7232
-0x9B51 = 0x7235
-0x9B54 = 0x4B62
-0x9B58 = 0x7236
-0x9B5A = 0x357B
-0x9B6F = 0x4F25
-0x9B74 = 0x7237
-0x9B83 = 0x7239
-0x9B8E = 0x303E
-0x9B91 = 0x723A
-0x9B92 = 0x4A2B
-0x9B93 = 0x7238
-0x9B96 = 0x723B
-0x9B97 = 0x723C
-0x9B9F = 0x723D
-0x9BA0 = 0x723E
-0x9BA8 = 0x723F
-0x9BAA = 0x4B6E
-0x9BAB = 0x3B2D
-0x9BAD = 0x3A7A
-0x9BAE = 0x412F
-0x9BB4 = 0x7240
-0x9BB9 = 0x7243
-0x9BC0 = 0x7241
-0x9BC6 = 0x7244
-0x9BC9 = 0x3871
-0x9BCA = 0x7242
-0x9BCF = 0x7245
-0x9BD1 = 0x7246
-0x9BD2 = 0x7247
-0x9BD4 = 0x724B
-0x9BD6 = 0x3B2A
-0x9BDB = 0x4264
-0x9BE1 = 0x724C
-0x9BE2 = 0x7249
-0x9BE3 = 0x7248
-0x9BE4 = 0x724A
-0x9BE8 = 0x375F
-0x9BF0 = 0x7250
-0x9BF1 = 0x724F
-0x9BF2 = 0x724E
-0x9BF5 = 0x3033
-0x9C04 = 0x725A
-0x9C06 = 0x7256
-0x9C08 = 0x7257
-0x9C09 = 0x7253
-0x9C0A = 0x7259
-0x9C0C = 0x7255
-0x9C0D = 0x3362
-0x9C10 = 0x4F4C
-0x9C12 = 0x7258
-0x9C13 = 0x7254
-0x9C14 = 0x7252
-0x9C15 = 0x7251
-0x9C1B = 0x725C
-0x9C21 = 0x725F
-0x9C24 = 0x725E
-0x9C25 = 0x725D
-0x9C2D = 0x4949
-0x9C2E = 0x725B
-0x9C2F = 0x3073
-0x9C30 = 0x7260
-0x9C32 = 0x7262
-0x9C39 = 0x336F
-0x9C3A = 0x724D
-0x9C3B = 0x3137
-0x9C3E = 0x7264
-0x9C46 = 0x7263
-0x9C47 = 0x7261
-0x9C48 = 0x432D
-0x9C52 = 0x4B70
-0x9C57 = 0x4E5A
-0x9C5A = 0x7265
-0x9C60 = 0x7266
-0x9C67 = 0x7267
-0x9C76 = 0x7268
-0x9C78 = 0x7269
-0x9CE5 = 0x443B
-0x9CE7 = 0x726A
-0x9CE9 = 0x4837
-0x9CEB = 0x726F
-0x9CEC = 0x726B
-0x9CF0 = 0x726C
-0x9CF3 = 0x4B31
-0x9CF4 = 0x4C44
-0x9CF6 = 0x4650
-0x9D03 = 0x7270
-0x9D06 = 0x7271
-0x9D07 = 0x463E
-0x9D08 = 0x726E
-0x9D09 = 0x726D
-0x9D0E = 0x322A
-0x9D12 = 0x7279
-0x9D15 = 0x7278
-0x9D1B = 0x3175
-0x9D1F = 0x7276
-0x9D23 = 0x7275
-0x9D26 = 0x7273
-0x9D28 = 0x337B
-0x9D2A = 0x7272
-0x9D2B = 0x3C32
-0x9D2C = 0x3229
-0x9D3B = 0x3963
-0x9D3E = 0x727C
-0x9D3F = 0x727B
-0x9D41 = 0x727A
-0x9D44 = 0x7277
-0x9D46 = 0x727D
-0x9D48 = 0x727E
-0x9D50 = 0x7325
-0x9D51 = 0x7324
-0x9D59 = 0x7326
-0x9D5C = 0x312D
-0x9D5D = 0x7321
-0x9D5E = 0x7322
-0x9D60 = 0x3974
-0x9D61 = 0x4C39
-0x9D64 = 0x7323
-0x9D6C = 0x4B32
-0x9D6F = 0x732B
-0x9D72 = 0x7327
-0x9D7A = 0x732C
-0x9D87 = 0x7329
-0x9D89 = 0x7328
-0x9D8F = 0x375C
-0x9D9A = 0x732D
-0x9DA4 = 0x732E
-0x9DA9 = 0x732F
-0x9DAB = 0x732A
-0x9DAF = 0x7274
-0x9DB2 = 0x7330
-0x9DB4 = 0x4461
-0x9DB8 = 0x7334
-0x9DBA = 0x7335
-0x9DBB = 0x7333
-0x9DC1 = 0x7332
-0x9DC2 = 0x7338
-0x9DC4 = 0x7331
-0x9DC6 = 0x7336
-0x9DCF = 0x7337
-0x9DD3 = 0x733A
-0x9DD9 = 0x7339
-0x9DE6 = 0x733C
-0x9DED = 0x733D
-0x9DEF = 0x733E
-0x9DF2 = 0x4F49
-0x9DF8 = 0x733B
-0x9DF9 = 0x426B
-0x9DFA = 0x3A6D
-0x9DFD = 0x733F
-0x9E1A = 0x7340
-0x9E1B = 0x7341
-0x9E1E = 0x7342
-0x9E75 = 0x7343
-0x9E78 = 0x3834
-0x9E79 = 0x7344
-0x9E7D = 0x7345
-0x9E7F = 0x3C2F
-0x9E81 = 0x7346
-0x9E88 = 0x7347
-0x9E8B = 0x7348
-0x9E8C = 0x7349
-0x9E91 = 0x734C
-0x9E92 = 0x734A
-0x9E93 = 0x4F3C
-0x9E95 = 0x734B
-0x9E97 = 0x4E6F
-0x9E9D = 0x734D
-0x9E9F = 0x4E5B
-0x9EA5 = 0x734E
-0x9EA6 = 0x477E
-0x9EA9 = 0x734F
-0x9EAA = 0x7351
-0x9EAD = 0x7352
-0x9EB8 = 0x7350
-0x9EB9 = 0x396D
-0x9EBA = 0x4C4D
-0x9EBB = 0x4B63
-0x9EBC = 0x5677
-0x9EBE = 0x5D60
-0x9EBF = 0x4B7B
-0x9EC4 = 0x322B
-0x9ECC = 0x7354
-0x9ECD = 0x3550
-0x9ECE = 0x7355
-0x9ECF = 0x7356
-0x9ED0 = 0x7357
-0x9ED2 = 0x3975
-0x9ED4 = 0x7358
-0x9ED8 = 0x6054
-0x9ED9 = 0x4C5B
-0x9EDB = 0x4263
-0x9EDC = 0x7359
-0x9EDD = 0x735B
-0x9EDE = 0x735A
-0x9EE0 = 0x735C
-0x9EE5 = 0x735D
-0x9EE8 = 0x735E
-0x9EEF = 0x735F
-0x9EF4 = 0x7360
-0x9EF6 = 0x7361
-0x9EF7 = 0x7362
-0x9EF9 = 0x7363
-0x9EFB = 0x7364
-0x9EFC = 0x7365
-0x9EFD = 0x7366
-0x9F07 = 0x7367
-0x9F08 = 0x7368
-0x9F0E = 0x4524
-0x9F13 = 0x385D
-0x9F15 = 0x736A
-0x9F20 = 0x414D
-0x9F21 = 0x736B
-0x9F2C = 0x736C
-0x9F3B = 0x4921
-0x9F3E = 0x736D
-0x9F4A = 0x736E
-0x9F4B = 0x6337
-0x9F4E = 0x6C5A
-0x9F4F = 0x706D
-0x9F52 = 0x736F
-0x9F54 = 0x7370
-0x9F5F = 0x7372
-0x9F60 = 0x7373
-0x9F61 = 0x7374
-0x9F62 = 0x4E70
-0x9F63 = 0x7371
-0x9F66 = 0x7375
-0x9F67 = 0x7376
-0x9F6A = 0x7378
-0x9F6C = 0x7377
-0x9F72 = 0x737A
-0x9F76 = 0x737B
-0x9F77 = 0x7379
-0x9F8D = 0x4E36
-0x9F95 = 0x737C
-0x9F9C = 0x737D
-0x9F9D = 0x6354
-0x9FA0 = 0x737E
-0xFF01 = 0x212A
-0xFF03 = 0x2174
-0xFF04 = 0x2170
-0xFF05 = 0x2173
-0xFF06 = 0x2175
-0xFF08 = 0x214A
-0xFF09 = 0x214B
-0xFF0A = 0x2176
-0xFF0B = 0x215C
-0xFF0C = 0x2124
-0xFF0D = 0x215D
-0xFF0E = 0x2125
-0xFF0F = 0x213F
-0xFF10 = 0x2330
-0xFF11 = 0x2331
-0xFF12 = 0x2332
-0xFF13 = 0x2333
-0xFF14 = 0x2334
-0xFF15 = 0x2335
-0xFF16 = 0x2336
-0xFF17 = 0x2337
-0xFF18 = 0x2338
-0xFF19 = 0x2339
-0xFF1A = 0x2127
-0xFF1B = 0x2128
-0xFF1C = 0x2163
-0xFF1D = 0x2161
-0xFF1E = 0x2164
-0xFF1F = 0x2129
-0xFF20 = 0x2177
-0xFF21 = 0x2341
-0xFF22 = 0x2342
-0xFF23 = 0x2343
-0xFF24 = 0x2344
-0xFF25 = 0x2345
-0xFF26 = 0x2346
-0xFF27 = 0x2347
-0xFF28 = 0x2348
-0xFF29 = 0x2349
-0xFF2A = 0x234A
-0xFF2B = 0x234B
-0xFF2C = 0x234C
-0xFF2D = 0x234D
-0xFF2E = 0x234E
-0xFF2F = 0x234F
-0xFF30 = 0x2350
-0xFF31 = 0x2351
-0xFF32 = 0x2352
-0xFF33 = 0x2353
-0xFF34 = 0x2354
-0xFF35 = 0x2355
-0xFF36 = 0x2356
-0xFF37 = 0x2357
-0xFF38 = 0x2358
-0xFF39 = 0x2359
-0xFF3A = 0x235A
-0xFF3B = 0x214E
-0xFF3C = 0x2140
-0xFF3D = 0x214F
-0xFF3E = 0x2130
-0xFF3F = 0x2132
-0xFF40 = 0x212E
-0xFF41 = 0x2361
-0xFF42 = 0x2362
-0xFF43 = 0x2363
-0xFF44 = 0x2364
-0xFF45 = 0x2365
-0xFF46 = 0x2366
-0xFF47 = 0x2367
-0xFF48 = 0x2368
-0xFF49 = 0x2369
-0xFF4A = 0x236A
-0xFF4B = 0x236B
-0xFF4C = 0x236C
-0xFF4D = 0x236D
-0xFF4E = 0x236E
-0xFF4F = 0x236F
-0xFF50 = 0x2370
-0xFF51 = 0x2371
-0xFF52 = 0x2372
-0xFF53 = 0x2373
-0xFF54 = 0x2374
-0xFF55 = 0x2375
-0xFF56 = 0x2376
-0xFF57 = 0x2377
-0xFF58 = 0x2378
-0xFF59 = 0x2379
-0xFF5A = 0x237A
-0xFF5B = 0x2150
-0xFF5C = 0x2143
-0xFF5D = 0x2151
-0xFF5E = 0x2141
-0xFFE0 = 0x2171
-0xFFE1 = 0x2172
-0xFFE2 = 0x224C
-0xFFE3 = 0x2131
-0xFFE5 = 0x216F
-END_MAP
diff --git a/enc/trans/JIS/UCS%JISX0208UDC.src b/enc/trans/JIS/UCS%JISX0208UDC.src
deleted file mode 100644
index 0604f6e4eb..0000000000
--- a/enc/trans/JIS/UCS%JISX0208UDC.src
+++ /dev/null
@@ -1,955 +0,0 @@
-# $NetBSD: UCS%JISX0208UDC.src,v 1.1 2003/07/19 20:20:42 tshiozak Exp $
-
-TYPE ROWCOL
-NAME "UCS/JISX0208UDC"
-SRC_ZONE 0xE000 - 0xE3AB
-OOB_MODE INVALID
-DST_INVALID 0xFFFF
-DST_UNIT_BITS 16
-
-BEGIN_MAP
-0xE000 - 0xE3AB = INVALID
-#
-# This data is derived from http://www.opengroup.or.jp/jvc/cde/
-#
-0xE000 = 0x7521
-0xE001 = 0x7522
-0xE002 = 0x7523
-0xE003 = 0x7524
-0xE004 = 0x7525
-0xE005 = 0x7526
-0xE006 = 0x7527
-0xE007 = 0x7528
-0xE008 = 0x7529
-0xE009 = 0x752A
-0xE00A = 0x752B
-0xE00B = 0x752C
-0xE00C = 0x752D
-0xE00D = 0x752E
-0xE00E = 0x752F
-0xE00F = 0x7530
-0xE010 = 0x7531
-0xE011 = 0x7532
-0xE012 = 0x7533
-0xE013 = 0x7534
-0xE014 = 0x7535
-0xE015 = 0x7536
-0xE016 = 0x7537
-0xE017 = 0x7538
-0xE018 = 0x7539
-0xE019 = 0x753A
-0xE01A = 0x753B
-0xE01B = 0x753C
-0xE01C = 0x753D
-0xE01D = 0x753E
-0xE01E = 0x753F
-0xE01F = 0x7540
-0xE020 = 0x7541
-0xE021 = 0x7542
-0xE022 = 0x7543
-0xE023 = 0x7544
-0xE024 = 0x7545
-0xE025 = 0x7546
-0xE026 = 0x7547
-0xE027 = 0x7548
-0xE028 = 0x7549
-0xE029 = 0x754A
-0xE02A = 0x754B
-0xE02B = 0x754C
-0xE02C = 0x754D
-0xE02D = 0x754E
-0xE02E = 0x754F
-0xE02F = 0x7550
-0xE030 = 0x7551
-0xE031 = 0x7552
-0xE032 = 0x7553
-0xE033 = 0x7554
-0xE034 = 0x7555
-0xE035 = 0x7556
-0xE036 = 0x7557
-0xE037 = 0x7558
-0xE038 = 0x7559
-0xE039 = 0x755A
-0xE03A = 0x755B
-0xE03B = 0x755C
-0xE03C = 0x755D
-0xE03D = 0x755E
-0xE03E = 0x755F
-0xE03F = 0x7560
-0xE040 = 0x7561
-0xE041 = 0x7562
-0xE042 = 0x7563
-0xE043 = 0x7564
-0xE044 = 0x7565
-0xE045 = 0x7566
-0xE046 = 0x7567
-0xE047 = 0x7568
-0xE048 = 0x7569
-0xE049 = 0x756A
-0xE04A = 0x756B
-0xE04B = 0x756C
-0xE04C = 0x756D
-0xE04D = 0x756E
-0xE04E = 0x756F
-0xE04F = 0x7570
-0xE050 = 0x7571
-0xE051 = 0x7572
-0xE052 = 0x7573
-0xE053 = 0x7574
-0xE054 = 0x7575
-0xE055 = 0x7576
-0xE056 = 0x7577
-0xE057 = 0x7578
-0xE058 = 0x7579
-0xE059 = 0x757A
-0xE05A = 0x757B
-0xE05B = 0x757C
-0xE05C = 0x757D
-0xE05D = 0x757E
-0xE05E = 0x7621
-0xE05F = 0x7622
-0xE060 = 0x7623
-0xE061 = 0x7624
-0xE062 = 0x7625
-0xE063 = 0x7626
-0xE064 = 0x7627
-0xE065 = 0x7628
-0xE066 = 0x7629
-0xE067 = 0x762A
-0xE068 = 0x762B
-0xE069 = 0x762C
-0xE06A = 0x762D
-0xE06B = 0x762E
-0xE06C = 0x762F
-0xE06D = 0x7630
-0xE06E = 0x7631
-0xE06F = 0x7632
-0xE070 = 0x7633
-0xE071 = 0x7634
-0xE072 = 0x7635
-0xE073 = 0x7636
-0xE074 = 0x7637
-0xE075 = 0x7638
-0xE076 = 0x7639
-0xE077 = 0x763A
-0xE078 = 0x763B
-0xE079 = 0x763C
-0xE07A = 0x763D
-0xE07B = 0x763E
-0xE07C = 0x763F
-0xE07D = 0x7640
-0xE07E = 0x7641
-0xE07F = 0x7642
-0xE080 = 0x7643
-0xE081 = 0x7644
-0xE082 = 0x7645
-0xE083 = 0x7646
-0xE084 = 0x7647
-0xE085 = 0x7648
-0xE086 = 0x7649
-0xE087 = 0x764A
-0xE088 = 0x764B
-0xE089 = 0x764C
-0xE08A = 0x764D
-0xE08B = 0x764E
-0xE08C = 0x764F
-0xE08D = 0x7650
-0xE08E = 0x7651
-0xE08F = 0x7652
-0xE090 = 0x7653
-0xE091 = 0x7654
-0xE092 = 0x7655
-0xE093 = 0x7656
-0xE094 = 0x7657
-0xE095 = 0x7658
-0xE096 = 0x7659
-0xE097 = 0x765A
-0xE098 = 0x765B
-0xE099 = 0x765C
-0xE09A = 0x765D
-0xE09B = 0x765E
-0xE09C = 0x765F
-0xE09D = 0x7660
-0xE09E = 0x7661
-0xE09F = 0x7662
-0xE0A0 = 0x7663
-0xE0A1 = 0x7664
-0xE0A2 = 0x7665
-0xE0A3 = 0x7666
-0xE0A4 = 0x7667
-0xE0A5 = 0x7668
-0xE0A6 = 0x7669
-0xE0A7 = 0x766A
-0xE0A8 = 0x766B
-0xE0A9 = 0x766C
-0xE0AA = 0x766D
-0xE0AB = 0x766E
-0xE0AC = 0x766F
-0xE0AD = 0x7670
-0xE0AE = 0x7671
-0xE0AF = 0x7672
-0xE0B0 = 0x7673
-0xE0B1 = 0x7674
-0xE0B2 = 0x7675
-0xE0B3 = 0x7676
-0xE0B4 = 0x7677
-0xE0B5 = 0x7678
-0xE0B6 = 0x7679
-0xE0B7 = 0x767A
-0xE0B8 = 0x767B
-0xE0B9 = 0x767C
-0xE0BA = 0x767D
-0xE0BB = 0x767E
-0xE0BC = 0x7721
-0xE0BD = 0x7722
-0xE0BE = 0x7723
-0xE0BF = 0x7724
-0xE0C0 = 0x7725
-0xE0C1 = 0x7726
-0xE0C2 = 0x7727
-0xE0C3 = 0x7728
-0xE0C4 = 0x7729
-0xE0C5 = 0x772A
-0xE0C6 = 0x772B
-0xE0C7 = 0x772C
-0xE0C8 = 0x772D
-0xE0C9 = 0x772E
-0xE0CA = 0x772F
-0xE0CB = 0x7730
-0xE0CC = 0x7731
-0xE0CD = 0x7732
-0xE0CE = 0x7733
-0xE0CF = 0x7734
-0xE0D0 = 0x7735
-0xE0D1 = 0x7736
-0xE0D2 = 0x7737
-0xE0D3 = 0x7738
-0xE0D4 = 0x7739
-0xE0D5 = 0x773A
-0xE0D6 = 0x773B
-0xE0D7 = 0x773C
-0xE0D8 = 0x773D
-0xE0D9 = 0x773E
-0xE0DA = 0x773F
-0xE0DB = 0x7740
-0xE0DC = 0x7741
-0xE0DD = 0x7742
-0xE0DE = 0x7743
-0xE0DF = 0x7744
-0xE0E0 = 0x7745
-0xE0E1 = 0x7746
-0xE0E2 = 0x7747
-0xE0E3 = 0x7748
-0xE0E4 = 0x7749
-0xE0E5 = 0x774A
-0xE0E6 = 0x774B
-0xE0E7 = 0x774C
-0xE0E8 = 0x774D
-0xE0E9 = 0x774E
-0xE0EA = 0x774F
-0xE0EB = 0x7750
-0xE0EC = 0x7751
-0xE0ED = 0x7752
-0xE0EE = 0x7753
-0xE0EF = 0x7754
-0xE0F0 = 0x7755
-0xE0F1 = 0x7756
-0xE0F2 = 0x7757
-0xE0F3 = 0x7758
-0xE0F4 = 0x7759
-0xE0F5 = 0x775A
-0xE0F6 = 0x775B
-0xE0F7 = 0x775C
-0xE0F8 = 0x775D
-0xE0F9 = 0x775E
-0xE0FA = 0x775F
-0xE0FB = 0x7760
-0xE0FC = 0x7761
-0xE0FD = 0x7762
-0xE0FE = 0x7763
-0xE0FF = 0x7764
-0xE100 = 0x7765
-0xE101 = 0x7766
-0xE102 = 0x7767
-0xE103 = 0x7768
-0xE104 = 0x7769
-0xE105 = 0x776A
-0xE106 = 0x776B
-0xE107 = 0x776C
-0xE108 = 0x776D
-0xE109 = 0x776E
-0xE10A = 0x776F
-0xE10B = 0x7770
-0xE10C = 0x7771
-0xE10D = 0x7772
-0xE10E = 0x7773
-0xE10F = 0x7774
-0xE110 = 0x7775
-0xE111 = 0x7776
-0xE112 = 0x7777
-0xE113 = 0x7778
-0xE114 = 0x7779
-0xE115 = 0x777A
-0xE116 = 0x777B
-0xE117 = 0x777C
-0xE118 = 0x777D
-0xE119 = 0x777E
-0xE11A = 0x7821
-0xE11B = 0x7822
-0xE11C = 0x7823
-0xE11D = 0x7824
-0xE11E = 0x7825
-0xE11F = 0x7826
-0xE120 = 0x7827
-0xE121 = 0x7828
-0xE122 = 0x7829
-0xE123 = 0x782A
-0xE124 = 0x782B
-0xE125 = 0x782C
-0xE126 = 0x782D
-0xE127 = 0x782E
-0xE128 = 0x782F
-0xE129 = 0x7830
-0xE12A = 0x7831
-0xE12B = 0x7832
-0xE12C = 0x7833
-0xE12D = 0x7834
-0xE12E = 0x7835
-0xE12F = 0x7836
-0xE130 = 0x7837
-0xE131 = 0x7838
-0xE132 = 0x7839
-0xE133 = 0x783A
-0xE134 = 0x783B
-0xE135 = 0x783C
-0xE136 = 0x783D
-0xE137 = 0x783E
-0xE138 = 0x783F
-0xE139 = 0x7840
-0xE13A = 0x7841
-0xE13B = 0x7842
-0xE13C = 0x7843
-0xE13D = 0x7844
-0xE13E = 0x7845
-0xE13F = 0x7846
-0xE140 = 0x7847
-0xE141 = 0x7848
-0xE142 = 0x7849
-0xE143 = 0x784A
-0xE144 = 0x784B
-0xE145 = 0x784C
-0xE146 = 0x784D
-0xE147 = 0x784E
-0xE148 = 0x784F
-0xE149 = 0x7850
-0xE14A = 0x7851
-0xE14B = 0x7852
-0xE14C = 0x7853
-0xE14D = 0x7854
-0xE14E = 0x7855
-0xE14F = 0x7856
-0xE150 = 0x7857
-0xE151 = 0x7858
-0xE152 = 0x7859
-0xE153 = 0x785A
-0xE154 = 0x785B
-0xE155 = 0x785C
-0xE156 = 0x785D
-0xE157 = 0x785E
-0xE158 = 0x785F
-0xE159 = 0x7860
-0xE15A = 0x7861
-0xE15B = 0x7862
-0xE15C = 0x7863
-0xE15D = 0x7864
-0xE15E = 0x7865
-0xE15F = 0x7866
-0xE160 = 0x7867
-0xE161 = 0x7868
-0xE162 = 0x7869
-0xE163 = 0x786A
-0xE164 = 0x786B
-0xE165 = 0x786C
-0xE166 = 0x786D
-0xE167 = 0x786E
-0xE168 = 0x786F
-0xE169 = 0x7870
-0xE16A = 0x7871
-0xE16B = 0x7872
-0xE16C = 0x7873
-0xE16D = 0x7874
-0xE16E = 0x7875
-0xE16F = 0x7876
-0xE170 = 0x7877
-0xE171 = 0x7878
-0xE172 = 0x7879
-0xE173 = 0x787A
-0xE174 = 0x787B
-0xE175 = 0x787C
-0xE176 = 0x787D
-0xE177 = 0x787E
-0xE178 = 0x7921
-0xE179 = 0x7922
-0xE17A = 0x7923
-0xE17B = 0x7924
-0xE17C = 0x7925
-0xE17D = 0x7926
-0xE17E = 0x7927
-0xE17F = 0x7928
-0xE180 = 0x7929
-0xE181 = 0x792A
-0xE182 = 0x792B
-0xE183 = 0x792C
-0xE184 = 0x792D
-0xE185 = 0x792E
-0xE186 = 0x792F
-0xE187 = 0x7930
-0xE188 = 0x7931
-0xE189 = 0x7932
-0xE18A = 0x7933
-0xE18B = 0x7934
-0xE18C = 0x7935
-0xE18D = 0x7936
-0xE18E = 0x7937
-0xE18F = 0x7938
-0xE190 = 0x7939
-0xE191 = 0x793A
-0xE192 = 0x793B
-0xE193 = 0x793C
-0xE194 = 0x793D
-0xE195 = 0x793E
-0xE196 = 0x793F
-0xE197 = 0x7940
-0xE198 = 0x7941
-0xE199 = 0x7942
-0xE19A = 0x7943
-0xE19B = 0x7944
-0xE19C = 0x7945
-0xE19D = 0x7946
-0xE19E = 0x7947
-0xE19F = 0x7948
-0xE1A0 = 0x7949
-0xE1A1 = 0x794A
-0xE1A2 = 0x794B
-0xE1A3 = 0x794C
-0xE1A4 = 0x794D
-0xE1A5 = 0x794E
-0xE1A6 = 0x794F
-0xE1A7 = 0x7950
-0xE1A8 = 0x7951
-0xE1A9 = 0x7952
-0xE1AA = 0x7953
-0xE1AB = 0x7954
-0xE1AC = 0x7955
-0xE1AD = 0x7956
-0xE1AE = 0x7957
-0xE1AF = 0x7958
-0xE1B0 = 0x7959
-0xE1B1 = 0x795A
-0xE1B2 = 0x795B
-0xE1B3 = 0x795C
-0xE1B4 = 0x795D
-0xE1B5 = 0x795E
-0xE1B6 = 0x795F
-0xE1B7 = 0x7960
-0xE1B8 = 0x7961
-0xE1B9 = 0x7962
-0xE1BA = 0x7963
-0xE1BB = 0x7964
-0xE1BC = 0x7965
-0xE1BD = 0x7966
-0xE1BE = 0x7967
-0xE1BF = 0x7968
-0xE1C0 = 0x7969
-0xE1C1 = 0x796A
-0xE1C2 = 0x796B
-0xE1C3 = 0x796C
-0xE1C4 = 0x796D
-0xE1C5 = 0x796E
-0xE1C6 = 0x796F
-0xE1C7 = 0x7970
-0xE1C8 = 0x7971
-0xE1C9 = 0x7972
-0xE1CA = 0x7973
-0xE1CB = 0x7974
-0xE1CC = 0x7975
-0xE1CD = 0x7976
-0xE1CE = 0x7977
-0xE1CF = 0x7978
-0xE1D0 = 0x7979
-0xE1D1 = 0x797A
-0xE1D2 = 0x797B
-0xE1D3 = 0x797C
-0xE1D4 = 0x797D
-0xE1D5 = 0x797E
-0xE1D6 = 0x7A21
-0xE1D7 = 0x7A22
-0xE1D8 = 0x7A23
-0xE1D9 = 0x7A24
-0xE1DA = 0x7A25
-0xE1DB = 0x7A26
-0xE1DC = 0x7A27
-0xE1DD = 0x7A28
-0xE1DE = 0x7A29
-0xE1DF = 0x7A2A
-0xE1E0 = 0x7A2B
-0xE1E1 = 0x7A2C
-0xE1E2 = 0x7A2D
-0xE1E3 = 0x7A2E
-0xE1E4 = 0x7A2F
-0xE1E5 = 0x7A30
-0xE1E6 = 0x7A31
-0xE1E7 = 0x7A32
-0xE1E8 = 0x7A33
-0xE1E9 = 0x7A34
-0xE1EA = 0x7A35
-0xE1EB = 0x7A36
-0xE1EC = 0x7A37
-0xE1ED = 0x7A38
-0xE1EE = 0x7A39
-0xE1EF = 0x7A3A
-0xE1F0 = 0x7A3B
-0xE1F1 = 0x7A3C
-0xE1F2 = 0x7A3D
-0xE1F3 = 0x7A3E
-0xE1F4 = 0x7A3F
-0xE1F5 = 0x7A40
-0xE1F6 = 0x7A41
-0xE1F7 = 0x7A42
-0xE1F8 = 0x7A43
-0xE1F9 = 0x7A44
-0xE1FA = 0x7A45
-0xE1FB = 0x7A46
-0xE1FC = 0x7A47
-0xE1FD = 0x7A48
-0xE1FE = 0x7A49
-0xE1FF = 0x7A4A
-0xE200 = 0x7A4B
-0xE201 = 0x7A4C
-0xE202 = 0x7A4D
-0xE203 = 0x7A4E
-0xE204 = 0x7A4F
-0xE205 = 0x7A50
-0xE206 = 0x7A51
-0xE207 = 0x7A52
-0xE208 = 0x7A53
-0xE209 = 0x7A54
-0xE20A = 0x7A55
-0xE20B = 0x7A56
-0xE20C = 0x7A57
-0xE20D = 0x7A58
-0xE20E = 0x7A59
-0xE20F = 0x7A5A
-0xE210 = 0x7A5B
-0xE211 = 0x7A5C
-0xE212 = 0x7A5D
-0xE213 = 0x7A5E
-0xE214 = 0x7A5F
-0xE215 = 0x7A60
-0xE216 = 0x7A61
-0xE217 = 0x7A62
-0xE218 = 0x7A63
-0xE219 = 0x7A64
-0xE21A = 0x7A65
-0xE21B = 0x7A66
-0xE21C = 0x7A67
-0xE21D = 0x7A68
-0xE21E = 0x7A69
-0xE21F = 0x7A6A
-0xE220 = 0x7A6B
-0xE221 = 0x7A6C
-0xE222 = 0x7A6D
-0xE223 = 0x7A6E
-0xE224 = 0x7A6F
-0xE225 = 0x7A70
-0xE226 = 0x7A71
-0xE227 = 0x7A72
-0xE228 = 0x7A73
-0xE229 = 0x7A74
-0xE22A = 0x7A75
-0xE22B = 0x7A76
-0xE22C = 0x7A77
-0xE22D = 0x7A78
-0xE22E = 0x7A79
-0xE22F = 0x7A7A
-0xE230 = 0x7A7B
-0xE231 = 0x7A7C
-0xE232 = 0x7A7D
-0xE233 = 0x7A7E
-0xE234 = 0x7B21
-0xE235 = 0x7B22
-0xE236 = 0x7B23
-0xE237 = 0x7B24
-0xE238 = 0x7B25
-0xE239 = 0x7B26
-0xE23A = 0x7B27
-0xE23B = 0x7B28
-0xE23C = 0x7B29
-0xE23D = 0x7B2A
-0xE23E = 0x7B2B
-0xE23F = 0x7B2C
-0xE240 = 0x7B2D
-0xE241 = 0x7B2E
-0xE242 = 0x7B2F
-0xE243 = 0x7B30
-0xE244 = 0x7B31
-0xE245 = 0x7B32
-0xE246 = 0x7B33
-0xE247 = 0x7B34
-0xE248 = 0x7B35
-0xE249 = 0x7B36
-0xE24A = 0x7B37
-0xE24B = 0x7B38
-0xE24C = 0x7B39
-0xE24D = 0x7B3A
-0xE24E = 0x7B3B
-0xE24F = 0x7B3C
-0xE250 = 0x7B3D
-0xE251 = 0x7B3E
-0xE252 = 0x7B3F
-0xE253 = 0x7B40
-0xE254 = 0x7B41
-0xE255 = 0x7B42
-0xE256 = 0x7B43
-0xE257 = 0x7B44
-0xE258 = 0x7B45
-0xE259 = 0x7B46
-0xE25A = 0x7B47
-0xE25B = 0x7B48
-0xE25C = 0x7B49
-0xE25D = 0x7B4A
-0xE25E = 0x7B4B
-0xE25F = 0x7B4C
-0xE260 = 0x7B4D
-0xE261 = 0x7B4E
-0xE262 = 0x7B4F
-0xE263 = 0x7B50
-0xE264 = 0x7B51
-0xE265 = 0x7B52
-0xE266 = 0x7B53
-0xE267 = 0x7B54
-0xE268 = 0x7B55
-0xE269 = 0x7B56
-0xE26A = 0x7B57
-0xE26B = 0x7B58
-0xE26C = 0x7B59
-0xE26D = 0x7B5A
-0xE26E = 0x7B5B
-0xE26F = 0x7B5C
-0xE270 = 0x7B5D
-0xE271 = 0x7B5E
-0xE272 = 0x7B5F
-0xE273 = 0x7B60
-0xE274 = 0x7B61
-0xE275 = 0x7B62
-0xE276 = 0x7B63
-0xE277 = 0x7B64
-0xE278 = 0x7B65
-0xE279 = 0x7B66
-0xE27A = 0x7B67
-0xE27B = 0x7B68
-0xE27C = 0x7B69
-0xE27D = 0x7B6A
-0xE27E = 0x7B6B
-0xE27F = 0x7B6C
-0xE280 = 0x7B6D
-0xE281 = 0x7B6E
-0xE282 = 0x7B6F
-0xE283 = 0x7B70
-0xE284 = 0x7B71
-0xE285 = 0x7B72
-0xE286 = 0x7B73
-0xE287 = 0x7B74
-0xE288 = 0x7B75
-0xE289 = 0x7B76
-0xE28A = 0x7B77
-0xE28B = 0x7B78
-0xE28C = 0x7B79
-0xE28D = 0x7B7A
-0xE28E = 0x7B7B
-0xE28F = 0x7B7C
-0xE290 = 0x7B7D
-0xE291 = 0x7B7E
-0xE292 = 0x7C21
-0xE293 = 0x7C22
-0xE294 = 0x7C23
-0xE295 = 0x7C24
-0xE296 = 0x7C25
-0xE297 = 0x7C26
-0xE298 = 0x7C27
-0xE299 = 0x7C28
-0xE29A = 0x7C29
-0xE29B = 0x7C2A
-0xE29C = 0x7C2B
-0xE29D = 0x7C2C
-0xE29E = 0x7C2D
-0xE29F = 0x7C2E
-0xE2A0 = 0x7C2F
-0xE2A1 = 0x7C30
-0xE2A2 = 0x7C31
-0xE2A3 = 0x7C32
-0xE2A4 = 0x7C33
-0xE2A5 = 0x7C34
-0xE2A6 = 0x7C35
-0xE2A7 = 0x7C36
-0xE2A8 = 0x7C37
-0xE2A9 = 0x7C38
-0xE2AA = 0x7C39
-0xE2AB = 0x7C3A
-0xE2AC = 0x7C3B
-0xE2AD = 0x7C3C
-0xE2AE = 0x7C3D
-0xE2AF = 0x7C3E
-0xE2B0 = 0x7C3F
-0xE2B1 = 0x7C40
-0xE2B2 = 0x7C41
-0xE2B3 = 0x7C42
-0xE2B4 = 0x7C43
-0xE2B5 = 0x7C44
-0xE2B6 = 0x7C45
-0xE2B7 = 0x7C46
-0xE2B8 = 0x7C47
-0xE2B9 = 0x7C48
-0xE2BA = 0x7C49
-0xE2BB = 0x7C4A
-0xE2BC = 0x7C4B
-0xE2BD = 0x7C4C
-0xE2BE = 0x7C4D
-0xE2BF = 0x7C4E
-0xE2C0 = 0x7C4F
-0xE2C1 = 0x7C50
-0xE2C2 = 0x7C51
-0xE2C3 = 0x7C52
-0xE2C4 = 0x7C53
-0xE2C5 = 0x7C54
-0xE2C6 = 0x7C55
-0xE2C7 = 0x7C56
-0xE2C8 = 0x7C57
-0xE2C9 = 0x7C58
-0xE2CA = 0x7C59
-0xE2CB = 0x7C5A
-0xE2CC = 0x7C5B
-0xE2CD = 0x7C5C
-0xE2CE = 0x7C5D
-0xE2CF = 0x7C5E
-0xE2D0 = 0x7C5F
-0xE2D1 = 0x7C60
-0xE2D2 = 0x7C61
-0xE2D3 = 0x7C62
-0xE2D4 = 0x7C63
-0xE2D5 = 0x7C64
-0xE2D6 = 0x7C65
-0xE2D7 = 0x7C66
-0xE2D8 = 0x7C67
-0xE2D9 = 0x7C68
-0xE2DA = 0x7C69
-0xE2DB = 0x7C6A
-0xE2DC = 0x7C6B
-0xE2DD = 0x7C6C
-0xE2DE = 0x7C6D
-0xE2DF = 0x7C6E
-0xE2E0 = 0x7C6F
-0xE2E1 = 0x7C70
-0xE2E2 = 0x7C71
-0xE2E3 = 0x7C72
-0xE2E4 = 0x7C73
-0xE2E5 = 0x7C74
-0xE2E6 = 0x7C75
-0xE2E7 = 0x7C76
-0xE2E8 = 0x7C77
-0xE2E9 = 0x7C78
-0xE2EA = 0x7C79
-0xE2EB = 0x7C7A
-0xE2EC = 0x7C7B
-0xE2ED = 0x7C7C
-0xE2EE = 0x7C7D
-0xE2EF = 0x7C7E
-0xE2F0 = 0x7D21
-0xE2F1 = 0x7D22
-0xE2F2 = 0x7D23
-0xE2F3 = 0x7D24
-0xE2F4 = 0x7D25
-0xE2F5 = 0x7D26
-0xE2F6 = 0x7D27
-0xE2F7 = 0x7D28
-0xE2F8 = 0x7D29
-0xE2F9 = 0x7D2A
-0xE2FA = 0x7D2B
-0xE2FB = 0x7D2C
-0xE2FC = 0x7D2D
-0xE2FD = 0x7D2E
-0xE2FE = 0x7D2F
-0xE2FF = 0x7D30
-0xE300 = 0x7D31
-0xE301 = 0x7D32
-0xE302 = 0x7D33
-0xE303 = 0x7D34
-0xE304 = 0x7D35
-0xE305 = 0x7D36
-0xE306 = 0x7D37
-0xE307 = 0x7D38
-0xE308 = 0x7D39
-0xE309 = 0x7D3A
-0xE30A = 0x7D3B
-0xE30B = 0x7D3C
-0xE30C = 0x7D3D
-0xE30D = 0x7D3E
-0xE30E = 0x7D3F
-0xE30F = 0x7D40
-0xE310 = 0x7D41
-0xE311 = 0x7D42
-0xE312 = 0x7D43
-0xE313 = 0x7D44
-0xE314 = 0x7D45
-0xE315 = 0x7D46
-0xE316 = 0x7D47
-0xE317 = 0x7D48
-0xE318 = 0x7D49
-0xE319 = 0x7D4A
-0xE31A = 0x7D4B
-0xE31B = 0x7D4C
-0xE31C = 0x7D4D
-0xE31D = 0x7D4E
-0xE31E = 0x7D4F
-0xE31F = 0x7D50
-0xE320 = 0x7D51
-0xE321 = 0x7D52
-0xE322 = 0x7D53
-0xE323 = 0x7D54
-0xE324 = 0x7D55
-0xE325 = 0x7D56
-0xE326 = 0x7D57
-0xE327 = 0x7D58
-0xE328 = 0x7D59
-0xE329 = 0x7D5A
-0xE32A = 0x7D5B
-0xE32B = 0x7D5C
-0xE32C = 0x7D5D
-0xE32D = 0x7D5E
-0xE32E = 0x7D5F
-0xE32F = 0x7D60
-0xE330 = 0x7D61
-0xE331 = 0x7D62
-0xE332 = 0x7D63
-0xE333 = 0x7D64
-0xE334 = 0x7D65
-0xE335 = 0x7D66
-0xE336 = 0x7D67
-0xE337 = 0x7D68
-0xE338 = 0x7D69
-0xE339 = 0x7D6A
-0xE33A = 0x7D6B
-0xE33B = 0x7D6C
-0xE33C = 0x7D6D
-0xE33D = 0x7D6E
-0xE33E = 0x7D6F
-0xE33F = 0x7D70
-0xE340 = 0x7D71
-0xE341 = 0x7D72
-0xE342 = 0x7D73
-0xE343 = 0x7D74
-0xE344 = 0x7D75
-0xE345 = 0x7D76
-0xE346 = 0x7D77
-0xE347 = 0x7D78
-0xE348 = 0x7D79
-0xE349 = 0x7D7A
-0xE34A = 0x7D7B
-0xE34B = 0x7D7C
-0xE34C = 0x7D7D
-0xE34D = 0x7D7E
-0xE34E = 0x7E21
-0xE34F = 0x7E22
-0xE350 = 0x7E23
-0xE351 = 0x7E24
-0xE352 = 0x7E25
-0xE353 = 0x7E26
-0xE354 = 0x7E27
-0xE355 = 0x7E28
-0xE356 = 0x7E29
-0xE357 = 0x7E2A
-0xE358 = 0x7E2B
-0xE359 = 0x7E2C
-0xE35A = 0x7E2D
-0xE35B = 0x7E2E
-0xE35C = 0x7E2F
-0xE35D = 0x7E30
-0xE35E = 0x7E31
-0xE35F = 0x7E32
-0xE360 = 0x7E33
-0xE361 = 0x7E34
-0xE362 = 0x7E35
-0xE363 = 0x7E36
-0xE364 = 0x7E37
-0xE365 = 0x7E38
-0xE366 = 0x7E39
-0xE367 = 0x7E3A
-0xE368 = 0x7E3B
-0xE369 = 0x7E3C
-0xE36A = 0x7E3D
-0xE36B = 0x7E3E
-0xE36C = 0x7E3F
-0xE36D = 0x7E40
-0xE36E = 0x7E41
-0xE36F = 0x7E42
-0xE370 = 0x7E43
-0xE371 = 0x7E44
-0xE372 = 0x7E45
-0xE373 = 0x7E46
-0xE374 = 0x7E47
-0xE375 = 0x7E48
-0xE376 = 0x7E49
-0xE377 = 0x7E4A
-0xE378 = 0x7E4B
-0xE379 = 0x7E4C
-0xE37A = 0x7E4D
-0xE37B = 0x7E4E
-0xE37C = 0x7E4F
-0xE37D = 0x7E50
-0xE37E = 0x7E51
-0xE37F = 0x7E52
-0xE380 = 0x7E53
-0xE381 = 0x7E54
-0xE382 = 0x7E55
-0xE383 = 0x7E56
-0xE384 = 0x7E57
-0xE385 = 0x7E58
-0xE386 = 0x7E59
-0xE387 = 0x7E5A
-0xE388 = 0x7E5B
-0xE389 = 0x7E5C
-0xE38A = 0x7E5D
-0xE38B = 0x7E5E
-0xE38C = 0x7E5F
-0xE38D = 0x7E60
-0xE38E = 0x7E61
-0xE38F = 0x7E62
-0xE390 = 0x7E63
-0xE391 = 0x7E64
-0xE392 = 0x7E65
-0xE393 = 0x7E66
-0xE394 = 0x7E67
-0xE395 = 0x7E68
-0xE396 = 0x7E69
-0xE397 = 0x7E6A
-0xE398 = 0x7E6B
-0xE399 = 0x7E6C
-0xE39A = 0x7E6D
-0xE39B = 0x7E6E
-0xE39C = 0x7E6F
-0xE39D = 0x7E70
-0xE39E = 0x7E71
-0xE39F = 0x7E72
-0xE3A0 = 0x7E73
-0xE3A1 = 0x7E74
-0xE3A2 = 0x7E75
-0xE3A3 = 0x7E76
-0xE3A4 = 0x7E77
-0xE3A5 = 0x7E78
-0xE3A6 = 0x7E79
-0xE3A7 = 0x7E7A
-0xE3A8 = 0x7E7B
-0xE3A9 = 0x7E7C
-0xE3AA = 0x7E7D
-0xE3AB = 0x7E7E
-END_MAP
diff --git a/enc/trans/JIS/UCS%JISX0208VDC@NEC.src b/enc/trans/JIS/UCS%JISX0208VDC@NEC.src
deleted file mode 100644
index d91f0bd2d8..0000000000
--- a/enc/trans/JIS/UCS%JISX0208VDC@NEC.src
+++ /dev/null
@@ -1,98 +0,0 @@
-# $NetBSD: UCS%JISX0208VDC@NEC.src,v 1.1 2003/07/19 20:20:42 tshiozak Exp $
-
-TYPE ROWCOL
-NAME "UCS/JISX0208VDC:NEC"
-SRC_ZONE 0x2116 - 0x33CD
-OOB_MODE INVALID
-DST_INVALID 0xFFFF
-DST_UNIT_BITS 16
-
-BEGIN_MAP
-0x2116 - 0x33CD = INVALID
-#
-# This data is derived from http://www.opengroup.or.jp/jvc/cde/
-#
-0x2116 = 0x2D62
-0x2121 = 0x2D64
-0x2160 = 0x2D35
-0x2161 = 0x2D36
-0x2162 = 0x2D37
-0x2163 = 0x2D38
-0x2164 = 0x2D39
-0x2165 = 0x2D3A
-0x2166 = 0x2D3B
-0x2167 = 0x2D3C
-0x2168 = 0x2D3D
-0x2169 = 0x2D3E
-0x2211 = 0x2D74
-0x221A = 0x2D75
-0x221F = 0x2D78
-0x2220 = 0x2D77
-0x2229 = 0x2D7B
-0x222A = 0x2D7C
-0x222B = 0x2D72
-0x222E = 0x2D73
-0x2235 = 0x2D7A
-0x2252 = 0x2D70
-0x2261 = 0x2D71
-0x22A5 = 0x2D76
-0x22BF = 0x2D79
-0x2460 = 0x2D21
-0x2461 = 0x2D22
-0x2462 = 0x2D23
-0x2463 = 0x2D24
-0x2464 = 0x2D25
-0x2465 = 0x2D26
-0x2466 = 0x2D27
-0x2467 = 0x2D28
-0x2468 = 0x2D29
-0x2469 = 0x2D2A
-0x246A = 0x2D2B
-0x246B = 0x2D2C
-0x246C = 0x2D2D
-0x246D = 0x2D2E
-0x246E = 0x2D2F
-0x246F = 0x2D30
-0x2470 = 0x2D31
-0x2471 = 0x2D32
-0x2472 = 0x2D33
-0x2473 = 0x2D34
-0x301D = 0x2D60
-0x301F = 0x2D61
-0x3231 = 0x2D6A
-0x3232 = 0x2D6B
-0x3239 = 0x2D6C
-0x32A4 = 0x2D65
-0x32A5 = 0x2D66
-0x32A6 = 0x2D67
-0x32A7 = 0x2D68
-0x32A8 = 0x2D69
-0x3303 = 0x2D46
-0x330D = 0x2D4A
-0x3314 = 0x2D41
-0x3318 = 0x2D44
-0x3322 = 0x2D42
-0x3323 = 0x2D4C
-0x3326 = 0x2D4B
-0x3327 = 0x2D45
-0x332B = 0x2D4D
-0x3336 = 0x2D47
-0x333B = 0x2D4F
-0x3349 = 0x2D40
-0x334A = 0x2D4E
-0x334D = 0x2D43
-0x3351 = 0x2D48
-0x3357 = 0x2D49
-0x337B = 0x2D5F
-0x337C = 0x2D6F
-0x337D = 0x2D6E
-0x337E = 0x2D6D
-0x338E = 0x2D53
-0x338F = 0x2D54
-0x339C = 0x2D50
-0x339D = 0x2D51
-0x339E = 0x2D52
-0x33A1 = 0x2D56
-0x33C4 = 0x2D55
-0x33CD = 0x2D63
-END_MAP
diff --git a/enc/trans/JIS/UCS%JISX0212.src b/enc/trans/JIS/UCS%JISX0212.src
deleted file mode 100644
index f3b2e7089b..0000000000
--- a/enc/trans/JIS/UCS%JISX0212.src
+++ /dev/null
@@ -1,6170 +0,0 @@
-# $NetBSD: UCS%JISX0212.src,v 1.3 2003/07/14 06:03:43 tshiozak Exp $
-
-TYPE ROWCOL
-NAME "UCS/JISX0212"
-SRC_ZONE 0x0000 - 0x9FFF
-OOB_MODE INVALID
-DST_INVALID 0xFFFF
-DST_UNIT_BITS 16
-
-BEGIN_MAP
-#
-# This mapping data is made from the mapping data provided by Unicode, Inc.
-# Original notice:
-#
-# Name: JIS X 0212 (1990) to Unicode
-# Unicode version: 1.1
-# Table version: 0.9
-# Table format: Format A
-# Date: 8 March 1994
-#
-# Copyright (c) 1991-1994 Unicode, Inc. All Rights reserved.
-#
-# This file is provided as-is by Unicode, Inc. (The Unicode Consortium).
-# No claims are made as to fitness for any particular purpose. No
-# warranties of any kind are expressed or implied. The recipient
-# agrees to determine applicability of information provided. If this
-# file has been provided on magnetic media by Unicode, Inc., the sole
-# remedy for any claim will be exchange of defective media within 90
-# days of receipt.
-#
-# Recipient is granted the right to make copies in any form for
-# internal distribution and to freely use the information supplied
-# in the creation of products supporting Unicode. Unicode, Inc.
-# specifically excludes the right to re-distribute this file directly
-# to third parties or other organizations whether for profit or not.
-#
-# General notes:
-#
-#
-# This table contains one set of mappings from JIS X 0212 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 JIS X 0212 and Unicode, consult the
-# VENDORS mapping data. Normative information on the mapping between
-# JIS X 0212 and Unicode may be found in the Unihan.txt file in the
-# latest Unicode Character Database.
-#
-# If you have carefully considered the fact that the mappings in
-# this table are only one possible set of mappings between JIS X 0212 and
-# Unicode and have no normative status, but still feel that you
-# have located an error in the table that requires fixing, you may
-# report any such error to errata@unicode.org.
-#
-#
-# Format: Three tab-separated columns
-# Column #1 is the JIS X 0212 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 JIS X 0212 order
-#
-# The following algorithms can be used to change the hex form
-# of JIS 0212 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;
-# 0x6D63 -> 0x4D43 -> 7767
-#
-# The kanji mappings are a normative part of ISO/IEC 10646. The
-# non-kanji mappings are provisional, pending definition of
-# official mappings by Japanese standards bodies
-#
-# Any comments or problems, contact <John_Jenkins@taligent.com>
-#
-# Notes:
-#
-# 1. JIS X 0212 apparently unified the following two symbols
-# into a single character at 0x2922:
-#
-# LATIN CAPITAL LETTER D WITH STROKE
-# LATIN CAPITAL LETTER ETH
-#
-# However, JIS X 0212 maintains the distinction between
-# the lowercase forms of these two elements at 0x2942 and 0x2943.
-# 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.
-#
-# Ruby specific modification:
-# remove 0x007E to 0x2237 conversion.
-#
-# 0x007E = 0x2237
-0x00A1 = 0x2242
-0x00A4 = 0x2270
-0x00A6 = 0x2243
-0x00A9 = 0x226D
-0x00AA = 0x226C
-0x00AE = 0x226E
-0x00AF = 0x2234
-0x00B8 = 0x2231
-0x00BA = 0x226B
-0x00BF = 0x2244
-0x00C0 = 0x2A22
-0x00C1 = 0x2A21
-0x00C2 = 0x2A24
-0x00C3 = 0x2A2A
-0x00C4 = 0x2A23
-0x00C5 = 0x2A29
-0x00C6 = 0x2921
-0x00C7 = 0x2A2E
-0x00C8 = 0x2A32
-0x00C9 = 0x2A31
-0x00CA = 0x2A34
-0x00CB = 0x2A33
-0x00CC = 0x2A40
-0x00CD = 0x2A3F
-0x00CE = 0x2A42
-0x00CF = 0x2A41
-0x00D1 = 0x2A50
-0x00D2 = 0x2A52
-0x00D3 = 0x2A51
-0x00D4 = 0x2A54
-0x00D5 = 0x2A58
-0x00D6 = 0x2A53
-0x00D8 = 0x292C
-0x00D9 = 0x2A63
-0x00DA = 0x2A62
-0x00DB = 0x2A65
-0x00DC = 0x2A64
-0x00DD = 0x2A72
-0x00DE = 0x2930
-0x00DF = 0x294E
-0x00E0 = 0x2B22
-0x00E1 = 0x2B21
-0x00E2 = 0x2B24
-0x00E3 = 0x2B2A
-0x00E4 = 0x2B23
-0x00E5 = 0x2B29
-0x00E6 = 0x2941
-0x00E7 = 0x2B2E
-0x00E8 = 0x2B32
-0x00E9 = 0x2B31
-0x00EA = 0x2B34
-0x00EB = 0x2B33
-0x00EC = 0x2B40
-0x00ED = 0x2B3F
-0x00EE = 0x2B42
-0x00EF = 0x2B41
-0x00F0 = 0x2943
-0x00F1 = 0x2B50
-0x00F2 = 0x2B52
-0x00F3 = 0x2B51
-0x00F4 = 0x2B54
-0x00F5 = 0x2B58
-0x00F6 = 0x2B53
-0x00F8 = 0x294C
-0x00F9 = 0x2B63
-0x00FA = 0x2B62
-0x00FB = 0x2B65
-0x00FC = 0x2B64
-0x00FD = 0x2B72
-0x00FE = 0x2950
-0x00FF = 0x2B73
-0x0100 = 0x2A27
-0x0101 = 0x2B27
-0x0102 = 0x2A25
-0x0103 = 0x2B25
-0x0104 = 0x2A28
-0x0105 = 0x2B28
-0x0106 = 0x2A2B
-0x0107 = 0x2B2B
-0x0108 = 0x2A2C
-0x0109 = 0x2B2C
-0x010A = 0x2A2F
-0x010B = 0x2B2F
-0x010C = 0x2A2D
-0x010D = 0x2B2D
-0x010E = 0x2A30
-0x010F = 0x2B30
-0x0110 = 0x2922
-0x0111 = 0x2942
-0x0112 = 0x2A37
-0x0113 = 0x2B37
-0x0116 = 0x2A36
-0x0117 = 0x2B36
-0x0118 = 0x2A38
-0x0119 = 0x2B38
-0x011A = 0x2A35
-0x011B = 0x2B35
-0x011C = 0x2A3A
-0x011D = 0x2B3A
-0x011E = 0x2A3B
-0x011F = 0x2B3B
-0x0120 = 0x2A3D
-0x0121 = 0x2B3D
-0x0122 = 0x2A3C
-0x0124 = 0x2A3E
-0x0125 = 0x2B3E
-0x0126 = 0x2924
-0x0127 = 0x2944
-0x0128 = 0x2A47
-0x0129 = 0x2B47
-0x012A = 0x2A45
-0x012B = 0x2B45
-0x012E = 0x2A46
-0x012F = 0x2B46
-0x0130 = 0x2A44
-0x0131 = 0x2945
-0x0132 = 0x2926
-0x0133 = 0x2946
-0x0134 = 0x2A48
-0x0135 = 0x2B48
-0x0136 = 0x2A49
-0x0137 = 0x2B49
-0x0138 = 0x2947
-0x0139 = 0x2A4A
-0x013A = 0x2B4A
-0x013B = 0x2A4C
-0x013C = 0x2B4C
-0x013D = 0x2A4B
-0x013E = 0x2B4B
-0x013F = 0x2929
-0x0140 = 0x2949
-0x0141 = 0x2928
-0x0142 = 0x2948
-0x0143 = 0x2A4D
-0x0144 = 0x2B4D
-0x0145 = 0x2A4F
-0x0146 = 0x2B4F
-0x0147 = 0x2A4E
-0x0148 = 0x2B4E
-0x0149 = 0x294A
-0x014A = 0x292B
-0x014B = 0x294B
-0x014C = 0x2A57
-0x014D = 0x2B57
-0x0150 = 0x2A56
-0x0151 = 0x2B56
-0x0152 = 0x292D
-0x0153 = 0x294D
-0x0154 = 0x2A59
-0x0155 = 0x2B59
-0x0156 = 0x2A5B
-0x0157 = 0x2B5B
-0x0158 = 0x2A5A
-0x0159 = 0x2B5A
-0x015A = 0x2A5C
-0x015B = 0x2B5C
-0x015C = 0x2A5D
-0x015D = 0x2B5D
-0x015E = 0x2A5F
-0x015F = 0x2B5F
-0x0160 = 0x2A5E
-0x0161 = 0x2B5E
-0x0162 = 0x2A61
-0x0163 = 0x2B61
-0x0164 = 0x2A60
-0x0165 = 0x2B60
-0x0166 = 0x292F
-0x0167 = 0x294F
-0x0168 = 0x2A6C
-0x0169 = 0x2B6C
-0x016A = 0x2A69
-0x016B = 0x2B69
-0x016C = 0x2A66
-0x016D = 0x2B66
-0x016E = 0x2A6B
-0x016F = 0x2B6B
-0x0170 = 0x2A68
-0x0171 = 0x2B68
-0x0172 = 0x2A6A
-0x0173 = 0x2B6A
-0x0174 = 0x2A71
-0x0175 = 0x2B71
-0x0176 = 0x2A74
-0x0177 = 0x2B74
-0x0178 = 0x2A73
-0x0179 = 0x2A75
-0x017A = 0x2B75
-0x017B = 0x2A77
-0x017C = 0x2B77
-0x017D = 0x2A76
-0x017E = 0x2B76
-0x01CD = 0x2A26
-0x01CE = 0x2B26
-0x01CF = 0x2A43
-0x01D0 = 0x2B43
-0x01D1 = 0x2A55
-0x01D2 = 0x2B55
-0x01D3 = 0x2A67
-0x01D4 = 0x2B67
-0x01D5 = 0x2A70
-0x01D6 = 0x2B70
-0x01D7 = 0x2A6D
-0x01D8 = 0x2B6D
-0x01D9 = 0x2A6F
-0x01DA = 0x2B6F
-0x01DB = 0x2A6E
-0x01DC = 0x2B6E
-0x01F5 = 0x2B39
-0x02C7 = 0x2230
-0x02D8 = 0x222F
-0x02D9 = 0x2232
-0x02DA = 0x2236
-0x02DB = 0x2235
-0x02DD = 0x2233
-0x0384 = 0x2238
-0x0385 = 0x2239
-0x0386 = 0x2661
-0x0388 = 0x2662
-0x0389 = 0x2663
-0x038A = 0x2664
-0x038C = 0x2667
-0x038E = 0x2669
-0x038F = 0x266C
-0x0390 = 0x2676
-0x03AA = 0x2665
-0x03AB = 0x266A
-0x03AC = 0x2671
-0x03AD = 0x2672
-0x03AE = 0x2673
-0x03AF = 0x2674
-0x03B0 = 0x267B
-0x03C2 = 0x2678
-0x03CA = 0x2675
-0x03CB = 0x267A
-0x03CC = 0x2677
-0x03CD = 0x2679
-0x03CE = 0x267C
-0x0402 = 0x2742
-0x0403 = 0x2743
-0x0404 = 0x2744
-0x0405 = 0x2745
-0x0406 = 0x2746
-0x0407 = 0x2747
-0x0408 = 0x2748
-0x0409 = 0x2749
-0x040A = 0x274A
-0x040B = 0x274B
-0x040C = 0x274C
-0x040E = 0x274D
-0x040F = 0x274E
-0x0452 = 0x2772
-0x0453 = 0x2773
-0x0454 = 0x2774
-0x0455 = 0x2775
-0x0456 = 0x2776
-0x0457 = 0x2777
-0x0458 = 0x2778
-0x0459 = 0x2779
-0x045A = 0x277A
-0x045B = 0x277B
-0x045C = 0x277C
-0x045E = 0x277D
-0x045F = 0x277E
-0x2116 = 0x2271
-0x2122 = 0x226F
-0x4E02 = 0x3021
-0x4E04 = 0x3022
-0x4E05 = 0x3023
-0x4E0C = 0x3024
-0x4E12 = 0x3025
-0x4E1F = 0x3026
-0x4E23 = 0x3027
-0x4E24 = 0x3028
-0x4E28 = 0x3029
-0x4E2B = 0x302A
-0x4E2E = 0x302B
-0x4E2F = 0x302C
-0x4E30 = 0x302D
-0x4E35 = 0x302E
-0x4E40 = 0x302F
-0x4E41 = 0x3030
-0x4E44 = 0x3031
-0x4E47 = 0x3032
-0x4E51 = 0x3033
-0x4E5A = 0x3034
-0x4E5C = 0x3035
-0x4E63 = 0x3036
-0x4E68 = 0x3037
-0x4E69 = 0x3038
-0x4E74 = 0x3039
-0x4E75 = 0x303A
-0x4E79 = 0x303B
-0x4E7F = 0x303C
-0x4E8D = 0x303D
-0x4E96 = 0x303E
-0x4E97 = 0x303F
-0x4E9D = 0x3040
-0x4EAF = 0x3041
-0x4EB9 = 0x3042
-0x4EC3 = 0x3043
-0x4ED0 = 0x3044
-0x4EDA = 0x3045
-0x4EDB = 0x3046
-0x4EE0 = 0x3047
-0x4EE1 = 0x3048
-0x4EE2 = 0x3049
-0x4EE8 = 0x304A
-0x4EEF = 0x304B
-0x4EF1 = 0x304C
-0x4EF3 = 0x304D
-0x4EF5 = 0x304E
-0x4EFD = 0x304F
-0x4EFE = 0x3050
-0x4EFF = 0x3051
-0x4F00 = 0x3052
-0x4F02 = 0x3053
-0x4F03 = 0x3054
-0x4F08 = 0x3055
-0x4F0B = 0x3056
-0x4F0C = 0x3057
-0x4F12 = 0x3058
-0x4F15 = 0x3059
-0x4F16 = 0x305A
-0x4F17 = 0x305B
-0x4F19 = 0x305C
-0x4F2E = 0x305D
-0x4F31 = 0x305E
-0x4F33 = 0x3060
-0x4F35 = 0x3061
-0x4F37 = 0x3062
-0x4F39 = 0x3063
-0x4F3B = 0x3064
-0x4F3E = 0x3065
-0x4F40 = 0x3066
-0x4F42 = 0x3067
-0x4F48 = 0x3068
-0x4F49 = 0x3069
-0x4F4B = 0x306A
-0x4F4C = 0x306B
-0x4F52 = 0x306C
-0x4F54 = 0x306D
-0x4F56 = 0x306E
-0x4F58 = 0x306F
-0x4F5F = 0x3070
-0x4F60 = 0x305F
-0x4F63 = 0x3071
-0x4F6A = 0x3072
-0x4F6C = 0x3073
-0x4F6E = 0x3074
-0x4F71 = 0x3075
-0x4F77 = 0x3076
-0x4F78 = 0x3077
-0x4F79 = 0x3078
-0x4F7A = 0x3079
-0x4F7D = 0x307A
-0x4F7E = 0x307B
-0x4F81 = 0x307C
-0x4F82 = 0x307D
-0x4F84 = 0x307E
-0x4F85 = 0x3121
-0x4F89 = 0x3122
-0x4F8A = 0x3123
-0x4F8C = 0x3124
-0x4F8E = 0x3125
-0x4F90 = 0x3126
-0x4F92 = 0x3127
-0x4F93 = 0x3128
-0x4F94 = 0x3129
-0x4F97 = 0x312A
-0x4F99 = 0x312B
-0x4F9A = 0x312C
-0x4F9E = 0x312D
-0x4F9F = 0x312E
-0x4FB2 = 0x312F
-0x4FB7 = 0x3130
-0x4FB9 = 0x3131
-0x4FBB = 0x3132
-0x4FBC = 0x3133
-0x4FBD = 0x3134
-0x4FBE = 0x3135
-0x4FC0 = 0x3136
-0x4FC1 = 0x3137
-0x4FC5 = 0x3138
-0x4FC6 = 0x3139
-0x4FC8 = 0x313A
-0x4FC9 = 0x313B
-0x4FCB = 0x313C
-0x4FCC = 0x313D
-0x4FCD = 0x313E
-0x4FCF = 0x313F
-0x4FD2 = 0x3140
-0x4FDC = 0x3141
-0x4FE0 = 0x3142
-0x4FE2 = 0x3143
-0x4FF0 = 0x3144
-0x4FF2 = 0x3145
-0x4FFC = 0x3146
-0x4FFD = 0x3147
-0x4FFF = 0x3148
-0x5000 = 0x3149
-0x5001 = 0x314A
-0x5004 = 0x314B
-0x5007 = 0x314C
-0x500A = 0x314D
-0x500C = 0x314E
-0x500E = 0x314F
-0x5010 = 0x3150
-0x5013 = 0x3151
-0x5017 = 0x3152
-0x5018 = 0x3153
-0x501B = 0x3154
-0x501C = 0x3155
-0x501D = 0x3156
-0x501E = 0x3157
-0x5022 = 0x3158
-0x5027 = 0x3159
-0x502E = 0x315A
-0x5030 = 0x315B
-0x5032 = 0x315C
-0x5033 = 0x315D
-0x5035 = 0x315E
-0x503B = 0x3176
-0x5040 = 0x315F
-0x5041 = 0x3160
-0x5042 = 0x3161
-0x5045 = 0x3162
-0x5046 = 0x3163
-0x504A = 0x3164
-0x504C = 0x3165
-0x504E = 0x3166
-0x5051 = 0x3167
-0x5052 = 0x3168
-0x5053 = 0x3169
-0x5057 = 0x316A
-0x5059 = 0x316B
-0x505F = 0x316C
-0x5060 = 0x316D
-0x5062 = 0x316E
-0x5063 = 0x316F
-0x5066 = 0x3170
-0x5067 = 0x3171
-0x506A = 0x3172
-0x506D = 0x3173
-0x5070 = 0x3174
-0x5071 = 0x3175
-0x5081 = 0x3177
-0x5083 = 0x3178
-0x5084 = 0x3179
-0x5086 = 0x317A
-0x508A = 0x317B
-0x508E = 0x317C
-0x508F = 0x317D
-0x5090 = 0x317E
-0x5092 = 0x3221
-0x5093 = 0x3222
-0x5094 = 0x3223
-0x5096 = 0x3224
-0x509B = 0x3225
-0x509C = 0x3226
-0x509E = 0x3227
-0x509F = 0x3228
-0x50A0 = 0x3229
-0x50A1 = 0x322A
-0x50A2 = 0x322B
-0x50AA = 0x322C
-0x50AF = 0x322D
-0x50B0 = 0x322E
-0x50B9 = 0x322F
-0x50BA = 0x3230
-0x50BD = 0x3231
-0x50C0 = 0x3232
-0x50C3 = 0x3233
-0x50C4 = 0x3234
-0x50C7 = 0x3235
-0x50CC = 0x3236
-0x50CE = 0x3237
-0x50D0 = 0x3238
-0x50D3 = 0x3239
-0x50D4 = 0x323A
-0x50D8 = 0x323B
-0x50DC = 0x323C
-0x50DD = 0x323D
-0x50DF = 0x323E
-0x50E2 = 0x323F
-0x50E4 = 0x3240
-0x50E6 = 0x3241
-0x50E8 = 0x3242
-0x50E9 = 0x3243
-0x50EF = 0x3244
-0x50F1 = 0x3245
-0x50F2 = 0x3251
-0x50F6 = 0x3246
-0x50FA = 0x3247
-0x50FE = 0x3248
-0x5103 = 0x3249
-0x5106 = 0x324A
-0x5107 = 0x324B
-0x5108 = 0x324C
-0x510B = 0x324D
-0x510C = 0x324E
-0x510D = 0x324F
-0x510E = 0x3250
-0x5110 = 0x3252
-0x5117 = 0x3253
-0x5119 = 0x3254
-0x511B = 0x3255
-0x511C = 0x3256
-0x511D = 0x3257
-0x511E = 0x3258
-0x5123 = 0x3259
-0x5127 = 0x325A
-0x5128 = 0x325B
-0x512C = 0x325C
-0x512D = 0x325D
-0x512F = 0x325E
-0x5131 = 0x325F
-0x5133 = 0x3260
-0x5134 = 0x3261
-0x5135 = 0x3262
-0x5138 = 0x3263
-0x5139 = 0x3264
-0x5142 = 0x3265
-0x514A = 0x3266
-0x514F = 0x3267
-0x5153 = 0x3268
-0x5155 = 0x3269
-0x5157 = 0x326A
-0x5158 = 0x326B
-0x515F = 0x326C
-0x5164 = 0x326D
-0x5166 = 0x326E
-0x517E = 0x326F
-0x5183 = 0x3270
-0x5184 = 0x3271
-0x518B = 0x3272
-0x518E = 0x3273
-0x5198 = 0x3274
-0x519D = 0x3275
-0x51A1 = 0x3276
-0x51A3 = 0x3277
-0x51AD = 0x3278
-0x51B8 = 0x3279
-0x51BA = 0x327A
-0x51BC = 0x327B
-0x51BE = 0x327C
-0x51BF = 0x327D
-0x51C2 = 0x327E
-0x51C8 = 0x3321
-0x51CF = 0x3322
-0x51D1 = 0x3323
-0x51D2 = 0x3324
-0x51D3 = 0x3325
-0x51D5 = 0x3326
-0x51D8 = 0x3327
-0x51DE = 0x3328
-0x51E2 = 0x3329
-0x51E5 = 0x332A
-0x51EE = 0x332B
-0x51F2 = 0x332C
-0x51F3 = 0x332D
-0x51F4 = 0x332E
-0x51F7 = 0x332F
-0x5201 = 0x3330
-0x5202 = 0x3331
-0x5205 = 0x3332
-0x5212 = 0x3333
-0x5213 = 0x3334
-0x5215 = 0x3335
-0x5216 = 0x3336
-0x5218 = 0x3337
-0x5222 = 0x3338
-0x5228 = 0x3339
-0x5231 = 0x333A
-0x5232 = 0x333B
-0x5235 = 0x333C
-0x523C = 0x333D
-0x5245 = 0x333E
-0x5249 = 0x333F
-0x5255 = 0x3340
-0x5257 = 0x3341
-0x5258 = 0x3342
-0x525A = 0x3343
-0x525C = 0x3344
-0x525F = 0x3345
-0x5260 = 0x3346
-0x5261 = 0x3347
-0x5266 = 0x3348
-0x526E = 0x3349
-0x5277 = 0x334A
-0x5278 = 0x334B
-0x5279 = 0x334C
-0x5280 = 0x334D
-0x5282 = 0x334E
-0x5285 = 0x334F
-0x528A = 0x3350
-0x528C = 0x3351
-0x5293 = 0x3352
-0x5295 = 0x3353
-0x5296 = 0x3354
-0x5297 = 0x3355
-0x5298 = 0x3356
-0x529A = 0x3357
-0x529C = 0x3358
-0x52A4 = 0x3359
-0x52A5 = 0x335A
-0x52A6 = 0x335B
-0x52A7 = 0x335C
-0x52AF = 0x335D
-0x52B0 = 0x335E
-0x52B6 = 0x335F
-0x52B7 = 0x3360
-0x52B8 = 0x3361
-0x52BA = 0x3362
-0x52BB = 0x3363
-0x52BD = 0x3364
-0x52C0 = 0x3365
-0x52C4 = 0x3366
-0x52C6 = 0x3367
-0x52C8 = 0x3368
-0x52CC = 0x3369
-0x52CF = 0x336A
-0x52D1 = 0x336B
-0x52D4 = 0x336C
-0x52D6 = 0x336D
-0x52DB = 0x336E
-0x52DC = 0x336F
-0x52E1 = 0x3370
-0x52E5 = 0x3371
-0x52E8 = 0x3372
-0x52E9 = 0x3373
-0x52EA = 0x3374
-0x52EC = 0x3375
-0x52F0 = 0x3376
-0x52F1 = 0x3377
-0x52F4 = 0x3378
-0x52F6 = 0x3379
-0x52F7 = 0x337A
-0x5300 = 0x337B
-0x5303 = 0x337C
-0x530A = 0x337D
-0x530B = 0x337E
-0x530C = 0x3421
-0x5311 = 0x3422
-0x5313 = 0x3423
-0x5318 = 0x3424
-0x531B = 0x3425
-0x531C = 0x3426
-0x531E = 0x3427
-0x531F = 0x3428
-0x5325 = 0x3429
-0x5327 = 0x342A
-0x5328 = 0x342B
-0x5329 = 0x342C
-0x532B = 0x342D
-0x532C = 0x342E
-0x532D = 0x342F
-0x5330 = 0x3430
-0x5332 = 0x3431
-0x5335 = 0x3432
-0x533C = 0x3433
-0x533D = 0x3434
-0x533E = 0x3435
-0x5342 = 0x3436
-0x534B = 0x3438
-0x534C = 0x3437
-0x5359 = 0x3439
-0x535B = 0x343A
-0x5361 = 0x343B
-0x5363 = 0x343C
-0x5365 = 0x343D
-0x536C = 0x343E
-0x536D = 0x343F
-0x5372 = 0x3440
-0x5379 = 0x3441
-0x537E = 0x3442
-0x5383 = 0x3443
-0x5387 = 0x3444
-0x5388 = 0x3445
-0x538E = 0x3446
-0x5393 = 0x3447
-0x5394 = 0x3448
-0x5399 = 0x3449
-0x539D = 0x344A
-0x53A1 = 0x344B
-0x53A4 = 0x344C
-0x53AA = 0x344D
-0x53AB = 0x344E
-0x53AF = 0x344F
-0x53B2 = 0x3450
-0x53B4 = 0x3451
-0x53B5 = 0x3452
-0x53B7 = 0x3453
-0x53B8 = 0x3454
-0x53BA = 0x3455
-0x53BD = 0x3456
-0x53C0 = 0x3457
-0x53C5 = 0x3458
-0x53CF = 0x3459
-0x53D2 = 0x345A
-0x53D3 = 0x345B
-0x53D5 = 0x345C
-0x53DA = 0x345D
-0x53DD = 0x345E
-0x53DE = 0x345F
-0x53E0 = 0x3460
-0x53E6 = 0x3461
-0x53E7 = 0x3462
-0x53F5 = 0x3463
-0x5402 = 0x3464
-0x5413 = 0x3465
-0x541A = 0x3466
-0x5421 = 0x3467
-0x5427 = 0x3468
-0x5428 = 0x3469
-0x542A = 0x346A
-0x542F = 0x346B
-0x5431 = 0x346C
-0x5434 = 0x346D
-0x5435 = 0x346E
-0x5443 = 0x346F
-0x5444 = 0x3470
-0x5447 = 0x3471
-0x544D = 0x3472
-0x544F = 0x3473
-0x545E = 0x3474
-0x5462 = 0x3475
-0x5464 = 0x3476
-0x5466 = 0x3477
-0x5467 = 0x3478
-0x5469 = 0x3479
-0x546B = 0x347A
-0x546D = 0x347B
-0x546E = 0x347C
-0x5474 = 0x347D
-0x547F = 0x347E
-0x5481 = 0x3521
-0x5483 = 0x3522
-0x5485 = 0x3523
-0x5488 = 0x3524
-0x5489 = 0x3525
-0x548D = 0x3526
-0x5491 = 0x3527
-0x5495 = 0x3528
-0x5496 = 0x3529
-0x549C = 0x352A
-0x549F = 0x352B
-0x54A1 = 0x352C
-0x54A6 = 0x352D
-0x54A7 = 0x352E
-0x54A9 = 0x352F
-0x54AA = 0x3530
-0x54AD = 0x3531
-0x54AE = 0x3532
-0x54B1 = 0x3533
-0x54B7 = 0x3534
-0x54B9 = 0x3535
-0x54BA = 0x3536
-0x54BB = 0x3537
-0x54BF = 0x3538
-0x54C6 = 0x3539
-0x54CA = 0x353A
-0x54CD = 0x353B
-0x54CE = 0x353C
-0x54E0 = 0x353D
-0x54EA = 0x353E
-0x54EC = 0x353F
-0x54EF = 0x3540
-0x54F6 = 0x3541
-0x54FC = 0x3542
-0x54FE = 0x3543
-0x54FF = 0x3544
-0x5500 = 0x3545
-0x5501 = 0x3546
-0x5505 = 0x3547
-0x5508 = 0x3548
-0x5509 = 0x3549
-0x550C = 0x354A
-0x550D = 0x354B
-0x550E = 0x354C
-0x5515 = 0x354D
-0x552A = 0x354E
-0x552B = 0x354F
-0x5532 = 0x3550
-0x5535 = 0x3551
-0x5536 = 0x3552
-0x553B = 0x3553
-0x553C = 0x3554
-0x553D = 0x3555
-0x5541 = 0x3556
-0x5547 = 0x3557
-0x5549 = 0x3558
-0x554A = 0x3559
-0x554D = 0x355A
-0x5550 = 0x355B
-0x5551 = 0x355C
-0x5558 = 0x355D
-0x555A = 0x355E
-0x555B = 0x355F
-0x555E = 0x3560
-0x5560 = 0x3561
-0x5561 = 0x3562
-0x5564 = 0x3563
-0x5566 = 0x3564
-0x557F = 0x3565
-0x5581 = 0x3566
-0x5582 = 0x3567
-0x5586 = 0x3568
-0x5588 = 0x3569
-0x558E = 0x356A
-0x558F = 0x356B
-0x5591 = 0x356C
-0x5592 = 0x356D
-0x5593 = 0x356E
-0x5594 = 0x356F
-0x5597 = 0x3570
-0x55A3 = 0x3571
-0x55A4 = 0x3572
-0x55AD = 0x3573
-0x55B2 = 0x3574
-0x55BF = 0x3575
-0x55C1 = 0x3576
-0x55C3 = 0x3577
-0x55C6 = 0x3578
-0x55C9 = 0x3579
-0x55CB = 0x357A
-0x55CC = 0x357B
-0x55CE = 0x357C
-0x55D1 = 0x357D
-0x55D2 = 0x357E
-0x55D3 = 0x3621
-0x55D7 = 0x3622
-0x55D8 = 0x3623
-0x55DB = 0x3624
-0x55DE = 0x3625
-0x55E2 = 0x3626
-0x55E9 = 0x3627
-0x55F6 = 0x3628
-0x55FF = 0x3629
-0x5605 = 0x362A
-0x5608 = 0x362B
-0x560A = 0x362C
-0x560D = 0x362D
-0x560E = 0x362E
-0x560F = 0x362F
-0x5610 = 0x3630
-0x5611 = 0x3631
-0x5612 = 0x3632
-0x5619 = 0x3633
-0x562C = 0x3634
-0x5630 = 0x3635
-0x5633 = 0x3636
-0x5635 = 0x3637
-0x5637 = 0x3638
-0x5639 = 0x3639
-0x563B = 0x363A
-0x563C = 0x363B
-0x563D = 0x363C
-0x563F = 0x363D
-0x5640 = 0x363E
-0x5641 = 0x363F
-0x5643 = 0x3640
-0x5644 = 0x3641
-0x5646 = 0x3642
-0x5649 = 0x3643
-0x564B = 0x3644
-0x564D = 0x3645
-0x564F = 0x3646
-0x5654 = 0x3647
-0x565E = 0x3648
-0x5660 = 0x3649
-0x5661 = 0x364A
-0x5662 = 0x364B
-0x5663 = 0x364C
-0x5666 = 0x364D
-0x5669 = 0x364E
-0x566D = 0x364F
-0x566F = 0x3650
-0x5671 = 0x3651
-0x5672 = 0x3652
-0x5675 = 0x3653
-0x5684 = 0x3654
-0x5685 = 0x3655
-0x5688 = 0x3656
-0x568B = 0x3657
-0x568C = 0x3658
-0x5695 = 0x3659
-0x5699 = 0x365A
-0x569A = 0x365B
-0x569D = 0x365C
-0x569E = 0x365D
-0x569F = 0x365E
-0x56A6 = 0x365F
-0x56A7 = 0x3660
-0x56A8 = 0x3661
-0x56A9 = 0x3662
-0x56AB = 0x3663
-0x56AC = 0x3664
-0x56AD = 0x3665
-0x56B1 = 0x3666
-0x56B3 = 0x3667
-0x56B7 = 0x3668
-0x56BE = 0x3669
-0x56C5 = 0x366A
-0x56C9 = 0x366B
-0x56CA = 0x366C
-0x56CB = 0x366D
-0x56CC = 0x3670
-0x56CD = 0x3671
-0x56CF = 0x366E
-0x56D0 = 0x366F
-0x56D9 = 0x3672
-0x56DC = 0x3673
-0x56DD = 0x3674
-0x56DF = 0x3675
-0x56E1 = 0x3676
-0x56E4 = 0x3677
-0x56E5 = 0x3678
-0x56E6 = 0x3679
-0x56E7 = 0x367A
-0x56E8 = 0x367B
-0x56EB = 0x367D
-0x56ED = 0x367E
-0x56F1 = 0x367C
-0x56F6 = 0x3721
-0x56F7 = 0x3722
-0x5701 = 0x3723
-0x5702 = 0x3724
-0x5707 = 0x3725
-0x570A = 0x3726
-0x570C = 0x3727
-0x5711 = 0x3728
-0x5715 = 0x3729
-0x571A = 0x372A
-0x571B = 0x372B
-0x571D = 0x372C
-0x5720 = 0x372D
-0x5722 = 0x372E
-0x5723 = 0x372F
-0x5724 = 0x3730
-0x5725 = 0x3731
-0x5729 = 0x3732
-0x572A = 0x3733
-0x572C = 0x3734
-0x572E = 0x3735
-0x572F = 0x3736
-0x5733 = 0x3737
-0x5734 = 0x3738
-0x573D = 0x3739
-0x573E = 0x373A
-0x573F = 0x373B
-0x5745 = 0x373C
-0x5746 = 0x373D
-0x574C = 0x373E
-0x574D = 0x373F
-0x5752 = 0x3740
-0x5762 = 0x3741
-0x5765 = 0x3742
-0x5767 = 0x3743
-0x5768 = 0x3744
-0x576B = 0x3745
-0x576D = 0x3746
-0x576E = 0x3747
-0x576F = 0x3748
-0x5770 = 0x3749
-0x5771 = 0x374A
-0x5773 = 0x374B
-0x5774 = 0x374C
-0x5775 = 0x374D
-0x5777 = 0x374E
-0x5779 = 0x374F
-0x577A = 0x3750
-0x577B = 0x3751
-0x577C = 0x3752
-0x577E = 0x3753
-0x5781 = 0x3754
-0x5783 = 0x3755
-0x578C = 0x3756
-0x5794 = 0x3757
-0x5795 = 0x3760
-0x5797 = 0x3758
-0x5799 = 0x3759
-0x579A = 0x375A
-0x579C = 0x375B
-0x579D = 0x375C
-0x579E = 0x375D
-0x579F = 0x375E
-0x57A1 = 0x375F
-0x57A7 = 0x3761
-0x57A8 = 0x3762
-0x57A9 = 0x3763
-0x57AC = 0x3764
-0x57B8 = 0x3765
-0x57BD = 0x3766
-0x57C7 = 0x3767
-0x57C8 = 0x3768
-0x57CC = 0x3769
-0x57CF = 0x376A
-0x57D5 = 0x376B
-0x57DD = 0x376C
-0x57DE = 0x376D
-0x57E1 = 0x377E
-0x57E4 = 0x376E
-0x57E6 = 0x376F
-0x57E7 = 0x3770
-0x57E9 = 0x3771
-0x57ED = 0x3772
-0x57F0 = 0x3773
-0x57F5 = 0x3774
-0x57F6 = 0x3775
-0x57F8 = 0x3776
-0x57FD = 0x3777
-0x57FE = 0x3778
-0x57FF = 0x3779
-0x5803 = 0x377A
-0x5804 = 0x377B
-0x5808 = 0x377C
-0x5809 = 0x377D
-0x580C = 0x3821
-0x580D = 0x3822
-0x581B = 0x3823
-0x581E = 0x3824
-0x581F = 0x3825
-0x5820 = 0x3826
-0x5826 = 0x3827
-0x5827 = 0x3828
-0x582D = 0x3829
-0x5832 = 0x382A
-0x5839 = 0x382B
-0x583F = 0x382C
-0x5849 = 0x382D
-0x584C = 0x382E
-0x584D = 0x382F
-0x584F = 0x3830
-0x5850 = 0x3831
-0x5855 = 0x3832
-0x585F = 0x3833
-0x5861 = 0x3834
-0x5864 = 0x3835
-0x5867 = 0x3836
-0x5868 = 0x3837
-0x5878 = 0x3838
-0x587C = 0x3839
-0x587F = 0x383A
-0x5880 = 0x383B
-0x5881 = 0x383C
-0x5887 = 0x383D
-0x5888 = 0x383E
-0x5889 = 0x383F
-0x588A = 0x3840
-0x588C = 0x3841
-0x588D = 0x3842
-0x588F = 0x3843
-0x5890 = 0x3844
-0x5894 = 0x3845
-0x5896 = 0x3846
-0x589D = 0x3847
-0x58A0 = 0x3848
-0x58A1 = 0x3849
-0x58A2 = 0x384A
-0x58A6 = 0x384B
-0x58A9 = 0x384C
-0x58B1 = 0x384D
-0x58B2 = 0x384E
-0x58BC = 0x3850
-0x58C2 = 0x3851
-0x58C4 = 0x384F
-0x58C8 = 0x3852
-0x58CD = 0x3853
-0x58CE = 0x3854
-0x58D0 = 0x3855
-0x58D2 = 0x3856
-0x58D4 = 0x3857
-0x58D6 = 0x3858
-0x58DA = 0x3859
-0x58DD = 0x385A
-0x58E1 = 0x385B
-0x58E2 = 0x385C
-0x58E9 = 0x385D
-0x58F3 = 0x385E
-0x5905 = 0x385F
-0x5906 = 0x3860
-0x590B = 0x3861
-0x590C = 0x3862
-0x5912 = 0x3863
-0x5913 = 0x3864
-0x5914 = 0x3865
-0x591D = 0x3867
-0x5921 = 0x3868
-0x5923 = 0x3869
-0x5924 = 0x386A
-0x5928 = 0x386B
-0x592F = 0x386C
-0x5930 = 0x386D
-0x5933 = 0x386E
-0x5935 = 0x386F
-0x5936 = 0x3870
-0x593F = 0x3871
-0x5943 = 0x3872
-0x5946 = 0x3873
-0x5952 = 0x3874
-0x5953 = 0x3875
-0x5959 = 0x3876
-0x595B = 0x3877
-0x595D = 0x3878
-0x595E = 0x3879
-0x595F = 0x387A
-0x5961 = 0x387B
-0x5963 = 0x387C
-0x596B = 0x387D
-0x596D = 0x387E
-0x596F = 0x3921
-0x5972 = 0x3922
-0x5975 = 0x3923
-0x5976 = 0x3924
-0x5979 = 0x3925
-0x597B = 0x3926
-0x597C = 0x3927
-0x598B = 0x3928
-0x598C = 0x3929
-0x598E = 0x392A
-0x5992 = 0x392B
-0x5995 = 0x392C
-0x5997 = 0x392D
-0x599F = 0x392E
-0x59A4 = 0x392F
-0x59A7 = 0x3930
-0x59AD = 0x3931
-0x59AE = 0x3932
-0x59AF = 0x3933
-0x59B0 = 0x3934
-0x59B3 = 0x3935
-0x59B7 = 0x3936
-0x59BA = 0x3937
-0x59BC = 0x3938
-0x59C1 = 0x3939
-0x59C3 = 0x393A
-0x59C4 = 0x393B
-0x59C8 = 0x393C
-0x59CA = 0x393D
-0x59CD = 0x393E
-0x59D2 = 0x393F
-0x59DD = 0x3940
-0x59DE = 0x3941
-0x59DF = 0x3942
-0x59E3 = 0x3943
-0x59E4 = 0x3944
-0x59E7 = 0x3945
-0x59EE = 0x3946
-0x59EF = 0x3947
-0x59F1 = 0x3948
-0x59F2 = 0x3949
-0x59F4 = 0x394A
-0x59F7 = 0x394B
-0x5A00 = 0x394C
-0x5A04 = 0x394D
-0x5A0C = 0x394E
-0x5A0D = 0x394F
-0x5A0E = 0x3950
-0x5A12 = 0x3951
-0x5A13 = 0x3952
-0x5A1E = 0x3953
-0x5A23 = 0x3954
-0x5A24 = 0x3955
-0x5A27 = 0x3956
-0x5A28 = 0x3957
-0x5A2A = 0x3958
-0x5A2D = 0x3959
-0x5A30 = 0x395A
-0x5A44 = 0x395B
-0x5A45 = 0x395C
-0x5A47 = 0x395D
-0x5A48 = 0x395E
-0x5A4C = 0x395F
-0x5A50 = 0x3960
-0x5A55 = 0x3961
-0x5A5E = 0x3962
-0x5A63 = 0x3963
-0x5A65 = 0x3964
-0x5A67 = 0x3965
-0x5A6D = 0x3966
-0x5A77 = 0x3967
-0x5A7A = 0x3968
-0x5A7B = 0x3969
-0x5A7E = 0x396A
-0x5A8B = 0x396B
-0x5A90 = 0x396C
-0x5A93 = 0x396D
-0x5A96 = 0x396E
-0x5A99 = 0x396F
-0x5A9C = 0x3970
-0x5A9E = 0x3971
-0x5A9F = 0x3972
-0x5AA0 = 0x3973
-0x5AA2 = 0x3974
-0x5AA7 = 0x3975
-0x5AAC = 0x3976
-0x5AB1 = 0x3977
-0x5AB2 = 0x3978
-0x5AB3 = 0x3979
-0x5AB5 = 0x397A
-0x5AB8 = 0x397B
-0x5ABA = 0x397C
-0x5ABB = 0x397D
-0x5ABF = 0x397E
-0x5AC4 = 0x3A21
-0x5AC6 = 0x3A22
-0x5AC8 = 0x3A23
-0x5ACF = 0x3A24
-0x5ADA = 0x3A25
-0x5ADC = 0x3A26
-0x5AE0 = 0x3A27
-0x5AE5 = 0x3A28
-0x5AEA = 0x3A29
-0x5AEE = 0x3A2A
-0x5AF5 = 0x3A2B
-0x5AF6 = 0x3A2C
-0x5AFD = 0x3A2D
-0x5B00 = 0x3A2E
-0x5B01 = 0x3A2F
-0x5B08 = 0x3A30
-0x5B17 = 0x3A31
-0x5B19 = 0x3A33
-0x5B1B = 0x3A34
-0x5B1D = 0x3A35
-0x5B21 = 0x3A36
-0x5B25 = 0x3A37
-0x5B2D = 0x3A38
-0x5B34 = 0x3A32
-0x5B38 = 0x3A39
-0x5B41 = 0x3A3A
-0x5B4B = 0x3A3B
-0x5B4C = 0x3A3C
-0x5B52 = 0x3A3D
-0x5B56 = 0x3A3E
-0x5B5E = 0x3A3F
-0x5B68 = 0x3A40
-0x5B6E = 0x3A41
-0x5B6F = 0x3A42
-0x5B7C = 0x3A43
-0x5B7D = 0x3A44
-0x5B7E = 0x3A45
-0x5B7F = 0x3A46
-0x5B81 = 0x3A47
-0x5B84 = 0x3A48
-0x5B86 = 0x3A49
-0x5B8A = 0x3A4A
-0x5B8E = 0x3A4B
-0x5B90 = 0x3A4C
-0x5B91 = 0x3A4D
-0x5B93 = 0x3A4E
-0x5B94 = 0x3A4F
-0x5B96 = 0x3A50
-0x5BA8 = 0x3A51
-0x5BA9 = 0x3A52
-0x5BAC = 0x3A53
-0x5BAD = 0x3A54
-0x5BAF = 0x3A55
-0x5BB1 = 0x3A56
-0x5BB2 = 0x3A57
-0x5BB7 = 0x3A58
-0x5BBA = 0x3A59
-0x5BBC = 0x3A5A
-0x5BC0 = 0x3A5B
-0x5BC1 = 0x3A5C
-0x5BCD = 0x3A5D
-0x5BCF = 0x3A5E
-0x5BD6 = 0x3A5F
-0x5BD7 = 0x3A60
-0x5BD8 = 0x3A61
-0x5BD9 = 0x3A62
-0x5BDA = 0x3A63
-0x5BE0 = 0x3A64
-0x5BEF = 0x3A65
-0x5BF1 = 0x3A66
-0x5BF4 = 0x3A67
-0x5BFD = 0x3A68
-0x5C0C = 0x3A69
-0x5C17 = 0x3A6A
-0x5C1E = 0x3A6B
-0x5C1F = 0x3A6C
-0x5C23 = 0x3A6D
-0x5C26 = 0x3A6E
-0x5C29 = 0x3A6F
-0x5C2B = 0x3A70
-0x5C2C = 0x3A71
-0x5C2E = 0x3A72
-0x5C30 = 0x3A73
-0x5C32 = 0x3A74
-0x5C35 = 0x3A75
-0x5C36 = 0x3A76
-0x5C59 = 0x3A77
-0x5C5A = 0x3A78
-0x5C5C = 0x3A79
-0x5C62 = 0x3A7A
-0x5C63 = 0x3A7B
-0x5C67 = 0x3A7C
-0x5C68 = 0x3A7D
-0x5C69 = 0x3A7E
-0x5C6D = 0x3B21
-0x5C70 = 0x3B22
-0x5C74 = 0x3B23
-0x5C75 = 0x3B24
-0x5C7A = 0x3B25
-0x5C7B = 0x3B26
-0x5C7C = 0x3B27
-0x5C7D = 0x3B28
-0x5C87 = 0x3B29
-0x5C88 = 0x3B2A
-0x5C8A = 0x3B2B
-0x5C8F = 0x3B2C
-0x5C92 = 0x3B2D
-0x5C9D = 0x3B2E
-0x5C9F = 0x3B2F
-0x5CA0 = 0x3B30
-0x5CA2 = 0x3B31
-0x5CA3 = 0x3B32
-0x5CA6 = 0x3B33
-0x5CAA = 0x3B34
-0x5CB2 = 0x3B35
-0x5CB4 = 0x3B36
-0x5CB5 = 0x3B37
-0x5CBA = 0x3B38
-0x5CC9 = 0x3B39
-0x5CCB = 0x3B3A
-0x5CD2 = 0x3B3B
-0x5CD7 = 0x3B3D
-0x5CDD = 0x3B3C
-0x5CEE = 0x3B3E
-0x5CF1 = 0x3B3F
-0x5CF2 = 0x3B40
-0x5CF4 = 0x3B41
-0x5D01 = 0x3B42
-0x5D06 = 0x3B43
-0x5D0D = 0x3B44
-0x5D12 = 0x3B45
-0x5D23 = 0x3B47
-0x5D24 = 0x3B48
-0x5D26 = 0x3B49
-0x5D27 = 0x3B4A
-0x5D2B = 0x3B46
-0x5D31 = 0x3B4B
-0x5D34 = 0x3B4C
-0x5D39 = 0x3B4D
-0x5D3D = 0x3B4E
-0x5D3F = 0x3B4F
-0x5D42 = 0x3B50
-0x5D43 = 0x3B51
-0x5D46 = 0x3B52
-0x5D48 = 0x3B53
-0x5D4A = 0x3B57
-0x5D51 = 0x3B55
-0x5D55 = 0x3B54
-0x5D59 = 0x3B56
-0x5D5F = 0x3B58
-0x5D60 = 0x3B59
-0x5D61 = 0x3B5A
-0x5D62 = 0x3B5B
-0x5D64 = 0x3B5C
-0x5D6A = 0x3B5D
-0x5D6D = 0x3B5E
-0x5D70 = 0x3B5F
-0x5D79 = 0x3B60
-0x5D7A = 0x3B61
-0x5D7E = 0x3B62
-0x5D7F = 0x3B63
-0x5D81 = 0x3B64
-0x5D83 = 0x3B65
-0x5D88 = 0x3B66
-0x5D8A = 0x3B67
-0x5D92 = 0x3B68
-0x5D93 = 0x3B69
-0x5D94 = 0x3B6A
-0x5D95 = 0x3B6B
-0x5D99 = 0x3B6C
-0x5D9B = 0x3B6D
-0x5D9F = 0x3B6E
-0x5DA0 = 0x3B6F
-0x5DA7 = 0x3B70
-0x5DAB = 0x3B71
-0x5DB0 = 0x3B72
-0x5DB2 = 0x6674
-0x5DB4 = 0x3B73
-0x5DB8 = 0x3B74
-0x5DB9 = 0x3B75
-0x5DC3 = 0x3B76
-0x5DC7 = 0x3B77
-0x5DCB = 0x3B78
-0x5DCE = 0x3B7A
-0x5DD0 = 0x3B79
-0x5DD8 = 0x3B7B
-0x5DD9 = 0x3B7C
-0x5DE0 = 0x3B7D
-0x5DE4 = 0x3B7E
-0x5DE9 = 0x3C21
-0x5DF8 = 0x3C22
-0x5DF9 = 0x3C23
-0x5E00 = 0x3C24
-0x5E07 = 0x3C25
-0x5E0D = 0x3C26
-0x5E12 = 0x3C27
-0x5E14 = 0x3C28
-0x5E15 = 0x3C29
-0x5E18 = 0x3C2A
-0x5E1F = 0x3C2B
-0x5E20 = 0x3C2C
-0x5E28 = 0x3C2E
-0x5E2E = 0x3C2D
-0x5E32 = 0x3C2F
-0x5E35 = 0x3C30
-0x5E3E = 0x3C31
-0x5E49 = 0x3C34
-0x5E4B = 0x3C32
-0x5E50 = 0x3C33
-0x5E51 = 0x3C35
-0x5E56 = 0x3C36
-0x5E58 = 0x3C37
-0x5E5B = 0x3C38
-0x5E5C = 0x3C39
-0x5E5E = 0x3C3A
-0x5E68 = 0x3C3B
-0x5E6A = 0x3C3C
-0x5E6B = 0x3C3D
-0x5E6C = 0x3C3E
-0x5E6D = 0x3C3F
-0x5E6E = 0x3C40
-0x5E70 = 0x3C41
-0x5E80 = 0x3C42
-0x5E8B = 0x3C43
-0x5E8E = 0x3C44
-0x5EA2 = 0x3C45
-0x5EA4 = 0x3C46
-0x5EA5 = 0x3C47
-0x5EA8 = 0x3C48
-0x5EAA = 0x3C49
-0x5EAC = 0x3C4A
-0x5EB1 = 0x3C4B
-0x5EB3 = 0x3C4C
-0x5EBD = 0x3C4D
-0x5EBE = 0x3C4E
-0x5EBF = 0x3C4F
-0x5EC6 = 0x3C50
-0x5ECB = 0x3C52
-0x5ECC = 0x3C51
-0x5ECE = 0x3C53
-0x5ED1 = 0x3C54
-0x5ED2 = 0x3C55
-0x5ED4 = 0x3C56
-0x5ED5 = 0x3C57
-0x5EDC = 0x3C58
-0x5EDE = 0x3C59
-0x5EE5 = 0x3C5A
-0x5EEB = 0x3C5B
-0x5F02 = 0x3C5C
-0x5F06 = 0x3C5D
-0x5F07 = 0x3C5E
-0x5F08 = 0x3C5F
-0x5F0E = 0x3C60
-0x5F19 = 0x3C61
-0x5F1C = 0x3C62
-0x5F1D = 0x3C63
-0x5F21 = 0x3C64
-0x5F22 = 0x3C65
-0x5F23 = 0x3C66
-0x5F24 = 0x3C67
-0x5F28 = 0x3C68
-0x5F2B = 0x3C69
-0x5F2C = 0x3C6A
-0x5F2E = 0x3C6B
-0x5F30 = 0x3C6C
-0x5F34 = 0x3C6D
-0x5F36 = 0x3C6E
-0x5F3B = 0x3C6F
-0x5F3D = 0x3C70
-0x5F3F = 0x3C71
-0x5F40 = 0x3C72
-0x5F44 = 0x3C73
-0x5F45 = 0x3C74
-0x5F47 = 0x3C75
-0x5F4D = 0x3C76
-0x5F50 = 0x3C77
-0x5F54 = 0x3C78
-0x5F58 = 0x3C79
-0x5F5B = 0x3C7A
-0x5F60 = 0x3C7B
-0x5F63 = 0x3C7C
-0x5F64 = 0x3C7D
-0x5F67 = 0x3C7E
-0x5F6F = 0x3D21
-0x5F72 = 0x3D22
-0x5F74 = 0x3D23
-0x5F75 = 0x3D24
-0x5F78 = 0x3D25
-0x5F7A = 0x3D26
-0x5F7D = 0x3D27
-0x5F7E = 0x3D28
-0x5F89 = 0x3D29
-0x5F8D = 0x3D2A
-0x5F8F = 0x3D2B
-0x5F96 = 0x3D2C
-0x5F9C = 0x3D2D
-0x5F9D = 0x3D2E
-0x5FA2 = 0x3D2F
-0x5FA4 = 0x3D32
-0x5FA7 = 0x3D30
-0x5FAB = 0x3D31
-0x5FAC = 0x3D33
-0x5FAF = 0x3D34
-0x5FB0 = 0x3D35
-0x5FB1 = 0x3D36
-0x5FB8 = 0x3D37
-0x5FC4 = 0x3D38
-0x5FC7 = 0x3D39
-0x5FC8 = 0x3D3A
-0x5FC9 = 0x3D3B
-0x5FCB = 0x3D3C
-0x5FD0 = 0x3D3D
-0x5FD1 = 0x3D3E
-0x5FD2 = 0x3D3F
-0x5FD3 = 0x3D40
-0x5FD4 = 0x3D41
-0x5FDE = 0x3D42
-0x5FE1 = 0x3D43
-0x5FE2 = 0x3D44
-0x5FE8 = 0x3D45
-0x5FE9 = 0x3D46
-0x5FEA = 0x3D47
-0x5FEC = 0x3D48
-0x5FED = 0x3D49
-0x5FEE = 0x3D4A
-0x5FEF = 0x3D4B
-0x5FF2 = 0x3D4C
-0x5FF3 = 0x3D4D
-0x5FF6 = 0x3D4E
-0x5FFA = 0x3D4F
-0x5FFC = 0x3D50
-0x6007 = 0x3D51
-0x600A = 0x3D52
-0x600D = 0x3D53
-0x6013 = 0x3D54
-0x6014 = 0x3D55
-0x6017 = 0x3D56
-0x6018 = 0x3D57
-0x601A = 0x3D58
-0x601F = 0x3D59
-0x6024 = 0x3D5A
-0x602D = 0x3D5B
-0x6033 = 0x3D5C
-0x6035 = 0x3D5D
-0x6040 = 0x3D5E
-0x6047 = 0x3D5F
-0x6048 = 0x3D60
-0x6049 = 0x3D61
-0x604C = 0x3D62
-0x6051 = 0x3D63
-0x6054 = 0x3D64
-0x6056 = 0x3D65
-0x6057 = 0x3D66
-0x605D = 0x3D67
-0x6061 = 0x3D68
-0x6067 = 0x3D69
-0x6071 = 0x3D6A
-0x607E = 0x3D6B
-0x607F = 0x3D6C
-0x6082 = 0x3D6D
-0x6086 = 0x3D6E
-0x6088 = 0x3D6F
-0x608A = 0x3D70
-0x608E = 0x3D71
-0x6091 = 0x3D72
-0x6093 = 0x3D73
-0x6095 = 0x3D74
-0x6098 = 0x3D75
-0x609D = 0x3D76
-0x609E = 0x3D77
-0x60A2 = 0x3D78
-0x60A4 = 0x3D79
-0x60A5 = 0x3D7A
-0x60A8 = 0x3D7B
-0x60B0 = 0x3D7C
-0x60B1 = 0x3D7D
-0x60B7 = 0x3D7E
-0x60BB = 0x3E21
-0x60BE = 0x3E22
-0x60C2 = 0x3E23
-0x60C4 = 0x3E24
-0x60C8 = 0x3E25
-0x60C9 = 0x3E26
-0x60CA = 0x3E27
-0x60CB = 0x3E28
-0x60CE = 0x3E29
-0x60CF = 0x3E2A
-0x60D4 = 0x3E2B
-0x60D5 = 0x3E2C
-0x60D9 = 0x3E2D
-0x60DB = 0x3E2E
-0x60DD = 0x3E2F
-0x60DE = 0x3E30
-0x60E2 = 0x3E31
-0x60E5 = 0x3E32
-0x60F2 = 0x3E33
-0x60F5 = 0x3E34
-0x60F8 = 0x3E35
-0x60FC = 0x3E36
-0x60FD = 0x3E37
-0x6102 = 0x3E38
-0x6107 = 0x3E39
-0x610A = 0x3E3A
-0x610C = 0x3E3B
-0x6110 = 0x3E3C
-0x6111 = 0x3E3D
-0x6112 = 0x3E3E
-0x6113 = 0x3E3F
-0x6114 = 0x3E40
-0x6116 = 0x3E41
-0x6117 = 0x3E42
-0x6119 = 0x3E43
-0x611C = 0x3E44
-0x611E = 0x3E45
-0x6122 = 0x3E46
-0x612A = 0x3E47
-0x612B = 0x3E48
-0x6130 = 0x3E49
-0x6131 = 0x3E4A
-0x6135 = 0x3E4B
-0x6136 = 0x3E4C
-0x6137 = 0x3E4D
-0x6139 = 0x3E4E
-0x6141 = 0x3E4F
-0x6145 = 0x3E50
-0x6146 = 0x3E51
-0x6149 = 0x3E52
-0x615E = 0x3E53
-0x6160 = 0x3E54
-0x616C = 0x3E55
-0x6172 = 0x3E56
-0x6178 = 0x3E57
-0x617B = 0x3E58
-0x617C = 0x3E59
-0x617F = 0x3E5A
-0x6180 = 0x3E5B
-0x6181 = 0x3E5C
-0x6183 = 0x3E5D
-0x6184 = 0x3E5E
-0x618B = 0x3E5F
-0x618D = 0x3E60
-0x6192 = 0x3E61
-0x6193 = 0x3E62
-0x6197 = 0x3E63
-0x6198 = 0x3E64
-0x619C = 0x3E65
-0x619D = 0x3E66
-0x619F = 0x3E67
-0x61A0 = 0x3E68
-0x61A5 = 0x3E69
-0x61A8 = 0x3E6A
-0x61AA = 0x3E6B
-0x61AD = 0x3E6C
-0x61B8 = 0x3E6D
-0x61B9 = 0x3E6E
-0x61BC = 0x3E6F
-0x61C0 = 0x3E70
-0x61C1 = 0x3E71
-0x61C2 = 0x3E72
-0x61CE = 0x3E73
-0x61CF = 0x3E74
-0x61D5 = 0x3E75
-0x61DC = 0x3E76
-0x61DD = 0x3E77
-0x61DE = 0x3E78
-0x61DF = 0x3E79
-0x61E1 = 0x3E7A
-0x61E2 = 0x3E7B
-0x61E5 = 0x3E7E
-0x61E7 = 0x3E7C
-0x61E9 = 0x3E7D
-0x61EC = 0x3F21
-0x61ED = 0x3F22
-0x61EF = 0x3F23
-0x6201 = 0x3F24
-0x6203 = 0x3F25
-0x6204 = 0x3F26
-0x6207 = 0x3F27
-0x6213 = 0x3F28
-0x6215 = 0x3F29
-0x621C = 0x3F2A
-0x6220 = 0x3F2B
-0x6222 = 0x3F2C
-0x6223 = 0x3F2D
-0x6227 = 0x3F2E
-0x6229 = 0x3F2F
-0x622B = 0x3F30
-0x6239 = 0x3F31
-0x623D = 0x3F32
-0x6242 = 0x3F33
-0x6243 = 0x3F34
-0x6244 = 0x3F35
-0x6246 = 0x3F36
-0x624C = 0x3F37
-0x6250 = 0x3F38
-0x6251 = 0x3F39
-0x6252 = 0x3F3A
-0x6254 = 0x3F3B
-0x6256 = 0x3F3C
-0x625A = 0x3F3D
-0x625C = 0x3F3E
-0x6264 = 0x3F3F
-0x626D = 0x3F40
-0x626F = 0x3F41
-0x6273 = 0x3F42
-0x627A = 0x3F43
-0x627D = 0x3F44
-0x628D = 0x3F45
-0x628E = 0x3F46
-0x628F = 0x3F47
-0x6290 = 0x3F48
-0x62A6 = 0x3F49
-0x62A8 = 0x3F4A
-0x62B3 = 0x3F4B
-0x62B6 = 0x3F4C
-0x62B7 = 0x3F4D
-0x62BA = 0x3F4E
-0x62BE = 0x3F4F
-0x62BF = 0x3F50
-0x62C4 = 0x3F51
-0x62CE = 0x3F52
-0x62D5 = 0x3F53
-0x62D6 = 0x3F54
-0x62DA = 0x3F55
-0x62EA = 0x3F56
-0x62F2 = 0x3F57
-0x62F4 = 0x3F58
-0x62FC = 0x3F59
-0x62FD = 0x3F5A
-0x6303 = 0x3F5B
-0x6304 = 0x3F5C
-0x630A = 0x3F5D
-0x630B = 0x3F5E
-0x630D = 0x3F5F
-0x6310 = 0x3F60
-0x6313 = 0x3F61
-0x6316 = 0x3F62
-0x6318 = 0x3F63
-0x6329 = 0x3F64
-0x632A = 0x3F65
-0x632D = 0x3F66
-0x6335 = 0x3F67
-0x6336 = 0x3F68
-0x6339 = 0x3F69
-0x633C = 0x3F6A
-0x6341 = 0x3F6B
-0x6342 = 0x3F6C
-0x6343 = 0x3F6D
-0x6344 = 0x3F6E
-0x6346 = 0x3F6F
-0x634A = 0x3F70
-0x634B = 0x3F71
-0x634E = 0x3F72
-0x6352 = 0x3F73
-0x6353 = 0x3F74
-0x6354 = 0x3F75
-0x6358 = 0x3F76
-0x635B = 0x3F77
-0x6365 = 0x3F78
-0x6366 = 0x3F79
-0x636C = 0x3F7A
-0x636D = 0x3F7B
-0x6371 = 0x3F7C
-0x6374 = 0x3F7D
-0x6375 = 0x3F7E
-0x6378 = 0x4021
-0x637C = 0x4022
-0x637D = 0x4023
-0x637F = 0x4024
-0x6382 = 0x4025
-0x6384 = 0x4026
-0x6387 = 0x4027
-0x638A = 0x4028
-0x6390 = 0x4029
-0x6394 = 0x402A
-0x6395 = 0x402B
-0x6399 = 0x402C
-0x639A = 0x402D
-0x639E = 0x402E
-0x63A4 = 0x402F
-0x63A6 = 0x4030
-0x63AD = 0x4031
-0x63AE = 0x4032
-0x63AF = 0x4033
-0x63BD = 0x4034
-0x63C1 = 0x4035
-0x63C5 = 0x4036
-0x63C8 = 0x4037
-0x63CE = 0x4038
-0x63D1 = 0x4039
-0x63D3 = 0x403A
-0x63D4 = 0x403B
-0x63D5 = 0x403C
-0x63DC = 0x403D
-0x63E0 = 0x403E
-0x63E5 = 0x403F
-0x63EA = 0x4040
-0x63EC = 0x4041
-0x63F2 = 0x4042
-0x63F3 = 0x4043
-0x63F5 = 0x4044
-0x63F8 = 0x4045
-0x63F9 = 0x4046
-0x6409 = 0x4047
-0x640A = 0x4048
-0x6410 = 0x4049
-0x6412 = 0x404A
-0x6414 = 0x404B
-0x6418 = 0x404C
-0x641E = 0x404D
-0x6420 = 0x404E
-0x6422 = 0x404F
-0x6424 = 0x4050
-0x6425 = 0x4051
-0x6429 = 0x4052
-0x642A = 0x4053
-0x642F = 0x4054
-0x6430 = 0x4055
-0x6435 = 0x4056
-0x643D = 0x4057
-0x643F = 0x4058
-0x644B = 0x4059
-0x644F = 0x405A
-0x6451 = 0x405B
-0x6452 = 0x405C
-0x6453 = 0x405D
-0x6454 = 0x405E
-0x645A = 0x405F
-0x645B = 0x4060
-0x645C = 0x4061
-0x645D = 0x4062
-0x645F = 0x4063
-0x6460 = 0x4064
-0x6461 = 0x4065
-0x6463 = 0x4066
-0x646D = 0x4067
-0x6473 = 0x4068
-0x6474 = 0x4069
-0x647B = 0x406A
-0x647D = 0x406B
-0x6485 = 0x406C
-0x6487 = 0x406D
-0x648F = 0x406E
-0x6490 = 0x406F
-0x6491 = 0x4070
-0x6498 = 0x4071
-0x6499 = 0x4072
-0x649B = 0x4073
-0x649D = 0x4074
-0x649F = 0x4075
-0x64A1 = 0x4076
-0x64A3 = 0x4077
-0x64A6 = 0x4078
-0x64A8 = 0x4079
-0x64AC = 0x407A
-0x64B3 = 0x407B
-0x64BD = 0x407C
-0x64BE = 0x407D
-0x64BF = 0x407E
-0x64C4 = 0x4121
-0x64C9 = 0x4122
-0x64CA = 0x4123
-0x64CB = 0x4124
-0x64CC = 0x4125
-0x64CE = 0x4126
-0x64D0 = 0x4127
-0x64D1 = 0x4128
-0x64D5 = 0x4129
-0x64D7 = 0x412A
-0x64E4 = 0x412B
-0x64E5 = 0x412C
-0x64E9 = 0x412D
-0x64EA = 0x412E
-0x64ED = 0x412F
-0x64F0 = 0x4130
-0x64F5 = 0x4131
-0x64F7 = 0x4132
-0x64FB = 0x4133
-0x64FF = 0x4134
-0x6501 = 0x4135
-0x6504 = 0x4136
-0x6508 = 0x4137
-0x6509 = 0x4138
-0x650A = 0x4139
-0x650F = 0x413A
-0x6513 = 0x413B
-0x6514 = 0x413C
-0x6516 = 0x413D
-0x6519 = 0x413E
-0x651B = 0x413F
-0x651E = 0x4140
-0x651F = 0x4141
-0x6522 = 0x4142
-0x6526 = 0x4143
-0x6529 = 0x4144
-0x652E = 0x4145
-0x6531 = 0x4146
-0x653A = 0x4147
-0x653C = 0x4148
-0x653D = 0x4149
-0x6543 = 0x414A
-0x6547 = 0x414B
-0x6549 = 0x414C
-0x6550 = 0x414D
-0x6552 = 0x414E
-0x6554 = 0x414F
-0x655F = 0x4150
-0x6560 = 0x4151
-0x6567 = 0x4152
-0x656B = 0x4153
-0x657A = 0x4154
-0x657D = 0x4155
-0x6581 = 0x4156
-0x6585 = 0x4157
-0x658A = 0x4158
-0x6592 = 0x4159
-0x6595 = 0x415A
-0x6598 = 0x415B
-0x659D = 0x415C
-0x65A0 = 0x415D
-0x65A3 = 0x415E
-0x65A6 = 0x415F
-0x65AE = 0x4160
-0x65B2 = 0x4161
-0x65B3 = 0x4162
-0x65B4 = 0x4163
-0x65BF = 0x4164
-0x65C2 = 0x4165
-0x65C8 = 0x4166
-0x65C9 = 0x4167
-0x65CE = 0x4168
-0x65D0 = 0x4169
-0x65D4 = 0x416A
-0x65D6 = 0x416B
-0x65D8 = 0x416C
-0x65DF = 0x416D
-0x65F0 = 0x416E
-0x65F2 = 0x416F
-0x65F4 = 0x4170
-0x65F5 = 0x4171
-0x65F9 = 0x4172
-0x65FE = 0x4173
-0x65FF = 0x4174
-0x6600 = 0x4175
-0x6604 = 0x4176
-0x6608 = 0x4177
-0x6609 = 0x4178
-0x660D = 0x4179
-0x6611 = 0x417A
-0x6612 = 0x417B
-0x6615 = 0x417C
-0x6616 = 0x417D
-0x661D = 0x417E
-0x661E = 0x4221
-0x6621 = 0x4222
-0x6622 = 0x4223
-0x6623 = 0x4224
-0x6624 = 0x4225
-0x6626 = 0x4226
-0x6629 = 0x4227
-0x662A = 0x4228
-0x662B = 0x4229
-0x662C = 0x422A
-0x662E = 0x422B
-0x6630 = 0x422C
-0x6631 = 0x422D
-0x6633 = 0x422E
-0x6637 = 0x4230
-0x6639 = 0x422F
-0x6640 = 0x4231
-0x6645 = 0x4232
-0x6646 = 0x4233
-0x664A = 0x4234
-0x664C = 0x4235
-0x664E = 0x4237
-0x6651 = 0x4236
-0x6657 = 0x4238
-0x6658 = 0x4239
-0x6659 = 0x423A
-0x665B = 0x423B
-0x665C = 0x423C
-0x6660 = 0x423D
-0x6661 = 0x423E
-0x666A = 0x4240
-0x666B = 0x4241
-0x666C = 0x4242
-0x6673 = 0x4244
-0x6675 = 0x4245
-0x6677 = 0x4247
-0x6678 = 0x4248
-0x6679 = 0x4249
-0x667B = 0x424A
-0x667C = 0x424C
-0x667E = 0x4243
-0x667F = 0x4246
-0x6680 = 0x424B
-0x668B = 0x424D
-0x668C = 0x424E
-0x668D = 0x424F
-0x6690 = 0x4250
-0x6692 = 0x4251
-0x6699 = 0x4252
-0x669A = 0x4253
-0x669B = 0x4254
-0x669C = 0x4255
-0x669F = 0x4256
-0x66A0 = 0x4257
-0x66A4 = 0x4258
-0x66AD = 0x4259
-0x66B1 = 0x425A
-0x66B2 = 0x425B
-0x66B5 = 0x425C
-0x66BB = 0x425D
-0x66BF = 0x425E
-0x66C0 = 0x425F
-0x66C2 = 0x4260
-0x66C3 = 0x4261
-0x66C8 = 0x4262
-0x66CC = 0x4263
-0x66CE = 0x4264
-0x66CF = 0x4265
-0x66D4 = 0x4266
-0x66DB = 0x4267
-0x66DF = 0x4268
-0x66E8 = 0x4269
-0x66EB = 0x426A
-0x66EC = 0x426B
-0x66EE = 0x426C
-0x66FA = 0x426D
-0x66FB = 0x423F
-0x6705 = 0x426E
-0x6707 = 0x426F
-0x670E = 0x4270
-0x6713 = 0x4271
-0x6719 = 0x4272
-0x671C = 0x4273
-0x6720 = 0x4274
-0x6722 = 0x4275
-0x6733 = 0x4276
-0x673E = 0x4277
-0x6745 = 0x4278
-0x6747 = 0x4279
-0x6748 = 0x427A
-0x674C = 0x427B
-0x6754 = 0x427C
-0x6755 = 0x427D
-0x675D = 0x427E
-0x6766 = 0x4321
-0x676C = 0x4322
-0x676E = 0x4323
-0x6774 = 0x4324
-0x6776 = 0x4325
-0x677B = 0x4326
-0x6781 = 0x4327
-0x6784 = 0x4328
-0x678E = 0x4329
-0x678F = 0x432A
-0x6791 = 0x432B
-0x6793 = 0x432C
-0x6796 = 0x432D
-0x6798 = 0x432E
-0x6799 = 0x432F
-0x679B = 0x4330
-0x67B0 = 0x4331
-0x67B1 = 0x4332
-0x67B2 = 0x4333
-0x67B5 = 0x4334
-0x67BB = 0x4335
-0x67BC = 0x4336
-0x67BD = 0x4337
-0x67C0 = 0x4339
-0x67C2 = 0x433A
-0x67C3 = 0x433B
-0x67C5 = 0x433C
-0x67C8 = 0x433D
-0x67C9 = 0x433E
-0x67D2 = 0x433F
-0x67D7 = 0x4340
-0x67D9 = 0x4341
-0x67DC = 0x4342
-0x67E1 = 0x4343
-0x67E6 = 0x4344
-0x67F0 = 0x4345
-0x67F2 = 0x4346
-0x67F6 = 0x4347
-0x67F7 = 0x4348
-0x67F9 = 0x4338
-0x6814 = 0x434A
-0x6819 = 0x434B
-0x681D = 0x434C
-0x681F = 0x434D
-0x6827 = 0x434F
-0x6828 = 0x434E
-0x682C = 0x4350
-0x682D = 0x4351
-0x682F = 0x4352
-0x6830 = 0x4353
-0x6831 = 0x4354
-0x6833 = 0x4355
-0x683B = 0x4356
-0x683F = 0x4357
-0x6844 = 0x4358
-0x6845 = 0x4359
-0x684A = 0x435A
-0x684C = 0x435B
-0x6852 = 0x4349
-0x6855 = 0x435C
-0x6857 = 0x435D
-0x6858 = 0x435E
-0x685B = 0x435F
-0x686B = 0x4360
-0x686E = 0x4361
-0x686F = 0x4362
-0x6870 = 0x4363
-0x6871 = 0x4364
-0x6872 = 0x4365
-0x6875 = 0x4366
-0x6879 = 0x4367
-0x687A = 0x4368
-0x687B = 0x4369
-0x687C = 0x436A
-0x6882 = 0x436B
-0x6884 = 0x436C
-0x6886 = 0x436D
-0x6888 = 0x436E
-0x6896 = 0x436F
-0x6898 = 0x4370
-0x689A = 0x4371
-0x689C = 0x4372
-0x68A1 = 0x4373
-0x68A3 = 0x4374
-0x68A5 = 0x4375
-0x68A9 = 0x4376
-0x68AA = 0x4377
-0x68AE = 0x4378
-0x68B2 = 0x4379
-0x68BB = 0x437A
-0x68C5 = 0x437B
-0x68C8 = 0x437C
-0x68CC = 0x437D
-0x68CF = 0x437E
-0x68D0 = 0x4421
-0x68D1 = 0x4422
-0x68D3 = 0x4423
-0x68D6 = 0x4424
-0x68D9 = 0x4425
-0x68DC = 0x4426
-0x68DD = 0x4427
-0x68E5 = 0x4428
-0x68E8 = 0x4429
-0x68EA = 0x442A
-0x68EB = 0x442B
-0x68EC = 0x442C
-0x68ED = 0x442D
-0x68F0 = 0x442E
-0x68F1 = 0x442F
-0x68F5 = 0x4430
-0x68F6 = 0x4431
-0x68FB = 0x4432
-0x68FC = 0x4433
-0x68FD = 0x4434
-0x6906 = 0x4435
-0x6909 = 0x4436
-0x690A = 0x4437
-0x6910 = 0x4438
-0x6911 = 0x4439
-0x6913 = 0x443A
-0x6916 = 0x443B
-0x6917 = 0x443C
-0x6931 = 0x443D
-0x6933 = 0x443E
-0x6935 = 0x443F
-0x6938 = 0x4440
-0x693B = 0x4441
-0x6942 = 0x4442
-0x6945 = 0x4443
-0x6949 = 0x4444
-0x694E = 0x4445
-0x6957 = 0x4446
-0x695B = 0x4447
-0x6963 = 0x4448
-0x6964 = 0x4449
-0x6965 = 0x444A
-0x6966 = 0x444B
-0x6968 = 0x444C
-0x6969 = 0x444D
-0x696C = 0x444E
-0x6970 = 0x444F
-0x6971 = 0x4450
-0x6972 = 0x4451
-0x697A = 0x4452
-0x697B = 0x4453
-0x697F = 0x4454
-0x6980 = 0x4455
-0x698D = 0x4456
-0x6992 = 0x4457
-0x6996 = 0x4458
-0x6998 = 0x4459
-0x69A1 = 0x445A
-0x69A5 = 0x445B
-0x69A6 = 0x445C
-0x69A8 = 0x445D
-0x69AB = 0x445E
-0x69AD = 0x445F
-0x69AF = 0x4460
-0x69B7 = 0x4461
-0x69B8 = 0x4462
-0x69BA = 0x4463
-0x69BC = 0x4464
-0x69C5 = 0x4465
-0x69C8 = 0x4466
-0x69D1 = 0x4467
-0x69D6 = 0x4468
-0x69D7 = 0x4469
-0x69E2 = 0x446A
-0x69E5 = 0x446B
-0x69EE = 0x446C
-0x69EF = 0x446D
-0x69F1 = 0x446E
-0x69F3 = 0x446F
-0x69F5 = 0x4470
-0x69FE = 0x4471
-0x6A00 = 0x4472
-0x6A01 = 0x4473
-0x6A03 = 0x4474
-0x6A0F = 0x4475
-0x6A11 = 0x4476
-0x6A15 = 0x4477
-0x6A1A = 0x4478
-0x6A1D = 0x4479
-0x6A20 = 0x447A
-0x6A24 = 0x447B
-0x6A28 = 0x447C
-0x6A30 = 0x447D
-0x6A32 = 0x447E
-0x6A34 = 0x4521
-0x6A37 = 0x4522
-0x6A3B = 0x4523
-0x6A3E = 0x4524
-0x6A3F = 0x4525
-0x6A45 = 0x4526
-0x6A46 = 0x4527
-0x6A49 = 0x4528
-0x6A4A = 0x4529
-0x6A4E = 0x452A
-0x6A50 = 0x452B
-0x6A51 = 0x452C
-0x6A52 = 0x452D
-0x6A55 = 0x452E
-0x6A56 = 0x452F
-0x6A5B = 0x4530
-0x6A64 = 0x4531
-0x6A67 = 0x4532
-0x6A6A = 0x4533
-0x6A71 = 0x4534
-0x6A73 = 0x4535
-0x6A7E = 0x4536
-0x6A81 = 0x4537
-0x6A83 = 0x4538
-0x6A86 = 0x4539
-0x6A87 = 0x453A
-0x6A89 = 0x453B
-0x6A8B = 0x453C
-0x6A91 = 0x453D
-0x6A9B = 0x453E
-0x6A9D = 0x453F
-0x6A9E = 0x4540
-0x6A9F = 0x4541
-0x6AA5 = 0x4542
-0x6AAB = 0x4543
-0x6AAF = 0x4544
-0x6AB0 = 0x4545
-0x6AB1 = 0x4546
-0x6AB4 = 0x4547
-0x6ABD = 0x4548
-0x6ABE = 0x4549
-0x6ABF = 0x454A
-0x6AC6 = 0x454B
-0x6AC8 = 0x454D
-0x6AC9 = 0x454C
-0x6ACC = 0x454E
-0x6AD0 = 0x454F
-0x6AD4 = 0x4550
-0x6AD5 = 0x4551
-0x6AD6 = 0x4552
-0x6ADC = 0x4553
-0x6ADD = 0x4554
-0x6AE4 = 0x4555
-0x6AE7 = 0x4556
-0x6AEC = 0x4557
-0x6AF0 = 0x4558
-0x6AF1 = 0x4559
-0x6AF2 = 0x455A
-0x6AFC = 0x455B
-0x6AFD = 0x455C
-0x6B02 = 0x455D
-0x6B03 = 0x455E
-0x6B06 = 0x455F
-0x6B07 = 0x4560
-0x6B09 = 0x4561
-0x6B0F = 0x4562
-0x6B10 = 0x4563
-0x6B11 = 0x4564
-0x6B17 = 0x4565
-0x6B1B = 0x4566
-0x6B1E = 0x4567
-0x6B24 = 0x4568
-0x6B28 = 0x4569
-0x6B2B = 0x456A
-0x6B2C = 0x456B
-0x6B2F = 0x456C
-0x6B35 = 0x456D
-0x6B36 = 0x456E
-0x6B3B = 0x456F
-0x6B3F = 0x4570
-0x6B46 = 0x4571
-0x6B4A = 0x4572
-0x6B4D = 0x4573
-0x6B52 = 0x4574
-0x6B56 = 0x4575
-0x6B58 = 0x4576
-0x6B5D = 0x4577
-0x6B60 = 0x4578
-0x6B67 = 0x4579
-0x6B6B = 0x457A
-0x6B6E = 0x457B
-0x6B70 = 0x457C
-0x6B75 = 0x457D
-0x6B7D = 0x457E
-0x6B7E = 0x4621
-0x6B82 = 0x4622
-0x6B85 = 0x4623
-0x6B97 = 0x4624
-0x6B9B = 0x4625
-0x6B9F = 0x4626
-0x6BA0 = 0x4627
-0x6BA2 = 0x4628
-0x6BA3 = 0x4629
-0x6BA8 = 0x462A
-0x6BA9 = 0x462B
-0x6BAC = 0x462C
-0x6BAD = 0x462D
-0x6BAE = 0x462E
-0x6BB0 = 0x462F
-0x6BB8 = 0x4630
-0x6BB9 = 0x4631
-0x6BBD = 0x4632
-0x6BBE = 0x4633
-0x6BC3 = 0x4634
-0x6BC4 = 0x4635
-0x6BC9 = 0x4636
-0x6BCC = 0x4637
-0x6BD6 = 0x4638
-0x6BDA = 0x4639
-0x6BE1 = 0x463A
-0x6BE3 = 0x463B
-0x6BE6 = 0x463C
-0x6BE7 = 0x463D
-0x6BEE = 0x463E
-0x6BF1 = 0x463F
-0x6BF7 = 0x4640
-0x6BF9 = 0x4641
-0x6BFF = 0x4642
-0x6C02 = 0x4643
-0x6C04 = 0x4644
-0x6C05 = 0x4645
-0x6C09 = 0x4646
-0x6C0D = 0x4647
-0x6C0E = 0x4648
-0x6C10 = 0x4649
-0x6C12 = 0x464A
-0x6C19 = 0x464B
-0x6C1F = 0x464C
-0x6C26 = 0x464D
-0x6C27 = 0x464E
-0x6C28 = 0x464F
-0x6C2C = 0x4650
-0x6C2E = 0x4651
-0x6C33 = 0x4652
-0x6C35 = 0x4653
-0x6C36 = 0x4654
-0x6C3A = 0x4655
-0x6C3B = 0x4656
-0x6C3F = 0x4657
-0x6C4A = 0x4658
-0x6C4B = 0x4659
-0x6C4D = 0x465A
-0x6C4F = 0x465B
-0x6C52 = 0x465C
-0x6C54 = 0x465D
-0x6C59 = 0x465E
-0x6C5B = 0x465F
-0x6C5C = 0x4660
-0x6C67 = 0x4736
-0x6C6B = 0x4661
-0x6C6D = 0x4662
-0x6C6F = 0x4663
-0x6C74 = 0x4664
-0x6C76 = 0x4665
-0x6C78 = 0x4666
-0x6C79 = 0x4667
-0x6C7B = 0x4668
-0x6C85 = 0x4669
-0x6C86 = 0x466A
-0x6C87 = 0x466B
-0x6C89 = 0x466C
-0x6C94 = 0x466D
-0x6C95 = 0x466E
-0x6C97 = 0x466F
-0x6C98 = 0x4670
-0x6C9C = 0x4671
-0x6C9F = 0x4672
-0x6CB0 = 0x4673
-0x6CB2 = 0x4674
-0x6CB4 = 0x4675
-0x6CC2 = 0x4676
-0x6CC6 = 0x4677
-0x6CCD = 0x4678
-0x6CCF = 0x4679
-0x6CD0 = 0x467A
-0x6CD1 = 0x467B
-0x6CD2 = 0x467C
-0x6CD4 = 0x467D
-0x6CD6 = 0x467E
-0x6CDA = 0x4721
-0x6CDC = 0x4722
-0x6CE0 = 0x4723
-0x6CE7 = 0x4724
-0x6CE9 = 0x4725
-0x6CEB = 0x4726
-0x6CEC = 0x4727
-0x6CEE = 0x4728
-0x6CF2 = 0x4729
-0x6CF4 = 0x472A
-0x6D04 = 0x472B
-0x6D07 = 0x472C
-0x6D0A = 0x472D
-0x6D0E = 0x472E
-0x6D0F = 0x472F
-0x6D11 = 0x4730
-0x6D13 = 0x4731
-0x6D1A = 0x4732
-0x6D26 = 0x4733
-0x6D27 = 0x4734
-0x6D28 = 0x4735
-0x6D2E = 0x4737
-0x6D2F = 0x4738
-0x6D31 = 0x4739
-0x6D39 = 0x473A
-0x6D3C = 0x473B
-0x6D3F = 0x473C
-0x6D57 = 0x473D
-0x6D5E = 0x473E
-0x6D5F = 0x473F
-0x6D61 = 0x4740
-0x6D65 = 0x4741
-0x6D67 = 0x4742
-0x6D6F = 0x4743
-0x6D70 = 0x4744
-0x6D7C = 0x4745
-0x6D82 = 0x4746
-0x6D87 = 0x4747
-0x6D91 = 0x4748
-0x6D92 = 0x4749
-0x6D94 = 0x474A
-0x6D96 = 0x474B
-0x6D97 = 0x474C
-0x6D98 = 0x474D
-0x6DAA = 0x474E
-0x6DAC = 0x474F
-0x6DB4 = 0x4750
-0x6DB7 = 0x4751
-0x6DB9 = 0x4752
-0x6DBD = 0x4753
-0x6DBF = 0x4754
-0x6DC4 = 0x4755
-0x6DC8 = 0x4756
-0x6DCA = 0x4757
-0x6DCE = 0x4758
-0x6DCF = 0x4759
-0x6DD6 = 0x475A
-0x6DDB = 0x475B
-0x6DDD = 0x475C
-0x6DDF = 0x475D
-0x6DE0 = 0x475E
-0x6DE2 = 0x475F
-0x6DE5 = 0x4760
-0x6DE9 = 0x4761
-0x6DEF = 0x4762
-0x6DF0 = 0x4763
-0x6DF4 = 0x4764
-0x6DF6 = 0x4765
-0x6DFC = 0x4766
-0x6E00 = 0x4767
-0x6E04 = 0x4768
-0x6E1E = 0x4769
-0x6E22 = 0x476A
-0x6E27 = 0x476B
-0x6E32 = 0x476C
-0x6E36 = 0x476D
-0x6E39 = 0x476E
-0x6E3B = 0x476F
-0x6E3C = 0x4770
-0x6E44 = 0x4771
-0x6E45 = 0x4772
-0x6E48 = 0x4773
-0x6E49 = 0x4774
-0x6E4B = 0x4775
-0x6E4F = 0x4776
-0x6E51 = 0x4777
-0x6E52 = 0x4778
-0x6E53 = 0x4779
-0x6E54 = 0x477A
-0x6E57 = 0x477B
-0x6E5C = 0x477C
-0x6E5D = 0x477D
-0x6E5E = 0x477E
-0x6E62 = 0x4821
-0x6E63 = 0x4822
-0x6E68 = 0x4823
-0x6E73 = 0x4824
-0x6E7B = 0x4825
-0x6E7D = 0x4826
-0x6E8D = 0x4827
-0x6E93 = 0x4828
-0x6E99 = 0x4829
-0x6EA0 = 0x482A
-0x6EA7 = 0x482B
-0x6EAD = 0x482C
-0x6EAE = 0x482D
-0x6EB1 = 0x482E
-0x6EB3 = 0x482F
-0x6EBB = 0x4830
-0x6EBF = 0x4831
-0x6EC0 = 0x4832
-0x6EC1 = 0x4833
-0x6EC3 = 0x4834
-0x6EC7 = 0x4835
-0x6EC8 = 0x4836
-0x6ECA = 0x4837
-0x6ECD = 0x4838
-0x6ECE = 0x4839
-0x6ECF = 0x483A
-0x6EEB = 0x483B
-0x6EED = 0x483C
-0x6EEE = 0x483D
-0x6EF9 = 0x483E
-0x6EFB = 0x483F
-0x6EFD = 0x4840
-0x6F04 = 0x4841
-0x6F08 = 0x4842
-0x6F0A = 0x4843
-0x6F0C = 0x4844
-0x6F0D = 0x4845
-0x6F16 = 0x4846
-0x6F18 = 0x4847
-0x6F1A = 0x4848
-0x6F1B = 0x4849
-0x6F26 = 0x484A
-0x6F29 = 0x484B
-0x6F2A = 0x484C
-0x6F2D = 0x4853
-0x6F2F = 0x484D
-0x6F30 = 0x484E
-0x6F33 = 0x484F
-0x6F36 = 0x4850
-0x6F3B = 0x4851
-0x6F3C = 0x4852
-0x6F4F = 0x4854
-0x6F51 = 0x4855
-0x6F52 = 0x4856
-0x6F53 = 0x4857
-0x6F57 = 0x4858
-0x6F59 = 0x4859
-0x6F5A = 0x485A
-0x6F5D = 0x485B
-0x6F5E = 0x485C
-0x6F61 = 0x485D
-0x6F62 = 0x485E
-0x6F68 = 0x485F
-0x6F6C = 0x4860
-0x6F7D = 0x4861
-0x6F7E = 0x4862
-0x6F83 = 0x4863
-0x6F87 = 0x4864
-0x6F88 = 0x4865
-0x6F8B = 0x4866
-0x6F8C = 0x4867
-0x6F8D = 0x4868
-0x6F90 = 0x4869
-0x6F92 = 0x486A
-0x6F93 = 0x486B
-0x6F94 = 0x486C
-0x6F96 = 0x486D
-0x6F9A = 0x486E
-0x6F9F = 0x486F
-0x6FA0 = 0x4870
-0x6FA5 = 0x4871
-0x6FA6 = 0x4872
-0x6FA7 = 0x4873
-0x6FA8 = 0x4874
-0x6FAE = 0x4875
-0x6FAF = 0x4876
-0x6FB0 = 0x4877
-0x6FB5 = 0x4878
-0x6FB6 = 0x4879
-0x6FBC = 0x487A
-0x6FC5 = 0x487B
-0x6FC7 = 0x487C
-0x6FC8 = 0x487D
-0x6FCA = 0x487E
-0x6FDA = 0x4921
-0x6FDE = 0x4922
-0x6FE8 = 0x4923
-0x6FE9 = 0x4924
-0x6FF0 = 0x4925
-0x6FF5 = 0x4926
-0x6FF9 = 0x4927
-0x6FFC = 0x4928
-0x6FFD = 0x4929
-0x7000 = 0x492A
-0x7005 = 0x492B
-0x7006 = 0x492C
-0x7007 = 0x492D
-0x700D = 0x492E
-0x7017 = 0x492F
-0x7020 = 0x4930
-0x7023 = 0x4931
-0x702F = 0x4932
-0x7034 = 0x4933
-0x7037 = 0x4934
-0x7039 = 0x4935
-0x703C = 0x4936
-0x7043 = 0x4937
-0x7044 = 0x4938
-0x7048 = 0x4939
-0x7049 = 0x493A
-0x704A = 0x493B
-0x704B = 0x493C
-0x704E = 0x4941
-0x7054 = 0x493D
-0x7055 = 0x493E
-0x705D = 0x493F
-0x705E = 0x4940
-0x7064 = 0x4942
-0x7065 = 0x4943
-0x706C = 0x4944
-0x706E = 0x4945
-0x7075 = 0x4946
-0x7076 = 0x4947
-0x707E = 0x4948
-0x7081 = 0x4949
-0x7085 = 0x494A
-0x7086 = 0x494B
-0x7094 = 0x494C
-0x7095 = 0x494D
-0x7096 = 0x494E
-0x7097 = 0x494F
-0x7098 = 0x4950
-0x709B = 0x4951
-0x70A4 = 0x4952
-0x70AB = 0x4953
-0x70B0 = 0x4954
-0x70B1 = 0x4955
-0x70B4 = 0x4956
-0x70B7 = 0x4957
-0x70CA = 0x4958
-0x70D1 = 0x4959
-0x70D3 = 0x495A
-0x70D4 = 0x495B
-0x70D5 = 0x495C
-0x70D6 = 0x495D
-0x70D8 = 0x495E
-0x70DC = 0x495F
-0x70E4 = 0x4960
-0x70FA = 0x4961
-0x7103 = 0x4962
-0x7104 = 0x4963
-0x7105 = 0x4964
-0x7106 = 0x4965
-0x7107 = 0x4966
-0x710B = 0x4967
-0x710C = 0x4968
-0x710F = 0x4969
-0x711E = 0x496A
-0x7120 = 0x496B
-0x712B = 0x496C
-0x712D = 0x496D
-0x712F = 0x496E
-0x7130 = 0x496F
-0x7131 = 0x4970
-0x7138 = 0x4971
-0x7141 = 0x4972
-0x7145 = 0x4973
-0x7146 = 0x4974
-0x7147 = 0x4975
-0x714A = 0x4976
-0x714B = 0x4977
-0x7150 = 0x4978
-0x7152 = 0x4979
-0x7157 = 0x497A
-0x715A = 0x497B
-0x715C = 0x497C
-0x715E = 0x497D
-0x7160 = 0x497E
-0x7168 = 0x4A21
-0x7179 = 0x4A22
-0x7180 = 0x4A23
-0x7185 = 0x4A24
-0x7187 = 0x4A25
-0x718C = 0x4A26
-0x7192 = 0x4A27
-0x719A = 0x4A28
-0x719B = 0x4A29
-0x71A0 = 0x4A2A
-0x71A2 = 0x4A2B
-0x71AF = 0x4A2C
-0x71B0 = 0x4A2D
-0x71B2 = 0x4A2E
-0x71B3 = 0x4A2F
-0x71BA = 0x4A30
-0x71BF = 0x4A31
-0x71C0 = 0x4A32
-0x71C1 = 0x4A33
-0x71C4 = 0x4A34
-0x71CB = 0x4A35
-0x71CC = 0x4A36
-0x71D3 = 0x4A37
-0x71D6 = 0x4A38
-0x71D9 = 0x4A39
-0x71DA = 0x4A3A
-0x71DC = 0x4A3B
-0x71F8 = 0x4A3C
-0x71FE = 0x4A3D
-0x7200 = 0x4A3E
-0x7207 = 0x4A3F
-0x7208 = 0x4A40
-0x7209 = 0x4A41
-0x7213 = 0x4A42
-0x7217 = 0x4A43
-0x721A = 0x4A44
-0x721D = 0x4A45
-0x721F = 0x4A46
-0x7224 = 0x4A47
-0x722B = 0x4A48
-0x722F = 0x4A49
-0x7234 = 0x4A4A
-0x7238 = 0x4A4B
-0x7239 = 0x4A4C
-0x7241 = 0x4A4D
-0x7242 = 0x4A4E
-0x7243 = 0x4A4F
-0x7245 = 0x4A50
-0x724E = 0x4A51
-0x724F = 0x4A52
-0x7250 = 0x4A53
-0x7253 = 0x4A54
-0x7255 = 0x4A55
-0x7256 = 0x4A56
-0x725A = 0x4A57
-0x725C = 0x4A58
-0x725E = 0x4A59
-0x7260 = 0x4A5A
-0x7263 = 0x4A5B
-0x7268 = 0x4A5C
-0x726B = 0x4A5D
-0x726E = 0x4A5E
-0x726F = 0x4A5F
-0x7271 = 0x4A60
-0x7277 = 0x4A61
-0x7278 = 0x4A62
-0x727B = 0x4A63
-0x727C = 0x4A64
-0x727F = 0x4A65
-0x7284 = 0x4A66
-0x7289 = 0x4A67
-0x728D = 0x4A68
-0x728E = 0x4A69
-0x7293 = 0x4A6A
-0x729B = 0x4A6B
-0x72A8 = 0x4A6C
-0x72AD = 0x4A6D
-0x72AE = 0x4A6E
-0x72B1 = 0x4A6F
-0x72B4 = 0x4A70
-0x72BE = 0x4A71
-0x72C1 = 0x4A72
-0x72C7 = 0x4A73
-0x72C9 = 0x4A74
-0x72CC = 0x4A75
-0x72D5 = 0x4A76
-0x72D6 = 0x4A77
-0x72D8 = 0x4A78
-0x72DF = 0x4A79
-0x72E5 = 0x4A7A
-0x72F3 = 0x4A7B
-0x72F4 = 0x4A7C
-0x72FA = 0x4A7D
-0x72FB = 0x4A7E
-0x72FE = 0x4B21
-0x7302 = 0x4B22
-0x7304 = 0x4B23
-0x7305 = 0x4B24
-0x7307 = 0x4B25
-0x730B = 0x4B26
-0x730D = 0x4B27
-0x7312 = 0x4B28
-0x7313 = 0x4B29
-0x7318 = 0x4B2A
-0x7319 = 0x4B2B
-0x731E = 0x4B2C
-0x7322 = 0x4B2D
-0x7324 = 0x4B2E
-0x7327 = 0x4B2F
-0x7328 = 0x4B30
-0x732C = 0x4B31
-0x7331 = 0x4B32
-0x7332 = 0x4B33
-0x7335 = 0x4B34
-0x733A = 0x4B35
-0x733B = 0x4B36
-0x733D = 0x4B37
-0x7343 = 0x4B38
-0x734D = 0x4B39
-0x7350 = 0x4B3A
-0x7352 = 0x4B3B
-0x7356 = 0x4B3C
-0x7358 = 0x4B3D
-0x735D = 0x4B3E
-0x735E = 0x4B3F
-0x735F = 0x4B40
-0x7360 = 0x4B41
-0x7366 = 0x4B42
-0x7367 = 0x4B43
-0x7369 = 0x4B44
-0x736B = 0x4B45
-0x736C = 0x4B46
-0x736E = 0x4B47
-0x736F = 0x4B48
-0x7371 = 0x4B49
-0x7377 = 0x4B4A
-0x7379 = 0x4B4B
-0x737C = 0x4B4C
-0x7380 = 0x4B4D
-0x7381 = 0x4B4E
-0x7383 = 0x4B4F
-0x7385 = 0x4B50
-0x7386 = 0x4B51
-0x738E = 0x4B52
-0x7390 = 0x4B53
-0x7393 = 0x4B54
-0x7395 = 0x4B55
-0x7397 = 0x4B56
-0x7398 = 0x4B57
-0x739C = 0x4B58
-0x739E = 0x4B59
-0x739F = 0x4B5A
-0x73A0 = 0x4B5B
-0x73A2 = 0x4B5C
-0x73A5 = 0x4B5D
-0x73A6 = 0x4B5E
-0x73AA = 0x4B5F
-0x73AB = 0x4B60
-0x73AD = 0x4B61
-0x73B5 = 0x4B62
-0x73B7 = 0x4B63
-0x73B9 = 0x4B64
-0x73BC = 0x4B65
-0x73BD = 0x4B66
-0x73BF = 0x4B67
-0x73C5 = 0x4B68
-0x73C6 = 0x4B69
-0x73C9 = 0x4B6A
-0x73CB = 0x4B6B
-0x73CC = 0x4B6C
-0x73CF = 0x4B6D
-0x73D2 = 0x4B6E
-0x73D3 = 0x4B6F
-0x73D6 = 0x4B70
-0x73D9 = 0x4B71
-0x73DD = 0x4B72
-0x73E1 = 0x4B73
-0x73E3 = 0x4B74
-0x73E6 = 0x4B75
-0x73E7 = 0x4B76
-0x73E9 = 0x4B77
-0x73F4 = 0x4B78
-0x73F5 = 0x4B79
-0x73F7 = 0x4B7A
-0x73F9 = 0x4B7B
-0x73FA = 0x4B7C
-0x73FB = 0x4B7D
-0x73FD = 0x4B7E
-0x73FF = 0x4C21
-0x7400 = 0x4C22
-0x7401 = 0x4C23
-0x7404 = 0x4C24
-0x7407 = 0x4C25
-0x740A = 0x4C26
-0x7411 = 0x4C27
-0x741A = 0x4C28
-0x741B = 0x4C29
-0x7424 = 0x4C2A
-0x7426 = 0x4C2B
-0x7428 = 0x4C2C
-0x7429 = 0x4C2D
-0x742A = 0x4C2E
-0x742B = 0x4C2F
-0x742C = 0x4C30
-0x742D = 0x4C31
-0x742E = 0x4C32
-0x742F = 0x4C33
-0x7430 = 0x4C34
-0x7431 = 0x4C35
-0x7439 = 0x4C36
-0x7440 = 0x4C37
-0x7443 = 0x4C38
-0x7444 = 0x4C39
-0x7446 = 0x4C3A
-0x7447 = 0x4C3B
-0x744B = 0x4C3C
-0x744D = 0x4C3D
-0x7451 = 0x4C3E
-0x7452 = 0x4C3F
-0x7457 = 0x4C40
-0x745D = 0x4C41
-0x7462 = 0x4C42
-0x7466 = 0x4C43
-0x7467 = 0x4C44
-0x7468 = 0x4C45
-0x746B = 0x4C46
-0x746D = 0x4C47
-0x746E = 0x4C48
-0x7471 = 0x4C49
-0x7472 = 0x4C4A
-0x7480 = 0x4C4B
-0x7481 = 0x4C4C
-0x7485 = 0x4C4D
-0x7486 = 0x4C4E
-0x7487 = 0x4C4F
-0x7489 = 0x4C50
-0x748F = 0x4C51
-0x7490 = 0x4C52
-0x7491 = 0x4C53
-0x7492 = 0x4C54
-0x7498 = 0x4C55
-0x7499 = 0x4C56
-0x749A = 0x4C57
-0x749C = 0x4C58
-0x749F = 0x4C59
-0x74A0 = 0x4C5A
-0x74A1 = 0x4C5B
-0x74A3 = 0x4C5C
-0x74A6 = 0x4C5D
-0x74A8 = 0x4C5E
-0x74A9 = 0x4C5F
-0x74AA = 0x4C60
-0x74AB = 0x4C61
-0x74AE = 0x4C62
-0x74AF = 0x4C63
-0x74B1 = 0x4C64
-0x74B2 = 0x4C65
-0x74B5 = 0x4C66
-0x74B9 = 0x4C67
-0x74BB = 0x4C68
-0x74BF = 0x4C69
-0x74C8 = 0x4C6A
-0x74C9 = 0x4C6B
-0x74CC = 0x4C6C
-0x74D0 = 0x4C6D
-0x74D3 = 0x4C6E
-0x74D8 = 0x4C6F
-0x74DA = 0x4C70
-0x74DB = 0x4C71
-0x74DE = 0x4C72
-0x74DF = 0x4C73
-0x74E4 = 0x4C74
-0x74E8 = 0x4C75
-0x74EA = 0x4C76
-0x74EB = 0x4C77
-0x74EF = 0x4C78
-0x74F4 = 0x4C79
-0x74FA = 0x4C7A
-0x74FB = 0x4C7B
-0x74FC = 0x4C7C
-0x74FF = 0x4C7D
-0x7506 = 0x4C7E
-0x7512 = 0x4D21
-0x7516 = 0x4D22
-0x7517 = 0x4D23
-0x7520 = 0x4D24
-0x7521 = 0x4D25
-0x7524 = 0x4D26
-0x7527 = 0x4D27
-0x7529 = 0x4D28
-0x752A = 0x4D29
-0x752F = 0x4D2A
-0x7536 = 0x4D2B
-0x7539 = 0x4D2C
-0x753D = 0x4D2D
-0x753E = 0x4D2E
-0x753F = 0x4D2F
-0x7540 = 0x4D30
-0x7543 = 0x4D31
-0x7547 = 0x4D32
-0x7548 = 0x4D33
-0x754E = 0x4D34
-0x7550 = 0x4D35
-0x7552 = 0x4D36
-0x7557 = 0x4D37
-0x755E = 0x4D38
-0x755F = 0x4D39
-0x7561 = 0x4D3A
-0x756F = 0x4D3B
-0x7571 = 0x4D3C
-0x7579 = 0x4D3D
-0x757A = 0x4D3E
-0x757B = 0x4D3F
-0x757C = 0x4D40
-0x757D = 0x4D41
-0x757E = 0x4D42
-0x7581 = 0x4D43
-0x7585 = 0x4D44
-0x7590 = 0x4D45
-0x7592 = 0x4D46
-0x7593 = 0x4D47
-0x7595 = 0x4D48
-0x7599 = 0x4D49
-0x759C = 0x4D4A
-0x75A2 = 0x4D4B
-0x75A4 = 0x4D4C
-0x75B4 = 0x4D4D
-0x75BA = 0x4D4E
-0x75BF = 0x4D4F
-0x75C0 = 0x4D50
-0x75C1 = 0x4D51
-0x75C4 = 0x4D52
-0x75C6 = 0x4D53
-0x75CC = 0x4D54
-0x75CE = 0x4D55
-0x75CF = 0x4D56
-0x75D7 = 0x4D57
-0x75DC = 0x4D58
-0x75DF = 0x4D59
-0x75E0 = 0x4D5A
-0x75E1 = 0x4D5B
-0x75E4 = 0x4D5C
-0x75E7 = 0x4D5D
-0x75EC = 0x4D5E
-0x75EE = 0x4D5F
-0x75EF = 0x4D60
-0x75F1 = 0x4D61
-0x75F9 = 0x4D62
-0x7600 = 0x4D63
-0x7602 = 0x4D64
-0x7603 = 0x4D65
-0x7604 = 0x4D66
-0x7607 = 0x4D67
-0x7608 = 0x4D68
-0x760A = 0x4D69
-0x760C = 0x4D6A
-0x760F = 0x4D6B
-0x7612 = 0x4D6C
-0x7613 = 0x4D6D
-0x7615 = 0x4D6E
-0x7616 = 0x4D6F
-0x7619 = 0x4D70
-0x761B = 0x4D71
-0x761C = 0x4D72
-0x761D = 0x4D73
-0x761E = 0x4D74
-0x7623 = 0x4D75
-0x7625 = 0x4D76
-0x7626 = 0x4D77
-0x7629 = 0x4D78
-0x762D = 0x4D79
-0x7632 = 0x4D7A
-0x7633 = 0x4D7B
-0x7635 = 0x4D7C
-0x7638 = 0x4D7D
-0x7639 = 0x4D7E
-0x763A = 0x4E21
-0x763C = 0x4E22
-0x7640 = 0x4E24
-0x7641 = 0x4E25
-0x7643 = 0x4E26
-0x7644 = 0x4E27
-0x7645 = 0x4E28
-0x7649 = 0x4E29
-0x764A = 0x4E23
-0x764B = 0x4E2A
-0x7655 = 0x4E2B
-0x7659 = 0x4E2C
-0x765F = 0x4E2D
-0x7664 = 0x4E2E
-0x7665 = 0x4E2F
-0x766D = 0x4E30
-0x766E = 0x4E31
-0x766F = 0x4E32
-0x7671 = 0x4E33
-0x7674 = 0x4E34
-0x7681 = 0x4E35
-0x7685 = 0x4E36
-0x768C = 0x4E37
-0x768D = 0x4E38
-0x7695 = 0x4E39
-0x769B = 0x4E3A
-0x769C = 0x4E3B
-0x769D = 0x4E3C
-0x769F = 0x4E3D
-0x76A0 = 0x4E3E
-0x76A2 = 0x4E3F
-0x76A3 = 0x4E40
-0x76A4 = 0x4E41
-0x76A5 = 0x4E42
-0x76A6 = 0x4E43
-0x76A7 = 0x4E44
-0x76A8 = 0x4E45
-0x76AA = 0x4E46
-0x76AD = 0x4E47
-0x76BD = 0x4E48
-0x76C1 = 0x4E49
-0x76C5 = 0x4E4A
-0x76C9 = 0x4E4B
-0x76CB = 0x4E4C
-0x76CC = 0x4E4D
-0x76CE = 0x4E4E
-0x76D4 = 0x4E4F
-0x76D9 = 0x4E50
-0x76E0 = 0x4E51
-0x76E6 = 0x4E52
-0x76E8 = 0x4E53
-0x76EC = 0x4E54
-0x76F0 = 0x4E55
-0x76F1 = 0x4E56
-0x76F6 = 0x4E57
-0x76F9 = 0x4E58
-0x76FC = 0x4E59
-0x7700 = 0x4E5A
-0x7706 = 0x4E5B
-0x770A = 0x4E5C
-0x770E = 0x4E5D
-0x7712 = 0x4E5E
-0x7714 = 0x4E5F
-0x7715 = 0x4E60
-0x7717 = 0x4E61
-0x7719 = 0x4E62
-0x771A = 0x4E63
-0x771C = 0x4E64
-0x7722 = 0x4E65
-0x7728 = 0x4E66
-0x772D = 0x4E67
-0x772E = 0x4E68
-0x772F = 0x4E69
-0x7734 = 0x4E6A
-0x7735 = 0x4E6B
-0x7736 = 0x4E6C
-0x7739 = 0x4E6D
-0x773D = 0x4E6E
-0x773E = 0x4E6F
-0x7742 = 0x4E70
-0x7745 = 0x4E71
-0x7746 = 0x4E72
-0x774A = 0x4E73
-0x774D = 0x4E74
-0x774E = 0x4E75
-0x774F = 0x4E76
-0x7752 = 0x4E77
-0x7756 = 0x4E78
-0x7757 = 0x4E79
-0x775C = 0x4E7A
-0x775E = 0x4E7B
-0x775F = 0x4E7C
-0x7760 = 0x4E7D
-0x7762 = 0x4E7E
-0x7764 = 0x4F21
-0x7767 = 0x4F22
-0x776A = 0x4F23
-0x776C = 0x4F24
-0x7770 = 0x4F25
-0x7772 = 0x4F26
-0x7773 = 0x4F27
-0x7774 = 0x4F28
-0x777A = 0x4F29
-0x777D = 0x4F2A
-0x7780 = 0x4F2B
-0x7784 = 0x4F2C
-0x778C = 0x4F2D
-0x778D = 0x4F2E
-0x7794 = 0x4F2F
-0x7795 = 0x4F30
-0x7796 = 0x4F31
-0x779A = 0x4F32
-0x779F = 0x4F33
-0x77A2 = 0x4F34
-0x77A7 = 0x4F35
-0x77AA = 0x4F36
-0x77AE = 0x4F37
-0x77AF = 0x4F38
-0x77B1 = 0x4F39
-0x77B5 = 0x4F3A
-0x77BE = 0x4F3B
-0x77C3 = 0x4F3C
-0x77C9 = 0x4F3D
-0x77D1 = 0x4F3E
-0x77D2 = 0x4F3F
-0x77D5 = 0x4F40
-0x77D9 = 0x4F41
-0x77DE = 0x4F42
-0x77DF = 0x4F43
-0x77E0 = 0x4F44
-0x77E4 = 0x4F45
-0x77E6 = 0x4F46
-0x77EA = 0x4F47
-0x77EC = 0x4F48
-0x77F0 = 0x4F49
-0x77F1 = 0x4F4A
-0x77F4 = 0x4F4B
-0x77F8 = 0x4F4C
-0x77FB = 0x4F4D
-0x7805 = 0x4F4E
-0x7806 = 0x4F4F
-0x7809 = 0x4F50
-0x780D = 0x4F51
-0x780E = 0x4F52
-0x7811 = 0x4F53
-0x781D = 0x4F54
-0x7821 = 0x4F55
-0x7822 = 0x4F56
-0x7823 = 0x4F57
-0x782D = 0x4F58
-0x782E = 0x4F59
-0x7830 = 0x4F5A
-0x7835 = 0x4F5B
-0x7837 = 0x4F5C
-0x7843 = 0x4F5D
-0x7844 = 0x4F5E
-0x7847 = 0x4F5F
-0x7848 = 0x4F60
-0x784C = 0x4F61
-0x784E = 0x4F62
-0x7852 = 0x4F63
-0x785C = 0x4F64
-0x785E = 0x4F65
-0x7860 = 0x4F66
-0x7861 = 0x4F67
-0x7863 = 0x4F68
-0x7864 = 0x4F69
-0x7868 = 0x4F6A
-0x786A = 0x4F6B
-0x786E = 0x4F6C
-0x787A = 0x4F6D
-0x787E = 0x4F6E
-0x788A = 0x4F6F
-0x788F = 0x4F70
-0x7894 = 0x4F71
-0x7898 = 0x4F72
-0x789D = 0x4F74
-0x789E = 0x4F75
-0x789F = 0x4F76
-0x78A1 = 0x4F73
-0x78A4 = 0x4F77
-0x78A8 = 0x4F78
-0x78AC = 0x4F79
-0x78AD = 0x4F7A
-0x78B0 = 0x4F7B
-0x78B1 = 0x4F7C
-0x78B2 = 0x4F7D
-0x78B3 = 0x4F7E
-0x78BB = 0x5021
-0x78BD = 0x5022
-0x78BF = 0x5023
-0x78C7 = 0x5024
-0x78C8 = 0x5025
-0x78C9 = 0x5026
-0x78CC = 0x5027
-0x78CE = 0x5028
-0x78D2 = 0x5029
-0x78D3 = 0x502A
-0x78D5 = 0x502B
-0x78D6 = 0x502C
-0x78DB = 0x502E
-0x78DF = 0x502F
-0x78E0 = 0x5030
-0x78E1 = 0x5031
-0x78E4 = 0x502D
-0x78E6 = 0x5032
-0x78EA = 0x5033
-0x78F2 = 0x5034
-0x78F3 = 0x5035
-0x78F6 = 0x5037
-0x78F7 = 0x5038
-0x78FA = 0x5039
-0x78FB = 0x503A
-0x78FF = 0x503B
-0x7900 = 0x5036
-0x7906 = 0x503C
-0x790C = 0x503D
-0x7910 = 0x503E
-0x791A = 0x503F
-0x791C = 0x5040
-0x791E = 0x5041
-0x791F = 0x5042
-0x7920 = 0x5043
-0x7925 = 0x5044
-0x7927 = 0x5045
-0x7929 = 0x5046
-0x792D = 0x5047
-0x7931 = 0x5048
-0x7934 = 0x5049
-0x7935 = 0x504A
-0x793B = 0x504B
-0x793D = 0x504C
-0x793F = 0x504D
-0x7944 = 0x504E
-0x7945 = 0x504F
-0x7946 = 0x5050
-0x794A = 0x5051
-0x794B = 0x5052
-0x794F = 0x5053
-0x7951 = 0x5054
-0x7954 = 0x5055
-0x7958 = 0x5056
-0x795B = 0x5057
-0x795C = 0x5058
-0x7967 = 0x5059
-0x7969 = 0x505A
-0x796B = 0x505B
-0x7972 = 0x505C
-0x7979 = 0x505D
-0x797B = 0x505E
-0x797C = 0x505F
-0x797E = 0x5060
-0x798B = 0x5061
-0x798C = 0x5062
-0x7991 = 0x5063
-0x7993 = 0x5064
-0x7994 = 0x5065
-0x7995 = 0x5066
-0x7996 = 0x5067
-0x7998 = 0x5068
-0x799B = 0x5069
-0x799C = 0x506A
-0x79A1 = 0x506B
-0x79A8 = 0x506C
-0x79A9 = 0x506D
-0x79AB = 0x506E
-0x79AF = 0x506F
-0x79B1 = 0x5070
-0x79B4 = 0x5071
-0x79B8 = 0x5072
-0x79BB = 0x5073
-0x79C2 = 0x5074
-0x79C4 = 0x5075
-0x79C7 = 0x5076
-0x79C8 = 0x5077
-0x79CA = 0x5078
-0x79CF = 0x5079
-0x79D4 = 0x507A
-0x79D6 = 0x507B
-0x79DA = 0x507C
-0x79DD = 0x507D
-0x79DE = 0x507E
-0x79E0 = 0x5121
-0x79E2 = 0x5122
-0x79E5 = 0x5123
-0x79EA = 0x5124
-0x79EB = 0x5125
-0x79ED = 0x5126
-0x79F1 = 0x5127
-0x79F8 = 0x5128
-0x79FC = 0x5129
-0x7A02 = 0x512A
-0x7A03 = 0x512B
-0x7A07 = 0x512C
-0x7A09 = 0x512D
-0x7A0A = 0x512E
-0x7A0C = 0x512F
-0x7A11 = 0x5130
-0x7A15 = 0x5131
-0x7A1B = 0x5132
-0x7A1E = 0x5133
-0x7A21 = 0x5134
-0x7A27 = 0x5135
-0x7A2B = 0x5136
-0x7A2D = 0x5137
-0x7A2F = 0x5138
-0x7A30 = 0x5139
-0x7A34 = 0x513A
-0x7A35 = 0x513B
-0x7A38 = 0x513C
-0x7A39 = 0x513D
-0x7A3A = 0x513E
-0x7A44 = 0x513F
-0x7A45 = 0x5140
-0x7A47 = 0x5141
-0x7A48 = 0x5142
-0x7A4C = 0x5143
-0x7A55 = 0x5144
-0x7A56 = 0x5145
-0x7A59 = 0x5146
-0x7A5C = 0x5147
-0x7A5D = 0x5148
-0x7A5F = 0x5149
-0x7A60 = 0x514A
-0x7A65 = 0x514B
-0x7A67 = 0x514C
-0x7A6A = 0x514D
-0x7A6D = 0x514E
-0x7A75 = 0x514F
-0x7A78 = 0x5150
-0x7A7E = 0x5151
-0x7A80 = 0x5152
-0x7A82 = 0x5153
-0x7A85 = 0x5154
-0x7A86 = 0x5155
-0x7A8A = 0x5156
-0x7A8B = 0x5157
-0x7A90 = 0x5158
-0x7A91 = 0x5159
-0x7A94 = 0x515A
-0x7A9E = 0x515B
-0x7AA0 = 0x515C
-0x7AA3 = 0x515D
-0x7AAC = 0x515E
-0x7AB3 = 0x515F
-0x7AB5 = 0x5160
-0x7AB9 = 0x5161
-0x7ABB = 0x5162
-0x7ABC = 0x5163
-0x7AC6 = 0x5164
-0x7AC9 = 0x5165
-0x7ACC = 0x5166
-0x7ACE = 0x5167
-0x7AD1 = 0x5168
-0x7ADB = 0x5169
-0x7AE8 = 0x516A
-0x7AE9 = 0x516B
-0x7AEB = 0x516C
-0x7AEC = 0x516D
-0x7AF1 = 0x516E
-0x7AF4 = 0x516F
-0x7AFB = 0x5170
-0x7AFD = 0x5171
-0x7AFE = 0x5172
-0x7B07 = 0x5173
-0x7B14 = 0x5174
-0x7B1F = 0x5175
-0x7B23 = 0x5176
-0x7B27 = 0x5177
-0x7B29 = 0x5178
-0x7B2A = 0x5179
-0x7B2B = 0x517A
-0x7B2D = 0x517B
-0x7B2E = 0x517C
-0x7B2F = 0x517D
-0x7B30 = 0x517E
-0x7B31 = 0x5221
-0x7B34 = 0x5222
-0x7B3D = 0x5223
-0x7B3F = 0x5224
-0x7B40 = 0x5225
-0x7B41 = 0x5226
-0x7B47 = 0x5227
-0x7B4E = 0x5228
-0x7B55 = 0x5229
-0x7B60 = 0x522A
-0x7B64 = 0x522B
-0x7B66 = 0x522C
-0x7B69 = 0x522D
-0x7B6A = 0x522E
-0x7B6D = 0x522F
-0x7B6F = 0x5230
-0x7B72 = 0x5231
-0x7B73 = 0x5232
-0x7B77 = 0x5233
-0x7B84 = 0x5234
-0x7B89 = 0x5235
-0x7B8E = 0x5236
-0x7B90 = 0x5237
-0x7B91 = 0x5238
-0x7B96 = 0x5239
-0x7B9B = 0x523A
-0x7B9E = 0x523B
-0x7BA0 = 0x523C
-0x7BA5 = 0x523D
-0x7BAC = 0x523E
-0x7BAF = 0x523F
-0x7BB0 = 0x5240
-0x7BB2 = 0x5241
-0x7BB5 = 0x5242
-0x7BB6 = 0x5243
-0x7BBA = 0x5244
-0x7BBB = 0x5245
-0x7BBC = 0x5246
-0x7BBD = 0x5247
-0x7BC2 = 0x5248
-0x7BC5 = 0x5249
-0x7BC8 = 0x524A
-0x7BCA = 0x524B
-0x7BD4 = 0x524C
-0x7BD6 = 0x524D
-0x7BD7 = 0x524E
-0x7BD9 = 0x524F
-0x7BDA = 0x5250
-0x7BDB = 0x5251
-0x7BE8 = 0x5252
-0x7BEA = 0x5253
-0x7BF2 = 0x5254
-0x7BF4 = 0x5255
-0x7BF5 = 0x5256
-0x7BF8 = 0x5257
-0x7BF9 = 0x5258
-0x7BFA = 0x5259
-0x7BFC = 0x525A
-0x7BFE = 0x525B
-0x7C01 = 0x525C
-0x7C02 = 0x525D
-0x7C03 = 0x525E
-0x7C04 = 0x525F
-0x7C06 = 0x5260
-0x7C09 = 0x5261
-0x7C0B = 0x5262
-0x7C0C = 0x5263
-0x7C0E = 0x5264
-0x7C0F = 0x5265
-0x7C19 = 0x5266
-0x7C1B = 0x5267
-0x7C20 = 0x5268
-0x7C25 = 0x5269
-0x7C26 = 0x526A
-0x7C28 = 0x526B
-0x7C2C = 0x526C
-0x7C31 = 0x526D
-0x7C33 = 0x526E
-0x7C34 = 0x526F
-0x7C36 = 0x5270
-0x7C39 = 0x5271
-0x7C3A = 0x5272
-0x7C46 = 0x5273
-0x7C4A = 0x5274
-0x7C51 = 0x5276
-0x7C52 = 0x5277
-0x7C53 = 0x5278
-0x7C55 = 0x5275
-0x7C59 = 0x5279
-0x7C5A = 0x527A
-0x7C5B = 0x527B
-0x7C5C = 0x527C
-0x7C5D = 0x527D
-0x7C5E = 0x527E
-0x7C61 = 0x5321
-0x7C63 = 0x5322
-0x7C67 = 0x5323
-0x7C69 = 0x5324
-0x7C6D = 0x5325
-0x7C6E = 0x5326
-0x7C70 = 0x5327
-0x7C72 = 0x5328
-0x7C79 = 0x5329
-0x7C7C = 0x532A
-0x7C7D = 0x532B
-0x7C86 = 0x532C
-0x7C87 = 0x532D
-0x7C8F = 0x532E
-0x7C94 = 0x532F
-0x7C9E = 0x5330
-0x7CA0 = 0x5331
-0x7CA6 = 0x5332
-0x7CB0 = 0x5333
-0x7CB6 = 0x5334
-0x7CB7 = 0x5335
-0x7CBA = 0x5336
-0x7CBB = 0x5337
-0x7CBC = 0x5338
-0x7CBF = 0x5339
-0x7CC4 = 0x533A
-0x7CC7 = 0x533B
-0x7CC8 = 0x533C
-0x7CC9 = 0x533D
-0x7CCD = 0x533E
-0x7CCF = 0x533F
-0x7CD3 = 0x5340
-0x7CD4 = 0x5341
-0x7CD5 = 0x5342
-0x7CD7 = 0x5343
-0x7CD9 = 0x5344
-0x7CDA = 0x5345
-0x7CDD = 0x5346
-0x7CE6 = 0x5347
-0x7CE9 = 0x5348
-0x7CEB = 0x5349
-0x7CF5 = 0x534A
-0x7D03 = 0x534B
-0x7D07 = 0x534C
-0x7D08 = 0x534D
-0x7D09 = 0x534E
-0x7D0F = 0x534F
-0x7D11 = 0x5350
-0x7D12 = 0x5351
-0x7D13 = 0x5352
-0x7D16 = 0x5353
-0x7D1D = 0x5354
-0x7D1E = 0x5355
-0x7D23 = 0x5356
-0x7D26 = 0x5357
-0x7D2A = 0x5358
-0x7D2D = 0x5359
-0x7D31 = 0x535A
-0x7D3C = 0x535B
-0x7D3D = 0x535C
-0x7D3E = 0x535D
-0x7D40 = 0x535E
-0x7D41 = 0x535F
-0x7D47 = 0x5360
-0x7D48 = 0x5361
-0x7D4D = 0x5362
-0x7D51 = 0x5363
-0x7D53 = 0x5364
-0x7D57 = 0x5365
-0x7D59 = 0x5366
-0x7D5A = 0x5367
-0x7D5C = 0x5368
-0x7D5D = 0x5369
-0x7D65 = 0x536A
-0x7D67 = 0x536B
-0x7D6A = 0x536C
-0x7D70 = 0x536D
-0x7D78 = 0x536E
-0x7D7A = 0x536F
-0x7D7B = 0x5370
-0x7D7F = 0x5371
-0x7D81 = 0x5372
-0x7D82 = 0x5373
-0x7D83 = 0x5374
-0x7D85 = 0x5375
-0x7D86 = 0x5376
-0x7D88 = 0x5377
-0x7D8B = 0x5378
-0x7D8C = 0x5379
-0x7D8D = 0x537A
-0x7D91 = 0x537B
-0x7D96 = 0x537C
-0x7D97 = 0x537D
-0x7D9D = 0x537E
-0x7D9E = 0x5421
-0x7DA6 = 0x5422
-0x7DA7 = 0x5423
-0x7DAA = 0x5424
-0x7DB3 = 0x5425
-0x7DB6 = 0x5426
-0x7DB7 = 0x5427
-0x7DB9 = 0x5428
-0x7DC2 = 0x5429
-0x7DC3 = 0x542A
-0x7DC4 = 0x542B
-0x7DC5 = 0x542C
-0x7DC6 = 0x542D
-0x7DCC = 0x542E
-0x7DCD = 0x542F
-0x7DCE = 0x5430
-0x7DD7 = 0x5431
-0x7DD9 = 0x5432
-0x7DE2 = 0x5434
-0x7DE5 = 0x5435
-0x7DE6 = 0x5436
-0x7DEA = 0x5437
-0x7DEB = 0x5438
-0x7DED = 0x5439
-0x7DF1 = 0x543A
-0x7DF5 = 0x543B
-0x7DF6 = 0x543C
-0x7DF9 = 0x543D
-0x7DFA = 0x543E
-0x7E00 = 0x5433
-0x7E08 = 0x543F
-0x7E10 = 0x5440
-0x7E11 = 0x5441
-0x7E15 = 0x5442
-0x7E17 = 0x5443
-0x7E1C = 0x5444
-0x7E1D = 0x5445
-0x7E20 = 0x5446
-0x7E27 = 0x5447
-0x7E28 = 0x5448
-0x7E2C = 0x5449
-0x7E2D = 0x544A
-0x7E2F = 0x544B
-0x7E33 = 0x544C
-0x7E36 = 0x544D
-0x7E3F = 0x544E
-0x7E44 = 0x544F
-0x7E45 = 0x5450
-0x7E47 = 0x5451
-0x7E4E = 0x5452
-0x7E50 = 0x5453
-0x7E52 = 0x5454
-0x7E58 = 0x5455
-0x7E5F = 0x5456
-0x7E61 = 0x5457
-0x7E62 = 0x5458
-0x7E65 = 0x5459
-0x7E6B = 0x545A
-0x7E6E = 0x545B
-0x7E6F = 0x545C
-0x7E73 = 0x545D
-0x7E78 = 0x545E
-0x7E7E = 0x545F
-0x7E81 = 0x5460
-0x7E86 = 0x5461
-0x7E87 = 0x5462
-0x7E8A = 0x5463
-0x7E8D = 0x5464
-0x7E91 = 0x5465
-0x7E95 = 0x5466
-0x7E98 = 0x5467
-0x7E9A = 0x5468
-0x7E9D = 0x5469
-0x7E9E = 0x546A
-0x7F3B = 0x546C
-0x7F3C = 0x546B
-0x7F3D = 0x546D
-0x7F3E = 0x546E
-0x7F3F = 0x546F
-0x7F43 = 0x5470
-0x7F44 = 0x5471
-0x7F47 = 0x5472
-0x7F4F = 0x5473
-0x7F52 = 0x5474
-0x7F53 = 0x5475
-0x7F5B = 0x5476
-0x7F5C = 0x5477
-0x7F5D = 0x5478
-0x7F61 = 0x5479
-0x7F63 = 0x547A
-0x7F64 = 0x547B
-0x7F65 = 0x547C
-0x7F66 = 0x547D
-0x7F6D = 0x547E
-0x7F71 = 0x5521
-0x7F7D = 0x5522
-0x7F7E = 0x5523
-0x7F7F = 0x5524
-0x7F80 = 0x5525
-0x7F8B = 0x5526
-0x7F8D = 0x5527
-0x7F8F = 0x5528
-0x7F90 = 0x5529
-0x7F91 = 0x552A
-0x7F96 = 0x552B
-0x7F97 = 0x552C
-0x7F9C = 0x552D
-0x7FA1 = 0x552E
-0x7FA2 = 0x552F
-0x7FA6 = 0x5530
-0x7FAA = 0x5531
-0x7FAD = 0x5532
-0x7FB4 = 0x5533
-0x7FBC = 0x5534
-0x7FBF = 0x5535
-0x7FC0 = 0x5536
-0x7FC3 = 0x5537
-0x7FC8 = 0x5538
-0x7FCE = 0x5539
-0x7FCF = 0x553A
-0x7FDB = 0x553B
-0x7FDF = 0x553C
-0x7FE3 = 0x553D
-0x7FE5 = 0x553E
-0x7FE8 = 0x553F
-0x7FEC = 0x5540
-0x7FEE = 0x5541
-0x7FEF = 0x5542
-0x7FF2 = 0x5543
-0x7FFA = 0x5544
-0x7FFD = 0x5545
-0x7FFE = 0x5546
-0x7FFF = 0x5547
-0x8007 = 0x5548
-0x8008 = 0x5549
-0x800A = 0x554A
-0x800D = 0x554B
-0x800E = 0x554C
-0x800F = 0x554D
-0x8011 = 0x554E
-0x8013 = 0x554F
-0x8014 = 0x5550
-0x8016 = 0x5551
-0x801D = 0x5552
-0x801E = 0x5553
-0x801F = 0x5554
-0x8020 = 0x5555
-0x8024 = 0x5556
-0x8026 = 0x5557
-0x802C = 0x5558
-0x802E = 0x5559
-0x8030 = 0x555A
-0x8034 = 0x555B
-0x8035 = 0x555C
-0x8037 = 0x555D
-0x8039 = 0x555E
-0x803A = 0x555F
-0x803C = 0x5560
-0x803E = 0x5561
-0x8040 = 0x5562
-0x8044 = 0x5563
-0x8060 = 0x5564
-0x8064 = 0x5565
-0x8066 = 0x5566
-0x806D = 0x5567
-0x8071 = 0x5568
-0x8075 = 0x5569
-0x8081 = 0x556A
-0x8088 = 0x556B
-0x808E = 0x556C
-0x809C = 0x556D
-0x809E = 0x556E
-0x80A6 = 0x556F
-0x80A7 = 0x5570
-0x80AB = 0x5571
-0x80B8 = 0x5572
-0x80B9 = 0x5573
-0x80C8 = 0x5574
-0x80CD = 0x5575
-0x80CF = 0x5576
-0x80D2 = 0x5577
-0x80D4 = 0x5578
-0x80D5 = 0x5579
-0x80D7 = 0x557A
-0x80D8 = 0x557B
-0x80E0 = 0x557C
-0x80ED = 0x557D
-0x80EE = 0x557E
-0x80F0 = 0x5621
-0x80F2 = 0x5622
-0x80F3 = 0x5623
-0x80F6 = 0x5624
-0x80F9 = 0x5625
-0x80FA = 0x5626
-0x80FE = 0x5627
-0x8103 = 0x5628
-0x810B = 0x5629
-0x8116 = 0x562A
-0x8117 = 0x562B
-0x8118 = 0x562C
-0x811C = 0x562D
-0x811E = 0x562E
-0x8120 = 0x562F
-0x8124 = 0x5630
-0x8127 = 0x5631
-0x812C = 0x5632
-0x8130 = 0x5633
-0x8135 = 0x5634
-0x813A = 0x5635
-0x813C = 0x5636
-0x8145 = 0x5637
-0x8147 = 0x5638
-0x814A = 0x5639
-0x814C = 0x563A
-0x8152 = 0x563B
-0x8157 = 0x563C
-0x8160 = 0x563D
-0x8161 = 0x563E
-0x8167 = 0x563F
-0x8168 = 0x5640
-0x8169 = 0x5641
-0x816D = 0x5642
-0x816F = 0x5643
-0x8177 = 0x5644
-0x8181 = 0x5645
-0x8184 = 0x5647
-0x8185 = 0x5648
-0x8186 = 0x5649
-0x818B = 0x564A
-0x818E = 0x564B
-0x8190 = 0x5646
-0x8196 = 0x564C
-0x8198 = 0x564D
-0x819B = 0x564E
-0x819E = 0x564F
-0x81A2 = 0x5650
-0x81AE = 0x5651
-0x81B2 = 0x5652
-0x81B4 = 0x5653
-0x81BB = 0x5654
-0x81C3 = 0x5656
-0x81C5 = 0x5657
-0x81CA = 0x5658
-0x81CB = 0x5655
-0x81CE = 0x5659
-0x81CF = 0x565A
-0x81D5 = 0x565B
-0x81D7 = 0x565C
-0x81DB = 0x565D
-0x81DD = 0x565E
-0x81DE = 0x565F
-0x81E1 = 0x5660
-0x81E4 = 0x5661
-0x81EB = 0x5662
-0x81EC = 0x5663
-0x81F0 = 0x5664
-0x81F1 = 0x5665
-0x81F2 = 0x5666
-0x81F5 = 0x5667
-0x81F6 = 0x5668
-0x81F8 = 0x5669
-0x81F9 = 0x566A
-0x81FD = 0x566B
-0x81FF = 0x566C
-0x8200 = 0x566D
-0x8203 = 0x566E
-0x820F = 0x566F
-0x8213 = 0x5670
-0x8214 = 0x5671
-0x8219 = 0x5672
-0x821A = 0x5673
-0x821D = 0x5674
-0x8221 = 0x5675
-0x8222 = 0x5676
-0x8228 = 0x5677
-0x8232 = 0x5678
-0x8234 = 0x5679
-0x823A = 0x567A
-0x8243 = 0x567B
-0x8244 = 0x567C
-0x8245 = 0x567D
-0x8246 = 0x567E
-0x824B = 0x5721
-0x824E = 0x5722
-0x824F = 0x5723
-0x8251 = 0x5724
-0x8256 = 0x5725
-0x825C = 0x5726
-0x8260 = 0x5727
-0x8263 = 0x5728
-0x8267 = 0x5729
-0x826D = 0x572A
-0x8274 = 0x572B
-0x827B = 0x572C
-0x827D = 0x572D
-0x827F = 0x572E
-0x8280 = 0x572F
-0x8281 = 0x5730
-0x8283 = 0x5731
-0x8284 = 0x5732
-0x8287 = 0x5733
-0x8289 = 0x5734
-0x828A = 0x5735
-0x828E = 0x5736
-0x8291 = 0x5737
-0x8294 = 0x5738
-0x8296 = 0x5739
-0x8298 = 0x573A
-0x829A = 0x573B
-0x829B = 0x573C
-0x82A0 = 0x573D
-0x82A1 = 0x573E
-0x82A3 = 0x573F
-0x82A4 = 0x5740
-0x82A7 = 0x5741
-0x82A8 = 0x5742
-0x82A9 = 0x5743
-0x82AA = 0x5744
-0x82AE = 0x5745
-0x82B0 = 0x5746
-0x82B2 = 0x5747
-0x82B4 = 0x5748
-0x82B7 = 0x5749
-0x82BA = 0x574A
-0x82BC = 0x574B
-0x82BE = 0x574C
-0x82BF = 0x574D
-0x82C6 = 0x574E
-0x82D0 = 0x574F
-0x82D5 = 0x5750
-0x82DA = 0x5751
-0x82E0 = 0x5752
-0x82E2 = 0x5753
-0x82E4 = 0x5754
-0x82E8 = 0x5755
-0x82EA = 0x5756
-0x82ED = 0x5757
-0x82EF = 0x5758
-0x82F6 = 0x5759
-0x82F7 = 0x575A
-0x82FD = 0x575B
-0x82FE = 0x575C
-0x8300 = 0x575D
-0x8301 = 0x575E
-0x8307 = 0x575F
-0x8308 = 0x5760
-0x830A = 0x5761
-0x830B = 0x5762
-0x831B = 0x5764
-0x831D = 0x5765
-0x831E = 0x5766
-0x831F = 0x5767
-0x8321 = 0x5768
-0x8322 = 0x5769
-0x832C = 0x576A
-0x832D = 0x576B
-0x832E = 0x576C
-0x8330 = 0x576D
-0x8333 = 0x576E
-0x8337 = 0x576F
-0x833A = 0x5770
-0x833C = 0x5771
-0x833D = 0x5772
-0x8342 = 0x5773
-0x8343 = 0x5774
-0x8344 = 0x5775
-0x8347 = 0x5776
-0x834D = 0x5777
-0x834E = 0x5778
-0x8351 = 0x5779
-0x8353 = 0x583E
-0x8354 = 0x5763
-0x8355 = 0x577A
-0x8356 = 0x577B
-0x8357 = 0x577C
-0x8370 = 0x577D
-0x8378 = 0x577E
-0x837D = 0x5821
-0x837F = 0x5822
-0x8380 = 0x5823
-0x8382 = 0x5824
-0x8384 = 0x5825
-0x8386 = 0x5826
-0x838D = 0x5827
-0x8392 = 0x5828
-0x8394 = 0x5829
-0x8395 = 0x582A
-0x8398 = 0x582B
-0x8399 = 0x582C
-0x839B = 0x582D
-0x839C = 0x582E
-0x839D = 0x582F
-0x83A6 = 0x5830
-0x83A7 = 0x5831
-0x83A9 = 0x5832
-0x83AC = 0x5833
-0x83AD = 0x584C
-0x83BE = 0x5834
-0x83BF = 0x5835
-0x83C0 = 0x5836
-0x83C7 = 0x5837
-0x83C9 = 0x5838
-0x83CF = 0x5839
-0x83D0 = 0x583A
-0x83D1 = 0x583B
-0x83D4 = 0x583C
-0x83DD = 0x583D
-0x83E8 = 0x583F
-0x83EA = 0x5840
-0x83F6 = 0x5841
-0x83F8 = 0x5842
-0x83F9 = 0x5843
-0x83FC = 0x5844
-0x8401 = 0x5845
-0x8406 = 0x5846
-0x840A = 0x5847
-0x840F = 0x5848
-0x8411 = 0x5849
-0x8415 = 0x584A
-0x8419 = 0x584B
-0x842F = 0x584D
-0x8439 = 0x584E
-0x8445 = 0x584F
-0x8447 = 0x5850
-0x8448 = 0x5851
-0x844A = 0x5852
-0x844D = 0x5853
-0x844F = 0x5854
-0x8451 = 0x5855
-0x8452 = 0x5856
-0x8456 = 0x5857
-0x8458 = 0x5858
-0x8459 = 0x5859
-0x845A = 0x585A
-0x845C = 0x585B
-0x8460 = 0x585C
-0x8464 = 0x585D
-0x8465 = 0x585E
-0x8467 = 0x585F
-0x846A = 0x5860
-0x8470 = 0x5861
-0x8473 = 0x5862
-0x8474 = 0x5863
-0x8476 = 0x5864
-0x8478 = 0x5865
-0x847C = 0x5866
-0x847D = 0x5867
-0x8481 = 0x5868
-0x8485 = 0x5869
-0x8492 = 0x586A
-0x8493 = 0x586B
-0x8495 = 0x586C
-0x849E = 0x586D
-0x84A6 = 0x586E
-0x84A8 = 0x586F
-0x84A9 = 0x5870
-0x84AA = 0x5871
-0x84AF = 0x5872
-0x84B1 = 0x5873
-0x84B4 = 0x5874
-0x84BA = 0x5875
-0x84BD = 0x5876
-0x84BE = 0x5877
-0x84C0 = 0x5878
-0x84C2 = 0x5879
-0x84C7 = 0x587A
-0x84C8 = 0x587B
-0x84CC = 0x587C
-0x84CF = 0x587D
-0x84D3 = 0x587E
-0x84DC = 0x5921
-0x84E7 = 0x5922
-0x84EA = 0x5923
-0x84EF = 0x5924
-0x84F0 = 0x5925
-0x84F1 = 0x5926
-0x84F2 = 0x5927
-0x84F7 = 0x5928
-0x84FA = 0x592A
-0x84FB = 0x592B
-0x84FD = 0x592C
-0x8502 = 0x592D
-0x8503 = 0x592E
-0x8507 = 0x592F
-0x850C = 0x5930
-0x850E = 0x5931
-0x8510 = 0x5932
-0x851C = 0x5933
-0x851E = 0x5934
-0x8522 = 0x5935
-0x8523 = 0x5936
-0x8524 = 0x5937
-0x8525 = 0x5938
-0x8527 = 0x5939
-0x852A = 0x593A
-0x852B = 0x593B
-0x852F = 0x593C
-0x8532 = 0x5929
-0x8533 = 0x593D
-0x8534 = 0x593E
-0x8536 = 0x593F
-0x853F = 0x5940
-0x8546 = 0x5941
-0x854F = 0x5942
-0x8550 = 0x5943
-0x8551 = 0x5944
-0x8552 = 0x5945
-0x8553 = 0x5946
-0x8556 = 0x5947
-0x8559 = 0x5948
-0x855C = 0x5949
-0x855D = 0x594A
-0x855E = 0x594B
-0x855F = 0x594C
-0x8560 = 0x594D
-0x8561 = 0x594E
-0x8562 = 0x594F
-0x8564 = 0x5950
-0x856B = 0x5951
-0x856F = 0x5952
-0x8579 = 0x5953
-0x857A = 0x5954
-0x857B = 0x5955
-0x857D = 0x5956
-0x857F = 0x5957
-0x8581 = 0x5958
-0x8585 = 0x5959
-0x8586 = 0x595A
-0x8589 = 0x595B
-0x858B = 0x595C
-0x858C = 0x595D
-0x858F = 0x595E
-0x8593 = 0x595F
-0x8598 = 0x5960
-0x859D = 0x5961
-0x859F = 0x5962
-0x85A0 = 0x5963
-0x85A2 = 0x5964
-0x85A5 = 0x5965
-0x85A7 = 0x5966
-0x85AD = 0x5974
-0x85B4 = 0x5967
-0x85B6 = 0x5968
-0x85B7 = 0x5969
-0x85B8 = 0x596A
-0x85BC = 0x596B
-0x85BD = 0x596C
-0x85BE = 0x596D
-0x85BF = 0x596E
-0x85C2 = 0x596F
-0x85C7 = 0x5970
-0x85CA = 0x5971
-0x85CB = 0x5972
-0x85CE = 0x5973
-0x85D8 = 0x5975
-0x85DA = 0x5976
-0x85DF = 0x5977
-0x85E0 = 0x5978
-0x85E6 = 0x5979
-0x85E8 = 0x597A
-0x85ED = 0x597B
-0x85F3 = 0x597C
-0x85F6 = 0x597D
-0x85FC = 0x597E
-0x85FF = 0x5A21
-0x8600 = 0x5A22
-0x8604 = 0x5A23
-0x8605 = 0x5A24
-0x860D = 0x5A25
-0x860E = 0x5A26
-0x8610 = 0x5A27
-0x8611 = 0x5A28
-0x8612 = 0x5A29
-0x8618 = 0x5A2A
-0x8619 = 0x5A2B
-0x861B = 0x5A2C
-0x861E = 0x5A2D
-0x8621 = 0x5A2E
-0x8627 = 0x5A2F
-0x8629 = 0x5A30
-0x8636 = 0x5A31
-0x8638 = 0x5A32
-0x863A = 0x5A33
-0x863C = 0x5A34
-0x863D = 0x5A35
-0x8640 = 0x5A36
-0x8641 = 0x3866
-0x8642 = 0x5A37
-0x8646 = 0x5A38
-0x8652 = 0x5A39
-0x8653 = 0x5A3A
-0x8656 = 0x5A3B
-0x8657 = 0x5A3C
-0x8658 = 0x5A3D
-0x8659 = 0x5A3E
-0x865D = 0x5A3F
-0x8660 = 0x5A40
-0x8661 = 0x5A41
-0x8662 = 0x5A42
-0x8663 = 0x5A43
-0x8664 = 0x5A44
-0x8669 = 0x5A45
-0x866C = 0x5A46
-0x866F = 0x5A47
-0x8675 = 0x5A48
-0x8676 = 0x5A49
-0x8677 = 0x5A4A
-0x867A = 0x5A4B
-0x8688 = 0x5A6D
-0x868D = 0x5A4C
-0x8691 = 0x5A4D
-0x8696 = 0x5A4E
-0x8698 = 0x5A4F
-0x869A = 0x5A50
-0x869C = 0x5A51
-0x86A1 = 0x5A52
-0x86A6 = 0x5A53
-0x86A7 = 0x5A54
-0x86A8 = 0x5A55
-0x86AD = 0x5A56
-0x86B1 = 0x5A57
-0x86B3 = 0x5A58
-0x86B4 = 0x5A59
-0x86B5 = 0x5A5A
-0x86B7 = 0x5A5B
-0x86B8 = 0x5A5C
-0x86B9 = 0x5A5D
-0x86BF = 0x5A5E
-0x86C0 = 0x5A5F
-0x86C1 = 0x5A60
-0x86C3 = 0x5A61
-0x86C5 = 0x5A62
-0x86D1 = 0x5A63
-0x86D2 = 0x5A64
-0x86D5 = 0x5A65
-0x86D7 = 0x5A66
-0x86DA = 0x5A67
-0x86DC = 0x5A68
-0x86E0 = 0x5A69
-0x86E3 = 0x5A6A
-0x86E5 = 0x5A6B
-0x86E7 = 0x5A6C
-0x86FA = 0x5A6E
-0x86FC = 0x5A6F
-0x86FD = 0x5A70
-0x8704 = 0x5A71
-0x8705 = 0x5A72
-0x8707 = 0x5A73
-0x870B = 0x5A74
-0x870E = 0x5A75
-0x870F = 0x5A76
-0x8710 = 0x5A77
-0x8713 = 0x5A78
-0x8714 = 0x5A79
-0x8719 = 0x5A7A
-0x871E = 0x5A7B
-0x871F = 0x5A7C
-0x8721 = 0x5A7D
-0x8723 = 0x5A7E
-0x8728 = 0x5B21
-0x872E = 0x5B22
-0x872F = 0x5B23
-0x8731 = 0x5B24
-0x8732 = 0x5B25
-0x8739 = 0x5B26
-0x873A = 0x5B27
-0x873C = 0x5B28
-0x873D = 0x5B29
-0x873E = 0x5B2A
-0x8740 = 0x5B2B
-0x8743 = 0x5B2C
-0x8745 = 0x5B2D
-0x874D = 0x5B2E
-0x8758 = 0x5B2F
-0x875D = 0x5B30
-0x8761 = 0x5B31
-0x8764 = 0x5B32
-0x8765 = 0x5B33
-0x876F = 0x5B34
-0x8771 = 0x5B35
-0x8772 = 0x5B36
-0x877B = 0x5B37
-0x8783 = 0x5B38
-0x8784 = 0x5B39
-0x8785 = 0x5B3A
-0x8786 = 0x5B3B
-0x8787 = 0x5B3C
-0x8788 = 0x5B3D
-0x8789 = 0x5B3E
-0x878B = 0x5B3F
-0x878C = 0x5B40
-0x8790 = 0x5B41
-0x8793 = 0x5B42
-0x8795 = 0x5B43
-0x8797 = 0x5B44
-0x8798 = 0x5B45
-0x8799 = 0x5B46
-0x879E = 0x5B47
-0x87A0 = 0x5B48
-0x87A3 = 0x5B49
-0x87A7 = 0x5B4A
-0x87AC = 0x5B4B
-0x87AD = 0x5B4C
-0x87AE = 0x5B4D
-0x87B1 = 0x5B4E
-0x87B5 = 0x5B4F
-0x87BE = 0x5B50
-0x87BF = 0x5B51
-0x87C1 = 0x5B52
-0x87C8 = 0x5B53
-0x87C9 = 0x5B54
-0x87CA = 0x5B55
-0x87CE = 0x5B56
-0x87D5 = 0x5B57
-0x87D6 = 0x5B58
-0x87D9 = 0x5B59
-0x87DA = 0x5B5A
-0x87DC = 0x5B5B
-0x87DF = 0x5B5C
-0x87E2 = 0x5B5D
-0x87E3 = 0x5B5E
-0x87E4 = 0x5B5F
-0x87EA = 0x5B60
-0x87EB = 0x5B61
-0x87ED = 0x5B62
-0x87F1 = 0x5B63
-0x87F3 = 0x5B64
-0x87F8 = 0x5B65
-0x87FA = 0x5B66
-0x87FF = 0x5B67
-0x8801 = 0x5B68
-0x8803 = 0x5B69
-0x8806 = 0x5B6A
-0x8809 = 0x5B6B
-0x880A = 0x5B6C
-0x880B = 0x5B6D
-0x8810 = 0x5B6E
-0x8812 = 0x5B70
-0x8813 = 0x5B71
-0x8814 = 0x5B72
-0x8818 = 0x5B73
-0x8819 = 0x5B6F
-0x881A = 0x5B74
-0x881B = 0x5B75
-0x881C = 0x5B76
-0x881E = 0x5B77
-0x881F = 0x5B78
-0x8828 = 0x5B79
-0x882D = 0x5B7A
-0x882E = 0x5B7B
-0x8830 = 0x5B7C
-0x8832 = 0x5B7D
-0x8835 = 0x5B7E
-0x883A = 0x5C21
-0x883C = 0x5C22
-0x8841 = 0x5C23
-0x8843 = 0x5C24
-0x8845 = 0x5C25
-0x8848 = 0x5C26
-0x8849 = 0x5C27
-0x884A = 0x5C28
-0x884B = 0x5C29
-0x884E = 0x5C2A
-0x8851 = 0x5C2B
-0x8855 = 0x5C2C
-0x8856 = 0x5C2D
-0x8858 = 0x5C2E
-0x885A = 0x5C2F
-0x885C = 0x5C30
-0x885F = 0x5C31
-0x8860 = 0x5C32
-0x8864 = 0x5C33
-0x8869 = 0x5C34
-0x8871 = 0x5C35
-0x8879 = 0x5C36
-0x887B = 0x5C37
-0x8880 = 0x5C38
-0x8898 = 0x5C39
-0x889A = 0x5C3A
-0x889B = 0x5C3B
-0x889C = 0x5C3C
-0x889F = 0x5C3D
-0x88A0 = 0x5C3E
-0x88A8 = 0x5C3F
-0x88AA = 0x5C40
-0x88BA = 0x5C41
-0x88BD = 0x5C42
-0x88BE = 0x5C43
-0x88C0 = 0x5C44
-0x88CA = 0x5C45
-0x88CB = 0x5C46
-0x88CC = 0x5C47
-0x88CD = 0x5C48
-0x88CE = 0x5C49
-0x88D1 = 0x5C4A
-0x88D2 = 0x5C4B
-0x88D3 = 0x5C4C
-0x88DB = 0x5C4D
-0x88DE = 0x5C4E
-0x88E7 = 0x5C4F
-0x88EF = 0x5C50
-0x88F0 = 0x5C51
-0x88F1 = 0x5C52
-0x88F5 = 0x5C53
-0x88F7 = 0x5C54
-0x8901 = 0x5C55
-0x8906 = 0x5C56
-0x890D = 0x5C57
-0x890E = 0x5C58
-0x890F = 0x5C59
-0x8915 = 0x5C5A
-0x8916 = 0x5C5B
-0x8918 = 0x5C5C
-0x8919 = 0x5C5D
-0x891A = 0x5C5E
-0x891C = 0x5C5F
-0x8920 = 0x5C60
-0x8926 = 0x5C61
-0x8927 = 0x5C62
-0x8928 = 0x5C63
-0x8930 = 0x5C64
-0x8931 = 0x5C65
-0x8932 = 0x5C66
-0x8935 = 0x5C67
-0x8939 = 0x5C68
-0x893A = 0x5C69
-0x893E = 0x5C6A
-0x8940 = 0x5C6B
-0x8942 = 0x5C6C
-0x8945 = 0x5C6D
-0x8946 = 0x5C6E
-0x8949 = 0x5C6F
-0x894F = 0x5C70
-0x8952 = 0x5C71
-0x8957 = 0x5C72
-0x895A = 0x5C73
-0x895B = 0x5C74
-0x895C = 0x5C75
-0x8961 = 0x5C76
-0x8962 = 0x5C77
-0x8963 = 0x5C78
-0x896B = 0x5C79
-0x896E = 0x5C7A
-0x8970 = 0x5C7B
-0x8973 = 0x5C7C
-0x8975 = 0x5C7D
-0x897A = 0x5C7E
-0x897B = 0x5D21
-0x897C = 0x5D22
-0x897D = 0x5D23
-0x8989 = 0x5D24
-0x898D = 0x5D25
-0x8990 = 0x5D26
-0x8994 = 0x5D27
-0x8995 = 0x5D28
-0x899B = 0x5D29
-0x899C = 0x5D2A
-0x899F = 0x5D2B
-0x89A0 = 0x5D2C
-0x89A5 = 0x5D2D
-0x89B0 = 0x5D2E
-0x89B4 = 0x5D2F
-0x89B5 = 0x5D30
-0x89B6 = 0x5D31
-0x89B7 = 0x5D32
-0x89BC = 0x5D33
-0x89D4 = 0x5D34
-0x89D5 = 0x5D35
-0x89D6 = 0x5D36
-0x89D7 = 0x5D37
-0x89D8 = 0x5D38
-0x89E5 = 0x5D39
-0x89E9 = 0x5D3A
-0x89EB = 0x5D3B
-0x89ED = 0x5D3C
-0x89F1 = 0x5D3D
-0x89F3 = 0x5D3E
-0x89F6 = 0x5D3F
-0x89F9 = 0x5D40
-0x89FD = 0x5D41
-0x89FF = 0x5D42
-0x8A04 = 0x5D43
-0x8A05 = 0x5D44
-0x8A07 = 0x5D45
-0x8A0F = 0x5D46
-0x8A11 = 0x5D47
-0x8A12 = 0x5D48
-0x8A14 = 0x5D49
-0x8A15 = 0x5D4A
-0x8A1E = 0x5D4B
-0x8A20 = 0x5D4C
-0x8A22 = 0x5D4D
-0x8A24 = 0x5D4E
-0x8A26 = 0x5D4F
-0x8A2B = 0x5D50
-0x8A2C = 0x5D51
-0x8A2F = 0x5D52
-0x8A35 = 0x5D53
-0x8A37 = 0x5D54
-0x8A3D = 0x5D55
-0x8A3E = 0x5D56
-0x8A40 = 0x5D57
-0x8A43 = 0x5D58
-0x8A45 = 0x5D59
-0x8A47 = 0x5D5A
-0x8A49 = 0x5D5B
-0x8A4D = 0x5D5C
-0x8A4E = 0x5D5D
-0x8A53 = 0x5D5E
-0x8A56 = 0x5D5F
-0x8A57 = 0x5D60
-0x8A58 = 0x5D61
-0x8A5C = 0x5D62
-0x8A5D = 0x5D63
-0x8A61 = 0x5D64
-0x8A65 = 0x5D65
-0x8A67 = 0x5D66
-0x8A75 = 0x5D67
-0x8A76 = 0x5D68
-0x8A77 = 0x5D69
-0x8A79 = 0x5D6A
-0x8A7A = 0x5D6B
-0x8A7B = 0x5D6C
-0x8A7E = 0x5D6D
-0x8A7F = 0x5D6E
-0x8A80 = 0x5D6F
-0x8A83 = 0x5D70
-0x8A86 = 0x5D71
-0x8A8B = 0x5D72
-0x8A8F = 0x5D73
-0x8A90 = 0x5D74
-0x8A92 = 0x5D75
-0x8A96 = 0x5D76
-0x8A97 = 0x5D77
-0x8A99 = 0x5D78
-0x8A9F = 0x5D79
-0x8AA7 = 0x5D7A
-0x8AA9 = 0x5D7B
-0x8AAE = 0x5D7C
-0x8AAF = 0x5D7D
-0x8AB3 = 0x5D7E
-0x8AB6 = 0x5E21
-0x8AB7 = 0x5E22
-0x8ABB = 0x5E23
-0x8ABE = 0x5E24
-0x8AC3 = 0x5E25
-0x8AC6 = 0x5E26
-0x8AC8 = 0x5E27
-0x8AC9 = 0x5E28
-0x8ACA = 0x5E29
-0x8AD1 = 0x5E2A
-0x8AD3 = 0x5E2B
-0x8AD4 = 0x5E2C
-0x8AD5 = 0x5E2D
-0x8AD7 = 0x5E2E
-0x8ADD = 0x5E2F
-0x8ADF = 0x5E30
-0x8AEC = 0x5E31
-0x8AF0 = 0x5E32
-0x8AF4 = 0x5E33
-0x8AF5 = 0x5E34
-0x8AF6 = 0x5E35
-0x8AFC = 0x5E36
-0x8AFF = 0x5E37
-0x8B05 = 0x5E38
-0x8B06 = 0x5E39
-0x8B0A = 0x5E3F
-0x8B0B = 0x5E3A
-0x8B11 = 0x5E3B
-0x8B1C = 0x5E3C
-0x8B1E = 0x5E3D
-0x8B1F = 0x5E3E
-0x8B2D = 0x5E40
-0x8B30 = 0x5E41
-0x8B37 = 0x5E42
-0x8B3C = 0x5E43
-0x8B42 = 0x5E44
-0x8B43 = 0x5E45
-0x8B44 = 0x5E46
-0x8B45 = 0x5E47
-0x8B46 = 0x5E48
-0x8B48 = 0x5E49
-0x8B4D = 0x5E4E
-0x8B52 = 0x5E4A
-0x8B53 = 0x5E4B
-0x8B54 = 0x5E4C
-0x8B59 = 0x5E4D
-0x8B5E = 0x5E4F
-0x8B63 = 0x5E50
-0x8B6D = 0x5E51
-0x8B76 = 0x5E52
-0x8B78 = 0x5E53
-0x8B79 = 0x5E54
-0x8B7C = 0x5E55
-0x8B7E = 0x5E56
-0x8B81 = 0x5E57
-0x8B84 = 0x5E58
-0x8B85 = 0x5E59
-0x8B8B = 0x5E5A
-0x8B8D = 0x5E5B
-0x8B8F = 0x5E5C
-0x8B94 = 0x5E5D
-0x8B95 = 0x5E5E
-0x8B9C = 0x5E5F
-0x8B9E = 0x5E60
-0x8B9F = 0x5E61
-0x8C38 = 0x5E62
-0x8C39 = 0x5E63
-0x8C3D = 0x5E64
-0x8C3E = 0x5E65
-0x8C45 = 0x5E66
-0x8C47 = 0x5E67
-0x8C49 = 0x5E68
-0x8C4B = 0x5E69
-0x8C4F = 0x5E6A
-0x8C51 = 0x5E6B
-0x8C53 = 0x5E6C
-0x8C54 = 0x5E6D
-0x8C57 = 0x5E6E
-0x8C58 = 0x5E6F
-0x8C59 = 0x5E72
-0x8C5B = 0x5E70
-0x8C5D = 0x5E71
-0x8C63 = 0x5E73
-0x8C64 = 0x5E74
-0x8C66 = 0x5E75
-0x8C68 = 0x5E76
-0x8C69 = 0x5E77
-0x8C6D = 0x5E78
-0x8C73 = 0x5E79
-0x8C75 = 0x5E7A
-0x8C76 = 0x5E7B
-0x8C7B = 0x5E7C
-0x8C7E = 0x5E7D
-0x8C86 = 0x5E7E
-0x8C87 = 0x5F21
-0x8C8B = 0x5F22
-0x8C90 = 0x5F23
-0x8C92 = 0x5F24
-0x8C93 = 0x5F25
-0x8C99 = 0x5F26
-0x8C9B = 0x5F27
-0x8C9C = 0x5F28
-0x8CA4 = 0x5F29
-0x8CB9 = 0x5F2A
-0x8CBA = 0x5F2B
-0x8CC5 = 0x5F2C
-0x8CC6 = 0x5F2D
-0x8CC9 = 0x5F2E
-0x8CCB = 0x5F2F
-0x8CCF = 0x5F30
-0x8CD5 = 0x5F32
-0x8CD6 = 0x5F31
-0x8CD9 = 0x5F33
-0x8CDD = 0x5F34
-0x8CE1 = 0x5F35
-0x8CE8 = 0x5F36
-0x8CEC = 0x5F37
-0x8CEF = 0x5F38
-0x8CF0 = 0x5F39
-0x8CF2 = 0x5F3A
-0x8CF5 = 0x5F3B
-0x8CF7 = 0x5F3C
-0x8CF8 = 0x5F3D
-0x8CFE = 0x5F3E
-0x8CFF = 0x5F3F
-0x8D01 = 0x5F40
-0x8D03 = 0x5F41
-0x8D09 = 0x5F42
-0x8D12 = 0x5F43
-0x8D17 = 0x5F44
-0x8D1B = 0x5F45
-0x8D65 = 0x5F46
-0x8D69 = 0x5F47
-0x8D6C = 0x5F48
-0x8D6E = 0x5F49
-0x8D7F = 0x5F4A
-0x8D82 = 0x5F4B
-0x8D84 = 0x5F4C
-0x8D88 = 0x5F4D
-0x8D8D = 0x5F4E
-0x8D90 = 0x5F4F
-0x8D91 = 0x5F50
-0x8D95 = 0x5F51
-0x8D9E = 0x5F52
-0x8D9F = 0x5F53
-0x8DA0 = 0x5F54
-0x8DA6 = 0x5F55
-0x8DAB = 0x5F56
-0x8DAC = 0x5F57
-0x8DAF = 0x5F58
-0x8DB2 = 0x5F59
-0x8DB5 = 0x5F5A
-0x8DB7 = 0x5F5B
-0x8DB9 = 0x5F5C
-0x8DBB = 0x5F5D
-0x8DBC = 0x5F6F
-0x8DC0 = 0x5F5E
-0x8DC5 = 0x5F5F
-0x8DC6 = 0x5F60
-0x8DC7 = 0x5F61
-0x8DC8 = 0x5F62
-0x8DCA = 0x5F63
-0x8DCE = 0x5F64
-0x8DD1 = 0x5F65
-0x8DD4 = 0x5F66
-0x8DD5 = 0x5F67
-0x8DD7 = 0x5F68
-0x8DD9 = 0x5F69
-0x8DE4 = 0x5F6A
-0x8DE5 = 0x5F6B
-0x8DE7 = 0x5F6C
-0x8DEC = 0x5F6D
-0x8DF0 = 0x5F6E
-0x8DF1 = 0x5F70
-0x8DF2 = 0x5F71
-0x8DF4 = 0x5F72
-0x8DFD = 0x5F73
-0x8E01 = 0x5F74
-0x8E04 = 0x5F75
-0x8E05 = 0x5F76
-0x8E06 = 0x5F77
-0x8E0B = 0x5F78
-0x8E11 = 0x5F79
-0x8E14 = 0x5F7A
-0x8E16 = 0x5F7B
-0x8E20 = 0x5F7C
-0x8E21 = 0x5F7D
-0x8E22 = 0x5F7E
-0x8E23 = 0x6021
-0x8E26 = 0x6022
-0x8E27 = 0x6023
-0x8E31 = 0x6024
-0x8E33 = 0x6025
-0x8E36 = 0x6026
-0x8E37 = 0x6027
-0x8E38 = 0x6028
-0x8E39 = 0x6029
-0x8E3D = 0x602A
-0x8E40 = 0x602B
-0x8E41 = 0x602C
-0x8E4B = 0x602D
-0x8E4D = 0x602E
-0x8E4E = 0x602F
-0x8E4F = 0x6030
-0x8E54 = 0x6031
-0x8E5B = 0x6032
-0x8E5C = 0x6033
-0x8E5D = 0x6034
-0x8E5E = 0x6035
-0x8E61 = 0x6036
-0x8E62 = 0x6037
-0x8E69 = 0x6038
-0x8E6C = 0x6039
-0x8E6D = 0x603A
-0x8E6F = 0x603B
-0x8E70 = 0x603C
-0x8E71 = 0x603D
-0x8E79 = 0x603E
-0x8E7A = 0x603F
-0x8E7B = 0x6040
-0x8E82 = 0x6041
-0x8E83 = 0x6042
-0x8E89 = 0x6043
-0x8E90 = 0x6044
-0x8E92 = 0x6045
-0x8E95 = 0x6046
-0x8E9A = 0x6047
-0x8E9B = 0x6048
-0x8E9D = 0x6049
-0x8E9E = 0x604A
-0x8EA2 = 0x604B
-0x8EA7 = 0x604C
-0x8EA9 = 0x604D
-0x8EAD = 0x604E
-0x8EAE = 0x604F
-0x8EB3 = 0x6050
-0x8EB5 = 0x6051
-0x8EBA = 0x6052
-0x8EBB = 0x6053
-0x8EC0 = 0x6054
-0x8EC1 = 0x6055
-0x8EC3 = 0x6056
-0x8EC4 = 0x6057
-0x8EC7 = 0x6058
-0x8ECF = 0x6059
-0x8ED1 = 0x605A
-0x8ED4 = 0x605B
-0x8EDC = 0x605C
-0x8EE8 = 0x605D
-0x8EED = 0x6064
-0x8EEE = 0x605E
-0x8EF0 = 0x605F
-0x8EF1 = 0x6060
-0x8EF7 = 0x6061
-0x8EF9 = 0x6062
-0x8EFA = 0x6063
-0x8F00 = 0x6065
-0x8F02 = 0x6066
-0x8F07 = 0x6067
-0x8F08 = 0x6068
-0x8F0F = 0x6069
-0x8F10 = 0x606A
-0x8F16 = 0x606B
-0x8F17 = 0x606C
-0x8F18 = 0x606D
-0x8F1E = 0x606E
-0x8F20 = 0x606F
-0x8F21 = 0x6070
-0x8F23 = 0x6071
-0x8F25 = 0x6072
-0x8F27 = 0x6073
-0x8F28 = 0x6074
-0x8F2C = 0x6075
-0x8F2D = 0x6076
-0x8F2E = 0x6077
-0x8F34 = 0x6078
-0x8F35 = 0x6079
-0x8F36 = 0x607A
-0x8F37 = 0x607B
-0x8F3A = 0x607C
-0x8F40 = 0x607D
-0x8F41 = 0x607E
-0x8F43 = 0x6121
-0x8F47 = 0x6122
-0x8F4F = 0x6123
-0x8F51 = 0x6124
-0x8F52 = 0x6125
-0x8F53 = 0x6126
-0x8F54 = 0x6127
-0x8F55 = 0x6128
-0x8F58 = 0x6129
-0x8F5D = 0x612A
-0x8F5E = 0x612B
-0x8F65 = 0x612C
-0x8F9D = 0x612D
-0x8FA0 = 0x612E
-0x8FA1 = 0x612F
-0x8FA4 = 0x6130
-0x8FA5 = 0x6131
-0x8FA6 = 0x6132
-0x8FB5 = 0x6133
-0x8FB6 = 0x6134
-0x8FB8 = 0x6135
-0x8FBE = 0x6136
-0x8FC0 = 0x6137
-0x8FC1 = 0x6138
-0x8FC6 = 0x6139
-0x8FCA = 0x613A
-0x8FCB = 0x613B
-0x8FCD = 0x613C
-0x8FD0 = 0x613D
-0x8FD2 = 0x613E
-0x8FD3 = 0x613F
-0x8FD5 = 0x6140
-0x8FE0 = 0x6141
-0x8FE3 = 0x6142
-0x8FE4 = 0x6143
-0x8FE8 = 0x6144
-0x8FEE = 0x6145
-0x8FF1 = 0x6146
-0x8FF5 = 0x6147
-0x8FF6 = 0x6148
-0x8FFB = 0x6149
-0x8FFE = 0x614A
-0x9002 = 0x614B
-0x9004 = 0x614C
-0x9008 = 0x614D
-0x900C = 0x614E
-0x9018 = 0x614F
-0x901B = 0x6150
-0x9028 = 0x6151
-0x9029 = 0x6152
-0x902A = 0x6154
-0x902C = 0x6155
-0x902D = 0x6156
-0x902F = 0x6153
-0x9033 = 0x6157
-0x9034 = 0x6158
-0x9037 = 0x6159
-0x903F = 0x615A
-0x9043 = 0x615B
-0x9044 = 0x615C
-0x904C = 0x615D
-0x905B = 0x615E
-0x905D = 0x615F
-0x9062 = 0x6160
-0x9066 = 0x6161
-0x9067 = 0x6162
-0x906C = 0x6163
-0x9070 = 0x6164
-0x9074 = 0x6165
-0x9079 = 0x6166
-0x9085 = 0x6167
-0x9088 = 0x6168
-0x908B = 0x6169
-0x908C = 0x616A
-0x908E = 0x616B
-0x9090 = 0x616C
-0x9095 = 0x616D
-0x9097 = 0x616E
-0x9098 = 0x616F
-0x9099 = 0x6170
-0x909B = 0x6171
-0x90A0 = 0x6172
-0x90A1 = 0x6173
-0x90A2 = 0x6174
-0x90A5 = 0x6175
-0x90B0 = 0x6176
-0x90B2 = 0x6177
-0x90B3 = 0x6178
-0x90B4 = 0x6179
-0x90B6 = 0x617A
-0x90BD = 0x617B
-0x90BE = 0x617D
-0x90C3 = 0x617E
-0x90C4 = 0x6221
-0x90C5 = 0x6222
-0x90C7 = 0x6223
-0x90C8 = 0x6224
-0x90CC = 0x617C
-0x90D2 = 0x622D
-0x90D5 = 0x6225
-0x90D7 = 0x6226
-0x90D8 = 0x6227
-0x90D9 = 0x6228
-0x90DC = 0x6229
-0x90DD = 0x622A
-0x90DF = 0x622B
-0x90E5 = 0x622C
-0x90EB = 0x622F
-0x90EF = 0x6230
-0x90F0 = 0x6231
-0x90F4 = 0x6232
-0x90F6 = 0x622E
-0x90FE = 0x6233
-0x90FF = 0x6234
-0x9100 = 0x6235
-0x9104 = 0x6236
-0x9105 = 0x6237
-0x9106 = 0x6238
-0x9108 = 0x6239
-0x910D = 0x623A
-0x9110 = 0x623B
-0x9114 = 0x623C
-0x9116 = 0x623D
-0x9117 = 0x623E
-0x9118 = 0x623F
-0x911A = 0x6240
-0x911C = 0x6241
-0x911E = 0x6242
-0x9120 = 0x6243
-0x9122 = 0x6245
-0x9123 = 0x6246
-0x9125 = 0x6244
-0x9127 = 0x6247
-0x9129 = 0x6248
-0x912E = 0x6249
-0x912F = 0x624A
-0x9131 = 0x624B
-0x9134 = 0x624C
-0x9136 = 0x624D
-0x9137 = 0x624E
-0x9139 = 0x624F
-0x913A = 0x6250
-0x913C = 0x6251
-0x913D = 0x6252
-0x9143 = 0x6253
-0x9147 = 0x6254
-0x9148 = 0x6255
-0x914F = 0x6256
-0x9153 = 0x6257
-0x9157 = 0x6258
-0x9159 = 0x6259
-0x915A = 0x625A
-0x915B = 0x625B
-0x9161 = 0x625C
-0x9164 = 0x625D
-0x9167 = 0x625E
-0x916D = 0x625F
-0x9174 = 0x6260
-0x9179 = 0x6261
-0x917A = 0x6262
-0x917B = 0x6263
-0x9181 = 0x6264
-0x9183 = 0x6265
-0x9185 = 0x6266
-0x9186 = 0x6267
-0x918A = 0x6268
-0x918E = 0x6269
-0x9191 = 0x626A
-0x9193 = 0x626B
-0x9194 = 0x626C
-0x9195 = 0x626D
-0x9198 = 0x626E
-0x919E = 0x626F
-0x91A1 = 0x6270
-0x91A6 = 0x6271
-0x91A8 = 0x6272
-0x91AC = 0x6273
-0x91AD = 0x6274
-0x91AE = 0x6275
-0x91B0 = 0x6276
-0x91B1 = 0x6277
-0x91B2 = 0x6278
-0x91B3 = 0x6279
-0x91B6 = 0x627A
-0x91BB = 0x627B
-0x91BC = 0x627C
-0x91BD = 0x627D
-0x91BF = 0x627E
-0x91C2 = 0x6321
-0x91C3 = 0x6322
-0x91C5 = 0x6323
-0x91D3 = 0x6324
-0x91D4 = 0x6325
-0x91D7 = 0x6326
-0x91D9 = 0x6327
-0x91DA = 0x6328
-0x91DE = 0x6329
-0x91E4 = 0x632A
-0x91E5 = 0x632B
-0x91E9 = 0x632C
-0x91EA = 0x632D
-0x91EC = 0x632E
-0x91ED = 0x632F
-0x91EE = 0x6330
-0x91EF = 0x6331
-0x91F0 = 0x6332
-0x91F1 = 0x6333
-0x91F7 = 0x6334
-0x91F9 = 0x6335
-0x91FB = 0x6336
-0x91FD = 0x6337
-0x9200 = 0x6338
-0x9201 = 0x6339
-0x9204 = 0x633A
-0x9205 = 0x633B
-0x9206 = 0x633C
-0x9207 = 0x633D
-0x9209 = 0x633E
-0x920A = 0x633F
-0x920C = 0x6340
-0x9210 = 0x6341
-0x9212 = 0x6342
-0x9213 = 0x6343
-0x9216 = 0x6344
-0x9218 = 0x6345
-0x921C = 0x6346
-0x921D = 0x6347
-0x9223 = 0x6348
-0x9224 = 0x6349
-0x9225 = 0x634A
-0x9226 = 0x634B
-0x9228 = 0x634C
-0x922E = 0x634D
-0x922F = 0x634E
-0x9230 = 0x634F
-0x9233 = 0x6350
-0x9235 = 0x6351
-0x9236 = 0x6352
-0x9238 = 0x6353
-0x9239 = 0x6354
-0x923A = 0x6355
-0x923C = 0x6356
-0x923E = 0x6357
-0x9240 = 0x6358
-0x9242 = 0x6359
-0x9243 = 0x635A
-0x9246 = 0x635B
-0x9247 = 0x635C
-0x924A = 0x635D
-0x924D = 0x635E
-0x924E = 0x635F
-0x924F = 0x6360
-0x9251 = 0x6361
-0x9258 = 0x6362
-0x9259 = 0x6363
-0x925C = 0x6364
-0x925D = 0x6365
-0x9260 = 0x6366
-0x9261 = 0x6367
-0x9265 = 0x6368
-0x9267 = 0x6369
-0x9268 = 0x636A
-0x9269 = 0x636B
-0x926E = 0x636C
-0x926F = 0x636D
-0x9270 = 0x636E
-0x9275 = 0x636F
-0x9276 = 0x6370
-0x9277 = 0x6371
-0x9278 = 0x6372
-0x9279 = 0x6373
-0x927B = 0x6374
-0x927C = 0x6375
-0x927D = 0x6376
-0x927F = 0x6377
-0x9288 = 0x6378
-0x9289 = 0x6379
-0x928A = 0x637A
-0x928D = 0x637B
-0x928E = 0x637C
-0x9292 = 0x637D
-0x9297 = 0x637E
-0x9299 = 0x6421
-0x929F = 0x6422
-0x92A0 = 0x6423
-0x92A4 = 0x6424
-0x92A5 = 0x6425
-0x92A7 = 0x6426
-0x92A8 = 0x6427
-0x92AB = 0x6428
-0x92AF = 0x6429
-0x92B2 = 0x642A
-0x92B6 = 0x642B
-0x92B8 = 0x642C
-0x92BA = 0x642D
-0x92BB = 0x642E
-0x92BC = 0x642F
-0x92BD = 0x6430
-0x92BF = 0x6431
-0x92C0 = 0x6432
-0x92C1 = 0x6433
-0x92C2 = 0x6434
-0x92C3 = 0x6435
-0x92C5 = 0x6436
-0x92C6 = 0x6437
-0x92C7 = 0x6438
-0x92C8 = 0x6439
-0x92CB = 0x643A
-0x92CC = 0x643B
-0x92CD = 0x643C
-0x92CE = 0x643D
-0x92D0 = 0x643E
-0x92D3 = 0x643F
-0x92D5 = 0x6440
-0x92D7 = 0x6441
-0x92D8 = 0x6442
-0x92D9 = 0x6443
-0x92DC = 0x6444
-0x92DD = 0x6445
-0x92DF = 0x6446
-0x92E0 = 0x6447
-0x92E1 = 0x6448
-0x92E3 = 0x6449
-0x92E5 = 0x644A
-0x92E7 = 0x644B
-0x92E8 = 0x644C
-0x92EC = 0x644D
-0x92EE = 0x644E
-0x92F0 = 0x644F
-0x92F9 = 0x6450
-0x92FB = 0x6451
-0x92FF = 0x6452
-0x9300 = 0x6453
-0x9302 = 0x6454
-0x9308 = 0x6455
-0x930D = 0x6456
-0x9311 = 0x6457
-0x9314 = 0x6458
-0x9315 = 0x6459
-0x931C = 0x645A
-0x931D = 0x645B
-0x931E = 0x645C
-0x931F = 0x645D
-0x9321 = 0x645E
-0x9324 = 0x645F
-0x9325 = 0x6460
-0x9327 = 0x6461
-0x9329 = 0x6462
-0x932A = 0x6463
-0x9333 = 0x6464
-0x9334 = 0x6465
-0x9336 = 0x6466
-0x9337 = 0x6467
-0x9347 = 0x6468
-0x9348 = 0x6469
-0x9349 = 0x646A
-0x9350 = 0x646B
-0x9351 = 0x646C
-0x9352 = 0x646D
-0x9355 = 0x646E
-0x9357 = 0x646F
-0x9358 = 0x6470
-0x935A = 0x6471
-0x935E = 0x6472
-0x9364 = 0x6473
-0x9365 = 0x6474
-0x9367 = 0x6475
-0x9369 = 0x6476
-0x936A = 0x6477
-0x936D = 0x6478
-0x936F = 0x6479
-0x9370 = 0x647A
-0x9371 = 0x647B
-0x9373 = 0x647C
-0x9374 = 0x647D
-0x9376 = 0x647E
-0x937A = 0x6521
-0x937D = 0x6522
-0x937F = 0x6523
-0x9380 = 0x6524
-0x9381 = 0x6525
-0x9382 = 0x6526
-0x9388 = 0x6527
-0x938A = 0x6528
-0x938B = 0x6529
-0x938D = 0x652A
-0x938F = 0x652B
-0x9392 = 0x652C
-0x9395 = 0x652D
-0x9398 = 0x652E
-0x939B = 0x652F
-0x939E = 0x6530
-0x93A1 = 0x6531
-0x93A3 = 0x6532
-0x93A4 = 0x6533
-0x93A6 = 0x6534
-0x93A8 = 0x6535
-0x93A9 = 0x653B
-0x93AB = 0x6536
-0x93B4 = 0x6537
-0x93B5 = 0x6538
-0x93B6 = 0x6539
-0x93BA = 0x653A
-0x93C1 = 0x653C
-0x93C4 = 0x653D
-0x93C5 = 0x653E
-0x93C6 = 0x653F
-0x93C7 = 0x6540
-0x93C9 = 0x6541
-0x93CA = 0x6542
-0x93CB = 0x6543
-0x93CC = 0x6544
-0x93CD = 0x6545
-0x93D3 = 0x6546
-0x93D9 = 0x6547
-0x93DC = 0x6548
-0x93DE = 0x6549
-0x93DF = 0x654A
-0x93E2 = 0x654B
-0x93E6 = 0x654C
-0x93E7 = 0x654D
-0x93F7 = 0x654F
-0x93F8 = 0x6550
-0x93F9 = 0x654E
-0x93FA = 0x6551
-0x93FB = 0x6552
-0x93FD = 0x6553
-0x9401 = 0x6554
-0x9402 = 0x6555
-0x9404 = 0x6556
-0x9408 = 0x6557
-0x9409 = 0x6558
-0x940D = 0x6559
-0x940E = 0x655A
-0x940F = 0x655B
-0x9415 = 0x655C
-0x9416 = 0x655D
-0x9417 = 0x655E
-0x941F = 0x655F
-0x942E = 0x6560
-0x942F = 0x6561
-0x9431 = 0x6562
-0x9432 = 0x6563
-0x9433 = 0x6564
-0x9434 = 0x6565
-0x943B = 0x6566
-0x943D = 0x6568
-0x943F = 0x6567
-0x9443 = 0x6569
-0x9445 = 0x656A
-0x9448 = 0x656B
-0x944A = 0x656C
-0x944C = 0x656D
-0x9455 = 0x656E
-0x9459 = 0x656F
-0x945C = 0x6570
-0x945F = 0x6571
-0x9461 = 0x6572
-0x9463 = 0x6573
-0x9468 = 0x6574
-0x946B = 0x6575
-0x946D = 0x6576
-0x946E = 0x6577
-0x946F = 0x6578
-0x9471 = 0x6579
-0x9472 = 0x657A
-0x9483 = 0x657C
-0x9484 = 0x657B
-0x9578 = 0x657D
-0x9579 = 0x657E
-0x957E = 0x6621
-0x9584 = 0x6622
-0x9588 = 0x6623
-0x958C = 0x6624
-0x958D = 0x6625
-0x958E = 0x6626
-0x959D = 0x6627
-0x959E = 0x6628
-0x959F = 0x6629
-0x95A1 = 0x662A
-0x95A6 = 0x662B
-0x95A9 = 0x662C
-0x95AB = 0x662D
-0x95AC = 0x662E
-0x95B4 = 0x662F
-0x95B6 = 0x6630
-0x95BA = 0x6631
-0x95BD = 0x6632
-0x95BF = 0x6633
-0x95C6 = 0x6634
-0x95C8 = 0x6635
-0x95C9 = 0x6636
-0x95CB = 0x6637
-0x95D0 = 0x6638
-0x95D1 = 0x6639
-0x95D2 = 0x663A
-0x95D3 = 0x663B
-0x95D9 = 0x663C
-0x95DA = 0x663D
-0x95DD = 0x663E
-0x95DE = 0x663F
-0x95DF = 0x6640
-0x95E0 = 0x6641
-0x95E4 = 0x6642
-0x95E6 = 0x6643
-0x961D = 0x6644
-0x961E = 0x6645
-0x9622 = 0x6646
-0x9624 = 0x6647
-0x9625 = 0x6648
-0x9626 = 0x6649
-0x962C = 0x664A
-0x9631 = 0x664B
-0x9633 = 0x664C
-0x9637 = 0x664D
-0x9638 = 0x664E
-0x9639 = 0x664F
-0x963A = 0x6650
-0x963C = 0x6651
-0x963D = 0x6652
-0x9641 = 0x6653
-0x9652 = 0x6654
-0x9654 = 0x6655
-0x9656 = 0x6656
-0x9657 = 0x6657
-0x9658 = 0x6658
-0x9661 = 0x6659
-0x966E = 0x665A
-0x9674 = 0x665B
-0x967B = 0x665C
-0x967C = 0x665D
-0x967E = 0x665E
-0x967F = 0x665F
-0x9681 = 0x6660
-0x9682 = 0x6661
-0x9683 = 0x6662
-0x9684 = 0x6663
-0x9689 = 0x6664
-0x9691 = 0x6665
-0x9696 = 0x6666
-0x969A = 0x6667
-0x969D = 0x6668
-0x969F = 0x6669
-0x96A4 = 0x666A
-0x96A5 = 0x666B
-0x96A6 = 0x666C
-0x96A9 = 0x666D
-0x96AE = 0x666E
-0x96AF = 0x666F
-0x96B3 = 0x6670
-0x96BA = 0x6671
-0x96CA = 0x6672
-0x96D2 = 0x6673
-0x96D8 = 0x6675
-0x96DA = 0x6676
-0x96DD = 0x6677
-0x96DE = 0x6678
-0x96DF = 0x6679
-0x96E9 = 0x667A
-0x96EF = 0x667B
-0x96F1 = 0x667C
-0x96FA = 0x667D
-0x9702 = 0x667E
-0x9703 = 0x6721
-0x9705 = 0x6722
-0x9709 = 0x6723
-0x971A = 0x6724
-0x971B = 0x6725
-0x971D = 0x6726
-0x9721 = 0x6727
-0x9722 = 0x6728
-0x9723 = 0x6729
-0x9728 = 0x672A
-0x9731 = 0x672B
-0x9733 = 0x672C
-0x9741 = 0x672D
-0x9743 = 0x672E
-0x974A = 0x672F
-0x974E = 0x6730
-0x974F = 0x6731
-0x9755 = 0x6732
-0x9757 = 0x6733
-0x9758 = 0x6734
-0x975A = 0x6735
-0x975B = 0x6736
-0x9763 = 0x6737
-0x9767 = 0x6738
-0x976A = 0x6739
-0x976E = 0x673A
-0x9773 = 0x673B
-0x9776 = 0x673C
-0x9777 = 0x673D
-0x9778 = 0x673E
-0x977B = 0x673F
-0x977D = 0x6740
-0x977F = 0x6741
-0x9780 = 0x6742
-0x9789 = 0x6743
-0x9795 = 0x6744
-0x9796 = 0x6745
-0x9797 = 0x6746
-0x9799 = 0x6747
-0x979A = 0x6748
-0x979E = 0x6749
-0x979F = 0x674A
-0x97A2 = 0x674B
-0x97AC = 0x674C
-0x97AE = 0x674D
-0x97B1 = 0x674E
-0x97B2 = 0x674F
-0x97B5 = 0x6750
-0x97B6 = 0x6751
-0x97B8 = 0x6752
-0x97B9 = 0x6753
-0x97BA = 0x6754
-0x97BC = 0x6755
-0x97BE = 0x6756
-0x97BF = 0x6757
-0x97C1 = 0x6758
-0x97C4 = 0x6759
-0x97C5 = 0x675A
-0x97C7 = 0x675B
-0x97C9 = 0x675C
-0x97CA = 0x675D
-0x97CC = 0x675E
-0x97CD = 0x675F
-0x97CE = 0x6760
-0x97D0 = 0x6761
-0x97D1 = 0x6762
-0x97D4 = 0x6763
-0x97D7 = 0x6764
-0x97D8 = 0x6765
-0x97D9 = 0x6766
-0x97DB = 0x676A
-0x97DD = 0x6767
-0x97DE = 0x6768
-0x97E0 = 0x6769
-0x97E1 = 0x676B
-0x97E4 = 0x676C
-0x97EF = 0x676D
-0x97F1 = 0x676E
-0x97F4 = 0x676F
-0x97F7 = 0x6770
-0x97F8 = 0x6771
-0x97FA = 0x6772
-0x9807 = 0x6773
-0x980A = 0x6774
-0x980D = 0x6776
-0x980E = 0x6777
-0x9814 = 0x6778
-0x9816 = 0x6779
-0x9819 = 0x6775
-0x981C = 0x677A
-0x981E = 0x677B
-0x9820 = 0x677C
-0x9823 = 0x677D
-0x9825 = 0x6828
-0x9826 = 0x677E
-0x982B = 0x6821
-0x982E = 0x6822
-0x982F = 0x6823
-0x9830 = 0x6824
-0x9832 = 0x6825
-0x9833 = 0x6826
-0x9835 = 0x6827
-0x983E = 0x6829
-0x9844 = 0x682A
-0x9847 = 0x682B
-0x984A = 0x682C
-0x9851 = 0x682D
-0x9852 = 0x682E
-0x9853 = 0x682F
-0x9856 = 0x6830
-0x9857 = 0x6831
-0x9859 = 0x6832
-0x985A = 0x6833
-0x9862 = 0x6834
-0x9863 = 0x6835
-0x9865 = 0x6836
-0x9866 = 0x6837
-0x986A = 0x6838
-0x986C = 0x6839
-0x98AB = 0x683A
-0x98AD = 0x683B
-0x98AE = 0x683C
-0x98B0 = 0x683D
-0x98B4 = 0x683E
-0x98B7 = 0x683F
-0x98B8 = 0x6840
-0x98BA = 0x6841
-0x98BB = 0x6842
-0x98BF = 0x6843
-0x98C2 = 0x6844
-0x98C5 = 0x6845
-0x98C8 = 0x6846
-0x98CC = 0x6847
-0x98E1 = 0x6848
-0x98E3 = 0x6849
-0x98E5 = 0x684A
-0x98E6 = 0x684B
-0x98E7 = 0x684C
-0x98EA = 0x684D
-0x98F3 = 0x684E
-0x98F6 = 0x684F
-0x9902 = 0x6850
-0x9907 = 0x6851
-0x9908 = 0x6852
-0x9911 = 0x6853
-0x9915 = 0x6854
-0x9916 = 0x6855
-0x9917 = 0x6856
-0x991A = 0x6857
-0x991B = 0x6858
-0x991C = 0x6859
-0x991F = 0x685A
-0x9922 = 0x685B
-0x9926 = 0x685C
-0x9927 = 0x685D
-0x992B = 0x685E
-0x9931 = 0x685F
-0x9932 = 0x6860
-0x9933 = 0x6861
-0x9934 = 0x6862
-0x9935 = 0x6863
-0x9939 = 0x6864
-0x993A = 0x6865
-0x993B = 0x6866
-0x993C = 0x6867
-0x9940 = 0x6868
-0x9941 = 0x6869
-0x9946 = 0x686A
-0x9947 = 0x686B
-0x9948 = 0x686C
-0x994D = 0x686D
-0x994E = 0x686E
-0x9954 = 0x686F
-0x9958 = 0x6870
-0x9959 = 0x6871
-0x995B = 0x6872
-0x995C = 0x6873
-0x995E = 0x6874
-0x995F = 0x6875
-0x9960 = 0x6876
-0x999B = 0x6877
-0x999D = 0x6878
-0x999F = 0x6879
-0x99A6 = 0x687A
-0x99B0 = 0x687B
-0x99B1 = 0x687C
-0x99B2 = 0x687D
-0x99B5 = 0x687E
-0x99B9 = 0x6921
-0x99BA = 0x6922
-0x99BD = 0x6923
-0x99BF = 0x6924
-0x99C3 = 0x6925
-0x99C9 = 0x6926
-0x99D3 = 0x6927
-0x99D4 = 0x6928
-0x99D9 = 0x6929
-0x99DA = 0x692A
-0x99DC = 0x692B
-0x99DE = 0x692C
-0x99E7 = 0x692D
-0x99EA = 0x692E
-0x99EB = 0x692F
-0x99EC = 0x6930
-0x99F0 = 0x6931
-0x99F4 = 0x6932
-0x99F5 = 0x6933
-0x99F9 = 0x6934
-0x99FD = 0x6935
-0x99FE = 0x6936
-0x9A02 = 0x6937
-0x9A03 = 0x6938
-0x9A04 = 0x6939
-0x9A0B = 0x693A
-0x9A0C = 0x693B
-0x9A10 = 0x693C
-0x9A11 = 0x693D
-0x9A16 = 0x693E
-0x9A1E = 0x693F
-0x9A20 = 0x6940
-0x9A22 = 0x6941
-0x9A23 = 0x6942
-0x9A24 = 0x6943
-0x9A27 = 0x6944
-0x9A2D = 0x6945
-0x9A2E = 0x6946
-0x9A33 = 0x6947
-0x9A35 = 0x6948
-0x9A36 = 0x6949
-0x9A38 = 0x694A
-0x9A41 = 0x694C
-0x9A44 = 0x694D
-0x9A47 = 0x694B
-0x9A4A = 0x694E
-0x9A4B = 0x694F
-0x9A4C = 0x6950
-0x9A4E = 0x6951
-0x9A51 = 0x6952
-0x9A54 = 0x6953
-0x9A56 = 0x6954
-0x9A5D = 0x6955
-0x9AAA = 0x6956
-0x9AAC = 0x6957
-0x9AAE = 0x6958
-0x9AAF = 0x6959
-0x9AB2 = 0x695A
-0x9AB4 = 0x695B
-0x9AB5 = 0x695C
-0x9AB6 = 0x695D
-0x9AB9 = 0x695E
-0x9ABB = 0x695F
-0x9ABE = 0x6960
-0x9ABF = 0x6961
-0x9AC1 = 0x6962
-0x9AC3 = 0x6963
-0x9AC6 = 0x6964
-0x9AC8 = 0x6965
-0x9ACE = 0x6966
-0x9AD0 = 0x6967
-0x9AD2 = 0x6968
-0x9AD5 = 0x6969
-0x9AD6 = 0x696A
-0x9AD7 = 0x696B
-0x9ADB = 0x696C
-0x9ADC = 0x696D
-0x9AE0 = 0x696E
-0x9AE4 = 0x696F
-0x9AE5 = 0x6970
-0x9AE7 = 0x6971
-0x9AE9 = 0x6972
-0x9AEC = 0x6973
-0x9AF2 = 0x6974
-0x9AF3 = 0x6975
-0x9AF5 = 0x6976
-0x9AF9 = 0x6977
-0x9AFA = 0x6978
-0x9AFD = 0x6979
-0x9AFF = 0x697A
-0x9B00 = 0x697B
-0x9B01 = 0x697C
-0x9B02 = 0x697D
-0x9B03 = 0x697E
-0x9B04 = 0x6A21
-0x9B05 = 0x6A22
-0x9B08 = 0x6A23
-0x9B09 = 0x6A24
-0x9B0B = 0x6A25
-0x9B0C = 0x6A26
-0x9B0D = 0x6A27
-0x9B0E = 0x6A28
-0x9B10 = 0x6A29
-0x9B12 = 0x6A2A
-0x9B16 = 0x6A2B
-0x9B19 = 0x6A2C
-0x9B1B = 0x6A2D
-0x9B1C = 0x6A2E
-0x9B20 = 0x6A2F
-0x9B26 = 0x6A30
-0x9B2B = 0x6A31
-0x9B2D = 0x6A32
-0x9B33 = 0x6A33
-0x9B34 = 0x6A34
-0x9B35 = 0x6A35
-0x9B37 = 0x6A36
-0x9B39 = 0x6A37
-0x9B3A = 0x6A38
-0x9B3D = 0x6A39
-0x9B48 = 0x6A3A
-0x9B4B = 0x6A3B
-0x9B4C = 0x6A3C
-0x9B55 = 0x6A3D
-0x9B56 = 0x6A3E
-0x9B57 = 0x6A3F
-0x9B5B = 0x6A40
-0x9B5E = 0x6A41
-0x9B61 = 0x6A42
-0x9B63 = 0x6A43
-0x9B65 = 0x6A44
-0x9B66 = 0x6A45
-0x9B68 = 0x6A46
-0x9B6A = 0x6A47
-0x9B6B = 0x6A48
-0x9B6C = 0x6A49
-0x9B6D = 0x6A4A
-0x9B6E = 0x6A4B
-0x9B73 = 0x6A4C
-0x9B75 = 0x6A4D
-0x9B77 = 0x6A4E
-0x9B78 = 0x6A4F
-0x9B79 = 0x6A50
-0x9B7F = 0x6A51
-0x9B80 = 0x6A52
-0x9B84 = 0x6A53
-0x9B85 = 0x6A54
-0x9B86 = 0x6A55
-0x9B87 = 0x6A56
-0x9B89 = 0x6A57
-0x9B8A = 0x6A58
-0x9B8B = 0x6A59
-0x9B8D = 0x6A5A
-0x9B8F = 0x6A5B
-0x9B90 = 0x6A5C
-0x9B94 = 0x6A5D
-0x9B9A = 0x6A5E
-0x9B9D = 0x6A5F
-0x9B9E = 0x6A60
-0x9BA6 = 0x6A61
-0x9BA7 = 0x6A62
-0x9BA9 = 0x6A63
-0x9BAC = 0x6A64
-0x9BB0 = 0x6A65
-0x9BB1 = 0x6A66
-0x9BB2 = 0x6A67
-0x9BB7 = 0x6A68
-0x9BB8 = 0x6A69
-0x9BBB = 0x6A6A
-0x9BBC = 0x6A6B
-0x9BBE = 0x6A6C
-0x9BBF = 0x6A6D
-0x9BC1 = 0x6A6E
-0x9BC7 = 0x6A6F
-0x9BC8 = 0x6A70
-0x9BCE = 0x6A71
-0x9BD0 = 0x6A72
-0x9BD7 = 0x6A73
-0x9BD8 = 0x6A74
-0x9BDD = 0x6A75
-0x9BDF = 0x6A76
-0x9BE5 = 0x6A77
-0x9BE7 = 0x6A78
-0x9BEA = 0x6A79
-0x9BEB = 0x6A7A
-0x9BEF = 0x6A7B
-0x9BF3 = 0x6A7C
-0x9BF7 = 0x6A7D
-0x9BF8 = 0x6A7E
-0x9BF9 = 0x6B21
-0x9BFA = 0x6B22
-0x9BFD = 0x6B23
-0x9BFF = 0x6B24
-0x9C00 = 0x6B25
-0x9C02 = 0x6B26
-0x9C0B = 0x6B27
-0x9C0F = 0x6B28
-0x9C11 = 0x6B29
-0x9C16 = 0x6B2A
-0x9C18 = 0x6B2B
-0x9C19 = 0x6B2C
-0x9C1A = 0x6B2D
-0x9C1C = 0x6B2E
-0x9C1E = 0x6B2F
-0x9C22 = 0x6B30
-0x9C23 = 0x6B31
-0x9C26 = 0x6B32
-0x9C27 = 0x6B33
-0x9C28 = 0x6B34
-0x9C29 = 0x6B35
-0x9C2A = 0x6B36
-0x9C31 = 0x6B37
-0x9C35 = 0x6B38
-0x9C36 = 0x6B39
-0x9C37 = 0x6B3A
-0x9C3D = 0x6B3B
-0x9C41 = 0x6B3C
-0x9C43 = 0x6B3D
-0x9C44 = 0x6B3E
-0x9C45 = 0x6B3F
-0x9C49 = 0x6B40
-0x9C4A = 0x6B41
-0x9C4E = 0x6B42
-0x9C4F = 0x6B43
-0x9C50 = 0x6B44
-0x9C53 = 0x6B45
-0x9C54 = 0x6B46
-0x9C56 = 0x6B47
-0x9C58 = 0x6B48
-0x9C5B = 0x6B49
-0x9C5C = 0x6B50
-0x9C5D = 0x6B4A
-0x9C5E = 0x6B4B
-0x9C5F = 0x6B4C
-0x9C63 = 0x6B4D
-0x9C68 = 0x6B52
-0x9C69 = 0x6B4E
-0x9C6A = 0x6B4F
-0x9C6B = 0x6B51
-0x9C6E = 0x6B53
-0x9C70 = 0x6B54
-0x9C72 = 0x6B55
-0x9C75 = 0x6B56
-0x9C77 = 0x6B57
-0x9C7B = 0x6B58
-0x9CE6 = 0x6B59
-0x9CF2 = 0x6B5A
-0x9CF7 = 0x6B5B
-0x9CF9 = 0x6B5C
-0x9D02 = 0x6B5E
-0x9D0B = 0x6B5D
-0x9D11 = 0x6B5F
-0x9D17 = 0x6B60
-0x9D18 = 0x6B61
-0x9D1C = 0x6B62
-0x9D1D = 0x6B63
-0x9D1E = 0x6B64
-0x9D2F = 0x6B65
-0x9D30 = 0x6B66
-0x9D32 = 0x6B67
-0x9D33 = 0x6B68
-0x9D34 = 0x6B69
-0x9D3A = 0x6B6A
-0x9D3C = 0x6B6B
-0x9D3D = 0x6B6D
-0x9D42 = 0x6B6E
-0x9D43 = 0x6B6F
-0x9D45 = 0x6B6C
-0x9D47 = 0x6B70
-0x9D4A = 0x6B71
-0x9D53 = 0x6B72
-0x9D54 = 0x6B73
-0x9D5F = 0x6B74
-0x9D62 = 0x6B76
-0x9D63 = 0x6B75
-0x9D65 = 0x6B77
-0x9D69 = 0x6B78
-0x9D6A = 0x6B79
-0x9D6B = 0x6B7A
-0x9D70 = 0x6B7B
-0x9D76 = 0x6B7C
-0x9D77 = 0x6B7D
-0x9D7B = 0x6B7E
-0x9D7C = 0x6C21
-0x9D7E = 0x6C22
-0x9D83 = 0x6C23
-0x9D84 = 0x6C24
-0x9D86 = 0x6C25
-0x9D8A = 0x6C26
-0x9D8D = 0x6C27
-0x9D8E = 0x6C28
-0x9D92 = 0x6C29
-0x9D93 = 0x6C2A
-0x9D95 = 0x6C2B
-0x9D96 = 0x6C2C
-0x9D97 = 0x6C2D
-0x9D98 = 0x6C2E
-0x9DA1 = 0x6C2F
-0x9DAA = 0x6C30
-0x9DAC = 0x6C31
-0x9DAE = 0x6C32
-0x9DB1 = 0x6C33
-0x9DB5 = 0x6C34
-0x9DB9 = 0x6C35
-0x9DBC = 0x6C36
-0x9DBF = 0x6C37
-0x9DC3 = 0x6C38
-0x9DC7 = 0x6C39
-0x9DC9 = 0x6C3A
-0x9DCA = 0x6C3B
-0x9DD4 = 0x6C3C
-0x9DD5 = 0x6C3D
-0x9DD6 = 0x6C3E
-0x9DD7 = 0x6C3F
-0x9DDA = 0x6C40
-0x9DDE = 0x6C41
-0x9DDF = 0x6C42
-0x9DE0 = 0x6C43
-0x9DE5 = 0x6C44
-0x9DE7 = 0x6C45
-0x9DE9 = 0x6C46
-0x9DEB = 0x6C47
-0x9DEE = 0x6C48
-0x9DF0 = 0x6C49
-0x9DF3 = 0x6C4A
-0x9DF4 = 0x6C4B
-0x9DFE = 0x6C4C
-0x9E02 = 0x6C4E
-0x9E07 = 0x6C4F
-0x9E0A = 0x6C4D
-0x9E0E = 0x6C50
-0x9E10 = 0x6C51
-0x9E11 = 0x6C52
-0x9E12 = 0x6C53
-0x9E15 = 0x6C54
-0x9E16 = 0x6C55
-0x9E19 = 0x6C56
-0x9E1C = 0x6C57
-0x9E1D = 0x6C58
-0x9E7A = 0x6C59
-0x9E7B = 0x6C5A
-0x9E7C = 0x6C5B
-0x9E80 = 0x6C5C
-0x9E82 = 0x6C5D
-0x9E83 = 0x6C5E
-0x9E84 = 0x6C5F
-0x9E85 = 0x6C60
-0x9E87 = 0x6C61
-0x9E8E = 0x6C62
-0x9E8F = 0x6C63
-0x9E96 = 0x6C64
-0x9E98 = 0x6C65
-0x9E9B = 0x6C66
-0x9E9E = 0x6C67
-0x9EA4 = 0x6C68
-0x9EA8 = 0x6C69
-0x9EAC = 0x6C6A
-0x9EAE = 0x6C6B
-0x9EAF = 0x6C6C
-0x9EB0 = 0x6C6D
-0x9EB3 = 0x6C6E
-0x9EB4 = 0x6C6F
-0x9EB5 = 0x6C70
-0x9EC6 = 0x6C71
-0x9EC8 = 0x6C72
-0x9ECB = 0x6C73
-0x9ED5 = 0x6C74
-0x9EDF = 0x6C75
-0x9EE4 = 0x6C76
-0x9EE7 = 0x6C77
-0x9EEC = 0x6C78
-0x9EED = 0x6C79
-0x9EEE = 0x6C7A
-0x9EF0 = 0x6C7B
-0x9EF1 = 0x6C7C
-0x9EF2 = 0x6C7D
-0x9EF5 = 0x6C7E
-0x9EF8 = 0x6D21
-0x9EFF = 0x6D22
-0x9F02 = 0x6D23
-0x9F03 = 0x6D24
-0x9F09 = 0x6D25
-0x9F0F = 0x6D26
-0x9F10 = 0x6D27
-0x9F11 = 0x6D28
-0x9F12 = 0x6D29
-0x9F14 = 0x6D2A
-0x9F16 = 0x6D2B
-0x9F17 = 0x6D2C
-0x9F19 = 0x6D2D
-0x9F1A = 0x6D2E
-0x9F1B = 0x6D2F
-0x9F1F = 0x6D30
-0x9F22 = 0x6D31
-0x9F26 = 0x6D32
-0x9F2A = 0x6D33
-0x9F2B = 0x6D34
-0x9F2F = 0x6D35
-0x9F31 = 0x6D36
-0x9F32 = 0x6D37
-0x9F34 = 0x6D38
-0x9F37 = 0x6D39
-0x9F39 = 0x6D3A
-0x9F3A = 0x6D3B
-0x9F3C = 0x6D3C
-0x9F3D = 0x6D3D
-0x9F3F = 0x6D3E
-0x9F41 = 0x6D3F
-0x9F43 = 0x6D40
-0x9F44 = 0x6D41
-0x9F45 = 0x6D42
-0x9F46 = 0x6D43
-0x9F47 = 0x6D44
-0x9F53 = 0x6D45
-0x9F55 = 0x6D46
-0x9F56 = 0x6D47
-0x9F57 = 0x6D48
-0x9F58 = 0x6D49
-0x9F5A = 0x6D4A
-0x9F5D = 0x6D4B
-0x9F5E = 0x6D4C
-0x9F68 = 0x6D4D
-0x9F69 = 0x6D4E
-0x9F6D = 0x6D4F
-0x9F6E = 0x6D50
-0x9F6F = 0x6D51
-0x9F70 = 0x6D52
-0x9F71 = 0x6D53
-0x9F73 = 0x6D54
-0x9F75 = 0x6D55
-0x9F7A = 0x6D56
-0x9F7D = 0x6D57
-0x9F8F = 0x6D58
-0x9F90 = 0x6D59
-0x9F91 = 0x6D5A
-0x9F92 = 0x6D5B
-0x9F94 = 0x6D5C
-0x9F96 = 0x6D5D
-0x9F97 = 0x6D5E
-0x9F9E = 0x6D5F
-0x9FA1 = 0x6D60
-0x9FA2 = 0x6D61
-0x9FA3 = 0x6D62
-0x9FA5 = 0x6D63
-END_MAP
diff --git a/enc/trans/JIS/UCS%JISX0212@MS.src b/enc/trans/JIS/UCS%JISX0212@MS.src
deleted file mode 100644
index 1f0c3c3c16..0000000000
--- a/enc/trans/JIS/UCS%JISX0212@MS.src
+++ /dev/null
@@ -1,6082 +0,0 @@
-# $NetBSD: UCS%JISX0212@MS.src,v 1.1 2003/07/19 20:20:42 tshiozak Exp $
-
-TYPE ROWCOL
-NAME "UCS/JISX0212:MS"
-SRC_ZONE 0x0000 - 0xFFFF
-OOB_MODE INVALID
-DST_INVALID 0xFFFF
-DST_UNIT_BITS 16
-
-BEGIN_MAP
-0x0000 - 0xFFFF = INVALID
-#
-# This data is derived from http://www.opengroup.or.jp/jvc/cde/
-#
-0x00A1 = 0x2242
-0x00A4 = 0x2270
-0x00A9 = 0x226D
-0x00AA = 0x226C
-0x00AE = 0x226E
-0x00AF = 0x2234
-0x00B8 = 0x2231
-0x00BA = 0x226B
-0x00BF = 0x2244
-0x00C0 = 0x2A22
-0x00C1 = 0x2A21
-0x00C2 = 0x2A24
-0x00C3 = 0x2A2A
-0x00C4 = 0x2A23
-0x00C5 = 0x2A29
-0x00C6 = 0x2921
-0x00C7 = 0x2A2E
-0x00C8 = 0x2A32
-0x00C9 = 0x2A31
-0x00CA = 0x2A34
-0x00CB = 0x2A33
-0x00CC = 0x2A40
-0x00CD = 0x2A3F
-0x00CE = 0x2A42
-0x00CF = 0x2A41
-0x00D1 = 0x2A50
-0x00D2 = 0x2A52
-0x00D3 = 0x2A51
-0x00D4 = 0x2A54
-0x00D5 = 0x2A58
-0x00D6 = 0x2A53
-0x00D8 = 0x292C
-0x00D9 = 0x2A63
-0x00DA = 0x2A62
-0x00DB = 0x2A65
-0x00DC = 0x2A64
-0x00DD = 0x2A72
-0x00DE = 0x2930
-0x00DF = 0x294E
-0x00E0 = 0x2B22
-0x00E1 = 0x2B21
-0x00E2 = 0x2B24
-0x00E3 = 0x2B2A
-0x00E4 = 0x2B23
-0x00E5 = 0x2B29
-0x00E6 = 0x2941
-0x00E7 = 0x2B2E
-0x00E8 = 0x2B32
-0x00E9 = 0x2B31
-0x00EA = 0x2B34
-0x00EB = 0x2B33
-0x00EC = 0x2B40
-0x00ED = 0x2B3F
-0x00EE = 0x2B42
-0x00EF = 0x2B41
-0x00F0 = 0x2943
-0x00F1 = 0x2B50
-0x00F2 = 0x2B52
-0x00F3 = 0x2B51
-0x00F4 = 0x2B54
-0x00F5 = 0x2B58
-0x00F6 = 0x2B53
-0x00F8 = 0x294C
-0x00F9 = 0x2B63
-0x00FA = 0x2B62
-0x00FB = 0x2B65
-0x00FC = 0x2B64
-0x00FD = 0x2B72
-0x00FE = 0x2950
-0x00FF = 0x2B73
-0x0100 = 0x2A27
-0x0101 = 0x2B27
-0x0102 = 0x2A25
-0x0103 = 0x2B25
-0x0104 = 0x2A28
-0x0105 = 0x2B28
-0x0106 = 0x2A2B
-0x0107 = 0x2B2B
-0x0108 = 0x2A2C
-0x0109 = 0x2B2C
-0x010A = 0x2A2F
-0x010B = 0x2B2F
-0x010C = 0x2A2D
-0x010D = 0x2B2D
-0x010E = 0x2A30
-0x010F = 0x2B30
-0x0110 = 0x2922
-0x0111 = 0x2942
-0x0112 = 0x2A37
-0x0113 = 0x2B37
-0x0116 = 0x2A36
-0x0117 = 0x2B36
-0x0118 = 0x2A38
-0x0119 = 0x2B38
-0x011A = 0x2A35
-0x011B = 0x2B35
-0x011C = 0x2A3A
-0x011D = 0x2B3A
-0x011E = 0x2A3B
-0x011F = 0x2B3B
-0x0120 = 0x2A3D
-0x0121 = 0x2B3D
-0x0122 = 0x2A3C
-0x0124 = 0x2A3E
-0x0125 = 0x2B3E
-0x0126 = 0x2924
-0x0127 = 0x2944
-0x0128 = 0x2A47
-0x0129 = 0x2B47
-0x012A = 0x2A45
-0x012B = 0x2B45
-0x012E = 0x2A46
-0x012F = 0x2B46
-0x0130 = 0x2A44
-0x0131 = 0x2945
-0x0132 = 0x2926
-0x0133 = 0x2946
-0x0134 = 0x2A48
-0x0135 = 0x2B48
-0x0136 = 0x2A49
-0x0137 = 0x2B49
-0x0138 = 0x2947
-0x0139 = 0x2A4A
-0x013A = 0x2B4A
-0x013B = 0x2A4C
-0x013C = 0x2B4C
-0x013D = 0x2A4B
-0x013E = 0x2B4B
-0x013F = 0x2929
-0x0140 = 0x2949
-0x0141 = 0x2928
-0x0142 = 0x2948
-0x0143 = 0x2A4D
-0x0144 = 0x2B4D
-0x0145 = 0x2A4F
-0x0146 = 0x2B4F
-0x0147 = 0x2A4E
-0x0148 = 0x2B4E
-0x0149 = 0x294A
-0x014A = 0x292B
-0x014B = 0x294B
-0x014C = 0x2A57
-0x014D = 0x2B57
-0x0150 = 0x2A56
-0x0151 = 0x2B56
-0x0152 = 0x292D
-0x0153 = 0x294D
-0x0154 = 0x2A59
-0x0155 = 0x2B59
-0x0156 = 0x2A5B
-0x0157 = 0x2B5B
-0x0158 = 0x2A5A
-0x0159 = 0x2B5A
-0x015A = 0x2A5C
-0x015B = 0x2B5C
-0x015C = 0x2A5D
-0x015D = 0x2B5D
-0x015E = 0x2A5F
-0x015F = 0x2B5F
-0x0160 = 0x2A5E
-0x0161 = 0x2B5E
-0x0162 = 0x2A61
-0x0163 = 0x2B61
-0x0164 = 0x2A60
-0x0165 = 0x2B60
-0x0166 = 0x292F
-0x0167 = 0x294F
-0x0168 = 0x2A6C
-0x0169 = 0x2B6C
-0x016A = 0x2A69
-0x016B = 0x2B69
-0x016C = 0x2A66
-0x016D = 0x2B66
-0x016E = 0x2A6B
-0x016F = 0x2B6B
-0x0170 = 0x2A68
-0x0171 = 0x2B68
-0x0172 = 0x2A6A
-0x0173 = 0x2B6A
-0x0174 = 0x2A71
-0x0175 = 0x2B71
-0x0176 = 0x2A74
-0x0177 = 0x2B74
-0x0178 = 0x2A73
-0x0179 = 0x2A75
-0x017A = 0x2B75
-0x017B = 0x2A77
-0x017C = 0x2B77
-0x017D = 0x2A76
-0x017E = 0x2B76
-0x01CD = 0x2A26
-0x01CE = 0x2B26
-0x01CF = 0x2A43
-0x01D0 = 0x2B43
-0x01D1 = 0x2A55
-0x01D2 = 0x2B55
-0x01D3 = 0x2A67
-0x01D4 = 0x2B67
-0x01D5 = 0x2A70
-0x01D6 = 0x2B70
-0x01D7 = 0x2A6D
-0x01D8 = 0x2B6D
-0x01D9 = 0x2A6F
-0x01DA = 0x2B6F
-0x01DB = 0x2A6E
-0x01DC = 0x2B6E
-0x01F5 = 0x2B39
-0x02C7 = 0x2230
-0x02D8 = 0x222F
-0x02D9 = 0x2232
-0x02DA = 0x2236
-0x02DB = 0x2235
-0x02DD = 0x2233
-0x0384 = 0x2238
-0x0385 = 0x2239
-0x0386 = 0x2661
-0x0388 = 0x2662
-0x0389 = 0x2663
-0x038A = 0x2664
-0x038C = 0x2667
-0x038E = 0x2669
-0x038F = 0x266C
-0x0390 = 0x2676
-0x03AA = 0x2665
-0x03AB = 0x266A
-0x03AC = 0x2671
-0x03AD = 0x2672
-0x03AE = 0x2673
-0x03AF = 0x2674
-0x03B0 = 0x267B
-0x03C2 = 0x2678
-0x03CA = 0x2675
-0x03CB = 0x267A
-0x03CC = 0x2677
-0x03CD = 0x2679
-0x03CE = 0x267C
-0x0402 = 0x2742
-0x0403 = 0x2743
-0x0404 = 0x2744
-0x0405 = 0x2745
-0x0406 = 0x2746
-0x0407 = 0x2747
-0x0408 = 0x2748
-0x0409 = 0x2749
-0x040A = 0x274A
-0x040B = 0x274B
-0x040C = 0x274C
-0x040E = 0x274D
-0x040F = 0x274E
-0x0452 = 0x2772
-0x0453 = 0x2773
-0x0454 = 0x2774
-0x0455 = 0x2775
-0x0456 = 0x2776
-0x0457 = 0x2777
-0x0458 = 0x2778
-0x0459 = 0x2779
-0x045A = 0x277A
-0x045B = 0x277B
-0x045C = 0x277C
-0x045E = 0x277D
-0x045F = 0x277E
-0x2116 = 0x2271
-0x2122 = 0x226F
-0x4E02 = 0x3021
-0x4E04 = 0x3022
-0x4E05 = 0x3023
-0x4E0C = 0x3024
-0x4E12 = 0x3025
-0x4E1F = 0x3026
-0x4E23 = 0x3027
-0x4E24 = 0x3028
-0x4E28 = 0x3029
-0x4E2B = 0x302A
-0x4E2E = 0x302B
-0x4E2F = 0x302C
-0x4E30 = 0x302D
-0x4E35 = 0x302E
-0x4E40 = 0x302F
-0x4E41 = 0x3030
-0x4E44 = 0x3031
-0x4E47 = 0x3032
-0x4E51 = 0x3033
-0x4E5A = 0x3034
-0x4E5C = 0x3035
-0x4E63 = 0x3036
-0x4E68 = 0x3037
-0x4E69 = 0x3038
-0x4E74 = 0x3039
-0x4E75 = 0x303A
-0x4E79 = 0x303B
-0x4E7F = 0x303C
-0x4E8D = 0x303D
-0x4E96 = 0x303E
-0x4E97 = 0x303F
-0x4E9D = 0x3040
-0x4EAF = 0x3041
-0x4EB9 = 0x3042
-0x4EC3 = 0x3043
-0x4ED0 = 0x3044
-0x4EDA = 0x3045
-0x4EDB = 0x3046
-0x4EE0 = 0x3047
-0x4EE1 = 0x3048
-0x4EE2 = 0x3049
-0x4EE8 = 0x304A
-0x4EEF = 0x304B
-0x4EF1 = 0x304C
-0x4EF3 = 0x304D
-0x4EF5 = 0x304E
-0x4EFD = 0x304F
-0x4EFE = 0x3050
-0x4EFF = 0x3051
-0x4F00 = 0x3052
-0x4F02 = 0x3053
-0x4F03 = 0x3054
-0x4F08 = 0x3055
-0x4F0B = 0x3056
-0x4F0C = 0x3057
-0x4F12 = 0x3058
-0x4F15 = 0x3059
-0x4F16 = 0x305A
-0x4F17 = 0x305B
-0x4F19 = 0x305C
-0x4F2E = 0x305D
-0x4F31 = 0x305E
-0x4F33 = 0x3060
-0x4F35 = 0x3061
-0x4F37 = 0x3062
-0x4F39 = 0x3063
-0x4F3B = 0x3064
-0x4F3E = 0x3065
-0x4F40 = 0x3066
-0x4F42 = 0x3067
-0x4F48 = 0x3068
-0x4F49 = 0x3069
-0x4F4B = 0x306A
-0x4F4C = 0x306B
-0x4F52 = 0x306C
-0x4F54 = 0x306D
-0x4F56 = 0x306E
-0x4F58 = 0x306F
-0x4F5F = 0x3070
-0x4F60 = 0x305F
-0x4F63 = 0x3071
-0x4F6A = 0x3072
-0x4F6C = 0x3073
-0x4F6E = 0x3074
-0x4F71 = 0x3075
-0x4F77 = 0x3076
-0x4F78 = 0x3077
-0x4F79 = 0x3078
-0x4F7A = 0x3079
-0x4F7D = 0x307A
-0x4F7E = 0x307B
-0x4F81 = 0x307C
-0x4F82 = 0x307D
-0x4F84 = 0x307E
-0x4F85 = 0x3121
-0x4F89 = 0x3122
-0x4F8A = 0x3123
-0x4F8C = 0x3124
-0x4F8E = 0x3125
-0x4F90 = 0x3126
-0x4F92 = 0x3127
-0x4F93 = 0x3128
-0x4F94 = 0x3129
-0x4F97 = 0x312A
-0x4F99 = 0x312B
-0x4F9A = 0x312C
-0x4F9E = 0x312D
-0x4F9F = 0x312E
-0x4FB2 = 0x312F
-0x4FB7 = 0x3130
-0x4FB9 = 0x3131
-0x4FBB = 0x3132
-0x4FBC = 0x3133
-0x4FBD = 0x3134
-0x4FBE = 0x3135
-0x4FC0 = 0x3136
-0x4FC1 = 0x3137
-0x4FC5 = 0x3138
-0x4FC6 = 0x3139
-0x4FC8 = 0x313A
-0x4FC9 = 0x313B
-0x4FCB = 0x313C
-0x4FCC = 0x313D
-0x4FCD = 0x313E
-0x4FCF = 0x313F
-0x4FD2 = 0x3140
-0x4FDC = 0x3141
-0x4FE0 = 0x3142
-0x4FE2 = 0x3143
-0x4FF0 = 0x3144
-0x4FF2 = 0x3145
-0x4FFC = 0x3146
-0x4FFD = 0x3147
-0x4FFF = 0x3148
-0x5000 = 0x3149
-0x5001 = 0x314A
-0x5004 = 0x314B
-0x5007 = 0x314C
-0x500A = 0x314D
-0x500C = 0x314E
-0x500E = 0x314F
-0x5010 = 0x3150
-0x5013 = 0x3151
-0x5017 = 0x3152
-0x5018 = 0x3153
-0x501B = 0x3154
-0x501C = 0x3155
-0x501D = 0x3156
-0x501E = 0x3157
-0x5022 = 0x3158
-0x5027 = 0x3159
-0x502E = 0x315A
-0x5030 = 0x315B
-0x5032 = 0x315C
-0x5033 = 0x315D
-0x5035 = 0x315E
-0x503B = 0x3176
-0x5040 = 0x315F
-0x5041 = 0x3160
-0x5042 = 0x3161
-0x5045 = 0x3162
-0x5046 = 0x3163
-0x504A = 0x3164
-0x504C = 0x3165
-0x504E = 0x3166
-0x5051 = 0x3167
-0x5052 = 0x3168
-0x5053 = 0x3169
-0x5057 = 0x316A
-0x5059 = 0x316B
-0x505F = 0x316C
-0x5060 = 0x316D
-0x5062 = 0x316E
-0x5063 = 0x316F
-0x5066 = 0x3170
-0x5067 = 0x3171
-0x506A = 0x3172
-0x506D = 0x3173
-0x5070 = 0x3174
-0x5071 = 0x3175
-0x5081 = 0x3177
-0x5083 = 0x3178
-0x5084 = 0x3179
-0x5086 = 0x317A
-0x508A = 0x317B
-0x508E = 0x317C
-0x508F = 0x317D
-0x5090 = 0x317E
-0x5092 = 0x3221
-0x5093 = 0x3222
-0x5094 = 0x3223
-0x5096 = 0x3224
-0x509B = 0x3225
-0x509C = 0x3226
-0x509E = 0x3227
-0x509F = 0x3228
-0x50A0 = 0x3229
-0x50A1 = 0x322A
-0x50A2 = 0x322B
-0x50AA = 0x322C
-0x50AF = 0x322D
-0x50B0 = 0x322E
-0x50B9 = 0x322F
-0x50BA = 0x3230
-0x50BD = 0x3231
-0x50C0 = 0x3232
-0x50C3 = 0x3233
-0x50C4 = 0x3234
-0x50C7 = 0x3235
-0x50CC = 0x3236
-0x50CE = 0x3237
-0x50D0 = 0x3238
-0x50D3 = 0x3239
-0x50D4 = 0x323A
-0x50D8 = 0x323B
-0x50DC = 0x323C
-0x50DD = 0x323D
-0x50DF = 0x323E
-0x50E2 = 0x323F
-0x50E4 = 0x3240
-0x50E6 = 0x3241
-0x50E8 = 0x3242
-0x50E9 = 0x3243
-0x50EF = 0x3244
-0x50F1 = 0x3245
-0x50F2 = 0x3251
-0x50F6 = 0x3246
-0x50FA = 0x3247
-0x50FE = 0x3248
-0x5103 = 0x3249
-0x5106 = 0x324A
-0x5107 = 0x324B
-0x5108 = 0x324C
-0x510B = 0x324D
-0x510C = 0x324E
-0x510D = 0x324F
-0x510E = 0x3250
-0x5110 = 0x3252
-0x5117 = 0x3253
-0x5119 = 0x3254
-0x511B = 0x3255
-0x511C = 0x3256
-0x511D = 0x3257
-0x511E = 0x3258
-0x5123 = 0x3259
-0x5127 = 0x325A
-0x5128 = 0x325B
-0x512C = 0x325C
-0x512D = 0x325D
-0x512F = 0x325E
-0x5131 = 0x325F
-0x5133 = 0x3260
-0x5134 = 0x3261
-0x5135 = 0x3262
-0x5138 = 0x3263
-0x5139 = 0x3264
-0x5142 = 0x3265
-0x514A = 0x3266
-0x514F = 0x3267
-0x5153 = 0x3268
-0x5155 = 0x3269
-0x5157 = 0x326A
-0x5158 = 0x326B
-0x515F = 0x326C
-0x5164 = 0x326D
-0x5166 = 0x326E
-0x517E = 0x326F
-0x5183 = 0x3270
-0x5184 = 0x3271
-0x518B = 0x3272
-0x518E = 0x3273
-0x5198 = 0x3274
-0x519D = 0x3275
-0x51A1 = 0x3276
-0x51A3 = 0x3277
-0x51AD = 0x3278
-0x51B8 = 0x3279
-0x51BA = 0x327A
-0x51BC = 0x327B
-0x51BE = 0x327C
-0x51BF = 0x327D
-0x51C2 = 0x327E
-0x51C8 = 0x3321
-0x51CF = 0x3322
-0x51D1 = 0x3323
-0x51D2 = 0x3324
-0x51D3 = 0x3325
-0x51D5 = 0x3326
-0x51D8 = 0x3327
-0x51DE = 0x3328
-0x51E2 = 0x3329
-0x51E5 = 0x332A
-0x51EE = 0x332B
-0x51F2 = 0x332C
-0x51F3 = 0x332D
-0x51F4 = 0x332E
-0x51F7 = 0x332F
-0x5201 = 0x3330
-0x5202 = 0x3331
-0x5205 = 0x3332
-0x5212 = 0x3333
-0x5213 = 0x3334
-0x5215 = 0x3335
-0x5216 = 0x3336
-0x5218 = 0x3337
-0x5222 = 0x3338
-0x5228 = 0x3339
-0x5231 = 0x333A
-0x5232 = 0x333B
-0x5235 = 0x333C
-0x523C = 0x333D
-0x5245 = 0x333E
-0x5249 = 0x333F
-0x5255 = 0x3340
-0x5257 = 0x3341
-0x5258 = 0x3342
-0x525A = 0x3343
-0x525C = 0x3344
-0x525F = 0x3345
-0x5260 = 0x3346
-0x5261 = 0x3347
-0x5266 = 0x3348
-0x526E = 0x3349
-0x5277 = 0x334A
-0x5278 = 0x334B
-0x5279 = 0x334C
-0x5280 = 0x334D
-0x5282 = 0x334E
-0x5285 = 0x334F
-0x528A = 0x3350
-0x528C = 0x3351
-0x5293 = 0x3352
-0x5295 = 0x3353
-0x5296 = 0x3354
-0x5297 = 0x3355
-0x5298 = 0x3356
-0x529A = 0x3357
-0x529C = 0x3358
-0x52A4 = 0x3359
-0x52A5 = 0x335A
-0x52A6 = 0x335B
-0x52A7 = 0x335C
-0x52AF = 0x335D
-0x52B0 = 0x335E
-0x52B6 = 0x335F
-0x52B7 = 0x3360
-0x52B8 = 0x3361
-0x52BA = 0x3362
-0x52BB = 0x3363
-0x52BD = 0x3364
-0x52C0 = 0x3365
-0x52C4 = 0x3366
-0x52C6 = 0x3367
-0x52C8 = 0x3368
-0x52CC = 0x3369
-0x52CF = 0x336A
-0x52D1 = 0x336B
-0x52D4 = 0x336C
-0x52D6 = 0x336D
-0x52DB = 0x336E
-0x52DC = 0x336F
-0x52E1 = 0x3370
-0x52E5 = 0x3371
-0x52E8 = 0x3372
-0x52E9 = 0x3373
-0x52EA = 0x3374
-0x52EC = 0x3375
-0x52F0 = 0x3376
-0x52F1 = 0x3377
-0x52F4 = 0x3378
-0x52F6 = 0x3379
-0x52F7 = 0x337A
-0x5300 = 0x337B
-0x5303 = 0x337C
-0x530A = 0x337D
-0x530B = 0x337E
-0x530C = 0x3421
-0x5311 = 0x3422
-0x5313 = 0x3423
-0x5318 = 0x3424
-0x531B = 0x3425
-0x531C = 0x3426
-0x531E = 0x3427
-0x531F = 0x3428
-0x5325 = 0x3429
-0x5327 = 0x342A
-0x5328 = 0x342B
-0x5329 = 0x342C
-0x532B = 0x342D
-0x532C = 0x342E
-0x532D = 0x342F
-0x5330 = 0x3430
-0x5332 = 0x3431
-0x5335 = 0x3432
-0x533C = 0x3433
-0x533D = 0x3434
-0x533E = 0x3435
-0x5342 = 0x3436
-0x534B = 0x3438
-0x534C = 0x3437
-0x5359 = 0x3439
-0x535B = 0x343A
-0x5361 = 0x343B
-0x5363 = 0x343C
-0x5365 = 0x343D
-0x536C = 0x343E
-0x536D = 0x343F
-0x5372 = 0x3440
-0x5379 = 0x3441
-0x537E = 0x3442
-0x5383 = 0x3443
-0x5387 = 0x3444
-0x5388 = 0x3445
-0x538E = 0x3446
-0x5393 = 0x3447
-0x5394 = 0x3448
-0x5399 = 0x3449
-0x539D = 0x344A
-0x53A1 = 0x344B
-0x53A4 = 0x344C
-0x53AA = 0x344D
-0x53AB = 0x344E
-0x53AF = 0x344F
-0x53B2 = 0x3450
-0x53B4 = 0x3451
-0x53B5 = 0x3452
-0x53B7 = 0x3453
-0x53B8 = 0x3454
-0x53BA = 0x3455
-0x53BD = 0x3456
-0x53C0 = 0x3457
-0x53C5 = 0x3458
-0x53CF = 0x3459
-0x53D2 = 0x345A
-0x53D3 = 0x345B
-0x53D5 = 0x345C
-0x53DA = 0x345D
-0x53DD = 0x345E
-0x53DE = 0x345F
-0x53E0 = 0x3460
-0x53E6 = 0x3461
-0x53E7 = 0x3462
-0x53F5 = 0x3463
-0x5402 = 0x3464
-0x5413 = 0x3465
-0x541A = 0x3466
-0x5421 = 0x3467
-0x5427 = 0x3468
-0x5428 = 0x3469
-0x542A = 0x346A
-0x542F = 0x346B
-0x5431 = 0x346C
-0x5434 = 0x346D
-0x5435 = 0x346E
-0x5443 = 0x346F
-0x5444 = 0x3470
-0x5447 = 0x3471
-0x544D = 0x3472
-0x544F = 0x3473
-0x545E = 0x3474
-0x5462 = 0x3475
-0x5464 = 0x3476
-0x5466 = 0x3477
-0x5467 = 0x3478
-0x5469 = 0x3479
-0x546B = 0x347A
-0x546D = 0x347B
-0x546E = 0x347C
-0x5474 = 0x347D
-0x547F = 0x347E
-0x5481 = 0x3521
-0x5483 = 0x3522
-0x5485 = 0x3523
-0x5488 = 0x3524
-0x5489 = 0x3525
-0x548D = 0x3526
-0x5491 = 0x3527
-0x5495 = 0x3528
-0x5496 = 0x3529
-0x549C = 0x352A
-0x549F = 0x352B
-0x54A1 = 0x352C
-0x54A6 = 0x352D
-0x54A7 = 0x352E
-0x54A9 = 0x352F
-0x54AA = 0x3530
-0x54AD = 0x3531
-0x54AE = 0x3532
-0x54B1 = 0x3533
-0x54B7 = 0x3534
-0x54B9 = 0x3535
-0x54BA = 0x3536
-0x54BB = 0x3537
-0x54BF = 0x3538
-0x54C6 = 0x3539
-0x54CA = 0x353A
-0x54CD = 0x353B
-0x54CE = 0x353C
-0x54E0 = 0x353D
-0x54EA = 0x353E
-0x54EC = 0x353F
-0x54EF = 0x3540
-0x54F6 = 0x3541
-0x54FC = 0x3542
-0x54FE = 0x3543
-0x54FF = 0x3544
-0x5500 = 0x3545
-0x5501 = 0x3546
-0x5505 = 0x3547
-0x5508 = 0x3548
-0x5509 = 0x3549
-0x550C = 0x354A
-0x550D = 0x354B
-0x550E = 0x354C
-0x5515 = 0x354D
-0x552A = 0x354E
-0x552B = 0x354F
-0x5532 = 0x3550
-0x5535 = 0x3551
-0x5536 = 0x3552
-0x553B = 0x3553
-0x553C = 0x3554
-0x553D = 0x3555
-0x5541 = 0x3556
-0x5547 = 0x3557
-0x5549 = 0x3558
-0x554A = 0x3559
-0x554D = 0x355A
-0x5550 = 0x355B
-0x5551 = 0x355C
-0x5558 = 0x355D
-0x555A = 0x355E
-0x555B = 0x355F
-0x555E = 0x3560
-0x5560 = 0x3561
-0x5561 = 0x3562
-0x5564 = 0x3563
-0x5566 = 0x3564
-0x557F = 0x3565
-0x5581 = 0x3566
-0x5582 = 0x3567
-0x5586 = 0x3568
-0x5588 = 0x3569
-0x558E = 0x356A
-0x558F = 0x356B
-0x5591 = 0x356C
-0x5592 = 0x356D
-0x5593 = 0x356E
-0x5594 = 0x356F
-0x5597 = 0x3570
-0x55A3 = 0x3571
-0x55A4 = 0x3572
-0x55AD = 0x3573
-0x55B2 = 0x3574
-0x55BF = 0x3575
-0x55C1 = 0x3576
-0x55C3 = 0x3577
-0x55C6 = 0x3578
-0x55C9 = 0x3579
-0x55CB = 0x357A
-0x55CC = 0x357B
-0x55CE = 0x357C
-0x55D1 = 0x357D
-0x55D2 = 0x357E
-0x55D3 = 0x3621
-0x55D7 = 0x3622
-0x55D8 = 0x3623
-0x55DB = 0x3624
-0x55DE = 0x3625
-0x55E2 = 0x3626
-0x55E9 = 0x3627
-0x55F6 = 0x3628
-0x55FF = 0x3629
-0x5605 = 0x362A
-0x5608 = 0x362B
-0x560A = 0x362C
-0x560D = 0x362D
-0x560E = 0x362E
-0x560F = 0x362F
-0x5610 = 0x3630
-0x5611 = 0x3631
-0x5612 = 0x3632
-0x5619 = 0x3633
-0x562C = 0x3634
-0x5630 = 0x3635
-0x5633 = 0x3636
-0x5635 = 0x3637
-0x5637 = 0x3638
-0x5639 = 0x3639
-0x563B = 0x363A
-0x563C = 0x363B
-0x563D = 0x363C
-0x563F = 0x363D
-0x5640 = 0x363E
-0x5641 = 0x363F
-0x5643 = 0x3640
-0x5644 = 0x3641
-0x5646 = 0x3642
-0x5649 = 0x3643
-0x564B = 0x3644
-0x564D = 0x3645
-0x564F = 0x3646
-0x5654 = 0x3647
-0x565E = 0x3648
-0x5660 = 0x3649
-0x5661 = 0x364A
-0x5662 = 0x364B
-0x5663 = 0x364C
-0x5666 = 0x364D
-0x5669 = 0x364E
-0x566D = 0x364F
-0x566F = 0x3650
-0x5671 = 0x3651
-0x5672 = 0x3652
-0x5675 = 0x3653
-0x5684 = 0x3654
-0x5685 = 0x3655
-0x5688 = 0x3656
-0x568B = 0x3657
-0x568C = 0x3658
-0x5695 = 0x3659
-0x5699 = 0x365A
-0x569A = 0x365B
-0x569D = 0x365C
-0x569E = 0x365D
-0x569F = 0x365E
-0x56A6 = 0x365F
-0x56A7 = 0x3660
-0x56A8 = 0x3661
-0x56A9 = 0x3662
-0x56AB = 0x3663
-0x56AC = 0x3664
-0x56AD = 0x3665
-0x56B1 = 0x3666
-0x56B3 = 0x3667
-0x56B7 = 0x3668
-0x56BE = 0x3669
-0x56C5 = 0x366A
-0x56C9 = 0x366B
-0x56CA = 0x366C
-0x56CB = 0x366D
-0x56CC = 0x3670
-0x56CD = 0x3671
-0x56CF = 0x366E
-0x56D0 = 0x366F
-0x56D9 = 0x3672
-0x56DC = 0x3673
-0x56DD = 0x3674
-0x56DF = 0x3675
-0x56E1 = 0x3676
-0x56E4 = 0x3677
-0x56E5 = 0x3678
-0x56E6 = 0x3679
-0x56E7 = 0x367A
-0x56E8 = 0x367B
-0x56EB = 0x367D
-0x56ED = 0x367E
-0x56F1 = 0x367C
-0x56F6 = 0x3721
-0x56F7 = 0x3722
-0x5701 = 0x3723
-0x5702 = 0x3724
-0x5707 = 0x3725
-0x570A = 0x3726
-0x570C = 0x3727
-0x5711 = 0x3728
-0x5715 = 0x3729
-0x571A = 0x372A
-0x571B = 0x372B
-0x571D = 0x372C
-0x5720 = 0x372D
-0x5722 = 0x372E
-0x5723 = 0x372F
-0x5724 = 0x3730
-0x5725 = 0x3731
-0x5729 = 0x3732
-0x572A = 0x3733
-0x572C = 0x3734
-0x572E = 0x3735
-0x572F = 0x3736
-0x5733 = 0x3737
-0x5734 = 0x3738
-0x573D = 0x3739
-0x573E = 0x373A
-0x573F = 0x373B
-0x5745 = 0x373C
-0x5746 = 0x373D
-0x574C = 0x373E
-0x574D = 0x373F
-0x5752 = 0x3740
-0x5762 = 0x3741
-0x5765 = 0x3742
-0x5767 = 0x3743
-0x5768 = 0x3744
-0x576B = 0x3745
-0x576D = 0x3746
-0x576E = 0x3747
-0x576F = 0x3748
-0x5770 = 0x3749
-0x5771 = 0x374A
-0x5773 = 0x374B
-0x5774 = 0x374C
-0x5775 = 0x374D
-0x5777 = 0x374E
-0x5779 = 0x374F
-0x577A = 0x3750
-0x577B = 0x3751
-0x577C = 0x3752
-0x577E = 0x3753
-0x5781 = 0x3754
-0x5783 = 0x3755
-0x578C = 0x3756
-0x5794 = 0x3757
-0x5795 = 0x3760
-0x5797 = 0x3758
-0x5799 = 0x3759
-0x579A = 0x375A
-0x579C = 0x375B
-0x579D = 0x375C
-0x579E = 0x375D
-0x579F = 0x375E
-0x57A1 = 0x375F
-0x57A7 = 0x3761
-0x57A8 = 0x3762
-0x57A9 = 0x3763
-0x57AC = 0x3764
-0x57B8 = 0x3765
-0x57BD = 0x3766
-0x57C7 = 0x3767
-0x57C8 = 0x3768
-0x57CC = 0x3769
-0x57CF = 0x376A
-0x57D5 = 0x376B
-0x57DD = 0x376C
-0x57DE = 0x376D
-0x57E1 = 0x377E
-0x57E4 = 0x376E
-0x57E6 = 0x376F
-0x57E7 = 0x3770
-0x57E9 = 0x3771
-0x57ED = 0x3772
-0x57F0 = 0x3773
-0x57F5 = 0x3774
-0x57F6 = 0x3775
-0x57F8 = 0x3776
-0x57FD = 0x3777
-0x57FE = 0x3778
-0x57FF = 0x3779
-0x5803 = 0x377A
-0x5804 = 0x377B
-0x5808 = 0x377C
-0x5809 = 0x377D
-0x580C = 0x3821
-0x580D = 0x3822
-0x581B = 0x3823
-0x581E = 0x3824
-0x581F = 0x3825
-0x5820 = 0x3826
-0x5826 = 0x3827
-0x5827 = 0x3828
-0x582D = 0x3829
-0x5832 = 0x382A
-0x5839 = 0x382B
-0x583F = 0x382C
-0x5849 = 0x382D
-0x584C = 0x382E
-0x584D = 0x382F
-0x584F = 0x3830
-0x5850 = 0x3831
-0x5855 = 0x3832
-0x585F = 0x3833
-0x5861 = 0x3834
-0x5864 = 0x3835
-0x5867 = 0x3836
-0x5868 = 0x3837
-0x5878 = 0x3838
-0x587C = 0x3839
-0x587F = 0x383A
-0x5880 = 0x383B
-0x5881 = 0x383C
-0x5887 = 0x383D
-0x5888 = 0x383E
-0x5889 = 0x383F
-0x588A = 0x3840
-0x588C = 0x3841
-0x588D = 0x3842
-0x588F = 0x3843
-0x5890 = 0x3844
-0x5894 = 0x3845
-0x5896 = 0x3846
-0x589D = 0x3847
-0x58A0 = 0x3848
-0x58A1 = 0x3849
-0x58A2 = 0x384A
-0x58A6 = 0x384B
-0x58A9 = 0x384C
-0x58B1 = 0x384D
-0x58B2 = 0x384E
-0x58BC = 0x3850
-0x58C2 = 0x3851
-0x58C4 = 0x384F
-0x58C8 = 0x3852
-0x58CD = 0x3853
-0x58CE = 0x3854
-0x58D0 = 0x3855
-0x58D2 = 0x3856
-0x58D4 = 0x3857
-0x58D6 = 0x3858
-0x58DA = 0x3859
-0x58DD = 0x385A
-0x58E1 = 0x385B
-0x58E2 = 0x385C
-0x58E9 = 0x385D
-0x58F3 = 0x385E
-0x5905 = 0x385F
-0x5906 = 0x3860
-0x590B = 0x3861
-0x590C = 0x3862
-0x5912 = 0x3863
-0x5913 = 0x3864
-0x5914 = 0x3865
-0x591D = 0x3867
-0x5921 = 0x3868
-0x5923 = 0x3869
-0x5924 = 0x386A
-0x5928 = 0x386B
-0x592F = 0x386C
-0x5930 = 0x386D
-0x5933 = 0x386E
-0x5935 = 0x386F
-0x5936 = 0x3870
-0x593F = 0x3871
-0x5943 = 0x3872
-0x5946 = 0x3873
-0x5952 = 0x3874
-0x5953 = 0x3875
-0x5959 = 0x3876
-0x595B = 0x3877
-0x595D = 0x3878
-0x595E = 0x3879
-0x595F = 0x387A
-0x5961 = 0x387B
-0x5963 = 0x387C
-0x596B = 0x387D
-0x596D = 0x387E
-0x596F = 0x3921
-0x5972 = 0x3922
-0x5975 = 0x3923
-0x5976 = 0x3924
-0x5979 = 0x3925
-0x597B = 0x3926
-0x597C = 0x3927
-0x598B = 0x3928
-0x598C = 0x3929
-0x598E = 0x392A
-0x5992 = 0x392B
-0x5995 = 0x392C
-0x5997 = 0x392D
-0x599F = 0x392E
-0x59A4 = 0x392F
-0x59A7 = 0x3930
-0x59AD = 0x3931
-0x59AE = 0x3932
-0x59AF = 0x3933
-0x59B0 = 0x3934
-0x59B3 = 0x3935
-0x59B7 = 0x3936
-0x59BA = 0x3937
-0x59BC = 0x3938
-0x59C1 = 0x3939
-0x59C3 = 0x393A
-0x59C4 = 0x393B
-0x59C8 = 0x393C
-0x59CA = 0x393D
-0x59CD = 0x393E
-0x59D2 = 0x393F
-0x59DD = 0x3940
-0x59DE = 0x3941
-0x59DF = 0x3942
-0x59E3 = 0x3943
-0x59E4 = 0x3944
-0x59E7 = 0x3945
-0x59EE = 0x3946
-0x59EF = 0x3947
-0x59F1 = 0x3948
-0x59F2 = 0x3949
-0x59F4 = 0x394A
-0x59F7 = 0x394B
-0x5A00 = 0x394C
-0x5A04 = 0x394D
-0x5A0C = 0x394E
-0x5A0D = 0x394F
-0x5A0E = 0x3950
-0x5A12 = 0x3951
-0x5A13 = 0x3952
-0x5A1E = 0x3953
-0x5A23 = 0x3954
-0x5A24 = 0x3955
-0x5A27 = 0x3956
-0x5A28 = 0x3957
-0x5A2A = 0x3958
-0x5A2D = 0x3959
-0x5A30 = 0x395A
-0x5A44 = 0x395B
-0x5A45 = 0x395C
-0x5A47 = 0x395D
-0x5A48 = 0x395E
-0x5A4C = 0x395F
-0x5A50 = 0x3960
-0x5A55 = 0x3961
-0x5A5E = 0x3962
-0x5A63 = 0x3963
-0x5A65 = 0x3964
-0x5A67 = 0x3965
-0x5A6D = 0x3966
-0x5A77 = 0x3967
-0x5A7A = 0x3968
-0x5A7B = 0x3969
-0x5A7E = 0x396A
-0x5A8B = 0x396B
-0x5A90 = 0x396C
-0x5A93 = 0x396D
-0x5A96 = 0x396E
-0x5A99 = 0x396F
-0x5A9C = 0x3970
-0x5A9E = 0x3971
-0x5A9F = 0x3972
-0x5AA0 = 0x3973
-0x5AA2 = 0x3974
-0x5AA7 = 0x3975
-0x5AAC = 0x3976
-0x5AB1 = 0x3977
-0x5AB2 = 0x3978
-0x5AB3 = 0x3979
-0x5AB5 = 0x397A
-0x5AB8 = 0x397B
-0x5ABA = 0x397C
-0x5ABB = 0x397D
-0x5ABF = 0x397E
-0x5AC4 = 0x3A21
-0x5AC6 = 0x3A22
-0x5AC8 = 0x3A23
-0x5ACF = 0x3A24
-0x5ADA = 0x3A25
-0x5ADC = 0x3A26
-0x5AE0 = 0x3A27
-0x5AE5 = 0x3A28
-0x5AEA = 0x3A29
-0x5AEE = 0x3A2A
-0x5AF5 = 0x3A2B
-0x5AF6 = 0x3A2C
-0x5AFD = 0x3A2D
-0x5B00 = 0x3A2E
-0x5B01 = 0x3A2F
-0x5B08 = 0x3A30
-0x5B17 = 0x3A31
-0x5B19 = 0x3A33
-0x5B1B = 0x3A34
-0x5B1D = 0x3A35
-0x5B21 = 0x3A36
-0x5B25 = 0x3A37
-0x5B2D = 0x3A38
-0x5B34 = 0x3A32
-0x5B38 = 0x3A39
-0x5B41 = 0x3A3A
-0x5B4B = 0x3A3B
-0x5B4C = 0x3A3C
-0x5B52 = 0x3A3D
-0x5B56 = 0x3A3E
-0x5B5E = 0x3A3F
-0x5B68 = 0x3A40
-0x5B6E = 0x3A41
-0x5B6F = 0x3A42
-0x5B7C = 0x3A43
-0x5B7D = 0x3A44
-0x5B7E = 0x3A45
-0x5B7F = 0x3A46
-0x5B81 = 0x3A47
-0x5B84 = 0x3A48
-0x5B86 = 0x3A49
-0x5B8A = 0x3A4A
-0x5B8E = 0x3A4B
-0x5B90 = 0x3A4C
-0x5B91 = 0x3A4D
-0x5B93 = 0x3A4E
-0x5B94 = 0x3A4F
-0x5B96 = 0x3A50
-0x5BA8 = 0x3A51
-0x5BA9 = 0x3A52
-0x5BAC = 0x3A53
-0x5BAD = 0x3A54
-0x5BAF = 0x3A55
-0x5BB1 = 0x3A56
-0x5BB2 = 0x3A57
-0x5BB7 = 0x3A58
-0x5BBA = 0x3A59
-0x5BBC = 0x3A5A
-0x5BC0 = 0x3A5B
-0x5BC1 = 0x3A5C
-0x5BCD = 0x3A5D
-0x5BCF = 0x3A5E
-0x5BD6 = 0x3A5F
-0x5BD7 = 0x3A60
-0x5BD8 = 0x3A61
-0x5BD9 = 0x3A62
-0x5BDA = 0x3A63
-0x5BE0 = 0x3A64
-0x5BEF = 0x3A65
-0x5BF1 = 0x3A66
-0x5BF4 = 0x3A67
-0x5BFD = 0x3A68
-0x5C0C = 0x3A69
-0x5C17 = 0x3A6A
-0x5C1E = 0x3A6B
-0x5C1F = 0x3A6C
-0x5C23 = 0x3A6D
-0x5C26 = 0x3A6E
-0x5C29 = 0x3A6F
-0x5C2B = 0x3A70
-0x5C2C = 0x3A71
-0x5C2E = 0x3A72
-0x5C30 = 0x3A73
-0x5C32 = 0x3A74
-0x5C35 = 0x3A75
-0x5C36 = 0x3A76
-0x5C59 = 0x3A77
-0x5C5A = 0x3A78
-0x5C5C = 0x3A79
-0x5C62 = 0x3A7A
-0x5C63 = 0x3A7B
-0x5C67 = 0x3A7C
-0x5C68 = 0x3A7D
-0x5C69 = 0x3A7E
-0x5C6D = 0x3B21
-0x5C70 = 0x3B22
-0x5C74 = 0x3B23
-0x5C75 = 0x3B24
-0x5C7A = 0x3B25
-0x5C7B = 0x3B26
-0x5C7C = 0x3B27
-0x5C7D = 0x3B28
-0x5C87 = 0x3B29
-0x5C88 = 0x3B2A
-0x5C8A = 0x3B2B
-0x5C8F = 0x3B2C
-0x5C92 = 0x3B2D
-0x5C9D = 0x3B2E
-0x5C9F = 0x3B2F
-0x5CA0 = 0x3B30
-0x5CA2 = 0x3B31
-0x5CA3 = 0x3B32
-0x5CA6 = 0x3B33
-0x5CAA = 0x3B34
-0x5CB2 = 0x3B35
-0x5CB4 = 0x3B36
-0x5CB5 = 0x3B37
-0x5CBA = 0x3B38
-0x5CC9 = 0x3B39
-0x5CCB = 0x3B3A
-0x5CD2 = 0x3B3B
-0x5CD7 = 0x3B3D
-0x5CDD = 0x3B3C
-0x5CEE = 0x3B3E
-0x5CF1 = 0x3B3F
-0x5CF2 = 0x3B40
-0x5CF4 = 0x3B41
-0x5D01 = 0x3B42
-0x5D06 = 0x3B43
-0x5D0D = 0x3B44
-0x5D12 = 0x3B45
-0x5D23 = 0x3B47
-0x5D24 = 0x3B48
-0x5D26 = 0x3B49
-0x5D27 = 0x3B4A
-0x5D2B = 0x3B46
-0x5D31 = 0x3B4B
-0x5D34 = 0x3B4C
-0x5D39 = 0x3B4D
-0x5D3D = 0x3B4E
-0x5D3F = 0x3B4F
-0x5D42 = 0x3B50
-0x5D43 = 0x3B51
-0x5D46 = 0x3B52
-0x5D48 = 0x3B53
-0x5D4A = 0x3B57
-0x5D51 = 0x3B55
-0x5D55 = 0x3B54
-0x5D59 = 0x3B56
-0x5D5F = 0x3B58
-0x5D60 = 0x3B59
-0x5D61 = 0x3B5A
-0x5D62 = 0x3B5B
-0x5D64 = 0x3B5C
-0x5D6A = 0x3B5D
-0x5D6D = 0x3B5E
-0x5D70 = 0x3B5F
-0x5D79 = 0x3B60
-0x5D7A = 0x3B61
-0x5D7E = 0x3B62
-0x5D7F = 0x3B63
-0x5D81 = 0x3B64
-0x5D83 = 0x3B65
-0x5D88 = 0x3B66
-0x5D8A = 0x3B67
-0x5D92 = 0x3B68
-0x5D93 = 0x3B69
-0x5D94 = 0x3B6A
-0x5D95 = 0x3B6B
-0x5D99 = 0x3B6C
-0x5D9B = 0x3B6D
-0x5D9F = 0x3B6E
-0x5DA0 = 0x3B6F
-0x5DA7 = 0x3B70
-0x5DAB = 0x3B71
-0x5DB0 = 0x3B72
-0x5DB2 = 0x6674
-0x5DB4 = 0x3B73
-0x5DB8 = 0x3B74
-0x5DB9 = 0x3B75
-0x5DC3 = 0x3B76
-0x5DC7 = 0x3B77
-0x5DCB = 0x3B78
-0x5DCE = 0x3B7A
-0x5DD0 = 0x3B79
-0x5DD8 = 0x3B7B
-0x5DD9 = 0x3B7C
-0x5DE0 = 0x3B7D
-0x5DE4 = 0x3B7E
-0x5DE9 = 0x3C21
-0x5DF8 = 0x3C22
-0x5DF9 = 0x3C23
-0x5E00 = 0x3C24
-0x5E07 = 0x3C25
-0x5E0D = 0x3C26
-0x5E12 = 0x3C27
-0x5E14 = 0x3C28
-0x5E15 = 0x3C29
-0x5E18 = 0x3C2A
-0x5E1F = 0x3C2B
-0x5E20 = 0x3C2C
-0x5E28 = 0x3C2E
-0x5E2E = 0x3C2D
-0x5E32 = 0x3C2F
-0x5E35 = 0x3C30
-0x5E3E = 0x3C31
-0x5E49 = 0x3C34
-0x5E4B = 0x3C32
-0x5E50 = 0x3C33
-0x5E51 = 0x3C35
-0x5E56 = 0x3C36
-0x5E58 = 0x3C37
-0x5E5B = 0x3C38
-0x5E5C = 0x3C39
-0x5E5E = 0x3C3A
-0x5E68 = 0x3C3B
-0x5E6A = 0x3C3C
-0x5E6B = 0x3C3D
-0x5E6C = 0x3C3E
-0x5E6D = 0x3C3F
-0x5E6E = 0x3C40
-0x5E70 = 0x3C41
-0x5E80 = 0x3C42
-0x5E8B = 0x3C43
-0x5E8E = 0x3C44
-0x5EA2 = 0x3C45
-0x5EA4 = 0x3C46
-0x5EA5 = 0x3C47
-0x5EA8 = 0x3C48
-0x5EAA = 0x3C49
-0x5EAC = 0x3C4A
-0x5EB1 = 0x3C4B
-0x5EB3 = 0x3C4C
-0x5EBD = 0x3C4D
-0x5EBE = 0x3C4E
-0x5EBF = 0x3C4F
-0x5EC6 = 0x3C50
-0x5ECB = 0x3C52
-0x5ECC = 0x3C51
-0x5ECE = 0x3C53
-0x5ED1 = 0x3C54
-0x5ED2 = 0x3C55
-0x5ED4 = 0x3C56
-0x5ED5 = 0x3C57
-0x5EDC = 0x3C58
-0x5EDE = 0x3C59
-0x5EE5 = 0x3C5A
-0x5EEB = 0x3C5B
-0x5F02 = 0x3C5C
-0x5F06 = 0x3C5D
-0x5F07 = 0x3C5E
-0x5F08 = 0x3C5F
-0x5F0E = 0x3C60
-0x5F19 = 0x3C61
-0x5F1C = 0x3C62
-0x5F1D = 0x3C63
-0x5F21 = 0x3C64
-0x5F22 = 0x3C65
-0x5F23 = 0x3C66
-0x5F24 = 0x3C67
-0x5F28 = 0x3C68
-0x5F2B = 0x3C69
-0x5F2C = 0x3C6A
-0x5F2E = 0x3C6B
-0x5F30 = 0x3C6C
-0x5F34 = 0x3C6D
-0x5F36 = 0x3C6E
-0x5F3B = 0x3C6F
-0x5F3D = 0x3C70
-0x5F3F = 0x3C71
-0x5F40 = 0x3C72
-0x5F44 = 0x3C73
-0x5F45 = 0x3C74
-0x5F47 = 0x3C75
-0x5F4D = 0x3C76
-0x5F50 = 0x3C77
-0x5F54 = 0x3C78
-0x5F58 = 0x3C79
-0x5F5B = 0x3C7A
-0x5F60 = 0x3C7B
-0x5F63 = 0x3C7C
-0x5F64 = 0x3C7D
-0x5F67 = 0x3C7E
-0x5F6F = 0x3D21
-0x5F72 = 0x3D22
-0x5F74 = 0x3D23
-0x5F75 = 0x3D24
-0x5F78 = 0x3D25
-0x5F7A = 0x3D26
-0x5F7D = 0x3D27
-0x5F7E = 0x3D28
-0x5F89 = 0x3D29
-0x5F8D = 0x3D2A
-0x5F8F = 0x3D2B
-0x5F96 = 0x3D2C
-0x5F9C = 0x3D2D
-0x5F9D = 0x3D2E
-0x5FA2 = 0x3D2F
-0x5FA4 = 0x3D32
-0x5FA7 = 0x3D30
-0x5FAB = 0x3D31
-0x5FAC = 0x3D33
-0x5FAF = 0x3D34
-0x5FB0 = 0x3D35
-0x5FB1 = 0x3D36
-0x5FB8 = 0x3D37
-0x5FC4 = 0x3D38
-0x5FC7 = 0x3D39
-0x5FC8 = 0x3D3A
-0x5FC9 = 0x3D3B
-0x5FCB = 0x3D3C
-0x5FD0 = 0x3D3D
-0x5FD1 = 0x3D3E
-0x5FD2 = 0x3D3F
-0x5FD3 = 0x3D40
-0x5FD4 = 0x3D41
-0x5FDE = 0x3D42
-0x5FE1 = 0x3D43
-0x5FE2 = 0x3D44
-0x5FE8 = 0x3D45
-0x5FE9 = 0x3D46
-0x5FEA = 0x3D47
-0x5FEC = 0x3D48
-0x5FED = 0x3D49
-0x5FEE = 0x3D4A
-0x5FEF = 0x3D4B
-0x5FF2 = 0x3D4C
-0x5FF3 = 0x3D4D
-0x5FF6 = 0x3D4E
-0x5FFA = 0x3D4F
-0x5FFC = 0x3D50
-0x6007 = 0x3D51
-0x600A = 0x3D52
-0x600D = 0x3D53
-0x6013 = 0x3D54
-0x6014 = 0x3D55
-0x6017 = 0x3D56
-0x6018 = 0x3D57
-0x601A = 0x3D58
-0x601F = 0x3D59
-0x6024 = 0x3D5A
-0x602D = 0x3D5B
-0x6033 = 0x3D5C
-0x6035 = 0x3D5D
-0x6040 = 0x3D5E
-0x6047 = 0x3D5F
-0x6048 = 0x3D60
-0x6049 = 0x3D61
-0x604C = 0x3D62
-0x6051 = 0x3D63
-0x6054 = 0x3D64
-0x6056 = 0x3D65
-0x6057 = 0x3D66
-0x605D = 0x3D67
-0x6061 = 0x3D68
-0x6067 = 0x3D69
-0x6071 = 0x3D6A
-0x607E = 0x3D6B
-0x607F = 0x3D6C
-0x6082 = 0x3D6D
-0x6086 = 0x3D6E
-0x6088 = 0x3D6F
-0x608A = 0x3D70
-0x608E = 0x3D71
-0x6091 = 0x3D72
-0x6093 = 0x3D73
-0x6095 = 0x3D74
-0x6098 = 0x3D75
-0x609D = 0x3D76
-0x609E = 0x3D77
-0x60A2 = 0x3D78
-0x60A4 = 0x3D79
-0x60A5 = 0x3D7A
-0x60A8 = 0x3D7B
-0x60B0 = 0x3D7C
-0x60B1 = 0x3D7D
-0x60B7 = 0x3D7E
-0x60BB = 0x3E21
-0x60BE = 0x3E22
-0x60C2 = 0x3E23
-0x60C4 = 0x3E24
-0x60C8 = 0x3E25
-0x60C9 = 0x3E26
-0x60CA = 0x3E27
-0x60CB = 0x3E28
-0x60CE = 0x3E29
-0x60CF = 0x3E2A
-0x60D4 = 0x3E2B
-0x60D5 = 0x3E2C
-0x60D9 = 0x3E2D
-0x60DB = 0x3E2E
-0x60DD = 0x3E2F
-0x60DE = 0x3E30
-0x60E2 = 0x3E31
-0x60E5 = 0x3E32
-0x60F2 = 0x3E33
-0x60F5 = 0x3E34
-0x60F8 = 0x3E35
-0x60FC = 0x3E36
-0x60FD = 0x3E37
-0x6102 = 0x3E38
-0x6107 = 0x3E39
-0x610A = 0x3E3A
-0x610C = 0x3E3B
-0x6110 = 0x3E3C
-0x6111 = 0x3E3D
-0x6112 = 0x3E3E
-0x6113 = 0x3E3F
-0x6114 = 0x3E40
-0x6116 = 0x3E41
-0x6117 = 0x3E42
-0x6119 = 0x3E43
-0x611C = 0x3E44
-0x611E = 0x3E45
-0x6122 = 0x3E46
-0x612A = 0x3E47
-0x612B = 0x3E48
-0x6130 = 0x3E49
-0x6131 = 0x3E4A
-0x6135 = 0x3E4B
-0x6136 = 0x3E4C
-0x6137 = 0x3E4D
-0x6139 = 0x3E4E
-0x6141 = 0x3E4F
-0x6145 = 0x3E50
-0x6146 = 0x3E51
-0x6149 = 0x3E52
-0x615E = 0x3E53
-0x6160 = 0x3E54
-0x616C = 0x3E55
-0x6172 = 0x3E56
-0x6178 = 0x3E57
-0x617B = 0x3E58
-0x617C = 0x3E59
-0x617F = 0x3E5A
-0x6180 = 0x3E5B
-0x6181 = 0x3E5C
-0x6183 = 0x3E5D
-0x6184 = 0x3E5E
-0x618B = 0x3E5F
-0x618D = 0x3E60
-0x6192 = 0x3E61
-0x6193 = 0x3E62
-0x6197 = 0x3E63
-0x6198 = 0x3E64
-0x619C = 0x3E65
-0x619D = 0x3E66
-0x619F = 0x3E67
-0x61A0 = 0x3E68
-0x61A5 = 0x3E69
-0x61A8 = 0x3E6A
-0x61AA = 0x3E6B
-0x61AD = 0x3E6C
-0x61B8 = 0x3E6D
-0x61B9 = 0x3E6E
-0x61BC = 0x3E6F
-0x61C0 = 0x3E70
-0x61C1 = 0x3E71
-0x61C2 = 0x3E72
-0x61CE = 0x3E73
-0x61CF = 0x3E74
-0x61D5 = 0x3E75
-0x61DC = 0x3E76
-0x61DD = 0x3E77
-0x61DE = 0x3E78
-0x61DF = 0x3E79
-0x61E1 = 0x3E7A
-0x61E2 = 0x3E7B
-0x61E5 = 0x3E7E
-0x61E7 = 0x3E7C
-0x61E9 = 0x3E7D
-0x61EC = 0x3F21
-0x61ED = 0x3F22
-0x61EF = 0x3F23
-0x6201 = 0x3F24
-0x6203 = 0x3F25
-0x6204 = 0x3F26
-0x6207 = 0x3F27
-0x6213 = 0x3F28
-0x6215 = 0x3F29
-0x621C = 0x3F2A
-0x6220 = 0x3F2B
-0x6222 = 0x3F2C
-0x6223 = 0x3F2D
-0x6227 = 0x3F2E
-0x6229 = 0x3F2F
-0x622B = 0x3F30
-0x6239 = 0x3F31
-0x623D = 0x3F32
-0x6242 = 0x3F33
-0x6243 = 0x3F34
-0x6244 = 0x3F35
-0x6246 = 0x3F36
-0x624C = 0x3F37
-0x6250 = 0x3F38
-0x6251 = 0x3F39
-0x6252 = 0x3F3A
-0x6254 = 0x3F3B
-0x6256 = 0x3F3C
-0x625A = 0x3F3D
-0x625C = 0x3F3E
-0x6264 = 0x3F3F
-0x626D = 0x3F40
-0x626F = 0x3F41
-0x6273 = 0x3F42
-0x627A = 0x3F43
-0x627D = 0x3F44
-0x628D = 0x3F45
-0x628E = 0x3F46
-0x628F = 0x3F47
-0x6290 = 0x3F48
-0x62A6 = 0x3F49
-0x62A8 = 0x3F4A
-0x62B3 = 0x3F4B
-0x62B6 = 0x3F4C
-0x62B7 = 0x3F4D
-0x62BA = 0x3F4E
-0x62BE = 0x3F4F
-0x62BF = 0x3F50
-0x62C4 = 0x3F51
-0x62CE = 0x3F52
-0x62D5 = 0x3F53
-0x62D6 = 0x3F54
-0x62DA = 0x3F55
-0x62EA = 0x3F56
-0x62F2 = 0x3F57
-0x62F4 = 0x3F58
-0x62FC = 0x3F59
-0x62FD = 0x3F5A
-0x6303 = 0x3F5B
-0x6304 = 0x3F5C
-0x630A = 0x3F5D
-0x630B = 0x3F5E
-0x630D = 0x3F5F
-0x6310 = 0x3F60
-0x6313 = 0x3F61
-0x6316 = 0x3F62
-0x6318 = 0x3F63
-0x6329 = 0x3F64
-0x632A = 0x3F65
-0x632D = 0x3F66
-0x6335 = 0x3F67
-0x6336 = 0x3F68
-0x6339 = 0x3F69
-0x633C = 0x3F6A
-0x6341 = 0x3F6B
-0x6342 = 0x3F6C
-0x6343 = 0x3F6D
-0x6344 = 0x3F6E
-0x6346 = 0x3F6F
-0x634A = 0x3F70
-0x634B = 0x3F71
-0x634E = 0x3F72
-0x6352 = 0x3F73
-0x6353 = 0x3F74
-0x6354 = 0x3F75
-0x6358 = 0x3F76
-0x635B = 0x3F77
-0x6365 = 0x3F78
-0x6366 = 0x3F79
-0x636C = 0x3F7A
-0x636D = 0x3F7B
-0x6371 = 0x3F7C
-0x6374 = 0x3F7D
-0x6375 = 0x3F7E
-0x6378 = 0x4021
-0x637C = 0x4022
-0x637D = 0x4023
-0x637F = 0x4024
-0x6382 = 0x4025
-0x6384 = 0x4026
-0x6387 = 0x4027
-0x638A = 0x4028
-0x6390 = 0x4029
-0x6394 = 0x402A
-0x6395 = 0x402B
-0x6399 = 0x402C
-0x639A = 0x402D
-0x639E = 0x402E
-0x63A4 = 0x402F
-0x63A6 = 0x4030
-0x63AD = 0x4031
-0x63AE = 0x4032
-0x63AF = 0x4033
-0x63BD = 0x4034
-0x63C1 = 0x4035
-0x63C5 = 0x4036
-0x63C8 = 0x4037
-0x63CE = 0x4038
-0x63D1 = 0x4039
-0x63D3 = 0x403A
-0x63D4 = 0x403B
-0x63D5 = 0x403C
-0x63DC = 0x403D
-0x63E0 = 0x403E
-0x63E5 = 0x403F
-0x63EA = 0x4040
-0x63EC = 0x4041
-0x63F2 = 0x4042
-0x63F3 = 0x4043
-0x63F5 = 0x4044
-0x63F8 = 0x4045
-0x63F9 = 0x4046
-0x6409 = 0x4047
-0x640A = 0x4048
-0x6410 = 0x4049
-0x6412 = 0x404A
-0x6414 = 0x404B
-0x6418 = 0x404C
-0x641E = 0x404D
-0x6420 = 0x404E
-0x6422 = 0x404F
-0x6424 = 0x4050
-0x6425 = 0x4051
-0x6429 = 0x4052
-0x642A = 0x4053
-0x642F = 0x4054
-0x6430 = 0x4055
-0x6435 = 0x4056
-0x643D = 0x4057
-0x643F = 0x4058
-0x644B = 0x4059
-0x644F = 0x405A
-0x6451 = 0x405B
-0x6452 = 0x405C
-0x6453 = 0x405D
-0x6454 = 0x405E
-0x645A = 0x405F
-0x645B = 0x4060
-0x645C = 0x4061
-0x645D = 0x4062
-0x645F = 0x4063
-0x6460 = 0x4064
-0x6461 = 0x4065
-0x6463 = 0x4066
-0x646D = 0x4067
-0x6473 = 0x4068
-0x6474 = 0x4069
-0x647B = 0x406A
-0x647D = 0x406B
-0x6485 = 0x406C
-0x6487 = 0x406D
-0x648F = 0x406E
-0x6490 = 0x406F
-0x6491 = 0x4070
-0x6498 = 0x4071
-0x6499 = 0x4072
-0x649B = 0x4073
-0x649D = 0x4074
-0x649F = 0x4075
-0x64A1 = 0x4076
-0x64A3 = 0x4077
-0x64A6 = 0x4078
-0x64A8 = 0x4079
-0x64AC = 0x407A
-0x64B3 = 0x407B
-0x64BD = 0x407C
-0x64BE = 0x407D
-0x64BF = 0x407E
-0x64C4 = 0x4121
-0x64C9 = 0x4122
-0x64CA = 0x4123
-0x64CB = 0x4124
-0x64CC = 0x4125
-0x64CE = 0x4126
-0x64D0 = 0x4127
-0x64D1 = 0x4128
-0x64D5 = 0x4129
-0x64D7 = 0x412A
-0x64E4 = 0x412B
-0x64E5 = 0x412C
-0x64E9 = 0x412D
-0x64EA = 0x412E
-0x64ED = 0x412F
-0x64F0 = 0x4130
-0x64F5 = 0x4131
-0x64F7 = 0x4132
-0x64FB = 0x4133
-0x64FF = 0x4134
-0x6501 = 0x4135
-0x6504 = 0x4136
-0x6508 = 0x4137
-0x6509 = 0x4138
-0x650A = 0x4139
-0x650F = 0x413A
-0x6513 = 0x413B
-0x6514 = 0x413C
-0x6516 = 0x413D
-0x6519 = 0x413E
-0x651B = 0x413F
-0x651E = 0x4140
-0x651F = 0x4141
-0x6522 = 0x4142
-0x6526 = 0x4143
-0x6529 = 0x4144
-0x652E = 0x4145
-0x6531 = 0x4146
-0x653A = 0x4147
-0x653C = 0x4148
-0x653D = 0x4149
-0x6543 = 0x414A
-0x6547 = 0x414B
-0x6549 = 0x414C
-0x6550 = 0x414D
-0x6552 = 0x414E
-0x6554 = 0x414F
-0x655F = 0x4150
-0x6560 = 0x4151
-0x6567 = 0x4152
-0x656B = 0x4153
-0x657A = 0x4154
-0x657D = 0x4155
-0x6581 = 0x4156
-0x6585 = 0x4157
-0x658A = 0x4158
-0x6592 = 0x4159
-0x6595 = 0x415A
-0x6598 = 0x415B
-0x659D = 0x415C
-0x65A0 = 0x415D
-0x65A3 = 0x415E
-0x65A6 = 0x415F
-0x65AE = 0x4160
-0x65B2 = 0x4161
-0x65B3 = 0x4162
-0x65B4 = 0x4163
-0x65BF = 0x4164
-0x65C2 = 0x4165
-0x65C8 = 0x4166
-0x65C9 = 0x4167
-0x65CE = 0x4168
-0x65D0 = 0x4169
-0x65D4 = 0x416A
-0x65D6 = 0x416B
-0x65D8 = 0x416C
-0x65DF = 0x416D
-0x65F0 = 0x416E
-0x65F2 = 0x416F
-0x65F4 = 0x4170
-0x65F5 = 0x4171
-0x65F9 = 0x4172
-0x65FE = 0x4173
-0x65FF = 0x4174
-0x6600 = 0x4175
-0x6604 = 0x4176
-0x6608 = 0x4177
-0x6609 = 0x4178
-0x660D = 0x4179
-0x6611 = 0x417A
-0x6612 = 0x417B
-0x6615 = 0x417C
-0x6616 = 0x417D
-0x661D = 0x417E
-0x661E = 0x4221
-0x6621 = 0x4222
-0x6622 = 0x4223
-0x6623 = 0x4224
-0x6624 = 0x4225
-0x6626 = 0x4226
-0x6629 = 0x4227
-0x662A = 0x4228
-0x662B = 0x4229
-0x662C = 0x422A
-0x662E = 0x422B
-0x6630 = 0x422C
-0x6631 = 0x422D
-0x6633 = 0x422E
-0x6637 = 0x4230
-0x6639 = 0x422F
-0x6640 = 0x4231
-0x6645 = 0x4232
-0x6646 = 0x4233
-0x664A = 0x4234
-0x664C = 0x4235
-0x664E = 0x4237
-0x6651 = 0x4236
-0x6657 = 0x4238
-0x6658 = 0x4239
-0x6659 = 0x423A
-0x665B = 0x423B
-0x665C = 0x423C
-0x6660 = 0x423D
-0x6661 = 0x423E
-0x666A = 0x4240
-0x666B = 0x4241
-0x666C = 0x4242
-0x6673 = 0x4244
-0x6675 = 0x4245
-0x6677 = 0x4247
-0x6678 = 0x4248
-0x6679 = 0x4249
-0x667B = 0x424A
-0x667C = 0x424C
-0x667E = 0x4243
-0x667F = 0x4246
-0x6680 = 0x424B
-0x668B = 0x424D
-0x668C = 0x424E
-0x668D = 0x424F
-0x6690 = 0x4250
-0x6692 = 0x4251
-0x6699 = 0x4252
-0x669A = 0x4253
-0x669B = 0x4254
-0x669C = 0x4255
-0x669F = 0x4256
-0x66A0 = 0x4257
-0x66A4 = 0x4258
-0x66AD = 0x4259
-0x66B1 = 0x425A
-0x66B2 = 0x425B
-0x66B5 = 0x425C
-0x66BB = 0x425D
-0x66BF = 0x425E
-0x66C0 = 0x425F
-0x66C2 = 0x4260
-0x66C3 = 0x4261
-0x66C8 = 0x4262
-0x66CC = 0x4263
-0x66CE = 0x4264
-0x66CF = 0x4265
-0x66D4 = 0x4266
-0x66DB = 0x4267
-0x66DF = 0x4268
-0x66E8 = 0x4269
-0x66EB = 0x426A
-0x66EC = 0x426B
-0x66EE = 0x426C
-0x66FA = 0x426D
-0x66FB = 0x423F
-0x6705 = 0x426E
-0x6707 = 0x426F
-0x670E = 0x4270
-0x6713 = 0x4271
-0x6719 = 0x4272
-0x671C = 0x4273
-0x6720 = 0x4274
-0x6722 = 0x4275
-0x6733 = 0x4276
-0x673E = 0x4277
-0x6745 = 0x4278
-0x6747 = 0x4279
-0x6748 = 0x427A
-0x674C = 0x427B
-0x6754 = 0x427C
-0x6755 = 0x427D
-0x675D = 0x427E
-0x6766 = 0x4321
-0x676C = 0x4322
-0x676E = 0x4323
-0x6774 = 0x4324
-0x6776 = 0x4325
-0x677B = 0x4326
-0x6781 = 0x4327
-0x6784 = 0x4328
-0x678E = 0x4329
-0x678F = 0x432A
-0x6791 = 0x432B
-0x6793 = 0x432C
-0x6796 = 0x432D
-0x6798 = 0x432E
-0x6799 = 0x432F
-0x679B = 0x4330
-0x67B0 = 0x4331
-0x67B1 = 0x4332
-0x67B2 = 0x4333
-0x67B5 = 0x4334
-0x67BB = 0x4335
-0x67BC = 0x4336
-0x67BD = 0x4337
-0x67C0 = 0x4339
-0x67C2 = 0x433A
-0x67C3 = 0x433B
-0x67C5 = 0x433C
-0x67C8 = 0x433D
-0x67C9 = 0x433E
-0x67D2 = 0x433F
-0x67D7 = 0x4340
-0x67D9 = 0x4341
-0x67DC = 0x4342
-0x67E1 = 0x4343
-0x67E6 = 0x4344
-0x67F0 = 0x4345
-0x67F2 = 0x4346
-0x67F6 = 0x4347
-0x67F7 = 0x4348
-0x67F9 = 0x4338
-0x6814 = 0x434A
-0x6819 = 0x434B
-0x681D = 0x434C
-0x681F = 0x434D
-0x6827 = 0x434F
-0x6828 = 0x434E
-0x682C = 0x4350
-0x682D = 0x4351
-0x682F = 0x4352
-0x6830 = 0x4353
-0x6831 = 0x4354
-0x6833 = 0x4355
-0x683B = 0x4356
-0x683F = 0x4357
-0x6844 = 0x4358
-0x6845 = 0x4359
-0x684A = 0x435A
-0x684C = 0x435B
-0x6852 = 0x4349
-0x6855 = 0x435C
-0x6857 = 0x435D
-0x6858 = 0x435E
-0x685B = 0x435F
-0x686B = 0x4360
-0x686E = 0x4361
-0x686F = 0x4362
-0x6870 = 0x4363
-0x6871 = 0x4364
-0x6872 = 0x4365
-0x6875 = 0x4366
-0x6879 = 0x4367
-0x687A = 0x4368
-0x687B = 0x4369
-0x687C = 0x436A
-0x6882 = 0x436B
-0x6884 = 0x436C
-0x6886 = 0x436D
-0x6888 = 0x436E
-0x6896 = 0x436F
-0x6898 = 0x4370
-0x689A = 0x4371
-0x689C = 0x4372
-0x68A1 = 0x4373
-0x68A3 = 0x4374
-0x68A5 = 0x4375
-0x68A9 = 0x4376
-0x68AA = 0x4377
-0x68AE = 0x4378
-0x68B2 = 0x4379
-0x68BB = 0x437A
-0x68C5 = 0x437B
-0x68C8 = 0x437C
-0x68CC = 0x437D
-0x68CF = 0x437E
-0x68D0 = 0x4421
-0x68D1 = 0x4422
-0x68D3 = 0x4423
-0x68D6 = 0x4424
-0x68D9 = 0x4425
-0x68DC = 0x4426
-0x68DD = 0x4427
-0x68E5 = 0x4428
-0x68E8 = 0x4429
-0x68EA = 0x442A
-0x68EB = 0x442B
-0x68EC = 0x442C
-0x68ED = 0x442D
-0x68F0 = 0x442E
-0x68F1 = 0x442F
-0x68F5 = 0x4430
-0x68F6 = 0x4431
-0x68FB = 0x4432
-0x68FC = 0x4433
-0x68FD = 0x4434
-0x6906 = 0x4435
-0x6909 = 0x4436
-0x690A = 0x4437
-0x6910 = 0x4438
-0x6911 = 0x4439
-0x6913 = 0x443A
-0x6916 = 0x443B
-0x6917 = 0x443C
-0x6931 = 0x443D
-0x6933 = 0x443E
-0x6935 = 0x443F
-0x6938 = 0x4440
-0x693B = 0x4441
-0x6942 = 0x4442
-0x6945 = 0x4443
-0x6949 = 0x4444
-0x694E = 0x4445
-0x6957 = 0x4446
-0x695B = 0x4447
-0x6963 = 0x4448
-0x6964 = 0x4449
-0x6965 = 0x444A
-0x6966 = 0x444B
-0x6968 = 0x444C
-0x6969 = 0x444D
-0x696C = 0x444E
-0x6970 = 0x444F
-0x6971 = 0x4450
-0x6972 = 0x4451
-0x697A = 0x4452
-0x697B = 0x4453
-0x697F = 0x4454
-0x6980 = 0x4455
-0x698D = 0x4456
-0x6992 = 0x4457
-0x6996 = 0x4458
-0x6998 = 0x4459
-0x69A1 = 0x445A
-0x69A5 = 0x445B
-0x69A6 = 0x445C
-0x69A8 = 0x445D
-0x69AB = 0x445E
-0x69AD = 0x445F
-0x69AF = 0x4460
-0x69B7 = 0x4461
-0x69B8 = 0x4462
-0x69BA = 0x4463
-0x69BC = 0x4464
-0x69C5 = 0x4465
-0x69C8 = 0x4466
-0x69D1 = 0x4467
-0x69D6 = 0x4468
-0x69D7 = 0x4469
-0x69E2 = 0x446A
-0x69E5 = 0x446B
-0x69EE = 0x446C
-0x69EF = 0x446D
-0x69F1 = 0x446E
-0x69F3 = 0x446F
-0x69F5 = 0x4470
-0x69FE = 0x4471
-0x6A00 = 0x4472
-0x6A01 = 0x4473
-0x6A03 = 0x4474
-0x6A0F = 0x4475
-0x6A11 = 0x4476
-0x6A15 = 0x4477
-0x6A1A = 0x4478
-0x6A1D = 0x4479
-0x6A20 = 0x447A
-0x6A24 = 0x447B
-0x6A28 = 0x447C
-0x6A30 = 0x447D
-0x6A32 = 0x447E
-0x6A34 = 0x4521
-0x6A37 = 0x4522
-0x6A3B = 0x4523
-0x6A3E = 0x4524
-0x6A3F = 0x4525
-0x6A45 = 0x4526
-0x6A46 = 0x4527
-0x6A49 = 0x4528
-0x6A4A = 0x4529
-0x6A4E = 0x452A
-0x6A50 = 0x452B
-0x6A51 = 0x452C
-0x6A52 = 0x452D
-0x6A55 = 0x452E
-0x6A56 = 0x452F
-0x6A5B = 0x4530
-0x6A64 = 0x4531
-0x6A67 = 0x4532
-0x6A6A = 0x4533
-0x6A71 = 0x4534
-0x6A73 = 0x4535
-0x6A7E = 0x4536
-0x6A81 = 0x4537
-0x6A83 = 0x4538
-0x6A86 = 0x4539
-0x6A87 = 0x453A
-0x6A89 = 0x453B
-0x6A8B = 0x453C
-0x6A91 = 0x453D
-0x6A9B = 0x453E
-0x6A9D = 0x453F
-0x6A9E = 0x4540
-0x6A9F = 0x4541
-0x6AA5 = 0x4542
-0x6AAB = 0x4543
-0x6AAF = 0x4544
-0x6AB0 = 0x4545
-0x6AB1 = 0x4546
-0x6AB4 = 0x4547
-0x6ABD = 0x4548
-0x6ABE = 0x4549
-0x6ABF = 0x454A
-0x6AC6 = 0x454B
-0x6AC8 = 0x454D
-0x6AC9 = 0x454C
-0x6ACC = 0x454E
-0x6AD0 = 0x454F
-0x6AD4 = 0x4550
-0x6AD5 = 0x4551
-0x6AD6 = 0x4552
-0x6ADC = 0x4553
-0x6ADD = 0x4554
-0x6AE4 = 0x4555
-0x6AE7 = 0x4556
-0x6AEC = 0x4557
-0x6AF0 = 0x4558
-0x6AF1 = 0x4559
-0x6AF2 = 0x455A
-0x6AFC = 0x455B
-0x6AFD = 0x455C
-0x6B02 = 0x455D
-0x6B03 = 0x455E
-0x6B06 = 0x455F
-0x6B07 = 0x4560
-0x6B09 = 0x4561
-0x6B0F = 0x4562
-0x6B10 = 0x4563
-0x6B11 = 0x4564
-0x6B17 = 0x4565
-0x6B1B = 0x4566
-0x6B1E = 0x4567
-0x6B24 = 0x4568
-0x6B28 = 0x4569
-0x6B2B = 0x456A
-0x6B2C = 0x456B
-0x6B2F = 0x456C
-0x6B35 = 0x456D
-0x6B36 = 0x456E
-0x6B3B = 0x456F
-0x6B3F = 0x4570
-0x6B46 = 0x4571
-0x6B4A = 0x4572
-0x6B4D = 0x4573
-0x6B52 = 0x4574
-0x6B56 = 0x4575
-0x6B58 = 0x4576
-0x6B5D = 0x4577
-0x6B60 = 0x4578
-0x6B67 = 0x4579
-0x6B6B = 0x457A
-0x6B6E = 0x457B
-0x6B70 = 0x457C
-0x6B75 = 0x457D
-0x6B7D = 0x457E
-0x6B7E = 0x4621
-0x6B82 = 0x4622
-0x6B85 = 0x4623
-0x6B97 = 0x4624
-0x6B9B = 0x4625
-0x6B9F = 0x4626
-0x6BA0 = 0x4627
-0x6BA2 = 0x4628
-0x6BA3 = 0x4629
-0x6BA8 = 0x462A
-0x6BA9 = 0x462B
-0x6BAC = 0x462C
-0x6BAD = 0x462D
-0x6BAE = 0x462E
-0x6BB0 = 0x462F
-0x6BB8 = 0x4630
-0x6BB9 = 0x4631
-0x6BBD = 0x4632
-0x6BBE = 0x4633
-0x6BC3 = 0x4634
-0x6BC4 = 0x4635
-0x6BC9 = 0x4636
-0x6BCC = 0x4637
-0x6BD6 = 0x4638
-0x6BDA = 0x4639
-0x6BE1 = 0x463A
-0x6BE3 = 0x463B
-0x6BE6 = 0x463C
-0x6BE7 = 0x463D
-0x6BEE = 0x463E
-0x6BF1 = 0x463F
-0x6BF7 = 0x4640
-0x6BF9 = 0x4641
-0x6BFF = 0x4642
-0x6C02 = 0x4643
-0x6C04 = 0x4644
-0x6C05 = 0x4645
-0x6C09 = 0x4646
-0x6C0D = 0x4647
-0x6C0E = 0x4648
-0x6C10 = 0x4649
-0x6C12 = 0x464A
-0x6C19 = 0x464B
-0x6C1F = 0x464C
-0x6C26 = 0x464D
-0x6C27 = 0x464E
-0x6C28 = 0x464F
-0x6C2C = 0x4650
-0x6C2E = 0x4651
-0x6C33 = 0x4652
-0x6C35 = 0x4653
-0x6C36 = 0x4654
-0x6C3A = 0x4655
-0x6C3B = 0x4656
-0x6C3F = 0x4657
-0x6C4A = 0x4658
-0x6C4B = 0x4659
-0x6C4D = 0x465A
-0x6C4F = 0x465B
-0x6C52 = 0x465C
-0x6C54 = 0x465D
-0x6C59 = 0x465E
-0x6C5B = 0x465F
-0x6C5C = 0x4660
-0x6C67 = 0x4736
-0x6C6B = 0x4661
-0x6C6D = 0x4662
-0x6C6F = 0x4663
-0x6C74 = 0x4664
-0x6C76 = 0x4665
-0x6C78 = 0x4666
-0x6C79 = 0x4667
-0x6C7B = 0x4668
-0x6C85 = 0x4669
-0x6C86 = 0x466A
-0x6C87 = 0x466B
-0x6C89 = 0x466C
-0x6C94 = 0x466D
-0x6C95 = 0x466E
-0x6C97 = 0x466F
-0x6C98 = 0x4670
-0x6C9C = 0x4671
-0x6C9F = 0x4672
-0x6CB0 = 0x4673
-0x6CB2 = 0x4674
-0x6CB4 = 0x4675
-0x6CC2 = 0x4676
-0x6CC6 = 0x4677
-0x6CCD = 0x4678
-0x6CCF = 0x4679
-0x6CD0 = 0x467A
-0x6CD1 = 0x467B
-0x6CD2 = 0x467C
-0x6CD4 = 0x467D
-0x6CD6 = 0x467E
-0x6CDA = 0x4721
-0x6CDC = 0x4722
-0x6CE0 = 0x4723
-0x6CE7 = 0x4724
-0x6CE9 = 0x4725
-0x6CEB = 0x4726
-0x6CEC = 0x4727
-0x6CEE = 0x4728
-0x6CF2 = 0x4729
-0x6CF4 = 0x472A
-0x6D04 = 0x472B
-0x6D07 = 0x472C
-0x6D0A = 0x472D
-0x6D0E = 0x472E
-0x6D0F = 0x472F
-0x6D11 = 0x4730
-0x6D13 = 0x4731
-0x6D1A = 0x4732
-0x6D26 = 0x4733
-0x6D27 = 0x4734
-0x6D28 = 0x4735
-0x6D2E = 0x4737
-0x6D2F = 0x4738
-0x6D31 = 0x4739
-0x6D39 = 0x473A
-0x6D3C = 0x473B
-0x6D3F = 0x473C
-0x6D57 = 0x473D
-0x6D5E = 0x473E
-0x6D5F = 0x473F
-0x6D61 = 0x4740
-0x6D65 = 0x4741
-0x6D67 = 0x4742
-0x6D6F = 0x4743
-0x6D70 = 0x4744
-0x6D7C = 0x4745
-0x6D82 = 0x4746
-0x6D87 = 0x4747
-0x6D91 = 0x4748
-0x6D92 = 0x4749
-0x6D94 = 0x474A
-0x6D96 = 0x474B
-0x6D97 = 0x474C
-0x6D98 = 0x474D
-0x6DAA = 0x474E
-0x6DAC = 0x474F
-0x6DB4 = 0x4750
-0x6DB7 = 0x4751
-0x6DB9 = 0x4752
-0x6DBD = 0x4753
-0x6DBF = 0x4754
-0x6DC4 = 0x4755
-0x6DC8 = 0x4756
-0x6DCA = 0x4757
-0x6DCE = 0x4758
-0x6DCF = 0x4759
-0x6DD6 = 0x475A
-0x6DDB = 0x475B
-0x6DDD = 0x475C
-0x6DDF = 0x475D
-0x6DE0 = 0x475E
-0x6DE2 = 0x475F
-0x6DE5 = 0x4760
-0x6DE9 = 0x4761
-0x6DEF = 0x4762
-0x6DF0 = 0x4763
-0x6DF4 = 0x4764
-0x6DF6 = 0x4765
-0x6DFC = 0x4766
-0x6E00 = 0x4767
-0x6E04 = 0x4768
-0x6E1E = 0x4769
-0x6E22 = 0x476A
-0x6E27 = 0x476B
-0x6E32 = 0x476C
-0x6E36 = 0x476D
-0x6E39 = 0x476E
-0x6E3B = 0x476F
-0x6E3C = 0x4770
-0x6E44 = 0x4771
-0x6E45 = 0x4772
-0x6E48 = 0x4773
-0x6E49 = 0x4774
-0x6E4B = 0x4775
-0x6E4F = 0x4776
-0x6E51 = 0x4777
-0x6E52 = 0x4778
-0x6E53 = 0x4779
-0x6E54 = 0x477A
-0x6E57 = 0x477B
-0x6E5C = 0x477C
-0x6E5D = 0x477D
-0x6E5E = 0x477E
-0x6E62 = 0x4821
-0x6E63 = 0x4822
-0x6E68 = 0x4823
-0x6E73 = 0x4824
-0x6E7B = 0x4825
-0x6E7D = 0x4826
-0x6E8D = 0x4827
-0x6E93 = 0x4828
-0x6E99 = 0x4829
-0x6EA0 = 0x482A
-0x6EA7 = 0x482B
-0x6EAD = 0x482C
-0x6EAE = 0x482D
-0x6EB1 = 0x482E
-0x6EB3 = 0x482F
-0x6EBB = 0x4830
-0x6EBF = 0x4831
-0x6EC0 = 0x4832
-0x6EC1 = 0x4833
-0x6EC3 = 0x4834
-0x6EC7 = 0x4835
-0x6EC8 = 0x4836
-0x6ECA = 0x4837
-0x6ECD = 0x4838
-0x6ECE = 0x4839
-0x6ECF = 0x483A
-0x6EEB = 0x483B
-0x6EED = 0x483C
-0x6EEE = 0x483D
-0x6EF9 = 0x483E
-0x6EFB = 0x483F
-0x6EFD = 0x4840
-0x6F04 = 0x4841
-0x6F08 = 0x4842
-0x6F0A = 0x4843
-0x6F0C = 0x4844
-0x6F0D = 0x4845
-0x6F16 = 0x4846
-0x6F18 = 0x4847
-0x6F1A = 0x4848
-0x6F1B = 0x4849
-0x6F26 = 0x484A
-0x6F29 = 0x484B
-0x6F2A = 0x484C
-0x6F2D = 0x4853
-0x6F2F = 0x484D
-0x6F30 = 0x484E
-0x6F33 = 0x484F
-0x6F36 = 0x4850
-0x6F3B = 0x4851
-0x6F3C = 0x4852
-0x6F4F = 0x4854
-0x6F51 = 0x4855
-0x6F52 = 0x4856
-0x6F53 = 0x4857
-0x6F57 = 0x4858
-0x6F59 = 0x4859
-0x6F5A = 0x485A
-0x6F5D = 0x485B
-0x6F5E = 0x485C
-0x6F61 = 0x485D
-0x6F62 = 0x485E
-0x6F68 = 0x485F
-0x6F6C = 0x4860
-0x6F7D = 0x4861
-0x6F7E = 0x4862
-0x6F83 = 0x4863
-0x6F87 = 0x4864
-0x6F88 = 0x4865
-0x6F8B = 0x4866
-0x6F8C = 0x4867
-0x6F8D = 0x4868
-0x6F90 = 0x4869
-0x6F92 = 0x486A
-0x6F93 = 0x486B
-0x6F94 = 0x486C
-0x6F96 = 0x486D
-0x6F9A = 0x486E
-0x6F9F = 0x486F
-0x6FA0 = 0x4870
-0x6FA5 = 0x4871
-0x6FA6 = 0x4872
-0x6FA7 = 0x4873
-0x6FA8 = 0x4874
-0x6FAE = 0x4875
-0x6FAF = 0x4876
-0x6FB0 = 0x4877
-0x6FB5 = 0x4878
-0x6FB6 = 0x4879
-0x6FBC = 0x487A
-0x6FC5 = 0x487B
-0x6FC7 = 0x487C
-0x6FC8 = 0x487D
-0x6FCA = 0x487E
-0x6FDA = 0x4921
-0x6FDE = 0x4922
-0x6FE8 = 0x4923
-0x6FE9 = 0x4924
-0x6FF0 = 0x4925
-0x6FF5 = 0x4926
-0x6FF9 = 0x4927
-0x6FFC = 0x4928
-0x6FFD = 0x4929
-0x7000 = 0x492A
-0x7005 = 0x492B
-0x7006 = 0x492C
-0x7007 = 0x492D
-0x700D = 0x492E
-0x7017 = 0x492F
-0x7020 = 0x4930
-0x7023 = 0x4931
-0x702F = 0x4932
-0x7034 = 0x4933
-0x7037 = 0x4934
-0x7039 = 0x4935
-0x703C = 0x4936
-0x7043 = 0x4937
-0x7044 = 0x4938
-0x7048 = 0x4939
-0x7049 = 0x493A
-0x704A = 0x493B
-0x704B = 0x493C
-0x704E = 0x4941
-0x7054 = 0x493D
-0x7055 = 0x493E
-0x705D = 0x493F
-0x705E = 0x4940
-0x7064 = 0x4942
-0x7065 = 0x4943
-0x706C = 0x4944
-0x706E = 0x4945
-0x7075 = 0x4946
-0x7076 = 0x4947
-0x707E = 0x4948
-0x7081 = 0x4949
-0x7085 = 0x494A
-0x7086 = 0x494B
-0x7094 = 0x494C
-0x7095 = 0x494D
-0x7096 = 0x494E
-0x7097 = 0x494F
-0x7098 = 0x4950
-0x709B = 0x4951
-0x70A4 = 0x4952
-0x70AB = 0x4953
-0x70B0 = 0x4954
-0x70B1 = 0x4955
-0x70B4 = 0x4956
-0x70B7 = 0x4957
-0x70CA = 0x4958
-0x70D1 = 0x4959
-0x70D3 = 0x495A
-0x70D4 = 0x495B
-0x70D5 = 0x495C
-0x70D6 = 0x495D
-0x70D8 = 0x495E
-0x70DC = 0x495F
-0x70E4 = 0x4960
-0x70FA = 0x4961
-0x7103 = 0x4962
-0x7104 = 0x4963
-0x7105 = 0x4964
-0x7106 = 0x4965
-0x7107 = 0x4966
-0x710B = 0x4967
-0x710C = 0x4968
-0x710F = 0x4969
-0x711E = 0x496A
-0x7120 = 0x496B
-0x712B = 0x496C
-0x712D = 0x496D
-0x712F = 0x496E
-0x7130 = 0x496F
-0x7131 = 0x4970
-0x7138 = 0x4971
-0x7141 = 0x4972
-0x7145 = 0x4973
-0x7146 = 0x4974
-0x7147 = 0x4975
-0x714A = 0x4976
-0x714B = 0x4977
-0x7150 = 0x4978
-0x7152 = 0x4979
-0x7157 = 0x497A
-0x715A = 0x497B
-0x715C = 0x497C
-0x715E = 0x497D
-0x7160 = 0x497E
-0x7168 = 0x4A21
-0x7179 = 0x4A22
-0x7180 = 0x4A23
-0x7185 = 0x4A24
-0x7187 = 0x4A25
-0x718C = 0x4A26
-0x7192 = 0x4A27
-0x719A = 0x4A28
-0x719B = 0x4A29
-0x71A0 = 0x4A2A
-0x71A2 = 0x4A2B
-0x71AF = 0x4A2C
-0x71B0 = 0x4A2D
-0x71B2 = 0x4A2E
-0x71B3 = 0x4A2F
-0x71BA = 0x4A30
-0x71BF = 0x4A31
-0x71C0 = 0x4A32
-0x71C1 = 0x4A33
-0x71C4 = 0x4A34
-0x71CB = 0x4A35
-0x71CC = 0x4A36
-0x71D3 = 0x4A37
-0x71D6 = 0x4A38
-0x71D9 = 0x4A39
-0x71DA = 0x4A3A
-0x71DC = 0x4A3B
-0x71F8 = 0x4A3C
-0x71FE = 0x4A3D
-0x7200 = 0x4A3E
-0x7207 = 0x4A3F
-0x7208 = 0x4A40
-0x7209 = 0x4A41
-0x7213 = 0x4A42
-0x7217 = 0x4A43
-0x721A = 0x4A44
-0x721D = 0x4A45
-0x721F = 0x4A46
-0x7224 = 0x4A47
-0x722B = 0x4A48
-0x722F = 0x4A49
-0x7234 = 0x4A4A
-0x7238 = 0x4A4B
-0x7239 = 0x4A4C
-0x7241 = 0x4A4D
-0x7242 = 0x4A4E
-0x7243 = 0x4A4F
-0x7245 = 0x4A50
-0x724E = 0x4A51
-0x724F = 0x4A52
-0x7250 = 0x4A53
-0x7253 = 0x4A54
-0x7255 = 0x4A55
-0x7256 = 0x4A56
-0x725A = 0x4A57
-0x725C = 0x4A58
-0x725E = 0x4A59
-0x7260 = 0x4A5A
-0x7263 = 0x4A5B
-0x7268 = 0x4A5C
-0x726B = 0x4A5D
-0x726E = 0x4A5E
-0x726F = 0x4A5F
-0x7271 = 0x4A60
-0x7277 = 0x4A61
-0x7278 = 0x4A62
-0x727B = 0x4A63
-0x727C = 0x4A64
-0x727F = 0x4A65
-0x7284 = 0x4A66
-0x7289 = 0x4A67
-0x728D = 0x4A68
-0x728E = 0x4A69
-0x7293 = 0x4A6A
-0x729B = 0x4A6B
-0x72A8 = 0x4A6C
-0x72AD = 0x4A6D
-0x72AE = 0x4A6E
-0x72B1 = 0x4A6F
-0x72B4 = 0x4A70
-0x72BE = 0x4A71
-0x72C1 = 0x4A72
-0x72C7 = 0x4A73
-0x72C9 = 0x4A74
-0x72CC = 0x4A75
-0x72D5 = 0x4A76
-0x72D6 = 0x4A77
-0x72D8 = 0x4A78
-0x72DF = 0x4A79
-0x72E5 = 0x4A7A
-0x72F3 = 0x4A7B
-0x72F4 = 0x4A7C
-0x72FA = 0x4A7D
-0x72FB = 0x4A7E
-0x72FE = 0x4B21
-0x7302 = 0x4B22
-0x7304 = 0x4B23
-0x7305 = 0x4B24
-0x7307 = 0x4B25
-0x730B = 0x4B26
-0x730D = 0x4B27
-0x7312 = 0x4B28
-0x7313 = 0x4B29
-0x7318 = 0x4B2A
-0x7319 = 0x4B2B
-0x731E = 0x4B2C
-0x7322 = 0x4B2D
-0x7324 = 0x4B2E
-0x7327 = 0x4B2F
-0x7328 = 0x4B30
-0x732C = 0x4B31
-0x7331 = 0x4B32
-0x7332 = 0x4B33
-0x7335 = 0x4B34
-0x733A = 0x4B35
-0x733B = 0x4B36
-0x733D = 0x4B37
-0x7343 = 0x4B38
-0x734D = 0x4B39
-0x7350 = 0x4B3A
-0x7352 = 0x4B3B
-0x7356 = 0x4B3C
-0x7358 = 0x4B3D
-0x735D = 0x4B3E
-0x735E = 0x4B3F
-0x735F = 0x4B40
-0x7360 = 0x4B41
-0x7366 = 0x4B42
-0x7367 = 0x4B43
-0x7369 = 0x4B44
-0x736B = 0x4B45
-0x736C = 0x4B46
-0x736E = 0x4B47
-0x736F = 0x4B48
-0x7371 = 0x4B49
-0x7377 = 0x4B4A
-0x7379 = 0x4B4B
-0x737C = 0x4B4C
-0x7380 = 0x4B4D
-0x7381 = 0x4B4E
-0x7383 = 0x4B4F
-0x7385 = 0x4B50
-0x7386 = 0x4B51
-0x738E = 0x4B52
-0x7390 = 0x4B53
-0x7393 = 0x4B54
-0x7395 = 0x4B55
-0x7397 = 0x4B56
-0x7398 = 0x4B57
-0x739C = 0x4B58
-0x739E = 0x4B59
-0x739F = 0x4B5A
-0x73A0 = 0x4B5B
-0x73A2 = 0x4B5C
-0x73A5 = 0x4B5D
-0x73A6 = 0x4B5E
-0x73AA = 0x4B5F
-0x73AB = 0x4B60
-0x73AD = 0x4B61
-0x73B5 = 0x4B62
-0x73B7 = 0x4B63
-0x73B9 = 0x4B64
-0x73BC = 0x4B65
-0x73BD = 0x4B66
-0x73BF = 0x4B67
-0x73C5 = 0x4B68
-0x73C6 = 0x4B69
-0x73C9 = 0x4B6A
-0x73CB = 0x4B6B
-0x73CC = 0x4B6C
-0x73CF = 0x4B6D
-0x73D2 = 0x4B6E
-0x73D3 = 0x4B6F
-0x73D6 = 0x4B70
-0x73D9 = 0x4B71
-0x73DD = 0x4B72
-0x73E1 = 0x4B73
-0x73E3 = 0x4B74
-0x73E6 = 0x4B75
-0x73E7 = 0x4B76
-0x73E9 = 0x4B77
-0x73F4 = 0x4B78
-0x73F5 = 0x4B79
-0x73F7 = 0x4B7A
-0x73F9 = 0x4B7B
-0x73FA = 0x4B7C
-0x73FB = 0x4B7D
-0x73FD = 0x4B7E
-0x73FF = 0x4C21
-0x7400 = 0x4C22
-0x7401 = 0x4C23
-0x7404 = 0x4C24
-0x7407 = 0x4C25
-0x740A = 0x4C26
-0x7411 = 0x4C27
-0x741A = 0x4C28
-0x741B = 0x4C29
-0x7424 = 0x4C2A
-0x7426 = 0x4C2B
-0x7428 = 0x4C2C
-0x7429 = 0x4C2D
-0x742A = 0x4C2E
-0x742B = 0x4C2F
-0x742C = 0x4C30
-0x742D = 0x4C31
-0x742E = 0x4C32
-0x742F = 0x4C33
-0x7430 = 0x4C34
-0x7431 = 0x4C35
-0x7439 = 0x4C36
-0x7440 = 0x4C37
-0x7443 = 0x4C38
-0x7444 = 0x4C39
-0x7446 = 0x4C3A
-0x7447 = 0x4C3B
-0x744B = 0x4C3C
-0x744D = 0x4C3D
-0x7451 = 0x4C3E
-0x7452 = 0x4C3F
-0x7457 = 0x4C40
-0x745D = 0x4C41
-0x7462 = 0x4C42
-0x7466 = 0x4C43
-0x7467 = 0x4C44
-0x7468 = 0x4C45
-0x746B = 0x4C46
-0x746D = 0x4C47
-0x746E = 0x4C48
-0x7471 = 0x4C49
-0x7472 = 0x4C4A
-0x7480 = 0x4C4B
-0x7481 = 0x4C4C
-0x7485 = 0x4C4D
-0x7486 = 0x4C4E
-0x7487 = 0x4C4F
-0x7489 = 0x4C50
-0x748F = 0x4C51
-0x7490 = 0x4C52
-0x7491 = 0x4C53
-0x7492 = 0x4C54
-0x7498 = 0x4C55
-0x7499 = 0x4C56
-0x749A = 0x4C57
-0x749C = 0x4C58
-0x749F = 0x4C59
-0x74A0 = 0x4C5A
-0x74A1 = 0x4C5B
-0x74A3 = 0x4C5C
-0x74A6 = 0x4C5D
-0x74A8 = 0x4C5E
-0x74A9 = 0x4C5F
-0x74AA = 0x4C60
-0x74AB = 0x4C61
-0x74AE = 0x4C62
-0x74AF = 0x4C63
-0x74B1 = 0x4C64
-0x74B2 = 0x4C65
-0x74B5 = 0x4C66
-0x74B9 = 0x4C67
-0x74BB = 0x4C68
-0x74BF = 0x4C69
-0x74C8 = 0x4C6A
-0x74C9 = 0x4C6B
-0x74CC = 0x4C6C
-0x74D0 = 0x4C6D
-0x74D3 = 0x4C6E
-0x74D8 = 0x4C6F
-0x74DA = 0x4C70
-0x74DB = 0x4C71
-0x74DE = 0x4C72
-0x74DF = 0x4C73
-0x74E4 = 0x4C74
-0x74E8 = 0x4C75
-0x74EA = 0x4C76
-0x74EB = 0x4C77
-0x74EF = 0x4C78
-0x74F4 = 0x4C79
-0x74FA = 0x4C7A
-0x74FB = 0x4C7B
-0x74FC = 0x4C7C
-0x74FF = 0x4C7D
-0x7506 = 0x4C7E
-0x7512 = 0x4D21
-0x7516 = 0x4D22
-0x7517 = 0x4D23
-0x7520 = 0x4D24
-0x7521 = 0x4D25
-0x7524 = 0x4D26
-0x7527 = 0x4D27
-0x7529 = 0x4D28
-0x752A = 0x4D29
-0x752F = 0x4D2A
-0x7536 = 0x4D2B
-0x7539 = 0x4D2C
-0x753D = 0x4D2D
-0x753E = 0x4D2E
-0x753F = 0x4D2F
-0x7540 = 0x4D30
-0x7543 = 0x4D31
-0x7547 = 0x4D32
-0x7548 = 0x4D33
-0x754E = 0x4D34
-0x7550 = 0x4D35
-0x7552 = 0x4D36
-0x7557 = 0x4D37
-0x755E = 0x4D38
-0x755F = 0x4D39
-0x7561 = 0x4D3A
-0x756F = 0x4D3B
-0x7571 = 0x4D3C
-0x7579 = 0x4D3D
-0x757A = 0x4D3E
-0x757B = 0x4D3F
-0x757C = 0x4D40
-0x757D = 0x4D41
-0x757E = 0x4D42
-0x7581 = 0x4D43
-0x7585 = 0x4D44
-0x7590 = 0x4D45
-0x7592 = 0x4D46
-0x7593 = 0x4D47
-0x7595 = 0x4D48
-0x7599 = 0x4D49
-0x759C = 0x4D4A
-0x75A2 = 0x4D4B
-0x75A4 = 0x4D4C
-0x75B4 = 0x4D4D
-0x75BA = 0x4D4E
-0x75BF = 0x4D4F
-0x75C0 = 0x4D50
-0x75C1 = 0x4D51
-0x75C4 = 0x4D52
-0x75C6 = 0x4D53
-0x75CC = 0x4D54
-0x75CE = 0x4D55
-0x75CF = 0x4D56
-0x75D7 = 0x4D57
-0x75DC = 0x4D58
-0x75DF = 0x4D59
-0x75E0 = 0x4D5A
-0x75E1 = 0x4D5B
-0x75E4 = 0x4D5C
-0x75E7 = 0x4D5D
-0x75EC = 0x4D5E
-0x75EE = 0x4D5F
-0x75EF = 0x4D60
-0x75F1 = 0x4D61
-0x75F9 = 0x4D62
-0x7600 = 0x4D63
-0x7602 = 0x4D64
-0x7603 = 0x4D65
-0x7604 = 0x4D66
-0x7607 = 0x4D67
-0x7608 = 0x4D68
-0x760A = 0x4D69
-0x760C = 0x4D6A
-0x760F = 0x4D6B
-0x7612 = 0x4D6C
-0x7613 = 0x4D6D
-0x7615 = 0x4D6E
-0x7616 = 0x4D6F
-0x7619 = 0x4D70
-0x761B = 0x4D71
-0x761C = 0x4D72
-0x761D = 0x4D73
-0x761E = 0x4D74
-0x7623 = 0x4D75
-0x7625 = 0x4D76
-0x7626 = 0x4D77
-0x7629 = 0x4D78
-0x762D = 0x4D79
-0x7632 = 0x4D7A
-0x7633 = 0x4D7B
-0x7635 = 0x4D7C
-0x7638 = 0x4D7D
-0x7639 = 0x4D7E
-0x763A = 0x4E21
-0x763C = 0x4E22
-0x7640 = 0x4E24
-0x7641 = 0x4E25
-0x7643 = 0x4E26
-0x7644 = 0x4E27
-0x7645 = 0x4E28
-0x7649 = 0x4E29
-0x764A = 0x4E23
-0x764B = 0x4E2A
-0x7655 = 0x4E2B
-0x7659 = 0x4E2C
-0x765F = 0x4E2D
-0x7664 = 0x4E2E
-0x7665 = 0x4E2F
-0x766D = 0x4E30
-0x766E = 0x4E31
-0x766F = 0x4E32
-0x7671 = 0x4E33
-0x7674 = 0x4E34
-0x7681 = 0x4E35
-0x7685 = 0x4E36
-0x768C = 0x4E37
-0x768D = 0x4E38
-0x7695 = 0x4E39
-0x769B = 0x4E3A
-0x769C = 0x4E3B
-0x769D = 0x4E3C
-0x769F = 0x4E3D
-0x76A0 = 0x4E3E
-0x76A2 = 0x4E3F
-0x76A3 = 0x4E40
-0x76A4 = 0x4E41
-0x76A5 = 0x4E42
-0x76A6 = 0x4E43
-0x76A7 = 0x4E44
-0x76A8 = 0x4E45
-0x76AA = 0x4E46
-0x76AD = 0x4E47
-0x76BD = 0x4E48
-0x76C1 = 0x4E49
-0x76C5 = 0x4E4A
-0x76C9 = 0x4E4B
-0x76CB = 0x4E4C
-0x76CC = 0x4E4D
-0x76CE = 0x4E4E
-0x76D4 = 0x4E4F
-0x76D9 = 0x4E50
-0x76E0 = 0x4E51
-0x76E6 = 0x4E52
-0x76E8 = 0x4E53
-0x76EC = 0x4E54
-0x76F0 = 0x4E55
-0x76F1 = 0x4E56
-0x76F6 = 0x4E57
-0x76F9 = 0x4E58
-0x76FC = 0x4E59
-0x7700 = 0x4E5A
-0x7706 = 0x4E5B
-0x770A = 0x4E5C
-0x770E = 0x4E5D
-0x7712 = 0x4E5E
-0x7714 = 0x4E5F
-0x7715 = 0x4E60
-0x7717 = 0x4E61
-0x7719 = 0x4E62
-0x771A = 0x4E63
-0x771C = 0x4E64
-0x7722 = 0x4E65
-0x7728 = 0x4E66
-0x772D = 0x4E67
-0x772E = 0x4E68
-0x772F = 0x4E69
-0x7734 = 0x4E6A
-0x7735 = 0x4E6B
-0x7736 = 0x4E6C
-0x7739 = 0x4E6D
-0x773D = 0x4E6E
-0x773E = 0x4E6F
-0x7742 = 0x4E70
-0x7745 = 0x4E71
-0x7746 = 0x4E72
-0x774A = 0x4E73
-0x774D = 0x4E74
-0x774E = 0x4E75
-0x774F = 0x4E76
-0x7752 = 0x4E77
-0x7756 = 0x4E78
-0x7757 = 0x4E79
-0x775C = 0x4E7A
-0x775E = 0x4E7B
-0x775F = 0x4E7C
-0x7760 = 0x4E7D
-0x7762 = 0x4E7E
-0x7764 = 0x4F21
-0x7767 = 0x4F22
-0x776A = 0x4F23
-0x776C = 0x4F24
-0x7770 = 0x4F25
-0x7772 = 0x4F26
-0x7773 = 0x4F27
-0x7774 = 0x4F28
-0x777A = 0x4F29
-0x777D = 0x4F2A
-0x7780 = 0x4F2B
-0x7784 = 0x4F2C
-0x778C = 0x4F2D
-0x778D = 0x4F2E
-0x7794 = 0x4F2F
-0x7795 = 0x4F30
-0x7796 = 0x4F31
-0x779A = 0x4F32
-0x779F = 0x4F33
-0x77A2 = 0x4F34
-0x77A7 = 0x4F35
-0x77AA = 0x4F36
-0x77AE = 0x4F37
-0x77AF = 0x4F38
-0x77B1 = 0x4F39
-0x77B5 = 0x4F3A
-0x77BE = 0x4F3B
-0x77C3 = 0x4F3C
-0x77C9 = 0x4F3D
-0x77D1 = 0x4F3E
-0x77D2 = 0x4F3F
-0x77D5 = 0x4F40
-0x77D9 = 0x4F41
-0x77DE = 0x4F42
-0x77DF = 0x4F43
-0x77E0 = 0x4F44
-0x77E4 = 0x4F45
-0x77E6 = 0x4F46
-0x77EA = 0x4F47
-0x77EC = 0x4F48
-0x77F0 = 0x4F49
-0x77F1 = 0x4F4A
-0x77F4 = 0x4F4B
-0x77F8 = 0x4F4C
-0x77FB = 0x4F4D
-0x7805 = 0x4F4E
-0x7806 = 0x4F4F
-0x7809 = 0x4F50
-0x780D = 0x4F51
-0x780E = 0x4F52
-0x7811 = 0x4F53
-0x781D = 0x4F54
-0x7821 = 0x4F55
-0x7822 = 0x4F56
-0x7823 = 0x4F57
-0x782D = 0x4F58
-0x782E = 0x4F59
-0x7830 = 0x4F5A
-0x7835 = 0x4F5B
-0x7837 = 0x4F5C
-0x7843 = 0x4F5D
-0x7844 = 0x4F5E
-0x7847 = 0x4F5F
-0x7848 = 0x4F60
-0x784C = 0x4F61
-0x784E = 0x4F62
-0x7852 = 0x4F63
-0x785C = 0x4F64
-0x785E = 0x4F65
-0x7860 = 0x4F66
-0x7861 = 0x4F67
-0x7863 = 0x4F68
-0x7864 = 0x4F69
-0x7868 = 0x4F6A
-0x786A = 0x4F6B
-0x786E = 0x4F6C
-0x787A = 0x4F6D
-0x787E = 0x4F6E
-0x788A = 0x4F6F
-0x788F = 0x4F70
-0x7894 = 0x4F71
-0x7898 = 0x4F72
-0x789D = 0x4F74
-0x789E = 0x4F75
-0x789F = 0x4F76
-0x78A1 = 0x4F73
-0x78A4 = 0x4F77
-0x78A8 = 0x4F78
-0x78AC = 0x4F79
-0x78AD = 0x4F7A
-0x78B0 = 0x4F7B
-0x78B1 = 0x4F7C
-0x78B2 = 0x4F7D
-0x78B3 = 0x4F7E
-0x78BB = 0x5021
-0x78BD = 0x5022
-0x78BF = 0x5023
-0x78C7 = 0x5024
-0x78C8 = 0x5025
-0x78C9 = 0x5026
-0x78CC = 0x5027
-0x78CE = 0x5028
-0x78D2 = 0x5029
-0x78D3 = 0x502A
-0x78D5 = 0x502B
-0x78D6 = 0x502C
-0x78DB = 0x502E
-0x78DF = 0x502F
-0x78E0 = 0x5030
-0x78E1 = 0x5031
-0x78E4 = 0x502D
-0x78E6 = 0x5032
-0x78EA = 0x5033
-0x78F2 = 0x5034
-0x78F3 = 0x5035
-0x78F6 = 0x5037
-0x78F7 = 0x5038
-0x78FA = 0x5039
-0x78FB = 0x503A
-0x78FF = 0x503B
-0x7900 = 0x5036
-0x7906 = 0x503C
-0x790C = 0x503D
-0x7910 = 0x503E
-0x791A = 0x503F
-0x791C = 0x5040
-0x791E = 0x5041
-0x791F = 0x5042
-0x7920 = 0x5043
-0x7925 = 0x5044
-0x7927 = 0x5045
-0x7929 = 0x5046
-0x792D = 0x5047
-0x7931 = 0x5048
-0x7934 = 0x5049
-0x7935 = 0x504A
-0x793B = 0x504B
-0x793D = 0x504C
-0x793F = 0x504D
-0x7944 = 0x504E
-0x7945 = 0x504F
-0x7946 = 0x5050
-0x794A = 0x5051
-0x794B = 0x5052
-0x794F = 0x5053
-0x7951 = 0x5054
-0x7954 = 0x5055
-0x7958 = 0x5056
-0x795B = 0x5057
-0x795C = 0x5058
-0x7967 = 0x5059
-0x7969 = 0x505A
-0x796B = 0x505B
-0x7972 = 0x505C
-0x7979 = 0x505D
-0x797B = 0x505E
-0x797C = 0x505F
-0x797E = 0x5060
-0x798B = 0x5061
-0x798C = 0x5062
-0x7991 = 0x5063
-0x7993 = 0x5064
-0x7994 = 0x5065
-0x7995 = 0x5066
-0x7996 = 0x5067
-0x7998 = 0x5068
-0x799B = 0x5069
-0x799C = 0x506A
-0x79A1 = 0x506B
-0x79A8 = 0x506C
-0x79A9 = 0x506D
-0x79AB = 0x506E
-0x79AF = 0x506F
-0x79B1 = 0x5070
-0x79B4 = 0x5071
-0x79B8 = 0x5072
-0x79BB = 0x5073
-0x79C2 = 0x5074
-0x79C4 = 0x5075
-0x79C7 = 0x5076
-0x79C8 = 0x5077
-0x79CA = 0x5078
-0x79CF = 0x5079
-0x79D4 = 0x507A
-0x79D6 = 0x507B
-0x79DA = 0x507C
-0x79DD = 0x507D
-0x79DE = 0x507E
-0x79E0 = 0x5121
-0x79E2 = 0x5122
-0x79E5 = 0x5123
-0x79EA = 0x5124
-0x79EB = 0x5125
-0x79ED = 0x5126
-0x79F1 = 0x5127
-0x79F8 = 0x5128
-0x79FC = 0x5129
-0x7A02 = 0x512A
-0x7A03 = 0x512B
-0x7A07 = 0x512C
-0x7A09 = 0x512D
-0x7A0A = 0x512E
-0x7A0C = 0x512F
-0x7A11 = 0x5130
-0x7A15 = 0x5131
-0x7A1B = 0x5132
-0x7A1E = 0x5133
-0x7A21 = 0x5134
-0x7A27 = 0x5135
-0x7A2B = 0x5136
-0x7A2D = 0x5137
-0x7A2F = 0x5138
-0x7A30 = 0x5139
-0x7A34 = 0x513A
-0x7A35 = 0x513B
-0x7A38 = 0x513C
-0x7A39 = 0x513D
-0x7A3A = 0x513E
-0x7A44 = 0x513F
-0x7A45 = 0x5140
-0x7A47 = 0x5141
-0x7A48 = 0x5142
-0x7A4C = 0x5143
-0x7A55 = 0x5144
-0x7A56 = 0x5145
-0x7A59 = 0x5146
-0x7A5C = 0x5147
-0x7A5D = 0x5148
-0x7A5F = 0x5149
-0x7A60 = 0x514A
-0x7A65 = 0x514B
-0x7A67 = 0x514C
-0x7A6A = 0x514D
-0x7A6D = 0x514E
-0x7A75 = 0x514F
-0x7A78 = 0x5150
-0x7A7E = 0x5151
-0x7A80 = 0x5152
-0x7A82 = 0x5153
-0x7A85 = 0x5154
-0x7A86 = 0x5155
-0x7A8A = 0x5156
-0x7A8B = 0x5157
-0x7A90 = 0x5158
-0x7A91 = 0x5159
-0x7A94 = 0x515A
-0x7A9E = 0x515B
-0x7AA0 = 0x515C
-0x7AA3 = 0x515D
-0x7AAC = 0x515E
-0x7AB3 = 0x515F
-0x7AB5 = 0x5160
-0x7AB9 = 0x5161
-0x7ABB = 0x5162
-0x7ABC = 0x5163
-0x7AC6 = 0x5164
-0x7AC9 = 0x5165
-0x7ACC = 0x5166
-0x7ACE = 0x5167
-0x7AD1 = 0x5168
-0x7ADB = 0x5169
-0x7AE8 = 0x516A
-0x7AE9 = 0x516B
-0x7AEB = 0x516C
-0x7AEC = 0x516D
-0x7AF1 = 0x516E
-0x7AF4 = 0x516F
-0x7AFB = 0x5170
-0x7AFD = 0x5171
-0x7AFE = 0x5172
-0x7B07 = 0x5173
-0x7B14 = 0x5174
-0x7B1F = 0x5175
-0x7B23 = 0x5176
-0x7B27 = 0x5177
-0x7B29 = 0x5178
-0x7B2A = 0x5179
-0x7B2B = 0x517A
-0x7B2D = 0x517B
-0x7B2E = 0x517C
-0x7B2F = 0x517D
-0x7B30 = 0x517E
-0x7B31 = 0x5221
-0x7B34 = 0x5222
-0x7B3D = 0x5223
-0x7B3F = 0x5224
-0x7B40 = 0x5225
-0x7B41 = 0x5226
-0x7B47 = 0x5227
-0x7B4E = 0x5228
-0x7B55 = 0x5229
-0x7B60 = 0x522A
-0x7B64 = 0x522B
-0x7B66 = 0x522C
-0x7B69 = 0x522D
-0x7B6A = 0x522E
-0x7B6D = 0x522F
-0x7B6F = 0x5230
-0x7B72 = 0x5231
-0x7B73 = 0x5232
-0x7B77 = 0x5233
-0x7B84 = 0x5234
-0x7B89 = 0x5235
-0x7B8E = 0x5236
-0x7B90 = 0x5237
-0x7B91 = 0x5238
-0x7B96 = 0x5239
-0x7B9B = 0x523A
-0x7B9E = 0x523B
-0x7BA0 = 0x523C
-0x7BA5 = 0x523D
-0x7BAC = 0x523E
-0x7BAF = 0x523F
-0x7BB0 = 0x5240
-0x7BB2 = 0x5241
-0x7BB5 = 0x5242
-0x7BB6 = 0x5243
-0x7BBA = 0x5244
-0x7BBB = 0x5245
-0x7BBC = 0x5246
-0x7BBD = 0x5247
-0x7BC2 = 0x5248
-0x7BC5 = 0x5249
-0x7BC8 = 0x524A
-0x7BCA = 0x524B
-0x7BD4 = 0x524C
-0x7BD6 = 0x524D
-0x7BD7 = 0x524E
-0x7BD9 = 0x524F
-0x7BDA = 0x5250
-0x7BDB = 0x5251
-0x7BE8 = 0x5252
-0x7BEA = 0x5253
-0x7BF2 = 0x5254
-0x7BF4 = 0x5255
-0x7BF5 = 0x5256
-0x7BF8 = 0x5257
-0x7BF9 = 0x5258
-0x7BFA = 0x5259
-0x7BFC = 0x525A
-0x7BFE = 0x525B
-0x7C01 = 0x525C
-0x7C02 = 0x525D
-0x7C03 = 0x525E
-0x7C04 = 0x525F
-0x7C06 = 0x5260
-0x7C09 = 0x5261
-0x7C0B = 0x5262
-0x7C0C = 0x5263
-0x7C0E = 0x5264
-0x7C0F = 0x5265
-0x7C19 = 0x5266
-0x7C1B = 0x5267
-0x7C20 = 0x5268
-0x7C25 = 0x5269
-0x7C26 = 0x526A
-0x7C28 = 0x526B
-0x7C2C = 0x526C
-0x7C31 = 0x526D
-0x7C33 = 0x526E
-0x7C34 = 0x526F
-0x7C36 = 0x5270
-0x7C39 = 0x5271
-0x7C3A = 0x5272
-0x7C46 = 0x5273
-0x7C4A = 0x5274
-0x7C51 = 0x5276
-0x7C52 = 0x5277
-0x7C53 = 0x5278
-0x7C55 = 0x5275
-0x7C59 = 0x5279
-0x7C5A = 0x527A
-0x7C5B = 0x527B
-0x7C5C = 0x527C
-0x7C5D = 0x527D
-0x7C5E = 0x527E
-0x7C61 = 0x5321
-0x7C63 = 0x5322
-0x7C67 = 0x5323
-0x7C69 = 0x5324
-0x7C6D = 0x5325
-0x7C6E = 0x5326
-0x7C70 = 0x5327
-0x7C72 = 0x5328
-0x7C79 = 0x5329
-0x7C7C = 0x532A
-0x7C7D = 0x532B
-0x7C86 = 0x532C
-0x7C87 = 0x532D
-0x7C8F = 0x532E
-0x7C94 = 0x532F
-0x7C9E = 0x5330
-0x7CA0 = 0x5331
-0x7CA6 = 0x5332
-0x7CB0 = 0x5333
-0x7CB6 = 0x5334
-0x7CB7 = 0x5335
-0x7CBA = 0x5336
-0x7CBB = 0x5337
-0x7CBC = 0x5338
-0x7CBF = 0x5339
-0x7CC4 = 0x533A
-0x7CC7 = 0x533B
-0x7CC8 = 0x533C
-0x7CC9 = 0x533D
-0x7CCD = 0x533E
-0x7CCF = 0x533F
-0x7CD3 = 0x5340
-0x7CD4 = 0x5341
-0x7CD5 = 0x5342
-0x7CD7 = 0x5343
-0x7CD9 = 0x5344
-0x7CDA = 0x5345
-0x7CDD = 0x5346
-0x7CE6 = 0x5347
-0x7CE9 = 0x5348
-0x7CEB = 0x5349
-0x7CF5 = 0x534A
-0x7D03 = 0x534B
-0x7D07 = 0x534C
-0x7D08 = 0x534D
-0x7D09 = 0x534E
-0x7D0F = 0x534F
-0x7D11 = 0x5350
-0x7D12 = 0x5351
-0x7D13 = 0x5352
-0x7D16 = 0x5353
-0x7D1D = 0x5354
-0x7D1E = 0x5355
-0x7D23 = 0x5356
-0x7D26 = 0x5357
-0x7D2A = 0x5358
-0x7D2D = 0x5359
-0x7D31 = 0x535A
-0x7D3C = 0x535B
-0x7D3D = 0x535C
-0x7D3E = 0x535D
-0x7D40 = 0x535E
-0x7D41 = 0x535F
-0x7D47 = 0x5360
-0x7D48 = 0x5361
-0x7D4D = 0x5362
-0x7D51 = 0x5363
-0x7D53 = 0x5364
-0x7D57 = 0x5365
-0x7D59 = 0x5366
-0x7D5A = 0x5367
-0x7D5C = 0x5368
-0x7D5D = 0x5369
-0x7D65 = 0x536A
-0x7D67 = 0x536B
-0x7D6A = 0x536C
-0x7D70 = 0x536D
-0x7D78 = 0x536E
-0x7D7A = 0x536F
-0x7D7B = 0x5370
-0x7D7F = 0x5371
-0x7D81 = 0x5372
-0x7D82 = 0x5373
-0x7D83 = 0x5374
-0x7D85 = 0x5375
-0x7D86 = 0x5376
-0x7D88 = 0x5377
-0x7D8B = 0x5378
-0x7D8C = 0x5379
-0x7D8D = 0x537A
-0x7D91 = 0x537B
-0x7D96 = 0x537C
-0x7D97 = 0x537D
-0x7D9D = 0x537E
-0x7D9E = 0x5421
-0x7DA6 = 0x5422
-0x7DA7 = 0x5423
-0x7DAA = 0x5424
-0x7DB3 = 0x5425
-0x7DB6 = 0x5426
-0x7DB7 = 0x5427
-0x7DB9 = 0x5428
-0x7DC2 = 0x5429
-0x7DC3 = 0x542A
-0x7DC4 = 0x542B
-0x7DC5 = 0x542C
-0x7DC6 = 0x542D
-0x7DCC = 0x542E
-0x7DCD = 0x542F
-0x7DCE = 0x5430
-0x7DD7 = 0x5431
-0x7DD9 = 0x5432
-0x7DE2 = 0x5434
-0x7DE5 = 0x5435
-0x7DE6 = 0x5436
-0x7DEA = 0x5437
-0x7DEB = 0x5438
-0x7DED = 0x5439
-0x7DF1 = 0x543A
-0x7DF5 = 0x543B
-0x7DF6 = 0x543C
-0x7DF9 = 0x543D
-0x7DFA = 0x543E
-0x7E00 = 0x5433
-0x7E08 = 0x543F
-0x7E10 = 0x5440
-0x7E11 = 0x5441
-0x7E15 = 0x5442
-0x7E17 = 0x5443
-0x7E1C = 0x5444
-0x7E1D = 0x5445
-0x7E20 = 0x5446
-0x7E27 = 0x5447
-0x7E28 = 0x5448
-0x7E2C = 0x5449
-0x7E2D = 0x544A
-0x7E2F = 0x544B
-0x7E33 = 0x544C
-0x7E36 = 0x544D
-0x7E3F = 0x544E
-0x7E44 = 0x544F
-0x7E45 = 0x5450
-0x7E47 = 0x5451
-0x7E4E = 0x5452
-0x7E50 = 0x5453
-0x7E52 = 0x5454
-0x7E58 = 0x5455
-0x7E5F = 0x5456
-0x7E61 = 0x5457
-0x7E62 = 0x5458
-0x7E65 = 0x5459
-0x7E6B = 0x545A
-0x7E6E = 0x545B
-0x7E6F = 0x545C
-0x7E73 = 0x545D
-0x7E78 = 0x545E
-0x7E7E = 0x545F
-0x7E81 = 0x5460
-0x7E86 = 0x5461
-0x7E87 = 0x5462
-0x7E8A = 0x5463
-0x7E8D = 0x5464
-0x7E91 = 0x5465
-0x7E95 = 0x5466
-0x7E98 = 0x5467
-0x7E9A = 0x5468
-0x7E9D = 0x5469
-0x7E9E = 0x546A
-0x7F3B = 0x546C
-0x7F3C = 0x546B
-0x7F3D = 0x546D
-0x7F3E = 0x546E
-0x7F3F = 0x546F
-0x7F43 = 0x5470
-0x7F44 = 0x5471
-0x7F47 = 0x5472
-0x7F4F = 0x5473
-0x7F52 = 0x5474
-0x7F53 = 0x5475
-0x7F5B = 0x5476
-0x7F5C = 0x5477
-0x7F5D = 0x5478
-0x7F61 = 0x5479
-0x7F63 = 0x547A
-0x7F64 = 0x547B
-0x7F65 = 0x547C
-0x7F66 = 0x547D
-0x7F6D = 0x547E
-0x7F71 = 0x5521
-0x7F7D = 0x5522
-0x7F7E = 0x5523
-0x7F7F = 0x5524
-0x7F80 = 0x5525
-0x7F8B = 0x5526
-0x7F8D = 0x5527
-0x7F8F = 0x5528
-0x7F90 = 0x5529
-0x7F91 = 0x552A
-0x7F96 = 0x552B
-0x7F97 = 0x552C
-0x7F9C = 0x552D
-0x7FA1 = 0x552E
-0x7FA2 = 0x552F
-0x7FA6 = 0x5530
-0x7FAA = 0x5531
-0x7FAD = 0x5532
-0x7FB4 = 0x5533
-0x7FBC = 0x5534
-0x7FBF = 0x5535
-0x7FC0 = 0x5536
-0x7FC3 = 0x5537
-0x7FC8 = 0x5538
-0x7FCE = 0x5539
-0x7FCF = 0x553A
-0x7FDB = 0x553B
-0x7FDF = 0x553C
-0x7FE3 = 0x553D
-0x7FE5 = 0x553E
-0x7FE8 = 0x553F
-0x7FEC = 0x5540
-0x7FEE = 0x5541
-0x7FEF = 0x5542
-0x7FF2 = 0x5543
-0x7FFA = 0x5544
-0x7FFD = 0x5545
-0x7FFE = 0x5546
-0x7FFF = 0x5547
-0x8007 = 0x5548
-0x8008 = 0x5549
-0x800A = 0x554A
-0x800D = 0x554B
-0x800E = 0x554C
-0x800F = 0x554D
-0x8011 = 0x554E
-0x8013 = 0x554F
-0x8014 = 0x5550
-0x8016 = 0x5551
-0x801D = 0x5552
-0x801E = 0x5553
-0x801F = 0x5554
-0x8020 = 0x5555
-0x8024 = 0x5556
-0x8026 = 0x5557
-0x802C = 0x5558
-0x802E = 0x5559
-0x8030 = 0x555A
-0x8034 = 0x555B
-0x8035 = 0x555C
-0x8037 = 0x555D
-0x8039 = 0x555E
-0x803A = 0x555F
-0x803C = 0x5560
-0x803E = 0x5561
-0x8040 = 0x5562
-0x8044 = 0x5563
-0x8060 = 0x5564
-0x8064 = 0x5565
-0x8066 = 0x5566
-0x806D = 0x5567
-0x8071 = 0x5568
-0x8075 = 0x5569
-0x8081 = 0x556A
-0x8088 = 0x556B
-0x808E = 0x556C
-0x809C = 0x556D
-0x809E = 0x556E
-0x80A6 = 0x556F
-0x80A7 = 0x5570
-0x80AB = 0x5571
-0x80B8 = 0x5572
-0x80B9 = 0x5573
-0x80C8 = 0x5574
-0x80CD = 0x5575
-0x80CF = 0x5576
-0x80D2 = 0x5577
-0x80D4 = 0x5578
-0x80D5 = 0x5579
-0x80D7 = 0x557A
-0x80D8 = 0x557B
-0x80E0 = 0x557C
-0x80ED = 0x557D
-0x80EE = 0x557E
-0x80F0 = 0x5621
-0x80F2 = 0x5622
-0x80F3 = 0x5623
-0x80F6 = 0x5624
-0x80F9 = 0x5625
-0x80FA = 0x5626
-0x80FE = 0x5627
-0x8103 = 0x5628
-0x810B = 0x5629
-0x8116 = 0x562A
-0x8117 = 0x562B
-0x8118 = 0x562C
-0x811C = 0x562D
-0x811E = 0x562E
-0x8120 = 0x562F
-0x8124 = 0x5630
-0x8127 = 0x5631
-0x812C = 0x5632
-0x8130 = 0x5633
-0x8135 = 0x5634
-0x813A = 0x5635
-0x813C = 0x5636
-0x8145 = 0x5637
-0x8147 = 0x5638
-0x814A = 0x5639
-0x814C = 0x563A
-0x8152 = 0x563B
-0x8157 = 0x563C
-0x8160 = 0x563D
-0x8161 = 0x563E
-0x8167 = 0x563F
-0x8168 = 0x5640
-0x8169 = 0x5641
-0x816D = 0x5642
-0x816F = 0x5643
-0x8177 = 0x5644
-0x8181 = 0x5645
-0x8184 = 0x5647
-0x8185 = 0x5648
-0x8186 = 0x5649
-0x818B = 0x564A
-0x818E = 0x564B
-0x8190 = 0x5646
-0x8196 = 0x564C
-0x8198 = 0x564D
-0x819B = 0x564E
-0x819E = 0x564F
-0x81A2 = 0x5650
-0x81AE = 0x5651
-0x81B2 = 0x5652
-0x81B4 = 0x5653
-0x81BB = 0x5654
-0x81C3 = 0x5656
-0x81C5 = 0x5657
-0x81CA = 0x5658
-0x81CB = 0x5655
-0x81CE = 0x5659
-0x81CF = 0x565A
-0x81D5 = 0x565B
-0x81D7 = 0x565C
-0x81DB = 0x565D
-0x81DD = 0x565E
-0x81DE = 0x565F
-0x81E1 = 0x5660
-0x81E4 = 0x5661
-0x81EB = 0x5662
-0x81EC = 0x5663
-0x81F0 = 0x5664
-0x81F1 = 0x5665
-0x81F2 = 0x5666
-0x81F5 = 0x5667
-0x81F6 = 0x5668
-0x81F8 = 0x5669
-0x81F9 = 0x566A
-0x81FD = 0x566B
-0x81FF = 0x566C
-0x8200 = 0x566D
-0x8203 = 0x566E
-0x820F = 0x566F
-0x8213 = 0x5670
-0x8214 = 0x5671
-0x8219 = 0x5672
-0x821A = 0x5673
-0x821D = 0x5674
-0x8221 = 0x5675
-0x8222 = 0x5676
-0x8228 = 0x5677
-0x8232 = 0x5678
-0x8234 = 0x5679
-0x823A = 0x567A
-0x8243 = 0x567B
-0x8244 = 0x567C
-0x8245 = 0x567D
-0x8246 = 0x567E
-0x824B = 0x5721
-0x824E = 0x5722
-0x824F = 0x5723
-0x8251 = 0x5724
-0x8256 = 0x5725
-0x825C = 0x5726
-0x8260 = 0x5727
-0x8263 = 0x5728
-0x8267 = 0x5729
-0x826D = 0x572A
-0x8274 = 0x572B
-0x827B = 0x572C
-0x827D = 0x572D
-0x827F = 0x572E
-0x8280 = 0x572F
-0x8281 = 0x5730
-0x8283 = 0x5731
-0x8284 = 0x5732
-0x8287 = 0x5733
-0x8289 = 0x5734
-0x828A = 0x5735
-0x828E = 0x5736
-0x8291 = 0x5737
-0x8294 = 0x5738
-0x8296 = 0x5739
-0x8298 = 0x573A
-0x829A = 0x573B
-0x829B = 0x573C
-0x82A0 = 0x573D
-0x82A1 = 0x573E
-0x82A3 = 0x573F
-0x82A4 = 0x5740
-0x82A7 = 0x5741
-0x82A8 = 0x5742
-0x82A9 = 0x5743
-0x82AA = 0x5744
-0x82AE = 0x5745
-0x82B0 = 0x5746
-0x82B2 = 0x5747
-0x82B4 = 0x5748
-0x82B7 = 0x5749
-0x82BA = 0x574A
-0x82BC = 0x574B
-0x82BE = 0x574C
-0x82BF = 0x574D
-0x82C6 = 0x574E
-0x82D0 = 0x574F
-0x82D5 = 0x5750
-0x82DA = 0x5751
-0x82E0 = 0x5752
-0x82E2 = 0x5753
-0x82E4 = 0x5754
-0x82E8 = 0x5755
-0x82EA = 0x5756
-0x82ED = 0x5757
-0x82EF = 0x5758
-0x82F6 = 0x5759
-0x82F7 = 0x575A
-0x82FD = 0x575B
-0x82FE = 0x575C
-0x8300 = 0x575D
-0x8301 = 0x575E
-0x8307 = 0x575F
-0x8308 = 0x5760
-0x830A = 0x5761
-0x830B = 0x5762
-0x831B = 0x5764
-0x831D = 0x5765
-0x831E = 0x5766
-0x831F = 0x5767
-0x8321 = 0x5768
-0x8322 = 0x5769
-0x832C = 0x576A
-0x832D = 0x576B
-0x832E = 0x576C
-0x8330 = 0x576D
-0x8333 = 0x576E
-0x8337 = 0x576F
-0x833A = 0x5770
-0x833C = 0x5771
-0x833D = 0x5772
-0x8342 = 0x5773
-0x8343 = 0x5774
-0x8344 = 0x5775
-0x8347 = 0x5776
-0x834D = 0x5777
-0x834E = 0x5778
-0x8351 = 0x5779
-0x8353 = 0x583E
-0x8354 = 0x5763
-0x8355 = 0x577A
-0x8356 = 0x577B
-0x8357 = 0x577C
-0x8370 = 0x577D
-0x8378 = 0x577E
-0x837D = 0x5821
-0x837F = 0x5822
-0x8380 = 0x5823
-0x8382 = 0x5824
-0x8384 = 0x5825
-0x8386 = 0x5826
-0x838D = 0x5827
-0x8392 = 0x5828
-0x8394 = 0x5829
-0x8395 = 0x582A
-0x8398 = 0x582B
-0x8399 = 0x582C
-0x839B = 0x582D
-0x839C = 0x582E
-0x839D = 0x582F
-0x83A6 = 0x5830
-0x83A7 = 0x5831
-0x83A9 = 0x5832
-0x83AC = 0x5833
-0x83AD = 0x584C
-0x83BE = 0x5834
-0x83BF = 0x5835
-0x83C0 = 0x5836
-0x83C7 = 0x5837
-0x83C9 = 0x5838
-0x83CF = 0x5839
-0x83D0 = 0x583A
-0x83D1 = 0x583B
-0x83D4 = 0x583C
-0x83DD = 0x583D
-0x83E8 = 0x583F
-0x83EA = 0x5840
-0x83F6 = 0x5841
-0x83F8 = 0x5842
-0x83F9 = 0x5843
-0x83FC = 0x5844
-0x8401 = 0x5845
-0x8406 = 0x5846
-0x840A = 0x5847
-0x840F = 0x5848
-0x8411 = 0x5849
-0x8415 = 0x584A
-0x8419 = 0x584B
-0x842F = 0x584D
-0x8439 = 0x584E
-0x8445 = 0x584F
-0x8447 = 0x5850
-0x8448 = 0x5851
-0x844A = 0x5852
-0x844D = 0x5853
-0x844F = 0x5854
-0x8451 = 0x5855
-0x8452 = 0x5856
-0x8456 = 0x5857
-0x8458 = 0x5858
-0x8459 = 0x5859
-0x845A = 0x585A
-0x845C = 0x585B
-0x8460 = 0x585C
-0x8464 = 0x585D
-0x8465 = 0x585E
-0x8467 = 0x585F
-0x846A = 0x5860
-0x8470 = 0x5861
-0x8473 = 0x5862
-0x8474 = 0x5863
-0x8476 = 0x5864
-0x8478 = 0x5865
-0x847C = 0x5866
-0x847D = 0x5867
-0x8481 = 0x5868
-0x8485 = 0x5869
-0x8492 = 0x586A
-0x8493 = 0x586B
-0x8495 = 0x586C
-0x849E = 0x586D
-0x84A6 = 0x586E
-0x84A8 = 0x586F
-0x84A9 = 0x5870
-0x84AA = 0x5871
-0x84AF = 0x5872
-0x84B1 = 0x5873
-0x84B4 = 0x5874
-0x84BA = 0x5875
-0x84BD = 0x5876
-0x84BE = 0x5877
-0x84C0 = 0x5878
-0x84C2 = 0x5879
-0x84C7 = 0x587A
-0x84C8 = 0x587B
-0x84CC = 0x587C
-0x84CF = 0x587D
-0x84D3 = 0x587E
-0x84DC = 0x5921
-0x84E7 = 0x5922
-0x84EA = 0x5923
-0x84EF = 0x5924
-0x84F0 = 0x5925
-0x84F1 = 0x5926
-0x84F2 = 0x5927
-0x84F7 = 0x5928
-0x84FA = 0x592A
-0x84FB = 0x592B
-0x84FD = 0x592C
-0x8502 = 0x592D
-0x8503 = 0x592E
-0x8507 = 0x592F
-0x850C = 0x5930
-0x850E = 0x5931
-0x8510 = 0x5932
-0x851C = 0x5933
-0x851E = 0x5934
-0x8522 = 0x5935
-0x8523 = 0x5936
-0x8524 = 0x5937
-0x8525 = 0x5938
-0x8527 = 0x5939
-0x852A = 0x593A
-0x852B = 0x593B
-0x852F = 0x593C
-0x8532 = 0x5929
-0x8533 = 0x593D
-0x8534 = 0x593E
-0x8536 = 0x593F
-0x853F = 0x5940
-0x8546 = 0x5941
-0x854F = 0x5942
-0x8550 = 0x5943
-0x8551 = 0x5944
-0x8552 = 0x5945
-0x8553 = 0x5946
-0x8556 = 0x5947
-0x8559 = 0x5948
-0x855C = 0x5949
-0x855D = 0x594A
-0x855E = 0x594B
-0x855F = 0x594C
-0x8560 = 0x594D
-0x8561 = 0x594E
-0x8562 = 0x594F
-0x8564 = 0x5950
-0x856B = 0x5951
-0x856F = 0x5952
-0x8579 = 0x5953
-0x857A = 0x5954
-0x857B = 0x5955
-0x857D = 0x5956
-0x857F = 0x5957
-0x8581 = 0x5958
-0x8585 = 0x5959
-0x8586 = 0x595A
-0x8589 = 0x595B
-0x858B = 0x595C
-0x858C = 0x595D
-0x858F = 0x595E
-0x8593 = 0x595F
-0x8598 = 0x5960
-0x859D = 0x5961
-0x859F = 0x5962
-0x85A0 = 0x5963
-0x85A2 = 0x5964
-0x85A5 = 0x5965
-0x85A7 = 0x5966
-0x85AD = 0x5974
-0x85B4 = 0x5967
-0x85B6 = 0x5968
-0x85B7 = 0x5969
-0x85B8 = 0x596A
-0x85BC = 0x596B
-0x85BD = 0x596C
-0x85BE = 0x596D
-0x85BF = 0x596E
-0x85C2 = 0x596F
-0x85C7 = 0x5970
-0x85CA = 0x5971
-0x85CB = 0x5972
-0x85CE = 0x5973
-0x85D8 = 0x5975
-0x85DA = 0x5976
-0x85DF = 0x5977
-0x85E0 = 0x5978
-0x85E6 = 0x5979
-0x85E8 = 0x597A
-0x85ED = 0x597B
-0x85F3 = 0x597C
-0x85F6 = 0x597D
-0x85FC = 0x597E
-0x85FF = 0x5A21
-0x8600 = 0x5A22
-0x8604 = 0x5A23
-0x8605 = 0x5A24
-0x860D = 0x5A25
-0x860E = 0x5A26
-0x8610 = 0x5A27
-0x8611 = 0x5A28
-0x8612 = 0x5A29
-0x8618 = 0x5A2A
-0x8619 = 0x5A2B
-0x861B = 0x5A2C
-0x861E = 0x5A2D
-0x8621 = 0x5A2E
-0x8627 = 0x5A2F
-0x8629 = 0x5A30
-0x8636 = 0x5A31
-0x8638 = 0x5A32
-0x863A = 0x5A33
-0x863C = 0x5A34
-0x863D = 0x5A35
-0x8640 = 0x5A36
-0x8641 = 0x3866
-0x8642 = 0x5A37
-0x8646 = 0x5A38
-0x8652 = 0x5A39
-0x8653 = 0x5A3A
-0x8656 = 0x5A3B
-0x8657 = 0x5A3C
-0x8658 = 0x5A3D
-0x8659 = 0x5A3E
-0x865D = 0x5A3F
-0x8660 = 0x5A40
-0x8661 = 0x5A41
-0x8662 = 0x5A42
-0x8663 = 0x5A43
-0x8664 = 0x5A44
-0x8669 = 0x5A45
-0x866C = 0x5A46
-0x866F = 0x5A47
-0x8675 = 0x5A48
-0x8676 = 0x5A49
-0x8677 = 0x5A4A
-0x867A = 0x5A4B
-0x8688 = 0x5A6D
-0x868D = 0x5A4C
-0x8691 = 0x5A4D
-0x8696 = 0x5A4E
-0x8698 = 0x5A4F
-0x869A = 0x5A50
-0x869C = 0x5A51
-0x86A1 = 0x5A52
-0x86A6 = 0x5A53
-0x86A7 = 0x5A54
-0x86A8 = 0x5A55
-0x86AD = 0x5A56
-0x86B1 = 0x5A57
-0x86B3 = 0x5A58
-0x86B4 = 0x5A59
-0x86B5 = 0x5A5A
-0x86B7 = 0x5A5B
-0x86B8 = 0x5A5C
-0x86B9 = 0x5A5D
-0x86BF = 0x5A5E
-0x86C0 = 0x5A5F
-0x86C1 = 0x5A60
-0x86C3 = 0x5A61
-0x86C5 = 0x5A62
-0x86D1 = 0x5A63
-0x86D2 = 0x5A64
-0x86D5 = 0x5A65
-0x86D7 = 0x5A66
-0x86DA = 0x5A67
-0x86DC = 0x5A68
-0x86E0 = 0x5A69
-0x86E3 = 0x5A6A
-0x86E5 = 0x5A6B
-0x86E7 = 0x5A6C
-0x86FA = 0x5A6E
-0x86FC = 0x5A6F
-0x86FD = 0x5A70
-0x8704 = 0x5A71
-0x8705 = 0x5A72
-0x8707 = 0x5A73
-0x870B = 0x5A74
-0x870E = 0x5A75
-0x870F = 0x5A76
-0x8710 = 0x5A77
-0x8713 = 0x5A78
-0x8714 = 0x5A79
-0x8719 = 0x5A7A
-0x871E = 0x5A7B
-0x871F = 0x5A7C
-0x8721 = 0x5A7D
-0x8723 = 0x5A7E
-0x8728 = 0x5B21
-0x872E = 0x5B22
-0x872F = 0x5B23
-0x8731 = 0x5B24
-0x8732 = 0x5B25
-0x8739 = 0x5B26
-0x873A = 0x5B27
-0x873C = 0x5B28
-0x873D = 0x5B29
-0x873E = 0x5B2A
-0x8740 = 0x5B2B
-0x8743 = 0x5B2C
-0x8745 = 0x5B2D
-0x874D = 0x5B2E
-0x8758 = 0x5B2F
-0x875D = 0x5B30
-0x8761 = 0x5B31
-0x8764 = 0x5B32
-0x8765 = 0x5B33
-0x876F = 0x5B34
-0x8771 = 0x5B35
-0x8772 = 0x5B36
-0x877B = 0x5B37
-0x8783 = 0x5B38
-0x8784 = 0x5B39
-0x8785 = 0x5B3A
-0x8786 = 0x5B3B
-0x8787 = 0x5B3C
-0x8788 = 0x5B3D
-0x8789 = 0x5B3E
-0x878B = 0x5B3F
-0x878C = 0x5B40
-0x8790 = 0x5B41
-0x8793 = 0x5B42
-0x8795 = 0x5B43
-0x8797 = 0x5B44
-0x8798 = 0x5B45
-0x8799 = 0x5B46
-0x879E = 0x5B47
-0x87A0 = 0x5B48
-0x87A3 = 0x5B49
-0x87A7 = 0x5B4A
-0x87AC = 0x5B4B
-0x87AD = 0x5B4C
-0x87AE = 0x5B4D
-0x87B1 = 0x5B4E
-0x87B5 = 0x5B4F
-0x87BE = 0x5B50
-0x87BF = 0x5B51
-0x87C1 = 0x5B52
-0x87C8 = 0x5B53
-0x87C9 = 0x5B54
-0x87CA = 0x5B55
-0x87CE = 0x5B56
-0x87D5 = 0x5B57
-0x87D6 = 0x5B58
-0x87D9 = 0x5B59
-0x87DA = 0x5B5A
-0x87DC = 0x5B5B
-0x87DF = 0x5B5C
-0x87E2 = 0x5B5D
-0x87E3 = 0x5B5E
-0x87E4 = 0x5B5F
-0x87EA = 0x5B60
-0x87EB = 0x5B61
-0x87ED = 0x5B62
-0x87F1 = 0x5B63
-0x87F3 = 0x5B64
-0x87F8 = 0x5B65
-0x87FA = 0x5B66
-0x87FF = 0x5B67
-0x8801 = 0x5B68
-0x8803 = 0x5B69
-0x8806 = 0x5B6A
-0x8809 = 0x5B6B
-0x880A = 0x5B6C
-0x880B = 0x5B6D
-0x8810 = 0x5B6E
-0x8812 = 0x5B70
-0x8813 = 0x5B71
-0x8814 = 0x5B72
-0x8818 = 0x5B73
-0x8819 = 0x5B6F
-0x881A = 0x5B74
-0x881B = 0x5B75
-0x881C = 0x5B76
-0x881E = 0x5B77
-0x881F = 0x5B78
-0x8828 = 0x5B79
-0x882D = 0x5B7A
-0x882E = 0x5B7B
-0x8830 = 0x5B7C
-0x8832 = 0x5B7D
-0x8835 = 0x5B7E
-0x883A = 0x5C21
-0x883C = 0x5C22
-0x8841 = 0x5C23
-0x8843 = 0x5C24
-0x8845 = 0x5C25
-0x8848 = 0x5C26
-0x8849 = 0x5C27
-0x884A = 0x5C28
-0x884B = 0x5C29
-0x884E = 0x5C2A
-0x8851 = 0x5C2B
-0x8855 = 0x5C2C
-0x8856 = 0x5C2D
-0x8858 = 0x5C2E
-0x885A = 0x5C2F
-0x885C = 0x5C30
-0x885F = 0x5C31
-0x8860 = 0x5C32
-0x8864 = 0x5C33
-0x8869 = 0x5C34
-0x8871 = 0x5C35
-0x8879 = 0x5C36
-0x887B = 0x5C37
-0x8880 = 0x5C38
-0x8898 = 0x5C39
-0x889A = 0x5C3A
-0x889B = 0x5C3B
-0x889C = 0x5C3C
-0x889F = 0x5C3D
-0x88A0 = 0x5C3E
-0x88A8 = 0x5C3F
-0x88AA = 0x5C40
-0x88BA = 0x5C41
-0x88BD = 0x5C42
-0x88BE = 0x5C43
-0x88C0 = 0x5C44
-0x88CA = 0x5C45
-0x88CB = 0x5C46
-0x88CC = 0x5C47
-0x88CD = 0x5C48
-0x88CE = 0x5C49
-0x88D1 = 0x5C4A
-0x88D2 = 0x5C4B
-0x88D3 = 0x5C4C
-0x88DB = 0x5C4D
-0x88DE = 0x5C4E
-0x88E7 = 0x5C4F
-0x88EF = 0x5C50
-0x88F0 = 0x5C51
-0x88F1 = 0x5C52
-0x88F5 = 0x5C53
-0x88F7 = 0x5C54
-0x8901 = 0x5C55
-0x8906 = 0x5C56
-0x890D = 0x5C57
-0x890E = 0x5C58
-0x890F = 0x5C59
-0x8915 = 0x5C5A
-0x8916 = 0x5C5B
-0x8918 = 0x5C5C
-0x8919 = 0x5C5D
-0x891A = 0x5C5E
-0x891C = 0x5C5F
-0x8920 = 0x5C60
-0x8926 = 0x5C61
-0x8927 = 0x5C62
-0x8928 = 0x5C63
-0x8930 = 0x5C64
-0x8931 = 0x5C65
-0x8932 = 0x5C66
-0x8935 = 0x5C67
-0x8939 = 0x5C68
-0x893A = 0x5C69
-0x893E = 0x5C6A
-0x8940 = 0x5C6B
-0x8942 = 0x5C6C
-0x8945 = 0x5C6D
-0x8946 = 0x5C6E
-0x8949 = 0x5C6F
-0x894F = 0x5C70
-0x8952 = 0x5C71
-0x8957 = 0x5C72
-0x895A = 0x5C73
-0x895B = 0x5C74
-0x895C = 0x5C75
-0x8961 = 0x5C76
-0x8962 = 0x5C77
-0x8963 = 0x5C78
-0x896B = 0x5C79
-0x896E = 0x5C7A
-0x8970 = 0x5C7B
-0x8973 = 0x5C7C
-0x8975 = 0x5C7D
-0x897A = 0x5C7E
-0x897B = 0x5D21
-0x897C = 0x5D22
-0x897D = 0x5D23
-0x8989 = 0x5D24
-0x898D = 0x5D25
-0x8990 = 0x5D26
-0x8994 = 0x5D27
-0x8995 = 0x5D28
-0x899B = 0x5D29
-0x899C = 0x5D2A
-0x899F = 0x5D2B
-0x89A0 = 0x5D2C
-0x89A5 = 0x5D2D
-0x89B0 = 0x5D2E
-0x89B4 = 0x5D2F
-0x89B5 = 0x5D30
-0x89B6 = 0x5D31
-0x89B7 = 0x5D32
-0x89BC = 0x5D33
-0x89D4 = 0x5D34
-0x89D5 = 0x5D35
-0x89D6 = 0x5D36
-0x89D7 = 0x5D37
-0x89D8 = 0x5D38
-0x89E5 = 0x5D39
-0x89E9 = 0x5D3A
-0x89EB = 0x5D3B
-0x89ED = 0x5D3C
-0x89F1 = 0x5D3D
-0x89F3 = 0x5D3E
-0x89F6 = 0x5D3F
-0x89F9 = 0x5D40
-0x89FD = 0x5D41
-0x89FF = 0x5D42
-0x8A04 = 0x5D43
-0x8A05 = 0x5D44
-0x8A07 = 0x5D45
-0x8A0F = 0x5D46
-0x8A11 = 0x5D47
-0x8A12 = 0x5D48
-0x8A14 = 0x5D49
-0x8A15 = 0x5D4A
-0x8A1E = 0x5D4B
-0x8A20 = 0x5D4C
-0x8A22 = 0x5D4D
-0x8A24 = 0x5D4E
-0x8A26 = 0x5D4F
-0x8A2B = 0x5D50
-0x8A2C = 0x5D51
-0x8A2F = 0x5D52
-0x8A35 = 0x5D53
-0x8A37 = 0x5D54
-0x8A3D = 0x5D55
-0x8A3E = 0x5D56
-0x8A40 = 0x5D57
-0x8A43 = 0x5D58
-0x8A45 = 0x5D59
-0x8A47 = 0x5D5A
-0x8A49 = 0x5D5B
-0x8A4D = 0x5D5C
-0x8A4E = 0x5D5D
-0x8A53 = 0x5D5E
-0x8A56 = 0x5D5F
-0x8A57 = 0x5D60
-0x8A58 = 0x5D61
-0x8A5C = 0x5D62
-0x8A5D = 0x5D63
-0x8A61 = 0x5D64
-0x8A65 = 0x5D65
-0x8A67 = 0x5D66
-0x8A75 = 0x5D67
-0x8A76 = 0x5D68
-0x8A77 = 0x5D69
-0x8A79 = 0x5D6A
-0x8A7A = 0x5D6B
-0x8A7B = 0x5D6C
-0x8A7E = 0x5D6D
-0x8A7F = 0x5D6E
-0x8A80 = 0x5D6F
-0x8A83 = 0x5D70
-0x8A86 = 0x5D71
-0x8A8B = 0x5D72
-0x8A8F = 0x5D73
-0x8A90 = 0x5D74
-0x8A92 = 0x5D75
-0x8A96 = 0x5D76
-0x8A97 = 0x5D77
-0x8A99 = 0x5D78
-0x8A9F = 0x5D79
-0x8AA7 = 0x5D7A
-0x8AA9 = 0x5D7B
-0x8AAE = 0x5D7C
-0x8AAF = 0x5D7D
-0x8AB3 = 0x5D7E
-0x8AB6 = 0x5E21
-0x8AB7 = 0x5E22
-0x8ABB = 0x5E23
-0x8ABE = 0x5E24
-0x8AC3 = 0x5E25
-0x8AC6 = 0x5E26
-0x8AC8 = 0x5E27
-0x8AC9 = 0x5E28
-0x8ACA = 0x5E29
-0x8AD1 = 0x5E2A
-0x8AD3 = 0x5E2B
-0x8AD4 = 0x5E2C
-0x8AD5 = 0x5E2D
-0x8AD7 = 0x5E2E
-0x8ADD = 0x5E2F
-0x8ADF = 0x5E30
-0x8AEC = 0x5E31
-0x8AF0 = 0x5E32
-0x8AF4 = 0x5E33
-0x8AF5 = 0x5E34
-0x8AF6 = 0x5E35
-0x8AFC = 0x5E36
-0x8AFF = 0x5E37
-0x8B05 = 0x5E38
-0x8B06 = 0x5E39
-0x8B0A = 0x5E3F
-0x8B0B = 0x5E3A
-0x8B11 = 0x5E3B
-0x8B1C = 0x5E3C
-0x8B1E = 0x5E3D
-0x8B1F = 0x5E3E
-0x8B2D = 0x5E40
-0x8B30 = 0x5E41
-0x8B37 = 0x5E42
-0x8B3C = 0x5E43
-0x8B42 = 0x5E44
-0x8B43 = 0x5E45
-0x8B44 = 0x5E46
-0x8B45 = 0x5E47
-0x8B46 = 0x5E48
-0x8B48 = 0x5E49
-0x8B4D = 0x5E4E
-0x8B52 = 0x5E4A
-0x8B53 = 0x5E4B
-0x8B54 = 0x5E4C
-0x8B59 = 0x5E4D
-0x8B5E = 0x5E4F
-0x8B63 = 0x5E50
-0x8B6D = 0x5E51
-0x8B76 = 0x5E52
-0x8B78 = 0x5E53
-0x8B79 = 0x5E54
-0x8B7C = 0x5E55
-0x8B7E = 0x5E56
-0x8B81 = 0x5E57
-0x8B84 = 0x5E58
-0x8B85 = 0x5E59
-0x8B8B = 0x5E5A
-0x8B8D = 0x5E5B
-0x8B8F = 0x5E5C
-0x8B94 = 0x5E5D
-0x8B95 = 0x5E5E
-0x8B9C = 0x5E5F
-0x8B9E = 0x5E60
-0x8B9F = 0x5E61
-0x8C38 = 0x5E62
-0x8C39 = 0x5E63
-0x8C3D = 0x5E64
-0x8C3E = 0x5E65
-0x8C45 = 0x5E66
-0x8C47 = 0x5E67
-0x8C49 = 0x5E68
-0x8C4B = 0x5E69
-0x8C4F = 0x5E6A
-0x8C51 = 0x5E6B
-0x8C53 = 0x5E6C
-0x8C54 = 0x5E6D
-0x8C57 = 0x5E6E
-0x8C58 = 0x5E6F
-0x8C59 = 0x5E72
-0x8C5B = 0x5E70
-0x8C5D = 0x5E71
-0x8C63 = 0x5E73
-0x8C64 = 0x5E74
-0x8C66 = 0x5E75
-0x8C68 = 0x5E76
-0x8C69 = 0x5E77
-0x8C6D = 0x5E78
-0x8C73 = 0x5E79
-0x8C75 = 0x5E7A
-0x8C76 = 0x5E7B
-0x8C7B = 0x5E7C
-0x8C7E = 0x5E7D
-0x8C86 = 0x5E7E
-0x8C87 = 0x5F21
-0x8C8B = 0x5F22
-0x8C90 = 0x5F23
-0x8C92 = 0x5F24
-0x8C93 = 0x5F25
-0x8C99 = 0x5F26
-0x8C9B = 0x5F27
-0x8C9C = 0x5F28
-0x8CA4 = 0x5F29
-0x8CB9 = 0x5F2A
-0x8CBA = 0x5F2B
-0x8CC5 = 0x5F2C
-0x8CC6 = 0x5F2D
-0x8CC9 = 0x5F2E
-0x8CCB = 0x5F2F
-0x8CCF = 0x5F30
-0x8CD5 = 0x5F32
-0x8CD6 = 0x5F31
-0x8CD9 = 0x5F33
-0x8CDD = 0x5F34
-0x8CE1 = 0x5F35
-0x8CE8 = 0x5F36
-0x8CEC = 0x5F37
-0x8CEF = 0x5F38
-0x8CF0 = 0x5F39
-0x8CF2 = 0x5F3A
-0x8CF5 = 0x5F3B
-0x8CF7 = 0x5F3C
-0x8CF8 = 0x5F3D
-0x8CFE = 0x5F3E
-0x8CFF = 0x5F3F
-0x8D01 = 0x5F40
-0x8D03 = 0x5F41
-0x8D09 = 0x5F42
-0x8D12 = 0x5F43
-0x8D17 = 0x5F44
-0x8D1B = 0x5F45
-0x8D65 = 0x5F46
-0x8D69 = 0x5F47
-0x8D6C = 0x5F48
-0x8D6E = 0x5F49
-0x8D7F = 0x5F4A
-0x8D82 = 0x5F4B
-0x8D84 = 0x5F4C
-0x8D88 = 0x5F4D
-0x8D8D = 0x5F4E
-0x8D90 = 0x5F4F
-0x8D91 = 0x5F50
-0x8D95 = 0x5F51
-0x8D9E = 0x5F52
-0x8D9F = 0x5F53
-0x8DA0 = 0x5F54
-0x8DA6 = 0x5F55
-0x8DAB = 0x5F56
-0x8DAC = 0x5F57
-0x8DAF = 0x5F58
-0x8DB2 = 0x5F59
-0x8DB5 = 0x5F5A
-0x8DB7 = 0x5F5B
-0x8DB9 = 0x5F5C
-0x8DBB = 0x5F5D
-0x8DBC = 0x5F6F
-0x8DC0 = 0x5F5E
-0x8DC5 = 0x5F5F
-0x8DC6 = 0x5F60
-0x8DC7 = 0x5F61
-0x8DC8 = 0x5F62
-0x8DCA = 0x5F63
-0x8DCE = 0x5F64
-0x8DD1 = 0x5F65
-0x8DD4 = 0x5F66
-0x8DD5 = 0x5F67
-0x8DD7 = 0x5F68
-0x8DD9 = 0x5F69
-0x8DE4 = 0x5F6A
-0x8DE5 = 0x5F6B
-0x8DE7 = 0x5F6C
-0x8DEC = 0x5F6D
-0x8DF0 = 0x5F6E
-0x8DF1 = 0x5F70
-0x8DF2 = 0x5F71
-0x8DF4 = 0x5F72
-0x8DFD = 0x5F73
-0x8E01 = 0x5F74
-0x8E04 = 0x5F75
-0x8E05 = 0x5F76
-0x8E06 = 0x5F77
-0x8E0B = 0x5F78
-0x8E11 = 0x5F79
-0x8E14 = 0x5F7A
-0x8E16 = 0x5F7B
-0x8E20 = 0x5F7C
-0x8E21 = 0x5F7D
-0x8E22 = 0x5F7E
-0x8E23 = 0x6021
-0x8E26 = 0x6022
-0x8E27 = 0x6023
-0x8E31 = 0x6024
-0x8E33 = 0x6025
-0x8E36 = 0x6026
-0x8E37 = 0x6027
-0x8E38 = 0x6028
-0x8E39 = 0x6029
-0x8E3D = 0x602A
-0x8E40 = 0x602B
-0x8E41 = 0x602C
-0x8E4B = 0x602D
-0x8E4D = 0x602E
-0x8E4E = 0x602F
-0x8E4F = 0x6030
-0x8E54 = 0x6031
-0x8E5B = 0x6032
-0x8E5C = 0x6033
-0x8E5D = 0x6034
-0x8E5E = 0x6035
-0x8E61 = 0x6036
-0x8E62 = 0x6037
-0x8E69 = 0x6038
-0x8E6C = 0x6039
-0x8E6D = 0x603A
-0x8E6F = 0x603B
-0x8E70 = 0x603C
-0x8E71 = 0x603D
-0x8E79 = 0x603E
-0x8E7A = 0x603F
-0x8E7B = 0x6040
-0x8E82 = 0x6041
-0x8E83 = 0x6042
-0x8E89 = 0x6043
-0x8E90 = 0x6044
-0x8E92 = 0x6045
-0x8E95 = 0x6046
-0x8E9A = 0x6047
-0x8E9B = 0x6048
-0x8E9D = 0x6049
-0x8E9E = 0x604A
-0x8EA2 = 0x604B
-0x8EA7 = 0x604C
-0x8EA9 = 0x604D
-0x8EAD = 0x604E
-0x8EAE = 0x604F
-0x8EB3 = 0x6050
-0x8EB5 = 0x6051
-0x8EBA = 0x6052
-0x8EBB = 0x6053
-0x8EC0 = 0x6054
-0x8EC1 = 0x6055
-0x8EC3 = 0x6056
-0x8EC4 = 0x6057
-0x8EC7 = 0x6058
-0x8ECF = 0x6059
-0x8ED1 = 0x605A
-0x8ED4 = 0x605B
-0x8EDC = 0x605C
-0x8EE8 = 0x605D
-0x8EED = 0x6064
-0x8EEE = 0x605E
-0x8EF0 = 0x605F
-0x8EF1 = 0x6060
-0x8EF7 = 0x6061
-0x8EF9 = 0x6062
-0x8EFA = 0x6063
-0x8F00 = 0x6065
-0x8F02 = 0x6066
-0x8F07 = 0x6067
-0x8F08 = 0x6068
-0x8F0F = 0x6069
-0x8F10 = 0x606A
-0x8F16 = 0x606B
-0x8F17 = 0x606C
-0x8F18 = 0x606D
-0x8F1E = 0x606E
-0x8F20 = 0x606F
-0x8F21 = 0x6070
-0x8F23 = 0x6071
-0x8F25 = 0x6072
-0x8F27 = 0x6073
-0x8F28 = 0x6074
-0x8F2C = 0x6075
-0x8F2D = 0x6076
-0x8F2E = 0x6077
-0x8F34 = 0x6078
-0x8F35 = 0x6079
-0x8F36 = 0x607A
-0x8F37 = 0x607B
-0x8F3A = 0x607C
-0x8F40 = 0x607D
-0x8F41 = 0x607E
-0x8F43 = 0x6121
-0x8F47 = 0x6122
-0x8F4F = 0x6123
-0x8F51 = 0x6124
-0x8F52 = 0x6125
-0x8F53 = 0x6126
-0x8F54 = 0x6127
-0x8F55 = 0x6128
-0x8F58 = 0x6129
-0x8F5D = 0x612A
-0x8F5E = 0x612B
-0x8F65 = 0x612C
-0x8F9D = 0x612D
-0x8FA0 = 0x612E
-0x8FA1 = 0x612F
-0x8FA4 = 0x6130
-0x8FA5 = 0x6131
-0x8FA6 = 0x6132
-0x8FB5 = 0x6133
-0x8FB6 = 0x6134
-0x8FB8 = 0x6135
-0x8FBE = 0x6136
-0x8FC0 = 0x6137
-0x8FC1 = 0x6138
-0x8FC6 = 0x6139
-0x8FCA = 0x613A
-0x8FCB = 0x613B
-0x8FCD = 0x613C
-0x8FD0 = 0x613D
-0x8FD2 = 0x613E
-0x8FD3 = 0x613F
-0x8FD5 = 0x6140
-0x8FE0 = 0x6141
-0x8FE3 = 0x6142
-0x8FE4 = 0x6143
-0x8FE8 = 0x6144
-0x8FEE = 0x6145
-0x8FF1 = 0x6146
-0x8FF5 = 0x6147
-0x8FF6 = 0x6148
-0x8FFB = 0x6149
-0x8FFE = 0x614A
-0x9002 = 0x614B
-0x9004 = 0x614C
-0x9008 = 0x614D
-0x900C = 0x614E
-0x9018 = 0x614F
-0x901B = 0x6150
-0x9028 = 0x6151
-0x9029 = 0x6152
-0x902A = 0x6154
-0x902C = 0x6155
-0x902D = 0x6156
-0x902F = 0x6153
-0x9033 = 0x6157
-0x9034 = 0x6158
-0x9037 = 0x6159
-0x903F = 0x615A
-0x9043 = 0x615B
-0x9044 = 0x615C
-0x904C = 0x615D
-0x905B = 0x615E
-0x905D = 0x615F
-0x9062 = 0x6160
-0x9066 = 0x6161
-0x9067 = 0x6162
-0x906C = 0x6163
-0x9070 = 0x6164
-0x9074 = 0x6165
-0x9079 = 0x6166
-0x9085 = 0x6167
-0x9088 = 0x6168
-0x908B = 0x6169
-0x908C = 0x616A
-0x908E = 0x616B
-0x9090 = 0x616C
-0x9095 = 0x616D
-0x9097 = 0x616E
-0x9098 = 0x616F
-0x9099 = 0x6170
-0x909B = 0x6171
-0x90A0 = 0x6172
-0x90A1 = 0x6173
-0x90A2 = 0x6174
-0x90A5 = 0x6175
-0x90B0 = 0x6176
-0x90B2 = 0x6177
-0x90B3 = 0x6178
-0x90B4 = 0x6179
-0x90B6 = 0x617A
-0x90BD = 0x617B
-0x90BE = 0x617D
-0x90C3 = 0x617E
-0x90C4 = 0x6221
-0x90C5 = 0x6222
-0x90C7 = 0x6223
-0x90C8 = 0x6224
-0x90CC = 0x617C
-0x90D2 = 0x622D
-0x90D5 = 0x6225
-0x90D7 = 0x6226
-0x90D8 = 0x6227
-0x90D9 = 0x6228
-0x90DC = 0x6229
-0x90DD = 0x622A
-0x90DF = 0x622B
-0x90E5 = 0x622C
-0x90EB = 0x622F
-0x90EF = 0x6230
-0x90F0 = 0x6231
-0x90F4 = 0x6232
-0x90F6 = 0x622E
-0x90FE = 0x6233
-0x90FF = 0x6234
-0x9100 = 0x6235
-0x9104 = 0x6236
-0x9105 = 0x6237
-0x9106 = 0x6238
-0x9108 = 0x6239
-0x910D = 0x623A
-0x9110 = 0x623B
-0x9114 = 0x623C
-0x9116 = 0x623D
-0x9117 = 0x623E
-0x9118 = 0x623F
-0x911A = 0x6240
-0x911C = 0x6241
-0x911E = 0x6242
-0x9120 = 0x6243
-0x9122 = 0x6245
-0x9123 = 0x6246
-0x9125 = 0x6244
-0x9127 = 0x6247
-0x9129 = 0x6248
-0x912E = 0x6249
-0x912F = 0x624A
-0x9131 = 0x624B
-0x9134 = 0x624C
-0x9136 = 0x624D
-0x9137 = 0x624E
-0x9139 = 0x624F
-0x913A = 0x6250
-0x913C = 0x6251
-0x913D = 0x6252
-0x9143 = 0x6253
-0x9147 = 0x6254
-0x9148 = 0x6255
-0x914F = 0x6256
-0x9153 = 0x6257
-0x9157 = 0x6258
-0x9159 = 0x6259
-0x915A = 0x625A
-0x915B = 0x625B
-0x9161 = 0x625C
-0x9164 = 0x625D
-0x9167 = 0x625E
-0x916D = 0x625F
-0x9174 = 0x6260
-0x9179 = 0x6261
-0x917A = 0x6262
-0x917B = 0x6263
-0x9181 = 0x6264
-0x9183 = 0x6265
-0x9185 = 0x6266
-0x9186 = 0x6267
-0x918A = 0x6268
-0x918E = 0x6269
-0x9191 = 0x626A
-0x9193 = 0x626B
-0x9194 = 0x626C
-0x9195 = 0x626D
-0x9198 = 0x626E
-0x919E = 0x626F
-0x91A1 = 0x6270
-0x91A6 = 0x6271
-0x91A8 = 0x6272
-0x91AC = 0x6273
-0x91AD = 0x6274
-0x91AE = 0x6275
-0x91B0 = 0x6276
-0x91B1 = 0x6277
-0x91B2 = 0x6278
-0x91B3 = 0x6279
-0x91B6 = 0x627A
-0x91BB = 0x627B
-0x91BC = 0x627C
-0x91BD = 0x627D
-0x91BF = 0x627E
-0x91C2 = 0x6321
-0x91C3 = 0x6322
-0x91C5 = 0x6323
-0x91D3 = 0x6324
-0x91D4 = 0x6325
-0x91D7 = 0x6326
-0x91D9 = 0x6327
-0x91DA = 0x6328
-0x91DE = 0x6329
-0x91E4 = 0x632A
-0x91E5 = 0x632B
-0x91E9 = 0x632C
-0x91EA = 0x632D
-0x91EC = 0x632E
-0x91ED = 0x632F
-0x91EE = 0x6330
-0x91EF = 0x6331
-0x91F0 = 0x6332
-0x91F1 = 0x6333
-0x91F7 = 0x6334
-0x91F9 = 0x6335
-0x91FB = 0x6336
-0x91FD = 0x6337
-0x9200 = 0x6338
-0x9201 = 0x6339
-0x9204 = 0x633A
-0x9205 = 0x633B
-0x9206 = 0x633C
-0x9207 = 0x633D
-0x9209 = 0x633E
-0x920A = 0x633F
-0x920C = 0x6340
-0x9210 = 0x6341
-0x9212 = 0x6342
-0x9213 = 0x6343
-0x9216 = 0x6344
-0x9218 = 0x6345
-0x921C = 0x6346
-0x921D = 0x6347
-0x9223 = 0x6348
-0x9224 = 0x6349
-0x9225 = 0x634A
-0x9226 = 0x634B
-0x9228 = 0x634C
-0x922E = 0x634D
-0x922F = 0x634E
-0x9230 = 0x634F
-0x9233 = 0x6350
-0x9235 = 0x6351
-0x9236 = 0x6352
-0x9238 = 0x6353
-0x9239 = 0x6354
-0x923A = 0x6355
-0x923C = 0x6356
-0x923E = 0x6357
-0x9240 = 0x6358
-0x9242 = 0x6359
-0x9243 = 0x635A
-0x9246 = 0x635B
-0x9247 = 0x635C
-0x924A = 0x635D
-0x924D = 0x635E
-0x924E = 0x635F
-0x924F = 0x6360
-0x9251 = 0x6361
-0x9258 = 0x6362
-0x9259 = 0x6363
-0x925C = 0x6364
-0x925D = 0x6365
-0x9260 = 0x6366
-0x9261 = 0x6367
-0x9265 = 0x6368
-0x9267 = 0x6369
-0x9268 = 0x636A
-0x9269 = 0x636B
-0x926E = 0x636C
-0x926F = 0x636D
-0x9270 = 0x636E
-0x9275 = 0x636F
-0x9276 = 0x6370
-0x9277 = 0x6371
-0x9278 = 0x6372
-0x9279 = 0x6373
-0x927B = 0x6374
-0x927C = 0x6375
-0x927D = 0x6376
-0x927F = 0x6377
-0x9288 = 0x6378
-0x9289 = 0x6379
-0x928A = 0x637A
-0x928D = 0x637B
-0x928E = 0x637C
-0x9292 = 0x637D
-0x9297 = 0x637E
-0x9299 = 0x6421
-0x929F = 0x6422
-0x92A0 = 0x6423
-0x92A4 = 0x6424
-0x92A5 = 0x6425
-0x92A7 = 0x6426
-0x92A8 = 0x6427
-0x92AB = 0x6428
-0x92AF = 0x6429
-0x92B2 = 0x642A
-0x92B6 = 0x642B
-0x92B8 = 0x642C
-0x92BA = 0x642D
-0x92BB = 0x642E
-0x92BC = 0x642F
-0x92BD = 0x6430
-0x92BF = 0x6431
-0x92C0 = 0x6432
-0x92C1 = 0x6433
-0x92C2 = 0x6434
-0x92C3 = 0x6435
-0x92C5 = 0x6436
-0x92C6 = 0x6437
-0x92C7 = 0x6438
-0x92C8 = 0x6439
-0x92CB = 0x643A
-0x92CC = 0x643B
-0x92CD = 0x643C
-0x92CE = 0x643D
-0x92D0 = 0x643E
-0x92D3 = 0x643F
-0x92D5 = 0x6440
-0x92D7 = 0x6441
-0x92D8 = 0x6442
-0x92D9 = 0x6443
-0x92DC = 0x6444
-0x92DD = 0x6445
-0x92DF = 0x6446
-0x92E0 = 0x6447
-0x92E1 = 0x6448
-0x92E3 = 0x6449
-0x92E5 = 0x644A
-0x92E7 = 0x644B
-0x92E8 = 0x644C
-0x92EC = 0x644D
-0x92EE = 0x644E
-0x92F0 = 0x644F
-0x92F9 = 0x6450
-0x92FB = 0x6451
-0x92FF = 0x6452
-0x9300 = 0x6453
-0x9302 = 0x6454
-0x9308 = 0x6455
-0x930D = 0x6456
-0x9311 = 0x6457
-0x9314 = 0x6458
-0x9315 = 0x6459
-0x931C = 0x645A
-0x931D = 0x645B
-0x931E = 0x645C
-0x931F = 0x645D
-0x9321 = 0x645E
-0x9324 = 0x645F
-0x9325 = 0x6460
-0x9327 = 0x6461
-0x9329 = 0x6462
-0x932A = 0x6463
-0x9333 = 0x6464
-0x9334 = 0x6465
-0x9336 = 0x6466
-0x9337 = 0x6467
-0x9347 = 0x6468
-0x9348 = 0x6469
-0x9349 = 0x646A
-0x9350 = 0x646B
-0x9351 = 0x646C
-0x9352 = 0x646D
-0x9355 = 0x646E
-0x9357 = 0x646F
-0x9358 = 0x6470
-0x935A = 0x6471
-0x935E = 0x6472
-0x9364 = 0x6473
-0x9365 = 0x6474
-0x9367 = 0x6475
-0x9369 = 0x6476
-0x936A = 0x6477
-0x936D = 0x6478
-0x936F = 0x6479
-0x9370 = 0x647A
-0x9371 = 0x647B
-0x9373 = 0x647C
-0x9374 = 0x647D
-0x9376 = 0x647E
-0x937A = 0x6521
-0x937D = 0x6522
-0x937F = 0x6523
-0x9380 = 0x6524
-0x9381 = 0x6525
-0x9382 = 0x6526
-0x9388 = 0x6527
-0x938A = 0x6528
-0x938B = 0x6529
-0x938D = 0x652A
-0x938F = 0x652B
-0x9392 = 0x652C
-0x9395 = 0x652D
-0x9398 = 0x652E
-0x939B = 0x652F
-0x939E = 0x6530
-0x93A1 = 0x6531
-0x93A3 = 0x6532
-0x93A4 = 0x6533
-0x93A6 = 0x6534
-0x93A8 = 0x6535
-0x93A9 = 0x653B
-0x93AB = 0x6536
-0x93B4 = 0x6537
-0x93B5 = 0x6538
-0x93B6 = 0x6539
-0x93BA = 0x653A
-0x93C1 = 0x653C
-0x93C4 = 0x653D
-0x93C5 = 0x653E
-0x93C6 = 0x653F
-0x93C7 = 0x6540
-0x93C9 = 0x6541
-0x93CA = 0x6542
-0x93CB = 0x6543
-0x93CC = 0x6544
-0x93CD = 0x6545
-0x93D3 = 0x6546
-0x93D9 = 0x6547
-0x93DC = 0x6548
-0x93DE = 0x6549
-0x93DF = 0x654A
-0x93E2 = 0x654B
-0x93E6 = 0x654C
-0x93E7 = 0x654D
-0x93F7 = 0x654F
-0x93F8 = 0x6550
-0x93F9 = 0x654E
-0x93FA = 0x6551
-0x93FB = 0x6552
-0x93FD = 0x6553
-0x9401 = 0x6554
-0x9402 = 0x6555
-0x9404 = 0x6556
-0x9408 = 0x6557
-0x9409 = 0x6558
-0x940D = 0x6559
-0x940E = 0x655A
-0x940F = 0x655B
-0x9415 = 0x655C
-0x9416 = 0x655D
-0x9417 = 0x655E
-0x941F = 0x655F
-0x942E = 0x6560
-0x942F = 0x6561
-0x9431 = 0x6562
-0x9432 = 0x6563
-0x9433 = 0x6564
-0x9434 = 0x6565
-0x943B = 0x6566
-0x943D = 0x6568
-0x943F = 0x6567
-0x9443 = 0x6569
-0x9445 = 0x656A
-0x9448 = 0x656B
-0x944A = 0x656C
-0x944C = 0x656D
-0x9455 = 0x656E
-0x9459 = 0x656F
-0x945C = 0x6570
-0x945F = 0x6571
-0x9461 = 0x6572
-0x9463 = 0x6573
-0x9468 = 0x6574
-0x946B = 0x6575
-0x946D = 0x6576
-0x946E = 0x6577
-0x946F = 0x6578
-0x9471 = 0x6579
-0x9472 = 0x657A
-0x9483 = 0x657C
-0x9484 = 0x657B
-0x9578 = 0x657D
-0x9579 = 0x657E
-0x957E = 0x6621
-0x9584 = 0x6622
-0x9588 = 0x6623
-0x958C = 0x6624
-0x958D = 0x6625
-0x958E = 0x6626
-0x959D = 0x6627
-0x959E = 0x6628
-0x959F = 0x6629
-0x95A1 = 0x662A
-0x95A6 = 0x662B
-0x95A9 = 0x662C
-0x95AB = 0x662D
-0x95AC = 0x662E
-0x95B4 = 0x662F
-0x95B6 = 0x6630
-0x95BA = 0x6631
-0x95BD = 0x6632
-0x95BF = 0x6633
-0x95C6 = 0x6634
-0x95C8 = 0x6635
-0x95C9 = 0x6636
-0x95CB = 0x6637
-0x95D0 = 0x6638
-0x95D1 = 0x6639
-0x95D2 = 0x663A
-0x95D3 = 0x663B
-0x95D9 = 0x663C
-0x95DA = 0x663D
-0x95DD = 0x663E
-0x95DE = 0x663F
-0x95DF = 0x6640
-0x95E0 = 0x6641
-0x95E4 = 0x6642
-0x95E6 = 0x6643
-0x961D = 0x6644
-0x961E = 0x6645
-0x9622 = 0x6646
-0x9624 = 0x6647
-0x9625 = 0x6648
-0x9626 = 0x6649
-0x962C = 0x664A
-0x9631 = 0x664B
-0x9633 = 0x664C
-0x9637 = 0x664D
-0x9638 = 0x664E
-0x9639 = 0x664F
-0x963A = 0x6650
-0x963C = 0x6651
-0x963D = 0x6652
-0x9641 = 0x6653
-0x9652 = 0x6654
-0x9654 = 0x6655
-0x9656 = 0x6656
-0x9657 = 0x6657
-0x9658 = 0x6658
-0x9661 = 0x6659
-0x966E = 0x665A
-0x9674 = 0x665B
-0x967B = 0x665C
-0x967C = 0x665D
-0x967E = 0x665E
-0x967F = 0x665F
-0x9681 = 0x6660
-0x9682 = 0x6661
-0x9683 = 0x6662
-0x9684 = 0x6663
-0x9689 = 0x6664
-0x9691 = 0x6665
-0x9696 = 0x6666
-0x969A = 0x6667
-0x969D = 0x6668
-0x969F = 0x6669
-0x96A4 = 0x666A
-0x96A5 = 0x666B
-0x96A6 = 0x666C
-0x96A9 = 0x666D
-0x96AE = 0x666E
-0x96AF = 0x666F
-0x96B3 = 0x6670
-0x96BA = 0x6671
-0x96CA = 0x6672
-0x96D2 = 0x6673
-0x96D8 = 0x6675
-0x96DA = 0x6676
-0x96DD = 0x6677
-0x96DE = 0x6678
-0x96DF = 0x6679
-0x96E9 = 0x667A
-0x96EF = 0x667B
-0x96F1 = 0x667C
-0x96FA = 0x667D
-0x9702 = 0x667E
-0x9703 = 0x6721
-0x9705 = 0x6722
-0x9709 = 0x6723
-0x971A = 0x6724
-0x971B = 0x6725
-0x971D = 0x6726
-0x9721 = 0x6727
-0x9722 = 0x6728
-0x9723 = 0x6729
-0x9728 = 0x672A
-0x9731 = 0x672B
-0x9733 = 0x672C
-0x9741 = 0x672D
-0x9743 = 0x672E
-0x974A = 0x672F
-0x974E = 0x6730
-0x974F = 0x6731
-0x9755 = 0x6732
-0x9757 = 0x6733
-0x9758 = 0x6734
-0x975A = 0x6735
-0x975B = 0x6736
-0x9763 = 0x6737
-0x9767 = 0x6738
-0x976A = 0x6739
-0x976E = 0x673A
-0x9773 = 0x673B
-0x9776 = 0x673C
-0x9777 = 0x673D
-0x9778 = 0x673E
-0x977B = 0x673F
-0x977D = 0x6740
-0x977F = 0x6741
-0x9780 = 0x6742
-0x9789 = 0x6743
-0x9795 = 0x6744
-0x9796 = 0x6745
-0x9797 = 0x6746
-0x9799 = 0x6747
-0x979A = 0x6748
-0x979E = 0x6749
-0x979F = 0x674A
-0x97A2 = 0x674B
-0x97AC = 0x674C
-0x97AE = 0x674D
-0x97B1 = 0x674E
-0x97B2 = 0x674F
-0x97B5 = 0x6750
-0x97B6 = 0x6751
-0x97B8 = 0x6752
-0x97B9 = 0x6753
-0x97BA = 0x6754
-0x97BC = 0x6755
-0x97BE = 0x6756
-0x97BF = 0x6757
-0x97C1 = 0x6758
-0x97C4 = 0x6759
-0x97C5 = 0x675A
-0x97C7 = 0x675B
-0x97C9 = 0x675C
-0x97CA = 0x675D
-0x97CC = 0x675E
-0x97CD = 0x675F
-0x97CE = 0x6760
-0x97D0 = 0x6761
-0x97D1 = 0x6762
-0x97D4 = 0x6763
-0x97D7 = 0x6764
-0x97D8 = 0x6765
-0x97D9 = 0x6766
-0x97DB = 0x676A
-0x97DD = 0x6767
-0x97DE = 0x6768
-0x97E0 = 0x6769
-0x97E1 = 0x676B
-0x97E4 = 0x676C
-0x97EF = 0x676D
-0x97F1 = 0x676E
-0x97F4 = 0x676F
-0x97F7 = 0x6770
-0x97F8 = 0x6771
-0x97FA = 0x6772
-0x9807 = 0x6773
-0x980A = 0x6774
-0x980D = 0x6776
-0x980E = 0x6777
-0x9814 = 0x6778
-0x9816 = 0x6779
-0x9819 = 0x6775
-0x981C = 0x677A
-0x981E = 0x677B
-0x9820 = 0x677C
-0x9823 = 0x677D
-0x9825 = 0x6828
-0x9826 = 0x677E
-0x982B = 0x6821
-0x982E = 0x6822
-0x982F = 0x6823
-0x9830 = 0x6824
-0x9832 = 0x6825
-0x9833 = 0x6826
-0x9835 = 0x6827
-0x983E = 0x6829
-0x9844 = 0x682A
-0x9847 = 0x682B
-0x984A = 0x682C
-0x9851 = 0x682D
-0x9852 = 0x682E
-0x9853 = 0x682F
-0x9856 = 0x6830
-0x9857 = 0x6831
-0x9859 = 0x6832
-0x985A = 0x6833
-0x9862 = 0x6834
-0x9863 = 0x6835
-0x9865 = 0x6836
-0x9866 = 0x6837
-0x986A = 0x6838
-0x986C = 0x6839
-0x98AB = 0x683A
-0x98AD = 0x683B
-0x98AE = 0x683C
-0x98B0 = 0x683D
-0x98B4 = 0x683E
-0x98B7 = 0x683F
-0x98B8 = 0x6840
-0x98BA = 0x6841
-0x98BB = 0x6842
-0x98BF = 0x6843
-0x98C2 = 0x6844
-0x98C5 = 0x6845
-0x98C8 = 0x6846
-0x98CC = 0x6847
-0x98E1 = 0x6848
-0x98E3 = 0x6849
-0x98E5 = 0x684A
-0x98E6 = 0x684B
-0x98E7 = 0x684C
-0x98EA = 0x684D
-0x98F3 = 0x684E
-0x98F6 = 0x684F
-0x9902 = 0x6850
-0x9907 = 0x6851
-0x9908 = 0x6852
-0x9911 = 0x6853
-0x9915 = 0x6854
-0x9916 = 0x6855
-0x9917 = 0x6856
-0x991A = 0x6857
-0x991B = 0x6858
-0x991C = 0x6859
-0x991F = 0x685A
-0x9922 = 0x685B
-0x9926 = 0x685C
-0x9927 = 0x685D
-0x992B = 0x685E
-0x9931 = 0x685F
-0x9932 = 0x6860
-0x9933 = 0x6861
-0x9934 = 0x6862
-0x9935 = 0x6863
-0x9939 = 0x6864
-0x993A = 0x6865
-0x993B = 0x6866
-0x993C = 0x6867
-0x9940 = 0x6868
-0x9941 = 0x6869
-0x9946 = 0x686A
-0x9947 = 0x686B
-0x9948 = 0x686C
-0x994D = 0x686D
-0x994E = 0x686E
-0x9954 = 0x686F
-0x9958 = 0x6870
-0x9959 = 0x6871
-0x995B = 0x6872
-0x995C = 0x6873
-0x995E = 0x6874
-0x995F = 0x6875
-0x9960 = 0x6876
-0x999B = 0x6877
-0x999D = 0x6878
-0x999F = 0x6879
-0x99A6 = 0x687A
-0x99B0 = 0x687B
-0x99B1 = 0x687C
-0x99B2 = 0x687D
-0x99B5 = 0x687E
-0x99B9 = 0x6921
-0x99BA = 0x6922
-0x99BD = 0x6923
-0x99BF = 0x6924
-0x99C3 = 0x6925
-0x99C9 = 0x6926
-0x99D3 = 0x6927
-0x99D4 = 0x6928
-0x99D9 = 0x6929
-0x99DA = 0x692A
-0x99DC = 0x692B
-0x99DE = 0x692C
-0x99E7 = 0x692D
-0x99EA = 0x692E
-0x99EB = 0x692F
-0x99EC = 0x6930
-0x99F0 = 0x6931
-0x99F4 = 0x6932
-0x99F5 = 0x6933
-0x99F9 = 0x6934
-0x99FD = 0x6935
-0x99FE = 0x6936
-0x9A02 = 0x6937
-0x9A03 = 0x6938
-0x9A04 = 0x6939
-0x9A0B = 0x693A
-0x9A0C = 0x693B
-0x9A10 = 0x693C
-0x9A11 = 0x693D
-0x9A16 = 0x693E
-0x9A1E = 0x693F
-0x9A20 = 0x6940
-0x9A22 = 0x6941
-0x9A23 = 0x6942
-0x9A24 = 0x6943
-0x9A27 = 0x6944
-0x9A2D = 0x6945
-0x9A2E = 0x6946
-0x9A33 = 0x6947
-0x9A35 = 0x6948
-0x9A36 = 0x6949
-0x9A38 = 0x694A
-0x9A41 = 0x694C
-0x9A44 = 0x694D
-0x9A47 = 0x694B
-0x9A4A = 0x694E
-0x9A4B = 0x694F
-0x9A4C = 0x6950
-0x9A4E = 0x6951
-0x9A51 = 0x6952
-0x9A54 = 0x6953
-0x9A56 = 0x6954
-0x9A5D = 0x6955
-0x9AAA = 0x6956
-0x9AAC = 0x6957
-0x9AAE = 0x6958
-0x9AAF = 0x6959
-0x9AB2 = 0x695A
-0x9AB4 = 0x695B
-0x9AB5 = 0x695C
-0x9AB6 = 0x695D
-0x9AB9 = 0x695E
-0x9ABB = 0x695F
-0x9ABE = 0x6960
-0x9ABF = 0x6961
-0x9AC1 = 0x6962
-0x9AC3 = 0x6963
-0x9AC6 = 0x6964
-0x9AC8 = 0x6965
-0x9ACE = 0x6966
-0x9AD0 = 0x6967
-0x9AD2 = 0x6968
-0x9AD5 = 0x6969
-0x9AD6 = 0x696A
-0x9AD7 = 0x696B
-0x9ADB = 0x696C
-0x9ADC = 0x696D
-0x9AE0 = 0x696E
-0x9AE4 = 0x696F
-0x9AE5 = 0x6970
-0x9AE7 = 0x6971
-0x9AE9 = 0x6972
-0x9AEC = 0x6973
-0x9AF2 = 0x6974
-0x9AF3 = 0x6975
-0x9AF5 = 0x6976
-0x9AF9 = 0x6977
-0x9AFA = 0x6978
-0x9AFD = 0x6979
-0x9AFF = 0x697A
-0x9B00 = 0x697B
-0x9B01 = 0x697C
-0x9B02 = 0x697D
-0x9B03 = 0x697E
-0x9B04 = 0x6A21
-0x9B05 = 0x6A22
-0x9B08 = 0x6A23
-0x9B09 = 0x6A24
-0x9B0B = 0x6A25
-0x9B0C = 0x6A26
-0x9B0D = 0x6A27
-0x9B0E = 0x6A28
-0x9B10 = 0x6A29
-0x9B12 = 0x6A2A
-0x9B16 = 0x6A2B
-0x9B19 = 0x6A2C
-0x9B1B = 0x6A2D
-0x9B1C = 0x6A2E
-0x9B20 = 0x6A2F
-0x9B26 = 0x6A30
-0x9B2B = 0x6A31
-0x9B2D = 0x6A32
-0x9B33 = 0x6A33
-0x9B34 = 0x6A34
-0x9B35 = 0x6A35
-0x9B37 = 0x6A36
-0x9B39 = 0x6A37
-0x9B3A = 0x6A38
-0x9B3D = 0x6A39
-0x9B48 = 0x6A3A
-0x9B4B = 0x6A3B
-0x9B4C = 0x6A3C
-0x9B55 = 0x6A3D
-0x9B56 = 0x6A3E
-0x9B57 = 0x6A3F
-0x9B5B = 0x6A40
-0x9B5E = 0x6A41
-0x9B61 = 0x6A42
-0x9B63 = 0x6A43
-0x9B65 = 0x6A44
-0x9B66 = 0x6A45
-0x9B68 = 0x6A46
-0x9B6A = 0x6A47
-0x9B6B = 0x6A48
-0x9B6C = 0x6A49
-0x9B6D = 0x6A4A
-0x9B6E = 0x6A4B
-0x9B73 = 0x6A4C
-0x9B75 = 0x6A4D
-0x9B77 = 0x6A4E
-0x9B78 = 0x6A4F
-0x9B79 = 0x6A50
-0x9B7F = 0x6A51
-0x9B80 = 0x6A52
-0x9B84 = 0x6A53
-0x9B85 = 0x6A54
-0x9B86 = 0x6A55
-0x9B87 = 0x6A56
-0x9B89 = 0x6A57
-0x9B8A = 0x6A58
-0x9B8B = 0x6A59
-0x9B8D = 0x6A5A
-0x9B8F = 0x6A5B
-0x9B90 = 0x6A5C
-0x9B94 = 0x6A5D
-0x9B9A = 0x6A5E
-0x9B9D = 0x6A5F
-0x9B9E = 0x6A60
-0x9BA6 = 0x6A61
-0x9BA7 = 0x6A62
-0x9BA9 = 0x6A63
-0x9BAC = 0x6A64
-0x9BB0 = 0x6A65
-0x9BB1 = 0x6A66
-0x9BB2 = 0x6A67
-0x9BB7 = 0x6A68
-0x9BB8 = 0x6A69
-0x9BBB = 0x6A6A
-0x9BBC = 0x6A6B
-0x9BBE = 0x6A6C
-0x9BBF = 0x6A6D
-0x9BC1 = 0x6A6E
-0x9BC7 = 0x6A6F
-0x9BC8 = 0x6A70
-0x9BCE = 0x6A71
-0x9BD0 = 0x6A72
-0x9BD7 = 0x6A73
-0x9BD8 = 0x6A74
-0x9BDD = 0x6A75
-0x9BDF = 0x6A76
-0x9BE5 = 0x6A77
-0x9BE7 = 0x6A78
-0x9BEA = 0x6A79
-0x9BEB = 0x6A7A
-0x9BEF = 0x6A7B
-0x9BF3 = 0x6A7C
-0x9BF7 = 0x6A7D
-0x9BF8 = 0x6A7E
-0x9BF9 = 0x6B21
-0x9BFA = 0x6B22
-0x9BFD = 0x6B23
-0x9BFF = 0x6B24
-0x9C00 = 0x6B25
-0x9C02 = 0x6B26
-0x9C0B = 0x6B27
-0x9C0F = 0x6B28
-0x9C11 = 0x6B29
-0x9C16 = 0x6B2A
-0x9C18 = 0x6B2B
-0x9C19 = 0x6B2C
-0x9C1A = 0x6B2D
-0x9C1C = 0x6B2E
-0x9C1E = 0x6B2F
-0x9C22 = 0x6B30
-0x9C23 = 0x6B31
-0x9C26 = 0x6B32
-0x9C27 = 0x6B33
-0x9C28 = 0x6B34
-0x9C29 = 0x6B35
-0x9C2A = 0x6B36
-0x9C31 = 0x6B37
-0x9C35 = 0x6B38
-0x9C36 = 0x6B39
-0x9C37 = 0x6B3A
-0x9C3D = 0x6B3B
-0x9C41 = 0x6B3C
-0x9C43 = 0x6B3D
-0x9C44 = 0x6B3E
-0x9C45 = 0x6B3F
-0x9C49 = 0x6B40
-0x9C4A = 0x6B41
-0x9C4E = 0x6B42
-0x9C4F = 0x6B43
-0x9C50 = 0x6B44
-0x9C53 = 0x6B45
-0x9C54 = 0x6B46
-0x9C56 = 0x6B47
-0x9C58 = 0x6B48
-0x9C5B = 0x6B49
-0x9C5C = 0x6B50
-0x9C5D = 0x6B4A
-0x9C5E = 0x6B4B
-0x9C5F = 0x6B4C
-0x9C63 = 0x6B4D
-0x9C68 = 0x6B52
-0x9C69 = 0x6B4E
-0x9C6A = 0x6B4F
-0x9C6B = 0x6B51
-0x9C6E = 0x6B53
-0x9C70 = 0x6B54
-0x9C72 = 0x6B55
-0x9C75 = 0x6B56
-0x9C77 = 0x6B57
-0x9C7B = 0x6B58
-0x9CE6 = 0x6B59
-0x9CF2 = 0x6B5A
-0x9CF7 = 0x6B5B
-0x9CF9 = 0x6B5C
-0x9D02 = 0x6B5E
-0x9D0B = 0x6B5D
-0x9D11 = 0x6B5F
-0x9D17 = 0x6B60
-0x9D18 = 0x6B61
-0x9D1C = 0x6B62
-0x9D1D = 0x6B63
-0x9D1E = 0x6B64
-0x9D2F = 0x6B65
-0x9D30 = 0x6B66
-0x9D32 = 0x6B67
-0x9D33 = 0x6B68
-0x9D34 = 0x6B69
-0x9D3A = 0x6B6A
-0x9D3C = 0x6B6B
-0x9D3D = 0x6B6D
-0x9D42 = 0x6B6E
-0x9D43 = 0x6B6F
-0x9D45 = 0x6B6C
-0x9D47 = 0x6B70
-0x9D4A = 0x6B71
-0x9D53 = 0x6B72
-0x9D54 = 0x6B73
-0x9D5F = 0x6B74
-0x9D62 = 0x6B76
-0x9D63 = 0x6B75
-0x9D65 = 0x6B77
-0x9D69 = 0x6B78
-0x9D6A = 0x6B79
-0x9D6B = 0x6B7A
-0x9D70 = 0x6B7B
-0x9D76 = 0x6B7C
-0x9D77 = 0x6B7D
-0x9D7B = 0x6B7E
-0x9D7C = 0x6C21
-0x9D7E = 0x6C22
-0x9D83 = 0x6C23
-0x9D84 = 0x6C24
-0x9D86 = 0x6C25
-0x9D8A = 0x6C26
-0x9D8D = 0x6C27
-0x9D8E = 0x6C28
-0x9D92 = 0x6C29
-0x9D93 = 0x6C2A
-0x9D95 = 0x6C2B
-0x9D96 = 0x6C2C
-0x9D97 = 0x6C2D
-0x9D98 = 0x6C2E
-0x9DA1 = 0x6C2F
-0x9DAA = 0x6C30
-0x9DAC = 0x6C31
-0x9DAE = 0x6C32
-0x9DB1 = 0x6C33
-0x9DB5 = 0x6C34
-0x9DB9 = 0x6C35
-0x9DBC = 0x6C36
-0x9DBF = 0x6C37
-0x9DC3 = 0x6C38
-0x9DC7 = 0x6C39
-0x9DC9 = 0x6C3A
-0x9DCA = 0x6C3B
-0x9DD4 = 0x6C3C
-0x9DD5 = 0x6C3D
-0x9DD6 = 0x6C3E
-0x9DD7 = 0x6C3F
-0x9DDA = 0x6C40
-0x9DDE = 0x6C41
-0x9DDF = 0x6C42
-0x9DE0 = 0x6C43
-0x9DE5 = 0x6C44
-0x9DE7 = 0x6C45
-0x9DE9 = 0x6C46
-0x9DEB = 0x6C47
-0x9DEE = 0x6C48
-0x9DF0 = 0x6C49
-0x9DF3 = 0x6C4A
-0x9DF4 = 0x6C4B
-0x9DFE = 0x6C4C
-0x9E02 = 0x6C4E
-0x9E07 = 0x6C4F
-0x9E0A = 0x6C4D
-0x9E0E = 0x6C50
-0x9E10 = 0x6C51
-0x9E11 = 0x6C52
-0x9E12 = 0x6C53
-0x9E15 = 0x6C54
-0x9E16 = 0x6C55
-0x9E19 = 0x6C56
-0x9E1C = 0x6C57
-0x9E1D = 0x6C58
-0x9E7A = 0x6C59
-0x9E7B = 0x6C5A
-0x9E7C = 0x6C5B
-0x9E80 = 0x6C5C
-0x9E82 = 0x6C5D
-0x9E83 = 0x6C5E
-0x9E84 = 0x6C5F
-0x9E85 = 0x6C60
-0x9E87 = 0x6C61
-0x9E8E = 0x6C62
-0x9E8F = 0x6C63
-0x9E96 = 0x6C64
-0x9E98 = 0x6C65
-0x9E9B = 0x6C66
-0x9E9E = 0x6C67
-0x9EA4 = 0x6C68
-0x9EA8 = 0x6C69
-0x9EAC = 0x6C6A
-0x9EAE = 0x6C6B
-0x9EAF = 0x6C6C
-0x9EB0 = 0x6C6D
-0x9EB3 = 0x6C6E
-0x9EB4 = 0x6C6F
-0x9EB5 = 0x6C70
-0x9EC6 = 0x6C71
-0x9EC8 = 0x6C72
-0x9ECB = 0x6C73
-0x9ED5 = 0x6C74
-0x9EDF = 0x6C75
-0x9EE4 = 0x6C76
-0x9EE7 = 0x6C77
-0x9EEC = 0x6C78
-0x9EED = 0x6C79
-0x9EEE = 0x6C7A
-0x9EF0 = 0x6C7B
-0x9EF1 = 0x6C7C
-0x9EF2 = 0x6C7D
-0x9EF5 = 0x6C7E
-0x9EF8 = 0x6D21
-0x9EFF = 0x6D22
-0x9F02 = 0x6D23
-0x9F03 = 0x6D24
-0x9F09 = 0x6D25
-0x9F0F = 0x6D26
-0x9F10 = 0x6D27
-0x9F11 = 0x6D28
-0x9F12 = 0x6D29
-0x9F14 = 0x6D2A
-0x9F16 = 0x6D2B
-0x9F17 = 0x6D2C
-0x9F19 = 0x6D2D
-0x9F1A = 0x6D2E
-0x9F1B = 0x6D2F
-0x9F1F = 0x6D30
-0x9F22 = 0x6D31
-0x9F26 = 0x6D32
-0x9F2A = 0x6D33
-0x9F2B = 0x6D34
-0x9F2F = 0x6D35
-0x9F31 = 0x6D36
-0x9F32 = 0x6D37
-0x9F34 = 0x6D38
-0x9F37 = 0x6D39
-0x9F39 = 0x6D3A
-0x9F3A = 0x6D3B
-0x9F3C = 0x6D3C
-0x9F3D = 0x6D3D
-0x9F3F = 0x6D3E
-0x9F41 = 0x6D3F
-0x9F43 = 0x6D40
-0x9F44 = 0x6D41
-0x9F45 = 0x6D42
-0x9F46 = 0x6D43
-0x9F47 = 0x6D44
-0x9F53 = 0x6D45
-0x9F55 = 0x6D46
-0x9F56 = 0x6D47
-0x9F57 = 0x6D48
-0x9F58 = 0x6D49
-0x9F5A = 0x6D4A
-0x9F5D = 0x6D4B
-0x9F5E = 0x6D4C
-0x9F68 = 0x6D4D
-0x9F69 = 0x6D4E
-0x9F6D = 0x6D4F
-0x9F6E = 0x6D50
-0x9F6F = 0x6D51
-0x9F70 = 0x6D52
-0x9F71 = 0x6D53
-0x9F73 = 0x6D54
-0x9F75 = 0x6D55
-0x9F7A = 0x6D56
-0x9F7D = 0x6D57
-0x9F8F = 0x6D58
-0x9F90 = 0x6D59
-0x9F91 = 0x6D5A
-0x9F92 = 0x6D5B
-0x9F94 = 0x6D5C
-0x9F96 = 0x6D5D
-0x9F97 = 0x6D5E
-0x9F9E = 0x6D5F
-0x9FA1 = 0x6D60
-0x9FA2 = 0x6D61
-0x9FA3 = 0x6D62
-0x9FA5 = 0x6D63
-0xFF5E = 0x2237
-0xFFE4 = 0x2243
-END_MAP
diff --git a/enc/trans/JIS/UCS%JISX0212UDC.src b/enc/trans/JIS/UCS%JISX0212UDC.src
deleted file mode 100644
index 3f7d39772b..0000000000
--- a/enc/trans/JIS/UCS%JISX0212UDC.src
+++ /dev/null
@@ -1,955 +0,0 @@
-# $NetBSD: UCS%JISX0212UDC.src,v 1.1 2003/07/19 20:20:43 tshiozak Exp $
-
-TYPE ROWCOL
-NAME "UCS/JISX0212UDC"
-SRC_ZONE 0xE3AC - 0xE757
-OOB_MODE INVALID
-DST_INVALID 0xFFFF
-DST_UNIT_BITS 16
-
-BEGIN_MAP
-0xE3AC - 0xE757 = INVALID
-#
-# This data is derived from http://www.opengroup.or.jp/jvc/cde/
-#
-0xE3AC = 0x7521
-0xE3AD = 0x7522
-0xE3AE = 0x7523
-0xE3AF = 0x7524
-0xE3B0 = 0x7525
-0xE3B1 = 0x7526
-0xE3B2 = 0x7527
-0xE3B3 = 0x7528
-0xE3B4 = 0x7529
-0xE3B5 = 0x752A
-0xE3B6 = 0x752B
-0xE3B7 = 0x752C
-0xE3B8 = 0x752D
-0xE3B9 = 0x752E
-0xE3BA = 0x752F
-0xE3BB = 0x7530
-0xE3BC = 0x7531
-0xE3BD = 0x7532
-0xE3BE = 0x7533
-0xE3BF = 0x7534
-0xE3C0 = 0x7535
-0xE3C1 = 0x7536
-0xE3C2 = 0x7537
-0xE3C3 = 0x7538
-0xE3C4 = 0x7539
-0xE3C5 = 0x753A
-0xE3C6 = 0x753B
-0xE3C7 = 0x753C
-0xE3C8 = 0x753D
-0xE3C9 = 0x753E
-0xE3CA = 0x753F
-0xE3CB = 0x7540
-0xE3CC = 0x7541
-0xE3CD = 0x7542
-0xE3CE = 0x7543
-0xE3CF = 0x7544
-0xE3D0 = 0x7545
-0xE3D1 = 0x7546
-0xE3D2 = 0x7547
-0xE3D3 = 0x7548
-0xE3D4 = 0x7549
-0xE3D5 = 0x754A
-0xE3D6 = 0x754B
-0xE3D7 = 0x754C
-0xE3D8 = 0x754D
-0xE3D9 = 0x754E
-0xE3DA = 0x754F
-0xE3DB = 0x7550
-0xE3DC = 0x7551
-0xE3DD = 0x7552
-0xE3DE = 0x7553
-0xE3DF = 0x7554
-0xE3E0 = 0x7555
-0xE3E1 = 0x7556
-0xE3E2 = 0x7557
-0xE3E3 = 0x7558
-0xE3E4 = 0x7559
-0xE3E5 = 0x755A
-0xE3E6 = 0x755B
-0xE3E7 = 0x755C
-0xE3E8 = 0x755D
-0xE3E9 = 0x755E
-0xE3EA = 0x755F
-0xE3EB = 0x7560
-0xE3EC = 0x7561
-0xE3ED = 0x7562
-0xE3EE = 0x7563
-0xE3EF = 0x7564
-0xE3F0 = 0x7565
-0xE3F1 = 0x7566
-0xE3F2 = 0x7567
-0xE3F3 = 0x7568
-0xE3F4 = 0x7569
-0xE3F5 = 0x756A
-0xE3F6 = 0x756B
-0xE3F7 = 0x756C
-0xE3F8 = 0x756D
-0xE3F9 = 0x756E
-0xE3FA = 0x756F
-0xE3FB = 0x7570
-0xE3FC = 0x7571
-0xE3FD = 0x7572
-0xE3FE = 0x7573
-0xE3FF = 0x7574
-0xE400 = 0x7575
-0xE401 = 0x7576
-0xE402 = 0x7577
-0xE403 = 0x7578
-0xE404 = 0x7579
-0xE405 = 0x757A
-0xE406 = 0x757B
-0xE407 = 0x757C
-0xE408 = 0x757D
-0xE409 = 0x757E
-0xE40A = 0x7621
-0xE40B = 0x7622
-0xE40C = 0x7623
-0xE40D = 0x7624
-0xE40E = 0x7625
-0xE40F = 0x7626
-0xE410 = 0x7627
-0xE411 = 0x7628
-0xE412 = 0x7629
-0xE413 = 0x762A
-0xE414 = 0x762B
-0xE415 = 0x762C
-0xE416 = 0x762D
-0xE417 = 0x762E
-0xE418 = 0x762F
-0xE419 = 0x7630
-0xE41A = 0x7631
-0xE41B = 0x7632
-0xE41C = 0x7633
-0xE41D = 0x7634
-0xE41E = 0x7635
-0xE41F = 0x7636
-0xE420 = 0x7637
-0xE421 = 0x7638
-0xE422 = 0x7639
-0xE423 = 0x763A
-0xE424 = 0x763B
-0xE425 = 0x763C
-0xE426 = 0x763D
-0xE427 = 0x763E
-0xE428 = 0x763F
-0xE429 = 0x7640
-0xE42A = 0x7641
-0xE42B = 0x7642
-0xE42C = 0x7643
-0xE42D = 0x7644
-0xE42E = 0x7645
-0xE42F = 0x7646
-0xE430 = 0x7647
-0xE431 = 0x7648
-0xE432 = 0x7649
-0xE433 = 0x764A
-0xE434 = 0x764B
-0xE435 = 0x764C
-0xE436 = 0x764D
-0xE437 = 0x764E
-0xE438 = 0x764F
-0xE439 = 0x7650
-0xE43A = 0x7651
-0xE43B = 0x7652
-0xE43C = 0x7653
-0xE43D = 0x7654
-0xE43E = 0x7655
-0xE43F = 0x7656
-0xE440 = 0x7657
-0xE441 = 0x7658
-0xE442 = 0x7659
-0xE443 = 0x765A
-0xE444 = 0x765B
-0xE445 = 0x765C
-0xE446 = 0x765D
-0xE447 = 0x765E
-0xE448 = 0x765F
-0xE449 = 0x7660
-0xE44A = 0x7661
-0xE44B = 0x7662
-0xE44C = 0x7663
-0xE44D = 0x7664
-0xE44E = 0x7665
-0xE44F = 0x7666
-0xE450 = 0x7667
-0xE451 = 0x7668
-0xE452 = 0x7669
-0xE453 = 0x766A
-0xE454 = 0x766B
-0xE455 = 0x766C
-0xE456 = 0x766D
-0xE457 = 0x766E
-0xE458 = 0x766F
-0xE459 = 0x7670
-0xE45A = 0x7671
-0xE45B = 0x7672
-0xE45C = 0x7673
-0xE45D = 0x7674
-0xE45E = 0x7675
-0xE45F = 0x7676
-0xE460 = 0x7677
-0xE461 = 0x7678
-0xE462 = 0x7679
-0xE463 = 0x767A
-0xE464 = 0x767B
-0xE465 = 0x767C
-0xE466 = 0x767D
-0xE467 = 0x767E
-0xE468 = 0x7721
-0xE469 = 0x7722
-0xE46A = 0x7723
-0xE46B = 0x7724
-0xE46C = 0x7725
-0xE46D = 0x7726
-0xE46E = 0x7727
-0xE46F = 0x7728
-0xE470 = 0x7729
-0xE471 = 0x772A
-0xE472 = 0x772B
-0xE473 = 0x772C
-0xE474 = 0x772D
-0xE475 = 0x772E
-0xE476 = 0x772F
-0xE477 = 0x7730
-0xE478 = 0x7731
-0xE479 = 0x7732
-0xE47A = 0x7733
-0xE47B = 0x7734
-0xE47C = 0x7735
-0xE47D = 0x7736
-0xE47E = 0x7737
-0xE47F = 0x7738
-0xE480 = 0x7739
-0xE481 = 0x773A
-0xE482 = 0x773B
-0xE483 = 0x773C
-0xE484 = 0x773D
-0xE485 = 0x773E
-0xE486 = 0x773F
-0xE487 = 0x7740
-0xE488 = 0x7741
-0xE489 = 0x7742
-0xE48A = 0x7743
-0xE48B = 0x7744
-0xE48C = 0x7745
-0xE48D = 0x7746
-0xE48E = 0x7747
-0xE48F = 0x7748
-0xE490 = 0x7749
-0xE491 = 0x774A
-0xE492 = 0x774B
-0xE493 = 0x774C
-0xE494 = 0x774D
-0xE495 = 0x774E
-0xE496 = 0x774F
-0xE497 = 0x7750
-0xE498 = 0x7751
-0xE499 = 0x7752
-0xE49A = 0x7753
-0xE49B = 0x7754
-0xE49C = 0x7755
-0xE49D = 0x7756
-0xE49E = 0x7757
-0xE49F = 0x7758
-0xE4A0 = 0x7759
-0xE4A1 = 0x775A
-0xE4A2 = 0x775B
-0xE4A3 = 0x775C
-0xE4A4 = 0x775D
-0xE4A5 = 0x775E
-0xE4A6 = 0x775F
-0xE4A7 = 0x7760
-0xE4A8 = 0x7761
-0xE4A9 = 0x7762
-0xE4AA = 0x7763
-0xE4AB = 0x7764
-0xE4AC = 0x7765
-0xE4AD = 0x7766
-0xE4AE = 0x7767
-0xE4AF = 0x7768
-0xE4B0 = 0x7769
-0xE4B1 = 0x776A
-0xE4B2 = 0x776B
-0xE4B3 = 0x776C
-0xE4B4 = 0x776D
-0xE4B5 = 0x776E
-0xE4B6 = 0x776F
-0xE4B7 = 0x7770
-0xE4B8 = 0x7771
-0xE4B9 = 0x7772
-0xE4BA = 0x7773
-0xE4BB = 0x7774
-0xE4BC = 0x7775
-0xE4BD = 0x7776
-0xE4BE = 0x7777
-0xE4BF = 0x7778
-0xE4C0 = 0x7779
-0xE4C1 = 0x777A
-0xE4C2 = 0x777B
-0xE4C3 = 0x777C
-0xE4C4 = 0x777D
-0xE4C5 = 0x777E
-0xE4C6 = 0x7821
-0xE4C7 = 0x7822
-0xE4C8 = 0x7823
-0xE4C9 = 0x7824
-0xE4CA = 0x7825
-0xE4CB = 0x7826
-0xE4CC = 0x7827
-0xE4CD = 0x7828
-0xE4CE = 0x7829
-0xE4CF = 0x782A
-0xE4D0 = 0x782B
-0xE4D1 = 0x782C
-0xE4D2 = 0x782D
-0xE4D3 = 0x782E
-0xE4D4 = 0x782F
-0xE4D5 = 0x7830
-0xE4D6 = 0x7831
-0xE4D7 = 0x7832
-0xE4D8 = 0x7833
-0xE4D9 = 0x7834
-0xE4DA = 0x7835
-0xE4DB = 0x7836
-0xE4DC = 0x7837
-0xE4DD = 0x7838
-0xE4DE = 0x7839
-0xE4DF = 0x783A
-0xE4E0 = 0x783B
-0xE4E1 = 0x783C
-0xE4E2 = 0x783D
-0xE4E3 = 0x783E
-0xE4E4 = 0x783F
-0xE4E5 = 0x7840
-0xE4E6 = 0x7841
-0xE4E7 = 0x7842
-0xE4E8 = 0x7843
-0xE4E9 = 0x7844
-0xE4EA = 0x7845
-0xE4EB = 0x7846
-0xE4EC = 0x7847
-0xE4ED = 0x7848
-0xE4EE = 0x7849
-0xE4EF = 0x784A
-0xE4F0 = 0x784B
-0xE4F1 = 0x784C
-0xE4F2 = 0x784D
-0xE4F3 = 0x784E
-0xE4F4 = 0x784F
-0xE4F5 = 0x7850
-0xE4F6 = 0x7851
-0xE4F7 = 0x7852
-0xE4F8 = 0x7853
-0xE4F9 = 0x7854
-0xE4FA = 0x7855
-0xE4FB = 0x7856
-0xE4FC = 0x7857
-0xE4FD = 0x7858
-0xE4FE = 0x7859
-0xE4FF = 0x785A
-0xE500 = 0x785B
-0xE501 = 0x785C
-0xE502 = 0x785D
-0xE503 = 0x785E
-0xE504 = 0x785F
-0xE505 = 0x7860
-0xE506 = 0x7861
-0xE507 = 0x7862
-0xE508 = 0x7863
-0xE509 = 0x7864
-0xE50A = 0x7865
-0xE50B = 0x7866
-0xE50C = 0x7867
-0xE50D = 0x7868
-0xE50E = 0x7869
-0xE50F = 0x786A
-0xE510 = 0x786B
-0xE511 = 0x786C
-0xE512 = 0x786D
-0xE513 = 0x786E
-0xE514 = 0x786F
-0xE515 = 0x7870
-0xE516 = 0x7871
-0xE517 = 0x7872
-0xE518 = 0x7873
-0xE519 = 0x7874
-0xE51A = 0x7875
-0xE51B = 0x7876
-0xE51C = 0x7877
-0xE51D = 0x7878
-0xE51E = 0x7879
-0xE51F = 0x787A
-0xE520 = 0x787B
-0xE521 = 0x787C
-0xE522 = 0x787D
-0xE523 = 0x787E
-0xE524 = 0x7921
-0xE525 = 0x7922
-0xE526 = 0x7923
-0xE527 = 0x7924
-0xE528 = 0x7925
-0xE529 = 0x7926
-0xE52A = 0x7927
-0xE52B = 0x7928
-0xE52C = 0x7929
-0xE52D = 0x792A
-0xE52E = 0x792B
-0xE52F = 0x792C
-0xE530 = 0x792D
-0xE531 = 0x792E
-0xE532 = 0x792F
-0xE533 = 0x7930
-0xE534 = 0x7931
-0xE535 = 0x7932
-0xE536 = 0x7933
-0xE537 = 0x7934
-0xE538 = 0x7935
-0xE539 = 0x7936
-0xE53A = 0x7937
-0xE53B = 0x7938
-0xE53C = 0x7939
-0xE53D = 0x793A
-0xE53E = 0x793B
-0xE53F = 0x793C
-0xE540 = 0x793D
-0xE541 = 0x793E
-0xE542 = 0x793F
-0xE543 = 0x7940
-0xE544 = 0x7941
-0xE545 = 0x7942
-0xE546 = 0x7943
-0xE547 = 0x7944
-0xE548 = 0x7945
-0xE549 = 0x7946
-0xE54A = 0x7947
-0xE54B = 0x7948
-0xE54C = 0x7949
-0xE54D = 0x794A
-0xE54E = 0x794B
-0xE54F = 0x794C
-0xE550 = 0x794D
-0xE551 = 0x794E
-0xE552 = 0x794F
-0xE553 = 0x7950
-0xE554 = 0x7951
-0xE555 = 0x7952
-0xE556 = 0x7953
-0xE557 = 0x7954
-0xE558 = 0x7955
-0xE559 = 0x7956
-0xE55A = 0x7957
-0xE55B = 0x7958
-0xE55C = 0x7959
-0xE55D = 0x795A
-0xE55E = 0x795B
-0xE55F = 0x795C
-0xE560 = 0x795D
-0xE561 = 0x795E
-0xE562 = 0x795F
-0xE563 = 0x7960
-0xE564 = 0x7961
-0xE565 = 0x7962
-0xE566 = 0x7963
-0xE567 = 0x7964
-0xE568 = 0x7965
-0xE569 = 0x7966
-0xE56A = 0x7967
-0xE56B = 0x7968
-0xE56C = 0x7969
-0xE56D = 0x796A
-0xE56E = 0x796B
-0xE56F = 0x796C
-0xE570 = 0x796D
-0xE571 = 0x796E
-0xE572 = 0x796F
-0xE573 = 0x7970
-0xE574 = 0x7971
-0xE575 = 0x7972
-0xE576 = 0x7973
-0xE577 = 0x7974
-0xE578 = 0x7975
-0xE579 = 0x7976
-0xE57A = 0x7977
-0xE57B = 0x7978
-0xE57C = 0x7979
-0xE57D = 0x797A
-0xE57E = 0x797B
-0xE57F = 0x797C
-0xE580 = 0x797D
-0xE581 = 0x797E
-0xE582 = 0x7A21
-0xE583 = 0x7A22
-0xE584 = 0x7A23
-0xE585 = 0x7A24
-0xE586 = 0x7A25
-0xE587 = 0x7A26
-0xE588 = 0x7A27
-0xE589 = 0x7A28
-0xE58A = 0x7A29
-0xE58B = 0x7A2A
-0xE58C = 0x7A2B
-0xE58D = 0x7A2C
-0xE58E = 0x7A2D
-0xE58F = 0x7A2E
-0xE590 = 0x7A2F
-0xE591 = 0x7A30
-0xE592 = 0x7A31
-0xE593 = 0x7A32
-0xE594 = 0x7A33
-0xE595 = 0x7A34
-0xE596 = 0x7A35
-0xE597 = 0x7A36
-0xE598 = 0x7A37
-0xE599 = 0x7A38
-0xE59A = 0x7A39
-0xE59B = 0x7A3A
-0xE59C = 0x7A3B
-0xE59D = 0x7A3C
-0xE59E = 0x7A3D
-0xE59F = 0x7A3E
-0xE5A0 = 0x7A3F
-0xE5A1 = 0x7A40
-0xE5A2 = 0x7A41
-0xE5A3 = 0x7A42
-0xE5A4 = 0x7A43
-0xE5A5 = 0x7A44
-0xE5A6 = 0x7A45
-0xE5A7 = 0x7A46
-0xE5A8 = 0x7A47
-0xE5A9 = 0x7A48
-0xE5AA = 0x7A49
-0xE5AB = 0x7A4A
-0xE5AC = 0x7A4B
-0xE5AD = 0x7A4C
-0xE5AE = 0x7A4D
-0xE5AF = 0x7A4E
-0xE5B0 = 0x7A4F
-0xE5B1 = 0x7A50
-0xE5B2 = 0x7A51
-0xE5B3 = 0x7A52
-0xE5B4 = 0x7A53
-0xE5B5 = 0x7A54
-0xE5B6 = 0x7A55
-0xE5B7 = 0x7A56
-0xE5B8 = 0x7A57
-0xE5B9 = 0x7A58
-0xE5BA = 0x7A59
-0xE5BB = 0x7A5A
-0xE5BC = 0x7A5B
-0xE5BD = 0x7A5C
-0xE5BE = 0x7A5D
-0xE5BF = 0x7A5E
-0xE5C0 = 0x7A5F
-0xE5C1 = 0x7A60
-0xE5C2 = 0x7A61
-0xE5C3 = 0x7A62
-0xE5C4 = 0x7A63
-0xE5C5 = 0x7A64
-0xE5C6 = 0x7A65
-0xE5C7 = 0x7A66
-0xE5C8 = 0x7A67
-0xE5C9 = 0x7A68
-0xE5CA = 0x7A69
-0xE5CB = 0x7A6A
-0xE5CC = 0x7A6B
-0xE5CD = 0x7A6C
-0xE5CE = 0x7A6D
-0xE5CF = 0x7A6E
-0xE5D0 = 0x7A6F
-0xE5D1 = 0x7A70
-0xE5D2 = 0x7A71
-0xE5D3 = 0x7A72
-0xE5D4 = 0x7A73
-0xE5D5 = 0x7A74
-0xE5D6 = 0x7A75
-0xE5D7 = 0x7A76
-0xE5D8 = 0x7A77
-0xE5D9 = 0x7A78
-0xE5DA = 0x7A79
-0xE5DB = 0x7A7A
-0xE5DC = 0x7A7B
-0xE5DD = 0x7A7C
-0xE5DE = 0x7A7D
-0xE5DF = 0x7A7E
-0xE5E0 = 0x7B21
-0xE5E1 = 0x7B22
-0xE5E2 = 0x7B23
-0xE5E3 = 0x7B24
-0xE5E4 = 0x7B25
-0xE5E5 = 0x7B26
-0xE5E6 = 0x7B27
-0xE5E7 = 0x7B28
-0xE5E8 = 0x7B29
-0xE5E9 = 0x7B2A
-0xE5EA = 0x7B2B
-0xE5EB = 0x7B2C
-0xE5EC = 0x7B2D
-0xE5ED = 0x7B2E
-0xE5EE = 0x7B2F
-0xE5EF = 0x7B30
-0xE5F0 = 0x7B31
-0xE5F1 = 0x7B32
-0xE5F2 = 0x7B33
-0xE5F3 = 0x7B34
-0xE5F4 = 0x7B35
-0xE5F5 = 0x7B36
-0xE5F6 = 0x7B37
-0xE5F7 = 0x7B38
-0xE5F8 = 0x7B39
-0xE5F9 = 0x7B3A
-0xE5FA = 0x7B3B
-0xE5FB = 0x7B3C
-0xE5FC = 0x7B3D
-0xE5FD = 0x7B3E
-0xE5FE = 0x7B3F
-0xE5FF = 0x7B40
-0xE600 = 0x7B41
-0xE601 = 0x7B42
-0xE602 = 0x7B43
-0xE603 = 0x7B44
-0xE604 = 0x7B45
-0xE605 = 0x7B46
-0xE606 = 0x7B47
-0xE607 = 0x7B48
-0xE608 = 0x7B49
-0xE609 = 0x7B4A
-0xE60A = 0x7B4B
-0xE60B = 0x7B4C
-0xE60C = 0x7B4D
-0xE60D = 0x7B4E
-0xE60E = 0x7B4F
-0xE60F = 0x7B50
-0xE610 = 0x7B51
-0xE611 = 0x7B52
-0xE612 = 0x7B53
-0xE613 = 0x7B54
-0xE614 = 0x7B55
-0xE615 = 0x7B56
-0xE616 = 0x7B57
-0xE617 = 0x7B58
-0xE618 = 0x7B59
-0xE619 = 0x7B5A
-0xE61A = 0x7B5B
-0xE61B = 0x7B5C
-0xE61C = 0x7B5D
-0xE61D = 0x7B5E
-0xE61E = 0x7B5F
-0xE61F = 0x7B60
-0xE620 = 0x7B61
-0xE621 = 0x7B62
-0xE622 = 0x7B63
-0xE623 = 0x7B64
-0xE624 = 0x7B65
-0xE625 = 0x7B66
-0xE626 = 0x7B67
-0xE627 = 0x7B68
-0xE628 = 0x7B69
-0xE629 = 0x7B6A
-0xE62A = 0x7B6B
-0xE62B = 0x7B6C
-0xE62C = 0x7B6D
-0xE62D = 0x7B6E
-0xE62E = 0x7B6F
-0xE62F = 0x7B70
-0xE630 = 0x7B71
-0xE631 = 0x7B72
-0xE632 = 0x7B73
-0xE633 = 0x7B74
-0xE634 = 0x7B75
-0xE635 = 0x7B76
-0xE636 = 0x7B77
-0xE637 = 0x7B78
-0xE638 = 0x7B79
-0xE639 = 0x7B7A
-0xE63A = 0x7B7B
-0xE63B = 0x7B7C
-0xE63C = 0x7B7D
-0xE63D = 0x7B7E
-0xE63E = 0x7C21
-0xE63F = 0x7C22
-0xE640 = 0x7C23
-0xE641 = 0x7C24
-0xE642 = 0x7C25
-0xE643 = 0x7C26
-0xE644 = 0x7C27
-0xE645 = 0x7C28
-0xE646 = 0x7C29
-0xE647 = 0x7C2A
-0xE648 = 0x7C2B
-0xE649 = 0x7C2C
-0xE64A = 0x7C2D
-0xE64B = 0x7C2E
-0xE64C = 0x7C2F
-0xE64D = 0x7C30
-0xE64E = 0x7C31
-0xE64F = 0x7C32
-0xE650 = 0x7C33
-0xE651 = 0x7C34
-0xE652 = 0x7C35
-0xE653 = 0x7C36
-0xE654 = 0x7C37
-0xE655 = 0x7C38
-0xE656 = 0x7C39
-0xE657 = 0x7C3A
-0xE658 = 0x7C3B
-0xE659 = 0x7C3C
-0xE65A = 0x7C3D
-0xE65B = 0x7C3E
-0xE65C = 0x7C3F
-0xE65D = 0x7C40
-0xE65E = 0x7C41
-0xE65F = 0x7C42
-0xE660 = 0x7C43
-0xE661 = 0x7C44
-0xE662 = 0x7C45
-0xE663 = 0x7C46
-0xE664 = 0x7C47
-0xE665 = 0x7C48
-0xE666 = 0x7C49
-0xE667 = 0x7C4A
-0xE668 = 0x7C4B
-0xE669 = 0x7C4C
-0xE66A = 0x7C4D
-0xE66B = 0x7C4E
-0xE66C = 0x7C4F
-0xE66D = 0x7C50
-0xE66E = 0x7C51
-0xE66F = 0x7C52
-0xE670 = 0x7C53
-0xE671 = 0x7C54
-0xE672 = 0x7C55
-0xE673 = 0x7C56
-0xE674 = 0x7C57
-0xE675 = 0x7C58
-0xE676 = 0x7C59
-0xE677 = 0x7C5A
-0xE678 = 0x7C5B
-0xE679 = 0x7C5C
-0xE67A = 0x7C5D
-0xE67B = 0x7C5E
-0xE67C = 0x7C5F
-0xE67D = 0x7C60
-0xE67E = 0x7C61
-0xE67F = 0x7C62
-0xE680 = 0x7C63
-0xE681 = 0x7C64
-0xE682 = 0x7C65
-0xE683 = 0x7C66
-0xE684 = 0x7C67
-0xE685 = 0x7C68
-0xE686 = 0x7C69
-0xE687 = 0x7C6A
-0xE688 = 0x7C6B
-0xE689 = 0x7C6C
-0xE68A = 0x7C6D
-0xE68B = 0x7C6E
-0xE68C = 0x7C6F
-0xE68D = 0x7C70
-0xE68E = 0x7C71
-0xE68F = 0x7C72
-0xE690 = 0x7C73
-0xE691 = 0x7C74
-0xE692 = 0x7C75
-0xE693 = 0x7C76
-0xE694 = 0x7C77
-0xE695 = 0x7C78
-0xE696 = 0x7C79
-0xE697 = 0x7C7A
-0xE698 = 0x7C7B
-0xE699 = 0x7C7C
-0xE69A = 0x7C7D
-0xE69B = 0x7C7E
-0xE69C = 0x7D21
-0xE69D = 0x7D22
-0xE69E = 0x7D23
-0xE69F = 0x7D24
-0xE6A0 = 0x7D25
-0xE6A1 = 0x7D26
-0xE6A2 = 0x7D27
-0xE6A3 = 0x7D28
-0xE6A4 = 0x7D29
-0xE6A5 = 0x7D2A
-0xE6A6 = 0x7D2B
-0xE6A7 = 0x7D2C
-0xE6A8 = 0x7D2D
-0xE6A9 = 0x7D2E
-0xE6AA = 0x7D2F
-0xE6AB = 0x7D30
-0xE6AC = 0x7D31
-0xE6AD = 0x7D32
-0xE6AE = 0x7D33
-0xE6AF = 0x7D34
-0xE6B0 = 0x7D35
-0xE6B1 = 0x7D36
-0xE6B2 = 0x7D37
-0xE6B3 = 0x7D38
-0xE6B4 = 0x7D39
-0xE6B5 = 0x7D3A
-0xE6B6 = 0x7D3B
-0xE6B7 = 0x7D3C
-0xE6B8 = 0x7D3D
-0xE6B9 = 0x7D3E
-0xE6BA = 0x7D3F
-0xE6BB = 0x7D40
-0xE6BC = 0x7D41
-0xE6BD = 0x7D42
-0xE6BE = 0x7D43
-0xE6BF = 0x7D44
-0xE6C0 = 0x7D45
-0xE6C1 = 0x7D46
-0xE6C2 = 0x7D47
-0xE6C3 = 0x7D48
-0xE6C4 = 0x7D49
-0xE6C5 = 0x7D4A
-0xE6C6 = 0x7D4B
-0xE6C7 = 0x7D4C
-0xE6C8 = 0x7D4D
-0xE6C9 = 0x7D4E
-0xE6CA = 0x7D4F
-0xE6CB = 0x7D50
-0xE6CC = 0x7D51
-0xE6CD = 0x7D52
-0xE6CE = 0x7D53
-0xE6CF = 0x7D54
-0xE6D0 = 0x7D55
-0xE6D1 = 0x7D56
-0xE6D2 = 0x7D57
-0xE6D3 = 0x7D58
-0xE6D4 = 0x7D59
-0xE6D5 = 0x7D5A
-0xE6D6 = 0x7D5B
-0xE6D7 = 0x7D5C
-0xE6D8 = 0x7D5D
-0xE6D9 = 0x7D5E
-0xE6DA = 0x7D5F
-0xE6DB = 0x7D60
-0xE6DC = 0x7D61
-0xE6DD = 0x7D62
-0xE6DE = 0x7D63
-0xE6DF = 0x7D64
-0xE6E0 = 0x7D65
-0xE6E1 = 0x7D66
-0xE6E2 = 0x7D67
-0xE6E3 = 0x7D68
-0xE6E4 = 0x7D69
-0xE6E5 = 0x7D6A
-0xE6E6 = 0x7D6B
-0xE6E7 = 0x7D6C
-0xE6E8 = 0x7D6D
-0xE6E9 = 0x7D6E
-0xE6EA = 0x7D6F
-0xE6EB = 0x7D70
-0xE6EC = 0x7D71
-0xE6ED = 0x7D72
-0xE6EE = 0x7D73
-0xE6EF = 0x7D74
-0xE6F0 = 0x7D75
-0xE6F1 = 0x7D76
-0xE6F2 = 0x7D77
-0xE6F3 = 0x7D78
-0xE6F4 = 0x7D79
-0xE6F5 = 0x7D7A
-0xE6F6 = 0x7D7B
-0xE6F7 = 0x7D7C
-0xE6F8 = 0x7D7D
-0xE6F9 = 0x7D7E
-0xE6FA = 0x7E21
-0xE6FB = 0x7E22
-0xE6FC = 0x7E23
-0xE6FD = 0x7E24
-0xE6FE = 0x7E25
-0xE6FF = 0x7E26
-0xE700 = 0x7E27
-0xE701 = 0x7E28
-0xE702 = 0x7E29
-0xE703 = 0x7E2A
-0xE704 = 0x7E2B
-0xE705 = 0x7E2C
-0xE706 = 0x7E2D
-0xE707 = 0x7E2E
-0xE708 = 0x7E2F
-0xE709 = 0x7E30
-0xE70A = 0x7E31
-0xE70B = 0x7E32
-0xE70C = 0x7E33
-0xE70D = 0x7E34
-0xE70E = 0x7E35
-0xE70F = 0x7E36
-0xE710 = 0x7E37
-0xE711 = 0x7E38
-0xE712 = 0x7E39
-0xE713 = 0x7E3A
-0xE714 = 0x7E3B
-0xE715 = 0x7E3C
-0xE716 = 0x7E3D
-0xE717 = 0x7E3E
-0xE718 = 0x7E3F
-0xE719 = 0x7E40
-0xE71A = 0x7E41
-0xE71B = 0x7E42
-0xE71C = 0x7E43
-0xE71D = 0x7E44
-0xE71E = 0x7E45
-0xE71F = 0x7E46
-0xE720 = 0x7E47
-0xE721 = 0x7E48
-0xE722 = 0x7E49
-0xE723 = 0x7E4A
-0xE724 = 0x7E4B
-0xE725 = 0x7E4C
-0xE726 = 0x7E4D
-0xE727 = 0x7E4E
-0xE728 = 0x7E4F
-0xE729 = 0x7E50
-0xE72A = 0x7E51
-0xE72B = 0x7E52
-0xE72C = 0x7E53
-0xE72D = 0x7E54
-0xE72E = 0x7E55
-0xE72F = 0x7E56
-0xE730 = 0x7E57
-0xE731 = 0x7E58
-0xE732 = 0x7E59
-0xE733 = 0x7E5A
-0xE734 = 0x7E5B
-0xE735 = 0x7E5C
-0xE736 = 0x7E5D
-0xE737 = 0x7E5E
-0xE738 = 0x7E5F
-0xE739 = 0x7E60
-0xE73A = 0x7E61
-0xE73B = 0x7E62
-0xE73C = 0x7E63
-0xE73D = 0x7E64
-0xE73E = 0x7E65
-0xE73F = 0x7E66
-0xE740 = 0x7E67
-0xE741 = 0x7E68
-0xE742 = 0x7E69
-0xE743 = 0x7E6A
-0xE744 = 0x7E6B
-0xE745 = 0x7E6C
-0xE746 = 0x7E6D
-0xE747 = 0x7E6E
-0xE748 = 0x7E6F
-0xE749 = 0x7E70
-0xE74A = 0x7E71
-0xE74B = 0x7E72
-0xE74C = 0x7E73
-0xE74D = 0x7E74
-0xE74E = 0x7E75
-0xE74F = 0x7E76
-0xE750 = 0x7E77
-0xE751 = 0x7E78
-0xE752 = 0x7E79
-0xE753 = 0x7E7A
-0xE754 = 0x7E7B
-0xE755 = 0x7E7C
-0xE756 = 0x7E7D
-0xE757 = 0x7E7E
-END_MAP
diff --git a/enc/trans/JIS/UCS%JISX0212VDC@IBM.src b/enc/trans/JIS/UCS%JISX0212VDC@IBM.src
deleted file mode 100644
index 0863140750..0000000000
--- a/enc/trans/JIS/UCS%JISX0212VDC@IBM.src
+++ /dev/null
@@ -1,121 +0,0 @@
-# $NetBSD: UCS%JISX0212VDC@IBM.src,v 1.1 2003/07/19 20:20:43 tshiozak Exp $
-
-TYPE ROWCOL
-NAME "UCS/JISX0212VDC:IBM"
-SRC_ZONE 0x2116 - 0xFF07
-OOB_MODE INVALID
-DST_INVALID 0xFFFF
-DST_UNIT_BITS 16
-
-BEGIN_MAP
-0x2116 - 0xFF07 = INVALID
-#
-# This data is derived from http://www.opengroup.or.jp/jvc/cde/
-#
-0x2116 = 0x742C
-0x2121 = 0x742D
-0x2160 = 0x737D
-0x2161 = 0x737E
-0x2162 = 0x7421
-0x2163 = 0x7422
-0x2164 = 0x7423
-0x2165 = 0x7424
-0x2166 = 0x7425
-0x2167 = 0x7426
-0x2168 = 0x7427
-0x2169 = 0x7428
-0x2170 = 0x7373
-0x2171 = 0x7374
-0x2172 = 0x7375
-0x2173 = 0x7376
-0x2174 = 0x7377
-0x2175 = 0x7378
-0x2176 = 0x7379
-0x2177 = 0x737A
-0x2178 = 0x737B
-0x2179 = 0x737C
-0x3231 = 0x742B
-0x4EFC = 0x742F
-0x50F4 = 0x7430
-0x51EC = 0x7431
-0x5307 = 0x7432
-0x5324 = 0x7433
-0x548A = 0x7435
-0x5759 = 0x7436
-0x589E = 0x7439
-0x5BEC = 0x743A
-0x5CF5 = 0x743B
-0x5D53 = 0x743C
-0x5FB7 = 0x743E
-0x6085 = 0x743F
-0x6120 = 0x7440
-0x654E = 0x7441
-0x663B = 0x7442
-0x6665 = 0x7443
-0x6801 = 0x7446
-0x6A6B = 0x7449
-0x6AE2 = 0x744A
-0x6DF2 = 0x744C
-0x6DF8 = 0x744B
-0x7028 = 0x744D
-0x70BB = 0x742E
-0x7501 = 0x7450
-0x7682 = 0x7451
-0x769E = 0x7452
-0x7930 = 0x7454
-0x7AE7 = 0x7459
-0x7DA0 = 0x745C
-0x7DD6 = 0x745D
-0x8362 = 0x745F
-0x85B0 = 0x7461
-0x8807 = 0x7464
-0x8B7F = 0x7466
-0x8CF4 = 0x7467
-0x8D76 = 0x7468
-0x90DE = 0x746C
-0x9115 = 0x746E
-0x9592 = 0x7471
-0x973B = 0x7474
-0x974D = 0x7475
-0x9751 = 0x7476
-0x999E = 0x747A
-0x9AD9 = 0x747B
-0x9B72 = 0x747C
-0x9ED1 = 0x747E
-0xF929 = 0x7445
-0xF9DC = 0x7472
-0xFA0E = 0x7434
-0xFA0F = 0x7437
-0xFA10 = 0x7438
-0xFA11 = 0x743D
-0xFA12 = 0x7444
-0xFA13 = 0x7447
-0xFA14 = 0x7448
-0xFA15 = 0x744E
-0xFA16 = 0x744F
-0xFA17 = 0x7453
-0xFA18 = 0x7455
-0xFA19 = 0x7456
-0xFA1A = 0x7457
-0xFA1B = 0x7458
-0xFA1C = 0x745A
-0xFA1D = 0x745B
-0xFA1E = 0x745E
-0xFA1F = 0x7460
-0xFA20 = 0x7462
-0xFA21 = 0x7463
-0xFA22 = 0x7465
-0xFA23 = 0x7469
-0xFA24 = 0x746A
-0xFA25 = 0x746B
-0xFA26 = 0x746D
-0xFA27 = 0x746F
-0xFA28 = 0x7470
-0xFA29 = 0x7473
-0xFA2A = 0x7477
-0xFA2B = 0x7478
-0xFA2C = 0x7479
-0xFA2D = 0x747D
-0xFF02 = 0x742A
-0xFF07 = 0x7429
-END_MAP
diff --git a/enc/trans/big5-tbl.rb b/enc/trans/big5-tbl.rb
deleted file mode 100644
index b093cb0d77..0000000000
--- a/enc/trans/big5-tbl.rb
+++ /dev/null
@@ -1,13705 +0,0 @@
-BIG5_TO_UCS_TBL= [
- ["A246",0xA2],
- ["A247",0xA3],
- ["A244",0xA5],
- ["A1B1",0xA7],
- ["A258",0xB0],
- ["A1D3",0xB1],
- ["A150",0xB7],
- ["A1D1",0xD7],
- ["A1D2",0xF7],
- ["A3BE",0x2C7],
- ["A3BC",0x2C9],
- ["A3BD",0x2CA],
- ["A3BF",0x2CB],
- ["A3BB",0x2D9],
- ["A344",0x391],
- ["A345",0x392],
- ["A346",0x393],
- ["A347",0x394],
- ["A348",0x395],
- ["A349",0x396],
- ["A34A",0x397],
- ["A34B",0x398],
- ["A34C",0x399],
- ["A34D",0x39A],
- ["A34E",0x39B],
- ["A34F",0x39C],
- ["A350",0x39D],
- ["A351",0x39E],
- ["A352",0x39F],
- ["A353",0x3A0],
- ["A354",0x3A1],
- ["A355",0x3A3],
- ["A356",0x3A4],
- ["A357",0x3A5],
- ["A358",0x3A6],
- ["A359",0x3A7],
- ["A35A",0x3A8],
- ["A35B",0x3A9],
- ["A35C",0x3B1],
- ["A35D",0x3B2],
- ["A35E",0x3B3],
- ["A35F",0x3B4],
- ["A360",0x3B5],
- ["A361",0x3B6],
- ["A362",0x3B7],
- ["A363",0x3B8],
- ["A364",0x3B9],
- ["A365",0x3BA],
- ["A366",0x3BB],
- ["A367",0x3BC],
- ["A368",0x3BD],
- ["A369",0x3BE],
- ["A36A",0x3BF],
- ["A36B",0x3C0],
- ["A36C",0x3C1],
- ["A36D",0x3C3],
- ["A36E",0x3C4],
- ["A36F",0x3C5],
- ["A370",0x3C6],
- ["A371",0x3C7],
- ["A372",0x3C8],
- ["A373",0x3C9],
- ["C7B3",0x401],
- ["C7B1",0x414],
- ["C7B2",0x415],
- ["C7B4",0x416],
- ["C7B5",0x417],
- ["C7B6",0x418],
- ["C7B7",0x419],
- ["C7B8",0x41A],
- ["C7B9",0x41B],
- ["C7BA",0x41C],
- ["C7BB",0x423],
- ["C7BC",0x424],
- ["C7BD",0x425],
- ["C7BE",0x426],
- ["C7BF",0x427],
- ["C7C0",0x428],
- ["C7C1",0x429],
- ["C7C2",0x42A],
- ["C7C3",0x42B],
- ["C7C4",0x42C],
- ["C7C5",0x42D],
- ["C7C6",0x42E],
- ["C7C7",0x42F],
- ["C7C8",0x430],
- ["C7C9",0x431],
- ["C7CA",0x432],
- ["C7CB",0x433],
- ["C7CC",0x434],
- ["C7CD",0x435],
- ["C7CF",0x436],
- ["C7D0",0x437],
- ["C7D1",0x438],
- ["C7D2",0x439],
- ["C7D3",0x43A],
- ["C7D4",0x43B],
- ["C7D5",0x43C],
- ["C7D6",0x43D],
- ["C7D7",0x43E],
- ["C7D8",0x43F],
- ["C7D9",0x440],
- ["C7DA",0x441],
- ["C7DB",0x442],
- ["C7DC",0x443],
- ["C7DD",0x444],
- ["C7DE",0x445],
- ["C7DF",0x446],
- ["C7E0",0x447],
- ["C7E1",0x448],
- ["C7E2",0x449],
- ["C7E3",0x44A],
- ["C7E4",0x44B],
- ["C7E5",0x44C],
- ["C7E6",0x44D],
- ["C7E7",0x44E],
- ["C7E8",0x44F],
- ["C7CE",0x451],
- ["A156",0x2013],
- ["A158",0x2014],
- ["A1A5",0x2018],
- ["A1A6",0x2019],
- ["A1A7",0x201C],
- ["A1A8",0x201D],
- ["A145",0x2022],
- ["A14C",0x2025],
- ["A14B",0x2026],
- ["A1AC",0x2032],
- ["A1AB",0x2035],
- ["A1B0",0x203B],
- ["A1C2",0x203E],
- ["A24A",0x2103],
- ["A1C1",0x2105],
- ["A24B",0x2109],
- ["A2B9",0x2160],
- ["A2BA",0x2161],
- ["A2BB",0x2162],
- ["A2BC",0x2163],
- ["A2BD",0x2164],
- ["A2BE",0x2165],
- ["A2BF",0x2166],
- ["A2C0",0x2167],
- ["A2C1",0x2168],
- ["A2C2",0x2169],
- ["A1F6",0x2190],
- ["A1F4",0x2191],
- ["A1F7",0x2192],
- ["A1F5",0x2193],
- ["A1F8",0x2196],
- ["A1F9",0x2197],
- ["A1FB",0x2198],
- ["A1FA",0x2199],
- ["A1D4",0x221A],
- ["A1DB",0x221E],
- ["A1E8",0x221F],
- ["A1E7",0x2220],
- ["A1FD",0x2223],
- ["A1FC",0x2225],
- ["A1E4",0x2229],
- ["A1E5",0x222A],
- ["A1EC",0x222B],
- ["A1ED",0x222E],
- ["A1EF",0x2234],
- ["A1EE",0x2235],
- ["A1E3",0x223C],
- ["A1DC",0x2252],
- ["A1DA",0x2260],
- ["A1DD",0x2261],
- ["A1D8",0x2266],
- ["A1D9",0x2267],
- ["A1E6",0x22A5],
- ["A1E9",0x22BF],
- ["C7E9",0x2460],
- ["C7EA",0x2461],
- ["C7EB",0x2462],
- ["C7EC",0x2463],
- ["C7ED",0x2464],
- ["C7EE",0x2465],
- ["C7EF",0x2466],
- ["C7F0",0x2467],
- ["C7F1",0x2468],
- ["C7F2",0x2469],
- ["C7F3",0x2474],
- ["C7F4",0x2475],
- ["C7F5",0x2476],
- ["C7F6",0x2477],
- ["C7F7",0x2478],
- ["C7F8",0x2479],
- ["C7F9",0x247A],
- ["C7FA",0x247B],
- ["C7FB",0x247C],
- ["C7FC",0x247D],
- ["A277",0x2500],
- ["A278",0x2502],
- ["A27A",0x250C],
- ["A27B",0x2510],
- ["A27C",0x2514],
- ["A27D",0x2518],
- ["A275",0x251C],
- ["A274",0x2524],
- ["A273",0x252C],
- ["A272",0x2534],
- ["A271",0x253C],
- ["A2A4",0x2550],
- ["A2A5",0x255E],
- ["A2A7",0x2561],
- ["A2A6",0x256A],
- ["A27E",0x256D],
- ["A2A1",0x256E],
- ["A2A3",0x256F],
- ["A2A2",0x2570],
- ["A2AC",0x2571],
- ["A2AD",0x2572],
- ["A2AE",0x2573],
- ["A262",0x2581],
- ["A263",0x2582],
- ["A264",0x2583],
- ["A265",0x2584],
- ["A266",0x2585],
- ["A267",0x2586],
- ["A268",0x2587],
- ["A269",0x2588],
- ["A270",0x2589],
- ["A26F",0x258A],
- ["A26E",0x258B],
- ["A26D",0x258C],
- ["A26C",0x258D],
- ["A26B",0x258E],
- ["A26A",0x258F],
- ["A276",0x2594],
- ["A279",0x2595],
- ["A1BD",0x25A0],
- ["A1BC",0x25A1],
- ["A1B6",0x25B2],
- ["A1B5",0x25B3],
- ["A1BF",0x25BC],
- ["A1BE",0x25BD],
- ["A1BB",0x25C6],
- ["A1BA",0x25C7],
- ["A1B3",0x25CB],
- ["A1B7",0x25CE],
- ["A1B4",0x25CF],
- ["A2A8",0x25E2],
- ["A2A9",0x25E3],
- ["A2AB",0x25E4],
- ["A2AA",0x25E5],
- ["A1B9",0x2605],
- ["A1B8",0x2606],
- ["A1F3",0x2609],
- ["A1F0",0x2640],
- ["A1F2",0x2641],
- ["A1F1",0x2642],
- ["A140",0x3000],
- ["A142",0x3001],
- ["A143",0x3002],
- ["A1B2",0x3003],
- ["C6A4",0x3005],
- ["A171",0x3008],
- ["A172",0x3009],
- ["A16D",0x300A],
- ["A16E",0x300B],
- ["A175",0x300C],
- ["A176",0x300D],
- ["A179",0x300E],
- ["A17A",0x300F],
- ["A169",0x3010],
- ["A16A",0x3011],
- ["A245",0x3012],
- ["A165",0x3014],
- ["A166",0x3015],
- ["A1A9",0x301D],
- ["A1AA",0x301E],
- ["A2C3",0x3021],
- ["A2C4",0x3022],
- ["A2C5",0x3023],
- ["A2C6",0x3024],
- ["A2C7",0x3025],
- ["A2C8",0x3026],
- ["A2C9",0x3027],
- ["A2CA",0x3028],
- ["A2CB",0x3029],
- ["C6A5",0x3041],
- ["C6A6",0x3042],
- ["C6A7",0x3043],
- ["C6A8",0x3044],
- ["C6A9",0x3045],
- ["C6AA",0x3046],
- ["C6AB",0x3047],
- ["C6AC",0x3048],
- ["C6AD",0x3049],
- ["C6AE",0x304A],
- ["C6AF",0x304B],
- ["C6B0",0x304C],
- ["C6B1",0x304D],
- ["C6B2",0x304E],
- ["C6B3",0x304F],
- ["C6B4",0x3050],
- ["C6B5",0x3051],
- ["C6B6",0x3052],
- ["C6B7",0x3053],
- ["C6B8",0x3054],
- ["C6B9",0x3055],
- ["C6BA",0x3056],
- ["C6BB",0x3057],
- ["C6BC",0x3058],
- ["C6BD",0x3059],
- ["C6BE",0x305A],
- ["C6BF",0x305B],
- ["C6C0",0x305C],
- ["C6C1",0x305D],
- ["C6C2",0x305E],
- ["C6C3",0x305F],
- ["C6C4",0x3060],
- ["C6C5",0x3061],
- ["C6C6",0x3062],
- ["C6C7",0x3063],
- ["C6C8",0x3064],
- ["C6C9",0x3065],
- ["C6CA",0x3066],
- ["C6CB",0x3067],
- ["C6CC",0x3068],
- ["C6CD",0x3069],
- ["C6CE",0x306A],
- ["C6CF",0x306B],
- ["C6D0",0x306C],
- ["C6D1",0x306D],
- ["C6D2",0x306E],
- ["C6D3",0x306F],
- ["C6D4",0x3070],
- ["C6D5",0x3071],
- ["C6D6",0x3072],
- ["C6D7",0x3073],
- ["C6D8",0x3074],
- ["C6D9",0x3075],
- ["C6DA",0x3076],
- ["C6DB",0x3077],
- ["C6DC",0x3078],
- ["C6DD",0x3079],
- ["C6DE",0x307A],
- ["C6DF",0x307B],
- ["C6E0",0x307C],
- ["C6E1",0x307D],
- ["C6E2",0x307E],
- ["C6E3",0x307F],
- ["C6E4",0x3080],
- ["C6E5",0x3081],
- ["C6E6",0x3082],
- ["C6E7",0x3083],
- ["C6E8",0x3084],
- ["C6E9",0x3085],
- ["C6EA",0x3086],
- ["C6EB",0x3087],
- ["C6EC",0x3088],
- ["C6ED",0x3089],
- ["C6EE",0x308A],
- ["C6EF",0x308B],
- ["C6F0",0x308C],
- ["C6F1",0x308D],
- ["C6F2",0x308E],
- ["C6F3",0x308F],
- ["C6F4",0x3090],
- ["C6F5",0x3091],
- ["C6F6",0x3092],
- ["C6F7",0x3093],
- ["C6A2",0x309D],
- ["C6A3",0x309E],
- ["C6F8",0x30A1],
- ["C6F9",0x30A2],
- ["C6FA",0x30A3],
- ["C6FB",0x30A4],
- ["C6FC",0x30A5],
- ["C6FD",0x30A6],
- ["C6FE",0x30A7],
- ["C740",0x30A8],
- ["C741",0x30A9],
- ["C742",0x30AA],
- ["C743",0x30AB],
- ["C744",0x30AC],
- ["C745",0x30AD],
- ["C746",0x30AE],
- ["C747",0x30AF],
- ["C748",0x30B0],
- ["C749",0x30B1],
- ["C74A",0x30B2],
- ["C74B",0x30B3],
- ["C74C",0x30B4],
- ["C74D",0x30B5],
- ["C74E",0x30B6],
- ["C74F",0x30B7],
- ["C750",0x30B8],
- ["C751",0x30B9],
- ["C752",0x30BA],
- ["C753",0x30BB],
- ["C754",0x30BC],
- ["C755",0x30BD],
- ["C756",0x30BE],
- ["C757",0x30BF],
- ["C758",0x30C0],
- ["C759",0x30C1],
- ["C75A",0x30C2],
- ["C75B",0x30C3],
- ["C75C",0x30C4],
- ["C75D",0x30C5],
- ["C75E",0x30C6],
- ["C75F",0x30C7],
- ["C760",0x30C8],
- ["C761",0x30C9],
- ["C762",0x30CA],
- ["C763",0x30CB],
- ["C764",0x30CC],
- ["C765",0x30CD],
- ["C766",0x30CE],
- ["C767",0x30CF],
- ["C768",0x30D0],
- ["C769",0x30D1],
- ["C76A",0x30D2],
- ["C76B",0x30D3],
- ["C76C",0x30D4],
- ["C76D",0x30D5],
- ["C76E",0x30D6],
- ["C76F",0x30D7],
- ["C770",0x30D8],
- ["C771",0x30D9],
- ["C772",0x30DA],
- ["C773",0x30DB],
- ["C774",0x30DC],
- ["C775",0x30DD],
- ["C776",0x30DE],
- ["C777",0x30DF],
- ["C778",0x30E0],
- ["C779",0x30E1],
- ["C77A",0x30E2],
- ["C77B",0x30E3],
- ["C77C",0x30E4],
- ["C77D",0x30E5],
- ["C77E",0x30E6],
- ["C7A1",0x30E7],
- ["C7A2",0x30E8],
- ["C7A3",0x30E9],
- ["C7A4",0x30EA],
- ["C7A5",0x30EB],
- ["C7A6",0x30EC],
- ["C7A7",0x30ED],
- ["C7A8",0x30EE],
- ["C7A9",0x30EF],
- ["C7AA",0x30F0],
- ["C7AB",0x30F1],
- ["C7AC",0x30F2],
- ["C7AD",0x30F3],
- ["C7AE",0x30F4],
- ["C7AF",0x30F5],
- ["C7B0",0x30F6],
- ["C6A1",0x30FE],
- ["A374",0x3105],
- ["A375",0x3106],
- ["A376",0x3107],
- ["A377",0x3108],
- ["A378",0x3109],
- ["A379",0x310A],
- ["A37A",0x310B],
- ["A37B",0x310C],
- ["A37C",0x310D],
- ["A37D",0x310E],
- ["A37E",0x310F],
- ["A3A1",0x3110],
- ["A3A2",0x3111],
- ["A3A3",0x3112],
- ["A3A4",0x3113],
- ["A3A5",0x3114],
- ["A3A6",0x3115],
- ["A3A7",0x3116],
- ["A3A8",0x3117],
- ["A3A9",0x3118],
- ["A3AA",0x3119],
- ["A3AB",0x311A],
- ["A3AC",0x311B],
- ["A3AD",0x311C],
- ["A3AE",0x311D],
- ["A3AF",0x311E],
- ["A3B0",0x311F],
- ["A3B1",0x3120],
- ["A3B2",0x3121],
- ["A3B3",0x3122],
- ["A3B4",0x3123],
- ["A3B5",0x3124],
- ["A3B6",0x3125],
- ["A3B7",0x3126],
- ["A3B8",0x3127],
- ["A3B9",0x3128],
- ["A3BA",0x3129],
- ["A1C0",0x32A3],
- ["A255",0x338E],
- ["A256",0x338F],
- ["A250",0x339C],
- ["A251",0x339D],
- ["A252",0x339E],
- ["A254",0x33A1],
- ["A257",0x33C4],
- ["A253",0x33CE],
- ["A1EB",0x33D1],
- ["A1EA",0x33D2],
- ["A24F",0x33D5],
- ["A440",0x4E00],
- ["A442",0x4E01],
- ["A443",0x4E03],
- ["C945",0x4E07],
- ["A456",0x4E08],
- ["A454",0x4E09],
- ["A457",0x4E0A],
- ["A455",0x4E0B],
- ["C946",0x4E0C],
- ["A4A3",0x4E0D],
- ["C94F",0x4E0E],
- ["C94D",0x4E0F],
- ["A4A2",0x4E10],
- ["A4A1",0x4E11],
- ["A542",0x4E14],
- ["A541",0x4E15],
- ["A540",0x4E16],
- ["A543",0x4E18],
- ["A4FE",0x4E19],
- ["A5E0",0x4E1E],
- ["A5E1",0x4E1F],
- ["A8C3",0x4E26],
- ["A458",0x4E2B],
- ["A4A4",0x4E2D],
- ["C950",0x4E2E],
- ["A4A5",0x4E30],
- ["C963",0x4E31],
- ["A6EA",0x4E32],
- ["CBB1",0x4E33],
- ["A459",0x4E38],
- ["A4A6",0x4E39],
- ["A544",0x4E3B],
- ["C964",0x4E3C],
- ["C940",0x4E42],
- ["A444",0x4E43],
- ["A45B",0x4E45],
- ["C947",0x4E47],
- ["A45C",0x4E48],
- ["A4A7",0x4E4B],
- ["A545",0x4E4D],
- ["A547",0x4E4E],
- ["A546",0x4E4F],
- ["A5E2",0x4E52],
- ["A5E3",0x4E53],
- ["A8C4",0x4E56],
- ["ADBC",0x4E58],
- ["A441",0x4E59],
- ["C941",0x4E5C],
- ["A445",0x4E5D],
- ["A45E",0x4E5E],
- ["A45D",0x4E5F],
- ["A5E4",0x4E69],
- ["A8C5",0x4E73],
- ["B0AE",0x4E7E],
- ["D44B",0x4E7F],
- ["B6C3",0x4E82],
- ["DCB1",0x4E83],
- ["DCB2",0x4E84],
- ["A446",0x4E86],
- ["A4A9",0x4E88],
- ["A8C6",0x4E8B],
- ["A447",0x4E8C],
- ["C948",0x4E8D],
- ["A45F",0x4E8E],
- ["A4AA",0x4E91],
- ["A4AC",0x4E92],
- ["C951",0x4E93],
- ["A4AD",0x4E94],
- ["A4AB",0x4E95],
- ["A5E5",0x4E99],
- ["A8C7",0x4E9B],
- ["A8C8",0x4E9E],
- ["AB45",0x4E9F],
- ["A460",0x4EA1],
- ["A4AE",0x4EA2],
- ["A5E6",0x4EA4],
- ["A5E8",0x4EA5],
- ["A5E7",0x4EA6],
- ["A6EB",0x4EA8],
- ["A8C9",0x4EAB],
- ["A8CA",0x4EAC],
- ["AB46",0x4EAD],
- ["AB47",0x4EAE],
- ["ADBD",0x4EB3],
- ["DCB3",0x4EB6],
- ["F6D6",0x4EB9],
- ["A448",0x4EBA],
- ["A4B0",0x4EC0],
- ["A4AF",0x4EC1],
- ["C952",0x4EC2],
- ["A4B1",0x4EC3],
- ["A4B7",0x4EC4],
- ["A4B2",0x4EC6],
- ["A4B3",0x4EC7],
- ["C954",0x4EC8],
- ["C953",0x4EC9],
- ["A4B5",0x4ECA],
- ["A4B6",0x4ECB],
- ["A4B4",0x4ECD],
- ["A54A",0x4ED4],
- ["A54B",0x4ED5],
- ["A54C",0x4ED6],
- ["A54D",0x4ED7],
- ["A549",0x4ED8],
- ["A550",0x4ED9],
- ["C96A",0x4EDA],
- ["C966",0x4EDC],
- ["C969",0x4EDD],
- ["A551",0x4EDE],
- ["A561",0x4EDF],
- ["C968",0x4EE1],
- ["A54E",0x4EE3],
- ["A54F",0x4EE4],
- ["A548",0x4EE5],
- ["C965",0x4EE8],
- ["C967",0x4EE9],
- ["A5F5",0x4EF0],
- ["C9B0",0x4EF1],
- ["A5F2",0x4EF2],
- ["A5F6",0x4EF3],
- ["C9BA",0x4EF4],
- ["C9AE",0x4EF5],
- ["A5F3",0x4EF6],
- ["C9B2",0x4EF7],
- ["A5F4",0x4EFB],
- ["A5F7",0x4EFD],
- ["A5E9",0x4EFF],
- ["C9B1",0x4F00],
- ["A5F8",0x4F01],
- ["C9B5",0x4F02],
- ["C9B9",0x4F04],
- ["C9B6",0x4F05],
- ["C9B3",0x4F08],
- ["A5EA",0x4F09],
- ["A5EC",0x4F0A],
- ["A5F9",0x4F0B],
- ["A5EE",0x4F0D],
- ["C9AB",0x4F0E],
- ["A5F1",0x4F0F],
- ["A5EF",0x4F10],
- ["A5F0",0x4F11],
- ["C9BB",0x4F12],
- ["C9B8",0x4F13],
- ["C9AF",0x4F14],
- ["A5ED",0x4F15],
- ["C9AC",0x4F18],
- ["A5EB",0x4F19],
- ["C9B4",0x4F1D],
- ["C9B7",0x4F22],
- ["C9AD",0x4F2C],
- ["CA66",0x4F2D],
- ["A742",0x4F2F],
- ["A6F4",0x4F30],
- ["CA67",0x4F33],
- ["A6F1",0x4F34],
- ["A744",0x4F36],
- ["A6F9",0x4F38],
- ["A6F8",0x4F3A],
- ["CA5B",0x4F3B],
- ["A6FC",0x4F3C],
- ["A6F7",0x4F3D],
- ["CA60",0x4F3E],
- ["CA68",0x4F3F],
- ["CA64",0x4F41],
- ["A6FA",0x4F43],
- ["A6FD",0x4F46],
- ["A6EE",0x4F47],
- ["A747",0x4F48],
- ["CA5D",0x4F49],
- ["CBBD",0x4F4C],
- ["A6EC",0x4F4D],
- ["A743",0x4F4E],
- ["A6ED",0x4F4F],
- ["A6F5",0x4F50],
- ["A6F6",0x4F51],
- ["CA62",0x4F52],
- ["CA5E",0x4F53],
- ["A6FB",0x4F54],
- ["A6F3",0x4F55],
- ["CA5A",0x4F56],
- ["A6EF",0x4F57],
- ["CA65",0x4F58],
- ["A745",0x4F59],
- ["A748",0x4F5A],
- ["A6F2",0x4F5B],
- ["A740",0x4F5C],
- ["A746",0x4F5D],
- ["A6F0",0x4F5E],
- ["CA63",0x4F5F],
- ["A741",0x4F60],
- ["CA69",0x4F61],
- ["CA5C",0x4F62],
- ["A6FE",0x4F63],
- ["CA5F",0x4F64],
- ["CA61",0x4F67],
- ["A8D8",0x4F69],
- ["CBBF",0x4F6A],
- ["CBCB",0x4F6B],
- ["A8D0",0x4F6C],
- ["CBCC",0x4F6E],
- ["A8CB",0x4F6F],
- ["A8D5",0x4F70],
- ["A8CE",0x4F73],
- ["CBB9",0x4F74],
- ["A8D6",0x4F75],
- ["CBB8",0x4F76],
- ["CBBC",0x4F77],
- ["CBC3",0x4F78],
- ["CBC1",0x4F79],
- ["A8DE",0x4F7A],
- ["A8D9",0x4F7B],
- ["CBB3",0x4F7C],
- ["CBB5",0x4F7D],
- ["A8DB",0x4F7E],
- ["A8CF",0x4F7F],
- ["CBB6",0x4F80],
- ["CBC2",0x4F81],
- ["CBC9",0x4F82],
- ["A8D4",0x4F83],
- ["CBBB",0x4F84],
- ["CBB4",0x4F85],
- ["A8D3",0x4F86],
- ["CBB7",0x4F87],
- ["A8D7",0x4F88],
- ["CBBA",0x4F89],
- ["A8D2",0x4F8B],
- ["A8CD",0x4F8D],
- ["A8DC",0x4F8F],
- ["CBC4",0x4F90],
- ["A8DD",0x4F91],
- ["CBC8",0x4F92],
- ["CBC6",0x4F94],
- ["CBCA",0x4F95],
- ["A8DA",0x4F96],
- ["CBBE",0x4F97],
- ["CBB2",0x4F98],
- ["CBC0",0x4F9A],
- ["A8D1",0x4F9B],
- ["CBC5",0x4F9C],
- ["A8CC",0x4F9D],
- ["CBC7",0x4F9E],
- ["AB56",0x4FAE],
- ["AB4A",0x4FAF],
- ["CDE0",0x4FB2],
- ["CDE8",0x4FB3],
- ["AB49",0x4FB5],
- ["AB51",0x4FB6],
- ["AB5D",0x4FB7],
- ["CDEE",0x4FB9],
- ["CDEC",0x4FBA],
- ["CDE7",0x4FBB],
- ["AB4B",0x4FBF],
- ["CDED",0x4FC0],
- ["CDE3",0x4FC1],
- ["AB59",0x4FC2],
- ["AB50",0x4FC3],
- ["AB58",0x4FC4],
- ["CDDE",0x4FC5],
- ["CDEA",0x4FC7],
- ["CDE1",0x4FC9],
- ["AB54",0x4FCA],
- ["CDE2",0x4FCB],
- ["CDDD",0x4FCD],
- ["AB5B",0x4FCE],
- ["AB4E",0x4FCF],
- ["AB57",0x4FD0],
- ["AB4D",0x4FD1],
- ["CDDF",0x4FD3],
- ["CDE4",0x4FD4],
- ["CDEB",0x4FD6],
- ["AB55",0x4FD7],
- ["AB52",0x4FD8],
- ["CDE6",0x4FD9],
- ["AB5A",0x4FDA],
- ["CDE9",0x4FDB],
- ["CDE5",0x4FDC],
- ["AB4F",0x4FDD],
- ["AB5C",0x4FDE],
- ["AB53",0x4FDF],
- ["AB4C",0x4FE0],
- ["AB48",0x4FE1],
- ["CDEF",0x4FEC],
- ["ADD7",0x4FEE],
- ["ADC1",0x4FEF],
- ["ADD1",0x4FF1],
- ["ADD6",0x4FF3],
- ["D0D0",0x4FF4],
- ["D0CF",0x4FF5],
- ["D0D4",0x4FF6],
- ["D0D5",0x4FF7],
- ["ADC4",0x4FF8],
- ["ADCD",0x4FFA],
- ["ADDA",0x4FFE],
- ["ADCE",0x5000],
- ["D0C9",0x5005],
- ["ADC7",0x5006],
- ["D0CA",0x5007],
- ["ADDC",0x5009],
- ["ADD3",0x500B],
- ["ADBE",0x500C],
- ["ADBF",0x500D],
- ["D0DD",0x500E],
- ["B0BF",0x500F],
- ["ADCC",0x5011],
- ["ADCB",0x5012],
- ["D0CB",0x5013],
- ["ADCF",0x5014],
- ["D45B",0x5015],
- ["ADC6",0x5016],
- ["D0D6",0x5017],
- ["ADD5",0x5018],
- ["ADD4",0x5019],
- ["ADCA",0x501A],
- ["D0CE",0x501B],
- ["D0D7",0x501C],
- ["D0C8",0x501E],
- ["ADC9",0x501F],
- ["D0D8",0x5020],
- ["ADD2",0x5021],
- ["D0CC",0x5022],
- ["ADC0",0x5023],
- ["ADC3",0x5025],
- ["ADC2",0x5026],
- ["D0D9",0x5027],
- ["ADD0",0x5028],
- ["ADC5",0x5029],
- ["ADD9",0x502A],
- ["ADDB",0x502B],
- ["D0D3",0x502C],
- ["ADD8",0x502D],
- ["D0DB",0x502F],
- ["D0CD",0x5030],
- ["D0DC",0x5031],
- ["D0D1",0x5033],
- ["D0DA",0x5035],
- ["D0D2",0x5037],
- ["ADC8",0x503C],
- ["D463",0x5040],
- ["D457",0x5041],
- ["B0B3",0x5043],
- ["D45C",0x5045],
- ["D462",0x5046],
- ["B0B2",0x5047],
- ["D455",0x5048],
- ["B0B6",0x5049],
- ["D459",0x504A],
- ["D452",0x504B],
- ["B0B4",0x504C],
- ["D456",0x504D],
- ["B0B9",0x504E],
- ["B0BE",0x504F],
- ["D467",0x5051],
- ["D451",0x5053],
- ["B0BA",0x5055],
- ["D466",0x5057],
- ["B0B5",0x505A],
- ["D458",0x505B],
- ["B0B1",0x505C],
- ["D453",0x505D],
- ["D44F",0x505E],
- ["D45D",0x505F],
- ["D450",0x5060],
- ["D44E",0x5061],
- ["D45A",0x5062],
- ["D460",0x5063],
- ["D461",0x5064],
- ["B0B7",0x5065],
- ["D85B",0x5068],
- ["D45E",0x5069],
- ["D44D",0x506A],
- ["D45F",0x506B],
- ["B0C1",0x506D],
- ["D464",0x506E],
- ["B0C0",0x506F],
- ["D44C",0x5070],
- ["D454",0x5072],
- ["D465",0x5073],
- ["B0BC",0x5074],
- ["B0BB",0x5075],
- ["B0B8",0x5076],
- ["B0BD",0x5077],
- ["B0AF",0x507A],
- ["B0B0",0x507D],
- ["B3C8",0x5080],
- ["D85E",0x5082],
- ["D857",0x5083],
- ["B3C5",0x5085],
- ["D85F",0x5087],
- ["D855",0x508B],
- ["D858",0x508C],
- ["B3C4",0x508D],
- ["D859",0x508E],
- ["B3C7",0x5091],
- ["D85D",0x5092],
- ["D853",0x5094],
- ["D852",0x5095],
- ["B3C9",0x5096],
- ["B3CA",0x5098],
- ["B3C6",0x5099],
- ["B3CB",0x509A],
- ["D851",0x509B],
- ["D85C",0x509C],
- ["D85A",0x509D],
- ["D854",0x509E],
- ["B3C3",0x50A2],
- ["D856",0x50A3],
- ["B6CA",0x50AC],
- ["B6C4",0x50AD],
- ["DCB7",0x50AE],
- ["B6CD",0x50AF],
- ["DCBD",0x50B0],
- ["DCC0",0x50B1],
- ["B6C6",0x50B2],
- ["B6C7",0x50B3],
- ["DCBA",0x50B4],
- ["B6C5",0x50B5],
- ["DCC3",0x50B6],
- ["B6CB",0x50B7],
- ["DCC4",0x50B8],
- ["DCBF",0x50BA],
- ["B6CC",0x50BB],
- ["DCB4",0x50BD],
- ["B6C9",0x50BE],
- ["DCB5",0x50BF],
- ["DCBE",0x50C1],
- ["DCBC",0x50C2],
- ["DCB8",0x50C4],
- ["B6C8",0x50C5],
- ["DCB6",0x50C6],
- ["B6CE",0x50C7],
- ["DCBB",0x50C8],
- ["DCC2",0x50C9],
- ["DCB9",0x50CA],
- ["DCC1",0x50CB],
- ["B9B6",0x50CE],
- ["B9B3",0x50CF],
- ["B9B4",0x50D1],
- ["E0F9",0x50D3],
- ["E0F1",0x50D4],
- ["B9B2",0x50D5],
- ["B9AF",0x50D6],
- ["E0F2",0x50D7],
- ["B9B1",0x50DA],
- ["E0F5",0x50DB],
- ["E0F7",0x50DD],
- ["E0FE",0x50E0],
- ["E0FD",0x50E3],
- ["E0F8",0x50E4],
- ["B9AE",0x50E5],
- ["E0F0",0x50E6],
- ["B9AC",0x50E7],
- ["E0F3",0x50E8],
- ["B9B7",0x50E9],
- ["E0F6",0x50EA],
- ["E0FA",0x50EC],
- ["B9B0",0x50ED],
- ["B9AD",0x50EE],
- ["E0FC",0x50EF],
- ["E0FB",0x50F0],
- ["B9B5",0x50F1],
- ["E0F4",0x50F3],
- ["BBF8",0x50F5],
- ["E4EC",0x50F6],
- ["E4E9",0x50F8],
- ["BBF9",0x50F9],
- ["BBF7",0x50FB],
- ["E4F0",0x50FD],
- ["E4ED",0x50FE],
- ["E4E6",0x50FF],
- ["BBF6",0x5100],
- ["BBFA",0x5102],
- ["E4E7",0x5103],
- ["BBF5",0x5104],
- ["BBFD",0x5105],
- ["E4EA",0x5106],
- ["E4EB",0x5107],
- ["BBFB",0x5108],
- ["BBFC",0x5109],
- ["E4F1",0x510A],
- ["E4EE",0x510B],
- ["E4EF",0x510C],
- ["BEAA",0x5110],
- ["E8F8",0x5111],
- ["BEA7",0x5112],
- ["E8F5",0x5113],
- ["BEA9",0x5114],
- ["BEAB",0x5115],
- ["E8F6",0x5117],
- ["BEA8",0x5118],
- ["E8F7",0x511A],
- ["E8F4",0x511C],
- ["C076",0x511F],
- ["ECBD",0x5120],
- ["C077",0x5121],
- ["ECBB",0x5122],
- ["ECBC",0x5124],
- ["ECBA",0x5125],
- ["ECB9",0x5126],
- ["ECBE",0x5129],
- ["C075",0x512A],
- ["EFB8",0x512D],
- ["EFB9",0x512E],
- ["E4E8",0x5130],
- ["EFB7",0x5131],
- ["C078",0x5132],
- ["C35F",0x5133],
- ["F1EB",0x5134],
- ["F1EC",0x5135],
- ["C4D7",0x5137],
- ["C4D8",0x5138],
- ["F5C1",0x5139],
- ["F5C0",0x513A],
- ["C56C",0x513B],
- ["C56B",0x513C],
- ["F7D0",0x513D],
- ["A449",0x513F],
- ["A461",0x5140],
- ["A4B9",0x5141],
- ["A4B8",0x5143],
- ["A553",0x5144],
- ["A552",0x5145],
- ["A5FC",0x5146],
- ["A5FB",0x5147],
- ["A5FD",0x5148],
- ["A5FA",0x5149],
- ["A74A",0x514B],
- ["A749",0x514C],
- ["A74B",0x514D],
- ["A8E0",0x5152],
- ["A8DF",0x5154],
- ["A8E1",0x5155],
- ["AB5E",0x5157],
- ["A259",0x5159],
- ["D0DE",0x515A],
- ["A25A",0x515B],
- ["B0C2",0x515C],
- ["A25C",0x515D],
- ["A25B",0x515E],
- ["D860",0x515F],
- ["A25D",0x5161],
- ["B9B8",0x5162],
- ["A25E",0x5163],
- ["A44A",0x5165],
- ["A4BA",0x5167],
- ["A5FE",0x5168],
- ["A8E2",0x5169],
- ["A44B",0x516B],
- ["A4BD",0x516C],
- ["A4BB",0x516D],
- ["A4BC",0x516E],
- ["A640",0x5171],
- ["A74C",0x5175],
- ["A8E4",0x5176],
- ["A8E3",0x5177],
- ["A8E5",0x5178],
- ["ADDD",0x517C],
- ["BEAC",0x5180],
- ["C94E",0x5187],
- ["A554",0x5189],
- ["A555",0x518A],
- ["A641",0x518D],
- ["CA6A",0x518F],
- ["AB60",0x5191],
- ["AB5F",0x5192],
- ["D0E0",0x5193],
- ["D0DF",0x5194],
- ["B0C3",0x5195],
- ["A4BE",0x5197],
- ["C955",0x5198],
- ["CBCD",0x519E],
- ["AB61",0x51A0],
- ["ADE0",0x51A2],
- ["ADDE",0x51A4],
- ["ADDF",0x51A5],
- ["BEAD",0x51AA],
- ["A556",0x51AC],
- ["A642",0x51B0],
- ["C9BC",0x51B1],
- ["A74D",0x51B6],
- ["A74E",0x51B7],
- ["CA6B",0x51B9],
- ["CBCE",0x51BC],
- ["A8E6",0x51BD],
- ["CBCF",0x51BE],
- ["D0E2",0x51C4],
- ["D0E3",0x51C5],
- ["ADE3",0x51C6],
- ["D0E4",0x51C8],
- ["D0E1",0x51CA],
- ["ADE4",0x51CB],
- ["ADE2",0x51CC],
- ["ADE1",0x51CD],
- ["D0E5",0x51CE],
- ["D468",0x51D0],
- ["D861",0x51D4],
- ["DCC5",0x51D7],
- ["E140",0x51D8],
- ["BBFE",0x51DC],
- ["BEAE",0x51DD],
- ["E8F9",0x51DE],
- ["A44C",0x51E0],
- ["A45A",0x51E1],
- ["B0C4",0x51F0],
- ["B3CD",0x51F1],
- ["B9B9",0x51F3],
- ["C942",0x51F5],
- ["A4BF",0x51F6],
- ["A559",0x51F8],
- ["A557",0x51F9],
- ["A558",0x51FA],
- ["A8E7",0x51FD],
- ["A44D",0x5200],
- ["A44E",0x5201],
- ["A462",0x5203],
- ["A4C0",0x5206],
- ["A4C1",0x5207],
- ["A4C2",0x5208],
- ["C9BE",0x5209],
- ["A55A",0x520A],
- ["C96B",0x520C],
- ["A646",0x520E],
- ["C9BF",0x5210],
- ["A644",0x5211],
- ["A645",0x5212],
- ["C9BD",0x5213],
- ["A647",0x5216],
- ["A643",0x5217],
- ["CA6C",0x521C],
- ["AAEC",0x521D],
- ["CA6D",0x521E],
- ["CA6E",0x5221],
- ["A750",0x5224],
- ["A74F",0x5225],
- ["A753",0x5228],
- ["A751",0x5229],
- ["A752",0x522A],
- ["A8ED",0x522E],
- ["A8EC",0x5230],
- ["CBD4",0x5231],
- ["CBD1",0x5232],
- ["CBD2",0x5233],
- ["CBD0",0x5235],
- ["A8EE",0x5236],
- ["A8EA",0x5237],
- ["A8E9",0x5238],
- ["A8EB",0x523A],
- ["A8E8",0x523B],
- ["A8EF",0x5241],
- ["AB63",0x5243],
- ["CDF0",0x5244],
- ["CBD3",0x5246],
- ["AB68",0x5247],
- ["CDF1",0x5249],
- ["AB64",0x524A],
- ["AB67",0x524B],
- ["AB66",0x524C],
- ["AB65",0x524D],
- ["AB62",0x524E],
- ["D0E8",0x5252],
- ["ADE7",0x5254],
- ["D0EB",0x5255],
- ["ADE5",0x5256],
- ["D0E7",0x525A],
- ["ADE8",0x525B],
- ["ADE6",0x525C],
- ["ADE9",0x525D],
- ["D0E9",0x525E],
- ["D0EA",0x525F],
- ["D0E6",0x5261],
- ["D0EC",0x5262],
- ["B3D1",0x5269],
- ["B0C5",0x526A],
- ["D469",0x526B],
- ["D46B",0x526C],
- ["D46A",0x526D],
- ["D46C",0x526E],
- ["B0C6",0x526F],
- ["B3CE",0x5272],
- ["B3CF",0x5274],
- ["B3D0",0x5275],
- ["B6D0",0x5277],
- ["DCC7",0x5278],
- ["DCC6",0x527A],
- ["DCC8",0x527B],
- ["DCC9",0x527C],
- ["B6D1",0x527D],
- ["B6CF",0x527F],
- ["E141",0x5280],
- ["E142",0x5281],
- ["B9BB",0x5282],
- ["B9BA",0x5283],
- ["E35A",0x5284],
- ["BC40",0x5287],
- ["BC41",0x5288],
- ["BC42",0x5289],
- ["BC44",0x528A],
- ["E4F2",0x528B],
- ["E4F3",0x528C],
- ["BC43",0x528D],
- ["BEAF",0x5291],
- ["BEB0",0x5293],
- ["F1ED",0x5296],
- ["F5C3",0x5297],
- ["F5C2",0x5298],
- ["F7D1",0x5299],
- ["A44F",0x529B],
- ["A55C",0x529F],
- ["A55B",0x52A0],
- ["A648",0x52A3],
- ["C9C0",0x52A6],
- ["A755",0x52A9],
- ["A756",0x52AA],
- ["A754",0x52AB],
- ["A757",0x52AC],
- ["CA6F",0x52AD],
- ["CA70",0x52AE],
- ["A8F1",0x52BB],
- ["CBD5",0x52BC],
- ["A8F0",0x52BE],
- ["CDF2",0x52C0],
- ["AB6C",0x52C1],
- ["CDF3",0x52C2],
- ["AB6B",0x52C3],
- ["AB69",0x52C7],
- ["AB6A",0x52C9],
- ["D0ED",0x52CD],
- ["B0C7",0x52D2],
- ["D46E",0x52D3],
- ["B0CA",0x52D5],
- ["D46D",0x52D6],
- ["B1E5",0x52D7],
- ["B0C9",0x52D8],
- ["B0C8",0x52D9],
- ["B3D4",0x52DB],
- ["B3D3",0x52DD],
- ["B3D2",0x52DE],
- ["B6D2",0x52DF],
- ["B6D5",0x52E2],
- ["B6D6",0x52E3],
- ["B6D4",0x52E4],
- ["B6D3",0x52E6],
- ["E143",0x52E9],
- ["E144",0x52EB],
- ["E4F5",0x52EF],
- ["BC45",0x52F0],
- ["E4F4",0x52F1],
- ["BEB1",0x52F3],
- ["ECBF",0x52F4],
- ["C079",0x52F5],
- ["F1EE",0x52F7],
- ["C455",0x52F8],
- ["A463",0x52FA],
- ["A4C3",0x52FB],
- ["C956",0x52FC],
- ["A4C4",0x52FE],
- ["A4C5",0x52FF],
- ["A55D",0x5305],
- ["A55E",0x5306],
- ["A649",0x5308],
- ["CA71",0x5309],
- ["CBD6",0x530A],
- ["CBD7",0x530B],
- ["AB6D",0x530D],
- ["D0EE",0x530E],
- ["B0CC",0x530F],
- ["B0CB",0x5310],
- ["D863",0x5311],
- ["D862",0x5312],
- ["A450",0x5315],
- ["A4C6",0x5316],
- ["A55F",0x5317],
- ["B0CD",0x5319],
- ["C943",0x531A],
- ["C96C",0x531C],
- ["A560",0x531D],
- ["C9C2",0x531F],
- ["A64B",0x5320],
- ["A64A",0x5321],
- ["C9C1",0x5322],
- ["A758",0x5323],
- ["ADEA",0x532A],
- ["D46F",0x532D],
- ["B6D7",0x532F],
- ["E145",0x5330],
- ["B9BC",0x5331],
- ["E8FA",0x5334],
- ["F3FD",0x5337],
- ["A4C7",0x5339],
- ["CBD8",0x533C],
- ["CDF4",0x533D],
- ["B0D0",0x533E],
- ["B0CE",0x533F],
- ["B0CF",0x5340],
- ["A451",0x5341],
- ["A464",0x5343],
- ["A2CD",0x5344],
- ["A4CA",0x5345],
- ["A4C9",0x5347],
- ["A4C8",0x5348],
- ["A563",0x5349],
- ["A562",0x534A],
- ["C96D",0x534C],
- ["C9C3",0x534D],
- ["A8F5",0x5351],
- ["A8F2",0x5352],
- ["A8F4",0x5353],
- ["A8F3",0x5354],
- ["AB6E",0x5357],
- ["B3D5",0x535A],
- ["A452",0x535C],
- ["A4CB",0x535E],
- ["A565",0x5360],
- ["A564",0x5361],
- ["CA72",0x5363],
- ["A8F6",0x5366],
- ["C957",0x536C],
- ["A567",0x536E],
- ["A566",0x536F],
- ["A64C",0x5370],
- ["A64D",0x5371],
- ["CA73",0x5372],
- ["A759",0x5373],
- ["A75A",0x5375],
- ["A8F7",0x5377],
- ["A8F8",0x5378],
- ["A8F9",0x5379],
- ["AB6F",0x537B],
- ["CDF5",0x537C],
- ["ADEB",0x537F],
- ["C944",0x5382],
- ["A4CC",0x5384],
- ["C9C4",0x538A],
- ["CA74",0x538E],
- ["CA75",0x538F],
- ["CBD9",0x5392],
- ["CBDA",0x5394],
- ["CDF7",0x5396],
- ["CDF6",0x5397],
- ["CDF9",0x5398],
- ["CDF8",0x5399],
- ["AB70",0x539A],
- ["D470",0x539C],
- ["ADED",0x539D],
- ["D0EF",0x539E],
- ["ADEC",0x539F],
- ["D864",0x53A4],
- ["B3D6",0x53A5],
- ["D865",0x53A7],
- ["E146",0x53AC],
- ["B9BD",0x53AD],
- ["BC46",0x53B2],
- ["F1EF",0x53B4],
- ["C958",0x53B9],
- ["A568",0x53BB],
- ["B0D1",0x53C3],
- ["A453",0x53C8],
- ["A465",0x53C9],
- ["A4CE",0x53CA],
- ["A4CD",0x53CB],
- ["A4CF",0x53CD],
- ["A8FB",0x53D4],
- ["A8FA",0x53D6],
- ["A8FC",0x53D7],
- ["AB71",0x53DB],
- ["ADEE",0x53DF],
- ["E8FB",0x53E1],
- ["C24F",0x53E2],
- ["A466",0x53E3],
- ["A56A",0x53E4],
- ["A579",0x53E5],
- ["A574",0x53E6],
- ["A56F",0x53E8],
- ["A56E",0x53E9],
- ["A575",0x53EA],
- ["A573",0x53EB],
- ["A56C",0x53EC],
- ["A57A",0x53ED],
- ["A56D",0x53EE],
- ["A569",0x53EF],
- ["A578",0x53F0],
- ["A577",0x53F1],
- ["A576",0x53F2],
- ["A56B",0x53F3],
- ["A572",0x53F5],
- ["A571",0x53F8],
- ["A57B",0x53FB],
- ["A570",0x53FC],
- ["A653",0x5401],
- ["A659",0x5403],
- ["A655",0x5404],
- ["A65B",0x5406],
- ["C9C5",0x5407],
- ["A658",0x5408],
- ["A64E",0x5409],
- ["A651",0x540A],
- ["A654",0x540B],
- ["A650",0x540C],
- ["A657",0x540D],
- ["A65A",0x540E],
- ["A64F",0x540F],
- ["A652",0x5410],
- ["A656",0x5411],
- ["A65C",0x5412],
- ["CA7E",0x5418],
- ["CA7B",0x5419],
- ["A767",0x541B],
- ["CA7C",0x541C],
- ["A75B",0x541D],
- ["A75D",0x541E],
- ["A775",0x541F],
- ["A770",0x5420],
- ["CAA5",0x5424],
- ["CA7D",0x5425],
- ["A75F",0x5426],
- ["A761",0x5427],
- ["CAA4",0x5428],
- ["A768",0x5429],
- ["CA78",0x542A],
- ["A774",0x542B],
- ["A776",0x542C],
- ["A75C",0x542D],
- ["A76D",0x542E],
- ["CA76",0x5430],
- ["A773",0x5431],
- ["A764",0x5433],
- ["A76E",0x5435],
- ["A76F",0x5436],
- ["CA77",0x5437],
- ["A76C",0x5438],
- ["A76A",0x5439],
- ["A76B",0x543B],
- ["A771",0x543C],
- ["CAA1",0x543D],
- ["A75E",0x543E],
- ["A772",0x5440],
- ["CAA3",0x5441],
- ["A766",0x5442],
- ["A763",0x5443],
- ["CA7A",0x5445],
- ["A762",0x5446],
- ["CAA6",0x5447],
- ["A765",0x5448],
- ["A769",0x544A],
- ["A760",0x544E],
- ["CAA2",0x544F],
- ["CA79",0x5454],
- ["CBEB",0x5460],
- ["CBEA",0x5461],
- ["A94F",0x5462],
- ["CBED",0x5463],
- ["CBEF",0x5464],
- ["CBE4",0x5465],
- ["CBE7",0x5466],
- ["CBEE",0x5467],
- ["A950",0x5468],
- ["CBE1",0x546B],
- ["CBE5",0x546C],
- ["CBE9",0x546F],
- ["CE49",0x5470],
- ["A94B",0x5471],
- ["CE4D",0x5472],
- ["A8FD",0x5473],
- ["CBE6",0x5474],
- ["A8FE",0x5475],
- ["A94C",0x5476],
- ["A945",0x5477],
- ["A941",0x5478],
- ["CBE2",0x547A],
- ["A944",0x547B],
- ["A949",0x547C],
- ["A952",0x547D],
- ["CBE3",0x547E],
- ["CBDC",0x547F],
- ["A943",0x5480],
- ["CBDD",0x5481],
- ["CBDF",0x5482],
- ["A946",0x5484],
- ["A948",0x5486],
- ["CBDB",0x5487],
- ["CBE0",0x5488],
- ["A951",0x548B],
- ["A94D",0x548C],
- ["CBE8",0x548D],
- ["A953",0x548E],
- ["A94A",0x5490],
- ["CBDE",0x5491],
- ["A947",0x5492],
- ["A942",0x5495],
- ["A940",0x5496],
- ["CBEC",0x5498],
- ["A94E",0x549A],
- ["CE48",0x54A0],
- ["CDFB",0x54A1],
- ["CE4B",0x54A2],
- ["CDFD",0x54A5],
- ["AB78",0x54A6],
- ["ABA8",0x54A7],
- ["AB74",0x54A8],
- ["ABA7",0x54A9],
- ["AB7D",0x54AA],
- ["ABA4",0x54AB],
- ["AB72",0x54AC],
- ["CDFC",0x54AD],
- ["CE43",0x54AE],
- ["ABA3",0x54AF],
- ["CE4F",0x54B0],
- ["ABA5",0x54B1],
- ["AB79",0x54B3],
- ["CE45",0x54B6],
- ["CE42",0x54B7],
- ["AB77",0x54B8],
- ["CDFA",0x54BA],
- ["ABA6",0x54BB],
- ["CE4A",0x54BC],
- ["AB7C",0x54BD],
- ["CE4C",0x54BE],
- ["ABA9",0x54BF],
- ["AB73",0x54C0],
- ["AB7E",0x54C1],
- ["AB7B",0x54C2],
- ["CE40",0x54C3],
- ["ABA1",0x54C4],
- ["CE46",0x54C5],
- ["CE47",0x54C6],
- ["AB7A",0x54C7],
- ["ABA2",0x54C8],
- ["AB76",0x54C9],
- ["AB75",0x54CE],
- ["CDFE",0x54CF],
- ["CE44",0x54D6],
- ["CE4E",0x54DE],
- ["D144",0x54E0],
- ["ADFB",0x54E1],
- ["D0F1",0x54E2],
- ["D0F6",0x54E4],
- ["ADF4",0x54E5],
- ["AE40",0x54E6],
- ["D0F4",0x54E7],
- ["ADEF",0x54E8],
- ["ADF9",0x54E9],
- ["ADFE",0x54EA],
- ["D0FB",0x54EB],
- ["ADFA",0x54ED],
- ["ADFD",0x54EE],
- ["D0FE",0x54F1],
- ["ADF5",0x54F2],
- ["D0F5",0x54F3],
- ["D142",0x54F7],
- ["D143",0x54F8],
- ["ADF7",0x54FA],
- ["D141",0x54FB],
- ["ADF3",0x54FC],
- ["AE43",0x54FD],
- ["D0F8",0x54FF],
- ["ADF1",0x5501],
- ["D146",0x5503],
- ["D0F9",0x5504],
- ["D0FD",0x5505],
- ["ADF6",0x5506],
- ["AE42",0x5507],
- ["D0FA",0x5508],
- ["ADFC",0x5509],
- ["D140",0x550A],
- ["D147",0x550B],
- ["D4A1",0x550C],
- ["D145",0x550E],
- ["AE44",0x550F],
- ["ADF0",0x5510],
- ["D0FC",0x5511],
- ["D0F3",0x5512],
- ["ADF8",0x5514],
- ["D0F2",0x5517],
- ["D0F7",0x551A],
- ["D0F0",0x5526],
- ["AE41",0x5527],
- ["D477",0x552A],
- ["B0E4",0x552C],
- ["D4A7",0x552D],
- ["B0E2",0x552E],
- ["B0DF",0x552F],
- ["D47C",0x5530],
- ["B0DB",0x5531],
- ["D4A2",0x5532],
- ["B0E6",0x5533],
- ["D476",0x5534],
- ["D47B",0x5535],
- ["D47A",0x5536],
- ["ADF2",0x5537],
- ["B0E1",0x5538],
- ["D4A5",0x5539],
- ["D4A8",0x553B],
- ["D473",0x553C],
- ["B3E8",0x553E],
- ["D4A9",0x5540],
- ["B0E7",0x5541],
- ["B0D9",0x5543],
- ["B0D6",0x5544],
- ["D47E",0x5545],
- ["B0D3",0x5546],
- ["D4A6",0x5548],
- ["B0DA",0x554A],
- ["D4AA",0x554B],
- ["D474",0x554D],
- ["D4A4",0x554E],
- ["B0DD",0x554F],
- ["D475",0x5550],
- ["D478",0x5551],
- ["D47D",0x5552],
- ["B0DE",0x5555],
- ["B0DC",0x5556],
- ["B0E8",0x5557],
- ["B0E3",0x555C],
- ["B0D7",0x555E],
- ["B1D2",0x555F],
- ["B0D8",0x5561],
- ["D479",0x5562],
- ["B0E5",0x5563],
- ["B0E0",0x5564],
- ["D4A3",0x5565],
- ["B0D5",0x5566],
- ["B0D4",0x556A],
- ["D471",0x5575],
- ["D472",0x5576],
- ["D86A",0x5577],
- ["B3D7",0x557B],
- ["B3DA",0x557C],
- ["D875",0x557D],
- ["B3EE",0x557E],
- ["D878",0x557F],
- ["B3D8",0x5580],
- ["D871",0x5581],
- ["B3DE",0x5582],
- ["B3E4",0x5583],
- ["B5BD",0x5584],
- ["B3E2",0x5587],
- ["D86E",0x5588],
- ["B3EF",0x5589],
- ["B3DB",0x558A],
- ["B3E3",0x558B],
- ["D876",0x558C],
- ["DCD7",0x558D],
- ["D87B",0x558E],
- ["D86F",0x558F],
- ["D866",0x5591],
- ["D873",0x5592],
- ["D86D",0x5593],
- ["B3E1",0x5594],
- ["D879",0x5595],
- ["B3DD",0x5598],
- ["B3F1",0x5599],
- ["B3EA",0x559A],
- ["B3DF",0x559C],
- ["B3DC",0x559D],
- ["B3E7",0x559F],
- ["D87A",0x55A1],
- ["D86C",0x55A2],
- ["D872",0x55A3],
- ["D874",0x55A4],
- ["D868",0x55A5],
- ["D877",0x55A6],
- ["B3D9",0x55A7],
- ["D867",0x55A8],
- ["B3E0",0x55AA],
- ["B3F0",0x55AB],
- ["B3EC",0x55AC],
- ["D869",0x55AD],
- ["B3E6",0x55AE],
- ["B3ED",0x55B1],
- ["B3E9",0x55B2],
- ["B3E5",0x55B3],
- ["D870",0x55B5],
- ["B3EB",0x55BB],
- ["DCD5",0x55BF],
- ["DCD1",0x55C0],
- ["DCE0",0x55C2],
- ["DCCA",0x55C3],
- ["DCD3",0x55C4],
- ["B6E5",0x55C5],
- ["B6E6",0x55C6],
- ["B6DE",0x55C7],
- ["DCDC",0x55C8],
- ["B6E8",0x55C9],
- ["DCCF",0x55CA],
- ["DCCE",0x55CB],
- ["DCCC",0x55CC],
- ["DCDE",0x55CD],
- ["B6DC",0x55CE],
- ["DCD8",0x55CF],
- ["DCCD",0x55D0],
- ["B6DF",0x55D1],
- ["DCD6",0x55D2],
- ["B6DA",0x55D3],
- ["DCD2",0x55D4],
- ["DCD9",0x55D5],
- ["DCDB",0x55D6],
- ["DCDF",0x55D9],
- ["B6E3",0x55DA],
- ["DCCB",0x55DB],
- ["B6DD",0x55DC],
- ["DCD0",0x55DD],
- ["B6D8",0x55DF],
- ["B6E4",0x55E1],
- ["DCDA",0x55E2],
- ["B6E0",0x55E3],
- ["B6E1",0x55E4],
- ["B6E7",0x55E5],
- ["B6DB",0x55E6],
- ["A25F",0x55E7],
- ["B6D9",0x55E8],
- ["DCD4",0x55E9],
- ["B6E2",0x55EF],
- ["DCDD",0x55F2],
- ["B9CD",0x55F6],
- ["B9C8",0x55F7],
- ["E155",0x55F9],
- ["E151",0x55FA],
- ["E14B",0x55FC],
- ["B9C2",0x55FD],
- ["B9BE",0x55FE],
- ["E154",0x55FF],
- ["B9BF",0x5600],
- ["E14E",0x5601],
- ["E150",0x5602],
- ["E153",0x5604],
- ["B9C4",0x5606],
- ["B9CB",0x5608],
- ["B9C5",0x5609],
- ["E149",0x560C],
- ["B9C6",0x560D],
- ["B9C7",0x560E],
- ["E14C",0x560F],
- ["B9CC",0x5610],
- ["E14A",0x5612],
- ["E14F",0x5613],
- ["B9C3",0x5614],
- ["E148",0x5615],
- ["B9C9",0x5616],
- ["B9C1",0x5617],
- ["B9C0",0x561B],
- ["E14D",0x561C],
- ["E152",0x561D],
- ["B9CA",0x561F],
- ["E147",0x5627],
- ["BC4D",0x5629],
- ["E547",0x562A],
- ["E544",0x562C],
- ["BC47",0x562E],
- ["BC53",0x562F],
- ["BC54",0x5630],
- ["BC4A",0x5632],
- ["E542",0x5633],
- ["BC4C",0x5634],
- ["E4F9",0x5635],
- ["BC52",0x5636],
- ["E546",0x5638],
- ["BC49",0x5639],
- ["E548",0x563A],
- ["BC48",0x563B],
- ["E543",0x563D],
- ["E545",0x563E],
- ["BC4B",0x563F],
- ["E541",0x5640],
- ["E4FA",0x5641],
- ["E4F7",0x5642],
- ["D86B",0x5645],
- ["E4FD",0x5646],
- ["E4F6",0x5648],
- ["E4FC",0x5649],
- ["E4FB",0x564A],
- ["E4F8",0x564C],
- ["BC4F",0x564E],
- ["BC4E",0x5653],
- ["BC50",0x5657],
- ["E4FE",0x5658],
- ["BEB2",0x5659],
- ["E540",0x565A],
- ["E945",0x565E],
- ["E8FD",0x5660],
- ["BEBE",0x5662],
- ["E942",0x5663],
- ["BEB6",0x5664],
- ["BEBA",0x5665],
- ["E941",0x5666],
- ["BEB9",0x5668],
- ["BEB5",0x5669],
- ["BEB8",0x566A],
- ["BEB3",0x566B],
- ["BEBD",0x566C],
- ["E943",0x566D],
- ["E8FE",0x566E],
- ["BEBC",0x566F],
- ["E8FC",0x5670],
- ["BEBB",0x5671],
- ["E944",0x5672],
- ["E940",0x5673],
- ["BC51",0x5674],
- ["BEBF",0x5676],
- ["E946",0x5677],
- ["BEB7",0x5678],
- ["BEB4",0x5679],
- ["ECC6",0x567E],
- ["ECC8",0x567F],
- ["C07B",0x5680],
- ["ECC9",0x5681],
- ["ECC7",0x5682],
- ["ECC5",0x5683],
- ["ECC4",0x5684],
- ["C07D",0x5685],
- ["ECC3",0x5686],
- ["C07E",0x5687],
- ["ECC1",0x568C],
- ["ECC2",0x568D],
- ["C07A",0x568E],
- ["C0A1",0x568F],
- ["C07C",0x5690],
- ["ECC0",0x5693],
- ["C250",0x5695],
- ["EFBC",0x5697],
- ["EFBA",0x5698],
- ["EFBF",0x5699],
- ["EFBD",0x569A],
- ["EFBB",0x569C],
- ["EFBE",0x569D],
- ["C360",0x56A5],
- ["F1F2",0x56A6],
- ["F1F3",0x56A7],
- ["C456",0x56A8],
- ["F1F4",0x56AA],
- ["F1F0",0x56AB],
- ["F1F5",0x56AC],
- ["F1F1",0x56AD],
- ["C251",0x56AE],
- ["F3FE",0x56B2],
- ["F441",0x56B3],
- ["C459",0x56B4],
- ["F440",0x56B5],
- ["C458",0x56B6],
- ["C457",0x56B7],
- ["C45A",0x56BC],
- ["F5C5",0x56BD],
- ["F5C6",0x56BE],
- ["C4DA",0x56C0],
- ["C4D9",0x56C1],
- ["C4DB",0x56C2],
- ["F5C4",0x56C3],
- ["F6D8",0x56C5],
- ["F6D7",0x56C6],
- ["C56D",0x56C8],
- ["C56F",0x56C9],
- ["C56E",0x56CA],
- ["F6D9",0x56CB],
- ["C5C8",0x56CC],
- ["F8A6",0x56CD],
- ["C5F1",0x56D1],
- ["F8A5",0x56D3],
- ["F8EE",0x56D4],
- ["C949",0x56D7],
- ["A57D",0x56DA],
- ["A57C",0x56DB],
- ["A65F",0x56DD],
- ["A65E",0x56DE],
- ["C9C7",0x56DF],
- ["A65D",0x56E0],
- ["C9C6",0x56E1],
- ["A779",0x56E4],
- ["CAA9",0x56E5],
- ["CAA8",0x56E7],
- ["A777",0x56EA],
- ["A77A",0x56EB],
- ["CAA7",0x56EE],
- ["A778",0x56F0],
- ["CBF0",0x56F7],
- ["CBF1",0x56F9],
- ["A954",0x56FA],
- ["ABAA",0x56FF],
- ["D148",0x5701],
- ["D149",0x5702],
- ["AE45",0x5703],
- ["AE46",0x5704],
- ["D4AC",0x5707],
- ["B0E9",0x5708],
- ["B0EB",0x5709],
- ["D4AB",0x570A],
- ["B0EA",0x570B],
- ["D87C",0x570C],
- ["B3F2",0x570D],
- ["B6E9",0x5712],
- ["B6EA",0x5713],
- ["DCE1",0x5714],
- ["B9CF",0x5716],
- ["B9CE",0x5718],
- ["E549",0x571A],
- ["E948",0x571B],
- ["E947",0x571C],
- ["F96B",0x571E],
- ["A467",0x571F],
- ["C959",0x5720],
- ["C96E",0x5722],
- ["C96F",0x5723],
- ["A662",0x5728],
- ["A666",0x5729],
- ["C9C9",0x572A],
- ["A664",0x572C],
- ["A663",0x572D],
- ["C9C8",0x572E],
- ["A665",0x572F],
- ["A661",0x5730],
- ["A660",0x5733],
- ["C9CA",0x5734],
- ["A7A6",0x573B],
- ["A7A3",0x573E],
- ["A77D",0x5740],
- ["CAAA",0x5741],
- ["CAAB",0x5745],
- ["A7A1",0x5747],
- ["CAAD",0x5749],
- ["A77B",0x574A],
- ["CAAE",0x574B],
- ["CAAC",0x574C],
- ["A77E",0x574D],
- ["A7A2",0x574E],
- ["A7A5",0x574F],
- ["A7A4",0x5750],
- ["A77C",0x5751],
- ["CAAF",0x5752],
- ["A959",0x5761],
- ["CBFE",0x5762],
- ["A95B",0x5764],
- ["A95A",0x5766],
- ["CC40",0x5768],
- ["A958",0x5769],
- ["A957",0x576A],
- ["CBF5",0x576B],
- ["CBF4",0x576D],
- ["CBF2",0x576F],
- ["CBF7",0x5770],
- ["CBF6",0x5771],
- ["CBF3",0x5772],
- ["CBFC",0x5773],
- ["CBFD",0x5774],
- ["CBFA",0x5775],
- ["CBF8",0x5776],
- ["A956",0x5777],
- ["CBFB",0x577B],
- ["A95C",0x577C],
- ["CC41",0x577D],
- ["CBF9",0x5780],
- ["ABAB",0x5782],
- ["A955",0x5783],
- ["ABAC",0x578B],
- ["CE54",0x578C],
- ["CE5A",0x578F],
- ["ABB2",0x5793],
- ["CE58",0x5794],
- ["CE5E",0x5795],
- ["CE55",0x5797],
- ["CE59",0x5798],
- ["CE5B",0x5799],
- ["CE5D",0x579A],
- ["CE57",0x579B],
- ["CE56",0x579D],
- ["CE51",0x579E],
- ["CE52",0x579F],
- ["ABAD",0x57A0],
- ["ABAF",0x57A2],
- ["ABAE",0x57A3],
- ["CE53",0x57A4],
- ["CE5C",0x57A5],
- ["ABB1",0x57AE],
- ["CE50",0x57B5],
- ["D153",0x57B6],
- ["D152",0x57B8],
- ["D157",0x57B9],
- ["D14E",0x57BA],
- ["D151",0x57BC],
- ["D150",0x57BD],
- ["D154",0x57BF],
- ["D158",0x57C1],
- ["AE47",0x57C2],
- ["AE4A",0x57C3],
- ["D14F",0x57C6],
- ["D155",0x57C7],
- ["AE49",0x57CB],
- ["D14A",0x57CC],
- ["ABB0",0x57CE],
- ["D4BA",0x57CF],
- ["D156",0x57D0],
- ["D14D",0x57D2],
- ["AE48",0x57D4],
- ["D14C",0x57D5],
- ["D4B1",0x57DC],
- ["B0EC",0x57DF],
- ["B0F0",0x57E0],
- ["D4C1",0x57E1],
- ["D4AF",0x57E2],
- ["D4BD",0x57E3],
- ["B0F1",0x57E4],
- ["D4BF",0x57E5],
- ["D4C5",0x57E7],
- ["D4C9",0x57E9],
- ["D4C0",0x57EC],
- ["D4B4",0x57ED],
- ["D4BC",0x57EE],
- ["D4CA",0x57F0],
- ["D4C8",0x57F1],
- ["D4BE",0x57F2],
- ["D4B9",0x57F3],
- ["D4B2",0x57F4],
- ["D8A6",0x57F5],
- ["D4B0",0x57F6],
- ["B0F5",0x57F7],
- ["D4B7",0x57F8],
- ["B0F6",0x57F9],
- ["B0F2",0x57FA],
- ["D4AD",0x57FB],
- ["D4C3",0x57FC],
- ["D4B5",0x57FD],
- ["D4B3",0x5800],
- ["D4C6",0x5801],
- ["B0F3",0x5802],
- ["D4CC",0x5804],
- ["B0ED",0x5805],
- ["B0EF",0x5806],
- ["D4BB",0x5807],
- ["D4B6",0x5808],
- ["AE4B",0x5809],
- ["B0EE",0x580A],
- ["D4B8",0x580B],
- ["D4C7",0x580C],
- ["D4CB",0x580D],
- ["D4C2",0x580E],
- ["D4C4",0x5810],
- ["D4AE",0x5814],
- ["D8A1",0x5819],
- ["D8AA",0x581B],
- ["D8A9",0x581C],
- ["B3FA",0x581D],
- ["D8A2",0x581E],
- ["B3FB",0x5820],
- ["B3F9",0x5821],
- ["D8A4",0x5823],
- ["B3F6",0x5824],
- ["D8A8",0x5825],
- ["D8A3",0x5827],
- ["D8A5",0x5828],
- ["D87D",0x5829],
- ["B3F4",0x582A],
- ["D8B2",0x582C],
- ["D8B1",0x582D],
- ["D8AE",0x582E],
- ["B3F3",0x582F],
- ["B3F7",0x5830],
- ["B3F8",0x5831],
- ["D14B",0x5832],
- ["D8AB",0x5833],
- ["B3F5",0x5834],
- ["B0F4",0x5835],
- ["D8AD",0x5836],
- ["D87E",0x5837],
- ["D8B0",0x5838],
- ["D8AF",0x5839],
- ["D8B3",0x583B],
- ["DCEF",0x583D],
- ["D8AC",0x583F],
- ["D8A7",0x5848],
- ["DCE7",0x5849],
- ["B6F4",0x584A],
- ["B6F7",0x584B],
- ["B6F2",0x584C],
- ["DCE6",0x584D],
- ["DCEA",0x584E],
- ["DCE5",0x584F],
- ["B6EC",0x5851],
- ["B6F6",0x5852],
- ["DCE2",0x5853],
- ["B6F0",0x5854],
- ["DCE9",0x5855],
- ["B6EE",0x5857],
- ["B6ED",0x5858],
- ["DCEC",0x5859],
- ["B6EF",0x585A],
- ["DCEE",0x585B],
- ["DCEB",0x585D],
- ["B6EB",0x585E],
- ["B6F5",0x5862],
- ["DCF0",0x5863],
- ["DCE4",0x5864],
- ["DCED",0x5865],
- ["DCE3",0x5868],
- ["B6F1",0x586B],
- ["B6F3",0x586D],
- ["DCE8",0x586F],
- ["DCF1",0x5871],
- ["E15D",0x5874],
- ["B9D0",0x5875],
- ["E163",0x5876],
- ["B9D5",0x5879],
- ["E15F",0x587A],
- ["E166",0x587B],
- ["E157",0x587C],
- ["B9D7",0x587D],
- ["B9D1",0x587E],
- ["E15C",0x587F],
- ["BC55",0x5880],
- ["E15B",0x5881],
- ["E164",0x5882],
- ["B9D2",0x5883],
- ["B9D6",0x5885],
- ["E15A",0x5886],
- ["E160",0x5887],
- ["E165",0x5888],
- ["E156",0x5889],
- ["B9D4",0x588A],
- ["E15E",0x588B],
- ["E162",0x588E],
- ["E168",0x588F],
- ["E158",0x5890],
- ["E161",0x5891],
- ["B9D3",0x5893],
- ["E167",0x5894],
- ["E159",0x5898],
- ["BC59",0x589C],
- ["E54B",0x589D],
- ["BC57",0x589E],
- ["BC56",0x589F],
- ["E54D",0x58A0],
- ["E552",0x58A1],
- ["E54E",0x58A3],
- ["E551",0x58A5],
- ["BC5C",0x58A6],
- ["BEA5",0x58A8],
- ["BC5B",0x58A9],
- ["E54A",0x58AB],
- ["E550",0x58AC],
- ["BC5A",0x58AE],
- ["E54F",0x58AF],
- ["E54C",0x58B1],
- ["BC58",0x58B3],
- ["E94D",0x58BA],
- ["E94F",0x58BC],
- ["E94A",0x58BD],
- ["BEC1",0x58BE],
- ["E94C",0x58BF],
- ["BEC0",0x58C1],
- ["E94E",0x58C2],
- ["BEC3",0x58C5],
- ["E950",0x58C6],
- ["BEC2",0x58C7],
- ["E949",0x58C8],
- ["E94B",0x58C9],
- ["C0A5",0x58CE],
- ["ECCC",0x58CF],
- ["C0A4",0x58D1],
- ["ECCD",0x58D2],
- ["C0A3",0x58D3],
- ["ECCB",0x58D4],
- ["C0A2",0x58D5],
- ["ECCA",0x58D6],
- ["C253",0x58D8],
- ["C252",0x58D9],
- ["F1F6",0x58DA],
- ["F1F8",0x58DB],
- ["F1F7",0x58DD],
- ["C361",0x58DE],
- ["C362",0x58DF],
- ["C363",0x58E2],
- ["F442",0x58E3],
- ["C45B",0x58E4],
- ["F7D3",0x58E7],
- ["F7D2",0x58E8],
- ["C5F2",0x58E9],
- ["A468",0x58EB],
- ["A4D0",0x58EC],
- ["A7A7",0x58EF],
- ["CE5F",0x58F4],
- ["B3FC",0x58F9],
- ["B3FD",0x58FA],
- ["DCF2",0x58FC],
- ["B9D8",0x58FD],
- ["E169",0x58FE],
- ["E553",0x58FF],
- ["C95A",0x5903],
- ["CAB0",0x5906],
- ["CC42",0x590C],
- ["CE60",0x590D],
- ["D159",0x590E],
- ["AE4C",0x590F],
- ["F1F9",0x5912],
- ["C4DC",0x5914],
- ["A469",0x5915],
- ["A57E",0x5916],
- ["C970",0x5917],
- ["A667",0x5919],
- ["A668",0x591A],
- ["A95D",0x591C],
- ["B0F7",0x5920],
- ["B9DA",0x5922],
- ["B9DB",0x5924],
- ["B9D9",0x5925],
- ["A46A",0x5927],
- ["A4D1",0x5929],
- ["A4D3",0x592A],
- ["A4D2",0x592B],
- ["C95B",0x592C],
- ["A4D4",0x592D],
- ["A5A1",0x592E],
- ["C971",0x592F],
- ["A5A2",0x5931],
- ["A669",0x5937],
- ["A66A",0x5938],
- ["C9CB",0x593C],
- ["A7A8",0x593E],
- ["CAB1",0x5940],
- ["A961",0x5944],
- ["CC43",0x5945],
- ["A95F",0x5947],
- ["A960",0x5948],
- ["A95E",0x5949],
- ["D15A",0x594A],
- ["ABB6",0x594E],
- ["ABB5",0x594F],
- ["ABB7",0x5950],
- ["ABB4",0x5951],
- ["CE61",0x5953],
- ["A962",0x5954],
- ["ABB3",0x5955],
- ["AE4D",0x5957],
- ["AE4E",0x5958],
- ["AE4F",0x595A],
- ["D4CD",0x595C],
- ["B3FE",0x5960],
- ["D8B4",0x5961],
- ["B0F8",0x5962],
- ["B6F8",0x5967],
- ["B9DD",0x5969],
- ["B9DC",0x596A],
- ["E16A",0x596B],
- ["BC5D",0x596D],
- ["BEC4",0x596E],
- ["EFC0",0x5970],
- ["F6DA",0x5971],
- ["F7D4",0x5972],
- ["A46B",0x5973],
- ["A5A3",0x5974],
- ["A5A4",0x5976],
- ["C9D1",0x5977],
- ["A66C",0x5978],
- ["A66F",0x5979],
- ["C9CF",0x597B],
- ["C9CD",0x597C],
- ["A66E",0x597D],
- ["C9D0",0x597E],
- ["C9D2",0x597F],
- ["C9CC",0x5980],
- ["A671",0x5981],
- ["A670",0x5982],
- ["A66D",0x5983],
- ["A66B",0x5984],
- ["C9CE",0x5985],
- ["A7B3",0x598A],
- ["A7B0",0x598D],
- ["CAB6",0x598E],
- ["CAB9",0x598F],
- ["CAB8",0x5990],
- ["A7AA",0x5992],
- ["A7B2",0x5993],
- ["A7AF",0x5996],
- ["CAB5",0x5997],
- ["CAB3",0x5998],
- ["A7AE",0x5999],
- ["A7A9",0x599D],
- ["A7AC",0x599E],
- ["CAB4",0x59A0],
- ["CABB",0x59A1],
- ["CAB7",0x59A2],
- ["A7AD",0x59A3],
- ["A7B1",0x59A4],
- ["A7B4",0x59A5],
- ["CAB2",0x59A6],
- ["CABA",0x59A7],
- ["A7AB",0x59A8],
- ["A967",0x59AE],
- ["A96F",0x59AF],
- ["CC4F",0x59B1],
- ["CC48",0x59B2],
- ["A970",0x59B3],
- ["CC53",0x59B4],
- ["CC44",0x59B5],
- ["CC4B",0x59B6],
- ["A966",0x59B9],
- ["CC45",0x59BA],
- ["A964",0x59BB],
- ["CC4C",0x59BC],
- ["CC50",0x59BD],
- ["A963",0x59BE],
- ["CC51",0x59C0],
- ["CC4A",0x59C1],
- ["CC4D",0x59C3],
- ["A972",0x59C5],
- ["A969",0x59C6],
- ["CC54",0x59C7],
- ["CC52",0x59C8],
- ["A96E",0x59CA],
- ["A96C",0x59CB],
- ["CC49",0x59CC],
- ["A96B",0x59CD],
- ["CC47",0x59CE],
- ["CC46",0x59CF],
- ["A96A",0x59D0],
- ["A968",0x59D1],
- ["A971",0x59D2],
- ["A96D",0x59D3],
- ["A965",0x59D4],
- ["CC4E",0x59D6],
- ["ABB9",0x59D8],
- ["ABC0",0x59DA],
- ["CE6F",0x59DB],
- ["ABB8",0x59DC],
- ["CE67",0x59DD],
- ["CE63",0x59DE],
- ["CE73",0x59E0],
- ["CE62",0x59E1],
- ["ABBB",0x59E3],
- ["CE6C",0x59E4],
- ["ABBE",0x59E5],
- ["ABC1",0x59E6],
- ["ABBC",0x59E8],
- ["CE70",0x59E9],
- ["ABBF",0x59EA],
- ["AE56",0x59EC],
- ["CE76",0x59ED],
- ["CE64",0x59EE],
- ["CE66",0x59F1],
- ["CE6D",0x59F2],
- ["CE71",0x59F3],
- ["CE75",0x59F4],
- ["CE72",0x59F5],
- ["CE6B",0x59F6],
- ["CE6E",0x59F7],
- ["CE68",0x59FA],
- ["ABC3",0x59FB],
- ["CE6A",0x59FC],
- ["CE69",0x59FD],
- ["CE74",0x59FE],
- ["ABBA",0x59FF],
- ["CE65",0x5A00],
- ["ABC2",0x5A01],
- ["ABBD",0x5A03],
- ["AE5C",0x5A09],
- ["D162",0x5A0A],
- ["AE5B",0x5A0C],
- ["D160",0x5A0F],
- ["AE50",0x5A11],
- ["AE55",0x5A13],
- ["D15F",0x5A15],
- ["D15C",0x5A16],
- ["D161",0x5A17],
- ["AE51",0x5A18],
- ["D15B",0x5A19],
- ["AE54",0x5A1B],
- ["AE52",0x5A1C],
- ["D163",0x5A1E],
- ["AE53",0x5A1F],
- ["AE57",0x5A20],
- ["AE58",0x5A23],
- ["AE5A",0x5A25],
- ["AE59",0x5A29],
- ["D15D",0x5A2D],
- ["D15E",0x5A2E],
- ["D164",0x5A33],
- ["D4D4",0x5A35],
- ["B0F9",0x5A36],
- ["D8C2",0x5A37],
- ["D4D3",0x5A38],
- ["D4E6",0x5A39],
- ["B140",0x5A3C],
- ["D4E4",0x5A3E],
- ["B0FE",0x5A40],
- ["B0FA",0x5A41],
- ["D4ED",0x5A42],
- ["D4DD",0x5A43],
- ["D4E0",0x5A44],
- ["B143",0x5A46],
- ["D4EA",0x5A47],
- ["D4E2",0x5A48],
- ["B0FB",0x5A49],
- ["B144",0x5A4A],
- ["D4E7",0x5A4C],
- ["D4E5",0x5A4D],
- ["D4D6",0x5A50],
- ["D4EB",0x5A51],
- ["D4DF",0x5A52],
- ["D4DA",0x5A53],
- ["D4D0",0x5A55],
- ["D4EC",0x5A56],
- ["D4DC",0x5A57],
- ["D4CF",0x5A58],
- ["B142",0x5A5A],
- ["D4E1",0x5A5B],
- ["D4EE",0x5A5C],
- ["D4DE",0x5A5D],
- ["D4D2",0x5A5E],
- ["D4D7",0x5A5F],
- ["D4CE",0x5A60],
- ["B141",0x5A62],
- ["D4DB",0x5A64],
- ["D4D8",0x5A65],
- ["B0FC",0x5A66],
- ["D4D1",0x5A67],
- ["D4E9",0x5A69],
- ["B0FD",0x5A6A],
- ["D4D9",0x5A6C],
- ["D4D5",0x5A6D],
- ["D4E8",0x5A70],
- ["B440",0x5A77],
- ["D8BB",0x5A78],
- ["D8B8",0x5A7A],
- ["D8C9",0x5A7B],
- ["D8BD",0x5A7C],
- ["D8CA",0x5A7D],
- ["B442",0x5A7F],
- ["D8C6",0x5A83],
- ["D8C3",0x5A84],
- ["D8C4",0x5A8A],
- ["D8C7",0x5A8B],
- ["D8CB",0x5A8C],
- ["D4E3",0x5A8E],
- ["D8CD",0x5A8F],
- ["DD47",0x5A90],
- ["B443",0x5A92],
- ["D8CE",0x5A93],
- ["D8B6",0x5A94],
- ["D8C0",0x5A95],
- ["D8C5",0x5A97],
- ["B441",0x5A9A],
- ["B444",0x5A9B],
- ["D8CC",0x5A9C],
- ["D8CF",0x5A9D],
- ["D8BA",0x5A9E],
- ["D8B7",0x5A9F],
- ["D8B9",0x5AA2],
- ["D8BE",0x5AA5],
- ["D8BC",0x5AA6],
- ["B445",0x5AA7],
- ["D8C8",0x5AA9],
- ["D8BF",0x5AAC],
- ["D8C1",0x5AAE],
- ["D8B5",0x5AAF],
- ["DCFA",0x5AB0],
- ["DCF8",0x5AB1],
- ["B742",0x5AB2],
- ["B740",0x5AB3],
- ["DD43",0x5AB4],
- ["DCF9",0x5AB5],
- ["DD44",0x5AB6],
- ["DD40",0x5AB7],
- ["DCF7",0x5AB8],
- ["DD46",0x5AB9],
- ["DCF6",0x5ABA],
- ["DCFD",0x5ABB],
- ["B6FE",0x5ABC],
- ["B6FD",0x5ABD],
- ["B6FC",0x5ABE],
- ["DCFB",0x5ABF],
- ["DD41",0x5AC0],
- ["B6F9",0x5AC1],
- ["B741",0x5AC2],
- ["DCF4",0x5AC4],
- ["DCFE",0x5AC6],
- ["DCF3",0x5AC7],
- ["DCFC",0x5AC8],
- ["B6FA",0x5AC9],
- ["DD42",0x5ACA],
- ["DCF5",0x5ACB],
- ["B6FB",0x5ACC],
- ["DD45",0x5ACD],
- ["E16E",0x5AD5],
- ["B9E2",0x5AD6],
- ["B9E1",0x5AD7],
- ["B9E3",0x5AD8],
- ["E17A",0x5AD9],
- ["E170",0x5ADA],
- ["E176",0x5ADB],
- ["E16B",0x5ADC],
- ["E179",0x5ADD],
- ["E178",0x5ADE],
- ["E17C",0x5ADF],
- ["E175",0x5AE0],
- ["B9DE",0x5AE1],
- ["E174",0x5AE2],
- ["B9E4",0x5AE3],
- ["E16D",0x5AE5],
- ["B9DF",0x5AE6],
- ["E17B",0x5AE8],
- ["B9E0",0x5AE9],
- ["E16F",0x5AEA],
- ["E172",0x5AEB],
- ["E177",0x5AEC],
- ["E171",0x5AED],
- ["E16C",0x5AEE],
- ["E173",0x5AF3],
- ["E555",0x5AF4],
- ["BC61",0x5AF5],
- ["E558",0x5AF6],
- ["E557",0x5AF7],
- ["E55A",0x5AF8],
- ["E55C",0x5AF9],
- ["BC5F",0x5AFB],
- ["E556",0x5AFD],
- ["E554",0x5AFF],
- ["E55D",0x5B01],
- ["E55B",0x5B02],
- ["E559",0x5B03],
- ["E55F",0x5B05],
- ["E55E",0x5B07],
- ["BC63",0x5B08],
- ["BC5E",0x5B09],
- ["BC60",0x5B0B],
- ["BC62",0x5B0C],
- ["E560",0x5B0F],
- ["E957",0x5B10],
- ["E956",0x5B13],
- ["E955",0x5B14],
- ["E958",0x5B16],
- ["E951",0x5B17],
- ["E952",0x5B19],
- ["E95A",0x5B1A],
- ["E953",0x5B1B],
- ["BEC5",0x5B1D],
- ["E95C",0x5B1E],
- ["E95B",0x5B20],
- ["E954",0x5B21],
- ["ECD1",0x5B23],
- ["C0A8",0x5B24],
- ["ECCF",0x5B25],
- ["ECD4",0x5B26],
- ["ECD3",0x5B27],
- ["E959",0x5B28],
- ["C0A7",0x5B2A],
- ["ECD2",0x5B2C],
- ["ECCE",0x5B2D],
- ["ECD6",0x5B2E],
- ["ECD5",0x5B2F],
- ["C0A6",0x5B30],
- ["ECD0",0x5B32],
- ["BEC6",0x5B34],
- ["C254",0x5B38],
- ["EFC1",0x5B3C],
- ["F1FA",0x5B3D],
- ["F1FB",0x5B3E],
- ["F1FC",0x5B3F],
- ["C45C",0x5B40],
- ["C45D",0x5B43],
- ["F443",0x5B45],
- ["F5C8",0x5B47],
- ["F5C7",0x5B48],
- ["F6DB",0x5B4B],
- ["F6DC",0x5B4C],
- ["F7D5",0x5B4D],
- ["F8A7",0x5B4E],
- ["A46C",0x5B50],
- ["A46D",0x5B51],
- ["A46E",0x5B53],
- ["A4D5",0x5B54],
- ["A5A5",0x5B55],
- ["C9D3",0x5B56],
- ["A672",0x5B57],
- ["A673",0x5B58],
- ["A7B7",0x5B5A],
- ["A7B8",0x5B5B],
- ["A7B6",0x5B5C],
- ["A7B5",0x5B5D],
- ["A973",0x5B5F],
- ["CC55",0x5B62],
- ["A975",0x5B63],
- ["A974",0x5B64],
- ["CC56",0x5B65],
- ["ABC4",0x5B69],
- ["AE5D",0x5B6B],
- ["D165",0x5B6C],
- ["D4F0",0x5B6E],
- ["B145",0x5B70],
- ["B447",0x5B71],
- ["D4EF",0x5B72],
- ["B446",0x5B73],
- ["B9E5",0x5B75],
- ["E17D",0x5B77],
- ["BEC7",0x5B78],
- ["C0A9",0x5B7A],
- ["ECD7",0x5B7B],
- ["C45E",0x5B7D],
- ["C570",0x5B7F],
- ["C972",0x5B81],
- ["A5A6",0x5B83],
- ["C973",0x5B84],
- ["A676",0x5B85],
- ["A674",0x5B87],
- ["A675",0x5B88],
- ["A677",0x5B89],
- ["A7BA",0x5B8B],
- ["A7B9",0x5B8C],
- ["CABC",0x5B8E],
- ["A7BB",0x5B8F],
- ["CABD",0x5B92],
- ["CC57",0x5B93],
- ["CC58",0x5B95],
- ["A976",0x5B97],
- ["A978",0x5B98],
- ["A97A",0x5B99],
- ["A977",0x5B9A],
- ["A97B",0x5B9B],
- ["A979",0x5B9C],
- ["ABC8",0x5BA2],
- ["ABC5",0x5BA3],
- ["ABC7",0x5BA4],
- ["ABC9",0x5BA5],
- ["ABC6",0x5BA6],
- ["D166",0x5BA7],
- ["CE77",0x5BA8],
- ["D168",0x5BAC],
- ["D167",0x5BAD],
- ["AE63",0x5BAE],
- ["AE5F",0x5BB0],
- ["AE60",0x5BB3],
- ["AE62",0x5BB4],
- ["AE64",0x5BB5],
- ["AE61",0x5BB6],
- ["AE66",0x5BB8],
- ["AE65",0x5BB9],
- ["B14A",0x5BBF],
- ["D4F2",0x5BC0],
- ["D4F1",0x5BC1],
- ["B149",0x5BC2],
- ["B148",0x5BC4],
- ["B147",0x5BC5],
- ["B14B",0x5BC6],
- ["B146",0x5BC7],
- ["D8D5",0x5BCA],
- ["D8D2",0x5BCB],
- ["B449",0x5BCC],
- ["D8D1",0x5BCD],
- ["D8D6",0x5BCE],
- ["B44B",0x5BD0],
- ["D8D4",0x5BD1],
- ["B448",0x5BD2],
- ["B44A",0x5BD3],
- ["D8D3",0x5BD4],
- ["DD48",0x5BD6],
- ["DD49",0x5BD8],
- ["DD4A",0x5BD9],
- ["B9E6",0x5BDE],
- ["B9EE",0x5BDF],
- ["E17E",0x5BE0],
- ["B9E8",0x5BE1],
- ["B9EC",0x5BE2],
- ["E1A1",0x5BE3],
- ["B9ED",0x5BE4],
- ["B9E9",0x5BE5],
- ["B9EA",0x5BE6],
- ["B9E7",0x5BE7],
- ["B9EB",0x5BE8],
- ["BC66",0x5BE9],
- ["D8D0",0x5BEA],
- ["BC67",0x5BEB],
- ["BC65",0x5BEC],
- ["BC64",0x5BEE],
- ["E95D",0x5BEF],
- ["BEC8",0x5BF0],
- ["ECD8",0x5BF1],
- ["ECD9",0x5BF2],
- ["C364",0x5BF5],
- ["C45F",0x5BF6],
- ["A46F",0x5BF8],
- ["A678",0x5BFA],
- ["ABCA",0x5C01],
- ["D169",0x5C03],
- ["AE67",0x5C04],
- ["B14E",0x5C07],
- ["B14D",0x5C08],
- ["B14C",0x5C09],
- ["B44C",0x5C0A],
- ["B44D",0x5C0B],
- ["D8D7",0x5C0C],
- ["B9EF",0x5C0D],
- ["BEC9",0x5C0E],
- ["A470",0x5C0F],
- ["C95C",0x5C10],
- ["A4D6",0x5C11],
- ["C974",0x5C12],
- ["C9D4",0x5C15],
- ["A679",0x5C16],
- ["A97C",0x5C1A],
- ["DD4B",0x5C1F],
- ["A471",0x5C22],
- ["A4D7",0x5C24],
- ["C9D5",0x5C25],
- ["CABE",0x5C28],
- ["CABF",0x5C2A],
- ["A7BC",0x5C2C],
- ["D8D8",0x5C30],
- ["B44E",0x5C31],
- ["DD4C",0x5C33],
- ["C0AA",0x5C37],
- ["A472",0x5C38],
- ["A4A8",0x5C39],
- ["A4D8",0x5C3A],
- ["C975",0x5C3B],
- ["A5A7",0x5C3C],
- ["A7C0",0x5C3E],
- ["A7BF",0x5C3F],
- ["A7BD",0x5C40],
- ["A7BE",0x5C41],
- ["CC59",0x5C44],
- ["A97E",0x5C45],
- ["A9A1",0x5C46],
- ["CC5A",0x5C47],
- ["A97D",0x5C48],
- ["ABCE",0x5C4B],
- ["CE78",0x5C4C],
- ["ABCD",0x5C4D],
- ["ABCB",0x5C4E],
- ["ABCC",0x5C4F],
- ["AE6A",0x5C50],
- ["AE68",0x5C51],
- ["D16B",0x5C54],
- ["AE69",0x5C55],
- ["D16A",0x5C56],
- ["AE5E",0x5C58],
- ["D4F3",0x5C59],
- ["B150",0x5C5C],
- ["B151",0x5C5D],
- ["B14F",0x5C60],
- ["B9F0",0x5C62],
- ["E1A2",0x5C63],
- ["BC68",0x5C64],
- ["BC69",0x5C65],
- ["E561",0x5C67],
- ["C0AB",0x5C68],
- ["EFC2",0x5C69],
- ["EFC3",0x5C6A],
- ["C4DD",0x5C6C],
- ["F8A8",0x5C6D],
- ["C94B",0x5C6E],
- ["A4D9",0x5C6F],
- ["A473",0x5C71],
- ["C977",0x5C73],
- ["C976",0x5C74],
- ["A67A",0x5C79],
- ["C9D7",0x5C7A],
- ["C9D8",0x5C7B],
- ["C9D6",0x5C7C],
- ["C9D9",0x5C7E],
- ["CAC7",0x5C86],
- ["CAC2",0x5C88],
- ["CAC4",0x5C89],
- ["CAC6",0x5C8A],
- ["CAC3",0x5C8B],
- ["A7C4",0x5C8C],
- ["CAC0",0x5C8D],
- ["CAC1",0x5C8F],
- ["A7C1",0x5C90],
- ["A7C2",0x5C91],
- ["CAC5",0x5C92],
- ["CAC8",0x5C93],
- ["A7C3",0x5C94],
- ["CAC9",0x5C95],
- ["CC68",0x5C9D],
- ["CC62",0x5C9F],
- ["CC5D",0x5CA0],
- ["A9A3",0x5CA1],
- ["CC65",0x5CA2],
- ["CC63",0x5CA3],
- ["CC5C",0x5CA4],
- ["CC69",0x5CA5],
- ["CC6C",0x5CA6],
- ["CC67",0x5CA7],
- ["CC60",0x5CA8],
- ["A9A5",0x5CA9],
- ["CC66",0x5CAA],
- ["A9A6",0x5CAB],
- ["CC61",0x5CAC],
- ["CC64",0x5CAD],
- ["CC5B",0x5CAE],
- ["CC5F",0x5CAF],
- ["CC6B",0x5CB0],
- ["A9A7",0x5CB1],
- ["A9A8",0x5CB3],
- ["CC5E",0x5CB5],
- ["CC6A",0x5CB6],
- ["A9A2",0x5CB7],
- ["A9A4",0x5CB8],
- ["CEAB",0x5CC6],
- ["CEA4",0x5CC7],
- ["CEAA",0x5CC8],
- ["CEA3",0x5CC9],
- ["CEA5",0x5CCA],
- ["CE7D",0x5CCB],
- ["CE7B",0x5CCC],
- ["CEAC",0x5CCE],
- ["CEA9",0x5CCF],
- ["CE79",0x5CD0],
- ["ABD0",0x5CD2],
- ["CEA7",0x5CD3],
- ["CEA8",0x5CD4],
- ["CEA6",0x5CD6],
- ["CE7C",0x5CD7],
- ["CE7A",0x5CD8],
- ["ABCF",0x5CD9],
- ["CEA2",0x5CDA],
- ["CE7E",0x5CDB],
- ["CEA1",0x5CDE],
- ["CEAD",0x5CDF],
- ["AE6F",0x5CE8],
- ["AE6E",0x5CEA],
- ["D16C",0x5CEC],
- ["AE6B",0x5CED],
- ["D16E",0x5CEE],
- ["AE70",0x5CF0],
- ["D16F",0x5CF1],
- ["AE73",0x5CF4],
- ["AE71",0x5CF6],
- ["D170",0x5CF7],
- ["CEAE",0x5CF8],
- ["D172",0x5CF9],
- ["AE6D",0x5CFB],
- ["AE6C",0x5CFD],
- ["D16D",0x5CFF],
- ["D171",0x5D00],
- ["AE72",0x5D01],
- ["B153",0x5D06],
- ["B152",0x5D07],
- ["D4F5",0x5D0B],
- ["D4F9",0x5D0C],
- ["D4FB",0x5D0D],
- ["B154",0x5D0E],
- ["D4FE",0x5D0F],
- ["B158",0x5D11],
- ["D541",0x5D12],
- ["B15A",0x5D14],
- ["B156",0x5D16],
- ["B15E",0x5D17],
- ["B15B",0x5D19],
- ["D4F7",0x5D1A],
- ["B155",0x5D1B],
- ["D4F6",0x5D1D],
- ["D4F4",0x5D1E],
- ["D543",0x5D1F],
- ["D4F8",0x5D20],
- ["B157",0x5D22],
- ["D542",0x5D23],
- ["B15C",0x5D24],
- ["D4FD",0x5D25],
- ["D4FC",0x5D26],
- ["B15D",0x5D27],
- ["D4FA",0x5D28],
- ["B159",0x5D29],
- ["D544",0x5D2E],
- ["D540",0x5D30],
- ["D8E7",0x5D31],
- ["D8EE",0x5D32],
- ["D8E3",0x5D33],
- ["B451",0x5D34],
- ["D8DF",0x5D35],
- ["D8EF",0x5D36],
- ["D8D9",0x5D37],
- ["D8EC",0x5D38],
- ["D8EA",0x5D39],
- ["D8E4",0x5D3A],
- ["D8ED",0x5D3C],
- ["D8E6",0x5D3D],
- ["D8DE",0x5D3F],
- ["D8F0",0x5D40],
- ["D8DC",0x5D41],
- ["D8E9",0x5D42],
- ["D8DA",0x5D43],
- ["D8F1",0x5D45],
- ["B452",0x5D47],
- ["D8EB",0x5D49],
- ["DD4F",0x5D4A],
- ["D8DD",0x5D4B],
- ["B44F",0x5D4C],
- ["D8E1",0x5D4E],
- ["B450",0x5D50],
- ["D8E0",0x5D51],
- ["D8E5",0x5D52],
- ["D8E2",0x5D55],
- ["D8E8",0x5D59],
- ["DD53",0x5D5E],
- ["DD56",0x5D62],
- ["DD4E",0x5D63],
- ["DD50",0x5D65],
- ["DD55",0x5D67],
- ["DD54",0x5D68],
- ["B743",0x5D69],
- ["D8DB",0x5D6B],
- ["DD52",0x5D6C],
- ["B744",0x5D6F],
- ["DD4D",0x5D71],
- ["DD51",0x5D72],
- ["E1A9",0x5D77],
- ["E1B0",0x5D79],
- ["E1A7",0x5D7A],
- ["E1AE",0x5D7C],
- ["E1A5",0x5D7D],
- ["E1AD",0x5D7E],
- ["E1B1",0x5D7F],
- ["E1A4",0x5D80],
- ["E1A8",0x5D81],
- ["E1A3",0x5D82],
- ["B9F1",0x5D84],
- ["E1A6",0x5D86],
- ["B9F2",0x5D87],
- ["E1AC",0x5D88],
- ["E1AB",0x5D89],
- ["E1AA",0x5D8A],
- ["E1AF",0x5D8D],
- ["E565",0x5D92],
- ["E567",0x5D93],
- ["BC6B",0x5D94],
- ["E568",0x5D95],
- ["E563",0x5D97],
- ["E562",0x5D99],
- ["E56C",0x5D9A],
- ["E56A",0x5D9C],
- ["BC6A",0x5D9D],
- ["E56D",0x5D9E],
- ["E564",0x5D9F],
- ["E569",0x5DA0],
- ["E56B",0x5DA1],
- ["E566",0x5DA2],
- ["E961",0x5DA7],
- ["E966",0x5DA8],
- ["E960",0x5DA9],
- ["E965",0x5DAA],
- ["E95E",0x5DAC],
- ["E968",0x5DAD],
- ["E964",0x5DAE],
- ["E969",0x5DAF],
- ["E963",0x5DB0],
- ["E95F",0x5DB1],
- ["E967",0x5DB2],
- ["E96A",0x5DB4],
- ["E962",0x5DB5],
- ["ECDA",0x5DB7],
- ["C0AF",0x5DB8],
- ["C0AD",0x5DBA],
- ["C0AC",0x5DBC],
- ["C0AE",0x5DBD],
- ["EFC4",0x5DC0],
- ["F172",0x5DC2],
- ["F1FD",0x5DC3],
- ["F444",0x5DC6],
- ["F445",0x5DC7],
- ["C460",0x5DC9],
- ["F5C9",0x5DCB],
- ["C4DE",0x5DCD],
- ["F5CA",0x5DCF],
- ["F6DE",0x5DD1],
- ["C572",0x5DD2],
- ["C571",0x5DD4],
- ["F6DD",0x5DD5],
- ["C5C9",0x5DD6],
- ["F7D6",0x5DD8],
- ["A474",0x5DDD],
- ["A67B",0x5DDE],
- ["C9DA",0x5DDF],
- ["CACA",0x5DE0],
- ["A8B5",0x5DE1],
- ["B15F",0x5DE2],
- ["A475",0x5DE5],
- ["A5AA",0x5DE6],
- ["A5A9",0x5DE7],
- ["A5A8",0x5DE8],
- ["A7C5",0x5DEB],
- ["AE74",0x5DEE],
- ["DD57",0x5DF0],
- ["A476",0x5DF1],
- ["A477",0x5DF2],
- ["A478",0x5DF3],
- ["A4DA",0x5DF4],
- ["ABD1",0x5DF7],
- ["CEAF",0x5DF9],
- ["B453",0x5DFD],
- ["A479",0x5DFE],
- ["C95D",0x5DFF],
- ["A5AB",0x5E02],
- ["A5AC",0x5E03],
- ["C978",0x5E04],
- ["A67C",0x5E06],
- ["CACB",0x5E0A],
- ["A7C6",0x5E0C],
- ["CACC",0x5E0E],
- ["A9AE",0x5E11],
- ["CC6E",0x5E14],
- ["A9AC",0x5E15],
- ["A9AB",0x5E16],
- ["CC6D",0x5E17],
- ["A9A9",0x5E18],
- ["CC6F",0x5E19],
- ["A9AA",0x5E1A],
- ["A9AD",0x5E1B],
- ["ABD2",0x5E1D],
- ["ABD4",0x5E1F],
- ["CEB3",0x5E20],
- ["CEB0",0x5E21],
- ["CEB1",0x5E22],
- ["CEB2",0x5E23],
- ["CEB4",0x5E24],
- ["ABD3",0x5E25],
- ["D174",0x5E28],
- ["D173",0x5E29],
- ["AE76",0x5E2B],
- ["AE75",0x5E2D],
- ["B162",0x5E33],
- ["D546",0x5E34],
- ["B161",0x5E36],
- ["B163",0x5E37],
- ["B160",0x5E38],
- ["B455",0x5E3D],
- ["D545",0x5E3E],
- ["B456",0x5E40],
- ["D8F3",0x5E41],
- ["B457",0x5E43],
- ["D8F2",0x5E44],
- ["B454",0x5E45],
- ["DD5A",0x5E4A],
- ["DD5C",0x5E4B],
- ["B745",0x5E4C],
- ["DD5B",0x5E4D],
- ["DD59",0x5E4E],
- ["DD58",0x5E4F],
- ["E1B4",0x5E53],
- ["B9F7",0x5E54],
- ["B9F5",0x5E55],
- ["B9F6",0x5E57],
- ["E1B2",0x5E58],
- ["E1B3",0x5E59],
- ["B9F3",0x5E5B],
- ["E571",0x5E5C],
- ["E56F",0x5E5D],
- ["BC6D",0x5E5F],
- ["E570",0x5E60],
- ["BC6E",0x5E61],
- ["BC6C",0x5E62],
- ["B9F4",0x5E63],
- ["E96D",0x5E66],
- ["E96B",0x5E67],
- ["E96C",0x5E68],
- ["E56E",0x5E69],
- ["ECDC",0x5E6A],
- ["C0B0",0x5E6B],
- ["ECDB",0x5E6C],
- ["EFC5",0x5E6D],
- ["EFC6",0x5E6E],
- ["E96E",0x5E6F],
- ["F1FE",0x5E70],
- ["A47A",0x5E72],
- ["A5AD",0x5E73],
- ["A67E",0x5E74],
- ["C9DB",0x5E75],
- ["A67D",0x5E76],
- ["A9AF",0x5E78],
- ["B746",0x5E79],
- ["A4DB",0x5E7B],
- ["A5AE",0x5E7C],
- ["ABD5",0x5E7D],
- ["B458",0x5E7E],
- ["C979",0x5E80],
- ["C97A",0x5E82],
- ["C9DC",0x5E84],
- ["A7C8",0x5E87],
- ["CAD0",0x5E88],
- ["CACE",0x5E89],
- ["A7C9",0x5E8A],
- ["CACD",0x5E8B],
- ["CACF",0x5E8C],
- ["CAD1",0x5E8D],
- ["A7C7",0x5E8F],
- ["A9B3",0x5E95],
- ["A9B4",0x5E96],
- ["A9B1",0x5E97],
- ["A9B0",0x5E9A],
- ["CEB8",0x5E9B],
- ["A9B2",0x5E9C],
- ["ABD6",0x5EA0],
- ["CEB7",0x5EA2],
- ["CEB9",0x5EA3],
- ["CEB6",0x5EA4],
- ["CEBA",0x5EA5],
- ["ABD7",0x5EA6],
- ["AE79",0x5EA7],
- ["D175",0x5EA8],
- ["D177",0x5EAA],
- ["AE77",0x5EAB],
- ["D178",0x5EAC],
- ["AE78",0x5EAD],
- ["D176",0x5EAE],
- ["CEB5",0x5EB0],
- ["D547",0x5EB1],
- ["D54A",0x5EB2],
- ["D54B",0x5EB3],
- ["D548",0x5EB4],
- ["B167",0x5EB5],
- ["B166",0x5EB6],
- ["B164",0x5EB7],
- ["B165",0x5EB8],
- ["D549",0x5EB9],
- ["B168",0x5EBE],
- ["B45A",0x5EC1],
- ["B45B",0x5EC2],
- ["B45C",0x5EC4],
- ["DD5D",0x5EC5],
- ["DD5F",0x5EC6],
- ["DD61",0x5EC7],
- ["B748",0x5EC8],
- ["B747",0x5EC9],
- ["B459",0x5ECA],
- ["DD60",0x5ECB],
- ["DD5E",0x5ECC],
- ["E1B8",0x5ECE],
- ["E1B6",0x5ED1],
- ["E1BC",0x5ED2],
- ["B9F8",0x5ED3],
- ["E1BD",0x5ED4],
- ["E1BA",0x5ED5],
- ["B9F9",0x5ED6],
- ["E1B7",0x5ED7],
- ["E1B5",0x5ED8],
- ["E1BB",0x5ED9],
- ["BC70",0x5EDA],
- ["E573",0x5EDB],
- ["E1B9",0x5EDC],
- ["BC72",0x5EDD],
- ["E574",0x5EDE],
- ["BC71",0x5EDF],
- ["BC74",0x5EE0],
- ["E575",0x5EE1],
- ["BC6F",0x5EE2],
- ["BC73",0x5EE3],
- ["E973",0x5EE5],
- ["E971",0x5EE6],
- ["E970",0x5EE7],
- ["E972",0x5EE8],
- ["E96F",0x5EE9],
- ["C366",0x5EEC],
- ["F446",0x5EEE],
- ["F447",0x5EEF],
- ["F5CB",0x5EF1],
- ["F6DF",0x5EF2],
- ["C655",0x5EF3],
- ["A9B5",0x5EF6],
- ["A7CA",0x5EF7],
- ["ABD8",0x5EFA],
- ["A47B",0x5EFE],
- ["A4DC",0x5EFF],
- ["A5AF",0x5F01],
- ["C9DD",0x5F02],
- ["A7CB",0x5F04],
- ["CAD2",0x5F05],
- ["CEBB",0x5F07],
- ["ABD9",0x5F08],
- ["B9FA",0x5F0A],
- ["A47C",0x5F0B],
- ["A6A1",0x5F0F],
- ["B749",0x5F12],
- ["A47D",0x5F13],
- ["A4DD",0x5F14],
- ["A4DE",0x5F15],
- ["A5B1",0x5F17],
- ["A5B0",0x5F18],
- ["C9DE",0x5F1A],
- ["A6A2",0x5F1B],
- ["CAD3",0x5F1D],
- ["A7CC",0x5F1F],
- ["CC71",0x5F22],
- ["CC72",0x5F23],
- ["CC73",0x5F24],
- ["A9B6",0x5F26],
- ["A9B7",0x5F27],
- ["CC70",0x5F28],
- ["A9B8",0x5F29],
- ["ABDA",0x5F2D],
- ["CEBC",0x5F2E],
- ["D17A",0x5F30],
- ["AE7A",0x5F31],
- ["D179",0x5F33],
- ["B169",0x5F35],
- ["D54C",0x5F36],
- ["B16A",0x5F37],
- ["D54D",0x5F38],
- ["B45D",0x5F3C],
- ["DD62",0x5F40],
- ["E1BF",0x5F43],
- ["E1BE",0x5F44],
- ["B9FB",0x5F46],
- ["BC75",0x5F48],
- ["E576",0x5F49],
- ["BECA",0x5F4A],
- ["E974",0x5F4B],
- ["C0B1",0x5F4C],
- ["C573",0x5F4E],
- ["F7D8",0x5F4F],
- ["CC74",0x5F54],
- ["CEBD",0x5F56],
- ["B16B",0x5F57],
- ["D8F4",0x5F58],
- ["B74A",0x5F59],
- ["C255",0x5F5D],
- ["A7CE",0x5F62],
- ["A7CD",0x5F64],
- ["ABDB",0x5F65],
- ["D17B",0x5F67],
- ["B16D",0x5F69],
- ["B343",0x5F6A],
- ["B16E",0x5F6B],
- ["B16C",0x5F6C],
- ["B45E",0x5F6D],
- ["E1C0",0x5F6F],
- ["B9FC",0x5F70],
- ["BC76",0x5F71],
- ["C94C",0x5F73],
- ["C9DF",0x5F74],
- ["CAD5",0x5F76],
- ["A7CF",0x5F77],
- ["CAD4",0x5F78],
- ["A7D0",0x5F79],
- ["A9BC",0x5F7C],
- ["CC77",0x5F7D],
- ["CC76",0x5F7E],
- ["A9BB",0x5F7F],
- ["A9B9",0x5F80],
- ["A9BA",0x5F81],
- ["CC75",0x5F82],
- ["ABDD",0x5F85],
- ["CEBE",0x5F86],
- ["ABE0",0x5F87],
- ["ABDC",0x5F88],
- ["ABE2",0x5F89],
- ["ABDE",0x5F8A],
- ["ABDF",0x5F8B],
- ["ABE1",0x5F8C],
- ["AE7D",0x5F90],
- ["AE7C",0x5F91],
- ["AE7B",0x5F92],
- ["D54F",0x5F96],
- ["B16F",0x5F97],
- ["B172",0x5F98],
- ["B170",0x5F99],
- ["D54E",0x5F9B],
- ["B175",0x5F9C],
- ["B171",0x5F9E],
- ["D550",0x5F9F],
- ["B174",0x5FA0],
- ["B173",0x5FA1],
- ["D8F6",0x5FA5],
- ["D8F5",0x5FA6],
- ["B461",0x5FA8],
- ["B45F",0x5FA9],
- ["B460",0x5FAA],
- ["D8F7",0x5FAB],
- ["B74B",0x5FAC],
- ["DD64",0x5FAD],
- ["B74C",0x5FAE],
- ["DD63",0x5FAF],
- ["E577",0x5FB2],
- ["BC78",0x5FB5],
- ["E1C1",0x5FB6],
- ["BC77",0x5FB7],
- ["B9FD",0x5FB9],
- ["ECDE",0x5FBB],
- ["E975",0x5FBC],
- ["C0B2",0x5FBD],
- ["ECDD",0x5FBE],
- ["F240",0x5FBF],
- ["F448",0x5FC0],
- ["F449",0x5FC1],
- ["A4DF",0x5FC3],
- ["A5B2",0x5FC5],
- ["C97B",0x5FC9],
- ["A7D2",0x5FCC],
- ["A7D4",0x5FCD],
- ["C9E2",0x5FCF],
- ["CAD8",0x5FD0],
- ["CAD7",0x5FD1],
- ["CAD6",0x5FD2],
- ["C9E1",0x5FD4],
- ["C9E0",0x5FD5],
- ["A6A4",0x5FD6],
- ["A7D3",0x5FD7],
- ["A7D1",0x5FD8],
- ["A6A3",0x5FD9],
- ["A9BD",0x5FDD],
- ["CC78",0x5FDE],
- ["A9BE",0x5FE0],
- ["CADD",0x5FE1],
- ["CADF",0x5FE3],
- ["CADE",0x5FE4],
- ["CC79",0x5FE5],
- ["CADA",0x5FE8],
- ["A7D8",0x5FEA],
- ["A7D6",0x5FEB],
- ["CAD9",0x5FED],
- ["CADB",0x5FEE],
- ["CAE1",0x5FEF],
- ["A7D5",0x5FF1],
- ["CADC",0x5FF3],
- ["CAE5",0x5FF4],
- ["A9C0",0x5FF5],
- ["CAE2",0x5FF7],
- ["A7D7",0x5FF8],
- ["CAE0",0x5FFA],
- ["CAE3",0x5FFB],
- ["A9BF",0x5FFD],
- ["A9C1",0x5FFF],
- ["CAE4",0x6000],
- ["CCAF",0x6009],
- ["CCA2",0x600A],
- ["CC7E",0x600B],
- ["CCAE",0x600C],
- ["CCA9",0x600D],
- ["ABE7",0x600E],
- ["A9C2",0x600F],
- ["CCAA",0x6010],
- ["CCAD",0x6011],
- ["ABE3",0x6012],
- ["CCAC",0x6013],
- ["A9C3",0x6014],
- ["A9C8",0x6015],
- ["A9C6",0x6016],
- ["CCA3",0x6017],
- ["CC7C",0x6019],
- ["CCA5",0x601A],
- ["A9CD",0x601B],
- ["CCB0",0x601C],
- ["ABE4",0x601D],
- ["CCA6",0x601E],
- ["ABE5",0x6020],
- ["A9C9",0x6021],
- ["CCA8",0x6022],
- ["CECD",0x6024],
- ["ABE6",0x6025],
- ["CC7B",0x6026],
- ["A9CA",0x6027],
- ["ABE8",0x6028],
- ["A9CB",0x6029],
- ["A9C7",0x602A],
- ["A9CC",0x602B],
- ["CCA7",0x602C],
- ["CC7A",0x602D],
- ["CCAB",0x602E],
- ["A9C4",0x602F],
- ["CC7D",0x6032],
- ["CCA4",0x6033],
- ["CCA1",0x6034],
- ["A9C5",0x6035],
- ["CEBF",0x6037],
- ["CEC0",0x6039],
- ["CECA",0x6040],
- ["D1A1",0x6041],
- ["CECB",0x6042],
- ["ABEE",0x6043],
- ["CECE",0x6044],
- ["CEC4",0x6045],
- ["ABED",0x6046],
- ["CEC6",0x6047],
- ["CEC7",0x6049],
- ["CEC9",0x604C],
- ["ABE9",0x604D],
- ["AEA3",0x6050],
- ["CEC5",0x6053],
- ["CEC1",0x6054],
- ["AEA4",0x6055],
- ["CECF",0x6058],
- ["AE7E",0x6059],
- ["D17D",0x605A],
- ["CEC8",0x605B],
- ["D17C",0x605D],
- ["CEC3",0x605E],
- ["CECC",0x605F],
- ["ABEC",0x6062],
- ["AEA1",0x6063],
- ["ABF2",0x6064],
- ["AEA2",0x6065],
- ["CED0",0x6066],
- ["D17E",0x6067],
- ["ABEB",0x6068],
- ["AEA6",0x6069],
- ["ABF1",0x606A],
- ["ABF0",0x606B],
- ["ABEF",0x606C],
- ["AEA5",0x606D],
- ["CED1",0x606E],
- ["AEA7",0x606F],
- ["ABEA",0x6070],
- ["CEC2",0x6072],
- ["B176",0x607F],
- ["D1A4",0x6080],
- ["D1A6",0x6081],
- ["D1A8",0x6083],
- ["AEA8",0x6084],
- ["AEAE",0x6085],
- ["D553",0x6086],
- ["D1AC",0x6087],
- ["D1A3",0x6088],
- ["B178",0x6089],
- ["D551",0x608A],
- ["AEAD",0x608C],
- ["AEAB",0x608D],
- ["D1AE",0x608E],
- ["D552",0x6090],
- ["D1A5",0x6092],
- ["AEAC",0x6094],
- ["D1A9",0x6095],
- ["AEAF",0x6096],
- ["D1AB",0x6097],
- ["AEAA",0x609A],
- ["D1AA",0x609B],
- ["D1AD",0x609C],
- ["D1A7",0x609D],
- ["AEA9",0x609F],
- ["B179",0x60A0],
- ["D1A2",0x60A2],
- ["B177",0x60A3],
- ["B17A",0x60A8],
- ["D555",0x60B0],
- ["D55E",0x60B1],
- ["B464",0x60B2],
- ["B17C",0x60B4],
- ["B1A3",0x60B5],
- ["B465",0x60B6],
- ["D560",0x60B7],
- ["B1AA",0x60B8],
- ["D8F9",0x60B9],
- ["D556",0x60BA],
- ["B1A2",0x60BB],
- ["B1A5",0x60BC],
- ["B17E",0x60BD],
- ["D554",0x60BE],
- ["D562",0x60BF],
- ["D565",0x60C0],
- ["D949",0x60C1],
- ["D563",0x60C3],
- ["D8FD",0x60C4],
- ["B1A1",0x60C5],
- ["B1A8",0x60C6],
- ["B1AC",0x60C7],
- ["D55D",0x60C8],
- ["D8F8",0x60C9],
- ["D561",0x60CA],
- ["B17B",0x60CB],
- ["D8FA",0x60CC],
- ["D564",0x60CD],
- ["D8FC",0x60CE],
- ["D559",0x60CF],
- ["B462",0x60D1],
- ["D557",0x60D3],
- ["D558",0x60D4],
- ["B1A7",0x60D5],
- ["B1A6",0x60D8],
- ["D55B",0x60D9],
- ["B1AB",0x60DA],
- ["D55F",0x60DB],
- ["B1A4",0x60DC],
- ["D55C",0x60DD],
- ["B1A9",0x60DF],
- ["B466",0x60E0],
- ["B463",0x60E1],
- ["D8FB",0x60E2],
- ["D55A",0x60E4],
- ["B17D",0x60E6],
- ["B46B",0x60F0],
- ["B46F",0x60F1],
- ["D940",0x60F2],
- ["B751",0x60F3],
- ["B46D",0x60F4],
- ["D944",0x60F5],
- ["B471",0x60F6],
- ["DD65",0x60F7],
- ["D946",0x60F8],
- ["B753",0x60F9],
- ["B469",0x60FA],
- ["B46C",0x60FB],
- ["D947",0x60FC],
- ["D948",0x60FE],
- ["D94E",0x60FF],
- ["B473",0x6100],
- ["B754",0x6101],
- ["D94A",0x6103],
- ["D94F",0x6104],
- ["D943",0x6105],
- ["B75E",0x6106],
- ["B755",0x6108],
- ["B472",0x6109],
- ["D941",0x610A],
- ["D950",0x610B],
- ["B75D",0x610D],
- ["B470",0x610E],
- ["B74E",0x610F],
- ["D94D",0x6110],
- ["B474",0x6112],
- ["D945",0x6113],
- ["D8FE",0x6114],
- ["B46A",0x6115],
- ["D942",0x6116],
- ["D94B",0x6118],
- ["B74D",0x611A],
- ["B752",0x611B],
- ["B467",0x611C],
- ["D94C",0x611D],
- ["B750",0x611F],
- ["B468",0x6123],
- ["B75C",0x6127],
- ["E1C3",0x6128],
- ["DD70",0x6129],
- ["DD68",0x612B],
- ["E1C2",0x612C],
- ["DD6C",0x612E],
- ["DD6E",0x612F],
- ["DD6B",0x6132],
- ["B75B",0x6134],
- ["DD6A",0x6136],
- ["B75F",0x6137],
- ["E1D2",0x613B],
- ["B75A",0x613E],
- ["BA40",0x613F],
- ["DD71",0x6140],
- ["E1C4",0x6141],
- ["B758",0x6144],
- ["DD69",0x6145],
- ["DD6D",0x6146],
- ["B9FE",0x6147],
- ["B74F",0x6148],
- ["DD66",0x6149],
- ["DD67",0x614A],
- ["BA41",0x614B],
- ["B757",0x614C],
- ["B759",0x614D],
- ["B756",0x614E],
- ["DD6F",0x614F],
- ["E1C8",0x6152],
- ["E1C9",0x6153],
- ["E1CE",0x6154],
- ["BC7D",0x6155],
- ["E1D5",0x6156],
- ["BA47",0x6158],
- ["BA46",0x615A],
- ["E1D0",0x615B],
- ["BC7C",0x615D],
- ["E1C5",0x615E],
- ["BA45",0x615F],
- ["E1D4",0x6161],
- ["BA43",0x6162],
- ["BA44",0x6163],
- ["E1D1",0x6165],
- ["E5AA",0x6166],
- ["BC7A",0x6167],
- ["B46E",0x6168],
- ["E1D3",0x616A],
- ["BCA3",0x616B],
- ["E1CB",0x616C],
- ["BC7B",0x616E],
- ["BCA2",0x6170],
- ["E1C6",0x6171],
- ["E1CA",0x6172],
- ["E1C7",0x6173],
- ["E1CD",0x6174],
- ["BA48",0x6175],
- ["BC79",0x6176],
- ["BA42",0x6177],
- ["E57A",0x6179],
- ["E1CF",0x617A],
- ["BCA1",0x617C],
- ["BCA4",0x617E],
- ["E1CC",0x6180],
- ["BC7E",0x6182],
- ["E579",0x6183],
- ["E57E",0x6189],
- ["BECE",0x618A],
- ["E578",0x618B],
- ["E9A3",0x618C],
- ["E5A9",0x618D],
- ["BCA8",0x618E],
- ["BCA6",0x6190],
- ["BECC",0x6191],
- ["E5A6",0x6192],
- ["E5A2",0x6193],
- ["BCAC",0x6194],
- ["E978",0x6196],
- ["BCAA",0x619A],
- ["E5A1",0x619B],
- ["E976",0x619D],
- ["E5A5",0x619F],
- ["E5A8",0x61A1],
- ["E57D",0x61A2],
- ["BCAB",0x61A4],
- ["BCA5",0x61A7],
- ["E977",0x61A8],
- ["BECD",0x61A9],
- ["E5A7",0x61AA],
- ["BCA7",0x61AB],
- ["BCA9",0x61AC],
- ["E5A4",0x61AD],
- ["BCAD",0x61AE],
- ["E5A3",0x61AF],
- ["E57C",0x61B0],
- ["E57B",0x61B1],
- ["BECB",0x61B2],
- ["E5AB",0x61B3],
- ["E97A",0x61B4],
- ["ECE0",0x61B5],
- ["BED0",0x61B6],
- ["E9A2",0x61B8],
- ["E97E",0x61BA],
- ["ECE1",0x61BC],
- ["BED1",0x61BE],
- ["E9A1",0x61BF],
- ["E97C",0x61C1],
- ["C0B4",0x61C2],
- ["ECDF",0x61C3],
- ["E979",0x61C5],
- ["E97B",0x61C6],
- ["C0B5",0x61C7],
- ["BED3",0x61C8],
- ["C0B3",0x61C9],
- ["BED2",0x61CA],
- ["C0B7",0x61CB],
- ["E97D",0x61CC],
- ["BECF",0x61CD],
- ["EFCF",0x61D6],
- ["EFC7",0x61D8],
- ["ECE7",0x61DE],
- ["EFC8",0x61DF],
- ["ECE3",0x61E0],
- ["C256",0x61E3],
- ["ECE5",0x61E4],
- ["ECE4",0x61E5],
- ["C0B6",0x61E6],
- ["ECE2",0x61E7],
- ["ECE6",0x61E8],
- ["EFD0",0x61E9],
- ["EFCC",0x61EA],
- ["EFCE",0x61EB],
- ["EFC9",0x61ED],
- ["EFCA",0x61EE],
- ["EFCD",0x61F0],
- ["EFCB",0x61F1],
- ["C367",0x61F2],
- ["C36A",0x61F5],
- ["C369",0x61F6],
- ["C368",0x61F7],
- ["C461",0x61F8],
- ["F44A",0x61F9],
- ["C462",0x61FA],
- ["F241",0x61FB],
- ["C4DF",0x61FC],
- ["F5CC",0x61FD],
- ["C4E0",0x61FE],
- ["C574",0x61FF],
- ["C5CA",0x6200],
- ["F7D9",0x6201],
- ["F7DA",0x6203],
- ["F7DB",0x6204],
- ["F9BA",0x6207],
- ["A4E0",0x6208],
- ["C97C",0x6209],
- ["A5B3",0x620A],
- ["A6A6",0x620C],
- ["A6A7",0x620D],
- ["A6A5",0x620E],
- ["A6A8",0x6210],
- ["A7DA",0x6211],
- ["A7D9",0x6212],
- ["CCB1",0x6214],
- ["A9CF",0x6215],
- ["A9CE",0x6216],
- ["D1AF",0x6219],
- ["B1AD",0x621A],
- ["B1AE",0x621B],
- ["B475",0x621F],
- ["DD72",0x6220],
- ["B760",0x6221],
- ["B761",0x6222],
- ["DD74",0x6223],
- ["DD76",0x6224],
- ["DD75",0x6225],
- ["E1D7",0x6227],
- ["E1D6",0x6229],
- ["BA49",0x622A],
- ["E1D8",0x622B],
- ["E5AC",0x622D],
- ["BCAE",0x622E],
- ["BED4",0x6230],
- ["C0B8",0x6232],
- ["C257",0x6233],
- ["C0B9",0x6234],
- ["A4E1",0x6236],
- ["CAE6",0x623A],
- ["CCB2",0x623D],
- ["A9D1",0x623E],
- ["A9D0",0x623F],
- ["A9D2",0x6240],
- ["ABF3",0x6241],
- ["CED2",0x6242],
- ["CED3",0x6243],
- ["D1B0",0x6246],
- ["AEB0",0x6247],
- ["B1AF",0x6248],
- ["B476",0x6249],
- ["D951",0x624A],
- ["A4E2",0x624B],
- ["A47E",0x624D],
- ["A4E3",0x624E],
- ["C97D",0x6250],
- ["A5B7",0x6251],
- ["A5B6",0x6252],
- ["A5B4",0x6253],
- ["A5B5",0x6254],
- ["A6AB",0x6258],
- ["C9E9",0x6259],
- ["C9EB",0x625A],
- ["A6AA",0x625B],
- ["C9E3",0x625C],
- ["C9E4",0x625E],
- ["C9EA",0x6260],
- ["C9E6",0x6261],
- ["C9E8",0x6262],
- ["A6A9",0x6263],
- ["C9E5",0x6264],
- ["C9EC",0x6265],
- ["C9E7",0x6266],
- ["A7E1",0x626D],
- ["A7EA",0x626E],
- ["A7E8",0x626F],
- ["CAF0",0x6270],
- ["CAED",0x6271],
- ["CAF5",0x6272],
- ["A7E6",0x6273],
- ["CAF6",0x6274],
- ["A7DF",0x6276],
- ["CAF3",0x6277],
- ["A7E5",0x6279],
- ["CAEF",0x627A],
- ["CAEE",0x627B],
- ["A7E3",0x627C],
- ["CAF4",0x627D],
- ["A7E4",0x627E],
- ["A9D3",0x627F],
- ["A7DE",0x6280],
- ["CAF1",0x6281],
- ["CAE7",0x6283],
- ["A7DB",0x6284],
- ["A7EE",0x6286],
- ["CAEC",0x6287],
- ["CAF2",0x6288],
- ["A7E0",0x6289],
- ["A7E2",0x628A],
- ["CAE8",0x628C],
- ["CAE9",0x628E],
- ["CAEA",0x628F],
- ["A7ED",0x6291],
- ["A7E7",0x6292],
- ["A7EC",0x6293],
- ["CAEB",0x6294],
- ["A7EB",0x6295],
- ["A7DD",0x6296],
- ["A7DC",0x6297],
- ["A7E9",0x6298],
- ["A9E1",0x62A8],
- ["CCBE",0x62A9],
- ["CCB7",0x62AA],
- ["A9DC",0x62AB],
- ["A9EF",0x62AC],
- ["CCB3",0x62AD],
- ["CCBA",0x62AE],
- ["CCBC",0x62AF],
- ["CCBF",0x62B0],
- ["A9EA",0x62B1],
- ["CCBB",0x62B3],
- ["CCB4",0x62B4],
- ["A9E8",0x62B5],
- ["CCB8",0x62B6],
- ["CCC0",0x62B8],
- ["A9D9",0x62B9],
- ["CCBD",0x62BB],
- ["A9E3",0x62BC],
- ["A9E2",0x62BD],
- ["CCB6",0x62BE],
- ["A9D7",0x62BF],
- ["A9D8",0x62C2],
- ["A9D6",0x62C4],
- ["A9EE",0x62C6],
- ["A9E6",0x62C7],
- ["A9E0",0x62C8],
- ["A9D4",0x62C9],
- ["CCB9",0x62CA],
- ["A9DF",0x62CB],
- ["A9D5",0x62CC],
- ["A9E7",0x62CD],
- ["A9F0",0x62CE],
- ["CED4",0x62CF],
- ["A9E4",0x62D0],
- ["CCB5",0x62D1],
- ["A9DA",0x62D2],
- ["A9DD",0x62D3],
- ["A9DE",0x62D4],
- ["A9EC",0x62D6],
- ["A9ED",0x62D7],
- ["A9EB",0x62D8],
- ["A9E5",0x62D9],
- ["A9E9",0x62DA],
- ["A9DB",0x62DB],
- ["ABF4",0x62DC],
- ["CEDA",0x62EB],
- ["AC41",0x62EC],
- ["ABF8",0x62ED],
- ["ABFA",0x62EE],
- ["AC40",0x62EF],
- ["CEE6",0x62F0],
- ["ABFD",0x62F1],
- ["D1B1",0x62F2],
- ["AEB1",0x62F3],
- ["AC43",0x62F4],
- ["CED7",0x62F5],
- ["CEDF",0x62F6],
- ["ABFE",0x62F7],
- ["CEDE",0x62F8],
- ["CEDB",0x62F9],
- ["CEE3",0x62FA],
- ["CEE5",0x62FB],
- ["ABF7",0x62FC],
- ["ABFB",0x62FD],
- ["AC42",0x62FE],
- ["AEB3",0x62FF],
- ["CEE0",0x6300],
- ["ABF9",0x6301],
- ["AC45",0x6302],
- ["CED9",0x6303],
- ["ABFC",0x6307],
- ["AEB2",0x6308],
- ["ABF6",0x6309],
- ["CED6",0x630B],
- ["CEDD",0x630C],
- ["CED5",0x630D],
- ["CED8",0x630E],
- ["CEDC",0x630F],
- ["D1B2",0x6310],
- ["AC44",0x6311],
- ["CEE1",0x6313],
- ["CEE2",0x6314],
- ["CEE4",0x6315],
- ["ABF5",0x6316],
- ["AEC1",0x6328],
- ["D1BE",0x6329],
- ["AEBF",0x632A],
- ["AEC0",0x632B],
- ["D1B4",0x632C],
- ["D1C4",0x632D],
- ["AEB6",0x632F],
- ["D566",0x6332],
- ["D1C6",0x6333],
- ["D1C0",0x6334],
- ["D1B7",0x6336],
- ["D1C9",0x6338],
- ["D1BA",0x6339],
- ["AEBC",0x633A],
- ["D57D",0x633B],
- ["D1BD",0x633C],
- ["AEBE",0x633D],
- ["AEB5",0x633E],
- ["D1CB",0x6340],
- ["D1BF",0x6341],
- ["AEB8",0x6342],
- ["D1B8",0x6343],
- ["D1B5",0x6344],
- ["D1B6",0x6345],
- ["AEB9",0x6346],
- ["D1C5",0x6347],
- ["D1CC",0x6348],
- ["AEBB",0x6349],
- ["D1BC",0x634A],
- ["D1BB",0x634B],
- ["AEC3",0x634C],
- ["AEC2",0x634D],
- ["AEB4",0x634E],
- ["AEBA",0x634F],
- ["AEBD",0x6350],
- ["D1C8",0x6351],
- ["D1C2",0x6354],
- ["AEB7",0x6355],
- ["D1B3",0x6356],
- ["D1CA",0x6357],
- ["D1C1",0x6358],
- ["D1C3",0x6359],
- ["D1C7",0x635A],
- ["D567",0x6365],
- ["B1B7",0x6367],
- ["B1CB",0x6368],
- ["B1CA",0x6369],
- ["B1BF",0x636B],
- ["D579",0x636D],
- ["D575",0x636E],
- ["D572",0x636F],
- ["D5A6",0x6370],
- ["B1BA",0x6371],
- ["B1B2",0x6372],
- ["D577",0x6375],
- ["B4A8",0x6376],
- ["B1B6",0x6377],
- ["D5A1",0x6378],
- ["B1CC",0x637A],
- ["B1C9",0x637B],
- ["D57B",0x637C],
- ["D56A",0x637D],
- ["B1C8",0x6380],
- ["D5A3",0x6381],
- ["D569",0x6382],
- ["B1BD",0x6383],
- ["B1C1",0x6384],
- ["D5A2",0x6385],
- ["D573",0x6387],
- ["B1C2",0x6388],
- ["B1BC",0x6389],
- ["D568",0x638A],
- ["B478",0x638C],
- ["D5A5",0x638D],
- ["D571",0x638E],
- ["B1C7",0x638F],
- ["D574",0x6390],
- ["D5A4",0x6391],
- ["B1C6",0x6392],
- ["D952",0x6394],
- ["B1B3",0x6396],
- ["D56F",0x6397],
- ["B1B8",0x6398],
- ["B1C3",0x6399],
- ["B1BE",0x639B],
- ["D578",0x639C],
- ["D56E",0x639D],
- ["D56C",0x639E],
- ["D57E",0x639F],
- ["B1B0",0x63A0],
- ["B1C4",0x63A1],
- ["B1B4",0x63A2],
- ["B477",0x63A3],
- ["D57C",0x63A4],
- ["B1B5",0x63A5],
- ["B1B1",0x63A7],
- ["B1C0",0x63A8],
- ["B1BB",0x63A9],
- ["B1B9",0x63AA],
- ["D570",0x63AB],
- ["B1C5",0x63AC],
- ["D56D",0x63AD],
- ["D57A",0x63AE],
- ["D576",0x63AF],
- ["D954",0x63B0],
- ["D953",0x63B1],
- ["D56B",0x63BD],
- ["D964",0x63BE],
- ["B47A",0x63C0],
- ["D96A",0x63C2],
- ["D959",0x63C3],
- ["D967",0x63C4],
- ["DD77",0x63C5],
- ["B47D",0x63C6],
- ["D96B",0x63C7],
- ["D96E",0x63C8],
- ["B47C",0x63C9],
- ["D95C",0x63CA],
- ["D96D",0x63CB],
- ["D96C",0x63CC],
- ["B47E",0x63CD],
- ["D955",0x63CE],
- ["B479",0x63CF],
- ["B4A3",0x63D0],
- ["B4A1",0x63D2],
- ["D969",0x63D3],
- ["D95F",0x63D5],
- ["B4A5",0x63D6],
- ["D970",0x63D7],
- ["D968",0x63D8],
- ["D971",0x63D9],
- ["B4AD",0x63DA],
- ["B4AB",0x63DB],
- ["D966",0x63DC],
- ["D965",0x63DD],
- ["D963",0x63DF],
- ["D95D",0x63E0],
- ["B4A4",0x63E1],
- ["B4A2",0x63E3],
- ["D1B9",0x63E4],
- ["D956",0x63E5],
- ["DDB7",0x63E7],
- ["D957",0x63E8],
- ["B47B",0x63E9],
- ["B4AA",0x63EA],
- ["DD79",0x63EB],
- ["B4A6",0x63ED],
- ["B4A7",0x63EE],
- ["D958",0x63EF],
- ["D96F",0x63F0],
- ["DD78",0x63F1],
- ["D960",0x63F2],
- ["D95B",0x63F3],
- ["B4A9",0x63F4],
- ["D961",0x63F5],
- ["D95E",0x63F6],
- ["B4AE",0x63F9],
- ["B770",0x6406],
- ["DD7C",0x6409],
- ["DDB1",0x640A],
- ["DDB6",0x640B],
- ["DDAA",0x640C],
- ["B76C",0x640D],
- ["DDBB",0x640E],
- ["B769",0x640F],
- ["DD7A",0x6410],
- ["DD7B",0x6412],
- ["B762",0x6413],
- ["B76B",0x6414],
- ["DDA4",0x6415],
- ["B76E",0x6416],
- ["B76F",0x6417],
- ["DDA5",0x6418],
- ["DDB2",0x641A],
- ["DDB8",0x641B],
- ["B76A",0x641C],
- ["B764",0x641E],
- ["DDA3",0x641F],
- ["DD7D",0x6420],
- ["DDBA",0x6421],
- ["DDA8",0x6422],
- ["DDA9",0x6423],
- ["DD7E",0x6424],
- ["DDB4",0x6425],
- ["DDAB",0x6426],
- ["DDB5",0x6427],
- ["DDAD",0x6428],
- ["B765",0x642A],
- ["E1D9",0x642B],
- ["B768",0x642C],
- ["B766",0x642D],
- ["DDB9",0x642E],
- ["DDB0",0x642F],
- ["DDAC",0x6430],
- ["DDA1",0x6433],
- ["BA53",0x6434],
- ["DDAF",0x6435],
- ["B76D",0x6436],
- ["DDA7",0x6437],
- ["DDA6",0x6439],
- ["B767",0x643D],
- ["B763",0x643E],
- ["E1EE",0x643F],
- ["DDB3",0x6440],
- ["DDAE",0x6441],
- ["DDA2",0x6443],
- ["E1E9",0x644B],
- ["E1DA",0x644D],
- ["E1E5",0x644E],
- ["E1EC",0x6450],
- ["BA51",0x6451],
- ["B4AC",0x6452],
- ["E1EA",0x6453],
- ["BA4C",0x6454],
- ["BA4B",0x6458],
- ["E1F1",0x6459],
- ["E1DB",0x645B],
- ["E1E8",0x645C],
- ["E1DC",0x645D],
- ["E1E7",0x645E],
- ["BA4F",0x645F],
- ["E1EB",0x6460],
- ["D962",0x6461],
- ["E1F2",0x6465],
- ["E1E3",0x6466],
- ["BA52",0x6467],
- ["E5BA",0x6468],
- ["BCAF",0x6469],
- ["E1F0",0x646B],
- ["E1EF",0x646C],
- ["BA54",0x646D],
- ["E5AD",0x646E],
- ["BCB0",0x646F],
- ["E5AE",0x6470],
- ["E1DF",0x6472],
- ["E1E0",0x6473],
- ["E1DD",0x6474],
- ["E1E2",0x6475],
- ["E1DE",0x6476],
- ["E1F3",0x6477],
- ["BA4E",0x6478],
- ["BCB1",0x6479],
- ["BA50",0x647A],
- ["BA55",0x647B],
- ["E1E1",0x647D],
- ["E1ED",0x647F],
- ["E1E6",0x6482],
- ["E5B1",0x6485],
- ["BA4A",0x6487],
- ["BCB4",0x6488],
- ["E9AA",0x6489],
- ["E5B6",0x648A],
- ["E5B5",0x648B],
- ["E5B7",0x648C],
- ["E5B4",0x648F],
- ["BCB5",0x6490],
- ["BCBB",0x6492],
- ["BCB8",0x6493],
- ["BCB9",0x6495],
- ["E5AF",0x6496],
- ["E5B2",0x6497],
- ["E5BC",0x6498],
- ["BCC1",0x6499],
- ["BCBF",0x649A],
- ["E5B3",0x649C],
- ["D95A",0x649D],
- ["BCB2",0x649E],
- ["E5B9",0x649F],
- ["E5B0",0x64A0],
- ["BCC2",0x64A2],
- ["E5B8",0x64A3],
- ["BA4D",0x64A4],
- ["BCB7",0x64A5],
- ["E1E4",0x64A6],
- ["BCBA",0x64A9],
- ["BCBE",0x64AB],
- ["BCC0",0x64AC],
- ["BCBD",0x64AD],
- ["BCBC",0x64AE],
- ["BCB6",0x64B0],
- ["E5BB",0x64B1],
- ["BCB3",0x64B2],
- ["BCC3",0x64B3],
- ["BED8",0x64BB],
- ["BED9",0x64BC],
- ["E9A9",0x64BD],
- ["BEE2",0x64BE],
- ["BEDF",0x64BF],
- ["BED6",0x64C1],
- ["BEDD",0x64C2],
- ["E9AB",0x64C3],
- ["BEDB",0x64C4],
- ["BED5",0x64C5],
- ["BEDC",0x64C7],
- ["E9A8",0x64C9],
- ["C0BB",0x64CA],
- ["BED7",0x64CB],
- ["BEDE",0x64CD],
- ["C0BA",0x64CE],
- ["E9A7",0x64CF],
- ["E9A6",0x64D0],
- ["BEE0",0x64D2],
- ["BEE1",0x64D4],
- ["E9A5",0x64D6],
- ["E9A4",0x64D7],
- ["C0BC",0x64D8],
- ["E9AE",0x64D9],
- ["BEDA",0x64DA],
- ["E9AC",0x64DB],
- ["C0BD",0x64E0],
- ["C0C2",0x64E2],
- ["ECEA",0x64E3],
- ["ECEC",0x64E4],
- ["C0BF",0x64E6],
- ["ECED",0x64E8],
- ["ECE9",0x64E9],
- ["ECEB",0x64EB],
- ["C0C0",0x64EC],
- ["C0C3",0x64ED],
- ["ECE8",0x64EF],
- ["C0BE",0x64F0],
- ["C0C1",0x64F1],
- ["C259",0x64F2],
- ["E9AD",0x64F3],
- ["C258",0x64F4],
- ["C25E",0x64F7],
- ["EFD4",0x64F8],
- ["C25C",0x64FA],
- ["C25D",0x64FB],
- ["EFD7",0x64FC],
- ["EFD3",0x64FD],
- ["C25A",0x64FE],
- ["EFD1",0x64FF],
- ["C36B",0x6500],
- ["EFD5",0x6501],
- ["EFD6",0x6503],
- ["EFD2",0x6504],
- ["C25B",0x6506],
- ["F242",0x6507],
- ["F245",0x6509],
- ["F246",0x650C],
- ["F244",0x650D],
- ["F247",0x650E],
- ["C36C",0x650F],
- ["F243",0x6510],
- ["F44E",0x6513],
- ["C464",0x6514],
- ["F44D",0x6515],
- ["F44C",0x6516],
- ["F44B",0x6517],
- ["C463",0x6518],
- ["C465",0x6519],
- ["F5CD",0x651B],
- ["C4E2",0x651C],
- ["C4E1",0x651D],
- ["F6E1",0x6520],
- ["F6E0",0x6521],
- ["F6E3",0x6522],
- ["C5CB",0x6523],
- ["C575",0x6524],
- ["F7DD",0x6525],
- ["F6E2",0x6526],
- ["F7DC",0x6529],
- ["C5CD",0x652A],
- ["C5CC",0x652B],
- ["C5F3",0x652C],
- ["F8A9",0x652D],
- ["F8EF",0x652E],
- ["A4E4",0x652F],
- ["D972",0x6532],
- ["E9AF",0x6533],
- ["A6AC",0x6536],
- ["CAF7",0x6537],
- ["A7F1",0x6538],
- ["A7EF",0x6539],
- ["A7F0",0x653B],
- ["CCC1",0x653D],
- ["A9F1",0x653E],
- ["AC46",0x653F],
- ["CEE7",0x6541],
- ["CEE8",0x6543],
- ["AC47",0x6545],
- ["D1CE",0x6546],
- ["AEC4",0x6548],
- ["AEC5",0x6549],
- ["D1CD",0x654A],
- ["B1D3",0x654F],
- ["B1CF",0x6551],
- ["D5A7",0x6553],
- ["B1D6",0x6554],
- ["B1D5",0x6555],
- ["B1CE",0x6556],
- ["B1D1",0x6557],
- ["B1D4",0x6558],
- ["B1D0",0x6559],
- ["D976",0x655C],
- ["B1CD",0x655D],
- ["B4AF",0x655E],
- ["B4B1",0x6562],
- ["B4B2",0x6563],
- ["D975",0x6564],
- ["D978",0x6565],
- ["B4B0",0x6566],
- ["D973",0x6567],
- ["D977",0x6568],
- ["D974",0x656A],
- ["B771",0x656C],
- ["DDBC",0x656F],
- ["BA56",0x6572],
- ["E1F4",0x6573],
- ["BEE3",0x6574],
- ["BCC4",0x6575],
- ["E5BD",0x6576],
- ["BCC5",0x6577],
- ["BCC6",0x6578],
- ["E5BF",0x6579],
- ["E5BE",0x657A],
- ["E5C0",0x657B],
- ["E9B1",0x657C],
- ["E9B0",0x657F],
- ["ECEF",0x6580],
- ["ECEE",0x6581],
- ["C0C4",0x6582],
- ["C0C5",0x6583],
- ["F248",0x6584],
- ["A4E5",0x6587],
- ["D979",0x658C],
- ["B4B4",0x6590],
- ["B4B3",0x6591],
- ["DDBD",0x6592],
- ["EFD8",0x6594],
- ["C4E3",0x6595],
- ["F7DE",0x6596],
- ["A4E6",0x6597],
- ["AEC6",0x6599],
- ["B1D8",0x659B],
- ["B1D7",0x659C],
- ["D97A",0x659D],
- ["D97B",0x659E],
- ["B772",0x659F],
- ["E1F5",0x65A0],
- ["BA57",0x65A1],
- ["E9B2",0x65A2],
- ["A4E7",0x65A4],
- ["A5B8",0x65A5],
- ["A9F2",0x65A7],
- ["CCC2",0x65A8],
- ["CEE9",0x65AA],
- ["AC48",0x65AB],
- ["B1D9",0x65AC],
- ["D97C",0x65AE],
- ["B4B5",0x65AF],
- ["B773",0x65B0],
- ["E5C1",0x65B2],
- ["E5C2",0x65B3],
- ["ECF0",0x65B6],
- ["C25F",0x65B7],
- ["F8F0",0x65B8],
- ["A4E8",0x65B9],
- ["CCC3",0x65BB],
- ["A9F3",0x65BC],
- ["AC49",0x65BD],
- ["CEEA",0x65BF],
- ["AEC7",0x65C1],
- ["D1D2",0x65C2],
- ["D1D0",0x65C3],
- ["D1D1",0x65C4],
- ["AEC8",0x65C5],
- ["D1CF",0x65C6],
- ["B1DB",0x65CB],
- ["B1DC",0x65CC],
- ["D5A8",0x65CD],
- ["B1DD",0x65CE],
- ["B1DA",0x65CF],
- ["D97D",0x65D0],
- ["D97E",0x65D2],
- ["DDBE",0x65D3],
- ["BA59",0x65D6],
- ["BA58",0x65D7],
- ["ECF1",0x65DA],
- ["EFD9",0x65DB],
- ["F24A",0x65DD],
- ["F249",0x65DE],
- ["F44F",0x65DF],
- ["C95E",0x65E1],
- ["AC4A",0x65E2],
- ["A4E9",0x65E5],
- ["A5B9",0x65E6],
- ["A6AE",0x65E8],
- ["A6AD",0x65E9],
- ["A6AF",0x65EC],
- ["A6B0",0x65ED],
- ["C9EE",0x65EE],
- ["C9ED",0x65EF],
- ["CAF8",0x65F0],
- ["A7F2",0x65F1],
- ["CAFB",0x65F2],
- ["CAFA",0x65F3],
- ["CAF9",0x65F4],
- ["CAFC",0x65F5],
- ["A9F4",0x65FA],
- ["CCC9",0x65FB],
- ["CCC5",0x65FC],
- ["CCCE",0x65FD],
- ["A9FB",0x6600],
- ["A9F9",0x6602],
- ["CCCA",0x6603],
- ["CCC6",0x6604],
- ["CCCD",0x6605],
- ["A9F8",0x6606],
- ["AA40",0x6607],
- ["CCC8",0x6608],
- ["CCC4",0x6609],
- ["A9FE",0x660A],
- ["CCCB",0x660B],
- ["A9F7",0x660C],
- ["CCCC",0x660D],
- ["A9FA",0x660E],
- ["A9FC",0x660F],
- ["CCD0",0x6610],
- ["CCCF",0x6611],
- ["CCC7",0x6612],
- ["A9F6",0x6613],
- ["A9F5",0x6614],
- ["A9FD",0x6615],
- ["CEEF",0x661C],
- ["CEF5",0x661D],
- ["AC50",0x661F],
- ["AC4D",0x6620],
- ["CEEC",0x6621],
- ["CEF1",0x6622],
- ["AC53",0x6624],
- ["AC4B",0x6625],
- ["CEF0",0x6626],
- ["AC4E",0x6627],
- ["AC51",0x6628],
- ["CEF3",0x662B],
- ["AC4C",0x662D],
- ["CEF8",0x662E],
- ["AC4F",0x662F],
- ["AC52",0x6631],
- ["CEED",0x6632],
- ["CEF2",0x6633],
- ["CEF6",0x6634],
- ["CEEE",0x6635],
- ["CEEB",0x6636],
- ["CEF7",0x6639],
- ["CEF4",0x663A],
- ["AED0",0x6641],
- ["AEC9",0x6642],
- ["AECC",0x6643],
- ["AECF",0x6645],
- ["D1D5",0x6647],
- ["AECA",0x6649],
- ["D1D3",0x664A],
- ["AECE",0x664C],
- ["AECB",0x664F],
- ["D1D6",0x6651],
- ["AECD",0x6652],
- ["D5AC",0x6659],
- ["B1DF",0x665A],
- ["D5AB",0x665B],
- ["D5AD",0x665C],
- ["B1DE",0x665D],
- ["B1E3",0x665E],
- ["D1D4",0x665F],
- ["D5AA",0x6661],
- ["D5AE",0x6662],
- ["B1E0",0x6664],
- ["D5A9",0x6665],
- ["B1E2",0x6666],
- ["B1E1",0x6668],
- ["D9A7",0x666A],
- ["D9A2",0x666C],
- ["B4B6",0x666E],
- ["B4BA",0x666F],
- ["B4B7",0x6670],
- ["D9A5",0x6671],
- ["D9A8",0x6672],
- ["B4B8",0x6674],
- ["B4B9",0x6676],
- ["B4BE",0x6677],
- ["DDC7",0x6678],
- ["D9A6",0x6679],
- ["B4BC",0x667A],
- ["D9A3",0x667B],
- ["D9A1",0x667C],
- ["B4BD",0x667E],
- ["D9A4",0x6680],
- ["B779",0x6684],
- ["DDBF",0x6686],
- ["B776",0x6687],
- ["B777",0x6688],
- ["B775",0x6689],
- ["DDC4",0x668A],
- ["DDC3",0x668B],
- ["DDC0",0x668C],
- ["B77B",0x668D],
- ["DDC2",0x6690],
- ["B4BB",0x6691],
- ["DDC6",0x6694],
- ["DDC1",0x6695],
- ["B778",0x6696],
- ["B774",0x6697],
- ["B77A",0x6698],
- ["DDC5",0x6699],
- ["BA5C",0x669D],
- ["E1F8",0x669F],
- ["E1F7",0x66A0],
- ["E1F6",0x66A1],
- ["BA5A",0x66A2],
- ["BA5B",0x66A8],
- ["E5C5",0x66A9],
- ["E5C8",0x66AA],
- ["BCC8",0x66AB],
- ["BCC7",0x66AE],
- ["E5C9",0x66AF],
- ["E5C4",0x66B0],
- ["BCCA",0x66B1],
- ["E5C6",0x66B2],
- ["BCC9",0x66B4],
- ["E5C3",0x66B5],
- ["E5C7",0x66B7],
- ["BEE9",0x66B8],
- ["BEE6",0x66B9],
- ["E9BB",0x66BA],
- ["E9BA",0x66BB],
- ["E9B9",0x66BD],
- ["E9B4",0x66BE],
- ["E9B5",0x66C0],
- ["BEE7",0x66C4],
- ["BEE4",0x66C6],
- ["BEE8",0x66C7],
- ["E9B3",0x66C8],
- ["BEE5",0x66C9],
- ["E9B6",0x66CA],
- ["E9B7",0x66CB],
- ["E9BC",0x66CC],
- ["E9B8",0x66CF],
- ["ECF2",0x66D2],
- ["C0C7",0x66D6],
- ["EFDC",0x66D8],
- ["C0C6",0x66D9],
- ["EFDA",0x66DA],
- ["EFDB",0x66DB],
- ["C260",0x66DC],
- ["C36E",0x66DD],
- ["F24B",0x66DE],
- ["C36D",0x66E0],
- ["F451",0x66E3],
- ["F452",0x66E4],
- ["C466",0x66E6],
- ["F450",0x66E8],
- ["C4E4",0x66E9],
- ["F7DF",0x66EB],
- ["C5CE",0x66EC],
- ["F8AA",0x66ED],
- ["F8AB",0x66EE],
- ["A4EA",0x66F0],
- ["A6B1",0x66F2],
- ["A6B2",0x66F3],
- ["A7F3",0x66F4],
- ["CCD1",0x66F6],
- ["AC54",0x66F7],
- ["AED1",0x66F8],
- ["B1E4",0x66F9],
- ["B0D2",0x66FC],
- ["B4BF",0x66FE],
- ["B4C0",0x66FF],
- ["B3CC",0x6700],
- ["D9A9",0x6701],
- ["B77C",0x6703],
- ["E1FA",0x6704],
- ["E1F9",0x6705],
- ["A4EB",0x6708],
- ["A6B3",0x6709],
- ["CCD2",0x670A],
- ["AA42",0x670B],
- ["AA41",0x670D],
- ["CEF9",0x670F],
- ["CEFA",0x6710],
- ["D1D7",0x6712],
- ["D1D8",0x6713],
- ["AED2",0x6714],
- ["AED3",0x6715],
- ["AED4",0x6717],
- ["D5AF",0x6718],
- ["B1E6",0x671B],
- ["B4C2",0x671D],
- ["B4C1",0x671F],
- ["DDC8",0x6720],
- ["DF7A",0x6721],
- ["E1FB",0x6722],
- ["E9BD",0x6723],
- ["C261",0x6726],
- ["C467",0x6727],
- ["A4EC",0x6728],
- ["A5BC",0x672A],
- ["A5BD",0x672B],
- ["A5BB",0x672C],
- ["A5BE",0x672D],
- ["A5BA",0x672E],
- ["A6B6",0x6731],
- ["C9F6",0x6733],
- ["A6B5",0x6734],
- ["A6B7",0x6735],
- ["C9F1",0x6738],
- ["C9F0",0x6739],
- ["C9F3",0x673A],
- ["C9F2",0x673B],
- ["C9F5",0x673C],
- ["A6B4",0x673D],
- ["C9EF",0x673E],
- ["C9F4",0x673F],
- ["CAFD",0x6745],
- ["A7FD",0x6746],
- ["CAFE",0x6747],
- ["CB43",0x6748],
- ["A7FC",0x6749],
- ["CB47",0x674B],
- ["CB42",0x674C],
- ["CB45",0x674D],
- ["A7F5",0x674E],
- ["A7F6",0x674F],
- ["A7F7",0x6750],
- ["A7F8",0x6751],
- ["A840",0x6753],
- ["CB41",0x6755],
- ["A7FA",0x6756],
- ["A841",0x6757],
- ["CB40",0x6759],
- ["CB46",0x675A],
- ["A7F9",0x675C],
- ["CB44",0x675D],
- ["A7FB",0x675E],
- ["A7F4",0x675F],
- ["A7FE",0x6760],
- ["AA57",0x676A],
- ["CCD4",0x676C],
- ["AA43",0x676D],
- ["AA4D",0x676F],
- ["AA4E",0x6770],
- ["AA46",0x6771],
- ["AA58",0x6772],
- ["AA48",0x6773],
- ["CCDC",0x6774],
- ["AA53",0x6775],
- ["CCD7",0x6776],
- ["AA49",0x6777],
- ["CCE6",0x6778],
- ["CCE7",0x6779],
- ["CCDF",0x677A],
- ["CCD8",0x677B],
- ["AA56",0x677C],
- ["CCE4",0x677D],
- ["AA51",0x677E],
- ["AA4F",0x677F],
- ["CCE5",0x6781],
- ["CCE3",0x6783],
- ["CCDB",0x6784],
- ["CCD3",0x6785],
- ["CCDA",0x6786],
- ["AA4A",0x6787],
- ["AA50",0x6789],
- ["AA44",0x678B],
- ["CCDE",0x678C],
- ["CCDD",0x678D],
- ["CCD5",0x678E],
- ["AA52",0x6790],
- ["CCE1",0x6791],
- ["CCD6",0x6792],
- ["AA55",0x6793],
- ["CCE8",0x6794],
- ["AA45",0x6795],
- ["AA4C",0x6797],
- ["CCD9",0x6798],
- ["CCE2",0x6799],
- ["AA54",0x679A],
- ["AA47",0x679C],
- ["AA4B",0x679D],
- ["CCE0",0x679F],
- ["CF5B",0x67AE],
- ["AC5C",0x67AF],
- ["AC69",0x67B0],
- ["CF56",0x67B2],
- ["CF4C",0x67B3],
- ["AC62",0x67B4],
- ["CF4A",0x67B5],
- ["AC5B",0x67B6],
- ["CF45",0x67B7],
- ["AC65",0x67B8],
- ["CF52",0x67B9],
- ["CEFE",0x67BA],
- ["CF41",0x67BB],
- ["CF44",0x67C0],
- ["CEFB",0x67C1],
- ["CF51",0x67C2],
- ["CF61",0x67C3],
- ["AC60",0x67C4],
- ["CF46",0x67C5],
- ["CF58",0x67C6],
- ["CEFD",0x67C8],
- ["CF5F",0x67C9],
- ["CF60",0x67CA],
- ["CF63",0x67CB],
- ["CF5A",0x67CC],
- ["CF4B",0x67CD],
- ["CF53",0x67CE],
- ["AC66",0x67CF],
- ["AC59",0x67D0],
- ["AC61",0x67D1],
- ["AC6D",0x67D2],
- ["AC56",0x67D3],
- ["AC58",0x67D4],
- ["CF43",0x67D8],
- ["AC6A",0x67D9],
- ["AC63",0x67DA],
- ["CF5D",0x67DB],
- ["CF40",0x67DC],
- ["AC6C",0x67DD],
- ["AC67",0x67DE],
- ["CF49",0x67DF],
- ["AC6B",0x67E2],
- ["CF50",0x67E3],
- ["CF48",0x67E4],
- ["AC64",0x67E5],
- ["CF5C",0x67E6],
- ["CF54",0x67E7],
- ["AC5E",0x67E9],
- ["CF62",0x67EA],
- ["CF47",0x67EB],
- ["AC5A",0x67EC],
- ["CF59",0x67ED],
- ["CF4F",0x67EE],
- ["AC5F",0x67EF],
- ["CF55",0x67F0],
- ["AC57",0x67F1],
- ["CEFC",0x67F2],
- ["AC68",0x67F3],
- ["AEE3",0x67F4],
- ["AC5D",0x67F5],
- ["CF4E",0x67F6],
- ["CF4D",0x67F7],
- ["CF42",0x67F8],
- ["CF5E",0x67FA],
- ["CF57",0x67FC],
- ["AC55",0x67FF],
- ["D1EC",0x6812],
- ["AEEA",0x6813],
- ["D1ED",0x6814],
- ["D1E1",0x6816],
- ["AEDF",0x6817],
- ["AEEB",0x6818],
- ["D1DA",0x681A],
- ["D1E3",0x681C],
- ["D1EB",0x681D],
- ["D1D9",0x681F],
- ["D1F4",0x6820],
- ["AED5",0x6821],
- ["D1F3",0x6825],
- ["D1EE",0x6826],
- ["D1EF",0x6828],
- ["AEDD",0x6829],
- ["AEE8",0x682A],
- ["D1E5",0x682B],
- ["D1E6",0x682D],
- ["D1F0",0x682E],
- ["D1E7",0x682F],
- ["D1E2",0x6831],
- ["D1DC",0x6832],
- ["D1DD",0x6833],
- ["D1EA",0x6834],
- ["D1E4",0x6835],
- ["AED6",0x6838],
- ["AEDA",0x6839],
- ["D1F2",0x683A],
- ["D1DE",0x683B],
- ["AEE6",0x683C],
- ["AEE2",0x683D],
- ["AEE5",0x6840],
- ["AEEC",0x6841],
- ["AEDB",0x6842],
- ["AEE7",0x6843],
- ["D1E9",0x6844],
- ["AEE9",0x6845],
- ["AED8",0x6846],
- ["AED7",0x6848],
- ["D1DB",0x6849],
- ["D1DF",0x684B],
- ["AEE0",0x684C],
- ["D1F1",0x684D],
- ["D1E8",0x684E],
- ["D1E0",0x684F],
- ["AEE4",0x6850],
- ["AEE1",0x6851],
- ["AED9",0x6853],
- ["AEDC",0x6854],
- ["D5C4",0x686B],
- ["D5B4",0x686D],
- ["D5B5",0x686E],
- ["D5B9",0x686F],
- ["D5C8",0x6871],
- ["D5C5",0x6872],
- ["D5BE",0x6874],
- ["D5BD",0x6875],
- ["B1ED",0x6876],
- ["D5C1",0x6877],
- ["D5D0",0x6878],
- ["D5B0",0x6879],
- ["D5D1",0x687B],
- ["D5C3",0x687C],
- ["D5D5",0x687D],
- ["D5C9",0x687E],
- ["B1EC",0x687F],
- ["D5C7",0x6880],
- ["B1E7",0x6881],
- ["B1FC",0x6882],
- ["B1F2",0x6883],
- ["B1F6",0x6885],
- ["B1F5",0x6886],
- ["D5B1",0x6887],
- ["D5CE",0x6889],
- ["D5D4",0x688A],
- ["D5CC",0x688B],
- ["D5D3",0x688C],
- ["D5C0",0x688F],
- ["D5B2",0x6890],
- ["D5D2",0x6891],
- ["D5C2",0x6892],
- ["B1EA",0x6893],
- ["B1F7",0x6894],
- ["D5CB",0x6896],
- ["B1F0",0x6897],
- ["D5CA",0x689B],
- ["D5B3",0x689C],
- ["B1F8",0x689D],
- ["B1FA",0x689F],
- ["D5CD",0x68A0],
- ["B1FB",0x68A1],
- ["B1E9",0x68A2],
- ["D5BA",0x68A3],
- ["D5CF",0x68A4],
- ["B1EF",0x68A7],
- ["B1F9",0x68A8],
- ["D5BC",0x68A9],
- ["D5C6",0x68AA],
- ["D5B7",0x68AB],
- ["D5BB",0x68AC],
- ["B1F4",0x68AD],
- ["D5B6",0x68AE],
- ["B1E8",0x68AF],
- ["B1F1",0x68B0],
- ["B1EE",0x68B1],
- ["D5BF",0x68B2],
- ["AEDE",0x68B3],
- ["D9C0",0x68B4],
- ["B1EB",0x68B5],
- ["B1F3",0x68C4],
- ["D9C3",0x68C6],
- ["D9D9",0x68C7],
- ["D9CE",0x68C8],
- ["B4D6",0x68C9],
- ["B4D1",0x68CB],
- ["D9BD",0x68CC],
- ["B4D2",0x68CD],
- ["D9CD",0x68CE],
- ["D9C6",0x68D0],
- ["D9D3",0x68D1],
- ["B4CE",0x68D2],
- ["D9AB",0x68D3],
- ["D9D5",0x68D4],
- ["B4C4",0x68D5],
- ["D9B3",0x68D6],
- ["B4C7",0x68D7],
- ["B4C6",0x68D8],
- ["B4D7",0x68DA],
- ["D9AD",0x68DC],
- ["D9CF",0x68DD],
- ["D9D0",0x68DE],
- ["B4C9",0x68DF],
- ["B4C5",0x68E0],
- ["D9BB",0x68E1],
- ["B4D0",0x68E3],
- ["D9B6",0x68E4],
- ["D9D1",0x68E6],
- ["B4CC",0x68E7],
- ["D9C9",0x68E8],
- ["D9D6",0x68E9],
- ["D9B0",0x68EA],
- ["D9B5",0x68EB],
- ["D9AF",0x68EC],
- ["B4CB",0x68EE],
- ["D9C2",0x68EF],
- ["DDDE",0x68F0],
- ["D9B1",0x68F1],
- ["B4CF",0x68F2],
- ["D9BA",0x68F3],
- ["D9D2",0x68F4],
- ["B4CA",0x68F5],
- ["D9B7",0x68F6],
- ["D9B4",0x68F7],
- ["D9C5",0x68F8],
- ["B4CD",0x68F9],
- ["B4C3",0x68FA],
- ["B4D9",0x68FB],
- ["D9C8",0x68FC],
- ["D9C7",0x68FD],
- ["D9AC",0x6904],
- ["B4C8",0x6905],
- ["D9D4",0x6906],
- ["D9BC",0x6907],
- ["D9BE",0x6908],
- ["D9CB",0x690A],
- ["D9CA",0x690B],
- ["D9AA",0x690C],
- ["B4D3",0x690D],
- ["B4D5",0x690E],
- ["D9B2",0x690F],
- ["D9B9",0x6910],
- ["D9C1",0x6911],
- ["B4D4",0x6912],
- ["D9B8",0x6913],
- ["D9C4",0x6914],
- ["D9D7",0x6915],
- ["D9CC",0x6917],
- ["D9D8",0x6925],
- ["D9AE",0x692A],
- ["DDF2",0x692F],
- ["B7A6",0x6930],
- ["DDF0",0x6932],
- ["DDDB",0x6933],
- ["DDE0",0x6934],
- ["DDD9",0x6935],
- ["DDEC",0x6937],
- ["DDCB",0x6938],
- ["DDD2",0x6939],
- ["DDEA",0x693B],
- ["DDF4",0x693C],
- ["DDDC",0x693D],
- ["DDCF",0x693F],
- ["DDE2",0x6940],
- ["DDE7",0x6941],
- ["DDD3",0x6942],
- ["DDE4",0x6944],
- ["DDD0",0x6945],
- ["DDD7",0x6948],
- ["DDD8",0x6949],
- ["B7A8",0x694A],
- ["DDEB",0x694B],
- ["DDE9",0x694C],
- ["DDCC",0x694E],
- ["DDEE",0x694F],
- ["DDEF",0x6951],
- ["DDF1",0x6952],
- ["B7AC",0x6953],
- ["B7A4",0x6954],
- ["D5B8",0x6956],
- ["DDD4",0x6957],
- ["DDE6",0x6958],
- ["DDD5",0x6959],
- ["B7A1",0x695A],
- ["B7B1",0x695B],
- ["DDED",0x695C],
- ["B7AF",0x695D],
- ["B7AB",0x695E],
- ["DDCA",0x695F],
- ["B7A3",0x6960],
- ["DDCD",0x6962],
- ["B7B0",0x6963],
- ["DDDD",0x6965],
- ["DDC9",0x6966],
- ["B7A9",0x6968],
- ["DDE1",0x6969],
- ["DDD1",0x696A],
- ["B7AA",0x696B],
- ["DDDA",0x696C],
- ["B77E",0x696D],
- ["B4D8",0x696E],
- ["DDE3",0x696F],
- ["D9BF",0x6970],
- ["DDCE",0x6971],
- ["DDE8",0x6974],
- ["B7A5",0x6975],
- ["DDE5",0x6976],
- ["B7A2",0x6977],
- ["DDDF",0x6978],
- ["B7AD",0x6979],
- ["DDD6",0x697A],
- ["DDF3",0x697B],
- ["B7A7",0x6982],
- ["DEC6",0x6983],
- ["B7AE",0x6986],
- ["E24A",0x698D],
- ["E248",0x698E],
- ["E25E",0x6990],
- ["E246",0x6991],
- ["E258",0x6993],
- ["B77D",0x6994],
- ["BA5F",0x6995],
- ["E242",0x6996],
- ["E25D",0x6997],
- ["E247",0x6999],
- ["E255",0x699A],
- ["BA64",0x699B],
- ["BA5D",0x699C],
- ["E25B",0x699E],
- ["E240",0x69A0],
- ["E25A",0x69A1],
- ["BA6F",0x69A3],
- ["E251",0x69A4],
- ["E261",0x69A5],
- ["BA6D",0x69A6],
- ["E249",0x69A7],
- ["BA5E",0x69A8],
- ["E24B",0x69A9],
- ["E259",0x69AA],
- ["BA67",0x69AB],
- ["E244",0x69AC],
- ["BA6B",0x69AD],
- ["BA61",0x69AE],
- ["E24D",0x69AF],
- ["E243",0x69B0],
- ["E1FC",0x69B1],
- ["E257",0x69B3],
- ["BA68",0x69B4],
- ["E260",0x69B5],
- ["E1FD",0x69B6],
- ["BA65",0x69B7],
- ["E253",0x69B9],
- ["BA66",0x69BB],
- ["E245",0x69BC],
- ["E250",0x69BD],
- ["E24C",0x69BE],
- ["E24E",0x69BF],
- ["BA60",0x69C1],
- ["E25F",0x69C2],
- ["BA6E",0x69C3],
- ["E24F",0x69C4],
- ["E262",0x69C6],
- ["E1FE",0x69C9],
- ["E254",0x69CA],
- ["BA63",0x69CB],
- ["BA6C",0x69CC],
- ["BA6A",0x69CD],
- ["E241",0x69CE],
- ["E256",0x69CF],
- ["BA69",0x69D0],
- ["BA62",0x69D3],
- ["E252",0x69D4],
- ["E25C",0x69D9],
- ["E5D5",0x69E2],
- ["E5D1",0x69E4],
- ["E5CD",0x69E5],
- ["E5E1",0x69E6],
- ["E5DE",0x69E7],
- ["BCCD",0x69E8],
- ["E5E5",0x69EB],
- ["E5D4",0x69EC],
- ["BCD8",0x69ED],
- ["E5DB",0x69EE],
- ["E5D0",0x69F1],
- ["E5DA",0x69F2],
- ["BCD5",0x69F3],
- ["E5EE",0x69F4],
- ["E5EB",0x69F6],
- ["E5DD",0x69F7],
- ["E5CE",0x69F8],
- ["E5E2",0x69FB],
- ["E5E4",0x69FC],
- ["BCD1",0x69FD],
- ["E5D8",0x69FE],
- ["E5D3",0x69FF],
- ["E5CA",0x6A00],
- ["BCCE",0x6A01],
- ["BCD6",0x6A02],
- ["E5E7",0x6A04],
- ["BCD7",0x6A05],
- ["E5CB",0x6A06],
- ["E5ED",0x6A07],
- ["E5E0",0x6A08],
- ["E5E6",0x6A09],
- ["BCD4",0x6A0A],
- ["E5E3",0x6A0D],
- ["E5EA",0x6A0F],
- ["BCD9",0x6A11],
- ["BCD3",0x6A13],
- ["E5DC",0x6A14],
- ["E5CF",0x6A15],
- ["E5EF",0x6A16],
- ["E5CC",0x6A17],
- ["E5E8",0x6A18],
- ["BCD0",0x6A19],
- ["E5D6",0x6A1B],
- ["E5D7",0x6A1D],
- ["BCCF",0x6A1E],
- ["BCCC",0x6A1F],
- ["E5D2",0x6A20],
- ["BCD2",0x6A21],
- ["BCCB",0x6A23],
- ["E5E9",0x6A25],
- ["E5EC",0x6A26],
- ["E5D9",0x6A27],
- ["E9CA",0x6A28],
- ["E9C2",0x6A32],
- ["E9BE",0x6A34],
- ["BEF6",0x6A35],
- ["BEEB",0x6A38],
- ["BEF0",0x6A39],
- ["BEEC",0x6A3A],
- ["E9CC",0x6A3B],
- ["E9D7",0x6A3C],
- ["BEEA",0x6A3D],
- ["E9C4",0x6A3E],
- ["E9CD",0x6A3F],
- ["E5DF",0x6A40],
- ["E9CE",0x6A41],
- ["BEF1",0x6A44],
- ["E9DD",0x6A46],
- ["BEF5",0x6A47],
- ["BEF8",0x6A48],
- ["E9C0",0x6A49],
- ["BEF4",0x6A4B],
- ["E9DB",0x6A4D],
- ["E9DC",0x6A4E],
- ["E9D2",0x6A4F],
- ["E9D1",0x6A50],
- ["E9C9",0x6A51],
- ["E9D3",0x6A54],
- ["E9DA",0x6A55],
- ["E9D9",0x6A56],
- ["BEEF",0x6A58],
- ["BEED",0x6A59],
- ["E9CB",0x6A5A],
- ["E9C8",0x6A5B],
- ["E9C5",0x6A5D],
- ["E9D8",0x6A5E],
- ["BEF7",0x6A5F],
- ["E9D6",0x6A60],
- ["BEF3",0x6A61],
- ["BEF2",0x6A62],
- ["E9D0",0x6A64],
- ["E9BF",0x6A66],
- ["E9C1",0x6A67],
- ["E9C3",0x6A68],
- ["E9D5",0x6A69],
- ["E9CF",0x6A6A],
- ["BEEE",0x6A6B],
- ["E9C6",0x6A6D],
- ["E9D4",0x6A6F],
- ["E9C7",0x6A76],
- ["C0CF",0x6A7E],
- ["ED45",0x6A7F],
- ["C0C8",0x6A80],
- ["ECF5",0x6A81],
- ["ED41",0x6A83],
- ["C0CA",0x6A84],
- ["ED48",0x6A85],
- ["ECFC",0x6A87],
- ["ECF7",0x6A89],
- ["ED49",0x6A8C],
- ["ECF3",0x6A8D],
- ["ECFE",0x6A8E],
- ["C0D1",0x6A90],
- ["ED44",0x6A91],
- ["ED4A",0x6A92],
- ["ECFD",0x6A93],
- ["C0C9",0x6A94],
- ["ED40",0x6A95],
- ["ECF4",0x6A96],
- ["C0D0",0x6A97],
- ["ED47",0x6A9A],
- ["ECF9",0x6A9B],
- ["C0CC",0x6A9C],
- ["ECFB",0x6A9E],
- ["ECF8",0x6A9F],
- ["C0D2",0x6AA0],
- ["ECFA",0x6AA1],
- ["C0CB",0x6AA2],
- ["C0CE",0x6AA3],
- ["ED43",0x6AA4],
- ["ECF6",0x6AA5],
- ["ED46",0x6AA6],
- ["ED42",0x6AA8],
- ["C263",0x6AAC],
- ["EFE7",0x6AAD],
- ["C268",0x6AAE],
- ["C269",0x6AAF],
- ["C262",0x6AB3],
- ["EFE6",0x6AB4],
- ["EFE3",0x6AB6],
- ["EFE4",0x6AB7],
- ["C266",0x6AB8],
- ["EFDE",0x6AB9],
- ["EFE2",0x6ABA],
- ["C265",0x6ABB],
- ["EFDF",0x6ABD],
- ["C267",0x6AC2],
- ["C264",0x6AC3],
- ["EFDD",0x6AC5],
- ["EFE1",0x6AC6],
- ["EFE5",0x6AC7],
- ["F251",0x6ACB],
- ["F24E",0x6ACC],
- ["F257",0x6ACD],
- ["F256",0x6ACF],
- ["F254",0x6AD0],
- ["F24F",0x6AD1],
- ["C372",0x6AD3],
- ["F250",0x6AD9],
- ["C371",0x6ADA],
- ["C0CD",0x6ADB],
- ["F253",0x6ADC],
- ["C370",0x6ADD],
- ["F258",0x6ADE],
- ["F252",0x6ADF],
- ["F24D",0x6AE0],
- ["EFE0",0x6AE1],
- ["C36F",0x6AE5],
- ["F24C",0x6AE7],
- ["F456",0x6AE8],
- ["F455",0x6AEA],
- ["F255",0x6AEB],
- ["C468",0x6AEC],
- ["F459",0x6AEE],
- ["F45A",0x6AEF],
- ["F454",0x6AF0],
- ["F458",0x6AF1],
- ["F453",0x6AF3],
- ["F5D1",0x6AF8],
- ["F457",0x6AF9],
- ["C4E7",0x6AFA],
- ["C4E5",0x6AFB],
- ["F5CF",0x6AFC],
- ["F5D2",0x6B00],
- ["F5CE",0x6B02],
- ["F5D0",0x6B03],
- ["C4E6",0x6B04],
- ["F6E5",0x6B08],
- ["F6E6",0x6B09],
- ["C576",0x6B0A],
- ["F6E4",0x6B0B],
- ["F7E2",0x6B0F],
- ["C5CF",0x6B10],
- ["F7E0",0x6B11],
- ["F7E1",0x6B12],
- ["F8AC",0x6B13],
- ["C656",0x6B16],
- ["F8F3",0x6B17],
- ["F8F1",0x6B18],
- ["F8F2",0x6B19],
- ["F8F4",0x6B1A],
- ["F9BB",0x6B1E],
- ["A4ED",0x6B20],
- ["A6B8",0x6B21],
- ["AA59",0x6B23],
- ["CCE9",0x6B25],
- ["CF64",0x6B28],
- ["D1F5",0x6B2C],
- ["D1F7",0x6B2D],
- ["D1F6",0x6B2F],
- ["D1F8",0x6B31],
- ["B1FD",0x6B32],
- ["D5D7",0x6B33],
- ["D1F9",0x6B34],
- ["D5D6",0x6B36],
- ["D5D8",0x6B37],
- ["D5D9",0x6B38],
- ["D9DA",0x6B39],
- ["B4DB",0x6B3A],
- ["D9DB",0x6B3B],
- ["D9DD",0x6B3C],
- ["B4DC",0x6B3D],
- ["B4DA",0x6B3E],
- ["D9DC",0x6B3F],
- ["DDFA",0x6B41],
- ["DDF8",0x6B42],
- ["DDF7",0x6B43],
- ["DDF6",0x6B45],
- ["DDF5",0x6B46],
- ["B7B2",0x6B47],
- ["DDF9",0x6B48],
- ["BA70",0x6B49],
- ["E263",0x6B4A],
- ["E265",0x6B4B],
- ["BA71",0x6B4C],
- ["E264",0x6B4D],
- ["BCDB",0x6B4E],
- ["BCDA",0x6B50],
- ["E5F0",0x6B51],
- ["E9DF",0x6B54],
- ["E9DE",0x6B55],
- ["E9E0",0x6B56],
- ["BEF9",0x6B59],
- ["ED4B",0x6B5B],
- ["C0D3",0x6B5C],
- ["EFE8",0x6B5E],
- ["C26A",0x6B5F],
- ["F259",0x6B60],
- ["C577",0x6B61],
- ["A4EE",0x6B62],
- ["A5BF",0x6B63],
- ["A6B9",0x6B64],
- ["A842",0x6B65],
- ["AA5A",0x6B66],
- ["AA5B",0x6B67],
- ["AC6E",0x6B6A],
- ["D1FA",0x6B6D],
- ["B7B3",0x6B72],
- ["E6D1",0x6B76],
- ["BEFA",0x6B77],
- ["C26B",0x6B78],
- ["A4EF",0x6B79],
- ["A6BA",0x6B7B],
- ["CCEB",0x6B7E],
- ["AA5C",0x6B7F],
- ["CCEA",0x6B80],
- ["CF65",0x6B82],
- ["AC6F",0x6B83],
- ["CF66",0x6B84],
- ["AC70",0x6B86],
- ["D1FC",0x6B88],
- ["AEEE",0x6B89],
- ["AEED",0x6B8A],
- ["D5DE",0x6B8C],
- ["D5DC",0x6B8D],
- ["D5DD",0x6B8E],
- ["D5DB",0x6B8F],
- ["D5DA",0x6B91],
- ["D9DE",0x6B94],
- ["D9E1",0x6B95],
- ["B4DE",0x6B96],
- ["D9DF",0x6B97],
- ["B4DD",0x6B98],
- ["D9E0",0x6B99],
- ["DDFB",0x6B9B],
- ["E266",0x6B9E],
- ["E267",0x6B9F],
- ["E268",0x6BA0],
- ["E5F3",0x6BA2],
- ["E5F2",0x6BA3],
- ["BCDC",0x6BA4],
- ["E5F1",0x6BA5],
- ["E5F4",0x6BA6],
- ["E9E1",0x6BA7],
- ["E9E2",0x6BAA],
- ["E9E3",0x6BAB],
- ["ED4C",0x6BAD],
- ["C0D4",0x6BAE],
- ["C26C",0x6BAF],
- ["F25A",0x6BB0],
- ["C4E8",0x6BB2],
- ["C95F",0x6BB3],
- ["AC71",0x6BB5],
- ["CF67",0x6BB6],
- ["AEEF",0x6BB7],
- ["B1FE",0x6BBA],
- ["B4DF",0x6BBC],
- ["D9E2",0x6BBD],
- ["B7B5",0x6BBF],
- ["B7B4",0x6BC0],
- ["E269",0x6BC3],
- ["E26A",0x6BC4],
- ["BCDD",0x6BC5],
- ["BCDE",0x6BC6],
- ["E9E5",0x6BC7],
- ["E9E4",0x6BC8],
- ["EFE9",0x6BC9],
- ["F7E3",0x6BCA],
- ["A4F0",0x6BCB],
- ["C960",0x6BCC],
- ["A5C0",0x6BCD],
- ["A843",0x6BCF],
- ["CB48",0x6BD0],
- ["AC72",0x6BD2],
- ["B7B6",0x6BD3],
- ["A4F1",0x6BD4],
- ["CF68",0x6BD6],
- ["AC73",0x6BD7],
- ["CF69",0x6BD8],
- ["C0D5",0x6BDA],
- ["A4F2",0x6BDB],
- ["CCEC",0x6BDE],
- ["CF6A",0x6BE0],
- ["D242",0x6BE2],
- ["D241",0x6BE3],
- ["D1FE",0x6BE4],
- ["D1FD",0x6BE6],
- ["D243",0x6BE7],
- ["D240",0x6BE8],
- ["B240",0x6BEB],
- ["B241",0x6BEC],
- ["B4E0",0x6BEF],
- ["D9E3",0x6BF0],
- ["D9E4",0x6BF2],
- ["D9E5",0x6BF3],
- ["DE41",0x6BF7],
- ["DE42",0x6BF8],
- ["DE40",0x6BF9],
- ["DDFD",0x6BFB],
- ["DDFE",0x6BFC],
- ["B7B7",0x6BFD],
- ["E26B",0x6BFE],
- ["E5F7",0x6BFF],
- ["E5F6",0x6C00],
- ["E5F5",0x6C01],
- ["E5F8",0x6C02],
- ["E9E7",0x6C03],
- ["E9E6",0x6C04],
- ["BEFB",0x6C05],
- ["E9E8",0x6C06],
- ["C0D6",0x6C08],
- ["ED4D",0x6C09],
- ["EFEA",0x6C0B],
- ["F25B",0x6C0C],
- ["F6E7",0x6C0D],
- ["A4F3",0x6C0F],
- ["A5C2",0x6C10],
- ["A5C1",0x6C11],
- ["AA5D",0x6C13],
- ["C961",0x6C14],
- ["C97E",0x6C15],
- ["A6BB",0x6C16],
- ["C9F7",0x6C18],
- ["CB49",0x6C19],
- ["CB4A",0x6C1A],
- ["AA5E",0x6C1B],
- ["CCED",0x6C1D],
- ["AC74",0x6C1F],
- ["CF6B",0x6C20],
- ["CF6C",0x6C21],
- ["AEF0",0x6C23],
- ["AEF4",0x6C24],
- ["D244",0x6C25],
- ["AEF3",0x6C26],
- ["AEF1",0x6C27],
- ["AEF2",0x6C28],
- ["D5DF",0x6C2A],
- ["B242",0x6C2B],
- ["B4E3",0x6C2C],
- ["B4E1",0x6C2E],
- ["B4E2",0x6C2F],
- ["D9E6",0x6C30],
- ["BA72",0x6C33],
- ["A4F4",0x6C34],
- ["C9A1",0x6C36],
- ["A5C3",0x6C38],
- ["C9A4",0x6C3B],
- ["A5C6",0x6C3E],
- ["C9A3",0x6C3F],
- ["A5C5",0x6C40],
- ["A5C4",0x6C41],
- ["A844",0x6C42],
- ["C9A2",0x6C43],
- ["C9F8",0x6C46],
- ["C9FC",0x6C4A],
- ["C9FE",0x6C4B],
- ["CA40",0x6C4C],
- ["A6C5",0x6C4D],
- ["A6C6",0x6C4E],
- ["C9FB",0x6C4F],
- ["A6C1",0x6C50],
- ["C9F9",0x6C52],
- ["C9FD",0x6C54],
- ["A6C2",0x6C55],
- ["A6BD",0x6C57],
- ["A6BE",0x6C59],
- ["A6C4",0x6C5B],
- ["C9FA",0x6C5C],
- ["A6BC",0x6C5D],
- ["A845",0x6C5E],
- ["A6BF",0x6C5F],
- ["A6C0",0x6C60],
- ["A6C3",0x6C61],
- ["CB5B",0x6C65],
- ["CB59",0x6C66],
- ["CB4C",0x6C67],
- ["A851",0x6C68],
- ["CB53",0x6C69],
- ["A84C",0x6C6A],
- ["CB4D",0x6C6B],
- ["CB55",0x6C6D],
- ["CB52",0x6C6F],
- ["A84F",0x6C70],
- ["CB51",0x6C71],
- ["A856",0x6C72],
- ["CB5A",0x6C73],
- ["A858",0x6C74],
- ["A85A",0x6C76],
- ["CB4B",0x6C78],
- ["A84D",0x6C7A],
- ["CB5C",0x6C7B],
- ["A854",0x6C7D],
- ["A857",0x6C7E],
- ["CD45",0x6C80],
- ["A847",0x6C81],
- ["A85E",0x6C82],
- ["A855",0x6C83],
- ["CB4E",0x6C84],
- ["A84A",0x6C85],
- ["A859",0x6C86],
- ["CB56",0x6C87],
- ["A848",0x6C88],
- ["A849",0x6C89],
- ["CD43",0x6C8A],
- ["CB4F",0x6C8B],
- ["A850",0x6C8C],
- ["A85B",0x6C8D],
- ["CB5D",0x6C8E],
- ["CB50",0x6C8F],
- ["A84E",0x6C90],
- ["A853",0x6C92],
- ["CCEE",0x6C93],
- ["A85C",0x6C94],
- ["CB57",0x6C95],
- ["A852",0x6C96],
- ["A85D",0x6C98],
- ["A846",0x6C99],
- ["CB54",0x6C9A],
- ["A84B",0x6C9B],
- ["CB58",0x6C9C],
- ["CD44",0x6C9D],
- ["AA6A",0x6CAB],
- ["AA7A",0x6CAC],
- ["CCF5",0x6CAD],
- ["AA71",0x6CAE],
- ["CD4B",0x6CB0],
- ["AA62",0x6CB1],
- ["AA65",0x6CB3],
- ["CD42",0x6CB4],
- ["CCF3",0x6CB6],
- ["CCF7",0x6CB7],
- ["AA6D",0x6CB8],
- ["AA6F",0x6CB9],
- ["CCFA",0x6CBA],
- ["AA76",0x6CBB],
- ["AA68",0x6CBC],
- ["AA66",0x6CBD],
- ["AA67",0x6CBE],
- ["AA75",0x6CBF],
- ["CD47",0x6CC0],
- ["AA70",0x6CC1],
- ["CCF9",0x6CC2],
- ["CCFB",0x6CC3],
- ["AA6E",0x6CC4],
- ["AA73",0x6CC5],
- ["CCFC",0x6CC6],
- ["CD4A",0x6CC7],
- ["AC75",0x6CC9],
- ["AA79",0x6CCA],
- ["AA63",0x6CCC],
- ["CD49",0x6CCD],
- ["CD4D",0x6CCF],
- ["CCF8",0x6CD0],
- ["CD4F",0x6CD1],
- ["CD40",0x6CD2],
- ["AA6C",0x6CD3],
- ["CCF4",0x6CD4],
- ["AA6B",0x6CD5],
- ["AA7D",0x6CD6],
- ["AA72",0x6CD7],
- ["CCF2",0x6CD9],
- ["CF75",0x6CDA],
- ["AA78",0x6CDB],
- ["AA7C",0x6CDC],
- ["CD41",0x6CDD],
- ["CD46",0x6CDE],
- ["AA7E",0x6CE0],
- ["AA77",0x6CE1],
- ["AA69",0x6CE2],
- ["AA5F",0x6CE3],
- ["AA64",0x6CE5],
- ["CCF6",0x6CE7],
- ["AA60",0x6CE8],
- ["CD4E",0x6CE9],
- ["CCF0",0x6CEB],
- ["CCEF",0x6CEC],
- ["CCFD",0x6CED],
- ["CCF1",0x6CEE],
- ["AA7B",0x6CEF],
- ["AEF5",0x6CF0],
- ["AA74",0x6CF1],
- ["CCFE",0x6CF2],
- ["AA61",0x6CF3],
- ["ACA6",0x6CF5],
- ["CD4C",0x6CF9],
- ["CF7C",0x6D00],
- ["CFA1",0x6D01],
- ["CFA4",0x6D03],
- ["CF77",0x6D04],
- ["CFA7",0x6D07],
- ["CFAA",0x6D08],
- ["CFAC",0x6D09],
- ["CF74",0x6D0A],
- ["AC76",0x6D0B],
- ["AC7B",0x6D0C],
- ["D249",0x6D0D],
- ["ACAD",0x6D0E],
- ["CFA5",0x6D0F],
- ["CFAD",0x6D10],
- ["CF7B",0x6D11],
- ["CF73",0x6D12],
- ["D264",0x6D16],
- ["AC7E",0x6D17],
- ["CFA2",0x6D18],
- ["CF78",0x6D19],
- ["CF7A",0x6D1A],
- ["ACA5",0x6D1B],
- ["CF7D",0x6D1D],
- ["AC7D",0x6D1E],
- ["CF70",0x6D1F],
- ["CFA8",0x6D20],
- ["CFAB",0x6D22],
- ["AC7A",0x6D25],
- ["ACA8",0x6D27],
- ["CF6D",0x6D28],
- ["ACAA",0x6D29],
- ["AC78",0x6D2A],
- ["ACAE",0x6D2B],
- ["CFA9",0x6D2C],
- ["CF6F",0x6D2D],
- ["ACAB",0x6D2E],
- ["D25E",0x6D2F],
- ["CD48",0x6D30],
- ["AC7C",0x6D31],
- ["AC77",0x6D32],
- ["CF76",0x6D33],
- ["CF6E",0x6D34],
- ["ACAC",0x6D35],
- ["ACA4",0x6D36],
- ["CFA3",0x6D37],
- ["ACA9",0x6D38],
- ["ACA7",0x6D39],
- ["CF79",0x6D3A],
- ["ACA1",0x6D3B],
- ["CF71",0x6D3C],
- ["ACA2",0x6D3D],
- ["ACA3",0x6D3E],
- ["CF72",0x6D3F],
- ["CFA6",0x6D40],
- ["AC79",0x6D41],
- ["CF7E",0x6D42],
- ["D24C",0x6D58],
- ["AEFD",0x6D59],
- ["AF43",0x6D5A],
- ["D255",0x6D5E],
- ["D25B",0x6D5F],
- ["D257",0x6D60],
- ["D24A",0x6D61],
- ["D24D",0x6D62],
- ["D246",0x6D63],
- ["D247",0x6D64],
- ["AF4A",0x6D65],
- ["AEFA",0x6D66],
- ["D256",0x6D67],
- ["D25F",0x6D68],
- ["AF45",0x6D69],
- ["AEF6",0x6D6A],
- ["AF40",0x6D6C],
- ["D24E",0x6D6D],
- ["AF42",0x6D6E],
- ["D24F",0x6D6F],
- ["D259",0x6D70],
- ["AF44",0x6D74],
- ["D268",0x6D75],
- ["D248",0x6D76],
- ["AEFC",0x6D77],
- ["AEFB",0x6D78],
- ["AF48",0x6D79],
- ["D245",0x6D7A],
- ["D266",0x6D7B],
- ["D25A",0x6D7C],
- ["D267",0x6D7D],
- ["D261",0x6D7E],
- ["D253",0x6D7F],
- ["D262",0x6D80],
- ["D25C",0x6D82],
- ["D265",0x6D83],
- ["D263",0x6D84],
- ["AF49",0x6D85],
- ["D254",0x6D86],
- ["AEF9",0x6D87],
- ["AEF8",0x6D88],
- ["AF41",0x6D89],
- ["AF47",0x6D8A],
- ["D260",0x6D8B],
- ["AF46",0x6D8C],
- ["D251",0x6D8D],
- ["B243",0x6D8E],
- ["D269",0x6D90],
- ["D250",0x6D91],
- ["D24B",0x6D92],
- ["AEFE",0x6D93],
- ["AF4B",0x6D94],
- ["AEF7",0x6D95],
- ["D258",0x6D97],
- ["D25D",0x6D98],
- ["B265",0x6DAA],
- ["D5E1",0x6DAB],
- ["D5E5",0x6DAC],
- ["B252",0x6DAE],
- ["B250",0x6DAF],
- ["B247",0x6DB2],
- ["D5E3",0x6DB3],
- ["D5E2",0x6DB4],
- ["B25B",0x6DB5],
- ["D5E8",0x6DB7],
- ["B255",0x6DB8],
- ["D5FA",0x6DBA],
- ["D647",0x6DBB],
- ["B244",0x6DBC],
- ["D5F7",0x6DBD],
- ["D5F0",0x6DBE],
- ["B267",0x6DBF],
- ["D5E0",0x6DC0],
- ["D5FC",0x6DC2],
- ["B264",0x6DC4],
- ["B258",0x6DC5],
- ["B263",0x6DC6],
- ["B24E",0x6DC7],
- ["D5EC",0x6DC8],
- ["D5FE",0x6DC9],
- ["D5F6",0x6DCA],
- ["B24F",0x6DCB],
- ["B249",0x6DCC],
- ["D645",0x6DCD],
- ["D5FD",0x6DCF],
- ["D640",0x6DD0],
- ["B251",0x6DD1],
- ["B259",0x6DD2],
- ["D642",0x6DD3],
- ["D5EA",0x6DD4],
- ["D5FB",0x6DD5],
- ["D5EF",0x6DD6],
- ["D644",0x6DD7],
- ["B25E",0x6DD8],
- ["B246",0x6DD9],
- ["B25C",0x6DDA],
- ["D5F4",0x6DDB],
- ["D5F2",0x6DDC],
- ["D5F3",0x6DDD],
- ["B253",0x6DDE],
- ["D5EE",0x6DDF],
- ["D5ED",0x6DE0],
- ["B248",0x6DE1],
- ["D5E7",0x6DE2],
- ["D646",0x6DE3],
- ["B24A",0x6DE4],
- ["D5F1",0x6DE5],
- ["B268",0x6DE6],
- ["B262",0x6DE8],
- ["D5E6",0x6DE9],
- ["B25F",0x6DEA],
- ["B25D",0x6DEB],
- ["B266",0x6DEC],
- ["D5F8",0x6DED],
- ["B261",0x6DEE],
- ["D252",0x6DEF],
- ["D5F9",0x6DF0],
- ["B260",0x6DF1],
- ["D641",0x6DF2],
- ["B245",0x6DF3],
- ["D5F5",0x6DF4],
- ["B257",0x6DF5],
- ["D5E9",0x6DF6],
- ["B256",0x6DF7],
- ["B254",0x6DF9],
- ["B24C",0x6DFA],
- ["B24B",0x6DFB],
- ["D9E7",0x6DFC],
- ["D643",0x6DFD],
- ["D5EB",0x6E00],
- ["D9FC",0x6E03],
- ["B24D",0x6E05],
- ["B541",0x6E19],
- ["B25A",0x6E1A],
- ["B4EE",0x6E1B],
- ["D9F6",0x6E1C],
- ["B4FC",0x6E1D],
- ["D9EA",0x6E1F],
- ["B4EB",0x6E20],
- ["B4E7",0x6E21],
- ["DA49",0x6E22],
- ["B4ED",0x6E23],
- ["B4F1",0x6E24],
- ["B4EC",0x6E25],
- ["B4F5",0x6E26],
- ["DA4D",0x6E27],
- ["DA44",0x6E28],
- ["D9F1",0x6E2B],
- ["B4FA",0x6E2C],
- ["B4F4",0x6E2D],
- ["D9FD",0x6E2E],
- ["B4E4",0x6E2F],
- ["DA4A",0x6E30],
- ["DA43",0x6E31],
- ["B4E8",0x6E32],
- ["D9F7",0x6E33],
- ["B4F7",0x6E34],
- ["DA55",0x6E35],
- ["DA56",0x6E36],
- ["B4E5",0x6E38],
- ["DA48",0x6E39],
- ["B4F9",0x6E3A],
- ["D9FB",0x6E3B],
- ["D9ED",0x6E3C],
- ["D9EE",0x6E3D],
- ["B4FD",0x6E3E],
- ["D9F2",0x6E3F],
- ["D9F9",0x6E40],
- ["D9F3",0x6E41],
- ["B4FB",0x6E43],
- ["B544",0x6E44],
- ["D9EF",0x6E45],
- ["D9E8",0x6E46],
- ["D9E9",0x6E47],
- ["D9EB",0x6E49],
- ["B4EA",0x6E4A],
- ["D9F8",0x6E4B],
- ["B4F8",0x6E4D],
- ["B542",0x6E4E],
- ["D9FA",0x6E51],
- ["DA53",0x6E52],
- ["DA4B",0x6E53],
- ["B4E6",0x6E54],
- ["DA51",0x6E55],
- ["B4F2",0x6E56],
- ["B4F0",0x6E58],
- ["DA57",0x6E5A],
- ["B4EF",0x6E5B],
- ["DA41",0x6E5C],
- ["D9F4",0x6E5D],
- ["D9FE",0x6E5E],
- ["B547",0x6E5F],
- ["DA45",0x6E60],
- ["DA42",0x6E61],
- ["D9F0",0x6E62],
- ["B543",0x6E63],
- ["DA4F",0x6E64],
- ["DA4C",0x6E65],
- ["DA54",0x6E66],
- ["B4E9",0x6E67],
- ["DA40",0x6E68],
- ["B546",0x6E69],
- ["DA47",0x6E6B],
- ["B4F3",0x6E6E],
- ["B4F6",0x6E6F],
- ["DA46",0x6E71],
- ["B545",0x6E72],
- ["D9F5",0x6E73],
- ["D5E4",0x6E74],
- ["DA50",0x6E77],
- ["DA4E",0x6E78],
- ["DA52",0x6E79],
- ["D9EC",0x6E88],
- ["B540",0x6E89],
- ["DE61",0x6E8D],
- ["DE60",0x6E8E],
- ["DE46",0x6E8F],
- ["B7BD",0x6E90],
- ["DE5F",0x6E92],
- ["DE49",0x6E93],
- ["DE4A",0x6E94],
- ["B7C7",0x6E96],
- ["DE68",0x6E97],
- ["B7C2",0x6E98],
- ["DE5E",0x6E99],
- ["DE43",0x6E9B],
- ["B7C8",0x6E9C],
- ["B7BE",0x6E9D],
- ["DE52",0x6E9E],
- ["DE48",0x6E9F],
- ["DE4B",0x6EA0],
- ["DE63",0x6EA1],
- ["B7B8",0x6EA2],
- ["DE6A",0x6EA3],
- ["DE62",0x6EA4],
- ["B7C1",0x6EA5],
- ["DE57",0x6EA6],
- ["B7CC",0x6EA7],
- ["B7CB",0x6EAA],
- ["B7C5",0x6EAB],
- ["DE69",0x6EAE],
- ["B7B9",0x6EAF],
- ["DE55",0x6EB0],
- ["DE4C",0x6EB1],
- ["DE59",0x6EB2],
- ["DE65",0x6EB3],
- ["B7CD",0x6EB4],
- ["B7BB",0x6EB6],
- ["DE54",0x6EB7],
- ["DE4D",0x6EB9],
- ["B7C4",0x6EBA],
- ["B7C3",0x6EBC],
- ["DE50",0x6EBD],
- ["DE5A",0x6EBE],
- ["DE64",0x6EBF],
- ["DE47",0x6EC0],
- ["DE51",0x6EC1],
- ["B7BC",0x6EC2],
- ["DE5B",0x6EC3],
- ["B7C9",0x6EC4],
- ["B7C0",0x6EC5],
- ["DE4E",0x6EC6],
- ["B7BF",0x6EC7],
- ["DE45",0x6EC8],
- ["DE53",0x6EC9],
- ["DE67",0x6ECA],
- ["B4FE",0x6ECB],
- ["BAB0",0x6ECC],
- ["DE56",0x6ECD],
- ["E26C",0x6ECE],
- ["DE58",0x6ECF],
- ["DE66",0x6ED0],
- ["B7C6",0x6ED1],
- ["DE4F",0x6ED2],
- ["B7BA",0x6ED3],
- ["B7CA",0x6ED4],
- ["BCF0",0x6ED5],
- ["DE44",0x6ED6],
- ["DE5D",0x6ED8],
- ["DE5C",0x6EDC],
- ["E2AA",0x6EEB],
- ["BAAD",0x6EEC],
- ["E27D",0x6EED],
- ["E2A4",0x6EEE],
- ["BAA2",0x6EEF],
- ["E26E",0x6EF1],
- ["BAAF",0x6EF2],
- ["BA77",0x6EF4],
- ["E26D",0x6EF5],
- ["E2B0",0x6EF6],
- ["BAB1",0x6EF7],
- ["E271",0x6EF8],
- ["E2A3",0x6EF9],
- ["E273",0x6EFB],
- ["E2B3",0x6EFC],
- ["E2AF",0x6EFD],
- ["BA75",0x6EFE],
- ["BAA1",0x6EFF],
- ["E653",0x6F00],
- ["BAAE",0x6F01],
- ["BA7D",0x6F02],
- ["E26F",0x6F03],
- ["E2AE",0x6F05],
- ["BAA3",0x6F06],
- ["E2AB",0x6F07],
- ["E2B8",0x6F08],
- ["E275",0x6F09],
- ["E27E",0x6F0A],
- ["E2B6",0x6F0D],
- ["E2AC",0x6F0E],
- ["BA7C",0x6F0F],
- ["E27C",0x6F12],
- ["BA76",0x6F13],
- ["BA74",0x6F14],
- ["BAA8",0x6F15],
- ["E27A",0x6F18],
- ["E277",0x6F19],
- ["E278",0x6F1A],
- ["E2B2",0x6F1C],
- ["E2B7",0x6F1E],
- ["E2B5",0x6F1F],
- ["BA7A",0x6F20],
- ["E2B9",0x6F21],
- ["BA7E",0x6F22],
- ["BAA7",0x6F23],
- ["E270",0x6F25],
- ["E5FA",0x6F26],
- ["E279",0x6F27],
- ["BA78",0x6F29],
- ["BAAC",0x6F2A],
- ["BAA9",0x6F2B],
- ["BA7B",0x6F2C],
- ["E2A5",0x6F2D],
- ["E274",0x6F2E],
- ["BAAA",0x6F2F],
- ["E2A7",0x6F30],
- ["BAA4",0x6F31],
- ["BAA6",0x6F32],
- ["BA73",0x6F33],
- ["E2A9",0x6F35],
- ["E2A1",0x6F36],
- ["E272",0x6F37],
- ["BAA5",0x6F38],
- ["E2B1",0x6F39],
- ["E2B4",0x6F3A],
- ["E27B",0x6F3B],
- ["E2A8",0x6F3C],
- ["BA79",0x6F3E],
- ["BCDF",0x6F3F],
- ["E2A6",0x6F40],
- ["E5F9",0x6F41],
- ["E2AD",0x6F43],
- ["E276",0x6F4E],
- ["E644",0x6F4F],
- ["E64E",0x6F50],
- ["BCE2",0x6F51],
- ["E64D",0x6F52],
- ["E659",0x6F53],
- ["BCE4",0x6F54],
- ["E64B",0x6F55],
- ["E64F",0x6F57],
- ["BCEF",0x6F58],
- ["E646",0x6F5A],
- ["BCE7",0x6F5B],
- ["E652",0x6F5D],
- ["E9F0",0x6F5E],
- ["BCF3",0x6F5F],
- ["BCF2",0x6F60],
- ["E654",0x6F61],
- ["E643",0x6F62],
- ["E65E",0x6F63],
- ["BCED",0x6F64],
- ["BCE3",0x6F66],
- ["E657",0x6F67],
- ["E65B",0x6F69],
- ["E660",0x6F6A],
- ["E655",0x6F6B],
- ["E649",0x6F6C],
- ["BCE6",0x6F6D],
- ["BCE9",0x6F6E],
- ["BCF1",0x6F6F],
- ["BCEC",0x6F70],
- ["E64C",0x6F72],
- ["E2A2",0x6F73],
- ["E648",0x6F76],
- ["E65F",0x6F77],
- ["BCE8",0x6F78],
- ["BCEB",0x6F7A],
- ["E661",0x6F7B],
- ["BCE0",0x6F7C],
- ["E656",0x6F7D],
- ["E5FB",0x6F7E],
- ["E65C",0x6F7F],
- ["C0DF",0x6F80],
- ["E64A",0x6F82],
- ["BCE1",0x6F84],
- ["E645",0x6F85],
- ["BCE5",0x6F86],
- ["E5FC",0x6F87],
- ["BAAB",0x6F88],
- ["E641",0x6F89],
- ["E65A",0x6F8B],
- ["E642",0x6F8C],
- ["E640",0x6F8D],
- ["BCEA",0x6F8E],
- ["E658",0x6F90],
- ["E5FE",0x6F92],
- ["E651",0x6F93],
- ["E650",0x6F94],
- ["E65D",0x6F95],
- ["E647",0x6F96],
- ["BCEE",0x6F97],
- ["E9F3",0x6F9E],
- ["BF49",0x6FA0],
- ["BEFE",0x6FA1],
- ["EA40",0x6FA2],
- ["E9EB",0x6FA3],
- ["BF41",0x6FA4],
- ["E9F7",0x6FA5],
- ["BF48",0x6FA6],
- ["BF43",0x6FA7],
- ["E9F5",0x6FA8],
- ["ED4F",0x6FA9],
- ["E9FB",0x6FAA],
- ["EA42",0x6FAB],
- ["E9FA",0x6FAC],
- ["E9E9",0x6FAD],
- ["E9F8",0x6FAE],
- ["EA44",0x6FAF],
- ["EA46",0x6FB0],
- ["BEFD",0x6FB1],
- ["EA45",0x6FB2],
- ["BF44",0x6FB3],
- ["BF4A",0x6FB4],
- ["BF47",0x6FB6],
- ["E9FE",0x6FB8],
- ["BF46",0x6FB9],
- ["E9F9",0x6FBA],
- ["E9ED",0x6FBC],
- ["E9F2",0x6FBD],
- ["E9FD",0x6FBF],
- ["BF45",0x6FC0],
- ["BF42",0x6FC1],
- ["BEFC",0x6FC2],
- ["BF40",0x6FC3],
- ["E9F1",0x6FC4],
- ["E5FD",0x6FC6],
- ["E9EC",0x6FC7],
- ["E9EF",0x6FC8],
- ["EA41",0x6FC9],
- ["E9F4",0x6FCA],
- ["E9EA",0x6FCB],
- ["ED4E",0x6FCC],
- ["EA43",0x6FCD],
- ["E9EE",0x6FCE],
- ["E9FC",0x6FCF],
- ["ED51",0x6FD4],
- ["C0E3",0x6FD5],
- ["C0D7",0x6FD8],
- ["C0DB",0x6FDB],
- ["ED53",0x6FDC],
- ["ED59",0x6FDD],
- ["ED57",0x6FDE],
- ["C0D9",0x6FDF],
- ["C0DA",0x6FE0],
- ["C0E1",0x6FE1],
- ["ED5A",0x6FE2],
- ["ED52",0x6FE3],
- ["C0DC",0x6FE4],
- ["ED56",0x6FE6],
- ["ED55",0x6FE7],
- ["ED5B",0x6FE8],
- ["C0E2",0x6FE9],
- ["C0DD",0x6FEB],
- ["C0E0",0x6FEC],
- ["ED54",0x6FED],
- ["C0E4",0x6FEE],
- ["C0DE",0x6FEF],
- ["C0E5",0x6FF0],
- ["C0D8",0x6FF1],
- ["ED58",0x6FF2],
- ["ED50",0x6FF4],
- ["EFF7",0x6FF7],
- ["C271",0x6FFA],
- ["EFF4",0x6FFB],
- ["EFF6",0x6FFC],
- ["C26F",0x6FFE],
- ["EFF2",0x6FFF],
- ["EFF3",0x7000],
- ["EFEE",0x7001],
- ["E9F6",0x7004],
- ["EFEF",0x7005],
- ["C270",0x7006],
- ["EFEB",0x7007],
- ["C26D",0x7009],
- ["EFF8",0x700A],
- ["C26E",0x700B],
- ["EFEC",0x700C],
- ["EFED",0x700D],
- ["EFF1",0x700E],
- ["C273",0x700F],
- ["C272",0x7011],
- ["EFF0",0x7014],
- ["C378",0x7015],
- ["F25F",0x7016],
- ["F265",0x7017],
- ["C379",0x7018],
- ["F25C",0x7019],
- ["C376",0x701A],
- ["C373",0x701B],
- ["F267",0x701C],
- ["C377",0x701D],
- ["C374",0x701F],
- ["F25E",0x7020],
- ["F261",0x7021],
- ["F262",0x7022],
- ["F263",0x7023],
- ["F266",0x7024],
- ["EFF5",0x7026],
- ["F25D",0x7027],
- ["C375",0x7028],
- ["F264",0x7029],
- ["F268",0x702A],
- ["F260",0x702B],
- ["F45D",0x702F],
- ["C46A",0x7030],
- ["F460",0x7031],
- ["C46B",0x7032],
- ["F468",0x7033],
- ["F45F",0x7034],
- ["F45C",0x7035],
- ["F45E",0x7037],
- ["F462",0x7038],
- ["F465",0x7039],
- ["F464",0x703A],
- ["F467",0x703B],
- ["F45B",0x703C],
- ["C469",0x703E],
- ["F463",0x703F],
- ["F466",0x7040],
- ["F469",0x7041],
- ["F461",0x7042],
- ["F5D3",0x7043],
- ["F5D4",0x7044],
- ["F5D8",0x7045],
- ["F5D9",0x7046],
- ["F5D6",0x7048],
- ["F5D7",0x7049],
- ["F5D5",0x704A],
- ["C4E9",0x704C],
- ["C578",0x7051],
- ["F6EB",0x7052],
- ["F6E8",0x7055],
- ["F6E9",0x7056],
- ["F6EA",0x7057],
- ["C579",0x7058],
- ["F7E5",0x705A],
- ["F7E4",0x705B],
- ["F8AF",0x705D],
- ["C5F4",0x705E],
- ["F8AD",0x705F],
- ["F8B0",0x7060],
- ["F8AE",0x7061],
- ["F8F5",0x7062],
- ["C657",0x7063],
- ["C665",0x7064],
- ["F9A3",0x7065],
- ["F96C",0x7066],
- ["F9A2",0x7068],
- ["F9D0",0x7069],
- ["F9D1",0x706A],
- ["A4F5",0x706B],
- ["A6C7",0x7070],
- ["CA41",0x7071],
- ["CB5E",0x7074],
- ["A85F",0x7076],
- ["A862",0x7078],
- ["CB5F",0x707A],
- ["A860",0x707C],
- ["A861",0x707D],
- ["CD58",0x7082],
- ["CD5A",0x7083],
- ["CD55",0x7084],
- ["CD52",0x7085],
- ["CD54",0x7086],
- ["AAA4",0x708A],
- ["AAA2",0x708E],
- ["CD56",0x7091],
- ["AAA3",0x7092],
- ["CD53",0x7093],
- ["CD50",0x7094],
- ["AAA1",0x7095],
- ["CD57",0x7096],
- ["CD51",0x7098],
- ["AAA5",0x7099],
- ["CD59",0x709A],
- ["CFAF",0x709F],
- ["CFB3",0x70A1],
- ["ACB7",0x70A4],
- ["CFB6",0x70A9],
- ["ACAF",0x70AB],
- ["ACB2",0x70AC],
- ["ACB4",0x70AD],
- ["ACB6",0x70AE],
- ["ACB3",0x70AF],
- ["CFB2",0x70B0],
- ["CFB1",0x70B1],
- ["ACB1",0x70B3],
- ["CFB4",0x70B4],
- ["CFB5",0x70B5],
- ["CFAE",0x70B7],
- ["ACB5",0x70B8],
- ["ACB0",0x70BA],
- ["CFB0",0x70BE],
- ["D277",0x70C5],
- ["D278",0x70C6],
- ["D279",0x70C7],
- ["AF50",0x70C8],
- ["AF4C",0x70CA],
- ["D26E",0x70CB],
- ["D276",0x70CD],
- ["D27B",0x70CE],
- ["AF51",0x70CF],
- ["D26C",0x70D1],
- ["D272",0x70D2],
- ["D26B",0x70D3],
- ["D275",0x70D4],
- ["D271",0x70D7],
- ["AF4D",0x70D8],
- ["AF4F",0x70D9],
- ["D27A",0x70DA],
- ["D26A",0x70DC],
- ["D26D",0x70DD],
- ["D273",0x70DE],
- ["D274",0x70E0],
- ["D27C",0x70E1],
- ["D270",0x70E2],
- ["AF4E",0x70E4],
- ["B26D",0x70EF],
- ["D64E",0x70F0],
- ["D650",0x70F3],
- ["D64C",0x70F4],
- ["D658",0x70F6],
- ["D64A",0x70F7],
- ["D657",0x70F8],
- ["B269",0x70F9],
- ["D648",0x70FA],
- ["DA5B",0x70FB],
- ["D652",0x70FC],
- ["B26C",0x70FD],
- ["D653",0x70FF],
- ["D656",0x7100],
- ["D65A",0x7102],
- ["D64F",0x7104],
- ["D654",0x7106],
- ["B26A",0x7109],
- ["B26B",0x710A],
- ["D659",0x710B],
- ["D64D",0x710C],
- ["D649",0x710D],
- ["D65B",0x710E],
- ["D651",0x7110],
- ["D655",0x7113],
- ["D64B",0x7117],
- ["B548",0x7119],
- ["B549",0x711A],
- ["DA65",0x711B],
- ["B54F",0x711C],
- ["DA59",0x711E],
- ["DA62",0x711F],
- ["DA58",0x7120],
- ["B54C",0x7121],
- ["DA60",0x7122],
- ["DA5E",0x7123],
- ["DA5F",0x7125],
- ["B54A",0x7126],
- ["DA63",0x7128],
- ["DA5C",0x712E],
- ["DA5A",0x712F],
- ["B54B",0x7130],
- ["DA5D",0x7131],
- ["DA61",0x7132],
- ["B54D",0x7136],
- ["DA64",0x713A],
- ["DE70",0x7141],
- ["DE77",0x7142],
- ["DE79",0x7143],
- ["DEA1",0x7144],
- ["B7DA",0x7146],
- ["DE6B",0x7147],
- ["B7D2",0x7149],
- ["DE7A",0x714B],
- ["B7D7",0x714C],
- ["DEA2",0x714D],
- ["B7CE",0x714E],
- ["DE7D",0x7150],
- ["DE6D",0x7152],
- ["DE7E",0x7153],
- ["DE6C",0x7154],
- ["B7DC",0x7156],
- ["DE78",0x7158],
- ["B7CF",0x7159],
- ["DEA3",0x715A],
- ["B7D4",0x715C],
- ["DE71",0x715D],
- ["B7D9",0x715E],
- ["DE7C",0x715F],
- ["DE6F",0x7160],
- ["DE76",0x7161],
- ["DE72",0x7162],
- ["DE6E",0x7163],
- ["B7D1",0x7164],
- ["B7D8",0x7165],
- ["B7D6",0x7166],
- ["B7D3",0x7167],
- ["B7DB",0x7168],
- ["B7D0",0x7169],
- ["DE75",0x716A],
- ["B7D5",0x716C],
- ["B54E",0x716E],
- ["DE7B",0x7170],
- ["DE73",0x7172],
- ["DE74",0x7178],
- ["E2C1",0x717B],
- ["BAB4",0x717D],
- ["E2BD",0x7180],
- ["E2C3",0x7181],
- ["E2BF",0x7182],
- ["BAB6",0x7184],
- ["E2BE",0x7185],
- ["E2C2",0x7186],
- ["E2BA",0x7187],
- ["E2BC",0x7189],
- ["BAB5",0x718A],
- ["E2C0",0x718F],
- ["E2BB",0x7190],
- ["BAB7",0x7192],
- ["BAB2",0x7194],
- ["E2C4",0x7197],
- ["BAB3",0x7199],
- ["E667",0x719A],
- ["E664",0x719B],
- ["E670",0x719C],
- ["E66A",0x719D],
- ["E66C",0x719E],
- ["BCF4",0x719F],
- ["E666",0x71A0],
- ["E66E",0x71A1],
- ["E66D",0x71A4],
- ["E66B",0x71A5],
- ["E671",0x71A7],
- ["BCF7",0x71A8],
- ["E668",0x71A9],
- ["E66F",0x71AA],
- ["BCF5",0x71AC],
- ["E663",0x71AF],
- ["E665",0x71B0],
- ["BCF6",0x71B1],
- ["E662",0x71B2],
- ["E672",0x71B3],
- ["E669",0x71B5],
- ["EA4A",0x71B8],
- ["BF51",0x71B9],
- ["EA55",0x71BC],
- ["EA53",0x71BD],
- ["BF4B",0x71BE],
- ["EA49",0x71BF],
- ["EA4C",0x71C0],
- ["EA4D",0x71C1],
- ["EA48",0x71C2],
- ["BF55",0x71C3],
- ["BF56",0x71C4],
- ["EA47",0x71C5],
- ["EA56",0x71C6],
- ["EA51",0x71C7],
- ["BF4F",0x71C8],
- ["BF4C",0x71C9],
- ["EA50",0x71CA],
- ["EA4E",0x71CB],
- ["BF52",0x71CE],
- ["EA52",0x71CF],
- ["BF4D",0x71D0],
- ["BF4E",0x71D2],
- ["EA4F",0x71D4],
- ["BF50",0x71D5],
- ["EA4B",0x71D6],
- ["EA54",0x71D8],
- ["BF53",0x71D9],
- ["EA57",0x71DA],
- ["EA58",0x71DB],
- ["BF54",0x71DC],
- ["C0E7",0x71DF],
- ["C0EE",0x71E0],
- ["ED5C",0x71E1],
- ["ED62",0x71E2],
- ["ED60",0x71E4],
- ["C0EA",0x71E5],
- ["C0E9",0x71E6],
- ["C0E6",0x71E7],
- ["ED5E",0x71E8],
- ["C0EC",0x71EC],
- ["C0EB",0x71ED],
- ["C0E8",0x71EE],
- ["ED61",0x71F0],
- ["ED5D",0x71F1],
- ["ED5F",0x71F2],
- ["C0ED",0x71F4],
- ["C277",0x71F8],
- ["EFFB",0x71F9],
- ["C274",0x71FB],
- ["C275",0x71FC],
- ["EFFD",0x71FD],
- ["C276",0x71FE],
- ["EFFA",0x71FF],
- ["EFF9",0x7201],
- ["F26C",0x7202],
- ["EFFC",0x7203],
- ["F26D",0x7205],
- ["C37A",0x7206],
- ["F26B",0x7207],
- ["F26A",0x720A],
- ["F269",0x720C],
- ["C37B",0x720D],
- ["C46C",0x7210],
- ["F46A",0x7213],
- ["F46B",0x7214],
- ["F5DC",0x7219],
- ["F5DB",0x721A],
- ["C4EA",0x721B],
- ["F5DA",0x721D],
- ["F6EC",0x721E],
- ["F6ED",0x721F],
- ["F7E6",0x7222],
- ["F8B1",0x7223],
- ["F8F6",0x7226],
- ["F9BC",0x7227],
- ["C679",0x7228],
- ["F9C6",0x7229],
- ["A4F6",0x722A],
- ["AAA6",0x722C],
- ["AAA7",0x722D],
- ["ACB8",0x7230],
- ["C0EF",0x7235],
- ["A4F7",0x7236],
- ["AAA8",0x7238],
- ["AF52",0x7239],
- ["B7DD",0x723A],
- ["A4F8",0x723B],
- ["B26E",0x723D],
- ["BAB8",0x723E],
- ["C962",0x723F],
- ["CFB7",0x7241],
- ["D27D",0x7242],
- ["E2C5",0x7244],
- ["C0F0",0x7246],
- ["A4F9",0x7247],
- ["AAA9",0x7248],
- ["CFB8",0x7249],
- ["CFB9",0x724A],
- ["DA66",0x724B],
- ["B550",0x724C],
- ["DEA4",0x724F],
- ["B7DE",0x7252],
- ["E2C6",0x7253],
- ["BCF8",0x7256],
- ["C37C",0x7258],
- ["A4FA",0x7259],
- ["DA67",0x725A],
- ["A4FB",0x725B],
- ["A6C9",0x725D],
- ["CA42",0x725E],
- ["A6C8",0x725F],
- ["A865",0x7260],
- ["A864",0x7261],
- ["A863",0x7262],
- ["CB60",0x7263],
- ["AAAA",0x7267],
- ["AAAB",0x7269],
- ["CD5B",0x726A],
- ["CFBA",0x726C],
- ["CFBD",0x726E],
- ["ACBA",0x726F],
- ["CFBB",0x7270],
- ["ACB9",0x7272],
- ["CFBC",0x7273],
- ["ACBB",0x7274],
- ["D2A2",0x7276],
- ["D2A1",0x7277],
- ["D27E",0x7278],
- ["AF53",0x7279],
- ["D65D",0x727B],
- ["D65E",0x727C],
- ["B26F",0x727D],
- ["D65C",0x727E],
- ["D65F",0x727F],
- ["B552",0x7280],
- ["B270",0x7281],
- ["B551",0x7284],
- ["DA6B",0x7285],
- ["DA6A",0x7286],
- ["DA68",0x7288],
- ["DA69",0x7289],
- ["DA6C",0x728B],
- ["DEA6",0x728C],
- ["DEA5",0x728D],
- ["DEA9",0x728E],
- ["DEA8",0x7290],
- ["DEA7",0x7291],
- ["BAB9",0x7292],
- ["E2C9",0x7293],
- ["E2C8",0x7295],
- ["BABA",0x7296],
- ["E2C7",0x7297],
- ["E673",0x7298],
- ["E674",0x729A],
- ["BCF9",0x729B],
- ["EA59",0x729D],
- ["EA5A",0x729E],
- ["F272",0x72A1],
- ["C37D",0x72A2],
- ["F271",0x72A3],
- ["F270",0x72A4],
- ["F26E",0x72A5],
- ["F26F",0x72A6],
- ["C4EB",0x72A7],
- ["F46C",0x72A8],
- ["F6EE",0x72A9],
- ["F8F7",0x72AA],
- ["A4FC",0x72AC],
- ["C9A5",0x72AE],
- ["A5C7",0x72AF],
- ["C9A6",0x72B0],
- ["CA43",0x72B4],
- ["CA44",0x72B5],
- ["CB66",0x72BA],
- ["CB62",0x72BD],
- ["CB61",0x72BF],
- ["AAAC",0x72C0],
- ["CB65",0x72C1],
- ["A867",0x72C2],
- ["CB63",0x72C3],
- ["A866",0x72C4],
- ["CB67",0x72C5],
- ["CB64",0x72C6],
- ["CD5F",0x72C9],
- ["CFBE",0x72CA],
- ["CD5D",0x72CB],
- ["CD64",0x72CC],
- ["AAAD",0x72CE],
- ["AAB0",0x72D0],
- ["CD65",0x72D1],
- ["CD61",0x72D2],
- ["CD62",0x72D4],
- ["CD5C",0x72D6],
- ["AAAF",0x72D7],
- ["CD5E",0x72D8],
- ["AAAE",0x72D9],
- ["CD63",0x72DA],
- ["CD60",0x72DC],
- ["CFC2",0x72DF],
- ["ACBD",0x72E0],
- ["ACBE",0x72E1],
- ["CFC5",0x72E3],
- ["CFBF",0x72E4],
- ["CFC4",0x72E6],
- ["CFC0",0x72E8],
- ["ACBC",0x72E9],
- ["CFC3",0x72EA],
- ["CFC1",0x72EB],
- ["D2A8",0x72F3],
- ["D2A5",0x72F4],
- ["D2A7",0x72F6],
- ["AF58",0x72F7],
- ["AF57",0x72F8],
- ["AF55",0x72F9],
- ["D2A4",0x72FA],
- ["D2A9",0x72FB],
- ["AF54",0x72FC],
- ["AF56",0x72FD],
- ["D2A6",0x72FE],
- ["D667",0x72FF],
- ["D2A3",0x7300],
- ["D2AA",0x7301],
- ["D662",0x7307],
- ["D666",0x7308],
- ["D665",0x730A],
- ["DA6E",0x730B],
- ["DA79",0x730C],
- ["D668",0x730F],
- ["D663",0x7311],
- ["DA6D",0x7312],
- ["B274",0x7313],
- ["B273",0x7316],
- ["D661",0x7317],
- ["D664",0x7318],
- ["B275",0x7319],
- ["B272",0x731B],
- ["B271",0x731C],
- ["D660",0x731D],
- ["D669",0x731E],
- ["DA70",0x7322],
- ["DA77",0x7323],
- ["B554",0x7325],
- ["DA76",0x7326],
- ["DA73",0x7327],
- ["B556",0x7329],
- ["DA75",0x732D],
- ["DA6F",0x7330],
- ["DA71",0x7331],
- ["DA74",0x7332],
- ["DA72",0x7333],
- ["B555",0x7334],
- ["DA78",0x7335],
- ["B553",0x7336],
- ["B7DF",0x7337],
- ["DEAD",0x733A],
- ["DEAC",0x733B],
- ["DEAA",0x733C],
- ["B7E2",0x733E],
- ["B7E1",0x733F],
- ["DEAE",0x7340],
- ["DEAB",0x7342],
- ["E2CA",0x7343],
- ["BABB",0x7344],
- ["B7E0",0x7345],
- ["DEB0",0x7349],
- ["DEAF",0x734A],
- ["E2CD",0x734C],
- ["E2CB",0x734D],
- ["BCFA",0x734E],
- ["BABC",0x7350],
- ["E2CC",0x7351],
- ["E676",0x7352],
- ["BCFB",0x7357],
- ["E675",0x7358],
- ["E67E",0x7359],
- ["E67D",0x735A],
- ["E67B",0x735B],
- ["E67A",0x735D],
- ["E677",0x735E],
- ["E678",0x735F],
- ["E679",0x7360],
- ["E67C",0x7361],
- ["E6A1",0x7362],
- ["EA5F",0x7365],
- ["EA5C",0x7366],
- ["EA5D",0x7367],
- ["BF57",0x7368],
- ["EA5B",0x7369],
- ["EA61",0x736A],
- ["EA60",0x736B],
- ["EA5E",0x736C],
- ["ED64",0x736E],
- ["ED65",0x736F],
- ["C0F1",0x7370],
- ["C0F2",0x7372],
- ["ED63",0x7373],
- ["C279",0x7375],
- ["EFFE",0x7376],
- ["C278",0x7377],
- ["C37E",0x7378],
- ["C3A1",0x737A],
- ["C46D",0x737B],
- ["F46E",0x737C],
- ["F46D",0x737D],
- ["F5DD",0x737E],
- ["F6EF",0x737F],
- ["C57A",0x7380],
- ["F7E8",0x7381],
- ["F7E7",0x7382],
- ["F7E9",0x7383],
- ["A5C8",0x7384],
- ["CFC6",0x7385],
- ["AF59",0x7386],
- ["B276",0x7387],
- ["D66A",0x7388],
- ["A5C9",0x7389],
- ["C9A7",0x738A],
- ["A4FD",0x738B],
- ["CA45",0x738E],
- ["CB6C",0x7392],
- ["CB6A",0x7393],
- ["CB6B",0x7394],
- ["CB68",0x7395],
- ["A868",0x7396],
- ["CB69",0x7397],
- ["CD6D",0x739D],
- ["AAB3",0x739F],
- ["CD6B",0x73A0],
- ["CD67",0x73A1],
- ["CD6A",0x73A2],
- ["CD66",0x73A4],
- ["AAB5",0x73A5],
- ["CD69",0x73A6],
- ["AAB2",0x73A8],
- ["AAB1",0x73A9],
- ["AAB4",0x73AB],
- ["CD6C",0x73AC],
- ["CD68",0x73AD],
- ["ACC2",0x73B2],
- ["ACC5",0x73B3],
- ["CFCE",0x73B4],
- ["CFCD",0x73B5],
- ["CFCC",0x73B6],
- ["ACBF",0x73B7],
- ["CFD5",0x73B8],
- ["CFCB",0x73B9],
- ["ACC1",0x73BB],
- ["D2AF",0x73BC],
- ["CFD2",0x73BE],
- ["CFD0",0x73BF],
- ["ACC4",0x73C0],
- ["CFC8",0x73C2],
- ["CFD3",0x73C3],
- ["CFCA",0x73C5],
- ["CFD4",0x73C6],
- ["CFD1",0x73C7],
- ["CFC9",0x73C8],
- ["ACC0",0x73CA],
- ["CFD6",0x73CB],
- ["CFC7",0x73CC],
- ["ACC3",0x73CD],
- ["D2B4",0x73D2],
- ["D2AB",0x73D3],
- ["D2B6",0x73D4],
- ["D2AE",0x73D6],
- ["D2B9",0x73D7],
- ["D2BA",0x73D8],
- ["D2AC",0x73D9],
- ["D2B8",0x73DA],
- ["D2B5",0x73DB],
- ["D2B3",0x73DC],
- ["D2B7",0x73DD],
- ["AF5F",0x73DE],
- ["AF5D",0x73E0],
- ["D2B1",0x73E3],
- ["D2AD",0x73E5],
- ["D2B0",0x73E7],
- ["D2BB",0x73E8],
- ["D2B2",0x73E9],
- ["AF5E",0x73EA],
- ["CFCF",0x73EB],
- ["AF5A",0x73ED],
- ["AF5C",0x73EE],
- ["D678",0x73F4],
- ["D66D",0x73F5],
- ["D66B",0x73F6],
- ["D66C",0x73F8],
- ["D673",0x73FA],
- ["D674",0x73FC],
- ["D670",0x73FD],
- ["B27B",0x73FE],
- ["D675",0x73FF],
- ["D672",0x7400],
- ["D66F",0x7401],
- ["B279",0x7403],
- ["D66E",0x7404],
- ["B277",0x7405],
- ["B27A",0x7406],
- ["D671",0x7407],
- ["D679",0x7408],
- ["AF5B",0x7409],
- ["B278",0x740A],
- ["D677",0x740B],
- ["D676",0x740C],
- ["B27C",0x740D],
- ["DA7E",0x7416],
- ["DAA1",0x741A],
- ["B560",0x741B],
- ["DAA7",0x741D],
- ["DAA9",0x7420],
- ["DAA2",0x7421],
- ["B55A",0x7422],
- ["DAA6",0x7423],
- ["DAA5",0x7424],
- ["B55B",0x7425],
- ["B561",0x7426],
- ["B562",0x7428],
- ["DAA8",0x7429],
- ["B558",0x742A],
- ["DA7D",0x742B],
- ["DA7B",0x742C],
- ["DAA3",0x742D],
- ["DA7A",0x742E],
- ["B55F",0x742F],
- ["DA7C",0x7430],
- ["DAA4",0x7431],
- ["DAAA",0x7432],
- ["B559",0x7433],
- ["B55E",0x7434],
- ["B55C",0x7435],
- ["B55D",0x7436],
- ["B557",0x743A],
- ["B7E9",0x743F],
- ["DEB7",0x7440],
- ["B7E8",0x7441],
- ["DEBB",0x7442],
- ["DEB1",0x7444],
- ["DEBC",0x7446],
- ["DEB2",0x744A],
- ["DEB3",0x744B],
- ["DEBD",0x744D],
- ["DEBA",0x744E],
- ["DEB8",0x744F],
- ["DEB9",0x7450],
- ["DEB5",0x7451],
- ["DEB4",0x7452],
- ["DEBE",0x7454],
- ["B7E5",0x7455],
- ["DEB6",0x7457],
- ["B7EA",0x7459],
- ["B7E4",0x745A],
- ["B7EB",0x745B],
- ["B7EC",0x745C],
- ["B7E7",0x745E],
- ["B7E6",0x745F],
- ["E2CE",0x7462],
- ["BABE",0x7463],
- ["BABD",0x7464],
- ["E2D3",0x7467],
- ["BCFC",0x7469],
- ["BABF",0x746A],
- ["BAC1",0x746D],
- ["E2D4",0x746E],
- ["B7E3",0x746F],
- ["BAC0",0x7470],
- ["E2D0",0x7471],
- ["E2D2",0x7472],
- ["E2CF",0x7473],
- ["E2D1",0x7475],
- ["E6AB",0x7479],
- ["E6AA",0x747C],
- ["E6A7",0x747D],
- ["BD40",0x747E],
- ["EA62",0x747F],
- ["BD41",0x7480],
- ["E6A6",0x7481],
- ["BCFE",0x7483],
- ["E6A8",0x7485],
- ["E6A5",0x7486],
- ["E6A2",0x7487],
- ["E6A9",0x7488],
- ["E6A3",0x7489],
- ["E6A4",0x748A],
- ["BCFD",0x748B],
- ["ED69",0x7490],
- ["EA66",0x7492],
- ["EA65",0x7494],
- ["EA67",0x7495],
- ["ED66",0x7497],
- ["BF5A",0x7498],
- ["EA63",0x749A],
- ["BF58",0x749C],
- ["BF5C",0x749E],
- ["BF5B",0x749F],
- ["EA64",0x74A0],
- ["EA68",0x74A1],
- ["BF59",0x74A3],
- ["ED6D",0x74A5],
- ["C0F5",0x74A6],
- ["C27A",0x74A7],
- ["C0F6",0x74A8],
- ["C0F3",0x74A9],
- ["ED6A",0x74AA],
- ["ED68",0x74AB],
- ["ED6B",0x74AD],
- ["ED6E",0x74AF],
- ["C0F4",0x74B0],
- ["ED6C",0x74B1],
- ["ED67",0x74B2],
- ["F042",0x74B5],
- ["F045",0x74B6],
- ["F275",0x74B7],
- ["F040",0x74B8],
- ["F46F",0x74BA],
- ["F046",0x74BB],
- ["C3A2",0x74BD],
- ["F044",0x74BE],
- ["C27B",0x74BF],
- ["F041",0x74C0],
- ["F043",0x74C1],
- ["F047",0x74C2],
- ["F276",0x74C3],
- ["F274",0x74C5],
- ["C3A3",0x74CA],
- ["F273",0x74CB],
- ["C46E",0x74CF],
- ["C4ED",0x74D4],
- ["F6F1",0x74D5],
- ["C4EC",0x74D6],
- ["F6F3",0x74D7],
- ["F6F0",0x74D8],
- ["F6F2",0x74D9],
- ["C5D0",0x74DA],
- ["F8B2",0x74DB],
- ["A5CA",0x74DC],
- ["CD6E",0x74DD],
- ["D2BC",0x74DE],
- ["D2BD",0x74DF],
- ["B27D",0x74E0],
- ["DEBF",0x74E1],
- ["BF5D",0x74E2],
- ["C3A4",0x74E3],
- ["C57B",0x74E4],
- ["F8B3",0x74E5],
- ["A5CB",0x74E6],
- ["CD6F",0x74E8],
- ["A260",0x74E9],
- ["CFD7",0x74EC],
- ["CFD8",0x74EE],
- ["D2BE",0x74F4],
- ["D2BF",0x74F5],
- ["B27E",0x74F6],
- ["B2A1",0x74F7],
- ["DAAB",0x74FB],
- ["DEC2",0x74FD],
- ["DEC1",0x74FE],
- ["DEC0",0x74FF],
- ["E2D5",0x7500],
- ["E2D6",0x7502],
- ["E2D7",0x7503],
- ["BAC2",0x7504],
- ["E6AD",0x7507],
- ["E6AC",0x7508],
- ["EA69",0x750B],
- ["BF5E",0x750C],
- ["BF5F",0x750D],
- ["ED72",0x750F],
- ["ED6F",0x7510],
- ["ED70",0x7511],
- ["ED71",0x7512],
- ["F049",0x7513],
- ["F048",0x7514],
- ["C27C",0x7515],
- ["F277",0x7516],
- ["F5DE",0x7517],
- ["A5CC",0x7518],
- ["ACC6",0x751A],
- ["B2A2",0x751C],
- ["DEC3",0x751D],
- ["A5CD",0x751F],
- ["D2C0",0x7521],
- ["B2A3",0x7522],
- ["B563",0x7525],
- ["B564",0x7526],
- ["A5CE",0x7528],
- ["A5CF",0x7529],
- ["CA46",0x752A],
- ["A86A",0x752B],
- ["A869",0x752C],
- ["ACC7",0x752D],
- ["CFD9",0x752E],
- ["DAAC",0x752F],
- ["A5D0",0x7530],
- ["A5D1",0x7531],
- ["A5D2",0x7532],
- ["A5D3",0x7533],
- ["A86B",0x7537],
- ["A86C",0x7538],
- ["CB6E",0x7539],
- ["CB6D",0x753A],
- ["AAB6",0x753D],
- ["CD72",0x753E],
- ["CD70",0x753F],
- ["CD71",0x7540],
- ["CFDA",0x7547],
- ["CFDB",0x7548],
- ["ACCB",0x754B],
- ["ACC9",0x754C],
- ["ACCA",0x754E],
- ["ACC8",0x754F],
- ["AF60",0x7554],
- ["AF64",0x7559],
- ["AF63",0x755A],
- ["D2C1",0x755B],
- ["AF62",0x755C],
- ["AF61",0x755D],
- ["D2C2",0x755F],
- ["B2A6",0x7562],
- ["D67B",0x7563],
- ["D67A",0x7564],
- ["B2A4",0x7565],
- ["B2A5",0x7566],
- ["B566",0x756A],
- ["B565",0x756B],
- ["DAAE",0x756C],
- ["DAAD",0x756F],
- ["B2A7",0x7570],
- ["B7ED",0x7576],
- ["DEC5",0x7577],
- ["B7EE",0x7578],
- ["DEC4",0x7579],
- ["E2D8",0x757D],
- ["E6AE",0x757E],
- ["BD42",0x757F],
- ["EA6A",0x7580],
- ["ED73",0x7584],
- ["C3A6",0x7586],
- ["C3A5",0x7587],
- ["C57C",0x758A],
- ["A5D4",0x758B],
- ["CD73",0x758C],
- ["B2A8",0x758F],
- ["E2D9",0x7590],
- ["BAC3",0x7591],
- ["CB6F",0x7594],
- ["CB70",0x7595],
- ["CD74",0x7598],
- ["AAB8",0x7599],
- ["AAB9",0x759A],
- ["AAB7",0x759D],
- ["ACCF",0x75A2],
- ["ACD0",0x75A3],
- ["ACCD",0x75A4],
- ["ACCE",0x75A5],
- ["CFDC",0x75A7],
- ["CFDD",0x75AA],
- ["ACCC",0x75AB],
- ["D2C3",0x75B0],
- ["AF68",0x75B2],
- ["AF69",0x75B3],
- ["B2AB",0x75B5],
- ["D2C9",0x75B6],
- ["AF6E",0x75B8],
- ["AF6C",0x75B9],
- ["D2CA",0x75BA],
- ["D2C5",0x75BB],
- ["AF6B",0x75BC],
- ["AF6A",0x75BD],
- ["AF65",0x75BE],
- ["D2C8",0x75BF],
- ["D2C7",0x75C0],
- ["D2C4",0x75C1],
- ["AF6D",0x75C2],
- ["D2C6",0x75C4],
- ["AF66",0x75C5],
- ["AF67",0x75C7],
- ["B2AC",0x75CA],
- ["D6A1",0x75CB],
- ["D6A2",0x75CC],
- ["B2AD",0x75CD],
- ["D67C",0x75CE],
- ["D67E",0x75CF],
- ["D6A4",0x75D0],
- ["D6A3",0x75D1],
- ["D67D",0x75D2],
- ["B2A9",0x75D4],
- ["B2AA",0x75D5],
- ["DAB6",0x75D7],
- ["B56B",0x75D8],
- ["B56A",0x75D9],
- ["DAB0",0x75DA],
- ["B568",0x75DB],
- ["DAB3",0x75DD],
- ["B56C",0x75DE],
- ["DAB4",0x75DF],
- ["B56D",0x75E0],
- ["DAB1",0x75E1],
- ["B567",0x75E2],
- ["B569",0x75E3],
- ["DAB5",0x75E4],
- ["DAB2",0x75E6],
- ["DAAF",0x75E7],
- ["DED2",0x75ED],
- ["DEC7",0x75EF],
- ["B7F0",0x75F0],
- ["B7F3",0x75F1],
- ["B7F2",0x75F2],
- ["B7F7",0x75F3],
- ["B7F6",0x75F4],
- ["DED3",0x75F5],
- ["DED1",0x75F6],
- ["DECA",0x75F7],
- ["DECE",0x75F8],
- ["DECD",0x75F9],
- ["B7F4",0x75FA],
- ["DED0",0x75FB],
- ["DECC",0x75FC],
- ["DED4",0x75FD],
- ["DECB",0x75FE],
- ["B7F5",0x75FF],
- ["B7EF",0x7600],
- ["B7F1",0x7601],
- ["DEC9",0x7603],
- ["E2DB",0x7608],
- ["BAC7",0x7609],
- ["E2DF",0x760A],
- ["BAC6",0x760B],
- ["E2DC",0x760C],
- ["BAC5",0x760D],
- ["DEC8",0x760F],
- ["DECF",0x7610],
- ["E2DE",0x7611],
- ["BAC8",0x7613],
- ["E2E0",0x7614],
- ["E2DD",0x7615],
- ["E2DA",0x7616],
- ["E6B1",0x7619],
- ["E6B5",0x761A],
- ["E6B7",0x761B],
- ["E6B3",0x761C],
- ["E6B2",0x761D],
- ["E6B0",0x761E],
- ["BD45",0x761F],
- ["BD43",0x7620],
- ["BD48",0x7621],
- ["BD49",0x7622],
- ["E6B4",0x7623],
- ["BD46",0x7624],
- ["E6AF",0x7625],
- ["BD47",0x7626],
- ["BAC4",0x7627],
- ["E6B6",0x7628],
- ["BD44",0x7629],
- ["EA6C",0x762D],
- ["EA6B",0x762F],
- ["EA73",0x7630],
- ["EA6D",0x7631],
- ["EA72",0x7632],
- ["EA6F",0x7633],
- ["BF60",0x7634],
- ["EA71",0x7635],
- ["BF61",0x7638],
- ["BF62",0x763A],
- ["EA70",0x763C],
- ["EA6E",0x763D],
- ["C0F8",0x7642],
- ["ED74",0x7643],
- ["C0F7",0x7646],
- ["ED77",0x7647],
- ["ED75",0x7648],
- ["ED76",0x7649],
- ["C0F9",0x764C],
- ["F04D",0x7650],
- ["C2A1",0x7652],
- ["F04E",0x7653],
- ["C27D",0x7656],
- ["F04F",0x7657],
- ["C27E",0x7658],
- ["F04C",0x7659],
- ["F050",0x765A],
- ["F04A",0x765C],
- ["C3A7",0x765F],
- ["F278",0x7660],
- ["C3A8",0x7661],
- ["C46F",0x7662],
- ["F04B",0x7664],
- ["C470",0x7665],
- ["C4EE",0x7669],
- ["F5DF",0x766A],
- ["C57E",0x766C],
- ["F6F4",0x766D],
- ["C57D",0x766E],
- ["F7EA",0x7670],
- ["C5F5",0x7671],
- ["C5F6",0x7672],
- ["F9CC",0x7675],
- ["ACD1",0x7678],
- ["CFDE",0x7679],
- ["B56E",0x767B],
- ["B56F",0x767C],
- ["A5D5",0x767D],
- ["A6CA",0x767E],
- ["CA47",0x767F],
- ["CB71",0x7681],
- ["A86D",0x7682],
- ["AABA",0x7684],
- ["ACD2",0x7686],
- ["ACD3",0x7687],
- ["ACD4",0x7688],
- ["D6A6",0x7689],
- ["D2CB",0x768A],
- ["AF6F",0x768B],
- ["B2AE",0x768E],
- ["D6A5",0x768F],
- ["DAB8",0x7692],
- ["B571",0x7693],
- ["DAB7",0x7695],
- ["B570",0x7696],
- ["DED5",0x7699],
- ["BD4A",0x769A],
- ["E6BB",0x769B],
- ["E6B8",0x769C],
- ["E6B9",0x769D],
- ["E6BA",0x769E],
- ["ED78",0x76A4],
- ["F051",0x76A6],
- ["F471",0x76AA],
- ["F470",0x76AB],
- ["F6F5",0x76AD],
- ["A5D6",0x76AE],
- ["CD75",0x76AF],
- ["AF70",0x76B0],
- ["B572",0x76B4],
- ["DED6",0x76B5],
- ["E2E1",0x76B8],
- ["BD4B",0x76BA],
- ["EA74",0x76BB],
- ["F052",0x76BD],
- ["F472",0x76BE],
- ["A5D7",0x76BF],
- ["AABB",0x76C2],
- ["ACD7",0x76C3],
- ["CFDF",0x76C4],
- ["ACD8",0x76C5],
- ["ACD6",0x76C6],
- ["ACD5",0x76C8],
- ["D2CC",0x76C9],
- ["AF71",0x76CA],
- ["AF72",0x76CD],
- ["AF73",0x76CE],
- ["B2B0",0x76D2],
- ["D6A7",0x76D3],
- ["B2AF",0x76D4],
- ["DAB9",0x76DA],
- ["B2B1",0x76DB],
- ["B573",0x76DC],
- ["DED7",0x76DD],
- ["B7F8",0x76DE],
- ["B7F9",0x76DF],
- ["BAC9",0x76E1],
- ["BACA",0x76E3],
- ["BD4C",0x76E4],
- ["BF64",0x76E5],
- ["EA75",0x76E6],
- ["BF63",0x76E7],
- ["ED79",0x76E9],
- ["C0FA",0x76EA],
- ["F053",0x76EC],
- ["F473",0x76ED],
- ["A5D8",0x76EE],
- ["A86E",0x76EF],
- ["CD78",0x76F0],
- ["CD77",0x76F1],
- ["AABC",0x76F2],
- ["CD76",0x76F3],
- ["AABD",0x76F4],
- ["CD79",0x76F5],
- ["CFE5",0x76F7],
- ["ACDB",0x76F8],
- ["ACDA",0x76F9],
- ["CFE7",0x76FA],
- ["CFE6",0x76FB],
- ["ACDF",0x76FC],
- ["ACDE",0x76FE],
- ["ACD9",0x7701],
- ["CFE1",0x7703],
- ["CFE2",0x7704],
- ["CFE3",0x7705],
- ["ACE0",0x7707],
- ["CFE0",0x7708],
- ["ACDC",0x7709],
- ["CFE4",0x770A],
- ["ACDD",0x770B],
- ["D2CF",0x7710],
- ["D2D3",0x7711],
- ["D2D1",0x7712],
- ["D2D0",0x7713],
- ["D2D4",0x7715],
- ["D2D5",0x7719],
- ["D2D6",0x771A],
- ["D2CE",0x771B],
- ["D2CD",0x771D],
- ["AF75",0x771F],
- ["AF76",0x7720],
- ["D2D7",0x7722],
- ["D2D2",0x7723],
- ["D6B0",0x7725],
- ["D2D8",0x7727],
- ["AF77",0x7728],
- ["AF74",0x7729],
- ["D6AA",0x772D],
- ["D6A9",0x772F],
- ["D6AB",0x7731],
- ["D6AC",0x7732],
- ["D6AE",0x7733],
- ["D6AD",0x7734],
- ["D6B2",0x7735],
- ["B2B5",0x7736],
- ["B2B2",0x7737],
- ["B2B6",0x7738],
- ["D6A8",0x7739],
- ["B2B7",0x773A],
- ["D6B1",0x773B],
- ["B2B4",0x773C],
- ["D6AF",0x773D],
- ["B2B3",0x773E],
- ["DABC",0x7744],
- ["DABE",0x7745],
- ["DABA",0x7746],
- ["DABB",0x7747],
- ["DABF",0x774A],
- ["DAC1",0x774B],
- ["DAC2",0x774C],
- ["DABD",0x774D],
- ["DAC0",0x774E],
- ["B574",0x774F],
- ["DEDB",0x7752],
- ["DEE0",0x7754],
- ["DED8",0x7755],
- ["DEDC",0x7756],
- ["DEE1",0x7759],
- ["DEDD",0x775A],
- ["B7FA",0x775B],
- ["B843",0x775C],
- ["B7FD",0x775E],
- ["DED9",0x775F],
- ["DEDA",0x7760],
- ["BACE",0x7761],
- ["B846",0x7762],
- ["B7FE",0x7763],
- ["B844",0x7765],
- ["B7FC",0x7766],
- ["DEDF",0x7767],
- ["B845",0x7768],
- ["DEDE",0x7769],
- ["B841",0x776A],
- ["B7FB",0x776B],
- ["B842",0x776C],
- ["DEE2",0x776D],
- ["E2E6",0x776E],
- ["E2E8",0x776F],
- ["B840",0x7779],
- ["E2E3",0x777C],
- ["BACC",0x777D],
- ["E2E9",0x777E],
- ["BACD",0x777F],
- ["E2E7",0x7780],
- ["E2E2",0x7781],
- ["E2E5",0x7782],
- ["E2EA",0x7783],
- ["BACB",0x7784],
- ["E2E4",0x7785],
- ["BD4E",0x7787],
- ["E6BF",0x7788],
- ["E6BE",0x7789],
- ["BD51",0x778B],
- ["BD4F",0x778C],
- ["E6BC",0x778D],
- ["BD4D",0x778E],
- ["E6BD",0x778F],
- ["BD50",0x7791],
- ["EA7D",0x7795],
- ["EAA1",0x7797],
- ["EA7E",0x7799],
- ["EA76",0x779A],
- ["EA7A",0x779B],
- ["EA79",0x779C],
- ["EA77",0x779D],
- ["BF66",0x779E],
- ["BF67",0x779F],
- ["BF65",0x77A0],
- ["EA78",0x77A1],
- ["EA7B",0x77A2],
- ["EA7C",0x77A3],
- ["BF68",0x77A5],
- ["C140",0x77A7],
- ["EDA3",0x77A8],
- ["C0FC",0x77AA],
- ["ED7B",0x77AB],
- ["C0FE",0x77AC],
- ["C141",0x77AD],
- ["C0FD",0x77B0],
- ["EDA2",0x77B1],
- ["ED7C",0x77B2],
- ["C0FB",0x77B3],
- ["EDA1",0x77B4],
- ["ED7A",0x77B5],
- ["ED7E",0x77B6],
- ["ED7D",0x77B7],
- ["F055",0x77BA],
- ["C2A4",0x77BB],
- ["C2A5",0x77BC],
- ["C2A2",0x77BD],
- ["C2A3",0x77BF],
- ["F054",0x77C2],
- ["F27B",0x77C4],
- ["C3A9",0x77C7],
- ["F279",0x77C9],
- ["F27A",0x77CA],
- ["F474",0x77CC],
- ["F477",0x77CD],
- ["F475",0x77CE],
- ["F476",0x77CF],
- ["F5E0",0x77D0],
- ["C4EF",0x77D3],
- ["F7EB",0x77D4],
- ["F8B4",0x77D5],
- ["C5F7",0x77D7],
- ["F8F8",0x77D8],
- ["F8F9",0x77D9],
- ["C666",0x77DA],
- ["A5D9",0x77DB],
- ["ACE1",0x77DC],
- ["DAC3",0x77DE],
- ["DEE3",0x77E0],
- ["A5DA",0x77E2],
- ["A86F",0x77E3],
- ["AABE",0x77E5],
- ["CFE8",0x77E7],
- ["CFE9",0x77E8],
- ["AF78",0x77E9],
- ["DAC4",0x77EC],
- ["B575",0x77ED],
- ["B847",0x77EE],
- ["C142",0x77EF],
- ["EDA4",0x77F0],
- ["F27C",0x77F1],
- ["F478",0x77F2],
- ["A5DB",0x77F3],
- ["CDA1",0x77F7],
- ["CD7A",0x77F8],
- ["CD7C",0x77F9],
- ["CD7E",0x77FA],
- ["CD7D",0x77FB],
- ["CD7B",0x77FC],
- ["AABF",0x77FD],
- ["ACE2",0x7802],
- ["CFF2",0x7803],
- ["CFED",0x7805],
- ["CFEA",0x7806],
- ["CFF1",0x7809],
- ["ACE4",0x780C],
- ["ACE5",0x780D],
- ["CFF0",0x780E],
- ["CFEF",0x780F],
- ["CFEE",0x7810],
- ["CFEB",0x7811],
- ["CFEC",0x7812],
- ["CFF3",0x7813],
- ["ACE3",0x7814],
- ["AF7C",0x781D],
- ["AFA4",0x781F],
- ["AFA3",0x7820],
- ["D2E1",0x7821],
- ["D2DB",0x7822],
- ["D2D9",0x7823],
- ["AFA1",0x7825],
- ["D6B9",0x7826],
- ["AF7A",0x7827],
- ["D2DE",0x7828],
- ["D2E2",0x7829],
- ["D2E4",0x782A],
- ["D2E0",0x782B],
- ["D2DA",0x782C],
- ["AFA2",0x782D],
- ["D2DF",0x782E],
- ["D2DD",0x782F],
- ["AF79",0x7830],
- ["D2E5",0x7831],
- ["AFA5",0x7832],
- ["D2E3",0x7833],
- ["AF7D",0x7834],
- ["D2DC",0x7835],
- ["AF7E",0x7837],
- ["AF7B",0x7838],
- ["B2B9",0x7843],
- ["D6BA",0x7845],
- ["D6B3",0x7848],
- ["D6B5",0x7849],
- ["D6B7",0x784A],
- ["D6B8",0x784C],
- ["D6B6",0x784D],
- ["B2BA",0x784E],
- ["D6BB",0x7850],
- ["D6B4",0x7852],
- ["DAC8",0x785C],
- ["B576",0x785D],
- ["DAD0",0x785E],
- ["DAC5",0x7860],
- ["DAD1",0x7862],
- ["DAC6",0x7864],
- ["DAC7",0x7865],
- ["DACF",0x7868],
- ["DACE",0x7869],
- ["DACB",0x786A],
- ["B2B8",0x786B],
- ["B577",0x786C],
- ["DAC9",0x786D],
- ["DACC",0x786E],
- ["B578",0x786F],
- ["DACD",0x7870],
- ["DACA",0x7871],
- ["DEEE",0x7879],
- ["DEF2",0x787B],
- ["B84E",0x787C],
- ["E2F0",0x787E],
- ["B851",0x787F],
- ["DEF0",0x7880],
- ["DEED",0x7883],
- ["DEE8",0x7884],
- ["DEEA",0x7885],
- ["DEEB",0x7886],
- ["DEE4",0x7887],
- ["B84D",0x7889],
- ["B84C",0x788C],
- ["B848",0x788E],
- ["DEE7",0x788F],
- ["B84F",0x7891],
- ["B850",0x7893],
- ["DEE6",0x7894],
- ["DEE9",0x7895],
- ["DEF1",0x7896],
- ["B84A",0x7897],
- ["B84B",0x7898],
- ["DEEF",0x7899],
- ["DEE5",0x789A],
- ["E2F2",0x789E],
- ["BAD0",0x789F],
- ["E2F4",0x78A0],
- ["DEEC",0x78A1],
- ["E2F6",0x78A2],
- ["BAD4",0x78A3],
- ["E2F7",0x78A4],
- ["E2F3",0x78A5],
- ["BAD1",0x78A7],
- ["E2EF",0x78A8],
- ["BAD3",0x78A9],
- ["E2EC",0x78AA],
- ["E2F1",0x78AB],
- ["E2F5",0x78AC],
- ["E2EE",0x78AD],
- ["B849",0x78B0],
- ["E2EB",0x78B2],
- ["BAD2",0x78B3],
- ["E2ED",0x78B4],
- ["BD54",0x78BA],
- ["E6C1",0x78BB],
- ["BD58",0x78BC],
- ["BD56",0x78BE],
- ["BACF",0x78C1],
- ["E6C8",0x78C3],
- ["E6C9",0x78C4],
- ["BD53",0x78C5],
- ["E6C7",0x78C8],
- ["E6CA",0x78C9],
- ["BD55",0x78CA],
- ["BD52",0x78CB],
- ["E6C3",0x78CC],
- ["E6C0",0x78CD],
- ["E6C5",0x78CE],
- ["E6C2",0x78CF],
- ["BD59",0x78D0],
- ["E6C4",0x78D1],
- ["E6C6",0x78D4],
- ["BD57",0x78D5],
- ["BF6A",0x78DA],
- ["EAA8",0x78DB],
- ["EAA2",0x78DD],
- ["EAA6",0x78DE],
- ["EAAC",0x78DF],
- ["EAAD",0x78E0],
- ["EAA9",0x78E1],
- ["EAAA",0x78E2],
- ["EAA7",0x78E3],
- ["EAA4",0x78E5],
- ["BF6C",0x78E7],
- ["BF69",0x78E8],
- ["EAA3",0x78E9],
- ["EAA5",0x78EA],
- ["BF6B",0x78EC],
- ["EAAB",0x78ED],
- ["C146",0x78EF],
- ["EDAA",0x78F2],
- ["EDA5",0x78F3],
- ["C145",0x78F4],
- ["C143",0x78F7],
- ["EDAC",0x78F9],
- ["C144",0x78FA],
- ["EDA8",0x78FB],
- ["EDA9",0x78FC],
- ["EDA6",0x78FD],
- ["EDAD",0x78FE],
- ["F056",0x78FF],
- ["C147",0x7901],
- ["EDA7",0x7902],
- ["EDAE",0x7904],
- ["EDAB",0x7905],
- ["F05A",0x7909],
- ["F057",0x790C],
- ["C2A6",0x790E],
- ["F05B",0x7910],
- ["F05D",0x7911],
- ["F05C",0x7912],
- ["F058",0x7913],
- ["F059",0x7914],
- ["F2A3",0x7917],
- ["C3AA",0x7919],
- ["F27E",0x791B],
- ["F2A2",0x791C],
- ["F27D",0x791D],
- ["F2A4",0x791E],
- ["F2A1",0x7921],
- ["F47A",0x7923],
- ["F47D",0x7924],
- ["F479",0x7925],
- ["C471",0x7926],
- ["F47B",0x7927],
- ["F47C",0x7928],
- ["F47E",0x7929],
- ["C472",0x792A],
- ["C474",0x792B],
- ["C473",0x792C],
- ["F5E1",0x792D],
- ["F5E3",0x792F],
- ["F5E2",0x7931],
- ["F6F6",0x7935],
- ["F8B5",0x7938],
- ["F8FA",0x7939],
- ["A5DC",0x793A],
- ["CB72",0x793D],
- ["AAC0",0x793E],
- ["CDA3",0x793F],
- ["AAC1",0x7940],
- ["AAC2",0x7941],
- ["CDA2",0x7942],
- ["CFF8",0x7944],
- ["CFF7",0x7945],
- ["ACE6",0x7946],
- ["ACE9",0x7947],
- ["ACE8",0x7948],
- ["ACE7",0x7949],
- ["CFF4",0x794A],
- ["CFF6",0x794B],
- ["CFF5",0x794C],
- ["D2E8",0x794F],
- ["AFA7",0x7950],
- ["D2EC",0x7951],
- ["D2EB",0x7952],
- ["D2EA",0x7953],
- ["D2E6",0x7954],
- ["AFA6",0x7955],
- ["AFAA",0x7956],
- ["AFAD",0x7957],
- ["AFAE",0x795A],
- ["D2E7",0x795B],
- ["D2E9",0x795C],
- ["AFAC",0x795D],
- ["AFAB",0x795E],
- ["AFA9",0x795F],
- ["AFA8",0x7960],
- ["D6C2",0x7961],
- ["D6C0",0x7963],
- ["D6BC",0x7964],
- ["B2BB",0x7965],
- ["D6BD",0x7967],
- ["B2BC",0x7968],
- ["D6BE",0x7969],
- ["D6BF",0x796A],
- ["D6C1",0x796B],
- ["B2BD",0x796D],
- ["DAD5",0x7970],
- ["DAD4",0x7972],
- ["DAD3",0x7973],
- ["DAD2",0x7974],
- ["DEF6",0x7979],
- ["B852",0x797A],
- ["DEF3",0x797C],
- ["DEF5",0x797D],
- ["B853",0x797F],
- ["B854",0x7981],
- ["DEF4",0x7982],
- ["E341",0x7988],
- ["E2F9",0x798A],
- ["E2FA",0x798B],
- ["BAD7",0x798D],
- ["BAD5",0x798E],
- ["BAD6",0x798F],
- ["E343",0x7990],
- ["E342",0x7992],
- ["E2FE",0x7993],
- ["E2FD",0x7994],
- ["E2FC",0x7995],
- ["E2FB",0x7996],
- ["E340",0x7997],
- ["E2F8",0x7998],
- ["E6CB",0x799A],
- ["E6D0",0x799B],
- ["E6CE",0x799C],
- ["E6CD",0x79A0],
- ["E6CC",0x79A1],
- ["E6CF",0x79A2],
- ["EAAE",0x79A4],
- ["BF6D",0x79A6],
- ["C148",0x79A7],
- ["EDB0",0x79A8],
- ["C149",0x79AA],
- ["EDAF",0x79AB],
- ["F05F",0x79AC],
- ["F05E",0x79AD],
- ["C2A7",0x79AE],
- ["F2A5",0x79B0],
- ["C3AB",0x79B1],
- ["F4A1",0x79B2],
- ["C5A1",0x79B3],
- ["F6F7",0x79B4],
- ["F8B7",0x79B6],
- ["F8B6",0x79B7],
- ["C9A8",0x79B8],
- ["ACEA",0x79B9],
- ["ACEB",0x79BA],
- ["D6C3",0x79BB],
- ["B856",0x79BD],
- ["A5DD",0x79BE],
- ["A872",0x79BF],
- ["A871",0x79C0],
- ["A870",0x79C1],
- ["CDA4",0x79C5],
- ["AAC4",0x79C8],
- ["AAC3",0x79C9],
- ["ACEE",0x79CB],
- ["CFFA",0x79CD],
- ["CFFD",0x79CE],
- ["CFFB",0x79CF],
- ["ACEC",0x79D1],
- ["ACED",0x79D2],
- ["CFF9",0x79D5],
- ["CFFC",0x79D6],
- ["AFB5",0x79D8],
- ["D2F3",0x79DC],
- ["D2F5",0x79DD],
- ["D2F4",0x79DE],
- ["AFB2",0x79DF],
- ["D2EF",0x79E0],
- ["AFB0",0x79E3],
- ["AFAF",0x79E4],
- ["AFB3",0x79E6],
- ["AFB1",0x79E7],
- ["AFB4",0x79E9],
- ["D2F2",0x79EA],
- ["D2ED",0x79EB],
- ["D2EE",0x79EC],
- ["D2F1",0x79ED],
- ["D2F0",0x79EE],
- ["D6C6",0x79F6],
- ["D6C7",0x79F7],
- ["D6C5",0x79F8],
- ["D6C4",0x79FA],
- ["B2BE",0x79FB],
- ["B57D",0x7A00],
- ["DAD6",0x7A02],
- ["DAD8",0x7A03],
- ["DADA",0x7A04],
- ["B57C",0x7A05],
- ["B57A",0x7A08],
- ["DAD7",0x7A0A],
- ["B57B",0x7A0B],
- ["DAD9",0x7A0C],
- ["B579",0x7A0D],
- ["DF41",0x7A10],
- ["DEF7",0x7A11],
- ["DEFA",0x7A12],
- ["DEFE",0x7A13],
- ["B85A",0x7A14],
- ["DEFC",0x7A15],
- ["DEFB",0x7A17],
- ["DEF8",0x7A18],
- ["DEF9",0x7A19],
- ["B858",0x7A1A],
- ["DF40",0x7A1B],
- ["B857",0x7A1C],
- ["B85C",0x7A1E],
- ["B85B",0x7A1F],
- ["B859",0x7A20],
- ["DEFD",0x7A22],
- ["E349",0x7A26],
- ["E348",0x7A28],
- ["E344",0x7A2B],
- ["BAD8",0x7A2E],
- ["E347",0x7A2F],
- ["E346",0x7A30],
- ["BAD9",0x7A31],
- ["BD5E",0x7A37],
- ["E6D2",0x7A39],
- ["BD5F",0x7A3B],
- ["BD5B",0x7A3C],
- ["BD5D",0x7A3D],
- ["BD5A",0x7A3F],
- ["BD5C",0x7A40],
- ["EAAF",0x7A44],
- ["BF70",0x7A46],
- ["EAB1",0x7A47],
- ["EAB0",0x7A48],
- ["E345",0x7A4A],
- ["BF72",0x7A4B],
- ["BF71",0x7A4C],
- ["BF6E",0x7A4D],
- ["BF6F",0x7A4E],
- ["EDB5",0x7A54],
- ["EDB3",0x7A56],
- ["C14A",0x7A57],
- ["EDB4",0x7A58],
- ["EDB6",0x7A5A],
- ["EDB2",0x7A5B],
- ["EDB1",0x7A5C],
- ["F060",0x7A5F],
- ["C2AA",0x7A60],
- ["C2A8",0x7A61],
- ["C2A9",0x7A62],
- ["F2A6",0x7A67],
- ["F2A7",0x7A68],
- ["C3AD",0x7A69],
- ["C3AC",0x7A6B],
- ["F4A3",0x7A6C],
- ["F4A4",0x7A6D],
- ["F4A2",0x7A6E],
- ["F6F8",0x7A70],
- ["F6F9",0x7A71],
- ["A5DE",0x7A74],
- ["CA48",0x7A75],
- ["A873",0x7A76],
- ["CDA5",0x7A78],
- ["AAC6",0x7A79],
- ["AAC5",0x7A7A],
- ["CDA6",0x7A7B],
- ["D040",0x7A7E],
- ["ACEF",0x7A7F],
- ["CFFE",0x7A80],
- ["ACF0",0x7A81],
- ["AFB6",0x7A84],
- ["D2F8",0x7A85],
- ["D2F6",0x7A86],
- ["D2FC",0x7A87],
- ["AFB7",0x7A88],
- ["D2F7",0x7A89],
- ["D2FB",0x7A8A],
- ["D2F9",0x7A8B],
- ["D2FA",0x7A8C],
- ["D6C8",0x7A8F],
- ["D6CA",0x7A90],
- ["B2BF",0x7A92],
- ["D6C9",0x7A94],
- ["B2C0",0x7A95],
- ["B5A2",0x7A96],
- ["B5A1",0x7A97],
- ["B57E",0x7A98],
- ["DADB",0x7A99],
- ["DF44",0x7A9E],
- ["B85D",0x7A9F],
- ["B85E",0x7AA0],
- ["DF43",0x7AA2],
- ["DF42",0x7AA3],
- ["E34A",0x7AA8],
- ["BADB",0x7AA9],
- ["BADA",0x7AAA],
- ["E34B",0x7AAB],
- ["E34C",0x7AAC],
- ["BD61",0x7AAE],
- ["BD60",0x7AAF],
- ["EAB5",0x7AB1],
- ["E6D3",0x7AB2],
- ["E6D5",0x7AB3],
- ["E6D4",0x7AB4],
- ["EAB4",0x7AB5],
- ["EAB2",0x7AB6],
- ["EAB6",0x7AB7],
- ["EAB3",0x7AB8],
- ["BF73",0x7ABA],
- ["EDB7",0x7ABE],
- ["C14B",0x7ABF],
- ["EDB8",0x7AC0],
- ["EDB9",0x7AC1],
- ["C2AB",0x7AC4],
- ["C2AC",0x7AC5],
- ["C475",0x7AC7],
- ["C5D1",0x7ACA],
- ["A5DF",0x7ACB],
- ["D041",0x7AD1],
- ["D2FD",0x7AD8],
- ["AFB8",0x7AD9],
- ["B3BA",0x7ADF],
- ["B3B9",0x7AE0],
- ["B5A4",0x7AE3],
- ["DADD",0x7AE4],
- ["B5A3",0x7AE5],
- ["DADC",0x7AE6],
- ["DF45",0x7AEB],
- ["BADC",0x7AED],
- ["E34D",0x7AEE],
- ["BADD",0x7AEF],
- ["C476",0x7AF6],
- ["F4A5",0x7AF7],
- ["A6CB",0x7AF9],
- ["AAC7",0x7AFA],
- ["CDA7",0x7AFB],
- ["ACF2",0x7AFD],
- ["ACF1",0x7AFF],
- ["D042",0x7B00],
- ["D043",0x7B01],
- ["D340",0x7B04],
- ["D342",0x7B05],
- ["AFB9",0x7B06],
- ["D344",0x7B08],
- ["D347",0x7B09],
- ["D345",0x7B0A],
- ["D346",0x7B0E],
- ["D343",0x7B0F],
- ["D2FE",0x7B10],
- ["AFBA",0x7B11],
- ["D348",0x7B12],
- ["D341",0x7B13],
- ["D6D3",0x7B18],
- ["B2C6",0x7B19],
- ["D6DC",0x7B1A],
- ["B2C3",0x7B1B],
- ["D6D5",0x7B1D],
- ["B2C7",0x7B1E],
- ["B2C1",0x7B20],
- ["D6D0",0x7B22],
- ["D6DD",0x7B23],
- ["D6D1",0x7B24],
- ["D6CE",0x7B25],
- ["B2C5",0x7B26],
- ["B2C2",0x7B28],
- ["D6D4",0x7B2A],
- ["D6D7",0x7B2B],
- ["B2C4",0x7B2C],
- ["D6D8",0x7B2D],
- ["B2C8",0x7B2E],
- ["D6D9",0x7B2F],
- ["D6CF",0x7B30],
- ["D6D6",0x7B31],
- ["D6DA",0x7B32],
- ["D6D2",0x7B33],
- ["D6CD",0x7B34],
- ["D6CB",0x7B35],
- ["D6DB",0x7B38],
- ["DADF",0x7B3B],
- ["DAE4",0x7B40],
- ["DAE0",0x7B44],
- ["DAE6",0x7B45],
- ["B5A7",0x7B46],
- ["D6CC",0x7B47],
- ["DAE1",0x7B48],
- ["B5A5",0x7B49],
- ["DADE",0x7B4A],
- ["B5AC",0x7B4B],
- ["DAE2",0x7B4C],
- ["B5AB",0x7B4D],
- ["DAE3",0x7B4E],
- ["B5AD",0x7B4F],
- ["B5A8",0x7B50],
- ["B5AE",0x7B51],
- ["B5A9",0x7B52],
- ["B5AA",0x7B54],
- ["B5A6",0x7B56],
- ["DAE5",0x7B58],
- ["B861",0x7B60],
- ["DF50",0x7B61],
- ["DF53",0x7B63],
- ["DF47",0x7B64],
- ["DF4C",0x7B65],
- ["DF46",0x7B66],
- ["B863",0x7B67],
- ["DF4A",0x7B69],
- ["DF48",0x7B6D],
- ["B862",0x7B6E],
- ["DF4F",0x7B70],
- ["DF4E",0x7B71],
- ["DF4B",0x7B72],
- ["DF4D",0x7B73],
- ["DF49",0x7B74],
- ["BAE1",0x7B75],
- ["DF52",0x7B76],
- ["B85F",0x7B77],
- ["DF51",0x7B78],
- ["E35D",0x7B82],
- ["BAE8",0x7B84],
- ["E358",0x7B85],
- ["BAE7",0x7B87],
- ["E34E",0x7B88],
- ["E350",0x7B8A],
- ["BAE0",0x7B8B],
- ["E355",0x7B8C],
- ["E354",0x7B8D],
- ["E357",0x7B8E],
- ["BAE5",0x7B8F],
- ["E352",0x7B90],
- ["E351",0x7B91],
- ["BAE4",0x7B94],
- ["BADF",0x7B95],
- ["E353",0x7B96],
- ["BAE2",0x7B97],
- ["E359",0x7B98],
- ["E35B",0x7B99],
- ["E356",0x7B9B],
- ["E34F",0x7B9C],
- ["BAE3",0x7B9D],
- ["BD69",0x7BA0],
- ["BADE",0x7BA1],
- ["E35C",0x7BA4],
- ["E6D9",0x7BAC],
- ["BD62",0x7BAD],
- ["E6DB",0x7BAF],
- ["BD63",0x7BB1],
- ["BD65",0x7BB4],
- ["E6DE",0x7BB5],
- ["E6D6",0x7BB7],
- ["BAE6",0x7BB8],
- ["E6DC",0x7BB9],
- ["E6D8",0x7BBE],
- ["B860",0x7BC0],
- ["BD68",0x7BC1],
- ["BD64",0x7BC4],
- ["BD66",0x7BC6],
- ["BD67",0x7BC7],
- ["BF76",0x7BC9],
- ["E6DD",0x7BCA],
- ["E6D7",0x7BCB],
- ["BD6A",0x7BCC],
- ["E6DA",0x7BCE],
- ["EAC0",0x7BD4],
- ["EABB",0x7BD5],
- ["EAC5",0x7BD8],
- ["BF74",0x7BD9],
- ["EABD",0x7BDA],
- ["BF78",0x7BDB],
- ["EAC3",0x7BDC],
- ["EABA",0x7BDD],
- ["EAB7",0x7BDE],
- ["EAC6",0x7BDF],
- ["C151",0x7BE0],
- ["BF79",0x7BE1],
- ["EAC2",0x7BE2],
- ["EAB8",0x7BE3],
- ["BF77",0x7BE4],
- ["EABC",0x7BE5],
- ["BF7B",0x7BE6],
- ["EAB9",0x7BE7],
- ["EABE",0x7BE8],
- ["BF7A",0x7BE9],
- ["EAC1",0x7BEA],
- ["EAC4",0x7BEB],
- ["EDCB",0x7BF0],
- ["EDCC",0x7BF1],
- ["EDBC",0x7BF2],
- ["EDC3",0x7BF3],
- ["EDC1",0x7BF4],
- ["C14F",0x7BF7],
- ["EDC8",0x7BF8],
- ["EABF",0x7BF9],
- ["EDBF",0x7BFB],
- ["EDC9",0x7BFD],
- ["C14E",0x7BFE],
- ["EDBE",0x7BFF],
- ["EDBD",0x7C00],
- ["EDC7",0x7C01],
- ["EDC4",0x7C02],
- ["EDC6",0x7C03],
- ["EDBA",0x7C05],
- ["EDCA",0x7C06],
- ["C14C",0x7C07],
- ["EDC5",0x7C09],
- ["EDCE",0x7C0A],
- ["EDC2",0x7C0B],
- ["C150",0x7C0C],
- ["C14D",0x7C0D],
- ["EDC0",0x7C0E],
- ["EDBB",0x7C0F],
- ["EDCD",0x7C10],
- ["BF75",0x7C11],
- ["F063",0x7C19],
- ["F061",0x7C1C],
- ["F067",0x7C1D],
- ["C2B0",0x7C1E],
- ["F065",0x7C1F],
- ["F064",0x7C20],
- ["C2B2",0x7C21],
- ["F06A",0x7C22],
- ["C2B1",0x7C23],
- ["F06B",0x7C25],
- ["F068",0x7C26],
- ["C2AE",0x7C27],
- ["F069",0x7C28],
- ["F062",0x7C29],
- ["C2AF",0x7C2A],
- ["C2AD",0x7C2B],
- ["F2AB",0x7C2C],
- ["F066",0x7C2D],
- ["F06C",0x7C30],
- ["F2A8",0x7C33],
- ["C3B2",0x7C37],
- ["C3B0",0x7C38],
- ["F2AA",0x7C39],
- ["F2AC",0x7C3B],
- ["F2A9",0x7C3C],
- ["C3B1",0x7C3D],
- ["C3AE",0x7C3E],
- ["C3AF",0x7C3F],
- ["C3B3",0x7C40],
- ["C478",0x7C43],
- ["F4AA",0x7C45],
- ["F4A9",0x7C47],
- ["F4A7",0x7C48],
- ["F4A6",0x7C49],
- ["F4A8",0x7C4A],
- ["C477",0x7C4C],
- ["C479",0x7C4D],
- ["C4F0",0x7C50],
- ["F5E5",0x7C53],
- ["F5E4",0x7C54],
- ["F6FA",0x7C57],
- ["F6FC",0x7C59],
- ["F6FE",0x7C5A],
- ["F6FD",0x7C5B],
- ["F6FB",0x7C5C],
- ["C5A3",0x7C5F],
- ["C5A2",0x7C60],
- ["C5D3",0x7C63],
- ["C5D2",0x7C64],
- ["C5D4",0x7C65],
- ["F7ED",0x7C66],
- ["F7EC",0x7C67],
- ["F8FB",0x7C69],
- ["F8B8",0x7C6A],
- ["F8FC",0x7C6B],
- ["C658",0x7C6C],
- ["C659",0x7C6E],
- ["F96D",0x7C6F],
- ["C67E",0x7C72],
- ["A6CC",0x7C73],
- ["CDA8",0x7C75],
- ["D045",0x7C78],
- ["D046",0x7C79],
- ["D044",0x7C7A],
- ["ACF3",0x7C7D],
- ["D047",0x7C7F],
- ["D048",0x7C80],
- ["D049",0x7C81],
- ["D349",0x7C84],
- ["D34F",0x7C85],
- ["D34D",0x7C88],
- ["AFBB",0x7C89],
- ["D34B",0x7C8A],
- ["D34C",0x7C8C],
- ["D34E",0x7C8D],
- ["D34A",0x7C91],
- ["B2C9",0x7C92],
- ["D6DE",0x7C94],
- ["B2CB",0x7C95],
- ["D6E0",0x7C96],
- ["B2CA",0x7C97],
- ["D6DF",0x7C98],
- ["DAE8",0x7C9E],
- ["B5AF",0x7C9F],
- ["DAEA",0x7CA1],
- ["DAE7",0x7CA2],
- ["D6E1",0x7CA3],
- ["B5B0",0x7CA5],
- ["DAE9",0x7CA8],
- ["DF56",0x7CAF],
- ["B864",0x7CB1],
- ["DF54",0x7CB2],
- ["B865",0x7CB3],
- ["DF55",0x7CB4],
- ["B866",0x7CB5],
- ["BAE9",0x7CB9],
- ["E361",0x7CBA],
- ["E35E",0x7CBB],
- ["E360",0x7CBC],
- ["BAEA",0x7CBD],
- ["BAEB",0x7CBE],
- ["E35F",0x7CBF],
- ["E6DF",0x7CC5],
- ["E6E0",0x7CC8],
- ["BD6B",0x7CCA],
- ["E6E2",0x7CCB],
- ["E6E1",0x7CCC],
- ["A261",0x7CCE],
- ["EACA",0x7CD0],
- ["EACB",0x7CD1],
- ["EAC7",0x7CD2],
- ["EAC8",0x7CD4],
- ["BF7C",0x7CD5],
- ["BF7D",0x7CD6],
- ["EAC9",0x7CD7],
- ["C157",0x7CD9],
- ["C153",0x7CDC],
- ["C158",0x7CDD],
- ["C154",0x7CDE],
- ["C156",0x7CDF],
- ["C152",0x7CE0],
- ["C155",0x7CE2],
- ["C2B3",0x7CE7],
- ["EDCF",0x7CE8],
- ["F2AE",0x7CEA],
- ["F2AD",0x7CEC],
- ["F4AB",0x7CEE],
- ["C47A",0x7CEF],
- ["C47B",0x7CF0],
- ["F741",0x7CF1],
- ["F5E6",0x7CF2],
- ["F740",0x7CF4],
- ["F8FD",0x7CF6],
- ["F9A4",0x7CF7],
- ["A6CD",0x7CF8],
- ["A874",0x7CFB],
- ["CDA9",0x7CFD],
- ["AAC8",0x7CFE],
- ["ACF6",0x7D00],
- ["D04C",0x7D01],
- ["ACF4",0x7D02],
- ["D04A",0x7D03],
- ["ACF9",0x7D04],
- ["ACF5",0x7D05],
- ["ACFA",0x7D06],
- ["ACF8",0x7D07],
- ["D04B",0x7D08],
- ["ACF7",0x7D09],
- ["AFBF",0x7D0A],
- ["AFBE",0x7D0B],
- ["D35A",0x7D0C],
- ["AFC7",0x7D0D],
- ["D353",0x7D0E],
- ["D359",0x7D0F],
- ["AFC3",0x7D10],
- ["D352",0x7D11],
- ["D358",0x7D12],
- ["D356",0x7D13],
- ["AFC2",0x7D14],
- ["AFC4",0x7D15],
- ["D355",0x7D16],
- ["AFBD",0x7D17],
- ["D354",0x7D18],
- ["AFC8",0x7D19],
- ["AFC5",0x7D1A],
- ["AFC9",0x7D1B],
- ["AFC6",0x7D1C],
- ["D351",0x7D1D],
- ["D350",0x7D1E],
- ["D357",0x7D1F],
- ["AFC0",0x7D20],
- ["AFBC",0x7D21],
- ["AFC1",0x7D22],
- ["D6F0",0x7D28],
- ["D6E9",0x7D29],
- ["B5B5",0x7D2B],
- ["D6E8",0x7D2C],
- ["B2CF",0x7D2E],
- ["B2D6",0x7D2F],
- ["B2D3",0x7D30],
- ["B2D9",0x7D31],
- ["B2D8",0x7D32],
- ["B2D4",0x7D33],
- ["D6E2",0x7D35],
- ["D6E5",0x7D36],
- ["D6E4",0x7D38],
- ["B2D0",0x7D39],
- ["D6E6",0x7D3A],
- ["D6EF",0x7D3B],
- ["B2D1",0x7D3C],
- ["D6E3",0x7D3D],
- ["D6EC",0x7D3E],
- ["D6ED",0x7D3F],
- ["B2D2",0x7D40],
- ["D6EA",0x7D41],
- ["B2D7",0x7D42],
- ["B2CD",0x7D43],
- ["B2D5",0x7D44],
- ["D6E7",0x7D45],
- ["B2CC",0x7D46],
- ["D6EB",0x7D47],
- ["D6EE",0x7D4A],
- ["DAFB",0x7D4E],
- ["DAF2",0x7D4F],
- ["B5B2",0x7D50],
- ["DAF9",0x7D51],
- ["DAF6",0x7D52],
- ["DAEE",0x7D53],
- ["DAF7",0x7D54],
- ["B5B4",0x7D55],
- ["DAEF",0x7D56],
- ["DAEB",0x7D58],
- ["B86C",0x7D5B],
- ["DAF4",0x7D5C],
- ["B5B1",0x7D5E],
- ["DAFA",0x7D5F],
- ["B5B8",0x7D61],
- ["B5BA",0x7D62],
- ["DAED",0x7D63],
- ["B5B9",0x7D66],
- ["DAF0",0x7D67],
- ["B5B3",0x7D68],
- ["DAF8",0x7D69],
- ["DAF1",0x7D6A],
- ["DAF5",0x7D6B],
- ["DAF3",0x7D6D],
- ["B5B6",0x7D6E],
- ["DAEC",0x7D6F],
- ["B5BB",0x7D70],
- ["B2CE",0x7D71],
- ["B5B7",0x7D72],
- ["B5BC",0x7D73],
- ["B868",0x7D79],
- ["DF5D",0x7D7A],
- ["DF5F",0x7D7B],
- ["DF61",0x7D7C],
- ["DF65",0x7D7D],
- ["DF5B",0x7D7F],
- ["DF59",0x7D80],
- ["B86A",0x7D81],
- ["DF60",0x7D83],
- ["DF64",0x7D84],
- ["DF5C",0x7D85],
- ["DF58",0x7D86],
- ["DF57",0x7D88],
- ["DF62",0x7D8C],
- ["DF5A",0x7D8D],
- ["DF5E",0x7D8E],
- ["B86B",0x7D8F],
- ["B869",0x7D91],
- ["DF66",0x7D92],
- ["B867",0x7D93],
- ["DF63",0x7D94],
- ["E372",0x7D96],
- ["BAEE",0x7D9C],
- ["E36A",0x7D9D],
- ["BD78",0x7D9E],
- ["E374",0x7D9F],
- ["BAF1",0x7DA0],
- ["E378",0x7DA1],
- ["BAF7",0x7DA2],
- ["E365",0x7DA3],
- ["E375",0x7DA6],
- ["E362",0x7DA7],
- ["E377",0x7DA9],
- ["E366",0x7DAA],
- ["BAFE",0x7DAC],
- ["BAFB",0x7DAD],
- ["E376",0x7DAE],
- ["E370",0x7DAF],
- ["BAED",0x7DB0],
- ["BAF5",0x7DB1],
- ["BAF4",0x7DB2],
- ["BAF3",0x7DB4],
- ["BAF9",0x7DB5],
- ["E363",0x7DB7],
- ["BAFA",0x7DB8],
- ["E371",0x7DB9],
- ["BAF6",0x7DBA],
- ["BAEC",0x7DBB],
- ["E373",0x7DBC],
- ["BAEF",0x7DBD],
- ["BAF0",0x7DBE],
- ["BAF8",0x7DBF],
- ["E368",0x7DC0],
- ["E367",0x7DC1],
- ["E364",0x7DC2],
- ["E36C",0x7DC4],
- ["E369",0x7DC5],
- ["E36D",0x7DC6],
- ["BAFD",0x7DC7],
- ["E379",0x7DC9],
- ["BAF2",0x7DCA],
- ["E36E",0x7DCB],
- ["E36F",0x7DCC],
- ["E36B",0x7DCE],
- ["BAFC",0x7DD2],
- ["E6E7",0x7DD7],
- ["BD70",0x7DD8],
- ["BD79",0x7DD9],
- ["BD75",0x7DDA],
- ["E6E4",0x7DDB],
- ["BD72",0x7DDD],
- ["BD76",0x7DDE],
- ["E6F0",0x7DDF],
- ["BD6C",0x7DE0],
- ["E6E8",0x7DE1],
- ["BD74",0x7DE3],
- ["E6EB",0x7DE6],
- ["E6E6",0x7DE7],
- ["BD73",0x7DE8],
- ["BD77",0x7DE9],
- ["E6E5",0x7DEA],
- ["BD71",0x7DEC],
- ["E6EF",0x7DEE],
- ["BD6E",0x7DEF],
- ["E6EE",0x7DF0],
- ["E6ED",0x7DF1],
- ["BD7A",0x7DF2],
- ["E572",0x7DF3],
- ["BD6D",0x7DF4],
- ["E6EC",0x7DF6],
- ["E6E3",0x7DF7],
- ["BD7B",0x7DF9],
- ["E6EA",0x7DFA],
- ["BD6F",0x7DFB],
- ["E6E9",0x7E03],
- ["BFA2",0x7E08],
- ["BFA7",0x7E09],
- ["BF7E",0x7E0A],
- ["EAD8",0x7E0B],
- ["EACF",0x7E0C],
- ["EADB",0x7E0D],
- ["EAD3",0x7E0E],
- ["EAD9",0x7E0F],
- ["BFA8",0x7E10],
- ["BFA1",0x7E11],
- ["EACC",0x7E12],
- ["EAD2",0x7E13],
- ["EADC",0x7E14],
- ["EAD5",0x7E15],
- ["EADA",0x7E16],
- ["EACE",0x7E17],
- ["EAD6",0x7E1A],
- ["BFA3",0x7E1B],
- ["EAD4",0x7E1C],
- ["BFA6",0x7E1D],
- ["BFA5",0x7E1E],
- ["EAD0",0x7E1F],
- ["EAD1",0x7E20],
- ["EACD",0x7E21],
- ["EAD7",0x7E22],
- ["BFA4",0x7E23],
- ["EADE",0x7E24],
- ["EADD",0x7E25],
- ["EDDA",0x7E29],
- ["EDD6",0x7E2A],
- ["C15F",0x7E2B],
- ["EDD0",0x7E2D],
- ["C159",0x7E2E],
- ["C169",0x7E2F],
- ["EDDC",0x7E30],
- ["C161",0x7E31],
- ["C15D",0x7E32],
- ["EDD3",0x7E33],
- ["C164",0x7E34],
- ["C167",0x7E35],
- ["EDDE",0x7E36],
- ["C15C",0x7E37],
- ["EDD5",0x7E38],
- ["C165",0x7E39],
- ["EDE0",0x7E3A],
- ["EDDD",0x7E3B],
- ["EDD1",0x7E3C],
- ["C160",0x7E3D],
- ["C15A",0x7E3E],
- ["C168",0x7E3F],
- ["EDD8",0x7E40],
- ["C163",0x7E41],
- ["EDD2",0x7E42],
- ["C15E",0x7E43],
- ["EDDF",0x7E44],
- ["C162",0x7E45],
- ["C15B",0x7E46],
- ["EDD9",0x7E47],
- ["C166",0x7E48],
- ["EDD7",0x7E49],
- ["EDDB",0x7E4C],
- ["F06E",0x7E50],
- ["F074",0x7E51],
- ["C2B9",0x7E52],
- ["F077",0x7E53],
- ["C2B4",0x7E54],
- ["C2B5",0x7E55],
- ["F06F",0x7E56],
- ["F076",0x7E57],
- ["F071",0x7E58],
- ["C2BA",0x7E59],
- ["C2B7",0x7E5A],
- ["F06D",0x7E5C],
- ["C2B6",0x7E5E],
- ["F073",0x7E5F],
- ["F075",0x7E60],
- ["C2B8",0x7E61],
- ["F072",0x7E62],
- ["F070",0x7E63],
- ["F2B8",0x7E68],
- ["C3B7",0x7E69],
- ["C3B8",0x7E6A],
- ["C3B4",0x7E6B],
- ["C3B5",0x7E6D],
- ["F2B4",0x7E6F],
- ["F2B2",0x7E70],
- ["F2B6",0x7E72],
- ["C3BA",0x7E73],
- ["F2B7",0x7E74],
- ["F2B0",0x7E75],
- ["F2AF",0x7E76],
- ["F2B3",0x7E77],
- ["F2B1",0x7E78],
- ["C3B6",0x7E79],
- ["F2B5",0x7E7A],
- ["F4AC",0x7E7B],
- ["C47E",0x7E7C],
- ["C47D",0x7E7D],
- ["F4AD",0x7E7E],
- ["F4AF",0x7E80],
- ["F4AE",0x7E81],
- ["C4A1",0x7E82],
- ["F5EB",0x7E86],
- ["F5E8",0x7E87],
- ["F5E9",0x7E88],
- ["F5E7",0x7E8A],
- ["F5EA",0x7E8B],
- ["C4F2",0x7E8C],
- ["F5EC",0x7E8D],
- ["C4F1",0x7E8F],
- ["F742",0x7E91],
- ["C5D5",0x7E93],
- ["C5D7",0x7E94],
- ["F7EE",0x7E95],
- ["C5D6",0x7E96],
- ["F8B9",0x7E97],
- ["F940",0x7E98],
- ["F942",0x7E99],
- ["F8FE",0x7E9A],
- ["F941",0x7E9B],
- ["C66C",0x7E9C],
- ["A6CE",0x7F36],
- ["ACFB",0x7F38],
- ["D26F",0x7F39],
- ["AFCA",0x7F3A],
- ["B2DA",0x7F3D],
- ["DAFC",0x7F3E],
- ["DAFD",0x7F3F],
- ["EADF",0x7F43],
- ["C16A",0x7F44],
- ["EDE1",0x7F45],
- ["C2BB",0x7F48],
- ["F2BA",0x7F4A],
- ["F2B9",0x7F4B],
- ["C4A2",0x7F4C],
- ["F5ED",0x7F4D],
- ["F743",0x7F4F],
- ["C5F8",0x7F50],
- ["CA49",0x7F51],
- ["AAC9",0x7F54],
- ["A875",0x7F55],
- ["D04D",0x7F58],
- ["D360",0x7F5B],
- ["D35B",0x7F5C],
- ["D35F",0x7F5D],
- ["D35D",0x7F5E],
- ["AFCB",0x7F5F],
- ["D35E",0x7F60],
- ["D35C",0x7F61],
- ["D6F1",0x7F63],
- ["DAFE",0x7F65],
- ["DB40",0x7F66],
- ["DF69",0x7F67],
- ["DF6A",0x7F68],
- ["B86E",0x7F69],
- ["B86F",0x7F6A],
- ["DF68",0x7F6B],
- ["DF6B",0x7F6C],
- ["DF67",0x7F6D],
- ["B86D",0x7F6E],
- ["BB40",0x7F70],
- ["B870",0x7F72],
- ["E37A",0x7F73],
- ["BD7C",0x7F75],
- ["E6F1",0x7F76],
- ["BD7D",0x7F77],
- ["BFA9",0x7F79],
- ["EAE2",0x7F7A],
- ["EAE0",0x7F7B],
- ["EAE1",0x7F7C],
- ["EDE4",0x7F7D],
- ["EDE3",0x7F7E],
- ["EDE2",0x7F7F],
- ["F2BB",0x7F83],
- ["C3B9",0x7F85],
- ["F2BC",0x7F86],
- ["F744",0x7F87],
- ["C5F9",0x7F88],
- ["F8BA",0x7F89],
- ["A6CF",0x7F8A],
- ["AACB",0x7F8B],
- ["AACA",0x7F8C],
- ["D04F",0x7F8D],
- ["ACFC",0x7F8E],
- ["D04E",0x7F91],
- ["D362",0x7F92],
- ["AFCC",0x7F94],
- ["D6F2",0x7F95],
- ["D361",0x7F96],
- ["B2DC",0x7F9A],
- ["D6F5",0x7F9B],
- ["D6F3",0x7F9C],
- ["D6F4",0x7F9D],
- ["B2DB",0x7F9E],
- ["DB42",0x7FA0],
- ["DB43",0x7FA1],
- ["DB41",0x7FA2],
- ["B873",0x7FA4],
- ["DF6D",0x7FA5],
- ["DF6C",0x7FA6],
- ["DF6E",0x7FA7],
- ["B872",0x7FA8],
- ["B871",0x7FA9],
- ["E6F2",0x7FAC],
- ["E6F4",0x7FAD],
- ["BD7E",0x7FAF],
- ["E6F3",0x7FB0],
- ["EAE3",0x7FB1],
- ["BFAA",0x7FB2],
- ["F079",0x7FB3],
- ["F078",0x7FB5],
- ["C3BB",0x7FB6],
- ["F2BD",0x7FB7],
- ["C3BD",0x7FB8],
- ["C3BC",0x7FB9],
- ["F4B0",0x7FBA],
- ["F5EE",0x7FBB],
- ["C4F3",0x7FBC],
- ["A6D0",0x7FBD],
- ["D050",0x7FBE],
- ["ACFD",0x7FBF],
- ["D365",0x7FC0],
- ["AFCE",0x7FC1],
- ["D364",0x7FC2],
- ["D363",0x7FC3],
- ["AFCD",0x7FC5],
- ["D6FB",0x7FC7],
- ["D6FD",0x7FC9],
- ["D6F6",0x7FCA],
- ["D6F7",0x7FCB],
- ["B2DD",0x7FCC],
- ["D6F8",0x7FCD],
- ["B2DE",0x7FCE],
- ["D6FC",0x7FCF],
- ["D6F9",0x7FD0],
- ["D6FA",0x7FD1],
- ["B2DF",0x7FD2],
- ["B5BE",0x7FD4],
- ["B5BF",0x7FD5],
- ["DB44",0x7FD7],
- ["DF6F",0x7FDB],
- ["DF70",0x7FDC],
- ["E37E",0x7FDE],
- ["BB43",0x7FDF],
- ["BB41",0x7FE0],
- ["BB42",0x7FE1],
- ["E37B",0x7FE2],
- ["E37C",0x7FE3],
- ["E37D",0x7FE5],
- ["E6F9",0x7FE6],
- ["E6FA",0x7FE8],
- ["BDA1",0x7FE9],
- ["E6F7",0x7FEA],
- ["E6F6",0x7FEB],
- ["E6F8",0x7FEC],
- ["E6F5",0x7FED],
- ["BFAD",0x7FEE],
- ["EAE4",0x7FEF],
- ["BFAB",0x7FF0],
- ["BFAC",0x7FF1],
- ["EDE6",0x7FF2],
- ["C16B",0x7FF3],
- ["EDE5",0x7FF4],
- ["EFA8",0x7FF5],
- ["F07A",0x7FF7],
- ["F07B",0x7FF8],
- ["C2BC",0x7FF9],
- ["C2BD",0x7FFB],
- ["C16C",0x7FFC],
- ["F2BE",0x7FFD],
- ["F2BF",0x7FFE],
- ["F4B1",0x7FFF],
- ["C4A3",0x8000],
- ["A6D1",0x8001],
- ["A6D2",0x8003],
- ["ACFE",0x8004],
- ["AACC",0x8005],
- ["AFCF",0x8006],
- ["D051",0x8007],
- ["B5C0",0x800B],
- ["A6D3",0x800C],
- ["AD41",0x800D],
- ["D052",0x800E],
- ["D053",0x800F],
- ["AD40",0x8010],
- ["AD42",0x8011],
- ["A6D4",0x8012],
- ["D054",0x8014],
- ["AFD1",0x8015],
- ["D366",0x8016],
- ["AFD3",0x8017],
- ["AFD0",0x8018],
- ["AFD2",0x8019],
- ["D741",0x801B],
- ["B2E0",0x801C],
- ["D740",0x801E],
- ["D6FE",0x801F],
- ["DF71",0x8021],
- ["E3A1",0x8024],
- ["BDA2",0x8026],
- ["BFAE",0x8028],
- ["EAE6",0x8029],
- ["EAE5",0x802A],
- ["EDE7",0x802C],
- ["F5EF",0x8030],
- ["A6D5",0x8033],
- ["CB73",0x8034],
- ["CDAA",0x8035],
- ["AD43",0x8036],
- ["D055",0x8037],
- ["D368",0x8039],
- ["AFD4",0x803D],
- ["D367",0x803E],
- ["AFD5",0x803F],
- ["D743",0x8043],
- ["B2E2",0x8046],
- ["D742",0x8047],
- ["D744",0x8048],
- ["B2E1",0x804A],
- ["DB46",0x804F],
- ["DB47",0x8050],
- ["DB45",0x8051],
- ["B5C1",0x8052],
- ["B874",0x8056],
- ["B875",0x8058],
- ["BB45",0x805A],
- ["E3A3",0x805C],
- ["E3A2",0x805D],
- ["BB44",0x805E],
- ["E6FB",0x8064],
- ["E6FC",0x8067],
- ["EAE7",0x806C],
- ["C170",0x806F],
- ["C16F",0x8070],
- ["C16D",0x8071],
- ["C16E",0x8072],
- ["C171",0x8073],
- ["F07C",0x8075],
- ["C2BF",0x8076],
- ["C2BE",0x8077],
- ["F2C0",0x8078],
- ["F4B2",0x8079],
- ["C5A5",0x807D],
- ["C5A4",0x807E],
- ["A6D6",0x807F],
- ["D1FB",0x8082],
- ["B877",0x8084],
- ["B5C2",0x8085],
- ["B876",0x8086],
- ["BB46",0x8087],
- ["A6D7",0x8089],
- ["C9A9",0x808A],
- ["A6D8",0x808B],
- ["A6D9",0x808C],
- ["CDAB",0x808F],
- ["CB76",0x8090],
- ["CB77",0x8092],
- ["A877",0x8093],
- ["CB74",0x8095],
- ["A876",0x8096],
- ["A879",0x8098],
- ["CB75",0x8099],
- ["A87B",0x809A],
- ["A87A",0x809B],
- ["CB78",0x809C],
- ["A878",0x809D],
- ["AAD1",0x80A1],
- ["AACF",0x80A2],
- ["CDAD",0x80A3],
- ["AACE",0x80A5],
- ["AAD3",0x80A9],
- ["AAD5",0x80AA],
- ["AAD2",0x80AB],
- ["CDB0",0x80AD],
- ["CDAC",0x80AE],
- ["AAD6",0x80AF],
- ["AAD0",0x80B1],
- ["A87C",0x80B2],
- ["AAD4",0x80B4],
- ["CDAF",0x80B5],
- ["CDAE",0x80B8],
- ["AACD",0x80BA],
- ["D05B",0x80C2],
- ["AD47",0x80C3],
- ["AD48",0x80C4],
- ["D05D",0x80C5],
- ["D057",0x80C7],
- ["D05A",0x80C8],
- ["D063",0x80C9],
- ["D061",0x80CA],
- ["AD49",0x80CC],
- ["D067",0x80CD],
- ["AD4C",0x80CE],
- ["D064",0x80CF],
- ["D05C",0x80D0],
- ["D059",0x80D1],
- ["DB49",0x80D4],
- ["D062",0x80D5],
- ["AD44",0x80D6],
- ["D065",0x80D7],
- ["D056",0x80D8],
- ["D05F",0x80D9],
- ["AD46",0x80DA],
- ["AD4B",0x80DB],
- ["D060",0x80DC],
- ["AD4F",0x80DD],
- ["AD4D",0x80DE],
- ["D058",0x80E0],
- ["AD4A",0x80E1],
- ["D05E",0x80E3],
- ["AD4E",0x80E4],
- ["AD45",0x80E5],
- ["D066",0x80E6],
- ["AFDA",0x80ED],
- ["AFE3",0x80EF],
- ["AFD8",0x80F0],
- ["AFD6",0x80F1],
- ["D36A",0x80F2],
- ["AFDE",0x80F3],
- ["AFDB",0x80F4],
- ["D36C",0x80F5],
- ["AFDD",0x80F8],
- ["D36B",0x80F9],
- ["D369",0x80FA],
- ["D36E",0x80FB],
- ["AFE2",0x80FC],
- ["AFE0",0x80FD],
- ["DB48",0x80FE],
- ["D36F",0x8100],
- ["D36D",0x8101],
- ["AFD7",0x8102],
- ["AFD9",0x8105],
- ["AFDC",0x8106],
- ["AFDF",0x8108],
- ["AFE1",0x810A],
- ["D74E",0x8115],
- ["B2E4",0x8116],
- ["D745",0x8118],
- ["D747",0x8119],
- ["D748",0x811B],
- ["D750",0x811D],
- ["D74C",0x811E],
- ["D74A",0x811F],
- ["D74D",0x8121],
- ["D751",0x8122],
- ["B2E5",0x8123],
- ["B2E9",0x8124],
- ["D746",0x8125],
- ["D74F",0x8127],
- ["B2E7",0x8129],
- ["B2E6",0x812B],
- ["D74B",0x812C],
- ["D749",0x812D],
- ["B2E3",0x812F],
- ["B2E8",0x8130],
- ["B5C8",0x8139],
- ["DB51",0x813A],
- ["DB4F",0x813D],
- ["B5CA",0x813E],
- ["DB4A",0x8143],
- ["DFA1",0x8144],
- ["B5C9",0x8146],
- ["DB4E",0x8147],
- ["DB4B",0x814A],
- ["B5C5",0x814B],
- ["B5CB",0x814C],
- ["DB50",0x814D],
- ["B5C7",0x814E],
- ["DB4D",0x814F],
- ["BB47",0x8150],
- ["B5C6",0x8151],
- ["DB4C",0x8152],
- ["B5CC",0x8153],
- ["B5C4",0x8154],
- ["B5C3",0x8155],
- ["DF77",0x815B],
- ["DF75",0x815C],
- ["DF7B",0x815E],
- ["DF73",0x8160],
- ["DFA2",0x8161],
- ["DF78",0x8162],
- ["DF72",0x8164],
- ["B87B",0x8165],
- ["B8A3",0x8166],
- ["DF7D",0x8167],
- ["DF76",0x8169],
- ["B87E",0x816B],
- ["B87C",0x816E],
- ["DF7E",0x816F],
- ["B879",0x8170],
- ["B878",0x8171],
- ["DF79",0x8172],
- ["B87D",0x8173],
- ["B5CD",0x8174],
- ["DF7C",0x8176],
- ["DF74",0x8177],
- ["B87A",0x8178],
- ["B8A1",0x8179],
- ["B8A2",0x817A],
- ["BB4C",0x817F],
- ["BB48",0x8180],
- ["BB4D",0x8182],
- ["E3A6",0x8183],
- ["E3A5",0x8186],
- ["E3A7",0x8187],
- ["BB4A",0x8188],
- ["E3A4",0x8189],
- ["BB4B",0x818A],
- ["E3AA",0x818B],
- ["E3A9",0x818C],
- ["E3A8",0x818D],
- ["BB49",0x818F],
- ["E741",0x8195],
- ["E744",0x8197],
- ["BDA8",0x8198],
- ["E743",0x8199],
- ["BDA7",0x819A],
- ["BDA3",0x819B],
- ["BDA4",0x819C],
- ["BDA5",0x819D],
- ["E740",0x819E],
- ["E6FE",0x819F],
- ["BDA6",0x81A0],
- ["E742",0x81A2],
- ["E6FD",0x81A3],
- ["EAE9",0x81A6],
- ["EAF3",0x81A7],
- ["BFB1",0x81A8],
- ["BFB0",0x81A9],
- ["EAED",0x81AB],
- ["EAEF",0x81AC],
- ["EAEA",0x81AE],
- ["EAEE",0x81B0],
- ["EAE8",0x81B1],
- ["EAF1",0x81B2],
- ["BFAF",0x81B3],
- ["EAF0",0x81B4],
- ["EAEC",0x81B5],
- ["EAF2",0x81B7],
- ["EAEB",0x81B9],
- ["C174",0x81BA],
- ["EDE8",0x81BB],
- ["EDEE",0x81BC],
- ["C178",0x81BD],
- ["C17A",0x81BE],
- ["C177",0x81BF],
- ["C176",0x81C0],
- ["C175",0x81C2],
- ["C173",0x81C3],
- ["EDE9",0x81C4],
- ["EDEC",0x81C5],
- ["C172",0x81C6],
- ["EDED",0x81C7],
- ["C179",0x81C9],
- ["EDEB",0x81CA],
- ["EDEA",0x81CC],
- ["C2C0",0x81CD],
- ["C2C1",0x81CF],
- ["F0A1",0x81D0],
- ["F07D",0x81D1],
- ["F07E",0x81D2],
- ["F2C2",0x81D5],
- ["F2C1",0x81D7],
- ["C3BE",0x81D8],
- ["F4B4",0x81D9],
- ["C4A4",0x81DA],
- ["F4B3",0x81DB],
- ["F5F0",0x81DD],
- ["F745",0x81DE],
- ["C5A6",0x81DF],
- ["F943",0x81E0],
- ["F944",0x81E1],
- ["C5D8",0x81E2],
- ["A6DA",0x81E3],
- ["AAD7",0x81E5],
- ["DB52",0x81E6],
- ["BB4E",0x81E7],
- ["C17B",0x81E8],
- ["EDEF",0x81E9],
- ["A6DB",0x81EA],
- ["AFE5",0x81EC],
- ["AFE4",0x81ED],
- ["DB53",0x81EE],
- ["EAF4",0x81F2],
- ["A6DC",0x81F3],
- ["AD50",0x81F4],
- ["DB54",0x81F7],
- ["DB55",0x81F8],
- ["DB56",0x81F9],
- ["BB4F",0x81FA],
- ["BFB2",0x81FB],
- ["A6DD",0x81FC],
- ["AAD8",0x81FE],
- ["D068",0x81FF],
- ["AFE6",0x8200],
- ["D370",0x8201],
- ["B2EA",0x8202],
- ["DB57",0x8204],
- ["B8A4",0x8205],
- ["BB50",0x8207],
- ["BFB3",0x8208],
- ["C17C",0x8209],
- ["C2C2",0x820A],
- ["F4B5",0x820B],
- ["A6DE",0x820C],
- ["AAD9",0x820D],
- ["AFE7",0x8210],
- ["D752",0x8211],
- ["B5CE",0x8212],
- ["BB51",0x8214],
- ["E3AB",0x8215],
- ["E745",0x8216],
- ["A6DF",0x821B],
- ["B5CF",0x821C],
- ["DFA3",0x821D],
- ["BB52",0x821E],
- ["A6E0",0x821F],
- ["CDB1",0x8220],
- ["D069",0x8221],
- ["AD51",0x8222],
- ["D372",0x8225],
- ["AFEA",0x8228],
- ["AFE8",0x822A],
- ["AFE9",0x822B],
- ["AFEB",0x822C],
- ["D371",0x822F],
- ["D757",0x8232],
- ["D754",0x8233],
- ["D756",0x8234],
- ["B2EB",0x8235],
- ["B2ED",0x8236],
- ["B2EC",0x8237],
- ["D753",0x8238],
- ["B2EE",0x8239],
- ["D755",0x823A],
- ["DB58",0x823C],
- ["DB59",0x823D],
- ["DB5A",0x823F],
- ["DFA6",0x8240],
- ["DFA7",0x8242],
- ["DFA5",0x8244],
- ["DFA8",0x8245],
- ["B8A5",0x8247],
- ["DFA4",0x8249],
- ["BB53",0x824B],
- ["E74A",0x824E],
- ["E746",0x824F],
- ["E749",0x8250],
- ["E74B",0x8251],
- ["E748",0x8252],
- ["E747",0x8253],
- ["EAF5",0x8255],
- ["EAF6",0x8256],
- ["EAF7",0x8257],
- ["BFB4",0x8258],
- ["BFB5",0x8259],
- ["EDF1",0x825A],
- ["EDF0",0x825B],
- ["EDF2",0x825C],
- ["F0A3",0x825E],
- ["F0A2",0x825F],
- ["F2C4",0x8261],
- ["F2C5",0x8263],
- ["F2C3",0x8264],
- ["C4A5",0x8266],
- ["F4B6",0x8268],
- ["F4B7",0x8269],
- ["F746",0x826B],
- ["F7EF",0x826C],
- ["F8BB",0x826D],
- ["A6E1",0x826E],
- ["A87D",0x826F],
- ["C17D",0x8271],
- ["A6E2",0x8272],
- ["D758",0x8274],
- ["DB5B",0x8275],
- ["C641",0x8277],
- ["CA4A",0x8278],
- ["CA4B",0x827C],
- ["CA4D",0x827D],
- ["A6E3",0x827E],
- ["CA4E",0x827F],
- ["CA4C",0x8280],
- ["CBA2",0x8283],
- ["CBA3",0x8284],
- ["CB7B",0x8285],
- ["CBA1",0x828A],
- ["A8A1",0x828B],
- ["A8A2",0x828D],
- ["CB7C",0x828E],
- ["CB7A",0x828F],
- ["CB79",0x8290],
- ["CB7D",0x8291],
- ["A87E",0x8292],
- ["CB7E",0x8293],
- ["D06A",0x8294],
- ["CDB6",0x8298],
- ["AADC",0x8299],
- ["CDB5",0x829A],
- ["CDB7",0x829B],
- ["AADB",0x829D],
- ["CDBC",0x829E],
- ["AADF",0x829F],
- ["CDB2",0x82A0],
- ["CDC0",0x82A1],
- ["CDC6",0x82A2],
- ["AAE6",0x82A3],
- ["CDC3",0x82A4],
- ["AAE3",0x82A5],
- ["CDB9",0x82A7],
- ["CDBF",0x82A8],
- ["CDC1",0x82A9],
- ["CDB4",0x82AB],
- ["AAE2",0x82AC],
- ["AADD",0x82AD],
- ["CDBA",0x82AE],
- ["AAE4",0x82AF],
- ["AAE7",0x82B0],
- ["AAE1",0x82B1],
- ["AADA",0x82B3],
- ["CDBE",0x82B4],
- ["CDB8",0x82B5],
- ["CDC5",0x82B6],
- ["AAE9",0x82B7],
- ["AAE5",0x82B8],
- ["AAE0",0x82B9],
- ["CDBD",0x82BA],
- ["AFEC",0x82BB],
- ["CDBB",0x82BC],
- ["AADE",0x82BD],
- ["AAE8",0x82BE],
- ["CDB3",0x82C0],
- ["CDC2",0x82C2],
- ["CDC4",0x82C3],
- ["AD62",0x82D1],
- ["AD5C",0x82D2],
- ["AD64",0x82D3],
- ["AD61",0x82D4],
- ["D071",0x82D5],
- ["D074",0x82D6],
- ["AD5D",0x82D7],
- ["D06B",0x82D9],
- ["AD56",0x82DB],
- ["AD60",0x82DC],
- ["AD63",0x82DE],
- ["AD65",0x82DF],
- ["D0A2",0x82E0],
- ["D077",0x82E1],
- ["AD55",0x82E3],
- ["D0A1",0x82E4],
- ["AD59",0x82E5],
- ["AD57",0x82E6],
- ["AD52",0x82E7],
- ["D06F",0x82E8],
- ["D07E",0x82EA],
- ["D073",0x82EB],
- ["D076",0x82EC],
- ["D0A5",0x82ED],
- ["AD66",0x82EF],
- ["D07D",0x82F0],
- ["AD5E",0x82F1],
- ["D078",0x82F2],
- ["D0A4",0x82F3],
- ["D075",0x82F4],
- ["D079",0x82F5],
- ["D07C",0x82F6],
- ["D06D",0x82F9],
- ["D0A3",0x82FA],
- ["D07B",0x82FB],
- ["D06C",0x82FE],
- ["D070",0x8300],
- ["AD5F",0x8301],
- ["AD5A",0x8302],
- ["AD53",0x8303],
- ["AD58",0x8304],
- ["AD54",0x8305],
- ["AD67",0x8306],
- ["D06E",0x8307],
- ["D3A5",0x8308],
- ["AD5B",0x8309],
- ["D07A",0x830C],
- ["CE41",0x830D],
- ["D3A8",0x8316],
- ["AFFA",0x8317],
- ["D376",0x8319],
- ["D3A3",0x831B],
- ["D37D",0x831C],
- ["D3B2",0x831E],
- ["D3AA",0x8320],
- ["D37E",0x8322],
- ["D3A9",0x8324],
- ["D378",0x8325],
- ["D37C",0x8326],
- ["D3B5",0x8327],
- ["AFFD",0x8328],
- ["D3AD",0x8329],
- ["D3A4",0x832A],
- ["AFED",0x832B],
- ["D3B3",0x832C],
- ["D374",0x832D],
- ["D3AC",0x832F],
- ["AFFC",0x8331],
- ["AFF7",0x8332],
- ["D373",0x8333],
- ["AFF5",0x8334],
- ["AFF4",0x8335],
- ["AFF9",0x8336],
- ["D3AB",0x8337],
- ["AFF1",0x8338],
- ["AFF8",0x8339],
- ["D072",0x833A],
- ["DB5C",0x833B],
- ["D3A6",0x833C],
- ["D37A",0x833F],
- ["AFFB",0x8340],
- ["D37B",0x8341],
- ["D3A1",0x8342],
- ["AFFE",0x8343],
- ["D375",0x8344],
- ["D3AF",0x8345],
- ["D3AE",0x8347],
- ["D3B6",0x8348],
- ["AFF3",0x8349],
- ["AFF0",0x834A],
- ["D3B4",0x834B],
- ["D3B0",0x834C],
- ["D3A7",0x834D],
- ["D3A2",0x834E],
- ["AFF6",0x834F],
- ["AFF2",0x8350],
- ["D377",0x8351],
- ["AFEE",0x8352],
- ["D3B1",0x8353],
- ["AFEF",0x8354],
- ["D379",0x8356],
- ["D75E",0x8373],
- ["D760",0x8374],
- ["D765",0x8375],
- ["D779",0x8376],
- ["B2FC",0x8377],
- ["B2F2",0x8378],
- ["D75D",0x837A],
- ["B2FD",0x837B],
- ["B2FE",0x837C],
- ["D768",0x837D],
- ["D76F",0x837E],
- ["D775",0x837F],
- ["D762",0x8381],
- ["D769",0x8383],
- ["B340",0x8386],
- ["D777",0x8387],
- ["D772",0x8388],
- ["B2FA",0x8389],
- ["B2F8",0x838A],
- ["D76E",0x838B],
- ["D76A",0x838C],
- ["D75C",0x838D],
- ["B2EF",0x838E],
- ["D761",0x838F],
- ["D759",0x8390],
- ["B2F7",0x8392],
- ["B2F9",0x8393],
- ["D766",0x8394],
- ["D763",0x8395],
- ["B2F4",0x8396],
- ["D773",0x8397],
- ["B2F1",0x8398],
- ["D764",0x8399],
- ["D77A",0x839A],
- ["D76C",0x839B],
- ["D76B",0x839D],
- ["B2F0",0x839E],
- ["B2FB",0x83A0],
- ["B2F3",0x83A2],
- ["D75A",0x83A3],
- ["D75F",0x83A4],
- ["D770",0x83A5],
- ["D776",0x83A6],
- ["B341",0x83A7],
- ["D75B",0x83A8],
- ["D767",0x83A9],
- ["D76D",0x83AA],
- ["B2F6",0x83AB],
- ["D778",0x83AE],
- ["D771",0x83AF],
- ["D774",0x83B0],
- ["B2F5",0x83BD],
- ["DB6C",0x83BF],
- ["DB60",0x83C0],
- ["B5D7",0x83C1],
- ["DB7D",0x83C2],
- ["DBA7",0x83C3],
- ["DBAA",0x83C4],
- ["B5D5",0x83C5],
- ["DB68",0x83C6],
- ["DBA3",0x83C7],
- ["DB69",0x83C8],
- ["DB77",0x83C9],
- ["B5E2",0x83CA],
- ["DB73",0x83CB],
- ["B5DF",0x83CC],
- ["DB74",0x83CE],
- ["DB5D",0x83CF],
- ["DBA4",0x83D1],
- ["B5E8",0x83D4],
- ["DBA1",0x83D5],
- ["DB75",0x83D6],
- ["DBAC",0x83D7],
- ["DB70",0x83D8],
- ["DFC8",0x83D9],
- ["DBAF",0x83DB],
- ["B5E6",0x83DC],
- ["DB6E",0x83DD],
- ["DB7A",0x83DE],
- ["B5E9",0x83DF],
- ["B5D4",0x83E0],
- ["DB72",0x83E1],
- ["DBAD",0x83E2],
- ["DB6B",0x83E3],
- ["DB64",0x83E4],
- ["DB6F",0x83E5],
- ["DB63",0x83E7],
- ["DB61",0x83E8],
- ["B5D0",0x83E9],
- ["DBA5",0x83EA],
- ["DB6A",0x83EB],
- ["DBA8",0x83EC],
- ["DBA9",0x83EE],
- ["B5D8",0x83EF],
- ["B5DD",0x83F0],
- ["B5D9",0x83F1],
- ["B5E1",0x83F2],
- ["DB7E",0x83F3],
- ["B5DA",0x83F4],
- ["DB76",0x83F5],
- ["DB66",0x83F6],
- ["B5D2",0x83F8],
- ["DB5E",0x83F9],
- ["DBA2",0x83FA],
- ["DBAB",0x83FB],
- ["DB65",0x83FC],
- ["B5E0",0x83FD],
- ["DBB0",0x83FE],
- ["DB71",0x83FF],
- ["DB6D",0x8401],
- ["B5D1",0x8403],
- ["B5E5",0x8404],
- ["DB7C",0x8406],
- ["B5E7",0x8407],
- ["DB78",0x8409],
- ["B5DC",0x840A],
- ["B5D6",0x840B],
- ["B5DE",0x840C],
- ["B5D3",0x840D],
- ["B5E4",0x840E],
- ["DB79",0x840F],
- ["DB67",0x8410],
- ["DB7B",0x8411],
- ["DB62",0x8412],
- ["DBA6",0x8413],
- ["DBAE",0x841B],
- ["DB5F",0x8423],
- ["DFC7",0x8429],
- ["DFDD",0x842B],
- ["B855",0x842C],
- ["DFCC",0x842D],
- ["DFCA",0x842F],
- ["DFB5",0x8430],
- ["B8A9",0x8431],
- ["DFC5",0x8432],
- ["DFD9",0x8433],
- ["DFC1",0x8434],
- ["B8B1",0x8435],
- ["DFD8",0x8436],
- ["DFBF",0x8437],
- ["B5E3",0x8438],
- ["DFCF",0x8439],
- ["DFC0",0x843A],
- ["DFD6",0x843B],
- ["B8B0",0x843C],
- ["B8A8",0x843D],
- ["DFAA",0x843F],
- ["DFB2",0x8440],
- ["DFCB",0x8442],
- ["DFC3",0x8443],
- ["DFDC",0x8444],
- ["DFC6",0x8445],
- ["B8B6",0x8446],
- ["DFD7",0x8447],
- ["B8AD",0x8449],
- ["DFC9",0x844B],
- ["DFD1",0x844C],
- ["DFB6",0x844D],
- ["DFD0",0x844E],
- ["DFE1",0x8450],
- ["DFB1",0x8451],
- ["DFD2",0x8452],
- ["DFDF",0x8454],
- ["DFAB",0x8456],
- ["B5DB",0x8457],
- ["DFB9",0x8459],
- ["DFB8",0x845A],
- ["B8AF",0x845B],
- ["DFBC",0x845D],
- ["DFBE",0x845E],
- ["DFCD",0x845F],
- ["DFDE",0x8460],
- ["B8B2",0x8461],
- ["B8B3",0x8463],
- ["DFB0",0x8465],
- ["B8AB",0x8466],
- ["DFB4",0x8467],
- ["DFDA",0x8468],
- ["B8B4",0x8469],
- ["B8AC",0x846B],
- ["B8AE",0x846C],
- ["B8B5",0x846D],
- ["DFE0",0x846E],
- ["DFD3",0x846F],
- ["DFCE",0x8470],
- ["DFBB",0x8473],
- ["DFBA",0x8474],
- ["B8AA",0x8475],
- ["DFAC",0x8476],
- ["B8A7",0x8477],
- ["DFC4",0x8478],
- ["DFAD",0x8479],
- ["DFC2",0x847A],
- ["DFB7",0x847D],
- ["DFDB",0x847E],
- ["B8A6",0x8482],
- ["DFB3",0x8486],
- ["DFAF",0x848D],
- ["DFD5",0x848E],
- ["DFAE",0x848F],
- ["BB60",0x8490],
- ["E3D3",0x8491],
- ["E3C2",0x8494],
- ["E3AC",0x8497],
- ["E3CA",0x8498],
- ["BB58",0x8499],
- ["E3BB",0x849A],
- ["E3C5",0x849B],
- ["BB5B",0x849C],
- ["E3BE",0x849D],
- ["BB59",0x849E],
- ["E3AF",0x849F],
- ["E3CD",0x84A0],
- ["E3AE",0x84A1],
- ["E3C1",0x84A2],
- ["E3AD",0x84A4],
- ["E3BF",0x84A7],
- ["E3C8",0x84A8],
- ["E3C6",0x84A9],
- ["E3BA",0x84AA],
- ["E3B5",0x84AB],
- ["E3B3",0x84AC],
- ["E3B4",0x84AE],
- ["E3C7",0x84AF],
- ["E3D2",0x84B0],
- ["E3BC",0x84B1],
- ["BB5A",0x84B2],
- ["E3B7",0x84B4],
- ["E3CB",0x84B6],
- ["BB5D",0x84B8],
- ["E3B6",0x84B9],
- ["E3B0",0x84BA],
- ["E3C0",0x84BB],
- ["BB61",0x84BC],
- ["BB55",0x84BF],
- ["BB5E",0x84C0],
- ["E3B8",0x84C1],
- ["E3B2",0x84C2],
- ["BB57",0x84C4],
- ["DFD4",0x84C5],
- ["BB56",0x84C6],
- ["E3C3",0x84C7],
- ["BB54",0x84C9],
- ["BB63",0x84CA],
- ["BB5C",0x84CB],
- ["E3C4",0x84CC],
- ["E3B9",0x84CD],
- ["E3B1",0x84CE],
- ["E3CC",0x84CF],
- ["E3BD",0x84D0],
- ["BB62",0x84D1],
- ["E3D0",0x84D2],
- ["BB5F",0x84D3],
- ["E3CF",0x84D4],
- ["E3C9",0x84D6],
- ["E3CE",0x84D7],
- ["E3D1",0x84DB],
- ["E773",0x84E7],
- ["E774",0x84E8],
- ["E767",0x84E9],
- ["E766",0x84EA],
- ["E762",0x84EB],
- ["BDB4",0x84EC],
- ["BDAC",0x84EE],
- ["E776",0x84EF],
- ["E775",0x84F0],
- ["DFA9",0x84F1],
- ["E75F",0x84F2],
- ["E763",0x84F3],
- ["E75D",0x84F4],
- ["E770",0x84F6],
- ["E761",0x84F7],
- ["E777",0x84F9],
- ["E75A",0x84FA],
- ["E758",0x84FB],
- ["E764",0x84FC],
- ["E76E",0x84FD],
- ["E769",0x84FE],
- ["BDB6",0x84FF],
- ["E74F",0x8500],
- ["E76D",0x8502],
- ["BDB7",0x8506],
- ["DFBD",0x8507],
- ["E75B",0x8508],
- ["E752",0x8509],
- ["E755",0x850A],
- ["E77B",0x850B],
- ["E75C",0x850C],
- ["E753",0x850D],
- ["E751",0x850E],
- ["E74E",0x850F],
- ["BDB0",0x8511],
- ["E765",0x8512],
- ["BDAF",0x8513],
- ["BDB3",0x8514],
- ["E760",0x8515],
- ["E768",0x8516],
- ["BDA9",0x8517],
- ["E778",0x8518],
- ["E77C",0x8519],
- ["BDAB",0x851A],
- ["E757",0x851C],
- ["E76B",0x851D],
- ["E76F",0x851E],
- ["E754",0x851F],
- ["E779",0x8520],
- ["BDB2",0x8521],
- ["BDB1",0x8523],
- ["E74C",0x8524],
- ["BDB5",0x8525],
- ["E772",0x8526],
- ["E756",0x8527],
- ["E76A",0x8528],
- ["E750",0x8529],
- ["E75E",0x852A],
- ["E759",0x852B],
- ["BDAD",0x852C],
- ["BDAE",0x852D],
- ["E76C",0x852E],
- ["E77D",0x852F],
- ["E77A",0x8530],
- ["E771",0x8531],
- ["E74D",0x853B],
- ["BDAA",0x853D],
- ["EB49",0x853E],
- ["EB40",0x8540],
- ["EB43",0x8541],
- ["BFBB",0x8543],
- ["EB45",0x8544],
- ["EAF9",0x8545],
- ["EB41",0x8546],
- ["EB47",0x8547],
- ["BFB8",0x8548],
- ["BFBC",0x8549],
- ["BFB6",0x854A],
- ["EAFB",0x854D],
- ["EB4C",0x854E],
- ["EB46",0x8551],
- ["EAFC",0x8553],
- ["EB55",0x8554],
- ["EB4F",0x8555],
- ["EAF8",0x8556],
- ["EE46",0x8557],
- ["EAFE",0x8558],
- ["BFB7",0x8559],
- ["EB4A",0x855B],
- ["EB54",0x855D],
- ["BFBF",0x855E],
- ["EB51",0x8560],
- ["EAFD",0x8561],
- ["EB44",0x8562],
- ["EB48",0x8563],
- ["EB42",0x8564],
- ["EB56",0x8565],
- ["EB53",0x8566],
- ["EB50",0x8567],
- ["BFB9",0x8568],
- ["BFBA",0x8569],
- ["BFBE",0x856A],
- ["EAFA",0x856B],
- ["EB57",0x856C],
- ["BFBD",0x856D],
- ["EB4D",0x856E],
- ["EB4B",0x8571],
- ["EB4E",0x8575],
- ["EE53",0x8576],
- ["EE40",0x8577],
- ["EE45",0x8578],
- ["EE52",0x8579],
- ["EE44",0x857A],
- ["EDFB",0x857B],
- ["EE41",0x857C],
- ["C1A2",0x857E],
- ["EDF4",0x8580],
- ["EE4D",0x8581],
- ["EE4F",0x8582],
- ["EDF3",0x8583],
- ["C1A1",0x8584],
- ["EE51",0x8585],
- ["EE49",0x8586],
- ["C1A8",0x8587],
- ["EE50",0x8588],
- ["EE42",0x8589],
- ["C1AA",0x858A],
- ["EDF9",0x858B],
- ["EB52",0x858C],
- ["EE4A",0x858D],
- ["EE47",0x858E],
- ["EDF5",0x858F],
- ["EE55",0x8590],
- ["C1A4",0x8591],
- ["C1A5",0x8594],
- ["EDF7",0x8595],
- ["EE48",0x8596],
- ["EE54",0x8598],
- ["EE4B",0x8599],
- ["EDFD",0x859A],
- ["C1A7",0x859B],
- ["C1A3",0x859C],
- ["EE4C",0x859D],
- ["EDFE",0x859E],
- ["EE56",0x859F],
- ["EDF8",0x85A0],
- ["EE43",0x85A1],
- ["EE4E",0x85A2],
- ["EDFA",0x85A3],
- ["EDFC",0x85A4],
- ["C2CB",0x85A6],
- ["EDF6",0x85A7],
- ["C1A9",0x85A8],
- ["C2C4",0x85A9],
- ["C17E",0x85AA],
- ["C1A6",0x85AF],
- ["C2C8",0x85B0],
- ["F0B3",0x85B1],
- ["F0A9",0x85B3],
- ["F0A4",0x85B4],
- ["F0AA",0x85B5],
- ["F0B4",0x85B6],
- ["F0B8",0x85B7],
- ["F0B7",0x85B8],
- ["C2CA",0x85B9],
- ["C2C9",0x85BA],
- ["F0AB",0x85BD],
- ["F0B9",0x85BE],
- ["F0AE",0x85BF],
- ["F0A6",0x85C0],
- ["F0A8",0x85C2],
- ["F0A7",0x85C3],
- ["F0AD",0x85C4],
- ["F0B2",0x85C5],
- ["F0A5",0x85C6],
- ["F0AC",0x85C7],
- ["F0B1",0x85C8],
- ["C2C7",0x85C9],
- ["F0AF",0x85CB],
- ["C2C5",0x85CD],
- ["F0B0",0x85CE],
- ["C2C3",0x85CF],
- ["C2C6",0x85D0],
- ["F2D5",0x85D1],
- ["F0B5",0x85D2],
- ["C3C2",0x85D5],
- ["F2CD",0x85D7],
- ["F2D1",0x85D8],
- ["F2C9",0x85D9],
- ["F2CC",0x85DA],
- ["F2D4",0x85DC],
- ["C3C0",0x85DD],
- ["F2D9",0x85DE],
- ["F2D2",0x85DF],
- ["F2CA",0x85E1],
- ["F2DA",0x85E2],
- ["F2D3",0x85E3],
- ["C3C3",0x85E4],
- ["C3C4",0x85E5],
- ["F2D7",0x85E6],
- ["F2CB",0x85E8],
- ["C3BF",0x85E9],
- ["C3C1",0x85EA],
- ["F2C6",0x85EB],
- ["F2CE",0x85EC],
- ["F2C8",0x85ED],
- ["F2D8",0x85EF],
- ["F2D6",0x85F0],
- ["F2C7",0x85F1],
- ["F2CF",0x85F2],
- ["F4BE",0x85F6],
- ["C3C5",0x85F7],
- ["F2D0",0x85F8],
- ["C4A7",0x85F9],
- ["C4A9",0x85FA],
- ["C4A6",0x85FB],
- ["F4C3",0x85FD],
- ["F4BB",0x85FE],
- ["F4B9",0x85FF],
- ["F4BD",0x8600],
- ["F4BA",0x8601],
- ["F4BF",0x8604],
- ["F4C1",0x8605],
- ["C4AA",0x8606],
- ["C4AC",0x8607],
- ["F4C0",0x8609],
- ["C4AD",0x860A],
- ["C4AB",0x860B],
- ["F4C2",0x860C],
- ["C4A8",0x8611],
- ["C4F4",0x8617],
- ["F5F1",0x8618],
- ["F5F7",0x8619],
- ["C4F6",0x861A],
- ["F4BC",0x861B],
- ["F5F6",0x861C],
- ["F5FD",0x861E],
- ["F5F4",0x861F],
- ["F5FB",0x8620],
- ["F5FA",0x8621],
- ["F4B8",0x8622],
- ["F5F5",0x8623],
- ["F0B6",0x8624],
- ["F5FE",0x8625],
- ["F5F3",0x8626],
- ["F5F8",0x8627],
- ["F5FC",0x8629],
- ["F5F2",0x862A],
- ["F74A",0x862C],
- ["C4F5",0x862D],
- ["F5F9",0x862E],
- ["F7F4",0x8631],
- ["F74B",0x8632],
- ["F749",0x8633],
- ["F747",0x8634],
- ["F748",0x8635],
- ["F74C",0x8636],
- ["C5D9",0x8638],
- ["F7F2",0x8639],
- ["F7F0",0x863A],
- ["F7F5",0x863B],
- ["F7F3",0x863C],
- ["F7F6",0x863E],
- ["C5DA",0x863F],
- ["F7F1",0x8640],
- ["F8BC",0x8643],
- ["F945",0x8646],
- ["F946",0x8647],
- ["F947",0x8648],
- ["F9C7",0x864B],
- ["F9BD",0x864C],
- ["CA4F",0x864D],
- ["AAEA",0x864E],
- ["AD68",0x8650],
- ["D3B8",0x8652],
- ["D3B7",0x8653],
- ["B040",0x8654],
- ["B342",0x8655],
- ["D77C",0x8656],
- ["D77B",0x8659],
- ["B5EA",0x865B],
- ["B8B8",0x865C],
- ["B8B7",0x865E],
- ["B8B9",0x865F],
- ["E3D4",0x8661],
- ["E77E",0x8662],
- ["EB58",0x8663],
- ["EB5A",0x8664],
- ["EB59",0x8665],
- ["C1AB",0x8667],
- ["EE57",0x8668],
- ["F0BA",0x8669],
- ["F9A5",0x866A],
- ["A6E4",0x866B],
- ["CDC9",0x866D],
- ["CDCA",0x866E],
- ["CDC8",0x866F],
- ["CDC7",0x8670],
- ["AAEB",0x8671],
- ["D0A9",0x8673],
- ["D0A7",0x8674],
- ["D0A6",0x8677],
- ["AD69",0x8679],
- ["AD6B",0x867A],
- ["AD6A",0x867B],
- ["D0A8",0x867C],
- ["D3C4",0x8685],
- ["D3C1",0x8686],
- ["D3BF",0x8687],
- ["B041",0x868A],
- ["D3C2",0x868B],
- ["B046",0x868C],
- ["D3BC",0x868D],
- ["D3CB",0x868E],
- ["D3CD",0x8690],
- ["D3BD",0x8691],
- ["B043",0x8693],
- ["D3CE",0x8694],
- ["D3C9",0x8695],
- ["D3BB",0x8696],
- ["D3C0",0x8697],
- ["D3CA",0x8698],
- ["D3C6",0x8699],
- ["D3C3",0x869A],
- ["B048",0x869C],
- ["D3CC",0x869D],
- ["D3BE",0x869E],
- ["D3C7",0x86A1],
- ["D3B9",0x86A2],
- ["B047",0x86A3],
- ["B044",0x86A4],
- ["D3C5",0x86A5],
- ["D3C8",0x86A7],
- ["D3BA",0x86A8],
- ["B045",0x86A9],
- ["B042",0x86AA],
- ["B34C",0x86AF],
- ["D7A5",0x86B0],
- ["B34B",0x86B1],
- ["D7A8",0x86B3],
- ["D7AB",0x86B4],
- ["B348",0x86B5],
- ["B346",0x86B6],
- ["D77E",0x86B7],
- ["D7A9",0x86B8],
- ["D7A7",0x86B9],
- ["D7A4",0x86BA],
- ["D7AC",0x86BB],
- ["D7AD",0x86BC],
- ["D7AF",0x86BD],
- ["D7B0",0x86BE],
- ["D77D",0x86BF],
- ["B345",0x86C0],
- ["D7A2",0x86C1],
- ["D7A1",0x86C2],
- ["D7AE",0x86C3],
- ["B347",0x86C4],
- ["D7A3",0x86C5],
- ["B349",0x86C6],
- ["B344",0x86C7],
- ["D7A6",0x86C8],
- ["B34D",0x86C9],
- ["B34A",0x86CB],
- ["D7AA",0x86CC],
- ["B5F1",0x86D0],
- ["DBBF",0x86D1],
- ["DBB4",0x86D3],
- ["B5EE",0x86D4],
- ["DFE7",0x86D6],
- ["DBBD",0x86D7],
- ["DBB1",0x86D8],
- ["B5EC",0x86D9],
- ["DBB6",0x86DA],
- ["B5EF",0x86DB],
- ["DBBA",0x86DC],
- ["DBB8",0x86DD],
- ["B5F2",0x86DE],
- ["B5EB",0x86DF],
- ["DBB2",0x86E2],
- ["DBB5",0x86E3],
- ["B5F0",0x86E4],
- ["DBB3",0x86E6],
- ["DBBE",0x86E8],
- ["DBBC",0x86E9],
- ["DBB7",0x86EA],
- ["DBB9",0x86EB],
- ["DBBB",0x86EC],
- ["B5ED",0x86ED],
- ["DFE8",0x86F5],
- ["DFEE",0x86F6],
- ["DFE4",0x86F7],
- ["DFEA",0x86F8],
- ["B8BA",0x86F9],
- ["DFE6",0x86FA],
- ["B8C0",0x86FB],
- ["B8BF",0x86FE],
- ["B8BE",0x8700],
- ["DFED",0x8701],
- ["B8C1",0x8702],
- ["B8C2",0x8703],
- ["DFE3",0x8704],
- ["DFF0",0x8705],
- ["B8C3",0x8706],
- ["B8BD",0x8707],
- ["B8BC",0x8708],
- ["DFEC",0x8709],
- ["B8C4",0x870A],
- ["DFE2",0x870B],
- ["DFE5",0x870C],
- ["DFEF",0x870D],
- ["DFEB",0x870E],
- ["E3F4",0x8711],
- ["E3E9",0x8712],
- ["B8BB",0x8713],
- ["BB6A",0x8718],
- ["E3DD",0x8719],
- ["E3F2",0x871A],
- ["E3DE",0x871B],
- ["BB65",0x871C],
- ["E3DB",0x871E],
- ["E3E4",0x8720],
- ["E3DC",0x8721],
- ["BB67",0x8722],
- ["E3D6",0x8723],
- ["E3F1",0x8724],
- ["BB68",0x8725],
- ["E3EE",0x8726],
- ["E3EF",0x8727],
- ["E3D7",0x8728],
- ["BB6D",0x8729],
- ["E3E6",0x872A],
- ["E3E0",0x872C],
- ["E3E7",0x872D],
- ["E3DA",0x872E],
- ["E3F3",0x8730],
- ["E3EB",0x8731],
- ["E3E5",0x8732],
- ["E3D5",0x8733],
- ["BB69",0x8734],
- ["E3EC",0x8735],
- ["BB6C",0x8737],
- ["E3F0",0x8738],
- ["E3EA",0x873A],
- ["BB66",0x873B],
- ["E3E8",0x873C],
- ["E3E2",0x873E],
- ["BB64",0x873F],
- ["E3D9",0x8740],
- ["E3E1",0x8741],
- ["E3ED",0x8742],
- ["E3DF",0x8743],
- ["E3E3",0x8746],
- ["BDC1",0x874C],
- ["DFE9",0x874D],
- ["E7B2",0x874E],
- ["E7BB",0x874F],
- ["E7B1",0x8750],
- ["E7AD",0x8751],
- ["E7AA",0x8752],
- ["BDC2",0x8753],
- ["E7A8",0x8754],
- ["BB6B",0x8755],
- ["E7A1",0x8756],
- ["BDC0",0x8757],
- ["E7A7",0x8758],
- ["BDBF",0x8759],
- ["E7AC",0x875A],
- ["E7A9",0x875B],
- ["E7B9",0x875C],
- ["E7B4",0x875D],
- ["E7AE",0x875E],
- ["E7B3",0x875F],
- ["BDBB",0x8760],
- ["E7AB",0x8761],
- ["E7BE",0x8762],
- ["E7A2",0x8763],
- ["E7A3",0x8764],
- ["E7BA",0x8765],
- ["BDBC",0x8766],
- ["E7BF",0x8767],
- ["BDBE",0x8768],
- ["E7C0",0x8769],
- ["E7B0",0x876A],
- ["E3D8",0x876B],
- ["E7B6",0x876C],
- ["E7AF",0x876D],
- ["E7B8",0x876E],
- ["E7B5",0x876F],
- ["E7A6",0x8773],
- ["BDB9",0x8774],
- ["E7BD",0x8775],
- ["BDBA",0x8776],
- ["E7A4",0x8777],
- ["BDBD",0x8778],
- ["EB64",0x8779],
- ["E7B7",0x877A],
- ["E7BC",0x877B],
- ["EB61",0x8781],
- ["BDB8",0x8782],
- ["BFC0",0x8783],
- ["EB6B",0x8784],
- ["EB67",0x8785],
- ["EB65",0x8787],
- ["EB60",0x8788],
- ["EB6F",0x8789],
- ["BFC4",0x878D],
- ["EB5C",0x878F],
- ["EB68",0x8790],
- ["EB69",0x8791],
- ["EB5F",0x8792],
- ["EB5E",0x8793],
- ["EB6C",0x8794],
- ["EB62",0x8796],
- ["EB5D",0x8797],
- ["EB63",0x8798],
- ["EB6E",0x879A],
- ["EB5B",0x879B],
- ["EB6D",0x879C],
- ["EB6A",0x879D],
- ["BFC2",0x879E],
- ["BFC1",0x879F],
- ["BFC3",0x87A2],
- ["EB66",0x87A3],
- ["F0CB",0x87A4],
- ["EE59",0x87AA],
- ["C1B1",0x87AB],
- ["EE5D",0x87AC],
- ["EE5A",0x87AD],
- ["EE61",0x87AE],
- ["EE67",0x87AF],
- ["EE5C",0x87B0],
- ["EE70",0x87B2],
- ["C1AE",0x87B3],
- ["EE6A",0x87B4],
- ["EE5F",0x87B5],
- ["EE6B",0x87B6],
- ["EE66",0x87B7],
- ["EE6D",0x87B8],
- ["EE5E",0x87B9],
- ["C1B3",0x87BA],
- ["C1B2",0x87BB],
- ["EE60",0x87BC],
- ["EE6E",0x87BD],
- ["EE58",0x87BE],
- ["EE6C",0x87BF],
- ["C1AC",0x87C0],
- ["EE64",0x87C2],
- ["EE63",0x87C3],
- ["EE68",0x87C4],
- ["EE5B",0x87C5],
- ["C1B0",0x87C6],
- ["C1B4",0x87C8],
- ["EE62",0x87C9],
- ["EE69",0x87CA],
- ["C1B5",0x87CB],
- ["EE65",0x87CC],
- ["C1AD",0x87D1],
- ["C1AF",0x87D2],
- ["F0C7",0x87D3],
- ["F0C5",0x87D4],
- ["F0CC",0x87D7],
- ["F0C9",0x87D8],
- ["F0CD",0x87D9],
- ["F0BE",0x87DB],
- ["F0C6",0x87DC],
- ["F0D1",0x87DD],
- ["EE6F",0x87DE],
- ["F0C2",0x87DF],
- ["C2CF",0x87E0],
- ["E7A5",0x87E1],
- ["F0BD",0x87E2],
- ["F0CA",0x87E3],
- ["F0C4",0x87E4],
- ["F0C1",0x87E5],
- ["F0BC",0x87E6],
- ["F0BB",0x87E7],
- ["F0D0",0x87E8],
- ["F0C0",0x87EA],
- ["F0BF",0x87EB],
- ["C2CD",0x87EC],
- ["F0C8",0x87ED],
- ["C2CC",0x87EF],
- ["C2CE",0x87F2],
- ["F0C3",0x87F3],
- ["F0CF",0x87F4],
- ["F2DE",0x87F6],
- ["F2DF",0x87F7],
- ["C3C9",0x87F9],
- ["F2DC",0x87FA],
- ["C3C6",0x87FB],
- ["F2E4",0x87FC],
- ["C3CA",0x87FE],
- ["F2E6",0x87FF],
- ["F2DB",0x8800],
- ["F0CE",0x8801],
- ["F2E8",0x8802],
- ["F2DD",0x8803],
- ["C3C7",0x8805],
- ["F2E3",0x8806],
- ["F2E5",0x8808],
- ["F2E0",0x8809],
- ["F2E7",0x880A],
- ["F2E2",0x880B],
- ["F2E1",0x880C],
- ["C3C8",0x880D],
- ["F4C5",0x8810],
- ["F4C6",0x8811],
- ["F4C8",0x8813],
- ["C4AE",0x8814],
- ["C4AF",0x8815],
- ["F4C9",0x8816],
- ["F4C7",0x8817],
- ["F4C4",0x8819],
- ["F642",0x881B],
- ["F645",0x881C],
- ["F641",0x881D],
- ["C4FA",0x881F],
- ["F643",0x8820],
- ["C4F9",0x8821],
- ["C4F8",0x8822],
- ["C4F7",0x8823],
- ["F644",0x8824],
- ["F751",0x8825],
- ["F74F",0x8826],
- ["F74E",0x8828],
- ["F640",0x8829],
- ["F750",0x882A],
- ["F646",0x882B],
- ["F74D",0x882C],
- ["F7F9",0x882E],
- ["F7D7",0x882F],
- ["F7F7",0x8830],
- ["C5DB",0x8831],
- ["F7F8",0x8832],
- ["F7FA",0x8833],
- ["F8BF",0x8835],
- ["C5FA",0x8836],
- ["F8BE",0x8837],
- ["F8BD",0x8838],
- ["C5FB",0x8839],
- ["C65A",0x883B],
- ["F96E",0x883C],
- ["F9A7",0x883D],
- ["F9A6",0x883E],
- ["F9A8",0x883F],
- ["A6E5",0x8840],
- ["D0AA",0x8841],
- ["D3CF",0x8843],
- ["D3D0",0x8844],
- ["DBC0",0x8848],
- ["F647",0x884A],
- ["F8C0",0x884B],
- ["A6E6",0x884C],
- ["AD6C",0x884D],
- ["D0AB",0x884E],
- ["D7B1",0x8852],
- ["B34E",0x8853],
- ["DBC2",0x8855],
- ["DBC1",0x8856],
- ["B5F3",0x8857],
- ["B8C5",0x8859],
- ["E7C1",0x885A],
- ["BDC3",0x885B],
- ["BDC4",0x885D],
- ["BFC5",0x8861],
- ["C5FC",0x8862],
- ["A6E7",0x8863],
- ["D0AC",0x8867],
- ["AAED",0x8868],
- ["D0AE",0x8869],
- ["D0AD",0x886A],
- ["AD6D",0x886B],
- ["D3D1",0x886D],
- ["D3D8",0x886F],
- ["B049",0x8870],
- ["D3D6",0x8871],
- ["D3D4",0x8872],
- ["D3DB",0x8874],
- ["D3D2",0x8875],
- ["D3D3",0x8876],
- ["B04A",0x8877],
- ["B04E",0x8879],
- ["D3DC",0x887C],
- ["B04D",0x887D],
- ["D3DA",0x887E],
- ["D3D7",0x887F],
- ["D3D5",0x8880],
- ["B04B",0x8881],
- ["B04C",0x8882],
- ["D3D9",0x8883],
- ["B350",0x8888],
- ["D7B2",0x8889],
- ["B355",0x888B],
- ["D7C2",0x888C],
- ["B354",0x888D],
- ["D7C4",0x888E],
- ["D7B8",0x8891],
- ["B352",0x8892],
- ["D7C3",0x8893],
- ["D7B3",0x8895],
- ["B353",0x8896],
- ["D7BF",0x8897],
- ["D7BB",0x8898],
- ["D7BD",0x8899],
- ["D7B7",0x889A],
- ["D7BE",0x889B],
- ["B34F",0x889E],
- ["D7BA",0x889F],
- ["D7B9",0x88A1],
- ["D7B5",0x88A2],
- ["D7C0",0x88A4],
- ["D7BC",0x88A7],
- ["D7B4",0x88A8],
- ["D7B6",0x88AA],
- ["B351",0x88AB],
- ["D7C1",0x88AC],
- ["B5F6",0x88B1],
- ["DBCD",0x88B2],
- ["DBC9",0x88B6],
- ["DBCB",0x88B7],
- ["DBC6",0x88B8],
- ["DBC5",0x88B9],
- ["DBC3",0x88BA],
- ["DBCA",0x88BC],
- ["DBCC",0x88BD],
- ["DBC8",0x88BE],
- ["DBC7",0x88C0],
- ["B5F4",0x88C1],
- ["B5F5",0x88C2],
- ["DBCF",0x88C9],
- ["B8CD",0x88CA],
- ["DFF2",0x88CB],
- ["DFF8",0x88CC],
- ["DFF3",0x88CD],
- ["DFF4",0x88CE],
- ["DFF9",0x88D0],
- ["B8CF",0x88D2],
- ["B8C7",0x88D4],
- ["B8CE",0x88D5],
- ["DFF1",0x88D6],
- ["DBC4",0x88D7],
- ["B8CA",0x88D8],
- ["B8C8",0x88D9],
- ["DFF7",0x88DA],
- ["DFF6",0x88DB],
- ["B8C9",0x88DC],
- ["B8CB",0x88DD],
- ["DFF5",0x88DE],
- ["B8C6",0x88DF],
- ["B8CC",0x88E1],
- ["E3F6",0x88E7],
- ["BB74",0x88E8],
- ["E442",0x88EB],
- ["E441",0x88EC],
- ["E3FB",0x88EE],
- ["BB76",0x88EF],
- ["E440",0x88F0],
- ["E3F7",0x88F1],
- ["E3F8",0x88F2],
- ["BB6E",0x88F3],
- ["BB70",0x88F4],
- ["E3FD",0x88F6],
- ["E3F5",0x88F7],
- ["BB72",0x88F8],
- ["BB71",0x88F9],
- ["E3F9",0x88FA],
- ["E3FE",0x88FB],
- ["E3FC",0x88FC],
- ["BB73",0x88FD],
- ["E3FA",0x88FE],
- ["DBCE",0x8901],
- ["BB6F",0x8902],
- ["E7C2",0x8905],
- ["E7C9",0x8906],
- ["BDC6",0x8907],
- ["E7CD",0x8909],
- ["BDCA",0x890A],
- ["E7C5",0x890B],
- ["E7C3",0x890C],
- ["E7CC",0x890E],
- ["BDC5",0x8910],
- ["E7CB",0x8911],
- ["BDC7",0x8912],
- ["BDC8",0x8913],
- ["E7C4",0x8914],
- ["BDC9",0x8915],
- ["E7CA",0x8916],
- ["E7C6",0x8917],
- ["E7C7",0x8918],
- ["E7C8",0x8919],
- ["BB75",0x891A],
- ["EB70",0x891E],
- ["EB7C",0x891F],
- ["BFCA",0x8921],
- ["EB77",0x8922],
- ["EB79",0x8923],
- ["BFC8",0x8925],
- ["EB71",0x8926],
- ["EB75",0x8927],
- ["EB78",0x8929],
- ["BFC6",0x892A],
- ["BFC9",0x892B],
- ["EB7B",0x892C],
- ["EB73",0x892D],
- ["EB74",0x892E],
- ["EB7A",0x892F],
- ["EB72",0x8930],
- ["EB76",0x8931],
- ["BFC7",0x8932],
- ["EE72",0x8933],
- ["EE71",0x8935],
- ["C1B7",0x8936],
- ["EE77",0x8937],
- ["C1B9",0x8938],
- ["C1B6",0x893B],
- ["EE73",0x893C],
- ["C1BA",0x893D],
- ["EE74",0x893E],
- ["EE75",0x8941],
- ["EE78",0x8942],
- ["C1B8",0x8944],
- ["F0D6",0x8946],
- ["F0D9",0x8949],
- ["F0D3",0x894B],
- ["F0D5",0x894C],
- ["F0D4",0x894F],
- ["F0D7",0x8950],
- ["F0D8",0x8951],
- ["EE76",0x8952],
- ["F0D2",0x8953],
- ["C3CD",0x8956],
- ["F2EC",0x8957],
- ["F2EF",0x8958],
- ["F2F1",0x8959],
- ["F2EA",0x895A],
- ["F2EB",0x895B],
- ["F2EE",0x895C],
- ["F2F0",0x895D],
- ["C3CE",0x895E],
- ["C3CC",0x895F],
- ["C3CB",0x8960],
- ["F2ED",0x8961],
- ["F2E9",0x8962],
- ["F4CA",0x8963],
- ["C4B0",0x8964],
- ["F4CB",0x8966],
- ["F649",0x8969],
- ["C4FB",0x896A],
- ["F64B",0x896B],
- ["C4FC",0x896C],
- ["F648",0x896D],
- ["F64A",0x896E],
- ["C5A8",0x896F],
- ["F752",0x8971],
- ["C5A7",0x8972],
- ["F7FD",0x8973],
- ["F7FC",0x8974],
- ["F7FB",0x8976],
- ["F948",0x8979],
- ["F949",0x897A],
- ["F94B",0x897B],
- ["F94A",0x897C],
- ["CA50",0x897E],
- ["A6E8",0x897F],
- ["AD6E",0x8981],
- ["D7C5",0x8982],
- ["B5F7",0x8983],
- ["DFFA",0x8985],
- ["C2D0",0x8986],
- ["F2F2",0x8988],
- ["A8A3",0x898B],
- ["B357",0x898F],
- ["B356",0x8993],
- ["DBD0",0x8995],
- ["B5F8",0x8996],
- ["DBD2",0x8997],
- ["DBD1",0x8998],
- ["DFFB",0x899B],
- ["B8D0",0x899C],
- ["E443",0x899D],
- ["E446",0x899E],
- ["E445",0x899F],
- ["E444",0x89A1],
- ["E7CE",0x89A2],
- ["E7D0",0x89A3],
- ["E7CF",0x89A4],
- ["BFCC",0x89A6],
- ["BFCB",0x89AA],
- ["C1BB",0x89AC],
- ["EE79",0x89AD],
- ["EE7B",0x89AE],
- ["EE7A",0x89AF],
- ["C2D1",0x89B2],
- ["F2F4",0x89B6],
- ["F2F3",0x89B7],
- ["F4CC",0x89B9],
- ["C4B1",0x89BA],
- ["C4FD",0x89BD],
- ["F754",0x89BE],
- ["F753",0x89BF],
- ["C65B",0x89C0],
- ["A8A4",0x89D2],
- ["D0AF",0x89D3],
- ["AD6F",0x89D4],
- ["D7C8",0x89D5],
- ["D7C6",0x89D6],
- ["D7C7",0x89D9],
- ["DBD4",0x89DA],
- ["DBD5",0x89DB],
- ["E043",0x89DC],
- ["DBD3",0x89DD],
- ["DFFC",0x89DF],
- ["E041",0x89E0],
- ["E040",0x89E1],
- ["E042",0x89E2],
- ["B8D1",0x89E3],
- ["DFFE",0x89E4],
- ["DFFD",0x89E5],
- ["E044",0x89E6],
- ["E449",0x89E8],
- ["E447",0x89E9],
- ["E448",0x89EB],
- ["E7D3",0x89EC],
- ["E7D1",0x89ED],
- ["E7D2",0x89F0],
- ["EB7D",0x89F1],
- ["EE7C",0x89F2],
- ["EE7D",0x89F3],
- ["C2D2",0x89F4],
- ["F2F5",0x89F6],
- ["F4CD",0x89F7],
- ["C4B2",0x89F8],
- ["F64C",0x89FA],
- ["F755",0x89FB],
- ["C5A9",0x89FC],
- ["F7FE",0x89FE],
- ["F94C",0x89FF],
- ["A8A5",0x8A00],
- ["AD71",0x8A02],
- ["AD72",0x8A03],
- ["D0B0",0x8A04],
- ["D0B1",0x8A07],
- ["AD70",0x8A08],
- ["B054",0x8A0A],
- ["B052",0x8A0C],
- ["B051",0x8A0E],
- ["B058",0x8A0F],
- ["B050",0x8A10],
- ["B059",0x8A11],
- ["D3DD",0x8A12],
- ["B056",0x8A13],
- ["B053",0x8A15],
- ["B057",0x8A16],
- ["B055",0x8A17],
- ["B04F",0x8A18],
- ["B35F",0x8A1B],
- ["B359",0x8A1D],
- ["D7CC",0x8A1E],
- ["B35E",0x8A1F],
- ["B360",0x8A22],
- ["B35A",0x8A23],
- ["B35B",0x8A25],
- ["D7CA",0x8A27],
- ["B358",0x8A2A],
- ["D7CB",0x8A2C],
- ["B35D",0x8A2D],
- ["D7C9",0x8A30],
- ["B35C",0x8A31],
- ["B644",0x8A34],
- ["B646",0x8A36],
- ["DBD8",0x8A39],
- ["B645",0x8A3A],
- ["B5F9",0x8A3B],
- ["B5FD",0x8A3C],
- ["B8E4",0x8A3E],
- ["E049",0x8A3F],
- ["DBDA",0x8A40],
- ["B5FE",0x8A41],
- ["DBDD",0x8A44],
- ["DBDE",0x8A45],
- ["B643",0x8A46],
- ["DBE0",0x8A48],
- ["DBE2",0x8A4A],
- ["DBE3",0x8A4C],
- ["DBD7",0x8A4D],
- ["DBD6",0x8A4E],
- ["DBE4",0x8A4F],
- ["B642",0x8A50],
- ["DBE1",0x8A51],
- ["DBDF",0x8A52],
- ["B640",0x8A54],
- ["B5FB",0x8A55],
- ["B647",0x8A56],
- ["DBDB",0x8A57],
- ["DBDC",0x8A58],
- ["DBD9",0x8A59],
- ["B641",0x8A5B],
- ["B5FC",0x8A5E],
- ["B5FA",0x8A60],
- ["E048",0x8A61],
- ["B8DF",0x8A62],
- ["B8DA",0x8A63],
- ["B8D5",0x8A66],
- ["B8E5",0x8A68],
- ["B8D6",0x8A69],
- ["B8D2",0x8A6B],
- ["B8E1",0x8A6C],
- ["B8DE",0x8A6D],
- ["B8E0",0x8A6E],
- ["B8D7",0x8A70],
- ["B8DC",0x8A71],
- ["B8D3",0x8A72],
- ["B8D4",0x8A73],
- ["E050",0x8A74],
- ["E04D",0x8A75],
- ["E045",0x8A76],
- ["E04A",0x8A77],
- ["B8E2",0x8A79],
- ["E051",0x8A7A],
- ["B8E3",0x8A7B],
- ["B8D9",0x8A7C],
- ["E047",0x8A7F],
- ["E04F",0x8A81],
- ["E04B",0x8A82],
- ["E04E",0x8A83],
- ["E04C",0x8A84],
- ["B8DD",0x8A85],
- ["E046",0x8A86],
- ["B8D8",0x8A87],
- ["E44C",0x8A8B],
- ["BB78",0x8A8C],
- ["BB7B",0x8A8D],
- ["E44E",0x8A8F],
- ["BBA5",0x8A91],
- ["E44D",0x8A92],
- ["BB7D",0x8A93],
- ["BDCF",0x8A95],
- ["E44F",0x8A96],
- ["BBA4",0x8A98],
- ["E44B",0x8A99],
- ["BBA6",0x8A9A],
- ["BB79",0x8A9E],
- ["B8DB",0x8AA0],
- ["BB7C",0x8AA1],
- ["BB7A",0x8AA3],
- ["BB7E",0x8AA4],
- ["BBA2",0x8AA5],
- ["BB77",0x8AA6],
- ["BBA7",0x8AA7],
- ["BBA3",0x8AA8],
- ["BBA1",0x8AAA],
- ["E44A",0x8AAB],
- ["BDD6",0x8AB0],
- ["BDD2",0x8AB2],
- ["BDD9",0x8AB6],
- ["E7D6",0x8AB8],
- ["BDDA",0x8AB9],
- ["E7E2",0x8ABA],
- ["E7DB",0x8ABB],
- ["BDCB",0x8ABC],
- ["E7E3",0x8ABD],
- ["E7DD",0x8ABE],
- ["BDD5",0x8ABF],
- ["E7DE",0x8AC0],
- ["BDD4",0x8AC2],
- ["E7E1",0x8AC3],
- ["BDCE",0x8AC4],
- ["E7DF",0x8AC5],
- ["E7D5",0x8AC6],
- ["BDCD",0x8AC7],
- ["EBAA",0x8AC8],
- ["BDD3",0x8AC9],
- ["BDD0",0x8ACB],
- ["BDD8",0x8ACD],
- ["E7D4",0x8ACF],
- ["E7D8",0x8AD1],
- ["BDCC",0x8AD2],
- ["E7D7",0x8AD3],
- ["E7D9",0x8AD4],
- ["E7DA",0x8AD5],
- ["BDD7",0x8AD6],
- ["E7DC",0x8AD7],
- ["E7E0",0x8AD8],
- ["E7E4",0x8AD9],
- ["BDDB",0x8ADB],
- ["BFD2",0x8ADC],
- ["EBA5",0x8ADD],
- ["EBAB",0x8ADE],
- ["EBA8",0x8ADF],
- ["EB7E",0x8AE0],
- ["EBAC",0x8AE1],
- ["EBA1",0x8AE2],
- ["EBA7",0x8AE4],
- ["BFCD",0x8AE6],
- ["BFD3",0x8AE7],
- ["EBAD",0x8AE8],
- ["BFCF",0x8AEB],
- ["BFD9",0x8AED],
- ["BFD4",0x8AEE],
- ["EBAF",0x8AEF],
- ["EBA9",0x8AF0],
- ["BFD0",0x8AF1],
- ["EBA2",0x8AF2],
- ["BFDA",0x8AF3],
- ["EBA3",0x8AF4],
- ["EBA4",0x8AF5],
- ["BFDB",0x8AF6],
- ["BFD8",0x8AF7],
- ["BDD1",0x8AF8],
- ["BFCE",0x8AFA],
- ["EBB0",0x8AFB],
- ["BFDC",0x8AFC],
- ["BFD5",0x8AFE],
- ["EBAE",0x8AFF],
- ["BFD1",0x8B00],
- ["BFD6",0x8B01],
- ["BFD7",0x8B02],
- ["C1C3",0x8B04],
- ["EEA4",0x8B05],
- ["EEAD",0x8B06],
- ["EEAA",0x8B07],
- ["EEAC",0x8B08],
- ["C1C0",0x8B0A],
- ["EEA5",0x8B0B],
- ["EEAB",0x8B0D],
- ["C1BC",0x8B0E],
- ["EEA7",0x8B0F],
- ["C1C4",0x8B10],
- ["EEA3",0x8B11],
- ["EEA8",0x8B12],
- ["EEAF",0x8B13],
- ["EBA6",0x8B14],
- ["EEA9",0x8B15],
- ["EEA2",0x8B16],
- ["C1BD",0x8B17],
- ["EEA1",0x8B18],
- ["C1BE",0x8B19],
- ["EEB0",0x8B1A],
- ["C1BF",0x8B1B],
- ["EEAE",0x8B1C],
- ["C1C2",0x8B1D],
- ["EE7E",0x8B1E],
- ["C1C1",0x8B20],
- ["EEA6",0x8B22],
- ["F0DC",0x8B23],
- ["F0EA",0x8B24],
- ["F0E5",0x8B25],
- ["F0E7",0x8B26],
- ["F0DB",0x8B27],
- ["C2D3",0x8B28],
- ["F0DA",0x8B2A],
- ["C2D6",0x8B2B],
- ["C2D5",0x8B2C],
- ["F0E9",0x8B2E],
- ["F0E1",0x8B2F],
- ["F0DE",0x8B30],
- ["F0E4",0x8B31],
- ["F0DD",0x8B33],
- ["F0DF",0x8B35],
- ["F0E8",0x8B36],
- ["F0E6",0x8B37],
- ["C2D4",0x8B39],
- ["F0ED",0x8B3A],
- ["F0EB",0x8B3B],
- ["F0E2",0x8B3C],
- ["F0EC",0x8B3D],
- ["F0E3",0x8B3E],
- ["F2F9",0x8B40],
- ["C3CF",0x8B41],
- ["F341",0x8B42],
- ["F64F",0x8B45],
- ["C3D6",0x8B46],
- ["F0E0",0x8B47],
- ["F2F7",0x8B48],
- ["C3D2",0x8B49],
- ["F2F8",0x8B4A],
- ["F2FD",0x8B4B],
- ["C3D4",0x8B4E],
- ["C3D5",0x8B4F],
- ["F2F6",0x8B50],
- ["F340",0x8B51],
- ["F342",0x8B52],
- ["F2FA",0x8B53],
- ["F2FC",0x8B54],
- ["F2FE",0x8B55],
- ["F2FB",0x8B56],
- ["F343",0x8B57],
- ["C3D1",0x8B58],
- ["C3D7",0x8B59],
- ["C3D3",0x8B5A],
- ["C3D0",0x8B5C],
- ["F4D0",0x8B5D],
- ["C4B7",0x8B5F],
- ["F4CE",0x8B60],
- ["F4D2",0x8B63],
- ["F4D3",0x8B65],
- ["C4B5",0x8B66],
- ["F4D4",0x8B67],
- ["F4D1",0x8B68],
- ["F4CF",0x8B6A],
- ["C4B8",0x8B6B],
- ["C4B4",0x8B6C],
- ["F4D5",0x8B6D],
- ["C4B6",0x8B6F],
- ["C4B3",0x8B70],
- ["C4FE",0x8B74],
- ["C540",0x8B77],
- ["F64E",0x8B78],
- ["F64D",0x8B79],
- ["F650",0x8B7A],
- ["F651",0x8B7B],
- ["C541",0x8B7D],
- ["F756",0x8B7E],
- ["F75B",0x8B7F],
- ["C5AA",0x8B80],
- ["F758",0x8B82],
- ["F757",0x8B84],
- ["F75A",0x8B85],
- ["F759",0x8B86],
- ["F843",0x8B88],
- ["C5DC",0x8B8A],
- ["F842",0x8B8B],
- ["F840",0x8B8C],
- ["F841",0x8B8E],
- ["C5FE",0x8B92],
- ["C5FD",0x8B93],
- ["F8C1",0x8B94],
- ["F8C2",0x8B95],
- ["C640",0x8B96],
- ["F94D",0x8B98],
- ["F94E",0x8B99],
- ["C667",0x8B9A],
- ["C66D",0x8B9C],
- ["F9A9",0x8B9E],
- ["F9C8",0x8B9F],
- ["A8A6",0x8C37],
- ["D7CD",0x8C39],
- ["D7CE",0x8C3B],
- ["E052",0x8C3C],
- ["E450",0x8C3D],
- ["E7E5",0x8C3E],
- ["C1C6",0x8C3F],
- ["C1C5",0x8C41],
- ["F0EE",0x8C42],
- ["F344",0x8C43],
- ["F844",0x8C45],
- ["A8A7",0x8C46],
- ["D3DE",0x8C47],
- ["B05A",0x8C48],
- ["B361",0x8C49],
- ["E054",0x8C4A],
- ["E053",0x8C4B],
- ["BDDC",0x8C4C],
- ["E7E6",0x8C4D],
- ["BDDD",0x8C4E],
- ["EEB1",0x8C4F],
- ["C2D7",0x8C50],
- ["C676",0x8C54],
- ["A8A8",0x8C55],
- ["CDCB",0x8C56],
- ["D3DF",0x8C57],
- ["B362",0x8C5A],
- ["D7CF",0x8C5C],
- ["D7D0",0x8C5D],
- ["DBE5",0x8C5F],
- ["B648",0x8C61],
- ["B8E6",0x8C62],
- ["E056",0x8C64],
- ["E055",0x8C65],
- ["E057",0x8C66],
- ["E451",0x8C68],
- ["E452",0x8C69],
- ["BBA8",0x8C6A],
- ["BFDD",0x8C6B],
- ["BDDE",0x8C6C],
- ["BFDE",0x8C6D],
- ["EEB5",0x8C6F],
- ["EEB2",0x8C70],
- ["EEB4",0x8C71],
- ["EEB3",0x8C72],
- ["C1C7",0x8C73],
- ["F0EF",0x8C75],
- ["F346",0x8C76],
- ["F345",0x8C77],
- ["CBA4",0x8C78],
- ["B05C",0x8C79],
- ["B05B",0x8C7A],
- ["D3E0",0x8C7B],
- ["D7D1",0x8C7D],
- ["DBE7",0x8C80],
- ["DBE6",0x8C81],
- ["B649",0x8C82],
- ["E059",0x8C84],
- ["E05A",0x8C85],
- ["E058",0x8C86],
- ["B8E8",0x8C89],
- ["B8E7",0x8C8A],
- ["BBAA",0x8C8C],
- ["BBA9",0x8C8D],
- ["E7E7",0x8C8F],
- ["EBB3",0x8C90],
- ["EBB1",0x8C91],
- ["EBB2",0x8C92],
- ["BFDF",0x8C93],
- ["EEB7",0x8C94],
- ["EEB6",0x8C95],
- ["F0F2",0x8C97],
- ["F0F1",0x8C98],
- ["F0F0",0x8C99],
- ["F347",0x8C9A],
- ["F9AA",0x8C9C],
- ["A8A9",0x8C9D],
- ["AD73",0x8C9E],
- ["AD74",0x8CA0],
- ["B05D",0x8CA1],
- ["B05E",0x8CA2],
- ["D3E2",0x8CA3],
- ["D3E1",0x8CA4],
- ["D7D2",0x8CA5],
- ["B368",0x8CA7],
- ["B366",0x8CA8],
- ["B363",0x8CA9],
- ["B367",0x8CAA],
- ["B365",0x8CAB],
- ["B364",0x8CAC],
- ["B64A",0x8CAF],
- ["DBEA",0x8CB0],
- ["B8ED",0x8CB2],
- ["B64C",0x8CB3],
- ["B651",0x8CB4],
- ["DBEC",0x8CB5],
- ["B653",0x8CB6],
- ["B652",0x8CB7],
- ["B655",0x8CB8],
- ["DBEB",0x8CB9],
- ["DBE8",0x8CBA],
- ["B64F",0x8CBB],
- ["B64B",0x8CBC],
- ["B64D",0x8CBD],
- ["DBE9",0x8CBE],
- ["B654",0x8CBF],
- ["B650",0x8CC0],
- ["B64E",0x8CC1],
- ["B8EF",0x8CC2],
- ["B8EE",0x8CC3],
- ["B8EC",0x8CC4],
- ["B8F0",0x8CC5],
- ["B8EA",0x8CC7],
- ["B8EB",0x8CC8],
- ["B8E9",0x8CCA],
- ["E05B",0x8CCC],
- ["E454",0x8CCF],
- ["BBAC",0x8CD1],
- ["BBAD",0x8CD2],
- ["BBAB",0x8CD3],
- ["E453",0x8CD5],
- ["E455",0x8CD7],
- ["E7EA",0x8CD9],
- ["E7EC",0x8CDA],
- ["BDE7",0x8CDC],
- ["E7ED",0x8CDD],
- ["BDE0",0x8CDE],
- ["E7E9",0x8CDF],
- ["BDDF",0x8CE0],
- ["BDE9",0x8CE1],
- ["BDE5",0x8CE2],
- ["BDE6",0x8CE3],
- ["BDE2",0x8CE4],
- ["E7E8",0x8CE5],
- ["BDE1",0x8CE6],
- ["E7EE",0x8CE7],
- ["E7EB",0x8CE8],
- ["BDE8",0x8CEA],
- ["BDE3",0x8CEC],
- ["BDE4",0x8CED],
- ["EBB5",0x8CEE],
- ["EBB7",0x8CF0],
- ["EBB6",0x8CF1],
- ["EBB8",0x8CF3],
- ["BFE0",0x8CF4],
- ["EBB4",0x8CF5],
- ["C1CB",0x8CF8],
- ["EEB8",0x8CF9],
- ["C1C8",0x8CFA],
- ["C1CC",0x8CFB],
- ["C1CA",0x8CFC],
- ["C1C9",0x8CFD],
- ["F0F3",0x8CFE],
- ["F0F6",0x8D00],
- ["F0F5",0x8D02],
- ["F0F4",0x8D04],
- ["C2D8",0x8D05],
- ["F348",0x8D06],
- ["F349",0x8D07],
- ["C3D8",0x8D08],
- ["F34A",0x8D09],
- ["C3D9",0x8D0A],
- ["C4BA",0x8D0D],
- ["C4B9",0x8D0F],
- ["F652",0x8D10],
- ["C542",0x8D13],
- ["F653",0x8D14],
- ["F75C",0x8D15],
- ["C5AB",0x8D16],
- ["C5AC",0x8D17],
- ["F845",0x8D19],
- ["C642",0x8D1B],
- ["A8AA",0x8D64],
- ["B36A",0x8D66],
- ["B369",0x8D67],
- ["E05C",0x8D68],
- ["E05D",0x8D69],
- ["BBAE",0x8D6B],
- ["EBB9",0x8D6C],
- ["BDEA",0x8D6D],
- ["EBBA",0x8D6E],
- ["EEB9",0x8D6F],
- ["A8AB",0x8D70],
- ["D0B2",0x8D72],
- ["AD76",0x8D73],
- ["AD75",0x8D74],
- ["D3E3",0x8D76],
- ["B05F",0x8D77],
- ["D3E4",0x8D78],
- ["D7D5",0x8D79],
- ["D7D4",0x8D7B],
- ["D7D3",0x8D7D],
- ["DBEE",0x8D80],
- ["B658",0x8D81],
- ["DBED",0x8D84],
- ["B657",0x8D85],
- ["DBEF",0x8D89],
- ["B656",0x8D8A],
- ["E05F",0x8D8C],
- ["E062",0x8D8D],
- ["E060",0x8D8E],
- ["E061",0x8D8F],
- ["E065",0x8D90],
- ["E05E",0x8D91],
- ["E066",0x8D92],
- ["E063",0x8D93],
- ["E064",0x8D94],
- ["BBB0",0x8D95],
- ["E456",0x8D96],
- ["BBAF",0x8D99],
- ["E7F2",0x8D9B],
- ["E7F0",0x8D9C],
- ["BDEB",0x8D9F],
- ["E7EF",0x8DA0],
- ["E7F1",0x8DA1],
- ["BDEC",0x8DA3],
- ["EBBB",0x8DA5],
- ["EBBC",0x8DA7],
- ["C1CD",0x8DA8],
- ["F34C",0x8DAA],
- ["F34E",0x8DAB],
- ["F34B",0x8DAC],
- ["F34D",0x8DAD],
- ["F4D6",0x8DAE],
- ["F654",0x8DAF],
- ["F96F",0x8DB2],
- ["A8AC",0x8DB3],
- ["AD77",0x8DB4],
- ["D3E5",0x8DB5],
- ["D3E7",0x8DB6],
- ["D3E6",0x8DB7],
- ["D7D8",0x8DB9],
- ["B36C",0x8DBA],
- ["D7D6",0x8DBC],
- ["B36B",0x8DBE],
- ["D7D9",0x8DBF],
- ["D7DA",0x8DC1],
- ["D7D7",0x8DC2],
- ["DBFB",0x8DC5],
- ["B660",0x8DC6],
- ["DBF3",0x8DC7],
- ["DBF9",0x8DC8],
- ["B65B",0x8DCB],
- ["B65E",0x8DCC],
- ["DBF2",0x8DCD],
- ["B659",0x8DCE],
- ["DBF6",0x8DCF],
- ["E06C",0x8DD0],
- ["B65D",0x8DD1],
- ["DBF1",0x8DD3],
- ["DBF7",0x8DD5],
- ["DBF4",0x8DD6],
- ["DBFA",0x8DD7],
- ["DBF0",0x8DD8],
- ["DBF8",0x8DD9],
- ["B65C",0x8DDA],
- ["B65F",0x8DDB],
- ["DBF5",0x8DDC],
- ["B65A",0x8DDD],
- ["B8F2",0x8DDF],
- ["E068",0x8DE0],
- ["B8F1",0x8DE1],
- ["E06F",0x8DE2],
- ["E06E",0x8DE3],
- ["B8F8",0x8DE4],
- ["B8F9",0x8DE6],
- ["E070",0x8DE7],
- ["B8F3",0x8DE8],
- ["E06D",0x8DE9],
- ["B8F7",0x8DEA],
- ["E072",0x8DEB],
- ["E069",0x8DEC],
- ["E06B",0x8DEE],
- ["B8F4",0x8DEF],
- ["E067",0x8DF0],
- ["E06A",0x8DF1],
- ["E071",0x8DF2],
- ["B8F5",0x8DF3],
- ["E073",0x8DF4],
- ["B8F6",0x8DFA],
- ["BBB1",0x8DFC],
- ["E45B",0x8DFD],
- ["E461",0x8DFE],
- ["E459",0x8DFF],
- ["E462",0x8E00],
- ["E458",0x8E02],
- ["E45D",0x8E03],
- ["E463",0x8E04],
- ["E460",0x8E05],
- ["E45F",0x8E06],
- ["E45E",0x8E07],
- ["E457",0x8E09],
- ["E45C",0x8E0A],
- ["E45A",0x8E0D],
- ["BDF1",0x8E0F],
- ["BDEE",0x8E10],
- ["E7FB",0x8E11],
- ["E841",0x8E12],
- ["E843",0x8E13],
- ["E840",0x8E14],
- ["E7F8",0x8E15],
- ["E7FA",0x8E16],
- ["E845",0x8E17],
- ["E842",0x8E18],
- ["E7FC",0x8E19],
- ["E846",0x8E1A],
- ["E7F9",0x8E1B],
- ["E844",0x8E1C],
- ["BDEF",0x8E1D],
- ["BDF5",0x8E1E],
- ["BDF3",0x8E1F],
- ["E7F3",0x8E20],
- ["BDF4",0x8E21],
- ["BDF0",0x8E22],
- ["E7F4",0x8E23],
- ["E7F6",0x8E24],
- ["E7F5",0x8E25],
- ["E7FD",0x8E26],
- ["E7FE",0x8E27],
- ["BDF2",0x8E29],
- ["BDED",0x8E2B],
- ["E7F7",0x8E2E],
- ["EBC6",0x8E30],
- ["BFE2",0x8E31],
- ["EBBD",0x8E33],
- ["BFE3",0x8E34],
- ["BFE6",0x8E35],
- ["EBC2",0x8E36],
- ["EBBF",0x8E38],
- ["BFE5",0x8E39],
- ["EBC3",0x8E3C],
- ["EBC4",0x8E3D],
- ["EBBE",0x8E3E],
- ["EBC7",0x8E3F],
- ["EBC0",0x8E40],
- ["EBC5",0x8E41],
- ["BFE4",0x8E42],
- ["BFE1",0x8E44],
- ["EBC1",0x8E45],
- ["EEBF",0x8E47],
- ["C1D0",0x8E48],
- ["C1CE",0x8E49],
- ["C1D1",0x8E4A],
- ["C1CF",0x8E4B],
- ["EEBE",0x8E4C],
- ["EEBB",0x8E4D],
- ["EEBA",0x8E4E],
- ["EEBD",0x8E50],
- ["EEBC",0x8E53],
- ["F145",0x8E54],
- ["C2DE",0x8E55],
- ["F0FB",0x8E56],
- ["F0FA",0x8E57],
- ["C2D9",0x8E59],
- ["F141",0x8E5A],
- ["F140",0x8E5B],
- ["F0F7",0x8E5C],
- ["F143",0x8E5D],
- ["F0FC",0x8E5E],
- ["C2DD",0x8E5F],
- ["F0F9",0x8E60],
- ["F142",0x8E61],
- ["F0F8",0x8E62],
- ["C2DA",0x8E63],
- ["C2DC",0x8E64],
- ["F0FD",0x8E65],
- ["C2DB",0x8E66],
- ["F0FE",0x8E67],
- ["F144",0x8E69],
- ["F352",0x8E6A],
- ["C3DE",0x8E6C],
- ["F34F",0x8E6D],
- ["F353",0x8E6F],
- ["C3DB",0x8E72],
- ["F351",0x8E73],
- ["C3E0",0x8E74],
- ["C3DD",0x8E76],
- ["F350",0x8E78],
- ["C3DF",0x8E7A],
- ["F354",0x8E7B],
- ["C3DA",0x8E7C],
- ["C4BC",0x8E81],
- ["C4BE",0x8E82],
- ["F4D9",0x8E84],
- ["C4BD",0x8E85],
- ["F4D7",0x8E86],
- ["C3DC",0x8E87],
- ["F4D8",0x8E88],
- ["C4BB",0x8E89],
- ["C543",0x8E8A],
- ["C545",0x8E8B],
- ["F656",0x8E8C],
- ["C544",0x8E8D],
- ["F655",0x8E8E],
- ["F761",0x8E90],
- ["C5AD",0x8E91],
- ["F760",0x8E92],
- ["C5AE",0x8E93],
- ["F75E",0x8E94],
- ["F75D",0x8E95],
- ["F762",0x8E96],
- ["F763",0x8E97],
- ["F846",0x8E98],
- ["F75F",0x8E9A],
- ["F8C6",0x8E9D],
- ["F8C3",0x8E9E],
- ["F8C4",0x8E9F],
- ["F8C5",0x8EA0],
- ["C65C",0x8EA1],
- ["F951",0x8EA3],
- ["F950",0x8EA4],
- ["F94F",0x8EA5],
- ["F970",0x8EA6],
- ["F9BE",0x8EA8],
- ["F9AB",0x8EA9],
- ["C66E",0x8EAA],
- ["A8AD",0x8EAB],
- ["B060",0x8EAC],
- ["B8FA",0x8EB2],
- ["BDF6",0x8EBA],
- ["EBC8",0x8EBD],
- ["C2DF",0x8EC0],
- ["F355",0x8EC2],
- ["F9AC",0x8EC9],
- ["A8AE",0x8ECA],
- ["AAEE",0x8ECB],
- ["AD79",0x8ECC],
- ["AD78",0x8ECD],
- ["B063",0x8ECF],
- ["D3E8",0x8ED1],
- ["B061",0x8ED2],
- ["D3E9",0x8ED3],
- ["B062",0x8ED4],
- ["D7DF",0x8ED7],
- ["D7DB",0x8ED8],
- ["B36D",0x8EDB],
- ["D7DE",0x8EDC],
- ["D7DD",0x8EDD],
- ["D7DC",0x8EDE],
- ["B36E",0x8EDF],
- ["D7E0",0x8EE0],
- ["D7E1",0x8EE1],
- ["DC43",0x8EE5],
- ["DC41",0x8EE6],
- ["DC45",0x8EE7],
- ["DC46",0x8EE8],
- ["DC4C",0x8EE9],
- ["DC48",0x8EEB],
- ["DC4A",0x8EEC],
- ["DC42",0x8EEE],
- ["DBFC",0x8EEF],
- ["DC49",0x8EF1],
- ["DC4B",0x8EF4],
- ["DC44",0x8EF5],
- ["DC47",0x8EF6],
- ["DBFD",0x8EF7],
- ["B662",0x8EF8],
- ["DC40",0x8EF9],
- ["DBFE",0x8EFA],
- ["B661",0x8EFB],
- ["B663",0x8EFC],
- ["B8FD",0x8EFE],
- ["E075",0x8EFF],
- ["E077",0x8F00],
- ["E076",0x8F01],
- ["E07B",0x8F02],
- ["B8FB",0x8F03],
- ["E078",0x8F05],
- ["E074",0x8F06],
- ["E079",0x8F07],
- ["E07A",0x8F08],
- ["B8FC",0x8F09],
- ["B8FE",0x8F0A],
- ["E07C",0x8F0B],
- ["E467",0x8F0D],
- ["E466",0x8F0E],
- ["E464",0x8F10],
- ["E465",0x8F11],
- ["BBB3",0x8F12],
- ["BBB5",0x8F13],
- ["BBB2",0x8F14],
- ["BBB4",0x8F15],
- ["E84D",0x8F16],
- ["E84E",0x8F17],
- ["E849",0x8F18],
- ["E84A",0x8F1A],
- ["BDF8",0x8F1B],
- ["BDFD",0x8F1C],
- ["BDF7",0x8F1D],
- ["BDFE",0x8F1E],
- ["BDF9",0x8F1F],
- ["E84B",0x8F20],
- ["E84C",0x8F23],
- ["E848",0x8F24],
- ["BE40",0x8F25],
- ["BDFB",0x8F26],
- ["BDFA",0x8F29],
- ["BDFC",0x8F2A],
- ["E847",0x8F2C],
- ["EBCA",0x8F2E],
- ["BFE8",0x8F2F],
- ["EBCC",0x8F32],
- ["BFEA",0x8F33],
- ["EBCF",0x8F34],
- ["EBCB",0x8F35],
- ["EBC9",0x8F36],
- ["EBCE",0x8F37],
- ["BFE9",0x8F38],
- ["EBCD",0x8F39],
- ["BFE7",0x8F3B],
- ["C1D3",0x8F3E],
- ["C1D6",0x8F3F],
- ["EEC1",0x8F40],
- ["C1D4",0x8F42],
- ["EEC0",0x8F43],
- ["C1D2",0x8F44],
- ["C1D5",0x8F45],
- ["F146",0x8F46],
- ["F147",0x8F47],
- ["F148",0x8F48],
- ["C2E0",0x8F49],
- ["F149",0x8F4B],
- ["C2E1",0x8F4D],
- ["C3E2",0x8F4E],
- ["F358",0x8F4F],
- ["F359",0x8F50],
- ["F357",0x8F51],
- ["F356",0x8F52],
- ["F35A",0x8F53],
- ["C3E1",0x8F54],
- ["F4DD",0x8F55],
- ["F4DB",0x8F56],
- ["F4DC",0x8F57],
- ["F4DE",0x8F58],
- ["F4DA",0x8F59],
- ["F4DF",0x8F5A],
- ["F658",0x8F5B],
- ["F659",0x8F5D],
- ["F657",0x8F5E],
- ["C546",0x8F5F],
- ["F764",0x8F60],
- ["C5AF",0x8F61],
- ["F765",0x8F62],
- ["F848",0x8F63],
- ["F847",0x8F64],
- ["A8AF",0x8F9B],
- ["B664",0x8F9C],
- ["B940",0x8F9F],
- ["BBB6",0x8FA3],
- ["BFEC",0x8FA6],
- ["BFEB",0x8FA8],
- ["C3E3",0x8FAD],
- ["C47C",0x8FAE],
- ["C547",0x8FAF],
- ["A8B0",0x8FB0],
- ["B064",0x8FB1],
- ["B941",0x8FB2],
- ["F35B",0x8FB4],
- ["CBA6",0x8FBF],
- ["A8B1",0x8FC2],
- ["A8B4",0x8FC4],
- ["A8B3",0x8FC5],
- ["A8B2",0x8FC6],
- ["CBA5",0x8FC9],
- ["CDCD",0x8FCB],
- ["CDCF",0x8FCD],
- ["AAEF",0x8FCE],
- ["AAF1",0x8FD1],
- ["CDCC",0x8FD2],
- ["CDCE",0x8FD3],
- ["AAF0",0x8FD4],
- ["CDD1",0x8FD5],
- ["CDD0",0x8FD6],
- ["CDD2",0x8FD7],
- ["D0B6",0x8FE0],
- ["D0B4",0x8FE1],
- ["AD7C",0x8FE2],
- ["D0B3",0x8FE3],
- ["ADA3",0x8FE4],
- ["AD7E",0x8FE5],
- ["AD7B",0x8FE6],
- ["ADA4",0x8FE8],
- ["AD7D",0x8FEA],
- ["ADA2",0x8FEB],
- ["ADA1",0x8FED],
- ["D0B5",0x8FEE],
- ["AD7A",0x8FF0],
- ["B06A",0x8FF4],
- ["D3EB",0x8FF5],
- ["D3F1",0x8FF6],
- ["B067",0x8FF7],
- ["B06E",0x8FF8],
- ["B069",0x8FFA],
- ["D3EE",0x8FFB],
- ["D3F0",0x8FFC],
- ["B06C",0x8FFD],
- ["D3EA",0x8FFE],
- ["D3ED",0x8FFF],
- ["B068",0x9000],
- ["B065",0x9001],
- ["D3EC",0x9002],
- ["B06B",0x9003],
- ["D3EF",0x9004],
- ["B06D",0x9005],
- ["B066",0x9006],
- ["D7E3",0x900B],
- ["D7E6",0x900C],
- ["B370",0x900D],
- ["B37A",0x900F],
- ["B376",0x9010],
- ["D7E4",0x9011],
- ["B37E",0x9014],
- ["B377",0x9015],
- ["B37C",0x9016],
- ["B372",0x9017],
- ["B36F",0x9019],
- ["B371",0x901A],
- ["B37D",0x901B],
- ["D7E5",0x901C],
- ["B375",0x901D],
- ["B378",0x901E],
- ["B374",0x901F],
- ["B379",0x9020],
- ["D7E7",0x9021],
- ["B37B",0x9022],
- ["B373",0x9023],
- ["D7E2",0x9024],
- ["DC4D",0x902D],
- ["B665",0x902E],
- ["DC4F",0x902F],
- ["B667",0x9031],
- ["B669",0x9032],
- ["DC4E",0x9034],
- ["B666",0x9035],
- ["B66A",0x9036],
- ["B668",0x9038],
- ["B947",0x903C],
- ["E0A3",0x903D],
- ["B94F",0x903E],
- ["E07E",0x903F],
- ["B950",0x9041],
- ["B945",0x9042],
- ["E0A1",0x9044],
- ["B94A",0x9047],
- ["E0A2",0x9049],
- ["B943",0x904A],
- ["B942",0x904B],
- ["B94D",0x904D],
- ["B94C",0x904E],
- ["B94B",0x904F],
- ["B949",0x9050],
- ["B94E",0x9051],
- ["E07D",0x9052],
- ["B944",0x9053],
- ["B946",0x9054],
- ["B948",0x9055],
- ["BBB8",0x9058],
- ["BBBB",0x9059],
- ["BBBF",0x905B],
- ["BBB9",0x905C],
- ["BBBE",0x905D],
- ["BBBC",0x905E],
- ["BBB7",0x9060],
- ["BBBD",0x9062],
- ["BBBA",0x9063],
- ["E852",0x9067],
- ["BE43",0x9068],
- ["BE41",0x9069],
- ["E853",0x906B],
- ["BE44",0x906D],
- ["BE42",0x906E],
- ["E851",0x906F],
- ["E850",0x9070],
- ["BFF0",0x9072],
- ["E84F",0x9073],
- ["BFEE",0x9074],
- ["BFED",0x9075],
- ["EBD0",0x9076],
- ["BE45",0x9077],
- ["BFEF",0x9078],
- ["EBD1",0x9079],
- ["BFF2",0x907A],
- ["EBD2",0x907B],
- ["BFF1",0x907C],
- ["C1D8",0x907D],
- ["EEC3",0x907E],
- ["C1D7",0x907F],
- ["C1DC",0x9080],
- ["C1DA",0x9081],
- ["C1DB",0x9082],
- ["C2E3",0x9083],
- ["C1D9",0x9084],
- ["EEC2",0x9085],
- ["EBD3",0x9086],
- ["C2E2",0x9087],
- ["C2E4",0x9088],
- ["C3E4",0x908A],
- ["C3E5",0x908B],
- ["F4E0",0x908D],
- ["C5DE",0x908F],
- ["C5DD",0x9090],
- ["A8B6",0x9091],
- ["CA55",0x9094],
- ["B06F",0x9095],
- ["CA52",0x9097],
- ["CA53",0x9098],
- ["CA51",0x9099],
- ["CA54",0x909B],
- ["CBAA",0x909E],
- ["CBA7",0x909F],
- ["CBAC",0x90A0],
- ["CBA8",0x90A1],
- ["A8B7",0x90A2],
- ["A8BA",0x90A3],
- ["CBA9",0x90A5],
- ["A8B9",0x90A6],
- ["CBAB",0x90A7],
- ["A8B8",0x90AA],
- ["CDD5",0x90AF],
- ["CDD7",0x90B0],
- ["AAF4",0x90B1],
- ["CDD3",0x90B2],
- ["CDD6",0x90B3],
- ["CDD4",0x90B4],
- ["AAF2",0x90B5],
- ["AAF5",0x90B6],
- ["AAF3",0x90B8],
- ["D0B8",0x90BD],
- ["D0BC",0x90BE],
- ["D0B9",0x90BF],
- ["ADA7",0x90C1],
- ["ADA8",0x90C3],
- ["D0BB",0x90C5],
- ["D0BD",0x90C7],
- ["D0BF",0x90C8],
- ["ADA5",0x90CA],
- ["D0BE",0x90CB],
- ["ADA6",0x90CE],
- ["D7EE",0x90D4],
- ["D0BA",0x90D5],
- ["D3F2",0x90D6],
- ["D3FB",0x90D7],
- ["D3F9",0x90D8],
- ["D3F4",0x90D9],
- ["D3F5",0x90DA],
- ["D3FA",0x90DB],
- ["D3FC",0x90DC],
- ["B071",0x90DD],
- ["D3F7",0x90DF],
- ["D3F3",0x90E0],
- ["B070",0x90E1],
- ["B072",0x90E2],
- ["D3F6",0x90E3],
- ["D3FD",0x90E4],
- ["D3F8",0x90E5],
- ["B3A1",0x90E8],
- ["D7F1",0x90E9],
- ["D7E9",0x90EA],
- ["D7EF",0x90EB],
- ["D7F0",0x90EC],
- ["B3A2",0x90ED],
- ["D7E8",0x90EF],
- ["D7EA",0x90F0],
- ["D0B7",0x90F1],
- ["D7EC",0x90F2],
- ["D7ED",0x90F3],
- ["D7EB",0x90F4],
- ["B66C",0x90F5],
- ["DC56",0x90F9],
- ["EBD4",0x90FA],
- ["DC57",0x90FB],
- ["DC54",0x90FC],
- ["B3A3",0x90FD],
- ["B66E",0x90FE],
- ["DC53",0x90FF],
- ["DC59",0x9100],
- ["DC58",0x9101],
- ["B66B",0x9102],
- ["DC5C",0x9103],
- ["DC52",0x9104],
- ["DC5B",0x9105],
- ["DC50",0x9106],
- ["DC5A",0x9107],
- ["DC55",0x9108],
- ["B66D",0x9109],
- ["E0AA",0x910B],
- ["E0A5",0x910D],
- ["E0AB",0x910E],
- ["E0A6",0x910F],
- ["E0A4",0x9110],
- ["E0A7",0x9111],
- ["B951",0x9112],
- ["E0A9",0x9114],
- ["E0A8",0x9116],
- ["B952",0x9117],
- ["BBC1",0x9118],
- ["BBC0",0x9119],
- ["E46E",0x911A],
- ["E471",0x911B],
- ["E469",0x911C],
- ["E46D",0x911D],
- ["BBC2",0x911E],
- ["E46C",0x911F],
- ["E46A",0x9120],
- ["E470",0x9121],
- ["E46B",0x9122],
- ["E468",0x9123],
- ["E46F",0x9124],
- ["E859",0x9126],
- ["BE48",0x9127],
- ["F14A",0x9128],
- ["E856",0x9129],
- ["E857",0x912A],
- ["E855",0x912B],
- ["DC51",0x912C],
- ["BE47",0x912D],
- ["E85A",0x912E],
- ["E854",0x912F],
- ["BE46",0x9130],
- ["BE49",0x9131],
- ["E858",0x9132],
- ["EBD5",0x9133],
- ["BFF3",0x9134],
- ["EBD6",0x9135],
- ["EBD7",0x9136],
- ["EEC4",0x9138],
- ["C1DD",0x9139],
- ["F14B",0x913A],
- ["F14C",0x913B],
- ["F14D",0x913E],
- ["F35D",0x913F],
- ["F35C",0x9140],
- ["F4E2",0x9141],
- ["F4E1",0x9143],
- ["F65B",0x9144],
- ["F65C",0x9145],
- ["F65A",0x9146],
- ["F766",0x9147],
- ["C5B0",0x9148],
- ["A8BB",0x9149],
- ["ADAA",0x914A],
- ["ADA9",0x914B],
- ["B075",0x914C],
- ["B074",0x914D],
- ["D440",0x914E],
- ["D441",0x914F],
- ["D3FE",0x9150],
- ["B073",0x9152],
- ["D7F5",0x9153],
- ["D7F6",0x9155],
- ["D7F2",0x9156],
- ["B3A4",0x9157],
- ["D7F3",0x9158],
- ["D7F4",0x915A],
- ["DC5F",0x915F],
- ["DC61",0x9160],
- ["DC5D",0x9161],
- ["DC60",0x9162],
- ["B66F",0x9163],
- ["DC5E",0x9164],
- ["B670",0x9165],
- ["DD73",0x9168],
- ["B955",0x9169],
- ["B954",0x916A],
- ["B953",0x916C],
- ["E0AC",0x916E],
- ["E0AD",0x916F],
- ["E473",0x9172],
- ["E475",0x9173],
- ["BBC6",0x9174],
- ["BBC3",0x9175],
- ["BBC5",0x9177],
- ["BBC4",0x9178],
- ["E474",0x9179],
- ["E472",0x917A],
- ["E861",0x9180],
- ["E85E",0x9181],
- ["E85F",0x9182],
- ["BE4D",0x9183],
- ["E860",0x9184],
- ["E85B",0x9185],
- ["E85C",0x9186],
- ["BE4A",0x9187],
- ["BE4B",0x9189],
- ["E85D",0x918A],
- ["BE4C",0x918B],
- ["EBDB",0x918D],
- ["EBDC",0x918F],
- ["EBD9",0x9190],
- ["EBDA",0x9191],
- ["BFF4",0x9192],
- ["EBD8",0x9193],
- ["EEC8",0x9199],
- ["EEC5",0x919A],
- ["EEC7",0x919B],
- ["C1E0",0x919C],
- ["EECB",0x919D],
- ["C1DF",0x919E],
- ["EEC9",0x919F],
- ["EECC",0x91A0],
- ["EECA",0x91A1],
- ["EEC6",0x91A2],
- ["C1DE",0x91A3],
- ["F14F",0x91A5],
- ["F150",0x91A7],
- ["F14E",0x91A8],
- ["F152",0x91AA],
- ["C2E5",0x91AB],
- ["C2E6",0x91AC],
- ["F35F",0x91AD],
- ["C3E7",0x91AE],
- ["F151",0x91AF],
- ["F35E",0x91B0],
- ["C3E6",0x91B1],
- ["F4E5",0x91B2],
- ["F4E6",0x91B3],
- ["C4BF",0x91B4],
- ["F4E4",0x91B5],
- ["F4E3",0x91B7],
- ["F65D",0x91B9],
- ["C548",0x91BA],
- ["F849",0x91BC],
- ["F8C8",0x91BD],
- ["F8C7",0x91BE],
- ["C643",0x91C0],
- ["C65D",0x91C1],
- ["F8C9",0x91C2],
- ["F971",0x91C3],
- ["C66F",0x91C5],
- ["A8BC",0x91C6],
- ["AAF6",0x91C7],
- ["B956",0x91C9],
- ["C4C0",0x91CB],
- ["A8BD",0x91CC],
- ["ADAB",0x91CD],
- ["B3A5",0x91CE],
- ["B671",0x91CF],
- ["C2E7",0x91D0],
- ["AAF7",0x91D1],
- ["D0C1",0x91D3],
- ["D0C0",0x91D4],
- ["D442",0x91D5],
- ["B078",0x91D7],
- ["B076",0x91D8],
- ["B07A",0x91D9],
- ["D444",0x91DA],
- ["B079",0x91DC],
- ["B077",0x91DD],
- ["D443",0x91E2],
- ["B3A8",0x91E3],
- ["D7FC",0x91E4],
- ["B3A7",0x91E6],
- ["B3A9",0x91E7],
- ["D842",0x91E8],
- ["B3AB",0x91E9],
- ["D7FE",0x91EA],
- ["D840",0x91EB],
- ["D7F7",0x91EC],
- ["B3AA",0x91ED],
- ["D843",0x91EE],
- ["D7F9",0x91F1],
- ["D7FA",0x91F3],
- ["D7F8",0x91F4],
- ["B3A6",0x91F5],
- ["D841",0x91F7],
- ["D7FB",0x91F8],
- ["D7FD",0x91F9],
- ["DC6D",0x91FD],
- ["DC6C",0x91FF],
- ["DC6A",0x9200],
- ["DC62",0x9201],
- ["DC71",0x9202],
- ["DC65",0x9203],
- ["DC6F",0x9204],
- ["DC76",0x9205],
- ["DC6E",0x9206],
- ["B679",0x9207],
- ["B675",0x9209],
- ["DC63",0x920A],
- ["DC69",0x920C],
- ["B677",0x920D],
- ["DC68",0x920F],
- ["B678",0x9210],
- ["B67A",0x9211],
- ["DC6B",0x9212],
- ["B672",0x9214],
- ["B673",0x9215],
- ["DC77",0x9216],
- ["DC75",0x9217],
- ["DC74",0x9219],
- ["DC66",0x921A],
- ["DC72",0x921C],
- ["B676",0x921E],
- ["B674",0x9223],
- ["DC73",0x9224],
- ["DC64",0x9225],
- ["DC67",0x9226],
- ["DC70",0x9227],
- ["E4BA",0x922D],
- ["E0B7",0x922E],
- ["E0B0",0x9230],
- ["E0C3",0x9231],
- ["E0CC",0x9232],
- ["E0B3",0x9233],
- ["B961",0x9234],
- ["E0C0",0x9236],
- ["B957",0x9237],
- ["B959",0x9238],
- ["B965",0x9239],
- ["E0B1",0x923A],
- ["B95A",0x923D],
- ["B95C",0x923E],
- ["B966",0x923F],
- ["B95B",0x9240],
- ["B964",0x9245],
- ["E0B9",0x9246],
- ["E0AE",0x9248],
- ["B962",0x9249],
- ["E0B8",0x924A],
- ["B95E",0x924B],
- ["E0CA",0x924C],
- ["B963",0x924D],
- ["E0C8",0x924E],
- ["E0BC",0x924F],
- ["E0C6",0x9250],
- ["B960",0x9251],
- ["E0AF",0x9252],
- ["E0C9",0x9253],
- ["E0C4",0x9254],
- ["E0CB",0x9256],
- ["B958",0x9257],
- ["B967",0x925A],
- ["B95D",0x925B],
- ["E0B5",0x925E],
- ["E0BD",0x9260],
- ["E0C1",0x9261],
- ["E0C5",0x9263],
- ["B95F",0x9264],
- ["E0B4",0x9265],
- ["E0B2",0x9266],
- ["E0BE",0x9267],
- ["E0BB",0x926C],
- ["E0BA",0x926D],
- ["E0BF",0x926F],
- ["E0C2",0x9270],
- ["E0C7",0x9272],
- ["E478",0x9276],
- ["BBC7",0x9278],
- ["E4A4",0x9279],
- ["E47A",0x927A],
- ["BBCC",0x927B],
- ["BBD0",0x927C],
- ["E4AD",0x927D],
- ["E4B5",0x927E],
- ["E4A6",0x927F],
- ["BBC8",0x9280],
- ["E4AA",0x9282],
- ["E0B6",0x9283],
- ["BBC9",0x9285],
- ["E4B1",0x9286],
- ["E4B6",0x9287],
- ["E4AE",0x9288],
- ["E4B0",0x928A],
- ["E4B9",0x928B],
- ["E4B2",0x928C],
- ["E47E",0x928D],
- ["E4A9",0x928E],
- ["BBD1",0x9291],
- ["BBCD",0x9293],
- ["E47C",0x9294],
- ["E4AB",0x9295],
- ["BBCB",0x9296],
- ["E4A5",0x9297],
- ["BBCA",0x9298],
- ["E4B3",0x9299],
- ["E4A2",0x929A],
- ["E479",0x929B],
- ["BBCE",0x929C],
- ["E4B8",0x929D],
- ["E47B",0x92A0],
- ["E4AF",0x92A1],
- ["E4AC",0x92A2],
- ["E4A7",0x92A3],
- ["E477",0x92A4],
- ["E476",0x92A5],
- ["E4A1",0x92A6],
- ["E4B4",0x92A7],
- ["BBCF",0x92A8],
- ["E4B7",0x92A9],
- ["E47D",0x92AA],
- ["E4A3",0x92AB],
- ["BE52",0x92AC],
- ["BE5A",0x92B2],
- ["BE55",0x92B3],
- ["E8A4",0x92B4],
- ["E8A1",0x92B5],
- ["E867",0x92B6],
- ["BE50",0x92B7],
- ["BE4F",0x92BB],
- ["BE56",0x92BC],
- ["E865",0x92C0],
- ["BE54",0x92C1],
- ["E871",0x92C2],
- ["E863",0x92C3],
- ["E864",0x92C4],
- ["BE4E",0x92C5],
- ["E8A3",0x92C6],
- ["BE58",0x92C7],
- ["E874",0x92C8],
- ["E879",0x92C9],
- ["E873",0x92CA],
- ["EBEE",0x92CB],
- ["E86F",0x92CC],
- ["E877",0x92CD],
- ["E875",0x92CE],
- ["E868",0x92CF],
- ["E862",0x92D0],
- ["E87D",0x92D1],
- ["BE57",0x92D2],
- ["E87E",0x92D3],
- ["E878",0x92D5],
- ["E86D",0x92D7],
- ["E86B",0x92D8],
- ["E866",0x92D9],
- ["E86E",0x92DD],
- ["E87B",0x92DE],
- ["E86A",0x92DF],
- ["E87A",0x92E0],
- ["E8A2",0x92E1],
- ["BE53",0x92E4],
- ["E876",0x92E6],
- ["E87C",0x92E7],
- ["E872",0x92E8],
- ["E86C",0x92E9],
- ["BE51",0x92EA],
- ["E4A8",0x92EE],
- ["E870",0x92EF],
- ["BE59",0x92F0],
- ["E869",0x92F1],
- ["EBF4",0x92F7],
- ["BFF7",0x92F8],
- ["EBF3",0x92F9],
- ["EBF0",0x92FA],
- ["EC44",0x92FB],
- ["BFFB",0x92FC],
- ["EC41",0x92FE],
- ["EBF8",0x92FF],
- ["EC43",0x9300],
- ["EBE9",0x9301],
- ["EBF6",0x9302],
- ["BFFD",0x9304],
- ["EBE1",0x9306],
- ["EBDF",0x9308],
- ["EC42",0x9309],
- ["EC40",0x930B],
- ["EBFE",0x930C],
- ["EBED",0x930D],
- ["EBEC",0x930E],
- ["EBE2",0x930F],
- ["C040",0x9310],
- ["EBE8",0x9312],
- ["EBF2",0x9313],
- ["EBFD",0x9314],
- ["C043",0x9315],
- ["EC45",0x9316],
- ["C1E8",0x9318],
- ["C045",0x9319],
- ["BFFE",0x931A],
- ["EBE6",0x931B],
- ["EBEF",0x931D],
- ["EBDE",0x931E],
- ["EBE0",0x931F],
- ["BFF5",0x9320],
- ["C042",0x9321],
- ["BFFA",0x9322],
- ["EBE7",0x9323],
- ["EBF7",0x9324],
- ["EBF1",0x9325],
- ["C041",0x9326],
- ["EBDD",0x9327],
- ["C1E3",0x9328],
- ["EBF9",0x9329],
- ["EBFC",0x932A],
- ["BFFC",0x932B],
- ["EBEB",0x932D],
- ["C044",0x932E],
- ["BFF9",0x932F],
- ["BFF8",0x9333],
- ["EBF5",0x9334],
- ["EBFB",0x9335],
- ["BFF6",0x9336],
- ["EBE4",0x9338],
- ["EBFA",0x9339],
- ["EBE5",0x933C],
- ["EBEA",0x9346],
- ["EED2",0x9347],
- ["EED7",0x9349],
- ["C1E5",0x934A],
- ["C1E7",0x934B],
- ["EEDD",0x934C],
- ["C1E1",0x934D],
- ["EEEC",0x934E],
- ["EEE3",0x934F],
- ["EED8",0x9350],
- ["EED9",0x9351],
- ["EEE2",0x9352],
- ["C1EE",0x9354],
- ["EEE1",0x9355],
- ["EED1",0x9356],
- ["EEE0",0x9357],
- ["EED4",0x9358],
- ["EEED",0x9359],
- ["C1ED",0x935A],
- ["C1EB",0x935B],
- ["EED5",0x935C],
- ["EEE8",0x935E],
- ["EEDA",0x9360],
- ["EEE7",0x9361],
- ["EEE9",0x9363],
- ["EED0",0x9364],
- ["C1E6",0x9365],
- ["EEEA",0x9367],
- ["EEDE",0x936A],
- ["C1EA",0x936C],
- ["EEDB",0x936D],
- ["C1EC",0x9370],
- ["EEE4",0x9371],
- ["C1E4",0x9375],
- ["EED6",0x9376],
- ["EEE5",0x9377],
- ["EEDF",0x9379],
- ["EBE3",0x937A],
- ["EEE6",0x937B],
- ["EED3",0x937C],
- ["C1E9",0x937E],
- ["EEEB",0x9380],
- ["C1E2",0x9382],
- ["EECE",0x9383],
- ["F160",0x9388],
- ["F159",0x9389],
- ["C2E9",0x938A],
- ["F154",0x938C],
- ["F163",0x938D],
- ["F15B",0x938E],
- ["EEDC",0x938F],
- ["F165",0x9391],
- ["F155",0x9392],
- ["C2E8",0x9394],
- ["F15F",0x9395],
- ["C2EA",0x9396],
- ["C2F2",0x9397],
- ["C2F0",0x9398],
- ["F161",0x9399],
- ["C2F1",0x939A],
- ["F157",0x939B],
- ["F158",0x939D],
- ["F15D",0x939E],
- ["F162",0x939F],
- ["EECD",0x93A1],
- ["C2EB",0x93A2],
- ["F16A",0x93A3],
- ["F167",0x93A4],
- ["F16B",0x93A5],
- ["F15E",0x93A6],
- ["F15A",0x93A7],
- ["F168",0x93A8],
- ["F36A",0x93A9],
- ["F15C",0x93AA],
- ["C2EE",0x93AC],
- ["C2ED",0x93AE],
- ["EECF",0x93AF],
- ["C2EF",0x93B0],
- ["F164",0x93B1],
- ["F166",0x93B2],
- ["C2EC",0x93B3],
- ["F169",0x93B4],
- ["F153",0x93B5],
- ["F156",0x93B7],
- ["F373",0x93C0],
- ["F363",0x93C2],
- ["C3EB",0x93C3],
- ["F371",0x93C4],
- ["F361",0x93C7],
- ["C3EC",0x93C8],
- ["F36C",0x93CA],
- ["F368",0x93CC],
- ["C3F1",0x93CD],
- ["F372",0x93CE],
- ["F362",0x93CF],
- ["F365",0x93D0],
- ["C3E9",0x93D1],
- ["F374",0x93D2],
- ["F36D",0x93D4],
- ["F370",0x93D5],
- ["C3EF",0x93D6],
- ["C3F4",0x93D7],
- ["C3F2",0x93D8],
- ["F369",0x93D9],
- ["F364",0x93DA],
- ["C3ED",0x93DC],
- ["C3EE",0x93DD],
- ["F360",0x93DE],
- ["C3EA",0x93DF],
- ["C3E8",0x93E1],
- ["C3F0",0x93E2],
- ["F36F",0x93E3],
- ["C3F3",0x93E4],
- ["F36B",0x93E6],
- ["F375",0x93E7],
- ["C3F5",0x93E8],
- ["F367",0x93EC],
- ["F36E",0x93EE],
- ["F4F3",0x93F5],
- ["F542",0x93F6],
- ["F4F5",0x93F7],
- ["F4FC",0x93F8],
- ["F366",0x93F9],
- ["F4FA",0x93FA],
- ["F4E9",0x93FB],
- ["F540",0x93FC],
- ["C4C3",0x93FD],
- ["F4ED",0x93FE],
- ["F4FE",0x93FF],
- ["F4F4",0x9400],
- ["C4C2",0x9403],
- ["F544",0x9406],
- ["F4F6",0x9407],
- ["F4FB",0x9409],
- ["F4FD",0x940A],
- ["F4E7",0x940B],
- ["F541",0x940C],
- ["F4F2",0x940D],
- ["F4F7",0x940E],
- ["F4EB",0x940F],
- ["F4EF",0x9410],
- ["F543",0x9411],
- ["F4F9",0x9412],
- ["F4E8",0x9413],
- ["F4EC",0x9414],
- ["F4EE",0x9415],
- ["F4F8",0x9416],
- ["C4C1",0x9418],
- ["F4F1",0x9419],
- ["F4EA",0x9420],
- ["F4F0",0x9428],
- ["F661",0x9429],
- ["F666",0x942A],
- ["C54F",0x942B],
- ["F668",0x942C],
- ["C549",0x942E],
- ["F664",0x9430],
- ["F66A",0x9431],
- ["C54E",0x9432],
- ["C54A",0x9433],
- ["C54B",0x9435],
- ["F660",0x9436],
- ["F667",0x9437],
- ["C54D",0x9438],
- ["F665",0x9439],
- ["C54C",0x943A],
- ["F65F",0x943B],
- ["F663",0x943C],
- ["F662",0x943D],
- ["F65E",0x943F],
- ["F669",0x9440],
- ["C5B1",0x9444],
- ["F76D",0x9445],
- ["F770",0x9446],
- ["F76C",0x9447],
- ["F76E",0x9448],
- ["F76F",0x9449],
- ["F769",0x944A],
- ["F76A",0x944B],
- ["F767",0x944C],
- ["F76B",0x944F],
- ["F768",0x9450],
- ["C5B2",0x9451],
- ["C5B3",0x9452],
- ["F84B",0x9455],
- ["F84D",0x9457],
- ["F84C",0x945D],
- ["F84E",0x945E],
- ["C5E0",0x9460],
- ["F84A",0x9462],
- ["C5DF",0x9463],
- ["C5E1",0x9464],
- ["F8CB",0x9468],
- ["F8CC",0x9469],
- ["C644",0x946A],
- ["F8CA",0x946B],
- ["F953",0x946D],
- ["F952",0x946E],
- ["F954",0x946F],
- ["C65F",0x9470],
- ["F955",0x9471],
- ["C65E",0x9472],
- ["F956",0x9473],
- ["F972",0x9474],
- ["F975",0x9475],
- ["F974",0x9476],
- ["C668",0x9477],
- ["F973",0x9478],
- ["C672",0x947C],
- ["C670",0x947D],
- ["C671",0x947E],
- ["C677",0x947F],
- ["F9C0",0x9480],
- ["F9C1",0x9481],
- ["F9BF",0x9482],
- ["F9C9",0x9483],
- ["AAF8",0x9577],
- ["D844",0x957A],
- ["DC78",0x957B],
- ["E8A5",0x957C],
- ["F376",0x957D],
- ["AAF9",0x9580],
- ["ADAC",0x9582],
- ["B07B",0x9583],
- ["D845",0x9586],
- ["D846",0x9588],
- ["B3AC",0x9589],
- ["B67D",0x958B],
- ["DC7A",0x958C],
- ["DC79",0x958D],
- ["B6A3",0x958E],
- ["B67C",0x958F],
- ["DC7B",0x9590],
- ["B67E",0x9591],
- ["B6A2",0x9592],
- ["B6A1",0x9593],
- ["B67B",0x9594],
- ["B968",0x9598],
- ["E0D0",0x959B],
- ["E0CE",0x959C],
- ["E0CF",0x959E],
- ["E0CD",0x959F],
- ["BBD2",0x95A1],
- ["BBD5",0x95A3],
- ["BBD7",0x95A4],
- ["BBD6",0x95A5],
- ["BBD3",0x95A8],
- ["BBD4",0x95A9],
- ["E8A7",0x95AB],
- ["E8A6",0x95AC],
- ["BE5B",0x95AD],
- ["E8A8",0x95AE],
- ["E8A9",0x95B0],
- ["BE5C",0x95B1],
- ["EC4D",0x95B5],
- ["EC4B",0x95B6],
- ["EEF3",0x95B7],
- ["EC49",0x95B9],
- ["EC4A",0x95BA],
- ["C046",0x95BB],
- ["EC46",0x95BC],
- ["EC4E",0x95BD],
- ["EC48",0x95BE],
- ["EC4C",0x95BF],
- ["EEEF",0x95C0],
- ["EEF1",0x95C3],
- ["EEF2",0x95C5],
- ["C1F3",0x95C6],
- ["EEEE",0x95C7],
- ["C1F2",0x95C8],
- ["EEF0",0x95C9],
- ["C1EF",0x95CA],
- ["C1F0",0x95CB],
- ["C1F1",0x95CC],
- ["EC47",0x95CD],
- ["C2F5",0x95D0],
- ["F16E",0x95D1],
- ["F16C",0x95D2],
- ["F16D",0x95D3],
- ["C2F3",0x95D4],
- ["C2F6",0x95D5],
- ["C2F4",0x95D6],
- ["F377",0x95DA],
- ["F378",0x95DB],
- ["C3F6",0x95DC],
- ["F545",0x95DE],
- ["F547",0x95DF],
- ["F546",0x95E0],
- ["C4C4",0x95E1],
- ["C550",0x95E2],
- ["F66D",0x95E3],
- ["F66C",0x95E4],
- ["F66B",0x95E5],
- ["AAFA",0x961C],
- ["C9AA",0x961E],
- ["CA58",0x9620],
- ["A6E9",0x9621],
- ["CA56",0x9622],
- ["CA59",0x9623],
- ["CA57",0x9624],
- ["CBAE",0x9628],
- ["A8C1",0x962A],
- ["A8C2",0x962C],
- ["CBB0",0x962D],
- ["A8BF",0x962E],
- ["CBAF",0x962F],
- ["CBAD",0x9630],
- ["A8C0",0x9631],
- ["A8BE",0x9632],
- ["CDD8",0x9639],
- ["CDDB",0x963A],
- ["AAFD",0x963B],
- ["CDDA",0x963C],
- ["CDD9",0x963D],
- ["AAFC",0x963F],
- ["AAFB",0x9640],
- ["AB40",0x9642],
- ["CDDC",0x9643],
- ["AAFE",0x9644],
- ["D0C6",0x964A],
- ["ADAE",0x964B],
- ["ADAF",0x964C],
- ["ADB0",0x964D],
- ["D0C7",0x964E],
- ["D0C3",0x964F],
- ["ADAD",0x9650],
- ["D0C4",0x9651],
- ["D0C5",0x9653],
- ["D0C2",0x9654],
- ["B0A4",0x9658],
- ["B0A1",0x965B],
- ["D445",0x965C],
- ["B0A2",0x965D],
- ["B0A5",0x965E],
- ["D446",0x965F],
- ["B07E",0x9661],
- ["B07C",0x9662],
- ["B07D",0x9663],
- ["B0A3",0x9664],
- ["B3AD",0x966A],
- ["D849",0x966B],
- ["B3B5",0x966C],
- ["D848",0x966D],
- ["D84B",0x966F],
- ["B3B1",0x9670],
- ["D84A",0x9671],
- ["B6AB",0x9672],
- ["B3AF",0x9673],
- ["B3B2",0x9674],
- ["B3AE",0x9675],
- ["B3B3",0x9676],
- ["B3B4",0x9677],
- ["B3B0",0x9678],
- ["D847",0x967C],
- ["B6A7",0x967D],
- ["DC7D",0x967E],
- ["DCA3",0x9680],
- ["DCA2",0x9683],
- ["B6AC",0x9684],
- ["B6A8",0x9685],
- ["B6A9",0x9686],
- ["DC7C",0x9687],
- ["DC7E",0x9688],
- ["DCA1",0x9689],
- ["B6A4",0x968A],
- ["B6A6",0x968B],
- ["B6AA",0x968D],
- ["B6A5",0x968E],
- ["E0D3",0x9691],
- ["E0D1",0x9692],
- ["E0D2",0x9693],
- ["B96A",0x9694],
- ["B96B",0x9695],
- ["E0D4",0x9697],
- ["B969",0x9698],
- ["BBD8",0x9699],
- ["BBDA",0x969B],
- ["BBD9",0x969C],
- ["E4BB",0x969E],
- ["E4BC",0x96A1],
- ["E8AB",0x96A2],
- ["E8AA",0x96A4],
- ["C047",0x96A7],
- ["C048",0x96A8],
- ["EC4F",0x96A9],
- ["C049",0x96AA],
- ["EEF6",0x96AC],
- ["EEF4",0x96AE],
- ["EEF5",0x96B0],
- ["C1F4",0x96B1],
- ["F16F",0x96B3],
- ["C3F7",0x96B4],
- ["C1F5",0x96B8],
- ["AB41",0x96B9],
- ["B0A6",0x96BB],
- ["D447",0x96BC],
- ["D84C",0x96BF],
- ["B3B6",0x96C0],
- ["B6AD",0x96C1],
- ["DCA4",0x96C2],
- ["DCA6",0x96C3],
- ["B6AF",0x96C4],
- ["B6AE",0x96C5],
- ["B6B0",0x96C6],
- ["B6B1",0x96C7],
- ["DCA5",0x96C8],
- ["B96E",0x96C9],
- ["B96F",0x96CA],
- ["B96D",0x96CB],
- ["BBDB",0x96CC],
- ["B96C",0x96CD],
- ["E0D5",0x96CE],
- ["BBDC",0x96D2],
- ["E8AC",0x96D3],
- ["EC50",0x96D4],
- ["C04A",0x96D5],
- ["C1F6",0x96D6],
- ["F170",0x96D7],
- ["F174",0x96D8],
- ["C2F9",0x96D9],
- ["F171",0x96DA],
- ["C2FA",0x96DB],
- ["C2F8",0x96DC],
- ["F175",0x96DD],
- ["C2FB",0x96DE],
- ["F173",0x96DF],
- ["F379",0x96E1],
- ["C2F7",0x96E2],
- ["C3F8",0x96E3],
- ["F8CD",0x96E5],
- ["AB42",0x96E8],
- ["B3B8",0x96E9],
- ["B3B7",0x96EA],
- ["B6B2",0x96EF],
- ["DCA8",0x96F0],
- ["DCA7",0x96F1],
- ["B6B3",0x96F2],
- ["E0D9",0x96F5],
- ["B973",0x96F6],
- ["B970",0x96F7],
- ["E0D8",0x96F8],
- ["B972",0x96F9],
- ["E0D6",0x96FA],
- ["B971",0x96FB],
- ["E0D7",0x96FD],
- ["E4BD",0x96FF],
- ["BBDD",0x9700],
- ["E8AF",0x9702],
- ["BE5D",0x9704],
- ["E8AD",0x9705],
- ["BE5E",0x9706],
- ["BE5F",0x9707],
- ["E8AE",0x9708],
- ["BE60",0x9709],
- ["EC51",0x970B],
- ["C04E",0x970D],
- ["C04B",0x970E],
- ["C050",0x970F],
- ["EC53",0x9710],
- ["C04C",0x9711],
- ["EC52",0x9712],
- ["C04F",0x9713],
- ["C04D",0x9716],
- ["EEF9",0x9718],
- ["EEFB",0x9719],
- ["C1F7",0x971C],
- ["EEFA",0x971D],
- ["C1F8",0x971E],
- ["EEF8",0x971F],
- ["EEF7",0x9720],
- ["F177",0x9722],
- ["F176",0x9723],
- ["C2FC",0x9724],
- ["F178",0x9725],
- ["F37E",0x9726],
- ["C3FA",0x9727],
- ["F37D",0x9728],
- ["F37A",0x9729],
- ["C3F9",0x972A],
- ["F37B",0x972B],
- ["F37C",0x972C],
- ["F548",0x972E],
- ["F549",0x972F],
- ["C4C5",0x9730],
- ["C553",0x9732],
- ["F66E",0x9735],
- ["C551",0x9738],
- ["C552",0x9739],
- ["F66F",0x973A],
- ["C5B4",0x973D],
- ["C5B5",0x973E],
- ["F771",0x973F],
- ["C645",0x9742],
- ["F8CF",0x9743],
- ["C647",0x9744],
- ["F8CE",0x9746],
- ["F8D0",0x9747],
- ["C646",0x9748],
- ["F957",0x9749],
- ["F9AD",0x974B],
- ["AB43",0x9752],
- ["B974",0x9756],
- ["E4BE",0x9758],
- ["E8B0",0x975A],
- ["C051",0x975B],
- ["C052",0x975C],
- ["AB44",0x975E],
- ["BE61",0x9760],
- ["C3FB",0x9761],
- ["ADB1",0x9762],
- ["C053",0x9766],
- ["C5E2",0x9768],
- ["ADB2",0x9769],
- ["D84D",0x976A],
- ["DCA9",0x976C],
- ["DCAB",0x976E],
- ["DCAA",0x9770],
- ["E0DD",0x9772],
- ["E0DA",0x9773],
- ["B975",0x9774],
- ["B976",0x9776],
- ["E0DB",0x9777],
- ["E0DC",0x9778],
- ["E4C0",0x977A],
- ["E4C5",0x977B],
- ["BBDE",0x977C],
- ["E4BF",0x977D],
- ["E4C1",0x977E],
- ["E4C8",0x977F],
- ["E4C3",0x9780],
- ["E4C7",0x9781],
- ["E4C4",0x9782],
- ["E4C2",0x9783],
- ["E4C6",0x9784],
- ["BBDF",0x9785],
- ["E8B3",0x9788],
- ["E8B1",0x978A],
- ["BE63",0x978B],
- ["BE62",0x978D],
- ["E8B2",0x978E],
- ["BE64",0x978F],
- ["EC56",0x9794],
- ["EC55",0x9797],
- ["C054",0x9798],
- ["EC54",0x9799],
- ["EEFC",0x979A],
- ["EEFE",0x979C],
- ["EF41",0x979D],
- ["EF40",0x979E],
- ["C1F9",0x97A0],
- ["EEFD",0x97A1],
- ["F1A1",0x97A2],
- ["C2FD",0x97A3],
- ["F17D",0x97A4],
- ["F1A2",0x97A5],
- ["C2FE",0x97A6],
- ["F17B",0x97A8],
- ["F17E",0x97AA],
- ["F17C",0x97AB],
- ["F179",0x97AC],
- ["C340",0x97AD],
- ["F17A",0x97AE],
- ["F3A1",0x97B3],
- ["F3A3",0x97B6],
- ["F3A2",0x97B7],
- ["F54A",0x97B9],
- ["F54B",0x97BB],
- ["F670",0x97BF],
- ["C5B7",0x97C1],
- ["C5B6",0x97C3],
- ["F84F",0x97C4],
- ["F850",0x97C5],
- ["C648",0x97C6],
- ["F8D1",0x97C7],
- ["C669",0x97C9],
- ["ADB3",0x97CB],
- ["B6B4",0x97CC],
- ["E4CA",0x97CD],
- ["E4C9",0x97CE],
- ["E8B5",0x97CF],
- ["E8B4",0x97D0],
- ["C1FA",0x97D3],
- ["EF43",0x97D4],
- ["EF42",0x97D5],
- ["F1A5",0x97D6],
- ["F1A3",0x97D7],
- ["F1A6",0x97D8],
- ["F1A4",0x97D9],
- ["C3FC",0x97DC],
- ["F3A4",0x97DD],
- ["F3A5",0x97DE],
- ["F3A6",0x97DF],
- ["F671",0x97E1],
- ["F772",0x97E3],
- ["F8D2",0x97E5],
- ["ADB4",0x97ED],
- ["EC57",0x97F0],
- ["EF44",0x97F1],
- ["ADB5",0x97F3],
- ["BBE0",0x97F6],
- ["EC58",0x97F8],
- ["C341",0x97F9],
- ["F1A7",0x97FA],
- ["C3FD",0x97FB],
- ["F54C",0x97FD],
- ["F54D",0x97FE],
- ["C554",0x97FF],
- ["F851",0x9800],
- ["ADB6",0x9801],
- ["B3BB",0x9802],
- ["B3BC",0x9803],
- ["D84E",0x9804],
- ["B6B5",0x9805],
- ["B6B6",0x9806],
- ["DCAC",0x9807],
- ["B6B7",0x9808],
- ["B97A",0x980A],
- ["B97C",0x980C],
- ["E0DF",0x980D],
- ["E0E0",0x980E],
- ["E0DE",0x980F],
- ["B977",0x9810],
- ["B978",0x9811],
- ["B97B",0x9812],
- ["B979",0x9813],
- ["E4CB",0x9816],
- ["BBE1",0x9817],
- ["BBE2",0x9818],
- ["E8BC",0x981B],
- ["BE67",0x981C],
- ["E8B7",0x981D],
- ["E8B6",0x981E],
- ["E8BB",0x9820],
- ["BE65",0x9821],
- ["C05B",0x9824],
- ["E8B8",0x9826],
- ["E8BD",0x9827],
- ["E8BA",0x9828],
- ["E8B9",0x9829],
- ["BE66",0x982B],
- ["C059",0x982D],
- ["EC5A",0x982F],
- ["C055",0x9830],
- ["EC5B",0x9832],
- ["EC59",0x9835],
- ["C058",0x9837],
- ["C056",0x9838],
- ["C05A",0x9839],
- ["C057",0x983B],
- ["EF45",0x9841],
- ["EF4A",0x9843],
- ["EF46",0x9844],
- ["EF49",0x9845],
- ["C1FB",0x9846],
- ["EDD4",0x9848],
- ["EF48",0x9849],
- ["EF47",0x984A],
- ["C344",0x984C],
- ["C342",0x984D],
- ["C345",0x984E],
- ["C343",0x984F],
- ["F1A8",0x9850],
- ["F1A9",0x9851],
- ["F1AA",0x9852],
- ["C346",0x9853],
- ["F3AA",0x9857],
- ["C440",0x9858],
- ["F3A8",0x9859],
- ["C441",0x985B],
- ["F3A7",0x985C],
- ["F3A9",0x985D],
- ["C3FE",0x985E],
- ["F551",0x985F],
- ["F54E",0x9860],
- ["F54F",0x9862],
- ["F550",0x9863],
- ["F672",0x9864],
- ["C556",0x9865],
- ["C555",0x9867],
- ["F774",0x9869],
- ["F773",0x986A],
- ["C5B8",0x986B],
- ["C5E3",0x986F],
- ["C649",0x9870],
- ["C660",0x9871],
- ["F958",0x9872],
- ["F9AE",0x9873],
- ["F9AF",0x9874],
- ["ADB7",0x98A8],
- ["DCAD",0x98A9],
- ["E0E1",0x98AC],
- ["E4CC",0x98AD],
- ["E4CD",0x98AE],
- ["BBE3",0x98AF],
- ["BBE4",0x98B1],
- ["E8BE",0x98B2],
- ["BE68",0x98B3],
- ["C1FC",0x98B6],
- ["F1AB",0x98B8],
- ["C347",0x98BA],
- ["F3AD",0x98BB],
- ["C442",0x98BC],
- ["F3AC",0x98BD],
- ["F3AE",0x98BE],
- ["F3AB",0x98BF],
- ["F675",0x98C0],
- ["F552",0x98C1],
- ["F553",0x98C2],
- ["C4C6",0x98C4],
- ["F674",0x98C6],
- ["F673",0x98C9],
- ["F775",0x98CB],
- ["F9B0",0x98CC],
- ["ADB8",0x98DB],
- ["ADB9",0x98DF],
- ["B0A7",0x98E2],
- ["D448",0x98E3],
- ["D84F",0x98E5],
- ["B6B8",0x98E7],
- ["B6BB",0x98E9],
- ["B6B9",0x98EA],
- ["DCAE",0x98EB],
- ["B6BD",0x98ED],
- ["B6BA",0x98EF],
- ["B6BC",0x98F2],
- ["B97E",0x98F4],
- ["E0E2",0x98F6],
- ["E0E3",0x98F9],
- ["E8C0",0x98FA],
- ["B97D",0x98FC],
- ["B9A1",0x98FD],
- ["B9A2",0x98FE],
- ["E4CF",0x9900],
- ["E4CE",0x9902],
- ["BBE5",0x9903],
- ["BBE6",0x9905],
- ["E4D0",0x9907],
- ["E8BF",0x9908],
- ["BBE8",0x9909],
- ["BE69",0x990A],
- ["BBE7",0x990C],
- ["C05C",0x9910],
- ["E8C1",0x9911],
- ["BE6B",0x9912],
- ["BE6A",0x9913],
- ["E8C2",0x9914],
- ["E8C5",0x9915],
- ["E8C3",0x9916],
- ["E8C4",0x9917],
- ["BE6C",0x9918],
- ["C061",0x991A],
- ["C05F",0x991B],
- ["C05E",0x991E],
- ["EC5D",0x991F],
- ["C060",0x9921],
- ["EC5C",0x9924],
- ["EF4B",0x9925],
- ["EC5E",0x9927],
- ["C05D",0x9928],
- ["EC5F",0x9929],
- ["EF4E",0x992A],
- ["EF4C",0x992B],
- ["EF4D",0x992C],
- ["EF52",0x992D],
- ["C34B",0x992E],
- ["EF51",0x992F],
- ["EF54",0x9930],
- ["EF53",0x9931],
- ["EF50",0x9932],
- ["EF4F",0x9933],
- ["C1FD",0x9935],
- ["F1AE",0x993A],
- ["F1AD",0x993C],
- ["C34A",0x993D],
- ["C348",0x993E],
- ["C349",0x993F],
- ["F1AC",0x9941],
- ["F3B1",0x9943],
- ["C443",0x9945],
- ["F3B0",0x9947],
- ["F3AF",0x9948],
- ["C444",0x9949],
- ["F558",0x994B],
- ["F557",0x994C],
- ["F555",0x994E],
- ["F554",0x9950],
- ["C4C8",0x9951],
- ["C4C7",0x9952],
- ["F559",0x9953],
- ["F776",0x9954],
- ["C5B9",0x9955],
- ["F677",0x9956],
- ["C557",0x9957],
- ["F676",0x9958],
- ["F556",0x9959],
- ["F777",0x995B],
- ["C5E4",0x995C],
- ["C661",0x995E],
- ["F959",0x995F],
- ["F9B1",0x9961],
- ["ADBA",0x9996],
- ["D850",0x9997],
- ["EF55",0x9998],
- ["ADBB",0x9999],
- ["E4D2",0x999C],
- ["E4D1",0x999D],
- ["EC60",0x999E],
- ["EF57",0x99A1],
- ["EF56",0x99A3],
- ["C34C",0x99A5],
- ["F3B2",0x99A6],
- ["F3B3",0x99A7],
- ["C4C9",0x99A8],
- ["F9B2",0x99AB],
- ["B0A8",0x99AC],
- ["B6BF",0x99AD],
- ["B6BE",0x99AE],
- ["E0E4",0x99AF],
- ["E0E6",0x99B0],
- ["B9A4",0x99B1],
- ["E0E5",0x99B2],
- ["B9A3",0x99B3],
- ["B9A5",0x99B4],
- ["E0E7",0x99B5],
- ["E4D4",0x99B9],
- ["E4D6",0x99BA],
- ["E4D5",0x99BB],
- ["E4D8",0x99BD],
- ["BBE9",0x99C1],
- ["E4D7",0x99C2],
- ["E4D3",0x99C3],
- ["E4D9",0x99C7],
- ["E8CC",0x99C9],
- ["E8CF",0x99CB],
- ["E8D1",0x99CC],
- ["E8C7",0x99CD],
- ["E8CB",0x99CE],
- ["E8C8",0x99CF],
- ["BE6E",0x99D0],
- ["BE71",0x99D1],
- ["BE73",0x99D2],
- ["E8C9",0x99D3],
- ["E8CA",0x99D4],
- ["BE72",0x99D5],
- ["E8CD",0x99D6],
- ["E8D0",0x99D7],
- ["E8CE",0x99D8],
- ["BE74",0x99D9],
- ["BE70",0x99DB],
- ["E8C6",0x99DC],
- ["BE6D",0x99DD],
- ["BE6F",0x99DF],
- ["C063",0x99E2],
- ["EC66",0x99E3],
- ["EC64",0x99E4],
- ["EC63",0x99E5],
- ["EC69",0x99E7],
- ["EC68",0x99E9],
- ["EC67",0x99EA],
- ["EC62",0x99EC],
- ["C062",0x99ED],
- ["EC61",0x99EE],
- ["EC65",0x99F0],
- ["C064",0x99F1],
- ["EF5A",0x99F4],
- ["EF5E",0x99F6],
- ["EF5B",0x99F7],
- ["EF5D",0x99F8],
- ["EF5C",0x99F9],
- ["EF59",0x99FA],
- ["EF5F",0x99FB],
- ["EF62",0x99FC],
- ["EF60",0x99FD],
- ["EF61",0x99FE],
- ["C240",0x99FF],
- ["C1FE",0x9A01],
- ["EF58",0x9A02],
- ["EF63",0x9A03],
- ["F1B3",0x9A04],
- ["F1B6",0x9A05],
- ["F1B8",0x9A06],
- ["F1B7",0x9A07],
- ["F1B1",0x9A09],
- ["F1B5",0x9A0A],
- ["F1B0",0x9A0B],
- ["F1B2",0x9A0D],
- ["C34D",0x9A0E],
- ["F1AF",0x9A0F],
- ["F1B4",0x9A11],
- ["F3C0",0x9A14],
- ["F3B5",0x9A15],
- ["C445",0x9A16],
- ["C446",0x9A19],
- ["F3B4",0x9A1A],
- ["F3B9",0x9A1B],
- ["F3BF",0x9A1C],
- ["F3B7",0x9A1D],
- ["F3BE",0x9A1E],
- ["F3BB",0x9A20],
- ["F3BA",0x9A22],
- ["F3BD",0x9A23],
- ["F3B8",0x9A24],
- ["F3B6",0x9A25],
- ["F3BC",0x9A27],
- ["F560",0x9A29],
- ["F55E",0x9A2A],
- ["C4CA",0x9A2B],
- ["F55D",0x9A2C],
- ["F563",0x9A2D],
- ["F561",0x9A2E],
- ["C4CB",0x9A30],
- ["F55C",0x9A31],
- ["F55A",0x9A32],
- ["F55B",0x9A34],
- ["C4CD",0x9A35],
- ["F55F",0x9A36],
- ["C4CC",0x9A37],
- ["F562",0x9A38],
- ["F678",0x9A39],
- ["F67E",0x9A3A],
- ["F679",0x9A3D],
- ["C55B",0x9A3E],
- ["F6A1",0x9A3F],
- ["C55A",0x9A40],
- ["F67D",0x9A41],
- ["F67C",0x9A42],
- ["C559",0x9A43],
- ["F67B",0x9A44],
- ["C558",0x9A45],
- ["F67A",0x9A46],
- ["F77D",0x9A48],
- ["F7A1",0x9A49],
- ["F77E",0x9A4A],
- ["F77B",0x9A4C],
- ["C5BB",0x9A4D],
- ["F778",0x9A4E],
- ["F77C",0x9A4F],
- ["F7A3",0x9A50],
- ["F7A2",0x9A52],
- ["F779",0x9A53],
- ["F77A",0x9A54],
- ["C5BA",0x9A55],
- ["F852",0x9A56],
- ["C5E7",0x9A57],
- ["F853",0x9A59],
- ["C5E5",0x9A5A],
- ["C5E6",0x9A5B],
- ["F8D3",0x9A5E],
- ["C64A",0x9A5F],
- ["F976",0x9A60],
- ["C66A",0x9A62],
- ["F9B3",0x9A64],
- ["C66B",0x9A65],
- ["F9B4",0x9A66],
- ["F9B5",0x9A67],
- ["F9C3",0x9A68],
- ["F9C2",0x9A69],
- ["C67A",0x9A6A],
- ["F9CD",0x9A6B],
- ["B0A9",0x9AA8],
- ["E0E9",0x9AAB],
- ["E0E8",0x9AAD],
- ["BBEA",0x9AAF],
- ["BBEB",0x9AB0],
- ["E4DA",0x9AB1],
- ["E8D2",0x9AB3],
- ["EC6C",0x9AB4],
- ["BE75",0x9AB7],
- ["C065",0x9AB8],
- ["EC6A",0x9AB9],
- ["EC6D",0x9ABB],
- ["C066",0x9ABC],
- ["EF64",0x9ABE],
- ["EC6B",0x9ABF],
- ["F1B9",0x9AC0],
- ["C34E",0x9AC1],
- ["F3C1",0x9AC2],
- ["F566",0x9AC6],
- ["F564",0x9AC7],
- ["F565",0x9ACA],
- ["F6A2",0x9ACD],
- ["C55C",0x9ACF],
- ["F7A4",0x9AD0],
- ["C5EA",0x9AD1],
- ["C5BC",0x9AD2],
- ["C5E8",0x9AD3],
- ["C5E9",0x9AD4],
- ["F8D4",0x9AD5],
- ["C662",0x9AD6],
- ["B0AA",0x9AD8],
- ["F1BA",0x9ADC],
- ["D449",0x9ADF],
- ["B9A6",0x9AE1],
- ["E4DB",0x9AE3],
- ["BBEC",0x9AE6],
- ["E4DC",0x9AE7],
- ["E8D4",0x9AEB],
- ["E8D3",0x9AEC],
- ["C068",0x9AED],
- ["BE76",0x9AEE],
- ["BE77",0x9AEF],
- ["E8D7",0x9AF1],
- ["E8D6",0x9AF2],
- ["E8D5",0x9AF3],
- ["EC6E",0x9AF6],
- ["EC71",0x9AF7],
- ["EC70",0x9AF9],
- ["EC6F",0x9AFA],
- ["C067",0x9AFB],
- ["EF68",0x9AFC],
- ["EF66",0x9AFD],
- ["EF65",0x9AFE],
- ["EF67",0x9B01],
- ["C34F",0x9B03],
- ["F1BC",0x9B04],
- ["F1BD",0x9B05],
- ["C350",0x9B06],
- ["F1BB",0x9B08],
- ["F3C3",0x9B0A],
- ["F3C2",0x9B0B],
- ["F3C5",0x9B0C],
- ["C447",0x9B0D],
- ["F3C4",0x9B0E],
- ["F567",0x9B10],
- ["F569",0x9B11],
- ["F568",0x9B12],
- ["F6A3",0x9B15],
- ["F6A6",0x9B16],
- ["F6A4",0x9B17],
- ["F6A5",0x9B18],
- ["F7A5",0x9B19],
- ["C5BD",0x9B1A],
- ["F854",0x9B1E],
- ["F855",0x9B1F],
- ["F856",0x9B20],
- ["C64B",0x9B22],
- ["C663",0x9B23],
- ["F9B6",0x9B24],
- ["B0AB",0x9B25],
- ["BE78",0x9B27],
- ["C069",0x9B28],
- ["F1BE",0x9B29],
- ["F7A6",0x9B2B],
- ["F9C4",0x9B2E],
- ["D44A",0x9B2F],
- ["C67B",0x9B31],
- ["B0AC",0x9B32],
- ["EC72",0x9B33],
- ["F1BF",0x9B35],
- ["F3C6",0x9B37],
- ["F6A7",0x9B3A],
- ["F7A7",0x9B3B],
- ["B0AD",0x9B3C],
- ["E4DD",0x9B3E],
- ["E4DE",0x9B3F],
- ["BBED",0x9B41],
- ["BBEE",0x9B42],
- ["E8D9",0x9B43],
- ["BE7A",0x9B44],
- ["BE79",0x9B45],
- ["E8D8",0x9B46],
- ["EF69",0x9B48],
- ["F1C0",0x9B4A],
- ["F1C2",0x9B4B],
- ["F1C1",0x9B4C],
- ["C353",0x9B4D],
- ["C352",0x9B4E],
- ["C351",0x9B4F],
- ["C55E",0x9B51],
- ["F6A8",0x9B52],
- ["C55D",0x9B54],
- ["F7A9",0x9B55],
- ["F7A8",0x9B56],
- ["C64C",0x9B58],
- ["F8D5",0x9B59],
- ["B3BD",0x9B5A],
- ["E0EA",0x9B5B],
- ["E4E1",0x9B5F],
- ["E4DF",0x9B60],
- ["E4E0",0x9B61],
- ["E8E2",0x9B64],
- ["E8DD",0x9B66],
- ["E8DA",0x9B67],
- ["E8E1",0x9B68],
- ["E8E3",0x9B6C],
- ["BE7C",0x9B6F],
- ["E8E0",0x9B70],
- ["E8DC",0x9B71],
- ["E8DB",0x9B74],
- ["E8DF",0x9B75],
- ["E8DE",0x9B76],
- ["BE7B",0x9B77],
- ["EC7D",0x9B7A],
- ["EC78",0x9B7B],
- ["EC76",0x9B7C],
- ["ECA1",0x9B7D],
- ["EC77",0x9B7E],
- ["EC73",0x9B80],
- ["EC79",0x9B82],
- ["EC74",0x9B85],
- ["EF72",0x9B86],
- ["EC75",0x9B87],
- ["ECA2",0x9B88],
- ["EC7C",0x9B90],
- ["C06A",0x9B91],
- ["EC7B",0x9B92],
- ["EC7A",0x9B93],
- ["EC7E",0x9B95],
- ["EF6A",0x9B9A],
- ["EF6D",0x9B9B],
- ["EF6C",0x9B9E],
- ["EF74",0x9BA0],
- ["EF6F",0x9BA1],
- ["EF73",0x9BA2],
- ["EF71",0x9BA4],
- ["EF70",0x9BA5],
- ["EF6E",0x9BA6],
- ["EF6B",0x9BA8],
- ["C243",0x9BAA],
- ["C242",0x9BAB],
- ["C244",0x9BAD],
- ["C241",0x9BAE],
- ["EF75",0x9BAF],
- ["F1C8",0x9BB5],
- ["F1CB",0x9BB6],
- ["F1C9",0x9BB8],
- ["F1CD",0x9BB9],
- ["F1CE",0x9BBD],
- ["F1C6",0x9BBF],
- ["C358",0x9BC0],
- ["F1C7",0x9BC1],
- ["F1C5",0x9BC3],
- ["F1CC",0x9BC4],
- ["F1C4",0x9BC6],
- ["F1C3",0x9BC7],
- ["C357",0x9BC8],
- ["C355",0x9BC9],
- ["C354",0x9BCA],
- ["F1CA",0x9BD3],
- ["F3CF",0x9BD4],
- ["F3D5",0x9BD5],
- ["C44A",0x9BD6],
- ["F3D0",0x9BD7],
- ["F3D3",0x9BD9],
- ["F3D7",0x9BDA],
- ["C44B",0x9BDB],
- ["F3D2",0x9BDC],
- ["F3CA",0x9BDE],
- ["F3C9",0x9BE0],
- ["F3D6",0x9BE1],
- ["F3CD",0x9BE2],
- ["F3CB",0x9BE4],
- ["F3D4",0x9BE5],
- ["F3CC",0x9BE6],
- ["C449",0x9BE7],
- ["C448",0x9BE8],
- ["F3C7",0x9BEA],
- ["F3C8",0x9BEB],
- ["F3D1",0x9BEC],
- ["F3CE",0x9BF0],
- ["F56C",0x9BF7],
- ["F56F",0x9BF8],
- ["C356",0x9BFD],
- ["F56D",0x9C05],
- ["F573",0x9C06],
- ["F571",0x9C07],
- ["F56B",0x9C08],
- ["F576",0x9C09],
- ["F56A",0x9C0B],
- ["C4CF",0x9C0D],
- ["F572",0x9C0E],
- ["F56E",0x9C12],
- ["C4CE",0x9C13],
- ["F575",0x9C14],
- ["F574",0x9C17],
- ["F6AB",0x9C1C],
- ["F6AA",0x9C1D],
- ["F6B1",0x9C21],
- ["F6AD",0x9C23],
- ["F6B0",0x9C24],
- ["C560",0x9C25],
- ["F6AE",0x9C28],
- ["F6AF",0x9C29],
- ["F6A9",0x9C2B],
- ["F6AC",0x9C2C],
- ["C55F",0x9C2D],
- ["C5BF",0x9C31],
- ["F7B4",0x9C32],
- ["F7AF",0x9C33],
- ["F7B3",0x9C34],
- ["F7B6",0x9C36],
- ["F7B2",0x9C37],
- ["F7AE",0x9C39],
- ["C5C1",0x9C3B],
- ["F7B1",0x9C3C],
- ["F7B5",0x9C3D],
- ["C5C0",0x9C3E],
- ["F7AC",0x9C3F],
- ["F570",0x9C40],
- ["F7B0",0x9C41],
- ["F7AD",0x9C44],
- ["F7AA",0x9C46],
- ["F7AB",0x9C48],
- ["C5BE",0x9C49],
- ["F85A",0x9C4A],
- ["F85C",0x9C4B],
- ["F85F",0x9C4C],
- ["F85B",0x9C4D],
- ["F860",0x9C4E],
- ["F859",0x9C50],
- ["F857",0x9C52],
- ["C5EB",0x9C54],
- ["F85D",0x9C55],
- ["C5ED",0x9C56],
- ["C5EC",0x9C57],
- ["F858",0x9C58],
- ["F85E",0x9C59],
- ["F8DA",0x9C5E],
- ["C64D",0x9C5F],
- ["F8DB",0x9C60],
- ["F8D9",0x9C62],
- ["F8D6",0x9C63],
- ["F8D8",0x9C66],
- ["F8D7",0x9C67],
- ["F95A",0x9C68],
- ["F95C",0x9C6D],
- ["F95B",0x9C6E],
- ["F979",0x9C71],
- ["F978",0x9C73],
- ["F977",0x9C74],
- ["F97A",0x9C75],
- ["C673",0x9C77],
- ["C674",0x9C78],
- ["F9CA",0x9C79],
- ["F9CE",0x9C7A],
- ["B3BE",0x9CE5],
- ["DCAF",0x9CE6],
- ["E0ED",0x9CE7],
- ["B9A7",0x9CE9],
- ["E0EB",0x9CEA],
- ["E0EC",0x9CED],
- ["E4E2",0x9CF1],
- ["E4E3",0x9CF2],
- ["BBF1",0x9CF3],
- ["BBEF",0x9CF4],
- ["E4E4",0x9CF5],
- ["BBF0",0x9CF6],
- ["E8E8",0x9CF7],
- ["E8EB",0x9CF9],
- ["E8E5",0x9CFA],
- ["E8EC",0x9CFB],
- ["E8E4",0x9CFC],
- ["E8E6",0x9CFD],
- ["E8E7",0x9CFF],
- ["E8EA",0x9D00],
- ["BEA1",0x9D03],
- ["E8EF",0x9D04],
- ["E8EE",0x9D05],
- ["BE7D",0x9D06],
- ["E8E9",0x9D07],
- ["E8ED",0x9D08],
- ["BE7E",0x9D09],
- ["ECAC",0x9D10],
- ["C06F",0x9D12],
- ["ECA7",0x9D14],
- ["C06B",0x9D15],
- ["ECA4",0x9D17],
- ["ECAA",0x9D18],
- ["ECAD",0x9D19],
- ["C070",0x9D1B],
- ["ECA9",0x9D1D],
- ["ECA6",0x9D1E],
- ["ECAE",0x9D1F],
- ["ECA5",0x9D20],
- ["ECAB",0x9D22],
- ["C06C",0x9D23],
- ["ECA3",0x9D25],
- ["C06D",0x9D26],
- ["C06E",0x9D28],
- ["ECA8",0x9D29],
- ["EFA9",0x9D2D],
- ["EF7A",0x9D2E],
- ["EF7B",0x9D2F],
- ["EF7E",0x9D30],
- ["EF7C",0x9D31],
- ["EF76",0x9D33],
- ["EF79",0x9D36],
- ["EFA5",0x9D37],
- ["EF7D",0x9D38],
- ["C245",0x9D3B],
- ["EFA7",0x9D3D],
- ["EFA4",0x9D3E],
- ["C246",0x9D3F],
- ["EFA6",0x9D40],
- ["EF77",0x9D41],
- ["EFA2",0x9D42],
- ["EFA3",0x9D43],
- ["EFA1",0x9D45],
- ["F1D2",0x9D4A],
- ["F1D4",0x9D4B],
- ["F1D7",0x9D4C],
- ["F1D1",0x9D4F],
- ["C359",0x9D51],
- ["F1D9",0x9D52],
- ["F1D0",0x9D53],
- ["F1DA",0x9D54],
- ["F1D6",0x9D56],
- ["F1D8",0x9D57],
- ["F1DC",0x9D58],
- ["F1D5",0x9D59],
- ["F1DD",0x9D5A],
- ["F1D3",0x9D5B],
- ["F1CF",0x9D5C],
- ["C35A",0x9D5D],
- ["F1DB",0x9D5F],
- ["C35B",0x9D60],
- ["C44D",0x9D61],
- ["EF78",0x9D67],
- ["F3F1",0x9D68],
- ["F3E8",0x9D69],
- ["C44F",0x9D6A],
- ["F3E4",0x9D6B],
- ["C450",0x9D6C],
- ["F3ED",0x9D6F],
- ["F3E7",0x9D70],
- ["F3DD",0x9D71],
- ["C44E",0x9D72],
- ["F3EA",0x9D73],
- ["F3E5",0x9D74],
- ["F3E6",0x9D75],
- ["F3D8",0x9D77],
- ["F3DF",0x9D78],
- ["F3EE",0x9D79],
- ["F3EB",0x9D7B],
- ["F3E3",0x9D7D],
- ["F3EF",0x9D7F],
- ["F3DE",0x9D80],
- ["F3D9",0x9D81],
- ["F3EC",0x9D82],
- ["F3DB",0x9D84],
- ["F3E9",0x9D85],
- ["F3E0",0x9D86],
- ["F3F0",0x9D87],
- ["F3DC",0x9D88],
- ["C44C",0x9D89],
- ["F3DA",0x9D8A],
- ["F3E1",0x9D8B],
- ["F3E2",0x9D8C],
- ["F57D",0x9D90],
- ["F57B",0x9D92],
- ["F5A2",0x9D94],
- ["F5AE",0x9D96],
- ["F5A5",0x9D97],
- ["F57C",0x9D98],
- ["F578",0x9D99],
- ["F5A7",0x9D9A],
- ["F57E",0x9D9B],
- ["F5A3",0x9D9C],
- ["F57A",0x9D9D],
- ["F5AA",0x9D9E],
- ["F577",0x9D9F],
- ["F5A1",0x9DA0],
- ["F5A6",0x9DA1],
- ["F5A8",0x9DA2],
- ["F5AB",0x9DA3],
- ["F579",0x9DA4],
- ["F5AF",0x9DA6],
- ["F5B0",0x9DA7],
- ["F5A9",0x9DA8],
- ["F5AD",0x9DA9],
- ["F5A4",0x9DAA],
- ["F6C1",0x9DAC],
- ["F6C4",0x9DAD],
- ["C561",0x9DAF],
- ["F6C3",0x9DB1],
- ["F6C8",0x9DB2],
- ["F6C6",0x9DB3],
- ["C562",0x9DB4],
- ["F6BD",0x9DB5],
- ["F6B3",0x9DB6],
- ["F6B2",0x9DB7],
- ["C564",0x9DB8],
- ["F6BF",0x9DB9],
- ["F6C0",0x9DBA],
- ["F6BC",0x9DBB],
- ["F6B4",0x9DBC],
- ["F6B9",0x9DBE],
- ["F5AC",0x9DBF],
- ["F6B5",0x9DC1],
- ["C563",0x9DC2],
- ["F6BB",0x9DC3],
- ["F6BA",0x9DC5],
- ["F6B6",0x9DC7],
- ["F6C2",0x9DC8],
- ["F6B7",0x9DCA],
- ["F7BB",0x9DCB],
- ["F6C5",0x9DCC],
- ["F6C7",0x9DCD],
- ["F6BE",0x9DCE],
- ["F6B8",0x9DCF],
- ["F7BC",0x9DD0],
- ["F7BE",0x9DD1],
- ["F7B8",0x9DD2],
- ["C5C2",0x9DD3],
- ["F7C5",0x9DD5],
- ["F7C3",0x9DD6],
- ["C5C3",0x9DD7],
- ["F7C2",0x9DD8],
- ["F7C1",0x9DD9],
- ["F7BA",0x9DDA],
- ["F7B7",0x9DDB],
- ["F7BD",0x9DDC],
- ["F7C6",0x9DDD],
- ["F7B9",0x9DDE],
- ["F7BF",0x9DDF],
- ["F869",0x9DE1],
- ["F86E",0x9DE2],
- ["F864",0x9DE3],
- ["F867",0x9DE4],
- ["C5EE",0x9DE5],
- ["F86B",0x9DE6],
- ["F872",0x9DE8],
- ["F7C0",0x9DE9],
- ["F865",0x9DEB],
- ["F86F",0x9DEC],
- ["F873",0x9DED],
- ["F86A",0x9DEE],
- ["F863",0x9DEF],
- ["F86D",0x9DF0],
- ["F86C",0x9DF2],
- ["F871",0x9DF3],
- ["F870",0x9DF4],
- ["F7C4",0x9DF5],
- ["F868",0x9DF6],
- ["F862",0x9DF7],
- ["F866",0x9DF8],
- ["C64E",0x9DF9],
- ["C64F",0x9DFA],
- ["F861",0x9DFB],
- ["F8E6",0x9DFD],
- ["F8DD",0x9DFE],
- ["F8E5",0x9DFF],
- ["F8E2",0x9E00],
- ["F8E3",0x9E01],
- ["F8DC",0x9E02],
- ["F8DF",0x9E03],
- ["F8E7",0x9E04],
- ["F8E1",0x9E05],
- ["F8E0",0x9E06],
- ["F8DE",0x9E07],
- ["F8E4",0x9E09],
- ["F95D",0x9E0B],
- ["F95E",0x9E0D],
- ["F960",0x9E0F],
- ["F95F",0x9E10],
- ["F962",0x9E11],
- ["F961",0x9E12],
- ["F97C",0x9E13],
- ["F97B",0x9E14],
- ["F9B7",0x9E15],
- ["F9B8",0x9E17],
- ["F9C5",0x9E19],
- ["C678",0x9E1A],
- ["C67C",0x9E1B],
- ["F9CF",0x9E1D],
- ["C67D",0x9E1E],
- ["B3BF",0x9E75],
- ["C4D0",0x9E79],
- ["F6C9",0x9E7A],
- ["C650",0x9E7C],
- ["C651",0x9E7D],
- ["B3C0",0x9E7F],
- ["E0EE",0x9E80],
- ["B9A8",0x9E82],
- ["E8F0",0x9E83],
- ["ECB0",0x9E86],
- ["ECB1",0x9E87],
- ["ECAF",0x9E88],
- ["EFAB",0x9E89],
- ["EFAA",0x9E8A],
- ["C247",0x9E8B],
- ["F1DF",0x9E8C],
- ["EFAC",0x9E8D],
- ["F1DE",0x9E8E],
- ["F3F3",0x9E91],
- ["C451",0x9E92],
- ["C453",0x9E93],
- ["F3F2",0x9E94],
- ["C452",0x9E97],
- ["F5B1",0x9E99],
- ["F5B3",0x9E9A],
- ["F5B2",0x9E9B],
- ["F6CA",0x9E9C],
- ["C565",0x9E9D],
- ["C5EF",0x9E9F],
- ["F8E8",0x9EA0],
- ["F963",0x9EA1],
- ["F9D2",0x9EA4],
- ["B3C1",0x9EA5],
- ["E4E5",0x9EA7],
- ["BEA2",0x9EA9],
- ["ECB3",0x9EAD],
- ["ECB2",0x9EAE],
- ["EFAD",0x9EB0],
- ["C454",0x9EB4],
- ["C4D1",0x9EB5],
- ["F7C7",0x9EB6],
- ["F9CB",0x9EB7],
- ["B3C2",0x9EBB],
- ["BBF2",0x9EBC],
- ["BEA3",0x9EBE],
- ["F3F4",0x9EC0],
- ["F874",0x9EC2],
- ["B6C0",0x9EC3],
- ["EFAE",0x9EC8],
- ["C664",0x9ECC],
- ["B6C1",0x9ECD],
- ["BEA4",0x9ECE],
- ["C248",0x9ECF],
- ["F875",0x9ED0],
- ["B6C2",0x9ED1],
- ["E8F1",0x9ED3],
- ["C072",0x9ED4],
- ["ECB4",0x9ED5],
- ["ECB5",0x9ED6],
- ["C071",0x9ED8],
- ["EFAF",0x9EDA],
- ["C24C",0x9EDB],
- ["C24A",0x9EDC],
- ["C24B",0x9EDD],
- ["C249",0x9EDE],
- ["F1E0",0x9EDF],
- ["C35C",0x9EE0],
- ["F5B5",0x9EE4],
- ["F5B4",0x9EE5],
- ["F5B7",0x9EE6],
- ["F5B6",0x9EE7],
- ["C4D2",0x9EE8],
- ["F6CB",0x9EEB],
- ["F6CD",0x9EED],
- ["F6CC",0x9EEE],
- ["C566",0x9EEF],
- ["F7C8",0x9EF0],
- ["F876",0x9EF2],
- ["F877",0x9EF3],
- ["C5F0",0x9EF4],
- ["F964",0x9EF5],
- ["F97D",0x9EF6],
- ["C675",0x9EF7],
- ["DCB0",0x9EF9],
- ["ECB6",0x9EFA],
- ["EFB0",0x9EFB],
- ["F3F5",0x9EFC],
- ["E0EF",0x9EFD],
- ["EFB1",0x9EFF],
- ["F1E2",0x9F00],
- ["F1E1",0x9F01],
- ["F878",0x9F06],
- ["C652",0x9F07],
- ["F965",0x9F09],
- ["F97E",0x9F0A],
- ["B9A9",0x9F0E],
- ["E8F2",0x9F0F],
- ["E8F3",0x9F10],
- ["ECB7",0x9F12],
- ["B9AA",0x9F13],
- ["C35D",0x9F15],
- ["F1E3",0x9F16],
- ["F6CF",0x9F18],
- ["C567",0x9F19],
- ["F6D0",0x9F1A],
- ["F6CE",0x9F1B],
- ["F879",0x9F1C],
- ["F8E9",0x9F1E],
- ["B9AB",0x9F20],
- ["EFB4",0x9F22],
- ["EFB3",0x9F23],
- ["EFB2",0x9F24],
- ["F1E4",0x9F25],
- ["F1E8",0x9F28],
- ["F1E7",0x9F29],
- ["F1E6",0x9F2A],
- ["F1E5",0x9F2B],
- ["C35E",0x9F2C],
- ["F3F6",0x9F2D],
- ["F5B9",0x9F2E],
- ["C4D3",0x9F2F],
- ["F5B8",0x9F30],
- ["F6D1",0x9F31],
- ["F7CB",0x9F32],
- ["F7CA",0x9F33],
- ["C5C4",0x9F34],
- ["F7C9",0x9F35],
- ["F87C",0x9F36],
- ["F87B",0x9F37],
- ["F87A",0x9F38],
- ["BBF3",0x9F3B],
- ["ECB8",0x9F3D],
- ["C24D",0x9F3E],
- ["F3F7",0x9F40],
- ["F3F8",0x9F41],
- ["F7CC",0x9F42],
- ["F87D",0x9F43],
- ["F8EA",0x9F46],
- ["F966",0x9F47],
- ["F9B9",0x9F48],
- ["F9D4",0x9F49],
- ["BBF4",0x9F4A],
- ["C24E",0x9F4B],
- ["F1E9",0x9F4C],
- ["F3F9",0x9F4D],
- ["F6D2",0x9F4E],
- ["F87E",0x9F4F],
- ["BEA6",0x9F52],
- ["EFB5",0x9F54],
- ["F1EA",0x9F55],
- ["F3FA",0x9F56],
- ["F3FB",0x9F57],
- ["F3FC",0x9F58],
- ["F5BE",0x9F59],
- ["F5BA",0x9F5B],
- ["C568",0x9F5C],
- ["F5BD",0x9F5D],
- ["F5BC",0x9F5E],
- ["C4D4",0x9F5F],
- ["F5BB",0x9F60],
- ["C4D6",0x9F61],
- ["C4D5",0x9F63],
- ["F6D4",0x9F64],
- ["F6D3",0x9F65],
- ["C569",0x9F66],
- ["C56A",0x9F67],
- ["C5C6",0x9F6A],
- ["F7CD",0x9F6B],
- ["C5C5",0x9F6C],
- ["F8A3",0x9F6E],
- ["F8A4",0x9F6F],
- ["F8A2",0x9F70],
- ["F8A1",0x9F71],
- ["C654",0x9F72],
- ["F8EB",0x9F74],
- ["F8EC",0x9F75],
- ["F8ED",0x9F76],
- ["C653",0x9F77],
- ["F967",0x9F78],
- ["F96A",0x9F79],
- ["F969",0x9F7A],
- ["F968",0x9F7B],
- ["F9D3",0x9F7E],
- ["C073",0x9F8D],
- ["C365",0x9F90],
- ["F5BF",0x9F91],
- ["F6D5",0x9F92],
- ["C5C7",0x9F94],
- ["F7CE",0x9F95],
- ["F9D5",0x9F98],
- ["C074",0x9F9C],
- ["EFB6",0x9FA0],
- ["F7CF",0x9FA2],
- ["F9A1",0x9FA4],
- ["C94A",0xFA0C],
- ["DDFC",0xFA0D],
- ["A14A",0xFE30],
- ["A157",0xFE31],
- ["A159",0xFE33],
- ["A15B",0xFE34],
- ["A15F",0xFE35],
- ["A160",0xFE36],
- ["A163",0xFE37],
- ["A164",0xFE38],
- ["A167",0xFE39],
- ["A168",0xFE3A],
- ["A16B",0xFE3B],
- ["A16C",0xFE3C],
- ["A16F",0xFE3D],
- ["A170",0xFE3E],
- ["A173",0xFE3F],
- ["A174",0xFE40],
- ["A177",0xFE41],
- ["A178",0xFE42],
- ["A17B",0xFE43],
- ["A17C",0xFE44],
- ["A1C6",0xFE49],
- ["A1C7",0xFE4A],
- ["A1CA",0xFE4B],
- ["A1CB",0xFE4C],
- ["A1C8",0xFE4D],
- ["A1C9",0xFE4E],
- ["A15C",0xFE4F],
- ["A14D",0xFE50],
- ["A14F",0xFE52],
- ["A151",0xFE54],
- ["A152",0xFE55],
- ["A153",0xFE56],
- ["A154",0xFE57],
- ["A17D",0xFE59],
- ["A17E",0xFE5A],
- ["A1A1",0xFE5B],
- ["A1A2",0xFE5C],
- ["A1A3",0xFE5D],
- ["A1A4",0xFE5E],
- ["A1CC",0xFE5F],
- ["A1CD",0xFE60],
- ["A1CE",0xFE61],
- ["A1DE",0xFE62],
- ["A1DF",0xFE63],
- ["A1E0",0xFE64],
- ["A1E1",0xFE65],
- ["A1E2",0xFE66],
- ["A24C",0xFE69],
- ["A24D",0xFE6A],
- ["A24E",0xFE6B],
- ["A149",0xFF01],
- ["A1AD",0xFF03],
- ["A243",0xFF04],
- ["A248",0xFF05],
- ["A1AE",0xFF06],
- ["A15D",0xFF08],
- ["A15E",0xFF09],
- ["A1AF",0xFF0A],
- ["A1CF",0xFF0B],
- ["A141",0xFF0C],
- ["A1D0",0xFF0D],
- ["A144",0xFF0E],
- ["A241",0xFF0F],
- ["A2AF",0xFF10],
- ["A2B0",0xFF11],
- ["A2B1",0xFF12],
- ["A2B2",0xFF13],
- ["A2B3",0xFF14],
- ["A2B4",0xFF15],
- ["A2B5",0xFF16],
- ["A2B6",0xFF17],
- ["A2B7",0xFF18],
- ["A2B8",0xFF19],
- ["A147",0xFF1A],
- ["A146",0xFF1B],
- ["A1D5",0xFF1C],
- ["A1D7",0xFF1D],
- ["A1D6",0xFF1E],
- ["A148",0xFF1F],
- ["A249",0xFF20],
- ["A2CF",0xFF21],
- ["A2D0",0xFF22],
- ["A2D1",0xFF23],
- ["A2D2",0xFF24],
- ["A2D3",0xFF25],
- ["A2D4",0xFF26],
- ["A2D5",0xFF27],
- ["A2D6",0xFF28],
- ["A2D7",0xFF29],
- ["A2D8",0xFF2A],
- ["A2D9",0xFF2B],
- ["A2DA",0xFF2C],
- ["A2DB",0xFF2D],
- ["A2DC",0xFF2E],
- ["A2DD",0xFF2F],
- ["A2DE",0xFF30],
- ["A2DF",0xFF31],
- ["A2E0",0xFF32],
- ["A2E1",0xFF33],
- ["A2E2",0xFF34],
- ["A2E3",0xFF35],
- ["A2E4",0xFF36],
- ["A2E5",0xFF37],
- ["A2E6",0xFF38],
- ["A2E7",0xFF39],
- ["A2E8",0xFF3A],
- ["A242",0xFF3C],
- ["A1C4",0xFF3F],
- ["A2E9",0xFF41],
- ["A2EA",0xFF42],
- ["A2EB",0xFF43],
- ["A2EC",0xFF44],
- ["A2ED",0xFF45],
- ["A2EE",0xFF46],
- ["A2EF",0xFF47],
- ["A2F0",0xFF48],
- ["A2F1",0xFF49],
- ["A2F2",0xFF4A],
- ["A2F3",0xFF4B],
- ["A2F4",0xFF4C],
- ["A2F5",0xFF4D],
- ["A2F6",0xFF4E],
- ["A2F7",0xFF4F],
- ["A2F8",0xFF50],
- ["A2F9",0xFF51],
- ["A2FA",0xFF52],
- ["A2FB",0xFF53],
- ["A2FC",0xFF54],
- ["A2FD",0xFF55],
- ["A2FE",0xFF56],
- ["A340",0xFF57],
- ["A341",0xFF58],
- ["A342",0xFF59],
- ["A343",0xFF5A],
- ["A161",0xFF5B],
- ["A155",0xFF5C],
- ["A162",0xFF5D],
- ["A14E",0xFF64],
-] \ No newline at end of file
diff --git a/enc/trans/big5.trans b/enc/trans/big5.trans
deleted file mode 100644
index ba7bae53f9..0000000000
--- a/enc/trans/big5.trans
+++ /dev/null
@@ -1,16 +0,0 @@
-#include "transcode_data.h"
-
-<%
- require "big5-tbl"
-
- transcode_tblgen "Big5", "UTF-8", [["{00-7f}", :nomap], *BIG5_TO_UCS_TBL]
- transcode_tblgen "UTF-8", "Big5", [["{00-7f}", :nomap], *BIG5_TO_UCS_TBL.map {|a,b| [b,a] }]
-%>
-
-<%= transcode_generated_code %>
-
-void
-Init_big5(void)
-{
-<%= transcode_register_code %>
-} \ No newline at end of file
diff --git a/enc/trans/chinese.trans b/enc/trans/chinese.trans
deleted file mode 100644
index 1db6565254..0000000000
--- a/enc/trans/chinese.trans
+++ /dev/null
@@ -1,30 +0,0 @@
-#include "transcode_data.h"
-
-<%
- set_valid_byte_pattern 'GB2312', 'EUC-KR'
- set_valid_byte_pattern 'GB12345', 'EUC-KR'
-
- transcode_tblgen "GB2312", "UTF-8",
- [["{00-7f}", :nomap]] +
- citrus_decode_mapsrc("euc", 0x8080, "GB2312/UCS")
-
- transcode_tblgen "GB12345", "UTF-8",
- [["{00-7f}", :nomap]] +
- citrus_decode_mapsrc("euc", 0x8080, "GB12345/UCS")
-
- transcode_tblgen "UTF-8", "GB2312",
- [["{00-7f}", :nomap]] +
- citrus_decode_mapsrc("euc", 0x8080, "UCS/GB2312")
-
- transcode_tblgen "UTF-8", "GB12345",
- [["{00-7f}", :nomap]] +
- citrus_decode_mapsrc("euc", 0x8080, "UCS/GB12345")
-%>
-
-<%= transcode_generated_code %>
-
-void
-Init_chinese(void)
-{
-<%= transcode_register_code %>
-}
diff --git a/enc/trans/cp850-tbl.rb b/enc/trans/cp850-tbl.rb
deleted file mode 100644
index 615d3b2599..0000000000
--- a/enc/trans/cp850-tbl.rb
+++ /dev/null
@@ -1,130 +0,0 @@
-CP850_TO_UCS_TBL = [
- ["FF",0xA0],
- ["AD",0xA1],
- ["BD",0xA2],
- ["9C",0xA3],
- ["CF",0xA4],
- ["BE",0xA5],
- ["DD",0xA6],
- ["F5",0xA7],
- ["F9",0xA8],
- ["B8",0xA9],
- ["A6",0xAA],
- ["AE",0xAB],
- ["AA",0xAC],
- ["F0",0xAD],
- ["A9",0xAE],
- ["EE",0xAF],
- ["F8",0xB0],
- ["F1",0xB1],
- ["FD",0xB2],
- ["FC",0xB3],
- ["EF",0xB4],
- ["E6",0xB5],
- ["F4",0xB6],
- ["FA",0xB7],
- ["F7",0xB8],
- ["FB",0xB9],
- ["A7",0xBA],
- ["AF",0xBB],
- ["AC",0xBC],
- ["AB",0xBD],
- ["F3",0xBE],
- ["A8",0xBF],
- ["B7",0xC0],
- ["B5",0xC1],
- ["B6",0xC2],
- ["C7",0xC3],
- ["8E",0xC4],
- ["8F",0xC5],
- ["92",0xC6],
- ["80",0xC7],
- ["D4",0xC8],
- ["90",0xC9],
- ["D2",0xCA],
- ["D3",0xCB],
- ["DE",0xCC],
- ["D6",0xCD],
- ["D7",0xCE],
- ["D8",0xCF],
- ["D1",0xD0],
- ["A5",0xD1],
- ["E3",0xD2],
- ["E0",0xD3],
- ["E2",0xD4],
- ["E5",0xD5],
- ["99",0xD6],
- ["9E",0xD7],
- ["9D",0xD8],
- ["EB",0xD9],
- ["E9",0xDA],
- ["EA",0xDB],
- ["9A",0xDC],
- ["ED",0xDD],
- ["E8",0xDE],
- ["E1",0xDF],
- ["85",0xE0],
- ["A0",0xE1],
- ["83",0xE2],
- ["C6",0xE3],
- ["84",0xE4],
- ["86",0xE5],
- ["91",0xE6],
- ["87",0xE7],
- ["8A",0xE8],
- ["82",0xE9],
- ["88",0xEA],
- ["89",0xEB],
- ["8D",0xEC],
- ["A1",0xED],
- ["8C",0xEE],
- ["8B",0xEF],
- ["D0",0xF0],
- ["A4",0xF1],
- ["95",0xF2],
- ["A2",0xF3],
- ["93",0xF4],
- ["E4",0xF5],
- ["94",0xF6],
- ["F6",0xF7],
- ["9B",0xF8],
- ["97",0xF9],
- ["A3",0xFA],
- ["96",0xFB],
- ["81",0xFC],
- ["EC",0xFD],
- ["E7",0xFE],
- ["98",0xFF],
- ["D5",0x131],
- ["9F",0x192],
- ["F2",0x2017],
- ["C4",0x2500],
- ["B3",0x2502],
- ["DA",0x250C],
- ["BF",0x2510],
- ["C0",0x2514],
- ["D9",0x2518],
- ["C3",0x251C],
- ["B4",0x2524],
- ["C2",0x252C],
- ["C1",0x2534],
- ["C5",0x253C],
- ["CD",0x2550],
- ["BA",0x2551],
- ["C9",0x2554],
- ["BB",0x2557],
- ["C8",0x255A],
- ["BC",0x255D],
- ["CC",0x2560],
- ["B9",0x2563],
- ["CB",0x2566],
- ["CA",0x2569],
- ["CE",0x256C],
- ["DF",0x2580],
- ["DC",0x2584],
- ["DB",0x2588],
- ["B0",0x2591],
- ["B1",0x2592],
- ["B2",0x2593],
- ["FE",0x25A0],
-] \ No newline at end of file
diff --git a/enc/trans/cp852-tbl.rb b/enc/trans/cp852-tbl.rb
deleted file mode 100644
index 6763bfa6e9..0000000000
--- a/enc/trans/cp852-tbl.rb
+++ /dev/null
@@ -1,130 +0,0 @@
-CP852_TO_UCS_TBL = [
- ["FF",0xA0],
- ["CF",0xA4],
- ["F5",0xA7],
- ["F9",0xA8],
- ["AE",0xAB],
- ["AA",0xAC],
- ["F0",0xAD],
- ["F8",0xB0],
- ["EF",0xB4],
- ["F7",0xB8],
- ["AF",0xBB],
- ["B5",0xC1],
- ["B6",0xC2],
- ["8E",0xC4],
- ["80",0xC7],
- ["90",0xC9],
- ["D3",0xCB],
- ["D6",0xCD],
- ["D7",0xCE],
- ["E0",0xD3],
- ["E2",0xD4],
- ["99",0xD6],
- ["9E",0xD7],
- ["E9",0xDA],
- ["9A",0xDC],
- ["ED",0xDD],
- ["E1",0xDF],
- ["A0",0xE1],
- ["83",0xE2],
- ["84",0xE4],
- ["87",0xE7],
- ["82",0xE9],
- ["89",0xEB],
- ["A1",0xED],
- ["8C",0xEE],
- ["A2",0xF3],
- ["93",0xF4],
- ["94",0xF6],
- ["F6",0xF7],
- ["A3",0xFA],
- ["81",0xFC],
- ["EC",0xFD],
- ["C6",0x102],
- ["C7",0x103],
- ["A4",0x104],
- ["A5",0x105],
- ["8F",0x106],
- ["86",0x107],
- ["AC",0x10C],
- ["9F",0x10D],
- ["D2",0x10E],
- ["D4",0x10F],
- ["D1",0x110],
- ["D0",0x111],
- ["A8",0x118],
- ["A9",0x119],
- ["B7",0x11A],
- ["D8",0x11B],
- ["91",0x139],
- ["92",0x13A],
- ["95",0x13D],
- ["96",0x13E],
- ["9D",0x141],
- ["88",0x142],
- ["E3",0x143],
- ["E4",0x144],
- ["D5",0x147],
- ["E5",0x148],
- ["8A",0x150],
- ["8B",0x151],
- ["E8",0x154],
- ["EA",0x155],
- ["FC",0x158],
- ["FD",0x159],
- ["97",0x15A],
- ["98",0x15B],
- ["B8",0x15E],
- ["AD",0x15F],
- ["E6",0x160],
- ["E7",0x161],
- ["DD",0x162],
- ["EE",0x163],
- ["9B",0x164],
- ["9C",0x165],
- ["DE",0x16E],
- ["85",0x16F],
- ["EB",0x170],
- ["FB",0x171],
- ["8D",0x179],
- ["AB",0x17A],
- ["BD",0x17B],
- ["BE",0x17C],
- ["A6",0x17D],
- ["A7",0x17E],
- ["F3",0x2C7],
- ["F4",0x2D8],
- ["FA",0x2D9],
- ["F2",0x2DB],
- ["F1",0x2DD],
- ["C4",0x2500],
- ["B3",0x2502],
- ["DA",0x250C],
- ["BF",0x2510],
- ["C0",0x2514],
- ["D9",0x2518],
- ["C3",0x251C],
- ["B4",0x2524],
- ["C2",0x252C],
- ["C1",0x2534],
- ["C5",0x253C],
- ["CD",0x2550],
- ["BA",0x2551],
- ["C9",0x2554],
- ["BB",0x2557],
- ["C8",0x255A],
- ["BC",0x255D],
- ["CC",0x2560],
- ["B9",0x2563],
- ["CB",0x2566],
- ["CA",0x2569],
- ["CE",0x256C],
- ["DF",0x2580],
- ["DC",0x2584],
- ["DB",0x2588],
- ["B0",0x2591],
- ["B1",0x2592],
- ["B2",0x2593],
- ["FE",0x25A0],
-] \ No newline at end of file
diff --git a/enc/trans/cp855-tbl.rb b/enc/trans/cp855-tbl.rb
deleted file mode 100644
index 72e548b9cb..0000000000
--- a/enc/trans/cp855-tbl.rb
+++ /dev/null
@@ -1,130 +0,0 @@
-CP855_TO_UCS_TBL = [
- ["FF",0xA0],
- ["CF",0xA4],
- ["FD",0xA7],
- ["AE",0xAB],
- ["F0",0xAD],
- ["AF",0xBB],
- ["85",0x401],
- ["81",0x402],
- ["83",0x403],
- ["87",0x404],
- ["89",0x405],
- ["8B",0x406],
- ["8D",0x407],
- ["8F",0x408],
- ["91",0x409],
- ["93",0x40A],
- ["95",0x40B],
- ["97",0x40C],
- ["99",0x40E],
- ["9B",0x40F],
- ["A1",0x410],
- ["A3",0x411],
- ["EC",0x412],
- ["AD",0x413],
- ["A7",0x414],
- ["A9",0x415],
- ["EA",0x416],
- ["F4",0x417],
- ["B8",0x418],
- ["BE",0x419],
- ["C7",0x41A],
- ["D1",0x41B],
- ["D3",0x41C],
- ["D5",0x41D],
- ["D7",0x41E],
- ["DD",0x41F],
- ["E2",0x420],
- ["E4",0x421],
- ["E6",0x422],
- ["E8",0x423],
- ["AB",0x424],
- ["B6",0x425],
- ["A5",0x426],
- ["FC",0x427],
- ["F6",0x428],
- ["FA",0x429],
- ["9F",0x42A],
- ["F2",0x42B],
- ["EE",0x42C],
- ["F8",0x42D],
- ["9D",0x42E],
- ["E0",0x42F],
- ["A0",0x430],
- ["A2",0x431],
- ["EB",0x432],
- ["AC",0x433],
- ["A6",0x434],
- ["A8",0x435],
- ["E9",0x436],
- ["F3",0x437],
- ["B7",0x438],
- ["BD",0x439],
- ["C6",0x43A],
- ["D0",0x43B],
- ["D2",0x43C],
- ["D4",0x43D],
- ["D6",0x43E],
- ["D8",0x43F],
- ["E1",0x440],
- ["E3",0x441],
- ["E5",0x442],
- ["E7",0x443],
- ["AA",0x444],
- ["B5",0x445],
- ["A4",0x446],
- ["FB",0x447],
- ["F5",0x448],
- ["F9",0x449],
- ["9E",0x44A],
- ["F1",0x44B],
- ["ED",0x44C],
- ["F7",0x44D],
- ["9C",0x44E],
- ["DE",0x44F],
- ["84",0x451],
- ["80",0x452],
- ["82",0x453],
- ["86",0x454],
- ["88",0x455],
- ["8A",0x456],
- ["8C",0x457],
- ["8E",0x458],
- ["90",0x459],
- ["92",0x45A],
- ["94",0x45B],
- ["96",0x45C],
- ["98",0x45E],
- ["9A",0x45F],
- ["EF",0x2116],
- ["C4",0x2500],
- ["B3",0x2502],
- ["DA",0x250C],
- ["BF",0x2510],
- ["C0",0x2514],
- ["D9",0x2518],
- ["C3",0x251C],
- ["B4",0x2524],
- ["C2",0x252C],
- ["C1",0x2534],
- ["C5",0x253C],
- ["CD",0x2550],
- ["BA",0x2551],
- ["C9",0x2554],
- ["BB",0x2557],
- ["C8",0x255A],
- ["BC",0x255D],
- ["CC",0x2560],
- ["B9",0x2563],
- ["CB",0x2566],
- ["CA",0x2569],
- ["CE",0x256C],
- ["DF",0x2580],
- ["DC",0x2584],
- ["DB",0x2588],
- ["B0",0x2591],
- ["B1",0x2592],
- ["B2",0x2593],
- ["FE",0x25A0],
-] \ No newline at end of file
diff --git a/enc/trans/cp949-tbl.rb b/enc/trans/cp949-tbl.rb
deleted file mode 100644
index 0e47353850..0000000000
--- a/enc/trans/cp949-tbl.rb
+++ /dev/null
@@ -1,8831 +0,0 @@
-require 'euckr-tbl'
-
-CP949_TO_UCS_ADDITIONAL_TBL = [
- ["8141",0xAC02],
- ["8142",0xAC03],
- ["8143",0xAC05],
- ["8144",0xAC06],
- ["8145",0xAC0B],
- ["8146",0xAC0C],
- ["8147",0xAC0D],
- ["8148",0xAC0E],
- ["8149",0xAC0F],
- ["814A",0xAC18],
- ["814B",0xAC1E],
- ["814C",0xAC1F],
- ["814D",0xAC21],
- ["814E",0xAC22],
- ["814F",0xAC23],
- ["8150",0xAC25],
- ["8151",0xAC26],
- ["8152",0xAC27],
- ["8153",0xAC28],
- ["8154",0xAC29],
- ["8155",0xAC2A],
- ["8156",0xAC2B],
- ["8157",0xAC2E],
- ["8158",0xAC32],
- ["8159",0xAC33],
- ["815A",0xAC34],
- ["8161",0xAC35],
- ["8162",0xAC36],
- ["8163",0xAC37],
- ["8164",0xAC3A],
- ["8165",0xAC3B],
- ["8166",0xAC3D],
- ["8167",0xAC3E],
- ["8168",0xAC3F],
- ["8169",0xAC41],
- ["816A",0xAC42],
- ["816B",0xAC43],
- ["816C",0xAC44],
- ["816D",0xAC45],
- ["816E",0xAC46],
- ["816F",0xAC47],
- ["8170",0xAC48],
- ["8171",0xAC49],
- ["8172",0xAC4A],
- ["8173",0xAC4C],
- ["8174",0xAC4E],
- ["8175",0xAC4F],
- ["8176",0xAC50],
- ["8177",0xAC51],
- ["8178",0xAC52],
- ["8179",0xAC53],
- ["817A",0xAC55],
- ["8181",0xAC56],
- ["8182",0xAC57],
- ["8183",0xAC59],
- ["8184",0xAC5A],
- ["8185",0xAC5B],
- ["8186",0xAC5D],
- ["8187",0xAC5E],
- ["8188",0xAC5F],
- ["8189",0xAC60],
- ["818A",0xAC61],
- ["818B",0xAC62],
- ["818C",0xAC63],
- ["818D",0xAC64],
- ["818E",0xAC65],
- ["818F",0xAC66],
- ["8190",0xAC67],
- ["8191",0xAC68],
- ["8192",0xAC69],
- ["8193",0xAC6A],
- ["8194",0xAC6B],
- ["8195",0xAC6C],
- ["8196",0xAC6D],
- ["8197",0xAC6E],
- ["8198",0xAC6F],
- ["8199",0xAC72],
- ["819A",0xAC73],
- ["819B",0xAC75],
- ["819C",0xAC76],
- ["819D",0xAC79],
- ["819E",0xAC7B],
- ["819F",0xAC7C],
- ["81A0",0xAC7D],
- ["81A1",0xAC7E],
- ["81A2",0xAC7F],
- ["81A3",0xAC82],
- ["81A4",0xAC87],
- ["81A5",0xAC88],
- ["81A6",0xAC8D],
- ["81A7",0xAC8E],
- ["81A8",0xAC8F],
- ["81A9",0xAC91],
- ["81AA",0xAC92],
- ["81AB",0xAC93],
- ["81AC",0xAC95],
- ["81AD",0xAC96],
- ["81AE",0xAC97],
- ["81AF",0xAC98],
- ["81B0",0xAC99],
- ["81B1",0xAC9A],
- ["81B2",0xAC9B],
- ["81B3",0xAC9E],
- ["81B4",0xACA2],
- ["81B5",0xACA3],
- ["81B6",0xACA4],
- ["81B7",0xACA5],
- ["81B8",0xACA6],
- ["81B9",0xACA7],
- ["81BA",0xACAB],
- ["81BB",0xACAD],
- ["81BC",0xACAE],
- ["81BD",0xACB1],
- ["81BE",0xACB2],
- ["81BF",0xACB3],
- ["81C0",0xACB4],
- ["81C1",0xACB5],
- ["81C2",0xACB6],
- ["81C3",0xACB7],
- ["81C4",0xACBA],
- ["81C5",0xACBE],
- ["81C6",0xACBF],
- ["81C7",0xACC0],
- ["81C8",0xACC2],
- ["81C9",0xACC3],
- ["81CA",0xACC5],
- ["81CB",0xACC6],
- ["81CC",0xACC7],
- ["81CD",0xACC9],
- ["81CE",0xACCA],
- ["81CF",0xACCB],
- ["81D0",0xACCD],
- ["81D1",0xACCE],
- ["81D2",0xACCF],
- ["81D3",0xACD0],
- ["81D4",0xACD1],
- ["81D5",0xACD2],
- ["81D6",0xACD3],
- ["81D7",0xACD4],
- ["81D8",0xACD6],
- ["81D9",0xACD8],
- ["81DA",0xACD9],
- ["81DB",0xACDA],
- ["81DC",0xACDB],
- ["81DD",0xACDC],
- ["81DE",0xACDD],
- ["81DF",0xACDE],
- ["81E0",0xACDF],
- ["81E1",0xACE2],
- ["81E2",0xACE3],
- ["81E3",0xACE5],
- ["81E4",0xACE6],
- ["81E5",0xACE9],
- ["81E6",0xACEB],
- ["81E7",0xACED],
- ["81E8",0xACEE],
- ["81E9",0xACF2],
- ["81EA",0xACF4],
- ["81EB",0xACF7],
- ["81EC",0xACF8],
- ["81ED",0xACF9],
- ["81EE",0xACFA],
- ["81EF",0xACFB],
- ["81F0",0xACFE],
- ["81F1",0xACFF],
- ["81F2",0xAD01],
- ["81F3",0xAD02],
- ["81F4",0xAD03],
- ["81F5",0xAD05],
- ["81F6",0xAD07],
- ["81F7",0xAD08],
- ["81F8",0xAD09],
- ["81F9",0xAD0A],
- ["81FA",0xAD0B],
- ["81FB",0xAD0E],
- ["81FC",0xAD10],
- ["81FD",0xAD12],
- ["81FE",0xAD13],
- ["8241",0xAD14],
- ["8242",0xAD15],
- ["8243",0xAD16],
- ["8244",0xAD17],
- ["8245",0xAD19],
- ["8246",0xAD1A],
- ["8247",0xAD1B],
- ["8248",0xAD1D],
- ["8249",0xAD1E],
- ["824A",0xAD1F],
- ["824B",0xAD21],
- ["824C",0xAD22],
- ["824D",0xAD23],
- ["824E",0xAD24],
- ["824F",0xAD25],
- ["8250",0xAD26],
- ["8251",0xAD27],
- ["8252",0xAD28],
- ["8253",0xAD2A],
- ["8254",0xAD2B],
- ["8255",0xAD2E],
- ["8256",0xAD2F],
- ["8257",0xAD30],
- ["8258",0xAD31],
- ["8259",0xAD32],
- ["825A",0xAD33],
- ["8261",0xAD36],
- ["8262",0xAD37],
- ["8263",0xAD39],
- ["8264",0xAD3A],
- ["8265",0xAD3B],
- ["8266",0xAD3D],
- ["8267",0xAD3E],
- ["8268",0xAD3F],
- ["8269",0xAD40],
- ["826A",0xAD41],
- ["826B",0xAD42],
- ["826C",0xAD43],
- ["826D",0xAD46],
- ["826E",0xAD48],
- ["826F",0xAD4A],
- ["8270",0xAD4B],
- ["8271",0xAD4C],
- ["8272",0xAD4D],
- ["8273",0xAD4E],
- ["8274",0xAD4F],
- ["8275",0xAD51],
- ["8276",0xAD52],
- ["8277",0xAD53],
- ["8278",0xAD55],
- ["8279",0xAD56],
- ["827A",0xAD57],
- ["8281",0xAD59],
- ["8282",0xAD5A],
- ["8283",0xAD5B],
- ["8284",0xAD5C],
- ["8285",0xAD5D],
- ["8286",0xAD5E],
- ["8287",0xAD5F],
- ["8288",0xAD60],
- ["8289",0xAD62],
- ["828A",0xAD64],
- ["828B",0xAD65],
- ["828C",0xAD66],
- ["828D",0xAD67],
- ["828E",0xAD68],
- ["828F",0xAD69],
- ["8290",0xAD6A],
- ["8291",0xAD6B],
- ["8292",0xAD6E],
- ["8293",0xAD6F],
- ["8294",0xAD71],
- ["8295",0xAD72],
- ["8296",0xAD77],
- ["8297",0xAD78],
- ["8298",0xAD79],
- ["8299",0xAD7A],
- ["829A",0xAD7E],
- ["829B",0xAD80],
- ["829C",0xAD83],
- ["829D",0xAD84],
- ["829E",0xAD85],
- ["829F",0xAD86],
- ["82A0",0xAD87],
- ["82A1",0xAD8A],
- ["82A2",0xAD8B],
- ["82A3",0xAD8D],
- ["82A4",0xAD8E],
- ["82A5",0xAD8F],
- ["82A6",0xAD91],
- ["82A7",0xAD92],
- ["82A8",0xAD93],
- ["82A9",0xAD94],
- ["82AA",0xAD95],
- ["82AB",0xAD96],
- ["82AC",0xAD97],
- ["82AD",0xAD98],
- ["82AE",0xAD99],
- ["82AF",0xAD9A],
- ["82B0",0xAD9B],
- ["82B1",0xAD9E],
- ["82B2",0xAD9F],
- ["82B3",0xADA0],
- ["82B4",0xADA1],
- ["82B5",0xADA2],
- ["82B6",0xADA3],
- ["82B7",0xADA5],
- ["82B8",0xADA6],
- ["82B9",0xADA7],
- ["82BA",0xADA8],
- ["82BB",0xADA9],
- ["82BC",0xADAA],
- ["82BD",0xADAB],
- ["82BE",0xADAC],
- ["82BF",0xADAD],
- ["82C0",0xADAE],
- ["82C1",0xADAF],
- ["82C2",0xADB0],
- ["82C3",0xADB1],
- ["82C4",0xADB2],
- ["82C5",0xADB3],
- ["82C6",0xADB4],
- ["82C7",0xADB5],
- ["82C8",0xADB6],
- ["82C9",0xADB8],
- ["82CA",0xADB9],
- ["82CB",0xADBA],
- ["82CC",0xADBB],
- ["82CD",0xADBC],
- ["82CE",0xADBD],
- ["82CF",0xADBE],
- ["82D0",0xADBF],
- ["82D1",0xADC2],
- ["82D2",0xADC3],
- ["82D3",0xADC5],
- ["82D4",0xADC6],
- ["82D5",0xADC7],
- ["82D6",0xADC9],
- ["82D7",0xADCA],
- ["82D8",0xADCB],
- ["82D9",0xADCC],
- ["82DA",0xADCD],
- ["82DB",0xADCE],
- ["82DC",0xADCF],
- ["82DD",0xADD2],
- ["82DE",0xADD4],
- ["82DF",0xADD5],
- ["82E0",0xADD6],
- ["82E1",0xADD7],
- ["82E2",0xADD8],
- ["82E3",0xADD9],
- ["82E4",0xADDA],
- ["82E5",0xADDB],
- ["82E6",0xADDD],
- ["82E7",0xADDE],
- ["82E8",0xADDF],
- ["82E9",0xADE1],
- ["82EA",0xADE2],
- ["82EB",0xADE3],
- ["82EC",0xADE5],
- ["82ED",0xADE6],
- ["82EE",0xADE7],
- ["82EF",0xADE8],
- ["82F0",0xADE9],
- ["82F1",0xADEA],
- ["82F2",0xADEB],
- ["82F3",0xADEC],
- ["82F4",0xADED],
- ["82F5",0xADEE],
- ["82F6",0xADEF],
- ["82F7",0xADF0],
- ["82F8",0xADF1],
- ["82F9",0xADF2],
- ["82FA",0xADF3],
- ["82FB",0xADF4],
- ["82FC",0xADF5],
- ["82FD",0xADF6],
- ["82FE",0xADF7],
- ["8341",0xADFA],
- ["8342",0xADFB],
- ["8343",0xADFD],
- ["8344",0xADFE],
- ["8345",0xAE02],
- ["8346",0xAE03],
- ["8347",0xAE04],
- ["8348",0xAE05],
- ["8349",0xAE06],
- ["834A",0xAE07],
- ["834B",0xAE0A],
- ["834C",0xAE0C],
- ["834D",0xAE0E],
- ["834E",0xAE0F],
- ["834F",0xAE10],
- ["8350",0xAE11],
- ["8351",0xAE12],
- ["8352",0xAE13],
- ["8353",0xAE15],
- ["8354",0xAE16],
- ["8355",0xAE17],
- ["8356",0xAE18],
- ["8357",0xAE19],
- ["8358",0xAE1A],
- ["8359",0xAE1B],
- ["835A",0xAE1C],
- ["8361",0xAE1D],
- ["8362",0xAE1E],
- ["8363",0xAE1F],
- ["8364",0xAE20],
- ["8365",0xAE21],
- ["8366",0xAE22],
- ["8367",0xAE23],
- ["8368",0xAE24],
- ["8369",0xAE25],
- ["836A",0xAE26],
- ["836B",0xAE27],
- ["836C",0xAE28],
- ["836D",0xAE29],
- ["836E",0xAE2A],
- ["836F",0xAE2B],
- ["8370",0xAE2C],
- ["8371",0xAE2D],
- ["8372",0xAE2E],
- ["8373",0xAE2F],
- ["8374",0xAE32],
- ["8375",0xAE33],
- ["8376",0xAE35],
- ["8377",0xAE36],
- ["8378",0xAE39],
- ["8379",0xAE3B],
- ["837A",0xAE3C],
- ["8381",0xAE3D],
- ["8382",0xAE3E],
- ["8383",0xAE3F],
- ["8384",0xAE42],
- ["8385",0xAE44],
- ["8386",0xAE47],
- ["8387",0xAE48],
- ["8388",0xAE49],
- ["8389",0xAE4B],
- ["838A",0xAE4F],
- ["838B",0xAE51],
- ["838C",0xAE52],
- ["838D",0xAE53],
- ["838E",0xAE55],
- ["838F",0xAE57],
- ["8390",0xAE58],
- ["8391",0xAE59],
- ["8392",0xAE5A],
- ["8393",0xAE5B],
- ["8394",0xAE5E],
- ["8395",0xAE62],
- ["8396",0xAE63],
- ["8397",0xAE64],
- ["8398",0xAE66],
- ["8399",0xAE67],
- ["839A",0xAE6A],
- ["839B",0xAE6B],
- ["839C",0xAE6D],
- ["839D",0xAE6E],
- ["839E",0xAE6F],
- ["839F",0xAE71],
- ["83A0",0xAE72],
- ["83A1",0xAE73],
- ["83A2",0xAE74],
- ["83A3",0xAE75],
- ["83A4",0xAE76],
- ["83A5",0xAE77],
- ["83A6",0xAE7A],
- ["83A7",0xAE7E],
- ["83A8",0xAE7F],
- ["83A9",0xAE80],
- ["83AA",0xAE81],
- ["83AB",0xAE82],
- ["83AC",0xAE83],
- ["83AD",0xAE86],
- ["83AE",0xAE87],
- ["83AF",0xAE88],
- ["83B0",0xAE89],
- ["83B1",0xAE8A],
- ["83B2",0xAE8B],
- ["83B3",0xAE8D],
- ["83B4",0xAE8E],
- ["83B5",0xAE8F],
- ["83B6",0xAE90],
- ["83B7",0xAE91],
- ["83B8",0xAE92],
- ["83B9",0xAE93],
- ["83BA",0xAE94],
- ["83BB",0xAE95],
- ["83BC",0xAE96],
- ["83BD",0xAE97],
- ["83BE",0xAE98],
- ["83BF",0xAE99],
- ["83C0",0xAE9A],
- ["83C1",0xAE9B],
- ["83C2",0xAE9C],
- ["83C3",0xAE9D],
- ["83C4",0xAE9E],
- ["83C5",0xAE9F],
- ["83C6",0xAEA0],
- ["83C7",0xAEA1],
- ["83C8",0xAEA2],
- ["83C9",0xAEA3],
- ["83CA",0xAEA4],
- ["83CB",0xAEA5],
- ["83CC",0xAEA6],
- ["83CD",0xAEA7],
- ["83CE",0xAEA8],
- ["83CF",0xAEA9],
- ["83D0",0xAEAA],
- ["83D1",0xAEAB],
- ["83D2",0xAEAC],
- ["83D3",0xAEAD],
- ["83D4",0xAEAE],
- ["83D5",0xAEAF],
- ["83D6",0xAEB0],
- ["83D7",0xAEB1],
- ["83D8",0xAEB2],
- ["83D9",0xAEB3],
- ["83DA",0xAEB4],
- ["83DB",0xAEB5],
- ["83DC",0xAEB6],
- ["83DD",0xAEB7],
- ["83DE",0xAEB8],
- ["83DF",0xAEB9],
- ["83E0",0xAEBA],
- ["83E1",0xAEBB],
- ["83E2",0xAEBF],
- ["83E3",0xAEC1],
- ["83E4",0xAEC2],
- ["83E5",0xAEC3],
- ["83E6",0xAEC5],
- ["83E7",0xAEC6],
- ["83E8",0xAEC7],
- ["83E9",0xAEC8],
- ["83EA",0xAEC9],
- ["83EB",0xAECA],
- ["83EC",0xAECB],
- ["83ED",0xAECE],
- ["83EE",0xAED2],
- ["83EF",0xAED3],
- ["83F0",0xAED4],
- ["83F1",0xAED5],
- ["83F2",0xAED6],
- ["83F3",0xAED7],
- ["83F4",0xAEDA],
- ["83F5",0xAEDB],
- ["83F6",0xAEDD],
- ["83F7",0xAEDE],
- ["83F8",0xAEDF],
- ["83F9",0xAEE0],
- ["83FA",0xAEE1],
- ["83FB",0xAEE2],
- ["83FC",0xAEE3],
- ["83FD",0xAEE4],
- ["83FE",0xAEE5],
- ["8441",0xAEE6],
- ["8442",0xAEE7],
- ["8443",0xAEE9],
- ["8444",0xAEEA],
- ["8445",0xAEEC],
- ["8446",0xAEEE],
- ["8447",0xAEEF],
- ["8448",0xAEF0],
- ["8449",0xAEF1],
- ["844A",0xAEF2],
- ["844B",0xAEF3],
- ["844C",0xAEF5],
- ["844D",0xAEF6],
- ["844E",0xAEF7],
- ["844F",0xAEF9],
- ["8450",0xAEFA],
- ["8451",0xAEFB],
- ["8452",0xAEFD],
- ["8453",0xAEFE],
- ["8454",0xAEFF],
- ["8455",0xAF00],
- ["8456",0xAF01],
- ["8457",0xAF02],
- ["8458",0xAF03],
- ["8459",0xAF04],
- ["845A",0xAF05],
- ["8461",0xAF06],
- ["8462",0xAF09],
- ["8463",0xAF0A],
- ["8464",0xAF0B],
- ["8465",0xAF0C],
- ["8466",0xAF0E],
- ["8467",0xAF0F],
- ["8468",0xAF11],
- ["8469",0xAF12],
- ["846A",0xAF13],
- ["846B",0xAF14],
- ["846C",0xAF15],
- ["846D",0xAF16],
- ["846E",0xAF17],
- ["846F",0xAF18],
- ["8470",0xAF19],
- ["8471",0xAF1A],
- ["8472",0xAF1B],
- ["8473",0xAF1C],
- ["8474",0xAF1D],
- ["8475",0xAF1E],
- ["8476",0xAF1F],
- ["8477",0xAF20],
- ["8478",0xAF21],
- ["8479",0xAF22],
- ["847A",0xAF23],
- ["8481",0xAF24],
- ["8482",0xAF25],
- ["8483",0xAF26],
- ["8484",0xAF27],
- ["8485",0xAF28],
- ["8486",0xAF29],
- ["8487",0xAF2A],
- ["8488",0xAF2B],
- ["8489",0xAF2E],
- ["848A",0xAF2F],
- ["848B",0xAF31],
- ["848C",0xAF33],
- ["848D",0xAF35],
- ["848E",0xAF36],
- ["848F",0xAF37],
- ["8490",0xAF38],
- ["8491",0xAF39],
- ["8492",0xAF3A],
- ["8493",0xAF3B],
- ["8494",0xAF3E],
- ["8495",0xAF40],
- ["8496",0xAF44],
- ["8497",0xAF45],
- ["8498",0xAF46],
- ["8499",0xAF47],
- ["849A",0xAF4A],
- ["849B",0xAF4B],
- ["849C",0xAF4C],
- ["849D",0xAF4D],
- ["849E",0xAF4E],
- ["849F",0xAF4F],
- ["84A0",0xAF51],
- ["84A1",0xAF52],
- ["84A2",0xAF53],
- ["84A3",0xAF54],
- ["84A4",0xAF55],
- ["84A5",0xAF56],
- ["84A6",0xAF57],
- ["84A7",0xAF58],
- ["84A8",0xAF59],
- ["84A9",0xAF5A],
- ["84AA",0xAF5B],
- ["84AB",0xAF5E],
- ["84AC",0xAF5F],
- ["84AD",0xAF60],
- ["84AE",0xAF61],
- ["84AF",0xAF62],
- ["84B0",0xAF63],
- ["84B1",0xAF66],
- ["84B2",0xAF67],
- ["84B3",0xAF68],
- ["84B4",0xAF69],
- ["84B5",0xAF6A],
- ["84B6",0xAF6B],
- ["84B7",0xAF6C],
- ["84B8",0xAF6D],
- ["84B9",0xAF6E],
- ["84BA",0xAF6F],
- ["84BB",0xAF70],
- ["84BC",0xAF71],
- ["84BD",0xAF72],
- ["84BE",0xAF73],
- ["84BF",0xAF74],
- ["84C0",0xAF75],
- ["84C1",0xAF76],
- ["84C2",0xAF77],
- ["84C3",0xAF78],
- ["84C4",0xAF7A],
- ["84C5",0xAF7B],
- ["84C6",0xAF7C],
- ["84C7",0xAF7D],
- ["84C8",0xAF7E],
- ["84C9",0xAF7F],
- ["84CA",0xAF81],
- ["84CB",0xAF82],
- ["84CC",0xAF83],
- ["84CD",0xAF85],
- ["84CE",0xAF86],
- ["84CF",0xAF87],
- ["84D0",0xAF89],
- ["84D1",0xAF8A],
- ["84D2",0xAF8B],
- ["84D3",0xAF8C],
- ["84D4",0xAF8D],
- ["84D5",0xAF8E],
- ["84D6",0xAF8F],
- ["84D7",0xAF92],
- ["84D8",0xAF93],
- ["84D9",0xAF94],
- ["84DA",0xAF96],
- ["84DB",0xAF97],
- ["84DC",0xAF98],
- ["84DD",0xAF99],
- ["84DE",0xAF9A],
- ["84DF",0xAF9B],
- ["84E0",0xAF9D],
- ["84E1",0xAF9E],
- ["84E2",0xAF9F],
- ["84E3",0xAFA0],
- ["84E4",0xAFA1],
- ["84E5",0xAFA2],
- ["84E6",0xAFA3],
- ["84E7",0xAFA4],
- ["84E8",0xAFA5],
- ["84E9",0xAFA6],
- ["84EA",0xAFA7],
- ["84EB",0xAFA8],
- ["84EC",0xAFA9],
- ["84ED",0xAFAA],
- ["84EE",0xAFAB],
- ["84EF",0xAFAC],
- ["84F0",0xAFAD],
- ["84F1",0xAFAE],
- ["84F2",0xAFAF],
- ["84F3",0xAFB0],
- ["84F4",0xAFB1],
- ["84F5",0xAFB2],
- ["84F6",0xAFB3],
- ["84F7",0xAFB4],
- ["84F8",0xAFB5],
- ["84F9",0xAFB6],
- ["84FA",0xAFB7],
- ["84FB",0xAFBA],
- ["84FC",0xAFBB],
- ["84FD",0xAFBD],
- ["84FE",0xAFBE],
- ["8541",0xAFBF],
- ["8542",0xAFC1],
- ["8543",0xAFC2],
- ["8544",0xAFC3],
- ["8545",0xAFC4],
- ["8546",0xAFC5],
- ["8547",0xAFC6],
- ["8548",0xAFCA],
- ["8549",0xAFCC],
- ["854A",0xAFCF],
- ["854B",0xAFD0],
- ["854C",0xAFD1],
- ["854D",0xAFD2],
- ["854E",0xAFD3],
- ["854F",0xAFD5],
- ["8550",0xAFD6],
- ["8551",0xAFD7],
- ["8552",0xAFD8],
- ["8553",0xAFD9],
- ["8554",0xAFDA],
- ["8555",0xAFDB],
- ["8556",0xAFDD],
- ["8557",0xAFDE],
- ["8558",0xAFDF],
- ["8559",0xAFE0],
- ["855A",0xAFE1],
- ["8561",0xAFE2],
- ["8562",0xAFE3],
- ["8563",0xAFE4],
- ["8564",0xAFE5],
- ["8565",0xAFE6],
- ["8566",0xAFE7],
- ["8567",0xAFEA],
- ["8568",0xAFEB],
- ["8569",0xAFEC],
- ["856A",0xAFED],
- ["856B",0xAFEE],
- ["856C",0xAFEF],
- ["856D",0xAFF2],
- ["856E",0xAFF3],
- ["856F",0xAFF5],
- ["8570",0xAFF6],
- ["8571",0xAFF7],
- ["8572",0xAFF9],
- ["8573",0xAFFA],
- ["8574",0xAFFB],
- ["8575",0xAFFC],
- ["8576",0xAFFD],
- ["8577",0xAFFE],
- ["8578",0xAFFF],
- ["8579",0xB002],
- ["857A",0xB003],
- ["8581",0xB005],
- ["8582",0xB006],
- ["8583",0xB007],
- ["8584",0xB008],
- ["8585",0xB009],
- ["8586",0xB00A],
- ["8587",0xB00B],
- ["8588",0xB00D],
- ["8589",0xB00E],
- ["858A",0xB00F],
- ["858B",0xB011],
- ["858C",0xB012],
- ["858D",0xB013],
- ["858E",0xB015],
- ["858F",0xB016],
- ["8590",0xB017],
- ["8591",0xB018],
- ["8592",0xB019],
- ["8593",0xB01A],
- ["8594",0xB01B],
- ["8595",0xB01E],
- ["8596",0xB01F],
- ["8597",0xB020],
- ["8598",0xB021],
- ["8599",0xB022],
- ["859A",0xB023],
- ["859B",0xB024],
- ["859C",0xB025],
- ["859D",0xB026],
- ["859E",0xB027],
- ["859F",0xB029],
- ["85A0",0xB02A],
- ["85A1",0xB02B],
- ["85A2",0xB02C],
- ["85A3",0xB02D],
- ["85A4",0xB02E],
- ["85A5",0xB02F],
- ["85A6",0xB030],
- ["85A7",0xB031],
- ["85A8",0xB032],
- ["85A9",0xB033],
- ["85AA",0xB034],
- ["85AB",0xB035],
- ["85AC",0xB036],
- ["85AD",0xB037],
- ["85AE",0xB038],
- ["85AF",0xB039],
- ["85B0",0xB03A],
- ["85B1",0xB03B],
- ["85B2",0xB03C],
- ["85B3",0xB03D],
- ["85B4",0xB03E],
- ["85B5",0xB03F],
- ["85B6",0xB040],
- ["85B7",0xB041],
- ["85B8",0xB042],
- ["85B9",0xB043],
- ["85BA",0xB046],
- ["85BB",0xB047],
- ["85BC",0xB049],
- ["85BD",0xB04B],
- ["85BE",0xB04D],
- ["85BF",0xB04F],
- ["85C0",0xB050],
- ["85C1",0xB051],
- ["85C2",0xB052],
- ["85C3",0xB056],
- ["85C4",0xB058],
- ["85C5",0xB05A],
- ["85C6",0xB05B],
- ["85C7",0xB05C],
- ["85C8",0xB05E],
- ["85C9",0xB05F],
- ["85CA",0xB060],
- ["85CB",0xB061],
- ["85CC",0xB062],
- ["85CD",0xB063],
- ["85CE",0xB064],
- ["85CF",0xB065],
- ["85D0",0xB066],
- ["85D1",0xB067],
- ["85D2",0xB068],
- ["85D3",0xB069],
- ["85D4",0xB06A],
- ["85D5",0xB06B],
- ["85D6",0xB06C],
- ["85D7",0xB06D],
- ["85D8",0xB06E],
- ["85D9",0xB06F],
- ["85DA",0xB070],
- ["85DB",0xB071],
- ["85DC",0xB072],
- ["85DD",0xB073],
- ["85DE",0xB074],
- ["85DF",0xB075],
- ["85E0",0xB076],
- ["85E1",0xB077],
- ["85E2",0xB078],
- ["85E3",0xB079],
- ["85E4",0xB07A],
- ["85E5",0xB07B],
- ["85E6",0xB07E],
- ["85E7",0xB07F],
- ["85E8",0xB081],
- ["85E9",0xB082],
- ["85EA",0xB083],
- ["85EB",0xB085],
- ["85EC",0xB086],
- ["85ED",0xB087],
- ["85EE",0xB088],
- ["85EF",0xB089],
- ["85F0",0xB08A],
- ["85F1",0xB08B],
- ["85F2",0xB08E],
- ["85F3",0xB090],
- ["85F4",0xB092],
- ["85F5",0xB093],
- ["85F6",0xB094],
- ["85F7",0xB095],
- ["85F8",0xB096],
- ["85F9",0xB097],
- ["85FA",0xB09B],
- ["85FB",0xB09D],
- ["85FC",0xB09E],
- ["85FD",0xB0A3],
- ["85FE",0xB0A4],
- ["8641",0xB0A5],
- ["8642",0xB0A6],
- ["8643",0xB0A7],
- ["8644",0xB0AA],
- ["8645",0xB0B0],
- ["8646",0xB0B2],
- ["8647",0xB0B6],
- ["8648",0xB0B7],
- ["8649",0xB0B9],
- ["864A",0xB0BA],
- ["864B",0xB0BB],
- ["864C",0xB0BD],
- ["864D",0xB0BE],
- ["864E",0xB0BF],
- ["864F",0xB0C0],
- ["8650",0xB0C1],
- ["8651",0xB0C2],
- ["8652",0xB0C3],
- ["8653",0xB0C6],
- ["8654",0xB0CA],
- ["8655",0xB0CB],
- ["8656",0xB0CC],
- ["8657",0xB0CD],
- ["8658",0xB0CE],
- ["8659",0xB0CF],
- ["865A",0xB0D2],
- ["8661",0xB0D3],
- ["8662",0xB0D5],
- ["8663",0xB0D6],
- ["8664",0xB0D7],
- ["8665",0xB0D9],
- ["8666",0xB0DA],
- ["8667",0xB0DB],
- ["8668",0xB0DC],
- ["8669",0xB0DD],
- ["866A",0xB0DE],
- ["866B",0xB0DF],
- ["866C",0xB0E1],
- ["866D",0xB0E2],
- ["866E",0xB0E3],
- ["866F",0xB0E4],
- ["8670",0xB0E6],
- ["8671",0xB0E7],
- ["8672",0xB0E8],
- ["8673",0xB0E9],
- ["8674",0xB0EA],
- ["8675",0xB0EB],
- ["8676",0xB0EC],
- ["8677",0xB0ED],
- ["8678",0xB0EE],
- ["8679",0xB0EF],
- ["867A",0xB0F0],
- ["8681",0xB0F1],
- ["8682",0xB0F2],
- ["8683",0xB0F3],
- ["8684",0xB0F4],
- ["8685",0xB0F5],
- ["8686",0xB0F6],
- ["8687",0xB0F7],
- ["8688",0xB0F8],
- ["8689",0xB0F9],
- ["868A",0xB0FA],
- ["868B",0xB0FB],
- ["868C",0xB0FC],
- ["868D",0xB0FD],
- ["868E",0xB0FE],
- ["868F",0xB0FF],
- ["8690",0xB100],
- ["8691",0xB101],
- ["8692",0xB102],
- ["8693",0xB103],
- ["8694",0xB104],
- ["8695",0xB105],
- ["8696",0xB106],
- ["8697",0xB107],
- ["8698",0xB10A],
- ["8699",0xB10D],
- ["869A",0xB10E],
- ["869B",0xB10F],
- ["869C",0xB111],
- ["869D",0xB114],
- ["869E",0xB115],
- ["869F",0xB116],
- ["86A0",0xB117],
- ["86A1",0xB11A],
- ["86A2",0xB11E],
- ["86A3",0xB11F],
- ["86A4",0xB120],
- ["86A5",0xB121],
- ["86A6",0xB122],
- ["86A7",0xB126],
- ["86A8",0xB127],
- ["86A9",0xB129],
- ["86AA",0xB12A],
- ["86AB",0xB12B],
- ["86AC",0xB12D],
- ["86AD",0xB12E],
- ["86AE",0xB12F],
- ["86AF",0xB130],
- ["86B0",0xB131],
- ["86B1",0xB132],
- ["86B2",0xB133],
- ["86B3",0xB136],
- ["86B4",0xB13A],
- ["86B5",0xB13B],
- ["86B6",0xB13C],
- ["86B7",0xB13D],
- ["86B8",0xB13E],
- ["86B9",0xB13F],
- ["86BA",0xB142],
- ["86BB",0xB143],
- ["86BC",0xB145],
- ["86BD",0xB146],
- ["86BE",0xB147],
- ["86BF",0xB149],
- ["86C0",0xB14A],
- ["86C1",0xB14B],
- ["86C2",0xB14C],
- ["86C3",0xB14D],
- ["86C4",0xB14E],
- ["86C5",0xB14F],
- ["86C6",0xB152],
- ["86C7",0xB153],
- ["86C8",0xB156],
- ["86C9",0xB157],
- ["86CA",0xB159],
- ["86CB",0xB15A],
- ["86CC",0xB15B],
- ["86CD",0xB15D],
- ["86CE",0xB15E],
- ["86CF",0xB15F],
- ["86D0",0xB161],
- ["86D1",0xB162],
- ["86D2",0xB163],
- ["86D3",0xB164],
- ["86D4",0xB165],
- ["86D5",0xB166],
- ["86D6",0xB167],
- ["86D7",0xB168],
- ["86D8",0xB169],
- ["86D9",0xB16A],
- ["86DA",0xB16B],
- ["86DB",0xB16C],
- ["86DC",0xB16D],
- ["86DD",0xB16E],
- ["86DE",0xB16F],
- ["86DF",0xB170],
- ["86E0",0xB171],
- ["86E1",0xB172],
- ["86E2",0xB173],
- ["86E3",0xB174],
- ["86E4",0xB175],
- ["86E5",0xB176],
- ["86E6",0xB177],
- ["86E7",0xB17A],
- ["86E8",0xB17B],
- ["86E9",0xB17D],
- ["86EA",0xB17E],
- ["86EB",0xB17F],
- ["86EC",0xB181],
- ["86ED",0xB183],
- ["86EE",0xB184],
- ["86EF",0xB185],
- ["86F0",0xB186],
- ["86F1",0xB187],
- ["86F2",0xB18A],
- ["86F3",0xB18C],
- ["86F4",0xB18E],
- ["86F5",0xB18F],
- ["86F6",0xB190],
- ["86F7",0xB191],
- ["86F8",0xB195],
- ["86F9",0xB196],
- ["86FA",0xB197],
- ["86FB",0xB199],
- ["86FC",0xB19A],
- ["86FD",0xB19B],
- ["86FE",0xB19D],
- ["8741",0xB19E],
- ["8742",0xB19F],
- ["8743",0xB1A0],
- ["8744",0xB1A1],
- ["8745",0xB1A2],
- ["8746",0xB1A3],
- ["8747",0xB1A4],
- ["8748",0xB1A5],
- ["8749",0xB1A6],
- ["874A",0xB1A7],
- ["874B",0xB1A9],
- ["874C",0xB1AA],
- ["874D",0xB1AB],
- ["874E",0xB1AC],
- ["874F",0xB1AD],
- ["8750",0xB1AE],
- ["8751",0xB1AF],
- ["8752",0xB1B0],
- ["8753",0xB1B1],
- ["8754",0xB1B2],
- ["8755",0xB1B3],
- ["8756",0xB1B4],
- ["8757",0xB1B5],
- ["8758",0xB1B6],
- ["8759",0xB1B7],
- ["875A",0xB1B8],
- ["8761",0xB1B9],
- ["8762",0xB1BA],
- ["8763",0xB1BB],
- ["8764",0xB1BC],
- ["8765",0xB1BD],
- ["8766",0xB1BE],
- ["8767",0xB1BF],
- ["8768",0xB1C0],
- ["8769",0xB1C1],
- ["876A",0xB1C2],
- ["876B",0xB1C3],
- ["876C",0xB1C4],
- ["876D",0xB1C5],
- ["876E",0xB1C6],
- ["876F",0xB1C7],
- ["8770",0xB1C8],
- ["8771",0xB1C9],
- ["8772",0xB1CA],
- ["8773",0xB1CB],
- ["8774",0xB1CD],
- ["8775",0xB1CE],
- ["8776",0xB1CF],
- ["8777",0xB1D1],
- ["8778",0xB1D2],
- ["8779",0xB1D3],
- ["877A",0xB1D5],
- ["8781",0xB1D6],
- ["8782",0xB1D7],
- ["8783",0xB1D8],
- ["8784",0xB1D9],
- ["8785",0xB1DA],
- ["8786",0xB1DB],
- ["8787",0xB1DE],
- ["8788",0xB1E0],
- ["8789",0xB1E1],
- ["878A",0xB1E2],
- ["878B",0xB1E3],
- ["878C",0xB1E4],
- ["878D",0xB1E5],
- ["878E",0xB1E6],
- ["878F",0xB1E7],
- ["8790",0xB1EA],
- ["8791",0xB1EB],
- ["8792",0xB1ED],
- ["8793",0xB1EE],
- ["8794",0xB1EF],
- ["8795",0xB1F1],
- ["8796",0xB1F2],
- ["8797",0xB1F3],
- ["8798",0xB1F4],
- ["8799",0xB1F5],
- ["879A",0xB1F6],
- ["879B",0xB1F7],
- ["879C",0xB1F8],
- ["879D",0xB1FA],
- ["879E",0xB1FC],
- ["879F",0xB1FE],
- ["87A0",0xB1FF],
- ["87A1",0xB200],
- ["87A2",0xB201],
- ["87A3",0xB202],
- ["87A4",0xB203],
- ["87A5",0xB206],
- ["87A6",0xB207],
- ["87A7",0xB209],
- ["87A8",0xB20A],
- ["87A9",0xB20D],
- ["87AA",0xB20E],
- ["87AB",0xB20F],
- ["87AC",0xB210],
- ["87AD",0xB211],
- ["87AE",0xB212],
- ["87AF",0xB213],
- ["87B0",0xB216],
- ["87B1",0xB218],
- ["87B2",0xB21A],
- ["87B3",0xB21B],
- ["87B4",0xB21C],
- ["87B5",0xB21D],
- ["87B6",0xB21E],
- ["87B7",0xB21F],
- ["87B8",0xB221],
- ["87B9",0xB222],
- ["87BA",0xB223],
- ["87BB",0xB224],
- ["87BC",0xB225],
- ["87BD",0xB226],
- ["87BE",0xB227],
- ["87BF",0xB228],
- ["87C0",0xB229],
- ["87C1",0xB22A],
- ["87C2",0xB22B],
- ["87C3",0xB22C],
- ["87C4",0xB22D],
- ["87C5",0xB22E],
- ["87C6",0xB22F],
- ["87C7",0xB230],
- ["87C8",0xB231],
- ["87C9",0xB232],
- ["87CA",0xB233],
- ["87CB",0xB235],
- ["87CC",0xB236],
- ["87CD",0xB237],
- ["87CE",0xB238],
- ["87CF",0xB239],
- ["87D0",0xB23A],
- ["87D1",0xB23B],
- ["87D2",0xB23D],
- ["87D3",0xB23E],
- ["87D4",0xB23F],
- ["87D5",0xB240],
- ["87D6",0xB241],
- ["87D7",0xB242],
- ["87D8",0xB243],
- ["87D9",0xB244],
- ["87DA",0xB245],
- ["87DB",0xB246],
- ["87DC",0xB247],
- ["87DD",0xB248],
- ["87DE",0xB249],
- ["87DF",0xB24A],
- ["87E0",0xB24B],
- ["87E1",0xB24C],
- ["87E2",0xB24D],
- ["87E3",0xB24E],
- ["87E4",0xB24F],
- ["87E5",0xB250],
- ["87E6",0xB251],
- ["87E7",0xB252],
- ["87E8",0xB253],
- ["87E9",0xB254],
- ["87EA",0xB255],
- ["87EB",0xB256],
- ["87EC",0xB257],
- ["87ED",0xB259],
- ["87EE",0xB25A],
- ["87EF",0xB25B],
- ["87F0",0xB25D],
- ["87F1",0xB25E],
- ["87F2",0xB25F],
- ["87F3",0xB261],
- ["87F4",0xB262],
- ["87F5",0xB263],
- ["87F6",0xB264],
- ["87F7",0xB265],
- ["87F8",0xB266],
- ["87F9",0xB267],
- ["87FA",0xB26A],
- ["87FB",0xB26B],
- ["87FC",0xB26C],
- ["87FD",0xB26D],
- ["87FE",0xB26E],
- ["8841",0xB26F],
- ["8842",0xB270],
- ["8843",0xB271],
- ["8844",0xB272],
- ["8845",0xB273],
- ["8846",0xB276],
- ["8847",0xB277],
- ["8848",0xB278],
- ["8849",0xB279],
- ["884A",0xB27A],
- ["884B",0xB27B],
- ["884C",0xB27D],
- ["884D",0xB27E],
- ["884E",0xB27F],
- ["884F",0xB280],
- ["8850",0xB281],
- ["8851",0xB282],
- ["8852",0xB283],
- ["8853",0xB286],
- ["8854",0xB287],
- ["8855",0xB288],
- ["8856",0xB28A],
- ["8857",0xB28B],
- ["8858",0xB28C],
- ["8859",0xB28D],
- ["885A",0xB28E],
- ["8861",0xB28F],
- ["8862",0xB292],
- ["8863",0xB293],
- ["8864",0xB295],
- ["8865",0xB296],
- ["8866",0xB297],
- ["8867",0xB29B],
- ["8868",0xB29C],
- ["8869",0xB29D],
- ["886A",0xB29E],
- ["886B",0xB29F],
- ["886C",0xB2A2],
- ["886D",0xB2A4],
- ["886E",0xB2A7],
- ["886F",0xB2A8],
- ["8870",0xB2A9],
- ["8871",0xB2AB],
- ["8872",0xB2AD],
- ["8873",0xB2AE],
- ["8874",0xB2AF],
- ["8875",0xB2B1],
- ["8876",0xB2B2],
- ["8877",0xB2B3],
- ["8878",0xB2B5],
- ["8879",0xB2B6],
- ["887A",0xB2B7],
- ["8881",0xB2B8],
- ["8882",0xB2B9],
- ["8883",0xB2BA],
- ["8884",0xB2BB],
- ["8885",0xB2BC],
- ["8886",0xB2BD],
- ["8887",0xB2BE],
- ["8888",0xB2BF],
- ["8889",0xB2C0],
- ["888A",0xB2C1],
- ["888B",0xB2C2],
- ["888C",0xB2C3],
- ["888D",0xB2C4],
- ["888E",0xB2C5],
- ["888F",0xB2C6],
- ["8890",0xB2C7],
- ["8891",0xB2CA],
- ["8892",0xB2CB],
- ["8893",0xB2CD],
- ["8894",0xB2CE],
- ["8895",0xB2CF],
- ["8896",0xB2D1],
- ["8897",0xB2D3],
- ["8898",0xB2D4],
- ["8899",0xB2D5],
- ["889A",0xB2D6],
- ["889B",0xB2D7],
- ["889C",0xB2DA],
- ["889D",0xB2DC],
- ["889E",0xB2DE],
- ["889F",0xB2DF],
- ["88A0",0xB2E0],
- ["88A1",0xB2E1],
- ["88A2",0xB2E3],
- ["88A3",0xB2E7],
- ["88A4",0xB2E9],
- ["88A5",0xB2EA],
- ["88A6",0xB2F0],
- ["88A7",0xB2F1],
- ["88A8",0xB2F2],
- ["88A9",0xB2F6],
- ["88AA",0xB2FC],
- ["88AB",0xB2FD],
- ["88AC",0xB2FE],
- ["88AD",0xB302],
- ["88AE",0xB303],
- ["88AF",0xB305],
- ["88B0",0xB306],
- ["88B1",0xB307],
- ["88B2",0xB309],
- ["88B3",0xB30A],
- ["88B4",0xB30B],
- ["88B5",0xB30C],
- ["88B6",0xB30D],
- ["88B7",0xB30E],
- ["88B8",0xB30F],
- ["88B9",0xB312],
- ["88BA",0xB316],
- ["88BB",0xB317],
- ["88BC",0xB318],
- ["88BD",0xB319],
- ["88BE",0xB31A],
- ["88BF",0xB31B],
- ["88C0",0xB31D],
- ["88C1",0xB31E],
- ["88C2",0xB31F],
- ["88C3",0xB320],
- ["88C4",0xB321],
- ["88C5",0xB322],
- ["88C6",0xB323],
- ["88C7",0xB324],
- ["88C8",0xB325],
- ["88C9",0xB326],
- ["88CA",0xB327],
- ["88CB",0xB328],
- ["88CC",0xB329],
- ["88CD",0xB32A],
- ["88CE",0xB32B],
- ["88CF",0xB32C],
- ["88D0",0xB32D],
- ["88D1",0xB32E],
- ["88D2",0xB32F],
- ["88D3",0xB330],
- ["88D4",0xB331],
- ["88D5",0xB332],
- ["88D6",0xB333],
- ["88D7",0xB334],
- ["88D8",0xB335],
- ["88D9",0xB336],
- ["88DA",0xB337],
- ["88DB",0xB338],
- ["88DC",0xB339],
- ["88DD",0xB33A],
- ["88DE",0xB33B],
- ["88DF",0xB33C],
- ["88E0",0xB33D],
- ["88E1",0xB33E],
- ["88E2",0xB33F],
- ["88E3",0xB340],
- ["88E4",0xB341],
- ["88E5",0xB342],
- ["88E6",0xB343],
- ["88E7",0xB344],
- ["88E8",0xB345],
- ["88E9",0xB346],
- ["88EA",0xB347],
- ["88EB",0xB348],
- ["88EC",0xB349],
- ["88ED",0xB34A],
- ["88EE",0xB34B],
- ["88EF",0xB34C],
- ["88F0",0xB34D],
- ["88F1",0xB34E],
- ["88F2",0xB34F],
- ["88F3",0xB350],
- ["88F4",0xB351],
- ["88F5",0xB352],
- ["88F6",0xB353],
- ["88F7",0xB357],
- ["88F8",0xB359],
- ["88F9",0xB35A],
- ["88FA",0xB35D],
- ["88FB",0xB360],
- ["88FC",0xB361],
- ["88FD",0xB362],
- ["88FE",0xB363],
- ["8941",0xB366],
- ["8942",0xB368],
- ["8943",0xB36A],
- ["8944",0xB36C],
- ["8945",0xB36D],
- ["8946",0xB36F],
- ["8947",0xB372],
- ["8948",0xB373],
- ["8949",0xB375],
- ["894A",0xB376],
- ["894B",0xB377],
- ["894C",0xB379],
- ["894D",0xB37A],
- ["894E",0xB37B],
- ["894F",0xB37C],
- ["8950",0xB37D],
- ["8951",0xB37E],
- ["8952",0xB37F],
- ["8953",0xB382],
- ["8954",0xB386],
- ["8955",0xB387],
- ["8956",0xB388],
- ["8957",0xB389],
- ["8958",0xB38A],
- ["8959",0xB38B],
- ["895A",0xB38D],
- ["8961",0xB38E],
- ["8962",0xB38F],
- ["8963",0xB391],
- ["8964",0xB392],
- ["8965",0xB393],
- ["8966",0xB395],
- ["8967",0xB396],
- ["8968",0xB397],
- ["8969",0xB398],
- ["896A",0xB399],
- ["896B",0xB39A],
- ["896C",0xB39B],
- ["896D",0xB39C],
- ["896E",0xB39D],
- ["896F",0xB39E],
- ["8970",0xB39F],
- ["8971",0xB3A2],
- ["8972",0xB3A3],
- ["8973",0xB3A4],
- ["8974",0xB3A5],
- ["8975",0xB3A6],
- ["8976",0xB3A7],
- ["8977",0xB3A9],
- ["8978",0xB3AA],
- ["8979",0xB3AB],
- ["897A",0xB3AD],
- ["8981",0xB3AE],
- ["8982",0xB3AF],
- ["8983",0xB3B0],
- ["8984",0xB3B1],
- ["8985",0xB3B2],
- ["8986",0xB3B3],
- ["8987",0xB3B4],
- ["8988",0xB3B5],
- ["8989",0xB3B6],
- ["898A",0xB3B7],
- ["898B",0xB3B8],
- ["898C",0xB3B9],
- ["898D",0xB3BA],
- ["898E",0xB3BB],
- ["898F",0xB3BC],
- ["8990",0xB3BD],
- ["8991",0xB3BE],
- ["8992",0xB3BF],
- ["8993",0xB3C0],
- ["8994",0xB3C1],
- ["8995",0xB3C2],
- ["8996",0xB3C3],
- ["8997",0xB3C6],
- ["8998",0xB3C7],
- ["8999",0xB3C9],
- ["899A",0xB3CA],
- ["899B",0xB3CD],
- ["899C",0xB3CF],
- ["899D",0xB3D1],
- ["899E",0xB3D2],
- ["899F",0xB3D3],
- ["89A0",0xB3D6],
- ["89A1",0xB3D8],
- ["89A2",0xB3DA],
- ["89A3",0xB3DC],
- ["89A4",0xB3DE],
- ["89A5",0xB3DF],
- ["89A6",0xB3E1],
- ["89A7",0xB3E2],
- ["89A8",0xB3E3],
- ["89A9",0xB3E5],
- ["89AA",0xB3E6],
- ["89AB",0xB3E7],
- ["89AC",0xB3E9],
- ["89AD",0xB3EA],
- ["89AE",0xB3EB],
- ["89AF",0xB3EC],
- ["89B0",0xB3ED],
- ["89B1",0xB3EE],
- ["89B2",0xB3EF],
- ["89B3",0xB3F0],
- ["89B4",0xB3F1],
- ["89B5",0xB3F2],
- ["89B6",0xB3F3],
- ["89B7",0xB3F4],
- ["89B8",0xB3F5],
- ["89B9",0xB3F6],
- ["89BA",0xB3F7],
- ["89BB",0xB3F8],
- ["89BC",0xB3F9],
- ["89BD",0xB3FA],
- ["89BE",0xB3FB],
- ["89BF",0xB3FD],
- ["89C0",0xB3FE],
- ["89C1",0xB3FF],
- ["89C2",0xB400],
- ["89C3",0xB401],
- ["89C4",0xB402],
- ["89C5",0xB403],
- ["89C6",0xB404],
- ["89C7",0xB405],
- ["89C8",0xB406],
- ["89C9",0xB407],
- ["89CA",0xB408],
- ["89CB",0xB409],
- ["89CC",0xB40A],
- ["89CD",0xB40B],
- ["89CE",0xB40C],
- ["89CF",0xB40D],
- ["89D0",0xB40E],
- ["89D1",0xB40F],
- ["89D2",0xB411],
- ["89D3",0xB412],
- ["89D4",0xB413],
- ["89D5",0xB414],
- ["89D6",0xB415],
- ["89D7",0xB416],
- ["89D8",0xB417],
- ["89D9",0xB419],
- ["89DA",0xB41A],
- ["89DB",0xB41B],
- ["89DC",0xB41D],
- ["89DD",0xB41E],
- ["89DE",0xB41F],
- ["89DF",0xB421],
- ["89E0",0xB422],
- ["89E1",0xB423],
- ["89E2",0xB424],
- ["89E3",0xB425],
- ["89E4",0xB426],
- ["89E5",0xB427],
- ["89E6",0xB42A],
- ["89E7",0xB42C],
- ["89E8",0xB42D],
- ["89E9",0xB42E],
- ["89EA",0xB42F],
- ["89EB",0xB430],
- ["89EC",0xB431],
- ["89ED",0xB432],
- ["89EE",0xB433],
- ["89EF",0xB435],
- ["89F0",0xB436],
- ["89F1",0xB437],
- ["89F2",0xB438],
- ["89F3",0xB439],
- ["89F4",0xB43A],
- ["89F5",0xB43B],
- ["89F6",0xB43C],
- ["89F7",0xB43D],
- ["89F8",0xB43E],
- ["89F9",0xB43F],
- ["89FA",0xB440],
- ["89FB",0xB441],
- ["89FC",0xB442],
- ["89FD",0xB443],
- ["89FE",0xB444],
- ["8A41",0xB445],
- ["8A42",0xB446],
- ["8A43",0xB447],
- ["8A44",0xB448],
- ["8A45",0xB449],
- ["8A46",0xB44A],
- ["8A47",0xB44B],
- ["8A48",0xB44C],
- ["8A49",0xB44D],
- ["8A4A",0xB44E],
- ["8A4B",0xB44F],
- ["8A4C",0xB452],
- ["8A4D",0xB453],
- ["8A4E",0xB455],
- ["8A4F",0xB456],
- ["8A50",0xB457],
- ["8A51",0xB459],
- ["8A52",0xB45A],
- ["8A53",0xB45B],
- ["8A54",0xB45C],
- ["8A55",0xB45D],
- ["8A56",0xB45E],
- ["8A57",0xB45F],
- ["8A58",0xB462],
- ["8A59",0xB464],
- ["8A5A",0xB466],
- ["8A61",0xB467],
- ["8A62",0xB468],
- ["8A63",0xB469],
- ["8A64",0xB46A],
- ["8A65",0xB46B],
- ["8A66",0xB46D],
- ["8A67",0xB46E],
- ["8A68",0xB46F],
- ["8A69",0xB470],
- ["8A6A",0xB471],
- ["8A6B",0xB472],
- ["8A6C",0xB473],
- ["8A6D",0xB474],
- ["8A6E",0xB475],
- ["8A6F",0xB476],
- ["8A70",0xB477],
- ["8A71",0xB478],
- ["8A72",0xB479],
- ["8A73",0xB47A],
- ["8A74",0xB47B],
- ["8A75",0xB47C],
- ["8A76",0xB47D],
- ["8A77",0xB47E],
- ["8A78",0xB47F],
- ["8A79",0xB481],
- ["8A7A",0xB482],
- ["8A81",0xB483],
- ["8A82",0xB484],
- ["8A83",0xB485],
- ["8A84",0xB486],
- ["8A85",0xB487],
- ["8A86",0xB489],
- ["8A87",0xB48A],
- ["8A88",0xB48B],
- ["8A89",0xB48C],
- ["8A8A",0xB48D],
- ["8A8B",0xB48E],
- ["8A8C",0xB48F],
- ["8A8D",0xB490],
- ["8A8E",0xB491],
- ["8A8F",0xB492],
- ["8A90",0xB493],
- ["8A91",0xB494],
- ["8A92",0xB495],
- ["8A93",0xB496],
- ["8A94",0xB497],
- ["8A95",0xB498],
- ["8A96",0xB499],
- ["8A97",0xB49A],
- ["8A98",0xB49B],
- ["8A99",0xB49C],
- ["8A9A",0xB49E],
- ["8A9B",0xB49F],
- ["8A9C",0xB4A0],
- ["8A9D",0xB4A1],
- ["8A9E",0xB4A2],
- ["8A9F",0xB4A3],
- ["8AA0",0xB4A5],
- ["8AA1",0xB4A6],
- ["8AA2",0xB4A7],
- ["8AA3",0xB4A9],
- ["8AA4",0xB4AA],
- ["8AA5",0xB4AB],
- ["8AA6",0xB4AD],
- ["8AA7",0xB4AE],
- ["8AA8",0xB4AF],
- ["8AA9",0xB4B0],
- ["8AAA",0xB4B1],
- ["8AAB",0xB4B2],
- ["8AAC",0xB4B3],
- ["8AAD",0xB4B4],
- ["8AAE",0xB4B6],
- ["8AAF",0xB4B8],
- ["8AB0",0xB4BA],
- ["8AB1",0xB4BB],
- ["8AB2",0xB4BC],
- ["8AB3",0xB4BD],
- ["8AB4",0xB4BE],
- ["8AB5",0xB4BF],
- ["8AB6",0xB4C1],
- ["8AB7",0xB4C2],
- ["8AB8",0xB4C3],
- ["8AB9",0xB4C5],
- ["8ABA",0xB4C6],
- ["8ABB",0xB4C7],
- ["8ABC",0xB4C9],
- ["8ABD",0xB4CA],
- ["8ABE",0xB4CB],
- ["8ABF",0xB4CC],
- ["8AC0",0xB4CD],
- ["8AC1",0xB4CE],
- ["8AC2",0xB4CF],
- ["8AC3",0xB4D1],
- ["8AC4",0xB4D2],
- ["8AC5",0xB4D3],
- ["8AC6",0xB4D4],
- ["8AC7",0xB4D6],
- ["8AC8",0xB4D7],
- ["8AC9",0xB4D8],
- ["8ACA",0xB4D9],
- ["8ACB",0xB4DA],
- ["8ACC",0xB4DB],
- ["8ACD",0xB4DE],
- ["8ACE",0xB4DF],
- ["8ACF",0xB4E1],
- ["8AD0",0xB4E2],
- ["8AD1",0xB4E5],
- ["8AD2",0xB4E7],
- ["8AD3",0xB4E8],
- ["8AD4",0xB4E9],
- ["8AD5",0xB4EA],
- ["8AD6",0xB4EB],
- ["8AD7",0xB4EE],
- ["8AD8",0xB4F0],
- ["8AD9",0xB4F2],
- ["8ADA",0xB4F3],
- ["8ADB",0xB4F4],
- ["8ADC",0xB4F5],
- ["8ADD",0xB4F6],
- ["8ADE",0xB4F7],
- ["8ADF",0xB4F9],
- ["8AE0",0xB4FA],
- ["8AE1",0xB4FB],
- ["8AE2",0xB4FC],
- ["8AE3",0xB4FD],
- ["8AE4",0xB4FE],
- ["8AE5",0xB4FF],
- ["8AE6",0xB500],
- ["8AE7",0xB501],
- ["8AE8",0xB502],
- ["8AE9",0xB503],
- ["8AEA",0xB504],
- ["8AEB",0xB505],
- ["8AEC",0xB506],
- ["8AED",0xB507],
- ["8AEE",0xB508],
- ["8AEF",0xB509],
- ["8AF0",0xB50A],
- ["8AF1",0xB50B],
- ["8AF2",0xB50C],
- ["8AF3",0xB50D],
- ["8AF4",0xB50E],
- ["8AF5",0xB50F],
- ["8AF6",0xB510],
- ["8AF7",0xB511],
- ["8AF8",0xB512],
- ["8AF9",0xB513],
- ["8AFA",0xB516],
- ["8AFB",0xB517],
- ["8AFC",0xB519],
- ["8AFD",0xB51A],
- ["8AFE",0xB51D],
- ["8B41",0xB51E],
- ["8B42",0xB51F],
- ["8B43",0xB520],
- ["8B44",0xB521],
- ["8B45",0xB522],
- ["8B46",0xB523],
- ["8B47",0xB526],
- ["8B48",0xB52B],
- ["8B49",0xB52C],
- ["8B4A",0xB52D],
- ["8B4B",0xB52E],
- ["8B4C",0xB52F],
- ["8B4D",0xB532],
- ["8B4E",0xB533],
- ["8B4F",0xB535],
- ["8B50",0xB536],
- ["8B51",0xB537],
- ["8B52",0xB539],
- ["8B53",0xB53A],
- ["8B54",0xB53B],
- ["8B55",0xB53C],
- ["8B56",0xB53D],
- ["8B57",0xB53E],
- ["8B58",0xB53F],
- ["8B59",0xB542],
- ["8B5A",0xB546],
- ["8B61",0xB547],
- ["8B62",0xB548],
- ["8B63",0xB549],
- ["8B64",0xB54A],
- ["8B65",0xB54E],
- ["8B66",0xB54F],
- ["8B67",0xB551],
- ["8B68",0xB552],
- ["8B69",0xB553],
- ["8B6A",0xB555],
- ["8B6B",0xB556],
- ["8B6C",0xB557],
- ["8B6D",0xB558],
- ["8B6E",0xB559],
- ["8B6F",0xB55A],
- ["8B70",0xB55B],
- ["8B71",0xB55E],
- ["8B72",0xB562],
- ["8B73",0xB563],
- ["8B74",0xB564],
- ["8B75",0xB565],
- ["8B76",0xB566],
- ["8B77",0xB567],
- ["8B78",0xB568],
- ["8B79",0xB569],
- ["8B7A",0xB56A],
- ["8B81",0xB56B],
- ["8B82",0xB56C],
- ["8B83",0xB56D],
- ["8B84",0xB56E],
- ["8B85",0xB56F],
- ["8B86",0xB570],
- ["8B87",0xB571],
- ["8B88",0xB572],
- ["8B89",0xB573],
- ["8B8A",0xB574],
- ["8B8B",0xB575],
- ["8B8C",0xB576],
- ["8B8D",0xB577],
- ["8B8E",0xB578],
- ["8B8F",0xB579],
- ["8B90",0xB57A],
- ["8B91",0xB57B],
- ["8B92",0xB57C],
- ["8B93",0xB57D],
- ["8B94",0xB57E],
- ["8B95",0xB57F],
- ["8B96",0xB580],
- ["8B97",0xB581],
- ["8B98",0xB582],
- ["8B99",0xB583],
- ["8B9A",0xB584],
- ["8B9B",0xB585],
- ["8B9C",0xB586],
- ["8B9D",0xB587],
- ["8B9E",0xB588],
- ["8B9F",0xB589],
- ["8BA0",0xB58A],
- ["8BA1",0xB58B],
- ["8BA2",0xB58C],
- ["8BA3",0xB58D],
- ["8BA4",0xB58E],
- ["8BA5",0xB58F],
- ["8BA6",0xB590],
- ["8BA7",0xB591],
- ["8BA8",0xB592],
- ["8BA9",0xB593],
- ["8BAA",0xB594],
- ["8BAB",0xB595],
- ["8BAC",0xB596],
- ["8BAD",0xB597],
- ["8BAE",0xB598],
- ["8BAF",0xB599],
- ["8BB0",0xB59A],
- ["8BB1",0xB59B],
- ["8BB2",0xB59C],
- ["8BB3",0xB59D],
- ["8BB4",0xB59E],
- ["8BB5",0xB59F],
- ["8BB6",0xB5A2],
- ["8BB7",0xB5A3],
- ["8BB8",0xB5A5],
- ["8BB9",0xB5A6],
- ["8BBA",0xB5A7],
- ["8BBB",0xB5A9],
- ["8BBC",0xB5AC],
- ["8BBD",0xB5AD],
- ["8BBE",0xB5AE],
- ["8BBF",0xB5AF],
- ["8BC0",0xB5B2],
- ["8BC1",0xB5B6],
- ["8BC2",0xB5B7],
- ["8BC3",0xB5B8],
- ["8BC4",0xB5B9],
- ["8BC5",0xB5BA],
- ["8BC6",0xB5BE],
- ["8BC7",0xB5BF],
- ["8BC8",0xB5C1],
- ["8BC9",0xB5C2],
- ["8BCA",0xB5C3],
- ["8BCB",0xB5C5],
- ["8BCC",0xB5C6],
- ["8BCD",0xB5C7],
- ["8BCE",0xB5C8],
- ["8BCF",0xB5C9],
- ["8BD0",0xB5CA],
- ["8BD1",0xB5CB],
- ["8BD2",0xB5CE],
- ["8BD3",0xB5D2],
- ["8BD4",0xB5D3],
- ["8BD5",0xB5D4],
- ["8BD6",0xB5D5],
- ["8BD7",0xB5D6],
- ["8BD8",0xB5D7],
- ["8BD9",0xB5D9],
- ["8BDA",0xB5DA],
- ["8BDB",0xB5DB],
- ["8BDC",0xB5DC],
- ["8BDD",0xB5DD],
- ["8BDE",0xB5DE],
- ["8BDF",0xB5DF],
- ["8BE0",0xB5E0],
- ["8BE1",0xB5E1],
- ["8BE2",0xB5E2],
- ["8BE3",0xB5E3],
- ["8BE4",0xB5E4],
- ["8BE5",0xB5E5],
- ["8BE6",0xB5E6],
- ["8BE7",0xB5E7],
- ["8BE8",0xB5E8],
- ["8BE9",0xB5E9],
- ["8BEA",0xB5EA],
- ["8BEB",0xB5EB],
- ["8BEC",0xB5ED],
- ["8BED",0xB5EE],
- ["8BEE",0xB5EF],
- ["8BEF",0xB5F0],
- ["8BF0",0xB5F1],
- ["8BF1",0xB5F2],
- ["8BF2",0xB5F3],
- ["8BF3",0xB5F4],
- ["8BF4",0xB5F5],
- ["8BF5",0xB5F6],
- ["8BF6",0xB5F7],
- ["8BF7",0xB5F8],
- ["8BF8",0xB5F9],
- ["8BF9",0xB5FA],
- ["8BFA",0xB5FB],
- ["8BFB",0xB5FC],
- ["8BFC",0xB5FD],
- ["8BFD",0xB5FE],
- ["8BFE",0xB5FF],
- ["8C41",0xB600],
- ["8C42",0xB601],
- ["8C43",0xB602],
- ["8C44",0xB603],
- ["8C45",0xB604],
- ["8C46",0xB605],
- ["8C47",0xB606],
- ["8C48",0xB607],
- ["8C49",0xB608],
- ["8C4A",0xB609],
- ["8C4B",0xB60A],
- ["8C4C",0xB60B],
- ["8C4D",0xB60C],
- ["8C4E",0xB60D],
- ["8C4F",0xB60E],
- ["8C50",0xB60F],
- ["8C51",0xB612],
- ["8C52",0xB613],
- ["8C53",0xB615],
- ["8C54",0xB616],
- ["8C55",0xB617],
- ["8C56",0xB619],
- ["8C57",0xB61A],
- ["8C58",0xB61B],
- ["8C59",0xB61C],
- ["8C5A",0xB61D],
- ["8C61",0xB61E],
- ["8C62",0xB61F],
- ["8C63",0xB620],
- ["8C64",0xB621],
- ["8C65",0xB622],
- ["8C66",0xB623],
- ["8C67",0xB624],
- ["8C68",0xB626],
- ["8C69",0xB627],
- ["8C6A",0xB628],
- ["8C6B",0xB629],
- ["8C6C",0xB62A],
- ["8C6D",0xB62B],
- ["8C6E",0xB62D],
- ["8C6F",0xB62E],
- ["8C70",0xB62F],
- ["8C71",0xB630],
- ["8C72",0xB631],
- ["8C73",0xB632],
- ["8C74",0xB633],
- ["8C75",0xB635],
- ["8C76",0xB636],
- ["8C77",0xB637],
- ["8C78",0xB638],
- ["8C79",0xB639],
- ["8C7A",0xB63A],
- ["8C81",0xB63B],
- ["8C82",0xB63C],
- ["8C83",0xB63D],
- ["8C84",0xB63E],
- ["8C85",0xB63F],
- ["8C86",0xB640],
- ["8C87",0xB641],
- ["8C88",0xB642],
- ["8C89",0xB643],
- ["8C8A",0xB644],
- ["8C8B",0xB645],
- ["8C8C",0xB646],
- ["8C8D",0xB647],
- ["8C8E",0xB649],
- ["8C8F",0xB64A],
- ["8C90",0xB64B],
- ["8C91",0xB64C],
- ["8C92",0xB64D],
- ["8C93",0xB64E],
- ["8C94",0xB64F],
- ["8C95",0xB650],
- ["8C96",0xB651],
- ["8C97",0xB652],
- ["8C98",0xB653],
- ["8C99",0xB654],
- ["8C9A",0xB655],
- ["8C9B",0xB656],
- ["8C9C",0xB657],
- ["8C9D",0xB658],
- ["8C9E",0xB659],
- ["8C9F",0xB65A],
- ["8CA0",0xB65B],
- ["8CA1",0xB65C],
- ["8CA2",0xB65D],
- ["8CA3",0xB65E],
- ["8CA4",0xB65F],
- ["8CA5",0xB660],
- ["8CA6",0xB661],
- ["8CA7",0xB662],
- ["8CA8",0xB663],
- ["8CA9",0xB665],
- ["8CAA",0xB666],
- ["8CAB",0xB667],
- ["8CAC",0xB669],
- ["8CAD",0xB66A],
- ["8CAE",0xB66B],
- ["8CAF",0xB66C],
- ["8CB0",0xB66D],
- ["8CB1",0xB66E],
- ["8CB2",0xB66F],
- ["8CB3",0xB670],
- ["8CB4",0xB671],
- ["8CB5",0xB672],
- ["8CB6",0xB673],
- ["8CB7",0xB674],
- ["8CB8",0xB675],
- ["8CB9",0xB676],
- ["8CBA",0xB677],
- ["8CBB",0xB678],
- ["8CBC",0xB679],
- ["8CBD",0xB67A],
- ["8CBE",0xB67B],
- ["8CBF",0xB67C],
- ["8CC0",0xB67D],
- ["8CC1",0xB67E],
- ["8CC2",0xB67F],
- ["8CC3",0xB680],
- ["8CC4",0xB681],
- ["8CC5",0xB682],
- ["8CC6",0xB683],
- ["8CC7",0xB684],
- ["8CC8",0xB685],
- ["8CC9",0xB686],
- ["8CCA",0xB687],
- ["8CCB",0xB688],
- ["8CCC",0xB689],
- ["8CCD",0xB68A],
- ["8CCE",0xB68B],
- ["8CCF",0xB68C],
- ["8CD0",0xB68D],
- ["8CD1",0xB68E],
- ["8CD2",0xB68F],
- ["8CD3",0xB690],
- ["8CD4",0xB691],
- ["8CD5",0xB692],
- ["8CD6",0xB693],
- ["8CD7",0xB694],
- ["8CD8",0xB695],
- ["8CD9",0xB696],
- ["8CDA",0xB697],
- ["8CDB",0xB698],
- ["8CDC",0xB699],
- ["8CDD",0xB69A],
- ["8CDE",0xB69B],
- ["8CDF",0xB69E],
- ["8CE0",0xB69F],
- ["8CE1",0xB6A1],
- ["8CE2",0xB6A2],
- ["8CE3",0xB6A3],
- ["8CE4",0xB6A5],
- ["8CE5",0xB6A6],
- ["8CE6",0xB6A7],
- ["8CE7",0xB6A8],
- ["8CE8",0xB6A9],
- ["8CE9",0xB6AA],
- ["8CEA",0xB6AD],
- ["8CEB",0xB6AE],
- ["8CEC",0xB6AF],
- ["8CED",0xB6B0],
- ["8CEE",0xB6B2],
- ["8CEF",0xB6B3],
- ["8CF0",0xB6B4],
- ["8CF1",0xB6B5],
- ["8CF2",0xB6B6],
- ["8CF3",0xB6B7],
- ["8CF4",0xB6B8],
- ["8CF5",0xB6B9],
- ["8CF6",0xB6BA],
- ["8CF7",0xB6BB],
- ["8CF8",0xB6BC],
- ["8CF9",0xB6BD],
- ["8CFA",0xB6BE],
- ["8CFB",0xB6BF],
- ["8CFC",0xB6C0],
- ["8CFD",0xB6C1],
- ["8CFE",0xB6C2],
- ["8D41",0xB6C3],
- ["8D42",0xB6C4],
- ["8D43",0xB6C5],
- ["8D44",0xB6C6],
- ["8D45",0xB6C7],
- ["8D46",0xB6C8],
- ["8D47",0xB6C9],
- ["8D48",0xB6CA],
- ["8D49",0xB6CB],
- ["8D4A",0xB6CC],
- ["8D4B",0xB6CD],
- ["8D4C",0xB6CE],
- ["8D4D",0xB6CF],
- ["8D4E",0xB6D0],
- ["8D4F",0xB6D1],
- ["8D50",0xB6D2],
- ["8D51",0xB6D3],
- ["8D52",0xB6D5],
- ["8D53",0xB6D6],
- ["8D54",0xB6D7],
- ["8D55",0xB6D8],
- ["8D56",0xB6D9],
- ["8D57",0xB6DA],
- ["8D58",0xB6DB],
- ["8D59",0xB6DC],
- ["8D5A",0xB6DD],
- ["8D61",0xB6DE],
- ["8D62",0xB6DF],
- ["8D63",0xB6E0],
- ["8D64",0xB6E1],
- ["8D65",0xB6E2],
- ["8D66",0xB6E3],
- ["8D67",0xB6E4],
- ["8D68",0xB6E5],
- ["8D69",0xB6E6],
- ["8D6A",0xB6E7],
- ["8D6B",0xB6E8],
- ["8D6C",0xB6E9],
- ["8D6D",0xB6EA],
- ["8D6E",0xB6EB],
- ["8D6F",0xB6EC],
- ["8D70",0xB6ED],
- ["8D71",0xB6EE],
- ["8D72",0xB6EF],
- ["8D73",0xB6F1],
- ["8D74",0xB6F2],
- ["8D75",0xB6F3],
- ["8D76",0xB6F5],
- ["8D77",0xB6F6],
- ["8D78",0xB6F7],
- ["8D79",0xB6F9],
- ["8D7A",0xB6FA],
- ["8D81",0xB6FB],
- ["8D82",0xB6FC],
- ["8D83",0xB6FD],
- ["8D84",0xB6FE],
- ["8D85",0xB6FF],
- ["8D86",0xB702],
- ["8D87",0xB703],
- ["8D88",0xB704],
- ["8D89",0xB706],
- ["8D8A",0xB707],
- ["8D8B",0xB708],
- ["8D8C",0xB709],
- ["8D8D",0xB70A],
- ["8D8E",0xB70B],
- ["8D8F",0xB70C],
- ["8D90",0xB70D],
- ["8D91",0xB70E],
- ["8D92",0xB70F],
- ["8D93",0xB710],
- ["8D94",0xB711],
- ["8D95",0xB712],
- ["8D96",0xB713],
- ["8D97",0xB714],
- ["8D98",0xB715],
- ["8D99",0xB716],
- ["8D9A",0xB717],
- ["8D9B",0xB718],
- ["8D9C",0xB719],
- ["8D9D",0xB71A],
- ["8D9E",0xB71B],
- ["8D9F",0xB71C],
- ["8DA0",0xB71D],
- ["8DA1",0xB71E],
- ["8DA2",0xB71F],
- ["8DA3",0xB720],
- ["8DA4",0xB721],
- ["8DA5",0xB722],
- ["8DA6",0xB723],
- ["8DA7",0xB724],
- ["8DA8",0xB725],
- ["8DA9",0xB726],
- ["8DAA",0xB727],
- ["8DAB",0xB72A],
- ["8DAC",0xB72B],
- ["8DAD",0xB72D],
- ["8DAE",0xB72E],
- ["8DAF",0xB731],
- ["8DB0",0xB732],
- ["8DB1",0xB733],
- ["8DB2",0xB734],
- ["8DB3",0xB735],
- ["8DB4",0xB736],
- ["8DB5",0xB737],
- ["8DB6",0xB73A],
- ["8DB7",0xB73C],
- ["8DB8",0xB73D],
- ["8DB9",0xB73E],
- ["8DBA",0xB73F],
- ["8DBB",0xB740],
- ["8DBC",0xB741],
- ["8DBD",0xB742],
- ["8DBE",0xB743],
- ["8DBF",0xB745],
- ["8DC0",0xB746],
- ["8DC1",0xB747],
- ["8DC2",0xB749],
- ["8DC3",0xB74A],
- ["8DC4",0xB74B],
- ["8DC5",0xB74D],
- ["8DC6",0xB74E],
- ["8DC7",0xB74F],
- ["8DC8",0xB750],
- ["8DC9",0xB751],
- ["8DCA",0xB752],
- ["8DCB",0xB753],
- ["8DCC",0xB756],
- ["8DCD",0xB757],
- ["8DCE",0xB758],
- ["8DCF",0xB759],
- ["8DD0",0xB75A],
- ["8DD1",0xB75B],
- ["8DD2",0xB75C],
- ["8DD3",0xB75D],
- ["8DD4",0xB75E],
- ["8DD5",0xB75F],
- ["8DD6",0xB761],
- ["8DD7",0xB762],
- ["8DD8",0xB763],
- ["8DD9",0xB765],
- ["8DDA",0xB766],
- ["8DDB",0xB767],
- ["8DDC",0xB769],
- ["8DDD",0xB76A],
- ["8DDE",0xB76B],
- ["8DDF",0xB76C],
- ["8DE0",0xB76D],
- ["8DE1",0xB76E],
- ["8DE2",0xB76F],
- ["8DE3",0xB772],
- ["8DE4",0xB774],
- ["8DE5",0xB776],
- ["8DE6",0xB777],
- ["8DE7",0xB778],
- ["8DE8",0xB779],
- ["8DE9",0xB77A],
- ["8DEA",0xB77B],
- ["8DEB",0xB77E],
- ["8DEC",0xB77F],
- ["8DED",0xB781],
- ["8DEE",0xB782],
- ["8DEF",0xB783],
- ["8DF0",0xB785],
- ["8DF1",0xB786],
- ["8DF2",0xB787],
- ["8DF3",0xB788],
- ["8DF4",0xB789],
- ["8DF5",0xB78A],
- ["8DF6",0xB78B],
- ["8DF7",0xB78E],
- ["8DF8",0xB793],
- ["8DF9",0xB794],
- ["8DFA",0xB795],
- ["8DFB",0xB79A],
- ["8DFC",0xB79B],
- ["8DFD",0xB79D],
- ["8DFE",0xB79E],
- ["8E41",0xB79F],
- ["8E42",0xB7A1],
- ["8E43",0xB7A2],
- ["8E44",0xB7A3],
- ["8E45",0xB7A4],
- ["8E46",0xB7A5],
- ["8E47",0xB7A6],
- ["8E48",0xB7A7],
- ["8E49",0xB7AA],
- ["8E4A",0xB7AE],
- ["8E4B",0xB7AF],
- ["8E4C",0xB7B0],
- ["8E4D",0xB7B1],
- ["8E4E",0xB7B2],
- ["8E4F",0xB7B3],
- ["8E50",0xB7B6],
- ["8E51",0xB7B7],
- ["8E52",0xB7B9],
- ["8E53",0xB7BA],
- ["8E54",0xB7BB],
- ["8E55",0xB7BC],
- ["8E56",0xB7BD],
- ["8E57",0xB7BE],
- ["8E58",0xB7BF],
- ["8E59",0xB7C0],
- ["8E5A",0xB7C1],
- ["8E61",0xB7C2],
- ["8E62",0xB7C3],
- ["8E63",0xB7C4],
- ["8E64",0xB7C5],
- ["8E65",0xB7C6],
- ["8E66",0xB7C8],
- ["8E67",0xB7CA],
- ["8E68",0xB7CB],
- ["8E69",0xB7CC],
- ["8E6A",0xB7CD],
- ["8E6B",0xB7CE],
- ["8E6C",0xB7CF],
- ["8E6D",0xB7D0],
- ["8E6E",0xB7D1],
- ["8E6F",0xB7D2],
- ["8E70",0xB7D3],
- ["8E71",0xB7D4],
- ["8E72",0xB7D5],
- ["8E73",0xB7D6],
- ["8E74",0xB7D7],
- ["8E75",0xB7D8],
- ["8E76",0xB7D9],
- ["8E77",0xB7DA],
- ["8E78",0xB7DB],
- ["8E79",0xB7DC],
- ["8E7A",0xB7DD],
- ["8E81",0xB7DE],
- ["8E82",0xB7DF],
- ["8E83",0xB7E0],
- ["8E84",0xB7E1],
- ["8E85",0xB7E2],
- ["8E86",0xB7E3],
- ["8E87",0xB7E4],
- ["8E88",0xB7E5],
- ["8E89",0xB7E6],
- ["8E8A",0xB7E7],
- ["8E8B",0xB7E8],
- ["8E8C",0xB7E9],
- ["8E8D",0xB7EA],
- ["8E8E",0xB7EB],
- ["8E8F",0xB7EE],
- ["8E90",0xB7EF],
- ["8E91",0xB7F1],
- ["8E92",0xB7F2],
- ["8E93",0xB7F3],
- ["8E94",0xB7F5],
- ["8E95",0xB7F6],
- ["8E96",0xB7F7],
- ["8E97",0xB7F8],
- ["8E98",0xB7F9],
- ["8E99",0xB7FA],
- ["8E9A",0xB7FB],
- ["8E9B",0xB7FE],
- ["8E9C",0xB802],
- ["8E9D",0xB803],
- ["8E9E",0xB804],
- ["8E9F",0xB805],
- ["8EA0",0xB806],
- ["8EA1",0xB80A],
- ["8EA2",0xB80B],
- ["8EA3",0xB80D],
- ["8EA4",0xB80E],
- ["8EA5",0xB80F],
- ["8EA6",0xB811],
- ["8EA7",0xB812],
- ["8EA8",0xB813],
- ["8EA9",0xB814],
- ["8EAA",0xB815],
- ["8EAB",0xB816],
- ["8EAC",0xB817],
- ["8EAD",0xB81A],
- ["8EAE",0xB81C],
- ["8EAF",0xB81E],
- ["8EB0",0xB81F],
- ["8EB1",0xB820],
- ["8EB2",0xB821],
- ["8EB3",0xB822],
- ["8EB4",0xB823],
- ["8EB5",0xB826],
- ["8EB6",0xB827],
- ["8EB7",0xB829],
- ["8EB8",0xB82A],
- ["8EB9",0xB82B],
- ["8EBA",0xB82D],
- ["8EBB",0xB82E],
- ["8EBC",0xB82F],
- ["8EBD",0xB830],
- ["8EBE",0xB831],
- ["8EBF",0xB832],
- ["8EC0",0xB833],
- ["8EC1",0xB836],
- ["8EC2",0xB83A],
- ["8EC3",0xB83B],
- ["8EC4",0xB83C],
- ["8EC5",0xB83D],
- ["8EC6",0xB83E],
- ["8EC7",0xB83F],
- ["8EC8",0xB841],
- ["8EC9",0xB842],
- ["8ECA",0xB843],
- ["8ECB",0xB845],
- ["8ECC",0xB846],
- ["8ECD",0xB847],
- ["8ECE",0xB848],
- ["8ECF",0xB849],
- ["8ED0",0xB84A],
- ["8ED1",0xB84B],
- ["8ED2",0xB84C],
- ["8ED3",0xB84D],
- ["8ED4",0xB84E],
- ["8ED5",0xB84F],
- ["8ED6",0xB850],
- ["8ED7",0xB852],
- ["8ED8",0xB854],
- ["8ED9",0xB855],
- ["8EDA",0xB856],
- ["8EDB",0xB857],
- ["8EDC",0xB858],
- ["8EDD",0xB859],
- ["8EDE",0xB85A],
- ["8EDF",0xB85B],
- ["8EE0",0xB85E],
- ["8EE1",0xB85F],
- ["8EE2",0xB861],
- ["8EE3",0xB862],
- ["8EE4",0xB863],
- ["8EE5",0xB865],
- ["8EE6",0xB866],
- ["8EE7",0xB867],
- ["8EE8",0xB868],
- ["8EE9",0xB869],
- ["8EEA",0xB86A],
- ["8EEB",0xB86B],
- ["8EEC",0xB86E],
- ["8EED",0xB870],
- ["8EEE",0xB872],
- ["8EEF",0xB873],
- ["8EF0",0xB874],
- ["8EF1",0xB875],
- ["8EF2",0xB876],
- ["8EF3",0xB877],
- ["8EF4",0xB879],
- ["8EF5",0xB87A],
- ["8EF6",0xB87B],
- ["8EF7",0xB87D],
- ["8EF8",0xB87E],
- ["8EF9",0xB87F],
- ["8EFA",0xB880],
- ["8EFB",0xB881],
- ["8EFC",0xB882],
- ["8EFD",0xB883],
- ["8EFE",0xB884],
- ["8F41",0xB885],
- ["8F42",0xB886],
- ["8F43",0xB887],
- ["8F44",0xB888],
- ["8F45",0xB889],
- ["8F46",0xB88A],
- ["8F47",0xB88B],
- ["8F48",0xB88C],
- ["8F49",0xB88E],
- ["8F4A",0xB88F],
- ["8F4B",0xB890],
- ["8F4C",0xB891],
- ["8F4D",0xB892],
- ["8F4E",0xB893],
- ["8F4F",0xB894],
- ["8F50",0xB895],
- ["8F51",0xB896],
- ["8F52",0xB897],
- ["8F53",0xB898],
- ["8F54",0xB899],
- ["8F55",0xB89A],
- ["8F56",0xB89B],
- ["8F57",0xB89C],
- ["8F58",0xB89D],
- ["8F59",0xB89E],
- ["8F5A",0xB89F],
- ["8F61",0xB8A0],
- ["8F62",0xB8A1],
- ["8F63",0xB8A2],
- ["8F64",0xB8A3],
- ["8F65",0xB8A4],
- ["8F66",0xB8A5],
- ["8F67",0xB8A6],
- ["8F68",0xB8A7],
- ["8F69",0xB8A9],
- ["8F6A",0xB8AA],
- ["8F6B",0xB8AB],
- ["8F6C",0xB8AC],
- ["8F6D",0xB8AD],
- ["8F6E",0xB8AE],
- ["8F6F",0xB8AF],
- ["8F70",0xB8B1],
- ["8F71",0xB8B2],
- ["8F72",0xB8B3],
- ["8F73",0xB8B5],
- ["8F74",0xB8B6],
- ["8F75",0xB8B7],
- ["8F76",0xB8B9],
- ["8F77",0xB8BA],
- ["8F78",0xB8BB],
- ["8F79",0xB8BC],
- ["8F7A",0xB8BD],
- ["8F81",0xB8BE],
- ["8F82",0xB8BF],
- ["8F83",0xB8C2],
- ["8F84",0xB8C4],
- ["8F85",0xB8C6],
- ["8F86",0xB8C7],
- ["8F87",0xB8C8],
- ["8F88",0xB8C9],
- ["8F89",0xB8CA],
- ["8F8A",0xB8CB],
- ["8F8B",0xB8CD],
- ["8F8C",0xB8CE],
- ["8F8D",0xB8CF],
- ["8F8E",0xB8D1],
- ["8F8F",0xB8D2],
- ["8F90",0xB8D3],
- ["8F91",0xB8D5],
- ["8F92",0xB8D6],
- ["8F93",0xB8D7],
- ["8F94",0xB8D8],
- ["8F95",0xB8D9],
- ["8F96",0xB8DA],
- ["8F97",0xB8DB],
- ["8F98",0xB8DC],
- ["8F99",0xB8DE],
- ["8F9A",0xB8E0],
- ["8F9B",0xB8E2],
- ["8F9C",0xB8E3],
- ["8F9D",0xB8E4],
- ["8F9E",0xB8E5],
- ["8F9F",0xB8E6],
- ["8FA0",0xB8E7],
- ["8FA1",0xB8EA],
- ["8FA2",0xB8EB],
- ["8FA3",0xB8ED],
- ["8FA4",0xB8EE],
- ["8FA5",0xB8EF],
- ["8FA6",0xB8F1],
- ["8FA7",0xB8F2],
- ["8FA8",0xB8F3],
- ["8FA9",0xB8F4],
- ["8FAA",0xB8F5],
- ["8FAB",0xB8F6],
- ["8FAC",0xB8F7],
- ["8FAD",0xB8FA],
- ["8FAE",0xB8FC],
- ["8FAF",0xB8FE],
- ["8FB0",0xB8FF],
- ["8FB1",0xB900],
- ["8FB2",0xB901],
- ["8FB3",0xB902],
- ["8FB4",0xB903],
- ["8FB5",0xB905],
- ["8FB6",0xB906],
- ["8FB7",0xB907],
- ["8FB8",0xB908],
- ["8FB9",0xB909],
- ["8FBA",0xB90A],
- ["8FBB",0xB90B],
- ["8FBC",0xB90C],
- ["8FBD",0xB90D],
- ["8FBE",0xB90E],
- ["8FBF",0xB90F],
- ["8FC0",0xB910],
- ["8FC1",0xB911],
- ["8FC2",0xB912],
- ["8FC3",0xB913],
- ["8FC4",0xB914],
- ["8FC5",0xB915],
- ["8FC6",0xB916],
- ["8FC7",0xB917],
- ["8FC8",0xB919],
- ["8FC9",0xB91A],
- ["8FCA",0xB91B],
- ["8FCB",0xB91C],
- ["8FCC",0xB91D],
- ["8FCD",0xB91E],
- ["8FCE",0xB91F],
- ["8FCF",0xB921],
- ["8FD0",0xB922],
- ["8FD1",0xB923],
- ["8FD2",0xB924],
- ["8FD3",0xB925],
- ["8FD4",0xB926],
- ["8FD5",0xB927],
- ["8FD6",0xB928],
- ["8FD7",0xB929],
- ["8FD8",0xB92A],
- ["8FD9",0xB92B],
- ["8FDA",0xB92C],
- ["8FDB",0xB92D],
- ["8FDC",0xB92E],
- ["8FDD",0xB92F],
- ["8FDE",0xB930],
- ["8FDF",0xB931],
- ["8FE0",0xB932],
- ["8FE1",0xB933],
- ["8FE2",0xB934],
- ["8FE3",0xB935],
- ["8FE4",0xB936],
- ["8FE5",0xB937],
- ["8FE6",0xB938],
- ["8FE7",0xB939],
- ["8FE8",0xB93A],
- ["8FE9",0xB93B],
- ["8FEA",0xB93E],
- ["8FEB",0xB93F],
- ["8FEC",0xB941],
- ["8FED",0xB942],
- ["8FEE",0xB943],
- ["8FEF",0xB945],
- ["8FF0",0xB946],
- ["8FF1",0xB947],
- ["8FF2",0xB948],
- ["8FF3",0xB949],
- ["8FF4",0xB94A],
- ["8FF5",0xB94B],
- ["8FF6",0xB94D],
- ["8FF7",0xB94E],
- ["8FF8",0xB950],
- ["8FF9",0xB952],
- ["8FFA",0xB953],
- ["8FFB",0xB954],
- ["8FFC",0xB955],
- ["8FFD",0xB956],
- ["8FFE",0xB957],
- ["9041",0xB95A],
- ["9042",0xB95B],
- ["9043",0xB95D],
- ["9044",0xB95E],
- ["9045",0xB95F],
- ["9046",0xB961],
- ["9047",0xB962],
- ["9048",0xB963],
- ["9049",0xB964],
- ["904A",0xB965],
- ["904B",0xB966],
- ["904C",0xB967],
- ["904D",0xB96A],
- ["904E",0xB96C],
- ["904F",0xB96E],
- ["9050",0xB96F],
- ["9051",0xB970],
- ["9052",0xB971],
- ["9053",0xB972],
- ["9054",0xB973],
- ["9055",0xB976],
- ["9056",0xB977],
- ["9057",0xB979],
- ["9058",0xB97A],
- ["9059",0xB97B],
- ["905A",0xB97D],
- ["9061",0xB97E],
- ["9062",0xB97F],
- ["9063",0xB980],
- ["9064",0xB981],
- ["9065",0xB982],
- ["9066",0xB983],
- ["9067",0xB986],
- ["9068",0xB988],
- ["9069",0xB98B],
- ["906A",0xB98C],
- ["906B",0xB98F],
- ["906C",0xB990],
- ["906D",0xB991],
- ["906E",0xB992],
- ["906F",0xB993],
- ["9070",0xB994],
- ["9071",0xB995],
- ["9072",0xB996],
- ["9073",0xB997],
- ["9074",0xB998],
- ["9075",0xB999],
- ["9076",0xB99A],
- ["9077",0xB99B],
- ["9078",0xB99C],
- ["9079",0xB99D],
- ["907A",0xB99E],
- ["9081",0xB99F],
- ["9082",0xB9A0],
- ["9083",0xB9A1],
- ["9084",0xB9A2],
- ["9085",0xB9A3],
- ["9086",0xB9A4],
- ["9087",0xB9A5],
- ["9088",0xB9A6],
- ["9089",0xB9A7],
- ["908A",0xB9A8],
- ["908B",0xB9A9],
- ["908C",0xB9AA],
- ["908D",0xB9AB],
- ["908E",0xB9AE],
- ["908F",0xB9AF],
- ["9090",0xB9B1],
- ["9091",0xB9B2],
- ["9092",0xB9B3],
- ["9093",0xB9B5],
- ["9094",0xB9B6],
- ["9095",0xB9B7],
- ["9096",0xB9B8],
- ["9097",0xB9B9],
- ["9098",0xB9BA],
- ["9099",0xB9BB],
- ["909A",0xB9BE],
- ["909B",0xB9C0],
- ["909C",0xB9C2],
- ["909D",0xB9C3],
- ["909E",0xB9C4],
- ["909F",0xB9C5],
- ["90A0",0xB9C6],
- ["90A1",0xB9C7],
- ["90A2",0xB9CA],
- ["90A3",0xB9CB],
- ["90A4",0xB9CD],
- ["90A5",0xB9D3],
- ["90A6",0xB9D4],
- ["90A7",0xB9D5],
- ["90A8",0xB9D6],
- ["90A9",0xB9D7],
- ["90AA",0xB9DA],
- ["90AB",0xB9DC],
- ["90AC",0xB9DF],
- ["90AD",0xB9E0],
- ["90AE",0xB9E2],
- ["90AF",0xB9E6],
- ["90B0",0xB9E7],
- ["90B1",0xB9E9],
- ["90B2",0xB9EA],
- ["90B3",0xB9EB],
- ["90B4",0xB9ED],
- ["90B5",0xB9EE],
- ["90B6",0xB9EF],
- ["90B7",0xB9F0],
- ["90B8",0xB9F1],
- ["90B9",0xB9F2],
- ["90BA",0xB9F3],
- ["90BB",0xB9F6],
- ["90BC",0xB9FB],
- ["90BD",0xB9FC],
- ["90BE",0xB9FD],
- ["90BF",0xB9FE],
- ["90C0",0xB9FF],
- ["90C1",0xBA02],
- ["90C2",0xBA03],
- ["90C3",0xBA04],
- ["90C4",0xBA05],
- ["90C5",0xBA06],
- ["90C6",0xBA07],
- ["90C7",0xBA09],
- ["90C8",0xBA0A],
- ["90C9",0xBA0B],
- ["90CA",0xBA0C],
- ["90CB",0xBA0D],
- ["90CC",0xBA0E],
- ["90CD",0xBA0F],
- ["90CE",0xBA10],
- ["90CF",0xBA11],
- ["90D0",0xBA12],
- ["90D1",0xBA13],
- ["90D2",0xBA14],
- ["90D3",0xBA16],
- ["90D4",0xBA17],
- ["90D5",0xBA18],
- ["90D6",0xBA19],
- ["90D7",0xBA1A],
- ["90D8",0xBA1B],
- ["90D9",0xBA1C],
- ["90DA",0xBA1D],
- ["90DB",0xBA1E],
- ["90DC",0xBA1F],
- ["90DD",0xBA20],
- ["90DE",0xBA21],
- ["90DF",0xBA22],
- ["90E0",0xBA23],
- ["90E1",0xBA24],
- ["90E2",0xBA25],
- ["90E3",0xBA26],
- ["90E4",0xBA27],
- ["90E5",0xBA28],
- ["90E6",0xBA29],
- ["90E7",0xBA2A],
- ["90E8",0xBA2B],
- ["90E9",0xBA2C],
- ["90EA",0xBA2D],
- ["90EB",0xBA2E],
- ["90EC",0xBA2F],
- ["90ED",0xBA30],
- ["90EE",0xBA31],
- ["90EF",0xBA32],
- ["90F0",0xBA33],
- ["90F1",0xBA34],
- ["90F2",0xBA35],
- ["90F3",0xBA36],
- ["90F4",0xBA37],
- ["90F5",0xBA3A],
- ["90F6",0xBA3B],
- ["90F7",0xBA3D],
- ["90F8",0xBA3E],
- ["90F9",0xBA3F],
- ["90FA",0xBA41],
- ["90FB",0xBA43],
- ["90FC",0xBA44],
- ["90FD",0xBA45],
- ["90FE",0xBA46],
- ["9141",0xBA47],
- ["9142",0xBA4A],
- ["9143",0xBA4C],
- ["9144",0xBA4F],
- ["9145",0xBA50],
- ["9146",0xBA51],
- ["9147",0xBA52],
- ["9148",0xBA56],
- ["9149",0xBA57],
- ["914A",0xBA59],
- ["914B",0xBA5A],
- ["914C",0xBA5B],
- ["914D",0xBA5D],
- ["914E",0xBA5E],
- ["914F",0xBA5F],
- ["9150",0xBA60],
- ["9151",0xBA61],
- ["9152",0xBA62],
- ["9153",0xBA63],
- ["9154",0xBA66],
- ["9155",0xBA6A],
- ["9156",0xBA6B],
- ["9157",0xBA6C],
- ["9158",0xBA6D],
- ["9159",0xBA6E],
- ["915A",0xBA6F],
- ["9161",0xBA72],
- ["9162",0xBA73],
- ["9163",0xBA75],
- ["9164",0xBA76],
- ["9165",0xBA77],
- ["9166",0xBA79],
- ["9167",0xBA7A],
- ["9168",0xBA7B],
- ["9169",0xBA7C],
- ["916A",0xBA7D],
- ["916B",0xBA7E],
- ["916C",0xBA7F],
- ["916D",0xBA80],
- ["916E",0xBA81],
- ["916F",0xBA82],
- ["9170",0xBA86],
- ["9171",0xBA88],
- ["9172",0xBA89],
- ["9173",0xBA8A],
- ["9174",0xBA8B],
- ["9175",0xBA8D],
- ["9176",0xBA8E],
- ["9177",0xBA8F],
- ["9178",0xBA90],
- ["9179",0xBA91],
- ["917A",0xBA92],
- ["9181",0xBA93],
- ["9182",0xBA94],
- ["9183",0xBA95],
- ["9184",0xBA96],
- ["9185",0xBA97],
- ["9186",0xBA98],
- ["9187",0xBA99],
- ["9188",0xBA9A],
- ["9189",0xBA9B],
- ["918A",0xBA9C],
- ["918B",0xBA9D],
- ["918C",0xBA9E],
- ["918D",0xBA9F],
- ["918E",0xBAA0],
- ["918F",0xBAA1],
- ["9190",0xBAA2],
- ["9191",0xBAA3],
- ["9192",0xBAA4],
- ["9193",0xBAA5],
- ["9194",0xBAA6],
- ["9195",0xBAA7],
- ["9196",0xBAAA],
- ["9197",0xBAAD],
- ["9198",0xBAAE],
- ["9199",0xBAAF],
- ["919A",0xBAB1],
- ["919B",0xBAB3],
- ["919C",0xBAB4],
- ["919D",0xBAB5],
- ["919E",0xBAB6],
- ["919F",0xBAB7],
- ["91A0",0xBABA],
- ["91A1",0xBABC],
- ["91A2",0xBABE],
- ["91A3",0xBABF],
- ["91A4",0xBAC0],
- ["91A5",0xBAC1],
- ["91A6",0xBAC2],
- ["91A7",0xBAC3],
- ["91A8",0xBAC5],
- ["91A9",0xBAC6],
- ["91AA",0xBAC7],
- ["91AB",0xBAC9],
- ["91AC",0xBACA],
- ["91AD",0xBACB],
- ["91AE",0xBACC],
- ["91AF",0xBACD],
- ["91B0",0xBACE],
- ["91B1",0xBACF],
- ["91B2",0xBAD0],
- ["91B3",0xBAD1],
- ["91B4",0xBAD2],
- ["91B5",0xBAD3],
- ["91B6",0xBAD4],
- ["91B7",0xBAD5],
- ["91B8",0xBAD6],
- ["91B9",0xBAD7],
- ["91BA",0xBADA],
- ["91BB",0xBADB],
- ["91BC",0xBADC],
- ["91BD",0xBADD],
- ["91BE",0xBADE],
- ["91BF",0xBADF],
- ["91C0",0xBAE0],
- ["91C1",0xBAE1],
- ["91C2",0xBAE2],
- ["91C3",0xBAE3],
- ["91C4",0xBAE4],
- ["91C5",0xBAE5],
- ["91C6",0xBAE6],
- ["91C7",0xBAE7],
- ["91C8",0xBAE8],
- ["91C9",0xBAE9],
- ["91CA",0xBAEA],
- ["91CB",0xBAEB],
- ["91CC",0xBAEC],
- ["91CD",0xBAED],
- ["91CE",0xBAEE],
- ["91CF",0xBAEF],
- ["91D0",0xBAF0],
- ["91D1",0xBAF1],
- ["91D2",0xBAF2],
- ["91D3",0xBAF3],
- ["91D4",0xBAF4],
- ["91D5",0xBAF5],
- ["91D6",0xBAF6],
- ["91D7",0xBAF7],
- ["91D8",0xBAF8],
- ["91D9",0xBAF9],
- ["91DA",0xBAFA],
- ["91DB",0xBAFB],
- ["91DC",0xBAFD],
- ["91DD",0xBAFE],
- ["91DE",0xBAFF],
- ["91DF",0xBB01],
- ["91E0",0xBB02],
- ["91E1",0xBB03],
- ["91E2",0xBB05],
- ["91E3",0xBB06],
- ["91E4",0xBB07],
- ["91E5",0xBB08],
- ["91E6",0xBB09],
- ["91E7",0xBB0A],
- ["91E8",0xBB0B],
- ["91E9",0xBB0C],
- ["91EA",0xBB0E],
- ["91EB",0xBB10],
- ["91EC",0xBB12],
- ["91ED",0xBB13],
- ["91EE",0xBB14],
- ["91EF",0xBB15],
- ["91F0",0xBB16],
- ["91F1",0xBB17],
- ["91F2",0xBB19],
- ["91F3",0xBB1A],
- ["91F4",0xBB1B],
- ["91F5",0xBB1D],
- ["91F6",0xBB1E],
- ["91F7",0xBB1F],
- ["91F8",0xBB21],
- ["91F9",0xBB22],
- ["91FA",0xBB23],
- ["91FB",0xBB24],
- ["91FC",0xBB25],
- ["91FD",0xBB26],
- ["91FE",0xBB27],
- ["9241",0xBB28],
- ["9242",0xBB2A],
- ["9243",0xBB2C],
- ["9244",0xBB2D],
- ["9245",0xBB2E],
- ["9246",0xBB2F],
- ["9247",0xBB30],
- ["9248",0xBB31],
- ["9249",0xBB32],
- ["924A",0xBB33],
- ["924B",0xBB37],
- ["924C",0xBB39],
- ["924D",0xBB3A],
- ["924E",0xBB3F],
- ["924F",0xBB40],
- ["9250",0xBB41],
- ["9251",0xBB42],
- ["9252",0xBB43],
- ["9253",0xBB46],
- ["9254",0xBB48],
- ["9255",0xBB4A],
- ["9256",0xBB4B],
- ["9257",0xBB4C],
- ["9258",0xBB4E],
- ["9259",0xBB51],
- ["925A",0xBB52],
- ["9261",0xBB53],
- ["9262",0xBB55],
- ["9263",0xBB56],
- ["9264",0xBB57],
- ["9265",0xBB59],
- ["9266",0xBB5A],
- ["9267",0xBB5B],
- ["9268",0xBB5C],
- ["9269",0xBB5D],
- ["926A",0xBB5E],
- ["926B",0xBB5F],
- ["926C",0xBB60],
- ["926D",0xBB62],
- ["926E",0xBB64],
- ["926F",0xBB65],
- ["9270",0xBB66],
- ["9271",0xBB67],
- ["9272",0xBB68],
- ["9273",0xBB69],
- ["9274",0xBB6A],
- ["9275",0xBB6B],
- ["9276",0xBB6D],
- ["9277",0xBB6E],
- ["9278",0xBB6F],
- ["9279",0xBB70],
- ["927A",0xBB71],
- ["9281",0xBB72],
- ["9282",0xBB73],
- ["9283",0xBB74],
- ["9284",0xBB75],
- ["9285",0xBB76],
- ["9286",0xBB77],
- ["9287",0xBB78],
- ["9288",0xBB79],
- ["9289",0xBB7A],
- ["928A",0xBB7B],
- ["928B",0xBB7C],
- ["928C",0xBB7D],
- ["928D",0xBB7E],
- ["928E",0xBB7F],
- ["928F",0xBB80],
- ["9290",0xBB81],
- ["9291",0xBB82],
- ["9292",0xBB83],
- ["9293",0xBB84],
- ["9294",0xBB85],
- ["9295",0xBB86],
- ["9296",0xBB87],
- ["9297",0xBB89],
- ["9298",0xBB8A],
- ["9299",0xBB8B],
- ["929A",0xBB8D],
- ["929B",0xBB8E],
- ["929C",0xBB8F],
- ["929D",0xBB91],
- ["929E",0xBB92],
- ["929F",0xBB93],
- ["92A0",0xBB94],
- ["92A1",0xBB95],
- ["92A2",0xBB96],
- ["92A3",0xBB97],
- ["92A4",0xBB98],
- ["92A5",0xBB99],
- ["92A6",0xBB9A],
- ["92A7",0xBB9B],
- ["92A8",0xBB9C],
- ["92A9",0xBB9D],
- ["92AA",0xBB9E],
- ["92AB",0xBB9F],
- ["92AC",0xBBA0],
- ["92AD",0xBBA1],
- ["92AE",0xBBA2],
- ["92AF",0xBBA3],
- ["92B0",0xBBA5],
- ["92B1",0xBBA6],
- ["92B2",0xBBA7],
- ["92B3",0xBBA9],
- ["92B4",0xBBAA],
- ["92B5",0xBBAB],
- ["92B6",0xBBAD],
- ["92B7",0xBBAE],
- ["92B8",0xBBAF],
- ["92B9",0xBBB0],
- ["92BA",0xBBB1],
- ["92BB",0xBBB2],
- ["92BC",0xBBB3],
- ["92BD",0xBBB5],
- ["92BE",0xBBB6],
- ["92BF",0xBBB8],
- ["92C0",0xBBB9],
- ["92C1",0xBBBA],
- ["92C2",0xBBBB],
- ["92C3",0xBBBC],
- ["92C4",0xBBBD],
- ["92C5",0xBBBE],
- ["92C6",0xBBBF],
- ["92C7",0xBBC1],
- ["92C8",0xBBC2],
- ["92C9",0xBBC3],
- ["92CA",0xBBC5],
- ["92CB",0xBBC6],
- ["92CC",0xBBC7],
- ["92CD",0xBBC9],
- ["92CE",0xBBCA],
- ["92CF",0xBBCB],
- ["92D0",0xBBCC],
- ["92D1",0xBBCD],
- ["92D2",0xBBCE],
- ["92D3",0xBBCF],
- ["92D4",0xBBD1],
- ["92D5",0xBBD2],
- ["92D6",0xBBD4],
- ["92D7",0xBBD5],
- ["92D8",0xBBD6],
- ["92D9",0xBBD7],
- ["92DA",0xBBD8],
- ["92DB",0xBBD9],
- ["92DC",0xBBDA],
- ["92DD",0xBBDB],
- ["92DE",0xBBDC],
- ["92DF",0xBBDD],
- ["92E0",0xBBDE],
- ["92E1",0xBBDF],
- ["92E2",0xBBE0],
- ["92E3",0xBBE1],
- ["92E4",0xBBE2],
- ["92E5",0xBBE3],
- ["92E6",0xBBE4],
- ["92E7",0xBBE5],
- ["92E8",0xBBE6],
- ["92E9",0xBBE7],
- ["92EA",0xBBE8],
- ["92EB",0xBBE9],
- ["92EC",0xBBEA],
- ["92ED",0xBBEB],
- ["92EE",0xBBEC],
- ["92EF",0xBBED],
- ["92F0",0xBBEE],
- ["92F1",0xBBEF],
- ["92F2",0xBBF0],
- ["92F3",0xBBF1],
- ["92F4",0xBBF2],
- ["92F5",0xBBF3],
- ["92F6",0xBBF4],
- ["92F7",0xBBF5],
- ["92F8",0xBBF6],
- ["92F9",0xBBF7],
- ["92FA",0xBBFA],
- ["92FB",0xBBFB],
- ["92FC",0xBBFD],
- ["92FD",0xBBFE],
- ["92FE",0xBC01],
- ["9341",0xBC03],
- ["9342",0xBC04],
- ["9343",0xBC05],
- ["9344",0xBC06],
- ["9345",0xBC07],
- ["9346",0xBC0A],
- ["9347",0xBC0E],
- ["9348",0xBC10],
- ["9349",0xBC12],
- ["934A",0xBC13],
- ["934B",0xBC19],
- ["934C",0xBC1A],
- ["934D",0xBC20],
- ["934E",0xBC21],
- ["934F",0xBC22],
- ["9350",0xBC23],
- ["9351",0xBC26],
- ["9352",0xBC28],
- ["9353",0xBC2A],
- ["9354",0xBC2B],
- ["9355",0xBC2C],
- ["9356",0xBC2E],
- ["9357",0xBC2F],
- ["9358",0xBC32],
- ["9359",0xBC33],
- ["935A",0xBC35],
- ["9361",0xBC36],
- ["9362",0xBC37],
- ["9363",0xBC39],
- ["9364",0xBC3A],
- ["9365",0xBC3B],
- ["9366",0xBC3C],
- ["9367",0xBC3D],
- ["9368",0xBC3E],
- ["9369",0xBC3F],
- ["936A",0xBC42],
- ["936B",0xBC46],
- ["936C",0xBC47],
- ["936D",0xBC48],
- ["936E",0xBC4A],
- ["936F",0xBC4B],
- ["9370",0xBC4E],
- ["9371",0xBC4F],
- ["9372",0xBC51],
- ["9373",0xBC52],
- ["9374",0xBC53],
- ["9375",0xBC54],
- ["9376",0xBC55],
- ["9377",0xBC56],
- ["9378",0xBC57],
- ["9379",0xBC58],
- ["937A",0xBC59],
- ["9381",0xBC5A],
- ["9382",0xBC5B],
- ["9383",0xBC5C],
- ["9384",0xBC5E],
- ["9385",0xBC5F],
- ["9386",0xBC60],
- ["9387",0xBC61],
- ["9388",0xBC62],
- ["9389",0xBC63],
- ["938A",0xBC64],
- ["938B",0xBC65],
- ["938C",0xBC66],
- ["938D",0xBC67],
- ["938E",0xBC68],
- ["938F",0xBC69],
- ["9390",0xBC6A],
- ["9391",0xBC6B],
- ["9392",0xBC6C],
- ["9393",0xBC6D],
- ["9394",0xBC6E],
- ["9395",0xBC6F],
- ["9396",0xBC70],
- ["9397",0xBC71],
- ["9398",0xBC72],
- ["9399",0xBC73],
- ["939A",0xBC74],
- ["939B",0xBC75],
- ["939C",0xBC76],
- ["939D",0xBC77],
- ["939E",0xBC78],
- ["939F",0xBC79],
- ["93A0",0xBC7A],
- ["93A1",0xBC7B],
- ["93A2",0xBC7C],
- ["93A3",0xBC7D],
- ["93A4",0xBC7E],
- ["93A5",0xBC7F],
- ["93A6",0xBC80],
- ["93A7",0xBC81],
- ["93A8",0xBC82],
- ["93A9",0xBC83],
- ["93AA",0xBC86],
- ["93AB",0xBC87],
- ["93AC",0xBC89],
- ["93AD",0xBC8A],
- ["93AE",0xBC8D],
- ["93AF",0xBC8F],
- ["93B0",0xBC90],
- ["93B1",0xBC91],
- ["93B2",0xBC92],
- ["93B3",0xBC93],
- ["93B4",0xBC96],
- ["93B5",0xBC98],
- ["93B6",0xBC9B],
- ["93B7",0xBC9C],
- ["93B8",0xBC9D],
- ["93B9",0xBC9E],
- ["93BA",0xBC9F],
- ["93BB",0xBCA2],
- ["93BC",0xBCA3],
- ["93BD",0xBCA5],
- ["93BE",0xBCA6],
- ["93BF",0xBCA9],
- ["93C0",0xBCAA],
- ["93C1",0xBCAB],
- ["93C2",0xBCAC],
- ["93C3",0xBCAD],
- ["93C4",0xBCAE],
- ["93C5",0xBCAF],
- ["93C6",0xBCB2],
- ["93C7",0xBCB6],
- ["93C8",0xBCB7],
- ["93C9",0xBCB8],
- ["93CA",0xBCB9],
- ["93CB",0xBCBA],
- ["93CC",0xBCBB],
- ["93CD",0xBCBE],
- ["93CE",0xBCBF],
- ["93CF",0xBCC1],
- ["93D0",0xBCC2],
- ["93D1",0xBCC3],
- ["93D2",0xBCC5],
- ["93D3",0xBCC6],
- ["93D4",0xBCC7],
- ["93D5",0xBCC8],
- ["93D6",0xBCC9],
- ["93D7",0xBCCA],
- ["93D8",0xBCCB],
- ["93D9",0xBCCC],
- ["93DA",0xBCCE],
- ["93DB",0xBCD2],
- ["93DC",0xBCD3],
- ["93DD",0xBCD4],
- ["93DE",0xBCD6],
- ["93DF",0xBCD7],
- ["93E0",0xBCD9],
- ["93E1",0xBCDA],
- ["93E2",0xBCDB],
- ["93E3",0xBCDD],
- ["93E4",0xBCDE],
- ["93E5",0xBCDF],
- ["93E6",0xBCE0],
- ["93E7",0xBCE1],
- ["93E8",0xBCE2],
- ["93E9",0xBCE3],
- ["93EA",0xBCE4],
- ["93EB",0xBCE5],
- ["93EC",0xBCE6],
- ["93ED",0xBCE7],
- ["93EE",0xBCE8],
- ["93EF",0xBCE9],
- ["93F0",0xBCEA],
- ["93F1",0xBCEB],
- ["93F2",0xBCEC],
- ["93F3",0xBCED],
- ["93F4",0xBCEE],
- ["93F5",0xBCEF],
- ["93F6",0xBCF0],
- ["93F7",0xBCF1],
- ["93F8",0xBCF2],
- ["93F9",0xBCF3],
- ["93FA",0xBCF7],
- ["93FB",0xBCF9],
- ["93FC",0xBCFA],
- ["93FD",0xBCFB],
- ["93FE",0xBCFD],
- ["9441",0xBCFE],
- ["9442",0xBCFF],
- ["9443",0xBD00],
- ["9444",0xBD01],
- ["9445",0xBD02],
- ["9446",0xBD03],
- ["9447",0xBD06],
- ["9448",0xBD08],
- ["9449",0xBD0A],
- ["944A",0xBD0B],
- ["944B",0xBD0C],
- ["944C",0xBD0D],
- ["944D",0xBD0E],
- ["944E",0xBD0F],
- ["944F",0xBD11],
- ["9450",0xBD12],
- ["9451",0xBD13],
- ["9452",0xBD15],
- ["9453",0xBD16],
- ["9454",0xBD17],
- ["9455",0xBD18],
- ["9456",0xBD19],
- ["9457",0xBD1A],
- ["9458",0xBD1B],
- ["9459",0xBD1C],
- ["945A",0xBD1D],
- ["9461",0xBD1E],
- ["9462",0xBD1F],
- ["9463",0xBD20],
- ["9464",0xBD21],
- ["9465",0xBD22],
- ["9466",0xBD23],
- ["9467",0xBD25],
- ["9468",0xBD26],
- ["9469",0xBD27],
- ["946A",0xBD28],
- ["946B",0xBD29],
- ["946C",0xBD2A],
- ["946D",0xBD2B],
- ["946E",0xBD2D],
- ["946F",0xBD2E],
- ["9470",0xBD2F],
- ["9471",0xBD30],
- ["9472",0xBD31],
- ["9473",0xBD32],
- ["9474",0xBD33],
- ["9475",0xBD34],
- ["9476",0xBD35],
- ["9477",0xBD36],
- ["9478",0xBD37],
- ["9479",0xBD38],
- ["947A",0xBD39],
- ["9481",0xBD3A],
- ["9482",0xBD3B],
- ["9483",0xBD3C],
- ["9484",0xBD3D],
- ["9485",0xBD3E],
- ["9486",0xBD3F],
- ["9487",0xBD41],
- ["9488",0xBD42],
- ["9489",0xBD43],
- ["948A",0xBD44],
- ["948B",0xBD45],
- ["948C",0xBD46],
- ["948D",0xBD47],
- ["948E",0xBD4A],
- ["948F",0xBD4B],
- ["9490",0xBD4D],
- ["9491",0xBD4E],
- ["9492",0xBD4F],
- ["9493",0xBD51],
- ["9494",0xBD52],
- ["9495",0xBD53],
- ["9496",0xBD54],
- ["9497",0xBD55],
- ["9498",0xBD56],
- ["9499",0xBD57],
- ["949A",0xBD5A],
- ["949B",0xBD5B],
- ["949C",0xBD5C],
- ["949D",0xBD5D],
- ["949E",0xBD5E],
- ["949F",0xBD5F],
- ["94A0",0xBD60],
- ["94A1",0xBD61],
- ["94A2",0xBD62],
- ["94A3",0xBD63],
- ["94A4",0xBD65],
- ["94A5",0xBD66],
- ["94A6",0xBD67],
- ["94A7",0xBD69],
- ["94A8",0xBD6A],
- ["94A9",0xBD6B],
- ["94AA",0xBD6C],
- ["94AB",0xBD6D],
- ["94AC",0xBD6E],
- ["94AD",0xBD6F],
- ["94AE",0xBD70],
- ["94AF",0xBD71],
- ["94B0",0xBD72],
- ["94B1",0xBD73],
- ["94B2",0xBD74],
- ["94B3",0xBD75],
- ["94B4",0xBD76],
- ["94B5",0xBD77],
- ["94B6",0xBD78],
- ["94B7",0xBD79],
- ["94B8",0xBD7A],
- ["94B9",0xBD7B],
- ["94BA",0xBD7C],
- ["94BB",0xBD7D],
- ["94BC",0xBD7E],
- ["94BD",0xBD7F],
- ["94BE",0xBD82],
- ["94BF",0xBD83],
- ["94C0",0xBD85],
- ["94C1",0xBD86],
- ["94C2",0xBD8B],
- ["94C3",0xBD8C],
- ["94C4",0xBD8D],
- ["94C5",0xBD8E],
- ["94C6",0xBD8F],
- ["94C7",0xBD92],
- ["94C8",0xBD94],
- ["94C9",0xBD96],
- ["94CA",0xBD97],
- ["94CB",0xBD98],
- ["94CC",0xBD9B],
- ["94CD",0xBD9D],
- ["94CE",0xBD9E],
- ["94CF",0xBD9F],
- ["94D0",0xBDA0],
- ["94D1",0xBDA1],
- ["94D2",0xBDA2],
- ["94D3",0xBDA3],
- ["94D4",0xBDA5],
- ["94D5",0xBDA6],
- ["94D6",0xBDA7],
- ["94D7",0xBDA8],
- ["94D8",0xBDA9],
- ["94D9",0xBDAA],
- ["94DA",0xBDAB],
- ["94DB",0xBDAC],
- ["94DC",0xBDAD],
- ["94DD",0xBDAE],
- ["94DE",0xBDAF],
- ["94DF",0xBDB1],
- ["94E0",0xBDB2],
- ["94E1",0xBDB3],
- ["94E2",0xBDB4],
- ["94E3",0xBDB5],
- ["94E4",0xBDB6],
- ["94E5",0xBDB7],
- ["94E6",0xBDB9],
- ["94E7",0xBDBA],
- ["94E8",0xBDBB],
- ["94E9",0xBDBC],
- ["94EA",0xBDBD],
- ["94EB",0xBDBE],
- ["94EC",0xBDBF],
- ["94ED",0xBDC0],
- ["94EE",0xBDC1],
- ["94EF",0xBDC2],
- ["94F0",0xBDC3],
- ["94F1",0xBDC4],
- ["94F2",0xBDC5],
- ["94F3",0xBDC6],
- ["94F4",0xBDC7],
- ["94F5",0xBDC8],
- ["94F6",0xBDC9],
- ["94F7",0xBDCA],
- ["94F8",0xBDCB],
- ["94F9",0xBDCC],
- ["94FA",0xBDCD],
- ["94FB",0xBDCE],
- ["94FC",0xBDCF],
- ["94FD",0xBDD0],
- ["94FE",0xBDD1],
- ["9541",0xBDD2],
- ["9542",0xBDD3],
- ["9543",0xBDD6],
- ["9544",0xBDD7],
- ["9545",0xBDD9],
- ["9546",0xBDDA],
- ["9547",0xBDDB],
- ["9548",0xBDDD],
- ["9549",0xBDDE],
- ["954A",0xBDDF],
- ["954B",0xBDE0],
- ["954C",0xBDE1],
- ["954D",0xBDE2],
- ["954E",0xBDE3],
- ["954F",0xBDE4],
- ["9550",0xBDE5],
- ["9551",0xBDE6],
- ["9552",0xBDE7],
- ["9553",0xBDE8],
- ["9554",0xBDEA],
- ["9555",0xBDEB],
- ["9556",0xBDEC],
- ["9557",0xBDED],
- ["9558",0xBDEE],
- ["9559",0xBDEF],
- ["955A",0xBDF1],
- ["9561",0xBDF2],
- ["9562",0xBDF3],
- ["9563",0xBDF5],
- ["9564",0xBDF6],
- ["9565",0xBDF7],
- ["9566",0xBDF9],
- ["9567",0xBDFA],
- ["9568",0xBDFB],
- ["9569",0xBDFC],
- ["956A",0xBDFD],
- ["956B",0xBDFE],
- ["956C",0xBDFF],
- ["956D",0xBE01],
- ["956E",0xBE02],
- ["956F",0xBE04],
- ["9570",0xBE06],
- ["9571",0xBE07],
- ["9572",0xBE08],
- ["9573",0xBE09],
- ["9574",0xBE0A],
- ["9575",0xBE0B],
- ["9576",0xBE0E],
- ["9577",0xBE0F],
- ["9578",0xBE11],
- ["9579",0xBE12],
- ["957A",0xBE13],
- ["9581",0xBE15],
- ["9582",0xBE16],
- ["9583",0xBE17],
- ["9584",0xBE18],
- ["9585",0xBE19],
- ["9586",0xBE1A],
- ["9587",0xBE1B],
- ["9588",0xBE1E],
- ["9589",0xBE20],
- ["958A",0xBE21],
- ["958B",0xBE22],
- ["958C",0xBE23],
- ["958D",0xBE24],
- ["958E",0xBE25],
- ["958F",0xBE26],
- ["9590",0xBE27],
- ["9591",0xBE28],
- ["9592",0xBE29],
- ["9593",0xBE2A],
- ["9594",0xBE2B],
- ["9595",0xBE2C],
- ["9596",0xBE2D],
- ["9597",0xBE2E],
- ["9598",0xBE2F],
- ["9599",0xBE30],
- ["959A",0xBE31],
- ["959B",0xBE32],
- ["959C",0xBE33],
- ["959D",0xBE34],
- ["959E",0xBE35],
- ["959F",0xBE36],
- ["95A0",0xBE37],
- ["95A1",0xBE38],
- ["95A2",0xBE39],
- ["95A3",0xBE3A],
- ["95A4",0xBE3B],
- ["95A5",0xBE3C],
- ["95A6",0xBE3D],
- ["95A7",0xBE3E],
- ["95A8",0xBE3F],
- ["95A9",0xBE40],
- ["95AA",0xBE41],
- ["95AB",0xBE42],
- ["95AC",0xBE43],
- ["95AD",0xBE46],
- ["95AE",0xBE47],
- ["95AF",0xBE49],
- ["95B0",0xBE4A],
- ["95B1",0xBE4B],
- ["95B2",0xBE4D],
- ["95B3",0xBE4F],
- ["95B4",0xBE50],
- ["95B5",0xBE51],
- ["95B6",0xBE52],
- ["95B7",0xBE53],
- ["95B8",0xBE56],
- ["95B9",0xBE58],
- ["95BA",0xBE5C],
- ["95BB",0xBE5D],
- ["95BC",0xBE5E],
- ["95BD",0xBE5F],
- ["95BE",0xBE62],
- ["95BF",0xBE63],
- ["95C0",0xBE65],
- ["95C1",0xBE66],
- ["95C2",0xBE67],
- ["95C3",0xBE69],
- ["95C4",0xBE6B],
- ["95C5",0xBE6C],
- ["95C6",0xBE6D],
- ["95C7",0xBE6E],
- ["95C8",0xBE6F],
- ["95C9",0xBE72],
- ["95CA",0xBE76],
- ["95CB",0xBE77],
- ["95CC",0xBE78],
- ["95CD",0xBE79],
- ["95CE",0xBE7A],
- ["95CF",0xBE7E],
- ["95D0",0xBE7F],
- ["95D1",0xBE81],
- ["95D2",0xBE82],
- ["95D3",0xBE83],
- ["95D4",0xBE85],
- ["95D5",0xBE86],
- ["95D6",0xBE87],
- ["95D7",0xBE88],
- ["95D8",0xBE89],
- ["95D9",0xBE8A],
- ["95DA",0xBE8B],
- ["95DB",0xBE8E],
- ["95DC",0xBE92],
- ["95DD",0xBE93],
- ["95DE",0xBE94],
- ["95DF",0xBE95],
- ["95E0",0xBE96],
- ["95E1",0xBE97],
- ["95E2",0xBE9A],
- ["95E3",0xBE9B],
- ["95E4",0xBE9C],
- ["95E5",0xBE9D],
- ["95E6",0xBE9E],
- ["95E7",0xBE9F],
- ["95E8",0xBEA0],
- ["95E9",0xBEA1],
- ["95EA",0xBEA2],
- ["95EB",0xBEA3],
- ["95EC",0xBEA4],
- ["95ED",0xBEA5],
- ["95EE",0xBEA6],
- ["95EF",0xBEA7],
- ["95F0",0xBEA9],
- ["95F1",0xBEAA],
- ["95F2",0xBEAB],
- ["95F3",0xBEAC],
- ["95F4",0xBEAD],
- ["95F5",0xBEAE],
- ["95F6",0xBEAF],
- ["95F7",0xBEB0],
- ["95F8",0xBEB1],
- ["95F9",0xBEB2],
- ["95FA",0xBEB3],
- ["95FB",0xBEB4],
- ["95FC",0xBEB5],
- ["95FD",0xBEB6],
- ["95FE",0xBEB7],
- ["9641",0xBEB8],
- ["9642",0xBEB9],
- ["9643",0xBEBA],
- ["9644",0xBEBB],
- ["9645",0xBEBC],
- ["9646",0xBEBD],
- ["9647",0xBEBE],
- ["9648",0xBEBF],
- ["9649",0xBEC0],
- ["964A",0xBEC1],
- ["964B",0xBEC2],
- ["964C",0xBEC3],
- ["964D",0xBEC4],
- ["964E",0xBEC5],
- ["964F",0xBEC6],
- ["9650",0xBEC7],
- ["9651",0xBEC8],
- ["9652",0xBEC9],
- ["9653",0xBECA],
- ["9654",0xBECB],
- ["9655",0xBECC],
- ["9656",0xBECD],
- ["9657",0xBECE],
- ["9658",0xBECF],
- ["9659",0xBED2],
- ["965A",0xBED3],
- ["9661",0xBED5],
- ["9662",0xBED6],
- ["9663",0xBED9],
- ["9664",0xBEDA],
- ["9665",0xBEDB],
- ["9666",0xBEDC],
- ["9667",0xBEDD],
- ["9668",0xBEDE],
- ["9669",0xBEDF],
- ["966A",0xBEE1],
- ["966B",0xBEE2],
- ["966C",0xBEE6],
- ["966D",0xBEE7],
- ["966E",0xBEE8],
- ["966F",0xBEE9],
- ["9670",0xBEEA],
- ["9671",0xBEEB],
- ["9672",0xBEED],
- ["9673",0xBEEE],
- ["9674",0xBEEF],
- ["9675",0xBEF0],
- ["9676",0xBEF1],
- ["9677",0xBEF2],
- ["9678",0xBEF3],
- ["9679",0xBEF4],
- ["967A",0xBEF5],
- ["9681",0xBEF6],
- ["9682",0xBEF7],
- ["9683",0xBEF8],
- ["9684",0xBEF9],
- ["9685",0xBEFA],
- ["9686",0xBEFB],
- ["9687",0xBEFC],
- ["9688",0xBEFD],
- ["9689",0xBEFE],
- ["968A",0xBEFF],
- ["968B",0xBF00],
- ["968C",0xBF02],
- ["968D",0xBF03],
- ["968E",0xBF04],
- ["968F",0xBF05],
- ["9690",0xBF06],
- ["9691",0xBF07],
- ["9692",0xBF0A],
- ["9693",0xBF0B],
- ["9694",0xBF0C],
- ["9695",0xBF0D],
- ["9696",0xBF0E],
- ["9697",0xBF0F],
- ["9698",0xBF10],
- ["9699",0xBF11],
- ["969A",0xBF12],
- ["969B",0xBF13],
- ["969C",0xBF14],
- ["969D",0xBF15],
- ["969E",0xBF16],
- ["969F",0xBF17],
- ["96A0",0xBF1A],
- ["96A1",0xBF1E],
- ["96A2",0xBF1F],
- ["96A3",0xBF20],
- ["96A4",0xBF21],
- ["96A5",0xBF22],
- ["96A6",0xBF23],
- ["96A7",0xBF24],
- ["96A8",0xBF25],
- ["96A9",0xBF26],
- ["96AA",0xBF27],
- ["96AB",0xBF28],
- ["96AC",0xBF29],
- ["96AD",0xBF2A],
- ["96AE",0xBF2B],
- ["96AF",0xBF2C],
- ["96B0",0xBF2D],
- ["96B1",0xBF2E],
- ["96B2",0xBF2F],
- ["96B3",0xBF30],
- ["96B4",0xBF31],
- ["96B5",0xBF32],
- ["96B6",0xBF33],
- ["96B7",0xBF34],
- ["96B8",0xBF35],
- ["96B9",0xBF36],
- ["96BA",0xBF37],
- ["96BB",0xBF38],
- ["96BC",0xBF39],
- ["96BD",0xBF3A],
- ["96BE",0xBF3B],
- ["96BF",0xBF3C],
- ["96C0",0xBF3D],
- ["96C1",0xBF3E],
- ["96C2",0xBF3F],
- ["96C3",0xBF42],
- ["96C4",0xBF43],
- ["96C5",0xBF45],
- ["96C6",0xBF46],
- ["96C7",0xBF47],
- ["96C8",0xBF49],
- ["96C9",0xBF4A],
- ["96CA",0xBF4B],
- ["96CB",0xBF4C],
- ["96CC",0xBF4D],
- ["96CD",0xBF4E],
- ["96CE",0xBF4F],
- ["96CF",0xBF52],
- ["96D0",0xBF53],
- ["96D1",0xBF54],
- ["96D2",0xBF56],
- ["96D3",0xBF57],
- ["96D4",0xBF58],
- ["96D5",0xBF59],
- ["96D6",0xBF5A],
- ["96D7",0xBF5B],
- ["96D8",0xBF5C],
- ["96D9",0xBF5D],
- ["96DA",0xBF5E],
- ["96DB",0xBF5F],
- ["96DC",0xBF60],
- ["96DD",0xBF61],
- ["96DE",0xBF62],
- ["96DF",0xBF63],
- ["96E0",0xBF64],
- ["96E1",0xBF65],
- ["96E2",0xBF66],
- ["96E3",0xBF67],
- ["96E4",0xBF68],
- ["96E5",0xBF69],
- ["96E6",0xBF6A],
- ["96E7",0xBF6B],
- ["96E8",0xBF6C],
- ["96E9",0xBF6D],
- ["96EA",0xBF6E],
- ["96EB",0xBF6F],
- ["96EC",0xBF70],
- ["96ED",0xBF71],
- ["96EE",0xBF72],
- ["96EF",0xBF73],
- ["96F0",0xBF74],
- ["96F1",0xBF75],
- ["96F2",0xBF76],
- ["96F3",0xBF77],
- ["96F4",0xBF78],
- ["96F5",0xBF79],
- ["96F6",0xBF7A],
- ["96F7",0xBF7B],
- ["96F8",0xBF7C],
- ["96F9",0xBF7D],
- ["96FA",0xBF7E],
- ["96FB",0xBF7F],
- ["96FC",0xBF80],
- ["96FD",0xBF81],
- ["96FE",0xBF82],
- ["9741",0xBF83],
- ["9742",0xBF84],
- ["9743",0xBF85],
- ["9744",0xBF86],
- ["9745",0xBF87],
- ["9746",0xBF88],
- ["9747",0xBF89],
- ["9748",0xBF8A],
- ["9749",0xBF8B],
- ["974A",0xBF8C],
- ["974B",0xBF8D],
- ["974C",0xBF8E],
- ["974D",0xBF8F],
- ["974E",0xBF90],
- ["974F",0xBF91],
- ["9750",0xBF92],
- ["9751",0xBF93],
- ["9752",0xBF95],
- ["9753",0xBF96],
- ["9754",0xBF97],
- ["9755",0xBF98],
- ["9756",0xBF99],
- ["9757",0xBF9A],
- ["9758",0xBF9B],
- ["9759",0xBF9C],
- ["975A",0xBF9D],
- ["9761",0xBF9E],
- ["9762",0xBF9F],
- ["9763",0xBFA0],
- ["9764",0xBFA1],
- ["9765",0xBFA2],
- ["9766",0xBFA3],
- ["9767",0xBFA4],
- ["9768",0xBFA5],
- ["9769",0xBFA6],
- ["976A",0xBFA7],
- ["976B",0xBFA8],
- ["976C",0xBFA9],
- ["976D",0xBFAA],
- ["976E",0xBFAB],
- ["976F",0xBFAC],
- ["9770",0xBFAD],
- ["9771",0xBFAE],
- ["9772",0xBFAF],
- ["9773",0xBFB1],
- ["9774",0xBFB2],
- ["9775",0xBFB3],
- ["9776",0xBFB4],
- ["9777",0xBFB5],
- ["9778",0xBFB6],
- ["9779",0xBFB7],
- ["977A",0xBFB8],
- ["9781",0xBFB9],
- ["9782",0xBFBA],
- ["9783",0xBFBB],
- ["9784",0xBFBC],
- ["9785",0xBFBD],
- ["9786",0xBFBE],
- ["9787",0xBFBF],
- ["9788",0xBFC0],
- ["9789",0xBFC1],
- ["978A",0xBFC2],
- ["978B",0xBFC3],
- ["978C",0xBFC4],
- ["978D",0xBFC6],
- ["978E",0xBFC7],
- ["978F",0xBFC8],
- ["9790",0xBFC9],
- ["9791",0xBFCA],
- ["9792",0xBFCB],
- ["9793",0xBFCE],
- ["9794",0xBFCF],
- ["9795",0xBFD1],
- ["9796",0xBFD2],
- ["9797",0xBFD3],
- ["9798",0xBFD5],
- ["9799",0xBFD6],
- ["979A",0xBFD7],
- ["979B",0xBFD8],
- ["979C",0xBFD9],
- ["979D",0xBFDA],
- ["979E",0xBFDB],
- ["979F",0xBFDD],
- ["97A0",0xBFDE],
- ["97A1",0xBFE0],
- ["97A2",0xBFE2],
- ["97A3",0xBFE3],
- ["97A4",0xBFE4],
- ["97A5",0xBFE5],
- ["97A6",0xBFE6],
- ["97A7",0xBFE7],
- ["97A8",0xBFE8],
- ["97A9",0xBFE9],
- ["97AA",0xBFEA],
- ["97AB",0xBFEB],
- ["97AC",0xBFEC],
- ["97AD",0xBFED],
- ["97AE",0xBFEE],
- ["97AF",0xBFEF],
- ["97B0",0xBFF0],
- ["97B1",0xBFF1],
- ["97B2",0xBFF2],
- ["97B3",0xBFF3],
- ["97B4",0xBFF4],
- ["97B5",0xBFF5],
- ["97B6",0xBFF6],
- ["97B7",0xBFF7],
- ["97B8",0xBFF8],
- ["97B9",0xBFF9],
- ["97BA",0xBFFA],
- ["97BB",0xBFFB],
- ["97BC",0xBFFC],
- ["97BD",0xBFFD],
- ["97BE",0xBFFE],
- ["97BF",0xBFFF],
- ["97C0",0xC000],
- ["97C1",0xC001],
- ["97C2",0xC002],
- ["97C3",0xC003],
- ["97C4",0xC004],
- ["97C5",0xC005],
- ["97C6",0xC006],
- ["97C7",0xC007],
- ["97C8",0xC008],
- ["97C9",0xC009],
- ["97CA",0xC00A],
- ["97CB",0xC00B],
- ["97CC",0xC00C],
- ["97CD",0xC00D],
- ["97CE",0xC00E],
- ["97CF",0xC00F],
- ["97D0",0xC010],
- ["97D1",0xC011],
- ["97D2",0xC012],
- ["97D3",0xC013],
- ["97D4",0xC014],
- ["97D5",0xC015],
- ["97D6",0xC016],
- ["97D7",0xC017],
- ["97D8",0xC018],
- ["97D9",0xC019],
- ["97DA",0xC01A],
- ["97DB",0xC01B],
- ["97DC",0xC01C],
- ["97DD",0xC01D],
- ["97DE",0xC01E],
- ["97DF",0xC01F],
- ["97E0",0xC020],
- ["97E1",0xC021],
- ["97E2",0xC022],
- ["97E3",0xC023],
- ["97E4",0xC024],
- ["97E5",0xC025],
- ["97E6",0xC026],
- ["97E7",0xC027],
- ["97E8",0xC028],
- ["97E9",0xC029],
- ["97EA",0xC02A],
- ["97EB",0xC02B],
- ["97EC",0xC02C],
- ["97ED",0xC02D],
- ["97EE",0xC02E],
- ["97EF",0xC02F],
- ["97F0",0xC030],
- ["97F1",0xC031],
- ["97F2",0xC032],
- ["97F3",0xC033],
- ["97F4",0xC034],
- ["97F5",0xC035],
- ["97F6",0xC036],
- ["97F7",0xC037],
- ["97F8",0xC038],
- ["97F9",0xC039],
- ["97FA",0xC03A],
- ["97FB",0xC03B],
- ["97FC",0xC03D],
- ["97FD",0xC03E],
- ["97FE",0xC03F],
- ["9841",0xC040],
- ["9842",0xC041],
- ["9843",0xC042],
- ["9844",0xC043],
- ["9845",0xC044],
- ["9846",0xC045],
- ["9847",0xC046],
- ["9848",0xC047],
- ["9849",0xC048],
- ["984A",0xC049],
- ["984B",0xC04A],
- ["984C",0xC04B],
- ["984D",0xC04C],
- ["984E",0xC04D],
- ["984F",0xC04E],
- ["9850",0xC04F],
- ["9851",0xC050],
- ["9852",0xC052],
- ["9853",0xC053],
- ["9854",0xC054],
- ["9855",0xC055],
- ["9856",0xC056],
- ["9857",0xC057],
- ["9858",0xC059],
- ["9859",0xC05A],
- ["985A",0xC05B],
- ["9861",0xC05D],
- ["9862",0xC05E],
- ["9863",0xC05F],
- ["9864",0xC061],
- ["9865",0xC062],
- ["9866",0xC063],
- ["9867",0xC064],
- ["9868",0xC065],
- ["9869",0xC066],
- ["986A",0xC067],
- ["986B",0xC06A],
- ["986C",0xC06B],
- ["986D",0xC06C],
- ["986E",0xC06D],
- ["986F",0xC06E],
- ["9870",0xC06F],
- ["9871",0xC070],
- ["9872",0xC071],
- ["9873",0xC072],
- ["9874",0xC073],
- ["9875",0xC074],
- ["9876",0xC075],
- ["9877",0xC076],
- ["9878",0xC077],
- ["9879",0xC078],
- ["987A",0xC079],
- ["9881",0xC07A],
- ["9882",0xC07B],
- ["9883",0xC07C],
- ["9884",0xC07D],
- ["9885",0xC07E],
- ["9886",0xC07F],
- ["9887",0xC080],
- ["9888",0xC081],
- ["9889",0xC082],
- ["988A",0xC083],
- ["988B",0xC084],
- ["988C",0xC085],
- ["988D",0xC086],
- ["988E",0xC087],
- ["988F",0xC088],
- ["9890",0xC089],
- ["9891",0xC08A],
- ["9892",0xC08B],
- ["9893",0xC08C],
- ["9894",0xC08D],
- ["9895",0xC08E],
- ["9896",0xC08F],
- ["9897",0xC092],
- ["9898",0xC093],
- ["9899",0xC095],
- ["989A",0xC096],
- ["989B",0xC097],
- ["989C",0xC099],
- ["989D",0xC09A],
- ["989E",0xC09B],
- ["989F",0xC09C],
- ["98A0",0xC09D],
- ["98A1",0xC09E],
- ["98A2",0xC09F],
- ["98A3",0xC0A2],
- ["98A4",0xC0A4],
- ["98A5",0xC0A6],
- ["98A6",0xC0A7],
- ["98A7",0xC0A8],
- ["98A8",0xC0A9],
- ["98A9",0xC0AA],
- ["98AA",0xC0AB],
- ["98AB",0xC0AE],
- ["98AC",0xC0B1],
- ["98AD",0xC0B2],
- ["98AE",0xC0B7],
- ["98AF",0xC0B8],
- ["98B0",0xC0B9],
- ["98B1",0xC0BA],
- ["98B2",0xC0BB],
- ["98B3",0xC0BE],
- ["98B4",0xC0C2],
- ["98B5",0xC0C3],
- ["98B6",0xC0C4],
- ["98B7",0xC0C6],
- ["98B8",0xC0C7],
- ["98B9",0xC0CA],
- ["98BA",0xC0CB],
- ["98BB",0xC0CD],
- ["98BC",0xC0CE],
- ["98BD",0xC0CF],
- ["98BE",0xC0D1],
- ["98BF",0xC0D2],
- ["98C0",0xC0D3],
- ["98C1",0xC0D4],
- ["98C2",0xC0D5],
- ["98C3",0xC0D6],
- ["98C4",0xC0D7],
- ["98C5",0xC0DA],
- ["98C6",0xC0DE],
- ["98C7",0xC0DF],
- ["98C8",0xC0E0],
- ["98C9",0xC0E1],
- ["98CA",0xC0E2],
- ["98CB",0xC0E3],
- ["98CC",0xC0E6],
- ["98CD",0xC0E7],
- ["98CE",0xC0E9],
- ["98CF",0xC0EA],
- ["98D0",0xC0EB],
- ["98D1",0xC0ED],
- ["98D2",0xC0EE],
- ["98D3",0xC0EF],
- ["98D4",0xC0F0],
- ["98D5",0xC0F1],
- ["98D6",0xC0F2],
- ["98D7",0xC0F3],
- ["98D8",0xC0F6],
- ["98D9",0xC0F8],
- ["98DA",0xC0FA],
- ["98DB",0xC0FB],
- ["98DC",0xC0FC],
- ["98DD",0xC0FD],
- ["98DE",0xC0FE],
- ["98DF",0xC0FF],
- ["98E0",0xC101],
- ["98E1",0xC102],
- ["98E2",0xC103],
- ["98E3",0xC105],
- ["98E4",0xC106],
- ["98E5",0xC107],
- ["98E6",0xC109],
- ["98E7",0xC10A],
- ["98E8",0xC10B],
- ["98E9",0xC10C],
- ["98EA",0xC10D],
- ["98EB",0xC10E],
- ["98EC",0xC10F],
- ["98ED",0xC111],
- ["98EE",0xC112],
- ["98EF",0xC113],
- ["98F0",0xC114],
- ["98F1",0xC116],
- ["98F2",0xC117],
- ["98F3",0xC118],
- ["98F4",0xC119],
- ["98F5",0xC11A],
- ["98F6",0xC11B],
- ["98F7",0xC121],
- ["98F8",0xC122],
- ["98F9",0xC125],
- ["98FA",0xC128],
- ["98FB",0xC129],
- ["98FC",0xC12A],
- ["98FD",0xC12B],
- ["98FE",0xC12E],
- ["9941",0xC132],
- ["9942",0xC133],
- ["9943",0xC134],
- ["9944",0xC135],
- ["9945",0xC137],
- ["9946",0xC13A],
- ["9947",0xC13B],
- ["9948",0xC13D],
- ["9949",0xC13E],
- ["994A",0xC13F],
- ["994B",0xC141],
- ["994C",0xC142],
- ["994D",0xC143],
- ["994E",0xC144],
- ["994F",0xC145],
- ["9950",0xC146],
- ["9951",0xC147],
- ["9952",0xC14A],
- ["9953",0xC14E],
- ["9954",0xC14F],
- ["9955",0xC150],
- ["9956",0xC151],
- ["9957",0xC152],
- ["9958",0xC153],
- ["9959",0xC156],
- ["995A",0xC157],
- ["9961",0xC159],
- ["9962",0xC15A],
- ["9963",0xC15B],
- ["9964",0xC15D],
- ["9965",0xC15E],
- ["9966",0xC15F],
- ["9967",0xC160],
- ["9968",0xC161],
- ["9969",0xC162],
- ["996A",0xC163],
- ["996B",0xC166],
- ["996C",0xC16A],
- ["996D",0xC16B],
- ["996E",0xC16C],
- ["996F",0xC16D],
- ["9970",0xC16E],
- ["9971",0xC16F],
- ["9972",0xC171],
- ["9973",0xC172],
- ["9974",0xC173],
- ["9975",0xC175],
- ["9976",0xC176],
- ["9977",0xC177],
- ["9978",0xC179],
- ["9979",0xC17A],
- ["997A",0xC17B],
- ["9981",0xC17C],
- ["9982",0xC17D],
- ["9983",0xC17E],
- ["9984",0xC17F],
- ["9985",0xC180],
- ["9986",0xC181],
- ["9987",0xC182],
- ["9988",0xC183],
- ["9989",0xC184],
- ["998A",0xC186],
- ["998B",0xC187],
- ["998C",0xC188],
- ["998D",0xC189],
- ["998E",0xC18A],
- ["998F",0xC18B],
- ["9990",0xC18F],
- ["9991",0xC191],
- ["9992",0xC192],
- ["9993",0xC193],
- ["9994",0xC195],
- ["9995",0xC197],
- ["9996",0xC198],
- ["9997",0xC199],
- ["9998",0xC19A],
- ["9999",0xC19B],
- ["999A",0xC19E],
- ["999B",0xC1A0],
- ["999C",0xC1A2],
- ["999D",0xC1A3],
- ["999E",0xC1A4],
- ["999F",0xC1A6],
- ["99A0",0xC1A7],
- ["99A1",0xC1AA],
- ["99A2",0xC1AB],
- ["99A3",0xC1AD],
- ["99A4",0xC1AE],
- ["99A5",0xC1AF],
- ["99A6",0xC1B1],
- ["99A7",0xC1B2],
- ["99A8",0xC1B3],
- ["99A9",0xC1B4],
- ["99AA",0xC1B5],
- ["99AB",0xC1B6],
- ["99AC",0xC1B7],
- ["99AD",0xC1B8],
- ["99AE",0xC1B9],
- ["99AF",0xC1BA],
- ["99B0",0xC1BB],
- ["99B1",0xC1BC],
- ["99B2",0xC1BE],
- ["99B3",0xC1BF],
- ["99B4",0xC1C0],
- ["99B5",0xC1C1],
- ["99B6",0xC1C2],
- ["99B7",0xC1C3],
- ["99B8",0xC1C5],
- ["99B9",0xC1C6],
- ["99BA",0xC1C7],
- ["99BB",0xC1C9],
- ["99BC",0xC1CA],
- ["99BD",0xC1CB],
- ["99BE",0xC1CD],
- ["99BF",0xC1CE],
- ["99C0",0xC1CF],
- ["99C1",0xC1D0],
- ["99C2",0xC1D1],
- ["99C3",0xC1D2],
- ["99C4",0xC1D3],
- ["99C5",0xC1D5],
- ["99C6",0xC1D6],
- ["99C7",0xC1D9],
- ["99C8",0xC1DA],
- ["99C9",0xC1DB],
- ["99CA",0xC1DC],
- ["99CB",0xC1DD],
- ["99CC",0xC1DE],
- ["99CD",0xC1DF],
- ["99CE",0xC1E1],
- ["99CF",0xC1E2],
- ["99D0",0xC1E3],
- ["99D1",0xC1E5],
- ["99D2",0xC1E6],
- ["99D3",0xC1E7],
- ["99D4",0xC1E9],
- ["99D5",0xC1EA],
- ["99D6",0xC1EB],
- ["99D7",0xC1EC],
- ["99D8",0xC1ED],
- ["99D9",0xC1EE],
- ["99DA",0xC1EF],
- ["99DB",0xC1F2],
- ["99DC",0xC1F4],
- ["99DD",0xC1F5],
- ["99DE",0xC1F6],
- ["99DF",0xC1F7],
- ["99E0",0xC1F8],
- ["99E1",0xC1F9],
- ["99E2",0xC1FA],
- ["99E3",0xC1FB],
- ["99E4",0xC1FE],
- ["99E5",0xC1FF],
- ["99E6",0xC201],
- ["99E7",0xC202],
- ["99E8",0xC203],
- ["99E9",0xC205],
- ["99EA",0xC206],
- ["99EB",0xC207],
- ["99EC",0xC208],
- ["99ED",0xC209],
- ["99EE",0xC20A],
- ["99EF",0xC20B],
- ["99F0",0xC20E],
- ["99F1",0xC210],
- ["99F2",0xC212],
- ["99F3",0xC213],
- ["99F4",0xC214],
- ["99F5",0xC215],
- ["99F6",0xC216],
- ["99F7",0xC217],
- ["99F8",0xC21A],
- ["99F9",0xC21B],
- ["99FA",0xC21D],
- ["99FB",0xC21E],
- ["99FC",0xC221],
- ["99FD",0xC222],
- ["99FE",0xC223],
- ["9A41",0xC224],
- ["9A42",0xC225],
- ["9A43",0xC226],
- ["9A44",0xC227],
- ["9A45",0xC22A],
- ["9A46",0xC22C],
- ["9A47",0xC22E],
- ["9A48",0xC230],
- ["9A49",0xC233],
- ["9A4A",0xC235],
- ["9A4B",0xC236],
- ["9A4C",0xC237],
- ["9A4D",0xC238],
- ["9A4E",0xC239],
- ["9A4F",0xC23A],
- ["9A50",0xC23B],
- ["9A51",0xC23C],
- ["9A52",0xC23D],
- ["9A53",0xC23E],
- ["9A54",0xC23F],
- ["9A55",0xC240],
- ["9A56",0xC241],
- ["9A57",0xC242],
- ["9A58",0xC243],
- ["9A59",0xC244],
- ["9A5A",0xC245],
- ["9A61",0xC246],
- ["9A62",0xC247],
- ["9A63",0xC249],
- ["9A64",0xC24A],
- ["9A65",0xC24B],
- ["9A66",0xC24C],
- ["9A67",0xC24D],
- ["9A68",0xC24E],
- ["9A69",0xC24F],
- ["9A6A",0xC252],
- ["9A6B",0xC253],
- ["9A6C",0xC255],
- ["9A6D",0xC256],
- ["9A6E",0xC257],
- ["9A6F",0xC259],
- ["9A70",0xC25A],
- ["9A71",0xC25B],
- ["9A72",0xC25C],
- ["9A73",0xC25D],
- ["9A74",0xC25E],
- ["9A75",0xC25F],
- ["9A76",0xC261],
- ["9A77",0xC262],
- ["9A78",0xC263],
- ["9A79",0xC264],
- ["9A7A",0xC266],
- ["9A81",0xC267],
- ["9A82",0xC268],
- ["9A83",0xC269],
- ["9A84",0xC26A],
- ["9A85",0xC26B],
- ["9A86",0xC26E],
- ["9A87",0xC26F],
- ["9A88",0xC271],
- ["9A89",0xC272],
- ["9A8A",0xC273],
- ["9A8B",0xC275],
- ["9A8C",0xC276],
- ["9A8D",0xC277],
- ["9A8E",0xC278],
- ["9A8F",0xC279],
- ["9A90",0xC27A],
- ["9A91",0xC27B],
- ["9A92",0xC27E],
- ["9A93",0xC280],
- ["9A94",0xC282],
- ["9A95",0xC283],
- ["9A96",0xC284],
- ["9A97",0xC285],
- ["9A98",0xC286],
- ["9A99",0xC287],
- ["9A9A",0xC28A],
- ["9A9B",0xC28B],
- ["9A9C",0xC28C],
- ["9A9D",0xC28D],
- ["9A9E",0xC28E],
- ["9A9F",0xC28F],
- ["9AA0",0xC291],
- ["9AA1",0xC292],
- ["9AA2",0xC293],
- ["9AA3",0xC294],
- ["9AA4",0xC295],
- ["9AA5",0xC296],
- ["9AA6",0xC297],
- ["9AA7",0xC299],
- ["9AA8",0xC29A],
- ["9AA9",0xC29C],
- ["9AAA",0xC29E],
- ["9AAB",0xC29F],
- ["9AAC",0xC2A0],
- ["9AAD",0xC2A1],
- ["9AAE",0xC2A2],
- ["9AAF",0xC2A3],
- ["9AB0",0xC2A6],
- ["9AB1",0xC2A7],
- ["9AB2",0xC2A9],
- ["9AB3",0xC2AA],
- ["9AB4",0xC2AB],
- ["9AB5",0xC2AE],
- ["9AB6",0xC2AF],
- ["9AB7",0xC2B0],
- ["9AB8",0xC2B1],
- ["9AB9",0xC2B2],
- ["9ABA",0xC2B3],
- ["9ABB",0xC2B6],
- ["9ABC",0xC2B8],
- ["9ABD",0xC2BA],
- ["9ABE",0xC2BB],
- ["9ABF",0xC2BC],
- ["9AC0",0xC2BD],
- ["9AC1",0xC2BE],
- ["9AC2",0xC2BF],
- ["9AC3",0xC2C0],
- ["9AC4",0xC2C1],
- ["9AC5",0xC2C2],
- ["9AC6",0xC2C3],
- ["9AC7",0xC2C4],
- ["9AC8",0xC2C5],
- ["9AC9",0xC2C6],
- ["9ACA",0xC2C7],
- ["9ACB",0xC2C8],
- ["9ACC",0xC2C9],
- ["9ACD",0xC2CA],
- ["9ACE",0xC2CB],
- ["9ACF",0xC2CC],
- ["9AD0",0xC2CD],
- ["9AD1",0xC2CE],
- ["9AD2",0xC2CF],
- ["9AD3",0xC2D0],
- ["9AD4",0xC2D1],
- ["9AD5",0xC2D2],
- ["9AD6",0xC2D3],
- ["9AD7",0xC2D4],
- ["9AD8",0xC2D5],
- ["9AD9",0xC2D6],
- ["9ADA",0xC2D7],
- ["9ADB",0xC2D8],
- ["9ADC",0xC2D9],
- ["9ADD",0xC2DA],
- ["9ADE",0xC2DB],
- ["9ADF",0xC2DE],
- ["9AE0",0xC2DF],
- ["9AE1",0xC2E1],
- ["9AE2",0xC2E2],
- ["9AE3",0xC2E5],
- ["9AE4",0xC2E6],
- ["9AE5",0xC2E7],
- ["9AE6",0xC2E8],
- ["9AE7",0xC2E9],
- ["9AE8",0xC2EA],
- ["9AE9",0xC2EE],
- ["9AEA",0xC2F0],
- ["9AEB",0xC2F2],
- ["9AEC",0xC2F3],
- ["9AED",0xC2F4],
- ["9AEE",0xC2F5],
- ["9AEF",0xC2F7],
- ["9AF0",0xC2FA],
- ["9AF1",0xC2FD],
- ["9AF2",0xC2FE],
- ["9AF3",0xC2FF],
- ["9AF4",0xC301],
- ["9AF5",0xC302],
- ["9AF6",0xC303],
- ["9AF7",0xC304],
- ["9AF8",0xC305],
- ["9AF9",0xC306],
- ["9AFA",0xC307],
- ["9AFB",0xC30A],
- ["9AFC",0xC30B],
- ["9AFD",0xC30E],
- ["9AFE",0xC30F],
- ["9B41",0xC310],
- ["9B42",0xC311],
- ["9B43",0xC312],
- ["9B44",0xC316],
- ["9B45",0xC317],
- ["9B46",0xC319],
- ["9B47",0xC31A],
- ["9B48",0xC31B],
- ["9B49",0xC31D],
- ["9B4A",0xC31E],
- ["9B4B",0xC31F],
- ["9B4C",0xC320],
- ["9B4D",0xC321],
- ["9B4E",0xC322],
- ["9B4F",0xC323],
- ["9B50",0xC326],
- ["9B51",0xC327],
- ["9B52",0xC32A],
- ["9B53",0xC32B],
- ["9B54",0xC32C],
- ["9B55",0xC32D],
- ["9B56",0xC32E],
- ["9B57",0xC32F],
- ["9B58",0xC330],
- ["9B59",0xC331],
- ["9B5A",0xC332],
- ["9B61",0xC333],
- ["9B62",0xC334],
- ["9B63",0xC335],
- ["9B64",0xC336],
- ["9B65",0xC337],
- ["9B66",0xC338],
- ["9B67",0xC339],
- ["9B68",0xC33A],
- ["9B69",0xC33B],
- ["9B6A",0xC33C],
- ["9B6B",0xC33D],
- ["9B6C",0xC33E],
- ["9B6D",0xC33F],
- ["9B6E",0xC340],
- ["9B6F",0xC341],
- ["9B70",0xC342],
- ["9B71",0xC343],
- ["9B72",0xC344],
- ["9B73",0xC346],
- ["9B74",0xC347],
- ["9B75",0xC348],
- ["9B76",0xC349],
- ["9B77",0xC34A],
- ["9B78",0xC34B],
- ["9B79",0xC34C],
- ["9B7A",0xC34D],
- ["9B81",0xC34E],
- ["9B82",0xC34F],
- ["9B83",0xC350],
- ["9B84",0xC351],
- ["9B85",0xC352],
- ["9B86",0xC353],
- ["9B87",0xC354],
- ["9B88",0xC355],
- ["9B89",0xC356],
- ["9B8A",0xC357],
- ["9B8B",0xC358],
- ["9B8C",0xC359],
- ["9B8D",0xC35A],
- ["9B8E",0xC35B],
- ["9B8F",0xC35C],
- ["9B90",0xC35D],
- ["9B91",0xC35E],
- ["9B92",0xC35F],
- ["9B93",0xC360],
- ["9B94",0xC361],
- ["9B95",0xC362],
- ["9B96",0xC363],
- ["9B97",0xC364],
- ["9B98",0xC365],
- ["9B99",0xC366],
- ["9B9A",0xC367],
- ["9B9B",0xC36A],
- ["9B9C",0xC36B],
- ["9B9D",0xC36D],
- ["9B9E",0xC36E],
- ["9B9F",0xC36F],
- ["9BA0",0xC371],
- ["9BA1",0xC373],
- ["9BA2",0xC374],
- ["9BA3",0xC375],
- ["9BA4",0xC376],
- ["9BA5",0xC377],
- ["9BA6",0xC37A],
- ["9BA7",0xC37B],
- ["9BA8",0xC37E],
- ["9BA9",0xC37F],
- ["9BAA",0xC380],
- ["9BAB",0xC381],
- ["9BAC",0xC382],
- ["9BAD",0xC383],
- ["9BAE",0xC385],
- ["9BAF",0xC386],
- ["9BB0",0xC387],
- ["9BB1",0xC389],
- ["9BB2",0xC38A],
- ["9BB3",0xC38B],
- ["9BB4",0xC38D],
- ["9BB5",0xC38E],
- ["9BB6",0xC38F],
- ["9BB7",0xC390],
- ["9BB8",0xC391],
- ["9BB9",0xC392],
- ["9BBA",0xC393],
- ["9BBB",0xC394],
- ["9BBC",0xC395],
- ["9BBD",0xC396],
- ["9BBE",0xC397],
- ["9BBF",0xC398],
- ["9BC0",0xC399],
- ["9BC1",0xC39A],
- ["9BC2",0xC39B],
- ["9BC3",0xC39C],
- ["9BC4",0xC39D],
- ["9BC5",0xC39E],
- ["9BC6",0xC39F],
- ["9BC7",0xC3A0],
- ["9BC8",0xC3A1],
- ["9BC9",0xC3A2],
- ["9BCA",0xC3A3],
- ["9BCB",0xC3A4],
- ["9BCC",0xC3A5],
- ["9BCD",0xC3A6],
- ["9BCE",0xC3A7],
- ["9BCF",0xC3A8],
- ["9BD0",0xC3A9],
- ["9BD1",0xC3AA],
- ["9BD2",0xC3AB],
- ["9BD3",0xC3AC],
- ["9BD4",0xC3AD],
- ["9BD5",0xC3AE],
- ["9BD6",0xC3AF],
- ["9BD7",0xC3B0],
- ["9BD8",0xC3B1],
- ["9BD9",0xC3B2],
- ["9BDA",0xC3B3],
- ["9BDB",0xC3B4],
- ["9BDC",0xC3B5],
- ["9BDD",0xC3B6],
- ["9BDE",0xC3B7],
- ["9BDF",0xC3B8],
- ["9BE0",0xC3B9],
- ["9BE1",0xC3BA],
- ["9BE2",0xC3BB],
- ["9BE3",0xC3BC],
- ["9BE4",0xC3BD],
- ["9BE5",0xC3BE],
- ["9BE6",0xC3BF],
- ["9BE7",0xC3C1],
- ["9BE8",0xC3C2],
- ["9BE9",0xC3C3],
- ["9BEA",0xC3C4],
- ["9BEB",0xC3C5],
- ["9BEC",0xC3C6],
- ["9BED",0xC3C7],
- ["9BEE",0xC3C8],
- ["9BEF",0xC3C9],
- ["9BF0",0xC3CA],
- ["9BF1",0xC3CB],
- ["9BF2",0xC3CC],
- ["9BF3",0xC3CD],
- ["9BF4",0xC3CE],
- ["9BF5",0xC3CF],
- ["9BF6",0xC3D0],
- ["9BF7",0xC3D1],
- ["9BF8",0xC3D2],
- ["9BF9",0xC3D3],
- ["9BFA",0xC3D4],
- ["9BFB",0xC3D5],
- ["9BFC",0xC3D6],
- ["9BFD",0xC3D7],
- ["9BFE",0xC3DA],
- ["9C41",0xC3DB],
- ["9C42",0xC3DD],
- ["9C43",0xC3DE],
- ["9C44",0xC3E1],
- ["9C45",0xC3E3],
- ["9C46",0xC3E4],
- ["9C47",0xC3E5],
- ["9C48",0xC3E6],
- ["9C49",0xC3E7],
- ["9C4A",0xC3EA],
- ["9C4B",0xC3EB],
- ["9C4C",0xC3EC],
- ["9C4D",0xC3EE],
- ["9C4E",0xC3EF],
- ["9C4F",0xC3F0],
- ["9C50",0xC3F1],
- ["9C51",0xC3F2],
- ["9C52",0xC3F3],
- ["9C53",0xC3F6],
- ["9C54",0xC3F7],
- ["9C55",0xC3F9],
- ["9C56",0xC3FA],
- ["9C57",0xC3FB],
- ["9C58",0xC3FC],
- ["9C59",0xC3FD],
- ["9C5A",0xC3FE],
- ["9C61",0xC3FF],
- ["9C62",0xC400],
- ["9C63",0xC401],
- ["9C64",0xC402],
- ["9C65",0xC403],
- ["9C66",0xC404],
- ["9C67",0xC405],
- ["9C68",0xC406],
- ["9C69",0xC407],
- ["9C6A",0xC409],
- ["9C6B",0xC40A],
- ["9C6C",0xC40B],
- ["9C6D",0xC40C],
- ["9C6E",0xC40D],
- ["9C6F",0xC40E],
- ["9C70",0xC40F],
- ["9C71",0xC411],
- ["9C72",0xC412],
- ["9C73",0xC413],
- ["9C74",0xC414],
- ["9C75",0xC415],
- ["9C76",0xC416],
- ["9C77",0xC417],
- ["9C78",0xC418],
- ["9C79",0xC419],
- ["9C7A",0xC41A],
- ["9C81",0xC41B],
- ["9C82",0xC41C],
- ["9C83",0xC41D],
- ["9C84",0xC41E],
- ["9C85",0xC41F],
- ["9C86",0xC420],
- ["9C87",0xC421],
- ["9C88",0xC422],
- ["9C89",0xC423],
- ["9C8A",0xC425],
- ["9C8B",0xC426],
- ["9C8C",0xC427],
- ["9C8D",0xC428],
- ["9C8E",0xC429],
- ["9C8F",0xC42A],
- ["9C90",0xC42B],
- ["9C91",0xC42D],
- ["9C92",0xC42E],
- ["9C93",0xC42F],
- ["9C94",0xC431],
- ["9C95",0xC432],
- ["9C96",0xC433],
- ["9C97",0xC435],
- ["9C98",0xC436],
- ["9C99",0xC437],
- ["9C9A",0xC438],
- ["9C9B",0xC439],
- ["9C9C",0xC43A],
- ["9C9D",0xC43B],
- ["9C9E",0xC43E],
- ["9C9F",0xC43F],
- ["9CA0",0xC440],
- ["9CA1",0xC441],
- ["9CA2",0xC442],
- ["9CA3",0xC443],
- ["9CA4",0xC444],
- ["9CA5",0xC445],
- ["9CA6",0xC446],
- ["9CA7",0xC447],
- ["9CA8",0xC449],
- ["9CA9",0xC44A],
- ["9CAA",0xC44B],
- ["9CAB",0xC44C],
- ["9CAC",0xC44D],
- ["9CAD",0xC44E],
- ["9CAE",0xC44F],
- ["9CAF",0xC450],
- ["9CB0",0xC451],
- ["9CB1",0xC452],
- ["9CB2",0xC453],
- ["9CB3",0xC454],
- ["9CB4",0xC455],
- ["9CB5",0xC456],
- ["9CB6",0xC457],
- ["9CB7",0xC458],
- ["9CB8",0xC459],
- ["9CB9",0xC45A],
- ["9CBA",0xC45B],
- ["9CBB",0xC45C],
- ["9CBC",0xC45D],
- ["9CBD",0xC45E],
- ["9CBE",0xC45F],
- ["9CBF",0xC460],
- ["9CC0",0xC461],
- ["9CC1",0xC462],
- ["9CC2",0xC463],
- ["9CC3",0xC466],
- ["9CC4",0xC467],
- ["9CC5",0xC469],
- ["9CC6",0xC46A],
- ["9CC7",0xC46B],
- ["9CC8",0xC46D],
- ["9CC9",0xC46E],
- ["9CCA",0xC46F],
- ["9CCB",0xC470],
- ["9CCC",0xC471],
- ["9CCD",0xC472],
- ["9CCE",0xC473],
- ["9CCF",0xC476],
- ["9CD0",0xC477],
- ["9CD1",0xC478],
- ["9CD2",0xC47A],
- ["9CD3",0xC47B],
- ["9CD4",0xC47C],
- ["9CD5",0xC47D],
- ["9CD6",0xC47E],
- ["9CD7",0xC47F],
- ["9CD8",0xC481],
- ["9CD9",0xC482],
- ["9CDA",0xC483],
- ["9CDB",0xC484],
- ["9CDC",0xC485],
- ["9CDD",0xC486],
- ["9CDE",0xC487],
- ["9CDF",0xC488],
- ["9CE0",0xC489],
- ["9CE1",0xC48A],
- ["9CE2",0xC48B],
- ["9CE3",0xC48C],
- ["9CE4",0xC48D],
- ["9CE5",0xC48E],
- ["9CE6",0xC48F],
- ["9CE7",0xC490],
- ["9CE8",0xC491],
- ["9CE9",0xC492],
- ["9CEA",0xC493],
- ["9CEB",0xC495],
- ["9CEC",0xC496],
- ["9CED",0xC497],
- ["9CEE",0xC498],
- ["9CEF",0xC499],
- ["9CF0",0xC49A],
- ["9CF1",0xC49B],
- ["9CF2",0xC49D],
- ["9CF3",0xC49E],
- ["9CF4",0xC49F],
- ["9CF5",0xC4A0],
- ["9CF6",0xC4A1],
- ["9CF7",0xC4A2],
- ["9CF8",0xC4A3],
- ["9CF9",0xC4A4],
- ["9CFA",0xC4A5],
- ["9CFB",0xC4A6],
- ["9CFC",0xC4A7],
- ["9CFD",0xC4A8],
- ["9CFE",0xC4A9],
- ["9D41",0xC4AA],
- ["9D42",0xC4AB],
- ["9D43",0xC4AC],
- ["9D44",0xC4AD],
- ["9D45",0xC4AE],
- ["9D46",0xC4AF],
- ["9D47",0xC4B0],
- ["9D48",0xC4B1],
- ["9D49",0xC4B2],
- ["9D4A",0xC4B3],
- ["9D4B",0xC4B4],
- ["9D4C",0xC4B5],
- ["9D4D",0xC4B6],
- ["9D4E",0xC4B7],
- ["9D4F",0xC4B9],
- ["9D50",0xC4BA],
- ["9D51",0xC4BB],
- ["9D52",0xC4BD],
- ["9D53",0xC4BE],
- ["9D54",0xC4BF],
- ["9D55",0xC4C0],
- ["9D56",0xC4C1],
- ["9D57",0xC4C2],
- ["9D58",0xC4C3],
- ["9D59",0xC4C4],
- ["9D5A",0xC4C5],
- ["9D61",0xC4C6],
- ["9D62",0xC4C7],
- ["9D63",0xC4C8],
- ["9D64",0xC4C9],
- ["9D65",0xC4CA],
- ["9D66",0xC4CB],
- ["9D67",0xC4CC],
- ["9D68",0xC4CD],
- ["9D69",0xC4CE],
- ["9D6A",0xC4CF],
- ["9D6B",0xC4D0],
- ["9D6C",0xC4D1],
- ["9D6D",0xC4D2],
- ["9D6E",0xC4D3],
- ["9D6F",0xC4D4],
- ["9D70",0xC4D5],
- ["9D71",0xC4D6],
- ["9D72",0xC4D7],
- ["9D73",0xC4D8],
- ["9D74",0xC4D9],
- ["9D75",0xC4DA],
- ["9D76",0xC4DB],
- ["9D77",0xC4DC],
- ["9D78",0xC4DD],
- ["9D79",0xC4DE],
- ["9D7A",0xC4DF],
- ["9D81",0xC4E0],
- ["9D82",0xC4E1],
- ["9D83",0xC4E2],
- ["9D84",0xC4E3],
- ["9D85",0xC4E4],
- ["9D86",0xC4E5],
- ["9D87",0xC4E6],
- ["9D88",0xC4E7],
- ["9D89",0xC4E8],
- ["9D8A",0xC4EA],
- ["9D8B",0xC4EB],
- ["9D8C",0xC4EC],
- ["9D8D",0xC4ED],
- ["9D8E",0xC4EE],
- ["9D8F",0xC4EF],
- ["9D90",0xC4F2],
- ["9D91",0xC4F3],
- ["9D92",0xC4F5],
- ["9D93",0xC4F6],
- ["9D94",0xC4F7],
- ["9D95",0xC4F9],
- ["9D96",0xC4FB],
- ["9D97",0xC4FC],
- ["9D98",0xC4FD],
- ["9D99",0xC4FE],
- ["9D9A",0xC502],
- ["9D9B",0xC503],
- ["9D9C",0xC504],
- ["9D9D",0xC505],
- ["9D9E",0xC506],
- ["9D9F",0xC507],
- ["9DA0",0xC508],
- ["9DA1",0xC509],
- ["9DA2",0xC50A],
- ["9DA3",0xC50B],
- ["9DA4",0xC50D],
- ["9DA5",0xC50E],
- ["9DA6",0xC50F],
- ["9DA7",0xC511],
- ["9DA8",0xC512],
- ["9DA9",0xC513],
- ["9DAA",0xC515],
- ["9DAB",0xC516],
- ["9DAC",0xC517],
- ["9DAD",0xC518],
- ["9DAE",0xC519],
- ["9DAF",0xC51A],
- ["9DB0",0xC51B],
- ["9DB1",0xC51D],
- ["9DB2",0xC51E],
- ["9DB3",0xC51F],
- ["9DB4",0xC520],
- ["9DB5",0xC521],
- ["9DB6",0xC522],
- ["9DB7",0xC523],
- ["9DB8",0xC524],
- ["9DB9",0xC525],
- ["9DBA",0xC526],
- ["9DBB",0xC527],
- ["9DBC",0xC52A],
- ["9DBD",0xC52B],
- ["9DBE",0xC52D],
- ["9DBF",0xC52E],
- ["9DC0",0xC52F],
- ["9DC1",0xC531],
- ["9DC2",0xC532],
- ["9DC3",0xC533],
- ["9DC4",0xC534],
- ["9DC5",0xC535],
- ["9DC6",0xC536],
- ["9DC7",0xC537],
- ["9DC8",0xC53A],
- ["9DC9",0xC53C],
- ["9DCA",0xC53E],
- ["9DCB",0xC53F],
- ["9DCC",0xC540],
- ["9DCD",0xC541],
- ["9DCE",0xC542],
- ["9DCF",0xC543],
- ["9DD0",0xC546],
- ["9DD1",0xC547],
- ["9DD2",0xC54B],
- ["9DD3",0xC54F],
- ["9DD4",0xC550],
- ["9DD5",0xC551],
- ["9DD6",0xC552],
- ["9DD7",0xC556],
- ["9DD8",0xC55A],
- ["9DD9",0xC55B],
- ["9DDA",0xC55C],
- ["9DDB",0xC55F],
- ["9DDC",0xC562],
- ["9DDD",0xC563],
- ["9DDE",0xC565],
- ["9DDF",0xC566],
- ["9DE0",0xC567],
- ["9DE1",0xC569],
- ["9DE2",0xC56A],
- ["9DE3",0xC56B],
- ["9DE4",0xC56C],
- ["9DE5",0xC56D],
- ["9DE6",0xC56E],
- ["9DE7",0xC56F],
- ["9DE8",0xC572],
- ["9DE9",0xC576],
- ["9DEA",0xC577],
- ["9DEB",0xC578],
- ["9DEC",0xC579],
- ["9DED",0xC57A],
- ["9DEE",0xC57B],
- ["9DEF",0xC57E],
- ["9DF0",0xC57F],
- ["9DF1",0xC581],
- ["9DF2",0xC582],
- ["9DF3",0xC583],
- ["9DF4",0xC585],
- ["9DF5",0xC586],
- ["9DF6",0xC588],
- ["9DF7",0xC589],
- ["9DF8",0xC58A],
- ["9DF9",0xC58B],
- ["9DFA",0xC58E],
- ["9DFB",0xC590],
- ["9DFC",0xC592],
- ["9DFD",0xC593],
- ["9DFE",0xC594],
- ["9E41",0xC596],
- ["9E42",0xC599],
- ["9E43",0xC59A],
- ["9E44",0xC59B],
- ["9E45",0xC59D],
- ["9E46",0xC59E],
- ["9E47",0xC59F],
- ["9E48",0xC5A1],
- ["9E49",0xC5A2],
- ["9E4A",0xC5A3],
- ["9E4B",0xC5A4],
- ["9E4C",0xC5A5],
- ["9E4D",0xC5A6],
- ["9E4E",0xC5A7],
- ["9E4F",0xC5A8],
- ["9E50",0xC5AA],
- ["9E51",0xC5AB],
- ["9E52",0xC5AC],
- ["9E53",0xC5AD],
- ["9E54",0xC5AE],
- ["9E55",0xC5AF],
- ["9E56",0xC5B0],
- ["9E57",0xC5B1],
- ["9E58",0xC5B2],
- ["9E59",0xC5B3],
- ["9E5A",0xC5B6],
- ["9E61",0xC5B7],
- ["9E62",0xC5BA],
- ["9E63",0xC5BF],
- ["9E64",0xC5C0],
- ["9E65",0xC5C1],
- ["9E66",0xC5C2],
- ["9E67",0xC5C3],
- ["9E68",0xC5CB],
- ["9E69",0xC5CD],
- ["9E6A",0xC5CF],
- ["9E6B",0xC5D2],
- ["9E6C",0xC5D3],
- ["9E6D",0xC5D5],
- ["9E6E",0xC5D6],
- ["9E6F",0xC5D7],
- ["9E70",0xC5D9],
- ["9E71",0xC5DA],
- ["9E72",0xC5DB],
- ["9E73",0xC5DC],
- ["9E74",0xC5DD],
- ["9E75",0xC5DE],
- ["9E76",0xC5DF],
- ["9E77",0xC5E2],
- ["9E78",0xC5E4],
- ["9E79",0xC5E6],
- ["9E7A",0xC5E7],
- ["9E81",0xC5E8],
- ["9E82",0xC5E9],
- ["9E83",0xC5EA],
- ["9E84",0xC5EB],
- ["9E85",0xC5EF],
- ["9E86",0xC5F1],
- ["9E87",0xC5F2],
- ["9E88",0xC5F3],
- ["9E89",0xC5F5],
- ["9E8A",0xC5F8],
- ["9E8B",0xC5F9],
- ["9E8C",0xC5FA],
- ["9E8D",0xC5FB],
- ["9E8E",0xC602],
- ["9E8F",0xC603],
- ["9E90",0xC604],
- ["9E91",0xC609],
- ["9E92",0xC60A],
- ["9E93",0xC60B],
- ["9E94",0xC60D],
- ["9E95",0xC60E],
- ["9E96",0xC60F],
- ["9E97",0xC611],
- ["9E98",0xC612],
- ["9E99",0xC613],
- ["9E9A",0xC614],
- ["9E9B",0xC615],
- ["9E9C",0xC616],
- ["9E9D",0xC617],
- ["9E9E",0xC61A],
- ["9E9F",0xC61D],
- ["9EA0",0xC61E],
- ["9EA1",0xC61F],
- ["9EA2",0xC620],
- ["9EA3",0xC621],
- ["9EA4",0xC622],
- ["9EA5",0xC623],
- ["9EA6",0xC626],
- ["9EA7",0xC627],
- ["9EA8",0xC629],
- ["9EA9",0xC62A],
- ["9EAA",0xC62B],
- ["9EAB",0xC62F],
- ["9EAC",0xC631],
- ["9EAD",0xC632],
- ["9EAE",0xC636],
- ["9EAF",0xC638],
- ["9EB0",0xC63A],
- ["9EB1",0xC63C],
- ["9EB2",0xC63D],
- ["9EB3",0xC63E],
- ["9EB4",0xC63F],
- ["9EB5",0xC642],
- ["9EB6",0xC643],
- ["9EB7",0xC645],
- ["9EB8",0xC646],
- ["9EB9",0xC647],
- ["9EBA",0xC649],
- ["9EBB",0xC64A],
- ["9EBC",0xC64B],
- ["9EBD",0xC64C],
- ["9EBE",0xC64D],
- ["9EBF",0xC64E],
- ["9EC0",0xC64F],
- ["9EC1",0xC652],
- ["9EC2",0xC656],
- ["9EC3",0xC657],
- ["9EC4",0xC658],
- ["9EC5",0xC659],
- ["9EC6",0xC65A],
- ["9EC7",0xC65B],
- ["9EC8",0xC65E],
- ["9EC9",0xC65F],
- ["9ECA",0xC661],
- ["9ECB",0xC662],
- ["9ECC",0xC663],
- ["9ECD",0xC664],
- ["9ECE",0xC665],
- ["9ECF",0xC666],
- ["9ED0",0xC667],
- ["9ED1",0xC668],
- ["9ED2",0xC669],
- ["9ED3",0xC66A],
- ["9ED4",0xC66B],
- ["9ED5",0xC66D],
- ["9ED6",0xC66E],
- ["9ED7",0xC670],
- ["9ED8",0xC672],
- ["9ED9",0xC673],
- ["9EDA",0xC674],
- ["9EDB",0xC675],
- ["9EDC",0xC676],
- ["9EDD",0xC677],
- ["9EDE",0xC67A],
- ["9EDF",0xC67B],
- ["9EE0",0xC67D],
- ["9EE1",0xC67E],
- ["9EE2",0xC67F],
- ["9EE3",0xC681],
- ["9EE4",0xC682],
- ["9EE5",0xC683],
- ["9EE6",0xC684],
- ["9EE7",0xC685],
- ["9EE8",0xC686],
- ["9EE9",0xC687],
- ["9EEA",0xC68A],
- ["9EEB",0xC68C],
- ["9EEC",0xC68E],
- ["9EED",0xC68F],
- ["9EEE",0xC690],
- ["9EEF",0xC691],
- ["9EF0",0xC692],
- ["9EF1",0xC693],
- ["9EF2",0xC696],
- ["9EF3",0xC697],
- ["9EF4",0xC699],
- ["9EF5",0xC69A],
- ["9EF6",0xC69B],
- ["9EF7",0xC69D],
- ["9EF8",0xC69E],
- ["9EF9",0xC69F],
- ["9EFA",0xC6A0],
- ["9EFB",0xC6A1],
- ["9EFC",0xC6A2],
- ["9EFD",0xC6A3],
- ["9EFE",0xC6A6],
- ["9F41",0xC6A8],
- ["9F42",0xC6AA],
- ["9F43",0xC6AB],
- ["9F44",0xC6AC],
- ["9F45",0xC6AD],
- ["9F46",0xC6AE],
- ["9F47",0xC6AF],
- ["9F48",0xC6B2],
- ["9F49",0xC6B3],
- ["9F4A",0xC6B5],
- ["9F4B",0xC6B6],
- ["9F4C",0xC6B7],
- ["9F4D",0xC6BB],
- ["9F4E",0xC6BC],
- ["9F4F",0xC6BD],
- ["9F50",0xC6BE],
- ["9F51",0xC6BF],
- ["9F52",0xC6C2],
- ["9F53",0xC6C4],
- ["9F54",0xC6C6],
- ["9F55",0xC6C7],
- ["9F56",0xC6C8],
- ["9F57",0xC6C9],
- ["9F58",0xC6CA],
- ["9F59",0xC6CB],
- ["9F5A",0xC6CE],
- ["9F61",0xC6CF],
- ["9F62",0xC6D1],
- ["9F63",0xC6D2],
- ["9F64",0xC6D3],
- ["9F65",0xC6D5],
- ["9F66",0xC6D6],
- ["9F67",0xC6D7],
- ["9F68",0xC6D8],
- ["9F69",0xC6D9],
- ["9F6A",0xC6DA],
- ["9F6B",0xC6DB],
- ["9F6C",0xC6DE],
- ["9F6D",0xC6DF],
- ["9F6E",0xC6E2],
- ["9F6F",0xC6E3],
- ["9F70",0xC6E4],
- ["9F71",0xC6E5],
- ["9F72",0xC6E6],
- ["9F73",0xC6E7],
- ["9F74",0xC6EA],
- ["9F75",0xC6EB],
- ["9F76",0xC6ED],
- ["9F77",0xC6EE],
- ["9F78",0xC6EF],
- ["9F79",0xC6F1],
- ["9F7A",0xC6F2],
- ["9F81",0xC6F3],
- ["9F82",0xC6F4],
- ["9F83",0xC6F5],
- ["9F84",0xC6F6],
- ["9F85",0xC6F7],
- ["9F86",0xC6FA],
- ["9F87",0xC6FB],
- ["9F88",0xC6FC],
- ["9F89",0xC6FE],
- ["9F8A",0xC6FF],
- ["9F8B",0xC700],
- ["9F8C",0xC701],
- ["9F8D",0xC702],
- ["9F8E",0xC703],
- ["9F8F",0xC706],
- ["9F90",0xC707],
- ["9F91",0xC709],
- ["9F92",0xC70A],
- ["9F93",0xC70B],
- ["9F94",0xC70D],
- ["9F95",0xC70E],
- ["9F96",0xC70F],
- ["9F97",0xC710],
- ["9F98",0xC711],
- ["9F99",0xC712],
- ["9F9A",0xC713],
- ["9F9B",0xC716],
- ["9F9C",0xC718],
- ["9F9D",0xC71A],
- ["9F9E",0xC71B],
- ["9F9F",0xC71C],
- ["9FA0",0xC71D],
- ["9FA1",0xC71E],
- ["9FA2",0xC71F],
- ["9FA3",0xC722],
- ["9FA4",0xC723],
- ["9FA5",0xC725],
- ["9FA6",0xC726],
- ["9FA7",0xC727],
- ["9FA8",0xC729],
- ["9FA9",0xC72A],
- ["9FAA",0xC72B],
- ["9FAB",0xC72C],
- ["9FAC",0xC72D],
- ["9FAD",0xC72E],
- ["9FAE",0xC72F],
- ["9FAF",0xC732],
- ["9FB0",0xC734],
- ["9FB1",0xC736],
- ["9FB2",0xC738],
- ["9FB3",0xC739],
- ["9FB4",0xC73A],
- ["9FB5",0xC73B],
- ["9FB6",0xC73E],
- ["9FB7",0xC73F],
- ["9FB8",0xC741],
- ["9FB9",0xC742],
- ["9FBA",0xC743],
- ["9FBB",0xC745],
- ["9FBC",0xC746],
- ["9FBD",0xC747],
- ["9FBE",0xC748],
- ["9FBF",0xC749],
- ["9FC0",0xC74B],
- ["9FC1",0xC74E],
- ["9FC2",0xC750],
- ["9FC3",0xC759],
- ["9FC4",0xC75A],
- ["9FC5",0xC75B],
- ["9FC6",0xC75D],
- ["9FC7",0xC75E],
- ["9FC8",0xC75F],
- ["9FC9",0xC761],
- ["9FCA",0xC762],
- ["9FCB",0xC763],
- ["9FCC",0xC764],
- ["9FCD",0xC765],
- ["9FCE",0xC766],
- ["9FCF",0xC767],
- ["9FD0",0xC769],
- ["9FD1",0xC76A],
- ["9FD2",0xC76C],
- ["9FD3",0xC76D],
- ["9FD4",0xC76E],
- ["9FD5",0xC76F],
- ["9FD6",0xC770],
- ["9FD7",0xC771],
- ["9FD8",0xC772],
- ["9FD9",0xC773],
- ["9FDA",0xC776],
- ["9FDB",0xC777],
- ["9FDC",0xC779],
- ["9FDD",0xC77A],
- ["9FDE",0xC77B],
- ["9FDF",0xC77F],
- ["9FE0",0xC780],
- ["9FE1",0xC781],
- ["9FE2",0xC782],
- ["9FE3",0xC786],
- ["9FE4",0xC78B],
- ["9FE5",0xC78C],
- ["9FE6",0xC78D],
- ["9FE7",0xC78F],
- ["9FE8",0xC792],
- ["9FE9",0xC793],
- ["9FEA",0xC795],
- ["9FEB",0xC799],
- ["9FEC",0xC79B],
- ["9FED",0xC79C],
- ["9FEE",0xC79D],
- ["9FEF",0xC79E],
- ["9FF0",0xC79F],
- ["9FF1",0xC7A2],
- ["9FF2",0xC7A7],
- ["9FF3",0xC7A8],
- ["9FF4",0xC7A9],
- ["9FF5",0xC7AA],
- ["9FF6",0xC7AB],
- ["9FF7",0xC7AE],
- ["9FF8",0xC7AF],
- ["9FF9",0xC7B1],
- ["9FFA",0xC7B2],
- ["9FFB",0xC7B3],
- ["9FFC",0xC7B5],
- ["9FFD",0xC7B6],
- ["9FFE",0xC7B7],
- ["A041",0xC7B8],
- ["A042",0xC7B9],
- ["A043",0xC7BA],
- ["A044",0xC7BB],
- ["A045",0xC7BE],
- ["A046",0xC7C2],
- ["A047",0xC7C3],
- ["A048",0xC7C4],
- ["A049",0xC7C5],
- ["A04A",0xC7C6],
- ["A04B",0xC7C7],
- ["A04C",0xC7CA],
- ["A04D",0xC7CB],
- ["A04E",0xC7CD],
- ["A04F",0xC7CF],
- ["A050",0xC7D1],
- ["A051",0xC7D2],
- ["A052",0xC7D3],
- ["A053",0xC7D4],
- ["A054",0xC7D5],
- ["A055",0xC7D6],
- ["A056",0xC7D7],
- ["A057",0xC7D9],
- ["A058",0xC7DA],
- ["A059",0xC7DB],
- ["A05A",0xC7DC],
- ["A061",0xC7DE],
- ["A062",0xC7DF],
- ["A063",0xC7E0],
- ["A064",0xC7E1],
- ["A065",0xC7E2],
- ["A066",0xC7E3],
- ["A067",0xC7E5],
- ["A068",0xC7E6],
- ["A069",0xC7E7],
- ["A06A",0xC7E9],
- ["A06B",0xC7EA],
- ["A06C",0xC7EB],
- ["A06D",0xC7ED],
- ["A06E",0xC7EE],
- ["A06F",0xC7EF],
- ["A070",0xC7F0],
- ["A071",0xC7F1],
- ["A072",0xC7F2],
- ["A073",0xC7F3],
- ["A074",0xC7F4],
- ["A075",0xC7F5],
- ["A076",0xC7F6],
- ["A077",0xC7F7],
- ["A078",0xC7F8],
- ["A079",0xC7F9],
- ["A07A",0xC7FA],
- ["A081",0xC7FB],
- ["A082",0xC7FC],
- ["A083",0xC7FD],
- ["A084",0xC7FE],
- ["A085",0xC7FF],
- ["A086",0xC802],
- ["A087",0xC803],
- ["A088",0xC805],
- ["A089",0xC806],
- ["A08A",0xC807],
- ["A08B",0xC809],
- ["A08C",0xC80B],
- ["A08D",0xC80C],
- ["A08E",0xC80D],
- ["A08F",0xC80E],
- ["A090",0xC80F],
- ["A091",0xC812],
- ["A092",0xC814],
- ["A093",0xC817],
- ["A094",0xC818],
- ["A095",0xC819],
- ["A096",0xC81A],
- ["A097",0xC81B],
- ["A098",0xC81E],
- ["A099",0xC81F],
- ["A09A",0xC821],
- ["A09B",0xC822],
- ["A09C",0xC823],
- ["A09D",0xC825],
- ["A09E",0xC826],
- ["A09F",0xC827],
- ["A0A0",0xC828],
- ["A0A1",0xC829],
- ["A0A2",0xC82A],
- ["A0A3",0xC82B],
- ["A0A4",0xC82E],
- ["A0A5",0xC830],
- ["A0A6",0xC832],
- ["A0A7",0xC833],
- ["A0A8",0xC834],
- ["A0A9",0xC835],
- ["A0AA",0xC836],
- ["A0AB",0xC837],
- ["A0AC",0xC839],
- ["A0AD",0xC83A],
- ["A0AE",0xC83B],
- ["A0AF",0xC83D],
- ["A0B0",0xC83E],
- ["A0B1",0xC83F],
- ["A0B2",0xC841],
- ["A0B3",0xC842],
- ["A0B4",0xC843],
- ["A0B5",0xC844],
- ["A0B6",0xC845],
- ["A0B7",0xC846],
- ["A0B8",0xC847],
- ["A0B9",0xC84A],
- ["A0BA",0xC84B],
- ["A0BB",0xC84E],
- ["A0BC",0xC84F],
- ["A0BD",0xC850],
- ["A0BE",0xC851],
- ["A0BF",0xC852],
- ["A0C0",0xC853],
- ["A0C1",0xC855],
- ["A0C2",0xC856],
- ["A0C3",0xC857],
- ["A0C4",0xC858],
- ["A0C5",0xC859],
- ["A0C6",0xC85A],
- ["A0C7",0xC85B],
- ["A0C8",0xC85C],
- ["A0C9",0xC85D],
- ["A0CA",0xC85E],
- ["A0CB",0xC85F],
- ["A0CC",0xC860],
- ["A0CD",0xC861],
- ["A0CE",0xC862],
- ["A0CF",0xC863],
- ["A0D0",0xC864],
- ["A0D1",0xC865],
- ["A0D2",0xC866],
- ["A0D3",0xC867],
- ["A0D4",0xC868],
- ["A0D5",0xC869],
- ["A0D6",0xC86A],
- ["A0D7",0xC86B],
- ["A0D8",0xC86C],
- ["A0D9",0xC86D],
- ["A0DA",0xC86E],
- ["A0DB",0xC86F],
- ["A0DC",0xC872],
- ["A0DD",0xC873],
- ["A0DE",0xC875],
- ["A0DF",0xC876],
- ["A0E0",0xC877],
- ["A0E1",0xC879],
- ["A0E2",0xC87B],
- ["A0E3",0xC87C],
- ["A0E4",0xC87D],
- ["A0E5",0xC87E],
- ["A0E6",0xC87F],
- ["A0E7",0xC882],
- ["A0E8",0xC884],
- ["A0E9",0xC888],
- ["A0EA",0xC889],
- ["A0EB",0xC88A],
- ["A0EC",0xC88E],
- ["A0ED",0xC88F],
- ["A0EE",0xC890],
- ["A0EF",0xC891],
- ["A0F0",0xC892],
- ["A0F1",0xC893],
- ["A0F2",0xC895],
- ["A0F3",0xC896],
- ["A0F4",0xC897],
- ["A0F5",0xC898],
- ["A0F6",0xC899],
- ["A0F7",0xC89A],
- ["A0F8",0xC89B],
- ["A0F9",0xC89C],
- ["A0FA",0xC89E],
- ["A0FB",0xC8A0],
- ["A0FC",0xC8A2],
- ["A0FD",0xC8A3],
- ["A0FE",0xC8A4],
- ["A141",0xC8A5],
- ["A142",0xC8A6],
- ["A143",0xC8A7],
- ["A144",0xC8A9],
- ["A145",0xC8AA],
- ["A146",0xC8AB],
- ["A147",0xC8AC],
- ["A148",0xC8AD],
- ["A149",0xC8AE],
- ["A14A",0xC8AF],
- ["A14B",0xC8B0],
- ["A14C",0xC8B1],
- ["A14D",0xC8B2],
- ["A14E",0xC8B3],
- ["A14F",0xC8B4],
- ["A150",0xC8B5],
- ["A151",0xC8B6],
- ["A152",0xC8B7],
- ["A153",0xC8B8],
- ["A154",0xC8B9],
- ["A155",0xC8BA],
- ["A156",0xC8BB],
- ["A157",0xC8BE],
- ["A158",0xC8BF],
- ["A159",0xC8C0],
- ["A15A",0xC8C1],
- ["A161",0xC8C2],
- ["A162",0xC8C3],
- ["A163",0xC8C5],
- ["A164",0xC8C6],
- ["A165",0xC8C7],
- ["A166",0xC8C9],
- ["A167",0xC8CA],
- ["A168",0xC8CB],
- ["A169",0xC8CD],
- ["A16A",0xC8CE],
- ["A16B",0xC8CF],
- ["A16C",0xC8D0],
- ["A16D",0xC8D1],
- ["A16E",0xC8D2],
- ["A16F",0xC8D3],
- ["A170",0xC8D6],
- ["A171",0xC8D8],
- ["A172",0xC8DA],
- ["A173",0xC8DB],
- ["A174",0xC8DC],
- ["A175",0xC8DD],
- ["A176",0xC8DE],
- ["A177",0xC8DF],
- ["A178",0xC8E2],
- ["A179",0xC8E3],
- ["A17A",0xC8E5],
- ["A181",0xC8E6],
- ["A182",0xC8E7],
- ["A183",0xC8E8],
- ["A184",0xC8E9],
- ["A185",0xC8EA],
- ["A186",0xC8EB],
- ["A187",0xC8EC],
- ["A188",0xC8ED],
- ["A189",0xC8EE],
- ["A18A",0xC8EF],
- ["A18B",0xC8F0],
- ["A18C",0xC8F1],
- ["A18D",0xC8F2],
- ["A18E",0xC8F3],
- ["A18F",0xC8F4],
- ["A190",0xC8F6],
- ["A191",0xC8F7],
- ["A192",0xC8F8],
- ["A193",0xC8F9],
- ["A194",0xC8FA],
- ["A195",0xC8FB],
- ["A196",0xC8FE],
- ["A197",0xC8FF],
- ["A198",0xC901],
- ["A199",0xC902],
- ["A19A",0xC903],
- ["A19B",0xC907],
- ["A19C",0xC908],
- ["A19D",0xC909],
- ["A19E",0xC90A],
- ["A19F",0xC90B],
- ["A1A0",0xC90E],
- ["A241",0xC910],
- ["A242",0xC912],
- ["A243",0xC913],
- ["A244",0xC914],
- ["A245",0xC915],
- ["A246",0xC916],
- ["A247",0xC917],
- ["A248",0xC919],
- ["A249",0xC91A],
- ["A24A",0xC91B],
- ["A24B",0xC91C],
- ["A24C",0xC91D],
- ["A24D",0xC91E],
- ["A24E",0xC91F],
- ["A24F",0xC920],
- ["A250",0xC921],
- ["A251",0xC922],
- ["A252",0xC923],
- ["A253",0xC924],
- ["A254",0xC925],
- ["A255",0xC926],
- ["A256",0xC927],
- ["A257",0xC928],
- ["A258",0xC929],
- ["A259",0xC92A],
- ["A25A",0xC92B],
- ["A261",0xC92D],
- ["A262",0xC92E],
- ["A263",0xC92F],
- ["A264",0xC930],
- ["A265",0xC931],
- ["A266",0xC932],
- ["A267",0xC933],
- ["A268",0xC935],
- ["A269",0xC936],
- ["A26A",0xC937],
- ["A26B",0xC938],
- ["A26C",0xC939],
- ["A26D",0xC93A],
- ["A26E",0xC93B],
- ["A26F",0xC93C],
- ["A270",0xC93D],
- ["A271",0xC93E],
- ["A272",0xC93F],
- ["A273",0xC940],
- ["A274",0xC941],
- ["A275",0xC942],
- ["A276",0xC943],
- ["A277",0xC944],
- ["A278",0xC945],
- ["A279",0xC946],
- ["A27A",0xC947],
- ["A281",0xC948],
- ["A282",0xC949],
- ["A283",0xC94A],
- ["A284",0xC94B],
- ["A285",0xC94C],
- ["A286",0xC94D],
- ["A287",0xC94E],
- ["A288",0xC94F],
- ["A289",0xC952],
- ["A28A",0xC953],
- ["A28B",0xC955],
- ["A28C",0xC956],
- ["A28D",0xC957],
- ["A28E",0xC959],
- ["A28F",0xC95A],
- ["A290",0xC95B],
- ["A291",0xC95C],
- ["A292",0xC95D],
- ["A293",0xC95E],
- ["A294",0xC95F],
- ["A295",0xC962],
- ["A296",0xC964],
- ["A297",0xC965],
- ["A298",0xC966],
- ["A299",0xC967],
- ["A29A",0xC968],
- ["A29B",0xC969],
- ["A29C",0xC96A],
- ["A29D",0xC96B],
- ["A29E",0xC96D],
- ["A29F",0xC96E],
- ["A2A0",0xC96F],
- ["A2E6",0x20AC],
- ["A2E7",0xAE],
- ["A341",0xC971],
- ["A342",0xC972],
- ["A343",0xC973],
- ["A344",0xC975],
- ["A345",0xC976],
- ["A346",0xC977],
- ["A347",0xC978],
- ["A348",0xC979],
- ["A349",0xC97A],
- ["A34A",0xC97B],
- ["A34B",0xC97D],
- ["A34C",0xC97E],
- ["A34D",0xC97F],
- ["A34E",0xC980],
- ["A34F",0xC981],
- ["A350",0xC982],
- ["A351",0xC983],
- ["A352",0xC984],
- ["A353",0xC985],
- ["A354",0xC986],
- ["A355",0xC987],
- ["A356",0xC98A],
- ["A357",0xC98B],
- ["A358",0xC98D],
- ["A359",0xC98E],
- ["A35A",0xC98F],
- ["A361",0xC991],
- ["A362",0xC992],
- ["A363",0xC993],
- ["A364",0xC994],
- ["A365",0xC995],
- ["A366",0xC996],
- ["A367",0xC997],
- ["A368",0xC99A],
- ["A369",0xC99C],
- ["A36A",0xC99E],
- ["A36B",0xC99F],
- ["A36C",0xC9A0],
- ["A36D",0xC9A1],
- ["A36E",0xC9A2],
- ["A36F",0xC9A3],
- ["A370",0xC9A4],
- ["A371",0xC9A5],
- ["A372",0xC9A6],
- ["A373",0xC9A7],
- ["A374",0xC9A8],
- ["A375",0xC9A9],
- ["A376",0xC9AA],
- ["A377",0xC9AB],
- ["A378",0xC9AC],
- ["A379",0xC9AD],
- ["A37A",0xC9AE],
- ["A381",0xC9AF],
- ["A382",0xC9B0],
- ["A383",0xC9B1],
- ["A384",0xC9B2],
- ["A385",0xC9B3],
- ["A386",0xC9B4],
- ["A387",0xC9B5],
- ["A388",0xC9B6],
- ["A389",0xC9B7],
- ["A38A",0xC9B8],
- ["A38B",0xC9B9],
- ["A38C",0xC9BA],
- ["A38D",0xC9BB],
- ["A38E",0xC9BC],
- ["A38F",0xC9BD],
- ["A390",0xC9BE],
- ["A391",0xC9BF],
- ["A392",0xC9C2],
- ["A393",0xC9C3],
- ["A394",0xC9C5],
- ["A395",0xC9C6],
- ["A396",0xC9C9],
- ["A397",0xC9CB],
- ["A398",0xC9CC],
- ["A399",0xC9CD],
- ["A39A",0xC9CE],
- ["A39B",0xC9CF],
- ["A39C",0xC9D2],
- ["A39D",0xC9D4],
- ["A39E",0xC9D7],
- ["A39F",0xC9D8],
- ["A3A0",0xC9DB],
- ["A441",0xC9DE],
- ["A442",0xC9DF],
- ["A443",0xC9E1],
- ["A444",0xC9E3],
- ["A445",0xC9E5],
- ["A446",0xC9E6],
- ["A447",0xC9E8],
- ["A448",0xC9E9],
- ["A449",0xC9EA],
- ["A44A",0xC9EB],
- ["A44B",0xC9EE],
- ["A44C",0xC9F2],
- ["A44D",0xC9F3],
- ["A44E",0xC9F4],
- ["A44F",0xC9F5],
- ["A450",0xC9F6],
- ["A451",0xC9F7],
- ["A452",0xC9FA],
- ["A453",0xC9FB],
- ["A454",0xC9FD],
- ["A455",0xC9FE],
- ["A456",0xC9FF],
- ["A457",0xCA01],
- ["A458",0xCA02],
- ["A459",0xCA03],
- ["A45A",0xCA04],
- ["A461",0xCA05],
- ["A462",0xCA06],
- ["A463",0xCA07],
- ["A464",0xCA0A],
- ["A465",0xCA0E],
- ["A466",0xCA0F],
- ["A467",0xCA10],
- ["A468",0xCA11],
- ["A469",0xCA12],
- ["A46A",0xCA13],
- ["A46B",0xCA15],
- ["A46C",0xCA16],
- ["A46D",0xCA17],
- ["A46E",0xCA19],
- ["A46F",0xCA1A],
- ["A470",0xCA1B],
- ["A471",0xCA1C],
- ["A472",0xCA1D],
- ["A473",0xCA1E],
- ["A474",0xCA1F],
- ["A475",0xCA20],
- ["A476",0xCA21],
- ["A477",0xCA22],
- ["A478",0xCA23],
- ["A479",0xCA24],
- ["A47A",0xCA25],
- ["A481",0xCA26],
- ["A482",0xCA27],
- ["A483",0xCA28],
- ["A484",0xCA2A],
- ["A485",0xCA2B],
- ["A486",0xCA2C],
- ["A487",0xCA2D],
- ["A488",0xCA2E],
- ["A489",0xCA2F],
- ["A48A",0xCA30],
- ["A48B",0xCA31],
- ["A48C",0xCA32],
- ["A48D",0xCA33],
- ["A48E",0xCA34],
- ["A48F",0xCA35],
- ["A490",0xCA36],
- ["A491",0xCA37],
- ["A492",0xCA38],
- ["A493",0xCA39],
- ["A494",0xCA3A],
- ["A495",0xCA3B],
- ["A496",0xCA3C],
- ["A497",0xCA3D],
- ["A498",0xCA3E],
- ["A499",0xCA3F],
- ["A49A",0xCA40],
- ["A49B",0xCA41],
- ["A49C",0xCA42],
- ["A49D",0xCA43],
- ["A49E",0xCA44],
- ["A49F",0xCA45],
- ["A4A0",0xCA46],
- ["A541",0xCA47],
- ["A542",0xCA48],
- ["A543",0xCA49],
- ["A544",0xCA4A],
- ["A545",0xCA4B],
- ["A546",0xCA4E],
- ["A547",0xCA4F],
- ["A548",0xCA51],
- ["A549",0xCA52],
- ["A54A",0xCA53],
- ["A54B",0xCA55],
- ["A54C",0xCA56],
- ["A54D",0xCA57],
- ["A54E",0xCA58],
- ["A54F",0xCA59],
- ["A550",0xCA5A],
- ["A551",0xCA5B],
- ["A552",0xCA5E],
- ["A553",0xCA62],
- ["A554",0xCA63],
- ["A555",0xCA64],
- ["A556",0xCA65],
- ["A557",0xCA66],
- ["A558",0xCA67],
- ["A559",0xCA69],
- ["A55A",0xCA6A],
- ["A561",0xCA6B],
- ["A562",0xCA6C],
- ["A563",0xCA6D],
- ["A564",0xCA6E],
- ["A565",0xCA6F],
- ["A566",0xCA70],
- ["A567",0xCA71],
- ["A568",0xCA72],
- ["A569",0xCA73],
- ["A56A",0xCA74],
- ["A56B",0xCA75],
- ["A56C",0xCA76],
- ["A56D",0xCA77],
- ["A56E",0xCA78],
- ["A56F",0xCA79],
- ["A570",0xCA7A],
- ["A571",0xCA7B],
- ["A572",0xCA7C],
- ["A573",0xCA7E],
- ["A574",0xCA7F],
- ["A575",0xCA80],
- ["A576",0xCA81],
- ["A577",0xCA82],
- ["A578",0xCA83],
- ["A579",0xCA85],
- ["A57A",0xCA86],
- ["A581",0xCA87],
- ["A582",0xCA88],
- ["A583",0xCA89],
- ["A584",0xCA8A],
- ["A585",0xCA8B],
- ["A586",0xCA8C],
- ["A587",0xCA8D],
- ["A588",0xCA8E],
- ["A589",0xCA8F],
- ["A58A",0xCA90],
- ["A58B",0xCA91],
- ["A58C",0xCA92],
- ["A58D",0xCA93],
- ["A58E",0xCA94],
- ["A58F",0xCA95],
- ["A590",0xCA96],
- ["A591",0xCA97],
- ["A592",0xCA99],
- ["A593",0xCA9A],
- ["A594",0xCA9B],
- ["A595",0xCA9C],
- ["A596",0xCA9D],
- ["A597",0xCA9E],
- ["A598",0xCA9F],
- ["A599",0xCAA0],
- ["A59A",0xCAA1],
- ["A59B",0xCAA2],
- ["A59C",0xCAA3],
- ["A59D",0xCAA4],
- ["A59E",0xCAA5],
- ["A59F",0xCAA6],
- ["A5A0",0xCAA7],
- ["A641",0xCAA8],
- ["A642",0xCAA9],
- ["A643",0xCAAA],
- ["A644",0xCAAB],
- ["A645",0xCAAC],
- ["A646",0xCAAD],
- ["A647",0xCAAE],
- ["A648",0xCAAF],
- ["A649",0xCAB0],
- ["A64A",0xCAB1],
- ["A64B",0xCAB2],
- ["A64C",0xCAB3],
- ["A64D",0xCAB4],
- ["A64E",0xCAB5],
- ["A64F",0xCAB6],
- ["A650",0xCAB7],
- ["A651",0xCAB8],
- ["A652",0xCAB9],
- ["A653",0xCABA],
- ["A654",0xCABB],
- ["A655",0xCABE],
- ["A656",0xCABF],
- ["A657",0xCAC1],
- ["A658",0xCAC2],
- ["A659",0xCAC3],
- ["A65A",0xCAC5],
- ["A661",0xCAC6],
- ["A662",0xCAC7],
- ["A663",0xCAC8],
- ["A664",0xCAC9],
- ["A665",0xCACA],
- ["A666",0xCACB],
- ["A667",0xCACE],
- ["A668",0xCAD0],
- ["A669",0xCAD2],
- ["A66A",0xCAD4],
- ["A66B",0xCAD5],
- ["A66C",0xCAD6],
- ["A66D",0xCAD7],
- ["A66E",0xCADA],
- ["A66F",0xCADB],
- ["A670",0xCADC],
- ["A671",0xCADD],
- ["A672",0xCADE],
- ["A673",0xCADF],
- ["A674",0xCAE1],
- ["A675",0xCAE2],
- ["A676",0xCAE3],
- ["A677",0xCAE4],
- ["A678",0xCAE5],
- ["A679",0xCAE6],
- ["A67A",0xCAE7],
- ["A681",0xCAE8],
- ["A682",0xCAE9],
- ["A683",0xCAEA],
- ["A684",0xCAEB],
- ["A685",0xCAED],
- ["A686",0xCAEE],
- ["A687",0xCAEF],
- ["A688",0xCAF0],
- ["A689",0xCAF1],
- ["A68A",0xCAF2],
- ["A68B",0xCAF3],
- ["A68C",0xCAF5],
- ["A68D",0xCAF6],
- ["A68E",0xCAF7],
- ["A68F",0xCAF8],
- ["A690",0xCAF9],
- ["A691",0xCAFA],
- ["A692",0xCAFB],
- ["A693",0xCAFC],
- ["A694",0xCAFD],
- ["A695",0xCAFE],
- ["A696",0xCAFF],
- ["A697",0xCB00],
- ["A698",0xCB01],
- ["A699",0xCB02],
- ["A69A",0xCB03],
- ["A69B",0xCB04],
- ["A69C",0xCB05],
- ["A69D",0xCB06],
- ["A69E",0xCB07],
- ["A69F",0xCB09],
- ["A6A0",0xCB0A],
- ["A741",0xCB0B],
- ["A742",0xCB0C],
- ["A743",0xCB0D],
- ["A744",0xCB0E],
- ["A745",0xCB0F],
- ["A746",0xCB11],
- ["A747",0xCB12],
- ["A748",0xCB13],
- ["A749",0xCB15],
- ["A74A",0xCB16],
- ["A74B",0xCB17],
- ["A74C",0xCB19],
- ["A74D",0xCB1A],
- ["A74E",0xCB1B],
- ["A74F",0xCB1C],
- ["A750",0xCB1D],
- ["A751",0xCB1E],
- ["A752",0xCB1F],
- ["A753",0xCB22],
- ["A754",0xCB23],
- ["A755",0xCB24],
- ["A756",0xCB25],
- ["A757",0xCB26],
- ["A758",0xCB27],
- ["A759",0xCB28],
- ["A75A",0xCB29],
- ["A761",0xCB2A],
- ["A762",0xCB2B],
- ["A763",0xCB2C],
- ["A764",0xCB2D],
- ["A765",0xCB2E],
- ["A766",0xCB2F],
- ["A767",0xCB30],
- ["A768",0xCB31],
- ["A769",0xCB32],
- ["A76A",0xCB33],
- ["A76B",0xCB34],
- ["A76C",0xCB35],
- ["A76D",0xCB36],
- ["A76E",0xCB37],
- ["A76F",0xCB38],
- ["A770",0xCB39],
- ["A771",0xCB3A],
- ["A772",0xCB3B],
- ["A773",0xCB3C],
- ["A774",0xCB3D],
- ["A775",0xCB3E],
- ["A776",0xCB3F],
- ["A777",0xCB40],
- ["A778",0xCB42],
- ["A779",0xCB43],
- ["A77A",0xCB44],
- ["A781",0xCB45],
- ["A782",0xCB46],
- ["A783",0xCB47],
- ["A784",0xCB4A],
- ["A785",0xCB4B],
- ["A786",0xCB4D],
- ["A787",0xCB4E],
- ["A788",0xCB4F],
- ["A789",0xCB51],
- ["A78A",0xCB52],
- ["A78B",0xCB53],
- ["A78C",0xCB54],
- ["A78D",0xCB55],
- ["A78E",0xCB56],
- ["A78F",0xCB57],
- ["A790",0xCB5A],
- ["A791",0xCB5B],
- ["A792",0xCB5C],
- ["A793",0xCB5E],
- ["A794",0xCB5F],
- ["A795",0xCB60],
- ["A796",0xCB61],
- ["A797",0xCB62],
- ["A798",0xCB63],
- ["A799",0xCB65],
- ["A79A",0xCB66],
- ["A79B",0xCB67],
- ["A79C",0xCB68],
- ["A79D",0xCB69],
- ["A79E",0xCB6A],
- ["A79F",0xCB6B],
- ["A7A0",0xCB6C],
- ["A841",0xCB6D],
- ["A842",0xCB6E],
- ["A843",0xCB6F],
- ["A844",0xCB70],
- ["A845",0xCB71],
- ["A846",0xCB72],
- ["A847",0xCB73],
- ["A848",0xCB74],
- ["A849",0xCB75],
- ["A84A",0xCB76],
- ["A84B",0xCB77],
- ["A84C",0xCB7A],
- ["A84D",0xCB7B],
- ["A84E",0xCB7C],
- ["A84F",0xCB7D],
- ["A850",0xCB7E],
- ["A851",0xCB7F],
- ["A852",0xCB80],
- ["A853",0xCB81],
- ["A854",0xCB82],
- ["A855",0xCB83],
- ["A856",0xCB84],
- ["A857",0xCB85],
- ["A858",0xCB86],
- ["A859",0xCB87],
- ["A85A",0xCB88],
- ["A861",0xCB89],
- ["A862",0xCB8A],
- ["A863",0xCB8B],
- ["A864",0xCB8C],
- ["A865",0xCB8D],
- ["A866",0xCB8E],
- ["A867",0xCB8F],
- ["A868",0xCB90],
- ["A869",0xCB91],
- ["A86A",0xCB92],
- ["A86B",0xCB93],
- ["A86C",0xCB94],
- ["A86D",0xCB95],
- ["A86E",0xCB96],
- ["A86F",0xCB97],
- ["A870",0xCB98],
- ["A871",0xCB99],
- ["A872",0xCB9A],
- ["A873",0xCB9B],
- ["A874",0xCB9D],
- ["A875",0xCB9E],
- ["A876",0xCB9F],
- ["A877",0xCBA0],
- ["A878",0xCBA1],
- ["A879",0xCBA2],
- ["A87A",0xCBA3],
- ["A881",0xCBA4],
- ["A882",0xCBA5],
- ["A883",0xCBA6],
- ["A884",0xCBA7],
- ["A885",0xCBA8],
- ["A886",0xCBA9],
- ["A887",0xCBAA],
- ["A888",0xCBAB],
- ["A889",0xCBAC],
- ["A88A",0xCBAD],
- ["A88B",0xCBAE],
- ["A88C",0xCBAF],
- ["A88D",0xCBB0],
- ["A88E",0xCBB1],
- ["A88F",0xCBB2],
- ["A890",0xCBB3],
- ["A891",0xCBB4],
- ["A892",0xCBB5],
- ["A893",0xCBB6],
- ["A894",0xCBB7],
- ["A895",0xCBB9],
- ["A896",0xCBBA],
- ["A897",0xCBBB],
- ["A898",0xCBBC],
- ["A899",0xCBBD],
- ["A89A",0xCBBE],
- ["A89B",0xCBBF],
- ["A89C",0xCBC0],
- ["A89D",0xCBC1],
- ["A89E",0xCBC2],
- ["A89F",0xCBC3],
- ["A8A0",0xCBC4],
- ["A941",0xCBC5],
- ["A942",0xCBC6],
- ["A943",0xCBC7],
- ["A944",0xCBC8],
- ["A945",0xCBC9],
- ["A946",0xCBCA],
- ["A947",0xCBCB],
- ["A948",0xCBCC],
- ["A949",0xCBCD],
- ["A94A",0xCBCE],
- ["A94B",0xCBCF],
- ["A94C",0xCBD0],
- ["A94D",0xCBD1],
- ["A94E",0xCBD2],
- ["A94F",0xCBD3],
- ["A950",0xCBD5],
- ["A951",0xCBD6],
- ["A952",0xCBD7],
- ["A953",0xCBD8],
- ["A954",0xCBD9],
- ["A955",0xCBDA],
- ["A956",0xCBDB],
- ["A957",0xCBDC],
- ["A958",0xCBDD],
- ["A959",0xCBDE],
- ["A95A",0xCBDF],
- ["A961",0xCBE0],
- ["A962",0xCBE1],
- ["A963",0xCBE2],
- ["A964",0xCBE3],
- ["A965",0xCBE5],
- ["A966",0xCBE6],
- ["A967",0xCBE8],
- ["A968",0xCBEA],
- ["A969",0xCBEB],
- ["A96A",0xCBEC],
- ["A96B",0xCBED],
- ["A96C",0xCBEE],
- ["A96D",0xCBEF],
- ["A96E",0xCBF0],
- ["A96F",0xCBF1],
- ["A970",0xCBF2],
- ["A971",0xCBF3],
- ["A972",0xCBF4],
- ["A973",0xCBF5],
- ["A974",0xCBF6],
- ["A975",0xCBF7],
- ["A976",0xCBF8],
- ["A977",0xCBF9],
- ["A978",0xCBFA],
- ["A979",0xCBFB],
- ["A97A",0xCBFC],
- ["A981",0xCBFD],
- ["A982",0xCBFE],
- ["A983",0xCBFF],
- ["A984",0xCC00],
- ["A985",0xCC01],
- ["A986",0xCC02],
- ["A987",0xCC03],
- ["A988",0xCC04],
- ["A989",0xCC05],
- ["A98A",0xCC06],
- ["A98B",0xCC07],
- ["A98C",0xCC08],
- ["A98D",0xCC09],
- ["A98E",0xCC0A],
- ["A98F",0xCC0B],
- ["A990",0xCC0E],
- ["A991",0xCC0F],
- ["A992",0xCC11],
- ["A993",0xCC12],
- ["A994",0xCC13],
- ["A995",0xCC15],
- ["A996",0xCC16],
- ["A997",0xCC17],
- ["A998",0xCC18],
- ["A999",0xCC19],
- ["A99A",0xCC1A],
- ["A99B",0xCC1B],
- ["A99C",0xCC1E],
- ["A99D",0xCC1F],
- ["A99E",0xCC20],
- ["A99F",0xCC23],
- ["A9A0",0xCC24],
- ["AA41",0xCC25],
- ["AA42",0xCC26],
- ["AA43",0xCC2A],
- ["AA44",0xCC2B],
- ["AA45",0xCC2D],
- ["AA46",0xCC2F],
- ["AA47",0xCC31],
- ["AA48",0xCC32],
- ["AA49",0xCC33],
- ["AA4A",0xCC34],
- ["AA4B",0xCC35],
- ["AA4C",0xCC36],
- ["AA4D",0xCC37],
- ["AA4E",0xCC3A],
- ["AA4F",0xCC3F],
- ["AA50",0xCC40],
- ["AA51",0xCC41],
- ["AA52",0xCC42],
- ["AA53",0xCC43],
- ["AA54",0xCC46],
- ["AA55",0xCC47],
- ["AA56",0xCC49],
- ["AA57",0xCC4A],
- ["AA58",0xCC4B],
- ["AA59",0xCC4D],
- ["AA5A",0xCC4E],
- ["AA61",0xCC4F],
- ["AA62",0xCC50],
- ["AA63",0xCC51],
- ["AA64",0xCC52],
- ["AA65",0xCC53],
- ["AA66",0xCC56],
- ["AA67",0xCC5A],
- ["AA68",0xCC5B],
- ["AA69",0xCC5C],
- ["AA6A",0xCC5D],
- ["AA6B",0xCC5E],
- ["AA6C",0xCC5F],
- ["AA6D",0xCC61],
- ["AA6E",0xCC62],
- ["AA6F",0xCC63],
- ["AA70",0xCC65],
- ["AA71",0xCC67],
- ["AA72",0xCC69],
- ["AA73",0xCC6A],
- ["AA74",0xCC6B],
- ["AA75",0xCC6C],
- ["AA76",0xCC6D],
- ["AA77",0xCC6E],
- ["AA78",0xCC6F],
- ["AA79",0xCC71],
- ["AA7A",0xCC72],
- ["AA81",0xCC73],
- ["AA82",0xCC74],
- ["AA83",0xCC76],
- ["AA84",0xCC77],
- ["AA85",0xCC78],
- ["AA86",0xCC79],
- ["AA87",0xCC7A],
- ["AA88",0xCC7B],
- ["AA89",0xCC7C],
- ["AA8A",0xCC7D],
- ["AA8B",0xCC7E],
- ["AA8C",0xCC7F],
- ["AA8D",0xCC80],
- ["AA8E",0xCC81],
- ["AA8F",0xCC82],
- ["AA90",0xCC83],
- ["AA91",0xCC84],
- ["AA92",0xCC85],
- ["AA93",0xCC86],
- ["AA94",0xCC87],
- ["AA95",0xCC88],
- ["AA96",0xCC89],
- ["AA97",0xCC8A],
- ["AA98",0xCC8B],
- ["AA99",0xCC8C],
- ["AA9A",0xCC8D],
- ["AA9B",0xCC8E],
- ["AA9C",0xCC8F],
- ["AA9D",0xCC90],
- ["AA9E",0xCC91],
- ["AA9F",0xCC92],
- ["AAA0",0xCC93],
- ["AB41",0xCC94],
- ["AB42",0xCC95],
- ["AB43",0xCC96],
- ["AB44",0xCC97],
- ["AB45",0xCC9A],
- ["AB46",0xCC9B],
- ["AB47",0xCC9D],
- ["AB48",0xCC9E],
- ["AB49",0xCC9F],
- ["AB4A",0xCCA1],
- ["AB4B",0xCCA2],
- ["AB4C",0xCCA3],
- ["AB4D",0xCCA4],
- ["AB4E",0xCCA5],
- ["AB4F",0xCCA6],
- ["AB50",0xCCA7],
- ["AB51",0xCCAA],
- ["AB52",0xCCAE],
- ["AB53",0xCCAF],
- ["AB54",0xCCB0],
- ["AB55",0xCCB1],
- ["AB56",0xCCB2],
- ["AB57",0xCCB3],
- ["AB58",0xCCB6],
- ["AB59",0xCCB7],
- ["AB5A",0xCCB9],
- ["AB61",0xCCBA],
- ["AB62",0xCCBB],
- ["AB63",0xCCBD],
- ["AB64",0xCCBE],
- ["AB65",0xCCBF],
- ["AB66",0xCCC0],
- ["AB67",0xCCC1],
- ["AB68",0xCCC2],
- ["AB69",0xCCC3],
- ["AB6A",0xCCC6],
- ["AB6B",0xCCC8],
- ["AB6C",0xCCCA],
- ["AB6D",0xCCCB],
- ["AB6E",0xCCCC],
- ["AB6F",0xCCCD],
- ["AB70",0xCCCE],
- ["AB71",0xCCCF],
- ["AB72",0xCCD1],
- ["AB73",0xCCD2],
- ["AB74",0xCCD3],
- ["AB75",0xCCD5],
- ["AB76",0xCCD6],
- ["AB77",0xCCD7],
- ["AB78",0xCCD8],
- ["AB79",0xCCD9],
- ["AB7A",0xCCDA],
- ["AB81",0xCCDB],
- ["AB82",0xCCDC],
- ["AB83",0xCCDD],
- ["AB84",0xCCDE],
- ["AB85",0xCCDF],
- ["AB86",0xCCE0],
- ["AB87",0xCCE1],
- ["AB88",0xCCE2],
- ["AB89",0xCCE3],
- ["AB8A",0xCCE5],
- ["AB8B",0xCCE6],
- ["AB8C",0xCCE7],
- ["AB8D",0xCCE8],
- ["AB8E",0xCCE9],
- ["AB8F",0xCCEA],
- ["AB90",0xCCEB],
- ["AB91",0xCCED],
- ["AB92",0xCCEE],
- ["AB93",0xCCEF],
- ["AB94",0xCCF1],
- ["AB95",0xCCF2],
- ["AB96",0xCCF3],
- ["AB97",0xCCF4],
- ["AB98",0xCCF5],
- ["AB99",0xCCF6],
- ["AB9A",0xCCF7],
- ["AB9B",0xCCF8],
- ["AB9C",0xCCF9],
- ["AB9D",0xCCFA],
- ["AB9E",0xCCFB],
- ["AB9F",0xCCFC],
- ["ABA0",0xCCFD],
- ["AC41",0xCCFE],
- ["AC42",0xCCFF],
- ["AC43",0xCD00],
- ["AC44",0xCD02],
- ["AC45",0xCD03],
- ["AC46",0xCD04],
- ["AC47",0xCD05],
- ["AC48",0xCD06],
- ["AC49",0xCD07],
- ["AC4A",0xCD0A],
- ["AC4B",0xCD0B],
- ["AC4C",0xCD0D],
- ["AC4D",0xCD0E],
- ["AC4E",0xCD0F],
- ["AC4F",0xCD11],
- ["AC50",0xCD12],
- ["AC51",0xCD13],
- ["AC52",0xCD14],
- ["AC53",0xCD15],
- ["AC54",0xCD16],
- ["AC55",0xCD17],
- ["AC56",0xCD1A],
- ["AC57",0xCD1C],
- ["AC58",0xCD1E],
- ["AC59",0xCD1F],
- ["AC5A",0xCD20],
- ["AC61",0xCD21],
- ["AC62",0xCD22],
- ["AC63",0xCD23],
- ["AC64",0xCD25],
- ["AC65",0xCD26],
- ["AC66",0xCD27],
- ["AC67",0xCD29],
- ["AC68",0xCD2A],
- ["AC69",0xCD2B],
- ["AC6A",0xCD2D],
- ["AC6B",0xCD2E],
- ["AC6C",0xCD2F],
- ["AC6D",0xCD30],
- ["AC6E",0xCD31],
- ["AC6F",0xCD32],
- ["AC70",0xCD33],
- ["AC71",0xCD34],
- ["AC72",0xCD35],
- ["AC73",0xCD36],
- ["AC74",0xCD37],
- ["AC75",0xCD38],
- ["AC76",0xCD3A],
- ["AC77",0xCD3B],
- ["AC78",0xCD3C],
- ["AC79",0xCD3D],
- ["AC7A",0xCD3E],
- ["AC81",0xCD3F],
- ["AC82",0xCD40],
- ["AC83",0xCD41],
- ["AC84",0xCD42],
- ["AC85",0xCD43],
- ["AC86",0xCD44],
- ["AC87",0xCD45],
- ["AC88",0xCD46],
- ["AC89",0xCD47],
- ["AC8A",0xCD48],
- ["AC8B",0xCD49],
- ["AC8C",0xCD4A],
- ["AC8D",0xCD4B],
- ["AC8E",0xCD4C],
- ["AC8F",0xCD4D],
- ["AC90",0xCD4E],
- ["AC91",0xCD4F],
- ["AC92",0xCD50],
- ["AC93",0xCD51],
- ["AC94",0xCD52],
- ["AC95",0xCD53],
- ["AC96",0xCD54],
- ["AC97",0xCD55],
- ["AC98",0xCD56],
- ["AC99",0xCD57],
- ["AC9A",0xCD58],
- ["AC9B",0xCD59],
- ["AC9C",0xCD5A],
- ["AC9D",0xCD5B],
- ["AC9E",0xCD5D],
- ["AC9F",0xCD5E],
- ["ACA0",0xCD5F],
- ["AD41",0xCD61],
- ["AD42",0xCD62],
- ["AD43",0xCD63],
- ["AD44",0xCD65],
- ["AD45",0xCD66],
- ["AD46",0xCD67],
- ["AD47",0xCD68],
- ["AD48",0xCD69],
- ["AD49",0xCD6A],
- ["AD4A",0xCD6B],
- ["AD4B",0xCD6E],
- ["AD4C",0xCD70],
- ["AD4D",0xCD72],
- ["AD4E",0xCD73],
- ["AD4F",0xCD74],
- ["AD50",0xCD75],
- ["AD51",0xCD76],
- ["AD52",0xCD77],
- ["AD53",0xCD79],
- ["AD54",0xCD7A],
- ["AD55",0xCD7B],
- ["AD56",0xCD7C],
- ["AD57",0xCD7D],
- ["AD58",0xCD7E],
- ["AD59",0xCD7F],
- ["AD5A",0xCD80],
- ["AD61",0xCD81],
- ["AD62",0xCD82],
- ["AD63",0xCD83],
- ["AD64",0xCD84],
- ["AD65",0xCD85],
- ["AD66",0xCD86],
- ["AD67",0xCD87],
- ["AD68",0xCD89],
- ["AD69",0xCD8A],
- ["AD6A",0xCD8B],
- ["AD6B",0xCD8C],
- ["AD6C",0xCD8D],
- ["AD6D",0xCD8E],
- ["AD6E",0xCD8F],
- ["AD6F",0xCD90],
- ["AD70",0xCD91],
- ["AD71",0xCD92],
- ["AD72",0xCD93],
- ["AD73",0xCD96],
- ["AD74",0xCD97],
- ["AD75",0xCD99],
- ["AD76",0xCD9A],
- ["AD77",0xCD9B],
- ["AD78",0xCD9D],
- ["AD79",0xCD9E],
- ["AD7A",0xCD9F],
- ["AD81",0xCDA0],
- ["AD82",0xCDA1],
- ["AD83",0xCDA2],
- ["AD84",0xCDA3],
- ["AD85",0xCDA6],
- ["AD86",0xCDA8],
- ["AD87",0xCDAA],
- ["AD88",0xCDAB],
- ["AD89",0xCDAC],
- ["AD8A",0xCDAD],
- ["AD8B",0xCDAE],
- ["AD8C",0xCDAF],
- ["AD8D",0xCDB1],
- ["AD8E",0xCDB2],
- ["AD8F",0xCDB3],
- ["AD90",0xCDB4],
- ["AD91",0xCDB5],
- ["AD92",0xCDB6],
- ["AD93",0xCDB7],
- ["AD94",0xCDB8],
- ["AD95",0xCDB9],
- ["AD96",0xCDBA],
- ["AD97",0xCDBB],
- ["AD98",0xCDBC],
- ["AD99",0xCDBD],
- ["AD9A",0xCDBE],
- ["AD9B",0xCDBF],
- ["AD9C",0xCDC0],
- ["AD9D",0xCDC1],
- ["AD9E",0xCDC2],
- ["AD9F",0xCDC3],
- ["ADA0",0xCDC5],
- ["AE41",0xCDC6],
- ["AE42",0xCDC7],
- ["AE43",0xCDC8],
- ["AE44",0xCDC9],
- ["AE45",0xCDCA],
- ["AE46",0xCDCB],
- ["AE47",0xCDCD],
- ["AE48",0xCDCE],
- ["AE49",0xCDCF],
- ["AE4A",0xCDD1],
- ["AE4B",0xCDD2],
- ["AE4C",0xCDD3],
- ["AE4D",0xCDD4],
- ["AE4E",0xCDD5],
- ["AE4F",0xCDD6],
- ["AE50",0xCDD7],
- ["AE51",0xCDD8],
- ["AE52",0xCDD9],
- ["AE53",0xCDDA],
- ["AE54",0xCDDB],
- ["AE55",0xCDDC],
- ["AE56",0xCDDD],
- ["AE57",0xCDDE],
- ["AE58",0xCDDF],
- ["AE59",0xCDE0],
- ["AE5A",0xCDE1],
- ["AE61",0xCDE2],
- ["AE62",0xCDE3],
- ["AE63",0xCDE4],
- ["AE64",0xCDE5],
- ["AE65",0xCDE6],
- ["AE66",0xCDE7],
- ["AE67",0xCDE9],
- ["AE68",0xCDEA],
- ["AE69",0xCDEB],
- ["AE6A",0xCDED],
- ["AE6B",0xCDEE],
- ["AE6C",0xCDEF],
- ["AE6D",0xCDF1],
- ["AE6E",0xCDF2],
- ["AE6F",0xCDF3],
- ["AE70",0xCDF4],
- ["AE71",0xCDF5],
- ["AE72",0xCDF6],
- ["AE73",0xCDF7],
- ["AE74",0xCDFA],
- ["AE75",0xCDFC],
- ["AE76",0xCDFE],
- ["AE77",0xCDFF],
- ["AE78",0xCE00],
- ["AE79",0xCE01],
- ["AE7A",0xCE02],
- ["AE81",0xCE03],
- ["AE82",0xCE05],
- ["AE83",0xCE06],
- ["AE84",0xCE07],
- ["AE85",0xCE09],
- ["AE86",0xCE0A],
- ["AE87",0xCE0B],
- ["AE88",0xCE0D],
- ["AE89",0xCE0E],
- ["AE8A",0xCE0F],
- ["AE8B",0xCE10],
- ["AE8C",0xCE11],
- ["AE8D",0xCE12],
- ["AE8E",0xCE13],
- ["AE8F",0xCE15],
- ["AE90",0xCE16],
- ["AE91",0xCE17],
- ["AE92",0xCE18],
- ["AE93",0xCE1A],
- ["AE94",0xCE1B],
- ["AE95",0xCE1C],
- ["AE96",0xCE1D],
- ["AE97",0xCE1E],
- ["AE98",0xCE1F],
- ["AE99",0xCE22],
- ["AE9A",0xCE23],
- ["AE9B",0xCE25],
- ["AE9C",0xCE26],
- ["AE9D",0xCE27],
- ["AE9E",0xCE29],
- ["AE9F",0xCE2A],
- ["AEA0",0xCE2B],
- ["AF41",0xCE2C],
- ["AF42",0xCE2D],
- ["AF43",0xCE2E],
- ["AF44",0xCE2F],
- ["AF45",0xCE32],
- ["AF46",0xCE34],
- ["AF47",0xCE36],
- ["AF48",0xCE37],
- ["AF49",0xCE38],
- ["AF4A",0xCE39],
- ["AF4B",0xCE3A],
- ["AF4C",0xCE3B],
- ["AF4D",0xCE3C],
- ["AF4E",0xCE3D],
- ["AF4F",0xCE3E],
- ["AF50",0xCE3F],
- ["AF51",0xCE40],
- ["AF52",0xCE41],
- ["AF53",0xCE42],
- ["AF54",0xCE43],
- ["AF55",0xCE44],
- ["AF56",0xCE45],
- ["AF57",0xCE46],
- ["AF58",0xCE47],
- ["AF59",0xCE48],
- ["AF5A",0xCE49],
- ["AF61",0xCE4A],
- ["AF62",0xCE4B],
- ["AF63",0xCE4C],
- ["AF64",0xCE4D],
- ["AF65",0xCE4E],
- ["AF66",0xCE4F],
- ["AF67",0xCE50],
- ["AF68",0xCE51],
- ["AF69",0xCE52],
- ["AF6A",0xCE53],
- ["AF6B",0xCE54],
- ["AF6C",0xCE55],
- ["AF6D",0xCE56],
- ["AF6E",0xCE57],
- ["AF6F",0xCE5A],
- ["AF70",0xCE5B],
- ["AF71",0xCE5D],
- ["AF72",0xCE5E],
- ["AF73",0xCE62],
- ["AF74",0xCE63],
- ["AF75",0xCE64],
- ["AF76",0xCE65],
- ["AF77",0xCE66],
- ["AF78",0xCE67],
- ["AF79",0xCE6A],
- ["AF7A",0xCE6C],
- ["AF81",0xCE6E],
- ["AF82",0xCE6F],
- ["AF83",0xCE70],
- ["AF84",0xCE71],
- ["AF85",0xCE72],
- ["AF86",0xCE73],
- ["AF87",0xCE76],
- ["AF88",0xCE77],
- ["AF89",0xCE79],
- ["AF8A",0xCE7A],
- ["AF8B",0xCE7B],
- ["AF8C",0xCE7D],
- ["AF8D",0xCE7E],
- ["AF8E",0xCE7F],
- ["AF8F",0xCE80],
- ["AF90",0xCE81],
- ["AF91",0xCE82],
- ["AF92",0xCE83],
- ["AF93",0xCE86],
- ["AF94",0xCE88],
- ["AF95",0xCE8A],
- ["AF96",0xCE8B],
- ["AF97",0xCE8C],
- ["AF98",0xCE8D],
- ["AF99",0xCE8E],
- ["AF9A",0xCE8F],
- ["AF9B",0xCE92],
- ["AF9C",0xCE93],
- ["AF9D",0xCE95],
- ["AF9E",0xCE96],
- ["AF9F",0xCE97],
- ["AFA0",0xCE99],
- ["B041",0xCE9A],
- ["B042",0xCE9B],
- ["B043",0xCE9C],
- ["B044",0xCE9D],
- ["B045",0xCE9E],
- ["B046",0xCE9F],
- ["B047",0xCEA2],
- ["B048",0xCEA6],
- ["B049",0xCEA7],
- ["B04A",0xCEA8],
- ["B04B",0xCEA9],
- ["B04C",0xCEAA],
- ["B04D",0xCEAB],
- ["B04E",0xCEAE],
- ["B04F",0xCEAF],
- ["B050",0xCEB0],
- ["B051",0xCEB1],
- ["B052",0xCEB2],
- ["B053",0xCEB3],
- ["B054",0xCEB4],
- ["B055",0xCEB5],
- ["B056",0xCEB6],
- ["B057",0xCEB7],
- ["B058",0xCEB8],
- ["B059",0xCEB9],
- ["B05A",0xCEBA],
- ["B061",0xCEBB],
- ["B062",0xCEBC],
- ["B063",0xCEBD],
- ["B064",0xCEBE],
- ["B065",0xCEBF],
- ["B066",0xCEC0],
- ["B067",0xCEC2],
- ["B068",0xCEC3],
- ["B069",0xCEC4],
- ["B06A",0xCEC5],
- ["B06B",0xCEC6],
- ["B06C",0xCEC7],
- ["B06D",0xCEC8],
- ["B06E",0xCEC9],
- ["B06F",0xCECA],
- ["B070",0xCECB],
- ["B071",0xCECC],
- ["B072",0xCECD],
- ["B073",0xCECE],
- ["B074",0xCECF],
- ["B075",0xCED0],
- ["B076",0xCED1],
- ["B077",0xCED2],
- ["B078",0xCED3],
- ["B079",0xCED4],
- ["B07A",0xCED5],
- ["B081",0xCED6],
- ["B082",0xCED7],
- ["B083",0xCED8],
- ["B084",0xCED9],
- ["B085",0xCEDA],
- ["B086",0xCEDB],
- ["B087",0xCEDC],
- ["B088",0xCEDD],
- ["B089",0xCEDE],
- ["B08A",0xCEDF],
- ["B08B",0xCEE0],
- ["B08C",0xCEE1],
- ["B08D",0xCEE2],
- ["B08E",0xCEE3],
- ["B08F",0xCEE6],
- ["B090",0xCEE7],
- ["B091",0xCEE9],
- ["B092",0xCEEA],
- ["B093",0xCEED],
- ["B094",0xCEEE],
- ["B095",0xCEEF],
- ["B096",0xCEF0],
- ["B097",0xCEF1],
- ["B098",0xCEF2],
- ["B099",0xCEF3],
- ["B09A",0xCEF6],
- ["B09B",0xCEFA],
- ["B09C",0xCEFB],
- ["B09D",0xCEFC],
- ["B09E",0xCEFD],
- ["B09F",0xCEFE],
- ["B0A0",0xCEFF],
- ["B141",0xCF02],
- ["B142",0xCF03],
- ["B143",0xCF05],
- ["B144",0xCF06],
- ["B145",0xCF07],
- ["B146",0xCF09],
- ["B147",0xCF0A],
- ["B148",0xCF0B],
- ["B149",0xCF0C],
- ["B14A",0xCF0D],
- ["B14B",0xCF0E],
- ["B14C",0xCF0F],
- ["B14D",0xCF12],
- ["B14E",0xCF14],
- ["B14F",0xCF16],
- ["B150",0xCF17],
- ["B151",0xCF18],
- ["B152",0xCF19],
- ["B153",0xCF1A],
- ["B154",0xCF1B],
- ["B155",0xCF1D],
- ["B156",0xCF1E],
- ["B157",0xCF1F],
- ["B158",0xCF21],
- ["B159",0xCF22],
- ["B15A",0xCF23],
- ["B161",0xCF25],
- ["B162",0xCF26],
- ["B163",0xCF27],
- ["B164",0xCF28],
- ["B165",0xCF29],
- ["B166",0xCF2A],
- ["B167",0xCF2B],
- ["B168",0xCF2E],
- ["B169",0xCF32],
- ["B16A",0xCF33],
- ["B16B",0xCF34],
- ["B16C",0xCF35],
- ["B16D",0xCF36],
- ["B16E",0xCF37],
- ["B16F",0xCF39],
- ["B170",0xCF3A],
- ["B171",0xCF3B],
- ["B172",0xCF3C],
- ["B173",0xCF3D],
- ["B174",0xCF3E],
- ["B175",0xCF3F],
- ["B176",0xCF40],
- ["B177",0xCF41],
- ["B178",0xCF42],
- ["B179",0xCF43],
- ["B17A",0xCF44],
- ["B181",0xCF45],
- ["B182",0xCF46],
- ["B183",0xCF47],
- ["B184",0xCF48],
- ["B185",0xCF49],
- ["B186",0xCF4A],
- ["B187",0xCF4B],
- ["B188",0xCF4C],
- ["B189",0xCF4D],
- ["B18A",0xCF4E],
- ["B18B",0xCF4F],
- ["B18C",0xCF50],
- ["B18D",0xCF51],
- ["B18E",0xCF52],
- ["B18F",0xCF53],
- ["B190",0xCF56],
- ["B191",0xCF57],
- ["B192",0xCF59],
- ["B193",0xCF5A],
- ["B194",0xCF5B],
- ["B195",0xCF5D],
- ["B196",0xCF5E],
- ["B197",0xCF5F],
- ["B198",0xCF60],
- ["B199",0xCF61],
- ["B19A",0xCF62],
- ["B19B",0xCF63],
- ["B19C",0xCF66],
- ["B19D",0xCF68],
- ["B19E",0xCF6A],
- ["B19F",0xCF6B],
- ["B1A0",0xCF6C],
- ["B241",0xCF6D],
- ["B242",0xCF6E],
- ["B243",0xCF6F],
- ["B244",0xCF72],
- ["B245",0xCF73],
- ["B246",0xCF75],
- ["B247",0xCF76],
- ["B248",0xCF77],
- ["B249",0xCF79],
- ["B24A",0xCF7A],
- ["B24B",0xCF7B],
- ["B24C",0xCF7C],
- ["B24D",0xCF7D],
- ["B24E",0xCF7E],
- ["B24F",0xCF7F],
- ["B250",0xCF81],
- ["B251",0xCF82],
- ["B252",0xCF83],
- ["B253",0xCF84],
- ["B254",0xCF86],
- ["B255",0xCF87],
- ["B256",0xCF88],
- ["B257",0xCF89],
- ["B258",0xCF8A],
- ["B259",0xCF8B],
- ["B25A",0xCF8D],
- ["B261",0xCF8E],
- ["B262",0xCF8F],
- ["B263",0xCF90],
- ["B264",0xCF91],
- ["B265",0xCF92],
- ["B266",0xCF93],
- ["B267",0xCF94],
- ["B268",0xCF95],
- ["B269",0xCF96],
- ["B26A",0xCF97],
- ["B26B",0xCF98],
- ["B26C",0xCF99],
- ["B26D",0xCF9A],
- ["B26E",0xCF9B],
- ["B26F",0xCF9C],
- ["B270",0xCF9D],
- ["B271",0xCF9E],
- ["B272",0xCF9F],
- ["B273",0xCFA0],
- ["B274",0xCFA2],
- ["B275",0xCFA3],
- ["B276",0xCFA4],
- ["B277",0xCFA5],
- ["B278",0xCFA6],
- ["B279",0xCFA7],
- ["B27A",0xCFA9],
- ["B281",0xCFAA],
- ["B282",0xCFAB],
- ["B283",0xCFAC],
- ["B284",0xCFAD],
- ["B285",0xCFAE],
- ["B286",0xCFAF],
- ["B287",0xCFB1],
- ["B288",0xCFB2],
- ["B289",0xCFB3],
- ["B28A",0xCFB4],
- ["B28B",0xCFB5],
- ["B28C",0xCFB6],
- ["B28D",0xCFB7],
- ["B28E",0xCFB8],
- ["B28F",0xCFB9],
- ["B290",0xCFBA],
- ["B291",0xCFBB],
- ["B292",0xCFBC],
- ["B293",0xCFBD],
- ["B294",0xCFBE],
- ["B295",0xCFBF],
- ["B296",0xCFC0],
- ["B297",0xCFC1],
- ["B298",0xCFC2],
- ["B299",0xCFC3],
- ["B29A",0xCFC5],
- ["B29B",0xCFC6],
- ["B29C",0xCFC7],
- ["B29D",0xCFC8],
- ["B29E",0xCFC9],
- ["B29F",0xCFCA],
- ["B2A0",0xCFCB],
- ["B341",0xCFCC],
- ["B342",0xCFCD],
- ["B343",0xCFCE],
- ["B344",0xCFCF],
- ["B345",0xCFD0],
- ["B346",0xCFD1],
- ["B347",0xCFD2],
- ["B348",0xCFD3],
- ["B349",0xCFD4],
- ["B34A",0xCFD5],
- ["B34B",0xCFD6],
- ["B34C",0xCFD7],
- ["B34D",0xCFD8],
- ["B34E",0xCFD9],
- ["B34F",0xCFDA],
- ["B350",0xCFDB],
- ["B351",0xCFDC],
- ["B352",0xCFDD],
- ["B353",0xCFDE],
- ["B354",0xCFDF],
- ["B355",0xCFE2],
- ["B356",0xCFE3],
- ["B357",0xCFE5],
- ["B358",0xCFE6],
- ["B359",0xCFE7],
- ["B35A",0xCFE9],
- ["B361",0xCFEA],
- ["B362",0xCFEB],
- ["B363",0xCFEC],
- ["B364",0xCFED],
- ["B365",0xCFEE],
- ["B366",0xCFEF],
- ["B367",0xCFF2],
- ["B368",0xCFF4],
- ["B369",0xCFF6],
- ["B36A",0xCFF7],
- ["B36B",0xCFF8],
- ["B36C",0xCFF9],
- ["B36D",0xCFFA],
- ["B36E",0xCFFB],
- ["B36F",0xCFFD],
- ["B370",0xCFFE],
- ["B371",0xCFFF],
- ["B372",0xD001],
- ["B373",0xD002],
- ["B374",0xD003],
- ["B375",0xD005],
- ["B376",0xD006],
- ["B377",0xD007],
- ["B378",0xD008],
- ["B379",0xD009],
- ["B37A",0xD00A],
- ["B381",0xD00B],
- ["B382",0xD00C],
- ["B383",0xD00D],
- ["B384",0xD00E],
- ["B385",0xD00F],
- ["B386",0xD010],
- ["B387",0xD012],
- ["B388",0xD013],
- ["B389",0xD014],
- ["B38A",0xD015],
- ["B38B",0xD016],
- ["B38C",0xD017],
- ["B38D",0xD019],
- ["B38E",0xD01A],
- ["B38F",0xD01B],
- ["B390",0xD01C],
- ["B391",0xD01D],
- ["B392",0xD01E],
- ["B393",0xD01F],
- ["B394",0xD020],
- ["B395",0xD021],
- ["B396",0xD022],
- ["B397",0xD023],
- ["B398",0xD024],
- ["B399",0xD025],
- ["B39A",0xD026],
- ["B39B",0xD027],
- ["B39C",0xD028],
- ["B39D",0xD029],
- ["B39E",0xD02A],
- ["B39F",0xD02B],
- ["B3A0",0xD02C],
- ["B441",0xD02E],
- ["B442",0xD02F],
- ["B443",0xD030],
- ["B444",0xD031],
- ["B445",0xD032],
- ["B446",0xD033],
- ["B447",0xD036],
- ["B448",0xD037],
- ["B449",0xD039],
- ["B44A",0xD03A],
- ["B44B",0xD03B],
- ["B44C",0xD03D],
- ["B44D",0xD03E],
- ["B44E",0xD03F],
- ["B44F",0xD040],
- ["B450",0xD041],
- ["B451",0xD042],
- ["B452",0xD043],
- ["B453",0xD046],
- ["B454",0xD048],
- ["B455",0xD04A],
- ["B456",0xD04B],
- ["B457",0xD04C],
- ["B458",0xD04D],
- ["B459",0xD04E],
- ["B45A",0xD04F],
- ["B461",0xD051],
- ["B462",0xD052],
- ["B463",0xD053],
- ["B464",0xD055],
- ["B465",0xD056],
- ["B466",0xD057],
- ["B467",0xD059],
- ["B468",0xD05A],
- ["B469",0xD05B],
- ["B46A",0xD05C],
- ["B46B",0xD05D],
- ["B46C",0xD05E],
- ["B46D",0xD05F],
- ["B46E",0xD061],
- ["B46F",0xD062],
- ["B470",0xD063],
- ["B471",0xD064],
- ["B472",0xD065],
- ["B473",0xD066],
- ["B474",0xD067],
- ["B475",0xD068],
- ["B476",0xD069],
- ["B477",0xD06A],
- ["B478",0xD06B],
- ["B479",0xD06E],
- ["B47A",0xD06F],
- ["B481",0xD071],
- ["B482",0xD072],
- ["B483",0xD073],
- ["B484",0xD075],
- ["B485",0xD076],
- ["B486",0xD077],
- ["B487",0xD078],
- ["B488",0xD079],
- ["B489",0xD07A],
- ["B48A",0xD07B],
- ["B48B",0xD07E],
- ["B48C",0xD07F],
- ["B48D",0xD080],
- ["B48E",0xD082],
- ["B48F",0xD083],
- ["B490",0xD084],
- ["B491",0xD085],
- ["B492",0xD086],
- ["B493",0xD087],
- ["B494",0xD088],
- ["B495",0xD089],
- ["B496",0xD08A],
- ["B497",0xD08B],
- ["B498",0xD08C],
- ["B499",0xD08D],
- ["B49A",0xD08E],
- ["B49B",0xD08F],
- ["B49C",0xD090],
- ["B49D",0xD091],
- ["B49E",0xD092],
- ["B49F",0xD093],
- ["B4A0",0xD094],
- ["B541",0xD095],
- ["B542",0xD096],
- ["B543",0xD097],
- ["B544",0xD098],
- ["B545",0xD099],
- ["B546",0xD09A],
- ["B547",0xD09B],
- ["B548",0xD09C],
- ["B549",0xD09D],
- ["B54A",0xD09E],
- ["B54B",0xD09F],
- ["B54C",0xD0A0],
- ["B54D",0xD0A1],
- ["B54E",0xD0A2],
- ["B54F",0xD0A3],
- ["B550",0xD0A6],
- ["B551",0xD0A7],
- ["B552",0xD0A9],
- ["B553",0xD0AA],
- ["B554",0xD0AB],
- ["B555",0xD0AD],
- ["B556",0xD0AE],
- ["B557",0xD0AF],
- ["B558",0xD0B0],
- ["B559",0xD0B1],
- ["B55A",0xD0B2],
- ["B561",0xD0B3],
- ["B562",0xD0B6],
- ["B563",0xD0B8],
- ["B564",0xD0BA],
- ["B565",0xD0BB],
- ["B566",0xD0BC],
- ["B567",0xD0BD],
- ["B568",0xD0BE],
- ["B569",0xD0BF],
- ["B56A",0xD0C2],
- ["B56B",0xD0C3],
- ["B56C",0xD0C5],
- ["B56D",0xD0C6],
- ["B56E",0xD0C7],
- ["B56F",0xD0CA],
- ["B570",0xD0CB],
- ["B571",0xD0CC],
- ["B572",0xD0CD],
- ["B573",0xD0CE],
- ["B574",0xD0CF],
- ["B575",0xD0D2],
- ["B576",0xD0D6],
- ["B577",0xD0D7],
- ["B578",0xD0D8],
- ["B579",0xD0D9],
- ["B57A",0xD0DA],
- ["B581",0xD0DB],
- ["B582",0xD0DE],
- ["B583",0xD0DF],
- ["B584",0xD0E1],
- ["B585",0xD0E2],
- ["B586",0xD0E3],
- ["B587",0xD0E5],
- ["B588",0xD0E6],
- ["B589",0xD0E7],
- ["B58A",0xD0E8],
- ["B58B",0xD0E9],
- ["B58C",0xD0EA],
- ["B58D",0xD0EB],
- ["B58E",0xD0EE],
- ["B58F",0xD0F2],
- ["B590",0xD0F3],
- ["B591",0xD0F4],
- ["B592",0xD0F5],
- ["B593",0xD0F6],
- ["B594",0xD0F7],
- ["B595",0xD0F9],
- ["B596",0xD0FA],
- ["B597",0xD0FB],
- ["B598",0xD0FC],
- ["B599",0xD0FD],
- ["B59A",0xD0FE],
- ["B59B",0xD0FF],
- ["B59C",0xD100],
- ["B59D",0xD101],
- ["B59E",0xD102],
- ["B59F",0xD103],
- ["B5A0",0xD104],
- ["B641",0xD105],
- ["B642",0xD106],
- ["B643",0xD107],
- ["B644",0xD108],
- ["B645",0xD109],
- ["B646",0xD10A],
- ["B647",0xD10B],
- ["B648",0xD10C],
- ["B649",0xD10E],
- ["B64A",0xD10F],
- ["B64B",0xD110],
- ["B64C",0xD111],
- ["B64D",0xD112],
- ["B64E",0xD113],
- ["B64F",0xD114],
- ["B650",0xD115],
- ["B651",0xD116],
- ["B652",0xD117],
- ["B653",0xD118],
- ["B654",0xD119],
- ["B655",0xD11A],
- ["B656",0xD11B],
- ["B657",0xD11C],
- ["B658",0xD11D],
- ["B659",0xD11E],
- ["B65A",0xD11F],
- ["B661",0xD120],
- ["B662",0xD121],
- ["B663",0xD122],
- ["B664",0xD123],
- ["B665",0xD124],
- ["B666",0xD125],
- ["B667",0xD126],
- ["B668",0xD127],
- ["B669",0xD128],
- ["B66A",0xD129],
- ["B66B",0xD12A],
- ["B66C",0xD12B],
- ["B66D",0xD12C],
- ["B66E",0xD12D],
- ["B66F",0xD12E],
- ["B670",0xD12F],
- ["B671",0xD132],
- ["B672",0xD133],
- ["B673",0xD135],
- ["B674",0xD136],
- ["B675",0xD137],
- ["B676",0xD139],
- ["B677",0xD13B],
- ["B678",0xD13C],
- ["B679",0xD13D],
- ["B67A",0xD13E],
- ["B681",0xD13F],
- ["B682",0xD142],
- ["B683",0xD146],
- ["B684",0xD147],
- ["B685",0xD148],
- ["B686",0xD149],
- ["B687",0xD14A],
- ["B688",0xD14B],
- ["B689",0xD14E],
- ["B68A",0xD14F],
- ["B68B",0xD151],
- ["B68C",0xD152],
- ["B68D",0xD153],
- ["B68E",0xD155],
- ["B68F",0xD156],
- ["B690",0xD157],
- ["B691",0xD158],
- ["B692",0xD159],
- ["B693",0xD15A],
- ["B694",0xD15B],
- ["B695",0xD15E],
- ["B696",0xD160],
- ["B697",0xD162],
- ["B698",0xD163],
- ["B699",0xD164],
- ["B69A",0xD165],
- ["B69B",0xD166],
- ["B69C",0xD167],
- ["B69D",0xD169],
- ["B69E",0xD16A],
- ["B69F",0xD16B],
- ["B6A0",0xD16D],
- ["B741",0xD16E],
- ["B742",0xD16F],
- ["B743",0xD170],
- ["B744",0xD171],
- ["B745",0xD172],
- ["B746",0xD173],
- ["B747",0xD174],
- ["B748",0xD175],
- ["B749",0xD176],
- ["B74A",0xD177],
- ["B74B",0xD178],
- ["B74C",0xD179],
- ["B74D",0xD17A],
- ["B74E",0xD17B],
- ["B74F",0xD17D],
- ["B750",0xD17E],
- ["B751",0xD17F],
- ["B752",0xD180],
- ["B753",0xD181],
- ["B754",0xD182],
- ["B755",0xD183],
- ["B756",0xD185],
- ["B757",0xD186],
- ["B758",0xD187],
- ["B759",0xD189],
- ["B75A",0xD18A],
- ["B761",0xD18B],
- ["B762",0xD18C],
- ["B763",0xD18D],
- ["B764",0xD18E],
- ["B765",0xD18F],
- ["B766",0xD190],
- ["B767",0xD191],
- ["B768",0xD192],
- ["B769",0xD193],
- ["B76A",0xD194],
- ["B76B",0xD195],
- ["B76C",0xD196],
- ["B76D",0xD197],
- ["B76E",0xD198],
- ["B76F",0xD199],
- ["B770",0xD19A],
- ["B771",0xD19B],
- ["B772",0xD19C],
- ["B773",0xD19D],
- ["B774",0xD19E],
- ["B775",0xD19F],
- ["B776",0xD1A2],
- ["B777",0xD1A3],
- ["B778",0xD1A5],
- ["B779",0xD1A6],
- ["B77A",0xD1A7],
- ["B781",0xD1A9],
- ["B782",0xD1AA],
- ["B783",0xD1AB],
- ["B784",0xD1AC],
- ["B785",0xD1AD],
- ["B786",0xD1AE],
- ["B787",0xD1AF],
- ["B788",0xD1B2],
- ["B789",0xD1B4],
- ["B78A",0xD1B6],
- ["B78B",0xD1B7],
- ["B78C",0xD1B8],
- ["B78D",0xD1B9],
- ["B78E",0xD1BB],
- ["B78F",0xD1BD],
- ["B790",0xD1BE],
- ["B791",0xD1BF],
- ["B792",0xD1C1],
- ["B793",0xD1C2],
- ["B794",0xD1C3],
- ["B795",0xD1C4],
- ["B796",0xD1C5],
- ["B797",0xD1C6],
- ["B798",0xD1C7],
- ["B799",0xD1C8],
- ["B79A",0xD1C9],
- ["B79B",0xD1CA],
- ["B79C",0xD1CB],
- ["B79D",0xD1CC],
- ["B79E",0xD1CD],
- ["B79F",0xD1CE],
- ["B7A0",0xD1CF],
- ["B841",0xD1D0],
- ["B842",0xD1D1],
- ["B843",0xD1D2],
- ["B844",0xD1D3],
- ["B845",0xD1D4],
- ["B846",0xD1D5],
- ["B847",0xD1D6],
- ["B848",0xD1D7],
- ["B849",0xD1D9],
- ["B84A",0xD1DA],
- ["B84B",0xD1DB],
- ["B84C",0xD1DC],
- ["B84D",0xD1DD],
- ["B84E",0xD1DE],
- ["B84F",0xD1DF],
- ["B850",0xD1E0],
- ["B851",0xD1E1],
- ["B852",0xD1E2],
- ["B853",0xD1E3],
- ["B854",0xD1E4],
- ["B855",0xD1E5],
- ["B856",0xD1E6],
- ["B857",0xD1E7],
- ["B858",0xD1E8],
- ["B859",0xD1E9],
- ["B85A",0xD1EA],
- ["B861",0xD1EB],
- ["B862",0xD1EC],
- ["B863",0xD1ED],
- ["B864",0xD1EE],
- ["B865",0xD1EF],
- ["B866",0xD1F0],
- ["B867",0xD1F1],
- ["B868",0xD1F2],
- ["B869",0xD1F3],
- ["B86A",0xD1F5],
- ["B86B",0xD1F6],
- ["B86C",0xD1F7],
- ["B86D",0xD1F9],
- ["B86E",0xD1FA],
- ["B86F",0xD1FB],
- ["B870",0xD1FC],
- ["B871",0xD1FD],
- ["B872",0xD1FE],
- ["B873",0xD1FF],
- ["B874",0xD200],
- ["B875",0xD201],
- ["B876",0xD202],
- ["B877",0xD203],
- ["B878",0xD204],
- ["B879",0xD205],
- ["B87A",0xD206],
- ["B881",0xD208],
- ["B882",0xD20A],
- ["B883",0xD20B],
- ["B884",0xD20C],
- ["B885",0xD20D],
- ["B886",0xD20E],
- ["B887",0xD20F],
- ["B888",0xD211],
- ["B889",0xD212],
- ["B88A",0xD213],
- ["B88B",0xD214],
- ["B88C",0xD215],
- ["B88D",0xD216],
- ["B88E",0xD217],
- ["B88F",0xD218],
- ["B890",0xD219],
- ["B891",0xD21A],
- ["B892",0xD21B],
- ["B893",0xD21C],
- ["B894",0xD21D],
- ["B895",0xD21E],
- ["B896",0xD21F],
- ["B897",0xD220],
- ["B898",0xD221],
- ["B899",0xD222],
- ["B89A",0xD223],
- ["B89B",0xD224],
- ["B89C",0xD225],
- ["B89D",0xD226],
- ["B89E",0xD227],
- ["B89F",0xD228],
- ["B8A0",0xD229],
- ["B941",0xD22A],
- ["B942",0xD22B],
- ["B943",0xD22E],
- ["B944",0xD22F],
- ["B945",0xD231],
- ["B946",0xD232],
- ["B947",0xD233],
- ["B948",0xD235],
- ["B949",0xD236],
- ["B94A",0xD237],
- ["B94B",0xD238],
- ["B94C",0xD239],
- ["B94D",0xD23A],
- ["B94E",0xD23B],
- ["B94F",0xD23E],
- ["B950",0xD240],
- ["B951",0xD242],
- ["B952",0xD243],
- ["B953",0xD244],
- ["B954",0xD245],
- ["B955",0xD246],
- ["B956",0xD247],
- ["B957",0xD249],
- ["B958",0xD24A],
- ["B959",0xD24B],
- ["B95A",0xD24C],
- ["B961",0xD24D],
- ["B962",0xD24E],
- ["B963",0xD24F],
- ["B964",0xD250],
- ["B965",0xD251],
- ["B966",0xD252],
- ["B967",0xD253],
- ["B968",0xD254],
- ["B969",0xD255],
- ["B96A",0xD256],
- ["B96B",0xD257],
- ["B96C",0xD258],
- ["B96D",0xD259],
- ["B96E",0xD25A],
- ["B96F",0xD25B],
- ["B970",0xD25D],
- ["B971",0xD25E],
- ["B972",0xD25F],
- ["B973",0xD260],
- ["B974",0xD261],
- ["B975",0xD262],
- ["B976",0xD263],
- ["B977",0xD265],
- ["B978",0xD266],
- ["B979",0xD267],
- ["B97A",0xD268],
- ["B981",0xD269],
- ["B982",0xD26A],
- ["B983",0xD26B],
- ["B984",0xD26C],
- ["B985",0xD26D],
- ["B986",0xD26E],
- ["B987",0xD26F],
- ["B988",0xD270],
- ["B989",0xD271],
- ["B98A",0xD272],
- ["B98B",0xD273],
- ["B98C",0xD274],
- ["B98D",0xD275],
- ["B98E",0xD276],
- ["B98F",0xD277],
- ["B990",0xD278],
- ["B991",0xD279],
- ["B992",0xD27A],
- ["B993",0xD27B],
- ["B994",0xD27C],
- ["B995",0xD27D],
- ["B996",0xD27E],
- ["B997",0xD27F],
- ["B998",0xD282],
- ["B999",0xD283],
- ["B99A",0xD285],
- ["B99B",0xD286],
- ["B99C",0xD287],
- ["B99D",0xD289],
- ["B99E",0xD28A],
- ["B99F",0xD28B],
- ["B9A0",0xD28C],
- ["BA41",0xD28D],
- ["BA42",0xD28E],
- ["BA43",0xD28F],
- ["BA44",0xD292],
- ["BA45",0xD293],
- ["BA46",0xD294],
- ["BA47",0xD296],
- ["BA48",0xD297],
- ["BA49",0xD298],
- ["BA4A",0xD299],
- ["BA4B",0xD29A],
- ["BA4C",0xD29B],
- ["BA4D",0xD29D],
- ["BA4E",0xD29E],
- ["BA4F",0xD29F],
- ["BA50",0xD2A1],
- ["BA51",0xD2A2],
- ["BA52",0xD2A3],
- ["BA53",0xD2A5],
- ["BA54",0xD2A6],
- ["BA55",0xD2A7],
- ["BA56",0xD2A8],
- ["BA57",0xD2A9],
- ["BA58",0xD2AA],
- ["BA59",0xD2AB],
- ["BA5A",0xD2AD],
- ["BA61",0xD2AE],
- ["BA62",0xD2AF],
- ["BA63",0xD2B0],
- ["BA64",0xD2B2],
- ["BA65",0xD2B3],
- ["BA66",0xD2B4],
- ["BA67",0xD2B5],
- ["BA68",0xD2B6],
- ["BA69",0xD2B7],
- ["BA6A",0xD2BA],
- ["BA6B",0xD2BB],
- ["BA6C",0xD2BD],
- ["BA6D",0xD2BE],
- ["BA6E",0xD2C1],
- ["BA6F",0xD2C3],
- ["BA70",0xD2C4],
- ["BA71",0xD2C5],
- ["BA72",0xD2C6],
- ["BA73",0xD2C7],
- ["BA74",0xD2CA],
- ["BA75",0xD2CC],
- ["BA76",0xD2CD],
- ["BA77",0xD2CE],
- ["BA78",0xD2CF],
- ["BA79",0xD2D0],
- ["BA7A",0xD2D1],
- ["BA81",0xD2D2],
- ["BA82",0xD2D3],
- ["BA83",0xD2D5],
- ["BA84",0xD2D6],
- ["BA85",0xD2D7],
- ["BA86",0xD2D9],
- ["BA87",0xD2DA],
- ["BA88",0xD2DB],
- ["BA89",0xD2DD],
- ["BA8A",0xD2DE],
- ["BA8B",0xD2DF],
- ["BA8C",0xD2E0],
- ["BA8D",0xD2E1],
- ["BA8E",0xD2E2],
- ["BA8F",0xD2E3],
- ["BA90",0xD2E6],
- ["BA91",0xD2E7],
- ["BA92",0xD2E8],
- ["BA93",0xD2E9],
- ["BA94",0xD2EA],
- ["BA95",0xD2EB],
- ["BA96",0xD2EC],
- ["BA97",0xD2ED],
- ["BA98",0xD2EE],
- ["BA99",0xD2EF],
- ["BA9A",0xD2F2],
- ["BA9B",0xD2F3],
- ["BA9C",0xD2F5],
- ["BA9D",0xD2F6],
- ["BA9E",0xD2F7],
- ["BA9F",0xD2F9],
- ["BAA0",0xD2FA],
- ["BB41",0xD2FB],
- ["BB42",0xD2FC],
- ["BB43",0xD2FD],
- ["BB44",0xD2FE],
- ["BB45",0xD2FF],
- ["BB46",0xD302],
- ["BB47",0xD304],
- ["BB48",0xD306],
- ["BB49",0xD307],
- ["BB4A",0xD308],
- ["BB4B",0xD309],
- ["BB4C",0xD30A],
- ["BB4D",0xD30B],
- ["BB4E",0xD30F],
- ["BB4F",0xD311],
- ["BB50",0xD312],
- ["BB51",0xD313],
- ["BB52",0xD315],
- ["BB53",0xD317],
- ["BB54",0xD318],
- ["BB55",0xD319],
- ["BB56",0xD31A],
- ["BB57",0xD31B],
- ["BB58",0xD31E],
- ["BB59",0xD322],
- ["BB5A",0xD323],
- ["BB61",0xD324],
- ["BB62",0xD326],
- ["BB63",0xD327],
- ["BB64",0xD32A],
- ["BB65",0xD32B],
- ["BB66",0xD32D],
- ["BB67",0xD32E],
- ["BB68",0xD32F],
- ["BB69",0xD331],
- ["BB6A",0xD332],
- ["BB6B",0xD333],
- ["BB6C",0xD334],
- ["BB6D",0xD335],
- ["BB6E",0xD336],
- ["BB6F",0xD337],
- ["BB70",0xD33A],
- ["BB71",0xD33E],
- ["BB72",0xD33F],
- ["BB73",0xD340],
- ["BB74",0xD341],
- ["BB75",0xD342],
- ["BB76",0xD343],
- ["BB77",0xD346],
- ["BB78",0xD347],
- ["BB79",0xD348],
- ["BB7A",0xD349],
- ["BB81",0xD34A],
- ["BB82",0xD34B],
- ["BB83",0xD34C],
- ["BB84",0xD34D],
- ["BB85",0xD34E],
- ["BB86",0xD34F],
- ["BB87",0xD350],
- ["BB88",0xD351],
- ["BB89",0xD352],
- ["BB8A",0xD353],
- ["BB8B",0xD354],
- ["BB8C",0xD355],
- ["BB8D",0xD356],
- ["BB8E",0xD357],
- ["BB8F",0xD358],
- ["BB90",0xD359],
- ["BB91",0xD35A],
- ["BB92",0xD35B],
- ["BB93",0xD35C],
- ["BB94",0xD35D],
- ["BB95",0xD35E],
- ["BB96",0xD35F],
- ["BB97",0xD360],
- ["BB98",0xD361],
- ["BB99",0xD362],
- ["BB9A",0xD363],
- ["BB9B",0xD364],
- ["BB9C",0xD365],
- ["BB9D",0xD366],
- ["BB9E",0xD367],
- ["BB9F",0xD368],
- ["BBA0",0xD369],
- ["BC41",0xD36A],
- ["BC42",0xD36B],
- ["BC43",0xD36C],
- ["BC44",0xD36D],
- ["BC45",0xD36E],
- ["BC46",0xD36F],
- ["BC47",0xD370],
- ["BC48",0xD371],
- ["BC49",0xD372],
- ["BC4A",0xD373],
- ["BC4B",0xD374],
- ["BC4C",0xD375],
- ["BC4D",0xD376],
- ["BC4E",0xD377],
- ["BC4F",0xD378],
- ["BC50",0xD379],
- ["BC51",0xD37A],
- ["BC52",0xD37B],
- ["BC53",0xD37E],
- ["BC54",0xD37F],
- ["BC55",0xD381],
- ["BC56",0xD382],
- ["BC57",0xD383],
- ["BC58",0xD385],
- ["BC59",0xD386],
- ["BC5A",0xD387],
- ["BC61",0xD388],
- ["BC62",0xD389],
- ["BC63",0xD38A],
- ["BC64",0xD38B],
- ["BC65",0xD38E],
- ["BC66",0xD392],
- ["BC67",0xD393],
- ["BC68",0xD394],
- ["BC69",0xD395],
- ["BC6A",0xD396],
- ["BC6B",0xD397],
- ["BC6C",0xD39A],
- ["BC6D",0xD39B],
- ["BC6E",0xD39D],
- ["BC6F",0xD39E],
- ["BC70",0xD39F],
- ["BC71",0xD3A1],
- ["BC72",0xD3A2],
- ["BC73",0xD3A3],
- ["BC74",0xD3A4],
- ["BC75",0xD3A5],
- ["BC76",0xD3A6],
- ["BC77",0xD3A7],
- ["BC78",0xD3AA],
- ["BC79",0xD3AC],
- ["BC7A",0xD3AE],
- ["BC81",0xD3AF],
- ["BC82",0xD3B0],
- ["BC83",0xD3B1],
- ["BC84",0xD3B2],
- ["BC85",0xD3B3],
- ["BC86",0xD3B5],
- ["BC87",0xD3B6],
- ["BC88",0xD3B7],
- ["BC89",0xD3B9],
- ["BC8A",0xD3BA],
- ["BC8B",0xD3BB],
- ["BC8C",0xD3BD],
- ["BC8D",0xD3BE],
- ["BC8E",0xD3BF],
- ["BC8F",0xD3C0],
- ["BC90",0xD3C1],
- ["BC91",0xD3C2],
- ["BC92",0xD3C3],
- ["BC93",0xD3C6],
- ["BC94",0xD3C7],
- ["BC95",0xD3CA],
- ["BC96",0xD3CB],
- ["BC97",0xD3CC],
- ["BC98",0xD3CD],
- ["BC99",0xD3CE],
- ["BC9A",0xD3CF],
- ["BC9B",0xD3D1],
- ["BC9C",0xD3D2],
- ["BC9D",0xD3D3],
- ["BC9E",0xD3D4],
- ["BC9F",0xD3D5],
- ["BCA0",0xD3D6],
- ["BD41",0xD3D7],
- ["BD42",0xD3D9],
- ["BD43",0xD3DA],
- ["BD44",0xD3DB],
- ["BD45",0xD3DC],
- ["BD46",0xD3DD],
- ["BD47",0xD3DE],
- ["BD48",0xD3DF],
- ["BD49",0xD3E0],
- ["BD4A",0xD3E2],
- ["BD4B",0xD3E4],
- ["BD4C",0xD3E5],
- ["BD4D",0xD3E6],
- ["BD4E",0xD3E7],
- ["BD4F",0xD3E8],
- ["BD50",0xD3E9],
- ["BD51",0xD3EA],
- ["BD52",0xD3EB],
- ["BD53",0xD3EE],
- ["BD54",0xD3EF],
- ["BD55",0xD3F1],
- ["BD56",0xD3F2],
- ["BD57",0xD3F3],
- ["BD58",0xD3F5],
- ["BD59",0xD3F6],
- ["BD5A",0xD3F7],
- ["BD61",0xD3F8],
- ["BD62",0xD3F9],
- ["BD63",0xD3FA],
- ["BD64",0xD3FB],
- ["BD65",0xD3FE],
- ["BD66",0xD400],
- ["BD67",0xD402],
- ["BD68",0xD403],
- ["BD69",0xD404],
- ["BD6A",0xD405],
- ["BD6B",0xD406],
- ["BD6C",0xD407],
- ["BD6D",0xD409],
- ["BD6E",0xD40A],
- ["BD6F",0xD40B],
- ["BD70",0xD40C],
- ["BD71",0xD40D],
- ["BD72",0xD40E],
- ["BD73",0xD40F],
- ["BD74",0xD410],
- ["BD75",0xD411],
- ["BD76",0xD412],
- ["BD77",0xD413],
- ["BD78",0xD414],
- ["BD79",0xD415],
- ["BD7A",0xD416],
- ["BD81",0xD417],
- ["BD82",0xD418],
- ["BD83",0xD419],
- ["BD84",0xD41A],
- ["BD85",0xD41B],
- ["BD86",0xD41C],
- ["BD87",0xD41E],
- ["BD88",0xD41F],
- ["BD89",0xD420],
- ["BD8A",0xD421],
- ["BD8B",0xD422],
- ["BD8C",0xD423],
- ["BD8D",0xD424],
- ["BD8E",0xD425],
- ["BD8F",0xD426],
- ["BD90",0xD427],
- ["BD91",0xD428],
- ["BD92",0xD429],
- ["BD93",0xD42A],
- ["BD94",0xD42B],
- ["BD95",0xD42C],
- ["BD96",0xD42D],
- ["BD97",0xD42E],
- ["BD98",0xD42F],
- ["BD99",0xD430],
- ["BD9A",0xD431],
- ["BD9B",0xD432],
- ["BD9C",0xD433],
- ["BD9D",0xD434],
- ["BD9E",0xD435],
- ["BD9F",0xD436],
- ["BDA0",0xD437],
- ["BE41",0xD438],
- ["BE42",0xD439],
- ["BE43",0xD43A],
- ["BE44",0xD43B],
- ["BE45",0xD43C],
- ["BE46",0xD43D],
- ["BE47",0xD43E],
- ["BE48",0xD43F],
- ["BE49",0xD441],
- ["BE4A",0xD442],
- ["BE4B",0xD443],
- ["BE4C",0xD445],
- ["BE4D",0xD446],
- ["BE4E",0xD447],
- ["BE4F",0xD448],
- ["BE50",0xD449],
- ["BE51",0xD44A],
- ["BE52",0xD44B],
- ["BE53",0xD44C],
- ["BE54",0xD44D],
- ["BE55",0xD44E],
- ["BE56",0xD44F],
- ["BE57",0xD450],
- ["BE58",0xD451],
- ["BE59",0xD452],
- ["BE5A",0xD453],
- ["BE61",0xD454],
- ["BE62",0xD455],
- ["BE63",0xD456],
- ["BE64",0xD457],
- ["BE65",0xD458],
- ["BE66",0xD459],
- ["BE67",0xD45A],
- ["BE68",0xD45B],
- ["BE69",0xD45D],
- ["BE6A",0xD45E],
- ["BE6B",0xD45F],
- ["BE6C",0xD461],
- ["BE6D",0xD462],
- ["BE6E",0xD463],
- ["BE6F",0xD465],
- ["BE70",0xD466],
- ["BE71",0xD467],
- ["BE72",0xD468],
- ["BE73",0xD469],
- ["BE74",0xD46A],
- ["BE75",0xD46B],
- ["BE76",0xD46C],
- ["BE77",0xD46E],
- ["BE78",0xD470],
- ["BE79",0xD471],
- ["BE7A",0xD472],
- ["BE81",0xD473],
- ["BE82",0xD474],
- ["BE83",0xD475],
- ["BE84",0xD476],
- ["BE85",0xD477],
- ["BE86",0xD47A],
- ["BE87",0xD47B],
- ["BE88",0xD47D],
- ["BE89",0xD47E],
- ["BE8A",0xD481],
- ["BE8B",0xD483],
- ["BE8C",0xD484],
- ["BE8D",0xD485],
- ["BE8E",0xD486],
- ["BE8F",0xD487],
- ["BE90",0xD48A],
- ["BE91",0xD48C],
- ["BE92",0xD48E],
- ["BE93",0xD48F],
- ["BE94",0xD490],
- ["BE95",0xD491],
- ["BE96",0xD492],
- ["BE97",0xD493],
- ["BE98",0xD495],
- ["BE99",0xD496],
- ["BE9A",0xD497],
- ["BE9B",0xD498],
- ["BE9C",0xD499],
- ["BE9D",0xD49A],
- ["BE9E",0xD49B],
- ["BE9F",0xD49C],
- ["BEA0",0xD49D],
- ["BF41",0xD49E],
- ["BF42",0xD49F],
- ["BF43",0xD4A0],
- ["BF44",0xD4A1],
- ["BF45",0xD4A2],
- ["BF46",0xD4A3],
- ["BF47",0xD4A4],
- ["BF48",0xD4A5],
- ["BF49",0xD4A6],
- ["BF4A",0xD4A7],
- ["BF4B",0xD4A8],
- ["BF4C",0xD4AA],
- ["BF4D",0xD4AB],
- ["BF4E",0xD4AC],
- ["BF4F",0xD4AD],
- ["BF50",0xD4AE],
- ["BF51",0xD4AF],
- ["BF52",0xD4B0],
- ["BF53",0xD4B1],
- ["BF54",0xD4B2],
- ["BF55",0xD4B3],
- ["BF56",0xD4B4],
- ["BF57",0xD4B5],
- ["BF58",0xD4B6],
- ["BF59",0xD4B7],
- ["BF5A",0xD4B8],
- ["BF61",0xD4B9],
- ["BF62",0xD4BA],
- ["BF63",0xD4BB],
- ["BF64",0xD4BC],
- ["BF65",0xD4BD],
- ["BF66",0xD4BE],
- ["BF67",0xD4BF],
- ["BF68",0xD4C0],
- ["BF69",0xD4C1],
- ["BF6A",0xD4C2],
- ["BF6B",0xD4C3],
- ["BF6C",0xD4C4],
- ["BF6D",0xD4C5],
- ["BF6E",0xD4C6],
- ["BF6F",0xD4C7],
- ["BF70",0xD4C8],
- ["BF71",0xD4C9],
- ["BF72",0xD4CA],
- ["BF73",0xD4CB],
- ["BF74",0xD4CD],
- ["BF75",0xD4CE],
- ["BF76",0xD4CF],
- ["BF77",0xD4D1],
- ["BF78",0xD4D2],
- ["BF79",0xD4D3],
- ["BF7A",0xD4D5],
- ["BF81",0xD4D6],
- ["BF82",0xD4D7],
- ["BF83",0xD4D8],
- ["BF84",0xD4D9],
- ["BF85",0xD4DA],
- ["BF86",0xD4DB],
- ["BF87",0xD4DD],
- ["BF88",0xD4DE],
- ["BF89",0xD4E0],
- ["BF8A",0xD4E1],
- ["BF8B",0xD4E2],
- ["BF8C",0xD4E3],
- ["BF8D",0xD4E4],
- ["BF8E",0xD4E5],
- ["BF8F",0xD4E6],
- ["BF90",0xD4E7],
- ["BF91",0xD4E9],
- ["BF92",0xD4EA],
- ["BF93",0xD4EB],
- ["BF94",0xD4ED],
- ["BF95",0xD4EE],
- ["BF96",0xD4EF],
- ["BF97",0xD4F1],
- ["BF98",0xD4F2],
- ["BF99",0xD4F3],
- ["BF9A",0xD4F4],
- ["BF9B",0xD4F5],
- ["BF9C",0xD4F6],
- ["BF9D",0xD4F7],
- ["BF9E",0xD4F9],
- ["BF9F",0xD4FA],
- ["BFA0",0xD4FC],
- ["C041",0xD4FE],
- ["C042",0xD4FF],
- ["C043",0xD500],
- ["C044",0xD501],
- ["C045",0xD502],
- ["C046",0xD503],
- ["C047",0xD505],
- ["C048",0xD506],
- ["C049",0xD507],
- ["C04A",0xD509],
- ["C04B",0xD50A],
- ["C04C",0xD50B],
- ["C04D",0xD50D],
- ["C04E",0xD50E],
- ["C04F",0xD50F],
- ["C050",0xD510],
- ["C051",0xD511],
- ["C052",0xD512],
- ["C053",0xD513],
- ["C054",0xD516],
- ["C055",0xD518],
- ["C056",0xD519],
- ["C057",0xD51A],
- ["C058",0xD51B],
- ["C059",0xD51C],
- ["C05A",0xD51D],
- ["C061",0xD51E],
- ["C062",0xD51F],
- ["C063",0xD520],
- ["C064",0xD521],
- ["C065",0xD522],
- ["C066",0xD523],
- ["C067",0xD524],
- ["C068",0xD525],
- ["C069",0xD526],
- ["C06A",0xD527],
- ["C06B",0xD528],
- ["C06C",0xD529],
- ["C06D",0xD52A],
- ["C06E",0xD52B],
- ["C06F",0xD52C],
- ["C070",0xD52D],
- ["C071",0xD52E],
- ["C072",0xD52F],
- ["C073",0xD530],
- ["C074",0xD531],
- ["C075",0xD532],
- ["C076",0xD533],
- ["C077",0xD534],
- ["C078",0xD535],
- ["C079",0xD536],
- ["C07A",0xD537],
- ["C081",0xD538],
- ["C082",0xD539],
- ["C083",0xD53A],
- ["C084",0xD53B],
- ["C085",0xD53E],
- ["C086",0xD53F],
- ["C087",0xD541],
- ["C088",0xD542],
- ["C089",0xD543],
- ["C08A",0xD545],
- ["C08B",0xD546],
- ["C08C",0xD547],
- ["C08D",0xD548],
- ["C08E",0xD549],
- ["C08F",0xD54A],
- ["C090",0xD54B],
- ["C091",0xD54E],
- ["C092",0xD550],
- ["C093",0xD552],
- ["C094",0xD553],
- ["C095",0xD554],
- ["C096",0xD555],
- ["C097",0xD556],
- ["C098",0xD557],
- ["C099",0xD55A],
- ["C09A",0xD55B],
- ["C09B",0xD55D],
- ["C09C",0xD55E],
- ["C09D",0xD55F],
- ["C09E",0xD561],
- ["C09F",0xD562],
- ["C0A0",0xD563],
- ["C141",0xD564],
- ["C142",0xD566],
- ["C143",0xD567],
- ["C144",0xD56A],
- ["C145",0xD56C],
- ["C146",0xD56E],
- ["C147",0xD56F],
- ["C148",0xD570],
- ["C149",0xD571],
- ["C14A",0xD572],
- ["C14B",0xD573],
- ["C14C",0xD576],
- ["C14D",0xD577],
- ["C14E",0xD579],
- ["C14F",0xD57A],
- ["C150",0xD57B],
- ["C151",0xD57D],
- ["C152",0xD57E],
- ["C153",0xD57F],
- ["C154",0xD580],
- ["C155",0xD581],
- ["C156",0xD582],
- ["C157",0xD583],
- ["C158",0xD586],
- ["C159",0xD58A],
- ["C15A",0xD58B],
- ["C161",0xD58C],
- ["C162",0xD58D],
- ["C163",0xD58E],
- ["C164",0xD58F],
- ["C165",0xD591],
- ["C166",0xD592],
- ["C167",0xD593],
- ["C168",0xD594],
- ["C169",0xD595],
- ["C16A",0xD596],
- ["C16B",0xD597],
- ["C16C",0xD598],
- ["C16D",0xD599],
- ["C16E",0xD59A],
- ["C16F",0xD59B],
- ["C170",0xD59C],
- ["C171",0xD59D],
- ["C172",0xD59E],
- ["C173",0xD59F],
- ["C174",0xD5A0],
- ["C175",0xD5A1],
- ["C176",0xD5A2],
- ["C177",0xD5A3],
- ["C178",0xD5A4],
- ["C179",0xD5A6],
- ["C17A",0xD5A7],
- ["C181",0xD5A8],
- ["C182",0xD5A9],
- ["C183",0xD5AA],
- ["C184",0xD5AB],
- ["C185",0xD5AC],
- ["C186",0xD5AD],
- ["C187",0xD5AE],
- ["C188",0xD5AF],
- ["C189",0xD5B0],
- ["C18A",0xD5B1],
- ["C18B",0xD5B2],
- ["C18C",0xD5B3],
- ["C18D",0xD5B4],
- ["C18E",0xD5B5],
- ["C18F",0xD5B6],
- ["C190",0xD5B7],
- ["C191",0xD5B8],
- ["C192",0xD5B9],
- ["C193",0xD5BA],
- ["C194",0xD5BB],
- ["C195",0xD5BC],
- ["C196",0xD5BD],
- ["C197",0xD5BE],
- ["C198",0xD5BF],
- ["C199",0xD5C0],
- ["C19A",0xD5C1],
- ["C19B",0xD5C2],
- ["C19C",0xD5C3],
- ["C19D",0xD5C4],
- ["C19E",0xD5C5],
- ["C19F",0xD5C6],
- ["C1A0",0xD5C7],
- ["C241",0xD5CA],
- ["C242",0xD5CB],
- ["C243",0xD5CD],
- ["C244",0xD5CE],
- ["C245",0xD5CF],
- ["C246",0xD5D1],
- ["C247",0xD5D3],
- ["C248",0xD5D4],
- ["C249",0xD5D5],
- ["C24A",0xD5D6],
- ["C24B",0xD5D7],
- ["C24C",0xD5DA],
- ["C24D",0xD5DC],
- ["C24E",0xD5DE],
- ["C24F",0xD5DF],
- ["C250",0xD5E0],
- ["C251",0xD5E1],
- ["C252",0xD5E2],
- ["C253",0xD5E3],
- ["C254",0xD5E6],
- ["C255",0xD5E7],
- ["C256",0xD5E9],
- ["C257",0xD5EA],
- ["C258",0xD5EB],
- ["C259",0xD5ED],
- ["C25A",0xD5EE],
- ["C261",0xD5EF],
- ["C262",0xD5F0],
- ["C263",0xD5F1],
- ["C264",0xD5F2],
- ["C265",0xD5F3],
- ["C266",0xD5F6],
- ["C267",0xD5F8],
- ["C268",0xD5FA],
- ["C269",0xD5FB],
- ["C26A",0xD5FC],
- ["C26B",0xD5FD],
- ["C26C",0xD5FE],
- ["C26D",0xD5FF],
- ["C26E",0xD602],
- ["C26F",0xD603],
- ["C270",0xD605],
- ["C271",0xD606],
- ["C272",0xD607],
- ["C273",0xD609],
- ["C274",0xD60A],
- ["C275",0xD60B],
- ["C276",0xD60C],
- ["C277",0xD60D],
- ["C278",0xD60E],
- ["C279",0xD60F],
- ["C27A",0xD612],
- ["C281",0xD616],
- ["C282",0xD617],
- ["C283",0xD618],
- ["C284",0xD619],
- ["C285",0xD61A],
- ["C286",0xD61B],
- ["C287",0xD61D],
- ["C288",0xD61E],
- ["C289",0xD61F],
- ["C28A",0xD621],
- ["C28B",0xD622],
- ["C28C",0xD623],
- ["C28D",0xD625],
- ["C28E",0xD626],
- ["C28F",0xD627],
- ["C290",0xD628],
- ["C291",0xD629],
- ["C292",0xD62A],
- ["C293",0xD62B],
- ["C294",0xD62C],
- ["C295",0xD62E],
- ["C296",0xD62F],
- ["C297",0xD630],
- ["C298",0xD631],
- ["C299",0xD632],
- ["C29A",0xD633],
- ["C29B",0xD634],
- ["C29C",0xD635],
- ["C29D",0xD636],
- ["C29E",0xD637],
- ["C29F",0xD63A],
- ["C2A0",0xD63B],
- ["C341",0xD63D],
- ["C342",0xD63E],
- ["C343",0xD63F],
- ["C344",0xD641],
- ["C345",0xD642],
- ["C346",0xD643],
- ["C347",0xD644],
- ["C348",0xD646],
- ["C349",0xD647],
- ["C34A",0xD64A],
- ["C34B",0xD64C],
- ["C34C",0xD64E],
- ["C34D",0xD64F],
- ["C34E",0xD650],
- ["C34F",0xD652],
- ["C350",0xD653],
- ["C351",0xD656],
- ["C352",0xD657],
- ["C353",0xD659],
- ["C354",0xD65A],
- ["C355",0xD65B],
- ["C356",0xD65D],
- ["C357",0xD65E],
- ["C358",0xD65F],
- ["C359",0xD660],
- ["C35A",0xD661],
- ["C361",0xD662],
- ["C362",0xD663],
- ["C363",0xD664],
- ["C364",0xD665],
- ["C365",0xD666],
- ["C366",0xD668],
- ["C367",0xD66A],
- ["C368",0xD66B],
- ["C369",0xD66C],
- ["C36A",0xD66D],
- ["C36B",0xD66E],
- ["C36C",0xD66F],
- ["C36D",0xD672],
- ["C36E",0xD673],
- ["C36F",0xD675],
- ["C370",0xD676],
- ["C371",0xD677],
- ["C372",0xD678],
- ["C373",0xD679],
- ["C374",0xD67A],
- ["C375",0xD67B],
- ["C376",0xD67C],
- ["C377",0xD67D],
- ["C378",0xD67E],
- ["C379",0xD67F],
- ["C37A",0xD680],
- ["C381",0xD681],
- ["C382",0xD682],
- ["C383",0xD684],
- ["C384",0xD686],
- ["C385",0xD687],
- ["C386",0xD688],
- ["C387",0xD689],
- ["C388",0xD68A],
- ["C389",0xD68B],
- ["C38A",0xD68E],
- ["C38B",0xD68F],
- ["C38C",0xD691],
- ["C38D",0xD692],
- ["C38E",0xD693],
- ["C38F",0xD695],
- ["C390",0xD696],
- ["C391",0xD697],
- ["C392",0xD698],
- ["C393",0xD699],
- ["C394",0xD69A],
- ["C395",0xD69B],
- ["C396",0xD69C],
- ["C397",0xD69E],
- ["C398",0xD6A0],
- ["C399",0xD6A2],
- ["C39A",0xD6A3],
- ["C39B",0xD6A4],
- ["C39C",0xD6A5],
- ["C39D",0xD6A6],
- ["C39E",0xD6A7],
- ["C39F",0xD6A9],
- ["C3A0",0xD6AA],
- ["C441",0xD6AB],
- ["C442",0xD6AD],
- ["C443",0xD6AE],
- ["C444",0xD6AF],
- ["C445",0xD6B1],
- ["C446",0xD6B2],
- ["C447",0xD6B3],
- ["C448",0xD6B4],
- ["C449",0xD6B5],
- ["C44A",0xD6B6],
- ["C44B",0xD6B7],
- ["C44C",0xD6B8],
- ["C44D",0xD6BA],
- ["C44E",0xD6BC],
- ["C44F",0xD6BD],
- ["C450",0xD6BE],
- ["C451",0xD6BF],
- ["C452",0xD6C0],
- ["C453",0xD6C1],
- ["C454",0xD6C2],
- ["C455",0xD6C3],
- ["C456",0xD6C6],
- ["C457",0xD6C7],
- ["C458",0xD6C9],
- ["C459",0xD6CA],
- ["C45A",0xD6CB],
- ["C461",0xD6CD],
- ["C462",0xD6CE],
- ["C463",0xD6CF],
- ["C464",0xD6D0],
- ["C465",0xD6D2],
- ["C466",0xD6D3],
- ["C467",0xD6D5],
- ["C468",0xD6D6],
- ["C469",0xD6D8],
- ["C46A",0xD6DA],
- ["C46B",0xD6DB],
- ["C46C",0xD6DC],
- ["C46D",0xD6DD],
- ["C46E",0xD6DE],
- ["C46F",0xD6DF],
- ["C470",0xD6E1],
- ["C471",0xD6E2],
- ["C472",0xD6E3],
- ["C473",0xD6E5],
- ["C474",0xD6E6],
- ["C475",0xD6E7],
- ["C476",0xD6E9],
- ["C477",0xD6EA],
- ["C478",0xD6EB],
- ["C479",0xD6EC],
- ["C47A",0xD6ED],
- ["C481",0xD6EE],
- ["C482",0xD6EF],
- ["C483",0xD6F1],
- ["C484",0xD6F2],
- ["C485",0xD6F3],
- ["C486",0xD6F4],
- ["C487",0xD6F6],
- ["C488",0xD6F7],
- ["C489",0xD6F8],
- ["C48A",0xD6F9],
- ["C48B",0xD6FA],
- ["C48C",0xD6FB],
- ["C48D",0xD6FE],
- ["C48E",0xD6FF],
- ["C48F",0xD701],
- ["C490",0xD702],
- ["C491",0xD703],
- ["C492",0xD705],
- ["C493",0xD706],
- ["C494",0xD707],
- ["C495",0xD708],
- ["C496",0xD709],
- ["C497",0xD70A],
- ["C498",0xD70B],
- ["C499",0xD70C],
- ["C49A",0xD70D],
- ["C49B",0xD70E],
- ["C49C",0xD70F],
- ["C49D",0xD710],
- ["C49E",0xD712],
- ["C49F",0xD713],
- ["C4A0",0xD714],
- ["C541",0xD715],
- ["C542",0xD716],
- ["C543",0xD717],
- ["C544",0xD71A],
- ["C545",0xD71B],
- ["C546",0xD71D],
- ["C547",0xD71E],
- ["C548",0xD71F],
- ["C549",0xD721],
- ["C54A",0xD722],
- ["C54B",0xD723],
- ["C54C",0xD724],
- ["C54D",0xD725],
- ["C54E",0xD726],
- ["C54F",0xD727],
- ["C550",0xD72A],
- ["C551",0xD72C],
- ["C552",0xD72E],
- ["C553",0xD72F],
- ["C554",0xD730],
- ["C555",0xD731],
- ["C556",0xD732],
- ["C557",0xD733],
- ["C558",0xD736],
- ["C559",0xD737],
- ["C55A",0xD739],
- ["C561",0xD73A],
- ["C562",0xD73B],
- ["C563",0xD73D],
- ["C564",0xD73E],
- ["C565",0xD73F],
- ["C566",0xD740],
- ["C567",0xD741],
- ["C568",0xD742],
- ["C569",0xD743],
- ["C56A",0xD745],
- ["C56B",0xD746],
- ["C56C",0xD748],
- ["C56D",0xD74A],
- ["C56E",0xD74B],
- ["C56F",0xD74C],
- ["C570",0xD74D],
- ["C571",0xD74E],
- ["C572",0xD74F],
- ["C573",0xD752],
- ["C574",0xD753],
- ["C575",0xD755],
- ["C576",0xD75A],
- ["C577",0xD75B],
- ["C578",0xD75C],
- ["C579",0xD75D],
- ["C57A",0xD75E],
- ["C581",0xD75F],
- ["C582",0xD762],
- ["C583",0xD764],
- ["C584",0xD766],
- ["C585",0xD767],
- ["C586",0xD768],
- ["C587",0xD76A],
- ["C588",0xD76B],
- ["C589",0xD76D],
- ["C58A",0xD76E],
- ["C58B",0xD76F],
- ["C58C",0xD771],
- ["C58D",0xD772],
- ["C58E",0xD773],
- ["C58F",0xD775],
- ["C590",0xD776],
- ["C591",0xD777],
- ["C592",0xD778],
- ["C593",0xD779],
- ["C594",0xD77A],
- ["C595",0xD77B],
- ["C596",0xD77E],
- ["C597",0xD77F],
- ["C598",0xD780],
- ["C599",0xD782],
- ["C59A",0xD783],
- ["C59B",0xD784],
- ["C59C",0xD785],
- ["C59D",0xD786],
- ["C59E",0xD787],
- ["C59F",0xD78A],
- ["C5A0",0xD78B],
- ["C641",0xD78D],
- ["C642",0xD78E],
- ["C643",0xD78F],
- ["C644",0xD791],
- ["C645",0xD792],
- ["C646",0xD793],
- ["C647",0xD794],
- ["C648",0xD795],
- ["C649",0xD796],
- ["C64A",0xD797],
- ["C64B",0xD79A],
- ["C64C",0xD79C],
- ["C64D",0xD79E],
- ["C64E",0xD79F],
- ["C64F",0xD7A0],
- ["C650",0xD7A1],
- ["C651",0xD7A2],
- ["C652",0xD7A3],
-]
-
-CP949_TO_UCS_TBL = EUCKR_TO_UCS_TBL + CP949_TO_UCS_ADDITIONAL_TBL
-UCS_TO_CP949_TBL = CP949_TO_UCS_TBL.map {|a,b| [b,a]}
diff --git a/enc/trans/escape.trans b/enc/trans/escape.trans
deleted file mode 100644
index f45f27bc41..0000000000
--- a/enc/trans/escape.trans
+++ /dev/null
@@ -1,94 +0,0 @@
-#include "transcode_data.h"
-
-<%
- def hexstr(str)
- str.unpack("H*")[0]
- end
-
- transcode_tblgen("", "amp_escape", [
- ["{00-25,27-FF}", :nomap],
- ["26", hexstr("&amp;")]
- ])
-
- transcode_tblgen("", "xml_text_escape", [
- ["{00-25,27-3B,3D,3F-FF}", :nomap],
- ["26", hexstr("&amp;")],
- ["3C", hexstr("&lt;")],
- ["3E", hexstr("&gt;")]
- ])
-
- transcode_tblgen("", "xml_attr_content_escape", [
- ["{00-21,23-25,27-3B,3D,3F-FF}", :nomap],
- ["22", hexstr("&quot;")],
- ["26", hexstr("&amp;")],
- ["3C", hexstr("&lt;")],
- ["3E", hexstr("&gt;")]
- ])
-
- map_xml_attr_quote = {}
- map_xml_attr_quote["{00-FF}"] = :func_so
- transcode_generate_node(ActionMap.parse(map_xml_attr_quote), "escape_xml_attr_quote")
-%>
-
-<%= transcode_generated_code %>
-
-#define END 0
-#define NORMAL 1
-
-static int
-escape_xml_attr_quote_init(void *statep)
-{
- unsigned char *sp = statep;
- *sp = END;
- return 0;
-}
-
-static ssize_t
-fun_so_escape_xml_attr_quote(void *statep, const unsigned char *s, size_t l, unsigned char *o, size_t osize)
-{
- unsigned char *sp = statep;
- int n = 0;
- if (*sp == END) {
- *sp = NORMAL;
- o[n++] = '"';
- }
- o[n++] = s[0];
- return n;
-}
-
-static ssize_t
-escape_xml_attr_quote_finish(void *statep, unsigned char *o, size_t osize)
-{
- unsigned char *sp = statep;
- int n = 0;
-
- if (*sp == END) {
- o[n++] = '"';
- }
-
- o[n++] = '"';
- *sp = END;
-
- return n;
-}
-
-static const rb_transcoder
-rb_escape_xml_attr_quote = {
- "", "xml_attr_quote", escape_xml_attr_quote,
- TRANSCODE_TABLE_INFO,
- 1, /* input_unit_length */
- 1, /* max_input */
- 7, /* max_output */
- asciicompat_encoder, /* asciicompat_type */
- 1, escape_xml_attr_quote_init, escape_xml_attr_quote_init,
- NULL, NULL, NULL, fun_so_escape_xml_attr_quote,
- escape_xml_attr_quote_finish
-};
-
-void
-Init_escape(void)
-{
-<%= transcode_register_code %>
- rb_register_transcoder(&rb_escape_xml_attr_quote);
-}
-
diff --git a/enc/trans/euckr-tbl.rb b/enc/trans/euckr-tbl.rb
deleted file mode 100644
index 773cd90122..0000000000
--- a/enc/trans/euckr-tbl.rb
+++ /dev/null
@@ -1,8228 +0,0 @@
-EUCKR_TO_UCS_TBL = [
- ["A1A1",0x3000],
- ["A1A2",0x3001],
- ["A1A3",0x3002],
- ["A1A4",0xB7],
- ["A1A5",0x2025],
- ["A1A6",0x2026],
- ["A1A7",0xA8],
- ["A1A8",0x3003],
- ["A1A9",0xAD],
- ["A1AA",0x2015],
- ["A1AB",0x2225],
- ["A1AC",0xFF3C],
- ["A1AD",0x223C],
- ["A1AE",0x2018],
- ["A1AF",0x2019],
- ["A1B0",0x201C],
- ["A1B1",0x201D],
- ["A1B2",0x3014],
- ["A1B3",0x3015],
- ["A1B4",0x3008],
- ["A1B5",0x3009],
- ["A1B6",0x300A],
- ["A1B7",0x300B],
- ["A1B8",0x300C],
- ["A1B9",0x300D],
- ["A1BA",0x300E],
- ["A1BB",0x300F],
- ["A1BC",0x3010],
- ["A1BD",0x3011],
- ["A1BE",0xB1],
- ["A1BF",0xD7],
- ["A1C0",0xF7],
- ["A1C1",0x2260],
- ["A1C2",0x2264],
- ["A1C3",0x2265],
- ["A1C4",0x221E],
- ["A1C5",0x2234],
- ["A1C6",0xB0],
- ["A1C7",0x2032],
- ["A1C8",0x2033],
- ["A1C9",0x2103],
- ["A1CA",0x212B],
- ["A1CB",0xFFE0],
- ["A1CC",0xFFE1],
- ["A1CD",0xFFE5],
- ["A1CE",0x2642],
- ["A1CF",0x2640],
- ["A1D0",0x2220],
- ["A1D1",0x22A5],
- ["A1D2",0x2312],
- ["A1D3",0x2202],
- ["A1D4",0x2207],
- ["A1D5",0x2261],
- ["A1D6",0x2252],
- ["A1D7",0xA7],
- ["A1D8",0x203B],
- ["A1D9",0x2606],
- ["A1DA",0x2605],
- ["A1DB",0x25CB],
- ["A1DC",0x25CF],
- ["A1DD",0x25CE],
- ["A1DE",0x25C7],
- ["A1DF",0x25C6],
- ["A1E0",0x25A1],
- ["A1E1",0x25A0],
- ["A1E2",0x25B3],
- ["A1E3",0x25B2],
- ["A1E4",0x25BD],
- ["A1E5",0x25BC],
- ["A1E6",0x2192],
- ["A1E7",0x2190],
- ["A1E8",0x2191],
- ["A1E9",0x2193],
- ["A1EA",0x2194],
- ["A1EB",0x3013],
- ["A1EC",0x226A],
- ["A1ED",0x226B],
- ["A1EE",0x221A],
- ["A1EF",0x223D],
- ["A1F0",0x221D],
- ["A1F1",0x2235],
- ["A1F2",0x222B],
- ["A1F3",0x222C],
- ["A1F4",0x2208],
- ["A1F5",0x220B],
- ["A1F6",0x2286],
- ["A1F7",0x2287],
- ["A1F8",0x2282],
- ["A1F9",0x2283],
- ["A1FA",0x222A],
- ["A1FB",0x2229],
- ["A1FC",0x2227],
- ["A1FD",0x2228],
- ["A1FE",0xFFE2],
- ["A2A1",0x21D2],
- ["A2A2",0x21D4],
- ["A2A3",0x2200],
- ["A2A4",0x2203],
- ["A2A5",0xB4],
- ["A2A6",0xFF5E],
- ["A2A7",0x2C7],
- ["A2A8",0x2D8],
- ["A2A9",0x2DD],
- ["A2AA",0x2DA],
- ["A2AB",0x2D9],
- ["A2AC",0xB8],
- ["A2AD",0x2DB],
- ["A2AE",0xA1],
- ["A2AF",0xBF],
- ["A2B0",0x2D0],
- ["A2B1",0x222E],
- ["A2B2",0x2211],
- ["A2B3",0x220F],
- ["A2B4",0xA4],
- ["A2B5",0x2109],
- ["A2B6",0x2030],
- ["A2B7",0x25C1],
- ["A2B8",0x25C0],
- ["A2B9",0x25B7],
- ["A2BA",0x25B6],
- ["A2BB",0x2664],
- ["A2BC",0x2660],
- ["A2BD",0x2661],
- ["A2BE",0x2665],
- ["A2BF",0x2667],
- ["A2C0",0x2663],
- ["A2C1",0x2299],
- ["A2C2",0x25C8],
- ["A2C3",0x25A3],
- ["A2C4",0x25D0],
- ["A2C5",0x25D1],
- ["A2C6",0x2592],
- ["A2C7",0x25A4],
- ["A2C8",0x25A5],
- ["A2C9",0x25A8],
- ["A2CA",0x25A7],
- ["A2CB",0x25A6],
- ["A2CC",0x25A9],
- ["A2CD",0x2668],
- ["A2CE",0x260F],
- ["A2CF",0x260E],
- ["A2D0",0x261C],
- ["A2D1",0x261E],
- ["A2D2",0xB6],
- ["A2D3",0x2020],
- ["A2D4",0x2021],
- ["A2D5",0x2195],
- ["A2D6",0x2197],
- ["A2D7",0x2199],
- ["A2D8",0x2196],
- ["A2D9",0x2198],
- ["A2DA",0x266D],
- ["A2DB",0x2669],
- ["A2DC",0x266A],
- ["A2DD",0x266C],
- ["A2DE",0x327F],
- ["A2DF",0x321C],
- ["A2E0",0x2116],
- ["A2E1",0x33C7],
- ["A2E2",0x2122],
- ["A2E3",0x33C2],
- ["A2E4",0x33D8],
- ["A2E5",0x2121],
- ["A3A1",0xFF01],
- ["A3A2",0xFF02],
- ["A3A3",0xFF03],
- ["A3A4",0xFF04],
- ["A3A5",0xFF05],
- ["A3A6",0xFF06],
- ["A3A7",0xFF07],
- ["A3A8",0xFF08],
- ["A3A9",0xFF09],
- ["A3AA",0xFF0A],
- ["A3AB",0xFF0B],
- ["A3AC",0xFF0C],
- ["A3AD",0xFF0D],
- ["A3AE",0xFF0E],
- ["A3AF",0xFF0F],
- ["A3B0",0xFF10],
- ["A3B1",0xFF11],
- ["A3B2",0xFF12],
- ["A3B3",0xFF13],
- ["A3B4",0xFF14],
- ["A3B5",0xFF15],
- ["A3B6",0xFF16],
- ["A3B7",0xFF17],
- ["A3B8",0xFF18],
- ["A3B9",0xFF19],
- ["A3BA",0xFF1A],
- ["A3BB",0xFF1B],
- ["A3BC",0xFF1C],
- ["A3BD",0xFF1D],
- ["A3BE",0xFF1E],
- ["A3BF",0xFF1F],
- ["A3C0",0xFF20],
- ["A3C1",0xFF21],
- ["A3C2",0xFF22],
- ["A3C3",0xFF23],
- ["A3C4",0xFF24],
- ["A3C5",0xFF25],
- ["A3C6",0xFF26],
- ["A3C7",0xFF27],
- ["A3C8",0xFF28],
- ["A3C9",0xFF29],
- ["A3CA",0xFF2A],
- ["A3CB",0xFF2B],
- ["A3CC",0xFF2C],
- ["A3CD",0xFF2D],
- ["A3CE",0xFF2E],
- ["A3CF",0xFF2F],
- ["A3D0",0xFF30],
- ["A3D1",0xFF31],
- ["A3D2",0xFF32],
- ["A3D3",0xFF33],
- ["A3D4",0xFF34],
- ["A3D5",0xFF35],
- ["A3D6",0xFF36],
- ["A3D7",0xFF37],
- ["A3D8",0xFF38],
- ["A3D9",0xFF39],
- ["A3DA",0xFF3A],
- ["A3DB",0xFF3B],
- ["A3DC",0xFFE6],
- ["A3DD",0xFF3D],
- ["A3DE",0xFF3E],
- ["A3DF",0xFF3F],
- ["A3E0",0xFF40],
- ["A3E1",0xFF41],
- ["A3E2",0xFF42],
- ["A3E3",0xFF43],
- ["A3E4",0xFF44],
- ["A3E5",0xFF45],
- ["A3E6",0xFF46],
- ["A3E7",0xFF47],
- ["A3E8",0xFF48],
- ["A3E9",0xFF49],
- ["A3EA",0xFF4A],
- ["A3EB",0xFF4B],
- ["A3EC",0xFF4C],
- ["A3ED",0xFF4D],
- ["A3EE",0xFF4E],
- ["A3EF",0xFF4F],
- ["A3F0",0xFF50],
- ["A3F1",0xFF51],
- ["A3F2",0xFF52],
- ["A3F3",0xFF53],
- ["A3F4",0xFF54],
- ["A3F5",0xFF55],
- ["A3F6",0xFF56],
- ["A3F7",0xFF57],
- ["A3F8",0xFF58],
- ["A3F9",0xFF59],
- ["A3FA",0xFF5A],
- ["A3FB",0xFF5B],
- ["A3FC",0xFF5C],
- ["A3FD",0xFF5D],
- ["A3FE",0xFFE3],
- ["A4A1",0x3131],
- ["A4A2",0x3132],
- ["A4A3",0x3133],
- ["A4A4",0x3134],
- ["A4A5",0x3135],
- ["A4A6",0x3136],
- ["A4A7",0x3137],
- ["A4A8",0x3138],
- ["A4A9",0x3139],
- ["A4AA",0x313A],
- ["A4AB",0x313B],
- ["A4AC",0x313C],
- ["A4AD",0x313D],
- ["A4AE",0x313E],
- ["A4AF",0x313F],
- ["A4B0",0x3140],
- ["A4B1",0x3141],
- ["A4B2",0x3142],
- ["A4B3",0x3143],
- ["A4B4",0x3144],
- ["A4B5",0x3145],
- ["A4B6",0x3146],
- ["A4B7",0x3147],
- ["A4B8",0x3148],
- ["A4B9",0x3149],
- ["A4BA",0x314A],
- ["A4BB",0x314B],
- ["A4BC",0x314C],
- ["A4BD",0x314D],
- ["A4BE",0x314E],
- ["A4BF",0x314F],
- ["A4C0",0x3150],
- ["A4C1",0x3151],
- ["A4C2",0x3152],
- ["A4C3",0x3153],
- ["A4C4",0x3154],
- ["A4C5",0x3155],
- ["A4C6",0x3156],
- ["A4C7",0x3157],
- ["A4C8",0x3158],
- ["A4C9",0x3159],
- ["A4CA",0x315A],
- ["A4CB",0x315B],
- ["A4CC",0x315C],
- ["A4CD",0x315D],
- ["A4CE",0x315E],
- ["A4CF",0x315F],
- ["A4D0",0x3160],
- ["A4D1",0x3161],
- ["A4D2",0x3162],
- ["A4D3",0x3163],
- ["A4D4",0x3164],
- ["A4D5",0x3165],
- ["A4D6",0x3166],
- ["A4D7",0x3167],
- ["A4D8",0x3168],
- ["A4D9",0x3169],
- ["A4DA",0x316A],
- ["A4DB",0x316B],
- ["A4DC",0x316C],
- ["A4DD",0x316D],
- ["A4DE",0x316E],
- ["A4DF",0x316F],
- ["A4E0",0x3170],
- ["A4E1",0x3171],
- ["A4E2",0x3172],
- ["A4E3",0x3173],
- ["A4E4",0x3174],
- ["A4E5",0x3175],
- ["A4E6",0x3176],
- ["A4E7",0x3177],
- ["A4E8",0x3178],
- ["A4E9",0x3179],
- ["A4EA",0x317A],
- ["A4EB",0x317B],
- ["A4EC",0x317C],
- ["A4ED",0x317D],
- ["A4EE",0x317E],
- ["A4EF",0x317F],
- ["A4F0",0x3180],
- ["A4F1",0x3181],
- ["A4F2",0x3182],
- ["A4F3",0x3183],
- ["A4F4",0x3184],
- ["A4F5",0x3185],
- ["A4F6",0x3186],
- ["A4F7",0x3187],
- ["A4F8",0x3188],
- ["A4F9",0x3189],
- ["A4FA",0x318A],
- ["A4FB",0x318B],
- ["A4FC",0x318C],
- ["A4FD",0x318D],
- ["A4FE",0x318E],
- ["A5A1",0x2170],
- ["A5A2",0x2171],
- ["A5A3",0x2172],
- ["A5A4",0x2173],
- ["A5A5",0x2174],
- ["A5A6",0x2175],
- ["A5A7",0x2176],
- ["A5A8",0x2177],
- ["A5A9",0x2178],
- ["A5AA",0x2179],
- ["A5B0",0x2160],
- ["A5B1",0x2161],
- ["A5B2",0x2162],
- ["A5B3",0x2163],
- ["A5B4",0x2164],
- ["A5B5",0x2165],
- ["A5B6",0x2166],
- ["A5B7",0x2167],
- ["A5B8",0x2168],
- ["A5B9",0x2169],
- ["A5C1",0x391],
- ["A5C2",0x392],
- ["A5C3",0x393],
- ["A5C4",0x394],
- ["A5C5",0x395],
- ["A5C6",0x396],
- ["A5C7",0x397],
- ["A5C8",0x398],
- ["A5C9",0x399],
- ["A5CA",0x39A],
- ["A5CB",0x39B],
- ["A5CC",0x39C],
- ["A5CD",0x39D],
- ["A5CE",0x39E],
- ["A5CF",0x39F],
- ["A5D0",0x3A0],
- ["A5D1",0x3A1],
- ["A5D2",0x3A3],
- ["A5D3",0x3A4],
- ["A5D4",0x3A5],
- ["A5D5",0x3A6],
- ["A5D6",0x3A7],
- ["A5D7",0x3A8],
- ["A5D8",0x3A9],
- ["A5E1",0x3B1],
- ["A5E2",0x3B2],
- ["A5E3",0x3B3],
- ["A5E4",0x3B4],
- ["A5E5",0x3B5],
- ["A5E6",0x3B6],
- ["A5E7",0x3B7],
- ["A5E8",0x3B8],
- ["A5E9",0x3B9],
- ["A5EA",0x3BA],
- ["A5EB",0x3BB],
- ["A5EC",0x3BC],
- ["A5ED",0x3BD],
- ["A5EE",0x3BE],
- ["A5EF",0x3BF],
- ["A5F0",0x3C0],
- ["A5F1",0x3C1],
- ["A5F2",0x3C3],
- ["A5F3",0x3C4],
- ["A5F4",0x3C5],
- ["A5F5",0x3C6],
- ["A5F6",0x3C7],
- ["A5F7",0x3C8],
- ["A5F8",0x3C9],
- ["A6A1",0x2500],
- ["A6A2",0x2502],
- ["A6A3",0x250C],
- ["A6A4",0x2510],
- ["A6A5",0x2518],
- ["A6A6",0x2514],
- ["A6A7",0x251C],
- ["A6A8",0x252C],
- ["A6A9",0x2524],
- ["A6AA",0x2534],
- ["A6AB",0x253C],
- ["A6AC",0x2501],
- ["A6AD",0x2503],
- ["A6AE",0x250F],
- ["A6AF",0x2513],
- ["A6B0",0x251B],
- ["A6B1",0x2517],
- ["A6B2",0x2523],
- ["A6B3",0x2533],
- ["A6B4",0x252B],
- ["A6B5",0x253B],
- ["A6B6",0x254B],
- ["A6B7",0x2520],
- ["A6B8",0x252F],
- ["A6B9",0x2528],
- ["A6BA",0x2537],
- ["A6BB",0x253F],
- ["A6BC",0x251D],
- ["A6BD",0x2530],
- ["A6BE",0x2525],
- ["A6BF",0x2538],
- ["A6C0",0x2542],
- ["A6C1",0x2512],
- ["A6C2",0x2511],
- ["A6C3",0x251A],
- ["A6C4",0x2519],
- ["A6C5",0x2516],
- ["A6C6",0x2515],
- ["A6C7",0x250E],
- ["A6C8",0x250D],
- ["A6C9",0x251E],
- ["A6CA",0x251F],
- ["A6CB",0x2521],
- ["A6CC",0x2522],
- ["A6CD",0x2526],
- ["A6CE",0x2527],
- ["A6CF",0x2529],
- ["A6D0",0x252A],
- ["A6D1",0x252D],
- ["A6D2",0x252E],
- ["A6D3",0x2531],
- ["A6D4",0x2532],
- ["A6D5",0x2535],
- ["A6D6",0x2536],
- ["A6D7",0x2539],
- ["A6D8",0x253A],
- ["A6D9",0x253D],
- ["A6DA",0x253E],
- ["A6DB",0x2540],
- ["A6DC",0x2541],
- ["A6DD",0x2543],
- ["A6DE",0x2544],
- ["A6DF",0x2545],
- ["A6E0",0x2546],
- ["A6E1",0x2547],
- ["A6E2",0x2548],
- ["A6E3",0x2549],
- ["A6E4",0x254A],
- ["A7A1",0x3395],
- ["A7A2",0x3396],
- ["A7A3",0x3397],
- ["A7A4",0x2113],
- ["A7A5",0x3398],
- ["A7A6",0x33C4],
- ["A7A7",0x33A3],
- ["A7A8",0x33A4],
- ["A7A9",0x33A5],
- ["A7AA",0x33A6],
- ["A7AB",0x3399],
- ["A7AC",0x339A],
- ["A7AD",0x339B],
- ["A7AE",0x339C],
- ["A7AF",0x339D],
- ["A7B0",0x339E],
- ["A7B1",0x339F],
- ["A7B2",0x33A0],
- ["A7B3",0x33A1],
- ["A7B4",0x33A2],
- ["A7B5",0x33CA],
- ["A7B6",0x338D],
- ["A7B7",0x338E],
- ["A7B8",0x338F],
- ["A7B9",0x33CF],
- ["A7BA",0x3388],
- ["A7BB",0x3389],
- ["A7BC",0x33C8],
- ["A7BD",0x33A7],
- ["A7BE",0x33A8],
- ["A7BF",0x33B0],
- ["A7C0",0x33B1],
- ["A7C1",0x33B2],
- ["A7C2",0x33B3],
- ["A7C3",0x33B4],
- ["A7C4",0x33B5],
- ["A7C5",0x33B6],
- ["A7C6",0x33B7],
- ["A7C7",0x33B8],
- ["A7C8",0x33B9],
- ["A7C9",0x3380],
- ["A7CA",0x3381],
- ["A7CB",0x3382],
- ["A7CC",0x3383],
- ["A7CD",0x3384],
- ["A7CE",0x33BA],
- ["A7CF",0x33BB],
- ["A7D0",0x33BC],
- ["A7D1",0x33BD],
- ["A7D2",0x33BE],
- ["A7D3",0x33BF],
- ["A7D4",0x3390],
- ["A7D5",0x3391],
- ["A7D6",0x3392],
- ["A7D7",0x3393],
- ["A7D8",0x3394],
- ["A7D9",0x2126],
- ["A7DA",0x33C0],
- ["A7DB",0x33C1],
- ["A7DC",0x338A],
- ["A7DD",0x338B],
- ["A7DE",0x338C],
- ["A7DF",0x33D6],
- ["A7E0",0x33C5],
- ["A7E1",0x33AD],
- ["A7E2",0x33AE],
- ["A7E3",0x33AF],
- ["A7E4",0x33DB],
- ["A7E5",0x33A9],
- ["A7E6",0x33AA],
- ["A7E7",0x33AB],
- ["A7E8",0x33AC],
- ["A7E9",0x33DD],
- ["A7EA",0x33D0],
- ["A7EB",0x33D3],
- ["A7EC",0x33C3],
- ["A7ED",0x33C9],
- ["A7EE",0x33DC],
- ["A7EF",0x33C6],
- ["A8A1",0xC6],
- ["A8A2",0xD0],
- ["A8A3",0xAA],
- ["A8A4",0x126],
- ["A8A6",0x132],
- ["A8A8",0x13F],
- ["A8A9",0x141],
- ["A8AA",0xD8],
- ["A8AB",0x152],
- ["A8AC",0xBA],
- ["A8AD",0xDE],
- ["A8AE",0x166],
- ["A8AF",0x14A],
- ["A8B1",0x3260],
- ["A8B2",0x3261],
- ["A8B3",0x3262],
- ["A8B4",0x3263],
- ["A8B5",0x3264],
- ["A8B6",0x3265],
- ["A8B7",0x3266],
- ["A8B8",0x3267],
- ["A8B9",0x3268],
- ["A8BA",0x3269],
- ["A8BB",0x326A],
- ["A8BC",0x326B],
- ["A8BD",0x326C],
- ["A8BE",0x326D],
- ["A8BF",0x326E],
- ["A8C0",0x326F],
- ["A8C1",0x3270],
- ["A8C2",0x3271],
- ["A8C3",0x3272],
- ["A8C4",0x3273],
- ["A8C5",0x3274],
- ["A8C6",0x3275],
- ["A8C7",0x3276],
- ["A8C8",0x3277],
- ["A8C9",0x3278],
- ["A8CA",0x3279],
- ["A8CB",0x327A],
- ["A8CC",0x327B],
- ["A8CD",0x24D0],
- ["A8CE",0x24D1],
- ["A8CF",0x24D2],
- ["A8D0",0x24D3],
- ["A8D1",0x24D4],
- ["A8D2",0x24D5],
- ["A8D3",0x24D6],
- ["A8D4",0x24D7],
- ["A8D5",0x24D8],
- ["A8D6",0x24D9],
- ["A8D7",0x24DA],
- ["A8D8",0x24DB],
- ["A8D9",0x24DC],
- ["A8DA",0x24DD],
- ["A8DB",0x24DE],
- ["A8DC",0x24DF],
- ["A8DD",0x24E0],
- ["A8DE",0x24E1],
- ["A8DF",0x24E2],
- ["A8E0",0x24E3],
- ["A8E1",0x24E4],
- ["A8E2",0x24E5],
- ["A8E3",0x24E6],
- ["A8E4",0x24E7],
- ["A8E5",0x24E8],
- ["A8E6",0x24E9],
- ["A8E7",0x2460],
- ["A8E8",0x2461],
- ["A8E9",0x2462],
- ["A8EA",0x2463],
- ["A8EB",0x2464],
- ["A8EC",0x2465],
- ["A8ED",0x2466],
- ["A8EE",0x2467],
- ["A8EF",0x2468],
- ["A8F0",0x2469],
- ["A8F1",0x246A],
- ["A8F2",0x246B],
- ["A8F3",0x246C],
- ["A8F4",0x246D],
- ["A8F5",0x246E],
- ["A8F6",0xBD],
- ["A8F7",0x2153],
- ["A8F8",0x2154],
- ["A8F9",0xBC],
- ["A8FA",0xBE],
- ["A8FB",0x215B],
- ["A8FC",0x215C],
- ["A8FD",0x215D],
- ["A8FE",0x215E],
- ["A9A1",0xE6],
- ["A9A2",0x111],
- ["A9A3",0xF0],
- ["A9A4",0x127],
- ["A9A5",0x131],
- ["A9A6",0x133],
- ["A9A7",0x138],
- ["A9A8",0x140],
- ["A9A9",0x142],
- ["A9AA",0xF8],
- ["A9AB",0x153],
- ["A9AC",0xDF],
- ["A9AD",0xFE],
- ["A9AE",0x167],
- ["A9AF",0x14B],
- ["A9B0",0x149],
- ["A9B1",0x3200],
- ["A9B2",0x3201],
- ["A9B3",0x3202],
- ["A9B4",0x3203],
- ["A9B5",0x3204],
- ["A9B6",0x3205],
- ["A9B7",0x3206],
- ["A9B8",0x3207],
- ["A9B9",0x3208],
- ["A9BA",0x3209],
- ["A9BB",0x320A],
- ["A9BC",0x320B],
- ["A9BD",0x320C],
- ["A9BE",0x320D],
- ["A9BF",0x320E],
- ["A9C0",0x320F],
- ["A9C1",0x3210],
- ["A9C2",0x3211],
- ["A9C3",0x3212],
- ["A9C4",0x3213],
- ["A9C5",0x3214],
- ["A9C6",0x3215],
- ["A9C7",0x3216],
- ["A9C8",0x3217],
- ["A9C9",0x3218],
- ["A9CA",0x3219],
- ["A9CB",0x321A],
- ["A9CC",0x321B],
- ["A9CD",0x249C],
- ["A9CE",0x249D],
- ["A9CF",0x249E],
- ["A9D0",0x249F],
- ["A9D1",0x24A0],
- ["A9D2",0x24A1],
- ["A9D3",0x24A2],
- ["A9D4",0x24A3],
- ["A9D5",0x24A4],
- ["A9D6",0x24A5],
- ["A9D7",0x24A6],
- ["A9D8",0x24A7],
- ["A9D9",0x24A8],
- ["A9DA",0x24A9],
- ["A9DB",0x24AA],
- ["A9DC",0x24AB],
- ["A9DD",0x24AC],
- ["A9DE",0x24AD],
- ["A9DF",0x24AE],
- ["A9E0",0x24AF],
- ["A9E1",0x24B0],
- ["A9E2",0x24B1],
- ["A9E3",0x24B2],
- ["A9E4",0x24B3],
- ["A9E5",0x24B4],
- ["A9E6",0x24B5],
- ["A9E7",0x2474],
- ["A9E8",0x2475],
- ["A9E9",0x2476],
- ["A9EA",0x2477],
- ["A9EB",0x2478],
- ["A9EC",0x2479],
- ["A9ED",0x247A],
- ["A9EE",0x247B],
- ["A9EF",0x247C],
- ["A9F0",0x247D],
- ["A9F1",0x247E],
- ["A9F2",0x247F],
- ["A9F3",0x2480],
- ["A9F4",0x2481],
- ["A9F5",0x2482],
- ["A9F6",0xB9],
- ["A9F7",0xB2],
- ["A9F8",0xB3],
- ["A9F9",0x2074],
- ["A9FA",0x207F],
- ["A9FB",0x2081],
- ["A9FC",0x2082],
- ["A9FD",0x2083],
- ["A9FE",0x2084],
- ["AAA1",0x3041],
- ["AAA2",0x3042],
- ["AAA3",0x3043],
- ["AAA4",0x3044],
- ["AAA5",0x3045],
- ["AAA6",0x3046],
- ["AAA7",0x3047],
- ["AAA8",0x3048],
- ["AAA9",0x3049],
- ["AAAA",0x304A],
- ["AAAB",0x304B],
- ["AAAC",0x304C],
- ["AAAD",0x304D],
- ["AAAE",0x304E],
- ["AAAF",0x304F],
- ["AAB0",0x3050],
- ["AAB1",0x3051],
- ["AAB2",0x3052],
- ["AAB3",0x3053],
- ["AAB4",0x3054],
- ["AAB5",0x3055],
- ["AAB6",0x3056],
- ["AAB7",0x3057],
- ["AAB8",0x3058],
- ["AAB9",0x3059],
- ["AABA",0x305A],
- ["AABB",0x305B],
- ["AABC",0x305C],
- ["AABD",0x305D],
- ["AABE",0x305E],
- ["AABF",0x305F],
- ["AAC0",0x3060],
- ["AAC1",0x3061],
- ["AAC2",0x3062],
- ["AAC3",0x3063],
- ["AAC4",0x3064],
- ["AAC5",0x3065],
- ["AAC6",0x3066],
- ["AAC7",0x3067],
- ["AAC8",0x3068],
- ["AAC9",0x3069],
- ["AACA",0x306A],
- ["AACB",0x306B],
- ["AACC",0x306C],
- ["AACD",0x306D],
- ["AACE",0x306E],
- ["AACF",0x306F],
- ["AAD0",0x3070],
- ["AAD1",0x3071],
- ["AAD2",0x3072],
- ["AAD3",0x3073],
- ["AAD4",0x3074],
- ["AAD5",0x3075],
- ["AAD6",0x3076],
- ["AAD7",0x3077],
- ["AAD8",0x3078],
- ["AAD9",0x3079],
- ["AADA",0x307A],
- ["AADB",0x307B],
- ["AADC",0x307C],
- ["AADD",0x307D],
- ["AADE",0x307E],
- ["AADF",0x307F],
- ["AAE0",0x3080],
- ["AAE1",0x3081],
- ["AAE2",0x3082],
- ["AAE3",0x3083],
- ["AAE4",0x3084],
- ["AAE5",0x3085],
- ["AAE6",0x3086],
- ["AAE7",0x3087],
- ["AAE8",0x3088],
- ["AAE9",0x3089],
- ["AAEA",0x308A],
- ["AAEB",0x308B],
- ["AAEC",0x308C],
- ["AAED",0x308D],
- ["AAEE",0x308E],
- ["AAEF",0x308F],
- ["AAF0",0x3090],
- ["AAF1",0x3091],
- ["AAF2",0x3092],
- ["AAF3",0x3093],
- ["ABA1",0x30A1],
- ["ABA2",0x30A2],
- ["ABA3",0x30A3],
- ["ABA4",0x30A4],
- ["ABA5",0x30A5],
- ["ABA6",0x30A6],
- ["ABA7",0x30A7],
- ["ABA8",0x30A8],
- ["ABA9",0x30A9],
- ["ABAA",0x30AA],
- ["ABAB",0x30AB],
- ["ABAC",0x30AC],
- ["ABAD",0x30AD],
- ["ABAE",0x30AE],
- ["ABAF",0x30AF],
- ["ABB0",0x30B0],
- ["ABB1",0x30B1],
- ["ABB2",0x30B2],
- ["ABB3",0x30B3],
- ["ABB4",0x30B4],
- ["ABB5",0x30B5],
- ["ABB6",0x30B6],
- ["ABB7",0x30B7],
- ["ABB8",0x30B8],
- ["ABB9",0x30B9],
- ["ABBA",0x30BA],
- ["ABBB",0x30BB],
- ["ABBC",0x30BC],
- ["ABBD",0x30BD],
- ["ABBE",0x30BE],
- ["ABBF",0x30BF],
- ["ABC0",0x30C0],
- ["ABC1",0x30C1],
- ["ABC2",0x30C2],
- ["ABC3",0x30C3],
- ["ABC4",0x30C4],
- ["ABC5",0x30C5],
- ["ABC6",0x30C6],
- ["ABC7",0x30C7],
- ["ABC8",0x30C8],
- ["ABC9",0x30C9],
- ["ABCA",0x30CA],
- ["ABCB",0x30CB],
- ["ABCC",0x30CC],
- ["ABCD",0x30CD],
- ["ABCE",0x30CE],
- ["ABCF",0x30CF],
- ["ABD0",0x30D0],
- ["ABD1",0x30D1],
- ["ABD2",0x30D2],
- ["ABD3",0x30D3],
- ["ABD4",0x30D4],
- ["ABD5",0x30D5],
- ["ABD6",0x30D6],
- ["ABD7",0x30D7],
- ["ABD8",0x30D8],
- ["ABD9",0x30D9],
- ["ABDA",0x30DA],
- ["ABDB",0x30DB],
- ["ABDC",0x30DC],
- ["ABDD",0x30DD],
- ["ABDE",0x30DE],
- ["ABDF",0x30DF],
- ["ABE0",0x30E0],
- ["ABE1",0x30E1],
- ["ABE2",0x30E2],
- ["ABE3",0x30E3],
- ["ABE4",0x30E4],
- ["ABE5",0x30E5],
- ["ABE6",0x30E6],
- ["ABE7",0x30E7],
- ["ABE8",0x30E8],
- ["ABE9",0x30E9],
- ["ABEA",0x30EA],
- ["ABEB",0x30EB],
- ["ABEC",0x30EC],
- ["ABED",0x30ED],
- ["ABEE",0x30EE],
- ["ABEF",0x30EF],
- ["ABF0",0x30F0],
- ["ABF1",0x30F1],
- ["ABF2",0x30F2],
- ["ABF3",0x30F3],
- ["ABF4",0x30F4],
- ["ABF5",0x30F5],
- ["ABF6",0x30F6],
- ["ACA1",0x410],
- ["ACA2",0x411],
- ["ACA3",0x412],
- ["ACA4",0x413],
- ["ACA5",0x414],
- ["ACA6",0x415],
- ["ACA7",0x401],
- ["ACA8",0x416],
- ["ACA9",0x417],
- ["ACAA",0x418],
- ["ACAB",0x419],
- ["ACAC",0x41A],
- ["ACAD",0x41B],
- ["ACAE",0x41C],
- ["ACAF",0x41D],
- ["ACB0",0x41E],
- ["ACB1",0x41F],
- ["ACB2",0x420],
- ["ACB3",0x421],
- ["ACB4",0x422],
- ["ACB5",0x423],
- ["ACB6",0x424],
- ["ACB7",0x425],
- ["ACB8",0x426],
- ["ACB9",0x427],
- ["ACBA",0x428],
- ["ACBB",0x429],
- ["ACBC",0x42A],
- ["ACBD",0x42B],
- ["ACBE",0x42C],
- ["ACBF",0x42D],
- ["ACC0",0x42E],
- ["ACC1",0x42F],
- ["ACD1",0x430],
- ["ACD2",0x431],
- ["ACD3",0x432],
- ["ACD4",0x433],
- ["ACD5",0x434],
- ["ACD6",0x435],
- ["ACD7",0x451],
- ["ACD8",0x436],
- ["ACD9",0x437],
- ["ACDA",0x438],
- ["ACDB",0x439],
- ["ACDC",0x43A],
- ["ACDD",0x43B],
- ["ACDE",0x43C],
- ["ACDF",0x43D],
- ["ACE0",0x43E],
- ["ACE1",0x43F],
- ["ACE2",0x440],
- ["ACE3",0x441],
- ["ACE4",0x442],
- ["ACE5",0x443],
- ["ACE6",0x444],
- ["ACE7",0x445],
- ["ACE8",0x446],
- ["ACE9",0x447],
- ["ACEA",0x448],
- ["ACEB",0x449],
- ["ACEC",0x44A],
- ["ACED",0x44B],
- ["ACEE",0x44C],
- ["ACEF",0x44D],
- ["ACF0",0x44E],
- ["ACF1",0x44F],
- ["B0A1",0xAC00],
- ["B0A2",0xAC01],
- ["B0A3",0xAC04],
- ["B0A4",0xAC07],
- ["B0A5",0xAC08],
- ["B0A6",0xAC09],
- ["B0A7",0xAC0A],
- ["B0A8",0xAC10],
- ["B0A9",0xAC11],
- ["B0AA",0xAC12],
- ["B0AB",0xAC13],
- ["B0AC",0xAC14],
- ["B0AD",0xAC15],
- ["B0AE",0xAC16],
- ["B0AF",0xAC17],
- ["B0B0",0xAC19],
- ["B0B1",0xAC1A],
- ["B0B2",0xAC1B],
- ["B0B3",0xAC1C],
- ["B0B4",0xAC1D],
- ["B0B5",0xAC20],
- ["B0B6",0xAC24],
- ["B0B7",0xAC2C],
- ["B0B8",0xAC2D],
- ["B0B9",0xAC2F],
- ["B0BA",0xAC30],
- ["B0BB",0xAC31],
- ["B0BC",0xAC38],
- ["B0BD",0xAC39],
- ["B0BE",0xAC3C],
- ["B0BF",0xAC40],
- ["B0C0",0xAC4B],
- ["B0C1",0xAC4D],
- ["B0C2",0xAC54],
- ["B0C3",0xAC58],
- ["B0C4",0xAC5C],
- ["B0C5",0xAC70],
- ["B0C6",0xAC71],
- ["B0C7",0xAC74],
- ["B0C8",0xAC77],
- ["B0C9",0xAC78],
- ["B0CA",0xAC7A],
- ["B0CB",0xAC80],
- ["B0CC",0xAC81],
- ["B0CD",0xAC83],
- ["B0CE",0xAC84],
- ["B0CF",0xAC85],
- ["B0D0",0xAC86],
- ["B0D1",0xAC89],
- ["B0D2",0xAC8A],
- ["B0D3",0xAC8B],
- ["B0D4",0xAC8C],
- ["B0D5",0xAC90],
- ["B0D6",0xAC94],
- ["B0D7",0xAC9C],
- ["B0D8",0xAC9D],
- ["B0D9",0xAC9F],
- ["B0DA",0xACA0],
- ["B0DB",0xACA1],
- ["B0DC",0xACA8],
- ["B0DD",0xACA9],
- ["B0DE",0xACAA],
- ["B0DF",0xACAC],
- ["B0E0",0xACAF],
- ["B0E1",0xACB0],
- ["B0E2",0xACB8],
- ["B0E3",0xACB9],
- ["B0E4",0xACBB],
- ["B0E5",0xACBC],
- ["B0E6",0xACBD],
- ["B0E7",0xACC1],
- ["B0E8",0xACC4],
- ["B0E9",0xACC8],
- ["B0EA",0xACCC],
- ["B0EB",0xACD5],
- ["B0EC",0xACD7],
- ["B0ED",0xACE0],
- ["B0EE",0xACE1],
- ["B0EF",0xACE4],
- ["B0F0",0xACE7],
- ["B0F1",0xACE8],
- ["B0F2",0xACEA],
- ["B0F3",0xACEC],
- ["B0F4",0xACEF],
- ["B0F5",0xACF0],
- ["B0F6",0xACF1],
- ["B0F7",0xACF3],
- ["B0F8",0xACF5],
- ["B0F9",0xACF6],
- ["B0FA",0xACFC],
- ["B0FB",0xACFD],
- ["B0FC",0xAD00],
- ["B0FD",0xAD04],
- ["B0FE",0xAD06],
- ["B1A1",0xAD0C],
- ["B1A2",0xAD0D],
- ["B1A3",0xAD0F],
- ["B1A4",0xAD11],
- ["B1A5",0xAD18],
- ["B1A6",0xAD1C],
- ["B1A7",0xAD20],
- ["B1A8",0xAD29],
- ["B1A9",0xAD2C],
- ["B1AA",0xAD2D],
- ["B1AB",0xAD34],
- ["B1AC",0xAD35],
- ["B1AD",0xAD38],
- ["B1AE",0xAD3C],
- ["B1AF",0xAD44],
- ["B1B0",0xAD45],
- ["B1B1",0xAD47],
- ["B1B2",0xAD49],
- ["B1B3",0xAD50],
- ["B1B4",0xAD54],
- ["B1B5",0xAD58],
- ["B1B6",0xAD61],
- ["B1B7",0xAD63],
- ["B1B8",0xAD6C],
- ["B1B9",0xAD6D],
- ["B1BA",0xAD70],
- ["B1BB",0xAD73],
- ["B1BC",0xAD74],
- ["B1BD",0xAD75],
- ["B1BE",0xAD76],
- ["B1BF",0xAD7B],
- ["B1C0",0xAD7C],
- ["B1C1",0xAD7D],
- ["B1C2",0xAD7F],
- ["B1C3",0xAD81],
- ["B1C4",0xAD82],
- ["B1C5",0xAD88],
- ["B1C6",0xAD89],
- ["B1C7",0xAD8C],
- ["B1C8",0xAD90],
- ["B1C9",0xAD9C],
- ["B1CA",0xAD9D],
- ["B1CB",0xADA4],
- ["B1CC",0xADB7],
- ["B1CD",0xADC0],
- ["B1CE",0xADC1],
- ["B1CF",0xADC4],
- ["B1D0",0xADC8],
- ["B1D1",0xADD0],
- ["B1D2",0xADD1],
- ["B1D3",0xADD3],
- ["B1D4",0xADDC],
- ["B1D5",0xADE0],
- ["B1D6",0xADE4],
- ["B1D7",0xADF8],
- ["B1D8",0xADF9],
- ["B1D9",0xADFC],
- ["B1DA",0xADFF],
- ["B1DB",0xAE00],
- ["B1DC",0xAE01],
- ["B1DD",0xAE08],
- ["B1DE",0xAE09],
- ["B1DF",0xAE0B],
- ["B1E0",0xAE0D],
- ["B1E1",0xAE14],
- ["B1E2",0xAE30],
- ["B1E3",0xAE31],
- ["B1E4",0xAE34],
- ["B1E5",0xAE37],
- ["B1E6",0xAE38],
- ["B1E7",0xAE3A],
- ["B1E8",0xAE40],
- ["B1E9",0xAE41],
- ["B1EA",0xAE43],
- ["B1EB",0xAE45],
- ["B1EC",0xAE46],
- ["B1ED",0xAE4A],
- ["B1EE",0xAE4C],
- ["B1EF",0xAE4D],
- ["B1F0",0xAE4E],
- ["B1F1",0xAE50],
- ["B1F2",0xAE54],
- ["B1F3",0xAE56],
- ["B1F4",0xAE5C],
- ["B1F5",0xAE5D],
- ["B1F6",0xAE5F],
- ["B1F7",0xAE60],
- ["B1F8",0xAE61],
- ["B1F9",0xAE65],
- ["B1FA",0xAE68],
- ["B1FB",0xAE69],
- ["B1FC",0xAE6C],
- ["B1FD",0xAE70],
- ["B1FE",0xAE78],
- ["B2A1",0xAE79],
- ["B2A2",0xAE7B],
- ["B2A3",0xAE7C],
- ["B2A4",0xAE7D],
- ["B2A5",0xAE84],
- ["B2A6",0xAE85],
- ["B2A7",0xAE8C],
- ["B2A8",0xAEBC],
- ["B2A9",0xAEBD],
- ["B2AA",0xAEBE],
- ["B2AB",0xAEC0],
- ["B2AC",0xAEC4],
- ["B2AD",0xAECC],
- ["B2AE",0xAECD],
- ["B2AF",0xAECF],
- ["B2B0",0xAED0],
- ["B2B1",0xAED1],
- ["B2B2",0xAED8],
- ["B2B3",0xAED9],
- ["B2B4",0xAEDC],
- ["B2B5",0xAEE8],
- ["B2B6",0xAEEB],
- ["B2B7",0xAEED],
- ["B2B8",0xAEF4],
- ["B2B9",0xAEF8],
- ["B2BA",0xAEFC],
- ["B2BB",0xAF07],
- ["B2BC",0xAF08],
- ["B2BD",0xAF0D],
- ["B2BE",0xAF10],
- ["B2BF",0xAF2C],
- ["B2C0",0xAF2D],
- ["B2C1",0xAF30],
- ["B2C2",0xAF32],
- ["B2C3",0xAF34],
- ["B2C4",0xAF3C],
- ["B2C5",0xAF3D],
- ["B2C6",0xAF3F],
- ["B2C7",0xAF41],
- ["B2C8",0xAF42],
- ["B2C9",0xAF43],
- ["B2CA",0xAF48],
- ["B2CB",0xAF49],
- ["B2CC",0xAF50],
- ["B2CD",0xAF5C],
- ["B2CE",0xAF5D],
- ["B2CF",0xAF64],
- ["B2D0",0xAF65],
- ["B2D1",0xAF79],
- ["B2D2",0xAF80],
- ["B2D3",0xAF84],
- ["B2D4",0xAF88],
- ["B2D5",0xAF90],
- ["B2D6",0xAF91],
- ["B2D7",0xAF95],
- ["B2D8",0xAF9C],
- ["B2D9",0xAFB8],
- ["B2DA",0xAFB9],
- ["B2DB",0xAFBC],
- ["B2DC",0xAFC0],
- ["B2DD",0xAFC7],
- ["B2DE",0xAFC8],
- ["B2DF",0xAFC9],
- ["B2E0",0xAFCB],
- ["B2E1",0xAFCD],
- ["B2E2",0xAFCE],
- ["B2E3",0xAFD4],
- ["B2E4",0xAFDC],
- ["B2E5",0xAFE8],
- ["B2E6",0xAFE9],
- ["B2E7",0xAFF0],
- ["B2E8",0xAFF1],
- ["B2E9",0xAFF4],
- ["B2EA",0xAFF8],
- ["B2EB",0xB000],
- ["B2EC",0xB001],
- ["B2ED",0xB004],
- ["B2EE",0xB00C],
- ["B2EF",0xB010],
- ["B2F0",0xB014],
- ["B2F1",0xB01C],
- ["B2F2",0xB01D],
- ["B2F3",0xB028],
- ["B2F4",0xB044],
- ["B2F5",0xB045],
- ["B2F6",0xB048],
- ["B2F7",0xB04A],
- ["B2F8",0xB04C],
- ["B2F9",0xB04E],
- ["B2FA",0xB053],
- ["B2FB",0xB054],
- ["B2FC",0xB055],
- ["B2FD",0xB057],
- ["B2FE",0xB059],
- ["B3A1",0xB05D],
- ["B3A2",0xB07C],
- ["B3A3",0xB07D],
- ["B3A4",0xB080],
- ["B3A5",0xB084],
- ["B3A6",0xB08C],
- ["B3A7",0xB08D],
- ["B3A8",0xB08F],
- ["B3A9",0xB091],
- ["B3AA",0xB098],
- ["B3AB",0xB099],
- ["B3AC",0xB09A],
- ["B3AD",0xB09C],
- ["B3AE",0xB09F],
- ["B3AF",0xB0A0],
- ["B3B0",0xB0A1],
- ["B3B1",0xB0A2],
- ["B3B2",0xB0A8],
- ["B3B3",0xB0A9],
- ["B3B4",0xB0AB],
- ["B3B5",0xB0AC],
- ["B3B6",0xB0AD],
- ["B3B7",0xB0AE],
- ["B3B8",0xB0AF],
- ["B3B9",0xB0B1],
- ["B3BA",0xB0B3],
- ["B3BB",0xB0B4],
- ["B3BC",0xB0B5],
- ["B3BD",0xB0B8],
- ["B3BE",0xB0BC],
- ["B3BF",0xB0C4],
- ["B3C0",0xB0C5],
- ["B3C1",0xB0C7],
- ["B3C2",0xB0C8],
- ["B3C3",0xB0C9],
- ["B3C4",0xB0D0],
- ["B3C5",0xB0D1],
- ["B3C6",0xB0D4],
- ["B3C7",0xB0D8],
- ["B3C8",0xB0E0],
- ["B3C9",0xB0E5],
- ["B3CA",0xB108],
- ["B3CB",0xB109],
- ["B3CC",0xB10B],
- ["B3CD",0xB10C],
- ["B3CE",0xB110],
- ["B3CF",0xB112],
- ["B3D0",0xB113],
- ["B3D1",0xB118],
- ["B3D2",0xB119],
- ["B3D3",0xB11B],
- ["B3D4",0xB11C],
- ["B3D5",0xB11D],
- ["B3D6",0xB123],
- ["B3D7",0xB124],
- ["B3D8",0xB125],
- ["B3D9",0xB128],
- ["B3DA",0xB12C],
- ["B3DB",0xB134],
- ["B3DC",0xB135],
- ["B3DD",0xB137],
- ["B3DE",0xB138],
- ["B3DF",0xB139],
- ["B3E0",0xB140],
- ["B3E1",0xB141],
- ["B3E2",0xB144],
- ["B3E3",0xB148],
- ["B3E4",0xB150],
- ["B3E5",0xB151],
- ["B3E6",0xB154],
- ["B3E7",0xB155],
- ["B3E8",0xB158],
- ["B3E9",0xB15C],
- ["B3EA",0xB160],
- ["B3EB",0xB178],
- ["B3EC",0xB179],
- ["B3ED",0xB17C],
- ["B3EE",0xB180],
- ["B3EF",0xB182],
- ["B3F0",0xB188],
- ["B3F1",0xB189],
- ["B3F2",0xB18B],
- ["B3F3",0xB18D],
- ["B3F4",0xB192],
- ["B3F5",0xB193],
- ["B3F6",0xB194],
- ["B3F7",0xB198],
- ["B3F8",0xB19C],
- ["B3F9",0xB1A8],
- ["B3FA",0xB1CC],
- ["B3FB",0xB1D0],
- ["B3FC",0xB1D4],
- ["B3FD",0xB1DC],
- ["B3FE",0xB1DD],
- ["B4A1",0xB1DF],
- ["B4A2",0xB1E8],
- ["B4A3",0xB1E9],
- ["B4A4",0xB1EC],
- ["B4A5",0xB1F0],
- ["B4A6",0xB1F9],
- ["B4A7",0xB1FB],
- ["B4A8",0xB1FD],
- ["B4A9",0xB204],
- ["B4AA",0xB205],
- ["B4AB",0xB208],
- ["B4AC",0xB20B],
- ["B4AD",0xB20C],
- ["B4AE",0xB214],
- ["B4AF",0xB215],
- ["B4B0",0xB217],
- ["B4B1",0xB219],
- ["B4B2",0xB220],
- ["B4B3",0xB234],
- ["B4B4",0xB23C],
- ["B4B5",0xB258],
- ["B4B6",0xB25C],
- ["B4B7",0xB260],
- ["B4B8",0xB268],
- ["B4B9",0xB269],
- ["B4BA",0xB274],
- ["B4BB",0xB275],
- ["B4BC",0xB27C],
- ["B4BD",0xB284],
- ["B4BE",0xB285],
- ["B4BF",0xB289],
- ["B4C0",0xB290],
- ["B4C1",0xB291],
- ["B4C2",0xB294],
- ["B4C3",0xB298],
- ["B4C4",0xB299],
- ["B4C5",0xB29A],
- ["B4C6",0xB2A0],
- ["B4C7",0xB2A1],
- ["B4C8",0xB2A3],
- ["B4C9",0xB2A5],
- ["B4CA",0xB2A6],
- ["B4CB",0xB2AA],
- ["B4CC",0xB2AC],
- ["B4CD",0xB2B0],
- ["B4CE",0xB2B4],
- ["B4CF",0xB2C8],
- ["B4D0",0xB2C9],
- ["B4D1",0xB2CC],
- ["B4D2",0xB2D0],
- ["B4D3",0xB2D2],
- ["B4D4",0xB2D8],
- ["B4D5",0xB2D9],
- ["B4D6",0xB2DB],
- ["B4D7",0xB2DD],
- ["B4D8",0xB2E2],
- ["B4D9",0xB2E4],
- ["B4DA",0xB2E5],
- ["B4DB",0xB2E6],
- ["B4DC",0xB2E8],
- ["B4DD",0xB2EB],
- ["B4DE",0xB2EC],
- ["B4DF",0xB2ED],
- ["B4E0",0xB2EE],
- ["B4E1",0xB2EF],
- ["B4E2",0xB2F3],
- ["B4E3",0xB2F4],
- ["B4E4",0xB2F5],
- ["B4E5",0xB2F7],
- ["B4E6",0xB2F8],
- ["B4E7",0xB2F9],
- ["B4E8",0xB2FA],
- ["B4E9",0xB2FB],
- ["B4EA",0xB2FF],
- ["B4EB",0xB300],
- ["B4EC",0xB301],
- ["B4ED",0xB304],
- ["B4EE",0xB308],
- ["B4EF",0xB310],
- ["B4F0",0xB311],
- ["B4F1",0xB313],
- ["B4F2",0xB314],
- ["B4F3",0xB315],
- ["B4F4",0xB31C],
- ["B4F5",0xB354],
- ["B4F6",0xB355],
- ["B4F7",0xB356],
- ["B4F8",0xB358],
- ["B4F9",0xB35B],
- ["B4FA",0xB35C],
- ["B4FB",0xB35E],
- ["B4FC",0xB35F],
- ["B4FD",0xB364],
- ["B4FE",0xB365],
- ["B5A1",0xB367],
- ["B5A2",0xB369],
- ["B5A3",0xB36B],
- ["B5A4",0xB36E],
- ["B5A5",0xB370],
- ["B5A6",0xB371],
- ["B5A7",0xB374],
- ["B5A8",0xB378],
- ["B5A9",0xB380],
- ["B5AA",0xB381],
- ["B5AB",0xB383],
- ["B5AC",0xB384],
- ["B5AD",0xB385],
- ["B5AE",0xB38C],
- ["B5AF",0xB390],
- ["B5B0",0xB394],
- ["B5B1",0xB3A0],
- ["B5B2",0xB3A1],
- ["B5B3",0xB3A8],
- ["B5B4",0xB3AC],
- ["B5B5",0xB3C4],
- ["B5B6",0xB3C5],
- ["B5B7",0xB3C8],
- ["B5B8",0xB3CB],
- ["B5B9",0xB3CC],
- ["B5BA",0xB3CE],
- ["B5BB",0xB3D0],
- ["B5BC",0xB3D4],
- ["B5BD",0xB3D5],
- ["B5BE",0xB3D7],
- ["B5BF",0xB3D9],
- ["B5C0",0xB3DB],
- ["B5C1",0xB3DD],
- ["B5C2",0xB3E0],
- ["B5C3",0xB3E4],
- ["B5C4",0xB3E8],
- ["B5C5",0xB3FC],
- ["B5C6",0xB410],
- ["B5C7",0xB418],
- ["B5C8",0xB41C],
- ["B5C9",0xB420],
- ["B5CA",0xB428],
- ["B5CB",0xB429],
- ["B5CC",0xB42B],
- ["B5CD",0xB434],
- ["B5CE",0xB450],
- ["B5CF",0xB451],
- ["B5D0",0xB454],
- ["B5D1",0xB458],
- ["B5D2",0xB460],
- ["B5D3",0xB461],
- ["B5D4",0xB463],
- ["B5D5",0xB465],
- ["B5D6",0xB46C],
- ["B5D7",0xB480],
- ["B5D8",0xB488],
- ["B5D9",0xB49D],
- ["B5DA",0xB4A4],
- ["B5DB",0xB4A8],
- ["B5DC",0xB4AC],
- ["B5DD",0xB4B5],
- ["B5DE",0xB4B7],
- ["B5DF",0xB4B9],
- ["B5E0",0xB4C0],
- ["B5E1",0xB4C4],
- ["B5E2",0xB4C8],
- ["B5E3",0xB4D0],
- ["B5E4",0xB4D5],
- ["B5E5",0xB4DC],
- ["B5E6",0xB4DD],
- ["B5E7",0xB4E0],
- ["B5E8",0xB4E3],
- ["B5E9",0xB4E4],
- ["B5EA",0xB4E6],
- ["B5EB",0xB4EC],
- ["B5EC",0xB4ED],
- ["B5ED",0xB4EF],
- ["B5EE",0xB4F1],
- ["B5EF",0xB4F8],
- ["B5F0",0xB514],
- ["B5F1",0xB515],
- ["B5F2",0xB518],
- ["B5F3",0xB51B],
- ["B5F4",0xB51C],
- ["B5F5",0xB524],
- ["B5F6",0xB525],
- ["B5F7",0xB527],
- ["B5F8",0xB528],
- ["B5F9",0xB529],
- ["B5FA",0xB52A],
- ["B5FB",0xB530],
- ["B5FC",0xB531],
- ["B5FD",0xB534],
- ["B5FE",0xB538],
- ["B6A1",0xB540],
- ["B6A2",0xB541],
- ["B6A3",0xB543],
- ["B6A4",0xB544],
- ["B6A5",0xB545],
- ["B6A6",0xB54B],
- ["B6A7",0xB54C],
- ["B6A8",0xB54D],
- ["B6A9",0xB550],
- ["B6AA",0xB554],
- ["B6AB",0xB55C],
- ["B6AC",0xB55D],
- ["B6AD",0xB55F],
- ["B6AE",0xB560],
- ["B6AF",0xB561],
- ["B6B0",0xB5A0],
- ["B6B1",0xB5A1],
- ["B6B2",0xB5A4],
- ["B6B3",0xB5A8],
- ["B6B4",0xB5AA],
- ["B6B5",0xB5AB],
- ["B6B6",0xB5B0],
- ["B6B7",0xB5B1],
- ["B6B8",0xB5B3],
- ["B6B9",0xB5B4],
- ["B6BA",0xB5B5],
- ["B6BB",0xB5BB],
- ["B6BC",0xB5BC],
- ["B6BD",0xB5BD],
- ["B6BE",0xB5C0],
- ["B6BF",0xB5C4],
- ["B6C0",0xB5CC],
- ["B6C1",0xB5CD],
- ["B6C2",0xB5CF],
- ["B6C3",0xB5D0],
- ["B6C4",0xB5D1],
- ["B6C5",0xB5D8],
- ["B6C6",0xB5EC],
- ["B6C7",0xB610],
- ["B6C8",0xB611],
- ["B6C9",0xB614],
- ["B6CA",0xB618],
- ["B6CB",0xB625],
- ["B6CC",0xB62C],
- ["B6CD",0xB634],
- ["B6CE",0xB648],
- ["B6CF",0xB664],
- ["B6D0",0xB668],
- ["B6D1",0xB69C],
- ["B6D2",0xB69D],
- ["B6D3",0xB6A0],
- ["B6D4",0xB6A4],
- ["B6D5",0xB6AB],
- ["B6D6",0xB6AC],
- ["B6D7",0xB6B1],
- ["B6D8",0xB6D4],
- ["B6D9",0xB6F0],
- ["B6DA",0xB6F4],
- ["B6DB",0xB6F8],
- ["B6DC",0xB700],
- ["B6DD",0xB701],
- ["B6DE",0xB705],
- ["B6DF",0xB728],
- ["B6E0",0xB729],
- ["B6E1",0xB72C],
- ["B6E2",0xB72F],
- ["B6E3",0xB730],
- ["B6E4",0xB738],
- ["B6E5",0xB739],
- ["B6E6",0xB73B],
- ["B6E7",0xB744],
- ["B6E8",0xB748],
- ["B6E9",0xB74C],
- ["B6EA",0xB754],
- ["B6EB",0xB755],
- ["B6EC",0xB760],
- ["B6ED",0xB764],
- ["B6EE",0xB768],
- ["B6EF",0xB770],
- ["B6F0",0xB771],
- ["B6F1",0xB773],
- ["B6F2",0xB775],
- ["B6F3",0xB77C],
- ["B6F4",0xB77D],
- ["B6F5",0xB780],
- ["B6F6",0xB784],
- ["B6F7",0xB78C],
- ["B6F8",0xB78D],
- ["B6F9",0xB78F],
- ["B6FA",0xB790],
- ["B6FB",0xB791],
- ["B6FC",0xB792],
- ["B6FD",0xB796],
- ["B6FE",0xB797],
- ["B7A1",0xB798],
- ["B7A2",0xB799],
- ["B7A3",0xB79C],
- ["B7A4",0xB7A0],
- ["B7A5",0xB7A8],
- ["B7A6",0xB7A9],
- ["B7A7",0xB7AB],
- ["B7A8",0xB7AC],
- ["B7A9",0xB7AD],
- ["B7AA",0xB7B4],
- ["B7AB",0xB7B5],
- ["B7AC",0xB7B8],
- ["B7AD",0xB7C7],
- ["B7AE",0xB7C9],
- ["B7AF",0xB7EC],
- ["B7B0",0xB7ED],
- ["B7B1",0xB7F0],
- ["B7B2",0xB7F4],
- ["B7B3",0xB7FC],
- ["B7B4",0xB7FD],
- ["B7B5",0xB7FF],
- ["B7B6",0xB800],
- ["B7B7",0xB801],
- ["B7B8",0xB807],
- ["B7B9",0xB808],
- ["B7BA",0xB809],
- ["B7BB",0xB80C],
- ["B7BC",0xB810],
- ["B7BD",0xB818],
- ["B7BE",0xB819],
- ["B7BF",0xB81B],
- ["B7C0",0xB81D],
- ["B7C1",0xB824],
- ["B7C2",0xB825],
- ["B7C3",0xB828],
- ["B7C4",0xB82C],
- ["B7C5",0xB834],
- ["B7C6",0xB835],
- ["B7C7",0xB837],
- ["B7C8",0xB838],
- ["B7C9",0xB839],
- ["B7CA",0xB840],
- ["B7CB",0xB844],
- ["B7CC",0xB851],
- ["B7CD",0xB853],
- ["B7CE",0xB85C],
- ["B7CF",0xB85D],
- ["B7D0",0xB860],
- ["B7D1",0xB864],
- ["B7D2",0xB86C],
- ["B7D3",0xB86D],
- ["B7D4",0xB86F],
- ["B7D5",0xB871],
- ["B7D6",0xB878],
- ["B7D7",0xB87C],
- ["B7D8",0xB88D],
- ["B7D9",0xB8A8],
- ["B7DA",0xB8B0],
- ["B7DB",0xB8B4],
- ["B7DC",0xB8B8],
- ["B7DD",0xB8C0],
- ["B7DE",0xB8C1],
- ["B7DF",0xB8C3],
- ["B7E0",0xB8C5],
- ["B7E1",0xB8CC],
- ["B7E2",0xB8D0],
- ["B7E3",0xB8D4],
- ["B7E4",0xB8DD],
- ["B7E5",0xB8DF],
- ["B7E6",0xB8E1],
- ["B7E7",0xB8E8],
- ["B7E8",0xB8E9],
- ["B7E9",0xB8EC],
- ["B7EA",0xB8F0],
- ["B7EB",0xB8F8],
- ["B7EC",0xB8F9],
- ["B7ED",0xB8FB],
- ["B7EE",0xB8FD],
- ["B7EF",0xB904],
- ["B7F0",0xB918],
- ["B7F1",0xB920],
- ["B7F2",0xB93C],
- ["B7F3",0xB93D],
- ["B7F4",0xB940],
- ["B7F5",0xB944],
- ["B7F6",0xB94C],
- ["B7F7",0xB94F],
- ["B7F8",0xB951],
- ["B7F9",0xB958],
- ["B7FA",0xB959],
- ["B7FB",0xB95C],
- ["B7FC",0xB960],
- ["B7FD",0xB968],
- ["B7FE",0xB969],
- ["B8A1",0xB96B],
- ["B8A2",0xB96D],
- ["B8A3",0xB974],
- ["B8A4",0xB975],
- ["B8A5",0xB978],
- ["B8A6",0xB97C],
- ["B8A7",0xB984],
- ["B8A8",0xB985],
- ["B8A9",0xB987],
- ["B8AA",0xB989],
- ["B8AB",0xB98A],
- ["B8AC",0xB98D],
- ["B8AD",0xB98E],
- ["B8AE",0xB9AC],
- ["B8AF",0xB9AD],
- ["B8B0",0xB9B0],
- ["B8B1",0xB9B4],
- ["B8B2",0xB9BC],
- ["B8B3",0xB9BD],
- ["B8B4",0xB9BF],
- ["B8B5",0xB9C1],
- ["B8B6",0xB9C8],
- ["B8B7",0xB9C9],
- ["B8B8",0xB9CC],
- ["B8B9",0xB9CE],
- ["B8BA",0xB9CF],
- ["B8BB",0xB9D0],
- ["B8BC",0xB9D1],
- ["B8BD",0xB9D2],
- ["B8BE",0xB9D8],
- ["B8BF",0xB9D9],
- ["B8C0",0xB9DB],
- ["B8C1",0xB9DD],
- ["B8C2",0xB9DE],
- ["B8C3",0xB9E1],
- ["B8C4",0xB9E3],
- ["B8C5",0xB9E4],
- ["B8C6",0xB9E5],
- ["B8C7",0xB9E8],
- ["B8C8",0xB9EC],
- ["B8C9",0xB9F4],
- ["B8CA",0xB9F5],
- ["B8CB",0xB9F7],
- ["B8CC",0xB9F8],
- ["B8CD",0xB9F9],
- ["B8CE",0xB9FA],
- ["B8CF",0xBA00],
- ["B8D0",0xBA01],
- ["B8D1",0xBA08],
- ["B8D2",0xBA15],
- ["B8D3",0xBA38],
- ["B8D4",0xBA39],
- ["B8D5",0xBA3C],
- ["B8D6",0xBA40],
- ["B8D7",0xBA42],
- ["B8D8",0xBA48],
- ["B8D9",0xBA49],
- ["B8DA",0xBA4B],
- ["B8DB",0xBA4D],
- ["B8DC",0xBA4E],
- ["B8DD",0xBA53],
- ["B8DE",0xBA54],
- ["B8DF",0xBA55],
- ["B8E0",0xBA58],
- ["B8E1",0xBA5C],
- ["B8E2",0xBA64],
- ["B8E3",0xBA65],
- ["B8E4",0xBA67],
- ["B8E5",0xBA68],
- ["B8E6",0xBA69],
- ["B8E7",0xBA70],
- ["B8E8",0xBA71],
- ["B8E9",0xBA74],
- ["B8EA",0xBA78],
- ["B8EB",0xBA83],
- ["B8EC",0xBA84],
- ["B8ED",0xBA85],
- ["B8EE",0xBA87],
- ["B8EF",0xBA8C],
- ["B8F0",0xBAA8],
- ["B8F1",0xBAA9],
- ["B8F2",0xBAAB],
- ["B8F3",0xBAAC],
- ["B8F4",0xBAB0],
- ["B8F5",0xBAB2],
- ["B8F6",0xBAB8],
- ["B8F7",0xBAB9],
- ["B8F8",0xBABB],
- ["B8F9",0xBABD],
- ["B8FA",0xBAC4],
- ["B8FB",0xBAC8],
- ["B8FC",0xBAD8],
- ["B8FD",0xBAD9],
- ["B8FE",0xBAFC],
- ["B9A1",0xBB00],
- ["B9A2",0xBB04],
- ["B9A3",0xBB0D],
- ["B9A4",0xBB0F],
- ["B9A5",0xBB11],
- ["B9A6",0xBB18],
- ["B9A7",0xBB1C],
- ["B9A8",0xBB20],
- ["B9A9",0xBB29],
- ["B9AA",0xBB2B],
- ["B9AB",0xBB34],
- ["B9AC",0xBB35],
- ["B9AD",0xBB36],
- ["B9AE",0xBB38],
- ["B9AF",0xBB3B],
- ["B9B0",0xBB3C],
- ["B9B1",0xBB3D],
- ["B9B2",0xBB3E],
- ["B9B3",0xBB44],
- ["B9B4",0xBB45],
- ["B9B5",0xBB47],
- ["B9B6",0xBB49],
- ["B9B7",0xBB4D],
- ["B9B8",0xBB4F],
- ["B9B9",0xBB50],
- ["B9BA",0xBB54],
- ["B9BB",0xBB58],
- ["B9BC",0xBB61],
- ["B9BD",0xBB63],
- ["B9BE",0xBB6C],
- ["B9BF",0xBB88],
- ["B9C0",0xBB8C],
- ["B9C1",0xBB90],
- ["B9C2",0xBBA4],
- ["B9C3",0xBBA8],
- ["B9C4",0xBBAC],
- ["B9C5",0xBBB4],
- ["B9C6",0xBBB7],
- ["B9C7",0xBBC0],
- ["B9C8",0xBBC4],
- ["B9C9",0xBBC8],
- ["B9CA",0xBBD0],
- ["B9CB",0xBBD3],
- ["B9CC",0xBBF8],
- ["B9CD",0xBBF9],
- ["B9CE",0xBBFC],
- ["B9CF",0xBBFF],
- ["B9D0",0xBC00],
- ["B9D1",0xBC02],
- ["B9D2",0xBC08],
- ["B9D3",0xBC09],
- ["B9D4",0xBC0B],
- ["B9D5",0xBC0C],
- ["B9D6",0xBC0D],
- ["B9D7",0xBC0F],
- ["B9D8",0xBC11],
- ["B9D9",0xBC14],
- ["B9DA",0xBC15],
- ["B9DB",0xBC16],
- ["B9DC",0xBC17],
- ["B9DD",0xBC18],
- ["B9DE",0xBC1B],
- ["B9DF",0xBC1C],
- ["B9E0",0xBC1D],
- ["B9E1",0xBC1E],
- ["B9E2",0xBC1F],
- ["B9E3",0xBC24],
- ["B9E4",0xBC25],
- ["B9E5",0xBC27],
- ["B9E6",0xBC29],
- ["B9E7",0xBC2D],
- ["B9E8",0xBC30],
- ["B9E9",0xBC31],
- ["B9EA",0xBC34],
- ["B9EB",0xBC38],
- ["B9EC",0xBC40],
- ["B9ED",0xBC41],
- ["B9EE",0xBC43],
- ["B9EF",0xBC44],
- ["B9F0",0xBC45],
- ["B9F1",0xBC49],
- ["B9F2",0xBC4C],
- ["B9F3",0xBC4D],
- ["B9F4",0xBC50],
- ["B9F5",0xBC5D],
- ["B9F6",0xBC84],
- ["B9F7",0xBC85],
- ["B9F8",0xBC88],
- ["B9F9",0xBC8B],
- ["B9FA",0xBC8C],
- ["B9FB",0xBC8E],
- ["B9FC",0xBC94],
- ["B9FD",0xBC95],
- ["B9FE",0xBC97],
- ["BAA1",0xBC99],
- ["BAA2",0xBC9A],
- ["BAA3",0xBCA0],
- ["BAA4",0xBCA1],
- ["BAA5",0xBCA4],
- ["BAA6",0xBCA7],
- ["BAA7",0xBCA8],
- ["BAA8",0xBCB0],
- ["BAA9",0xBCB1],
- ["BAAA",0xBCB3],
- ["BAAB",0xBCB4],
- ["BAAC",0xBCB5],
- ["BAAD",0xBCBC],
- ["BAAE",0xBCBD],
- ["BAAF",0xBCC0],
- ["BAB0",0xBCC4],
- ["BAB1",0xBCCD],
- ["BAB2",0xBCCF],
- ["BAB3",0xBCD0],
- ["BAB4",0xBCD1],
- ["BAB5",0xBCD5],
- ["BAB6",0xBCD8],
- ["BAB7",0xBCDC],
- ["BAB8",0xBCF4],
- ["BAB9",0xBCF5],
- ["BABA",0xBCF6],
- ["BABB",0xBCF8],
- ["BABC",0xBCFC],
- ["BABD",0xBD04],
- ["BABE",0xBD05],
- ["BABF",0xBD07],
- ["BAC0",0xBD09],
- ["BAC1",0xBD10],
- ["BAC2",0xBD14],
- ["BAC3",0xBD24],
- ["BAC4",0xBD2C],
- ["BAC5",0xBD40],
- ["BAC6",0xBD48],
- ["BAC7",0xBD49],
- ["BAC8",0xBD4C],
- ["BAC9",0xBD50],
- ["BACA",0xBD58],
- ["BACB",0xBD59],
- ["BACC",0xBD64],
- ["BACD",0xBD68],
- ["BACE",0xBD80],
- ["BACF",0xBD81],
- ["BAD0",0xBD84],
- ["BAD1",0xBD87],
- ["BAD2",0xBD88],
- ["BAD3",0xBD89],
- ["BAD4",0xBD8A],
- ["BAD5",0xBD90],
- ["BAD6",0xBD91],
- ["BAD7",0xBD93],
- ["BAD8",0xBD95],
- ["BAD9",0xBD99],
- ["BADA",0xBD9A],
- ["BADB",0xBD9C],
- ["BADC",0xBDA4],
- ["BADD",0xBDB0],
- ["BADE",0xBDB8],
- ["BADF",0xBDD4],
- ["BAE0",0xBDD5],
- ["BAE1",0xBDD8],
- ["BAE2",0xBDDC],
- ["BAE3",0xBDE9],
- ["BAE4",0xBDF0],
- ["BAE5",0xBDF4],
- ["BAE6",0xBDF8],
- ["BAE7",0xBE00],
- ["BAE8",0xBE03],
- ["BAE9",0xBE05],
- ["BAEA",0xBE0C],
- ["BAEB",0xBE0D],
- ["BAEC",0xBE10],
- ["BAED",0xBE14],
- ["BAEE",0xBE1C],
- ["BAEF",0xBE1D],
- ["BAF0",0xBE1F],
- ["BAF1",0xBE44],
- ["BAF2",0xBE45],
- ["BAF3",0xBE48],
- ["BAF4",0xBE4C],
- ["BAF5",0xBE4E],
- ["BAF6",0xBE54],
- ["BAF7",0xBE55],
- ["BAF8",0xBE57],
- ["BAF9",0xBE59],
- ["BAFA",0xBE5A],
- ["BAFB",0xBE5B],
- ["BAFC",0xBE60],
- ["BAFD",0xBE61],
- ["BAFE",0xBE64],
- ["BBA1",0xBE68],
- ["BBA2",0xBE6A],
- ["BBA3",0xBE70],
- ["BBA4",0xBE71],
- ["BBA5",0xBE73],
- ["BBA6",0xBE74],
- ["BBA7",0xBE75],
- ["BBA8",0xBE7B],
- ["BBA9",0xBE7C],
- ["BBAA",0xBE7D],
- ["BBAB",0xBE80],
- ["BBAC",0xBE84],
- ["BBAD",0xBE8C],
- ["BBAE",0xBE8D],
- ["BBAF",0xBE8F],
- ["BBB0",0xBE90],
- ["BBB1",0xBE91],
- ["BBB2",0xBE98],
- ["BBB3",0xBE99],
- ["BBB4",0xBEA8],
- ["BBB5",0xBED0],
- ["BBB6",0xBED1],
- ["BBB7",0xBED4],
- ["BBB8",0xBED7],
- ["BBB9",0xBED8],
- ["BBBA",0xBEE0],
- ["BBBB",0xBEE3],
- ["BBBC",0xBEE4],
- ["BBBD",0xBEE5],
- ["BBBE",0xBEEC],
- ["BBBF",0xBF01],
- ["BBC0",0xBF08],
- ["BBC1",0xBF09],
- ["BBC2",0xBF18],
- ["BBC3",0xBF19],
- ["BBC4",0xBF1B],
- ["BBC5",0xBF1C],
- ["BBC6",0xBF1D],
- ["BBC7",0xBF40],
- ["BBC8",0xBF41],
- ["BBC9",0xBF44],
- ["BBCA",0xBF48],
- ["BBCB",0xBF50],
- ["BBCC",0xBF51],
- ["BBCD",0xBF55],
- ["BBCE",0xBF94],
- ["BBCF",0xBFB0],
- ["BBD0",0xBFC5],
- ["BBD1",0xBFCC],
- ["BBD2",0xBFCD],
- ["BBD3",0xBFD0],
- ["BBD4",0xBFD4],
- ["BBD5",0xBFDC],
- ["BBD6",0xBFDF],
- ["BBD7",0xBFE1],
- ["BBD8",0xC03C],
- ["BBD9",0xC051],
- ["BBDA",0xC058],
- ["BBDB",0xC05C],
- ["BBDC",0xC060],
- ["BBDD",0xC068],
- ["BBDE",0xC069],
- ["BBDF",0xC090],
- ["BBE0",0xC091],
- ["BBE1",0xC094],
- ["BBE2",0xC098],
- ["BBE3",0xC0A0],
- ["BBE4",0xC0A1],
- ["BBE5",0xC0A3],
- ["BBE6",0xC0A5],
- ["BBE7",0xC0AC],
- ["BBE8",0xC0AD],
- ["BBE9",0xC0AF],
- ["BBEA",0xC0B0],
- ["BBEB",0xC0B3],
- ["BBEC",0xC0B4],
- ["BBED",0xC0B5],
- ["BBEE",0xC0B6],
- ["BBEF",0xC0BC],
- ["BBF0",0xC0BD],
- ["BBF1",0xC0BF],
- ["BBF2",0xC0C0],
- ["BBF3",0xC0C1],
- ["BBF4",0xC0C5],
- ["BBF5",0xC0C8],
- ["BBF6",0xC0C9],
- ["BBF7",0xC0CC],
- ["BBF8",0xC0D0],
- ["BBF9",0xC0D8],
- ["BBFA",0xC0D9],
- ["BBFB",0xC0DB],
- ["BBFC",0xC0DC],
- ["BBFD",0xC0DD],
- ["BBFE",0xC0E4],
- ["BCA1",0xC0E5],
- ["BCA2",0xC0E8],
- ["BCA3",0xC0EC],
- ["BCA4",0xC0F4],
- ["BCA5",0xC0F5],
- ["BCA6",0xC0F7],
- ["BCA7",0xC0F9],
- ["BCA8",0xC100],
- ["BCA9",0xC104],
- ["BCAA",0xC108],
- ["BCAB",0xC110],
- ["BCAC",0xC115],
- ["BCAD",0xC11C],
- ["BCAE",0xC11D],
- ["BCAF",0xC11E],
- ["BCB0",0xC11F],
- ["BCB1",0xC120],
- ["BCB2",0xC123],
- ["BCB3",0xC124],
- ["BCB4",0xC126],
- ["BCB5",0xC127],
- ["BCB6",0xC12C],
- ["BCB7",0xC12D],
- ["BCB8",0xC12F],
- ["BCB9",0xC130],
- ["BCBA",0xC131],
- ["BCBB",0xC136],
- ["BCBC",0xC138],
- ["BCBD",0xC139],
- ["BCBE",0xC13C],
- ["BCBF",0xC140],
- ["BCC0",0xC148],
- ["BCC1",0xC149],
- ["BCC2",0xC14B],
- ["BCC3",0xC14C],
- ["BCC4",0xC14D],
- ["BCC5",0xC154],
- ["BCC6",0xC155],
- ["BCC7",0xC158],
- ["BCC8",0xC15C],
- ["BCC9",0xC164],
- ["BCCA",0xC165],
- ["BCCB",0xC167],
- ["BCCC",0xC168],
- ["BCCD",0xC169],
- ["BCCE",0xC170],
- ["BCCF",0xC174],
- ["BCD0",0xC178],
- ["BCD1",0xC185],
- ["BCD2",0xC18C],
- ["BCD3",0xC18D],
- ["BCD4",0xC18E],
- ["BCD5",0xC190],
- ["BCD6",0xC194],
- ["BCD7",0xC196],
- ["BCD8",0xC19C],
- ["BCD9",0xC19D],
- ["BCDA",0xC19F],
- ["BCDB",0xC1A1],
- ["BCDC",0xC1A5],
- ["BCDD",0xC1A8],
- ["BCDE",0xC1A9],
- ["BCDF",0xC1AC],
- ["BCE0",0xC1B0],
- ["BCE1",0xC1BD],
- ["BCE2",0xC1C4],
- ["BCE3",0xC1C8],
- ["BCE4",0xC1CC],
- ["BCE5",0xC1D4],
- ["BCE6",0xC1D7],
- ["BCE7",0xC1D8],
- ["BCE8",0xC1E0],
- ["BCE9",0xC1E4],
- ["BCEA",0xC1E8],
- ["BCEB",0xC1F0],
- ["BCEC",0xC1F1],
- ["BCED",0xC1F3],
- ["BCEE",0xC1FC],
- ["BCEF",0xC1FD],
- ["BCF0",0xC200],
- ["BCF1",0xC204],
- ["BCF2",0xC20C],
- ["BCF3",0xC20D],
- ["BCF4",0xC20F],
- ["BCF5",0xC211],
- ["BCF6",0xC218],
- ["BCF7",0xC219],
- ["BCF8",0xC21C],
- ["BCF9",0xC21F],
- ["BCFA",0xC220],
- ["BCFB",0xC228],
- ["BCFC",0xC229],
- ["BCFD",0xC22B],
- ["BCFE",0xC22D],
- ["BDA1",0xC22F],
- ["BDA2",0xC231],
- ["BDA3",0xC232],
- ["BDA4",0xC234],
- ["BDA5",0xC248],
- ["BDA6",0xC250],
- ["BDA7",0xC251],
- ["BDA8",0xC254],
- ["BDA9",0xC258],
- ["BDAA",0xC260],
- ["BDAB",0xC265],
- ["BDAC",0xC26C],
- ["BDAD",0xC26D],
- ["BDAE",0xC270],
- ["BDAF",0xC274],
- ["BDB0",0xC27C],
- ["BDB1",0xC27D],
- ["BDB2",0xC27F],
- ["BDB3",0xC281],
- ["BDB4",0xC288],
- ["BDB5",0xC289],
- ["BDB6",0xC290],
- ["BDB7",0xC298],
- ["BDB8",0xC29B],
- ["BDB9",0xC29D],
- ["BDBA",0xC2A4],
- ["BDBB",0xC2A5],
- ["BDBC",0xC2A8],
- ["BDBD",0xC2AC],
- ["BDBE",0xC2AD],
- ["BDBF",0xC2B4],
- ["BDC0",0xC2B5],
- ["BDC1",0xC2B7],
- ["BDC2",0xC2B9],
- ["BDC3",0xC2DC],
- ["BDC4",0xC2DD],
- ["BDC5",0xC2E0],
- ["BDC6",0xC2E3],
- ["BDC7",0xC2E4],
- ["BDC8",0xC2EB],
- ["BDC9",0xC2EC],
- ["BDCA",0xC2ED],
- ["BDCB",0xC2EF],
- ["BDCC",0xC2F1],
- ["BDCD",0xC2F6],
- ["BDCE",0xC2F8],
- ["BDCF",0xC2F9],
- ["BDD0",0xC2FB],
- ["BDD1",0xC2FC],
- ["BDD2",0xC300],
- ["BDD3",0xC308],
- ["BDD4",0xC309],
- ["BDD5",0xC30C],
- ["BDD6",0xC30D],
- ["BDD7",0xC313],
- ["BDD8",0xC314],
- ["BDD9",0xC315],
- ["BDDA",0xC318],
- ["BDDB",0xC31C],
- ["BDDC",0xC324],
- ["BDDD",0xC325],
- ["BDDE",0xC328],
- ["BDDF",0xC329],
- ["BDE0",0xC345],
- ["BDE1",0xC368],
- ["BDE2",0xC369],
- ["BDE3",0xC36C],
- ["BDE4",0xC370],
- ["BDE5",0xC372],
- ["BDE6",0xC378],
- ["BDE7",0xC379],
- ["BDE8",0xC37C],
- ["BDE9",0xC37D],
- ["BDEA",0xC384],
- ["BDEB",0xC388],
- ["BDEC",0xC38C],
- ["BDED",0xC3C0],
- ["BDEE",0xC3D8],
- ["BDEF",0xC3D9],
- ["BDF0",0xC3DC],
- ["BDF1",0xC3DF],
- ["BDF2",0xC3E0],
- ["BDF3",0xC3E2],
- ["BDF4",0xC3E8],
- ["BDF5",0xC3E9],
- ["BDF6",0xC3ED],
- ["BDF7",0xC3F4],
- ["BDF8",0xC3F5],
- ["BDF9",0xC3F8],
- ["BDFA",0xC408],
- ["BDFB",0xC410],
- ["BDFC",0xC424],
- ["BDFD",0xC42C],
- ["BDFE",0xC430],
- ["BEA1",0xC434],
- ["BEA2",0xC43C],
- ["BEA3",0xC43D],
- ["BEA4",0xC448],
- ["BEA5",0xC464],
- ["BEA6",0xC465],
- ["BEA7",0xC468],
- ["BEA8",0xC46C],
- ["BEA9",0xC474],
- ["BEAA",0xC475],
- ["BEAB",0xC479],
- ["BEAC",0xC480],
- ["BEAD",0xC494],
- ["BEAE",0xC49C],
- ["BEAF",0xC4B8],
- ["BEB0",0xC4BC],
- ["BEB1",0xC4E9],
- ["BEB2",0xC4F0],
- ["BEB3",0xC4F1],
- ["BEB4",0xC4F4],
- ["BEB5",0xC4F8],
- ["BEB6",0xC4FA],
- ["BEB7",0xC4FF],
- ["BEB8",0xC500],
- ["BEB9",0xC501],
- ["BEBA",0xC50C],
- ["BEBB",0xC510],
- ["BEBC",0xC514],
- ["BEBD",0xC51C],
- ["BEBE",0xC528],
- ["BEBF",0xC529],
- ["BEC0",0xC52C],
- ["BEC1",0xC530],
- ["BEC2",0xC538],
- ["BEC3",0xC539],
- ["BEC4",0xC53B],
- ["BEC5",0xC53D],
- ["BEC6",0xC544],
- ["BEC7",0xC545],
- ["BEC8",0xC548],
- ["BEC9",0xC549],
- ["BECA",0xC54A],
- ["BECB",0xC54C],
- ["BECC",0xC54D],
- ["BECD",0xC54E],
- ["BECE",0xC553],
- ["BECF",0xC554],
- ["BED0",0xC555],
- ["BED1",0xC557],
- ["BED2",0xC558],
- ["BED3",0xC559],
- ["BED4",0xC55D],
- ["BED5",0xC55E],
- ["BED6",0xC560],
- ["BED7",0xC561],
- ["BED8",0xC564],
- ["BED9",0xC568],
- ["BEDA",0xC570],
- ["BEDB",0xC571],
- ["BEDC",0xC573],
- ["BEDD",0xC574],
- ["BEDE",0xC575],
- ["BEDF",0xC57C],
- ["BEE0",0xC57D],
- ["BEE1",0xC580],
- ["BEE2",0xC584],
- ["BEE3",0xC587],
- ["BEE4",0xC58C],
- ["BEE5",0xC58D],
- ["BEE6",0xC58F],
- ["BEE7",0xC591],
- ["BEE8",0xC595],
- ["BEE9",0xC597],
- ["BEEA",0xC598],
- ["BEEB",0xC59C],
- ["BEEC",0xC5A0],
- ["BEED",0xC5A9],
- ["BEEE",0xC5B4],
- ["BEEF",0xC5B5],
- ["BEF0",0xC5B8],
- ["BEF1",0xC5B9],
- ["BEF2",0xC5BB],
- ["BEF3",0xC5BC],
- ["BEF4",0xC5BD],
- ["BEF5",0xC5BE],
- ["BEF6",0xC5C4],
- ["BEF7",0xC5C5],
- ["BEF8",0xC5C6],
- ["BEF9",0xC5C7],
- ["BEFA",0xC5C8],
- ["BEFB",0xC5C9],
- ["BEFC",0xC5CA],
- ["BEFD",0xC5CC],
- ["BEFE",0xC5CE],
- ["BFA1",0xC5D0],
- ["BFA2",0xC5D1],
- ["BFA3",0xC5D4],
- ["BFA4",0xC5D8],
- ["BFA5",0xC5E0],
- ["BFA6",0xC5E1],
- ["BFA7",0xC5E3],
- ["BFA8",0xC5E5],
- ["BFA9",0xC5EC],
- ["BFAA",0xC5ED],
- ["BFAB",0xC5EE],
- ["BFAC",0xC5F0],
- ["BFAD",0xC5F4],
- ["BFAE",0xC5F6],
- ["BFAF",0xC5F7],
- ["BFB0",0xC5FC],
- ["BFB1",0xC5FD],
- ["BFB2",0xC5FE],
- ["BFB3",0xC5FF],
- ["BFB4",0xC600],
- ["BFB5",0xC601],
- ["BFB6",0xC605],
- ["BFB7",0xC606],
- ["BFB8",0xC607],
- ["BFB9",0xC608],
- ["BFBA",0xC60C],
- ["BFBB",0xC610],
- ["BFBC",0xC618],
- ["BFBD",0xC619],
- ["BFBE",0xC61B],
- ["BFBF",0xC61C],
- ["BFC0",0xC624],
- ["BFC1",0xC625],
- ["BFC2",0xC628],
- ["BFC3",0xC62C],
- ["BFC4",0xC62D],
- ["BFC5",0xC62E],
- ["BFC6",0xC630],
- ["BFC7",0xC633],
- ["BFC8",0xC634],
- ["BFC9",0xC635],
- ["BFCA",0xC637],
- ["BFCB",0xC639],
- ["BFCC",0xC63B],
- ["BFCD",0xC640],
- ["BFCE",0xC641],
- ["BFCF",0xC644],
- ["BFD0",0xC648],
- ["BFD1",0xC650],
- ["BFD2",0xC651],
- ["BFD3",0xC653],
- ["BFD4",0xC654],
- ["BFD5",0xC655],
- ["BFD6",0xC65C],
- ["BFD7",0xC65D],
- ["BFD8",0xC660],
- ["BFD9",0xC66C],
- ["BFDA",0xC66F],
- ["BFDB",0xC671],
- ["BFDC",0xC678],
- ["BFDD",0xC679],
- ["BFDE",0xC67C],
- ["BFDF",0xC680],
- ["BFE0",0xC688],
- ["BFE1",0xC689],
- ["BFE2",0xC68B],
- ["BFE3",0xC68D],
- ["BFE4",0xC694],
- ["BFE5",0xC695],
- ["BFE6",0xC698],
- ["BFE7",0xC69C],
- ["BFE8",0xC6A4],
- ["BFE9",0xC6A5],
- ["BFEA",0xC6A7],
- ["BFEB",0xC6A9],
- ["BFEC",0xC6B0],
- ["BFED",0xC6B1],
- ["BFEE",0xC6B4],
- ["BFEF",0xC6B8],
- ["BFF0",0xC6B9],
- ["BFF1",0xC6BA],
- ["BFF2",0xC6C0],
- ["BFF3",0xC6C1],
- ["BFF4",0xC6C3],
- ["BFF5",0xC6C5],
- ["BFF6",0xC6CC],
- ["BFF7",0xC6CD],
- ["BFF8",0xC6D0],
- ["BFF9",0xC6D4],
- ["BFFA",0xC6DC],
- ["BFFB",0xC6DD],
- ["BFFC",0xC6E0],
- ["BFFD",0xC6E1],
- ["BFFE",0xC6E8],
- ["C0A1",0xC6E9],
- ["C0A2",0xC6EC],
- ["C0A3",0xC6F0],
- ["C0A4",0xC6F8],
- ["C0A5",0xC6F9],
- ["C0A6",0xC6FD],
- ["C0A7",0xC704],
- ["C0A8",0xC705],
- ["C0A9",0xC708],
- ["C0AA",0xC70C],
- ["C0AB",0xC714],
- ["C0AC",0xC715],
- ["C0AD",0xC717],
- ["C0AE",0xC719],
- ["C0AF",0xC720],
- ["C0B0",0xC721],
- ["C0B1",0xC724],
- ["C0B2",0xC728],
- ["C0B3",0xC730],
- ["C0B4",0xC731],
- ["C0B5",0xC733],
- ["C0B6",0xC735],
- ["C0B7",0xC737],
- ["C0B8",0xC73C],
- ["C0B9",0xC73D],
- ["C0BA",0xC740],
- ["C0BB",0xC744],
- ["C0BC",0xC74A],
- ["C0BD",0xC74C],
- ["C0BE",0xC74D],
- ["C0BF",0xC74F],
- ["C0C0",0xC751],
- ["C0C1",0xC752],
- ["C0C2",0xC753],
- ["C0C3",0xC754],
- ["C0C4",0xC755],
- ["C0C5",0xC756],
- ["C0C6",0xC757],
- ["C0C7",0xC758],
- ["C0C8",0xC75C],
- ["C0C9",0xC760],
- ["C0CA",0xC768],
- ["C0CB",0xC76B],
- ["C0CC",0xC774],
- ["C0CD",0xC775],
- ["C0CE",0xC778],
- ["C0CF",0xC77C],
- ["C0D0",0xC77D],
- ["C0D1",0xC77E],
- ["C0D2",0xC783],
- ["C0D3",0xC784],
- ["C0D4",0xC785],
- ["C0D5",0xC787],
- ["C0D6",0xC788],
- ["C0D7",0xC789],
- ["C0D8",0xC78A],
- ["C0D9",0xC78E],
- ["C0DA",0xC790],
- ["C0DB",0xC791],
- ["C0DC",0xC794],
- ["C0DD",0xC796],
- ["C0DE",0xC797],
- ["C0DF",0xC798],
- ["C0E0",0xC79A],
- ["C0E1",0xC7A0],
- ["C0E2",0xC7A1],
- ["C0E3",0xC7A3],
- ["C0E4",0xC7A4],
- ["C0E5",0xC7A5],
- ["C0E6",0xC7A6],
- ["C0E7",0xC7AC],
- ["C0E8",0xC7AD],
- ["C0E9",0xC7B0],
- ["C0EA",0xC7B4],
- ["C0EB",0xC7BC],
- ["C0EC",0xC7BD],
- ["C0ED",0xC7BF],
- ["C0EE",0xC7C0],
- ["C0EF",0xC7C1],
- ["C0F0",0xC7C8],
- ["C0F1",0xC7C9],
- ["C0F2",0xC7CC],
- ["C0F3",0xC7CE],
- ["C0F4",0xC7D0],
- ["C0F5",0xC7D8],
- ["C0F6",0xC7DD],
- ["C0F7",0xC7E4],
- ["C0F8",0xC7E8],
- ["C0F9",0xC7EC],
- ["C0FA",0xC800],
- ["C0FB",0xC801],
- ["C0FC",0xC804],
- ["C0FD",0xC808],
- ["C0FE",0xC80A],
- ["C1A1",0xC810],
- ["C1A2",0xC811],
- ["C1A3",0xC813],
- ["C1A4",0xC815],
- ["C1A5",0xC816],
- ["C1A6",0xC81C],
- ["C1A7",0xC81D],
- ["C1A8",0xC820],
- ["C1A9",0xC824],
- ["C1AA",0xC82C],
- ["C1AB",0xC82D],
- ["C1AC",0xC82F],
- ["C1AD",0xC831],
- ["C1AE",0xC838],
- ["C1AF",0xC83C],
- ["C1B0",0xC840],
- ["C1B1",0xC848],
- ["C1B2",0xC849],
- ["C1B3",0xC84C],
- ["C1B4",0xC84D],
- ["C1B5",0xC854],
- ["C1B6",0xC870],
- ["C1B7",0xC871],
- ["C1B8",0xC874],
- ["C1B9",0xC878],
- ["C1BA",0xC87A],
- ["C1BB",0xC880],
- ["C1BC",0xC881],
- ["C1BD",0xC883],
- ["C1BE",0xC885],
- ["C1BF",0xC886],
- ["C1C0",0xC887],
- ["C1C1",0xC88B],
- ["C1C2",0xC88C],
- ["C1C3",0xC88D],
- ["C1C4",0xC894],
- ["C1C5",0xC89D],
- ["C1C6",0xC89F],
- ["C1C7",0xC8A1],
- ["C1C8",0xC8A8],
- ["C1C9",0xC8BC],
- ["C1CA",0xC8BD],
- ["C1CB",0xC8C4],
- ["C1CC",0xC8C8],
- ["C1CD",0xC8CC],
- ["C1CE",0xC8D4],
- ["C1CF",0xC8D5],
- ["C1D0",0xC8D7],
- ["C1D1",0xC8D9],
- ["C1D2",0xC8E0],
- ["C1D3",0xC8E1],
- ["C1D4",0xC8E4],
- ["C1D5",0xC8F5],
- ["C1D6",0xC8FC],
- ["C1D7",0xC8FD],
- ["C1D8",0xC900],
- ["C1D9",0xC904],
- ["C1DA",0xC905],
- ["C1DB",0xC906],
- ["C1DC",0xC90C],
- ["C1DD",0xC90D],
- ["C1DE",0xC90F],
- ["C1DF",0xC911],
- ["C1E0",0xC918],
- ["C1E1",0xC92C],
- ["C1E2",0xC934],
- ["C1E3",0xC950],
- ["C1E4",0xC951],
- ["C1E5",0xC954],
- ["C1E6",0xC958],
- ["C1E7",0xC960],
- ["C1E8",0xC961],
- ["C1E9",0xC963],
- ["C1EA",0xC96C],
- ["C1EB",0xC970],
- ["C1EC",0xC974],
- ["C1ED",0xC97C],
- ["C1EE",0xC988],
- ["C1EF",0xC989],
- ["C1F0",0xC98C],
- ["C1F1",0xC990],
- ["C1F2",0xC998],
- ["C1F3",0xC999],
- ["C1F4",0xC99B],
- ["C1F5",0xC99D],
- ["C1F6",0xC9C0],
- ["C1F7",0xC9C1],
- ["C1F8",0xC9C4],
- ["C1F9",0xC9C7],
- ["C1FA",0xC9C8],
- ["C1FB",0xC9CA],
- ["C1FC",0xC9D0],
- ["C1FD",0xC9D1],
- ["C1FE",0xC9D3],
- ["C2A1",0xC9D5],
- ["C2A2",0xC9D6],
- ["C2A3",0xC9D9],
- ["C2A4",0xC9DA],
- ["C2A5",0xC9DC],
- ["C2A6",0xC9DD],
- ["C2A7",0xC9E0],
- ["C2A8",0xC9E2],
- ["C2A9",0xC9E4],
- ["C2AA",0xC9E7],
- ["C2AB",0xC9EC],
- ["C2AC",0xC9ED],
- ["C2AD",0xC9EF],
- ["C2AE",0xC9F0],
- ["C2AF",0xC9F1],
- ["C2B0",0xC9F8],
- ["C2B1",0xC9F9],
- ["C2B2",0xC9FC],
- ["C2B3",0xCA00],
- ["C2B4",0xCA08],
- ["C2B5",0xCA09],
- ["C2B6",0xCA0B],
- ["C2B7",0xCA0C],
- ["C2B8",0xCA0D],
- ["C2B9",0xCA14],
- ["C2BA",0xCA18],
- ["C2BB",0xCA29],
- ["C2BC",0xCA4C],
- ["C2BD",0xCA4D],
- ["C2BE",0xCA50],
- ["C2BF",0xCA54],
- ["C2C0",0xCA5C],
- ["C2C1",0xCA5D],
- ["C2C2",0xCA5F],
- ["C2C3",0xCA60],
- ["C2C4",0xCA61],
- ["C2C5",0xCA68],
- ["C2C6",0xCA7D],
- ["C2C7",0xCA84],
- ["C2C8",0xCA98],
- ["C2C9",0xCABC],
- ["C2CA",0xCABD],
- ["C2CB",0xCAC0],
- ["C2CC",0xCAC4],
- ["C2CD",0xCACC],
- ["C2CE",0xCACD],
- ["C2CF",0xCACF],
- ["C2D0",0xCAD1],
- ["C2D1",0xCAD3],
- ["C2D2",0xCAD8],
- ["C2D3",0xCAD9],
- ["C2D4",0xCAE0],
- ["C2D5",0xCAEC],
- ["C2D6",0xCAF4],
- ["C2D7",0xCB08],
- ["C2D8",0xCB10],
- ["C2D9",0xCB14],
- ["C2DA",0xCB18],
- ["C2DB",0xCB20],
- ["C2DC",0xCB21],
- ["C2DD",0xCB41],
- ["C2DE",0xCB48],
- ["C2DF",0xCB49],
- ["C2E0",0xCB4C],
- ["C2E1",0xCB50],
- ["C2E2",0xCB58],
- ["C2E3",0xCB59],
- ["C2E4",0xCB5D],
- ["C2E5",0xCB64],
- ["C2E6",0xCB78],
- ["C2E7",0xCB79],
- ["C2E8",0xCB9C],
- ["C2E9",0xCBB8],
- ["C2EA",0xCBD4],
- ["C2EB",0xCBE4],
- ["C2EC",0xCBE7],
- ["C2ED",0xCBE9],
- ["C2EE",0xCC0C],
- ["C2EF",0xCC0D],
- ["C2F0",0xCC10],
- ["C2F1",0xCC14],
- ["C2F2",0xCC1C],
- ["C2F3",0xCC1D],
- ["C2F4",0xCC21],
- ["C2F5",0xCC22],
- ["C2F6",0xCC27],
- ["C2F7",0xCC28],
- ["C2F8",0xCC29],
- ["C2F9",0xCC2C],
- ["C2FA",0xCC2E],
- ["C2FB",0xCC30],
- ["C2FC",0xCC38],
- ["C2FD",0xCC39],
- ["C2FE",0xCC3B],
- ["C3A1",0xCC3C],
- ["C3A2",0xCC3D],
- ["C3A3",0xCC3E],
- ["C3A4",0xCC44],
- ["C3A5",0xCC45],
- ["C3A6",0xCC48],
- ["C3A7",0xCC4C],
- ["C3A8",0xCC54],
- ["C3A9",0xCC55],
- ["C3AA",0xCC57],
- ["C3AB",0xCC58],
- ["C3AC",0xCC59],
- ["C3AD",0xCC60],
- ["C3AE",0xCC64],
- ["C3AF",0xCC66],
- ["C3B0",0xCC68],
- ["C3B1",0xCC70],
- ["C3B2",0xCC75],
- ["C3B3",0xCC98],
- ["C3B4",0xCC99],
- ["C3B5",0xCC9C],
- ["C3B6",0xCCA0],
- ["C3B7",0xCCA8],
- ["C3B8",0xCCA9],
- ["C3B9",0xCCAB],
- ["C3BA",0xCCAC],
- ["C3BB",0xCCAD],
- ["C3BC",0xCCB4],
- ["C3BD",0xCCB5],
- ["C3BE",0xCCB8],
- ["C3BF",0xCCBC],
- ["C3C0",0xCCC4],
- ["C3C1",0xCCC5],
- ["C3C2",0xCCC7],
- ["C3C3",0xCCC9],
- ["C3C4",0xCCD0],
- ["C3C5",0xCCD4],
- ["C3C6",0xCCE4],
- ["C3C7",0xCCEC],
- ["C3C8",0xCCF0],
- ["C3C9",0xCD01],
- ["C3CA",0xCD08],
- ["C3CB",0xCD09],
- ["C3CC",0xCD0C],
- ["C3CD",0xCD10],
- ["C3CE",0xCD18],
- ["C3CF",0xCD19],
- ["C3D0",0xCD1B],
- ["C3D1",0xCD1D],
- ["C3D2",0xCD24],
- ["C3D3",0xCD28],
- ["C3D4",0xCD2C],
- ["C3D5",0xCD39],
- ["C3D6",0xCD5C],
- ["C3D7",0xCD60],
- ["C3D8",0xCD64],
- ["C3D9",0xCD6C],
- ["C3DA",0xCD6D],
- ["C3DB",0xCD6F],
- ["C3DC",0xCD71],
- ["C3DD",0xCD78],
- ["C3DE",0xCD88],
- ["C3DF",0xCD94],
- ["C3E0",0xCD95],
- ["C3E1",0xCD98],
- ["C3E2",0xCD9C],
- ["C3E3",0xCDA4],
- ["C3E4",0xCDA5],
- ["C3E5",0xCDA7],
- ["C3E6",0xCDA9],
- ["C3E7",0xCDB0],
- ["C3E8",0xCDC4],
- ["C3E9",0xCDCC],
- ["C3EA",0xCDD0],
- ["C3EB",0xCDE8],
- ["C3EC",0xCDEC],
- ["C3ED",0xCDF0],
- ["C3EE",0xCDF8],
- ["C3EF",0xCDF9],
- ["C3F0",0xCDFB],
- ["C3F1",0xCDFD],
- ["C3F2",0xCE04],
- ["C3F3",0xCE08],
- ["C3F4",0xCE0C],
- ["C3F5",0xCE14],
- ["C3F6",0xCE19],
- ["C3F7",0xCE20],
- ["C3F8",0xCE21],
- ["C3F9",0xCE24],
- ["C3FA",0xCE28],
- ["C3FB",0xCE30],
- ["C3FC",0xCE31],
- ["C3FD",0xCE33],
- ["C3FE",0xCE35],
- ["C4A1",0xCE58],
- ["C4A2",0xCE59],
- ["C4A3",0xCE5C],
- ["C4A4",0xCE5F],
- ["C4A5",0xCE60],
- ["C4A6",0xCE61],
- ["C4A7",0xCE68],
- ["C4A8",0xCE69],
- ["C4A9",0xCE6B],
- ["C4AA",0xCE6D],
- ["C4AB",0xCE74],
- ["C4AC",0xCE75],
- ["C4AD",0xCE78],
- ["C4AE",0xCE7C],
- ["C4AF",0xCE84],
- ["C4B0",0xCE85],
- ["C4B1",0xCE87],
- ["C4B2",0xCE89],
- ["C4B3",0xCE90],
- ["C4B4",0xCE91],
- ["C4B5",0xCE94],
- ["C4B6",0xCE98],
- ["C4B7",0xCEA0],
- ["C4B8",0xCEA1],
- ["C4B9",0xCEA3],
- ["C4BA",0xCEA4],
- ["C4BB",0xCEA5],
- ["C4BC",0xCEAC],
- ["C4BD",0xCEAD],
- ["C4BE",0xCEC1],
- ["C4BF",0xCEE4],
- ["C4C0",0xCEE5],
- ["C4C1",0xCEE8],
- ["C4C2",0xCEEB],
- ["C4C3",0xCEEC],
- ["C4C4",0xCEF4],
- ["C4C5",0xCEF5],
- ["C4C6",0xCEF7],
- ["C4C7",0xCEF8],
- ["C4C8",0xCEF9],
- ["C4C9",0xCF00],
- ["C4CA",0xCF01],
- ["C4CB",0xCF04],
- ["C4CC",0xCF08],
- ["C4CD",0xCF10],
- ["C4CE",0xCF11],
- ["C4CF",0xCF13],
- ["C4D0",0xCF15],
- ["C4D1",0xCF1C],
- ["C4D2",0xCF20],
- ["C4D3",0xCF24],
- ["C4D4",0xCF2C],
- ["C4D5",0xCF2D],
- ["C4D6",0xCF2F],
- ["C4D7",0xCF30],
- ["C4D8",0xCF31],
- ["C4D9",0xCF38],
- ["C4DA",0xCF54],
- ["C4DB",0xCF55],
- ["C4DC",0xCF58],
- ["C4DD",0xCF5C],
- ["C4DE",0xCF64],
- ["C4DF",0xCF65],
- ["C4E0",0xCF67],
- ["C4E1",0xCF69],
- ["C4E2",0xCF70],
- ["C4E3",0xCF71],
- ["C4E4",0xCF74],
- ["C4E5",0xCF78],
- ["C4E6",0xCF80],
- ["C4E7",0xCF85],
- ["C4E8",0xCF8C],
- ["C4E9",0xCFA1],
- ["C4EA",0xCFA8],
- ["C4EB",0xCFB0],
- ["C4EC",0xCFC4],
- ["C4ED",0xCFE0],
- ["C4EE",0xCFE1],
- ["C4EF",0xCFE4],
- ["C4F0",0xCFE8],
- ["C4F1",0xCFF0],
- ["C4F2",0xCFF1],
- ["C4F3",0xCFF3],
- ["C4F4",0xCFF5],
- ["C4F5",0xCFFC],
- ["C4F6",0xD000],
- ["C4F7",0xD004],
- ["C4F8",0xD011],
- ["C4F9",0xD018],
- ["C4FA",0xD02D],
- ["C4FB",0xD034],
- ["C4FC",0xD035],
- ["C4FD",0xD038],
- ["C4FE",0xD03C],
- ["C5A1",0xD044],
- ["C5A2",0xD045],
- ["C5A3",0xD047],
- ["C5A4",0xD049],
- ["C5A5",0xD050],
- ["C5A6",0xD054],
- ["C5A7",0xD058],
- ["C5A8",0xD060],
- ["C5A9",0xD06C],
- ["C5AA",0xD06D],
- ["C5AB",0xD070],
- ["C5AC",0xD074],
- ["C5AD",0xD07C],
- ["C5AE",0xD07D],
- ["C5AF",0xD081],
- ["C5B0",0xD0A4],
- ["C5B1",0xD0A5],
- ["C5B2",0xD0A8],
- ["C5B3",0xD0AC],
- ["C5B4",0xD0B4],
- ["C5B5",0xD0B5],
- ["C5B6",0xD0B7],
- ["C5B7",0xD0B9],
- ["C5B8",0xD0C0],
- ["C5B9",0xD0C1],
- ["C5BA",0xD0C4],
- ["C5BB",0xD0C8],
- ["C5BC",0xD0C9],
- ["C5BD",0xD0D0],
- ["C5BE",0xD0D1],
- ["C5BF",0xD0D3],
- ["C5C0",0xD0D4],
- ["C5C1",0xD0D5],
- ["C5C2",0xD0DC],
- ["C5C3",0xD0DD],
- ["C5C4",0xD0E0],
- ["C5C5",0xD0E4],
- ["C5C6",0xD0EC],
- ["C5C7",0xD0ED],
- ["C5C8",0xD0EF],
- ["C5C9",0xD0F0],
- ["C5CA",0xD0F1],
- ["C5CB",0xD0F8],
- ["C5CC",0xD10D],
- ["C5CD",0xD130],
- ["C5CE",0xD131],
- ["C5CF",0xD134],
- ["C5D0",0xD138],
- ["C5D1",0xD13A],
- ["C5D2",0xD140],
- ["C5D3",0xD141],
- ["C5D4",0xD143],
- ["C5D5",0xD144],
- ["C5D6",0xD145],
- ["C5D7",0xD14C],
- ["C5D8",0xD14D],
- ["C5D9",0xD150],
- ["C5DA",0xD154],
- ["C5DB",0xD15C],
- ["C5DC",0xD15D],
- ["C5DD",0xD15F],
- ["C5DE",0xD161],
- ["C5DF",0xD168],
- ["C5E0",0xD16C],
- ["C5E1",0xD17C],
- ["C5E2",0xD184],
- ["C5E3",0xD188],
- ["C5E4",0xD1A0],
- ["C5E5",0xD1A1],
- ["C5E6",0xD1A4],
- ["C5E7",0xD1A8],
- ["C5E8",0xD1B0],
- ["C5E9",0xD1B1],
- ["C5EA",0xD1B3],
- ["C5EB",0xD1B5],
- ["C5EC",0xD1BA],
- ["C5ED",0xD1BC],
- ["C5EE",0xD1C0],
- ["C5EF",0xD1D8],
- ["C5F0",0xD1F4],
- ["C5F1",0xD1F8],
- ["C5F2",0xD207],
- ["C5F3",0xD209],
- ["C5F4",0xD210],
- ["C5F5",0xD22C],
- ["C5F6",0xD22D],
- ["C5F7",0xD230],
- ["C5F8",0xD234],
- ["C5F9",0xD23C],
- ["C5FA",0xD23D],
- ["C5FB",0xD23F],
- ["C5FC",0xD241],
- ["C5FD",0xD248],
- ["C5FE",0xD25C],
- ["C6A1",0xD264],
- ["C6A2",0xD280],
- ["C6A3",0xD281],
- ["C6A4",0xD284],
- ["C6A5",0xD288],
- ["C6A6",0xD290],
- ["C6A7",0xD291],
- ["C6A8",0xD295],
- ["C6A9",0xD29C],
- ["C6AA",0xD2A0],
- ["C6AB",0xD2A4],
- ["C6AC",0xD2AC],
- ["C6AD",0xD2B1],
- ["C6AE",0xD2B8],
- ["C6AF",0xD2B9],
- ["C6B0",0xD2BC],
- ["C6B1",0xD2BF],
- ["C6B2",0xD2C0],
- ["C6B3",0xD2C2],
- ["C6B4",0xD2C8],
- ["C6B5",0xD2C9],
- ["C6B6",0xD2CB],
- ["C6B7",0xD2D4],
- ["C6B8",0xD2D8],
- ["C6B9",0xD2DC],
- ["C6BA",0xD2E4],
- ["C6BB",0xD2E5],
- ["C6BC",0xD2F0],
- ["C6BD",0xD2F1],
- ["C6BE",0xD2F4],
- ["C6BF",0xD2F8],
- ["C6C0",0xD300],
- ["C6C1",0xD301],
- ["C6C2",0xD303],
- ["C6C3",0xD305],
- ["C6C4",0xD30C],
- ["C6C5",0xD30D],
- ["C6C6",0xD30E],
- ["C6C7",0xD310],
- ["C6C8",0xD314],
- ["C6C9",0xD316],
- ["C6CA",0xD31C],
- ["C6CB",0xD31D],
- ["C6CC",0xD31F],
- ["C6CD",0xD320],
- ["C6CE",0xD321],
- ["C6CF",0xD325],
- ["C6D0",0xD328],
- ["C6D1",0xD329],
- ["C6D2",0xD32C],
- ["C6D3",0xD330],
- ["C6D4",0xD338],
- ["C6D5",0xD339],
- ["C6D6",0xD33B],
- ["C6D7",0xD33C],
- ["C6D8",0xD33D],
- ["C6D9",0xD344],
- ["C6DA",0xD345],
- ["C6DB",0xD37C],
- ["C6DC",0xD37D],
- ["C6DD",0xD380],
- ["C6DE",0xD384],
- ["C6DF",0xD38C],
- ["C6E0",0xD38D],
- ["C6E1",0xD38F],
- ["C6E2",0xD390],
- ["C6E3",0xD391],
- ["C6E4",0xD398],
- ["C6E5",0xD399],
- ["C6E6",0xD39C],
- ["C6E7",0xD3A0],
- ["C6E8",0xD3A8],
- ["C6E9",0xD3A9],
- ["C6EA",0xD3AB],
- ["C6EB",0xD3AD],
- ["C6EC",0xD3B4],
- ["C6ED",0xD3B8],
- ["C6EE",0xD3BC],
- ["C6EF",0xD3C4],
- ["C6F0",0xD3C5],
- ["C6F1",0xD3C8],
- ["C6F2",0xD3C9],
- ["C6F3",0xD3D0],
- ["C6F4",0xD3D8],
- ["C6F5",0xD3E1],
- ["C6F6",0xD3E3],
- ["C6F7",0xD3EC],
- ["C6F8",0xD3ED],
- ["C6F9",0xD3F0],
- ["C6FA",0xD3F4],
- ["C6FB",0xD3FC],
- ["C6FC",0xD3FD],
- ["C6FD",0xD3FF],
- ["C6FE",0xD401],
- ["C7A1",0xD408],
- ["C7A2",0xD41D],
- ["C7A3",0xD440],
- ["C7A4",0xD444],
- ["C7A5",0xD45C],
- ["C7A6",0xD460],
- ["C7A7",0xD464],
- ["C7A8",0xD46D],
- ["C7A9",0xD46F],
- ["C7AA",0xD478],
- ["C7AB",0xD479],
- ["C7AC",0xD47C],
- ["C7AD",0xD47F],
- ["C7AE",0xD480],
- ["C7AF",0xD482],
- ["C7B0",0xD488],
- ["C7B1",0xD489],
- ["C7B2",0xD48B],
- ["C7B3",0xD48D],
- ["C7B4",0xD494],
- ["C7B5",0xD4A9],
- ["C7B6",0xD4CC],
- ["C7B7",0xD4D0],
- ["C7B8",0xD4D4],
- ["C7B9",0xD4DC],
- ["C7BA",0xD4DF],
- ["C7BB",0xD4E8],
- ["C7BC",0xD4EC],
- ["C7BD",0xD4F0],
- ["C7BE",0xD4F8],
- ["C7BF",0xD4FB],
- ["C7C0",0xD4FD],
- ["C7C1",0xD504],
- ["C7C2",0xD508],
- ["C7C3",0xD50C],
- ["C7C4",0xD514],
- ["C7C5",0xD515],
- ["C7C6",0xD517],
- ["C7C7",0xD53C],
- ["C7C8",0xD53D],
- ["C7C9",0xD540],
- ["C7CA",0xD544],
- ["C7CB",0xD54C],
- ["C7CC",0xD54D],
- ["C7CD",0xD54F],
- ["C7CE",0xD551],
- ["C7CF",0xD558],
- ["C7D0",0xD559],
- ["C7D1",0xD55C],
- ["C7D2",0xD560],
- ["C7D3",0xD565],
- ["C7D4",0xD568],
- ["C7D5",0xD569],
- ["C7D6",0xD56B],
- ["C7D7",0xD56D],
- ["C7D8",0xD574],
- ["C7D9",0xD575],
- ["C7DA",0xD578],
- ["C7DB",0xD57C],
- ["C7DC",0xD584],
- ["C7DD",0xD585],
- ["C7DE",0xD587],
- ["C7DF",0xD588],
- ["C7E0",0xD589],
- ["C7E1",0xD590],
- ["C7E2",0xD5A5],
- ["C7E3",0xD5C8],
- ["C7E4",0xD5C9],
- ["C7E5",0xD5CC],
- ["C7E6",0xD5D0],
- ["C7E7",0xD5D2],
- ["C7E8",0xD5D8],
- ["C7E9",0xD5D9],
- ["C7EA",0xD5DB],
- ["C7EB",0xD5DD],
- ["C7EC",0xD5E4],
- ["C7ED",0xD5E5],
- ["C7EE",0xD5E8],
- ["C7EF",0xD5EC],
- ["C7F0",0xD5F4],
- ["C7F1",0xD5F5],
- ["C7F2",0xD5F7],
- ["C7F3",0xD5F9],
- ["C7F4",0xD600],
- ["C7F5",0xD601],
- ["C7F6",0xD604],
- ["C7F7",0xD608],
- ["C7F8",0xD610],
- ["C7F9",0xD611],
- ["C7FA",0xD613],
- ["C7FB",0xD614],
- ["C7FC",0xD615],
- ["C7FD",0xD61C],
- ["C7FE",0xD620],
- ["C8A1",0xD624],
- ["C8A2",0xD62D],
- ["C8A3",0xD638],
- ["C8A4",0xD639],
- ["C8A5",0xD63C],
- ["C8A6",0xD640],
- ["C8A7",0xD645],
- ["C8A8",0xD648],
- ["C8A9",0xD649],
- ["C8AA",0xD64B],
- ["C8AB",0xD64D],
- ["C8AC",0xD651],
- ["C8AD",0xD654],
- ["C8AE",0xD655],
- ["C8AF",0xD658],
- ["C8B0",0xD65C],
- ["C8B1",0xD667],
- ["C8B2",0xD669],
- ["C8B3",0xD670],
- ["C8B4",0xD671],
- ["C8B5",0xD674],
- ["C8B6",0xD683],
- ["C8B7",0xD685],
- ["C8B8",0xD68C],
- ["C8B9",0xD68D],
- ["C8BA",0xD690],
- ["C8BB",0xD694],
- ["C8BC",0xD69D],
- ["C8BD",0xD69F],
- ["C8BE",0xD6A1],
- ["C8BF",0xD6A8],
- ["C8C0",0xD6AC],
- ["C8C1",0xD6B0],
- ["C8C2",0xD6B9],
- ["C8C3",0xD6BB],
- ["C8C4",0xD6C4],
- ["C8C5",0xD6C5],
- ["C8C6",0xD6C8],
- ["C8C7",0xD6CC],
- ["C8C8",0xD6D1],
- ["C8C9",0xD6D4],
- ["C8CA",0xD6D7],
- ["C8CB",0xD6D9],
- ["C8CC",0xD6E0],
- ["C8CD",0xD6E4],
- ["C8CE",0xD6E8],
- ["C8CF",0xD6F0],
- ["C8D0",0xD6F5],
- ["C8D1",0xD6FC],
- ["C8D2",0xD6FD],
- ["C8D3",0xD700],
- ["C8D4",0xD704],
- ["C8D5",0xD711],
- ["C8D6",0xD718],
- ["C8D7",0xD719],
- ["C8D8",0xD71C],
- ["C8D9",0xD720],
- ["C8DA",0xD728],
- ["C8DB",0xD729],
- ["C8DC",0xD72B],
- ["C8DD",0xD72D],
- ["C8DE",0xD734],
- ["C8DF",0xD735],
- ["C8E0",0xD738],
- ["C8E1",0xD73C],
- ["C8E2",0xD744],
- ["C8E3",0xD747],
- ["C8E4",0xD749],
- ["C8E5",0xD750],
- ["C8E6",0xD751],
- ["C8E7",0xD754],
- ["C8E8",0xD756],
- ["C8E9",0xD757],
- ["C8EA",0xD758],
- ["C8EB",0xD759],
- ["C8EC",0xD760],
- ["C8ED",0xD761],
- ["C8EE",0xD763],
- ["C8EF",0xD765],
- ["C8F0",0xD769],
- ["C8F1",0xD76C],
- ["C8F2",0xD770],
- ["C8F3",0xD774],
- ["C8F4",0xD77C],
- ["C8F5",0xD77D],
- ["C8F6",0xD781],
- ["C8F7",0xD788],
- ["C8F8",0xD789],
- ["C8F9",0xD78C],
- ["C8FA",0xD790],
- ["C8FB",0xD798],
- ["C8FC",0xD799],
- ["C8FD",0xD79B],
- ["C8FE",0xD79D],
- ["CAA1",0x4F3D],
- ["CAA2",0x4F73],
- ["CAA3",0x5047],
- ["CAA4",0x50F9],
- ["CAA5",0x52A0],
- ["CAA6",0x53EF],
- ["CAA7",0x5475],
- ["CAA8",0x54E5],
- ["CAA9",0x5609],
- ["CAAA",0x5AC1],
- ["CAAB",0x5BB6],
- ["CAAC",0x6687],
- ["CAAD",0x67B6],
- ["CAAE",0x67B7],
- ["CAAF",0x67EF],
- ["CAB0",0x6B4C],
- ["CAB1",0x73C2],
- ["CAB2",0x75C2],
- ["CAB3",0x7A3C],
- ["CAB4",0x82DB],
- ["CAB5",0x8304],
- ["CAB6",0x8857],
- ["CAB7",0x8888],
- ["CAB8",0x8A36],
- ["CAB9",0x8CC8],
- ["CABA",0x8DCF],
- ["CABB",0x8EFB],
- ["CABC",0x8FE6],
- ["CABD",0x99D5],
- ["CABE",0x523B],
- ["CABF",0x5374],
- ["CAC0",0x5404],
- ["CAC1",0x606A],
- ["CAC2",0x6164],
- ["CAC3",0x6BBC],
- ["CAC4",0x73CF],
- ["CAC5",0x811A],
- ["CAC6",0x89BA],
- ["CAC7",0x89D2],
- ["CAC8",0x95A3],
- ["CAC9",0x4F83],
- ["CACA",0x520A],
- ["CACB",0x58BE],
- ["CACC",0x5978],
- ["CACD",0x59E6],
- ["CACE",0x5E72],
- ["CACF",0x5E79],
- ["CAD0",0x61C7],
- ["CAD1",0x63C0],
- ["CAD2",0x6746],
- ["CAD3",0x67EC],
- ["CAD4",0x687F],
- ["CAD5",0x6F97],
- ["CAD6",0x764E],
- ["CAD7",0x770B],
- ["CAD8",0x78F5],
- ["CAD9",0x7A08],
- ["CADA",0x7AFF],
- ["CADB",0x7C21],
- ["CADC",0x809D],
- ["CADD",0x826E],
- ["CADE",0x8271],
- ["CADF",0x8AEB],
- ["CAE0",0x9593],
- ["CAE1",0x4E6B],
- ["CAE2",0x559D],
- ["CAE3",0x66F7],
- ["CAE4",0x6E34],
- ["CAE5",0x78A3],
- ["CAE6",0x7AED],
- ["CAE7",0x845B],
- ["CAE8",0x8910],
- ["CAE9",0x874E],
- ["CAEA",0x97A8],
- ["CAEB",0x52D8],
- ["CAEC",0x574E],
- ["CAED",0x582A],
- ["CAEE",0x5D4C],
- ["CAEF",0x611F],
- ["CAF0",0x61BE],
- ["CAF1",0x6221],
- ["CAF2",0x6562],
- ["CAF3",0x67D1],
- ["CAF4",0x6A44],
- ["CAF5",0x6E1B],
- ["CAF6",0x7518],
- ["CAF7",0x75B3],
- ["CAF8",0x76E3],
- ["CAF9",0x77B0],
- ["CAFA",0x7D3A],
- ["CAFB",0x90AF],
- ["CAFC",0x9451],
- ["CAFD",0x9452],
- ["CAFE",0x9F95],
- ["CBA1",0x5323],
- ["CBA2",0x5CAC],
- ["CBA3",0x7532],
- ["CBA4",0x80DB],
- ["CBA5",0x9240],
- ["CBA6",0x9598],
- ["CBA7",0x525B],
- ["CBA8",0x5808],
- ["CBA9",0x59DC],
- ["CBAA",0x5CA1],
- ["CBAB",0x5D17],
- ["CBAC",0x5EB7],
- ["CBAD",0x5F3A],
- ["CBAE",0x5F4A],
- ["CBAF",0x6177],
- ["CBB0",0x6C5F],
- ["CBB1",0x757A],
- ["CBB2",0x7586],
- ["CBB3",0x7CE0],
- ["CBB4",0x7D73],
- ["CBB5",0x7DB1],
- ["CBB6",0x7F8C],
- ["CBB7",0x8154],
- ["CBB8",0x8221],
- ["CBB9",0x8591],
- ["CBBA",0x8941],
- ["CBBB",0x8B1B],
- ["CBBC",0x92FC],
- ["CBBD",0x964D],
- ["CBBE",0x9C47],
- ["CBBF",0x4ECB],
- ["CBC0",0x4EF7],
- ["CBC1",0x500B],
- ["CBC2",0x51F1],
- ["CBC3",0x584F],
- ["CBC4",0x6137],
- ["CBC5",0x613E],
- ["CBC6",0x6168],
- ["CBC7",0x6539],
- ["CBC8",0x69EA],
- ["CBC9",0x6F11],
- ["CBCA",0x75A5],
- ["CBCB",0x7686],
- ["CBCC",0x76D6],
- ["CBCD",0x7B87],
- ["CBCE",0x82A5],
- ["CBCF",0x84CB],
- ["CBD0",0xF900],
- ["CBD1",0x93A7],
- ["CBD2",0x958B],
- ["CBD3",0x5580],
- ["CBD4",0x5BA2],
- ["CBD5",0x5751],
- ["CBD6",0xF901],
- ["CBD7",0x7CB3],
- ["CBD8",0x7FB9],
- ["CBD9",0x91B5],
- ["CBDA",0x5028],
- ["CBDB",0x53BB],
- ["CBDC",0x5C45],
- ["CBDD",0x5DE8],
- ["CBDE",0x62D2],
- ["CBDF",0x636E],
- ["CBE0",0x64DA],
- ["CBE1",0x64E7],
- ["CBE2",0x6E20],
- ["CBE3",0x70AC],
- ["CBE4",0x795B],
- ["CBE5",0x8DDD],
- ["CBE6",0x8E1E],
- ["CBE7",0xF902],
- ["CBE8",0x907D],
- ["CBE9",0x9245],
- ["CBEA",0x92F8],
- ["CBEB",0x4E7E],
- ["CBEC",0x4EF6],
- ["CBED",0x5065],
- ["CBEE",0x5DFE],
- ["CBEF",0x5EFA],
- ["CBF0",0x6106],
- ["CBF1",0x6957],
- ["CBF2",0x8171],
- ["CBF3",0x8654],
- ["CBF4",0x8E47],
- ["CBF5",0x9375],
- ["CBF6",0x9A2B],
- ["CBF7",0x4E5E],
- ["CBF8",0x5091],
- ["CBF9",0x6770],
- ["CBFA",0x6840],
- ["CBFB",0x5109],
- ["CBFC",0x528D],
- ["CBFD",0x5292],
- ["CBFE",0x6AA2],
- ["CCA1",0x77BC],
- ["CCA2",0x9210],
- ["CCA3",0x9ED4],
- ["CCA4",0x52AB],
- ["CCA5",0x602F],
- ["CCA6",0x8FF2],
- ["CCA7",0x5048],
- ["CCA8",0x61A9],
- ["CCA9",0x63ED],
- ["CCAA",0x64CA],
- ["CCAB",0x683C],
- ["CCAC",0x6A84],
- ["CCAD",0x6FC0],
- ["CCAE",0x8188],
- ["CCAF",0x89A1],
- ["CCB0",0x9694],
- ["CCB1",0x5805],
- ["CCB2",0x727D],
- ["CCB3",0x72AC],
- ["CCB4",0x7504],
- ["CCB5",0x7D79],
- ["CCB6",0x7E6D],
- ["CCB7",0x80A9],
- ["CCB8",0x898B],
- ["CCB9",0x8B74],
- ["CCBA",0x9063],
- ["CCBB",0x9D51],
- ["CCBC",0x6289],
- ["CCBD",0x6C7A],
- ["CCBE",0x6F54],
- ["CCBF",0x7D50],
- ["CCC0",0x7F3A],
- ["CCC1",0x8A23],
- ["CCC2",0x517C],
- ["CCC3",0x614A],
- ["CCC4",0x7B9D],
- ["CCC5",0x8B19],
- ["CCC6",0x9257],
- ["CCC7",0x938C],
- ["CCC8",0x4EAC],
- ["CCC9",0x4FD3],
- ["CCCA",0x501E],
- ["CCCB",0x50BE],
- ["CCCC",0x5106],
- ["CCCD",0x52C1],
- ["CCCE",0x52CD],
- ["CCCF",0x537F],
- ["CCD0",0x5770],
- ["CCD1",0x5883],
- ["CCD2",0x5E9A],
- ["CCD3",0x5F91],
- ["CCD4",0x6176],
- ["CCD5",0x61AC],
- ["CCD6",0x64CE],
- ["CCD7",0x656C],
- ["CCD8",0x666F],
- ["CCD9",0x66BB],
- ["CCDA",0x66F4],
- ["CCDB",0x6897],
- ["CCDC",0x6D87],
- ["CCDD",0x7085],
- ["CCDE",0x70F1],
- ["CCDF",0x749F],
- ["CCE0",0x74A5],
- ["CCE1",0x74CA],
- ["CCE2",0x75D9],
- ["CCE3",0x786C],
- ["CCE4",0x78EC],
- ["CCE5",0x7ADF],
- ["CCE6",0x7AF6],
- ["CCE7",0x7D45],
- ["CCE8",0x7D93],
- ["CCE9",0x8015],
- ["CCEA",0x803F],
- ["CCEB",0x811B],
- ["CCEC",0x8396],
- ["CCED",0x8B66],
- ["CCEE",0x8F15],
- ["CCEF",0x9015],
- ["CCF0",0x93E1],
- ["CCF1",0x9803],
- ["CCF2",0x9838],
- ["CCF3",0x9A5A],
- ["CCF4",0x9BE8],
- ["CCF5",0x4FC2],
- ["CCF6",0x5553],
- ["CCF7",0x583A],
- ["CCF8",0x5951],
- ["CCF9",0x5B63],
- ["CCFA",0x5C46],
- ["CCFB",0x60B8],
- ["CCFC",0x6212],
- ["CCFD",0x6842],
- ["CCFE",0x68B0],
- ["CDA1",0x68E8],
- ["CDA2",0x6EAA],
- ["CDA3",0x754C],
- ["CDA4",0x7678],
- ["CDA5",0x78CE],
- ["CDA6",0x7A3D],
- ["CDA7",0x7CFB],
- ["CDA8",0x7E6B],
- ["CDA9",0x7E7C],
- ["CDAA",0x8A08],
- ["CDAB",0x8AA1],
- ["CDAC",0x8C3F],
- ["CDAD",0x968E],
- ["CDAE",0x9DC4],
- ["CDAF",0x53E4],
- ["CDB0",0x53E9],
- ["CDB1",0x544A],
- ["CDB2",0x5471],
- ["CDB3",0x56FA],
- ["CDB4",0x59D1],
- ["CDB5",0x5B64],
- ["CDB6",0x5C3B],
- ["CDB7",0x5EAB],
- ["CDB8",0x62F7],
- ["CDB9",0x6537],
- ["CDBA",0x6545],
- ["CDBB",0x6572],
- ["CDBC",0x66A0],
- ["CDBD",0x67AF],
- ["CDBE",0x69C1],
- ["CDBF",0x6CBD],
- ["CDC0",0x75FC],
- ["CDC1",0x7690],
- ["CDC2",0x777E],
- ["CDC3",0x7A3F],
- ["CDC4",0x7F94],
- ["CDC5",0x8003],
- ["CDC6",0x80A1],
- ["CDC7",0x818F],
- ["CDC8",0x82E6],
- ["CDC9",0x82FD],
- ["CDCA",0x83F0],
- ["CDCB",0x85C1],
- ["CDCC",0x8831],
- ["CDCD",0x88B4],
- ["CDCE",0x8AA5],
- ["CDCF",0xF903],
- ["CDD0",0x8F9C],
- ["CDD1",0x932E],
- ["CDD2",0x96C7],
- ["CDD3",0x9867],
- ["CDD4",0x9AD8],
- ["CDD5",0x9F13],
- ["CDD6",0x54ED],
- ["CDD7",0x659B],
- ["CDD8",0x66F2],
- ["CDD9",0x688F],
- ["CDDA",0x7A40],
- ["CDDB",0x8C37],
- ["CDDC",0x9D60],
- ["CDDD",0x56F0],
- ["CDDE",0x5764],
- ["CDDF",0x5D11],
- ["CDE0",0x6606],
- ["CDE1",0x68B1],
- ["CDE2",0x68CD],
- ["CDE3",0x6EFE],
- ["CDE4",0x7428],
- ["CDE5",0x889E],
- ["CDE6",0x9BE4],
- ["CDE7",0x6C68],
- ["CDE8",0xF904],
- ["CDE9",0x9AA8],
- ["CDEA",0x4F9B],
- ["CDEB",0x516C],
- ["CDEC",0x5171],
- ["CDED",0x529F],
- ["CDEE",0x5B54],
- ["CDEF",0x5DE5],
- ["CDF0",0x6050],
- ["CDF1",0x606D],
- ["CDF2",0x62F1],
- ["CDF3",0x63A7],
- ["CDF4",0x653B],
- ["CDF5",0x73D9],
- ["CDF6",0x7A7A],
- ["CDF7",0x86A3],
- ["CDF8",0x8CA2],
- ["CDF9",0x978F],
- ["CDFA",0x4E32],
- ["CDFB",0x5BE1],
- ["CDFC",0x6208],
- ["CDFD",0x679C],
- ["CDFE",0x74DC],
- ["CEA1",0x79D1],
- ["CEA2",0x83D3],
- ["CEA3",0x8A87],
- ["CEA4",0x8AB2],
- ["CEA5",0x8DE8],
- ["CEA6",0x904E],
- ["CEA7",0x934B],
- ["CEA8",0x9846],
- ["CEA9",0x5ED3],
- ["CEAA",0x69E8],
- ["CEAB",0x85FF],
- ["CEAC",0x90ED],
- ["CEAD",0xF905],
- ["CEAE",0x51A0],
- ["CEAF",0x5B98],
- ["CEB0",0x5BEC],
- ["CEB1",0x6163],
- ["CEB2",0x68FA],
- ["CEB3",0x6B3E],
- ["CEB4",0x704C],
- ["CEB5",0x742F],
- ["CEB6",0x74D8],
- ["CEB7",0x7BA1],
- ["CEB8",0x7F50],
- ["CEB9",0x83C5],
- ["CEBA",0x89C0],
- ["CEBB",0x8CAB],
- ["CEBC",0x95DC],
- ["CEBD",0x9928],
- ["CEBE",0x522E],
- ["CEBF",0x605D],
- ["CEC0",0x62EC],
- ["CEC1",0x9002],
- ["CEC2",0x4F8A],
- ["CEC3",0x5149],
- ["CEC4",0x5321],
- ["CEC5",0x58D9],
- ["CEC6",0x5EE3],
- ["CEC7",0x66E0],
- ["CEC8",0x6D38],
- ["CEC9",0x709A],
- ["CECA",0x72C2],
- ["CECB",0x73D6],
- ["CECC",0x7B50],
- ["CECD",0x80F1],
- ["CECE",0x945B],
- ["CECF",0x5366],
- ["CED0",0x639B],
- ["CED1",0x7F6B],
- ["CED2",0x4E56],
- ["CED3",0x5080],
- ["CED4",0x584A],
- ["CED5",0x58DE],
- ["CED6",0x602A],
- ["CED7",0x6127],
- ["CED8",0x62D0],
- ["CED9",0x69D0],
- ["CEDA",0x9B41],
- ["CEDB",0x5B8F],
- ["CEDC",0x7D18],
- ["CEDD",0x80B1],
- ["CEDE",0x8F5F],
- ["CEDF",0x4EA4],
- ["CEE0",0x50D1],
- ["CEE1",0x54AC],
- ["CEE2",0x55AC],
- ["CEE3",0x5B0C],
- ["CEE4",0x5DA0],
- ["CEE5",0x5DE7],
- ["CEE6",0x652A],
- ["CEE7",0x654E],
- ["CEE8",0x6821],
- ["CEE9",0x6A4B],
- ["CEEA",0x72E1],
- ["CEEB",0x768E],
- ["CEEC",0x77EF],
- ["CEED",0x7D5E],
- ["CEEE",0x7FF9],
- ["CEEF",0x81A0],
- ["CEF0",0x854E],
- ["CEF1",0x86DF],
- ["CEF2",0x8F03],
- ["CEF3",0x8F4E],
- ["CEF4",0x90CA],
- ["CEF5",0x9903],
- ["CEF6",0x9A55],
- ["CEF7",0x9BAB],
- ["CEF8",0x4E18],
- ["CEF9",0x4E45],
- ["CEFA",0x4E5D],
- ["CEFB",0x4EC7],
- ["CEFC",0x4FF1],
- ["CEFD",0x5177],
- ["CEFE",0x52FE],
- ["CFA1",0x5340],
- ["CFA2",0x53E3],
- ["CFA3",0x53E5],
- ["CFA4",0x548E],
- ["CFA5",0x5614],
- ["CFA6",0x5775],
- ["CFA7",0x57A2],
- ["CFA8",0x5BC7],
- ["CFA9",0x5D87],
- ["CFAA",0x5ED0],
- ["CFAB",0x61FC],
- ["CFAC",0x62D8],
- ["CFAD",0x6551],
- ["CFAE",0x67B8],
- ["CFAF",0x67E9],
- ["CFB0",0x69CB],
- ["CFB1",0x6B50],
- ["CFB2",0x6BC6],
- ["CFB3",0x6BEC],
- ["CFB4",0x6C42],
- ["CFB5",0x6E9D],
- ["CFB6",0x7078],
- ["CFB7",0x72D7],
- ["CFB8",0x7396],
- ["CFB9",0x7403],
- ["CFBA",0x77BF],
- ["CFBB",0x77E9],
- ["CFBC",0x7A76],
- ["CFBD",0x7D7F],
- ["CFBE",0x8009],
- ["CFBF",0x81FC],
- ["CFC0",0x8205],
- ["CFC1",0x820A],
- ["CFC2",0x82DF],
- ["CFC3",0x8862],
- ["CFC4",0x8B33],
- ["CFC5",0x8CFC],
- ["CFC6",0x8EC0],
- ["CFC7",0x9011],
- ["CFC8",0x90B1],
- ["CFC9",0x9264],
- ["CFCA",0x92B6],
- ["CFCB",0x99D2],
- ["CFCC",0x9A45],
- ["CFCD",0x9CE9],
- ["CFCE",0x9DD7],
- ["CFCF",0x9F9C],
- ["CFD0",0x570B],
- ["CFD1",0x5C40],
- ["CFD2",0x83CA],
- ["CFD3",0x97A0],
- ["CFD4",0x97AB],
- ["CFD5",0x9EB4],
- ["CFD6",0x541B],
- ["CFD7",0x7A98],
- ["CFD8",0x7FA4],
- ["CFD9",0x88D9],
- ["CFDA",0x8ECD],
- ["CFDB",0x90E1],
- ["CFDC",0x5800],
- ["CFDD",0x5C48],
- ["CFDE",0x6398],
- ["CFDF",0x7A9F],
- ["CFE0",0x5BAE],
- ["CFE1",0x5F13],
- ["CFE2",0x7A79],
- ["CFE3",0x7AAE],
- ["CFE4",0x828E],
- ["CFE5",0x8EAC],
- ["CFE6",0x5026],
- ["CFE7",0x5238],
- ["CFE8",0x52F8],
- ["CFE9",0x5377],
- ["CFEA",0x5708],
- ["CFEB",0x62F3],
- ["CFEC",0x6372],
- ["CFED",0x6B0A],
- ["CFEE",0x6DC3],
- ["CFEF",0x7737],
- ["CFF0",0x53A5],
- ["CFF1",0x7357],
- ["CFF2",0x8568],
- ["CFF3",0x8E76],
- ["CFF4",0x95D5],
- ["CFF5",0x673A],
- ["CFF6",0x6AC3],
- ["CFF7",0x6F70],
- ["CFF8",0x8A6D],
- ["CFF9",0x8ECC],
- ["CFFA",0x994B],
- ["CFFB",0xF906],
- ["CFFC",0x6677],
- ["CFFD",0x6B78],
- ["CFFE",0x8CB4],
- ["D0A1",0x9B3C],
- ["D0A2",0xF907],
- ["D0A3",0x53EB],
- ["D0A4",0x572D],
- ["D0A5",0x594E],
- ["D0A6",0x63C6],
- ["D0A7",0x69FB],
- ["D0A8",0x73EA],
- ["D0A9",0x7845],
- ["D0AA",0x7ABA],
- ["D0AB",0x7AC5],
- ["D0AC",0x7CFE],
- ["D0AD",0x8475],
- ["D0AE",0x898F],
- ["D0AF",0x8D73],
- ["D0B0",0x9035],
- ["D0B1",0x95A8],
- ["D0B2",0x52FB],
- ["D0B3",0x5747],
- ["D0B4",0x7547],
- ["D0B5",0x7B60],
- ["D0B6",0x83CC],
- ["D0B7",0x921E],
- ["D0B8",0xF908],
- ["D0B9",0x6A58],
- ["D0BA",0x514B],
- ["D0BB",0x524B],
- ["D0BC",0x5287],
- ["D0BD",0x621F],
- ["D0BE",0x68D8],
- ["D0BF",0x6975],
- ["D0C0",0x9699],
- ["D0C1",0x50C5],
- ["D0C2",0x52A4],
- ["D0C3",0x52E4],
- ["D0C4",0x61C3],
- ["D0C5",0x65A4],
- ["D0C6",0x6839],
- ["D0C7",0x69FF],
- ["D0C8",0x747E],
- ["D0C9",0x7B4B],
- ["D0CA",0x82B9],
- ["D0CB",0x83EB],
- ["D0CC",0x89B2],
- ["D0CD",0x8B39],
- ["D0CE",0x8FD1],
- ["D0CF",0x9949],
- ["D0D0",0xF909],
- ["D0D1",0x4ECA],
- ["D0D2",0x5997],
- ["D0D3",0x64D2],
- ["D0D4",0x6611],
- ["D0D5",0x6A8E],
- ["D0D6",0x7434],
- ["D0D7",0x7981],
- ["D0D8",0x79BD],
- ["D0D9",0x82A9],
- ["D0DA",0x887E],
- ["D0DB",0x887F],
- ["D0DC",0x895F],
- ["D0DD",0xF90A],
- ["D0DE",0x9326],
- ["D0DF",0x4F0B],
- ["D0E0",0x53CA],
- ["D0E1",0x6025],
- ["D0E2",0x6271],
- ["D0E3",0x6C72],
- ["D0E4",0x7D1A],
- ["D0E5",0x7D66],
- ["D0E6",0x4E98],
- ["D0E7",0x5162],
- ["D0E8",0x77DC],
- ["D0E9",0x80AF],
- ["D0EA",0x4F01],
- ["D0EB",0x4F0E],
- ["D0EC",0x5176],
- ["D0ED",0x5180],
- ["D0EE",0x55DC],
- ["D0EF",0x5668],
- ["D0F0",0x573B],
- ["D0F1",0x57FA],
- ["D0F2",0x57FC],
- ["D0F3",0x5914],
- ["D0F4",0x5947],
- ["D0F5",0x5993],
- ["D0F6",0x5BC4],
- ["D0F7",0x5C90],
- ["D0F8",0x5D0E],
- ["D0F9",0x5DF1],
- ["D0FA",0x5E7E],
- ["D0FB",0x5FCC],
- ["D0FC",0x6280],
- ["D0FD",0x65D7],
- ["D0FE",0x65E3],
- ["D1A1",0x671E],
- ["D1A2",0x671F],
- ["D1A3",0x675E],
- ["D1A4",0x68CB],
- ["D1A5",0x68C4],
- ["D1A6",0x6A5F],
- ["D1A7",0x6B3A],
- ["D1A8",0x6C23],
- ["D1A9",0x6C7D],
- ["D1AA",0x6C82],
- ["D1AB",0x6DC7],
- ["D1AC",0x7398],
- ["D1AD",0x7426],
- ["D1AE",0x742A],
- ["D1AF",0x7482],
- ["D1B0",0x74A3],
- ["D1B1",0x7578],
- ["D1B2",0x757F],
- ["D1B3",0x7881],
- ["D1B4",0x78EF],
- ["D1B5",0x7941],
- ["D1B6",0x7947],
- ["D1B7",0x7948],
- ["D1B8",0x797A],
- ["D1B9",0x7B95],
- ["D1BA",0x7D00],
- ["D1BB",0x7DBA],
- ["D1BC",0x7F88],
- ["D1BD",0x8006],
- ["D1BE",0x802D],
- ["D1BF",0x808C],
- ["D1C0",0x8A18],
- ["D1C1",0x8B4F],
- ["D1C2",0x8C48],
- ["D1C3",0x8D77],
- ["D1C4",0x9321],
- ["D1C5",0x9324],
- ["D1C6",0x98E2],
- ["D1C7",0x9951],
- ["D1C8",0x9A0E],
- ["D1C9",0x9A0F],
- ["D1CA",0x9A65],
- ["D1CB",0x9E92],
- ["D1CC",0x7DCA],
- ["D1CD",0x4F76],
- ["D1CE",0x5409],
- ["D1CF",0x62EE],
- ["D1D0",0x6854],
- ["D1D1",0x91D1],
- ["D1D2",0x55AB],
- ["D1D3",0x513A],
- ["D1D4",0xF90B],
- ["D1D5",0xF90C],
- ["D1D6",0x5A1C],
- ["D1D7",0x61E6],
- ["D1D8",0xF90D],
- ["D1D9",0x62CF],
- ["D1DA",0x62FF],
- ["D1DB",0xF90E],
- ["D1DC",0xF90F],
- ["D1DD",0xF910],
- ["D1DE",0xF911],
- ["D1DF",0xF912],
- ["D1E0",0xF913],
- ["D1E1",0x90A3],
- ["D1E2",0xF914],
- ["D1E3",0xF915],
- ["D1E4",0xF916],
- ["D1E5",0xF917],
- ["D1E6",0xF918],
- ["D1E7",0x8AFE],
- ["D1E8",0xF919],
- ["D1E9",0xF91A],
- ["D1EA",0xF91B],
- ["D1EB",0xF91C],
- ["D1EC",0x6696],
- ["D1ED",0xF91D],
- ["D1EE",0x7156],
- ["D1EF",0xF91E],
- ["D1F0",0xF91F],
- ["D1F1",0x96E3],
- ["D1F2",0xF920],
- ["D1F3",0x634F],
- ["D1F4",0x637A],
- ["D1F5",0x5357],
- ["D1F6",0xF921],
- ["D1F7",0x678F],
- ["D1F8",0x6960],
- ["D1F9",0x6E73],
- ["D1FA",0xF922],
- ["D1FB",0x7537],
- ["D1FC",0xF923],
- ["D1FD",0xF924],
- ["D1FE",0xF925],
- ["D2A1",0x7D0D],
- ["D2A2",0xF926],
- ["D2A3",0xF927],
- ["D2A4",0x8872],
- ["D2A5",0x56CA],
- ["D2A6",0x5A18],
- ["D2A7",0xF928],
- ["D2A8",0xF929],
- ["D2A9",0xF92A],
- ["D2AA",0xF92B],
- ["D2AB",0xF92C],
- ["D2AC",0x4E43],
- ["D2AD",0xF92D],
- ["D2AE",0x5167],
- ["D2AF",0x5948],
- ["D2B0",0x67F0],
- ["D2B1",0x8010],
- ["D2B2",0xF92E],
- ["D2B3",0x5973],
- ["D2B4",0x5E74],
- ["D2B5",0x649A],
- ["D2B6",0x79CA],
- ["D2B7",0x5FF5],
- ["D2B8",0x606C],
- ["D2B9",0x62C8],
- ["D2BA",0x637B],
- ["D2BB",0x5BE7],
- ["D2BC",0x5BD7],
- ["D2BD",0x52AA],
- ["D2BE",0xF92F],
- ["D2BF",0x5974],
- ["D2C0",0x5F29],
- ["D2C1",0x6012],
- ["D2C2",0xF930],
- ["D2C3",0xF931],
- ["D2C4",0xF932],
- ["D2C5",0x7459],
- ["D2C6",0xF933],
- ["D2C7",0xF934],
- ["D2C8",0xF935],
- ["D2C9",0xF936],
- ["D2CA",0xF937],
- ["D2CB",0xF938],
- ["D2CC",0x99D1],
- ["D2CD",0xF939],
- ["D2CE",0xF93A],
- ["D2CF",0xF93B],
- ["D2D0",0xF93C],
- ["D2D1",0xF93D],
- ["D2D2",0xF93E],
- ["D2D3",0xF93F],
- ["D2D4",0xF940],
- ["D2D5",0xF941],
- ["D2D6",0xF942],
- ["D2D7",0xF943],
- ["D2D8",0x6FC3],
- ["D2D9",0xF944],
- ["D2DA",0xF945],
- ["D2DB",0x81BF],
- ["D2DC",0x8FB2],
- ["D2DD",0x60F1],
- ["D2DE",0xF946],
- ["D2DF",0xF947],
- ["D2E0",0x8166],
- ["D2E1",0xF948],
- ["D2E2",0xF949],
- ["D2E3",0x5C3F],
- ["D2E4",0xF94A],
- ["D2E5",0xF94B],
- ["D2E6",0xF94C],
- ["D2E7",0xF94D],
- ["D2E8",0xF94E],
- ["D2E9",0xF94F],
- ["D2EA",0xF950],
- ["D2EB",0xF951],
- ["D2EC",0x5AE9],
- ["D2ED",0x8A25],
- ["D2EE",0x677B],
- ["D2EF",0x7D10],
- ["D2F0",0xF952],
- ["D2F1",0xF953],
- ["D2F2",0xF954],
- ["D2F3",0xF955],
- ["D2F4",0xF956],
- ["D2F5",0xF957],
- ["D2F6",0x80FD],
- ["D2F7",0xF958],
- ["D2F8",0xF959],
- ["D2F9",0x5C3C],
- ["D2FA",0x6CE5],
- ["D2FB",0x533F],
- ["D2FC",0x6EBA],
- ["D2FD",0x591A],
- ["D2FE",0x8336],
- ["D3A1",0x4E39],
- ["D3A2",0x4EB6],
- ["D3A3",0x4F46],
- ["D3A4",0x55AE],
- ["D3A5",0x5718],
- ["D3A6",0x58C7],
- ["D3A7",0x5F56],
- ["D3A8",0x65B7],
- ["D3A9",0x65E6],
- ["D3AA",0x6A80],
- ["D3AB",0x6BB5],
- ["D3AC",0x6E4D],
- ["D3AD",0x77ED],
- ["D3AE",0x7AEF],
- ["D3AF",0x7C1E],
- ["D3B0",0x7DDE],
- ["D3B1",0x86CB],
- ["D3B2",0x8892],
- ["D3B3",0x9132],
- ["D3B4",0x935B],
- ["D3B5",0x64BB],
- ["D3B6",0x6FBE],
- ["D3B7",0x737A],
- ["D3B8",0x75B8],
- ["D3B9",0x9054],
- ["D3BA",0x5556],
- ["D3BB",0x574D],
- ["D3BC",0x61BA],
- ["D3BD",0x64D4],
- ["D3BE",0x66C7],
- ["D3BF",0x6DE1],
- ["D3C0",0x6E5B],
- ["D3C1",0x6F6D],
- ["D3C2",0x6FB9],
- ["D3C3",0x75F0],
- ["D3C4",0x8043],
- ["D3C5",0x81BD],
- ["D3C6",0x8541],
- ["D3C7",0x8983],
- ["D3C8",0x8AC7],
- ["D3C9",0x8B5A],
- ["D3CA",0x931F],
- ["D3CB",0x6C93],
- ["D3CC",0x7553],
- ["D3CD",0x7B54],
- ["D3CE",0x8E0F],
- ["D3CF",0x905D],
- ["D3D0",0x5510],
- ["D3D1",0x5802],
- ["D3D2",0x5858],
- ["D3D3",0x5E62],
- ["D3D4",0x6207],
- ["D3D5",0x649E],
- ["D3D6",0x68E0],
- ["D3D7",0x7576],
- ["D3D8",0x7CD6],
- ["D3D9",0x87B3],
- ["D3DA",0x9EE8],
- ["D3DB",0x4EE3],
- ["D3DC",0x5788],
- ["D3DD",0x576E],
- ["D3DE",0x5927],
- ["D3DF",0x5C0D],
- ["D3E0",0x5CB1],
- ["D3E1",0x5E36],
- ["D3E2",0x5F85],
- ["D3E3",0x6234],
- ["D3E4",0x64E1],
- ["D3E5",0x73B3],
- ["D3E6",0x81FA],
- ["D3E7",0x888B],
- ["D3E8",0x8CB8],
- ["D3E9",0x968A],
- ["D3EA",0x9EDB],
- ["D3EB",0x5B85],
- ["D3EC",0x5FB7],
- ["D3ED",0x60B3],
- ["D3EE",0x5012],
- ["D3EF",0x5200],
- ["D3F0",0x5230],
- ["D3F1",0x5716],
- ["D3F2",0x5835],
- ["D3F3",0x5857],
- ["D3F4",0x5C0E],
- ["D3F5",0x5C60],
- ["D3F6",0x5CF6],
- ["D3F7",0x5D8B],
- ["D3F8",0x5EA6],
- ["D3F9",0x5F92],
- ["D3FA",0x60BC],
- ["D3FB",0x6311],
- ["D3FC",0x6389],
- ["D3FD",0x6417],
- ["D3FE",0x6843],
- ["D4A1",0x68F9],
- ["D4A2",0x6AC2],
- ["D4A3",0x6DD8],
- ["D4A4",0x6E21],
- ["D4A5",0x6ED4],
- ["D4A6",0x6FE4],
- ["D4A7",0x71FE],
- ["D4A8",0x76DC],
- ["D4A9",0x7779],
- ["D4AA",0x79B1],
- ["D4AB",0x7A3B],
- ["D4AC",0x8404],
- ["D4AD",0x89A9],
- ["D4AE",0x8CED],
- ["D4AF",0x8DF3],
- ["D4B0",0x8E48],
- ["D4B1",0x9003],
- ["D4B2",0x9014],
- ["D4B3",0x9053],
- ["D4B4",0x90FD],
- ["D4B5",0x934D],
- ["D4B6",0x9676],
- ["D4B7",0x97DC],
- ["D4B8",0x6BD2],
- ["D4B9",0x7006],
- ["D4BA",0x7258],
- ["D4BB",0x72A2],
- ["D4BC",0x7368],
- ["D4BD",0x7763],
- ["D4BE",0x79BF],
- ["D4BF",0x7BE4],
- ["D4C0",0x7E9B],
- ["D4C1",0x8B80],
- ["D4C2",0x58A9],
- ["D4C3",0x60C7],
- ["D4C4",0x6566],
- ["D4C5",0x65FD],
- ["D4C6",0x66BE],
- ["D4C7",0x6C8C],
- ["D4C8",0x711E],
- ["D4C9",0x71C9],
- ["D4CA",0x8C5A],
- ["D4CB",0x9813],
- ["D4CC",0x4E6D],
- ["D4CD",0x7A81],
- ["D4CE",0x4EDD],
- ["D4CF",0x51AC],
- ["D4D0",0x51CD],
- ["D4D1",0x52D5],
- ["D4D2",0x540C],
- ["D4D3",0x61A7],
- ["D4D4",0x6771],
- ["D4D5",0x6850],
- ["D4D6",0x68DF],
- ["D4D7",0x6D1E],
- ["D4D8",0x6F7C],
- ["D4D9",0x75BC],
- ["D4DA",0x77B3],
- ["D4DB",0x7AE5],
- ["D4DC",0x80F4],
- ["D4DD",0x8463],
- ["D4DE",0x9285],
- ["D4DF",0x515C],
- ["D4E0",0x6597],
- ["D4E1",0x675C],
- ["D4E2",0x6793],
- ["D4E3",0x75D8],
- ["D4E4",0x7AC7],
- ["D4E5",0x8373],
- ["D4E6",0xF95A],
- ["D4E7",0x8C46],
- ["D4E8",0x9017],
- ["D4E9",0x982D],
- ["D4EA",0x5C6F],
- ["D4EB",0x81C0],
- ["D4EC",0x829A],
- ["D4ED",0x9041],
- ["D4EE",0x906F],
- ["D4EF",0x920D],
- ["D4F0",0x5F97],
- ["D4F1",0x5D9D],
- ["D4F2",0x6A59],
- ["D4F3",0x71C8],
- ["D4F4",0x767B],
- ["D4F5",0x7B49],
- ["D4F6",0x85E4],
- ["D4F7",0x8B04],
- ["D4F8",0x9127],
- ["D4F9",0x9A30],
- ["D4FA",0x5587],
- ["D4FB",0x61F6],
- ["D4FC",0xF95B],
- ["D4FD",0x7669],
- ["D4FE",0x7F85],
- ["D5A1",0x863F],
- ["D5A2",0x87BA],
- ["D5A3",0x88F8],
- ["D5A4",0x908F],
- ["D5A5",0xF95C],
- ["D5A6",0x6D1B],
- ["D5A7",0x70D9],
- ["D5A8",0x73DE],
- ["D5A9",0x7D61],
- ["D5AA",0x843D],
- ["D5AB",0xF95D],
- ["D5AC",0x916A],
- ["D5AD",0x99F1],
- ["D5AE",0xF95E],
- ["D5AF",0x4E82],
- ["D5B0",0x5375],
- ["D5B1",0x6B04],
- ["D5B2",0x6B12],
- ["D5B3",0x703E],
- ["D5B4",0x721B],
- ["D5B5",0x862D],
- ["D5B6",0x9E1E],
- ["D5B7",0x524C],
- ["D5B8",0x8FA3],
- ["D5B9",0x5D50],
- ["D5BA",0x64E5],
- ["D5BB",0x652C],
- ["D5BC",0x6B16],
- ["D5BD",0x6FEB],
- ["D5BE",0x7C43],
- ["D5BF",0x7E9C],
- ["D5C0",0x85CD],
- ["D5C1",0x8964],
- ["D5C2",0x89BD],
- ["D5C3",0x62C9],
- ["D5C4",0x81D8],
- ["D5C5",0x881F],
- ["D5C6",0x5ECA],
- ["D5C7",0x6717],
- ["D5C8",0x6D6A],
- ["D5C9",0x72FC],
- ["D5CA",0x7405],
- ["D5CB",0x746F],
- ["D5CC",0x8782],
- ["D5CD",0x90DE],
- ["D5CE",0x4F86],
- ["D5CF",0x5D0D],
- ["D5D0",0x5FA0],
- ["D5D1",0x840A],
- ["D5D2",0x51B7],
- ["D5D3",0x63A0],
- ["D5D4",0x7565],
- ["D5D5",0x4EAE],
- ["D5D6",0x5006],
- ["D5D7",0x5169],
- ["D5D8",0x51C9],
- ["D5D9",0x6881],
- ["D5DA",0x6A11],
- ["D5DB",0x7CAE],
- ["D5DC",0x7CB1],
- ["D5DD",0x7CE7],
- ["D5DE",0x826F],
- ["D5DF",0x8AD2],
- ["D5E0",0x8F1B],
- ["D5E1",0x91CF],
- ["D5E2",0x4FB6],
- ["D5E3",0x5137],
- ["D5E4",0x52F5],
- ["D5E5",0x5442],
- ["D5E6",0x5EEC],
- ["D5E7",0x616E],
- ["D5E8",0x623E],
- ["D5E9",0x65C5],
- ["D5EA",0x6ADA],
- ["D5EB",0x6FFE],
- ["D5EC",0x792A],
- ["D5ED",0x85DC],
- ["D5EE",0x8823],
- ["D5EF",0x95AD],
- ["D5F0",0x9A62],
- ["D5F1",0x9A6A],
- ["D5F2",0x9E97],
- ["D5F3",0x9ECE],
- ["D5F4",0x529B],
- ["D5F5",0x66C6],
- ["D5F6",0x6B77],
- ["D5F7",0x701D],
- ["D5F8",0x792B],
- ["D5F9",0x8F62],
- ["D5FA",0x9742],
- ["D5FB",0x6190],
- ["D5FC",0x6200],
- ["D5FD",0x6523],
- ["D5FE",0x6F23],
- ["D6A1",0x7149],
- ["D6A2",0x7489],
- ["D6A3",0x7DF4],
- ["D6A4",0x806F],
- ["D6A5",0x84EE],
- ["D6A6",0x8F26],
- ["D6A7",0x9023],
- ["D6A8",0x934A],
- ["D6A9",0x51BD],
- ["D6AA",0x5217],
- ["D6AB",0x52A3],
- ["D6AC",0x6D0C],
- ["D6AD",0x70C8],
- ["D6AE",0x88C2],
- ["D6AF",0x5EC9],
- ["D6B0",0x6582],
- ["D6B1",0x6BAE],
- ["D6B2",0x6FC2],
- ["D6B3",0x7C3E],
- ["D6B4",0x7375],
- ["D6B5",0x4EE4],
- ["D6B6",0x4F36],
- ["D6B7",0x56F9],
- ["D6B8",0xF95F],
- ["D6B9",0x5CBA],
- ["D6BA",0x5DBA],
- ["D6BB",0x601C],
- ["D6BC",0x73B2],
- ["D6BD",0x7B2D],
- ["D6BE",0x7F9A],
- ["D6BF",0x7FCE],
- ["D6C0",0x8046],
- ["D6C1",0x901E],
- ["D6C2",0x9234],
- ["D6C3",0x96F6],
- ["D6C4",0x9748],
- ["D6C5",0x9818],
- ["D6C6",0x9F61],
- ["D6C7",0x4F8B],
- ["D6C8",0x6FA7],
- ["D6C9",0x79AE],
- ["D6CA",0x91B4],
- ["D6CB",0x96B7],
- ["D6CC",0x52DE],
- ["D6CD",0xF960],
- ["D6CE",0x6488],
- ["D6CF",0x64C4],
- ["D6D0",0x6AD3],
- ["D6D1",0x6F5E],
- ["D6D2",0x7018],
- ["D6D3",0x7210],
- ["D6D4",0x76E7],
- ["D6D5",0x8001],
- ["D6D6",0x8606],
- ["D6D7",0x865C],
- ["D6D8",0x8DEF],
- ["D6D9",0x8F05],
- ["D6DA",0x9732],
- ["D6DB",0x9B6F],
- ["D6DC",0x9DFA],
- ["D6DD",0x9E75],
- ["D6DE",0x788C],
- ["D6DF",0x797F],
- ["D6E0",0x7DA0],
- ["D6E1",0x83C9],
- ["D6E2",0x9304],
- ["D6E3",0x9E7F],
- ["D6E4",0x9E93],
- ["D6E5",0x8AD6],
- ["D6E6",0x58DF],
- ["D6E7",0x5F04],
- ["D6E8",0x6727],
- ["D6E9",0x7027],
- ["D6EA",0x74CF],
- ["D6EB",0x7C60],
- ["D6EC",0x807E],
- ["D6ED",0x5121],
- ["D6EE",0x7028],
- ["D6EF",0x7262],
- ["D6F0",0x78CA],
- ["D6F1",0x8CC2],
- ["D6F2",0x8CDA],
- ["D6F3",0x8CF4],
- ["D6F4",0x96F7],
- ["D6F5",0x4E86],
- ["D6F6",0x50DA],
- ["D6F7",0x5BEE],
- ["D6F8",0x5ED6],
- ["D6F9",0x6599],
- ["D6FA",0x71CE],
- ["D6FB",0x7642],
- ["D6FC",0x77AD],
- ["D6FD",0x804A],
- ["D6FE",0x84FC],
- ["D7A1",0x907C],
- ["D7A2",0x9B27],
- ["D7A3",0x9F8D],
- ["D7A4",0x58D8],
- ["D7A5",0x5A41],
- ["D7A6",0x5C62],
- ["D7A7",0x6A13],
- ["D7A8",0x6DDA],
- ["D7A9",0x6F0F],
- ["D7AA",0x763B],
- ["D7AB",0x7D2F],
- ["D7AC",0x7E37],
- ["D7AD",0x851E],
- ["D7AE",0x8938],
- ["D7AF",0x93E4],
- ["D7B0",0x964B],
- ["D7B1",0x5289],
- ["D7B2",0x65D2],
- ["D7B3",0x67F3],
- ["D7B4",0x69B4],
- ["D7B5",0x6D41],
- ["D7B6",0x6E9C],
- ["D7B7",0x700F],
- ["D7B8",0x7409],
- ["D7B9",0x7460],
- ["D7BA",0x7559],
- ["D7BB",0x7624],
- ["D7BC",0x786B],
- ["D7BD",0x8B2C],
- ["D7BE",0x985E],
- ["D7BF",0x516D],
- ["D7C0",0x622E],
- ["D7C1",0x9678],
- ["D7C2",0x4F96],
- ["D7C3",0x502B],
- ["D7C4",0x5D19],
- ["D7C5",0x6DEA],
- ["D7C6",0x7DB8],
- ["D7C7",0x8F2A],
- ["D7C8",0x5F8B],
- ["D7C9",0x6144],
- ["D7CA",0x6817],
- ["D7CB",0xF961],
- ["D7CC",0x9686],
- ["D7CD",0x52D2],
- ["D7CE",0x808B],
- ["D7CF",0x51DC],
- ["D7D0",0x51CC],
- ["D7D1",0x695E],
- ["D7D2",0x7A1C],
- ["D7D3",0x7DBE],
- ["D7D4",0x83F1],
- ["D7D5",0x9675],
- ["D7D6",0x4FDA],
- ["D7D7",0x5229],
- ["D7D8",0x5398],
- ["D7D9",0x540F],
- ["D7DA",0x550E],
- ["D7DB",0x5C65],
- ["D7DC",0x60A7],
- ["D7DD",0x674E],
- ["D7DE",0x68A8],
- ["D7DF",0x6D6C],
- ["D7E0",0x7281],
- ["D7E1",0x72F8],
- ["D7E2",0x7406],
- ["D7E3",0x7483],
- ["D7E4",0xF962],
- ["D7E5",0x75E2],
- ["D7E6",0x7C6C],
- ["D7E7",0x7F79],
- ["D7E8",0x7FB8],
- ["D7E9",0x8389],
- ["D7EA",0x88CF],
- ["D7EB",0x88E1],
- ["D7EC",0x91CC],
- ["D7ED",0x91D0],
- ["D7EE",0x96E2],
- ["D7EF",0x9BC9],
- ["D7F0",0x541D],
- ["D7F1",0x6F7E],
- ["D7F2",0x71D0],
- ["D7F3",0x7498],
- ["D7F4",0x85FA],
- ["D7F5",0x8EAA],
- ["D7F6",0x96A3],
- ["D7F7",0x9C57],
- ["D7F8",0x9E9F],
- ["D7F9",0x6797],
- ["D7FA",0x6DCB],
- ["D7FB",0x7433],
- ["D7FC",0x81E8],
- ["D7FD",0x9716],
- ["D7FE",0x782C],
- ["D8A1",0x7ACB],
- ["D8A2",0x7B20],
- ["D8A3",0x7C92],
- ["D8A4",0x6469],
- ["D8A5",0x746A],
- ["D8A6",0x75F2],
- ["D8A7",0x78BC],
- ["D8A8",0x78E8],
- ["D8A9",0x99AC],
- ["D8AA",0x9B54],
- ["D8AB",0x9EBB],
- ["D8AC",0x5BDE],
- ["D8AD",0x5E55],
- ["D8AE",0x6F20],
- ["D8AF",0x819C],
- ["D8B0",0x83AB],
- ["D8B1",0x9088],
- ["D8B2",0x4E07],
- ["D8B3",0x534D],
- ["D8B4",0x5A29],
- ["D8B5",0x5DD2],
- ["D8B6",0x5F4E],
- ["D8B7",0x6162],
- ["D8B8",0x633D],
- ["D8B9",0x6669],
- ["D8BA",0x66FC],
- ["D8BB",0x6EFF],
- ["D8BC",0x6F2B],
- ["D8BD",0x7063],
- ["D8BE",0x779E],
- ["D8BF",0x842C],
- ["D8C0",0x8513],
- ["D8C1",0x883B],
- ["D8C2",0x8F13],
- ["D8C3",0x9945],
- ["D8C4",0x9C3B],
- ["D8C5",0x551C],
- ["D8C6",0x62B9],
- ["D8C7",0x672B],
- ["D8C8",0x6CAB],
- ["D8C9",0x8309],
- ["D8CA",0x896A],
- ["D8CB",0x977A],
- ["D8CC",0x4EA1],
- ["D8CD",0x5984],
- ["D8CE",0x5FD8],
- ["D8CF",0x5FD9],
- ["D8D0",0x671B],
- ["D8D1",0x7DB2],
- ["D8D2",0x7F54],
- ["D8D3",0x8292],
- ["D8D4",0x832B],
- ["D8D5",0x83BD],
- ["D8D6",0x8F1E],
- ["D8D7",0x9099],
- ["D8D8",0x57CB],
- ["D8D9",0x59B9],
- ["D8DA",0x5A92],
- ["D8DB",0x5BD0],
- ["D8DC",0x6627],
- ["D8DD",0x679A],
- ["D8DE",0x6885],
- ["D8DF",0x6BCF],
- ["D8E0",0x7164],
- ["D8E1",0x7F75],
- ["D8E2",0x8CB7],
- ["D8E3",0x8CE3],
- ["D8E4",0x9081],
- ["D8E5",0x9B45],
- ["D8E6",0x8108],
- ["D8E7",0x8C8A],
- ["D8E8",0x964C],
- ["D8E9",0x9A40],
- ["D8EA",0x9EA5],
- ["D8EB",0x5B5F],
- ["D8EC",0x6C13],
- ["D8ED",0x731B],
- ["D8EE",0x76F2],
- ["D8EF",0x76DF],
- ["D8F0",0x840C],
- ["D8F1",0x51AA],
- ["D8F2",0x8993],
- ["D8F3",0x514D],
- ["D8F4",0x5195],
- ["D8F5",0x52C9],
- ["D8F6",0x68C9],
- ["D8F7",0x6C94],
- ["D8F8",0x7704],
- ["D8F9",0x7720],
- ["D8FA",0x7DBF],
- ["D8FB",0x7DEC],
- ["D8FC",0x9762],
- ["D8FD",0x9EB5],
- ["D8FE",0x6EC5],
- ["D9A1",0x8511],
- ["D9A2",0x51A5],
- ["D9A3",0x540D],
- ["D9A4",0x547D],
- ["D9A5",0x660E],
- ["D9A6",0x669D],
- ["D9A7",0x6927],
- ["D9A8",0x6E9F],
- ["D9A9",0x76BF],
- ["D9AA",0x7791],
- ["D9AB",0x8317],
- ["D9AC",0x84C2],
- ["D9AD",0x879F],
- ["D9AE",0x9169],
- ["D9AF",0x9298],
- ["D9B0",0x9CF4],
- ["D9B1",0x8882],
- ["D9B2",0x4FAE],
- ["D9B3",0x5192],
- ["D9B4",0x52DF],
- ["D9B5",0x59C6],
- ["D9B6",0x5E3D],
- ["D9B7",0x6155],
- ["D9B8",0x6478],
- ["D9B9",0x6479],
- ["D9BA",0x66AE],
- ["D9BB",0x67D0],
- ["D9BC",0x6A21],
- ["D9BD",0x6BCD],
- ["D9BE",0x6BDB],
- ["D9BF",0x725F],
- ["D9C0",0x7261],
- ["D9C1",0x7441],
- ["D9C2",0x7738],
- ["D9C3",0x77DB],
- ["D9C4",0x8017],
- ["D9C5",0x82BC],
- ["D9C6",0x8305],
- ["D9C7",0x8B00],
- ["D9C8",0x8B28],
- ["D9C9",0x8C8C],
- ["D9CA",0x6728],
- ["D9CB",0x6C90],
- ["D9CC",0x7267],
- ["D9CD",0x76EE],
- ["D9CE",0x7766],
- ["D9CF",0x7A46],
- ["D9D0",0x9DA9],
- ["D9D1",0x6B7F],
- ["D9D2",0x6C92],
- ["D9D3",0x5922],
- ["D9D4",0x6726],
- ["D9D5",0x8499],
- ["D9D6",0x536F],
- ["D9D7",0x5893],
- ["D9D8",0x5999],
- ["D9D9",0x5EDF],
- ["D9DA",0x63CF],
- ["D9DB",0x6634],
- ["D9DC",0x6773],
- ["D9DD",0x6E3A],
- ["D9DE",0x732B],
- ["D9DF",0x7AD7],
- ["D9E0",0x82D7],
- ["D9E1",0x9328],
- ["D9E2",0x52D9],
- ["D9E3",0x5DEB],
- ["D9E4",0x61AE],
- ["D9E5",0x61CB],
- ["D9E6",0x620A],
- ["D9E7",0x62C7],
- ["D9E8",0x64AB],
- ["D9E9",0x65E0],
- ["D9EA",0x6959],
- ["D9EB",0x6B66],
- ["D9EC",0x6BCB],
- ["D9ED",0x7121],
- ["D9EE",0x73F7],
- ["D9EF",0x755D],
- ["D9F0",0x7E46],
- ["D9F1",0x821E],
- ["D9F2",0x8302],
- ["D9F3",0x856A],
- ["D9F4",0x8AA3],
- ["D9F5",0x8CBF],
- ["D9F6",0x9727],
- ["D9F7",0x9D61],
- ["D9F8",0x58A8],
- ["D9F9",0x9ED8],
- ["D9FA",0x5011],
- ["D9FB",0x520E],
- ["D9FC",0x543B],
- ["D9FD",0x554F],
- ["D9FE",0x6587],
- ["DAA1",0x6C76],
- ["DAA2",0x7D0A],
- ["DAA3",0x7D0B],
- ["DAA4",0x805E],
- ["DAA5",0x868A],
- ["DAA6",0x9580],
- ["DAA7",0x96EF],
- ["DAA8",0x52FF],
- ["DAA9",0x6C95],
- ["DAAA",0x7269],
- ["DAAB",0x5473],
- ["DAAC",0x5A9A],
- ["DAAD",0x5C3E],
- ["DAAE",0x5D4B],
- ["DAAF",0x5F4C],
- ["DAB0",0x5FAE],
- ["DAB1",0x672A],
- ["DAB2",0x68B6],
- ["DAB3",0x6963],
- ["DAB4",0x6E3C],
- ["DAB5",0x6E44],
- ["DAB6",0x7709],
- ["DAB7",0x7C73],
- ["DAB8",0x7F8E],
- ["DAB9",0x8587],
- ["DABA",0x8B0E],
- ["DABB",0x8FF7],
- ["DABC",0x9761],
- ["DABD",0x9EF4],
- ["DABE",0x5CB7],
- ["DABF",0x60B6],
- ["DAC0",0x610D],
- ["DAC1",0x61AB],
- ["DAC2",0x654F],
- ["DAC3",0x65FB],
- ["DAC4",0x65FC],
- ["DAC5",0x6C11],
- ["DAC6",0x6CEF],
- ["DAC7",0x739F],
- ["DAC8",0x73C9],
- ["DAC9",0x7DE1],
- ["DACA",0x9594],
- ["DACB",0x5BC6],
- ["DACC",0x871C],
- ["DACD",0x8B10],
- ["DACE",0x525D],
- ["DACF",0x535A],
- ["DAD0",0x62CD],
- ["DAD1",0x640F],
- ["DAD2",0x64B2],
- ["DAD3",0x6734],
- ["DAD4",0x6A38],
- ["DAD5",0x6CCA],
- ["DAD6",0x73C0],
- ["DAD7",0x749E],
- ["DAD8",0x7B94],
- ["DAD9",0x7C95],
- ["DADA",0x7E1B],
- ["DADB",0x818A],
- ["DADC",0x8236],
- ["DADD",0x8584],
- ["DADE",0x8FEB],
- ["DADF",0x96F9],
- ["DAE0",0x99C1],
- ["DAE1",0x4F34],
- ["DAE2",0x534A],
- ["DAE3",0x53CD],
- ["DAE4",0x53DB],
- ["DAE5",0x62CC],
- ["DAE6",0x642C],
- ["DAE7",0x6500],
- ["DAE8",0x6591],
- ["DAE9",0x69C3],
- ["DAEA",0x6CEE],
- ["DAEB",0x6F58],
- ["DAEC",0x73ED],
- ["DAED",0x7554],
- ["DAEE",0x7622],
- ["DAEF",0x76E4],
- ["DAF0",0x76FC],
- ["DAF1",0x78D0],
- ["DAF2",0x78FB],
- ["DAF3",0x792C],
- ["DAF4",0x7D46],
- ["DAF5",0x822C],
- ["DAF6",0x87E0],
- ["DAF7",0x8FD4],
- ["DAF8",0x9812],
- ["DAF9",0x98EF],
- ["DAFA",0x52C3],
- ["DAFB",0x62D4],
- ["DAFC",0x64A5],
- ["DAFD",0x6E24],
- ["DAFE",0x6F51],
- ["DBA1",0x767C],
- ["DBA2",0x8DCB],
- ["DBA3",0x91B1],
- ["DBA4",0x9262],
- ["DBA5",0x9AEE],
- ["DBA6",0x9B43],
- ["DBA7",0x5023],
- ["DBA8",0x508D],
- ["DBA9",0x574A],
- ["DBAA",0x59A8],
- ["DBAB",0x5C28],
- ["DBAC",0x5E47],
- ["DBAD",0x5F77],
- ["DBAE",0x623F],
- ["DBAF",0x653E],
- ["DBB0",0x65B9],
- ["DBB1",0x65C1],
- ["DBB2",0x6609],
- ["DBB3",0x678B],
- ["DBB4",0x699C],
- ["DBB5",0x6EC2],
- ["DBB6",0x78C5],
- ["DBB7",0x7D21],
- ["DBB8",0x80AA],
- ["DBB9",0x8180],
- ["DBBA",0x822B],
- ["DBBB",0x82B3],
- ["DBBC",0x84A1],
- ["DBBD",0x868C],
- ["DBBE",0x8A2A],
- ["DBBF",0x8B17],
- ["DBC0",0x90A6],
- ["DBC1",0x9632],
- ["DBC2",0x9F90],
- ["DBC3",0x500D],
- ["DBC4",0x4FF3],
- ["DBC5",0xF963],
- ["DBC6",0x57F9],
- ["DBC7",0x5F98],
- ["DBC8",0x62DC],
- ["DBC9",0x6392],
- ["DBCA",0x676F],
- ["DBCB",0x6E43],
- ["DBCC",0x7119],
- ["DBCD",0x76C3],
- ["DBCE",0x80CC],
- ["DBCF",0x80DA],
- ["DBD0",0x88F4],
- ["DBD1",0x88F5],
- ["DBD2",0x8919],
- ["DBD3",0x8CE0],
- ["DBD4",0x8F29],
- ["DBD5",0x914D],
- ["DBD6",0x966A],
- ["DBD7",0x4F2F],
- ["DBD8",0x4F70],
- ["DBD9",0x5E1B],
- ["DBDA",0x67CF],
- ["DBDB",0x6822],
- ["DBDC",0x767D],
- ["DBDD",0x767E],
- ["DBDE",0x9B44],
- ["DBDF",0x5E61],
- ["DBE0",0x6A0A],
- ["DBE1",0x7169],
- ["DBE2",0x71D4],
- ["DBE3",0x756A],
- ["DBE4",0xF964],
- ["DBE5",0x7E41],
- ["DBE6",0x8543],
- ["DBE7",0x85E9],
- ["DBE8",0x98DC],
- ["DBE9",0x4F10],
- ["DBEA",0x7B4F],
- ["DBEB",0x7F70],
- ["DBEC",0x95A5],
- ["DBED",0x51E1],
- ["DBEE",0x5E06],
- ["DBEF",0x68B5],
- ["DBF0",0x6C3E],
- ["DBF1",0x6C4E],
- ["DBF2",0x6CDB],
- ["DBF3",0x72AF],
- ["DBF4",0x7BC4],
- ["DBF5",0x8303],
- ["DBF6",0x6CD5],
- ["DBF7",0x743A],
- ["DBF8",0x50FB],
- ["DBF9",0x5288],
- ["DBFA",0x58C1],
- ["DBFB",0x64D8],
- ["DBFC",0x6A97],
- ["DBFD",0x74A7],
- ["DBFE",0x7656],
- ["DCA1",0x78A7],
- ["DCA2",0x8617],
- ["DCA3",0x95E2],
- ["DCA4",0x9739],
- ["DCA5",0xF965],
- ["DCA6",0x535E],
- ["DCA7",0x5F01],
- ["DCA8",0x8B8A],
- ["DCA9",0x8FA8],
- ["DCAA",0x8FAF],
- ["DCAB",0x908A],
- ["DCAC",0x5225],
- ["DCAD",0x77A5],
- ["DCAE",0x9C49],
- ["DCAF",0x9F08],
- ["DCB0",0x4E19],
- ["DCB1",0x5002],
- ["DCB2",0x5175],
- ["DCB3",0x5C5B],
- ["DCB4",0x5E77],
- ["DCB5",0x661E],
- ["DCB6",0x663A],
- ["DCB7",0x67C4],
- ["DCB8",0x68C5],
- ["DCB9",0x70B3],
- ["DCBA",0x7501],
- ["DCBB",0x75C5],
- ["DCBC",0x79C9],
- ["DCBD",0x7ADD],
- ["DCBE",0x8F27],
- ["DCBF",0x9920],
- ["DCC0",0x9A08],
- ["DCC1",0x4FDD],
- ["DCC2",0x5821],
- ["DCC3",0x5831],
- ["DCC4",0x5BF6],
- ["DCC5",0x666E],
- ["DCC6",0x6B65],
- ["DCC7",0x6D11],
- ["DCC8",0x6E7A],
- ["DCC9",0x6F7D],
- ["DCCA",0x73E4],
- ["DCCB",0x752B],
- ["DCCC",0x83E9],
- ["DCCD",0x88DC],
- ["DCCE",0x8913],
- ["DCCF",0x8B5C],
- ["DCD0",0x8F14],
- ["DCD1",0x4F0F],
- ["DCD2",0x50D5],
- ["DCD3",0x5310],
- ["DCD4",0x535C],
- ["DCD5",0x5B93],
- ["DCD6",0x5FA9],
- ["DCD7",0x670D],
- ["DCD8",0x798F],
- ["DCD9",0x8179],
- ["DCDA",0x832F],
- ["DCDB",0x8514],
- ["DCDC",0x8907],
- ["DCDD",0x8986],
- ["DCDE",0x8F39],
- ["DCDF",0x8F3B],
- ["DCE0",0x99A5],
- ["DCE1",0x9C12],
- ["DCE2",0x672C],
- ["DCE3",0x4E76],
- ["DCE4",0x4FF8],
- ["DCE5",0x5949],
- ["DCE6",0x5C01],
- ["DCE7",0x5CEF],
- ["DCE8",0x5CF0],
- ["DCE9",0x6367],
- ["DCEA",0x68D2],
- ["DCEB",0x70FD],
- ["DCEC",0x71A2],
- ["DCED",0x742B],
- ["DCEE",0x7E2B],
- ["DCEF",0x84EC],
- ["DCF0",0x8702],
- ["DCF1",0x9022],
- ["DCF2",0x92D2],
- ["DCF3",0x9CF3],
- ["DCF4",0x4E0D],
- ["DCF5",0x4ED8],
- ["DCF6",0x4FEF],
- ["DCF7",0x5085],
- ["DCF8",0x5256],
- ["DCF9",0x526F],
- ["DCFA",0x5426],
- ["DCFB",0x5490],
- ["DCFC",0x57E0],
- ["DCFD",0x592B],
- ["DCFE",0x5A66],
- ["DDA1",0x5B5A],
- ["DDA2",0x5B75],
- ["DDA3",0x5BCC],
- ["DDA4",0x5E9C],
- ["DDA5",0xF966],
- ["DDA6",0x6276],
- ["DDA7",0x6577],
- ["DDA8",0x65A7],
- ["DDA9",0x6D6E],
- ["DDAA",0x6EA5],
- ["DDAB",0x7236],
- ["DDAC",0x7B26],
- ["DDAD",0x7C3F],
- ["DDAE",0x7F36],
- ["DDAF",0x8150],
- ["DDB0",0x8151],
- ["DDB1",0x819A],
- ["DDB2",0x8240],
- ["DDB3",0x8299],
- ["DDB4",0x83A9],
- ["DDB5",0x8A03],
- ["DDB6",0x8CA0],
- ["DDB7",0x8CE6],
- ["DDB8",0x8CFB],
- ["DDB9",0x8D74],
- ["DDBA",0x8DBA],
- ["DDBB",0x90E8],
- ["DDBC",0x91DC],
- ["DDBD",0x961C],
- ["DDBE",0x9644],
- ["DDBF",0x99D9],
- ["DDC0",0x9CE7],
- ["DDC1",0x5317],
- ["DDC2",0x5206],
- ["DDC3",0x5429],
- ["DDC4",0x5674],
- ["DDC5",0x58B3],
- ["DDC6",0x5954],
- ["DDC7",0x596E],
- ["DDC8",0x5FFF],
- ["DDC9",0x61A4],
- ["DDCA",0x626E],
- ["DDCB",0x6610],
- ["DDCC",0x6C7E],
- ["DDCD",0x711A],
- ["DDCE",0x76C6],
- ["DDCF",0x7C89],
- ["DDD0",0x7CDE],
- ["DDD1",0x7D1B],
- ["DDD2",0x82AC],
- ["DDD3",0x8CC1],
- ["DDD4",0x96F0],
- ["DDD5",0xF967],
- ["DDD6",0x4F5B],
- ["DDD7",0x5F17],
- ["DDD8",0x5F7F],
- ["DDD9",0x62C2],
- ["DDDA",0x5D29],
- ["DDDB",0x670B],
- ["DDDC",0x68DA],
- ["DDDD",0x787C],
- ["DDDE",0x7E43],
- ["DDDF",0x9D6C],
- ["DDE0",0x4E15],
- ["DDE1",0x5099],
- ["DDE2",0x5315],
- ["DDE3",0x532A],
- ["DDE4",0x5351],
- ["DDE5",0x5983],
- ["DDE6",0x5A62],
- ["DDE7",0x5E87],
- ["DDE8",0x60B2],
- ["DDE9",0x618A],
- ["DDEA",0x6249],
- ["DDEB",0x6279],
- ["DDEC",0x6590],
- ["DDED",0x6787],
- ["DDEE",0x69A7],
- ["DDEF",0x6BD4],
- ["DDF0",0x6BD6],
- ["DDF1",0x6BD7],
- ["DDF2",0x6BD8],
- ["DDF3",0x6CB8],
- ["DDF4",0xF968],
- ["DDF5",0x7435],
- ["DDF6",0x75FA],
- ["DDF7",0x7812],
- ["DDF8",0x7891],
- ["DDF9",0x79D5],
- ["DDFA",0x79D8],
- ["DDFB",0x7C83],
- ["DDFC",0x7DCB],
- ["DDFD",0x7FE1],
- ["DDFE",0x80A5],
- ["DEA1",0x813E],
- ["DEA2",0x81C2],
- ["DEA3",0x83F2],
- ["DEA4",0x871A],
- ["DEA5",0x88E8],
- ["DEA6",0x8AB9],
- ["DEA7",0x8B6C],
- ["DEA8",0x8CBB],
- ["DEA9",0x9119],
- ["DEAA",0x975E],
- ["DEAB",0x98DB],
- ["DEAC",0x9F3B],
- ["DEAD",0x56AC],
- ["DEAE",0x5B2A],
- ["DEAF",0x5F6C],
- ["DEB0",0x658C],
- ["DEB1",0x6AB3],
- ["DEB2",0x6BAF],
- ["DEB3",0x6D5C],
- ["DEB4",0x6FF1],
- ["DEB5",0x7015],
- ["DEB6",0x725D],
- ["DEB7",0x73AD],
- ["DEB8",0x8CA7],
- ["DEB9",0x8CD3],
- ["DEBA",0x983B],
- ["DEBB",0x6191],
- ["DEBC",0x6C37],
- ["DEBD",0x8058],
- ["DEBE",0x9A01],
- ["DEBF",0x4E4D],
- ["DEC0",0x4E8B],
- ["DEC1",0x4E9B],
- ["DEC2",0x4ED5],
- ["DEC3",0x4F3A],
- ["DEC4",0x4F3C],
- ["DEC5",0x4F7F],
- ["DEC6",0x4FDF],
- ["DEC7",0x50FF],
- ["DEC8",0x53F2],
- ["DEC9",0x53F8],
- ["DECA",0x5506],
- ["DECB",0x55E3],
- ["DECC",0x56DB],
- ["DECD",0x58EB],
- ["DECE",0x5962],
- ["DECF",0x5A11],
- ["DED0",0x5BEB],
- ["DED1",0x5BFA],
- ["DED2",0x5C04],
- ["DED3",0x5DF3],
- ["DED4",0x5E2B],
- ["DED5",0x5F99],
- ["DED6",0x601D],
- ["DED7",0x6368],
- ["DED8",0x659C],
- ["DED9",0x65AF],
- ["DEDA",0x67F6],
- ["DEDB",0x67FB],
- ["DEDC",0x68AD],
- ["DEDD",0x6B7B],
- ["DEDE",0x6C99],
- ["DEDF",0x6CD7],
- ["DEE0",0x6E23],
- ["DEE1",0x7009],
- ["DEE2",0x7345],
- ["DEE3",0x7802],
- ["DEE4",0x793E],
- ["DEE5",0x7940],
- ["DEE6",0x7960],
- ["DEE7",0x79C1],
- ["DEE8",0x7BE9],
- ["DEE9",0x7D17],
- ["DEEA",0x7D72],
- ["DEEB",0x8086],
- ["DEEC",0x820D],
- ["DEED",0x838E],
- ["DEEE",0x84D1],
- ["DEEF",0x86C7],
- ["DEF0",0x88DF],
- ["DEF1",0x8A50],
- ["DEF2",0x8A5E],
- ["DEF3",0x8B1D],
- ["DEF4",0x8CDC],
- ["DEF5",0x8D66],
- ["DEF6",0x8FAD],
- ["DEF7",0x90AA],
- ["DEF8",0x98FC],
- ["DEF9",0x99DF],
- ["DEFA",0x9E9D],
- ["DEFB",0x524A],
- ["DEFC",0xF969],
- ["DEFD",0x6714],
- ["DEFE",0xF96A],
- ["DFA1",0x5098],
- ["DFA2",0x522A],
- ["DFA3",0x5C71],
- ["DFA4",0x6563],
- ["DFA5",0x6C55],
- ["DFA6",0x73CA],
- ["DFA7",0x7523],
- ["DFA8",0x759D],
- ["DFA9",0x7B97],
- ["DFAA",0x849C],
- ["DFAB",0x9178],
- ["DFAC",0x9730],
- ["DFAD",0x4E77],
- ["DFAE",0x6492],
- ["DFAF",0x6BBA],
- ["DFB0",0x715E],
- ["DFB1",0x85A9],
- ["DFB2",0x4E09],
- ["DFB3",0xF96B],
- ["DFB4",0x6749],
- ["DFB5",0x68EE],
- ["DFB6",0x6E17],
- ["DFB7",0x829F],
- ["DFB8",0x8518],
- ["DFB9",0x886B],
- ["DFBA",0x63F7],
- ["DFBB",0x6F81],
- ["DFBC",0x9212],
- ["DFBD",0x98AF],
- ["DFBE",0x4E0A],
- ["DFBF",0x50B7],
- ["DFC0",0x50CF],
- ["DFC1",0x511F],
- ["DFC2",0x5546],
- ["DFC3",0x55AA],
- ["DFC4",0x5617],
- ["DFC5",0x5B40],
- ["DFC6",0x5C19],
- ["DFC7",0x5CE0],
- ["DFC8",0x5E38],
- ["DFC9",0x5E8A],
- ["DFCA",0x5EA0],
- ["DFCB",0x5EC2],
- ["DFCC",0x60F3],
- ["DFCD",0x6851],
- ["DFCE",0x6A61],
- ["DFCF",0x6E58],
- ["DFD0",0x723D],
- ["DFD1",0x7240],
- ["DFD2",0x72C0],
- ["DFD3",0x76F8],
- ["DFD4",0x7965],
- ["DFD5",0x7BB1],
- ["DFD6",0x7FD4],
- ["DFD7",0x88F3],
- ["DFD8",0x89F4],
- ["DFD9",0x8A73],
- ["DFDA",0x8C61],
- ["DFDB",0x8CDE],
- ["DFDC",0x971C],
- ["DFDD",0x585E],
- ["DFDE",0x74BD],
- ["DFDF",0x8CFD],
- ["DFE0",0x55C7],
- ["DFE1",0xF96C],
- ["DFE2",0x7A61],
- ["DFE3",0x7D22],
- ["DFE4",0x8272],
- ["DFE5",0x7272],
- ["DFE6",0x751F],
- ["DFE7",0x7525],
- ["DFE8",0xF96D],
- ["DFE9",0x7B19],
- ["DFEA",0x5885],
- ["DFEB",0x58FB],
- ["DFEC",0x5DBC],
- ["DFED",0x5E8F],
- ["DFEE",0x5EB6],
- ["DFEF",0x5F90],
- ["DFF0",0x6055],
- ["DFF1",0x6292],
- ["DFF2",0x637F],
- ["DFF3",0x654D],
- ["DFF4",0x6691],
- ["DFF5",0x66D9],
- ["DFF6",0x66F8],
- ["DFF7",0x6816],
- ["DFF8",0x68F2],
- ["DFF9",0x7280],
- ["DFFA",0x745E],
- ["DFFB",0x7B6E],
- ["DFFC",0x7D6E],
- ["DFFD",0x7DD6],
- ["DFFE",0x7F72],
- ["E0A1",0x80E5],
- ["E0A2",0x8212],
- ["E0A3",0x85AF],
- ["E0A4",0x897F],
- ["E0A5",0x8A93],
- ["E0A6",0x901D],
- ["E0A7",0x92E4],
- ["E0A8",0x9ECD],
- ["E0A9",0x9F20],
- ["E0AA",0x5915],
- ["E0AB",0x596D],
- ["E0AC",0x5E2D],
- ["E0AD",0x60DC],
- ["E0AE",0x6614],
- ["E0AF",0x6673],
- ["E0B0",0x6790],
- ["E0B1",0x6C50],
- ["E0B2",0x6DC5],
- ["E0B3",0x6F5F],
- ["E0B4",0x77F3],
- ["E0B5",0x78A9],
- ["E0B6",0x84C6],
- ["E0B7",0x91CB],
- ["E0B8",0x932B],
- ["E0B9",0x4ED9],
- ["E0BA",0x50CA],
- ["E0BB",0x5148],
- ["E0BC",0x5584],
- ["E0BD",0x5B0B],
- ["E0BE",0x5BA3],
- ["E0BF",0x6247],
- ["E0C0",0x657E],
- ["E0C1",0x65CB],
- ["E0C2",0x6E32],
- ["E0C3",0x717D],
- ["E0C4",0x7401],
- ["E0C5",0x7444],
- ["E0C6",0x7487],
- ["E0C7",0x74BF],
- ["E0C8",0x766C],
- ["E0C9",0x79AA],
- ["E0CA",0x7DDA],
- ["E0CB",0x7E55],
- ["E0CC",0x7FA8],
- ["E0CD",0x817A],
- ["E0CE",0x81B3],
- ["E0CF",0x8239],
- ["E0D0",0x861A],
- ["E0D1",0x87EC],
- ["E0D2",0x8A75],
- ["E0D3",0x8DE3],
- ["E0D4",0x9078],
- ["E0D5",0x9291],
- ["E0D6",0x9425],
- ["E0D7",0x994D],
- ["E0D8",0x9BAE],
- ["E0D9",0x5368],
- ["E0DA",0x5C51],
- ["E0DB",0x6954],
- ["E0DC",0x6CC4],
- ["E0DD",0x6D29],
- ["E0DE",0x6E2B],
- ["E0DF",0x820C],
- ["E0E0",0x859B],
- ["E0E1",0x893B],
- ["E0E2",0x8A2D],
- ["E0E3",0x8AAA],
- ["E0E4",0x96EA],
- ["E0E5",0x9F67],
- ["E0E6",0x5261],
- ["E0E7",0x66B9],
- ["E0E8",0x6BB2],
- ["E0E9",0x7E96],
- ["E0EA",0x87FE],
- ["E0EB",0x8D0D],
- ["E0EC",0x9583],
- ["E0ED",0x965D],
- ["E0EE",0x651D],
- ["E0EF",0x6D89],
- ["E0F0",0x71EE],
- ["E0F1",0xF96E],
- ["E0F2",0x57CE],
- ["E0F3",0x59D3],
- ["E0F4",0x5BAC],
- ["E0F5",0x6027],
- ["E0F6",0x60FA],
- ["E0F7",0x6210],
- ["E0F8",0x661F],
- ["E0F9",0x665F],
- ["E0FA",0x7329],
- ["E0FB",0x73F9],
- ["E0FC",0x76DB],
- ["E0FD",0x7701],
- ["E0FE",0x7B6C],
- ["E1A1",0x8056],
- ["E1A2",0x8072],
- ["E1A3",0x8165],
- ["E1A4",0x8AA0],
- ["E1A5",0x9192],
- ["E1A6",0x4E16],
- ["E1A7",0x52E2],
- ["E1A8",0x6B72],
- ["E1A9",0x6D17],
- ["E1AA",0x7A05],
- ["E1AB",0x7B39],
- ["E1AC",0x7D30],
- ["E1AD",0xF96F],
- ["E1AE",0x8CB0],
- ["E1AF",0x53EC],
- ["E1B0",0x562F],
- ["E1B1",0x5851],
- ["E1B2",0x5BB5],
- ["E1B3",0x5C0F],
- ["E1B4",0x5C11],
- ["E1B5",0x5DE2],
- ["E1B6",0x6240],
- ["E1B7",0x6383],
- ["E1B8",0x6414],
- ["E1B9",0x662D],
- ["E1BA",0x68B3],
- ["E1BB",0x6CBC],
- ["E1BC",0x6D88],
- ["E1BD",0x6EAF],
- ["E1BE",0x701F],
- ["E1BF",0x70A4],
- ["E1C0",0x71D2],
- ["E1C1",0x7526],
- ["E1C2",0x758F],
- ["E1C3",0x758E],
- ["E1C4",0x7619],
- ["E1C5",0x7B11],
- ["E1C6",0x7BE0],
- ["E1C7",0x7C2B],
- ["E1C8",0x7D20],
- ["E1C9",0x7D39],
- ["E1CA",0x852C],
- ["E1CB",0x856D],
- ["E1CC",0x8607],
- ["E1CD",0x8A34],
- ["E1CE",0x900D],
- ["E1CF",0x9061],
- ["E1D0",0x90B5],
- ["E1D1",0x92B7],
- ["E1D2",0x97F6],
- ["E1D3",0x9A37],
- ["E1D4",0x4FD7],
- ["E1D5",0x5C6C],
- ["E1D6",0x675F],
- ["E1D7",0x6D91],
- ["E1D8",0x7C9F],
- ["E1D9",0x7E8C],
- ["E1DA",0x8B16],
- ["E1DB",0x8D16],
- ["E1DC",0x901F],
- ["E1DD",0x5B6B],
- ["E1DE",0x5DFD],
- ["E1DF",0x640D],
- ["E1E0",0x84C0],
- ["E1E1",0x905C],
- ["E1E2",0x98E1],
- ["E1E3",0x7387],
- ["E1E4",0x5B8B],
- ["E1E5",0x609A],
- ["E1E6",0x677E],
- ["E1E7",0x6DDE],
- ["E1E8",0x8A1F],
- ["E1E9",0x8AA6],
- ["E1EA",0x9001],
- ["E1EB",0x980C],
- ["E1EC",0x5237],
- ["E1ED",0xF970],
- ["E1EE",0x7051],
- ["E1EF",0x788E],
- ["E1F0",0x9396],
- ["E1F1",0x8870],
- ["E1F2",0x91D7],
- ["E1F3",0x4FEE],
- ["E1F4",0x53D7],
- ["E1F5",0x55FD],
- ["E1F6",0x56DA],
- ["E1F7",0x5782],
- ["E1F8",0x58FD],
- ["E1F9",0x5AC2],
- ["E1FA",0x5B88],
- ["E1FB",0x5CAB],
- ["E1FC",0x5CC0],
- ["E1FD",0x5E25],
- ["E1FE",0x6101],
- ["E2A1",0x620D],
- ["E2A2",0x624B],
- ["E2A3",0x6388],
- ["E2A4",0x641C],
- ["E2A5",0x6536],
- ["E2A6",0x6578],
- ["E2A7",0x6A39],
- ["E2A8",0x6B8A],
- ["E2A9",0x6C34],
- ["E2AA",0x6D19],
- ["E2AB",0x6F31],
- ["E2AC",0x71E7],
- ["E2AD",0x72E9],
- ["E2AE",0x7378],
- ["E2AF",0x7407],
- ["E2B0",0x74B2],
- ["E2B1",0x7626],
- ["E2B2",0x7761],
- ["E2B3",0x79C0],
- ["E2B4",0x7A57],
- ["E2B5",0x7AEA],
- ["E2B6",0x7CB9],
- ["E2B7",0x7D8F],
- ["E2B8",0x7DAC],
- ["E2B9",0x7E61],
- ["E2BA",0x7F9E],
- ["E2BB",0x8129],
- ["E2BC",0x8331],
- ["E2BD",0x8490],
- ["E2BE",0x84DA],
- ["E2BF",0x85EA],
- ["E2C0",0x8896],
- ["E2C1",0x8AB0],
- ["E2C2",0x8B90],
- ["E2C3",0x8F38],
- ["E2C4",0x9042],
- ["E2C5",0x9083],
- ["E2C6",0x916C],
- ["E2C7",0x9296],
- ["E2C8",0x92B9],
- ["E2C9",0x968B],
- ["E2CA",0x96A7],
- ["E2CB",0x96A8],
- ["E2CC",0x96D6],
- ["E2CD",0x9700],
- ["E2CE",0x9808],
- ["E2CF",0x9996],
- ["E2D0",0x9AD3],
- ["E2D1",0x9B1A],
- ["E2D2",0x53D4],
- ["E2D3",0x587E],
- ["E2D4",0x5919],
- ["E2D5",0x5B70],
- ["E2D6",0x5BBF],
- ["E2D7",0x6DD1],
- ["E2D8",0x6F5A],
- ["E2D9",0x719F],
- ["E2DA",0x7421],
- ["E2DB",0x74B9],
- ["E2DC",0x8085],
- ["E2DD",0x83FD],
- ["E2DE",0x5DE1],
- ["E2DF",0x5F87],
- ["E2E0",0x5FAA],
- ["E2E1",0x6042],
- ["E2E2",0x65EC],
- ["E2E3",0x6812],
- ["E2E4",0x696F],
- ["E2E5",0x6A53],
- ["E2E6",0x6B89],
- ["E2E7",0x6D35],
- ["E2E8",0x6DF3],
- ["E2E9",0x73E3],
- ["E2EA",0x76FE],
- ["E2EB",0x77AC],
- ["E2EC",0x7B4D],
- ["E2ED",0x7D14],
- ["E2EE",0x8123],
- ["E2EF",0x821C],
- ["E2F0",0x8340],
- ["E2F1",0x84F4],
- ["E2F2",0x8563],
- ["E2F3",0x8A62],
- ["E2F4",0x8AC4],
- ["E2F5",0x9187],
- ["E2F6",0x931E],
- ["E2F7",0x9806],
- ["E2F8",0x99B4],
- ["E2F9",0x620C],
- ["E2FA",0x8853],
- ["E2FB",0x8FF0],
- ["E2FC",0x9265],
- ["E2FD",0x5D07],
- ["E2FE",0x5D27],
- ["E3A1",0x5D69],
- ["E3A2",0x745F],
- ["E3A3",0x819D],
- ["E3A4",0x8768],
- ["E3A5",0x6FD5],
- ["E3A6",0x62FE],
- ["E3A7",0x7FD2],
- ["E3A8",0x8936],
- ["E3A9",0x8972],
- ["E3AA",0x4E1E],
- ["E3AB",0x4E58],
- ["E3AC",0x50E7],
- ["E3AD",0x52DD],
- ["E3AE",0x5347],
- ["E3AF",0x627F],
- ["E3B0",0x6607],
- ["E3B1",0x7E69],
- ["E3B2",0x8805],
- ["E3B3",0x965E],
- ["E3B4",0x4F8D],
- ["E3B5",0x5319],
- ["E3B6",0x5636],
- ["E3B7",0x59CB],
- ["E3B8",0x5AA4],
- ["E3B9",0x5C38],
- ["E3BA",0x5C4E],
- ["E3BB",0x5C4D],
- ["E3BC",0x5E02],
- ["E3BD",0x5F11],
- ["E3BE",0x6043],
- ["E3BF",0x65BD],
- ["E3C0",0x662F],
- ["E3C1",0x6642],
- ["E3C2",0x67BE],
- ["E3C3",0x67F4],
- ["E3C4",0x731C],
- ["E3C5",0x77E2],
- ["E3C6",0x793A],
- ["E3C7",0x7FC5],
- ["E3C8",0x8494],
- ["E3C9",0x84CD],
- ["E3CA",0x8996],
- ["E3CB",0x8A66],
- ["E3CC",0x8A69],
- ["E3CD",0x8AE1],
- ["E3CE",0x8C55],
- ["E3CF",0x8C7A],
- ["E3D0",0x57F4],
- ["E3D1",0x5BD4],
- ["E3D2",0x5F0F],
- ["E3D3",0x606F],
- ["E3D4",0x62ED],
- ["E3D5",0x690D],
- ["E3D6",0x6B96],
- ["E3D7",0x6E5C],
- ["E3D8",0x7184],
- ["E3D9",0x7BD2],
- ["E3DA",0x8755],
- ["E3DB",0x8B58],
- ["E3DC",0x8EFE],
- ["E3DD",0x98DF],
- ["E3DE",0x98FE],
- ["E3DF",0x4F38],
- ["E3E0",0x4F81],
- ["E3E1",0x4FE1],
- ["E3E2",0x547B],
- ["E3E3",0x5A20],
- ["E3E4",0x5BB8],
- ["E3E5",0x613C],
- ["E3E6",0x65B0],
- ["E3E7",0x6668],
- ["E3E8",0x71FC],
- ["E3E9",0x7533],
- ["E3EA",0x795E],
- ["E3EB",0x7D33],
- ["E3EC",0x814E],
- ["E3ED",0x81E3],
- ["E3EE",0x8398],
- ["E3EF",0x85AA],
- ["E3F0",0x85CE],
- ["E3F1",0x8703],
- ["E3F2",0x8A0A],
- ["E3F3",0x8EAB],
- ["E3F4",0x8F9B],
- ["E3F5",0xF971],
- ["E3F6",0x8FC5],
- ["E3F7",0x5931],
- ["E3F8",0x5BA4],
- ["E3F9",0x5BE6],
- ["E3FA",0x6089],
- ["E3FB",0x5BE9],
- ["E3FC",0x5C0B],
- ["E3FD",0x5FC3],
- ["E3FE",0x6C81],
- ["E4A1",0xF972],
- ["E4A2",0x6DF1],
- ["E4A3",0x700B],
- ["E4A4",0x751A],
- ["E4A5",0x82AF],
- ["E4A6",0x8AF6],
- ["E4A7",0x4EC0],
- ["E4A8",0x5341],
- ["E4A9",0xF973],
- ["E4AA",0x96D9],
- ["E4AB",0x6C0F],
- ["E4AC",0x4E9E],
- ["E4AD",0x4FC4],
- ["E4AE",0x5152],
- ["E4AF",0x555E],
- ["E4B0",0x5A25],
- ["E4B1",0x5CE8],
- ["E4B2",0x6211],
- ["E4B3",0x7259],
- ["E4B4",0x82BD],
- ["E4B5",0x83AA],
- ["E4B6",0x86FE],
- ["E4B7",0x8859],
- ["E4B8",0x8A1D],
- ["E4B9",0x963F],
- ["E4BA",0x96C5],
- ["E4BB",0x9913],
- ["E4BC",0x9D09],
- ["E4BD",0x9D5D],
- ["E4BE",0x580A],
- ["E4BF",0x5CB3],
- ["E4C0",0x5DBD],
- ["E4C1",0x5E44],
- ["E4C2",0x60E1],
- ["E4C3",0x6115],
- ["E4C4",0x63E1],
- ["E4C5",0x6A02],
- ["E4C6",0x6E25],
- ["E4C7",0x9102],
- ["E4C8",0x9354],
- ["E4C9",0x984E],
- ["E4CA",0x9C10],
- ["E4CB",0x9F77],
- ["E4CC",0x5B89],
- ["E4CD",0x5CB8],
- ["E4CE",0x6309],
- ["E4CF",0x664F],
- ["E4D0",0x6848],
- ["E4D1",0x773C],
- ["E4D2",0x96C1],
- ["E4D3",0x978D],
- ["E4D4",0x9854],
- ["E4D5",0x9B9F],
- ["E4D6",0x65A1],
- ["E4D7",0x8B01],
- ["E4D8",0x8ECB],
- ["E4D9",0x95BC],
- ["E4DA",0x5535],
- ["E4DB",0x5CA9],
- ["E4DC",0x5DD6],
- ["E4DD",0x5EB5],
- ["E4DE",0x6697],
- ["E4DF",0x764C],
- ["E4E0",0x83F4],
- ["E4E1",0x95C7],
- ["E4E2",0x58D3],
- ["E4E3",0x62BC],
- ["E4E4",0x72CE],
- ["E4E5",0x9D28],
- ["E4E6",0x4EF0],
- ["E4E7",0x592E],
- ["E4E8",0x600F],
- ["E4E9",0x663B],
- ["E4EA",0x6B83],
- ["E4EB",0x79E7],
- ["E4EC",0x9D26],
- ["E4ED",0x5393],
- ["E4EE",0x54C0],
- ["E4EF",0x57C3],
- ["E4F0",0x5D16],
- ["E4F1",0x611B],
- ["E4F2",0x66D6],
- ["E4F3",0x6DAF],
- ["E4F4",0x788D],
- ["E4F5",0x827E],
- ["E4F6",0x9698],
- ["E4F7",0x9744],
- ["E4F8",0x5384],
- ["E4F9",0x627C],
- ["E4FA",0x6396],
- ["E4FB",0x6DB2],
- ["E4FC",0x7E0A],
- ["E4FD",0x814B],
- ["E4FE",0x984D],
- ["E5A1",0x6AFB],
- ["E5A2",0x7F4C],
- ["E5A3",0x9DAF],
- ["E5A4",0x9E1A],
- ["E5A5",0x4E5F],
- ["E5A6",0x503B],
- ["E5A7",0x51B6],
- ["E5A8",0x591C],
- ["E5A9",0x60F9],
- ["E5AA",0x63F6],
- ["E5AB",0x6930],
- ["E5AC",0x723A],
- ["E5AD",0x8036],
- ["E5AE",0xF974],
- ["E5AF",0x91CE],
- ["E5B0",0x5F31],
- ["E5B1",0xF975],
- ["E5B2",0xF976],
- ["E5B3",0x7D04],
- ["E5B4",0x82E5],
- ["E5B5",0x846F],
- ["E5B6",0x84BB],
- ["E5B7",0x85E5],
- ["E5B8",0x8E8D],
- ["E5B9",0xF977],
- ["E5BA",0x4F6F],
- ["E5BB",0xF978],
- ["E5BC",0xF979],
- ["E5BD",0x58E4],
- ["E5BE",0x5B43],
- ["E5BF",0x6059],
- ["E5C0",0x63DA],
- ["E5C1",0x6518],
- ["E5C2",0x656D],
- ["E5C3",0x6698],
- ["E5C4",0xF97A],
- ["E5C5",0x694A],
- ["E5C6",0x6A23],
- ["E5C7",0x6D0B],
- ["E5C8",0x7001],
- ["E5C9",0x716C],
- ["E5CA",0x75D2],
- ["E5CB",0x760D],
- ["E5CC",0x79B3],
- ["E5CD",0x7A70],
- ["E5CE",0xF97B],
- ["E5CF",0x7F8A],
- ["E5D0",0xF97C],
- ["E5D1",0x8944],
- ["E5D2",0xF97D],
- ["E5D3",0x8B93],
- ["E5D4",0x91C0],
- ["E5D5",0x967D],
- ["E5D6",0xF97E],
- ["E5D7",0x990A],
- ["E5D8",0x5704],
- ["E5D9",0x5FA1],
- ["E5DA",0x65BC],
- ["E5DB",0x6F01],
- ["E5DC",0x7600],
- ["E5DD",0x79A6],
- ["E5DE",0x8A9E],
- ["E5DF",0x99AD],
- ["E5E0",0x9B5A],
- ["E5E1",0x9F6C],
- ["E5E2",0x5104],
- ["E5E3",0x61B6],
- ["E5E4",0x6291],
- ["E5E5",0x6A8D],
- ["E5E6",0x81C6],
- ["E5E7",0x5043],
- ["E5E8",0x5830],
- ["E5E9",0x5F66],
- ["E5EA",0x7109],
- ["E5EB",0x8A00],
- ["E5EC",0x8AFA],
- ["E5ED",0x5B7C],
- ["E5EE",0x8616],
- ["E5EF",0x4FFA],
- ["E5F0",0x513C],
- ["E5F1",0x56B4],
- ["E5F2",0x5944],
- ["E5F3",0x63A9],
- ["E5F4",0x6DF9],
- ["E5F5",0x5DAA],
- ["E5F6",0x696D],
- ["E5F7",0x5186],
- ["E5F8",0x4E88],
- ["E5F9",0x4F59],
- ["E5FA",0xF97F],
- ["E5FB",0xF980],
- ["E5FC",0xF981],
- ["E5FD",0x5982],
- ["E5FE",0xF982],
- ["E6A1",0xF983],
- ["E6A2",0x6B5F],
- ["E6A3",0x6C5D],
- ["E6A4",0xF984],
- ["E6A5",0x74B5],
- ["E6A6",0x7916],
- ["E6A7",0xF985],
- ["E6A8",0x8207],
- ["E6A9",0x8245],
- ["E6AA",0x8339],
- ["E6AB",0x8F3F],
- ["E6AC",0x8F5D],
- ["E6AD",0xF986],
- ["E6AE",0x9918],
- ["E6AF",0xF987],
- ["E6B0",0xF988],
- ["E6B1",0xF989],
- ["E6B2",0x4EA6],
- ["E6B3",0xF98A],
- ["E6B4",0x57DF],
- ["E6B5",0x5F79],
- ["E6B6",0x6613],
- ["E6B7",0xF98B],
- ["E6B8",0xF98C],
- ["E6B9",0x75AB],
- ["E6BA",0x7E79],
- ["E6BB",0x8B6F],
- ["E6BC",0xF98D],
- ["E6BD",0x9006],
- ["E6BE",0x9A5B],
- ["E6BF",0x56A5],
- ["E6C0",0x5827],
- ["E6C1",0x59F8],
- ["E6C2",0x5A1F],
- ["E6C3",0x5BB4],
- ["E6C4",0xF98E],
- ["E6C5",0x5EF6],
- ["E6C6",0xF98F],
- ["E6C7",0xF990],
- ["E6C8",0x6350],
- ["E6C9",0x633B],
- ["E6CA",0xF991],
- ["E6CB",0x693D],
- ["E6CC",0x6C87],
- ["E6CD",0x6CBF],
- ["E6CE",0x6D8E],
- ["E6CF",0x6D93],
- ["E6D0",0x6DF5],
- ["E6D1",0x6F14],
- ["E6D2",0xF992],
- ["E6D3",0x70DF],
- ["E6D4",0x7136],
- ["E6D5",0x7159],
- ["E6D6",0xF993],
- ["E6D7",0x71C3],
- ["E6D8",0x71D5],
- ["E6D9",0xF994],
- ["E6DA",0x784F],
- ["E6DB",0x786F],
- ["E6DC",0xF995],
- ["E6DD",0x7B75],
- ["E6DE",0x7DE3],
- ["E6DF",0xF996],
- ["E6E0",0x7E2F],
- ["E6E1",0xF997],
- ["E6E2",0x884D],
- ["E6E3",0x8EDF],
- ["E6E4",0xF998],
- ["E6E5",0xF999],
- ["E6E6",0xF99A],
- ["E6E7",0x925B],
- ["E6E8",0xF99B],
- ["E6E9",0x9CF6],
- ["E6EA",0xF99C],
- ["E6EB",0xF99D],
- ["E6EC",0xF99E],
- ["E6ED",0x6085],
- ["E6EE",0x6D85],
- ["E6EF",0xF99F],
- ["E6F0",0x71B1],
- ["E6F1",0xF9A0],
- ["E6F2",0xF9A1],
- ["E6F3",0x95B1],
- ["E6F4",0x53AD],
- ["E6F5",0xF9A2],
- ["E6F6",0xF9A3],
- ["E6F7",0xF9A4],
- ["E6F8",0x67D3],
- ["E6F9",0xF9A5],
- ["E6FA",0x708E],
- ["E6FB",0x7130],
- ["E6FC",0x7430],
- ["E6FD",0x8276],
- ["E6FE",0x82D2],
- ["E7A1",0xF9A6],
- ["E7A2",0x95BB],
- ["E7A3",0x9AE5],
- ["E7A4",0x9E7D],
- ["E7A5",0x66C4],
- ["E7A6",0xF9A7],
- ["E7A7",0x71C1],
- ["E7A8",0x8449],
- ["E7A9",0xF9A8],
- ["E7AA",0xF9A9],
- ["E7AB",0x584B],
- ["E7AC",0xF9AA],
- ["E7AD",0xF9AB],
- ["E7AE",0x5DB8],
- ["E7AF",0x5F71],
- ["E7B0",0xF9AC],
- ["E7B1",0x6620],
- ["E7B2",0x668E],
- ["E7B3",0x6979],
- ["E7B4",0x69AE],
- ["E7B5",0x6C38],
- ["E7B6",0x6CF3],
- ["E7B7",0x6E36],
- ["E7B8",0x6F41],
- ["E7B9",0x6FDA],
- ["E7BA",0x701B],
- ["E7BB",0x702F],
- ["E7BC",0x7150],
- ["E7BD",0x71DF],
- ["E7BE",0x7370],
- ["E7BF",0xF9AD],
- ["E7C0",0x745B],
- ["E7C1",0xF9AE],
- ["E7C2",0x74D4],
- ["E7C3",0x76C8],
- ["E7C4",0x7A4E],
- ["E7C5",0x7E93],
- ["E7C6",0xF9AF],
- ["E7C7",0xF9B0],
- ["E7C8",0x82F1],
- ["E7C9",0x8A60],
- ["E7CA",0x8FCE],
- ["E7CB",0xF9B1],
- ["E7CC",0x9348],
- ["E7CD",0xF9B2],
- ["E7CE",0x9719],
- ["E7CF",0xF9B3],
- ["E7D0",0xF9B4],
- ["E7D1",0x4E42],
- ["E7D2",0x502A],
- ["E7D3",0xF9B5],
- ["E7D4",0x5208],
- ["E7D5",0x53E1],
- ["E7D6",0x66F3],
- ["E7D7",0x6C6D],
- ["E7D8",0x6FCA],
- ["E7D9",0x730A],
- ["E7DA",0x777F],
- ["E7DB",0x7A62],
- ["E7DC",0x82AE],
- ["E7DD",0x85DD],
- ["E7DE",0x8602],
- ["E7DF",0xF9B6],
- ["E7E0",0x88D4],
- ["E7E1",0x8A63],
- ["E7E2",0x8B7D],
- ["E7E3",0x8C6B],
- ["E7E4",0xF9B7],
- ["E7E5",0x92B3],
- ["E7E6",0xF9B8],
- ["E7E7",0x9713],
- ["E7E8",0x9810],
- ["E7E9",0x4E94],
- ["E7EA",0x4F0D],
- ["E7EB",0x4FC9],
- ["E7EC",0x50B2],
- ["E7ED",0x5348],
- ["E7EE",0x543E],
- ["E7EF",0x5433],
- ["E7F0",0x55DA],
- ["E7F1",0x5862],
- ["E7F2",0x58BA],
- ["E7F3",0x5967],
- ["E7F4",0x5A1B],
- ["E7F5",0x5BE4],
- ["E7F6",0x609F],
- ["E7F7",0xF9B9],
- ["E7F8",0x61CA],
- ["E7F9",0x6556],
- ["E7FA",0x65FF],
- ["E7FB",0x6664],
- ["E7FC",0x68A7],
- ["E7FD",0x6C5A],
- ["E7FE",0x6FB3],
- ["E8A1",0x70CF],
- ["E8A2",0x71AC],
- ["E8A3",0x7352],
- ["E8A4",0x7B7D],
- ["E8A5",0x8708],
- ["E8A6",0x8AA4],
- ["E8A7",0x9C32],
- ["E8A8",0x9F07],
- ["E8A9",0x5C4B],
- ["E8AA",0x6C83],
- ["E8AB",0x7344],
- ["E8AC",0x7389],
- ["E8AD",0x923A],
- ["E8AE",0x6EAB],
- ["E8AF",0x7465],
- ["E8B0",0x761F],
- ["E8B1",0x7A69],
- ["E8B2",0x7E15],
- ["E8B3",0x860A],
- ["E8B4",0x5140],
- ["E8B5",0x58C5],
- ["E8B6",0x64C1],
- ["E8B7",0x74EE],
- ["E8B8",0x7515],
- ["E8B9",0x7670],
- ["E8BA",0x7FC1],
- ["E8BB",0x9095],
- ["E8BC",0x96CD],
- ["E8BD",0x9954],
- ["E8BE",0x6E26],
- ["E8BF",0x74E6],
- ["E8C0",0x7AA9],
- ["E8C1",0x7AAA],
- ["E8C2",0x81E5],
- ["E8C3",0x86D9],
- ["E8C4",0x8778],
- ["E8C5",0x8A1B],
- ["E8C6",0x5A49],
- ["E8C7",0x5B8C],
- ["E8C8",0x5B9B],
- ["E8C9",0x68A1],
- ["E8CA",0x6900],
- ["E8CB",0x6D63],
- ["E8CC",0x73A9],
- ["E8CD",0x7413],
- ["E8CE",0x742C],
- ["E8CF",0x7897],
- ["E8D0",0x7DE9],
- ["E8D1",0x7FEB],
- ["E8D2",0x8118],
- ["E8D3",0x8155],
- ["E8D4",0x839E],
- ["E8D5",0x8C4C],
- ["E8D6",0x962E],
- ["E8D7",0x9811],
- ["E8D8",0x66F0],
- ["E8D9",0x5F80],
- ["E8DA",0x65FA],
- ["E8DB",0x6789],
- ["E8DC",0x6C6A],
- ["E8DD",0x738B],
- ["E8DE",0x502D],
- ["E8DF",0x5A03],
- ["E8E0",0x6B6A],
- ["E8E1",0x77EE],
- ["E8E2",0x5916],
- ["E8E3",0x5D6C],
- ["E8E4",0x5DCD],
- ["E8E5",0x7325],
- ["E8E6",0x754F],
- ["E8E7",0xF9BA],
- ["E8E8",0xF9BB],
- ["E8E9",0x50E5],
- ["E8EA",0x51F9],
- ["E8EB",0x582F],
- ["E8EC",0x592D],
- ["E8ED",0x5996],
- ["E8EE",0x59DA],
- ["E8EF",0x5BE5],
- ["E8F0",0xF9BC],
- ["E8F1",0xF9BD],
- ["E8F2",0x5DA2],
- ["E8F3",0x62D7],
- ["E8F4",0x6416],
- ["E8F5",0x6493],
- ["E8F6",0x64FE],
- ["E8F7",0xF9BE],
- ["E8F8",0x66DC],
- ["E8F9",0xF9BF],
- ["E8FA",0x6A48],
- ["E8FB",0xF9C0],
- ["E8FC",0x71FF],
- ["E8FD",0x7464],
- ["E8FE",0xF9C1],
- ["E9A1",0x7A88],
- ["E9A2",0x7AAF],
- ["E9A3",0x7E47],
- ["E9A4",0x7E5E],
- ["E9A5",0x8000],
- ["E9A6",0x8170],
- ["E9A7",0xF9C2],
- ["E9A8",0x87EF],
- ["E9A9",0x8981],
- ["E9AA",0x8B20],
- ["E9AB",0x9059],
- ["E9AC",0xF9C3],
- ["E9AD",0x9080],
- ["E9AE",0x9952],
- ["E9AF",0x617E],
- ["E9B0",0x6B32],
- ["E9B1",0x6D74],
- ["E9B2",0x7E1F],
- ["E9B3",0x8925],
- ["E9B4",0x8FB1],
- ["E9B5",0x4FD1],
- ["E9B6",0x50AD],
- ["E9B7",0x5197],
- ["E9B8",0x52C7],
- ["E9B9",0x57C7],
- ["E9BA",0x5889],
- ["E9BB",0x5BB9],
- ["E9BC",0x5EB8],
- ["E9BD",0x6142],
- ["E9BE",0x6995],
- ["E9BF",0x6D8C],
- ["E9C0",0x6E67],
- ["E9C1",0x6EB6],
- ["E9C2",0x7194],
- ["E9C3",0x7462],
- ["E9C4",0x7528],
- ["E9C5",0x752C],
- ["E9C6",0x8073],
- ["E9C7",0x8338],
- ["E9C8",0x84C9],
- ["E9C9",0x8E0A],
- ["E9CA",0x9394],
- ["E9CB",0x93DE],
- ["E9CC",0xF9C4],
- ["E9CD",0x4E8E],
- ["E9CE",0x4F51],
- ["E9CF",0x5076],
- ["E9D0",0x512A],
- ["E9D1",0x53C8],
- ["E9D2",0x53CB],
- ["E9D3",0x53F3],
- ["E9D4",0x5B87],
- ["E9D5",0x5BD3],
- ["E9D6",0x5C24],
- ["E9D7",0x611A],
- ["E9D8",0x6182],
- ["E9D9",0x65F4],
- ["E9DA",0x725B],
- ["E9DB",0x7397],
- ["E9DC",0x7440],
- ["E9DD",0x76C2],
- ["E9DE",0x7950],
- ["E9DF",0x7991],
- ["E9E0",0x79B9],
- ["E9E1",0x7D06],
- ["E9E2",0x7FBD],
- ["E9E3",0x828B],
- ["E9E4",0x85D5],
- ["E9E5",0x865E],
- ["E9E6",0x8FC2],
- ["E9E7",0x9047],
- ["E9E8",0x90F5],
- ["E9E9",0x91EA],
- ["E9EA",0x9685],
- ["E9EB",0x96E8],
- ["E9EC",0x96E9],
- ["E9ED",0x52D6],
- ["E9EE",0x5F67],
- ["E9EF",0x65ED],
- ["E9F0",0x6631],
- ["E9F1",0x682F],
- ["E9F2",0x715C],
- ["E9F3",0x7A36],
- ["E9F4",0x90C1],
- ["E9F5",0x980A],
- ["E9F6",0x4E91],
- ["E9F7",0xF9C5],
- ["E9F8",0x6A52],
- ["E9F9",0x6B9E],
- ["E9FA",0x6F90],
- ["E9FB",0x7189],
- ["E9FC",0x8018],
- ["E9FD",0x82B8],
- ["E9FE",0x8553],
- ["EAA1",0x904B],
- ["EAA2",0x9695],
- ["EAA3",0x96F2],
- ["EAA4",0x97FB],
- ["EAA5",0x851A],
- ["EAA6",0x9B31],
- ["EAA7",0x4E90],
- ["EAA8",0x718A],
- ["EAA9",0x96C4],
- ["EAAA",0x5143],
- ["EAAB",0x539F],
- ["EAAC",0x54E1],
- ["EAAD",0x5713],
- ["EAAE",0x5712],
- ["EAAF",0x57A3],
- ["EAB0",0x5A9B],
- ["EAB1",0x5AC4],
- ["EAB2",0x5BC3],
- ["EAB3",0x6028],
- ["EAB4",0x613F],
- ["EAB5",0x63F4],
- ["EAB6",0x6C85],
- ["EAB7",0x6D39],
- ["EAB8",0x6E72],
- ["EAB9",0x6E90],
- ["EABA",0x7230],
- ["EABB",0x733F],
- ["EABC",0x7457],
- ["EABD",0x82D1],
- ["EABE",0x8881],
- ["EABF",0x8F45],
- ["EAC0",0x9060],
- ["EAC1",0xF9C6],
- ["EAC2",0x9662],
- ["EAC3",0x9858],
- ["EAC4",0x9D1B],
- ["EAC5",0x6708],
- ["EAC6",0x8D8A],
- ["EAC7",0x925E],
- ["EAC8",0x4F4D],
- ["EAC9",0x5049],
- ["EACA",0x50DE],
- ["EACB",0x5371],
- ["EACC",0x570D],
- ["EACD",0x59D4],
- ["EACE",0x5A01],
- ["EACF",0x5C09],
- ["EAD0",0x6170],
- ["EAD1",0x6690],
- ["EAD2",0x6E2D],
- ["EAD3",0x7232],
- ["EAD4",0x744B],
- ["EAD5",0x7DEF],
- ["EAD6",0x80C3],
- ["EAD7",0x840E],
- ["EAD8",0x8466],
- ["EAD9",0x853F],
- ["EADA",0x875F],
- ["EADB",0x885B],
- ["EADC",0x8918],
- ["EADD",0x8B02],
- ["EADE",0x9055],
- ["EADF",0x97CB],
- ["EAE0",0x9B4F],
- ["EAE1",0x4E73],
- ["EAE2",0x4F91],
- ["EAE3",0x5112],
- ["EAE4",0x516A],
- ["EAE5",0xF9C7],
- ["EAE6",0x552F],
- ["EAE7",0x55A9],
- ["EAE8",0x5B7A],
- ["EAE9",0x5BA5],
- ["EAEA",0x5E7C],
- ["EAEB",0x5E7D],
- ["EAEC",0x5EBE],
- ["EAED",0x60A0],
- ["EAEE",0x60DF],
- ["EAEF",0x6108],
- ["EAF0",0x6109],
- ["EAF1",0x63C4],
- ["EAF2",0x6538],
- ["EAF3",0x6709],
- ["EAF4",0xF9C8],
- ["EAF5",0x67D4],
- ["EAF6",0x67DA],
- ["EAF7",0xF9C9],
- ["EAF8",0x6961],
- ["EAF9",0x6962],
- ["EAFA",0x6CB9],
- ["EAFB",0x6D27],
- ["EAFC",0xF9CA],
- ["EAFD",0x6E38],
- ["EAFE",0xF9CB],
- ["EBA1",0x6FE1],
- ["EBA2",0x7336],
- ["EBA3",0x7337],
- ["EBA4",0xF9CC],
- ["EBA5",0x745C],
- ["EBA6",0x7531],
- ["EBA7",0xF9CD],
- ["EBA8",0x7652],
- ["EBA9",0xF9CE],
- ["EBAA",0xF9CF],
- ["EBAB",0x7DAD],
- ["EBAC",0x81FE],
- ["EBAD",0x8438],
- ["EBAE",0x88D5],
- ["EBAF",0x8A98],
- ["EBB0",0x8ADB],
- ["EBB1",0x8AED],
- ["EBB2",0x8E30],
- ["EBB3",0x8E42],
- ["EBB4",0x904A],
- ["EBB5",0x903E],
- ["EBB6",0x907A],
- ["EBB7",0x9149],
- ["EBB8",0x91C9],
- ["EBB9",0x936E],
- ["EBBA",0xF9D0],
- ["EBBB",0xF9D1],
- ["EBBC",0x5809],
- ["EBBD",0xF9D2],
- ["EBBE",0x6BD3],
- ["EBBF",0x8089],
- ["EBC0",0x80B2],
- ["EBC1",0xF9D3],
- ["EBC2",0xF9D4],
- ["EBC3",0x5141],
- ["EBC4",0x596B],
- ["EBC5",0x5C39],
- ["EBC6",0xF9D5],
- ["EBC7",0xF9D6],
- ["EBC8",0x6F64],
- ["EBC9",0x73A7],
- ["EBCA",0x80E4],
- ["EBCB",0x8D07],
- ["EBCC",0xF9D7],
- ["EBCD",0x9217],
- ["EBCE",0x958F],
- ["EBCF",0xF9D8],
- ["EBD0",0xF9D9],
- ["EBD1",0xF9DA],
- ["EBD2",0xF9DB],
- ["EBD3",0x807F],
- ["EBD4",0x620E],
- ["EBD5",0x701C],
- ["EBD6",0x7D68],
- ["EBD7",0x878D],
- ["EBD8",0xF9DC],
- ["EBD9",0x57A0],
- ["EBDA",0x6069],
- ["EBDB",0x6147],
- ["EBDC",0x6BB7],
- ["EBDD",0x8ABE],
- ["EBDE",0x9280],
- ["EBDF",0x96B1],
- ["EBE0",0x4E59],
- ["EBE1",0x541F],
- ["EBE2",0x6DEB],
- ["EBE3",0x852D],
- ["EBE4",0x9670],
- ["EBE5",0x97F3],
- ["EBE6",0x98EE],
- ["EBE7",0x63D6],
- ["EBE8",0x6CE3],
- ["EBE9",0x9091],
- ["EBEA",0x51DD],
- ["EBEB",0x61C9],
- ["EBEC",0x81BA],
- ["EBED",0x9DF9],
- ["EBEE",0x4F9D],
- ["EBEF",0x501A],
- ["EBF0",0x5100],
- ["EBF1",0x5B9C],
- ["EBF2",0x610F],
- ["EBF3",0x61FF],
- ["EBF4",0x64EC],
- ["EBF5",0x6905],
- ["EBF6",0x6BC5],
- ["EBF7",0x7591],
- ["EBF8",0x77E3],
- ["EBF9",0x7FA9],
- ["EBFA",0x8264],
- ["EBFB",0x858F],
- ["EBFC",0x87FB],
- ["EBFD",0x8863],
- ["EBFE",0x8ABC],
- ["ECA1",0x8B70],
- ["ECA2",0x91AB],
- ["ECA3",0x4E8C],
- ["ECA4",0x4EE5],
- ["ECA5",0x4F0A],
- ["ECA6",0xF9DD],
- ["ECA7",0xF9DE],
- ["ECA8",0x5937],
- ["ECA9",0x59E8],
- ["ECAA",0xF9DF],
- ["ECAB",0x5DF2],
- ["ECAC",0x5F1B],
- ["ECAD",0x5F5B],
- ["ECAE",0x6021],
- ["ECAF",0xF9E0],
- ["ECB0",0xF9E1],
- ["ECB1",0xF9E2],
- ["ECB2",0xF9E3],
- ["ECB3",0x723E],
- ["ECB4",0x73E5],
- ["ECB5",0xF9E4],
- ["ECB6",0x7570],
- ["ECB7",0x75CD],
- ["ECB8",0xF9E5],
- ["ECB9",0x79FB],
- ["ECBA",0xF9E6],
- ["ECBB",0x800C],
- ["ECBC",0x8033],
- ["ECBD",0x8084],
- ["ECBE",0x82E1],
- ["ECBF",0x8351],
- ["ECC0",0xF9E7],
- ["ECC1",0xF9E8],
- ["ECC2",0x8CBD],
- ["ECC3",0x8CB3],
- ["ECC4",0x9087],
- ["ECC5",0xF9E9],
- ["ECC6",0xF9EA],
- ["ECC7",0x98F4],
- ["ECC8",0x990C],
- ["ECC9",0xF9EB],
- ["ECCA",0xF9EC],
- ["ECCB",0x7037],
- ["ECCC",0x76CA],
- ["ECCD",0x7FCA],
- ["ECCE",0x7FCC],
- ["ECCF",0x7FFC],
- ["ECD0",0x8B1A],
- ["ECD1",0x4EBA],
- ["ECD2",0x4EC1],
- ["ECD3",0x5203],
- ["ECD4",0x5370],
- ["ECD5",0xF9ED],
- ["ECD6",0x54BD],
- ["ECD7",0x56E0],
- ["ECD8",0x59FB],
- ["ECD9",0x5BC5],
- ["ECDA",0x5F15],
- ["ECDB",0x5FCD],
- ["ECDC",0x6E6E],
- ["ECDD",0xF9EE],
- ["ECDE",0xF9EF],
- ["ECDF",0x7D6A],
- ["ECE0",0x8335],
- ["ECE1",0xF9F0],
- ["ECE2",0x8693],
- ["ECE3",0x8A8D],
- ["ECE4",0xF9F1],
- ["ECE5",0x976D],
- ["ECE6",0x9777],
- ["ECE7",0xF9F2],
- ["ECE8",0xF9F3],
- ["ECE9",0x4E00],
- ["ECEA",0x4F5A],
- ["ECEB",0x4F7E],
- ["ECEC",0x58F9],
- ["ECED",0x65E5],
- ["ECEE",0x6EA2],
- ["ECEF",0x9038],
- ["ECF0",0x93B0],
- ["ECF1",0x99B9],
- ["ECF2",0x4EFB],
- ["ECF3",0x58EC],
- ["ECF4",0x598A],
- ["ECF5",0x59D9],
- ["ECF6",0x6041],
- ["ECF7",0xF9F4],
- ["ECF8",0xF9F5],
- ["ECF9",0x7A14],
- ["ECFA",0xF9F6],
- ["ECFB",0x834F],
- ["ECFC",0x8CC3],
- ["ECFD",0x5165],
- ["ECFE",0x5344],
- ["EDA1",0xF9F7],
- ["EDA2",0xF9F8],
- ["EDA3",0xF9F9],
- ["EDA4",0x4ECD],
- ["EDA5",0x5269],
- ["EDA6",0x5B55],
- ["EDA7",0x82BF],
- ["EDA8",0x4ED4],
- ["EDA9",0x523A],
- ["EDAA",0x54A8],
- ["EDAB",0x59C9],
- ["EDAC",0x59FF],
- ["EDAD",0x5B50],
- ["EDAE",0x5B57],
- ["EDAF",0x5B5C],
- ["EDB0",0x6063],
- ["EDB1",0x6148],
- ["EDB2",0x6ECB],
- ["EDB3",0x7099],
- ["EDB4",0x716E],
- ["EDB5",0x7386],
- ["EDB6",0x74F7],
- ["EDB7",0x75B5],
- ["EDB8",0x78C1],
- ["EDB9",0x7D2B],
- ["EDBA",0x8005],
- ["EDBB",0x81EA],
- ["EDBC",0x8328],
- ["EDBD",0x8517],
- ["EDBE",0x85C9],
- ["EDBF",0x8AEE],
- ["EDC0",0x8CC7],
- ["EDC1",0x96CC],
- ["EDC2",0x4F5C],
- ["EDC3",0x52FA],
- ["EDC4",0x56BC],
- ["EDC5",0x65AB],
- ["EDC6",0x6628],
- ["EDC7",0x707C],
- ["EDC8",0x70B8],
- ["EDC9",0x7235],
- ["EDCA",0x7DBD],
- ["EDCB",0x828D],
- ["EDCC",0x914C],
- ["EDCD",0x96C0],
- ["EDCE",0x9D72],
- ["EDCF",0x5B71],
- ["EDD0",0x68E7],
- ["EDD1",0x6B98],
- ["EDD2",0x6F7A],
- ["EDD3",0x76DE],
- ["EDD4",0x5C91],
- ["EDD5",0x66AB],
- ["EDD6",0x6F5B],
- ["EDD7",0x7BB4],
- ["EDD8",0x7C2A],
- ["EDD9",0x8836],
- ["EDDA",0x96DC],
- ["EDDB",0x4E08],
- ["EDDC",0x4ED7],
- ["EDDD",0x5320],
- ["EDDE",0x5834],
- ["EDDF",0x58BB],
- ["EDE0",0x58EF],
- ["EDE1",0x596C],
- ["EDE2",0x5C07],
- ["EDE3",0x5E33],
- ["EDE4",0x5E84],
- ["EDE5",0x5F35],
- ["EDE6",0x638C],
- ["EDE7",0x66B2],
- ["EDE8",0x6756],
- ["EDE9",0x6A1F],
- ["EDEA",0x6AA3],
- ["EDEB",0x6B0C],
- ["EDEC",0x6F3F],
- ["EDED",0x7246],
- ["EDEE",0xF9FA],
- ["EDEF",0x7350],
- ["EDF0",0x748B],
- ["EDF1",0x7AE0],
- ["EDF2",0x7CA7],
- ["EDF3",0x8178],
- ["EDF4",0x81DF],
- ["EDF5",0x81E7],
- ["EDF6",0x838A],
- ["EDF7",0x846C],
- ["EDF8",0x8523],
- ["EDF9",0x8594],
- ["EDFA",0x85CF],
- ["EDFB",0x88DD],
- ["EDFC",0x8D13],
- ["EDFD",0x91AC],
- ["EDFE",0x9577],
- ["EEA1",0x969C],
- ["EEA2",0x518D],
- ["EEA3",0x54C9],
- ["EEA4",0x5728],
- ["EEA5",0x5BB0],
- ["EEA6",0x624D],
- ["EEA7",0x6750],
- ["EEA8",0x683D],
- ["EEA9",0x6893],
- ["EEAA",0x6E3D],
- ["EEAB",0x6ED3],
- ["EEAC",0x707D],
- ["EEAD",0x7E21],
- ["EEAE",0x88C1],
- ["EEAF",0x8CA1],
- ["EEB0",0x8F09],
- ["EEB1",0x9F4B],
- ["EEB2",0x9F4E],
- ["EEB3",0x722D],
- ["EEB4",0x7B8F],
- ["EEB5",0x8ACD],
- ["EEB6",0x931A],
- ["EEB7",0x4F47],
- ["EEB8",0x4F4E],
- ["EEB9",0x5132],
- ["EEBA",0x5480],
- ["EEBB",0x59D0],
- ["EEBC",0x5E95],
- ["EEBD",0x62B5],
- ["EEBE",0x6775],
- ["EEBF",0x696E],
- ["EEC0",0x6A17],
- ["EEC1",0x6CAE],
- ["EEC2",0x6E1A],
- ["EEC3",0x72D9],
- ["EEC4",0x732A],
- ["EEC5",0x75BD],
- ["EEC6",0x7BB8],
- ["EEC7",0x7D35],
- ["EEC8",0x82E7],
- ["EEC9",0x83F9],
- ["EECA",0x8457],
- ["EECB",0x85F7],
- ["EECC",0x8A5B],
- ["EECD",0x8CAF],
- ["EECE",0x8E87],
- ["EECF",0x9019],
- ["EED0",0x90B8],
- ["EED1",0x96CE],
- ["EED2",0x9F5F],
- ["EED3",0x52E3],
- ["EED4",0x540A],
- ["EED5",0x5AE1],
- ["EED6",0x5BC2],
- ["EED7",0x6458],
- ["EED8",0x6575],
- ["EED9",0x6EF4],
- ["EEDA",0x72C4],
- ["EEDB",0xF9FB],
- ["EEDC",0x7684],
- ["EEDD",0x7A4D],
- ["EEDE",0x7B1B],
- ["EEDF",0x7C4D],
- ["EEE0",0x7E3E],
- ["EEE1",0x7FDF],
- ["EEE2",0x837B],
- ["EEE3",0x8B2B],
- ["EEE4",0x8CCA],
- ["EEE5",0x8D64],
- ["EEE6",0x8DE1],
- ["EEE7",0x8E5F],
- ["EEE8",0x8FEA],
- ["EEE9",0x8FF9],
- ["EEEA",0x9069],
- ["EEEB",0x93D1],
- ["EEEC",0x4F43],
- ["EEED",0x4F7A],
- ["EEEE",0x50B3],
- ["EEEF",0x5168],
- ["EEF0",0x5178],
- ["EEF1",0x524D],
- ["EEF2",0x526A],
- ["EEF3",0x5861],
- ["EEF4",0x587C],
- ["EEF5",0x5960],
- ["EEF6",0x5C08],
- ["EEF7",0x5C55],
- ["EEF8",0x5EDB],
- ["EEF9",0x609B],
- ["EEFA",0x6230],
- ["EEFB",0x6813],
- ["EEFC",0x6BBF],
- ["EEFD",0x6C08],
- ["EEFE",0x6FB1],
- ["EFA1",0x714E],
- ["EFA2",0x7420],
- ["EFA3",0x7530],
- ["EFA4",0x7538],
- ["EFA5",0x7551],
- ["EFA6",0x7672],
- ["EFA7",0x7B4C],
- ["EFA8",0x7B8B],
- ["EFA9",0x7BAD],
- ["EFAA",0x7BC6],
- ["EFAB",0x7E8F],
- ["EFAC",0x8A6E],
- ["EFAD",0x8F3E],
- ["EFAE",0x8F49],
- ["EFAF",0x923F],
- ["EFB0",0x9293],
- ["EFB1",0x9322],
- ["EFB2",0x942B],
- ["EFB3",0x96FB],
- ["EFB4",0x985A],
- ["EFB5",0x986B],
- ["EFB6",0x991E],
- ["EFB7",0x5207],
- ["EFB8",0x622A],
- ["EFB9",0x6298],
- ["EFBA",0x6D59],
- ["EFBB",0x7664],
- ["EFBC",0x7ACA],
- ["EFBD",0x7BC0],
- ["EFBE",0x7D76],
- ["EFBF",0x5360],
- ["EFC0",0x5CBE],
- ["EFC1",0x5E97],
- ["EFC2",0x6F38],
- ["EFC3",0x70B9],
- ["EFC4",0x7C98],
- ["EFC5",0x9711],
- ["EFC6",0x9B8E],
- ["EFC7",0x9EDE],
- ["EFC8",0x63A5],
- ["EFC9",0x647A],
- ["EFCA",0x8776],
- ["EFCB",0x4E01],
- ["EFCC",0x4E95],
- ["EFCD",0x4EAD],
- ["EFCE",0x505C],
- ["EFCF",0x5075],
- ["EFD0",0x5448],
- ["EFD1",0x59C3],
- ["EFD2",0x5B9A],
- ["EFD3",0x5E40],
- ["EFD4",0x5EAD],
- ["EFD5",0x5EF7],
- ["EFD6",0x5F81],
- ["EFD7",0x60C5],
- ["EFD8",0x633A],
- ["EFD9",0x653F],
- ["EFDA",0x6574],
- ["EFDB",0x65CC],
- ["EFDC",0x6676],
- ["EFDD",0x6678],
- ["EFDE",0x67FE],
- ["EFDF",0x6968],
- ["EFE0",0x6A89],
- ["EFE1",0x6B63],
- ["EFE2",0x6C40],
- ["EFE3",0x6DC0],
- ["EFE4",0x6DE8],
- ["EFE5",0x6E1F],
- ["EFE6",0x6E5E],
- ["EFE7",0x701E],
- ["EFE8",0x70A1],
- ["EFE9",0x738E],
- ["EFEA",0x73FD],
- ["EFEB",0x753A],
- ["EFEC",0x775B],
- ["EFED",0x7887],
- ["EFEE",0x798E],
- ["EFEF",0x7A0B],
- ["EFF0",0x7A7D],
- ["EFF1",0x7CBE],
- ["EFF2",0x7D8E],
- ["EFF3",0x8247],
- ["EFF4",0x8A02],
- ["EFF5",0x8AEA],
- ["EFF6",0x8C9E],
- ["EFF7",0x912D],
- ["EFF8",0x914A],
- ["EFF9",0x91D8],
- ["EFFA",0x9266],
- ["EFFB",0x92CC],
- ["EFFC",0x9320],
- ["EFFD",0x9706],
- ["EFFE",0x9756],
- ["F0A1",0x975C],
- ["F0A2",0x9802],
- ["F0A3",0x9F0E],
- ["F0A4",0x5236],
- ["F0A5",0x5291],
- ["F0A6",0x557C],
- ["F0A7",0x5824],
- ["F0A8",0x5E1D],
- ["F0A9",0x5F1F],
- ["F0AA",0x608C],
- ["F0AB",0x63D0],
- ["F0AC",0x68AF],
- ["F0AD",0x6FDF],
- ["F0AE",0x796D],
- ["F0AF",0x7B2C],
- ["F0B0",0x81CD],
- ["F0B1",0x85BA],
- ["F0B2",0x88FD],
- ["F0B3",0x8AF8],
- ["F0B4",0x8E44],
- ["F0B5",0x918D],
- ["F0B6",0x9664],
- ["F0B7",0x969B],
- ["F0B8",0x973D],
- ["F0B9",0x984C],
- ["F0BA",0x9F4A],
- ["F0BB",0x4FCE],
- ["F0BC",0x5146],
- ["F0BD",0x51CB],
- ["F0BE",0x52A9],
- ["F0BF",0x5632],
- ["F0C0",0x5F14],
- ["F0C1",0x5F6B],
- ["F0C2",0x63AA],
- ["F0C3",0x64CD],
- ["F0C4",0x65E9],
- ["F0C5",0x6641],
- ["F0C6",0x66FA],
- ["F0C7",0x66F9],
- ["F0C8",0x671D],
- ["F0C9",0x689D],
- ["F0CA",0x68D7],
- ["F0CB",0x69FD],
- ["F0CC",0x6F15],
- ["F0CD",0x6F6E],
- ["F0CE",0x7167],
- ["F0CF",0x71E5],
- ["F0D0",0x722A],
- ["F0D1",0x74AA],
- ["F0D2",0x773A],
- ["F0D3",0x7956],
- ["F0D4",0x795A],
- ["F0D5",0x79DF],
- ["F0D6",0x7A20],
- ["F0D7",0x7A95],
- ["F0D8",0x7C97],
- ["F0D9",0x7CDF],
- ["F0DA",0x7D44],
- ["F0DB",0x7E70],
- ["F0DC",0x8087],
- ["F0DD",0x85FB],
- ["F0DE",0x86A4],
- ["F0DF",0x8A54],
- ["F0E0",0x8ABF],
- ["F0E1",0x8D99],
- ["F0E2",0x8E81],
- ["F0E3",0x9020],
- ["F0E4",0x906D],
- ["F0E5",0x91E3],
- ["F0E6",0x963B],
- ["F0E7",0x96D5],
- ["F0E8",0x9CE5],
- ["F0E9",0x65CF],
- ["F0EA",0x7C07],
- ["F0EB",0x8DB3],
- ["F0EC",0x93C3],
- ["F0ED",0x5B58],
- ["F0EE",0x5C0A],
- ["F0EF",0x5352],
- ["F0F0",0x62D9],
- ["F0F1",0x731D],
- ["F0F2",0x5027],
- ["F0F3",0x5B97],
- ["F0F4",0x5F9E],
- ["F0F5",0x60B0],
- ["F0F6",0x616B],
- ["F0F7",0x68D5],
- ["F0F8",0x6DD9],
- ["F0F9",0x742E],
- ["F0FA",0x7A2E],
- ["F0FB",0x7D42],
- ["F0FC",0x7D9C],
- ["F0FD",0x7E31],
- ["F0FE",0x816B],
- ["F1A1",0x8E2A],
- ["F1A2",0x8E35],
- ["F1A3",0x937E],
- ["F1A4",0x9418],
- ["F1A5",0x4F50],
- ["F1A6",0x5750],
- ["F1A7",0x5DE6],
- ["F1A8",0x5EA7],
- ["F1A9",0x632B],
- ["F1AA",0x7F6A],
- ["F1AB",0x4E3B],
- ["F1AC",0x4F4F],
- ["F1AD",0x4F8F],
- ["F1AE",0x505A],
- ["F1AF",0x59DD],
- ["F1B0",0x80C4],
- ["F1B1",0x546A],
- ["F1B2",0x5468],
- ["F1B3",0x55FE],
- ["F1B4",0x594F],
- ["F1B5",0x5B99],
- ["F1B6",0x5DDE],
- ["F1B7",0x5EDA],
- ["F1B8",0x665D],
- ["F1B9",0x6731],
- ["F1BA",0x67F1],
- ["F1BB",0x682A],
- ["F1BC",0x6CE8],
- ["F1BD",0x6D32],
- ["F1BE",0x6E4A],
- ["F1BF",0x6F8D],
- ["F1C0",0x70B7],
- ["F1C1",0x73E0],
- ["F1C2",0x7587],
- ["F1C3",0x7C4C],
- ["F1C4",0x7D02],
- ["F1C5",0x7D2C],
- ["F1C6",0x7DA2],
- ["F1C7",0x821F],
- ["F1C8",0x86DB],
- ["F1C9",0x8A3B],
- ["F1CA",0x8A85],
- ["F1CB",0x8D70],
- ["F1CC",0x8E8A],
- ["F1CD",0x8F33],
- ["F1CE",0x9031],
- ["F1CF",0x914E],
- ["F1D0",0x9152],
- ["F1D1",0x9444],
- ["F1D2",0x99D0],
- ["F1D3",0x7AF9],
- ["F1D4",0x7CA5],
- ["F1D5",0x4FCA],
- ["F1D6",0x5101],
- ["F1D7",0x51C6],
- ["F1D8",0x57C8],
- ["F1D9",0x5BEF],
- ["F1DA",0x5CFB],
- ["F1DB",0x6659],
- ["F1DC",0x6A3D],
- ["F1DD",0x6D5A],
- ["F1DE",0x6E96],
- ["F1DF",0x6FEC],
- ["F1E0",0x710C],
- ["F1E1",0x756F],
- ["F1E2",0x7AE3],
- ["F1E3",0x8822],
- ["F1E4",0x9021],
- ["F1E5",0x9075],
- ["F1E6",0x96CB],
- ["F1E7",0x99FF],
- ["F1E8",0x8301],
- ["F1E9",0x4E2D],
- ["F1EA",0x4EF2],
- ["F1EB",0x8846],
- ["F1EC",0x91CD],
- ["F1ED",0x537D],
- ["F1EE",0x6ADB],
- ["F1EF",0x696B],
- ["F1F0",0x6C41],
- ["F1F1",0x847A],
- ["F1F2",0x589E],
- ["F1F3",0x618E],
- ["F1F4",0x66FE],
- ["F1F5",0x62EF],
- ["F1F6",0x70DD],
- ["F1F7",0x7511],
- ["F1F8",0x75C7],
- ["F1F9",0x7E52],
- ["F1FA",0x84B8],
- ["F1FB",0x8B49],
- ["F1FC",0x8D08],
- ["F1FD",0x4E4B],
- ["F1FE",0x53EA],
- ["F2A1",0x54AB],
- ["F2A2",0x5730],
- ["F2A3",0x5740],
- ["F2A4",0x5FD7],
- ["F2A5",0x6301],
- ["F2A6",0x6307],
- ["F2A7",0x646F],
- ["F2A8",0x652F],
- ["F2A9",0x65E8],
- ["F2AA",0x667A],
- ["F2AB",0x679D],
- ["F2AC",0x67B3],
- ["F2AD",0x6B62],
- ["F2AE",0x6C60],
- ["F2AF",0x6C9A],
- ["F2B0",0x6F2C],
- ["F2B1",0x77E5],
- ["F2B2",0x7825],
- ["F2B3",0x7949],
- ["F2B4",0x7957],
- ["F2B5",0x7D19],
- ["F2B6",0x80A2],
- ["F2B7",0x8102],
- ["F2B8",0x81F3],
- ["F2B9",0x829D],
- ["F2BA",0x82B7],
- ["F2BB",0x8718],
- ["F2BC",0x8A8C],
- ["F2BD",0xF9FC],
- ["F2BE",0x8D04],
- ["F2BF",0x8DBE],
- ["F2C0",0x9072],
- ["F2C1",0x76F4],
- ["F2C2",0x7A19],
- ["F2C3",0x7A37],
- ["F2C4",0x7E54],
- ["F2C5",0x8077],
- ["F2C6",0x5507],
- ["F2C7",0x55D4],
- ["F2C8",0x5875],
- ["F2C9",0x632F],
- ["F2CA",0x6422],
- ["F2CB",0x6649],
- ["F2CC",0x664B],
- ["F2CD",0x686D],
- ["F2CE",0x699B],
- ["F2CF",0x6B84],
- ["F2D0",0x6D25],
- ["F2D1",0x6EB1],
- ["F2D2",0x73CD],
- ["F2D3",0x7468],
- ["F2D4",0x74A1],
- ["F2D5",0x755B],
- ["F2D6",0x75B9],
- ["F2D7",0x76E1],
- ["F2D8",0x771E],
- ["F2D9",0x778B],
- ["F2DA",0x79E6],
- ["F2DB",0x7E09],
- ["F2DC",0x7E1D],
- ["F2DD",0x81FB],
- ["F2DE",0x852F],
- ["F2DF",0x8897],
- ["F2E0",0x8A3A],
- ["F2E1",0x8CD1],
- ["F2E2",0x8EEB],
- ["F2E3",0x8FB0],
- ["F2E4",0x9032],
- ["F2E5",0x93AD],
- ["F2E6",0x9663],
- ["F2E7",0x9673],
- ["F2E8",0x9707],
- ["F2E9",0x4F84],
- ["F2EA",0x53F1],
- ["F2EB",0x59EA],
- ["F2EC",0x5AC9],
- ["F2ED",0x5E19],
- ["F2EE",0x684E],
- ["F2EF",0x74C6],
- ["F2F0",0x75BE],
- ["F2F1",0x79E9],
- ["F2F2",0x7A92],
- ["F2F3",0x81A3],
- ["F2F4",0x86ED],
- ["F2F5",0x8CEA],
- ["F2F6",0x8DCC],
- ["F2F7",0x8FED],
- ["F2F8",0x659F],
- ["F2F9",0x6715],
- ["F2FA",0xF9FD],
- ["F2FB",0x57F7],
- ["F2FC",0x6F57],
- ["F2FD",0x7DDD],
- ["F2FE",0x8F2F],
- ["F3A1",0x93F6],
- ["F3A2",0x96C6],
- ["F3A3",0x5FB5],
- ["F3A4",0x61F2],
- ["F3A5",0x6F84],
- ["F3A6",0x4E14],
- ["F3A7",0x4F98],
- ["F3A8",0x501F],
- ["F3A9",0x53C9],
- ["F3AA",0x55DF],
- ["F3AB",0x5D6F],
- ["F3AC",0x5DEE],
- ["F3AD",0x6B21],
- ["F3AE",0x6B64],
- ["F3AF",0x78CB],
- ["F3B0",0x7B9A],
- ["F3B1",0xF9FE],
- ["F3B2",0x8E49],
- ["F3B3",0x8ECA],
- ["F3B4",0x906E],
- ["F3B5",0x6349],
- ["F3B6",0x643E],
- ["F3B7",0x7740],
- ["F3B8",0x7A84],
- ["F3B9",0x932F],
- ["F3BA",0x947F],
- ["F3BB",0x9F6A],
- ["F3BC",0x64B0],
- ["F3BD",0x6FAF],
- ["F3BE",0x71E6],
- ["F3BF",0x74A8],
- ["F3C0",0x74DA],
- ["F3C1",0x7AC4],
- ["F3C2",0x7C12],
- ["F3C3",0x7E82],
- ["F3C4",0x7CB2],
- ["F3C5",0x7E98],
- ["F3C6",0x8B9A],
- ["F3C7",0x8D0A],
- ["F3C8",0x947D],
- ["F3C9",0x9910],
- ["F3CA",0x994C],
- ["F3CB",0x5239],
- ["F3CC",0x5BDF],
- ["F3CD",0x64E6],
- ["F3CE",0x672D],
- ["F3CF",0x7D2E],
- ["F3D0",0x50ED],
- ["F3D1",0x53C3],
- ["F3D2",0x5879],
- ["F3D3",0x6158],
- ["F3D4",0x6159],
- ["F3D5",0x61FA],
- ["F3D6",0x65AC],
- ["F3D7",0x7AD9],
- ["F3D8",0x8B92],
- ["F3D9",0x8B96],
- ["F3DA",0x5009],
- ["F3DB",0x5021],
- ["F3DC",0x5275],
- ["F3DD",0x5531],
- ["F3DE",0x5A3C],
- ["F3DF",0x5EE0],
- ["F3E0",0x5F70],
- ["F3E1",0x6134],
- ["F3E2",0x655E],
- ["F3E3",0x660C],
- ["F3E4",0x6636],
- ["F3E5",0x66A2],
- ["F3E6",0x69CD],
- ["F3E7",0x6EC4],
- ["F3E8",0x6F32],
- ["F3E9",0x7316],
- ["F3EA",0x7621],
- ["F3EB",0x7A93],
- ["F3EC",0x8139],
- ["F3ED",0x8259],
- ["F3EE",0x83D6],
- ["F3EF",0x84BC],
- ["F3F0",0x50B5],
- ["F3F1",0x57F0],
- ["F3F2",0x5BC0],
- ["F3F3",0x5BE8],
- ["F3F4",0x5F69],
- ["F3F5",0x63A1],
- ["F3F6",0x7826],
- ["F3F7",0x7DB5],
- ["F3F8",0x83DC],
- ["F3F9",0x8521],
- ["F3FA",0x91C7],
- ["F3FB",0x91F5],
- ["F3FC",0x518A],
- ["F3FD",0x67F5],
- ["F3FE",0x7B56],
- ["F4A1",0x8CAC],
- ["F4A2",0x51C4],
- ["F4A3",0x59BB],
- ["F4A4",0x60BD],
- ["F4A5",0x8655],
- ["F4A6",0x501C],
- ["F4A7",0xF9FF],
- ["F4A8",0x5254],
- ["F4A9",0x5C3A],
- ["F4AA",0x617D],
- ["F4AB",0x621A],
- ["F4AC",0x62D3],
- ["F4AD",0x64F2],
- ["F4AE",0x65A5],
- ["F4AF",0x6ECC],
- ["F4B0",0x7620],
- ["F4B1",0x810A],
- ["F4B2",0x8E60],
- ["F4B3",0x965F],
- ["F4B4",0x96BB],
- ["F4B5",0x4EDF],
- ["F4B6",0x5343],
- ["F4B7",0x5598],
- ["F4B8",0x5929],
- ["F4B9",0x5DDD],
- ["F4BA",0x64C5],
- ["F4BB",0x6CC9],
- ["F4BC",0x6DFA],
- ["F4BD",0x7394],
- ["F4BE",0x7A7F],
- ["F4BF",0x821B],
- ["F4C0",0x85A6],
- ["F4C1",0x8CE4],
- ["F4C2",0x8E10],
- ["F4C3",0x9077],
- ["F4C4",0x91E7],
- ["F4C5",0x95E1],
- ["F4C6",0x9621],
- ["F4C7",0x97C6],
- ["F4C8",0x51F8],
- ["F4C9",0x54F2],
- ["F4CA",0x5586],
- ["F4CB",0x5FB9],
- ["F4CC",0x64A4],
- ["F4CD",0x6F88],
- ["F4CE",0x7DB4],
- ["F4CF",0x8F1F],
- ["F4D0",0x8F4D],
- ["F4D1",0x9435],
- ["F4D2",0x50C9],
- ["F4D3",0x5C16],
- ["F4D4",0x6CBE],
- ["F4D5",0x6DFB],
- ["F4D6",0x751B],
- ["F4D7",0x77BB],
- ["F4D8",0x7C3D],
- ["F4D9",0x7C64],
- ["F4DA",0x8A79],
- ["F4DB",0x8AC2],
- ["F4DC",0x581E],
- ["F4DD",0x59BE],
- ["F4DE",0x5E16],
- ["F4DF",0x6377],
- ["F4E0",0x7252],
- ["F4E1",0x758A],
- ["F4E2",0x776B],
- ["F4E3",0x8ADC],
- ["F4E4",0x8CBC],
- ["F4E5",0x8F12],
- ["F4E6",0x5EF3],
- ["F4E7",0x6674],
- ["F4E8",0x6DF8],
- ["F4E9",0x807D],
- ["F4EA",0x83C1],
- ["F4EB",0x8ACB],
- ["F4EC",0x9751],
- ["F4ED",0x9BD6],
- ["F4EE",0xFA00],
- ["F4EF",0x5243],
- ["F4F0",0x66FF],
- ["F4F1",0x6D95],
- ["F4F2",0x6EEF],
- ["F4F3",0x7DE0],
- ["F4F4",0x8AE6],
- ["F4F5",0x902E],
- ["F4F6",0x905E],
- ["F4F7",0x9AD4],
- ["F4F8",0x521D],
- ["F4F9",0x527F],
- ["F4FA",0x54E8],
- ["F4FB",0x6194],
- ["F4FC",0x6284],
- ["F4FD",0x62DB],
- ["F4FE",0x68A2],
- ["F5A1",0x6912],
- ["F5A2",0x695A],
- ["F5A3",0x6A35],
- ["F5A4",0x7092],
- ["F5A5",0x7126],
- ["F5A6",0x785D],
- ["F5A7",0x7901],
- ["F5A8",0x790E],
- ["F5A9",0x79D2],
- ["F5AA",0x7A0D],
- ["F5AB",0x8096],
- ["F5AC",0x8278],
- ["F5AD",0x82D5],
- ["F5AE",0x8349],
- ["F5AF",0x8549],
- ["F5B0",0x8C82],
- ["F5B1",0x8D85],
- ["F5B2",0x9162],
- ["F5B3",0x918B],
- ["F5B4",0x91AE],
- ["F5B5",0x4FC3],
- ["F5B6",0x56D1],
- ["F5B7",0x71ED],
- ["F5B8",0x77D7],
- ["F5B9",0x8700],
- ["F5BA",0x89F8],
- ["F5BB",0x5BF8],
- ["F5BC",0x5FD6],
- ["F5BD",0x6751],
- ["F5BE",0x90A8],
- ["F5BF",0x53E2],
- ["F5C0",0x585A],
- ["F5C1",0x5BF5],
- ["F5C2",0x60A4],
- ["F5C3",0x6181],
- ["F5C4",0x6460],
- ["F5C5",0x7E3D],
- ["F5C6",0x8070],
- ["F5C7",0x8525],
- ["F5C8",0x9283],
- ["F5C9",0x64AE],
- ["F5CA",0x50AC],
- ["F5CB",0x5D14],
- ["F5CC",0x6700],
- ["F5CD",0x589C],
- ["F5CE",0x62BD],
- ["F5CF",0x63A8],
- ["F5D0",0x690E],
- ["F5D1",0x6978],
- ["F5D2",0x6A1E],
- ["F5D3",0x6E6B],
- ["F5D4",0x76BA],
- ["F5D5",0x79CB],
- ["F5D6",0x82BB],
- ["F5D7",0x8429],
- ["F5D8",0x8ACF],
- ["F5D9",0x8DA8],
- ["F5DA",0x8FFD],
- ["F5DB",0x9112],
- ["F5DC",0x914B],
- ["F5DD",0x919C],
- ["F5DE",0x9310],
- ["F5DF",0x9318],
- ["F5E0",0x939A],
- ["F5E1",0x96DB],
- ["F5E2",0x9A36],
- ["F5E3",0x9C0D],
- ["F5E4",0x4E11],
- ["F5E5",0x755C],
- ["F5E6",0x795D],
- ["F5E7",0x7AFA],
- ["F5E8",0x7B51],
- ["F5E9",0x7BC9],
- ["F5EA",0x7E2E],
- ["F5EB",0x84C4],
- ["F5EC",0x8E59],
- ["F5ED",0x8E74],
- ["F5EE",0x8EF8],
- ["F5EF",0x9010],
- ["F5F0",0x6625],
- ["F5F1",0x693F],
- ["F5F2",0x7443],
- ["F5F3",0x51FA],
- ["F5F4",0x672E],
- ["F5F5",0x9EDC],
- ["F5F6",0x5145],
- ["F5F7",0x5FE0],
- ["F5F8",0x6C96],
- ["F5F9",0x87F2],
- ["F5FA",0x885D],
- ["F5FB",0x8877],
- ["F5FC",0x60B4],
- ["F5FD",0x81B5],
- ["F5FE",0x8403],
- ["F6A1",0x8D05],
- ["F6A2",0x53D6],
- ["F6A3",0x5439],
- ["F6A4",0x5634],
- ["F6A5",0x5A36],
- ["F6A6",0x5C31],
- ["F6A7",0x708A],
- ["F6A8",0x7FE0],
- ["F6A9",0x805A],
- ["F6AA",0x8106],
- ["F6AB",0x81ED],
- ["F6AC",0x8DA3],
- ["F6AD",0x9189],
- ["F6AE",0x9A5F],
- ["F6AF",0x9DF2],
- ["F6B0",0x5074],
- ["F6B1",0x4EC4],
- ["F6B2",0x53A0],
- ["F6B3",0x60FB],
- ["F6B4",0x6E2C],
- ["F6B5",0x5C64],
- ["F6B6",0x4F88],
- ["F6B7",0x5024],
- ["F6B8",0x55E4],
- ["F6B9",0x5CD9],
- ["F6BA",0x5E5F],
- ["F6BB",0x6065],
- ["F6BC",0x6894],
- ["F6BD",0x6CBB],
- ["F6BE",0x6DC4],
- ["F6BF",0x71BE],
- ["F6C0",0x75D4],
- ["F6C1",0x75F4],
- ["F6C2",0x7661],
- ["F6C3",0x7A1A],
- ["F6C4",0x7A49],
- ["F6C5",0x7DC7],
- ["F6C6",0x7DFB],
- ["F6C7",0x7F6E],
- ["F6C8",0x81F4],
- ["F6C9",0x86A9],
- ["F6CA",0x8F1C],
- ["F6CB",0x96C9],
- ["F6CC",0x99B3],
- ["F6CD",0x9F52],
- ["F6CE",0x5247],
- ["F6CF",0x52C5],
- ["F6D0",0x98ED],
- ["F6D1",0x89AA],
- ["F6D2",0x4E03],
- ["F6D3",0x67D2],
- ["F6D4",0x6F06],
- ["F6D5",0x4FB5],
- ["F6D6",0x5BE2],
- ["F6D7",0x6795],
- ["F6D8",0x6C88],
- ["F6D9",0x6D78],
- ["F6DA",0x741B],
- ["F6DB",0x7827],
- ["F6DC",0x91DD],
- ["F6DD",0x937C],
- ["F6DE",0x87C4],
- ["F6DF",0x79E4],
- ["F6E0",0x7A31],
- ["F6E1",0x5FEB],
- ["F6E2",0x4ED6],
- ["F6E3",0x54A4],
- ["F6E4",0x553E],
- ["F6E5",0x58AE],
- ["F6E6",0x59A5],
- ["F6E7",0x60F0],
- ["F6E8",0x6253],
- ["F6E9",0x62D6],
- ["F6EA",0x6736],
- ["F6EB",0x6955],
- ["F6EC",0x8235],
- ["F6ED",0x9640],
- ["F6EE",0x99B1],
- ["F6EF",0x99DD],
- ["F6F0",0x502C],
- ["F6F1",0x5353],
- ["F6F2",0x5544],
- ["F6F3",0x577C],
- ["F6F4",0xFA01],
- ["F6F5",0x6258],
- ["F6F6",0xFA02],
- ["F6F7",0x64E2],
- ["F6F8",0x666B],
- ["F6F9",0x67DD],
- ["F6FA",0x6FC1],
- ["F6FB",0x6FEF],
- ["F6FC",0x7422],
- ["F6FD",0x7438],
- ["F6FE",0x8A17],
- ["F7A1",0x9438],
- ["F7A2",0x5451],
- ["F7A3",0x5606],
- ["F7A4",0x5766],
- ["F7A5",0x5F48],
- ["F7A6",0x619A],
- ["F7A7",0x6B4E],
- ["F7A8",0x7058],
- ["F7A9",0x70AD],
- ["F7AA",0x7DBB],
- ["F7AB",0x8A95],
- ["F7AC",0x596A],
- ["F7AD",0x812B],
- ["F7AE",0x63A2],
- ["F7AF",0x7708],
- ["F7B0",0x803D],
- ["F7B1",0x8CAA],
- ["F7B2",0x5854],
- ["F7B3",0x642D],
- ["F7B4",0x69BB],
- ["F7B5",0x5B95],
- ["F7B6",0x5E11],
- ["F7B7",0x6E6F],
- ["F7B8",0xFA03],
- ["F7B9",0x8569],
- ["F7BA",0x514C],
- ["F7BB",0x53F0],
- ["F7BC",0x592A],
- ["F7BD",0x6020],
- ["F7BE",0x614B],
- ["F7BF",0x6B86],
- ["F7C0",0x6C70],
- ["F7C1",0x6CF0],
- ["F7C2",0x7B1E],
- ["F7C3",0x80CE],
- ["F7C4",0x82D4],
- ["F7C5",0x8DC6],
- ["F7C6",0x90B0],
- ["F7C7",0x98B1],
- ["F7C8",0xFA04],
- ["F7C9",0x64C7],
- ["F7CA",0x6FA4],
- ["F7CB",0x6491],
- ["F7CC",0x6504],
- ["F7CD",0x514E],
- ["F7CE",0x5410],
- ["F7CF",0x571F],
- ["F7D0",0x8A0E],
- ["F7D1",0x615F],
- ["F7D2",0x6876],
- ["F7D3",0xFA05],
- ["F7D4",0x75DB],
- ["F7D5",0x7B52],
- ["F7D6",0x7D71],
- ["F7D7",0x901A],
- ["F7D8",0x5806],
- ["F7D9",0x69CC],
- ["F7DA",0x817F],
- ["F7DB",0x892A],
- ["F7DC",0x9000],
- ["F7DD",0x9839],
- ["F7DE",0x5078],
- ["F7DF",0x5957],
- ["F7E0",0x59AC],
- ["F7E1",0x6295],
- ["F7E2",0x900F],
- ["F7E3",0x9B2A],
- ["F7E4",0x615D],
- ["F7E5",0x7279],
- ["F7E6",0x95D6],
- ["F7E7",0x5761],
- ["F7E8",0x5A46],
- ["F7E9",0x5DF4],
- ["F7EA",0x628A],
- ["F7EB",0x64AD],
- ["F7EC",0x64FA],
- ["F7ED",0x6777],
- ["F7EE",0x6CE2],
- ["F7EF",0x6D3E],
- ["F7F0",0x722C],
- ["F7F1",0x7436],
- ["F7F2",0x7834],
- ["F7F3",0x7F77],
- ["F7F4",0x82AD],
- ["F7F5",0x8DDB],
- ["F7F6",0x9817],
- ["F7F7",0x5224],
- ["F7F8",0x5742],
- ["F7F9",0x677F],
- ["F7FA",0x7248],
- ["F7FB",0x74E3],
- ["F7FC",0x8CA9],
- ["F7FD",0x8FA6],
- ["F7FE",0x9211],
- ["F8A1",0x962A],
- ["F8A2",0x516B],
- ["F8A3",0x53ED],
- ["F8A4",0x634C],
- ["F8A5",0x4F69],
- ["F8A6",0x5504],
- ["F8A7",0x6096],
- ["F8A8",0x6557],
- ["F8A9",0x6C9B],
- ["F8AA",0x6D7F],
- ["F8AB",0x724C],
- ["F8AC",0x72FD],
- ["F8AD",0x7A17],
- ["F8AE",0x8987],
- ["F8AF",0x8C9D],
- ["F8B0",0x5F6D],
- ["F8B1",0x6F8E],
- ["F8B2",0x70F9],
- ["F8B3",0x81A8],
- ["F8B4",0x610E],
- ["F8B5",0x4FBF],
- ["F8B6",0x504F],
- ["F8B7",0x6241],
- ["F8B8",0x7247],
- ["F8B9",0x7BC7],
- ["F8BA",0x7DE8],
- ["F8BB",0x7FE9],
- ["F8BC",0x904D],
- ["F8BD",0x97AD],
- ["F8BE",0x9A19],
- ["F8BF",0x8CB6],
- ["F8C0",0x576A],
- ["F8C1",0x5E73],
- ["F8C2",0x67B0],
- ["F8C3",0x840D],
- ["F8C4",0x8A55],
- ["F8C5",0x5420],
- ["F8C6",0x5B16],
- ["F8C7",0x5E63],
- ["F8C8",0x5EE2],
- ["F8C9",0x5F0A],
- ["F8CA",0x6583],
- ["F8CB",0x80BA],
- ["F8CC",0x853D],
- ["F8CD",0x9589],
- ["F8CE",0x965B],
- ["F8CF",0x4F48],
- ["F8D0",0x5305],
- ["F8D1",0x530D],
- ["F8D2",0x530F],
- ["F8D3",0x5486],
- ["F8D4",0x54FA],
- ["F8D5",0x5703],
- ["F8D6",0x5E03],
- ["F8D7",0x6016],
- ["F8D8",0x629B],
- ["F8D9",0x62B1],
- ["F8DA",0x6355],
- ["F8DB",0xFA06],
- ["F8DC",0x6CE1],
- ["F8DD",0x6D66],
- ["F8DE",0x75B1],
- ["F8DF",0x7832],
- ["F8E0",0x80DE],
- ["F8E1",0x812F],
- ["F8E2",0x82DE],
- ["F8E3",0x8461],
- ["F8E4",0x84B2],
- ["F8E5",0x888D],
- ["F8E6",0x8912],
- ["F8E7",0x900B],
- ["F8E8",0x92EA],
- ["F8E9",0x98FD],
- ["F8EA",0x9B91],
- ["F8EB",0x5E45],
- ["F8EC",0x66B4],
- ["F8ED",0x66DD],
- ["F8EE",0x7011],
- ["F8EF",0x7206],
- ["F8F0",0xFA07],
- ["F8F1",0x4FF5],
- ["F8F2",0x527D],
- ["F8F3",0x5F6A],
- ["F8F4",0x6153],
- ["F8F5",0x6753],
- ["F8F6",0x6A19],
- ["F8F7",0x6F02],
- ["F8F8",0x74E2],
- ["F8F9",0x7968],
- ["F8FA",0x8868],
- ["F8FB",0x8C79],
- ["F8FC",0x98C7],
- ["F8FD",0x98C4],
- ["F8FE",0x9A43],
- ["F9A1",0x54C1],
- ["F9A2",0x7A1F],
- ["F9A3",0x6953],
- ["F9A4",0x8AF7],
- ["F9A5",0x8C4A],
- ["F9A6",0x98A8],
- ["F9A7",0x99AE],
- ["F9A8",0x5F7C],
- ["F9A9",0x62AB],
- ["F9AA",0x75B2],
- ["F9AB",0x76AE],
- ["F9AC",0x88AB],
- ["F9AD",0x907F],
- ["F9AE",0x9642],
- ["F9AF",0x5339],
- ["F9B0",0x5F3C],
- ["F9B1",0x5FC5],
- ["F9B2",0x6CCC],
- ["F9B3",0x73CC],
- ["F9B4",0x7562],
- ["F9B5",0x758B],
- ["F9B6",0x7B46],
- ["F9B7",0x82FE],
- ["F9B8",0x999D],
- ["F9B9",0x4E4F],
- ["F9BA",0x903C],
- ["F9BB",0x4E0B],
- ["F9BC",0x4F55],
- ["F9BD",0x53A6],
- ["F9BE",0x590F],
- ["F9BF",0x5EC8],
- ["F9C0",0x6630],
- ["F9C1",0x6CB3],
- ["F9C2",0x7455],
- ["F9C3",0x8377],
- ["F9C4",0x8766],
- ["F9C5",0x8CC0],
- ["F9C6",0x9050],
- ["F9C7",0x971E],
- ["F9C8",0x9C15],
- ["F9C9",0x58D1],
- ["F9CA",0x5B78],
- ["F9CB",0x8650],
- ["F9CC",0x8B14],
- ["F9CD",0x9DB4],
- ["F9CE",0x5BD2],
- ["F9CF",0x6068],
- ["F9D0",0x608D],
- ["F9D1",0x65F1],
- ["F9D2",0x6C57],
- ["F9D3",0x6F22],
- ["F9D4",0x6FA3],
- ["F9D5",0x701A],
- ["F9D6",0x7F55],
- ["F9D7",0x7FF0],
- ["F9D8",0x9591],
- ["F9D9",0x9592],
- ["F9DA",0x9650],
- ["F9DB",0x97D3],
- ["F9DC",0x5272],
- ["F9DD",0x8F44],
- ["F9DE",0x51FD],
- ["F9DF",0x542B],
- ["F9E0",0x54B8],
- ["F9E1",0x5563],
- ["F9E2",0x558A],
- ["F9E3",0x6ABB],
- ["F9E4",0x6DB5],
- ["F9E5",0x7DD8],
- ["F9E6",0x8266],
- ["F9E7",0x929C],
- ["F9E8",0x9677],
- ["F9E9",0x9E79],
- ["F9EA",0x5408],
- ["F9EB",0x54C8],
- ["F9EC",0x76D2],
- ["F9ED",0x86E4],
- ["F9EE",0x95A4],
- ["F9EF",0x95D4],
- ["F9F0",0x965C],
- ["F9F1",0x4EA2],
- ["F9F2",0x4F09],
- ["F9F3",0x59EE],
- ["F9F4",0x5AE6],
- ["F9F5",0x5DF7],
- ["F9F6",0x6052],
- ["F9F7",0x6297],
- ["F9F8",0x676D],
- ["F9F9",0x6841],
- ["F9FA",0x6C86],
- ["F9FB",0x6E2F],
- ["F9FC",0x7F38],
- ["F9FD",0x809B],
- ["F9FE",0x822A],
- ["FAA1",0xFA08],
- ["FAA2",0xFA09],
- ["FAA3",0x9805],
- ["FAA4",0x4EA5],
- ["FAA5",0x5055],
- ["FAA6",0x54B3],
- ["FAA7",0x5793],
- ["FAA8",0x595A],
- ["FAA9",0x5B69],
- ["FAAA",0x5BB3],
- ["FAAB",0x61C8],
- ["FAAC",0x6977],
- ["FAAD",0x6D77],
- ["FAAE",0x7023],
- ["FAAF",0x87F9],
- ["FAB0",0x89E3],
- ["FAB1",0x8A72],
- ["FAB2",0x8AE7],
- ["FAB3",0x9082],
- ["FAB4",0x99ED],
- ["FAB5",0x9AB8],
- ["FAB6",0x52BE],
- ["FAB7",0x6838],
- ["FAB8",0x5016],
- ["FAB9",0x5E78],
- ["FABA",0x674F],
- ["FABB",0x8347],
- ["FABC",0x884C],
- ["FABD",0x4EAB],
- ["FABE",0x5411],
- ["FABF",0x56AE],
- ["FAC0",0x73E6],
- ["FAC1",0x9115],
- ["FAC2",0x97FF],
- ["FAC3",0x9909],
- ["FAC4",0x9957],
- ["FAC5",0x9999],
- ["FAC6",0x5653],
- ["FAC7",0x589F],
- ["FAC8",0x865B],
- ["FAC9",0x8A31],
- ["FACA",0x61B2],
- ["FACB",0x6AF6],
- ["FACC",0x737B],
- ["FACD",0x8ED2],
- ["FACE",0x6B47],
- ["FACF",0x96AA],
- ["FAD0",0x9A57],
- ["FAD1",0x5955],
- ["FAD2",0x7200],
- ["FAD3",0x8D6B],
- ["FAD4",0x9769],
- ["FAD5",0x4FD4],
- ["FAD6",0x5CF4],
- ["FAD7",0x5F26],
- ["FAD8",0x61F8],
- ["FAD9",0x665B],
- ["FADA",0x6CEB],
- ["FADB",0x70AB],
- ["FADC",0x7384],
- ["FADD",0x73B9],
- ["FADE",0x73FE],
- ["FADF",0x7729],
- ["FAE0",0x774D],
- ["FAE1",0x7D43],
- ["FAE2",0x7D62],
- ["FAE3",0x7E23],
- ["FAE4",0x8237],
- ["FAE5",0x8852],
- ["FAE6",0xFA0A],
- ["FAE7",0x8CE2],
- ["FAE8",0x9249],
- ["FAE9",0x986F],
- ["FAEA",0x5B51],
- ["FAEB",0x7A74],
- ["FAEC",0x8840],
- ["FAED",0x9801],
- ["FAEE",0x5ACC],
- ["FAEF",0x4FE0],
- ["FAF0",0x5354],
- ["FAF1",0x593E],
- ["FAF2",0x5CFD],
- ["FAF3",0x633E],
- ["FAF4",0x6D79],
- ["FAF5",0x72F9],
- ["FAF6",0x8105],
- ["FAF7",0x8107],
- ["FAF8",0x83A2],
- ["FAF9",0x92CF],
- ["FAFA",0x9830],
- ["FAFB",0x4EA8],
- ["FAFC",0x5144],
- ["FAFD",0x5211],
- ["FAFE",0x578B],
- ["FBA1",0x5F62],
- ["FBA2",0x6CC2],
- ["FBA3",0x6ECE],
- ["FBA4",0x7005],
- ["FBA5",0x7050],
- ["FBA6",0x70AF],
- ["FBA7",0x7192],
- ["FBA8",0x73E9],
- ["FBA9",0x7469],
- ["FBAA",0x834A],
- ["FBAB",0x87A2],
- ["FBAC",0x8861],
- ["FBAD",0x9008],
- ["FBAE",0x90A2],
- ["FBAF",0x93A3],
- ["FBB0",0x99A8],
- ["FBB1",0x516E],
- ["FBB2",0x5F57],
- ["FBB3",0x60E0],
- ["FBB4",0x6167],
- ["FBB5",0x66B3],
- ["FBB6",0x8559],
- ["FBB7",0x8E4A],
- ["FBB8",0x91AF],
- ["FBB9",0x978B],
- ["FBBA",0x4E4E],
- ["FBBB",0x4E92],
- ["FBBC",0x547C],
- ["FBBD",0x58D5],
- ["FBBE",0x58FA],
- ["FBBF",0x597D],
- ["FBC0",0x5CB5],
- ["FBC1",0x5F27],
- ["FBC2",0x6236],
- ["FBC3",0x6248],
- ["FBC4",0x660A],
- ["FBC5",0x6667],
- ["FBC6",0x6BEB],
- ["FBC7",0x6D69],
- ["FBC8",0x6DCF],
- ["FBC9",0x6E56],
- ["FBCA",0x6EF8],
- ["FBCB",0x6F94],
- ["FBCC",0x6FE0],
- ["FBCD",0x6FE9],
- ["FBCE",0x705D],
- ["FBCF",0x72D0],
- ["FBD0",0x7425],
- ["FBD1",0x745A],
- ["FBD2",0x74E0],
- ["FBD3",0x7693],
- ["FBD4",0x795C],
- ["FBD5",0x7CCA],
- ["FBD6",0x7E1E],
- ["FBD7",0x80E1],
- ["FBD8",0x82A6],
- ["FBD9",0x846B],
- ["FBDA",0x84BF],
- ["FBDB",0x864E],
- ["FBDC",0x865F],
- ["FBDD",0x8774],
- ["FBDE",0x8B77],
- ["FBDF",0x8C6A],
- ["FBE0",0x93AC],
- ["FBE1",0x9800],
- ["FBE2",0x9865],
- ["FBE3",0x60D1],
- ["FBE4",0x6216],
- ["FBE5",0x9177],
- ["FBE6",0x5A5A],
- ["FBE7",0x660F],
- ["FBE8",0x6DF7],
- ["FBE9",0x6E3E],
- ["FBEA",0x743F],
- ["FBEB",0x9B42],
- ["FBEC",0x5FFD],
- ["FBED",0x60DA],
- ["FBEE",0x7B0F],
- ["FBEF",0x54C4],
- ["FBF0",0x5F18],
- ["FBF1",0x6C5E],
- ["FBF2",0x6CD3],
- ["FBF3",0x6D2A],
- ["FBF4",0x70D8],
- ["FBF5",0x7D05],
- ["FBF6",0x8679],
- ["FBF7",0x8A0C],
- ["FBF8",0x9D3B],
- ["FBF9",0x5316],
- ["FBFA",0x548C],
- ["FBFB",0x5B05],
- ["FBFC",0x6A3A],
- ["FBFD",0x706B],
- ["FBFE",0x7575],
- ["FCA1",0x798D],
- ["FCA2",0x79BE],
- ["FCA3",0x82B1],
- ["FCA4",0x83EF],
- ["FCA5",0x8A71],
- ["FCA6",0x8B41],
- ["FCA7",0x8CA8],
- ["FCA8",0x9774],
- ["FCA9",0xFA0B],
- ["FCAA",0x64F4],
- ["FCAB",0x652B],
- ["FCAC",0x78BA],
- ["FCAD",0x78BB],
- ["FCAE",0x7A6B],
- ["FCAF",0x4E38],
- ["FCB0",0x559A],
- ["FCB1",0x5950],
- ["FCB2",0x5BA6],
- ["FCB3",0x5E7B],
- ["FCB4",0x60A3],
- ["FCB5",0x63DB],
- ["FCB6",0x6B61],
- ["FCB7",0x6665],
- ["FCB8",0x6853],
- ["FCB9",0x6E19],
- ["FCBA",0x7165],
- ["FCBB",0x74B0],
- ["FCBC",0x7D08],
- ["FCBD",0x9084],
- ["FCBE",0x9A69],
- ["FCBF",0x9C25],
- ["FCC0",0x6D3B],
- ["FCC1",0x6ED1],
- ["FCC2",0x733E],
- ["FCC3",0x8C41],
- ["FCC4",0x95CA],
- ["FCC5",0x51F0],
- ["FCC6",0x5E4C],
- ["FCC7",0x5FA8],
- ["FCC8",0x604D],
- ["FCC9",0x60F6],
- ["FCCA",0x6130],
- ["FCCB",0x614C],
- ["FCCC",0x6643],
- ["FCCD",0x6644],
- ["FCCE",0x69A5],
- ["FCCF",0x6CC1],
- ["FCD0",0x6E5F],
- ["FCD1",0x6EC9],
- ["FCD2",0x6F62],
- ["FCD3",0x714C],
- ["FCD4",0x749C],
- ["FCD5",0x7687],
- ["FCD6",0x7BC1],
- ["FCD7",0x7C27],
- ["FCD8",0x8352],
- ["FCD9",0x8757],
- ["FCDA",0x9051],
- ["FCDB",0x968D],
- ["FCDC",0x9EC3],
- ["FCDD",0x532F],
- ["FCDE",0x56DE],
- ["FCDF",0x5EFB],
- ["FCE0",0x5F8A],
- ["FCE1",0x6062],
- ["FCE2",0x6094],
- ["FCE3",0x61F7],
- ["FCE4",0x6666],
- ["FCE5",0x6703],
- ["FCE6",0x6A9C],
- ["FCE7",0x6DEE],
- ["FCE8",0x6FAE],
- ["FCE9",0x7070],
- ["FCEA",0x736A],
- ["FCEB",0x7E6A],
- ["FCEC",0x81BE],
- ["FCED",0x8334],
- ["FCEE",0x86D4],
- ["FCEF",0x8AA8],
- ["FCF0",0x8CC4],
- ["FCF1",0x5283],
- ["FCF2",0x7372],
- ["FCF3",0x5B96],
- ["FCF4",0x6A6B],
- ["FCF5",0x9404],
- ["FCF6",0x54EE],
- ["FCF7",0x5686],
- ["FCF8",0x5B5D],
- ["FCF9",0x6548],
- ["FCFA",0x6585],
- ["FCFB",0x66C9],
- ["FCFC",0x689F],
- ["FCFD",0x6D8D],
- ["FCFE",0x6DC6],
- ["FDA1",0x723B],
- ["FDA2",0x80B4],
- ["FDA3",0x9175],
- ["FDA4",0x9A4D],
- ["FDA5",0x4FAF],
- ["FDA6",0x5019],
- ["FDA7",0x539A],
- ["FDA8",0x540E],
- ["FDA9",0x543C],
- ["FDAA",0x5589],
- ["FDAB",0x55C5],
- ["FDAC",0x5E3F],
- ["FDAD",0x5F8C],
- ["FDAE",0x673D],
- ["FDAF",0x7166],
- ["FDB0",0x73DD],
- ["FDB1",0x9005],
- ["FDB2",0x52DB],
- ["FDB3",0x52F3],
- ["FDB4",0x5864],
- ["FDB5",0x58CE],
- ["FDB6",0x7104],
- ["FDB7",0x718F],
- ["FDB8",0x71FB],
- ["FDB9",0x85B0],
- ["FDBA",0x8A13],
- ["FDBB",0x6688],
- ["FDBC",0x85A8],
- ["FDBD",0x55A7],
- ["FDBE",0x6684],
- ["FDBF",0x714A],
- ["FDC0",0x8431],
- ["FDC1",0x5349],
- ["FDC2",0x5599],
- ["FDC3",0x6BC1],
- ["FDC4",0x5F59],
- ["FDC5",0x5FBD],
- ["FDC6",0x63EE],
- ["FDC7",0x6689],
- ["FDC8",0x7147],
- ["FDC9",0x8AF1],
- ["FDCA",0x8F1D],
- ["FDCB",0x9EBE],
- ["FDCC",0x4F11],
- ["FDCD",0x643A],
- ["FDCE",0x70CB],
- ["FDCF",0x7566],
- ["FDD0",0x8667],
- ["FDD1",0x6064],
- ["FDD2",0x8B4E],
- ["FDD3",0x9DF8],
- ["FDD4",0x5147],
- ["FDD5",0x51F6],
- ["FDD6",0x5308],
- ["FDD7",0x6D36],
- ["FDD8",0x80F8],
- ["FDD9",0x9ED1],
- ["FDDA",0x6615],
- ["FDDB",0x6B23],
- ["FDDC",0x7098],
- ["FDDD",0x75D5],
- ["FDDE",0x5403],
- ["FDDF",0x5C79],
- ["FDE0",0x7D07],
- ["FDE1",0x8A16],
- ["FDE2",0x6B20],
- ["FDE3",0x6B3D],
- ["FDE4",0x6B46],
- ["FDE5",0x5438],
- ["FDE6",0x6070],
- ["FDE7",0x6D3D],
- ["FDE8",0x7FD5],
- ["FDE9",0x8208],
- ["FDEA",0x50D6],
- ["FDEB",0x51DE],
- ["FDEC",0x559C],
- ["FDED",0x566B],
- ["FDEE",0x56CD],
- ["FDEF",0x59EC],
- ["FDF0",0x5B09],
- ["FDF1",0x5E0C],
- ["FDF2",0x6199],
- ["FDF3",0x6198],
- ["FDF4",0x6231],
- ["FDF5",0x665E],
- ["FDF6",0x66E6],
- ["FDF7",0x7199],
- ["FDF8",0x71B9],
- ["FDF9",0x71BA],
- ["FDFA",0x72A7],
- ["FDFB",0x79A7],
- ["FDFC",0x7A00],
- ["FDFD",0x7FB2],
- ["FDFE",0x8A70],
-]
-
-UCS_TO_EUCKR_TBL = EUCKR_TO_UCS_TBL.map {|a,b| [b,a] }
diff --git a/enc/trans/gb18030-tbl.rb b/enc/trans/gb18030-tbl.rb
deleted file mode 100644
index 17a01d8885..0000000000
--- a/enc/trans/gb18030-tbl.rb
+++ /dev/null
@@ -1,63330 +0,0 @@
-GB18030_TO_UCS_TBL = [
- ["81308432",0xA0],
- ["81308433",0xA1],
- ["81308434",0xA2],
- ["81308435",0xA3],
- ["A1E8",0xA4],
- ["81308436",0xA5],
- ["81308437",0xA6],
- ["A1EC",0xA7],
- ["A1A7",0xA8],
- ["81308438",0xA9],
- ["81308439",0xAA],
- ["81308530",0xAB],
- ["81308531",0xAC],
- ["81308532",0xAD],
- ["81308533",0xAE],
- ["81308534",0xAF],
- ["A1E3",0xB0],
- ["A1C0",0xB1],
- ["81308535",0xB2],
- ["81308536",0xB3],
- ["81308537",0xB4],
- ["81308538",0xB5],
- ["81308539",0xB6],
- ["A1A4",0xB7],
- ["81308630",0xB8],
- ["81308631",0xB9],
- ["81308632",0xBA],
- ["81308633",0xBB],
- ["81308634",0xBC],
- ["81308635",0xBD],
- ["81308636",0xBE],
- ["81308637",0xBF],
- ["81308638",0xC0],
- ["81308639",0xC1],
- ["81308730",0xC2],
- ["81308731",0xC3],
- ["81308732",0xC4],
- ["81308733",0xC5],
- ["81308734",0xC6],
- ["81308735",0xC7],
- ["81308736",0xC8],
- ["81308737",0xC9],
- ["81308738",0xCA],
- ["81308739",0xCB],
- ["81308830",0xCC],
- ["81308831",0xCD],
- ["81308832",0xCE],
- ["81308833",0xCF],
- ["81308834",0xD0],
- ["81308835",0xD1],
- ["81308836",0xD2],
- ["81308837",0xD3],
- ["81308838",0xD4],
- ["81308839",0xD5],
- ["81308930",0xD6],
- ["A1C1",0xD7],
- ["81308931",0xD8],
- ["81308932",0xD9],
- ["81308933",0xDA],
- ["81308934",0xDB],
- ["81308935",0xDC],
- ["81308936",0xDD],
- ["81308937",0xDE],
- ["81308938",0xDF],
- ["A8A4",0xE0],
- ["A8A2",0xE1],
- ["81308939",0xE2],
- ["81308A30",0xE3],
- ["81308A31",0xE4],
- ["81308A32",0xE5],
- ["81308A33",0xE6],
- ["81308A34",0xE7],
- ["A8A8",0xE8],
- ["A8A6",0xE9],
- ["A8BA",0xEA],
- ["81308A35",0xEB],
- ["A8AC",0xEC],
- ["A8AA",0xED],
- ["81308A36",0xEE],
- ["81308A37",0xEF],
- ["81308A38",0xF0],
- ["81308A39",0xF1],
- ["A8B0",0xF2],
- ["A8AE",0xF3],
- ["81308B30",0xF4],
- ["81308B31",0xF5],
- ["81308B32",0xF6],
- ["A1C2",0xF7],
- ["81308B33",0xF8],
- ["A8B4",0xF9],
- ["A8B2",0xFA],
- ["81308B34",0xFB],
- ["A8B9",0xFC],
- ["81308B35",0xFD],
- ["81308B36",0xFE],
- ["81308B37",0xFF],
- ["81308B38",0x100],
- ["A8A1",0x101],
- ["81308B39",0x102],
- ["81308C30",0x103],
- ["81308C31",0x104],
- ["81308C32",0x105],
- ["81308C33",0x106],
- ["81308C34",0x107],
- ["81308C35",0x108],
- ["81308C36",0x109],
- ["81308C37",0x10A],
- ["81308C38",0x10B],
- ["81308C39",0x10C],
- ["81308D30",0x10D],
- ["81308D31",0x10E],
- ["81308D32",0x10F],
- ["81308D33",0x110],
- ["81308D34",0x111],
- ["81308D35",0x112],
- ["A8A5",0x113],
- ["81308D36",0x114],
- ["81308D37",0x115],
- ["81308D38",0x116],
- ["81308D39",0x117],
- ["81308E30",0x118],
- ["81308E31",0x119],
- ["81308E32",0x11A],
- ["A8A7",0x11B],
- ["81308E33",0x11C],
- ["81308E34",0x11D],
- ["81308E35",0x11E],
- ["81308E36",0x11F],
- ["81308E37",0x120],
- ["81308E38",0x121],
- ["81308E39",0x122],
- ["81308F30",0x123],
- ["81308F31",0x124],
- ["81308F32",0x125],
- ["81308F33",0x126],
- ["81308F34",0x127],
- ["81308F35",0x128],
- ["81308F36",0x129],
- ["81308F37",0x12A],
- ["A8A9",0x12B],
- ["81308F38",0x12C],
- ["81308F39",0x12D],
- ["81309030",0x12E],
- ["81309031",0x12F],
- ["81309032",0x130],
- ["81309033",0x131],
- ["81309034",0x132],
- ["81309035",0x133],
- ["81309036",0x134],
- ["81309037",0x135],
- ["81309038",0x136],
- ["81309039",0x137],
- ["81309130",0x138],
- ["81309131",0x139],
- ["81309132",0x13A],
- ["81309133",0x13B],
- ["81309134",0x13C],
- ["81309135",0x13D],
- ["81309136",0x13E],
- ["81309137",0x13F],
- ["81309138",0x140],
- ["81309139",0x141],
- ["81309230",0x142],
- ["81309231",0x143],
- ["A8BD",0x144],
- ["81309232",0x145],
- ["81309233",0x146],
- ["81309234",0x147],
- ["A8BE",0x148],
- ["81309235",0x149],
- ["81309236",0x14A],
- ["81309237",0x14B],
- ["81309238",0x14C],
- ["A8AD",0x14D],
- ["81309239",0x14E],
- ["81309330",0x14F],
- ["81309331",0x150],
- ["81309332",0x151],
- ["81309333",0x152],
- ["81309334",0x153],
- ["81309335",0x154],
- ["81309336",0x155],
- ["81309337",0x156],
- ["81309338",0x157],
- ["81309339",0x158],
- ["81309430",0x159],
- ["81309431",0x15A],
- ["81309432",0x15B],
- ["81309433",0x15C],
- ["81309434",0x15D],
- ["81309435",0x15E],
- ["81309436",0x15F],
- ["81309437",0x160],
- ["81309438",0x161],
- ["81309439",0x162],
- ["81309530",0x163],
- ["81309531",0x164],
- ["81309532",0x165],
- ["81309533",0x166],
- ["81309534",0x167],
- ["81309535",0x168],
- ["81309536",0x169],
- ["81309537",0x16A],
- ["A8B1",0x16B],
- ["81309538",0x16C],
- ["81309539",0x16D],
- ["81309630",0x16E],
- ["81309631",0x16F],
- ["81309632",0x170],
- ["81309633",0x171],
- ["81309634",0x172],
- ["81309635",0x173],
- ["81309636",0x174],
- ["81309637",0x175],
- ["81309638",0x176],
- ["81309639",0x177],
- ["81309730",0x178],
- ["81309731",0x179],
- ["81309732",0x17A],
- ["81309733",0x17B],
- ["81309734",0x17C],
- ["81309735",0x17D],
- ["81309736",0x17E],
- ["81309737",0x17F],
- ["81309738",0x180],
- ["81309739",0x181],
- ["81309830",0x182],
- ["81309831",0x183],
- ["81309832",0x184],
- ["81309833",0x185],
- ["81309834",0x186],
- ["81309835",0x187],
- ["81309836",0x188],
- ["81309837",0x189],
- ["81309838",0x18A],
- ["81309839",0x18B],
- ["81309930",0x18C],
- ["81309931",0x18D],
- ["81309932",0x18E],
- ["81309933",0x18F],
- ["81309934",0x190],
- ["81309935",0x191],
- ["81309936",0x192],
- ["81309937",0x193],
- ["81309938",0x194],
- ["81309939",0x195],
- ["81309A30",0x196],
- ["81309A31",0x197],
- ["81309A32",0x198],
- ["81309A33",0x199],
- ["81309A34",0x19A],
- ["81309A35",0x19B],
- ["81309A36",0x19C],
- ["81309A37",0x19D],
- ["81309A38",0x19E],
- ["81309A39",0x19F],
- ["81309B30",0x1A0],
- ["81309B31",0x1A1],
- ["81309B32",0x1A2],
- ["81309B33",0x1A3],
- ["81309B34",0x1A4],
- ["81309B35",0x1A5],
- ["81309B36",0x1A6],
- ["81309B37",0x1A7],
- ["81309B38",0x1A8],
- ["81309B39",0x1A9],
- ["81309C30",0x1AA],
- ["81309C31",0x1AB],
- ["81309C32",0x1AC],
- ["81309C33",0x1AD],
- ["81309C34",0x1AE],
- ["81309C35",0x1AF],
- ["81309C36",0x1B0],
- ["81309C37",0x1B1],
- ["81309C38",0x1B2],
- ["81309C39",0x1B3],
- ["81309D30",0x1B4],
- ["81309D31",0x1B5],
- ["81309D32",0x1B6],
- ["81309D33",0x1B7],
- ["81309D34",0x1B8],
- ["81309D35",0x1B9],
- ["81309D36",0x1BA],
- ["81309D37",0x1BB],
- ["81309D38",0x1BC],
- ["81309D39",0x1BD],
- ["81309E30",0x1BE],
- ["81309E31",0x1BF],
- ["81309E32",0x1C0],
- ["81309E33",0x1C1],
- ["81309E34",0x1C2],
- ["81309E35",0x1C3],
- ["81309E36",0x1C4],
- ["81309E37",0x1C5],
- ["81309E38",0x1C6],
- ["81309E39",0x1C7],
- ["81309F30",0x1C8],
- ["81309F31",0x1C9],
- ["81309F32",0x1CA],
- ["81309F33",0x1CB],
- ["81309F34",0x1CC],
- ["81309F35",0x1CD],
- ["A8A3",0x1CE],
- ["81309F36",0x1CF],
- ["A8AB",0x1D0],
- ["81309F37",0x1D1],
- ["A8AF",0x1D2],
- ["81309F38",0x1D3],
- ["A8B3",0x1D4],
- ["81309F39",0x1D5],
- ["A8B5",0x1D6],
- ["8130A030",0x1D7],
- ["A8B6",0x1D8],
- ["8130A031",0x1D9],
- ["A8B7",0x1DA],
- ["8130A032",0x1DB],
- ["A8B8",0x1DC],
- ["8130A033",0x1DD],
- ["8130A034",0x1DE],
- ["8130A035",0x1DF],
- ["8130A036",0x1E0],
- ["8130A037",0x1E1],
- ["8130A038",0x1E2],
- ["8130A039",0x1E3],
- ["8130A130",0x1E4],
- ["8130A131",0x1E5],
- ["8130A132",0x1E6],
- ["8130A133",0x1E7],
- ["8130A134",0x1E8],
- ["8130A135",0x1E9],
- ["8130A136",0x1EA],
- ["8130A137",0x1EB],
- ["8130A138",0x1EC],
- ["8130A139",0x1ED],
- ["8130A230",0x1EE],
- ["8130A231",0x1EF],
- ["8130A232",0x1F0],
- ["8130A233",0x1F1],
- ["8130A234",0x1F2],
- ["8130A235",0x1F3],
- ["8130A236",0x1F4],
- ["8130A237",0x1F5],
- ["8130A238",0x1F6],
- ["8130A239",0x1F7],
- ["8130A330",0x1F8],
- ["A8BF",0x1F9],
- ["8130A331",0x1FA],
- ["8130A332",0x1FB],
- ["8130A333",0x1FC],
- ["8130A334",0x1FD],
- ["8130A335",0x1FE],
- ["8130A336",0x1FF],
- ["8130A337",0x200],
- ["8130A338",0x201],
- ["8130A339",0x202],
- ["8130A430",0x203],
- ["8130A431",0x204],
- ["8130A432",0x205],
- ["8130A433",0x206],
- ["8130A434",0x207],
- ["8130A435",0x208],
- ["8130A436",0x209],
- ["8130A437",0x20A],
- ["8130A438",0x20B],
- ["8130A439",0x20C],
- ["8130A530",0x20D],
- ["8130A531",0x20E],
- ["8130A532",0x20F],
- ["8130A533",0x210],
- ["8130A534",0x211],
- ["8130A535",0x212],
- ["8130A536",0x213],
- ["8130A537",0x214],
- ["8130A538",0x215],
- ["8130A539",0x216],
- ["8130A630",0x217],
- ["8130A631",0x218],
- ["8130A632",0x219],
- ["8130A633",0x21A],
- ["8130A634",0x21B],
- ["8130A635",0x21C],
- ["8130A636",0x21D],
- ["8130A637",0x21E],
- ["8130A638",0x21F],
- ["8130A639",0x220],
- ["8130A730",0x221],
- ["8130A731",0x222],
- ["8130A732",0x223],
- ["8130A733",0x224],
- ["8130A734",0x225],
- ["8130A735",0x226],
- ["8130A736",0x227],
- ["8130A737",0x228],
- ["8130A738",0x229],
- ["8130A739",0x22A],
- ["8130A830",0x22B],
- ["8130A831",0x22C],
- ["8130A832",0x22D],
- ["8130A833",0x22E],
- ["8130A834",0x22F],
- ["8130A835",0x230],
- ["8130A836",0x231],
- ["8130A837",0x232],
- ["8130A838",0x233],
- ["8130A839",0x234],
- ["8130A930",0x235],
- ["8130A931",0x236],
- ["8130A932",0x237],
- ["8130A933",0x238],
- ["8130A934",0x239],
- ["8130A935",0x23A],
- ["8130A936",0x23B],
- ["8130A937",0x23C],
- ["8130A938",0x23D],
- ["8130A939",0x23E],
- ["8130AA30",0x23F],
- ["8130AA31",0x240],
- ["8130AA32",0x241],
- ["8130AA33",0x242],
- ["8130AA34",0x243],
- ["8130AA35",0x244],
- ["8130AA36",0x245],
- ["8130AA37",0x246],
- ["8130AA38",0x247],
- ["8130AA39",0x248],
- ["8130AB30",0x249],
- ["8130AB31",0x24A],
- ["8130AB32",0x24B],
- ["8130AB33",0x24C],
- ["8130AB34",0x24D],
- ["8130AB35",0x24E],
- ["8130AB36",0x24F],
- ["8130AB37",0x250],
- ["A8BB",0x251],
- ["8130AB38",0x252],
- ["8130AB39",0x253],
- ["8130AC30",0x254],
- ["8130AC31",0x255],
- ["8130AC32",0x256],
- ["8130AC33",0x257],
- ["8130AC34",0x258],
- ["8130AC35",0x259],
- ["8130AC36",0x25A],
- ["8130AC37",0x25B],
- ["8130AC38",0x25C],
- ["8130AC39",0x25D],
- ["8130AD30",0x25E],
- ["8130AD31",0x25F],
- ["8130AD32",0x260],
- ["A8C0",0x261],
- ["8130AD33",0x262],
- ["8130AD34",0x263],
- ["8130AD35",0x264],
- ["8130AD36",0x265],
- ["8130AD37",0x266],
- ["8130AD38",0x267],
- ["8130AD39",0x268],
- ["8130AE30",0x269],
- ["8130AE31",0x26A],
- ["8130AE32",0x26B],
- ["8130AE33",0x26C],
- ["8130AE34",0x26D],
- ["8130AE35",0x26E],
- ["8130AE36",0x26F],
- ["8130AE37",0x270],
- ["8130AE38",0x271],
- ["8130AE39",0x272],
- ["8130AF30",0x273],
- ["8130AF31",0x274],
- ["8130AF32",0x275],
- ["8130AF33",0x276],
- ["8130AF34",0x277],
- ["8130AF35",0x278],
- ["8130AF36",0x279],
- ["8130AF37",0x27A],
- ["8130AF38",0x27B],
- ["8130AF39",0x27C],
- ["8130B030",0x27D],
- ["8130B031",0x27E],
- ["8130B032",0x27F],
- ["8130B033",0x280],
- ["8130B034",0x281],
- ["8130B035",0x282],
- ["8130B036",0x283],
- ["8130B037",0x284],
- ["8130B038",0x285],
- ["8130B039",0x286],
- ["8130B130",0x287],
- ["8130B131",0x288],
- ["8130B132",0x289],
- ["8130B133",0x28A],
- ["8130B134",0x28B],
- ["8130B135",0x28C],
- ["8130B136",0x28D],
- ["8130B137",0x28E],
- ["8130B138",0x28F],
- ["8130B139",0x290],
- ["8130B230",0x291],
- ["8130B231",0x292],
- ["8130B232",0x293],
- ["8130B233",0x294],
- ["8130B234",0x295],
- ["8130B235",0x296],
- ["8130B236",0x297],
- ["8130B237",0x298],
- ["8130B238",0x299],
- ["8130B239",0x29A],
- ["8130B330",0x29B],
- ["8130B331",0x29C],
- ["8130B332",0x29D],
- ["8130B333",0x29E],
- ["8130B334",0x29F],
- ["8130B335",0x2A0],
- ["8130B336",0x2A1],
- ["8130B337",0x2A2],
- ["8130B338",0x2A3],
- ["8130B339",0x2A4],
- ["8130B430",0x2A5],
- ["8130B431",0x2A6],
- ["8130B432",0x2A7],
- ["8130B433",0x2A8],
- ["8130B434",0x2A9],
- ["8130B435",0x2AA],
- ["8130B436",0x2AB],
- ["8130B437",0x2AC],
- ["8130B438",0x2AD],
- ["8130B439",0x2AE],
- ["8130B530",0x2AF],
- ["8130B531",0x2B0],
- ["8130B532",0x2B1],
- ["8130B533",0x2B2],
- ["8130B534",0x2B3],
- ["8130B535",0x2B4],
- ["8130B536",0x2B5],
- ["8130B537",0x2B6],
- ["8130B538",0x2B7],
- ["8130B539",0x2B8],
- ["8130B630",0x2B9],
- ["8130B631",0x2BA],
- ["8130B632",0x2BB],
- ["8130B633",0x2BC],
- ["8130B634",0x2BD],
- ["8130B635",0x2BE],
- ["8130B636",0x2BF],
- ["8130B637",0x2C0],
- ["8130B638",0x2C1],
- ["8130B639",0x2C2],
- ["8130B730",0x2C3],
- ["8130B731",0x2C4],
- ["8130B732",0x2C5],
- ["8130B733",0x2C6],
- ["A1A6",0x2C7],
- ["8130B734",0x2C8],
- ["A1A5",0x2C9],
- ["A840",0x2CA],
- ["A841",0x2CB],
- ["8130B735",0x2CC],
- ["8130B736",0x2CD],
- ["8130B737",0x2CE],
- ["8130B738",0x2CF],
- ["8130B739",0x2D0],
- ["8130B830",0x2D1],
- ["8130B831",0x2D2],
- ["8130B832",0x2D3],
- ["8130B833",0x2D4],
- ["8130B834",0x2D5],
- ["8130B835",0x2D6],
- ["8130B836",0x2D7],
- ["8130B837",0x2D8],
- ["A842",0x2D9],
- ["8130B838",0x2DA],
- ["8130B839",0x2DB],
- ["8130B930",0x2DC],
- ["8130B931",0x2DD],
- ["8130B932",0x2DE],
- ["8130B933",0x2DF],
- ["8130B934",0x2E0],
- ["8130B935",0x2E1],
- ["8130B936",0x2E2],
- ["8130B937",0x2E3],
- ["8130B938",0x2E4],
- ["8130B939",0x2E5],
- ["8130BA30",0x2E6],
- ["8130BA31",0x2E7],
- ["8130BA32",0x2E8],
- ["8130BA33",0x2E9],
- ["8130BA34",0x2EA],
- ["8130BA35",0x2EB],
- ["8130BA36",0x2EC],
- ["8130BA37",0x2ED],
- ["8130BA38",0x2EE],
- ["8130BA39",0x2EF],
- ["8130BB30",0x2F0],
- ["8130BB31",0x2F1],
- ["8130BB32",0x2F2],
- ["8130BB33",0x2F3],
- ["8130BB34",0x2F4],
- ["8130BB35",0x2F5],
- ["8130BB36",0x2F6],
- ["8130BB37",0x2F7],
- ["8130BB38",0x2F8],
- ["8130BB39",0x2F9],
- ["8130BC30",0x2FA],
- ["8130BC31",0x2FB],
- ["8130BC32",0x2FC],
- ["8130BC33",0x2FD],
- ["8130BC34",0x2FE],
- ["8130BC35",0x2FF],
- ["8130BC36",0x300],
- ["8130BC37",0x301],
- ["8130BC38",0x302],
- ["8130BC39",0x303],
- ["8130BD30",0x304],
- ["8130BD31",0x305],
- ["8130BD32",0x306],
- ["8130BD33",0x307],
- ["8130BD34",0x308],
- ["8130BD35",0x309],
- ["8130BD36",0x30A],
- ["8130BD37",0x30B],
- ["8130BD38",0x30C],
- ["8130BD39",0x30D],
- ["8130BE30",0x30E],
- ["8130BE31",0x30F],
- ["8130BE32",0x310],
- ["8130BE33",0x311],
- ["8130BE34",0x312],
- ["8130BE35",0x313],
- ["8130BE36",0x314],
- ["8130BE37",0x315],
- ["8130BE38",0x316],
- ["8130BE39",0x317],
- ["8130BF30",0x318],
- ["8130BF31",0x319],
- ["8130BF32",0x31A],
- ["8130BF33",0x31B],
- ["8130BF34",0x31C],
- ["8130BF35",0x31D],
- ["8130BF36",0x31E],
- ["8130BF37",0x31F],
- ["8130BF38",0x320],
- ["8130BF39",0x321],
- ["8130C030",0x322],
- ["8130C031",0x323],
- ["8130C032",0x324],
- ["8130C033",0x325],
- ["8130C034",0x326],
- ["8130C035",0x327],
- ["8130C036",0x328],
- ["8130C037",0x329],
- ["8130C038",0x32A],
- ["8130C039",0x32B],
- ["8130C130",0x32C],
- ["8130C131",0x32D],
- ["8130C132",0x32E],
- ["8130C133",0x32F],
- ["8130C134",0x330],
- ["8130C135",0x331],
- ["8130C136",0x332],
- ["8130C137",0x333],
- ["8130C138",0x334],
- ["8130C139",0x335],
- ["8130C230",0x336],
- ["8130C231",0x337],
- ["8130C232",0x338],
- ["8130C233",0x339],
- ["8130C234",0x33A],
- ["8130C235",0x33B],
- ["8130C236",0x33C],
- ["8130C237",0x33D],
- ["8130C238",0x33E],
- ["8130C239",0x33F],
- ["8130C330",0x340],
- ["8130C331",0x341],
- ["8130C332",0x342],
- ["8130C333",0x343],
- ["8130C334",0x344],
- ["8130C335",0x345],
- ["8130C336",0x346],
- ["8130C337",0x347],
- ["8130C338",0x348],
- ["8130C339",0x349],
- ["8130C430",0x34A],
- ["8130C431",0x34B],
- ["8130C432",0x34C],
- ["8130C433",0x34D],
- ["8130C434",0x34E],
- ["8130C435",0x34F],
- ["8130C436",0x350],
- ["8130C437",0x351],
- ["8130C438",0x352],
- ["8130C439",0x353],
- ["8130C530",0x354],
- ["8130C531",0x355],
- ["8130C532",0x356],
- ["8130C533",0x357],
- ["8130C534",0x358],
- ["8130C535",0x359],
- ["8130C536",0x35A],
- ["8130C537",0x35B],
- ["8130C538",0x35C],
- ["8130C539",0x35D],
- ["8130C630",0x35E],
- ["8130C631",0x35F],
- ["8130C632",0x360],
- ["8130C633",0x361],
- ["8130C634",0x362],
- ["8130C635",0x363],
- ["8130C636",0x364],
- ["8130C637",0x365],
- ["8130C638",0x366],
- ["8130C639",0x367],
- ["8130C730",0x368],
- ["8130C731",0x369],
- ["8130C732",0x36A],
- ["8130C733",0x36B],
- ["8130C734",0x36C],
- ["8130C735",0x36D],
- ["8130C736",0x36E],
- ["8130C737",0x36F],
- ["8130C738",0x370],
- ["8130C739",0x371],
- ["8130C830",0x372],
- ["8130C831",0x373],
- ["8130C832",0x374],
- ["8130C833",0x375],
- ["8130C834",0x376],
- ["8130C835",0x377],
- ["8130C836",0x378],
- ["8130C837",0x379],
- ["8130C838",0x37A],
- ["8130C839",0x37B],
- ["8130C930",0x37C],
- ["8130C931",0x37D],
- ["8130C932",0x37E],
- ["8130C933",0x37F],
- ["8130C934",0x380],
- ["8130C935",0x381],
- ["8130C936",0x382],
- ["8130C937",0x383],
- ["8130C938",0x384],
- ["8130C939",0x385],
- ["8130CA30",0x386],
- ["8130CA31",0x387],
- ["8130CA32",0x388],
- ["8130CA33",0x389],
- ["8130CA34",0x38A],
- ["8130CA35",0x38B],
- ["8130CA36",0x38C],
- ["8130CA37",0x38D],
- ["8130CA38",0x38E],
- ["8130CA39",0x38F],
- ["8130CB30",0x390],
- ["A6A1",0x391],
- ["A6A2",0x392],
- ["A6A3",0x393],
- ["A6A4",0x394],
- ["A6A5",0x395],
- ["A6A6",0x396],
- ["A6A7",0x397],
- ["A6A8",0x398],
- ["A6A9",0x399],
- ["A6AA",0x39A],
- ["A6AB",0x39B],
- ["A6AC",0x39C],
- ["A6AD",0x39D],
- ["A6AE",0x39E],
- ["A6AF",0x39F],
- ["A6B0",0x3A0],
- ["A6B1",0x3A1],
- ["8130CB31",0x3A2],
- ["A6B2",0x3A3],
- ["A6B3",0x3A4],
- ["A6B4",0x3A5],
- ["A6B5",0x3A6],
- ["A6B6",0x3A7],
- ["A6B7",0x3A8],
- ["A6B8",0x3A9],
- ["8130CB32",0x3AA],
- ["8130CB33",0x3AB],
- ["8130CB34",0x3AC],
- ["8130CB35",0x3AD],
- ["8130CB36",0x3AE],
- ["8130CB37",0x3AF],
- ["8130CB38",0x3B0],
- ["A6C1",0x3B1],
- ["A6C2",0x3B2],
- ["A6C3",0x3B3],
- ["A6C4",0x3B4],
- ["A6C5",0x3B5],
- ["A6C6",0x3B6],
- ["A6C7",0x3B7],
- ["A6C8",0x3B8],
- ["A6C9",0x3B9],
- ["A6CA",0x3BA],
- ["A6CB",0x3BB],
- ["A6CC",0x3BC],
- ["A6CD",0x3BD],
- ["A6CE",0x3BE],
- ["A6CF",0x3BF],
- ["A6D0",0x3C0],
- ["A6D1",0x3C1],
- ["8130CB39",0x3C2],
- ["A6D2",0x3C3],
- ["A6D3",0x3C4],
- ["A6D4",0x3C5],
- ["A6D5",0x3C6],
- ["A6D6",0x3C7],
- ["A6D7",0x3C8],
- ["A6D8",0x3C9],
- ["8130CC30",0x3CA],
- ["8130CC31",0x3CB],
- ["8130CC32",0x3CC],
- ["8130CC33",0x3CD],
- ["8130CC34",0x3CE],
- ["8130CC35",0x3CF],
- ["8130CC36",0x3D0],
- ["8130CC37",0x3D1],
- ["8130CC38",0x3D2],
- ["8130CC39",0x3D3],
- ["8130CD30",0x3D4],
- ["8130CD31",0x3D5],
- ["8130CD32",0x3D6],
- ["8130CD33",0x3D7],
- ["8130CD34",0x3D8],
- ["8130CD35",0x3D9],
- ["8130CD36",0x3DA],
- ["8130CD37",0x3DB],
- ["8130CD38",0x3DC],
- ["8130CD39",0x3DD],
- ["8130CE30",0x3DE],
- ["8130CE31",0x3DF],
- ["8130CE32",0x3E0],
- ["8130CE33",0x3E1],
- ["8130CE34",0x3E2],
- ["8130CE35",0x3E3],
- ["8130CE36",0x3E4],
- ["8130CE37",0x3E5],
- ["8130CE38",0x3E6],
- ["8130CE39",0x3E7],
- ["8130CF30",0x3E8],
- ["8130CF31",0x3E9],
- ["8130CF32",0x3EA],
- ["8130CF33",0x3EB],
- ["8130CF34",0x3EC],
- ["8130CF35",0x3ED],
- ["8130CF36",0x3EE],
- ["8130CF37",0x3EF],
- ["8130CF38",0x3F0],
- ["8130CF39",0x3F1],
- ["8130D030",0x3F2],
- ["8130D031",0x3F3],
- ["8130D032",0x3F4],
- ["8130D033",0x3F5],
- ["8130D034",0x3F6],
- ["8130D035",0x3F7],
- ["8130D036",0x3F8],
- ["8130D037",0x3F9],
- ["8130D038",0x3FA],
- ["8130D039",0x3FB],
- ["8130D130",0x3FC],
- ["8130D131",0x3FD],
- ["8130D132",0x3FE],
- ["8130D133",0x3FF],
- ["8130D134",0x400],
- ["A7A7",0x401],
- ["8130D135",0x402],
- ["8130D136",0x403],
- ["8130D137",0x404],
- ["8130D138",0x405],
- ["8130D139",0x406],
- ["8130D230",0x407],
- ["8130D231",0x408],
- ["8130D232",0x409],
- ["8130D233",0x40A],
- ["8130D234",0x40B],
- ["8130D235",0x40C],
- ["8130D236",0x40D],
- ["8130D237",0x40E],
- ["8130D238",0x40F],
- ["A7A1",0x410],
- ["A7A2",0x411],
- ["A7A3",0x412],
- ["A7A4",0x413],
- ["A7A5",0x414],
- ["A7A6",0x415],
- ["A7A8",0x416],
- ["A7A9",0x417],
- ["A7AA",0x418],
- ["A7AB",0x419],
- ["A7AC",0x41A],
- ["A7AD",0x41B],
- ["A7AE",0x41C],
- ["A7AF",0x41D],
- ["A7B0",0x41E],
- ["A7B1",0x41F],
- ["A7B2",0x420],
- ["A7B3",0x421],
- ["A7B4",0x422],
- ["A7B5",0x423],
- ["A7B6",0x424],
- ["A7B7",0x425],
- ["A7B8",0x426],
- ["A7B9",0x427],
- ["A7BA",0x428],
- ["A7BB",0x429],
- ["A7BC",0x42A],
- ["A7BD",0x42B],
- ["A7BE",0x42C],
- ["A7BF",0x42D],
- ["A7C0",0x42E],
- ["A7C1",0x42F],
- ["A7D1",0x430],
- ["A7D2",0x431],
- ["A7D3",0x432],
- ["A7D4",0x433],
- ["A7D5",0x434],
- ["A7D6",0x435],
- ["A7D8",0x436],
- ["A7D9",0x437],
- ["A7DA",0x438],
- ["A7DB",0x439],
- ["A7DC",0x43A],
- ["A7DD",0x43B],
- ["A7DE",0x43C],
- ["A7DF",0x43D],
- ["A7E0",0x43E],
- ["A7E1",0x43F],
- ["A7E2",0x440],
- ["A7E3",0x441],
- ["A7E4",0x442],
- ["A7E5",0x443],
- ["A7E6",0x444],
- ["A7E7",0x445],
- ["A7E8",0x446],
- ["A7E9",0x447],
- ["A7EA",0x448],
- ["A7EB",0x449],
- ["A7EC",0x44A],
- ["A7ED",0x44B],
- ["A7EE",0x44C],
- ["A7EF",0x44D],
- ["A7F0",0x44E],
- ["A7F1",0x44F],
- ["8130D239",0x450],
- ["A7D7",0x451],
- ["8130D330",0x452],
- ["8130D331",0x453],
- ["8130D332",0x454],
- ["8130D333",0x455],
- ["8130D334",0x456],
- ["8130D335",0x457],
- ["8130D336",0x458],
- ["8130D337",0x459],
- ["8130D338",0x45A],
- ["8130D339",0x45B],
- ["8130D430",0x45C],
- ["8130D431",0x45D],
- ["8130D432",0x45E],
- ["8130D433",0x45F],
- ["8130D434",0x460],
- ["8130D435",0x461],
- ["8130D436",0x462],
- ["8130D437",0x463],
- ["8130D438",0x464],
- ["8130D439",0x465],
- ["8130D530",0x466],
- ["8130D531",0x467],
- ["8130D532",0x468],
- ["8130D533",0x469],
- ["8130D534",0x46A],
- ["8130D535",0x46B],
- ["8130D536",0x46C],
- ["8130D537",0x46D],
- ["8130D538",0x46E],
- ["8130D539",0x46F],
- ["8130D630",0x470],
- ["8130D631",0x471],
- ["8130D632",0x472],
- ["8130D633",0x473],
- ["8130D634",0x474],
- ["8130D635",0x475],
- ["8130D636",0x476],
- ["8130D637",0x477],
- ["8130D638",0x478],
- ["8130D639",0x479],
- ["8130D730",0x47A],
- ["8130D731",0x47B],
- ["8130D732",0x47C],
- ["8130D733",0x47D],
- ["8130D734",0x47E],
- ["8130D735",0x47F],
- ["8130D736",0x480],
- ["8130D737",0x481],
- ["8130D738",0x482],
- ["8130D739",0x483],
- ["8130D830",0x484],
- ["8130D831",0x485],
- ["8130D832",0x486],
- ["8130D833",0x487],
- ["8130D834",0x488],
- ["8130D835",0x489],
- ["8130D836",0x48A],
- ["8130D837",0x48B],
- ["8130D838",0x48C],
- ["8130D839",0x48D],
- ["8130D930",0x48E],
- ["8130D931",0x48F],
- ["8130D932",0x490],
- ["8130D933",0x491],
- ["8130D934",0x492],
- ["8130D935",0x493],
- ["8130D936",0x494],
- ["8130D937",0x495],
- ["8130D938",0x496],
- ["8130D939",0x497],
- ["8130DA30",0x498],
- ["8130DA31",0x499],
- ["8130DA32",0x49A],
- ["8130DA33",0x49B],
- ["8130DA34",0x49C],
- ["8130DA35",0x49D],
- ["8130DA36",0x49E],
- ["8130DA37",0x49F],
- ["8130DA38",0x4A0],
- ["8130DA39",0x4A1],
- ["8130DB30",0x4A2],
- ["8130DB31",0x4A3],
- ["8130DB32",0x4A4],
- ["8130DB33",0x4A5],
- ["8130DB34",0x4A6],
- ["8130DB35",0x4A7],
- ["8130DB36",0x4A8],
- ["8130DB37",0x4A9],
- ["8130DB38",0x4AA],
- ["8130DB39",0x4AB],
- ["8130DC30",0x4AC],
- ["8130DC31",0x4AD],
- ["8130DC32",0x4AE],
- ["8130DC33",0x4AF],
- ["8130DC34",0x4B0],
- ["8130DC35",0x4B1],
- ["8130DC36",0x4B2],
- ["8130DC37",0x4B3],
- ["8130DC38",0x4B4],
- ["8130DC39",0x4B5],
- ["8130DD30",0x4B6],
- ["8130DD31",0x4B7],
- ["8130DD32",0x4B8],
- ["8130DD33",0x4B9],
- ["8130DD34",0x4BA],
- ["8130DD35",0x4BB],
- ["8130DD36",0x4BC],
- ["8130DD37",0x4BD],
- ["8130DD38",0x4BE],
- ["8130DD39",0x4BF],
- ["8130DE30",0x4C0],
- ["8130DE31",0x4C1],
- ["8130DE32",0x4C2],
- ["8130DE33",0x4C3],
- ["8130DE34",0x4C4],
- ["8130DE35",0x4C5],
- ["8130DE36",0x4C6],
- ["8130DE37",0x4C7],
- ["8130DE38",0x4C8],
- ["8130DE39",0x4C9],
- ["8130DF30",0x4CA],
- ["8130DF31",0x4CB],
- ["8130DF32",0x4CC],
- ["8130DF33",0x4CD],
- ["8130DF34",0x4CE],
- ["8130DF35",0x4CF],
- ["8130DF36",0x4D0],
- ["8130DF37",0x4D1],
- ["8130DF38",0x4D2],
- ["8130DF39",0x4D3],
- ["8130E030",0x4D4],
- ["8130E031",0x4D5],
- ["8130E032",0x4D6],
- ["8130E033",0x4D7],
- ["8130E034",0x4D8],
- ["8130E035",0x4D9],
- ["8130E036",0x4DA],
- ["8130E037",0x4DB],
- ["8130E038",0x4DC],
- ["8130E039",0x4DD],
- ["8130E130",0x4DE],
- ["8130E131",0x4DF],
- ["8130E132",0x4E0],
- ["8130E133",0x4E1],
- ["8130E134",0x4E2],
- ["8130E135",0x4E3],
- ["8130E136",0x4E4],
- ["8130E137",0x4E5],
- ["8130E138",0x4E6],
- ["8130E139",0x4E7],
- ["8130E230",0x4E8],
- ["8130E231",0x4E9],
- ["8130E232",0x4EA],
- ["8130E233",0x4EB],
- ["8130E234",0x4EC],
- ["8130E235",0x4ED],
- ["8130E236",0x4EE],
- ["8130E237",0x4EF],
- ["8130E238",0x4F0],
- ["8130E239",0x4F1],
- ["8130E330",0x4F2],
- ["8130E331",0x4F3],
- ["8130E332",0x4F4],
- ["8130E333",0x4F5],
- ["8130E334",0x4F6],
- ["8130E335",0x4F7],
- ["8130E336",0x4F8],
- ["8130E337",0x4F9],
- ["8130E338",0x4FA],
- ["8130E339",0x4FB],
- ["8130E430",0x4FC],
- ["8130E431",0x4FD],
- ["8130E432",0x4FE],
- ["8130E433",0x4FF],
- ["8130E434",0x500],
- ["8130E435",0x501],
- ["8130E436",0x502],
- ["8130E437",0x503],
- ["8130E438",0x504],
- ["8130E439",0x505],
- ["8130E530",0x506],
- ["8130E531",0x507],
- ["8130E532",0x508],
- ["8130E533",0x509],
- ["8130E534",0x50A],
- ["8130E535",0x50B],
- ["8130E536",0x50C],
- ["8130E537",0x50D],
- ["8130E538",0x50E],
- ["8130E539",0x50F],
- ["8130E630",0x510],
- ["8130E631",0x511],
- ["8130E632",0x512],
- ["8130E633",0x513],
- ["8130E634",0x514],
- ["8130E635",0x515],
- ["8130E636",0x516],
- ["8130E637",0x517],
- ["8130E638",0x518],
- ["8130E639",0x519],
- ["8130E730",0x51A],
- ["8130E731",0x51B],
- ["8130E732",0x51C],
- ["8130E733",0x51D],
- ["8130E734",0x51E],
- ["8130E735",0x51F],
- ["8130E736",0x520],
- ["8130E737",0x521],
- ["8130E738",0x522],
- ["8130E739",0x523],
- ["8130E830",0x524],
- ["8130E831",0x525],
- ["8130E832",0x526],
- ["8130E833",0x527],
- ["8130E834",0x528],
- ["8130E835",0x529],
- ["8130E836",0x52A],
- ["8130E837",0x52B],
- ["8130E838",0x52C],
- ["8130E839",0x52D],
- ["8130E930",0x52E],
- ["8130E931",0x52F],
- ["8130E932",0x530],
- ["8130E933",0x531],
- ["8130E934",0x532],
- ["8130E935",0x533],
- ["8130E936",0x534],
- ["8130E937",0x535],
- ["8130E938",0x536],
- ["8130E939",0x537],
- ["8130EA30",0x538],
- ["8130EA31",0x539],
- ["8130EA32",0x53A],
- ["8130EA33",0x53B],
- ["8130EA34",0x53C],
- ["8130EA35",0x53D],
- ["8130EA36",0x53E],
- ["8130EA37",0x53F],
- ["8130EA38",0x540],
- ["8130EA39",0x541],
- ["8130EB30",0x542],
- ["8130EB31",0x543],
- ["8130EB32",0x544],
- ["8130EB33",0x545],
- ["8130EB34",0x546],
- ["8130EB35",0x547],
- ["8130EB36",0x548],
- ["8130EB37",0x549],
- ["8130EB38",0x54A],
- ["8130EB39",0x54B],
- ["8130EC30",0x54C],
- ["8130EC31",0x54D],
- ["8130EC32",0x54E],
- ["8130EC33",0x54F],
- ["8130EC34",0x550],
- ["8130EC35",0x551],
- ["8130EC36",0x552],
- ["8130EC37",0x553],
- ["8130EC38",0x554],
- ["8130EC39",0x555],
- ["8130ED30",0x556],
- ["8130ED31",0x557],
- ["8130ED32",0x558],
- ["8130ED33",0x559],
- ["8130ED34",0x55A],
- ["8130ED35",0x55B],
- ["8130ED36",0x55C],
- ["8130ED37",0x55D],
- ["8130ED38",0x55E],
- ["8130ED39",0x55F],
- ["8130EE30",0x560],
- ["8130EE31",0x561],
- ["8130EE32",0x562],
- ["8130EE33",0x563],
- ["8130EE34",0x564],
- ["8130EE35",0x565],
- ["8130EE36",0x566],
- ["8130EE37",0x567],
- ["8130EE38",0x568],
- ["8130EE39",0x569],
- ["8130EF30",0x56A],
- ["8130EF31",0x56B],
- ["8130EF32",0x56C],
- ["8130EF33",0x56D],
- ["8130EF34",0x56E],
- ["8130EF35",0x56F],
- ["8130EF36",0x570],
- ["8130EF37",0x571],
- ["8130EF38",0x572],
- ["8130EF39",0x573],
- ["8130F030",0x574],
- ["8130F031",0x575],
- ["8130F032",0x576],
- ["8130F033",0x577],
- ["8130F034",0x578],
- ["8130F035",0x579],
- ["8130F036",0x57A],
- ["8130F037",0x57B],
- ["8130F038",0x57C],
- ["8130F039",0x57D],
- ["8130F130",0x57E],
- ["8130F131",0x57F],
- ["8130F132",0x580],
- ["8130F133",0x581],
- ["8130F134",0x582],
- ["8130F135",0x583],
- ["8130F136",0x584],
- ["8130F137",0x585],
- ["8130F138",0x586],
- ["8130F139",0x587],
- ["8130F230",0x588],
- ["8130F231",0x589],
- ["8130F232",0x58A],
- ["8130F233",0x58B],
- ["8130F234",0x58C],
- ["8130F235",0x58D],
- ["8130F236",0x58E],
- ["8130F237",0x58F],
- ["8130F238",0x590],
- ["8130F239",0x591],
- ["8130F330",0x592],
- ["8130F331",0x593],
- ["8130F332",0x594],
- ["8130F333",0x595],
- ["8130F334",0x596],
- ["8130F335",0x597],
- ["8130F336",0x598],
- ["8130F337",0x599],
- ["8130F338",0x59A],
- ["8130F339",0x59B],
- ["8130F430",0x59C],
- ["8130F431",0x59D],
- ["8130F432",0x59E],
- ["8130F433",0x59F],
- ["8130F434",0x5A0],
- ["8130F435",0x5A1],
- ["8130F436",0x5A2],
- ["8130F437",0x5A3],
- ["8130F438",0x5A4],
- ["8130F439",0x5A5],
- ["8130F530",0x5A6],
- ["8130F531",0x5A7],
- ["8130F532",0x5A8],
- ["8130F533",0x5A9],
- ["8130F534",0x5AA],
- ["8130F535",0x5AB],
- ["8130F536",0x5AC],
- ["8130F537",0x5AD],
- ["8130F538",0x5AE],
- ["8130F539",0x5AF],
- ["8130F630",0x5B0],
- ["8130F631",0x5B1],
- ["8130F632",0x5B2],
- ["8130F633",0x5B3],
- ["8130F634",0x5B4],
- ["8130F635",0x5B5],
- ["8130F636",0x5B6],
- ["8130F637",0x5B7],
- ["8130F638",0x5B8],
- ["8130F639",0x5B9],
- ["8130F730",0x5BA],
- ["8130F731",0x5BB],
- ["8130F732",0x5BC],
- ["8130F733",0x5BD],
- ["8130F734",0x5BE],
- ["8130F735",0x5BF],
- ["8130F736",0x5C0],
- ["8130F737",0x5C1],
- ["8130F738",0x5C2],
- ["8130F739",0x5C3],
- ["8130F830",0x5C4],
- ["8130F831",0x5C5],
- ["8130F832",0x5C6],
- ["8130F833",0x5C7],
- ["8130F834",0x5C8],
- ["8130F835",0x5C9],
- ["8130F836",0x5CA],
- ["8130F837",0x5CB],
- ["8130F838",0x5CC],
- ["8130F839",0x5CD],
- ["8130F930",0x5CE],
- ["8130F931",0x5CF],
- ["8130F932",0x5D0],
- ["8130F933",0x5D1],
- ["8130F934",0x5D2],
- ["8130F935",0x5D3],
- ["8130F936",0x5D4],
- ["8130F937",0x5D5],
- ["8130F938",0x5D6],
- ["8130F939",0x5D7],
- ["8130FA30",0x5D8],
- ["8130FA31",0x5D9],
- ["8130FA32",0x5DA],
- ["8130FA33",0x5DB],
- ["8130FA34",0x5DC],
- ["8130FA35",0x5DD],
- ["8130FA36",0x5DE],
- ["8130FA37",0x5DF],
- ["8130FA38",0x5E0],
- ["8130FA39",0x5E1],
- ["8130FB30",0x5E2],
- ["8130FB31",0x5E3],
- ["8130FB32",0x5E4],
- ["8130FB33",0x5E5],
- ["8130FB34",0x5E6],
- ["8130FB35",0x5E7],
- ["8130FB36",0x5E8],
- ["8130FB37",0x5E9],
- ["8130FB38",0x5EA],
- ["8130FB39",0x5EB],
- ["8130FC30",0x5EC],
- ["8130FC31",0x5ED],
- ["8130FC32",0x5EE],
- ["8130FC33",0x5EF],
- ["8130FC34",0x5F0],
- ["8130FC35",0x5F1],
- ["8130FC36",0x5F2],
- ["8130FC37",0x5F3],
- ["8130FC38",0x5F4],
- ["8130FC39",0x5F5],
- ["8130FD30",0x5F6],
- ["8130FD31",0x5F7],
- ["8130FD32",0x5F8],
- ["8130FD33",0x5F9],
- ["8130FD34",0x5FA],
- ["8130FD35",0x5FB],
- ["8130FD36",0x5FC],
- ["8130FD37",0x5FD],
- ["8130FD38",0x5FE],
- ["8130FD39",0x5FF],
- ["8130FE30",0x600],
- ["8130FE31",0x601],
- ["8130FE32",0x602],
- ["8130FE33",0x603],
- ["8130FE34",0x604],
- ["8130FE35",0x605],
- ["8130FE36",0x606],
- ["8130FE37",0x607],
- ["8130FE38",0x608],
- ["8130FE39",0x609],
- ["81318130",0x60A],
- ["81318131",0x60B],
- ["81318132",0x60C],
- ["81318133",0x60D],
- ["81318134",0x60E],
- ["81318135",0x60F],
- ["81318136",0x610],
- ["81318137",0x611],
- ["81318138",0x612],
- ["81318139",0x613],
- ["81318230",0x614],
- ["81318231",0x615],
- ["81318232",0x616],
- ["81318233",0x617],
- ["81318234",0x618],
- ["81318235",0x619],
- ["81318236",0x61A],
- ["81318237",0x61B],
- ["81318238",0x61C],
- ["81318239",0x61D],
- ["81318330",0x61E],
- ["81318331",0x61F],
- ["81318332",0x620],
- ["81318333",0x621],
- ["81318334",0x622],
- ["81318335",0x623],
- ["81318336",0x624],
- ["81318337",0x625],
- ["81318338",0x626],
- ["81318339",0x627],
- ["81318430",0x628],
- ["81318431",0x629],
- ["81318432",0x62A],
- ["81318433",0x62B],
- ["81318434",0x62C],
- ["81318435",0x62D],
- ["81318436",0x62E],
- ["81318437",0x62F],
- ["81318438",0x630],
- ["81318439",0x631],
- ["81318530",0x632],
- ["81318531",0x633],
- ["81318532",0x634],
- ["81318533",0x635],
- ["81318534",0x636],
- ["81318535",0x637],
- ["81318536",0x638],
- ["81318537",0x639],
- ["81318538",0x63A],
- ["81318539",0x63B],
- ["81318630",0x63C],
- ["81318631",0x63D],
- ["81318632",0x63E],
- ["81318633",0x63F],
- ["81318634",0x640],
- ["81318635",0x641],
- ["81318636",0x642],
- ["81318637",0x643],
- ["81318638",0x644],
- ["81318639",0x645],
- ["81318730",0x646],
- ["81318731",0x647],
- ["81318732",0x648],
- ["81318733",0x649],
- ["81318734",0x64A],
- ["81318735",0x64B],
- ["81318736",0x64C],
- ["81318737",0x64D],
- ["81318738",0x64E],
- ["81318739",0x64F],
- ["81318830",0x650],
- ["81318831",0x651],
- ["81318832",0x652],
- ["81318833",0x653],
- ["81318834",0x654],
- ["81318835",0x655],
- ["81318836",0x656],
- ["81318837",0x657],
- ["81318838",0x658],
- ["81318839",0x659],
- ["81318930",0x65A],
- ["81318931",0x65B],
- ["81318932",0x65C],
- ["81318933",0x65D],
- ["81318934",0x65E],
- ["81318935",0x65F],
- ["81318936",0x660],
- ["81318937",0x661],
- ["81318938",0x662],
- ["81318939",0x663],
- ["81318A30",0x664],
- ["81318A31",0x665],
- ["81318A32",0x666],
- ["81318A33",0x667],
- ["81318A34",0x668],
- ["81318A35",0x669],
- ["81318A36",0x66A],
- ["81318A37",0x66B],
- ["81318A38",0x66C],
- ["81318A39",0x66D],
- ["81318B30",0x66E],
- ["81318B31",0x66F],
- ["81318B32",0x670],
- ["81318B33",0x671],
- ["81318B34",0x672],
- ["81318B35",0x673],
- ["81318B36",0x674],
- ["81318B37",0x675],
- ["81318B38",0x676],
- ["81318B39",0x677],
- ["81318C30",0x678],
- ["81318C31",0x679],
- ["81318C32",0x67A],
- ["81318C33",0x67B],
- ["81318C34",0x67C],
- ["81318C35",0x67D],
- ["81318C36",0x67E],
- ["81318C37",0x67F],
- ["81318C38",0x680],
- ["81318C39",0x681],
- ["81318D30",0x682],
- ["81318D31",0x683],
- ["81318D32",0x684],
- ["81318D33",0x685],
- ["81318D34",0x686],
- ["81318D35",0x687],
- ["81318D36",0x688],
- ["81318D37",0x689],
- ["81318D38",0x68A],
- ["81318D39",0x68B],
- ["81318E30",0x68C],
- ["81318E31",0x68D],
- ["81318E32",0x68E],
- ["81318E33",0x68F],
- ["81318E34",0x690],
- ["81318E35",0x691],
- ["81318E36",0x692],
- ["81318E37",0x693],
- ["81318E38",0x694],
- ["81318E39",0x695],
- ["81318F30",0x696],
- ["81318F31",0x697],
- ["81318F32",0x698],
- ["81318F33",0x699],
- ["81318F34",0x69A],
- ["81318F35",0x69B],
- ["81318F36",0x69C],
- ["81318F37",0x69D],
- ["81318F38",0x69E],
- ["81318F39",0x69F],
- ["81319030",0x6A0],
- ["81319031",0x6A1],
- ["81319032",0x6A2],
- ["81319033",0x6A3],
- ["81319034",0x6A4],
- ["81319035",0x6A5],
- ["81319036",0x6A6],
- ["81319037",0x6A7],
- ["81319038",0x6A8],
- ["81319039",0x6A9],
- ["81319130",0x6AA],
- ["81319131",0x6AB],
- ["81319132",0x6AC],
- ["81319133",0x6AD],
- ["81319134",0x6AE],
- ["81319135",0x6AF],
- ["81319136",0x6B0],
- ["81319137",0x6B1],
- ["81319138",0x6B2],
- ["81319139",0x6B3],
- ["81319230",0x6B4],
- ["81319231",0x6B5],
- ["81319232",0x6B6],
- ["81319233",0x6B7],
- ["81319234",0x6B8],
- ["81319235",0x6B9],
- ["81319236",0x6BA],
- ["81319237",0x6BB],
- ["81319238",0x6BC],
- ["81319239",0x6BD],
- ["81319330",0x6BE],
- ["81319331",0x6BF],
- ["81319332",0x6C0],
- ["81319333",0x6C1],
- ["81319334",0x6C2],
- ["81319335",0x6C3],
- ["81319336",0x6C4],
- ["81319337",0x6C5],
- ["81319338",0x6C6],
- ["81319339",0x6C7],
- ["81319430",0x6C8],
- ["81319431",0x6C9],
- ["81319432",0x6CA],
- ["81319433",0x6CB],
- ["81319434",0x6CC],
- ["81319435",0x6CD],
- ["81319436",0x6CE],
- ["81319437",0x6CF],
- ["81319438",0x6D0],
- ["81319439",0x6D1],
- ["81319530",0x6D2],
- ["81319531",0x6D3],
- ["81319532",0x6D4],
- ["81319533",0x6D5],
- ["81319534",0x6D6],
- ["81319535",0x6D7],
- ["81319536",0x6D8],
- ["81319537",0x6D9],
- ["81319538",0x6DA],
- ["81319539",0x6DB],
- ["81319630",0x6DC],
- ["81319631",0x6DD],
- ["81319632",0x6DE],
- ["81319633",0x6DF],
- ["81319634",0x6E0],
- ["81319635",0x6E1],
- ["81319636",0x6E2],
- ["81319637",0x6E3],
- ["81319638",0x6E4],
- ["81319639",0x6E5],
- ["81319730",0x6E6],
- ["81319731",0x6E7],
- ["81319732",0x6E8],
- ["81319733",0x6E9],
- ["81319734",0x6EA],
- ["81319735",0x6EB],
- ["81319736",0x6EC],
- ["81319737",0x6ED],
- ["81319738",0x6EE],
- ["81319739",0x6EF],
- ["81319830",0x6F0],
- ["81319831",0x6F1],
- ["81319832",0x6F2],
- ["81319833",0x6F3],
- ["81319834",0x6F4],
- ["81319835",0x6F5],
- ["81319836",0x6F6],
- ["81319837",0x6F7],
- ["81319838",0x6F8],
- ["81319839",0x6F9],
- ["81319930",0x6FA],
- ["81319931",0x6FB],
- ["81319932",0x6FC],
- ["81319933",0x6FD],
- ["81319934",0x6FE],
- ["81319935",0x6FF],
- ["81319936",0x700],
- ["81319937",0x701],
- ["81319938",0x702],
- ["81319939",0x703],
- ["81319A30",0x704],
- ["81319A31",0x705],
- ["81319A32",0x706],
- ["81319A33",0x707],
- ["81319A34",0x708],
- ["81319A35",0x709],
- ["81319A36",0x70A],
- ["81319A37",0x70B],
- ["81319A38",0x70C],
- ["81319A39",0x70D],
- ["81319B30",0x70E],
- ["81319B31",0x70F],
- ["81319B32",0x710],
- ["81319B33",0x711],
- ["81319B34",0x712],
- ["81319B35",0x713],
- ["81319B36",0x714],
- ["81319B37",0x715],
- ["81319B38",0x716],
- ["81319B39",0x717],
- ["81319C30",0x718],
- ["81319C31",0x719],
- ["81319C32",0x71A],
- ["81319C33",0x71B],
- ["81319C34",0x71C],
- ["81319C35",0x71D],
- ["81319C36",0x71E],
- ["81319C37",0x71F],
- ["81319C38",0x720],
- ["81319C39",0x721],
- ["81319D30",0x722],
- ["81319D31",0x723],
- ["81319D32",0x724],
- ["81319D33",0x725],
- ["81319D34",0x726],
- ["81319D35",0x727],
- ["81319D36",0x728],
- ["81319D37",0x729],
- ["81319D38",0x72A],
- ["81319D39",0x72B],
- ["81319E30",0x72C],
- ["81319E31",0x72D],
- ["81319E32",0x72E],
- ["81319E33",0x72F],
- ["81319E34",0x730],
- ["81319E35",0x731],
- ["81319E36",0x732],
- ["81319E37",0x733],
- ["81319E38",0x734],
- ["81319E39",0x735],
- ["81319F30",0x736],
- ["81319F31",0x737],
- ["81319F32",0x738],
- ["81319F33",0x739],
- ["81319F34",0x73A],
- ["81319F35",0x73B],
- ["81319F36",0x73C],
- ["81319F37",0x73D],
- ["81319F38",0x73E],
- ["81319F39",0x73F],
- ["8131A030",0x740],
- ["8131A031",0x741],
- ["8131A032",0x742],
- ["8131A033",0x743],
- ["8131A034",0x744],
- ["8131A035",0x745],
- ["8131A036",0x746],
- ["8131A037",0x747],
- ["8131A038",0x748],
- ["8131A039",0x749],
- ["8131A130",0x74A],
- ["8131A131",0x74B],
- ["8131A132",0x74C],
- ["8131A133",0x74D],
- ["8131A134",0x74E],
- ["8131A135",0x74F],
- ["8131A136",0x750],
- ["8131A137",0x751],
- ["8131A138",0x752],
- ["8131A139",0x753],
- ["8131A230",0x754],
- ["8131A231",0x755],
- ["8131A232",0x756],
- ["8131A233",0x757],
- ["8131A234",0x758],
- ["8131A235",0x759],
- ["8131A236",0x75A],
- ["8131A237",0x75B],
- ["8131A238",0x75C],
- ["8131A239",0x75D],
- ["8131A330",0x75E],
- ["8131A331",0x75F],
- ["8131A332",0x760],
- ["8131A333",0x761],
- ["8131A334",0x762],
- ["8131A335",0x763],
- ["8131A336",0x764],
- ["8131A337",0x765],
- ["8131A338",0x766],
- ["8131A339",0x767],
- ["8131A430",0x768],
- ["8131A431",0x769],
- ["8131A432",0x76A],
- ["8131A433",0x76B],
- ["8131A434",0x76C],
- ["8131A435",0x76D],
- ["8131A436",0x76E],
- ["8131A437",0x76F],
- ["8131A438",0x770],
- ["8131A439",0x771],
- ["8131A530",0x772],
- ["8131A531",0x773],
- ["8131A532",0x774],
- ["8131A533",0x775],
- ["8131A534",0x776],
- ["8131A535",0x777],
- ["8131A536",0x778],
- ["8131A537",0x779],
- ["8131A538",0x77A],
- ["8131A539",0x77B],
- ["8131A630",0x77C],
- ["8131A631",0x77D],
- ["8131A632",0x77E],
- ["8131A633",0x77F],
- ["8131A634",0x780],
- ["8131A635",0x781],
- ["8131A636",0x782],
- ["8131A637",0x783],
- ["8131A638",0x784],
- ["8131A639",0x785],
- ["8131A730",0x786],
- ["8131A731",0x787],
- ["8131A732",0x788],
- ["8131A733",0x789],
- ["8131A734",0x78A],
- ["8131A735",0x78B],
- ["8131A736",0x78C],
- ["8131A737",0x78D],
- ["8131A738",0x78E],
- ["8131A739",0x78F],
- ["8131A830",0x790],
- ["8131A831",0x791],
- ["8131A832",0x792],
- ["8131A833",0x793],
- ["8131A834",0x794],
- ["8131A835",0x795],
- ["8131A836",0x796],
- ["8131A837",0x797],
- ["8131A838",0x798],
- ["8131A839",0x799],
- ["8131A930",0x79A],
- ["8131A931",0x79B],
- ["8131A932",0x79C],
- ["8131A933",0x79D],
- ["8131A934",0x79E],
- ["8131A935",0x79F],
- ["8131A936",0x7A0],
- ["8131A937",0x7A1],
- ["8131A938",0x7A2],
- ["8131A939",0x7A3],
- ["8131AA30",0x7A4],
- ["8131AA31",0x7A5],
- ["8131AA32",0x7A6],
- ["8131AA33",0x7A7],
- ["8131AA34",0x7A8],
- ["8131AA35",0x7A9],
- ["8131AA36",0x7AA],
- ["8131AA37",0x7AB],
- ["8131AA38",0x7AC],
- ["8131AA39",0x7AD],
- ["8131AB30",0x7AE],
- ["8131AB31",0x7AF],
- ["8131AB32",0x7B0],
- ["8131AB33",0x7B1],
- ["8131AB34",0x7B2],
- ["8131AB35",0x7B3],
- ["8131AB36",0x7B4],
- ["8131AB37",0x7B5],
- ["8131AB38",0x7B6],
- ["8131AB39",0x7B7],
- ["8131AC30",0x7B8],
- ["8131AC31",0x7B9],
- ["8131AC32",0x7BA],
- ["8131AC33",0x7BB],
- ["8131AC34",0x7BC],
- ["8131AC35",0x7BD],
- ["8131AC36",0x7BE],
- ["8131AC37",0x7BF],
- ["8131AC38",0x7C0],
- ["8131AC39",0x7C1],
- ["8131AD30",0x7C2],
- ["8131AD31",0x7C3],
- ["8131AD32",0x7C4],
- ["8131AD33",0x7C5],
- ["8131AD34",0x7C6],
- ["8131AD35",0x7C7],
- ["8131AD36",0x7C8],
- ["8131AD37",0x7C9],
- ["8131AD38",0x7CA],
- ["8131AD39",0x7CB],
- ["8131AE30",0x7CC],
- ["8131AE31",0x7CD],
- ["8131AE32",0x7CE],
- ["8131AE33",0x7CF],
- ["8131AE34",0x7D0],
- ["8131AE35",0x7D1],
- ["8131AE36",0x7D2],
- ["8131AE37",0x7D3],
- ["8131AE38",0x7D4],
- ["8131AE39",0x7D5],
- ["8131AF30",0x7D6],
- ["8131AF31",0x7D7],
- ["8131AF32",0x7D8],
- ["8131AF33",0x7D9],
- ["8131AF34",0x7DA],
- ["8131AF35",0x7DB],
- ["8131AF36",0x7DC],
- ["8131AF37",0x7DD],
- ["8131AF38",0x7DE],
- ["8131AF39",0x7DF],
- ["8131B030",0x7E0],
- ["8131B031",0x7E1],
- ["8131B032",0x7E2],
- ["8131B033",0x7E3],
- ["8131B034",0x7E4],
- ["8131B035",0x7E5],
- ["8131B036",0x7E6],
- ["8131B037",0x7E7],
- ["8131B038",0x7E8],
- ["8131B039",0x7E9],
- ["8131B130",0x7EA],
- ["8131B131",0x7EB],
- ["8131B132",0x7EC],
- ["8131B133",0x7ED],
- ["8131B134",0x7EE],
- ["8131B135",0x7EF],
- ["8131B136",0x7F0],
- ["8131B137",0x7F1],
- ["8131B138",0x7F2],
- ["8131B139",0x7F3],
- ["8131B230",0x7F4],
- ["8131B231",0x7F5],
- ["8131B232",0x7F6],
- ["8131B233",0x7F7],
- ["8131B234",0x7F8],
- ["8131B235",0x7F9],
- ["8131B236",0x7FA],
- ["8131B237",0x7FB],
- ["8131B238",0x7FC],
- ["8131B239",0x7FD],
- ["8131B330",0x7FE],
- ["8131B331",0x7FF],
- ["8131B332",0x800],
- ["8131B333",0x801],
- ["8131B334",0x802],
- ["8131B335",0x803],
- ["8131B336",0x804],
- ["8131B337",0x805],
- ["8131B338",0x806],
- ["8131B339",0x807],
- ["8131B430",0x808],
- ["8131B431",0x809],
- ["8131B432",0x80A],
- ["8131B433",0x80B],
- ["8131B434",0x80C],
- ["8131B435",0x80D],
- ["8131B436",0x80E],
- ["8131B437",0x80F],
- ["8131B438",0x810],
- ["8131B439",0x811],
- ["8131B530",0x812],
- ["8131B531",0x813],
- ["8131B532",0x814],
- ["8131B533",0x815],
- ["8131B534",0x816],
- ["8131B535",0x817],
- ["8131B536",0x818],
- ["8131B537",0x819],
- ["8131B538",0x81A],
- ["8131B539",0x81B],
- ["8131B630",0x81C],
- ["8131B631",0x81D],
- ["8131B632",0x81E],
- ["8131B633",0x81F],
- ["8131B634",0x820],
- ["8131B635",0x821],
- ["8131B636",0x822],
- ["8131B637",0x823],
- ["8131B638",0x824],
- ["8131B639",0x825],
- ["8131B730",0x826],
- ["8131B731",0x827],
- ["8131B732",0x828],
- ["8131B733",0x829],
- ["8131B734",0x82A],
- ["8131B735",0x82B],
- ["8131B736",0x82C],
- ["8131B737",0x82D],
- ["8131B738",0x82E],
- ["8131B739",0x82F],
- ["8131B830",0x830],
- ["8131B831",0x831],
- ["8131B832",0x832],
- ["8131B833",0x833],
- ["8131B834",0x834],
- ["8131B835",0x835],
- ["8131B836",0x836],
- ["8131B837",0x837],
- ["8131B838",0x838],
- ["8131B839",0x839],
- ["8131B930",0x83A],
- ["8131B931",0x83B],
- ["8131B932",0x83C],
- ["8131B933",0x83D],
- ["8131B934",0x83E],
- ["8131B935",0x83F],
- ["8131B936",0x840],
- ["8131B937",0x841],
- ["8131B938",0x842],
- ["8131B939",0x843],
- ["8131BA30",0x844],
- ["8131BA31",0x845],
- ["8131BA32",0x846],
- ["8131BA33",0x847],
- ["8131BA34",0x848],
- ["8131BA35",0x849],
- ["8131BA36",0x84A],
- ["8131BA37",0x84B],
- ["8131BA38",0x84C],
- ["8131BA39",0x84D],
- ["8131BB30",0x84E],
- ["8131BB31",0x84F],
- ["8131BB32",0x850],
- ["8131BB33",0x851],
- ["8131BB34",0x852],
- ["8131BB35",0x853],
- ["8131BB36",0x854],
- ["8131BB37",0x855],
- ["8131BB38",0x856],
- ["8131BB39",0x857],
- ["8131BC30",0x858],
- ["8131BC31",0x859],
- ["8131BC32",0x85A],
- ["8131BC33",0x85B],
- ["8131BC34",0x85C],
- ["8131BC35",0x85D],
- ["8131BC36",0x85E],
- ["8131BC37",0x85F],
- ["8131BC38",0x860],
- ["8131BC39",0x861],
- ["8131BD30",0x862],
- ["8131BD31",0x863],
- ["8131BD32",0x864],
- ["8131BD33",0x865],
- ["8131BD34",0x866],
- ["8131BD35",0x867],
- ["8131BD36",0x868],
- ["8131BD37",0x869],
- ["8131BD38",0x86A],
- ["8131BD39",0x86B],
- ["8131BE30",0x86C],
- ["8131BE31",0x86D],
- ["8131BE32",0x86E],
- ["8131BE33",0x86F],
- ["8131BE34",0x870],
- ["8131BE35",0x871],
- ["8131BE36",0x872],
- ["8131BE37",0x873],
- ["8131BE38",0x874],
- ["8131BE39",0x875],
- ["8131BF30",0x876],
- ["8131BF31",0x877],
- ["8131BF32",0x878],
- ["8131BF33",0x879],
- ["8131BF34",0x87A],
- ["8131BF35",0x87B],
- ["8131BF36",0x87C],
- ["8131BF37",0x87D],
- ["8131BF38",0x87E],
- ["8131BF39",0x87F],
- ["8131C030",0x880],
- ["8131C031",0x881],
- ["8131C032",0x882],
- ["8131C033",0x883],
- ["8131C034",0x884],
- ["8131C035",0x885],
- ["8131C036",0x886],
- ["8131C037",0x887],
- ["8131C038",0x888],
- ["8131C039",0x889],
- ["8131C130",0x88A],
- ["8131C131",0x88B],
- ["8131C132",0x88C],
- ["8131C133",0x88D],
- ["8131C134",0x88E],
- ["8131C135",0x88F],
- ["8131C136",0x890],
- ["8131C137",0x891],
- ["8131C138",0x892],
- ["8131C139",0x893],
- ["8131C230",0x894],
- ["8131C231",0x895],
- ["8131C232",0x896],
- ["8131C233",0x897],
- ["8131C234",0x898],
- ["8131C235",0x899],
- ["8131C236",0x89A],
- ["8131C237",0x89B],
- ["8131C238",0x89C],
- ["8131C239",0x89D],
- ["8131C330",0x89E],
- ["8131C331",0x89F],
- ["8131C332",0x8A0],
- ["8131C333",0x8A1],
- ["8131C334",0x8A2],
- ["8131C335",0x8A3],
- ["8131C336",0x8A4],
- ["8131C337",0x8A5],
- ["8131C338",0x8A6],
- ["8131C339",0x8A7],
- ["8131C430",0x8A8],
- ["8131C431",0x8A9],
- ["8131C432",0x8AA],
- ["8131C433",0x8AB],
- ["8131C434",0x8AC],
- ["8131C435",0x8AD],
- ["8131C436",0x8AE],
- ["8131C437",0x8AF],
- ["8131C438",0x8B0],
- ["8131C439",0x8B1],
- ["8131C530",0x8B2],
- ["8131C531",0x8B3],
- ["8131C532",0x8B4],
- ["8131C533",0x8B5],
- ["8131C534",0x8B6],
- ["8131C535",0x8B7],
- ["8131C536",0x8B8],
- ["8131C537",0x8B9],
- ["8131C538",0x8BA],
- ["8131C539",0x8BB],
- ["8131C630",0x8BC],
- ["8131C631",0x8BD],
- ["8131C632",0x8BE],
- ["8131C633",0x8BF],
- ["8131C634",0x8C0],
- ["8131C635",0x8C1],
- ["8131C636",0x8C2],
- ["8131C637",0x8C3],
- ["8131C638",0x8C4],
- ["8131C639",0x8C5],
- ["8131C730",0x8C6],
- ["8131C731",0x8C7],
- ["8131C732",0x8C8],
- ["8131C733",0x8C9],
- ["8131C734",0x8CA],
- ["8131C735",0x8CB],
- ["8131C736",0x8CC],
- ["8131C737",0x8CD],
- ["8131C738",0x8CE],
- ["8131C739",0x8CF],
- ["8131C830",0x8D0],
- ["8131C831",0x8D1],
- ["8131C832",0x8D2],
- ["8131C833",0x8D3],
- ["8131C834",0x8D4],
- ["8131C835",0x8D5],
- ["8131C836",0x8D6],
- ["8131C837",0x8D7],
- ["8131C838",0x8D8],
- ["8131C839",0x8D9],
- ["8131C930",0x8DA],
- ["8131C931",0x8DB],
- ["8131C932",0x8DC],
- ["8131C933",0x8DD],
- ["8131C934",0x8DE],
- ["8131C935",0x8DF],
- ["8131C936",0x8E0],
- ["8131C937",0x8E1],
- ["8131C938",0x8E2],
- ["8131C939",0x8E3],
- ["8131CA30",0x8E4],
- ["8131CA31",0x8E5],
- ["8131CA32",0x8E6],
- ["8131CA33",0x8E7],
- ["8131CA34",0x8E8],
- ["8131CA35",0x8E9],
- ["8131CA36",0x8EA],
- ["8131CA37",0x8EB],
- ["8131CA38",0x8EC],
- ["8131CA39",0x8ED],
- ["8131CB30",0x8EE],
- ["8131CB31",0x8EF],
- ["8131CB32",0x8F0],
- ["8131CB33",0x8F1],
- ["8131CB34",0x8F2],
- ["8131CB35",0x8F3],
- ["8131CB36",0x8F4],
- ["8131CB37",0x8F5],
- ["8131CB38",0x8F6],
- ["8131CB39",0x8F7],
- ["8131CC30",0x8F8],
- ["8131CC31",0x8F9],
- ["8131CC32",0x8FA],
- ["8131CC33",0x8FB],
- ["8131CC34",0x8FC],
- ["8131CC35",0x8FD],
- ["8131CC36",0x8FE],
- ["8131CC37",0x8FF],
- ["8131CC38",0x900],
- ["8131CC39",0x901],
- ["8131CD30",0x902],
- ["8131CD31",0x903],
- ["8131CD32",0x904],
- ["8131CD33",0x905],
- ["8131CD34",0x906],
- ["8131CD35",0x907],
- ["8131CD36",0x908],
- ["8131CD37",0x909],
- ["8131CD38",0x90A],
- ["8131CD39",0x90B],
- ["8131CE30",0x90C],
- ["8131CE31",0x90D],
- ["8131CE32",0x90E],
- ["8131CE33",0x90F],
- ["8131CE34",0x910],
- ["8131CE35",0x911],
- ["8131CE36",0x912],
- ["8131CE37",0x913],
- ["8131CE38",0x914],
- ["8131CE39",0x915],
- ["8131CF30",0x916],
- ["8131CF31",0x917],
- ["8131CF32",0x918],
- ["8131CF33",0x919],
- ["8131CF34",0x91A],
- ["8131CF35",0x91B],
- ["8131CF36",0x91C],
- ["8131CF37",0x91D],
- ["8131CF38",0x91E],
- ["8131CF39",0x91F],
- ["8131D030",0x920],
- ["8131D031",0x921],
- ["8131D032",0x922],
- ["8131D033",0x923],
- ["8131D034",0x924],
- ["8131D035",0x925],
- ["8131D036",0x926],
- ["8131D037",0x927],
- ["8131D038",0x928],
- ["8131D039",0x929],
- ["8131D130",0x92A],
- ["8131D131",0x92B],
- ["8131D132",0x92C],
- ["8131D133",0x92D],
- ["8131D134",0x92E],
- ["8131D135",0x92F],
- ["8131D136",0x930],
- ["8131D137",0x931],
- ["8131D138",0x932],
- ["8131D139",0x933],
- ["8131D230",0x934],
- ["8131D231",0x935],
- ["8131D232",0x936],
- ["8131D233",0x937],
- ["8131D234",0x938],
- ["8131D235",0x939],
- ["8131D236",0x93A],
- ["8131D237",0x93B],
- ["8131D238",0x93C],
- ["8131D239",0x93D],
- ["8131D330",0x93E],
- ["8131D331",0x93F],
- ["8131D332",0x940],
- ["8131D333",0x941],
- ["8131D334",0x942],
- ["8131D335",0x943],
- ["8131D336",0x944],
- ["8131D337",0x945],
- ["8131D338",0x946],
- ["8131D339",0x947],
- ["8131D430",0x948],
- ["8131D431",0x949],
- ["8131D432",0x94A],
- ["8131D433",0x94B],
- ["8131D434",0x94C],
- ["8131D435",0x94D],
- ["8131D436",0x94E],
- ["8131D437",0x94F],
- ["8131D438",0x950],
- ["8131D439",0x951],
- ["8131D530",0x952],
- ["8131D531",0x953],
- ["8131D532",0x954],
- ["8131D533",0x955],
- ["8131D534",0x956],
- ["8131D535",0x957],
- ["8131D536",0x958],
- ["8131D537",0x959],
- ["8131D538",0x95A],
- ["8131D539",0x95B],
- ["8131D630",0x95C],
- ["8131D631",0x95D],
- ["8131D632",0x95E],
- ["8131D633",0x95F],
- ["8131D634",0x960],
- ["8131D635",0x961],
- ["8131D636",0x962],
- ["8131D637",0x963],
- ["8131D638",0x964],
- ["8131D639",0x965],
- ["8131D730",0x966],
- ["8131D731",0x967],
- ["8131D732",0x968],
- ["8131D733",0x969],
- ["8131D734",0x96A],
- ["8131D735",0x96B],
- ["8131D736",0x96C],
- ["8131D737",0x96D],
- ["8131D738",0x96E],
- ["8131D739",0x96F],
- ["8131D830",0x970],
- ["8131D831",0x971],
- ["8131D832",0x972],
- ["8131D833",0x973],
- ["8131D834",0x974],
- ["8131D835",0x975],
- ["8131D836",0x976],
- ["8131D837",0x977],
- ["8131D838",0x978],
- ["8131D839",0x979],
- ["8131D930",0x97A],
- ["8131D931",0x97B],
- ["8131D932",0x97C],
- ["8131D933",0x97D],
- ["8131D934",0x97E],
- ["8131D935",0x97F],
- ["8131D936",0x980],
- ["8131D937",0x981],
- ["8131D938",0x982],
- ["8131D939",0x983],
- ["8131DA30",0x984],
- ["8131DA31",0x985],
- ["8131DA32",0x986],
- ["8131DA33",0x987],
- ["8131DA34",0x988],
- ["8131DA35",0x989],
- ["8131DA36",0x98A],
- ["8131DA37",0x98B],
- ["8131DA38",0x98C],
- ["8131DA39",0x98D],
- ["8131DB30",0x98E],
- ["8131DB31",0x98F],
- ["8131DB32",0x990],
- ["8131DB33",0x991],
- ["8131DB34",0x992],
- ["8131DB35",0x993],
- ["8131DB36",0x994],
- ["8131DB37",0x995],
- ["8131DB38",0x996],
- ["8131DB39",0x997],
- ["8131DC30",0x998],
- ["8131DC31",0x999],
- ["8131DC32",0x99A],
- ["8131DC33",0x99B],
- ["8131DC34",0x99C],
- ["8131DC35",0x99D],
- ["8131DC36",0x99E],
- ["8131DC37",0x99F],
- ["8131DC38",0x9A0],
- ["8131DC39",0x9A1],
- ["8131DD30",0x9A2],
- ["8131DD31",0x9A3],
- ["8131DD32",0x9A4],
- ["8131DD33",0x9A5],
- ["8131DD34",0x9A6],
- ["8131DD35",0x9A7],
- ["8131DD36",0x9A8],
- ["8131DD37",0x9A9],
- ["8131DD38",0x9AA],
- ["8131DD39",0x9AB],
- ["8131DE30",0x9AC],
- ["8131DE31",0x9AD],
- ["8131DE32",0x9AE],
- ["8131DE33",0x9AF],
- ["8131DE34",0x9B0],
- ["8131DE35",0x9B1],
- ["8131DE36",0x9B2],
- ["8131DE37",0x9B3],
- ["8131DE38",0x9B4],
- ["8131DE39",0x9B5],
- ["8131DF30",0x9B6],
- ["8131DF31",0x9B7],
- ["8131DF32",0x9B8],
- ["8131DF33",0x9B9],
- ["8131DF34",0x9BA],
- ["8131DF35",0x9BB],
- ["8131DF36",0x9BC],
- ["8131DF37",0x9BD],
- ["8131DF38",0x9BE],
- ["8131DF39",0x9BF],
- ["8131E030",0x9C0],
- ["8131E031",0x9C1],
- ["8131E032",0x9C2],
- ["8131E033",0x9C3],
- ["8131E034",0x9C4],
- ["8131E035",0x9C5],
- ["8131E036",0x9C6],
- ["8131E037",0x9C7],
- ["8131E038",0x9C8],
- ["8131E039",0x9C9],
- ["8131E130",0x9CA],
- ["8131E131",0x9CB],
- ["8131E132",0x9CC],
- ["8131E133",0x9CD],
- ["8131E134",0x9CE],
- ["8131E135",0x9CF],
- ["8131E136",0x9D0],
- ["8131E137",0x9D1],
- ["8131E138",0x9D2],
- ["8131E139",0x9D3],
- ["8131E230",0x9D4],
- ["8131E231",0x9D5],
- ["8131E232",0x9D6],
- ["8131E233",0x9D7],
- ["8131E234",0x9D8],
- ["8131E235",0x9D9],
- ["8131E236",0x9DA],
- ["8131E237",0x9DB],
- ["8131E238",0x9DC],
- ["8131E239",0x9DD],
- ["8131E330",0x9DE],
- ["8131E331",0x9DF],
- ["8131E332",0x9E0],
- ["8131E333",0x9E1],
- ["8131E334",0x9E2],
- ["8131E335",0x9E3],
- ["8131E336",0x9E4],
- ["8131E337",0x9E5],
- ["8131E338",0x9E6],
- ["8131E339",0x9E7],
- ["8131E430",0x9E8],
- ["8131E431",0x9E9],
- ["8131E432",0x9EA],
- ["8131E433",0x9EB],
- ["8131E434",0x9EC],
- ["8131E435",0x9ED],
- ["8131E436",0x9EE],
- ["8131E437",0x9EF],
- ["8131E438",0x9F0],
- ["8131E439",0x9F1],
- ["8131E530",0x9F2],
- ["8131E531",0x9F3],
- ["8131E532",0x9F4],
- ["8131E533",0x9F5],
- ["8131E534",0x9F6],
- ["8131E535",0x9F7],
- ["8131E536",0x9F8],
- ["8131E537",0x9F9],
- ["8131E538",0x9FA],
- ["8131E539",0x9FB],
- ["8131E630",0x9FC],
- ["8131E631",0x9FD],
- ["8131E632",0x9FE],
- ["8131E633",0x9FF],
- ["8131E634",0xA00],
- ["8131E635",0xA01],
- ["8131E636",0xA02],
- ["8131E637",0xA03],
- ["8131E638",0xA04],
- ["8131E639",0xA05],
- ["8131E730",0xA06],
- ["8131E731",0xA07],
- ["8131E732",0xA08],
- ["8131E733",0xA09],
- ["8131E734",0xA0A],
- ["8131E735",0xA0B],
- ["8131E736",0xA0C],
- ["8131E737",0xA0D],
- ["8131E738",0xA0E],
- ["8131E739",0xA0F],
- ["8131E830",0xA10],
- ["8131E831",0xA11],
- ["8131E832",0xA12],
- ["8131E833",0xA13],
- ["8131E834",0xA14],
- ["8131E835",0xA15],
- ["8131E836",0xA16],
- ["8131E837",0xA17],
- ["8131E838",0xA18],
- ["8131E839",0xA19],
- ["8131E930",0xA1A],
- ["8131E931",0xA1B],
- ["8131E932",0xA1C],
- ["8131E933",0xA1D],
- ["8131E934",0xA1E],
- ["8131E935",0xA1F],
- ["8131E936",0xA20],
- ["8131E937",0xA21],
- ["8131E938",0xA22],
- ["8131E939",0xA23],
- ["8131EA30",0xA24],
- ["8131EA31",0xA25],
- ["8131EA32",0xA26],
- ["8131EA33",0xA27],
- ["8131EA34",0xA28],
- ["8131EA35",0xA29],
- ["8131EA36",0xA2A],
- ["8131EA37",0xA2B],
- ["8131EA38",0xA2C],
- ["8131EA39",0xA2D],
- ["8131EB30",0xA2E],
- ["8131EB31",0xA2F],
- ["8131EB32",0xA30],
- ["8131EB33",0xA31],
- ["8131EB34",0xA32],
- ["8131EB35",0xA33],
- ["8131EB36",0xA34],
- ["8131EB37",0xA35],
- ["8131EB38",0xA36],
- ["8131EB39",0xA37],
- ["8131EC30",0xA38],
- ["8131EC31",0xA39],
- ["8131EC32",0xA3A],
- ["8131EC33",0xA3B],
- ["8131EC34",0xA3C],
- ["8131EC35",0xA3D],
- ["8131EC36",0xA3E],
- ["8131EC37",0xA3F],
- ["8131EC38",0xA40],
- ["8131EC39",0xA41],
- ["8131ED30",0xA42],
- ["8131ED31",0xA43],
- ["8131ED32",0xA44],
- ["8131ED33",0xA45],
- ["8131ED34",0xA46],
- ["8131ED35",0xA47],
- ["8131ED36",0xA48],
- ["8131ED37",0xA49],
- ["8131ED38",0xA4A],
- ["8131ED39",0xA4B],
- ["8131EE30",0xA4C],
- ["8131EE31",0xA4D],
- ["8131EE32",0xA4E],
- ["8131EE33",0xA4F],
- ["8131EE34",0xA50],
- ["8131EE35",0xA51],
- ["8131EE36",0xA52],
- ["8131EE37",0xA53],
- ["8131EE38",0xA54],
- ["8131EE39",0xA55],
- ["8131EF30",0xA56],
- ["8131EF31",0xA57],
- ["8131EF32",0xA58],
- ["8131EF33",0xA59],
- ["8131EF34",0xA5A],
- ["8131EF35",0xA5B],
- ["8131EF36",0xA5C],
- ["8131EF37",0xA5D],
- ["8131EF38",0xA5E],
- ["8131EF39",0xA5F],
- ["8131F030",0xA60],
- ["8131F031",0xA61],
- ["8131F032",0xA62],
- ["8131F033",0xA63],
- ["8131F034",0xA64],
- ["8131F035",0xA65],
- ["8131F036",0xA66],
- ["8131F037",0xA67],
- ["8131F038",0xA68],
- ["8131F039",0xA69],
- ["8131F130",0xA6A],
- ["8131F131",0xA6B],
- ["8131F132",0xA6C],
- ["8131F133",0xA6D],
- ["8131F134",0xA6E],
- ["8131F135",0xA6F],
- ["8131F136",0xA70],
- ["8131F137",0xA71],
- ["8131F138",0xA72],
- ["8131F139",0xA73],
- ["8131F230",0xA74],
- ["8131F231",0xA75],
- ["8131F232",0xA76],
- ["8131F233",0xA77],
- ["8131F234",0xA78],
- ["8131F235",0xA79],
- ["8131F236",0xA7A],
- ["8131F237",0xA7B],
- ["8131F238",0xA7C],
- ["8131F239",0xA7D],
- ["8131F330",0xA7E],
- ["8131F331",0xA7F],
- ["8131F332",0xA80],
- ["8131F333",0xA81],
- ["8131F334",0xA82],
- ["8131F335",0xA83],
- ["8131F336",0xA84],
- ["8131F337",0xA85],
- ["8131F338",0xA86],
- ["8131F339",0xA87],
- ["8131F430",0xA88],
- ["8131F431",0xA89],
- ["8131F432",0xA8A],
- ["8131F433",0xA8B],
- ["8131F434",0xA8C],
- ["8131F435",0xA8D],
- ["8131F436",0xA8E],
- ["8131F437",0xA8F],
- ["8131F438",0xA90],
- ["8131F439",0xA91],
- ["8131F530",0xA92],
- ["8131F531",0xA93],
- ["8131F532",0xA94],
- ["8131F533",0xA95],
- ["8131F534",0xA96],
- ["8131F535",0xA97],
- ["8131F536",0xA98],
- ["8131F537",0xA99],
- ["8131F538",0xA9A],
- ["8131F539",0xA9B],
- ["8131F630",0xA9C],
- ["8131F631",0xA9D],
- ["8131F632",0xA9E],
- ["8131F633",0xA9F],
- ["8131F634",0xAA0],
- ["8131F635",0xAA1],
- ["8131F636",0xAA2],
- ["8131F637",0xAA3],
- ["8131F638",0xAA4],
- ["8131F639",0xAA5],
- ["8131F730",0xAA6],
- ["8131F731",0xAA7],
- ["8131F732",0xAA8],
- ["8131F733",0xAA9],
- ["8131F734",0xAAA],
- ["8131F735",0xAAB],
- ["8131F736",0xAAC],
- ["8131F737",0xAAD],
- ["8131F738",0xAAE],
- ["8131F739",0xAAF],
- ["8131F830",0xAB0],
- ["8131F831",0xAB1],
- ["8131F832",0xAB2],
- ["8131F833",0xAB3],
- ["8131F834",0xAB4],
- ["8131F835",0xAB5],
- ["8131F836",0xAB6],
- ["8131F837",0xAB7],
- ["8131F838",0xAB8],
- ["8131F839",0xAB9],
- ["8131F930",0xABA],
- ["8131F931",0xABB],
- ["8131F932",0xABC],
- ["8131F933",0xABD],
- ["8131F934",0xABE],
- ["8131F935",0xABF],
- ["8131F936",0xAC0],
- ["8131F937",0xAC1],
- ["8131F938",0xAC2],
- ["8131F939",0xAC3],
- ["8131FA30",0xAC4],
- ["8131FA31",0xAC5],
- ["8131FA32",0xAC6],
- ["8131FA33",0xAC7],
- ["8131FA34",0xAC8],
- ["8131FA35",0xAC9],
- ["8131FA36",0xACA],
- ["8131FA37",0xACB],
- ["8131FA38",0xACC],
- ["8131FA39",0xACD],
- ["8131FB30",0xACE],
- ["8131FB31",0xACF],
- ["8131FB32",0xAD0],
- ["8131FB33",0xAD1],
- ["8131FB34",0xAD2],
- ["8131FB35",0xAD3],
- ["8131FB36",0xAD4],
- ["8131FB37",0xAD5],
- ["8131FB38",0xAD6],
- ["8131FB39",0xAD7],
- ["8131FC30",0xAD8],
- ["8131FC31",0xAD9],
- ["8131FC32",0xADA],
- ["8131FC33",0xADB],
- ["8131FC34",0xADC],
- ["8131FC35",0xADD],
- ["8131FC36",0xADE],
- ["8131FC37",0xADF],
- ["8131FC38",0xAE0],
- ["8131FC39",0xAE1],
- ["8131FD30",0xAE2],
- ["8131FD31",0xAE3],
- ["8131FD32",0xAE4],
- ["8131FD33",0xAE5],
- ["8131FD34",0xAE6],
- ["8131FD35",0xAE7],
- ["8131FD36",0xAE8],
- ["8131FD37",0xAE9],
- ["8131FD38",0xAEA],
- ["8131FD39",0xAEB],
- ["8131FE30",0xAEC],
- ["8131FE31",0xAED],
- ["8131FE32",0xAEE],
- ["8131FE33",0xAEF],
- ["8131FE34",0xAF0],
- ["8131FE35",0xAF1],
- ["8131FE36",0xAF2],
- ["8131FE37",0xAF3],
- ["8131FE38",0xAF4],
- ["8131FE39",0xAF5],
- ["81328130",0xAF6],
- ["81328131",0xAF7],
- ["81328132",0xAF8],
- ["81328133",0xAF9],
- ["81328134",0xAFA],
- ["81328135",0xAFB],
- ["81328136",0xAFC],
- ["81328137",0xAFD],
- ["81328138",0xAFE],
- ["81328139",0xAFF],
- ["81328230",0xB00],
- ["81328231",0xB01],
- ["81328232",0xB02],
- ["81328233",0xB03],
- ["81328234",0xB04],
- ["81328235",0xB05],
- ["81328236",0xB06],
- ["81328237",0xB07],
- ["81328238",0xB08],
- ["81328239",0xB09],
- ["81328330",0xB0A],
- ["81328331",0xB0B],
- ["81328332",0xB0C],
- ["81328333",0xB0D],
- ["81328334",0xB0E],
- ["81328335",0xB0F],
- ["81328336",0xB10],
- ["81328337",0xB11],
- ["81328338",0xB12],
- ["81328339",0xB13],
- ["81328430",0xB14],
- ["81328431",0xB15],
- ["81328432",0xB16],
- ["81328433",0xB17],
- ["81328434",0xB18],
- ["81328435",0xB19],
- ["81328436",0xB1A],
- ["81328437",0xB1B],
- ["81328438",0xB1C],
- ["81328439",0xB1D],
- ["81328530",0xB1E],
- ["81328531",0xB1F],
- ["81328532",0xB20],
- ["81328533",0xB21],
- ["81328534",0xB22],
- ["81328535",0xB23],
- ["81328536",0xB24],
- ["81328537",0xB25],
- ["81328538",0xB26],
- ["81328539",0xB27],
- ["81328630",0xB28],
- ["81328631",0xB29],
- ["81328632",0xB2A],
- ["81328633",0xB2B],
- ["81328634",0xB2C],
- ["81328635",0xB2D],
- ["81328636",0xB2E],
- ["81328637",0xB2F],
- ["81328638",0xB30],
- ["81328639",0xB31],
- ["81328730",0xB32],
- ["81328731",0xB33],
- ["81328732",0xB34],
- ["81328733",0xB35],
- ["81328734",0xB36],
- ["81328735",0xB37],
- ["81328736",0xB38],
- ["81328737",0xB39],
- ["81328738",0xB3A],
- ["81328739",0xB3B],
- ["81328830",0xB3C],
- ["81328831",0xB3D],
- ["81328832",0xB3E],
- ["81328833",0xB3F],
- ["81328834",0xB40],
- ["81328835",0xB41],
- ["81328836",0xB42],
- ["81328837",0xB43],
- ["81328838",0xB44],
- ["81328839",0xB45],
- ["81328930",0xB46],
- ["81328931",0xB47],
- ["81328932",0xB48],
- ["81328933",0xB49],
- ["81328934",0xB4A],
- ["81328935",0xB4B],
- ["81328936",0xB4C],
- ["81328937",0xB4D],
- ["81328938",0xB4E],
- ["81328939",0xB4F],
- ["81328A30",0xB50],
- ["81328A31",0xB51],
- ["81328A32",0xB52],
- ["81328A33",0xB53],
- ["81328A34",0xB54],
- ["81328A35",0xB55],
- ["81328A36",0xB56],
- ["81328A37",0xB57],
- ["81328A38",0xB58],
- ["81328A39",0xB59],
- ["81328B30",0xB5A],
- ["81328B31",0xB5B],
- ["81328B32",0xB5C],
- ["81328B33",0xB5D],
- ["81328B34",0xB5E],
- ["81328B35",0xB5F],
- ["81328B36",0xB60],
- ["81328B37",0xB61],
- ["81328B38",0xB62],
- ["81328B39",0xB63],
- ["81328C30",0xB64],
- ["81328C31",0xB65],
- ["81328C32",0xB66],
- ["81328C33",0xB67],
- ["81328C34",0xB68],
- ["81328C35",0xB69],
- ["81328C36",0xB6A],
- ["81328C37",0xB6B],
- ["81328C38",0xB6C],
- ["81328C39",0xB6D],
- ["81328D30",0xB6E],
- ["81328D31",0xB6F],
- ["81328D32",0xB70],
- ["81328D33",0xB71],
- ["81328D34",0xB72],
- ["81328D35",0xB73],
- ["81328D36",0xB74],
- ["81328D37",0xB75],
- ["81328D38",0xB76],
- ["81328D39",0xB77],
- ["81328E30",0xB78],
- ["81328E31",0xB79],
- ["81328E32",0xB7A],
- ["81328E33",0xB7B],
- ["81328E34",0xB7C],
- ["81328E35",0xB7D],
- ["81328E36",0xB7E],
- ["81328E37",0xB7F],
- ["81328E38",0xB80],
- ["81328E39",0xB81],
- ["81328F30",0xB82],
- ["81328F31",0xB83],
- ["81328F32",0xB84],
- ["81328F33",0xB85],
- ["81328F34",0xB86],
- ["81328F35",0xB87],
- ["81328F36",0xB88],
- ["81328F37",0xB89],
- ["81328F38",0xB8A],
- ["81328F39",0xB8B],
- ["81329030",0xB8C],
- ["81329031",0xB8D],
- ["81329032",0xB8E],
- ["81329033",0xB8F],
- ["81329034",0xB90],
- ["81329035",0xB91],
- ["81329036",0xB92],
- ["81329037",0xB93],
- ["81329038",0xB94],
- ["81329039",0xB95],
- ["81329130",0xB96],
- ["81329131",0xB97],
- ["81329132",0xB98],
- ["81329133",0xB99],
- ["81329134",0xB9A],
- ["81329135",0xB9B],
- ["81329136",0xB9C],
- ["81329137",0xB9D],
- ["81329138",0xB9E],
- ["81329139",0xB9F],
- ["81329230",0xBA0],
- ["81329231",0xBA1],
- ["81329232",0xBA2],
- ["81329233",0xBA3],
- ["81329234",0xBA4],
- ["81329235",0xBA5],
- ["81329236",0xBA6],
- ["81329237",0xBA7],
- ["81329238",0xBA8],
- ["81329239",0xBA9],
- ["81329330",0xBAA],
- ["81329331",0xBAB],
- ["81329332",0xBAC],
- ["81329333",0xBAD],
- ["81329334",0xBAE],
- ["81329335",0xBAF],
- ["81329336",0xBB0],
- ["81329337",0xBB1],
- ["81329338",0xBB2],
- ["81329339",0xBB3],
- ["81329430",0xBB4],
- ["81329431",0xBB5],
- ["81329432",0xBB6],
- ["81329433",0xBB7],
- ["81329434",0xBB8],
- ["81329435",0xBB9],
- ["81329436",0xBBA],
- ["81329437",0xBBB],
- ["81329438",0xBBC],
- ["81329439",0xBBD],
- ["81329530",0xBBE],
- ["81329531",0xBBF],
- ["81329532",0xBC0],
- ["81329533",0xBC1],
- ["81329534",0xBC2],
- ["81329535",0xBC3],
- ["81329536",0xBC4],
- ["81329537",0xBC5],
- ["81329538",0xBC6],
- ["81329539",0xBC7],
- ["81329630",0xBC8],
- ["81329631",0xBC9],
- ["81329632",0xBCA],
- ["81329633",0xBCB],
- ["81329634",0xBCC],
- ["81329635",0xBCD],
- ["81329636",0xBCE],
- ["81329637",0xBCF],
- ["81329638",0xBD0],
- ["81329639",0xBD1],
- ["81329730",0xBD2],
- ["81329731",0xBD3],
- ["81329732",0xBD4],
- ["81329733",0xBD5],
- ["81329734",0xBD6],
- ["81329735",0xBD7],
- ["81329736",0xBD8],
- ["81329737",0xBD9],
- ["81329738",0xBDA],
- ["81329739",0xBDB],
- ["81329830",0xBDC],
- ["81329831",0xBDD],
- ["81329832",0xBDE],
- ["81329833",0xBDF],
- ["81329834",0xBE0],
- ["81329835",0xBE1],
- ["81329836",0xBE2],
- ["81329837",0xBE3],
- ["81329838",0xBE4],
- ["81329839",0xBE5],
- ["81329930",0xBE6],
- ["81329931",0xBE7],
- ["81329932",0xBE8],
- ["81329933",0xBE9],
- ["81329934",0xBEA],
- ["81329935",0xBEB],
- ["81329936",0xBEC],
- ["81329937",0xBED],
- ["81329938",0xBEE],
- ["81329939",0xBEF],
- ["81329A30",0xBF0],
- ["81329A31",0xBF1],
- ["81329A32",0xBF2],
- ["81329A33",0xBF3],
- ["81329A34",0xBF4],
- ["81329A35",0xBF5],
- ["81329A36",0xBF6],
- ["81329A37",0xBF7],
- ["81329A38",0xBF8],
- ["81329A39",0xBF9],
- ["81329B30",0xBFA],
- ["81329B31",0xBFB],
- ["81329B32",0xBFC],
- ["81329B33",0xBFD],
- ["81329B34",0xBFE],
- ["81329B35",0xBFF],
- ["81329B36",0xC00],
- ["81329B37",0xC01],
- ["81329B38",0xC02],
- ["81329B39",0xC03],
- ["81329C30",0xC04],
- ["81329C31",0xC05],
- ["81329C32",0xC06],
- ["81329C33",0xC07],
- ["81329C34",0xC08],
- ["81329C35",0xC09],
- ["81329C36",0xC0A],
- ["81329C37",0xC0B],
- ["81329C38",0xC0C],
- ["81329C39",0xC0D],
- ["81329D30",0xC0E],
- ["81329D31",0xC0F],
- ["81329D32",0xC10],
- ["81329D33",0xC11],
- ["81329D34",0xC12],
- ["81329D35",0xC13],
- ["81329D36",0xC14],
- ["81329D37",0xC15],
- ["81329D38",0xC16],
- ["81329D39",0xC17],
- ["81329E30",0xC18],
- ["81329E31",0xC19],
- ["81329E32",0xC1A],
- ["81329E33",0xC1B],
- ["81329E34",0xC1C],
- ["81329E35",0xC1D],
- ["81329E36",0xC1E],
- ["81329E37",0xC1F],
- ["81329E38",0xC20],
- ["81329E39",0xC21],
- ["81329F30",0xC22],
- ["81329F31",0xC23],
- ["81329F32",0xC24],
- ["81329F33",0xC25],
- ["81329F34",0xC26],
- ["81329F35",0xC27],
- ["81329F36",0xC28],
- ["81329F37",0xC29],
- ["81329F38",0xC2A],
- ["81329F39",0xC2B],
- ["8132A030",0xC2C],
- ["8132A031",0xC2D],
- ["8132A032",0xC2E],
- ["8132A033",0xC2F],
- ["8132A034",0xC30],
- ["8132A035",0xC31],
- ["8132A036",0xC32],
- ["8132A037",0xC33],
- ["8132A038",0xC34],
- ["8132A039",0xC35],
- ["8132A130",0xC36],
- ["8132A131",0xC37],
- ["8132A132",0xC38],
- ["8132A133",0xC39],
- ["8132A134",0xC3A],
- ["8132A135",0xC3B],
- ["8132A136",0xC3C],
- ["8132A137",0xC3D],
- ["8132A138",0xC3E],
- ["8132A139",0xC3F],
- ["8132A230",0xC40],
- ["8132A231",0xC41],
- ["8132A232",0xC42],
- ["8132A233",0xC43],
- ["8132A234",0xC44],
- ["8132A235",0xC45],
- ["8132A236",0xC46],
- ["8132A237",0xC47],
- ["8132A238",0xC48],
- ["8132A239",0xC49],
- ["8132A330",0xC4A],
- ["8132A331",0xC4B],
- ["8132A332",0xC4C],
- ["8132A333",0xC4D],
- ["8132A334",0xC4E],
- ["8132A335",0xC4F],
- ["8132A336",0xC50],
- ["8132A337",0xC51],
- ["8132A338",0xC52],
- ["8132A339",0xC53],
- ["8132A430",0xC54],
- ["8132A431",0xC55],
- ["8132A432",0xC56],
- ["8132A433",0xC57],
- ["8132A434",0xC58],
- ["8132A435",0xC59],
- ["8132A436",0xC5A],
- ["8132A437",0xC5B],
- ["8132A438",0xC5C],
- ["8132A439",0xC5D],
- ["8132A530",0xC5E],
- ["8132A531",0xC5F],
- ["8132A532",0xC60],
- ["8132A533",0xC61],
- ["8132A534",0xC62],
- ["8132A535",0xC63],
- ["8132A536",0xC64],
- ["8132A537",0xC65],
- ["8132A538",0xC66],
- ["8132A539",0xC67],
- ["8132A630",0xC68],
- ["8132A631",0xC69],
- ["8132A632",0xC6A],
- ["8132A633",0xC6B],
- ["8132A634",0xC6C],
- ["8132A635",0xC6D],
- ["8132A636",0xC6E],
- ["8132A637",0xC6F],
- ["8132A638",0xC70],
- ["8132A639",0xC71],
- ["8132A730",0xC72],
- ["8132A731",0xC73],
- ["8132A732",0xC74],
- ["8132A733",0xC75],
- ["8132A734",0xC76],
- ["8132A735",0xC77],
- ["8132A736",0xC78],
- ["8132A737",0xC79],
- ["8132A738",0xC7A],
- ["8132A739",0xC7B],
- ["8132A830",0xC7C],
- ["8132A831",0xC7D],
- ["8132A832",0xC7E],
- ["8132A833",0xC7F],
- ["8132A834",0xC80],
- ["8132A835",0xC81],
- ["8132A836",0xC82],
- ["8132A837",0xC83],
- ["8132A838",0xC84],
- ["8132A839",0xC85],
- ["8132A930",0xC86],
- ["8132A931",0xC87],
- ["8132A932",0xC88],
- ["8132A933",0xC89],
- ["8132A934",0xC8A],
- ["8132A935",0xC8B],
- ["8132A936",0xC8C],
- ["8132A937",0xC8D],
- ["8132A938",0xC8E],
- ["8132A939",0xC8F],
- ["8132AA30",0xC90],
- ["8132AA31",0xC91],
- ["8132AA32",0xC92],
- ["8132AA33",0xC93],
- ["8132AA34",0xC94],
- ["8132AA35",0xC95],
- ["8132AA36",0xC96],
- ["8132AA37",0xC97],
- ["8132AA38",0xC98],
- ["8132AA39",0xC99],
- ["8132AB30",0xC9A],
- ["8132AB31",0xC9B],
- ["8132AB32",0xC9C],
- ["8132AB33",0xC9D],
- ["8132AB34",0xC9E],
- ["8132AB35",0xC9F],
- ["8132AB36",0xCA0],
- ["8132AB37",0xCA1],
- ["8132AB38",0xCA2],
- ["8132AB39",0xCA3],
- ["8132AC30",0xCA4],
- ["8132AC31",0xCA5],
- ["8132AC32",0xCA6],
- ["8132AC33",0xCA7],
- ["8132AC34",0xCA8],
- ["8132AC35",0xCA9],
- ["8132AC36",0xCAA],
- ["8132AC37",0xCAB],
- ["8132AC38",0xCAC],
- ["8132AC39",0xCAD],
- ["8132AD30",0xCAE],
- ["8132AD31",0xCAF],
- ["8132AD32",0xCB0],
- ["8132AD33",0xCB1],
- ["8132AD34",0xCB2],
- ["8132AD35",0xCB3],
- ["8132AD36",0xCB4],
- ["8132AD37",0xCB5],
- ["8132AD38",0xCB6],
- ["8132AD39",0xCB7],
- ["8132AE30",0xCB8],
- ["8132AE31",0xCB9],
- ["8132AE32",0xCBA],
- ["8132AE33",0xCBB],
- ["8132AE34",0xCBC],
- ["8132AE35",0xCBD],
- ["8132AE36",0xCBE],
- ["8132AE37",0xCBF],
- ["8132AE38",0xCC0],
- ["8132AE39",0xCC1],
- ["8132AF30",0xCC2],
- ["8132AF31",0xCC3],
- ["8132AF32",0xCC4],
- ["8132AF33",0xCC5],
- ["8132AF34",0xCC6],
- ["8132AF35",0xCC7],
- ["8132AF36",0xCC8],
- ["8132AF37",0xCC9],
- ["8132AF38",0xCCA],
- ["8132AF39",0xCCB],
- ["8132B030",0xCCC],
- ["8132B031",0xCCD],
- ["8132B032",0xCCE],
- ["8132B033",0xCCF],
- ["8132B034",0xCD0],
- ["8132B035",0xCD1],
- ["8132B036",0xCD2],
- ["8132B037",0xCD3],
- ["8132B038",0xCD4],
- ["8132B039",0xCD5],
- ["8132B130",0xCD6],
- ["8132B131",0xCD7],
- ["8132B132",0xCD8],
- ["8132B133",0xCD9],
- ["8132B134",0xCDA],
- ["8132B135",0xCDB],
- ["8132B136",0xCDC],
- ["8132B137",0xCDD],
- ["8132B138",0xCDE],
- ["8132B139",0xCDF],
- ["8132B230",0xCE0],
- ["8132B231",0xCE1],
- ["8132B232",0xCE2],
- ["8132B233",0xCE3],
- ["8132B234",0xCE4],
- ["8132B235",0xCE5],
- ["8132B236",0xCE6],
- ["8132B237",0xCE7],
- ["8132B238",0xCE8],
- ["8132B239",0xCE9],
- ["8132B330",0xCEA],
- ["8132B331",0xCEB],
- ["8132B332",0xCEC],
- ["8132B333",0xCED],
- ["8132B334",0xCEE],
- ["8132B335",0xCEF],
- ["8132B336",0xCF0],
- ["8132B337",0xCF1],
- ["8132B338",0xCF2],
- ["8132B339",0xCF3],
- ["8132B430",0xCF4],
- ["8132B431",0xCF5],
- ["8132B432",0xCF6],
- ["8132B433",0xCF7],
- ["8132B434",0xCF8],
- ["8132B435",0xCF9],
- ["8132B436",0xCFA],
- ["8132B437",0xCFB],
- ["8132B438",0xCFC],
- ["8132B439",0xCFD],
- ["8132B530",0xCFE],
- ["8132B531",0xCFF],
- ["8132B532",0xD00],
- ["8132B533",0xD01],
- ["8132B534",0xD02],
- ["8132B535",0xD03],
- ["8132B536",0xD04],
- ["8132B537",0xD05],
- ["8132B538",0xD06],
- ["8132B539",0xD07],
- ["8132B630",0xD08],
- ["8132B631",0xD09],
- ["8132B632",0xD0A],
- ["8132B633",0xD0B],
- ["8132B634",0xD0C],
- ["8132B635",0xD0D],
- ["8132B636",0xD0E],
- ["8132B637",0xD0F],
- ["8132B638",0xD10],
- ["8132B639",0xD11],
- ["8132B730",0xD12],
- ["8132B731",0xD13],
- ["8132B732",0xD14],
- ["8132B733",0xD15],
- ["8132B734",0xD16],
- ["8132B735",0xD17],
- ["8132B736",0xD18],
- ["8132B737",0xD19],
- ["8132B738",0xD1A],
- ["8132B739",0xD1B],
- ["8132B830",0xD1C],
- ["8132B831",0xD1D],
- ["8132B832",0xD1E],
- ["8132B833",0xD1F],
- ["8132B834",0xD20],
- ["8132B835",0xD21],
- ["8132B836",0xD22],
- ["8132B837",0xD23],
- ["8132B838",0xD24],
- ["8132B839",0xD25],
- ["8132B930",0xD26],
- ["8132B931",0xD27],
- ["8132B932",0xD28],
- ["8132B933",0xD29],
- ["8132B934",0xD2A],
- ["8132B935",0xD2B],
- ["8132B936",0xD2C],
- ["8132B937",0xD2D],
- ["8132B938",0xD2E],
- ["8132B939",0xD2F],
- ["8132BA30",0xD30],
- ["8132BA31",0xD31],
- ["8132BA32",0xD32],
- ["8132BA33",0xD33],
- ["8132BA34",0xD34],
- ["8132BA35",0xD35],
- ["8132BA36",0xD36],
- ["8132BA37",0xD37],
- ["8132BA38",0xD38],
- ["8132BA39",0xD39],
- ["8132BB30",0xD3A],
- ["8132BB31",0xD3B],
- ["8132BB32",0xD3C],
- ["8132BB33",0xD3D],
- ["8132BB34",0xD3E],
- ["8132BB35",0xD3F],
- ["8132BB36",0xD40],
- ["8132BB37",0xD41],
- ["8132BB38",0xD42],
- ["8132BB39",0xD43],
- ["8132BC30",0xD44],
- ["8132BC31",0xD45],
- ["8132BC32",0xD46],
- ["8132BC33",0xD47],
- ["8132BC34",0xD48],
- ["8132BC35",0xD49],
- ["8132BC36",0xD4A],
- ["8132BC37",0xD4B],
- ["8132BC38",0xD4C],
- ["8132BC39",0xD4D],
- ["8132BD30",0xD4E],
- ["8132BD31",0xD4F],
- ["8132BD32",0xD50],
- ["8132BD33",0xD51],
- ["8132BD34",0xD52],
- ["8132BD35",0xD53],
- ["8132BD36",0xD54],
- ["8132BD37",0xD55],
- ["8132BD38",0xD56],
- ["8132BD39",0xD57],
- ["8132BE30",0xD58],
- ["8132BE31",0xD59],
- ["8132BE32",0xD5A],
- ["8132BE33",0xD5B],
- ["8132BE34",0xD5C],
- ["8132BE35",0xD5D],
- ["8132BE36",0xD5E],
- ["8132BE37",0xD5F],
- ["8132BE38",0xD60],
- ["8132BE39",0xD61],
- ["8132BF30",0xD62],
- ["8132BF31",0xD63],
- ["8132BF32",0xD64],
- ["8132BF33",0xD65],
- ["8132BF34",0xD66],
- ["8132BF35",0xD67],
- ["8132BF36",0xD68],
- ["8132BF37",0xD69],
- ["8132BF38",0xD6A],
- ["8132BF39",0xD6B],
- ["8132C030",0xD6C],
- ["8132C031",0xD6D],
- ["8132C032",0xD6E],
- ["8132C033",0xD6F],
- ["8132C034",0xD70],
- ["8132C035",0xD71],
- ["8132C036",0xD72],
- ["8132C037",0xD73],
- ["8132C038",0xD74],
- ["8132C039",0xD75],
- ["8132C130",0xD76],
- ["8132C131",0xD77],
- ["8132C132",0xD78],
- ["8132C133",0xD79],
- ["8132C134",0xD7A],
- ["8132C135",0xD7B],
- ["8132C136",0xD7C],
- ["8132C137",0xD7D],
- ["8132C138",0xD7E],
- ["8132C139",0xD7F],
- ["8132C230",0xD80],
- ["8132C231",0xD81],
- ["8132C232",0xD82],
- ["8132C233",0xD83],
- ["8132C234",0xD84],
- ["8132C235",0xD85],
- ["8132C236",0xD86],
- ["8132C237",0xD87],
- ["8132C238",0xD88],
- ["8132C239",0xD89],
- ["8132C330",0xD8A],
- ["8132C331",0xD8B],
- ["8132C332",0xD8C],
- ["8132C333",0xD8D],
- ["8132C334",0xD8E],
- ["8132C335",0xD8F],
- ["8132C336",0xD90],
- ["8132C337",0xD91],
- ["8132C338",0xD92],
- ["8132C339",0xD93],
- ["8132C430",0xD94],
- ["8132C431",0xD95],
- ["8132C432",0xD96],
- ["8132C433",0xD97],
- ["8132C434",0xD98],
- ["8132C435",0xD99],
- ["8132C436",0xD9A],
- ["8132C437",0xD9B],
- ["8132C438",0xD9C],
- ["8132C439",0xD9D],
- ["8132C530",0xD9E],
- ["8132C531",0xD9F],
- ["8132C532",0xDA0],
- ["8132C533",0xDA1],
- ["8132C534",0xDA2],
- ["8132C535",0xDA3],
- ["8132C536",0xDA4],
- ["8132C537",0xDA5],
- ["8132C538",0xDA6],
- ["8132C539",0xDA7],
- ["8132C630",0xDA8],
- ["8132C631",0xDA9],
- ["8132C632",0xDAA],
- ["8132C633",0xDAB],
- ["8132C634",0xDAC],
- ["8132C635",0xDAD],
- ["8132C636",0xDAE],
- ["8132C637",0xDAF],
- ["8132C638",0xDB0],
- ["8132C639",0xDB1],
- ["8132C730",0xDB2],
- ["8132C731",0xDB3],
- ["8132C732",0xDB4],
- ["8132C733",0xDB5],
- ["8132C734",0xDB6],
- ["8132C735",0xDB7],
- ["8132C736",0xDB8],
- ["8132C737",0xDB9],
- ["8132C738",0xDBA],
- ["8132C739",0xDBB],
- ["8132C830",0xDBC],
- ["8132C831",0xDBD],
- ["8132C832",0xDBE],
- ["8132C833",0xDBF],
- ["8132C834",0xDC0],
- ["8132C835",0xDC1],
- ["8132C836",0xDC2],
- ["8132C837",0xDC3],
- ["8132C838",0xDC4],
- ["8132C839",0xDC5],
- ["8132C930",0xDC6],
- ["8132C931",0xDC7],
- ["8132C932",0xDC8],
- ["8132C933",0xDC9],
- ["8132C934",0xDCA],
- ["8132C935",0xDCB],
- ["8132C936",0xDCC],
- ["8132C937",0xDCD],
- ["8132C938",0xDCE],
- ["8132C939",0xDCF],
- ["8132CA30",0xDD0],
- ["8132CA31",0xDD1],
- ["8132CA32",0xDD2],
- ["8132CA33",0xDD3],
- ["8132CA34",0xDD4],
- ["8132CA35",0xDD5],
- ["8132CA36",0xDD6],
- ["8132CA37",0xDD7],
- ["8132CA38",0xDD8],
- ["8132CA39",0xDD9],
- ["8132CB30",0xDDA],
- ["8132CB31",0xDDB],
- ["8132CB32",0xDDC],
- ["8132CB33",0xDDD],
- ["8132CB34",0xDDE],
- ["8132CB35",0xDDF],
- ["8132CB36",0xDE0],
- ["8132CB37",0xDE1],
- ["8132CB38",0xDE2],
- ["8132CB39",0xDE3],
- ["8132CC30",0xDE4],
- ["8132CC31",0xDE5],
- ["8132CC32",0xDE6],
- ["8132CC33",0xDE7],
- ["8132CC34",0xDE8],
- ["8132CC35",0xDE9],
- ["8132CC36",0xDEA],
- ["8132CC37",0xDEB],
- ["8132CC38",0xDEC],
- ["8132CC39",0xDED],
- ["8132CD30",0xDEE],
- ["8132CD31",0xDEF],
- ["8132CD32",0xDF0],
- ["8132CD33",0xDF1],
- ["8132CD34",0xDF2],
- ["8132CD35",0xDF3],
- ["8132CD36",0xDF4],
- ["8132CD37",0xDF5],
- ["8132CD38",0xDF6],
- ["8132CD39",0xDF7],
- ["8132CE30",0xDF8],
- ["8132CE31",0xDF9],
- ["8132CE32",0xDFA],
- ["8132CE33",0xDFB],
- ["8132CE34",0xDFC],
- ["8132CE35",0xDFD],
- ["8132CE36",0xDFE],
- ["8132CE37",0xDFF],
- ["8132CE38",0xE00],
- ["8132CE39",0xE01],
- ["8132CF30",0xE02],
- ["8132CF31",0xE03],
- ["8132CF32",0xE04],
- ["8132CF33",0xE05],
- ["8132CF34",0xE06],
- ["8132CF35",0xE07],
- ["8132CF36",0xE08],
- ["8132CF37",0xE09],
- ["8132CF38",0xE0A],
- ["8132CF39",0xE0B],
- ["8132D030",0xE0C],
- ["8132D031",0xE0D],
- ["8132D032",0xE0E],
- ["8132D033",0xE0F],
- ["8132D034",0xE10],
- ["8132D035",0xE11],
- ["8132D036",0xE12],
- ["8132D037",0xE13],
- ["8132D038",0xE14],
- ["8132D039",0xE15],
- ["8132D130",0xE16],
- ["8132D131",0xE17],
- ["8132D132",0xE18],
- ["8132D133",0xE19],
- ["8132D134",0xE1A],
- ["8132D135",0xE1B],
- ["8132D136",0xE1C],
- ["8132D137",0xE1D],
- ["8132D138",0xE1E],
- ["8132D139",0xE1F],
- ["8132D230",0xE20],
- ["8132D231",0xE21],
- ["8132D232",0xE22],
- ["8132D233",0xE23],
- ["8132D234",0xE24],
- ["8132D235",0xE25],
- ["8132D236",0xE26],
- ["8132D237",0xE27],
- ["8132D238",0xE28],
- ["8132D239",0xE29],
- ["8132D330",0xE2A],
- ["8132D331",0xE2B],
- ["8132D332",0xE2C],
- ["8132D333",0xE2D],
- ["8132D334",0xE2E],
- ["8132D335",0xE2F],
- ["8132D336",0xE30],
- ["8132D337",0xE31],
- ["8132D338",0xE32],
- ["8132D339",0xE33],
- ["8132D430",0xE34],
- ["8132D431",0xE35],
- ["8132D432",0xE36],
- ["8132D433",0xE37],
- ["8132D434",0xE38],
- ["8132D435",0xE39],
- ["8132D436",0xE3A],
- ["8132D437",0xE3B],
- ["8132D438",0xE3C],
- ["8132D439",0xE3D],
- ["8132D530",0xE3E],
- ["8132D531",0xE3F],
- ["8132D532",0xE40],
- ["8132D533",0xE41],
- ["8132D534",0xE42],
- ["8132D535",0xE43],
- ["8132D536",0xE44],
- ["8132D537",0xE45],
- ["8132D538",0xE46],
- ["8132D539",0xE47],
- ["8132D630",0xE48],
- ["8132D631",0xE49],
- ["8132D632",0xE4A],
- ["8132D633",0xE4B],
- ["8132D634",0xE4C],
- ["8132D635",0xE4D],
- ["8132D636",0xE4E],
- ["8132D637",0xE4F],
- ["8132D638",0xE50],
- ["8132D639",0xE51],
- ["8132D730",0xE52],
- ["8132D731",0xE53],
- ["8132D732",0xE54],
- ["8132D733",0xE55],
- ["8132D734",0xE56],
- ["8132D735",0xE57],
- ["8132D736",0xE58],
- ["8132D737",0xE59],
- ["8132D738",0xE5A],
- ["8132D739",0xE5B],
- ["8132D830",0xE5C],
- ["8132D831",0xE5D],
- ["8132D832",0xE5E],
- ["8132D833",0xE5F],
- ["8132D834",0xE60],
- ["8132D835",0xE61],
- ["8132D836",0xE62],
- ["8132D837",0xE63],
- ["8132D838",0xE64],
- ["8132D839",0xE65],
- ["8132D930",0xE66],
- ["8132D931",0xE67],
- ["8132D932",0xE68],
- ["8132D933",0xE69],
- ["8132D934",0xE6A],
- ["8132D935",0xE6B],
- ["8132D936",0xE6C],
- ["8132D937",0xE6D],
- ["8132D938",0xE6E],
- ["8132D939",0xE6F],
- ["8132DA30",0xE70],
- ["8132DA31",0xE71],
- ["8132DA32",0xE72],
- ["8132DA33",0xE73],
- ["8132DA34",0xE74],
- ["8132DA35",0xE75],
- ["8132DA36",0xE76],
- ["8132DA37",0xE77],
- ["8132DA38",0xE78],
- ["8132DA39",0xE79],
- ["8132DB30",0xE7A],
- ["8132DB31",0xE7B],
- ["8132DB32",0xE7C],
- ["8132DB33",0xE7D],
- ["8132DB34",0xE7E],
- ["8132DB35",0xE7F],
- ["8132DB36",0xE80],
- ["8132DB37",0xE81],
- ["8132DB38",0xE82],
- ["8132DB39",0xE83],
- ["8132DC30",0xE84],
- ["8132DC31",0xE85],
- ["8132DC32",0xE86],
- ["8132DC33",0xE87],
- ["8132DC34",0xE88],
- ["8132DC35",0xE89],
- ["8132DC36",0xE8A],
- ["8132DC37",0xE8B],
- ["8132DC38",0xE8C],
- ["8132DC39",0xE8D],
- ["8132DD30",0xE8E],
- ["8132DD31",0xE8F],
- ["8132DD32",0xE90],
- ["8132DD33",0xE91],
- ["8132DD34",0xE92],
- ["8132DD35",0xE93],
- ["8132DD36",0xE94],
- ["8132DD37",0xE95],
- ["8132DD38",0xE96],
- ["8132DD39",0xE97],
- ["8132DE30",0xE98],
- ["8132DE31",0xE99],
- ["8132DE32",0xE9A],
- ["8132DE33",0xE9B],
- ["8132DE34",0xE9C],
- ["8132DE35",0xE9D],
- ["8132DE36",0xE9E],
- ["8132DE37",0xE9F],
- ["8132DE38",0xEA0],
- ["8132DE39",0xEA1],
- ["8132DF30",0xEA2],
- ["8132DF31",0xEA3],
- ["8132DF32",0xEA4],
- ["8132DF33",0xEA5],
- ["8132DF34",0xEA6],
- ["8132DF35",0xEA7],
- ["8132DF36",0xEA8],
- ["8132DF37",0xEA9],
- ["8132DF38",0xEAA],
- ["8132DF39",0xEAB],
- ["8132E030",0xEAC],
- ["8132E031",0xEAD],
- ["8132E032",0xEAE],
- ["8132E033",0xEAF],
- ["8132E034",0xEB0],
- ["8132E035",0xEB1],
- ["8132E036",0xEB2],
- ["8132E037",0xEB3],
- ["8132E038",0xEB4],
- ["8132E039",0xEB5],
- ["8132E130",0xEB6],
- ["8132E131",0xEB7],
- ["8132E132",0xEB8],
- ["8132E133",0xEB9],
- ["8132E134",0xEBA],
- ["8132E135",0xEBB],
- ["8132E136",0xEBC],
- ["8132E137",0xEBD],
- ["8132E138",0xEBE],
- ["8132E139",0xEBF],
- ["8132E230",0xEC0],
- ["8132E231",0xEC1],
- ["8132E232",0xEC2],
- ["8132E233",0xEC3],
- ["8132E234",0xEC4],
- ["8132E235",0xEC5],
- ["8132E236",0xEC6],
- ["8132E237",0xEC7],
- ["8132E238",0xEC8],
- ["8132E239",0xEC9],
- ["8132E330",0xECA],
- ["8132E331",0xECB],
- ["8132E332",0xECC],
- ["8132E333",0xECD],
- ["8132E334",0xECE],
- ["8132E335",0xECF],
- ["8132E336",0xED0],
- ["8132E337",0xED1],
- ["8132E338",0xED2],
- ["8132E339",0xED3],
- ["8132E430",0xED4],
- ["8132E431",0xED5],
- ["8132E432",0xED6],
- ["8132E433",0xED7],
- ["8132E434",0xED8],
- ["8132E435",0xED9],
- ["8132E436",0xEDA],
- ["8132E437",0xEDB],
- ["8132E438",0xEDC],
- ["8132E439",0xEDD],
- ["8132E530",0xEDE],
- ["8132E531",0xEDF],
- ["8132E532",0xEE0],
- ["8132E533",0xEE1],
- ["8132E534",0xEE2],
- ["8132E535",0xEE3],
- ["8132E536",0xEE4],
- ["8132E537",0xEE5],
- ["8132E538",0xEE6],
- ["8132E539",0xEE7],
- ["8132E630",0xEE8],
- ["8132E631",0xEE9],
- ["8132E632",0xEEA],
- ["8132E633",0xEEB],
- ["8132E634",0xEEC],
- ["8132E635",0xEED],
- ["8132E636",0xEEE],
- ["8132E637",0xEEF],
- ["8132E638",0xEF0],
- ["8132E639",0xEF1],
- ["8132E730",0xEF2],
- ["8132E731",0xEF3],
- ["8132E732",0xEF4],
- ["8132E733",0xEF5],
- ["8132E734",0xEF6],
- ["8132E735",0xEF7],
- ["8132E736",0xEF8],
- ["8132E737",0xEF9],
- ["8132E738",0xEFA],
- ["8132E739",0xEFB],
- ["8132E830",0xEFC],
- ["8132E831",0xEFD],
- ["8132E832",0xEFE],
- ["8132E833",0xEFF],
- ["8132E834",0xF00],
- ["8132E835",0xF01],
- ["8132E836",0xF02],
- ["8132E837",0xF03],
- ["8132E838",0xF04],
- ["8132E839",0xF05],
- ["8132E930",0xF06],
- ["8132E931",0xF07],
- ["8132E932",0xF08],
- ["8132E933",0xF09],
- ["8132E934",0xF0A],
- ["8132E935",0xF0B],
- ["8132E936",0xF0C],
- ["8132E937",0xF0D],
- ["8132E938",0xF0E],
- ["8132E939",0xF0F],
- ["8132EA30",0xF10],
- ["8132EA31",0xF11],
- ["8132EA32",0xF12],
- ["8132EA33",0xF13],
- ["8132EA34",0xF14],
- ["8132EA35",0xF15],
- ["8132EA36",0xF16],
- ["8132EA37",0xF17],
- ["8132EA38",0xF18],
- ["8132EA39",0xF19],
- ["8132EB30",0xF1A],
- ["8132EB31",0xF1B],
- ["8132EB32",0xF1C],
- ["8132EB33",0xF1D],
- ["8132EB34",0xF1E],
- ["8132EB35",0xF1F],
- ["8132EB36",0xF20],
- ["8132EB37",0xF21],
- ["8132EB38",0xF22],
- ["8132EB39",0xF23],
- ["8132EC30",0xF24],
- ["8132EC31",0xF25],
- ["8132EC32",0xF26],
- ["8132EC33",0xF27],
- ["8132EC34",0xF28],
- ["8132EC35",0xF29],
- ["8132EC36",0xF2A],
- ["8132EC37",0xF2B],
- ["8132EC38",0xF2C],
- ["8132EC39",0xF2D],
- ["8132ED30",0xF2E],
- ["8132ED31",0xF2F],
- ["8132ED32",0xF30],
- ["8132ED33",0xF31],
- ["8132ED34",0xF32],
- ["8132ED35",0xF33],
- ["8132ED36",0xF34],
- ["8132ED37",0xF35],
- ["8132ED38",0xF36],
- ["8132ED39",0xF37],
- ["8132EE30",0xF38],
- ["8132EE31",0xF39],
- ["8132EE32",0xF3A],
- ["8132EE33",0xF3B],
- ["8132EE34",0xF3C],
- ["8132EE35",0xF3D],
- ["8132EE36",0xF3E],
- ["8132EE37",0xF3F],
- ["8132EE38",0xF40],
- ["8132EE39",0xF41],
- ["8132EF30",0xF42],
- ["8132EF31",0xF43],
- ["8132EF32",0xF44],
- ["8132EF33",0xF45],
- ["8132EF34",0xF46],
- ["8132EF35",0xF47],
- ["8132EF36",0xF48],
- ["8132EF37",0xF49],
- ["8132EF38",0xF4A],
- ["8132EF39",0xF4B],
- ["8132F030",0xF4C],
- ["8132F031",0xF4D],
- ["8132F032",0xF4E],
- ["8132F033",0xF4F],
- ["8132F034",0xF50],
- ["8132F035",0xF51],
- ["8132F036",0xF52],
- ["8132F037",0xF53],
- ["8132F038",0xF54],
- ["8132F039",0xF55],
- ["8132F130",0xF56],
- ["8132F131",0xF57],
- ["8132F132",0xF58],
- ["8132F133",0xF59],
- ["8132F134",0xF5A],
- ["8132F135",0xF5B],
- ["8132F136",0xF5C],
- ["8132F137",0xF5D],
- ["8132F138",0xF5E],
- ["8132F139",0xF5F],
- ["8132F230",0xF60],
- ["8132F231",0xF61],
- ["8132F232",0xF62],
- ["8132F233",0xF63],
- ["8132F234",0xF64],
- ["8132F235",0xF65],
- ["8132F236",0xF66],
- ["8132F237",0xF67],
- ["8132F238",0xF68],
- ["8132F239",0xF69],
- ["8132F330",0xF6A],
- ["8132F331",0xF6B],
- ["8132F332",0xF6C],
- ["8132F333",0xF6D],
- ["8132F334",0xF6E],
- ["8132F335",0xF6F],
- ["8132F336",0xF70],
- ["8132F337",0xF71],
- ["8132F338",0xF72],
- ["8132F339",0xF73],
- ["8132F430",0xF74],
- ["8132F431",0xF75],
- ["8132F432",0xF76],
- ["8132F433",0xF77],
- ["8132F434",0xF78],
- ["8132F435",0xF79],
- ["8132F436",0xF7A],
- ["8132F437",0xF7B],
- ["8132F438",0xF7C],
- ["8132F439",0xF7D],
- ["8132F530",0xF7E],
- ["8132F531",0xF7F],
- ["8132F532",0xF80],
- ["8132F533",0xF81],
- ["8132F534",0xF82],
- ["8132F535",0xF83],
- ["8132F536",0xF84],
- ["8132F537",0xF85],
- ["8132F538",0xF86],
- ["8132F539",0xF87],
- ["8132F630",0xF88],
- ["8132F631",0xF89],
- ["8132F632",0xF8A],
- ["8132F633",0xF8B],
- ["8132F634",0xF8C],
- ["8132F635",0xF8D],
- ["8132F636",0xF8E],
- ["8132F637",0xF8F],
- ["8132F638",0xF90],
- ["8132F639",0xF91],
- ["8132F730",0xF92],
- ["8132F731",0xF93],
- ["8132F732",0xF94],
- ["8132F733",0xF95],
- ["8132F734",0xF96],
- ["8132F735",0xF97],
- ["8132F736",0xF98],
- ["8132F737",0xF99],
- ["8132F738",0xF9A],
- ["8132F739",0xF9B],
- ["8132F830",0xF9C],
- ["8132F831",0xF9D],
- ["8132F832",0xF9E],
- ["8132F833",0xF9F],
- ["8132F834",0xFA0],
- ["8132F835",0xFA1],
- ["8132F836",0xFA2],
- ["8132F837",0xFA3],
- ["8132F838",0xFA4],
- ["8132F839",0xFA5],
- ["8132F930",0xFA6],
- ["8132F931",0xFA7],
- ["8132F932",0xFA8],
- ["8132F933",0xFA9],
- ["8132F934",0xFAA],
- ["8132F935",0xFAB],
- ["8132F936",0xFAC],
- ["8132F937",0xFAD],
- ["8132F938",0xFAE],
- ["8132F939",0xFAF],
- ["8132FA30",0xFB0],
- ["8132FA31",0xFB1],
- ["8132FA32",0xFB2],
- ["8132FA33",0xFB3],
- ["8132FA34",0xFB4],
- ["8132FA35",0xFB5],
- ["8132FA36",0xFB6],
- ["8132FA37",0xFB7],
- ["8132FA38",0xFB8],
- ["8132FA39",0xFB9],
- ["8132FB30",0xFBA],
- ["8132FB31",0xFBB],
- ["8132FB32",0xFBC],
- ["8132FB33",0xFBD],
- ["8132FB34",0xFBE],
- ["8132FB35",0xFBF],
- ["8132FB36",0xFC0],
- ["8132FB37",0xFC1],
- ["8132FB38",0xFC2],
- ["8132FB39",0xFC3],
- ["8132FC30",0xFC4],
- ["8132FC31",0xFC5],
- ["8132FC32",0xFC6],
- ["8132FC33",0xFC7],
- ["8132FC34",0xFC8],
- ["8132FC35",0xFC9],
- ["8132FC36",0xFCA],
- ["8132FC37",0xFCB],
- ["8132FC38",0xFCC],
- ["8132FC39",0xFCD],
- ["8132FD30",0xFCE],
- ["8132FD31",0xFCF],
- ["8132FD32",0xFD0],
- ["8132FD33",0xFD1],
- ["8132FD34",0xFD2],
- ["8132FD35",0xFD3],
- ["8132FD36",0xFD4],
- ["8132FD37",0xFD5],
- ["8132FD38",0xFD6],
- ["8132FD39",0xFD7],
- ["8132FE30",0xFD8],
- ["8132FE31",0xFD9],
- ["8132FE32",0xFDA],
- ["8132FE33",0xFDB],
- ["8132FE34",0xFDC],
- ["8132FE35",0xFDD],
- ["8132FE36",0xFDE],
- ["8132FE37",0xFDF],
- ["8132FE38",0xFE0],
- ["8132FE39",0xFE1],
- ["81338130",0xFE2],
- ["81338131",0xFE3],
- ["81338132",0xFE4],
- ["81338133",0xFE5],
- ["81338134",0xFE6],
- ["81338135",0xFE7],
- ["81338136",0xFE8],
- ["81338137",0xFE9],
- ["81338138",0xFEA],
- ["81338139",0xFEB],
- ["81338230",0xFEC],
- ["81338231",0xFED],
- ["81338232",0xFEE],
- ["81338233",0xFEF],
- ["81338234",0xFF0],
- ["81338235",0xFF1],
- ["81338236",0xFF2],
- ["81338237",0xFF3],
- ["81338238",0xFF4],
- ["81338239",0xFF5],
- ["81338330",0xFF6],
- ["81338331",0xFF7],
- ["81338332",0xFF8],
- ["81338333",0xFF9],
- ["81338334",0xFFA],
- ["81338335",0xFFB],
- ["81338336",0xFFC],
- ["81338337",0xFFD],
- ["81338338",0xFFE],
- ["81338339",0xFFF],
- ["81338430",0x1000],
- ["81338431",0x1001],
- ["81338432",0x1002],
- ["81338433",0x1003],
- ["81338434",0x1004],
- ["81338435",0x1005],
- ["81338436",0x1006],
- ["81338437",0x1007],
- ["81338438",0x1008],
- ["81338439",0x1009],
- ["81338530",0x100A],
- ["81338531",0x100B],
- ["81338532",0x100C],
- ["81338533",0x100D],
- ["81338534",0x100E],
- ["81338535",0x100F],
- ["81338536",0x1010],
- ["81338537",0x1011],
- ["81338538",0x1012],
- ["81338539",0x1013],
- ["81338630",0x1014],
- ["81338631",0x1015],
- ["81338632",0x1016],
- ["81338633",0x1017],
- ["81338634",0x1018],
- ["81338635",0x1019],
- ["81338636",0x101A],
- ["81338637",0x101B],
- ["81338638",0x101C],
- ["81338639",0x101D],
- ["81338730",0x101E],
- ["81338731",0x101F],
- ["81338732",0x1020],
- ["81338733",0x1021],
- ["81338734",0x1022],
- ["81338735",0x1023],
- ["81338736",0x1024],
- ["81338737",0x1025],
- ["81338738",0x1026],
- ["81338739",0x1027],
- ["81338830",0x1028],
- ["81338831",0x1029],
- ["81338832",0x102A],
- ["81338833",0x102B],
- ["81338834",0x102C],
- ["81338835",0x102D],
- ["81338836",0x102E],
- ["81338837",0x102F],
- ["81338838",0x1030],
- ["81338839",0x1031],
- ["81338930",0x1032],
- ["81338931",0x1033],
- ["81338932",0x1034],
- ["81338933",0x1035],
- ["81338934",0x1036],
- ["81338935",0x1037],
- ["81338936",0x1038],
- ["81338937",0x1039],
- ["81338938",0x103A],
- ["81338939",0x103B],
- ["81338A30",0x103C],
- ["81338A31",0x103D],
- ["81338A32",0x103E],
- ["81338A33",0x103F],
- ["81338A34",0x1040],
- ["81338A35",0x1041],
- ["81338A36",0x1042],
- ["81338A37",0x1043],
- ["81338A38",0x1044],
- ["81338A39",0x1045],
- ["81338B30",0x1046],
- ["81338B31",0x1047],
- ["81338B32",0x1048],
- ["81338B33",0x1049],
- ["81338B34",0x104A],
- ["81338B35",0x104B],
- ["81338B36",0x104C],
- ["81338B37",0x104D],
- ["81338B38",0x104E],
- ["81338B39",0x104F],
- ["81338C30",0x1050],
- ["81338C31",0x1051],
- ["81338C32",0x1052],
- ["81338C33",0x1053],
- ["81338C34",0x1054],
- ["81338C35",0x1055],
- ["81338C36",0x1056],
- ["81338C37",0x1057],
- ["81338C38",0x1058],
- ["81338C39",0x1059],
- ["81338D30",0x105A],
- ["81338D31",0x105B],
- ["81338D32",0x105C],
- ["81338D33",0x105D],
- ["81338D34",0x105E],
- ["81338D35",0x105F],
- ["81338D36",0x1060],
- ["81338D37",0x1061],
- ["81338D38",0x1062],
- ["81338D39",0x1063],
- ["81338E30",0x1064],
- ["81338E31",0x1065],
- ["81338E32",0x1066],
- ["81338E33",0x1067],
- ["81338E34",0x1068],
- ["81338E35",0x1069],
- ["81338E36",0x106A],
- ["81338E37",0x106B],
- ["81338E38",0x106C],
- ["81338E39",0x106D],
- ["81338F30",0x106E],
- ["81338F31",0x106F],
- ["81338F32",0x1070],
- ["81338F33",0x1071],
- ["81338F34",0x1072],
- ["81338F35",0x1073],
- ["81338F36",0x1074],
- ["81338F37",0x1075],
- ["81338F38",0x1076],
- ["81338F39",0x1077],
- ["81339030",0x1078],
- ["81339031",0x1079],
- ["81339032",0x107A],
- ["81339033",0x107B],
- ["81339034",0x107C],
- ["81339035",0x107D],
- ["81339036",0x107E],
- ["81339037",0x107F],
- ["81339038",0x1080],
- ["81339039",0x1081],
- ["81339130",0x1082],
- ["81339131",0x1083],
- ["81339132",0x1084],
- ["81339133",0x1085],
- ["81339134",0x1086],
- ["81339135",0x1087],
- ["81339136",0x1088],
- ["81339137",0x1089],
- ["81339138",0x108A],
- ["81339139",0x108B],
- ["81339230",0x108C],
- ["81339231",0x108D],
- ["81339232",0x108E],
- ["81339233",0x108F],
- ["81339234",0x1090],
- ["81339235",0x1091],
- ["81339236",0x1092],
- ["81339237",0x1093],
- ["81339238",0x1094],
- ["81339239",0x1095],
- ["81339330",0x1096],
- ["81339331",0x1097],
- ["81339332",0x1098],
- ["81339333",0x1099],
- ["81339334",0x109A],
- ["81339335",0x109B],
- ["81339336",0x109C],
- ["81339337",0x109D],
- ["81339338",0x109E],
- ["81339339",0x109F],
- ["81339430",0x10A0],
- ["81339431",0x10A1],
- ["81339432",0x10A2],
- ["81339433",0x10A3],
- ["81339434",0x10A4],
- ["81339435",0x10A5],
- ["81339436",0x10A6],
- ["81339437",0x10A7],
- ["81339438",0x10A8],
- ["81339439",0x10A9],
- ["81339530",0x10AA],
- ["81339531",0x10AB],
- ["81339532",0x10AC],
- ["81339533",0x10AD],
- ["81339534",0x10AE],
- ["81339535",0x10AF],
- ["81339536",0x10B0],
- ["81339537",0x10B1],
- ["81339538",0x10B2],
- ["81339539",0x10B3],
- ["81339630",0x10B4],
- ["81339631",0x10B5],
- ["81339632",0x10B6],
- ["81339633",0x10B7],
- ["81339634",0x10B8],
- ["81339635",0x10B9],
- ["81339636",0x10BA],
- ["81339637",0x10BB],
- ["81339638",0x10BC],
- ["81339639",0x10BD],
- ["81339730",0x10BE],
- ["81339731",0x10BF],
- ["81339732",0x10C0],
- ["81339733",0x10C1],
- ["81339734",0x10C2],
- ["81339735",0x10C3],
- ["81339736",0x10C4],
- ["81339737",0x10C5],
- ["81339738",0x10C6],
- ["81339739",0x10C7],
- ["81339830",0x10C8],
- ["81339831",0x10C9],
- ["81339832",0x10CA],
- ["81339833",0x10CB],
- ["81339834",0x10CC],
- ["81339835",0x10CD],
- ["81339836",0x10CE],
- ["81339837",0x10CF],
- ["81339838",0x10D0],
- ["81339839",0x10D1],
- ["81339930",0x10D2],
- ["81339931",0x10D3],
- ["81339932",0x10D4],
- ["81339933",0x10D5],
- ["81339934",0x10D6],
- ["81339935",0x10D7],
- ["81339936",0x10D8],
- ["81339937",0x10D9],
- ["81339938",0x10DA],
- ["81339939",0x10DB],
- ["81339A30",0x10DC],
- ["81339A31",0x10DD],
- ["81339A32",0x10DE],
- ["81339A33",0x10DF],
- ["81339A34",0x10E0],
- ["81339A35",0x10E1],
- ["81339A36",0x10E2],
- ["81339A37",0x10E3],
- ["81339A38",0x10E4],
- ["81339A39",0x10E5],
- ["81339B30",0x10E6],
- ["81339B31",0x10E7],
- ["81339B32",0x10E8],
- ["81339B33",0x10E9],
- ["81339B34",0x10EA],
- ["81339B35",0x10EB],
- ["81339B36",0x10EC],
- ["81339B37",0x10ED],
- ["81339B38",0x10EE],
- ["81339B39",0x10EF],
- ["81339C30",0x10F0],
- ["81339C31",0x10F1],
- ["81339C32",0x10F2],
- ["81339C33",0x10F3],
- ["81339C34",0x10F4],
- ["81339C35",0x10F5],
- ["81339C36",0x10F6],
- ["81339C37",0x10F7],
- ["81339C38",0x10F8],
- ["81339C39",0x10F9],
- ["81339D30",0x10FA],
- ["81339D31",0x10FB],
- ["81339D32",0x10FC],
- ["81339D33",0x10FD],
- ["81339D34",0x10FE],
- ["81339D35",0x10FF],
- ["81339D36",0x1100],
- ["81339D37",0x1101],
- ["81339D38",0x1102],
- ["81339D39",0x1103],
- ["81339E30",0x1104],
- ["81339E31",0x1105],
- ["81339E32",0x1106],
- ["81339E33",0x1107],
- ["81339E34",0x1108],
- ["81339E35",0x1109],
- ["81339E36",0x110A],
- ["81339E37",0x110B],
- ["81339E38",0x110C],
- ["81339E39",0x110D],
- ["81339F30",0x110E],
- ["81339F31",0x110F],
- ["81339F32",0x1110],
- ["81339F33",0x1111],
- ["81339F34",0x1112],
- ["81339F35",0x1113],
- ["81339F36",0x1114],
- ["81339F37",0x1115],
- ["81339F38",0x1116],
- ["81339F39",0x1117],
- ["8133A030",0x1118],
- ["8133A031",0x1119],
- ["8133A032",0x111A],
- ["8133A033",0x111B],
- ["8133A034",0x111C],
- ["8133A035",0x111D],
- ["8133A036",0x111E],
- ["8133A037",0x111F],
- ["8133A038",0x1120],
- ["8133A039",0x1121],
- ["8133A130",0x1122],
- ["8133A131",0x1123],
- ["8133A132",0x1124],
- ["8133A133",0x1125],
- ["8133A134",0x1126],
- ["8133A135",0x1127],
- ["8133A136",0x1128],
- ["8133A137",0x1129],
- ["8133A138",0x112A],
- ["8133A139",0x112B],
- ["8133A230",0x112C],
- ["8133A231",0x112D],
- ["8133A232",0x112E],
- ["8133A233",0x112F],
- ["8133A234",0x1130],
- ["8133A235",0x1131],
- ["8133A236",0x1132],
- ["8133A237",0x1133],
- ["8133A238",0x1134],
- ["8133A239",0x1135],
- ["8133A330",0x1136],
- ["8133A331",0x1137],
- ["8133A332",0x1138],
- ["8133A333",0x1139],
- ["8133A334",0x113A],
- ["8133A335",0x113B],
- ["8133A336",0x113C],
- ["8133A337",0x113D],
- ["8133A338",0x113E],
- ["8133A339",0x113F],
- ["8133A430",0x1140],
- ["8133A431",0x1141],
- ["8133A432",0x1142],
- ["8133A433",0x1143],
- ["8133A434",0x1144],
- ["8133A435",0x1145],
- ["8133A436",0x1146],
- ["8133A437",0x1147],
- ["8133A438",0x1148],
- ["8133A439",0x1149],
- ["8133A530",0x114A],
- ["8133A531",0x114B],
- ["8133A532",0x114C],
- ["8133A533",0x114D],
- ["8133A534",0x114E],
- ["8133A535",0x114F],
- ["8133A536",0x1150],
- ["8133A537",0x1151],
- ["8133A538",0x1152],
- ["8133A539",0x1153],
- ["8133A630",0x1154],
- ["8133A631",0x1155],
- ["8133A632",0x1156],
- ["8133A633",0x1157],
- ["8133A634",0x1158],
- ["8133A635",0x1159],
- ["8133A636",0x115A],
- ["8133A637",0x115B],
- ["8133A638",0x115C],
- ["8133A639",0x115D],
- ["8133A730",0x115E],
- ["8133A731",0x115F],
- ["8133A732",0x1160],
- ["8133A733",0x1161],
- ["8133A734",0x1162],
- ["8133A735",0x1163],
- ["8133A736",0x1164],
- ["8133A737",0x1165],
- ["8133A738",0x1166],
- ["8133A739",0x1167],
- ["8133A830",0x1168],
- ["8133A831",0x1169],
- ["8133A832",0x116A],
- ["8133A833",0x116B],
- ["8133A834",0x116C],
- ["8133A835",0x116D],
- ["8133A836",0x116E],
- ["8133A837",0x116F],
- ["8133A838",0x1170],
- ["8133A839",0x1171],
- ["8133A930",0x1172],
- ["8133A931",0x1173],
- ["8133A932",0x1174],
- ["8133A933",0x1175],
- ["8133A934",0x1176],
- ["8133A935",0x1177],
- ["8133A936",0x1178],
- ["8133A937",0x1179],
- ["8133A938",0x117A],
- ["8133A939",0x117B],
- ["8133AA30",0x117C],
- ["8133AA31",0x117D],
- ["8133AA32",0x117E],
- ["8133AA33",0x117F],
- ["8133AA34",0x1180],
- ["8133AA35",0x1181],
- ["8133AA36",0x1182],
- ["8133AA37",0x1183],
- ["8133AA38",0x1184],
- ["8133AA39",0x1185],
- ["8133AB30",0x1186],
- ["8133AB31",0x1187],
- ["8133AB32",0x1188],
- ["8133AB33",0x1189],
- ["8133AB34",0x118A],
- ["8133AB35",0x118B],
- ["8133AB36",0x118C],
- ["8133AB37",0x118D],
- ["8133AB38",0x118E],
- ["8133AB39",0x118F],
- ["8133AC30",0x1190],
- ["8133AC31",0x1191],
- ["8133AC32",0x1192],
- ["8133AC33",0x1193],
- ["8133AC34",0x1194],
- ["8133AC35",0x1195],
- ["8133AC36",0x1196],
- ["8133AC37",0x1197],
- ["8133AC38",0x1198],
- ["8133AC39",0x1199],
- ["8133AD30",0x119A],
- ["8133AD31",0x119B],
- ["8133AD32",0x119C],
- ["8133AD33",0x119D],
- ["8133AD34",0x119E],
- ["8133AD35",0x119F],
- ["8133AD36",0x11A0],
- ["8133AD37",0x11A1],
- ["8133AD38",0x11A2],
- ["8133AD39",0x11A3],
- ["8133AE30",0x11A4],
- ["8133AE31",0x11A5],
- ["8133AE32",0x11A6],
- ["8133AE33",0x11A7],
- ["8133AE34",0x11A8],
- ["8133AE35",0x11A9],
- ["8133AE36",0x11AA],
- ["8133AE37",0x11AB],
- ["8133AE38",0x11AC],
- ["8133AE39",0x11AD],
- ["8133AF30",0x11AE],
- ["8133AF31",0x11AF],
- ["8133AF32",0x11B0],
- ["8133AF33",0x11B1],
- ["8133AF34",0x11B2],
- ["8133AF35",0x11B3],
- ["8133AF36",0x11B4],
- ["8133AF37",0x11B5],
- ["8133AF38",0x11B6],
- ["8133AF39",0x11B7],
- ["8133B030",0x11B8],
- ["8133B031",0x11B9],
- ["8133B032",0x11BA],
- ["8133B033",0x11BB],
- ["8133B034",0x11BC],
- ["8133B035",0x11BD],
- ["8133B036",0x11BE],
- ["8133B037",0x11BF],
- ["8133B038",0x11C0],
- ["8133B039",0x11C1],
- ["8133B130",0x11C2],
- ["8133B131",0x11C3],
- ["8133B132",0x11C4],
- ["8133B133",0x11C5],
- ["8133B134",0x11C6],
- ["8133B135",0x11C7],
- ["8133B136",0x11C8],
- ["8133B137",0x11C9],
- ["8133B138",0x11CA],
- ["8133B139",0x11CB],
- ["8133B230",0x11CC],
- ["8133B231",0x11CD],
- ["8133B232",0x11CE],
- ["8133B233",0x11CF],
- ["8133B234",0x11D0],
- ["8133B235",0x11D1],
- ["8133B236",0x11D2],
- ["8133B237",0x11D3],
- ["8133B238",0x11D4],
- ["8133B239",0x11D5],
- ["8133B330",0x11D6],
- ["8133B331",0x11D7],
- ["8133B332",0x11D8],
- ["8133B333",0x11D9],
- ["8133B334",0x11DA],
- ["8133B335",0x11DB],
- ["8133B336",0x11DC],
- ["8133B337",0x11DD],
- ["8133B338",0x11DE],
- ["8133B339",0x11DF],
- ["8133B430",0x11E0],
- ["8133B431",0x11E1],
- ["8133B432",0x11E2],
- ["8133B433",0x11E3],
- ["8133B434",0x11E4],
- ["8133B435",0x11E5],
- ["8133B436",0x11E6],
- ["8133B437",0x11E7],
- ["8133B438",0x11E8],
- ["8133B439",0x11E9],
- ["8133B530",0x11EA],
- ["8133B531",0x11EB],
- ["8133B532",0x11EC],
- ["8133B533",0x11ED],
- ["8133B534",0x11EE],
- ["8133B535",0x11EF],
- ["8133B536",0x11F0],
- ["8133B537",0x11F1],
- ["8133B538",0x11F2],
- ["8133B539",0x11F3],
- ["8133B630",0x11F4],
- ["8133B631",0x11F5],
- ["8133B632",0x11F6],
- ["8133B633",0x11F7],
- ["8133B634",0x11F8],
- ["8133B635",0x11F9],
- ["8133B636",0x11FA],
- ["8133B637",0x11FB],
- ["8133B638",0x11FC],
- ["8133B639",0x11FD],
- ["8133B730",0x11FE],
- ["8133B731",0x11FF],
- ["8133B732",0x1200],
- ["8133B733",0x1201],
- ["8133B734",0x1202],
- ["8133B735",0x1203],
- ["8133B736",0x1204],
- ["8133B737",0x1205],
- ["8133B738",0x1206],
- ["8133B739",0x1207],
- ["8133B830",0x1208],
- ["8133B831",0x1209],
- ["8133B832",0x120A],
- ["8133B833",0x120B],
- ["8133B834",0x120C],
- ["8133B835",0x120D],
- ["8133B836",0x120E],
- ["8133B837",0x120F],
- ["8133B838",0x1210],
- ["8133B839",0x1211],
- ["8133B930",0x1212],
- ["8133B931",0x1213],
- ["8133B932",0x1214],
- ["8133B933",0x1215],
- ["8133B934",0x1216],
- ["8133B935",0x1217],
- ["8133B936",0x1218],
- ["8133B937",0x1219],
- ["8133B938",0x121A],
- ["8133B939",0x121B],
- ["8133BA30",0x121C],
- ["8133BA31",0x121D],
- ["8133BA32",0x121E],
- ["8133BA33",0x121F],
- ["8133BA34",0x1220],
- ["8133BA35",0x1221],
- ["8133BA36",0x1222],
- ["8133BA37",0x1223],
- ["8133BA38",0x1224],
- ["8133BA39",0x1225],
- ["8133BB30",0x1226],
- ["8133BB31",0x1227],
- ["8133BB32",0x1228],
- ["8133BB33",0x1229],
- ["8133BB34",0x122A],
- ["8133BB35",0x122B],
- ["8133BB36",0x122C],
- ["8133BB37",0x122D],
- ["8133BB38",0x122E],
- ["8133BB39",0x122F],
- ["8133BC30",0x1230],
- ["8133BC31",0x1231],
- ["8133BC32",0x1232],
- ["8133BC33",0x1233],
- ["8133BC34",0x1234],
- ["8133BC35",0x1235],
- ["8133BC36",0x1236],
- ["8133BC37",0x1237],
- ["8133BC38",0x1238],
- ["8133BC39",0x1239],
- ["8133BD30",0x123A],
- ["8133BD31",0x123B],
- ["8133BD32",0x123C],
- ["8133BD33",0x123D],
- ["8133BD34",0x123E],
- ["8133BD35",0x123F],
- ["8133BD36",0x1240],
- ["8133BD37",0x1241],
- ["8133BD38",0x1242],
- ["8133BD39",0x1243],
- ["8133BE30",0x1244],
- ["8133BE31",0x1245],
- ["8133BE32",0x1246],
- ["8133BE33",0x1247],
- ["8133BE34",0x1248],
- ["8133BE35",0x1249],
- ["8133BE36",0x124A],
- ["8133BE37",0x124B],
- ["8133BE38",0x124C],
- ["8133BE39",0x124D],
- ["8133BF30",0x124E],
- ["8133BF31",0x124F],
- ["8133BF32",0x1250],
- ["8133BF33",0x1251],
- ["8133BF34",0x1252],
- ["8133BF35",0x1253],
- ["8133BF36",0x1254],
- ["8133BF37",0x1255],
- ["8133BF38",0x1256],
- ["8133BF39",0x1257],
- ["8133C030",0x1258],
- ["8133C031",0x1259],
- ["8133C032",0x125A],
- ["8133C033",0x125B],
- ["8133C034",0x125C],
- ["8133C035",0x125D],
- ["8133C036",0x125E],
- ["8133C037",0x125F],
- ["8133C038",0x1260],
- ["8133C039",0x1261],
- ["8133C130",0x1262],
- ["8133C131",0x1263],
- ["8133C132",0x1264],
- ["8133C133",0x1265],
- ["8133C134",0x1266],
- ["8133C135",0x1267],
- ["8133C136",0x1268],
- ["8133C137",0x1269],
- ["8133C138",0x126A],
- ["8133C139",0x126B],
- ["8133C230",0x126C],
- ["8133C231",0x126D],
- ["8133C232",0x126E],
- ["8133C233",0x126F],
- ["8133C234",0x1270],
- ["8133C235",0x1271],
- ["8133C236",0x1272],
- ["8133C237",0x1273],
- ["8133C238",0x1274],
- ["8133C239",0x1275],
- ["8133C330",0x1276],
- ["8133C331",0x1277],
- ["8133C332",0x1278],
- ["8133C333",0x1279],
- ["8133C334",0x127A],
- ["8133C335",0x127B],
- ["8133C336",0x127C],
- ["8133C337",0x127D],
- ["8133C338",0x127E],
- ["8133C339",0x127F],
- ["8133C430",0x1280],
- ["8133C431",0x1281],
- ["8133C432",0x1282],
- ["8133C433",0x1283],
- ["8133C434",0x1284],
- ["8133C435",0x1285],
- ["8133C436",0x1286],
- ["8133C437",0x1287],
- ["8133C438",0x1288],
- ["8133C439",0x1289],
- ["8133C530",0x128A],
- ["8133C531",0x128B],
- ["8133C532",0x128C],
- ["8133C533",0x128D],
- ["8133C534",0x128E],
- ["8133C535",0x128F],
- ["8133C536",0x1290],
- ["8133C537",0x1291],
- ["8133C538",0x1292],
- ["8133C539",0x1293],
- ["8133C630",0x1294],
- ["8133C631",0x1295],
- ["8133C632",0x1296],
- ["8133C633",0x1297],
- ["8133C634",0x1298],
- ["8133C635",0x1299],
- ["8133C636",0x129A],
- ["8133C637",0x129B],
- ["8133C638",0x129C],
- ["8133C639",0x129D],
- ["8133C730",0x129E],
- ["8133C731",0x129F],
- ["8133C732",0x12A0],
- ["8133C733",0x12A1],
- ["8133C734",0x12A2],
- ["8133C735",0x12A3],
- ["8133C736",0x12A4],
- ["8133C737",0x12A5],
- ["8133C738",0x12A6],
- ["8133C739",0x12A7],
- ["8133C830",0x12A8],
- ["8133C831",0x12A9],
- ["8133C832",0x12AA],
- ["8133C833",0x12AB],
- ["8133C834",0x12AC],
- ["8133C835",0x12AD],
- ["8133C836",0x12AE],
- ["8133C837",0x12AF],
- ["8133C838",0x12B0],
- ["8133C839",0x12B1],
- ["8133C930",0x12B2],
- ["8133C931",0x12B3],
- ["8133C932",0x12B4],
- ["8133C933",0x12B5],
- ["8133C934",0x12B6],
- ["8133C935",0x12B7],
- ["8133C936",0x12B8],
- ["8133C937",0x12B9],
- ["8133C938",0x12BA],
- ["8133C939",0x12BB],
- ["8133CA30",0x12BC],
- ["8133CA31",0x12BD],
- ["8133CA32",0x12BE],
- ["8133CA33",0x12BF],
- ["8133CA34",0x12C0],
- ["8133CA35",0x12C1],
- ["8133CA36",0x12C2],
- ["8133CA37",0x12C3],
- ["8133CA38",0x12C4],
- ["8133CA39",0x12C5],
- ["8133CB30",0x12C6],
- ["8133CB31",0x12C7],
- ["8133CB32",0x12C8],
- ["8133CB33",0x12C9],
- ["8133CB34",0x12CA],
- ["8133CB35",0x12CB],
- ["8133CB36",0x12CC],
- ["8133CB37",0x12CD],
- ["8133CB38",0x12CE],
- ["8133CB39",0x12CF],
- ["8133CC30",0x12D0],
- ["8133CC31",0x12D1],
- ["8133CC32",0x12D2],
- ["8133CC33",0x12D3],
- ["8133CC34",0x12D4],
- ["8133CC35",0x12D5],
- ["8133CC36",0x12D6],
- ["8133CC37",0x12D7],
- ["8133CC38",0x12D8],
- ["8133CC39",0x12D9],
- ["8133CD30",0x12DA],
- ["8133CD31",0x12DB],
- ["8133CD32",0x12DC],
- ["8133CD33",0x12DD],
- ["8133CD34",0x12DE],
- ["8133CD35",0x12DF],
- ["8133CD36",0x12E0],
- ["8133CD37",0x12E1],
- ["8133CD38",0x12E2],
- ["8133CD39",0x12E3],
- ["8133CE30",0x12E4],
- ["8133CE31",0x12E5],
- ["8133CE32",0x12E6],
- ["8133CE33",0x12E7],
- ["8133CE34",0x12E8],
- ["8133CE35",0x12E9],
- ["8133CE36",0x12EA],
- ["8133CE37",0x12EB],
- ["8133CE38",0x12EC],
- ["8133CE39",0x12ED],
- ["8133CF30",0x12EE],
- ["8133CF31",0x12EF],
- ["8133CF32",0x12F0],
- ["8133CF33",0x12F1],
- ["8133CF34",0x12F2],
- ["8133CF35",0x12F3],
- ["8133CF36",0x12F4],
- ["8133CF37",0x12F5],
- ["8133CF38",0x12F6],
- ["8133CF39",0x12F7],
- ["8133D030",0x12F8],
- ["8133D031",0x12F9],
- ["8133D032",0x12FA],
- ["8133D033",0x12FB],
- ["8133D034",0x12FC],
- ["8133D035",0x12FD],
- ["8133D036",0x12FE],
- ["8133D037",0x12FF],
- ["8133D038",0x1300],
- ["8133D039",0x1301],
- ["8133D130",0x1302],
- ["8133D131",0x1303],
- ["8133D132",0x1304],
- ["8133D133",0x1305],
- ["8133D134",0x1306],
- ["8133D135",0x1307],
- ["8133D136",0x1308],
- ["8133D137",0x1309],
- ["8133D138",0x130A],
- ["8133D139",0x130B],
- ["8133D230",0x130C],
- ["8133D231",0x130D],
- ["8133D232",0x130E],
- ["8133D233",0x130F],
- ["8133D234",0x1310],
- ["8133D235",0x1311],
- ["8133D236",0x1312],
- ["8133D237",0x1313],
- ["8133D238",0x1314],
- ["8133D239",0x1315],
- ["8133D330",0x1316],
- ["8133D331",0x1317],
- ["8133D332",0x1318],
- ["8133D333",0x1319],
- ["8133D334",0x131A],
- ["8133D335",0x131B],
- ["8133D336",0x131C],
- ["8133D337",0x131D],
- ["8133D338",0x131E],
- ["8133D339",0x131F],
- ["8133D430",0x1320],
- ["8133D431",0x1321],
- ["8133D432",0x1322],
- ["8133D433",0x1323],
- ["8133D434",0x1324],
- ["8133D435",0x1325],
- ["8133D436",0x1326],
- ["8133D437",0x1327],
- ["8133D438",0x1328],
- ["8133D439",0x1329],
- ["8133D530",0x132A],
- ["8133D531",0x132B],
- ["8133D532",0x132C],
- ["8133D533",0x132D],
- ["8133D534",0x132E],
- ["8133D535",0x132F],
- ["8133D536",0x1330],
- ["8133D537",0x1331],
- ["8133D538",0x1332],
- ["8133D539",0x1333],
- ["8133D630",0x1334],
- ["8133D631",0x1335],
- ["8133D632",0x1336],
- ["8133D633",0x1337],
- ["8133D634",0x1338],
- ["8133D635",0x1339],
- ["8133D636",0x133A],
- ["8133D637",0x133B],
- ["8133D638",0x133C],
- ["8133D639",0x133D],
- ["8133D730",0x133E],
- ["8133D731",0x133F],
- ["8133D732",0x1340],
- ["8133D733",0x1341],
- ["8133D734",0x1342],
- ["8133D735",0x1343],
- ["8133D736",0x1344],
- ["8133D737",0x1345],
- ["8133D738",0x1346],
- ["8133D739",0x1347],
- ["8133D830",0x1348],
- ["8133D831",0x1349],
- ["8133D832",0x134A],
- ["8133D833",0x134B],
- ["8133D834",0x134C],
- ["8133D835",0x134D],
- ["8133D836",0x134E],
- ["8133D837",0x134F],
- ["8133D838",0x1350],
- ["8133D839",0x1351],
- ["8133D930",0x1352],
- ["8133D931",0x1353],
- ["8133D932",0x1354],
- ["8133D933",0x1355],
- ["8133D934",0x1356],
- ["8133D935",0x1357],
- ["8133D936",0x1358],
- ["8133D937",0x1359],
- ["8133D938",0x135A],
- ["8133D939",0x135B],
- ["8133DA30",0x135C],
- ["8133DA31",0x135D],
- ["8133DA32",0x135E],
- ["8133DA33",0x135F],
- ["8133DA34",0x1360],
- ["8133DA35",0x1361],
- ["8133DA36",0x1362],
- ["8133DA37",0x1363],
- ["8133DA38",0x1364],
- ["8133DA39",0x1365],
- ["8133DB30",0x1366],
- ["8133DB31",0x1367],
- ["8133DB32",0x1368],
- ["8133DB33",0x1369],
- ["8133DB34",0x136A],
- ["8133DB35",0x136B],
- ["8133DB36",0x136C],
- ["8133DB37",0x136D],
- ["8133DB38",0x136E],
- ["8133DB39",0x136F],
- ["8133DC30",0x1370],
- ["8133DC31",0x1371],
- ["8133DC32",0x1372],
- ["8133DC33",0x1373],
- ["8133DC34",0x1374],
- ["8133DC35",0x1375],
- ["8133DC36",0x1376],
- ["8133DC37",0x1377],
- ["8133DC38",0x1378],
- ["8133DC39",0x1379],
- ["8133DD30",0x137A],
- ["8133DD31",0x137B],
- ["8133DD32",0x137C],
- ["8133DD33",0x137D],
- ["8133DD34",0x137E],
- ["8133DD35",0x137F],
- ["8133DD36",0x1380],
- ["8133DD37",0x1381],
- ["8133DD38",0x1382],
- ["8133DD39",0x1383],
- ["8133DE30",0x1384],
- ["8133DE31",0x1385],
- ["8133DE32",0x1386],
- ["8133DE33",0x1387],
- ["8133DE34",0x1388],
- ["8133DE35",0x1389],
- ["8133DE36",0x138A],
- ["8133DE37",0x138B],
- ["8133DE38",0x138C],
- ["8133DE39",0x138D],
- ["8133DF30",0x138E],
- ["8133DF31",0x138F],
- ["8133DF32",0x1390],
- ["8133DF33",0x1391],
- ["8133DF34",0x1392],
- ["8133DF35",0x1393],
- ["8133DF36",0x1394],
- ["8133DF37",0x1395],
- ["8133DF38",0x1396],
- ["8133DF39",0x1397],
- ["8133E030",0x1398],
- ["8133E031",0x1399],
- ["8133E032",0x139A],
- ["8133E033",0x139B],
- ["8133E034",0x139C],
- ["8133E035",0x139D],
- ["8133E036",0x139E],
- ["8133E037",0x139F],
- ["8133E038",0x13A0],
- ["8133E039",0x13A1],
- ["8133E130",0x13A2],
- ["8133E131",0x13A3],
- ["8133E132",0x13A4],
- ["8133E133",0x13A5],
- ["8133E134",0x13A6],
- ["8133E135",0x13A7],
- ["8133E136",0x13A8],
- ["8133E137",0x13A9],
- ["8133E138",0x13AA],
- ["8133E139",0x13AB],
- ["8133E230",0x13AC],
- ["8133E231",0x13AD],
- ["8133E232",0x13AE],
- ["8133E233",0x13AF],
- ["8133E234",0x13B0],
- ["8133E235",0x13B1],
- ["8133E236",0x13B2],
- ["8133E237",0x13B3],
- ["8133E238",0x13B4],
- ["8133E239",0x13B5],
- ["8133E330",0x13B6],
- ["8133E331",0x13B7],
- ["8133E332",0x13B8],
- ["8133E333",0x13B9],
- ["8133E334",0x13BA],
- ["8133E335",0x13BB],
- ["8133E336",0x13BC],
- ["8133E337",0x13BD],
- ["8133E338",0x13BE],
- ["8133E339",0x13BF],
- ["8133E430",0x13C0],
- ["8133E431",0x13C1],
- ["8133E432",0x13C2],
- ["8133E433",0x13C3],
- ["8133E434",0x13C4],
- ["8133E435",0x13C5],
- ["8133E436",0x13C6],
- ["8133E437",0x13C7],
- ["8133E438",0x13C8],
- ["8133E439",0x13C9],
- ["8133E530",0x13CA],
- ["8133E531",0x13CB],
- ["8133E532",0x13CC],
- ["8133E533",0x13CD],
- ["8133E534",0x13CE],
- ["8133E535",0x13CF],
- ["8133E536",0x13D0],
- ["8133E537",0x13D1],
- ["8133E538",0x13D2],
- ["8133E539",0x13D3],
- ["8133E630",0x13D4],
- ["8133E631",0x13D5],
- ["8133E632",0x13D6],
- ["8133E633",0x13D7],
- ["8133E634",0x13D8],
- ["8133E635",0x13D9],
- ["8133E636",0x13DA],
- ["8133E637",0x13DB],
- ["8133E638",0x13DC],
- ["8133E639",0x13DD],
- ["8133E730",0x13DE],
- ["8133E731",0x13DF],
- ["8133E732",0x13E0],
- ["8133E733",0x13E1],
- ["8133E734",0x13E2],
- ["8133E735",0x13E3],
- ["8133E736",0x13E4],
- ["8133E737",0x13E5],
- ["8133E738",0x13E6],
- ["8133E739",0x13E7],
- ["8133E830",0x13E8],
- ["8133E831",0x13E9],
- ["8133E832",0x13EA],
- ["8133E833",0x13EB],
- ["8133E834",0x13EC],
- ["8133E835",0x13ED],
- ["8133E836",0x13EE],
- ["8133E837",0x13EF],
- ["8133E838",0x13F0],
- ["8133E839",0x13F1],
- ["8133E930",0x13F2],
- ["8133E931",0x13F3],
- ["8133E932",0x13F4],
- ["8133E933",0x13F5],
- ["8133E934",0x13F6],
- ["8133E935",0x13F7],
- ["8133E936",0x13F8],
- ["8133E937",0x13F9],
- ["8133E938",0x13FA],
- ["8133E939",0x13FB],
- ["8133EA30",0x13FC],
- ["8133EA31",0x13FD],
- ["8133EA32",0x13FE],
- ["8133EA33",0x13FF],
- ["8133EA34",0x1400],
- ["8133EA35",0x1401],
- ["8133EA36",0x1402],
- ["8133EA37",0x1403],
- ["8133EA38",0x1404],
- ["8133EA39",0x1405],
- ["8133EB30",0x1406],
- ["8133EB31",0x1407],
- ["8133EB32",0x1408],
- ["8133EB33",0x1409],
- ["8133EB34",0x140A],
- ["8133EB35",0x140B],
- ["8133EB36",0x140C],
- ["8133EB37",0x140D],
- ["8133EB38",0x140E],
- ["8133EB39",0x140F],
- ["8133EC30",0x1410],
- ["8133EC31",0x1411],
- ["8133EC32",0x1412],
- ["8133EC33",0x1413],
- ["8133EC34",0x1414],
- ["8133EC35",0x1415],
- ["8133EC36",0x1416],
- ["8133EC37",0x1417],
- ["8133EC38",0x1418],
- ["8133EC39",0x1419],
- ["8133ED30",0x141A],
- ["8133ED31",0x141B],
- ["8133ED32",0x141C],
- ["8133ED33",0x141D],
- ["8133ED34",0x141E],
- ["8133ED35",0x141F],
- ["8133ED36",0x1420],
- ["8133ED37",0x1421],
- ["8133ED38",0x1422],
- ["8133ED39",0x1423],
- ["8133EE30",0x1424],
- ["8133EE31",0x1425],
- ["8133EE32",0x1426],
- ["8133EE33",0x1427],
- ["8133EE34",0x1428],
- ["8133EE35",0x1429],
- ["8133EE36",0x142A],
- ["8133EE37",0x142B],
- ["8133EE38",0x142C],
- ["8133EE39",0x142D],
- ["8133EF30",0x142E],
- ["8133EF31",0x142F],
- ["8133EF32",0x1430],
- ["8133EF33",0x1431],
- ["8133EF34",0x1432],
- ["8133EF35",0x1433],
- ["8133EF36",0x1434],
- ["8133EF37",0x1435],
- ["8133EF38",0x1436],
- ["8133EF39",0x1437],
- ["8133F030",0x1438],
- ["8133F031",0x1439],
- ["8133F032",0x143A],
- ["8133F033",0x143B],
- ["8133F034",0x143C],
- ["8133F035",0x143D],
- ["8133F036",0x143E],
- ["8133F037",0x143F],
- ["8133F038",0x1440],
- ["8133F039",0x1441],
- ["8133F130",0x1442],
- ["8133F131",0x1443],
- ["8133F132",0x1444],
- ["8133F133",0x1445],
- ["8133F134",0x1446],
- ["8133F135",0x1447],
- ["8133F136",0x1448],
- ["8133F137",0x1449],
- ["8133F138",0x144A],
- ["8133F139",0x144B],
- ["8133F230",0x144C],
- ["8133F231",0x144D],
- ["8133F232",0x144E],
- ["8133F233",0x144F],
- ["8133F234",0x1450],
- ["8133F235",0x1451],
- ["8133F236",0x1452],
- ["8133F237",0x1453],
- ["8133F238",0x1454],
- ["8133F239",0x1455],
- ["8133F330",0x1456],
- ["8133F331",0x1457],
- ["8133F332",0x1458],
- ["8133F333",0x1459],
- ["8133F334",0x145A],
- ["8133F335",0x145B],
- ["8133F336",0x145C],
- ["8133F337",0x145D],
- ["8133F338",0x145E],
- ["8133F339",0x145F],
- ["8133F430",0x1460],
- ["8133F431",0x1461],
- ["8133F432",0x1462],
- ["8133F433",0x1463],
- ["8133F434",0x1464],
- ["8133F435",0x1465],
- ["8133F436",0x1466],
- ["8133F437",0x1467],
- ["8133F438",0x1468],
- ["8133F439",0x1469],
- ["8133F530",0x146A],
- ["8133F531",0x146B],
- ["8133F532",0x146C],
- ["8133F533",0x146D],
- ["8133F534",0x146E],
- ["8133F535",0x146F],
- ["8133F536",0x1470],
- ["8133F537",0x1471],
- ["8133F538",0x1472],
- ["8133F539",0x1473],
- ["8133F630",0x1474],
- ["8133F631",0x1475],
- ["8133F632",0x1476],
- ["8133F633",0x1477],
- ["8133F634",0x1478],
- ["8133F635",0x1479],
- ["8133F636",0x147A],
- ["8133F637",0x147B],
- ["8133F638",0x147C],
- ["8133F639",0x147D],
- ["8133F730",0x147E],
- ["8133F731",0x147F],
- ["8133F732",0x1480],
- ["8133F733",0x1481],
- ["8133F734",0x1482],
- ["8133F735",0x1483],
- ["8133F736",0x1484],
- ["8133F737",0x1485],
- ["8133F738",0x1486],
- ["8133F739",0x1487],
- ["8133F830",0x1488],
- ["8133F831",0x1489],
- ["8133F832",0x148A],
- ["8133F833",0x148B],
- ["8133F834",0x148C],
- ["8133F835",0x148D],
- ["8133F836",0x148E],
- ["8133F837",0x148F],
- ["8133F838",0x1490],
- ["8133F839",0x1491],
- ["8133F930",0x1492],
- ["8133F931",0x1493],
- ["8133F932",0x1494],
- ["8133F933",0x1495],
- ["8133F934",0x1496],
- ["8133F935",0x1497],
- ["8133F936",0x1498],
- ["8133F937",0x1499],
- ["8133F938",0x149A],
- ["8133F939",0x149B],
- ["8133FA30",0x149C],
- ["8133FA31",0x149D],
- ["8133FA32",0x149E],
- ["8133FA33",0x149F],
- ["8133FA34",0x14A0],
- ["8133FA35",0x14A1],
- ["8133FA36",0x14A2],
- ["8133FA37",0x14A3],
- ["8133FA38",0x14A4],
- ["8133FA39",0x14A5],
- ["8133FB30",0x14A6],
- ["8133FB31",0x14A7],
- ["8133FB32",0x14A8],
- ["8133FB33",0x14A9],
- ["8133FB34",0x14AA],
- ["8133FB35",0x14AB],
- ["8133FB36",0x14AC],
- ["8133FB37",0x14AD],
- ["8133FB38",0x14AE],
- ["8133FB39",0x14AF],
- ["8133FC30",0x14B0],
- ["8133FC31",0x14B1],
- ["8133FC32",0x14B2],
- ["8133FC33",0x14B3],
- ["8133FC34",0x14B4],
- ["8133FC35",0x14B5],
- ["8133FC36",0x14B6],
- ["8133FC37",0x14B7],
- ["8133FC38",0x14B8],
- ["8133FC39",0x14B9],
- ["8133FD30",0x14BA],
- ["8133FD31",0x14BB],
- ["8133FD32",0x14BC],
- ["8133FD33",0x14BD],
- ["8133FD34",0x14BE],
- ["8133FD35",0x14BF],
- ["8133FD36",0x14C0],
- ["8133FD37",0x14C1],
- ["8133FD38",0x14C2],
- ["8133FD39",0x14C3],
- ["8133FE30",0x14C4],
- ["8133FE31",0x14C5],
- ["8133FE32",0x14C6],
- ["8133FE33",0x14C7],
- ["8133FE34",0x14C8],
- ["8133FE35",0x14C9],
- ["8133FE36",0x14CA],
- ["8133FE37",0x14CB],
- ["8133FE38",0x14CC],
- ["8133FE39",0x14CD],
- ["81348130",0x14CE],
- ["81348131",0x14CF],
- ["81348132",0x14D0],
- ["81348133",0x14D1],
- ["81348134",0x14D2],
- ["81348135",0x14D3],
- ["81348136",0x14D4],
- ["81348137",0x14D5],
- ["81348138",0x14D6],
- ["81348139",0x14D7],
- ["81348230",0x14D8],
- ["81348231",0x14D9],
- ["81348232",0x14DA],
- ["81348233",0x14DB],
- ["81348234",0x14DC],
- ["81348235",0x14DD],
- ["81348236",0x14DE],
- ["81348237",0x14DF],
- ["81348238",0x14E0],
- ["81348239",0x14E1],
- ["81348330",0x14E2],
- ["81348331",0x14E3],
- ["81348332",0x14E4],
- ["81348333",0x14E5],
- ["81348334",0x14E6],
- ["81348335",0x14E7],
- ["81348336",0x14E8],
- ["81348337",0x14E9],
- ["81348338",0x14EA],
- ["81348339",0x14EB],
- ["81348430",0x14EC],
- ["81348431",0x14ED],
- ["81348432",0x14EE],
- ["81348433",0x14EF],
- ["81348434",0x14F0],
- ["81348435",0x14F1],
- ["81348436",0x14F2],
- ["81348437",0x14F3],
- ["81348438",0x14F4],
- ["81348439",0x14F5],
- ["81348530",0x14F6],
- ["81348531",0x14F7],
- ["81348532",0x14F8],
- ["81348533",0x14F9],
- ["81348534",0x14FA],
- ["81348535",0x14FB],
- ["81348536",0x14FC],
- ["81348537",0x14FD],
- ["81348538",0x14FE],
- ["81348539",0x14FF],
- ["81348630",0x1500],
- ["81348631",0x1501],
- ["81348632",0x1502],
- ["81348633",0x1503],
- ["81348634",0x1504],
- ["81348635",0x1505],
- ["81348636",0x1506],
- ["81348637",0x1507],
- ["81348638",0x1508],
- ["81348639",0x1509],
- ["81348730",0x150A],
- ["81348731",0x150B],
- ["81348732",0x150C],
- ["81348733",0x150D],
- ["81348734",0x150E],
- ["81348735",0x150F],
- ["81348736",0x1510],
- ["81348737",0x1511],
- ["81348738",0x1512],
- ["81348739",0x1513],
- ["81348830",0x1514],
- ["81348831",0x1515],
- ["81348832",0x1516],
- ["81348833",0x1517],
- ["81348834",0x1518],
- ["81348835",0x1519],
- ["81348836",0x151A],
- ["81348837",0x151B],
- ["81348838",0x151C],
- ["81348839",0x151D],
- ["81348930",0x151E],
- ["81348931",0x151F],
- ["81348932",0x1520],
- ["81348933",0x1521],
- ["81348934",0x1522],
- ["81348935",0x1523],
- ["81348936",0x1524],
- ["81348937",0x1525],
- ["81348938",0x1526],
- ["81348939",0x1527],
- ["81348A30",0x1528],
- ["81348A31",0x1529],
- ["81348A32",0x152A],
- ["81348A33",0x152B],
- ["81348A34",0x152C],
- ["81348A35",0x152D],
- ["81348A36",0x152E],
- ["81348A37",0x152F],
- ["81348A38",0x1530],
- ["81348A39",0x1531],
- ["81348B30",0x1532],
- ["81348B31",0x1533],
- ["81348B32",0x1534],
- ["81348B33",0x1535],
- ["81348B34",0x1536],
- ["81348B35",0x1537],
- ["81348B36",0x1538],
- ["81348B37",0x1539],
- ["81348B38",0x153A],
- ["81348B39",0x153B],
- ["81348C30",0x153C],
- ["81348C31",0x153D],
- ["81348C32",0x153E],
- ["81348C33",0x153F],
- ["81348C34",0x1540],
- ["81348C35",0x1541],
- ["81348C36",0x1542],
- ["81348C37",0x1543],
- ["81348C38",0x1544],
- ["81348C39",0x1545],
- ["81348D30",0x1546],
- ["81348D31",0x1547],
- ["81348D32",0x1548],
- ["81348D33",0x1549],
- ["81348D34",0x154A],
- ["81348D35",0x154B],
- ["81348D36",0x154C],
- ["81348D37",0x154D],
- ["81348D38",0x154E],
- ["81348D39",0x154F],
- ["81348E30",0x1550],
- ["81348E31",0x1551],
- ["81348E32",0x1552],
- ["81348E33",0x1553],
- ["81348E34",0x1554],
- ["81348E35",0x1555],
- ["81348E36",0x1556],
- ["81348E37",0x1557],
- ["81348E38",0x1558],
- ["81348E39",0x1559],
- ["81348F30",0x155A],
- ["81348F31",0x155B],
- ["81348F32",0x155C],
- ["81348F33",0x155D],
- ["81348F34",0x155E],
- ["81348F35",0x155F],
- ["81348F36",0x1560],
- ["81348F37",0x1561],
- ["81348F38",0x1562],
- ["81348F39",0x1563],
- ["81349030",0x1564],
- ["81349031",0x1565],
- ["81349032",0x1566],
- ["81349033",0x1567],
- ["81349034",0x1568],
- ["81349035",0x1569],
- ["81349036",0x156A],
- ["81349037",0x156B],
- ["81349038",0x156C],
- ["81349039",0x156D],
- ["81349130",0x156E],
- ["81349131",0x156F],
- ["81349132",0x1570],
- ["81349133",0x1571],
- ["81349134",0x1572],
- ["81349135",0x1573],
- ["81349136",0x1574],
- ["81349137",0x1575],
- ["81349138",0x1576],
- ["81349139",0x1577],
- ["81349230",0x1578],
- ["81349231",0x1579],
- ["81349232",0x157A],
- ["81349233",0x157B],
- ["81349234",0x157C],
- ["81349235",0x157D],
- ["81349236",0x157E],
- ["81349237",0x157F],
- ["81349238",0x1580],
- ["81349239",0x1581],
- ["81349330",0x1582],
- ["81349331",0x1583],
- ["81349332",0x1584],
- ["81349333",0x1585],
- ["81349334",0x1586],
- ["81349335",0x1587],
- ["81349336",0x1588],
- ["81349337",0x1589],
- ["81349338",0x158A],
- ["81349339",0x158B],
- ["81349430",0x158C],
- ["81349431",0x158D],
- ["81349432",0x158E],
- ["81349433",0x158F],
- ["81349434",0x1590],
- ["81349435",0x1591],
- ["81349436",0x1592],
- ["81349437",0x1593],
- ["81349438",0x1594],
- ["81349439",0x1595],
- ["81349530",0x1596],
- ["81349531",0x1597],
- ["81349532",0x1598],
- ["81349533",0x1599],
- ["81349534",0x159A],
- ["81349535",0x159B],
- ["81349536",0x159C],
- ["81349537",0x159D],
- ["81349538",0x159E],
- ["81349539",0x159F],
- ["81349630",0x15A0],
- ["81349631",0x15A1],
- ["81349632",0x15A2],
- ["81349633",0x15A3],
- ["81349634",0x15A4],
- ["81349635",0x15A5],
- ["81349636",0x15A6],
- ["81349637",0x15A7],
- ["81349638",0x15A8],
- ["81349639",0x15A9],
- ["81349730",0x15AA],
- ["81349731",0x15AB],
- ["81349732",0x15AC],
- ["81349733",0x15AD],
- ["81349734",0x15AE],
- ["81349735",0x15AF],
- ["81349736",0x15B0],
- ["81349737",0x15B1],
- ["81349738",0x15B2],
- ["81349739",0x15B3],
- ["81349830",0x15B4],
- ["81349831",0x15B5],
- ["81349832",0x15B6],
- ["81349833",0x15B7],
- ["81349834",0x15B8],
- ["81349835",0x15B9],
- ["81349836",0x15BA],
- ["81349837",0x15BB],
- ["81349838",0x15BC],
- ["81349839",0x15BD],
- ["81349930",0x15BE],
- ["81349931",0x15BF],
- ["81349932",0x15C0],
- ["81349933",0x15C1],
- ["81349934",0x15C2],
- ["81349935",0x15C3],
- ["81349936",0x15C4],
- ["81349937",0x15C5],
- ["81349938",0x15C6],
- ["81349939",0x15C7],
- ["81349A30",0x15C8],
- ["81349A31",0x15C9],
- ["81349A32",0x15CA],
- ["81349A33",0x15CB],
- ["81349A34",0x15CC],
- ["81349A35",0x15CD],
- ["81349A36",0x15CE],
- ["81349A37",0x15CF],
- ["81349A38",0x15D0],
- ["81349A39",0x15D1],
- ["81349B30",0x15D2],
- ["81349B31",0x15D3],
- ["81349B32",0x15D4],
- ["81349B33",0x15D5],
- ["81349B34",0x15D6],
- ["81349B35",0x15D7],
- ["81349B36",0x15D8],
- ["81349B37",0x15D9],
- ["81349B38",0x15DA],
- ["81349B39",0x15DB],
- ["81349C30",0x15DC],
- ["81349C31",0x15DD],
- ["81349C32",0x15DE],
- ["81349C33",0x15DF],
- ["81349C34",0x15E0],
- ["81349C35",0x15E1],
- ["81349C36",0x15E2],
- ["81349C37",0x15E3],
- ["81349C38",0x15E4],
- ["81349C39",0x15E5],
- ["81349D30",0x15E6],
- ["81349D31",0x15E7],
- ["81349D32",0x15E8],
- ["81349D33",0x15E9],
- ["81349D34",0x15EA],
- ["81349D35",0x15EB],
- ["81349D36",0x15EC],
- ["81349D37",0x15ED],
- ["81349D38",0x15EE],
- ["81349D39",0x15EF],
- ["81349E30",0x15F0],
- ["81349E31",0x15F1],
- ["81349E32",0x15F2],
- ["81349E33",0x15F3],
- ["81349E34",0x15F4],
- ["81349E35",0x15F5],
- ["81349E36",0x15F6],
- ["81349E37",0x15F7],
- ["81349E38",0x15F8],
- ["81349E39",0x15F9],
- ["81349F30",0x15FA],
- ["81349F31",0x15FB],
- ["81349F32",0x15FC],
- ["81349F33",0x15FD],
- ["81349F34",0x15FE],
- ["81349F35",0x15FF],
- ["81349F36",0x1600],
- ["81349F37",0x1601],
- ["81349F38",0x1602],
- ["81349F39",0x1603],
- ["8134A030",0x1604],
- ["8134A031",0x1605],
- ["8134A032",0x1606],
- ["8134A033",0x1607],
- ["8134A034",0x1608],
- ["8134A035",0x1609],
- ["8134A036",0x160A],
- ["8134A037",0x160B],
- ["8134A038",0x160C],
- ["8134A039",0x160D],
- ["8134A130",0x160E],
- ["8134A131",0x160F],
- ["8134A132",0x1610],
- ["8134A133",0x1611],
- ["8134A134",0x1612],
- ["8134A135",0x1613],
- ["8134A136",0x1614],
- ["8134A137",0x1615],
- ["8134A138",0x1616],
- ["8134A139",0x1617],
- ["8134A230",0x1618],
- ["8134A231",0x1619],
- ["8134A232",0x161A],
- ["8134A233",0x161B],
- ["8134A234",0x161C],
- ["8134A235",0x161D],
- ["8134A236",0x161E],
- ["8134A237",0x161F],
- ["8134A238",0x1620],
- ["8134A239",0x1621],
- ["8134A330",0x1622],
- ["8134A331",0x1623],
- ["8134A332",0x1624],
- ["8134A333",0x1625],
- ["8134A334",0x1626],
- ["8134A335",0x1627],
- ["8134A336",0x1628],
- ["8134A337",0x1629],
- ["8134A338",0x162A],
- ["8134A339",0x162B],
- ["8134A430",0x162C],
- ["8134A431",0x162D],
- ["8134A432",0x162E],
- ["8134A433",0x162F],
- ["8134A434",0x1630],
- ["8134A435",0x1631],
- ["8134A436",0x1632],
- ["8134A437",0x1633],
- ["8134A438",0x1634],
- ["8134A439",0x1635],
- ["8134A530",0x1636],
- ["8134A531",0x1637],
- ["8134A532",0x1638],
- ["8134A533",0x1639],
- ["8134A534",0x163A],
- ["8134A535",0x163B],
- ["8134A536",0x163C],
- ["8134A537",0x163D],
- ["8134A538",0x163E],
- ["8134A539",0x163F],
- ["8134A630",0x1640],
- ["8134A631",0x1641],
- ["8134A632",0x1642],
- ["8134A633",0x1643],
- ["8134A634",0x1644],
- ["8134A635",0x1645],
- ["8134A636",0x1646],
- ["8134A637",0x1647],
- ["8134A638",0x1648],
- ["8134A639",0x1649],
- ["8134A730",0x164A],
- ["8134A731",0x164B],
- ["8134A732",0x164C],
- ["8134A733",0x164D],
- ["8134A734",0x164E],
- ["8134A735",0x164F],
- ["8134A736",0x1650],
- ["8134A737",0x1651],
- ["8134A738",0x1652],
- ["8134A739",0x1653],
- ["8134A830",0x1654],
- ["8134A831",0x1655],
- ["8134A832",0x1656],
- ["8134A833",0x1657],
- ["8134A834",0x1658],
- ["8134A835",0x1659],
- ["8134A836",0x165A],
- ["8134A837",0x165B],
- ["8134A838",0x165C],
- ["8134A839",0x165D],
- ["8134A930",0x165E],
- ["8134A931",0x165F],
- ["8134A932",0x1660],
- ["8134A933",0x1661],
- ["8134A934",0x1662],
- ["8134A935",0x1663],
- ["8134A936",0x1664],
- ["8134A937",0x1665],
- ["8134A938",0x1666],
- ["8134A939",0x1667],
- ["8134AA30",0x1668],
- ["8134AA31",0x1669],
- ["8134AA32",0x166A],
- ["8134AA33",0x166B],
- ["8134AA34",0x166C],
- ["8134AA35",0x166D],
- ["8134AA36",0x166E],
- ["8134AA37",0x166F],
- ["8134AA38",0x1670],
- ["8134AA39",0x1671],
- ["8134AB30",0x1672],
- ["8134AB31",0x1673],
- ["8134AB32",0x1674],
- ["8134AB33",0x1675],
- ["8134AB34",0x1676],
- ["8134AB35",0x1677],
- ["8134AB36",0x1678],
- ["8134AB37",0x1679],
- ["8134AB38",0x167A],
- ["8134AB39",0x167B],
- ["8134AC30",0x167C],
- ["8134AC31",0x167D],
- ["8134AC32",0x167E],
- ["8134AC33",0x167F],
- ["8134AC34",0x1680],
- ["8134AC35",0x1681],
- ["8134AC36",0x1682],
- ["8134AC37",0x1683],
- ["8134AC38",0x1684],
- ["8134AC39",0x1685],
- ["8134AD30",0x1686],
- ["8134AD31",0x1687],
- ["8134AD32",0x1688],
- ["8134AD33",0x1689],
- ["8134AD34",0x168A],
- ["8134AD35",0x168B],
- ["8134AD36",0x168C],
- ["8134AD37",0x168D],
- ["8134AD38",0x168E],
- ["8134AD39",0x168F],
- ["8134AE30",0x1690],
- ["8134AE31",0x1691],
- ["8134AE32",0x1692],
- ["8134AE33",0x1693],
- ["8134AE34",0x1694],
- ["8134AE35",0x1695],
- ["8134AE36",0x1696],
- ["8134AE37",0x1697],
- ["8134AE38",0x1698],
- ["8134AE39",0x1699],
- ["8134AF30",0x169A],
- ["8134AF31",0x169B],
- ["8134AF32",0x169C],
- ["8134AF33",0x169D],
- ["8134AF34",0x169E],
- ["8134AF35",0x169F],
- ["8134AF36",0x16A0],
- ["8134AF37",0x16A1],
- ["8134AF38",0x16A2],
- ["8134AF39",0x16A3],
- ["8134B030",0x16A4],
- ["8134B031",0x16A5],
- ["8134B032",0x16A6],
- ["8134B033",0x16A7],
- ["8134B034",0x16A8],
- ["8134B035",0x16A9],
- ["8134B036",0x16AA],
- ["8134B037",0x16AB],
- ["8134B038",0x16AC],
- ["8134B039",0x16AD],
- ["8134B130",0x16AE],
- ["8134B131",0x16AF],
- ["8134B132",0x16B0],
- ["8134B133",0x16B1],
- ["8134B134",0x16B2],
- ["8134B135",0x16B3],
- ["8134B136",0x16B4],
- ["8134B137",0x16B5],
- ["8134B138",0x16B6],
- ["8134B139",0x16B7],
- ["8134B230",0x16B8],
- ["8134B231",0x16B9],
- ["8134B232",0x16BA],
- ["8134B233",0x16BB],
- ["8134B234",0x16BC],
- ["8134B235",0x16BD],
- ["8134B236",0x16BE],
- ["8134B237",0x16BF],
- ["8134B238",0x16C0],
- ["8134B239",0x16C1],
- ["8134B330",0x16C2],
- ["8134B331",0x16C3],
- ["8134B332",0x16C4],
- ["8134B333",0x16C5],
- ["8134B334",0x16C6],
- ["8134B335",0x16C7],
- ["8134B336",0x16C8],
- ["8134B337",0x16C9],
- ["8134B338",0x16CA],
- ["8134B339",0x16CB],
- ["8134B430",0x16CC],
- ["8134B431",0x16CD],
- ["8134B432",0x16CE],
- ["8134B433",0x16CF],
- ["8134B434",0x16D0],
- ["8134B435",0x16D1],
- ["8134B436",0x16D2],
- ["8134B437",0x16D3],
- ["8134B438",0x16D4],
- ["8134B439",0x16D5],
- ["8134B530",0x16D6],
- ["8134B531",0x16D7],
- ["8134B532",0x16D8],
- ["8134B533",0x16D9],
- ["8134B534",0x16DA],
- ["8134B535",0x16DB],
- ["8134B536",0x16DC],
- ["8134B537",0x16DD],
- ["8134B538",0x16DE],
- ["8134B539",0x16DF],
- ["8134B630",0x16E0],
- ["8134B631",0x16E1],
- ["8134B632",0x16E2],
- ["8134B633",0x16E3],
- ["8134B634",0x16E4],
- ["8134B635",0x16E5],
- ["8134B636",0x16E6],
- ["8134B637",0x16E7],
- ["8134B638",0x16E8],
- ["8134B639",0x16E9],
- ["8134B730",0x16EA],
- ["8134B731",0x16EB],
- ["8134B732",0x16EC],
- ["8134B733",0x16ED],
- ["8134B734",0x16EE],
- ["8134B735",0x16EF],
- ["8134B736",0x16F0],
- ["8134B737",0x16F1],
- ["8134B738",0x16F2],
- ["8134B739",0x16F3],
- ["8134B830",0x16F4],
- ["8134B831",0x16F5],
- ["8134B832",0x16F6],
- ["8134B833",0x16F7],
- ["8134B834",0x16F8],
- ["8134B835",0x16F9],
- ["8134B836",0x16FA],
- ["8134B837",0x16FB],
- ["8134B838",0x16FC],
- ["8134B839",0x16FD],
- ["8134B930",0x16FE],
- ["8134B931",0x16FF],
- ["8134B932",0x1700],
- ["8134B933",0x1701],
- ["8134B934",0x1702],
- ["8134B935",0x1703],
- ["8134B936",0x1704],
- ["8134B937",0x1705],
- ["8134B938",0x1706],
- ["8134B939",0x1707],
- ["8134BA30",0x1708],
- ["8134BA31",0x1709],
- ["8134BA32",0x170A],
- ["8134BA33",0x170B],
- ["8134BA34",0x170C],
- ["8134BA35",0x170D],
- ["8134BA36",0x170E],
- ["8134BA37",0x170F],
- ["8134BA38",0x1710],
- ["8134BA39",0x1711],
- ["8134BB30",0x1712],
- ["8134BB31",0x1713],
- ["8134BB32",0x1714],
- ["8134BB33",0x1715],
- ["8134BB34",0x1716],
- ["8134BB35",0x1717],
- ["8134BB36",0x1718],
- ["8134BB37",0x1719],
- ["8134BB38",0x171A],
- ["8134BB39",0x171B],
- ["8134BC30",0x171C],
- ["8134BC31",0x171D],
- ["8134BC32",0x171E],
- ["8134BC33",0x171F],
- ["8134BC34",0x1720],
- ["8134BC35",0x1721],
- ["8134BC36",0x1722],
- ["8134BC37",0x1723],
- ["8134BC38",0x1724],
- ["8134BC39",0x1725],
- ["8134BD30",0x1726],
- ["8134BD31",0x1727],
- ["8134BD32",0x1728],
- ["8134BD33",0x1729],
- ["8134BD34",0x172A],
- ["8134BD35",0x172B],
- ["8134BD36",0x172C],
- ["8134BD37",0x172D],
- ["8134BD38",0x172E],
- ["8134BD39",0x172F],
- ["8134BE30",0x1730],
- ["8134BE31",0x1731],
- ["8134BE32",0x1732],
- ["8134BE33",0x1733],
- ["8134BE34",0x1734],
- ["8134BE35",0x1735],
- ["8134BE36",0x1736],
- ["8134BE37",0x1737],
- ["8134BE38",0x1738],
- ["8134BE39",0x1739],
- ["8134BF30",0x173A],
- ["8134BF31",0x173B],
- ["8134BF32",0x173C],
- ["8134BF33",0x173D],
- ["8134BF34",0x173E],
- ["8134BF35",0x173F],
- ["8134BF36",0x1740],
- ["8134BF37",0x1741],
- ["8134BF38",0x1742],
- ["8134BF39",0x1743],
- ["8134C030",0x1744],
- ["8134C031",0x1745],
- ["8134C032",0x1746],
- ["8134C033",0x1747],
- ["8134C034",0x1748],
- ["8134C035",0x1749],
- ["8134C036",0x174A],
- ["8134C037",0x174B],
- ["8134C038",0x174C],
- ["8134C039",0x174D],
- ["8134C130",0x174E],
- ["8134C131",0x174F],
- ["8134C132",0x1750],
- ["8134C133",0x1751],
- ["8134C134",0x1752],
- ["8134C135",0x1753],
- ["8134C136",0x1754],
- ["8134C137",0x1755],
- ["8134C138",0x1756],
- ["8134C139",0x1757],
- ["8134C230",0x1758],
- ["8134C231",0x1759],
- ["8134C232",0x175A],
- ["8134C233",0x175B],
- ["8134C234",0x175C],
- ["8134C235",0x175D],
- ["8134C236",0x175E],
- ["8134C237",0x175F],
- ["8134C238",0x1760],
- ["8134C239",0x1761],
- ["8134C330",0x1762],
- ["8134C331",0x1763],
- ["8134C332",0x1764],
- ["8134C333",0x1765],
- ["8134C334",0x1766],
- ["8134C335",0x1767],
- ["8134C336",0x1768],
- ["8134C337",0x1769],
- ["8134C338",0x176A],
- ["8134C339",0x176B],
- ["8134C430",0x176C],
- ["8134C431",0x176D],
- ["8134C432",0x176E],
- ["8134C433",0x176F],
- ["8134C434",0x1770],
- ["8134C435",0x1771],
- ["8134C436",0x1772],
- ["8134C437",0x1773],
- ["8134C438",0x1774],
- ["8134C439",0x1775],
- ["8134C530",0x1776],
- ["8134C531",0x1777],
- ["8134C532",0x1778],
- ["8134C533",0x1779],
- ["8134C534",0x177A],
- ["8134C535",0x177B],
- ["8134C536",0x177C],
- ["8134C537",0x177D],
- ["8134C538",0x177E],
- ["8134C539",0x177F],
- ["8134C630",0x1780],
- ["8134C631",0x1781],
- ["8134C632",0x1782],
- ["8134C633",0x1783],
- ["8134C634",0x1784],
- ["8134C635",0x1785],
- ["8134C636",0x1786],
- ["8134C637",0x1787],
- ["8134C638",0x1788],
- ["8134C639",0x1789],
- ["8134C730",0x178A],
- ["8134C731",0x178B],
- ["8134C732",0x178C],
- ["8134C733",0x178D],
- ["8134C734",0x178E],
- ["8134C735",0x178F],
- ["8134C736",0x1790],
- ["8134C737",0x1791],
- ["8134C738",0x1792],
- ["8134C739",0x1793],
- ["8134C830",0x1794],
- ["8134C831",0x1795],
- ["8134C832",0x1796],
- ["8134C833",0x1797],
- ["8134C834",0x1798],
- ["8134C835",0x1799],
- ["8134C836",0x179A],
- ["8134C837",0x179B],
- ["8134C838",0x179C],
- ["8134C839",0x179D],
- ["8134C930",0x179E],
- ["8134C931",0x179F],
- ["8134C932",0x17A0],
- ["8134C933",0x17A1],
- ["8134C934",0x17A2],
- ["8134C935",0x17A3],
- ["8134C936",0x17A4],
- ["8134C937",0x17A5],
- ["8134C938",0x17A6],
- ["8134C939",0x17A7],
- ["8134CA30",0x17A8],
- ["8134CA31",0x17A9],
- ["8134CA32",0x17AA],
- ["8134CA33",0x17AB],
- ["8134CA34",0x17AC],
- ["8134CA35",0x17AD],
- ["8134CA36",0x17AE],
- ["8134CA37",0x17AF],
- ["8134CA38",0x17B0],
- ["8134CA39",0x17B1],
- ["8134CB30",0x17B2],
- ["8134CB31",0x17B3],
- ["8134CB32",0x17B4],
- ["8134CB33",0x17B5],
- ["8134CB34",0x17B6],
- ["8134CB35",0x17B7],
- ["8134CB36",0x17B8],
- ["8134CB37",0x17B9],
- ["8134CB38",0x17BA],
- ["8134CB39",0x17BB],
- ["8134CC30",0x17BC],
- ["8134CC31",0x17BD],
- ["8134CC32",0x17BE],
- ["8134CC33",0x17BF],
- ["8134CC34",0x17C0],
- ["8134CC35",0x17C1],
- ["8134CC36",0x17C2],
- ["8134CC37",0x17C3],
- ["8134CC38",0x17C4],
- ["8134CC39",0x17C5],
- ["8134CD30",0x17C6],
- ["8134CD31",0x17C7],
- ["8134CD32",0x17C8],
- ["8134CD33",0x17C9],
- ["8134CD34",0x17CA],
- ["8134CD35",0x17CB],
- ["8134CD36",0x17CC],
- ["8134CD37",0x17CD],
- ["8134CD38",0x17CE],
- ["8134CD39",0x17CF],
- ["8134CE30",0x17D0],
- ["8134CE31",0x17D1],
- ["8134CE32",0x17D2],
- ["8134CE33",0x17D3],
- ["8134CE34",0x17D4],
- ["8134CE35",0x17D5],
- ["8134CE36",0x17D6],
- ["8134CE37",0x17D7],
- ["8134CE38",0x17D8],
- ["8134CE39",0x17D9],
- ["8134CF30",0x17DA],
- ["8134CF31",0x17DB],
- ["8134CF32",0x17DC],
- ["8134CF33",0x17DD],
- ["8134CF34",0x17DE],
- ["8134CF35",0x17DF],
- ["8134CF36",0x17E0],
- ["8134CF37",0x17E1],
- ["8134CF38",0x17E2],
- ["8134CF39",0x17E3],
- ["8134D030",0x17E4],
- ["8134D031",0x17E5],
- ["8134D032",0x17E6],
- ["8134D033",0x17E7],
- ["8134D034",0x17E8],
- ["8134D035",0x17E9],
- ["8134D036",0x17EA],
- ["8134D037",0x17EB],
- ["8134D038",0x17EC],
- ["8134D039",0x17ED],
- ["8134D130",0x17EE],
- ["8134D131",0x17EF],
- ["8134D132",0x17F0],
- ["8134D133",0x17F1],
- ["8134D134",0x17F2],
- ["8134D135",0x17F3],
- ["8134D136",0x17F4],
- ["8134D137",0x17F5],
- ["8134D138",0x17F6],
- ["8134D139",0x17F7],
- ["8134D230",0x17F8],
- ["8134D231",0x17F9],
- ["8134D232",0x17FA],
- ["8134D233",0x17FB],
- ["8134D234",0x17FC],
- ["8134D235",0x17FD],
- ["8134D236",0x17FE],
- ["8134D237",0x17FF],
- ["8134D238",0x1800],
- ["8134D239",0x1801],
- ["8134D330",0x1802],
- ["8134D331",0x1803],
- ["8134D332",0x1804],
- ["8134D333",0x1805],
- ["8134D334",0x1806],
- ["8134D335",0x1807],
- ["8134D336",0x1808],
- ["8134D337",0x1809],
- ["8134D338",0x180A],
- ["8134D339",0x180B],
- ["8134D430",0x180C],
- ["8134D431",0x180D],
- ["8134D432",0x180E],
- ["8134D433",0x180F],
- ["8134D434",0x1810],
- ["8134D435",0x1811],
- ["8134D436",0x1812],
- ["8134D437",0x1813],
- ["8134D438",0x1814],
- ["8134D439",0x1815],
- ["8134D530",0x1816],
- ["8134D531",0x1817],
- ["8134D532",0x1818],
- ["8134D533",0x1819],
- ["8134D534",0x181A],
- ["8134D535",0x181B],
- ["8134D536",0x181C],
- ["8134D537",0x181D],
- ["8134D538",0x181E],
- ["8134D539",0x181F],
- ["8134D630",0x1820],
- ["8134D631",0x1821],
- ["8134D632",0x1822],
- ["8134D633",0x1823],
- ["8134D634",0x1824],
- ["8134D635",0x1825],
- ["8134D636",0x1826],
- ["8134D637",0x1827],
- ["8134D638",0x1828],
- ["8134D639",0x1829],
- ["8134D730",0x182A],
- ["8134D731",0x182B],
- ["8134D732",0x182C],
- ["8134D733",0x182D],
- ["8134D734",0x182E],
- ["8134D735",0x182F],
- ["8134D736",0x1830],
- ["8134D737",0x1831],
- ["8134D738",0x1832],
- ["8134D739",0x1833],
- ["8134D830",0x1834],
- ["8134D831",0x1835],
- ["8134D832",0x1836],
- ["8134D833",0x1837],
- ["8134D834",0x1838],
- ["8134D835",0x1839],
- ["8134D836",0x183A],
- ["8134D837",0x183B],
- ["8134D838",0x183C],
- ["8134D839",0x183D],
- ["8134D930",0x183E],
- ["8134D931",0x183F],
- ["8134D932",0x1840],
- ["8134D933",0x1841],
- ["8134D934",0x1842],
- ["8134D935",0x1843],
- ["8134D936",0x1844],
- ["8134D937",0x1845],
- ["8134D938",0x1846],
- ["8134D939",0x1847],
- ["8134DA30",0x1848],
- ["8134DA31",0x1849],
- ["8134DA32",0x184A],
- ["8134DA33",0x184B],
- ["8134DA34",0x184C],
- ["8134DA35",0x184D],
- ["8134DA36",0x184E],
- ["8134DA37",0x184F],
- ["8134DA38",0x1850],
- ["8134DA39",0x1851],
- ["8134DB30",0x1852],
- ["8134DB31",0x1853],
- ["8134DB32",0x1854],
- ["8134DB33",0x1855],
- ["8134DB34",0x1856],
- ["8134DB35",0x1857],
- ["8134DB36",0x1858],
- ["8134DB37",0x1859],
- ["8134DB38",0x185A],
- ["8134DB39",0x185B],
- ["8134DC30",0x185C],
- ["8134DC31",0x185D],
- ["8134DC32",0x185E],
- ["8134DC33",0x185F],
- ["8134DC34",0x1860],
- ["8134DC35",0x1861],
- ["8134DC36",0x1862],
- ["8134DC37",0x1863],
- ["8134DC38",0x1864],
- ["8134DC39",0x1865],
- ["8134DD30",0x1866],
- ["8134DD31",0x1867],
- ["8134DD32",0x1868],
- ["8134DD33",0x1869],
- ["8134DD34",0x186A],
- ["8134DD35",0x186B],
- ["8134DD36",0x186C],
- ["8134DD37",0x186D],
- ["8134DD38",0x186E],
- ["8134DD39",0x186F],
- ["8134DE30",0x1870],
- ["8134DE31",0x1871],
- ["8134DE32",0x1872],
- ["8134DE33",0x1873],
- ["8134DE34",0x1874],
- ["8134DE35",0x1875],
- ["8134DE36",0x1876],
- ["8134DE37",0x1877],
- ["8134DE38",0x1878],
- ["8134DE39",0x1879],
- ["8134DF30",0x187A],
- ["8134DF31",0x187B],
- ["8134DF32",0x187C],
- ["8134DF33",0x187D],
- ["8134DF34",0x187E],
- ["8134DF35",0x187F],
- ["8134DF36",0x1880],
- ["8134DF37",0x1881],
- ["8134DF38",0x1882],
- ["8134DF39",0x1883],
- ["8134E030",0x1884],
- ["8134E031",0x1885],
- ["8134E032",0x1886],
- ["8134E033",0x1887],
- ["8134E034",0x1888],
- ["8134E035",0x1889],
- ["8134E036",0x188A],
- ["8134E037",0x188B],
- ["8134E038",0x188C],
- ["8134E039",0x188D],
- ["8134E130",0x188E],
- ["8134E131",0x188F],
- ["8134E132",0x1890],
- ["8134E133",0x1891],
- ["8134E134",0x1892],
- ["8134E135",0x1893],
- ["8134E136",0x1894],
- ["8134E137",0x1895],
- ["8134E138",0x1896],
- ["8134E139",0x1897],
- ["8134E230",0x1898],
- ["8134E231",0x1899],
- ["8134E232",0x189A],
- ["8134E233",0x189B],
- ["8134E234",0x189C],
- ["8134E235",0x189D],
- ["8134E236",0x189E],
- ["8134E237",0x189F],
- ["8134E238",0x18A0],
- ["8134E239",0x18A1],
- ["8134E330",0x18A2],
- ["8134E331",0x18A3],
- ["8134E332",0x18A4],
- ["8134E333",0x18A5],
- ["8134E334",0x18A6],
- ["8134E335",0x18A7],
- ["8134E336",0x18A8],
- ["8134E337",0x18A9],
- ["8134E338",0x18AA],
- ["8134E339",0x18AB],
- ["8134E430",0x18AC],
- ["8134E431",0x18AD],
- ["8134E432",0x18AE],
- ["8134E433",0x18AF],
- ["8134E434",0x18B0],
- ["8134E435",0x18B1],
- ["8134E436",0x18B2],
- ["8134E437",0x18B3],
- ["8134E438",0x18B4],
- ["8134E439",0x18B5],
- ["8134E530",0x18B6],
- ["8134E531",0x18B7],
- ["8134E532",0x18B8],
- ["8134E533",0x18B9],
- ["8134E534",0x18BA],
- ["8134E535",0x18BB],
- ["8134E536",0x18BC],
- ["8134E537",0x18BD],
- ["8134E538",0x18BE],
- ["8134E539",0x18BF],
- ["8134E630",0x18C0],
- ["8134E631",0x18C1],
- ["8134E632",0x18C2],
- ["8134E633",0x18C3],
- ["8134E634",0x18C4],
- ["8134E635",0x18C5],
- ["8134E636",0x18C6],
- ["8134E637",0x18C7],
- ["8134E638",0x18C8],
- ["8134E639",0x18C9],
- ["8134E730",0x18CA],
- ["8134E731",0x18CB],
- ["8134E732",0x18CC],
- ["8134E733",0x18CD],
- ["8134E734",0x18CE],
- ["8134E735",0x18CF],
- ["8134E736",0x18D0],
- ["8134E737",0x18D1],
- ["8134E738",0x18D2],
- ["8134E739",0x18D3],
- ["8134E830",0x18D4],
- ["8134E831",0x18D5],
- ["8134E832",0x18D6],
- ["8134E833",0x18D7],
- ["8134E834",0x18D8],
- ["8134E835",0x18D9],
- ["8134E836",0x18DA],
- ["8134E837",0x18DB],
- ["8134E838",0x18DC],
- ["8134E839",0x18DD],
- ["8134E930",0x18DE],
- ["8134E931",0x18DF],
- ["8134E932",0x18E0],
- ["8134E933",0x18E1],
- ["8134E934",0x18E2],
- ["8134E935",0x18E3],
- ["8134E936",0x18E4],
- ["8134E937",0x18E5],
- ["8134E938",0x18E6],
- ["8134E939",0x18E7],
- ["8134EA30",0x18E8],
- ["8134EA31",0x18E9],
- ["8134EA32",0x18EA],
- ["8134EA33",0x18EB],
- ["8134EA34",0x18EC],
- ["8134EA35",0x18ED],
- ["8134EA36",0x18EE],
- ["8134EA37",0x18EF],
- ["8134EA38",0x18F0],
- ["8134EA39",0x18F1],
- ["8134EB30",0x18F2],
- ["8134EB31",0x18F3],
- ["8134EB32",0x18F4],
- ["8134EB33",0x18F5],
- ["8134EB34",0x18F6],
- ["8134EB35",0x18F7],
- ["8134EB36",0x18F8],
- ["8134EB37",0x18F9],
- ["8134EB38",0x18FA],
- ["8134EB39",0x18FB],
- ["8134EC30",0x18FC],
- ["8134EC31",0x18FD],
- ["8134EC32",0x18FE],
- ["8134EC33",0x18FF],
- ["8134EC34",0x1900],
- ["8134EC35",0x1901],
- ["8134EC36",0x1902],
- ["8134EC37",0x1903],
- ["8134EC38",0x1904],
- ["8134EC39",0x1905],
- ["8134ED30",0x1906],
- ["8134ED31",0x1907],
- ["8134ED32",0x1908],
- ["8134ED33",0x1909],
- ["8134ED34",0x190A],
- ["8134ED35",0x190B],
- ["8134ED36",0x190C],
- ["8134ED37",0x190D],
- ["8134ED38",0x190E],
- ["8134ED39",0x190F],
- ["8134EE30",0x1910],
- ["8134EE31",0x1911],
- ["8134EE32",0x1912],
- ["8134EE33",0x1913],
- ["8134EE34",0x1914],
- ["8134EE35",0x1915],
- ["8134EE36",0x1916],
- ["8134EE37",0x1917],
- ["8134EE38",0x1918],
- ["8134EE39",0x1919],
- ["8134EF30",0x191A],
- ["8134EF31",0x191B],
- ["8134EF32",0x191C],
- ["8134EF33",0x191D],
- ["8134EF34",0x191E],
- ["8134EF35",0x191F],
- ["8134EF36",0x1920],
- ["8134EF37",0x1921],
- ["8134EF38",0x1922],
- ["8134EF39",0x1923],
- ["8134F030",0x1924],
- ["8134F031",0x1925],
- ["8134F032",0x1926],
- ["8134F033",0x1927],
- ["8134F034",0x1928],
- ["8134F035",0x1929],
- ["8134F036",0x192A],
- ["8134F037",0x192B],
- ["8134F038",0x192C],
- ["8134F039",0x192D],
- ["8134F130",0x192E],
- ["8134F131",0x192F],
- ["8134F132",0x1930],
- ["8134F133",0x1931],
- ["8134F134",0x1932],
- ["8134F135",0x1933],
- ["8134F136",0x1934],
- ["8134F137",0x1935],
- ["8134F138",0x1936],
- ["8134F139",0x1937],
- ["8134F230",0x1938],
- ["8134F231",0x1939],
- ["8134F232",0x193A],
- ["8134F233",0x193B],
- ["8134F234",0x193C],
- ["8134F235",0x193D],
- ["8134F236",0x193E],
- ["8134F237",0x193F],
- ["8134F238",0x1940],
- ["8134F239",0x1941],
- ["8134F330",0x1942],
- ["8134F331",0x1943],
- ["8134F332",0x1944],
- ["8134F333",0x1945],
- ["8134F334",0x1946],
- ["8134F335",0x1947],
- ["8134F336",0x1948],
- ["8134F337",0x1949],
- ["8134F338",0x194A],
- ["8134F339",0x194B],
- ["8134F430",0x194C],
- ["8134F431",0x194D],
- ["8134F432",0x194E],
- ["8134F433",0x194F],
- ["8134F434",0x1950],
- ["8134F435",0x1951],
- ["8134F436",0x1952],
- ["8134F437",0x1953],
- ["8134F438",0x1954],
- ["8134F439",0x1955],
- ["8134F530",0x1956],
- ["8134F531",0x1957],
- ["8134F532",0x1958],
- ["8134F533",0x1959],
- ["8134F534",0x195A],
- ["8134F535",0x195B],
- ["8134F536",0x195C],
- ["8134F537",0x195D],
- ["8134F538",0x195E],
- ["8134F539",0x195F],
- ["8134F630",0x1960],
- ["8134F631",0x1961],
- ["8134F632",0x1962],
- ["8134F633",0x1963],
- ["8134F634",0x1964],
- ["8134F635",0x1965],
- ["8134F636",0x1966],
- ["8134F637",0x1967],
- ["8134F638",0x1968],
- ["8134F639",0x1969],
- ["8134F730",0x196A],
- ["8134F731",0x196B],
- ["8134F732",0x196C],
- ["8134F733",0x196D],
- ["8134F734",0x196E],
- ["8134F735",0x196F],
- ["8134F736",0x1970],
- ["8134F737",0x1971],
- ["8134F738",0x1972],
- ["8134F739",0x1973],
- ["8134F830",0x1974],
- ["8134F831",0x1975],
- ["8134F832",0x1976],
- ["8134F833",0x1977],
- ["8134F834",0x1978],
- ["8134F835",0x1979],
- ["8134F836",0x197A],
- ["8134F837",0x197B],
- ["8134F838",0x197C],
- ["8134F839",0x197D],
- ["8134F930",0x197E],
- ["8134F931",0x197F],
- ["8134F932",0x1980],
- ["8134F933",0x1981],
- ["8134F934",0x1982],
- ["8134F935",0x1983],
- ["8134F936",0x1984],
- ["8134F937",0x1985],
- ["8134F938",0x1986],
- ["8134F939",0x1987],
- ["8134FA30",0x1988],
- ["8134FA31",0x1989],
- ["8134FA32",0x198A],
- ["8134FA33",0x198B],
- ["8134FA34",0x198C],
- ["8134FA35",0x198D],
- ["8134FA36",0x198E],
- ["8134FA37",0x198F],
- ["8134FA38",0x1990],
- ["8134FA39",0x1991],
- ["8134FB30",0x1992],
- ["8134FB31",0x1993],
- ["8134FB32",0x1994],
- ["8134FB33",0x1995],
- ["8134FB34",0x1996],
- ["8134FB35",0x1997],
- ["8134FB36",0x1998],
- ["8134FB37",0x1999],
- ["8134FB38",0x199A],
- ["8134FB39",0x199B],
- ["8134FC30",0x199C],
- ["8134FC31",0x199D],
- ["8134FC32",0x199E],
- ["8134FC33",0x199F],
- ["8134FC34",0x19A0],
- ["8134FC35",0x19A1],
- ["8134FC36",0x19A2],
- ["8134FC37",0x19A3],
- ["8134FC38",0x19A4],
- ["8134FC39",0x19A5],
- ["8134FD30",0x19A6],
- ["8134FD31",0x19A7],
- ["8134FD32",0x19A8],
- ["8134FD33",0x19A9],
- ["8134FD34",0x19AA],
- ["8134FD35",0x19AB],
- ["8134FD36",0x19AC],
- ["8134FD37",0x19AD],
- ["8134FD38",0x19AE],
- ["8134FD39",0x19AF],
- ["8134FE30",0x19B0],
- ["8134FE31",0x19B1],
- ["8134FE32",0x19B2],
- ["8134FE33",0x19B3],
- ["8134FE34",0x19B4],
- ["8134FE35",0x19B5],
- ["8134FE36",0x19B6],
- ["8134FE37",0x19B7],
- ["8134FE38",0x19B8],
- ["8134FE39",0x19B9],
- ["81358130",0x19BA],
- ["81358131",0x19BB],
- ["81358132",0x19BC],
- ["81358133",0x19BD],
- ["81358134",0x19BE],
- ["81358135",0x19BF],
- ["81358136",0x19C0],
- ["81358137",0x19C1],
- ["81358138",0x19C2],
- ["81358139",0x19C3],
- ["81358230",0x19C4],
- ["81358231",0x19C5],
- ["81358232",0x19C6],
- ["81358233",0x19C7],
- ["81358234",0x19C8],
- ["81358235",0x19C9],
- ["81358236",0x19CA],
- ["81358237",0x19CB],
- ["81358238",0x19CC],
- ["81358239",0x19CD],
- ["81358330",0x19CE],
- ["81358331",0x19CF],
- ["81358332",0x19D0],
- ["81358333",0x19D1],
- ["81358334",0x19D2],
- ["81358335",0x19D3],
- ["81358336",0x19D4],
- ["81358337",0x19D5],
- ["81358338",0x19D6],
- ["81358339",0x19D7],
- ["81358430",0x19D8],
- ["81358431",0x19D9],
- ["81358432",0x19DA],
- ["81358433",0x19DB],
- ["81358434",0x19DC],
- ["81358435",0x19DD],
- ["81358436",0x19DE],
- ["81358437",0x19DF],
- ["81358438",0x19E0],
- ["81358439",0x19E1],
- ["81358530",0x19E2],
- ["81358531",0x19E3],
- ["81358532",0x19E4],
- ["81358533",0x19E5],
- ["81358534",0x19E6],
- ["81358535",0x19E7],
- ["81358536",0x19E8],
- ["81358537",0x19E9],
- ["81358538",0x19EA],
- ["81358539",0x19EB],
- ["81358630",0x19EC],
- ["81358631",0x19ED],
- ["81358632",0x19EE],
- ["81358633",0x19EF],
- ["81358634",0x19F0],
- ["81358635",0x19F1],
- ["81358636",0x19F2],
- ["81358637",0x19F3],
- ["81358638",0x19F4],
- ["81358639",0x19F5],
- ["81358730",0x19F6],
- ["81358731",0x19F7],
- ["81358732",0x19F8],
- ["81358733",0x19F9],
- ["81358734",0x19FA],
- ["81358735",0x19FB],
- ["81358736",0x19FC],
- ["81358737",0x19FD],
- ["81358738",0x19FE],
- ["81358739",0x19FF],
- ["81358830",0x1A00],
- ["81358831",0x1A01],
- ["81358832",0x1A02],
- ["81358833",0x1A03],
- ["81358834",0x1A04],
- ["81358835",0x1A05],
- ["81358836",0x1A06],
- ["81358837",0x1A07],
- ["81358838",0x1A08],
- ["81358839",0x1A09],
- ["81358930",0x1A0A],
- ["81358931",0x1A0B],
- ["81358932",0x1A0C],
- ["81358933",0x1A0D],
- ["81358934",0x1A0E],
- ["81358935",0x1A0F],
- ["81358936",0x1A10],
- ["81358937",0x1A11],
- ["81358938",0x1A12],
- ["81358939",0x1A13],
- ["81358A30",0x1A14],
- ["81358A31",0x1A15],
- ["81358A32",0x1A16],
- ["81358A33",0x1A17],
- ["81358A34",0x1A18],
- ["81358A35",0x1A19],
- ["81358A36",0x1A1A],
- ["81358A37",0x1A1B],
- ["81358A38",0x1A1C],
- ["81358A39",0x1A1D],
- ["81358B30",0x1A1E],
- ["81358B31",0x1A1F],
- ["81358B32",0x1A20],
- ["81358B33",0x1A21],
- ["81358B34",0x1A22],
- ["81358B35",0x1A23],
- ["81358B36",0x1A24],
- ["81358B37",0x1A25],
- ["81358B38",0x1A26],
- ["81358B39",0x1A27],
- ["81358C30",0x1A28],
- ["81358C31",0x1A29],
- ["81358C32",0x1A2A],
- ["81358C33",0x1A2B],
- ["81358C34",0x1A2C],
- ["81358C35",0x1A2D],
- ["81358C36",0x1A2E],
- ["81358C37",0x1A2F],
- ["81358C38",0x1A30],
- ["81358C39",0x1A31],
- ["81358D30",0x1A32],
- ["81358D31",0x1A33],
- ["81358D32",0x1A34],
- ["81358D33",0x1A35],
- ["81358D34",0x1A36],
- ["81358D35",0x1A37],
- ["81358D36",0x1A38],
- ["81358D37",0x1A39],
- ["81358D38",0x1A3A],
- ["81358D39",0x1A3B],
- ["81358E30",0x1A3C],
- ["81358E31",0x1A3D],
- ["81358E32",0x1A3E],
- ["81358E33",0x1A3F],
- ["81358E34",0x1A40],
- ["81358E35",0x1A41],
- ["81358E36",0x1A42],
- ["81358E37",0x1A43],
- ["81358E38",0x1A44],
- ["81358E39",0x1A45],
- ["81358F30",0x1A46],
- ["81358F31",0x1A47],
- ["81358F32",0x1A48],
- ["81358F33",0x1A49],
- ["81358F34",0x1A4A],
- ["81358F35",0x1A4B],
- ["81358F36",0x1A4C],
- ["81358F37",0x1A4D],
- ["81358F38",0x1A4E],
- ["81358F39",0x1A4F],
- ["81359030",0x1A50],
- ["81359031",0x1A51],
- ["81359032",0x1A52],
- ["81359033",0x1A53],
- ["81359034",0x1A54],
- ["81359035",0x1A55],
- ["81359036",0x1A56],
- ["81359037",0x1A57],
- ["81359038",0x1A58],
- ["81359039",0x1A59],
- ["81359130",0x1A5A],
- ["81359131",0x1A5B],
- ["81359132",0x1A5C],
- ["81359133",0x1A5D],
- ["81359134",0x1A5E],
- ["81359135",0x1A5F],
- ["81359136",0x1A60],
- ["81359137",0x1A61],
- ["81359138",0x1A62],
- ["81359139",0x1A63],
- ["81359230",0x1A64],
- ["81359231",0x1A65],
- ["81359232",0x1A66],
- ["81359233",0x1A67],
- ["81359234",0x1A68],
- ["81359235",0x1A69],
- ["81359236",0x1A6A],
- ["81359237",0x1A6B],
- ["81359238",0x1A6C],
- ["81359239",0x1A6D],
- ["81359330",0x1A6E],
- ["81359331",0x1A6F],
- ["81359332",0x1A70],
- ["81359333",0x1A71],
- ["81359334",0x1A72],
- ["81359335",0x1A73],
- ["81359336",0x1A74],
- ["81359337",0x1A75],
- ["81359338",0x1A76],
- ["81359339",0x1A77],
- ["81359430",0x1A78],
- ["81359431",0x1A79],
- ["81359432",0x1A7A],
- ["81359433",0x1A7B],
- ["81359434",0x1A7C],
- ["81359435",0x1A7D],
- ["81359436",0x1A7E],
- ["81359437",0x1A7F],
- ["81359438",0x1A80],
- ["81359439",0x1A81],
- ["81359530",0x1A82],
- ["81359531",0x1A83],
- ["81359532",0x1A84],
- ["81359533",0x1A85],
- ["81359534",0x1A86],
- ["81359535",0x1A87],
- ["81359536",0x1A88],
- ["81359537",0x1A89],
- ["81359538",0x1A8A],
- ["81359539",0x1A8B],
- ["81359630",0x1A8C],
- ["81359631",0x1A8D],
- ["81359632",0x1A8E],
- ["81359633",0x1A8F],
- ["81359634",0x1A90],
- ["81359635",0x1A91],
- ["81359636",0x1A92],
- ["81359637",0x1A93],
- ["81359638",0x1A94],
- ["81359639",0x1A95],
- ["81359730",0x1A96],
- ["81359731",0x1A97],
- ["81359732",0x1A98],
- ["81359733",0x1A99],
- ["81359734",0x1A9A],
- ["81359735",0x1A9B],
- ["81359736",0x1A9C],
- ["81359737",0x1A9D],
- ["81359738",0x1A9E],
- ["81359739",0x1A9F],
- ["81359830",0x1AA0],
- ["81359831",0x1AA1],
- ["81359832",0x1AA2],
- ["81359833",0x1AA3],
- ["81359834",0x1AA4],
- ["81359835",0x1AA5],
- ["81359836",0x1AA6],
- ["81359837",0x1AA7],
- ["81359838",0x1AA8],
- ["81359839",0x1AA9],
- ["81359930",0x1AAA],
- ["81359931",0x1AAB],
- ["81359932",0x1AAC],
- ["81359933",0x1AAD],
- ["81359934",0x1AAE],
- ["81359935",0x1AAF],
- ["81359936",0x1AB0],
- ["81359937",0x1AB1],
- ["81359938",0x1AB2],
- ["81359939",0x1AB3],
- ["81359A30",0x1AB4],
- ["81359A31",0x1AB5],
- ["81359A32",0x1AB6],
- ["81359A33",0x1AB7],
- ["81359A34",0x1AB8],
- ["81359A35",0x1AB9],
- ["81359A36",0x1ABA],
- ["81359A37",0x1ABB],
- ["81359A38",0x1ABC],
- ["81359A39",0x1ABD],
- ["81359B30",0x1ABE],
- ["81359B31",0x1ABF],
- ["81359B32",0x1AC0],
- ["81359B33",0x1AC1],
- ["81359B34",0x1AC2],
- ["81359B35",0x1AC3],
- ["81359B36",0x1AC4],
- ["81359B37",0x1AC5],
- ["81359B38",0x1AC6],
- ["81359B39",0x1AC7],
- ["81359C30",0x1AC8],
- ["81359C31",0x1AC9],
- ["81359C32",0x1ACA],
- ["81359C33",0x1ACB],
- ["81359C34",0x1ACC],
- ["81359C35",0x1ACD],
- ["81359C36",0x1ACE],
- ["81359C37",0x1ACF],
- ["81359C38",0x1AD0],
- ["81359C39",0x1AD1],
- ["81359D30",0x1AD2],
- ["81359D31",0x1AD3],
- ["81359D32",0x1AD4],
- ["81359D33",0x1AD5],
- ["81359D34",0x1AD6],
- ["81359D35",0x1AD7],
- ["81359D36",0x1AD8],
- ["81359D37",0x1AD9],
- ["81359D38",0x1ADA],
- ["81359D39",0x1ADB],
- ["81359E30",0x1ADC],
- ["81359E31",0x1ADD],
- ["81359E32",0x1ADE],
- ["81359E33",0x1ADF],
- ["81359E34",0x1AE0],
- ["81359E35",0x1AE1],
- ["81359E36",0x1AE2],
- ["81359E37",0x1AE3],
- ["81359E38",0x1AE4],
- ["81359E39",0x1AE5],
- ["81359F30",0x1AE6],
- ["81359F31",0x1AE7],
- ["81359F32",0x1AE8],
- ["81359F33",0x1AE9],
- ["81359F34",0x1AEA],
- ["81359F35",0x1AEB],
- ["81359F36",0x1AEC],
- ["81359F37",0x1AED],
- ["81359F38",0x1AEE],
- ["81359F39",0x1AEF],
- ["8135A030",0x1AF0],
- ["8135A031",0x1AF1],
- ["8135A032",0x1AF2],
- ["8135A033",0x1AF3],
- ["8135A034",0x1AF4],
- ["8135A035",0x1AF5],
- ["8135A036",0x1AF6],
- ["8135A037",0x1AF7],
- ["8135A038",0x1AF8],
- ["8135A039",0x1AF9],
- ["8135A130",0x1AFA],
- ["8135A131",0x1AFB],
- ["8135A132",0x1AFC],
- ["8135A133",0x1AFD],
- ["8135A134",0x1AFE],
- ["8135A135",0x1AFF],
- ["8135A136",0x1B00],
- ["8135A137",0x1B01],
- ["8135A138",0x1B02],
- ["8135A139",0x1B03],
- ["8135A230",0x1B04],
- ["8135A231",0x1B05],
- ["8135A232",0x1B06],
- ["8135A233",0x1B07],
- ["8135A234",0x1B08],
- ["8135A235",0x1B09],
- ["8135A236",0x1B0A],
- ["8135A237",0x1B0B],
- ["8135A238",0x1B0C],
- ["8135A239",0x1B0D],
- ["8135A330",0x1B0E],
- ["8135A331",0x1B0F],
- ["8135A332",0x1B10],
- ["8135A333",0x1B11],
- ["8135A334",0x1B12],
- ["8135A335",0x1B13],
- ["8135A336",0x1B14],
- ["8135A337",0x1B15],
- ["8135A338",0x1B16],
- ["8135A339",0x1B17],
- ["8135A430",0x1B18],
- ["8135A431",0x1B19],
- ["8135A432",0x1B1A],
- ["8135A433",0x1B1B],
- ["8135A434",0x1B1C],
- ["8135A435",0x1B1D],
- ["8135A436",0x1B1E],
- ["8135A437",0x1B1F],
- ["8135A438",0x1B20],
- ["8135A439",0x1B21],
- ["8135A530",0x1B22],
- ["8135A531",0x1B23],
- ["8135A532",0x1B24],
- ["8135A533",0x1B25],
- ["8135A534",0x1B26],
- ["8135A535",0x1B27],
- ["8135A536",0x1B28],
- ["8135A537",0x1B29],
- ["8135A538",0x1B2A],
- ["8135A539",0x1B2B],
- ["8135A630",0x1B2C],
- ["8135A631",0x1B2D],
- ["8135A632",0x1B2E],
- ["8135A633",0x1B2F],
- ["8135A634",0x1B30],
- ["8135A635",0x1B31],
- ["8135A636",0x1B32],
- ["8135A637",0x1B33],
- ["8135A638",0x1B34],
- ["8135A639",0x1B35],
- ["8135A730",0x1B36],
- ["8135A731",0x1B37],
- ["8135A732",0x1B38],
- ["8135A733",0x1B39],
- ["8135A734",0x1B3A],
- ["8135A735",0x1B3B],
- ["8135A736",0x1B3C],
- ["8135A737",0x1B3D],
- ["8135A738",0x1B3E],
- ["8135A739",0x1B3F],
- ["8135A830",0x1B40],
- ["8135A831",0x1B41],
- ["8135A832",0x1B42],
- ["8135A833",0x1B43],
- ["8135A834",0x1B44],
- ["8135A835",0x1B45],
- ["8135A836",0x1B46],
- ["8135A837",0x1B47],
- ["8135A838",0x1B48],
- ["8135A839",0x1B49],
- ["8135A930",0x1B4A],
- ["8135A931",0x1B4B],
- ["8135A932",0x1B4C],
- ["8135A933",0x1B4D],
- ["8135A934",0x1B4E],
- ["8135A935",0x1B4F],
- ["8135A936",0x1B50],
- ["8135A937",0x1B51],
- ["8135A938",0x1B52],
- ["8135A939",0x1B53],
- ["8135AA30",0x1B54],
- ["8135AA31",0x1B55],
- ["8135AA32",0x1B56],
- ["8135AA33",0x1B57],
- ["8135AA34",0x1B58],
- ["8135AA35",0x1B59],
- ["8135AA36",0x1B5A],
- ["8135AA37",0x1B5B],
- ["8135AA38",0x1B5C],
- ["8135AA39",0x1B5D],
- ["8135AB30",0x1B5E],
- ["8135AB31",0x1B5F],
- ["8135AB32",0x1B60],
- ["8135AB33",0x1B61],
- ["8135AB34",0x1B62],
- ["8135AB35",0x1B63],
- ["8135AB36",0x1B64],
- ["8135AB37",0x1B65],
- ["8135AB38",0x1B66],
- ["8135AB39",0x1B67],
- ["8135AC30",0x1B68],
- ["8135AC31",0x1B69],
- ["8135AC32",0x1B6A],
- ["8135AC33",0x1B6B],
- ["8135AC34",0x1B6C],
- ["8135AC35",0x1B6D],
- ["8135AC36",0x1B6E],
- ["8135AC37",0x1B6F],
- ["8135AC38",0x1B70],
- ["8135AC39",0x1B71],
- ["8135AD30",0x1B72],
- ["8135AD31",0x1B73],
- ["8135AD32",0x1B74],
- ["8135AD33",0x1B75],
- ["8135AD34",0x1B76],
- ["8135AD35",0x1B77],
- ["8135AD36",0x1B78],
- ["8135AD37",0x1B79],
- ["8135AD38",0x1B7A],
- ["8135AD39",0x1B7B],
- ["8135AE30",0x1B7C],
- ["8135AE31",0x1B7D],
- ["8135AE32",0x1B7E],
- ["8135AE33",0x1B7F],
- ["8135AE34",0x1B80],
- ["8135AE35",0x1B81],
- ["8135AE36",0x1B82],
- ["8135AE37",0x1B83],
- ["8135AE38",0x1B84],
- ["8135AE39",0x1B85],
- ["8135AF30",0x1B86],
- ["8135AF31",0x1B87],
- ["8135AF32",0x1B88],
- ["8135AF33",0x1B89],
- ["8135AF34",0x1B8A],
- ["8135AF35",0x1B8B],
- ["8135AF36",0x1B8C],
- ["8135AF37",0x1B8D],
- ["8135AF38",0x1B8E],
- ["8135AF39",0x1B8F],
- ["8135B030",0x1B90],
- ["8135B031",0x1B91],
- ["8135B032",0x1B92],
- ["8135B033",0x1B93],
- ["8135B034",0x1B94],
- ["8135B035",0x1B95],
- ["8135B036",0x1B96],
- ["8135B037",0x1B97],
- ["8135B038",0x1B98],
- ["8135B039",0x1B99],
- ["8135B130",0x1B9A],
- ["8135B131",0x1B9B],
- ["8135B132",0x1B9C],
- ["8135B133",0x1B9D],
- ["8135B134",0x1B9E],
- ["8135B135",0x1B9F],
- ["8135B136",0x1BA0],
- ["8135B137",0x1BA1],
- ["8135B138",0x1BA2],
- ["8135B139",0x1BA3],
- ["8135B230",0x1BA4],
- ["8135B231",0x1BA5],
- ["8135B232",0x1BA6],
- ["8135B233",0x1BA7],
- ["8135B234",0x1BA8],
- ["8135B235",0x1BA9],
- ["8135B236",0x1BAA],
- ["8135B237",0x1BAB],
- ["8135B238",0x1BAC],
- ["8135B239",0x1BAD],
- ["8135B330",0x1BAE],
- ["8135B331",0x1BAF],
- ["8135B332",0x1BB0],
- ["8135B333",0x1BB1],
- ["8135B334",0x1BB2],
- ["8135B335",0x1BB3],
- ["8135B336",0x1BB4],
- ["8135B337",0x1BB5],
- ["8135B338",0x1BB6],
- ["8135B339",0x1BB7],
- ["8135B430",0x1BB8],
- ["8135B431",0x1BB9],
- ["8135B432",0x1BBA],
- ["8135B433",0x1BBB],
- ["8135B434",0x1BBC],
- ["8135B435",0x1BBD],
- ["8135B436",0x1BBE],
- ["8135B437",0x1BBF],
- ["8135B438",0x1BC0],
- ["8135B439",0x1BC1],
- ["8135B530",0x1BC2],
- ["8135B531",0x1BC3],
- ["8135B532",0x1BC4],
- ["8135B533",0x1BC5],
- ["8135B534",0x1BC6],
- ["8135B535",0x1BC7],
- ["8135B536",0x1BC8],
- ["8135B537",0x1BC9],
- ["8135B538",0x1BCA],
- ["8135B539",0x1BCB],
- ["8135B630",0x1BCC],
- ["8135B631",0x1BCD],
- ["8135B632",0x1BCE],
- ["8135B633",0x1BCF],
- ["8135B634",0x1BD0],
- ["8135B635",0x1BD1],
- ["8135B636",0x1BD2],
- ["8135B637",0x1BD3],
- ["8135B638",0x1BD4],
- ["8135B639",0x1BD5],
- ["8135B730",0x1BD6],
- ["8135B731",0x1BD7],
- ["8135B732",0x1BD8],
- ["8135B733",0x1BD9],
- ["8135B734",0x1BDA],
- ["8135B735",0x1BDB],
- ["8135B736",0x1BDC],
- ["8135B737",0x1BDD],
- ["8135B738",0x1BDE],
- ["8135B739",0x1BDF],
- ["8135B830",0x1BE0],
- ["8135B831",0x1BE1],
- ["8135B832",0x1BE2],
- ["8135B833",0x1BE3],
- ["8135B834",0x1BE4],
- ["8135B835",0x1BE5],
- ["8135B836",0x1BE6],
- ["8135B837",0x1BE7],
- ["8135B838",0x1BE8],
- ["8135B839",0x1BE9],
- ["8135B930",0x1BEA],
- ["8135B931",0x1BEB],
- ["8135B932",0x1BEC],
- ["8135B933",0x1BED],
- ["8135B934",0x1BEE],
- ["8135B935",0x1BEF],
- ["8135B936",0x1BF0],
- ["8135B937",0x1BF1],
- ["8135B938",0x1BF2],
- ["8135B939",0x1BF3],
- ["8135BA30",0x1BF4],
- ["8135BA31",0x1BF5],
- ["8135BA32",0x1BF6],
- ["8135BA33",0x1BF7],
- ["8135BA34",0x1BF8],
- ["8135BA35",0x1BF9],
- ["8135BA36",0x1BFA],
- ["8135BA37",0x1BFB],
- ["8135BA38",0x1BFC],
- ["8135BA39",0x1BFD],
- ["8135BB30",0x1BFE],
- ["8135BB31",0x1BFF],
- ["8135BB32",0x1C00],
- ["8135BB33",0x1C01],
- ["8135BB34",0x1C02],
- ["8135BB35",0x1C03],
- ["8135BB36",0x1C04],
- ["8135BB37",0x1C05],
- ["8135BB38",0x1C06],
- ["8135BB39",0x1C07],
- ["8135BC30",0x1C08],
- ["8135BC31",0x1C09],
- ["8135BC32",0x1C0A],
- ["8135BC33",0x1C0B],
- ["8135BC34",0x1C0C],
- ["8135BC35",0x1C0D],
- ["8135BC36",0x1C0E],
- ["8135BC37",0x1C0F],
- ["8135BC38",0x1C10],
- ["8135BC39",0x1C11],
- ["8135BD30",0x1C12],
- ["8135BD31",0x1C13],
- ["8135BD32",0x1C14],
- ["8135BD33",0x1C15],
- ["8135BD34",0x1C16],
- ["8135BD35",0x1C17],
- ["8135BD36",0x1C18],
- ["8135BD37",0x1C19],
- ["8135BD38",0x1C1A],
- ["8135BD39",0x1C1B],
- ["8135BE30",0x1C1C],
- ["8135BE31",0x1C1D],
- ["8135BE32",0x1C1E],
- ["8135BE33",0x1C1F],
- ["8135BE34",0x1C20],
- ["8135BE35",0x1C21],
- ["8135BE36",0x1C22],
- ["8135BE37",0x1C23],
- ["8135BE38",0x1C24],
- ["8135BE39",0x1C25],
- ["8135BF30",0x1C26],
- ["8135BF31",0x1C27],
- ["8135BF32",0x1C28],
- ["8135BF33",0x1C29],
- ["8135BF34",0x1C2A],
- ["8135BF35",0x1C2B],
- ["8135BF36",0x1C2C],
- ["8135BF37",0x1C2D],
- ["8135BF38",0x1C2E],
- ["8135BF39",0x1C2F],
- ["8135C030",0x1C30],
- ["8135C031",0x1C31],
- ["8135C032",0x1C32],
- ["8135C033",0x1C33],
- ["8135C034",0x1C34],
- ["8135C035",0x1C35],
- ["8135C036",0x1C36],
- ["8135C037",0x1C37],
- ["8135C038",0x1C38],
- ["8135C039",0x1C39],
- ["8135C130",0x1C3A],
- ["8135C131",0x1C3B],
- ["8135C132",0x1C3C],
- ["8135C133",0x1C3D],
- ["8135C134",0x1C3E],
- ["8135C135",0x1C3F],
- ["8135C136",0x1C40],
- ["8135C137",0x1C41],
- ["8135C138",0x1C42],
- ["8135C139",0x1C43],
- ["8135C230",0x1C44],
- ["8135C231",0x1C45],
- ["8135C232",0x1C46],
- ["8135C233",0x1C47],
- ["8135C234",0x1C48],
- ["8135C235",0x1C49],
- ["8135C236",0x1C4A],
- ["8135C237",0x1C4B],
- ["8135C238",0x1C4C],
- ["8135C239",0x1C4D],
- ["8135C330",0x1C4E],
- ["8135C331",0x1C4F],
- ["8135C332",0x1C50],
- ["8135C333",0x1C51],
- ["8135C334",0x1C52],
- ["8135C335",0x1C53],
- ["8135C336",0x1C54],
- ["8135C337",0x1C55],
- ["8135C338",0x1C56],
- ["8135C339",0x1C57],
- ["8135C430",0x1C58],
- ["8135C431",0x1C59],
- ["8135C432",0x1C5A],
- ["8135C433",0x1C5B],
- ["8135C434",0x1C5C],
- ["8135C435",0x1C5D],
- ["8135C436",0x1C5E],
- ["8135C437",0x1C5F],
- ["8135C438",0x1C60],
- ["8135C439",0x1C61],
- ["8135C530",0x1C62],
- ["8135C531",0x1C63],
- ["8135C532",0x1C64],
- ["8135C533",0x1C65],
- ["8135C534",0x1C66],
- ["8135C535",0x1C67],
- ["8135C536",0x1C68],
- ["8135C537",0x1C69],
- ["8135C538",0x1C6A],
- ["8135C539",0x1C6B],
- ["8135C630",0x1C6C],
- ["8135C631",0x1C6D],
- ["8135C632",0x1C6E],
- ["8135C633",0x1C6F],
- ["8135C634",0x1C70],
- ["8135C635",0x1C71],
- ["8135C636",0x1C72],
- ["8135C637",0x1C73],
- ["8135C638",0x1C74],
- ["8135C639",0x1C75],
- ["8135C730",0x1C76],
- ["8135C731",0x1C77],
- ["8135C732",0x1C78],
- ["8135C733",0x1C79],
- ["8135C734",0x1C7A],
- ["8135C735",0x1C7B],
- ["8135C736",0x1C7C],
- ["8135C737",0x1C7D],
- ["8135C738",0x1C7E],
- ["8135C739",0x1C7F],
- ["8135C830",0x1C80],
- ["8135C831",0x1C81],
- ["8135C832",0x1C82],
- ["8135C833",0x1C83],
- ["8135C834",0x1C84],
- ["8135C835",0x1C85],
- ["8135C836",0x1C86],
- ["8135C837",0x1C87],
- ["8135C838",0x1C88],
- ["8135C839",0x1C89],
- ["8135C930",0x1C8A],
- ["8135C931",0x1C8B],
- ["8135C932",0x1C8C],
- ["8135C933",0x1C8D],
- ["8135C934",0x1C8E],
- ["8135C935",0x1C8F],
- ["8135C936",0x1C90],
- ["8135C937",0x1C91],
- ["8135C938",0x1C92],
- ["8135C939",0x1C93],
- ["8135CA30",0x1C94],
- ["8135CA31",0x1C95],
- ["8135CA32",0x1C96],
- ["8135CA33",0x1C97],
- ["8135CA34",0x1C98],
- ["8135CA35",0x1C99],
- ["8135CA36",0x1C9A],
- ["8135CA37",0x1C9B],
- ["8135CA38",0x1C9C],
- ["8135CA39",0x1C9D],
- ["8135CB30",0x1C9E],
- ["8135CB31",0x1C9F],
- ["8135CB32",0x1CA0],
- ["8135CB33",0x1CA1],
- ["8135CB34",0x1CA2],
- ["8135CB35",0x1CA3],
- ["8135CB36",0x1CA4],
- ["8135CB37",0x1CA5],
- ["8135CB38",0x1CA6],
- ["8135CB39",0x1CA7],
- ["8135CC30",0x1CA8],
- ["8135CC31",0x1CA9],
- ["8135CC32",0x1CAA],
- ["8135CC33",0x1CAB],
- ["8135CC34",0x1CAC],
- ["8135CC35",0x1CAD],
- ["8135CC36",0x1CAE],
- ["8135CC37",0x1CAF],
- ["8135CC38",0x1CB0],
- ["8135CC39",0x1CB1],
- ["8135CD30",0x1CB2],
- ["8135CD31",0x1CB3],
- ["8135CD32",0x1CB4],
- ["8135CD33",0x1CB5],
- ["8135CD34",0x1CB6],
- ["8135CD35",0x1CB7],
- ["8135CD36",0x1CB8],
- ["8135CD37",0x1CB9],
- ["8135CD38",0x1CBA],
- ["8135CD39",0x1CBB],
- ["8135CE30",0x1CBC],
- ["8135CE31",0x1CBD],
- ["8135CE32",0x1CBE],
- ["8135CE33",0x1CBF],
- ["8135CE34",0x1CC0],
- ["8135CE35",0x1CC1],
- ["8135CE36",0x1CC2],
- ["8135CE37",0x1CC3],
- ["8135CE38",0x1CC4],
- ["8135CE39",0x1CC5],
- ["8135CF30",0x1CC6],
- ["8135CF31",0x1CC7],
- ["8135CF32",0x1CC8],
- ["8135CF33",0x1CC9],
- ["8135CF34",0x1CCA],
- ["8135CF35",0x1CCB],
- ["8135CF36",0x1CCC],
- ["8135CF37",0x1CCD],
- ["8135CF38",0x1CCE],
- ["8135CF39",0x1CCF],
- ["8135D030",0x1CD0],
- ["8135D031",0x1CD1],
- ["8135D032",0x1CD2],
- ["8135D033",0x1CD3],
- ["8135D034",0x1CD4],
- ["8135D035",0x1CD5],
- ["8135D036",0x1CD6],
- ["8135D037",0x1CD7],
- ["8135D038",0x1CD8],
- ["8135D039",0x1CD9],
- ["8135D130",0x1CDA],
- ["8135D131",0x1CDB],
- ["8135D132",0x1CDC],
- ["8135D133",0x1CDD],
- ["8135D134",0x1CDE],
- ["8135D135",0x1CDF],
- ["8135D136",0x1CE0],
- ["8135D137",0x1CE1],
- ["8135D138",0x1CE2],
- ["8135D139",0x1CE3],
- ["8135D230",0x1CE4],
- ["8135D231",0x1CE5],
- ["8135D232",0x1CE6],
- ["8135D233",0x1CE7],
- ["8135D234",0x1CE8],
- ["8135D235",0x1CE9],
- ["8135D236",0x1CEA],
- ["8135D237",0x1CEB],
- ["8135D238",0x1CEC],
- ["8135D239",0x1CED],
- ["8135D330",0x1CEE],
- ["8135D331",0x1CEF],
- ["8135D332",0x1CF0],
- ["8135D333",0x1CF1],
- ["8135D334",0x1CF2],
- ["8135D335",0x1CF3],
- ["8135D336",0x1CF4],
- ["8135D337",0x1CF5],
- ["8135D338",0x1CF6],
- ["8135D339",0x1CF7],
- ["8135D430",0x1CF8],
- ["8135D431",0x1CF9],
- ["8135D432",0x1CFA],
- ["8135D433",0x1CFB],
- ["8135D434",0x1CFC],
- ["8135D435",0x1CFD],
- ["8135D436",0x1CFE],
- ["8135D437",0x1CFF],
- ["8135D438",0x1D00],
- ["8135D439",0x1D01],
- ["8135D530",0x1D02],
- ["8135D531",0x1D03],
- ["8135D532",0x1D04],
- ["8135D533",0x1D05],
- ["8135D534",0x1D06],
- ["8135D535",0x1D07],
- ["8135D536",0x1D08],
- ["8135D537",0x1D09],
- ["8135D538",0x1D0A],
- ["8135D539",0x1D0B],
- ["8135D630",0x1D0C],
- ["8135D631",0x1D0D],
- ["8135D632",0x1D0E],
- ["8135D633",0x1D0F],
- ["8135D634",0x1D10],
- ["8135D635",0x1D11],
- ["8135D636",0x1D12],
- ["8135D637",0x1D13],
- ["8135D638",0x1D14],
- ["8135D639",0x1D15],
- ["8135D730",0x1D16],
- ["8135D731",0x1D17],
- ["8135D732",0x1D18],
- ["8135D733",0x1D19],
- ["8135D734",0x1D1A],
- ["8135D735",0x1D1B],
- ["8135D736",0x1D1C],
- ["8135D737",0x1D1D],
- ["8135D738",0x1D1E],
- ["8135D739",0x1D1F],
- ["8135D830",0x1D20],
- ["8135D831",0x1D21],
- ["8135D832",0x1D22],
- ["8135D833",0x1D23],
- ["8135D834",0x1D24],
- ["8135D835",0x1D25],
- ["8135D836",0x1D26],
- ["8135D837",0x1D27],
- ["8135D838",0x1D28],
- ["8135D839",0x1D29],
- ["8135D930",0x1D2A],
- ["8135D931",0x1D2B],
- ["8135D932",0x1D2C],
- ["8135D933",0x1D2D],
- ["8135D934",0x1D2E],
- ["8135D935",0x1D2F],
- ["8135D936",0x1D30],
- ["8135D937",0x1D31],
- ["8135D938",0x1D32],
- ["8135D939",0x1D33],
- ["8135DA30",0x1D34],
- ["8135DA31",0x1D35],
- ["8135DA32",0x1D36],
- ["8135DA33",0x1D37],
- ["8135DA34",0x1D38],
- ["8135DA35",0x1D39],
- ["8135DA36",0x1D3A],
- ["8135DA37",0x1D3B],
- ["8135DA38",0x1D3C],
- ["8135DA39",0x1D3D],
- ["8135DB30",0x1D3E],
- ["8135DB31",0x1D3F],
- ["8135DB32",0x1D40],
- ["8135DB33",0x1D41],
- ["8135DB34",0x1D42],
- ["8135DB35",0x1D43],
- ["8135DB36",0x1D44],
- ["8135DB37",0x1D45],
- ["8135DB38",0x1D46],
- ["8135DB39",0x1D47],
- ["8135DC30",0x1D48],
- ["8135DC31",0x1D49],
- ["8135DC32",0x1D4A],
- ["8135DC33",0x1D4B],
- ["8135DC34",0x1D4C],
- ["8135DC35",0x1D4D],
- ["8135DC36",0x1D4E],
- ["8135DC37",0x1D4F],
- ["8135DC38",0x1D50],
- ["8135DC39",0x1D51],
- ["8135DD30",0x1D52],
- ["8135DD31",0x1D53],
- ["8135DD32",0x1D54],
- ["8135DD33",0x1D55],
- ["8135DD34",0x1D56],
- ["8135DD35",0x1D57],
- ["8135DD36",0x1D58],
- ["8135DD37",0x1D59],
- ["8135DD38",0x1D5A],
- ["8135DD39",0x1D5B],
- ["8135DE30",0x1D5C],
- ["8135DE31",0x1D5D],
- ["8135DE32",0x1D5E],
- ["8135DE33",0x1D5F],
- ["8135DE34",0x1D60],
- ["8135DE35",0x1D61],
- ["8135DE36",0x1D62],
- ["8135DE37",0x1D63],
- ["8135DE38",0x1D64],
- ["8135DE39",0x1D65],
- ["8135DF30",0x1D66],
- ["8135DF31",0x1D67],
- ["8135DF32",0x1D68],
- ["8135DF33",0x1D69],
- ["8135DF34",0x1D6A],
- ["8135DF35",0x1D6B],
- ["8135DF36",0x1D6C],
- ["8135DF37",0x1D6D],
- ["8135DF38",0x1D6E],
- ["8135DF39",0x1D6F],
- ["8135E030",0x1D70],
- ["8135E031",0x1D71],
- ["8135E032",0x1D72],
- ["8135E033",0x1D73],
- ["8135E034",0x1D74],
- ["8135E035",0x1D75],
- ["8135E036",0x1D76],
- ["8135E037",0x1D77],
- ["8135E038",0x1D78],
- ["8135E039",0x1D79],
- ["8135E130",0x1D7A],
- ["8135E131",0x1D7B],
- ["8135E132",0x1D7C],
- ["8135E133",0x1D7D],
- ["8135E134",0x1D7E],
- ["8135E135",0x1D7F],
- ["8135E136",0x1D80],
- ["8135E137",0x1D81],
- ["8135E138",0x1D82],
- ["8135E139",0x1D83],
- ["8135E230",0x1D84],
- ["8135E231",0x1D85],
- ["8135E232",0x1D86],
- ["8135E233",0x1D87],
- ["8135E234",0x1D88],
- ["8135E235",0x1D89],
- ["8135E236",0x1D8A],
- ["8135E237",0x1D8B],
- ["8135E238",0x1D8C],
- ["8135E239",0x1D8D],
- ["8135E330",0x1D8E],
- ["8135E331",0x1D8F],
- ["8135E332",0x1D90],
- ["8135E333",0x1D91],
- ["8135E334",0x1D92],
- ["8135E335",0x1D93],
- ["8135E336",0x1D94],
- ["8135E337",0x1D95],
- ["8135E338",0x1D96],
- ["8135E339",0x1D97],
- ["8135E430",0x1D98],
- ["8135E431",0x1D99],
- ["8135E432",0x1D9A],
- ["8135E433",0x1D9B],
- ["8135E434",0x1D9C],
- ["8135E435",0x1D9D],
- ["8135E436",0x1D9E],
- ["8135E437",0x1D9F],
- ["8135E438",0x1DA0],
- ["8135E439",0x1DA1],
- ["8135E530",0x1DA2],
- ["8135E531",0x1DA3],
- ["8135E532",0x1DA4],
- ["8135E533",0x1DA5],
- ["8135E534",0x1DA6],
- ["8135E535",0x1DA7],
- ["8135E536",0x1DA8],
- ["8135E537",0x1DA9],
- ["8135E538",0x1DAA],
- ["8135E539",0x1DAB],
- ["8135E630",0x1DAC],
- ["8135E631",0x1DAD],
- ["8135E632",0x1DAE],
- ["8135E633",0x1DAF],
- ["8135E634",0x1DB0],
- ["8135E635",0x1DB1],
- ["8135E636",0x1DB2],
- ["8135E637",0x1DB3],
- ["8135E638",0x1DB4],
- ["8135E639",0x1DB5],
- ["8135E730",0x1DB6],
- ["8135E731",0x1DB7],
- ["8135E732",0x1DB8],
- ["8135E733",0x1DB9],
- ["8135E734",0x1DBA],
- ["8135E735",0x1DBB],
- ["8135E736",0x1DBC],
- ["8135E737",0x1DBD],
- ["8135E738",0x1DBE],
- ["8135E739",0x1DBF],
- ["8135E830",0x1DC0],
- ["8135E831",0x1DC1],
- ["8135E832",0x1DC2],
- ["8135E833",0x1DC3],
- ["8135E834",0x1DC4],
- ["8135E835",0x1DC5],
- ["8135E836",0x1DC6],
- ["8135E837",0x1DC7],
- ["8135E838",0x1DC8],
- ["8135E839",0x1DC9],
- ["8135E930",0x1DCA],
- ["8135E931",0x1DCB],
- ["8135E932",0x1DCC],
- ["8135E933",0x1DCD],
- ["8135E934",0x1DCE],
- ["8135E935",0x1DCF],
- ["8135E936",0x1DD0],
- ["8135E937",0x1DD1],
- ["8135E938",0x1DD2],
- ["8135E939",0x1DD3],
- ["8135EA30",0x1DD4],
- ["8135EA31",0x1DD5],
- ["8135EA32",0x1DD6],
- ["8135EA33",0x1DD7],
- ["8135EA34",0x1DD8],
- ["8135EA35",0x1DD9],
- ["8135EA36",0x1DDA],
- ["8135EA37",0x1DDB],
- ["8135EA38",0x1DDC],
- ["8135EA39",0x1DDD],
- ["8135EB30",0x1DDE],
- ["8135EB31",0x1DDF],
- ["8135EB32",0x1DE0],
- ["8135EB33",0x1DE1],
- ["8135EB34",0x1DE2],
- ["8135EB35",0x1DE3],
- ["8135EB36",0x1DE4],
- ["8135EB37",0x1DE5],
- ["8135EB38",0x1DE6],
- ["8135EB39",0x1DE7],
- ["8135EC30",0x1DE8],
- ["8135EC31",0x1DE9],
- ["8135EC32",0x1DEA],
- ["8135EC33",0x1DEB],
- ["8135EC34",0x1DEC],
- ["8135EC35",0x1DED],
- ["8135EC36",0x1DEE],
- ["8135EC37",0x1DEF],
- ["8135EC38",0x1DF0],
- ["8135EC39",0x1DF1],
- ["8135ED30",0x1DF2],
- ["8135ED31",0x1DF3],
- ["8135ED32",0x1DF4],
- ["8135ED33",0x1DF5],
- ["8135ED34",0x1DF6],
- ["8135ED35",0x1DF7],
- ["8135ED36",0x1DF8],
- ["8135ED37",0x1DF9],
- ["8135ED38",0x1DFA],
- ["8135ED39",0x1DFB],
- ["8135EE30",0x1DFC],
- ["8135EE31",0x1DFD],
- ["8135EE32",0x1DFE],
- ["8135EE33",0x1DFF],
- ["8135EE34",0x1E00],
- ["8135EE35",0x1E01],
- ["8135EE36",0x1E02],
- ["8135EE37",0x1E03],
- ["8135EE38",0x1E04],
- ["8135EE39",0x1E05],
- ["8135EF30",0x1E06],
- ["8135EF31",0x1E07],
- ["8135EF32",0x1E08],
- ["8135EF33",0x1E09],
- ["8135EF34",0x1E0A],
- ["8135EF35",0x1E0B],
- ["8135EF36",0x1E0C],
- ["8135EF37",0x1E0D],
- ["8135EF38",0x1E0E],
- ["8135EF39",0x1E0F],
- ["8135F030",0x1E10],
- ["8135F031",0x1E11],
- ["8135F032",0x1E12],
- ["8135F033",0x1E13],
- ["8135F034",0x1E14],
- ["8135F035",0x1E15],
- ["8135F036",0x1E16],
- ["8135F037",0x1E17],
- ["8135F038",0x1E18],
- ["8135F039",0x1E19],
- ["8135F130",0x1E1A],
- ["8135F131",0x1E1B],
- ["8135F132",0x1E1C],
- ["8135F133",0x1E1D],
- ["8135F134",0x1E1E],
- ["8135F135",0x1E1F],
- ["8135F136",0x1E20],
- ["8135F137",0x1E21],
- ["8135F138",0x1E22],
- ["8135F139",0x1E23],
- ["8135F230",0x1E24],
- ["8135F231",0x1E25],
- ["8135F232",0x1E26],
- ["8135F233",0x1E27],
- ["8135F234",0x1E28],
- ["8135F235",0x1E29],
- ["8135F236",0x1E2A],
- ["8135F237",0x1E2B],
- ["8135F238",0x1E2C],
- ["8135F239",0x1E2D],
- ["8135F330",0x1E2E],
- ["8135F331",0x1E2F],
- ["8135F332",0x1E30],
- ["8135F333",0x1E31],
- ["8135F334",0x1E32],
- ["8135F335",0x1E33],
- ["8135F336",0x1E34],
- ["8135F337",0x1E35],
- ["8135F338",0x1E36],
- ["8135F339",0x1E37],
- ["8135F430",0x1E38],
- ["8135F431",0x1E39],
- ["8135F432",0x1E3A],
- ["8135F433",0x1E3B],
- ["8135F434",0x1E3C],
- ["8135F435",0x1E3D],
- ["8135F436",0x1E3E],
- ["8135F437",0x1E3F],
- ["8135F438",0x1E40],
- ["8135F439",0x1E41],
- ["8135F530",0x1E42],
- ["8135F531",0x1E43],
- ["8135F532",0x1E44],
- ["8135F533",0x1E45],
- ["8135F534",0x1E46],
- ["8135F535",0x1E47],
- ["8135F536",0x1E48],
- ["8135F537",0x1E49],
- ["8135F538",0x1E4A],
- ["8135F539",0x1E4B],
- ["8135F630",0x1E4C],
- ["8135F631",0x1E4D],
- ["8135F632",0x1E4E],
- ["8135F633",0x1E4F],
- ["8135F634",0x1E50],
- ["8135F635",0x1E51],
- ["8135F636",0x1E52],
- ["8135F637",0x1E53],
- ["8135F638",0x1E54],
- ["8135F639",0x1E55],
- ["8135F730",0x1E56],
- ["8135F731",0x1E57],
- ["8135F732",0x1E58],
- ["8135F733",0x1E59],
- ["8135F734",0x1E5A],
- ["8135F735",0x1E5B],
- ["8135F736",0x1E5C],
- ["8135F737",0x1E5D],
- ["8135F738",0x1E5E],
- ["8135F739",0x1E5F],
- ["8135F830",0x1E60],
- ["8135F831",0x1E61],
- ["8135F832",0x1E62],
- ["8135F833",0x1E63],
- ["8135F834",0x1E64],
- ["8135F835",0x1E65],
- ["8135F836",0x1E66],
- ["8135F837",0x1E67],
- ["8135F838",0x1E68],
- ["8135F839",0x1E69],
- ["8135F930",0x1E6A],
- ["8135F931",0x1E6B],
- ["8135F932",0x1E6C],
- ["8135F933",0x1E6D],
- ["8135F934",0x1E6E],
- ["8135F935",0x1E6F],
- ["8135F936",0x1E70],
- ["8135F937",0x1E71],
- ["8135F938",0x1E72],
- ["8135F939",0x1E73],
- ["8135FA30",0x1E74],
- ["8135FA31",0x1E75],
- ["8135FA32",0x1E76],
- ["8135FA33",0x1E77],
- ["8135FA34",0x1E78],
- ["8135FA35",0x1E79],
- ["8135FA36",0x1E7A],
- ["8135FA37",0x1E7B],
- ["8135FA38",0x1E7C],
- ["8135FA39",0x1E7D],
- ["8135FB30",0x1E7E],
- ["8135FB31",0x1E7F],
- ["8135FB32",0x1E80],
- ["8135FB33",0x1E81],
- ["8135FB34",0x1E82],
- ["8135FB35",0x1E83],
- ["8135FB36",0x1E84],
- ["8135FB37",0x1E85],
- ["8135FB38",0x1E86],
- ["8135FB39",0x1E87],
- ["8135FC30",0x1E88],
- ["8135FC31",0x1E89],
- ["8135FC32",0x1E8A],
- ["8135FC33",0x1E8B],
- ["8135FC34",0x1E8C],
- ["8135FC35",0x1E8D],
- ["8135FC36",0x1E8E],
- ["8135FC37",0x1E8F],
- ["8135FC38",0x1E90],
- ["8135FC39",0x1E91],
- ["8135FD30",0x1E92],
- ["8135FD31",0x1E93],
- ["8135FD32",0x1E94],
- ["8135FD33",0x1E95],
- ["8135FD34",0x1E96],
- ["8135FD35",0x1E97],
- ["8135FD36",0x1E98],
- ["8135FD37",0x1E99],
- ["8135FD38",0x1E9A],
- ["8135FD39",0x1E9B],
- ["8135FE30",0x1E9C],
- ["8135FE31",0x1E9D],
- ["8135FE32",0x1E9E],
- ["8135FE33",0x1E9F],
- ["8135FE34",0x1EA0],
- ["8135FE35",0x1EA1],
- ["8135FE36",0x1EA2],
- ["8135FE37",0x1EA3],
- ["8135FE38",0x1EA4],
- ["8135FE39",0x1EA5],
- ["81368130",0x1EA6],
- ["81368131",0x1EA7],
- ["81368132",0x1EA8],
- ["81368133",0x1EA9],
- ["81368134",0x1EAA],
- ["81368135",0x1EAB],
- ["81368136",0x1EAC],
- ["81368137",0x1EAD],
- ["81368138",0x1EAE],
- ["81368139",0x1EAF],
- ["81368230",0x1EB0],
- ["81368231",0x1EB1],
- ["81368232",0x1EB2],
- ["81368233",0x1EB3],
- ["81368234",0x1EB4],
- ["81368235",0x1EB5],
- ["81368236",0x1EB6],
- ["81368237",0x1EB7],
- ["81368238",0x1EB8],
- ["81368239",0x1EB9],
- ["81368330",0x1EBA],
- ["81368331",0x1EBB],
- ["81368332",0x1EBC],
- ["81368333",0x1EBD],
- ["81368334",0x1EBE],
- ["81368335",0x1EBF],
- ["81368336",0x1EC0],
- ["81368337",0x1EC1],
- ["81368338",0x1EC2],
- ["81368339",0x1EC3],
- ["81368430",0x1EC4],
- ["81368431",0x1EC5],
- ["81368432",0x1EC6],
- ["81368433",0x1EC7],
- ["81368434",0x1EC8],
- ["81368435",0x1EC9],
- ["81368436",0x1ECA],
- ["81368437",0x1ECB],
- ["81368438",0x1ECC],
- ["81368439",0x1ECD],
- ["81368530",0x1ECE],
- ["81368531",0x1ECF],
- ["81368532",0x1ED0],
- ["81368533",0x1ED1],
- ["81368534",0x1ED2],
- ["81368535",0x1ED3],
- ["81368536",0x1ED4],
- ["81368537",0x1ED5],
- ["81368538",0x1ED6],
- ["81368539",0x1ED7],
- ["81368630",0x1ED8],
- ["81368631",0x1ED9],
- ["81368632",0x1EDA],
- ["81368633",0x1EDB],
- ["81368634",0x1EDC],
- ["81368635",0x1EDD],
- ["81368636",0x1EDE],
- ["81368637",0x1EDF],
- ["81368638",0x1EE0],
- ["81368639",0x1EE1],
- ["81368730",0x1EE2],
- ["81368731",0x1EE3],
- ["81368732",0x1EE4],
- ["81368733",0x1EE5],
- ["81368734",0x1EE6],
- ["81368735",0x1EE7],
- ["81368736",0x1EE8],
- ["81368737",0x1EE9],
- ["81368738",0x1EEA],
- ["81368739",0x1EEB],
- ["81368830",0x1EEC],
- ["81368831",0x1EED],
- ["81368832",0x1EEE],
- ["81368833",0x1EEF],
- ["81368834",0x1EF0],
- ["81368835",0x1EF1],
- ["81368836",0x1EF2],
- ["81368837",0x1EF3],
- ["81368838",0x1EF4],
- ["81368839",0x1EF5],
- ["81368930",0x1EF6],
- ["81368931",0x1EF7],
- ["81368932",0x1EF8],
- ["81368933",0x1EF9],
- ["81368934",0x1EFA],
- ["81368935",0x1EFB],
- ["81368936",0x1EFC],
- ["81368937",0x1EFD],
- ["81368938",0x1EFE],
- ["81368939",0x1EFF],
- ["81368A30",0x1F00],
- ["81368A31",0x1F01],
- ["81368A32",0x1F02],
- ["81368A33",0x1F03],
- ["81368A34",0x1F04],
- ["81368A35",0x1F05],
- ["81368A36",0x1F06],
- ["81368A37",0x1F07],
- ["81368A38",0x1F08],
- ["81368A39",0x1F09],
- ["81368B30",0x1F0A],
- ["81368B31",0x1F0B],
- ["81368B32",0x1F0C],
- ["81368B33",0x1F0D],
- ["81368B34",0x1F0E],
- ["81368B35",0x1F0F],
- ["81368B36",0x1F10],
- ["81368B37",0x1F11],
- ["81368B38",0x1F12],
- ["81368B39",0x1F13],
- ["81368C30",0x1F14],
- ["81368C31",0x1F15],
- ["81368C32",0x1F16],
- ["81368C33",0x1F17],
- ["81368C34",0x1F18],
- ["81368C35",0x1F19],
- ["81368C36",0x1F1A],
- ["81368C37",0x1F1B],
- ["81368C38",0x1F1C],
- ["81368C39",0x1F1D],
- ["81368D30",0x1F1E],
- ["81368D31",0x1F1F],
- ["81368D32",0x1F20],
- ["81368D33",0x1F21],
- ["81368D34",0x1F22],
- ["81368D35",0x1F23],
- ["81368D36",0x1F24],
- ["81368D37",0x1F25],
- ["81368D38",0x1F26],
- ["81368D39",0x1F27],
- ["81368E30",0x1F28],
- ["81368E31",0x1F29],
- ["81368E32",0x1F2A],
- ["81368E33",0x1F2B],
- ["81368E34",0x1F2C],
- ["81368E35",0x1F2D],
- ["81368E36",0x1F2E],
- ["81368E37",0x1F2F],
- ["81368E38",0x1F30],
- ["81368E39",0x1F31],
- ["81368F30",0x1F32],
- ["81368F31",0x1F33],
- ["81368F32",0x1F34],
- ["81368F33",0x1F35],
- ["81368F34",0x1F36],
- ["81368F35",0x1F37],
- ["81368F36",0x1F38],
- ["81368F37",0x1F39],
- ["81368F38",0x1F3A],
- ["81368F39",0x1F3B],
- ["81369030",0x1F3C],
- ["81369031",0x1F3D],
- ["81369032",0x1F3E],
- ["81369033",0x1F3F],
- ["81369034",0x1F40],
- ["81369035",0x1F41],
- ["81369036",0x1F42],
- ["81369037",0x1F43],
- ["81369038",0x1F44],
- ["81369039",0x1F45],
- ["81369130",0x1F46],
- ["81369131",0x1F47],
- ["81369132",0x1F48],
- ["81369133",0x1F49],
- ["81369134",0x1F4A],
- ["81369135",0x1F4B],
- ["81369136",0x1F4C],
- ["81369137",0x1F4D],
- ["81369138",0x1F4E],
- ["81369139",0x1F4F],
- ["81369230",0x1F50],
- ["81369231",0x1F51],
- ["81369232",0x1F52],
- ["81369233",0x1F53],
- ["81369234",0x1F54],
- ["81369235",0x1F55],
- ["81369236",0x1F56],
- ["81369237",0x1F57],
- ["81369238",0x1F58],
- ["81369239",0x1F59],
- ["81369330",0x1F5A],
- ["81369331",0x1F5B],
- ["81369332",0x1F5C],
- ["81369333",0x1F5D],
- ["81369334",0x1F5E],
- ["81369335",0x1F5F],
- ["81369336",0x1F60],
- ["81369337",0x1F61],
- ["81369338",0x1F62],
- ["81369339",0x1F63],
- ["81369430",0x1F64],
- ["81369431",0x1F65],
- ["81369432",0x1F66],
- ["81369433",0x1F67],
- ["81369434",0x1F68],
- ["81369435",0x1F69],
- ["81369436",0x1F6A],
- ["81369437",0x1F6B],
- ["81369438",0x1F6C],
- ["81369439",0x1F6D],
- ["81369530",0x1F6E],
- ["81369531",0x1F6F],
- ["81369532",0x1F70],
- ["81369533",0x1F71],
- ["81369534",0x1F72],
- ["81369535",0x1F73],
- ["81369536",0x1F74],
- ["81369537",0x1F75],
- ["81369538",0x1F76],
- ["81369539",0x1F77],
- ["81369630",0x1F78],
- ["81369631",0x1F79],
- ["81369632",0x1F7A],
- ["81369633",0x1F7B],
- ["81369634",0x1F7C],
- ["81369635",0x1F7D],
- ["81369636",0x1F7E],
- ["81369637",0x1F7F],
- ["81369638",0x1F80],
- ["81369639",0x1F81],
- ["81369730",0x1F82],
- ["81369731",0x1F83],
- ["81369732",0x1F84],
- ["81369733",0x1F85],
- ["81369734",0x1F86],
- ["81369735",0x1F87],
- ["81369736",0x1F88],
- ["81369737",0x1F89],
- ["81369738",0x1F8A],
- ["81369739",0x1F8B],
- ["81369830",0x1F8C],
- ["81369831",0x1F8D],
- ["81369832",0x1F8E],
- ["81369833",0x1F8F],
- ["81369834",0x1F90],
- ["81369835",0x1F91],
- ["81369836",0x1F92],
- ["81369837",0x1F93],
- ["81369838",0x1F94],
- ["81369839",0x1F95],
- ["81369930",0x1F96],
- ["81369931",0x1F97],
- ["81369932",0x1F98],
- ["81369933",0x1F99],
- ["81369934",0x1F9A],
- ["81369935",0x1F9B],
- ["81369936",0x1F9C],
- ["81369937",0x1F9D],
- ["81369938",0x1F9E],
- ["81369939",0x1F9F],
- ["81369A30",0x1FA0],
- ["81369A31",0x1FA1],
- ["81369A32",0x1FA2],
- ["81369A33",0x1FA3],
- ["81369A34",0x1FA4],
- ["81369A35",0x1FA5],
- ["81369A36",0x1FA6],
- ["81369A37",0x1FA7],
- ["81369A38",0x1FA8],
- ["81369A39",0x1FA9],
- ["81369B30",0x1FAA],
- ["81369B31",0x1FAB],
- ["81369B32",0x1FAC],
- ["81369B33",0x1FAD],
- ["81369B34",0x1FAE],
- ["81369B35",0x1FAF],
- ["81369B36",0x1FB0],
- ["81369B37",0x1FB1],
- ["81369B38",0x1FB2],
- ["81369B39",0x1FB3],
- ["81369C30",0x1FB4],
- ["81369C31",0x1FB5],
- ["81369C32",0x1FB6],
- ["81369C33",0x1FB7],
- ["81369C34",0x1FB8],
- ["81369C35",0x1FB9],
- ["81369C36",0x1FBA],
- ["81369C37",0x1FBB],
- ["81369C38",0x1FBC],
- ["81369C39",0x1FBD],
- ["81369D30",0x1FBE],
- ["81369D31",0x1FBF],
- ["81369D32",0x1FC0],
- ["81369D33",0x1FC1],
- ["81369D34",0x1FC2],
- ["81369D35",0x1FC3],
- ["81369D36",0x1FC4],
- ["81369D37",0x1FC5],
- ["81369D38",0x1FC6],
- ["81369D39",0x1FC7],
- ["81369E30",0x1FC8],
- ["81369E31",0x1FC9],
- ["81369E32",0x1FCA],
- ["81369E33",0x1FCB],
- ["81369E34",0x1FCC],
- ["81369E35",0x1FCD],
- ["81369E36",0x1FCE],
- ["81369E37",0x1FCF],
- ["81369E38",0x1FD0],
- ["81369E39",0x1FD1],
- ["81369F30",0x1FD2],
- ["81369F31",0x1FD3],
- ["81369F32",0x1FD4],
- ["81369F33",0x1FD5],
- ["81369F34",0x1FD6],
- ["81369F35",0x1FD7],
- ["81369F36",0x1FD8],
- ["81369F37",0x1FD9],
- ["81369F38",0x1FDA],
- ["81369F39",0x1FDB],
- ["8136A030",0x1FDC],
- ["8136A031",0x1FDD],
- ["8136A032",0x1FDE],
- ["8136A033",0x1FDF],
- ["8136A034",0x1FE0],
- ["8136A035",0x1FE1],
- ["8136A036",0x1FE2],
- ["8136A037",0x1FE3],
- ["8136A038",0x1FE4],
- ["8136A039",0x1FE5],
- ["8136A130",0x1FE6],
- ["8136A131",0x1FE7],
- ["8136A132",0x1FE8],
- ["8136A133",0x1FE9],
- ["8136A134",0x1FEA],
- ["8136A135",0x1FEB],
- ["8136A136",0x1FEC],
- ["8136A137",0x1FED],
- ["8136A138",0x1FEE],
- ["8136A139",0x1FEF],
- ["8136A230",0x1FF0],
- ["8136A231",0x1FF1],
- ["8136A232",0x1FF2],
- ["8136A233",0x1FF3],
- ["8136A234",0x1FF4],
- ["8136A235",0x1FF5],
- ["8136A236",0x1FF6],
- ["8136A237",0x1FF7],
- ["8136A238",0x1FF8],
- ["8136A239",0x1FF9],
- ["8136A330",0x1FFA],
- ["8136A331",0x1FFB],
- ["8136A332",0x1FFC],
- ["8136A333",0x1FFD],
- ["8136A334",0x1FFE],
- ["8136A335",0x1FFF],
- ["8136A336",0x2000],
- ["8136A337",0x2001],
- ["8136A338",0x2002],
- ["8136A339",0x2003],
- ["8136A430",0x2004],
- ["8136A431",0x2005],
- ["8136A432",0x2006],
- ["8136A433",0x2007],
- ["8136A434",0x2008],
- ["8136A435",0x2009],
- ["8136A436",0x200A],
- ["8136A437",0x200B],
- ["8136A438",0x200C],
- ["8136A439",0x200D],
- ["8136A530",0x200E],
- ["8136A531",0x200F],
- ["A95C",0x2010],
- ["8136A532",0x2011],
- ["8136A533",0x2012],
- ["A843",0x2013],
- ["A1AA",0x2014],
- ["A844",0x2015],
- ["A1AC",0x2016],
- ["8136A534",0x2017],
- ["A1AE",0x2018],
- ["A1AF",0x2019],
- ["8136A535",0x201A],
- ["8136A536",0x201B],
- ["A1B0",0x201C],
- ["A1B1",0x201D],
- ["8136A537",0x201E],
- ["8136A538",0x201F],
- ["8136A539",0x2020],
- ["8136A630",0x2021],
- ["8136A631",0x2022],
- ["8136A632",0x2023],
- ["8136A633",0x2024],
- ["A845",0x2025],
- ["A1AD",0x2026],
- ["8136A634",0x2027],
- ["8136A635",0x2028],
- ["8136A636",0x2029],
- ["8136A637",0x202A],
- ["8136A638",0x202B],
- ["8136A639",0x202C],
- ["8136A730",0x202D],
- ["8136A731",0x202E],
- ["8136A732",0x202F],
- ["A1EB",0x2030],
- ["8136A733",0x2031],
- ["A1E4",0x2032],
- ["A1E5",0x2033],
- ["8136A734",0x2034],
- ["A846",0x2035],
- ["8136A735",0x2036],
- ["8136A736",0x2037],
- ["8136A737",0x2038],
- ["8136A738",0x2039],
- ["8136A739",0x203A],
- ["A1F9",0x203B],
- ["8136A830",0x203C],
- ["8136A831",0x203D],
- ["8136A832",0x203E],
- ["8136A833",0x203F],
- ["8136A834",0x2040],
- ["8136A835",0x2041],
- ["8136A836",0x2042],
- ["8136A837",0x2043],
- ["8136A838",0x2044],
- ["8136A839",0x2045],
- ["8136A930",0x2046],
- ["8136A931",0x2047],
- ["8136A932",0x2048],
- ["8136A933",0x2049],
- ["8136A934",0x204A],
- ["8136A935",0x204B],
- ["8136A936",0x204C],
- ["8136A937",0x204D],
- ["8136A938",0x204E],
- ["8136A939",0x204F],
- ["8136AA30",0x2050],
- ["8136AA31",0x2051],
- ["8136AA32",0x2052],
- ["8136AA33",0x2053],
- ["8136AA34",0x2054],
- ["8136AA35",0x2055],
- ["8136AA36",0x2056],
- ["8136AA37",0x2057],
- ["8136AA38",0x2058],
- ["8136AA39",0x2059],
- ["8136AB30",0x205A],
- ["8136AB31",0x205B],
- ["8136AB32",0x205C],
- ["8136AB33",0x205D],
- ["8136AB34",0x205E],
- ["8136AB35",0x205F],
- ["8136AB36",0x2060],
- ["8136AB37",0x2061],
- ["8136AB38",0x2062],
- ["8136AB39",0x2063],
- ["8136AC30",0x2064],
- ["8136AC31",0x2065],
- ["8136AC32",0x2066],
- ["8136AC33",0x2067],
- ["8136AC34",0x2068],
- ["8136AC35",0x2069],
- ["8136AC36",0x206A],
- ["8136AC37",0x206B],
- ["8136AC38",0x206C],
- ["8136AC39",0x206D],
- ["8136AD30",0x206E],
- ["8136AD31",0x206F],
- ["8136AD32",0x2070],
- ["8136AD33",0x2071],
- ["8136AD34",0x2072],
- ["8136AD35",0x2073],
- ["8136AD36",0x2074],
- ["8136AD37",0x2075],
- ["8136AD38",0x2076],
- ["8136AD39",0x2077],
- ["8136AE30",0x2078],
- ["8136AE31",0x2079],
- ["8136AE32",0x207A],
- ["8136AE33",0x207B],
- ["8136AE34",0x207C],
- ["8136AE35",0x207D],
- ["8136AE36",0x207E],
- ["8136AE37",0x207F],
- ["8136AE38",0x2080],
- ["8136AE39",0x2081],
- ["8136AF30",0x2082],
- ["8136AF31",0x2083],
- ["8136AF32",0x2084],
- ["8136AF33",0x2085],
- ["8136AF34",0x2086],
- ["8136AF35",0x2087],
- ["8136AF36",0x2088],
- ["8136AF37",0x2089],
- ["8136AF38",0x208A],
- ["8136AF39",0x208B],
- ["8136B030",0x208C],
- ["8136B031",0x208D],
- ["8136B032",0x208E],
- ["8136B033",0x208F],
- ["8136B034",0x2090],
- ["8136B035",0x2091],
- ["8136B036",0x2092],
- ["8136B037",0x2093],
- ["8136B038",0x2094],
- ["8136B039",0x2095],
- ["8136B130",0x2096],
- ["8136B131",0x2097],
- ["8136B132",0x2098],
- ["8136B133",0x2099],
- ["8136B134",0x209A],
- ["8136B135",0x209B],
- ["8136B136",0x209C],
- ["8136B137",0x209D],
- ["8136B138",0x209E],
- ["8136B139",0x209F],
- ["8136B230",0x20A0],
- ["8136B231",0x20A1],
- ["8136B232",0x20A2],
- ["8136B233",0x20A3],
- ["8136B234",0x20A4],
- ["8136B235",0x20A5],
- ["8136B236",0x20A6],
- ["8136B237",0x20A7],
- ["8136B238",0x20A8],
- ["8136B239",0x20A9],
- ["8136B330",0x20AA],
- ["8136B331",0x20AB],
- ["A2E3",0x20AC],
- ["8136B332",0x20AD],
- ["8136B333",0x20AE],
- ["8136B334",0x20AF],
- ["8136B335",0x20B0],
- ["8136B336",0x20B1],
- ["8136B337",0x20B2],
- ["8136B338",0x20B3],
- ["8136B339",0x20B4],
- ["8136B430",0x20B5],
- ["8136B431",0x20B6],
- ["8136B432",0x20B7],
- ["8136B433",0x20B8],
- ["8136B434",0x20B9],
- ["8136B435",0x20BA],
- ["8136B436",0x20BB],
- ["8136B437",0x20BC],
- ["8136B438",0x20BD],
- ["8136B439",0x20BE],
- ["8136B530",0x20BF],
- ["8136B531",0x20C0],
- ["8136B532",0x20C1],
- ["8136B533",0x20C2],
- ["8136B534",0x20C3],
- ["8136B535",0x20C4],
- ["8136B536",0x20C5],
- ["8136B537",0x20C6],
- ["8136B538",0x20C7],
- ["8136B539",0x20C8],
- ["8136B630",0x20C9],
- ["8136B631",0x20CA],
- ["8136B632",0x20CB],
- ["8136B633",0x20CC],
- ["8136B634",0x20CD],
- ["8136B635",0x20CE],
- ["8136B636",0x20CF],
- ["8136B637",0x20D0],
- ["8136B638",0x20D1],
- ["8136B639",0x20D2],
- ["8136B730",0x20D3],
- ["8136B731",0x20D4],
- ["8136B732",0x20D5],
- ["8136B733",0x20D6],
- ["8136B734",0x20D7],
- ["8136B735",0x20D8],
- ["8136B736",0x20D9],
- ["8136B737",0x20DA],
- ["8136B738",0x20DB],
- ["8136B739",0x20DC],
- ["8136B830",0x20DD],
- ["8136B831",0x20DE],
- ["8136B832",0x20DF],
- ["8136B833",0x20E0],
- ["8136B834",0x20E1],
- ["8136B835",0x20E2],
- ["8136B836",0x20E3],
- ["8136B837",0x20E4],
- ["8136B838",0x20E5],
- ["8136B839",0x20E6],
- ["8136B930",0x20E7],
- ["8136B931",0x20E8],
- ["8136B932",0x20E9],
- ["8136B933",0x20EA],
- ["8136B934",0x20EB],
- ["8136B935",0x20EC],
- ["8136B936",0x20ED],
- ["8136B937",0x20EE],
- ["8136B938",0x20EF],
- ["8136B939",0x20F0],
- ["8136BA30",0x20F1],
- ["8136BA31",0x20F2],
- ["8136BA32",0x20F3],
- ["8136BA33",0x20F4],
- ["8136BA34",0x20F5],
- ["8136BA35",0x20F6],
- ["8136BA36",0x20F7],
- ["8136BA37",0x20F8],
- ["8136BA38",0x20F9],
- ["8136BA39",0x20FA],
- ["8136BB30",0x20FB],
- ["8136BB31",0x20FC],
- ["8136BB32",0x20FD],
- ["8136BB33",0x20FE],
- ["8136BB34",0x20FF],
- ["8136BB35",0x2100],
- ["8136BB36",0x2101],
- ["8136BB37",0x2102],
- ["A1E6",0x2103],
- ["8136BB38",0x2104],
- ["A847",0x2105],
- ["8136BB39",0x2106],
- ["8136BC30",0x2107],
- ["8136BC31",0x2108],
- ["A848",0x2109],
- ["8136BC32",0x210A],
- ["8136BC33",0x210B],
- ["8136BC34",0x210C],
- ["8136BC35",0x210D],
- ["8136BC36",0x210E],
- ["8136BC37",0x210F],
- ["8136BC38",0x2110],
- ["8136BC39",0x2111],
- ["8136BD30",0x2112],
- ["8136BD31",0x2113],
- ["8136BD32",0x2114],
- ["8136BD33",0x2115],
- ["A1ED",0x2116],
- ["8136BD34",0x2117],
- ["8136BD35",0x2118],
- ["8136BD36",0x2119],
- ["8136BD37",0x211A],
- ["8136BD38",0x211B],
- ["8136BD39",0x211C],
- ["8136BE30",0x211D],
- ["8136BE31",0x211E],
- ["8136BE32",0x211F],
- ["8136BE33",0x2120],
- ["A959",0x2121],
- ["8136BE34",0x2122],
- ["8136BE35",0x2123],
- ["8136BE36",0x2124],
- ["8136BE37",0x2125],
- ["8136BE38",0x2126],
- ["8136BE39",0x2127],
- ["8136BF30",0x2128],
- ["8136BF31",0x2129],
- ["8136BF32",0x212A],
- ["8136BF33",0x212B],
- ["8136BF34",0x212C],
- ["8136BF35",0x212D],
- ["8136BF36",0x212E],
- ["8136BF37",0x212F],
- ["8136BF38",0x2130],
- ["8136BF39",0x2131],
- ["8136C030",0x2132],
- ["8136C031",0x2133],
- ["8136C032",0x2134],
- ["8136C033",0x2135],
- ["8136C034",0x2136],
- ["8136C035",0x2137],
- ["8136C036",0x2138],
- ["8136C037",0x2139],
- ["8136C038",0x213A],
- ["8136C039",0x213B],
- ["8136C130",0x213C],
- ["8136C131",0x213D],
- ["8136C132",0x213E],
- ["8136C133",0x213F],
- ["8136C134",0x2140],
- ["8136C135",0x2141],
- ["8136C136",0x2142],
- ["8136C137",0x2143],
- ["8136C138",0x2144],
- ["8136C139",0x2145],
- ["8136C230",0x2146],
- ["8136C231",0x2147],
- ["8136C232",0x2148],
- ["8136C233",0x2149],
- ["8136C234",0x214A],
- ["8136C235",0x214B],
- ["8136C236",0x214C],
- ["8136C237",0x214D],
- ["8136C238",0x214E],
- ["8136C239",0x214F],
- ["8136C330",0x2150],
- ["8136C331",0x2151],
- ["8136C332",0x2152],
- ["8136C333",0x2153],
- ["8136C334",0x2154],
- ["8136C335",0x2155],
- ["8136C336",0x2156],
- ["8136C337",0x2157],
- ["8136C338",0x2158],
- ["8136C339",0x2159],
- ["8136C430",0x215A],
- ["8136C431",0x215B],
- ["8136C432",0x215C],
- ["8136C433",0x215D],
- ["8136C434",0x215E],
- ["8136C435",0x215F],
- ["A2F1",0x2160],
- ["A2F2",0x2161],
- ["A2F3",0x2162],
- ["A2F4",0x2163],
- ["A2F5",0x2164],
- ["A2F6",0x2165],
- ["A2F7",0x2166],
- ["A2F8",0x2167],
- ["A2F9",0x2168],
- ["A2FA",0x2169],
- ["A2FB",0x216A],
- ["A2FC",0x216B],
- ["8136C436",0x216C],
- ["8136C437",0x216D],
- ["8136C438",0x216E],
- ["8136C439",0x216F],
- ["A2A1",0x2170],
- ["A2A2",0x2171],
- ["A2A3",0x2172],
- ["A2A4",0x2173],
- ["A2A5",0x2174],
- ["A2A6",0x2175],
- ["A2A7",0x2176],
- ["A2A8",0x2177],
- ["A2A9",0x2178],
- ["A2AA",0x2179],
- ["8136C530",0x217A],
- ["8136C531",0x217B],
- ["8136C532",0x217C],
- ["8136C533",0x217D],
- ["8136C534",0x217E],
- ["8136C535",0x217F],
- ["8136C536",0x2180],
- ["8136C537",0x2181],
- ["8136C538",0x2182],
- ["8136C539",0x2183],
- ["8136C630",0x2184],
- ["8136C631",0x2185],
- ["8136C632",0x2186],
- ["8136C633",0x2187],
- ["8136C634",0x2188],
- ["8136C635",0x2189],
- ["8136C636",0x218A],
- ["8136C637",0x218B],
- ["8136C638",0x218C],
- ["8136C639",0x218D],
- ["8136C730",0x218E],
- ["8136C731",0x218F],
- ["A1FB",0x2190],
- ["A1FC",0x2191],
- ["A1FA",0x2192],
- ["A1FD",0x2193],
- ["8136C732",0x2194],
- ["8136C733",0x2195],
- ["A849",0x2196],
- ["A84A",0x2197],
- ["A84B",0x2198],
- ["A84C",0x2199],
- ["8136C734",0x219A],
- ["8136C735",0x219B],
- ["8136C736",0x219C],
- ["8136C737",0x219D],
- ["8136C738",0x219E],
- ["8136C739",0x219F],
- ["8136C830",0x21A0],
- ["8136C831",0x21A1],
- ["8136C832",0x21A2],
- ["8136C833",0x21A3],
- ["8136C834",0x21A4],
- ["8136C835",0x21A5],
- ["8136C836",0x21A6],
- ["8136C837",0x21A7],
- ["8136C838",0x21A8],
- ["8136C839",0x21A9],
- ["8136C930",0x21AA],
- ["8136C931",0x21AB],
- ["8136C932",0x21AC],
- ["8136C933",0x21AD],
- ["8136C934",0x21AE],
- ["8136C935",0x21AF],
- ["8136C936",0x21B0],
- ["8136C937",0x21B1],
- ["8136C938",0x21B2],
- ["8136C939",0x21B3],
- ["8136CA30",0x21B4],
- ["8136CA31",0x21B5],
- ["8136CA32",0x21B6],
- ["8136CA33",0x21B7],
- ["8136CA34",0x21B8],
- ["8136CA35",0x21B9],
- ["8136CA36",0x21BA],
- ["8136CA37",0x21BB],
- ["8136CA38",0x21BC],
- ["8136CA39",0x21BD],
- ["8136CB30",0x21BE],
- ["8136CB31",0x21BF],
- ["8136CB32",0x21C0],
- ["8136CB33",0x21C1],
- ["8136CB34",0x21C2],
- ["8136CB35",0x21C3],
- ["8136CB36",0x21C4],
- ["8136CB37",0x21C5],
- ["8136CB38",0x21C6],
- ["8136CB39",0x21C7],
- ["8136CC30",0x21C8],
- ["8136CC31",0x21C9],
- ["8136CC32",0x21CA],
- ["8136CC33",0x21CB],
- ["8136CC34",0x21CC],
- ["8136CC35",0x21CD],
- ["8136CC36",0x21CE],
- ["8136CC37",0x21CF],
- ["8136CC38",0x21D0],
- ["8136CC39",0x21D1],
- ["8136CD30",0x21D2],
- ["8136CD31",0x21D3],
- ["8136CD32",0x21D4],
- ["8136CD33",0x21D5],
- ["8136CD34",0x21D6],
- ["8136CD35",0x21D7],
- ["8136CD36",0x21D8],
- ["8136CD37",0x21D9],
- ["8136CD38",0x21DA],
- ["8136CD39",0x21DB],
- ["8136CE30",0x21DC],
- ["8136CE31",0x21DD],
- ["8136CE32",0x21DE],
- ["8136CE33",0x21DF],
- ["8136CE34",0x21E0],
- ["8136CE35",0x21E1],
- ["8136CE36",0x21E2],
- ["8136CE37",0x21E3],
- ["8136CE38",0x21E4],
- ["8136CE39",0x21E5],
- ["8136CF30",0x21E6],
- ["8136CF31",0x21E7],
- ["8136CF32",0x21E8],
- ["8136CF33",0x21E9],
- ["8136CF34",0x21EA],
- ["8136CF35",0x21EB],
- ["8136CF36",0x21EC],
- ["8136CF37",0x21ED],
- ["8136CF38",0x21EE],
- ["8136CF39",0x21EF],
- ["8136D030",0x21F0],
- ["8136D031",0x21F1],
- ["8136D032",0x21F2],
- ["8136D033",0x21F3],
- ["8136D034",0x21F4],
- ["8136D035",0x21F5],
- ["8136D036",0x21F6],
- ["8136D037",0x21F7],
- ["8136D038",0x21F8],
- ["8136D039",0x21F9],
- ["8136D130",0x21FA],
- ["8136D131",0x21FB],
- ["8136D132",0x21FC],
- ["8136D133",0x21FD],
- ["8136D134",0x21FE],
- ["8136D135",0x21FF],
- ["8136D136",0x2200],
- ["8136D137",0x2201],
- ["8136D138",0x2202],
- ["8136D139",0x2203],
- ["8136D230",0x2204],
- ["8136D231",0x2205],
- ["8136D232",0x2206],
- ["8136D233",0x2207],
- ["A1CA",0x2208],
- ["8136D234",0x2209],
- ["8136D235",0x220A],
- ["8136D236",0x220B],
- ["8136D237",0x220C],
- ["8136D238",0x220D],
- ["8136D239",0x220E],
- ["A1C7",0x220F],
- ["8136D330",0x2210],
- ["A1C6",0x2211],
- ["8136D331",0x2212],
- ["8136D332",0x2213],
- ["8136D333",0x2214],
- ["A84D",0x2215],
- ["8136D334",0x2216],
- ["8136D335",0x2217],
- ["8136D336",0x2218],
- ["8136D337",0x2219],
- ["A1CC",0x221A],
- ["8136D338",0x221B],
- ["8136D339",0x221C],
- ["A1D8",0x221D],
- ["A1DE",0x221E],
- ["A84E",0x221F],
- ["A1CF",0x2220],
- ["8136D430",0x2221],
- ["8136D431",0x2222],
- ["A84F",0x2223],
- ["8136D432",0x2224],
- ["A1CE",0x2225],
- ["8136D433",0x2226],
- ["A1C4",0x2227],
- ["A1C5",0x2228],
- ["A1C9",0x2229],
- ["A1C8",0x222A],
- ["A1D2",0x222B],
- ["8136D434",0x222C],
- ["8136D435",0x222D],
- ["A1D3",0x222E],
- ["8136D436",0x222F],
- ["8136D437",0x2230],
- ["8136D438",0x2231],
- ["8136D439",0x2232],
- ["8136D530",0x2233],
- ["A1E0",0x2234],
- ["A1DF",0x2235],
- ["A1C3",0x2236],
- ["A1CB",0x2237],
- ["8136D531",0x2238],
- ["8136D532",0x2239],
- ["8136D533",0x223A],
- ["8136D534",0x223B],
- ["8136D535",0x223C],
- ["A1D7",0x223D],
- ["8136D536",0x223E],
- ["8136D537",0x223F],
- ["8136D538",0x2240],
- ["8136D539",0x2241],
- ["8136D630",0x2242],
- ["8136D631",0x2243],
- ["8136D632",0x2244],
- ["8136D633",0x2245],
- ["8136D634",0x2246],
- ["8136D635",0x2247],
- ["A1D6",0x2248],
- ["8136D636",0x2249],
- ["8136D637",0x224A],
- ["8136D638",0x224B],
- ["A1D5",0x224C],
- ["8136D639",0x224D],
- ["8136D730",0x224E],
- ["8136D731",0x224F],
- ["8136D732",0x2250],
- ["8136D733",0x2251],
- ["A850",0x2252],
- ["8136D734",0x2253],
- ["8136D735",0x2254],
- ["8136D736",0x2255],
- ["8136D737",0x2256],
- ["8136D738",0x2257],
- ["8136D739",0x2258],
- ["8136D830",0x2259],
- ["8136D831",0x225A],
- ["8136D832",0x225B],
- ["8136D833",0x225C],
- ["8136D834",0x225D],
- ["8136D835",0x225E],
- ["8136D836",0x225F],
- ["A1D9",0x2260],
- ["A1D4",0x2261],
- ["8136D837",0x2262],
- ["8136D838",0x2263],
- ["A1DC",0x2264],
- ["A1DD",0x2265],
- ["A851",0x2266],
- ["A852",0x2267],
- ["8136D839",0x2268],
- ["8136D930",0x2269],
- ["8136D931",0x226A],
- ["8136D932",0x226B],
- ["8136D933",0x226C],
- ["8136D934",0x226D],
- ["A1DA",0x226E],
- ["A1DB",0x226F],
- ["8136D935",0x2270],
- ["8136D936",0x2271],
- ["8136D937",0x2272],
- ["8136D938",0x2273],
- ["8136D939",0x2274],
- ["8136DA30",0x2275],
- ["8136DA31",0x2276],
- ["8136DA32",0x2277],
- ["8136DA33",0x2278],
- ["8136DA34",0x2279],
- ["8136DA35",0x227A],
- ["8136DA36",0x227B],
- ["8136DA37",0x227C],
- ["8136DA38",0x227D],
- ["8136DA39",0x227E],
- ["8136DB30",0x227F],
- ["8136DB31",0x2280],
- ["8136DB32",0x2281],
- ["8136DB33",0x2282],
- ["8136DB34",0x2283],
- ["8136DB35",0x2284],
- ["8136DB36",0x2285],
- ["8136DB37",0x2286],
- ["8136DB38",0x2287],
- ["8136DB39",0x2288],
- ["8136DC30",0x2289],
- ["8136DC31",0x228A],
- ["8136DC32",0x228B],
- ["8136DC33",0x228C],
- ["8136DC34",0x228D],
- ["8136DC35",0x228E],
- ["8136DC36",0x228F],
- ["8136DC37",0x2290],
- ["8136DC38",0x2291],
- ["8136DC39",0x2292],
- ["8136DD30",0x2293],
- ["8136DD31",0x2294],
- ["A892",0x2295],
- ["8136DD32",0x2296],
- ["8136DD33",0x2297],
- ["8136DD34",0x2298],
- ["A1D1",0x2299],
- ["8136DD35",0x229A],
- ["8136DD36",0x229B],
- ["8136DD37",0x229C],
- ["8136DD38",0x229D],
- ["8136DD39",0x229E],
- ["8136DE30",0x229F],
- ["8136DE31",0x22A0],
- ["8136DE32",0x22A1],
- ["8136DE33",0x22A2],
- ["8136DE34",0x22A3],
- ["8136DE35",0x22A4],
- ["A1CD",0x22A5],
- ["8136DE36",0x22A6],
- ["8136DE37",0x22A7],
- ["8136DE38",0x22A8],
- ["8136DE39",0x22A9],
- ["8136DF30",0x22AA],
- ["8136DF31",0x22AB],
- ["8136DF32",0x22AC],
- ["8136DF33",0x22AD],
- ["8136DF34",0x22AE],
- ["8136DF35",0x22AF],
- ["8136DF36",0x22B0],
- ["8136DF37",0x22B1],
- ["8136DF38",0x22B2],
- ["8136DF39",0x22B3],
- ["8136E030",0x22B4],
- ["8136E031",0x22B5],
- ["8136E032",0x22B6],
- ["8136E033",0x22B7],
- ["8136E034",0x22B8],
- ["8136E035",0x22B9],
- ["8136E036",0x22BA],
- ["8136E037",0x22BB],
- ["8136E038",0x22BC],
- ["8136E039",0x22BD],
- ["8136E130",0x22BE],
- ["A853",0x22BF],
- ["8136E131",0x22C0],
- ["8136E132",0x22C1],
- ["8136E133",0x22C2],
- ["8136E134",0x22C3],
- ["8136E135",0x22C4],
- ["8136E136",0x22C5],
- ["8136E137",0x22C6],
- ["8136E138",0x22C7],
- ["8136E139",0x22C8],
- ["8136E230",0x22C9],
- ["8136E231",0x22CA],
- ["8136E232",0x22CB],
- ["8136E233",0x22CC],
- ["8136E234",0x22CD],
- ["8136E235",0x22CE],
- ["8136E236",0x22CF],
- ["8136E237",0x22D0],
- ["8136E238",0x22D1],
- ["8136E239",0x22D2],
- ["8136E330",0x22D3],
- ["8136E331",0x22D4],
- ["8136E332",0x22D5],
- ["8136E333",0x22D6],
- ["8136E334",0x22D7],
- ["8136E335",0x22D8],
- ["8136E336",0x22D9],
- ["8136E337",0x22DA],
- ["8136E338",0x22DB],
- ["8136E339",0x22DC],
- ["8136E430",0x22DD],
- ["8136E431",0x22DE],
- ["8136E432",0x22DF],
- ["8136E433",0x22E0],
- ["8136E434",0x22E1],
- ["8136E435",0x22E2],
- ["8136E436",0x22E3],
- ["8136E437",0x22E4],
- ["8136E438",0x22E5],
- ["8136E439",0x22E6],
- ["8136E530",0x22E7],
- ["8136E531",0x22E8],
- ["8136E532",0x22E9],
- ["8136E533",0x22EA],
- ["8136E534",0x22EB],
- ["8136E535",0x22EC],
- ["8136E536",0x22ED],
- ["8136E537",0x22EE],
- ["8136E538",0x22EF],
- ["8136E539",0x22F0],
- ["8136E630",0x22F1],
- ["8136E631",0x22F2],
- ["8136E632",0x22F3],
- ["8136E633",0x22F4],
- ["8136E634",0x22F5],
- ["8136E635",0x22F6],
- ["8136E636",0x22F7],
- ["8136E637",0x22F8],
- ["8136E638",0x22F9],
- ["8136E639",0x22FA],
- ["8136E730",0x22FB],
- ["8136E731",0x22FC],
- ["8136E732",0x22FD],
- ["8136E733",0x22FE],
- ["8136E734",0x22FF],
- ["8136E735",0x2300],
- ["8136E736",0x2301],
- ["8136E737",0x2302],
- ["8136E738",0x2303],
- ["8136E739",0x2304],
- ["8136E830",0x2305],
- ["8136E831",0x2306],
- ["8136E832",0x2307],
- ["8136E833",0x2308],
- ["8136E834",0x2309],
- ["8136E835",0x230A],
- ["8136E836",0x230B],
- ["8136E837",0x230C],
- ["8136E838",0x230D],
- ["8136E839",0x230E],
- ["8136E930",0x230F],
- ["8136E931",0x2310],
- ["8136E932",0x2311],
- ["A1D0",0x2312],
- ["8136E933",0x2313],
- ["8136E934",0x2314],
- ["8136E935",0x2315],
- ["8136E936",0x2316],
- ["8136E937",0x2317],
- ["8136E938",0x2318],
- ["8136E939",0x2319],
- ["8136EA30",0x231A],
- ["8136EA31",0x231B],
- ["8136EA32",0x231C],
- ["8136EA33",0x231D],
- ["8136EA34",0x231E],
- ["8136EA35",0x231F],
- ["8136EA36",0x2320],
- ["8136EA37",0x2321],
- ["8136EA38",0x2322],
- ["8136EA39",0x2323],
- ["8136EB30",0x2324],
- ["8136EB31",0x2325],
- ["8136EB32",0x2326],
- ["8136EB33",0x2327],
- ["8136EB34",0x2328],
- ["8136EB35",0x2329],
- ["8136EB36",0x232A],
- ["8136EB37",0x232B],
- ["8136EB38",0x232C],
- ["8136EB39",0x232D],
- ["8136EC30",0x232E],
- ["8136EC31",0x232F],
- ["8136EC32",0x2330],
- ["8136EC33",0x2331],
- ["8136EC34",0x2332],
- ["8136EC35",0x2333],
- ["8136EC36",0x2334],
- ["8136EC37",0x2335],
- ["8136EC38",0x2336],
- ["8136EC39",0x2337],
- ["8136ED30",0x2338],
- ["8136ED31",0x2339],
- ["8136ED32",0x233A],
- ["8136ED33",0x233B],
- ["8136ED34",0x233C],
- ["8136ED35",0x233D],
- ["8136ED36",0x233E],
- ["8136ED37",0x233F],
- ["8136ED38",0x2340],
- ["8136ED39",0x2341],
- ["8136EE30",0x2342],
- ["8136EE31",0x2343],
- ["8136EE32",0x2344],
- ["8136EE33",0x2345],
- ["8136EE34",0x2346],
- ["8136EE35",0x2347],
- ["8136EE36",0x2348],
- ["8136EE37",0x2349],
- ["8136EE38",0x234A],
- ["8136EE39",0x234B],
- ["8136EF30",0x234C],
- ["8136EF31",0x234D],
- ["8136EF32",0x234E],
- ["8136EF33",0x234F],
- ["8136EF34",0x2350],
- ["8136EF35",0x2351],
- ["8136EF36",0x2352],
- ["8136EF37",0x2353],
- ["8136EF38",0x2354],
- ["8136EF39",0x2355],
- ["8136F030",0x2356],
- ["8136F031",0x2357],
- ["8136F032",0x2358],
- ["8136F033",0x2359],
- ["8136F034",0x235A],
- ["8136F035",0x235B],
- ["8136F036",0x235C],
- ["8136F037",0x235D],
- ["8136F038",0x235E],
- ["8136F039",0x235F],
- ["8136F130",0x2360],
- ["8136F131",0x2361],
- ["8136F132",0x2362],
- ["8136F133",0x2363],
- ["8136F134",0x2364],
- ["8136F135",0x2365],
- ["8136F136",0x2366],
- ["8136F137",0x2367],
- ["8136F138",0x2368],
- ["8136F139",0x2369],
- ["8136F230",0x236A],
- ["8136F231",0x236B],
- ["8136F232",0x236C],
- ["8136F233",0x236D],
- ["8136F234",0x236E],
- ["8136F235",0x236F],
- ["8136F236",0x2370],
- ["8136F237",0x2371],
- ["8136F238",0x2372],
- ["8136F239",0x2373],
- ["8136F330",0x2374],
- ["8136F331",0x2375],
- ["8136F332",0x2376],
- ["8136F333",0x2377],
- ["8136F334",0x2378],
- ["8136F335",0x2379],
- ["8136F336",0x237A],
- ["8136F337",0x237B],
- ["8136F338",0x237C],
- ["8136F339",0x237D],
- ["8136F430",0x237E],
- ["8136F431",0x237F],
- ["8136F432",0x2380],
- ["8136F433",0x2381],
- ["8136F434",0x2382],
- ["8136F435",0x2383],
- ["8136F436",0x2384],
- ["8136F437",0x2385],
- ["8136F438",0x2386],
- ["8136F439",0x2387],
- ["8136F530",0x2388],
- ["8136F531",0x2389],
- ["8136F532",0x238A],
- ["8136F533",0x238B],
- ["8136F534",0x238C],
- ["8136F535",0x238D],
- ["8136F536",0x238E],
- ["8136F537",0x238F],
- ["8136F538",0x2390],
- ["8136F539",0x2391],
- ["8136F630",0x2392],
- ["8136F631",0x2393],
- ["8136F632",0x2394],
- ["8136F633",0x2395],
- ["8136F634",0x2396],
- ["8136F635",0x2397],
- ["8136F636",0x2398],
- ["8136F637",0x2399],
- ["8136F638",0x239A],
- ["8136F639",0x239B],
- ["8136F730",0x239C],
- ["8136F731",0x239D],
- ["8136F732",0x239E],
- ["8136F733",0x239F],
- ["8136F734",0x23A0],
- ["8136F735",0x23A1],
- ["8136F736",0x23A2],
- ["8136F737",0x23A3],
- ["8136F738",0x23A4],
- ["8136F739",0x23A5],
- ["8136F830",0x23A6],
- ["8136F831",0x23A7],
- ["8136F832",0x23A8],
- ["8136F833",0x23A9],
- ["8136F834",0x23AA],
- ["8136F835",0x23AB],
- ["8136F836",0x23AC],
- ["8136F837",0x23AD],
- ["8136F838",0x23AE],
- ["8136F839",0x23AF],
- ["8136F930",0x23B0],
- ["8136F931",0x23B1],
- ["8136F932",0x23B2],
- ["8136F933",0x23B3],
- ["8136F934",0x23B4],
- ["8136F935",0x23B5],
- ["8136F936",0x23B6],
- ["8136F937",0x23B7],
- ["8136F938",0x23B8],
- ["8136F939",0x23B9],
- ["8136FA30",0x23BA],
- ["8136FA31",0x23BB],
- ["8136FA32",0x23BC],
- ["8136FA33",0x23BD],
- ["8136FA34",0x23BE],
- ["8136FA35",0x23BF],
- ["8136FA36",0x23C0],
- ["8136FA37",0x23C1],
- ["8136FA38",0x23C2],
- ["8136FA39",0x23C3],
- ["8136FB30",0x23C4],
- ["8136FB31",0x23C5],
- ["8136FB32",0x23C6],
- ["8136FB33",0x23C7],
- ["8136FB34",0x23C8],
- ["8136FB35",0x23C9],
- ["8136FB36",0x23CA],
- ["8136FB37",0x23CB],
- ["8136FB38",0x23CC],
- ["8136FB39",0x23CD],
- ["8136FC30",0x23CE],
- ["8136FC31",0x23CF],
- ["8136FC32",0x23D0],
- ["8136FC33",0x23D1],
- ["8136FC34",0x23D2],
- ["8136FC35",0x23D3],
- ["8136FC36",0x23D4],
- ["8136FC37",0x23D5],
- ["8136FC38",0x23D6],
- ["8136FC39",0x23D7],
- ["8136FD30",0x23D8],
- ["8136FD31",0x23D9],
- ["8136FD32",0x23DA],
- ["8136FD33",0x23DB],
- ["8136FD34",0x23DC],
- ["8136FD35",0x23DD],
- ["8136FD36",0x23DE],
- ["8136FD37",0x23DF],
- ["8136FD38",0x23E0],
- ["8136FD39",0x23E1],
- ["8136FE30",0x23E2],
- ["8136FE31",0x23E3],
- ["8136FE32",0x23E4],
- ["8136FE33",0x23E5],
- ["8136FE34",0x23E6],
- ["8136FE35",0x23E7],
- ["8136FE36",0x23E8],
- ["8136FE37",0x23E9],
- ["8136FE38",0x23EA],
- ["8136FE39",0x23EB],
- ["81378130",0x23EC],
- ["81378131",0x23ED],
- ["81378132",0x23EE],
- ["81378133",0x23EF],
- ["81378134",0x23F0],
- ["81378135",0x23F1],
- ["81378136",0x23F2],
- ["81378137",0x23F3],
- ["81378138",0x23F4],
- ["81378139",0x23F5],
- ["81378230",0x23F6],
- ["81378231",0x23F7],
- ["81378232",0x23F8],
- ["81378233",0x23F9],
- ["81378234",0x23FA],
- ["81378235",0x23FB],
- ["81378236",0x23FC],
- ["81378237",0x23FD],
- ["81378238",0x23FE],
- ["81378239",0x23FF],
- ["81378330",0x2400],
- ["81378331",0x2401],
- ["81378332",0x2402],
- ["81378333",0x2403],
- ["81378334",0x2404],
- ["81378335",0x2405],
- ["81378336",0x2406],
- ["81378337",0x2407],
- ["81378338",0x2408],
- ["81378339",0x2409],
- ["81378430",0x240A],
- ["81378431",0x240B],
- ["81378432",0x240C],
- ["81378433",0x240D],
- ["81378434",0x240E],
- ["81378435",0x240F],
- ["81378436",0x2410],
- ["81378437",0x2411],
- ["81378438",0x2412],
- ["81378439",0x2413],
- ["81378530",0x2414],
- ["81378531",0x2415],
- ["81378532",0x2416],
- ["81378533",0x2417],
- ["81378534",0x2418],
- ["81378535",0x2419],
- ["81378536",0x241A],
- ["81378537",0x241B],
- ["81378538",0x241C],
- ["81378539",0x241D],
- ["81378630",0x241E],
- ["81378631",0x241F],
- ["81378632",0x2420],
- ["81378633",0x2421],
- ["81378634",0x2422],
- ["81378635",0x2423],
- ["81378636",0x2424],
- ["81378637",0x2425],
- ["81378638",0x2426],
- ["81378639",0x2427],
- ["81378730",0x2428],
- ["81378731",0x2429],
- ["81378732",0x242A],
- ["81378733",0x242B],
- ["81378734",0x242C],
- ["81378735",0x242D],
- ["81378736",0x242E],
- ["81378737",0x242F],
- ["81378738",0x2430],
- ["81378739",0x2431],
- ["81378830",0x2432],
- ["81378831",0x2433],
- ["81378832",0x2434],
- ["81378833",0x2435],
- ["81378834",0x2436],
- ["81378835",0x2437],
- ["81378836",0x2438],
- ["81378837",0x2439],
- ["81378838",0x243A],
- ["81378839",0x243B],
- ["81378930",0x243C],
- ["81378931",0x243D],
- ["81378932",0x243E],
- ["81378933",0x243F],
- ["81378934",0x2440],
- ["81378935",0x2441],
- ["81378936",0x2442],
- ["81378937",0x2443],
- ["81378938",0x2444],
- ["81378939",0x2445],
- ["81378A30",0x2446],
- ["81378A31",0x2447],
- ["81378A32",0x2448],
- ["81378A33",0x2449],
- ["81378A34",0x244A],
- ["81378A35",0x244B],
- ["81378A36",0x244C],
- ["81378A37",0x244D],
- ["81378A38",0x244E],
- ["81378A39",0x244F],
- ["81378B30",0x2450],
- ["81378B31",0x2451],
- ["81378B32",0x2452],
- ["81378B33",0x2453],
- ["81378B34",0x2454],
- ["81378B35",0x2455],
- ["81378B36",0x2456],
- ["81378B37",0x2457],
- ["81378B38",0x2458],
- ["81378B39",0x2459],
- ["81378C30",0x245A],
- ["81378C31",0x245B],
- ["81378C32",0x245C],
- ["81378C33",0x245D],
- ["81378C34",0x245E],
- ["81378C35",0x245F],
- ["A2D9",0x2460],
- ["A2DA",0x2461],
- ["A2DB",0x2462],
- ["A2DC",0x2463],
- ["A2DD",0x2464],
- ["A2DE",0x2465],
- ["A2DF",0x2466],
- ["A2E0",0x2467],
- ["A2E1",0x2468],
- ["A2E2",0x2469],
- ["81378C36",0x246A],
- ["81378C37",0x246B],
- ["81378C38",0x246C],
- ["81378C39",0x246D],
- ["81378D30",0x246E],
- ["81378D31",0x246F],
- ["81378D32",0x2470],
- ["81378D33",0x2471],
- ["81378D34",0x2472],
- ["81378D35",0x2473],
- ["A2C5",0x2474],
- ["A2C6",0x2475],
- ["A2C7",0x2476],
- ["A2C8",0x2477],
- ["A2C9",0x2478],
- ["A2CA",0x2479],
- ["A2CB",0x247A],
- ["A2CC",0x247B],
- ["A2CD",0x247C],
- ["A2CE",0x247D],
- ["A2CF",0x247E],
- ["A2D0",0x247F],
- ["A2D1",0x2480],
- ["A2D2",0x2481],
- ["A2D3",0x2482],
- ["A2D4",0x2483],
- ["A2D5",0x2484],
- ["A2D6",0x2485],
- ["A2D7",0x2486],
- ["A2D8",0x2487],
- ["A2B1",0x2488],
- ["A2B2",0x2489],
- ["A2B3",0x248A],
- ["A2B4",0x248B],
- ["A2B5",0x248C],
- ["A2B6",0x248D],
- ["A2B7",0x248E],
- ["A2B8",0x248F],
- ["A2B9",0x2490],
- ["A2BA",0x2491],
- ["A2BB",0x2492],
- ["A2BC",0x2493],
- ["A2BD",0x2494],
- ["A2BE",0x2495],
- ["A2BF",0x2496],
- ["A2C0",0x2497],
- ["A2C1",0x2498],
- ["A2C2",0x2499],
- ["A2C3",0x249A],
- ["A2C4",0x249B],
- ["81378D36",0x249C],
- ["81378D37",0x249D],
- ["81378D38",0x249E],
- ["81378D39",0x249F],
- ["81378E30",0x24A0],
- ["81378E31",0x24A1],
- ["81378E32",0x24A2],
- ["81378E33",0x24A3],
- ["81378E34",0x24A4],
- ["81378E35",0x24A5],
- ["81378E36",0x24A6],
- ["81378E37",0x24A7],
- ["81378E38",0x24A8],
- ["81378E39",0x24A9],
- ["81378F30",0x24AA],
- ["81378F31",0x24AB],
- ["81378F32",0x24AC],
- ["81378F33",0x24AD],
- ["81378F34",0x24AE],
- ["81378F35",0x24AF],
- ["81378F36",0x24B0],
- ["81378F37",0x24B1],
- ["81378F38",0x24B2],
- ["81378F39",0x24B3],
- ["81379030",0x24B4],
- ["81379031",0x24B5],
- ["81379032",0x24B6],
- ["81379033",0x24B7],
- ["81379034",0x24B8],
- ["81379035",0x24B9],
- ["81379036",0x24BA],
- ["81379037",0x24BB],
- ["81379038",0x24BC],
- ["81379039",0x24BD],
- ["81379130",0x24BE],
- ["81379131",0x24BF],
- ["81379132",0x24C0],
- ["81379133",0x24C1],
- ["81379134",0x24C2],
- ["81379135",0x24C3],
- ["81379136",0x24C4],
- ["81379137",0x24C5],
- ["81379138",0x24C6],
- ["81379139",0x24C7],
- ["81379230",0x24C8],
- ["81379231",0x24C9],
- ["81379232",0x24CA],
- ["81379233",0x24CB],
- ["81379234",0x24CC],
- ["81379235",0x24CD],
- ["81379236",0x24CE],
- ["81379237",0x24CF],
- ["81379238",0x24D0],
- ["81379239",0x24D1],
- ["81379330",0x24D2],
- ["81379331",0x24D3],
- ["81379332",0x24D4],
- ["81379333",0x24D5],
- ["81379334",0x24D6],
- ["81379335",0x24D7],
- ["81379336",0x24D8],
- ["81379337",0x24D9],
- ["81379338",0x24DA],
- ["81379339",0x24DB],
- ["81379430",0x24DC],
- ["81379431",0x24DD],
- ["81379432",0x24DE],
- ["81379433",0x24DF],
- ["81379434",0x24E0],
- ["81379435",0x24E1],
- ["81379436",0x24E2],
- ["81379437",0x24E3],
- ["81379438",0x24E4],
- ["81379439",0x24E5],
- ["81379530",0x24E6],
- ["81379531",0x24E7],
- ["81379532",0x24E8],
- ["81379533",0x24E9],
- ["81379534",0x24EA],
- ["81379535",0x24EB],
- ["81379536",0x24EC],
- ["81379537",0x24ED],
- ["81379538",0x24EE],
- ["81379539",0x24EF],
- ["81379630",0x24F0],
- ["81379631",0x24F1],
- ["81379632",0x24F2],
- ["81379633",0x24F3],
- ["81379634",0x24F4],
- ["81379635",0x24F5],
- ["81379636",0x24F6],
- ["81379637",0x24F7],
- ["81379638",0x24F8],
- ["81379639",0x24F9],
- ["81379730",0x24FA],
- ["81379731",0x24FB],
- ["81379732",0x24FC],
- ["81379733",0x24FD],
- ["81379734",0x24FE],
- ["81379735",0x24FF],
- ["A9A4",0x2500],
- ["A9A5",0x2501],
- ["A9A6",0x2502],
- ["A9A7",0x2503],
- ["A9A8",0x2504],
- ["A9A9",0x2505],
- ["A9AA",0x2506],
- ["A9AB",0x2507],
- ["A9AC",0x2508],
- ["A9AD",0x2509],
- ["A9AE",0x250A],
- ["A9AF",0x250B],
- ["A9B0",0x250C],
- ["A9B1",0x250D],
- ["A9B2",0x250E],
- ["A9B3",0x250F],
- ["A9B4",0x2510],
- ["A9B5",0x2511],
- ["A9B6",0x2512],
- ["A9B7",0x2513],
- ["A9B8",0x2514],
- ["A9B9",0x2515],
- ["A9BA",0x2516],
- ["A9BB",0x2517],
- ["A9BC",0x2518],
- ["A9BD",0x2519],
- ["A9BE",0x251A],
- ["A9BF",0x251B],
- ["A9C0",0x251C],
- ["A9C1",0x251D],
- ["A9C2",0x251E],
- ["A9C3",0x251F],
- ["A9C4",0x2520],
- ["A9C5",0x2521],
- ["A9C6",0x2522],
- ["A9C7",0x2523],
- ["A9C8",0x2524],
- ["A9C9",0x2525],
- ["A9CA",0x2526],
- ["A9CB",0x2527],
- ["A9CC",0x2528],
- ["A9CD",0x2529],
- ["A9CE",0x252A],
- ["A9CF",0x252B],
- ["A9D0",0x252C],
- ["A9D1",0x252D],
- ["A9D2",0x252E],
- ["A9D3",0x252F],
- ["A9D4",0x2530],
- ["A9D5",0x2531],
- ["A9D6",0x2532],
- ["A9D7",0x2533],
- ["A9D8",0x2534],
- ["A9D9",0x2535],
- ["A9DA",0x2536],
- ["A9DB",0x2537],
- ["A9DC",0x2538],
- ["A9DD",0x2539],
- ["A9DE",0x253A],
- ["A9DF",0x253B],
- ["A9E0",0x253C],
- ["A9E1",0x253D],
- ["A9E2",0x253E],
- ["A9E3",0x253F],
- ["A9E4",0x2540],
- ["A9E5",0x2541],
- ["A9E6",0x2542],
- ["A9E7",0x2543],
- ["A9E8",0x2544],
- ["A9E9",0x2545],
- ["A9EA",0x2546],
- ["A9EB",0x2547],
- ["A9EC",0x2548],
- ["A9ED",0x2549],
- ["A9EE",0x254A],
- ["A9EF",0x254B],
- ["81379736",0x254C],
- ["81379737",0x254D],
- ["81379738",0x254E],
- ["81379739",0x254F],
- ["A854",0x2550],
- ["A855",0x2551],
- ["A856",0x2552],
- ["A857",0x2553],
- ["A858",0x2554],
- ["A859",0x2555],
- ["A85A",0x2556],
- ["A85B",0x2557],
- ["A85C",0x2558],
- ["A85D",0x2559],
- ["A85E",0x255A],
- ["A85F",0x255B],
- ["A860",0x255C],
- ["A861",0x255D],
- ["A862",0x255E],
- ["A863",0x255F],
- ["A864",0x2560],
- ["A865",0x2561],
- ["A866",0x2562],
- ["A867",0x2563],
- ["A868",0x2564],
- ["A869",0x2565],
- ["A86A",0x2566],
- ["A86B",0x2567],
- ["A86C",0x2568],
- ["A86D",0x2569],
- ["A86E",0x256A],
- ["A86F",0x256B],
- ["A870",0x256C],
- ["A871",0x256D],
- ["A872",0x256E],
- ["A873",0x256F],
- ["A874",0x2570],
- ["A875",0x2571],
- ["A876",0x2572],
- ["A877",0x2573],
- ["81379830",0x2574],
- ["81379831",0x2575],
- ["81379832",0x2576],
- ["81379833",0x2577],
- ["81379834",0x2578],
- ["81379835",0x2579],
- ["81379836",0x257A],
- ["81379837",0x257B],
- ["81379838",0x257C],
- ["81379839",0x257D],
- ["81379930",0x257E],
- ["81379931",0x257F],
- ["81379932",0x2580],
- ["A878",0x2581],
- ["A879",0x2582],
- ["A87A",0x2583],
- ["A87B",0x2584],
- ["A87C",0x2585],
- ["A87D",0x2586],
- ["A87E",0x2587],
- ["A880",0x2588],
- ["A881",0x2589],
- ["A882",0x258A],
- ["A883",0x258B],
- ["A884",0x258C],
- ["A885",0x258D],
- ["A886",0x258E],
- ["A887",0x258F],
- ["81379933",0x2590],
- ["81379934",0x2591],
- ["81379935",0x2592],
- ["A888",0x2593],
- ["A889",0x2594],
- ["A88A",0x2595],
- ["81379936",0x2596],
- ["81379937",0x2597],
- ["81379938",0x2598],
- ["81379939",0x2599],
- ["81379A30",0x259A],
- ["81379A31",0x259B],
- ["81379A32",0x259C],
- ["81379A33",0x259D],
- ["81379A34",0x259E],
- ["81379A35",0x259F],
- ["A1F6",0x25A0],
- ["A1F5",0x25A1],
- ["81379A36",0x25A2],
- ["81379A37",0x25A3],
- ["81379A38",0x25A4],
- ["81379A39",0x25A5],
- ["81379B30",0x25A6],
- ["81379B31",0x25A7],
- ["81379B32",0x25A8],
- ["81379B33",0x25A9],
- ["81379B34",0x25AA],
- ["81379B35",0x25AB],
- ["81379B36",0x25AC],
- ["81379B37",0x25AD],
- ["81379B38",0x25AE],
- ["81379B39",0x25AF],
- ["81379C30",0x25B0],
- ["81379C31",0x25B1],
- ["A1F8",0x25B2],
- ["A1F7",0x25B3],
- ["81379C32",0x25B4],
- ["81379C33",0x25B5],
- ["81379C34",0x25B6],
- ["81379C35",0x25B7],
- ["81379C36",0x25B8],
- ["81379C37",0x25B9],
- ["81379C38",0x25BA],
- ["81379C39",0x25BB],
- ["A88B",0x25BC],
- ["A88C",0x25BD],
- ["81379D30",0x25BE],
- ["81379D31",0x25BF],
- ["81379D32",0x25C0],
- ["81379D33",0x25C1],
- ["81379D34",0x25C2],
- ["81379D35",0x25C3],
- ["81379D36",0x25C4],
- ["81379D37",0x25C5],
- ["A1F4",0x25C6],
- ["A1F3",0x25C7],
- ["81379D38",0x25C8],
- ["81379D39",0x25C9],
- ["81379E30",0x25CA],
- ["A1F0",0x25CB],
- ["81379E31",0x25CC],
- ["81379E32",0x25CD],
- ["A1F2",0x25CE],
- ["A1F1",0x25CF],
- ["81379E33",0x25D0],
- ["81379E34",0x25D1],
- ["81379E35",0x25D2],
- ["81379E36",0x25D3],
- ["81379E37",0x25D4],
- ["81379E38",0x25D5],
- ["81379E39",0x25D6],
- ["81379F30",0x25D7],
- ["81379F31",0x25D8],
- ["81379F32",0x25D9],
- ["81379F33",0x25DA],
- ["81379F34",0x25DB],
- ["81379F35",0x25DC],
- ["81379F36",0x25DD],
- ["81379F37",0x25DE],
- ["81379F38",0x25DF],
- ["81379F39",0x25E0],
- ["8137A030",0x25E1],
- ["A88D",0x25E2],
- ["A88E",0x25E3],
- ["A88F",0x25E4],
- ["A890",0x25E5],
- ["8137A031",0x25E6],
- ["8137A032",0x25E7],
- ["8137A033",0x25E8],
- ["8137A034",0x25E9],
- ["8137A035",0x25EA],
- ["8137A036",0x25EB],
- ["8137A037",0x25EC],
- ["8137A038",0x25ED],
- ["8137A039",0x25EE],
- ["8137A130",0x25EF],
- ["8137A131",0x25F0],
- ["8137A132",0x25F1],
- ["8137A133",0x25F2],
- ["8137A134",0x25F3],
- ["8137A135",0x25F4],
- ["8137A136",0x25F5],
- ["8137A137",0x25F6],
- ["8137A138",0x25F7],
- ["8137A139",0x25F8],
- ["8137A230",0x25F9],
- ["8137A231",0x25FA],
- ["8137A232",0x25FB],
- ["8137A233",0x25FC],
- ["8137A234",0x25FD],
- ["8137A235",0x25FE],
- ["8137A236",0x25FF],
- ["8137A237",0x2600],
- ["8137A238",0x2601],
- ["8137A239",0x2602],
- ["8137A330",0x2603],
- ["8137A331",0x2604],
- ["A1EF",0x2605],
- ["A1EE",0x2606],
- ["8137A332",0x2607],
- ["8137A333",0x2608],
- ["A891",0x2609],
- ["8137A334",0x260A],
- ["8137A335",0x260B],
- ["8137A336",0x260C],
- ["8137A337",0x260D],
- ["8137A338",0x260E],
- ["8137A339",0x260F],
- ["8137A430",0x2610],
- ["8137A431",0x2611],
- ["8137A432",0x2612],
- ["8137A433",0x2613],
- ["8137A434",0x2614],
- ["8137A435",0x2615],
- ["8137A436",0x2616],
- ["8137A437",0x2617],
- ["8137A438",0x2618],
- ["8137A439",0x2619],
- ["8137A530",0x261A],
- ["8137A531",0x261B],
- ["8137A532",0x261C],
- ["8137A533",0x261D],
- ["8137A534",0x261E],
- ["8137A535",0x261F],
- ["8137A536",0x2620],
- ["8137A537",0x2621],
- ["8137A538",0x2622],
- ["8137A539",0x2623],
- ["8137A630",0x2624],
- ["8137A631",0x2625],
- ["8137A632",0x2626],
- ["8137A633",0x2627],
- ["8137A634",0x2628],
- ["8137A635",0x2629],
- ["8137A636",0x262A],
- ["8137A637",0x262B],
- ["8137A638",0x262C],
- ["8137A639",0x262D],
- ["8137A730",0x262E],
- ["8137A731",0x262F],
- ["8137A732",0x2630],
- ["8137A733",0x2631],
- ["8137A734",0x2632],
- ["8137A735",0x2633],
- ["8137A736",0x2634],
- ["8137A737",0x2635],
- ["8137A738",0x2636],
- ["8137A739",0x2637],
- ["8137A830",0x2638],
- ["8137A831",0x2639],
- ["8137A832",0x263A],
- ["8137A833",0x263B],
- ["8137A834",0x263C],
- ["8137A835",0x263D],
- ["8137A836",0x263E],
- ["8137A837",0x263F],
- ["A1E2",0x2640],
- ["8137A838",0x2641],
- ["A1E1",0x2642],
- ["8137A839",0x2643],
- ["8137A930",0x2644],
- ["8137A931",0x2645],
- ["8137A932",0x2646],
- ["8137A933",0x2647],
- ["8137A934",0x2648],
- ["8137A935",0x2649],
- ["8137A936",0x264A],
- ["8137A937",0x264B],
- ["8137A938",0x264C],
- ["8137A939",0x264D],
- ["8137AA30",0x264E],
- ["8137AA31",0x264F],
- ["8137AA32",0x2650],
- ["8137AA33",0x2651],
- ["8137AA34",0x2652],
- ["8137AA35",0x2653],
- ["8137AA36",0x2654],
- ["8137AA37",0x2655],
- ["8137AA38",0x2656],
- ["8137AA39",0x2657],
- ["8137AB30",0x2658],
- ["8137AB31",0x2659],
- ["8137AB32",0x265A],
- ["8137AB33",0x265B],
- ["8137AB34",0x265C],
- ["8137AB35",0x265D],
- ["8137AB36",0x265E],
- ["8137AB37",0x265F],
- ["8137AB38",0x2660],
- ["8137AB39",0x2661],
- ["8137AC30",0x2662],
- ["8137AC31",0x2663],
- ["8137AC32",0x2664],
- ["8137AC33",0x2665],
- ["8137AC34",0x2666],
- ["8137AC35",0x2667],
- ["8137AC36",0x2668],
- ["8137AC37",0x2669],
- ["8137AC38",0x266A],
- ["8137AC39",0x266B],
- ["8137AD30",0x266C],
- ["8137AD31",0x266D],
- ["8137AD32",0x266E],
- ["8137AD33",0x266F],
- ["8137AD34",0x2670],
- ["8137AD35",0x2671],
- ["8137AD36",0x2672],
- ["8137AD37",0x2673],
- ["8137AD38",0x2674],
- ["8137AD39",0x2675],
- ["8137AE30",0x2676],
- ["8137AE31",0x2677],
- ["8137AE32",0x2678],
- ["8137AE33",0x2679],
- ["8137AE34",0x267A],
- ["8137AE35",0x267B],
- ["8137AE36",0x267C],
- ["8137AE37",0x267D],
- ["8137AE38",0x267E],
- ["8137AE39",0x267F],
- ["8137AF30",0x2680],
- ["8137AF31",0x2681],
- ["8137AF32",0x2682],
- ["8137AF33",0x2683],
- ["8137AF34",0x2684],
- ["8137AF35",0x2685],
- ["8137AF36",0x2686],
- ["8137AF37",0x2687],
- ["8137AF38",0x2688],
- ["8137AF39",0x2689],
- ["8137B030",0x268A],
- ["8137B031",0x268B],
- ["8137B032",0x268C],
- ["8137B033",0x268D],
- ["8137B034",0x268E],
- ["8137B035",0x268F],
- ["8137B036",0x2690],
- ["8137B037",0x2691],
- ["8137B038",0x2692],
- ["8137B039",0x2693],
- ["8137B130",0x2694],
- ["8137B131",0x2695],
- ["8137B132",0x2696],
- ["8137B133",0x2697],
- ["8137B134",0x2698],
- ["8137B135",0x2699],
- ["8137B136",0x269A],
- ["8137B137",0x269B],
- ["8137B138",0x269C],
- ["8137B139",0x269D],
- ["8137B230",0x269E],
- ["8137B231",0x269F],
- ["8137B232",0x26A0],
- ["8137B233",0x26A1],
- ["8137B234",0x26A2],
- ["8137B235",0x26A3],
- ["8137B236",0x26A4],
- ["8137B237",0x26A5],
- ["8137B238",0x26A6],
- ["8137B239",0x26A7],
- ["8137B330",0x26A8],
- ["8137B331",0x26A9],
- ["8137B332",0x26AA],
- ["8137B333",0x26AB],
- ["8137B334",0x26AC],
- ["8137B335",0x26AD],
- ["8137B336",0x26AE],
- ["8137B337",0x26AF],
- ["8137B338",0x26B0],
- ["8137B339",0x26B1],
- ["8137B430",0x26B2],
- ["8137B431",0x26B3],
- ["8137B432",0x26B4],
- ["8137B433",0x26B5],
- ["8137B434",0x26B6],
- ["8137B435",0x26B7],
- ["8137B436",0x26B8],
- ["8137B437",0x26B9],
- ["8137B438",0x26BA],
- ["8137B439",0x26BB],
- ["8137B530",0x26BC],
- ["8137B531",0x26BD],
- ["8137B532",0x26BE],
- ["8137B533",0x26BF],
- ["8137B534",0x26C0],
- ["8137B535",0x26C1],
- ["8137B536",0x26C2],
- ["8137B537",0x26C3],
- ["8137B538",0x26C4],
- ["8137B539",0x26C5],
- ["8137B630",0x26C6],
- ["8137B631",0x26C7],
- ["8137B632",0x26C8],
- ["8137B633",0x26C9],
- ["8137B634",0x26CA],
- ["8137B635",0x26CB],
- ["8137B636",0x26CC],
- ["8137B637",0x26CD],
- ["8137B638",0x26CE],
- ["8137B639",0x26CF],
- ["8137B730",0x26D0],
- ["8137B731",0x26D1],
- ["8137B732",0x26D2],
- ["8137B733",0x26D3],
- ["8137B734",0x26D4],
- ["8137B735",0x26D5],
- ["8137B736",0x26D6],
- ["8137B737",0x26D7],
- ["8137B738",0x26D8],
- ["8137B739",0x26D9],
- ["8137B830",0x26DA],
- ["8137B831",0x26DB],
- ["8137B832",0x26DC],
- ["8137B833",0x26DD],
- ["8137B834",0x26DE],
- ["8137B835",0x26DF],
- ["8137B836",0x26E0],
- ["8137B837",0x26E1],
- ["8137B838",0x26E2],
- ["8137B839",0x26E3],
- ["8137B930",0x26E4],
- ["8137B931",0x26E5],
- ["8137B932",0x26E6],
- ["8137B933",0x26E7],
- ["8137B934",0x26E8],
- ["8137B935",0x26E9],
- ["8137B936",0x26EA],
- ["8137B937",0x26EB],
- ["8137B938",0x26EC],
- ["8137B939",0x26ED],
- ["8137BA30",0x26EE],
- ["8137BA31",0x26EF],
- ["8137BA32",0x26F0],
- ["8137BA33",0x26F1],
- ["8137BA34",0x26F2],
- ["8137BA35",0x26F3],
- ["8137BA36",0x26F4],
- ["8137BA37",0x26F5],
- ["8137BA38",0x26F6],
- ["8137BA39",0x26F7],
- ["8137BB30",0x26F8],
- ["8137BB31",0x26F9],
- ["8137BB32",0x26FA],
- ["8137BB33",0x26FB],
- ["8137BB34",0x26FC],
- ["8137BB35",0x26FD],
- ["8137BB36",0x26FE],
- ["8137BB37",0x26FF],
- ["8137BB38",0x2700],
- ["8137BB39",0x2701],
- ["8137BC30",0x2702],
- ["8137BC31",0x2703],
- ["8137BC32",0x2704],
- ["8137BC33",0x2705],
- ["8137BC34",0x2706],
- ["8137BC35",0x2707],
- ["8137BC36",0x2708],
- ["8137BC37",0x2709],
- ["8137BC38",0x270A],
- ["8137BC39",0x270B],
- ["8137BD30",0x270C],
- ["8137BD31",0x270D],
- ["8137BD32",0x270E],
- ["8137BD33",0x270F],
- ["8137BD34",0x2710],
- ["8137BD35",0x2711],
- ["8137BD36",0x2712],
- ["8137BD37",0x2713],
- ["8137BD38",0x2714],
- ["8137BD39",0x2715],
- ["8137BE30",0x2716],
- ["8137BE31",0x2717],
- ["8137BE32",0x2718],
- ["8137BE33",0x2719],
- ["8137BE34",0x271A],
- ["8137BE35",0x271B],
- ["8137BE36",0x271C],
- ["8137BE37",0x271D],
- ["8137BE38",0x271E],
- ["8137BE39",0x271F],
- ["8137BF30",0x2720],
- ["8137BF31",0x2721],
- ["8137BF32",0x2722],
- ["8137BF33",0x2723],
- ["8137BF34",0x2724],
- ["8137BF35",0x2725],
- ["8137BF36",0x2726],
- ["8137BF37",0x2727],
- ["8137BF38",0x2728],
- ["8137BF39",0x2729],
- ["8137C030",0x272A],
- ["8137C031",0x272B],
- ["8137C032",0x272C],
- ["8137C033",0x272D],
- ["8137C034",0x272E],
- ["8137C035",0x272F],
- ["8137C036",0x2730],
- ["8137C037",0x2731],
- ["8137C038",0x2732],
- ["8137C039",0x2733],
- ["8137C130",0x2734],
- ["8137C131",0x2735],
- ["8137C132",0x2736],
- ["8137C133",0x2737],
- ["8137C134",0x2738],
- ["8137C135",0x2739],
- ["8137C136",0x273A],
- ["8137C137",0x273B],
- ["8137C138",0x273C],
- ["8137C139",0x273D],
- ["8137C230",0x273E],
- ["8137C231",0x273F],
- ["8137C232",0x2740],
- ["8137C233",0x2741],
- ["8137C234",0x2742],
- ["8137C235",0x2743],
- ["8137C236",0x2744],
- ["8137C237",0x2745],
- ["8137C238",0x2746],
- ["8137C239",0x2747],
- ["8137C330",0x2748],
- ["8137C331",0x2749],
- ["8137C332",0x274A],
- ["8137C333",0x274B],
- ["8137C334",0x274C],
- ["8137C335",0x274D],
- ["8137C336",0x274E],
- ["8137C337",0x274F],
- ["8137C338",0x2750],
- ["8137C339",0x2751],
- ["8137C430",0x2752],
- ["8137C431",0x2753],
- ["8137C432",0x2754],
- ["8137C433",0x2755],
- ["8137C434",0x2756],
- ["8137C435",0x2757],
- ["8137C436",0x2758],
- ["8137C437",0x2759],
- ["8137C438",0x275A],
- ["8137C439",0x275B],
- ["8137C530",0x275C],
- ["8137C531",0x275D],
- ["8137C532",0x275E],
- ["8137C533",0x275F],
- ["8137C534",0x2760],
- ["8137C535",0x2761],
- ["8137C536",0x2762],
- ["8137C537",0x2763],
- ["8137C538",0x2764],
- ["8137C539",0x2765],
- ["8137C630",0x2766],
- ["8137C631",0x2767],
- ["8137C632",0x2768],
- ["8137C633",0x2769],
- ["8137C634",0x276A],
- ["8137C635",0x276B],
- ["8137C636",0x276C],
- ["8137C637",0x276D],
- ["8137C638",0x276E],
- ["8137C639",0x276F],
- ["8137C730",0x2770],
- ["8137C731",0x2771],
- ["8137C732",0x2772],
- ["8137C733",0x2773],
- ["8137C734",0x2774],
- ["8137C735",0x2775],
- ["8137C736",0x2776],
- ["8137C737",0x2777],
- ["8137C738",0x2778],
- ["8137C739",0x2779],
- ["8137C830",0x277A],
- ["8137C831",0x277B],
- ["8137C832",0x277C],
- ["8137C833",0x277D],
- ["8137C834",0x277E],
- ["8137C835",0x277F],
- ["8137C836",0x2780],
- ["8137C837",0x2781],
- ["8137C838",0x2782],
- ["8137C839",0x2783],
- ["8137C930",0x2784],
- ["8137C931",0x2785],
- ["8137C932",0x2786],
- ["8137C933",0x2787],
- ["8137C934",0x2788],
- ["8137C935",0x2789],
- ["8137C936",0x278A],
- ["8137C937",0x278B],
- ["8137C938",0x278C],
- ["8137C939",0x278D],
- ["8137CA30",0x278E],
- ["8137CA31",0x278F],
- ["8137CA32",0x2790],
- ["8137CA33",0x2791],
- ["8137CA34",0x2792],
- ["8137CA35",0x2793],
- ["8137CA36",0x2794],
- ["8137CA37",0x2795],
- ["8137CA38",0x2796],
- ["8137CA39",0x2797],
- ["8137CB30",0x2798],
- ["8137CB31",0x2799],
- ["8137CB32",0x279A],
- ["8137CB33",0x279B],
- ["8137CB34",0x279C],
- ["8137CB35",0x279D],
- ["8137CB36",0x279E],
- ["8137CB37",0x279F],
- ["8137CB38",0x27A0],
- ["8137CB39",0x27A1],
- ["8137CC30",0x27A2],
- ["8137CC31",0x27A3],
- ["8137CC32",0x27A4],
- ["8137CC33",0x27A5],
- ["8137CC34",0x27A6],
- ["8137CC35",0x27A7],
- ["8137CC36",0x27A8],
- ["8137CC37",0x27A9],
- ["8137CC38",0x27AA],
- ["8137CC39",0x27AB],
- ["8137CD30",0x27AC],
- ["8137CD31",0x27AD],
- ["8137CD32",0x27AE],
- ["8137CD33",0x27AF],
- ["8137CD34",0x27B0],
- ["8137CD35",0x27B1],
- ["8137CD36",0x27B2],
- ["8137CD37",0x27B3],
- ["8137CD38",0x27B4],
- ["8137CD39",0x27B5],
- ["8137CE30",0x27B6],
- ["8137CE31",0x27B7],
- ["8137CE32",0x27B8],
- ["8137CE33",0x27B9],
- ["8137CE34",0x27BA],
- ["8137CE35",0x27BB],
- ["8137CE36",0x27BC],
- ["8137CE37",0x27BD],
- ["8137CE38",0x27BE],
- ["8137CE39",0x27BF],
- ["8137CF30",0x27C0],
- ["8137CF31",0x27C1],
- ["8137CF32",0x27C2],
- ["8137CF33",0x27C3],
- ["8137CF34",0x27C4],
- ["8137CF35",0x27C5],
- ["8137CF36",0x27C6],
- ["8137CF37",0x27C7],
- ["8137CF38",0x27C8],
- ["8137CF39",0x27C9],
- ["8137D030",0x27CA],
- ["8137D031",0x27CB],
- ["8137D032",0x27CC],
- ["8137D033",0x27CD],
- ["8137D034",0x27CE],
- ["8137D035",0x27CF],
- ["8137D036",0x27D0],
- ["8137D037",0x27D1],
- ["8137D038",0x27D2],
- ["8137D039",0x27D3],
- ["8137D130",0x27D4],
- ["8137D131",0x27D5],
- ["8137D132",0x27D6],
- ["8137D133",0x27D7],
- ["8137D134",0x27D8],
- ["8137D135",0x27D9],
- ["8137D136",0x27DA],
- ["8137D137",0x27DB],
- ["8137D138",0x27DC],
- ["8137D139",0x27DD],
- ["8137D230",0x27DE],
- ["8137D231",0x27DF],
- ["8137D232",0x27E0],
- ["8137D233",0x27E1],
- ["8137D234",0x27E2],
- ["8137D235",0x27E3],
- ["8137D236",0x27E4],
- ["8137D237",0x27E5],
- ["8137D238",0x27E6],
- ["8137D239",0x27E7],
- ["8137D330",0x27E8],
- ["8137D331",0x27E9],
- ["8137D332",0x27EA],
- ["8137D333",0x27EB],
- ["8137D334",0x27EC],
- ["8137D335",0x27ED],
- ["8137D336",0x27EE],
- ["8137D337",0x27EF],
- ["8137D338",0x27F0],
- ["8137D339",0x27F1],
- ["8137D430",0x27F2],
- ["8137D431",0x27F3],
- ["8137D432",0x27F4],
- ["8137D433",0x27F5],
- ["8137D434",0x27F6],
- ["8137D435",0x27F7],
- ["8137D436",0x27F8],
- ["8137D437",0x27F9],
- ["8137D438",0x27FA],
- ["8137D439",0x27FB],
- ["8137D530",0x27FC],
- ["8137D531",0x27FD],
- ["8137D532",0x27FE],
- ["8137D533",0x27FF],
- ["8137D534",0x2800],
- ["8137D535",0x2801],
- ["8137D536",0x2802],
- ["8137D537",0x2803],
- ["8137D538",0x2804],
- ["8137D539",0x2805],
- ["8137D630",0x2806],
- ["8137D631",0x2807],
- ["8137D632",0x2808],
- ["8137D633",0x2809],
- ["8137D634",0x280A],
- ["8137D635",0x280B],
- ["8137D636",0x280C],
- ["8137D637",0x280D],
- ["8137D638",0x280E],
- ["8137D639",0x280F],
- ["8137D730",0x2810],
- ["8137D731",0x2811],
- ["8137D732",0x2812],
- ["8137D733",0x2813],
- ["8137D734",0x2814],
- ["8137D735",0x2815],
- ["8137D736",0x2816],
- ["8137D737",0x2817],
- ["8137D738",0x2818],
- ["8137D739",0x2819],
- ["8137D830",0x281A],
- ["8137D831",0x281B],
- ["8137D832",0x281C],
- ["8137D833",0x281D],
- ["8137D834",0x281E],
- ["8137D835",0x281F],
- ["8137D836",0x2820],
- ["8137D837",0x2821],
- ["8137D838",0x2822],
- ["8137D839",0x2823],
- ["8137D930",0x2824],
- ["8137D931",0x2825],
- ["8137D932",0x2826],
- ["8137D933",0x2827],
- ["8137D934",0x2828],
- ["8137D935",0x2829],
- ["8137D936",0x282A],
- ["8137D937",0x282B],
- ["8137D938",0x282C],
- ["8137D939",0x282D],
- ["8137DA30",0x282E],
- ["8137DA31",0x282F],
- ["8137DA32",0x2830],
- ["8137DA33",0x2831],
- ["8137DA34",0x2832],
- ["8137DA35",0x2833],
- ["8137DA36",0x2834],
- ["8137DA37",0x2835],
- ["8137DA38",0x2836],
- ["8137DA39",0x2837],
- ["8137DB30",0x2838],
- ["8137DB31",0x2839],
- ["8137DB32",0x283A],
- ["8137DB33",0x283B],
- ["8137DB34",0x283C],
- ["8137DB35",0x283D],
- ["8137DB36",0x283E],
- ["8137DB37",0x283F],
- ["8137DB38",0x2840],
- ["8137DB39",0x2841],
- ["8137DC30",0x2842],
- ["8137DC31",0x2843],
- ["8137DC32",0x2844],
- ["8137DC33",0x2845],
- ["8137DC34",0x2846],
- ["8137DC35",0x2847],
- ["8137DC36",0x2848],
- ["8137DC37",0x2849],
- ["8137DC38",0x284A],
- ["8137DC39",0x284B],
- ["8137DD30",0x284C],
- ["8137DD31",0x284D],
- ["8137DD32",0x284E],
- ["8137DD33",0x284F],
- ["8137DD34",0x2850],
- ["8137DD35",0x2851],
- ["8137DD36",0x2852],
- ["8137DD37",0x2853],
- ["8137DD38",0x2854],
- ["8137DD39",0x2855],
- ["8137DE30",0x2856],
- ["8137DE31",0x2857],
- ["8137DE32",0x2858],
- ["8137DE33",0x2859],
- ["8137DE34",0x285A],
- ["8137DE35",0x285B],
- ["8137DE36",0x285C],
- ["8137DE37",0x285D],
- ["8137DE38",0x285E],
- ["8137DE39",0x285F],
- ["8137DF30",0x2860],
- ["8137DF31",0x2861],
- ["8137DF32",0x2862],
- ["8137DF33",0x2863],
- ["8137DF34",0x2864],
- ["8137DF35",0x2865],
- ["8137DF36",0x2866],
- ["8137DF37",0x2867],
- ["8137DF38",0x2868],
- ["8137DF39",0x2869],
- ["8137E030",0x286A],
- ["8137E031",0x286B],
- ["8137E032",0x286C],
- ["8137E033",0x286D],
- ["8137E034",0x286E],
- ["8137E035",0x286F],
- ["8137E036",0x2870],
- ["8137E037",0x2871],
- ["8137E038",0x2872],
- ["8137E039",0x2873],
- ["8137E130",0x2874],
- ["8137E131",0x2875],
- ["8137E132",0x2876],
- ["8137E133",0x2877],
- ["8137E134",0x2878],
- ["8137E135",0x2879],
- ["8137E136",0x287A],
- ["8137E137",0x287B],
- ["8137E138",0x287C],
- ["8137E139",0x287D],
- ["8137E230",0x287E],
- ["8137E231",0x287F],
- ["8137E232",0x2880],
- ["8137E233",0x2881],
- ["8137E234",0x2882],
- ["8137E235",0x2883],
- ["8137E236",0x2884],
- ["8137E237",0x2885],
- ["8137E238",0x2886],
- ["8137E239",0x2887],
- ["8137E330",0x2888],
- ["8137E331",0x2889],
- ["8137E332",0x288A],
- ["8137E333",0x288B],
- ["8137E334",0x288C],
- ["8137E335",0x288D],
- ["8137E336",0x288E],
- ["8137E337",0x288F],
- ["8137E338",0x2890],
- ["8137E339",0x2891],
- ["8137E430",0x2892],
- ["8137E431",0x2893],
- ["8137E432",0x2894],
- ["8137E433",0x2895],
- ["8137E434",0x2896],
- ["8137E435",0x2897],
- ["8137E436",0x2898],
- ["8137E437",0x2899],
- ["8137E438",0x289A],
- ["8137E439",0x289B],
- ["8137E530",0x289C],
- ["8137E531",0x289D],
- ["8137E532",0x289E],
- ["8137E533",0x289F],
- ["8137E534",0x28A0],
- ["8137E535",0x28A1],
- ["8137E536",0x28A2],
- ["8137E537",0x28A3],
- ["8137E538",0x28A4],
- ["8137E539",0x28A5],
- ["8137E630",0x28A6],
- ["8137E631",0x28A7],
- ["8137E632",0x28A8],
- ["8137E633",0x28A9],
- ["8137E634",0x28AA],
- ["8137E635",0x28AB],
- ["8137E636",0x28AC],
- ["8137E637",0x28AD],
- ["8137E638",0x28AE],
- ["8137E639",0x28AF],
- ["8137E730",0x28B0],
- ["8137E731",0x28B1],
- ["8137E732",0x28B2],
- ["8137E733",0x28B3],
- ["8137E734",0x28B4],
- ["8137E735",0x28B5],
- ["8137E736",0x28B6],
- ["8137E737",0x28B7],
- ["8137E738",0x28B8],
- ["8137E739",0x28B9],
- ["8137E830",0x28BA],
- ["8137E831",0x28BB],
- ["8137E832",0x28BC],
- ["8137E833",0x28BD],
- ["8137E834",0x28BE],
- ["8137E835",0x28BF],
- ["8137E836",0x28C0],
- ["8137E837",0x28C1],
- ["8137E838",0x28C2],
- ["8137E839",0x28C3],
- ["8137E930",0x28C4],
- ["8137E931",0x28C5],
- ["8137E932",0x28C6],
- ["8137E933",0x28C7],
- ["8137E934",0x28C8],
- ["8137E935",0x28C9],
- ["8137E936",0x28CA],
- ["8137E937",0x28CB],
- ["8137E938",0x28CC],
- ["8137E939",0x28CD],
- ["8137EA30",0x28CE],
- ["8137EA31",0x28CF],
- ["8137EA32",0x28D0],
- ["8137EA33",0x28D1],
- ["8137EA34",0x28D2],
- ["8137EA35",0x28D3],
- ["8137EA36",0x28D4],
- ["8137EA37",0x28D5],
- ["8137EA38",0x28D6],
- ["8137EA39",0x28D7],
- ["8137EB30",0x28D8],
- ["8137EB31",0x28D9],
- ["8137EB32",0x28DA],
- ["8137EB33",0x28DB],
- ["8137EB34",0x28DC],
- ["8137EB35",0x28DD],
- ["8137EB36",0x28DE],
- ["8137EB37",0x28DF],
- ["8137EB38",0x28E0],
- ["8137EB39",0x28E1],
- ["8137EC30",0x28E2],
- ["8137EC31",0x28E3],
- ["8137EC32",0x28E4],
- ["8137EC33",0x28E5],
- ["8137EC34",0x28E6],
- ["8137EC35",0x28E7],
- ["8137EC36",0x28E8],
- ["8137EC37",0x28E9],
- ["8137EC38",0x28EA],
- ["8137EC39",0x28EB],
- ["8137ED30",0x28EC],
- ["8137ED31",0x28ED],
- ["8137ED32",0x28EE],
- ["8137ED33",0x28EF],
- ["8137ED34",0x28F0],
- ["8137ED35",0x28F1],
- ["8137ED36",0x28F2],
- ["8137ED37",0x28F3],
- ["8137ED38",0x28F4],
- ["8137ED39",0x28F5],
- ["8137EE30",0x28F6],
- ["8137EE31",0x28F7],
- ["8137EE32",0x28F8],
- ["8137EE33",0x28F9],
- ["8137EE34",0x28FA],
- ["8137EE35",0x28FB],
- ["8137EE36",0x28FC],
- ["8137EE37",0x28FD],
- ["8137EE38",0x28FE],
- ["8137EE39",0x28FF],
- ["8137EF30",0x2900],
- ["8137EF31",0x2901],
- ["8137EF32",0x2902],
- ["8137EF33",0x2903],
- ["8137EF34",0x2904],
- ["8137EF35",0x2905],
- ["8137EF36",0x2906],
- ["8137EF37",0x2907],
- ["8137EF38",0x2908],
- ["8137EF39",0x2909],
- ["8137F030",0x290A],
- ["8137F031",0x290B],
- ["8137F032",0x290C],
- ["8137F033",0x290D],
- ["8137F034",0x290E],
- ["8137F035",0x290F],
- ["8137F036",0x2910],
- ["8137F037",0x2911],
- ["8137F038",0x2912],
- ["8137F039",0x2913],
- ["8137F130",0x2914],
- ["8137F131",0x2915],
- ["8137F132",0x2916],
- ["8137F133",0x2917],
- ["8137F134",0x2918],
- ["8137F135",0x2919],
- ["8137F136",0x291A],
- ["8137F137",0x291B],
- ["8137F138",0x291C],
- ["8137F139",0x291D],
- ["8137F230",0x291E],
- ["8137F231",0x291F],
- ["8137F232",0x2920],
- ["8137F233",0x2921],
- ["8137F234",0x2922],
- ["8137F235",0x2923],
- ["8137F236",0x2924],
- ["8137F237",0x2925],
- ["8137F238",0x2926],
- ["8137F239",0x2927],
- ["8137F330",0x2928],
- ["8137F331",0x2929],
- ["8137F332",0x292A],
- ["8137F333",0x292B],
- ["8137F334",0x292C],
- ["8137F335",0x292D],
- ["8137F336",0x292E],
- ["8137F337",0x292F],
- ["8137F338",0x2930],
- ["8137F339",0x2931],
- ["8137F430",0x2932],
- ["8137F431",0x2933],
- ["8137F432",0x2934],
- ["8137F433",0x2935],
- ["8137F434",0x2936],
- ["8137F435",0x2937],
- ["8137F436",0x2938],
- ["8137F437",0x2939],
- ["8137F438",0x293A],
- ["8137F439",0x293B],
- ["8137F530",0x293C],
- ["8137F531",0x293D],
- ["8137F532",0x293E],
- ["8137F533",0x293F],
- ["8137F534",0x2940],
- ["8137F535",0x2941],
- ["8137F536",0x2942],
- ["8137F537",0x2943],
- ["8137F538",0x2944],
- ["8137F539",0x2945],
- ["8137F630",0x2946],
- ["8137F631",0x2947],
- ["8137F632",0x2948],
- ["8137F633",0x2949],
- ["8137F634",0x294A],
- ["8137F635",0x294B],
- ["8137F636",0x294C],
- ["8137F637",0x294D],
- ["8137F638",0x294E],
- ["8137F639",0x294F],
- ["8137F730",0x2950],
- ["8137F731",0x2951],
- ["8137F732",0x2952],
- ["8137F733",0x2953],
- ["8137F734",0x2954],
- ["8137F735",0x2955],
- ["8137F736",0x2956],
- ["8137F737",0x2957],
- ["8137F738",0x2958],
- ["8137F739",0x2959],
- ["8137F830",0x295A],
- ["8137F831",0x295B],
- ["8137F832",0x295C],
- ["8137F833",0x295D],
- ["8137F834",0x295E],
- ["8137F835",0x295F],
- ["8137F836",0x2960],
- ["8137F837",0x2961],
- ["8137F838",0x2962],
- ["8137F839",0x2963],
- ["8137F930",0x2964],
- ["8137F931",0x2965],
- ["8137F932",0x2966],
- ["8137F933",0x2967],
- ["8137F934",0x2968],
- ["8137F935",0x2969],
- ["8137F936",0x296A],
- ["8137F937",0x296B],
- ["8137F938",0x296C],
- ["8137F939",0x296D],
- ["8137FA30",0x296E],
- ["8137FA31",0x296F],
- ["8137FA32",0x2970],
- ["8137FA33",0x2971],
- ["8137FA34",0x2972],
- ["8137FA35",0x2973],
- ["8137FA36",0x2974],
- ["8137FA37",0x2975],
- ["8137FA38",0x2976],
- ["8137FA39",0x2977],
- ["8137FB30",0x2978],
- ["8137FB31",0x2979],
- ["8137FB32",0x297A],
- ["8137FB33",0x297B],
- ["8137FB34",0x297C],
- ["8137FB35",0x297D],
- ["8137FB36",0x297E],
- ["8137FB37",0x297F],
- ["8137FB38",0x2980],
- ["8137FB39",0x2981],
- ["8137FC30",0x2982],
- ["8137FC31",0x2983],
- ["8137FC32",0x2984],
- ["8137FC33",0x2985],
- ["8137FC34",0x2986],
- ["8137FC35",0x2987],
- ["8137FC36",0x2988],
- ["8137FC37",0x2989],
- ["8137FC38",0x298A],
- ["8137FC39",0x298B],
- ["8137FD30",0x298C],
- ["8137FD31",0x298D],
- ["8137FD32",0x298E],
- ["8137FD33",0x298F],
- ["8137FD34",0x2990],
- ["8137FD35",0x2991],
- ["8137FD36",0x2992],
- ["8137FD37",0x2993],
- ["8137FD38",0x2994],
- ["8137FD39",0x2995],
- ["8137FE30",0x2996],
- ["8137FE31",0x2997],
- ["8137FE32",0x2998],
- ["8137FE33",0x2999],
- ["8137FE34",0x299A],
- ["8137FE35",0x299B],
- ["8137FE36",0x299C],
- ["8137FE37",0x299D],
- ["8137FE38",0x299E],
- ["8137FE39",0x299F],
- ["81388130",0x29A0],
- ["81388131",0x29A1],
- ["81388132",0x29A2],
- ["81388133",0x29A3],
- ["81388134",0x29A4],
- ["81388135",0x29A5],
- ["81388136",0x29A6],
- ["81388137",0x29A7],
- ["81388138",0x29A8],
- ["81388139",0x29A9],
- ["81388230",0x29AA],
- ["81388231",0x29AB],
- ["81388232",0x29AC],
- ["81388233",0x29AD],
- ["81388234",0x29AE],
- ["81388235",0x29AF],
- ["81388236",0x29B0],
- ["81388237",0x29B1],
- ["81388238",0x29B2],
- ["81388239",0x29B3],
- ["81388330",0x29B4],
- ["81388331",0x29B5],
- ["81388332",0x29B6],
- ["81388333",0x29B7],
- ["81388334",0x29B8],
- ["81388335",0x29B9],
- ["81388336",0x29BA],
- ["81388337",0x29BB],
- ["81388338",0x29BC],
- ["81388339",0x29BD],
- ["81388430",0x29BE],
- ["81388431",0x29BF],
- ["81388432",0x29C0],
- ["81388433",0x29C1],
- ["81388434",0x29C2],
- ["81388435",0x29C3],
- ["81388436",0x29C4],
- ["81388437",0x29C5],
- ["81388438",0x29C6],
- ["81388439",0x29C7],
- ["81388530",0x29C8],
- ["81388531",0x29C9],
- ["81388532",0x29CA],
- ["81388533",0x29CB],
- ["81388534",0x29CC],
- ["81388535",0x29CD],
- ["81388536",0x29CE],
- ["81388537",0x29CF],
- ["81388538",0x29D0],
- ["81388539",0x29D1],
- ["81388630",0x29D2],
- ["81388631",0x29D3],
- ["81388632",0x29D4],
- ["81388633",0x29D5],
- ["81388634",0x29D6],
- ["81388635",0x29D7],
- ["81388636",0x29D8],
- ["81388637",0x29D9],
- ["81388638",0x29DA],
- ["81388639",0x29DB],
- ["81388730",0x29DC],
- ["81388731",0x29DD],
- ["81388732",0x29DE],
- ["81388733",0x29DF],
- ["81388734",0x29E0],
- ["81388735",0x29E1],
- ["81388736",0x29E2],
- ["81388737",0x29E3],
- ["81388738",0x29E4],
- ["81388739",0x29E5],
- ["81388830",0x29E6],
- ["81388831",0x29E7],
- ["81388832",0x29E8],
- ["81388833",0x29E9],
- ["81388834",0x29EA],
- ["81388835",0x29EB],
- ["81388836",0x29EC],
- ["81388837",0x29ED],
- ["81388838",0x29EE],
- ["81388839",0x29EF],
- ["81388930",0x29F0],
- ["81388931",0x29F1],
- ["81388932",0x29F2],
- ["81388933",0x29F3],
- ["81388934",0x29F4],
- ["81388935",0x29F5],
- ["81388936",0x29F6],
- ["81388937",0x29F7],
- ["81388938",0x29F8],
- ["81388939",0x29F9],
- ["81388A30",0x29FA],
- ["81388A31",0x29FB],
- ["81388A32",0x29FC],
- ["81388A33",0x29FD],
- ["81388A34",0x29FE],
- ["81388A35",0x29FF],
- ["81388A36",0x2A00],
- ["81388A37",0x2A01],
- ["81388A38",0x2A02],
- ["81388A39",0x2A03],
- ["81388B30",0x2A04],
- ["81388B31",0x2A05],
- ["81388B32",0x2A06],
- ["81388B33",0x2A07],
- ["81388B34",0x2A08],
- ["81388B35",0x2A09],
- ["81388B36",0x2A0A],
- ["81388B37",0x2A0B],
- ["81388B38",0x2A0C],
- ["81388B39",0x2A0D],
- ["81388C30",0x2A0E],
- ["81388C31",0x2A0F],
- ["81388C32",0x2A10],
- ["81388C33",0x2A11],
- ["81388C34",0x2A12],
- ["81388C35",0x2A13],
- ["81388C36",0x2A14],
- ["81388C37",0x2A15],
- ["81388C38",0x2A16],
- ["81388C39",0x2A17],
- ["81388D30",0x2A18],
- ["81388D31",0x2A19],
- ["81388D32",0x2A1A],
- ["81388D33",0x2A1B],
- ["81388D34",0x2A1C],
- ["81388D35",0x2A1D],
- ["81388D36",0x2A1E],
- ["81388D37",0x2A1F],
- ["81388D38",0x2A20],
- ["81388D39",0x2A21],
- ["81388E30",0x2A22],
- ["81388E31",0x2A23],
- ["81388E32",0x2A24],
- ["81388E33",0x2A25],
- ["81388E34",0x2A26],
- ["81388E35",0x2A27],
- ["81388E36",0x2A28],
- ["81388E37",0x2A29],
- ["81388E38",0x2A2A],
- ["81388E39",0x2A2B],
- ["81388F30",0x2A2C],
- ["81388F31",0x2A2D],
- ["81388F32",0x2A2E],
- ["81388F33",0x2A2F],
- ["81388F34",0x2A30],
- ["81388F35",0x2A31],
- ["81388F36",0x2A32],
- ["81388F37",0x2A33],
- ["81388F38",0x2A34],
- ["81388F39",0x2A35],
- ["81389030",0x2A36],
- ["81389031",0x2A37],
- ["81389032",0x2A38],
- ["81389033",0x2A39],
- ["81389034",0x2A3A],
- ["81389035",0x2A3B],
- ["81389036",0x2A3C],
- ["81389037",0x2A3D],
- ["81389038",0x2A3E],
- ["81389039",0x2A3F],
- ["81389130",0x2A40],
- ["81389131",0x2A41],
- ["81389132",0x2A42],
- ["81389133",0x2A43],
- ["81389134",0x2A44],
- ["81389135",0x2A45],
- ["81389136",0x2A46],
- ["81389137",0x2A47],
- ["81389138",0x2A48],
- ["81389139",0x2A49],
- ["81389230",0x2A4A],
- ["81389231",0x2A4B],
- ["81389232",0x2A4C],
- ["81389233",0x2A4D],
- ["81389234",0x2A4E],
- ["81389235",0x2A4F],
- ["81389236",0x2A50],
- ["81389237",0x2A51],
- ["81389238",0x2A52],
- ["81389239",0x2A53],
- ["81389330",0x2A54],
- ["81389331",0x2A55],
- ["81389332",0x2A56],
- ["81389333",0x2A57],
- ["81389334",0x2A58],
- ["81389335",0x2A59],
- ["81389336",0x2A5A],
- ["81389337",0x2A5B],
- ["81389338",0x2A5C],
- ["81389339",0x2A5D],
- ["81389430",0x2A5E],
- ["81389431",0x2A5F],
- ["81389432",0x2A60],
- ["81389433",0x2A61],
- ["81389434",0x2A62],
- ["81389435",0x2A63],
- ["81389436",0x2A64],
- ["81389437",0x2A65],
- ["81389438",0x2A66],
- ["81389439",0x2A67],
- ["81389530",0x2A68],
- ["81389531",0x2A69],
- ["81389532",0x2A6A],
- ["81389533",0x2A6B],
- ["81389534",0x2A6C],
- ["81389535",0x2A6D],
- ["81389536",0x2A6E],
- ["81389537",0x2A6F],
- ["81389538",0x2A70],
- ["81389539",0x2A71],
- ["81389630",0x2A72],
- ["81389631",0x2A73],
- ["81389632",0x2A74],
- ["81389633",0x2A75],
- ["81389634",0x2A76],
- ["81389635",0x2A77],
- ["81389636",0x2A78],
- ["81389637",0x2A79],
- ["81389638",0x2A7A],
- ["81389639",0x2A7B],
- ["81389730",0x2A7C],
- ["81389731",0x2A7D],
- ["81389732",0x2A7E],
- ["81389733",0x2A7F],
- ["81389734",0x2A80],
- ["81389735",0x2A81],
- ["81389736",0x2A82],
- ["81389737",0x2A83],
- ["81389738",0x2A84],
- ["81389739",0x2A85],
- ["81389830",0x2A86],
- ["81389831",0x2A87],
- ["81389832",0x2A88],
- ["81389833",0x2A89],
- ["81389834",0x2A8A],
- ["81389835",0x2A8B],
- ["81389836",0x2A8C],
- ["81389837",0x2A8D],
- ["81389838",0x2A8E],
- ["81389839",0x2A8F],
- ["81389930",0x2A90],
- ["81389931",0x2A91],
- ["81389932",0x2A92],
- ["81389933",0x2A93],
- ["81389934",0x2A94],
- ["81389935",0x2A95],
- ["81389936",0x2A96],
- ["81389937",0x2A97],
- ["81389938",0x2A98],
- ["81389939",0x2A99],
- ["81389A30",0x2A9A],
- ["81389A31",0x2A9B],
- ["81389A32",0x2A9C],
- ["81389A33",0x2A9D],
- ["81389A34",0x2A9E],
- ["81389A35",0x2A9F],
- ["81389A36",0x2AA0],
- ["81389A37",0x2AA1],
- ["81389A38",0x2AA2],
- ["81389A39",0x2AA3],
- ["81389B30",0x2AA4],
- ["81389B31",0x2AA5],
- ["81389B32",0x2AA6],
- ["81389B33",0x2AA7],
- ["81389B34",0x2AA8],
- ["81389B35",0x2AA9],
- ["81389B36",0x2AAA],
- ["81389B37",0x2AAB],
- ["81389B38",0x2AAC],
- ["81389B39",0x2AAD],
- ["81389C30",0x2AAE],
- ["81389C31",0x2AAF],
- ["81389C32",0x2AB0],
- ["81389C33",0x2AB1],
- ["81389C34",0x2AB2],
- ["81389C35",0x2AB3],
- ["81389C36",0x2AB4],
- ["81389C37",0x2AB5],
- ["81389C38",0x2AB6],
- ["81389C39",0x2AB7],
- ["81389D30",0x2AB8],
- ["81389D31",0x2AB9],
- ["81389D32",0x2ABA],
- ["81389D33",0x2ABB],
- ["81389D34",0x2ABC],
- ["81389D35",0x2ABD],
- ["81389D36",0x2ABE],
- ["81389D37",0x2ABF],
- ["81389D38",0x2AC0],
- ["81389D39",0x2AC1],
- ["81389E30",0x2AC2],
- ["81389E31",0x2AC3],
- ["81389E32",0x2AC4],
- ["81389E33",0x2AC5],
- ["81389E34",0x2AC6],
- ["81389E35",0x2AC7],
- ["81389E36",0x2AC8],
- ["81389E37",0x2AC9],
- ["81389E38",0x2ACA],
- ["81389E39",0x2ACB],
- ["81389F30",0x2ACC],
- ["81389F31",0x2ACD],
- ["81389F32",0x2ACE],
- ["81389F33",0x2ACF],
- ["81389F34",0x2AD0],
- ["81389F35",0x2AD1],
- ["81389F36",0x2AD2],
- ["81389F37",0x2AD3],
- ["81389F38",0x2AD4],
- ["81389F39",0x2AD5],
- ["8138A030",0x2AD6],
- ["8138A031",0x2AD7],
- ["8138A032",0x2AD8],
- ["8138A033",0x2AD9],
- ["8138A034",0x2ADA],
- ["8138A035",0x2ADB],
- ["8138A036",0x2ADC],
- ["8138A037",0x2ADD],
- ["8138A038",0x2ADE],
- ["8138A039",0x2ADF],
- ["8138A130",0x2AE0],
- ["8138A131",0x2AE1],
- ["8138A132",0x2AE2],
- ["8138A133",0x2AE3],
- ["8138A134",0x2AE4],
- ["8138A135",0x2AE5],
- ["8138A136",0x2AE6],
- ["8138A137",0x2AE7],
- ["8138A138",0x2AE8],
- ["8138A139",0x2AE9],
- ["8138A230",0x2AEA],
- ["8138A231",0x2AEB],
- ["8138A232",0x2AEC],
- ["8138A233",0x2AED],
- ["8138A234",0x2AEE],
- ["8138A235",0x2AEF],
- ["8138A236",0x2AF0],
- ["8138A237",0x2AF1],
- ["8138A238",0x2AF2],
- ["8138A239",0x2AF3],
- ["8138A330",0x2AF4],
- ["8138A331",0x2AF5],
- ["8138A332",0x2AF6],
- ["8138A333",0x2AF7],
- ["8138A334",0x2AF8],
- ["8138A335",0x2AF9],
- ["8138A336",0x2AFA],
- ["8138A337",0x2AFB],
- ["8138A338",0x2AFC],
- ["8138A339",0x2AFD],
- ["8138A430",0x2AFE],
- ["8138A431",0x2AFF],
- ["8138A432",0x2B00],
- ["8138A433",0x2B01],
- ["8138A434",0x2B02],
- ["8138A435",0x2B03],
- ["8138A436",0x2B04],
- ["8138A437",0x2B05],
- ["8138A438",0x2B06],
- ["8138A439",0x2B07],
- ["8138A530",0x2B08],
- ["8138A531",0x2B09],
- ["8138A532",0x2B0A],
- ["8138A533",0x2B0B],
- ["8138A534",0x2B0C],
- ["8138A535",0x2B0D],
- ["8138A536",0x2B0E],
- ["8138A537",0x2B0F],
- ["8138A538",0x2B10],
- ["8138A539",0x2B11],
- ["8138A630",0x2B12],
- ["8138A631",0x2B13],
- ["8138A632",0x2B14],
- ["8138A633",0x2B15],
- ["8138A634",0x2B16],
- ["8138A635",0x2B17],
- ["8138A636",0x2B18],
- ["8138A637",0x2B19],
- ["8138A638",0x2B1A],
- ["8138A639",0x2B1B],
- ["8138A730",0x2B1C],
- ["8138A731",0x2B1D],
- ["8138A732",0x2B1E],
- ["8138A733",0x2B1F],
- ["8138A734",0x2B20],
- ["8138A735",0x2B21],
- ["8138A736",0x2B22],
- ["8138A737",0x2B23],
- ["8138A738",0x2B24],
- ["8138A739",0x2B25],
- ["8138A830",0x2B26],
- ["8138A831",0x2B27],
- ["8138A832",0x2B28],
- ["8138A833",0x2B29],
- ["8138A834",0x2B2A],
- ["8138A835",0x2B2B],
- ["8138A836",0x2B2C],
- ["8138A837",0x2B2D],
- ["8138A838",0x2B2E],
- ["8138A839",0x2B2F],
- ["8138A930",0x2B30],
- ["8138A931",0x2B31],
- ["8138A932",0x2B32],
- ["8138A933",0x2B33],
- ["8138A934",0x2B34],
- ["8138A935",0x2B35],
- ["8138A936",0x2B36],
- ["8138A937",0x2B37],
- ["8138A938",0x2B38],
- ["8138A939",0x2B39],
- ["8138AA30",0x2B3A],
- ["8138AA31",0x2B3B],
- ["8138AA32",0x2B3C],
- ["8138AA33",0x2B3D],
- ["8138AA34",0x2B3E],
- ["8138AA35",0x2B3F],
- ["8138AA36",0x2B40],
- ["8138AA37",0x2B41],
- ["8138AA38",0x2B42],
- ["8138AA39",0x2B43],
- ["8138AB30",0x2B44],
- ["8138AB31",0x2B45],
- ["8138AB32",0x2B46],
- ["8138AB33",0x2B47],
- ["8138AB34",0x2B48],
- ["8138AB35",0x2B49],
- ["8138AB36",0x2B4A],
- ["8138AB37",0x2B4B],
- ["8138AB38",0x2B4C],
- ["8138AB39",0x2B4D],
- ["8138AC30",0x2B4E],
- ["8138AC31",0x2B4F],
- ["8138AC32",0x2B50],
- ["8138AC33",0x2B51],
- ["8138AC34",0x2B52],
- ["8138AC35",0x2B53],
- ["8138AC36",0x2B54],
- ["8138AC37",0x2B55],
- ["8138AC38",0x2B56],
- ["8138AC39",0x2B57],
- ["8138AD30",0x2B58],
- ["8138AD31",0x2B59],
- ["8138AD32",0x2B5A],
- ["8138AD33",0x2B5B],
- ["8138AD34",0x2B5C],
- ["8138AD35",0x2B5D],
- ["8138AD36",0x2B5E],
- ["8138AD37",0x2B5F],
- ["8138AD38",0x2B60],
- ["8138AD39",0x2B61],
- ["8138AE30",0x2B62],
- ["8138AE31",0x2B63],
- ["8138AE32",0x2B64],
- ["8138AE33",0x2B65],
- ["8138AE34",0x2B66],
- ["8138AE35",0x2B67],
- ["8138AE36",0x2B68],
- ["8138AE37",0x2B69],
- ["8138AE38",0x2B6A],
- ["8138AE39",0x2B6B],
- ["8138AF30",0x2B6C],
- ["8138AF31",0x2B6D],
- ["8138AF32",0x2B6E],
- ["8138AF33",0x2B6F],
- ["8138AF34",0x2B70],
- ["8138AF35",0x2B71],
- ["8138AF36",0x2B72],
- ["8138AF37",0x2B73],
- ["8138AF38",0x2B74],
- ["8138AF39",0x2B75],
- ["8138B030",0x2B76],
- ["8138B031",0x2B77],
- ["8138B032",0x2B78],
- ["8138B033",0x2B79],
- ["8138B034",0x2B7A],
- ["8138B035",0x2B7B],
- ["8138B036",0x2B7C],
- ["8138B037",0x2B7D],
- ["8138B038",0x2B7E],
- ["8138B039",0x2B7F],
- ["8138B130",0x2B80],
- ["8138B131",0x2B81],
- ["8138B132",0x2B82],
- ["8138B133",0x2B83],
- ["8138B134",0x2B84],
- ["8138B135",0x2B85],
- ["8138B136",0x2B86],
- ["8138B137",0x2B87],
- ["8138B138",0x2B88],
- ["8138B139",0x2B89],
- ["8138B230",0x2B8A],
- ["8138B231",0x2B8B],
- ["8138B232",0x2B8C],
- ["8138B233",0x2B8D],
- ["8138B234",0x2B8E],
- ["8138B235",0x2B8F],
- ["8138B236",0x2B90],
- ["8138B237",0x2B91],
- ["8138B238",0x2B92],
- ["8138B239",0x2B93],
- ["8138B330",0x2B94],
- ["8138B331",0x2B95],
- ["8138B332",0x2B96],
- ["8138B333",0x2B97],
- ["8138B334",0x2B98],
- ["8138B335",0x2B99],
- ["8138B336",0x2B9A],
- ["8138B337",0x2B9B],
- ["8138B338",0x2B9C],
- ["8138B339",0x2B9D],
- ["8138B430",0x2B9E],
- ["8138B431",0x2B9F],
- ["8138B432",0x2BA0],
- ["8138B433",0x2BA1],
- ["8138B434",0x2BA2],
- ["8138B435",0x2BA3],
- ["8138B436",0x2BA4],
- ["8138B437",0x2BA5],
- ["8138B438",0x2BA6],
- ["8138B439",0x2BA7],
- ["8138B530",0x2BA8],
- ["8138B531",0x2BA9],
- ["8138B532",0x2BAA],
- ["8138B533",0x2BAB],
- ["8138B534",0x2BAC],
- ["8138B535",0x2BAD],
- ["8138B536",0x2BAE],
- ["8138B537",0x2BAF],
- ["8138B538",0x2BB0],
- ["8138B539",0x2BB1],
- ["8138B630",0x2BB2],
- ["8138B631",0x2BB3],
- ["8138B632",0x2BB4],
- ["8138B633",0x2BB5],
- ["8138B634",0x2BB6],
- ["8138B635",0x2BB7],
- ["8138B636",0x2BB8],
- ["8138B637",0x2BB9],
- ["8138B638",0x2BBA],
- ["8138B639",0x2BBB],
- ["8138B730",0x2BBC],
- ["8138B731",0x2BBD],
- ["8138B732",0x2BBE],
- ["8138B733",0x2BBF],
- ["8138B734",0x2BC0],
- ["8138B735",0x2BC1],
- ["8138B736",0x2BC2],
- ["8138B737",0x2BC3],
- ["8138B738",0x2BC4],
- ["8138B739",0x2BC5],
- ["8138B830",0x2BC6],
- ["8138B831",0x2BC7],
- ["8138B832",0x2BC8],
- ["8138B833",0x2BC9],
- ["8138B834",0x2BCA],
- ["8138B835",0x2BCB],
- ["8138B836",0x2BCC],
- ["8138B837",0x2BCD],
- ["8138B838",0x2BCE],
- ["8138B839",0x2BCF],
- ["8138B930",0x2BD0],
- ["8138B931",0x2BD1],
- ["8138B932",0x2BD2],
- ["8138B933",0x2BD3],
- ["8138B934",0x2BD4],
- ["8138B935",0x2BD5],
- ["8138B936",0x2BD6],
- ["8138B937",0x2BD7],
- ["8138B938",0x2BD8],
- ["8138B939",0x2BD9],
- ["8138BA30",0x2BDA],
- ["8138BA31",0x2BDB],
- ["8138BA32",0x2BDC],
- ["8138BA33",0x2BDD],
- ["8138BA34",0x2BDE],
- ["8138BA35",0x2BDF],
- ["8138BA36",0x2BE0],
- ["8138BA37",0x2BE1],
- ["8138BA38",0x2BE2],
- ["8138BA39",0x2BE3],
- ["8138BB30",0x2BE4],
- ["8138BB31",0x2BE5],
- ["8138BB32",0x2BE6],
- ["8138BB33",0x2BE7],
- ["8138BB34",0x2BE8],
- ["8138BB35",0x2BE9],
- ["8138BB36",0x2BEA],
- ["8138BB37",0x2BEB],
- ["8138BB38",0x2BEC],
- ["8138BB39",0x2BED],
- ["8138BC30",0x2BEE],
- ["8138BC31",0x2BEF],
- ["8138BC32",0x2BF0],
- ["8138BC33",0x2BF1],
- ["8138BC34",0x2BF2],
- ["8138BC35",0x2BF3],
- ["8138BC36",0x2BF4],
- ["8138BC37",0x2BF5],
- ["8138BC38",0x2BF6],
- ["8138BC39",0x2BF7],
- ["8138BD30",0x2BF8],
- ["8138BD31",0x2BF9],
- ["8138BD32",0x2BFA],
- ["8138BD33",0x2BFB],
- ["8138BD34",0x2BFC],
- ["8138BD35",0x2BFD],
- ["8138BD36",0x2BFE],
- ["8138BD37",0x2BFF],
- ["8138BD38",0x2C00],
- ["8138BD39",0x2C01],
- ["8138BE30",0x2C02],
- ["8138BE31",0x2C03],
- ["8138BE32",0x2C04],
- ["8138BE33",0x2C05],
- ["8138BE34",0x2C06],
- ["8138BE35",0x2C07],
- ["8138BE36",0x2C08],
- ["8138BE37",0x2C09],
- ["8138BE38",0x2C0A],
- ["8138BE39",0x2C0B],
- ["8138BF30",0x2C0C],
- ["8138BF31",0x2C0D],
- ["8138BF32",0x2C0E],
- ["8138BF33",0x2C0F],
- ["8138BF34",0x2C10],
- ["8138BF35",0x2C11],
- ["8138BF36",0x2C12],
- ["8138BF37",0x2C13],
- ["8138BF38",0x2C14],
- ["8138BF39",0x2C15],
- ["8138C030",0x2C16],
- ["8138C031",0x2C17],
- ["8138C032",0x2C18],
- ["8138C033",0x2C19],
- ["8138C034",0x2C1A],
- ["8138C035",0x2C1B],
- ["8138C036",0x2C1C],
- ["8138C037",0x2C1D],
- ["8138C038",0x2C1E],
- ["8138C039",0x2C1F],
- ["8138C130",0x2C20],
- ["8138C131",0x2C21],
- ["8138C132",0x2C22],
- ["8138C133",0x2C23],
- ["8138C134",0x2C24],
- ["8138C135",0x2C25],
- ["8138C136",0x2C26],
- ["8138C137",0x2C27],
- ["8138C138",0x2C28],
- ["8138C139",0x2C29],
- ["8138C230",0x2C2A],
- ["8138C231",0x2C2B],
- ["8138C232",0x2C2C],
- ["8138C233",0x2C2D],
- ["8138C234",0x2C2E],
- ["8138C235",0x2C2F],
- ["8138C236",0x2C30],
- ["8138C237",0x2C31],
- ["8138C238",0x2C32],
- ["8138C239",0x2C33],
- ["8138C330",0x2C34],
- ["8138C331",0x2C35],
- ["8138C332",0x2C36],
- ["8138C333",0x2C37],
- ["8138C334",0x2C38],
- ["8138C335",0x2C39],
- ["8138C336",0x2C3A],
- ["8138C337",0x2C3B],
- ["8138C338",0x2C3C],
- ["8138C339",0x2C3D],
- ["8138C430",0x2C3E],
- ["8138C431",0x2C3F],
- ["8138C432",0x2C40],
- ["8138C433",0x2C41],
- ["8138C434",0x2C42],
- ["8138C435",0x2C43],
- ["8138C436",0x2C44],
- ["8138C437",0x2C45],
- ["8138C438",0x2C46],
- ["8138C439",0x2C47],
- ["8138C530",0x2C48],
- ["8138C531",0x2C49],
- ["8138C532",0x2C4A],
- ["8138C533",0x2C4B],
- ["8138C534",0x2C4C],
- ["8138C535",0x2C4D],
- ["8138C536",0x2C4E],
- ["8138C537",0x2C4F],
- ["8138C538",0x2C50],
- ["8138C539",0x2C51],
- ["8138C630",0x2C52],
- ["8138C631",0x2C53],
- ["8138C632",0x2C54],
- ["8138C633",0x2C55],
- ["8138C634",0x2C56],
- ["8138C635",0x2C57],
- ["8138C636",0x2C58],
- ["8138C637",0x2C59],
- ["8138C638",0x2C5A],
- ["8138C639",0x2C5B],
- ["8138C730",0x2C5C],
- ["8138C731",0x2C5D],
- ["8138C732",0x2C5E],
- ["8138C733",0x2C5F],
- ["8138C734",0x2C60],
- ["8138C735",0x2C61],
- ["8138C736",0x2C62],
- ["8138C737",0x2C63],
- ["8138C738",0x2C64],
- ["8138C739",0x2C65],
- ["8138C830",0x2C66],
- ["8138C831",0x2C67],
- ["8138C832",0x2C68],
- ["8138C833",0x2C69],
- ["8138C834",0x2C6A],
- ["8138C835",0x2C6B],
- ["8138C836",0x2C6C],
- ["8138C837",0x2C6D],
- ["8138C838",0x2C6E],
- ["8138C839",0x2C6F],
- ["8138C930",0x2C70],
- ["8138C931",0x2C71],
- ["8138C932",0x2C72],
- ["8138C933",0x2C73],
- ["8138C934",0x2C74],
- ["8138C935",0x2C75],
- ["8138C936",0x2C76],
- ["8138C937",0x2C77],
- ["8138C938",0x2C78],
- ["8138C939",0x2C79],
- ["8138CA30",0x2C7A],
- ["8138CA31",0x2C7B],
- ["8138CA32",0x2C7C],
- ["8138CA33",0x2C7D],
- ["8138CA34",0x2C7E],
- ["8138CA35",0x2C7F],
- ["8138CA36",0x2C80],
- ["8138CA37",0x2C81],
- ["8138CA38",0x2C82],
- ["8138CA39",0x2C83],
- ["8138CB30",0x2C84],
- ["8138CB31",0x2C85],
- ["8138CB32",0x2C86],
- ["8138CB33",0x2C87],
- ["8138CB34",0x2C88],
- ["8138CB35",0x2C89],
- ["8138CB36",0x2C8A],
- ["8138CB37",0x2C8B],
- ["8138CB38",0x2C8C],
- ["8138CB39",0x2C8D],
- ["8138CC30",0x2C8E],
- ["8138CC31",0x2C8F],
- ["8138CC32",0x2C90],
- ["8138CC33",0x2C91],
- ["8138CC34",0x2C92],
- ["8138CC35",0x2C93],
- ["8138CC36",0x2C94],
- ["8138CC37",0x2C95],
- ["8138CC38",0x2C96],
- ["8138CC39",0x2C97],
- ["8138CD30",0x2C98],
- ["8138CD31",0x2C99],
- ["8138CD32",0x2C9A],
- ["8138CD33",0x2C9B],
- ["8138CD34",0x2C9C],
- ["8138CD35",0x2C9D],
- ["8138CD36",0x2C9E],
- ["8138CD37",0x2C9F],
- ["8138CD38",0x2CA0],
- ["8138CD39",0x2CA1],
- ["8138CE30",0x2CA2],
- ["8138CE31",0x2CA3],
- ["8138CE32",0x2CA4],
- ["8138CE33",0x2CA5],
- ["8138CE34",0x2CA6],
- ["8138CE35",0x2CA7],
- ["8138CE36",0x2CA8],
- ["8138CE37",0x2CA9],
- ["8138CE38",0x2CAA],
- ["8138CE39",0x2CAB],
- ["8138CF30",0x2CAC],
- ["8138CF31",0x2CAD],
- ["8138CF32",0x2CAE],
- ["8138CF33",0x2CAF],
- ["8138CF34",0x2CB0],
- ["8138CF35",0x2CB1],
- ["8138CF36",0x2CB2],
- ["8138CF37",0x2CB3],
- ["8138CF38",0x2CB4],
- ["8138CF39",0x2CB5],
- ["8138D030",0x2CB6],
- ["8138D031",0x2CB7],
- ["8138D032",0x2CB8],
- ["8138D033",0x2CB9],
- ["8138D034",0x2CBA],
- ["8138D035",0x2CBB],
- ["8138D036",0x2CBC],
- ["8138D037",0x2CBD],
- ["8138D038",0x2CBE],
- ["8138D039",0x2CBF],
- ["8138D130",0x2CC0],
- ["8138D131",0x2CC1],
- ["8138D132",0x2CC2],
- ["8138D133",0x2CC3],
- ["8138D134",0x2CC4],
- ["8138D135",0x2CC5],
- ["8138D136",0x2CC6],
- ["8138D137",0x2CC7],
- ["8138D138",0x2CC8],
- ["8138D139",0x2CC9],
- ["8138D230",0x2CCA],
- ["8138D231",0x2CCB],
- ["8138D232",0x2CCC],
- ["8138D233",0x2CCD],
- ["8138D234",0x2CCE],
- ["8138D235",0x2CCF],
- ["8138D236",0x2CD0],
- ["8138D237",0x2CD1],
- ["8138D238",0x2CD2],
- ["8138D239",0x2CD3],
- ["8138D330",0x2CD4],
- ["8138D331",0x2CD5],
- ["8138D332",0x2CD6],
- ["8138D333",0x2CD7],
- ["8138D334",0x2CD8],
- ["8138D335",0x2CD9],
- ["8138D336",0x2CDA],
- ["8138D337",0x2CDB],
- ["8138D338",0x2CDC],
- ["8138D339",0x2CDD],
- ["8138D430",0x2CDE],
- ["8138D431",0x2CDF],
- ["8138D432",0x2CE0],
- ["8138D433",0x2CE1],
- ["8138D434",0x2CE2],
- ["8138D435",0x2CE3],
- ["8138D436",0x2CE4],
- ["8138D437",0x2CE5],
- ["8138D438",0x2CE6],
- ["8138D439",0x2CE7],
- ["8138D530",0x2CE8],
- ["8138D531",0x2CE9],
- ["8138D532",0x2CEA],
- ["8138D533",0x2CEB],
- ["8138D534",0x2CEC],
- ["8138D535",0x2CED],
- ["8138D536",0x2CEE],
- ["8138D537",0x2CEF],
- ["8138D538",0x2CF0],
- ["8138D539",0x2CF1],
- ["8138D630",0x2CF2],
- ["8138D631",0x2CF3],
- ["8138D632",0x2CF4],
- ["8138D633",0x2CF5],
- ["8138D634",0x2CF6],
- ["8138D635",0x2CF7],
- ["8138D636",0x2CF8],
- ["8138D637",0x2CF9],
- ["8138D638",0x2CFA],
- ["8138D639",0x2CFB],
- ["8138D730",0x2CFC],
- ["8138D731",0x2CFD],
- ["8138D732",0x2CFE],
- ["8138D733",0x2CFF],
- ["8138D734",0x2D00],
- ["8138D735",0x2D01],
- ["8138D736",0x2D02],
- ["8138D737",0x2D03],
- ["8138D738",0x2D04],
- ["8138D739",0x2D05],
- ["8138D830",0x2D06],
- ["8138D831",0x2D07],
- ["8138D832",0x2D08],
- ["8138D833",0x2D09],
- ["8138D834",0x2D0A],
- ["8138D835",0x2D0B],
- ["8138D836",0x2D0C],
- ["8138D837",0x2D0D],
- ["8138D838",0x2D0E],
- ["8138D839",0x2D0F],
- ["8138D930",0x2D10],
- ["8138D931",0x2D11],
- ["8138D932",0x2D12],
- ["8138D933",0x2D13],
- ["8138D934",0x2D14],
- ["8138D935",0x2D15],
- ["8138D936",0x2D16],
- ["8138D937",0x2D17],
- ["8138D938",0x2D18],
- ["8138D939",0x2D19],
- ["8138DA30",0x2D1A],
- ["8138DA31",0x2D1B],
- ["8138DA32",0x2D1C],
- ["8138DA33",0x2D1D],
- ["8138DA34",0x2D1E],
- ["8138DA35",0x2D1F],
- ["8138DA36",0x2D20],
- ["8138DA37",0x2D21],
- ["8138DA38",0x2D22],
- ["8138DA39",0x2D23],
- ["8138DB30",0x2D24],
- ["8138DB31",0x2D25],
- ["8138DB32",0x2D26],
- ["8138DB33",0x2D27],
- ["8138DB34",0x2D28],
- ["8138DB35",0x2D29],
- ["8138DB36",0x2D2A],
- ["8138DB37",0x2D2B],
- ["8138DB38",0x2D2C],
- ["8138DB39",0x2D2D],
- ["8138DC30",0x2D2E],
- ["8138DC31",0x2D2F],
- ["8138DC32",0x2D30],
- ["8138DC33",0x2D31],
- ["8138DC34",0x2D32],
- ["8138DC35",0x2D33],
- ["8138DC36",0x2D34],
- ["8138DC37",0x2D35],
- ["8138DC38",0x2D36],
- ["8138DC39",0x2D37],
- ["8138DD30",0x2D38],
- ["8138DD31",0x2D39],
- ["8138DD32",0x2D3A],
- ["8138DD33",0x2D3B],
- ["8138DD34",0x2D3C],
- ["8138DD35",0x2D3D],
- ["8138DD36",0x2D3E],
- ["8138DD37",0x2D3F],
- ["8138DD38",0x2D40],
- ["8138DD39",0x2D41],
- ["8138DE30",0x2D42],
- ["8138DE31",0x2D43],
- ["8138DE32",0x2D44],
- ["8138DE33",0x2D45],
- ["8138DE34",0x2D46],
- ["8138DE35",0x2D47],
- ["8138DE36",0x2D48],
- ["8138DE37",0x2D49],
- ["8138DE38",0x2D4A],
- ["8138DE39",0x2D4B],
- ["8138DF30",0x2D4C],
- ["8138DF31",0x2D4D],
- ["8138DF32",0x2D4E],
- ["8138DF33",0x2D4F],
- ["8138DF34",0x2D50],
- ["8138DF35",0x2D51],
- ["8138DF36",0x2D52],
- ["8138DF37",0x2D53],
- ["8138DF38",0x2D54],
- ["8138DF39",0x2D55],
- ["8138E030",0x2D56],
- ["8138E031",0x2D57],
- ["8138E032",0x2D58],
- ["8138E033",0x2D59],
- ["8138E034",0x2D5A],
- ["8138E035",0x2D5B],
- ["8138E036",0x2D5C],
- ["8138E037",0x2D5D],
- ["8138E038",0x2D5E],
- ["8138E039",0x2D5F],
- ["8138E130",0x2D60],
- ["8138E131",0x2D61],
- ["8138E132",0x2D62],
- ["8138E133",0x2D63],
- ["8138E134",0x2D64],
- ["8138E135",0x2D65],
- ["8138E136",0x2D66],
- ["8138E137",0x2D67],
- ["8138E138",0x2D68],
- ["8138E139",0x2D69],
- ["8138E230",0x2D6A],
- ["8138E231",0x2D6B],
- ["8138E232",0x2D6C],
- ["8138E233",0x2D6D],
- ["8138E234",0x2D6E],
- ["8138E235",0x2D6F],
- ["8138E236",0x2D70],
- ["8138E237",0x2D71],
- ["8138E238",0x2D72],
- ["8138E239",0x2D73],
- ["8138E330",0x2D74],
- ["8138E331",0x2D75],
- ["8138E332",0x2D76],
- ["8138E333",0x2D77],
- ["8138E334",0x2D78],
- ["8138E335",0x2D79],
- ["8138E336",0x2D7A],
- ["8138E337",0x2D7B],
- ["8138E338",0x2D7C],
- ["8138E339",0x2D7D],
- ["8138E430",0x2D7E],
- ["8138E431",0x2D7F],
- ["8138E432",0x2D80],
- ["8138E433",0x2D81],
- ["8138E434",0x2D82],
- ["8138E435",0x2D83],
- ["8138E436",0x2D84],
- ["8138E437",0x2D85],
- ["8138E438",0x2D86],
- ["8138E439",0x2D87],
- ["8138E530",0x2D88],
- ["8138E531",0x2D89],
- ["8138E532",0x2D8A],
- ["8138E533",0x2D8B],
- ["8138E534",0x2D8C],
- ["8138E535",0x2D8D],
- ["8138E536",0x2D8E],
- ["8138E537",0x2D8F],
- ["8138E538",0x2D90],
- ["8138E539",0x2D91],
- ["8138E630",0x2D92],
- ["8138E631",0x2D93],
- ["8138E632",0x2D94],
- ["8138E633",0x2D95],
- ["8138E634",0x2D96],
- ["8138E635",0x2D97],
- ["8138E636",0x2D98],
- ["8138E637",0x2D99],
- ["8138E638",0x2D9A],
- ["8138E639",0x2D9B],
- ["8138E730",0x2D9C],
- ["8138E731",0x2D9D],
- ["8138E732",0x2D9E],
- ["8138E733",0x2D9F],
- ["8138E734",0x2DA0],
- ["8138E735",0x2DA1],
- ["8138E736",0x2DA2],
- ["8138E737",0x2DA3],
- ["8138E738",0x2DA4],
- ["8138E739",0x2DA5],
- ["8138E830",0x2DA6],
- ["8138E831",0x2DA7],
- ["8138E832",0x2DA8],
- ["8138E833",0x2DA9],
- ["8138E834",0x2DAA],
- ["8138E835",0x2DAB],
- ["8138E836",0x2DAC],
- ["8138E837",0x2DAD],
- ["8138E838",0x2DAE],
- ["8138E839",0x2DAF],
- ["8138E930",0x2DB0],
- ["8138E931",0x2DB1],
- ["8138E932",0x2DB2],
- ["8138E933",0x2DB3],
- ["8138E934",0x2DB4],
- ["8138E935",0x2DB5],
- ["8138E936",0x2DB6],
- ["8138E937",0x2DB7],
- ["8138E938",0x2DB8],
- ["8138E939",0x2DB9],
- ["8138EA30",0x2DBA],
- ["8138EA31",0x2DBB],
- ["8138EA32",0x2DBC],
- ["8138EA33",0x2DBD],
- ["8138EA34",0x2DBE],
- ["8138EA35",0x2DBF],
- ["8138EA36",0x2DC0],
- ["8138EA37",0x2DC1],
- ["8138EA38",0x2DC2],
- ["8138EA39",0x2DC3],
- ["8138EB30",0x2DC4],
- ["8138EB31",0x2DC5],
- ["8138EB32",0x2DC6],
- ["8138EB33",0x2DC7],
- ["8138EB34",0x2DC8],
- ["8138EB35",0x2DC9],
- ["8138EB36",0x2DCA],
- ["8138EB37",0x2DCB],
- ["8138EB38",0x2DCC],
- ["8138EB39",0x2DCD],
- ["8138EC30",0x2DCE],
- ["8138EC31",0x2DCF],
- ["8138EC32",0x2DD0],
- ["8138EC33",0x2DD1],
- ["8138EC34",0x2DD2],
- ["8138EC35",0x2DD3],
- ["8138EC36",0x2DD4],
- ["8138EC37",0x2DD5],
- ["8138EC38",0x2DD6],
- ["8138EC39",0x2DD7],
- ["8138ED30",0x2DD8],
- ["8138ED31",0x2DD9],
- ["8138ED32",0x2DDA],
- ["8138ED33",0x2DDB],
- ["8138ED34",0x2DDC],
- ["8138ED35",0x2DDD],
- ["8138ED36",0x2DDE],
- ["8138ED37",0x2DDF],
- ["8138ED38",0x2DE0],
- ["8138ED39",0x2DE1],
- ["8138EE30",0x2DE2],
- ["8138EE31",0x2DE3],
- ["8138EE32",0x2DE4],
- ["8138EE33",0x2DE5],
- ["8138EE34",0x2DE6],
- ["8138EE35",0x2DE7],
- ["8138EE36",0x2DE8],
- ["8138EE37",0x2DE9],
- ["8138EE38",0x2DEA],
- ["8138EE39",0x2DEB],
- ["8138EF30",0x2DEC],
- ["8138EF31",0x2DED],
- ["8138EF32",0x2DEE],
- ["8138EF33",0x2DEF],
- ["8138EF34",0x2DF0],
- ["8138EF35",0x2DF1],
- ["8138EF36",0x2DF2],
- ["8138EF37",0x2DF3],
- ["8138EF38",0x2DF4],
- ["8138EF39",0x2DF5],
- ["8138F030",0x2DF6],
- ["8138F031",0x2DF7],
- ["8138F032",0x2DF8],
- ["8138F033",0x2DF9],
- ["8138F034",0x2DFA],
- ["8138F035",0x2DFB],
- ["8138F036",0x2DFC],
- ["8138F037",0x2DFD],
- ["8138F038",0x2DFE],
- ["8138F039",0x2DFF],
- ["8138F130",0x2E00],
- ["8138F131",0x2E01],
- ["8138F132",0x2E02],
- ["8138F133",0x2E03],
- ["8138F134",0x2E04],
- ["8138F135",0x2E05],
- ["8138F136",0x2E06],
- ["8138F137",0x2E07],
- ["8138F138",0x2E08],
- ["8138F139",0x2E09],
- ["8138F230",0x2E0A],
- ["8138F231",0x2E0B],
- ["8138F232",0x2E0C],
- ["8138F233",0x2E0D],
- ["8138F234",0x2E0E],
- ["8138F235",0x2E0F],
- ["8138F236",0x2E10],
- ["8138F237",0x2E11],
- ["8138F238",0x2E12],
- ["8138F239",0x2E13],
- ["8138F330",0x2E14],
- ["8138F331",0x2E15],
- ["8138F332",0x2E16],
- ["8138F333",0x2E17],
- ["8138F334",0x2E18],
- ["8138F335",0x2E19],
- ["8138F336",0x2E1A],
- ["8138F337",0x2E1B],
- ["8138F338",0x2E1C],
- ["8138F339",0x2E1D],
- ["8138F430",0x2E1E],
- ["8138F431",0x2E1F],
- ["8138F432",0x2E20],
- ["8138F433",0x2E21],
- ["8138F434",0x2E22],
- ["8138F435",0x2E23],
- ["8138F436",0x2E24],
- ["8138F437",0x2E25],
- ["8138F438",0x2E26],
- ["8138F439",0x2E27],
- ["8138F530",0x2E28],
- ["8138F531",0x2E29],
- ["8138F532",0x2E2A],
- ["8138F533",0x2E2B],
- ["8138F534",0x2E2C],
- ["8138F535",0x2E2D],
- ["8138F536",0x2E2E],
- ["8138F537",0x2E2F],
- ["8138F538",0x2E30],
- ["8138F539",0x2E31],
- ["8138F630",0x2E32],
- ["8138F631",0x2E33],
- ["8138F632",0x2E34],
- ["8138F633",0x2E35],
- ["8138F634",0x2E36],
- ["8138F635",0x2E37],
- ["8138F636",0x2E38],
- ["8138F637",0x2E39],
- ["8138F638",0x2E3A],
- ["8138F639",0x2E3B],
- ["8138F730",0x2E3C],
- ["8138F731",0x2E3D],
- ["8138F732",0x2E3E],
- ["8138F733",0x2E3F],
- ["8138F734",0x2E40],
- ["8138F735",0x2E41],
- ["8138F736",0x2E42],
- ["8138F737",0x2E43],
- ["8138F738",0x2E44],
- ["8138F739",0x2E45],
- ["8138F830",0x2E46],
- ["8138F831",0x2E47],
- ["8138F832",0x2E48],
- ["8138F833",0x2E49],
- ["8138F834",0x2E4A],
- ["8138F835",0x2E4B],
- ["8138F836",0x2E4C],
- ["8138F837",0x2E4D],
- ["8138F838",0x2E4E],
- ["8138F839",0x2E4F],
- ["8138F930",0x2E50],
- ["8138F931",0x2E51],
- ["8138F932",0x2E52],
- ["8138F933",0x2E53],
- ["8138F934",0x2E54],
- ["8138F935",0x2E55],
- ["8138F936",0x2E56],
- ["8138F937",0x2E57],
- ["8138F938",0x2E58],
- ["8138F939",0x2E59],
- ["8138FA30",0x2E5A],
- ["8138FA31",0x2E5B],
- ["8138FA32",0x2E5C],
- ["8138FA33",0x2E5D],
- ["8138FA34",0x2E5E],
- ["8138FA35",0x2E5F],
- ["8138FA36",0x2E60],
- ["8138FA37",0x2E61],
- ["8138FA38",0x2E62],
- ["8138FA39",0x2E63],
- ["8138FB30",0x2E64],
- ["8138FB31",0x2E65],
- ["8138FB32",0x2E66],
- ["8138FB33",0x2E67],
- ["8138FB34",0x2E68],
- ["8138FB35",0x2E69],
- ["8138FB36",0x2E6A],
- ["8138FB37",0x2E6B],
- ["8138FB38",0x2E6C],
- ["8138FB39",0x2E6D],
- ["8138FC30",0x2E6E],
- ["8138FC31",0x2E6F],
- ["8138FC32",0x2E70],
- ["8138FC33",0x2E71],
- ["8138FC34",0x2E72],
- ["8138FC35",0x2E73],
- ["8138FC36",0x2E74],
- ["8138FC37",0x2E75],
- ["8138FC38",0x2E76],
- ["8138FC39",0x2E77],
- ["8138FD30",0x2E78],
- ["8138FD31",0x2E79],
- ["8138FD32",0x2E7A],
- ["8138FD33",0x2E7B],
- ["8138FD34",0x2E7C],
- ["8138FD35",0x2E7D],
- ["8138FD36",0x2E7E],
- ["8138FD37",0x2E7F],
- ["8138FD38",0x2E80],
- ["FE50",0x2E81],
- ["8138FD39",0x2E82],
- ["8138FE30",0x2E83],
- ["FE54",0x2E84],
- ["8138FE31",0x2E85],
- ["8138FE32",0x2E86],
- ["8138FE33",0x2E87],
- ["FE57",0x2E88],
- ["8138FE34",0x2E89],
- ["8138FE35",0x2E8A],
- ["FE58",0x2E8B],
- ["FE5D",0x2E8C],
- ["8138FE36",0x2E8D],
- ["8138FE37",0x2E8E],
- ["8138FE38",0x2E8F],
- ["8138FE39",0x2E90],
- ["81398130",0x2E91],
- ["81398131",0x2E92],
- ["81398132",0x2E93],
- ["81398133",0x2E94],
- ["81398134",0x2E95],
- ["81398135",0x2E96],
- ["FE5E",0x2E97],
- ["81398136",0x2E98],
- ["81398137",0x2E99],
- ["81398138",0x2E9A],
- ["81398139",0x2E9B],
- ["81398230",0x2E9C],
- ["81398231",0x2E9D],
- ["81398232",0x2E9E],
- ["81398233",0x2E9F],
- ["81398234",0x2EA0],
- ["81398235",0x2EA1],
- ["81398236",0x2EA2],
- ["81398237",0x2EA3],
- ["81398238",0x2EA4],
- ["81398239",0x2EA5],
- ["81398330",0x2EA6],
- ["FE6B",0x2EA7],
- ["81398331",0x2EA8],
- ["81398332",0x2EA9],
- ["FE6E",0x2EAA],
- ["81398333",0x2EAB],
- ["81398334",0x2EAC],
- ["81398335",0x2EAD],
- ["FE71",0x2EAE],
- ["81398336",0x2EAF],
- ["81398337",0x2EB0],
- ["81398338",0x2EB1],
- ["81398339",0x2EB2],
- ["FE73",0x2EB3],
- ["81398430",0x2EB4],
- ["81398431",0x2EB5],
- ["FE74",0x2EB6],
- ["FE75",0x2EB7],
- ["81398432",0x2EB8],
- ["81398433",0x2EB9],
- ["81398434",0x2EBA],
- ["FE79",0x2EBB],
- ["81398435",0x2EBC],
- ["81398436",0x2EBD],
- ["81398437",0x2EBE],
- ["81398438",0x2EBF],
- ["81398439",0x2EC0],
- ["81398530",0x2EC1],
- ["81398531",0x2EC2],
- ["81398532",0x2EC3],
- ["81398533",0x2EC4],
- ["81398534",0x2EC5],
- ["81398535",0x2EC6],
- ["81398536",0x2EC7],
- ["81398537",0x2EC8],
- ["81398538",0x2EC9],
- ["FE84",0x2ECA],
- ["81398539",0x2ECB],
- ["81398630",0x2ECC],
- ["81398631",0x2ECD],
- ["81398632",0x2ECE],
- ["81398633",0x2ECF],
- ["81398634",0x2ED0],
- ["81398635",0x2ED1],
- ["81398636",0x2ED2],
- ["81398637",0x2ED3],
- ["81398638",0x2ED4],
- ["81398639",0x2ED5],
- ["81398730",0x2ED6],
- ["81398731",0x2ED7],
- ["81398732",0x2ED8],
- ["81398733",0x2ED9],
- ["81398734",0x2EDA],
- ["81398735",0x2EDB],
- ["81398736",0x2EDC],
- ["81398737",0x2EDD],
- ["81398738",0x2EDE],
- ["81398739",0x2EDF],
- ["81398830",0x2EE0],
- ["81398831",0x2EE1],
- ["81398832",0x2EE2],
- ["81398833",0x2EE3],
- ["81398834",0x2EE4],
- ["81398835",0x2EE5],
- ["81398836",0x2EE6],
- ["81398837",0x2EE7],
- ["81398838",0x2EE8],
- ["81398839",0x2EE9],
- ["81398930",0x2EEA],
- ["81398931",0x2EEB],
- ["81398932",0x2EEC],
- ["81398933",0x2EED],
- ["81398934",0x2EEE],
- ["81398935",0x2EEF],
- ["81398936",0x2EF0],
- ["81398937",0x2EF1],
- ["81398938",0x2EF2],
- ["81398939",0x2EF3],
- ["81398A30",0x2EF4],
- ["81398A31",0x2EF5],
- ["81398A32",0x2EF6],
- ["81398A33",0x2EF7],
- ["81398A34",0x2EF8],
- ["81398A35",0x2EF9],
- ["81398A36",0x2EFA],
- ["81398A37",0x2EFB],
- ["81398A38",0x2EFC],
- ["81398A39",0x2EFD],
- ["81398B30",0x2EFE],
- ["81398B31",0x2EFF],
- ["81398B32",0x2F00],
- ["81398B33",0x2F01],
- ["81398B34",0x2F02],
- ["81398B35",0x2F03],
- ["81398B36",0x2F04],
- ["81398B37",0x2F05],
- ["81398B38",0x2F06],
- ["81398B39",0x2F07],
- ["81398C30",0x2F08],
- ["81398C31",0x2F09],
- ["81398C32",0x2F0A],
- ["81398C33",0x2F0B],
- ["81398C34",0x2F0C],
- ["81398C35",0x2F0D],
- ["81398C36",0x2F0E],
- ["81398C37",0x2F0F],
- ["81398C38",0x2F10],
- ["81398C39",0x2F11],
- ["81398D30",0x2F12],
- ["81398D31",0x2F13],
- ["81398D32",0x2F14],
- ["81398D33",0x2F15],
- ["81398D34",0x2F16],
- ["81398D35",0x2F17],
- ["81398D36",0x2F18],
- ["81398D37",0x2F19],
- ["81398D38",0x2F1A],
- ["81398D39",0x2F1B],
- ["81398E30",0x2F1C],
- ["81398E31",0x2F1D],
- ["81398E32",0x2F1E],
- ["81398E33",0x2F1F],
- ["81398E34",0x2F20],
- ["81398E35",0x2F21],
- ["81398E36",0x2F22],
- ["81398E37",0x2F23],
- ["81398E38",0x2F24],
- ["81398E39",0x2F25],
- ["81398F30",0x2F26],
- ["81398F31",0x2F27],
- ["81398F32",0x2F28],
- ["81398F33",0x2F29],
- ["81398F34",0x2F2A],
- ["81398F35",0x2F2B],
- ["81398F36",0x2F2C],
- ["81398F37",0x2F2D],
- ["81398F38",0x2F2E],
- ["81398F39",0x2F2F],
- ["81399030",0x2F30],
- ["81399031",0x2F31],
- ["81399032",0x2F32],
- ["81399033",0x2F33],
- ["81399034",0x2F34],
- ["81399035",0x2F35],
- ["81399036",0x2F36],
- ["81399037",0x2F37],
- ["81399038",0x2F38],
- ["81399039",0x2F39],
- ["81399130",0x2F3A],
- ["81399131",0x2F3B],
- ["81399132",0x2F3C],
- ["81399133",0x2F3D],
- ["81399134",0x2F3E],
- ["81399135",0x2F3F],
- ["81399136",0x2F40],
- ["81399137",0x2F41],
- ["81399138",0x2F42],
- ["81399139",0x2F43],
- ["81399230",0x2F44],
- ["81399231",0x2F45],
- ["81399232",0x2F46],
- ["81399233",0x2F47],
- ["81399234",0x2F48],
- ["81399235",0x2F49],
- ["81399236",0x2F4A],
- ["81399237",0x2F4B],
- ["81399238",0x2F4C],
- ["81399239",0x2F4D],
- ["81399330",0x2F4E],
- ["81399331",0x2F4F],
- ["81399332",0x2F50],
- ["81399333",0x2F51],
- ["81399334",0x2F52],
- ["81399335",0x2F53],
- ["81399336",0x2F54],
- ["81399337",0x2F55],
- ["81399338",0x2F56],
- ["81399339",0x2F57],
- ["81399430",0x2F58],
- ["81399431",0x2F59],
- ["81399432",0x2F5A],
- ["81399433",0x2F5B],
- ["81399434",0x2F5C],
- ["81399435",0x2F5D],
- ["81399436",0x2F5E],
- ["81399437",0x2F5F],
- ["81399438",0x2F60],
- ["81399439",0x2F61],
- ["81399530",0x2F62],
- ["81399531",0x2F63],
- ["81399532",0x2F64],
- ["81399533",0x2F65],
- ["81399534",0x2F66],
- ["81399535",0x2F67],
- ["81399536",0x2F68],
- ["81399537",0x2F69],
- ["81399538",0x2F6A],
- ["81399539",0x2F6B],
- ["81399630",0x2F6C],
- ["81399631",0x2F6D],
- ["81399632",0x2F6E],
- ["81399633",0x2F6F],
- ["81399634",0x2F70],
- ["81399635",0x2F71],
- ["81399636",0x2F72],
- ["81399637",0x2F73],
- ["81399638",0x2F74],
- ["81399639",0x2F75],
- ["81399730",0x2F76],
- ["81399731",0x2F77],
- ["81399732",0x2F78],
- ["81399733",0x2F79],
- ["81399734",0x2F7A],
- ["81399735",0x2F7B],
- ["81399736",0x2F7C],
- ["81399737",0x2F7D],
- ["81399738",0x2F7E],
- ["81399739",0x2F7F],
- ["81399830",0x2F80],
- ["81399831",0x2F81],
- ["81399832",0x2F82],
- ["81399833",0x2F83],
- ["81399834",0x2F84],
- ["81399835",0x2F85],
- ["81399836",0x2F86],
- ["81399837",0x2F87],
- ["81399838",0x2F88],
- ["81399839",0x2F89],
- ["81399930",0x2F8A],
- ["81399931",0x2F8B],
- ["81399932",0x2F8C],
- ["81399933",0x2F8D],
- ["81399934",0x2F8E],
- ["81399935",0x2F8F],
- ["81399936",0x2F90],
- ["81399937",0x2F91],
- ["81399938",0x2F92],
- ["81399939",0x2F93],
- ["81399A30",0x2F94],
- ["81399A31",0x2F95],
- ["81399A32",0x2F96],
- ["81399A33",0x2F97],
- ["81399A34",0x2F98],
- ["81399A35",0x2F99],
- ["81399A36",0x2F9A],
- ["81399A37",0x2F9B],
- ["81399A38",0x2F9C],
- ["81399A39",0x2F9D],
- ["81399B30",0x2F9E],
- ["81399B31",0x2F9F],
- ["81399B32",0x2FA0],
- ["81399B33",0x2FA1],
- ["81399B34",0x2FA2],
- ["81399B35",0x2FA3],
- ["81399B36",0x2FA4],
- ["81399B37",0x2FA5],
- ["81399B38",0x2FA6],
- ["81399B39",0x2FA7],
- ["81399C30",0x2FA8],
- ["81399C31",0x2FA9],
- ["81399C32",0x2FAA],
- ["81399C33",0x2FAB],
- ["81399C34",0x2FAC],
- ["81399C35",0x2FAD],
- ["81399C36",0x2FAE],
- ["81399C37",0x2FAF],
- ["81399C38",0x2FB0],
- ["81399C39",0x2FB1],
- ["81399D30",0x2FB2],
- ["81399D31",0x2FB3],
- ["81399D32",0x2FB4],
- ["81399D33",0x2FB5],
- ["81399D34",0x2FB6],
- ["81399D35",0x2FB7],
- ["81399D36",0x2FB8],
- ["81399D37",0x2FB9],
- ["81399D38",0x2FBA],
- ["81399D39",0x2FBB],
- ["81399E30",0x2FBC],
- ["81399E31",0x2FBD],
- ["81399E32",0x2FBE],
- ["81399E33",0x2FBF],
- ["81399E34",0x2FC0],
- ["81399E35",0x2FC1],
- ["81399E36",0x2FC2],
- ["81399E37",0x2FC3],
- ["81399E38",0x2FC4],
- ["81399E39",0x2FC5],
- ["81399F30",0x2FC6],
- ["81399F31",0x2FC7],
- ["81399F32",0x2FC8],
- ["81399F33",0x2FC9],
- ["81399F34",0x2FCA],
- ["81399F35",0x2FCB],
- ["81399F36",0x2FCC],
- ["81399F37",0x2FCD],
- ["81399F38",0x2FCE],
- ["81399F39",0x2FCF],
- ["8139A030",0x2FD0],
- ["8139A031",0x2FD1],
- ["8139A032",0x2FD2],
- ["8139A033",0x2FD3],
- ["8139A034",0x2FD4],
- ["8139A035",0x2FD5],
- ["8139A036",0x2FD6],
- ["8139A037",0x2FD7],
- ["8139A038",0x2FD8],
- ["8139A039",0x2FD9],
- ["8139A130",0x2FDA],
- ["8139A131",0x2FDB],
- ["8139A132",0x2FDC],
- ["8139A133",0x2FDD],
- ["8139A134",0x2FDE],
- ["8139A135",0x2FDF],
- ["8139A136",0x2FE0],
- ["8139A137",0x2FE1],
- ["8139A138",0x2FE2],
- ["8139A139",0x2FE3],
- ["8139A230",0x2FE4],
- ["8139A231",0x2FE5],
- ["8139A232",0x2FE6],
- ["8139A233",0x2FE7],
- ["8139A234",0x2FE8],
- ["8139A235",0x2FE9],
- ["8139A236",0x2FEA],
- ["8139A237",0x2FEB],
- ["8139A238",0x2FEC],
- ["8139A239",0x2FED],
- ["8139A330",0x2FEE],
- ["8139A331",0x2FEF],
- ["A98A",0x2FF0],
- ["A98B",0x2FF1],
- ["A98C",0x2FF2],
- ["A98D",0x2FF3],
- ["A98E",0x2FF4],
- ["A98F",0x2FF5],
- ["A990",0x2FF6],
- ["A991",0x2FF7],
- ["A992",0x2FF8],
- ["A993",0x2FF9],
- ["A994",0x2FFA],
- ["A995",0x2FFB],
- ["8139A332",0x2FFC],
- ["8139A333",0x2FFD],
- ["8139A334",0x2FFE],
- ["8139A335",0x2FFF],
- ["A1A1",0x3000],
- ["A1A2",0x3001],
- ["A1A3",0x3002],
- ["A1A8",0x3003],
- ["8139A336",0x3004],
- ["A1A9",0x3005],
- ["A965",0x3006],
- ["A996",0x3007],
- ["A1B4",0x3008],
- ["A1B5",0x3009],
- ["A1B6",0x300A],
- ["A1B7",0x300B],
- ["A1B8",0x300C],
- ["A1B9",0x300D],
- ["A1BA",0x300E],
- ["A1BB",0x300F],
- ["A1BE",0x3010],
- ["A1BF",0x3011],
- ["A893",0x3012],
- ["A1FE",0x3013],
- ["A1B2",0x3014],
- ["A1B3",0x3015],
- ["A1BC",0x3016],
- ["A1BD",0x3017],
- ["8139A337",0x3018],
- ["8139A338",0x3019],
- ["8139A339",0x301A],
- ["8139A430",0x301B],
- ["8139A431",0x301C],
- ["A894",0x301D],
- ["A895",0x301E],
- ["8139A432",0x301F],
- ["8139A433",0x3020],
- ["A940",0x3021],
- ["A941",0x3022],
- ["A942",0x3023],
- ["A943",0x3024],
- ["A944",0x3025],
- ["A945",0x3026],
- ["A946",0x3027],
- ["A947",0x3028],
- ["A948",0x3029],
- ["8139A434",0x302A],
- ["8139A435",0x302B],
- ["8139A436",0x302C],
- ["8139A437",0x302D],
- ["8139A438",0x302E],
- ["8139A439",0x302F],
- ["8139A530",0x3030],
- ["8139A531",0x3031],
- ["8139A532",0x3032],
- ["8139A533",0x3033],
- ["8139A534",0x3034],
- ["8139A535",0x3035],
- ["8139A536",0x3036],
- ["8139A537",0x3037],
- ["8139A538",0x3038],
- ["8139A539",0x3039],
- ["8139A630",0x303A],
- ["8139A631",0x303B],
- ["8139A632",0x303C],
- ["8139A633",0x303D],
- ["A989",0x303E],
- ["8139A634",0x303F],
- ["8139A635",0x3040],
- ["A4A1",0x3041],
- ["A4A2",0x3042],
- ["A4A3",0x3043],
- ["A4A4",0x3044],
- ["A4A5",0x3045],
- ["A4A6",0x3046],
- ["A4A7",0x3047],
- ["A4A8",0x3048],
- ["A4A9",0x3049],
- ["A4AA",0x304A],
- ["A4AB",0x304B],
- ["A4AC",0x304C],
- ["A4AD",0x304D],
- ["A4AE",0x304E],
- ["A4AF",0x304F],
- ["A4B0",0x3050],
- ["A4B1",0x3051],
- ["A4B2",0x3052],
- ["A4B3",0x3053],
- ["A4B4",0x3054],
- ["A4B5",0x3055],
- ["A4B6",0x3056],
- ["A4B7",0x3057],
- ["A4B8",0x3058],
- ["A4B9",0x3059],
- ["A4BA",0x305A],
- ["A4BB",0x305B],
- ["A4BC",0x305C],
- ["A4BD",0x305D],
- ["A4BE",0x305E],
- ["A4BF",0x305F],
- ["A4C0",0x3060],
- ["A4C1",0x3061],
- ["A4C2",0x3062],
- ["A4C3",0x3063],
- ["A4C4",0x3064],
- ["A4C5",0x3065],
- ["A4C6",0x3066],
- ["A4C7",0x3067],
- ["A4C8",0x3068],
- ["A4C9",0x3069],
- ["A4CA",0x306A],
- ["A4CB",0x306B],
- ["A4CC",0x306C],
- ["A4CD",0x306D],
- ["A4CE",0x306E],
- ["A4CF",0x306F],
- ["A4D0",0x3070],
- ["A4D1",0x3071],
- ["A4D2",0x3072],
- ["A4D3",0x3073],
- ["A4D4",0x3074],
- ["A4D5",0x3075],
- ["A4D6",0x3076],
- ["A4D7",0x3077],
- ["A4D8",0x3078],
- ["A4D9",0x3079],
- ["A4DA",0x307A],
- ["A4DB",0x307B],
- ["A4DC",0x307C],
- ["A4DD",0x307D],
- ["A4DE",0x307E],
- ["A4DF",0x307F],
- ["A4E0",0x3080],
- ["A4E1",0x3081],
- ["A4E2",0x3082],
- ["A4E3",0x3083],
- ["A4E4",0x3084],
- ["A4E5",0x3085],
- ["A4E6",0x3086],
- ["A4E7",0x3087],
- ["A4E8",0x3088],
- ["A4E9",0x3089],
- ["A4EA",0x308A],
- ["A4EB",0x308B],
- ["A4EC",0x308C],
- ["A4ED",0x308D],
- ["A4EE",0x308E],
- ["A4EF",0x308F],
- ["A4F0",0x3090],
- ["A4F1",0x3091],
- ["A4F2",0x3092],
- ["A4F3",0x3093],
- ["8139A636",0x3094],
- ["8139A637",0x3095],
- ["8139A638",0x3096],
- ["8139A639",0x3097],
- ["8139A730",0x3098],
- ["8139A731",0x3099],
- ["8139A732",0x309A],
- ["A961",0x309B],
- ["A962",0x309C],
- ["A966",0x309D],
- ["A967",0x309E],
- ["8139A733",0x309F],
- ["8139A734",0x30A0],
- ["A5A1",0x30A1],
- ["A5A2",0x30A2],
- ["A5A3",0x30A3],
- ["A5A4",0x30A4],
- ["A5A5",0x30A5],
- ["A5A6",0x30A6],
- ["A5A7",0x30A7],
- ["A5A8",0x30A8],
- ["A5A9",0x30A9],
- ["A5AA",0x30AA],
- ["A5AB",0x30AB],
- ["A5AC",0x30AC],
- ["A5AD",0x30AD],
- ["A5AE",0x30AE],
- ["A5AF",0x30AF],
- ["A5B0",0x30B0],
- ["A5B1",0x30B1],
- ["A5B2",0x30B2],
- ["A5B3",0x30B3],
- ["A5B4",0x30B4],
- ["A5B5",0x30B5],
- ["A5B6",0x30B6],
- ["A5B7",0x30B7],
- ["A5B8",0x30B8],
- ["A5B9",0x30B9],
- ["A5BA",0x30BA],
- ["A5BB",0x30BB],
- ["A5BC",0x30BC],
- ["A5BD",0x30BD],
- ["A5BE",0x30BE],
- ["A5BF",0x30BF],
- ["A5C0",0x30C0],
- ["A5C1",0x30C1],
- ["A5C2",0x30C2],
- ["A5C3",0x30C3],
- ["A5C4",0x30C4],
- ["A5C5",0x30C5],
- ["A5C6",0x30C6],
- ["A5C7",0x30C7],
- ["A5C8",0x30C8],
- ["A5C9",0x30C9],
- ["A5CA",0x30CA],
- ["A5CB",0x30CB],
- ["A5CC",0x30CC],
- ["A5CD",0x30CD],
- ["A5CE",0x30CE],
- ["A5CF",0x30CF],
- ["A5D0",0x30D0],
- ["A5D1",0x30D1],
- ["A5D2",0x30D2],
- ["A5D3",0x30D3],
- ["A5D4",0x30D4],
- ["A5D5",0x30D5],
- ["A5D6",0x30D6],
- ["A5D7",0x30D7],
- ["A5D8",0x30D8],
- ["A5D9",0x30D9],
- ["A5DA",0x30DA],
- ["A5DB",0x30DB],
- ["A5DC",0x30DC],
- ["A5DD",0x30DD],
- ["A5DE",0x30DE],
- ["A5DF",0x30DF],
- ["A5E0",0x30E0],
- ["A5E1",0x30E1],
- ["A5E2",0x30E2],
- ["A5E3",0x30E3],
- ["A5E4",0x30E4],
- ["A5E5",0x30E5],
- ["A5E6",0x30E6],
- ["A5E7",0x30E7],
- ["A5E8",0x30E8],
- ["A5E9",0x30E9],
- ["A5EA",0x30EA],
- ["A5EB",0x30EB],
- ["A5EC",0x30EC],
- ["A5ED",0x30ED],
- ["A5EE",0x30EE],
- ["A5EF",0x30EF],
- ["A5F0",0x30F0],
- ["A5F1",0x30F1],
- ["A5F2",0x30F2],
- ["A5F3",0x30F3],
- ["A5F4",0x30F4],
- ["A5F5",0x30F5],
- ["A5F6",0x30F6],
- ["8139A735",0x30F7],
- ["8139A736",0x30F8],
- ["8139A737",0x30F9],
- ["8139A738",0x30FA],
- ["8139A739",0x30FB],
- ["A960",0x30FC],
- ["A963",0x30FD],
- ["A964",0x30FE],
- ["8139A830",0x30FF],
- ["8139A831",0x3100],
- ["8139A832",0x3101],
- ["8139A833",0x3102],
- ["8139A834",0x3103],
- ["8139A835",0x3104],
- ["A8C5",0x3105],
- ["A8C6",0x3106],
- ["A8C7",0x3107],
- ["A8C8",0x3108],
- ["A8C9",0x3109],
- ["A8CA",0x310A],
- ["A8CB",0x310B],
- ["A8CC",0x310C],
- ["A8CD",0x310D],
- ["A8CE",0x310E],
- ["A8CF",0x310F],
- ["A8D0",0x3110],
- ["A8D1",0x3111],
- ["A8D2",0x3112],
- ["A8D3",0x3113],
- ["A8D4",0x3114],
- ["A8D5",0x3115],
- ["A8D6",0x3116],
- ["A8D7",0x3117],
- ["A8D8",0x3118],
- ["A8D9",0x3119],
- ["A8DA",0x311A],
- ["A8DB",0x311B],
- ["A8DC",0x311C],
- ["A8DD",0x311D],
- ["A8DE",0x311E],
- ["A8DF",0x311F],
- ["A8E0",0x3120],
- ["A8E1",0x3121],
- ["A8E2",0x3122],
- ["A8E3",0x3123],
- ["A8E4",0x3124],
- ["A8E5",0x3125],
- ["A8E6",0x3126],
- ["A8E7",0x3127],
- ["A8E8",0x3128],
- ["A8E9",0x3129],
- ["8139A836",0x312A],
- ["8139A837",0x312B],
- ["8139A838",0x312C],
- ["8139A839",0x312D],
- ["8139A930",0x312E],
- ["8139A931",0x312F],
- ["8139A932",0x3130],
- ["8139A933",0x3131],
- ["8139A934",0x3132],
- ["8139A935",0x3133],
- ["8139A936",0x3134],
- ["8139A937",0x3135],
- ["8139A938",0x3136],
- ["8139A939",0x3137],
- ["8139AA30",0x3138],
- ["8139AA31",0x3139],
- ["8139AA32",0x313A],
- ["8139AA33",0x313B],
- ["8139AA34",0x313C],
- ["8139AA35",0x313D],
- ["8139AA36",0x313E],
- ["8139AA37",0x313F],
- ["8139AA38",0x3140],
- ["8139AA39",0x3141],
- ["8139AB30",0x3142],
- ["8139AB31",0x3143],
- ["8139AB32",0x3144],
- ["8139AB33",0x3145],
- ["8139AB34",0x3146],
- ["8139AB35",0x3147],
- ["8139AB36",0x3148],
- ["8139AB37",0x3149],
- ["8139AB38",0x314A],
- ["8139AB39",0x314B],
- ["8139AC30",0x314C],
- ["8139AC31",0x314D],
- ["8139AC32",0x314E],
- ["8139AC33",0x314F],
- ["8139AC34",0x3150],
- ["8139AC35",0x3151],
- ["8139AC36",0x3152],
- ["8139AC37",0x3153],
- ["8139AC38",0x3154],
- ["8139AC39",0x3155],
- ["8139AD30",0x3156],
- ["8139AD31",0x3157],
- ["8139AD32",0x3158],
- ["8139AD33",0x3159],
- ["8139AD34",0x315A],
- ["8139AD35",0x315B],
- ["8139AD36",0x315C],
- ["8139AD37",0x315D],
- ["8139AD38",0x315E],
- ["8139AD39",0x315F],
- ["8139AE30",0x3160],
- ["8139AE31",0x3161],
- ["8139AE32",0x3162],
- ["8139AE33",0x3163],
- ["8139AE34",0x3164],
- ["8139AE35",0x3165],
- ["8139AE36",0x3166],
- ["8139AE37",0x3167],
- ["8139AE38",0x3168],
- ["8139AE39",0x3169],
- ["8139AF30",0x316A],
- ["8139AF31",0x316B],
- ["8139AF32",0x316C],
- ["8139AF33",0x316D],
- ["8139AF34",0x316E],
- ["8139AF35",0x316F],
- ["8139AF36",0x3170],
- ["8139AF37",0x3171],
- ["8139AF38",0x3172],
- ["8139AF39",0x3173],
- ["8139B030",0x3174],
- ["8139B031",0x3175],
- ["8139B032",0x3176],
- ["8139B033",0x3177],
- ["8139B034",0x3178],
- ["8139B035",0x3179],
- ["8139B036",0x317A],
- ["8139B037",0x317B],
- ["8139B038",0x317C],
- ["8139B039",0x317D],
- ["8139B130",0x317E],
- ["8139B131",0x317F],
- ["8139B132",0x3180],
- ["8139B133",0x3181],
- ["8139B134",0x3182],
- ["8139B135",0x3183],
- ["8139B136",0x3184],
- ["8139B137",0x3185],
- ["8139B138",0x3186],
- ["8139B139",0x3187],
- ["8139B230",0x3188],
- ["8139B231",0x3189],
- ["8139B232",0x318A],
- ["8139B233",0x318B],
- ["8139B234",0x318C],
- ["8139B235",0x318D],
- ["8139B236",0x318E],
- ["8139B237",0x318F],
- ["8139B238",0x3190],
- ["8139B239",0x3191],
- ["8139B330",0x3192],
- ["8139B331",0x3193],
- ["8139B332",0x3194],
- ["8139B333",0x3195],
- ["8139B334",0x3196],
- ["8139B335",0x3197],
- ["8139B336",0x3198],
- ["8139B337",0x3199],
- ["8139B338",0x319A],
- ["8139B339",0x319B],
- ["8139B430",0x319C],
- ["8139B431",0x319D],
- ["8139B432",0x319E],
- ["8139B433",0x319F],
- ["8139B434",0x31A0],
- ["8139B435",0x31A1],
- ["8139B436",0x31A2],
- ["8139B437",0x31A3],
- ["8139B438",0x31A4],
- ["8139B439",0x31A5],
- ["8139B530",0x31A6],
- ["8139B531",0x31A7],
- ["8139B532",0x31A8],
- ["8139B533",0x31A9],
- ["8139B534",0x31AA],
- ["8139B535",0x31AB],
- ["8139B536",0x31AC],
- ["8139B537",0x31AD],
- ["8139B538",0x31AE],
- ["8139B539",0x31AF],
- ["8139B630",0x31B0],
- ["8139B631",0x31B1],
- ["8139B632",0x31B2],
- ["8139B633",0x31B3],
- ["8139B634",0x31B4],
- ["8139B635",0x31B5],
- ["8139B636",0x31B6],
- ["8139B637",0x31B7],
- ["8139B638",0x31B8],
- ["8139B639",0x31B9],
- ["8139B730",0x31BA],
- ["8139B731",0x31BB],
- ["8139B732",0x31BC],
- ["8139B733",0x31BD],
- ["8139B734",0x31BE],
- ["8139B735",0x31BF],
- ["8139B736",0x31C0],
- ["8139B737",0x31C1],
- ["8139B738",0x31C2],
- ["8139B739",0x31C3],
- ["8139B830",0x31C4],
- ["8139B831",0x31C5],
- ["8139B832",0x31C6],
- ["8139B833",0x31C7],
- ["8139B834",0x31C8],
- ["8139B835",0x31C9],
- ["8139B836",0x31CA],
- ["8139B837",0x31CB],
- ["8139B838",0x31CC],
- ["8139B839",0x31CD],
- ["8139B930",0x31CE],
- ["8139B931",0x31CF],
- ["8139B932",0x31D0],
- ["8139B933",0x31D1],
- ["8139B934",0x31D2],
- ["8139B935",0x31D3],
- ["8139B936",0x31D4],
- ["8139B937",0x31D5],
- ["8139B938",0x31D6],
- ["8139B939",0x31D7],
- ["8139BA30",0x31D8],
- ["8139BA31",0x31D9],
- ["8139BA32",0x31DA],
- ["8139BA33",0x31DB],
- ["8139BA34",0x31DC],
- ["8139BA35",0x31DD],
- ["8139BA36",0x31DE],
- ["8139BA37",0x31DF],
- ["8139BA38",0x31E0],
- ["8139BA39",0x31E1],
- ["8139BB30",0x31E2],
- ["8139BB31",0x31E3],
- ["8139BB32",0x31E4],
- ["8139BB33",0x31E5],
- ["8139BB34",0x31E6],
- ["8139BB35",0x31E7],
- ["8139BB36",0x31E8],
- ["8139BB37",0x31E9],
- ["8139BB38",0x31EA],
- ["8139BB39",0x31EB],
- ["8139BC30",0x31EC],
- ["8139BC31",0x31ED],
- ["8139BC32",0x31EE],
- ["8139BC33",0x31EF],
- ["8139BC34",0x31F0],
- ["8139BC35",0x31F1],
- ["8139BC36",0x31F2],
- ["8139BC37",0x31F3],
- ["8139BC38",0x31F4],
- ["8139BC39",0x31F5],
- ["8139BD30",0x31F6],
- ["8139BD31",0x31F7],
- ["8139BD32",0x31F8],
- ["8139BD33",0x31F9],
- ["8139BD34",0x31FA],
- ["8139BD35",0x31FB],
- ["8139BD36",0x31FC],
- ["8139BD37",0x31FD],
- ["8139BD38",0x31FE],
- ["8139BD39",0x31FF],
- ["8139BE30",0x3200],
- ["8139BE31",0x3201],
- ["8139BE32",0x3202],
- ["8139BE33",0x3203],
- ["8139BE34",0x3204],
- ["8139BE35",0x3205],
- ["8139BE36",0x3206],
- ["8139BE37",0x3207],
- ["8139BE38",0x3208],
- ["8139BE39",0x3209],
- ["8139BF30",0x320A],
- ["8139BF31",0x320B],
- ["8139BF32",0x320C],
- ["8139BF33",0x320D],
- ["8139BF34",0x320E],
- ["8139BF35",0x320F],
- ["8139BF36",0x3210],
- ["8139BF37",0x3211],
- ["8139BF38",0x3212],
- ["8139BF39",0x3213],
- ["8139C030",0x3214],
- ["8139C031",0x3215],
- ["8139C032",0x3216],
- ["8139C033",0x3217],
- ["8139C034",0x3218],
- ["8139C035",0x3219],
- ["8139C036",0x321A],
- ["8139C037",0x321B],
- ["8139C038",0x321C],
- ["8139C039",0x321D],
- ["8139C130",0x321E],
- ["8139C131",0x321F],
- ["A2E5",0x3220],
- ["A2E6",0x3221],
- ["A2E7",0x3222],
- ["A2E8",0x3223],
- ["A2E9",0x3224],
- ["A2EA",0x3225],
- ["A2EB",0x3226],
- ["A2EC",0x3227],
- ["A2ED",0x3228],
- ["A2EE",0x3229],
- ["8139C132",0x322A],
- ["8139C133",0x322B],
- ["8139C134",0x322C],
- ["8139C135",0x322D],
- ["8139C136",0x322E],
- ["8139C137",0x322F],
- ["8139C138",0x3230],
- ["A95A",0x3231],
- ["8139C139",0x3232],
- ["8139C230",0x3233],
- ["8139C231",0x3234],
- ["8139C232",0x3235],
- ["8139C233",0x3236],
- ["8139C234",0x3237],
- ["8139C235",0x3238],
- ["8139C236",0x3239],
- ["8139C237",0x323A],
- ["8139C238",0x323B],
- ["8139C239",0x323C],
- ["8139C330",0x323D],
- ["8139C331",0x323E],
- ["8139C332",0x323F],
- ["8139C333",0x3240],
- ["8139C334",0x3241],
- ["8139C335",0x3242],
- ["8139C336",0x3243],
- ["8139C337",0x3244],
- ["8139C338",0x3245],
- ["8139C339",0x3246],
- ["8139C430",0x3247],
- ["8139C431",0x3248],
- ["8139C432",0x3249],
- ["8139C433",0x324A],
- ["8139C434",0x324B],
- ["8139C435",0x324C],
- ["8139C436",0x324D],
- ["8139C437",0x324E],
- ["8139C438",0x324F],
- ["8139C439",0x3250],
- ["8139C530",0x3251],
- ["8139C531",0x3252],
- ["8139C532",0x3253],
- ["8139C533",0x3254],
- ["8139C534",0x3255],
- ["8139C535",0x3256],
- ["8139C536",0x3257],
- ["8139C537",0x3258],
- ["8139C538",0x3259],
- ["8139C539",0x325A],
- ["8139C630",0x325B],
- ["8139C631",0x325C],
- ["8139C632",0x325D],
- ["8139C633",0x325E],
- ["8139C634",0x325F],
- ["8139C635",0x3260],
- ["8139C636",0x3261],
- ["8139C637",0x3262],
- ["8139C638",0x3263],
- ["8139C639",0x3264],
- ["8139C730",0x3265],
- ["8139C731",0x3266],
- ["8139C732",0x3267],
- ["8139C733",0x3268],
- ["8139C734",0x3269],
- ["8139C735",0x326A],
- ["8139C736",0x326B],
- ["8139C737",0x326C],
- ["8139C738",0x326D],
- ["8139C739",0x326E],
- ["8139C830",0x326F],
- ["8139C831",0x3270],
- ["8139C832",0x3271],
- ["8139C833",0x3272],
- ["8139C834",0x3273],
- ["8139C835",0x3274],
- ["8139C836",0x3275],
- ["8139C837",0x3276],
- ["8139C838",0x3277],
- ["8139C839",0x3278],
- ["8139C930",0x3279],
- ["8139C931",0x327A],
- ["8139C932",0x327B],
- ["8139C933",0x327C],
- ["8139C934",0x327D],
- ["8139C935",0x327E],
- ["8139C936",0x327F],
- ["8139C937",0x3280],
- ["8139C938",0x3281],
- ["8139C939",0x3282],
- ["8139CA30",0x3283],
- ["8139CA31",0x3284],
- ["8139CA32",0x3285],
- ["8139CA33",0x3286],
- ["8139CA34",0x3287],
- ["8139CA35",0x3288],
- ["8139CA36",0x3289],
- ["8139CA37",0x328A],
- ["8139CA38",0x328B],
- ["8139CA39",0x328C],
- ["8139CB30",0x328D],
- ["8139CB31",0x328E],
- ["8139CB32",0x328F],
- ["8139CB33",0x3290],
- ["8139CB34",0x3291],
- ["8139CB35",0x3292],
- ["8139CB36",0x3293],
- ["8139CB37",0x3294],
- ["8139CB38",0x3295],
- ["8139CB39",0x3296],
- ["8139CC30",0x3297],
- ["8139CC31",0x3298],
- ["8139CC32",0x3299],
- ["8139CC33",0x329A],
- ["8139CC34",0x329B],
- ["8139CC35",0x329C],
- ["8139CC36",0x329D],
- ["8139CC37",0x329E],
- ["8139CC38",0x329F],
- ["8139CC39",0x32A0],
- ["8139CD30",0x32A1],
- ["8139CD31",0x32A2],
- ["A949",0x32A3],
- ["8139CD32",0x32A4],
- ["8139CD33",0x32A5],
- ["8139CD34",0x32A6],
- ["8139CD35",0x32A7],
- ["8139CD36",0x32A8],
- ["8139CD37",0x32A9],
- ["8139CD38",0x32AA],
- ["8139CD39",0x32AB],
- ["8139CE30",0x32AC],
- ["8139CE31",0x32AD],
- ["8139CE32",0x32AE],
- ["8139CE33",0x32AF],
- ["8139CE34",0x32B0],
- ["8139CE35",0x32B1],
- ["8139CE36",0x32B2],
- ["8139CE37",0x32B3],
- ["8139CE38",0x32B4],
- ["8139CE39",0x32B5],
- ["8139CF30",0x32B6],
- ["8139CF31",0x32B7],
- ["8139CF32",0x32B8],
- ["8139CF33",0x32B9],
- ["8139CF34",0x32BA],
- ["8139CF35",0x32BB],
- ["8139CF36",0x32BC],
- ["8139CF37",0x32BD],
- ["8139CF38",0x32BE],
- ["8139CF39",0x32BF],
- ["8139D030",0x32C0],
- ["8139D031",0x32C1],
- ["8139D032",0x32C2],
- ["8139D033",0x32C3],
- ["8139D034",0x32C4],
- ["8139D035",0x32C5],
- ["8139D036",0x32C6],
- ["8139D037",0x32C7],
- ["8139D038",0x32C8],
- ["8139D039",0x32C9],
- ["8139D130",0x32CA],
- ["8139D131",0x32CB],
- ["8139D132",0x32CC],
- ["8139D133",0x32CD],
- ["8139D134",0x32CE],
- ["8139D135",0x32CF],
- ["8139D136",0x32D0],
- ["8139D137",0x32D1],
- ["8139D138",0x32D2],
- ["8139D139",0x32D3],
- ["8139D230",0x32D4],
- ["8139D231",0x32D5],
- ["8139D232",0x32D6],
- ["8139D233",0x32D7],
- ["8139D234",0x32D8],
- ["8139D235",0x32D9],
- ["8139D236",0x32DA],
- ["8139D237",0x32DB],
- ["8139D238",0x32DC],
- ["8139D239",0x32DD],
- ["8139D330",0x32DE],
- ["8139D331",0x32DF],
- ["8139D332",0x32E0],
- ["8139D333",0x32E1],
- ["8139D334",0x32E2],
- ["8139D335",0x32E3],
- ["8139D336",0x32E4],
- ["8139D337",0x32E5],
- ["8139D338",0x32E6],
- ["8139D339",0x32E7],
- ["8139D430",0x32E8],
- ["8139D431",0x32E9],
- ["8139D432",0x32EA],
- ["8139D433",0x32EB],
- ["8139D434",0x32EC],
- ["8139D435",0x32ED],
- ["8139D436",0x32EE],
- ["8139D437",0x32EF],
- ["8139D438",0x32F0],
- ["8139D439",0x32F1],
- ["8139D530",0x32F2],
- ["8139D531",0x32F3],
- ["8139D532",0x32F4],
- ["8139D533",0x32F5],
- ["8139D534",0x32F6],
- ["8139D535",0x32F7],
- ["8139D536",0x32F8],
- ["8139D537",0x32F9],
- ["8139D538",0x32FA],
- ["8139D539",0x32FB],
- ["8139D630",0x32FC],
- ["8139D631",0x32FD],
- ["8139D632",0x32FE],
- ["8139D633",0x32FF],
- ["8139D634",0x3300],
- ["8139D635",0x3301],
- ["8139D636",0x3302],
- ["8139D637",0x3303],
- ["8139D638",0x3304],
- ["8139D639",0x3305],
- ["8139D730",0x3306],
- ["8139D731",0x3307],
- ["8139D732",0x3308],
- ["8139D733",0x3309],
- ["8139D734",0x330A],
- ["8139D735",0x330B],
- ["8139D736",0x330C],
- ["8139D737",0x330D],
- ["8139D738",0x330E],
- ["8139D739",0x330F],
- ["8139D830",0x3310],
- ["8139D831",0x3311],
- ["8139D832",0x3312],
- ["8139D833",0x3313],
- ["8139D834",0x3314],
- ["8139D835",0x3315],
- ["8139D836",0x3316],
- ["8139D837",0x3317],
- ["8139D838",0x3318],
- ["8139D839",0x3319],
- ["8139D930",0x331A],
- ["8139D931",0x331B],
- ["8139D932",0x331C],
- ["8139D933",0x331D],
- ["8139D934",0x331E],
- ["8139D935",0x331F],
- ["8139D936",0x3320],
- ["8139D937",0x3321],
- ["8139D938",0x3322],
- ["8139D939",0x3323],
- ["8139DA30",0x3324],
- ["8139DA31",0x3325],
- ["8139DA32",0x3326],
- ["8139DA33",0x3327],
- ["8139DA34",0x3328],
- ["8139DA35",0x3329],
- ["8139DA36",0x332A],
- ["8139DA37",0x332B],
- ["8139DA38",0x332C],
- ["8139DA39",0x332D],
- ["8139DB30",0x332E],
- ["8139DB31",0x332F],
- ["8139DB32",0x3330],
- ["8139DB33",0x3331],
- ["8139DB34",0x3332],
- ["8139DB35",0x3333],
- ["8139DB36",0x3334],
- ["8139DB37",0x3335],
- ["8139DB38",0x3336],
- ["8139DB39",0x3337],
- ["8139DC30",0x3338],
- ["8139DC31",0x3339],
- ["8139DC32",0x333A],
- ["8139DC33",0x333B],
- ["8139DC34",0x333C],
- ["8139DC35",0x333D],
- ["8139DC36",0x333E],
- ["8139DC37",0x333F],
- ["8139DC38",0x3340],
- ["8139DC39",0x3341],
- ["8139DD30",0x3342],
- ["8139DD31",0x3343],
- ["8139DD32",0x3344],
- ["8139DD33",0x3345],
- ["8139DD34",0x3346],
- ["8139DD35",0x3347],
- ["8139DD36",0x3348],
- ["8139DD37",0x3349],
- ["8139DD38",0x334A],
- ["8139DD39",0x334B],
- ["8139DE30",0x334C],
- ["8139DE31",0x334D],
- ["8139DE32",0x334E],
- ["8139DE33",0x334F],
- ["8139DE34",0x3350],
- ["8139DE35",0x3351],
- ["8139DE36",0x3352],
- ["8139DE37",0x3353],
- ["8139DE38",0x3354],
- ["8139DE39",0x3355],
- ["8139DF30",0x3356],
- ["8139DF31",0x3357],
- ["8139DF32",0x3358],
- ["8139DF33",0x3359],
- ["8139DF34",0x335A],
- ["8139DF35",0x335B],
- ["8139DF36",0x335C],
- ["8139DF37",0x335D],
- ["8139DF38",0x335E],
- ["8139DF39",0x335F],
- ["8139E030",0x3360],
- ["8139E031",0x3361],
- ["8139E032",0x3362],
- ["8139E033",0x3363],
- ["8139E034",0x3364],
- ["8139E035",0x3365],
- ["8139E036",0x3366],
- ["8139E037",0x3367],
- ["8139E038",0x3368],
- ["8139E039",0x3369],
- ["8139E130",0x336A],
- ["8139E131",0x336B],
- ["8139E132",0x336C],
- ["8139E133",0x336D],
- ["8139E134",0x336E],
- ["8139E135",0x336F],
- ["8139E136",0x3370],
- ["8139E137",0x3371],
- ["8139E138",0x3372],
- ["8139E139",0x3373],
- ["8139E230",0x3374],
- ["8139E231",0x3375],
- ["8139E232",0x3376],
- ["8139E233",0x3377],
- ["8139E234",0x3378],
- ["8139E235",0x3379],
- ["8139E236",0x337A],
- ["8139E237",0x337B],
- ["8139E238",0x337C],
- ["8139E239",0x337D],
- ["8139E330",0x337E],
- ["8139E331",0x337F],
- ["8139E332",0x3380],
- ["8139E333",0x3381],
- ["8139E334",0x3382],
- ["8139E335",0x3383],
- ["8139E336",0x3384],
- ["8139E337",0x3385],
- ["8139E338",0x3386],
- ["8139E339",0x3387],
- ["8139E430",0x3388],
- ["8139E431",0x3389],
- ["8139E432",0x338A],
- ["8139E433",0x338B],
- ["8139E434",0x338C],
- ["8139E435",0x338D],
- ["A94A",0x338E],
- ["A94B",0x338F],
- ["8139E436",0x3390],
- ["8139E437",0x3391],
- ["8139E438",0x3392],
- ["8139E439",0x3393],
- ["8139E530",0x3394],
- ["8139E531",0x3395],
- ["8139E532",0x3396],
- ["8139E533",0x3397],
- ["8139E534",0x3398],
- ["8139E535",0x3399],
- ["8139E536",0x339A],
- ["8139E537",0x339B],
- ["A94C",0x339C],
- ["A94D",0x339D],
- ["A94E",0x339E],
- ["8139E538",0x339F],
- ["8139E539",0x33A0],
- ["A94F",0x33A1],
- ["8139E630",0x33A2],
- ["8139E631",0x33A3],
- ["8139E632",0x33A4],
- ["8139E633",0x33A5],
- ["8139E634",0x33A6],
- ["8139E635",0x33A7],
- ["8139E636",0x33A8],
- ["8139E637",0x33A9],
- ["8139E638",0x33AA],
- ["8139E639",0x33AB],
- ["8139E730",0x33AC],
- ["8139E731",0x33AD],
- ["8139E732",0x33AE],
- ["8139E733",0x33AF],
- ["8139E734",0x33B0],
- ["8139E735",0x33B1],
- ["8139E736",0x33B2],
- ["8139E737",0x33B3],
- ["8139E738",0x33B4],
- ["8139E739",0x33B5],
- ["8139E830",0x33B6],
- ["8139E831",0x33B7],
- ["8139E832",0x33B8],
- ["8139E833",0x33B9],
- ["8139E834",0x33BA],
- ["8139E835",0x33BB],
- ["8139E836",0x33BC],
- ["8139E837",0x33BD],
- ["8139E838",0x33BE],
- ["8139E839",0x33BF],
- ["8139E930",0x33C0],
- ["8139E931",0x33C1],
- ["8139E932",0x33C2],
- ["8139E933",0x33C3],
- ["A950",0x33C4],
- ["8139E934",0x33C5],
- ["8139E935",0x33C6],
- ["8139E936",0x33C7],
- ["8139E937",0x33C8],
- ["8139E938",0x33C9],
- ["8139E939",0x33CA],
- ["8139EA30",0x33CB],
- ["8139EA31",0x33CC],
- ["8139EA32",0x33CD],
- ["A951",0x33CE],
- ["8139EA33",0x33CF],
- ["8139EA34",0x33D0],
- ["A952",0x33D1],
- ["A953",0x33D2],
- ["8139EA35",0x33D3],
- ["8139EA36",0x33D4],
- ["A954",0x33D5],
- ["8139EA37",0x33D6],
- ["8139EA38",0x33D7],
- ["8139EA39",0x33D8],
- ["8139EB30",0x33D9],
- ["8139EB31",0x33DA],
- ["8139EB32",0x33DB],
- ["8139EB33",0x33DC],
- ["8139EB34",0x33DD],
- ["8139EB35",0x33DE],
- ["8139EB36",0x33DF],
- ["8139EB37",0x33E0],
- ["8139EB38",0x33E1],
- ["8139EB39",0x33E2],
- ["8139EC30",0x33E3],
- ["8139EC31",0x33E4],
- ["8139EC32",0x33E5],
- ["8139EC33",0x33E6],
- ["8139EC34",0x33E7],
- ["8139EC35",0x33E8],
- ["8139EC36",0x33E9],
- ["8139EC37",0x33EA],
- ["8139EC38",0x33EB],
- ["8139EC39",0x33EC],
- ["8139ED30",0x33ED],
- ["8139ED31",0x33EE],
- ["8139ED32",0x33EF],
- ["8139ED33",0x33F0],
- ["8139ED34",0x33F1],
- ["8139ED35",0x33F2],
- ["8139ED36",0x33F3],
- ["8139ED37",0x33F4],
- ["8139ED38",0x33F5],
- ["8139ED39",0x33F6],
- ["8139EE30",0x33F7],
- ["8139EE31",0x33F8],
- ["8139EE32",0x33F9],
- ["8139EE33",0x33FA],
- ["8139EE34",0x33FB],
- ["8139EE35",0x33FC],
- ["8139EE36",0x33FD],
- ["8139EE37",0x33FE],
- ["8139EE38",0x33FF],
- ["8139EE39",0x3400],
- ["8139EF30",0x3401],
- ["8139EF31",0x3402],
- ["8139EF32",0x3403],
- ["8139EF33",0x3404],
- ["8139EF34",0x3405],
- ["8139EF35",0x3406],
- ["8139EF36",0x3407],
- ["8139EF37",0x3408],
- ["8139EF38",0x3409],
- ["8139EF39",0x340A],
- ["8139F030",0x340B],
- ["8139F031",0x340C],
- ["8139F032",0x340D],
- ["8139F033",0x340E],
- ["8139F034",0x340F],
- ["8139F035",0x3410],
- ["8139F036",0x3411],
- ["8139F037",0x3412],
- ["8139F038",0x3413],
- ["8139F039",0x3414],
- ["8139F130",0x3415],
- ["8139F131",0x3416],
- ["8139F132",0x3417],
- ["8139F133",0x3418],
- ["8139F134",0x3419],
- ["8139F135",0x341A],
- ["8139F136",0x341B],
- ["8139F137",0x341C],
- ["8139F138",0x341D],
- ["8139F139",0x341E],
- ["8139F230",0x341F],
- ["8139F231",0x3420],
- ["8139F232",0x3421],
- ["8139F233",0x3422],
- ["8139F234",0x3423],
- ["8139F235",0x3424],
- ["8139F236",0x3425],
- ["8139F237",0x3426],
- ["8139F238",0x3427],
- ["8139F239",0x3428],
- ["8139F330",0x3429],
- ["8139F331",0x342A],
- ["8139F332",0x342B],
- ["8139F333",0x342C],
- ["8139F334",0x342D],
- ["8139F335",0x342E],
- ["8139F336",0x342F],
- ["8139F337",0x3430],
- ["8139F338",0x3431],
- ["8139F339",0x3432],
- ["8139F430",0x3433],
- ["8139F431",0x3434],
- ["8139F432",0x3435],
- ["8139F433",0x3436],
- ["8139F434",0x3437],
- ["8139F435",0x3438],
- ["8139F436",0x3439],
- ["8139F437",0x343A],
- ["8139F438",0x343B],
- ["8139F439",0x343C],
- ["8139F530",0x343D],
- ["8139F531",0x343E],
- ["8139F532",0x343F],
- ["8139F533",0x3440],
- ["8139F534",0x3441],
- ["8139F535",0x3442],
- ["8139F536",0x3443],
- ["8139F537",0x3444],
- ["8139F538",0x3445],
- ["8139F539",0x3446],
- ["FE56",0x3447],
- ["8139F630",0x3448],
- ["8139F631",0x3449],
- ["8139F632",0x344A],
- ["8139F633",0x344B],
- ["8139F634",0x344C],
- ["8139F635",0x344D],
- ["8139F636",0x344E],
- ["8139F637",0x344F],
- ["8139F638",0x3450],
- ["8139F639",0x3451],
- ["8139F730",0x3452],
- ["8139F731",0x3453],
- ["8139F732",0x3454],
- ["8139F733",0x3455],
- ["8139F734",0x3456],
- ["8139F735",0x3457],
- ["8139F736",0x3458],
- ["8139F737",0x3459],
- ["8139F738",0x345A],
- ["8139F739",0x345B],
- ["8139F830",0x345C],
- ["8139F831",0x345D],
- ["8139F832",0x345E],
- ["8139F833",0x345F],
- ["8139F834",0x3460],
- ["8139F835",0x3461],
- ["8139F836",0x3462],
- ["8139F837",0x3463],
- ["8139F838",0x3464],
- ["8139F839",0x3465],
- ["8139F930",0x3466],
- ["8139F931",0x3467],
- ["8139F932",0x3468],
- ["8139F933",0x3469],
- ["8139F934",0x346A],
- ["8139F935",0x346B],
- ["8139F936",0x346C],
- ["8139F937",0x346D],
- ["8139F938",0x346E],
- ["8139F939",0x346F],
- ["8139FA30",0x3470],
- ["8139FA31",0x3471],
- ["8139FA32",0x3472],
- ["FE55",0x3473],
- ["8139FA33",0x3474],
- ["8139FA34",0x3475],
- ["8139FA35",0x3476],
- ["8139FA36",0x3477],
- ["8139FA37",0x3478],
- ["8139FA38",0x3479],
- ["8139FA39",0x347A],
- ["8139FB30",0x347B],
- ["8139FB31",0x347C],
- ["8139FB32",0x347D],
- ["8139FB33",0x347E],
- ["8139FB34",0x347F],
- ["8139FB35",0x3480],
- ["8139FB36",0x3481],
- ["8139FB37",0x3482],
- ["8139FB38",0x3483],
- ["8139FB39",0x3484],
- ["8139FC30",0x3485],
- ["8139FC31",0x3486],
- ["8139FC32",0x3487],
- ["8139FC33",0x3488],
- ["8139FC34",0x3489],
- ["8139FC35",0x348A],
- ["8139FC36",0x348B],
- ["8139FC37",0x348C],
- ["8139FC38",0x348D],
- ["8139FC39",0x348E],
- ["8139FD30",0x348F],
- ["8139FD31",0x3490],
- ["8139FD32",0x3491],
- ["8139FD33",0x3492],
- ["8139FD34",0x3493],
- ["8139FD35",0x3494],
- ["8139FD36",0x3495],
- ["8139FD37",0x3496],
- ["8139FD38",0x3497],
- ["8139FD39",0x3498],
- ["8139FE30",0x3499],
- ["8139FE31",0x349A],
- ["8139FE32",0x349B],
- ["8139FE33",0x349C],
- ["8139FE34",0x349D],
- ["8139FE35",0x349E],
- ["8139FE36",0x349F],
- ["8139FE37",0x34A0],
- ["8139FE38",0x34A1],
- ["8139FE39",0x34A2],
- ["82308130",0x34A3],
- ["82308131",0x34A4],
- ["82308132",0x34A5],
- ["82308133",0x34A6],
- ["82308134",0x34A7],
- ["82308135",0x34A8],
- ["82308136",0x34A9],
- ["82308137",0x34AA],
- ["82308138",0x34AB],
- ["82308139",0x34AC],
- ["82308230",0x34AD],
- ["82308231",0x34AE],
- ["82308232",0x34AF],
- ["82308233",0x34B0],
- ["82308234",0x34B1],
- ["82308235",0x34B2],
- ["82308236",0x34B3],
- ["82308237",0x34B4],
- ["82308238",0x34B5],
- ["82308239",0x34B6],
- ["82308330",0x34B7],
- ["82308331",0x34B8],
- ["82308332",0x34B9],
- ["82308333",0x34BA],
- ["82308334",0x34BB],
- ["82308335",0x34BC],
- ["82308336",0x34BD],
- ["82308337",0x34BE],
- ["82308338",0x34BF],
- ["82308339",0x34C0],
- ["82308430",0x34C1],
- ["82308431",0x34C2],
- ["82308432",0x34C3],
- ["82308433",0x34C4],
- ["82308434",0x34C5],
- ["82308435",0x34C6],
- ["82308436",0x34C7],
- ["82308437",0x34C8],
- ["82308438",0x34C9],
- ["82308439",0x34CA],
- ["82308530",0x34CB],
- ["82308531",0x34CC],
- ["82308532",0x34CD],
- ["82308533",0x34CE],
- ["82308534",0x34CF],
- ["82308535",0x34D0],
- ["82308536",0x34D1],
- ["82308537",0x34D2],
- ["82308538",0x34D3],
- ["82308539",0x34D4],
- ["82308630",0x34D5],
- ["82308631",0x34D6],
- ["82308632",0x34D7],
- ["82308633",0x34D8],
- ["82308634",0x34D9],
- ["82308635",0x34DA],
- ["82308636",0x34DB],
- ["82308637",0x34DC],
- ["82308638",0x34DD],
- ["82308639",0x34DE],
- ["82308730",0x34DF],
- ["82308731",0x34E0],
- ["82308732",0x34E1],
- ["82308733",0x34E2],
- ["82308734",0x34E3],
- ["82308735",0x34E4],
- ["82308736",0x34E5],
- ["82308737",0x34E6],
- ["82308738",0x34E7],
- ["82308739",0x34E8],
- ["82308830",0x34E9],
- ["82308831",0x34EA],
- ["82308832",0x34EB],
- ["82308833",0x34EC],
- ["82308834",0x34ED],
- ["82308835",0x34EE],
- ["82308836",0x34EF],
- ["82308837",0x34F0],
- ["82308838",0x34F1],
- ["82308839",0x34F2],
- ["82308930",0x34F3],
- ["82308931",0x34F4],
- ["82308932",0x34F5],
- ["82308933",0x34F6],
- ["82308934",0x34F7],
- ["82308935",0x34F8],
- ["82308936",0x34F9],
- ["82308937",0x34FA],
- ["82308938",0x34FB],
- ["82308939",0x34FC],
- ["82308A30",0x34FD],
- ["82308A31",0x34FE],
- ["82308A32",0x34FF],
- ["82308A33",0x3500],
- ["82308A34",0x3501],
- ["82308A35",0x3502],
- ["82308A36",0x3503],
- ["82308A37",0x3504],
- ["82308A38",0x3505],
- ["82308A39",0x3506],
- ["82308B30",0x3507],
- ["82308B31",0x3508],
- ["82308B32",0x3509],
- ["82308B33",0x350A],
- ["82308B34",0x350B],
- ["82308B35",0x350C],
- ["82308B36",0x350D],
- ["82308B37",0x350E],
- ["82308B38",0x350F],
- ["82308B39",0x3510],
- ["82308C30",0x3511],
- ["82308C31",0x3512],
- ["82308C32",0x3513],
- ["82308C33",0x3514],
- ["82308C34",0x3515],
- ["82308C35",0x3516],
- ["82308C36",0x3517],
- ["82308C37",0x3518],
- ["82308C38",0x3519],
- ["82308C39",0x351A],
- ["82308D30",0x351B],
- ["82308D31",0x351C],
- ["82308D32",0x351D],
- ["82308D33",0x351E],
- ["82308D34",0x351F],
- ["82308D35",0x3520],
- ["82308D36",0x3521],
- ["82308D37",0x3522],
- ["82308D38",0x3523],
- ["82308D39",0x3524],
- ["82308E30",0x3525],
- ["82308E31",0x3526],
- ["82308E32",0x3527],
- ["82308E33",0x3528],
- ["82308E34",0x3529],
- ["82308E35",0x352A],
- ["82308E36",0x352B],
- ["82308E37",0x352C],
- ["82308E38",0x352D],
- ["82308E39",0x352E],
- ["82308F30",0x352F],
- ["82308F31",0x3530],
- ["82308F32",0x3531],
- ["82308F33",0x3532],
- ["82308F34",0x3533],
- ["82308F35",0x3534],
- ["82308F36",0x3535],
- ["82308F37",0x3536],
- ["82308F38",0x3537],
- ["82308F39",0x3538],
- ["82309030",0x3539],
- ["82309031",0x353A],
- ["82309032",0x353B],
- ["82309033",0x353C],
- ["82309034",0x353D],
- ["82309035",0x353E],
- ["82309036",0x353F],
- ["82309037",0x3540],
- ["82309038",0x3541],
- ["82309039",0x3542],
- ["82309130",0x3543],
- ["82309131",0x3544],
- ["82309132",0x3545],
- ["82309133",0x3546],
- ["82309134",0x3547],
- ["82309135",0x3548],
- ["82309136",0x3549],
- ["82309137",0x354A],
- ["82309138",0x354B],
- ["82309139",0x354C],
- ["82309230",0x354D],
- ["82309231",0x354E],
- ["82309232",0x354F],
- ["82309233",0x3550],
- ["82309234",0x3551],
- ["82309235",0x3552],
- ["82309236",0x3553],
- ["82309237",0x3554],
- ["82309238",0x3555],
- ["82309239",0x3556],
- ["82309330",0x3557],
- ["82309331",0x3558],
- ["82309332",0x3559],
- ["82309333",0x355A],
- ["82309334",0x355B],
- ["82309335",0x355C],
- ["82309336",0x355D],
- ["82309337",0x355E],
- ["82309338",0x355F],
- ["82309339",0x3560],
- ["82309430",0x3561],
- ["82309431",0x3562],
- ["82309432",0x3563],
- ["82309433",0x3564],
- ["82309434",0x3565],
- ["82309435",0x3566],
- ["82309436",0x3567],
- ["82309437",0x3568],
- ["82309438",0x3569],
- ["82309439",0x356A],
- ["82309530",0x356B],
- ["82309531",0x356C],
- ["82309532",0x356D],
- ["82309533",0x356E],
- ["82309534",0x356F],
- ["82309535",0x3570],
- ["82309536",0x3571],
- ["82309537",0x3572],
- ["82309538",0x3573],
- ["82309539",0x3574],
- ["82309630",0x3575],
- ["82309631",0x3576],
- ["82309632",0x3577],
- ["82309633",0x3578],
- ["82309634",0x3579],
- ["82309635",0x357A],
- ["82309636",0x357B],
- ["82309637",0x357C],
- ["82309638",0x357D],
- ["82309639",0x357E],
- ["82309730",0x357F],
- ["82309731",0x3580],
- ["82309732",0x3581],
- ["82309733",0x3582],
- ["82309734",0x3583],
- ["82309735",0x3584],
- ["82309736",0x3585],
- ["82309737",0x3586],
- ["82309738",0x3587],
- ["82309739",0x3588],
- ["82309830",0x3589],
- ["82309831",0x358A],
- ["82309832",0x358B],
- ["82309833",0x358C],
- ["82309834",0x358D],
- ["82309835",0x358E],
- ["82309836",0x358F],
- ["82309837",0x3590],
- ["82309838",0x3591],
- ["82309839",0x3592],
- ["82309930",0x3593],
- ["82309931",0x3594],
- ["82309932",0x3595],
- ["82309933",0x3596],
- ["82309934",0x3597],
- ["82309935",0x3598],
- ["82309936",0x3599],
- ["82309937",0x359A],
- ["82309938",0x359B],
- ["82309939",0x359C],
- ["82309A30",0x359D],
- ["FE5A",0x359E],
- ["82309A31",0x359F],
- ["82309A32",0x35A0],
- ["82309A33",0x35A1],
- ["82309A34",0x35A2],
- ["82309A35",0x35A3],
- ["82309A36",0x35A4],
- ["82309A37",0x35A5],
- ["82309A38",0x35A6],
- ["82309A39",0x35A7],
- ["82309B30",0x35A8],
- ["82309B31",0x35A9],
- ["82309B32",0x35AA],
- ["82309B33",0x35AB],
- ["82309B34",0x35AC],
- ["82309B35",0x35AD],
- ["82309B36",0x35AE],
- ["82309B37",0x35AF],
- ["82309B38",0x35B0],
- ["82309B39",0x35B1],
- ["82309C30",0x35B2],
- ["82309C31",0x35B3],
- ["82309C32",0x35B4],
- ["82309C33",0x35B5],
- ["82309C34",0x35B6],
- ["82309C35",0x35B7],
- ["82309C36",0x35B8],
- ["82309C37",0x35B9],
- ["82309C38",0x35BA],
- ["82309C39",0x35BB],
- ["82309D30",0x35BC],
- ["82309D31",0x35BD],
- ["82309D32",0x35BE],
- ["82309D33",0x35BF],
- ["82309D34",0x35C0],
- ["82309D35",0x35C1],
- ["82309D36",0x35C2],
- ["82309D37",0x35C3],
- ["82309D38",0x35C4],
- ["82309D39",0x35C5],
- ["82309E30",0x35C6],
- ["82309E31",0x35C7],
- ["82309E32",0x35C8],
- ["82309E33",0x35C9],
- ["82309E34",0x35CA],
- ["82309E35",0x35CB],
- ["82309E36",0x35CC],
- ["82309E37",0x35CD],
- ["82309E38",0x35CE],
- ["82309E39",0x35CF],
- ["82309F30",0x35D0],
- ["82309F31",0x35D1],
- ["82309F32",0x35D2],
- ["82309F33",0x35D3],
- ["82309F34",0x35D4],
- ["82309F35",0x35D5],
- ["82309F36",0x35D6],
- ["82309F37",0x35D7],
- ["82309F38",0x35D8],
- ["82309F39",0x35D9],
- ["8230A030",0x35DA],
- ["8230A031",0x35DB],
- ["8230A032",0x35DC],
- ["8230A033",0x35DD],
- ["8230A034",0x35DE],
- ["8230A035",0x35DF],
- ["8230A036",0x35E0],
- ["8230A037",0x35E1],
- ["8230A038",0x35E2],
- ["8230A039",0x35E3],
- ["8230A130",0x35E4],
- ["8230A131",0x35E5],
- ["8230A132",0x35E6],
- ["8230A133",0x35E7],
- ["8230A134",0x35E8],
- ["8230A135",0x35E9],
- ["8230A136",0x35EA],
- ["8230A137",0x35EB],
- ["8230A138",0x35EC],
- ["8230A139",0x35ED],
- ["8230A230",0x35EE],
- ["8230A231",0x35EF],
- ["8230A232",0x35F0],
- ["8230A233",0x35F1],
- ["8230A234",0x35F2],
- ["8230A235",0x35F3],
- ["8230A236",0x35F4],
- ["8230A237",0x35F5],
- ["8230A238",0x35F6],
- ["8230A239",0x35F7],
- ["8230A330",0x35F8],
- ["8230A331",0x35F9],
- ["8230A332",0x35FA],
- ["8230A333",0x35FB],
- ["8230A334",0x35FC],
- ["8230A335",0x35FD],
- ["8230A336",0x35FE],
- ["8230A337",0x35FF],
- ["8230A338",0x3600],
- ["8230A339",0x3601],
- ["8230A430",0x3602],
- ["8230A431",0x3603],
- ["8230A432",0x3604],
- ["8230A433",0x3605],
- ["8230A434",0x3606],
- ["8230A435",0x3607],
- ["8230A436",0x3608],
- ["8230A437",0x3609],
- ["8230A438",0x360A],
- ["8230A439",0x360B],
- ["8230A530",0x360C],
- ["8230A531",0x360D],
- ["FE5C",0x360E],
- ["8230A532",0x360F],
- ["8230A533",0x3610],
- ["8230A534",0x3611],
- ["8230A535",0x3612],
- ["8230A536",0x3613],
- ["8230A537",0x3614],
- ["8230A538",0x3615],
- ["8230A539",0x3616],
- ["8230A630",0x3617],
- ["8230A631",0x3618],
- ["8230A632",0x3619],
- ["FE5B",0x361A],
- ["8230A633",0x361B],
- ["8230A634",0x361C],
- ["8230A635",0x361D],
- ["8230A636",0x361E],
- ["8230A637",0x361F],
- ["8230A638",0x3620],
- ["8230A639",0x3621],
- ["8230A730",0x3622],
- ["8230A731",0x3623],
- ["8230A732",0x3624],
- ["8230A733",0x3625],
- ["8230A734",0x3626],
- ["8230A735",0x3627],
- ["8230A736",0x3628],
- ["8230A737",0x3629],
- ["8230A738",0x362A],
- ["8230A739",0x362B],
- ["8230A830",0x362C],
- ["8230A831",0x362D],
- ["8230A832",0x362E],
- ["8230A833",0x362F],
- ["8230A834",0x3630],
- ["8230A835",0x3631],
- ["8230A836",0x3632],
- ["8230A837",0x3633],
- ["8230A838",0x3634],
- ["8230A839",0x3635],
- ["8230A930",0x3636],
- ["8230A931",0x3637],
- ["8230A932",0x3638],
- ["8230A933",0x3639],
- ["8230A934",0x363A],
- ["8230A935",0x363B],
- ["8230A936",0x363C],
- ["8230A937",0x363D],
- ["8230A938",0x363E],
- ["8230A939",0x363F],
- ["8230AA30",0x3640],
- ["8230AA31",0x3641],
- ["8230AA32",0x3642],
- ["8230AA33",0x3643],
- ["8230AA34",0x3644],
- ["8230AA35",0x3645],
- ["8230AA36",0x3646],
- ["8230AA37",0x3647],
- ["8230AA38",0x3648],
- ["8230AA39",0x3649],
- ["8230AB30",0x364A],
- ["8230AB31",0x364B],
- ["8230AB32",0x364C],
- ["8230AB33",0x364D],
- ["8230AB34",0x364E],
- ["8230AB35",0x364F],
- ["8230AB36",0x3650],
- ["8230AB37",0x3651],
- ["8230AB38",0x3652],
- ["8230AB39",0x3653],
- ["8230AC30",0x3654],
- ["8230AC31",0x3655],
- ["8230AC32",0x3656],
- ["8230AC33",0x3657],
- ["8230AC34",0x3658],
- ["8230AC35",0x3659],
- ["8230AC36",0x365A],
- ["8230AC37",0x365B],
- ["8230AC38",0x365C],
- ["8230AC39",0x365D],
- ["8230AD30",0x365E],
- ["8230AD31",0x365F],
- ["8230AD32",0x3660],
- ["8230AD33",0x3661],
- ["8230AD34",0x3662],
- ["8230AD35",0x3663],
- ["8230AD36",0x3664],
- ["8230AD37",0x3665],
- ["8230AD38",0x3666],
- ["8230AD39",0x3667],
- ["8230AE30",0x3668],
- ["8230AE31",0x3669],
- ["8230AE32",0x366A],
- ["8230AE33",0x366B],
- ["8230AE34",0x366C],
- ["8230AE35",0x366D],
- ["8230AE36",0x366E],
- ["8230AE37",0x366F],
- ["8230AE38",0x3670],
- ["8230AE39",0x3671],
- ["8230AF30",0x3672],
- ["8230AF31",0x3673],
- ["8230AF32",0x3674],
- ["8230AF33",0x3675],
- ["8230AF34",0x3676],
- ["8230AF35",0x3677],
- ["8230AF36",0x3678],
- ["8230AF37",0x3679],
- ["8230AF38",0x367A],
- ["8230AF39",0x367B],
- ["8230B030",0x367C],
- ["8230B031",0x367D],
- ["8230B032",0x367E],
- ["8230B033",0x367F],
- ["8230B034",0x3680],
- ["8230B035",0x3681],
- ["8230B036",0x3682],
- ["8230B037",0x3683],
- ["8230B038",0x3684],
- ["8230B039",0x3685],
- ["8230B130",0x3686],
- ["8230B131",0x3687],
- ["8230B132",0x3688],
- ["8230B133",0x3689],
- ["8230B134",0x368A],
- ["8230B135",0x368B],
- ["8230B136",0x368C],
- ["8230B137",0x368D],
- ["8230B138",0x368E],
- ["8230B139",0x368F],
- ["8230B230",0x3690],
- ["8230B231",0x3691],
- ["8230B232",0x3692],
- ["8230B233",0x3693],
- ["8230B234",0x3694],
- ["8230B235",0x3695],
- ["8230B236",0x3696],
- ["8230B237",0x3697],
- ["8230B238",0x3698],
- ["8230B239",0x3699],
- ["8230B330",0x369A],
- ["8230B331",0x369B],
- ["8230B332",0x369C],
- ["8230B333",0x369D],
- ["8230B334",0x369E],
- ["8230B335",0x369F],
- ["8230B336",0x36A0],
- ["8230B337",0x36A1],
- ["8230B338",0x36A2],
- ["8230B339",0x36A3],
- ["8230B430",0x36A4],
- ["8230B431",0x36A5],
- ["8230B432",0x36A6],
- ["8230B433",0x36A7],
- ["8230B434",0x36A8],
- ["8230B435",0x36A9],
- ["8230B436",0x36AA],
- ["8230B437",0x36AB],
- ["8230B438",0x36AC],
- ["8230B439",0x36AD],
- ["8230B530",0x36AE],
- ["8230B531",0x36AF],
- ["8230B532",0x36B0],
- ["8230B533",0x36B1],
- ["8230B534",0x36B2],
- ["8230B535",0x36B3],
- ["8230B536",0x36B4],
- ["8230B537",0x36B5],
- ["8230B538",0x36B6],
- ["8230B539",0x36B7],
- ["8230B630",0x36B8],
- ["8230B631",0x36B9],
- ["8230B632",0x36BA],
- ["8230B633",0x36BB],
- ["8230B634",0x36BC],
- ["8230B635",0x36BD],
- ["8230B636",0x36BE],
- ["8230B637",0x36BF],
- ["8230B638",0x36C0],
- ["8230B639",0x36C1],
- ["8230B730",0x36C2],
- ["8230B731",0x36C3],
- ["8230B732",0x36C4],
- ["8230B733",0x36C5],
- ["8230B734",0x36C6],
- ["8230B735",0x36C7],
- ["8230B736",0x36C8],
- ["8230B737",0x36C9],
- ["8230B738",0x36CA],
- ["8230B739",0x36CB],
- ["8230B830",0x36CC],
- ["8230B831",0x36CD],
- ["8230B832",0x36CE],
- ["8230B833",0x36CF],
- ["8230B834",0x36D0],
- ["8230B835",0x36D1],
- ["8230B836",0x36D2],
- ["8230B837",0x36D3],
- ["8230B838",0x36D4],
- ["8230B839",0x36D5],
- ["8230B930",0x36D6],
- ["8230B931",0x36D7],
- ["8230B932",0x36D8],
- ["8230B933",0x36D9],
- ["8230B934",0x36DA],
- ["8230B935",0x36DB],
- ["8230B936",0x36DC],
- ["8230B937",0x36DD],
- ["8230B938",0x36DE],
- ["8230B939",0x36DF],
- ["8230BA30",0x36E0],
- ["8230BA31",0x36E1],
- ["8230BA32",0x36E2],
- ["8230BA33",0x36E3],
- ["8230BA34",0x36E4],
- ["8230BA35",0x36E5],
- ["8230BA36",0x36E6],
- ["8230BA37",0x36E7],
- ["8230BA38",0x36E8],
- ["8230BA39",0x36E9],
- ["8230BB30",0x36EA],
- ["8230BB31",0x36EB],
- ["8230BB32",0x36EC],
- ["8230BB33",0x36ED],
- ["8230BB34",0x36EE],
- ["8230BB35",0x36EF],
- ["8230BB36",0x36F0],
- ["8230BB37",0x36F1],
- ["8230BB38",0x36F2],
- ["8230BB39",0x36F3],
- ["8230BC30",0x36F4],
- ["8230BC31",0x36F5],
- ["8230BC32",0x36F6],
- ["8230BC33",0x36F7],
- ["8230BC34",0x36F8],
- ["8230BC35",0x36F9],
- ["8230BC36",0x36FA],
- ["8230BC37",0x36FB],
- ["8230BC38",0x36FC],
- ["8230BC39",0x36FD],
- ["8230BD30",0x36FE],
- ["8230BD31",0x36FF],
- ["8230BD32",0x3700],
- ["8230BD33",0x3701],
- ["8230BD34",0x3702],
- ["8230BD35",0x3703],
- ["8230BD36",0x3704],
- ["8230BD37",0x3705],
- ["8230BD38",0x3706],
- ["8230BD39",0x3707],
- ["8230BE30",0x3708],
- ["8230BE31",0x3709],
- ["8230BE32",0x370A],
- ["8230BE33",0x370B],
- ["8230BE34",0x370C],
- ["8230BE35",0x370D],
- ["8230BE36",0x370E],
- ["8230BE37",0x370F],
- ["8230BE38",0x3710],
- ["8230BE39",0x3711],
- ["8230BF30",0x3712],
- ["8230BF31",0x3713],
- ["8230BF32",0x3714],
- ["8230BF33",0x3715],
- ["8230BF34",0x3716],
- ["8230BF35",0x3717],
- ["8230BF36",0x3718],
- ["8230BF37",0x3719],
- ["8230BF38",0x371A],
- ["8230BF39",0x371B],
- ["8230C030",0x371C],
- ["8230C031",0x371D],
- ["8230C032",0x371E],
- ["8230C033",0x371F],
- ["8230C034",0x3720],
- ["8230C035",0x3721],
- ["8230C036",0x3722],
- ["8230C037",0x3723],
- ["8230C038",0x3724],
- ["8230C039",0x3725],
- ["8230C130",0x3726],
- ["8230C131",0x3727],
- ["8230C132",0x3728],
- ["8230C133",0x3729],
- ["8230C134",0x372A],
- ["8230C135",0x372B],
- ["8230C136",0x372C],
- ["8230C137",0x372D],
- ["8230C138",0x372E],
- ["8230C139",0x372F],
- ["8230C230",0x3730],
- ["8230C231",0x3731],
- ["8230C232",0x3732],
- ["8230C233",0x3733],
- ["8230C234",0x3734],
- ["8230C235",0x3735],
- ["8230C236",0x3736],
- ["8230C237",0x3737],
- ["8230C238",0x3738],
- ["8230C239",0x3739],
- ["8230C330",0x373A],
- ["8230C331",0x373B],
- ["8230C332",0x373C],
- ["8230C333",0x373D],
- ["8230C334",0x373E],
- ["8230C335",0x373F],
- ["8230C336",0x3740],
- ["8230C337",0x3741],
- ["8230C338",0x3742],
- ["8230C339",0x3743],
- ["8230C430",0x3744],
- ["8230C431",0x3745],
- ["8230C432",0x3746],
- ["8230C433",0x3747],
- ["8230C434",0x3748],
- ["8230C435",0x3749],
- ["8230C436",0x374A],
- ["8230C437",0x374B],
- ["8230C438",0x374C],
- ["8230C439",0x374D],
- ["8230C530",0x374E],
- ["8230C531",0x374F],
- ["8230C532",0x3750],
- ["8230C533",0x3751],
- ["8230C534",0x3752],
- ["8230C535",0x3753],
- ["8230C536",0x3754],
- ["8230C537",0x3755],
- ["8230C538",0x3756],
- ["8230C539",0x3757],
- ["8230C630",0x3758],
- ["8230C631",0x3759],
- ["8230C632",0x375A],
- ["8230C633",0x375B],
- ["8230C634",0x375C],
- ["8230C635",0x375D],
- ["8230C636",0x375E],
- ["8230C637",0x375F],
- ["8230C638",0x3760],
- ["8230C639",0x3761],
- ["8230C730",0x3762],
- ["8230C731",0x3763],
- ["8230C732",0x3764],
- ["8230C733",0x3765],
- ["8230C734",0x3766],
- ["8230C735",0x3767],
- ["8230C736",0x3768],
- ["8230C737",0x3769],
- ["8230C738",0x376A],
- ["8230C739",0x376B],
- ["8230C830",0x376C],
- ["8230C831",0x376D],
- ["8230C832",0x376E],
- ["8230C833",0x376F],
- ["8230C834",0x3770],
- ["8230C835",0x3771],
- ["8230C836",0x3772],
- ["8230C837",0x3773],
- ["8230C838",0x3774],
- ["8230C839",0x3775],
- ["8230C930",0x3776],
- ["8230C931",0x3777],
- ["8230C932",0x3778],
- ["8230C933",0x3779],
- ["8230C934",0x377A],
- ["8230C935",0x377B],
- ["8230C936",0x377C],
- ["8230C937",0x377D],
- ["8230C938",0x377E],
- ["8230C939",0x377F],
- ["8230CA30",0x3780],
- ["8230CA31",0x3781],
- ["8230CA32",0x3782],
- ["8230CA33",0x3783],
- ["8230CA34",0x3784],
- ["8230CA35",0x3785],
- ["8230CA36",0x3786],
- ["8230CA37",0x3787],
- ["8230CA38",0x3788],
- ["8230CA39",0x3789],
- ["8230CB30",0x378A],
- ["8230CB31",0x378B],
- ["8230CB32",0x378C],
- ["8230CB33",0x378D],
- ["8230CB34",0x378E],
- ["8230CB35",0x378F],
- ["8230CB36",0x3790],
- ["8230CB37",0x3791],
- ["8230CB38",0x3792],
- ["8230CB39",0x3793],
- ["8230CC30",0x3794],
- ["8230CC31",0x3795],
- ["8230CC32",0x3796],
- ["8230CC33",0x3797],
- ["8230CC34",0x3798],
- ["8230CC35",0x3799],
- ["8230CC36",0x379A],
- ["8230CC37",0x379B],
- ["8230CC38",0x379C],
- ["8230CC39",0x379D],
- ["8230CD30",0x379E],
- ["8230CD31",0x379F],
- ["8230CD32",0x37A0],
- ["8230CD33",0x37A1],
- ["8230CD34",0x37A2],
- ["8230CD35",0x37A3],
- ["8230CD36",0x37A4],
- ["8230CD37",0x37A5],
- ["8230CD38",0x37A6],
- ["8230CD39",0x37A7],
- ["8230CE30",0x37A8],
- ["8230CE31",0x37A9],
- ["8230CE32",0x37AA],
- ["8230CE33",0x37AB],
- ["8230CE34",0x37AC],
- ["8230CE35",0x37AD],
- ["8230CE36",0x37AE],
- ["8230CE37",0x37AF],
- ["8230CE38",0x37B0],
- ["8230CE39",0x37B1],
- ["8230CF30",0x37B2],
- ["8230CF31",0x37B3],
- ["8230CF32",0x37B4],
- ["8230CF33",0x37B5],
- ["8230CF34",0x37B6],
- ["8230CF35",0x37B7],
- ["8230CF36",0x37B8],
- ["8230CF37",0x37B9],
- ["8230CF38",0x37BA],
- ["8230CF39",0x37BB],
- ["8230D030",0x37BC],
- ["8230D031",0x37BD],
- ["8230D032",0x37BE],
- ["8230D033",0x37BF],
- ["8230D034",0x37C0],
- ["8230D035",0x37C1],
- ["8230D036",0x37C2],
- ["8230D037",0x37C3],
- ["8230D038",0x37C4],
- ["8230D039",0x37C5],
- ["8230D130",0x37C6],
- ["8230D131",0x37C7],
- ["8230D132",0x37C8],
- ["8230D133",0x37C9],
- ["8230D134",0x37CA],
- ["8230D135",0x37CB],
- ["8230D136",0x37CC],
- ["8230D137",0x37CD],
- ["8230D138",0x37CE],
- ["8230D139",0x37CF],
- ["8230D230",0x37D0],
- ["8230D231",0x37D1],
- ["8230D232",0x37D2],
- ["8230D233",0x37D3],
- ["8230D234",0x37D4],
- ["8230D235",0x37D5],
- ["8230D236",0x37D6],
- ["8230D237",0x37D7],
- ["8230D238",0x37D8],
- ["8230D239",0x37D9],
- ["8230D330",0x37DA],
- ["8230D331",0x37DB],
- ["8230D332",0x37DC],
- ["8230D333",0x37DD],
- ["8230D334",0x37DE],
- ["8230D335",0x37DF],
- ["8230D336",0x37E0],
- ["8230D337",0x37E1],
- ["8230D338",0x37E2],
- ["8230D339",0x37E3],
- ["8230D430",0x37E4],
- ["8230D431",0x37E5],
- ["8230D432",0x37E6],
- ["8230D433",0x37E7],
- ["8230D434",0x37E8],
- ["8230D435",0x37E9],
- ["8230D436",0x37EA],
- ["8230D437",0x37EB],
- ["8230D438",0x37EC],
- ["8230D439",0x37ED],
- ["8230D530",0x37EE],
- ["8230D531",0x37EF],
- ["8230D532",0x37F0],
- ["8230D533",0x37F1],
- ["8230D534",0x37F2],
- ["8230D535",0x37F3],
- ["8230D536",0x37F4],
- ["8230D537",0x37F5],
- ["8230D538",0x37F6],
- ["8230D539",0x37F7],
- ["8230D630",0x37F8],
- ["8230D631",0x37F9],
- ["8230D632",0x37FA],
- ["8230D633",0x37FB],
- ["8230D634",0x37FC],
- ["8230D635",0x37FD],
- ["8230D636",0x37FE],
- ["8230D637",0x37FF],
- ["8230D638",0x3800],
- ["8230D639",0x3801],
- ["8230D730",0x3802],
- ["8230D731",0x3803],
- ["8230D732",0x3804],
- ["8230D733",0x3805],
- ["8230D734",0x3806],
- ["8230D735",0x3807],
- ["8230D736",0x3808],
- ["8230D737",0x3809],
- ["8230D738",0x380A],
- ["8230D739",0x380B],
- ["8230D830",0x380C],
- ["8230D831",0x380D],
- ["8230D832",0x380E],
- ["8230D833",0x380F],
- ["8230D834",0x3810],
- ["8230D835",0x3811],
- ["8230D836",0x3812],
- ["8230D837",0x3813],
- ["8230D838",0x3814],
- ["8230D839",0x3815],
- ["8230D930",0x3816],
- ["8230D931",0x3817],
- ["8230D932",0x3818],
- ["8230D933",0x3819],
- ["8230D934",0x381A],
- ["8230D935",0x381B],
- ["8230D936",0x381C],
- ["8230D937",0x381D],
- ["8230D938",0x381E],
- ["8230D939",0x381F],
- ["8230DA30",0x3820],
- ["8230DA31",0x3821],
- ["8230DA32",0x3822],
- ["8230DA33",0x3823],
- ["8230DA34",0x3824],
- ["8230DA35",0x3825],
- ["8230DA36",0x3826],
- ["8230DA37",0x3827],
- ["8230DA38",0x3828],
- ["8230DA39",0x3829],
- ["8230DB30",0x382A],
- ["8230DB31",0x382B],
- ["8230DB32",0x382C],
- ["8230DB33",0x382D],
- ["8230DB34",0x382E],
- ["8230DB35",0x382F],
- ["8230DB36",0x3830],
- ["8230DB37",0x3831],
- ["8230DB38",0x3832],
- ["8230DB39",0x3833],
- ["8230DC30",0x3834],
- ["8230DC31",0x3835],
- ["8230DC32",0x3836],
- ["8230DC33",0x3837],
- ["8230DC34",0x3838],
- ["8230DC35",0x3839],
- ["8230DC36",0x383A],
- ["8230DC37",0x383B],
- ["8230DC38",0x383C],
- ["8230DC39",0x383D],
- ["8230DD30",0x383E],
- ["8230DD31",0x383F],
- ["8230DD32",0x3840],
- ["8230DD33",0x3841],
- ["8230DD34",0x3842],
- ["8230DD35",0x3843],
- ["8230DD36",0x3844],
- ["8230DD37",0x3845],
- ["8230DD38",0x3846],
- ["8230DD39",0x3847],
- ["8230DE30",0x3848],
- ["8230DE31",0x3849],
- ["8230DE32",0x384A],
- ["8230DE33",0x384B],
- ["8230DE34",0x384C],
- ["8230DE35",0x384D],
- ["8230DE36",0x384E],
- ["8230DE37",0x384F],
- ["8230DE38",0x3850],
- ["8230DE39",0x3851],
- ["8230DF30",0x3852],
- ["8230DF31",0x3853],
- ["8230DF32",0x3854],
- ["8230DF33",0x3855],
- ["8230DF34",0x3856],
- ["8230DF35",0x3857],
- ["8230DF36",0x3858],
- ["8230DF37",0x3859],
- ["8230DF38",0x385A],
- ["8230DF39",0x385B],
- ["8230E030",0x385C],
- ["8230E031",0x385D],
- ["8230E032",0x385E],
- ["8230E033",0x385F],
- ["8230E034",0x3860],
- ["8230E035",0x3861],
- ["8230E036",0x3862],
- ["8230E037",0x3863],
- ["8230E038",0x3864],
- ["8230E039",0x3865],
- ["8230E130",0x3866],
- ["8230E131",0x3867],
- ["8230E132",0x3868],
- ["8230E133",0x3869],
- ["8230E134",0x386A],
- ["8230E135",0x386B],
- ["8230E136",0x386C],
- ["8230E137",0x386D],
- ["8230E138",0x386E],
- ["8230E139",0x386F],
- ["8230E230",0x3870],
- ["8230E231",0x3871],
- ["8230E232",0x3872],
- ["8230E233",0x3873],
- ["8230E234",0x3874],
- ["8230E235",0x3875],
- ["8230E236",0x3876],
- ["8230E237",0x3877],
- ["8230E238",0x3878],
- ["8230E239",0x3879],
- ["8230E330",0x387A],
- ["8230E331",0x387B],
- ["8230E332",0x387C],
- ["8230E333",0x387D],
- ["8230E334",0x387E],
- ["8230E335",0x387F],
- ["8230E336",0x3880],
- ["8230E337",0x3881],
- ["8230E338",0x3882],
- ["8230E339",0x3883],
- ["8230E430",0x3884],
- ["8230E431",0x3885],
- ["8230E432",0x3886],
- ["8230E433",0x3887],
- ["8230E434",0x3888],
- ["8230E435",0x3889],
- ["8230E436",0x388A],
- ["8230E437",0x388B],
- ["8230E438",0x388C],
- ["8230E439",0x388D],
- ["8230E530",0x388E],
- ["8230E531",0x388F],
- ["8230E532",0x3890],
- ["8230E533",0x3891],
- ["8230E534",0x3892],
- ["8230E535",0x3893],
- ["8230E536",0x3894],
- ["8230E537",0x3895],
- ["8230E538",0x3896],
- ["8230E539",0x3897],
- ["8230E630",0x3898],
- ["8230E631",0x3899],
- ["8230E632",0x389A],
- ["8230E633",0x389B],
- ["8230E634",0x389C],
- ["8230E635",0x389D],
- ["8230E636",0x389E],
- ["8230E637",0x389F],
- ["8230E638",0x38A0],
- ["8230E639",0x38A1],
- ["8230E730",0x38A2],
- ["8230E731",0x38A3],
- ["8230E732",0x38A4],
- ["8230E733",0x38A5],
- ["8230E734",0x38A6],
- ["8230E735",0x38A7],
- ["8230E736",0x38A8],
- ["8230E737",0x38A9],
- ["8230E738",0x38AA],
- ["8230E739",0x38AB],
- ["8230E830",0x38AC],
- ["8230E831",0x38AD],
- ["8230E832",0x38AE],
- ["8230E833",0x38AF],
- ["8230E834",0x38B0],
- ["8230E835",0x38B1],
- ["8230E836",0x38B2],
- ["8230E837",0x38B3],
- ["8230E838",0x38B4],
- ["8230E839",0x38B5],
- ["8230E930",0x38B6],
- ["8230E931",0x38B7],
- ["8230E932",0x38B8],
- ["8230E933",0x38B9],
- ["8230E934",0x38BA],
- ["8230E935",0x38BB],
- ["8230E936",0x38BC],
- ["8230E937",0x38BD],
- ["8230E938",0x38BE],
- ["8230E939",0x38BF],
- ["8230EA30",0x38C0],
- ["8230EA31",0x38C1],
- ["8230EA32",0x38C2],
- ["8230EA33",0x38C3],
- ["8230EA34",0x38C4],
- ["8230EA35",0x38C5],
- ["8230EA36",0x38C6],
- ["8230EA37",0x38C7],
- ["8230EA38",0x38C8],
- ["8230EA39",0x38C9],
- ["8230EB30",0x38CA],
- ["8230EB31",0x38CB],
- ["8230EB32",0x38CC],
- ["8230EB33",0x38CD],
- ["8230EB34",0x38CE],
- ["8230EB35",0x38CF],
- ["8230EB36",0x38D0],
- ["8230EB37",0x38D1],
- ["8230EB38",0x38D2],
- ["8230EB39",0x38D3],
- ["8230EC30",0x38D4],
- ["8230EC31",0x38D5],
- ["8230EC32",0x38D6],
- ["8230EC33",0x38D7],
- ["8230EC34",0x38D8],
- ["8230EC35",0x38D9],
- ["8230EC36",0x38DA],
- ["8230EC37",0x38DB],
- ["8230EC38",0x38DC],
- ["8230EC39",0x38DD],
- ["8230ED30",0x38DE],
- ["8230ED31",0x38DF],
- ["8230ED32",0x38E0],
- ["8230ED33",0x38E1],
- ["8230ED34",0x38E2],
- ["8230ED35",0x38E3],
- ["8230ED36",0x38E4],
- ["8230ED37",0x38E5],
- ["8230ED38",0x38E6],
- ["8230ED39",0x38E7],
- ["8230EE30",0x38E8],
- ["8230EE31",0x38E9],
- ["8230EE32",0x38EA],
- ["8230EE33",0x38EB],
- ["8230EE34",0x38EC],
- ["8230EE35",0x38ED],
- ["8230EE36",0x38EE],
- ["8230EE37",0x38EF],
- ["8230EE38",0x38F0],
- ["8230EE39",0x38F1],
- ["8230EF30",0x38F2],
- ["8230EF31",0x38F3],
- ["8230EF32",0x38F4],
- ["8230EF33",0x38F5],
- ["8230EF34",0x38F6],
- ["8230EF35",0x38F7],
- ["8230EF36",0x38F8],
- ["8230EF37",0x38F9],
- ["8230EF38",0x38FA],
- ["8230EF39",0x38FB],
- ["8230F030",0x38FC],
- ["8230F031",0x38FD],
- ["8230F032",0x38FE],
- ["8230F033",0x38FF],
- ["8230F034",0x3900],
- ["8230F035",0x3901],
- ["8230F036",0x3902],
- ["8230F037",0x3903],
- ["8230F038",0x3904],
- ["8230F039",0x3905],
- ["8230F130",0x3906],
- ["8230F131",0x3907],
- ["8230F132",0x3908],
- ["8230F133",0x3909],
- ["8230F134",0x390A],
- ["8230F135",0x390B],
- ["8230F136",0x390C],
- ["8230F137",0x390D],
- ["8230F138",0x390E],
- ["8230F139",0x390F],
- ["8230F230",0x3910],
- ["8230F231",0x3911],
- ["8230F232",0x3912],
- ["8230F233",0x3913],
- ["8230F234",0x3914],
- ["8230F235",0x3915],
- ["8230F236",0x3916],
- ["8230F237",0x3917],
- ["FE60",0x3918],
- ["8230F238",0x3919],
- ["8230F239",0x391A],
- ["8230F330",0x391B],
- ["8230F331",0x391C],
- ["8230F332",0x391D],
- ["8230F333",0x391E],
- ["8230F334",0x391F],
- ["8230F335",0x3920],
- ["8230F336",0x3921],
- ["8230F337",0x3922],
- ["8230F338",0x3923],
- ["8230F339",0x3924],
- ["8230F430",0x3925],
- ["8230F431",0x3926],
- ["8230F432",0x3927],
- ["8230F433",0x3928],
- ["8230F434",0x3929],
- ["8230F435",0x392A],
- ["8230F436",0x392B],
- ["8230F437",0x392C],
- ["8230F438",0x392D],
- ["8230F439",0x392E],
- ["8230F530",0x392F],
- ["8230F531",0x3930],
- ["8230F532",0x3931],
- ["8230F533",0x3932],
- ["8230F534",0x3933],
- ["8230F535",0x3934],
- ["8230F536",0x3935],
- ["8230F537",0x3936],
- ["8230F538",0x3937],
- ["8230F539",0x3938],
- ["8230F630",0x3939],
- ["8230F631",0x393A],
- ["8230F632",0x393B],
- ["8230F633",0x393C],
- ["8230F634",0x393D],
- ["8230F635",0x393E],
- ["8230F636",0x393F],
- ["8230F637",0x3940],
- ["8230F638",0x3941],
- ["8230F639",0x3942],
- ["8230F730",0x3943],
- ["8230F731",0x3944],
- ["8230F732",0x3945],
- ["8230F733",0x3946],
- ["8230F734",0x3947],
- ["8230F735",0x3948],
- ["8230F736",0x3949],
- ["8230F737",0x394A],
- ["8230F738",0x394B],
- ["8230F739",0x394C],
- ["8230F830",0x394D],
- ["8230F831",0x394E],
- ["8230F832",0x394F],
- ["8230F833",0x3950],
- ["8230F834",0x3951],
- ["8230F835",0x3952],
- ["8230F836",0x3953],
- ["8230F837",0x3954],
- ["8230F838",0x3955],
- ["8230F839",0x3956],
- ["8230F930",0x3957],
- ["8230F931",0x3958],
- ["8230F932",0x3959],
- ["8230F933",0x395A],
- ["8230F934",0x395B],
- ["8230F935",0x395C],
- ["8230F936",0x395D],
- ["8230F937",0x395E],
- ["8230F938",0x395F],
- ["8230F939",0x3960],
- ["8230FA30",0x3961],
- ["8230FA31",0x3962],
- ["8230FA32",0x3963],
- ["8230FA33",0x3964],
- ["8230FA34",0x3965],
- ["8230FA35",0x3966],
- ["8230FA36",0x3967],
- ["8230FA37",0x3968],
- ["8230FA38",0x3969],
- ["8230FA39",0x396A],
- ["8230FB30",0x396B],
- ["8230FB31",0x396C],
- ["8230FB32",0x396D],
- ["FE5F",0x396E],
- ["8230FB33",0x396F],
- ["8230FB34",0x3970],
- ["8230FB35",0x3971],
- ["8230FB36",0x3972],
- ["8230FB37",0x3973],
- ["8230FB38",0x3974],
- ["8230FB39",0x3975],
- ["8230FC30",0x3976],
- ["8230FC31",0x3977],
- ["8230FC32",0x3978],
- ["8230FC33",0x3979],
- ["8230FC34",0x397A],
- ["8230FC35",0x397B],
- ["8230FC36",0x397C],
- ["8230FC37",0x397D],
- ["8230FC38",0x397E],
- ["8230FC39",0x397F],
- ["8230FD30",0x3980],
- ["8230FD31",0x3981],
- ["8230FD32",0x3982],
- ["8230FD33",0x3983],
- ["8230FD34",0x3984],
- ["8230FD35",0x3985],
- ["8230FD36",0x3986],
- ["8230FD37",0x3987],
- ["8230FD38",0x3988],
- ["8230FD39",0x3989],
- ["8230FE30",0x398A],
- ["8230FE31",0x398B],
- ["8230FE32",0x398C],
- ["8230FE33",0x398D],
- ["8230FE34",0x398E],
- ["8230FE35",0x398F],
- ["8230FE36",0x3990],
- ["8230FE37",0x3991],
- ["8230FE38",0x3992],
- ["8230FE39",0x3993],
- ["82318130",0x3994],
- ["82318131",0x3995],
- ["82318132",0x3996],
- ["82318133",0x3997],
- ["82318134",0x3998],
- ["82318135",0x3999],
- ["82318136",0x399A],
- ["82318137",0x399B],
- ["82318138",0x399C],
- ["82318139",0x399D],
- ["82318230",0x399E],
- ["82318231",0x399F],
- ["82318232",0x39A0],
- ["82318233",0x39A1],
- ["82318234",0x39A2],
- ["82318235",0x39A3],
- ["82318236",0x39A4],
- ["82318237",0x39A5],
- ["82318238",0x39A6],
- ["82318239",0x39A7],
- ["82318330",0x39A8],
- ["82318331",0x39A9],
- ["82318332",0x39AA],
- ["82318333",0x39AB],
- ["82318334",0x39AC],
- ["82318335",0x39AD],
- ["82318336",0x39AE],
- ["82318337",0x39AF],
- ["82318338",0x39B0],
- ["82318339",0x39B1],
- ["82318430",0x39B2],
- ["82318431",0x39B3],
- ["82318432",0x39B4],
- ["82318433",0x39B5],
- ["82318434",0x39B6],
- ["82318435",0x39B7],
- ["82318436",0x39B8],
- ["82318437",0x39B9],
- ["82318438",0x39BA],
- ["82318439",0x39BB],
- ["82318530",0x39BC],
- ["82318531",0x39BD],
- ["82318532",0x39BE],
- ["82318533",0x39BF],
- ["82318534",0x39C0],
- ["82318535",0x39C1],
- ["82318536",0x39C2],
- ["82318537",0x39C3],
- ["82318538",0x39C4],
- ["82318539",0x39C5],
- ["82318630",0x39C6],
- ["82318631",0x39C7],
- ["82318632",0x39C8],
- ["82318633",0x39C9],
- ["82318634",0x39CA],
- ["82318635",0x39CB],
- ["82318636",0x39CC],
- ["82318637",0x39CD],
- ["82318638",0x39CE],
- ["FE62",0x39CF],
- ["FE65",0x39D0],
- ["82318639",0x39D1],
- ["82318730",0x39D2],
- ["82318731",0x39D3],
- ["82318732",0x39D4],
- ["82318733",0x39D5],
- ["82318734",0x39D6],
- ["82318735",0x39D7],
- ["82318736",0x39D8],
- ["82318737",0x39D9],
- ["82318738",0x39DA],
- ["82318739",0x39DB],
- ["82318830",0x39DC],
- ["82318831",0x39DD],
- ["82318832",0x39DE],
- ["FE63",0x39DF],
- ["82318833",0x39E0],
- ["82318834",0x39E1],
- ["82318835",0x39E2],
- ["82318836",0x39E3],
- ["82318837",0x39E4],
- ["82318838",0x39E5],
- ["82318839",0x39E6],
- ["82318930",0x39E7],
- ["82318931",0x39E8],
- ["82318932",0x39E9],
- ["82318933",0x39EA],
- ["82318934",0x39EB],
- ["82318935",0x39EC],
- ["82318936",0x39ED],
- ["82318937",0x39EE],
- ["82318938",0x39EF],
- ["82318939",0x39F0],
- ["82318A30",0x39F1],
- ["82318A31",0x39F2],
- ["82318A32",0x39F3],
- ["82318A33",0x39F4],
- ["82318A34",0x39F5],
- ["82318A35",0x39F6],
- ["82318A36",0x39F7],
- ["82318A37",0x39F8],
- ["82318A38",0x39F9],
- ["82318A39",0x39FA],
- ["82318B30",0x39FB],
- ["82318B31",0x39FC],
- ["82318B32",0x39FD],
- ["82318B33",0x39FE],
- ["82318B34",0x39FF],
- ["82318B35",0x3A00],
- ["82318B36",0x3A01],
- ["82318B37",0x3A02],
- ["82318B38",0x3A03],
- ["82318B39",0x3A04],
- ["82318C30",0x3A05],
- ["82318C31",0x3A06],
- ["82318C32",0x3A07],
- ["82318C33",0x3A08],
- ["82318C34",0x3A09],
- ["82318C35",0x3A0A],
- ["82318C36",0x3A0B],
- ["82318C37",0x3A0C],
- ["82318C38",0x3A0D],
- ["82318C39",0x3A0E],
- ["82318D30",0x3A0F],
- ["82318D31",0x3A10],
- ["82318D32",0x3A11],
- ["82318D33",0x3A12],
- ["82318D34",0x3A13],
- ["82318D35",0x3A14],
- ["82318D36",0x3A15],
- ["82318D37",0x3A16],
- ["82318D38",0x3A17],
- ["82318D39",0x3A18],
- ["82318E30",0x3A19],
- ["82318E31",0x3A1A],
- ["82318E32",0x3A1B],
- ["82318E33",0x3A1C],
- ["82318E34",0x3A1D],
- ["82318E35",0x3A1E],
- ["82318E36",0x3A1F],
- ["82318E37",0x3A20],
- ["82318E38",0x3A21],
- ["82318E39",0x3A22],
- ["82318F30",0x3A23],
- ["82318F31",0x3A24],
- ["82318F32",0x3A25],
- ["82318F33",0x3A26],
- ["82318F34",0x3A27],
- ["82318F35",0x3A28],
- ["82318F36",0x3A29],
- ["82318F37",0x3A2A],
- ["82318F38",0x3A2B],
- ["82318F39",0x3A2C],
- ["82319030",0x3A2D],
- ["82319031",0x3A2E],
- ["82319032",0x3A2F],
- ["82319033",0x3A30],
- ["82319034",0x3A31],
- ["82319035",0x3A32],
- ["82319036",0x3A33],
- ["82319037",0x3A34],
- ["82319038",0x3A35],
- ["82319039",0x3A36],
- ["82319130",0x3A37],
- ["82319131",0x3A38],
- ["82319132",0x3A39],
- ["82319133",0x3A3A],
- ["82319134",0x3A3B],
- ["82319135",0x3A3C],
- ["82319136",0x3A3D],
- ["82319137",0x3A3E],
- ["82319138",0x3A3F],
- ["82319139",0x3A40],
- ["82319230",0x3A41],
- ["82319231",0x3A42],
- ["82319232",0x3A43],
- ["82319233",0x3A44],
- ["82319234",0x3A45],
- ["82319235",0x3A46],
- ["82319236",0x3A47],
- ["82319237",0x3A48],
- ["82319238",0x3A49],
- ["82319239",0x3A4A],
- ["82319330",0x3A4B],
- ["82319331",0x3A4C],
- ["82319332",0x3A4D],
- ["82319333",0x3A4E],
- ["82319334",0x3A4F],
- ["82319335",0x3A50],
- ["82319336",0x3A51],
- ["82319337",0x3A52],
- ["82319338",0x3A53],
- ["82319339",0x3A54],
- ["82319430",0x3A55],
- ["82319431",0x3A56],
- ["82319432",0x3A57],
- ["82319433",0x3A58],
- ["82319434",0x3A59],
- ["82319435",0x3A5A],
- ["82319436",0x3A5B],
- ["82319437",0x3A5C],
- ["82319438",0x3A5D],
- ["82319439",0x3A5E],
- ["82319530",0x3A5F],
- ["82319531",0x3A60],
- ["82319532",0x3A61],
- ["82319533",0x3A62],
- ["82319534",0x3A63],
- ["82319535",0x3A64],
- ["82319536",0x3A65],
- ["82319537",0x3A66],
- ["82319538",0x3A67],
- ["82319539",0x3A68],
- ["82319630",0x3A69],
- ["82319631",0x3A6A],
- ["82319632",0x3A6B],
- ["82319633",0x3A6C],
- ["82319634",0x3A6D],
- ["82319635",0x3A6E],
- ["82319636",0x3A6F],
- ["82319637",0x3A70],
- ["82319638",0x3A71],
- ["82319639",0x3A72],
- ["FE64",0x3A73],
- ["82319730",0x3A74],
- ["82319731",0x3A75],
- ["82319732",0x3A76],
- ["82319733",0x3A77],
- ["82319734",0x3A78],
- ["82319735",0x3A79],
- ["82319736",0x3A7A],
- ["82319737",0x3A7B],
- ["82319738",0x3A7C],
- ["82319739",0x3A7D],
- ["82319830",0x3A7E],
- ["82319831",0x3A7F],
- ["82319832",0x3A80],
- ["82319833",0x3A81],
- ["82319834",0x3A82],
- ["82319835",0x3A83],
- ["82319836",0x3A84],
- ["82319837",0x3A85],
- ["82319838",0x3A86],
- ["82319839",0x3A87],
- ["82319930",0x3A88],
- ["82319931",0x3A89],
- ["82319932",0x3A8A],
- ["82319933",0x3A8B],
- ["82319934",0x3A8C],
- ["82319935",0x3A8D],
- ["82319936",0x3A8E],
- ["82319937",0x3A8F],
- ["82319938",0x3A90],
- ["82319939",0x3A91],
- ["82319A30",0x3A92],
- ["82319A31",0x3A93],
- ["82319A32",0x3A94],
- ["82319A33",0x3A95],
- ["82319A34",0x3A96],
- ["82319A35",0x3A97],
- ["82319A36",0x3A98],
- ["82319A37",0x3A99],
- ["82319A38",0x3A9A],
- ["82319A39",0x3A9B],
- ["82319B30",0x3A9C],
- ["82319B31",0x3A9D],
- ["82319B32",0x3A9E],
- ["82319B33",0x3A9F],
- ["82319B34",0x3AA0],
- ["82319B35",0x3AA1],
- ["82319B36",0x3AA2],
- ["82319B37",0x3AA3],
- ["82319B38",0x3AA4],
- ["82319B39",0x3AA5],
- ["82319C30",0x3AA6],
- ["82319C31",0x3AA7],
- ["82319C32",0x3AA8],
- ["82319C33",0x3AA9],
- ["82319C34",0x3AAA],
- ["82319C35",0x3AAB],
- ["82319C36",0x3AAC],
- ["82319C37",0x3AAD],
- ["82319C38",0x3AAE],
- ["82319C39",0x3AAF],
- ["82319D30",0x3AB0],
- ["82319D31",0x3AB1],
- ["82319D32",0x3AB2],
- ["82319D33",0x3AB3],
- ["82319D34",0x3AB4],
- ["82319D35",0x3AB5],
- ["82319D36",0x3AB6],
- ["82319D37",0x3AB7],
- ["82319D38",0x3AB8],
- ["82319D39",0x3AB9],
- ["82319E30",0x3ABA],
- ["82319E31",0x3ABB],
- ["82319E32",0x3ABC],
- ["82319E33",0x3ABD],
- ["82319E34",0x3ABE],
- ["82319E35",0x3ABF],
- ["82319E36",0x3AC0],
- ["82319E37",0x3AC1],
- ["82319E38",0x3AC2],
- ["82319E39",0x3AC3],
- ["82319F30",0x3AC4],
- ["82319F31",0x3AC5],
- ["82319F32",0x3AC6],
- ["82319F33",0x3AC7],
- ["82319F34",0x3AC8],
- ["82319F35",0x3AC9],
- ["82319F36",0x3ACA],
- ["82319F37",0x3ACB],
- ["82319F38",0x3ACC],
- ["82319F39",0x3ACD],
- ["8231A030",0x3ACE],
- ["8231A031",0x3ACF],
- ["8231A032",0x3AD0],
- ["8231A033",0x3AD1],
- ["8231A034",0x3AD2],
- ["8231A035",0x3AD3],
- ["8231A036",0x3AD4],
- ["8231A037",0x3AD5],
- ["8231A038",0x3AD6],
- ["8231A039",0x3AD7],
- ["8231A130",0x3AD8],
- ["8231A131",0x3AD9],
- ["8231A132",0x3ADA],
- ["8231A133",0x3ADB],
- ["8231A134",0x3ADC],
- ["8231A135",0x3ADD],
- ["8231A136",0x3ADE],
- ["8231A137",0x3ADF],
- ["8231A138",0x3AE0],
- ["8231A139",0x3AE1],
- ["8231A230",0x3AE2],
- ["8231A231",0x3AE3],
- ["8231A232",0x3AE4],
- ["8231A233",0x3AE5],
- ["8231A234",0x3AE6],
- ["8231A235",0x3AE7],
- ["8231A236",0x3AE8],
- ["8231A237",0x3AE9],
- ["8231A238",0x3AEA],
- ["8231A239",0x3AEB],
- ["8231A330",0x3AEC],
- ["8231A331",0x3AED],
- ["8231A332",0x3AEE],
- ["8231A333",0x3AEF],
- ["8231A334",0x3AF0],
- ["8231A335",0x3AF1],
- ["8231A336",0x3AF2],
- ["8231A337",0x3AF3],
- ["8231A338",0x3AF4],
- ["8231A339",0x3AF5],
- ["8231A430",0x3AF6],
- ["8231A431",0x3AF7],
- ["8231A432",0x3AF8],
- ["8231A433",0x3AF9],
- ["8231A434",0x3AFA],
- ["8231A435",0x3AFB],
- ["8231A436",0x3AFC],
- ["8231A437",0x3AFD],
- ["8231A438",0x3AFE],
- ["8231A439",0x3AFF],
- ["8231A530",0x3B00],
- ["8231A531",0x3B01],
- ["8231A532",0x3B02],
- ["8231A533",0x3B03],
- ["8231A534",0x3B04],
- ["8231A535",0x3B05],
- ["8231A536",0x3B06],
- ["8231A537",0x3B07],
- ["8231A538",0x3B08],
- ["8231A539",0x3B09],
- ["8231A630",0x3B0A],
- ["8231A631",0x3B0B],
- ["8231A632",0x3B0C],
- ["8231A633",0x3B0D],
- ["8231A634",0x3B0E],
- ["8231A635",0x3B0F],
- ["8231A636",0x3B10],
- ["8231A637",0x3B11],
- ["8231A638",0x3B12],
- ["8231A639",0x3B13],
- ["8231A730",0x3B14],
- ["8231A731",0x3B15],
- ["8231A732",0x3B16],
- ["8231A733",0x3B17],
- ["8231A734",0x3B18],
- ["8231A735",0x3B19],
- ["8231A736",0x3B1A],
- ["8231A737",0x3B1B],
- ["8231A738",0x3B1C],
- ["8231A739",0x3B1D],
- ["8231A830",0x3B1E],
- ["8231A831",0x3B1F],
- ["8231A832",0x3B20],
- ["8231A833",0x3B21],
- ["8231A834",0x3B22],
- ["8231A835",0x3B23],
- ["8231A836",0x3B24],
- ["8231A837",0x3B25],
- ["8231A838",0x3B26],
- ["8231A839",0x3B27],
- ["8231A930",0x3B28],
- ["8231A931",0x3B29],
- ["8231A932",0x3B2A],
- ["8231A933",0x3B2B],
- ["8231A934",0x3B2C],
- ["8231A935",0x3B2D],
- ["8231A936",0x3B2E],
- ["8231A937",0x3B2F],
- ["8231A938",0x3B30],
- ["8231A939",0x3B31],
- ["8231AA30",0x3B32],
- ["8231AA31",0x3B33],
- ["8231AA32",0x3B34],
- ["8231AA33",0x3B35],
- ["8231AA34",0x3B36],
- ["8231AA35",0x3B37],
- ["8231AA36",0x3B38],
- ["8231AA37",0x3B39],
- ["8231AA38",0x3B3A],
- ["8231AA39",0x3B3B],
- ["8231AB30",0x3B3C],
- ["8231AB31",0x3B3D],
- ["8231AB32",0x3B3E],
- ["8231AB33",0x3B3F],
- ["8231AB34",0x3B40],
- ["8231AB35",0x3B41],
- ["8231AB36",0x3B42],
- ["8231AB37",0x3B43],
- ["8231AB38",0x3B44],
- ["8231AB39",0x3B45],
- ["8231AC30",0x3B46],
- ["8231AC31",0x3B47],
- ["8231AC32",0x3B48],
- ["8231AC33",0x3B49],
- ["8231AC34",0x3B4A],
- ["8231AC35",0x3B4B],
- ["8231AC36",0x3B4C],
- ["8231AC37",0x3B4D],
- ["FE68",0x3B4E],
- ["8231AC38",0x3B4F],
- ["8231AC39",0x3B50],
- ["8231AD30",0x3B51],
- ["8231AD31",0x3B52],
- ["8231AD32",0x3B53],
- ["8231AD33",0x3B54],
- ["8231AD34",0x3B55],
- ["8231AD35",0x3B56],
- ["8231AD36",0x3B57],
- ["8231AD37",0x3B58],
- ["8231AD38",0x3B59],
- ["8231AD39",0x3B5A],
- ["8231AE30",0x3B5B],
- ["8231AE31",0x3B5C],
- ["8231AE32",0x3B5D],
- ["8231AE33",0x3B5E],
- ["8231AE34",0x3B5F],
- ["8231AE35",0x3B60],
- ["8231AE36",0x3B61],
- ["8231AE37",0x3B62],
- ["8231AE38",0x3B63],
- ["8231AE39",0x3B64],
- ["8231AF30",0x3B65],
- ["8231AF31",0x3B66],
- ["8231AF32",0x3B67],
- ["8231AF33",0x3B68],
- ["8231AF34",0x3B69],
- ["8231AF35",0x3B6A],
- ["8231AF36",0x3B6B],
- ["8231AF37",0x3B6C],
- ["8231AF38",0x3B6D],
- ["8231AF39",0x3B6E],
- ["8231B030",0x3B6F],
- ["8231B031",0x3B70],
- ["8231B032",0x3B71],
- ["8231B033",0x3B72],
- ["8231B034",0x3B73],
- ["8231B035",0x3B74],
- ["8231B036",0x3B75],
- ["8231B037",0x3B76],
- ["8231B038",0x3B77],
- ["8231B039",0x3B78],
- ["8231B130",0x3B79],
- ["8231B131",0x3B7A],
- ["8231B132",0x3B7B],
- ["8231B133",0x3B7C],
- ["8231B134",0x3B7D],
- ["8231B135",0x3B7E],
- ["8231B136",0x3B7F],
- ["8231B137",0x3B80],
- ["8231B138",0x3B81],
- ["8231B139",0x3B82],
- ["8231B230",0x3B83],
- ["8231B231",0x3B84],
- ["8231B232",0x3B85],
- ["8231B233",0x3B86],
- ["8231B234",0x3B87],
- ["8231B235",0x3B88],
- ["8231B236",0x3B89],
- ["8231B237",0x3B8A],
- ["8231B238",0x3B8B],
- ["8231B239",0x3B8C],
- ["8231B330",0x3B8D],
- ["8231B331",0x3B8E],
- ["8231B332",0x3B8F],
- ["8231B333",0x3B90],
- ["8231B334",0x3B91],
- ["8231B335",0x3B92],
- ["8231B336",0x3B93],
- ["8231B337",0x3B94],
- ["8231B338",0x3B95],
- ["8231B339",0x3B96],
- ["8231B430",0x3B97],
- ["8231B431",0x3B98],
- ["8231B432",0x3B99],
- ["8231B433",0x3B9A],
- ["8231B434",0x3B9B],
- ["8231B435",0x3B9C],
- ["8231B436",0x3B9D],
- ["8231B437",0x3B9E],
- ["8231B438",0x3B9F],
- ["8231B439",0x3BA0],
- ["8231B530",0x3BA1],
- ["8231B531",0x3BA2],
- ["8231B532",0x3BA3],
- ["8231B533",0x3BA4],
- ["8231B534",0x3BA5],
- ["8231B535",0x3BA6],
- ["8231B536",0x3BA7],
- ["8231B537",0x3BA8],
- ["8231B538",0x3BA9],
- ["8231B539",0x3BAA],
- ["8231B630",0x3BAB],
- ["8231B631",0x3BAC],
- ["8231B632",0x3BAD],
- ["8231B633",0x3BAE],
- ["8231B634",0x3BAF],
- ["8231B635",0x3BB0],
- ["8231B636",0x3BB1],
- ["8231B637",0x3BB2],
- ["8231B638",0x3BB3],
- ["8231B639",0x3BB4],
- ["8231B730",0x3BB5],
- ["8231B731",0x3BB6],
- ["8231B732",0x3BB7],
- ["8231B733",0x3BB8],
- ["8231B734",0x3BB9],
- ["8231B735",0x3BBA],
- ["8231B736",0x3BBB],
- ["8231B737",0x3BBC],
- ["8231B738",0x3BBD],
- ["8231B739",0x3BBE],
- ["8231B830",0x3BBF],
- ["8231B831",0x3BC0],
- ["8231B832",0x3BC1],
- ["8231B833",0x3BC2],
- ["8231B834",0x3BC3],
- ["8231B835",0x3BC4],
- ["8231B836",0x3BC5],
- ["8231B837",0x3BC6],
- ["8231B838",0x3BC7],
- ["8231B839",0x3BC8],
- ["8231B930",0x3BC9],
- ["8231B931",0x3BCA],
- ["8231B932",0x3BCB],
- ["8231B933",0x3BCC],
- ["8231B934",0x3BCD],
- ["8231B935",0x3BCE],
- ["8231B936",0x3BCF],
- ["8231B937",0x3BD0],
- ["8231B938",0x3BD1],
- ["8231B939",0x3BD2],
- ["8231BA30",0x3BD3],
- ["8231BA31",0x3BD4],
- ["8231BA32",0x3BD5],
- ["8231BA33",0x3BD6],
- ["8231BA34",0x3BD7],
- ["8231BA35",0x3BD8],
- ["8231BA36",0x3BD9],
- ["8231BA37",0x3BDA],
- ["8231BA38",0x3BDB],
- ["8231BA39",0x3BDC],
- ["8231BB30",0x3BDD],
- ["8231BB31",0x3BDE],
- ["8231BB32",0x3BDF],
- ["8231BB33",0x3BE0],
- ["8231BB34",0x3BE1],
- ["8231BB35",0x3BE2],
- ["8231BB36",0x3BE3],
- ["8231BB37",0x3BE4],
- ["8231BB38",0x3BE5],
- ["8231BB39",0x3BE6],
- ["8231BC30",0x3BE7],
- ["8231BC31",0x3BE8],
- ["8231BC32",0x3BE9],
- ["8231BC33",0x3BEA],
- ["8231BC34",0x3BEB],
- ["8231BC35",0x3BEC],
- ["8231BC36",0x3BED],
- ["8231BC37",0x3BEE],
- ["8231BC38",0x3BEF],
- ["8231BC39",0x3BF0],
- ["8231BD30",0x3BF1],
- ["8231BD31",0x3BF2],
- ["8231BD32",0x3BF3],
- ["8231BD33",0x3BF4],
- ["8231BD34",0x3BF5],
- ["8231BD35",0x3BF6],
- ["8231BD36",0x3BF7],
- ["8231BD37",0x3BF8],
- ["8231BD38",0x3BF9],
- ["8231BD39",0x3BFA],
- ["8231BE30",0x3BFB],
- ["8231BE31",0x3BFC],
- ["8231BE32",0x3BFD],
- ["8231BE33",0x3BFE],
- ["8231BE34",0x3BFF],
- ["8231BE35",0x3C00],
- ["8231BE36",0x3C01],
- ["8231BE37",0x3C02],
- ["8231BE38",0x3C03],
- ["8231BE39",0x3C04],
- ["8231BF30",0x3C05],
- ["8231BF31",0x3C06],
- ["8231BF32",0x3C07],
- ["8231BF33",0x3C08],
- ["8231BF34",0x3C09],
- ["8231BF35",0x3C0A],
- ["8231BF36",0x3C0B],
- ["8231BF37",0x3C0C],
- ["8231BF38",0x3C0D],
- ["8231BF39",0x3C0E],
- ["8231C030",0x3C0F],
- ["8231C031",0x3C10],
- ["8231C032",0x3C11],
- ["8231C033",0x3C12],
- ["8231C034",0x3C13],
- ["8231C035",0x3C14],
- ["8231C036",0x3C15],
- ["8231C037",0x3C16],
- ["8231C038",0x3C17],
- ["8231C039",0x3C18],
- ["8231C130",0x3C19],
- ["8231C131",0x3C1A],
- ["8231C132",0x3C1B],
- ["8231C133",0x3C1C],
- ["8231C134",0x3C1D],
- ["8231C135",0x3C1E],
- ["8231C136",0x3C1F],
- ["8231C137",0x3C20],
- ["8231C138",0x3C21],
- ["8231C139",0x3C22],
- ["8231C230",0x3C23],
- ["8231C231",0x3C24],
- ["8231C232",0x3C25],
- ["8231C233",0x3C26],
- ["8231C234",0x3C27],
- ["8231C235",0x3C28],
- ["8231C236",0x3C29],
- ["8231C237",0x3C2A],
- ["8231C238",0x3C2B],
- ["8231C239",0x3C2C],
- ["8231C330",0x3C2D],
- ["8231C331",0x3C2E],
- ["8231C332",0x3C2F],
- ["8231C333",0x3C30],
- ["8231C334",0x3C31],
- ["8231C335",0x3C32],
- ["8231C336",0x3C33],
- ["8231C337",0x3C34],
- ["8231C338",0x3C35],
- ["8231C339",0x3C36],
- ["8231C430",0x3C37],
- ["8231C431",0x3C38],
- ["8231C432",0x3C39],
- ["8231C433",0x3C3A],
- ["8231C434",0x3C3B],
- ["8231C435",0x3C3C],
- ["8231C436",0x3C3D],
- ["8231C437",0x3C3E],
- ["8231C438",0x3C3F],
- ["8231C439",0x3C40],
- ["8231C530",0x3C41],
- ["8231C531",0x3C42],
- ["8231C532",0x3C43],
- ["8231C533",0x3C44],
- ["8231C534",0x3C45],
- ["8231C535",0x3C46],
- ["8231C536",0x3C47],
- ["8231C537",0x3C48],
- ["8231C538",0x3C49],
- ["8231C539",0x3C4A],
- ["8231C630",0x3C4B],
- ["8231C631",0x3C4C],
- ["8231C632",0x3C4D],
- ["8231C633",0x3C4E],
- ["8231C634",0x3C4F],
- ["8231C635",0x3C50],
- ["8231C636",0x3C51],
- ["8231C637",0x3C52],
- ["8231C638",0x3C53],
- ["8231C639",0x3C54],
- ["8231C730",0x3C55],
- ["8231C731",0x3C56],
- ["8231C732",0x3C57],
- ["8231C733",0x3C58],
- ["8231C734",0x3C59],
- ["8231C735",0x3C5A],
- ["8231C736",0x3C5B],
- ["8231C737",0x3C5C],
- ["8231C738",0x3C5D],
- ["8231C739",0x3C5E],
- ["8231C830",0x3C5F],
- ["8231C831",0x3C60],
- ["8231C832",0x3C61],
- ["8231C833",0x3C62],
- ["8231C834",0x3C63],
- ["8231C835",0x3C64],
- ["8231C836",0x3C65],
- ["8231C837",0x3C66],
- ["8231C838",0x3C67],
- ["8231C839",0x3C68],
- ["8231C930",0x3C69],
- ["8231C931",0x3C6A],
- ["8231C932",0x3C6B],
- ["8231C933",0x3C6C],
- ["8231C934",0x3C6D],
- ["FE69",0x3C6E],
- ["8231C935",0x3C6F],
- ["8231C936",0x3C70],
- ["8231C937",0x3C71],
- ["8231C938",0x3C72],
- ["8231C939",0x3C73],
- ["8231CA30",0x3C74],
- ["8231CA31",0x3C75],
- ["8231CA32",0x3C76],
- ["8231CA33",0x3C77],
- ["8231CA34",0x3C78],
- ["8231CA35",0x3C79],
- ["8231CA36",0x3C7A],
- ["8231CA37",0x3C7B],
- ["8231CA38",0x3C7C],
- ["8231CA39",0x3C7D],
- ["8231CB30",0x3C7E],
- ["8231CB31",0x3C7F],
- ["8231CB32",0x3C80],
- ["8231CB33",0x3C81],
- ["8231CB34",0x3C82],
- ["8231CB35",0x3C83],
- ["8231CB36",0x3C84],
- ["8231CB37",0x3C85],
- ["8231CB38",0x3C86],
- ["8231CB39",0x3C87],
- ["8231CC30",0x3C88],
- ["8231CC31",0x3C89],
- ["8231CC32",0x3C8A],
- ["8231CC33",0x3C8B],
- ["8231CC34",0x3C8C],
- ["8231CC35",0x3C8D],
- ["8231CC36",0x3C8E],
- ["8231CC37",0x3C8F],
- ["8231CC38",0x3C90],
- ["8231CC39",0x3C91],
- ["8231CD30",0x3C92],
- ["8231CD31",0x3C93],
- ["8231CD32",0x3C94],
- ["8231CD33",0x3C95],
- ["8231CD34",0x3C96],
- ["8231CD35",0x3C97],
- ["8231CD36",0x3C98],
- ["8231CD37",0x3C99],
- ["8231CD38",0x3C9A],
- ["8231CD39",0x3C9B],
- ["8231CE30",0x3C9C],
- ["8231CE31",0x3C9D],
- ["8231CE32",0x3C9E],
- ["8231CE33",0x3C9F],
- ["8231CE34",0x3CA0],
- ["8231CE35",0x3CA1],
- ["8231CE36",0x3CA2],
- ["8231CE37",0x3CA3],
- ["8231CE38",0x3CA4],
- ["8231CE39",0x3CA5],
- ["8231CF30",0x3CA6],
- ["8231CF31",0x3CA7],
- ["8231CF32",0x3CA8],
- ["8231CF33",0x3CA9],
- ["8231CF34",0x3CAA],
- ["8231CF35",0x3CAB],
- ["8231CF36",0x3CAC],
- ["8231CF37",0x3CAD],
- ["8231CF38",0x3CAE],
- ["8231CF39",0x3CAF],
- ["8231D030",0x3CB0],
- ["8231D031",0x3CB1],
- ["8231D032",0x3CB2],
- ["8231D033",0x3CB3],
- ["8231D034",0x3CB4],
- ["8231D035",0x3CB5],
- ["8231D036",0x3CB6],
- ["8231D037",0x3CB7],
- ["8231D038",0x3CB8],
- ["8231D039",0x3CB9],
- ["8231D130",0x3CBA],
- ["8231D131",0x3CBB],
- ["8231D132",0x3CBC],
- ["8231D133",0x3CBD],
- ["8231D134",0x3CBE],
- ["8231D135",0x3CBF],
- ["8231D136",0x3CC0],
- ["8231D137",0x3CC1],
- ["8231D138",0x3CC2],
- ["8231D139",0x3CC3],
- ["8231D230",0x3CC4],
- ["8231D231",0x3CC5],
- ["8231D232",0x3CC6],
- ["8231D233",0x3CC7],
- ["8231D234",0x3CC8],
- ["8231D235",0x3CC9],
- ["8231D236",0x3CCA],
- ["8231D237",0x3CCB],
- ["8231D238",0x3CCC],
- ["8231D239",0x3CCD],
- ["8231D330",0x3CCE],
- ["8231D331",0x3CCF],
- ["8231D332",0x3CD0],
- ["8231D333",0x3CD1],
- ["8231D334",0x3CD2],
- ["8231D335",0x3CD3],
- ["8231D336",0x3CD4],
- ["8231D337",0x3CD5],
- ["8231D338",0x3CD6],
- ["8231D339",0x3CD7],
- ["8231D430",0x3CD8],
- ["8231D431",0x3CD9],
- ["8231D432",0x3CDA],
- ["8231D433",0x3CDB],
- ["8231D434",0x3CDC],
- ["8231D435",0x3CDD],
- ["8231D436",0x3CDE],
- ["8231D437",0x3CDF],
- ["FE6A",0x3CE0],
- ["8231D438",0x3CE1],
- ["8231D439",0x3CE2],
- ["8231D530",0x3CE3],
- ["8231D531",0x3CE4],
- ["8231D532",0x3CE5],
- ["8231D533",0x3CE6],
- ["8231D534",0x3CE7],
- ["8231D535",0x3CE8],
- ["8231D536",0x3CE9],
- ["8231D537",0x3CEA],
- ["8231D538",0x3CEB],
- ["8231D539",0x3CEC],
- ["8231D630",0x3CED],
- ["8231D631",0x3CEE],
- ["8231D632",0x3CEF],
- ["8231D633",0x3CF0],
- ["8231D634",0x3CF1],
- ["8231D635",0x3CF2],
- ["8231D636",0x3CF3],
- ["8231D637",0x3CF4],
- ["8231D638",0x3CF5],
- ["8231D639",0x3CF6],
- ["8231D730",0x3CF7],
- ["8231D731",0x3CF8],
- ["8231D732",0x3CF9],
- ["8231D733",0x3CFA],
- ["8231D734",0x3CFB],
- ["8231D735",0x3CFC],
- ["8231D736",0x3CFD],
- ["8231D737",0x3CFE],
- ["8231D738",0x3CFF],
- ["8231D739",0x3D00],
- ["8231D830",0x3D01],
- ["8231D831",0x3D02],
- ["8231D832",0x3D03],
- ["8231D833",0x3D04],
- ["8231D834",0x3D05],
- ["8231D835",0x3D06],
- ["8231D836",0x3D07],
- ["8231D837",0x3D08],
- ["8231D838",0x3D09],
- ["8231D839",0x3D0A],
- ["8231D930",0x3D0B],
- ["8231D931",0x3D0C],
- ["8231D932",0x3D0D],
- ["8231D933",0x3D0E],
- ["8231D934",0x3D0F],
- ["8231D935",0x3D10],
- ["8231D936",0x3D11],
- ["8231D937",0x3D12],
- ["8231D938",0x3D13],
- ["8231D939",0x3D14],
- ["8231DA30",0x3D15],
- ["8231DA31",0x3D16],
- ["8231DA32",0x3D17],
- ["8231DA33",0x3D18],
- ["8231DA34",0x3D19],
- ["8231DA35",0x3D1A],
- ["8231DA36",0x3D1B],
- ["8231DA37",0x3D1C],
- ["8231DA38",0x3D1D],
- ["8231DA39",0x3D1E],
- ["8231DB30",0x3D1F],
- ["8231DB31",0x3D20],
- ["8231DB32",0x3D21],
- ["8231DB33",0x3D22],
- ["8231DB34",0x3D23],
- ["8231DB35",0x3D24],
- ["8231DB36",0x3D25],
- ["8231DB37",0x3D26],
- ["8231DB38",0x3D27],
- ["8231DB39",0x3D28],
- ["8231DC30",0x3D29],
- ["8231DC31",0x3D2A],
- ["8231DC32",0x3D2B],
- ["8231DC33",0x3D2C],
- ["8231DC34",0x3D2D],
- ["8231DC35",0x3D2E],
- ["8231DC36",0x3D2F],
- ["8231DC37",0x3D30],
- ["8231DC38",0x3D31],
- ["8231DC39",0x3D32],
- ["8231DD30",0x3D33],
- ["8231DD31",0x3D34],
- ["8231DD32",0x3D35],
- ["8231DD33",0x3D36],
- ["8231DD34",0x3D37],
- ["8231DD35",0x3D38],
- ["8231DD36",0x3D39],
- ["8231DD37",0x3D3A],
- ["8231DD38",0x3D3B],
- ["8231DD39",0x3D3C],
- ["8231DE30",0x3D3D],
- ["8231DE31",0x3D3E],
- ["8231DE32",0x3D3F],
- ["8231DE33",0x3D40],
- ["8231DE34",0x3D41],
- ["8231DE35",0x3D42],
- ["8231DE36",0x3D43],
- ["8231DE37",0x3D44],
- ["8231DE38",0x3D45],
- ["8231DE39",0x3D46],
- ["8231DF30",0x3D47],
- ["8231DF31",0x3D48],
- ["8231DF32",0x3D49],
- ["8231DF33",0x3D4A],
- ["8231DF34",0x3D4B],
- ["8231DF35",0x3D4C],
- ["8231DF36",0x3D4D],
- ["8231DF37",0x3D4E],
- ["8231DF38",0x3D4F],
- ["8231DF39",0x3D50],
- ["8231E030",0x3D51],
- ["8231E031",0x3D52],
- ["8231E032",0x3D53],
- ["8231E033",0x3D54],
- ["8231E034",0x3D55],
- ["8231E035",0x3D56],
- ["8231E036",0x3D57],
- ["8231E037",0x3D58],
- ["8231E038",0x3D59],
- ["8231E039",0x3D5A],
- ["8231E130",0x3D5B],
- ["8231E131",0x3D5C],
- ["8231E132",0x3D5D],
- ["8231E133",0x3D5E],
- ["8231E134",0x3D5F],
- ["8231E135",0x3D60],
- ["8231E136",0x3D61],
- ["8231E137",0x3D62],
- ["8231E138",0x3D63],
- ["8231E139",0x3D64],
- ["8231E230",0x3D65],
- ["8231E231",0x3D66],
- ["8231E232",0x3D67],
- ["8231E233",0x3D68],
- ["8231E234",0x3D69],
- ["8231E235",0x3D6A],
- ["8231E236",0x3D6B],
- ["8231E237",0x3D6C],
- ["8231E238",0x3D6D],
- ["8231E239",0x3D6E],
- ["8231E330",0x3D6F],
- ["8231E331",0x3D70],
- ["8231E332",0x3D71],
- ["8231E333",0x3D72],
- ["8231E334",0x3D73],
- ["8231E335",0x3D74],
- ["8231E336",0x3D75],
- ["8231E337",0x3D76],
- ["8231E338",0x3D77],
- ["8231E339",0x3D78],
- ["8231E430",0x3D79],
- ["8231E431",0x3D7A],
- ["8231E432",0x3D7B],
- ["8231E433",0x3D7C],
- ["8231E434",0x3D7D],
- ["8231E435",0x3D7E],
- ["8231E436",0x3D7F],
- ["8231E437",0x3D80],
- ["8231E438",0x3D81],
- ["8231E439",0x3D82],
- ["8231E530",0x3D83],
- ["8231E531",0x3D84],
- ["8231E532",0x3D85],
- ["8231E533",0x3D86],
- ["8231E534",0x3D87],
- ["8231E535",0x3D88],
- ["8231E536",0x3D89],
- ["8231E537",0x3D8A],
- ["8231E538",0x3D8B],
- ["8231E539",0x3D8C],
- ["8231E630",0x3D8D],
- ["8231E631",0x3D8E],
- ["8231E632",0x3D8F],
- ["8231E633",0x3D90],
- ["8231E634",0x3D91],
- ["8231E635",0x3D92],
- ["8231E636",0x3D93],
- ["8231E637",0x3D94],
- ["8231E638",0x3D95],
- ["8231E639",0x3D96],
- ["8231E730",0x3D97],
- ["8231E731",0x3D98],
- ["8231E732",0x3D99],
- ["8231E733",0x3D9A],
- ["8231E734",0x3D9B],
- ["8231E735",0x3D9C],
- ["8231E736",0x3D9D],
- ["8231E737",0x3D9E],
- ["8231E738",0x3D9F],
- ["8231E739",0x3DA0],
- ["8231E830",0x3DA1],
- ["8231E831",0x3DA2],
- ["8231E832",0x3DA3],
- ["8231E833",0x3DA4],
- ["8231E834",0x3DA5],
- ["8231E835",0x3DA6],
- ["8231E836",0x3DA7],
- ["8231E837",0x3DA8],
- ["8231E838",0x3DA9],
- ["8231E839",0x3DAA],
- ["8231E930",0x3DAB],
- ["8231E931",0x3DAC],
- ["8231E932",0x3DAD],
- ["8231E933",0x3DAE],
- ["8231E934",0x3DAF],
- ["8231E935",0x3DB0],
- ["8231E936",0x3DB1],
- ["8231E937",0x3DB2],
- ["8231E938",0x3DB3],
- ["8231E939",0x3DB4],
- ["8231EA30",0x3DB5],
- ["8231EA31",0x3DB6],
- ["8231EA32",0x3DB7],
- ["8231EA33",0x3DB8],
- ["8231EA34",0x3DB9],
- ["8231EA35",0x3DBA],
- ["8231EA36",0x3DBB],
- ["8231EA37",0x3DBC],
- ["8231EA38",0x3DBD],
- ["8231EA39",0x3DBE],
- ["8231EB30",0x3DBF],
- ["8231EB31",0x3DC0],
- ["8231EB32",0x3DC1],
- ["8231EB33",0x3DC2],
- ["8231EB34",0x3DC3],
- ["8231EB35",0x3DC4],
- ["8231EB36",0x3DC5],
- ["8231EB37",0x3DC6],
- ["8231EB38",0x3DC7],
- ["8231EB39",0x3DC8],
- ["8231EC30",0x3DC9],
- ["8231EC31",0x3DCA],
- ["8231EC32",0x3DCB],
- ["8231EC33",0x3DCC],
- ["8231EC34",0x3DCD],
- ["8231EC35",0x3DCE],
- ["8231EC36",0x3DCF],
- ["8231EC37",0x3DD0],
- ["8231EC38",0x3DD1],
- ["8231EC39",0x3DD2],
- ["8231ED30",0x3DD3],
- ["8231ED31",0x3DD4],
- ["8231ED32",0x3DD5],
- ["8231ED33",0x3DD6],
- ["8231ED34",0x3DD7],
- ["8231ED35",0x3DD8],
- ["8231ED36",0x3DD9],
- ["8231ED37",0x3DDA],
- ["8231ED38",0x3DDB],
- ["8231ED39",0x3DDC],
- ["8231EE30",0x3DDD],
- ["8231EE31",0x3DDE],
- ["8231EE32",0x3DDF],
- ["8231EE33",0x3DE0],
- ["8231EE34",0x3DE1],
- ["8231EE35",0x3DE2],
- ["8231EE36",0x3DE3],
- ["8231EE37",0x3DE4],
- ["8231EE38",0x3DE5],
- ["8231EE39",0x3DE6],
- ["8231EF30",0x3DE7],
- ["8231EF31",0x3DE8],
- ["8231EF32",0x3DE9],
- ["8231EF33",0x3DEA],
- ["8231EF34",0x3DEB],
- ["8231EF35",0x3DEC],
- ["8231EF36",0x3DED],
- ["8231EF37",0x3DEE],
- ["8231EF38",0x3DEF],
- ["8231EF39",0x3DF0],
- ["8231F030",0x3DF1],
- ["8231F031",0x3DF2],
- ["8231F032",0x3DF3],
- ["8231F033",0x3DF4],
- ["8231F034",0x3DF5],
- ["8231F035",0x3DF6],
- ["8231F036",0x3DF7],
- ["8231F037",0x3DF8],
- ["8231F038",0x3DF9],
- ["8231F039",0x3DFA],
- ["8231F130",0x3DFB],
- ["8231F131",0x3DFC],
- ["8231F132",0x3DFD],
- ["8231F133",0x3DFE],
- ["8231F134",0x3DFF],
- ["8231F135",0x3E00],
- ["8231F136",0x3E01],
- ["8231F137",0x3E02],
- ["8231F138",0x3E03],
- ["8231F139",0x3E04],
- ["8231F230",0x3E05],
- ["8231F231",0x3E06],
- ["8231F232",0x3E07],
- ["8231F233",0x3E08],
- ["8231F234",0x3E09],
- ["8231F235",0x3E0A],
- ["8231F236",0x3E0B],
- ["8231F237",0x3E0C],
- ["8231F238",0x3E0D],
- ["8231F239",0x3E0E],
- ["8231F330",0x3E0F],
- ["8231F331",0x3E10],
- ["8231F332",0x3E11],
- ["8231F333",0x3E12],
- ["8231F334",0x3E13],
- ["8231F335",0x3E14],
- ["8231F336",0x3E15],
- ["8231F337",0x3E16],
- ["8231F338",0x3E17],
- ["8231F339",0x3E18],
- ["8231F430",0x3E19],
- ["8231F431",0x3E1A],
- ["8231F432",0x3E1B],
- ["8231F433",0x3E1C],
- ["8231F434",0x3E1D],
- ["8231F435",0x3E1E],
- ["8231F436",0x3E1F],
- ["8231F437",0x3E20],
- ["8231F438",0x3E21],
- ["8231F439",0x3E22],
- ["8231F530",0x3E23],
- ["8231F531",0x3E24],
- ["8231F532",0x3E25],
- ["8231F533",0x3E26],
- ["8231F534",0x3E27],
- ["8231F535",0x3E28],
- ["8231F536",0x3E29],
- ["8231F537",0x3E2A],
- ["8231F538",0x3E2B],
- ["8231F539",0x3E2C],
- ["8231F630",0x3E2D],
- ["8231F631",0x3E2E],
- ["8231F632",0x3E2F],
- ["8231F633",0x3E30],
- ["8231F634",0x3E31],
- ["8231F635",0x3E32],
- ["8231F636",0x3E33],
- ["8231F637",0x3E34],
- ["8231F638",0x3E35],
- ["8231F639",0x3E36],
- ["8231F730",0x3E37],
- ["8231F731",0x3E38],
- ["8231F732",0x3E39],
- ["8231F733",0x3E3A],
- ["8231F734",0x3E3B],
- ["8231F735",0x3E3C],
- ["8231F736",0x3E3D],
- ["8231F737",0x3E3E],
- ["8231F738",0x3E3F],
- ["8231F739",0x3E40],
- ["8231F830",0x3E41],
- ["8231F831",0x3E42],
- ["8231F832",0x3E43],
- ["8231F833",0x3E44],
- ["8231F834",0x3E45],
- ["8231F835",0x3E46],
- ["8231F836",0x3E47],
- ["8231F837",0x3E48],
- ["8231F838",0x3E49],
- ["8231F839",0x3E4A],
- ["8231F930",0x3E4B],
- ["8231F931",0x3E4C],
- ["8231F932",0x3E4D],
- ["8231F933",0x3E4E],
- ["8231F934",0x3E4F],
- ["8231F935",0x3E50],
- ["8231F936",0x3E51],
- ["8231F937",0x3E52],
- ["8231F938",0x3E53],
- ["8231F939",0x3E54],
- ["8231FA30",0x3E55],
- ["8231FA31",0x3E56],
- ["8231FA32",0x3E57],
- ["8231FA33",0x3E58],
- ["8231FA34",0x3E59],
- ["8231FA35",0x3E5A],
- ["8231FA36",0x3E5B],
- ["8231FA37",0x3E5C],
- ["8231FA38",0x3E5D],
- ["8231FA39",0x3E5E],
- ["8231FB30",0x3E5F],
- ["8231FB31",0x3E60],
- ["8231FB32",0x3E61],
- ["8231FB33",0x3E62],
- ["8231FB34",0x3E63],
- ["8231FB35",0x3E64],
- ["8231FB36",0x3E65],
- ["8231FB37",0x3E66],
- ["8231FB38",0x3E67],
- ["8231FB39",0x3E68],
- ["8231FC30",0x3E69],
- ["8231FC31",0x3E6A],
- ["8231FC32",0x3E6B],
- ["8231FC33",0x3E6C],
- ["8231FC34",0x3E6D],
- ["8231FC35",0x3E6E],
- ["8231FC36",0x3E6F],
- ["8231FC37",0x3E70],
- ["8231FC38",0x3E71],
- ["8231FC39",0x3E72],
- ["8231FD30",0x3E73],
- ["8231FD31",0x3E74],
- ["8231FD32",0x3E75],
- ["8231FD33",0x3E76],
- ["8231FD34",0x3E77],
- ["8231FD35",0x3E78],
- ["8231FD36",0x3E79],
- ["8231FD37",0x3E7A],
- ["8231FD38",0x3E7B],
- ["8231FD39",0x3E7C],
- ["8231FE30",0x3E7D],
- ["8231FE31",0x3E7E],
- ["8231FE32",0x3E7F],
- ["8231FE33",0x3E80],
- ["8231FE34",0x3E81],
- ["8231FE35",0x3E82],
- ["8231FE36",0x3E83],
- ["8231FE37",0x3E84],
- ["8231FE38",0x3E85],
- ["8231FE39",0x3E86],
- ["82328130",0x3E87],
- ["82328131",0x3E88],
- ["82328132",0x3E89],
- ["82328133",0x3E8A],
- ["82328134",0x3E8B],
- ["82328135",0x3E8C],
- ["82328136",0x3E8D],
- ["82328137",0x3E8E],
- ["82328138",0x3E8F],
- ["82328139",0x3E90],
- ["82328230",0x3E91],
- ["82328231",0x3E92],
- ["82328232",0x3E93],
- ["82328233",0x3E94],
- ["82328234",0x3E95],
- ["82328235",0x3E96],
- ["82328236",0x3E97],
- ["82328237",0x3E98],
- ["82328238",0x3E99],
- ["82328239",0x3E9A],
- ["82328330",0x3E9B],
- ["82328331",0x3E9C],
- ["82328332",0x3E9D],
- ["82328333",0x3E9E],
- ["82328334",0x3E9F],
- ["82328335",0x3EA0],
- ["82328336",0x3EA1],
- ["82328337",0x3EA2],
- ["82328338",0x3EA3],
- ["82328339",0x3EA4],
- ["82328430",0x3EA5],
- ["82328431",0x3EA6],
- ["82328432",0x3EA7],
- ["82328433",0x3EA8],
- ["82328434",0x3EA9],
- ["82328435",0x3EAA],
- ["82328436",0x3EAB],
- ["82328437",0x3EAC],
- ["82328438",0x3EAD],
- ["82328439",0x3EAE],
- ["82328530",0x3EAF],
- ["82328531",0x3EB0],
- ["82328532",0x3EB1],
- ["82328533",0x3EB2],
- ["82328534",0x3EB3],
- ["82328535",0x3EB4],
- ["82328536",0x3EB5],
- ["82328537",0x3EB6],
- ["82328538",0x3EB7],
- ["82328539",0x3EB8],
- ["82328630",0x3EB9],
- ["82328631",0x3EBA],
- ["82328632",0x3EBB],
- ["82328633",0x3EBC],
- ["82328634",0x3EBD],
- ["82328635",0x3EBE],
- ["82328636",0x3EBF],
- ["82328637",0x3EC0],
- ["82328638",0x3EC1],
- ["82328639",0x3EC2],
- ["82328730",0x3EC3],
- ["82328731",0x3EC4],
- ["82328732",0x3EC5],
- ["82328733",0x3EC6],
- ["82328734",0x3EC7],
- ["82328735",0x3EC8],
- ["82328736",0x3EC9],
- ["82328737",0x3ECA],
- ["82328738",0x3ECB],
- ["82328739",0x3ECC],
- ["82328830",0x3ECD],
- ["82328831",0x3ECE],
- ["82328832",0x3ECF],
- ["82328833",0x3ED0],
- ["82328834",0x3ED1],
- ["82328835",0x3ED2],
- ["82328836",0x3ED3],
- ["82328837",0x3ED4],
- ["82328838",0x3ED5],
- ["82328839",0x3ED6],
- ["82328930",0x3ED7],
- ["82328931",0x3ED8],
- ["82328932",0x3ED9],
- ["82328933",0x3EDA],
- ["82328934",0x3EDB],
- ["82328935",0x3EDC],
- ["82328936",0x3EDD],
- ["82328937",0x3EDE],
- ["82328938",0x3EDF],
- ["82328939",0x3EE0],
- ["82328A30",0x3EE1],
- ["82328A31",0x3EE2],
- ["82328A32",0x3EE3],
- ["82328A33",0x3EE4],
- ["82328A34",0x3EE5],
- ["82328A35",0x3EE6],
- ["82328A36",0x3EE7],
- ["82328A37",0x3EE8],
- ["82328A38",0x3EE9],
- ["82328A39",0x3EEA],
- ["82328B30",0x3EEB],
- ["82328B31",0x3EEC],
- ["82328B32",0x3EED],
- ["82328B33",0x3EEE],
- ["82328B34",0x3EEF],
- ["82328B35",0x3EF0],
- ["82328B36",0x3EF1],
- ["82328B37",0x3EF2],
- ["82328B38",0x3EF3],
- ["82328B39",0x3EF4],
- ["82328C30",0x3EF5],
- ["82328C31",0x3EF6],
- ["82328C32",0x3EF7],
- ["82328C33",0x3EF8],
- ["82328C34",0x3EF9],
- ["82328C35",0x3EFA],
- ["82328C36",0x3EFB],
- ["82328C37",0x3EFC],
- ["82328C38",0x3EFD],
- ["82328C39",0x3EFE],
- ["82328D30",0x3EFF],
- ["82328D31",0x3F00],
- ["82328D32",0x3F01],
- ["82328D33",0x3F02],
- ["82328D34",0x3F03],
- ["82328D35",0x3F04],
- ["82328D36",0x3F05],
- ["82328D37",0x3F06],
- ["82328D38",0x3F07],
- ["82328D39",0x3F08],
- ["82328E30",0x3F09],
- ["82328E31",0x3F0A],
- ["82328E32",0x3F0B],
- ["82328E33",0x3F0C],
- ["82328E34",0x3F0D],
- ["82328E35",0x3F0E],
- ["82328E36",0x3F0F],
- ["82328E37",0x3F10],
- ["82328E38",0x3F11],
- ["82328E39",0x3F12],
- ["82328F30",0x3F13],
- ["82328F31",0x3F14],
- ["82328F32",0x3F15],
- ["82328F33",0x3F16],
- ["82328F34",0x3F17],
- ["82328F35",0x3F18],
- ["82328F36",0x3F19],
- ["82328F37",0x3F1A],
- ["82328F38",0x3F1B],
- ["82328F39",0x3F1C],
- ["82329030",0x3F1D],
- ["82329031",0x3F1E],
- ["82329032",0x3F1F],
- ["82329033",0x3F20],
- ["82329034",0x3F21],
- ["82329035",0x3F22],
- ["82329036",0x3F23],
- ["82329037",0x3F24],
- ["82329038",0x3F25],
- ["82329039",0x3F26],
- ["82329130",0x3F27],
- ["82329131",0x3F28],
- ["82329132",0x3F29],
- ["82329133",0x3F2A],
- ["82329134",0x3F2B],
- ["82329135",0x3F2C],
- ["82329136",0x3F2D],
- ["82329137",0x3F2E],
- ["82329138",0x3F2F],
- ["82329139",0x3F30],
- ["82329230",0x3F31],
- ["82329231",0x3F32],
- ["82329232",0x3F33],
- ["82329233",0x3F34],
- ["82329234",0x3F35],
- ["82329235",0x3F36],
- ["82329236",0x3F37],
- ["82329237",0x3F38],
- ["82329238",0x3F39],
- ["82329239",0x3F3A],
- ["82329330",0x3F3B],
- ["82329331",0x3F3C],
- ["82329332",0x3F3D],
- ["82329333",0x3F3E],
- ["82329334",0x3F3F],
- ["82329335",0x3F40],
- ["82329336",0x3F41],
- ["82329337",0x3F42],
- ["82329338",0x3F43],
- ["82329339",0x3F44],
- ["82329430",0x3F45],
- ["82329431",0x3F46],
- ["82329432",0x3F47],
- ["82329433",0x3F48],
- ["82329434",0x3F49],
- ["82329435",0x3F4A],
- ["82329436",0x3F4B],
- ["82329437",0x3F4C],
- ["82329438",0x3F4D],
- ["82329439",0x3F4E],
- ["82329530",0x3F4F],
- ["82329531",0x3F50],
- ["82329532",0x3F51],
- ["82329533",0x3F52],
- ["82329534",0x3F53],
- ["82329535",0x3F54],
- ["82329536",0x3F55],
- ["82329537",0x3F56],
- ["82329538",0x3F57],
- ["82329539",0x3F58],
- ["82329630",0x3F59],
- ["82329631",0x3F5A],
- ["82329632",0x3F5B],
- ["82329633",0x3F5C],
- ["82329634",0x3F5D],
- ["82329635",0x3F5E],
- ["82329636",0x3F5F],
- ["82329637",0x3F60],
- ["82329638",0x3F61],
- ["82329639",0x3F62],
- ["82329730",0x3F63],
- ["82329731",0x3F64],
- ["82329732",0x3F65],
- ["82329733",0x3F66],
- ["82329734",0x3F67],
- ["82329735",0x3F68],
- ["82329736",0x3F69],
- ["82329737",0x3F6A],
- ["82329738",0x3F6B],
- ["82329739",0x3F6C],
- ["82329830",0x3F6D],
- ["82329831",0x3F6E],
- ["82329832",0x3F6F],
- ["82329833",0x3F70],
- ["82329834",0x3F71],
- ["82329835",0x3F72],
- ["82329836",0x3F73],
- ["82329837",0x3F74],
- ["82329838",0x3F75],
- ["82329839",0x3F76],
- ["82329930",0x3F77],
- ["82329931",0x3F78],
- ["82329932",0x3F79],
- ["82329933",0x3F7A],
- ["82329934",0x3F7B],
- ["82329935",0x3F7C],
- ["82329936",0x3F7D],
- ["82329937",0x3F7E],
- ["82329938",0x3F7F],
- ["82329939",0x3F80],
- ["82329A30",0x3F81],
- ["82329A31",0x3F82],
- ["82329A32",0x3F83],
- ["82329A33",0x3F84],
- ["82329A34",0x3F85],
- ["82329A35",0x3F86],
- ["82329A36",0x3F87],
- ["82329A37",0x3F88],
- ["82329A38",0x3F89],
- ["82329A39",0x3F8A],
- ["82329B30",0x3F8B],
- ["82329B31",0x3F8C],
- ["82329B32",0x3F8D],
- ["82329B33",0x3F8E],
- ["82329B34",0x3F8F],
- ["82329B35",0x3F90],
- ["82329B36",0x3F91],
- ["82329B37",0x3F92],
- ["82329B38",0x3F93],
- ["82329B39",0x3F94],
- ["82329C30",0x3F95],
- ["82329C31",0x3F96],
- ["82329C32",0x3F97],
- ["82329C33",0x3F98],
- ["82329C34",0x3F99],
- ["82329C35",0x3F9A],
- ["82329C36",0x3F9B],
- ["82329C37",0x3F9C],
- ["82329C38",0x3F9D],
- ["82329C39",0x3F9E],
- ["82329D30",0x3F9F],
- ["82329D31",0x3FA0],
- ["82329D32",0x3FA1],
- ["82329D33",0x3FA2],
- ["82329D34",0x3FA3],
- ["82329D35",0x3FA4],
- ["82329D36",0x3FA5],
- ["82329D37",0x3FA6],
- ["82329D38",0x3FA7],
- ["82329D39",0x3FA8],
- ["82329E30",0x3FA9],
- ["82329E31",0x3FAA],
- ["82329E32",0x3FAB],
- ["82329E33",0x3FAC],
- ["82329E34",0x3FAD],
- ["82329E35",0x3FAE],
- ["82329E36",0x3FAF],
- ["82329E37",0x3FB0],
- ["82329E38",0x3FB1],
- ["82329E39",0x3FB2],
- ["82329F30",0x3FB3],
- ["82329F31",0x3FB4],
- ["82329F32",0x3FB5],
- ["82329F33",0x3FB6],
- ["82329F34",0x3FB7],
- ["82329F35",0x3FB8],
- ["82329F36",0x3FB9],
- ["82329F37",0x3FBA],
- ["82329F38",0x3FBB],
- ["82329F39",0x3FBC],
- ["8232A030",0x3FBD],
- ["8232A031",0x3FBE],
- ["8232A032",0x3FBF],
- ["8232A033",0x3FC0],
- ["8232A034",0x3FC1],
- ["8232A035",0x3FC2],
- ["8232A036",0x3FC3],
- ["8232A037",0x3FC4],
- ["8232A038",0x3FC5],
- ["8232A039",0x3FC6],
- ["8232A130",0x3FC7],
- ["8232A131",0x3FC8],
- ["8232A132",0x3FC9],
- ["8232A133",0x3FCA],
- ["8232A134",0x3FCB],
- ["8232A135",0x3FCC],
- ["8232A136",0x3FCD],
- ["8232A137",0x3FCE],
- ["8232A138",0x3FCF],
- ["8232A139",0x3FD0],
- ["8232A230",0x3FD1],
- ["8232A231",0x3FD2],
- ["8232A232",0x3FD3],
- ["8232A233",0x3FD4],
- ["8232A234",0x3FD5],
- ["8232A235",0x3FD6],
- ["8232A236",0x3FD7],
- ["8232A237",0x3FD8],
- ["8232A238",0x3FD9],
- ["8232A239",0x3FDA],
- ["8232A330",0x3FDB],
- ["8232A331",0x3FDC],
- ["8232A332",0x3FDD],
- ["8232A333",0x3FDE],
- ["8232A334",0x3FDF],
- ["8232A335",0x3FE0],
- ["8232A336",0x3FE1],
- ["8232A337",0x3FE2],
- ["8232A338",0x3FE3],
- ["8232A339",0x3FE4],
- ["8232A430",0x3FE5],
- ["8232A431",0x3FE6],
- ["8232A432",0x3FE7],
- ["8232A433",0x3FE8],
- ["8232A434",0x3FE9],
- ["8232A435",0x3FEA],
- ["8232A436",0x3FEB],
- ["8232A437",0x3FEC],
- ["8232A438",0x3FED],
- ["8232A439",0x3FEE],
- ["8232A530",0x3FEF],
- ["8232A531",0x3FF0],
- ["8232A532",0x3FF1],
- ["8232A533",0x3FF2],
- ["8232A534",0x3FF3],
- ["8232A535",0x3FF4],
- ["8232A536",0x3FF5],
- ["8232A537",0x3FF6],
- ["8232A538",0x3FF7],
- ["8232A539",0x3FF8],
- ["8232A630",0x3FF9],
- ["8232A631",0x3FFA],
- ["8232A632",0x3FFB],
- ["8232A633",0x3FFC],
- ["8232A634",0x3FFD],
- ["8232A635",0x3FFE],
- ["8232A636",0x3FFF],
- ["8232A637",0x4000],
- ["8232A638",0x4001],
- ["8232A639",0x4002],
- ["8232A730",0x4003],
- ["8232A731",0x4004],
- ["8232A732",0x4005],
- ["8232A733",0x4006],
- ["8232A734",0x4007],
- ["8232A735",0x4008],
- ["8232A736",0x4009],
- ["8232A737",0x400A],
- ["8232A738",0x400B],
- ["8232A739",0x400C],
- ["8232A830",0x400D],
- ["8232A831",0x400E],
- ["8232A832",0x400F],
- ["8232A833",0x4010],
- ["8232A834",0x4011],
- ["8232A835",0x4012],
- ["8232A836",0x4013],
- ["8232A837",0x4014],
- ["8232A838",0x4015],
- ["8232A839",0x4016],
- ["8232A930",0x4017],
- ["8232A931",0x4018],
- ["8232A932",0x4019],
- ["8232A933",0x401A],
- ["8232A934",0x401B],
- ["8232A935",0x401C],
- ["8232A936",0x401D],
- ["8232A937",0x401E],
- ["8232A938",0x401F],
- ["8232A939",0x4020],
- ["8232AA30",0x4021],
- ["8232AA31",0x4022],
- ["8232AA32",0x4023],
- ["8232AA33",0x4024],
- ["8232AA34",0x4025],
- ["8232AA35",0x4026],
- ["8232AA36",0x4027],
- ["8232AA37",0x4028],
- ["8232AA38",0x4029],
- ["8232AA39",0x402A],
- ["8232AB30",0x402B],
- ["8232AB31",0x402C],
- ["8232AB32",0x402D],
- ["8232AB33",0x402E],
- ["8232AB34",0x402F],
- ["8232AB35",0x4030],
- ["8232AB36",0x4031],
- ["8232AB37",0x4032],
- ["8232AB38",0x4033],
- ["8232AB39",0x4034],
- ["8232AC30",0x4035],
- ["8232AC31",0x4036],
- ["8232AC32",0x4037],
- ["8232AC33",0x4038],
- ["8232AC34",0x4039],
- ["8232AC35",0x403A],
- ["8232AC36",0x403B],
- ["8232AC37",0x403C],
- ["8232AC38",0x403D],
- ["8232AC39",0x403E],
- ["8232AD30",0x403F],
- ["8232AD31",0x4040],
- ["8232AD32",0x4041],
- ["8232AD33",0x4042],
- ["8232AD34",0x4043],
- ["8232AD35",0x4044],
- ["8232AD36",0x4045],
- ["8232AD37",0x4046],
- ["8232AD38",0x4047],
- ["8232AD39",0x4048],
- ["8232AE30",0x4049],
- ["8232AE31",0x404A],
- ["8232AE32",0x404B],
- ["8232AE33",0x404C],
- ["8232AE34",0x404D],
- ["8232AE35",0x404E],
- ["8232AE36",0x404F],
- ["8232AE37",0x4050],
- ["8232AE38",0x4051],
- ["8232AE39",0x4052],
- ["8232AF30",0x4053],
- ["8232AF31",0x4054],
- ["8232AF32",0x4055],
- ["FE6F",0x4056],
- ["8232AF33",0x4057],
- ["8232AF34",0x4058],
- ["8232AF35",0x4059],
- ["8232AF36",0x405A],
- ["8232AF37",0x405B],
- ["8232AF38",0x405C],
- ["8232AF39",0x405D],
- ["8232B030",0x405E],
- ["8232B031",0x405F],
- ["8232B032",0x4060],
- ["8232B033",0x4061],
- ["8232B034",0x4062],
- ["8232B035",0x4063],
- ["8232B036",0x4064],
- ["8232B037",0x4065],
- ["8232B038",0x4066],
- ["8232B039",0x4067],
- ["8232B130",0x4068],
- ["8232B131",0x4069],
- ["8232B132",0x406A],
- ["8232B133",0x406B],
- ["8232B134",0x406C],
- ["8232B135",0x406D],
- ["8232B136",0x406E],
- ["8232B137",0x406F],
- ["8232B138",0x4070],
- ["8232B139",0x4071],
- ["8232B230",0x4072],
- ["8232B231",0x4073],
- ["8232B232",0x4074],
- ["8232B233",0x4075],
- ["8232B234",0x4076],
- ["8232B235",0x4077],
- ["8232B236",0x4078],
- ["8232B237",0x4079],
- ["8232B238",0x407A],
- ["8232B239",0x407B],
- ["8232B330",0x407C],
- ["8232B331",0x407D],
- ["8232B332",0x407E],
- ["8232B333",0x407F],
- ["8232B334",0x4080],
- ["8232B335",0x4081],
- ["8232B336",0x4082],
- ["8232B337",0x4083],
- ["8232B338",0x4084],
- ["8232B339",0x4085],
- ["8232B430",0x4086],
- ["8232B431",0x4087],
- ["8232B432",0x4088],
- ["8232B433",0x4089],
- ["8232B434",0x408A],
- ["8232B435",0x408B],
- ["8232B436",0x408C],
- ["8232B437",0x408D],
- ["8232B438",0x408E],
- ["8232B439",0x408F],
- ["8232B530",0x4090],
- ["8232B531",0x4091],
- ["8232B532",0x4092],
- ["8232B533",0x4093],
- ["8232B534",0x4094],
- ["8232B535",0x4095],
- ["8232B536",0x4096],
- ["8232B537",0x4097],
- ["8232B538",0x4098],
- ["8232B539",0x4099],
- ["8232B630",0x409A],
- ["8232B631",0x409B],
- ["8232B632",0x409C],
- ["8232B633",0x409D],
- ["8232B634",0x409E],
- ["8232B635",0x409F],
- ["8232B636",0x40A0],
- ["8232B637",0x40A1],
- ["8232B638",0x40A2],
- ["8232B639",0x40A3],
- ["8232B730",0x40A4],
- ["8232B731",0x40A5],
- ["8232B732",0x40A6],
- ["8232B733",0x40A7],
- ["8232B734",0x40A8],
- ["8232B735",0x40A9],
- ["8232B736",0x40AA],
- ["8232B737",0x40AB],
- ["8232B738",0x40AC],
- ["8232B739",0x40AD],
- ["8232B830",0x40AE],
- ["8232B831",0x40AF],
- ["8232B832",0x40B0],
- ["8232B833",0x40B1],
- ["8232B834",0x40B2],
- ["8232B835",0x40B3],
- ["8232B836",0x40B4],
- ["8232B837",0x40B5],
- ["8232B838",0x40B6],
- ["8232B839",0x40B7],
- ["8232B930",0x40B8],
- ["8232B931",0x40B9],
- ["8232B932",0x40BA],
- ["8232B933",0x40BB],
- ["8232B934",0x40BC],
- ["8232B935",0x40BD],
- ["8232B936",0x40BE],
- ["8232B937",0x40BF],
- ["8232B938",0x40C0],
- ["8232B939",0x40C1],
- ["8232BA30",0x40C2],
- ["8232BA31",0x40C3],
- ["8232BA32",0x40C4],
- ["8232BA33",0x40C5],
- ["8232BA34",0x40C6],
- ["8232BA35",0x40C7],
- ["8232BA36",0x40C8],
- ["8232BA37",0x40C9],
- ["8232BA38",0x40CA],
- ["8232BA39",0x40CB],
- ["8232BB30",0x40CC],
- ["8232BB31",0x40CD],
- ["8232BB32",0x40CE],
- ["8232BB33",0x40CF],
- ["8232BB34",0x40D0],
- ["8232BB35",0x40D1],
- ["8232BB36",0x40D2],
- ["8232BB37",0x40D3],
- ["8232BB38",0x40D4],
- ["8232BB39",0x40D5],
- ["8232BC30",0x40D6],
- ["8232BC31",0x40D7],
- ["8232BC32",0x40D8],
- ["8232BC33",0x40D9],
- ["8232BC34",0x40DA],
- ["8232BC35",0x40DB],
- ["8232BC36",0x40DC],
- ["8232BC37",0x40DD],
- ["8232BC38",0x40DE],
- ["8232BC39",0x40DF],
- ["8232BD30",0x40E0],
- ["8232BD31",0x40E1],
- ["8232BD32",0x40E2],
- ["8232BD33",0x40E3],
- ["8232BD34",0x40E4],
- ["8232BD35",0x40E5],
- ["8232BD36",0x40E6],
- ["8232BD37",0x40E7],
- ["8232BD38",0x40E8],
- ["8232BD39",0x40E9],
- ["8232BE30",0x40EA],
- ["8232BE31",0x40EB],
- ["8232BE32",0x40EC],
- ["8232BE33",0x40ED],
- ["8232BE34",0x40EE],
- ["8232BE35",0x40EF],
- ["8232BE36",0x40F0],
- ["8232BE37",0x40F1],
- ["8232BE38",0x40F2],
- ["8232BE39",0x40F3],
- ["8232BF30",0x40F4],
- ["8232BF31",0x40F5],
- ["8232BF32",0x40F6],
- ["8232BF33",0x40F7],
- ["8232BF34",0x40F8],
- ["8232BF35",0x40F9],
- ["8232BF36",0x40FA],
- ["8232BF37",0x40FB],
- ["8232BF38",0x40FC],
- ["8232BF39",0x40FD],
- ["8232C030",0x40FE],
- ["8232C031",0x40FF],
- ["8232C032",0x4100],
- ["8232C033",0x4101],
- ["8232C034",0x4102],
- ["8232C035",0x4103],
- ["8232C036",0x4104],
- ["8232C037",0x4105],
- ["8232C038",0x4106],
- ["8232C039",0x4107],
- ["8232C130",0x4108],
- ["8232C131",0x4109],
- ["8232C132",0x410A],
- ["8232C133",0x410B],
- ["8232C134",0x410C],
- ["8232C135",0x410D],
- ["8232C136",0x410E],
- ["8232C137",0x410F],
- ["8232C138",0x4110],
- ["8232C139",0x4111],
- ["8232C230",0x4112],
- ["8232C231",0x4113],
- ["8232C232",0x4114],
- ["8232C233",0x4115],
- ["8232C234",0x4116],
- ["8232C235",0x4117],
- ["8232C236",0x4118],
- ["8232C237",0x4119],
- ["8232C238",0x411A],
- ["8232C239",0x411B],
- ["8232C330",0x411C],
- ["8232C331",0x411D],
- ["8232C332",0x411E],
- ["8232C333",0x411F],
- ["8232C334",0x4120],
- ["8232C335",0x4121],
- ["8232C336",0x4122],
- ["8232C337",0x4123],
- ["8232C338",0x4124],
- ["8232C339",0x4125],
- ["8232C430",0x4126],
- ["8232C431",0x4127],
- ["8232C432",0x4128],
- ["8232C433",0x4129],
- ["8232C434",0x412A],
- ["8232C435",0x412B],
- ["8232C436",0x412C],
- ["8232C437",0x412D],
- ["8232C438",0x412E],
- ["8232C439",0x412F],
- ["8232C530",0x4130],
- ["8232C531",0x4131],
- ["8232C532",0x4132],
- ["8232C533",0x4133],
- ["8232C534",0x4134],
- ["8232C535",0x4135],
- ["8232C536",0x4136],
- ["8232C537",0x4137],
- ["8232C538",0x4138],
- ["8232C539",0x4139],
- ["8232C630",0x413A],
- ["8232C631",0x413B],
- ["8232C632",0x413C],
- ["8232C633",0x413D],
- ["8232C634",0x413E],
- ["8232C635",0x413F],
- ["8232C636",0x4140],
- ["8232C637",0x4141],
- ["8232C638",0x4142],
- ["8232C639",0x4143],
- ["8232C730",0x4144],
- ["8232C731",0x4145],
- ["8232C732",0x4146],
- ["8232C733",0x4147],
- ["8232C734",0x4148],
- ["8232C735",0x4149],
- ["8232C736",0x414A],
- ["8232C737",0x414B],
- ["8232C738",0x414C],
- ["8232C739",0x414D],
- ["8232C830",0x414E],
- ["8232C831",0x414F],
- ["8232C832",0x4150],
- ["8232C833",0x4151],
- ["8232C834",0x4152],
- ["8232C835",0x4153],
- ["8232C836",0x4154],
- ["8232C837",0x4155],
- ["8232C838",0x4156],
- ["8232C839",0x4157],
- ["8232C930",0x4158],
- ["8232C931",0x4159],
- ["8232C932",0x415A],
- ["8232C933",0x415B],
- ["8232C934",0x415C],
- ["8232C935",0x415D],
- ["8232C936",0x415E],
- ["FE70",0x415F],
- ["8232C937",0x4160],
- ["8232C938",0x4161],
- ["8232C939",0x4162],
- ["8232CA30",0x4163],
- ["8232CA31",0x4164],
- ["8232CA32",0x4165],
- ["8232CA33",0x4166],
- ["8232CA34",0x4167],
- ["8232CA35",0x4168],
- ["8232CA36",0x4169],
- ["8232CA37",0x416A],
- ["8232CA38",0x416B],
- ["8232CA39",0x416C],
- ["8232CB30",0x416D],
- ["8232CB31",0x416E],
- ["8232CB32",0x416F],
- ["8232CB33",0x4170],
- ["8232CB34",0x4171],
- ["8232CB35",0x4172],
- ["8232CB36",0x4173],
- ["8232CB37",0x4174],
- ["8232CB38",0x4175],
- ["8232CB39",0x4176],
- ["8232CC30",0x4177],
- ["8232CC31",0x4178],
- ["8232CC32",0x4179],
- ["8232CC33",0x417A],
- ["8232CC34",0x417B],
- ["8232CC35",0x417C],
- ["8232CC36",0x417D],
- ["8232CC37",0x417E],
- ["8232CC38",0x417F],
- ["8232CC39",0x4180],
- ["8232CD30",0x4181],
- ["8232CD31",0x4182],
- ["8232CD32",0x4183],
- ["8232CD33",0x4184],
- ["8232CD34",0x4185],
- ["8232CD35",0x4186],
- ["8232CD36",0x4187],
- ["8232CD37",0x4188],
- ["8232CD38",0x4189],
- ["8232CD39",0x418A],
- ["8232CE30",0x418B],
- ["8232CE31",0x418C],
- ["8232CE32",0x418D],
- ["8232CE33",0x418E],
- ["8232CE34",0x418F],
- ["8232CE35",0x4190],
- ["8232CE36",0x4191],
- ["8232CE37",0x4192],
- ["8232CE38",0x4193],
- ["8232CE39",0x4194],
- ["8232CF30",0x4195],
- ["8232CF31",0x4196],
- ["8232CF32",0x4197],
- ["8232CF33",0x4198],
- ["8232CF34",0x4199],
- ["8232CF35",0x419A],
- ["8232CF36",0x419B],
- ["8232CF37",0x419C],
- ["8232CF38",0x419D],
- ["8232CF39",0x419E],
- ["8232D030",0x419F],
- ["8232D031",0x41A0],
- ["8232D032",0x41A1],
- ["8232D033",0x41A2],
- ["8232D034",0x41A3],
- ["8232D035",0x41A4],
- ["8232D036",0x41A5],
- ["8232D037",0x41A6],
- ["8232D038",0x41A7],
- ["8232D039",0x41A8],
- ["8232D130",0x41A9],
- ["8232D131",0x41AA],
- ["8232D132",0x41AB],
- ["8232D133",0x41AC],
- ["8232D134",0x41AD],
- ["8232D135",0x41AE],
- ["8232D136",0x41AF],
- ["8232D137",0x41B0],
- ["8232D138",0x41B1],
- ["8232D139",0x41B2],
- ["8232D230",0x41B3],
- ["8232D231",0x41B4],
- ["8232D232",0x41B5],
- ["8232D233",0x41B6],
- ["8232D234",0x41B7],
- ["8232D235",0x41B8],
- ["8232D236",0x41B9],
- ["8232D237",0x41BA],
- ["8232D238",0x41BB],
- ["8232D239",0x41BC],
- ["8232D330",0x41BD],
- ["8232D331",0x41BE],
- ["8232D332",0x41BF],
- ["8232D333",0x41C0],
- ["8232D334",0x41C1],
- ["8232D335",0x41C2],
- ["8232D336",0x41C3],
- ["8232D337",0x41C4],
- ["8232D338",0x41C5],
- ["8232D339",0x41C6],
- ["8232D430",0x41C7],
- ["8232D431",0x41C8],
- ["8232D432",0x41C9],
- ["8232D433",0x41CA],
- ["8232D434",0x41CB],
- ["8232D435",0x41CC],
- ["8232D436",0x41CD],
- ["8232D437",0x41CE],
- ["8232D438",0x41CF],
- ["8232D439",0x41D0],
- ["8232D530",0x41D1],
- ["8232D531",0x41D2],
- ["8232D532",0x41D3],
- ["8232D533",0x41D4],
- ["8232D534",0x41D5],
- ["8232D535",0x41D6],
- ["8232D536",0x41D7],
- ["8232D537",0x41D8],
- ["8232D538",0x41D9],
- ["8232D539",0x41DA],
- ["8232D630",0x41DB],
- ["8232D631",0x41DC],
- ["8232D632",0x41DD],
- ["8232D633",0x41DE],
- ["8232D634",0x41DF],
- ["8232D635",0x41E0],
- ["8232D636",0x41E1],
- ["8232D637",0x41E2],
- ["8232D638",0x41E3],
- ["8232D639",0x41E4],
- ["8232D730",0x41E5],
- ["8232D731",0x41E6],
- ["8232D732",0x41E7],
- ["8232D733",0x41E8],
- ["8232D734",0x41E9],
- ["8232D735",0x41EA],
- ["8232D736",0x41EB],
- ["8232D737",0x41EC],
- ["8232D738",0x41ED],
- ["8232D739",0x41EE],
- ["8232D830",0x41EF],
- ["8232D831",0x41F0],
- ["8232D832",0x41F1],
- ["8232D833",0x41F2],
- ["8232D834",0x41F3],
- ["8232D835",0x41F4],
- ["8232D836",0x41F5],
- ["8232D837",0x41F6],
- ["8232D838",0x41F7],
- ["8232D839",0x41F8],
- ["8232D930",0x41F9],
- ["8232D931",0x41FA],
- ["8232D932",0x41FB],
- ["8232D933",0x41FC],
- ["8232D934",0x41FD],
- ["8232D935",0x41FE],
- ["8232D936",0x41FF],
- ["8232D937",0x4200],
- ["8232D938",0x4201],
- ["8232D939",0x4202],
- ["8232DA30",0x4203],
- ["8232DA31",0x4204],
- ["8232DA32",0x4205],
- ["8232DA33",0x4206],
- ["8232DA34",0x4207],
- ["8232DA35",0x4208],
- ["8232DA36",0x4209],
- ["8232DA37",0x420A],
- ["8232DA38",0x420B],
- ["8232DA39",0x420C],
- ["8232DB30",0x420D],
- ["8232DB31",0x420E],
- ["8232DB32",0x420F],
- ["8232DB33",0x4210],
- ["8232DB34",0x4211],
- ["8232DB35",0x4212],
- ["8232DB36",0x4213],
- ["8232DB37",0x4214],
- ["8232DB38",0x4215],
- ["8232DB39",0x4216],
- ["8232DC30",0x4217],
- ["8232DC31",0x4218],
- ["8232DC32",0x4219],
- ["8232DC33",0x421A],
- ["8232DC34",0x421B],
- ["8232DC35",0x421C],
- ["8232DC36",0x421D],
- ["8232DC37",0x421E],
- ["8232DC38",0x421F],
- ["8232DC39",0x4220],
- ["8232DD30",0x4221],
- ["8232DD31",0x4222],
- ["8232DD32",0x4223],
- ["8232DD33",0x4224],
- ["8232DD34",0x4225],
- ["8232DD35",0x4226],
- ["8232DD36",0x4227],
- ["8232DD37",0x4228],
- ["8232DD38",0x4229],
- ["8232DD39",0x422A],
- ["8232DE30",0x422B],
- ["8232DE31",0x422C],
- ["8232DE32",0x422D],
- ["8232DE33",0x422E],
- ["8232DE34",0x422F],
- ["8232DE35",0x4230],
- ["8232DE36",0x4231],
- ["8232DE37",0x4232],
- ["8232DE38",0x4233],
- ["8232DE39",0x4234],
- ["8232DF30",0x4235],
- ["8232DF31",0x4236],
- ["8232DF32",0x4237],
- ["8232DF33",0x4238],
- ["8232DF34",0x4239],
- ["8232DF35",0x423A],
- ["8232DF36",0x423B],
- ["8232DF37",0x423C],
- ["8232DF38",0x423D],
- ["8232DF39",0x423E],
- ["8232E030",0x423F],
- ["8232E031",0x4240],
- ["8232E032",0x4241],
- ["8232E033",0x4242],
- ["8232E034",0x4243],
- ["8232E035",0x4244],
- ["8232E036",0x4245],
- ["8232E037",0x4246],
- ["8232E038",0x4247],
- ["8232E039",0x4248],
- ["8232E130",0x4249],
- ["8232E131",0x424A],
- ["8232E132",0x424B],
- ["8232E133",0x424C],
- ["8232E134",0x424D],
- ["8232E135",0x424E],
- ["8232E136",0x424F],
- ["8232E137",0x4250],
- ["8232E138",0x4251],
- ["8232E139",0x4252],
- ["8232E230",0x4253],
- ["8232E231",0x4254],
- ["8232E232",0x4255],
- ["8232E233",0x4256],
- ["8232E234",0x4257],
- ["8232E235",0x4258],
- ["8232E236",0x4259],
- ["8232E237",0x425A],
- ["8232E238",0x425B],
- ["8232E239",0x425C],
- ["8232E330",0x425D],
- ["8232E331",0x425E],
- ["8232E332",0x425F],
- ["8232E333",0x4260],
- ["8232E334",0x4261],
- ["8232E335",0x4262],
- ["8232E336",0x4263],
- ["8232E337",0x4264],
- ["8232E338",0x4265],
- ["8232E339",0x4266],
- ["8232E430",0x4267],
- ["8232E431",0x4268],
- ["8232E432",0x4269],
- ["8232E433",0x426A],
- ["8232E434",0x426B],
- ["8232E435",0x426C],
- ["8232E436",0x426D],
- ["8232E437",0x426E],
- ["8232E438",0x426F],
- ["8232E439",0x4270],
- ["8232E530",0x4271],
- ["8232E531",0x4272],
- ["8232E532",0x4273],
- ["8232E533",0x4274],
- ["8232E534",0x4275],
- ["8232E535",0x4276],
- ["8232E536",0x4277],
- ["8232E537",0x4278],
- ["8232E538",0x4279],
- ["8232E539",0x427A],
- ["8232E630",0x427B],
- ["8232E631",0x427C],
- ["8232E632",0x427D],
- ["8232E633",0x427E],
- ["8232E634",0x427F],
- ["8232E635",0x4280],
- ["8232E636",0x4281],
- ["8232E637",0x4282],
- ["8232E638",0x4283],
- ["8232E639",0x4284],
- ["8232E730",0x4285],
- ["8232E731",0x4286],
- ["8232E732",0x4287],
- ["8232E733",0x4288],
- ["8232E734",0x4289],
- ["8232E735",0x428A],
- ["8232E736",0x428B],
- ["8232E737",0x428C],
- ["8232E738",0x428D],
- ["8232E739",0x428E],
- ["8232E830",0x428F],
- ["8232E831",0x4290],
- ["8232E832",0x4291],
- ["8232E833",0x4292],
- ["8232E834",0x4293],
- ["8232E835",0x4294],
- ["8232E836",0x4295],
- ["8232E837",0x4296],
- ["8232E838",0x4297],
- ["8232E839",0x4298],
- ["8232E930",0x4299],
- ["8232E931",0x429A],
- ["8232E932",0x429B],
- ["8232E933",0x429C],
- ["8232E934",0x429D],
- ["8232E935",0x429E],
- ["8232E936",0x429F],
- ["8232E937",0x42A0],
- ["8232E938",0x42A1],
- ["8232E939",0x42A2],
- ["8232EA30",0x42A3],
- ["8232EA31",0x42A4],
- ["8232EA32",0x42A5],
- ["8232EA33",0x42A6],
- ["8232EA34",0x42A7],
- ["8232EA35",0x42A8],
- ["8232EA36",0x42A9],
- ["8232EA37",0x42AA],
- ["8232EA38",0x42AB],
- ["8232EA39",0x42AC],
- ["8232EB30",0x42AD],
- ["8232EB31",0x42AE],
- ["8232EB32",0x42AF],
- ["8232EB33",0x42B0],
- ["8232EB34",0x42B1],
- ["8232EB35",0x42B2],
- ["8232EB36",0x42B3],
- ["8232EB37",0x42B4],
- ["8232EB38",0x42B5],
- ["8232EB39",0x42B6],
- ["8232EC30",0x42B7],
- ["8232EC31",0x42B8],
- ["8232EC32",0x42B9],
- ["8232EC33",0x42BA],
- ["8232EC34",0x42BB],
- ["8232EC35",0x42BC],
- ["8232EC36",0x42BD],
- ["8232EC37",0x42BE],
- ["8232EC38",0x42BF],
- ["8232EC39",0x42C0],
- ["8232ED30",0x42C1],
- ["8232ED31",0x42C2],
- ["8232ED32",0x42C3],
- ["8232ED33",0x42C4],
- ["8232ED34",0x42C5],
- ["8232ED35",0x42C6],
- ["8232ED36",0x42C7],
- ["8232ED37",0x42C8],
- ["8232ED38",0x42C9],
- ["8232ED39",0x42CA],
- ["8232EE30",0x42CB],
- ["8232EE31",0x42CC],
- ["8232EE32",0x42CD],
- ["8232EE33",0x42CE],
- ["8232EE34",0x42CF],
- ["8232EE35",0x42D0],
- ["8232EE36",0x42D1],
- ["8232EE37",0x42D2],
- ["8232EE38",0x42D3],
- ["8232EE39",0x42D4],
- ["8232EF30",0x42D5],
- ["8232EF31",0x42D6],
- ["8232EF32",0x42D7],
- ["8232EF33",0x42D8],
- ["8232EF34",0x42D9],
- ["8232EF35",0x42DA],
- ["8232EF36",0x42DB],
- ["8232EF37",0x42DC],
- ["8232EF38",0x42DD],
- ["8232EF39",0x42DE],
- ["8232F030",0x42DF],
- ["8232F031",0x42E0],
- ["8232F032",0x42E1],
- ["8232F033",0x42E2],
- ["8232F034",0x42E3],
- ["8232F035",0x42E4],
- ["8232F036",0x42E5],
- ["8232F037",0x42E6],
- ["8232F038",0x42E7],
- ["8232F039",0x42E8],
- ["8232F130",0x42E9],
- ["8232F131",0x42EA],
- ["8232F132",0x42EB],
- ["8232F133",0x42EC],
- ["8232F134",0x42ED],
- ["8232F135",0x42EE],
- ["8232F136",0x42EF],
- ["8232F137",0x42F0],
- ["8232F138",0x42F1],
- ["8232F139",0x42F2],
- ["8232F230",0x42F3],
- ["8232F231",0x42F4],
- ["8232F232",0x42F5],
- ["8232F233",0x42F6],
- ["8232F234",0x42F7],
- ["8232F235",0x42F8],
- ["8232F236",0x42F9],
- ["8232F237",0x42FA],
- ["8232F238",0x42FB],
- ["8232F239",0x42FC],
- ["8232F330",0x42FD],
- ["8232F331",0x42FE],
- ["8232F332",0x42FF],
- ["8232F333",0x4300],
- ["8232F334",0x4301],
- ["8232F335",0x4302],
- ["8232F336",0x4303],
- ["8232F337",0x4304],
- ["8232F338",0x4305],
- ["8232F339",0x4306],
- ["8232F430",0x4307],
- ["8232F431",0x4308],
- ["8232F432",0x4309],
- ["8232F433",0x430A],
- ["8232F434",0x430B],
- ["8232F435",0x430C],
- ["8232F436",0x430D],
- ["8232F437",0x430E],
- ["8232F438",0x430F],
- ["8232F439",0x4310],
- ["8232F530",0x4311],
- ["8232F531",0x4312],
- ["8232F532",0x4313],
- ["8232F533",0x4314],
- ["8232F534",0x4315],
- ["8232F535",0x4316],
- ["8232F536",0x4317],
- ["8232F537",0x4318],
- ["8232F538",0x4319],
- ["8232F539",0x431A],
- ["8232F630",0x431B],
- ["8232F631",0x431C],
- ["8232F632",0x431D],
- ["8232F633",0x431E],
- ["8232F634",0x431F],
- ["8232F635",0x4320],
- ["8232F636",0x4321],
- ["8232F637",0x4322],
- ["8232F638",0x4323],
- ["8232F639",0x4324],
- ["8232F730",0x4325],
- ["8232F731",0x4326],
- ["8232F732",0x4327],
- ["8232F733",0x4328],
- ["8232F734",0x4329],
- ["8232F735",0x432A],
- ["8232F736",0x432B],
- ["8232F737",0x432C],
- ["8232F738",0x432D],
- ["8232F739",0x432E],
- ["8232F830",0x432F],
- ["8232F831",0x4330],
- ["8232F832",0x4331],
- ["8232F833",0x4332],
- ["8232F834",0x4333],
- ["8232F835",0x4334],
- ["8232F836",0x4335],
- ["8232F837",0x4336],
- ["FE72",0x4337],
- ["8232F838",0x4338],
- ["8232F839",0x4339],
- ["8232F930",0x433A],
- ["8232F931",0x433B],
- ["8232F932",0x433C],
- ["8232F933",0x433D],
- ["8232F934",0x433E],
- ["8232F935",0x433F],
- ["8232F936",0x4340],
- ["8232F937",0x4341],
- ["8232F938",0x4342],
- ["8232F939",0x4343],
- ["8232FA30",0x4344],
- ["8232FA31",0x4345],
- ["8232FA32",0x4346],
- ["8232FA33",0x4347],
- ["8232FA34",0x4348],
- ["8232FA35",0x4349],
- ["8232FA36",0x434A],
- ["8232FA37",0x434B],
- ["8232FA38",0x434C],
- ["8232FA39",0x434D],
- ["8232FB30",0x434E],
- ["8232FB31",0x434F],
- ["8232FB32",0x4350],
- ["8232FB33",0x4351],
- ["8232FB34",0x4352],
- ["8232FB35",0x4353],
- ["8232FB36",0x4354],
- ["8232FB37",0x4355],
- ["8232FB38",0x4356],
- ["8232FB39",0x4357],
- ["8232FC30",0x4358],
- ["8232FC31",0x4359],
- ["8232FC32",0x435A],
- ["8232FC33",0x435B],
- ["8232FC34",0x435C],
- ["8232FC35",0x435D],
- ["8232FC36",0x435E],
- ["8232FC37",0x435F],
- ["8232FC38",0x4360],
- ["8232FC39",0x4361],
- ["8232FD30",0x4362],
- ["8232FD31",0x4363],
- ["8232FD32",0x4364],
- ["8232FD33",0x4365],
- ["8232FD34",0x4366],
- ["8232FD35",0x4367],
- ["8232FD36",0x4368],
- ["8232FD37",0x4369],
- ["8232FD38",0x436A],
- ["8232FD39",0x436B],
- ["8232FE30",0x436C],
- ["8232FE31",0x436D],
- ["8232FE32",0x436E],
- ["8232FE33",0x436F],
- ["8232FE34",0x4370],
- ["8232FE35",0x4371],
- ["8232FE36",0x4372],
- ["8232FE37",0x4373],
- ["8232FE38",0x4374],
- ["8232FE39",0x4375],
- ["82338130",0x4376],
- ["82338131",0x4377],
- ["82338132",0x4378],
- ["82338133",0x4379],
- ["82338134",0x437A],
- ["82338135",0x437B],
- ["82338136",0x437C],
- ["82338137",0x437D],
- ["82338138",0x437E],
- ["82338139",0x437F],
- ["82338230",0x4380],
- ["82338231",0x4381],
- ["82338232",0x4382],
- ["82338233",0x4383],
- ["82338234",0x4384],
- ["82338235",0x4385],
- ["82338236",0x4386],
- ["82338237",0x4387],
- ["82338238",0x4388],
- ["82338239",0x4389],
- ["82338330",0x438A],
- ["82338331",0x438B],
- ["82338332",0x438C],
- ["82338333",0x438D],
- ["82338334",0x438E],
- ["82338335",0x438F],
- ["82338336",0x4390],
- ["82338337",0x4391],
- ["82338338",0x4392],
- ["82338339",0x4393],
- ["82338430",0x4394],
- ["82338431",0x4395],
- ["82338432",0x4396],
- ["82338433",0x4397],
- ["82338434",0x4398],
- ["82338435",0x4399],
- ["82338436",0x439A],
- ["82338437",0x439B],
- ["82338438",0x439C],
- ["82338439",0x439D],
- ["82338530",0x439E],
- ["82338531",0x439F],
- ["82338532",0x43A0],
- ["82338533",0x43A1],
- ["82338534",0x43A2],
- ["82338535",0x43A3],
- ["82338536",0x43A4],
- ["82338537",0x43A5],
- ["82338538",0x43A6],
- ["82338539",0x43A7],
- ["82338630",0x43A8],
- ["82338631",0x43A9],
- ["82338632",0x43AA],
- ["82338633",0x43AB],
- ["FE78",0x43AC],
- ["82338634",0x43AD],
- ["82338635",0x43AE],
- ["82338636",0x43AF],
- ["82338637",0x43B0],
- ["FE77",0x43B1],
- ["82338638",0x43B2],
- ["82338639",0x43B3],
- ["82338730",0x43B4],
- ["82338731",0x43B5],
- ["82338732",0x43B6],
- ["82338733",0x43B7],
- ["82338734",0x43B8],
- ["82338735",0x43B9],
- ["82338736",0x43BA],
- ["82338737",0x43BB],
- ["82338738",0x43BC],
- ["82338739",0x43BD],
- ["82338830",0x43BE],
- ["82338831",0x43BF],
- ["82338832",0x43C0],
- ["82338833",0x43C1],
- ["82338834",0x43C2],
- ["82338835",0x43C3],
- ["82338836",0x43C4],
- ["82338837",0x43C5],
- ["82338838",0x43C6],
- ["82338839",0x43C7],
- ["82338930",0x43C8],
- ["82338931",0x43C9],
- ["82338932",0x43CA],
- ["82338933",0x43CB],
- ["82338934",0x43CC],
- ["82338935",0x43CD],
- ["82338936",0x43CE],
- ["82338937",0x43CF],
- ["82338938",0x43D0],
- ["82338939",0x43D1],
- ["82338A30",0x43D2],
- ["82338A31",0x43D3],
- ["82338A32",0x43D4],
- ["82338A33",0x43D5],
- ["82338A34",0x43D6],
- ["82338A35",0x43D7],
- ["82338A36",0x43D8],
- ["82338A37",0x43D9],
- ["82338A38",0x43DA],
- ["82338A39",0x43DB],
- ["82338B30",0x43DC],
- ["FE7A",0x43DD],
- ["82338B31",0x43DE],
- ["82338B32",0x43DF],
- ["82338B33",0x43E0],
- ["82338B34",0x43E1],
- ["82338B35",0x43E2],
- ["82338B36",0x43E3],
- ["82338B37",0x43E4],
- ["82338B38",0x43E5],
- ["82338B39",0x43E6],
- ["82338C30",0x43E7],
- ["82338C31",0x43E8],
- ["82338C32",0x43E9],
- ["82338C33",0x43EA],
- ["82338C34",0x43EB],
- ["82338C35",0x43EC],
- ["82338C36",0x43ED],
- ["82338C37",0x43EE],
- ["82338C38",0x43EF],
- ["82338C39",0x43F0],
- ["82338D30",0x43F1],
- ["82338D31",0x43F2],
- ["82338D32",0x43F3],
- ["82338D33",0x43F4],
- ["82338D34",0x43F5],
- ["82338D35",0x43F6],
- ["82338D36",0x43F7],
- ["82338D37",0x43F8],
- ["82338D38",0x43F9],
- ["82338D39",0x43FA],
- ["82338E30",0x43FB],
- ["82338E31",0x43FC],
- ["82338E32",0x43FD],
- ["82338E33",0x43FE],
- ["82338E34",0x43FF],
- ["82338E35",0x4400],
- ["82338E36",0x4401],
- ["82338E37",0x4402],
- ["82338E38",0x4403],
- ["82338E39",0x4404],
- ["82338F30",0x4405],
- ["82338F31",0x4406],
- ["82338F32",0x4407],
- ["82338F33",0x4408],
- ["82338F34",0x4409],
- ["82338F35",0x440A],
- ["82338F36",0x440B],
- ["82338F37",0x440C],
- ["82338F38",0x440D],
- ["82338F39",0x440E],
- ["82339030",0x440F],
- ["82339031",0x4410],
- ["82339032",0x4411],
- ["82339033",0x4412],
- ["82339034",0x4413],
- ["82339035",0x4414],
- ["82339036",0x4415],
- ["82339037",0x4416],
- ["82339038",0x4417],
- ["82339039",0x4418],
- ["82339130",0x4419],
- ["82339131",0x441A],
- ["82339132",0x441B],
- ["82339133",0x441C],
- ["82339134",0x441D],
- ["82339135",0x441E],
- ["82339136",0x441F],
- ["82339137",0x4420],
- ["82339138",0x4421],
- ["82339139",0x4422],
- ["82339230",0x4423],
- ["82339231",0x4424],
- ["82339232",0x4425],
- ["82339233",0x4426],
- ["82339234",0x4427],
- ["82339235",0x4428],
- ["82339236",0x4429],
- ["82339237",0x442A],
- ["82339238",0x442B],
- ["82339239",0x442C],
- ["82339330",0x442D],
- ["82339331",0x442E],
- ["82339332",0x442F],
- ["82339333",0x4430],
- ["82339334",0x4431],
- ["82339335",0x4432],
- ["82339336",0x4433],
- ["82339337",0x4434],
- ["82339338",0x4435],
- ["82339339",0x4436],
- ["82339430",0x4437],
- ["82339431",0x4438],
- ["82339432",0x4439],
- ["82339433",0x443A],
- ["82339434",0x443B],
- ["82339435",0x443C],
- ["82339436",0x443D],
- ["82339437",0x443E],
- ["82339438",0x443F],
- ["82339439",0x4440],
- ["82339530",0x4441],
- ["82339531",0x4442],
- ["82339532",0x4443],
- ["82339533",0x4444],
- ["82339534",0x4445],
- ["82339535",0x4446],
- ["82339536",0x4447],
- ["82339537",0x4448],
- ["82339538",0x4449],
- ["82339539",0x444A],
- ["82339630",0x444B],
- ["82339631",0x444C],
- ["82339632",0x444D],
- ["82339633",0x444E],
- ["82339634",0x444F],
- ["82339635",0x4450],
- ["82339636",0x4451],
- ["82339637",0x4452],
- ["82339638",0x4453],
- ["82339639",0x4454],
- ["82339730",0x4455],
- ["82339731",0x4456],
- ["82339732",0x4457],
- ["82339733",0x4458],
- ["82339734",0x4459],
- ["82339735",0x445A],
- ["82339736",0x445B],
- ["82339737",0x445C],
- ["82339738",0x445D],
- ["82339739",0x445E],
- ["82339830",0x445F],
- ["82339831",0x4460],
- ["82339832",0x4461],
- ["82339833",0x4462],
- ["82339834",0x4463],
- ["82339835",0x4464],
- ["82339836",0x4465],
- ["82339837",0x4466],
- ["82339838",0x4467],
- ["82339839",0x4468],
- ["82339930",0x4469],
- ["82339931",0x446A],
- ["82339932",0x446B],
- ["82339933",0x446C],
- ["82339934",0x446D],
- ["82339935",0x446E],
- ["82339936",0x446F],
- ["82339937",0x4470],
- ["82339938",0x4471],
- ["82339939",0x4472],
- ["82339A30",0x4473],
- ["82339A31",0x4474],
- ["82339A32",0x4475],
- ["82339A33",0x4476],
- ["82339A34",0x4477],
- ["82339A35",0x4478],
- ["82339A36",0x4479],
- ["82339A37",0x447A],
- ["82339A38",0x447B],
- ["82339A39",0x447C],
- ["82339B30",0x447D],
- ["82339B31",0x447E],
- ["82339B32",0x447F],
- ["82339B33",0x4480],
- ["82339B34",0x4481],
- ["82339B35",0x4482],
- ["82339B36",0x4483],
- ["82339B37",0x4484],
- ["82339B38",0x4485],
- ["82339B39",0x4486],
- ["82339C30",0x4487],
- ["82339C31",0x4488],
- ["82339C32",0x4489],
- ["82339C33",0x448A],
- ["82339C34",0x448B],
- ["82339C35",0x448C],
- ["82339C36",0x448D],
- ["82339C37",0x448E],
- ["82339C38",0x448F],
- ["82339C39",0x4490],
- ["82339D30",0x4491],
- ["82339D31",0x4492],
- ["82339D32",0x4493],
- ["82339D33",0x4494],
- ["82339D34",0x4495],
- ["82339D35",0x4496],
- ["82339D36",0x4497],
- ["82339D37",0x4498],
- ["82339D38",0x4499],
- ["82339D39",0x449A],
- ["82339E30",0x449B],
- ["82339E31",0x449C],
- ["82339E32",0x449D],
- ["82339E33",0x449E],
- ["82339E34",0x449F],
- ["82339E35",0x44A0],
- ["82339E36",0x44A1],
- ["82339E37",0x44A2],
- ["82339E38",0x44A3],
- ["82339E39",0x44A4],
- ["82339F30",0x44A5],
- ["82339F31",0x44A6],
- ["82339F32",0x44A7],
- ["82339F33",0x44A8],
- ["82339F34",0x44A9],
- ["82339F35",0x44AA],
- ["82339F36",0x44AB],
- ["82339F37",0x44AC],
- ["82339F38",0x44AD],
- ["82339F39",0x44AE],
- ["8233A030",0x44AF],
- ["8233A031",0x44B0],
- ["8233A032",0x44B1],
- ["8233A033",0x44B2],
- ["8233A034",0x44B3],
- ["8233A035",0x44B4],
- ["8233A036",0x44B5],
- ["8233A037",0x44B6],
- ["8233A038",0x44B7],
- ["8233A039",0x44B8],
- ["8233A130",0x44B9],
- ["8233A131",0x44BA],
- ["8233A132",0x44BB],
- ["8233A133",0x44BC],
- ["8233A134",0x44BD],
- ["8233A135",0x44BE],
- ["8233A136",0x44BF],
- ["8233A137",0x44C0],
- ["8233A138",0x44C1],
- ["8233A139",0x44C2],
- ["8233A230",0x44C3],
- ["8233A231",0x44C4],
- ["8233A232",0x44C5],
- ["8233A233",0x44C6],
- ["8233A234",0x44C7],
- ["8233A235",0x44C8],
- ["8233A236",0x44C9],
- ["8233A237",0x44CA],
- ["8233A238",0x44CB],
- ["8233A239",0x44CC],
- ["8233A330",0x44CD],
- ["8233A331",0x44CE],
- ["8233A332",0x44CF],
- ["8233A333",0x44D0],
- ["8233A334",0x44D1],
- ["8233A335",0x44D2],
- ["8233A336",0x44D3],
- ["8233A337",0x44D4],
- ["8233A338",0x44D5],
- ["FE7B",0x44D6],
- ["8233A339",0x44D7],
- ["8233A430",0x44D8],
- ["8233A431",0x44D9],
- ["8233A432",0x44DA],
- ["8233A433",0x44DB],
- ["8233A434",0x44DC],
- ["8233A435",0x44DD],
- ["8233A436",0x44DE],
- ["8233A437",0x44DF],
- ["8233A438",0x44E0],
- ["8233A439",0x44E1],
- ["8233A530",0x44E2],
- ["8233A531",0x44E3],
- ["8233A532",0x44E4],
- ["8233A533",0x44E5],
- ["8233A534",0x44E6],
- ["8233A535",0x44E7],
- ["8233A536",0x44E8],
- ["8233A537",0x44E9],
- ["8233A538",0x44EA],
- ["8233A539",0x44EB],
- ["8233A630",0x44EC],
- ["8233A631",0x44ED],
- ["8233A632",0x44EE],
- ["8233A633",0x44EF],
- ["8233A634",0x44F0],
- ["8233A635",0x44F1],
- ["8233A636",0x44F2],
- ["8233A637",0x44F3],
- ["8233A638",0x44F4],
- ["8233A639",0x44F5],
- ["8233A730",0x44F6],
- ["8233A731",0x44F7],
- ["8233A732",0x44F8],
- ["8233A733",0x44F9],
- ["8233A734",0x44FA],
- ["8233A735",0x44FB],
- ["8233A736",0x44FC],
- ["8233A737",0x44FD],
- ["8233A738",0x44FE],
- ["8233A739",0x44FF],
- ["8233A830",0x4500],
- ["8233A831",0x4501],
- ["8233A832",0x4502],
- ["8233A833",0x4503],
- ["8233A834",0x4504],
- ["8233A835",0x4505],
- ["8233A836",0x4506],
- ["8233A837",0x4507],
- ["8233A838",0x4508],
- ["8233A839",0x4509],
- ["8233A930",0x450A],
- ["8233A931",0x450B],
- ["8233A932",0x450C],
- ["8233A933",0x450D],
- ["8233A934",0x450E],
- ["8233A935",0x450F],
- ["8233A936",0x4510],
- ["8233A937",0x4511],
- ["8233A938",0x4512],
- ["8233A939",0x4513],
- ["8233AA30",0x4514],
- ["8233AA31",0x4515],
- ["8233AA32",0x4516],
- ["8233AA33",0x4517],
- ["8233AA34",0x4518],
- ["8233AA35",0x4519],
- ["8233AA36",0x451A],
- ["8233AA37",0x451B],
- ["8233AA38",0x451C],
- ["8233AA39",0x451D],
- ["8233AB30",0x451E],
- ["8233AB31",0x451F],
- ["8233AB32",0x4520],
- ["8233AB33",0x4521],
- ["8233AB34",0x4522],
- ["8233AB35",0x4523],
- ["8233AB36",0x4524],
- ["8233AB37",0x4525],
- ["8233AB38",0x4526],
- ["8233AB39",0x4527],
- ["8233AC30",0x4528],
- ["8233AC31",0x4529],
- ["8233AC32",0x452A],
- ["8233AC33",0x452B],
- ["8233AC34",0x452C],
- ["8233AC35",0x452D],
- ["8233AC36",0x452E],
- ["8233AC37",0x452F],
- ["8233AC38",0x4530],
- ["8233AC39",0x4531],
- ["8233AD30",0x4532],
- ["8233AD31",0x4533],
- ["8233AD32",0x4534],
- ["8233AD33",0x4535],
- ["8233AD34",0x4536],
- ["8233AD35",0x4537],
- ["8233AD36",0x4538],
- ["8233AD37",0x4539],
- ["8233AD38",0x453A],
- ["8233AD39",0x453B],
- ["8233AE30",0x453C],
- ["8233AE31",0x453D],
- ["8233AE32",0x453E],
- ["8233AE33",0x453F],
- ["8233AE34",0x4540],
- ["8233AE35",0x4541],
- ["8233AE36",0x4542],
- ["8233AE37",0x4543],
- ["8233AE38",0x4544],
- ["8233AE39",0x4545],
- ["8233AF30",0x4546],
- ["8233AF31",0x4547],
- ["8233AF32",0x4548],
- ["8233AF33",0x4549],
- ["8233AF34",0x454A],
- ["8233AF35",0x454B],
- ["8233AF36",0x454C],
- ["8233AF37",0x454D],
- ["8233AF38",0x454E],
- ["8233AF39",0x454F],
- ["8233B030",0x4550],
- ["8233B031",0x4551],
- ["8233B032",0x4552],
- ["8233B033",0x4553],
- ["8233B034",0x4554],
- ["8233B035",0x4555],
- ["8233B036",0x4556],
- ["8233B037",0x4557],
- ["8233B038",0x4558],
- ["8233B039",0x4559],
- ["8233B130",0x455A],
- ["8233B131",0x455B],
- ["8233B132",0x455C],
- ["8233B133",0x455D],
- ["8233B134",0x455E],
- ["8233B135",0x455F],
- ["8233B136",0x4560],
- ["8233B137",0x4561],
- ["8233B138",0x4562],
- ["8233B139",0x4563],
- ["8233B230",0x4564],
- ["8233B231",0x4565],
- ["8233B232",0x4566],
- ["8233B233",0x4567],
- ["8233B234",0x4568],
- ["8233B235",0x4569],
- ["8233B236",0x456A],
- ["8233B237",0x456B],
- ["8233B238",0x456C],
- ["8233B239",0x456D],
- ["8233B330",0x456E],
- ["8233B331",0x456F],
- ["8233B332",0x4570],
- ["8233B333",0x4571],
- ["8233B334",0x4572],
- ["8233B335",0x4573],
- ["8233B336",0x4574],
- ["8233B337",0x4575],
- ["8233B338",0x4576],
- ["8233B339",0x4577],
- ["8233B430",0x4578],
- ["8233B431",0x4579],
- ["8233B432",0x457A],
- ["8233B433",0x457B],
- ["8233B434",0x457C],
- ["8233B435",0x457D],
- ["8233B436",0x457E],
- ["8233B437",0x457F],
- ["8233B438",0x4580],
- ["8233B439",0x4581],
- ["8233B530",0x4582],
- ["8233B531",0x4583],
- ["8233B532",0x4584],
- ["8233B533",0x4585],
- ["8233B534",0x4586],
- ["8233B535",0x4587],
- ["8233B536",0x4588],
- ["8233B537",0x4589],
- ["8233B538",0x458A],
- ["8233B539",0x458B],
- ["8233B630",0x458C],
- ["8233B631",0x458D],
- ["8233B632",0x458E],
- ["8233B633",0x458F],
- ["8233B634",0x4590],
- ["8233B635",0x4591],
- ["8233B636",0x4592],
- ["8233B637",0x4593],
- ["8233B638",0x4594],
- ["8233B639",0x4595],
- ["8233B730",0x4596],
- ["8233B731",0x4597],
- ["8233B732",0x4598],
- ["8233B733",0x4599],
- ["8233B734",0x459A],
- ["8233B735",0x459B],
- ["8233B736",0x459C],
- ["8233B737",0x459D],
- ["8233B738",0x459E],
- ["8233B739",0x459F],
- ["8233B830",0x45A0],
- ["8233B831",0x45A1],
- ["8233B832",0x45A2],
- ["8233B833",0x45A3],
- ["8233B834",0x45A4],
- ["8233B835",0x45A5],
- ["8233B836",0x45A6],
- ["8233B837",0x45A7],
- ["8233B838",0x45A8],
- ["8233B839",0x45A9],
- ["8233B930",0x45AA],
- ["8233B931",0x45AB],
- ["8233B932",0x45AC],
- ["8233B933",0x45AD],
- ["8233B934",0x45AE],
- ["8233B935",0x45AF],
- ["8233B936",0x45B0],
- ["8233B937",0x45B1],
- ["8233B938",0x45B2],
- ["8233B939",0x45B3],
- ["8233BA30",0x45B4],
- ["8233BA31",0x45B5],
- ["8233BA32",0x45B6],
- ["8233BA33",0x45B7],
- ["8233BA34",0x45B8],
- ["8233BA35",0x45B9],
- ["8233BA36",0x45BA],
- ["8233BA37",0x45BB],
- ["8233BA38",0x45BC],
- ["8233BA39",0x45BD],
- ["8233BB30",0x45BE],
- ["8233BB31",0x45BF],
- ["8233BB32",0x45C0],
- ["8233BB33",0x45C1],
- ["8233BB34",0x45C2],
- ["8233BB35",0x45C3],
- ["8233BB36",0x45C4],
- ["8233BB37",0x45C5],
- ["8233BB38",0x45C6],
- ["8233BB39",0x45C7],
- ["8233BC30",0x45C8],
- ["8233BC31",0x45C9],
- ["8233BC32",0x45CA],
- ["8233BC33",0x45CB],
- ["8233BC34",0x45CC],
- ["8233BC35",0x45CD],
- ["8233BC36",0x45CE],
- ["8233BC37",0x45CF],
- ["8233BC38",0x45D0],
- ["8233BC39",0x45D1],
- ["8233BD30",0x45D2],
- ["8233BD31",0x45D3],
- ["8233BD32",0x45D4],
- ["8233BD33",0x45D5],
- ["8233BD34",0x45D6],
- ["8233BD35",0x45D7],
- ["8233BD36",0x45D8],
- ["8233BD37",0x45D9],
- ["8233BD38",0x45DA],
- ["8233BD39",0x45DB],
- ["8233BE30",0x45DC],
- ["8233BE31",0x45DD],
- ["8233BE32",0x45DE],
- ["8233BE33",0x45DF],
- ["8233BE34",0x45E0],
- ["8233BE35",0x45E1],
- ["8233BE36",0x45E2],
- ["8233BE37",0x45E3],
- ["8233BE38",0x45E4],
- ["8233BE39",0x45E5],
- ["8233BF30",0x45E6],
- ["8233BF31",0x45E7],
- ["8233BF32",0x45E8],
- ["8233BF33",0x45E9],
- ["8233BF34",0x45EA],
- ["8233BF35",0x45EB],
- ["8233BF36",0x45EC],
- ["8233BF37",0x45ED],
- ["8233BF38",0x45EE],
- ["8233BF39",0x45EF],
- ["8233C030",0x45F0],
- ["8233C031",0x45F1],
- ["8233C032",0x45F2],
- ["8233C033",0x45F3],
- ["8233C034",0x45F4],
- ["8233C035",0x45F5],
- ["8233C036",0x45F6],
- ["8233C037",0x45F7],
- ["8233C038",0x45F8],
- ["8233C039",0x45F9],
- ["8233C130",0x45FA],
- ["8233C131",0x45FB],
- ["8233C132",0x45FC],
- ["8233C133",0x45FD],
- ["8233C134",0x45FE],
- ["8233C135",0x45FF],
- ["8233C136",0x4600],
- ["8233C137",0x4601],
- ["8233C138",0x4602],
- ["8233C139",0x4603],
- ["8233C230",0x4604],
- ["8233C231",0x4605],
- ["8233C232",0x4606],
- ["8233C233",0x4607],
- ["8233C234",0x4608],
- ["8233C235",0x4609],
- ["8233C236",0x460A],
- ["8233C237",0x460B],
- ["8233C238",0x460C],
- ["8233C239",0x460D],
- ["8233C330",0x460E],
- ["8233C331",0x460F],
- ["8233C332",0x4610],
- ["8233C333",0x4611],
- ["8233C334",0x4612],
- ["8233C335",0x4613],
- ["8233C336",0x4614],
- ["8233C337",0x4615],
- ["8233C338",0x4616],
- ["8233C339",0x4617],
- ["8233C430",0x4618],
- ["8233C431",0x4619],
- ["8233C432",0x461A],
- ["8233C433",0x461B],
- ["8233C434",0x461C],
- ["8233C435",0x461D],
- ["8233C436",0x461E],
- ["8233C437",0x461F],
- ["8233C438",0x4620],
- ["8233C439",0x4621],
- ["8233C530",0x4622],
- ["8233C531",0x4623],
- ["8233C532",0x4624],
- ["8233C533",0x4625],
- ["8233C534",0x4626],
- ["8233C535",0x4627],
- ["8233C536",0x4628],
- ["8233C537",0x4629],
- ["8233C538",0x462A],
- ["8233C539",0x462B],
- ["8233C630",0x462C],
- ["8233C631",0x462D],
- ["8233C632",0x462E],
- ["8233C633",0x462F],
- ["8233C634",0x4630],
- ["8233C635",0x4631],
- ["8233C636",0x4632],
- ["8233C637",0x4633],
- ["8233C638",0x4634],
- ["8233C639",0x4635],
- ["8233C730",0x4636],
- ["8233C731",0x4637],
- ["8233C732",0x4638],
- ["8233C733",0x4639],
- ["8233C734",0x463A],
- ["8233C735",0x463B],
- ["8233C736",0x463C],
- ["8233C737",0x463D],
- ["8233C738",0x463E],
- ["8233C739",0x463F],
- ["8233C830",0x4640],
- ["8233C831",0x4641],
- ["8233C832",0x4642],
- ["8233C833",0x4643],
- ["8233C834",0x4644],
- ["8233C835",0x4645],
- ["8233C836",0x4646],
- ["8233C837",0x4647],
- ["8233C838",0x4648],
- ["8233C839",0x4649],
- ["8233C930",0x464A],
- ["8233C931",0x464B],
- ["FE7D",0x464C],
- ["8233C932",0x464D],
- ["8233C933",0x464E],
- ["8233C934",0x464F],
- ["8233C935",0x4650],
- ["8233C936",0x4651],
- ["8233C937",0x4652],
- ["8233C938",0x4653],
- ["8233C939",0x4654],
- ["8233CA30",0x4655],
- ["8233CA31",0x4656],
- ["8233CA32",0x4657],
- ["8233CA33",0x4658],
- ["8233CA34",0x4659],
- ["8233CA35",0x465A],
- ["8233CA36",0x465B],
- ["8233CA37",0x465C],
- ["8233CA38",0x465D],
- ["8233CA39",0x465E],
- ["8233CB30",0x465F],
- ["8233CB31",0x4660],
- ["FE7C",0x4661],
- ["8233CB32",0x4662],
- ["8233CB33",0x4663],
- ["8233CB34",0x4664],
- ["8233CB35",0x4665],
- ["8233CB36",0x4666],
- ["8233CB37",0x4667],
- ["8233CB38",0x4668],
- ["8233CB39",0x4669],
- ["8233CC30",0x466A],
- ["8233CC31",0x466B],
- ["8233CC32",0x466C],
- ["8233CC33",0x466D],
- ["8233CC34",0x466E],
- ["8233CC35",0x466F],
- ["8233CC36",0x4670],
- ["8233CC37",0x4671],
- ["8233CC38",0x4672],
- ["8233CC39",0x4673],
- ["8233CD30",0x4674],
- ["8233CD31",0x4675],
- ["8233CD32",0x4676],
- ["8233CD33",0x4677],
- ["8233CD34",0x4678],
- ["8233CD35",0x4679],
- ["8233CD36",0x467A],
- ["8233CD37",0x467B],
- ["8233CD38",0x467C],
- ["8233CD39",0x467D],
- ["8233CE30",0x467E],
- ["8233CE31",0x467F],
- ["8233CE32",0x4680],
- ["8233CE33",0x4681],
- ["8233CE34",0x4682],
- ["8233CE35",0x4683],
- ["8233CE36",0x4684],
- ["8233CE37",0x4685],
- ["8233CE38",0x4686],
- ["8233CE39",0x4687],
- ["8233CF30",0x4688],
- ["8233CF31",0x4689],
- ["8233CF32",0x468A],
- ["8233CF33",0x468B],
- ["8233CF34",0x468C],
- ["8233CF35",0x468D],
- ["8233CF36",0x468E],
- ["8233CF37",0x468F],
- ["8233CF38",0x4690],
- ["8233CF39",0x4691],
- ["8233D030",0x4692],
- ["8233D031",0x4693],
- ["8233D032",0x4694],
- ["8233D033",0x4695],
- ["8233D034",0x4696],
- ["8233D035",0x4697],
- ["8233D036",0x4698],
- ["8233D037",0x4699],
- ["8233D038",0x469A],
- ["8233D039",0x469B],
- ["8233D130",0x469C],
- ["8233D131",0x469D],
- ["8233D132",0x469E],
- ["8233D133",0x469F],
- ["8233D134",0x46A0],
- ["8233D135",0x46A1],
- ["8233D136",0x46A2],
- ["8233D137",0x46A3],
- ["8233D138",0x46A4],
- ["8233D139",0x46A5],
- ["8233D230",0x46A6],
- ["8233D231",0x46A7],
- ["8233D232",0x46A8],
- ["8233D233",0x46A9],
- ["8233D234",0x46AA],
- ["8233D235",0x46AB],
- ["8233D236",0x46AC],
- ["8233D237",0x46AD],
- ["8233D238",0x46AE],
- ["8233D239",0x46AF],
- ["8233D330",0x46B0],
- ["8233D331",0x46B1],
- ["8233D332",0x46B2],
- ["8233D333",0x46B3],
- ["8233D334",0x46B4],
- ["8233D335",0x46B5],
- ["8233D336",0x46B6],
- ["8233D337",0x46B7],
- ["8233D338",0x46B8],
- ["8233D339",0x46B9],
- ["8233D430",0x46BA],
- ["8233D431",0x46BB],
- ["8233D432",0x46BC],
- ["8233D433",0x46BD],
- ["8233D434",0x46BE],
- ["8233D435",0x46BF],
- ["8233D436",0x46C0],
- ["8233D437",0x46C1],
- ["8233D438",0x46C2],
- ["8233D439",0x46C3],
- ["8233D530",0x46C4],
- ["8233D531",0x46C5],
- ["8233D532",0x46C6],
- ["8233D533",0x46C7],
- ["8233D534",0x46C8],
- ["8233D535",0x46C9],
- ["8233D536",0x46CA],
- ["8233D537",0x46CB],
- ["8233D538",0x46CC],
- ["8233D539",0x46CD],
- ["8233D630",0x46CE],
- ["8233D631",0x46CF],
- ["8233D632",0x46D0],
- ["8233D633",0x46D1],
- ["8233D634",0x46D2],
- ["8233D635",0x46D3],
- ["8233D636",0x46D4],
- ["8233D637",0x46D5],
- ["8233D638",0x46D6],
- ["8233D639",0x46D7],
- ["8233D730",0x46D8],
- ["8233D731",0x46D9],
- ["8233D732",0x46DA],
- ["8233D733",0x46DB],
- ["8233D734",0x46DC],
- ["8233D735",0x46DD],
- ["8233D736",0x46DE],
- ["8233D737",0x46DF],
- ["8233D738",0x46E0],
- ["8233D739",0x46E1],
- ["8233D830",0x46E2],
- ["8233D831",0x46E3],
- ["8233D832",0x46E4],
- ["8233D833",0x46E5],
- ["8233D834",0x46E6],
- ["8233D835",0x46E7],
- ["8233D836",0x46E8],
- ["8233D837",0x46E9],
- ["8233D838",0x46EA],
- ["8233D839",0x46EB],
- ["8233D930",0x46EC],
- ["8233D931",0x46ED],
- ["8233D932",0x46EE],
- ["8233D933",0x46EF],
- ["8233D934",0x46F0],
- ["8233D935",0x46F1],
- ["8233D936",0x46F2],
- ["8233D937",0x46F3],
- ["8233D938",0x46F4],
- ["8233D939",0x46F5],
- ["8233DA30",0x46F6],
- ["8233DA31",0x46F7],
- ["8233DA32",0x46F8],
- ["8233DA33",0x46F9],
- ["8233DA34",0x46FA],
- ["8233DA35",0x46FB],
- ["8233DA36",0x46FC],
- ["8233DA37",0x46FD],
- ["8233DA38",0x46FE],
- ["8233DA39",0x46FF],
- ["8233DB30",0x4700],
- ["8233DB31",0x4701],
- ["8233DB32",0x4702],
- ["8233DB33",0x4703],
- ["8233DB34",0x4704],
- ["8233DB35",0x4705],
- ["8233DB36",0x4706],
- ["8233DB37",0x4707],
- ["8233DB38",0x4708],
- ["8233DB39",0x4709],
- ["8233DC30",0x470A],
- ["8233DC31",0x470B],
- ["8233DC32",0x470C],
- ["8233DC33",0x470D],
- ["8233DC34",0x470E],
- ["8233DC35",0x470F],
- ["8233DC36",0x4710],
- ["8233DC37",0x4711],
- ["8233DC38",0x4712],
- ["8233DC39",0x4713],
- ["8233DD30",0x4714],
- ["8233DD31",0x4715],
- ["8233DD32",0x4716],
- ["8233DD33",0x4717],
- ["8233DD34",0x4718],
- ["8233DD35",0x4719],
- ["8233DD36",0x471A],
- ["8233DD37",0x471B],
- ["8233DD38",0x471C],
- ["8233DD39",0x471D],
- ["8233DE30",0x471E],
- ["8233DE31",0x471F],
- ["8233DE32",0x4720],
- ["8233DE33",0x4721],
- ["8233DE34",0x4722],
- ["FE80",0x4723],
- ["8233DE35",0x4724],
- ["8233DE36",0x4725],
- ["8233DE37",0x4726],
- ["8233DE38",0x4727],
- ["8233DE39",0x4728],
- ["FE81",0x4729],
- ["8233DF30",0x472A],
- ["8233DF31",0x472B],
- ["8233DF32",0x472C],
- ["8233DF33",0x472D],
- ["8233DF34",0x472E],
- ["8233DF35",0x472F],
- ["8233DF36",0x4730],
- ["8233DF37",0x4731],
- ["8233DF38",0x4732],
- ["8233DF39",0x4733],
- ["8233E030",0x4734],
- ["8233E031",0x4735],
- ["8233E032",0x4736],
- ["8233E033",0x4737],
- ["8233E034",0x4738],
- ["8233E035",0x4739],
- ["8233E036",0x473A],
- ["8233E037",0x473B],
- ["8233E038",0x473C],
- ["8233E039",0x473D],
- ["8233E130",0x473E],
- ["8233E131",0x473F],
- ["8233E132",0x4740],
- ["8233E133",0x4741],
- ["8233E134",0x4742],
- ["8233E135",0x4743],
- ["8233E136",0x4744],
- ["8233E137",0x4745],
- ["8233E138",0x4746],
- ["8233E139",0x4747],
- ["8233E230",0x4748],
- ["8233E231",0x4749],
- ["8233E232",0x474A],
- ["8233E233",0x474B],
- ["8233E234",0x474C],
- ["8233E235",0x474D],
- ["8233E236",0x474E],
- ["8233E237",0x474F],
- ["8233E238",0x4750],
- ["8233E239",0x4751],
- ["8233E330",0x4752],
- ["8233E331",0x4753],
- ["8233E332",0x4754],
- ["8233E333",0x4755],
- ["8233E334",0x4756],
- ["8233E335",0x4757],
- ["8233E336",0x4758],
- ["8233E337",0x4759],
- ["8233E338",0x475A],
- ["8233E339",0x475B],
- ["8233E430",0x475C],
- ["8233E431",0x475D],
- ["8233E432",0x475E],
- ["8233E433",0x475F],
- ["8233E434",0x4760],
- ["8233E435",0x4761],
- ["8233E436",0x4762],
- ["8233E437",0x4763],
- ["8233E438",0x4764],
- ["8233E439",0x4765],
- ["8233E530",0x4766],
- ["8233E531",0x4767],
- ["8233E532",0x4768],
- ["8233E533",0x4769],
- ["8233E534",0x476A],
- ["8233E535",0x476B],
- ["8233E536",0x476C],
- ["8233E537",0x476D],
- ["8233E538",0x476E],
- ["8233E539",0x476F],
- ["8233E630",0x4770],
- ["8233E631",0x4771],
- ["8233E632",0x4772],
- ["8233E633",0x4773],
- ["8233E634",0x4774],
- ["8233E635",0x4775],
- ["8233E636",0x4776],
- ["8233E637",0x4777],
- ["8233E638",0x4778],
- ["8233E639",0x4779],
- ["8233E730",0x477A],
- ["8233E731",0x477B],
- ["FE82",0x477C],
- ["8233E732",0x477D],
- ["8233E733",0x477E],
- ["8233E734",0x477F],
- ["8233E735",0x4780],
- ["8233E736",0x4781],
- ["8233E737",0x4782],
- ["8233E738",0x4783],
- ["8233E739",0x4784],
- ["8233E830",0x4785],
- ["8233E831",0x4786],
- ["8233E832",0x4787],
- ["8233E833",0x4788],
- ["8233E834",0x4789],
- ["8233E835",0x478A],
- ["8233E836",0x478B],
- ["8233E837",0x478C],
- ["FE83",0x478D],
- ["8233E838",0x478E],
- ["8233E839",0x478F],
- ["8233E930",0x4790],
- ["8233E931",0x4791],
- ["8233E932",0x4792],
- ["8233E933",0x4793],
- ["8233E934",0x4794],
- ["8233E935",0x4795],
- ["8233E936",0x4796],
- ["8233E937",0x4797],
- ["8233E938",0x4798],
- ["8233E939",0x4799],
- ["8233EA30",0x479A],
- ["8233EA31",0x479B],
- ["8233EA32",0x479C],
- ["8233EA33",0x479D],
- ["8233EA34",0x479E],
- ["8233EA35",0x479F],
- ["8233EA36",0x47A0],
- ["8233EA37",0x47A1],
- ["8233EA38",0x47A2],
- ["8233EA39",0x47A3],
- ["8233EB30",0x47A4],
- ["8233EB31",0x47A5],
- ["8233EB32",0x47A6],
- ["8233EB33",0x47A7],
- ["8233EB34",0x47A8],
- ["8233EB35",0x47A9],
- ["8233EB36",0x47AA],
- ["8233EB37",0x47AB],
- ["8233EB38",0x47AC],
- ["8233EB39",0x47AD],
- ["8233EC30",0x47AE],
- ["8233EC31",0x47AF],
- ["8233EC32",0x47B0],
- ["8233EC33",0x47B1],
- ["8233EC34",0x47B2],
- ["8233EC35",0x47B3],
- ["8233EC36",0x47B4],
- ["8233EC37",0x47B5],
- ["8233EC38",0x47B6],
- ["8233EC39",0x47B7],
- ["8233ED30",0x47B8],
- ["8233ED31",0x47B9],
- ["8233ED32",0x47BA],
- ["8233ED33",0x47BB],
- ["8233ED34",0x47BC],
- ["8233ED35",0x47BD],
- ["8233ED36",0x47BE],
- ["8233ED37",0x47BF],
- ["8233ED38",0x47C0],
- ["8233ED39",0x47C1],
- ["8233EE30",0x47C2],
- ["8233EE31",0x47C3],
- ["8233EE32",0x47C4],
- ["8233EE33",0x47C5],
- ["8233EE34",0x47C6],
- ["8233EE35",0x47C7],
- ["8233EE36",0x47C8],
- ["8233EE37",0x47C9],
- ["8233EE38",0x47CA],
- ["8233EE39",0x47CB],
- ["8233EF30",0x47CC],
- ["8233EF31",0x47CD],
- ["8233EF32",0x47CE],
- ["8233EF33",0x47CF],
- ["8233EF34",0x47D0],
- ["8233EF35",0x47D1],
- ["8233EF36",0x47D2],
- ["8233EF37",0x47D3],
- ["8233EF38",0x47D4],
- ["8233EF39",0x47D5],
- ["8233F030",0x47D6],
- ["8233F031",0x47D7],
- ["8233F032",0x47D8],
- ["8233F033",0x47D9],
- ["8233F034",0x47DA],
- ["8233F035",0x47DB],
- ["8233F036",0x47DC],
- ["8233F037",0x47DD],
- ["8233F038",0x47DE],
- ["8233F039",0x47DF],
- ["8233F130",0x47E0],
- ["8233F131",0x47E1],
- ["8233F132",0x47E2],
- ["8233F133",0x47E3],
- ["8233F134",0x47E4],
- ["8233F135",0x47E5],
- ["8233F136",0x47E6],
- ["8233F137",0x47E7],
- ["8233F138",0x47E8],
- ["8233F139",0x47E9],
- ["8233F230",0x47EA],
- ["8233F231",0x47EB],
- ["8233F232",0x47EC],
- ["8233F233",0x47ED],
- ["8233F234",0x47EE],
- ["8233F235",0x47EF],
- ["8233F236",0x47F0],
- ["8233F237",0x47F1],
- ["8233F238",0x47F2],
- ["8233F239",0x47F3],
- ["8233F330",0x47F4],
- ["8233F331",0x47F5],
- ["8233F332",0x47F6],
- ["8233F333",0x47F7],
- ["8233F334",0x47F8],
- ["8233F335",0x47F9],
- ["8233F336",0x47FA],
- ["8233F337",0x47FB],
- ["8233F338",0x47FC],
- ["8233F339",0x47FD],
- ["8233F430",0x47FE],
- ["8233F431",0x47FF],
- ["8233F432",0x4800],
- ["8233F433",0x4801],
- ["8233F434",0x4802],
- ["8233F435",0x4803],
- ["8233F436",0x4804],
- ["8233F437",0x4805],
- ["8233F438",0x4806],
- ["8233F439",0x4807],
- ["8233F530",0x4808],
- ["8233F531",0x4809],
- ["8233F532",0x480A],
- ["8233F533",0x480B],
- ["8233F534",0x480C],
- ["8233F535",0x480D],
- ["8233F536",0x480E],
- ["8233F537",0x480F],
- ["8233F538",0x4810],
- ["8233F539",0x4811],
- ["8233F630",0x4812],
- ["8233F631",0x4813],
- ["8233F632",0x4814],
- ["8233F633",0x4815],
- ["8233F634",0x4816],
- ["8233F635",0x4817],
- ["8233F636",0x4818],
- ["8233F637",0x4819],
- ["8233F638",0x481A],
- ["8233F639",0x481B],
- ["8233F730",0x481C],
- ["8233F731",0x481D],
- ["8233F732",0x481E],
- ["8233F733",0x481F],
- ["8233F734",0x4820],
- ["8233F735",0x4821],
- ["8233F736",0x4822],
- ["8233F737",0x4823],
- ["8233F738",0x4824],
- ["8233F739",0x4825],
- ["8233F830",0x4826],
- ["8233F831",0x4827],
- ["8233F832",0x4828],
- ["8233F833",0x4829],
- ["8233F834",0x482A],
- ["8233F835",0x482B],
- ["8233F836",0x482C],
- ["8233F837",0x482D],
- ["8233F838",0x482E],
- ["8233F839",0x482F],
- ["8233F930",0x4830],
- ["8233F931",0x4831],
- ["8233F932",0x4832],
- ["8233F933",0x4833],
- ["8233F934",0x4834],
- ["8233F935",0x4835],
- ["8233F936",0x4836],
- ["8233F937",0x4837],
- ["8233F938",0x4838],
- ["8233F939",0x4839],
- ["8233FA30",0x483A],
- ["8233FA31",0x483B],
- ["8233FA32",0x483C],
- ["8233FA33",0x483D],
- ["8233FA34",0x483E],
- ["8233FA35",0x483F],
- ["8233FA36",0x4840],
- ["8233FA37",0x4841],
- ["8233FA38",0x4842],
- ["8233FA39",0x4843],
- ["8233FB30",0x4844],
- ["8233FB31",0x4845],
- ["8233FB32",0x4846],
- ["8233FB33",0x4847],
- ["8233FB34",0x4848],
- ["8233FB35",0x4849],
- ["8233FB36",0x484A],
- ["8233FB37",0x484B],
- ["8233FB38",0x484C],
- ["8233FB39",0x484D],
- ["8233FC30",0x484E],
- ["8233FC31",0x484F],
- ["8233FC32",0x4850],
- ["8233FC33",0x4851],
- ["8233FC34",0x4852],
- ["8233FC35",0x4853],
- ["8233FC36",0x4854],
- ["8233FC37",0x4855],
- ["8233FC38",0x4856],
- ["8233FC39",0x4857],
- ["8233FD30",0x4858],
- ["8233FD31",0x4859],
- ["8233FD32",0x485A],
- ["8233FD33",0x485B],
- ["8233FD34",0x485C],
- ["8233FD35",0x485D],
- ["8233FD36",0x485E],
- ["8233FD37",0x485F],
- ["8233FD38",0x4860],
- ["8233FD39",0x4861],
- ["8233FE30",0x4862],
- ["8233FE31",0x4863],
- ["8233FE32",0x4864],
- ["8233FE33",0x4865],
- ["8233FE34",0x4866],
- ["8233FE35",0x4867],
- ["8233FE36",0x4868],
- ["8233FE37",0x4869],
- ["8233FE38",0x486A],
- ["8233FE39",0x486B],
- ["82348130",0x486C],
- ["82348131",0x486D],
- ["82348132",0x486E],
- ["82348133",0x486F],
- ["82348134",0x4870],
- ["82348135",0x4871],
- ["82348136",0x4872],
- ["82348137",0x4873],
- ["82348138",0x4874],
- ["82348139",0x4875],
- ["82348230",0x4876],
- ["82348231",0x4877],
- ["82348232",0x4878],
- ["82348233",0x4879],
- ["82348234",0x487A],
- ["82348235",0x487B],
- ["82348236",0x487C],
- ["82348237",0x487D],
- ["82348238",0x487E],
- ["82348239",0x487F],
- ["82348330",0x4880],
- ["82348331",0x4881],
- ["82348332",0x4882],
- ["82348333",0x4883],
- ["82348334",0x4884],
- ["82348335",0x4885],
- ["82348336",0x4886],
- ["82348337",0x4887],
- ["82348338",0x4888],
- ["82348339",0x4889],
- ["82348430",0x488A],
- ["82348431",0x488B],
- ["82348432",0x488C],
- ["82348433",0x488D],
- ["82348434",0x488E],
- ["82348435",0x488F],
- ["82348436",0x4890],
- ["82348437",0x4891],
- ["82348438",0x4892],
- ["82348439",0x4893],
- ["82348530",0x4894],
- ["82348531",0x4895],
- ["82348532",0x4896],
- ["82348533",0x4897],
- ["82348534",0x4898],
- ["82348535",0x4899],
- ["82348536",0x489A],
- ["82348537",0x489B],
- ["82348538",0x489C],
- ["82348539",0x489D],
- ["82348630",0x489E],
- ["82348631",0x489F],
- ["82348632",0x48A0],
- ["82348633",0x48A1],
- ["82348634",0x48A2],
- ["82348635",0x48A3],
- ["82348636",0x48A4],
- ["82348637",0x48A5],
- ["82348638",0x48A6],
- ["82348639",0x48A7],
- ["82348730",0x48A8],
- ["82348731",0x48A9],
- ["82348732",0x48AA],
- ["82348733",0x48AB],
- ["82348734",0x48AC],
- ["82348735",0x48AD],
- ["82348736",0x48AE],
- ["82348737",0x48AF],
- ["82348738",0x48B0],
- ["82348739",0x48B1],
- ["82348830",0x48B2],
- ["82348831",0x48B3],
- ["82348832",0x48B4],
- ["82348833",0x48B5],
- ["82348834",0x48B6],
- ["82348835",0x48B7],
- ["82348836",0x48B8],
- ["82348837",0x48B9],
- ["82348838",0x48BA],
- ["82348839",0x48BB],
- ["82348930",0x48BC],
- ["82348931",0x48BD],
- ["82348932",0x48BE],
- ["82348933",0x48BF],
- ["82348934",0x48C0],
- ["82348935",0x48C1],
- ["82348936",0x48C2],
- ["82348937",0x48C3],
- ["82348938",0x48C4],
- ["82348939",0x48C5],
- ["82348A30",0x48C6],
- ["82348A31",0x48C7],
- ["82348A32",0x48C8],
- ["82348A33",0x48C9],
- ["82348A34",0x48CA],
- ["82348A35",0x48CB],
- ["82348A36",0x48CC],
- ["82348A37",0x48CD],
- ["82348A38",0x48CE],
- ["82348A39",0x48CF],
- ["82348B30",0x48D0],
- ["82348B31",0x48D1],
- ["82348B32",0x48D2],
- ["82348B33",0x48D3],
- ["82348B34",0x48D4],
- ["82348B35",0x48D5],
- ["82348B36",0x48D6],
- ["82348B37",0x48D7],
- ["82348B38",0x48D8],
- ["82348B39",0x48D9],
- ["82348C30",0x48DA],
- ["82348C31",0x48DB],
- ["82348C32",0x48DC],
- ["82348C33",0x48DD],
- ["82348C34",0x48DE],
- ["82348C35",0x48DF],
- ["82348C36",0x48E0],
- ["82348C37",0x48E1],
- ["82348C38",0x48E2],
- ["82348C39",0x48E3],
- ["82348D30",0x48E4],
- ["82348D31",0x48E5],
- ["82348D32",0x48E6],
- ["82348D33",0x48E7],
- ["82348D34",0x48E8],
- ["82348D35",0x48E9],
- ["82348D36",0x48EA],
- ["82348D37",0x48EB],
- ["82348D38",0x48EC],
- ["82348D39",0x48ED],
- ["82348E30",0x48EE],
- ["82348E31",0x48EF],
- ["82348E32",0x48F0],
- ["82348E33",0x48F1],
- ["82348E34",0x48F2],
- ["82348E35",0x48F3],
- ["82348E36",0x48F4],
- ["82348E37",0x48F5],
- ["82348E38",0x48F6],
- ["82348E39",0x48F7],
- ["82348F30",0x48F8],
- ["82348F31",0x48F9],
- ["82348F32",0x48FA],
- ["82348F33",0x48FB],
- ["82348F34",0x48FC],
- ["82348F35",0x48FD],
- ["82348F36",0x48FE],
- ["82348F37",0x48FF],
- ["82348F38",0x4900],
- ["82348F39",0x4901],
- ["82349030",0x4902],
- ["82349031",0x4903],
- ["82349032",0x4904],
- ["82349033",0x4905],
- ["82349034",0x4906],
- ["82349035",0x4907],
- ["82349036",0x4908],
- ["82349037",0x4909],
- ["82349038",0x490A],
- ["82349039",0x490B],
- ["82349130",0x490C],
- ["82349131",0x490D],
- ["82349132",0x490E],
- ["82349133",0x490F],
- ["82349134",0x4910],
- ["82349135",0x4911],
- ["82349136",0x4912],
- ["82349137",0x4913],
- ["82349138",0x4914],
- ["82349139",0x4915],
- ["82349230",0x4916],
- ["82349231",0x4917],
- ["82349232",0x4918],
- ["82349233",0x4919],
- ["82349234",0x491A],
- ["82349235",0x491B],
- ["82349236",0x491C],
- ["82349237",0x491D],
- ["82349238",0x491E],
- ["82349239",0x491F],
- ["82349330",0x4920],
- ["82349331",0x4921],
- ["82349332",0x4922],
- ["82349333",0x4923],
- ["82349334",0x4924],
- ["82349335",0x4925],
- ["82349336",0x4926],
- ["82349337",0x4927],
- ["82349338",0x4928],
- ["82349339",0x4929],
- ["82349430",0x492A],
- ["82349431",0x492B],
- ["82349432",0x492C],
- ["82349433",0x492D],
- ["82349434",0x492E],
- ["82349435",0x492F],
- ["82349436",0x4930],
- ["82349437",0x4931],
- ["82349438",0x4932],
- ["82349439",0x4933],
- ["82349530",0x4934],
- ["82349531",0x4935],
- ["82349532",0x4936],
- ["82349533",0x4937],
- ["82349534",0x4938],
- ["82349535",0x4939],
- ["82349536",0x493A],
- ["82349537",0x493B],
- ["82349538",0x493C],
- ["82349539",0x493D],
- ["82349630",0x493E],
- ["82349631",0x493F],
- ["82349632",0x4940],
- ["82349633",0x4941],
- ["82349634",0x4942],
- ["82349635",0x4943],
- ["82349636",0x4944],
- ["82349637",0x4945],
- ["82349638",0x4946],
- ["FE85",0x4947],
- ["82349639",0x4948],
- ["82349730",0x4949],
- ["82349731",0x494A],
- ["82349732",0x494B],
- ["82349733",0x494C],
- ["82349734",0x494D],
- ["82349735",0x494E],
- ["82349736",0x494F],
- ["82349737",0x4950],
- ["82349738",0x4951],
- ["82349739",0x4952],
- ["82349830",0x4953],
- ["82349831",0x4954],
- ["82349832",0x4955],
- ["82349833",0x4956],
- ["82349834",0x4957],
- ["82349835",0x4958],
- ["82349836",0x4959],
- ["82349837",0x495A],
- ["82349838",0x495B],
- ["82349839",0x495C],
- ["82349930",0x495D],
- ["82349931",0x495E],
- ["82349932",0x495F],
- ["82349933",0x4960],
- ["82349934",0x4961],
- ["82349935",0x4962],
- ["82349936",0x4963],
- ["82349937",0x4964],
- ["82349938",0x4965],
- ["82349939",0x4966],
- ["82349A30",0x4967],
- ["82349A31",0x4968],
- ["82349A32",0x4969],
- ["82349A33",0x496A],
- ["82349A34",0x496B],
- ["82349A35",0x496C],
- ["82349A36",0x496D],
- ["82349A37",0x496E],
- ["82349A38",0x496F],
- ["82349A39",0x4970],
- ["82349B30",0x4971],
- ["82349B31",0x4972],
- ["82349B32",0x4973],
- ["82349B33",0x4974],
- ["82349B34",0x4975],
- ["82349B35",0x4976],
- ["82349B36",0x4977],
- ["82349B37",0x4978],
- ["82349B38",0x4979],
- ["FE86",0x497A],
- ["82349B39",0x497B],
- ["82349C30",0x497C],
- ["FE87",0x497D],
- ["82349C31",0x497E],
- ["82349C32",0x497F],
- ["82349C33",0x4980],
- ["82349C34",0x4981],
- ["FE88",0x4982],
- ["FE89",0x4983],
- ["82349C35",0x4984],
- ["FE8A",0x4985],
- ["FE8B",0x4986],
- ["82349C36",0x4987],
- ["82349C37",0x4988],
- ["82349C38",0x4989],
- ["82349C39",0x498A],
- ["82349D30",0x498B],
- ["82349D31",0x498C],
- ["82349D32",0x498D],
- ["82349D33",0x498E],
- ["82349D34",0x498F],
- ["82349D35",0x4990],
- ["82349D36",0x4991],
- ["82349D37",0x4992],
- ["82349D38",0x4993],
- ["82349D39",0x4994],
- ["82349E30",0x4995],
- ["82349E31",0x4996],
- ["82349E32",0x4997],
- ["82349E33",0x4998],
- ["82349E34",0x4999],
- ["82349E35",0x499A],
- ["FE8D",0x499B],
- ["82349E36",0x499C],
- ["82349E37",0x499D],
- ["82349E38",0x499E],
- ["FE8C",0x499F],
- ["82349E39",0x49A0],
- ["82349F30",0x49A1],
- ["82349F31",0x49A2],
- ["82349F32",0x49A3],
- ["82349F33",0x49A4],
- ["82349F34",0x49A5],
- ["82349F35",0x49A6],
- ["82349F36",0x49A7],
- ["82349F37",0x49A8],
- ["82349F38",0x49A9],
- ["82349F39",0x49AA],
- ["8234A030",0x49AB],
- ["8234A031",0x49AC],
- ["8234A032",0x49AD],
- ["8234A033",0x49AE],
- ["8234A034",0x49AF],
- ["8234A035",0x49B0],
- ["8234A036",0x49B1],
- ["8234A037",0x49B2],
- ["8234A038",0x49B3],
- ["8234A039",0x49B4],
- ["8234A130",0x49B5],
- ["FE8F",0x49B6],
- ["FE8E",0x49B7],
- ["8234A131",0x49B8],
- ["8234A132",0x49B9],
- ["8234A133",0x49BA],
- ["8234A134",0x49BB],
- ["8234A135",0x49BC],
- ["8234A136",0x49BD],
- ["8234A137",0x49BE],
- ["8234A138",0x49BF],
- ["8234A139",0x49C0],
- ["8234A230",0x49C1],
- ["8234A231",0x49C2],
- ["8234A232",0x49C3],
- ["8234A233",0x49C4],
- ["8234A234",0x49C5],
- ["8234A235",0x49C6],
- ["8234A236",0x49C7],
- ["8234A237",0x49C8],
- ["8234A238",0x49C9],
- ["8234A239",0x49CA],
- ["8234A330",0x49CB],
- ["8234A331",0x49CC],
- ["8234A332",0x49CD],
- ["8234A333",0x49CE],
- ["8234A334",0x49CF],
- ["8234A335",0x49D0],
- ["8234A336",0x49D1],
- ["8234A337",0x49D2],
- ["8234A338",0x49D3],
- ["8234A339",0x49D4],
- ["8234A430",0x49D5],
- ["8234A431",0x49D6],
- ["8234A432",0x49D7],
- ["8234A433",0x49D8],
- ["8234A434",0x49D9],
- ["8234A435",0x49DA],
- ["8234A436",0x49DB],
- ["8234A437",0x49DC],
- ["8234A438",0x49DD],
- ["8234A439",0x49DE],
- ["8234A530",0x49DF],
- ["8234A531",0x49E0],
- ["8234A532",0x49E1],
- ["8234A533",0x49E2],
- ["8234A534",0x49E3],
- ["8234A535",0x49E4],
- ["8234A536",0x49E5],
- ["8234A537",0x49E6],
- ["8234A538",0x49E7],
- ["8234A539",0x49E8],
- ["8234A630",0x49E9],
- ["8234A631",0x49EA],
- ["8234A632",0x49EB],
- ["8234A633",0x49EC],
- ["8234A634",0x49ED],
- ["8234A635",0x49EE],
- ["8234A636",0x49EF],
- ["8234A637",0x49F0],
- ["8234A638",0x49F1],
- ["8234A639",0x49F2],
- ["8234A730",0x49F3],
- ["8234A731",0x49F4],
- ["8234A732",0x49F5],
- ["8234A733",0x49F6],
- ["8234A734",0x49F7],
- ["8234A735",0x49F8],
- ["8234A736",0x49F9],
- ["8234A737",0x49FA],
- ["8234A738",0x49FB],
- ["8234A739",0x49FC],
- ["8234A830",0x49FD],
- ["8234A831",0x49FE],
- ["8234A832",0x49FF],
- ["8234A833",0x4A00],
- ["8234A834",0x4A01],
- ["8234A835",0x4A02],
- ["8234A836",0x4A03],
- ["8234A837",0x4A04],
- ["8234A838",0x4A05],
- ["8234A839",0x4A06],
- ["8234A930",0x4A07],
- ["8234A931",0x4A08],
- ["8234A932",0x4A09],
- ["8234A933",0x4A0A],
- ["8234A934",0x4A0B],
- ["8234A935",0x4A0C],
- ["8234A936",0x4A0D],
- ["8234A937",0x4A0E],
- ["8234A938",0x4A0F],
- ["8234A939",0x4A10],
- ["8234AA30",0x4A11],
- ["8234AA31",0x4A12],
- ["8234AA32",0x4A13],
- ["8234AA33",0x4A14],
- ["8234AA34",0x4A15],
- ["8234AA35",0x4A16],
- ["8234AA36",0x4A17],
- ["8234AA37",0x4A18],
- ["8234AA38",0x4A19],
- ["8234AA39",0x4A1A],
- ["8234AB30",0x4A1B],
- ["8234AB31",0x4A1C],
- ["8234AB32",0x4A1D],
- ["8234AB33",0x4A1E],
- ["8234AB34",0x4A1F],
- ["8234AB35",0x4A20],
- ["8234AB36",0x4A21],
- ["8234AB37",0x4A22],
- ["8234AB38",0x4A23],
- ["8234AB39",0x4A24],
- ["8234AC30",0x4A25],
- ["8234AC31",0x4A26],
- ["8234AC32",0x4A27],
- ["8234AC33",0x4A28],
- ["8234AC34",0x4A29],
- ["8234AC35",0x4A2A],
- ["8234AC36",0x4A2B],
- ["8234AC37",0x4A2C],
- ["8234AC38",0x4A2D],
- ["8234AC39",0x4A2E],
- ["8234AD30",0x4A2F],
- ["8234AD31",0x4A30],
- ["8234AD32",0x4A31],
- ["8234AD33",0x4A32],
- ["8234AD34",0x4A33],
- ["8234AD35",0x4A34],
- ["8234AD36",0x4A35],
- ["8234AD37",0x4A36],
- ["8234AD38",0x4A37],
- ["8234AD39",0x4A38],
- ["8234AE30",0x4A39],
- ["8234AE31",0x4A3A],
- ["8234AE32",0x4A3B],
- ["8234AE33",0x4A3C],
- ["8234AE34",0x4A3D],
- ["8234AE35",0x4A3E],
- ["8234AE36",0x4A3F],
- ["8234AE37",0x4A40],
- ["8234AE38",0x4A41],
- ["8234AE39",0x4A42],
- ["8234AF30",0x4A43],
- ["8234AF31",0x4A44],
- ["8234AF32",0x4A45],
- ["8234AF33",0x4A46],
- ["8234AF34",0x4A47],
- ["8234AF35",0x4A48],
- ["8234AF36",0x4A49],
- ["8234AF37",0x4A4A],
- ["8234AF38",0x4A4B],
- ["8234AF39",0x4A4C],
- ["8234B030",0x4A4D],
- ["8234B031",0x4A4E],
- ["8234B032",0x4A4F],
- ["8234B033",0x4A50],
- ["8234B034",0x4A51],
- ["8234B035",0x4A52],
- ["8234B036",0x4A53],
- ["8234B037",0x4A54],
- ["8234B038",0x4A55],
- ["8234B039",0x4A56],
- ["8234B130",0x4A57],
- ["8234B131",0x4A58],
- ["8234B132",0x4A59],
- ["8234B133",0x4A5A],
- ["8234B134",0x4A5B],
- ["8234B135",0x4A5C],
- ["8234B136",0x4A5D],
- ["8234B137",0x4A5E],
- ["8234B138",0x4A5F],
- ["8234B139",0x4A60],
- ["8234B230",0x4A61],
- ["8234B231",0x4A62],
- ["8234B232",0x4A63],
- ["8234B233",0x4A64],
- ["8234B234",0x4A65],
- ["8234B235",0x4A66],
- ["8234B236",0x4A67],
- ["8234B237",0x4A68],
- ["8234B238",0x4A69],
- ["8234B239",0x4A6A],
- ["8234B330",0x4A6B],
- ["8234B331",0x4A6C],
- ["8234B332",0x4A6D],
- ["8234B333",0x4A6E],
- ["8234B334",0x4A6F],
- ["8234B335",0x4A70],
- ["8234B336",0x4A71],
- ["8234B337",0x4A72],
- ["8234B338",0x4A73],
- ["8234B339",0x4A74],
- ["8234B430",0x4A75],
- ["8234B431",0x4A76],
- ["8234B432",0x4A77],
- ["8234B433",0x4A78],
- ["8234B434",0x4A79],
- ["8234B435",0x4A7A],
- ["8234B436",0x4A7B],
- ["8234B437",0x4A7C],
- ["8234B438",0x4A7D],
- ["8234B439",0x4A7E],
- ["8234B530",0x4A7F],
- ["8234B531",0x4A80],
- ["8234B532",0x4A81],
- ["8234B533",0x4A82],
- ["8234B534",0x4A83],
- ["8234B535",0x4A84],
- ["8234B536",0x4A85],
- ["8234B537",0x4A86],
- ["8234B538",0x4A87],
- ["8234B539",0x4A88],
- ["8234B630",0x4A89],
- ["8234B631",0x4A8A],
- ["8234B632",0x4A8B],
- ["8234B633",0x4A8C],
- ["8234B634",0x4A8D],
- ["8234B635",0x4A8E],
- ["8234B636",0x4A8F],
- ["8234B637",0x4A90],
- ["8234B638",0x4A91],
- ["8234B639",0x4A92],
- ["8234B730",0x4A93],
- ["8234B731",0x4A94],
- ["8234B732",0x4A95],
- ["8234B733",0x4A96],
- ["8234B734",0x4A97],
- ["8234B735",0x4A98],
- ["8234B736",0x4A99],
- ["8234B737",0x4A9A],
- ["8234B738",0x4A9B],
- ["8234B739",0x4A9C],
- ["8234B830",0x4A9D],
- ["8234B831",0x4A9E],
- ["8234B832",0x4A9F],
- ["8234B833",0x4AA0],
- ["8234B834",0x4AA1],
- ["8234B835",0x4AA2],
- ["8234B836",0x4AA3],
- ["8234B837",0x4AA4],
- ["8234B838",0x4AA5],
- ["8234B839",0x4AA6],
- ["8234B930",0x4AA7],
- ["8234B931",0x4AA8],
- ["8234B932",0x4AA9],
- ["8234B933",0x4AAA],
- ["8234B934",0x4AAB],
- ["8234B935",0x4AAC],
- ["8234B936",0x4AAD],
- ["8234B937",0x4AAE],
- ["8234B938",0x4AAF],
- ["8234B939",0x4AB0],
- ["8234BA30",0x4AB1],
- ["8234BA31",0x4AB2],
- ["8234BA32",0x4AB3],
- ["8234BA33",0x4AB4],
- ["8234BA34",0x4AB5],
- ["8234BA35",0x4AB6],
- ["8234BA36",0x4AB7],
- ["8234BA37",0x4AB8],
- ["8234BA38",0x4AB9],
- ["8234BA39",0x4ABA],
- ["8234BB30",0x4ABB],
- ["8234BB31",0x4ABC],
- ["8234BB32",0x4ABD],
- ["8234BB33",0x4ABE],
- ["8234BB34",0x4ABF],
- ["8234BB35",0x4AC0],
- ["8234BB36",0x4AC1],
- ["8234BB37",0x4AC2],
- ["8234BB38",0x4AC3],
- ["8234BB39",0x4AC4],
- ["8234BC30",0x4AC5],
- ["8234BC31",0x4AC6],
- ["8234BC32",0x4AC7],
- ["8234BC33",0x4AC8],
- ["8234BC34",0x4AC9],
- ["8234BC35",0x4ACA],
- ["8234BC36",0x4ACB],
- ["8234BC37",0x4ACC],
- ["8234BC38",0x4ACD],
- ["8234BC39",0x4ACE],
- ["8234BD30",0x4ACF],
- ["8234BD31",0x4AD0],
- ["8234BD32",0x4AD1],
- ["8234BD33",0x4AD2],
- ["8234BD34",0x4AD3],
- ["8234BD35",0x4AD4],
- ["8234BD36",0x4AD5],
- ["8234BD37",0x4AD6],
- ["8234BD38",0x4AD7],
- ["8234BD39",0x4AD8],
- ["8234BE30",0x4AD9],
- ["8234BE31",0x4ADA],
- ["8234BE32",0x4ADB],
- ["8234BE33",0x4ADC],
- ["8234BE34",0x4ADD],
- ["8234BE35",0x4ADE],
- ["8234BE36",0x4ADF],
- ["8234BE37",0x4AE0],
- ["8234BE38",0x4AE1],
- ["8234BE39",0x4AE2],
- ["8234BF30",0x4AE3],
- ["8234BF31",0x4AE4],
- ["8234BF32",0x4AE5],
- ["8234BF33",0x4AE6],
- ["8234BF34",0x4AE7],
- ["8234BF35",0x4AE8],
- ["8234BF36",0x4AE9],
- ["8234BF37",0x4AEA],
- ["8234BF38",0x4AEB],
- ["8234BF39",0x4AEC],
- ["8234C030",0x4AED],
- ["8234C031",0x4AEE],
- ["8234C032",0x4AEF],
- ["8234C033",0x4AF0],
- ["8234C034",0x4AF1],
- ["8234C035",0x4AF2],
- ["8234C036",0x4AF3],
- ["8234C037",0x4AF4],
- ["8234C038",0x4AF5],
- ["8234C039",0x4AF6],
- ["8234C130",0x4AF7],
- ["8234C131",0x4AF8],
- ["8234C132",0x4AF9],
- ["8234C133",0x4AFA],
- ["8234C134",0x4AFB],
- ["8234C135",0x4AFC],
- ["8234C136",0x4AFD],
- ["8234C137",0x4AFE],
- ["8234C138",0x4AFF],
- ["8234C139",0x4B00],
- ["8234C230",0x4B01],
- ["8234C231",0x4B02],
- ["8234C232",0x4B03],
- ["8234C233",0x4B04],
- ["8234C234",0x4B05],
- ["8234C235",0x4B06],
- ["8234C236",0x4B07],
- ["8234C237",0x4B08],
- ["8234C238",0x4B09],
- ["8234C239",0x4B0A],
- ["8234C330",0x4B0B],
- ["8234C331",0x4B0C],
- ["8234C332",0x4B0D],
- ["8234C333",0x4B0E],
- ["8234C334",0x4B0F],
- ["8234C335",0x4B10],
- ["8234C336",0x4B11],
- ["8234C337",0x4B12],
- ["8234C338",0x4B13],
- ["8234C339",0x4B14],
- ["8234C430",0x4B15],
- ["8234C431",0x4B16],
- ["8234C432",0x4B17],
- ["8234C433",0x4B18],
- ["8234C434",0x4B19],
- ["8234C435",0x4B1A],
- ["8234C436",0x4B1B],
- ["8234C437",0x4B1C],
- ["8234C438",0x4B1D],
- ["8234C439",0x4B1E],
- ["8234C530",0x4B1F],
- ["8234C531",0x4B20],
- ["8234C532",0x4B21],
- ["8234C533",0x4B22],
- ["8234C534",0x4B23],
- ["8234C535",0x4B24],
- ["8234C536",0x4B25],
- ["8234C537",0x4B26],
- ["8234C538",0x4B27],
- ["8234C539",0x4B28],
- ["8234C630",0x4B29],
- ["8234C631",0x4B2A],
- ["8234C632",0x4B2B],
- ["8234C633",0x4B2C],
- ["8234C634",0x4B2D],
- ["8234C635",0x4B2E],
- ["8234C636",0x4B2F],
- ["8234C637",0x4B30],
- ["8234C638",0x4B31],
- ["8234C639",0x4B32],
- ["8234C730",0x4B33],
- ["8234C731",0x4B34],
- ["8234C732",0x4B35],
- ["8234C733",0x4B36],
- ["8234C734",0x4B37],
- ["8234C735",0x4B38],
- ["8234C736",0x4B39],
- ["8234C737",0x4B3A],
- ["8234C738",0x4B3B],
- ["8234C739",0x4B3C],
- ["8234C830",0x4B3D],
- ["8234C831",0x4B3E],
- ["8234C832",0x4B3F],
- ["8234C833",0x4B40],
- ["8234C834",0x4B41],
- ["8234C835",0x4B42],
- ["8234C836",0x4B43],
- ["8234C837",0x4B44],
- ["8234C838",0x4B45],
- ["8234C839",0x4B46],
- ["8234C930",0x4B47],
- ["8234C931",0x4B48],
- ["8234C932",0x4B49],
- ["8234C933",0x4B4A],
- ["8234C934",0x4B4B],
- ["8234C935",0x4B4C],
- ["8234C936",0x4B4D],
- ["8234C937",0x4B4E],
- ["8234C938",0x4B4F],
- ["8234C939",0x4B50],
- ["8234CA30",0x4B51],
- ["8234CA31",0x4B52],
- ["8234CA32",0x4B53],
- ["8234CA33",0x4B54],
- ["8234CA34",0x4B55],
- ["8234CA35",0x4B56],
- ["8234CA36",0x4B57],
- ["8234CA37",0x4B58],
- ["8234CA38",0x4B59],
- ["8234CA39",0x4B5A],
- ["8234CB30",0x4B5B],
- ["8234CB31",0x4B5C],
- ["8234CB32",0x4B5D],
- ["8234CB33",0x4B5E],
- ["8234CB34",0x4B5F],
- ["8234CB35",0x4B60],
- ["8234CB36",0x4B61],
- ["8234CB37",0x4B62],
- ["8234CB38",0x4B63],
- ["8234CB39",0x4B64],
- ["8234CC30",0x4B65],
- ["8234CC31",0x4B66],
- ["8234CC32",0x4B67],
- ["8234CC33",0x4B68],
- ["8234CC34",0x4B69],
- ["8234CC35",0x4B6A],
- ["8234CC36",0x4B6B],
- ["8234CC37",0x4B6C],
- ["8234CC38",0x4B6D],
- ["8234CC39",0x4B6E],
- ["8234CD30",0x4B6F],
- ["8234CD31",0x4B70],
- ["8234CD32",0x4B71],
- ["8234CD33",0x4B72],
- ["8234CD34",0x4B73],
- ["8234CD35",0x4B74],
- ["8234CD36",0x4B75],
- ["8234CD37",0x4B76],
- ["8234CD38",0x4B77],
- ["8234CD39",0x4B78],
- ["8234CE30",0x4B79],
- ["8234CE31",0x4B7A],
- ["8234CE32",0x4B7B],
- ["8234CE33",0x4B7C],
- ["8234CE34",0x4B7D],
- ["8234CE35",0x4B7E],
- ["8234CE36",0x4B7F],
- ["8234CE37",0x4B80],
- ["8234CE38",0x4B81],
- ["8234CE39",0x4B82],
- ["8234CF30",0x4B83],
- ["8234CF31",0x4B84],
- ["8234CF32",0x4B85],
- ["8234CF33",0x4B86],
- ["8234CF34",0x4B87],
- ["8234CF35",0x4B88],
- ["8234CF36",0x4B89],
- ["8234CF37",0x4B8A],
- ["8234CF38",0x4B8B],
- ["8234CF39",0x4B8C],
- ["8234D030",0x4B8D],
- ["8234D031",0x4B8E],
- ["8234D032",0x4B8F],
- ["8234D033",0x4B90],
- ["8234D034",0x4B91],
- ["8234D035",0x4B92],
- ["8234D036",0x4B93],
- ["8234D037",0x4B94],
- ["8234D038",0x4B95],
- ["8234D039",0x4B96],
- ["8234D130",0x4B97],
- ["8234D131",0x4B98],
- ["8234D132",0x4B99],
- ["8234D133",0x4B9A],
- ["8234D134",0x4B9B],
- ["8234D135",0x4B9C],
- ["8234D136",0x4B9D],
- ["8234D137",0x4B9E],
- ["8234D138",0x4B9F],
- ["8234D139",0x4BA0],
- ["8234D230",0x4BA1],
- ["8234D231",0x4BA2],
- ["8234D232",0x4BA3],
- ["8234D233",0x4BA4],
- ["8234D234",0x4BA5],
- ["8234D235",0x4BA6],
- ["8234D236",0x4BA7],
- ["8234D237",0x4BA8],
- ["8234D238",0x4BA9],
- ["8234D239",0x4BAA],
- ["8234D330",0x4BAB],
- ["8234D331",0x4BAC],
- ["8234D332",0x4BAD],
- ["8234D333",0x4BAE],
- ["8234D334",0x4BAF],
- ["8234D335",0x4BB0],
- ["8234D336",0x4BB1],
- ["8234D337",0x4BB2],
- ["8234D338",0x4BB3],
- ["8234D339",0x4BB4],
- ["8234D430",0x4BB5],
- ["8234D431",0x4BB6],
- ["8234D432",0x4BB7],
- ["8234D433",0x4BB8],
- ["8234D434",0x4BB9],
- ["8234D435",0x4BBA],
- ["8234D436",0x4BBB],
- ["8234D437",0x4BBC],
- ["8234D438",0x4BBD],
- ["8234D439",0x4BBE],
- ["8234D530",0x4BBF],
- ["8234D531",0x4BC0],
- ["8234D532",0x4BC1],
- ["8234D533",0x4BC2],
- ["8234D534",0x4BC3],
- ["8234D535",0x4BC4],
- ["8234D536",0x4BC5],
- ["8234D537",0x4BC6],
- ["8234D538",0x4BC7],
- ["8234D539",0x4BC8],
- ["8234D630",0x4BC9],
- ["8234D631",0x4BCA],
- ["8234D632",0x4BCB],
- ["8234D633",0x4BCC],
- ["8234D634",0x4BCD],
- ["8234D635",0x4BCE],
- ["8234D636",0x4BCF],
- ["8234D637",0x4BD0],
- ["8234D638",0x4BD1],
- ["8234D639",0x4BD2],
- ["8234D730",0x4BD3],
- ["8234D731",0x4BD4],
- ["8234D732",0x4BD5],
- ["8234D733",0x4BD6],
- ["8234D734",0x4BD7],
- ["8234D735",0x4BD8],
- ["8234D736",0x4BD9],
- ["8234D737",0x4BDA],
- ["8234D738",0x4BDB],
- ["8234D739",0x4BDC],
- ["8234D830",0x4BDD],
- ["8234D831",0x4BDE],
- ["8234D832",0x4BDF],
- ["8234D833",0x4BE0],
- ["8234D834",0x4BE1],
- ["8234D835",0x4BE2],
- ["8234D836",0x4BE3],
- ["8234D837",0x4BE4],
- ["8234D838",0x4BE5],
- ["8234D839",0x4BE6],
- ["8234D930",0x4BE7],
- ["8234D931",0x4BE8],
- ["8234D932",0x4BE9],
- ["8234D933",0x4BEA],
- ["8234D934",0x4BEB],
- ["8234D935",0x4BEC],
- ["8234D936",0x4BED],
- ["8234D937",0x4BEE],
- ["8234D938",0x4BEF],
- ["8234D939",0x4BF0],
- ["8234DA30",0x4BF1],
- ["8234DA31",0x4BF2],
- ["8234DA32",0x4BF3],
- ["8234DA33",0x4BF4],
- ["8234DA34",0x4BF5],
- ["8234DA35",0x4BF6],
- ["8234DA36",0x4BF7],
- ["8234DA37",0x4BF8],
- ["8234DA38",0x4BF9],
- ["8234DA39",0x4BFA],
- ["8234DB30",0x4BFB],
- ["8234DB31",0x4BFC],
- ["8234DB32",0x4BFD],
- ["8234DB33",0x4BFE],
- ["8234DB34",0x4BFF],
- ["8234DB35",0x4C00],
- ["8234DB36",0x4C01],
- ["8234DB37",0x4C02],
- ["8234DB38",0x4C03],
- ["8234DB39",0x4C04],
- ["8234DC30",0x4C05],
- ["8234DC31",0x4C06],
- ["8234DC32",0x4C07],
- ["8234DC33",0x4C08],
- ["8234DC34",0x4C09],
- ["8234DC35",0x4C0A],
- ["8234DC36",0x4C0B],
- ["8234DC37",0x4C0C],
- ["8234DC38",0x4C0D],
- ["8234DC39",0x4C0E],
- ["8234DD30",0x4C0F],
- ["8234DD31",0x4C10],
- ["8234DD32",0x4C11],
- ["8234DD33",0x4C12],
- ["8234DD34",0x4C13],
- ["8234DD35",0x4C14],
- ["8234DD36",0x4C15],
- ["8234DD37",0x4C16],
- ["8234DD38",0x4C17],
- ["8234DD39",0x4C18],
- ["8234DE30",0x4C19],
- ["8234DE31",0x4C1A],
- ["8234DE32",0x4C1B],
- ["8234DE33",0x4C1C],
- ["8234DE34",0x4C1D],
- ["8234DE35",0x4C1E],
- ["8234DE36",0x4C1F],
- ["8234DE37",0x4C20],
- ["8234DE38",0x4C21],
- ["8234DE39",0x4C22],
- ["8234DF30",0x4C23],
- ["8234DF31",0x4C24],
- ["8234DF32",0x4C25],
- ["8234DF33",0x4C26],
- ["8234DF34",0x4C27],
- ["8234DF35",0x4C28],
- ["8234DF36",0x4C29],
- ["8234DF37",0x4C2A],
- ["8234DF38",0x4C2B],
- ["8234DF39",0x4C2C],
- ["8234E030",0x4C2D],
- ["8234E031",0x4C2E],
- ["8234E032",0x4C2F],
- ["8234E033",0x4C30],
- ["8234E034",0x4C31],
- ["8234E035",0x4C32],
- ["8234E036",0x4C33],
- ["8234E037",0x4C34],
- ["8234E038",0x4C35],
- ["8234E039",0x4C36],
- ["8234E130",0x4C37],
- ["8234E131",0x4C38],
- ["8234E132",0x4C39],
- ["8234E133",0x4C3A],
- ["8234E134",0x4C3B],
- ["8234E135",0x4C3C],
- ["8234E136",0x4C3D],
- ["8234E137",0x4C3E],
- ["8234E138",0x4C3F],
- ["8234E139",0x4C40],
- ["8234E230",0x4C41],
- ["8234E231",0x4C42],
- ["8234E232",0x4C43],
- ["8234E233",0x4C44],
- ["8234E234",0x4C45],
- ["8234E235",0x4C46],
- ["8234E236",0x4C47],
- ["8234E237",0x4C48],
- ["8234E238",0x4C49],
- ["8234E239",0x4C4A],
- ["8234E330",0x4C4B],
- ["8234E331",0x4C4C],
- ["8234E332",0x4C4D],
- ["8234E333",0x4C4E],
- ["8234E334",0x4C4F],
- ["8234E335",0x4C50],
- ["8234E336",0x4C51],
- ["8234E337",0x4C52],
- ["8234E338",0x4C53],
- ["8234E339",0x4C54],
- ["8234E430",0x4C55],
- ["8234E431",0x4C56],
- ["8234E432",0x4C57],
- ["8234E433",0x4C58],
- ["8234E434",0x4C59],
- ["8234E435",0x4C5A],
- ["8234E436",0x4C5B],
- ["8234E437",0x4C5C],
- ["8234E438",0x4C5D],
- ["8234E439",0x4C5E],
- ["8234E530",0x4C5F],
- ["8234E531",0x4C60],
- ["8234E532",0x4C61],
- ["8234E533",0x4C62],
- ["8234E534",0x4C63],
- ["8234E535",0x4C64],
- ["8234E536",0x4C65],
- ["8234E537",0x4C66],
- ["8234E538",0x4C67],
- ["8234E539",0x4C68],
- ["8234E630",0x4C69],
- ["8234E631",0x4C6A],
- ["8234E632",0x4C6B],
- ["8234E633",0x4C6C],
- ["8234E634",0x4C6D],
- ["8234E635",0x4C6E],
- ["8234E636",0x4C6F],
- ["8234E637",0x4C70],
- ["8234E638",0x4C71],
- ["8234E639",0x4C72],
- ["8234E730",0x4C73],
- ["8234E731",0x4C74],
- ["8234E732",0x4C75],
- ["8234E733",0x4C76],
- ["FE96",0x4C77],
- ["8234E734",0x4C78],
- ["8234E735",0x4C79],
- ["8234E736",0x4C7A],
- ["8234E737",0x4C7B],
- ["8234E738",0x4C7C],
- ["8234E739",0x4C7D],
- ["8234E830",0x4C7E],
- ["8234E831",0x4C7F],
- ["8234E832",0x4C80],
- ["8234E833",0x4C81],
- ["8234E834",0x4C82],
- ["8234E835",0x4C83],
- ["8234E836",0x4C84],
- ["8234E837",0x4C85],
- ["8234E838",0x4C86],
- ["8234E839",0x4C87],
- ["8234E930",0x4C88],
- ["8234E931",0x4C89],
- ["8234E932",0x4C8A],
- ["8234E933",0x4C8B],
- ["8234E934",0x4C8C],
- ["8234E935",0x4C8D],
- ["8234E936",0x4C8E],
- ["8234E937",0x4C8F],
- ["8234E938",0x4C90],
- ["8234E939",0x4C91],
- ["8234EA30",0x4C92],
- ["8234EA31",0x4C93],
- ["8234EA32",0x4C94],
- ["8234EA33",0x4C95],
- ["8234EA34",0x4C96],
- ["8234EA35",0x4C97],
- ["8234EA36",0x4C98],
- ["8234EA37",0x4C99],
- ["8234EA38",0x4C9A],
- ["8234EA39",0x4C9B],
- ["8234EB30",0x4C9C],
- ["8234EB31",0x4C9D],
- ["8234EB32",0x4C9E],
- ["FE93",0x4C9F],
- ["FE94",0x4CA0],
- ["FE95",0x4CA1],
- ["FE97",0x4CA2],
- ["FE92",0x4CA3],
- ["8234EB33",0x4CA4],
- ["8234EB34",0x4CA5],
- ["8234EB35",0x4CA6],
- ["8234EB36",0x4CA7],
- ["8234EB37",0x4CA8],
- ["8234EB38",0x4CA9],
- ["8234EB39",0x4CAA],
- ["8234EC30",0x4CAB],
- ["8234EC31",0x4CAC],
- ["8234EC32",0x4CAD],
- ["8234EC33",0x4CAE],
- ["8234EC34",0x4CAF],
- ["8234EC35",0x4CB0],
- ["8234EC36",0x4CB1],
- ["8234EC37",0x4CB2],
- ["8234EC38",0x4CB3],
- ["8234EC39",0x4CB4],
- ["8234ED30",0x4CB5],
- ["8234ED31",0x4CB6],
- ["8234ED32",0x4CB7],
- ["8234ED33",0x4CB8],
- ["8234ED34",0x4CB9],
- ["8234ED35",0x4CBA],
- ["8234ED36",0x4CBB],
- ["8234ED37",0x4CBC],
- ["8234ED38",0x4CBD],
- ["8234ED39",0x4CBE],
- ["8234EE30",0x4CBF],
- ["8234EE31",0x4CC0],
- ["8234EE32",0x4CC1],
- ["8234EE33",0x4CC2],
- ["8234EE34",0x4CC3],
- ["8234EE35",0x4CC4],
- ["8234EE36",0x4CC5],
- ["8234EE37",0x4CC6],
- ["8234EE38",0x4CC7],
- ["8234EE39",0x4CC8],
- ["8234EF30",0x4CC9],
- ["8234EF31",0x4CCA],
- ["8234EF32",0x4CCB],
- ["8234EF33",0x4CCC],
- ["8234EF34",0x4CCD],
- ["8234EF35",0x4CCE],
- ["8234EF36",0x4CCF],
- ["8234EF37",0x4CD0],
- ["8234EF38",0x4CD1],
- ["8234EF39",0x4CD2],
- ["8234F030",0x4CD3],
- ["8234F031",0x4CD4],
- ["8234F032",0x4CD5],
- ["8234F033",0x4CD6],
- ["8234F034",0x4CD7],
- ["8234F035",0x4CD8],
- ["8234F036",0x4CD9],
- ["8234F037",0x4CDA],
- ["8234F038",0x4CDB],
- ["8234F039",0x4CDC],
- ["8234F130",0x4CDD],
- ["8234F131",0x4CDE],
- ["8234F132",0x4CDF],
- ["8234F133",0x4CE0],
- ["8234F134",0x4CE1],
- ["8234F135",0x4CE2],
- ["8234F136",0x4CE3],
- ["8234F137",0x4CE4],
- ["8234F138",0x4CE5],
- ["8234F139",0x4CE6],
- ["8234F230",0x4CE7],
- ["8234F231",0x4CE8],
- ["8234F232",0x4CE9],
- ["8234F233",0x4CEA],
- ["8234F234",0x4CEB],
- ["8234F235",0x4CEC],
- ["8234F236",0x4CED],
- ["8234F237",0x4CEE],
- ["8234F238",0x4CEF],
- ["8234F239",0x4CF0],
- ["8234F330",0x4CF1],
- ["8234F331",0x4CF2],
- ["8234F332",0x4CF3],
- ["8234F333",0x4CF4],
- ["8234F334",0x4CF5],
- ["8234F335",0x4CF6],
- ["8234F336",0x4CF7],
- ["8234F337",0x4CF8],
- ["8234F338",0x4CF9],
- ["8234F339",0x4CFA],
- ["8234F430",0x4CFB],
- ["8234F431",0x4CFC],
- ["8234F432",0x4CFD],
- ["8234F433",0x4CFE],
- ["8234F434",0x4CFF],
- ["8234F435",0x4D00],
- ["8234F436",0x4D01],
- ["8234F437",0x4D02],
- ["8234F438",0x4D03],
- ["8234F439",0x4D04],
- ["8234F530",0x4D05],
- ["8234F531",0x4D06],
- ["8234F532",0x4D07],
- ["8234F533",0x4D08],
- ["8234F534",0x4D09],
- ["8234F535",0x4D0A],
- ["8234F536",0x4D0B],
- ["8234F537",0x4D0C],
- ["8234F538",0x4D0D],
- ["8234F539",0x4D0E],
- ["8234F630",0x4D0F],
- ["8234F631",0x4D10],
- ["8234F632",0x4D11],
- ["8234F633",0x4D12],
- ["FE98",0x4D13],
- ["FE99",0x4D14],
- ["FE9A",0x4D15],
- ["FE9B",0x4D16],
- ["FE9C",0x4D17],
- ["FE9D",0x4D18],
- ["FE9E",0x4D19],
- ["8234F634",0x4D1A],
- ["8234F635",0x4D1B],
- ["8234F636",0x4D1C],
- ["8234F637",0x4D1D],
- ["8234F638",0x4D1E],
- ["8234F639",0x4D1F],
- ["8234F730",0x4D20],
- ["8234F731",0x4D21],
- ["8234F732",0x4D22],
- ["8234F733",0x4D23],
- ["8234F734",0x4D24],
- ["8234F735",0x4D25],
- ["8234F736",0x4D26],
- ["8234F737",0x4D27],
- ["8234F738",0x4D28],
- ["8234F739",0x4D29],
- ["8234F830",0x4D2A],
- ["8234F831",0x4D2B],
- ["8234F832",0x4D2C],
- ["8234F833",0x4D2D],
- ["8234F834",0x4D2E],
- ["8234F835",0x4D2F],
- ["8234F836",0x4D30],
- ["8234F837",0x4D31],
- ["8234F838",0x4D32],
- ["8234F839",0x4D33],
- ["8234F930",0x4D34],
- ["8234F931",0x4D35],
- ["8234F932",0x4D36],
- ["8234F933",0x4D37],
- ["8234F934",0x4D38],
- ["8234F935",0x4D39],
- ["8234F936",0x4D3A],
- ["8234F937",0x4D3B],
- ["8234F938",0x4D3C],
- ["8234F939",0x4D3D],
- ["8234FA30",0x4D3E],
- ["8234FA31",0x4D3F],
- ["8234FA32",0x4D40],
- ["8234FA33",0x4D41],
- ["8234FA34",0x4D42],
- ["8234FA35",0x4D43],
- ["8234FA36",0x4D44],
- ["8234FA37",0x4D45],
- ["8234FA38",0x4D46],
- ["8234FA39",0x4D47],
- ["8234FB30",0x4D48],
- ["8234FB31",0x4D49],
- ["8234FB32",0x4D4A],
- ["8234FB33",0x4D4B],
- ["8234FB34",0x4D4C],
- ["8234FB35",0x4D4D],
- ["8234FB36",0x4D4E],
- ["8234FB37",0x4D4F],
- ["8234FB38",0x4D50],
- ["8234FB39",0x4D51],
- ["8234FC30",0x4D52],
- ["8234FC31",0x4D53],
- ["8234FC32",0x4D54],
- ["8234FC33",0x4D55],
- ["8234FC34",0x4D56],
- ["8234FC35",0x4D57],
- ["8234FC36",0x4D58],
- ["8234FC37",0x4D59],
- ["8234FC38",0x4D5A],
- ["8234FC39",0x4D5B],
- ["8234FD30",0x4D5C],
- ["8234FD31",0x4D5D],
- ["8234FD32",0x4D5E],
- ["8234FD33",0x4D5F],
- ["8234FD34",0x4D60],
- ["8234FD35",0x4D61],
- ["8234FD36",0x4D62],
- ["8234FD37",0x4D63],
- ["8234FD38",0x4D64],
- ["8234FD39",0x4D65],
- ["8234FE30",0x4D66],
- ["8234FE31",0x4D67],
- ["8234FE32",0x4D68],
- ["8234FE33",0x4D69],
- ["8234FE34",0x4D6A],
- ["8234FE35",0x4D6B],
- ["8234FE36",0x4D6C],
- ["8234FE37",0x4D6D],
- ["8234FE38",0x4D6E],
- ["8234FE39",0x4D6F],
- ["82358130",0x4D70],
- ["82358131",0x4D71],
- ["82358132",0x4D72],
- ["82358133",0x4D73],
- ["82358134",0x4D74],
- ["82358135",0x4D75],
- ["82358136",0x4D76],
- ["82358137",0x4D77],
- ["82358138",0x4D78],
- ["82358139",0x4D79],
- ["82358230",0x4D7A],
- ["82358231",0x4D7B],
- ["82358232",0x4D7C],
- ["82358233",0x4D7D],
- ["82358234",0x4D7E],
- ["82358235",0x4D7F],
- ["82358236",0x4D80],
- ["82358237",0x4D81],
- ["82358238",0x4D82],
- ["82358239",0x4D83],
- ["82358330",0x4D84],
- ["82358331",0x4D85],
- ["82358332",0x4D86],
- ["82358333",0x4D87],
- ["82358334",0x4D88],
- ["82358335",0x4D89],
- ["82358336",0x4D8A],
- ["82358337",0x4D8B],
- ["82358338",0x4D8C],
- ["82358339",0x4D8D],
- ["82358430",0x4D8E],
- ["82358431",0x4D8F],
- ["82358432",0x4D90],
- ["82358433",0x4D91],
- ["82358434",0x4D92],
- ["82358435",0x4D93],
- ["82358436",0x4D94],
- ["82358437",0x4D95],
- ["82358438",0x4D96],
- ["82358439",0x4D97],
- ["82358530",0x4D98],
- ["82358531",0x4D99],
- ["82358532",0x4D9A],
- ["82358533",0x4D9B],
- ["82358534",0x4D9C],
- ["82358535",0x4D9D],
- ["82358536",0x4D9E],
- ["82358537",0x4D9F],
- ["82358538",0x4DA0],
- ["82358539",0x4DA1],
- ["82358630",0x4DA2],
- ["82358631",0x4DA3],
- ["82358632",0x4DA4],
- ["82358633",0x4DA5],
- ["82358634",0x4DA6],
- ["82358635",0x4DA7],
- ["82358636",0x4DA8],
- ["82358637",0x4DA9],
- ["82358638",0x4DAA],
- ["82358639",0x4DAB],
- ["82358730",0x4DAC],
- ["82358731",0x4DAD],
- ["FE9F",0x4DAE],
- ["82358732",0x4DAF],
- ["82358733",0x4DB0],
- ["82358734",0x4DB1],
- ["82358735",0x4DB2],
- ["82358736",0x4DB3],
- ["82358737",0x4DB4],
- ["82358738",0x4DB5],
- ["82358739",0x4DB6],
- ["82358830",0x4DB7],
- ["82358831",0x4DB8],
- ["82358832",0x4DB9],
- ["82358833",0x4DBA],
- ["82358834",0x4DBB],
- ["82358835",0x4DBC],
- ["82358836",0x4DBD],
- ["82358837",0x4DBE],
- ["82358838",0x4DBF],
- ["82358839",0x4DC0],
- ["82358930",0x4DC1],
- ["82358931",0x4DC2],
- ["82358932",0x4DC3],
- ["82358933",0x4DC4],
- ["82358934",0x4DC5],
- ["82358935",0x4DC6],
- ["82358936",0x4DC7],
- ["82358937",0x4DC8],
- ["82358938",0x4DC9],
- ["82358939",0x4DCA],
- ["82358A30",0x4DCB],
- ["82358A31",0x4DCC],
- ["82358A32",0x4DCD],
- ["82358A33",0x4DCE],
- ["82358A34",0x4DCF],
- ["82358A35",0x4DD0],
- ["82358A36",0x4DD1],
- ["82358A37",0x4DD2],
- ["82358A38",0x4DD3],
- ["82358A39",0x4DD4],
- ["82358B30",0x4DD5],
- ["82358B31",0x4DD6],
- ["82358B32",0x4DD7],
- ["82358B33",0x4DD8],
- ["82358B34",0x4DD9],
- ["82358B35",0x4DDA],
- ["82358B36",0x4DDB],
- ["82358B37",0x4DDC],
- ["82358B38",0x4DDD],
- ["82358B39",0x4DDE],
- ["82358C30",0x4DDF],
- ["82358C31",0x4DE0],
- ["82358C32",0x4DE1],
- ["82358C33",0x4DE2],
- ["82358C34",0x4DE3],
- ["82358C35",0x4DE4],
- ["82358C36",0x4DE5],
- ["82358C37",0x4DE6],
- ["82358C38",0x4DE7],
- ["82358C39",0x4DE8],
- ["82358D30",0x4DE9],
- ["82358D31",0x4DEA],
- ["82358D32",0x4DEB],
- ["82358D33",0x4DEC],
- ["82358D34",0x4DED],
- ["82358D35",0x4DEE],
- ["82358D36",0x4DEF],
- ["82358D37",0x4DF0],
- ["82358D38",0x4DF1],
- ["82358D39",0x4DF2],
- ["82358E30",0x4DF3],
- ["82358E31",0x4DF4],
- ["82358E32",0x4DF5],
- ["82358E33",0x4DF6],
- ["82358E34",0x4DF7],
- ["82358E35",0x4DF8],
- ["82358E36",0x4DF9],
- ["82358E37",0x4DFA],
- ["82358E38",0x4DFB],
- ["82358E39",0x4DFC],
- ["82358F30",0x4DFD],
- ["82358F31",0x4DFE],
- ["82358F32",0x4DFF],
- ["D2BB",0x4E00],
- ["B6A1",0x4E01],
- ["8140",0x4E02],
- ["C6DF",0x4E03],
- ["8141",0x4E04],
- ["8142",0x4E05],
- ["8143",0x4E06],
- ["CDF2",0x4E07],
- ["D5C9",0x4E08],
- ["C8FD",0x4E09],
- ["C9CF",0x4E0A],
- ["CFC2",0x4E0B],
- ["D8A2",0x4E0C],
- ["B2BB",0x4E0D],
- ["D3EB",0x4E0E],
- ["8144",0x4E0F],
- ["D8A4",0x4E10],
- ["B3F3",0x4E11],
- ["8145",0x4E12],
- ["D7A8",0x4E13],
- ["C7D2",0x4E14],
- ["D8A7",0x4E15],
- ["CAC0",0x4E16],
- ["8146",0x4E17],
- ["C7F0",0x4E18],
- ["B1FB",0x4E19],
- ["D2B5",0x4E1A],
- ["B4D4",0x4E1B],
- ["B6AB",0x4E1C],
- ["CBBF",0x4E1D],
- ["D8A9",0x4E1E],
- ["8147",0x4E1F],
- ["8148",0x4E20],
- ["8149",0x4E21],
- ["B6AA",0x4E22],
- ["814A",0x4E23],
- ["C1BD",0x4E24],
- ["D1CF",0x4E25],
- ["814B",0x4E26],
- ["C9A5",0x4E27],
- ["D8AD",0x4E28],
- ["814C",0x4E29],
- ["B8F6",0x4E2A],
- ["D1BE",0x4E2B],
- ["E3DC",0x4E2C],
- ["D6D0",0x4E2D],
- ["814D",0x4E2E],
- ["814E",0x4E2F],
- ["B7E1",0x4E30],
- ["814F",0x4E31],
- ["B4AE",0x4E32],
- ["8150",0x4E33],
- ["C1D9",0x4E34],
- ["8151",0x4E35],
- ["D8BC",0x4E36],
- ["8152",0x4E37],
- ["CDE8",0x4E38],
- ["B5A4",0x4E39],
- ["CEAA",0x4E3A],
- ["D6F7",0x4E3B],
- ["8153",0x4E3C],
- ["C0F6",0x4E3D],
- ["BED9",0x4E3E],
- ["D8AF",0x4E3F],
- ["8154",0x4E40],
- ["8155",0x4E41],
- ["8156",0x4E42],
- ["C4CB",0x4E43],
- ["8157",0x4E44],
- ["BEC3",0x4E45],
- ["8158",0x4E46],
- ["D8B1",0x4E47],
- ["C3B4",0x4E48],
- ["D2E5",0x4E49],
- ["8159",0x4E4A],
- ["D6AE",0x4E4B],
- ["CEDA",0x4E4C],
- ["D5A7",0x4E4D],
- ["BAF5",0x4E4E],
- ["B7A6",0x4E4F],
- ["C0D6",0x4E50],
- ["815A",0x4E51],
- ["C6B9",0x4E52],
- ["C5D2",0x4E53],
- ["C7C7",0x4E54],
- ["815B",0x4E55],
- ["B9D4",0x4E56],
- ["815C",0x4E57],
- ["B3CB",0x4E58],
- ["D2D2",0x4E59],
- ["815D",0x4E5A],
- ["815E",0x4E5B],
- ["D8BF",0x4E5C],
- ["BEC5",0x4E5D],
- ["C6F2",0x4E5E],
- ["D2B2",0x4E5F],
- ["CFB0",0x4E60],
- ["CFE7",0x4E61],
- ["815F",0x4E62],
- ["8160",0x4E63],
- ["8161",0x4E64],
- ["8162",0x4E65],
- ["CAE9",0x4E66],
- ["8163",0x4E67],
- ["8164",0x4E68],
- ["D8C0",0x4E69],
- ["8165",0x4E6A],
- ["8166",0x4E6B],
- ["8167",0x4E6C],
- ["8168",0x4E6D],
- ["8169",0x4E6E],
- ["816A",0x4E6F],
- ["C2F2",0x4E70],
- ["C2D2",0x4E71],
- ["816B",0x4E72],
- ["C8E9",0x4E73],
- ["816C",0x4E74],
- ["816D",0x4E75],
- ["816E",0x4E76],
- ["816F",0x4E77],
- ["8170",0x4E78],
- ["8171",0x4E79],
- ["8172",0x4E7A],
- ["8173",0x4E7B],
- ["8174",0x4E7C],
- ["8175",0x4E7D],
- ["C7AC",0x4E7E],
- ["8176",0x4E7F],
- ["8177",0x4E80],
- ["8178",0x4E81],
- ["8179",0x4E82],
- ["817A",0x4E83],
- ["817B",0x4E84],
- ["817C",0x4E85],
- ["C1CB",0x4E86],
- ["817D",0x4E87],
- ["D3E8",0x4E88],
- ["D5F9",0x4E89],
- ["817E",0x4E8A],
- ["CAC2",0x4E8B],
- ["B6FE",0x4E8C],
- ["D8A1",0x4E8D],
- ["D3DA",0x4E8E],
- ["BFF7",0x4E8F],
- ["8180",0x4E90],
- ["D4C6",0x4E91],
- ["BBA5",0x4E92],
- ["D8C1",0x4E93],
- ["CEE5",0x4E94],
- ["BEAE",0x4E95],
- ["8181",0x4E96],
- ["8182",0x4E97],
- ["D8A8",0x4E98],
- ["8183",0x4E99],
- ["D1C7",0x4E9A],
- ["D0A9",0x4E9B],
- ["8184",0x4E9C],
- ["8185",0x4E9D],
- ["8186",0x4E9E],
- ["D8BD",0x4E9F],
- ["D9EF",0x4EA0],
- ["CDF6",0x4EA1],
- ["BFBA",0x4EA2],
- ["8187",0x4EA3],
- ["BDBB",0x4EA4],
- ["BAA5",0x4EA5],
- ["D2E0",0x4EA6],
- ["B2FA",0x4EA7],
- ["BAE0",0x4EA8],
- ["C4B6",0x4EA9],
- ["8188",0x4EAA],
- ["CFED",0x4EAB],
- ["BEA9",0x4EAC],
- ["CDA4",0x4EAD],
- ["C1C1",0x4EAE],
- ["8189",0x4EAF],
- ["818A",0x4EB0],
- ["818B",0x4EB1],
- ["C7D7",0x4EB2],
- ["D9F1",0x4EB3],
- ["818C",0x4EB4],
- ["D9F4",0x4EB5],
- ["818D",0x4EB6],
- ["818E",0x4EB7],
- ["818F",0x4EB8],
- ["8190",0x4EB9],
- ["C8CB",0x4EBA],
- ["D8E9",0x4EBB],
- ["8191",0x4EBC],
- ["8192",0x4EBD],
- ["8193",0x4EBE],
- ["D2DA",0x4EBF],
- ["CAB2",0x4EC0],
- ["C8CA",0x4EC1],
- ["D8EC",0x4EC2],
- ["D8EA",0x4EC3],
- ["D8C6",0x4EC4],
- ["BDF6",0x4EC5],
- ["C6CD",0x4EC6],
- ["B3F0",0x4EC7],
- ["8194",0x4EC8],
- ["D8EB",0x4EC9],
- ["BDF1",0x4ECA],
- ["BDE9",0x4ECB],
- ["8195",0x4ECC],
- ["C8D4",0x4ECD],
- ["B4D3",0x4ECE],
- ["8196",0x4ECF],
- ["8197",0x4ED0],
- ["C2D8",0x4ED1],
- ["8198",0x4ED2],
- ["B2D6",0x4ED3],
- ["D7D0",0x4ED4],
- ["CACB",0x4ED5],
- ["CBFB",0x4ED6],
- ["D5CC",0x4ED7],
- ["B8B6",0x4ED8],
- ["CFC9",0x4ED9],
- ["8199",0x4EDA],
- ["819A",0x4EDB],
- ["819B",0x4EDC],
- ["D9DA",0x4EDD],
- ["D8F0",0x4EDE],
- ["C7AA",0x4EDF],
- ["819C",0x4EE0],
- ["D8EE",0x4EE1],
- ["819D",0x4EE2],
- ["B4FA",0x4EE3],
- ["C1EE",0x4EE4],
- ["D2D4",0x4EE5],
- ["819E",0x4EE6],
- ["819F",0x4EE7],
- ["D8ED",0x4EE8],
- ["81A0",0x4EE9],
- ["D2C7",0x4EEA],
- ["D8EF",0x4EEB],
- ["C3C7",0x4EEC],
- ["81A1",0x4EED],
- ["81A2",0x4EEE],
- ["81A3",0x4EEF],
- ["D1F6",0x4EF0],
- ["81A4",0x4EF1],
- ["D6D9",0x4EF2],
- ["D8F2",0x4EF3],
- ["81A5",0x4EF4],
- ["D8F5",0x4EF5],
- ["BCFE",0x4EF6],
- ["BCDB",0x4EF7],
- ["81A6",0x4EF8],
- ["81A7",0x4EF9],
- ["81A8",0x4EFA],
- ["C8CE",0x4EFB],
- ["81A9",0x4EFC],
- ["B7DD",0x4EFD],
- ["81AA",0x4EFE],
- ["B7C2",0x4EFF],
- ["81AB",0x4F00],
- ["C6F3",0x4F01],
- ["81AC",0x4F02],
- ["81AD",0x4F03],
- ["81AE",0x4F04],
- ["81AF",0x4F05],
- ["81B0",0x4F06],
- ["81B1",0x4F07],
- ["81B2",0x4F08],
- ["D8F8",0x4F09],
- ["D2C1",0x4F0A],
- ["81B3",0x4F0B],
- ["81B4",0x4F0C],
- ["CEE9",0x4F0D],
- ["BCBF",0x4F0E],
- ["B7FC",0x4F0F],
- ["B7A5",0x4F10],
- ["D0DD",0x4F11],
- ["81B5",0x4F12],
- ["81B6",0x4F13],
- ["81B7",0x4F14],
- ["81B8",0x4F15],
- ["81B9",0x4F16],
- ["D6DA",0x4F17],
- ["D3C5",0x4F18],
- ["BBEF",0x4F19],
- ["BBE1",0x4F1A],
- ["D8F1",0x4F1B],
- ["81BA",0x4F1C],
- ["81BB",0x4F1D],
- ["C9A1",0x4F1E],
- ["CEB0",0x4F1F],
- ["B4AB",0x4F20],
- ["81BC",0x4F21],
- ["D8F3",0x4F22],
- ["81BD",0x4F23],
- ["C9CB",0x4F24],
- ["D8F6",0x4F25],
- ["C2D7",0x4F26],
- ["D8F7",0x4F27],
- ["81BE",0x4F28],
- ["81BF",0x4F29],
- ["CEB1",0x4F2A],
- ["D8F9",0x4F2B],
- ["81C0",0x4F2C],
- ["81C1",0x4F2D],
- ["81C2",0x4F2E],
- ["B2AE",0x4F2F],
- ["B9C0",0x4F30],
- ["81C3",0x4F31],
- ["D9A3",0x4F32],
- ["81C4",0x4F33],
- ["B0E9",0x4F34],
- ["81C5",0x4F35],
- ["C1E6",0x4F36],
- ["81C6",0x4F37],
- ["C9EC",0x4F38],
- ["81C7",0x4F39],
- ["CBC5",0x4F3A],
- ["81C8",0x4F3B],
- ["CBC6",0x4F3C],
- ["D9A4",0x4F3D],
- ["81C9",0x4F3E],
- ["81CA",0x4F3F],
- ["81CB",0x4F40],
- ["81CC",0x4F41],
- ["81CD",0x4F42],
- ["B5E8",0x4F43],
- ["81CE",0x4F44],
- ["81CF",0x4F45],
- ["B5AB",0x4F46],
- ["81D0",0x4F47],
- ["81D1",0x4F48],
- ["81D2",0x4F49],
- ["81D3",0x4F4A],
- ["81D4",0x4F4B],
- ["81D5",0x4F4C],
- ["CEBB",0x4F4D],
- ["B5CD",0x4F4E],
- ["D7A1",0x4F4F],
- ["D7F4",0x4F50],
- ["D3D3",0x4F51],
- ["81D6",0x4F52],
- ["CCE5",0x4F53],
- ["81D7",0x4F54],
- ["BACE",0x4F55],
- ["81D8",0x4F56],
- ["D9A2",0x4F57],
- ["D9DC",0x4F58],
- ["D3E0",0x4F59],
- ["D8FD",0x4F5A],
- ["B7F0",0x4F5B],
- ["D7F7",0x4F5C],
- ["D8FE",0x4F5D],
- ["D8FA",0x4F5E],
- ["D9A1",0x4F5F],
- ["C4E3",0x4F60],
- ["81D9",0x4F61],
- ["81DA",0x4F62],
- ["D3B6",0x4F63],
- ["D8F4",0x4F64],
- ["D9DD",0x4F65],
- ["81DB",0x4F66],
- ["D8FB",0x4F67],
- ["81DC",0x4F68],
- ["C5E5",0x4F69],
- ["81DD",0x4F6A],
- ["81DE",0x4F6B],
- ["C0D0",0x4F6C],
- ["81DF",0x4F6D],
- ["81E0",0x4F6E],
- ["D1F0",0x4F6F],
- ["B0DB",0x4F70],
- ["81E1",0x4F71],
- ["81E2",0x4F72],
- ["BCD1",0x4F73],
- ["D9A6",0x4F74],
- ["81E3",0x4F75],
- ["D9A5",0x4F76],
- ["81E4",0x4F77],
- ["81E5",0x4F78],
- ["81E6",0x4F79],
- ["81E7",0x4F7A],
- ["D9AC",0x4F7B],
- ["D9AE",0x4F7C],
- ["81E8",0x4F7D],
- ["D9AB",0x4F7E],
- ["CAB9",0x4F7F],
- ["81E9",0x4F80],
- ["81EA",0x4F81],
- ["81EB",0x4F82],
- ["D9A9",0x4F83],
- ["D6B6",0x4F84],
- ["81EC",0x4F85],
- ["81ED",0x4F86],
- ["81EE",0x4F87],
- ["B3DE",0x4F88],
- ["D9A8",0x4F89],
- ["81EF",0x4F8A],
- ["C0FD",0x4F8B],
- ["81F0",0x4F8C],
- ["CACC",0x4F8D],
- ["81F1",0x4F8E],
- ["D9AA",0x4F8F],
- ["81F2",0x4F90],
- ["D9A7",0x4F91],
- ["81F3",0x4F92],
- ["81F4",0x4F93],
- ["D9B0",0x4F94],
- ["81F5",0x4F95],
- ["81F6",0x4F96],
- ["B6B1",0x4F97],
- ["81F7",0x4F98],
- ["81F8",0x4F99],
- ["81F9",0x4F9A],
- ["B9A9",0x4F9B],
- ["81FA",0x4F9C],
- ["D2C0",0x4F9D],
- ["81FB",0x4F9E],
- ["81FC",0x4F9F],
- ["CFC0",0x4FA0],
- ["81FD",0x4FA1],
- ["81FE",0x4FA2],
- ["C2C2",0x4FA3],
- ["8240",0x4FA4],
- ["BDC4",0x4FA5],
- ["D5EC",0x4FA6],
- ["B2E0",0x4FA7],
- ["C7C8",0x4FA8],
- ["BFEB",0x4FA9],
- ["D9AD",0x4FAA],
- ["8241",0x4FAB],
- ["D9AF",0x4FAC],
- ["8242",0x4FAD],
- ["CEEA",0x4FAE],
- ["BAEE",0x4FAF],
- ["8243",0x4FB0],
- ["8244",0x4FB1],
- ["8245",0x4FB2],
- ["8246",0x4FB3],
- ["8247",0x4FB4],
- ["C7D6",0x4FB5],
- ["8248",0x4FB6],
- ["8249",0x4FB7],
- ["824A",0x4FB8],
- ["824B",0x4FB9],
- ["824C",0x4FBA],
- ["824D",0x4FBB],
- ["824E",0x4FBC],
- ["824F",0x4FBD],
- ["8250",0x4FBE],
- ["B1E3",0x4FBF],
- ["8251",0x4FC0],
- ["8252",0x4FC1],
- ["8253",0x4FC2],
- ["B4D9",0x4FC3],
- ["B6ED",0x4FC4],
- ["D9B4",0x4FC5],
- ["8254",0x4FC6],
- ["8255",0x4FC7],
- ["8256",0x4FC8],
- ["8257",0x4FC9],
- ["BFA1",0x4FCA],
- ["8258",0x4FCB],
- ["8259",0x4FCC],
- ["825A",0x4FCD],
- ["D9DE",0x4FCE],
- ["C7CE",0x4FCF],
- ["C0FE",0x4FD0],
- ["D9B8",0x4FD1],
- ["825B",0x4FD2],
- ["825C",0x4FD3],
- ["825D",0x4FD4],
- ["825E",0x4FD5],
- ["825F",0x4FD6],
- ["CBD7",0x4FD7],
- ["B7FD",0x4FD8],
- ["8260",0x4FD9],
- ["D9B5",0x4FDA],
- ["8261",0x4FDB],
- ["D9B7",0x4FDC],
- ["B1A3",0x4FDD],
- ["D3E1",0x4FDE],
- ["D9B9",0x4FDF],
- ["8262",0x4FE0],
- ["D0C5",0x4FE1],
- ["8263",0x4FE2],
- ["D9B6",0x4FE3],
- ["8264",0x4FE4],
- ["8265",0x4FE5],
- ["D9B1",0x4FE6],
- ["8266",0x4FE7],
- ["D9B2",0x4FE8],
- ["C1A9",0x4FE9],
- ["D9B3",0x4FEA],
- ["8267",0x4FEB],
- ["8268",0x4FEC],
- ["BCF3",0x4FED],
- ["D0DE",0x4FEE],
- ["B8A9",0x4FEF],
- ["8269",0x4FF0],
- ["BEE3",0x4FF1],
- ["826A",0x4FF2],
- ["D9BD",0x4FF3],
- ["826B",0x4FF4],
- ["826C",0x4FF5],
- ["826D",0x4FF6],
- ["826E",0x4FF7],
- ["D9BA",0x4FF8],
- ["826F",0x4FF9],
- ["B0B3",0x4FFA],
- ["8270",0x4FFB],
- ["8271",0x4FFC],
- ["8272",0x4FFD],
- ["D9C2",0x4FFE],
- ["8273",0x4FFF],
- ["8274",0x5000],
- ["8275",0x5001],
- ["8276",0x5002],
- ["8277",0x5003],
- ["8278",0x5004],
- ["8279",0x5005],
- ["827A",0x5006],
- ["827B",0x5007],
- ["827C",0x5008],
- ["827D",0x5009],
- ["827E",0x500A],
- ["8280",0x500B],
- ["D9C4",0x500C],
- ["B1B6",0x500D],
- ["8281",0x500E],
- ["D9BF",0x500F],
- ["8282",0x5010],
- ["8283",0x5011],
- ["B5B9",0x5012],
- ["8284",0x5013],
- ["BEF3",0x5014],
- ["8285",0x5015],
- ["8286",0x5016],
- ["8287",0x5017],
- ["CCC8",0x5018],
- ["BAF2",0x5019],
- ["D2D0",0x501A],
- ["8288",0x501B],
- ["D9C3",0x501C],
- ["8289",0x501D],
- ["828A",0x501E],
- ["BDE8",0x501F],
- ["828B",0x5020],
- ["B3AB",0x5021],
- ["828C",0x5022],
- ["828D",0x5023],
- ["828E",0x5024],
- ["D9C5",0x5025],
- ["BEEB",0x5026],
- ["828F",0x5027],
- ["D9C6",0x5028],
- ["D9BB",0x5029],
- ["C4DF",0x502A],
- ["8290",0x502B],
- ["D9BE",0x502C],
- ["D9C1",0x502D],
- ["D9C0",0x502E],
- ["8291",0x502F],
- ["8292",0x5030],
- ["8293",0x5031],
- ["8294",0x5032],
- ["8295",0x5033],
- ["8296",0x5034],
- ["8297",0x5035],
- ["8298",0x5036],
- ["8299",0x5037],
- ["829A",0x5038],
- ["829B",0x5039],
- ["D5AE",0x503A],
- ["829C",0x503B],
- ["D6B5",0x503C],
- ["829D",0x503D],
- ["C7E3",0x503E],
- ["829E",0x503F],
- ["829F",0x5040],
- ["82A0",0x5041],
- ["82A1",0x5042],
- ["D9C8",0x5043],
- ["82A2",0x5044],
- ["82A3",0x5045],
- ["82A4",0x5046],
- ["BCD9",0x5047],
- ["D9CA",0x5048],
- ["82A5",0x5049],
- ["82A6",0x504A],
- ["82A7",0x504B],
- ["D9BC",0x504C],
- ["82A8",0x504D],
- ["D9CB",0x504E],
- ["C6AB",0x504F],
- ["82A9",0x5050],
- ["82AA",0x5051],
- ["82AB",0x5052],
- ["82AC",0x5053],
- ["82AD",0x5054],
- ["D9C9",0x5055],
- ["82AE",0x5056],
- ["82AF",0x5057],
- ["82B0",0x5058],
- ["82B1",0x5059],
- ["D7F6",0x505A],
- ["82B2",0x505B],
- ["CDA3",0x505C],
- ["82B3",0x505D],
- ["82B4",0x505E],
- ["82B5",0x505F],
- ["82B6",0x5060],
- ["82B7",0x5061],
- ["82B8",0x5062],
- ["82B9",0x5063],
- ["82BA",0x5064],
- ["BDA1",0x5065],
- ["82BB",0x5066],
- ["82BC",0x5067],
- ["82BD",0x5068],
- ["82BE",0x5069],
- ["82BF",0x506A],
- ["82C0",0x506B],
- ["D9CC",0x506C],
- ["82C1",0x506D],
- ["82C2",0x506E],
- ["82C3",0x506F],
- ["82C4",0x5070],
- ["82C5",0x5071],
- ["82C6",0x5072],
- ["82C7",0x5073],
- ["82C8",0x5074],
- ["82C9",0x5075],
- ["C5BC",0x5076],
- ["CDB5",0x5077],
- ["82CA",0x5078],
- ["82CB",0x5079],
- ["82CC",0x507A],
- ["D9CD",0x507B],
- ["82CD",0x507C],
- ["82CE",0x507D],
- ["D9C7",0x507E],
- ["B3A5",0x507F],
- ["BFFE",0x5080],
- ["82CF",0x5081],
- ["82D0",0x5082],
- ["82D1",0x5083],
- ["82D2",0x5084],
- ["B8B5",0x5085],
- ["82D3",0x5086],
- ["82D4",0x5087],
- ["C0FC",0x5088],
- ["82D5",0x5089],
- ["82D6",0x508A],
- ["82D7",0x508B],
- ["82D8",0x508C],
- ["B0F8",0x508D],
- ["82D9",0x508E],
- ["82DA",0x508F],
- ["82DB",0x5090],
- ["82DC",0x5091],
- ["82DD",0x5092],
- ["82DE",0x5093],
- ["82DF",0x5094],
- ["82E0",0x5095],
- ["82E1",0x5096],
- ["82E2",0x5097],
- ["82E3",0x5098],
- ["82E4",0x5099],
- ["82E5",0x509A],
- ["82E6",0x509B],
- ["82E7",0x509C],
- ["82E8",0x509D],
- ["82E9",0x509E],
- ["82EA",0x509F],
- ["82EB",0x50A0],
- ["82EC",0x50A1],
- ["82ED",0x50A2],
- ["B4F6",0x50A3],
- ["82EE",0x50A4],
- ["D9CE",0x50A5],
- ["82EF",0x50A6],
- ["D9CF",0x50A7],
- ["B4A2",0x50A8],
- ["D9D0",0x50A9],
- ["82F0",0x50AA],
- ["82F1",0x50AB],
- ["B4DF",0x50AC],
- ["82F2",0x50AD],
- ["82F3",0x50AE],
- ["82F4",0x50AF],
- ["82F5",0x50B0],
- ["82F6",0x50B1],
- ["B0C1",0x50B2],
- ["82F7",0x50B3],
- ["82F8",0x50B4],
- ["82F9",0x50B5],
- ["82FA",0x50B6],
- ["82FB",0x50B7],
- ["82FC",0x50B8],
- ["82FD",0x50B9],
- ["D9D1",0x50BA],
- ["C9B5",0x50BB],
- ["82FE",0x50BC],
- ["8340",0x50BD],
- ["8341",0x50BE],
- ["8342",0x50BF],
- ["8343",0x50C0],
- ["8344",0x50C1],
- ["8345",0x50C2],
- ["8346",0x50C3],
- ["8347",0x50C4],
- ["8348",0x50C5],
- ["8349",0x50C6],
- ["834A",0x50C7],
- ["834B",0x50C8],
- ["834C",0x50C9],
- ["834D",0x50CA],
- ["834E",0x50CB],
- ["834F",0x50CC],
- ["8350",0x50CD],
- ["8351",0x50CE],
- ["CFF1",0x50CF],
- ["8352",0x50D0],
- ["8353",0x50D1],
- ["8354",0x50D2],
- ["8355",0x50D3],
- ["8356",0x50D4],
- ["8357",0x50D5],
- ["D9D2",0x50D6],
- ["8358",0x50D7],
- ["8359",0x50D8],
- ["835A",0x50D9],
- ["C1C5",0x50DA],
- ["835B",0x50DB],
- ["835C",0x50DC],
- ["835D",0x50DD],
- ["835E",0x50DE],
- ["835F",0x50DF],
- ["8360",0x50E0],
- ["8361",0x50E1],
- ["8362",0x50E2],
- ["8363",0x50E3],
- ["8364",0x50E4],
- ["8365",0x50E5],
- ["D9D6",0x50E6],
- ["C9AE",0x50E7],
- ["8366",0x50E8],
- ["8367",0x50E9],
- ["8368",0x50EA],
- ["8369",0x50EB],
- ["D9D5",0x50EC],
- ["D9D4",0x50ED],
- ["D9D7",0x50EE],
- ["836A",0x50EF],
- ["836B",0x50F0],
- ["836C",0x50F1],
- ["836D",0x50F2],
- ["CBDB",0x50F3],
- ["836E",0x50F4],
- ["BDA9",0x50F5],
- ["836F",0x50F6],
- ["8370",0x50F7],
- ["8371",0x50F8],
- ["8372",0x50F9],
- ["8373",0x50FA],
- ["C6A7",0x50FB],
- ["8374",0x50FC],
- ["8375",0x50FD],
- ["8376",0x50FE],
- ["8377",0x50FF],
- ["8378",0x5100],
- ["8379",0x5101],
- ["837A",0x5102],
- ["837B",0x5103],
- ["837C",0x5104],
- ["837D",0x5105],
- ["D9D3",0x5106],
- ["D9D8",0x5107],
- ["837E",0x5108],
- ["8380",0x5109],
- ["8381",0x510A],
- ["D9D9",0x510B],
- ["8382",0x510C],
- ["8383",0x510D],
- ["8384",0x510E],
- ["8385",0x510F],
- ["8386",0x5110],
- ["8387",0x5111],
- ["C8E5",0x5112],
- ["8388",0x5113],
- ["8389",0x5114],
- ["838A",0x5115],
- ["838B",0x5116],
- ["838C",0x5117],
- ["838D",0x5118],
- ["838E",0x5119],
- ["838F",0x511A],
- ["8390",0x511B],
- ["8391",0x511C],
- ["8392",0x511D],
- ["8393",0x511E],
- ["8394",0x511F],
- ["8395",0x5120],
- ["C0DC",0x5121],
- ["8396",0x5122],
- ["8397",0x5123],
- ["8398",0x5124],
- ["8399",0x5125],
- ["839A",0x5126],
- ["839B",0x5127],
- ["839C",0x5128],
- ["839D",0x5129],
- ["839E",0x512A],
- ["839F",0x512B],
- ["83A0",0x512C],
- ["83A1",0x512D],
- ["83A2",0x512E],
- ["83A3",0x512F],
- ["83A4",0x5130],
- ["83A5",0x5131],
- ["83A6",0x5132],
- ["83A7",0x5133],
- ["83A8",0x5134],
- ["83A9",0x5135],
- ["83AA",0x5136],
- ["83AB",0x5137],
- ["83AC",0x5138],
- ["83AD",0x5139],
- ["83AE",0x513A],
- ["83AF",0x513B],
- ["83B0",0x513C],
- ["83B1",0x513D],
- ["83B2",0x513E],
- ["B6F9",0x513F],
- ["D8A3",0x5140],
- ["D4CA",0x5141],
- ["83B3",0x5142],
- ["D4AA",0x5143],
- ["D0D6",0x5144],
- ["B3E4",0x5145],
- ["D5D7",0x5146],
- ["83B4",0x5147],
- ["CFC8",0x5148],
- ["B9E2",0x5149],
- ["83B5",0x514A],
- ["BFCB",0x514B],
- ["83B6",0x514C],
- ["C3E2",0x514D],
- ["83B7",0x514E],
- ["83B8",0x514F],
- ["83B9",0x5150],
- ["B6D2",0x5151],
- ["83BA",0x5152],
- ["83BB",0x5153],
- ["CDC3",0x5154],
- ["D9EE",0x5155],
- ["D9F0",0x5156],
- ["83BC",0x5157],
- ["83BD",0x5158],
- ["83BE",0x5159],
- ["B5B3",0x515A],
- ["83BF",0x515B],
- ["B6B5",0x515C],
- ["83C0",0x515D],
- ["83C1",0x515E],
- ["83C2",0x515F],
- ["83C3",0x5160],
- ["83C4",0x5161],
- ["BEA4",0x5162],
- ["83C5",0x5163],
- ["83C6",0x5164],
- ["C8EB",0x5165],
- ["83C7",0x5166],
- ["83C8",0x5167],
- ["C8AB",0x5168],
- ["83C9",0x5169],
- ["83CA",0x516A],
- ["B0CB",0x516B],
- ["B9AB",0x516C],
- ["C1F9",0x516D],
- ["D9E2",0x516E],
- ["83CB",0x516F],
- ["C0BC",0x5170],
- ["B9B2",0x5171],
- ["83CC",0x5172],
- ["B9D8",0x5173],
- ["D0CB",0x5174],
- ["B1F8",0x5175],
- ["C6E4",0x5176],
- ["BEDF",0x5177],
- ["B5E4",0x5178],
- ["D7C8",0x5179],
- ["83CD",0x517A],
- ["D1F8",0x517B],
- ["BCE6",0x517C],
- ["CADE",0x517D],
- ["83CE",0x517E],
- ["83CF",0x517F],
- ["BCBD",0x5180],
- ["D9E6",0x5181],
- ["D8E7",0x5182],
- ["83D0",0x5183],
- ["83D1",0x5184],
- ["C4DA",0x5185],
- ["83D2",0x5186],
- ["83D3",0x5187],
- ["B8D4",0x5188],
- ["C8BD",0x5189],
- ["83D4",0x518A],
- ["83D5",0x518B],
- ["B2E1",0x518C],
- ["D4D9",0x518D],
- ["83D6",0x518E],
- ["83D7",0x518F],
- ["83D8",0x5190],
- ["83D9",0x5191],
- ["C3B0",0x5192],
- ["83DA",0x5193],
- ["83DB",0x5194],
- ["C3E1",0x5195],
- ["DAA2",0x5196],
- ["C8DF",0x5197],
- ["83DC",0x5198],
- ["D0B4",0x5199],
- ["83DD",0x519A],
- ["BEFC",0x519B],
- ["C5A9",0x519C],
- ["83DE",0x519D],
- ["83DF",0x519E],
- ["83E0",0x519F],
- ["B9DA",0x51A0],
- ["83E1",0x51A1],
- ["DAA3",0x51A2],
- ["83E2",0x51A3],
- ["D4A9",0x51A4],
- ["DAA4",0x51A5],
- ["83E3",0x51A6],
- ["83E4",0x51A7],
- ["83E5",0x51A8],
- ["83E6",0x51A9],
- ["83E7",0x51AA],
- ["D9FB",0x51AB],
- ["B6AC",0x51AC],
- ["83E8",0x51AD],
- ["83E9",0x51AE],
- ["B7EB",0x51AF],
- ["B1F9",0x51B0],
- ["D9FC",0x51B1],
- ["B3E5",0x51B2],
- ["BEF6",0x51B3],
- ["83EA",0x51B4],
- ["BFF6",0x51B5],
- ["D2B1",0x51B6],
- ["C0E4",0x51B7],
- ["83EB",0x51B8],
- ["83EC",0x51B9],
- ["83ED",0x51BA],
- ["B6B3",0x51BB],
- ["D9FE",0x51BC],
- ["D9FD",0x51BD],
- ["83EE",0x51BE],
- ["83EF",0x51BF],
- ["BEBB",0x51C0],
- ["83F0",0x51C1],
- ["83F1",0x51C2],
- ["83F2",0x51C3],
- ["C6E0",0x51C4],
- ["83F3",0x51C5],
- ["D7BC",0x51C6],
- ["DAA1",0x51C7],
- ["83F4",0x51C8],
- ["C1B9",0x51C9],
- ["83F5",0x51CA],
- ["B5F2",0x51CB],
- ["C1E8",0x51CC],
- ["83F6",0x51CD],
- ["83F7",0x51CE],
- ["BCF5",0x51CF],
- ["83F8",0x51D0],
- ["B4D5",0x51D1],
- ["83F9",0x51D2],
- ["83FA",0x51D3],
- ["83FB",0x51D4],
- ["83FC",0x51D5],
- ["83FD",0x51D6],
- ["83FE",0x51D7],
- ["8440",0x51D8],
- ["8441",0x51D9],
- ["8442",0x51DA],
- ["C1DD",0x51DB],
- ["8443",0x51DC],
- ["C4FD",0x51DD],
- ["8444",0x51DE],
- ["8445",0x51DF],
- ["BCB8",0x51E0],
- ["B7B2",0x51E1],
- ["8446",0x51E2],
- ["8447",0x51E3],
- ["B7EF",0x51E4],
- ["8448",0x51E5],
- ["8449",0x51E6],
- ["844A",0x51E7],
- ["844B",0x51E8],
- ["844C",0x51E9],
- ["844D",0x51EA],
- ["D9EC",0x51EB],
- ["844E",0x51EC],
- ["C6BE",0x51ED],
- ["844F",0x51EE],
- ["BFAD",0x51EF],
- ["BBCB",0x51F0],
- ["8450",0x51F1],
- ["8451",0x51F2],
- ["B5CA",0x51F3],
- ["8452",0x51F4],
- ["DBC9",0x51F5],
- ["D0D7",0x51F6],
- ["8453",0x51F7],
- ["CDB9",0x51F8],
- ["B0BC",0x51F9],
- ["B3F6",0x51FA],
- ["BBF7",0x51FB],
- ["DBCA",0x51FC],
- ["BAAF",0x51FD],
- ["8454",0x51FE],
- ["D4E4",0x51FF],
- ["B5B6",0x5200],
- ["B5F3",0x5201],
- ["D8D6",0x5202],
- ["C8D0",0x5203],
- ["8455",0x5204],
- ["8456",0x5205],
- ["B7D6",0x5206],
- ["C7D0",0x5207],
- ["D8D7",0x5208],
- ["8457",0x5209],
- ["BFAF",0x520A],
- ["8458",0x520B],
- ["8459",0x520C],
- ["DBBB",0x520D],
- ["D8D8",0x520E],
- ["845A",0x520F],
- ["845B",0x5210],
- ["D0CC",0x5211],
- ["BBAE",0x5212],
- ["845C",0x5213],
- ["845D",0x5214],
- ["845E",0x5215],
- ["EBBE",0x5216],
- ["C1D0",0x5217],
- ["C1F5",0x5218],
- ["D4F2",0x5219],
- ["B8D5",0x521A],
- ["B4B4",0x521B],
- ["845F",0x521C],
- ["B3F5",0x521D],
- ["8460",0x521E],
- ["8461",0x521F],
- ["C9BE",0x5220],
- ["8462",0x5221],
- ["8463",0x5222],
- ["8464",0x5223],
- ["C5D0",0x5224],
- ["8465",0x5225],
- ["8466",0x5226],
- ["8467",0x5227],
- ["C5D9",0x5228],
- ["C0FB",0x5229],
- ["8468",0x522A],
- ["B1F0",0x522B],
- ["8469",0x522C],
- ["D8D9",0x522D],
- ["B9CE",0x522E],
- ["846A",0x522F],
- ["B5BD",0x5230],
- ["846B",0x5231],
- ["846C",0x5232],
- ["D8DA",0x5233],
- ["846D",0x5234],
- ["846E",0x5235],
- ["D6C6",0x5236],
- ["CBA2",0x5237],
- ["C8AF",0x5238],
- ["C9B2",0x5239],
- ["B4CC",0x523A],
- ["BFCC",0x523B],
- ["846F",0x523C],
- ["B9F4",0x523D],
- ["8470",0x523E],
- ["D8DB",0x523F],
- ["D8DC",0x5240],
- ["B6E7",0x5241],
- ["BCC1",0x5242],
- ["CCEA",0x5243],
- ["8471",0x5244],
- ["8472",0x5245],
- ["8473",0x5246],
- ["8474",0x5247],
- ["8475",0x5248],
- ["8476",0x5249],
- ["CFF7",0x524A],
- ["8477",0x524B],
- ["D8DD",0x524C],
- ["C7B0",0x524D],
- ["8478",0x524E],
- ["8479",0x524F],
- ["B9D0",0x5250],
- ["BDA3",0x5251],
- ["847A",0x5252],
- ["847B",0x5253],
- ["CCDE",0x5254],
- ["847C",0x5255],
- ["C6CA",0x5256],
- ["847D",0x5257],
- ["847E",0x5258],
- ["8480",0x5259],
- ["8481",0x525A],
- ["8482",0x525B],
- ["D8E0",0x525C],
- ["8483",0x525D],
- ["D8DE",0x525E],
- ["8484",0x525F],
- ["8485",0x5260],
- ["D8DF",0x5261],
- ["8486",0x5262],
- ["8487",0x5263],
- ["8488",0x5264],
- ["B0FE",0x5265],
- ["8489",0x5266],
- ["BEE7",0x5267],
- ["848A",0x5268],
- ["CAA3",0x5269],
- ["BCF4",0x526A],
- ["848B",0x526B],
- ["848C",0x526C],
- ["848D",0x526D],
- ["848E",0x526E],
- ["B8B1",0x526F],
- ["848F",0x5270],
- ["8490",0x5271],
- ["B8EE",0x5272],
- ["8491",0x5273],
- ["8492",0x5274],
- ["8493",0x5275],
- ["8494",0x5276],
- ["8495",0x5277],
- ["8496",0x5278],
- ["8497",0x5279],
- ["8498",0x527A],
- ["8499",0x527B],
- ["849A",0x527C],
- ["D8E2",0x527D],
- ["849B",0x527E],
- ["BDCB",0x527F],
- ["849C",0x5280],
- ["D8E4",0x5281],
- ["D8E3",0x5282],
- ["849D",0x5283],
- ["849E",0x5284],
- ["849F",0x5285],
- ["84A0",0x5286],
- ["84A1",0x5287],
- ["C5FC",0x5288],
- ["84A2",0x5289],
- ["84A3",0x528A],
- ["84A4",0x528B],
- ["84A5",0x528C],
- ["84A6",0x528D],
- ["84A7",0x528E],
- ["84A8",0x528F],
- ["D8E5",0x5290],
- ["84A9",0x5291],
- ["84AA",0x5292],
- ["D8E6",0x5293],
- ["84AB",0x5294],
- ["84AC",0x5295],
- ["84AD",0x5296],
- ["84AE",0x5297],
- ["84AF",0x5298],
- ["84B0",0x5299],
- ["84B1",0x529A],
- ["C1A6",0x529B],
- ["84B2",0x529C],
- ["C8B0",0x529D],
- ["B0EC",0x529E],
- ["B9A6",0x529F],
- ["BCD3",0x52A0],
- ["CEF1",0x52A1],
- ["DBBD",0x52A2],
- ["C1D3",0x52A3],
- ["84B3",0x52A4],
- ["84B4",0x52A5],
- ["84B5",0x52A6],
- ["84B6",0x52A7],
- ["B6AF",0x52A8],
- ["D6FA",0x52A9],
- ["C5AC",0x52AA],
- ["BDD9",0x52AB],
- ["DBBE",0x52AC],
- ["DBBF",0x52AD],
- ["84B7",0x52AE],
- ["84B8",0x52AF],
- ["84B9",0x52B0],
- ["C0F8",0x52B1],
- ["BEA2",0x52B2],
- ["C0CD",0x52B3],
- ["84BA",0x52B4],
- ["84BB",0x52B5],
- ["84BC",0x52B6],
- ["84BD",0x52B7],
- ["84BE",0x52B8],
- ["84BF",0x52B9],
- ["84C0",0x52BA],
- ["84C1",0x52BB],
- ["84C2",0x52BC],
- ["84C3",0x52BD],
- ["DBC0",0x52BE],
- ["CAC6",0x52BF],
- ["84C4",0x52C0],
- ["84C5",0x52C1],
- ["84C6",0x52C2],
- ["B2AA",0x52C3],
- ["84C7",0x52C4],
- ["84C8",0x52C5],
- ["84C9",0x52C6],
- ["D3C2",0x52C7],
- ["84CA",0x52C8],
- ["C3E3",0x52C9],
- ["84CB",0x52CA],
- ["D1AB",0x52CB],
- ["84CC",0x52CC],
- ["84CD",0x52CD],
- ["84CE",0x52CE],
- ["84CF",0x52CF],
- ["DBC2",0x52D0],
- ["84D0",0x52D1],
- ["C0D5",0x52D2],
- ["84D1",0x52D3],
- ["84D2",0x52D4],
- ["84D3",0x52D5],
- ["DBC3",0x52D6],
- ["84D4",0x52D7],
- ["BFB1",0x52D8],
- ["84D5",0x52D9],
- ["84D6",0x52DA],
- ["84D7",0x52DB],
- ["84D8",0x52DC],
- ["84D9",0x52DD],
- ["84DA",0x52DE],
- ["C4BC",0x52DF],
- ["84DB",0x52E0],
- ["84DC",0x52E1],
- ["84DD",0x52E2],
- ["84DE",0x52E3],
- ["C7DA",0x52E4],
- ["84DF",0x52E5],
- ["84E0",0x52E6],
- ["84E1",0x52E7],
- ["84E2",0x52E8],
- ["84E3",0x52E9],
- ["84E4",0x52EA],
- ["84E5",0x52EB],
- ["84E6",0x52EC],
- ["84E7",0x52ED],
- ["84E8",0x52EE],
- ["84E9",0x52EF],
- ["DBC4",0x52F0],
- ["84EA",0x52F1],
- ["84EB",0x52F2],
- ["84EC",0x52F3],
- ["84ED",0x52F4],
- ["84EE",0x52F5],
- ["84EF",0x52F6],
- ["84F0",0x52F7],
- ["84F1",0x52F8],
- ["D9E8",0x52F9],
- ["C9D7",0x52FA],
- ["84F2",0x52FB],
- ["84F3",0x52FC],
- ["84F4",0x52FD],
- ["B9B4",0x52FE],
- ["CEF0",0x52FF],
- ["D4C8",0x5300],
- ["84F5",0x5301],
- ["84F6",0x5302],
- ["84F7",0x5303],
- ["84F8",0x5304],
- ["B0FC",0x5305],
- ["B4D2",0x5306],
- ["84F9",0x5307],
- ["D0D9",0x5308],
- ["84FA",0x5309],
- ["84FB",0x530A],
- ["84FC",0x530B],
- ["84FD",0x530C],
- ["D9E9",0x530D],
- ["84FE",0x530E],
- ["DECB",0x530F],
- ["D9EB",0x5310],
- ["8540",0x5311],
- ["8541",0x5312],
- ["8542",0x5313],
- ["8543",0x5314],
- ["D8B0",0x5315],
- ["BBAF",0x5316],
- ["B1B1",0x5317],
- ["8544",0x5318],
- ["B3D7",0x5319],
- ["D8CE",0x531A],
- ["8545",0x531B],
- ["8546",0x531C],
- ["D4D1",0x531D],
- ["8547",0x531E],
- ["8548",0x531F],
- ["BDB3",0x5320],
- ["BFEF",0x5321],
- ["8549",0x5322],
- ["CFBB",0x5323],
- ["854A",0x5324],
- ["854B",0x5325],
- ["D8D0",0x5326],
- ["854C",0x5327],
- ["854D",0x5328],
- ["854E",0x5329],
- ["B7CB",0x532A],
- ["854F",0x532B],
- ["8550",0x532C],
- ["8551",0x532D],
- ["D8D1",0x532E],
- ["8552",0x532F],
- ["8553",0x5330],
- ["8554",0x5331],
- ["8555",0x5332],
- ["8556",0x5333],
- ["8557",0x5334],
- ["8558",0x5335],
- ["8559",0x5336],
- ["855A",0x5337],
- ["855B",0x5338],
- ["C6A5",0x5339],
- ["C7F8",0x533A],
- ["D2BD",0x533B],
- ["855C",0x533C],
- ["855D",0x533D],
- ["D8D2",0x533E],
- ["C4E4",0x533F],
- ["855E",0x5340],
- ["CAAE",0x5341],
- ["855F",0x5342],
- ["C7A7",0x5343],
- ["8560",0x5344],
- ["D8A6",0x5345],
- ["8561",0x5346],
- ["C9FD",0x5347],
- ["CEE7",0x5348],
- ["BBDC",0x5349],
- ["B0EB",0x534A],
- ["8562",0x534B],
- ["8563",0x534C],
- ["8564",0x534D],
- ["BBAA",0x534E],
- ["D0AD",0x534F],
- ["8565",0x5350],
- ["B1B0",0x5351],
- ["D7E4",0x5352],
- ["D7BF",0x5353],
- ["8566",0x5354],
- ["B5A5",0x5355],
- ["C2F4",0x5356],
- ["C4CF",0x5357],
- ["8567",0x5358],
- ["8568",0x5359],
- ["B2A9",0x535A],
- ["8569",0x535B],
- ["B2B7",0x535C],
- ["856A",0x535D],
- ["B1E5",0x535E],
- ["DFB2",0x535F],
- ["D5BC",0x5360],
- ["BFA8",0x5361],
- ["C2AC",0x5362],
- ["D8D5",0x5363],
- ["C2B1",0x5364],
- ["856B",0x5365],
- ["D8D4",0x5366],
- ["CED4",0x5367],
- ["856C",0x5368],
- ["DAE0",0x5369],
- ["856D",0x536A],
- ["CEC0",0x536B],
- ["856E",0x536C],
- ["856F",0x536D],
- ["D8B4",0x536E],
- ["C3AE",0x536F],
- ["D3A1",0x5370],
- ["CEA3",0x5371],
- ["8570",0x5372],
- ["BCB4",0x5373],
- ["C8B4",0x5374],
- ["C2D1",0x5375],
- ["8571",0x5376],
- ["BEED",0x5377],
- ["D0B6",0x5378],
- ["8572",0x5379],
- ["DAE1",0x537A],
- ["8573",0x537B],
- ["8574",0x537C],
- ["8575",0x537D],
- ["8576",0x537E],
- ["C7E4",0x537F],
- ["8577",0x5380],
- ["8578",0x5381],
- ["B3A7",0x5382],
- ["8579",0x5383],
- ["B6F2",0x5384],
- ["CCFC",0x5385],
- ["C0FA",0x5386],
- ["857A",0x5387],
- ["857B",0x5388],
- ["C0F7",0x5389],
- ["857C",0x538A],
- ["D1B9",0x538B],
- ["D1E1",0x538C],
- ["D8C7",0x538D],
- ["857D",0x538E],
- ["857E",0x538F],
- ["8580",0x5390],
- ["8581",0x5391],
- ["8582",0x5392],
- ["8583",0x5393],
- ["8584",0x5394],
- ["B2DE",0x5395],
- ["8585",0x5396],
- ["8586",0x5397],
- ["C0E5",0x5398],
- ["8587",0x5399],
- ["BAF1",0x539A],
- ["8588",0x539B],
- ["8589",0x539C],
- ["D8C8",0x539D],
- ["858A",0x539E],
- ["D4AD",0x539F],
- ["858B",0x53A0],
- ["858C",0x53A1],
- ["CFE1",0x53A2],
- ["D8C9",0x53A3],
- ["858D",0x53A4],
- ["D8CA",0x53A5],
- ["CFC3",0x53A6],
- ["858E",0x53A7],
- ["B3F8",0x53A8],
- ["BEC7",0x53A9],
- ["858F",0x53AA],
- ["8590",0x53AB],
- ["8591",0x53AC],
- ["8592",0x53AD],
- ["D8CB",0x53AE],
- ["8593",0x53AF],
- ["8594",0x53B0],
- ["8595",0x53B1],
- ["8596",0x53B2],
- ["8597",0x53B3],
- ["8598",0x53B4],
- ["8599",0x53B5],
- ["DBCC",0x53B6],
- ["859A",0x53B7],
- ["859B",0x53B8],
- ["859C",0x53B9],
- ["859D",0x53BA],
- ["C8A5",0x53BB],
- ["859E",0x53BC],
- ["859F",0x53BD],
- ["85A0",0x53BE],
- ["CFD8",0x53BF],
- ["85A1",0x53C0],
- ["C8FE",0x53C1],
- ["B2CE",0x53C2],
- ["85A2",0x53C3],
- ["85A3",0x53C4],
- ["85A4",0x53C5],
- ["85A5",0x53C6],
- ["85A6",0x53C7],
- ["D3D6",0x53C8],
- ["B2E6",0x53C9],
- ["BCB0",0x53CA],
- ["D3D1",0x53CB],
- ["CBAB",0x53CC],
- ["B7B4",0x53CD],
- ["85A7",0x53CE],
- ["85A8",0x53CF],
- ["85A9",0x53D0],
- ["B7A2",0x53D1],
- ["85AA",0x53D2],
- ["85AB",0x53D3],
- ["CAE5",0x53D4],
- ["85AC",0x53D5],
- ["C8A1",0x53D6],
- ["CADC",0x53D7],
- ["B1E4",0x53D8],
- ["D0F0",0x53D9],
- ["85AD",0x53DA],
- ["C5D1",0x53DB],
- ["85AE",0x53DC],
- ["85AF",0x53DD],
- ["85B0",0x53DE],
- ["DBC5",0x53DF],
- ["B5FE",0x53E0],
- ["85B1",0x53E1],
- ["85B2",0x53E2],
- ["BFDA",0x53E3],
- ["B9C5",0x53E4],
- ["BEE4",0x53E5],
- ["C1ED",0x53E6],
- ["85B3",0x53E7],
- ["DFB6",0x53E8],
- ["DFB5",0x53E9],
- ["D6BB",0x53EA],
- ["BDD0",0x53EB],
- ["D5D9",0x53EC],
- ["B0C8",0x53ED],
- ["B6A3",0x53EE],
- ["BFC9",0x53EF],
- ["CCA8",0x53F0],
- ["DFB3",0x53F1],
- ["CAB7",0x53F2],
- ["D3D2",0x53F3],
- ["85B4",0x53F4],
- ["D8CF",0x53F5],
- ["D2B6",0x53F6],
- ["BAC5",0x53F7],
- ["CBBE",0x53F8],
- ["CCBE",0x53F9],
- ["85B5",0x53FA],
- ["DFB7",0x53FB],
- ["B5F0",0x53FC],
- ["DFB4",0x53FD],
- ["85B6",0x53FE],
- ["85B7",0x53FF],
- ["85B8",0x5400],
- ["D3F5",0x5401],
- ["85B9",0x5402],
- ["B3D4",0x5403],
- ["B8F7",0x5404],
- ["85BA",0x5405],
- ["DFBA",0x5406],
- ["85BB",0x5407],
- ["BACF",0x5408],
- ["BCAA",0x5409],
- ["B5F5",0x540A],
- ["85BC",0x540B],
- ["CDAC",0x540C],
- ["C3FB",0x540D],
- ["BAF3",0x540E],
- ["C0F4",0x540F],
- ["CDC2",0x5410],
- ["CFF2",0x5411],
- ["DFB8",0x5412],
- ["CFC5",0x5413],
- ["85BD",0x5414],
- ["C2C0",0x5415],
- ["DFB9",0x5416],
- ["C2F0",0x5417],
- ["85BE",0x5418],
- ["85BF",0x5419],
- ["85C0",0x541A],
- ["BEFD",0x541B],
- ["85C1",0x541C],
- ["C1DF",0x541D],
- ["CDCC",0x541E],
- ["D2F7",0x541F],
- ["B7CD",0x5420],
- ["DFC1",0x5421],
- ["85C2",0x5422],
- ["DFC4",0x5423],
- ["85C3",0x5424],
- ["85C4",0x5425],
- ["B7F1",0x5426],
- ["B0C9",0x5427],
- ["B6D6",0x5428],
- ["B7D4",0x5429],
- ["85C5",0x542A],
- ["BAAC",0x542B],
- ["CCFD",0x542C],
- ["BFD4",0x542D],
- ["CBB1",0x542E],
- ["C6F4",0x542F],
- ["85C6",0x5430],
- ["D6A8",0x5431],
- ["DFC5",0x5432],
- ["85C7",0x5433],
- ["CEE2",0x5434],
- ["B3B3",0x5435],
- ["85C8",0x5436],
- ["85C9",0x5437],
- ["CEFC",0x5438],
- ["B4B5",0x5439],
- ["85CA",0x543A],
- ["CEC7",0x543B],
- ["BAF0",0x543C],
- ["85CB",0x543D],
- ["CEE1",0x543E],
- ["85CC",0x543F],
- ["D1BD",0x5440],
- ["85CD",0x5441],
- ["85CE",0x5442],
- ["DFC0",0x5443],
- ["85CF",0x5444],
- ["85D0",0x5445],
- ["B4F4",0x5446],
- ["85D1",0x5447],
- ["B3CA",0x5448],
- ["85D2",0x5449],
- ["B8E6",0x544A],
- ["DFBB",0x544B],
- ["85D3",0x544C],
- ["85D4",0x544D],
- ["85D5",0x544E],
- ["85D6",0x544F],
- ["C4C5",0x5450],
- ["85D7",0x5451],
- ["DFBC",0x5452],
- ["DFBD",0x5453],
- ["DFBE",0x5454],
- ["C5BB",0x5455],
- ["DFBF",0x5456],
- ["DFC2",0x5457],
- ["D4B1",0x5458],
- ["DFC3",0x5459],
- ["85D8",0x545A],
- ["C7BA",0x545B],
- ["CED8",0x545C],
- ["85D9",0x545D],
- ["85DA",0x545E],
- ["85DB",0x545F],
- ["85DC",0x5460],
- ["85DD",0x5461],
- ["C4D8",0x5462],
- ["85DE",0x5463],
- ["DFCA",0x5464],
- ["85DF",0x5465],
- ["DFCF",0x5466],
- ["85E0",0x5467],
- ["D6DC",0x5468],
- ["85E1",0x5469],
- ["85E2",0x546A],
- ["85E3",0x546B],
- ["85E4",0x546C],
- ["85E5",0x546D],
- ["85E6",0x546E],
- ["85E7",0x546F],
- ["85E8",0x5470],
- ["DFC9",0x5471],
- ["DFDA",0x5472],
- ["CEB6",0x5473],
- ["85E9",0x5474],
- ["BAC7",0x5475],
- ["DFCE",0x5476],
- ["DFC8",0x5477],
- ["C5DE",0x5478],
- ["85EA",0x5479],
- ["85EB",0x547A],
- ["C9EB",0x547B],
- ["BAF4",0x547C],
- ["C3FC",0x547D],
- ["85EC",0x547E],
- ["85ED",0x547F],
- ["BED7",0x5480],
- ["85EE",0x5481],
- ["DFC6",0x5482],
- ["85EF",0x5483],
- ["DFCD",0x5484],
- ["85F0",0x5485],
- ["C5D8",0x5486],
- ["85F1",0x5487],
- ["85F2",0x5488],
- ["85F3",0x5489],
- ["85F4",0x548A],
- ["D5A6",0x548B],
- ["BACD",0x548C],
- ["85F5",0x548D],
- ["BECC",0x548E],
- ["D3BD",0x548F],
- ["B8C0",0x5490],
- ["85F6",0x5491],
- ["D6E4",0x5492],
- ["85F7",0x5493],
- ["DFC7",0x5494],
- ["B9BE",0x5495],
- ["BFA7",0x5496],
- ["85F8",0x5497],
- ["85F9",0x5498],
- ["C1FC",0x5499],
- ["DFCB",0x549A],
- ["DFCC",0x549B],
- ["85FA",0x549C],
- ["DFD0",0x549D],
- ["85FB",0x549E],
- ["85FC",0x549F],
- ["85FD",0x54A0],
- ["85FE",0x54A1],
- ["8640",0x54A2],
- ["DFDB",0x54A3],
- ["DFE5",0x54A4],
- ["8641",0x54A5],
- ["DFD7",0x54A6],
- ["DFD6",0x54A7],
- ["D7C9",0x54A8],
- ["DFE3",0x54A9],
- ["DFE4",0x54AA],
- ["E5EB",0x54AB],
- ["D2A7",0x54AC],
- ["DFD2",0x54AD],
- ["8642",0x54AE],
- ["BFA9",0x54AF],
- ["8643",0x54B0],
- ["D4DB",0x54B1],
- ["8644",0x54B2],
- ["BFC8",0x54B3],
- ["DFD4",0x54B4],
- ["8645",0x54B5],
- ["8646",0x54B6],
- ["8647",0x54B7],
- ["CFCC",0x54B8],
- ["8648",0x54B9],
- ["8649",0x54BA],
- ["DFDD",0x54BB],
- ["864A",0x54BC],
- ["D1CA",0x54BD],
- ["864B",0x54BE],
- ["DFDE",0x54BF],
- ["B0A7",0x54C0],
- ["C6B7",0x54C1],
- ["DFD3",0x54C2],
- ["864C",0x54C3],
- ["BAE5",0x54C4],
- ["864D",0x54C5],
- ["B6DF",0x54C6],
- ["CDDB",0x54C7],
- ["B9FE",0x54C8],
- ["D4D5",0x54C9],
- ["864E",0x54CA],
- ["864F",0x54CB],
- ["DFDF",0x54CC],
- ["CFEC",0x54CD],
- ["B0A5",0x54CE],
- ["DFE7",0x54CF],
- ["DFD1",0x54D0],
- ["D1C6",0x54D1],
- ["DFD5",0x54D2],
- ["DFD8",0x54D3],
- ["DFD9",0x54D4],
- ["DFDC",0x54D5],
- ["8650",0x54D6],
- ["BBA9",0x54D7],
- ["8651",0x54D8],
- ["DFE0",0x54D9],
- ["DFE1",0x54DA],
- ["8652",0x54DB],
- ["DFE2",0x54DC],
- ["DFE6",0x54DD],
- ["DFE8",0x54DE],
- ["D3B4",0x54DF],
- ["8653",0x54E0],
- ["8654",0x54E1],
- ["8655",0x54E2],
- ["8656",0x54E3],
- ["8657",0x54E4],
- ["B8E7",0x54E5],
- ["C5B6",0x54E6],
- ["DFEA",0x54E7],
- ["C9DA",0x54E8],
- ["C1A8",0x54E9],
- ["C4C4",0x54EA],
- ["8658",0x54EB],
- ["8659",0x54EC],
- ["BFDE",0x54ED],
- ["CFF8",0x54EE],
- ["865A",0x54EF],
- ["865B",0x54F0],
- ["865C",0x54F1],
- ["D5DC",0x54F2],
- ["DFEE",0x54F3],
- ["865D",0x54F4],
- ["865E",0x54F5],
- ["865F",0x54F6],
- ["8660",0x54F7],
- ["8661",0x54F8],
- ["8662",0x54F9],
- ["B2B8",0x54FA],
- ["8663",0x54FB],
- ["BADF",0x54FC],
- ["DFEC",0x54FD],
- ["8664",0x54FE],
- ["DBC1",0x54FF],
- ["8665",0x5500],
- ["D1E4",0x5501],
- ["8666",0x5502],
- ["8667",0x5503],
- ["8668",0x5504],
- ["8669",0x5505],
- ["CBF4",0x5506],
- ["B4BD",0x5507],
- ["866A",0x5508],
- ["B0A6",0x5509],
- ["866B",0x550A],
- ["866C",0x550B],
- ["866D",0x550C],
- ["866E",0x550D],
- ["866F",0x550E],
- ["DFF1",0x550F],
- ["CCC6",0x5510],
- ["DFF2",0x5511],
- ["8670",0x5512],
- ["8671",0x5513],
- ["DFED",0x5514],
- ["8672",0x5515],
- ["8673",0x5516],
- ["8674",0x5517],
- ["8675",0x5518],
- ["8676",0x5519],
- ["8677",0x551A],
- ["DFE9",0x551B],
- ["8678",0x551C],
- ["8679",0x551D],
- ["867A",0x551E],
- ["867B",0x551F],
- ["DFEB",0x5520],
- ["867C",0x5521],
- ["DFEF",0x5522],
- ["DFF0",0x5523],
- ["BBBD",0x5524],
- ["867D",0x5525],
- ["867E",0x5526],
- ["DFF3",0x5527],
- ["8680",0x5528],
- ["8681",0x5529],
- ["DFF4",0x552A],
- ["8682",0x552B],
- ["BBA3",0x552C],
- ["8683",0x552D],
- ["CADB",0x552E],
- ["CEA8",0x552F],
- ["E0A7",0x5530],
- ["B3AA",0x5531],
- ["8684",0x5532],
- ["E0A6",0x5533],
- ["8685",0x5534],
- ["8686",0x5535],
- ["8687",0x5536],
- ["E0A1",0x5537],
- ["8688",0x5538],
- ["8689",0x5539],
- ["868A",0x553A],
- ["868B",0x553B],
- ["DFFE",0x553C],
- ["868C",0x553D],
- ["CDD9",0x553E],
- ["DFFC",0x553F],
- ["868D",0x5540],
- ["DFFA",0x5541],
- ["868E",0x5542],
- ["BFD0",0x5543],
- ["D7C4",0x5544],
- ["868F",0x5545],
- ["C9CC",0x5546],
- ["8690",0x5547],
- ["8691",0x5548],
- ["DFF8",0x5549],
- ["B0A1",0x554A],
- ["8692",0x554B],
- ["8693",0x554C],
- ["8694",0x554D],
- ["8695",0x554E],
- ["8696",0x554F],
- ["DFFD",0x5550],
- ["8697",0x5551],
- ["8698",0x5552],
- ["8699",0x5553],
- ["869A",0x5554],
- ["DFFB",0x5555],
- ["E0A2",0x5556],
- ["869B",0x5557],
- ["869C",0x5558],
- ["869D",0x5559],
- ["869E",0x555A],
- ["869F",0x555B],
- ["E0A8",0x555C],
- ["86A0",0x555D],
- ["86A1",0x555E],
- ["86A2",0x555F],
- ["86A3",0x5560],
- ["B7C8",0x5561],
- ["86A4",0x5562],
- ["86A5",0x5563],
- ["C6A1",0x5564],
- ["C9B6",0x5565],
- ["C0B2",0x5566],
- ["DFF5",0x5567],
- ["86A6",0x5568],
- ["86A7",0x5569],
- ["C5BE",0x556A],
- ["86A8",0x556B],
- ["D8C4",0x556C],
- ["DFF9",0x556D],
- ["C4F6",0x556E],
- ["86A9",0x556F],
- ["86AA",0x5570],
- ["86AB",0x5571],
- ["86AC",0x5572],
- ["86AD",0x5573],
- ["86AE",0x5574],
- ["E0A3",0x5575],
- ["E0A4",0x5576],
- ["E0A5",0x5577],
- ["D0A5",0x5578],
- ["86AF",0x5579],
- ["86B0",0x557A],
- ["E0B4",0x557B],
- ["CCE4",0x557C],
- ["86B1",0x557D],
- ["E0B1",0x557E],
- ["86B2",0x557F],
- ["BFA6",0x5580],
- ["E0AF",0x5581],
- ["CEB9",0x5582],
- ["E0AB",0x5583],
- ["C9C6",0x5584],
- ["86B3",0x5585],
- ["86B4",0x5586],
- ["C0AE",0x5587],
- ["E0AE",0x5588],
- ["BAED",0x5589],
- ["BAB0",0x558A],
- ["E0A9",0x558B],
- ["86B5",0x558C],
- ["86B6",0x558D],
- ["86B7",0x558E],
- ["DFF6",0x558F],
- ["86B8",0x5590],
- ["E0B3",0x5591],
- ["86B9",0x5592],
- ["86BA",0x5593],
- ["E0B8",0x5594],
- ["86BB",0x5595],
- ["86BC",0x5596],
- ["86BD",0x5597],
- ["B4AD",0x5598],
- ["E0B9",0x5599],
- ["86BE",0x559A],
- ["86BF",0x559B],
- ["CFB2",0x559C],
- ["BAC8",0x559D],
- ["86C0",0x559E],
- ["E0B0",0x559F],
- ["86C1",0x55A0],
- ["86C2",0x55A1],
- ["86C3",0x55A2],
- ["86C4",0x55A3],
- ["86C5",0x55A4],
- ["86C6",0x55A5],
- ["86C7",0x55A6],
- ["D0FA",0x55A7],
- ["86C8",0x55A8],
- ["86C9",0x55A9],
- ["86CA",0x55AA],
- ["86CB",0x55AB],
- ["86CC",0x55AC],
- ["86CD",0x55AD],
- ["86CE",0x55AE],
- ["86CF",0x55AF],
- ["86D0",0x55B0],
- ["E0AC",0x55B1],
- ["86D1",0x55B2],
- ["D4FB",0x55B3],
- ["86D2",0x55B4],
- ["DFF7",0x55B5],
- ["86D3",0x55B6],
- ["C5E7",0x55B7],
- ["86D4",0x55B8],
- ["E0AD",0x55B9],
- ["86D5",0x55BA],
- ["D3F7",0x55BB],
- ["86D6",0x55BC],
- ["E0B6",0x55BD],
- ["E0B7",0x55BE],
- ["86D7",0x55BF],
- ["86D8",0x55C0],
- ["86D9",0x55C1],
- ["86DA",0x55C2],
- ["86DB",0x55C3],
- ["E0C4",0x55C4],
- ["D0E1",0x55C5],
- ["86DC",0x55C6],
- ["86DD",0x55C7],
- ["86DE",0x55C8],
- ["E0BC",0x55C9],
- ["86DF",0x55CA],
- ["86E0",0x55CB],
- ["E0C9",0x55CC],
- ["E0CA",0x55CD],
- ["86E1",0x55CE],
- ["86E2",0x55CF],
- ["86E3",0x55D0],
- ["E0BE",0x55D1],
- ["E0AA",0x55D2],
- ["C9A4",0x55D3],
- ["E0C1",0x55D4],
- ["86E4",0x55D5],
- ["E0B2",0x55D6],
- ["86E5",0x55D7],
- ["86E6",0x55D8],
- ["86E7",0x55D9],
- ["86E8",0x55DA],
- ["86E9",0x55DB],
- ["CAC8",0x55DC],
- ["E0C3",0x55DD],
- ["86EA",0x55DE],
- ["E0B5",0x55DF],
- ["86EB",0x55E0],
- ["CECB",0x55E1],
- ["86EC",0x55E2],
- ["CBC3",0x55E3],
- ["E0CD",0x55E4],
- ["E0C6",0x55E5],
- ["E0C2",0x55E6],
- ["86ED",0x55E7],
- ["E0CB",0x55E8],
- ["86EE",0x55E9],
- ["E0BA",0x55EA],
- ["E0BF",0x55EB],
- ["E0C0",0x55EC],
- ["86EF",0x55ED],
- ["86F0",0x55EE],
- ["E0C5",0x55EF],
- ["86F1",0x55F0],
- ["86F2",0x55F1],
- ["E0C7",0x55F2],
- ["E0C8",0x55F3],
- ["86F3",0x55F4],
- ["E0CC",0x55F5],
- ["86F4",0x55F6],
- ["E0BB",0x55F7],
- ["86F5",0x55F8],
- ["86F6",0x55F9],
- ["86F7",0x55FA],
- ["86F8",0x55FB],
- ["86F9",0x55FC],
- ["CBD4",0x55FD],
- ["E0D5",0x55FE],
- ["86FA",0x55FF],
- ["E0D6",0x5600],
- ["E0D2",0x5601],
- ["86FB",0x5602],
- ["86FC",0x5603],
- ["86FD",0x5604],
- ["86FE",0x5605],
- ["8740",0x5606],
- ["8741",0x5607],
- ["E0D0",0x5608],
- ["BCCE",0x5609],
- ["8742",0x560A],
- ["8743",0x560B],
- ["E0D1",0x560C],
- ["8744",0x560D],
- ["B8C2",0x560E],
- ["D8C5",0x560F],
- ["8745",0x5610],
- ["8746",0x5611],
- ["8747",0x5612],
- ["8748",0x5613],
- ["8749",0x5614],
- ["874A",0x5615],
- ["874B",0x5616],
- ["874C",0x5617],
- ["D0EA",0x5618],
- ["874D",0x5619],
- ["874E",0x561A],
- ["C2EF",0x561B],
- ["874F",0x561C],
- ["8750",0x561D],
- ["E0CF",0x561E],
- ["E0BD",0x561F],
- ["8751",0x5620],
- ["8752",0x5621],
- ["8753",0x5622],
- ["E0D4",0x5623],
- ["E0D3",0x5624],
- ["8754",0x5625],
- ["8755",0x5626],
- ["E0D7",0x5627],
- ["8756",0x5628],
- ["8757",0x5629],
- ["8758",0x562A],
- ["8759",0x562B],
- ["E0DC",0x562C],
- ["E0D8",0x562D],
- ["875A",0x562E],
- ["875B",0x562F],
- ["875C",0x5630],
- ["D6F6",0x5631],
- ["B3B0",0x5632],
- ["875D",0x5633],
- ["D7EC",0x5634],
- ["875E",0x5635],
- ["CBBB",0x5636],
- ["875F",0x5637],
- ["8760",0x5638],
- ["E0DA",0x5639],
- ["8761",0x563A],
- ["CEFB",0x563B],
- ["8762",0x563C],
- ["8763",0x563D],
- ["8764",0x563E],
- ["BAD9",0x563F],
- ["8765",0x5640],
- ["8766",0x5641],
- ["8767",0x5642],
- ["8768",0x5643],
- ["8769",0x5644],
- ["876A",0x5645],
- ["876B",0x5646],
- ["876C",0x5647],
- ["876D",0x5648],
- ["876E",0x5649],
- ["876F",0x564A],
- ["8770",0x564B],
- ["E0E1",0x564C],
- ["E0DD",0x564D],
- ["D2AD",0x564E],
- ["8771",0x564F],
- ["8772",0x5650],
- ["8773",0x5651],
- ["8774",0x5652],
- ["8775",0x5653],
- ["E0E2",0x5654],
- ["8776",0x5655],
- ["8777",0x5656],
- ["E0DB",0x5657],
- ["E0D9",0x5658],
- ["E0DF",0x5659],
- ["8778",0x565A],
- ["8779",0x565B],
- ["E0E0",0x565C],
- ["877A",0x565D],
- ["877B",0x565E],
- ["877C",0x565F],
- ["877D",0x5660],
- ["877E",0x5661],
- ["E0DE",0x5662],
- ["8780",0x5663],
- ["E0E4",0x5664],
- ["8781",0x5665],
- ["8782",0x5666],
- ["8783",0x5667],
- ["C6F7",0x5668],
- ["D8AC",0x5669],
- ["D4EB",0x566A],
- ["E0E6",0x566B],
- ["CAC9",0x566C],
- ["8784",0x566D],
- ["8785",0x566E],
- ["8786",0x566F],
- ["8787",0x5670],
- ["E0E5",0x5671],
- ["8788",0x5672],
- ["8789",0x5673],
- ["878A",0x5674],
- ["878B",0x5675],
- ["B8C1",0x5676],
- ["878C",0x5677],
- ["878D",0x5678],
- ["878E",0x5679],
- ["878F",0x567A],
- ["E0E7",0x567B],
- ["E0E8",0x567C],
- ["8790",0x567D],
- ["8791",0x567E],
- ["8792",0x567F],
- ["8793",0x5680],
- ["8794",0x5681],
- ["8795",0x5682],
- ["8796",0x5683],
- ["8797",0x5684],
- ["E0E9",0x5685],
- ["E0E3",0x5686],
- ["8798",0x5687],
- ["8799",0x5688],
- ["879A",0x5689],
- ["879B",0x568A],
- ["879C",0x568B],
- ["879D",0x568C],
- ["879E",0x568D],
- ["BABF",0x568E],
- ["CCE7",0x568F],
- ["879F",0x5690],
- ["87A0",0x5691],
- ["87A1",0x5692],
- ["E0EA",0x5693],
- ["87A2",0x5694],
- ["87A3",0x5695],
- ["87A4",0x5696],
- ["87A5",0x5697],
- ["87A6",0x5698],
- ["87A7",0x5699],
- ["87A8",0x569A],
- ["87A9",0x569B],
- ["87AA",0x569C],
- ["87AB",0x569D],
- ["87AC",0x569E],
- ["87AD",0x569F],
- ["87AE",0x56A0],
- ["87AF",0x56A1],
- ["87B0",0x56A2],
- ["CFF9",0x56A3],
- ["87B1",0x56A4],
- ["87B2",0x56A5],
- ["87B3",0x56A6],
- ["87B4",0x56A7],
- ["87B5",0x56A8],
- ["87B6",0x56A9],
- ["87B7",0x56AA],
- ["87B8",0x56AB],
- ["87B9",0x56AC],
- ["87BA",0x56AD],
- ["87BB",0x56AE],
- ["E0EB",0x56AF],
- ["87BC",0x56B0],
- ["87BD",0x56B1],
- ["87BE",0x56B2],
- ["87BF",0x56B3],
- ["87C0",0x56B4],
- ["87C1",0x56B5],
- ["87C2",0x56B6],
- ["C8C2",0x56B7],
- ["87C3",0x56B8],
- ["87C4",0x56B9],
- ["87C5",0x56BA],
- ["87C6",0x56BB],
- ["BDC0",0x56BC],
- ["87C7",0x56BD],
- ["87C8",0x56BE],
- ["87C9",0x56BF],
- ["87CA",0x56C0],
- ["87CB",0x56C1],
- ["87CC",0x56C2],
- ["87CD",0x56C3],
- ["87CE",0x56C4],
- ["87CF",0x56C5],
- ["87D0",0x56C6],
- ["87D1",0x56C7],
- ["87D2",0x56C8],
- ["87D3",0x56C9],
- ["C4D2",0x56CA],
- ["87D4",0x56CB],
- ["87D5",0x56CC],
- ["87D6",0x56CD],
- ["87D7",0x56CE],
- ["87D8",0x56CF],
- ["87D9",0x56D0],
- ["87DA",0x56D1],
- ["87DB",0x56D2],
- ["87DC",0x56D3],
- ["E0EC",0x56D4],
- ["87DD",0x56D5],
- ["87DE",0x56D6],
- ["E0ED",0x56D7],
- ["87DF",0x56D8],
- ["87E0",0x56D9],
- ["C7F4",0x56DA],
- ["CBC4",0x56DB],
- ["87E1",0x56DC],
- ["E0EE",0x56DD],
- ["BBD8",0x56DE],
- ["D8B6",0x56DF],
- ["D2F2",0x56E0],
- ["E0EF",0x56E1],
- ["CDC5",0x56E2],
- ["87E2",0x56E3],
- ["B6DA",0x56E4],
- ["87E3",0x56E5],
- ["87E4",0x56E6],
- ["87E5",0x56E7],
- ["87E6",0x56E8],
- ["87E7",0x56E9],
- ["87E8",0x56EA],
- ["E0F1",0x56EB],
- ["87E9",0x56EC],
- ["D4B0",0x56ED],
- ["87EA",0x56EE],
- ["87EB",0x56EF],
- ["C0A7",0x56F0],
- ["B4D1",0x56F1],
- ["87EC",0x56F2],
- ["87ED",0x56F3],
- ["CEA7",0x56F4],
- ["E0F0",0x56F5],
- ["87EE",0x56F6],
- ["87EF",0x56F7],
- ["87F0",0x56F8],
- ["E0F2",0x56F9],
- ["B9CC",0x56FA],
- ["87F1",0x56FB],
- ["87F2",0x56FC],
- ["B9FA",0x56FD],
- ["CDBC",0x56FE],
- ["E0F3",0x56FF],
- ["87F3",0x5700],
- ["87F4",0x5701],
- ["87F5",0x5702],
- ["C6D4",0x5703],
- ["E0F4",0x5704],
- ["87F6",0x5705],
- ["D4B2",0x5706],
- ["87F7",0x5707],
- ["C8A6",0x5708],
- ["E0F6",0x5709],
- ["E0F5",0x570A],
- ["87F8",0x570B],
- ["87F9",0x570C],
- ["87FA",0x570D],
- ["87FB",0x570E],
- ["87FC",0x570F],
- ["87FD",0x5710],
- ["87FE",0x5711],
- ["8840",0x5712],
- ["8841",0x5713],
- ["8842",0x5714],
- ["8843",0x5715],
- ["8844",0x5716],
- ["8845",0x5717],
- ["8846",0x5718],
- ["8847",0x5719],
- ["8848",0x571A],
- ["8849",0x571B],
- ["E0F7",0x571C],
- ["884A",0x571D],
- ["884B",0x571E],
- ["CDC1",0x571F],
- ["884C",0x5720],
- ["884D",0x5721],
- ["884E",0x5722],
- ["CAA5",0x5723],
- ["884F",0x5724],
- ["8850",0x5725],
- ["8851",0x5726],
- ["8852",0x5727],
- ["D4DA",0x5728],
- ["DBD7",0x5729],
- ["DBD9",0x572A],
- ["8853",0x572B],
- ["DBD8",0x572C],
- ["B9E7",0x572D],
- ["DBDC",0x572E],
- ["DBDD",0x572F],
- ["B5D8",0x5730],
- ["8854",0x5731],
- ["8855",0x5732],
- ["DBDA",0x5733],
- ["8856",0x5734],
- ["8857",0x5735],
- ["8858",0x5736],
- ["8859",0x5737],
- ["885A",0x5738],
- ["DBDB",0x5739],
- ["B3A1",0x573A],
- ["DBDF",0x573B],
- ["885B",0x573C],
- ["885C",0x573D],
- ["BBF8",0x573E],
- ["885D",0x573F],
- ["D6B7",0x5740],
- ["885E",0x5741],
- ["DBE0",0x5742],
- ["885F",0x5743],
- ["8860",0x5744],
- ["8861",0x5745],
- ["8862",0x5746],
- ["BEF9",0x5747],
- ["8863",0x5748],
- ["8864",0x5749],
- ["B7BB",0x574A],
- ["8865",0x574B],
- ["DBD0",0x574C],
- ["CCAE",0x574D],
- ["BFB2",0x574E],
- ["BBB5",0x574F],
- ["D7F8",0x5750],
- ["BFD3",0x5751],
- ["8866",0x5752],
- ["8867",0x5753],
- ["8868",0x5754],
- ["8869",0x5755],
- ["886A",0x5756],
- ["BFE9",0x5757],
- ["886B",0x5758],
- ["886C",0x5759],
- ["BCE1",0x575A],
- ["CCB3",0x575B],
- ["DBDE",0x575C],
- ["B0D3",0x575D],
- ["CEEB",0x575E],
- ["B7D8",0x575F],
- ["D7B9",0x5760],
- ["C6C2",0x5761],
- ["886D",0x5762],
- ["886E",0x5763],
- ["C0A4",0x5764],
- ["886F",0x5765],
- ["CCB9",0x5766],
- ["8870",0x5767],
- ["DBE7",0x5768],
- ["DBE1",0x5769],
- ["C6BA",0x576A],
- ["DBE3",0x576B],
- ["8871",0x576C],
- ["DBE8",0x576D],
- ["8872",0x576E],
- ["C5F7",0x576F],
- ["8873",0x5770],
- ["8874",0x5771],
- ["8875",0x5772],
- ["DBEA",0x5773],
- ["8876",0x5774],
- ["8877",0x5775],
- ["DBE9",0x5776],
- ["BFC0",0x5777],
- ["8878",0x5778],
- ["8879",0x5779],
- ["887A",0x577A],
- ["DBE6",0x577B],
- ["DBE5",0x577C],
- ["887B",0x577D],
- ["887C",0x577E],
- ["887D",0x577F],
- ["887E",0x5780],
- ["8880",0x5781],
- ["B4B9",0x5782],
- ["C0AC",0x5783],
- ["C2A2",0x5784],
- ["DBE2",0x5785],
- ["DBE4",0x5786],
- ["8881",0x5787],
- ["8882",0x5788],
- ["8883",0x5789],
- ["8884",0x578A],
- ["D0CD",0x578B],
- ["DBED",0x578C],
- ["8885",0x578D],
- ["8886",0x578E],
- ["8887",0x578F],
- ["8888",0x5790],
- ["8889",0x5791],
- ["C0DD",0x5792],
- ["DBF2",0x5793],
- ["888A",0x5794],
- ["888B",0x5795],
- ["888C",0x5796],
- ["888D",0x5797],
- ["888E",0x5798],
- ["888F",0x5799],
- ["8890",0x579A],
- ["B6E2",0x579B],
- ["8891",0x579C],
- ["8892",0x579D],
- ["8893",0x579E],
- ["8894",0x579F],
- ["DBF3",0x57A0],
- ["DBD2",0x57A1],
- ["B9B8",0x57A2],
- ["D4AB",0x57A3],
- ["DBEC",0x57A4],
- ["8895",0x57A5],
- ["BFD1",0x57A6],
- ["DBF0",0x57A7],
- ["8896",0x57A8],
- ["DBD1",0x57A9],
- ["8897",0x57AA],
- ["B5E6",0x57AB],
- ["8898",0x57AC],
- ["DBEB",0x57AD],
- ["BFE5",0x57AE],
- ["8899",0x57AF],
- ["889A",0x57B0],
- ["889B",0x57B1],
- ["DBEE",0x57B2],
- ["889C",0x57B3],
- ["DBF1",0x57B4],
- ["889D",0x57B5],
- ["889E",0x57B6],
- ["889F",0x57B7],
- ["DBF9",0x57B8],
- ["88A0",0x57B9],
- ["88A1",0x57BA],
- ["88A2",0x57BB],
- ["88A3",0x57BC],
- ["88A4",0x57BD],
- ["88A5",0x57BE],
- ["88A6",0x57BF],
- ["88A7",0x57C0],
- ["88A8",0x57C1],
- ["B9A1",0x57C2],
- ["B0A3",0x57C3],
- ["88A9",0x57C4],
- ["88AA",0x57C5],
- ["88AB",0x57C6],
- ["88AC",0x57C7],
- ["88AD",0x57C8],
- ["88AE",0x57C9],
- ["88AF",0x57CA],
- ["C2F1",0x57CB],
- ["88B0",0x57CC],
- ["88B1",0x57CD],
- ["B3C7",0x57CE],
- ["DBEF",0x57CF],
- ["88B2",0x57D0],
- ["88B3",0x57D1],
- ["DBF8",0x57D2],
- ["88B4",0x57D3],
- ["C6D2",0x57D4],
- ["DBF4",0x57D5],
- ["88B5",0x57D6],
- ["88B6",0x57D7],
- ["DBF5",0x57D8],
- ["DBF7",0x57D9],
- ["DBF6",0x57DA],
- ["88B7",0x57DB],
- ["88B8",0x57DC],
- ["DBFE",0x57DD],
- ["88B9",0x57DE],
- ["D3F2",0x57DF],
- ["B2BA",0x57E0],
- ["88BA",0x57E1],
- ["88BB",0x57E2],
- ["88BC",0x57E3],
- ["DBFD",0x57E4],
- ["88BD",0x57E5],
- ["88BE",0x57E6],
- ["88BF",0x57E7],
- ["88C0",0x57E8],
- ["88C1",0x57E9],
- ["88C2",0x57EA],
- ["88C3",0x57EB],
- ["88C4",0x57EC],
- ["DCA4",0x57ED],
- ["88C5",0x57EE],
- ["DBFB",0x57EF],
- ["88C6",0x57F0],
- ["88C7",0x57F1],
- ["88C8",0x57F2],
- ["88C9",0x57F3],
- ["DBFA",0x57F4],
- ["88CA",0x57F5],
- ["88CB",0x57F6],
- ["88CC",0x57F7],
- ["DBFC",0x57F8],
- ["C5E0",0x57F9],
- ["BBF9",0x57FA],
- ["88CD",0x57FB],
- ["88CE",0x57FC],
- ["DCA3",0x57FD],
- ["88CF",0x57FE],
- ["88D0",0x57FF],
- ["DCA5",0x5800],
- ["88D1",0x5801],
- ["CCC3",0x5802],
- ["88D2",0x5803],
- ["88D3",0x5804],
- ["88D4",0x5805],
- ["B6D1",0x5806],
- ["DDC0",0x5807],
- ["88D5",0x5808],
- ["88D6",0x5809],
- ["88D7",0x580A],
- ["DCA1",0x580B],
- ["88D8",0x580C],
- ["DCA2",0x580D],
- ["88D9",0x580E],
- ["88DA",0x580F],
- ["88DB",0x5810],
- ["C7B5",0x5811],
- ["88DC",0x5812],
- ["88DD",0x5813],
- ["88DE",0x5814],
- ["B6E9",0x5815],
- ["88DF",0x5816],
- ["88E0",0x5817],
- ["88E1",0x5818],
- ["DCA7",0x5819],
- ["88E2",0x581A],
- ["88E3",0x581B],
- ["88E4",0x581C],
- ["88E5",0x581D],
- ["DCA6",0x581E],
- ["88E6",0x581F],
- ["DCA9",0x5820],
- ["B1A4",0x5821],
- ["88E7",0x5822],
- ["88E8",0x5823],
- ["B5CC",0x5824],
- ["88E9",0x5825],
- ["88EA",0x5826],
- ["88EB",0x5827],
- ["88EC",0x5828],
- ["88ED",0x5829],
- ["BFB0",0x582A],
- ["88EE",0x582B],
- ["88EF",0x582C],
- ["88F0",0x582D],
- ["88F1",0x582E],
- ["88F2",0x582F],
- ["D1DF",0x5830],
- ["88F3",0x5831],
- ["88F4",0x5832],
- ["88F5",0x5833],
- ["88F6",0x5834],
- ["B6C2",0x5835],
- ["88F7",0x5836],
- ["88F8",0x5837],
- ["88F9",0x5838],
- ["88FA",0x5839],
- ["88FB",0x583A],
- ["88FC",0x583B],
- ["88FD",0x583C],
- ["88FE",0x583D],
- ["8940",0x583E],
- ["8941",0x583F],
- ["8942",0x5840],
- ["8943",0x5841],
- ["8944",0x5842],
- ["8945",0x5843],
- ["DCA8",0x5844],
- ["8946",0x5845],
- ["8947",0x5846],
- ["8948",0x5847],
- ["8949",0x5848],
- ["894A",0x5849],
- ["894B",0x584A],
- ["894C",0x584B],
- ["CBFA",0x584C],
- ["EBF3",0x584D],
- ["894D",0x584E],
- ["894E",0x584F],
- ["894F",0x5850],
- ["CBDC",0x5851],
- ["8950",0x5852],
- ["8951",0x5853],
- ["CBFE",0x5854],
- ["8952",0x5855],
- ["8953",0x5856],
- ["8954",0x5857],
- ["CCC1",0x5858],
- ["8955",0x5859],
- ["8956",0x585A],
- ["8957",0x585B],
- ["8958",0x585C],
- ["8959",0x585D],
- ["C8FB",0x585E],
- ["895A",0x585F],
- ["895B",0x5860],
- ["895C",0x5861],
- ["895D",0x5862],
- ["895E",0x5863],
- ["895F",0x5864],
- ["DCAA",0x5865],
- ["8960",0x5866],
- ["8961",0x5867],
- ["8962",0x5868],
- ["8963",0x5869],
- ["8964",0x586A],
- ["CCEE",0x586B],
- ["DCAB",0x586C],
- ["8965",0x586D],
- ["8966",0x586E],
- ["8967",0x586F],
- ["8968",0x5870],
- ["8969",0x5871],
- ["896A",0x5872],
- ["896B",0x5873],
- ["896C",0x5874],
- ["896D",0x5875],
- ["896E",0x5876],
- ["896F",0x5877],
- ["8970",0x5878],
- ["8971",0x5879],
- ["8972",0x587A],
- ["8973",0x587B],
- ["8974",0x587C],
- ["8975",0x587D],
- ["DBD3",0x587E],
- ["8976",0x587F],
- ["DCAF",0x5880],
- ["DCAC",0x5881],
- ["8977",0x5882],
- ["BEB3",0x5883],
- ["8978",0x5884],
- ["CAFB",0x5885],
- ["8979",0x5886],
- ["897A",0x5887],
- ["897B",0x5888],
- ["DCAD",0x5889],
- ["897C",0x588A],
- ["897D",0x588B],
- ["897E",0x588C],
- ["8980",0x588D],
- ["8981",0x588E],
- ["8982",0x588F],
- ["8983",0x5890],
- ["8984",0x5891],
- ["C9CA",0x5892],
- ["C4B9",0x5893],
- ["8985",0x5894],
- ["8986",0x5895],
- ["8987",0x5896],
- ["8988",0x5897],
- ["8989",0x5898],
- ["C7BD",0x5899],
- ["DCAE",0x589A],
- ["898A",0x589B],
- ["898B",0x589C],
- ["898C",0x589D],
- ["D4F6",0x589E],
- ["D0E6",0x589F],
- ["898D",0x58A0],
- ["898E",0x58A1],
- ["898F",0x58A2],
- ["8990",0x58A3],
- ["8991",0x58A4],
- ["8992",0x58A5],
- ["8993",0x58A6],
- ["8994",0x58A7],
- ["C4AB",0x58A8],
- ["B6D5",0x58A9],
- ["8995",0x58AA],
- ["8996",0x58AB],
- ["8997",0x58AC],
- ["8998",0x58AD],
- ["8999",0x58AE],
- ["899A",0x58AF],
- ["899B",0x58B0],
- ["899C",0x58B1],
- ["899D",0x58B2],
- ["899E",0x58B3],
- ["899F",0x58B4],
- ["89A0",0x58B5],
- ["89A1",0x58B6],
- ["89A2",0x58B7],
- ["89A3",0x58B8],
- ["89A4",0x58B9],
- ["89A5",0x58BA],
- ["89A6",0x58BB],
- ["DBD4",0x58BC],
- ["89A7",0x58BD],
- ["89A8",0x58BE],
- ["89A9",0x58BF],
- ["89AA",0x58C0],
- ["B1DA",0x58C1],
- ["89AB",0x58C2],
- ["89AC",0x58C3],
- ["89AD",0x58C4],
- ["DBD5",0x58C5],
- ["89AE",0x58C6],
- ["89AF",0x58C7],
- ["89B0",0x58C8],
- ["89B1",0x58C9],
- ["89B2",0x58CA],
- ["89B3",0x58CB],
- ["89B4",0x58CC],
- ["89B5",0x58CD],
- ["89B6",0x58CE],
- ["89B7",0x58CF],
- ["89B8",0x58D0],
- ["DBD6",0x58D1],
- ["89B9",0x58D2],
- ["89BA",0x58D3],
- ["89BB",0x58D4],
- ["BABE",0x58D5],
- ["89BC",0x58D6],
- ["89BD",0x58D7],
- ["89BE",0x58D8],
- ["89BF",0x58D9],
- ["89C0",0x58DA],
- ["89C1",0x58DB],
- ["89C2",0x58DC],
- ["89C3",0x58DD],
- ["89C4",0x58DE],
- ["89C5",0x58DF],
- ["89C6",0x58E0],
- ["89C7",0x58E1],
- ["89C8",0x58E2],
- ["89C9",0x58E3],
- ["C8C0",0x58E4],
- ["89CA",0x58E5],
- ["89CB",0x58E6],
- ["89CC",0x58E7],
- ["89CD",0x58E8],
- ["89CE",0x58E9],
- ["89CF",0x58EA],
- ["CABF",0x58EB],
- ["C8C9",0x58EC],
- ["89D0",0x58ED],
- ["D7B3",0x58EE],
- ["89D1",0x58EF],
- ["C9F9",0x58F0],
- ["89D2",0x58F1],
- ["89D3",0x58F2],
- ["BFC7",0x58F3],
- ["89D4",0x58F4],
- ["89D5",0x58F5],
- ["BAF8",0x58F6],
- ["89D6",0x58F7],
- ["89D7",0x58F8],
- ["D2BC",0x58F9],
- ["89D8",0x58FA],
- ["89D9",0x58FB],
- ["89DA",0x58FC],
- ["89DB",0x58FD],
- ["89DC",0x58FE],
- ["89DD",0x58FF],
- ["89DE",0x5900],
- ["89DF",0x5901],
- ["E2BA",0x5902],
- ["89E0",0x5903],
- ["B4A6",0x5904],
- ["89E1",0x5905],
- ["89E2",0x5906],
- ["B1B8",0x5907],
- ["89E3",0x5908],
- ["89E4",0x5909],
- ["89E5",0x590A],
- ["89E6",0x590B],
- ["89E7",0x590C],
- ["B8B4",0x590D],
- ["89E8",0x590E],
- ["CFC4",0x590F],
- ["89E9",0x5910],
- ["89EA",0x5911],
- ["89EB",0x5912],
- ["89EC",0x5913],
- ["D9E7",0x5914],
- ["CFA6",0x5915],
- ["CDE2",0x5916],
- ["89ED",0x5917],
- ["89EE",0x5918],
- ["D9ED",0x5919],
- ["B6E0",0x591A],
- ["89EF",0x591B],
- ["D2B9",0x591C],
- ["89F0",0x591D],
- ["89F1",0x591E],
- ["B9BB",0x591F],
- ["89F2",0x5920],
- ["89F3",0x5921],
- ["89F4",0x5922],
- ["89F5",0x5923],
- ["E2B9",0x5924],
- ["E2B7",0x5925],
- ["89F6",0x5926],
- ["B4F3",0x5927],
- ["89F7",0x5928],
- ["CCEC",0x5929],
- ["CCAB",0x592A],
- ["B7F2",0x592B],
- ["89F8",0x592C],
- ["D8B2",0x592D],
- ["D1EB",0x592E],
- ["BABB",0x592F],
- ["89F9",0x5930],
- ["CAA7",0x5931],
- ["89FA",0x5932],
- ["89FB",0x5933],
- ["CDB7",0x5934],
- ["89FC",0x5935],
- ["89FD",0x5936],
- ["D2C4",0x5937],
- ["BFE4",0x5938],
- ["BCD0",0x5939],
- ["B6E1",0x593A],
- ["89FE",0x593B],
- ["DEC5",0x593C],
- ["8A40",0x593D],
- ["8A41",0x593E],
- ["8A42",0x593F],
- ["8A43",0x5940],
- ["DEC6",0x5941],
- ["DBBC",0x5942],
- ["8A44",0x5943],
- ["D1D9",0x5944],
- ["8A45",0x5945],
- ["8A46",0x5946],
- ["C6E6",0x5947],
- ["C4CE",0x5948],
- ["B7EE",0x5949],
- ["8A47",0x594A],
- ["B7DC",0x594B],
- ["8A48",0x594C],
- ["8A49",0x594D],
- ["BFFC",0x594E],
- ["D7E0",0x594F],
- ["8A4A",0x5950],
- ["C6F5",0x5951],
- ["8A4B",0x5952],
- ["8A4C",0x5953],
- ["B1BC",0x5954],
- ["DEC8",0x5955],
- ["BDB1",0x5956],
- ["CCD7",0x5957],
- ["DECA",0x5958],
- ["8A4D",0x5959],
- ["DEC9",0x595A],
- ["8A4E",0x595B],
- ["8A4F",0x595C],
- ["8A50",0x595D],
- ["8A51",0x595E],
- ["8A52",0x595F],
- ["B5EC",0x5960],
- ["8A53",0x5961],
- ["C9DD",0x5962],
- ["8A54",0x5963],
- ["8A55",0x5964],
- ["B0C2",0x5965],
- ["8A56",0x5966],
- ["8A57",0x5967],
- ["8A58",0x5968],
- ["8A59",0x5969],
- ["8A5A",0x596A],
- ["8A5B",0x596B],
- ["8A5C",0x596C],
- ["8A5D",0x596D],
- ["8A5E",0x596E],
- ["8A5F",0x596F],
- ["8A60",0x5970],
- ["8A61",0x5971],
- ["8A62",0x5972],
- ["C5AE",0x5973],
- ["C5AB",0x5974],
- ["8A63",0x5975],
- ["C4CC",0x5976],
- ["8A64",0x5977],
- ["BCE9",0x5978],
- ["CBFD",0x5979],
- ["8A65",0x597A],
- ["8A66",0x597B],
- ["8A67",0x597C],
- ["BAC3",0x597D],
- ["8A68",0x597E],
- ["8A69",0x597F],
- ["8A6A",0x5980],
- ["E5F9",0x5981],
- ["C8E7",0x5982],
- ["E5FA",0x5983],
- ["CDFD",0x5984],
- ["8A6B",0x5985],
- ["D7B1",0x5986],
- ["B8BE",0x5987],
- ["C2E8",0x5988],
- ["8A6C",0x5989],
- ["C8D1",0x598A],
- ["8A6D",0x598B],
- ["8A6E",0x598C],
- ["E5FB",0x598D],
- ["8A6F",0x598E],
- ["8A70",0x598F],
- ["8A71",0x5990],
- ["8A72",0x5991],
- ["B6CA",0x5992],
- ["BCCB",0x5993],
- ["8A73",0x5994],
- ["8A74",0x5995],
- ["D1FD",0x5996],
- ["E6A1",0x5997],
- ["8A75",0x5998],
- ["C3EE",0x5999],
- ["8A76",0x599A],
- ["8A77",0x599B],
- ["8A78",0x599C],
- ["8A79",0x599D],
- ["E6A4",0x599E],
- ["8A7A",0x599F],
- ["8A7B",0x59A0],
- ["8A7C",0x59A1],
- ["8A7D",0x59A2],
- ["E5FE",0x59A3],
- ["E6A5",0x59A4],
- ["CDD7",0x59A5],
- ["8A7E",0x59A6],
- ["8A80",0x59A7],
- ["B7C1",0x59A8],
- ["E5FC",0x59A9],
- ["E5FD",0x59AA],
- ["E6A3",0x59AB],
- ["8A81",0x59AC],
- ["8A82",0x59AD],
- ["C4DD",0x59AE],
- ["E6A8",0x59AF],
- ["8A83",0x59B0],
- ["8A84",0x59B1],
- ["E6A7",0x59B2],
- ["8A85",0x59B3],
- ["8A86",0x59B4],
- ["8A87",0x59B5],
- ["8A88",0x59B6],
- ["8A89",0x59B7],
- ["8A8A",0x59B8],
- ["C3C3",0x59B9],
- ["8A8B",0x59BA],
- ["C6DE",0x59BB],
- ["8A8C",0x59BC],
- ["8A8D",0x59BD],
- ["E6AA",0x59BE],
- ["8A8E",0x59BF],
- ["8A8F",0x59C0],
- ["8A90",0x59C1],
- ["8A91",0x59C2],
- ["8A92",0x59C3],
- ["8A93",0x59C4],
- ["8A94",0x59C5],
- ["C4B7",0x59C6],
- ["8A95",0x59C7],
- ["8A96",0x59C8],
- ["8A97",0x59C9],
- ["E6A2",0x59CA],
- ["CABC",0x59CB],
- ["8A98",0x59CC],
- ["8A99",0x59CD],
- ["8A9A",0x59CE],
- ["8A9B",0x59CF],
- ["BDE3",0x59D0],
- ["B9C3",0x59D1],
- ["E6A6",0x59D2],
- ["D0D5",0x59D3],
- ["CEAF",0x59D4],
- ["8A9C",0x59D5],
- ["8A9D",0x59D6],
- ["E6A9",0x59D7],
- ["E6B0",0x59D8],
- ["8A9E",0x59D9],
- ["D2A6",0x59DA],
- ["8A9F",0x59DB],
- ["BDAA",0x59DC],
- ["E6AD",0x59DD],
- ["8AA0",0x59DE],
- ["8AA1",0x59DF],
- ["8AA2",0x59E0],
- ["8AA3",0x59E1],
- ["8AA4",0x59E2],
- ["E6AF",0x59E3],
- ["8AA5",0x59E4],
- ["C0D1",0x59E5],
- ["8AA6",0x59E6],
- ["8AA7",0x59E7],
- ["D2CC",0x59E8],
- ["8AA8",0x59E9],
- ["8AA9",0x59EA],
- ["8AAA",0x59EB],
- ["BCA7",0x59EC],
- ["8AAB",0x59ED],
- ["8AAC",0x59EE],
- ["8AAD",0x59EF],
- ["8AAE",0x59F0],
- ["8AAF",0x59F1],
- ["8AB0",0x59F2],
- ["8AB1",0x59F3],
- ["8AB2",0x59F4],
- ["8AB3",0x59F5],
- ["8AB4",0x59F6],
- ["8AB5",0x59F7],
- ["8AB6",0x59F8],
- ["E6B1",0x59F9],
- ["8AB7",0x59FA],
- ["D2F6",0x59FB],
- ["8AB8",0x59FC],
- ["8AB9",0x59FD],
- ["8ABA",0x59FE],
- ["D7CB",0x59FF],
- ["8ABB",0x5A00],
- ["CDFE",0x5A01],
- ["8ABC",0x5A02],
- ["CDDE",0x5A03],
- ["C2A6",0x5A04],
- ["E6AB",0x5A05],
- ["E6AC",0x5A06],
- ["BDBF",0x5A07],
- ["E6AE",0x5A08],
- ["E6B3",0x5A09],
- ["8ABD",0x5A0A],
- ["8ABE",0x5A0B],
- ["E6B2",0x5A0C],
- ["8ABF",0x5A0D],
- ["8AC0",0x5A0E],
- ["8AC1",0x5A0F],
- ["8AC2",0x5A10],
- ["E6B6",0x5A11],
- ["8AC3",0x5A12],
- ["E6B8",0x5A13],
- ["8AC4",0x5A14],
- ["8AC5",0x5A15],
- ["8AC6",0x5A16],
- ["8AC7",0x5A17],
- ["C4EF",0x5A18],
- ["8AC8",0x5A19],
- ["8AC9",0x5A1A],
- ["8ACA",0x5A1B],
- ["C4C8",0x5A1C],
- ["8ACB",0x5A1D],
- ["8ACC",0x5A1E],
- ["BEEA",0x5A1F],
- ["C9EF",0x5A20],
- ["8ACD",0x5A21],
- ["8ACE",0x5A22],
- ["E6B7",0x5A23],
- ["8ACF",0x5A24],
- ["B6F0",0x5A25],
- ["8AD0",0x5A26],
- ["8AD1",0x5A27],
- ["8AD2",0x5A28],
- ["C3E4",0x5A29],
- ["8AD3",0x5A2A],
- ["8AD4",0x5A2B],
- ["8AD5",0x5A2C],
- ["8AD6",0x5A2D],
- ["8AD7",0x5A2E],
- ["8AD8",0x5A2F],
- ["8AD9",0x5A30],
- ["D3E9",0x5A31],
- ["E6B4",0x5A32],
- ["8ADA",0x5A33],
- ["E6B5",0x5A34],
- ["8ADB",0x5A35],
- ["C8A2",0x5A36],
- ["8ADC",0x5A37],
- ["8ADD",0x5A38],
- ["8ADE",0x5A39],
- ["8ADF",0x5A3A],
- ["8AE0",0x5A3B],
- ["E6BD",0x5A3C],
- ["8AE1",0x5A3D],
- ["8AE2",0x5A3E],
- ["8AE3",0x5A3F],
- ["E6B9",0x5A40],
- ["8AE4",0x5A41],
- ["8AE5",0x5A42],
- ["8AE6",0x5A43],
- ["8AE7",0x5A44],
- ["8AE8",0x5A45],
- ["C6C5",0x5A46],
- ["8AE9",0x5A47],
- ["8AEA",0x5A48],
- ["CDF1",0x5A49],
- ["E6BB",0x5A4A],
- ["8AEB",0x5A4B],
- ["8AEC",0x5A4C],
- ["8AED",0x5A4D],
- ["8AEE",0x5A4E],
- ["8AEF",0x5A4F],
- ["8AF0",0x5A50],
- ["8AF1",0x5A51],
- ["8AF2",0x5A52],
- ["8AF3",0x5A53],
- ["8AF4",0x5A54],
- ["E6BC",0x5A55],
- ["8AF5",0x5A56],
- ["8AF6",0x5A57],
- ["8AF7",0x5A58],
- ["8AF8",0x5A59],
- ["BBE9",0x5A5A],
- ["8AF9",0x5A5B],
- ["8AFA",0x5A5C],
- ["8AFB",0x5A5D],
- ["8AFC",0x5A5E],
- ["8AFD",0x5A5F],
- ["8AFE",0x5A60],
- ["8B40",0x5A61],
- ["E6BE",0x5A62],
- ["8B41",0x5A63],
- ["8B42",0x5A64],
- ["8B43",0x5A65],
- ["8B44",0x5A66],
- ["E6BA",0x5A67],
- ["8B45",0x5A68],
- ["8B46",0x5A69],
- ["C0B7",0x5A6A],
- ["8B47",0x5A6B],
- ["8B48",0x5A6C],
- ["8B49",0x5A6D],
- ["8B4A",0x5A6E],
- ["8B4B",0x5A6F],
- ["8B4C",0x5A70],
- ["8B4D",0x5A71],
- ["8B4E",0x5A72],
- ["8B4F",0x5A73],
- ["D3A4",0x5A74],
- ["E6BF",0x5A75],
- ["C9F4",0x5A76],
- ["E6C3",0x5A77],
- ["8B50",0x5A78],
- ["8B51",0x5A79],
- ["E6C4",0x5A7A],
- ["8B52",0x5A7B],
- ["8B53",0x5A7C],
- ["8B54",0x5A7D],
- ["8B55",0x5A7E],
- ["D0F6",0x5A7F],
- ["8B56",0x5A80],
- ["8B57",0x5A81],
- ["8B58",0x5A82],
- ["8B59",0x5A83],
- ["8B5A",0x5A84],
- ["8B5B",0x5A85],
- ["8B5C",0x5A86],
- ["8B5D",0x5A87],
- ["8B5E",0x5A88],
- ["8B5F",0x5A89],
- ["8B60",0x5A8A],
- ["8B61",0x5A8B],
- ["8B62",0x5A8C],
- ["8B63",0x5A8D],
- ["8B64",0x5A8E],
- ["8B65",0x5A8F],
- ["8B66",0x5A90],
- ["8B67",0x5A91],
- ["C3BD",0x5A92],
- ["8B68",0x5A93],
- ["8B69",0x5A94],
- ["8B6A",0x5A95],
- ["8B6B",0x5A96],
- ["8B6C",0x5A97],
- ["8B6D",0x5A98],
- ["8B6E",0x5A99],
- ["C3C4",0x5A9A],
- ["E6C2",0x5A9B],
- ["8B6F",0x5A9C],
- ["8B70",0x5A9D],
- ["8B71",0x5A9E],
- ["8B72",0x5A9F],
- ["8B73",0x5AA0],
- ["8B74",0x5AA1],
- ["8B75",0x5AA2],
- ["8B76",0x5AA3],
- ["8B77",0x5AA4],
- ["8B78",0x5AA5],
- ["8B79",0x5AA6],
- ["8B7A",0x5AA7],
- ["8B7B",0x5AA8],
- ["8B7C",0x5AA9],
- ["E6C1",0x5AAA],
- ["8B7D",0x5AAB],
- ["8B7E",0x5AAC],
- ["8B80",0x5AAD],
- ["8B81",0x5AAE],
- ["8B82",0x5AAF],
- ["8B83",0x5AB0],
- ["8B84",0x5AB1],
- ["E6C7",0x5AB2],
- ["CFB1",0x5AB3],
- ["8B85",0x5AB4],
- ["EBF4",0x5AB5],
- ["8B86",0x5AB6],
- ["8B87",0x5AB7],
- ["E6CA",0x5AB8],
- ["8B88",0x5AB9],
- ["8B89",0x5ABA],
- ["8B8A",0x5ABB],
- ["8B8B",0x5ABC],
- ["8B8C",0x5ABD],
- ["E6C5",0x5ABE],
- ["8B8D",0x5ABF],
- ["8B8E",0x5AC0],
- ["BCDE",0x5AC1],
- ["C9A9",0x5AC2],
- ["8B8F",0x5AC3],
- ["8B90",0x5AC4],
- ["8B91",0x5AC5],
- ["8B92",0x5AC6],
- ["8B93",0x5AC7],
- ["8B94",0x5AC8],
- ["BCB5",0x5AC9],
- ["8B95",0x5ACA],
- ["8B96",0x5ACB],
- ["CFD3",0x5ACC],
- ["8B97",0x5ACD],
- ["8B98",0x5ACE],
- ["8B99",0x5ACF],
- ["8B9A",0x5AD0],
- ["8B9B",0x5AD1],
- ["E6C8",0x5AD2],
- ["8B9C",0x5AD3],
- ["E6C9",0x5AD4],
- ["8B9D",0x5AD5],
- ["E6CE",0x5AD6],
- ["8B9E",0x5AD7],
- ["E6D0",0x5AD8],
- ["8B9F",0x5AD9],
- ["8BA0",0x5ADA],
- ["8BA1",0x5ADB],
- ["E6D1",0x5ADC],
- ["8BA2",0x5ADD],
- ["8BA3",0x5ADE],
- ["8BA4",0x5ADF],
- ["E6CB",0x5AE0],
- ["B5D5",0x5AE1],
- ["8BA5",0x5AE2],
- ["E6CC",0x5AE3],
- ["8BA6",0x5AE4],
- ["8BA7",0x5AE5],
- ["E6CF",0x5AE6],
- ["8BA8",0x5AE7],
- ["8BA9",0x5AE8],
- ["C4DB",0x5AE9],
- ["8BAA",0x5AEA],
- ["E6C6",0x5AEB],
- ["8BAB",0x5AEC],
- ["8BAC",0x5AED],
- ["8BAD",0x5AEE],
- ["8BAE",0x5AEF],
- ["8BAF",0x5AF0],
- ["E6CD",0x5AF1],
- ["8BB0",0x5AF2],
- ["8BB1",0x5AF3],
- ["8BB2",0x5AF4],
- ["8BB3",0x5AF5],
- ["8BB4",0x5AF6],
- ["8BB5",0x5AF7],
- ["8BB6",0x5AF8],
- ["8BB7",0x5AF9],
- ["8BB8",0x5AFA],
- ["8BB9",0x5AFB],
- ["8BBA",0x5AFC],
- ["8BBB",0x5AFD],
- ["8BBC",0x5AFE],
- ["8BBD",0x5AFF],
- ["8BBE",0x5B00],
- ["8BBF",0x5B01],
- ["8BC0",0x5B02],
- ["8BC1",0x5B03],
- ["8BC2",0x5B04],
- ["8BC3",0x5B05],
- ["8BC4",0x5B06],
- ["8BC5",0x5B07],
- ["8BC6",0x5B08],
- ["E6D2",0x5B09],
- ["8BC7",0x5B0A],
- ["8BC8",0x5B0B],
- ["8BC9",0x5B0C],
- ["8BCA",0x5B0D],
- ["8BCB",0x5B0E],
- ["8BCC",0x5B0F],
- ["8BCD",0x5B10],
- ["8BCE",0x5B11],
- ["8BCF",0x5B12],
- ["8BD0",0x5B13],
- ["8BD1",0x5B14],
- ["8BD2",0x5B15],
- ["E6D4",0x5B16],
- ["E6D3",0x5B17],
- ["8BD3",0x5B18],
- ["8BD4",0x5B19],
- ["8BD5",0x5B1A],
- ["8BD6",0x5B1B],
- ["8BD7",0x5B1C],
- ["8BD8",0x5B1D],
- ["8BD9",0x5B1E],
- ["8BDA",0x5B1F],
- ["8BDB",0x5B20],
- ["8BDC",0x5B21],
- ["8BDD",0x5B22],
- ["8BDE",0x5B23],
- ["8BDF",0x5B24],
- ["8BE0",0x5B25],
- ["8BE1",0x5B26],
- ["8BE2",0x5B27],
- ["8BE3",0x5B28],
- ["8BE4",0x5B29],
- ["8BE5",0x5B2A],
- ["8BE6",0x5B2B],
- ["8BE7",0x5B2C],
- ["8BE8",0x5B2D],
- ["8BE9",0x5B2E],
- ["8BEA",0x5B2F],
- ["8BEB",0x5B30],
- ["8BEC",0x5B31],
- ["E6D5",0x5B32],
- ["8BED",0x5B33],
- ["D9F8",0x5B34],
- ["8BEE",0x5B35],
- ["8BEF",0x5B36],
- ["E6D6",0x5B37],
- ["8BF0",0x5B38],
- ["8BF1",0x5B39],
- ["8BF2",0x5B3A],
- ["8BF3",0x5B3B],
- ["8BF4",0x5B3C],
- ["8BF5",0x5B3D],
- ["8BF6",0x5B3E],
- ["8BF7",0x5B3F],
- ["E6D7",0x5B40],
- ["8BF8",0x5B41],
- ["8BF9",0x5B42],
- ["8BFA",0x5B43],
- ["8BFB",0x5B44],
- ["8BFC",0x5B45],
- ["8BFD",0x5B46],
- ["8BFE",0x5B47],
- ["8C40",0x5B48],
- ["8C41",0x5B49],
- ["8C42",0x5B4A],
- ["8C43",0x5B4B],
- ["8C44",0x5B4C],
- ["8C45",0x5B4D],
- ["8C46",0x5B4E],
- ["8C47",0x5B4F],
- ["D7D3",0x5B50],
- ["E6DD",0x5B51],
- ["8C48",0x5B52],
- ["E6DE",0x5B53],
- ["BFD7",0x5B54],
- ["D4D0",0x5B55],
- ["8C49",0x5B56],
- ["D7D6",0x5B57],
- ["B4E6",0x5B58],
- ["CBEF",0x5B59],
- ["E6DA",0x5B5A],
- ["D8C3",0x5B5B],
- ["D7CE",0x5B5C],
- ["D0A2",0x5B5D],
- ["8C4A",0x5B5E],
- ["C3CF",0x5B5F],
- ["8C4B",0x5B60],
- ["8C4C",0x5B61],
- ["E6DF",0x5B62],
- ["BCBE",0x5B63],
- ["B9C2",0x5B64],
- ["E6DB",0x5B65],
- ["D1A7",0x5B66],
- ["8C4D",0x5B67],
- ["8C4E",0x5B68],
- ["BAA2",0x5B69],
- ["C2CF",0x5B6A],
- ["8C4F",0x5B6B],
- ["D8AB",0x5B6C],
- ["8C50",0x5B6D],
- ["8C51",0x5B6E],
- ["8C52",0x5B6F],
- ["CAEB",0x5B70],
- ["E5EE",0x5B71],
- ["8C53",0x5B72],
- ["E6DC",0x5B73],
- ["8C54",0x5B74],
- ["B7F5",0x5B75],
- ["8C55",0x5B76],
- ["8C56",0x5B77],
- ["8C57",0x5B78],
- ["8C58",0x5B79],
- ["C8E6",0x5B7A],
- ["8C59",0x5B7B],
- ["8C5A",0x5B7C],
- ["C4F5",0x5B7D],
- ["8C5B",0x5B7E],
- ["8C5C",0x5B7F],
- ["E5B2",0x5B80],
- ["C4FE",0x5B81],
- ["8C5D",0x5B82],
- ["CBFC",0x5B83],
- ["E5B3",0x5B84],
- ["D5AC",0x5B85],
- ["8C5E",0x5B86],
- ["D3EE",0x5B87],
- ["CAD8",0x5B88],
- ["B0B2",0x5B89],
- ["8C5F",0x5B8A],
- ["CBCE",0x5B8B],
- ["CDEA",0x5B8C],
- ["8C60",0x5B8D],
- ["8C61",0x5B8E],
- ["BAEA",0x5B8F],
- ["8C62",0x5B90],
- ["8C63",0x5B91],
- ["8C64",0x5B92],
- ["E5B5",0x5B93],
- ["8C65",0x5B94],
- ["E5B4",0x5B95],
- ["8C66",0x5B96],
- ["D7DA",0x5B97],
- ["B9D9",0x5B98],
- ["D6E6",0x5B99],
- ["B6A8",0x5B9A],
- ["CDF0",0x5B9B],
- ["D2CB",0x5B9C],
- ["B1A6",0x5B9D],
- ["CAB5",0x5B9E],
- ["8C67",0x5B9F],
- ["B3E8",0x5BA0],
- ["C9F3",0x5BA1],
- ["BFCD",0x5BA2],
- ["D0FB",0x5BA3],
- ["CAD2",0x5BA4],
- ["E5B6",0x5BA5],
- ["BBC2",0x5BA6],
- ["8C68",0x5BA7],
- ["8C69",0x5BA8],
- ["8C6A",0x5BA9],
- ["CFDC",0x5BAA],
- ["B9AC",0x5BAB],
- ["8C6B",0x5BAC],
- ["8C6C",0x5BAD],
- ["8C6D",0x5BAE],
- ["8C6E",0x5BAF],
- ["D4D7",0x5BB0],
- ["8C6F",0x5BB1],
- ["8C70",0x5BB2],
- ["BAA6",0x5BB3],
- ["D1E7",0x5BB4],
- ["CFFC",0x5BB5],
- ["BCD2",0x5BB6],
- ["8C71",0x5BB7],
- ["E5B7",0x5BB8],
- ["C8DD",0x5BB9],
- ["8C72",0x5BBA],
- ["8C73",0x5BBB],
- ["8C74",0x5BBC],
- ["BFED",0x5BBD],
- ["B1F6",0x5BBE],
- ["CBDE",0x5BBF],
- ["8C75",0x5BC0],
- ["8C76",0x5BC1],
- ["BCC5",0x5BC2],
- ["8C77",0x5BC3],
- ["BCC4",0x5BC4],
- ["D2FA",0x5BC5],
- ["C3DC",0x5BC6],
- ["BFDC",0x5BC7],
- ["8C78",0x5BC8],
- ["8C79",0x5BC9],
- ["8C7A",0x5BCA],
- ["8C7B",0x5BCB],
- ["B8BB",0x5BCC],
- ["8C7C",0x5BCD],
- ["8C7D",0x5BCE],
- ["8C7E",0x5BCF],
- ["C3C2",0x5BD0],
- ["8C80",0x5BD1],
- ["BAAE",0x5BD2],
- ["D4A2",0x5BD3],
- ["8C81",0x5BD4],
- ["8C82",0x5BD5],
- ["8C83",0x5BD6],
- ["8C84",0x5BD7],
- ["8C85",0x5BD8],
- ["8C86",0x5BD9],
- ["8C87",0x5BDA],
- ["8C88",0x5BDB],
- ["8C89",0x5BDC],
- ["C7DE",0x5BDD],
- ["C4AF",0x5BDE],
- ["B2EC",0x5BDF],
- ["8C8A",0x5BE0],
- ["B9D1",0x5BE1],
- ["8C8B",0x5BE2],
- ["8C8C",0x5BE3],
- ["E5BB",0x5BE4],
- ["C1C8",0x5BE5],
- ["8C8D",0x5BE6],
- ["8C8E",0x5BE7],
- ["D5AF",0x5BE8],
- ["8C8F",0x5BE9],
- ["8C90",0x5BEA],
- ["8C91",0x5BEB],
- ["8C92",0x5BEC],
- ["8C93",0x5BED],
- ["E5BC",0x5BEE],
- ["8C94",0x5BEF],
- ["E5BE",0x5BF0],
- ["8C95",0x5BF1],
- ["8C96",0x5BF2],
- ["8C97",0x5BF3],
- ["8C98",0x5BF4],
- ["8C99",0x5BF5],
- ["8C9A",0x5BF6],
- ["8C9B",0x5BF7],
- ["B4E7",0x5BF8],
- ["B6D4",0x5BF9],
- ["CBC2",0x5BFA],
- ["D1B0",0x5BFB],
- ["B5BC",0x5BFC],
- ["8C9C",0x5BFD],
- ["8C9D",0x5BFE],
- ["CAD9",0x5BFF],
- ["8C9E",0x5C00],
- ["B7E2",0x5C01],
- ["8C9F",0x5C02],
- ["8CA0",0x5C03],
- ["C9E4",0x5C04],
- ["8CA1",0x5C05],
- ["BDAB",0x5C06],
- ["8CA2",0x5C07],
- ["8CA3",0x5C08],
- ["CEBE",0x5C09],
- ["D7F0",0x5C0A],
- ["8CA4",0x5C0B],
- ["8CA5",0x5C0C],
- ["8CA6",0x5C0D],
- ["8CA7",0x5C0E],
- ["D0A1",0x5C0F],
- ["8CA8",0x5C10],
- ["C9D9",0x5C11],
- ["8CA9",0x5C12],
- ["8CAA",0x5C13],
- ["B6FB",0x5C14],
- ["E6D8",0x5C15],
- ["BCE2",0x5C16],
- ["8CAB",0x5C17],
- ["B3BE",0x5C18],
- ["8CAC",0x5C19],
- ["C9D0",0x5C1A],
- ["8CAD",0x5C1B],
- ["E6D9",0x5C1C],
- ["B3A2",0x5C1D],
- ["8CAE",0x5C1E],
- ["8CAF",0x5C1F],
- ["8CB0",0x5C20],
- ["8CB1",0x5C21],
- ["DECC",0x5C22],
- ["8CB2",0x5C23],
- ["D3C8",0x5C24],
- ["DECD",0x5C25],
- ["8CB3",0x5C26],
- ["D2A2",0x5C27],
- ["8CB4",0x5C28],
- ["8CB5",0x5C29],
- ["8CB6",0x5C2A],
- ["8CB7",0x5C2B],
- ["DECE",0x5C2C],
- ["8CB8",0x5C2D],
- ["8CB9",0x5C2E],
- ["8CBA",0x5C2F],
- ["8CBB",0x5C30],
- ["BECD",0x5C31],
- ["8CBC",0x5C32],
- ["8CBD",0x5C33],
- ["DECF",0x5C34],
- ["8CBE",0x5C35],
- ["8CBF",0x5C36],
- ["8CC0",0x5C37],
- ["CAAC",0x5C38],
- ["D2FC",0x5C39],
- ["B3DF",0x5C3A],
- ["E5EA",0x5C3B],
- ["C4E1",0x5C3C],
- ["BEA1",0x5C3D],
- ["CEB2",0x5C3E],
- ["C4F2",0x5C3F],
- ["BED6",0x5C40],
- ["C6A8",0x5C41],
- ["B2E3",0x5C42],
- ["8CC1",0x5C43],
- ["8CC2",0x5C44],
- ["BED3",0x5C45],
- ["8CC3",0x5C46],
- ["8CC4",0x5C47],
- ["C7FC",0x5C48],
- ["CCEB",0x5C49],
- ["BDEC",0x5C4A],
- ["CEDD",0x5C4B],
- ["8CC5",0x5C4C],
- ["8CC6",0x5C4D],
- ["CABA",0x5C4E],
- ["C6C1",0x5C4F],
- ["E5EC",0x5C50],
- ["D0BC",0x5C51],
- ["8CC7",0x5C52],
- ["8CC8",0x5C53],
- ["8CC9",0x5C54],
- ["D5B9",0x5C55],
- ["8CCA",0x5C56],
- ["8CCB",0x5C57],
- ["8CCC",0x5C58],
- ["E5ED",0x5C59],
- ["8CCD",0x5C5A],
- ["8CCE",0x5C5B],
- ["8CCF",0x5C5C],
- ["8CD0",0x5C5D],
- ["CAF4",0x5C5E],
- ["8CD1",0x5C5F],
- ["CDC0",0x5C60],
- ["C2C5",0x5C61],
- ["8CD2",0x5C62],
- ["E5EF",0x5C63],
- ["8CD3",0x5C64],
- ["C2C4",0x5C65],
- ["E5F0",0x5C66],
- ["8CD4",0x5C67],
- ["8CD5",0x5C68],
- ["8CD6",0x5C69],
- ["8CD7",0x5C6A],
- ["8CD8",0x5C6B],
- ["8CD9",0x5C6C],
- ["8CDA",0x5C6D],
- ["E5F8",0x5C6E],
- ["CDCD",0x5C6F],
- ["8CDB",0x5C70],
- ["C9BD",0x5C71],
- ["8CDC",0x5C72],
- ["8CDD",0x5C73],
- ["8CDE",0x5C74],
- ["8CDF",0x5C75],
- ["8CE0",0x5C76],
- ["8CE1",0x5C77],
- ["8CE2",0x5C78],
- ["D2D9",0x5C79],
- ["E1A8",0x5C7A],
- ["8CE3",0x5C7B],
- ["8CE4",0x5C7C],
- ["8CE5",0x5C7D],
- ["8CE6",0x5C7E],
- ["D3EC",0x5C7F],
- ["8CE7",0x5C80],
- ["CBEA",0x5C81],
- ["C6F1",0x5C82],
- ["8CE8",0x5C83],
- ["8CE9",0x5C84],
- ["8CEA",0x5C85],
- ["8CEB",0x5C86],
- ["8CEC",0x5C87],
- ["E1AC",0x5C88],
- ["8CED",0x5C89],
- ["8CEE",0x5C8A],
- ["8CEF",0x5C8B],
- ["E1A7",0x5C8C],
- ["E1A9",0x5C8D],
- ["8CF0",0x5C8E],
- ["8CF1",0x5C8F],
- ["E1AA",0x5C90],
- ["E1AF",0x5C91],
- ["8CF2",0x5C92],
- ["8CF3",0x5C93],
- ["B2ED",0x5C94],
- ["8CF4",0x5C95],
- ["E1AB",0x5C96],
- ["B8DA",0x5C97],
- ["E1AD",0x5C98],
- ["E1AE",0x5C99],
- ["E1B0",0x5C9A],
- ["B5BA",0x5C9B],
- ["E1B1",0x5C9C],
- ["8CF5",0x5C9D],
- ["8CF6",0x5C9E],
- ["8CF7",0x5C9F],
- ["8CF8",0x5CA0],
- ["8CF9",0x5CA1],
- ["E1B3",0x5CA2],
- ["E1B8",0x5CA3],
- ["8CFA",0x5CA4],
- ["8CFB",0x5CA5],
- ["8CFC",0x5CA6],
- ["8CFD",0x5CA7],
- ["8CFE",0x5CA8],
- ["D1D2",0x5CA9],
- ["8D40",0x5CAA],
- ["E1B6",0x5CAB],
- ["E1B5",0x5CAC],
- ["C1EB",0x5CAD],
- ["8D41",0x5CAE],
- ["8D42",0x5CAF],
- ["8D43",0x5CB0],
- ["E1B7",0x5CB1],
- ["8D44",0x5CB2],
- ["D4C0",0x5CB3],
- ["8D45",0x5CB4],
- ["E1B2",0x5CB5],
- ["8D46",0x5CB6],
- ["E1BA",0x5CB7],
- ["B0B6",0x5CB8],
- ["8D47",0x5CB9],
- ["8D48",0x5CBA],
- ["8D49",0x5CBB],
- ["8D4A",0x5CBC],
- ["E1B4",0x5CBD],
- ["8D4B",0x5CBE],
- ["BFF9",0x5CBF],
- ["8D4C",0x5CC0],
- ["E1B9",0x5CC1],
- ["8D4D",0x5CC2],
- ["8D4E",0x5CC3],
- ["E1BB",0x5CC4],
- ["8D4F",0x5CC5],
- ["8D50",0x5CC6],
- ["8D51",0x5CC7],
- ["8D52",0x5CC8],
- ["8D53",0x5CC9],
- ["8D54",0x5CCA],
- ["E1BE",0x5CCB],
- ["8D55",0x5CCC],
- ["8D56",0x5CCD],
- ["8D57",0x5CCE],
- ["8D58",0x5CCF],
- ["8D59",0x5CD0],
- ["8D5A",0x5CD1],
- ["E1BC",0x5CD2],
- ["8D5B",0x5CD3],
- ["8D5C",0x5CD4],
- ["8D5D",0x5CD5],
- ["8D5E",0x5CD6],
- ["8D5F",0x5CD7],
- ["8D60",0x5CD8],
- ["D6C5",0x5CD9],
- ["8D61",0x5CDA],
- ["8D62",0x5CDB],
- ["8D63",0x5CDC],
- ["8D64",0x5CDD],
- ["8D65",0x5CDE],
- ["8D66",0x5CDF],
- ["8D67",0x5CE0],
- ["CFBF",0x5CE1],
- ["8D68",0x5CE2],
- ["8D69",0x5CE3],
- ["E1BD",0x5CE4],
- ["E1BF",0x5CE5],
- ["C2CD",0x5CE6],
- ["8D6A",0x5CE7],
- ["B6EB",0x5CE8],
- ["8D6B",0x5CE9],
- ["D3F8",0x5CEA],
- ["8D6C",0x5CEB],
- ["8D6D",0x5CEC],
- ["C7CD",0x5CED],
- ["8D6E",0x5CEE],
- ["8D6F",0x5CEF],
- ["B7E5",0x5CF0],
- ["8D70",0x5CF1],
- ["8D71",0x5CF2],
- ["8D72",0x5CF3],
- ["8D73",0x5CF4],
- ["8D74",0x5CF5],
- ["8D75",0x5CF6],
- ["8D76",0x5CF7],
- ["8D77",0x5CF8],
- ["8D78",0x5CF9],
- ["8D79",0x5CFA],
- ["BEFE",0x5CFB],
- ["8D7A",0x5CFC],
- ["8D7B",0x5CFD],
- ["8D7C",0x5CFE],
- ["8D7D",0x5CFF],
- ["8D7E",0x5D00],
- ["8D80",0x5D01],
- ["E1C0",0x5D02],
- ["E1C1",0x5D03],
- ["8D81",0x5D04],
- ["8D82",0x5D05],
- ["E1C7",0x5D06],
- ["B3E7",0x5D07],
- ["8D83",0x5D08],
- ["8D84",0x5D09],
- ["8D85",0x5D0A],
- ["8D86",0x5D0B],
- ["8D87",0x5D0C],
- ["8D88",0x5D0D],
- ["C6E9",0x5D0E],
- ["8D89",0x5D0F],
- ["8D8A",0x5D10],
- ["8D8B",0x5D11],
- ["8D8C",0x5D12],
- ["8D8D",0x5D13],
- ["B4DE",0x5D14],
- ["8D8E",0x5D15],
- ["D1C2",0x5D16],
- ["8D8F",0x5D17],
- ["8D90",0x5D18],
- ["8D91",0x5D19],
- ["8D92",0x5D1A],
- ["E1C8",0x5D1B],
- ["8D93",0x5D1C],
- ["8D94",0x5D1D],
- ["E1C6",0x5D1E],
- ["8D95",0x5D1F],
- ["8D96",0x5D20],
- ["8D97",0x5D21],
- ["8D98",0x5D22],
- ["8D99",0x5D23],
- ["E1C5",0x5D24],
- ["8D9A",0x5D25],
- ["E1C3",0x5D26],
- ["E1C2",0x5D27],
- ["8D9B",0x5D28],
- ["B1C0",0x5D29],
- ["8D9C",0x5D2A],
- ["8D9D",0x5D2B],
- ["8D9E",0x5D2C],
- ["D5B8",0x5D2D],
- ["E1C4",0x5D2E],
- ["8D9F",0x5D2F],
- ["8DA0",0x5D30],
- ["8DA1",0x5D31],
- ["8DA2",0x5D32],
- ["8DA3",0x5D33],
- ["E1CB",0x5D34],
- ["8DA4",0x5D35],
- ["8DA5",0x5D36],
- ["8DA6",0x5D37],
- ["8DA7",0x5D38],
- ["8DA8",0x5D39],
- ["8DA9",0x5D3A],
- ["8DAA",0x5D3B],
- ["8DAB",0x5D3C],
- ["E1CC",0x5D3D],
- ["E1CA",0x5D3E],
- ["8DAC",0x5D3F],
- ["8DAD",0x5D40],
- ["8DAE",0x5D41],
- ["8DAF",0x5D42],
- ["8DB0",0x5D43],
- ["8DB1",0x5D44],
- ["8DB2",0x5D45],
- ["8DB3",0x5D46],
- ["EFFA",0x5D47],
- ["8DB4",0x5D48],
- ["8DB5",0x5D49],
- ["E1D3",0x5D4A],
- ["E1D2",0x5D4B],
- ["C7B6",0x5D4C],
- ["8DB6",0x5D4D],
- ["8DB7",0x5D4E],
- ["8DB8",0x5D4F],
- ["8DB9",0x5D50],
- ["8DBA",0x5D51],
- ["8DBB",0x5D52],
- ["8DBC",0x5D53],
- ["8DBD",0x5D54],
- ["8DBE",0x5D55],
- ["8DBF",0x5D56],
- ["8DC0",0x5D57],
- ["E1C9",0x5D58],
- ["8DC1",0x5D59],
- ["8DC2",0x5D5A],
- ["E1CE",0x5D5B],
- ["8DC3",0x5D5C],
- ["E1D0",0x5D5D],
- ["8DC4",0x5D5E],
- ["8DC5",0x5D5F],
- ["8DC6",0x5D60],
- ["8DC7",0x5D61],
- ["8DC8",0x5D62],
- ["8DC9",0x5D63],
- ["8DCA",0x5D64],
- ["8DCB",0x5D65],
- ["8DCC",0x5D66],
- ["8DCD",0x5D67],
- ["8DCE",0x5D68],
- ["E1D4",0x5D69],
- ["8DCF",0x5D6A],
- ["E1D1",0x5D6B],
- ["E1CD",0x5D6C],
- ["8DD0",0x5D6D],
- ["8DD1",0x5D6E],
- ["E1CF",0x5D6F],
- ["8DD2",0x5D70],
- ["8DD3",0x5D71],
- ["8DD4",0x5D72],
- ["8DD5",0x5D73],
- ["E1D5",0x5D74],
- ["8DD6",0x5D75],
- ["8DD7",0x5D76],
- ["8DD8",0x5D77],
- ["8DD9",0x5D78],
- ["8DDA",0x5D79],
- ["8DDB",0x5D7A],
- ["8DDC",0x5D7B],
- ["8DDD",0x5D7C],
- ["8DDE",0x5D7D],
- ["8DDF",0x5D7E],
- ["8DE0",0x5D7F],
- ["8DE1",0x5D80],
- ["8DE2",0x5D81],
- ["E1D6",0x5D82],
- ["8DE3",0x5D83],
- ["8DE4",0x5D84],
- ["8DE5",0x5D85],
- ["8DE6",0x5D86],
- ["8DE7",0x5D87],
- ["8DE8",0x5D88],
- ["8DE9",0x5D89],
- ["8DEA",0x5D8A],
- ["8DEB",0x5D8B],
- ["8DEC",0x5D8C],
- ["8DED",0x5D8D],
- ["8DEE",0x5D8E],
- ["8DEF",0x5D8F],
- ["8DF0",0x5D90],
- ["8DF1",0x5D91],
- ["8DF2",0x5D92],
- ["8DF3",0x5D93],
- ["8DF4",0x5D94],
- ["8DF5",0x5D95],
- ["8DF6",0x5D96],
- ["8DF7",0x5D97],
- ["8DF8",0x5D98],
- ["E1D7",0x5D99],
- ["8DF9",0x5D9A],
- ["8DFA",0x5D9B],
- ["8DFB",0x5D9C],
- ["E1D8",0x5D9D],
- ["8DFC",0x5D9E],
- ["8DFD",0x5D9F],
- ["8DFE",0x5DA0],
- ["8E40",0x5DA1],
- ["8E41",0x5DA2],
- ["8E42",0x5DA3],
- ["8E43",0x5DA4],
- ["8E44",0x5DA5],
- ["8E45",0x5DA6],
- ["8E46",0x5DA7],
- ["8E47",0x5DA8],
- ["8E48",0x5DA9],
- ["8E49",0x5DAA],
- ["8E4A",0x5DAB],
- ["8E4B",0x5DAC],
- ["8E4C",0x5DAD],
- ["8E4D",0x5DAE],
- ["8E4E",0x5DAF],
- ["8E4F",0x5DB0],
- ["8E50",0x5DB1],
- ["8E51",0x5DB2],
- ["8E52",0x5DB3],
- ["8E53",0x5DB4],
- ["8E54",0x5DB5],
- ["8E55",0x5DB6],
- ["E1DA",0x5DB7],
- ["8E56",0x5DB8],
- ["8E57",0x5DB9],
- ["8E58",0x5DBA],
- ["8E59",0x5DBB],
- ["8E5A",0x5DBC],
- ["8E5B",0x5DBD],
- ["8E5C",0x5DBE],
- ["8E5D",0x5DBF],
- ["8E5E",0x5DC0],
- ["8E5F",0x5DC1],
- ["8E60",0x5DC2],
- ["8E61",0x5DC3],
- ["8E62",0x5DC4],
- ["E1DB",0x5DC5],
- ["8E63",0x5DC6],
- ["8E64",0x5DC7],
- ["8E65",0x5DC8],
- ["8E66",0x5DC9],
- ["8E67",0x5DCA],
- ["8E68",0x5DCB],
- ["8E69",0x5DCC],
- ["CEA1",0x5DCD],
- ["8E6A",0x5DCE],
- ["8E6B",0x5DCF],
- ["8E6C",0x5DD0],
- ["8E6D",0x5DD1],
- ["8E6E",0x5DD2],
- ["8E6F",0x5DD3],
- ["8E70",0x5DD4],
- ["8E71",0x5DD5],
- ["8E72",0x5DD6],
- ["8E73",0x5DD7],
- ["8E74",0x5DD8],
- ["8E75",0x5DD9],
- ["8E76",0x5DDA],
- ["E7DD",0x5DDB],
- ["8E77",0x5DDC],
- ["B4A8",0x5DDD],
- ["D6DD",0x5DDE],
- ["8E78",0x5DDF],
- ["8E79",0x5DE0],
- ["D1B2",0x5DE1],
- ["B3B2",0x5DE2],
- ["8E7A",0x5DE3],
- ["8E7B",0x5DE4],
- ["B9A4",0x5DE5],
- ["D7F3",0x5DE6],
- ["C7C9",0x5DE7],
- ["BEDE",0x5DE8],
- ["B9AE",0x5DE9],
- ["8E7C",0x5DEA],
- ["CED7",0x5DEB],
- ["8E7D",0x5DEC],
- ["8E7E",0x5DED],
- ["B2EE",0x5DEE],
- ["DBCF",0x5DEF],
- ["8E80",0x5DF0],
- ["BCBA",0x5DF1],
- ["D2D1",0x5DF2],
- ["CBC8",0x5DF3],
- ["B0CD",0x5DF4],
- ["8E81",0x5DF5],
- ["8E82",0x5DF6],
- ["CFEF",0x5DF7],
- ["8E83",0x5DF8],
- ["8E84",0x5DF9],
- ["8E85",0x5DFA],
- ["8E86",0x5DFB],
- ["8E87",0x5DFC],
- ["D9E3",0x5DFD],
- ["BDED",0x5DFE],
- ["8E88",0x5DFF],
- ["8E89",0x5E00],
- ["B1D2",0x5E01],
- ["CAD0",0x5E02],
- ["B2BC",0x5E03],
- ["8E8A",0x5E04],
- ["CBA7",0x5E05],
- ["B7AB",0x5E06],
- ["8E8B",0x5E07],
- ["CAA6",0x5E08],
- ["8E8C",0x5E09],
- ["8E8D",0x5E0A],
- ["8E8E",0x5E0B],
- ["CFA3",0x5E0C],
- ["8E8F",0x5E0D],
- ["8E90",0x5E0E],
- ["E0F8",0x5E0F],
- ["D5CA",0x5E10],
- ["E0FB",0x5E11],
- ["8E91",0x5E12],
- ["8E92",0x5E13],
- ["E0FA",0x5E14],
- ["C5C1",0x5E15],
- ["CCFB",0x5E16],
- ["8E93",0x5E17],
- ["C1B1",0x5E18],
- ["E0F9",0x5E19],
- ["D6E3",0x5E1A],
- ["B2AF",0x5E1B],
- ["D6C4",0x5E1C],
- ["B5DB",0x5E1D],
- ["8E94",0x5E1E],
- ["8E95",0x5E1F],
- ["8E96",0x5E20],
- ["8E97",0x5E21],
- ["8E98",0x5E22],
- ["8E99",0x5E23],
- ["8E9A",0x5E24],
- ["8E9B",0x5E25],
- ["B4F8",0x5E26],
- ["D6A1",0x5E27],
- ["8E9C",0x5E28],
- ["8E9D",0x5E29],
- ["8E9E",0x5E2A],
- ["8E9F",0x5E2B],
- ["8EA0",0x5E2C],
- ["CFAF",0x5E2D],
- ["B0EF",0x5E2E],
- ["8EA1",0x5E2F],
- ["8EA2",0x5E30],
- ["E0FC",0x5E31],
- ["8EA3",0x5E32],
- ["8EA4",0x5E33],
- ["8EA5",0x5E34],
- ["8EA6",0x5E35],
- ["8EA7",0x5E36],
- ["E1A1",0x5E37],
- ["B3A3",0x5E38],
- ["8EA8",0x5E39],
- ["8EA9",0x5E3A],
- ["E0FD",0x5E3B],
- ["E0FE",0x5E3C],
- ["C3B1",0x5E3D],
- ["8EAA",0x5E3E],
- ["8EAB",0x5E3F],
- ["8EAC",0x5E40],
- ["8EAD",0x5E41],
- ["C3DD",0x5E42],
- ["8EAE",0x5E43],
- ["E1A2",0x5E44],
- ["B7F9",0x5E45],
- ["8EAF",0x5E46],
- ["8EB0",0x5E47],
- ["8EB1",0x5E48],
- ["8EB2",0x5E49],
- ["8EB3",0x5E4A],
- ["8EB4",0x5E4B],
- ["BBCF",0x5E4C],
- ["8EB5",0x5E4D],
- ["8EB6",0x5E4E],
- ["8EB7",0x5E4F],
- ["8EB8",0x5E50],
- ["8EB9",0x5E51],
- ["8EBA",0x5E52],
- ["8EBB",0x5E53],
- ["E1A3",0x5E54],
- ["C4BB",0x5E55],
- ["8EBC",0x5E56],
- ["8EBD",0x5E57],
- ["8EBE",0x5E58],
- ["8EBF",0x5E59],
- ["8EC0",0x5E5A],
- ["E1A4",0x5E5B],
- ["8EC1",0x5E5C],
- ["8EC2",0x5E5D],
- ["E1A5",0x5E5E],
- ["8EC3",0x5E5F],
- ["8EC4",0x5E60],
- ["E1A6",0x5E61],
- ["B4B1",0x5E62],
- ["8EC5",0x5E63],
- ["8EC6",0x5E64],
- ["8EC7",0x5E65],
- ["8EC8",0x5E66],
- ["8EC9",0x5E67],
- ["8ECA",0x5E68],
- ["8ECB",0x5E69],
- ["8ECC",0x5E6A],
- ["8ECD",0x5E6B],
- ["8ECE",0x5E6C],
- ["8ECF",0x5E6D],
- ["8ED0",0x5E6E],
- ["8ED1",0x5E6F],
- ["8ED2",0x5E70],
- ["8ED3",0x5E71],
- ["B8C9",0x5E72],
- ["C6BD",0x5E73],
- ["C4EA",0x5E74],
- ["8ED4",0x5E75],
- ["B2A2",0x5E76],
- ["8ED5",0x5E77],
- ["D0D2",0x5E78],
- ["8ED6",0x5E79],
- ["E7DB",0x5E7A],
- ["BBC3",0x5E7B],
- ["D3D7",0x5E7C],
- ["D3C4",0x5E7D],
- ["8ED7",0x5E7E],
- ["B9E3",0x5E7F],
- ["E2CF",0x5E80],
- ["8ED8",0x5E81],
- ["8ED9",0x5E82],
- ["8EDA",0x5E83],
- ["D7AF",0x5E84],
- ["8EDB",0x5E85],
- ["C7EC",0x5E86],
- ["B1D3",0x5E87],
- ["8EDC",0x5E88],
- ["8EDD",0x5E89],
- ["B4B2",0x5E8A],
- ["E2D1",0x5E8B],
- ["8EDE",0x5E8C],
- ["8EDF",0x5E8D],
- ["8EE0",0x5E8E],
- ["D0F2",0x5E8F],
- ["C2AE",0x5E90],
- ["E2D0",0x5E91],
- ["8EE1",0x5E92],
- ["BFE2",0x5E93],
- ["D3A6",0x5E94],
- ["B5D7",0x5E95],
- ["E2D2",0x5E96],
- ["B5EA",0x5E97],
- ["8EE2",0x5E98],
- ["C3ED",0x5E99],
- ["B8FD",0x5E9A],
- ["8EE3",0x5E9B],
- ["B8AE",0x5E9C],
- ["8EE4",0x5E9D],
- ["C5D3",0x5E9E],
- ["B7CF",0x5E9F],
- ["E2D4",0x5EA0],
- ["8EE5",0x5EA1],
- ["8EE6",0x5EA2],
- ["8EE7",0x5EA3],
- ["8EE8",0x5EA4],
- ["E2D3",0x5EA5],
- ["B6C8",0x5EA6],
- ["D7F9",0x5EA7],
- ["8EE9",0x5EA8],
- ["8EEA",0x5EA9],
- ["8EEB",0x5EAA],
- ["8EEC",0x5EAB],
- ["8EED",0x5EAC],
- ["CDA5",0x5EAD],
- ["8EEE",0x5EAE],
- ["8EEF",0x5EAF],
- ["8EF0",0x5EB0],
- ["8EF1",0x5EB1],
- ["8EF2",0x5EB2],
- ["E2D8",0x5EB3],
- ["8EF3",0x5EB4],
- ["E2D6",0x5EB5],
- ["CAFC",0x5EB6],
- ["BFB5",0x5EB7],
- ["D3B9",0x5EB8],
- ["E2D5",0x5EB9],
- ["8EF4",0x5EBA],
- ["8EF5",0x5EBB],
- ["8EF6",0x5EBC],
- ["8EF7",0x5EBD],
- ["E2D7",0x5EBE],
- ["8EF8",0x5EBF],
- ["8EF9",0x5EC0],
- ["8EFA",0x5EC1],
- ["8EFB",0x5EC2],
- ["8EFC",0x5EC3],
- ["8EFD",0x5EC4],
- ["8EFE",0x5EC5],
- ["8F40",0x5EC6],
- ["8F41",0x5EC7],
- ["8F42",0x5EC8],
- ["C1AE",0x5EC9],
- ["C0C8",0x5ECA],
- ["8F43",0x5ECB],
- ["8F44",0x5ECC],
- ["8F45",0x5ECD],
- ["8F46",0x5ECE],
- ["8F47",0x5ECF],
- ["8F48",0x5ED0],
- ["E2DB",0x5ED1],
- ["E2DA",0x5ED2],
- ["C0AA",0x5ED3],
- ["8F49",0x5ED4],
- ["8F4A",0x5ED5],
- ["C1CE",0x5ED6],
- ["8F4B",0x5ED7],
- ["8F4C",0x5ED8],
- ["8F4D",0x5ED9],
- ["8F4E",0x5EDA],
- ["E2DC",0x5EDB],
- ["8F4F",0x5EDC],
- ["8F50",0x5EDD],
- ["8F51",0x5EDE],
- ["8F52",0x5EDF],
- ["8F53",0x5EE0],
- ["8F54",0x5EE1],
- ["8F55",0x5EE2],
- ["8F56",0x5EE3],
- ["8F57",0x5EE4],
- ["8F58",0x5EE5],
- ["8F59",0x5EE6],
- ["8F5A",0x5EE7],
- ["E2DD",0x5EE8],
- ["8F5B",0x5EE9],
- ["E2DE",0x5EEA],
- ["8F5C",0x5EEB],
- ["8F5D",0x5EEC],
- ["8F5E",0x5EED],
- ["8F5F",0x5EEE],
- ["8F60",0x5EEF],
- ["8F61",0x5EF0],
- ["8F62",0x5EF1],
- ["8F63",0x5EF2],
- ["8F64",0x5EF3],
- ["DBC8",0x5EF4],
- ["8F65",0x5EF5],
- ["D1D3",0x5EF6],
- ["CDA2",0x5EF7],
- ["8F66",0x5EF8],
- ["8F67",0x5EF9],
- ["BDA8",0x5EFA],
- ["8F68",0x5EFB],
- ["8F69",0x5EFC],
- ["8F6A",0x5EFD],
- ["DEC3",0x5EFE],
- ["D8A5",0x5EFF],
- ["BFAA",0x5F00],
- ["DBCD",0x5F01],
- ["D2EC",0x5F02],
- ["C6FA",0x5F03],
- ["C5AA",0x5F04],
- ["8F6B",0x5F05],
- ["8F6C",0x5F06],
- ["8F6D",0x5F07],
- ["DEC4",0x5F08],
- ["8F6E",0x5F09],
- ["B1D7",0x5F0A],
- ["DFAE",0x5F0B],
- ["8F6F",0x5F0C],
- ["8F70",0x5F0D],
- ["8F71",0x5F0E],
- ["CABD",0x5F0F],
- ["8F72",0x5F10],
- ["DFB1",0x5F11],
- ["8F73",0x5F12],
- ["B9AD",0x5F13],
- ["8F74",0x5F14],
- ["D2FD",0x5F15],
- ["8F75",0x5F16],
- ["B8A5",0x5F17],
- ["BAEB",0x5F18],
- ["8F76",0x5F19],
- ["8F77",0x5F1A],
- ["B3DA",0x5F1B],
- ["8F78",0x5F1C],
- ["8F79",0x5F1D],
- ["8F7A",0x5F1E],
- ["B5DC",0x5F1F],
- ["D5C5",0x5F20],
- ["8F7B",0x5F21],
- ["8F7C",0x5F22],
- ["8F7D",0x5F23],
- ["8F7E",0x5F24],
- ["C3D6",0x5F25],
- ["CFD2",0x5F26],
- ["BBA1",0x5F27],
- ["8F80",0x5F28],
- ["E5F3",0x5F29],
- ["E5F2",0x5F2A],
- ["8F81",0x5F2B],
- ["8F82",0x5F2C],
- ["E5F4",0x5F2D],
- ["8F83",0x5F2E],
- ["CDE4",0x5F2F],
- ["8F84",0x5F30],
- ["C8F5",0x5F31],
- ["8F85",0x5F32],
- ["8F86",0x5F33],
- ["8F87",0x5F34],
- ["8F88",0x5F35],
- ["8F89",0x5F36],
- ["8F8A",0x5F37],
- ["8F8B",0x5F38],
- ["B5AF",0x5F39],
- ["C7BF",0x5F3A],
- ["8F8C",0x5F3B],
- ["E5F6",0x5F3C],
- ["8F8D",0x5F3D],
- ["8F8E",0x5F3E],
- ["8F8F",0x5F3F],
- ["ECB0",0x5F40],
- ["8F90",0x5F41],
- ["8F91",0x5F42],
- ["8F92",0x5F43],
- ["8F93",0x5F44],
- ["8F94",0x5F45],
- ["8F95",0x5F46],
- ["8F96",0x5F47],
- ["8F97",0x5F48],
- ["8F98",0x5F49],
- ["8F99",0x5F4A],
- ["8F9A",0x5F4B],
- ["8F9B",0x5F4C],
- ["8F9C",0x5F4D],
- ["8F9D",0x5F4E],
- ["8F9E",0x5F4F],
- ["E5E6",0x5F50],
- ["8F9F",0x5F51],
- ["B9E9",0x5F52],
- ["B5B1",0x5F53],
- ["8FA0",0x5F54],
- ["C2BC",0x5F55],
- ["E5E8",0x5F56],
- ["E5E7",0x5F57],
- ["E5E9",0x5F58],
- ["8FA1",0x5F59],
- ["8FA2",0x5F5A],
- ["8FA3",0x5F5B],
- ["8FA4",0x5F5C],
- ["D2CD",0x5F5D],
- ["8FA5",0x5F5E],
- ["8FA6",0x5F5F],
- ["8FA7",0x5F60],
- ["E1EA",0x5F61],
- ["D0CE",0x5F62],
- ["8FA8",0x5F63],
- ["CDAE",0x5F64],
- ["8FA9",0x5F65],
- ["D1E5",0x5F66],
- ["8FAA",0x5F67],
- ["8FAB",0x5F68],
- ["B2CA",0x5F69],
- ["B1EB",0x5F6A],
- ["8FAC",0x5F6B],
- ["B1F2",0x5F6C],
- ["C5ED",0x5F6D],
- ["8FAD",0x5F6E],
- ["8FAE",0x5F6F],
- ["D5C3",0x5F70],
- ["D3B0",0x5F71],
- ["8FAF",0x5F72],
- ["E1DC",0x5F73],
- ["8FB0",0x5F74],
- ["8FB1",0x5F75],
- ["8FB2",0x5F76],
- ["E1DD",0x5F77],
- ["8FB3",0x5F78],
- ["D2DB",0x5F79],
- ["8FB4",0x5F7A],
- ["B3B9",0x5F7B],
- ["B1CB",0x5F7C],
- ["8FB5",0x5F7D],
- ["8FB6",0x5F7E],
- ["8FB7",0x5F7F],
- ["CDF9",0x5F80],
- ["D5F7",0x5F81],
- ["E1DE",0x5F82],
- ["8FB8",0x5F83],
- ["BEB6",0x5F84],
- ["B4FD",0x5F85],
- ["8FB9",0x5F86],
- ["E1DF",0x5F87],
- ["BADC",0x5F88],
- ["E1E0",0x5F89],
- ["BBB2",0x5F8A],
- ["C2C9",0x5F8B],
- ["E1E1",0x5F8C],
- ["8FBA",0x5F8D],
- ["8FBB",0x5F8E],
- ["8FBC",0x5F8F],
- ["D0EC",0x5F90],
- ["8FBD",0x5F91],
- ["CDBD",0x5F92],
- ["8FBE",0x5F93],
- ["8FBF",0x5F94],
- ["E1E2",0x5F95],
- ["8FC0",0x5F96],
- ["B5C3",0x5F97],
- ["C5C7",0x5F98],
- ["E1E3",0x5F99],
- ["8FC1",0x5F9A],
- ["8FC2",0x5F9B],
- ["E1E4",0x5F9C],
- ["8FC3",0x5F9D],
- ["8FC4",0x5F9E],
- ["8FC5",0x5F9F],
- ["8FC6",0x5FA0],
- ["D3F9",0x5FA1],
- ["8FC7",0x5FA2],
- ["8FC8",0x5FA3],
- ["8FC9",0x5FA4],
- ["8FCA",0x5FA5],
- ["8FCB",0x5FA6],
- ["8FCC",0x5FA7],
- ["E1E5",0x5FA8],
- ["8FCD",0x5FA9],
- ["D1AD",0x5FAA],
- ["8FCE",0x5FAB],
- ["8FCF",0x5FAC],
- ["E1E6",0x5FAD],
- ["CEA2",0x5FAE],
- ["8FD0",0x5FAF],
- ["8FD1",0x5FB0],
- ["8FD2",0x5FB1],
- ["8FD3",0x5FB2],
- ["8FD4",0x5FB3],
- ["8FD5",0x5FB4],
- ["E1E7",0x5FB5],
- ["8FD6",0x5FB6],
- ["B5C2",0x5FB7],
- ["8FD7",0x5FB8],
- ["8FD8",0x5FB9],
- ["8FD9",0x5FBA],
- ["8FDA",0x5FBB],
- ["E1E8",0x5FBC],
- ["BBD5",0x5FBD],
- ["8FDB",0x5FBE],
- ["8FDC",0x5FBF],
- ["8FDD",0x5FC0],
- ["8FDE",0x5FC1],
- ["8FDF",0x5FC2],
- ["D0C4",0x5FC3],
- ["E2E0",0x5FC4],
- ["B1D8",0x5FC5],
- ["D2E4",0x5FC6],
- ["8FE0",0x5FC7],
- ["8FE1",0x5FC8],
- ["E2E1",0x5FC9],
- ["8FE2",0x5FCA],
- ["8FE3",0x5FCB],
- ["BCC9",0x5FCC],
- ["C8CC",0x5FCD],
- ["8FE4",0x5FCE],
- ["E2E3",0x5FCF],
- ["ECFE",0x5FD0],
- ["ECFD",0x5FD1],
- ["DFAF",0x5FD2],
- ["8FE5",0x5FD3],
- ["8FE6",0x5FD4],
- ["8FE7",0x5FD5],
- ["E2E2",0x5FD6],
- ["D6BE",0x5FD7],
- ["CDFC",0x5FD8],
- ["C3A6",0x5FD9],
- ["8FE8",0x5FDA],
- ["8FE9",0x5FDB],
- ["8FEA",0x5FDC],
- ["E3C3",0x5FDD],
- ["8FEB",0x5FDE],
- ["8FEC",0x5FDF],
- ["D6D2",0x5FE0],
- ["E2E7",0x5FE1],
- ["8FED",0x5FE2],
- ["8FEE",0x5FE3],
- ["E2E8",0x5FE4],
- ["8FEF",0x5FE5],
- ["8FF0",0x5FE6],
- ["D3C7",0x5FE7],
- ["8FF1",0x5FE8],
- ["8FF2",0x5FE9],
- ["E2EC",0x5FEA],
- ["BFEC",0x5FEB],
- ["8FF3",0x5FEC],
- ["E2ED",0x5FED],
- ["E2E5",0x5FEE],
- ["8FF4",0x5FEF],
- ["8FF5",0x5FF0],
- ["B3C0",0x5FF1],
- ["8FF6",0x5FF2],
- ["8FF7",0x5FF3],
- ["8FF8",0x5FF4],
- ["C4EE",0x5FF5],
- ["8FF9",0x5FF6],
- ["8FFA",0x5FF7],
- ["E2EE",0x5FF8],
- ["8FFB",0x5FF9],
- ["8FFC",0x5FFA],
- ["D0C3",0x5FFB],
- ["8FFD",0x5FFC],
- ["BAF6",0x5FFD],
- ["E2E9",0x5FFE],
- ["B7DE",0x5FFF],
- ["BBB3",0x6000],
- ["CCAC",0x6001],
- ["CBCB",0x6002],
- ["E2E4",0x6003],
- ["E2E6",0x6004],
- ["E2EA",0x6005],
- ["E2EB",0x6006],
- ["8FFE",0x6007],
- ["9040",0x6008],
- ["9041",0x6009],
- ["E2F7",0x600A],
- ["9042",0x600B],
- ["9043",0x600C],
- ["E2F4",0x600D],
- ["D4F5",0x600E],
- ["E2F3",0x600F],
- ["9044",0x6010],
- ["9045",0x6011],
- ["C5AD",0x6012],
- ["9046",0x6013],
- ["D5FA",0x6014],
- ["C5C2",0x6015],
- ["B2C0",0x6016],
- ["9047",0x6017],
- ["9048",0x6018],
- ["E2EF",0x6019],
- ["9049",0x601A],
- ["E2F2",0x601B],
- ["C1AF",0x601C],
- ["CBBC",0x601D],
- ["904A",0x601E],
- ["904B",0x601F],
- ["B5A1",0x6020],
- ["E2F9",0x6021],
- ["904C",0x6022],
- ["904D",0x6023],
- ["904E",0x6024],
- ["BCB1",0x6025],
- ["E2F1",0x6026],
- ["D0D4",0x6027],
- ["D4B9",0x6028],
- ["E2F5",0x6029],
- ["B9D6",0x602A],
- ["E2F6",0x602B],
- ["904F",0x602C],
- ["9050",0x602D],
- ["9051",0x602E],
- ["C7D3",0x602F],
- ["9052",0x6030],
- ["9053",0x6031],
- ["9054",0x6032],
- ["9055",0x6033],
- ["9056",0x6034],
- ["E2F0",0x6035],
- ["9057",0x6036],
- ["9058",0x6037],
- ["9059",0x6038],
- ["905A",0x6039],
- ["905B",0x603A],
- ["D7DC",0x603B],
- ["EDA1",0x603C],
- ["905C",0x603D],
- ["905D",0x603E],
- ["E2F8",0x603F],
- ["905E",0x6040],
- ["EDA5",0x6041],
- ["E2FE",0x6042],
- ["CAD1",0x6043],
- ["905F",0x6044],
- ["9060",0x6045],
- ["9061",0x6046],
- ["9062",0x6047],
- ["9063",0x6048],
- ["9064",0x6049],
- ["9065",0x604A],
- ["C1B5",0x604B],
- ["9066",0x604C],
- ["BBD0",0x604D],
- ["9067",0x604E],
- ["9068",0x604F],
- ["BFD6",0x6050],
- ["9069",0x6051],
- ["BAE3",0x6052],
- ["906A",0x6053],
- ["906B",0x6054],
- ["CBA1",0x6055],
- ["906C",0x6056],
- ["906D",0x6057],
- ["906E",0x6058],
- ["EDA6",0x6059],
- ["EDA3",0x605A],
- ["906F",0x605B],
- ["9070",0x605C],
- ["EDA2",0x605D],
- ["9071",0x605E],
- ["9072",0x605F],
- ["9073",0x6060],
- ["9074",0x6061],
- ["BBD6",0x6062],
- ["EDA7",0x6063],
- ["D0F4",0x6064],
- ["9075",0x6065],
- ["9076",0x6066],
- ["EDA4",0x6067],
- ["BADE",0x6068],
- ["B6F7",0x6069],
- ["E3A1",0x606A],
- ["B6B2",0x606B],
- ["CCF1",0x606C],
- ["B9A7",0x606D],
- ["9077",0x606E],
- ["CFA2",0x606F],
- ["C7A1",0x6070],
- ["9078",0x6071],
- ["9079",0x6072],
- ["BFD2",0x6073],
- ["907A",0x6074],
- ["907B",0x6075],
- ["B6F1",0x6076],
- ["907C",0x6077],
- ["E2FA",0x6078],
- ["E2FB",0x6079],
- ["E2FD",0x607A],
- ["E2FC",0x607B],
- ["C4D5",0x607C],
- ["E3A2",0x607D],
- ["907D",0x607E],
- ["D3C1",0x607F],
- ["907E",0x6080],
- ["9080",0x6081],
- ["9081",0x6082],
- ["E3A7",0x6083],
- ["C7C4",0x6084],
- ["9082",0x6085],
- ["9083",0x6086],
- ["9084",0x6087],
- ["9085",0x6088],
- ["CFA4",0x6089],
- ["9086",0x608A],
- ["9087",0x608B],
- ["E3A9",0x608C],
- ["BAB7",0x608D],
- ["9088",0x608E],
- ["9089",0x608F],
- ["908A",0x6090],
- ["908B",0x6091],
- ["E3A8",0x6092],
- ["908C",0x6093],
- ["BBDA",0x6094],
- ["908D",0x6095],
- ["E3A3",0x6096],
- ["908E",0x6097],
- ["908F",0x6098],
- ["9090",0x6099],
- ["E3A4",0x609A],
- ["E3AA",0x609B],
- ["9091",0x609C],
- ["E3A6",0x609D],
- ["9092",0x609E],
- ["CEF2",0x609F],
- ["D3C6",0x60A0],
- ["9093",0x60A1],
- ["9094",0x60A2],
- ["BBBC",0x60A3],
- ["9095",0x60A4],
- ["9096",0x60A5],
- ["D4C3",0x60A6],
- ["9097",0x60A7],
- ["C4FA",0x60A8],
- ["9098",0x60A9],
- ["9099",0x60AA],
- ["EDA8",0x60AB],
- ["D0FC",0x60AC],
- ["E3A5",0x60AD],
- ["909A",0x60AE],
- ["C3F5",0x60AF],
- ["909B",0x60B0],
- ["E3AD",0x60B1],
- ["B1AF",0x60B2],
- ["909C",0x60B3],
- ["E3B2",0x60B4],
- ["909D",0x60B5],
- ["909E",0x60B6],
- ["909F",0x60B7],
- ["BCC2",0x60B8],
- ["90A0",0x60B9],
- ["90A1",0x60BA],
- ["E3AC",0x60BB],
- ["B5BF",0x60BC],
- ["90A2",0x60BD],
- ["90A3",0x60BE],
- ["90A4",0x60BF],
- ["90A5",0x60C0],
- ["90A6",0x60C1],
- ["90A7",0x60C2],
- ["90A8",0x60C3],
- ["90A9",0x60C4],
- ["C7E9",0x60C5],
- ["E3B0",0x60C6],
- ["90AA",0x60C7],
- ["90AB",0x60C8],
- ["90AC",0x60C9],
- ["BEAA",0x60CA],
- ["CDEF",0x60CB],
- ["90AD",0x60CC],
- ["90AE",0x60CD],
- ["90AF",0x60CE],
- ["90B0",0x60CF],
- ["90B1",0x60D0],
- ["BBF3",0x60D1],
- ["90B2",0x60D2],
- ["90B3",0x60D3],
- ["90B4",0x60D4],
- ["CCE8",0x60D5],
- ["90B5",0x60D6],
- ["90B6",0x60D7],
- ["E3AF",0x60D8],
- ["90B7",0x60D9],
- ["E3B1",0x60DA],
- ["90B8",0x60DB],
- ["CFA7",0x60DC],
- ["E3AE",0x60DD],
- ["90B9",0x60DE],
- ["CEA9",0x60DF],
- ["BBDD",0x60E0],
- ["90BA",0x60E1],
- ["90BB",0x60E2],
- ["90BC",0x60E3],
- ["90BD",0x60E4],
- ["90BE",0x60E5],
- ["B5EB",0x60E6],
- ["BEE5",0x60E7],
- ["B2D2",0x60E8],
- ["B3CD",0x60E9],
- ["90BF",0x60EA],
- ["B1B9",0x60EB],
- ["E3AB",0x60EC],
- ["B2D1",0x60ED],
- ["B5AC",0x60EE],
- ["B9DF",0x60EF],
- ["B6E8",0x60F0],
- ["90C0",0x60F1],
- ["90C1",0x60F2],
- ["CFEB",0x60F3],
- ["E3B7",0x60F4],
- ["90C2",0x60F5],
- ["BBCC",0x60F6],
- ["90C3",0x60F7],
- ["90C4",0x60F8],
- ["C8C7",0x60F9],
- ["D0CA",0x60FA],
- ["90C5",0x60FB],
- ["90C6",0x60FC],
- ["90C7",0x60FD],
- ["90C8",0x60FE],
- ["90C9",0x60FF],
- ["E3B8",0x6100],
- ["B3EE",0x6101],
- ["90CA",0x6102],
- ["90CB",0x6103],
- ["90CC",0x6104],
- ["90CD",0x6105],
- ["EDA9",0x6106],
- ["90CE",0x6107],
- ["D3FA",0x6108],
- ["D3E4",0x6109],
- ["90CF",0x610A],
- ["90D0",0x610B],
- ["90D1",0x610C],
- ["EDAA",0x610D],
- ["E3B9",0x610E],
- ["D2E2",0x610F],
- ["90D2",0x6110],
- ["90D3",0x6111],
- ["90D4",0x6112],
- ["90D5",0x6113],
- ["90D6",0x6114],
- ["E3B5",0x6115],
- ["90D7",0x6116],
- ["90D8",0x6117],
- ["90D9",0x6118],
- ["90DA",0x6119],
- ["D3DE",0x611A],
- ["90DB",0x611B],
- ["90DC",0x611C],
- ["90DD",0x611D],
- ["90DE",0x611E],
- ["B8D0",0x611F],
- ["E3B3",0x6120],
- ["90DF",0x6121],
- ["90E0",0x6122],
- ["E3B6",0x6123],
- ["B7DF",0x6124],
- ["90E1",0x6125],
- ["E3B4",0x6126],
- ["C0A2",0x6127],
- ["90E2",0x6128],
- ["90E3",0x6129],
- ["90E4",0x612A],
- ["E3BA",0x612B],
- ["90E5",0x612C],
- ["90E6",0x612D],
- ["90E7",0x612E],
- ["90E8",0x612F],
- ["90E9",0x6130],
- ["90EA",0x6131],
- ["90EB",0x6132],
- ["90EC",0x6133],
- ["90ED",0x6134],
- ["90EE",0x6135],
- ["90EF",0x6136],
- ["90F0",0x6137],
- ["90F1",0x6138],
- ["90F2",0x6139],
- ["90F3",0x613A],
- ["90F4",0x613B],
- ["90F5",0x613C],
- ["90F6",0x613D],
- ["90F7",0x613E],
- ["D4B8",0x613F],
- ["90F8",0x6140],
- ["90F9",0x6141],
- ["90FA",0x6142],
- ["90FB",0x6143],
- ["90FC",0x6144],
- ["90FD",0x6145],
- ["90FE",0x6146],
- ["9140",0x6147],
- ["B4C8",0x6148],
- ["9141",0x6149],
- ["E3BB",0x614A],
- ["9142",0x614B],
- ["BBC5",0x614C],
- ["9143",0x614D],
- ["C9F7",0x614E],
- ["9144",0x614F],
- ["9145",0x6150],
- ["C9E5",0x6151],
- ["9146",0x6152],
- ["9147",0x6153],
- ["9148",0x6154],
- ["C4BD",0x6155],
- ["9149",0x6156],
- ["914A",0x6157],
- ["914B",0x6158],
- ["914C",0x6159],
- ["914D",0x615A],
- ["914E",0x615B],
- ["914F",0x615C],
- ["EDAB",0x615D],
- ["9150",0x615E],
- ["9151",0x615F],
- ["9152",0x6160],
- ["9153",0x6161],
- ["C2FD",0x6162],
- ["9154",0x6163],
- ["9155",0x6164],
- ["9156",0x6165],
- ["9157",0x6166],
- ["BBDB",0x6167],
- ["BFAE",0x6168],
- ["9158",0x6169],
- ["9159",0x616A],
- ["915A",0x616B],
- ["915B",0x616C],
- ["915C",0x616D],
- ["915D",0x616E],
- ["915E",0x616F],
- ["CEBF",0x6170],
- ["915F",0x6171],
- ["9160",0x6172],
- ["9161",0x6173],
- ["9162",0x6174],
- ["E3BC",0x6175],
- ["9163",0x6176],
- ["BFB6",0x6177],
- ["9164",0x6178],
- ["9165",0x6179],
- ["9166",0x617A],
- ["9167",0x617B],
- ["9168",0x617C],
- ["9169",0x617D],
- ["916A",0x617E],
- ["916B",0x617F],
- ["916C",0x6180],
- ["916D",0x6181],
- ["916E",0x6182],
- ["916F",0x6183],
- ["9170",0x6184],
- ["9171",0x6185],
- ["9172",0x6186],
- ["9173",0x6187],
- ["9174",0x6188],
- ["9175",0x6189],
- ["9176",0x618A],
- ["B1EF",0x618B],
- ["9177",0x618C],
- ["9178",0x618D],
- ["D4F7",0x618E],
- ["9179",0x618F],
- ["917A",0x6190],
- ["917B",0x6191],
- ["917C",0x6192],
- ["917D",0x6193],
- ["E3BE",0x6194],
- ["917E",0x6195],
- ["9180",0x6196],
- ["9181",0x6197],
- ["9182",0x6198],
- ["9183",0x6199],
- ["9184",0x619A],
- ["9185",0x619B],
- ["9186",0x619C],
- ["EDAD",0x619D],
- ["9187",0x619E],
- ["9188",0x619F],
- ["9189",0x61A0],
- ["918A",0x61A1],
- ["918B",0x61A2],
- ["918C",0x61A3],
- ["918D",0x61A4],
- ["918E",0x61A5],
- ["918F",0x61A6],
- ["E3BF",0x61A7],
- ["BAA9",0x61A8],
- ["EDAC",0x61A9],
- ["9190",0x61AA],
- ["9191",0x61AB],
- ["E3BD",0x61AC],
- ["9192",0x61AD],
- ["9193",0x61AE],
- ["9194",0x61AF],
- ["9195",0x61B0],
- ["9196",0x61B1],
- ["9197",0x61B2],
- ["9198",0x61B3],
- ["9199",0x61B4],
- ["919A",0x61B5],
- ["919B",0x61B6],
- ["E3C0",0x61B7],
- ["919C",0x61B8],
- ["919D",0x61B9],
- ["919E",0x61BA],
- ["919F",0x61BB],
- ["91A0",0x61BC],
- ["91A1",0x61BD],
- ["BAB6",0x61BE],
- ["91A2",0x61BF],
- ["91A3",0x61C0],
- ["91A4",0x61C1],
- ["B6AE",0x61C2],
- ["91A5",0x61C3],
- ["91A6",0x61C4],
- ["91A7",0x61C5],
- ["91A8",0x61C6],
- ["91A9",0x61C7],
- ["D0B8",0x61C8],
- ["91AA",0x61C9],
- ["B0C3",0x61CA],
- ["EDAE",0x61CB],
- ["91AB",0x61CC],
- ["91AC",0x61CD],
- ["91AD",0x61CE],
- ["91AE",0x61CF],
- ["91AF",0x61D0],
- ["EDAF",0x61D1],
- ["C0C1",0x61D2],
- ["91B0",0x61D3],
- ["E3C1",0x61D4],
- ["91B1",0x61D5],
- ["91B2",0x61D6],
- ["91B3",0x61D7],
- ["91B4",0x61D8],
- ["91B5",0x61D9],
- ["91B6",0x61DA],
- ["91B7",0x61DB],
- ["91B8",0x61DC],
- ["91B9",0x61DD],
- ["91BA",0x61DE],
- ["91BB",0x61DF],
- ["91BC",0x61E0],
- ["91BD",0x61E1],
- ["91BE",0x61E2],
- ["91BF",0x61E3],
- ["91C0",0x61E4],
- ["91C1",0x61E5],
- ["C5B3",0x61E6],
- ["91C2",0x61E7],
- ["91C3",0x61E8],
- ["91C4",0x61E9],
- ["91C5",0x61EA],
- ["91C6",0x61EB],
- ["91C7",0x61EC],
- ["91C8",0x61ED],
- ["91C9",0x61EE],
- ["91CA",0x61EF],
- ["91CB",0x61F0],
- ["91CC",0x61F1],
- ["91CD",0x61F2],
- ["91CE",0x61F3],
- ["91CF",0x61F4],
- ["E3C2",0x61F5],
- ["91D0",0x61F6],
- ["91D1",0x61F7],
- ["91D2",0x61F8],
- ["91D3",0x61F9],
- ["91D4",0x61FA],
- ["91D5",0x61FB],
- ["91D6",0x61FC],
- ["91D7",0x61FD],
- ["91D8",0x61FE],
- ["DCB2",0x61FF],
- ["91D9",0x6200],
- ["91DA",0x6201],
- ["91DB",0x6202],
- ["91DC",0x6203],
- ["91DD",0x6204],
- ["91DE",0x6205],
- ["EDB0",0x6206],
- ["91DF",0x6207],
- ["B8EA",0x6208],
- ["91E0",0x6209],
- ["CEEC",0x620A],
- ["EAA7",0x620B],
- ["D0E7",0x620C],
- ["CAF9",0x620D],
- ["C8D6",0x620E],
- ["CFB7",0x620F],
- ["B3C9",0x6210],
- ["CED2",0x6211],
- ["BDE4",0x6212],
- ["91E1",0x6213],
- ["91E2",0x6214],
- ["E3DE",0x6215],
- ["BBF2",0x6216],
- ["EAA8",0x6217],
- ["D5BD",0x6218],
- ["91E3",0x6219],
- ["C6DD",0x621A],
- ["EAA9",0x621B],
- ["91E4",0x621C],
- ["91E5",0x621D],
- ["91E6",0x621E],
- ["EAAA",0x621F],
- ["91E7",0x6220],
- ["EAAC",0x6221],
- ["EAAB",0x6222],
- ["91E8",0x6223],
- ["EAAE",0x6224],
- ["EAAD",0x6225],
- ["91E9",0x6226],
- ["91EA",0x6227],
- ["91EB",0x6228],
- ["91EC",0x6229],
- ["BDD8",0x622A],
- ["91ED",0x622B],
- ["EAAF",0x622C],
- ["91EE",0x622D],
- ["C2BE",0x622E],
- ["91EF",0x622F],
- ["91F0",0x6230],
- ["91F1",0x6231],
- ["91F2",0x6232],
- ["B4C1",0x6233],
- ["B4F7",0x6234],
- ["91F3",0x6235],
- ["91F4",0x6236],
- ["BBA7",0x6237],
- ["91F5",0x6238],
- ["91F6",0x6239],
- ["91F7",0x623A],
- ["91F8",0x623B],
- ["91F9",0x623C],
- ["ECE6",0x623D],
- ["ECE5",0x623E],
- ["B7BF",0x623F],
- ["CBF9",0x6240],
- ["B1E2",0x6241],
- ["91FA",0x6242],
- ["ECE7",0x6243],
- ["91FB",0x6244],
- ["91FC",0x6245],
- ["91FD",0x6246],
- ["C9C8",0x6247],
- ["ECE8",0x6248],
- ["ECE9",0x6249],
- ["91FE",0x624A],
- ["CAD6",0x624B],
- ["DED0",0x624C],
- ["B2C5",0x624D],
- ["D4FA",0x624E],
- ["9240",0x624F],
- ["9241",0x6250],
- ["C6CB",0x6251],
- ["B0C7",0x6252],
- ["B4F2",0x6253],
- ["C8D3",0x6254],
- ["9242",0x6255],
- ["9243",0x6256],
- ["9244",0x6257],
- ["CDD0",0x6258],
- ["9245",0x6259],
- ["9246",0x625A],
- ["BFB8",0x625B],
- ["9247",0x625C],
- ["9248",0x625D],
- ["9249",0x625E],
- ["924A",0x625F],
- ["924B",0x6260],
- ["924C",0x6261],
- ["924D",0x6262],
- ["BFDB",0x6263],
- ["924E",0x6264],
- ["924F",0x6265],
- ["C7A4",0x6266],
- ["D6B4",0x6267],
- ["9250",0x6268],
- ["C0A9",0x6269],
- ["DED1",0x626A],
- ["C9A8",0x626B],
- ["D1EF",0x626C],
- ["C5A4",0x626D],
- ["B0E7",0x626E],
- ["B3B6",0x626F],
- ["C8C5",0x6270],
- ["9251",0x6271],
- ["9252",0x6272],
- ["B0E2",0x6273],
- ["9253",0x6274],
- ["9254",0x6275],
- ["B7F6",0x6276],
- ["9255",0x6277],
- ["9256",0x6278],
- ["C5FA",0x6279],
- ["9257",0x627A],
- ["9258",0x627B],
- ["B6F3",0x627C],
- ["9259",0x627D],
- ["D5D2",0x627E],
- ["B3D0",0x627F],
- ["BCBC",0x6280],
- ["925A",0x6281],
- ["925B",0x6282],
- ["925C",0x6283],
- ["B3AD",0x6284],
- ["925D",0x6285],
- ["925E",0x6286],
- ["925F",0x6287],
- ["9260",0x6288],
- ["BEF1",0x6289],
- ["B0D1",0x628A],
- ["9261",0x628B],
- ["9262",0x628C],
- ["9263",0x628D],
- ["9264",0x628E],
- ["9265",0x628F],
- ["9266",0x6290],
- ["D2D6",0x6291],
- ["CAE3",0x6292],
- ["D7A5",0x6293],
- ["9267",0x6294],
- ["CDB6",0x6295],
- ["B6B6",0x6296],
- ["BFB9",0x6297],
- ["D5DB",0x6298],
- ["9268",0x6299],
- ["B8A7",0x629A],
- ["C5D7",0x629B],
- ["9269",0x629C],
- ["926A",0x629D],
- ["926B",0x629E],
- ["DED2",0x629F],
- ["BFD9",0x62A0],
- ["C2D5",0x62A1],
- ["C7C0",0x62A2],
- ["926C",0x62A3],
- ["BBA4",0x62A4],
- ["B1A8",0x62A5],
- ["926D",0x62A6],
- ["926E",0x62A7],
- ["C5EA",0x62A8],
- ["926F",0x62A9],
- ["9270",0x62AA],
- ["C5FB",0x62AB],
- ["CCA7",0x62AC],
- ["9271",0x62AD],
- ["9272",0x62AE],
- ["9273",0x62AF],
- ["9274",0x62B0],
- ["B1A7",0x62B1],
- ["9275",0x62B2],
- ["9276",0x62B3],
- ["9277",0x62B4],
- ["B5D6",0x62B5],
- ["9278",0x62B6],
- ["9279",0x62B7],
- ["927A",0x62B8],
- ["C4A8",0x62B9],
- ["927B",0x62BA],
- ["DED3",0x62BB],
- ["D1BA",0x62BC],
- ["B3E9",0x62BD],
- ["927C",0x62BE],
- ["C3F2",0x62BF],
- ["927D",0x62C0],
- ["927E",0x62C1],
- ["B7F7",0x62C2],
- ["9280",0x62C3],
- ["D6F4",0x62C4],
- ["B5A3",0x62C5],
- ["B2F0",0x62C6],
- ["C4B4",0x62C7],
- ["C4E9",0x62C8],
- ["C0AD",0x62C9],
- ["DED4",0x62CA],
- ["9281",0x62CB],
- ["B0E8",0x62CC],
- ["C5C4",0x62CD],
- ["C1E0",0x62CE],
- ["9282",0x62CF],
- ["B9D5",0x62D0],
- ["9283",0x62D1],
- ["BEDC",0x62D2],
- ["CDD8",0x62D3],
- ["B0CE",0x62D4],
- ["9284",0x62D5],
- ["CDCF",0x62D6],
- ["DED6",0x62D7],
- ["BED0",0x62D8],
- ["D7BE",0x62D9],
- ["DED5",0x62DA],
- ["D5D0",0x62DB],
- ["B0DD",0x62DC],
- ["9285",0x62DD],
- ["9286",0x62DE],
- ["C4E2",0x62DF],
- ["9287",0x62E0],
- ["9288",0x62E1],
- ["C2A3",0x62E2],
- ["BCF0",0x62E3],
- ["9289",0x62E4],
- ["D3B5",0x62E5],
- ["C0B9",0x62E6],
- ["C5A1",0x62E7],
- ["B2A6",0x62E8],
- ["D4F1",0x62E9],
- ["928A",0x62EA],
- ["928B",0x62EB],
- ["C0A8",0x62EC],
- ["CAC3",0x62ED],
- ["DED7",0x62EE],
- ["D5FC",0x62EF],
- ["928C",0x62F0],
- ["B9B0",0x62F1],
- ["928D",0x62F2],
- ["C8AD",0x62F3],
- ["CBA9",0x62F4],
- ["928E",0x62F5],
- ["DED9",0x62F6],
- ["BFBD",0x62F7],
- ["928F",0x62F8],
- ["9290",0x62F9],
- ["9291",0x62FA],
- ["9292",0x62FB],
- ["C6B4",0x62FC],
- ["D7A7",0x62FD],
- ["CAB0",0x62FE],
- ["C4C3",0x62FF],
- ["9293",0x6300],
- ["B3D6",0x6301],
- ["B9D2",0x6302],
- ["9294",0x6303],
- ["9295",0x6304],
- ["9296",0x6305],
- ["9297",0x6306],
- ["D6B8",0x6307],
- ["EAFC",0x6308],
- ["B0B4",0x6309],
- ["9298",0x630A],
- ["9299",0x630B],
- ["929A",0x630C],
- ["929B",0x630D],
- ["BFE6",0x630E],
- ["929C",0x630F],
- ["929D",0x6310],
- ["CCF4",0x6311],
- ["929E",0x6312],
- ["929F",0x6313],
- ["92A0",0x6314],
- ["92A1",0x6315],
- ["CDDA",0x6316],
- ["92A2",0x6317],
- ["92A3",0x6318],
- ["92A4",0x6319],
- ["D6BF",0x631A],
- ["C2CE",0x631B],
- ["92A5",0x631C],
- ["CECE",0x631D],
- ["CCA2",0x631E],
- ["D0AE",0x631F],
- ["C4D3",0x6320],
- ["B5B2",0x6321],
- ["DED8",0x6322],
- ["D5F5",0x6323],
- ["BCB7",0x6324],
- ["BBD3",0x6325],
- ["92A6",0x6326],
- ["92A7",0x6327],
- ["B0A4",0x6328],
- ["92A8",0x6329],
- ["C5B2",0x632A],
- ["B4EC",0x632B],
- ["92A9",0x632C],
- ["92AA",0x632D],
- ["92AB",0x632E],
- ["D5F1",0x632F],
- ["92AC",0x6330],
- ["92AD",0x6331],
- ["EAFD",0x6332],
- ["92AE",0x6333],
- ["92AF",0x6334],
- ["92B0",0x6335],
- ["92B1",0x6336],
- ["92B2",0x6337],
- ["92B3",0x6338],
- ["DEDA",0x6339],
- ["CDA6",0x633A],
- ["92B4",0x633B],
- ["92B5",0x633C],
- ["CDEC",0x633D],
- ["92B6",0x633E],
- ["92B7",0x633F],
- ["92B8",0x6340],
- ["92B9",0x6341],
- ["CEE6",0x6342],
- ["DEDC",0x6343],
- ["92BA",0x6344],
- ["CDB1",0x6345],
- ["C0A6",0x6346],
- ["92BB",0x6347],
- ["92BC",0x6348],
- ["D7BD",0x6349],
- ["92BD",0x634A],
- ["DEDB",0x634B],
- ["B0C6",0x634C],
- ["BAB4",0x634D],
- ["C9D3",0x634E],
- ["C4F3",0x634F],
- ["BEE8",0x6350],
- ["92BE",0x6351],
- ["92BF",0x6352],
- ["92C0",0x6353],
- ["92C1",0x6354],
- ["B2B6",0x6355],
- ["92C2",0x6356],
- ["92C3",0x6357],
- ["92C4",0x6358],
- ["92C5",0x6359],
- ["92C6",0x635A],
- ["92C7",0x635B],
- ["92C8",0x635C],
- ["92C9",0x635D],
- ["C0CC",0x635E],
- ["CBF0",0x635F],
- ["92CA",0x6360],
- ["BCF1",0x6361],
- ["BBBB",0x6362],
- ["B5B7",0x6363],
- ["92CB",0x6364],
- ["92CC",0x6365],
- ["92CD",0x6366],
- ["C5F5",0x6367],
- ["92CE",0x6368],
- ["DEE6",0x6369],
- ["92CF",0x636A],
- ["92D0",0x636B],
- ["92D1",0x636C],
- ["DEE3",0x636D],
- ["BEDD",0x636E],
- ["92D2",0x636F],
- ["92D3",0x6370],
- ["DEDF",0x6371],
- ["92D4",0x6372],
- ["92D5",0x6373],
- ["92D6",0x6374],
- ["92D7",0x6375],
- ["B4B7",0x6376],
- ["BDDD",0x6377],
- ["92D8",0x6378],
- ["92D9",0x6379],
- ["DEE0",0x637A],
- ["C4ED",0x637B],
- ["92DA",0x637C],
- ["92DB",0x637D],
- ["92DC",0x637E],
- ["92DD",0x637F],
- ["CFC6",0x6380],
- ["92DE",0x6381],
- ["B5E0",0x6382],
- ["92DF",0x6383],
- ["92E0",0x6384],
- ["92E1",0x6385],
- ["92E2",0x6386],
- ["B6DE",0x6387],
- ["CADA",0x6388],
- ["B5F4",0x6389],
- ["DEE5",0x638A],
- ["92E3",0x638B],
- ["D5C6",0x638C],
- ["92E4",0x638D],
- ["DEE1",0x638E],
- ["CCCD",0x638F],
- ["C6FE",0x6390],
- ["92E5",0x6391],
- ["C5C5",0x6392],
- ["92E6",0x6393],
- ["92E7",0x6394],
- ["92E8",0x6395],
- ["D2B4",0x6396],
- ["92E9",0x6397],
- ["BEF2",0x6398],
- ["92EA",0x6399],
- ["92EB",0x639A],
- ["92EC",0x639B],
- ["92ED",0x639C],
- ["92EE",0x639D],
- ["92EF",0x639E],
- ["92F0",0x639F],
- ["C2D3",0x63A0],
- ["92F1",0x63A1],
- ["CCBD",0x63A2],
- ["B3B8",0x63A3],
- ["92F2",0x63A4],
- ["BDD3",0x63A5],
- ["92F3",0x63A6],
- ["BFD8",0x63A7],
- ["CDC6",0x63A8],
- ["D1DA",0x63A9],
- ["B4EB",0x63AA],
- ["92F4",0x63AB],
- ["DEE4",0x63AC],
- ["DEDD",0x63AD],
- ["DEE7",0x63AE],
- ["92F5",0x63AF],
- ["EAFE",0x63B0],
- ["92F6",0x63B1],
- ["92F7",0x63B2],
- ["C2B0",0x63B3],
- ["DEE2",0x63B4],
- ["92F8",0x63B5],
- ["92F9",0x63B6],
- ["D6C0",0x63B7],
- ["B5A7",0x63B8],
- ["92FA",0x63B9],
- ["B2F4",0x63BA],
- ["92FB",0x63BB],
- ["DEE8",0x63BC],
- ["92FC",0x63BD],
- ["DEF2",0x63BE],
- ["92FD",0x63BF],
- ["92FE",0x63C0],
- ["9340",0x63C1],
- ["9341",0x63C2],
- ["9342",0x63C3],
- ["DEED",0x63C4],
- ["9343",0x63C5],
- ["DEF1",0x63C6],
- ["9344",0x63C7],
- ["9345",0x63C8],
- ["C8E0",0x63C9],
- ["9346",0x63CA],
- ["9347",0x63CB],
- ["9348",0x63CC],
- ["D7E1",0x63CD],
- ["DEEF",0x63CE],
- ["C3E8",0x63CF],
- ["CCE1",0x63D0],
- ["9349",0x63D1],
- ["B2E5",0x63D2],
- ["934A",0x63D3],
- ["934B",0x63D4],
- ["934C",0x63D5],
- ["D2BE",0x63D6],
- ["934D",0x63D7],
- ["934E",0x63D8],
- ["934F",0x63D9],
- ["9350",0x63DA],
- ["9351",0x63DB],
- ["9352",0x63DC],
- ["9353",0x63DD],
- ["DEEE",0x63DE],
- ["9354",0x63DF],
- ["DEEB",0x63E0],
- ["CED5",0x63E1],
- ["9355",0x63E2],
- ["B4A7",0x63E3],
- ["9356",0x63E4],
- ["9357",0x63E5],
- ["9358",0x63E6],
- ["9359",0x63E7],
- ["935A",0x63E8],
- ["BFAB",0x63E9],
- ["BEBE",0x63EA],
- ["935B",0x63EB],
- ["935C",0x63EC],
- ["BDD2",0x63ED],
- ["935D",0x63EE],
- ["935E",0x63EF],
- ["935F",0x63F0],
- ["9360",0x63F1],
- ["DEE9",0x63F2],
- ["9361",0x63F3],
- ["D4AE",0x63F4],
- ["9362",0x63F5],
- ["DEDE",0x63F6],
- ["9363",0x63F7],
- ["DEEA",0x63F8],
- ["9364",0x63F9],
- ["9365",0x63FA],
- ["9366",0x63FB],
- ["9367",0x63FC],
- ["C0BF",0x63FD],
- ["9368",0x63FE],
- ["DEEC",0x63FF],
- ["B2F3",0x6400],
- ["B8E9",0x6401],
- ["C2A7",0x6402],
- ["9369",0x6403],
- ["936A",0x6404],
- ["BDC1",0x6405],
- ["936B",0x6406],
- ["936C",0x6407],
- ["936D",0x6408],
- ["936E",0x6409],
- ["936F",0x640A],
- ["DEF5",0x640B],
- ["DEF8",0x640C],
- ["9370",0x640D],
- ["9371",0x640E],
- ["B2AB",0x640F],
- ["B4A4",0x6410],
- ["9372",0x6411],
- ["9373",0x6412],
- ["B4EA",0x6413],
- ["C9A6",0x6414],
- ["9374",0x6415],
- ["9375",0x6416],
- ["9376",0x6417],
- ["9377",0x6418],
- ["9378",0x6419],
- ["9379",0x641A],
- ["DEF6",0x641B],
- ["CBD1",0x641C],
- ["937A",0x641D],
- ["B8E3",0x641E],
- ["937B",0x641F],
- ["DEF7",0x6420],
- ["DEFA",0x6421],
- ["937C",0x6422],
- ["937D",0x6423],
- ["937E",0x6424],
- ["9380",0x6425],
- ["DEF9",0x6426],
- ["9381",0x6427],
- ["9382",0x6428],
- ["9383",0x6429],
- ["CCC2",0x642A],
- ["9384",0x642B],
- ["B0E1",0x642C],
- ["B4EE",0x642D],
- ["9385",0x642E],
- ["9386",0x642F],
- ["9387",0x6430],
- ["9388",0x6431],
- ["9389",0x6432],
- ["938A",0x6433],
- ["E5BA",0x6434],
- ["938B",0x6435],
- ["938C",0x6436],
- ["938D",0x6437],
- ["938E",0x6438],
- ["938F",0x6439],
- ["D0AF",0x643A],
- ["9390",0x643B],
- ["9391",0x643C],
- ["B2EB",0x643D],
- ["9392",0x643E],
- ["EBA1",0x643F],
- ["9393",0x6440],
- ["DEF4",0x6441],
- ["9394",0x6442],
- ["9395",0x6443],
- ["C9E3",0x6444],
- ["DEF3",0x6445],
- ["B0DA",0x6446],
- ["D2A1",0x6447],
- ["B1F7",0x6448],
- ["9396",0x6449],
- ["CCAF",0x644A],
- ["9397",0x644B],
- ["9398",0x644C],
- ["9399",0x644D],
- ["939A",0x644E],
- ["939B",0x644F],
- ["939C",0x6450],
- ["939D",0x6451],
- ["DEF0",0x6452],
- ["939E",0x6453],
- ["CBA4",0x6454],
- ["939F",0x6455],
- ["93A0",0x6456],
- ["93A1",0x6457],
- ["D5AA",0x6458],
- ["93A2",0x6459],
- ["93A3",0x645A],
- ["93A4",0x645B],
- ["93A5",0x645C],
- ["93A6",0x645D],
- ["DEFB",0x645E],
- ["93A7",0x645F],
- ["93A8",0x6460],
- ["93A9",0x6461],
- ["93AA",0x6462],
- ["93AB",0x6463],
- ["93AC",0x6464],
- ["93AD",0x6465],
- ["93AE",0x6466],
- ["B4DD",0x6467],
- ["93AF",0x6468],
- ["C4A6",0x6469],
- ["93B0",0x646A],
- ["93B1",0x646B],
- ["93B2",0x646C],
- ["DEFD",0x646D],
- ["93B3",0x646E],
- ["93B4",0x646F],
- ["93B5",0x6470],
- ["93B6",0x6471],
- ["93B7",0x6472],
- ["93B8",0x6473],
- ["93B9",0x6474],
- ["93BA",0x6475],
- ["93BB",0x6476],
- ["93BC",0x6477],
- ["C3FE",0x6478],
- ["C4A1",0x6479],
- ["DFA1",0x647A],
- ["93BD",0x647B],
- ["93BE",0x647C],
- ["93BF",0x647D],
- ["93C0",0x647E],
- ["93C1",0x647F],
- ["93C2",0x6480],
- ["93C3",0x6481],
- ["C1CC",0x6482],
- ["93C4",0x6483],
- ["DEFC",0x6484],
- ["BEEF",0x6485],
- ["93C5",0x6486],
- ["C6B2",0x6487],
- ["93C6",0x6488],
- ["93C7",0x6489],
- ["93C8",0x648A],
- ["93C9",0x648B],
- ["93CA",0x648C],
- ["93CB",0x648D],
- ["93CC",0x648E],
- ["93CD",0x648F],
- ["93CE",0x6490],
- ["B3C5",0x6491],
- ["C8F6",0x6492],
- ["93CF",0x6493],
- ["93D0",0x6494],
- ["CBBA",0x6495],
- ["DEFE",0x6496],
- ["93D1",0x6497],
- ["93D2",0x6498],
- ["DFA4",0x6499],
- ["93D3",0x649A],
- ["93D4",0x649B],
- ["93D5",0x649C],
- ["93D6",0x649D],
- ["D7B2",0x649E],
- ["93D7",0x649F],
- ["93D8",0x64A0],
- ["93D9",0x64A1],
- ["93DA",0x64A2],
- ["93DB",0x64A3],
- ["B3B7",0x64A4],
- ["93DC",0x64A5],
- ["93DD",0x64A6],
- ["93DE",0x64A7],
- ["93DF",0x64A8],
- ["C1C3",0x64A9],
- ["93E0",0x64AA],
- ["93E1",0x64AB],
- ["C7CB",0x64AC],
- ["B2A5",0x64AD],
- ["B4E9",0x64AE],
- ["93E2",0x64AF],
- ["D7AB",0x64B0],
- ["93E3",0x64B1],
- ["93E4",0x64B2],
- ["93E5",0x64B3],
- ["93E6",0x64B4],
- ["C4EC",0x64B5],
- ["93E7",0x64B6],
- ["DFA2",0x64B7],
- ["DFA3",0x64B8],
- ["93E8",0x64B9],
- ["DFA5",0x64BA],
- ["93E9",0x64BB],
- ["BAB3",0x64BC],
- ["93EA",0x64BD],
- ["93EB",0x64BE],
- ["93EC",0x64BF],
- ["DFA6",0x64C0],
- ["93ED",0x64C1],
- ["C0DE",0x64C2],
- ["93EE",0x64C3],
- ["93EF",0x64C4],
- ["C9C3",0x64C5],
- ["93F0",0x64C6],
- ["93F1",0x64C7],
- ["93F2",0x64C8],
- ["93F3",0x64C9],
- ["93F4",0x64CA],
- ["93F5",0x64CB],
- ["93F6",0x64CC],
- ["B2D9",0x64CD],
- ["C7E6",0x64CE],
- ["93F7",0x64CF],
- ["DFA7",0x64D0],
- ["93F8",0x64D1],
- ["C7DC",0x64D2],
- ["93F9",0x64D3],
- ["93FA",0x64D4],
- ["93FB",0x64D5],
- ["93FC",0x64D6],
- ["DFA8",0x64D7],
- ["EBA2",0x64D8],
- ["93FD",0x64D9],
- ["93FE",0x64DA],
- ["9440",0x64DB],
- ["9441",0x64DC],
- ["9442",0x64DD],
- ["CBD3",0x64DE],
- ["9443",0x64DF],
- ["9444",0x64E0],
- ["9445",0x64E1],
- ["DFAA",0x64E2],
- ["9446",0x64E3],
- ["DFA9",0x64E4],
- ["9447",0x64E5],
- ["B2C1",0x64E6],
- ["9448",0x64E7],
- ["9449",0x64E8],
- ["944A",0x64E9],
- ["944B",0x64EA],
- ["944C",0x64EB],
- ["944D",0x64EC],
- ["944E",0x64ED],
- ["944F",0x64EE],
- ["9450",0x64EF],
- ["9451",0x64F0],
- ["9452",0x64F1],
- ["9453",0x64F2],
- ["9454",0x64F3],
- ["9455",0x64F4],
- ["9456",0x64F5],
- ["9457",0x64F6],
- ["9458",0x64F7],
- ["9459",0x64F8],
- ["945A",0x64F9],
- ["945B",0x64FA],
- ["945C",0x64FB],
- ["945D",0x64FC],
- ["945E",0x64FD],
- ["945F",0x64FE],
- ["9460",0x64FF],
- ["C5CA",0x6500],
- ["9461",0x6501],
- ["9462",0x6502],
- ["9463",0x6503],
- ["9464",0x6504],
- ["9465",0x6505],
- ["9466",0x6506],
- ["9467",0x6507],
- ["9468",0x6508],
- ["DFAB",0x6509],
- ["9469",0x650A],
- ["946A",0x650B],
- ["946B",0x650C],
- ["946C",0x650D],
- ["946D",0x650E],
- ["946E",0x650F],
- ["946F",0x6510],
- ["9470",0x6511],
- ["D4DC",0x6512],
- ["9471",0x6513],
- ["9472",0x6514],
- ["9473",0x6515],
- ["9474",0x6516],
- ["9475",0x6517],
- ["C8C1",0x6518],
- ["9476",0x6519],
- ["9477",0x651A],
- ["9478",0x651B],
- ["9479",0x651C],
- ["947A",0x651D],
- ["947B",0x651E],
- ["947C",0x651F],
- ["947D",0x6520],
- ["947E",0x6521],
- ["9480",0x6522],
- ["9481",0x6523],
- ["9482",0x6524],
- ["DFAC",0x6525],
- ["9483",0x6526],
- ["9484",0x6527],
- ["9485",0x6528],
- ["9486",0x6529],
- ["9487",0x652A],
- ["BEF0",0x652B],
- ["9488",0x652C],
- ["9489",0x652D],
- ["DFAD",0x652E],
- ["D6A7",0x652F],
- ["948A",0x6530],
- ["948B",0x6531],
- ["948C",0x6532],
- ["948D",0x6533],
- ["EAB7",0x6534],
- ["EBB6",0x6535],
- ["CAD5",0x6536],
- ["948E",0x6537],
- ["D8FC",0x6538],
- ["B8C4",0x6539],
- ["948F",0x653A],
- ["B9A5",0x653B],
- ["9490",0x653C],
- ["9491",0x653D],
- ["B7C5",0x653E],
- ["D5FE",0x653F],
- ["9492",0x6540],
- ["9493",0x6541],
- ["9494",0x6542],
- ["9495",0x6543],
- ["9496",0x6544],
- ["B9CA",0x6545],
- ["9497",0x6546],
- ["9498",0x6547],
- ["D0A7",0x6548],
- ["F4CD",0x6549],
- ["9499",0x654A],
- ["949A",0x654B],
- ["B5D0",0x654C],
- ["949B",0x654D],
- ["949C",0x654E],
- ["C3F4",0x654F],
- ["949D",0x6550],
- ["BEC8",0x6551],
- ["949E",0x6552],
- ["949F",0x6553],
- ["94A0",0x6554],
- ["EBB7",0x6555],
- ["B0BD",0x6556],
- ["94A1",0x6557],
- ["94A2",0x6558],
- ["BDCC",0x6559],
- ["94A3",0x655A],
- ["C1B2",0x655B],
- ["94A4",0x655C],
- ["B1D6",0x655D],
- ["B3A8",0x655E],
- ["94A5",0x655F],
- ["94A6",0x6560],
- ["94A7",0x6561],
- ["B8D2",0x6562],
- ["C9A2",0x6563],
- ["94A8",0x6564],
- ["94A9",0x6565],
- ["B6D8",0x6566],
- ["94AA",0x6567],
- ["94AB",0x6568],
- ["94AC",0x6569],
- ["94AD",0x656A],
- ["EBB8",0x656B],
- ["BEB4",0x656C],
- ["94AE",0x656D],
- ["94AF",0x656E],
- ["94B0",0x656F],
- ["CAFD",0x6570],
- ["94B1",0x6571],
- ["C7C3",0x6572],
- ["94B2",0x6573],
- ["D5FB",0x6574],
- ["94B3",0x6575],
- ["94B4",0x6576],
- ["B7F3",0x6577],
- ["94B5",0x6578],
- ["94B6",0x6579],
- ["94B7",0x657A],
- ["94B8",0x657B],
- ["94B9",0x657C],
- ["94BA",0x657D],
- ["94BB",0x657E],
- ["94BC",0x657F],
- ["94BD",0x6580],
- ["94BE",0x6581],
- ["94BF",0x6582],
- ["94C0",0x6583],
- ["94C1",0x6584],
- ["94C2",0x6585],
- ["94C3",0x6586],
- ["CEC4",0x6587],
- ["94C4",0x6588],
- ["94C5",0x6589],
- ["94C6",0x658A],
- ["D5AB",0x658B],
- ["B1F3",0x658C],
- ["94C7",0x658D],
- ["94C8",0x658E],
- ["94C9",0x658F],
- ["ECB3",0x6590],
- ["B0DF",0x6591],
- ["94CA",0x6592],
- ["ECB5",0x6593],
- ["94CB",0x6594],
- ["94CC",0x6595],
- ["94CD",0x6596],
- ["B6B7",0x6597],
- ["94CE",0x6598],
- ["C1CF",0x6599],
- ["94CF",0x659A],
- ["F5FA",0x659B],
- ["D0B1",0x659C],
- ["94D0",0x659D],
- ["94D1",0x659E],
- ["D5E5",0x659F],
- ["94D2",0x65A0],
- ["CED3",0x65A1],
- ["94D3",0x65A2],
- ["94D4",0x65A3],
- ["BDEF",0x65A4],
- ["B3E2",0x65A5],
- ["94D5",0x65A6],
- ["B8AB",0x65A7],
- ["94D6",0x65A8],
- ["D5B6",0x65A9],
- ["94D7",0x65AA],
- ["EDBD",0x65AB],
- ["94D8",0x65AC],
- ["B6CF",0x65AD],
- ["94D9",0x65AE],
- ["CBB9",0x65AF],
- ["D0C2",0x65B0],
- ["94DA",0x65B1],
- ["94DB",0x65B2],
- ["94DC",0x65B3],
- ["94DD",0x65B4],
- ["94DE",0x65B5],
- ["94DF",0x65B6],
- ["94E0",0x65B7],
- ["94E1",0x65B8],
- ["B7BD",0x65B9],
- ["94E2",0x65BA],
- ["94E3",0x65BB],
- ["ECB6",0x65BC],
- ["CAA9",0x65BD],
- ["94E4",0x65BE],
- ["94E5",0x65BF],
- ["94E6",0x65C0],
- ["C5D4",0x65C1],
- ["94E7",0x65C2],
- ["ECB9",0x65C3],
- ["ECB8",0x65C4],
- ["C2C3",0x65C5],
- ["ECB7",0x65C6],
- ["94E8",0x65C7],
- ["94E9",0x65C8],
- ["94EA",0x65C9],
- ["94EB",0x65CA],
- ["D0FD",0x65CB],
- ["ECBA",0x65CC],
- ["94EC",0x65CD],
- ["ECBB",0x65CE],
- ["D7E5",0x65CF],
- ["94ED",0x65D0],
- ["94EE",0x65D1],
- ["ECBC",0x65D2],
- ["94EF",0x65D3],
- ["94F0",0x65D4],
- ["94F1",0x65D5],
- ["ECBD",0x65D6],
- ["C6EC",0x65D7],
- ["94F2",0x65D8],
- ["94F3",0x65D9],
- ["94F4",0x65DA],
- ["94F5",0x65DB],
- ["94F6",0x65DC],
- ["94F7",0x65DD],
- ["94F8",0x65DE],
- ["94F9",0x65DF],
- ["CEDE",0x65E0],
- ["94FA",0x65E1],
- ["BCC8",0x65E2],
- ["94FB",0x65E3],
- ["94FC",0x65E4],
- ["C8D5",0x65E5],
- ["B5A9",0x65E6],
- ["BEC9",0x65E7],
- ["D6BC",0x65E8],
- ["D4E7",0x65E9],
- ["94FD",0x65EA],
- ["94FE",0x65EB],
- ["D1AE",0x65EC],
- ["D0F1",0x65ED],
- ["EAB8",0x65EE],
- ["EAB9",0x65EF],
- ["EABA",0x65F0],
- ["BAB5",0x65F1],
- ["9540",0x65F2],
- ["9541",0x65F3],
- ["9542",0x65F4],
- ["9543",0x65F5],
- ["CAB1",0x65F6],
- ["BFF5",0x65F7],
- ["9544",0x65F8],
- ["9545",0x65F9],
- ["CDFA",0x65FA],
- ["9546",0x65FB],
- ["9547",0x65FC],
- ["9548",0x65FD],
- ["9549",0x65FE],
- ["954A",0x65FF],
- ["EAC0",0x6600],
- ["954B",0x6601],
- ["B0BA",0x6602],
- ["EABE",0x6603],
- ["954C",0x6604],
- ["954D",0x6605],
- ["C0A5",0x6606],
- ["954E",0x6607],
- ["954F",0x6608],
- ["9550",0x6609],
- ["EABB",0x660A],
- ["9551",0x660B],
- ["B2FD",0x660C],
- ["9552",0x660D],
- ["C3F7",0x660E],
- ["BBE8",0x660F],
- ["9553",0x6610],
- ["9554",0x6611],
- ["9555",0x6612],
- ["D2D7",0x6613],
- ["CEF4",0x6614],
- ["EABF",0x6615],
- ["9556",0x6616],
- ["9557",0x6617],
- ["9558",0x6618],
- ["EABC",0x6619],
- ["9559",0x661A],
- ["955A",0x661B],
- ["955B",0x661C],
- ["EAC3",0x661D],
- ["955C",0x661E],
- ["D0C7",0x661F],
- ["D3B3",0x6620],
- ["955D",0x6621],
- ["955E",0x6622],
- ["955F",0x6623],
- ["9560",0x6624],
- ["B4BA",0x6625],
- ["9561",0x6626],
- ["C3C1",0x6627],
- ["D7F2",0x6628],
- ["9562",0x6629],
- ["9563",0x662A],
- ["9564",0x662B],
- ["9565",0x662C],
- ["D5D1",0x662D],
- ["9566",0x662E],
- ["CAC7",0x662F],
- ["9567",0x6630],
- ["EAC5",0x6631],
- ["9568",0x6632],
- ["9569",0x6633],
- ["EAC4",0x6634],
- ["EAC7",0x6635],
- ["EAC6",0x6636],
- ["956A",0x6637],
- ["956B",0x6638],
- ["956C",0x6639],
- ["956D",0x663A],
- ["956E",0x663B],
- ["D6E7",0x663C],
- ["956F",0x663D],
- ["CFD4",0x663E],
- ["9570",0x663F],
- ["9571",0x6640],
- ["EACB",0x6641],
- ["9572",0x6642],
- ["BBCE",0x6643],
- ["9573",0x6644],
- ["9574",0x6645],
- ["9575",0x6646],
- ["9576",0x6647],
- ["9577",0x6648],
- ["9578",0x6649],
- ["9579",0x664A],
- ["BDFA",0x664B],
- ["C9CE",0x664C],
- ["957A",0x664D],
- ["957B",0x664E],
- ["EACC",0x664F],
- ["957C",0x6650],
- ["957D",0x6651],
- ["C9B9",0x6652],
- ["CFFE",0x6653],
- ["EACA",0x6654],
- ["D4CE",0x6655],
- ["EACD",0x6656],
- ["EACF",0x6657],
- ["957E",0x6658],
- ["9580",0x6659],
- ["CDED",0x665A],
- ["9581",0x665B],
- ["9582",0x665C],
- ["9583",0x665D],
- ["9584",0x665E],
- ["EAC9",0x665F],
- ["9585",0x6660],
- ["EACE",0x6661],
- ["9586",0x6662],
- ["9587",0x6663],
- ["CEEE",0x6664],
- ["9588",0x6665],
- ["BBDE",0x6666],
- ["9589",0x6667],
- ["B3BF",0x6668],
- ["958A",0x6669],
- ["958B",0x666A],
- ["958C",0x666B],
- ["958D",0x666C],
- ["958E",0x666D],
- ["C6D5",0x666E],
- ["BEB0",0x666F],
- ["CEFA",0x6670],
- ["958F",0x6671],
- ["9590",0x6672],
- ["9591",0x6673],
- ["C7E7",0x6674],
- ["9592",0x6675],
- ["BEA7",0x6676],
- ["EAD0",0x6677],
- ["9593",0x6678],
- ["9594",0x6679],
- ["D6C7",0x667A],
- ["9595",0x667B],
- ["9596",0x667C],
- ["9597",0x667D],
- ["C1C0",0x667E],
- ["9598",0x667F],
- ["9599",0x6680],
- ["959A",0x6681],
- ["D4DD",0x6682],
- ["959B",0x6683],
- ["EAD1",0x6684],
- ["959C",0x6685],
- ["959D",0x6686],
- ["CFBE",0x6687],
- ["959E",0x6688],
- ["959F",0x6689],
- ["95A0",0x668A],
- ["95A1",0x668B],
- ["EAD2",0x668C],
- ["95A2",0x668D],
- ["95A3",0x668E],
- ["95A4",0x668F],
- ["95A5",0x6690],
- ["CAEE",0x6691],
- ["95A6",0x6692],
- ["95A7",0x6693],
- ["95A8",0x6694],
- ["95A9",0x6695],
- ["C5AF",0x6696],
- ["B0B5",0x6697],
- ["95AA",0x6698],
- ["95AB",0x6699],
- ["95AC",0x669A],
- ["95AD",0x669B],
- ["95AE",0x669C],
- ["EAD4",0x669D],
- ["95AF",0x669E],
- ["95B0",0x669F],
- ["95B1",0x66A0],
- ["95B2",0x66A1],
- ["95B3",0x66A2],
- ["95B4",0x66A3],
- ["95B5",0x66A4],
- ["95B6",0x66A5],
- ["95B7",0x66A6],
- ["EAD3",0x66A7],
- ["F4DF",0x66A8],
- ["95B8",0x66A9],
- ["95B9",0x66AA],
- ["95BA",0x66AB],
- ["95BB",0x66AC],
- ["95BC",0x66AD],
- ["C4BA",0x66AE],
- ["95BD",0x66AF],
- ["95BE",0x66B0],
- ["95BF",0x66B1],
- ["95C0",0x66B2],
- ["95C1",0x66B3],
- ["B1A9",0x66B4],
- ["95C2",0x66B5],
- ["95C3",0x66B6],
- ["95C4",0x66B7],
- ["95C5",0x66B8],
- ["E5DF",0x66B9],
- ["95C6",0x66BA],
- ["95C7",0x66BB],
- ["95C8",0x66BC],
- ["95C9",0x66BD],
- ["EAD5",0x66BE],
- ["95CA",0x66BF],
- ["95CB",0x66C0],
- ["95CC",0x66C1],
- ["95CD",0x66C2],
- ["95CE",0x66C3],
- ["95CF",0x66C4],
- ["95D0",0x66C5],
- ["95D1",0x66C6],
- ["95D2",0x66C7],
- ["95D3",0x66C8],
- ["95D4",0x66C9],
- ["95D5",0x66CA],
- ["95D6",0x66CB],
- ["95D7",0x66CC],
- ["95D8",0x66CD],
- ["95D9",0x66CE],
- ["95DA",0x66CF],
- ["95DB",0x66D0],
- ["95DC",0x66D1],
- ["95DD",0x66D2],
- ["95DE",0x66D3],
- ["95DF",0x66D4],
- ["95E0",0x66D5],
- ["95E1",0x66D6],
- ["95E2",0x66D7],
- ["95E3",0x66D8],
- ["CAEF",0x66D9],
- ["95E4",0x66DA],
- ["EAD6",0x66DB],
- ["EAD7",0x66DC],
- ["C6D8",0x66DD],
- ["95E5",0x66DE],
- ["95E6",0x66DF],
- ["95E7",0x66E0],
- ["95E8",0x66E1],
- ["95E9",0x66E2],
- ["95EA",0x66E3],
- ["95EB",0x66E4],
- ["95EC",0x66E5],
- ["EAD8",0x66E6],
- ["95ED",0x66E7],
- ["95EE",0x66E8],
- ["EAD9",0x66E9],
- ["95EF",0x66EA],
- ["95F0",0x66EB],
- ["95F1",0x66EC],
- ["95F2",0x66ED],
- ["95F3",0x66EE],
- ["95F4",0x66EF],
- ["D4BB",0x66F0],
- ["95F5",0x66F1],
- ["C7FA",0x66F2],
- ["D2B7",0x66F3],
- ["B8FC",0x66F4],
- ["95F6",0x66F5],
- ["95F7",0x66F6],
- ["EAC2",0x66F7],
- ["95F8",0x66F8],
- ["B2DC",0x66F9],
- ["95F9",0x66FA],
- ["95FA",0x66FB],
- ["C2FC",0x66FC],
- ["95FB",0x66FD],
- ["D4F8",0x66FE],
- ["CCE6",0x66FF],
- ["D7EE",0x6700],
- ["95FC",0x6701],
- ["95FD",0x6702],
- ["95FE",0x6703],
- ["9640",0x6704],
- ["9641",0x6705],
- ["9642",0x6706],
- ["9643",0x6707],
- ["D4C2",0x6708],
- ["D3D0",0x6709],
- ["EBC3",0x670A],
- ["C5F3",0x670B],
- ["9644",0x670C],
- ["B7FE",0x670D],
- ["9645",0x670E],
- ["9646",0x670F],
- ["EBD4",0x6710],
- ["9647",0x6711],
- ["9648",0x6712],
- ["9649",0x6713],
- ["CBB7",0x6714],
- ["EBDE",0x6715],
- ["964A",0x6716],
- ["C0CA",0x6717],
- ["964B",0x6718],
- ["964C",0x6719],
- ["964D",0x671A],
- ["CDFB",0x671B],
- ["964E",0x671C],
- ["B3AF",0x671D],
- ["964F",0x671E],
- ["C6DA",0x671F],
- ["9650",0x6720],
- ["9651",0x6721],
- ["9652",0x6722],
- ["9653",0x6723],
- ["9654",0x6724],
- ["9655",0x6725],
- ["EBFC",0x6726],
- ["9656",0x6727],
- ["C4BE",0x6728],
- ["9657",0x6729],
- ["CEB4",0x672A],
- ["C4A9",0x672B],
- ["B1BE",0x672C],
- ["D4FD",0x672D],
- ["9658",0x672E],
- ["CAF5",0x672F],
- ["9659",0x6730],
- ["D6EC",0x6731],
- ["965A",0x6732],
- ["965B",0x6733],
- ["C6D3",0x6734],
- ["B6E4",0x6735],
- ["965C",0x6736],
- ["965D",0x6737],
- ["965E",0x6738],
- ["965F",0x6739],
- ["BBFA",0x673A],
- ["9660",0x673B],
- ["9661",0x673C],
- ["D0E0",0x673D],
- ["9662",0x673E],
- ["9663",0x673F],
- ["C9B1",0x6740],
- ["9664",0x6741],
- ["D4D3",0x6742],
- ["C8A8",0x6743],
- ["9665",0x6744],
- ["9666",0x6745],
- ["B8CB",0x6746],
- ["9667",0x6747],
- ["E8BE",0x6748],
- ["C9BC",0x6749],
- ["9668",0x674A],
- ["9669",0x674B],
- ["E8BB",0x674C],
- ["966A",0x674D],
- ["C0EE",0x674E],
- ["D0D3",0x674F],
- ["B2C4",0x6750],
- ["B4E5",0x6751],
- ["966B",0x6752],
- ["E8BC",0x6753],
- ["966C",0x6754],
- ["966D",0x6755],
- ["D5C8",0x6756],
- ["966E",0x6757],
- ["966F",0x6758],
- ["9670",0x6759],
- ["9671",0x675A],
- ["9672",0x675B],
- ["B6C5",0x675C],
- ["9673",0x675D],
- ["E8BD",0x675E],
- ["CAF8",0x675F],
- ["B8DC",0x6760],
- ["CCF5",0x6761],
- ["9674",0x6762],
- ["9675",0x6763],
- ["9676",0x6764],
- ["C0B4",0x6765],
- ["9677",0x6766],
- ["9678",0x6767],
- ["D1EE",0x6768],
- ["E8BF",0x6769],
- ["E8C2",0x676A],
- ["9679",0x676B],
- ["967A",0x676C],
- ["BABC",0x676D],
- ["967B",0x676E],
- ["B1AD",0x676F],
- ["BDDC",0x6770],
- ["967C",0x6771],
- ["EABD",0x6772],
- ["E8C3",0x6773],
- ["967D",0x6774],
- ["E8C6",0x6775],
- ["967E",0x6776],
- ["E8CB",0x6777],
- ["9680",0x6778],
- ["9681",0x6779],
- ["9682",0x677A],
- ["9683",0x677B],
- ["E8CC",0x677C],
- ["9684",0x677D],
- ["CBC9",0x677E],
- ["B0E5",0x677F],
- ["9685",0x6780],
- ["BCAB",0x6781],
- ["9686",0x6782],
- ["9687",0x6783],
- ["B9B9",0x6784],
- ["9688",0x6785],
- ["9689",0x6786],
- ["E8C1",0x6787],
- ["968A",0x6788],
- ["CDF7",0x6789],
- ["968B",0x678A],
- ["E8CA",0x678B],
- ["968C",0x678C],
- ["968D",0x678D],
- ["968E",0x678E],
- ["968F",0x678F],
- ["CEF6",0x6790],
- ["9690",0x6791],
- ["9691",0x6792],
- ["9692",0x6793],
- ["9693",0x6794],
- ["D5ED",0x6795],
- ["9694",0x6796],
- ["C1D6",0x6797],
- ["E8C4",0x6798],
- ["9695",0x6799],
- ["C3B6",0x679A],
- ["9696",0x679B],
- ["B9FB",0x679C],
- ["D6A6",0x679D],
- ["E8C8",0x679E],
- ["9697",0x679F],
- ["9698",0x67A0],
- ["9699",0x67A1],
- ["CAE0",0x67A2],
- ["D4E6",0x67A3],
- ["969A",0x67A4],
- ["E8C0",0x67A5],
- ["969B",0x67A6],
- ["E8C5",0x67A7],
- ["E8C7",0x67A8],
- ["969C",0x67A9],
- ["C7B9",0x67AA],
- ["B7E3",0x67AB],
- ["969D",0x67AC],
- ["E8C9",0x67AD],
- ["969E",0x67AE],
- ["BFDD",0x67AF],
- ["E8D2",0x67B0],
- ["969F",0x67B1],
- ["96A0",0x67B2],
- ["E8D7",0x67B3],
- ["96A1",0x67B4],
- ["E8D5",0x67B5],
- ["BCDC",0x67B6],
- ["BCCF",0x67B7],
- ["E8DB",0x67B8],
- ["96A2",0x67B9],
- ["96A3",0x67BA],
- ["96A4",0x67BB],
- ["96A5",0x67BC],
- ["96A6",0x67BD],
- ["96A7",0x67BE],
- ["96A8",0x67BF],
- ["96A9",0x67C0],
- ["E8DE",0x67C1],
- ["96AA",0x67C2],
- ["E8DA",0x67C3],
- ["B1FA",0x67C4],
- ["96AB",0x67C5],
- ["96AC",0x67C6],
- ["96AD",0x67C7],
- ["96AE",0x67C8],
- ["96AF",0x67C9],
- ["96B0",0x67CA],
- ["96B1",0x67CB],
- ["96B2",0x67CC],
- ["96B3",0x67CD],
- ["96B4",0x67CE],
- ["B0D8",0x67CF],
- ["C4B3",0x67D0],
- ["B8CC",0x67D1],
- ["C6E2",0x67D2],
- ["C8BE",0x67D3],
- ["C8E1",0x67D4],
- ["96B5",0x67D5],
- ["96B6",0x67D6],
- ["96B7",0x67D7],
- ["E8CF",0x67D8],
- ["E8D4",0x67D9],
- ["E8D6",0x67DA],
- ["96B8",0x67DB],
- ["B9F1",0x67DC],
- ["E8D8",0x67DD],
- ["D7F5",0x67DE],
- ["96B9",0x67DF],
- ["C4FB",0x67E0],
- ["96BA",0x67E1],
- ["E8DC",0x67E2],
- ["96BB",0x67E3],
- ["96BC",0x67E4],
- ["B2E9",0x67E5],
- ["96BD",0x67E6],
- ["96BE",0x67E7],
- ["96BF",0x67E8],
- ["E8D1",0x67E9],
- ["96C0",0x67EA],
- ["96C1",0x67EB],
- ["BCED",0x67EC],
- ["96C2",0x67ED],
- ["96C3",0x67EE],
- ["BFC2",0x67EF],
- ["E8CD",0x67F0],
- ["D6F9",0x67F1],
- ["96C4",0x67F2],
- ["C1F8",0x67F3],
- ["B2F1",0x67F4],
- ["96C5",0x67F5],
- ["96C6",0x67F6],
- ["96C7",0x67F7],
- ["96C8",0x67F8],
- ["96C9",0x67F9],
- ["96CA",0x67FA],
- ["96CB",0x67FB],
- ["96CC",0x67FC],
- ["E8DF",0x67FD],
- ["96CD",0x67FE],
- ["CAC1",0x67FF],
- ["E8D9",0x6800],
- ["96CE",0x6801],
- ["96CF",0x6802],
- ["96D0",0x6803],
- ["96D1",0x6804],
- ["D5A4",0x6805],
- ["96D2",0x6806],
- ["B1EA",0x6807],
- ["D5BB",0x6808],
- ["E8CE",0x6809],
- ["E8D0",0x680A],
- ["B6B0",0x680B],
- ["E8D3",0x680C],
- ["96D3",0x680D],
- ["E8DD",0x680E],
- ["C0B8",0x680F],
- ["96D4",0x6810],
- ["CAF7",0x6811],
- ["96D5",0x6812],
- ["CBA8",0x6813],
- ["96D6",0x6814],
- ["96D7",0x6815],
- ["C6DC",0x6816],
- ["C0F5",0x6817],
- ["96D8",0x6818],
- ["96D9",0x6819],
- ["96DA",0x681A],
- ["96DB",0x681B],
- ["96DC",0x681C],
- ["E8E9",0x681D],
- ["96DD",0x681E],
- ["96DE",0x681F],
- ["96DF",0x6820],
- ["D0A3",0x6821],
- ["96E0",0x6822],
- ["96E1",0x6823],
- ["96E2",0x6824],
- ["96E3",0x6825],
- ["96E4",0x6826],
- ["96E5",0x6827],
- ["96E6",0x6828],
- ["E8F2",0x6829],
- ["D6EA",0x682A],
- ["96E7",0x682B],
- ["96E8",0x682C],
- ["96E9",0x682D],
- ["96EA",0x682E],
- ["96EB",0x682F],
- ["96EC",0x6830],
- ["96ED",0x6831],
- ["E8E0",0x6832],
- ["E8E1",0x6833],
- ["96EE",0x6834],
- ["96EF",0x6835],
- ["96F0",0x6836],
- ["D1F9",0x6837],
- ["BACB",0x6838],
- ["B8F9",0x6839],
- ["96F1",0x683A],
- ["96F2",0x683B],
- ["B8F1",0x683C],
- ["D4D4",0x683D],
- ["E8EF",0x683E],
- ["96F3",0x683F],
- ["E8EE",0x6840],
- ["E8EC",0x6841],
- ["B9F0",0x6842],
- ["CCD2",0x6843],
- ["E8E6",0x6844],
- ["CEA6",0x6845],
- ["BFF2",0x6846],
- ["96F4",0x6847],
- ["B0B8",0x6848],
- ["E8F1",0x6849],
- ["E8F0",0x684A],
- ["96F5",0x684B],
- ["D7C0",0x684C],
- ["96F6",0x684D],
- ["E8E4",0x684E],
- ["96F7",0x684F],
- ["CDA9",0x6850],
- ["C9A3",0x6851],
- ["96F8",0x6852],
- ["BBB8",0x6853],
- ["BDDB",0x6854],
- ["E8EA",0x6855],
- ["96F9",0x6856],
- ["96FA",0x6857],
- ["96FB",0x6858],
- ["96FC",0x6859],
- ["96FD",0x685A],
- ["96FE",0x685B],
- ["9740",0x685C],
- ["9741",0x685D],
- ["9742",0x685E],
- ["9743",0x685F],
- ["E8E2",0x6860],
- ["E8E3",0x6861],
- ["E8E5",0x6862],
- ["B5B5",0x6863],
- ["E8E7",0x6864],
- ["C7C5",0x6865],
- ["E8EB",0x6866],
- ["E8ED",0x6867],
- ["BDB0",0x6868],
- ["D7AE",0x6869],
- ["9744",0x686A],
- ["E8F8",0x686B],
- ["9745",0x686C],
- ["9746",0x686D],
- ["9747",0x686E],
- ["9748",0x686F],
- ["9749",0x6870],
- ["974A",0x6871],
- ["974B",0x6872],
- ["974C",0x6873],
- ["E8F5",0x6874],
- ["974D",0x6875],
- ["CDB0",0x6876],
- ["E8F6",0x6877],
- ["974E",0x6878],
- ["974F",0x6879],
- ["9750",0x687A],
- ["9751",0x687B],
- ["9752",0x687C],
- ["9753",0x687D],
- ["9754",0x687E],
- ["9755",0x687F],
- ["9756",0x6880],
- ["C1BA",0x6881],
- ["9757",0x6882],
- ["E8E8",0x6883],
- ["9758",0x6884],
- ["C3B7",0x6885],
- ["B0F0",0x6886],
- ["9759",0x6887],
- ["975A",0x6888],
- ["975B",0x6889],
- ["975C",0x688A],
- ["975D",0x688B],
- ["975E",0x688C],
- ["975F",0x688D],
- ["9760",0x688E],
- ["E8F4",0x688F],
- ["9761",0x6890],
- ["9762",0x6891],
- ["9763",0x6892],
- ["E8F7",0x6893],
- ["9764",0x6894],
- ["9765",0x6895],
- ["9766",0x6896],
- ["B9A3",0x6897],
- ["9767",0x6898],
- ["9768",0x6899],
- ["9769",0x689A],
- ["976A",0x689B],
- ["976B",0x689C],
- ["976C",0x689D],
- ["976D",0x689E],
- ["976E",0x689F],
- ["976F",0x68A0],
- ["9770",0x68A1],
- ["C9D2",0x68A2],
- ["9771",0x68A3],
- ["9772",0x68A4],
- ["9773",0x68A5],
- ["C3CE",0x68A6],
- ["CEE0",0x68A7],
- ["C0E6",0x68A8],
- ["9774",0x68A9],
- ["9775",0x68AA],
- ["9776",0x68AB],
- ["9777",0x68AC],
- ["CBF3",0x68AD],
- ["9778",0x68AE],
- ["CCDD",0x68AF],
- ["D0B5",0x68B0],
- ["9779",0x68B1],
- ["977A",0x68B2],
- ["CAE1",0x68B3],
- ["977B",0x68B4],
- ["E8F3",0x68B5],
- ["977C",0x68B6],
- ["977D",0x68B7],
- ["977E",0x68B8],
- ["9780",0x68B9],
- ["9781",0x68BA],
- ["9782",0x68BB],
- ["9783",0x68BC],
- ["9784",0x68BD],
- ["9785",0x68BE],
- ["9786",0x68BF],
- ["BCEC",0x68C0],
- ["9787",0x68C1],
- ["E8F9",0x68C2],
- ["9788",0x68C3],
- ["9789",0x68C4],
- ["978A",0x68C5],
- ["978B",0x68C6],
- ["978C",0x68C7],
- ["978D",0x68C8],
- ["C3DE",0x68C9],
- ["978E",0x68CA],
- ["C6E5",0x68CB],
- ["978F",0x68CC],
- ["B9F7",0x68CD],
- ["9790",0x68CE],
- ["9791",0x68CF],
- ["9792",0x68D0],
- ["9793",0x68D1],
- ["B0F4",0x68D2],
- ["9794",0x68D3],
- ["9795",0x68D4],
- ["D7D8",0x68D5],
- ["9796",0x68D6],
- ["9797",0x68D7],
- ["BCAC",0x68D8],
- ["9798",0x68D9],
- ["C5EF",0x68DA],
- ["9799",0x68DB],
- ["979A",0x68DC],
- ["979B",0x68DD],
- ["979C",0x68DE],
- ["979D",0x68DF],
- ["CCC4",0x68E0],
- ["979E",0x68E1],
- ["979F",0x68E2],
- ["E9A6",0x68E3],
- ["97A0",0x68E4],
- ["97A1",0x68E5],
- ["97A2",0x68E6],
- ["97A3",0x68E7],
- ["97A4",0x68E8],
- ["97A5",0x68E9],
- ["97A6",0x68EA],
- ["97A7",0x68EB],
- ["97A8",0x68EC],
- ["97A9",0x68ED],
- ["C9AD",0x68EE],
- ["97AA",0x68EF],
- ["E9A2",0x68F0],
- ["C0E2",0x68F1],
- ["97AB",0x68F2],
- ["97AC",0x68F3],
- ["97AD",0x68F4],
- ["BFC3",0x68F5],
- ["97AE",0x68F6],
- ["97AF",0x68F7],
- ["97B0",0x68F8],
- ["E8FE",0x68F9],
- ["B9D7",0x68FA],
- ["97B1",0x68FB],
- ["E8FB",0x68FC],
- ["97B2",0x68FD],
- ["97B3",0x68FE],
- ["97B4",0x68FF],
- ["97B5",0x6900],
- ["E9A4",0x6901],
- ["97B6",0x6902],
- ["97B7",0x6903],
- ["97B8",0x6904],
- ["D2CE",0x6905],
- ["97B9",0x6906],
- ["97BA",0x6907],
- ["97BB",0x6908],
- ["97BC",0x6909],
- ["97BD",0x690A],
- ["E9A3",0x690B],
- ["97BE",0x690C],
- ["D6B2",0x690D],
- ["D7B5",0x690E],
- ["97BF",0x690F],
- ["E9A7",0x6910],
- ["97C0",0x6911],
- ["BDB7",0x6912],
- ["97C1",0x6913],
- ["97C2",0x6914],
- ["97C3",0x6915],
- ["97C4",0x6916],
- ["97C5",0x6917],
- ["97C6",0x6918],
- ["97C7",0x6919],
- ["97C8",0x691A],
- ["97C9",0x691B],
- ["97CA",0x691C],
- ["97CB",0x691D],
- ["97CC",0x691E],
- ["E8FC",0x691F],
- ["E8FD",0x6920],
- ["97CD",0x6921],
- ["97CE",0x6922],
- ["97CF",0x6923],
- ["E9A1",0x6924],
- ["97D0",0x6925],
- ["97D1",0x6926],
- ["97D2",0x6927],
- ["97D3",0x6928],
- ["97D4",0x6929],
- ["97D5",0x692A],
- ["97D6",0x692B],
- ["97D7",0x692C],
- ["CDD6",0x692D],
- ["97D8",0x692E],
- ["97D9",0x692F],
- ["D2AC",0x6930],
- ["97DA",0x6931],
- ["97DB",0x6932],
- ["97DC",0x6933],
- ["E9B2",0x6934],
- ["97DD",0x6935],
- ["97DE",0x6936],
- ["97DF",0x6937],
- ["97E0",0x6938],
- ["E9A9",0x6939],
- ["97E1",0x693A],
- ["97E2",0x693B],
- ["97E3",0x693C],
- ["B4AA",0x693D],
- ["97E4",0x693E],
- ["B4BB",0x693F],
- ["97E5",0x6940],
- ["97E6",0x6941],
- ["E9AB",0x6942],
- ["97E7",0x6943],
- ["97E8",0x6944],
- ["97E9",0x6945],
- ["97EA",0x6946],
- ["97EB",0x6947],
- ["97EC",0x6948],
- ["97ED",0x6949],
- ["97EE",0x694A],
- ["97EF",0x694B],
- ["97F0",0x694C],
- ["97F1",0x694D],
- ["97F2",0x694E],
- ["97F3",0x694F],
- ["97F4",0x6950],
- ["97F5",0x6951],
- ["97F6",0x6952],
- ["97F7",0x6953],
- ["D0A8",0x6954],
- ["97F8",0x6955],
- ["97F9",0x6956],
- ["E9A5",0x6957],
- ["97FA",0x6958],
- ["97FB",0x6959],
- ["B3FE",0x695A],
- ["97FC",0x695B],
- ["97FD",0x695C],
- ["E9AC",0x695D],
- ["C0E3",0x695E],
- ["97FE",0x695F],
- ["E9AA",0x6960],
- ["9840",0x6961],
- ["9841",0x6962],
- ["E9B9",0x6963],
- ["9842",0x6964],
- ["9843",0x6965],
- ["E9B8",0x6966],
- ["9844",0x6967],
- ["9845",0x6968],
- ["9846",0x6969],
- ["9847",0x696A],
- ["E9AE",0x696B],
- ["9848",0x696C],
- ["9849",0x696D],
- ["E8FA",0x696E],
- ["984A",0x696F],
- ["984B",0x6970],
- ["E9A8",0x6971],
- ["984C",0x6972],
- ["984D",0x6973],
- ["984E",0x6974],
- ["984F",0x6975],
- ["9850",0x6976],
- ["BFAC",0x6977],
- ["E9B1",0x6978],
- ["E9BA",0x6979],
- ["9851",0x697A],
- ["9852",0x697B],
- ["C2A5",0x697C],
- ["9853",0x697D],
- ["9854",0x697E],
- ["9855",0x697F],
- ["E9AF",0x6980],
- ["9856",0x6981],
- ["B8C5",0x6982],
- ["9857",0x6983],
- ["E9AD",0x6984],
- ["9858",0x6985],
- ["D3DC",0x6986],
- ["E9B4",0x6987],
- ["E9B5",0x6988],
- ["E9B7",0x6989],
- ["9859",0x698A],
- ["985A",0x698B],
- ["985B",0x698C],
- ["E9C7",0x698D],
- ["985C",0x698E],
- ["985D",0x698F],
- ["985E",0x6990],
- ["985F",0x6991],
- ["9860",0x6992],
- ["9861",0x6993],
- ["C0C6",0x6994],
- ["E9C5",0x6995],
- ["9862",0x6996],
- ["9863",0x6997],
- ["E9B0",0x6998],
- ["9864",0x6999],
- ["9865",0x699A],
- ["E9BB",0x699B],
- ["B0F1",0x699C],
- ["9866",0x699D],
- ["9867",0x699E],
- ["9868",0x699F],
- ["9869",0x69A0],
- ["986A",0x69A1],
- ["986B",0x69A2],
- ["986C",0x69A3],
- ["986D",0x69A4],
- ["986E",0x69A5],
- ["986F",0x69A6],
- ["E9BC",0x69A7],
- ["D5A5",0x69A8],
- ["9870",0x69A9],
- ["9871",0x69AA],
- ["E9BE",0x69AB],
- ["9872",0x69AC],
- ["E9BF",0x69AD],
- ["9873",0x69AE],
- ["9874",0x69AF],
- ["9875",0x69B0],
- ["E9C1",0x69B1],
- ["9876",0x69B2],
- ["9877",0x69B3],
- ["C1F1",0x69B4],
- ["9878",0x69B5],
- ["9879",0x69B6],
- ["C8B6",0x69B7],
- ["987A",0x69B8],
- ["987B",0x69B9],
- ["987C",0x69BA],
- ["E9BD",0x69BB],
- ["987D",0x69BC],
- ["987E",0x69BD],
- ["9880",0x69BE],
- ["9881",0x69BF],
- ["9882",0x69C0],
- ["E9C2",0x69C1],
- ["9883",0x69C2],
- ["9884",0x69C3],
- ["9885",0x69C4],
- ["9886",0x69C5],
- ["9887",0x69C6],
- ["9888",0x69C7],
- ["9889",0x69C8],
- ["988A",0x69C9],
- ["E9C3",0x69CA],
- ["988B",0x69CB],
- ["E9B3",0x69CC],
- ["988C",0x69CD],
- ["E9B6",0x69CE],
- ["988D",0x69CF],
- ["BBB1",0x69D0],
- ["988E",0x69D1],
- ["988F",0x69D2],
- ["9890",0x69D3],
- ["E9C0",0x69D4],
- ["9891",0x69D5],
- ["9892",0x69D6],
- ["9893",0x69D7],
- ["9894",0x69D8],
- ["9895",0x69D9],
- ["9896",0x69DA],
- ["BCF7",0x69DB],
- ["9897",0x69DC],
- ["9898",0x69DD],
- ["9899",0x69DE],
- ["E9C4",0x69DF],
- ["E9C6",0x69E0],
- ["989A",0x69E1],
- ["989B",0x69E2],
- ["989C",0x69E3],
- ["989D",0x69E4],
- ["989E",0x69E5],
- ["989F",0x69E6],
- ["98A0",0x69E7],
- ["98A1",0x69E8],
- ["98A2",0x69E9],
- ["98A3",0x69EA],
- ["98A4",0x69EB],
- ["98A5",0x69EC],
- ["E9CA",0x69ED],
- ["98A6",0x69EE],
- ["98A7",0x69EF],
- ["98A8",0x69F0],
- ["98A9",0x69F1],
- ["E9CE",0x69F2],
- ["98AA",0x69F3],
- ["98AB",0x69F4],
- ["98AC",0x69F5],
- ["98AD",0x69F6],
- ["98AE",0x69F7],
- ["98AF",0x69F8],
- ["98B0",0x69F9],
- ["98B1",0x69FA],
- ["98B2",0x69FB],
- ["98B3",0x69FC],
- ["B2DB",0x69FD],
- ["98B4",0x69FE],
- ["E9C8",0x69FF],
- ["98B5",0x6A00],
- ["98B6",0x6A01],
- ["98B7",0x6A02],
- ["98B8",0x6A03],
- ["98B9",0x6A04],
- ["98BA",0x6A05],
- ["98BB",0x6A06],
- ["98BC",0x6A07],
- ["98BD",0x6A08],
- ["98BE",0x6A09],
- ["B7AE",0x6A0A],
- ["98BF",0x6A0B],
- ["98C0",0x6A0C],
- ["98C1",0x6A0D],
- ["98C2",0x6A0E],
- ["98C3",0x6A0F],
- ["98C4",0x6A10],
- ["98C5",0x6A11],
- ["98C6",0x6A12],
- ["98C7",0x6A13],
- ["98C8",0x6A14],
- ["98C9",0x6A15],
- ["98CA",0x6A16],
- ["E9CB",0x6A17],
- ["E9CC",0x6A18],
- ["98CB",0x6A19],
- ["98CC",0x6A1A],
- ["98CD",0x6A1B],
- ["98CE",0x6A1C],
- ["98CF",0x6A1D],
- ["98D0",0x6A1E],
- ["D5C1",0x6A1F],
- ["98D1",0x6A20],
- ["C4A3",0x6A21],
- ["98D2",0x6A22],
- ["98D3",0x6A23],
- ["98D4",0x6A24],
- ["98D5",0x6A25],
- ["98D6",0x6A26],
- ["98D7",0x6A27],
- ["E9D8",0x6A28],
- ["98D8",0x6A29],
- ["BAE1",0x6A2A],
- ["98D9",0x6A2B],
- ["98DA",0x6A2C],
- ["98DB",0x6A2D],
- ["98DC",0x6A2E],
- ["E9C9",0x6A2F],
- ["98DD",0x6A30],
- ["D3A3",0x6A31],
- ["98DE",0x6A32],
- ["98DF",0x6A33],
- ["98E0",0x6A34],
- ["E9D4",0x6A35],
- ["98E1",0x6A36],
- ["98E2",0x6A37],
- ["98E3",0x6A38],
- ["98E4",0x6A39],
- ["98E5",0x6A3A],
- ["98E6",0x6A3B],
- ["98E7",0x6A3C],
- ["E9D7",0x6A3D],
- ["E9D0",0x6A3E],
- ["98E8",0x6A3F],
- ["98E9",0x6A40],
- ["98EA",0x6A41],
- ["98EB",0x6A42],
- ["98EC",0x6A43],
- ["E9CF",0x6A44],
- ["98ED",0x6A45],
- ["98EE",0x6A46],
- ["C7C1",0x6A47],
- ["98EF",0x6A48],
- ["98F0",0x6A49],
- ["98F1",0x6A4A],
- ["98F2",0x6A4B],
- ["98F3",0x6A4C],
- ["98F4",0x6A4D],
- ["98F5",0x6A4E],
- ["98F6",0x6A4F],
- ["E9D2",0x6A50],
- ["98F7",0x6A51],
- ["98F8",0x6A52],
- ["98F9",0x6A53],
- ["98FA",0x6A54],
- ["98FB",0x6A55],
- ["98FC",0x6A56],
- ["98FD",0x6A57],
- ["E9D9",0x6A58],
- ["B3C8",0x6A59],
- ["98FE",0x6A5A],
- ["E9D3",0x6A5B],
- ["9940",0x6A5C],
- ["9941",0x6A5D],
- ["9942",0x6A5E],
- ["9943",0x6A5F],
- ["9944",0x6A60],
- ["CFF0",0x6A61],
- ["9945",0x6A62],
- ["9946",0x6A63],
- ["9947",0x6A64],
- ["E9CD",0x6A65],
- ["9948",0x6A66],
- ["9949",0x6A67],
- ["994A",0x6A68],
- ["994B",0x6A69],
- ["994C",0x6A6A],
- ["994D",0x6A6B],
- ["994E",0x6A6C],
- ["994F",0x6A6D],
- ["9950",0x6A6E],
- ["9951",0x6A6F],
- ["9952",0x6A70],
- ["B3F7",0x6A71],
- ["9953",0x6A72],
- ["9954",0x6A73],
- ["9955",0x6A74],
- ["9956",0x6A75],
- ["9957",0x6A76],
- ["9958",0x6A77],
- ["9959",0x6A78],
- ["E9D6",0x6A79],
- ["995A",0x6A7A],
- ["995B",0x6A7B],
- ["E9DA",0x6A7C],
- ["995C",0x6A7D],
- ["995D",0x6A7E],
- ["995E",0x6A7F],
- ["CCB4",0x6A80],
- ["995F",0x6A81],
- ["9960",0x6A82],
- ["9961",0x6A83],
- ["CFAD",0x6A84],
- ["9962",0x6A85],
- ["9963",0x6A86],
- ["9964",0x6A87],
- ["9965",0x6A88],
- ["9966",0x6A89],
- ["9967",0x6A8A],
- ["9968",0x6A8B],
- ["9969",0x6A8C],
- ["996A",0x6A8D],
- ["E9D5",0x6A8E],
- ["996B",0x6A8F],
- ["E9DC",0x6A90],
- ["E9DB",0x6A91],
- ["996C",0x6A92],
- ["996D",0x6A93],
- ["996E",0x6A94],
- ["996F",0x6A95],
- ["9970",0x6A96],
- ["E9DE",0x6A97],
- ["9971",0x6A98],
- ["9972",0x6A99],
- ["9973",0x6A9A],
- ["9974",0x6A9B],
- ["9975",0x6A9C],
- ["9976",0x6A9D],
- ["9977",0x6A9E],
- ["9978",0x6A9F],
- ["E9D1",0x6AA0],
- ["9979",0x6AA1],
- ["997A",0x6AA2],
- ["997B",0x6AA3],
- ["997C",0x6AA4],
- ["997D",0x6AA5],
- ["997E",0x6AA6],
- ["9980",0x6AA7],
- ["9981",0x6AA8],
- ["E9DD",0x6AA9],
- ["9982",0x6AAA],
- ["E9DF",0x6AAB],
- ["C3CA",0x6AAC],
- ["9983",0x6AAD],
- ["9984",0x6AAE],
- ["9985",0x6AAF],
- ["9986",0x6AB0],
- ["9987",0x6AB1],
- ["9988",0x6AB2],
- ["9989",0x6AB3],
- ["998A",0x6AB4],
- ["998B",0x6AB5],
- ["998C",0x6AB6],
- ["998D",0x6AB7],
- ["998E",0x6AB8],
- ["998F",0x6AB9],
- ["9990",0x6ABA],
- ["9991",0x6ABB],
- ["9992",0x6ABC],
- ["9993",0x6ABD],
- ["9994",0x6ABE],
- ["9995",0x6ABF],
- ["9996",0x6AC0],
- ["9997",0x6AC1],
- ["9998",0x6AC2],
- ["9999",0x6AC3],
- ["999A",0x6AC4],
- ["999B",0x6AC5],
- ["999C",0x6AC6],
- ["999D",0x6AC7],
- ["999E",0x6AC8],
- ["999F",0x6AC9],
- ["99A0",0x6ACA],
- ["99A1",0x6ACB],
- ["99A2",0x6ACC],
- ["99A3",0x6ACD],
- ["99A4",0x6ACE],
- ["99A5",0x6ACF],
- ["99A6",0x6AD0],
- ["99A7",0x6AD1],
- ["99A8",0x6AD2],
- ["99A9",0x6AD3],
- ["99AA",0x6AD4],
- ["99AB",0x6AD5],
- ["99AC",0x6AD6],
- ["99AD",0x6AD7],
- ["99AE",0x6AD8],
- ["99AF",0x6AD9],
- ["99B0",0x6ADA],
- ["99B1",0x6ADB],
- ["99B2",0x6ADC],
- ["99B3",0x6ADD],
- ["99B4",0x6ADE],
- ["99B5",0x6ADF],
- ["99B6",0x6AE0],
- ["99B7",0x6AE1],
- ["99B8",0x6AE2],
- ["99B9",0x6AE3],
- ["99BA",0x6AE4],
- ["99BB",0x6AE5],
- ["99BC",0x6AE6],
- ["99BD",0x6AE7],
- ["99BE",0x6AE8],
- ["99BF",0x6AE9],
- ["99C0",0x6AEA],
- ["99C1",0x6AEB],
- ["99C2",0x6AEC],
- ["99C3",0x6AED],
- ["99C4",0x6AEE],
- ["99C5",0x6AEF],
- ["99C6",0x6AF0],
- ["99C7",0x6AF1],
- ["99C8",0x6AF2],
- ["99C9",0x6AF3],
- ["99CA",0x6AF4],
- ["99CB",0x6AF5],
- ["99CC",0x6AF6],
- ["99CD",0x6AF7],
- ["99CE",0x6AF8],
- ["99CF",0x6AF9],
- ["99D0",0x6AFA],
- ["99D1",0x6AFB],
- ["99D2",0x6AFC],
- ["99D3",0x6AFD],
- ["99D4",0x6AFE],
- ["99D5",0x6AFF],
- ["99D6",0x6B00],
- ["99D7",0x6B01],
- ["99D8",0x6B02],
- ["99D9",0x6B03],
- ["99DA",0x6B04],
- ["99DB",0x6B05],
- ["99DC",0x6B06],
- ["99DD",0x6B07],
- ["99DE",0x6B08],
- ["99DF",0x6B09],
- ["99E0",0x6B0A],
- ["99E1",0x6B0B],
- ["99E2",0x6B0C],
- ["99E3",0x6B0D],
- ["99E4",0x6B0E],
- ["99E5",0x6B0F],
- ["99E6",0x6B10],
- ["99E7",0x6B11],
- ["99E8",0x6B12],
- ["99E9",0x6B13],
- ["99EA",0x6B14],
- ["99EB",0x6B15],
- ["99EC",0x6B16],
- ["99ED",0x6B17],
- ["99EE",0x6B18],
- ["99EF",0x6B19],
- ["99F0",0x6B1A],
- ["99F1",0x6B1B],
- ["99F2",0x6B1C],
- ["99F3",0x6B1D],
- ["99F4",0x6B1E],
- ["99F5",0x6B1F],
- ["C7B7",0x6B20],
- ["B4CE",0x6B21],
- ["BBB6",0x6B22],
- ["D0C0",0x6B23],
- ["ECA3",0x6B24],
- ["99F6",0x6B25],
- ["99F7",0x6B26],
- ["C5B7",0x6B27],
- ["99F8",0x6B28],
- ["99F9",0x6B29],
- ["99FA",0x6B2A],
- ["99FB",0x6B2B],
- ["99FC",0x6B2C],
- ["99FD",0x6B2D],
- ["99FE",0x6B2E],
- ["9A40",0x6B2F],
- ["9A41",0x6B30],
- ["9A42",0x6B31],
- ["D3FB",0x6B32],
- ["9A43",0x6B33],
- ["9A44",0x6B34],
- ["9A45",0x6B35],
- ["9A46",0x6B36],
- ["ECA4",0x6B37],
- ["9A47",0x6B38],
- ["ECA5",0x6B39],
- ["C6DB",0x6B3A],
- ["9A48",0x6B3B],
- ["9A49",0x6B3C],
- ["9A4A",0x6B3D],
- ["BFEE",0x6B3E],
- ["9A4B",0x6B3F],
- ["9A4C",0x6B40],
- ["9A4D",0x6B41],
- ["9A4E",0x6B42],
- ["ECA6",0x6B43],
- ["9A4F",0x6B44],
- ["9A50",0x6B45],
- ["ECA7",0x6B46],
- ["D0AA",0x6B47],
- ["9A51",0x6B48],
- ["C7B8",0x6B49],
- ["9A52",0x6B4A],
- ["9A53",0x6B4B],
- ["B8E8",0x6B4C],
- ["9A54",0x6B4D],
- ["9A55",0x6B4E],
- ["9A56",0x6B4F],
- ["9A57",0x6B50],
- ["9A58",0x6B51],
- ["9A59",0x6B52],
- ["9A5A",0x6B53],
- ["9A5B",0x6B54],
- ["9A5C",0x6B55],
- ["9A5D",0x6B56],
- ["9A5E",0x6B57],
- ["9A5F",0x6B58],
- ["ECA8",0x6B59],
- ["9A60",0x6B5A],
- ["9A61",0x6B5B],
- ["9A62",0x6B5C],
- ["9A63",0x6B5D],
- ["9A64",0x6B5E],
- ["9A65",0x6B5F],
- ["9A66",0x6B60],
- ["9A67",0x6B61],
- ["D6B9",0x6B62],
- ["D5FD",0x6B63],
- ["B4CB",0x6B64],
- ["B2BD",0x6B65],
- ["CEE4",0x6B66],
- ["C6E7",0x6B67],
- ["9A68",0x6B68],
- ["9A69",0x6B69],
- ["CDE1",0x6B6A],
- ["9A6A",0x6B6B],
- ["9A6B",0x6B6C],
- ["9A6C",0x6B6D],
- ["9A6D",0x6B6E],
- ["9A6E",0x6B6F],
- ["9A6F",0x6B70],
- ["9A70",0x6B71],
- ["9A71",0x6B72],
- ["9A72",0x6B73],
- ["9A73",0x6B74],
- ["9A74",0x6B75],
- ["9A75",0x6B76],
- ["9A76",0x6B77],
- ["9A77",0x6B78],
- ["B4F5",0x6B79],
- ["9A78",0x6B7A],
- ["CBC0",0x6B7B],
- ["BCDF",0x6B7C],
- ["9A79",0x6B7D],
- ["9A7A",0x6B7E],
- ["9A7B",0x6B7F],
- ["9A7C",0x6B80],
- ["E9E2",0x6B81],
- ["E9E3",0x6B82],
- ["D1EA",0x6B83],
- ["E9E5",0x6B84],
- ["9A7D",0x6B85],
- ["B4F9",0x6B86],
- ["E9E4",0x6B87],
- ["9A7E",0x6B88],
- ["D1B3",0x6B89],
- ["CAE2",0x6B8A],
- ["B2D0",0x6B8B],
- ["9A80",0x6B8C],
- ["E9E8",0x6B8D],
- ["9A81",0x6B8E],
- ["9A82",0x6B8F],
- ["9A83",0x6B90],
- ["9A84",0x6B91],
- ["E9E6",0x6B92],
- ["E9E7",0x6B93],
- ["9A85",0x6B94],
- ["9A86",0x6B95],
- ["D6B3",0x6B96],
- ["9A87",0x6B97],
- ["9A88",0x6B98],
- ["9A89",0x6B99],
- ["E9E9",0x6B9A],
- ["E9EA",0x6B9B],
- ["9A8A",0x6B9C],
- ["9A8B",0x6B9D],
- ["9A8C",0x6B9E],
- ["9A8D",0x6B9F],
- ["9A8E",0x6BA0],
- ["E9EB",0x6BA1],
- ["9A8F",0x6BA2],
- ["9A90",0x6BA3],
- ["9A91",0x6BA4],
- ["9A92",0x6BA5],
- ["9A93",0x6BA6],
- ["9A94",0x6BA7],
- ["9A95",0x6BA8],
- ["9A96",0x6BA9],
- ["E9EC",0x6BAA],
- ["9A97",0x6BAB],
- ["9A98",0x6BAC],
- ["9A99",0x6BAD],
- ["9A9A",0x6BAE],
- ["9A9B",0x6BAF],
- ["9A9C",0x6BB0],
- ["9A9D",0x6BB1],
- ["9A9E",0x6BB2],
- ["ECAF",0x6BB3],
- ["C5B9",0x6BB4],
- ["B6CE",0x6BB5],
- ["9A9F",0x6BB6],
- ["D2F3",0x6BB7],
- ["9AA0",0x6BB8],
- ["9AA1",0x6BB9],
- ["9AA2",0x6BBA],
- ["9AA3",0x6BBB],
- ["9AA4",0x6BBC],
- ["9AA5",0x6BBD],
- ["9AA6",0x6BBE],
- ["B5EE",0x6BBF],
- ["9AA7",0x6BC0],
- ["BBD9",0x6BC1],
- ["ECB1",0x6BC2],
- ["9AA8",0x6BC3],
- ["9AA9",0x6BC4],
- ["D2E3",0x6BC5],
- ["9AAA",0x6BC6],
- ["9AAB",0x6BC7],
- ["9AAC",0x6BC8],
- ["9AAD",0x6BC9],
- ["9AAE",0x6BCA],
- ["CEE3",0x6BCB],
- ["9AAF",0x6BCC],
- ["C4B8",0x6BCD],
- ["9AB0",0x6BCE],
- ["C3BF",0x6BCF],
- ["9AB1",0x6BD0],
- ["9AB2",0x6BD1],
- ["B6BE",0x6BD2],
- ["D8B9",0x6BD3],
- ["B1C8",0x6BD4],
- ["B1CF",0x6BD5],
- ["B1D1",0x6BD6],
- ["C5FE",0x6BD7],
- ["9AB3",0x6BD8],
- ["B1D0",0x6BD9],
- ["9AB4",0x6BDA],
- ["C3AB",0x6BDB],
- ["9AB5",0x6BDC],
- ["9AB6",0x6BDD],
- ["9AB7",0x6BDE],
- ["9AB8",0x6BDF],
- ["9AB9",0x6BE0],
- ["D5B1",0x6BE1],
- ["9ABA",0x6BE2],
- ["9ABB",0x6BE3],
- ["9ABC",0x6BE4],
- ["9ABD",0x6BE5],
- ["9ABE",0x6BE6],
- ["9ABF",0x6BE7],
- ["9AC0",0x6BE8],
- ["9AC1",0x6BE9],
- ["EBA4",0x6BEA],
- ["BAC1",0x6BEB],
- ["9AC2",0x6BEC],
- ["9AC3",0x6BED],
- ["9AC4",0x6BEE],
- ["CCBA",0x6BEF],
- ["9AC5",0x6BF0],
- ["9AC6",0x6BF1],
- ["9AC7",0x6BF2],
- ["EBA5",0x6BF3],
- ["9AC8",0x6BF4],
- ["EBA7",0x6BF5],
- ["9AC9",0x6BF6],
- ["9ACA",0x6BF7],
- ["9ACB",0x6BF8],
- ["EBA8",0x6BF9],
- ["9ACC",0x6BFA],
- ["9ACD",0x6BFB],
- ["9ACE",0x6BFC],
- ["EBA6",0x6BFD],
- ["9ACF",0x6BFE],
- ["9AD0",0x6BFF],
- ["9AD1",0x6C00],
- ["9AD2",0x6C01],
- ["9AD3",0x6C02],
- ["9AD4",0x6C03],
- ["9AD5",0x6C04],
- ["EBA9",0x6C05],
- ["EBAB",0x6C06],
- ["EBAA",0x6C07],
- ["9AD6",0x6C08],
- ["9AD7",0x6C09],
- ["9AD8",0x6C0A],
- ["9AD9",0x6C0B],
- ["9ADA",0x6C0C],
- ["EBAC",0x6C0D],
- ["9ADB",0x6C0E],
- ["CACF",0x6C0F],
- ["D8B5",0x6C10],
- ["C3F1",0x6C11],
- ["9ADC",0x6C12],
- ["C3A5",0x6C13],
- ["C6F8",0x6C14],
- ["EBAD",0x6C15],
- ["C4CA",0x6C16],
- ["9ADD",0x6C17],
- ["EBAE",0x6C18],
- ["EBAF",0x6C19],
- ["EBB0",0x6C1A],
- ["B7D5",0x6C1B],
- ["9ADE",0x6C1C],
- ["9ADF",0x6C1D],
- ["9AE0",0x6C1E],
- ["B7FA",0x6C1F],
- ["9AE1",0x6C20],
- ["EBB1",0x6C21],
- ["C7E2",0x6C22],
- ["9AE2",0x6C23],
- ["EBB3",0x6C24],
- ["9AE3",0x6C25],
- ["BAA4",0x6C26],
- ["D1F5",0x6C27],
- ["B0B1",0x6C28],
- ["EBB2",0x6C29],
- ["EBB4",0x6C2A],
- ["9AE4",0x6C2B],
- ["9AE5",0x6C2C],
- ["9AE6",0x6C2D],
- ["B5AA",0x6C2E],
- ["C2C8",0x6C2F],
- ["C7E8",0x6C30],
- ["9AE7",0x6C31],
- ["EBB5",0x6C32],
- ["9AE8",0x6C33],
- ["CBAE",0x6C34],
- ["E3DF",0x6C35],
- ["9AE9",0x6C36],
- ["9AEA",0x6C37],
- ["D3C0",0x6C38],
- ["9AEB",0x6C39],
- ["9AEC",0x6C3A],
- ["9AED",0x6C3B],
- ["9AEE",0x6C3C],
- ["D9DB",0x6C3D],
- ["9AEF",0x6C3E],
- ["9AF0",0x6C3F],
- ["CDA1",0x6C40],
- ["D6AD",0x6C41],
- ["C7F3",0x6C42],
- ["9AF1",0x6C43],
- ["9AF2",0x6C44],
- ["9AF3",0x6C45],
- ["D9E0",0x6C46],
- ["BBE3",0x6C47],
- ["9AF4",0x6C48],
- ["BABA",0x6C49],
- ["E3E2",0x6C4A],
- ["9AF5",0x6C4B],
- ["9AF6",0x6C4C],
- ["9AF7",0x6C4D],
- ["9AF8",0x6C4E],
- ["9AF9",0x6C4F],
- ["CFAB",0x6C50],
- ["9AFA",0x6C51],
- ["9AFB",0x6C52],
- ["9AFC",0x6C53],
- ["E3E0",0x6C54],
- ["C9C7",0x6C55],
- ["9AFD",0x6C56],
- ["BAB9",0x6C57],
- ["9AFE",0x6C58],
- ["9B40",0x6C59],
- ["9B41",0x6C5A],
- ["D1B4",0x6C5B],
- ["E3E1",0x6C5C],
- ["C8EA",0x6C5D],
- ["B9AF",0x6C5E],
- ["BDAD",0x6C5F],
- ["B3D8",0x6C60],
- ["CEDB",0x6C61],
- ["9B42",0x6C62],
- ["9B43",0x6C63],
- ["CCC0",0x6C64],
- ["9B44",0x6C65],
- ["9B45",0x6C66],
- ["9B46",0x6C67],
- ["E3E8",0x6C68],
- ["E3E9",0x6C69],
- ["CDF4",0x6C6A],
- ["9B47",0x6C6B],
- ["9B48",0x6C6C],
- ["9B49",0x6C6D],
- ["9B4A",0x6C6E],
- ["9B4B",0x6C6F],
- ["CCAD",0x6C70],
- ["9B4C",0x6C71],
- ["BCB3",0x6C72],
- ["9B4D",0x6C73],
- ["E3EA",0x6C74],
- ["9B4E",0x6C75],
- ["E3EB",0x6C76],
- ["9B4F",0x6C77],
- ["9B50",0x6C78],
- ["D0DA",0x6C79],
- ["9B51",0x6C7A],
- ["9B52",0x6C7B],
- ["9B53",0x6C7C],
- ["C6FB",0x6C7D],
- ["B7DA",0x6C7E],
- ["9B54",0x6C7F],
- ["9B55",0x6C80],
- ["C7DF",0x6C81],
- ["D2CA",0x6C82],
- ["CED6",0x6C83],
- ["9B56",0x6C84],
- ["E3E4",0x6C85],
- ["E3EC",0x6C86],
- ["9B57",0x6C87],
- ["C9F2",0x6C88],
- ["B3C1",0x6C89],
- ["9B58",0x6C8A],
- ["9B59",0x6C8B],
- ["E3E7",0x6C8C],
- ["9B5A",0x6C8D],
- ["9B5B",0x6C8E],
- ["C6E3",0x6C8F],
- ["E3E5",0x6C90],
- ["9B5C",0x6C91],
- ["9B5D",0x6C92],
- ["EDB3",0x6C93],
- ["E3E6",0x6C94],
- ["9B5E",0x6C95],
- ["9B5F",0x6C96],
- ["9B60",0x6C97],
- ["9B61",0x6C98],
- ["C9B3",0x6C99],
- ["9B62",0x6C9A],
- ["C5E6",0x6C9B],
- ["9B63",0x6C9C],
- ["9B64",0x6C9D],
- ["9B65",0x6C9E],
- ["B9B5",0x6C9F],
- ["9B66",0x6CA0],
- ["C3BB",0x6CA1],
- ["9B67",0x6CA2],
- ["E3E3",0x6CA3],
- ["C5BD",0x6CA4],
- ["C1A4",0x6CA5],
- ["C2D9",0x6CA6],
- ["B2D7",0x6CA7],
- ["9B68",0x6CA8],
- ["E3ED",0x6CA9],
- ["BBA6",0x6CAA],
- ["C4AD",0x6CAB],
- ["9B69",0x6CAC],
- ["E3F0",0x6CAD],
- ["BEDA",0x6CAE],
- ["9B6A",0x6CAF],
- ["9B6B",0x6CB0],
- ["E3FB",0x6CB1],
- ["E3F5",0x6CB2],
- ["BAD3",0x6CB3],
- ["9B6C",0x6CB4],
- ["9B6D",0x6CB5],
- ["9B6E",0x6CB6],
- ["9B6F",0x6CB7],
- ["B7D0",0x6CB8],
- ["D3CD",0x6CB9],
- ["9B70",0x6CBA],
- ["D6CE",0x6CBB],
- ["D5D3",0x6CBC],
- ["B9C1",0x6CBD],
- ["D5B4",0x6CBE],
- ["D1D8",0x6CBF],
- ["9B71",0x6CC0],
- ["9B72",0x6CC1],
- ["9B73",0x6CC2],
- ["9B74",0x6CC3],
- ["D0B9",0x6CC4],
- ["C7F6",0x6CC5],
- ["9B75",0x6CC6],
- ["9B76",0x6CC7],
- ["9B77",0x6CC8],
- ["C8AA",0x6CC9],
- ["B2B4",0x6CCA],
- ["9B78",0x6CCB],
- ["C3DA",0x6CCC],
- ["9B79",0x6CCD],
- ["9B7A",0x6CCE],
- ["9B7B",0x6CCF],
- ["E3EE",0x6CD0],
- ["9B7C",0x6CD1],
- ["9B7D",0x6CD2],
- ["E3FC",0x6CD3],
- ["E3EF",0x6CD4],
- ["B7A8",0x6CD5],
- ["E3F7",0x6CD6],
- ["E3F4",0x6CD7],
- ["9B7E",0x6CD8],
- ["9B80",0x6CD9],
- ["9B81",0x6CDA],
- ["B7BA",0x6CDB],
- ["9B82",0x6CDC],
- ["9B83",0x6CDD],
- ["C5A2",0x6CDE],
- ["9B84",0x6CDF],
- ["E3F6",0x6CE0],
- ["C5DD",0x6CE1],
- ["B2A8",0x6CE2],
- ["C6FC",0x6CE3],
- ["9B85",0x6CE4],
- ["C4E0",0x6CE5],
- ["9B86",0x6CE6],
- ["9B87",0x6CE7],
- ["D7A2",0x6CE8],
- ["9B88",0x6CE9],
- ["C0E1",0x6CEA],
- ["E3F9",0x6CEB],
- ["9B89",0x6CEC],
- ["9B8A",0x6CED],
- ["E3FA",0x6CEE],
- ["E3FD",0x6CEF],
- ["CCA9",0x6CF0],
- ["E3F3",0x6CF1],
- ["9B8B",0x6CF2],
- ["D3BE",0x6CF3],
- ["9B8C",0x6CF4],
- ["B1C3",0x6CF5],
- ["EDB4",0x6CF6],
- ["E3F1",0x6CF7],
- ["E3F2",0x6CF8],
- ["9B8D",0x6CF9],
- ["E3F8",0x6CFA],
- ["D0BA",0x6CFB],
- ["C6C3",0x6CFC],
- ["D4F3",0x6CFD],
- ["E3FE",0x6CFE],
- ["9B8E",0x6CFF],
- ["9B8F",0x6D00],
- ["BDE0",0x6D01],
- ["9B90",0x6D02],
- ["9B91",0x6D03],
- ["E4A7",0x6D04],
- ["9B92",0x6D05],
- ["9B93",0x6D06],
- ["E4A6",0x6D07],
- ["9B94",0x6D08],
- ["9B95",0x6D09],
- ["9B96",0x6D0A],
- ["D1F3",0x6D0B],
- ["E4A3",0x6D0C],
- ["9B97",0x6D0D],
- ["E4A9",0x6D0E],
- ["9B98",0x6D0F],
- ["9B99",0x6D10],
- ["9B9A",0x6D11],
- ["C8F7",0x6D12],
- ["9B9B",0x6D13],
- ["9B9C",0x6D14],
- ["9B9D",0x6D15],
- ["9B9E",0x6D16],
- ["CFB4",0x6D17],
- ["9B9F",0x6D18],
- ["E4A8",0x6D19],
- ["E4AE",0x6D1A],
- ["C2E5",0x6D1B],
- ["9BA0",0x6D1C],
- ["9BA1",0x6D1D],
- ["B6B4",0x6D1E],
- ["9BA2",0x6D1F],
- ["9BA3",0x6D20],
- ["9BA4",0x6D21],
- ["9BA5",0x6D22],
- ["9BA6",0x6D23],
- ["9BA7",0x6D24],
- ["BDF2",0x6D25],
- ["9BA8",0x6D26],
- ["E4A2",0x6D27],
- ["9BA9",0x6D28],
- ["9BAA",0x6D29],
- ["BAE9",0x6D2A],
- ["E4AA",0x6D2B],
- ["9BAB",0x6D2C],
- ["9BAC",0x6D2D],
- ["E4AC",0x6D2E],
- ["9BAD",0x6D2F],
- ["9BAE",0x6D30],
- ["B6FD",0x6D31],
- ["D6DE",0x6D32],
- ["E4B2",0x6D33],
- ["9BAF",0x6D34],
- ["E4AD",0x6D35],
- ["9BB0",0x6D36],
- ["9BB1",0x6D37],
- ["9BB2",0x6D38],
- ["E4A1",0x6D39],
- ["9BB3",0x6D3A],
- ["BBEE",0x6D3B],
- ["CDDD",0x6D3C],
- ["C7A2",0x6D3D],
- ["C5C9",0x6D3E],
- ["9BB4",0x6D3F],
- ["9BB5",0x6D40],
- ["C1F7",0x6D41],
- ["9BB6",0x6D42],
- ["E4A4",0x6D43],
- ["9BB7",0x6D44],
- ["C7B3",0x6D45],
- ["BDAC",0x6D46],
- ["BDBD",0x6D47],
- ["E4A5",0x6D48],
- ["9BB8",0x6D49],
- ["D7C7",0x6D4A],
- ["B2E2",0x6D4B],
- ["9BB9",0x6D4C],
- ["E4AB",0x6D4D],
- ["BCC3",0x6D4E],
- ["E4AF",0x6D4F],
- ["9BBA",0x6D50],
- ["BBEB",0x6D51],
- ["E4B0",0x6D52],
- ["C5A8",0x6D53],
- ["E4B1",0x6D54],
- ["9BBB",0x6D55],
- ["9BBC",0x6D56],
- ["9BBD",0x6D57],
- ["9BBE",0x6D58],
- ["D5E3",0x6D59],
- ["BFA3",0x6D5A],
- ["9BBF",0x6D5B],
- ["E4BA",0x6D5C],
- ["9BC0",0x6D5D],
- ["E4B7",0x6D5E],
- ["9BC1",0x6D5F],
- ["E4BB",0x6D60],
- ["9BC2",0x6D61],
- ["9BC3",0x6D62],
- ["E4BD",0x6D63],
- ["9BC4",0x6D64],
- ["9BC5",0x6D65],
- ["C6D6",0x6D66],
- ["9BC6",0x6D67],
- ["9BC7",0x6D68],
- ["BAC6",0x6D69],
- ["C0CB",0x6D6A],
- ["9BC8",0x6D6B],
- ["9BC9",0x6D6C],
- ["9BCA",0x6D6D],
- ["B8A1",0x6D6E],
- ["E4B4",0x6D6F],
- ["9BCB",0x6D70],
- ["9BCC",0x6D71],
- ["9BCD",0x6D72],
- ["9BCE",0x6D73],
- ["D4A1",0x6D74],
- ["9BCF",0x6D75],
- ["9BD0",0x6D76],
- ["BAA3",0x6D77],
- ["BDFE",0x6D78],
- ["9BD1",0x6D79],
- ["9BD2",0x6D7A],
- ["9BD3",0x6D7B],
- ["E4BC",0x6D7C],
- ["9BD4",0x6D7D],
- ["9BD5",0x6D7E],
- ["9BD6",0x6D7F],
- ["9BD7",0x6D80],
- ["9BD8",0x6D81],
- ["CDBF",0x6D82],
- ["9BD9",0x6D83],
- ["9BDA",0x6D84],
- ["C4F9",0x6D85],
- ["9BDB",0x6D86],
- ["9BDC",0x6D87],
- ["CFFB",0x6D88],
- ["C9E6",0x6D89],
- ["9BDD",0x6D8A],
- ["9BDE",0x6D8B],
- ["D3BF",0x6D8C],
- ["9BDF",0x6D8D],
- ["CFD1",0x6D8E],
- ["9BE0",0x6D8F],
- ["9BE1",0x6D90],
- ["E4B3",0x6D91],
- ["9BE2",0x6D92],
- ["E4B8",0x6D93],
- ["E4B9",0x6D94],
- ["CCE9",0x6D95],
- ["9BE3",0x6D96],
- ["9BE4",0x6D97],
- ["9BE5",0x6D98],
- ["9BE6",0x6D99],
- ["9BE7",0x6D9A],
- ["CCCE",0x6D9B],
- ["9BE8",0x6D9C],
- ["C0D4",0x6D9D],
- ["E4B5",0x6D9E],
- ["C1B0",0x6D9F],
- ["E4B6",0x6DA0],
- ["CED0",0x6DA1],
- ["9BE9",0x6DA2],
- ["BBC1",0x6DA3],
- ["B5D3",0x6DA4],
- ["9BEA",0x6DA5],
- ["C8F3",0x6DA6],
- ["BDA7",0x6DA7],
- ["D5C7",0x6DA8],
- ["C9AC",0x6DA9],
- ["B8A2",0x6DAA],
- ["E4CA",0x6DAB],
- ["9BEB",0x6DAC],
- ["9BEC",0x6DAD],
- ["E4CC",0x6DAE],
- ["D1C4",0x6DAF],
- ["9BED",0x6DB0],
- ["9BEE",0x6DB1],
- ["D2BA",0x6DB2],
- ["9BEF",0x6DB3],
- ["9BF0",0x6DB4],
- ["BAAD",0x6DB5],
- ["9BF1",0x6DB6],
- ["9BF2",0x6DB7],
- ["BAD4",0x6DB8],
- ["9BF3",0x6DB9],
- ["9BF4",0x6DBA],
- ["9BF5",0x6DBB],
- ["9BF6",0x6DBC],
- ["9BF7",0x6DBD],
- ["9BF8",0x6DBE],
- ["E4C3",0x6DBF],
- ["B5ED",0x6DC0],
- ["9BF9",0x6DC1],
- ["9BFA",0x6DC2],
- ["9BFB",0x6DC3],
- ["D7CD",0x6DC4],
- ["E4C0",0x6DC5],
- ["CFFD",0x6DC6],
- ["E4BF",0x6DC7],
- ["9BFC",0x6DC8],
- ["9BFD",0x6DC9],
- ["9BFE",0x6DCA],
- ["C1DC",0x6DCB],
- ["CCCA",0x6DCC],
- ["9C40",0x6DCD],
- ["9C41",0x6DCE],
- ["9C42",0x6DCF],
- ["9C43",0x6DD0],
- ["CAE7",0x6DD1],
- ["9C44",0x6DD2],
- ["9C45",0x6DD3],
- ["9C46",0x6DD4],
- ["9C47",0x6DD5],
- ["C4D7",0x6DD6],
- ["9C48",0x6DD7],
- ["CCD4",0x6DD8],
- ["E4C8",0x6DD9],
- ["9C49",0x6DDA],
- ["9C4A",0x6DDB],
- ["9C4B",0x6DDC],
- ["E4C7",0x6DDD],
- ["E4C1",0x6DDE],
- ["9C4C",0x6DDF],
- ["E4C4",0x6DE0],
- ["B5AD",0x6DE1],
- ["9C4D",0x6DE2],
- ["9C4E",0x6DE3],
- ["D3D9",0x6DE4],
- ["9C4F",0x6DE5],
- ["E4C6",0x6DE6],
- ["9C50",0x6DE7],
- ["9C51",0x6DE8],
- ["9C52",0x6DE9],
- ["9C53",0x6DEA],
- ["D2F9",0x6DEB],
- ["B4E3",0x6DEC],
- ["9C54",0x6DED],
- ["BBB4",0x6DEE],
- ["9C55",0x6DEF],
- ["9C56",0x6DF0],
- ["C9EE",0x6DF1],
- ["9C57",0x6DF2],
- ["B4BE",0x6DF3],
- ["9C58",0x6DF4],
- ["9C59",0x6DF5],
- ["9C5A",0x6DF6],
- ["BBEC",0x6DF7],
- ["9C5B",0x6DF8],
- ["D1CD",0x6DF9],
- ["9C5C",0x6DFA],
- ["CCED",0x6DFB],
- ["EDB5",0x6DFC],
- ["9C5D",0x6DFD],
- ["9C5E",0x6DFE],
- ["9C5F",0x6DFF],
- ["9C60",0x6E00],
- ["9C61",0x6E01],
- ["9C62",0x6E02],
- ["9C63",0x6E03],
- ["9C64",0x6E04],
- ["C7E5",0x6E05],
- ["9C65",0x6E06],
- ["9C66",0x6E07],
- ["9C67",0x6E08],
- ["9C68",0x6E09],
- ["D4A8",0x6E0A],
- ["9C69",0x6E0B],
- ["E4CB",0x6E0C],
- ["D7D5",0x6E0D],
- ["E4C2",0x6E0E],
- ["9C6A",0x6E0F],
- ["BDA5",0x6E10],
- ["E4C5",0x6E11],
- ["9C6B",0x6E12],
- ["9C6C",0x6E13],
- ["D3E6",0x6E14],
- ["9C6D",0x6E15],
- ["E4C9",0x6E16],
- ["C9F8",0x6E17],
- ["9C6E",0x6E18],
- ["9C6F",0x6E19],
- ["E4BE",0x6E1A],
- ["9C70",0x6E1B],
- ["9C71",0x6E1C],
- ["D3E5",0x6E1D],
- ["9C72",0x6E1E],
- ["9C73",0x6E1F],
- ["C7FE",0x6E20],
- ["B6C9",0x6E21],
- ["9C74",0x6E22],
- ["D4FC",0x6E23],
- ["B2B3",0x6E24],
- ["E4D7",0x6E25],
- ["9C75",0x6E26],
- ["9C76",0x6E27],
- ["9C77",0x6E28],
- ["CEC2",0x6E29],
- ["9C78",0x6E2A],
- ["E4CD",0x6E2B],
- ["9C79",0x6E2C],
- ["CEBC",0x6E2D],
- ["9C7A",0x6E2E],
- ["B8DB",0x6E2F],
- ["9C7B",0x6E30],
- ["9C7C",0x6E31],
- ["E4D6",0x6E32],
- ["9C7D",0x6E33],
- ["BFCA",0x6E34],
- ["9C7E",0x6E35],
- ["9C80",0x6E36],
- ["9C81",0x6E37],
- ["D3CE",0x6E38],
- ["9C82",0x6E39],
- ["C3EC",0x6E3A],
- ["9C83",0x6E3B],
- ["9C84",0x6E3C],
- ["9C85",0x6E3D],
- ["9C86",0x6E3E],
- ["9C87",0x6E3F],
- ["9C88",0x6E40],
- ["9C89",0x6E41],
- ["9C8A",0x6E42],
- ["C5C8",0x6E43],
- ["E4D8",0x6E44],
- ["9C8B",0x6E45],
- ["9C8C",0x6E46],
- ["9C8D",0x6E47],
- ["9C8E",0x6E48],
- ["9C8F",0x6E49],
- ["9C90",0x6E4A],
- ["9C91",0x6E4B],
- ["9C92",0x6E4C],
- ["CDC4",0x6E4D],
- ["E4CF",0x6E4E],
- ["9C93",0x6E4F],
- ["9C94",0x6E50],
- ["9C95",0x6E51],
- ["9C96",0x6E52],
- ["E4D4",0x6E53],
- ["E4D5",0x6E54],
- ["9C97",0x6E55],
- ["BAFE",0x6E56],
- ["9C98",0x6E57],
- ["CFE6",0x6E58],
- ["9C99",0x6E59],
- ["9C9A",0x6E5A],
- ["D5BF",0x6E5B],
- ["9C9B",0x6E5C],
- ["9C9C",0x6E5D],
- ["9C9D",0x6E5E],
- ["E4D2",0x6E5F],
- ["9C9E",0x6E60],
- ["9C9F",0x6E61],
- ["9CA0",0x6E62],
- ["9CA1",0x6E63],
- ["9CA2",0x6E64],
- ["9CA3",0x6E65],
- ["9CA4",0x6E66],
- ["9CA5",0x6E67],
- ["9CA6",0x6E68],
- ["9CA7",0x6E69],
- ["9CA8",0x6E6A],
- ["E4D0",0x6E6B],
- ["9CA9",0x6E6C],
- ["9CAA",0x6E6D],
- ["E4CE",0x6E6E],
- ["9CAB",0x6E6F],
- ["9CAC",0x6E70],
- ["9CAD",0x6E71],
- ["9CAE",0x6E72],
- ["9CAF",0x6E73],
- ["9CB0",0x6E74],
- ["9CB1",0x6E75],
- ["9CB2",0x6E76],
- ["9CB3",0x6E77],
- ["9CB4",0x6E78],
- ["9CB5",0x6E79],
- ["9CB6",0x6E7A],
- ["9CB7",0x6E7B],
- ["9CB8",0x6E7C],
- ["9CB9",0x6E7D],
- ["CDE5",0x6E7E],
- ["CAAA",0x6E7F],
- ["9CBA",0x6E80],
- ["9CBB",0x6E81],
- ["9CBC",0x6E82],
- ["C0A3",0x6E83],
- ["9CBD",0x6E84],
- ["BDA6",0x6E85],
- ["E4D3",0x6E86],
- ["9CBE",0x6E87],
- ["9CBF",0x6E88],
- ["B8C8",0x6E89],
- ["9CC0",0x6E8A],
- ["9CC1",0x6E8B],
- ["9CC2",0x6E8C],
- ["9CC3",0x6E8D],
- ["9CC4",0x6E8E],
- ["E4E7",0x6E8F],
- ["D4B4",0x6E90],
- ["9CC5",0x6E91],
- ["9CC6",0x6E92],
- ["9CC7",0x6E93],
- ["9CC8",0x6E94],
- ["9CC9",0x6E95],
- ["9CCA",0x6E96],
- ["9CCB",0x6E97],
- ["E4DB",0x6E98],
- ["9CCC",0x6E99],
- ["9CCD",0x6E9A],
- ["9CCE",0x6E9B],
- ["C1EF",0x6E9C],
- ["9CCF",0x6E9D],
- ["9CD0",0x6E9E],
- ["E4E9",0x6E9F],
- ["9CD1",0x6EA0],
- ["9CD2",0x6EA1],
- ["D2E7",0x6EA2],
- ["9CD3",0x6EA3],
- ["9CD4",0x6EA4],
- ["E4DF",0x6EA5],
- ["9CD5",0x6EA6],
- ["E4E0",0x6EA7],
- ["9CD6",0x6EA8],
- ["9CD7",0x6EA9],
- ["CFAA",0x6EAA],
- ["9CD8",0x6EAB],
- ["9CD9",0x6EAC],
- ["9CDA",0x6EAD],
- ["9CDB",0x6EAE],
- ["CBDD",0x6EAF],
- ["9CDC",0x6EB0],
- ["E4DA",0x6EB1],
- ["E4D1",0x6EB2],
- ["9CDD",0x6EB3],
- ["E4E5",0x6EB4],
- ["9CDE",0x6EB5],
- ["C8DC",0x6EB6],
- ["E4E3",0x6EB7],
- ["9CDF",0x6EB8],
- ["9CE0",0x6EB9],
- ["C4E7",0x6EBA],
- ["E4E2",0x6EBB],
- ["9CE1",0x6EBC],
- ["E4E1",0x6EBD],
- ["9CE2",0x6EBE],
- ["9CE3",0x6EBF],
- ["9CE4",0x6EC0],
- ["B3FC",0x6EC1],
- ["E4E8",0x6EC2],
- ["9CE5",0x6EC3],
- ["9CE6",0x6EC4],
- ["9CE7",0x6EC5],
- ["9CE8",0x6EC6],
- ["B5E1",0x6EC7],
- ["9CE9",0x6EC8],
- ["9CEA",0x6EC9],
- ["9CEB",0x6ECA],
- ["D7CC",0x6ECB],
- ["9CEC",0x6ECC],
- ["9CED",0x6ECD],
- ["9CEE",0x6ECE],
- ["E4E6",0x6ECF],
- ["9CEF",0x6ED0],
- ["BBAC",0x6ED1],
- ["9CF0",0x6ED2],
- ["D7D2",0x6ED3],
- ["CCCF",0x6ED4],
- ["EBF8",0x6ED5],
- ["9CF1",0x6ED6],
- ["E4E4",0x6ED7],
- ["9CF2",0x6ED8],
- ["9CF3",0x6ED9],
- ["B9F6",0x6EDA],
- ["9CF4",0x6EDB],
- ["9CF5",0x6EDC],
- ["9CF6",0x6EDD],
- ["D6CD",0x6EDE],
- ["E4D9",0x6EDF],
- ["E4DC",0x6EE0],
- ["C2FA",0x6EE1],
- ["E4DE",0x6EE2],
- ["9CF7",0x6EE3],
- ["C2CB",0x6EE4],
- ["C0C4",0x6EE5],
- ["C2D0",0x6EE6],
- ["9CF8",0x6EE7],
- ["B1F5",0x6EE8],
- ["CCB2",0x6EE9],
- ["9CF9",0x6EEA],
- ["9CFA",0x6EEB],
- ["9CFB",0x6EEC],
- ["9CFC",0x6EED],
- ["9CFD",0x6EEE],
- ["9CFE",0x6EEF],
- ["9D40",0x6EF0],
- ["9D41",0x6EF1],
- ["9D42",0x6EF2],
- ["9D43",0x6EF3],
- ["B5CE",0x6EF4],
- ["9D44",0x6EF5],
- ["9D45",0x6EF6],
- ["9D46",0x6EF7],
- ["9D47",0x6EF8],
- ["E4EF",0x6EF9],
- ["9D48",0x6EFA],
- ["9D49",0x6EFB],
- ["9D4A",0x6EFC],
- ["9D4B",0x6EFD],
- ["9D4C",0x6EFE],
- ["9D4D",0x6EFF],
- ["9D4E",0x6F00],
- ["9D4F",0x6F01],
- ["C6AF",0x6F02],
- ["9D50",0x6F03],
- ["9D51",0x6F04],
- ["9D52",0x6F05],
- ["C6E1",0x6F06],
- ["9D53",0x6F07],
- ["9D54",0x6F08],
- ["E4F5",0x6F09],
- ["9D55",0x6F0A],
- ["9D56",0x6F0B],
- ["9D57",0x6F0C],
- ["9D58",0x6F0D],
- ["9D59",0x6F0E],
- ["C2A9",0x6F0F],
- ["9D5A",0x6F10],
- ["9D5B",0x6F11],
- ["9D5C",0x6F12],
- ["C0EC",0x6F13],
- ["D1DD",0x6F14],
- ["E4EE",0x6F15],
- ["9D5D",0x6F16],
- ["9D5E",0x6F17],
- ["9D5F",0x6F18],
- ["9D60",0x6F19],
- ["9D61",0x6F1A],
- ["9D62",0x6F1B],
- ["9D63",0x6F1C],
- ["9D64",0x6F1D],
- ["9D65",0x6F1E],
- ["9D66",0x6F1F],
- ["C4AE",0x6F20],
- ["9D67",0x6F21],
- ["9D68",0x6F22],
- ["9D69",0x6F23],
- ["E4ED",0x6F24],
- ["9D6A",0x6F25],
- ["9D6B",0x6F26],
- ["9D6C",0x6F27],
- ["9D6D",0x6F28],
- ["E4F6",0x6F29],
- ["E4F4",0x6F2A],
- ["C2FE",0x6F2B],
- ["9D6E",0x6F2C],
- ["E4DD",0x6F2D],
- ["9D6F",0x6F2E],
- ["E4F0",0x6F2F],
- ["9D70",0x6F30],
- ["CAFE",0x6F31],
- ["9D71",0x6F32],
- ["D5C4",0x6F33],
- ["9D72",0x6F34],
- ["9D73",0x6F35],
- ["E4F1",0x6F36],
- ["9D74",0x6F37],
- ["9D75",0x6F38],
- ["9D76",0x6F39],
- ["9D77",0x6F3A],
- ["9D78",0x6F3B],
- ["9D79",0x6F3C],
- ["9D7A",0x6F3D],
- ["D1FA",0x6F3E],
- ["9D7B",0x6F3F],
- ["9D7C",0x6F40],
- ["9D7D",0x6F41],
- ["9D7E",0x6F42],
- ["9D80",0x6F43],
- ["9D81",0x6F44],
- ["9D82",0x6F45],
- ["E4EB",0x6F46],
- ["E4EC",0x6F47],
- ["9D83",0x6F48],
- ["9D84",0x6F49],
- ["9D85",0x6F4A],
- ["E4F2",0x6F4B],
- ["9D86",0x6F4C],
- ["CEAB",0x6F4D],
- ["9D87",0x6F4E],
- ["9D88",0x6F4F],
- ["9D89",0x6F50],
- ["9D8A",0x6F51],
- ["9D8B",0x6F52],
- ["9D8C",0x6F53],
- ["9D8D",0x6F54],
- ["9D8E",0x6F55],
- ["9D8F",0x6F56],
- ["9D90",0x6F57],
- ["C5CB",0x6F58],
- ["9D91",0x6F59],
- ["9D92",0x6F5A],
- ["9D93",0x6F5B],
- ["C7B1",0x6F5C],
- ["9D94",0x6F5D],
- ["C2BA",0x6F5E],
- ["9D95",0x6F5F],
- ["9D96",0x6F60],
- ["9D97",0x6F61],
- ["E4EA",0x6F62],
- ["9D98",0x6F63],
- ["9D99",0x6F64],
- ["9D9A",0x6F65],
- ["C1CA",0x6F66],
- ["9D9B",0x6F67],
- ["9D9C",0x6F68],
- ["9D9D",0x6F69],
- ["9D9E",0x6F6A],
- ["9D9F",0x6F6B],
- ["9DA0",0x6F6C],
- ["CCB6",0x6F6D],
- ["B3B1",0x6F6E],
- ["9DA1",0x6F6F],
- ["9DA2",0x6F70],
- ["9DA3",0x6F71],
- ["E4FB",0x6F72],
- ["9DA4",0x6F73],
- ["E4F3",0x6F74],
- ["9DA5",0x6F75],
- ["9DA6",0x6F76],
- ["9DA7",0x6F77],
- ["E4FA",0x6F78],
- ["9DA8",0x6F79],
- ["E4FD",0x6F7A],
- ["9DA9",0x6F7B],
- ["E4FC",0x6F7C],
- ["9DAA",0x6F7D],
- ["9DAB",0x6F7E],
- ["9DAC",0x6F7F],
- ["9DAD",0x6F80],
- ["9DAE",0x6F81],
- ["9DAF",0x6F82],
- ["9DB0",0x6F83],
- ["B3CE",0x6F84],
- ["9DB1",0x6F85],
- ["9DB2",0x6F86],
- ["9DB3",0x6F87],
- ["B3BA",0x6F88],
- ["E4F7",0x6F89],
- ["9DB4",0x6F8A],
- ["9DB5",0x6F8B],
- ["E4F9",0x6F8C],
- ["E4F8",0x6F8D],
- ["C5EC",0x6F8E],
- ["9DB6",0x6F8F],
- ["9DB7",0x6F90],
- ["9DB8",0x6F91],
- ["9DB9",0x6F92],
- ["9DBA",0x6F93],
- ["9DBB",0x6F94],
- ["9DBC",0x6F95],
- ["9DBD",0x6F96],
- ["9DBE",0x6F97],
- ["9DBF",0x6F98],
- ["9DC0",0x6F99],
- ["9DC1",0x6F9A],
- ["9DC2",0x6F9B],
- ["C0BD",0x6F9C],
- ["9DC3",0x6F9D],
- ["9DC4",0x6F9E],
- ["9DC5",0x6F9F],
- ["9DC6",0x6FA0],
- ["D4E8",0x6FA1],
- ["9DC7",0x6FA2],
- ["9DC8",0x6FA3],
- ["9DC9",0x6FA4],
- ["9DCA",0x6FA5],
- ["9DCB",0x6FA6],
- ["E5A2",0x6FA7],
- ["9DCC",0x6FA8],
- ["9DCD",0x6FA9],
- ["9DCE",0x6FAA],
- ["9DCF",0x6FAB],
- ["9DD0",0x6FAC],
- ["9DD1",0x6FAD],
- ["9DD2",0x6FAE],
- ["9DD3",0x6FAF],
- ["9DD4",0x6FB0],
- ["9DD5",0x6FB1],
- ["9DD6",0x6FB2],
- ["B0C4",0x6FB3],
- ["9DD7",0x6FB4],
- ["9DD8",0x6FB5],
- ["E5A4",0x6FB6],
- ["9DD9",0x6FB7],
- ["9DDA",0x6FB8],
- ["E5A3",0x6FB9],
- ["9DDB",0x6FBA],
- ["9DDC",0x6FBB],
- ["9DDD",0x6FBC],
- ["9DDE",0x6FBD],
- ["9DDF",0x6FBE],
- ["9DE0",0x6FBF],
- ["BCA4",0x6FC0],
- ["9DE1",0x6FC1],
- ["E5A5",0x6FC2],
- ["9DE2",0x6FC3],
- ["9DE3",0x6FC4],
- ["9DE4",0x6FC5],
- ["9DE5",0x6FC6],
- ["9DE6",0x6FC7],
- ["9DE7",0x6FC8],
- ["E5A1",0x6FC9],
- ["9DE8",0x6FCA],
- ["9DE9",0x6FCB],
- ["9DEA",0x6FCC],
- ["9DEB",0x6FCD],
- ["9DEC",0x6FCE],
- ["9DED",0x6FCF],
- ["9DEE",0x6FD0],
- ["E4FE",0x6FD1],
- ["B1F4",0x6FD2],
- ["9DEF",0x6FD3],
- ["9DF0",0x6FD4],
- ["9DF1",0x6FD5],
- ["9DF2",0x6FD6],
- ["9DF3",0x6FD7],
- ["9DF4",0x6FD8],
- ["9DF5",0x6FD9],
- ["9DF6",0x6FDA],
- ["9DF7",0x6FDB],
- ["9DF8",0x6FDC],
- ["9DF9",0x6FDD],
- ["E5A8",0x6FDE],
- ["9DFA",0x6FDF],
- ["E5A9",0x6FE0],
- ["E5A6",0x6FE1],
- ["9DFB",0x6FE2],
- ["9DFC",0x6FE3],
- ["9DFD",0x6FE4],
- ["9DFE",0x6FE5],
- ["9E40",0x6FE6],
- ["9E41",0x6FE7],
- ["9E42",0x6FE8],
- ["9E43",0x6FE9],
- ["9E44",0x6FEA],
- ["9E45",0x6FEB],
- ["9E46",0x6FEC],
- ["9E47",0x6FED],
- ["E5A7",0x6FEE],
- ["E5AA",0x6FEF],
- ["9E48",0x6FF0],
- ["9E49",0x6FF1],
- ["9E4A",0x6FF2],
- ["9E4B",0x6FF3],
- ["9E4C",0x6FF4],
- ["9E4D",0x6FF5],
- ["9E4E",0x6FF6],
- ["9E4F",0x6FF7],
- ["9E50",0x6FF8],
- ["9E51",0x6FF9],
- ["9E52",0x6FFA],
- ["9E53",0x6FFB],
- ["9E54",0x6FFC],
- ["9E55",0x6FFD],
- ["9E56",0x6FFE],
- ["9E57",0x6FFF],
- ["9E58",0x7000],
- ["9E59",0x7001],
- ["9E5A",0x7002],
- ["9E5B",0x7003],
- ["9E5C",0x7004],
- ["9E5D",0x7005],
- ["9E5E",0x7006],
- ["9E5F",0x7007],
- ["9E60",0x7008],
- ["9E61",0x7009],
- ["9E62",0x700A],
- ["9E63",0x700B],
- ["9E64",0x700C],
- ["9E65",0x700D],
- ["9E66",0x700E],
- ["9E67",0x700F],
- ["9E68",0x7010],
- ["C6D9",0x7011],
- ["9E69",0x7012],
- ["9E6A",0x7013],
- ["9E6B",0x7014],
- ["9E6C",0x7015],
- ["9E6D",0x7016],
- ["9E6E",0x7017],
- ["9E6F",0x7018],
- ["9E70",0x7019],
- ["E5AB",0x701A],
- ["E5AD",0x701B],
- ["9E71",0x701C],
- ["9E72",0x701D],
- ["9E73",0x701E],
- ["9E74",0x701F],
- ["9E75",0x7020],
- ["9E76",0x7021],
- ["9E77",0x7022],
- ["E5AC",0x7023],
- ["9E78",0x7024],
- ["9E79",0x7025],
- ["9E7A",0x7026],
- ["9E7B",0x7027],
- ["9E7C",0x7028],
- ["9E7D",0x7029],
- ["9E7E",0x702A],
- ["9E80",0x702B],
- ["9E81",0x702C],
- ["9E82",0x702D],
- ["9E83",0x702E],
- ["9E84",0x702F],
- ["9E85",0x7030],
- ["9E86",0x7031],
- ["9E87",0x7032],
- ["9E88",0x7033],
- ["9E89",0x7034],
- ["E5AF",0x7035],
- ["9E8A",0x7036],
- ["9E8B",0x7037],
- ["9E8C",0x7038],
- ["E5AE",0x7039],
- ["9E8D",0x703A],
- ["9E8E",0x703B],
- ["9E8F",0x703C],
- ["9E90",0x703D],
- ["9E91",0x703E],
- ["9E92",0x703F],
- ["9E93",0x7040],
- ["9E94",0x7041],
- ["9E95",0x7042],
- ["9E96",0x7043],
- ["9E97",0x7044],
- ["9E98",0x7045],
- ["9E99",0x7046],
- ["9E9A",0x7047],
- ["9E9B",0x7048],
- ["9E9C",0x7049],
- ["9E9D",0x704A],
- ["9E9E",0x704B],
- ["B9E0",0x704C],
- ["9E9F",0x704D],
- ["9EA0",0x704E],
- ["E5B0",0x704F],
- ["9EA1",0x7050],
- ["9EA2",0x7051],
- ["9EA3",0x7052],
- ["9EA4",0x7053],
- ["9EA5",0x7054],
- ["9EA6",0x7055],
- ["9EA7",0x7056],
- ["9EA8",0x7057],
- ["9EA9",0x7058],
- ["9EAA",0x7059],
- ["9EAB",0x705A],
- ["9EAC",0x705B],
- ["9EAD",0x705C],
- ["9EAE",0x705D],
- ["E5B1",0x705E],
- ["9EAF",0x705F],
- ["9EB0",0x7060],
- ["9EB1",0x7061],
- ["9EB2",0x7062],
- ["9EB3",0x7063],
- ["9EB4",0x7064],
- ["9EB5",0x7065],
- ["9EB6",0x7066],
- ["9EB7",0x7067],
- ["9EB8",0x7068],
- ["9EB9",0x7069],
- ["9EBA",0x706A],
- ["BBF0",0x706B],
- ["ECE1",0x706C],
- ["C3F0",0x706D],
- ["9EBB",0x706E],
- ["B5C6",0x706F],
- ["BBD2",0x7070],
- ["9EBC",0x7071],
- ["9EBD",0x7072],
- ["9EBE",0x7073],
- ["9EBF",0x7074],
- ["C1E9",0x7075],
- ["D4EE",0x7076],
- ["9EC0",0x7077],
- ["BEC4",0x7078],
- ["9EC1",0x7079],
- ["9EC2",0x707A],
- ["9EC3",0x707B],
- ["D7C6",0x707C],
- ["9EC4",0x707D],
- ["D4D6",0x707E],
- ["B2D3",0x707F],
- ["ECBE",0x7080],
- ["9EC5",0x7081],
- ["9EC6",0x7082],
- ["9EC7",0x7083],
- ["9EC8",0x7084],
- ["EAC1",0x7085],
- ["9EC9",0x7086],
- ["9ECA",0x7087],
- ["9ECB",0x7088],
- ["C2AF",0x7089],
- ["B4B6",0x708A],
- ["9ECC",0x708B],
- ["9ECD",0x708C],
- ["9ECE",0x708D],
- ["D1D7",0x708E],
- ["9ECF",0x708F],
- ["9ED0",0x7090],
- ["9ED1",0x7091],
- ["B3B4",0x7092],
- ["9ED2",0x7093],
- ["C8B2",0x7094],
- ["BFBB",0x7095],
- ["ECC0",0x7096],
- ["9ED3",0x7097],
- ["9ED4",0x7098],
- ["D6CB",0x7099],
- ["9ED5",0x709A],
- ["9ED6",0x709B],
- ["ECBF",0x709C],
- ["ECC1",0x709D],
- ["9ED7",0x709E],
- ["9ED8",0x709F],
- ["9ED9",0x70A0],
- ["9EDA",0x70A1],
- ["9EDB",0x70A2],
- ["9EDC",0x70A3],
- ["9EDD",0x70A4],
- ["9EDE",0x70A5],
- ["9EDF",0x70A6],
- ["9EE0",0x70A7],
- ["9EE1",0x70A8],
- ["9EE2",0x70A9],
- ["9EE3",0x70AA],
- ["ECC5",0x70AB],
- ["BEE6",0x70AC],
- ["CCBF",0x70AD],
- ["C5DA",0x70AE],
- ["BEBC",0x70AF],
- ["9EE4",0x70B0],
- ["ECC6",0x70B1],
- ["9EE5",0x70B2],
- ["B1FE",0x70B3],
- ["9EE6",0x70B4],
- ["9EE7",0x70B5],
- ["9EE8",0x70B6],
- ["ECC4",0x70B7],
- ["D5A8",0x70B8],
- ["B5E3",0x70B9],
- ["9EE9",0x70BA],
- ["ECC2",0x70BB],
- ["C1B6",0x70BC],
- ["B3E3",0x70BD],
- ["9EEA",0x70BE],
- ["9EEB",0x70BF],
- ["ECC3",0x70C0],
- ["CBB8",0x70C1],
- ["C0C3",0x70C2],
- ["CCFE",0x70C3],
- ["9EEC",0x70C4],
- ["9EED",0x70C5],
- ["9EEE",0x70C6],
- ["9EEF",0x70C7],
- ["C1D2",0x70C8],
- ["9EF0",0x70C9],
- ["ECC8",0x70CA],
- ["9EF1",0x70CB],
- ["9EF2",0x70CC],
- ["9EF3",0x70CD],
- ["9EF4",0x70CE],
- ["9EF5",0x70CF],
- ["9EF6",0x70D0],
- ["9EF7",0x70D1],
- ["9EF8",0x70D2],
- ["9EF9",0x70D3],
- ["9EFA",0x70D4],
- ["9EFB",0x70D5],
- ["9EFC",0x70D6],
- ["9EFD",0x70D7],
- ["BAE6",0x70D8],
- ["C0D3",0x70D9],
- ["9EFE",0x70DA],
- ["D6F2",0x70DB],
- ["9F40",0x70DC],
- ["9F41",0x70DD],
- ["9F42",0x70DE],
- ["D1CC",0x70DF],
- ["9F43",0x70E0],
- ["9F44",0x70E1],
- ["9F45",0x70E2],
- ["9F46",0x70E3],
- ["BFBE",0x70E4],
- ["9F47",0x70E5],
- ["B7B3",0x70E6],
- ["C9D5",0x70E7],
- ["ECC7",0x70E8],
- ["BBE2",0x70E9],
- ["9F48",0x70EA],
- ["CCCC",0x70EB],
- ["BDFD",0x70EC],
- ["C8C8",0x70ED],
- ["9F49",0x70EE],
- ["CFA9",0x70EF],
- ["9F4A",0x70F0],
- ["9F4B",0x70F1],
- ["9F4C",0x70F2],
- ["9F4D",0x70F3],
- ["9F4E",0x70F4],
- ["9F4F",0x70F5],
- ["9F50",0x70F6],
- ["CDE9",0x70F7],
- ["9F51",0x70F8],
- ["C5EB",0x70F9],
- ["9F52",0x70FA],
- ["9F53",0x70FB],
- ["9F54",0x70FC],
- ["B7E9",0x70FD],
- ["9F55",0x70FE],
- ["9F56",0x70FF],
- ["9F57",0x7100],
- ["9F58",0x7101],
- ["9F59",0x7102],
- ["9F5A",0x7103],
- ["9F5B",0x7104],
- ["9F5C",0x7105],
- ["9F5D",0x7106],
- ["9F5E",0x7107],
- ["9F5F",0x7108],
- ["D1C9",0x7109],
- ["BAB8",0x710A],
- ["9F60",0x710B],
- ["9F61",0x710C],
- ["9F62",0x710D],
- ["9F63",0x710E],
- ["9F64",0x710F],
- ["ECC9",0x7110],
- ["9F65",0x7111],
- ["9F66",0x7112],
- ["ECCA",0x7113],
- ["9F67",0x7114],
- ["BBC0",0x7115],
- ["ECCB",0x7116],
- ["9F68",0x7117],
- ["ECE2",0x7118],
- ["B1BA",0x7119],
- ["B7D9",0x711A],
- ["9F69",0x711B],
- ["9F6A",0x711C],
- ["9F6B",0x711D],
- ["9F6C",0x711E],
- ["9F6D",0x711F],
- ["9F6E",0x7120],
- ["9F6F",0x7121],
- ["9F70",0x7122],
- ["9F71",0x7123],
- ["9F72",0x7124],
- ["9F73",0x7125],
- ["BDB9",0x7126],
- ["9F74",0x7127],
- ["9F75",0x7128],
- ["9F76",0x7129],
- ["9F77",0x712A],
- ["9F78",0x712B],
- ["9F79",0x712C],
- ["9F7A",0x712D],
- ["9F7B",0x712E],
- ["ECCC",0x712F],
- ["D1E6",0x7130],
- ["ECCD",0x7131],
- ["9F7C",0x7132],
- ["9F7D",0x7133],
- ["9F7E",0x7134],
- ["9F80",0x7135],
- ["C8BB",0x7136],
- ["9F81",0x7137],
- ["9F82",0x7138],
- ["9F83",0x7139],
- ["9F84",0x713A],
- ["9F85",0x713B],
- ["9F86",0x713C],
- ["9F87",0x713D],
- ["9F88",0x713E],
- ["9F89",0x713F],
- ["9F8A",0x7140],
- ["9F8B",0x7141],
- ["9F8C",0x7142],
- ["9F8D",0x7143],
- ["9F8E",0x7144],
- ["ECD1",0x7145],
- ["9F8F",0x7146],
- ["9F90",0x7147],
- ["9F91",0x7148],
- ["9F92",0x7149],
- ["ECD3",0x714A],
- ["9F93",0x714B],
- ["BBCD",0x714C],
- ["9F94",0x714D],
- ["BCE5",0x714E],
- ["9F95",0x714F],
- ["9F96",0x7150],
- ["9F97",0x7151],
- ["9F98",0x7152],
- ["9F99",0x7153],
- ["9F9A",0x7154],
- ["9F9B",0x7155],
- ["9F9C",0x7156],
- ["9F9D",0x7157],
- ["9F9E",0x7158],
- ["9F9F",0x7159],
- ["9FA0",0x715A],
- ["9FA1",0x715B],
- ["ECCF",0x715C],
- ["9FA2",0x715D],
- ["C9B7",0x715E],
- ["9FA3",0x715F],
- ["9FA4",0x7160],
- ["9FA5",0x7161],
- ["9FA6",0x7162],
- ["9FA7",0x7163],
- ["C3BA",0x7164],
- ["9FA8",0x7165],
- ["ECE3",0x7166],
- ["D5D5",0x7167],
- ["ECD0",0x7168],
- ["9FA9",0x7169],
- ["9FAA",0x716A],
- ["9FAB",0x716B],
- ["9FAC",0x716C],
- ["9FAD",0x716D],
- ["D6F3",0x716E],
- ["9FAE",0x716F],
- ["9FAF",0x7170],
- ["9FB0",0x7171],
- ["ECD2",0x7172],
- ["ECCE",0x7173],
- ["9FB1",0x7174],
- ["9FB2",0x7175],
- ["9FB3",0x7176],
- ["9FB4",0x7177],
- ["ECD4",0x7178],
- ["9FB5",0x7179],
- ["ECD5",0x717A],
- ["9FB6",0x717B],
- ["9FB7",0x717C],
- ["C9BF",0x717D],
- ["9FB8",0x717E],
- ["9FB9",0x717F],
- ["9FBA",0x7180],
- ["9FBB",0x7181],
- ["9FBC",0x7182],
- ["9FBD",0x7183],
- ["CFA8",0x7184],
- ["9FBE",0x7185],
- ["9FBF",0x7186],
- ["9FC0",0x7187],
- ["9FC1",0x7188],
- ["9FC2",0x7189],
- ["D0DC",0x718A],
- ["9FC3",0x718B],
- ["9FC4",0x718C],
- ["9FC5",0x718D],
- ["9FC6",0x718E],
- ["D1AC",0x718F],
- ["9FC7",0x7190],
- ["9FC8",0x7191],
- ["9FC9",0x7192],
- ["9FCA",0x7193],
- ["C8DB",0x7194],
- ["9FCB",0x7195],
- ["9FCC",0x7196],
- ["9FCD",0x7197],
- ["ECD6",0x7198],
- ["CEF5",0x7199],
- ["9FCE",0x719A],
- ["9FCF",0x719B],
- ["9FD0",0x719C],
- ["9FD1",0x719D],
- ["9FD2",0x719E],
- ["CAEC",0x719F],
- ["ECDA",0x71A0],
- ["9FD3",0x71A1],
- ["9FD4",0x71A2],
- ["9FD5",0x71A3],
- ["9FD6",0x71A4],
- ["9FD7",0x71A5],
- ["9FD8",0x71A6],
- ["9FD9",0x71A7],
- ["ECD9",0x71A8],
- ["9FDA",0x71A9],
- ["9FDB",0x71AA],
- ["9FDC",0x71AB],
- ["B0BE",0x71AC],
- ["9FDD",0x71AD],
- ["9FDE",0x71AE],
- ["9FDF",0x71AF],
- ["9FE0",0x71B0],
- ["9FE1",0x71B1],
- ["9FE2",0x71B2],
- ["ECD7",0x71B3],
- ["9FE3",0x71B4],
- ["ECD8",0x71B5],
- ["9FE4",0x71B6],
- ["9FE5",0x71B7],
- ["9FE6",0x71B8],
- ["ECE4",0x71B9],
- ["9FE7",0x71BA],
- ["9FE8",0x71BB],
- ["9FE9",0x71BC],
- ["9FEA",0x71BD],
- ["9FEB",0x71BE],
- ["9FEC",0x71BF],
- ["9FED",0x71C0],
- ["9FEE",0x71C1],
- ["9FEF",0x71C2],
- ["C8BC",0x71C3],
- ["9FF0",0x71C4],
- ["9FF1",0x71C5],
- ["9FF2",0x71C6],
- ["9FF3",0x71C7],
- ["9FF4",0x71C8],
- ["9FF5",0x71C9],
- ["9FF6",0x71CA],
- ["9FF7",0x71CB],
- ["9FF8",0x71CC],
- ["9FF9",0x71CD],
- ["C1C7",0x71CE],
- ["9FFA",0x71CF],
- ["9FFB",0x71D0],
- ["9FFC",0x71D1],
- ["9FFD",0x71D2],
- ["9FFE",0x71D3],
- ["ECDC",0x71D4],
- ["D1E0",0x71D5],
- ["A040",0x71D6],
- ["A041",0x71D7],
- ["A042",0x71D8],
- ["A043",0x71D9],
- ["A044",0x71DA],
- ["A045",0x71DB],
- ["A046",0x71DC],
- ["A047",0x71DD],
- ["A048",0x71DE],
- ["A049",0x71DF],
- ["ECDB",0x71E0],
- ["A04A",0x71E1],
- ["A04B",0x71E2],
- ["A04C",0x71E3],
- ["A04D",0x71E4],
- ["D4EF",0x71E5],
- ["A04E",0x71E6],
- ["ECDD",0x71E7],
- ["A04F",0x71E8],
- ["A050",0x71E9],
- ["A051",0x71EA],
- ["A052",0x71EB],
- ["A053",0x71EC],
- ["A054",0x71ED],
- ["DBC6",0x71EE],
- ["A055",0x71EF],
- ["A056",0x71F0],
- ["A057",0x71F1],
- ["A058",0x71F2],
- ["A059",0x71F3],
- ["A05A",0x71F4],
- ["A05B",0x71F5],
- ["A05C",0x71F6],
- ["A05D",0x71F7],
- ["A05E",0x71F8],
- ["ECDE",0x71F9],
- ["A05F",0x71FA],
- ["A060",0x71FB],
- ["A061",0x71FC],
- ["A062",0x71FD],
- ["A063",0x71FE],
- ["A064",0x71FF],
- ["A065",0x7200],
- ["A066",0x7201],
- ["A067",0x7202],
- ["A068",0x7203],
- ["A069",0x7204],
- ["A06A",0x7205],
- ["B1AC",0x7206],
- ["A06B",0x7207],
- ["A06C",0x7208],
- ["A06D",0x7209],
- ["A06E",0x720A],
- ["A06F",0x720B],
- ["A070",0x720C],
- ["A071",0x720D],
- ["A072",0x720E],
- ["A073",0x720F],
- ["A074",0x7210],
- ["A075",0x7211],
- ["A076",0x7212],
- ["A077",0x7213],
- ["A078",0x7214],
- ["A079",0x7215],
- ["A07A",0x7216],
- ["A07B",0x7217],
- ["A07C",0x7218],
- ["A07D",0x7219],
- ["A07E",0x721A],
- ["A080",0x721B],
- ["A081",0x721C],
- ["ECDF",0x721D],
- ["A082",0x721E],
- ["A083",0x721F],
- ["A084",0x7220],
- ["A085",0x7221],
- ["A086",0x7222],
- ["A087",0x7223],
- ["A088",0x7224],
- ["A089",0x7225],
- ["A08A",0x7226],
- ["A08B",0x7227],
- ["ECE0",0x7228],
- ["A08C",0x7229],
- ["D7A6",0x722A],
- ["A08D",0x722B],
- ["C5C0",0x722C],
- ["A08E",0x722D],
- ["A08F",0x722E],
- ["A090",0x722F],
- ["EBBC",0x7230],
- ["B0AE",0x7231],
- ["A091",0x7232],
- ["A092",0x7233],
- ["A093",0x7234],
- ["BEF4",0x7235],
- ["B8B8",0x7236],
- ["D2AF",0x7237],
- ["B0D6",0x7238],
- ["B5F9",0x7239],
- ["A094",0x723A],
- ["D8B3",0x723B],
- ["A095",0x723C],
- ["CBAC",0x723D],
- ["A096",0x723E],
- ["E3DD",0x723F],
- ["A097",0x7240],
- ["A098",0x7241],
- ["A099",0x7242],
- ["A09A",0x7243],
- ["A09B",0x7244],
- ["A09C",0x7245],
- ["A09D",0x7246],
- ["C6AC",0x7247],
- ["B0E6",0x7248],
- ["A09E",0x7249],
- ["A09F",0x724A],
- ["A0A0",0x724B],
- ["C5C6",0x724C],
- ["EBB9",0x724D],
- ["A0A1",0x724E],
- ["A0A2",0x724F],
- ["A0A3",0x7250],
- ["A0A4",0x7251],
- ["EBBA",0x7252],
- ["A0A5",0x7253],
- ["A0A6",0x7254],
- ["A0A7",0x7255],
- ["EBBB",0x7256],
- ["A0A8",0x7257],
- ["A0A9",0x7258],
- ["D1C0",0x7259],
- ["A0AA",0x725A],
- ["C5A3",0x725B],
- ["A0AB",0x725C],
- ["EAF2",0x725D],
- ["A0AC",0x725E],
- ["C4B2",0x725F],
- ["A0AD",0x7260],
- ["C4B5",0x7261],
- ["C0CE",0x7262],
- ["A0AE",0x7263],
- ["A0AF",0x7264],
- ["A0B0",0x7265],
- ["EAF3",0x7266],
- ["C4C1",0x7267],
- ["A0B1",0x7268],
- ["CEEF",0x7269],
- ["A0B2",0x726A],
- ["A0B3",0x726B],
- ["A0B4",0x726C],
- ["A0B5",0x726D],
- ["EAF0",0x726E],
- ["EAF4",0x726F],
- ["A0B6",0x7270],
- ["A0B7",0x7271],
- ["C9FC",0x7272],
- ["A0B8",0x7273],
- ["A0B9",0x7274],
- ["C7A3",0x7275],
- ["A0BA",0x7276],
- ["A0BB",0x7277],
- ["A0BC",0x7278],
- ["CCD8",0x7279],
- ["CEFE",0x727A],
- ["A0BD",0x727B],
- ["A0BE",0x727C],
- ["A0BF",0x727D],
- ["EAF5",0x727E],
- ["EAF6",0x727F],
- ["CFAC",0x7280],
- ["C0E7",0x7281],
- ["A0C0",0x7282],
- ["A0C1",0x7283],
- ["EAF7",0x7284],
- ["A0C2",0x7285],
- ["A0C3",0x7286],
- ["A0C4",0x7287],
- ["A0C5",0x7288],
- ["A0C6",0x7289],
- ["B6BF",0x728A],
- ["EAF8",0x728B],
- ["A0C7",0x728C],
- ["EAF9",0x728D],
- ["A0C8",0x728E],
- ["EAFA",0x728F],
- ["A0C9",0x7290],
- ["A0CA",0x7291],
- ["EAFB",0x7292],
- ["A0CB",0x7293],
- ["A0CC",0x7294],
- ["A0CD",0x7295],
- ["A0CE",0x7296],
- ["A0CF",0x7297],
- ["A0D0",0x7298],
- ["A0D1",0x7299],
- ["A0D2",0x729A],
- ["A0D3",0x729B],
- ["A0D4",0x729C],
- ["A0D5",0x729D],
- ["A0D6",0x729E],
- ["EAF1",0x729F],
- ["A0D7",0x72A0],
- ["A0D8",0x72A1],
- ["A0D9",0x72A2],
- ["A0DA",0x72A3],
- ["A0DB",0x72A4],
- ["A0DC",0x72A5],
- ["A0DD",0x72A6],
- ["A0DE",0x72A7],
- ["A0DF",0x72A8],
- ["A0E0",0x72A9],
- ["A0E1",0x72AA],
- ["A0E2",0x72AB],
- ["C8AE",0x72AC],
- ["E1EB",0x72AD],
- ["A0E3",0x72AE],
- ["B7B8",0x72AF],
- ["E1EC",0x72B0],
- ["A0E4",0x72B1],
- ["A0E5",0x72B2],
- ["A0E6",0x72B3],
- ["E1ED",0x72B4],
- ["A0E7",0x72B5],
- ["D7B4",0x72B6],
- ["E1EE",0x72B7],
- ["E1EF",0x72B8],
- ["D3CC",0x72B9],
- ["A0E8",0x72BA],
- ["A0E9",0x72BB],
- ["A0EA",0x72BC],
- ["A0EB",0x72BD],
- ["A0EC",0x72BE],
- ["A0ED",0x72BF],
- ["A0EE",0x72C0],
- ["E1F1",0x72C1],
- ["BFF1",0x72C2],
- ["E1F0",0x72C3],
- ["B5D2",0x72C4],
- ["A0EF",0x72C5],
- ["A0F0",0x72C6],
- ["A0F1",0x72C7],
- ["B1B7",0x72C8],
- ["A0F2",0x72C9],
- ["A0F3",0x72CA],
- ["A0F4",0x72CB],
- ["A0F5",0x72CC],
- ["E1F3",0x72CD],
- ["E1F2",0x72CE],
- ["A0F6",0x72CF],
- ["BAFC",0x72D0],
- ["A0F7",0x72D1],
- ["E1F4",0x72D2],
- ["A0F8",0x72D3],
- ["A0F9",0x72D4],
- ["A0FA",0x72D5],
- ["A0FB",0x72D6],
- ["B9B7",0x72D7],
- ["A0FC",0x72D8],
- ["BED1",0x72D9],
- ["A0FD",0x72DA],
- ["A0FE",0x72DB],
- ["AA40",0x72DC],
- ["AA41",0x72DD],
- ["C4FC",0x72DE],
- ["AA42",0x72DF],
- ["BADD",0x72E0],
- ["BDC6",0x72E1],
- ["AA43",0x72E2],
- ["AA44",0x72E3],
- ["AA45",0x72E4],
- ["AA46",0x72E5],
- ["AA47",0x72E6],
- ["AA48",0x72E7],
- ["E1F5",0x72E8],
- ["E1F7",0x72E9],
- ["AA49",0x72EA],
- ["AA4A",0x72EB],
- ["B6C0",0x72EC],
- ["CFC1",0x72ED],
- ["CAA8",0x72EE],
- ["E1F6",0x72EF],
- ["D5F8",0x72F0],
- ["D3FC",0x72F1],
- ["E1F8",0x72F2],
- ["E1FC",0x72F3],
- ["E1F9",0x72F4],
- ["AA4B",0x72F5],
- ["AA4C",0x72F6],
- ["E1FA",0x72F7],
- ["C0EA",0x72F8],
- ["AA4D",0x72F9],
- ["E1FE",0x72FA],
- ["E2A1",0x72FB],
- ["C0C7",0x72FC],
- ["AA4E",0x72FD],
- ["AA4F",0x72FE],
- ["AA50",0x72FF],
- ["AA51",0x7300],
- ["E1FB",0x7301],
- ["AA52",0x7302],
- ["E1FD",0x7303],
- ["AA53",0x7304],
- ["AA54",0x7305],
- ["AA55",0x7306],
- ["AA56",0x7307],
- ["AA57",0x7308],
- ["AA58",0x7309],
- ["E2A5",0x730A],
- ["AA59",0x730B],
- ["AA5A",0x730C],
- ["AA5B",0x730D],
- ["C1D4",0x730E],
- ["AA5C",0x730F],
- ["AA5D",0x7310],
- ["AA5E",0x7311],
- ["AA5F",0x7312],
- ["E2A3",0x7313],
- ["AA60",0x7314],
- ["E2A8",0x7315],
- ["B2FE",0x7316],
- ["E2A2",0x7317],
- ["AA61",0x7318],
- ["AA62",0x7319],
- ["AA63",0x731A],
- ["C3CD",0x731B],
- ["B2C2",0x731C],
- ["E2A7",0x731D],
- ["E2A6",0x731E],
- ["AA64",0x731F],
- ["AA65",0x7320],
- ["E2A4",0x7321],
- ["E2A9",0x7322],
- ["AA66",0x7323],
- ["AA67",0x7324],
- ["E2AB",0x7325],
- ["AA68",0x7326],
- ["AA69",0x7327],
- ["AA6A",0x7328],
- ["D0C9",0x7329],
- ["D6ED",0x732A],
- ["C3A8",0x732B],
- ["E2AC",0x732C],
- ["AA6B",0x732D],
- ["CFD7",0x732E],
- ["AA6C",0x732F],
- ["AA6D",0x7330],
- ["E2AE",0x7331],
- ["AA6E",0x7332],
- ["AA6F",0x7333],
- ["BAEF",0x7334],
- ["AA70",0x7335],
- ["AA71",0x7336],
- ["E9E0",0x7337],
- ["E2AD",0x7338],
- ["E2AA",0x7339],
- ["AA72",0x733A],
- ["AA73",0x733B],
- ["AA74",0x733C],
- ["AA75",0x733D],
- ["BBAB",0x733E],
- ["D4B3",0x733F],
- ["AA76",0x7340],
- ["AA77",0x7341],
- ["AA78",0x7342],
- ["AA79",0x7343],
- ["AA7A",0x7344],
- ["AA7B",0x7345],
- ["AA7C",0x7346],
- ["AA7D",0x7347],
- ["AA7E",0x7348],
- ["AA80",0x7349],
- ["AA81",0x734A],
- ["AA82",0x734B],
- ["AA83",0x734C],
- ["E2B0",0x734D],
- ["AA84",0x734E],
- ["AA85",0x734F],
- ["E2AF",0x7350],
- ["AA86",0x7351],
- ["E9E1",0x7352],
- ["AA87",0x7353],
- ["AA88",0x7354],
- ["AA89",0x7355],
- ["AA8A",0x7356],
- ["E2B1",0x7357],
- ["AA8B",0x7358],
- ["AA8C",0x7359],
- ["AA8D",0x735A],
- ["AA8E",0x735B],
- ["AA8F",0x735C],
- ["AA90",0x735D],
- ["AA91",0x735E],
- ["AA92",0x735F],
- ["E2B2",0x7360],
- ["AA93",0x7361],
- ["AA94",0x7362],
- ["AA95",0x7363],
- ["AA96",0x7364],
- ["AA97",0x7365],
- ["AA98",0x7366],
- ["AA99",0x7367],
- ["AA9A",0x7368],
- ["AA9B",0x7369],
- ["AA9C",0x736A],
- ["AA9D",0x736B],
- ["E2B3",0x736C],
- ["CCA1",0x736D],
- ["AA9E",0x736E],
- ["E2B4",0x736F],
- ["AA9F",0x7370],
- ["AAA0",0x7371],
- ["AB40",0x7372],
- ["AB41",0x7373],
- ["AB42",0x7374],
- ["AB43",0x7375],
- ["AB44",0x7376],
- ["AB45",0x7377],
- ["AB46",0x7378],
- ["AB47",0x7379],
- ["AB48",0x737A],
- ["AB49",0x737B],
- ["AB4A",0x737C],
- ["AB4B",0x737D],
- ["E2B5",0x737E],
- ["AB4C",0x737F],
- ["AB4D",0x7380],
- ["AB4E",0x7381],
- ["AB4F",0x7382],
- ["AB50",0x7383],
- ["D0FE",0x7384],
- ["AB51",0x7385],
- ["AB52",0x7386],
- ["C2CA",0x7387],
- ["AB53",0x7388],
- ["D3F1",0x7389],
- ["AB54",0x738A],
- ["CDF5",0x738B],
- ["AB55",0x738C],
- ["AB56",0x738D],
- ["E7E0",0x738E],
- ["AB57",0x738F],
- ["AB58",0x7390],
- ["E7E1",0x7391],
- ["AB59",0x7392],
- ["AB5A",0x7393],
- ["AB5B",0x7394],
- ["AB5C",0x7395],
- ["BEC1",0x7396],
- ["AB5D",0x7397],
- ["AB5E",0x7398],
- ["AB5F",0x7399],
- ["AB60",0x739A],
- ["C2EA",0x739B],
- ["AB61",0x739C],
- ["AB62",0x739D],
- ["AB63",0x739E],
- ["E7E4",0x739F],
- ["AB64",0x73A0],
- ["AB65",0x73A1],
- ["E7E3",0x73A2],
- ["AB66",0x73A3],
- ["AB67",0x73A4],
- ["AB68",0x73A5],
- ["AB69",0x73A6],
- ["AB6A",0x73A7],
- ["AB6B",0x73A8],
- ["CDE6",0x73A9],
- ["AB6C",0x73AA],
- ["C3B5",0x73AB],
- ["AB6D",0x73AC],
- ["AB6E",0x73AD],
- ["E7E2",0x73AE],
- ["BBB7",0x73AF],
- ["CFD6",0x73B0],
- ["AB6F",0x73B1],
- ["C1E1",0x73B2],
- ["E7E9",0x73B3],
- ["AB70",0x73B4],
- ["AB71",0x73B5],
- ["AB72",0x73B6],
- ["E7E8",0x73B7],
- ["AB73",0x73B8],
- ["AB74",0x73B9],
- ["E7F4",0x73BA],
- ["B2A3",0x73BB],
- ["AB75",0x73BC],
- ["AB76",0x73BD],
- ["AB77",0x73BE],
- ["AB78",0x73BF],
- ["E7EA",0x73C0],
- ["AB79",0x73C1],
- ["E7E6",0x73C2],
- ["AB7A",0x73C3],
- ["AB7B",0x73C4],
- ["AB7C",0x73C5],
- ["AB7D",0x73C6],
- ["AB7E",0x73C7],
- ["E7EC",0x73C8],
- ["E7EB",0x73C9],
- ["C9BA",0x73CA],
- ["AB80",0x73CB],
- ["AB81",0x73CC],
- ["D5E4",0x73CD],
- ["AB82",0x73CE],
- ["E7E5",0x73CF],
- ["B7A9",0x73D0],
- ["E7E7",0x73D1],
- ["AB83",0x73D2],
- ["AB84",0x73D3],
- ["AB85",0x73D4],
- ["AB86",0x73D5],
- ["AB87",0x73D6],
- ["AB88",0x73D7],
- ["AB89",0x73D8],
- ["E7EE",0x73D9],
- ["AB8A",0x73DA],
- ["AB8B",0x73DB],
- ["AB8C",0x73DC],
- ["AB8D",0x73DD],
- ["E7F3",0x73DE],
- ["AB8E",0x73DF],
- ["D6E9",0x73E0],
- ["AB8F",0x73E1],
- ["AB90",0x73E2],
- ["AB91",0x73E3],
- ["AB92",0x73E4],
- ["E7ED",0x73E5],
- ["AB93",0x73E6],
- ["E7F2",0x73E7],
- ["AB94",0x73E8],
- ["E7F1",0x73E9],
- ["AB95",0x73EA],
- ["AB96",0x73EB],
- ["AB97",0x73EC],
- ["B0E0",0x73ED],
- ["AB98",0x73EE],
- ["AB99",0x73EF],
- ["AB9A",0x73F0],
- ["AB9B",0x73F1],
- ["E7F5",0x73F2],
- ["AB9C",0x73F3],
- ["AB9D",0x73F4],
- ["AB9E",0x73F5],
- ["AB9F",0x73F6],
- ["ABA0",0x73F7],
- ["AC40",0x73F8],
- ["AC41",0x73F9],
- ["AC42",0x73FA],
- ["AC43",0x73FB],
- ["AC44",0x73FC],
- ["AC45",0x73FD],
- ["AC46",0x73FE],
- ["AC47",0x73FF],
- ["AC48",0x7400],
- ["AC49",0x7401],
- ["AC4A",0x7402],
- ["C7F2",0x7403],
- ["AC4B",0x7404],
- ["C0C5",0x7405],
- ["C0ED",0x7406],
- ["AC4C",0x7407],
- ["AC4D",0x7408],
- ["C1F0",0x7409],
- ["E7F0",0x740A],
- ["AC4E",0x740B],
- ["AC4F",0x740C],
- ["AC50",0x740D],
- ["AC51",0x740E],
- ["E7F6",0x740F],
- ["CBF6",0x7410],
- ["AC52",0x7411],
- ["AC53",0x7412],
- ["AC54",0x7413],
- ["AC55",0x7414],
- ["AC56",0x7415],
- ["AC57",0x7416],
- ["AC58",0x7417],
- ["AC59",0x7418],
- ["AC5A",0x7419],
- ["E8A2",0x741A],
- ["E8A1",0x741B],
- ["AC5B",0x741C],
- ["AC5C",0x741D],
- ["AC5D",0x741E],
- ["AC5E",0x741F],
- ["AC5F",0x7420],
- ["AC60",0x7421],
- ["D7C1",0x7422],
- ["AC61",0x7423],
- ["AC62",0x7424],
- ["E7FA",0x7425],
- ["E7F9",0x7426],
- ["AC63",0x7427],
- ["E7FB",0x7428],
- ["AC64",0x7429],
- ["E7F7",0x742A],
- ["AC65",0x742B],
- ["E7FE",0x742C],
- ["AC66",0x742D],
- ["E7FD",0x742E],
- ["AC67",0x742F],
- ["E7FC",0x7430],
- ["AC68",0x7431],
- ["AC69",0x7432],
- ["C1D5",0x7433],
- ["C7D9",0x7434],
- ["C5FD",0x7435],
- ["C5C3",0x7436],
- ["AC6A",0x7437],
- ["AC6B",0x7438],
- ["AC6C",0x7439],
- ["AC6D",0x743A],
- ["AC6E",0x743B],
- ["C7ED",0x743C],
- ["AC6F",0x743D],
- ["AC70",0x743E],
- ["AC71",0x743F],
- ["AC72",0x7440],
- ["E8A3",0x7441],
- ["AC73",0x7442],
- ["AC74",0x7443],
- ["AC75",0x7444],
- ["AC76",0x7445],
- ["AC77",0x7446],
- ["AC78",0x7447],
- ["AC79",0x7448],
- ["AC7A",0x7449],
- ["AC7B",0x744A],
- ["AC7C",0x744B],
- ["AC7D",0x744C],
- ["AC7E",0x744D],
- ["AC80",0x744E],
- ["AC81",0x744F],
- ["AC82",0x7450],
- ["AC83",0x7451],
- ["AC84",0x7452],
- ["AC85",0x7453],
- ["AC86",0x7454],
- ["E8A6",0x7455],
- ["AC87",0x7456],
- ["E8A5",0x7457],
- ["AC88",0x7458],
- ["E8A7",0x7459],
- ["BAF7",0x745A],
- ["E7F8",0x745B],
- ["E8A4",0x745C],
- ["AC89",0x745D],
- ["C8F0",0x745E],
- ["C9AA",0x745F],
- ["AC8A",0x7460],
- ["AC8B",0x7461],
- ["AC8C",0x7462],
- ["AC8D",0x7463],
- ["AC8E",0x7464],
- ["AC8F",0x7465],
- ["AC90",0x7466],
- ["AC91",0x7467],
- ["AC92",0x7468],
- ["AC93",0x7469],
- ["AC94",0x746A],
- ["AC95",0x746B],
- ["AC96",0x746C],
- ["E8A9",0x746D],
- ["AC97",0x746E],
- ["AC98",0x746F],
- ["B9E5",0x7470],
- ["AC99",0x7471],
- ["AC9A",0x7472],
- ["AC9B",0x7473],
- ["AC9C",0x7474],
- ["AC9D",0x7475],
- ["D1FE",0x7476],
- ["E8A8",0x7477],
- ["AC9E",0x7478],
- ["AC9F",0x7479],
- ["ACA0",0x747A],
- ["AD40",0x747B],
- ["AD41",0x747C],
- ["AD42",0x747D],
- ["E8AA",0x747E],
- ["AD43",0x747F],
- ["E8AD",0x7480],
- ["E8AE",0x7481],
- ["AD44",0x7482],
- ["C1A7",0x7483],
- ["AD45",0x7484],
- ["AD46",0x7485],
- ["AD47",0x7486],
- ["E8AF",0x7487],
- ["AD48",0x7488],
- ["AD49",0x7489],
- ["AD4A",0x748A],
- ["E8B0",0x748B],
- ["AD4B",0x748C],
- ["AD4C",0x748D],
- ["E8AC",0x748E],
- ["AD4D",0x748F],
- ["E8B4",0x7490],
- ["AD4E",0x7491],
- ["AD4F",0x7492],
- ["AD50",0x7493],
- ["AD51",0x7494],
- ["AD52",0x7495],
- ["AD53",0x7496],
- ["AD54",0x7497],
- ["AD55",0x7498],
- ["AD56",0x7499],
- ["AD57",0x749A],
- ["AD58",0x749B],
- ["E8AB",0x749C],
- ["AD59",0x749D],
- ["E8B1",0x749E],
- ["AD5A",0x749F],
- ["AD5B",0x74A0],
- ["AD5C",0x74A1],
- ["AD5D",0x74A2],
- ["AD5E",0x74A3],
- ["AD5F",0x74A4],
- ["AD60",0x74A5],
- ["AD61",0x74A6],
- ["E8B5",0x74A7],
- ["E8B2",0x74A8],
- ["E8B3",0x74A9],
- ["AD62",0x74AA],
- ["AD63",0x74AB],
- ["AD64",0x74AC],
- ["AD65",0x74AD],
- ["AD66",0x74AE],
- ["AD67",0x74AF],
- ["AD68",0x74B0],
- ["AD69",0x74B1],
- ["AD6A",0x74B2],
- ["AD6B",0x74B3],
- ["AD6C",0x74B4],
- ["AD6D",0x74B5],
- ["AD6E",0x74B6],
- ["AD6F",0x74B7],
- ["AD70",0x74B8],
- ["AD71",0x74B9],
- ["E8B7",0x74BA],
- ["AD72",0x74BB],
- ["AD73",0x74BC],
- ["AD74",0x74BD],
- ["AD75",0x74BE],
- ["AD76",0x74BF],
- ["AD77",0x74C0],
- ["AD78",0x74C1],
- ["AD79",0x74C2],
- ["AD7A",0x74C3],
- ["AD7B",0x74C4],
- ["AD7C",0x74C5],
- ["AD7D",0x74C6],
- ["AD7E",0x74C7],
- ["AD80",0x74C8],
- ["AD81",0x74C9],
- ["AD82",0x74CA],
- ["AD83",0x74CB],
- ["AD84",0x74CC],
- ["AD85",0x74CD],
- ["AD86",0x74CE],
- ["AD87",0x74CF],
- ["AD88",0x74D0],
- ["AD89",0x74D1],
- ["E8B6",0x74D2],
- ["AD8A",0x74D3],
- ["AD8B",0x74D4],
- ["AD8C",0x74D5],
- ["AD8D",0x74D6],
- ["AD8E",0x74D7],
- ["AD8F",0x74D8],
- ["AD90",0x74D9],
- ["AD91",0x74DA],
- ["AD92",0x74DB],
- ["B9CF",0x74DC],
- ["AD93",0x74DD],
- ["F0AC",0x74DE],
- ["AD94",0x74DF],
- ["F0AD",0x74E0],
- ["AD95",0x74E1],
- ["C6B0",0x74E2],
- ["B0EA",0x74E3],
- ["C8BF",0x74E4],
- ["AD96",0x74E5],
- ["CDDF",0x74E6],
- ["AD97",0x74E7],
- ["AD98",0x74E8],
- ["AD99",0x74E9],
- ["AD9A",0x74EA],
- ["AD9B",0x74EB],
- ["AD9C",0x74EC],
- ["AD9D",0x74ED],
- ["CECD",0x74EE],
- ["EAB1",0x74EF],
- ["AD9E",0x74F0],
- ["AD9F",0x74F1],
- ["ADA0",0x74F2],
- ["AE40",0x74F3],
- ["EAB2",0x74F4],
- ["AE41",0x74F5],
- ["C6BF",0x74F6],
- ["B4C9",0x74F7],
- ["AE42",0x74F8],
- ["AE43",0x74F9],
- ["AE44",0x74FA],
- ["AE45",0x74FB],
- ["AE46",0x74FC],
- ["AE47",0x74FD],
- ["AE48",0x74FE],
- ["EAB3",0x74FF],
- ["AE49",0x7500],
- ["AE4A",0x7501],
- ["AE4B",0x7502],
- ["AE4C",0x7503],
- ["D5E7",0x7504],
- ["AE4D",0x7505],
- ["AE4E",0x7506],
- ["AE4F",0x7507],
- ["AE50",0x7508],
- ["AE51",0x7509],
- ["AE52",0x750A],
- ["AE53",0x750B],
- ["AE54",0x750C],
- ["DDF9",0x750D],
- ["AE55",0x750E],
- ["EAB4",0x750F],
- ["AE56",0x7510],
- ["EAB5",0x7511],
- ["AE57",0x7512],
- ["EAB6",0x7513],
- ["AE58",0x7514],
- ["AE59",0x7515],
- ["AE5A",0x7516],
- ["AE5B",0x7517],
- ["B8CA",0x7518],
- ["DFB0",0x7519],
- ["C9F5",0x751A],
- ["AE5C",0x751B],
- ["CCF0",0x751C],
- ["AE5D",0x751D],
- ["AE5E",0x751E],
- ["C9FA",0x751F],
- ["AE5F",0x7520],
- ["AE60",0x7521],
- ["AE61",0x7522],
- ["AE62",0x7523],
- ["AE63",0x7524],
- ["C9FB",0x7525],
- ["AE64",0x7526],
- ["AE65",0x7527],
- ["D3C3",0x7528],
- ["CBA6",0x7529],
- ["AE66",0x752A],
- ["B8A6",0x752B],
- ["F0AE",0x752C],
- ["B1C2",0x752D],
- ["AE67",0x752E],
- ["E5B8",0x752F],
- ["CCEF",0x7530],
- ["D3C9",0x7531],
- ["BCD7",0x7532],
- ["C9EA",0x7533],
- ["AE68",0x7534],
- ["B5E7",0x7535],
- ["AE69",0x7536],
- ["C4D0",0x7537],
- ["B5E9",0x7538],
- ["AE6A",0x7539],
- ["EEAE",0x753A],
- ["BBAD",0x753B],
- ["AE6B",0x753C],
- ["AE6C",0x753D],
- ["E7DE",0x753E],
- ["AE6D",0x753F],
- ["EEAF",0x7540],
- ["AE6E",0x7541],
- ["AE6F",0x7542],
- ["AE70",0x7543],
- ["AE71",0x7544],
- ["B3A9",0x7545],
- ["AE72",0x7546],
- ["AE73",0x7547],
- ["EEB2",0x7548],
- ["AE74",0x7549],
- ["AE75",0x754A],
- ["EEB1",0x754B],
- ["BDE7",0x754C],
- ["AE76",0x754D],
- ["EEB0",0x754E],
- ["CEB7",0x754F],
- ["AE77",0x7550],
- ["AE78",0x7551],
- ["AE79",0x7552],
- ["AE7A",0x7553],
- ["C5CF",0x7554],
- ["AE7B",0x7555],
- ["AE7C",0x7556],
- ["AE7D",0x7557],
- ["AE7E",0x7558],
- ["C1F4",0x7559],
- ["DBCE",0x755A],
- ["EEB3",0x755B],
- ["D0F3",0x755C],
- ["AE80",0x755D],
- ["AE81",0x755E],
- ["AE82",0x755F],
- ["AE83",0x7560],
- ["AE84",0x7561],
- ["AE85",0x7562],
- ["AE86",0x7563],
- ["AE87",0x7564],
- ["C2D4",0x7565],
- ["C6E8",0x7566],
- ["AE88",0x7567],
- ["AE89",0x7568],
- ["AE8A",0x7569],
- ["B7AC",0x756A],
- ["AE8B",0x756B],
- ["AE8C",0x756C],
- ["AE8D",0x756D],
- ["AE8E",0x756E],
- ["AE8F",0x756F],
- ["AE90",0x7570],
- ["AE91",0x7571],
- ["EEB4",0x7572],
- ["AE92",0x7573],
- ["B3EB",0x7574],
- ["AE93",0x7575],
- ["AE94",0x7576],
- ["AE95",0x7577],
- ["BBFB",0x7578],
- ["EEB5",0x7579],
- ["AE96",0x757A],
- ["AE97",0x757B],
- ["AE98",0x757C],
- ["AE99",0x757D],
- ["AE9A",0x757E],
- ["E7DC",0x757F],
- ["AE9B",0x7580],
- ["AE9C",0x7581],
- ["AE9D",0x7582],
- ["EEB6",0x7583],
- ["AE9E",0x7584],
- ["AE9F",0x7585],
- ["BDAE",0x7586],
- ["AEA0",0x7587],
- ["AF40",0x7588],
- ["AF41",0x7589],
- ["AF42",0x758A],
- ["F1E2",0x758B],
- ["AF43",0x758C],
- ["AF44",0x758D],
- ["AF45",0x758E],
- ["CAE8",0x758F],
- ["AF46",0x7590],
- ["D2C9",0x7591],
- ["F0DA",0x7592],
- ["AF47",0x7593],
- ["F0DB",0x7594],
- ["AF48",0x7595],
- ["F0DC",0x7596],
- ["C1C6",0x7597],
- ["AF49",0x7598],
- ["B8ED",0x7599],
- ["BECE",0x759A],
- ["AF4A",0x759B],
- ["AF4B",0x759C],
- ["F0DE",0x759D],
- ["AF4C",0x759E],
- ["C5B1",0x759F],
- ["F0DD",0x75A0],
- ["D1F1",0x75A1],
- ["AF4D",0x75A2],
- ["F0E0",0x75A3],
- ["B0CC",0x75A4],
- ["BDEA",0x75A5],
- ["AF4E",0x75A6],
- ["AF4F",0x75A7],
- ["AF50",0x75A8],
- ["AF51",0x75A9],
- ["AF52",0x75AA],
- ["D2DF",0x75AB],
- ["F0DF",0x75AC],
- ["AF53",0x75AD],
- ["B4AF",0x75AE],
- ["B7E8",0x75AF],
- ["F0E6",0x75B0],
- ["F0E5",0x75B1],
- ["C6A3",0x75B2],
- ["F0E1",0x75B3],
- ["F0E2",0x75B4],
- ["B4C3",0x75B5],
- ["AF54",0x75B6],
- ["AF55",0x75B7],
- ["F0E3",0x75B8],
- ["D5EE",0x75B9],
- ["AF56",0x75BA],
- ["AF57",0x75BB],
- ["CCDB",0x75BC],
- ["BED2",0x75BD],
- ["BCB2",0x75BE],
- ["AF58",0x75BF],
- ["AF59",0x75C0],
- ["AF5A",0x75C1],
- ["F0E8",0x75C2],
- ["F0E7",0x75C3],
- ["F0E4",0x75C4],
- ["B2A1",0x75C5],
- ["AF5B",0x75C6],
- ["D6A2",0x75C7],
- ["D3B8",0x75C8],
- ["BEB7",0x75C9],
- ["C8AC",0x75CA],
- ["AF5C",0x75CB],
- ["AF5D",0x75CC],
- ["F0EA",0x75CD],
- ["AF5E",0x75CE],
- ["AF5F",0x75CF],
- ["AF60",0x75D0],
- ["AF61",0x75D1],
- ["D1F7",0x75D2],
- ["AF62",0x75D3],
- ["D6CC",0x75D4],
- ["BADB",0x75D5],
- ["F0E9",0x75D6],
- ["AF63",0x75D7],
- ["B6BB",0x75D8],
- ["AF64",0x75D9],
- ["AF65",0x75DA],
- ["CDB4",0x75DB],
- ["AF66",0x75DC],
- ["AF67",0x75DD],
- ["C6A6",0x75DE],
- ["AF68",0x75DF],
- ["AF69",0x75E0],
- ["AF6A",0x75E1],
- ["C1A1",0x75E2],
- ["F0EB",0x75E3],
- ["F0EE",0x75E4],
- ["AF6B",0x75E5],
- ["F0ED",0x75E6],
- ["F0F0",0x75E7],
- ["F0EC",0x75E8],
- ["AF6C",0x75E9],
- ["BBBE",0x75EA],
- ["F0EF",0x75EB],
- ["AF6D",0x75EC],
- ["AF6E",0x75ED],
- ["AF6F",0x75EE],
- ["AF70",0x75EF],
- ["CCB5",0x75F0],
- ["F0F2",0x75F1],
- ["AF71",0x75F2],
- ["AF72",0x75F3],
- ["B3D5",0x75F4],
- ["AF73",0x75F5],
- ["AF74",0x75F6],
- ["AF75",0x75F7],
- ["AF76",0x75F8],
- ["B1D4",0x75F9],
- ["AF77",0x75FA],
- ["AF78",0x75FB],
- ["F0F3",0x75FC],
- ["AF79",0x75FD],
- ["AF7A",0x75FE],
- ["F0F4",0x75FF],
- ["F0F6",0x7600],
- ["B4E1",0x7601],
- ["AF7B",0x7602],
- ["F0F1",0x7603],
- ["AF7C",0x7604],
- ["F0F7",0x7605],
- ["AF7D",0x7606],
- ["AF7E",0x7607],
- ["AF80",0x7608],
- ["AF81",0x7609],
- ["F0FA",0x760A],
- ["AF82",0x760B],
- ["F0F8",0x760C],
- ["AF83",0x760D],
- ["AF84",0x760E],
- ["AF85",0x760F],
- ["F0F5",0x7610],
- ["AF86",0x7611],
- ["AF87",0x7612],
- ["AF88",0x7613],
- ["AF89",0x7614],
- ["F0FD",0x7615],
- ["AF8A",0x7616],
- ["F0F9",0x7617],
- ["F0FC",0x7618],
- ["F0FE",0x7619],
- ["AF8B",0x761A],
- ["F1A1",0x761B],
- ["AF8C",0x761C],
- ["AF8D",0x761D],
- ["AF8E",0x761E],
- ["CEC1",0x761F],
- ["F1A4",0x7620],
- ["AF8F",0x7621],
- ["F1A3",0x7622],
- ["AF90",0x7623],
- ["C1F6",0x7624],
- ["F0FB",0x7625],
- ["CADD",0x7626],
- ["AF91",0x7627],
- ["AF92",0x7628],
- ["B4F1",0x7629],
- ["B1F1",0x762A],
- ["CCB1",0x762B],
- ["AF93",0x762C],
- ["F1A6",0x762D],
- ["AF94",0x762E],
- ["AF95",0x762F],
- ["F1A7",0x7630],
- ["AF96",0x7631],
- ["AF97",0x7632],
- ["F1AC",0x7633],
- ["D5CE",0x7634],
- ["F1A9",0x7635],
- ["AF98",0x7636],
- ["AF99",0x7637],
- ["C8B3",0x7638],
- ["AF9A",0x7639],
- ["AF9B",0x763A],
- ["AF9C",0x763B],
- ["F1A2",0x763C],
- ["AF9D",0x763D],
- ["F1AB",0x763E],
- ["F1A8",0x763F],
- ["F1A5",0x7640],
- ["AF9E",0x7641],
- ["AF9F",0x7642],
- ["F1AA",0x7643],
- ["AFA0",0x7644],
- ["B040",0x7645],
- ["B041",0x7646],
- ["B042",0x7647],
- ["B043",0x7648],
- ["B044",0x7649],
- ["B045",0x764A],
- ["B046",0x764B],
- ["B0A9",0x764C],
- ["F1AD",0x764D],
- ["B047",0x764E],
- ["B048",0x764F],
- ["B049",0x7650],
- ["B04A",0x7651],
- ["B04B",0x7652],
- ["B04C",0x7653],
- ["F1AF",0x7654],
- ["B04D",0x7655],
- ["F1B1",0x7656],
- ["B04E",0x7657],
- ["B04F",0x7658],
- ["B050",0x7659],
- ["B051",0x765A],
- ["B052",0x765B],
- ["F1B0",0x765C],
- ["B053",0x765D],
- ["F1AE",0x765E],
- ["B054",0x765F],
- ["B055",0x7660],
- ["B056",0x7661],
- ["B057",0x7662],
- ["D1A2",0x7663],
- ["B058",0x7664],
- ["B059",0x7665],
- ["B05A",0x7666],
- ["B05B",0x7667],
- ["B05C",0x7668],
- ["B05D",0x7669],
- ["B05E",0x766A],
- ["F1B2",0x766B],
- ["B05F",0x766C],
- ["B060",0x766D],
- ["B061",0x766E],
- ["F1B3",0x766F],
- ["B062",0x7670],
- ["B063",0x7671],
- ["B064",0x7672],
- ["B065",0x7673],
- ["B066",0x7674],
- ["B067",0x7675],
- ["B068",0x7676],
- ["B069",0x7677],
- ["B9EF",0x7678],
- ["B06A",0x7679],
- ["B06B",0x767A],
- ["B5C7",0x767B],
- ["B06C",0x767C],
- ["B0D7",0x767D],
- ["B0D9",0x767E],
- ["B06D",0x767F],
- ["B06E",0x7680],
- ["B06F",0x7681],
- ["D4ED",0x7682],
- ["B070",0x7683],
- ["B5C4",0x7684],
- ["B071",0x7685],
- ["BDD4",0x7686],
- ["BBCA",0x7687],
- ["F0A7",0x7688],
- ["B072",0x7689],
- ["B073",0x768A],
- ["B8DE",0x768B],
- ["B074",0x768C],
- ["B075",0x768D],
- ["F0A8",0x768E],
- ["B076",0x768F],
- ["B077",0x7690],
- ["B0A8",0x7691],
- ["B078",0x7692],
- ["F0A9",0x7693],
- ["B079",0x7694],
- ["B07A",0x7695],
- ["CDEE",0x7696],
- ["B07B",0x7697],
- ["B07C",0x7698],
- ["F0AA",0x7699],
- ["B07D",0x769A],
- ["B07E",0x769B],
- ["B080",0x769C],
- ["B081",0x769D],
- ["B082",0x769E],
- ["B083",0x769F],
- ["B084",0x76A0],
- ["B085",0x76A1],
- ["B086",0x76A2],
- ["B087",0x76A3],
- ["F0AB",0x76A4],
- ["B088",0x76A5],
- ["B089",0x76A6],
- ["B08A",0x76A7],
- ["B08B",0x76A8],
- ["B08C",0x76A9],
- ["B08D",0x76AA],
- ["B08E",0x76AB],
- ["B08F",0x76AC],
- ["B090",0x76AD],
- ["C6A4",0x76AE],
- ["B091",0x76AF],
- ["B092",0x76B0],
- ["D6E5",0x76B1],
- ["F1E4",0x76B2],
- ["B093",0x76B3],
- ["F1E5",0x76B4],
- ["B094",0x76B5],
- ["B095",0x76B6],
- ["B096",0x76B7],
- ["B097",0x76B8],
- ["B098",0x76B9],
- ["B099",0x76BA],
- ["B09A",0x76BB],
- ["B09B",0x76BC],
- ["B09C",0x76BD],
- ["B09D",0x76BE],
- ["C3F3",0x76BF],
- ["B09E",0x76C0],
- ["B09F",0x76C1],
- ["D3DB",0x76C2],
- ["B0A0",0x76C3],
- ["B140",0x76C4],
- ["D6D1",0x76C5],
- ["C5E8",0x76C6],
- ["B141",0x76C7],
- ["D3AF",0x76C8],
- ["B142",0x76C9],
- ["D2E6",0x76CA],
- ["B143",0x76CB],
- ["B144",0x76CC],
- ["EEC1",0x76CD],
- ["B0BB",0x76CE],
- ["D5B5",0x76CF],
- ["D1CE",0x76D0],
- ["BCE0",0x76D1],
- ["BAD0",0x76D2],
- ["B145",0x76D3],
- ["BFF8",0x76D4],
- ["B146",0x76D5],
- ["B8C7",0x76D6],
- ["B5C1",0x76D7],
- ["C5CC",0x76D8],
- ["B147",0x76D9],
- ["B148",0x76DA],
- ["CAA2",0x76DB],
- ["B149",0x76DC],
- ["B14A",0x76DD],
- ["B14B",0x76DE],
- ["C3CB",0x76DF],
- ["B14C",0x76E0],
- ["B14D",0x76E1],
- ["B14E",0x76E2],
- ["B14F",0x76E3],
- ["B150",0x76E4],
- ["EEC2",0x76E5],
- ["B151",0x76E6],
- ["B152",0x76E7],
- ["B153",0x76E8],
- ["B154",0x76E9],
- ["B155",0x76EA],
- ["B156",0x76EB],
- ["B157",0x76EC],
- ["B158",0x76ED],
- ["C4BF",0x76EE],
- ["B6A2",0x76EF],
- ["B159",0x76F0],
- ["EDEC",0x76F1],
- ["C3A4",0x76F2],
- ["B15A",0x76F3],
- ["D6B1",0x76F4],
- ["B15B",0x76F5],
- ["B15C",0x76F6],
- ["B15D",0x76F7],
- ["CFE0",0x76F8],
- ["EDEF",0x76F9],
- ["B15E",0x76FA],
- ["B15F",0x76FB],
- ["C5CE",0x76FC],
- ["B160",0x76FD],
- ["B6DC",0x76FE],
- ["B161",0x76FF],
- ["B162",0x7700],
- ["CAA1",0x7701],
- ["B163",0x7702],
- ["B164",0x7703],
- ["EDED",0x7704],
- ["B165",0x7705],
- ["B166",0x7706],
- ["EDF0",0x7707],
- ["EDF1",0x7708],
- ["C3BC",0x7709],
- ["B167",0x770A],
- ["BFB4",0x770B],
- ["B168",0x770C],
- ["EDEE",0x770D],
- ["B169",0x770E],
- ["B16A",0x770F],
- ["B16B",0x7710],
- ["B16C",0x7711],
- ["B16D",0x7712],
- ["B16E",0x7713],
- ["B16F",0x7714],
- ["B170",0x7715],
- ["B171",0x7716],
- ["B172",0x7717],
- ["B173",0x7718],
- ["EDF4",0x7719],
- ["EDF2",0x771A],
- ["B174",0x771B],
- ["B175",0x771C],
- ["B176",0x771D],
- ["B177",0x771E],
- ["D5E6",0x771F],
- ["C3DF",0x7720],
- ["B178",0x7721],
- ["EDF3",0x7722],
- ["B179",0x7723],
- ["B17A",0x7724],
- ["B17B",0x7725],
- ["EDF6",0x7726],
- ["B17C",0x7727],
- ["D5A3",0x7728],
- ["D1A3",0x7729],
- ["B17D",0x772A],
- ["B17E",0x772B],
- ["B180",0x772C],
- ["EDF5",0x772D],
- ["B181",0x772E],
- ["C3D0",0x772F],
- ["B182",0x7730],
- ["B183",0x7731],
- ["B184",0x7732],
- ["B185",0x7733],
- ["B186",0x7734],
- ["EDF7",0x7735],
- ["BFF4",0x7736],
- ["BEEC",0x7737],
- ["EDF8",0x7738],
- ["B187",0x7739],
- ["CCF7",0x773A],
- ["B188",0x773B],
- ["D1DB",0x773C],
- ["B189",0x773D],
- ["B18A",0x773E],
- ["B18B",0x773F],
- ["D7C5",0x7740],
- ["D5F6",0x7741],
- ["B18C",0x7742],
- ["EDFC",0x7743],
- ["B18D",0x7744],
- ["B18E",0x7745],
- ["B18F",0x7746],
- ["EDFB",0x7747],
- ["B190",0x7748],
- ["B191",0x7749],
- ["B192",0x774A],
- ["B193",0x774B],
- ["B194",0x774C],
- ["B195",0x774D],
- ["B196",0x774E],
- ["B197",0x774F],
- ["EDF9",0x7750],
- ["EDFA",0x7751],
- ["B198",0x7752],
- ["B199",0x7753],
- ["B19A",0x7754],
- ["B19B",0x7755],
- ["B19C",0x7756],
- ["B19D",0x7757],
- ["B19E",0x7758],
- ["B19F",0x7759],
- ["EDFD",0x775A],
- ["BEA6",0x775B],
- ["B1A0",0x775C],
- ["B240",0x775D],
- ["B241",0x775E],
- ["B242",0x775F],
- ["B243",0x7760],
- ["CBAF",0x7761],
- ["EEA1",0x7762],
- ["B6BD",0x7763],
- ["B244",0x7764],
- ["EEA2",0x7765],
- ["C4C0",0x7766],
- ["B245",0x7767],
- ["EDFE",0x7768],
- ["B246",0x7769],
- ["B247",0x776A],
- ["BDDE",0x776B],
- ["B2C7",0x776C],
- ["B248",0x776D],
- ["B249",0x776E],
- ["B24A",0x776F],
- ["B24B",0x7770],
- ["B24C",0x7771],
- ["B24D",0x7772],
- ["B24E",0x7773],
- ["B24F",0x7774],
- ["B250",0x7775],
- ["B251",0x7776],
- ["B252",0x7777],
- ["B253",0x7778],
- ["B6C3",0x7779],
- ["B254",0x777A],
- ["B255",0x777B],
- ["B256",0x777C],
- ["EEA5",0x777D],
- ["D8BA",0x777E],
- ["EEA3",0x777F],
- ["EEA6",0x7780],
- ["B257",0x7781],
- ["B258",0x7782],
- ["B259",0x7783],
- ["C3E9",0x7784],
- ["B3F2",0x7785],
- ["B25A",0x7786],
- ["B25B",0x7787],
- ["B25C",0x7788],
- ["B25D",0x7789],
- ["B25E",0x778A],
- ["B25F",0x778B],
- ["EEA7",0x778C],
- ["EEA4",0x778D],
- ["CFB9",0x778E],
- ["B260",0x778F],
- ["B261",0x7790],
- ["EEA8",0x7791],
- ["C2F7",0x7792],
- ["B262",0x7793],
- ["B263",0x7794],
- ["B264",0x7795],
- ["B265",0x7796],
- ["B266",0x7797],
- ["B267",0x7798],
- ["B268",0x7799],
- ["B269",0x779A],
- ["B26A",0x779B],
- ["B26B",0x779C],
- ["B26C",0x779D],
- ["B26D",0x779E],
- ["EEA9",0x779F],
- ["EEAA",0x77A0],
- ["B26E",0x77A1],
- ["DEAB",0x77A2],
- ["B26F",0x77A3],
- ["B270",0x77A4],
- ["C6B3",0x77A5],
- ["B271",0x77A6],
- ["C7C6",0x77A7],
- ["B272",0x77A8],
- ["D6F5",0x77A9],
- ["B5C9",0x77AA],
- ["B273",0x77AB],
- ["CBB2",0x77AC],
- ["B274",0x77AD],
- ["B275",0x77AE],
- ["B276",0x77AF],
- ["EEAB",0x77B0],
- ["B277",0x77B1],
- ["B278",0x77B2],
- ["CDAB",0x77B3],
- ["B279",0x77B4],
- ["EEAC",0x77B5],
- ["B27A",0x77B6],
- ["B27B",0x77B7],
- ["B27C",0x77B8],
- ["B27D",0x77B9],
- ["B27E",0x77BA],
- ["D5B0",0x77BB],
- ["B280",0x77BC],
- ["EEAD",0x77BD],
- ["B281",0x77BE],
- ["F6C4",0x77BF],
- ["B282",0x77C0],
- ["B283",0x77C1],
- ["B284",0x77C2],
- ["B285",0x77C3],
- ["B286",0x77C4],
- ["B287",0x77C5],
- ["B288",0x77C6],
- ["B289",0x77C7],
- ["B28A",0x77C8],
- ["B28B",0x77C9],
- ["B28C",0x77CA],
- ["B28D",0x77CB],
- ["B28E",0x77CC],
- ["DBC7",0x77CD],
- ["B28F",0x77CE],
- ["B290",0x77CF],
- ["B291",0x77D0],
- ["B292",0x77D1],
- ["B293",0x77D2],
- ["B294",0x77D3],
- ["B295",0x77D4],
- ["B296",0x77D5],
- ["B297",0x77D6],
- ["B4A3",0x77D7],
- ["B298",0x77D8],
- ["B299",0x77D9],
- ["B29A",0x77DA],
- ["C3AC",0x77DB],
- ["F1E6",0x77DC],
- ["B29B",0x77DD],
- ["B29C",0x77DE],
- ["B29D",0x77DF],
- ["B29E",0x77E0],
- ["B29F",0x77E1],
- ["CAB8",0x77E2],
- ["D2D3",0x77E3],
- ["B2A0",0x77E4],
- ["D6AA",0x77E5],
- ["B340",0x77E6],
- ["EFF2",0x77E7],
- ["B341",0x77E8],
- ["BED8",0x77E9],
- ["B342",0x77EA],
- ["BDC3",0x77EB],
- ["EFF3",0x77EC],
- ["B6CC",0x77ED],
- ["B0AB",0x77EE],
- ["B343",0x77EF],
- ["B344",0x77F0],
- ["B345",0x77F1],
- ["B346",0x77F2],
- ["CAAF",0x77F3],
- ["B347",0x77F4],
- ["B348",0x77F5],
- ["EDB6",0x77F6],
- ["B349",0x77F7],
- ["EDB7",0x77F8],
- ["B34A",0x77F9],
- ["B34B",0x77FA],
- ["B34C",0x77FB],
- ["B34D",0x77FC],
- ["CEF9",0x77FD],
- ["B7AF",0x77FE],
- ["BFF3",0x77FF],
- ["EDB8",0x7800],
- ["C2EB",0x7801],
- ["C9B0",0x7802],
- ["B34E",0x7803],
- ["B34F",0x7804],
- ["B350",0x7805],
- ["B351",0x7806],
- ["B352",0x7807],
- ["B353",0x7808],
- ["EDB9",0x7809],
- ["B354",0x780A],
- ["B355",0x780B],
- ["C6F6",0x780C],
- ["BFB3",0x780D],
- ["B356",0x780E],
- ["B357",0x780F],
- ["B358",0x7810],
- ["EDBC",0x7811],
- ["C5F8",0x7812],
- ["B359",0x7813],
- ["D1D0",0x7814],
- ["B35A",0x7815],
- ["D7A9",0x7816],
- ["EDBA",0x7817],
- ["EDBB",0x7818],
- ["B35B",0x7819],
- ["D1E2",0x781A],
- ["B35C",0x781B],
- ["EDBF",0x781C],
- ["EDC0",0x781D],
- ["B35D",0x781E],
- ["EDC4",0x781F],
- ["B35E",0x7820],
- ["B35F",0x7821],
- ["B360",0x7822],
- ["EDC8",0x7823],
- ["B361",0x7824],
- ["EDC6",0x7825],
- ["EDCE",0x7826],
- ["D5E8",0x7827],
- ["B362",0x7828],
- ["EDC9",0x7829],
- ["B363",0x782A],
- ["B364",0x782B],
- ["EDC7",0x782C],
- ["EDBE",0x782D],
- ["B365",0x782E],
- ["B366",0x782F],
- ["C5E9",0x7830],
- ["B367",0x7831],
- ["B368",0x7832],
- ["B369",0x7833],
- ["C6C6",0x7834],
- ["B36A",0x7835],
- ["B36B",0x7836],
- ["C9E9",0x7837],
- ["D4D2",0x7838],
- ["EDC1",0x7839],
- ["EDC2",0x783A],
- ["EDC3",0x783B],
- ["EDC5",0x783C],
- ["B36C",0x783D],
- ["C0F9",0x783E],
- ["B36D",0x783F],
- ["B4A1",0x7840],
- ["B36E",0x7841],
- ["B36F",0x7842],
- ["B370",0x7843],
- ["B371",0x7844],
- ["B9E8",0x7845],
- ["B372",0x7846],
- ["EDD0",0x7847],
- ["B373",0x7848],
- ["B374",0x7849],
- ["B375",0x784A],
- ["B376",0x784B],
- ["EDD1",0x784C],
- ["B377",0x784D],
- ["EDCA",0x784E],
- ["B378",0x784F],
- ["EDCF",0x7850],
- ["B379",0x7851],
- ["CEF8",0x7852],
- ["B37A",0x7853],
- ["B37B",0x7854],
- ["CBB6",0x7855],
- ["EDCC",0x7856],
- ["EDCD",0x7857],
- ["B37C",0x7858],
- ["B37D",0x7859],
- ["B37E",0x785A],
- ["B380",0x785B],
- ["B381",0x785C],
- ["CFF5",0x785D],
- ["B382",0x785E],
- ["B383",0x785F],
- ["B384",0x7860],
- ["B385",0x7861],
- ["B386",0x7862],
- ["B387",0x7863],
- ["B388",0x7864],
- ["B389",0x7865],
- ["B38A",0x7866],
- ["B38B",0x7867],
- ["B38C",0x7868],
- ["B38D",0x7869],
- ["EDD2",0x786A],
- ["C1F2",0x786B],
- ["D3B2",0x786C],
- ["EDCB",0x786D],
- ["C8B7",0x786E],
- ["B38E",0x786F],
- ["B38F",0x7870],
- ["B390",0x7871],
- ["B391",0x7872],
- ["B392",0x7873],
- ["B393",0x7874],
- ["B394",0x7875],
- ["B395",0x7876],
- ["BCEF",0x7877],
- ["B396",0x7878],
- ["B397",0x7879],
- ["B398",0x787A],
- ["B399",0x787B],
- ["C5F0",0x787C],
- ["B39A",0x787D],
- ["B39B",0x787E],
- ["B39C",0x787F],
- ["B39D",0x7880],
- ["B39E",0x7881],
- ["B39F",0x7882],
- ["B3A0",0x7883],
- ["B440",0x7884],
- ["B441",0x7885],
- ["B442",0x7886],
- ["EDD6",0x7887],
- ["B443",0x7888],
- ["B5EF",0x7889],
- ["B444",0x788A],
- ["B445",0x788B],
- ["C2B5",0x788C],
- ["B0AD",0x788D],
- ["CBE9",0x788E],
- ["B446",0x788F],
- ["B447",0x7890],
- ["B1AE",0x7891],
- ["B448",0x7892],
- ["EDD4",0x7893],
- ["B449",0x7894],
- ["B44A",0x7895],
- ["B44B",0x7896],
- ["CDEB",0x7897],
- ["B5E2",0x7898],
- ["B44C",0x7899],
- ["EDD5",0x789A],
- ["EDD3",0x789B],
- ["EDD7",0x789C],
- ["B44D",0x789D],
- ["B44E",0x789E],
- ["B5FA",0x789F],
- ["B44F",0x78A0],
- ["EDD8",0x78A1],
- ["B450",0x78A2],
- ["EDD9",0x78A3],
- ["B451",0x78A4],
- ["EDDC",0x78A5],
- ["B452",0x78A6],
- ["B1CC",0x78A7],
- ["B453",0x78A8],
- ["B454",0x78A9],
- ["B455",0x78AA],
- ["B456",0x78AB],
- ["B457",0x78AC],
- ["B458",0x78AD],
- ["B459",0x78AE],
- ["B45A",0x78AF],
- ["C5F6",0x78B0],
- ["BCEE",0x78B1],
- ["EDDA",0x78B2],
- ["CCBC",0x78B3],
- ["B2EA",0x78B4],
- ["B45B",0x78B5],
- ["B45C",0x78B6],
- ["B45D",0x78B7],
- ["B45E",0x78B8],
- ["EDDB",0x78B9],
- ["B45F",0x78BA],
- ["B460",0x78BB],
- ["B461",0x78BC],
- ["B462",0x78BD],
- ["C4EB",0x78BE],
- ["B463",0x78BF],
- ["B464",0x78C0],
- ["B4C5",0x78C1],
- ["B465",0x78C2],
- ["B466",0x78C3],
- ["B467",0x78C4],
- ["B0F5",0x78C5],
- ["B468",0x78C6],
- ["B469",0x78C7],
- ["B46A",0x78C8],
- ["EDDF",0x78C9],
- ["C0DA",0x78CA],
- ["B4E8",0x78CB],
- ["B46B",0x78CC],
- ["B46C",0x78CD],
- ["B46D",0x78CE],
- ["B46E",0x78CF],
- ["C5CD",0x78D0],
- ["B46F",0x78D1],
- ["B470",0x78D2],
- ["B471",0x78D3],
- ["EDDD",0x78D4],
- ["BFC4",0x78D5],
- ["B472",0x78D6],
- ["B473",0x78D7],
- ["B474",0x78D8],
- ["EDDE",0x78D9],
- ["B475",0x78DA],
- ["B476",0x78DB],
- ["B477",0x78DC],
- ["B478",0x78DD],
- ["B479",0x78DE],
- ["B47A",0x78DF],
- ["B47B",0x78E0],
- ["B47C",0x78E1],
- ["B47D",0x78E2],
- ["B47E",0x78E3],
- ["B480",0x78E4],
- ["B481",0x78E5],
- ["B482",0x78E6],
- ["B483",0x78E7],
- ["C4A5",0x78E8],
- ["B484",0x78E9],
- ["B485",0x78EA],
- ["B486",0x78EB],
- ["EDE0",0x78EC],
- ["B487",0x78ED],
- ["B488",0x78EE],
- ["B489",0x78EF],
- ["B48A",0x78F0],
- ["B48B",0x78F1],
- ["EDE1",0x78F2],
- ["B48C",0x78F3],
- ["EDE3",0x78F4],
- ["B48D",0x78F5],
- ["B48E",0x78F6],
- ["C1D7",0x78F7],
- ["B48F",0x78F8],
- ["B490",0x78F9],
- ["BBC7",0x78FA],
- ["B491",0x78FB],
- ["B492",0x78FC],
- ["B493",0x78FD],
- ["B494",0x78FE],
- ["B495",0x78FF],
- ["B496",0x7900],
- ["BDB8",0x7901],
- ["B497",0x7902],
- ["B498",0x7903],
- ["B499",0x7904],
- ["EDE2",0x7905],
- ["B49A",0x7906],
- ["B49B",0x7907],
- ["B49C",0x7908],
- ["B49D",0x7909],
- ["B49E",0x790A],
- ["B49F",0x790B],
- ["B4A0",0x790C],
- ["B540",0x790D],
- ["B541",0x790E],
- ["B542",0x790F],
- ["B543",0x7910],
- ["B544",0x7911],
- ["B545",0x7912],
- ["EDE4",0x7913],
- ["B546",0x7914],
- ["B547",0x7915],
- ["B548",0x7916],
- ["B549",0x7917],
- ["B54A",0x7918],
- ["B54B",0x7919],
- ["B54C",0x791A],
- ["B54D",0x791B],
- ["B54E",0x791C],
- ["B54F",0x791D],
- ["EDE6",0x791E],
- ["B550",0x791F],
- ["B551",0x7920],
- ["B552",0x7921],
- ["B553",0x7922],
- ["B554",0x7923],
- ["EDE5",0x7924],
- ["B555",0x7925],
- ["B556",0x7926],
- ["B557",0x7927],
- ["B558",0x7928],
- ["B559",0x7929],
- ["B55A",0x792A],
- ["B55B",0x792B],
- ["B55C",0x792C],
- ["B55D",0x792D],
- ["B55E",0x792E],
- ["B55F",0x792F],
- ["B560",0x7930],
- ["B561",0x7931],
- ["B562",0x7932],
- ["B563",0x7933],
- ["EDE7",0x7934],
- ["B564",0x7935],
- ["B565",0x7936],
- ["B566",0x7937],
- ["B567",0x7938],
- ["B568",0x7939],
- ["CABE",0x793A],
- ["ECEA",0x793B],
- ["C0F1",0x793C],
- ["B569",0x793D],
- ["C9E7",0x793E],
- ["B56A",0x793F],
- ["ECEB",0x7940],
- ["C6EE",0x7941],
- ["B56B",0x7942],
- ["B56C",0x7943],
- ["B56D",0x7944],
- ["B56E",0x7945],
- ["ECEC",0x7946],
- ["B56F",0x7947],
- ["C6ED",0x7948],
- ["ECED",0x7949],
- ["B570",0x794A],
- ["B571",0x794B],
- ["B572",0x794C],
- ["B573",0x794D],
- ["B574",0x794E],
- ["B575",0x794F],
- ["B576",0x7950],
- ["B577",0x7951],
- ["B578",0x7952],
- ["ECF0",0x7953],
- ["B579",0x7954],
- ["B57A",0x7955],
- ["D7E6",0x7956],
- ["ECF3",0x7957],
- ["B57B",0x7958],
- ["B57C",0x7959],
- ["ECF1",0x795A],
- ["ECEE",0x795B],
- ["ECEF",0x795C],
- ["D7A3",0x795D],
- ["C9F1",0x795E],
- ["CBEE",0x795F],
- ["ECF4",0x7960],
- ["B57D",0x7961],
- ["ECF2",0x7962],
- ["B57E",0x7963],
- ["B580",0x7964],
- ["CFE9",0x7965],
- ["B581",0x7966],
- ["ECF6",0x7967],
- ["C6B1",0x7968],
- ["B582",0x7969],
- ["B583",0x796A],
- ["B584",0x796B],
- ["B585",0x796C],
- ["BCC0",0x796D],
- ["B586",0x796E],
- ["ECF5",0x796F],
- ["B587",0x7970],
- ["B588",0x7971],
- ["B589",0x7972],
- ["B58A",0x7973],
- ["B58B",0x7974],
- ["B58C",0x7975],
- ["B58D",0x7976],
- ["B5BB",0x7977],
- ["BBF6",0x7978],
- ["B58E",0x7979],
- ["ECF7",0x797A],
- ["B58F",0x797B],
- ["B590",0x797C],
- ["B591",0x797D],
- ["B592",0x797E],
- ["B593",0x797F],
- ["D9F7",0x7980],
- ["BDFB",0x7981],
- ["B594",0x7982],
- ["B595",0x7983],
- ["C2BB",0x7984],
- ["ECF8",0x7985],
- ["B596",0x7986],
- ["B597",0x7987],
- ["B598",0x7988],
- ["B599",0x7989],
- ["ECF9",0x798A],
- ["B59A",0x798B],
- ["B59B",0x798C],
- ["B59C",0x798D],
- ["B59D",0x798E],
- ["B8A3",0x798F],
- ["B59E",0x7990],
- ["B59F",0x7991],
- ["B5A0",0x7992],
- ["B640",0x7993],
- ["B641",0x7994],
- ["B642",0x7995],
- ["B643",0x7996],
- ["B644",0x7997],
- ["B645",0x7998],
- ["B646",0x7999],
- ["ECFA",0x799A],
- ["B647",0x799B],
- ["B648",0x799C],
- ["B649",0x799D],
- ["B64A",0x799E],
- ["B64B",0x799F],
- ["B64C",0x79A0],
- ["B64D",0x79A1],
- ["B64E",0x79A2],
- ["B64F",0x79A3],
- ["B650",0x79A4],
- ["B651",0x79A5],
- ["B652",0x79A6],
- ["ECFB",0x79A7],
- ["B653",0x79A8],
- ["B654",0x79A9],
- ["B655",0x79AA],
- ["B656",0x79AB],
- ["B657",0x79AC],
- ["B658",0x79AD],
- ["B659",0x79AE],
- ["B65A",0x79AF],
- ["B65B",0x79B0],
- ["B65C",0x79B1],
- ["B65D",0x79B2],
- ["ECFC",0x79B3],
- ["B65E",0x79B4],
- ["B65F",0x79B5],
- ["B660",0x79B6],
- ["B661",0x79B7],
- ["B662",0x79B8],
- ["D3ED",0x79B9],
- ["D8AE",0x79BA],
- ["C0EB",0x79BB],
- ["B663",0x79BC],
- ["C7DD",0x79BD],
- ["BACC",0x79BE],
- ["B664",0x79BF],
- ["D0E3",0x79C0],
- ["CBBD",0x79C1],
- ["B665",0x79C2],
- ["CDBA",0x79C3],
- ["B666",0x79C4],
- ["B667",0x79C5],
- ["B8D1",0x79C6],
- ["B668",0x79C7],
- ["B669",0x79C8],
- ["B1FC",0x79C9],
- ["B66A",0x79CA],
- ["C7EF",0x79CB],
- ["B66B",0x79CC],
- ["D6D6",0x79CD],
- ["B66C",0x79CE],
- ["B66D",0x79CF],
- ["B66E",0x79D0],
- ["BFC6",0x79D1],
- ["C3EB",0x79D2],
- ["B66F",0x79D3],
- ["B670",0x79D4],
- ["EFF5",0x79D5],
- ["B671",0x79D6],
- ["B672",0x79D7],
- ["C3D8",0x79D8],
- ["B673",0x79D9],
- ["B674",0x79DA],
- ["B675",0x79DB],
- ["B676",0x79DC],
- ["B677",0x79DD],
- ["B678",0x79DE],
- ["D7E2",0x79DF],
- ["B679",0x79E0],
- ["B67A",0x79E1],
- ["B67B",0x79E2],
- ["EFF7",0x79E3],
- ["B3D3",0x79E4],
- ["B67C",0x79E5],
- ["C7D8",0x79E6],
- ["D1ED",0x79E7],
- ["B67D",0x79E8],
- ["D6C8",0x79E9],
- ["B67E",0x79EA],
- ["EFF8",0x79EB],
- ["B680",0x79EC],
- ["EFF6",0x79ED],
- ["B681",0x79EE],
- ["BBFD",0x79EF],
- ["B3C6",0x79F0],
- ["B682",0x79F1],
- ["B683",0x79F2],
- ["B684",0x79F3],
- ["B685",0x79F4],
- ["B686",0x79F5],
- ["B687",0x79F6],
- ["B688",0x79F7],
- ["BDD5",0x79F8],
- ["B689",0x79F9],
- ["B68A",0x79FA],
- ["D2C6",0x79FB],
- ["B68B",0x79FC],
- ["BBE0",0x79FD],
- ["B68C",0x79FE],
- ["B68D",0x79FF],
- ["CFA1",0x7A00],
- ["B68E",0x7A01],
- ["EFFC",0x7A02],
- ["EFFB",0x7A03],
- ["B68F",0x7A04],
- ["B690",0x7A05],
- ["EFF9",0x7A06],
- ["B691",0x7A07],
- ["B692",0x7A08],
- ["B693",0x7A09],
- ["B694",0x7A0A],
- ["B3CC",0x7A0B],
- ["B695",0x7A0C],
- ["C9D4",0x7A0D],
- ["CBB0",0x7A0E],
- ["B696",0x7A0F],
- ["B697",0x7A10],
- ["B698",0x7A11],
- ["B699",0x7A12],
- ["B69A",0x7A13],
- ["EFFE",0x7A14],
- ["B69B",0x7A15],
- ["B69C",0x7A16],
- ["B0DE",0x7A17],
- ["B69D",0x7A18],
- ["B69E",0x7A19],
- ["D6C9",0x7A1A],
- ["B69F",0x7A1B],
- ["B6A0",0x7A1C],
- ["B740",0x7A1D],
- ["EFFD",0x7A1E],
- ["B741",0x7A1F],
- ["B3ED",0x7A20],
- ["B742",0x7A21],
- ["B743",0x7A22],
- ["F6D5",0x7A23],
- ["B744",0x7A24],
- ["B745",0x7A25],
- ["B746",0x7A26],
- ["B747",0x7A27],
- ["B748",0x7A28],
- ["B749",0x7A29],
- ["B74A",0x7A2A],
- ["B74B",0x7A2B],
- ["B74C",0x7A2C],
- ["B74D",0x7A2D],
- ["B74E",0x7A2E],
- ["B74F",0x7A2F],
- ["B750",0x7A30],
- ["B751",0x7A31],
- ["B752",0x7A32],
- ["CEC8",0x7A33],
- ["B753",0x7A34],
- ["B754",0x7A35],
- ["B755",0x7A36],
- ["F0A2",0x7A37],
- ["B756",0x7A38],
- ["F0A1",0x7A39],
- ["B757",0x7A3A],
- ["B5BE",0x7A3B],
- ["BCDA",0x7A3C],
- ["BBFC",0x7A3D],
- ["B758",0x7A3E],
- ["B8E5",0x7A3F],
- ["B759",0x7A40],
- ["B75A",0x7A41],
- ["B75B",0x7A42],
- ["B75C",0x7A43],
- ["B75D",0x7A44],
- ["B75E",0x7A45],
- ["C4C2",0x7A46],
- ["B75F",0x7A47],
- ["B760",0x7A48],
- ["B761",0x7A49],
- ["B762",0x7A4A],
- ["B763",0x7A4B],
- ["B764",0x7A4C],
- ["B765",0x7A4D],
- ["B766",0x7A4E],
- ["B767",0x7A4F],
- ["B768",0x7A50],
- ["F0A3",0x7A51],
- ["B769",0x7A52],
- ["B76A",0x7A53],
- ["B76B",0x7A54],
- ["B76C",0x7A55],
- ["B76D",0x7A56],
- ["CBEB",0x7A57],
- ["B76E",0x7A58],
- ["B76F",0x7A59],
- ["B770",0x7A5A],
- ["B771",0x7A5B],
- ["B772",0x7A5C],
- ["B773",0x7A5D],
- ["B774",0x7A5E],
- ["B775",0x7A5F],
- ["B776",0x7A60],
- ["B777",0x7A61],
- ["B778",0x7A62],
- ["B779",0x7A63],
- ["B77A",0x7A64],
- ["B77B",0x7A65],
- ["B77C",0x7A66],
- ["B77D",0x7A67],
- ["B77E",0x7A68],
- ["B780",0x7A69],
- ["B781",0x7A6A],
- ["B782",0x7A6B],
- ["B783",0x7A6C],
- ["B784",0x7A6D],
- ["B785",0x7A6E],
- ["B786",0x7A6F],
- ["F0A6",0x7A70],
- ["B787",0x7A71],
- ["B788",0x7A72],
- ["B789",0x7A73],
- ["D1A8",0x7A74],
- ["B78A",0x7A75],
- ["BEBF",0x7A76],
- ["C7EE",0x7A77],
- ["F1B6",0x7A78],
- ["F1B7",0x7A79],
- ["BFD5",0x7A7A],
- ["B78B",0x7A7B],
- ["B78C",0x7A7C],
- ["B78D",0x7A7D],
- ["B78E",0x7A7E],
- ["B4A9",0x7A7F],
- ["F1B8",0x7A80],
- ["CDBB",0x7A81],
- ["B78F",0x7A82],
- ["C7D4",0x7A83],
- ["D5AD",0x7A84],
- ["B790",0x7A85],
- ["F1B9",0x7A86],
- ["B791",0x7A87],
- ["F1BA",0x7A88],
- ["B792",0x7A89],
- ["B793",0x7A8A],
- ["B794",0x7A8B],
- ["B795",0x7A8C],
- ["C7CF",0x7A8D],
- ["B796",0x7A8E],
- ["B797",0x7A8F],
- ["B798",0x7A90],
- ["D2A4",0x7A91],
- ["D6CF",0x7A92],
- ["B799",0x7A93],
- ["B79A",0x7A94],
- ["F1BB",0x7A95],
- ["BDD1",0x7A96],
- ["B4B0",0x7A97],
- ["BEBD",0x7A98],
- ["B79B",0x7A99],
- ["B79C",0x7A9A],
- ["B79D",0x7A9B],
- ["B4DC",0x7A9C],
- ["CED1",0x7A9D],
- ["B79E",0x7A9E],
- ["BFDF",0x7A9F],
- ["F1BD",0x7AA0],
- ["B79F",0x7AA1],
- ["B7A0",0x7AA2],
- ["B840",0x7AA3],
- ["B841",0x7AA4],
- ["BFFA",0x7AA5],
- ["F1BC",0x7AA6],
- ["B842",0x7AA7],
- ["F1BF",0x7AA8],
- ["B843",0x7AA9],
- ["B844",0x7AAA],
- ["B845",0x7AAB],
- ["F1BE",0x7AAC],
- ["F1C0",0x7AAD],
- ["B846",0x7AAE],
- ["B847",0x7AAF],
- ["B848",0x7AB0],
- ["B849",0x7AB1],
- ["B84A",0x7AB2],
- ["F1C1",0x7AB3],
- ["B84B",0x7AB4],
- ["B84C",0x7AB5],
- ["B84D",0x7AB6],
- ["B84E",0x7AB7],
- ["B84F",0x7AB8],
- ["B850",0x7AB9],
- ["B851",0x7ABA],
- ["B852",0x7ABB],
- ["B853",0x7ABC],
- ["B854",0x7ABD],
- ["B855",0x7ABE],
- ["C1FE",0x7ABF],
- ["B856",0x7AC0],
- ["B857",0x7AC1],
- ["B858",0x7AC2],
- ["B859",0x7AC3],
- ["B85A",0x7AC4],
- ["B85B",0x7AC5],
- ["B85C",0x7AC6],
- ["B85D",0x7AC7],
- ["B85E",0x7AC8],
- ["B85F",0x7AC9],
- ["B860",0x7ACA],
- ["C1A2",0x7ACB],
- ["B861",0x7ACC],
- ["B862",0x7ACD],
- ["B863",0x7ACE],
- ["B864",0x7ACF],
- ["B865",0x7AD0],
- ["B866",0x7AD1],
- ["B867",0x7AD2],
- ["B868",0x7AD3],
- ["B869",0x7AD4],
- ["B86A",0x7AD5],
- ["CAFA",0x7AD6],
- ["B86B",0x7AD7],
- ["B86C",0x7AD8],
- ["D5BE",0x7AD9],
- ["B86D",0x7ADA],
- ["B86E",0x7ADB],
- ["B86F",0x7ADC],
- ["B870",0x7ADD],
- ["BEBA",0x7ADE],
- ["BEB9",0x7ADF],
- ["D5C2",0x7AE0],
- ["B871",0x7AE1],
- ["B872",0x7AE2],
- ["BFA2",0x7AE3],
- ["B873",0x7AE4],
- ["CDAF",0x7AE5],
- ["F1B5",0x7AE6],
- ["B874",0x7AE7],
- ["B875",0x7AE8],
- ["B876",0x7AE9],
- ["B877",0x7AEA],
- ["B878",0x7AEB],
- ["B879",0x7AEC],
- ["BDDF",0x7AED],
- ["B87A",0x7AEE],
- ["B6CB",0x7AEF],
- ["B87B",0x7AF0],
- ["B87C",0x7AF1],
- ["B87D",0x7AF2],
- ["B87E",0x7AF3],
- ["B880",0x7AF4],
- ["B881",0x7AF5],
- ["B882",0x7AF6],
- ["B883",0x7AF7],
- ["B884",0x7AF8],
- ["D6F1",0x7AF9],
- ["F3C3",0x7AFA],
- ["B885",0x7AFB],
- ["B886",0x7AFC],
- ["F3C4",0x7AFD],
- ["B887",0x7AFE],
- ["B8CD",0x7AFF],
- ["B888",0x7B00],
- ["B889",0x7B01],
- ["B88A",0x7B02],
- ["F3C6",0x7B03],
- ["F3C7",0x7B04],
- ["B88B",0x7B05],
- ["B0CA",0x7B06],
- ["B88C",0x7B07],
- ["F3C5",0x7B08],
- ["B88D",0x7B09],
- ["F3C9",0x7B0A],
- ["CBF1",0x7B0B],
- ["B88E",0x7B0C],
- ["B88F",0x7B0D],
- ["B890",0x7B0E],
- ["F3CB",0x7B0F],
- ["B891",0x7B10],
- ["D0A6",0x7B11],
- ["B892",0x7B12],
- ["B893",0x7B13],
- ["B1CA",0x7B14],
- ["F3C8",0x7B15],
- ["B894",0x7B16],
- ["B895",0x7B17],
- ["B896",0x7B18],
- ["F3CF",0x7B19],
- ["B897",0x7B1A],
- ["B5D1",0x7B1B],
- ["B898",0x7B1C],
- ["B899",0x7B1D],
- ["F3D7",0x7B1E],
- ["B89A",0x7B1F],
- ["F3D2",0x7B20],
- ["B89B",0x7B21],
- ["B89C",0x7B22],
- ["B89D",0x7B23],
- ["F3D4",0x7B24],
- ["F3D3",0x7B25],
- ["B7FB",0x7B26],
- ["B89E",0x7B27],
- ["B1BF",0x7B28],
- ["B89F",0x7B29],
- ["F3CE",0x7B2A],
- ["F3CA",0x7B2B],
- ["B5DA",0x7B2C],
- ["B8A0",0x7B2D],
- ["F3D0",0x7B2E],
- ["B940",0x7B2F],
- ["B941",0x7B30],
- ["F3D1",0x7B31],
- ["B942",0x7B32],
- ["F3D5",0x7B33],
- ["B943",0x7B34],
- ["B944",0x7B35],
- ["B945",0x7B36],
- ["B946",0x7B37],
- ["F3CD",0x7B38],
- ["B947",0x7B39],
- ["BCE3",0x7B3A],
- ["B948",0x7B3B],
- ["C1FD",0x7B3C],
- ["B949",0x7B3D],
- ["F3D6",0x7B3E],
- ["B94A",0x7B3F],
- ["B94B",0x7B40],
- ["B94C",0x7B41],
- ["B94D",0x7B42],
- ["B94E",0x7B43],
- ["B94F",0x7B44],
- ["F3DA",0x7B45],
- ["B950",0x7B46],
- ["F3CC",0x7B47],
- ["B951",0x7B48],
- ["B5C8",0x7B49],
- ["B952",0x7B4A],
- ["BDEE",0x7B4B],
- ["F3DC",0x7B4C],
- ["B953",0x7B4D],
- ["B954",0x7B4E],
- ["B7A4",0x7B4F],
- ["BFF0",0x7B50],
- ["D6FE",0x7B51],
- ["CDB2",0x7B52],
- ["B955",0x7B53],
- ["B4F0",0x7B54],
- ["B956",0x7B55],
- ["B2DF",0x7B56],
- ["B957",0x7B57],
- ["F3D8",0x7B58],
- ["B958",0x7B59],
- ["F3D9",0x7B5A],
- ["C9B8",0x7B5B],
- ["B959",0x7B5C],
- ["F3DD",0x7B5D],
- ["B95A",0x7B5E],
- ["B95B",0x7B5F],
- ["F3DE",0x7B60],
- ["B95C",0x7B61],
- ["F3E1",0x7B62],
- ["B95D",0x7B63],
- ["B95E",0x7B64],
- ["B95F",0x7B65],
- ["B960",0x7B66],
- ["B961",0x7B67],
- ["B962",0x7B68],
- ["B963",0x7B69],
- ["B964",0x7B6A],
- ["B965",0x7B6B],
- ["B966",0x7B6C],
- ["B967",0x7B6D],
- ["F3DF",0x7B6E],
- ["B968",0x7B6F],
- ["B969",0x7B70],
- ["F3E3",0x7B71],
- ["F3E2",0x7B72],
- ["B96A",0x7B73],
- ["B96B",0x7B74],
- ["F3DB",0x7B75],
- ["B96C",0x7B76],
- ["BFEA",0x7B77],
- ["B96D",0x7B78],
- ["B3EF",0x7B79],
- ["B96E",0x7B7A],
- ["F3E0",0x7B7B],
- ["B96F",0x7B7C],
- ["B970",0x7B7D],
- ["C7A9",0x7B7E],
- ["B971",0x7B7F],
- ["BCF2",0x7B80],
- ["B972",0x7B81],
- ["B973",0x7B82],
- ["B974",0x7B83],
- ["B975",0x7B84],
- ["F3EB",0x7B85],
- ["B976",0x7B86],
- ["B977",0x7B87],
- ["B978",0x7B88],
- ["B979",0x7B89],
- ["B97A",0x7B8A],
- ["B97B",0x7B8B],
- ["B97C",0x7B8C],
- ["B9BF",0x7B8D],
- ["B97D",0x7B8E],
- ["B97E",0x7B8F],
- ["F3E4",0x7B90],
- ["B980",0x7B91],
- ["B981",0x7B92],
- ["B982",0x7B93],
- ["B2AD",0x7B94],
- ["BBFE",0x7B95],
- ["B983",0x7B96],
- ["CBE3",0x7B97],
- ["B984",0x7B98],
- ["B985",0x7B99],
- ["B986",0x7B9A],
- ["B987",0x7B9B],
- ["F3ED",0x7B9C],
- ["F3E9",0x7B9D],
- ["B988",0x7B9E],
- ["B989",0x7B9F],
- ["B98A",0x7BA0],
- ["B9DC",0x7BA1],
- ["F3EE",0x7BA2],
- ["B98B",0x7BA3],
- ["B98C",0x7BA4],
- ["B98D",0x7BA5],
- ["F3E5",0x7BA6],
- ["F3E6",0x7BA7],
- ["F3EA",0x7BA8],
- ["C2E1",0x7BA9],
- ["F3EC",0x7BAA],
- ["F3EF",0x7BAB],
- ["F3E8",0x7BAC],
- ["BCFD",0x7BAD],
- ["B98E",0x7BAE],
- ["B98F",0x7BAF],
- ["B990",0x7BB0],
- ["CFE4",0x7BB1],
- ["B991",0x7BB2],
- ["B992",0x7BB3],
- ["F3F0",0x7BB4],
- ["B993",0x7BB5],
- ["B994",0x7BB6],
- ["B995",0x7BB7],
- ["F3E7",0x7BB8],
- ["B996",0x7BB9],
- ["B997",0x7BBA],
- ["B998",0x7BBB],
- ["B999",0x7BBC],
- ["B99A",0x7BBD],
- ["B99B",0x7BBE],
- ["B99C",0x7BBF],
- ["B99D",0x7BC0],
- ["F3F2",0x7BC1],
- ["B99E",0x7BC2],
- ["B99F",0x7BC3],
- ["B9A0",0x7BC4],
- ["BA40",0x7BC5],
- ["D7AD",0x7BC6],
- ["C6AA",0x7BC7],
- ["BA41",0x7BC8],
- ["BA42",0x7BC9],
- ["BA43",0x7BCA],
- ["BA44",0x7BCB],
- ["F3F3",0x7BCC],
- ["BA45",0x7BCD],
- ["BA46",0x7BCE],
- ["BA47",0x7BCF],
- ["BA48",0x7BD0],
- ["F3F1",0x7BD1],
- ["BA49",0x7BD2],
- ["C2A8",0x7BD3],
- ["BA4A",0x7BD4],
- ["BA4B",0x7BD5],
- ["BA4C",0x7BD6],
- ["BA4D",0x7BD7],
- ["BA4E",0x7BD8],
- ["B8DD",0x7BD9],
- ["F3F5",0x7BDA],
- ["BA4F",0x7BDB],
- ["BA50",0x7BDC],
- ["F3F4",0x7BDD],
- ["BA51",0x7BDE],
- ["BA52",0x7BDF],
- ["BA53",0x7BE0],
- ["B4DB",0x7BE1],
- ["BA54",0x7BE2],
- ["BA55",0x7BE3],
- ["BA56",0x7BE4],
- ["F3F6",0x7BE5],
- ["F3F7",0x7BE6],
- ["BA57",0x7BE7],
- ["BA58",0x7BE8],
- ["BA59",0x7BE9],
- ["F3F8",0x7BEA],
- ["BA5A",0x7BEB],
- ["BA5B",0x7BEC],
- ["BA5C",0x7BED],
- ["C0BA",0x7BEE],
- ["BA5D",0x7BEF],
- ["BA5E",0x7BF0],
- ["C0E9",0x7BF1],
- ["BA5F",0x7BF2],
- ["BA60",0x7BF3],
- ["BA61",0x7BF4],
- ["BA62",0x7BF5],
- ["BA63",0x7BF6],
- ["C5F1",0x7BF7],
- ["BA64",0x7BF8],
- ["BA65",0x7BF9],
- ["BA66",0x7BFA],
- ["BA67",0x7BFB],
- ["F3FB",0x7BFC],
- ["BA68",0x7BFD],
- ["F3FA",0x7BFE],
- ["BA69",0x7BFF],
- ["BA6A",0x7C00],
- ["BA6B",0x7C01],
- ["BA6C",0x7C02],
- ["BA6D",0x7C03],
- ["BA6E",0x7C04],
- ["BA6F",0x7C05],
- ["BA70",0x7C06],
- ["B4D8",0x7C07],
- ["BA71",0x7C08],
- ["BA72",0x7C09],
- ["BA73",0x7C0A],
- ["F3FE",0x7C0B],
- ["F3F9",0x7C0C],
- ["BA74",0x7C0D],
- ["BA75",0x7C0E],
- ["F3FC",0x7C0F],
- ["BA76",0x7C10],
- ["BA77",0x7C11],
- ["BA78",0x7C12],
- ["BA79",0x7C13],
- ["BA7A",0x7C14],
- ["BA7B",0x7C15],
- ["F3FD",0x7C16],
- ["BA7C",0x7C17],
- ["BA7D",0x7C18],
- ["BA7E",0x7C19],
- ["BA80",0x7C1A],
- ["BA81",0x7C1B],
- ["BA82",0x7C1C],
- ["BA83",0x7C1D],
- ["BA84",0x7C1E],
- ["F4A1",0x7C1F],
- ["BA85",0x7C20],
- ["BA86",0x7C21],
- ["BA87",0x7C22],
- ["BA88",0x7C23],
- ["BA89",0x7C24],
- ["BA8A",0x7C25],
- ["F4A3",0x7C26],
- ["BBC9",0x7C27],
- ["BA8B",0x7C28],
- ["BA8C",0x7C29],
- ["F4A2",0x7C2A],
- ["BA8D",0x7C2B],
- ["BA8E",0x7C2C],
- ["BA8F",0x7C2D],
- ["BA90",0x7C2E],
- ["BA91",0x7C2F],
- ["BA92",0x7C30],
- ["BA93",0x7C31],
- ["BA94",0x7C32],
- ["BA95",0x7C33],
- ["BA96",0x7C34],
- ["BA97",0x7C35],
- ["BA98",0x7C36],
- ["BA99",0x7C37],
- ["F4A4",0x7C38],
- ["BA9A",0x7C39],
- ["BA9B",0x7C3A],
- ["BA9C",0x7C3B],
- ["BA9D",0x7C3C],
- ["BA9E",0x7C3D],
- ["BA9F",0x7C3E],
- ["B2BE",0x7C3F],
- ["F4A6",0x7C40],
- ["F4A5",0x7C41],
- ["BAA0",0x7C42],
- ["BB40",0x7C43],
- ["BB41",0x7C44],
- ["BB42",0x7C45],
- ["BB43",0x7C46],
- ["BB44",0x7C47],
- ["BB45",0x7C48],
- ["BB46",0x7C49],
- ["BB47",0x7C4A],
- ["BB48",0x7C4B],
- ["BB49",0x7C4C],
- ["BCAE",0x7C4D],
- ["BB4A",0x7C4E],
- ["BB4B",0x7C4F],
- ["BB4C",0x7C50],
- ["BB4D",0x7C51],
- ["BB4E",0x7C52],
- ["BB4F",0x7C53],
- ["BB50",0x7C54],
- ["BB51",0x7C55],
- ["BB52",0x7C56],
- ["BB53",0x7C57],
- ["BB54",0x7C58],
- ["BB55",0x7C59],
- ["BB56",0x7C5A],
- ["BB57",0x7C5B],
- ["BB58",0x7C5C],
- ["BB59",0x7C5D],
- ["BB5A",0x7C5E],
- ["BB5B",0x7C5F],
- ["BB5C",0x7C60],
- ["BB5D",0x7C61],
- ["BB5E",0x7C62],
- ["BB5F",0x7C63],
- ["BB60",0x7C64],
- ["BB61",0x7C65],
- ["BB62",0x7C66],
- ["BB63",0x7C67],
- ["BB64",0x7C68],
- ["BB65",0x7C69],
- ["BB66",0x7C6A],
- ["BB67",0x7C6B],
- ["BB68",0x7C6C],
- ["BB69",0x7C6D],
- ["BB6A",0x7C6E],
- ["BB6B",0x7C6F],
- ["BB6C",0x7C70],
- ["BB6D",0x7C71],
- ["BB6E",0x7C72],
- ["C3D7",0x7C73],
- ["D9E1",0x7C74],
- ["BB6F",0x7C75],
- ["BB70",0x7C76],
- ["BB71",0x7C77],
- ["BB72",0x7C78],
- ["BB73",0x7C79],
- ["BB74",0x7C7A],
- ["C0E0",0x7C7B],
- ["F4CC",0x7C7C],
- ["D7D1",0x7C7D],
- ["BB75",0x7C7E],
- ["BB76",0x7C7F],
- ["BB77",0x7C80],
- ["BB78",0x7C81],
- ["BB79",0x7C82],
- ["BB7A",0x7C83],
- ["BB7B",0x7C84],
- ["BB7C",0x7C85],
- ["BB7D",0x7C86],
- ["BB7E",0x7C87],
- ["BB80",0x7C88],
- ["B7DB",0x7C89],
- ["BB81",0x7C8A],
- ["BB82",0x7C8B],
- ["BB83",0x7C8C],
- ["BB84",0x7C8D],
- ["BB85",0x7C8E],
- ["BB86",0x7C8F],
- ["BB87",0x7C90],
- ["F4CE",0x7C91],
- ["C1A3",0x7C92],
- ["BB88",0x7C93],
- ["BB89",0x7C94],
- ["C6C9",0x7C95],
- ["BB8A",0x7C96],
- ["B4D6",0x7C97],
- ["D5B3",0x7C98],
- ["BB8B",0x7C99],
- ["BB8C",0x7C9A],
- ["BB8D",0x7C9B],
- ["F4D0",0x7C9C],
- ["F4CF",0x7C9D],
- ["F4D1",0x7C9E],
- ["CBDA",0x7C9F],
- ["BB8E",0x7CA0],
- ["BB8F",0x7CA1],
- ["F4D2",0x7CA2],
- ["BB90",0x7CA3],
- ["D4C1",0x7CA4],
- ["D6E0",0x7CA5],
- ["BB91",0x7CA6],
- ["BB92",0x7CA7],
- ["BB93",0x7CA8],
- ["BB94",0x7CA9],
- ["B7E0",0x7CAA],
- ["BB95",0x7CAB],
- ["BB96",0x7CAC],
- ["BB97",0x7CAD],
- ["C1B8",0x7CAE],
- ["BB98",0x7CAF],
- ["BB99",0x7CB0],
- ["C1BB",0x7CB1],
- ["F4D3",0x7CB2],
- ["BEAC",0x7CB3],
- ["BB9A",0x7CB4],
- ["BB9B",0x7CB5],
- ["BB9C",0x7CB6],
- ["BB9D",0x7CB7],
- ["BB9E",0x7CB8],
- ["B4E2",0x7CB9],
- ["BB9F",0x7CBA],
- ["BBA0",0x7CBB],
- ["F4D4",0x7CBC],
- ["F4D5",0x7CBD],
- ["BEAB",0x7CBE],
- ["BC40",0x7CBF],
- ["BC41",0x7CC0],
- ["F4D6",0x7CC1],
- ["BC42",0x7CC2],
- ["BC43",0x7CC3],
- ["BC44",0x7CC4],
- ["F4DB",0x7CC5],
- ["BC45",0x7CC6],
- ["F4D7",0x7CC7],
- ["F4DA",0x7CC8],
- ["BC46",0x7CC9],
- ["BAFD",0x7CCA],
- ["BC47",0x7CCB],
- ["F4D8",0x7CCC],
- ["F4D9",0x7CCD],
- ["BC48",0x7CCE],
- ["BC49",0x7CCF],
- ["BC4A",0x7CD0],
- ["BC4B",0x7CD1],
- ["BC4C",0x7CD2],
- ["BC4D",0x7CD3],
- ["BC4E",0x7CD4],
- ["B8E2",0x7CD5],
- ["CCC7",0x7CD6],
- ["F4DC",0x7CD7],
- ["BC4F",0x7CD8],
- ["B2DA",0x7CD9],
- ["BC50",0x7CDA],
- ["BC51",0x7CDB],
- ["C3D3",0x7CDC],
- ["BC52",0x7CDD],
- ["BC53",0x7CDE],
- ["D4E3",0x7CDF],
- ["BFB7",0x7CE0],
- ["BC54",0x7CE1],
- ["BC55",0x7CE2],
- ["BC56",0x7CE3],
- ["BC57",0x7CE4],
- ["BC58",0x7CE5],
- ["BC59",0x7CE6],
- ["BC5A",0x7CE7],
- ["F4DD",0x7CE8],
- ["BC5B",0x7CE9],
- ["BC5C",0x7CEA],
- ["BC5D",0x7CEB],
- ["BC5E",0x7CEC],
- ["BC5F",0x7CED],
- ["BC60",0x7CEE],
- ["C5B4",0x7CEF],
- ["BC61",0x7CF0],
- ["BC62",0x7CF1],
- ["BC63",0x7CF2],
- ["BC64",0x7CF3],
- ["BC65",0x7CF4],
- ["BC66",0x7CF5],
- ["BC67",0x7CF6],
- ["BC68",0x7CF7],
- ["F4E9",0x7CF8],
- ["BC69",0x7CF9],
- ["BC6A",0x7CFA],
- ["CFB5",0x7CFB],
- ["BC6B",0x7CFC],
- ["BC6C",0x7CFD],
- ["BC6D",0x7CFE],
- ["BC6E",0x7CFF],
- ["BC6F",0x7D00],
- ["BC70",0x7D01],
- ["BC71",0x7D02],
- ["BC72",0x7D03],
- ["BC73",0x7D04],
- ["BC74",0x7D05],
- ["BC75",0x7D06],
- ["BC76",0x7D07],
- ["BC77",0x7D08],
- ["BC78",0x7D09],
- ["CEC9",0x7D0A],
- ["BC79",0x7D0B],
- ["BC7A",0x7D0C],
- ["BC7B",0x7D0D],
- ["BC7C",0x7D0E],
- ["BC7D",0x7D0F],
- ["BC7E",0x7D10],
- ["BC80",0x7D11],
- ["BC81",0x7D12],
- ["BC82",0x7D13],
- ["BC83",0x7D14],
- ["BC84",0x7D15],
- ["BC85",0x7D16],
- ["BC86",0x7D17],
- ["BC87",0x7D18],
- ["BC88",0x7D19],
- ["BC89",0x7D1A],
- ["BC8A",0x7D1B],
- ["BC8B",0x7D1C],
- ["BC8C",0x7D1D],
- ["BC8D",0x7D1E],
- ["BC8E",0x7D1F],
- ["CBD8",0x7D20],
- ["BC8F",0x7D21],
- ["CBF7",0x7D22],
- ["BC90",0x7D23],
- ["BC91",0x7D24],
- ["BC92",0x7D25],
- ["BC93",0x7D26],
- ["BDF4",0x7D27],
- ["BC94",0x7D28],
- ["BC95",0x7D29],
- ["BC96",0x7D2A],
- ["D7CF",0x7D2B],
- ["BC97",0x7D2C],
- ["BC98",0x7D2D],
- ["BC99",0x7D2E],
- ["C0DB",0x7D2F],
- ["BC9A",0x7D30],
- ["BC9B",0x7D31],
- ["BC9C",0x7D32],
- ["BC9D",0x7D33],
- ["BC9E",0x7D34],
- ["BC9F",0x7D35],
- ["BCA0",0x7D36],
- ["BD40",0x7D37],
- ["BD41",0x7D38],
- ["BD42",0x7D39],
- ["BD43",0x7D3A],
- ["BD44",0x7D3B],
- ["BD45",0x7D3C],
- ["BD46",0x7D3D],
- ["BD47",0x7D3E],
- ["BD48",0x7D3F],
- ["BD49",0x7D40],
- ["BD4A",0x7D41],
- ["BD4B",0x7D42],
- ["BD4C",0x7D43],
- ["BD4D",0x7D44],
- ["BD4E",0x7D45],
- ["BD4F",0x7D46],
- ["BD50",0x7D47],
- ["BD51",0x7D48],
- ["BD52",0x7D49],
- ["BD53",0x7D4A],
- ["BD54",0x7D4B],
- ["BD55",0x7D4C],
- ["BD56",0x7D4D],
- ["BD57",0x7D4E],
- ["BD58",0x7D4F],
- ["BD59",0x7D50],
- ["BD5A",0x7D51],
- ["BD5B",0x7D52],
- ["BD5C",0x7D53],
- ["BD5D",0x7D54],
- ["BD5E",0x7D55],
- ["BD5F",0x7D56],
- ["BD60",0x7D57],
- ["BD61",0x7D58],
- ["BD62",0x7D59],
- ["BD63",0x7D5A],
- ["BD64",0x7D5B],
- ["BD65",0x7D5C],
- ["BD66",0x7D5D],
- ["BD67",0x7D5E],
- ["BD68",0x7D5F],
- ["BD69",0x7D60],
- ["BD6A",0x7D61],
- ["BD6B",0x7D62],
- ["BD6C",0x7D63],
- ["BD6D",0x7D64],
- ["BD6E",0x7D65],
- ["BD6F",0x7D66],
- ["BD70",0x7D67],
- ["BD71",0x7D68],
- ["BD72",0x7D69],
- ["BD73",0x7D6A],
- ["BD74",0x7D6B],
- ["BD75",0x7D6C],
- ["BD76",0x7D6D],
- ["D0F5",0x7D6E],
- ["BD77",0x7D6F],
- ["BD78",0x7D70],
- ["BD79",0x7D71],
- ["BD7A",0x7D72],
- ["BD7B",0x7D73],
- ["BD7C",0x7D74],
- ["BD7D",0x7D75],
- ["BD7E",0x7D76],
- ["F4EA",0x7D77],
- ["BD80",0x7D78],
- ["BD81",0x7D79],
- ["BD82",0x7D7A],
- ["BD83",0x7D7B],
- ["BD84",0x7D7C],
- ["BD85",0x7D7D],
- ["BD86",0x7D7E],
- ["BD87",0x7D7F],
- ["BD88",0x7D80],
- ["BD89",0x7D81],
- ["BD8A",0x7D82],
- ["BD8B",0x7D83],
- ["BD8C",0x7D84],
- ["BD8D",0x7D85],
- ["BD8E",0x7D86],
- ["BD8F",0x7D87],
- ["BD90",0x7D88],
- ["BD91",0x7D89],
- ["BD92",0x7D8A],
- ["BD93",0x7D8B],
- ["BD94",0x7D8C],
- ["BD95",0x7D8D],
- ["BD96",0x7D8E],
- ["BD97",0x7D8F],
- ["BD98",0x7D90],
- ["BD99",0x7D91],
- ["BD9A",0x7D92],
- ["BD9B",0x7D93],
- ["BD9C",0x7D94],
- ["BD9D",0x7D95],
- ["BD9E",0x7D96],
- ["BD9F",0x7D97],
- ["BDA0",0x7D98],
- ["BE40",0x7D99],
- ["BE41",0x7D9A],
- ["BE42",0x7D9B],
- ["BE43",0x7D9C],
- ["BE44",0x7D9D],
- ["BE45",0x7D9E],
- ["BE46",0x7D9F],
- ["BE47",0x7DA0],
- ["BE48",0x7DA1],
- ["BE49",0x7DA2],
- ["BE4A",0x7DA3],
- ["BE4B",0x7DA4],
- ["BE4C",0x7DA5],
- ["F4EB",0x7DA6],
- ["BE4D",0x7DA7],
- ["BE4E",0x7DA8],
- ["BE4F",0x7DA9],
- ["BE50",0x7DAA],
- ["BE51",0x7DAB],
- ["BE52",0x7DAC],
- ["BE53",0x7DAD],
- ["F4EC",0x7DAE],
- ["BE54",0x7DAF],
- ["BE55",0x7DB0],
- ["BE56",0x7DB1],
- ["BE57",0x7DB2],
- ["BE58",0x7DB3],
- ["BE59",0x7DB4],
- ["BE5A",0x7DB5],
- ["BE5B",0x7DB6],
- ["BE5C",0x7DB7],
- ["BE5D",0x7DB8],
- ["BE5E",0x7DB9],
- ["BE5F",0x7DBA],
- ["BE60",0x7DBB],
- ["BE61",0x7DBC],
- ["BE62",0x7DBD],
- ["BE63",0x7DBE],
- ["BE64",0x7DBF],
- ["BE65",0x7DC0],
- ["BE66",0x7DC1],
- ["BE67",0x7DC2],
- ["BE68",0x7DC3],
- ["BE69",0x7DC4],
- ["BE6A",0x7DC5],
- ["BE6B",0x7DC6],
- ["BE6C",0x7DC7],
- ["BE6D",0x7DC8],
- ["BE6E",0x7DC9],
- ["BE6F",0x7DCA],
- ["BE70",0x7DCB],
- ["BE71",0x7DCC],
- ["BE72",0x7DCD],
- ["BE73",0x7DCE],
- ["BE74",0x7DCF],
- ["BE75",0x7DD0],
- ["BE76",0x7DD1],
- ["BE77",0x7DD2],
- ["BE78",0x7DD3],
- ["BE79",0x7DD4],
- ["BE7A",0x7DD5],
- ["BE7B",0x7DD6],
- ["BE7C",0x7DD7],
- ["BE7D",0x7DD8],
- ["BE7E",0x7DD9],
- ["BE80",0x7DDA],
- ["BE81",0x7DDB],
- ["BE82",0x7DDC],
- ["BE83",0x7DDD],
- ["BE84",0x7DDE],
- ["BE85",0x7DDF],
- ["BE86",0x7DE0],
- ["BE87",0x7DE1],
- ["BE88",0x7DE2],
- ["BE89",0x7DE3],
- ["BE8A",0x7DE4],
- ["BE8B",0x7DE5],
- ["BE8C",0x7DE6],
- ["BE8D",0x7DE7],
- ["BE8E",0x7DE8],
- ["BE8F",0x7DE9],
- ["BE90",0x7DEA],
- ["BE91",0x7DEB],
- ["BE92",0x7DEC],
- ["BE93",0x7DED],
- ["BE94",0x7DEE],
- ["BE95",0x7DEF],
- ["BE96",0x7DF0],
- ["BE97",0x7DF1],
- ["BE98",0x7DF2],
- ["BE99",0x7DF3],
- ["BE9A",0x7DF4],
- ["BE9B",0x7DF5],
- ["BE9C",0x7DF6],
- ["BE9D",0x7DF7],
- ["BE9E",0x7DF8],
- ["BE9F",0x7DF9],
- ["BEA0",0x7DFA],
- ["BF40",0x7DFB],
- ["BF41",0x7DFC],
- ["BF42",0x7DFD],
- ["BF43",0x7DFE],
- ["BF44",0x7DFF],
- ["BF45",0x7E00],
- ["BF46",0x7E01],
- ["BF47",0x7E02],
- ["BF48",0x7E03],
- ["BF49",0x7E04],
- ["BF4A",0x7E05],
- ["BF4B",0x7E06],
- ["BF4C",0x7E07],
- ["BF4D",0x7E08],
- ["BF4E",0x7E09],
- ["BF4F",0x7E0A],
- ["BF50",0x7E0B],
- ["BF51",0x7E0C],
- ["BF52",0x7E0D],
- ["BF53",0x7E0E],
- ["BF54",0x7E0F],
- ["BF55",0x7E10],
- ["BF56",0x7E11],
- ["BF57",0x7E12],
- ["BF58",0x7E13],
- ["BF59",0x7E14],
- ["BF5A",0x7E15],
- ["BF5B",0x7E16],
- ["BF5C",0x7E17],
- ["BF5D",0x7E18],
- ["BF5E",0x7E19],
- ["BF5F",0x7E1A],
- ["BF60",0x7E1B],
- ["BF61",0x7E1C],
- ["BF62",0x7E1D],
- ["BF63",0x7E1E],
- ["BF64",0x7E1F],
- ["BF65",0x7E20],
- ["BF66",0x7E21],
- ["BF67",0x7E22],
- ["BF68",0x7E23],
- ["BF69",0x7E24],
- ["BF6A",0x7E25],
- ["BF6B",0x7E26],
- ["BF6C",0x7E27],
- ["BF6D",0x7E28],
- ["BF6E",0x7E29],
- ["BF6F",0x7E2A],
- ["BF70",0x7E2B],
- ["BF71",0x7E2C],
- ["BF72",0x7E2D],
- ["BF73",0x7E2E],
- ["BF74",0x7E2F],
- ["BF75",0x7E30],
- ["BF76",0x7E31],
- ["BF77",0x7E32],
- ["BF78",0x7E33],
- ["BF79",0x7E34],
- ["BF7A",0x7E35],
- ["BF7B",0x7E36],
- ["BF7C",0x7E37],
- ["BF7D",0x7E38],
- ["BF7E",0x7E39],
- ["BF80",0x7E3A],
- ["F7E3",0x7E3B],
- ["BF81",0x7E3C],
- ["BF82",0x7E3D],
- ["BF83",0x7E3E],
- ["BF84",0x7E3F],
- ["BF85",0x7E40],
- ["B7B1",0x7E41],
- ["BF86",0x7E42],
- ["BF87",0x7E43],
- ["BF88",0x7E44],
- ["BF89",0x7E45],
- ["BF8A",0x7E46],
- ["F4ED",0x7E47],
- ["BF8B",0x7E48],
- ["BF8C",0x7E49],
- ["BF8D",0x7E4A],
- ["BF8E",0x7E4B],
- ["BF8F",0x7E4C],
- ["BF90",0x7E4D],
- ["BF91",0x7E4E],
- ["BF92",0x7E4F],
- ["BF93",0x7E50],
- ["BF94",0x7E51],
- ["BF95",0x7E52],
- ["BF96",0x7E53],
- ["BF97",0x7E54],
- ["BF98",0x7E55],
- ["BF99",0x7E56],
- ["BF9A",0x7E57],
- ["BF9B",0x7E58],
- ["BF9C",0x7E59],
- ["BF9D",0x7E5A],
- ["BF9E",0x7E5B],
- ["BF9F",0x7E5C],
- ["BFA0",0x7E5D],
- ["C040",0x7E5E],
- ["C041",0x7E5F],
- ["C042",0x7E60],
- ["C043",0x7E61],
- ["C044",0x7E62],
- ["C045",0x7E63],
- ["C046",0x7E64],
- ["C047",0x7E65],
- ["C048",0x7E66],
- ["C049",0x7E67],
- ["C04A",0x7E68],
- ["C04B",0x7E69],
- ["C04C",0x7E6A],
- ["C04D",0x7E6B],
- ["C04E",0x7E6C],
- ["C04F",0x7E6D],
- ["C050",0x7E6E],
- ["C051",0x7E6F],
- ["C052",0x7E70],
- ["C053",0x7E71],
- ["C054",0x7E72],
- ["C055",0x7E73],
- ["C056",0x7E74],
- ["C057",0x7E75],
- ["C058",0x7E76],
- ["C059",0x7E77],
- ["C05A",0x7E78],
- ["C05B",0x7E79],
- ["C05C",0x7E7A],
- ["C05D",0x7E7B],
- ["C05E",0x7E7C],
- ["C05F",0x7E7D],
- ["C060",0x7E7E],
- ["C061",0x7E7F],
- ["C062",0x7E80],
- ["C063",0x7E81],
- ["D7EB",0x7E82],
- ["C064",0x7E83],
- ["C065",0x7E84],
- ["C066",0x7E85],
- ["C067",0x7E86],
- ["C068",0x7E87],
- ["C069",0x7E88],
- ["C06A",0x7E89],
- ["C06B",0x7E8A],
- ["C06C",0x7E8B],
- ["C06D",0x7E8C],
- ["C06E",0x7E8D],
- ["C06F",0x7E8E],
- ["C070",0x7E8F],
- ["C071",0x7E90],
- ["C072",0x7E91],
- ["C073",0x7E92],
- ["C074",0x7E93],
- ["C075",0x7E94],
- ["C076",0x7E95],
- ["C077",0x7E96],
- ["C078",0x7E97],
- ["C079",0x7E98],
- ["C07A",0x7E99],
- ["C07B",0x7E9A],
- ["F4EE",0x7E9B],
- ["C07C",0x7E9C],
- ["C07D",0x7E9D],
- ["C07E",0x7E9E],
- ["E6F9",0x7E9F],
- ["BEC0",0x7EA0],
- ["E6FA",0x7EA1],
- ["BAEC",0x7EA2],
- ["E6FB",0x7EA3],
- ["CFCB",0x7EA4],
- ["E6FC",0x7EA5],
- ["D4BC",0x7EA6],
- ["BCB6",0x7EA7],
- ["E6FD",0x7EA8],
- ["E6FE",0x7EA9],
- ["BCCD",0x7EAA],
- ["C8D2",0x7EAB],
- ["CEB3",0x7EAC],
- ["E7A1",0x7EAD],
- ["C080",0x7EAE],
- ["B4BF",0x7EAF],
- ["E7A2",0x7EB0],
- ["C9B4",0x7EB1],
- ["B8D9",0x7EB2],
- ["C4C9",0x7EB3],
- ["C081",0x7EB4],
- ["D7DD",0x7EB5],
- ["C2DA",0x7EB6],
- ["B7D7",0x7EB7],
- ["D6BD",0x7EB8],
- ["CEC6",0x7EB9],
- ["B7C4",0x7EBA],
- ["C082",0x7EBB],
- ["C083",0x7EBC],
- ["C5A6",0x7EBD],
- ["E7A3",0x7EBE],
- ["CFDF",0x7EBF],
- ["E7A4",0x7EC0],
- ["E7A5",0x7EC1],
- ["E7A6",0x7EC2],
- ["C1B7",0x7EC3],
- ["D7E9",0x7EC4],
- ["C9F0",0x7EC5],
- ["CFB8",0x7EC6],
- ["D6AF",0x7EC7],
- ["D6D5",0x7EC8],
- ["E7A7",0x7EC9],
- ["B0ED",0x7ECA],
- ["E7A8",0x7ECB],
- ["E7A9",0x7ECC],
- ["C9DC",0x7ECD],
- ["D2EF",0x7ECE],
- ["BEAD",0x7ECF],
- ["E7AA",0x7ED0],
- ["B0F3",0x7ED1],
- ["C8DE",0x7ED2],
- ["BDE1",0x7ED3],
- ["E7AB",0x7ED4],
- ["C8C6",0x7ED5],
- ["C084",0x7ED6],
- ["E7AC",0x7ED7],
- ["BBE6",0x7ED8],
- ["B8F8",0x7ED9],
- ["D1A4",0x7EDA],
- ["E7AD",0x7EDB],
- ["C2E7",0x7EDC],
- ["BEF8",0x7EDD],
- ["BDCA",0x7EDE],
- ["CDB3",0x7EDF],
- ["E7AE",0x7EE0],
- ["E7AF",0x7EE1],
- ["BEEE",0x7EE2],
- ["D0E5",0x7EE3],
- ["C085",0x7EE4],
- ["CBE7",0x7EE5],
- ["CCD0",0x7EE6],
- ["BCCC",0x7EE7],
- ["E7B0",0x7EE8],
- ["BCA8",0x7EE9],
- ["D0F7",0x7EEA],
- ["E7B1",0x7EEB],
- ["C086",0x7EEC],
- ["D0F8",0x7EED],
- ["E7B2",0x7EEE],
- ["E7B3",0x7EEF],
- ["B4C2",0x7EF0],
- ["E7B4",0x7EF1],
- ["E7B5",0x7EF2],
- ["C9FE",0x7EF3],
- ["CEAC",0x7EF4],
- ["C3E0",0x7EF5],
- ["E7B7",0x7EF6],
- ["B1C1",0x7EF7],
- ["B3F1",0x7EF8],
- ["C087",0x7EF9],
- ["E7B8",0x7EFA],
- ["E7B9",0x7EFB],
- ["D7DB",0x7EFC],
- ["D5C0",0x7EFD],
- ["E7BA",0x7EFE],
- ["C2CC",0x7EFF],
- ["D7BA",0x7F00],
- ["E7BB",0x7F01],
- ["E7BC",0x7F02],
- ["E7BD",0x7F03],
- ["BCEA",0x7F04],
- ["C3E5",0x7F05],
- ["C0C2",0x7F06],
- ["E7BE",0x7F07],
- ["E7BF",0x7F08],
- ["BCA9",0x7F09],
- ["C088",0x7F0A],
- ["E7C0",0x7F0B],
- ["E7C1",0x7F0C],
- ["E7B6",0x7F0D],
- ["B6D0",0x7F0E],
- ["E7C2",0x7F0F],
- ["C089",0x7F10],
- ["E7C3",0x7F11],
- ["E7C4",0x7F12],
- ["BBBA",0x7F13],
- ["B5DE",0x7F14],
- ["C2C6",0x7F15],
- ["B1E0",0x7F16],
- ["E7C5",0x7F17],
- ["D4B5",0x7F18],
- ["E7C6",0x7F19],
- ["B8BF",0x7F1A],
- ["E7C8",0x7F1B],
- ["E7C7",0x7F1C],
- ["B7EC",0x7F1D],
- ["C08A",0x7F1E],
- ["E7C9",0x7F1F],
- ["B2F8",0x7F20],
- ["E7CA",0x7F21],
- ["E7CB",0x7F22],
- ["E7CC",0x7F23],
- ["E7CD",0x7F24],
- ["E7CE",0x7F25],
- ["E7CF",0x7F26],
- ["E7D0",0x7F27],
- ["D3A7",0x7F28],
- ["CBF5",0x7F29],
- ["E7D1",0x7F2A],
- ["E7D2",0x7F2B],
- ["E7D3",0x7F2C],
- ["E7D4",0x7F2D],
- ["C9C9",0x7F2E],
- ["E7D5",0x7F2F],
- ["E7D6",0x7F30],
- ["E7D7",0x7F31],
- ["E7D8",0x7F32],
- ["E7D9",0x7F33],
- ["BDC9",0x7F34],
- ["E7DA",0x7F35],
- ["F3BE",0x7F36],
- ["C08B",0x7F37],
- ["B8D7",0x7F38],
- ["C08C",0x7F39],
- ["C8B1",0x7F3A],
- ["C08D",0x7F3B],
- ["C08E",0x7F3C],
- ["C08F",0x7F3D],
- ["C090",0x7F3E],
- ["C091",0x7F3F],
- ["C092",0x7F40],
- ["C093",0x7F41],
- ["F3BF",0x7F42],
- ["C094",0x7F43],
- ["F3C0",0x7F44],
- ["F3C1",0x7F45],
- ["C095",0x7F46],
- ["C096",0x7F47],
- ["C097",0x7F48],
- ["C098",0x7F49],
- ["C099",0x7F4A],
- ["C09A",0x7F4B],
- ["C09B",0x7F4C],
- ["C09C",0x7F4D],
- ["C09D",0x7F4E],
- ["C09E",0x7F4F],
- ["B9DE",0x7F50],
- ["CDF8",0x7F51],
- ["C09F",0x7F52],
- ["C0A0",0x7F53],
- ["D8E8",0x7F54],
- ["BAB1",0x7F55],
- ["C140",0x7F56],
- ["C2DE",0x7F57],
- ["EEB7",0x7F58],
- ["C141",0x7F59],
- ["B7A3",0x7F5A],
- ["C142",0x7F5B],
- ["C143",0x7F5C],
- ["C144",0x7F5D],
- ["C145",0x7F5E],
- ["EEB9",0x7F5F],
- ["C146",0x7F60],
- ["EEB8",0x7F61],
- ["B0D5",0x7F62],
- ["C147",0x7F63],
- ["C148",0x7F64],
- ["C149",0x7F65],
- ["C14A",0x7F66],
- ["C14B",0x7F67],
- ["EEBB",0x7F68],
- ["D5D6",0x7F69],
- ["D7EF",0x7F6A],
- ["C14C",0x7F6B],
- ["C14D",0x7F6C],
- ["C14E",0x7F6D],
- ["D6C3",0x7F6E],
- ["C14F",0x7F6F],
- ["C150",0x7F70],
- ["EEBD",0x7F71],
- ["CAF0",0x7F72],
- ["C151",0x7F73],
- ["EEBC",0x7F74],
- ["C152",0x7F75],
- ["C153",0x7F76],
- ["C154",0x7F77],
- ["C155",0x7F78],
- ["EEBE",0x7F79],
- ["C156",0x7F7A],
- ["C157",0x7F7B],
- ["C158",0x7F7C],
- ["C159",0x7F7D],
- ["EEC0",0x7F7E],
- ["C15A",0x7F7F],
- ["C15B",0x7F80],
- ["EEBF",0x7F81],
- ["C15C",0x7F82],
- ["C15D",0x7F83],
- ["C15E",0x7F84],
- ["C15F",0x7F85],
- ["C160",0x7F86],
- ["C161",0x7F87],
- ["C162",0x7F88],
- ["C163",0x7F89],
- ["D1F2",0x7F8A],
- ["C164",0x7F8B],
- ["C7BC",0x7F8C],
- ["C165",0x7F8D],
- ["C3C0",0x7F8E],
- ["C166",0x7F8F],
- ["C167",0x7F90],
- ["C168",0x7F91],
- ["C169",0x7F92],
- ["C16A",0x7F93],
- ["B8E1",0x7F94],
- ["C16B",0x7F95],
- ["C16C",0x7F96],
- ["C16D",0x7F97],
- ["C16E",0x7F98],
- ["C16F",0x7F99],
- ["C1E7",0x7F9A],
- ["C170",0x7F9B],
- ["C171",0x7F9C],
- ["F4C6",0x7F9D],
- ["D0DF",0x7F9E],
- ["F4C7",0x7F9F],
- ["C172",0x7FA0],
- ["CFDB",0x7FA1],
- ["C173",0x7FA2],
- ["C174",0x7FA3],
- ["C8BA",0x7FA4],
- ["C175",0x7FA5],
- ["C176",0x7FA6],
- ["F4C8",0x7FA7],
- ["C177",0x7FA8],
- ["C178",0x7FA9],
- ["C179",0x7FAA],
- ["C17A",0x7FAB],
- ["C17B",0x7FAC],
- ["C17C",0x7FAD],
- ["C17D",0x7FAE],
- ["F4C9",0x7FAF],
- ["F4CA",0x7FB0],
- ["C17E",0x7FB1],
- ["F4CB",0x7FB2],
- ["C180",0x7FB3],
- ["C181",0x7FB4],
- ["C182",0x7FB5],
- ["C183",0x7FB6],
- ["C184",0x7FB7],
- ["D9FA",0x7FB8],
- ["B8FE",0x7FB9],
- ["C185",0x7FBA],
- ["C186",0x7FBB],
- ["E5F1",0x7FBC],
- ["D3F0",0x7FBD],
- ["C187",0x7FBE],
- ["F4E0",0x7FBF],
- ["C188",0x7FC0],
- ["CECC",0x7FC1],
- ["C189",0x7FC2],
- ["C18A",0x7FC3],
- ["C18B",0x7FC4],
- ["B3E1",0x7FC5],
- ["C18C",0x7FC6],
- ["C18D",0x7FC7],
- ["C18E",0x7FC8],
- ["C18F",0x7FC9],
- ["F1B4",0x7FCA],
- ["C190",0x7FCB],
- ["D2EE",0x7FCC],
- ["C191",0x7FCD],
- ["F4E1",0x7FCE],
- ["C192",0x7FCF],
- ["C193",0x7FD0],
- ["C194",0x7FD1],
- ["C195",0x7FD2],
- ["C196",0x7FD3],
- ["CFE8",0x7FD4],
- ["F4E2",0x7FD5],
- ["C197",0x7FD6],
- ["C198",0x7FD7],
- ["C7CC",0x7FD8],
- ["C199",0x7FD9],
- ["C19A",0x7FDA],
- ["C19B",0x7FDB],
- ["C19C",0x7FDC],
- ["C19D",0x7FDD],
- ["C19E",0x7FDE],
- ["B5D4",0x7FDF],
- ["B4E4",0x7FE0],
- ["F4E4",0x7FE1],
- ["C19F",0x7FE2],
- ["C1A0",0x7FE3],
- ["C240",0x7FE4],
- ["F4E3",0x7FE5],
- ["F4E5",0x7FE6],
- ["C241",0x7FE7],
- ["C242",0x7FE8],
- ["F4E6",0x7FE9],
- ["C243",0x7FEA],
- ["C244",0x7FEB],
- ["C245",0x7FEC],
- ["C246",0x7FED],
- ["F4E7",0x7FEE],
- ["C247",0x7FEF],
- ["BAB2",0x7FF0],
- ["B0BF",0x7FF1],
- ["C248",0x7FF2],
- ["F4E8",0x7FF3],
- ["C249",0x7FF4],
- ["C24A",0x7FF5],
- ["C24B",0x7FF6],
- ["C24C",0x7FF7],
- ["C24D",0x7FF8],
- ["C24E",0x7FF9],
- ["C24F",0x7FFA],
- ["B7AD",0x7FFB],
- ["D2ED",0x7FFC],
- ["C250",0x7FFD],
- ["C251",0x7FFE],
- ["C252",0x7FFF],
- ["D2AB",0x8000],
- ["C0CF",0x8001],
- ["C253",0x8002],
- ["BFBC",0x8003],
- ["EBA3",0x8004],
- ["D5DF",0x8005],
- ["EAC8",0x8006],
- ["C254",0x8007],
- ["C255",0x8008],
- ["C256",0x8009],
- ["C257",0x800A],
- ["F1F3",0x800B],
- ["B6F8",0x800C],
- ["CBA3",0x800D],
- ["C258",0x800E],
- ["C259",0x800F],
- ["C4CD",0x8010],
- ["C25A",0x8011],
- ["F1E7",0x8012],
- ["C25B",0x8013],
- ["F1E8",0x8014],
- ["B8FB",0x8015],
- ["F1E9",0x8016],
- ["BAC4",0x8017],
- ["D4C5",0x8018],
- ["B0D2",0x8019],
- ["C25C",0x801A],
- ["C25D",0x801B],
- ["F1EA",0x801C],
- ["C25E",0x801D],
- ["C25F",0x801E],
- ["C260",0x801F],
- ["F1EB",0x8020],
- ["C261",0x8021],
- ["F1EC",0x8022],
- ["C262",0x8023],
- ["C263",0x8024],
- ["F1ED",0x8025],
- ["F1EE",0x8026],
- ["F1EF",0x8027],
- ["F1F1",0x8028],
- ["F1F0",0x8029],
- ["C5D5",0x802A],
- ["C264",0x802B],
- ["C265",0x802C],
- ["C266",0x802D],
- ["C267",0x802E],
- ["C268",0x802F],
- ["C269",0x8030],
- ["F1F2",0x8031],
- ["C26A",0x8032],
- ["B6FA",0x8033],
- ["C26B",0x8034],
- ["F1F4",0x8035],
- ["D2AE",0x8036],
- ["DEC7",0x8037],
- ["CBCA",0x8038],
- ["C26C",0x8039],
- ["C26D",0x803A],
- ["B3DC",0x803B],
- ["C26E",0x803C],
- ["B5A2",0x803D],
- ["C26F",0x803E],
- ["B9A2",0x803F],
- ["C270",0x8040],
- ["C271",0x8041],
- ["C4F4",0x8042],
- ["F1F5",0x8043],
- ["C272",0x8044],
- ["C273",0x8045],
- ["F1F6",0x8046],
- ["C274",0x8047],
- ["C275",0x8048],
- ["C276",0x8049],
- ["C1C4",0x804A],
- ["C1FB",0x804B],
- ["D6B0",0x804C],
- ["F1F7",0x804D],
- ["C277",0x804E],
- ["C278",0x804F],
- ["C279",0x8050],
- ["C27A",0x8051],
- ["F1F8",0x8052],
- ["C27B",0x8053],
- ["C1AA",0x8054],
- ["C27C",0x8055],
- ["C27D",0x8056],
- ["C27E",0x8057],
- ["C6B8",0x8058],
- ["C280",0x8059],
- ["BEDB",0x805A],
- ["C281",0x805B],
- ["C282",0x805C],
- ["C283",0x805D],
- ["C284",0x805E],
- ["C285",0x805F],
- ["C286",0x8060],
- ["C287",0x8061],
- ["C288",0x8062],
- ["C289",0x8063],
- ["C28A",0x8064],
- ["C28B",0x8065],
- ["C28C",0x8066],
- ["C28D",0x8067],
- ["C28E",0x8068],
- ["F1F9",0x8069],
- ["B4CF",0x806A],
- ["C28F",0x806B],
- ["C290",0x806C],
- ["C291",0x806D],
- ["C292",0x806E],
- ["C293",0x806F],
- ["C294",0x8070],
- ["F1FA",0x8071],
- ["C295",0x8072],
- ["C296",0x8073],
- ["C297",0x8074],
- ["C298",0x8075],
- ["C299",0x8076],
- ["C29A",0x8077],
- ["C29B",0x8078],
- ["C29C",0x8079],
- ["C29D",0x807A],
- ["C29E",0x807B],
- ["C29F",0x807C],
- ["C2A0",0x807D],
- ["C340",0x807E],
- ["EDB2",0x807F],
- ["EDB1",0x8080],
- ["C341",0x8081],
- ["C342",0x8082],
- ["CBE0",0x8083],
- ["D2DE",0x8084],
- ["C343",0x8085],
- ["CBC1",0x8086],
- ["D5D8",0x8087],
- ["C344",0x8088],
- ["C8E2",0x8089],
- ["C345",0x808A],
- ["C0DF",0x808B],
- ["BCA1",0x808C],
- ["C346",0x808D],
- ["C347",0x808E],
- ["C348",0x808F],
- ["C349",0x8090],
- ["C34A",0x8091],
- ["C34B",0x8092],
- ["EBC1",0x8093],
- ["C34C",0x8094],
- ["C34D",0x8095],
- ["D0A4",0x8096],
- ["C34E",0x8097],
- ["D6E2",0x8098],
- ["C34F",0x8099],
- ["B6C7",0x809A],
- ["B8D8",0x809B],
- ["EBC0",0x809C],
- ["B8CE",0x809D],
- ["C350",0x809E],
- ["EBBF",0x809F],
- ["B3A6",0x80A0],
- ["B9C9",0x80A1],
- ["D6AB",0x80A2],
- ["C351",0x80A3],
- ["B7F4",0x80A4],
- ["B7CA",0x80A5],
- ["C352",0x80A6],
- ["C353",0x80A7],
- ["C354",0x80A8],
- ["BCE7",0x80A9],
- ["B7BE",0x80AA],
- ["EBC6",0x80AB],
- ["C355",0x80AC],
- ["EBC7",0x80AD],
- ["B0B9",0x80AE],
- ["BFCF",0x80AF],
- ["C356",0x80B0],
- ["EBC5",0x80B1],
- ["D3FD",0x80B2],
- ["C357",0x80B3],
- ["EBC8",0x80B4],
- ["C358",0x80B5],
- ["C359",0x80B6],
- ["EBC9",0x80B7],
- ["C35A",0x80B8],
- ["C35B",0x80B9],
- ["B7CE",0x80BA],
- ["C35C",0x80BB],
- ["EBC2",0x80BC],
- ["EBC4",0x80BD],
- ["C9F6",0x80BE],
- ["D6D7",0x80BF],
- ["D5CD",0x80C0],
- ["D0B2",0x80C1],
- ["EBCF",0x80C2],
- ["CEB8",0x80C3],
- ["EBD0",0x80C4],
- ["C35D",0x80C5],
- ["B5A8",0x80C6],
- ["C35E",0x80C7],
- ["C35F",0x80C8],
- ["C360",0x80C9],
- ["C361",0x80CA],
- ["C362",0x80CB],
- ["B1B3",0x80CC],
- ["EBD2",0x80CD],
- ["CCA5",0x80CE],
- ["C363",0x80CF],
- ["C364",0x80D0],
- ["C365",0x80D1],
- ["C366",0x80D2],
- ["C367",0x80D3],
- ["C368",0x80D4],
- ["C369",0x80D5],
- ["C5D6",0x80D6],
- ["EBD3",0x80D7],
- ["C36A",0x80D8],
- ["EBD1",0x80D9],
- ["C5DF",0x80DA],
- ["EBCE",0x80DB],
- ["CAA4",0x80DC],
- ["EBD5",0x80DD],
- ["B0FB",0x80DE],
- ["C36B",0x80DF],
- ["C36C",0x80E0],
- ["BAFA",0x80E1],
- ["C36D",0x80E2],
- ["C36E",0x80E3],
- ["D8B7",0x80E4],
- ["F1E3",0x80E5],
- ["C36F",0x80E6],
- ["EBCA",0x80E7],
- ["EBCB",0x80E8],
- ["EBCC",0x80E9],
- ["EBCD",0x80EA],
- ["EBD6",0x80EB],
- ["E6C0",0x80EC],
- ["EBD9",0x80ED],
- ["C370",0x80EE],
- ["BFE8",0x80EF],
- ["D2C8",0x80F0],
- ["EBD7",0x80F1],
- ["EBDC",0x80F2],
- ["B8EC",0x80F3],
- ["EBD8",0x80F4],
- ["C371",0x80F5],
- ["BDBA",0x80F6],
- ["C372",0x80F7],
- ["D0D8",0x80F8],
- ["C373",0x80F9],
- ["B0B7",0x80FA],
- ["C374",0x80FB],
- ["EBDD",0x80FC],
- ["C4DC",0x80FD],
- ["C375",0x80FE],
- ["C376",0x80FF],
- ["C377",0x8100],
- ["C378",0x8101],
- ["D6AC",0x8102],
- ["C379",0x8103],
- ["C37A",0x8104],
- ["C37B",0x8105],
- ["B4E0",0x8106],
- ["C37C",0x8107],
- ["C37D",0x8108],
- ["C2F6",0x8109],
- ["BCB9",0x810A],
- ["C37E",0x810B],
- ["C380",0x810C],
- ["EBDA",0x810D],
- ["EBDB",0x810E],
- ["D4E0",0x810F],
- ["C6EA",0x8110],
- ["C4D4",0x8111],
- ["EBDF",0x8112],
- ["C5A7",0x8113],
- ["D9F5",0x8114],
- ["C381",0x8115],
- ["B2B1",0x8116],
- ["C382",0x8117],
- ["EBE4",0x8118],
- ["C383",0x8119],
- ["BDC5",0x811A],
- ["C384",0x811B],
- ["C385",0x811C],
- ["C386",0x811D],
- ["EBE2",0x811E],
- ["C387",0x811F],
- ["C388",0x8120],
- ["C389",0x8121],
- ["C38A",0x8122],
- ["C38B",0x8123],
- ["C38C",0x8124],
- ["C38D",0x8125],
- ["C38E",0x8126],
- ["C38F",0x8127],
- ["C390",0x8128],
- ["C391",0x8129],
- ["C392",0x812A],
- ["C393",0x812B],
- ["EBE3",0x812C],
- ["C394",0x812D],
- ["C395",0x812E],
- ["B8AC",0x812F],
- ["C396",0x8130],
- ["CDD1",0x8131],
- ["EBE5",0x8132],
- ["C397",0x8133],
- ["C398",0x8134],
- ["C399",0x8135],
- ["EBE1",0x8136],
- ["C39A",0x8137],
- ["C1B3",0x8138],
- ["C39B",0x8139],
- ["C39C",0x813A],
- ["C39D",0x813B],
- ["C39E",0x813C],
- ["C39F",0x813D],
- ["C6A2",0x813E],
- ["C3A0",0x813F],
- ["C440",0x8140],
- ["C441",0x8141],
- ["C442",0x8142],
- ["C443",0x8143],
- ["C444",0x8144],
- ["C445",0x8145],
- ["CCF3",0x8146],
- ["C446",0x8147],
- ["EBE6",0x8148],
- ["C447",0x8149],
- ["C0B0",0x814A],
- ["D2B8",0x814B],
- ["EBE7",0x814C],
- ["C448",0x814D],
- ["C449",0x814E],
- ["C44A",0x814F],
- ["B8AF",0x8150],
- ["B8AD",0x8151],
- ["C44B",0x8152],
- ["EBE8",0x8153],
- ["C7BB",0x8154],
- ["CDF3",0x8155],
- ["C44C",0x8156],
- ["C44D",0x8157],
- ["C44E",0x8158],
- ["EBEA",0x8159],
- ["EBEB",0x815A],
- ["C44F",0x815B],
- ["C450",0x815C],
- ["C451",0x815D],
- ["C452",0x815E],
- ["C453",0x815F],
- ["EBED",0x8160],
- ["C454",0x8161],
- ["C455",0x8162],
- ["C456",0x8163],
- ["C457",0x8164],
- ["D0C8",0x8165],
- ["C458",0x8166],
- ["EBF2",0x8167],
- ["C459",0x8168],
- ["EBEE",0x8169],
- ["C45A",0x816A],
- ["C45B",0x816B],
- ["C45C",0x816C],
- ["EBF1",0x816D],
- ["C8F9",0x816E],
- ["C45D",0x816F],
- ["D1FC",0x8170],
- ["EBEC",0x8171],
- ["C45E",0x8172],
- ["C45F",0x8173],
- ["EBE9",0x8174],
- ["C460",0x8175],
- ["C461",0x8176],
- ["C462",0x8177],
- ["C463",0x8178],
- ["B8B9",0x8179],
- ["CFD9",0x817A],
- ["C4E5",0x817B],
- ["EBEF",0x817C],
- ["EBF0",0x817D],
- ["CCDA",0x817E],
- ["CDC8",0x817F],
- ["B0F2",0x8180],
- ["C464",0x8181],
- ["EBF6",0x8182],
- ["C465",0x8183],
- ["C466",0x8184],
- ["C467",0x8185],
- ["C468",0x8186],
- ["C469",0x8187],
- ["EBF5",0x8188],
- ["C46A",0x8189],
- ["B2B2",0x818A],
- ["C46B",0x818B],
- ["C46C",0x818C],
- ["C46D",0x818D],
- ["C46E",0x818E],
- ["B8E0",0x818F],
- ["C46F",0x8190],
- ["EBF7",0x8191],
- ["C470",0x8192],
- ["C471",0x8193],
- ["C472",0x8194],
- ["C473",0x8195],
- ["C474",0x8196],
- ["C475",0x8197],
- ["B1EC",0x8198],
- ["C476",0x8199],
- ["C477",0x819A],
- ["CCC5",0x819B],
- ["C4A4",0x819C],
- ["CFA5",0x819D],
- ["C478",0x819E],
- ["C479",0x819F],
- ["C47A",0x81A0],
- ["C47B",0x81A1],
- ["C47C",0x81A2],
- ["EBF9",0x81A3],
- ["C47D",0x81A4],
- ["C47E",0x81A5],
- ["ECA2",0x81A6],
- ["C480",0x81A7],
- ["C5F2",0x81A8],
- ["C481",0x81A9],
- ["EBFA",0x81AA],
- ["C482",0x81AB],
- ["C483",0x81AC],
- ["C484",0x81AD],
- ["C485",0x81AE],
- ["C486",0x81AF],
- ["C487",0x81B0],
- ["C488",0x81B1],
- ["C489",0x81B2],
- ["C9C5",0x81B3],
- ["C48A",0x81B4],
- ["C48B",0x81B5],
- ["C48C",0x81B6],
- ["C48D",0x81B7],
- ["C48E",0x81B8],
- ["C48F",0x81B9],
- ["E2DF",0x81BA],
- ["EBFE",0x81BB],
- ["C490",0x81BC],
- ["C491",0x81BD],
- ["C492",0x81BE],
- ["C493",0x81BF],
- ["CDCE",0x81C0],
- ["ECA1",0x81C1],
- ["B1DB",0x81C2],
- ["D3B7",0x81C3],
- ["C494",0x81C4],
- ["C495",0x81C5],
- ["D2DC",0x81C6],
- ["C496",0x81C7],
- ["C497",0x81C8],
- ["C498",0x81C9],
- ["EBFD",0x81CA],
- ["C499",0x81CB],
- ["EBFB",0x81CC],
- ["C49A",0x81CD],
- ["C49B",0x81CE],
- ["C49C",0x81CF],
- ["C49D",0x81D0],
- ["C49E",0x81D1],
- ["C49F",0x81D2],
- ["C4A0",0x81D3],
- ["C540",0x81D4],
- ["C541",0x81D5],
- ["C542",0x81D6],
- ["C543",0x81D7],
- ["C544",0x81D8],
- ["C545",0x81D9],
- ["C546",0x81DA],
- ["C547",0x81DB],
- ["C548",0x81DC],
- ["C549",0x81DD],
- ["C54A",0x81DE],
- ["C54B",0x81DF],
- ["C54C",0x81E0],
- ["C54D",0x81E1],
- ["C54E",0x81E2],
- ["B3BC",0x81E3],
- ["C54F",0x81E4],
- ["C550",0x81E5],
- ["C551",0x81E6],
- ["EAB0",0x81E7],
- ["C552",0x81E8],
- ["C553",0x81E9],
- ["D7D4",0x81EA],
- ["C554",0x81EB],
- ["F4AB",0x81EC],
- ["B3F4",0x81ED],
- ["C555",0x81EE],
- ["C556",0x81EF],
- ["C557",0x81F0],
- ["C558",0x81F1],
- ["C559",0x81F2],
- ["D6C1",0x81F3],
- ["D6C2",0x81F4],
- ["C55A",0x81F5],
- ["C55B",0x81F6],
- ["C55C",0x81F7],
- ["C55D",0x81F8],
- ["C55E",0x81F9],
- ["C55F",0x81FA],
- ["D5E9",0x81FB],
- ["BECA",0x81FC],
- ["C560",0x81FD],
- ["F4A7",0x81FE],
- ["C561",0x81FF],
- ["D2A8",0x8200],
- ["F4A8",0x8201],
- ["F4A9",0x8202],
- ["C562",0x8203],
- ["F4AA",0x8204],
- ["BECB",0x8205],
- ["D3DF",0x8206],
- ["C563",0x8207],
- ["C564",0x8208],
- ["C565",0x8209],
- ["C566",0x820A],
- ["C567",0x820B],
- ["C9E0",0x820C],
- ["C9E1",0x820D],
- ["C568",0x820E],
- ["C569",0x820F],
- ["F3C2",0x8210],
- ["C56A",0x8211],
- ["CAE6",0x8212],
- ["C56B",0x8213],
- ["CCF2",0x8214],
- ["C56C",0x8215],
- ["C56D",0x8216],
- ["C56E",0x8217],
- ["C56F",0x8218],
- ["C570",0x8219],
- ["C571",0x821A],
- ["E2B6",0x821B],
- ["CBB4",0x821C],
- ["C572",0x821D],
- ["CEE8",0x821E],
- ["D6DB",0x821F],
- ["C573",0x8220],
- ["F4AD",0x8221],
- ["F4AE",0x8222],
- ["F4AF",0x8223],
- ["C574",0x8224],
- ["C575",0x8225],
- ["C576",0x8226],
- ["C577",0x8227],
- ["F4B2",0x8228],
- ["C578",0x8229],
- ["BABD",0x822A],
- ["F4B3",0x822B],
- ["B0E3",0x822C],
- ["F4B0",0x822D],
- ["C579",0x822E],
- ["F4B1",0x822F],
- ["BDA2",0x8230],
- ["B2D5",0x8231],
- ["C57A",0x8232],
- ["F4B6",0x8233],
- ["F4B7",0x8234],
- ["B6E6",0x8235],
- ["B2B0",0x8236],
- ["CFCF",0x8237],
- ["F4B4",0x8238],
- ["B4AC",0x8239],
- ["C57B",0x823A],
- ["F4B5",0x823B],
- ["C57C",0x823C],
- ["C57D",0x823D],
- ["F4B8",0x823E],
- ["C57E",0x823F],
- ["C580",0x8240],
- ["C581",0x8241],
- ["C582",0x8242],
- ["C583",0x8243],
- ["F4B9",0x8244],
- ["C584",0x8245],
- ["C585",0x8246],
- ["CDA7",0x8247],
- ["C586",0x8248],
- ["F4BA",0x8249],
- ["C587",0x824A],
- ["F4BB",0x824B],
- ["C588",0x824C],
- ["C589",0x824D],
- ["C58A",0x824E],
- ["F4BC",0x824F],
- ["C58B",0x8250],
- ["C58C",0x8251],
- ["C58D",0x8252],
- ["C58E",0x8253],
- ["C58F",0x8254],
- ["C590",0x8255],
- ["C591",0x8256],
- ["C592",0x8257],
- ["CBD2",0x8258],
- ["C593",0x8259],
- ["F4BD",0x825A],
- ["C594",0x825B],
- ["C595",0x825C],
- ["C596",0x825D],
- ["C597",0x825E],
- ["F4BE",0x825F],
- ["C598",0x8260],
- ["C599",0x8261],
- ["C59A",0x8262],
- ["C59B",0x8263],
- ["C59C",0x8264],
- ["C59D",0x8265],
- ["C59E",0x8266],
- ["C59F",0x8267],
- ["F4BF",0x8268],
- ["C5A0",0x8269],
- ["C640",0x826A],
- ["C641",0x826B],
- ["C642",0x826C],
- ["C643",0x826D],
- ["F4DE",0x826E],
- ["C1BC",0x826F],
- ["BCE8",0x8270],
- ["C644",0x8271],
- ["C9AB",0x8272],
- ["D1DE",0x8273],
- ["E5F5",0x8274],
- ["C645",0x8275],
- ["C646",0x8276],
- ["C647",0x8277],
- ["C648",0x8278],
- ["DCB3",0x8279],
- ["D2D5",0x827A],
- ["C649",0x827B],
- ["C64A",0x827C],
- ["DCB4",0x827D],
- ["B0AC",0x827E],
- ["DCB5",0x827F],
- ["C64B",0x8280],
- ["C64C",0x8281],
- ["BDDA",0x8282],
- ["C64D",0x8283],
- ["DCB9",0x8284],
- ["C64E",0x8285],
- ["C64F",0x8286],
- ["C650",0x8287],
- ["D8C2",0x8288],
- ["C651",0x8289],
- ["DCB7",0x828A],
- ["D3F3",0x828B],
- ["C652",0x828C],
- ["C9D6",0x828D],
- ["DCBA",0x828E],
- ["DCB6",0x828F],
- ["C653",0x8290],
- ["DCBB",0x8291],
- ["C3A2",0x8292],
- ["C654",0x8293],
- ["C655",0x8294],
- ["C656",0x8295],
- ["C657",0x8296],
- ["DCBC",0x8297],
- ["DCC5",0x8298],
- ["DCBD",0x8299],
- ["C658",0x829A],
- ["C659",0x829B],
- ["CEDF",0x829C],
- ["D6A5",0x829D],
- ["C65A",0x829E],
- ["DCCF",0x829F],
- ["C65B",0x82A0],
- ["DCCD",0x82A1],
- ["C65C",0x82A2],
- ["C65D",0x82A3],
- ["DCD2",0x82A4],
- ["BDE6",0x82A5],
- ["C2AB",0x82A6],
- ["C65E",0x82A7],
- ["DCB8",0x82A8],
- ["DCCB",0x82A9],
- ["DCCE",0x82AA],
- ["DCBE",0x82AB],
- ["B7D2",0x82AC],
- ["B0C5",0x82AD],
- ["DCC7",0x82AE],
- ["D0BE",0x82AF],
- ["DCC1",0x82B0],
- ["BBA8",0x82B1],
- ["C65F",0x82B2],
- ["B7BC",0x82B3],
- ["DCCC",0x82B4],
- ["C660",0x82B5],
- ["C661",0x82B6],
- ["DCC6",0x82B7],
- ["DCBF",0x82B8],
- ["C7DB",0x82B9],
- ["C662",0x82BA],
- ["C663",0x82BB],
- ["C664",0x82BC],
- ["D1BF",0x82BD],
- ["DCC0",0x82BE],
- ["C665",0x82BF],
- ["C666",0x82C0],
- ["DCCA",0x82C1],
- ["C667",0x82C2],
- ["C668",0x82C3],
- ["DCD0",0x82C4],
- ["C669",0x82C5],
- ["C66A",0x82C6],
- ["CEAD",0x82C7],
- ["DCC2",0x82C8],
- ["C66B",0x82C9],
- ["DCC3",0x82CA],
- ["DCC8",0x82CB],
- ["DCC9",0x82CC],
- ["B2D4",0x82CD],
- ["DCD1",0x82CE],
- ["CBD5",0x82CF],
- ["C66C",0x82D0],
- ["D4B7",0x82D1],
- ["DCDB",0x82D2],
- ["DCDF",0x82D3],
- ["CCA6",0x82D4],
- ["DCE6",0x82D5],
- ["C66D",0x82D6],
- ["C3E7",0x82D7],
- ["DCDC",0x82D8],
- ["C66E",0x82D9],
- ["C66F",0x82DA],
- ["BFC1",0x82DB],
- ["DCD9",0x82DC],
- ["C670",0x82DD],
- ["B0FA",0x82DE],
- ["B9B6",0x82DF],
- ["DCE5",0x82E0],
- ["DCD3",0x82E1],
- ["C671",0x82E2],
- ["DCC4",0x82E3],
- ["DCD6",0x82E4],
- ["C8F4",0x82E5],
- ["BFE0",0x82E6],
- ["C672",0x82E7],
- ["C673",0x82E8],
- ["C674",0x82E9],
- ["C675",0x82EA],
- ["C9BB",0x82EB],
- ["C676",0x82EC],
- ["C677",0x82ED],
- ["C678",0x82EE],
- ["B1BD",0x82EF],
- ["C679",0x82F0],
- ["D3A2",0x82F1],
- ["C67A",0x82F2],
- ["C67B",0x82F3],
- ["DCDA",0x82F4],
- ["C67C",0x82F5],
- ["C67D",0x82F6],
- ["DCD5",0x82F7],
- ["C67E",0x82F8],
- ["C6BB",0x82F9],
- ["C680",0x82FA],
- ["DCDE",0x82FB],
- ["C681",0x82FC],
- ["C682",0x82FD],
- ["C683",0x82FE],
- ["C684",0x82FF],
- ["C685",0x8300],
- ["D7C2",0x8301],
- ["C3AF",0x8302],
- ["B7B6",0x8303],
- ["C7D1",0x8304],
- ["C3A9",0x8305],
- ["DCE2",0x8306],
- ["DCD8",0x8307],
- ["DCEB",0x8308],
- ["DCD4",0x8309],
- ["C686",0x830A],
- ["C687",0x830B],
- ["DCDD",0x830C],
- ["C688",0x830D],
- ["BEA5",0x830E],
- ["DCD7",0x830F],
- ["C689",0x8310],
- ["DCE0",0x8311],
- ["C68A",0x8312],
- ["C68B",0x8313],
- ["DCE3",0x8314],
- ["DCE4",0x8315],
- ["C68C",0x8316],
- ["DCF8",0x8317],
- ["C68D",0x8318],
- ["C68E",0x8319],
- ["DCE1",0x831A],
- ["DDA2",0x831B],
- ["DCE7",0x831C],
- ["C68F",0x831D],
- ["C690",0x831E],
- ["C691",0x831F],
- ["C692",0x8320],
- ["C693",0x8321],
- ["C694",0x8322],
- ["C695",0x8323],
- ["C696",0x8324],
- ["C697",0x8325],
- ["C698",0x8326],
- ["BCEB",0x8327],
- ["B4C4",0x8328],
- ["C699",0x8329],
- ["C69A",0x832A],
- ["C3A3",0x832B],
- ["B2E7",0x832C],
- ["DCFA",0x832D],
- ["C69B",0x832E],
- ["DCF2",0x832F],
- ["C69C",0x8330],
- ["DCEF",0x8331],
- ["C69D",0x8332],
- ["DCFC",0x8333],
- ["DCEE",0x8334],
- ["D2F0",0x8335],
- ["B2E8",0x8336],
- ["C69E",0x8337],
- ["C8D7",0x8338],
- ["C8E3",0x8339],
- ["DCFB",0x833A],
- ["C69F",0x833B],
- ["DCED",0x833C],
- ["C6A0",0x833D],
- ["C740",0x833E],
- ["C741",0x833F],
- ["DCF7",0x8340],
- ["C742",0x8341],
- ["C743",0x8342],
- ["DCF5",0x8343],
- ["C744",0x8344],
- ["C745",0x8345],
- ["BEA3",0x8346],
- ["DCF4",0x8347],
- ["C746",0x8348],
- ["B2DD",0x8349],
- ["C747",0x834A],
- ["C748",0x834B],
- ["C749",0x834C],
- ["C74A",0x834D],
- ["C74B",0x834E],
- ["DCF3",0x834F],
- ["BCF6",0x8350],
- ["DCE8",0x8351],
- ["BBC4",0x8352],
- ["C74C",0x8353],
- ["C0F3",0x8354],
- ["C74D",0x8355],
- ["C74E",0x8356],
- ["C74F",0x8357],
- ["C750",0x8358],
- ["C751",0x8359],
- ["BCD4",0x835A],
- ["DCE9",0x835B],
- ["DCEA",0x835C],
- ["C752",0x835D],
- ["DCF1",0x835E],
- ["DCF6",0x835F],
- ["DCF9",0x8360],
- ["B5B4",0x8361],
- ["C753",0x8362],
- ["C8D9",0x8363],
- ["BBE7",0x8364],
- ["DCFE",0x8365],
- ["DCFD",0x8366],
- ["D3AB",0x8367],
- ["DDA1",0x8368],
- ["DDA3",0x8369],
- ["DDA5",0x836A],
- ["D2F1",0x836B],
- ["DDA4",0x836C],
- ["DDA6",0x836D],
- ["DDA7",0x836E],
- ["D2A9",0x836F],
- ["C754",0x8370],
- ["C755",0x8371],
- ["C756",0x8372],
- ["C757",0x8373],
- ["C758",0x8374],
- ["C759",0x8375],
- ["C75A",0x8376],
- ["BAC9",0x8377],
- ["DDA9",0x8378],
- ["C75B",0x8379],
- ["C75C",0x837A],
- ["DDB6",0x837B],
- ["DDB1",0x837C],
- ["DDB4",0x837D],
- ["C75D",0x837E],
- ["C75E",0x837F],
- ["C75F",0x8380],
- ["C760",0x8381],
- ["C761",0x8382],
- ["C762",0x8383],
- ["C763",0x8384],
- ["DDB0",0x8385],
- ["C6CE",0x8386],
- ["C764",0x8387],
- ["C765",0x8388],
- ["C0F2",0x8389],
- ["C766",0x838A],
- ["C767",0x838B],
- ["C768",0x838C],
- ["C769",0x838D],
- ["C9AF",0x838E],
- ["C76A",0x838F],
- ["C76B",0x8390],
- ["C76C",0x8391],
- ["DCEC",0x8392],
- ["DDAE",0x8393],
- ["C76D",0x8394],
- ["C76E",0x8395],
- ["C76F",0x8396],
- ["C770",0x8397],
- ["DDB7",0x8398],
- ["C771",0x8399],
- ["C772",0x839A],
- ["DCF0",0x839B],
- ["DDAF",0x839C],
- ["C773",0x839D],
- ["DDB8",0x839E],
- ["C774",0x839F],
- ["DDAC",0x83A0],
- ["C775",0x83A1],
- ["C776",0x83A2],
- ["C777",0x83A3],
- ["C778",0x83A4],
- ["C779",0x83A5],
- ["C77A",0x83A6],
- ["C77B",0x83A7],
- ["DDB9",0x83A8],
- ["DDB3",0x83A9],
- ["DDAD",0x83AA],
- ["C4AA",0x83AB],
- ["C77C",0x83AC],
- ["C77D",0x83AD],
- ["C77E",0x83AE],
- ["C780",0x83AF],
- ["DDA8",0x83B0],
- ["C0B3",0x83B1],
- ["C1AB",0x83B2],
- ["DDAA",0x83B3],
- ["DDAB",0x83B4],
- ["C781",0x83B5],
- ["DDB2",0x83B6],
- ["BBF1",0x83B7],
- ["DDB5",0x83B8],
- ["D3A8",0x83B9],
- ["DDBA",0x83BA],
- ["C782",0x83BB],
- ["DDBB",0x83BC],
- ["C3A7",0x83BD],
- ["C783",0x83BE],
- ["C784",0x83BF],
- ["DDD2",0x83C0],
- ["DDBC",0x83C1],
- ["C785",0x83C2],
- ["C786",0x83C3],
- ["C787",0x83C4],
- ["DDD1",0x83C5],
- ["C788",0x83C6],
- ["B9BD",0x83C7],
- ["C789",0x83C8],
- ["C78A",0x83C9],
- ["BED5",0x83CA],
- ["C78B",0x83CB],
- ["BEFA",0x83CC],
- ["C78C",0x83CD],
- ["C78D",0x83CE],
- ["BACA",0x83CF],
- ["C78E",0x83D0],
- ["C78F",0x83D1],
- ["C790",0x83D2],
- ["C791",0x83D3],
- ["DDCA",0x83D4],
- ["C792",0x83D5],
- ["DDC5",0x83D6],
- ["C793",0x83D7],
- ["DDBF",0x83D8],
- ["C794",0x83D9],
- ["C795",0x83DA],
- ["C796",0x83DB],
- ["B2CB",0x83DC],
- ["DDC3",0x83DD],
- ["C797",0x83DE],
- ["DDCB",0x83DF],
- ["B2A4",0x83E0],
- ["DDD5",0x83E1],
- ["C798",0x83E2],
- ["C799",0x83E3],
- ["C79A",0x83E4],
- ["DDBE",0x83E5],
- ["C79B",0x83E6],
- ["C79C",0x83E7],
- ["C79D",0x83E8],
- ["C6D0",0x83E9],
- ["DDD0",0x83EA],
- ["C79E",0x83EB],
- ["C79F",0x83EC],
- ["C7A0",0x83ED],
- ["C840",0x83EE],
- ["C841",0x83EF],
- ["DDD4",0x83F0],
- ["C1E2",0x83F1],
- ["B7C6",0x83F2],
- ["C842",0x83F3],
- ["C843",0x83F4],
- ["C844",0x83F5],
- ["C845",0x83F6],
- ["C846",0x83F7],
- ["DDCE",0x83F8],
- ["DDCF",0x83F9],
- ["C847",0x83FA],
- ["C848",0x83FB],
- ["C849",0x83FC],
- ["DDC4",0x83FD],
- ["C84A",0x83FE],
- ["C84B",0x83FF],
- ["C84C",0x8400],
- ["DDBD",0x8401],
- ["C84D",0x8402],
- ["DDCD",0x8403],
- ["CCD1",0x8404],
- ["C84E",0x8405],
- ["DDC9",0x8406],
- ["C84F",0x8407],
- ["C850",0x8408],
- ["C851",0x8409],
- ["C852",0x840A],
- ["DDC2",0x840B],
- ["C3C8",0x840C],
- ["C6BC",0x840D],
- ["CEAE",0x840E],
- ["DDCC",0x840F],
- ["C853",0x8410],
- ["DDC8",0x8411],
- ["C854",0x8412],
- ["C855",0x8413],
- ["C856",0x8414],
- ["C857",0x8415],
- ["C858",0x8416],
- ["C859",0x8417],
- ["DDC1",0x8418],
- ["C85A",0x8419],
- ["C85B",0x841A],
- ["C85C",0x841B],
- ["DDC6",0x841C],
- ["C2DC",0x841D],
- ["C85D",0x841E],
- ["C85E",0x841F],
- ["C85F",0x8420],
- ["C860",0x8421],
- ["C861",0x8422],
- ["C862",0x8423],
- ["D3A9",0x8424],
- ["D3AA",0x8425],
- ["DDD3",0x8426],
- ["CFF4",0x8427],
- ["C8F8",0x8428],
- ["C863",0x8429],
- ["C864",0x842A],
- ["C865",0x842B],
- ["C866",0x842C],
- ["C867",0x842D],
- ["C868",0x842E],
- ["C869",0x842F],
- ["C86A",0x8430],
- ["DDE6",0x8431],
- ["C86B",0x8432],
- ["C86C",0x8433],
- ["C86D",0x8434],
- ["C86E",0x8435],
- ["C86F",0x8436],
- ["C870",0x8437],
- ["DDC7",0x8438],
- ["C871",0x8439],
- ["C872",0x843A],
- ["C873",0x843B],
- ["DDE0",0x843C],
- ["C2E4",0x843D],
- ["C874",0x843E],
- ["C875",0x843F],
- ["C876",0x8440],
- ["C877",0x8441],
- ["C878",0x8442],
- ["C879",0x8443],
- ["C87A",0x8444],
- ["C87B",0x8445],
- ["DDE1",0x8446],
- ["C87C",0x8447],
- ["C87D",0x8448],
- ["C87E",0x8449],
- ["C880",0x844A],
- ["C881",0x844B],
- ["C882",0x844C],
- ["C883",0x844D],
- ["C884",0x844E],
- ["C885",0x844F],
- ["C886",0x8450],
- ["DDD7",0x8451],
- ["C887",0x8452],
- ["C888",0x8453],
- ["C889",0x8454],
- ["C88A",0x8455],
- ["C88B",0x8456],
- ["D6F8",0x8457],
- ["C88C",0x8458],
- ["DDD9",0x8459],
- ["DDD8",0x845A],
- ["B8F0",0x845B],
- ["DDD6",0x845C],
- ["C88D",0x845D],
- ["C88E",0x845E],
- ["C88F",0x845F],
- ["C890",0x8460],
- ["C6CF",0x8461],
- ["C891",0x8462],
- ["B6AD",0x8463],
- ["C892",0x8464],
- ["C893",0x8465],
- ["C894",0x8466],
- ["C895",0x8467],
- ["C896",0x8468],
- ["DDE2",0x8469],
- ["C897",0x846A],
- ["BAF9",0x846B],
- ["D4E1",0x846C],
- ["DDE7",0x846D],
- ["C898",0x846E],
- ["C899",0x846F],
- ["C89A",0x8470],
- ["B4D0",0x8471],
- ["C89B",0x8472],
- ["DDDA",0x8473],
- ["C89C",0x8474],
- ["BFFB",0x8475],
- ["DDE3",0x8476],
- ["C89D",0x8477],
- ["DDDF",0x8478],
- ["C89E",0x8479],
- ["DDDD",0x847A],
- ["C89F",0x847B],
- ["C8A0",0x847C],
- ["C940",0x847D],
- ["C941",0x847E],
- ["C942",0x847F],
- ["C943",0x8480],
- ["C944",0x8481],
- ["B5D9",0x8482],
- ["C945",0x8483],
- ["C946",0x8484],
- ["C947",0x8485],
- ["C948",0x8486],
- ["DDDB",0x8487],
- ["DDDC",0x8488],
- ["DDDE",0x8489],
- ["C949",0x848A],
- ["BDAF",0x848B],
- ["DDE4",0x848C],
- ["C94A",0x848D],
- ["DDE5",0x848E],
- ["C94B",0x848F],
- ["C94C",0x8490],
- ["C94D",0x8491],
- ["C94E",0x8492],
- ["C94F",0x8493],
- ["C950",0x8494],
- ["C951",0x8495],
- ["C952",0x8496],
- ["DDF5",0x8497],
- ["C953",0x8498],
- ["C3C9",0x8499],
- ["C954",0x849A],
- ["C955",0x849B],
- ["CBE2",0x849C],
- ["C956",0x849D],
- ["C957",0x849E],
- ["C958",0x849F],
- ["C959",0x84A0],
- ["DDF2",0x84A1],
- ["C95A",0x84A2],
- ["C95B",0x84A3],
- ["C95C",0x84A4],
- ["C95D",0x84A5],
- ["C95E",0x84A6],
- ["C95F",0x84A7],
- ["C960",0x84A8],
- ["C961",0x84A9],
- ["C962",0x84AA],
- ["C963",0x84AB],
- ["C964",0x84AC],
- ["C965",0x84AD],
- ["C966",0x84AE],
- ["D8E1",0x84AF],
- ["C967",0x84B0],
- ["C968",0x84B1],
- ["C6D1",0x84B2],
- ["C969",0x84B3],
- ["DDF4",0x84B4],
- ["C96A",0x84B5],
- ["C96B",0x84B6],
- ["C96C",0x84B7],
- ["D5F4",0x84B8],
- ["DDF3",0x84B9],
- ["DDF0",0x84BA],
- ["C96D",0x84BB],
- ["C96E",0x84BC],
- ["DDEC",0x84BD],
- ["C96F",0x84BE],
- ["DDEF",0x84BF],
- ["C970",0x84C0],
- ["DDE8",0x84C1],
- ["C971",0x84C2],
- ["C972",0x84C3],
- ["D0EE",0x84C4],
- ["C973",0x84C5],
- ["C974",0x84C6],
- ["C975",0x84C7],
- ["C976",0x84C8],
- ["C8D8",0x84C9],
- ["DDEE",0x84CA],
- ["C977",0x84CB],
- ["C978",0x84CC],
- ["DDE9",0x84CD],
- ["C979",0x84CE],
- ["C97A",0x84CF],
- ["DDEA",0x84D0],
- ["CBF2",0x84D1],
- ["C97B",0x84D2],
- ["DDED",0x84D3],
- ["C97C",0x84D4],
- ["C97D",0x84D5],
- ["B1CD",0x84D6],
- ["C97E",0x84D7],
- ["C980",0x84D8],
- ["C981",0x84D9],
- ["C982",0x84DA],
- ["C983",0x84DB],
- ["C984",0x84DC],
- ["C0B6",0x84DD],
- ["C985",0x84DE],
- ["BCBB",0x84DF],
- ["DDF1",0x84E0],
- ["C986",0x84E1],
- ["C987",0x84E2],
- ["DDF7",0x84E3],
- ["C988",0x84E4],
- ["DDF6",0x84E5],
- ["DDEB",0x84E6],
- ["C989",0x84E7],
- ["C98A",0x84E8],
- ["C98B",0x84E9],
- ["C98C",0x84EA],
- ["C98D",0x84EB],
- ["C5EE",0x84EC],
- ["C98E",0x84ED],
- ["C98F",0x84EE],
- ["C990",0x84EF],
- ["DDFB",0x84F0],
- ["C991",0x84F1],
- ["C992",0x84F2],
- ["C993",0x84F3],
- ["C994",0x84F4],
- ["C995",0x84F5],
- ["C996",0x84F6],
- ["C997",0x84F7],
- ["C998",0x84F8],
- ["C999",0x84F9],
- ["C99A",0x84FA],
- ["C99B",0x84FB],
- ["DEA4",0x84FC],
- ["C99C",0x84FD],
- ["C99D",0x84FE],
- ["DEA3",0x84FF],
- ["C99E",0x8500],
- ["C99F",0x8501],
- ["C9A0",0x8502],
- ["CA40",0x8503],
- ["CA41",0x8504],
- ["CA42",0x8505],
- ["CA43",0x8506],
- ["CA44",0x8507],
- ["CA45",0x8508],
- ["CA46",0x8509],
- ["CA47",0x850A],
- ["CA48",0x850B],
- ["DDF8",0x850C],
- ["CA49",0x850D],
- ["CA4A",0x850E],
- ["CA4B",0x850F],
- ["CA4C",0x8510],
- ["C3EF",0x8511],
- ["CA4D",0x8512],
- ["C2FB",0x8513],
- ["CA4E",0x8514],
- ["CA4F",0x8515],
- ["CA50",0x8516],
- ["D5E1",0x8517],
- ["CA51",0x8518],
- ["CA52",0x8519],
- ["CEB5",0x851A],
- ["CA53",0x851B],
- ["CA54",0x851C],
- ["CA55",0x851D],
- ["CA56",0x851E],
- ["DDFD",0x851F],
- ["CA57",0x8520],
- ["B2CC",0x8521],
- ["CA58",0x8522],
- ["CA59",0x8523],
- ["CA5A",0x8524],
- ["CA5B",0x8525],
- ["CA5C",0x8526],
- ["CA5D",0x8527],
- ["CA5E",0x8528],
- ["CA5F",0x8529],
- ["CA60",0x852A],
- ["C4E8",0x852B],
- ["CADF",0x852C],
- ["CA61",0x852D],
- ["CA62",0x852E],
- ["CA63",0x852F],
- ["CA64",0x8530],
- ["CA65",0x8531],
- ["CA66",0x8532],
- ["CA67",0x8533],
- ["CA68",0x8534],
- ["CA69",0x8535],
- ["CA6A",0x8536],
- ["C7BE",0x8537],
- ["DDFA",0x8538],
- ["DDFC",0x8539],
- ["DDFE",0x853A],
- ["DEA2",0x853B],
- ["B0AA",0x853C],
- ["B1CE",0x853D],
- ["CA6B",0x853E],
- ["CA6C",0x853F],
- ["CA6D",0x8540],
- ["CA6E",0x8541],
- ["CA6F",0x8542],
- ["DEAC",0x8543],
- ["CA70",0x8544],
- ["CA71",0x8545],
- ["CA72",0x8546],
- ["CA73",0x8547],
- ["DEA6",0x8548],
- ["BDB6",0x8549],
- ["C8EF",0x854A],
- ["CA74",0x854B],
- ["CA75",0x854C],
- ["CA76",0x854D],
- ["CA77",0x854E],
- ["CA78",0x854F],
- ["CA79",0x8550],
- ["CA7A",0x8551],
- ["CA7B",0x8552],
- ["CA7C",0x8553],
- ["CA7D",0x8554],
- ["CA7E",0x8555],
- ["DEA1",0x8556],
- ["CA80",0x8557],
- ["CA81",0x8558],
- ["DEA5",0x8559],
- ["CA82",0x855A],
- ["CA83",0x855B],
- ["CA84",0x855C],
- ["CA85",0x855D],
- ["DEA9",0x855E],
- ["CA86",0x855F],
- ["CA87",0x8560],
- ["CA88",0x8561],
- ["CA89",0x8562],
- ["CA8A",0x8563],
- ["DEA8",0x8564],
- ["CA8B",0x8565],
- ["CA8C",0x8566],
- ["CA8D",0x8567],
- ["DEA7",0x8568],
- ["CA8E",0x8569],
- ["CA8F",0x856A],
- ["CA90",0x856B],
- ["CA91",0x856C],
- ["CA92",0x856D],
- ["CA93",0x856E],
- ["CA94",0x856F],
- ["CA95",0x8570],
- ["CA96",0x8571],
- ["DEAD",0x8572],
- ["CA97",0x8573],
- ["D4CC",0x8574],
- ["CA98",0x8575],
- ["CA99",0x8576],
- ["CA9A",0x8577],
- ["CA9B",0x8578],
- ["DEB3",0x8579],
- ["DEAA",0x857A],
- ["DEAE",0x857B],
- ["CA9C",0x857C],
- ["CA9D",0x857D],
- ["C0D9",0x857E],
- ["CA9E",0x857F],
- ["CA9F",0x8580],
- ["CAA0",0x8581],
- ["CB40",0x8582],
- ["CB41",0x8583],
- ["B1A1",0x8584],
- ["DEB6",0x8585],
- ["CB42",0x8586],
- ["DEB1",0x8587],
- ["CB43",0x8588],
- ["CB44",0x8589],
- ["CB45",0x858A],
- ["CB46",0x858B],
- ["CB47",0x858C],
- ["CB48",0x858D],
- ["CB49",0x858E],
- ["DEB2",0x858F],
- ["CB4A",0x8590],
- ["CB4B",0x8591],
- ["CB4C",0x8592],
- ["CB4D",0x8593],
- ["CB4E",0x8594],
- ["CB4F",0x8595],
- ["CB50",0x8596],
- ["CB51",0x8597],
- ["CB52",0x8598],
- ["CB53",0x8599],
- ["CB54",0x859A],
- ["D1A6",0x859B],
- ["DEB5",0x859C],
- ["CB55",0x859D],
- ["CB56",0x859E],
- ["CB57",0x859F],
- ["CB58",0x85A0],
- ["CB59",0x85A1],
- ["CB5A",0x85A2],
- ["CB5B",0x85A3],
- ["DEAF",0x85A4],
- ["CB5C",0x85A5],
- ["CB5D",0x85A6],
- ["CB5E",0x85A7],
- ["DEB0",0x85A8],
- ["CB5F",0x85A9],
- ["D0BD",0x85AA],
- ["CB60",0x85AB],
- ["CB61",0x85AC],
- ["CB62",0x85AD],
- ["DEB4",0x85AE],
- ["CAED",0x85AF],
- ["DEB9",0x85B0],
- ["CB63",0x85B1],
- ["CB64",0x85B2],
- ["CB65",0x85B3],
- ["CB66",0x85B4],
- ["CB67",0x85B5],
- ["CB68",0x85B6],
- ["DEB8",0x85B7],
- ["CB69",0x85B8],
- ["DEB7",0x85B9],
- ["CB6A",0x85BA],
- ["CB6B",0x85BB],
- ["CB6C",0x85BC],
- ["CB6D",0x85BD],
- ["CB6E",0x85BE],
- ["CB6F",0x85BF],
- ["CB70",0x85C0],
- ["DEBB",0x85C1],
- ["CB71",0x85C2],
- ["CB72",0x85C3],
- ["CB73",0x85C4],
- ["CB74",0x85C5],
- ["CB75",0x85C6],
- ["CB76",0x85C7],
- ["CB77",0x85C8],
- ["BDE5",0x85C9],
- ["CB78",0x85CA],
- ["CB79",0x85CB],
- ["CB7A",0x85CC],
- ["CB7B",0x85CD],
- ["CB7C",0x85CE],
- ["B2D8",0x85CF],
- ["C3EA",0x85D0],
- ["CB7D",0x85D1],
- ["CB7E",0x85D2],
- ["DEBA",0x85D3],
- ["CB80",0x85D4],
- ["C5BA",0x85D5],
- ["CB81",0x85D6],
- ["CB82",0x85D7],
- ["CB83",0x85D8],
- ["CB84",0x85D9],
- ["CB85",0x85DA],
- ["CB86",0x85DB],
- ["DEBC",0x85DC],
- ["CB87",0x85DD],
- ["CB88",0x85DE],
- ["CB89",0x85DF],
- ["CB8A",0x85E0],
- ["CB8B",0x85E1],
- ["CB8C",0x85E2],
- ["CB8D",0x85E3],
- ["CCD9",0x85E4],
- ["CB8E",0x85E5],
- ["CB8F",0x85E6],
- ["CB90",0x85E7],
- ["CB91",0x85E8],
- ["B7AA",0x85E9],
- ["CB92",0x85EA],
- ["CB93",0x85EB],
- ["CB94",0x85EC],
- ["CB95",0x85ED],
- ["CB96",0x85EE],
- ["CB97",0x85EF],
- ["CB98",0x85F0],
- ["CB99",0x85F1],
- ["CB9A",0x85F2],
- ["CB9B",0x85F3],
- ["CB9C",0x85F4],
- ["CB9D",0x85F5],
- ["CB9E",0x85F6],
- ["CB9F",0x85F7],
- ["CBA0",0x85F8],
- ["CC40",0x85F9],
- ["CC41",0x85FA],
- ["D4E5",0x85FB],
- ["CC42",0x85FC],
- ["CC43",0x85FD],
- ["CC44",0x85FE],
- ["DEBD",0x85FF],
- ["CC45",0x8600],
- ["CC46",0x8601],
- ["CC47",0x8602],
- ["CC48",0x8603],
- ["CC49",0x8604],
- ["DEBF",0x8605],
- ["CC4A",0x8606],
- ["CC4B",0x8607],
- ["CC4C",0x8608],
- ["CC4D",0x8609],
- ["CC4E",0x860A],
- ["CC4F",0x860B],
- ["CC50",0x860C],
- ["CC51",0x860D],
- ["CC52",0x860E],
- ["CC53",0x860F],
- ["CC54",0x8610],
- ["C4A2",0x8611],
- ["CC55",0x8612],
- ["CC56",0x8613],
- ["CC57",0x8614],
- ["CC58",0x8615],
- ["DEC1",0x8616],
- ["CC59",0x8617],
- ["CC5A",0x8618],
- ["CC5B",0x8619],
- ["CC5C",0x861A],
- ["CC5D",0x861B],
- ["CC5E",0x861C],
- ["CC5F",0x861D],
- ["CC60",0x861E],
- ["CC61",0x861F],
- ["CC62",0x8620],
- ["CC63",0x8621],
- ["CC64",0x8622],
- ["CC65",0x8623],
- ["CC66",0x8624],
- ["CC67",0x8625],
- ["CC68",0x8626],
- ["DEBE",0x8627],
- ["CC69",0x8628],
- ["DEC0",0x8629],
- ["CC6A",0x862A],
- ["CC6B",0x862B],
- ["CC6C",0x862C],
- ["CC6D",0x862D],
- ["CC6E",0x862E],
- ["CC6F",0x862F],
- ["CC70",0x8630],
- ["CC71",0x8631],
- ["CC72",0x8632],
- ["CC73",0x8633],
- ["CC74",0x8634],
- ["CC75",0x8635],
- ["CC76",0x8636],
- ["CC77",0x8637],
- ["D5BA",0x8638],
- ["CC78",0x8639],
- ["CC79",0x863A],
- ["CC7A",0x863B],
- ["DEC2",0x863C],
- ["CC7B",0x863D],
- ["CC7C",0x863E],
- ["CC7D",0x863F],
- ["CC7E",0x8640],
- ["CC80",0x8641],
- ["CC81",0x8642],
- ["CC82",0x8643],
- ["CC83",0x8644],
- ["CC84",0x8645],
- ["CC85",0x8646],
- ["CC86",0x8647],
- ["CC87",0x8648],
- ["CC88",0x8649],
- ["CC89",0x864A],
- ["CC8A",0x864B],
- ["CC8B",0x864C],
- ["F2AE",0x864D],
- ["BBA2",0x864E],
- ["C2B2",0x864F],
- ["C5B0",0x8650],
- ["C2C7",0x8651],
- ["CC8C",0x8652],
- ["CC8D",0x8653],
- ["F2AF",0x8654],
- ["CC8E",0x8655],
- ["CC8F",0x8656],
- ["CC90",0x8657],
- ["CC91",0x8658],
- ["CC92",0x8659],
- ["D0E9",0x865A],
- ["CC93",0x865B],
- ["CC94",0x865C],
- ["CC95",0x865D],
- ["D3DD",0x865E],
- ["CC96",0x865F],
- ["CC97",0x8660],
- ["CC98",0x8661],
- ["EBBD",0x8662],
- ["CC99",0x8663],
- ["CC9A",0x8664],
- ["CC9B",0x8665],
- ["CC9C",0x8666],
- ["CC9D",0x8667],
- ["CC9E",0x8668],
- ["CC9F",0x8669],
- ["CCA0",0x866A],
- ["B3E6",0x866B],
- ["F2B0",0x866C],
- ["CD40",0x866D],
- ["F2B1",0x866E],
- ["CD41",0x866F],
- ["CD42",0x8670],
- ["CAAD",0x8671],
- ["CD43",0x8672],
- ["CD44",0x8673],
- ["CD45",0x8674],
- ["CD46",0x8675],
- ["CD47",0x8676],
- ["CD48",0x8677],
- ["CD49",0x8678],
- ["BAE7",0x8679],
- ["F2B3",0x867A],
- ["F2B5",0x867B],
- ["F2B4",0x867C],
- ["CBE4",0x867D],
- ["CFBA",0x867E],
- ["F2B2",0x867F],
- ["CAB4",0x8680],
- ["D2CF",0x8681],
- ["C2EC",0x8682],
- ["CD4A",0x8683],
- ["CD4B",0x8684],
- ["CD4C",0x8685],
- ["CD4D",0x8686],
- ["CD4E",0x8687],
- ["CD4F",0x8688],
- ["CD50",0x8689],
- ["CEC3",0x868A],
- ["F2B8",0x868B],
- ["B0F6",0x868C],
- ["F2B7",0x868D],
- ["CD51",0x868E],
- ["CD52",0x868F],
- ["CD53",0x8690],
- ["CD54",0x8691],
- ["CD55",0x8692],
- ["F2BE",0x8693],
- ["CD56",0x8694],
- ["B2CF",0x8695],
- ["CD57",0x8696],
- ["CD58",0x8697],
- ["CD59",0x8698],
- ["CD5A",0x8699],
- ["CD5B",0x869A],
- ["CD5C",0x869B],
- ["D1C1",0x869C],
- ["F2BA",0x869D],
- ["CD5D",0x869E],
- ["CD5E",0x869F],
- ["CD5F",0x86A0],
- ["CD60",0x86A1],
- ["CD61",0x86A2],
- ["F2BC",0x86A3],
- ["D4E9",0x86A4],
- ["CD62",0x86A5],
- ["CD63",0x86A6],
- ["F2BB",0x86A7],
- ["F2B6",0x86A8],
- ["F2BF",0x86A9],
- ["F2BD",0x86AA],
- ["CD64",0x86AB],
- ["F2B9",0x86AC],
- ["CD65",0x86AD],
- ["CD66",0x86AE],
- ["F2C7",0x86AF],
- ["F2C4",0x86B0],
- ["F2C6",0x86B1],
- ["CD67",0x86B2],
- ["CD68",0x86B3],
- ["F2CA",0x86B4],
- ["F2C2",0x86B5],
- ["F2C0",0x86B6],
- ["CD69",0x86B7],
- ["CD6A",0x86B8],
- ["CD6B",0x86B9],
- ["F2C5",0x86BA],
- ["CD6C",0x86BB],
- ["CD6D",0x86BC],
- ["CD6E",0x86BD],
- ["CD6F",0x86BE],
- ["CD70",0x86BF],
- ["D6FB",0x86C0],
- ["CD71",0x86C1],
- ["CD72",0x86C2],
- ["CD73",0x86C3],
- ["F2C1",0x86C4],
- ["CD74",0x86C5],
- ["C7F9",0x86C6],
- ["C9DF",0x86C7],
- ["CD75",0x86C8],
- ["F2C8",0x86C9],
- ["B9C6",0x86CA],
- ["B5B0",0x86CB],
- ["CD76",0x86CC],
- ["CD77",0x86CD],
- ["F2C3",0x86CE],
- ["F2C9",0x86CF],
- ["F2D0",0x86D0],
- ["F2D6",0x86D1],
- ["CD78",0x86D2],
- ["CD79",0x86D3],
- ["BBD7",0x86D4],
- ["CD7A",0x86D5],
- ["CD7B",0x86D6],
- ["CD7C",0x86D7],
- ["F2D5",0x86D8],
- ["CDDC",0x86D9],
- ["CD7D",0x86DA],
- ["D6EB",0x86DB],
- ["CD7E",0x86DC],
- ["CD80",0x86DD],
- ["F2D2",0x86DE],
- ["F2D4",0x86DF],
- ["CD81",0x86E0],
- ["CD82",0x86E1],
- ["CD83",0x86E2],
- ["CD84",0x86E3],
- ["B8F2",0x86E4],
- ["CD85",0x86E5],
- ["CD86",0x86E6],
- ["CD87",0x86E7],
- ["CD88",0x86E8],
- ["F2CB",0x86E9],
- ["CD89",0x86EA],
- ["CD8A",0x86EB],
- ["CD8B",0x86EC],
- ["F2CE",0x86ED],
- ["C2F9",0x86EE],
- ["CD8C",0x86EF],
- ["D5DD",0x86F0],
- ["F2CC",0x86F1],
- ["F2CD",0x86F2],
- ["F2CF",0x86F3],
- ["F2D3",0x86F4],
- ["CD8D",0x86F5],
- ["CD8E",0x86F6],
- ["CD8F",0x86F7],
- ["F2D9",0x86F8],
- ["D3BC",0x86F9],
- ["CD90",0x86FA],
- ["CD91",0x86FB],
- ["CD92",0x86FC],
- ["CD93",0x86FD],
- ["B6EA",0x86FE],
- ["CD94",0x86FF],
- ["CAF1",0x8700],
- ["CD95",0x8701],
- ["B7E4",0x8702],
- ["F2D7",0x8703],
- ["CD96",0x8704],
- ["CD97",0x8705],
- ["CD98",0x8706],
- ["F2D8",0x8707],
- ["F2DA",0x8708],
- ["F2DD",0x8709],
- ["F2DB",0x870A],
- ["CD99",0x870B],
- ["CD9A",0x870C],
- ["F2DC",0x870D],
- ["CD9B",0x870E],
- ["CD9C",0x870F],
- ["CD9D",0x8710],
- ["CD9E",0x8711],
- ["D1D1",0x8712],
- ["F2D1",0x8713],
- ["CD9F",0x8714],
- ["CDC9",0x8715],
- ["CDA0",0x8716],
- ["CECF",0x8717],
- ["D6A9",0x8718],
- ["CE40",0x8719],
- ["F2E3",0x871A],
- ["CE41",0x871B],
- ["C3DB",0x871C],
- ["CE42",0x871D],
- ["F2E0",0x871E],
- ["CE43",0x871F],
- ["CE44",0x8720],
- ["C0AF",0x8721],
- ["F2EC",0x8722],
- ["F2DE",0x8723],
- ["CE45",0x8724],
- ["F2E1",0x8725],
- ["CE46",0x8726],
- ["CE47",0x8727],
- ["CE48",0x8728],
- ["F2E8",0x8729],
- ["CE49",0x872A],
- ["CE4A",0x872B],
- ["CE4B",0x872C],
- ["CE4C",0x872D],
- ["F2E2",0x872E],
- ["CE4D",0x872F],
- ["CE4E",0x8730],
- ["F2E7",0x8731],
- ["CE4F",0x8732],
- ["CE50",0x8733],
- ["F2E6",0x8734],
- ["CE51",0x8735],
- ["CE52",0x8736],
- ["F2E9",0x8737],
- ["CE53",0x8738],
- ["CE54",0x8739],
- ["CE55",0x873A],
- ["F2DF",0x873B],
- ["CE56",0x873C],
- ["CE57",0x873D],
- ["F2E4",0x873E],
- ["F2EA",0x873F],
- ["CE58",0x8740],
- ["CE59",0x8741],
- ["CE5A",0x8742],
- ["CE5B",0x8743],
- ["CE5C",0x8744],
- ["CE5D",0x8745],
- ["CE5E",0x8746],
- ["D3AC",0x8747],
- ["F2E5",0x8748],
- ["B2F5",0x8749],
- ["CE5F",0x874A],
- ["CE60",0x874B],
- ["F2F2",0x874C],
- ["CE61",0x874D],
- ["D0AB",0x874E],
- ["CE62",0x874F],
- ["CE63",0x8750],
- ["CE64",0x8751],
- ["CE65",0x8752],
- ["F2F5",0x8753],
- ["CE66",0x8754],
- ["CE67",0x8755],
- ["CE68",0x8756],
- ["BBC8",0x8757],
- ["CE69",0x8758],
- ["F2F9",0x8759],
- ["CE6A",0x875A],
- ["CE6B",0x875B],
- ["CE6C",0x875C],
- ["CE6D",0x875D],
- ["CE6E",0x875E],
- ["CE6F",0x875F],
- ["F2F0",0x8760],
- ["CE70",0x8761],
- ["CE71",0x8762],
- ["F2F6",0x8763],
- ["F2F8",0x8764],
- ["F2FA",0x8765],
- ["CE72",0x8766],
- ["CE73",0x8767],
- ["CE74",0x8768],
- ["CE75",0x8769],
- ["CE76",0x876A],
- ["CE77",0x876B],
- ["CE78",0x876C],
- ["CE79",0x876D],
- ["F2F3",0x876E],
- ["CE7A",0x876F],
- ["F2F1",0x8770],
- ["CE7B",0x8771],
- ["CE7C",0x8772],
- ["CE7D",0x8773],
- ["BAFB",0x8774],
- ["CE7E",0x8775],
- ["B5FB",0x8776],
- ["CE80",0x8777],
- ["CE81",0x8778],
- ["CE82",0x8779],
- ["CE83",0x877A],
- ["F2EF",0x877B],
- ["F2F7",0x877C],
- ["F2ED",0x877D],
- ["F2EE",0x877E],
- ["CE84",0x877F],
- ["CE85",0x8780],
- ["CE86",0x8781],
- ["F2EB",0x8782],
- ["F3A6",0x8783],
- ["CE87",0x8784],
- ["F3A3",0x8785],
- ["CE88",0x8786],
- ["CE89",0x8787],
- ["F3A2",0x8788],
- ["CE8A",0x8789],
- ["CE8B",0x878A],
- ["F2F4",0x878B],
- ["CE8C",0x878C],
- ["C8DA",0x878D],
- ["CE8D",0x878E],
- ["CE8E",0x878F],
- ["CE8F",0x8790],
- ["CE90",0x8791],
- ["CE91",0x8792],
- ["F2FB",0x8793],
- ["CE92",0x8794],
- ["CE93",0x8795],
- ["CE94",0x8796],
- ["F3A5",0x8797],
- ["CE95",0x8798],
- ["CE96",0x8799],
- ["CE97",0x879A],
- ["CE98",0x879B],
- ["CE99",0x879C],
- ["CE9A",0x879D],
- ["CE9B",0x879E],
- ["C3F8",0x879F],
- ["CE9C",0x87A0],
- ["CE9D",0x87A1],
- ["CE9E",0x87A2],
- ["CE9F",0x87A3],
- ["CEA0",0x87A4],
- ["CF40",0x87A5],
- ["CF41",0x87A6],
- ["CF42",0x87A7],
- ["F2FD",0x87A8],
- ["CF43",0x87A9],
- ["CF44",0x87AA],
- ["F3A7",0x87AB],
- ["F3A9",0x87AC],
- ["F3A4",0x87AD],
- ["CF45",0x87AE],
- ["F2FC",0x87AF],
- ["CF46",0x87B0],
- ["CF47",0x87B1],
- ["CF48",0x87B2],
- ["F3AB",0x87B3],
- ["CF49",0x87B4],
- ["F3AA",0x87B5],
- ["CF4A",0x87B6],
- ["CF4B",0x87B7],
- ["CF4C",0x87B8],
- ["CF4D",0x87B9],
- ["C2DD",0x87BA],
- ["CF4E",0x87BB],
- ["CF4F",0x87BC],
- ["F3AE",0x87BD],
- ["CF50",0x87BE],
- ["CF51",0x87BF],
- ["F3B0",0x87C0],
- ["CF52",0x87C1],
- ["CF53",0x87C2],
- ["CF54",0x87C3],
- ["CF55",0x87C4],
- ["CF56",0x87C5],
- ["F3A1",0x87C6],
- ["CF57",0x87C7],
- ["CF58",0x87C8],
- ["CF59",0x87C9],
- ["F3B1",0x87CA],
- ["F3AC",0x87CB],
- ["CF5A",0x87CC],
- ["CF5B",0x87CD],
- ["CF5C",0x87CE],
- ["CF5D",0x87CF],
- ["CF5E",0x87D0],
- ["F3AF",0x87D1],
- ["F2FE",0x87D2],
- ["F3AD",0x87D3],
- ["CF5F",0x87D4],
- ["CF60",0x87D5],
- ["CF61",0x87D6],
- ["CF62",0x87D7],
- ["CF63",0x87D8],
- ["CF64",0x87D9],
- ["CF65",0x87DA],
- ["F3B2",0x87DB],
- ["CF66",0x87DC],
- ["CF67",0x87DD],
- ["CF68",0x87DE],
- ["CF69",0x87DF],
- ["F3B4",0x87E0],
- ["CF6A",0x87E1],
- ["CF6B",0x87E2],
- ["CF6C",0x87E3],
- ["CF6D",0x87E4],
- ["F3A8",0x87E5],
- ["CF6E",0x87E6],
- ["CF6F",0x87E7],
- ["CF70",0x87E8],
- ["CF71",0x87E9],
- ["F3B3",0x87EA],
- ["CF72",0x87EB],
- ["CF73",0x87EC],
- ["CF74",0x87ED],
- ["F3B5",0x87EE],
- ["CF75",0x87EF],
- ["CF76",0x87F0],
- ["CF77",0x87F1],
- ["CF78",0x87F2],
- ["CF79",0x87F3],
- ["CF7A",0x87F4],
- ["CF7B",0x87F5],
- ["CF7C",0x87F6],
- ["CF7D",0x87F7],
- ["CF7E",0x87F8],
- ["D0B7",0x87F9],
- ["CF80",0x87FA],
- ["CF81",0x87FB],
- ["CF82",0x87FC],
- ["CF83",0x87FD],
- ["F3B8",0x87FE],
- ["CF84",0x87FF],
- ["CF85",0x8800],
- ["CF86",0x8801],
- ["CF87",0x8802],
- ["D9F9",0x8803],
- ["CF88",0x8804],
- ["CF89",0x8805],
- ["CF8A",0x8806],
- ["CF8B",0x8807],
- ["CF8C",0x8808],
- ["CF8D",0x8809],
- ["F3B9",0x880A],
- ["CF8E",0x880B],
- ["CF8F",0x880C],
- ["CF90",0x880D],
- ["CF91",0x880E],
- ["CF92",0x880F],
- ["CF93",0x8810],
- ["CF94",0x8811],
- ["CF95",0x8812],
- ["F3B7",0x8813],
- ["CF96",0x8814],
- ["C8E4",0x8815],
- ["F3B6",0x8816],
- ["CF97",0x8817],
- ["CF98",0x8818],
- ["CF99",0x8819],
- ["CF9A",0x881A],
- ["F3BA",0x881B],
- ["CF9B",0x881C],
- ["CF9C",0x881D],
- ["CF9D",0x881E],
- ["CF9E",0x881F],
- ["CF9F",0x8820],
- ["F3BB",0x8821],
- ["B4C0",0x8822],
- ["CFA0",0x8823],
- ["D040",0x8824],
- ["D041",0x8825],
- ["D042",0x8826],
- ["D043",0x8827],
- ["D044",0x8828],
- ["D045",0x8829],
- ["D046",0x882A],
- ["D047",0x882B],
- ["D048",0x882C],
- ["D049",0x882D],
- ["D04A",0x882E],
- ["D04B",0x882F],
- ["D04C",0x8830],
- ["D04D",0x8831],
- ["EEC3",0x8832],
- ["D04E",0x8833],
- ["D04F",0x8834],
- ["D050",0x8835],
- ["D051",0x8836],
- ["D052",0x8837],
- ["D053",0x8838],
- ["F3BC",0x8839],
- ["D054",0x883A],
- ["D055",0x883B],
- ["F3BD",0x883C],
- ["D056",0x883D],
- ["D057",0x883E],
- ["D058",0x883F],
- ["D1AA",0x8840],
- ["D059",0x8841],
- ["D05A",0x8842],
- ["D05B",0x8843],
- ["F4AC",0x8844],
- ["D0C6",0x8845],
- ["D05C",0x8846],
- ["D05D",0x8847],
- ["D05E",0x8848],
- ["D05F",0x8849],
- ["D060",0x884A],
- ["D061",0x884B],
- ["D0D0",0x884C],
- ["D1DC",0x884D],
- ["D062",0x884E],
- ["D063",0x884F],
- ["D064",0x8850],
- ["D065",0x8851],
- ["D066",0x8852],
- ["D067",0x8853],
- ["CFCE",0x8854],
- ["D068",0x8855],
- ["D069",0x8856],
- ["BDD6",0x8857],
- ["D06A",0x8858],
- ["D1C3",0x8859],
- ["D06B",0x885A],
- ["D06C",0x885B],
- ["D06D",0x885C],
- ["D06E",0x885D],
- ["D06F",0x885E],
- ["D070",0x885F],
- ["D071",0x8860],
- ["BAE2",0x8861],
- ["E1E9",0x8862],
- ["D2C2",0x8863],
- ["F1C2",0x8864],
- ["B2B9",0x8865],
- ["D072",0x8866],
- ["D073",0x8867],
- ["B1ED",0x8868],
- ["F1C3",0x8869],
- ["D074",0x886A],
- ["C9C0",0x886B],
- ["B3C4",0x886C],
- ["D075",0x886D],
- ["D9F2",0x886E],
- ["D076",0x886F],
- ["CBA5",0x8870],
- ["D077",0x8871],
- ["F1C4",0x8872],
- ["D078",0x8873],
- ["D079",0x8874],
- ["D07A",0x8875],
- ["D07B",0x8876],
- ["D6D4",0x8877],
- ["D07C",0x8878],
- ["D07D",0x8879],
- ["D07E",0x887A],
- ["D080",0x887B],
- ["D081",0x887C],
- ["F1C5",0x887D],
- ["F4C0",0x887E],
- ["F1C6",0x887F],
- ["D082",0x8880],
- ["D4AC",0x8881],
- ["F1C7",0x8882],
- ["D083",0x8883],
- ["B0C0",0x8884],
- ["F4C1",0x8885],
- ["D084",0x8886],
- ["D085",0x8887],
- ["F4C2",0x8888],
- ["D086",0x8889],
- ["D087",0x888A],
- ["B4FC",0x888B],
- ["D088",0x888C],
- ["C5DB",0x888D],
- ["D089",0x888E],
- ["D08A",0x888F],
- ["D08B",0x8890],
- ["D08C",0x8891],
- ["CCBB",0x8892],
- ["D08D",0x8893],
- ["D08E",0x8894],
- ["D08F",0x8895],
- ["D0E4",0x8896],
- ["D090",0x8897],
- ["D091",0x8898],
- ["D092",0x8899],
- ["D093",0x889A],
- ["D094",0x889B],
- ["CDE0",0x889C],
- ["D095",0x889D],
- ["D096",0x889E],
- ["D097",0x889F],
- ["D098",0x88A0],
- ["D099",0x88A1],
- ["F1C8",0x88A2],
- ["D09A",0x88A3],
- ["D9F3",0x88A4],
- ["D09B",0x88A5],
- ["D09C",0x88A6],
- ["D09D",0x88A7],
- ["D09E",0x88A8],
- ["D09F",0x88A9],
- ["D0A0",0x88AA],
- ["B1BB",0x88AB],
- ["D140",0x88AC],
- ["CFAE",0x88AD],
- ["D141",0x88AE],
- ["D142",0x88AF],
- ["D143",0x88B0],
- ["B8A4",0x88B1],
- ["D144",0x88B2],
- ["D145",0x88B3],
- ["D146",0x88B4],
- ["D147",0x88B5],
- ["D148",0x88B6],
- ["F1CA",0x88B7],
- ["D149",0x88B8],
- ["D14A",0x88B9],
- ["D14B",0x88BA],
- ["D14C",0x88BB],
- ["F1CB",0x88BC],
- ["D14D",0x88BD],
- ["D14E",0x88BE],
- ["D14F",0x88BF],
- ["D150",0x88C0],
- ["B2C3",0x88C1],
- ["C1D1",0x88C2],
- ["D151",0x88C3],
- ["D152",0x88C4],
- ["D7B0",0x88C5],
- ["F1C9",0x88C6],
- ["D153",0x88C7],
- ["D154",0x88C8],
- ["F1CC",0x88C9],
- ["D155",0x88CA],
- ["D156",0x88CB],
- ["D157",0x88CC],
- ["D158",0x88CD],
- ["F1CE",0x88CE],
- ["D159",0x88CF],
- ["D15A",0x88D0],
- ["D15B",0x88D1],
- ["D9F6",0x88D2],
- ["D15C",0x88D3],
- ["D2E1",0x88D4],
- ["D4A3",0x88D5],
- ["D15D",0x88D6],
- ["D15E",0x88D7],
- ["F4C3",0x88D8],
- ["C8B9",0x88D9],
- ["D15F",0x88DA],
- ["D160",0x88DB],
- ["D161",0x88DC],
- ["D162",0x88DD],
- ["D163",0x88DE],
- ["F4C4",0x88DF],
- ["D164",0x88E0],
- ["D165",0x88E1],
- ["F1CD",0x88E2],
- ["F1CF",0x88E3],
- ["BFE3",0x88E4],
- ["F1D0",0x88E5],
- ["D166",0x88E6],
- ["D167",0x88E7],
- ["F1D4",0x88E8],
- ["D168",0x88E9],
- ["D169",0x88EA],
- ["D16A",0x88EB],
- ["D16B",0x88EC],
- ["D16C",0x88ED],
- ["D16D",0x88EE],
- ["D16E",0x88EF],
- ["F1D6",0x88F0],
- ["F1D1",0x88F1],
- ["D16F",0x88F2],
- ["C9D1",0x88F3],
- ["C5E1",0x88F4],
- ["D170",0x88F5],
- ["D171",0x88F6],
- ["D172",0x88F7],
- ["C2E3",0x88F8],
- ["B9FC",0x88F9],
- ["D173",0x88FA],
- ["D174",0x88FB],
- ["F1D3",0x88FC],
- ["D175",0x88FD],
- ["F1D5",0x88FE],
- ["D176",0x88FF],
- ["D177",0x8900],
- ["D178",0x8901],
- ["B9D3",0x8902],
- ["D179",0x8903],
- ["D17A",0x8904],
- ["D17B",0x8905],
- ["D17C",0x8906],
- ["D17D",0x8907],
- ["D17E",0x8908],
- ["D180",0x8909],
- ["F1DB",0x890A],
- ["D181",0x890B],
- ["D182",0x890C],
- ["D183",0x890D],
- ["D184",0x890E],
- ["D185",0x890F],
- ["BAD6",0x8910],
- ["D186",0x8911],
- ["B0FD",0x8912],
- ["F1D9",0x8913],
- ["D187",0x8914],
- ["D188",0x8915],
- ["D189",0x8916],
- ["D18A",0x8917],
- ["D18B",0x8918],
- ["F1D8",0x8919],
- ["F1D2",0x891A],
- ["F1DA",0x891B],
- ["D18C",0x891C],
- ["D18D",0x891D],
- ["D18E",0x891E],
- ["D18F",0x891F],
- ["D190",0x8920],
- ["F1D7",0x8921],
- ["D191",0x8922],
- ["D192",0x8923],
- ["D193",0x8924],
- ["C8EC",0x8925],
- ["D194",0x8926],
- ["D195",0x8927],
- ["D196",0x8928],
- ["D197",0x8929],
- ["CDCA",0x892A],
- ["F1DD",0x892B],
- ["D198",0x892C],
- ["D199",0x892D],
- ["D19A",0x892E],
- ["D19B",0x892F],
- ["E5BD",0x8930],
- ["D19C",0x8931],
- ["D19D",0x8932],
- ["D19E",0x8933],
- ["F1DC",0x8934],
- ["D19F",0x8935],
- ["F1DE",0x8936],
- ["D1A0",0x8937],
- ["D240",0x8938],
- ["D241",0x8939],
- ["D242",0x893A],
- ["D243",0x893B],
- ["D244",0x893C],
- ["D245",0x893D],
- ["D246",0x893E],
- ["D247",0x893F],
- ["D248",0x8940],
- ["F1DF",0x8941],
- ["D249",0x8942],
- ["D24A",0x8943],
- ["CFE5",0x8944],
- ["D24B",0x8945],
- ["D24C",0x8946],
- ["D24D",0x8947],
- ["D24E",0x8948],
- ["D24F",0x8949],
- ["D250",0x894A],
- ["D251",0x894B],
- ["D252",0x894C],
- ["D253",0x894D],
- ["D254",0x894E],
- ["D255",0x894F],
- ["D256",0x8950],
- ["D257",0x8951],
- ["D258",0x8952],
- ["D259",0x8953],
- ["D25A",0x8954],
- ["D25B",0x8955],
- ["D25C",0x8956],
- ["D25D",0x8957],
- ["D25E",0x8958],
- ["D25F",0x8959],
- ["D260",0x895A],
- ["D261",0x895B],
- ["D262",0x895C],
- ["D263",0x895D],
- ["F4C5",0x895E],
- ["BDF3",0x895F],
- ["D264",0x8960],
- ["D265",0x8961],
- ["D266",0x8962],
- ["D267",0x8963],
- ["D268",0x8964],
- ["D269",0x8965],
- ["F1E0",0x8966],
- ["D26A",0x8967],
- ["D26B",0x8968],
- ["D26C",0x8969],
- ["D26D",0x896A],
- ["D26E",0x896B],
- ["D26F",0x896C],
- ["D270",0x896D],
- ["D271",0x896E],
- ["D272",0x896F],
- ["D273",0x8970],
- ["D274",0x8971],
- ["D275",0x8972],
- ["D276",0x8973],
- ["D277",0x8974],
- ["D278",0x8975],
- ["D279",0x8976],
- ["D27A",0x8977],
- ["D27B",0x8978],
- ["D27C",0x8979],
- ["D27D",0x897A],
- ["F1E1",0x897B],
- ["D27E",0x897C],
- ["D280",0x897D],
- ["D281",0x897E],
- ["CEF7",0x897F],
- ["D282",0x8980],
- ["D2AA",0x8981],
- ["D283",0x8982],
- ["F1FB",0x8983],
- ["D284",0x8984],
- ["D285",0x8985],
- ["B8B2",0x8986],
- ["D286",0x8987],
- ["D287",0x8988],
- ["D288",0x8989],
- ["D289",0x898A],
- ["D28A",0x898B],
- ["D28B",0x898C],
- ["D28C",0x898D],
- ["D28D",0x898E],
- ["D28E",0x898F],
- ["D28F",0x8990],
- ["D290",0x8991],
- ["D291",0x8992],
- ["D292",0x8993],
- ["D293",0x8994],
- ["D294",0x8995],
- ["D295",0x8996],
- ["D296",0x8997],
- ["D297",0x8998],
- ["D298",0x8999],
- ["D299",0x899A],
- ["D29A",0x899B],
- ["D29B",0x899C],
- ["D29C",0x899D],
- ["D29D",0x899E],
- ["D29E",0x899F],
- ["D29F",0x89A0],
- ["D2A0",0x89A1],
- ["D340",0x89A2],
- ["D341",0x89A3],
- ["D342",0x89A4],
- ["D343",0x89A5],
- ["D344",0x89A6],
- ["D345",0x89A7],
- ["D346",0x89A8],
- ["D347",0x89A9],
- ["D348",0x89AA],
- ["D349",0x89AB],
- ["D34A",0x89AC],
- ["D34B",0x89AD],
- ["D34C",0x89AE],
- ["D34D",0x89AF],
- ["D34E",0x89B0],
- ["D34F",0x89B1],
- ["D350",0x89B2],
- ["D351",0x89B3],
- ["D352",0x89B4],
- ["D353",0x89B5],
- ["D354",0x89B6],
- ["D355",0x89B7],
- ["D356",0x89B8],
- ["D357",0x89B9],
- ["D358",0x89BA],
- ["D359",0x89BB],
- ["D35A",0x89BC],
- ["D35B",0x89BD],
- ["D35C",0x89BE],
- ["D35D",0x89BF],
- ["D35E",0x89C0],
- ["BCFB",0x89C1],
- ["B9DB",0x89C2],
- ["D35F",0x89C3],
- ["B9E6",0x89C4],
- ["C3D9",0x89C5],
- ["CAD3",0x89C6],
- ["EAE8",0x89C7],
- ["C0C0",0x89C8],
- ["BEF5",0x89C9],
- ["EAE9",0x89CA],
- ["EAEA",0x89CB],
- ["EAEB",0x89CC],
- ["D360",0x89CD],
- ["EAEC",0x89CE],
- ["EAED",0x89CF],
- ["EAEE",0x89D0],
- ["EAEF",0x89D1],
- ["BDC7",0x89D2],
- ["D361",0x89D3],
- ["D362",0x89D4],
- ["D363",0x89D5],
- ["F5FB",0x89D6],
- ["D364",0x89D7],
- ["D365",0x89D8],
- ["D366",0x89D9],
- ["F5FD",0x89DA],
- ["D367",0x89DB],
- ["F5FE",0x89DC],
- ["D368",0x89DD],
- ["F5FC",0x89DE],
- ["D369",0x89DF],
- ["D36A",0x89E0],
- ["D36B",0x89E1],
- ["D36C",0x89E2],
- ["BDE2",0x89E3],
- ["D36D",0x89E4],
- ["F6A1",0x89E5],
- ["B4A5",0x89E6],
- ["D36E",0x89E7],
- ["D36F",0x89E8],
- ["D370",0x89E9],
- ["D371",0x89EA],
- ["F6A2",0x89EB],
- ["D372",0x89EC],
- ["D373",0x89ED],
- ["D374",0x89EE],
- ["F6A3",0x89EF],
- ["D375",0x89F0],
- ["D376",0x89F1],
- ["D377",0x89F2],
- ["ECB2",0x89F3],
- ["D378",0x89F4],
- ["D379",0x89F5],
- ["D37A",0x89F6],
- ["D37B",0x89F7],
- ["D37C",0x89F8],
- ["D37D",0x89F9],
- ["D37E",0x89FA],
- ["D380",0x89FB],
- ["D381",0x89FC],
- ["D382",0x89FD],
- ["D383",0x89FE],
- ["D384",0x89FF],
- ["D1D4",0x8A00],
- ["D385",0x8A01],
- ["D386",0x8A02],
- ["D387",0x8A03],
- ["D388",0x8A04],
- ["D389",0x8A05],
- ["D38A",0x8A06],
- ["D9EA",0x8A07],
- ["D38B",0x8A08],
- ["D38C",0x8A09],
- ["D38D",0x8A0A],
- ["D38E",0x8A0B],
- ["D38F",0x8A0C],
- ["D390",0x8A0D],
- ["D391",0x8A0E],
- ["D392",0x8A0F],
- ["D393",0x8A10],
- ["D394",0x8A11],
- ["D395",0x8A12],
- ["D396",0x8A13],
- ["D397",0x8A14],
- ["D398",0x8A15],
- ["D399",0x8A16],
- ["D39A",0x8A17],
- ["D39B",0x8A18],
- ["D39C",0x8A19],
- ["D39D",0x8A1A],
- ["D39E",0x8A1B],
- ["D39F",0x8A1C],
- ["D3A0",0x8A1D],
- ["D440",0x8A1E],
- ["D441",0x8A1F],
- ["D442",0x8A20],
- ["D443",0x8A21],
- ["D444",0x8A22],
- ["D445",0x8A23],
- ["D446",0x8A24],
- ["D447",0x8A25],
- ["D448",0x8A26],
- ["D449",0x8A27],
- ["D44A",0x8A28],
- ["D44B",0x8A29],
- ["D44C",0x8A2A],
- ["D44D",0x8A2B],
- ["D44E",0x8A2C],
- ["D44F",0x8A2D],
- ["D450",0x8A2E],
- ["D451",0x8A2F],
- ["D452",0x8A30],
- ["D453",0x8A31],
- ["D454",0x8A32],
- ["D455",0x8A33],
- ["D456",0x8A34],
- ["D457",0x8A35],
- ["D458",0x8A36],
- ["D459",0x8A37],
- ["D45A",0x8A38],
- ["D45B",0x8A39],
- ["D45C",0x8A3A],
- ["D45D",0x8A3B],
- ["D45E",0x8A3C],
- ["D45F",0x8A3D],
- ["F6A4",0x8A3E],
- ["D460",0x8A3F],
- ["D461",0x8A40],
- ["D462",0x8A41],
- ["D463",0x8A42],
- ["D464",0x8A43],
- ["D465",0x8A44],
- ["D466",0x8A45],
- ["D467",0x8A46],
- ["D468",0x8A47],
- ["EEBA",0x8A48],
- ["D469",0x8A49],
- ["D46A",0x8A4A],
- ["D46B",0x8A4B],
- ["D46C",0x8A4C],
- ["D46D",0x8A4D],
- ["D46E",0x8A4E],
- ["D46F",0x8A4F],
- ["D470",0x8A50],
- ["D471",0x8A51],
- ["D472",0x8A52],
- ["D473",0x8A53],
- ["D474",0x8A54],
- ["D475",0x8A55],
- ["D476",0x8A56],
- ["D477",0x8A57],
- ["D478",0x8A58],
- ["D479",0x8A59],
- ["D47A",0x8A5A],
- ["D47B",0x8A5B],
- ["D47C",0x8A5C],
- ["D47D",0x8A5D],
- ["D47E",0x8A5E],
- ["D480",0x8A5F],
- ["D481",0x8A60],
- ["D482",0x8A61],
- ["D483",0x8A62],
- ["D484",0x8A63],
- ["D485",0x8A64],
- ["D486",0x8A65],
- ["D487",0x8A66],
- ["D488",0x8A67],
- ["D489",0x8A68],
- ["D48A",0x8A69],
- ["D48B",0x8A6A],
- ["D48C",0x8A6B],
- ["D48D",0x8A6C],
- ["D48E",0x8A6D],
- ["D48F",0x8A6E],
- ["D490",0x8A6F],
- ["D491",0x8A70],
- ["D492",0x8A71],
- ["D493",0x8A72],
- ["D494",0x8A73],
- ["D495",0x8A74],
- ["D496",0x8A75],
- ["D497",0x8A76],
- ["D498",0x8A77],
- ["D499",0x8A78],
- ["D5B2",0x8A79],
- ["D49A",0x8A7A],
- ["D49B",0x8A7B],
- ["D49C",0x8A7C],
- ["D49D",0x8A7D],
- ["D49E",0x8A7E],
- ["D49F",0x8A7F],
- ["D4A0",0x8A80],
- ["D540",0x8A81],
- ["D541",0x8A82],
- ["D542",0x8A83],
- ["D543",0x8A84],
- ["D544",0x8A85],
- ["D545",0x8A86],
- ["D546",0x8A87],
- ["D547",0x8A88],
- ["D3FE",0x8A89],
- ["CCDC",0x8A8A],
- ["D548",0x8A8B],
- ["D549",0x8A8C],
- ["D54A",0x8A8D],
- ["D54B",0x8A8E],
- ["D54C",0x8A8F],
- ["D54D",0x8A90],
- ["D54E",0x8A91],
- ["D54F",0x8A92],
- ["CAC4",0x8A93],
- ["D550",0x8A94],
- ["D551",0x8A95],
- ["D552",0x8A96],
- ["D553",0x8A97],
- ["D554",0x8A98],
- ["D555",0x8A99],
- ["D556",0x8A9A],
- ["D557",0x8A9B],
- ["D558",0x8A9C],
- ["D559",0x8A9D],
- ["D55A",0x8A9E],
- ["D55B",0x8A9F],
- ["D55C",0x8AA0],
- ["D55D",0x8AA1],
- ["D55E",0x8AA2],
- ["D55F",0x8AA3],
- ["D560",0x8AA4],
- ["D561",0x8AA5],
- ["D562",0x8AA6],
- ["D563",0x8AA7],
- ["D564",0x8AA8],
- ["D565",0x8AA9],
- ["D566",0x8AAA],
- ["D567",0x8AAB],
- ["D568",0x8AAC],
- ["D569",0x8AAD],
- ["D56A",0x8AAE],
- ["D56B",0x8AAF],
- ["D56C",0x8AB0],
- ["D56D",0x8AB1],
- ["D56E",0x8AB2],
- ["D56F",0x8AB3],
- ["D570",0x8AB4],
- ["D571",0x8AB5],
- ["D572",0x8AB6],
- ["D573",0x8AB7],
- ["D574",0x8AB8],
- ["D575",0x8AB9],
- ["D576",0x8ABA],
- ["D577",0x8ABB],
- ["D578",0x8ABC],
- ["D579",0x8ABD],
- ["D57A",0x8ABE],
- ["D57B",0x8ABF],
- ["D57C",0x8AC0],
- ["D57D",0x8AC1],
- ["D57E",0x8AC2],
- ["D580",0x8AC3],
- ["D581",0x8AC4],
- ["D582",0x8AC5],
- ["D583",0x8AC6],
- ["D584",0x8AC7],
- ["D585",0x8AC8],
- ["D586",0x8AC9],
- ["D587",0x8ACA],
- ["D588",0x8ACB],
- ["D589",0x8ACC],
- ["D58A",0x8ACD],
- ["D58B",0x8ACE],
- ["D58C",0x8ACF],
- ["D58D",0x8AD0],
- ["D58E",0x8AD1],
- ["D58F",0x8AD2],
- ["D590",0x8AD3],
- ["D591",0x8AD4],
- ["D592",0x8AD5],
- ["D593",0x8AD6],
- ["D594",0x8AD7],
- ["D595",0x8AD8],
- ["D596",0x8AD9],
- ["D597",0x8ADA],
- ["D598",0x8ADB],
- ["D599",0x8ADC],
- ["D59A",0x8ADD],
- ["D59B",0x8ADE],
- ["D59C",0x8ADF],
- ["D59D",0x8AE0],
- ["D59E",0x8AE1],
- ["D59F",0x8AE2],
- ["D5A0",0x8AE3],
- ["D640",0x8AE4],
- ["D641",0x8AE5],
- ["D642",0x8AE6],
- ["D643",0x8AE7],
- ["D644",0x8AE8],
- ["D645",0x8AE9],
- ["D646",0x8AEA],
- ["D647",0x8AEB],
- ["D648",0x8AEC],
- ["D649",0x8AED],
- ["D64A",0x8AEE],
- ["D64B",0x8AEF],
- ["D64C",0x8AF0],
- ["D64D",0x8AF1],
- ["D64E",0x8AF2],
- ["D64F",0x8AF3],
- ["D650",0x8AF4],
- ["D651",0x8AF5],
- ["D652",0x8AF6],
- ["D653",0x8AF7],
- ["D654",0x8AF8],
- ["D655",0x8AF9],
- ["D656",0x8AFA],
- ["D657",0x8AFB],
- ["D658",0x8AFC],
- ["D659",0x8AFD],
- ["D65A",0x8AFE],
- ["D65B",0x8AFF],
- ["D65C",0x8B00],
- ["D65D",0x8B01],
- ["D65E",0x8B02],
- ["D65F",0x8B03],
- ["D660",0x8B04],
- ["D661",0x8B05],
- ["D662",0x8B06],
- ["E5C0",0x8B07],
- ["D663",0x8B08],
- ["D664",0x8B09],
- ["D665",0x8B0A],
- ["D666",0x8B0B],
- ["D667",0x8B0C],
- ["D668",0x8B0D],
- ["D669",0x8B0E],
- ["D66A",0x8B0F],
- ["D66B",0x8B10],
- ["D66C",0x8B11],
- ["D66D",0x8B12],
- ["D66E",0x8B13],
- ["D66F",0x8B14],
- ["D670",0x8B15],
- ["D671",0x8B16],
- ["D672",0x8B17],
- ["D673",0x8B18],
- ["D674",0x8B19],
- ["D675",0x8B1A],
- ["D676",0x8B1B],
- ["D677",0x8B1C],
- ["D678",0x8B1D],
- ["D679",0x8B1E],
- ["D67A",0x8B1F],
- ["D67B",0x8B20],
- ["D67C",0x8B21],
- ["D67D",0x8B22],
- ["D67E",0x8B23],
- ["D680",0x8B24],
- ["D681",0x8B25],
- ["F6A5",0x8B26],
- ["D682",0x8B27],
- ["D683",0x8B28],
- ["D684",0x8B29],
- ["D685",0x8B2A],
- ["D686",0x8B2B],
- ["D687",0x8B2C],
- ["D688",0x8B2D],
- ["D689",0x8B2E],
- ["D68A",0x8B2F],
- ["D68B",0x8B30],
- ["D68C",0x8B31],
- ["D68D",0x8B32],
- ["D68E",0x8B33],
- ["D68F",0x8B34],
- ["D690",0x8B35],
- ["D691",0x8B36],
- ["D692",0x8B37],
- ["D693",0x8B38],
- ["D694",0x8B39],
- ["D695",0x8B3A],
- ["D696",0x8B3B],
- ["D697",0x8B3C],
- ["D698",0x8B3D],
- ["D699",0x8B3E],
- ["D69A",0x8B3F],
- ["D69B",0x8B40],
- ["D69C",0x8B41],
- ["D69D",0x8B42],
- ["D69E",0x8B43],
- ["D69F",0x8B44],
- ["D6A0",0x8B45],
- ["D740",0x8B46],
- ["D741",0x8B47],
- ["D742",0x8B48],
- ["D743",0x8B49],
- ["D744",0x8B4A],
- ["D745",0x8B4B],
- ["D746",0x8B4C],
- ["D747",0x8B4D],
- ["D748",0x8B4E],
- ["D749",0x8B4F],
- ["D74A",0x8B50],
- ["D74B",0x8B51],
- ["D74C",0x8B52],
- ["D74D",0x8B53],
- ["D74E",0x8B54],
- ["D74F",0x8B55],
- ["D750",0x8B56],
- ["D751",0x8B57],
- ["D752",0x8B58],
- ["D753",0x8B59],
- ["D754",0x8B5A],
- ["D755",0x8B5B],
- ["D756",0x8B5C],
- ["D757",0x8B5D],
- ["D758",0x8B5E],
- ["D759",0x8B5F],
- ["D75A",0x8B60],
- ["D75B",0x8B61],
- ["D75C",0x8B62],
- ["D75D",0x8B63],
- ["D75E",0x8B64],
- ["D75F",0x8B65],
- ["BEAF",0x8B66],
- ["D760",0x8B67],
- ["D761",0x8B68],
- ["D762",0x8B69],
- ["D763",0x8B6A],
- ["D764",0x8B6B],
- ["C6A9",0x8B6C],
- ["D765",0x8B6D],
- ["D766",0x8B6E],
- ["D767",0x8B6F],
- ["D768",0x8B70],
- ["D769",0x8B71],
- ["D76A",0x8B72],
- ["D76B",0x8B73],
- ["D76C",0x8B74],
- ["D76D",0x8B75],
- ["D76E",0x8B76],
- ["D76F",0x8B77],
- ["D770",0x8B78],
- ["D771",0x8B79],
- ["D772",0x8B7A],
- ["D773",0x8B7B],
- ["D774",0x8B7C],
- ["D775",0x8B7D],
- ["D776",0x8B7E],
- ["D777",0x8B7F],
- ["D778",0x8B80],
- ["D779",0x8B81],
- ["D77A",0x8B82],
- ["D77B",0x8B83],
- ["D77C",0x8B84],
- ["D77D",0x8B85],
- ["D77E",0x8B86],
- ["D780",0x8B87],
- ["D781",0x8B88],
- ["D782",0x8B89],
- ["D783",0x8B8A],
- ["D784",0x8B8B],
- ["D785",0x8B8C],
- ["D786",0x8B8D],
- ["D787",0x8B8E],
- ["D788",0x8B8F],
- ["D789",0x8B90],
- ["D78A",0x8B91],
- ["D78B",0x8B92],
- ["D78C",0x8B93],
- ["D78D",0x8B94],
- ["D78E",0x8B95],
- ["D78F",0x8B96],
- ["D790",0x8B97],
- ["D791",0x8B98],
- ["D792",0x8B99],
- ["D793",0x8B9A],
- ["D794",0x8B9B],
- ["D795",0x8B9C],
- ["D796",0x8B9D],
- ["D797",0x8B9E],
- ["D798",0x8B9F],
- ["DAA5",0x8BA0],
- ["BCC6",0x8BA1],
- ["B6A9",0x8BA2],
- ["B8BC",0x8BA3],
- ["C8CF",0x8BA4],
- ["BCA5",0x8BA5],
- ["DAA6",0x8BA6],
- ["DAA7",0x8BA7],
- ["CCD6",0x8BA8],
- ["C8C3",0x8BA9],
- ["DAA8",0x8BAA],
- ["C6FD",0x8BAB],
- ["D799",0x8BAC],
- ["D1B5",0x8BAD],
- ["D2E9",0x8BAE],
- ["D1B6",0x8BAF],
- ["BCC7",0x8BB0],
- ["D79A",0x8BB1],
- ["BDB2",0x8BB2],
- ["BBE4",0x8BB3],
- ["DAA9",0x8BB4],
- ["DAAA",0x8BB5],
- ["D1C8",0x8BB6],
- ["DAAB",0x8BB7],
- ["D0ED",0x8BB8],
- ["B6EF",0x8BB9],
- ["C2DB",0x8BBA],
- ["D79B",0x8BBB],
- ["CBCF",0x8BBC],
- ["B7ED",0x8BBD],
- ["C9E8",0x8BBE],
- ["B7C3",0x8BBF],
- ["BEF7",0x8BC0],
- ["D6A4",0x8BC1],
- ["DAAC",0x8BC2],
- ["DAAD",0x8BC3],
- ["C6C0",0x8BC4],
- ["D7E7",0x8BC5],
- ["CAB6",0x8BC6],
- ["D79C",0x8BC7],
- ["D5A9",0x8BC8],
- ["CBDF",0x8BC9],
- ["D5EF",0x8BCA],
- ["DAAE",0x8BCB],
- ["D6DF",0x8BCC],
- ["B4CA",0x8BCD],
- ["DAB0",0x8BCE],
- ["DAAF",0x8BCF],
- ["D79D",0x8BD0],
- ["D2EB",0x8BD1],
- ["DAB1",0x8BD2],
- ["DAB2",0x8BD3],
- ["DAB3",0x8BD4],
- ["CAD4",0x8BD5],
- ["DAB4",0x8BD6],
- ["CAAB",0x8BD7],
- ["DAB5",0x8BD8],
- ["DAB6",0x8BD9],
- ["B3CF",0x8BDA],
- ["D6EF",0x8BDB],
- ["DAB7",0x8BDC],
- ["BBB0",0x8BDD],
- ["B5AE",0x8BDE],
- ["DAB8",0x8BDF],
- ["DAB9",0x8BE0],
- ["B9EE",0x8BE1],
- ["D1AF",0x8BE2],
- ["D2E8",0x8BE3],
- ["DABA",0x8BE4],
- ["B8C3",0x8BE5],
- ["CFEA",0x8BE6],
- ["B2EF",0x8BE7],
- ["DABB",0x8BE8],
- ["DABC",0x8BE9],
- ["D79E",0x8BEA],
- ["BDEB",0x8BEB],
- ["CEDC",0x8BEC],
- ["D3EF",0x8BED],
- ["DABD",0x8BEE],
- ["CEF3",0x8BEF],
- ["DABE",0x8BF0],
- ["D3D5",0x8BF1],
- ["BBE5",0x8BF2],
- ["DABF",0x8BF3],
- ["CBB5",0x8BF4],
- ["CBD0",0x8BF5],
- ["DAC0",0x8BF6],
- ["C7EB",0x8BF7],
- ["D6EE",0x8BF8],
- ["DAC1",0x8BF9],
- ["C5B5",0x8BFA],
- ["B6C1",0x8BFB],
- ["DAC2",0x8BFC],
- ["B7CC",0x8BFD],
- ["BFCE",0x8BFE],
- ["DAC3",0x8BFF],
- ["DAC4",0x8C00],
- ["CBAD",0x8C01],
- ["DAC5",0x8C02],
- ["B5F7",0x8C03],
- ["DAC6",0x8C04],
- ["C1C2",0x8C05],
- ["D7BB",0x8C06],
- ["DAC7",0x8C07],
- ["CCB8",0x8C08],
- ["D79F",0x8C09],
- ["D2EA",0x8C0A],
- ["C4B1",0x8C0B],
- ["DAC8",0x8C0C],
- ["B5FD",0x8C0D],
- ["BBD1",0x8C0E],
- ["DAC9",0x8C0F],
- ["D0B3",0x8C10],
- ["DACA",0x8C11],
- ["DACB",0x8C12],
- ["CEBD",0x8C13],
- ["DACC",0x8C14],
- ["DACD",0x8C15],
- ["DACE",0x8C16],
- ["B2F7",0x8C17],
- ["DAD1",0x8C18],
- ["DACF",0x8C19],
- ["D1E8",0x8C1A],
- ["DAD0",0x8C1B],
- ["C3D5",0x8C1C],
- ["DAD2",0x8C1D],
- ["D7A0",0x8C1E],
- ["DAD3",0x8C1F],
- ["DAD4",0x8C20],
- ["DAD5",0x8C21],
- ["D0BB",0x8C22],
- ["D2A5",0x8C23],
- ["B0F9",0x8C24],
- ["DAD6",0x8C25],
- ["C7AB",0x8C26],
- ["DAD7",0x8C27],
- ["BDF7",0x8C28],
- ["C3A1",0x8C29],
- ["DAD8",0x8C2A],
- ["DAD9",0x8C2B],
- ["C3FD",0x8C2C],
- ["CCB7",0x8C2D],
- ["DADA",0x8C2E],
- ["DADB",0x8C2F],
- ["C0BE",0x8C30],
- ["C6D7",0x8C31],
- ["DADC",0x8C32],
- ["DADD",0x8C33],
- ["C7B4",0x8C34],
- ["DADE",0x8C35],
- ["DADF",0x8C36],
- ["B9C8",0x8C37],
- ["D840",0x8C38],
- ["D841",0x8C39],
- ["D842",0x8C3A],
- ["D843",0x8C3B],
- ["D844",0x8C3C],
- ["D845",0x8C3D],
- ["D846",0x8C3E],
- ["D847",0x8C3F],
- ["D848",0x8C40],
- ["BBED",0x8C41],
- ["D849",0x8C42],
- ["D84A",0x8C43],
- ["D84B",0x8C44],
- ["D84C",0x8C45],
- ["B6B9",0x8C46],
- ["F4F8",0x8C47],
- ["D84D",0x8C48],
- ["F4F9",0x8C49],
- ["D84E",0x8C4A],
- ["D84F",0x8C4B],
- ["CDE3",0x8C4C],
- ["D850",0x8C4D],
- ["D851",0x8C4E],
- ["D852",0x8C4F],
- ["D853",0x8C50],
- ["D854",0x8C51],
- ["D855",0x8C52],
- ["D856",0x8C53],
- ["D857",0x8C54],
- ["F5B9",0x8C55],
- ["D858",0x8C56],
- ["D859",0x8C57],
- ["D85A",0x8C58],
- ["D85B",0x8C59],
- ["EBE0",0x8C5A],
- ["D85C",0x8C5B],
- ["D85D",0x8C5C],
- ["D85E",0x8C5D],
- ["D85F",0x8C5E],
- ["D860",0x8C5F],
- ["D861",0x8C60],
- ["CFF3",0x8C61],
- ["BBBF",0x8C62],
- ["D862",0x8C63],
- ["D863",0x8C64],
- ["D864",0x8C65],
- ["D865",0x8C66],
- ["D866",0x8C67],
- ["D867",0x8C68],
- ["D868",0x8C69],
- ["BAC0",0x8C6A],
- ["D4A5",0x8C6B],
- ["D869",0x8C6C],
- ["D86A",0x8C6D],
- ["D86B",0x8C6E],
- ["D86C",0x8C6F],
- ["D86D",0x8C70],
- ["D86E",0x8C71],
- ["D86F",0x8C72],
- ["E1D9",0x8C73],
- ["D870",0x8C74],
- ["D871",0x8C75],
- ["D872",0x8C76],
- ["D873",0x8C77],
- ["F5F4",0x8C78],
- ["B1AA",0x8C79],
- ["B2F2",0x8C7A],
- ["D874",0x8C7B],
- ["D875",0x8C7C],
- ["D876",0x8C7D],
- ["D877",0x8C7E],
- ["D878",0x8C7F],
- ["D879",0x8C80],
- ["D87A",0x8C81],
- ["F5F5",0x8C82],
- ["D87B",0x8C83],
- ["D87C",0x8C84],
- ["F5F7",0x8C85],
- ["D87D",0x8C86],
- ["D87E",0x8C87],
- ["D880",0x8C88],
- ["BAD1",0x8C89],
- ["F5F6",0x8C8A],
- ["D881",0x8C8B],
- ["C3B2",0x8C8C],
- ["D882",0x8C8D],
- ["D883",0x8C8E],
- ["D884",0x8C8F],
- ["D885",0x8C90],
- ["D886",0x8C91],
- ["D887",0x8C92],
- ["D888",0x8C93],
- ["F5F9",0x8C94],
- ["D889",0x8C95],
- ["D88A",0x8C96],
- ["D88B",0x8C97],
- ["F5F8",0x8C98],
- ["D88C",0x8C99],
- ["D88D",0x8C9A],
- ["D88E",0x8C9B],
- ["D88F",0x8C9C],
- ["D890",0x8C9D],
- ["D891",0x8C9E],
- ["D892",0x8C9F],
- ["D893",0x8CA0],
- ["D894",0x8CA1],
- ["D895",0x8CA2],
- ["D896",0x8CA3],
- ["D897",0x8CA4],
- ["D898",0x8CA5],
- ["D899",0x8CA6],
- ["D89A",0x8CA7],
- ["D89B",0x8CA8],
- ["D89C",0x8CA9],
- ["D89D",0x8CAA],
- ["D89E",0x8CAB],
- ["D89F",0x8CAC],
- ["D8A0",0x8CAD],
- ["D940",0x8CAE],
- ["D941",0x8CAF],
- ["D942",0x8CB0],
- ["D943",0x8CB1],
- ["D944",0x8CB2],
- ["D945",0x8CB3],
- ["D946",0x8CB4],
- ["D947",0x8CB5],
- ["D948",0x8CB6],
- ["D949",0x8CB7],
- ["D94A",0x8CB8],
- ["D94B",0x8CB9],
- ["D94C",0x8CBA],
- ["D94D",0x8CBB],
- ["D94E",0x8CBC],
- ["D94F",0x8CBD],
- ["D950",0x8CBE],
- ["D951",0x8CBF],
- ["D952",0x8CC0],
- ["D953",0x8CC1],
- ["D954",0x8CC2],
- ["D955",0x8CC3],
- ["D956",0x8CC4],
- ["D957",0x8CC5],
- ["D958",0x8CC6],
- ["D959",0x8CC7],
- ["D95A",0x8CC8],
- ["D95B",0x8CC9],
- ["D95C",0x8CCA],
- ["D95D",0x8CCB],
- ["D95E",0x8CCC],
- ["D95F",0x8CCD],
- ["D960",0x8CCE],
- ["D961",0x8CCF],
- ["D962",0x8CD0],
- ["D963",0x8CD1],
- ["D964",0x8CD2],
- ["D965",0x8CD3],
- ["D966",0x8CD4],
- ["D967",0x8CD5],
- ["D968",0x8CD6],
- ["D969",0x8CD7],
- ["D96A",0x8CD8],
- ["D96B",0x8CD9],
- ["D96C",0x8CDA],
- ["D96D",0x8CDB],
- ["D96E",0x8CDC],
- ["D96F",0x8CDD],
- ["D970",0x8CDE],
- ["D971",0x8CDF],
- ["D972",0x8CE0],
- ["D973",0x8CE1],
- ["D974",0x8CE2],
- ["D975",0x8CE3],
- ["D976",0x8CE4],
- ["D977",0x8CE5],
- ["D978",0x8CE6],
- ["D979",0x8CE7],
- ["D97A",0x8CE8],
- ["D97B",0x8CE9],
- ["D97C",0x8CEA],
- ["D97D",0x8CEB],
- ["D97E",0x8CEC],
- ["D980",0x8CED],
- ["D981",0x8CEE],
- ["D982",0x8CEF],
- ["D983",0x8CF0],
- ["D984",0x8CF1],
- ["D985",0x8CF2],
- ["D986",0x8CF3],
- ["D987",0x8CF4],
- ["D988",0x8CF5],
- ["D989",0x8CF6],
- ["D98A",0x8CF7],
- ["D98B",0x8CF8],
- ["D98C",0x8CF9],
- ["D98D",0x8CFA],
- ["D98E",0x8CFB],
- ["D98F",0x8CFC],
- ["D990",0x8CFD],
- ["D991",0x8CFE],
- ["D992",0x8CFF],
- ["D993",0x8D00],
- ["D994",0x8D01],
- ["D995",0x8D02],
- ["D996",0x8D03],
- ["D997",0x8D04],
- ["D998",0x8D05],
- ["D999",0x8D06],
- ["D99A",0x8D07],
- ["D99B",0x8D08],
- ["D99C",0x8D09],
- ["D99D",0x8D0A],
- ["D99E",0x8D0B],
- ["D99F",0x8D0C],
- ["D9A0",0x8D0D],
- ["DA40",0x8D0E],
- ["DA41",0x8D0F],
- ["DA42",0x8D10],
- ["DA43",0x8D11],
- ["DA44",0x8D12],
- ["DA45",0x8D13],
- ["DA46",0x8D14],
- ["DA47",0x8D15],
- ["DA48",0x8D16],
- ["DA49",0x8D17],
- ["DA4A",0x8D18],
- ["DA4B",0x8D19],
- ["DA4C",0x8D1A],
- ["DA4D",0x8D1B],
- ["DA4E",0x8D1C],
- ["B1B4",0x8D1D],
- ["D5EA",0x8D1E],
- ["B8BA",0x8D1F],
- ["DA4F",0x8D20],
- ["B9B1",0x8D21],
- ["B2C6",0x8D22],
- ["D4F0",0x8D23],
- ["CFCD",0x8D24],
- ["B0DC",0x8D25],
- ["D5CB",0x8D26],
- ["BBF5",0x8D27],
- ["D6CA",0x8D28],
- ["B7B7",0x8D29],
- ["CCB0",0x8D2A],
- ["C6B6",0x8D2B],
- ["B1E1",0x8D2C],
- ["B9BA",0x8D2D],
- ["D6FC",0x8D2E],
- ["B9E1",0x8D2F],
- ["B7A1",0x8D30],
- ["BCFA",0x8D31],
- ["EADA",0x8D32],
- ["EADB",0x8D33],
- ["CCF9",0x8D34],
- ["B9F3",0x8D35],
- ["EADC",0x8D36],
- ["B4FB",0x8D37],
- ["C3B3",0x8D38],
- ["B7D1",0x8D39],
- ["BAD8",0x8D3A],
- ["EADD",0x8D3B],
- ["D4F4",0x8D3C],
- ["EADE",0x8D3D],
- ["BCD6",0x8D3E],
- ["BBDF",0x8D3F],
- ["EADF",0x8D40],
- ["C1DE",0x8D41],
- ["C2B8",0x8D42],
- ["D4DF",0x8D43],
- ["D7CA",0x8D44],
- ["EAE0",0x8D45],
- ["EAE1",0x8D46],
- ["EAE4",0x8D47],
- ["EAE2",0x8D48],
- ["EAE3",0x8D49],
- ["C9DE",0x8D4A],
- ["B8B3",0x8D4B],
- ["B6C4",0x8D4C],
- ["EAE5",0x8D4D],
- ["CAEA",0x8D4E],
- ["C9CD",0x8D4F],
- ["B4CD",0x8D50],
- ["DA50",0x8D51],
- ["DA51",0x8D52],
- ["E2D9",0x8D53],
- ["C5E2",0x8D54],
- ["EAE6",0x8D55],
- ["C0B5",0x8D56],
- ["DA52",0x8D57],
- ["D7B8",0x8D58],
- ["EAE7",0x8D59],
- ["D7AC",0x8D5A],
- ["C8FC",0x8D5B],
- ["D8D3",0x8D5C],
- ["D8CD",0x8D5D],
- ["D4DE",0x8D5E],
- ["DA53",0x8D5F],
- ["D4F9",0x8D60],
- ["C9C4",0x8D61],
- ["D3AE",0x8D62],
- ["B8D3",0x8D63],
- ["B3E0",0x8D64],
- ["DA54",0x8D65],
- ["C9E2",0x8D66],
- ["F4F6",0x8D67],
- ["DA55",0x8D68],
- ["DA56",0x8D69],
- ["DA57",0x8D6A],
- ["BAD5",0x8D6B],
- ["DA58",0x8D6C],
- ["F4F7",0x8D6D],
- ["DA59",0x8D6E],
- ["DA5A",0x8D6F],
- ["D7DF",0x8D70],
- ["DA5B",0x8D71],
- ["DA5C",0x8D72],
- ["F4F1",0x8D73],
- ["B8B0",0x8D74],
- ["D5D4",0x8D75],
- ["B8CF",0x8D76],
- ["C6F0",0x8D77],
- ["DA5D",0x8D78],
- ["DA5E",0x8D79],
- ["DA5F",0x8D7A],
- ["DA60",0x8D7B],
- ["DA61",0x8D7C],
- ["DA62",0x8D7D],
- ["DA63",0x8D7E],
- ["DA64",0x8D7F],
- ["DA65",0x8D80],
- ["B3C3",0x8D81],
- ["DA66",0x8D82],
- ["DA67",0x8D83],
- ["F4F2",0x8D84],
- ["B3AC",0x8D85],
- ["DA68",0x8D86],
- ["DA69",0x8D87],
- ["DA6A",0x8D88],
- ["DA6B",0x8D89],
- ["D4BD",0x8D8A],
- ["C7F7",0x8D8B],
- ["DA6C",0x8D8C],
- ["DA6D",0x8D8D],
- ["DA6E",0x8D8E],
- ["DA6F",0x8D8F],
- ["DA70",0x8D90],
- ["F4F4",0x8D91],
- ["DA71",0x8D92],
- ["DA72",0x8D93],
- ["F4F3",0x8D94],
- ["DA73",0x8D95],
- ["DA74",0x8D96],
- ["DA75",0x8D97],
- ["DA76",0x8D98],
- ["DA77",0x8D99],
- ["DA78",0x8D9A],
- ["DA79",0x8D9B],
- ["DA7A",0x8D9C],
- ["DA7B",0x8D9D],
- ["DA7C",0x8D9E],
- ["CCCB",0x8D9F],
- ["DA7D",0x8DA0],
- ["DA7E",0x8DA1],
- ["DA80",0x8DA2],
- ["C8A4",0x8DA3],
- ["DA81",0x8DA4],
- ["DA82",0x8DA5],
- ["DA83",0x8DA6],
- ["DA84",0x8DA7],
- ["DA85",0x8DA8],
- ["DA86",0x8DA9],
- ["DA87",0x8DAA],
- ["DA88",0x8DAB],
- ["DA89",0x8DAC],
- ["DA8A",0x8DAD],
- ["DA8B",0x8DAE],
- ["DA8C",0x8DAF],
- ["DA8D",0x8DB0],
- ["F4F5",0x8DB1],
- ["DA8E",0x8DB2],
- ["D7E3",0x8DB3],
- ["C5BF",0x8DB4],
- ["F5C0",0x8DB5],
- ["DA8F",0x8DB6],
- ["DA90",0x8DB7],
- ["F5BB",0x8DB8],
- ["DA91",0x8DB9],
- ["F5C3",0x8DBA],
- ["DA92",0x8DBB],
- ["F5C2",0x8DBC],
- ["DA93",0x8DBD],
- ["D6BA",0x8DBE],
- ["F5C1",0x8DBF],
- ["DA94",0x8DC0],
- ["DA95",0x8DC1],
- ["DA96",0x8DC2],
- ["D4BE",0x8DC3],
- ["F5C4",0x8DC4],
- ["DA97",0x8DC5],
- ["F5CC",0x8DC6],
- ["DA98",0x8DC7],
- ["DA99",0x8DC8],
- ["DA9A",0x8DC9],
- ["DA9B",0x8DCA],
- ["B0CF",0x8DCB],
- ["B5F8",0x8DCC],
- ["DA9C",0x8DCD],
- ["F5C9",0x8DCE],
- ["F5CA",0x8DCF],
- ["DA9D",0x8DD0],
- ["C5DC",0x8DD1],
- ["DA9E",0x8DD2],
- ["DA9F",0x8DD3],
- ["DAA0",0x8DD4],
- ["DB40",0x8DD5],
- ["F5C5",0x8DD6],
- ["F5C6",0x8DD7],
- ["DB41",0x8DD8],
- ["DB42",0x8DD9],
- ["F5C7",0x8DDA],
- ["F5CB",0x8DDB],
- ["DB43",0x8DDC],
- ["BEE0",0x8DDD],
- ["F5C8",0x8DDE],
- ["B8FA",0x8DDF],
- ["DB44",0x8DE0],
- ["DB45",0x8DE1],
- ["DB46",0x8DE2],
- ["F5D0",0x8DE3],
- ["F5D3",0x8DE4],
- ["DB47",0x8DE5],
- ["DB48",0x8DE6],
- ["DB49",0x8DE7],
- ["BFE7",0x8DE8],
- ["DB4A",0x8DE9],
- ["B9F2",0x8DEA],
- ["F5BC",0x8DEB],
- ["F5CD",0x8DEC],
- ["DB4B",0x8DED],
- ["DB4C",0x8DEE],
- ["C2B7",0x8DEF],
- ["DB4D",0x8DF0],
- ["DB4E",0x8DF1],
- ["DB4F",0x8DF2],
- ["CCF8",0x8DF3],
- ["DB50",0x8DF4],
- ["BCF9",0x8DF5],
- ["DB51",0x8DF6],
- ["F5CE",0x8DF7],
- ["F5CF",0x8DF8],
- ["F5D1",0x8DF9],
- ["B6E5",0x8DFA],
- ["F5D2",0x8DFB],
- ["DB52",0x8DFC],
- ["F5D5",0x8DFD],
- ["DB53",0x8DFE],
- ["DB54",0x8DFF],
- ["DB55",0x8E00],
- ["DB56",0x8E01],
- ["DB57",0x8E02],
- ["DB58",0x8E03],
- ["DB59",0x8E04],
- ["F5BD",0x8E05],
- ["DB5A",0x8E06],
- ["DB5B",0x8E07],
- ["DB5C",0x8E08],
- ["F5D4",0x8E09],
- ["D3BB",0x8E0A],
- ["DB5D",0x8E0B],
- ["B3EC",0x8E0C],
- ["DB5E",0x8E0D],
- ["DB5F",0x8E0E],
- ["CCA4",0x8E0F],
- ["DB60",0x8E10],
- ["DB61",0x8E11],
- ["DB62",0x8E12],
- ["DB63",0x8E13],
- ["F5D6",0x8E14],
- ["DB64",0x8E15],
- ["DB65",0x8E16],
- ["DB66",0x8E17],
- ["DB67",0x8E18],
- ["DB68",0x8E19],
- ["DB69",0x8E1A],
- ["DB6A",0x8E1B],
- ["DB6B",0x8E1C],
- ["F5D7",0x8E1D],
- ["BEE1",0x8E1E],
- ["F5D8",0x8E1F],
- ["DB6C",0x8E20],
- ["DB6D",0x8E21],
- ["CCDF",0x8E22],
- ["F5DB",0x8E23],
- ["DB6E",0x8E24],
- ["DB6F",0x8E25],
- ["DB70",0x8E26],
- ["DB71",0x8E27],
- ["DB72",0x8E28],
- ["B2C8",0x8E29],
- ["D7D9",0x8E2A],
- ["DB73",0x8E2B],
- ["F5D9",0x8E2C],
- ["DB74",0x8E2D],
- ["F5DA",0x8E2E],
- ["F5DC",0x8E2F],
- ["DB75",0x8E30],
- ["F5E2",0x8E31],
- ["DB76",0x8E32],
- ["DB77",0x8E33],
- ["DB78",0x8E34],
- ["F5E0",0x8E35],
- ["DB79",0x8E36],
- ["DB7A",0x8E37],
- ["DB7B",0x8E38],
- ["F5DF",0x8E39],
- ["F5DD",0x8E3A],
- ["DB7C",0x8E3B],
- ["DB7D",0x8E3C],
- ["F5E1",0x8E3D],
- ["DB7E",0x8E3E],
- ["DB80",0x8E3F],
- ["F5DE",0x8E40],
- ["F5E4",0x8E41],
- ["F5E5",0x8E42],
- ["DB81",0x8E43],
- ["CCE3",0x8E44],
- ["DB82",0x8E45],
- ["DB83",0x8E46],
- ["E5BF",0x8E47],
- ["B5B8",0x8E48],
- ["F5E3",0x8E49],
- ["F5E8",0x8E4A],
- ["CCA3",0x8E4B],
- ["DB84",0x8E4C],
- ["DB85",0x8E4D],
- ["DB86",0x8E4E],
- ["DB87",0x8E4F],
- ["DB88",0x8E50],
- ["F5E6",0x8E51],
- ["F5E7",0x8E52],
- ["DB89",0x8E53],
- ["DB8A",0x8E54],
- ["DB8B",0x8E55],
- ["DB8C",0x8E56],
- ["DB8D",0x8E57],
- ["DB8E",0x8E58],
- ["F5BE",0x8E59],
- ["DB8F",0x8E5A],
- ["DB90",0x8E5B],
- ["DB91",0x8E5C],
- ["DB92",0x8E5D],
- ["DB93",0x8E5E],
- ["DB94",0x8E5F],
- ["DB95",0x8E60],
- ["DB96",0x8E61],
- ["DB97",0x8E62],
- ["DB98",0x8E63],
- ["DB99",0x8E64],
- ["DB9A",0x8E65],
- ["B1C4",0x8E66],
- ["DB9B",0x8E67],
- ["DB9C",0x8E68],
- ["F5BF",0x8E69],
- ["DB9D",0x8E6A],
- ["DB9E",0x8E6B],
- ["B5C5",0x8E6C],
- ["B2E4",0x8E6D],
- ["DB9F",0x8E6E],
- ["F5EC",0x8E6F],
- ["F5E9",0x8E70],
- ["DBA0",0x8E71],
- ["B6D7",0x8E72],
- ["DC40",0x8E73],
- ["F5ED",0x8E74],
- ["DC41",0x8E75],
- ["F5EA",0x8E76],
- ["DC42",0x8E77],
- ["DC43",0x8E78],
- ["DC44",0x8E79],
- ["DC45",0x8E7A],
- ["DC46",0x8E7B],
- ["F5EB",0x8E7C],
- ["DC47",0x8E7D],
- ["DC48",0x8E7E],
- ["B4DA",0x8E7F],
- ["DC49",0x8E80],
- ["D4EA",0x8E81],
- ["DC4A",0x8E82],
- ["DC4B",0x8E83],
- ["DC4C",0x8E84],
- ["F5EE",0x8E85],
- ["DC4D",0x8E86],
- ["B3F9",0x8E87],
- ["DC4E",0x8E88],
- ["DC4F",0x8E89],
- ["DC50",0x8E8A],
- ["DC51",0x8E8B],
- ["DC52",0x8E8C],
- ["DC53",0x8E8D],
- ["DC54",0x8E8E],
- ["F5EF",0x8E8F],
- ["F5F1",0x8E90],
- ["DC55",0x8E91],
- ["DC56",0x8E92],
- ["DC57",0x8E93],
- ["F5F0",0x8E94],
- ["DC58",0x8E95],
- ["DC59",0x8E96],
- ["DC5A",0x8E97],
- ["DC5B",0x8E98],
- ["DC5C",0x8E99],
- ["DC5D",0x8E9A],
- ["DC5E",0x8E9B],
- ["F5F2",0x8E9C],
- ["DC5F",0x8E9D],
- ["F5F3",0x8E9E],
- ["DC60",0x8E9F],
- ["DC61",0x8EA0],
- ["DC62",0x8EA1],
- ["DC63",0x8EA2],
- ["DC64",0x8EA3],
- ["DC65",0x8EA4],
- ["DC66",0x8EA5],
- ["DC67",0x8EA6],
- ["DC68",0x8EA7],
- ["DC69",0x8EA8],
- ["DC6A",0x8EA9],
- ["DC6B",0x8EAA],
- ["C9ED",0x8EAB],
- ["B9AA",0x8EAC],
- ["DC6C",0x8EAD],
- ["DC6D",0x8EAE],
- ["C7FB",0x8EAF],
- ["DC6E",0x8EB0],
- ["DC6F",0x8EB1],
- ["B6E3",0x8EB2],
- ["DC70",0x8EB3],
- ["DC71",0x8EB4],
- ["DC72",0x8EB5],
- ["DC73",0x8EB6],
- ["DC74",0x8EB7],
- ["DC75",0x8EB8],
- ["DC76",0x8EB9],
- ["CCC9",0x8EBA],
- ["DC77",0x8EBB],
- ["DC78",0x8EBC],
- ["DC79",0x8EBD],
- ["DC7A",0x8EBE],
- ["DC7B",0x8EBF],
- ["DC7C",0x8EC0],
- ["DC7D",0x8EC1],
- ["DC7E",0x8EC2],
- ["DC80",0x8EC3],
- ["DC81",0x8EC4],
- ["DC82",0x8EC5],
- ["DC83",0x8EC6],
- ["DC84",0x8EC7],
- ["DC85",0x8EC8],
- ["DC86",0x8EC9],
- ["DC87",0x8ECA],
- ["DC88",0x8ECB],
- ["DC89",0x8ECC],
- ["DC8A",0x8ECD],
- ["EAA6",0x8ECE],
- ["DC8B",0x8ECF],
- ["DC8C",0x8ED0],
- ["DC8D",0x8ED1],
- ["DC8E",0x8ED2],
- ["DC8F",0x8ED3],
- ["DC90",0x8ED4],
- ["DC91",0x8ED5],
- ["DC92",0x8ED6],
- ["DC93",0x8ED7],
- ["DC94",0x8ED8],
- ["DC95",0x8ED9],
- ["DC96",0x8EDA],
- ["DC97",0x8EDB],
- ["DC98",0x8EDC],
- ["DC99",0x8EDD],
- ["DC9A",0x8EDE],
- ["DC9B",0x8EDF],
- ["DC9C",0x8EE0],
- ["DC9D",0x8EE1],
- ["DC9E",0x8EE2],
- ["DC9F",0x8EE3],
- ["DCA0",0x8EE4],
- ["DD40",0x8EE5],
- ["DD41",0x8EE6],
- ["DD42",0x8EE7],
- ["DD43",0x8EE8],
- ["DD44",0x8EE9],
- ["DD45",0x8EEA],
- ["DD46",0x8EEB],
- ["DD47",0x8EEC],
- ["DD48",0x8EED],
- ["DD49",0x8EEE],
- ["DD4A",0x8EEF],
- ["DD4B",0x8EF0],
- ["DD4C",0x8EF1],
- ["DD4D",0x8EF2],
- ["DD4E",0x8EF3],
- ["DD4F",0x8EF4],
- ["DD50",0x8EF5],
- ["DD51",0x8EF6],
- ["DD52",0x8EF7],
- ["DD53",0x8EF8],
- ["DD54",0x8EF9],
- ["DD55",0x8EFA],
- ["DD56",0x8EFB],
- ["DD57",0x8EFC],
- ["DD58",0x8EFD],
- ["DD59",0x8EFE],
- ["DD5A",0x8EFF],
- ["DD5B",0x8F00],
- ["DD5C",0x8F01],
- ["DD5D",0x8F02],
- ["DD5E",0x8F03],
- ["DD5F",0x8F04],
- ["DD60",0x8F05],
- ["DD61",0x8F06],
- ["DD62",0x8F07],
- ["DD63",0x8F08],
- ["DD64",0x8F09],
- ["DD65",0x8F0A],
- ["DD66",0x8F0B],
- ["DD67",0x8F0C],
- ["DD68",0x8F0D],
- ["DD69",0x8F0E],
- ["DD6A",0x8F0F],
- ["DD6B",0x8F10],
- ["DD6C",0x8F11],
- ["DD6D",0x8F12],
- ["DD6E",0x8F13],
- ["DD6F",0x8F14],
- ["DD70",0x8F15],
- ["DD71",0x8F16],
- ["DD72",0x8F17],
- ["DD73",0x8F18],
- ["DD74",0x8F19],
- ["DD75",0x8F1A],
- ["DD76",0x8F1B],
- ["DD77",0x8F1C],
- ["DD78",0x8F1D],
- ["DD79",0x8F1E],
- ["DD7A",0x8F1F],
- ["DD7B",0x8F20],
- ["DD7C",0x8F21],
- ["DD7D",0x8F22],
- ["DD7E",0x8F23],
- ["DD80",0x8F24],
- ["DD81",0x8F25],
- ["DD82",0x8F26],
- ["DD83",0x8F27],
- ["DD84",0x8F28],
- ["DD85",0x8F29],
- ["DD86",0x8F2A],
- ["DD87",0x8F2B],
- ["DD88",0x8F2C],
- ["DD89",0x8F2D],
- ["DD8A",0x8F2E],
- ["DD8B",0x8F2F],
- ["DD8C",0x8F30],
- ["DD8D",0x8F31],
- ["DD8E",0x8F32],
- ["DD8F",0x8F33],
- ["DD90",0x8F34],
- ["DD91",0x8F35],
- ["DD92",0x8F36],
- ["DD93",0x8F37],
- ["DD94",0x8F38],
- ["DD95",0x8F39],
- ["DD96",0x8F3A],
- ["DD97",0x8F3B],
- ["DD98",0x8F3C],
- ["DD99",0x8F3D],
- ["DD9A",0x8F3E],
- ["DD9B",0x8F3F],
- ["DD9C",0x8F40],
- ["DD9D",0x8F41],
- ["DD9E",0x8F42],
- ["DD9F",0x8F43],
- ["DDA0",0x8F44],
- ["DE40",0x8F45],
- ["DE41",0x8F46],
- ["DE42",0x8F47],
- ["DE43",0x8F48],
- ["DE44",0x8F49],
- ["DE45",0x8F4A],
- ["DE46",0x8F4B],
- ["DE47",0x8F4C],
- ["DE48",0x8F4D],
- ["DE49",0x8F4E],
- ["DE4A",0x8F4F],
- ["DE4B",0x8F50],
- ["DE4C",0x8F51],
- ["DE4D",0x8F52],
- ["DE4E",0x8F53],
- ["DE4F",0x8F54],
- ["DE50",0x8F55],
- ["DE51",0x8F56],
- ["DE52",0x8F57],
- ["DE53",0x8F58],
- ["DE54",0x8F59],
- ["DE55",0x8F5A],
- ["DE56",0x8F5B],
- ["DE57",0x8F5C],
- ["DE58",0x8F5D],
- ["DE59",0x8F5E],
- ["DE5A",0x8F5F],
- ["DE5B",0x8F60],
- ["DE5C",0x8F61],
- ["DE5D",0x8F62],
- ["DE5E",0x8F63],
- ["DE5F",0x8F64],
- ["DE60",0x8F65],
- ["B3B5",0x8F66],
- ["D4FE",0x8F67],
- ["B9EC",0x8F68],
- ["D0F9",0x8F69],
- ["DE61",0x8F6A],
- ["E9ED",0x8F6B],
- ["D7AA",0x8F6C],
- ["E9EE",0x8F6D],
- ["C2D6",0x8F6E],
- ["C8ED",0x8F6F],
- ["BAE4",0x8F70],
- ["E9EF",0x8F71],
- ["E9F0",0x8F72],
- ["E9F1",0x8F73],
- ["D6E1",0x8F74],
- ["E9F2",0x8F75],
- ["E9F3",0x8F76],
- ["E9F5",0x8F77],
- ["E9F4",0x8F78],
- ["E9F6",0x8F79],
- ["E9F7",0x8F7A],
- ["C7E1",0x8F7B],
- ["E9F8",0x8F7C],
- ["D4D8",0x8F7D],
- ["E9F9",0x8F7E],
- ["BDCE",0x8F7F],
- ["DE62",0x8F80],
- ["E9FA",0x8F81],
- ["E9FB",0x8F82],
- ["BDCF",0x8F83],
- ["E9FC",0x8F84],
- ["B8A8",0x8F85],
- ["C1BE",0x8F86],
- ["E9FD",0x8F87],
- ["B1B2",0x8F88],
- ["BBD4",0x8F89],
- ["B9F5",0x8F8A],
- ["E9FE",0x8F8B],
- ["DE63",0x8F8C],
- ["EAA1",0x8F8D],
- ["EAA2",0x8F8E],
- ["EAA3",0x8F8F],
- ["B7F8",0x8F90],
- ["BCAD",0x8F91],
- ["DE64",0x8F92],
- ["CAE4",0x8F93],
- ["E0CE",0x8F94],
- ["D4AF",0x8F95],
- ["CFBD",0x8F96],
- ["D5B7",0x8F97],
- ["EAA4",0x8F98],
- ["D5DE",0x8F99],
- ["EAA5",0x8F9A],
- ["D0C1",0x8F9B],
- ["B9BC",0x8F9C],
- ["DE65",0x8F9D],
- ["B4C7",0x8F9E],
- ["B1D9",0x8F9F],
- ["DE66",0x8FA0],
- ["DE67",0x8FA1],
- ["DE68",0x8FA2],
- ["C0B1",0x8FA3],
- ["DE69",0x8FA4],
- ["DE6A",0x8FA5],
- ["DE6B",0x8FA6],
- ["DE6C",0x8FA7],
- ["B1E6",0x8FA8],
- ["B1E7",0x8FA9],
- ["DE6D",0x8FAA],
- ["B1E8",0x8FAB],
- ["DE6E",0x8FAC],
- ["DE6F",0x8FAD],
- ["DE70",0x8FAE],
- ["DE71",0x8FAF],
- ["B3BD",0x8FB0],
- ["C8E8",0x8FB1],
- ["DE72",0x8FB2],
- ["DE73",0x8FB3],
- ["DE74",0x8FB4],
- ["DE75",0x8FB5],
- ["E5C1",0x8FB6],
- ["DE76",0x8FB7],
- ["DE77",0x8FB8],
- ["B1DF",0x8FB9],
- ["DE78",0x8FBA],
- ["DE79",0x8FBB],
- ["DE7A",0x8FBC],
- ["C1C9",0x8FBD],
- ["B4EF",0x8FBE],
- ["DE7B",0x8FBF],
- ["DE7C",0x8FC0],
- ["C7A8",0x8FC1],
- ["D3D8",0x8FC2],
- ["DE7D",0x8FC3],
- ["C6F9",0x8FC4],
- ["D1B8",0x8FC5],
- ["DE7E",0x8FC6],
- ["B9FD",0x8FC7],
- ["C2F5",0x8FC8],
- ["DE80",0x8FC9],
- ["DE81",0x8FCA],
- ["DE82",0x8FCB],
- ["DE83",0x8FCC],
- ["DE84",0x8FCD],
- ["D3AD",0x8FCE],
- ["DE85",0x8FCF],
- ["D4CB",0x8FD0],
- ["BDFC",0x8FD1],
- ["DE86",0x8FD2],
- ["E5C2",0x8FD3],
- ["B7B5",0x8FD4],
- ["E5C3",0x8FD5],
- ["DE87",0x8FD6],
- ["DE88",0x8FD7],
- ["BBB9",0x8FD8],
- ["D5E2",0x8FD9],
- ["DE89",0x8FDA],
- ["BDF8",0x8FDB],
- ["D4B6",0x8FDC],
- ["CEA5",0x8FDD],
- ["C1AC",0x8FDE],
- ["B3D9",0x8FDF],
- ["DE8A",0x8FE0],
- ["DE8B",0x8FE1],
- ["CCF6",0x8FE2],
- ["DE8C",0x8FE3],
- ["E5C6",0x8FE4],
- ["E5C4",0x8FE5],
- ["E5C8",0x8FE6],
- ["DE8D",0x8FE7],
- ["E5CA",0x8FE8],
- ["E5C7",0x8FE9],
- ["B5CF",0x8FEA],
- ["C6C8",0x8FEB],
- ["DE8E",0x8FEC],
- ["B5FC",0x8FED],
- ["E5C5",0x8FEE],
- ["DE8F",0x8FEF],
- ["CAF6",0x8FF0],
- ["DE90",0x8FF1],
- ["DE91",0x8FF2],
- ["E5C9",0x8FF3],
- ["DE92",0x8FF4],
- ["DE93",0x8FF5],
- ["DE94",0x8FF6],
- ["C3D4",0x8FF7],
- ["B1C5",0x8FF8],
- ["BCA3",0x8FF9],
- ["DE95",0x8FFA],
- ["DE96",0x8FFB],
- ["DE97",0x8FFC],
- ["D7B7",0x8FFD],
- ["DE98",0x8FFE],
- ["DE99",0x8FFF],
- ["CDCB",0x9000],
- ["CBCD",0x9001],
- ["CACA",0x9002],
- ["CCD3",0x9003],
- ["E5CC",0x9004],
- ["E5CB",0x9005],
- ["C4E6",0x9006],
- ["DE9A",0x9007],
- ["DE9B",0x9008],
- ["D1A1",0x9009],
- ["D1B7",0x900A],
- ["E5CD",0x900B],
- ["DE9C",0x900C],
- ["E5D0",0x900D],
- ["DE9D",0x900E],
- ["CDB8",0x900F],
- ["D6F0",0x9010],
- ["E5CF",0x9011],
- ["B5DD",0x9012],
- ["DE9E",0x9013],
- ["CDBE",0x9014],
- ["DE9F",0x9015],
- ["E5D1",0x9016],
- ["B6BA",0x9017],
- ["DEA0",0x9018],
- ["DF40",0x9019],
- ["CDA8",0x901A],
- ["B9E4",0x901B],
- ["DF41",0x901C],
- ["CAC5",0x901D],
- ["B3D1",0x901E],
- ["CBD9",0x901F],
- ["D4EC",0x9020],
- ["E5D2",0x9021],
- ["B7EA",0x9022],
- ["DF42",0x9023],
- ["DF43",0x9024],
- ["DF44",0x9025],
- ["E5CE",0x9026],
- ["DF45",0x9027],
- ["DF46",0x9028],
- ["DF47",0x9029],
- ["DF48",0x902A],
- ["DF49",0x902B],
- ["DF4A",0x902C],
- ["E5D5",0x902D],
- ["B4FE",0x902E],
- ["E5D6",0x902F],
- ["DF4B",0x9030],
- ["DF4C",0x9031],
- ["DF4D",0x9032],
- ["DF4E",0x9033],
- ["DF4F",0x9034],
- ["E5D3",0x9035],
- ["E5D4",0x9036],
- ["DF50",0x9037],
- ["D2DD",0x9038],
- ["DF51",0x9039],
- ["DF52",0x903A],
- ["C2DF",0x903B],
- ["B1C6",0x903C],
- ["DF53",0x903D],
- ["D3E2",0x903E],
- ["DF54",0x903F],
- ["DF55",0x9040],
- ["B6DD",0x9041],
- ["CBEC",0x9042],
- ["DF56",0x9043],
- ["E5D7",0x9044],
- ["DF57",0x9045],
- ["DF58",0x9046],
- ["D3F6",0x9047],
- ["DF59",0x9048],
- ["DF5A",0x9049],
- ["DF5B",0x904A],
- ["DF5C",0x904B],
- ["DF5D",0x904C],
- ["B1E9",0x904D],
- ["DF5E",0x904E],
- ["B6F4",0x904F],
- ["E5DA",0x9050],
- ["E5D8",0x9051],
- ["E5D9",0x9052],
- ["B5C0",0x9053],
- ["DF5F",0x9054],
- ["DF60",0x9055],
- ["DF61",0x9056],
- ["D2C5",0x9057],
- ["E5DC",0x9058],
- ["DF62",0x9059],
- ["DF63",0x905A],
- ["E5DE",0x905B],
- ["DF64",0x905C],
- ["DF65",0x905D],
- ["DF66",0x905E],
- ["DF67",0x905F],
- ["DF68",0x9060],
- ["DF69",0x9061],
- ["E5DD",0x9062],
- ["C7B2",0x9063],
- ["DF6A",0x9064],
- ["D2A3",0x9065],
- ["DF6B",0x9066],
- ["DF6C",0x9067],
- ["E5DB",0x9068],
- ["DF6D",0x9069],
- ["DF6E",0x906A],
- ["DF6F",0x906B],
- ["DF70",0x906C],
- ["D4E2",0x906D],
- ["D5DA",0x906E],
- ["DF71",0x906F],
- ["DF72",0x9070],
- ["DF73",0x9071],
- ["DF74",0x9072],
- ["DF75",0x9073],
- ["E5E0",0x9074],
- ["D7F1",0x9075],
- ["DF76",0x9076],
- ["DF77",0x9077],
- ["DF78",0x9078],
- ["DF79",0x9079],
- ["DF7A",0x907A],
- ["DF7B",0x907B],
- ["DF7C",0x907C],
- ["E5E1",0x907D],
- ["DF7D",0x907E],
- ["B1DC",0x907F],
- ["D1FB",0x9080],
- ["DF7E",0x9081],
- ["E5E2",0x9082],
- ["E5E4",0x9083],
- ["DF80",0x9084],
- ["DF81",0x9085],
- ["DF82",0x9086],
- ["DF83",0x9087],
- ["E5E3",0x9088],
- ["DF84",0x9089],
- ["DF85",0x908A],
- ["E5E5",0x908B],
- ["DF86",0x908C],
- ["DF87",0x908D],
- ["DF88",0x908E],
- ["DF89",0x908F],
- ["DF8A",0x9090],
- ["D2D8",0x9091],
- ["DF8B",0x9092],
- ["B5CB",0x9093],
- ["DF8C",0x9094],
- ["E7DF",0x9095],
- ["DF8D",0x9096],
- ["DAF5",0x9097],
- ["DF8E",0x9098],
- ["DAF8",0x9099],
- ["DF8F",0x909A],
- ["DAF6",0x909B],
- ["DF90",0x909C],
- ["DAF7",0x909D],
- ["DF91",0x909E],
- ["DF92",0x909F],
- ["DF93",0x90A0],
- ["DAFA",0x90A1],
- ["D0CF",0x90A2],
- ["C4C7",0x90A3],
- ["DF94",0x90A4],
- ["DF95",0x90A5],
- ["B0EE",0x90A6],
- ["DF96",0x90A7],
- ["DF97",0x90A8],
- ["DF98",0x90A9],
- ["D0B0",0x90AA],
- ["DF99",0x90AB],
- ["DAF9",0x90AC],
- ["DF9A",0x90AD],
- ["D3CA",0x90AE],
- ["BAAA",0x90AF],
- ["DBA2",0x90B0],
- ["C7F1",0x90B1],
- ["DF9B",0x90B2],
- ["DAFC",0x90B3],
- ["DAFB",0x90B4],
- ["C9DB",0x90B5],
- ["DAFD",0x90B6],
- ["DF9C",0x90B7],
- ["DBA1",0x90B8],
- ["D7DE",0x90B9],
- ["DAFE",0x90BA],
- ["C1DA",0x90BB],
- ["DF9D",0x90BC],
- ["DF9E",0x90BD],
- ["DBA5",0x90BE],
- ["DF9F",0x90BF],
- ["DFA0",0x90C0],
- ["D3F4",0x90C1],
- ["E040",0x90C2],
- ["E041",0x90C3],
- ["DBA7",0x90C4],
- ["DBA4",0x90C5],
- ["E042",0x90C6],
- ["DBA8",0x90C7],
- ["E043",0x90C8],
- ["E044",0x90C9],
- ["BDBC",0x90CA],
- ["E045",0x90CB],
- ["E046",0x90CC],
- ["E047",0x90CD],
- ["C0C9",0x90CE],
- ["DBA3",0x90CF],
- ["DBA6",0x90D0],
- ["D6A3",0x90D1],
- ["E048",0x90D2],
- ["DBA9",0x90D3],
- ["E049",0x90D4],
- ["E04A",0x90D5],
- ["E04B",0x90D6],
- ["DBAD",0x90D7],
- ["E04C",0x90D8],
- ["E04D",0x90D9],
- ["E04E",0x90DA],
- ["DBAE",0x90DB],
- ["DBAC",0x90DC],
- ["BAC2",0x90DD],
- ["E04F",0x90DE],
- ["E050",0x90DF],
- ["E051",0x90E0],
- ["BFA4",0x90E1],
- ["DBAB",0x90E2],
- ["E052",0x90E3],
- ["E053",0x90E4],
- ["E054",0x90E5],
- ["DBAA",0x90E6],
- ["D4C7",0x90E7],
- ["B2BF",0x90E8],
- ["E055",0x90E9],
- ["E056",0x90EA],
- ["DBAF",0x90EB],
- ["E057",0x90EC],
- ["B9F9",0x90ED],
- ["E058",0x90EE],
- ["DBB0",0x90EF],
- ["E059",0x90F0],
- ["E05A",0x90F1],
- ["E05B",0x90F2],
- ["E05C",0x90F3],
- ["B3BB",0x90F4],
- ["E05D",0x90F5],
- ["E05E",0x90F6],
- ["E05F",0x90F7],
- ["B5A6",0x90F8],
- ["E060",0x90F9],
- ["E061",0x90FA],
- ["E062",0x90FB],
- ["E063",0x90FC],
- ["B6BC",0x90FD],
- ["DBB1",0x90FE],
- ["E064",0x90FF],
- ["E065",0x9100],
- ["E066",0x9101],
- ["B6F5",0x9102],
- ["E067",0x9103],
- ["DBB2",0x9104],
- ["E068",0x9105],
- ["E069",0x9106],
- ["E06A",0x9107],
- ["E06B",0x9108],
- ["E06C",0x9109],
- ["E06D",0x910A],
- ["E06E",0x910B],
- ["E06F",0x910C],
- ["E070",0x910D],
- ["E071",0x910E],
- ["E072",0x910F],
- ["E073",0x9110],
- ["E074",0x9111],
- ["E075",0x9112],
- ["E076",0x9113],
- ["E077",0x9114],
- ["E078",0x9115],
- ["E079",0x9116],
- ["E07A",0x9117],
- ["E07B",0x9118],
- ["B1C9",0x9119],
- ["E07C",0x911A],
- ["E07D",0x911B],
- ["E07E",0x911C],
- ["E080",0x911D],
- ["DBB4",0x911E],
- ["E081",0x911F],
- ["E082",0x9120],
- ["E083",0x9121],
- ["DBB3",0x9122],
- ["DBB5",0x9123],
- ["E084",0x9124],
- ["E085",0x9125],
- ["E086",0x9126],
- ["E087",0x9127],
- ["E088",0x9128],
- ["E089",0x9129],
- ["E08A",0x912A],
- ["E08B",0x912B],
- ["E08C",0x912C],
- ["E08D",0x912D],
- ["E08E",0x912E],
- ["DBB7",0x912F],
- ["E08F",0x9130],
- ["DBB6",0x9131],
- ["E090",0x9132],
- ["E091",0x9133],
- ["E092",0x9134],
- ["E093",0x9135],
- ["E094",0x9136],
- ["E095",0x9137],
- ["E096",0x9138],
- ["DBB8",0x9139],
- ["E097",0x913A],
- ["E098",0x913B],
- ["E099",0x913C],
- ["E09A",0x913D],
- ["E09B",0x913E],
- ["E09C",0x913F],
- ["E09D",0x9140],
- ["E09E",0x9141],
- ["E09F",0x9142],
- ["DBB9",0x9143],
- ["E0A0",0x9144],
- ["E140",0x9145],
- ["DBBA",0x9146],
- ["E141",0x9147],
- ["E142",0x9148],
- ["D3CF",0x9149],
- ["F4FA",0x914A],
- ["C7F5",0x914B],
- ["D7C3",0x914C],
- ["C5E4",0x914D],
- ["F4FC",0x914E],
- ["F4FD",0x914F],
- ["F4FB",0x9150],
- ["E143",0x9151],
- ["BEC6",0x9152],
- ["E144",0x9153],
- ["E145",0x9154],
- ["E146",0x9155],
- ["E147",0x9156],
- ["D0EF",0x9157],
- ["E148",0x9158],
- ["E149",0x9159],
- ["B7D3",0x915A],
- ["E14A",0x915B],
- ["E14B",0x915C],
- ["D4CD",0x915D],
- ["CCAA",0x915E],
- ["E14C",0x915F],
- ["E14D",0x9160],
- ["F5A2",0x9161],
- ["F5A1",0x9162],
- ["BAA8",0x9163],
- ["F4FE",0x9164],
- ["CBD6",0x9165],
- ["E14E",0x9166],
- ["E14F",0x9167],
- ["E150",0x9168],
- ["F5A4",0x9169],
- ["C0D2",0x916A],
- ["E151",0x916B],
- ["B3EA",0x916C],
- ["E152",0x916D],
- ["CDAA",0x916E],
- ["F5A5",0x916F],
- ["F5A3",0x9170],
- ["BDB4",0x9171],
- ["F5A8",0x9172],
- ["E153",0x9173],
- ["F5A9",0x9174],
- ["BDCD",0x9175],
- ["C3B8",0x9176],
- ["BFE1",0x9177],
- ["CBE1",0x9178],
- ["F5AA",0x9179],
- ["E154",0x917A],
- ["E155",0x917B],
- ["E156",0x917C],
- ["F5A6",0x917D],
- ["F5A7",0x917E],
- ["C4F0",0x917F],
- ["E157",0x9180],
- ["E158",0x9181],
- ["E159",0x9182],
- ["E15A",0x9183],
- ["E15B",0x9184],
- ["F5AC",0x9185],
- ["E15C",0x9186],
- ["B4BC",0x9187],
- ["E15D",0x9188],
- ["D7ED",0x9189],
- ["E15E",0x918A],
- ["B4D7",0x918B],
- ["F5AB",0x918C],
- ["F5AE",0x918D],
- ["E15F",0x918E],
- ["E160",0x918F],
- ["F5AD",0x9190],
- ["F5AF",0x9191],
- ["D0D1",0x9192],
- ["E161",0x9193],
- ["E162",0x9194],
- ["E163",0x9195],
- ["E164",0x9196],
- ["E165",0x9197],
- ["E166",0x9198],
- ["E167",0x9199],
- ["C3D1",0x919A],
- ["C8A9",0x919B],
- ["E168",0x919C],
- ["E169",0x919D],
- ["E16A",0x919E],
- ["E16B",0x919F],
- ["E16C",0x91A0],
- ["E16D",0x91A1],
- ["F5B0",0x91A2],
- ["F5B1",0x91A3],
- ["E16E",0x91A4],
- ["E16F",0x91A5],
- ["E170",0x91A6],
- ["E171",0x91A7],
- ["E172",0x91A8],
- ["E173",0x91A9],
- ["F5B2",0x91AA],
- ["E174",0x91AB],
- ["E175",0x91AC],
- ["F5B3",0x91AD],
- ["F5B4",0x91AE],
- ["F5B5",0x91AF],
- ["E176",0x91B0],
- ["E177",0x91B1],
- ["E178",0x91B2],
- ["E179",0x91B3],
- ["F5B7",0x91B4],
- ["F5B6",0x91B5],
- ["E17A",0x91B6],
- ["E17B",0x91B7],
- ["E17C",0x91B8],
- ["E17D",0x91B9],
- ["F5B8",0x91BA],
- ["E17E",0x91BB],
- ["E180",0x91BC],
- ["E181",0x91BD],
- ["E182",0x91BE],
- ["E183",0x91BF],
- ["E184",0x91C0],
- ["E185",0x91C1],
- ["E186",0x91C2],
- ["E187",0x91C3],
- ["E188",0x91C4],
- ["E189",0x91C5],
- ["E18A",0x91C6],
- ["B2C9",0x91C7],
- ["E18B",0x91C8],
- ["D3D4",0x91C9],
- ["CACD",0x91CA],
- ["E18C",0x91CB],
- ["C0EF",0x91CC],
- ["D6D8",0x91CD],
- ["D2B0",0x91CE],
- ["C1BF",0x91CF],
- ["E18D",0x91D0],
- ["BDF0",0x91D1],
- ["E18E",0x91D2],
- ["E18F",0x91D3],
- ["E190",0x91D4],
- ["E191",0x91D5],
- ["E192",0x91D6],
- ["E193",0x91D7],
- ["E194",0x91D8],
- ["E195",0x91D9],
- ["E196",0x91DA],
- ["E197",0x91DB],
- ["B8AA",0x91DC],
- ["E198",0x91DD],
- ["E199",0x91DE],
- ["E19A",0x91DF],
- ["E19B",0x91E0],
- ["E19C",0x91E1],
- ["E19D",0x91E2],
- ["E19E",0x91E3],
- ["E19F",0x91E4],
- ["E1A0",0x91E5],
- ["E240",0x91E6],
- ["E241",0x91E7],
- ["E242",0x91E8],
- ["E243",0x91E9],
- ["E244",0x91EA],
- ["E245",0x91EB],
- ["E246",0x91EC],
- ["E247",0x91ED],
- ["E248",0x91EE],
- ["E249",0x91EF],
- ["E24A",0x91F0],
- ["E24B",0x91F1],
- ["E24C",0x91F2],
- ["E24D",0x91F3],
- ["E24E",0x91F4],
- ["E24F",0x91F5],
- ["E250",0x91F6],
- ["E251",0x91F7],
- ["E252",0x91F8],
- ["E253",0x91F9],
- ["E254",0x91FA],
- ["E255",0x91FB],
- ["E256",0x91FC],
- ["E257",0x91FD],
- ["E258",0x91FE],
- ["E259",0x91FF],
- ["E25A",0x9200],
- ["E25B",0x9201],
- ["E25C",0x9202],
- ["E25D",0x9203],
- ["E25E",0x9204],
- ["E25F",0x9205],
- ["E260",0x9206],
- ["E261",0x9207],
- ["E262",0x9208],
- ["E263",0x9209],
- ["E264",0x920A],
- ["E265",0x920B],
- ["E266",0x920C],
- ["E267",0x920D],
- ["E268",0x920E],
- ["E269",0x920F],
- ["E26A",0x9210],
- ["E26B",0x9211],
- ["E26C",0x9212],
- ["E26D",0x9213],
- ["E26E",0x9214],
- ["E26F",0x9215],
- ["E270",0x9216],
- ["E271",0x9217],
- ["E272",0x9218],
- ["E273",0x9219],
- ["E274",0x921A],
- ["E275",0x921B],
- ["E276",0x921C],
- ["E277",0x921D],
- ["E278",0x921E],
- ["E279",0x921F],
- ["E27A",0x9220],
- ["E27B",0x9221],
- ["E27C",0x9222],
- ["E27D",0x9223],
- ["E27E",0x9224],
- ["E280",0x9225],
- ["E281",0x9226],
- ["E282",0x9227],
- ["E283",0x9228],
- ["E284",0x9229],
- ["E285",0x922A],
- ["E286",0x922B],
- ["E287",0x922C],
- ["E288",0x922D],
- ["E289",0x922E],
- ["E28A",0x922F],
- ["E28B",0x9230],
- ["E28C",0x9231],
- ["E28D",0x9232],
- ["E28E",0x9233],
- ["E28F",0x9234],
- ["E290",0x9235],
- ["E291",0x9236],
- ["E292",0x9237],
- ["E293",0x9238],
- ["E294",0x9239],
- ["E295",0x923A],
- ["E296",0x923B],
- ["E297",0x923C],
- ["E298",0x923D],
- ["E299",0x923E],
- ["E29A",0x923F],
- ["E29B",0x9240],
- ["E29C",0x9241],
- ["E29D",0x9242],
- ["E29E",0x9243],
- ["E29F",0x9244],
- ["E2A0",0x9245],
- ["E340",0x9246],
- ["E341",0x9247],
- ["E342",0x9248],
- ["E343",0x9249],
- ["E344",0x924A],
- ["E345",0x924B],
- ["E346",0x924C],
- ["E347",0x924D],
- ["E348",0x924E],
- ["E349",0x924F],
- ["E34A",0x9250],
- ["E34B",0x9251],
- ["E34C",0x9252],
- ["E34D",0x9253],
- ["E34E",0x9254],
- ["E34F",0x9255],
- ["E350",0x9256],
- ["E351",0x9257],
- ["E352",0x9258],
- ["E353",0x9259],
- ["E354",0x925A],
- ["E355",0x925B],
- ["E356",0x925C],
- ["E357",0x925D],
- ["E358",0x925E],
- ["E359",0x925F],
- ["E35A",0x9260],
- ["E35B",0x9261],
- ["E35C",0x9262],
- ["E35D",0x9263],
- ["E35E",0x9264],
- ["E35F",0x9265],
- ["E360",0x9266],
- ["E361",0x9267],
- ["E362",0x9268],
- ["E363",0x9269],
- ["E364",0x926A],
- ["E365",0x926B],
- ["E366",0x926C],
- ["E367",0x926D],
- ["E368",0x926E],
- ["E369",0x926F],
- ["E36A",0x9270],
- ["E36B",0x9271],
- ["E36C",0x9272],
- ["E36D",0x9273],
- ["BCF8",0x9274],
- ["E36E",0x9275],
- ["E36F",0x9276],
- ["E370",0x9277],
- ["E371",0x9278],
- ["E372",0x9279],
- ["E373",0x927A],
- ["E374",0x927B],
- ["E375",0x927C],
- ["E376",0x927D],
- ["E377",0x927E],
- ["E378",0x927F],
- ["E379",0x9280],
- ["E37A",0x9281],
- ["E37B",0x9282],
- ["E37C",0x9283],
- ["E37D",0x9284],
- ["E37E",0x9285],
- ["E380",0x9286],
- ["E381",0x9287],
- ["E382",0x9288],
- ["E383",0x9289],
- ["E384",0x928A],
- ["E385",0x928B],
- ["E386",0x928C],
- ["E387",0x928D],
- ["F6C6",0x928E],
- ["E388",0x928F],
- ["E389",0x9290],
- ["E38A",0x9291],
- ["E38B",0x9292],
- ["E38C",0x9293],
- ["E38D",0x9294],
- ["E38E",0x9295],
- ["E38F",0x9296],
- ["E390",0x9297],
- ["E391",0x9298],
- ["E392",0x9299],
- ["E393",0x929A],
- ["E394",0x929B],
- ["E395",0x929C],
- ["E396",0x929D],
- ["E397",0x929E],
- ["E398",0x929F],
- ["E399",0x92A0],
- ["E39A",0x92A1],
- ["E39B",0x92A2],
- ["E39C",0x92A3],
- ["E39D",0x92A4],
- ["E39E",0x92A5],
- ["E39F",0x92A6],
- ["E3A0",0x92A7],
- ["E440",0x92A8],
- ["E441",0x92A9],
- ["E442",0x92AA],
- ["E443",0x92AB],
- ["E444",0x92AC],
- ["E445",0x92AD],
- ["F6C7",0x92AE],
- ["E446",0x92AF],
- ["E447",0x92B0],
- ["E448",0x92B1],
- ["E449",0x92B2],
- ["E44A",0x92B3],
- ["E44B",0x92B4],
- ["E44C",0x92B5],
- ["E44D",0x92B6],
- ["E44E",0x92B7],
- ["E44F",0x92B8],
- ["E450",0x92B9],
- ["E451",0x92BA],
- ["E452",0x92BB],
- ["E453",0x92BC],
- ["E454",0x92BD],
- ["E455",0x92BE],
- ["E456",0x92BF],
- ["E457",0x92C0],
- ["E458",0x92C1],
- ["E459",0x92C2],
- ["E45A",0x92C3],
- ["E45B",0x92C4],
- ["E45C",0x92C5],
- ["E45D",0x92C6],
- ["E45E",0x92C7],
- ["F6C8",0x92C8],
- ["E45F",0x92C9],
- ["E460",0x92CA],
- ["E461",0x92CB],
- ["E462",0x92CC],
- ["E463",0x92CD],
- ["E464",0x92CE],
- ["E465",0x92CF],
- ["E466",0x92D0],
- ["E467",0x92D1],
- ["E468",0x92D2],
- ["E469",0x92D3],
- ["E46A",0x92D4],
- ["E46B",0x92D5],
- ["E46C",0x92D6],
- ["E46D",0x92D7],
- ["E46E",0x92D8],
- ["E46F",0x92D9],
- ["E470",0x92DA],
- ["E471",0x92DB],
- ["E472",0x92DC],
- ["E473",0x92DD],
- ["E474",0x92DE],
- ["E475",0x92DF],
- ["E476",0x92E0],
- ["E477",0x92E1],
- ["E478",0x92E2],
- ["E479",0x92E3],
- ["E47A",0x92E4],
- ["E47B",0x92E5],
- ["E47C",0x92E6],
- ["E47D",0x92E7],
- ["E47E",0x92E8],
- ["E480",0x92E9],
- ["E481",0x92EA],
- ["E482",0x92EB],
- ["E483",0x92EC],
- ["E484",0x92ED],
- ["E485",0x92EE],
- ["E486",0x92EF],
- ["E487",0x92F0],
- ["E488",0x92F1],
- ["E489",0x92F2],
- ["E48A",0x92F3],
- ["E48B",0x92F4],
- ["E48C",0x92F5],
- ["E48D",0x92F6],
- ["E48E",0x92F7],
- ["E48F",0x92F8],
- ["E490",0x92F9],
- ["E491",0x92FA],
- ["E492",0x92FB],
- ["E493",0x92FC],
- ["E494",0x92FD],
- ["E495",0x92FE],
- ["E496",0x92FF],
- ["E497",0x9300],
- ["E498",0x9301],
- ["E499",0x9302],
- ["E49A",0x9303],
- ["E49B",0x9304],
- ["E49C",0x9305],
- ["E49D",0x9306],
- ["E49E",0x9307],
- ["E49F",0x9308],
- ["E4A0",0x9309],
- ["E540",0x930A],
- ["E541",0x930B],
- ["E542",0x930C],
- ["E543",0x930D],
- ["E544",0x930E],
- ["E545",0x930F],
- ["E546",0x9310],
- ["E547",0x9311],
- ["E548",0x9312],
- ["E549",0x9313],
- ["E54A",0x9314],
- ["E54B",0x9315],
- ["E54C",0x9316],
- ["E54D",0x9317],
- ["E54E",0x9318],
- ["E54F",0x9319],
- ["E550",0x931A],
- ["E551",0x931B],
- ["E552",0x931C],
- ["E553",0x931D],
- ["E554",0x931E],
- ["E555",0x931F],
- ["E556",0x9320],
- ["E557",0x9321],
- ["E558",0x9322],
- ["E559",0x9323],
- ["E55A",0x9324],
- ["E55B",0x9325],
- ["E55C",0x9326],
- ["E55D",0x9327],
- ["E55E",0x9328],
- ["E55F",0x9329],
- ["E560",0x932A],
- ["E561",0x932B],
- ["E562",0x932C],
- ["E563",0x932D],
- ["E564",0x932E],
- ["E565",0x932F],
- ["E566",0x9330],
- ["E567",0x9331],
- ["E568",0x9332],
- ["E569",0x9333],
- ["E56A",0x9334],
- ["E56B",0x9335],
- ["E56C",0x9336],
- ["E56D",0x9337],
- ["E56E",0x9338],
- ["E56F",0x9339],
- ["E570",0x933A],
- ["E571",0x933B],
- ["E572",0x933C],
- ["E573",0x933D],
- ["F6C9",0x933E],
- ["E574",0x933F],
- ["E575",0x9340],
- ["E576",0x9341],
- ["E577",0x9342],
- ["E578",0x9343],
- ["E579",0x9344],
- ["E57A",0x9345],
- ["E57B",0x9346],
- ["E57C",0x9347],
- ["E57D",0x9348],
- ["E57E",0x9349],
- ["E580",0x934A],
- ["E581",0x934B],
- ["E582",0x934C],
- ["E583",0x934D],
- ["E584",0x934E],
- ["E585",0x934F],
- ["E586",0x9350],
- ["E587",0x9351],
- ["E588",0x9352],
- ["E589",0x9353],
- ["E58A",0x9354],
- ["E58B",0x9355],
- ["E58C",0x9356],
- ["E58D",0x9357],
- ["E58E",0x9358],
- ["E58F",0x9359],
- ["E590",0x935A],
- ["E591",0x935B],
- ["E592",0x935C],
- ["E593",0x935D],
- ["E594",0x935E],
- ["E595",0x935F],
- ["E596",0x9360],
- ["E597",0x9361],
- ["E598",0x9362],
- ["E599",0x9363],
- ["E59A",0x9364],
- ["E59B",0x9365],
- ["E59C",0x9366],
- ["E59D",0x9367],
- ["E59E",0x9368],
- ["E59F",0x9369],
- ["F6CA",0x936A],
- ["E5A0",0x936B],
- ["E640",0x936C],
- ["E641",0x936D],
- ["E642",0x936E],
- ["E643",0x936F],
- ["E644",0x9370],
- ["E645",0x9371],
- ["E646",0x9372],
- ["E647",0x9373],
- ["E648",0x9374],
- ["E649",0x9375],
- ["E64A",0x9376],
- ["E64B",0x9377],
- ["E64C",0x9378],
- ["E64D",0x9379],
- ["E64E",0x937A],
- ["E64F",0x937B],
- ["E650",0x937C],
- ["E651",0x937D],
- ["E652",0x937E],
- ["E653",0x937F],
- ["E654",0x9380],
- ["E655",0x9381],
- ["E656",0x9382],
- ["E657",0x9383],
- ["E658",0x9384],
- ["E659",0x9385],
- ["E65A",0x9386],
- ["E65B",0x9387],
- ["E65C",0x9388],
- ["E65D",0x9389],
- ["E65E",0x938A],
- ["E65F",0x938B],
- ["E660",0x938C],
- ["E661",0x938D],
- ["E662",0x938E],
- ["F6CC",0x938F],
- ["E663",0x9390],
- ["E664",0x9391],
- ["E665",0x9392],
- ["E666",0x9393],
- ["E667",0x9394],
- ["E668",0x9395],
- ["E669",0x9396],
- ["E66A",0x9397],
- ["E66B",0x9398],
- ["E66C",0x9399],
- ["E66D",0x939A],
- ["E66E",0x939B],
- ["E66F",0x939C],
- ["E670",0x939D],
- ["E671",0x939E],
- ["E672",0x939F],
- ["E673",0x93A0],
- ["E674",0x93A1],
- ["E675",0x93A2],
- ["E676",0x93A3],
- ["E677",0x93A4],
- ["E678",0x93A5],
- ["E679",0x93A6],
- ["E67A",0x93A7],
- ["E67B",0x93A8],
- ["E67C",0x93A9],
- ["E67D",0x93AA],
- ["E67E",0x93AB],
- ["E680",0x93AC],
- ["E681",0x93AD],
- ["E682",0x93AE],
- ["E683",0x93AF],
- ["E684",0x93B0],
- ["E685",0x93B1],
- ["E686",0x93B2],
- ["E687",0x93B3],
- ["E688",0x93B4],
- ["E689",0x93B5],
- ["E68A",0x93B6],
- ["E68B",0x93B7],
- ["E68C",0x93B8],
- ["E68D",0x93B9],
- ["E68E",0x93BA],
- ["E68F",0x93BB],
- ["E690",0x93BC],
- ["E691",0x93BD],
- ["E692",0x93BE],
- ["E693",0x93BF],
- ["E694",0x93C0],
- ["E695",0x93C1],
- ["E696",0x93C2],
- ["E697",0x93C3],
- ["E698",0x93C4],
- ["E699",0x93C5],
- ["E69A",0x93C6],
- ["E69B",0x93C7],
- ["E69C",0x93C8],
- ["E69D",0x93C9],
- ["F6CB",0x93CA],
- ["E69E",0x93CB],
- ["E69F",0x93CC],
- ["E6A0",0x93CD],
- ["E740",0x93CE],
- ["E741",0x93CF],
- ["E742",0x93D0],
- ["E743",0x93D1],
- ["E744",0x93D2],
- ["E745",0x93D3],
- ["E746",0x93D4],
- ["E747",0x93D5],
- ["F7E9",0x93D6],
- ["E748",0x93D7],
- ["E749",0x93D8],
- ["E74A",0x93D9],
- ["E74B",0x93DA],
- ["E74C",0x93DB],
- ["E74D",0x93DC],
- ["E74E",0x93DD],
- ["E74F",0x93DE],
- ["E750",0x93DF],
- ["E751",0x93E0],
- ["E752",0x93E1],
- ["E753",0x93E2],
- ["E754",0x93E3],
- ["E755",0x93E4],
- ["E756",0x93E5],
- ["E757",0x93E6],
- ["E758",0x93E7],
- ["E759",0x93E8],
- ["E75A",0x93E9],
- ["E75B",0x93EA],
- ["E75C",0x93EB],
- ["E75D",0x93EC],
- ["E75E",0x93ED],
- ["E75F",0x93EE],
- ["E760",0x93EF],
- ["E761",0x93F0],
- ["E762",0x93F1],
- ["E763",0x93F2],
- ["E764",0x93F3],
- ["E765",0x93F4],
- ["E766",0x93F5],
- ["E767",0x93F6],
- ["E768",0x93F7],
- ["E769",0x93F8],
- ["E76A",0x93F9],
- ["E76B",0x93FA],
- ["E76C",0x93FB],
- ["E76D",0x93FC],
- ["E76E",0x93FD],
- ["E76F",0x93FE],
- ["E770",0x93FF],
- ["E771",0x9400],
- ["E772",0x9401],
- ["E773",0x9402],
- ["E774",0x9403],
- ["E775",0x9404],
- ["E776",0x9405],
- ["E777",0x9406],
- ["E778",0x9407],
- ["E779",0x9408],
- ["E77A",0x9409],
- ["E77B",0x940A],
- ["E77C",0x940B],
- ["E77D",0x940C],
- ["E77E",0x940D],
- ["E780",0x940E],
- ["E781",0x940F],
- ["E782",0x9410],
- ["E783",0x9411],
- ["E784",0x9412],
- ["E785",0x9413],
- ["E786",0x9414],
- ["E787",0x9415],
- ["E788",0x9416],
- ["E789",0x9417],
- ["E78A",0x9418],
- ["E78B",0x9419],
- ["E78C",0x941A],
- ["E78D",0x941B],
- ["E78E",0x941C],
- ["E78F",0x941D],
- ["E790",0x941E],
- ["E791",0x941F],
- ["E792",0x9420],
- ["E793",0x9421],
- ["E794",0x9422],
- ["E795",0x9423],
- ["E796",0x9424],
- ["E797",0x9425],
- ["E798",0x9426],
- ["E799",0x9427],
- ["E79A",0x9428],
- ["E79B",0x9429],
- ["E79C",0x942A],
- ["E79D",0x942B],
- ["E79E",0x942C],
- ["E79F",0x942D],
- ["E7A0",0x942E],
- ["E840",0x942F],
- ["E841",0x9430],
- ["E842",0x9431],
- ["E843",0x9432],
- ["E844",0x9433],
- ["E845",0x9434],
- ["E846",0x9435],
- ["E847",0x9436],
- ["E848",0x9437],
- ["E849",0x9438],
- ["E84A",0x9439],
- ["E84B",0x943A],
- ["E84C",0x943B],
- ["E84D",0x943C],
- ["E84E",0x943D],
- ["F6CD",0x943E],
- ["E84F",0x943F],
- ["E850",0x9440],
- ["E851",0x9441],
- ["E852",0x9442],
- ["E853",0x9443],
- ["E854",0x9444],
- ["E855",0x9445],
- ["E856",0x9446],
- ["E857",0x9447],
- ["E858",0x9448],
- ["E859",0x9449],
- ["E85A",0x944A],
- ["E85B",0x944B],
- ["E85C",0x944C],
- ["E85D",0x944D],
- ["E85E",0x944E],
- ["E85F",0x944F],
- ["E860",0x9450],
- ["E861",0x9451],
- ["E862",0x9452],
- ["E863",0x9453],
- ["E864",0x9454],
- ["E865",0x9455],
- ["E866",0x9456],
- ["E867",0x9457],
- ["E868",0x9458],
- ["E869",0x9459],
- ["E86A",0x945A],
- ["E86B",0x945B],
- ["E86C",0x945C],
- ["E86D",0x945D],
- ["E86E",0x945E],
- ["E86F",0x945F],
- ["E870",0x9460],
- ["E871",0x9461],
- ["E872",0x9462],
- ["E873",0x9463],
- ["E874",0x9464],
- ["E875",0x9465],
- ["E876",0x9466],
- ["E877",0x9467],
- ["E878",0x9468],
- ["E879",0x9469],
- ["E87A",0x946A],
- ["F6CE",0x946B],
- ["E87B",0x946C],
- ["E87C",0x946D],
- ["E87D",0x946E],
- ["E87E",0x946F],
- ["E880",0x9470],
- ["E881",0x9471],
- ["E882",0x9472],
- ["E883",0x9473],
- ["E884",0x9474],
- ["E885",0x9475],
- ["E886",0x9476],
- ["E887",0x9477],
- ["E888",0x9478],
- ["E889",0x9479],
- ["E88A",0x947A],
- ["E88B",0x947B],
- ["E88C",0x947C],
- ["E88D",0x947D],
- ["E88E",0x947E],
- ["E88F",0x947F],
- ["E890",0x9480],
- ["E891",0x9481],
- ["E892",0x9482],
- ["E893",0x9483],
- ["E894",0x9484],
- ["EEC4",0x9485],
- ["EEC5",0x9486],
- ["EEC6",0x9487],
- ["D5EB",0x9488],
- ["B6A4",0x9489],
- ["EEC8",0x948A],
- ["EEC7",0x948B],
- ["EEC9",0x948C],
- ["EECA",0x948D],
- ["C7A5",0x948E],
- ["EECB",0x948F],
- ["EECC",0x9490],
- ["E895",0x9491],
- ["B7B0",0x9492],
- ["B5F6",0x9493],
- ["EECD",0x9494],
- ["EECF",0x9495],
- ["E896",0x9496],
- ["EECE",0x9497],
- ["E897",0x9498],
- ["B8C6",0x9499],
- ["EED0",0x949A],
- ["EED1",0x949B],
- ["EED2",0x949C],
- ["B6DB",0x949D],
- ["B3AE",0x949E],
- ["D6D3",0x949F],
- ["C4C6",0x94A0],
- ["B1B5",0x94A1],
- ["B8D6",0x94A2],
- ["EED3",0x94A3],
- ["EED4",0x94A4],
- ["D4BF",0x94A5],
- ["C7D5",0x94A6],
- ["BEFB",0x94A7],
- ["CED9",0x94A8],
- ["B9B3",0x94A9],
- ["EED6",0x94AA],
- ["EED5",0x94AB],
- ["EED8",0x94AC],
- ["EED7",0x94AD],
- ["C5A5",0x94AE],
- ["EED9",0x94AF],
- ["EEDA",0x94B0],
- ["C7AE",0x94B1],
- ["EEDB",0x94B2],
- ["C7AF",0x94B3],
- ["EEDC",0x94B4],
- ["B2A7",0x94B5],
- ["EEDD",0x94B6],
- ["EEDE",0x94B7],
- ["EEDF",0x94B8],
- ["EEE0",0x94B9],
- ["EEE1",0x94BA],
- ["D7EA",0x94BB],
- ["EEE2",0x94BC],
- ["EEE3",0x94BD],
- ["BCD8",0x94BE],
- ["EEE4",0x94BF],
- ["D3CB",0x94C0],
- ["CCFA",0x94C1],
- ["B2AC",0x94C2],
- ["C1E5",0x94C3],
- ["EEE5",0x94C4],
- ["C7A6",0x94C5],
- ["C3AD",0x94C6],
- ["E898",0x94C7],
- ["EEE6",0x94C8],
- ["EEE7",0x94C9],
- ["EEE8",0x94CA],
- ["EEE9",0x94CB],
- ["EEEA",0x94CC],
- ["EEEB",0x94CD],
- ["EEEC",0x94CE],
- ["E899",0x94CF],
- ["EEED",0x94D0],
- ["EEEE",0x94D1],
- ["EEEF",0x94D2],
- ["E89A",0x94D3],
- ["E89B",0x94D4],
- ["EEF0",0x94D5],
- ["EEF1",0x94D6],
- ["EEF2",0x94D7],
- ["EEF4",0x94D8],
- ["EEF3",0x94D9],
- ["E89C",0x94DA],
- ["EEF5",0x94DB],
- ["CDAD",0x94DC],
- ["C2C1",0x94DD],
- ["EEF6",0x94DE],
- ["EEF7",0x94DF],
- ["EEF8",0x94E0],
- ["D5A1",0x94E1],
- ["EEF9",0x94E2],
- ["CFB3",0x94E3],
- ["EEFA",0x94E4],
- ["EEFB",0x94E5],
- ["E89D",0x94E6],
- ["EEFC",0x94E7],
- ["EEFD",0x94E8],
- ["EFA1",0x94E9],
- ["EEFE",0x94EA],
- ["EFA2",0x94EB],
- ["B8F5",0x94EC],
- ["C3FA",0x94ED],
- ["EFA3",0x94EE],
- ["EFA4",0x94EF],
- ["BDC2",0x94F0],
- ["D2BF",0x94F1],
- ["B2F9",0x94F2],
- ["EFA5",0x94F3],
- ["EFA6",0x94F4],
- ["EFA7",0x94F5],
- ["D2F8",0x94F6],
- ["EFA8",0x94F7],
- ["D6FD",0x94F8],
- ["EFA9",0x94F9],
- ["C6CC",0x94FA],
- ["E89E",0x94FB],
- ["EFAA",0x94FC],
- ["EFAB",0x94FD],
- ["C1B4",0x94FE],
- ["EFAC",0x94FF],
- ["CFFA",0x9500],
- ["CBF8",0x9501],
- ["EFAE",0x9502],
- ["EFAD",0x9503],
- ["B3FA",0x9504],
- ["B9F8",0x9505],
- ["EFAF",0x9506],
- ["EFB0",0x9507],
- ["D0E2",0x9508],
- ["EFB1",0x9509],
- ["EFB2",0x950A],
- ["B7E6",0x950B],
- ["D0BF",0x950C],
- ["EFB3",0x950D],
- ["EFB4",0x950E],
- ["EFB5",0x950F],
- ["C8F1",0x9510],
- ["CCE0",0x9511],
- ["EFB6",0x9512],
- ["EFB7",0x9513],
- ["EFB8",0x9514],
- ["EFB9",0x9515],
- ["EFBA",0x9516],
- ["D5E0",0x9517],
- ["EFBB",0x9518],
- ["B4ED",0x9519],
- ["C3AA",0x951A],
- ["EFBC",0x951B],
- ["E89F",0x951C],
- ["EFBD",0x951D],
- ["EFBE",0x951E],
- ["EFBF",0x951F],
- ["E8A0",0x9520],
- ["CEFD",0x9521],
- ["EFC0",0x9522],
- ["C2E0",0x9523],
- ["B4B8",0x9524],
- ["D7B6",0x9525],
- ["BDF5",0x9526],
- ["E940",0x9527],
- ["CFC7",0x9528],
- ["EFC3",0x9529],
- ["EFC1",0x952A],
- ["EFC2",0x952B],
- ["EFC4",0x952C],
- ["B6A7",0x952D],
- ["BCFC",0x952E],
- ["BEE2",0x952F],
- ["C3CC",0x9530],
- ["EFC5",0x9531],
- ["EFC6",0x9532],
- ["E941",0x9533],
- ["EFC7",0x9534],
- ["EFCF",0x9535],
- ["EFC8",0x9536],
- ["EFC9",0x9537],
- ["EFCA",0x9538],
- ["C7C2",0x9539],
- ["EFF1",0x953A],
- ["B6CD",0x953B],
- ["EFCB",0x953C],
- ["E942",0x953D],
- ["EFCC",0x953E],
- ["EFCD",0x953F],
- ["B6C6",0x9540],
- ["C3BE",0x9541],
- ["EFCE",0x9542],
- ["E943",0x9543],
- ["EFD0",0x9544],
- ["EFD1",0x9545],
- ["EFD2",0x9546],
- ["D5F2",0x9547],
- ["E944",0x9548],
- ["EFD3",0x9549],
- ["C4F7",0x954A],
- ["E945",0x954B],
- ["EFD4",0x954C],
- ["C4F8",0x954D],
- ["EFD5",0x954E],
- ["EFD6",0x954F],
- ["B8E4",0x9550],
- ["B0F7",0x9551],
- ["EFD7",0x9552],
- ["EFD8",0x9553],
- ["EFD9",0x9554],
- ["E946",0x9555],
- ["EFDA",0x9556],
- ["EFDB",0x9557],
- ["EFDC",0x9558],
- ["EFDD",0x9559],
- ["E947",0x955A],
- ["EFDE",0x955B],
- ["BEB5",0x955C],
- ["EFE1",0x955D],
- ["EFDF",0x955E],
- ["EFE0",0x955F],
- ["E948",0x9560],
- ["EFE2",0x9561],
- ["EFE3",0x9562],
- ["C1CD",0x9563],
- ["EFE4",0x9564],
- ["EFE5",0x9565],
- ["EFE6",0x9566],
- ["EFE7",0x9567],
- ["EFE8",0x9568],
- ["EFE9",0x9569],
- ["EFEA",0x956A],
- ["EFEB",0x956B],
- ["EFEC",0x956C],
- ["C0D8",0x956D],
- ["E949",0x956E],
- ["EFED",0x956F],
- ["C1AD",0x9570],
- ["EFEE",0x9571],
- ["EFEF",0x9572],
- ["EFF0",0x9573],
- ["E94A",0x9574],
- ["E94B",0x9575],
- ["CFE2",0x9576],
- ["E94C",0x9577],
- ["E94D",0x9578],
- ["E94E",0x9579],
- ["E94F",0x957A],
- ["E950",0x957B],
- ["E951",0x957C],
- ["E952",0x957D],
- ["E953",0x957E],
- ["B3A4",0x957F],
- ["E954",0x9580],
- ["E955",0x9581],
- ["E956",0x9582],
- ["E957",0x9583],
- ["E958",0x9584],
- ["E959",0x9585],
- ["E95A",0x9586],
- ["E95B",0x9587],
- ["E95C",0x9588],
- ["E95D",0x9589],
- ["E95E",0x958A],
- ["E95F",0x958B],
- ["E960",0x958C],
- ["E961",0x958D],
- ["E962",0x958E],
- ["E963",0x958F],
- ["E964",0x9590],
- ["E965",0x9591],
- ["E966",0x9592],
- ["E967",0x9593],
- ["E968",0x9594],
- ["E969",0x9595],
- ["E96A",0x9596],
- ["E96B",0x9597],
- ["E96C",0x9598],
- ["E96D",0x9599],
- ["E96E",0x959A],
- ["E96F",0x959B],
- ["E970",0x959C],
- ["E971",0x959D],
- ["E972",0x959E],
- ["E973",0x959F],
- ["E974",0x95A0],
- ["E975",0x95A1],
- ["E976",0x95A2],
- ["E977",0x95A3],
- ["E978",0x95A4],
- ["E979",0x95A5],
- ["E97A",0x95A6],
- ["E97B",0x95A7],
- ["E97C",0x95A8],
- ["E97D",0x95A9],
- ["E97E",0x95AA],
- ["E980",0x95AB],
- ["E981",0x95AC],
- ["E982",0x95AD],
- ["E983",0x95AE],
- ["E984",0x95AF],
- ["E985",0x95B0],
- ["E986",0x95B1],
- ["E987",0x95B2],
- ["E988",0x95B3],
- ["E989",0x95B4],
- ["E98A",0x95B5],
- ["E98B",0x95B6],
- ["E98C",0x95B7],
- ["E98D",0x95B8],
- ["E98E",0x95B9],
- ["E98F",0x95BA],
- ["E990",0x95BB],
- ["E991",0x95BC],
- ["E992",0x95BD],
- ["E993",0x95BE],
- ["E994",0x95BF],
- ["E995",0x95C0],
- ["E996",0x95C1],
- ["E997",0x95C2],
- ["E998",0x95C3],
- ["E999",0x95C4],
- ["E99A",0x95C5],
- ["E99B",0x95C6],
- ["E99C",0x95C7],
- ["E99D",0x95C8],
- ["E99E",0x95C9],
- ["E99F",0x95CA],
- ["E9A0",0x95CB],
- ["EA40",0x95CC],
- ["EA41",0x95CD],
- ["EA42",0x95CE],
- ["EA43",0x95CF],
- ["EA44",0x95D0],
- ["EA45",0x95D1],
- ["EA46",0x95D2],
- ["EA47",0x95D3],
- ["EA48",0x95D4],
- ["EA49",0x95D5],
- ["EA4A",0x95D6],
- ["EA4B",0x95D7],
- ["EA4C",0x95D8],
- ["EA4D",0x95D9],
- ["EA4E",0x95DA],
- ["EA4F",0x95DB],
- ["EA50",0x95DC],
- ["EA51",0x95DD],
- ["EA52",0x95DE],
- ["EA53",0x95DF],
- ["EA54",0x95E0],
- ["EA55",0x95E1],
- ["EA56",0x95E2],
- ["EA57",0x95E3],
- ["EA58",0x95E4],
- ["EA59",0x95E5],
- ["EA5A",0x95E6],
- ["EA5B",0x95E7],
- ["C3C5",0x95E8],
- ["E3C5",0x95E9],
- ["C9C1",0x95EA],
- ["E3C6",0x95EB],
- ["EA5C",0x95EC],
- ["B1D5",0x95ED],
- ["CECA",0x95EE],
- ["B4B3",0x95EF],
- ["C8F2",0x95F0],
- ["E3C7",0x95F1],
- ["CFD0",0x95F2],
- ["E3C8",0x95F3],
- ["BCE4",0x95F4],
- ["E3C9",0x95F5],
- ["E3CA",0x95F6],
- ["C3C6",0x95F7],
- ["D5A2",0x95F8],
- ["C4D6",0x95F9],
- ["B9EB",0x95FA],
- ["CEC5",0x95FB],
- ["E3CB",0x95FC],
- ["C3F6",0x95FD],
- ["E3CC",0x95FE],
- ["EA5D",0x95FF],
- ["B7A7",0x9600],
- ["B8F3",0x9601],
- ["BAD2",0x9602],
- ["E3CD",0x9603],
- ["E3CE",0x9604],
- ["D4C4",0x9605],
- ["E3CF",0x9606],
- ["EA5E",0x9607],
- ["E3D0",0x9608],
- ["D1CB",0x9609],
- ["E3D1",0x960A],
- ["E3D2",0x960B],
- ["E3D3",0x960C],
- ["E3D4",0x960D],
- ["D1D6",0x960E],
- ["E3D5",0x960F],
- ["B2FB",0x9610],
- ["C0BB",0x9611],
- ["E3D6",0x9612],
- ["EA5F",0x9613],
- ["C0AB",0x9614],
- ["E3D7",0x9615],
- ["E3D8",0x9616],
- ["E3D9",0x9617],
- ["EA60",0x9618],
- ["E3DA",0x9619],
- ["E3DB",0x961A],
- ["EA61",0x961B],
- ["B8B7",0x961C],
- ["DAE2",0x961D],
- ["EA62",0x961E],
- ["B6D3",0x961F],
- ["EA63",0x9620],
- ["DAE4",0x9621],
- ["DAE3",0x9622],
- ["EA64",0x9623],
- ["EA65",0x9624],
- ["EA66",0x9625],
- ["EA67",0x9626],
- ["EA68",0x9627],
- ["EA69",0x9628],
- ["EA6A",0x9629],
- ["DAE6",0x962A],
- ["EA6B",0x962B],
- ["EA6C",0x962C],
- ["EA6D",0x962D],
- ["C8EE",0x962E],
- ["EA6E",0x962F],
- ["EA6F",0x9630],
- ["DAE5",0x9631],
- ["B7C0",0x9632],
- ["D1F4",0x9633],
- ["D2F5",0x9634],
- ["D5F3",0x9635],
- ["BDD7",0x9636],
- ["EA70",0x9637],
- ["EA71",0x9638],
- ["EA72",0x9639],
- ["EA73",0x963A],
- ["D7E8",0x963B],
- ["DAE8",0x963C],
- ["DAE7",0x963D],
- ["EA74",0x963E],
- ["B0A2",0x963F],
- ["CDD3",0x9640],
- ["EA75",0x9641],
- ["DAE9",0x9642],
- ["EA76",0x9643],
- ["B8BD",0x9644],
- ["BCCA",0x9645],
- ["C2BD",0x9646],
- ["C2A4",0x9647],
- ["B3C2",0x9648],
- ["DAEA",0x9649],
- ["EA77",0x964A],
- ["C2AA",0x964B],
- ["C4B0",0x964C],
- ["BDB5",0x964D],
- ["EA78",0x964E],
- ["EA79",0x964F],
- ["CFDE",0x9650],
- ["EA7A",0x9651],
- ["EA7B",0x9652],
- ["EA7C",0x9653],
- ["DAEB",0x9654],
- ["C9C2",0x9655],
- ["EA7D",0x9656],
- ["EA7E",0x9657],
- ["EA80",0x9658],
- ["EA81",0x9659],
- ["EA82",0x965A],
- ["B1DD",0x965B],
- ["EA83",0x965C],
- ["EA84",0x965D],
- ["EA85",0x965E],
- ["DAEC",0x965F],
- ["EA86",0x9660],
- ["B6B8",0x9661],
- ["D4BA",0x9662],
- ["EA87",0x9663],
- ["B3FD",0x9664],
- ["EA88",0x9665],
- ["EA89",0x9666],
- ["DAED",0x9667],
- ["D4C9",0x9668],
- ["CFD5",0x9669],
- ["C5E3",0x966A],
- ["EA8A",0x966B],
- ["DAEE",0x966C],
- ["EA8B",0x966D],
- ["EA8C",0x966E],
- ["EA8D",0x966F],
- ["EA8E",0x9670],
- ["EA8F",0x9671],
- ["DAEF",0x9672],
- ["EA90",0x9673],
- ["DAF0",0x9674],
- ["C1EA",0x9675],
- ["CCD5",0x9676],
- ["CFDD",0x9677],
- ["EA91",0x9678],
- ["EA92",0x9679],
- ["EA93",0x967A],
- ["EA94",0x967B],
- ["EA95",0x967C],
- ["EA96",0x967D],
- ["EA97",0x967E],
- ["EA98",0x967F],
- ["EA99",0x9680],
- ["EA9A",0x9681],
- ["EA9B",0x9682],
- ["EA9C",0x9683],
- ["EA9D",0x9684],
- ["D3E7",0x9685],
- ["C2A1",0x9686],
- ["EA9E",0x9687],
- ["DAF1",0x9688],
- ["EA9F",0x9689],
- ["EAA0",0x968A],
- ["CBE5",0x968B],
- ["EB40",0x968C],
- ["DAF2",0x968D],
- ["EB41",0x968E],
- ["CBE6",0x968F],
- ["D2FE",0x9690],
- ["EB42",0x9691],
- ["EB43",0x9692],
- ["EB44",0x9693],
- ["B8F4",0x9694],
- ["EB45",0x9695],
- ["EB46",0x9696],
- ["DAF3",0x9697],
- ["B0AF",0x9698],
- ["CFB6",0x9699],
- ["EB47",0x969A],
- ["EB48",0x969B],
- ["D5CF",0x969C],
- ["EB49",0x969D],
- ["EB4A",0x969E],
- ["EB4B",0x969F],
- ["EB4C",0x96A0],
- ["EB4D",0x96A1],
- ["EB4E",0x96A2],
- ["EB4F",0x96A3],
- ["EB50",0x96A4],
- ["EB51",0x96A5],
- ["EB52",0x96A6],
- ["CBED",0x96A7],
- ["EB53",0x96A8],
- ["EB54",0x96A9],
- ["EB55",0x96AA],
- ["EB56",0x96AB],
- ["EB57",0x96AC],
- ["EB58",0x96AD],
- ["EB59",0x96AE],
- ["EB5A",0x96AF],
- ["DAF4",0x96B0],
- ["EB5B",0x96B1],
- ["EB5C",0x96B2],
- ["E3C4",0x96B3],
- ["EB5D",0x96B4],
- ["EB5E",0x96B5],
- ["C1A5",0x96B6],
- ["EB5F",0x96B7],
- ["EB60",0x96B8],
- ["F6BF",0x96B9],
- ["EB61",0x96BA],
- ["EB62",0x96BB],
- ["F6C0",0x96BC],
- ["F6C1",0x96BD],
- ["C4D1",0x96BE],
- ["EB63",0x96BF],
- ["C8B8",0x96C0],
- ["D1E3",0x96C1],
- ["EB64",0x96C2],
- ["EB65",0x96C3],
- ["D0DB",0x96C4],
- ["D1C5",0x96C5],
- ["BCAF",0x96C6],
- ["B9CD",0x96C7],
- ["EB66",0x96C8],
- ["EFF4",0x96C9],
- ["EB67",0x96CA],
- ["EB68",0x96CB],
- ["B4C6",0x96CC],
- ["D3BA",0x96CD],
- ["F6C2",0x96CE],
- ["B3FB",0x96CF],
- ["EB69",0x96D0],
- ["EB6A",0x96D1],
- ["F6C3",0x96D2],
- ["EB6B",0x96D3],
- ["EB6C",0x96D4],
- ["B5F1",0x96D5],
- ["EB6D",0x96D6],
- ["EB6E",0x96D7],
- ["EB6F",0x96D8],
- ["EB70",0x96D9],
- ["EB71",0x96DA],
- ["EB72",0x96DB],
- ["EB73",0x96DC],
- ["EB74",0x96DD],
- ["EB75",0x96DE],
- ["EB76",0x96DF],
- ["F6C5",0x96E0],
- ["EB77",0x96E1],
- ["EB78",0x96E2],
- ["EB79",0x96E3],
- ["EB7A",0x96E4],
- ["EB7B",0x96E5],
- ["EB7C",0x96E6],
- ["EB7D",0x96E7],
- ["D3EA",0x96E8],
- ["F6A7",0x96E9],
- ["D1A9",0x96EA],
- ["EB7E",0x96EB],
- ["EB80",0x96EC],
- ["EB81",0x96ED],
- ["EB82",0x96EE],
- ["F6A9",0x96EF],
- ["EB83",0x96F0],
- ["EB84",0x96F1],
- ["EB85",0x96F2],
- ["F6A8",0x96F3],
- ["EB86",0x96F4],
- ["EB87",0x96F5],
- ["C1E3",0x96F6],
- ["C0D7",0x96F7],
- ["EB88",0x96F8],
- ["B1A2",0x96F9],
- ["EB89",0x96FA],
- ["EB8A",0x96FB],
- ["EB8B",0x96FC],
- ["EB8C",0x96FD],
- ["CEED",0x96FE],
- ["EB8D",0x96FF],
- ["D0E8",0x9700],
- ["F6AB",0x9701],
- ["EB8E",0x9702],
- ["EB8F",0x9703],
- ["CFF6",0x9704],
- ["EB90",0x9705],
- ["F6AA",0x9706],
- ["D5F0",0x9707],
- ["F6AC",0x9708],
- ["C3B9",0x9709],
- ["EB91",0x970A],
- ["EB92",0x970B],
- ["EB93",0x970C],
- ["BBF4",0x970D],
- ["F6AE",0x970E],
- ["F6AD",0x970F],
- ["EB94",0x9710],
- ["EB95",0x9711],
- ["EB96",0x9712],
- ["C4DE",0x9713],
- ["EB97",0x9714],
- ["EB98",0x9715],
- ["C1D8",0x9716],
- ["EB99",0x9717],
- ["EB9A",0x9718],
- ["EB9B",0x9719],
- ["EB9C",0x971A],
- ["EB9D",0x971B],
- ["CBAA",0x971C],
- ["EB9E",0x971D],
- ["CFBC",0x971E],
- ["EB9F",0x971F],
- ["EBA0",0x9720],
- ["EC40",0x9721],
- ["EC41",0x9722],
- ["EC42",0x9723],
- ["EC43",0x9724],
- ["EC44",0x9725],
- ["EC45",0x9726],
- ["EC46",0x9727],
- ["EC47",0x9728],
- ["EC48",0x9729],
- ["F6AF",0x972A],
- ["EC49",0x972B],
- ["EC4A",0x972C],
- ["F6B0",0x972D],
- ["EC4B",0x972E],
- ["EC4C",0x972F],
- ["F6B1",0x9730],
- ["EC4D",0x9731],
- ["C2B6",0x9732],
- ["EC4E",0x9733],
- ["EC4F",0x9734],
- ["EC50",0x9735],
- ["EC51",0x9736],
- ["EC52",0x9737],
- ["B0D4",0x9738],
- ["C5F9",0x9739],
- ["EC53",0x973A],
- ["EC54",0x973B],
- ["EC55",0x973C],
- ["EC56",0x973D],
- ["F6B2",0x973E],
- ["EC57",0x973F],
- ["EC58",0x9740],
- ["EC59",0x9741],
- ["EC5A",0x9742],
- ["EC5B",0x9743],
- ["EC5C",0x9744],
- ["EC5D",0x9745],
- ["EC5E",0x9746],
- ["EC5F",0x9747],
- ["EC60",0x9748],
- ["EC61",0x9749],
- ["EC62",0x974A],
- ["EC63",0x974B],
- ["EC64",0x974C],
- ["EC65",0x974D],
- ["EC66",0x974E],
- ["EC67",0x974F],
- ["EC68",0x9750],
- ["EC69",0x9751],
- ["C7E0",0x9752],
- ["F6A6",0x9753],
- ["EC6A",0x9754],
- ["EC6B",0x9755],
- ["BEB8",0x9756],
- ["EC6C",0x9757],
- ["EC6D",0x9758],
- ["BEB2",0x9759],
- ["EC6E",0x975A],
- ["B5E5",0x975B],
- ["EC6F",0x975C],
- ["EC70",0x975D],
- ["B7C7",0x975E],
- ["EC71",0x975F],
- ["BFBF",0x9760],
- ["C3D2",0x9761],
- ["C3E6",0x9762],
- ["EC72",0x9763],
- ["EC73",0x9764],
- ["D8CC",0x9765],
- ["EC74",0x9766],
- ["EC75",0x9767],
- ["EC76",0x9768],
- ["B8EF",0x9769],
- ["EC77",0x976A],
- ["EC78",0x976B],
- ["EC79",0x976C],
- ["EC7A",0x976D],
- ["EC7B",0x976E],
- ["EC7C",0x976F],
- ["EC7D",0x9770],
- ["EC7E",0x9771],
- ["EC80",0x9772],
- ["BDF9",0x9773],
- ["D1A5",0x9774],
- ["EC81",0x9775],
- ["B0D0",0x9776],
- ["EC82",0x9777],
- ["EC83",0x9778],
- ["EC84",0x9779],
- ["EC85",0x977A],
- ["EC86",0x977B],
- ["F7B0",0x977C],
- ["EC87",0x977D],
- ["EC88",0x977E],
- ["EC89",0x977F],
- ["EC8A",0x9780],
- ["EC8B",0x9781],
- ["EC8C",0x9782],
- ["EC8D",0x9783],
- ["EC8E",0x9784],
- ["F7B1",0x9785],
- ["EC8F",0x9786],
- ["EC90",0x9787],
- ["EC91",0x9788],
- ["EC92",0x9789],
- ["EC93",0x978A],
- ["D0AC",0x978B],
- ["EC94",0x978C],
- ["B0B0",0x978D],
- ["EC95",0x978E],
- ["EC96",0x978F],
- ["EC97",0x9790],
- ["F7B2",0x9791],
- ["F7B3",0x9792],
- ["EC98",0x9793],
- ["F7B4",0x9794],
- ["EC99",0x9795],
- ["EC9A",0x9796],
- ["EC9B",0x9797],
- ["C7CA",0x9798],
- ["EC9C",0x9799],
- ["EC9D",0x979A],
- ["EC9E",0x979B],
- ["EC9F",0x979C],
- ["ECA0",0x979D],
- ["ED40",0x979E],
- ["ED41",0x979F],
- ["BECF",0x97A0],
- ["ED42",0x97A1],
- ["ED43",0x97A2],
- ["F7B7",0x97A3],
- ["ED44",0x97A4],
- ["ED45",0x97A5],
- ["ED46",0x97A6],
- ["ED47",0x97A7],
- ["ED48",0x97A8],
- ["ED49",0x97A9],
- ["ED4A",0x97AA],
- ["F7B6",0x97AB],
- ["ED4B",0x97AC],
- ["B1DE",0x97AD],
- ["ED4C",0x97AE],
- ["F7B5",0x97AF],
- ["ED4D",0x97B0],
- ["ED4E",0x97B1],
- ["F7B8",0x97B2],
- ["ED4F",0x97B3],
- ["F7B9",0x97B4],
- ["ED50",0x97B5],
- ["ED51",0x97B6],
- ["ED52",0x97B7],
- ["ED53",0x97B8],
- ["ED54",0x97B9],
- ["ED55",0x97BA],
- ["ED56",0x97BB],
- ["ED57",0x97BC],
- ["ED58",0x97BD],
- ["ED59",0x97BE],
- ["ED5A",0x97BF],
- ["ED5B",0x97C0],
- ["ED5C",0x97C1],
- ["ED5D",0x97C2],
- ["ED5E",0x97C3],
- ["ED5F",0x97C4],
- ["ED60",0x97C5],
- ["ED61",0x97C6],
- ["ED62",0x97C7],
- ["ED63",0x97C8],
- ["ED64",0x97C9],
- ["ED65",0x97CA],
- ["ED66",0x97CB],
- ["ED67",0x97CC],
- ["ED68",0x97CD],
- ["ED69",0x97CE],
- ["ED6A",0x97CF],
- ["ED6B",0x97D0],
- ["ED6C",0x97D1],
- ["ED6D",0x97D2],
- ["ED6E",0x97D3],
- ["ED6F",0x97D4],
- ["ED70",0x97D5],
- ["ED71",0x97D6],
- ["ED72",0x97D7],
- ["ED73",0x97D8],
- ["ED74",0x97D9],
- ["ED75",0x97DA],
- ["ED76",0x97DB],
- ["ED77",0x97DC],
- ["ED78",0x97DD],
- ["ED79",0x97DE],
- ["ED7A",0x97DF],
- ["ED7B",0x97E0],
- ["ED7C",0x97E1],
- ["ED7D",0x97E2],
- ["ED7E",0x97E3],
- ["ED80",0x97E4],
- ["ED81",0x97E5],
- ["CEA4",0x97E6],
- ["C8CD",0x97E7],
- ["ED82",0x97E8],
- ["BAAB",0x97E9],
- ["E8B8",0x97EA],
- ["E8B9",0x97EB],
- ["E8BA",0x97EC],
- ["BEC2",0x97ED],
- ["ED83",0x97EE],
- ["ED84",0x97EF],
- ["ED85",0x97F0],
- ["ED86",0x97F1],
- ["ED87",0x97F2],
- ["D2F4",0x97F3],
- ["ED88",0x97F4],
- ["D4CF",0x97F5],
- ["C9D8",0x97F6],
- ["ED89",0x97F7],
- ["ED8A",0x97F8],
- ["ED8B",0x97F9],
- ["ED8C",0x97FA],
- ["ED8D",0x97FB],
- ["ED8E",0x97FC],
- ["ED8F",0x97FD],
- ["ED90",0x97FE],
- ["ED91",0x97FF],
- ["ED92",0x9800],
- ["ED93",0x9801],
- ["ED94",0x9802],
- ["ED95",0x9803],
- ["ED96",0x9804],
- ["ED97",0x9805],
- ["ED98",0x9806],
- ["ED99",0x9807],
- ["ED9A",0x9808],
- ["ED9B",0x9809],
- ["ED9C",0x980A],
- ["ED9D",0x980B],
- ["ED9E",0x980C],
- ["ED9F",0x980D],
- ["EDA0",0x980E],
- ["EE40",0x980F],
- ["EE41",0x9810],
- ["EE42",0x9811],
- ["EE43",0x9812],
- ["EE44",0x9813],
- ["EE45",0x9814],
- ["EE46",0x9815],
- ["EE47",0x9816],
- ["EE48",0x9817],
- ["EE49",0x9818],
- ["EE4A",0x9819],
- ["EE4B",0x981A],
- ["EE4C",0x981B],
- ["EE4D",0x981C],
- ["EE4E",0x981D],
- ["EE4F",0x981E],
- ["EE50",0x981F],
- ["EE51",0x9820],
- ["EE52",0x9821],
- ["EE53",0x9822],
- ["EE54",0x9823],
- ["EE55",0x9824],
- ["EE56",0x9825],
- ["EE57",0x9826],
- ["EE58",0x9827],
- ["EE59",0x9828],
- ["EE5A",0x9829],
- ["EE5B",0x982A],
- ["EE5C",0x982B],
- ["EE5D",0x982C],
- ["EE5E",0x982D],
- ["EE5F",0x982E],
- ["EE60",0x982F],
- ["EE61",0x9830],
- ["EE62",0x9831],
- ["EE63",0x9832],
- ["EE64",0x9833],
- ["EE65",0x9834],
- ["EE66",0x9835],
- ["EE67",0x9836],
- ["EE68",0x9837],
- ["EE69",0x9838],
- ["EE6A",0x9839],
- ["EE6B",0x983A],
- ["EE6C",0x983B],
- ["EE6D",0x983C],
- ["EE6E",0x983D],
- ["EE6F",0x983E],
- ["EE70",0x983F],
- ["EE71",0x9840],
- ["EE72",0x9841],
- ["EE73",0x9842],
- ["EE74",0x9843],
- ["EE75",0x9844],
- ["EE76",0x9845],
- ["EE77",0x9846],
- ["EE78",0x9847],
- ["EE79",0x9848],
- ["EE7A",0x9849],
- ["EE7B",0x984A],
- ["EE7C",0x984B],
- ["EE7D",0x984C],
- ["EE7E",0x984D],
- ["EE80",0x984E],
- ["EE81",0x984F],
- ["EE82",0x9850],
- ["EE83",0x9851],
- ["EE84",0x9852],
- ["EE85",0x9853],
- ["EE86",0x9854],
- ["EE87",0x9855],
- ["EE88",0x9856],
- ["EE89",0x9857],
- ["EE8A",0x9858],
- ["EE8B",0x9859],
- ["EE8C",0x985A],
- ["EE8D",0x985B],
- ["EE8E",0x985C],
- ["EE8F",0x985D],
- ["EE90",0x985E],
- ["EE91",0x985F],
- ["EE92",0x9860],
- ["EE93",0x9861],
- ["EE94",0x9862],
- ["EE95",0x9863],
- ["EE96",0x9864],
- ["EE97",0x9865],
- ["EE98",0x9866],
- ["EE99",0x9867],
- ["EE9A",0x9868],
- ["EE9B",0x9869],
- ["EE9C",0x986A],
- ["EE9D",0x986B],
- ["EE9E",0x986C],
- ["EE9F",0x986D],
- ["EEA0",0x986E],
- ["EF40",0x986F],
- ["EF41",0x9870],
- ["EF42",0x9871],
- ["EF43",0x9872],
- ["EF44",0x9873],
- ["EF45",0x9874],
- ["D2B3",0x9875],
- ["B6A5",0x9876],
- ["C7EA",0x9877],
- ["F1FC",0x9878],
- ["CFEE",0x9879],
- ["CBB3",0x987A],
- ["D0EB",0x987B],
- ["E7EF",0x987C],
- ["CDE7",0x987D],
- ["B9CB",0x987E],
- ["B6D9",0x987F],
- ["F1FD",0x9880],
- ["B0E4",0x9881],
- ["CBCC",0x9882],
- ["F1FE",0x9883],
- ["D4A4",0x9884],
- ["C2AD",0x9885],
- ["C1EC",0x9886],
- ["C6C4",0x9887],
- ["BEB1",0x9888],
- ["F2A1",0x9889],
- ["BCD5",0x988A],
- ["EF46",0x988B],
- ["F2A2",0x988C],
- ["F2A3",0x988D],
- ["EF47",0x988E],
- ["F2A4",0x988F],
- ["D2C3",0x9890],
- ["C6B5",0x9891],
- ["EF48",0x9892],
- ["CDC7",0x9893],
- ["F2A5",0x9894],
- ["EF49",0x9895],
- ["D3B1",0x9896],
- ["BFC5",0x9897],
- ["CCE2",0x9898],
- ["EF4A",0x9899],
- ["F2A6",0x989A],
- ["F2A7",0x989B],
- ["D1D5",0x989C],
- ["B6EE",0x989D],
- ["F2A8",0x989E],
- ["F2A9",0x989F],
- ["B5DF",0x98A0],
- ["F2AA",0x98A1],
- ["F2AB",0x98A2],
- ["EF4B",0x98A3],
- ["B2FC",0x98A4],
- ["F2AC",0x98A5],
- ["F2AD",0x98A6],
- ["C8A7",0x98A7],
- ["EF4C",0x98A8],
- ["EF4D",0x98A9],
- ["EF4E",0x98AA],
- ["EF4F",0x98AB],
- ["EF50",0x98AC],
- ["EF51",0x98AD],
- ["EF52",0x98AE],
- ["EF53",0x98AF],
- ["EF54",0x98B0],
- ["EF55",0x98B1],
- ["EF56",0x98B2],
- ["EF57",0x98B3],
- ["EF58",0x98B4],
- ["EF59",0x98B5],
- ["EF5A",0x98B6],
- ["EF5B",0x98B7],
- ["EF5C",0x98B8],
- ["EF5D",0x98B9],
- ["EF5E",0x98BA],
- ["EF5F",0x98BB],
- ["EF60",0x98BC],
- ["EF61",0x98BD],
- ["EF62",0x98BE],
- ["EF63",0x98BF],
- ["EF64",0x98C0],
- ["EF65",0x98C1],
- ["EF66",0x98C2],
- ["EF67",0x98C3],
- ["EF68",0x98C4],
- ["EF69",0x98C5],
- ["EF6A",0x98C6],
- ["EF6B",0x98C7],
- ["EF6C",0x98C8],
- ["EF6D",0x98C9],
- ["EF6E",0x98CA],
- ["EF6F",0x98CB],
- ["EF70",0x98CC],
- ["EF71",0x98CD],
- ["B7E7",0x98CE],
- ["EF72",0x98CF],
- ["EF73",0x98D0],
- ["ECA9",0x98D1],
- ["ECAA",0x98D2],
- ["ECAB",0x98D3],
- ["EF74",0x98D4],
- ["ECAC",0x98D5],
- ["EF75",0x98D6],
- ["EF76",0x98D7],
- ["C6AE",0x98D8],
- ["ECAD",0x98D9],
- ["ECAE",0x98DA],
- ["EF77",0x98DB],
- ["EF78",0x98DC],
- ["EF79",0x98DD],
- ["B7C9",0x98DE],
- ["CAB3",0x98DF],
- ["EF7A",0x98E0],
- ["EF7B",0x98E1],
- ["EF7C",0x98E2],
- ["EF7D",0x98E3],
- ["EF7E",0x98E4],
- ["EF80",0x98E5],
- ["EF81",0x98E6],
- ["E2B8",0x98E7],
- ["F7CF",0x98E8],
- ["EF82",0x98E9],
- ["EF83",0x98EA],
- ["EF84",0x98EB],
- ["EF85",0x98EC],
- ["EF86",0x98ED],
- ["EF87",0x98EE],
- ["EF88",0x98EF],
- ["EF89",0x98F0],
- ["EF8A",0x98F1],
- ["EF8B",0x98F2],
- ["EF8C",0x98F3],
- ["EF8D",0x98F4],
- ["EF8E",0x98F5],
- ["EF8F",0x98F6],
- ["EF90",0x98F7],
- ["EF91",0x98F8],
- ["EF92",0x98F9],
- ["EF93",0x98FA],
- ["EF94",0x98FB],
- ["EF95",0x98FC],
- ["EF96",0x98FD],
- ["EF97",0x98FE],
- ["EF98",0x98FF],
- ["EF99",0x9900],
- ["EF9A",0x9901],
- ["EF9B",0x9902],
- ["EF9C",0x9903],
- ["EF9D",0x9904],
- ["EF9E",0x9905],
- ["EF9F",0x9906],
- ["EFA0",0x9907],
- ["F040",0x9908],
- ["F041",0x9909],
- ["F042",0x990A],
- ["F043",0x990B],
- ["F044",0x990C],
- ["F7D0",0x990D],
- ["F045",0x990E],
- ["F046",0x990F],
- ["B2CD",0x9910],
- ["F047",0x9911],
- ["F048",0x9912],
- ["F049",0x9913],
- ["F04A",0x9914],
- ["F04B",0x9915],
- ["F04C",0x9916],
- ["F04D",0x9917],
- ["F04E",0x9918],
- ["F04F",0x9919],
- ["F050",0x991A],
- ["F051",0x991B],
- ["F052",0x991C],
- ["F053",0x991D],
- ["F054",0x991E],
- ["F055",0x991F],
- ["F056",0x9920],
- ["F057",0x9921],
- ["F058",0x9922],
- ["F059",0x9923],
- ["F05A",0x9924],
- ["F05B",0x9925],
- ["F05C",0x9926],
- ["F05D",0x9927],
- ["F05E",0x9928],
- ["F05F",0x9929],
- ["F060",0x992A],
- ["F061",0x992B],
- ["F062",0x992C],
- ["F063",0x992D],
- ["F7D1",0x992E],
- ["F064",0x992F],
- ["F065",0x9930],
- ["F066",0x9931],
- ["F067",0x9932],
- ["F068",0x9933],
- ["F069",0x9934],
- ["F06A",0x9935],
- ["F06B",0x9936],
- ["F06C",0x9937],
- ["F06D",0x9938],
- ["F06E",0x9939],
- ["F06F",0x993A],
- ["F070",0x993B],
- ["F071",0x993C],
- ["F072",0x993D],
- ["F073",0x993E],
- ["F074",0x993F],
- ["F075",0x9940],
- ["F076",0x9941],
- ["F077",0x9942],
- ["F078",0x9943],
- ["F079",0x9944],
- ["F07A",0x9945],
- ["F07B",0x9946],
- ["F07C",0x9947],
- ["F07D",0x9948],
- ["F07E",0x9949],
- ["F080",0x994A],
- ["F081",0x994B],
- ["F082",0x994C],
- ["F083",0x994D],
- ["F084",0x994E],
- ["F085",0x994F],
- ["F086",0x9950],
- ["F087",0x9951],
- ["F088",0x9952],
- ["F089",0x9953],
- ["F7D3",0x9954],
- ["F7D2",0x9955],
- ["F08A",0x9956],
- ["F08B",0x9957],
- ["F08C",0x9958],
- ["F08D",0x9959],
- ["F08E",0x995A],
- ["F08F",0x995B],
- ["F090",0x995C],
- ["F091",0x995D],
- ["F092",0x995E],
- ["F093",0x995F],
- ["F094",0x9960],
- ["F095",0x9961],
- ["F096",0x9962],
- ["E2BB",0x9963],
- ["F097",0x9964],
- ["BCA2",0x9965],
- ["F098",0x9966],
- ["E2BC",0x9967],
- ["E2BD",0x9968],
- ["E2BE",0x9969],
- ["E2BF",0x996A],
- ["E2C0",0x996B],
- ["E2C1",0x996C],
- ["B7B9",0x996D],
- ["D2FB",0x996E],
- ["BDA4",0x996F],
- ["CACE",0x9970],
- ["B1A5",0x9971],
- ["CBC7",0x9972],
- ["F099",0x9973],
- ["E2C2",0x9974],
- ["B6FC",0x9975],
- ["C8C4",0x9976],
- ["E2C3",0x9977],
- ["F09A",0x9978],
- ["F09B",0x9979],
- ["BDC8",0x997A],
- ["F09C",0x997B],
- ["B1FD",0x997C],
- ["E2C4",0x997D],
- ["F09D",0x997E],
- ["B6F6",0x997F],
- ["E2C5",0x9980],
- ["C4D9",0x9981],
- ["F09E",0x9982],
- ["F09F",0x9983],
- ["E2C6",0x9984],
- ["CFDA",0x9985],
- ["B9DD",0x9986],
- ["E2C7",0x9987],
- ["C0A1",0x9988],
- ["F0A0",0x9989],
- ["E2C8",0x998A],
- ["B2F6",0x998B],
- ["F140",0x998C],
- ["E2C9",0x998D],
- ["F141",0x998E],
- ["C1F3",0x998F],
- ["E2CA",0x9990],
- ["E2CB",0x9991],
- ["C2F8",0x9992],
- ["E2CC",0x9993],
- ["E2CD",0x9994],
- ["E2CE",0x9995],
- ["CAD7",0x9996],
- ["D8B8",0x9997],
- ["D9E5",0x9998],
- ["CFE3",0x9999],
- ["F142",0x999A],
- ["F143",0x999B],
- ["F144",0x999C],
- ["F145",0x999D],
- ["F146",0x999E],
- ["F147",0x999F],
- ["F148",0x99A0],
- ["F149",0x99A1],
- ["F14A",0x99A2],
- ["F14B",0x99A3],
- ["F14C",0x99A4],
- ["F0A5",0x99A5],
- ["F14D",0x99A6],
- ["F14E",0x99A7],
- ["DCB0",0x99A8],
- ["F14F",0x99A9],
- ["F150",0x99AA],
- ["F151",0x99AB],
- ["F152",0x99AC],
- ["F153",0x99AD],
- ["F154",0x99AE],
- ["F155",0x99AF],
- ["F156",0x99B0],
- ["F157",0x99B1],
- ["F158",0x99B2],
- ["F159",0x99B3],
- ["F15A",0x99B4],
- ["F15B",0x99B5],
- ["F15C",0x99B6],
- ["F15D",0x99B7],
- ["F15E",0x99B8],
- ["F15F",0x99B9],
- ["F160",0x99BA],
- ["F161",0x99BB],
- ["F162",0x99BC],
- ["F163",0x99BD],
- ["F164",0x99BE],
- ["F165",0x99BF],
- ["F166",0x99C0],
- ["F167",0x99C1],
- ["F168",0x99C2],
- ["F169",0x99C3],
- ["F16A",0x99C4],
- ["F16B",0x99C5],
- ["F16C",0x99C6],
- ["F16D",0x99C7],
- ["F16E",0x99C8],
- ["F16F",0x99C9],
- ["F170",0x99CA],
- ["F171",0x99CB],
- ["F172",0x99CC],
- ["F173",0x99CD],
- ["F174",0x99CE],
- ["F175",0x99CF],
- ["F176",0x99D0],
- ["F177",0x99D1],
- ["F178",0x99D2],
- ["F179",0x99D3],
- ["F17A",0x99D4],
- ["F17B",0x99D5],
- ["F17C",0x99D6],
- ["F17D",0x99D7],
- ["F17E",0x99D8],
- ["F180",0x99D9],
- ["F181",0x99DA],
- ["F182",0x99DB],
- ["F183",0x99DC],
- ["F184",0x99DD],
- ["F185",0x99DE],
- ["F186",0x99DF],
- ["F187",0x99E0],
- ["F188",0x99E1],
- ["F189",0x99E2],
- ["F18A",0x99E3],
- ["F18B",0x99E4],
- ["F18C",0x99E5],
- ["F18D",0x99E6],
- ["F18E",0x99E7],
- ["F18F",0x99E8],
- ["F190",0x99E9],
- ["F191",0x99EA],
- ["F192",0x99EB],
- ["F193",0x99EC],
- ["F194",0x99ED],
- ["F195",0x99EE],
- ["F196",0x99EF],
- ["F197",0x99F0],
- ["F198",0x99F1],
- ["F199",0x99F2],
- ["F19A",0x99F3],
- ["F19B",0x99F4],
- ["F19C",0x99F5],
- ["F19D",0x99F6],
- ["F19E",0x99F7],
- ["F19F",0x99F8],
- ["F1A0",0x99F9],
- ["F240",0x99FA],
- ["F241",0x99FB],
- ["F242",0x99FC],
- ["F243",0x99FD],
- ["F244",0x99FE],
- ["F245",0x99FF],
- ["F246",0x9A00],
- ["F247",0x9A01],
- ["F248",0x9A02],
- ["F249",0x9A03],
- ["F24A",0x9A04],
- ["F24B",0x9A05],
- ["F24C",0x9A06],
- ["F24D",0x9A07],
- ["F24E",0x9A08],
- ["F24F",0x9A09],
- ["F250",0x9A0A],
- ["F251",0x9A0B],
- ["F252",0x9A0C],
- ["F253",0x9A0D],
- ["F254",0x9A0E],
- ["F255",0x9A0F],
- ["F256",0x9A10],
- ["F257",0x9A11],
- ["F258",0x9A12],
- ["F259",0x9A13],
- ["F25A",0x9A14],
- ["F25B",0x9A15],
- ["F25C",0x9A16],
- ["F25D",0x9A17],
- ["F25E",0x9A18],
- ["F25F",0x9A19],
- ["F260",0x9A1A],
- ["F261",0x9A1B],
- ["F262",0x9A1C],
- ["F263",0x9A1D],
- ["F264",0x9A1E],
- ["F265",0x9A1F],
- ["F266",0x9A20],
- ["F267",0x9A21],
- ["F268",0x9A22],
- ["F269",0x9A23],
- ["F26A",0x9A24],
- ["F26B",0x9A25],
- ["F26C",0x9A26],
- ["F26D",0x9A27],
- ["F26E",0x9A28],
- ["F26F",0x9A29],
- ["F270",0x9A2A],
- ["F271",0x9A2B],
- ["F272",0x9A2C],
- ["F273",0x9A2D],
- ["F274",0x9A2E],
- ["F275",0x9A2F],
- ["F276",0x9A30],
- ["F277",0x9A31],
- ["F278",0x9A32],
- ["F279",0x9A33],
- ["F27A",0x9A34],
- ["F27B",0x9A35],
- ["F27C",0x9A36],
- ["F27D",0x9A37],
- ["F27E",0x9A38],
- ["F280",0x9A39],
- ["F281",0x9A3A],
- ["F282",0x9A3B],
- ["F283",0x9A3C],
- ["F284",0x9A3D],
- ["F285",0x9A3E],
- ["F286",0x9A3F],
- ["F287",0x9A40],
- ["F288",0x9A41],
- ["F289",0x9A42],
- ["F28A",0x9A43],
- ["F28B",0x9A44],
- ["F28C",0x9A45],
- ["F28D",0x9A46],
- ["F28E",0x9A47],
- ["F28F",0x9A48],
- ["F290",0x9A49],
- ["F291",0x9A4A],
- ["F292",0x9A4B],
- ["F293",0x9A4C],
- ["F294",0x9A4D],
- ["F295",0x9A4E],
- ["F296",0x9A4F],
- ["F297",0x9A50],
- ["F298",0x9A51],
- ["F299",0x9A52],
- ["F29A",0x9A53],
- ["F29B",0x9A54],
- ["F29C",0x9A55],
- ["F29D",0x9A56],
- ["F29E",0x9A57],
- ["F29F",0x9A58],
- ["F2A0",0x9A59],
- ["F340",0x9A5A],
- ["F341",0x9A5B],
- ["F342",0x9A5C],
- ["F343",0x9A5D],
- ["F344",0x9A5E],
- ["F345",0x9A5F],
- ["F346",0x9A60],
- ["F347",0x9A61],
- ["F348",0x9A62],
- ["F349",0x9A63],
- ["F34A",0x9A64],
- ["F34B",0x9A65],
- ["F34C",0x9A66],
- ["F34D",0x9A67],
- ["F34E",0x9A68],
- ["F34F",0x9A69],
- ["F350",0x9A6A],
- ["F351",0x9A6B],
- ["C2ED",0x9A6C],
- ["D4A6",0x9A6D],
- ["CDD4",0x9A6E],
- ["D1B1",0x9A6F],
- ["B3DB",0x9A70],
- ["C7FD",0x9A71],
- ["F352",0x9A72],
- ["B2B5",0x9A73],
- ["C2BF",0x9A74],
- ["E6E0",0x9A75],
- ["CABB",0x9A76],
- ["E6E1",0x9A77],
- ["E6E2",0x9A78],
- ["BED4",0x9A79],
- ["E6E3",0x9A7A],
- ["D7A4",0x9A7B],
- ["CDD5",0x9A7C],
- ["E6E5",0x9A7D],
- ["BCDD",0x9A7E],
- ["E6E4",0x9A7F],
- ["E6E6",0x9A80],
- ["E6E7",0x9A81],
- ["C2EE",0x9A82],
- ["F353",0x9A83],
- ["BDBE",0x9A84],
- ["E6E8",0x9A85],
- ["C2E6",0x9A86],
- ["BAA7",0x9A87],
- ["E6E9",0x9A88],
- ["F354",0x9A89],
- ["E6EA",0x9A8A],
- ["B3D2",0x9A8B],
- ["D1E9",0x9A8C],
- ["F355",0x9A8D],
- ["F356",0x9A8E],
- ["BFA5",0x9A8F],
- ["E6EB",0x9A90],
- ["C6EF",0x9A91],
- ["E6EC",0x9A92],
- ["E6ED",0x9A93],
- ["F357",0x9A94],
- ["F358",0x9A95],
- ["E6EE",0x9A96],
- ["C6AD",0x9A97],
- ["E6EF",0x9A98],
- ["F359",0x9A99],
- ["C9A7",0x9A9A],
- ["E6F0",0x9A9B],
- ["E6F1",0x9A9C],
- ["E6F2",0x9A9D],
- ["E5B9",0x9A9E],
- ["E6F3",0x9A9F],
- ["E6F4",0x9AA0],
- ["C2E2",0x9AA1],
- ["E6F5",0x9AA2],
- ["E6F6",0x9AA3],
- ["D6E8",0x9AA4],
- ["E6F7",0x9AA5],
- ["F35A",0x9AA6],
- ["E6F8",0x9AA7],
- ["B9C7",0x9AA8],
- ["F35B",0x9AA9],
- ["F35C",0x9AAA],
- ["F35D",0x9AAB],
- ["F35E",0x9AAC],
- ["F35F",0x9AAD],
- ["F360",0x9AAE],
- ["F361",0x9AAF],
- ["F7BB",0x9AB0],
- ["F7BA",0x9AB1],
- ["F362",0x9AB2],
- ["F363",0x9AB3],
- ["F364",0x9AB4],
- ["F365",0x9AB5],
- ["F7BE",0x9AB6],
- ["F7BC",0x9AB7],
- ["BAA1",0x9AB8],
- ["F366",0x9AB9],
- ["F7BF",0x9ABA],
- ["F367",0x9ABB],
- ["F7C0",0x9ABC],
- ["F368",0x9ABD],
- ["F369",0x9ABE],
- ["F36A",0x9ABF],
- ["F7C2",0x9AC0],
- ["F7C1",0x9AC1],
- ["F7C4",0x9AC2],
- ["F36B",0x9AC3],
- ["F36C",0x9AC4],
- ["F7C3",0x9AC5],
- ["F36D",0x9AC6],
- ["F36E",0x9AC7],
- ["F36F",0x9AC8],
- ["F370",0x9AC9],
- ["F371",0x9ACA],
- ["F7C5",0x9ACB],
- ["F7C6",0x9ACC],
- ["F372",0x9ACD],
- ["F373",0x9ACE],
- ["F374",0x9ACF],
- ["F375",0x9AD0],
- ["F7C7",0x9AD1],
- ["F376",0x9AD2],
- ["CBE8",0x9AD3],
- ["F377",0x9AD4],
- ["F378",0x9AD5],
- ["F379",0x9AD6],
- ["F37A",0x9AD7],
- ["B8DF",0x9AD8],
- ["F37B",0x9AD9],
- ["F37C",0x9ADA],
- ["F37D",0x9ADB],
- ["F37E",0x9ADC],
- ["F380",0x9ADD],
- ["F381",0x9ADE],
- ["F7D4",0x9ADF],
- ["F382",0x9AE0],
- ["F7D5",0x9AE1],
- ["F383",0x9AE2],
- ["F384",0x9AE3],
- ["F385",0x9AE4],
- ["F386",0x9AE5],
- ["F7D6",0x9AE6],
- ["F387",0x9AE7],
- ["F388",0x9AE8],
- ["F389",0x9AE9],
- ["F38A",0x9AEA],
- ["F7D8",0x9AEB],
- ["F38B",0x9AEC],
- ["F7DA",0x9AED],
- ["F38C",0x9AEE],
- ["F7D7",0x9AEF],
- ["F38D",0x9AF0],
- ["F38E",0x9AF1],
- ["F38F",0x9AF2],
- ["F390",0x9AF3],
- ["F391",0x9AF4],
- ["F392",0x9AF5],
- ["F393",0x9AF6],
- ["F394",0x9AF7],
- ["F395",0x9AF8],
- ["F7DB",0x9AF9],
- ["F396",0x9AFA],
- ["F7D9",0x9AFB],
- ["F397",0x9AFC],
- ["F398",0x9AFD],
- ["F399",0x9AFE],
- ["F39A",0x9AFF],
- ["F39B",0x9B00],
- ["F39C",0x9B01],
- ["F39D",0x9B02],
- ["D7D7",0x9B03],
- ["F39E",0x9B04],
- ["F39F",0x9B05],
- ["F3A0",0x9B06],
- ["F440",0x9B07],
- ["F7DC",0x9B08],
- ["F441",0x9B09],
- ["F442",0x9B0A],
- ["F443",0x9B0B],
- ["F444",0x9B0C],
- ["F445",0x9B0D],
- ["F446",0x9B0E],
- ["F7DD",0x9B0F],
- ["F447",0x9B10],
- ["F448",0x9B11],
- ["F449",0x9B12],
- ["F7DE",0x9B13],
- ["F44A",0x9B14],
- ["F44B",0x9B15],
- ["F44C",0x9B16],
- ["F44D",0x9B17],
- ["F44E",0x9B18],
- ["F44F",0x9B19],
- ["F450",0x9B1A],
- ["F451",0x9B1B],
- ["F452",0x9B1C],
- ["F453",0x9B1D],
- ["F454",0x9B1E],
- ["F7DF",0x9B1F],
- ["F455",0x9B20],
- ["F456",0x9B21],
- ["F457",0x9B22],
- ["F7E0",0x9B23],
- ["F458",0x9B24],
- ["F459",0x9B25],
- ["F45A",0x9B26],
- ["F45B",0x9B27],
- ["F45C",0x9B28],
- ["F45D",0x9B29],
- ["F45E",0x9B2A],
- ["F45F",0x9B2B],
- ["F460",0x9B2C],
- ["F461",0x9B2D],
- ["F462",0x9B2E],
- ["DBCB",0x9B2F],
- ["F463",0x9B30],
- ["F464",0x9B31],
- ["D8AA",0x9B32],
- ["F465",0x9B33],
- ["F466",0x9B34],
- ["F467",0x9B35],
- ["F468",0x9B36],
- ["F469",0x9B37],
- ["F46A",0x9B38],
- ["F46B",0x9B39],
- ["F46C",0x9B3A],
- ["E5F7",0x9B3B],
- ["B9ED",0x9B3C],
- ["F46D",0x9B3D],
- ["F46E",0x9B3E],
- ["F46F",0x9B3F],
- ["F470",0x9B40],
- ["BFFD",0x9B41],
- ["BBEA",0x9B42],
- ["F7C9",0x9B43],
- ["C6C7",0x9B44],
- ["F7C8",0x9B45],
- ["F471",0x9B46],
- ["F7CA",0x9B47],
- ["F7CC",0x9B48],
- ["F7CB",0x9B49],
- ["F472",0x9B4A],
- ["F473",0x9B4B],
- ["F474",0x9B4C],
- ["F7CD",0x9B4D],
- ["F475",0x9B4E],
- ["CEBA",0x9B4F],
- ["F476",0x9B50],
- ["F7CE",0x9B51],
- ["F477",0x9B52],
- ["F478",0x9B53],
- ["C4A7",0x9B54],
- ["F479",0x9B55],
- ["F47A",0x9B56],
- ["F47B",0x9B57],
- ["F47C",0x9B58],
- ["F47D",0x9B59],
- ["F47E",0x9B5A],
- ["F480",0x9B5B],
- ["F481",0x9B5C],
- ["F482",0x9B5D],
- ["F483",0x9B5E],
- ["F484",0x9B5F],
- ["F485",0x9B60],
- ["F486",0x9B61],
- ["F487",0x9B62],
- ["F488",0x9B63],
- ["F489",0x9B64],
- ["F48A",0x9B65],
- ["F48B",0x9B66],
- ["F48C",0x9B67],
- ["F48D",0x9B68],
- ["F48E",0x9B69],
- ["F48F",0x9B6A],
- ["F490",0x9B6B],
- ["F491",0x9B6C],
- ["F492",0x9B6D],
- ["F493",0x9B6E],
- ["F494",0x9B6F],
- ["F495",0x9B70],
- ["F496",0x9B71],
- ["F497",0x9B72],
- ["F498",0x9B73],
- ["F499",0x9B74],
- ["F49A",0x9B75],
- ["F49B",0x9B76],
- ["F49C",0x9B77],
- ["F49D",0x9B78],
- ["F49E",0x9B79],
- ["F49F",0x9B7A],
- ["F4A0",0x9B7B],
- ["F540",0x9B7C],
- ["F541",0x9B7D],
- ["F542",0x9B7E],
- ["F543",0x9B7F],
- ["F544",0x9B80],
- ["F545",0x9B81],
- ["F546",0x9B82],
- ["F547",0x9B83],
- ["F548",0x9B84],
- ["F549",0x9B85],
- ["F54A",0x9B86],
- ["F54B",0x9B87],
- ["F54C",0x9B88],
- ["F54D",0x9B89],
- ["F54E",0x9B8A],
- ["F54F",0x9B8B],
- ["F550",0x9B8C],
- ["F551",0x9B8D],
- ["F552",0x9B8E],
- ["F553",0x9B8F],
- ["F554",0x9B90],
- ["F555",0x9B91],
- ["F556",0x9B92],
- ["F557",0x9B93],
- ["F558",0x9B94],
- ["F559",0x9B95],
- ["F55A",0x9B96],
- ["F55B",0x9B97],
- ["F55C",0x9B98],
- ["F55D",0x9B99],
- ["F55E",0x9B9A],
- ["F55F",0x9B9B],
- ["F560",0x9B9C],
- ["F561",0x9B9D],
- ["F562",0x9B9E],
- ["F563",0x9B9F],
- ["F564",0x9BA0],
- ["F565",0x9BA1],
- ["F566",0x9BA2],
- ["F567",0x9BA3],
- ["F568",0x9BA4],
- ["F569",0x9BA5],
- ["F56A",0x9BA6],
- ["F56B",0x9BA7],
- ["F56C",0x9BA8],
- ["F56D",0x9BA9],
- ["F56E",0x9BAA],
- ["F56F",0x9BAB],
- ["F570",0x9BAC],
- ["F571",0x9BAD],
- ["F572",0x9BAE],
- ["F573",0x9BAF],
- ["F574",0x9BB0],
- ["F575",0x9BB1],
- ["F576",0x9BB2],
- ["F577",0x9BB3],
- ["F578",0x9BB4],
- ["F579",0x9BB5],
- ["F57A",0x9BB6],
- ["F57B",0x9BB7],
- ["F57C",0x9BB8],
- ["F57D",0x9BB9],
- ["F57E",0x9BBA],
- ["F580",0x9BBB],
- ["F581",0x9BBC],
- ["F582",0x9BBD],
- ["F583",0x9BBE],
- ["F584",0x9BBF],
- ["F585",0x9BC0],
- ["F586",0x9BC1],
- ["F587",0x9BC2],
- ["F588",0x9BC3],
- ["F589",0x9BC4],
- ["F58A",0x9BC5],
- ["F58B",0x9BC6],
- ["F58C",0x9BC7],
- ["F58D",0x9BC8],
- ["F58E",0x9BC9],
- ["F58F",0x9BCA],
- ["F590",0x9BCB],
- ["F591",0x9BCC],
- ["F592",0x9BCD],
- ["F593",0x9BCE],
- ["F594",0x9BCF],
- ["F595",0x9BD0],
- ["F596",0x9BD1],
- ["F597",0x9BD2],
- ["F598",0x9BD3],
- ["F599",0x9BD4],
- ["F59A",0x9BD5],
- ["F59B",0x9BD6],
- ["F59C",0x9BD7],
- ["F59D",0x9BD8],
- ["F59E",0x9BD9],
- ["F59F",0x9BDA],
- ["F5A0",0x9BDB],
- ["F640",0x9BDC],
- ["F641",0x9BDD],
- ["F642",0x9BDE],
- ["F643",0x9BDF],
- ["F644",0x9BE0],
- ["F645",0x9BE1],
- ["F646",0x9BE2],
- ["F647",0x9BE3],
- ["F648",0x9BE4],
- ["F649",0x9BE5],
- ["F64A",0x9BE6],
- ["F64B",0x9BE7],
- ["F64C",0x9BE8],
- ["F64D",0x9BE9],
- ["F64E",0x9BEA],
- ["F64F",0x9BEB],
- ["F650",0x9BEC],
- ["F651",0x9BED],
- ["F652",0x9BEE],
- ["F653",0x9BEF],
- ["F654",0x9BF0],
- ["F655",0x9BF1],
- ["F656",0x9BF2],
- ["F657",0x9BF3],
- ["F658",0x9BF4],
- ["F659",0x9BF5],
- ["F65A",0x9BF6],
- ["F65B",0x9BF7],
- ["F65C",0x9BF8],
- ["F65D",0x9BF9],
- ["F65E",0x9BFA],
- ["F65F",0x9BFB],
- ["F660",0x9BFC],
- ["F661",0x9BFD],
- ["F662",0x9BFE],
- ["F663",0x9BFF],
- ["F664",0x9C00],
- ["F665",0x9C01],
- ["F666",0x9C02],
- ["F667",0x9C03],
- ["F668",0x9C04],
- ["F669",0x9C05],
- ["F66A",0x9C06],
- ["F66B",0x9C07],
- ["F66C",0x9C08],
- ["F66D",0x9C09],
- ["F66E",0x9C0A],
- ["F66F",0x9C0B],
- ["F670",0x9C0C],
- ["F671",0x9C0D],
- ["F672",0x9C0E],
- ["F673",0x9C0F],
- ["F674",0x9C10],
- ["F675",0x9C11],
- ["F676",0x9C12],
- ["F677",0x9C13],
- ["F678",0x9C14],
- ["F679",0x9C15],
- ["F67A",0x9C16],
- ["F67B",0x9C17],
- ["F67C",0x9C18],
- ["F67D",0x9C19],
- ["F67E",0x9C1A],
- ["F680",0x9C1B],
- ["F681",0x9C1C],
- ["F682",0x9C1D],
- ["F683",0x9C1E],
- ["F684",0x9C1F],
- ["F685",0x9C20],
- ["F686",0x9C21],
- ["F687",0x9C22],
- ["F688",0x9C23],
- ["F689",0x9C24],
- ["F68A",0x9C25],
- ["F68B",0x9C26],
- ["F68C",0x9C27],
- ["F68D",0x9C28],
- ["F68E",0x9C29],
- ["F68F",0x9C2A],
- ["F690",0x9C2B],
- ["F691",0x9C2C],
- ["F692",0x9C2D],
- ["F693",0x9C2E],
- ["F694",0x9C2F],
- ["F695",0x9C30],
- ["F696",0x9C31],
- ["F697",0x9C32],
- ["F698",0x9C33],
- ["F699",0x9C34],
- ["F69A",0x9C35],
- ["F69B",0x9C36],
- ["F69C",0x9C37],
- ["F69D",0x9C38],
- ["F69E",0x9C39],
- ["F69F",0x9C3A],
- ["F6A0",0x9C3B],
- ["F740",0x9C3C],
- ["F741",0x9C3D],
- ["F742",0x9C3E],
- ["F743",0x9C3F],
- ["F744",0x9C40],
- ["F745",0x9C41],
- ["F746",0x9C42],
- ["F747",0x9C43],
- ["F748",0x9C44],
- ["F749",0x9C45],
- ["F74A",0x9C46],
- ["F74B",0x9C47],
- ["F74C",0x9C48],
- ["F74D",0x9C49],
- ["F74E",0x9C4A],
- ["F74F",0x9C4B],
- ["F750",0x9C4C],
- ["F751",0x9C4D],
- ["F752",0x9C4E],
- ["F753",0x9C4F],
- ["F754",0x9C50],
- ["F755",0x9C51],
- ["F756",0x9C52],
- ["F757",0x9C53],
- ["F758",0x9C54],
- ["F759",0x9C55],
- ["F75A",0x9C56],
- ["F75B",0x9C57],
- ["F75C",0x9C58],
- ["F75D",0x9C59],
- ["F75E",0x9C5A],
- ["F75F",0x9C5B],
- ["F760",0x9C5C],
- ["F761",0x9C5D],
- ["F762",0x9C5E],
- ["F763",0x9C5F],
- ["F764",0x9C60],
- ["F765",0x9C61],
- ["F766",0x9C62],
- ["F767",0x9C63],
- ["F768",0x9C64],
- ["F769",0x9C65],
- ["F76A",0x9C66],
- ["F76B",0x9C67],
- ["F76C",0x9C68],
- ["F76D",0x9C69],
- ["F76E",0x9C6A],
- ["F76F",0x9C6B],
- ["F770",0x9C6C],
- ["F771",0x9C6D],
- ["F772",0x9C6E],
- ["F773",0x9C6F],
- ["F774",0x9C70],
- ["F775",0x9C71],
- ["F776",0x9C72],
- ["F777",0x9C73],
- ["F778",0x9C74],
- ["F779",0x9C75],
- ["F77A",0x9C76],
- ["F77B",0x9C77],
- ["F77C",0x9C78],
- ["F77D",0x9C79],
- ["F77E",0x9C7A],
- ["F780",0x9C7B],
- ["D3E3",0x9C7C],
- ["F781",0x9C7D],
- ["F782",0x9C7E],
- ["F6CF",0x9C7F],
- ["F783",0x9C80],
- ["C2B3",0x9C81],
- ["F6D0",0x9C82],
- ["F784",0x9C83],
- ["F785",0x9C84],
- ["F6D1",0x9C85],
- ["F6D2",0x9C86],
- ["F6D3",0x9C87],
- ["F6D4",0x9C88],
- ["F786",0x9C89],
- ["F787",0x9C8A],
- ["F6D6",0x9C8B],
- ["F788",0x9C8C],
- ["B1AB",0x9C8D],
- ["F6D7",0x9C8E],
- ["F789",0x9C8F],
- ["F6D8",0x9C90],
- ["F6D9",0x9C91],
- ["F6DA",0x9C92],
- ["F78A",0x9C93],
- ["F6DB",0x9C94],
- ["F6DC",0x9C95],
- ["F78B",0x9C96],
- ["F78C",0x9C97],
- ["F78D",0x9C98],
- ["F78E",0x9C99],
- ["F6DD",0x9C9A],
- ["F6DE",0x9C9B],
- ["CFCA",0x9C9C],
- ["F78F",0x9C9D],
- ["F6DF",0x9C9E],
- ["F6E0",0x9C9F],
- ["F6E1",0x9CA0],
- ["F6E2",0x9CA1],
- ["F6E3",0x9CA2],
- ["F6E4",0x9CA3],
- ["C0F0",0x9CA4],
- ["F6E5",0x9CA5],
- ["F6E6",0x9CA6],
- ["F6E7",0x9CA7],
- ["F6E8",0x9CA8],
- ["F6E9",0x9CA9],
- ["F790",0x9CAA],
- ["F6EA",0x9CAB],
- ["F791",0x9CAC],
- ["F6EB",0x9CAD],
- ["F6EC",0x9CAE],
- ["F792",0x9CAF],
- ["F6ED",0x9CB0],
- ["F6EE",0x9CB1],
- ["F6EF",0x9CB2],
- ["F6F0",0x9CB3],
- ["F6F1",0x9CB4],
- ["F6F2",0x9CB5],
- ["F6F3",0x9CB6],
- ["F6F4",0x9CB7],
- ["BEA8",0x9CB8],
- ["F793",0x9CB9],
- ["F6F5",0x9CBA],
- ["F6F6",0x9CBB],
- ["F6F7",0x9CBC],
- ["F6F8",0x9CBD],
- ["F794",0x9CBE],
- ["F795",0x9CBF],
- ["F796",0x9CC0],
- ["F797",0x9CC1],
- ["F798",0x9CC2],
- ["C8FA",0x9CC3],
- ["F6F9",0x9CC4],
- ["F6FA",0x9CC5],
- ["F6FB",0x9CC6],
- ["F6FC",0x9CC7],
- ["F799",0x9CC8],
- ["F79A",0x9CC9],
- ["F6FD",0x9CCA],
- ["F6FE",0x9CCB],
- ["F7A1",0x9CCC],
- ["F7A2",0x9CCD],
- ["F7A3",0x9CCE],
- ["F7A4",0x9CCF],
- ["F7A5",0x9CD0],
- ["F79B",0x9CD1],
- ["F79C",0x9CD2],
- ["F7A6",0x9CD3],
- ["F7A7",0x9CD4],
- ["F7A8",0x9CD5],
- ["B1EE",0x9CD6],
- ["F7A9",0x9CD7],
- ["F7AA",0x9CD8],
- ["F7AB",0x9CD9],
- ["F79D",0x9CDA],
- ["F79E",0x9CDB],
- ["F7AC",0x9CDC],
- ["F7AD",0x9CDD],
- ["C1DB",0x9CDE],
- ["F7AE",0x9CDF],
- ["F79F",0x9CE0],
- ["F7A0",0x9CE1],
- ["F7AF",0x9CE2],
- ["F840",0x9CE3],
- ["F841",0x9CE4],
- ["F842",0x9CE5],
- ["F843",0x9CE6],
- ["F844",0x9CE7],
- ["F845",0x9CE8],
- ["F846",0x9CE9],
- ["F847",0x9CEA],
- ["F848",0x9CEB],
- ["F849",0x9CEC],
- ["F84A",0x9CED],
- ["F84B",0x9CEE],
- ["F84C",0x9CEF],
- ["F84D",0x9CF0],
- ["F84E",0x9CF1],
- ["F84F",0x9CF2],
- ["F850",0x9CF3],
- ["F851",0x9CF4],
- ["F852",0x9CF5],
- ["F853",0x9CF6],
- ["F854",0x9CF7],
- ["F855",0x9CF8],
- ["F856",0x9CF9],
- ["F857",0x9CFA],
- ["F858",0x9CFB],
- ["F859",0x9CFC],
- ["F85A",0x9CFD],
- ["F85B",0x9CFE],
- ["F85C",0x9CFF],
- ["F85D",0x9D00],
- ["F85E",0x9D01],
- ["F85F",0x9D02],
- ["F860",0x9D03],
- ["F861",0x9D04],
- ["F862",0x9D05],
- ["F863",0x9D06],
- ["F864",0x9D07],
- ["F865",0x9D08],
- ["F866",0x9D09],
- ["F867",0x9D0A],
- ["F868",0x9D0B],
- ["F869",0x9D0C],
- ["F86A",0x9D0D],
- ["F86B",0x9D0E],
- ["F86C",0x9D0F],
- ["F86D",0x9D10],
- ["F86E",0x9D11],
- ["F86F",0x9D12],
- ["F870",0x9D13],
- ["F871",0x9D14],
- ["F872",0x9D15],
- ["F873",0x9D16],
- ["F874",0x9D17],
- ["F875",0x9D18],
- ["F876",0x9D19],
- ["F877",0x9D1A],
- ["F878",0x9D1B],
- ["F879",0x9D1C],
- ["F87A",0x9D1D],
- ["F87B",0x9D1E],
- ["F87C",0x9D1F],
- ["F87D",0x9D20],
- ["F87E",0x9D21],
- ["F880",0x9D22],
- ["F881",0x9D23],
- ["F882",0x9D24],
- ["F883",0x9D25],
- ["F884",0x9D26],
- ["F885",0x9D27],
- ["F886",0x9D28],
- ["F887",0x9D29],
- ["F888",0x9D2A],
- ["F889",0x9D2B],
- ["F88A",0x9D2C],
- ["F88B",0x9D2D],
- ["F88C",0x9D2E],
- ["F88D",0x9D2F],
- ["F88E",0x9D30],
- ["F88F",0x9D31],
- ["F890",0x9D32],
- ["F891",0x9D33],
- ["F892",0x9D34],
- ["F893",0x9D35],
- ["F894",0x9D36],
- ["F895",0x9D37],
- ["F896",0x9D38],
- ["F897",0x9D39],
- ["F898",0x9D3A],
- ["F899",0x9D3B],
- ["F89A",0x9D3C],
- ["F89B",0x9D3D],
- ["F89C",0x9D3E],
- ["F89D",0x9D3F],
- ["F89E",0x9D40],
- ["F89F",0x9D41],
- ["F8A0",0x9D42],
- ["F940",0x9D43],
- ["F941",0x9D44],
- ["F942",0x9D45],
- ["F943",0x9D46],
- ["F944",0x9D47],
- ["F945",0x9D48],
- ["F946",0x9D49],
- ["F947",0x9D4A],
- ["F948",0x9D4B],
- ["F949",0x9D4C],
- ["F94A",0x9D4D],
- ["F94B",0x9D4E],
- ["F94C",0x9D4F],
- ["F94D",0x9D50],
- ["F94E",0x9D51],
- ["F94F",0x9D52],
- ["F950",0x9D53],
- ["F951",0x9D54],
- ["F952",0x9D55],
- ["F953",0x9D56],
- ["F954",0x9D57],
- ["F955",0x9D58],
- ["F956",0x9D59],
- ["F957",0x9D5A],
- ["F958",0x9D5B],
- ["F959",0x9D5C],
- ["F95A",0x9D5D],
- ["F95B",0x9D5E],
- ["F95C",0x9D5F],
- ["F95D",0x9D60],
- ["F95E",0x9D61],
- ["F95F",0x9D62],
- ["F960",0x9D63],
- ["F961",0x9D64],
- ["F962",0x9D65],
- ["F963",0x9D66],
- ["F964",0x9D67],
- ["F965",0x9D68],
- ["F966",0x9D69],
- ["F967",0x9D6A],
- ["F968",0x9D6B],
- ["F969",0x9D6C],
- ["F96A",0x9D6D],
- ["F96B",0x9D6E],
- ["F96C",0x9D6F],
- ["F96D",0x9D70],
- ["F96E",0x9D71],
- ["F96F",0x9D72],
- ["F970",0x9D73],
- ["F971",0x9D74],
- ["F972",0x9D75],
- ["F973",0x9D76],
- ["F974",0x9D77],
- ["F975",0x9D78],
- ["F976",0x9D79],
- ["F977",0x9D7A],
- ["F978",0x9D7B],
- ["F979",0x9D7C],
- ["F97A",0x9D7D],
- ["F97B",0x9D7E],
- ["F97C",0x9D7F],
- ["F97D",0x9D80],
- ["F97E",0x9D81],
- ["F980",0x9D82],
- ["F981",0x9D83],
- ["F982",0x9D84],
- ["F983",0x9D85],
- ["F984",0x9D86],
- ["F985",0x9D87],
- ["F986",0x9D88],
- ["F987",0x9D89],
- ["F988",0x9D8A],
- ["F989",0x9D8B],
- ["F98A",0x9D8C],
- ["F98B",0x9D8D],
- ["F98C",0x9D8E],
- ["F98D",0x9D8F],
- ["F98E",0x9D90],
- ["F98F",0x9D91],
- ["F990",0x9D92],
- ["F991",0x9D93],
- ["F992",0x9D94],
- ["F993",0x9D95],
- ["F994",0x9D96],
- ["F995",0x9D97],
- ["F996",0x9D98],
- ["F997",0x9D99],
- ["F998",0x9D9A],
- ["F999",0x9D9B],
- ["F99A",0x9D9C],
- ["F99B",0x9D9D],
- ["F99C",0x9D9E],
- ["F99D",0x9D9F],
- ["F99E",0x9DA0],
- ["F99F",0x9DA1],
- ["F9A0",0x9DA2],
- ["FA40",0x9DA3],
- ["FA41",0x9DA4],
- ["FA42",0x9DA5],
- ["FA43",0x9DA6],
- ["FA44",0x9DA7],
- ["FA45",0x9DA8],
- ["FA46",0x9DA9],
- ["FA47",0x9DAA],
- ["FA48",0x9DAB],
- ["FA49",0x9DAC],
- ["FA4A",0x9DAD],
- ["FA4B",0x9DAE],
- ["FA4C",0x9DAF],
- ["FA4D",0x9DB0],
- ["FA4E",0x9DB1],
- ["FA4F",0x9DB2],
- ["FA50",0x9DB3],
- ["FA51",0x9DB4],
- ["FA52",0x9DB5],
- ["FA53",0x9DB6],
- ["FA54",0x9DB7],
- ["FA55",0x9DB8],
- ["FA56",0x9DB9],
- ["FA57",0x9DBA],
- ["FA58",0x9DBB],
- ["FA59",0x9DBC],
- ["FA5A",0x9DBD],
- ["FA5B",0x9DBE],
- ["FA5C",0x9DBF],
- ["FA5D",0x9DC0],
- ["FA5E",0x9DC1],
- ["FA5F",0x9DC2],
- ["FA60",0x9DC3],
- ["FA61",0x9DC4],
- ["FA62",0x9DC5],
- ["FA63",0x9DC6],
- ["FA64",0x9DC7],
- ["FA65",0x9DC8],
- ["FA66",0x9DC9],
- ["FA67",0x9DCA],
- ["FA68",0x9DCB],
- ["FA69",0x9DCC],
- ["FA6A",0x9DCD],
- ["FA6B",0x9DCE],
- ["FA6C",0x9DCF],
- ["FA6D",0x9DD0],
- ["FA6E",0x9DD1],
- ["FA6F",0x9DD2],
- ["FA70",0x9DD3],
- ["FA71",0x9DD4],
- ["FA72",0x9DD5],
- ["FA73",0x9DD6],
- ["FA74",0x9DD7],
- ["FA75",0x9DD8],
- ["FA76",0x9DD9],
- ["FA77",0x9DDA],
- ["FA78",0x9DDB],
- ["FA79",0x9DDC],
- ["FA7A",0x9DDD],
- ["FA7B",0x9DDE],
- ["FA7C",0x9DDF],
- ["FA7D",0x9DE0],
- ["FA7E",0x9DE1],
- ["FA80",0x9DE2],
- ["FA81",0x9DE3],
- ["FA82",0x9DE4],
- ["FA83",0x9DE5],
- ["FA84",0x9DE6],
- ["FA85",0x9DE7],
- ["FA86",0x9DE8],
- ["FA87",0x9DE9],
- ["FA88",0x9DEA],
- ["FA89",0x9DEB],
- ["FA8A",0x9DEC],
- ["FA8B",0x9DED],
- ["FA8C",0x9DEE],
- ["FA8D",0x9DEF],
- ["FA8E",0x9DF0],
- ["FA8F",0x9DF1],
- ["FA90",0x9DF2],
- ["FA91",0x9DF3],
- ["FA92",0x9DF4],
- ["FA93",0x9DF5],
- ["FA94",0x9DF6],
- ["FA95",0x9DF7],
- ["FA96",0x9DF8],
- ["FA97",0x9DF9],
- ["FA98",0x9DFA],
- ["FA99",0x9DFB],
- ["FA9A",0x9DFC],
- ["FA9B",0x9DFD],
- ["FA9C",0x9DFE],
- ["FA9D",0x9DFF],
- ["FA9E",0x9E00],
- ["FA9F",0x9E01],
- ["FAA0",0x9E02],
- ["FB40",0x9E03],
- ["FB41",0x9E04],
- ["FB42",0x9E05],
- ["FB43",0x9E06],
- ["FB44",0x9E07],
- ["FB45",0x9E08],
- ["FB46",0x9E09],
- ["FB47",0x9E0A],
- ["FB48",0x9E0B],
- ["FB49",0x9E0C],
- ["FB4A",0x9E0D],
- ["FB4B",0x9E0E],
- ["FB4C",0x9E0F],
- ["FB4D",0x9E10],
- ["FB4E",0x9E11],
- ["FB4F",0x9E12],
- ["FB50",0x9E13],
- ["FB51",0x9E14],
- ["FB52",0x9E15],
- ["FB53",0x9E16],
- ["FB54",0x9E17],
- ["FB55",0x9E18],
- ["FB56",0x9E19],
- ["FB57",0x9E1A],
- ["FB58",0x9E1B],
- ["FB59",0x9E1C],
- ["FB5A",0x9E1D],
- ["FB5B",0x9E1E],
- ["C4F1",0x9E1F],
- ["F0AF",0x9E20],
- ["BCA6",0x9E21],
- ["F0B0",0x9E22],
- ["C3F9",0x9E23],
- ["FB5C",0x9E24],
- ["C5B8",0x9E25],
- ["D1BB",0x9E26],
- ["FB5D",0x9E27],
- ["F0B1",0x9E28],
- ["F0B2",0x9E29],
- ["F0B3",0x9E2A],
- ["F0B4",0x9E2B],
- ["F0B5",0x9E2C],
- ["D1BC",0x9E2D],
- ["FB5E",0x9E2E],
- ["D1EC",0x9E2F],
- ["FB5F",0x9E30],
- ["F0B7",0x9E31],
- ["F0B6",0x9E32],
- ["D4A7",0x9E33],
- ["FB60",0x9E34],
- ["CDD2",0x9E35],
- ["F0B8",0x9E36],
- ["F0BA",0x9E37],
- ["F0B9",0x9E38],
- ["F0BB",0x9E39],
- ["F0BC",0x9E3A],
- ["FB61",0x9E3B],
- ["FB62",0x9E3C],
- ["B8EB",0x9E3D],
- ["F0BD",0x9E3E],
- ["BAE8",0x9E3F],
- ["FB63",0x9E40],
- ["F0BE",0x9E41],
- ["F0BF",0x9E42],
- ["BEE9",0x9E43],
- ["F0C0",0x9E44],
- ["B6EC",0x9E45],
- ["F0C1",0x9E46],
- ["F0C2",0x9E47],
- ["F0C3",0x9E48],
- ["F0C4",0x9E49],
- ["C8B5",0x9E4A],
- ["F0C5",0x9E4B],
- ["F0C6",0x9E4C],
- ["FB64",0x9E4D],
- ["F0C7",0x9E4E],
- ["C5F4",0x9E4F],
- ["FB65",0x9E50],
- ["F0C8",0x9E51],
- ["FB66",0x9E52],
- ["FB67",0x9E53],
- ["FB68",0x9E54],
- ["F0C9",0x9E55],
- ["FB69",0x9E56],
- ["F0CA",0x9E57],
- ["F7BD",0x9E58],
- ["FB6A",0x9E59],
- ["F0CB",0x9E5A],
- ["F0CC",0x9E5B],
- ["F0CD",0x9E5C],
- ["FB6B",0x9E5D],
- ["F0CE",0x9E5E],
- ["FB6C",0x9E5F],
- ["FB6D",0x9E60],
- ["FB6E",0x9E61],
- ["FB6F",0x9E62],
- ["F0CF",0x9E63],
- ["BAD7",0x9E64],
- ["FB70",0x9E65],
- ["F0D0",0x9E66],
- ["F0D1",0x9E67],
- ["F0D2",0x9E68],
- ["F0D3",0x9E69],
- ["F0D4",0x9E6A],
- ["F0D5",0x9E6B],
- ["F0D6",0x9E6C],
- ["F0D8",0x9E6D],
- ["FB71",0x9E6E],
- ["FB72",0x9E6F],
- ["D3A5",0x9E70],
- ["F0D7",0x9E71],
- ["FB73",0x9E72],
- ["F0D9",0x9E73],
- ["FB74",0x9E74],
- ["FB75",0x9E75],
- ["FB76",0x9E76],
- ["FB77",0x9E77],
- ["FB78",0x9E78],
- ["FB79",0x9E79],
- ["FB7A",0x9E7A],
- ["FB7B",0x9E7B],
- ["FB7C",0x9E7C],
- ["FB7D",0x9E7D],
- ["F5BA",0x9E7E],
- ["C2B9",0x9E7F],
- ["FB7E",0x9E80],
- ["FB80",0x9E81],
- ["F7E4",0x9E82],
- ["FB81",0x9E83],
- ["FB82",0x9E84],
- ["FB83",0x9E85],
- ["FB84",0x9E86],
- ["F7E5",0x9E87],
- ["F7E6",0x9E88],
- ["FB85",0x9E89],
- ["FB86",0x9E8A],
- ["F7E7",0x9E8B],
- ["FB87",0x9E8C],
- ["FB88",0x9E8D],
- ["FB89",0x9E8E],
- ["FB8A",0x9E8F],
- ["FB8B",0x9E90],
- ["FB8C",0x9E91],
- ["F7E8",0x9E92],
- ["C2B4",0x9E93],
- ["FB8D",0x9E94],
- ["FB8E",0x9E95],
- ["FB8F",0x9E96],
- ["FB90",0x9E97],
- ["FB91",0x9E98],
- ["FB92",0x9E99],
- ["FB93",0x9E9A],
- ["FB94",0x9E9B],
- ["FB95",0x9E9C],
- ["F7EA",0x9E9D],
- ["FB96",0x9E9E],
- ["F7EB",0x9E9F],
- ["FB97",0x9EA0],
- ["FB98",0x9EA1],
- ["FB99",0x9EA2],
- ["FB9A",0x9EA3],
- ["FB9B",0x9EA4],
- ["FB9C",0x9EA5],
- ["C2F3",0x9EA6],
- ["FB9D",0x9EA7],
- ["FB9E",0x9EA8],
- ["FB9F",0x9EA9],
- ["FBA0",0x9EAA],
- ["FC40",0x9EAB],
- ["FC41",0x9EAC],
- ["FC42",0x9EAD],
- ["FC43",0x9EAE],
- ["FC44",0x9EAF],
- ["FC45",0x9EB0],
- ["FC46",0x9EB1],
- ["FC47",0x9EB2],
- ["FC48",0x9EB3],
- ["F4F0",0x9EB4],
- ["FC49",0x9EB5],
- ["FC4A",0x9EB6],
- ["FC4B",0x9EB7],
- ["F4EF",0x9EB8],
- ["FC4C",0x9EB9],
- ["FC4D",0x9EBA],
- ["C2E9",0x9EBB],
- ["FC4E",0x9EBC],
- ["F7E1",0x9EBD],
- ["F7E2",0x9EBE],
- ["FC4F",0x9EBF],
- ["FC50",0x9EC0],
- ["FC51",0x9EC1],
- ["FC52",0x9EC2],
- ["FC53",0x9EC3],
- ["BBC6",0x9EC4],
- ["FC54",0x9EC5],
- ["FC55",0x9EC6],
- ["FC56",0x9EC7],
- ["FC57",0x9EC8],
- ["D9E4",0x9EC9],
- ["FC58",0x9ECA],
- ["FC59",0x9ECB],
- ["FC5A",0x9ECC],
- ["CAF2",0x9ECD],
- ["C0E8",0x9ECE],
- ["F0A4",0x9ECF],
- ["FC5B",0x9ED0],
- ["BADA",0x9ED1],
- ["FC5C",0x9ED2],
- ["FC5D",0x9ED3],
- ["C7AD",0x9ED4],
- ["FC5E",0x9ED5],
- ["FC5F",0x9ED6],
- ["FC60",0x9ED7],
- ["C4AC",0x9ED8],
- ["FC61",0x9ED9],
- ["FC62",0x9EDA],
- ["F7EC",0x9EDB],
- ["F7ED",0x9EDC],
- ["F7EE",0x9EDD],
- ["FC63",0x9EDE],
- ["F7F0",0x9EDF],
- ["F7EF",0x9EE0],
- ["FC64",0x9EE1],
- ["F7F1",0x9EE2],
- ["FC65",0x9EE3],
- ["FC66",0x9EE4],
- ["F7F4",0x9EE5],
- ["FC67",0x9EE6],
- ["F7F3",0x9EE7],
- ["FC68",0x9EE8],
- ["F7F2",0x9EE9],
- ["F7F5",0x9EEA],
- ["FC69",0x9EEB],
- ["FC6A",0x9EEC],
- ["FC6B",0x9EED],
- ["FC6C",0x9EEE],
- ["F7F6",0x9EEF],
- ["FC6D",0x9EF0],
- ["FC6E",0x9EF1],
- ["FC6F",0x9EF2],
- ["FC70",0x9EF3],
- ["FC71",0x9EF4],
- ["FC72",0x9EF5],
- ["FC73",0x9EF6],
- ["FC74",0x9EF7],
- ["FC75",0x9EF8],
- ["EDE9",0x9EF9],
- ["FC76",0x9EFA],
- ["EDEA",0x9EFB],
- ["EDEB",0x9EFC],
- ["FC77",0x9EFD],
- ["F6BC",0x9EFE],
- ["FC78",0x9EFF],
- ["FC79",0x9F00],
- ["FC7A",0x9F01],
- ["FC7B",0x9F02],
- ["FC7C",0x9F03],
- ["FC7D",0x9F04],
- ["FC7E",0x9F05],
- ["FC80",0x9F06],
- ["FC81",0x9F07],
- ["FC82",0x9F08],
- ["FC83",0x9F09],
- ["FC84",0x9F0A],
- ["F6BD",0x9F0B],
- ["FC85",0x9F0C],
- ["F6BE",0x9F0D],
- ["B6A6",0x9F0E],
- ["FC86",0x9F0F],
- ["D8BE",0x9F10],
- ["FC87",0x9F11],
- ["FC88",0x9F12],
- ["B9C4",0x9F13],
- ["FC89",0x9F14],
- ["FC8A",0x9F15],
- ["FC8B",0x9F16],
- ["D8BB",0x9F17],
- ["FC8C",0x9F18],
- ["DCB1",0x9F19],
- ["FC8D",0x9F1A],
- ["FC8E",0x9F1B],
- ["FC8F",0x9F1C],
- ["FC90",0x9F1D],
- ["FC91",0x9F1E],
- ["FC92",0x9F1F],
- ["CAF3",0x9F20],
- ["FC93",0x9F21],
- ["F7F7",0x9F22],
- ["FC94",0x9F23],
- ["FC95",0x9F24],
- ["FC96",0x9F25],
- ["FC97",0x9F26],
- ["FC98",0x9F27],
- ["FC99",0x9F28],
- ["FC9A",0x9F29],
- ["FC9B",0x9F2A],
- ["FC9C",0x9F2B],
- ["F7F8",0x9F2C],
- ["FC9D",0x9F2D],
- ["FC9E",0x9F2E],
- ["F7F9",0x9F2F],
- ["FC9F",0x9F30],
- ["FCA0",0x9F31],
- ["FD40",0x9F32],
- ["FD41",0x9F33],
- ["FD42",0x9F34],
- ["FD43",0x9F35],
- ["FD44",0x9F36],
- ["F7FB",0x9F37],
- ["FD45",0x9F38],
- ["F7FA",0x9F39],
- ["FD46",0x9F3A],
- ["B1C7",0x9F3B],
- ["FD47",0x9F3C],
- ["F7FC",0x9F3D],
- ["F7FD",0x9F3E],
- ["FD48",0x9F3F],
- ["FD49",0x9F40],
- ["FD4A",0x9F41],
- ["FD4B",0x9F42],
- ["FD4C",0x9F43],
- ["F7FE",0x9F44],
- ["FD4D",0x9F45],
- ["FD4E",0x9F46],
- ["FD4F",0x9F47],
- ["FD50",0x9F48],
- ["FD51",0x9F49],
- ["FD52",0x9F4A],
- ["FD53",0x9F4B],
- ["FD54",0x9F4C],
- ["FD55",0x9F4D],
- ["FD56",0x9F4E],
- ["FD57",0x9F4F],
- ["C6EB",0x9F50],
- ["ECB4",0x9F51],
- ["FD58",0x9F52],
- ["FD59",0x9F53],
- ["FD5A",0x9F54],
- ["FD5B",0x9F55],
- ["FD5C",0x9F56],
- ["FD5D",0x9F57],
- ["FD5E",0x9F58],
- ["FD5F",0x9F59],
- ["FD60",0x9F5A],
- ["FD61",0x9F5B],
- ["FD62",0x9F5C],
- ["FD63",0x9F5D],
- ["FD64",0x9F5E],
- ["FD65",0x9F5F],
- ["FD66",0x9F60],
- ["FD67",0x9F61],
- ["FD68",0x9F62],
- ["FD69",0x9F63],
- ["FD6A",0x9F64],
- ["FD6B",0x9F65],
- ["FD6C",0x9F66],
- ["FD6D",0x9F67],
- ["FD6E",0x9F68],
- ["FD6F",0x9F69],
- ["FD70",0x9F6A],
- ["FD71",0x9F6B],
- ["FD72",0x9F6C],
- ["FD73",0x9F6D],
- ["FD74",0x9F6E],
- ["FD75",0x9F6F],
- ["FD76",0x9F70],
- ["FD77",0x9F71],
- ["FD78",0x9F72],
- ["FD79",0x9F73],
- ["FD7A",0x9F74],
- ["FD7B",0x9F75],
- ["FD7C",0x9F76],
- ["FD7D",0x9F77],
- ["FD7E",0x9F78],
- ["FD80",0x9F79],
- ["FD81",0x9F7A],
- ["FD82",0x9F7B],
- ["FD83",0x9F7C],
- ["FD84",0x9F7D],
- ["FD85",0x9F7E],
- ["B3DD",0x9F7F],
- ["F6B3",0x9F80],
- ["FD86",0x9F81],
- ["FD87",0x9F82],
- ["F6B4",0x9F83],
- ["C1E4",0x9F84],
- ["F6B5",0x9F85],
- ["F6B6",0x9F86],
- ["F6B7",0x9F87],
- ["F6B8",0x9F88],
- ["F6B9",0x9F89],
- ["F6BA",0x9F8A],
- ["C8A3",0x9F8B],
- ["F6BB",0x9F8C],
- ["FD88",0x9F8D],
- ["FD89",0x9F8E],
- ["FD8A",0x9F8F],
- ["FD8B",0x9F90],
- ["FD8C",0x9F91],
- ["FD8D",0x9F92],
- ["FD8E",0x9F93],
- ["FD8F",0x9F94],
- ["FD90",0x9F95],
- ["FD91",0x9F96],
- ["FD92",0x9F97],
- ["FD93",0x9F98],
- ["C1FA",0x9F99],
- ["B9A8",0x9F9A],
- ["EDE8",0x9F9B],
- ["FD94",0x9F9C],
- ["FD95",0x9F9D],
- ["FD96",0x9F9E],
- ["B9EA",0x9F9F],
- ["D9DF",0x9FA0],
- ["FD97",0x9FA1],
- ["FD98",0x9FA2],
- ["FD99",0x9FA3],
- ["FD9A",0x9FA4],
- ["FD9B",0x9FA5],
- ["82358F33",0x9FA6],
- ["82358F34",0x9FA7],
- ["82358F35",0x9FA8],
- ["82358F36",0x9FA9],
- ["82358F37",0x9FAA],
- ["82358F38",0x9FAB],
- ["82358F39",0x9FAC],
- ["82359030",0x9FAD],
- ["82359031",0x9FAE],
- ["82359032",0x9FAF],
- ["82359033",0x9FB0],
- ["82359034",0x9FB1],
- ["82359035",0x9FB2],
- ["82359036",0x9FB3],
- ["82359037",0x9FB4],
- ["82359038",0x9FB5],
- ["82359039",0x9FB6],
- ["82359130",0x9FB7],
- ["82359131",0x9FB8],
- ["82359132",0x9FB9],
- ["82359133",0x9FBA],
- ["82359134",0x9FBB],
- ["82359135",0x9FBC],
- ["82359136",0x9FBD],
- ["82359137",0x9FBE],
- ["82359138",0x9FBF],
- ["82359139",0x9FC0],
- ["82359230",0x9FC1],
- ["82359231",0x9FC2],
- ["82359232",0x9FC3],
- ["82359233",0x9FC4],
- ["82359234",0x9FC5],
- ["82359235",0x9FC6],
- ["82359236",0x9FC7],
- ["82359237",0x9FC8],
- ["82359238",0x9FC9],
- ["82359239",0x9FCA],
- ["82359330",0x9FCB],
- ["82359331",0x9FCC],
- ["82359332",0x9FCD],
- ["82359333",0x9FCE],
- ["82359334",0x9FCF],
- ["82359335",0x9FD0],
- ["82359336",0x9FD1],
- ["82359337",0x9FD2],
- ["82359338",0x9FD3],
- ["82359339",0x9FD4],
- ["82359430",0x9FD5],
- ["82359431",0x9FD6],
- ["82359432",0x9FD7],
- ["82359433",0x9FD8],
- ["82359434",0x9FD9],
- ["82359435",0x9FDA],
- ["82359436",0x9FDB],
- ["82359437",0x9FDC],
- ["82359438",0x9FDD],
- ["82359439",0x9FDE],
- ["82359530",0x9FDF],
- ["82359531",0x9FE0],
- ["82359532",0x9FE1],
- ["82359533",0x9FE2],
- ["82359534",0x9FE3],
- ["82359535",0x9FE4],
- ["82359536",0x9FE5],
- ["82359537",0x9FE6],
- ["82359538",0x9FE7],
- ["82359539",0x9FE8],
- ["82359630",0x9FE9],
- ["82359631",0x9FEA],
- ["82359632",0x9FEB],
- ["82359633",0x9FEC],
- ["82359634",0x9FED],
- ["82359635",0x9FEE],
- ["82359636",0x9FEF],
- ["82359637",0x9FF0],
- ["82359638",0x9FF1],
- ["82359639",0x9FF2],
- ["82359730",0x9FF3],
- ["82359731",0x9FF4],
- ["82359732",0x9FF5],
- ["82359733",0x9FF6],
- ["82359734",0x9FF7],
- ["82359735",0x9FF8],
- ["82359736",0x9FF9],
- ["82359737",0x9FFA],
- ["82359738",0x9FFB],
- ["82359739",0x9FFC],
- ["82359830",0x9FFD],
- ["82359831",0x9FFE],
- ["82359832",0x9FFF],
- ["82359833",0xA000],
- ["82359834",0xA001],
- ["82359835",0xA002],
- ["82359836",0xA003],
- ["82359837",0xA004],
- ["82359838",0xA005],
- ["82359839",0xA006],
- ["82359930",0xA007],
- ["82359931",0xA008],
- ["82359932",0xA009],
- ["82359933",0xA00A],
- ["82359934",0xA00B],
- ["82359935",0xA00C],
- ["82359936",0xA00D],
- ["82359937",0xA00E],
- ["82359938",0xA00F],
- ["82359939",0xA010],
- ["82359A30",0xA011],
- ["82359A31",0xA012],
- ["82359A32",0xA013],
- ["82359A33",0xA014],
- ["82359A34",0xA015],
- ["82359A35",0xA016],
- ["82359A36",0xA017],
- ["82359A37",0xA018],
- ["82359A38",0xA019],
- ["82359A39",0xA01A],
- ["82359B30",0xA01B],
- ["82359B31",0xA01C],
- ["82359B32",0xA01D],
- ["82359B33",0xA01E],
- ["82359B34",0xA01F],
- ["82359B35",0xA020],
- ["82359B36",0xA021],
- ["82359B37",0xA022],
- ["82359B38",0xA023],
- ["82359B39",0xA024],
- ["82359C30",0xA025],
- ["82359C31",0xA026],
- ["82359C32",0xA027],
- ["82359C33",0xA028],
- ["82359C34",0xA029],
- ["82359C35",0xA02A],
- ["82359C36",0xA02B],
- ["82359C37",0xA02C],
- ["82359C38",0xA02D],
- ["82359C39",0xA02E],
- ["82359D30",0xA02F],
- ["82359D31",0xA030],
- ["82359D32",0xA031],
- ["82359D33",0xA032],
- ["82359D34",0xA033],
- ["82359D35",0xA034],
- ["82359D36",0xA035],
- ["82359D37",0xA036],
- ["82359D38",0xA037],
- ["82359D39",0xA038],
- ["82359E30",0xA039],
- ["82359E31",0xA03A],
- ["82359E32",0xA03B],
- ["82359E33",0xA03C],
- ["82359E34",0xA03D],
- ["82359E35",0xA03E],
- ["82359E36",0xA03F],
- ["82359E37",0xA040],
- ["82359E38",0xA041],
- ["82359E39",0xA042],
- ["82359F30",0xA043],
- ["82359F31",0xA044],
- ["82359F32",0xA045],
- ["82359F33",0xA046],
- ["82359F34",0xA047],
- ["82359F35",0xA048],
- ["82359F36",0xA049],
- ["82359F37",0xA04A],
- ["82359F38",0xA04B],
- ["82359F39",0xA04C],
- ["8235A030",0xA04D],
- ["8235A031",0xA04E],
- ["8235A032",0xA04F],
- ["8235A033",0xA050],
- ["8235A034",0xA051],
- ["8235A035",0xA052],
- ["8235A036",0xA053],
- ["8235A037",0xA054],
- ["8235A038",0xA055],
- ["8235A039",0xA056],
- ["8235A130",0xA057],
- ["8235A131",0xA058],
- ["8235A132",0xA059],
- ["8235A133",0xA05A],
- ["8235A134",0xA05B],
- ["8235A135",0xA05C],
- ["8235A136",0xA05D],
- ["8235A137",0xA05E],
- ["8235A138",0xA05F],
- ["8235A139",0xA060],
- ["8235A230",0xA061],
- ["8235A231",0xA062],
- ["8235A232",0xA063],
- ["8235A233",0xA064],
- ["8235A234",0xA065],
- ["8235A235",0xA066],
- ["8235A236",0xA067],
- ["8235A237",0xA068],
- ["8235A238",0xA069],
- ["8235A239",0xA06A],
- ["8235A330",0xA06B],
- ["8235A331",0xA06C],
- ["8235A332",0xA06D],
- ["8235A333",0xA06E],
- ["8235A334",0xA06F],
- ["8235A335",0xA070],
- ["8235A336",0xA071],
- ["8235A337",0xA072],
- ["8235A338",0xA073],
- ["8235A339",0xA074],
- ["8235A430",0xA075],
- ["8235A431",0xA076],
- ["8235A432",0xA077],
- ["8235A433",0xA078],
- ["8235A434",0xA079],
- ["8235A435",0xA07A],
- ["8235A436",0xA07B],
- ["8235A437",0xA07C],
- ["8235A438",0xA07D],
- ["8235A439",0xA07E],
- ["8235A530",0xA07F],
- ["8235A531",0xA080],
- ["8235A532",0xA081],
- ["8235A533",0xA082],
- ["8235A534",0xA083],
- ["8235A535",0xA084],
- ["8235A536",0xA085],
- ["8235A537",0xA086],
- ["8235A538",0xA087],
- ["8235A539",0xA088],
- ["8235A630",0xA089],
- ["8235A631",0xA08A],
- ["8235A632",0xA08B],
- ["8235A633",0xA08C],
- ["8235A634",0xA08D],
- ["8235A635",0xA08E],
- ["8235A636",0xA08F],
- ["8235A637",0xA090],
- ["8235A638",0xA091],
- ["8235A639",0xA092],
- ["8235A730",0xA093],
- ["8235A731",0xA094],
- ["8235A732",0xA095],
- ["8235A733",0xA096],
- ["8235A734",0xA097],
- ["8235A735",0xA098],
- ["8235A736",0xA099],
- ["8235A737",0xA09A],
- ["8235A738",0xA09B],
- ["8235A739",0xA09C],
- ["8235A830",0xA09D],
- ["8235A831",0xA09E],
- ["8235A832",0xA09F],
- ["8235A833",0xA0A0],
- ["8235A834",0xA0A1],
- ["8235A835",0xA0A2],
- ["8235A836",0xA0A3],
- ["8235A837",0xA0A4],
- ["8235A838",0xA0A5],
- ["8235A839",0xA0A6],
- ["8235A930",0xA0A7],
- ["8235A931",0xA0A8],
- ["8235A932",0xA0A9],
- ["8235A933",0xA0AA],
- ["8235A934",0xA0AB],
- ["8235A935",0xA0AC],
- ["8235A936",0xA0AD],
- ["8235A937",0xA0AE],
- ["8235A938",0xA0AF],
- ["8235A939",0xA0B0],
- ["8235AA30",0xA0B1],
- ["8235AA31",0xA0B2],
- ["8235AA32",0xA0B3],
- ["8235AA33",0xA0B4],
- ["8235AA34",0xA0B5],
- ["8235AA35",0xA0B6],
- ["8235AA36",0xA0B7],
- ["8235AA37",0xA0B8],
- ["8235AA38",0xA0B9],
- ["8235AA39",0xA0BA],
- ["8235AB30",0xA0BB],
- ["8235AB31",0xA0BC],
- ["8235AB32",0xA0BD],
- ["8235AB33",0xA0BE],
- ["8235AB34",0xA0BF],
- ["8235AB35",0xA0C0],
- ["8235AB36",0xA0C1],
- ["8235AB37",0xA0C2],
- ["8235AB38",0xA0C3],
- ["8235AB39",0xA0C4],
- ["8235AC30",0xA0C5],
- ["8235AC31",0xA0C6],
- ["8235AC32",0xA0C7],
- ["8235AC33",0xA0C8],
- ["8235AC34",0xA0C9],
- ["8235AC35",0xA0CA],
- ["8235AC36",0xA0CB],
- ["8235AC37",0xA0CC],
- ["8235AC38",0xA0CD],
- ["8235AC39",0xA0CE],
- ["8235AD30",0xA0CF],
- ["8235AD31",0xA0D0],
- ["8235AD32",0xA0D1],
- ["8235AD33",0xA0D2],
- ["8235AD34",0xA0D3],
- ["8235AD35",0xA0D4],
- ["8235AD36",0xA0D5],
- ["8235AD37",0xA0D6],
- ["8235AD38",0xA0D7],
- ["8235AD39",0xA0D8],
- ["8235AE30",0xA0D9],
- ["8235AE31",0xA0DA],
- ["8235AE32",0xA0DB],
- ["8235AE33",0xA0DC],
- ["8235AE34",0xA0DD],
- ["8235AE35",0xA0DE],
- ["8235AE36",0xA0DF],
- ["8235AE37",0xA0E0],
- ["8235AE38",0xA0E1],
- ["8235AE39",0xA0E2],
- ["8235AF30",0xA0E3],
- ["8235AF31",0xA0E4],
- ["8235AF32",0xA0E5],
- ["8235AF33",0xA0E6],
- ["8235AF34",0xA0E7],
- ["8235AF35",0xA0E8],
- ["8235AF36",0xA0E9],
- ["8235AF37",0xA0EA],
- ["8235AF38",0xA0EB],
- ["8235AF39",0xA0EC],
- ["8235B030",0xA0ED],
- ["8235B031",0xA0EE],
- ["8235B032",0xA0EF],
- ["8235B033",0xA0F0],
- ["8235B034",0xA0F1],
- ["8235B035",0xA0F2],
- ["8235B036",0xA0F3],
- ["8235B037",0xA0F4],
- ["8235B038",0xA0F5],
- ["8235B039",0xA0F6],
- ["8235B130",0xA0F7],
- ["8235B131",0xA0F8],
- ["8235B132",0xA0F9],
- ["8235B133",0xA0FA],
- ["8235B134",0xA0FB],
- ["8235B135",0xA0FC],
- ["8235B136",0xA0FD],
- ["8235B137",0xA0FE],
- ["8235B138",0xA0FF],
- ["8235B139",0xA100],
- ["8235B230",0xA101],
- ["8235B231",0xA102],
- ["8235B232",0xA103],
- ["8235B233",0xA104],
- ["8235B234",0xA105],
- ["8235B235",0xA106],
- ["8235B236",0xA107],
- ["8235B237",0xA108],
- ["8235B238",0xA109],
- ["8235B239",0xA10A],
- ["8235B330",0xA10B],
- ["8235B331",0xA10C],
- ["8235B332",0xA10D],
- ["8235B333",0xA10E],
- ["8235B334",0xA10F],
- ["8235B335",0xA110],
- ["8235B336",0xA111],
- ["8235B337",0xA112],
- ["8235B338",0xA113],
- ["8235B339",0xA114],
- ["8235B430",0xA115],
- ["8235B431",0xA116],
- ["8235B432",0xA117],
- ["8235B433",0xA118],
- ["8235B434",0xA119],
- ["8235B435",0xA11A],
- ["8235B436",0xA11B],
- ["8235B437",0xA11C],
- ["8235B438",0xA11D],
- ["8235B439",0xA11E],
- ["8235B530",0xA11F],
- ["8235B531",0xA120],
- ["8235B532",0xA121],
- ["8235B533",0xA122],
- ["8235B534",0xA123],
- ["8235B535",0xA124],
- ["8235B536",0xA125],
- ["8235B537",0xA126],
- ["8235B538",0xA127],
- ["8235B539",0xA128],
- ["8235B630",0xA129],
- ["8235B631",0xA12A],
- ["8235B632",0xA12B],
- ["8235B633",0xA12C],
- ["8235B634",0xA12D],
- ["8235B635",0xA12E],
- ["8235B636",0xA12F],
- ["8235B637",0xA130],
- ["8235B638",0xA131],
- ["8235B639",0xA132],
- ["8235B730",0xA133],
- ["8235B731",0xA134],
- ["8235B732",0xA135],
- ["8235B733",0xA136],
- ["8235B734",0xA137],
- ["8235B735",0xA138],
- ["8235B736",0xA139],
- ["8235B737",0xA13A],
- ["8235B738",0xA13B],
- ["8235B739",0xA13C],
- ["8235B830",0xA13D],
- ["8235B831",0xA13E],
- ["8235B832",0xA13F],
- ["8235B833",0xA140],
- ["8235B834",0xA141],
- ["8235B835",0xA142],
- ["8235B836",0xA143],
- ["8235B837",0xA144],
- ["8235B838",0xA145],
- ["8235B839",0xA146],
- ["8235B930",0xA147],
- ["8235B931",0xA148],
- ["8235B932",0xA149],
- ["8235B933",0xA14A],
- ["8235B934",0xA14B],
- ["8235B935",0xA14C],
- ["8235B936",0xA14D],
- ["8235B937",0xA14E],
- ["8235B938",0xA14F],
- ["8235B939",0xA150],
- ["8235BA30",0xA151],
- ["8235BA31",0xA152],
- ["8235BA32",0xA153],
- ["8235BA33",0xA154],
- ["8235BA34",0xA155],
- ["8235BA35",0xA156],
- ["8235BA36",0xA157],
- ["8235BA37",0xA158],
- ["8235BA38",0xA159],
- ["8235BA39",0xA15A],
- ["8235BB30",0xA15B],
- ["8235BB31",0xA15C],
- ["8235BB32",0xA15D],
- ["8235BB33",0xA15E],
- ["8235BB34",0xA15F],
- ["8235BB35",0xA160],
- ["8235BB36",0xA161],
- ["8235BB37",0xA162],
- ["8235BB38",0xA163],
- ["8235BB39",0xA164],
- ["8235BC30",0xA165],
- ["8235BC31",0xA166],
- ["8235BC32",0xA167],
- ["8235BC33",0xA168],
- ["8235BC34",0xA169],
- ["8235BC35",0xA16A],
- ["8235BC36",0xA16B],
- ["8235BC37",0xA16C],
- ["8235BC38",0xA16D],
- ["8235BC39",0xA16E],
- ["8235BD30",0xA16F],
- ["8235BD31",0xA170],
- ["8235BD32",0xA171],
- ["8235BD33",0xA172],
- ["8235BD34",0xA173],
- ["8235BD35",0xA174],
- ["8235BD36",0xA175],
- ["8235BD37",0xA176],
- ["8235BD38",0xA177],
- ["8235BD39",0xA178],
- ["8235BE30",0xA179],
- ["8235BE31",0xA17A],
- ["8235BE32",0xA17B],
- ["8235BE33",0xA17C],
- ["8235BE34",0xA17D],
- ["8235BE35",0xA17E],
- ["8235BE36",0xA17F],
- ["8235BE37",0xA180],
- ["8235BE38",0xA181],
- ["8235BE39",0xA182],
- ["8235BF30",0xA183],
- ["8235BF31",0xA184],
- ["8235BF32",0xA185],
- ["8235BF33",0xA186],
- ["8235BF34",0xA187],
- ["8235BF35",0xA188],
- ["8235BF36",0xA189],
- ["8235BF37",0xA18A],
- ["8235BF38",0xA18B],
- ["8235BF39",0xA18C],
- ["8235C030",0xA18D],
- ["8235C031",0xA18E],
- ["8235C032",0xA18F],
- ["8235C033",0xA190],
- ["8235C034",0xA191],
- ["8235C035",0xA192],
- ["8235C036",0xA193],
- ["8235C037",0xA194],
- ["8235C038",0xA195],
- ["8235C039",0xA196],
- ["8235C130",0xA197],
- ["8235C131",0xA198],
- ["8235C132",0xA199],
- ["8235C133",0xA19A],
- ["8235C134",0xA19B],
- ["8235C135",0xA19C],
- ["8235C136",0xA19D],
- ["8235C137",0xA19E],
- ["8235C138",0xA19F],
- ["8235C139",0xA1A0],
- ["8235C230",0xA1A1],
- ["8235C231",0xA1A2],
- ["8235C232",0xA1A3],
- ["8235C233",0xA1A4],
- ["8235C234",0xA1A5],
- ["8235C235",0xA1A6],
- ["8235C236",0xA1A7],
- ["8235C237",0xA1A8],
- ["8235C238",0xA1A9],
- ["8235C239",0xA1AA],
- ["8235C330",0xA1AB],
- ["8235C331",0xA1AC],
- ["8235C332",0xA1AD],
- ["8235C333",0xA1AE],
- ["8235C334",0xA1AF],
- ["8235C335",0xA1B0],
- ["8235C336",0xA1B1],
- ["8235C337",0xA1B2],
- ["8235C338",0xA1B3],
- ["8235C339",0xA1B4],
- ["8235C430",0xA1B5],
- ["8235C431",0xA1B6],
- ["8235C432",0xA1B7],
- ["8235C433",0xA1B8],
- ["8235C434",0xA1B9],
- ["8235C435",0xA1BA],
- ["8235C436",0xA1BB],
- ["8235C437",0xA1BC],
- ["8235C438",0xA1BD],
- ["8235C439",0xA1BE],
- ["8235C530",0xA1BF],
- ["8235C531",0xA1C0],
- ["8235C532",0xA1C1],
- ["8235C533",0xA1C2],
- ["8235C534",0xA1C3],
- ["8235C535",0xA1C4],
- ["8235C536",0xA1C5],
- ["8235C537",0xA1C6],
- ["8235C538",0xA1C7],
- ["8235C539",0xA1C8],
- ["8235C630",0xA1C9],
- ["8235C631",0xA1CA],
- ["8235C632",0xA1CB],
- ["8235C633",0xA1CC],
- ["8235C634",0xA1CD],
- ["8235C635",0xA1CE],
- ["8235C636",0xA1CF],
- ["8235C637",0xA1D0],
- ["8235C638",0xA1D1],
- ["8235C639",0xA1D2],
- ["8235C730",0xA1D3],
- ["8235C731",0xA1D4],
- ["8235C732",0xA1D5],
- ["8235C733",0xA1D6],
- ["8235C734",0xA1D7],
- ["8235C735",0xA1D8],
- ["8235C736",0xA1D9],
- ["8235C737",0xA1DA],
- ["8235C738",0xA1DB],
- ["8235C739",0xA1DC],
- ["8235C830",0xA1DD],
- ["8235C831",0xA1DE],
- ["8235C832",0xA1DF],
- ["8235C833",0xA1E0],
- ["8235C834",0xA1E1],
- ["8235C835",0xA1E2],
- ["8235C836",0xA1E3],
- ["8235C837",0xA1E4],
- ["8235C838",0xA1E5],
- ["8235C839",0xA1E6],
- ["8235C930",0xA1E7],
- ["8235C931",0xA1E8],
- ["8235C932",0xA1E9],
- ["8235C933",0xA1EA],
- ["8235C934",0xA1EB],
- ["8235C935",0xA1EC],
- ["8235C936",0xA1ED],
- ["8235C937",0xA1EE],
- ["8235C938",0xA1EF],
- ["8235C939",0xA1F0],
- ["8235CA30",0xA1F1],
- ["8235CA31",0xA1F2],
- ["8235CA32",0xA1F3],
- ["8235CA33",0xA1F4],
- ["8235CA34",0xA1F5],
- ["8235CA35",0xA1F6],
- ["8235CA36",0xA1F7],
- ["8235CA37",0xA1F8],
- ["8235CA38",0xA1F9],
- ["8235CA39",0xA1FA],
- ["8235CB30",0xA1FB],
- ["8235CB31",0xA1FC],
- ["8235CB32",0xA1FD],
- ["8235CB33",0xA1FE],
- ["8235CB34",0xA1FF],
- ["8235CB35",0xA200],
- ["8235CB36",0xA201],
- ["8235CB37",0xA202],
- ["8235CB38",0xA203],
- ["8235CB39",0xA204],
- ["8235CC30",0xA205],
- ["8235CC31",0xA206],
- ["8235CC32",0xA207],
- ["8235CC33",0xA208],
- ["8235CC34",0xA209],
- ["8235CC35",0xA20A],
- ["8235CC36",0xA20B],
- ["8235CC37",0xA20C],
- ["8235CC38",0xA20D],
- ["8235CC39",0xA20E],
- ["8235CD30",0xA20F],
- ["8235CD31",0xA210],
- ["8235CD32",0xA211],
- ["8235CD33",0xA212],
- ["8235CD34",0xA213],
- ["8235CD35",0xA214],
- ["8235CD36",0xA215],
- ["8235CD37",0xA216],
- ["8235CD38",0xA217],
- ["8235CD39",0xA218],
- ["8235CE30",0xA219],
- ["8235CE31",0xA21A],
- ["8235CE32",0xA21B],
- ["8235CE33",0xA21C],
- ["8235CE34",0xA21D],
- ["8235CE35",0xA21E],
- ["8235CE36",0xA21F],
- ["8235CE37",0xA220],
- ["8235CE38",0xA221],
- ["8235CE39",0xA222],
- ["8235CF30",0xA223],
- ["8235CF31",0xA224],
- ["8235CF32",0xA225],
- ["8235CF33",0xA226],
- ["8235CF34",0xA227],
- ["8235CF35",0xA228],
- ["8235CF36",0xA229],
- ["8235CF37",0xA22A],
- ["8235CF38",0xA22B],
- ["8235CF39",0xA22C],
- ["8235D030",0xA22D],
- ["8235D031",0xA22E],
- ["8235D032",0xA22F],
- ["8235D033",0xA230],
- ["8235D034",0xA231],
- ["8235D035",0xA232],
- ["8235D036",0xA233],
- ["8235D037",0xA234],
- ["8235D038",0xA235],
- ["8235D039",0xA236],
- ["8235D130",0xA237],
- ["8235D131",0xA238],
- ["8235D132",0xA239],
- ["8235D133",0xA23A],
- ["8235D134",0xA23B],
- ["8235D135",0xA23C],
- ["8235D136",0xA23D],
- ["8235D137",0xA23E],
- ["8235D138",0xA23F],
- ["8235D139",0xA240],
- ["8235D230",0xA241],
- ["8235D231",0xA242],
- ["8235D232",0xA243],
- ["8235D233",0xA244],
- ["8235D234",0xA245],
- ["8235D235",0xA246],
- ["8235D236",0xA247],
- ["8235D237",0xA248],
- ["8235D238",0xA249],
- ["8235D239",0xA24A],
- ["8235D330",0xA24B],
- ["8235D331",0xA24C],
- ["8235D332",0xA24D],
- ["8235D333",0xA24E],
- ["8235D334",0xA24F],
- ["8235D335",0xA250],
- ["8235D336",0xA251],
- ["8235D337",0xA252],
- ["8235D338",0xA253],
- ["8235D339",0xA254],
- ["8235D430",0xA255],
- ["8235D431",0xA256],
- ["8235D432",0xA257],
- ["8235D433",0xA258],
- ["8235D434",0xA259],
- ["8235D435",0xA25A],
- ["8235D436",0xA25B],
- ["8235D437",0xA25C],
- ["8235D438",0xA25D],
- ["8235D439",0xA25E],
- ["8235D530",0xA25F],
- ["8235D531",0xA260],
- ["8235D532",0xA261],
- ["8235D533",0xA262],
- ["8235D534",0xA263],
- ["8235D535",0xA264],
- ["8235D536",0xA265],
- ["8235D537",0xA266],
- ["8235D538",0xA267],
- ["8235D539",0xA268],
- ["8235D630",0xA269],
- ["8235D631",0xA26A],
- ["8235D632",0xA26B],
- ["8235D633",0xA26C],
- ["8235D634",0xA26D],
- ["8235D635",0xA26E],
- ["8235D636",0xA26F],
- ["8235D637",0xA270],
- ["8235D638",0xA271],
- ["8235D639",0xA272],
- ["8235D730",0xA273],
- ["8235D731",0xA274],
- ["8235D732",0xA275],
- ["8235D733",0xA276],
- ["8235D734",0xA277],
- ["8235D735",0xA278],
- ["8235D736",0xA279],
- ["8235D737",0xA27A],
- ["8235D738",0xA27B],
- ["8235D739",0xA27C],
- ["8235D830",0xA27D],
- ["8235D831",0xA27E],
- ["8235D832",0xA27F],
- ["8235D833",0xA280],
- ["8235D834",0xA281],
- ["8235D835",0xA282],
- ["8235D836",0xA283],
- ["8235D837",0xA284],
- ["8235D838",0xA285],
- ["8235D839",0xA286],
- ["8235D930",0xA287],
- ["8235D931",0xA288],
- ["8235D932",0xA289],
- ["8235D933",0xA28A],
- ["8235D934",0xA28B],
- ["8235D935",0xA28C],
- ["8235D936",0xA28D],
- ["8235D937",0xA28E],
- ["8235D938",0xA28F],
- ["8235D939",0xA290],
- ["8235DA30",0xA291],
- ["8235DA31",0xA292],
- ["8235DA32",0xA293],
- ["8235DA33",0xA294],
- ["8235DA34",0xA295],
- ["8235DA35",0xA296],
- ["8235DA36",0xA297],
- ["8235DA37",0xA298],
- ["8235DA38",0xA299],
- ["8235DA39",0xA29A],
- ["8235DB30",0xA29B],
- ["8235DB31",0xA29C],
- ["8235DB32",0xA29D],
- ["8235DB33",0xA29E],
- ["8235DB34",0xA29F],
- ["8235DB35",0xA2A0],
- ["8235DB36",0xA2A1],
- ["8235DB37",0xA2A2],
- ["8235DB38",0xA2A3],
- ["8235DB39",0xA2A4],
- ["8235DC30",0xA2A5],
- ["8235DC31",0xA2A6],
- ["8235DC32",0xA2A7],
- ["8235DC33",0xA2A8],
- ["8235DC34",0xA2A9],
- ["8235DC35",0xA2AA],
- ["8235DC36",0xA2AB],
- ["8235DC37",0xA2AC],
- ["8235DC38",0xA2AD],
- ["8235DC39",0xA2AE],
- ["8235DD30",0xA2AF],
- ["8235DD31",0xA2B0],
- ["8235DD32",0xA2B1],
- ["8235DD33",0xA2B2],
- ["8235DD34",0xA2B3],
- ["8235DD35",0xA2B4],
- ["8235DD36",0xA2B5],
- ["8235DD37",0xA2B6],
- ["8235DD38",0xA2B7],
- ["8235DD39",0xA2B8],
- ["8235DE30",0xA2B9],
- ["8235DE31",0xA2BA],
- ["8235DE32",0xA2BB],
- ["8235DE33",0xA2BC],
- ["8235DE34",0xA2BD],
- ["8235DE35",0xA2BE],
- ["8235DE36",0xA2BF],
- ["8235DE37",0xA2C0],
- ["8235DE38",0xA2C1],
- ["8235DE39",0xA2C2],
- ["8235DF30",0xA2C3],
- ["8235DF31",0xA2C4],
- ["8235DF32",0xA2C5],
- ["8235DF33",0xA2C6],
- ["8235DF34",0xA2C7],
- ["8235DF35",0xA2C8],
- ["8235DF36",0xA2C9],
- ["8235DF37",0xA2CA],
- ["8235DF38",0xA2CB],
- ["8235DF39",0xA2CC],
- ["8235E030",0xA2CD],
- ["8235E031",0xA2CE],
- ["8235E032",0xA2CF],
- ["8235E033",0xA2D0],
- ["8235E034",0xA2D1],
- ["8235E035",0xA2D2],
- ["8235E036",0xA2D3],
- ["8235E037",0xA2D4],
- ["8235E038",0xA2D5],
- ["8235E039",0xA2D6],
- ["8235E130",0xA2D7],
- ["8235E131",0xA2D8],
- ["8235E132",0xA2D9],
- ["8235E133",0xA2DA],
- ["8235E134",0xA2DB],
- ["8235E135",0xA2DC],
- ["8235E136",0xA2DD],
- ["8235E137",0xA2DE],
- ["8235E138",0xA2DF],
- ["8235E139",0xA2E0],
- ["8235E230",0xA2E1],
- ["8235E231",0xA2E2],
- ["8235E232",0xA2E3],
- ["8235E233",0xA2E4],
- ["8235E234",0xA2E5],
- ["8235E235",0xA2E6],
- ["8235E236",0xA2E7],
- ["8235E237",0xA2E8],
- ["8235E238",0xA2E9],
- ["8235E239",0xA2EA],
- ["8235E330",0xA2EB],
- ["8235E331",0xA2EC],
- ["8235E332",0xA2ED],
- ["8235E333",0xA2EE],
- ["8235E334",0xA2EF],
- ["8235E335",0xA2F0],
- ["8235E336",0xA2F1],
- ["8235E337",0xA2F2],
- ["8235E338",0xA2F3],
- ["8235E339",0xA2F4],
- ["8235E430",0xA2F5],
- ["8235E431",0xA2F6],
- ["8235E432",0xA2F7],
- ["8235E433",0xA2F8],
- ["8235E434",0xA2F9],
- ["8235E435",0xA2FA],
- ["8235E436",0xA2FB],
- ["8235E437",0xA2FC],
- ["8235E438",0xA2FD],
- ["8235E439",0xA2FE],
- ["8235E530",0xA2FF],
- ["8235E531",0xA300],
- ["8235E532",0xA301],
- ["8235E533",0xA302],
- ["8235E534",0xA303],
- ["8235E535",0xA304],
- ["8235E536",0xA305],
- ["8235E537",0xA306],
- ["8235E538",0xA307],
- ["8235E539",0xA308],
- ["8235E630",0xA309],
- ["8235E631",0xA30A],
- ["8235E632",0xA30B],
- ["8235E633",0xA30C],
- ["8235E634",0xA30D],
- ["8235E635",0xA30E],
- ["8235E636",0xA30F],
- ["8235E637",0xA310],
- ["8235E638",0xA311],
- ["8235E639",0xA312],
- ["8235E730",0xA313],
- ["8235E731",0xA314],
- ["8235E732",0xA315],
- ["8235E733",0xA316],
- ["8235E734",0xA317],
- ["8235E735",0xA318],
- ["8235E736",0xA319],
- ["8235E737",0xA31A],
- ["8235E738",0xA31B],
- ["8235E739",0xA31C],
- ["8235E830",0xA31D],
- ["8235E831",0xA31E],
- ["8235E832",0xA31F],
- ["8235E833",0xA320],
- ["8235E834",0xA321],
- ["8235E835",0xA322],
- ["8235E836",0xA323],
- ["8235E837",0xA324],
- ["8235E838",0xA325],
- ["8235E839",0xA326],
- ["8235E930",0xA327],
- ["8235E931",0xA328],
- ["8235E932",0xA329],
- ["8235E933",0xA32A],
- ["8235E934",0xA32B],
- ["8235E935",0xA32C],
- ["8235E936",0xA32D],
- ["8235E937",0xA32E],
- ["8235E938",0xA32F],
- ["8235E939",0xA330],
- ["8235EA30",0xA331],
- ["8235EA31",0xA332],
- ["8235EA32",0xA333],
- ["8235EA33",0xA334],
- ["8235EA34",0xA335],
- ["8235EA35",0xA336],
- ["8235EA36",0xA337],
- ["8235EA37",0xA338],
- ["8235EA38",0xA339],
- ["8235EA39",0xA33A],
- ["8235EB30",0xA33B],
- ["8235EB31",0xA33C],
- ["8235EB32",0xA33D],
- ["8235EB33",0xA33E],
- ["8235EB34",0xA33F],
- ["8235EB35",0xA340],
- ["8235EB36",0xA341],
- ["8235EB37",0xA342],
- ["8235EB38",0xA343],
- ["8235EB39",0xA344],
- ["8235EC30",0xA345],
- ["8235EC31",0xA346],
- ["8235EC32",0xA347],
- ["8235EC33",0xA348],
- ["8235EC34",0xA349],
- ["8235EC35",0xA34A],
- ["8235EC36",0xA34B],
- ["8235EC37",0xA34C],
- ["8235EC38",0xA34D],
- ["8235EC39",0xA34E],
- ["8235ED30",0xA34F],
- ["8235ED31",0xA350],
- ["8235ED32",0xA351],
- ["8235ED33",0xA352],
- ["8235ED34",0xA353],
- ["8235ED35",0xA354],
- ["8235ED36",0xA355],
- ["8235ED37",0xA356],
- ["8235ED38",0xA357],
- ["8235ED39",0xA358],
- ["8235EE30",0xA359],
- ["8235EE31",0xA35A],
- ["8235EE32",0xA35B],
- ["8235EE33",0xA35C],
- ["8235EE34",0xA35D],
- ["8235EE35",0xA35E],
- ["8235EE36",0xA35F],
- ["8235EE37",0xA360],
- ["8235EE38",0xA361],
- ["8235EE39",0xA362],
- ["8235EF30",0xA363],
- ["8235EF31",0xA364],
- ["8235EF32",0xA365],
- ["8235EF33",0xA366],
- ["8235EF34",0xA367],
- ["8235EF35",0xA368],
- ["8235EF36",0xA369],
- ["8235EF37",0xA36A],
- ["8235EF38",0xA36B],
- ["8235EF39",0xA36C],
- ["8235F030",0xA36D],
- ["8235F031",0xA36E],
- ["8235F032",0xA36F],
- ["8235F033",0xA370],
- ["8235F034",0xA371],
- ["8235F035",0xA372],
- ["8235F036",0xA373],
- ["8235F037",0xA374],
- ["8235F038",0xA375],
- ["8235F039",0xA376],
- ["8235F130",0xA377],
- ["8235F131",0xA378],
- ["8235F132",0xA379],
- ["8235F133",0xA37A],
- ["8235F134",0xA37B],
- ["8235F135",0xA37C],
- ["8235F136",0xA37D],
- ["8235F137",0xA37E],
- ["8235F138",0xA37F],
- ["8235F139",0xA380],
- ["8235F230",0xA381],
- ["8235F231",0xA382],
- ["8235F232",0xA383],
- ["8235F233",0xA384],
- ["8235F234",0xA385],
- ["8235F235",0xA386],
- ["8235F236",0xA387],
- ["8235F237",0xA388],
- ["8235F238",0xA389],
- ["8235F239",0xA38A],
- ["8235F330",0xA38B],
- ["8235F331",0xA38C],
- ["8235F332",0xA38D],
- ["8235F333",0xA38E],
- ["8235F334",0xA38F],
- ["8235F335",0xA390],
- ["8235F336",0xA391],
- ["8235F337",0xA392],
- ["8235F338",0xA393],
- ["8235F339",0xA394],
- ["8235F430",0xA395],
- ["8235F431",0xA396],
- ["8235F432",0xA397],
- ["8235F433",0xA398],
- ["8235F434",0xA399],
- ["8235F435",0xA39A],
- ["8235F436",0xA39B],
- ["8235F437",0xA39C],
- ["8235F438",0xA39D],
- ["8235F439",0xA39E],
- ["8235F530",0xA39F],
- ["8235F531",0xA3A0],
- ["8235F532",0xA3A1],
- ["8235F533",0xA3A2],
- ["8235F534",0xA3A3],
- ["8235F535",0xA3A4],
- ["8235F536",0xA3A5],
- ["8235F537",0xA3A6],
- ["8235F538",0xA3A7],
- ["8235F539",0xA3A8],
- ["8235F630",0xA3A9],
- ["8235F631",0xA3AA],
- ["8235F632",0xA3AB],
- ["8235F633",0xA3AC],
- ["8235F634",0xA3AD],
- ["8235F635",0xA3AE],
- ["8235F636",0xA3AF],
- ["8235F637",0xA3B0],
- ["8235F638",0xA3B1],
- ["8235F639",0xA3B2],
- ["8235F730",0xA3B3],
- ["8235F731",0xA3B4],
- ["8235F732",0xA3B5],
- ["8235F733",0xA3B6],
- ["8235F734",0xA3B7],
- ["8235F735",0xA3B8],
- ["8235F736",0xA3B9],
- ["8235F737",0xA3BA],
- ["8235F738",0xA3BB],
- ["8235F739",0xA3BC],
- ["8235F830",0xA3BD],
- ["8235F831",0xA3BE],
- ["8235F832",0xA3BF],
- ["8235F833",0xA3C0],
- ["8235F834",0xA3C1],
- ["8235F835",0xA3C2],
- ["8235F836",0xA3C3],
- ["8235F837",0xA3C4],
- ["8235F838",0xA3C5],
- ["8235F839",0xA3C6],
- ["8235F930",0xA3C7],
- ["8235F931",0xA3C8],
- ["8235F932",0xA3C9],
- ["8235F933",0xA3CA],
- ["8235F934",0xA3CB],
- ["8235F935",0xA3CC],
- ["8235F936",0xA3CD],
- ["8235F937",0xA3CE],
- ["8235F938",0xA3CF],
- ["8235F939",0xA3D0],
- ["8235FA30",0xA3D1],
- ["8235FA31",0xA3D2],
- ["8235FA32",0xA3D3],
- ["8235FA33",0xA3D4],
- ["8235FA34",0xA3D5],
- ["8235FA35",0xA3D6],
- ["8235FA36",0xA3D7],
- ["8235FA37",0xA3D8],
- ["8235FA38",0xA3D9],
- ["8235FA39",0xA3DA],
- ["8235FB30",0xA3DB],
- ["8235FB31",0xA3DC],
- ["8235FB32",0xA3DD],
- ["8235FB33",0xA3DE],
- ["8235FB34",0xA3DF],
- ["8235FB35",0xA3E0],
- ["8235FB36",0xA3E1],
- ["8235FB37",0xA3E2],
- ["8235FB38",0xA3E3],
- ["8235FB39",0xA3E4],
- ["8235FC30",0xA3E5],
- ["8235FC31",0xA3E6],
- ["8235FC32",0xA3E7],
- ["8235FC33",0xA3E8],
- ["8235FC34",0xA3E9],
- ["8235FC35",0xA3EA],
- ["8235FC36",0xA3EB],
- ["8235FC37",0xA3EC],
- ["8235FC38",0xA3ED],
- ["8235FC39",0xA3EE],
- ["8235FD30",0xA3EF],
- ["8235FD31",0xA3F0],
- ["8235FD32",0xA3F1],
- ["8235FD33",0xA3F2],
- ["8235FD34",0xA3F3],
- ["8235FD35",0xA3F4],
- ["8235FD36",0xA3F5],
- ["8235FD37",0xA3F6],
- ["8235FD38",0xA3F7],
- ["8235FD39",0xA3F8],
- ["8235FE30",0xA3F9],
- ["8235FE31",0xA3FA],
- ["8235FE32",0xA3FB],
- ["8235FE33",0xA3FC],
- ["8235FE34",0xA3FD],
- ["8235FE35",0xA3FE],
- ["8235FE36",0xA3FF],
- ["8235FE37",0xA400],
- ["8235FE38",0xA401],
- ["8235FE39",0xA402],
- ["82368130",0xA403],
- ["82368131",0xA404],
- ["82368132",0xA405],
- ["82368133",0xA406],
- ["82368134",0xA407],
- ["82368135",0xA408],
- ["82368136",0xA409],
- ["82368137",0xA40A],
- ["82368138",0xA40B],
- ["82368139",0xA40C],
- ["82368230",0xA40D],
- ["82368231",0xA40E],
- ["82368232",0xA40F],
- ["82368233",0xA410],
- ["82368234",0xA411],
- ["82368235",0xA412],
- ["82368236",0xA413],
- ["82368237",0xA414],
- ["82368238",0xA415],
- ["82368239",0xA416],
- ["82368330",0xA417],
- ["82368331",0xA418],
- ["82368332",0xA419],
- ["82368333",0xA41A],
- ["82368334",0xA41B],
- ["82368335",0xA41C],
- ["82368336",0xA41D],
- ["82368337",0xA41E],
- ["82368338",0xA41F],
- ["82368339",0xA420],
- ["82368430",0xA421],
- ["82368431",0xA422],
- ["82368432",0xA423],
- ["82368433",0xA424],
- ["82368434",0xA425],
- ["82368435",0xA426],
- ["82368436",0xA427],
- ["82368437",0xA428],
- ["82368438",0xA429],
- ["82368439",0xA42A],
- ["82368530",0xA42B],
- ["82368531",0xA42C],
- ["82368532",0xA42D],
- ["82368533",0xA42E],
- ["82368534",0xA42F],
- ["82368535",0xA430],
- ["82368536",0xA431],
- ["82368537",0xA432],
- ["82368538",0xA433],
- ["82368539",0xA434],
- ["82368630",0xA435],
- ["82368631",0xA436],
- ["82368632",0xA437],
- ["82368633",0xA438],
- ["82368634",0xA439],
- ["82368635",0xA43A],
- ["82368636",0xA43B],
- ["82368637",0xA43C],
- ["82368638",0xA43D],
- ["82368639",0xA43E],
- ["82368730",0xA43F],
- ["82368731",0xA440],
- ["82368732",0xA441],
- ["82368733",0xA442],
- ["82368734",0xA443],
- ["82368735",0xA444],
- ["82368736",0xA445],
- ["82368737",0xA446],
- ["82368738",0xA447],
- ["82368739",0xA448],
- ["82368830",0xA449],
- ["82368831",0xA44A],
- ["82368832",0xA44B],
- ["82368833",0xA44C],
- ["82368834",0xA44D],
- ["82368835",0xA44E],
- ["82368836",0xA44F],
- ["82368837",0xA450],
- ["82368838",0xA451],
- ["82368839",0xA452],
- ["82368930",0xA453],
- ["82368931",0xA454],
- ["82368932",0xA455],
- ["82368933",0xA456],
- ["82368934",0xA457],
- ["82368935",0xA458],
- ["82368936",0xA459],
- ["82368937",0xA45A],
- ["82368938",0xA45B],
- ["82368939",0xA45C],
- ["82368A30",0xA45D],
- ["82368A31",0xA45E],
- ["82368A32",0xA45F],
- ["82368A33",0xA460],
- ["82368A34",0xA461],
- ["82368A35",0xA462],
- ["82368A36",0xA463],
- ["82368A37",0xA464],
- ["82368A38",0xA465],
- ["82368A39",0xA466],
- ["82368B30",0xA467],
- ["82368B31",0xA468],
- ["82368B32",0xA469],
- ["82368B33",0xA46A],
- ["82368B34",0xA46B],
- ["82368B35",0xA46C],
- ["82368B36",0xA46D],
- ["82368B37",0xA46E],
- ["82368B38",0xA46F],
- ["82368B39",0xA470],
- ["82368C30",0xA471],
- ["82368C31",0xA472],
- ["82368C32",0xA473],
- ["82368C33",0xA474],
- ["82368C34",0xA475],
- ["82368C35",0xA476],
- ["82368C36",0xA477],
- ["82368C37",0xA478],
- ["82368C38",0xA479],
- ["82368C39",0xA47A],
- ["82368D30",0xA47B],
- ["82368D31",0xA47C],
- ["82368D32",0xA47D],
- ["82368D33",0xA47E],
- ["82368D34",0xA47F],
- ["82368D35",0xA480],
- ["82368D36",0xA481],
- ["82368D37",0xA482],
- ["82368D38",0xA483],
- ["82368D39",0xA484],
- ["82368E30",0xA485],
- ["82368E31",0xA486],
- ["82368E32",0xA487],
- ["82368E33",0xA488],
- ["82368E34",0xA489],
- ["82368E35",0xA48A],
- ["82368E36",0xA48B],
- ["82368E37",0xA48C],
- ["82368E38",0xA48D],
- ["82368E39",0xA48E],
- ["82368F30",0xA48F],
- ["82368F31",0xA490],
- ["82368F32",0xA491],
- ["82368F33",0xA492],
- ["82368F34",0xA493],
- ["82368F35",0xA494],
- ["82368F36",0xA495],
- ["82368F37",0xA496],
- ["82368F38",0xA497],
- ["82368F39",0xA498],
- ["82369030",0xA499],
- ["82369031",0xA49A],
- ["82369032",0xA49B],
- ["82369033",0xA49C],
- ["82369034",0xA49D],
- ["82369035",0xA49E],
- ["82369036",0xA49F],
- ["82369037",0xA4A0],
- ["82369038",0xA4A1],
- ["82369039",0xA4A2],
- ["82369130",0xA4A3],
- ["82369131",0xA4A4],
- ["82369132",0xA4A5],
- ["82369133",0xA4A6],
- ["82369134",0xA4A7],
- ["82369135",0xA4A8],
- ["82369136",0xA4A9],
- ["82369137",0xA4AA],
- ["82369138",0xA4AB],
- ["82369139",0xA4AC],
- ["82369230",0xA4AD],
- ["82369231",0xA4AE],
- ["82369232",0xA4AF],
- ["82369233",0xA4B0],
- ["82369234",0xA4B1],
- ["82369235",0xA4B2],
- ["82369236",0xA4B3],
- ["82369237",0xA4B4],
- ["82369238",0xA4B5],
- ["82369239",0xA4B6],
- ["82369330",0xA4B7],
- ["82369331",0xA4B8],
- ["82369332",0xA4B9],
- ["82369333",0xA4BA],
- ["82369334",0xA4BB],
- ["82369335",0xA4BC],
- ["82369336",0xA4BD],
- ["82369337",0xA4BE],
- ["82369338",0xA4BF],
- ["82369339",0xA4C0],
- ["82369430",0xA4C1],
- ["82369431",0xA4C2],
- ["82369432",0xA4C3],
- ["82369433",0xA4C4],
- ["82369434",0xA4C5],
- ["82369435",0xA4C6],
- ["82369436",0xA4C7],
- ["82369437",0xA4C8],
- ["82369438",0xA4C9],
- ["82369439",0xA4CA],
- ["82369530",0xA4CB],
- ["82369531",0xA4CC],
- ["82369532",0xA4CD],
- ["82369533",0xA4CE],
- ["82369534",0xA4CF],
- ["82369535",0xA4D0],
- ["82369536",0xA4D1],
- ["82369537",0xA4D2],
- ["82369538",0xA4D3],
- ["82369539",0xA4D4],
- ["82369630",0xA4D5],
- ["82369631",0xA4D6],
- ["82369632",0xA4D7],
- ["82369633",0xA4D8],
- ["82369634",0xA4D9],
- ["82369635",0xA4DA],
- ["82369636",0xA4DB],
- ["82369637",0xA4DC],
- ["82369638",0xA4DD],
- ["82369639",0xA4DE],
- ["82369730",0xA4DF],
- ["82369731",0xA4E0],
- ["82369732",0xA4E1],
- ["82369733",0xA4E2],
- ["82369734",0xA4E3],
- ["82369735",0xA4E4],
- ["82369736",0xA4E5],
- ["82369737",0xA4E6],
- ["82369738",0xA4E7],
- ["82369739",0xA4E8],
- ["82369830",0xA4E9],
- ["82369831",0xA4EA],
- ["82369832",0xA4EB],
- ["82369833",0xA4EC],
- ["82369834",0xA4ED],
- ["82369835",0xA4EE],
- ["82369836",0xA4EF],
- ["82369837",0xA4F0],
- ["82369838",0xA4F1],
- ["82369839",0xA4F2],
- ["82369930",0xA4F3],
- ["82369931",0xA4F4],
- ["82369932",0xA4F5],
- ["82369933",0xA4F6],
- ["82369934",0xA4F7],
- ["82369935",0xA4F8],
- ["82369936",0xA4F9],
- ["82369937",0xA4FA],
- ["82369938",0xA4FB],
- ["82369939",0xA4FC],
- ["82369A30",0xA4FD],
- ["82369A31",0xA4FE],
- ["82369A32",0xA4FF],
- ["82369A33",0xA500],
- ["82369A34",0xA501],
- ["82369A35",0xA502],
- ["82369A36",0xA503],
- ["82369A37",0xA504],
- ["82369A38",0xA505],
- ["82369A39",0xA506],
- ["82369B30",0xA507],
- ["82369B31",0xA508],
- ["82369B32",0xA509],
- ["82369B33",0xA50A],
- ["82369B34",0xA50B],
- ["82369B35",0xA50C],
- ["82369B36",0xA50D],
- ["82369B37",0xA50E],
- ["82369B38",0xA50F],
- ["82369B39",0xA510],
- ["82369C30",0xA511],
- ["82369C31",0xA512],
- ["82369C32",0xA513],
- ["82369C33",0xA514],
- ["82369C34",0xA515],
- ["82369C35",0xA516],
- ["82369C36",0xA517],
- ["82369C37",0xA518],
- ["82369C38",0xA519],
- ["82369C39",0xA51A],
- ["82369D30",0xA51B],
- ["82369D31",0xA51C],
- ["82369D32",0xA51D],
- ["82369D33",0xA51E],
- ["82369D34",0xA51F],
- ["82369D35",0xA520],
- ["82369D36",0xA521],
- ["82369D37",0xA522],
- ["82369D38",0xA523],
- ["82369D39",0xA524],
- ["82369E30",0xA525],
- ["82369E31",0xA526],
- ["82369E32",0xA527],
- ["82369E33",0xA528],
- ["82369E34",0xA529],
- ["82369E35",0xA52A],
- ["82369E36",0xA52B],
- ["82369E37",0xA52C],
- ["82369E38",0xA52D],
- ["82369E39",0xA52E],
- ["82369F30",0xA52F],
- ["82369F31",0xA530],
- ["82369F32",0xA531],
- ["82369F33",0xA532],
- ["82369F34",0xA533],
- ["82369F35",0xA534],
- ["82369F36",0xA535],
- ["82369F37",0xA536],
- ["82369F38",0xA537],
- ["82369F39",0xA538],
- ["8236A030",0xA539],
- ["8236A031",0xA53A],
- ["8236A032",0xA53B],
- ["8236A033",0xA53C],
- ["8236A034",0xA53D],
- ["8236A035",0xA53E],
- ["8236A036",0xA53F],
- ["8236A037",0xA540],
- ["8236A038",0xA541],
- ["8236A039",0xA542],
- ["8236A130",0xA543],
- ["8236A131",0xA544],
- ["8236A132",0xA545],
- ["8236A133",0xA546],
- ["8236A134",0xA547],
- ["8236A135",0xA548],
- ["8236A136",0xA549],
- ["8236A137",0xA54A],
- ["8236A138",0xA54B],
- ["8236A139",0xA54C],
- ["8236A230",0xA54D],
- ["8236A231",0xA54E],
- ["8236A232",0xA54F],
- ["8236A233",0xA550],
- ["8236A234",0xA551],
- ["8236A235",0xA552],
- ["8236A236",0xA553],
- ["8236A237",0xA554],
- ["8236A238",0xA555],
- ["8236A239",0xA556],
- ["8236A330",0xA557],
- ["8236A331",0xA558],
- ["8236A332",0xA559],
- ["8236A333",0xA55A],
- ["8236A334",0xA55B],
- ["8236A335",0xA55C],
- ["8236A336",0xA55D],
- ["8236A337",0xA55E],
- ["8236A338",0xA55F],
- ["8236A339",0xA560],
- ["8236A430",0xA561],
- ["8236A431",0xA562],
- ["8236A432",0xA563],
- ["8236A433",0xA564],
- ["8236A434",0xA565],
- ["8236A435",0xA566],
- ["8236A436",0xA567],
- ["8236A437",0xA568],
- ["8236A438",0xA569],
- ["8236A439",0xA56A],
- ["8236A530",0xA56B],
- ["8236A531",0xA56C],
- ["8236A532",0xA56D],
- ["8236A533",0xA56E],
- ["8236A534",0xA56F],
- ["8236A535",0xA570],
- ["8236A536",0xA571],
- ["8236A537",0xA572],
- ["8236A538",0xA573],
- ["8236A539",0xA574],
- ["8236A630",0xA575],
- ["8236A631",0xA576],
- ["8236A632",0xA577],
- ["8236A633",0xA578],
- ["8236A634",0xA579],
- ["8236A635",0xA57A],
- ["8236A636",0xA57B],
- ["8236A637",0xA57C],
- ["8236A638",0xA57D],
- ["8236A639",0xA57E],
- ["8236A730",0xA57F],
- ["8236A731",0xA580],
- ["8236A732",0xA581],
- ["8236A733",0xA582],
- ["8236A734",0xA583],
- ["8236A735",0xA584],
- ["8236A736",0xA585],
- ["8236A737",0xA586],
- ["8236A738",0xA587],
- ["8236A739",0xA588],
- ["8236A830",0xA589],
- ["8236A831",0xA58A],
- ["8236A832",0xA58B],
- ["8236A833",0xA58C],
- ["8236A834",0xA58D],
- ["8236A835",0xA58E],
- ["8236A836",0xA58F],
- ["8236A837",0xA590],
- ["8236A838",0xA591],
- ["8236A839",0xA592],
- ["8236A930",0xA593],
- ["8236A931",0xA594],
- ["8236A932",0xA595],
- ["8236A933",0xA596],
- ["8236A934",0xA597],
- ["8236A935",0xA598],
- ["8236A936",0xA599],
- ["8236A937",0xA59A],
- ["8236A938",0xA59B],
- ["8236A939",0xA59C],
- ["8236AA30",0xA59D],
- ["8236AA31",0xA59E],
- ["8236AA32",0xA59F],
- ["8236AA33",0xA5A0],
- ["8236AA34",0xA5A1],
- ["8236AA35",0xA5A2],
- ["8236AA36",0xA5A3],
- ["8236AA37",0xA5A4],
- ["8236AA38",0xA5A5],
- ["8236AA39",0xA5A6],
- ["8236AB30",0xA5A7],
- ["8236AB31",0xA5A8],
- ["8236AB32",0xA5A9],
- ["8236AB33",0xA5AA],
- ["8236AB34",0xA5AB],
- ["8236AB35",0xA5AC],
- ["8236AB36",0xA5AD],
- ["8236AB37",0xA5AE],
- ["8236AB38",0xA5AF],
- ["8236AB39",0xA5B0],
- ["8236AC30",0xA5B1],
- ["8236AC31",0xA5B2],
- ["8236AC32",0xA5B3],
- ["8236AC33",0xA5B4],
- ["8236AC34",0xA5B5],
- ["8236AC35",0xA5B6],
- ["8236AC36",0xA5B7],
- ["8236AC37",0xA5B8],
- ["8236AC38",0xA5B9],
- ["8236AC39",0xA5BA],
- ["8236AD30",0xA5BB],
- ["8236AD31",0xA5BC],
- ["8236AD32",0xA5BD],
- ["8236AD33",0xA5BE],
- ["8236AD34",0xA5BF],
- ["8236AD35",0xA5C0],
- ["8236AD36",0xA5C1],
- ["8236AD37",0xA5C2],
- ["8236AD38",0xA5C3],
- ["8236AD39",0xA5C4],
- ["8236AE30",0xA5C5],
- ["8236AE31",0xA5C6],
- ["8236AE32",0xA5C7],
- ["8236AE33",0xA5C8],
- ["8236AE34",0xA5C9],
- ["8236AE35",0xA5CA],
- ["8236AE36",0xA5CB],
- ["8236AE37",0xA5CC],
- ["8236AE38",0xA5CD],
- ["8236AE39",0xA5CE],
- ["8236AF30",0xA5CF],
- ["8236AF31",0xA5D0],
- ["8236AF32",0xA5D1],
- ["8236AF33",0xA5D2],
- ["8236AF34",0xA5D3],
- ["8236AF35",0xA5D4],
- ["8236AF36",0xA5D5],
- ["8236AF37",0xA5D6],
- ["8236AF38",0xA5D7],
- ["8236AF39",0xA5D8],
- ["8236B030",0xA5D9],
- ["8236B031",0xA5DA],
- ["8236B032",0xA5DB],
- ["8236B033",0xA5DC],
- ["8236B034",0xA5DD],
- ["8236B035",0xA5DE],
- ["8236B036",0xA5DF],
- ["8236B037",0xA5E0],
- ["8236B038",0xA5E1],
- ["8236B039",0xA5E2],
- ["8236B130",0xA5E3],
- ["8236B131",0xA5E4],
- ["8236B132",0xA5E5],
- ["8236B133",0xA5E6],
- ["8236B134",0xA5E7],
- ["8236B135",0xA5E8],
- ["8236B136",0xA5E9],
- ["8236B137",0xA5EA],
- ["8236B138",0xA5EB],
- ["8236B139",0xA5EC],
- ["8236B230",0xA5ED],
- ["8236B231",0xA5EE],
- ["8236B232",0xA5EF],
- ["8236B233",0xA5F0],
- ["8236B234",0xA5F1],
- ["8236B235",0xA5F2],
- ["8236B236",0xA5F3],
- ["8236B237",0xA5F4],
- ["8236B238",0xA5F5],
- ["8236B239",0xA5F6],
- ["8236B330",0xA5F7],
- ["8236B331",0xA5F8],
- ["8236B332",0xA5F9],
- ["8236B333",0xA5FA],
- ["8236B334",0xA5FB],
- ["8236B335",0xA5FC],
- ["8236B336",0xA5FD],
- ["8236B337",0xA5FE],
- ["8236B338",0xA5FF],
- ["8236B339",0xA600],
- ["8236B430",0xA601],
- ["8236B431",0xA602],
- ["8236B432",0xA603],
- ["8236B433",0xA604],
- ["8236B434",0xA605],
- ["8236B435",0xA606],
- ["8236B436",0xA607],
- ["8236B437",0xA608],
- ["8236B438",0xA609],
- ["8236B439",0xA60A],
- ["8236B530",0xA60B],
- ["8236B531",0xA60C],
- ["8236B532",0xA60D],
- ["8236B533",0xA60E],
- ["8236B534",0xA60F],
- ["8236B535",0xA610],
- ["8236B536",0xA611],
- ["8236B537",0xA612],
- ["8236B538",0xA613],
- ["8236B539",0xA614],
- ["8236B630",0xA615],
- ["8236B631",0xA616],
- ["8236B632",0xA617],
- ["8236B633",0xA618],
- ["8236B634",0xA619],
- ["8236B635",0xA61A],
- ["8236B636",0xA61B],
- ["8236B637",0xA61C],
- ["8236B638",0xA61D],
- ["8236B639",0xA61E],
- ["8236B730",0xA61F],
- ["8236B731",0xA620],
- ["8236B732",0xA621],
- ["8236B733",0xA622],
- ["8236B734",0xA623],
- ["8236B735",0xA624],
- ["8236B736",0xA625],
- ["8236B737",0xA626],
- ["8236B738",0xA627],
- ["8236B739",0xA628],
- ["8236B830",0xA629],
- ["8236B831",0xA62A],
- ["8236B832",0xA62B],
- ["8236B833",0xA62C],
- ["8236B834",0xA62D],
- ["8236B835",0xA62E],
- ["8236B836",0xA62F],
- ["8236B837",0xA630],
- ["8236B838",0xA631],
- ["8236B839",0xA632],
- ["8236B930",0xA633],
- ["8236B931",0xA634],
- ["8236B932",0xA635],
- ["8236B933",0xA636],
- ["8236B934",0xA637],
- ["8236B935",0xA638],
- ["8236B936",0xA639],
- ["8236B937",0xA63A],
- ["8236B938",0xA63B],
- ["8236B939",0xA63C],
- ["8236BA30",0xA63D],
- ["8236BA31",0xA63E],
- ["8236BA32",0xA63F],
- ["8236BA33",0xA640],
- ["8236BA34",0xA641],
- ["8236BA35",0xA642],
- ["8236BA36",0xA643],
- ["8236BA37",0xA644],
- ["8236BA38",0xA645],
- ["8236BA39",0xA646],
- ["8236BB30",0xA647],
- ["8236BB31",0xA648],
- ["8236BB32",0xA649],
- ["8236BB33",0xA64A],
- ["8236BB34",0xA64B],
- ["8236BB35",0xA64C],
- ["8236BB36",0xA64D],
- ["8236BB37",0xA64E],
- ["8236BB38",0xA64F],
- ["8236BB39",0xA650],
- ["8236BC30",0xA651],
- ["8236BC31",0xA652],
- ["8236BC32",0xA653],
- ["8236BC33",0xA654],
- ["8236BC34",0xA655],
- ["8236BC35",0xA656],
- ["8236BC36",0xA657],
- ["8236BC37",0xA658],
- ["8236BC38",0xA659],
- ["8236BC39",0xA65A],
- ["8236BD30",0xA65B],
- ["8236BD31",0xA65C],
- ["8236BD32",0xA65D],
- ["8236BD33",0xA65E],
- ["8236BD34",0xA65F],
- ["8236BD35",0xA660],
- ["8236BD36",0xA661],
- ["8236BD37",0xA662],
- ["8236BD38",0xA663],
- ["8236BD39",0xA664],
- ["8236BE30",0xA665],
- ["8236BE31",0xA666],
- ["8236BE32",0xA667],
- ["8236BE33",0xA668],
- ["8236BE34",0xA669],
- ["8236BE35",0xA66A],
- ["8236BE36",0xA66B],
- ["8236BE37",0xA66C],
- ["8236BE38",0xA66D],
- ["8236BE39",0xA66E],
- ["8236BF30",0xA66F],
- ["8236BF31",0xA670],
- ["8236BF32",0xA671],
- ["8236BF33",0xA672],
- ["8236BF34",0xA673],
- ["8236BF35",0xA674],
- ["8236BF36",0xA675],
- ["8236BF37",0xA676],
- ["8236BF38",0xA677],
- ["8236BF39",0xA678],
- ["8236C030",0xA679],
- ["8236C031",0xA67A],
- ["8236C032",0xA67B],
- ["8236C033",0xA67C],
- ["8236C034",0xA67D],
- ["8236C035",0xA67E],
- ["8236C036",0xA67F],
- ["8236C037",0xA680],
- ["8236C038",0xA681],
- ["8236C039",0xA682],
- ["8236C130",0xA683],
- ["8236C131",0xA684],
- ["8236C132",0xA685],
- ["8236C133",0xA686],
- ["8236C134",0xA687],
- ["8236C135",0xA688],
- ["8236C136",0xA689],
- ["8236C137",0xA68A],
- ["8236C138",0xA68B],
- ["8236C139",0xA68C],
- ["8236C230",0xA68D],
- ["8236C231",0xA68E],
- ["8236C232",0xA68F],
- ["8236C233",0xA690],
- ["8236C234",0xA691],
- ["8236C235",0xA692],
- ["8236C236",0xA693],
- ["8236C237",0xA694],
- ["8236C238",0xA695],
- ["8236C239",0xA696],
- ["8236C330",0xA697],
- ["8236C331",0xA698],
- ["8236C332",0xA699],
- ["8236C333",0xA69A],
- ["8236C334",0xA69B],
- ["8236C335",0xA69C],
- ["8236C336",0xA69D],
- ["8236C337",0xA69E],
- ["8236C338",0xA69F],
- ["8236C339",0xA6A0],
- ["8236C430",0xA6A1],
- ["8236C431",0xA6A2],
- ["8236C432",0xA6A3],
- ["8236C433",0xA6A4],
- ["8236C434",0xA6A5],
- ["8236C435",0xA6A6],
- ["8236C436",0xA6A7],
- ["8236C437",0xA6A8],
- ["8236C438",0xA6A9],
- ["8236C439",0xA6AA],
- ["8236C530",0xA6AB],
- ["8236C531",0xA6AC],
- ["8236C532",0xA6AD],
- ["8236C533",0xA6AE],
- ["8236C534",0xA6AF],
- ["8236C535",0xA6B0],
- ["8236C536",0xA6B1],
- ["8236C537",0xA6B2],
- ["8236C538",0xA6B3],
- ["8236C539",0xA6B4],
- ["8236C630",0xA6B5],
- ["8236C631",0xA6B6],
- ["8236C632",0xA6B7],
- ["8236C633",0xA6B8],
- ["8236C634",0xA6B9],
- ["8236C635",0xA6BA],
- ["8236C636",0xA6BB],
- ["8236C637",0xA6BC],
- ["8236C638",0xA6BD],
- ["8236C639",0xA6BE],
- ["8236C730",0xA6BF],
- ["8236C731",0xA6C0],
- ["8236C732",0xA6C1],
- ["8236C733",0xA6C2],
- ["8236C734",0xA6C3],
- ["8236C735",0xA6C4],
- ["8236C736",0xA6C5],
- ["8236C737",0xA6C6],
- ["8236C738",0xA6C7],
- ["8236C739",0xA6C8],
- ["8236C830",0xA6C9],
- ["8236C831",0xA6CA],
- ["8236C832",0xA6CB],
- ["8236C833",0xA6CC],
- ["8236C834",0xA6CD],
- ["8236C835",0xA6CE],
- ["8236C836",0xA6CF],
- ["8236C837",0xA6D0],
- ["8236C838",0xA6D1],
- ["8236C839",0xA6D2],
- ["8236C930",0xA6D3],
- ["8236C931",0xA6D4],
- ["8236C932",0xA6D5],
- ["8236C933",0xA6D6],
- ["8236C934",0xA6D7],
- ["8236C935",0xA6D8],
- ["8236C936",0xA6D9],
- ["8236C937",0xA6DA],
- ["8236C938",0xA6DB],
- ["8236C939",0xA6DC],
- ["8236CA30",0xA6DD],
- ["8236CA31",0xA6DE],
- ["8236CA32",0xA6DF],
- ["8236CA33",0xA6E0],
- ["8236CA34",0xA6E1],
- ["8236CA35",0xA6E2],
- ["8236CA36",0xA6E3],
- ["8236CA37",0xA6E4],
- ["8236CA38",0xA6E5],
- ["8236CA39",0xA6E6],
- ["8236CB30",0xA6E7],
- ["8236CB31",0xA6E8],
- ["8236CB32",0xA6E9],
- ["8236CB33",0xA6EA],
- ["8236CB34",0xA6EB],
- ["8236CB35",0xA6EC],
- ["8236CB36",0xA6ED],
- ["8236CB37",0xA6EE],
- ["8236CB38",0xA6EF],
- ["8236CB39",0xA6F0],
- ["8236CC30",0xA6F1],
- ["8236CC31",0xA6F2],
- ["8236CC32",0xA6F3],
- ["8236CC33",0xA6F4],
- ["8236CC34",0xA6F5],
- ["8236CC35",0xA6F6],
- ["8236CC36",0xA6F7],
- ["8236CC37",0xA6F8],
- ["8236CC38",0xA6F9],
- ["8236CC39",0xA6FA],
- ["8236CD30",0xA6FB],
- ["8236CD31",0xA6FC],
- ["8236CD32",0xA6FD],
- ["8236CD33",0xA6FE],
- ["8236CD34",0xA6FF],
- ["8236CD35",0xA700],
- ["8236CD36",0xA701],
- ["8236CD37",0xA702],
- ["8236CD38",0xA703],
- ["8236CD39",0xA704],
- ["8236CE30",0xA705],
- ["8236CE31",0xA706],
- ["8236CE32",0xA707],
- ["8236CE33",0xA708],
- ["8236CE34",0xA709],
- ["8236CE35",0xA70A],
- ["8236CE36",0xA70B],
- ["8236CE37",0xA70C],
- ["8236CE38",0xA70D],
- ["8236CE39",0xA70E],
- ["8236CF30",0xA70F],
- ["8236CF31",0xA710],
- ["8236CF32",0xA711],
- ["8236CF33",0xA712],
- ["8236CF34",0xA713],
- ["8236CF35",0xA714],
- ["8236CF36",0xA715],
- ["8236CF37",0xA716],
- ["8236CF38",0xA717],
- ["8236CF39",0xA718],
- ["8236D030",0xA719],
- ["8236D031",0xA71A],
- ["8236D032",0xA71B],
- ["8236D033",0xA71C],
- ["8236D034",0xA71D],
- ["8236D035",0xA71E],
- ["8236D036",0xA71F],
- ["8236D037",0xA720],
- ["8236D038",0xA721],
- ["8236D039",0xA722],
- ["8236D130",0xA723],
- ["8236D131",0xA724],
- ["8236D132",0xA725],
- ["8236D133",0xA726],
- ["8236D134",0xA727],
- ["8236D135",0xA728],
- ["8236D136",0xA729],
- ["8236D137",0xA72A],
- ["8236D138",0xA72B],
- ["8236D139",0xA72C],
- ["8236D230",0xA72D],
- ["8236D231",0xA72E],
- ["8236D232",0xA72F],
- ["8236D233",0xA730],
- ["8236D234",0xA731],
- ["8236D235",0xA732],
- ["8236D236",0xA733],
- ["8236D237",0xA734],
- ["8236D238",0xA735],
- ["8236D239",0xA736],
- ["8236D330",0xA737],
- ["8236D331",0xA738],
- ["8236D332",0xA739],
- ["8236D333",0xA73A],
- ["8236D334",0xA73B],
- ["8236D335",0xA73C],
- ["8236D336",0xA73D],
- ["8236D337",0xA73E],
- ["8236D338",0xA73F],
- ["8236D339",0xA740],
- ["8236D430",0xA741],
- ["8236D431",0xA742],
- ["8236D432",0xA743],
- ["8236D433",0xA744],
- ["8236D434",0xA745],
- ["8236D435",0xA746],
- ["8236D436",0xA747],
- ["8236D437",0xA748],
- ["8236D438",0xA749],
- ["8236D439",0xA74A],
- ["8236D530",0xA74B],
- ["8236D531",0xA74C],
- ["8236D532",0xA74D],
- ["8236D533",0xA74E],
- ["8236D534",0xA74F],
- ["8236D535",0xA750],
- ["8236D536",0xA751],
- ["8236D537",0xA752],
- ["8236D538",0xA753],
- ["8236D539",0xA754],
- ["8236D630",0xA755],
- ["8236D631",0xA756],
- ["8236D632",0xA757],
- ["8236D633",0xA758],
- ["8236D634",0xA759],
- ["8236D635",0xA75A],
- ["8236D636",0xA75B],
- ["8236D637",0xA75C],
- ["8236D638",0xA75D],
- ["8236D639",0xA75E],
- ["8236D730",0xA75F],
- ["8236D731",0xA760],
- ["8236D732",0xA761],
- ["8236D733",0xA762],
- ["8236D734",0xA763],
- ["8236D735",0xA764],
- ["8236D736",0xA765],
- ["8236D737",0xA766],
- ["8236D738",0xA767],
- ["8236D739",0xA768],
- ["8236D830",0xA769],
- ["8236D831",0xA76A],
- ["8236D832",0xA76B],
- ["8236D833",0xA76C],
- ["8236D834",0xA76D],
- ["8236D835",0xA76E],
- ["8236D836",0xA76F],
- ["8236D837",0xA770],
- ["8236D838",0xA771],
- ["8236D839",0xA772],
- ["8236D930",0xA773],
- ["8236D931",0xA774],
- ["8236D932",0xA775],
- ["8236D933",0xA776],
- ["8236D934",0xA777],
- ["8236D935",0xA778],
- ["8236D936",0xA779],
- ["8236D937",0xA77A],
- ["8236D938",0xA77B],
- ["8236D939",0xA77C],
- ["8236DA30",0xA77D],
- ["8236DA31",0xA77E],
- ["8236DA32",0xA77F],
- ["8236DA33",0xA780],
- ["8236DA34",0xA781],
- ["8236DA35",0xA782],
- ["8236DA36",0xA783],
- ["8236DA37",0xA784],
- ["8236DA38",0xA785],
- ["8236DA39",0xA786],
- ["8236DB30",0xA787],
- ["8236DB31",0xA788],
- ["8236DB32",0xA789],
- ["8236DB33",0xA78A],
- ["8236DB34",0xA78B],
- ["8236DB35",0xA78C],
- ["8236DB36",0xA78D],
- ["8236DB37",0xA78E],
- ["8236DB38",0xA78F],
- ["8236DB39",0xA790],
- ["8236DC30",0xA791],
- ["8236DC31",0xA792],
- ["8236DC32",0xA793],
- ["8236DC33",0xA794],
- ["8236DC34",0xA795],
- ["8236DC35",0xA796],
- ["8236DC36",0xA797],
- ["8236DC37",0xA798],
- ["8236DC38",0xA799],
- ["8236DC39",0xA79A],
- ["8236DD30",0xA79B],
- ["8236DD31",0xA79C],
- ["8236DD32",0xA79D],
- ["8236DD33",0xA79E],
- ["8236DD34",0xA79F],
- ["8236DD35",0xA7A0],
- ["8236DD36",0xA7A1],
- ["8236DD37",0xA7A2],
- ["8236DD38",0xA7A3],
- ["8236DD39",0xA7A4],
- ["8236DE30",0xA7A5],
- ["8236DE31",0xA7A6],
- ["8236DE32",0xA7A7],
- ["8236DE33",0xA7A8],
- ["8236DE34",0xA7A9],
- ["8236DE35",0xA7AA],
- ["8236DE36",0xA7AB],
- ["8236DE37",0xA7AC],
- ["8236DE38",0xA7AD],
- ["8236DE39",0xA7AE],
- ["8236DF30",0xA7AF],
- ["8236DF31",0xA7B0],
- ["8236DF32",0xA7B1],
- ["8236DF33",0xA7B2],
- ["8236DF34",0xA7B3],
- ["8236DF35",0xA7B4],
- ["8236DF36",0xA7B5],
- ["8236DF37",0xA7B6],
- ["8236DF38",0xA7B7],
- ["8236DF39",0xA7B8],
- ["8236E030",0xA7B9],
- ["8236E031",0xA7BA],
- ["8236E032",0xA7BB],
- ["8236E033",0xA7BC],
- ["8236E034",0xA7BD],
- ["8236E035",0xA7BE],
- ["8236E036",0xA7BF],
- ["8236E037",0xA7C0],
- ["8236E038",0xA7C1],
- ["8236E039",0xA7C2],
- ["8236E130",0xA7C3],
- ["8236E131",0xA7C4],
- ["8236E132",0xA7C5],
- ["8236E133",0xA7C6],
- ["8236E134",0xA7C7],
- ["8236E135",0xA7C8],
- ["8236E136",0xA7C9],
- ["8236E137",0xA7CA],
- ["8236E138",0xA7CB],
- ["8236E139",0xA7CC],
- ["8236E230",0xA7CD],
- ["8236E231",0xA7CE],
- ["8236E232",0xA7CF],
- ["8236E233",0xA7D0],
- ["8236E234",0xA7D1],
- ["8236E235",0xA7D2],
- ["8236E236",0xA7D3],
- ["8236E237",0xA7D4],
- ["8236E238",0xA7D5],
- ["8236E239",0xA7D6],
- ["8236E330",0xA7D7],
- ["8236E331",0xA7D8],
- ["8236E332",0xA7D9],
- ["8236E333",0xA7DA],
- ["8236E334",0xA7DB],
- ["8236E335",0xA7DC],
- ["8236E336",0xA7DD],
- ["8236E337",0xA7DE],
- ["8236E338",0xA7DF],
- ["8236E339",0xA7E0],
- ["8236E430",0xA7E1],
- ["8236E431",0xA7E2],
- ["8236E432",0xA7E3],
- ["8236E433",0xA7E4],
- ["8236E434",0xA7E5],
- ["8236E435",0xA7E6],
- ["8236E436",0xA7E7],
- ["8236E437",0xA7E8],
- ["8236E438",0xA7E9],
- ["8236E439",0xA7EA],
- ["8236E530",0xA7EB],
- ["8236E531",0xA7EC],
- ["8236E532",0xA7ED],
- ["8236E533",0xA7EE],
- ["8236E534",0xA7EF],
- ["8236E535",0xA7F0],
- ["8236E536",0xA7F1],
- ["8236E537",0xA7F2],
- ["8236E538",0xA7F3],
- ["8236E539",0xA7F4],
- ["8236E630",0xA7F5],
- ["8236E631",0xA7F6],
- ["8236E632",0xA7F7],
- ["8236E633",0xA7F8],
- ["8236E634",0xA7F9],
- ["8236E635",0xA7FA],
- ["8236E636",0xA7FB],
- ["8236E637",0xA7FC],
- ["8236E638",0xA7FD],
- ["8236E639",0xA7FE],
- ["8236E730",0xA7FF],
- ["8236E731",0xA800],
- ["8236E732",0xA801],
- ["8236E733",0xA802],
- ["8236E734",0xA803],
- ["8236E735",0xA804],
- ["8236E736",0xA805],
- ["8236E737",0xA806],
- ["8236E738",0xA807],
- ["8236E739",0xA808],
- ["8236E830",0xA809],
- ["8236E831",0xA80A],
- ["8236E832",0xA80B],
- ["8236E833",0xA80C],
- ["8236E834",0xA80D],
- ["8236E835",0xA80E],
- ["8236E836",0xA80F],
- ["8236E837",0xA810],
- ["8236E838",0xA811],
- ["8236E839",0xA812],
- ["8236E930",0xA813],
- ["8236E931",0xA814],
- ["8236E932",0xA815],
- ["8236E933",0xA816],
- ["8236E934",0xA817],
- ["8236E935",0xA818],
- ["8236E936",0xA819],
- ["8236E937",0xA81A],
- ["8236E938",0xA81B],
- ["8236E939",0xA81C],
- ["8236EA30",0xA81D],
- ["8236EA31",0xA81E],
- ["8236EA32",0xA81F],
- ["8236EA33",0xA820],
- ["8236EA34",0xA821],
- ["8236EA35",0xA822],
- ["8236EA36",0xA823],
- ["8236EA37",0xA824],
- ["8236EA38",0xA825],
- ["8236EA39",0xA826],
- ["8236EB30",0xA827],
- ["8236EB31",0xA828],
- ["8236EB32",0xA829],
- ["8236EB33",0xA82A],
- ["8236EB34",0xA82B],
- ["8236EB35",0xA82C],
- ["8236EB36",0xA82D],
- ["8236EB37",0xA82E],
- ["8236EB38",0xA82F],
- ["8236EB39",0xA830],
- ["8236EC30",0xA831],
- ["8236EC31",0xA832],
- ["8236EC32",0xA833],
- ["8236EC33",0xA834],
- ["8236EC34",0xA835],
- ["8236EC35",0xA836],
- ["8236EC36",0xA837],
- ["8236EC37",0xA838],
- ["8236EC38",0xA839],
- ["8236EC39",0xA83A],
- ["8236ED30",0xA83B],
- ["8236ED31",0xA83C],
- ["8236ED32",0xA83D],
- ["8236ED33",0xA83E],
- ["8236ED34",0xA83F],
- ["8236ED35",0xA840],
- ["8236ED36",0xA841],
- ["8236ED37",0xA842],
- ["8236ED38",0xA843],
- ["8236ED39",0xA844],
- ["8236EE30",0xA845],
- ["8236EE31",0xA846],
- ["8236EE32",0xA847],
- ["8236EE33",0xA848],
- ["8236EE34",0xA849],
- ["8236EE35",0xA84A],
- ["8236EE36",0xA84B],
- ["8236EE37",0xA84C],
- ["8236EE38",0xA84D],
- ["8236EE39",0xA84E],
- ["8236EF30",0xA84F],
- ["8236EF31",0xA850],
- ["8236EF32",0xA851],
- ["8236EF33",0xA852],
- ["8236EF34",0xA853],
- ["8236EF35",0xA854],
- ["8236EF36",0xA855],
- ["8236EF37",0xA856],
- ["8236EF38",0xA857],
- ["8236EF39",0xA858],
- ["8236F030",0xA859],
- ["8236F031",0xA85A],
- ["8236F032",0xA85B],
- ["8236F033",0xA85C],
- ["8236F034",0xA85D],
- ["8236F035",0xA85E],
- ["8236F036",0xA85F],
- ["8236F037",0xA860],
- ["8236F038",0xA861],
- ["8236F039",0xA862],
- ["8236F130",0xA863],
- ["8236F131",0xA864],
- ["8236F132",0xA865],
- ["8236F133",0xA866],
- ["8236F134",0xA867],
- ["8236F135",0xA868],
- ["8236F136",0xA869],
- ["8236F137",0xA86A],
- ["8236F138",0xA86B],
- ["8236F139",0xA86C],
- ["8236F230",0xA86D],
- ["8236F231",0xA86E],
- ["8236F232",0xA86F],
- ["8236F233",0xA870],
- ["8236F234",0xA871],
- ["8236F235",0xA872],
- ["8236F236",0xA873],
- ["8236F237",0xA874],
- ["8236F238",0xA875],
- ["8236F239",0xA876],
- ["8236F330",0xA877],
- ["8236F331",0xA878],
- ["8236F332",0xA879],
- ["8236F333",0xA87A],
- ["8236F334",0xA87B],
- ["8236F335",0xA87C],
- ["8236F336",0xA87D],
- ["8236F337",0xA87E],
- ["8236F338",0xA87F],
- ["8236F339",0xA880],
- ["8236F430",0xA881],
- ["8236F431",0xA882],
- ["8236F432",0xA883],
- ["8236F433",0xA884],
- ["8236F434",0xA885],
- ["8236F435",0xA886],
- ["8236F436",0xA887],
- ["8236F437",0xA888],
- ["8236F438",0xA889],
- ["8236F439",0xA88A],
- ["8236F530",0xA88B],
- ["8236F531",0xA88C],
- ["8236F532",0xA88D],
- ["8236F533",0xA88E],
- ["8236F534",0xA88F],
- ["8236F535",0xA890],
- ["8236F536",0xA891],
- ["8236F537",0xA892],
- ["8236F538",0xA893],
- ["8236F539",0xA894],
- ["8236F630",0xA895],
- ["8236F631",0xA896],
- ["8236F632",0xA897],
- ["8236F633",0xA898],
- ["8236F634",0xA899],
- ["8236F635",0xA89A],
- ["8236F636",0xA89B],
- ["8236F637",0xA89C],
- ["8236F638",0xA89D],
- ["8236F639",0xA89E],
- ["8236F730",0xA89F],
- ["8236F731",0xA8A0],
- ["8236F732",0xA8A1],
- ["8236F733",0xA8A2],
- ["8236F734",0xA8A3],
- ["8236F735",0xA8A4],
- ["8236F736",0xA8A5],
- ["8236F737",0xA8A6],
- ["8236F738",0xA8A7],
- ["8236F739",0xA8A8],
- ["8236F830",0xA8A9],
- ["8236F831",0xA8AA],
- ["8236F832",0xA8AB],
- ["8236F833",0xA8AC],
- ["8236F834",0xA8AD],
- ["8236F835",0xA8AE],
- ["8236F836",0xA8AF],
- ["8236F837",0xA8B0],
- ["8236F838",0xA8B1],
- ["8236F839",0xA8B2],
- ["8236F930",0xA8B3],
- ["8236F931",0xA8B4],
- ["8236F932",0xA8B5],
- ["8236F933",0xA8B6],
- ["8236F934",0xA8B7],
- ["8236F935",0xA8B8],
- ["8236F936",0xA8B9],
- ["8236F937",0xA8BA],
- ["8236F938",0xA8BB],
- ["8236F939",0xA8BC],
- ["8236FA30",0xA8BD],
- ["8236FA31",0xA8BE],
- ["8236FA32",0xA8BF],
- ["8236FA33",0xA8C0],
- ["8236FA34",0xA8C1],
- ["8236FA35",0xA8C2],
- ["8236FA36",0xA8C3],
- ["8236FA37",0xA8C4],
- ["8236FA38",0xA8C5],
- ["8236FA39",0xA8C6],
- ["8236FB30",0xA8C7],
- ["8236FB31",0xA8C8],
- ["8236FB32",0xA8C9],
- ["8236FB33",0xA8CA],
- ["8236FB34",0xA8CB],
- ["8236FB35",0xA8CC],
- ["8236FB36",0xA8CD],
- ["8236FB37",0xA8CE],
- ["8236FB38",0xA8CF],
- ["8236FB39",0xA8D0],
- ["8236FC30",0xA8D1],
- ["8236FC31",0xA8D2],
- ["8236FC32",0xA8D3],
- ["8236FC33",0xA8D4],
- ["8236FC34",0xA8D5],
- ["8236FC35",0xA8D6],
- ["8236FC36",0xA8D7],
- ["8236FC37",0xA8D8],
- ["8236FC38",0xA8D9],
- ["8236FC39",0xA8DA],
- ["8236FD30",0xA8DB],
- ["8236FD31",0xA8DC],
- ["8236FD32",0xA8DD],
- ["8236FD33",0xA8DE],
- ["8236FD34",0xA8DF],
- ["8236FD35",0xA8E0],
- ["8236FD36",0xA8E1],
- ["8236FD37",0xA8E2],
- ["8236FD38",0xA8E3],
- ["8236FD39",0xA8E4],
- ["8236FE30",0xA8E5],
- ["8236FE31",0xA8E6],
- ["8236FE32",0xA8E7],
- ["8236FE33",0xA8E8],
- ["8236FE34",0xA8E9],
- ["8236FE35",0xA8EA],
- ["8236FE36",0xA8EB],
- ["8236FE37",0xA8EC],
- ["8236FE38",0xA8ED],
- ["8236FE39",0xA8EE],
- ["82378130",0xA8EF],
- ["82378131",0xA8F0],
- ["82378132",0xA8F1],
- ["82378133",0xA8F2],
- ["82378134",0xA8F3],
- ["82378135",0xA8F4],
- ["82378136",0xA8F5],
- ["82378137",0xA8F6],
- ["82378138",0xA8F7],
- ["82378139",0xA8F8],
- ["82378230",0xA8F9],
- ["82378231",0xA8FA],
- ["82378232",0xA8FB],
- ["82378233",0xA8FC],
- ["82378234",0xA8FD],
- ["82378235",0xA8FE],
- ["82378236",0xA8FF],
- ["82378237",0xA900],
- ["82378238",0xA901],
- ["82378239",0xA902],
- ["82378330",0xA903],
- ["82378331",0xA904],
- ["82378332",0xA905],
- ["82378333",0xA906],
- ["82378334",0xA907],
- ["82378335",0xA908],
- ["82378336",0xA909],
- ["82378337",0xA90A],
- ["82378338",0xA90B],
- ["82378339",0xA90C],
- ["82378430",0xA90D],
- ["82378431",0xA90E],
- ["82378432",0xA90F],
- ["82378433",0xA910],
- ["82378434",0xA911],
- ["82378435",0xA912],
- ["82378436",0xA913],
- ["82378437",0xA914],
- ["82378438",0xA915],
- ["82378439",0xA916],
- ["82378530",0xA917],
- ["82378531",0xA918],
- ["82378532",0xA919],
- ["82378533",0xA91A],
- ["82378534",0xA91B],
- ["82378535",0xA91C],
- ["82378536",0xA91D],
- ["82378537",0xA91E],
- ["82378538",0xA91F],
- ["82378539",0xA920],
- ["82378630",0xA921],
- ["82378631",0xA922],
- ["82378632",0xA923],
- ["82378633",0xA924],
- ["82378634",0xA925],
- ["82378635",0xA926],
- ["82378636",0xA927],
- ["82378637",0xA928],
- ["82378638",0xA929],
- ["82378639",0xA92A],
- ["82378730",0xA92B],
- ["82378731",0xA92C],
- ["82378732",0xA92D],
- ["82378733",0xA92E],
- ["82378734",0xA92F],
- ["82378735",0xA930],
- ["82378736",0xA931],
- ["82378737",0xA932],
- ["82378738",0xA933],
- ["82378739",0xA934],
- ["82378830",0xA935],
- ["82378831",0xA936],
- ["82378832",0xA937],
- ["82378833",0xA938],
- ["82378834",0xA939],
- ["82378835",0xA93A],
- ["82378836",0xA93B],
- ["82378837",0xA93C],
- ["82378838",0xA93D],
- ["82378839",0xA93E],
- ["82378930",0xA93F],
- ["82378931",0xA940],
- ["82378932",0xA941],
- ["82378933",0xA942],
- ["82378934",0xA943],
- ["82378935",0xA944],
- ["82378936",0xA945],
- ["82378937",0xA946],
- ["82378938",0xA947],
- ["82378939",0xA948],
- ["82378A30",0xA949],
- ["82378A31",0xA94A],
- ["82378A32",0xA94B],
- ["82378A33",0xA94C],
- ["82378A34",0xA94D],
- ["82378A35",0xA94E],
- ["82378A36",0xA94F],
- ["82378A37",0xA950],
- ["82378A38",0xA951],
- ["82378A39",0xA952],
- ["82378B30",0xA953],
- ["82378B31",0xA954],
- ["82378B32",0xA955],
- ["82378B33",0xA956],
- ["82378B34",0xA957],
- ["82378B35",0xA958],
- ["82378B36",0xA959],
- ["82378B37",0xA95A],
- ["82378B38",0xA95B],
- ["82378B39",0xA95C],
- ["82378C30",0xA95D],
- ["82378C31",0xA95E],
- ["82378C32",0xA95F],
- ["82378C33",0xA960],
- ["82378C34",0xA961],
- ["82378C35",0xA962],
- ["82378C36",0xA963],
- ["82378C37",0xA964],
- ["82378C38",0xA965],
- ["82378C39",0xA966],
- ["82378D30",0xA967],
- ["82378D31",0xA968],
- ["82378D32",0xA969],
- ["82378D33",0xA96A],
- ["82378D34",0xA96B],
- ["82378D35",0xA96C],
- ["82378D36",0xA96D],
- ["82378D37",0xA96E],
- ["82378D38",0xA96F],
- ["82378D39",0xA970],
- ["82378E30",0xA971],
- ["82378E31",0xA972],
- ["82378E32",0xA973],
- ["82378E33",0xA974],
- ["82378E34",0xA975],
- ["82378E35",0xA976],
- ["82378E36",0xA977],
- ["82378E37",0xA978],
- ["82378E38",0xA979],
- ["82378E39",0xA97A],
- ["82378F30",0xA97B],
- ["82378F31",0xA97C],
- ["82378F32",0xA97D],
- ["82378F33",0xA97E],
- ["82378F34",0xA97F],
- ["82378F35",0xA980],
- ["82378F36",0xA981],
- ["82378F37",0xA982],
- ["82378F38",0xA983],
- ["82378F39",0xA984],
- ["82379030",0xA985],
- ["82379031",0xA986],
- ["82379032",0xA987],
- ["82379033",0xA988],
- ["82379034",0xA989],
- ["82379035",0xA98A],
- ["82379036",0xA98B],
- ["82379037",0xA98C],
- ["82379038",0xA98D],
- ["82379039",0xA98E],
- ["82379130",0xA98F],
- ["82379131",0xA990],
- ["82379132",0xA991],
- ["82379133",0xA992],
- ["82379134",0xA993],
- ["82379135",0xA994],
- ["82379136",0xA995],
- ["82379137",0xA996],
- ["82379138",0xA997],
- ["82379139",0xA998],
- ["82379230",0xA999],
- ["82379231",0xA99A],
- ["82379232",0xA99B],
- ["82379233",0xA99C],
- ["82379234",0xA99D],
- ["82379235",0xA99E],
- ["82379236",0xA99F],
- ["82379237",0xA9A0],
- ["82379238",0xA9A1],
- ["82379239",0xA9A2],
- ["82379330",0xA9A3],
- ["82379331",0xA9A4],
- ["82379332",0xA9A5],
- ["82379333",0xA9A6],
- ["82379334",0xA9A7],
- ["82379335",0xA9A8],
- ["82379336",0xA9A9],
- ["82379337",0xA9AA],
- ["82379338",0xA9AB],
- ["82379339",0xA9AC],
- ["82379430",0xA9AD],
- ["82379431",0xA9AE],
- ["82379432",0xA9AF],
- ["82379433",0xA9B0],
- ["82379434",0xA9B1],
- ["82379435",0xA9B2],
- ["82379436",0xA9B3],
- ["82379437",0xA9B4],
- ["82379438",0xA9B5],
- ["82379439",0xA9B6],
- ["82379530",0xA9B7],
- ["82379531",0xA9B8],
- ["82379532",0xA9B9],
- ["82379533",0xA9BA],
- ["82379534",0xA9BB],
- ["82379535",0xA9BC],
- ["82379536",0xA9BD],
- ["82379537",0xA9BE],
- ["82379538",0xA9BF],
- ["82379539",0xA9C0],
- ["82379630",0xA9C1],
- ["82379631",0xA9C2],
- ["82379632",0xA9C3],
- ["82379633",0xA9C4],
- ["82379634",0xA9C5],
- ["82379635",0xA9C6],
- ["82379636",0xA9C7],
- ["82379637",0xA9C8],
- ["82379638",0xA9C9],
- ["82379639",0xA9CA],
- ["82379730",0xA9CB],
- ["82379731",0xA9CC],
- ["82379732",0xA9CD],
- ["82379733",0xA9CE],
- ["82379734",0xA9CF],
- ["82379735",0xA9D0],
- ["82379736",0xA9D1],
- ["82379737",0xA9D2],
- ["82379738",0xA9D3],
- ["82379739",0xA9D4],
- ["82379830",0xA9D5],
- ["82379831",0xA9D6],
- ["82379832",0xA9D7],
- ["82379833",0xA9D8],
- ["82379834",0xA9D9],
- ["82379835",0xA9DA],
- ["82379836",0xA9DB],
- ["82379837",0xA9DC],
- ["82379838",0xA9DD],
- ["82379839",0xA9DE],
- ["82379930",0xA9DF],
- ["82379931",0xA9E0],
- ["82379932",0xA9E1],
- ["82379933",0xA9E2],
- ["82379934",0xA9E3],
- ["82379935",0xA9E4],
- ["82379936",0xA9E5],
- ["82379937",0xA9E6],
- ["82379938",0xA9E7],
- ["82379939",0xA9E8],
- ["82379A30",0xA9E9],
- ["82379A31",0xA9EA],
- ["82379A32",0xA9EB],
- ["82379A33",0xA9EC],
- ["82379A34",0xA9ED],
- ["82379A35",0xA9EE],
- ["82379A36",0xA9EF],
- ["82379A37",0xA9F0],
- ["82379A38",0xA9F1],
- ["82379A39",0xA9F2],
- ["82379B30",0xA9F3],
- ["82379B31",0xA9F4],
- ["82379B32",0xA9F5],
- ["82379B33",0xA9F6],
- ["82379B34",0xA9F7],
- ["82379B35",0xA9F8],
- ["82379B36",0xA9F9],
- ["82379B37",0xA9FA],
- ["82379B38",0xA9FB],
- ["82379B39",0xA9FC],
- ["82379C30",0xA9FD],
- ["82379C31",0xA9FE],
- ["82379C32",0xA9FF],
- ["82379C33",0xAA00],
- ["82379C34",0xAA01],
- ["82379C35",0xAA02],
- ["82379C36",0xAA03],
- ["82379C37",0xAA04],
- ["82379C38",0xAA05],
- ["82379C39",0xAA06],
- ["82379D30",0xAA07],
- ["82379D31",0xAA08],
- ["82379D32",0xAA09],
- ["82379D33",0xAA0A],
- ["82379D34",0xAA0B],
- ["82379D35",0xAA0C],
- ["82379D36",0xAA0D],
- ["82379D37",0xAA0E],
- ["82379D38",0xAA0F],
- ["82379D39",0xAA10],
- ["82379E30",0xAA11],
- ["82379E31",0xAA12],
- ["82379E32",0xAA13],
- ["82379E33",0xAA14],
- ["82379E34",0xAA15],
- ["82379E35",0xAA16],
- ["82379E36",0xAA17],
- ["82379E37",0xAA18],
- ["82379E38",0xAA19],
- ["82379E39",0xAA1A],
- ["82379F30",0xAA1B],
- ["82379F31",0xAA1C],
- ["82379F32",0xAA1D],
- ["82379F33",0xAA1E],
- ["82379F34",0xAA1F],
- ["82379F35",0xAA20],
- ["82379F36",0xAA21],
- ["82379F37",0xAA22],
- ["82379F38",0xAA23],
- ["82379F39",0xAA24],
- ["8237A030",0xAA25],
- ["8237A031",0xAA26],
- ["8237A032",0xAA27],
- ["8237A033",0xAA28],
- ["8237A034",0xAA29],
- ["8237A035",0xAA2A],
- ["8237A036",0xAA2B],
- ["8237A037",0xAA2C],
- ["8237A038",0xAA2D],
- ["8237A039",0xAA2E],
- ["8237A130",0xAA2F],
- ["8237A131",0xAA30],
- ["8237A132",0xAA31],
- ["8237A133",0xAA32],
- ["8237A134",0xAA33],
- ["8237A135",0xAA34],
- ["8237A136",0xAA35],
- ["8237A137",0xAA36],
- ["8237A138",0xAA37],
- ["8237A139",0xAA38],
- ["8237A230",0xAA39],
- ["8237A231",0xAA3A],
- ["8237A232",0xAA3B],
- ["8237A233",0xAA3C],
- ["8237A234",0xAA3D],
- ["8237A235",0xAA3E],
- ["8237A236",0xAA3F],
- ["8237A237",0xAA40],
- ["8237A238",0xAA41],
- ["8237A239",0xAA42],
- ["8237A330",0xAA43],
- ["8237A331",0xAA44],
- ["8237A332",0xAA45],
- ["8237A333",0xAA46],
- ["8237A334",0xAA47],
- ["8237A335",0xAA48],
- ["8237A336",0xAA49],
- ["8237A337",0xAA4A],
- ["8237A338",0xAA4B],
- ["8237A339",0xAA4C],
- ["8237A430",0xAA4D],
- ["8237A431",0xAA4E],
- ["8237A432",0xAA4F],
- ["8237A433",0xAA50],
- ["8237A434",0xAA51],
- ["8237A435",0xAA52],
- ["8237A436",0xAA53],
- ["8237A437",0xAA54],
- ["8237A438",0xAA55],
- ["8237A439",0xAA56],
- ["8237A530",0xAA57],
- ["8237A531",0xAA58],
- ["8237A532",0xAA59],
- ["8237A533",0xAA5A],
- ["8237A534",0xAA5B],
- ["8237A535",0xAA5C],
- ["8237A536",0xAA5D],
- ["8237A537",0xAA5E],
- ["8237A538",0xAA5F],
- ["8237A539",0xAA60],
- ["8237A630",0xAA61],
- ["8237A631",0xAA62],
- ["8237A632",0xAA63],
- ["8237A633",0xAA64],
- ["8237A634",0xAA65],
- ["8237A635",0xAA66],
- ["8237A636",0xAA67],
- ["8237A637",0xAA68],
- ["8237A638",0xAA69],
- ["8237A639",0xAA6A],
- ["8237A730",0xAA6B],
- ["8237A731",0xAA6C],
- ["8237A732",0xAA6D],
- ["8237A733",0xAA6E],
- ["8237A734",0xAA6F],
- ["8237A735",0xAA70],
- ["8237A736",0xAA71],
- ["8237A737",0xAA72],
- ["8237A738",0xAA73],
- ["8237A739",0xAA74],
- ["8237A830",0xAA75],
- ["8237A831",0xAA76],
- ["8237A832",0xAA77],
- ["8237A833",0xAA78],
- ["8237A834",0xAA79],
- ["8237A835",0xAA7A],
- ["8237A836",0xAA7B],
- ["8237A837",0xAA7C],
- ["8237A838",0xAA7D],
- ["8237A839",0xAA7E],
- ["8237A930",0xAA7F],
- ["8237A931",0xAA80],
- ["8237A932",0xAA81],
- ["8237A933",0xAA82],
- ["8237A934",0xAA83],
- ["8237A935",0xAA84],
- ["8237A936",0xAA85],
- ["8237A937",0xAA86],
- ["8237A938",0xAA87],
- ["8237A939",0xAA88],
- ["8237AA30",0xAA89],
- ["8237AA31",0xAA8A],
- ["8237AA32",0xAA8B],
- ["8237AA33",0xAA8C],
- ["8237AA34",0xAA8D],
- ["8237AA35",0xAA8E],
- ["8237AA36",0xAA8F],
- ["8237AA37",0xAA90],
- ["8237AA38",0xAA91],
- ["8237AA39",0xAA92],
- ["8237AB30",0xAA93],
- ["8237AB31",0xAA94],
- ["8237AB32",0xAA95],
- ["8237AB33",0xAA96],
- ["8237AB34",0xAA97],
- ["8237AB35",0xAA98],
- ["8237AB36",0xAA99],
- ["8237AB37",0xAA9A],
- ["8237AB38",0xAA9B],
- ["8237AB39",0xAA9C],
- ["8237AC30",0xAA9D],
- ["8237AC31",0xAA9E],
- ["8237AC32",0xAA9F],
- ["8237AC33",0xAAA0],
- ["8237AC34",0xAAA1],
- ["8237AC35",0xAAA2],
- ["8237AC36",0xAAA3],
- ["8237AC37",0xAAA4],
- ["8237AC38",0xAAA5],
- ["8237AC39",0xAAA6],
- ["8237AD30",0xAAA7],
- ["8237AD31",0xAAA8],
- ["8237AD32",0xAAA9],
- ["8237AD33",0xAAAA],
- ["8237AD34",0xAAAB],
- ["8237AD35",0xAAAC],
- ["8237AD36",0xAAAD],
- ["8237AD37",0xAAAE],
- ["8237AD38",0xAAAF],
- ["8237AD39",0xAAB0],
- ["8237AE30",0xAAB1],
- ["8237AE31",0xAAB2],
- ["8237AE32",0xAAB3],
- ["8237AE33",0xAAB4],
- ["8237AE34",0xAAB5],
- ["8237AE35",0xAAB6],
- ["8237AE36",0xAAB7],
- ["8237AE37",0xAAB8],
- ["8237AE38",0xAAB9],
- ["8237AE39",0xAABA],
- ["8237AF30",0xAABB],
- ["8237AF31",0xAABC],
- ["8237AF32",0xAABD],
- ["8237AF33",0xAABE],
- ["8237AF34",0xAABF],
- ["8237AF35",0xAAC0],
- ["8237AF36",0xAAC1],
- ["8237AF37",0xAAC2],
- ["8237AF38",0xAAC3],
- ["8237AF39",0xAAC4],
- ["8237B030",0xAAC5],
- ["8237B031",0xAAC6],
- ["8237B032",0xAAC7],
- ["8237B033",0xAAC8],
- ["8237B034",0xAAC9],
- ["8237B035",0xAACA],
- ["8237B036",0xAACB],
- ["8237B037",0xAACC],
- ["8237B038",0xAACD],
- ["8237B039",0xAACE],
- ["8237B130",0xAACF],
- ["8237B131",0xAAD0],
- ["8237B132",0xAAD1],
- ["8237B133",0xAAD2],
- ["8237B134",0xAAD3],
- ["8237B135",0xAAD4],
- ["8237B136",0xAAD5],
- ["8237B137",0xAAD6],
- ["8237B138",0xAAD7],
- ["8237B139",0xAAD8],
- ["8237B230",0xAAD9],
- ["8237B231",0xAADA],
- ["8237B232",0xAADB],
- ["8237B233",0xAADC],
- ["8237B234",0xAADD],
- ["8237B235",0xAADE],
- ["8237B236",0xAADF],
- ["8237B237",0xAAE0],
- ["8237B238",0xAAE1],
- ["8237B239",0xAAE2],
- ["8237B330",0xAAE3],
- ["8237B331",0xAAE4],
- ["8237B332",0xAAE5],
- ["8237B333",0xAAE6],
- ["8237B334",0xAAE7],
- ["8237B335",0xAAE8],
- ["8237B336",0xAAE9],
- ["8237B337",0xAAEA],
- ["8237B338",0xAAEB],
- ["8237B339",0xAAEC],
- ["8237B430",0xAAED],
- ["8237B431",0xAAEE],
- ["8237B432",0xAAEF],
- ["8237B433",0xAAF0],
- ["8237B434",0xAAF1],
- ["8237B435",0xAAF2],
- ["8237B436",0xAAF3],
- ["8237B437",0xAAF4],
- ["8237B438",0xAAF5],
- ["8237B439",0xAAF6],
- ["8237B530",0xAAF7],
- ["8237B531",0xAAF8],
- ["8237B532",0xAAF9],
- ["8237B533",0xAAFA],
- ["8237B534",0xAAFB],
- ["8237B535",0xAAFC],
- ["8237B536",0xAAFD],
- ["8237B537",0xAAFE],
- ["8237B538",0xAAFF],
- ["8237B539",0xAB00],
- ["8237B630",0xAB01],
- ["8237B631",0xAB02],
- ["8237B632",0xAB03],
- ["8237B633",0xAB04],
- ["8237B634",0xAB05],
- ["8237B635",0xAB06],
- ["8237B636",0xAB07],
- ["8237B637",0xAB08],
- ["8237B638",0xAB09],
- ["8237B639",0xAB0A],
- ["8237B730",0xAB0B],
- ["8237B731",0xAB0C],
- ["8237B732",0xAB0D],
- ["8237B733",0xAB0E],
- ["8237B734",0xAB0F],
- ["8237B735",0xAB10],
- ["8237B736",0xAB11],
- ["8237B737",0xAB12],
- ["8237B738",0xAB13],
- ["8237B739",0xAB14],
- ["8237B830",0xAB15],
- ["8237B831",0xAB16],
- ["8237B832",0xAB17],
- ["8237B833",0xAB18],
- ["8237B834",0xAB19],
- ["8237B835",0xAB1A],
- ["8237B836",0xAB1B],
- ["8237B837",0xAB1C],
- ["8237B838",0xAB1D],
- ["8237B839",0xAB1E],
- ["8237B930",0xAB1F],
- ["8237B931",0xAB20],
- ["8237B932",0xAB21],
- ["8237B933",0xAB22],
- ["8237B934",0xAB23],
- ["8237B935",0xAB24],
- ["8237B936",0xAB25],
- ["8237B937",0xAB26],
- ["8237B938",0xAB27],
- ["8237B939",0xAB28],
- ["8237BA30",0xAB29],
- ["8237BA31",0xAB2A],
- ["8237BA32",0xAB2B],
- ["8237BA33",0xAB2C],
- ["8237BA34",0xAB2D],
- ["8237BA35",0xAB2E],
- ["8237BA36",0xAB2F],
- ["8237BA37",0xAB30],
- ["8237BA38",0xAB31],
- ["8237BA39",0xAB32],
- ["8237BB30",0xAB33],
- ["8237BB31",0xAB34],
- ["8237BB32",0xAB35],
- ["8237BB33",0xAB36],
- ["8237BB34",0xAB37],
- ["8237BB35",0xAB38],
- ["8237BB36",0xAB39],
- ["8237BB37",0xAB3A],
- ["8237BB38",0xAB3B],
- ["8237BB39",0xAB3C],
- ["8237BC30",0xAB3D],
- ["8237BC31",0xAB3E],
- ["8237BC32",0xAB3F],
- ["8237BC33",0xAB40],
- ["8237BC34",0xAB41],
- ["8237BC35",0xAB42],
- ["8237BC36",0xAB43],
- ["8237BC37",0xAB44],
- ["8237BC38",0xAB45],
- ["8237BC39",0xAB46],
- ["8237BD30",0xAB47],
- ["8237BD31",0xAB48],
- ["8237BD32",0xAB49],
- ["8237BD33",0xAB4A],
- ["8237BD34",0xAB4B],
- ["8237BD35",0xAB4C],
- ["8237BD36",0xAB4D],
- ["8237BD37",0xAB4E],
- ["8237BD38",0xAB4F],
- ["8237BD39",0xAB50],
- ["8237BE30",0xAB51],
- ["8237BE31",0xAB52],
- ["8237BE32",0xAB53],
- ["8237BE33",0xAB54],
- ["8237BE34",0xAB55],
- ["8237BE35",0xAB56],
- ["8237BE36",0xAB57],
- ["8237BE37",0xAB58],
- ["8237BE38",0xAB59],
- ["8237BE39",0xAB5A],
- ["8237BF30",0xAB5B],
- ["8237BF31",0xAB5C],
- ["8237BF32",0xAB5D],
- ["8237BF33",0xAB5E],
- ["8237BF34",0xAB5F],
- ["8237BF35",0xAB60],
- ["8237BF36",0xAB61],
- ["8237BF37",0xAB62],
- ["8237BF38",0xAB63],
- ["8237BF39",0xAB64],
- ["8237C030",0xAB65],
- ["8237C031",0xAB66],
- ["8237C032",0xAB67],
- ["8237C033",0xAB68],
- ["8237C034",0xAB69],
- ["8237C035",0xAB6A],
- ["8237C036",0xAB6B],
- ["8237C037",0xAB6C],
- ["8237C038",0xAB6D],
- ["8237C039",0xAB6E],
- ["8237C130",0xAB6F],
- ["8237C131",0xAB70],
- ["8237C132",0xAB71],
- ["8237C133",0xAB72],
- ["8237C134",0xAB73],
- ["8237C135",0xAB74],
- ["8237C136",0xAB75],
- ["8237C137",0xAB76],
- ["8237C138",0xAB77],
- ["8237C139",0xAB78],
- ["8237C230",0xAB79],
- ["8237C231",0xAB7A],
- ["8237C232",0xAB7B],
- ["8237C233",0xAB7C],
- ["8237C234",0xAB7D],
- ["8237C235",0xAB7E],
- ["8237C236",0xAB7F],
- ["8237C237",0xAB80],
- ["8237C238",0xAB81],
- ["8237C239",0xAB82],
- ["8237C330",0xAB83],
- ["8237C331",0xAB84],
- ["8237C332",0xAB85],
- ["8237C333",0xAB86],
- ["8237C334",0xAB87],
- ["8237C335",0xAB88],
- ["8237C336",0xAB89],
- ["8237C337",0xAB8A],
- ["8237C338",0xAB8B],
- ["8237C339",0xAB8C],
- ["8237C430",0xAB8D],
- ["8237C431",0xAB8E],
- ["8237C432",0xAB8F],
- ["8237C433",0xAB90],
- ["8237C434",0xAB91],
- ["8237C435",0xAB92],
- ["8237C436",0xAB93],
- ["8237C437",0xAB94],
- ["8237C438",0xAB95],
- ["8237C439",0xAB96],
- ["8237C530",0xAB97],
- ["8237C531",0xAB98],
- ["8237C532",0xAB99],
- ["8237C533",0xAB9A],
- ["8237C534",0xAB9B],
- ["8237C535",0xAB9C],
- ["8237C536",0xAB9D],
- ["8237C537",0xAB9E],
- ["8237C538",0xAB9F],
- ["8237C539",0xABA0],
- ["8237C630",0xABA1],
- ["8237C631",0xABA2],
- ["8237C632",0xABA3],
- ["8237C633",0xABA4],
- ["8237C634",0xABA5],
- ["8237C635",0xABA6],
- ["8237C636",0xABA7],
- ["8237C637",0xABA8],
- ["8237C638",0xABA9],
- ["8237C639",0xABAA],
- ["8237C730",0xABAB],
- ["8237C731",0xABAC],
- ["8237C732",0xABAD],
- ["8237C733",0xABAE],
- ["8237C734",0xABAF],
- ["8237C735",0xABB0],
- ["8237C736",0xABB1],
- ["8237C737",0xABB2],
- ["8237C738",0xABB3],
- ["8237C739",0xABB4],
- ["8237C830",0xABB5],
- ["8237C831",0xABB6],
- ["8237C832",0xABB7],
- ["8237C833",0xABB8],
- ["8237C834",0xABB9],
- ["8237C835",0xABBA],
- ["8237C836",0xABBB],
- ["8237C837",0xABBC],
- ["8237C838",0xABBD],
- ["8237C839",0xABBE],
- ["8237C930",0xABBF],
- ["8237C931",0xABC0],
- ["8237C932",0xABC1],
- ["8237C933",0xABC2],
- ["8237C934",0xABC3],
- ["8237C935",0xABC4],
- ["8237C936",0xABC5],
- ["8237C937",0xABC6],
- ["8237C938",0xABC7],
- ["8237C939",0xABC8],
- ["8237CA30",0xABC9],
- ["8237CA31",0xABCA],
- ["8237CA32",0xABCB],
- ["8237CA33",0xABCC],
- ["8237CA34",0xABCD],
- ["8237CA35",0xABCE],
- ["8237CA36",0xABCF],
- ["8237CA37",0xABD0],
- ["8237CA38",0xABD1],
- ["8237CA39",0xABD2],
- ["8237CB30",0xABD3],
- ["8237CB31",0xABD4],
- ["8237CB32",0xABD5],
- ["8237CB33",0xABD6],
- ["8237CB34",0xABD7],
- ["8237CB35",0xABD8],
- ["8237CB36",0xABD9],
- ["8237CB37",0xABDA],
- ["8237CB38",0xABDB],
- ["8237CB39",0xABDC],
- ["8237CC30",0xABDD],
- ["8237CC31",0xABDE],
- ["8237CC32",0xABDF],
- ["8237CC33",0xABE0],
- ["8237CC34",0xABE1],
- ["8237CC35",0xABE2],
- ["8237CC36",0xABE3],
- ["8237CC37",0xABE4],
- ["8237CC38",0xABE5],
- ["8237CC39",0xABE6],
- ["8237CD30",0xABE7],
- ["8237CD31",0xABE8],
- ["8237CD32",0xABE9],
- ["8237CD33",0xABEA],
- ["8237CD34",0xABEB],
- ["8237CD35",0xABEC],
- ["8237CD36",0xABED],
- ["8237CD37",0xABEE],
- ["8237CD38",0xABEF],
- ["8237CD39",0xABF0],
- ["8237CE30",0xABF1],
- ["8237CE31",0xABF2],
- ["8237CE32",0xABF3],
- ["8237CE33",0xABF4],
- ["8237CE34",0xABF5],
- ["8237CE35",0xABF6],
- ["8237CE36",0xABF7],
- ["8237CE37",0xABF8],
- ["8237CE38",0xABF9],
- ["8237CE39",0xABFA],
- ["8237CF30",0xABFB],
- ["8237CF31",0xABFC],
- ["8237CF32",0xABFD],
- ["8237CF33",0xABFE],
- ["8237CF34",0xABFF],
- ["8237CF35",0xAC00],
- ["8237CF36",0xAC01],
- ["8237CF37",0xAC02],
- ["8237CF38",0xAC03],
- ["8237CF39",0xAC04],
- ["8237D030",0xAC05],
- ["8237D031",0xAC06],
- ["8237D032",0xAC07],
- ["8237D033",0xAC08],
- ["8237D034",0xAC09],
- ["8237D035",0xAC0A],
- ["8237D036",0xAC0B],
- ["8237D037",0xAC0C],
- ["8237D038",0xAC0D],
- ["8237D039",0xAC0E],
- ["8237D130",0xAC0F],
- ["8237D131",0xAC10],
- ["8237D132",0xAC11],
- ["8237D133",0xAC12],
- ["8237D134",0xAC13],
- ["8237D135",0xAC14],
- ["8237D136",0xAC15],
- ["8237D137",0xAC16],
- ["8237D138",0xAC17],
- ["8237D139",0xAC18],
- ["8237D230",0xAC19],
- ["8237D231",0xAC1A],
- ["8237D232",0xAC1B],
- ["8237D233",0xAC1C],
- ["8237D234",0xAC1D],
- ["8237D235",0xAC1E],
- ["8237D236",0xAC1F],
- ["8237D237",0xAC20],
- ["8237D238",0xAC21],
- ["8237D239",0xAC22],
- ["8237D330",0xAC23],
- ["8237D331",0xAC24],
- ["8237D332",0xAC25],
- ["8237D333",0xAC26],
- ["8237D334",0xAC27],
- ["8237D335",0xAC28],
- ["8237D336",0xAC29],
- ["8237D337",0xAC2A],
- ["8237D338",0xAC2B],
- ["8237D339",0xAC2C],
- ["8237D430",0xAC2D],
- ["8237D431",0xAC2E],
- ["8237D432",0xAC2F],
- ["8237D433",0xAC30],
- ["8237D434",0xAC31],
- ["8237D435",0xAC32],
- ["8237D436",0xAC33],
- ["8237D437",0xAC34],
- ["8237D438",0xAC35],
- ["8237D439",0xAC36],
- ["8237D530",0xAC37],
- ["8237D531",0xAC38],
- ["8237D532",0xAC39],
- ["8237D533",0xAC3A],
- ["8237D534",0xAC3B],
- ["8237D535",0xAC3C],
- ["8237D536",0xAC3D],
- ["8237D537",0xAC3E],
- ["8237D538",0xAC3F],
- ["8237D539",0xAC40],
- ["8237D630",0xAC41],
- ["8237D631",0xAC42],
- ["8237D632",0xAC43],
- ["8237D633",0xAC44],
- ["8237D634",0xAC45],
- ["8237D635",0xAC46],
- ["8237D636",0xAC47],
- ["8237D637",0xAC48],
- ["8237D638",0xAC49],
- ["8237D639",0xAC4A],
- ["8237D730",0xAC4B],
- ["8237D731",0xAC4C],
- ["8237D732",0xAC4D],
- ["8237D733",0xAC4E],
- ["8237D734",0xAC4F],
- ["8237D735",0xAC50],
- ["8237D736",0xAC51],
- ["8237D737",0xAC52],
- ["8237D738",0xAC53],
- ["8237D739",0xAC54],
- ["8237D830",0xAC55],
- ["8237D831",0xAC56],
- ["8237D832",0xAC57],
- ["8237D833",0xAC58],
- ["8237D834",0xAC59],
- ["8237D835",0xAC5A],
- ["8237D836",0xAC5B],
- ["8237D837",0xAC5C],
- ["8237D838",0xAC5D],
- ["8237D839",0xAC5E],
- ["8237D930",0xAC5F],
- ["8237D931",0xAC60],
- ["8237D932",0xAC61],
- ["8237D933",0xAC62],
- ["8237D934",0xAC63],
- ["8237D935",0xAC64],
- ["8237D936",0xAC65],
- ["8237D937",0xAC66],
- ["8237D938",0xAC67],
- ["8237D939",0xAC68],
- ["8237DA30",0xAC69],
- ["8237DA31",0xAC6A],
- ["8237DA32",0xAC6B],
- ["8237DA33",0xAC6C],
- ["8237DA34",0xAC6D],
- ["8237DA35",0xAC6E],
- ["8237DA36",0xAC6F],
- ["8237DA37",0xAC70],
- ["8237DA38",0xAC71],
- ["8237DA39",0xAC72],
- ["8237DB30",0xAC73],
- ["8237DB31",0xAC74],
- ["8237DB32",0xAC75],
- ["8237DB33",0xAC76],
- ["8237DB34",0xAC77],
- ["8237DB35",0xAC78],
- ["8237DB36",0xAC79],
- ["8237DB37",0xAC7A],
- ["8237DB38",0xAC7B],
- ["8237DB39",0xAC7C],
- ["8237DC30",0xAC7D],
- ["8237DC31",0xAC7E],
- ["8237DC32",0xAC7F],
- ["8237DC33",0xAC80],
- ["8237DC34",0xAC81],
- ["8237DC35",0xAC82],
- ["8237DC36",0xAC83],
- ["8237DC37",0xAC84],
- ["8237DC38",0xAC85],
- ["8237DC39",0xAC86],
- ["8237DD30",0xAC87],
- ["8237DD31",0xAC88],
- ["8237DD32",0xAC89],
- ["8237DD33",0xAC8A],
- ["8237DD34",0xAC8B],
- ["8237DD35",0xAC8C],
- ["8237DD36",0xAC8D],
- ["8237DD37",0xAC8E],
- ["8237DD38",0xAC8F],
- ["8237DD39",0xAC90],
- ["8237DE30",0xAC91],
- ["8237DE31",0xAC92],
- ["8237DE32",0xAC93],
- ["8237DE33",0xAC94],
- ["8237DE34",0xAC95],
- ["8237DE35",0xAC96],
- ["8237DE36",0xAC97],
- ["8237DE37",0xAC98],
- ["8237DE38",0xAC99],
- ["8237DE39",0xAC9A],
- ["8237DF30",0xAC9B],
- ["8237DF31",0xAC9C],
- ["8237DF32",0xAC9D],
- ["8237DF33",0xAC9E],
- ["8237DF34",0xAC9F],
- ["8237DF35",0xACA0],
- ["8237DF36",0xACA1],
- ["8237DF37",0xACA2],
- ["8237DF38",0xACA3],
- ["8237DF39",0xACA4],
- ["8237E030",0xACA5],
- ["8237E031",0xACA6],
- ["8237E032",0xACA7],
- ["8237E033",0xACA8],
- ["8237E034",0xACA9],
- ["8237E035",0xACAA],
- ["8237E036",0xACAB],
- ["8237E037",0xACAC],
- ["8237E038",0xACAD],
- ["8237E039",0xACAE],
- ["8237E130",0xACAF],
- ["8237E131",0xACB0],
- ["8237E132",0xACB1],
- ["8237E133",0xACB2],
- ["8237E134",0xACB3],
- ["8237E135",0xACB4],
- ["8237E136",0xACB5],
- ["8237E137",0xACB6],
- ["8237E138",0xACB7],
- ["8237E139",0xACB8],
- ["8237E230",0xACB9],
- ["8237E231",0xACBA],
- ["8237E232",0xACBB],
- ["8237E233",0xACBC],
- ["8237E234",0xACBD],
- ["8237E235",0xACBE],
- ["8237E236",0xACBF],
- ["8237E237",0xACC0],
- ["8237E238",0xACC1],
- ["8237E239",0xACC2],
- ["8237E330",0xACC3],
- ["8237E331",0xACC4],
- ["8237E332",0xACC5],
- ["8237E333",0xACC6],
- ["8237E334",0xACC7],
- ["8237E335",0xACC8],
- ["8237E336",0xACC9],
- ["8237E337",0xACCA],
- ["8237E338",0xACCB],
- ["8237E339",0xACCC],
- ["8237E430",0xACCD],
- ["8237E431",0xACCE],
- ["8237E432",0xACCF],
- ["8237E433",0xACD0],
- ["8237E434",0xACD1],
- ["8237E435",0xACD2],
- ["8237E436",0xACD3],
- ["8237E437",0xACD4],
- ["8237E438",0xACD5],
- ["8237E439",0xACD6],
- ["8237E530",0xACD7],
- ["8237E531",0xACD8],
- ["8237E532",0xACD9],
- ["8237E533",0xACDA],
- ["8237E534",0xACDB],
- ["8237E535",0xACDC],
- ["8237E536",0xACDD],
- ["8237E537",0xACDE],
- ["8237E538",0xACDF],
- ["8237E539",0xACE0],
- ["8237E630",0xACE1],
- ["8237E631",0xACE2],
- ["8237E632",0xACE3],
- ["8237E633",0xACE4],
- ["8237E634",0xACE5],
- ["8237E635",0xACE6],
- ["8237E636",0xACE7],
- ["8237E637",0xACE8],
- ["8237E638",0xACE9],
- ["8237E639",0xACEA],
- ["8237E730",0xACEB],
- ["8237E731",0xACEC],
- ["8237E732",0xACED],
- ["8237E733",0xACEE],
- ["8237E734",0xACEF],
- ["8237E735",0xACF0],
- ["8237E736",0xACF1],
- ["8237E737",0xACF2],
- ["8237E738",0xACF3],
- ["8237E739",0xACF4],
- ["8237E830",0xACF5],
- ["8237E831",0xACF6],
- ["8237E832",0xACF7],
- ["8237E833",0xACF8],
- ["8237E834",0xACF9],
- ["8237E835",0xACFA],
- ["8237E836",0xACFB],
- ["8237E837",0xACFC],
- ["8237E838",0xACFD],
- ["8237E839",0xACFE],
- ["8237E930",0xACFF],
- ["8237E931",0xAD00],
- ["8237E932",0xAD01],
- ["8237E933",0xAD02],
- ["8237E934",0xAD03],
- ["8237E935",0xAD04],
- ["8237E936",0xAD05],
- ["8237E937",0xAD06],
- ["8237E938",0xAD07],
- ["8237E939",0xAD08],
- ["8237EA30",0xAD09],
- ["8237EA31",0xAD0A],
- ["8237EA32",0xAD0B],
- ["8237EA33",0xAD0C],
- ["8237EA34",0xAD0D],
- ["8237EA35",0xAD0E],
- ["8237EA36",0xAD0F],
- ["8237EA37",0xAD10],
- ["8237EA38",0xAD11],
- ["8237EA39",0xAD12],
- ["8237EB30",0xAD13],
- ["8237EB31",0xAD14],
- ["8237EB32",0xAD15],
- ["8237EB33",0xAD16],
- ["8237EB34",0xAD17],
- ["8237EB35",0xAD18],
- ["8237EB36",0xAD19],
- ["8237EB37",0xAD1A],
- ["8237EB38",0xAD1B],
- ["8237EB39",0xAD1C],
- ["8237EC30",0xAD1D],
- ["8237EC31",0xAD1E],
- ["8237EC32",0xAD1F],
- ["8237EC33",0xAD20],
- ["8237EC34",0xAD21],
- ["8237EC35",0xAD22],
- ["8237EC36",0xAD23],
- ["8237EC37",0xAD24],
- ["8237EC38",0xAD25],
- ["8237EC39",0xAD26],
- ["8237ED30",0xAD27],
- ["8237ED31",0xAD28],
- ["8237ED32",0xAD29],
- ["8237ED33",0xAD2A],
- ["8237ED34",0xAD2B],
- ["8237ED35",0xAD2C],
- ["8237ED36",0xAD2D],
- ["8237ED37",0xAD2E],
- ["8237ED38",0xAD2F],
- ["8237ED39",0xAD30],
- ["8237EE30",0xAD31],
- ["8237EE31",0xAD32],
- ["8237EE32",0xAD33],
- ["8237EE33",0xAD34],
- ["8237EE34",0xAD35],
- ["8237EE35",0xAD36],
- ["8237EE36",0xAD37],
- ["8237EE37",0xAD38],
- ["8237EE38",0xAD39],
- ["8237EE39",0xAD3A],
- ["8237EF30",0xAD3B],
- ["8237EF31",0xAD3C],
- ["8237EF32",0xAD3D],
- ["8237EF33",0xAD3E],
- ["8237EF34",0xAD3F],
- ["8237EF35",0xAD40],
- ["8237EF36",0xAD41],
- ["8237EF37",0xAD42],
- ["8237EF38",0xAD43],
- ["8237EF39",0xAD44],
- ["8237F030",0xAD45],
- ["8237F031",0xAD46],
- ["8237F032",0xAD47],
- ["8237F033",0xAD48],
- ["8237F034",0xAD49],
- ["8237F035",0xAD4A],
- ["8237F036",0xAD4B],
- ["8237F037",0xAD4C],
- ["8237F038",0xAD4D],
- ["8237F039",0xAD4E],
- ["8237F130",0xAD4F],
- ["8237F131",0xAD50],
- ["8237F132",0xAD51],
- ["8237F133",0xAD52],
- ["8237F134",0xAD53],
- ["8237F135",0xAD54],
- ["8237F136",0xAD55],
- ["8237F137",0xAD56],
- ["8237F138",0xAD57],
- ["8237F139",0xAD58],
- ["8237F230",0xAD59],
- ["8237F231",0xAD5A],
- ["8237F232",0xAD5B],
- ["8237F233",0xAD5C],
- ["8237F234",0xAD5D],
- ["8237F235",0xAD5E],
- ["8237F236",0xAD5F],
- ["8237F237",0xAD60],
- ["8237F238",0xAD61],
- ["8237F239",0xAD62],
- ["8237F330",0xAD63],
- ["8237F331",0xAD64],
- ["8237F332",0xAD65],
- ["8237F333",0xAD66],
- ["8237F334",0xAD67],
- ["8237F335",0xAD68],
- ["8237F336",0xAD69],
- ["8237F337",0xAD6A],
- ["8237F338",0xAD6B],
- ["8237F339",0xAD6C],
- ["8237F430",0xAD6D],
- ["8237F431",0xAD6E],
- ["8237F432",0xAD6F],
- ["8237F433",0xAD70],
- ["8237F434",0xAD71],
- ["8237F435",0xAD72],
- ["8237F436",0xAD73],
- ["8237F437",0xAD74],
- ["8237F438",0xAD75],
- ["8237F439",0xAD76],
- ["8237F530",0xAD77],
- ["8237F531",0xAD78],
- ["8237F532",0xAD79],
- ["8237F533",0xAD7A],
- ["8237F534",0xAD7B],
- ["8237F535",0xAD7C],
- ["8237F536",0xAD7D],
- ["8237F537",0xAD7E],
- ["8237F538",0xAD7F],
- ["8237F539",0xAD80],
- ["8237F630",0xAD81],
- ["8237F631",0xAD82],
- ["8237F632",0xAD83],
- ["8237F633",0xAD84],
- ["8237F634",0xAD85],
- ["8237F635",0xAD86],
- ["8237F636",0xAD87],
- ["8237F637",0xAD88],
- ["8237F638",0xAD89],
- ["8237F639",0xAD8A],
- ["8237F730",0xAD8B],
- ["8237F731",0xAD8C],
- ["8237F732",0xAD8D],
- ["8237F733",0xAD8E],
- ["8237F734",0xAD8F],
- ["8237F735",0xAD90],
- ["8237F736",0xAD91],
- ["8237F737",0xAD92],
- ["8237F738",0xAD93],
- ["8237F739",0xAD94],
- ["8237F830",0xAD95],
- ["8237F831",0xAD96],
- ["8237F832",0xAD97],
- ["8237F833",0xAD98],
- ["8237F834",0xAD99],
- ["8237F835",0xAD9A],
- ["8237F836",0xAD9B],
- ["8237F837",0xAD9C],
- ["8237F838",0xAD9D],
- ["8237F839",0xAD9E],
- ["8237F930",0xAD9F],
- ["8237F931",0xADA0],
- ["8237F932",0xADA1],
- ["8237F933",0xADA2],
- ["8237F934",0xADA3],
- ["8237F935",0xADA4],
- ["8237F936",0xADA5],
- ["8237F937",0xADA6],
- ["8237F938",0xADA7],
- ["8237F939",0xADA8],
- ["8237FA30",0xADA9],
- ["8237FA31",0xADAA],
- ["8237FA32",0xADAB],
- ["8237FA33",0xADAC],
- ["8237FA34",0xADAD],
- ["8237FA35",0xADAE],
- ["8237FA36",0xADAF],
- ["8237FA37",0xADB0],
- ["8237FA38",0xADB1],
- ["8237FA39",0xADB2],
- ["8237FB30",0xADB3],
- ["8237FB31",0xADB4],
- ["8237FB32",0xADB5],
- ["8237FB33",0xADB6],
- ["8237FB34",0xADB7],
- ["8237FB35",0xADB8],
- ["8237FB36",0xADB9],
- ["8237FB37",0xADBA],
- ["8237FB38",0xADBB],
- ["8237FB39",0xADBC],
- ["8237FC30",0xADBD],
- ["8237FC31",0xADBE],
- ["8237FC32",0xADBF],
- ["8237FC33",0xADC0],
- ["8237FC34",0xADC1],
- ["8237FC35",0xADC2],
- ["8237FC36",0xADC3],
- ["8237FC37",0xADC4],
- ["8237FC38",0xADC5],
- ["8237FC39",0xADC6],
- ["8237FD30",0xADC7],
- ["8237FD31",0xADC8],
- ["8237FD32",0xADC9],
- ["8237FD33",0xADCA],
- ["8237FD34",0xADCB],
- ["8237FD35",0xADCC],
- ["8237FD36",0xADCD],
- ["8237FD37",0xADCE],
- ["8237FD38",0xADCF],
- ["8237FD39",0xADD0],
- ["8237FE30",0xADD1],
- ["8237FE31",0xADD2],
- ["8237FE32",0xADD3],
- ["8237FE33",0xADD4],
- ["8237FE34",0xADD5],
- ["8237FE35",0xADD6],
- ["8237FE36",0xADD7],
- ["8237FE37",0xADD8],
- ["8237FE38",0xADD9],
- ["8237FE39",0xADDA],
- ["82388130",0xADDB],
- ["82388131",0xADDC],
- ["82388132",0xADDD],
- ["82388133",0xADDE],
- ["82388134",0xADDF],
- ["82388135",0xADE0],
- ["82388136",0xADE1],
- ["82388137",0xADE2],
- ["82388138",0xADE3],
- ["82388139",0xADE4],
- ["82388230",0xADE5],
- ["82388231",0xADE6],
- ["82388232",0xADE7],
- ["82388233",0xADE8],
- ["82388234",0xADE9],
- ["82388235",0xADEA],
- ["82388236",0xADEB],
- ["82388237",0xADEC],
- ["82388238",0xADED],
- ["82388239",0xADEE],
- ["82388330",0xADEF],
- ["82388331",0xADF0],
- ["82388332",0xADF1],
- ["82388333",0xADF2],
- ["82388334",0xADF3],
- ["82388335",0xADF4],
- ["82388336",0xADF5],
- ["82388337",0xADF6],
- ["82388338",0xADF7],
- ["82388339",0xADF8],
- ["82388430",0xADF9],
- ["82388431",0xADFA],
- ["82388432",0xADFB],
- ["82388433",0xADFC],
- ["82388434",0xADFD],
- ["82388435",0xADFE],
- ["82388436",0xADFF],
- ["82388437",0xAE00],
- ["82388438",0xAE01],
- ["82388439",0xAE02],
- ["82388530",0xAE03],
- ["82388531",0xAE04],
- ["82388532",0xAE05],
- ["82388533",0xAE06],
- ["82388534",0xAE07],
- ["82388535",0xAE08],
- ["82388536",0xAE09],
- ["82388537",0xAE0A],
- ["82388538",0xAE0B],
- ["82388539",0xAE0C],
- ["82388630",0xAE0D],
- ["82388631",0xAE0E],
- ["82388632",0xAE0F],
- ["82388633",0xAE10],
- ["82388634",0xAE11],
- ["82388635",0xAE12],
- ["82388636",0xAE13],
- ["82388637",0xAE14],
- ["82388638",0xAE15],
- ["82388639",0xAE16],
- ["82388730",0xAE17],
- ["82388731",0xAE18],
- ["82388732",0xAE19],
- ["82388733",0xAE1A],
- ["82388734",0xAE1B],
- ["82388735",0xAE1C],
- ["82388736",0xAE1D],
- ["82388737",0xAE1E],
- ["82388738",0xAE1F],
- ["82388739",0xAE20],
- ["82388830",0xAE21],
- ["82388831",0xAE22],
- ["82388832",0xAE23],
- ["82388833",0xAE24],
- ["82388834",0xAE25],
- ["82388835",0xAE26],
- ["82388836",0xAE27],
- ["82388837",0xAE28],
- ["82388838",0xAE29],
- ["82388839",0xAE2A],
- ["82388930",0xAE2B],
- ["82388931",0xAE2C],
- ["82388932",0xAE2D],
- ["82388933",0xAE2E],
- ["82388934",0xAE2F],
- ["82388935",0xAE30],
- ["82388936",0xAE31],
- ["82388937",0xAE32],
- ["82388938",0xAE33],
- ["82388939",0xAE34],
- ["82388A30",0xAE35],
- ["82388A31",0xAE36],
- ["82388A32",0xAE37],
- ["82388A33",0xAE38],
- ["82388A34",0xAE39],
- ["82388A35",0xAE3A],
- ["82388A36",0xAE3B],
- ["82388A37",0xAE3C],
- ["82388A38",0xAE3D],
- ["82388A39",0xAE3E],
- ["82388B30",0xAE3F],
- ["82388B31",0xAE40],
- ["82388B32",0xAE41],
- ["82388B33",0xAE42],
- ["82388B34",0xAE43],
- ["82388B35",0xAE44],
- ["82388B36",0xAE45],
- ["82388B37",0xAE46],
- ["82388B38",0xAE47],
- ["82388B39",0xAE48],
- ["82388C30",0xAE49],
- ["82388C31",0xAE4A],
- ["82388C32",0xAE4B],
- ["82388C33",0xAE4C],
- ["82388C34",0xAE4D],
- ["82388C35",0xAE4E],
- ["82388C36",0xAE4F],
- ["82388C37",0xAE50],
- ["82388C38",0xAE51],
- ["82388C39",0xAE52],
- ["82388D30",0xAE53],
- ["82388D31",0xAE54],
- ["82388D32",0xAE55],
- ["82388D33",0xAE56],
- ["82388D34",0xAE57],
- ["82388D35",0xAE58],
- ["82388D36",0xAE59],
- ["82388D37",0xAE5A],
- ["82388D38",0xAE5B],
- ["82388D39",0xAE5C],
- ["82388E30",0xAE5D],
- ["82388E31",0xAE5E],
- ["82388E32",0xAE5F],
- ["82388E33",0xAE60],
- ["82388E34",0xAE61],
- ["82388E35",0xAE62],
- ["82388E36",0xAE63],
- ["82388E37",0xAE64],
- ["82388E38",0xAE65],
- ["82388E39",0xAE66],
- ["82388F30",0xAE67],
- ["82388F31",0xAE68],
- ["82388F32",0xAE69],
- ["82388F33",0xAE6A],
- ["82388F34",0xAE6B],
- ["82388F35",0xAE6C],
- ["82388F36",0xAE6D],
- ["82388F37",0xAE6E],
- ["82388F38",0xAE6F],
- ["82388F39",0xAE70],
- ["82389030",0xAE71],
- ["82389031",0xAE72],
- ["82389032",0xAE73],
- ["82389033",0xAE74],
- ["82389034",0xAE75],
- ["82389035",0xAE76],
- ["82389036",0xAE77],
- ["82389037",0xAE78],
- ["82389038",0xAE79],
- ["82389039",0xAE7A],
- ["82389130",0xAE7B],
- ["82389131",0xAE7C],
- ["82389132",0xAE7D],
- ["82389133",0xAE7E],
- ["82389134",0xAE7F],
- ["82389135",0xAE80],
- ["82389136",0xAE81],
- ["82389137",0xAE82],
- ["82389138",0xAE83],
- ["82389139",0xAE84],
- ["82389230",0xAE85],
- ["82389231",0xAE86],
- ["82389232",0xAE87],
- ["82389233",0xAE88],
- ["82389234",0xAE89],
- ["82389235",0xAE8A],
- ["82389236",0xAE8B],
- ["82389237",0xAE8C],
- ["82389238",0xAE8D],
- ["82389239",0xAE8E],
- ["82389330",0xAE8F],
- ["82389331",0xAE90],
- ["82389332",0xAE91],
- ["82389333",0xAE92],
- ["82389334",0xAE93],
- ["82389335",0xAE94],
- ["82389336",0xAE95],
- ["82389337",0xAE96],
- ["82389338",0xAE97],
- ["82389339",0xAE98],
- ["82389430",0xAE99],
- ["82389431",0xAE9A],
- ["82389432",0xAE9B],
- ["82389433",0xAE9C],
- ["82389434",0xAE9D],
- ["82389435",0xAE9E],
- ["82389436",0xAE9F],
- ["82389437",0xAEA0],
- ["82389438",0xAEA1],
- ["82389439",0xAEA2],
- ["82389530",0xAEA3],
- ["82389531",0xAEA4],
- ["82389532",0xAEA5],
- ["82389533",0xAEA6],
- ["82389534",0xAEA7],
- ["82389535",0xAEA8],
- ["82389536",0xAEA9],
- ["82389537",0xAEAA],
- ["82389538",0xAEAB],
- ["82389539",0xAEAC],
- ["82389630",0xAEAD],
- ["82389631",0xAEAE],
- ["82389632",0xAEAF],
- ["82389633",0xAEB0],
- ["82389634",0xAEB1],
- ["82389635",0xAEB2],
- ["82389636",0xAEB3],
- ["82389637",0xAEB4],
- ["82389638",0xAEB5],
- ["82389639",0xAEB6],
- ["82389730",0xAEB7],
- ["82389731",0xAEB8],
- ["82389732",0xAEB9],
- ["82389733",0xAEBA],
- ["82389734",0xAEBB],
- ["82389735",0xAEBC],
- ["82389736",0xAEBD],
- ["82389737",0xAEBE],
- ["82389738",0xAEBF],
- ["82389739",0xAEC0],
- ["82389830",0xAEC1],
- ["82389831",0xAEC2],
- ["82389832",0xAEC3],
- ["82389833",0xAEC4],
- ["82389834",0xAEC5],
- ["82389835",0xAEC6],
- ["82389836",0xAEC7],
- ["82389837",0xAEC8],
- ["82389838",0xAEC9],
- ["82389839",0xAECA],
- ["82389930",0xAECB],
- ["82389931",0xAECC],
- ["82389932",0xAECD],
- ["82389933",0xAECE],
- ["82389934",0xAECF],
- ["82389935",0xAED0],
- ["82389936",0xAED1],
- ["82389937",0xAED2],
- ["82389938",0xAED3],
- ["82389939",0xAED4],
- ["82389A30",0xAED5],
- ["82389A31",0xAED6],
- ["82389A32",0xAED7],
- ["82389A33",0xAED8],
- ["82389A34",0xAED9],
- ["82389A35",0xAEDA],
- ["82389A36",0xAEDB],
- ["82389A37",0xAEDC],
- ["82389A38",0xAEDD],
- ["82389A39",0xAEDE],
- ["82389B30",0xAEDF],
- ["82389B31",0xAEE0],
- ["82389B32",0xAEE1],
- ["82389B33",0xAEE2],
- ["82389B34",0xAEE3],
- ["82389B35",0xAEE4],
- ["82389B36",0xAEE5],
- ["82389B37",0xAEE6],
- ["82389B38",0xAEE7],
- ["82389B39",0xAEE8],
- ["82389C30",0xAEE9],
- ["82389C31",0xAEEA],
- ["82389C32",0xAEEB],
- ["82389C33",0xAEEC],
- ["82389C34",0xAEED],
- ["82389C35",0xAEEE],
- ["82389C36",0xAEEF],
- ["82389C37",0xAEF0],
- ["82389C38",0xAEF1],
- ["82389C39",0xAEF2],
- ["82389D30",0xAEF3],
- ["82389D31",0xAEF4],
- ["82389D32",0xAEF5],
- ["82389D33",0xAEF6],
- ["82389D34",0xAEF7],
- ["82389D35",0xAEF8],
- ["82389D36",0xAEF9],
- ["82389D37",0xAEFA],
- ["82389D38",0xAEFB],
- ["82389D39",0xAEFC],
- ["82389E30",0xAEFD],
- ["82389E31",0xAEFE],
- ["82389E32",0xAEFF],
- ["82389E33",0xAF00],
- ["82389E34",0xAF01],
- ["82389E35",0xAF02],
- ["82389E36",0xAF03],
- ["82389E37",0xAF04],
- ["82389E38",0xAF05],
- ["82389E39",0xAF06],
- ["82389F30",0xAF07],
- ["82389F31",0xAF08],
- ["82389F32",0xAF09],
- ["82389F33",0xAF0A],
- ["82389F34",0xAF0B],
- ["82389F35",0xAF0C],
- ["82389F36",0xAF0D],
- ["82389F37",0xAF0E],
- ["82389F38",0xAF0F],
- ["82389F39",0xAF10],
- ["8238A030",0xAF11],
- ["8238A031",0xAF12],
- ["8238A032",0xAF13],
- ["8238A033",0xAF14],
- ["8238A034",0xAF15],
- ["8238A035",0xAF16],
- ["8238A036",0xAF17],
- ["8238A037",0xAF18],
- ["8238A038",0xAF19],
- ["8238A039",0xAF1A],
- ["8238A130",0xAF1B],
- ["8238A131",0xAF1C],
- ["8238A132",0xAF1D],
- ["8238A133",0xAF1E],
- ["8238A134",0xAF1F],
- ["8238A135",0xAF20],
- ["8238A136",0xAF21],
- ["8238A137",0xAF22],
- ["8238A138",0xAF23],
- ["8238A139",0xAF24],
- ["8238A230",0xAF25],
- ["8238A231",0xAF26],
- ["8238A232",0xAF27],
- ["8238A233",0xAF28],
- ["8238A234",0xAF29],
- ["8238A235",0xAF2A],
- ["8238A236",0xAF2B],
- ["8238A237",0xAF2C],
- ["8238A238",0xAF2D],
- ["8238A239",0xAF2E],
- ["8238A330",0xAF2F],
- ["8238A331",0xAF30],
- ["8238A332",0xAF31],
- ["8238A333",0xAF32],
- ["8238A334",0xAF33],
- ["8238A335",0xAF34],
- ["8238A336",0xAF35],
- ["8238A337",0xAF36],
- ["8238A338",0xAF37],
- ["8238A339",0xAF38],
- ["8238A430",0xAF39],
- ["8238A431",0xAF3A],
- ["8238A432",0xAF3B],
- ["8238A433",0xAF3C],
- ["8238A434",0xAF3D],
- ["8238A435",0xAF3E],
- ["8238A436",0xAF3F],
- ["8238A437",0xAF40],
- ["8238A438",0xAF41],
- ["8238A439",0xAF42],
- ["8238A530",0xAF43],
- ["8238A531",0xAF44],
- ["8238A532",0xAF45],
- ["8238A533",0xAF46],
- ["8238A534",0xAF47],
- ["8238A535",0xAF48],
- ["8238A536",0xAF49],
- ["8238A537",0xAF4A],
- ["8238A538",0xAF4B],
- ["8238A539",0xAF4C],
- ["8238A630",0xAF4D],
- ["8238A631",0xAF4E],
- ["8238A632",0xAF4F],
- ["8238A633",0xAF50],
- ["8238A634",0xAF51],
- ["8238A635",0xAF52],
- ["8238A636",0xAF53],
- ["8238A637",0xAF54],
- ["8238A638",0xAF55],
- ["8238A639",0xAF56],
- ["8238A730",0xAF57],
- ["8238A731",0xAF58],
- ["8238A732",0xAF59],
- ["8238A733",0xAF5A],
- ["8238A734",0xAF5B],
- ["8238A735",0xAF5C],
- ["8238A736",0xAF5D],
- ["8238A737",0xAF5E],
- ["8238A738",0xAF5F],
- ["8238A739",0xAF60],
- ["8238A830",0xAF61],
- ["8238A831",0xAF62],
- ["8238A832",0xAF63],
- ["8238A833",0xAF64],
- ["8238A834",0xAF65],
- ["8238A835",0xAF66],
- ["8238A836",0xAF67],
- ["8238A837",0xAF68],
- ["8238A838",0xAF69],
- ["8238A839",0xAF6A],
- ["8238A930",0xAF6B],
- ["8238A931",0xAF6C],
- ["8238A932",0xAF6D],
- ["8238A933",0xAF6E],
- ["8238A934",0xAF6F],
- ["8238A935",0xAF70],
- ["8238A936",0xAF71],
- ["8238A937",0xAF72],
- ["8238A938",0xAF73],
- ["8238A939",0xAF74],
- ["8238AA30",0xAF75],
- ["8238AA31",0xAF76],
- ["8238AA32",0xAF77],
- ["8238AA33",0xAF78],
- ["8238AA34",0xAF79],
- ["8238AA35",0xAF7A],
- ["8238AA36",0xAF7B],
- ["8238AA37",0xAF7C],
- ["8238AA38",0xAF7D],
- ["8238AA39",0xAF7E],
- ["8238AB30",0xAF7F],
- ["8238AB31",0xAF80],
- ["8238AB32",0xAF81],
- ["8238AB33",0xAF82],
- ["8238AB34",0xAF83],
- ["8238AB35",0xAF84],
- ["8238AB36",0xAF85],
- ["8238AB37",0xAF86],
- ["8238AB38",0xAF87],
- ["8238AB39",0xAF88],
- ["8238AC30",0xAF89],
- ["8238AC31",0xAF8A],
- ["8238AC32",0xAF8B],
- ["8238AC33",0xAF8C],
- ["8238AC34",0xAF8D],
- ["8238AC35",0xAF8E],
- ["8238AC36",0xAF8F],
- ["8238AC37",0xAF90],
- ["8238AC38",0xAF91],
- ["8238AC39",0xAF92],
- ["8238AD30",0xAF93],
- ["8238AD31",0xAF94],
- ["8238AD32",0xAF95],
- ["8238AD33",0xAF96],
- ["8238AD34",0xAF97],
- ["8238AD35",0xAF98],
- ["8238AD36",0xAF99],
- ["8238AD37",0xAF9A],
- ["8238AD38",0xAF9B],
- ["8238AD39",0xAF9C],
- ["8238AE30",0xAF9D],
- ["8238AE31",0xAF9E],
- ["8238AE32",0xAF9F],
- ["8238AE33",0xAFA0],
- ["8238AE34",0xAFA1],
- ["8238AE35",0xAFA2],
- ["8238AE36",0xAFA3],
- ["8238AE37",0xAFA4],
- ["8238AE38",0xAFA5],
- ["8238AE39",0xAFA6],
- ["8238AF30",0xAFA7],
- ["8238AF31",0xAFA8],
- ["8238AF32",0xAFA9],
- ["8238AF33",0xAFAA],
- ["8238AF34",0xAFAB],
- ["8238AF35",0xAFAC],
- ["8238AF36",0xAFAD],
- ["8238AF37",0xAFAE],
- ["8238AF38",0xAFAF],
- ["8238AF39",0xAFB0],
- ["8238B030",0xAFB1],
- ["8238B031",0xAFB2],
- ["8238B032",0xAFB3],
- ["8238B033",0xAFB4],
- ["8238B034",0xAFB5],
- ["8238B035",0xAFB6],
- ["8238B036",0xAFB7],
- ["8238B037",0xAFB8],
- ["8238B038",0xAFB9],
- ["8238B039",0xAFBA],
- ["8238B130",0xAFBB],
- ["8238B131",0xAFBC],
- ["8238B132",0xAFBD],
- ["8238B133",0xAFBE],
- ["8238B134",0xAFBF],
- ["8238B135",0xAFC0],
- ["8238B136",0xAFC1],
- ["8238B137",0xAFC2],
- ["8238B138",0xAFC3],
- ["8238B139",0xAFC4],
- ["8238B230",0xAFC5],
- ["8238B231",0xAFC6],
- ["8238B232",0xAFC7],
- ["8238B233",0xAFC8],
- ["8238B234",0xAFC9],
- ["8238B235",0xAFCA],
- ["8238B236",0xAFCB],
- ["8238B237",0xAFCC],
- ["8238B238",0xAFCD],
- ["8238B239",0xAFCE],
- ["8238B330",0xAFCF],
- ["8238B331",0xAFD0],
- ["8238B332",0xAFD1],
- ["8238B333",0xAFD2],
- ["8238B334",0xAFD3],
- ["8238B335",0xAFD4],
- ["8238B336",0xAFD5],
- ["8238B337",0xAFD6],
- ["8238B338",0xAFD7],
- ["8238B339",0xAFD8],
- ["8238B430",0xAFD9],
- ["8238B431",0xAFDA],
- ["8238B432",0xAFDB],
- ["8238B433",0xAFDC],
- ["8238B434",0xAFDD],
- ["8238B435",0xAFDE],
- ["8238B436",0xAFDF],
- ["8238B437",0xAFE0],
- ["8238B438",0xAFE1],
- ["8238B439",0xAFE2],
- ["8238B530",0xAFE3],
- ["8238B531",0xAFE4],
- ["8238B532",0xAFE5],
- ["8238B533",0xAFE6],
- ["8238B534",0xAFE7],
- ["8238B535",0xAFE8],
- ["8238B536",0xAFE9],
- ["8238B537",0xAFEA],
- ["8238B538",0xAFEB],
- ["8238B539",0xAFEC],
- ["8238B630",0xAFED],
- ["8238B631",0xAFEE],
- ["8238B632",0xAFEF],
- ["8238B633",0xAFF0],
- ["8238B634",0xAFF1],
- ["8238B635",0xAFF2],
- ["8238B636",0xAFF3],
- ["8238B637",0xAFF4],
- ["8238B638",0xAFF5],
- ["8238B639",0xAFF6],
- ["8238B730",0xAFF7],
- ["8238B731",0xAFF8],
- ["8238B732",0xAFF9],
- ["8238B733",0xAFFA],
- ["8238B734",0xAFFB],
- ["8238B735",0xAFFC],
- ["8238B736",0xAFFD],
- ["8238B737",0xAFFE],
- ["8238B738",0xAFFF],
- ["8238B739",0xB000],
- ["8238B830",0xB001],
- ["8238B831",0xB002],
- ["8238B832",0xB003],
- ["8238B833",0xB004],
- ["8238B834",0xB005],
- ["8238B835",0xB006],
- ["8238B836",0xB007],
- ["8238B837",0xB008],
- ["8238B838",0xB009],
- ["8238B839",0xB00A],
- ["8238B930",0xB00B],
- ["8238B931",0xB00C],
- ["8238B932",0xB00D],
- ["8238B933",0xB00E],
- ["8238B934",0xB00F],
- ["8238B935",0xB010],
- ["8238B936",0xB011],
- ["8238B937",0xB012],
- ["8238B938",0xB013],
- ["8238B939",0xB014],
- ["8238BA30",0xB015],
- ["8238BA31",0xB016],
- ["8238BA32",0xB017],
- ["8238BA33",0xB018],
- ["8238BA34",0xB019],
- ["8238BA35",0xB01A],
- ["8238BA36",0xB01B],
- ["8238BA37",0xB01C],
- ["8238BA38",0xB01D],
- ["8238BA39",0xB01E],
- ["8238BB30",0xB01F],
- ["8238BB31",0xB020],
- ["8238BB32",0xB021],
- ["8238BB33",0xB022],
- ["8238BB34",0xB023],
- ["8238BB35",0xB024],
- ["8238BB36",0xB025],
- ["8238BB37",0xB026],
- ["8238BB38",0xB027],
- ["8238BB39",0xB028],
- ["8238BC30",0xB029],
- ["8238BC31",0xB02A],
- ["8238BC32",0xB02B],
- ["8238BC33",0xB02C],
- ["8238BC34",0xB02D],
- ["8238BC35",0xB02E],
- ["8238BC36",0xB02F],
- ["8238BC37",0xB030],
- ["8238BC38",0xB031],
- ["8238BC39",0xB032],
- ["8238BD30",0xB033],
- ["8238BD31",0xB034],
- ["8238BD32",0xB035],
- ["8238BD33",0xB036],
- ["8238BD34",0xB037],
- ["8238BD35",0xB038],
- ["8238BD36",0xB039],
- ["8238BD37",0xB03A],
- ["8238BD38",0xB03B],
- ["8238BD39",0xB03C],
- ["8238BE30",0xB03D],
- ["8238BE31",0xB03E],
- ["8238BE32",0xB03F],
- ["8238BE33",0xB040],
- ["8238BE34",0xB041],
- ["8238BE35",0xB042],
- ["8238BE36",0xB043],
- ["8238BE37",0xB044],
- ["8238BE38",0xB045],
- ["8238BE39",0xB046],
- ["8238BF30",0xB047],
- ["8238BF31",0xB048],
- ["8238BF32",0xB049],
- ["8238BF33",0xB04A],
- ["8238BF34",0xB04B],
- ["8238BF35",0xB04C],
- ["8238BF36",0xB04D],
- ["8238BF37",0xB04E],
- ["8238BF38",0xB04F],
- ["8238BF39",0xB050],
- ["8238C030",0xB051],
- ["8238C031",0xB052],
- ["8238C032",0xB053],
- ["8238C033",0xB054],
- ["8238C034",0xB055],
- ["8238C035",0xB056],
- ["8238C036",0xB057],
- ["8238C037",0xB058],
- ["8238C038",0xB059],
- ["8238C039",0xB05A],
- ["8238C130",0xB05B],
- ["8238C131",0xB05C],
- ["8238C132",0xB05D],
- ["8238C133",0xB05E],
- ["8238C134",0xB05F],
- ["8238C135",0xB060],
- ["8238C136",0xB061],
- ["8238C137",0xB062],
- ["8238C138",0xB063],
- ["8238C139",0xB064],
- ["8238C230",0xB065],
- ["8238C231",0xB066],
- ["8238C232",0xB067],
- ["8238C233",0xB068],
- ["8238C234",0xB069],
- ["8238C235",0xB06A],
- ["8238C236",0xB06B],
- ["8238C237",0xB06C],
- ["8238C238",0xB06D],
- ["8238C239",0xB06E],
- ["8238C330",0xB06F],
- ["8238C331",0xB070],
- ["8238C332",0xB071],
- ["8238C333",0xB072],
- ["8238C334",0xB073],
- ["8238C335",0xB074],
- ["8238C336",0xB075],
- ["8238C337",0xB076],
- ["8238C338",0xB077],
- ["8238C339",0xB078],
- ["8238C430",0xB079],
- ["8238C431",0xB07A],
- ["8238C432",0xB07B],
- ["8238C433",0xB07C],
- ["8238C434",0xB07D],
- ["8238C435",0xB07E],
- ["8238C436",0xB07F],
- ["8238C437",0xB080],
- ["8238C438",0xB081],
- ["8238C439",0xB082],
- ["8238C530",0xB083],
- ["8238C531",0xB084],
- ["8238C532",0xB085],
- ["8238C533",0xB086],
- ["8238C534",0xB087],
- ["8238C535",0xB088],
- ["8238C536",0xB089],
- ["8238C537",0xB08A],
- ["8238C538",0xB08B],
- ["8238C539",0xB08C],
- ["8238C630",0xB08D],
- ["8238C631",0xB08E],
- ["8238C632",0xB08F],
- ["8238C633",0xB090],
- ["8238C634",0xB091],
- ["8238C635",0xB092],
- ["8238C636",0xB093],
- ["8238C637",0xB094],
- ["8238C638",0xB095],
- ["8238C639",0xB096],
- ["8238C730",0xB097],
- ["8238C731",0xB098],
- ["8238C732",0xB099],
- ["8238C733",0xB09A],
- ["8238C734",0xB09B],
- ["8238C735",0xB09C],
- ["8238C736",0xB09D],
- ["8238C737",0xB09E],
- ["8238C738",0xB09F],
- ["8238C739",0xB0A0],
- ["8238C830",0xB0A1],
- ["8238C831",0xB0A2],
- ["8238C832",0xB0A3],
- ["8238C833",0xB0A4],
- ["8238C834",0xB0A5],
- ["8238C835",0xB0A6],
- ["8238C836",0xB0A7],
- ["8238C837",0xB0A8],
- ["8238C838",0xB0A9],
- ["8238C839",0xB0AA],
- ["8238C930",0xB0AB],
- ["8238C931",0xB0AC],
- ["8238C932",0xB0AD],
- ["8238C933",0xB0AE],
- ["8238C934",0xB0AF],
- ["8238C935",0xB0B0],
- ["8238C936",0xB0B1],
- ["8238C937",0xB0B2],
- ["8238C938",0xB0B3],
- ["8238C939",0xB0B4],
- ["8238CA30",0xB0B5],
- ["8238CA31",0xB0B6],
- ["8238CA32",0xB0B7],
- ["8238CA33",0xB0B8],
- ["8238CA34",0xB0B9],
- ["8238CA35",0xB0BA],
- ["8238CA36",0xB0BB],
- ["8238CA37",0xB0BC],
- ["8238CA38",0xB0BD],
- ["8238CA39",0xB0BE],
- ["8238CB30",0xB0BF],
- ["8238CB31",0xB0C0],
- ["8238CB32",0xB0C1],
- ["8238CB33",0xB0C2],
- ["8238CB34",0xB0C3],
- ["8238CB35",0xB0C4],
- ["8238CB36",0xB0C5],
- ["8238CB37",0xB0C6],
- ["8238CB38",0xB0C7],
- ["8238CB39",0xB0C8],
- ["8238CC30",0xB0C9],
- ["8238CC31",0xB0CA],
- ["8238CC32",0xB0CB],
- ["8238CC33",0xB0CC],
- ["8238CC34",0xB0CD],
- ["8238CC35",0xB0CE],
- ["8238CC36",0xB0CF],
- ["8238CC37",0xB0D0],
- ["8238CC38",0xB0D1],
- ["8238CC39",0xB0D2],
- ["8238CD30",0xB0D3],
- ["8238CD31",0xB0D4],
- ["8238CD32",0xB0D5],
- ["8238CD33",0xB0D6],
- ["8238CD34",0xB0D7],
- ["8238CD35",0xB0D8],
- ["8238CD36",0xB0D9],
- ["8238CD37",0xB0DA],
- ["8238CD38",0xB0DB],
- ["8238CD39",0xB0DC],
- ["8238CE30",0xB0DD],
- ["8238CE31",0xB0DE],
- ["8238CE32",0xB0DF],
- ["8238CE33",0xB0E0],
- ["8238CE34",0xB0E1],
- ["8238CE35",0xB0E2],
- ["8238CE36",0xB0E3],
- ["8238CE37",0xB0E4],
- ["8238CE38",0xB0E5],
- ["8238CE39",0xB0E6],
- ["8238CF30",0xB0E7],
- ["8238CF31",0xB0E8],
- ["8238CF32",0xB0E9],
- ["8238CF33",0xB0EA],
- ["8238CF34",0xB0EB],
- ["8238CF35",0xB0EC],
- ["8238CF36",0xB0ED],
- ["8238CF37",0xB0EE],
- ["8238CF38",0xB0EF],
- ["8238CF39",0xB0F0],
- ["8238D030",0xB0F1],
- ["8238D031",0xB0F2],
- ["8238D032",0xB0F3],
- ["8238D033",0xB0F4],
- ["8238D034",0xB0F5],
- ["8238D035",0xB0F6],
- ["8238D036",0xB0F7],
- ["8238D037",0xB0F8],
- ["8238D038",0xB0F9],
- ["8238D039",0xB0FA],
- ["8238D130",0xB0FB],
- ["8238D131",0xB0FC],
- ["8238D132",0xB0FD],
- ["8238D133",0xB0FE],
- ["8238D134",0xB0FF],
- ["8238D135",0xB100],
- ["8238D136",0xB101],
- ["8238D137",0xB102],
- ["8238D138",0xB103],
- ["8238D139",0xB104],
- ["8238D230",0xB105],
- ["8238D231",0xB106],
- ["8238D232",0xB107],
- ["8238D233",0xB108],
- ["8238D234",0xB109],
- ["8238D235",0xB10A],
- ["8238D236",0xB10B],
- ["8238D237",0xB10C],
- ["8238D238",0xB10D],
- ["8238D239",0xB10E],
- ["8238D330",0xB10F],
- ["8238D331",0xB110],
- ["8238D332",0xB111],
- ["8238D333",0xB112],
- ["8238D334",0xB113],
- ["8238D335",0xB114],
- ["8238D336",0xB115],
- ["8238D337",0xB116],
- ["8238D338",0xB117],
- ["8238D339",0xB118],
- ["8238D430",0xB119],
- ["8238D431",0xB11A],
- ["8238D432",0xB11B],
- ["8238D433",0xB11C],
- ["8238D434",0xB11D],
- ["8238D435",0xB11E],
- ["8238D436",0xB11F],
- ["8238D437",0xB120],
- ["8238D438",0xB121],
- ["8238D439",0xB122],
- ["8238D530",0xB123],
- ["8238D531",0xB124],
- ["8238D532",0xB125],
- ["8238D533",0xB126],
- ["8238D534",0xB127],
- ["8238D535",0xB128],
- ["8238D536",0xB129],
- ["8238D537",0xB12A],
- ["8238D538",0xB12B],
- ["8238D539",0xB12C],
- ["8238D630",0xB12D],
- ["8238D631",0xB12E],
- ["8238D632",0xB12F],
- ["8238D633",0xB130],
- ["8238D634",0xB131],
- ["8238D635",0xB132],
- ["8238D636",0xB133],
- ["8238D637",0xB134],
- ["8238D638",0xB135],
- ["8238D639",0xB136],
- ["8238D730",0xB137],
- ["8238D731",0xB138],
- ["8238D732",0xB139],
- ["8238D733",0xB13A],
- ["8238D734",0xB13B],
- ["8238D735",0xB13C],
- ["8238D736",0xB13D],
- ["8238D737",0xB13E],
- ["8238D738",0xB13F],
- ["8238D739",0xB140],
- ["8238D830",0xB141],
- ["8238D831",0xB142],
- ["8238D832",0xB143],
- ["8238D833",0xB144],
- ["8238D834",0xB145],
- ["8238D835",0xB146],
- ["8238D836",0xB147],
- ["8238D837",0xB148],
- ["8238D838",0xB149],
- ["8238D839",0xB14A],
- ["8238D930",0xB14B],
- ["8238D931",0xB14C],
- ["8238D932",0xB14D],
- ["8238D933",0xB14E],
- ["8238D934",0xB14F],
- ["8238D935",0xB150],
- ["8238D936",0xB151],
- ["8238D937",0xB152],
- ["8238D938",0xB153],
- ["8238D939",0xB154],
- ["8238DA30",0xB155],
- ["8238DA31",0xB156],
- ["8238DA32",0xB157],
- ["8238DA33",0xB158],
- ["8238DA34",0xB159],
- ["8238DA35",0xB15A],
- ["8238DA36",0xB15B],
- ["8238DA37",0xB15C],
- ["8238DA38",0xB15D],
- ["8238DA39",0xB15E],
- ["8238DB30",0xB15F],
- ["8238DB31",0xB160],
- ["8238DB32",0xB161],
- ["8238DB33",0xB162],
- ["8238DB34",0xB163],
- ["8238DB35",0xB164],
- ["8238DB36",0xB165],
- ["8238DB37",0xB166],
- ["8238DB38",0xB167],
- ["8238DB39",0xB168],
- ["8238DC30",0xB169],
- ["8238DC31",0xB16A],
- ["8238DC32",0xB16B],
- ["8238DC33",0xB16C],
- ["8238DC34",0xB16D],
- ["8238DC35",0xB16E],
- ["8238DC36",0xB16F],
- ["8238DC37",0xB170],
- ["8238DC38",0xB171],
- ["8238DC39",0xB172],
- ["8238DD30",0xB173],
- ["8238DD31",0xB174],
- ["8238DD32",0xB175],
- ["8238DD33",0xB176],
- ["8238DD34",0xB177],
- ["8238DD35",0xB178],
- ["8238DD36",0xB179],
- ["8238DD37",0xB17A],
- ["8238DD38",0xB17B],
- ["8238DD39",0xB17C],
- ["8238DE30",0xB17D],
- ["8238DE31",0xB17E],
- ["8238DE32",0xB17F],
- ["8238DE33",0xB180],
- ["8238DE34",0xB181],
- ["8238DE35",0xB182],
- ["8238DE36",0xB183],
- ["8238DE37",0xB184],
- ["8238DE38",0xB185],
- ["8238DE39",0xB186],
- ["8238DF30",0xB187],
- ["8238DF31",0xB188],
- ["8238DF32",0xB189],
- ["8238DF33",0xB18A],
- ["8238DF34",0xB18B],
- ["8238DF35",0xB18C],
- ["8238DF36",0xB18D],
- ["8238DF37",0xB18E],
- ["8238DF38",0xB18F],
- ["8238DF39",0xB190],
- ["8238E030",0xB191],
- ["8238E031",0xB192],
- ["8238E032",0xB193],
- ["8238E033",0xB194],
- ["8238E034",0xB195],
- ["8238E035",0xB196],
- ["8238E036",0xB197],
- ["8238E037",0xB198],
- ["8238E038",0xB199],
- ["8238E039",0xB19A],
- ["8238E130",0xB19B],
- ["8238E131",0xB19C],
- ["8238E132",0xB19D],
- ["8238E133",0xB19E],
- ["8238E134",0xB19F],
- ["8238E135",0xB1A0],
- ["8238E136",0xB1A1],
- ["8238E137",0xB1A2],
- ["8238E138",0xB1A3],
- ["8238E139",0xB1A4],
- ["8238E230",0xB1A5],
- ["8238E231",0xB1A6],
- ["8238E232",0xB1A7],
- ["8238E233",0xB1A8],
- ["8238E234",0xB1A9],
- ["8238E235",0xB1AA],
- ["8238E236",0xB1AB],
- ["8238E237",0xB1AC],
- ["8238E238",0xB1AD],
- ["8238E239",0xB1AE],
- ["8238E330",0xB1AF],
- ["8238E331",0xB1B0],
- ["8238E332",0xB1B1],
- ["8238E333",0xB1B2],
- ["8238E334",0xB1B3],
- ["8238E335",0xB1B4],
- ["8238E336",0xB1B5],
- ["8238E337",0xB1B6],
- ["8238E338",0xB1B7],
- ["8238E339",0xB1B8],
- ["8238E430",0xB1B9],
- ["8238E431",0xB1BA],
- ["8238E432",0xB1BB],
- ["8238E433",0xB1BC],
- ["8238E434",0xB1BD],
- ["8238E435",0xB1BE],
- ["8238E436",0xB1BF],
- ["8238E437",0xB1C0],
- ["8238E438",0xB1C1],
- ["8238E439",0xB1C2],
- ["8238E530",0xB1C3],
- ["8238E531",0xB1C4],
- ["8238E532",0xB1C5],
- ["8238E533",0xB1C6],
- ["8238E534",0xB1C7],
- ["8238E535",0xB1C8],
- ["8238E536",0xB1C9],
- ["8238E537",0xB1CA],
- ["8238E538",0xB1CB],
- ["8238E539",0xB1CC],
- ["8238E630",0xB1CD],
- ["8238E631",0xB1CE],
- ["8238E632",0xB1CF],
- ["8238E633",0xB1D0],
- ["8238E634",0xB1D1],
- ["8238E635",0xB1D2],
- ["8238E636",0xB1D3],
- ["8238E637",0xB1D4],
- ["8238E638",0xB1D5],
- ["8238E639",0xB1D6],
- ["8238E730",0xB1D7],
- ["8238E731",0xB1D8],
- ["8238E732",0xB1D9],
- ["8238E733",0xB1DA],
- ["8238E734",0xB1DB],
- ["8238E735",0xB1DC],
- ["8238E736",0xB1DD],
- ["8238E737",0xB1DE],
- ["8238E738",0xB1DF],
- ["8238E739",0xB1E0],
- ["8238E830",0xB1E1],
- ["8238E831",0xB1E2],
- ["8238E832",0xB1E3],
- ["8238E833",0xB1E4],
- ["8238E834",0xB1E5],
- ["8238E835",0xB1E6],
- ["8238E836",0xB1E7],
- ["8238E837",0xB1E8],
- ["8238E838",0xB1E9],
- ["8238E839",0xB1EA],
- ["8238E930",0xB1EB],
- ["8238E931",0xB1EC],
- ["8238E932",0xB1ED],
- ["8238E933",0xB1EE],
- ["8238E934",0xB1EF],
- ["8238E935",0xB1F0],
- ["8238E936",0xB1F1],
- ["8238E937",0xB1F2],
- ["8238E938",0xB1F3],
- ["8238E939",0xB1F4],
- ["8238EA30",0xB1F5],
- ["8238EA31",0xB1F6],
- ["8238EA32",0xB1F7],
- ["8238EA33",0xB1F8],
- ["8238EA34",0xB1F9],
- ["8238EA35",0xB1FA],
- ["8238EA36",0xB1FB],
- ["8238EA37",0xB1FC],
- ["8238EA38",0xB1FD],
- ["8238EA39",0xB1FE],
- ["8238EB30",0xB1FF],
- ["8238EB31",0xB200],
- ["8238EB32",0xB201],
- ["8238EB33",0xB202],
- ["8238EB34",0xB203],
- ["8238EB35",0xB204],
- ["8238EB36",0xB205],
- ["8238EB37",0xB206],
- ["8238EB38",0xB207],
- ["8238EB39",0xB208],
- ["8238EC30",0xB209],
- ["8238EC31",0xB20A],
- ["8238EC32",0xB20B],
- ["8238EC33",0xB20C],
- ["8238EC34",0xB20D],
- ["8238EC35",0xB20E],
- ["8238EC36",0xB20F],
- ["8238EC37",0xB210],
- ["8238EC38",0xB211],
- ["8238EC39",0xB212],
- ["8238ED30",0xB213],
- ["8238ED31",0xB214],
- ["8238ED32",0xB215],
- ["8238ED33",0xB216],
- ["8238ED34",0xB217],
- ["8238ED35",0xB218],
- ["8238ED36",0xB219],
- ["8238ED37",0xB21A],
- ["8238ED38",0xB21B],
- ["8238ED39",0xB21C],
- ["8238EE30",0xB21D],
- ["8238EE31",0xB21E],
- ["8238EE32",0xB21F],
- ["8238EE33",0xB220],
- ["8238EE34",0xB221],
- ["8238EE35",0xB222],
- ["8238EE36",0xB223],
- ["8238EE37",0xB224],
- ["8238EE38",0xB225],
- ["8238EE39",0xB226],
- ["8238EF30",0xB227],
- ["8238EF31",0xB228],
- ["8238EF32",0xB229],
- ["8238EF33",0xB22A],
- ["8238EF34",0xB22B],
- ["8238EF35",0xB22C],
- ["8238EF36",0xB22D],
- ["8238EF37",0xB22E],
- ["8238EF38",0xB22F],
- ["8238EF39",0xB230],
- ["8238F030",0xB231],
- ["8238F031",0xB232],
- ["8238F032",0xB233],
- ["8238F033",0xB234],
- ["8238F034",0xB235],
- ["8238F035",0xB236],
- ["8238F036",0xB237],
- ["8238F037",0xB238],
- ["8238F038",0xB239],
- ["8238F039",0xB23A],
- ["8238F130",0xB23B],
- ["8238F131",0xB23C],
- ["8238F132",0xB23D],
- ["8238F133",0xB23E],
- ["8238F134",0xB23F],
- ["8238F135",0xB240],
- ["8238F136",0xB241],
- ["8238F137",0xB242],
- ["8238F138",0xB243],
- ["8238F139",0xB244],
- ["8238F230",0xB245],
- ["8238F231",0xB246],
- ["8238F232",0xB247],
- ["8238F233",0xB248],
- ["8238F234",0xB249],
- ["8238F235",0xB24A],
- ["8238F236",0xB24B],
- ["8238F237",0xB24C],
- ["8238F238",0xB24D],
- ["8238F239",0xB24E],
- ["8238F330",0xB24F],
- ["8238F331",0xB250],
- ["8238F332",0xB251],
- ["8238F333",0xB252],
- ["8238F334",0xB253],
- ["8238F335",0xB254],
- ["8238F336",0xB255],
- ["8238F337",0xB256],
- ["8238F338",0xB257],
- ["8238F339",0xB258],
- ["8238F430",0xB259],
- ["8238F431",0xB25A],
- ["8238F432",0xB25B],
- ["8238F433",0xB25C],
- ["8238F434",0xB25D],
- ["8238F435",0xB25E],
- ["8238F436",0xB25F],
- ["8238F437",0xB260],
- ["8238F438",0xB261],
- ["8238F439",0xB262],
- ["8238F530",0xB263],
- ["8238F531",0xB264],
- ["8238F532",0xB265],
- ["8238F533",0xB266],
- ["8238F534",0xB267],
- ["8238F535",0xB268],
- ["8238F536",0xB269],
- ["8238F537",0xB26A],
- ["8238F538",0xB26B],
- ["8238F539",0xB26C],
- ["8238F630",0xB26D],
- ["8238F631",0xB26E],
- ["8238F632",0xB26F],
- ["8238F633",0xB270],
- ["8238F634",0xB271],
- ["8238F635",0xB272],
- ["8238F636",0xB273],
- ["8238F637",0xB274],
- ["8238F638",0xB275],
- ["8238F639",0xB276],
- ["8238F730",0xB277],
- ["8238F731",0xB278],
- ["8238F732",0xB279],
- ["8238F733",0xB27A],
- ["8238F734",0xB27B],
- ["8238F735",0xB27C],
- ["8238F736",0xB27D],
- ["8238F737",0xB27E],
- ["8238F738",0xB27F],
- ["8238F739",0xB280],
- ["8238F830",0xB281],
- ["8238F831",0xB282],
- ["8238F832",0xB283],
- ["8238F833",0xB284],
- ["8238F834",0xB285],
- ["8238F835",0xB286],
- ["8238F836",0xB287],
- ["8238F837",0xB288],
- ["8238F838",0xB289],
- ["8238F839",0xB28A],
- ["8238F930",0xB28B],
- ["8238F931",0xB28C],
- ["8238F932",0xB28D],
- ["8238F933",0xB28E],
- ["8238F934",0xB28F],
- ["8238F935",0xB290],
- ["8238F936",0xB291],
- ["8238F937",0xB292],
- ["8238F938",0xB293],
- ["8238F939",0xB294],
- ["8238FA30",0xB295],
- ["8238FA31",0xB296],
- ["8238FA32",0xB297],
- ["8238FA33",0xB298],
- ["8238FA34",0xB299],
- ["8238FA35",0xB29A],
- ["8238FA36",0xB29B],
- ["8238FA37",0xB29C],
- ["8238FA38",0xB29D],
- ["8238FA39",0xB29E],
- ["8238FB30",0xB29F],
- ["8238FB31",0xB2A0],
- ["8238FB32",0xB2A1],
- ["8238FB33",0xB2A2],
- ["8238FB34",0xB2A3],
- ["8238FB35",0xB2A4],
- ["8238FB36",0xB2A5],
- ["8238FB37",0xB2A6],
- ["8238FB38",0xB2A7],
- ["8238FB39",0xB2A8],
- ["8238FC30",0xB2A9],
- ["8238FC31",0xB2AA],
- ["8238FC32",0xB2AB],
- ["8238FC33",0xB2AC],
- ["8238FC34",0xB2AD],
- ["8238FC35",0xB2AE],
- ["8238FC36",0xB2AF],
- ["8238FC37",0xB2B0],
- ["8238FC38",0xB2B1],
- ["8238FC39",0xB2B2],
- ["8238FD30",0xB2B3],
- ["8238FD31",0xB2B4],
- ["8238FD32",0xB2B5],
- ["8238FD33",0xB2B6],
- ["8238FD34",0xB2B7],
- ["8238FD35",0xB2B8],
- ["8238FD36",0xB2B9],
- ["8238FD37",0xB2BA],
- ["8238FD38",0xB2BB],
- ["8238FD39",0xB2BC],
- ["8238FE30",0xB2BD],
- ["8238FE31",0xB2BE],
- ["8238FE32",0xB2BF],
- ["8238FE33",0xB2C0],
- ["8238FE34",0xB2C1],
- ["8238FE35",0xB2C2],
- ["8238FE36",0xB2C3],
- ["8238FE37",0xB2C4],
- ["8238FE38",0xB2C5],
- ["8238FE39",0xB2C6],
- ["82398130",0xB2C7],
- ["82398131",0xB2C8],
- ["82398132",0xB2C9],
- ["82398133",0xB2CA],
- ["82398134",0xB2CB],
- ["82398135",0xB2CC],
- ["82398136",0xB2CD],
- ["82398137",0xB2CE],
- ["82398138",0xB2CF],
- ["82398139",0xB2D0],
- ["82398230",0xB2D1],
- ["82398231",0xB2D2],
- ["82398232",0xB2D3],
- ["82398233",0xB2D4],
- ["82398234",0xB2D5],
- ["82398235",0xB2D6],
- ["82398236",0xB2D7],
- ["82398237",0xB2D8],
- ["82398238",0xB2D9],
- ["82398239",0xB2DA],
- ["82398330",0xB2DB],
- ["82398331",0xB2DC],
- ["82398332",0xB2DD],
- ["82398333",0xB2DE],
- ["82398334",0xB2DF],
- ["82398335",0xB2E0],
- ["82398336",0xB2E1],
- ["82398337",0xB2E2],
- ["82398338",0xB2E3],
- ["82398339",0xB2E4],
- ["82398430",0xB2E5],
- ["82398431",0xB2E6],
- ["82398432",0xB2E7],
- ["82398433",0xB2E8],
- ["82398434",0xB2E9],
- ["82398435",0xB2EA],
- ["82398436",0xB2EB],
- ["82398437",0xB2EC],
- ["82398438",0xB2ED],
- ["82398439",0xB2EE],
- ["82398530",0xB2EF],
- ["82398531",0xB2F0],
- ["82398532",0xB2F1],
- ["82398533",0xB2F2],
- ["82398534",0xB2F3],
- ["82398535",0xB2F4],
- ["82398536",0xB2F5],
- ["82398537",0xB2F6],
- ["82398538",0xB2F7],
- ["82398539",0xB2F8],
- ["82398630",0xB2F9],
- ["82398631",0xB2FA],
- ["82398632",0xB2FB],
- ["82398633",0xB2FC],
- ["82398634",0xB2FD],
- ["82398635",0xB2FE],
- ["82398636",0xB2FF],
- ["82398637",0xB300],
- ["82398638",0xB301],
- ["82398639",0xB302],
- ["82398730",0xB303],
- ["82398731",0xB304],
- ["82398732",0xB305],
- ["82398733",0xB306],
- ["82398734",0xB307],
- ["82398735",0xB308],
- ["82398736",0xB309],
- ["82398737",0xB30A],
- ["82398738",0xB30B],
- ["82398739",0xB30C],
- ["82398830",0xB30D],
- ["82398831",0xB30E],
- ["82398832",0xB30F],
- ["82398833",0xB310],
- ["82398834",0xB311],
- ["82398835",0xB312],
- ["82398836",0xB313],
- ["82398837",0xB314],
- ["82398838",0xB315],
- ["82398839",0xB316],
- ["82398930",0xB317],
- ["82398931",0xB318],
- ["82398932",0xB319],
- ["82398933",0xB31A],
- ["82398934",0xB31B],
- ["82398935",0xB31C],
- ["82398936",0xB31D],
- ["82398937",0xB31E],
- ["82398938",0xB31F],
- ["82398939",0xB320],
- ["82398A30",0xB321],
- ["82398A31",0xB322],
- ["82398A32",0xB323],
- ["82398A33",0xB324],
- ["82398A34",0xB325],
- ["82398A35",0xB326],
- ["82398A36",0xB327],
- ["82398A37",0xB328],
- ["82398A38",0xB329],
- ["82398A39",0xB32A],
- ["82398B30",0xB32B],
- ["82398B31",0xB32C],
- ["82398B32",0xB32D],
- ["82398B33",0xB32E],
- ["82398B34",0xB32F],
- ["82398B35",0xB330],
- ["82398B36",0xB331],
- ["82398B37",0xB332],
- ["82398B38",0xB333],
- ["82398B39",0xB334],
- ["82398C30",0xB335],
- ["82398C31",0xB336],
- ["82398C32",0xB337],
- ["82398C33",0xB338],
- ["82398C34",0xB339],
- ["82398C35",0xB33A],
- ["82398C36",0xB33B],
- ["82398C37",0xB33C],
- ["82398C38",0xB33D],
- ["82398C39",0xB33E],
- ["82398D30",0xB33F],
- ["82398D31",0xB340],
- ["82398D32",0xB341],
- ["82398D33",0xB342],
- ["82398D34",0xB343],
- ["82398D35",0xB344],
- ["82398D36",0xB345],
- ["82398D37",0xB346],
- ["82398D38",0xB347],
- ["82398D39",0xB348],
- ["82398E30",0xB349],
- ["82398E31",0xB34A],
- ["82398E32",0xB34B],
- ["82398E33",0xB34C],
- ["82398E34",0xB34D],
- ["82398E35",0xB34E],
- ["82398E36",0xB34F],
- ["82398E37",0xB350],
- ["82398E38",0xB351],
- ["82398E39",0xB352],
- ["82398F30",0xB353],
- ["82398F31",0xB354],
- ["82398F32",0xB355],
- ["82398F33",0xB356],
- ["82398F34",0xB357],
- ["82398F35",0xB358],
- ["82398F36",0xB359],
- ["82398F37",0xB35A],
- ["82398F38",0xB35B],
- ["82398F39",0xB35C],
- ["82399030",0xB35D],
- ["82399031",0xB35E],
- ["82399032",0xB35F],
- ["82399033",0xB360],
- ["82399034",0xB361],
- ["82399035",0xB362],
- ["82399036",0xB363],
- ["82399037",0xB364],
- ["82399038",0xB365],
- ["82399039",0xB366],
- ["82399130",0xB367],
- ["82399131",0xB368],
- ["82399132",0xB369],
- ["82399133",0xB36A],
- ["82399134",0xB36B],
- ["82399135",0xB36C],
- ["82399136",0xB36D],
- ["82399137",0xB36E],
- ["82399138",0xB36F],
- ["82399139",0xB370],
- ["82399230",0xB371],
- ["82399231",0xB372],
- ["82399232",0xB373],
- ["82399233",0xB374],
- ["82399234",0xB375],
- ["82399235",0xB376],
- ["82399236",0xB377],
- ["82399237",0xB378],
- ["82399238",0xB379],
- ["82399239",0xB37A],
- ["82399330",0xB37B],
- ["82399331",0xB37C],
- ["82399332",0xB37D],
- ["82399333",0xB37E],
- ["82399334",0xB37F],
- ["82399335",0xB380],
- ["82399336",0xB381],
- ["82399337",0xB382],
- ["82399338",0xB383],
- ["82399339",0xB384],
- ["82399430",0xB385],
- ["82399431",0xB386],
- ["82399432",0xB387],
- ["82399433",0xB388],
- ["82399434",0xB389],
- ["82399435",0xB38A],
- ["82399436",0xB38B],
- ["82399437",0xB38C],
- ["82399438",0xB38D],
- ["82399439",0xB38E],
- ["82399530",0xB38F],
- ["82399531",0xB390],
- ["82399532",0xB391],
- ["82399533",0xB392],
- ["82399534",0xB393],
- ["82399535",0xB394],
- ["82399536",0xB395],
- ["82399537",0xB396],
- ["82399538",0xB397],
- ["82399539",0xB398],
- ["82399630",0xB399],
- ["82399631",0xB39A],
- ["82399632",0xB39B],
- ["82399633",0xB39C],
- ["82399634",0xB39D],
- ["82399635",0xB39E],
- ["82399636",0xB39F],
- ["82399637",0xB3A0],
- ["82399638",0xB3A1],
- ["82399639",0xB3A2],
- ["82399730",0xB3A3],
- ["82399731",0xB3A4],
- ["82399732",0xB3A5],
- ["82399733",0xB3A6],
- ["82399734",0xB3A7],
- ["82399735",0xB3A8],
- ["82399736",0xB3A9],
- ["82399737",0xB3AA],
- ["82399738",0xB3AB],
- ["82399739",0xB3AC],
- ["82399830",0xB3AD],
- ["82399831",0xB3AE],
- ["82399832",0xB3AF],
- ["82399833",0xB3B0],
- ["82399834",0xB3B1],
- ["82399835",0xB3B2],
- ["82399836",0xB3B3],
- ["82399837",0xB3B4],
- ["82399838",0xB3B5],
- ["82399839",0xB3B6],
- ["82399930",0xB3B7],
- ["82399931",0xB3B8],
- ["82399932",0xB3B9],
- ["82399933",0xB3BA],
- ["82399934",0xB3BB],
- ["82399935",0xB3BC],
- ["82399936",0xB3BD],
- ["82399937",0xB3BE],
- ["82399938",0xB3BF],
- ["82399939",0xB3C0],
- ["82399A30",0xB3C1],
- ["82399A31",0xB3C2],
- ["82399A32",0xB3C3],
- ["82399A33",0xB3C4],
- ["82399A34",0xB3C5],
- ["82399A35",0xB3C6],
- ["82399A36",0xB3C7],
- ["82399A37",0xB3C8],
- ["82399A38",0xB3C9],
- ["82399A39",0xB3CA],
- ["82399B30",0xB3CB],
- ["82399B31",0xB3CC],
- ["82399B32",0xB3CD],
- ["82399B33",0xB3CE],
- ["82399B34",0xB3CF],
- ["82399B35",0xB3D0],
- ["82399B36",0xB3D1],
- ["82399B37",0xB3D2],
- ["82399B38",0xB3D3],
- ["82399B39",0xB3D4],
- ["82399C30",0xB3D5],
- ["82399C31",0xB3D6],
- ["82399C32",0xB3D7],
- ["82399C33",0xB3D8],
- ["82399C34",0xB3D9],
- ["82399C35",0xB3DA],
- ["82399C36",0xB3DB],
- ["82399C37",0xB3DC],
- ["82399C38",0xB3DD],
- ["82399C39",0xB3DE],
- ["82399D30",0xB3DF],
- ["82399D31",0xB3E0],
- ["82399D32",0xB3E1],
- ["82399D33",0xB3E2],
- ["82399D34",0xB3E3],
- ["82399D35",0xB3E4],
- ["82399D36",0xB3E5],
- ["82399D37",0xB3E6],
- ["82399D38",0xB3E7],
- ["82399D39",0xB3E8],
- ["82399E30",0xB3E9],
- ["82399E31",0xB3EA],
- ["82399E32",0xB3EB],
- ["82399E33",0xB3EC],
- ["82399E34",0xB3ED],
- ["82399E35",0xB3EE],
- ["82399E36",0xB3EF],
- ["82399E37",0xB3F0],
- ["82399E38",0xB3F1],
- ["82399E39",0xB3F2],
- ["82399F30",0xB3F3],
- ["82399F31",0xB3F4],
- ["82399F32",0xB3F5],
- ["82399F33",0xB3F6],
- ["82399F34",0xB3F7],
- ["82399F35",0xB3F8],
- ["82399F36",0xB3F9],
- ["82399F37",0xB3FA],
- ["82399F38",0xB3FB],
- ["82399F39",0xB3FC],
- ["8239A030",0xB3FD],
- ["8239A031",0xB3FE],
- ["8239A032",0xB3FF],
- ["8239A033",0xB400],
- ["8239A034",0xB401],
- ["8239A035",0xB402],
- ["8239A036",0xB403],
- ["8239A037",0xB404],
- ["8239A038",0xB405],
- ["8239A039",0xB406],
- ["8239A130",0xB407],
- ["8239A131",0xB408],
- ["8239A132",0xB409],
- ["8239A133",0xB40A],
- ["8239A134",0xB40B],
- ["8239A135",0xB40C],
- ["8239A136",0xB40D],
- ["8239A137",0xB40E],
- ["8239A138",0xB40F],
- ["8239A139",0xB410],
- ["8239A230",0xB411],
- ["8239A231",0xB412],
- ["8239A232",0xB413],
- ["8239A233",0xB414],
- ["8239A234",0xB415],
- ["8239A235",0xB416],
- ["8239A236",0xB417],
- ["8239A237",0xB418],
- ["8239A238",0xB419],
- ["8239A239",0xB41A],
- ["8239A330",0xB41B],
- ["8239A331",0xB41C],
- ["8239A332",0xB41D],
- ["8239A333",0xB41E],
- ["8239A334",0xB41F],
- ["8239A335",0xB420],
- ["8239A336",0xB421],
- ["8239A337",0xB422],
- ["8239A338",0xB423],
- ["8239A339",0xB424],
- ["8239A430",0xB425],
- ["8239A431",0xB426],
- ["8239A432",0xB427],
- ["8239A433",0xB428],
- ["8239A434",0xB429],
- ["8239A435",0xB42A],
- ["8239A436",0xB42B],
- ["8239A437",0xB42C],
- ["8239A438",0xB42D],
- ["8239A439",0xB42E],
- ["8239A530",0xB42F],
- ["8239A531",0xB430],
- ["8239A532",0xB431],
- ["8239A533",0xB432],
- ["8239A534",0xB433],
- ["8239A535",0xB434],
- ["8239A536",0xB435],
- ["8239A537",0xB436],
- ["8239A538",0xB437],
- ["8239A539",0xB438],
- ["8239A630",0xB439],
- ["8239A631",0xB43A],
- ["8239A632",0xB43B],
- ["8239A633",0xB43C],
- ["8239A634",0xB43D],
- ["8239A635",0xB43E],
- ["8239A636",0xB43F],
- ["8239A637",0xB440],
- ["8239A638",0xB441],
- ["8239A639",0xB442],
- ["8239A730",0xB443],
- ["8239A731",0xB444],
- ["8239A732",0xB445],
- ["8239A733",0xB446],
- ["8239A734",0xB447],
- ["8239A735",0xB448],
- ["8239A736",0xB449],
- ["8239A737",0xB44A],
- ["8239A738",0xB44B],
- ["8239A739",0xB44C],
- ["8239A830",0xB44D],
- ["8239A831",0xB44E],
- ["8239A832",0xB44F],
- ["8239A833",0xB450],
- ["8239A834",0xB451],
- ["8239A835",0xB452],
- ["8239A836",0xB453],
- ["8239A837",0xB454],
- ["8239A838",0xB455],
- ["8239A839",0xB456],
- ["8239A930",0xB457],
- ["8239A931",0xB458],
- ["8239A932",0xB459],
- ["8239A933",0xB45A],
- ["8239A934",0xB45B],
- ["8239A935",0xB45C],
- ["8239A936",0xB45D],
- ["8239A937",0xB45E],
- ["8239A938",0xB45F],
- ["8239A939",0xB460],
- ["8239AA30",0xB461],
- ["8239AA31",0xB462],
- ["8239AA32",0xB463],
- ["8239AA33",0xB464],
- ["8239AA34",0xB465],
- ["8239AA35",0xB466],
- ["8239AA36",0xB467],
- ["8239AA37",0xB468],
- ["8239AA38",0xB469],
- ["8239AA39",0xB46A],
- ["8239AB30",0xB46B],
- ["8239AB31",0xB46C],
- ["8239AB32",0xB46D],
- ["8239AB33",0xB46E],
- ["8239AB34",0xB46F],
- ["8239AB35",0xB470],
- ["8239AB36",0xB471],
- ["8239AB37",0xB472],
- ["8239AB38",0xB473],
- ["8239AB39",0xB474],
- ["8239AC30",0xB475],
- ["8239AC31",0xB476],
- ["8239AC32",0xB477],
- ["8239AC33",0xB478],
- ["8239AC34",0xB479],
- ["8239AC35",0xB47A],
- ["8239AC36",0xB47B],
- ["8239AC37",0xB47C],
- ["8239AC38",0xB47D],
- ["8239AC39",0xB47E],
- ["8239AD30",0xB47F],
- ["8239AD31",0xB480],
- ["8239AD32",0xB481],
- ["8239AD33",0xB482],
- ["8239AD34",0xB483],
- ["8239AD35",0xB484],
- ["8239AD36",0xB485],
- ["8239AD37",0xB486],
- ["8239AD38",0xB487],
- ["8239AD39",0xB488],
- ["8239AE30",0xB489],
- ["8239AE31",0xB48A],
- ["8239AE32",0xB48B],
- ["8239AE33",0xB48C],
- ["8239AE34",0xB48D],
- ["8239AE35",0xB48E],
- ["8239AE36",0xB48F],
- ["8239AE37",0xB490],
- ["8239AE38",0xB491],
- ["8239AE39",0xB492],
- ["8239AF30",0xB493],
- ["8239AF31",0xB494],
- ["8239AF32",0xB495],
- ["8239AF33",0xB496],
- ["8239AF34",0xB497],
- ["8239AF35",0xB498],
- ["8239AF36",0xB499],
- ["8239AF37",0xB49A],
- ["8239AF38",0xB49B],
- ["8239AF39",0xB49C],
- ["8239B030",0xB49D],
- ["8239B031",0xB49E],
- ["8239B032",0xB49F],
- ["8239B033",0xB4A0],
- ["8239B034",0xB4A1],
- ["8239B035",0xB4A2],
- ["8239B036",0xB4A3],
- ["8239B037",0xB4A4],
- ["8239B038",0xB4A5],
- ["8239B039",0xB4A6],
- ["8239B130",0xB4A7],
- ["8239B131",0xB4A8],
- ["8239B132",0xB4A9],
- ["8239B133",0xB4AA],
- ["8239B134",0xB4AB],
- ["8239B135",0xB4AC],
- ["8239B136",0xB4AD],
- ["8239B137",0xB4AE],
- ["8239B138",0xB4AF],
- ["8239B139",0xB4B0],
- ["8239B230",0xB4B1],
- ["8239B231",0xB4B2],
- ["8239B232",0xB4B3],
- ["8239B233",0xB4B4],
- ["8239B234",0xB4B5],
- ["8239B235",0xB4B6],
- ["8239B236",0xB4B7],
- ["8239B237",0xB4B8],
- ["8239B238",0xB4B9],
- ["8239B239",0xB4BA],
- ["8239B330",0xB4BB],
- ["8239B331",0xB4BC],
- ["8239B332",0xB4BD],
- ["8239B333",0xB4BE],
- ["8239B334",0xB4BF],
- ["8239B335",0xB4C0],
- ["8239B336",0xB4C1],
- ["8239B337",0xB4C2],
- ["8239B338",0xB4C3],
- ["8239B339",0xB4C4],
- ["8239B430",0xB4C5],
- ["8239B431",0xB4C6],
- ["8239B432",0xB4C7],
- ["8239B433",0xB4C8],
- ["8239B434",0xB4C9],
- ["8239B435",0xB4CA],
- ["8239B436",0xB4CB],
- ["8239B437",0xB4CC],
- ["8239B438",0xB4CD],
- ["8239B439",0xB4CE],
- ["8239B530",0xB4CF],
- ["8239B531",0xB4D0],
- ["8239B532",0xB4D1],
- ["8239B533",0xB4D2],
- ["8239B534",0xB4D3],
- ["8239B535",0xB4D4],
- ["8239B536",0xB4D5],
- ["8239B537",0xB4D6],
- ["8239B538",0xB4D7],
- ["8239B539",0xB4D8],
- ["8239B630",0xB4D9],
- ["8239B631",0xB4DA],
- ["8239B632",0xB4DB],
- ["8239B633",0xB4DC],
- ["8239B634",0xB4DD],
- ["8239B635",0xB4DE],
- ["8239B636",0xB4DF],
- ["8239B637",0xB4E0],
- ["8239B638",0xB4E1],
- ["8239B639",0xB4E2],
- ["8239B730",0xB4E3],
- ["8239B731",0xB4E4],
- ["8239B732",0xB4E5],
- ["8239B733",0xB4E6],
- ["8239B734",0xB4E7],
- ["8239B735",0xB4E8],
- ["8239B736",0xB4E9],
- ["8239B737",0xB4EA],
- ["8239B738",0xB4EB],
- ["8239B739",0xB4EC],
- ["8239B830",0xB4ED],
- ["8239B831",0xB4EE],
- ["8239B832",0xB4EF],
- ["8239B833",0xB4F0],
- ["8239B834",0xB4F1],
- ["8239B835",0xB4F2],
- ["8239B836",0xB4F3],
- ["8239B837",0xB4F4],
- ["8239B838",0xB4F5],
- ["8239B839",0xB4F6],
- ["8239B930",0xB4F7],
- ["8239B931",0xB4F8],
- ["8239B932",0xB4F9],
- ["8239B933",0xB4FA],
- ["8239B934",0xB4FB],
- ["8239B935",0xB4FC],
- ["8239B936",0xB4FD],
- ["8239B937",0xB4FE],
- ["8239B938",0xB4FF],
- ["8239B939",0xB500],
- ["8239BA30",0xB501],
- ["8239BA31",0xB502],
- ["8239BA32",0xB503],
- ["8239BA33",0xB504],
- ["8239BA34",0xB505],
- ["8239BA35",0xB506],
- ["8239BA36",0xB507],
- ["8239BA37",0xB508],
- ["8239BA38",0xB509],
- ["8239BA39",0xB50A],
- ["8239BB30",0xB50B],
- ["8239BB31",0xB50C],
- ["8239BB32",0xB50D],
- ["8239BB33",0xB50E],
- ["8239BB34",0xB50F],
- ["8239BB35",0xB510],
- ["8239BB36",0xB511],
- ["8239BB37",0xB512],
- ["8239BB38",0xB513],
- ["8239BB39",0xB514],
- ["8239BC30",0xB515],
- ["8239BC31",0xB516],
- ["8239BC32",0xB517],
- ["8239BC33",0xB518],
- ["8239BC34",0xB519],
- ["8239BC35",0xB51A],
- ["8239BC36",0xB51B],
- ["8239BC37",0xB51C],
- ["8239BC38",0xB51D],
- ["8239BC39",0xB51E],
- ["8239BD30",0xB51F],
- ["8239BD31",0xB520],
- ["8239BD32",0xB521],
- ["8239BD33",0xB522],
- ["8239BD34",0xB523],
- ["8239BD35",0xB524],
- ["8239BD36",0xB525],
- ["8239BD37",0xB526],
- ["8239BD38",0xB527],
- ["8239BD39",0xB528],
- ["8239BE30",0xB529],
- ["8239BE31",0xB52A],
- ["8239BE32",0xB52B],
- ["8239BE33",0xB52C],
- ["8239BE34",0xB52D],
- ["8239BE35",0xB52E],
- ["8239BE36",0xB52F],
- ["8239BE37",0xB530],
- ["8239BE38",0xB531],
- ["8239BE39",0xB532],
- ["8239BF30",0xB533],
- ["8239BF31",0xB534],
- ["8239BF32",0xB535],
- ["8239BF33",0xB536],
- ["8239BF34",0xB537],
- ["8239BF35",0xB538],
- ["8239BF36",0xB539],
- ["8239BF37",0xB53A],
- ["8239BF38",0xB53B],
- ["8239BF39",0xB53C],
- ["8239C030",0xB53D],
- ["8239C031",0xB53E],
- ["8239C032",0xB53F],
- ["8239C033",0xB540],
- ["8239C034",0xB541],
- ["8239C035",0xB542],
- ["8239C036",0xB543],
- ["8239C037",0xB544],
- ["8239C038",0xB545],
- ["8239C039",0xB546],
- ["8239C130",0xB547],
- ["8239C131",0xB548],
- ["8239C132",0xB549],
- ["8239C133",0xB54A],
- ["8239C134",0xB54B],
- ["8239C135",0xB54C],
- ["8239C136",0xB54D],
- ["8239C137",0xB54E],
- ["8239C138",0xB54F],
- ["8239C139",0xB550],
- ["8239C230",0xB551],
- ["8239C231",0xB552],
- ["8239C232",0xB553],
- ["8239C233",0xB554],
- ["8239C234",0xB555],
- ["8239C235",0xB556],
- ["8239C236",0xB557],
- ["8239C237",0xB558],
- ["8239C238",0xB559],
- ["8239C239",0xB55A],
- ["8239C330",0xB55B],
- ["8239C331",0xB55C],
- ["8239C332",0xB55D],
- ["8239C333",0xB55E],
- ["8239C334",0xB55F],
- ["8239C335",0xB560],
- ["8239C336",0xB561],
- ["8239C337",0xB562],
- ["8239C338",0xB563],
- ["8239C339",0xB564],
- ["8239C430",0xB565],
- ["8239C431",0xB566],
- ["8239C432",0xB567],
- ["8239C433",0xB568],
- ["8239C434",0xB569],
- ["8239C435",0xB56A],
- ["8239C436",0xB56B],
- ["8239C437",0xB56C],
- ["8239C438",0xB56D],
- ["8239C439",0xB56E],
- ["8239C530",0xB56F],
- ["8239C531",0xB570],
- ["8239C532",0xB571],
- ["8239C533",0xB572],
- ["8239C534",0xB573],
- ["8239C535",0xB574],
- ["8239C536",0xB575],
- ["8239C537",0xB576],
- ["8239C538",0xB577],
- ["8239C539",0xB578],
- ["8239C630",0xB579],
- ["8239C631",0xB57A],
- ["8239C632",0xB57B],
- ["8239C633",0xB57C],
- ["8239C634",0xB57D],
- ["8239C635",0xB57E],
- ["8239C636",0xB57F],
- ["8239C637",0xB580],
- ["8239C638",0xB581],
- ["8239C639",0xB582],
- ["8239C730",0xB583],
- ["8239C731",0xB584],
- ["8239C732",0xB585],
- ["8239C733",0xB586],
- ["8239C734",0xB587],
- ["8239C735",0xB588],
- ["8239C736",0xB589],
- ["8239C737",0xB58A],
- ["8239C738",0xB58B],
- ["8239C739",0xB58C],
- ["8239C830",0xB58D],
- ["8239C831",0xB58E],
- ["8239C832",0xB58F],
- ["8239C833",0xB590],
- ["8239C834",0xB591],
- ["8239C835",0xB592],
- ["8239C836",0xB593],
- ["8239C837",0xB594],
- ["8239C838",0xB595],
- ["8239C839",0xB596],
- ["8239C930",0xB597],
- ["8239C931",0xB598],
- ["8239C932",0xB599],
- ["8239C933",0xB59A],
- ["8239C934",0xB59B],
- ["8239C935",0xB59C],
- ["8239C936",0xB59D],
- ["8239C937",0xB59E],
- ["8239C938",0xB59F],
- ["8239C939",0xB5A0],
- ["8239CA30",0xB5A1],
- ["8239CA31",0xB5A2],
- ["8239CA32",0xB5A3],
- ["8239CA33",0xB5A4],
- ["8239CA34",0xB5A5],
- ["8239CA35",0xB5A6],
- ["8239CA36",0xB5A7],
- ["8239CA37",0xB5A8],
- ["8239CA38",0xB5A9],
- ["8239CA39",0xB5AA],
- ["8239CB30",0xB5AB],
- ["8239CB31",0xB5AC],
- ["8239CB32",0xB5AD],
- ["8239CB33",0xB5AE],
- ["8239CB34",0xB5AF],
- ["8239CB35",0xB5B0],
- ["8239CB36",0xB5B1],
- ["8239CB37",0xB5B2],
- ["8239CB38",0xB5B3],
- ["8239CB39",0xB5B4],
- ["8239CC30",0xB5B5],
- ["8239CC31",0xB5B6],
- ["8239CC32",0xB5B7],
- ["8239CC33",0xB5B8],
- ["8239CC34",0xB5B9],
- ["8239CC35",0xB5BA],
- ["8239CC36",0xB5BB],
- ["8239CC37",0xB5BC],
- ["8239CC38",0xB5BD],
- ["8239CC39",0xB5BE],
- ["8239CD30",0xB5BF],
- ["8239CD31",0xB5C0],
- ["8239CD32",0xB5C1],
- ["8239CD33",0xB5C2],
- ["8239CD34",0xB5C3],
- ["8239CD35",0xB5C4],
- ["8239CD36",0xB5C5],
- ["8239CD37",0xB5C6],
- ["8239CD38",0xB5C7],
- ["8239CD39",0xB5C8],
- ["8239CE30",0xB5C9],
- ["8239CE31",0xB5CA],
- ["8239CE32",0xB5CB],
- ["8239CE33",0xB5CC],
- ["8239CE34",0xB5CD],
- ["8239CE35",0xB5CE],
- ["8239CE36",0xB5CF],
- ["8239CE37",0xB5D0],
- ["8239CE38",0xB5D1],
- ["8239CE39",0xB5D2],
- ["8239CF30",0xB5D3],
- ["8239CF31",0xB5D4],
- ["8239CF32",0xB5D5],
- ["8239CF33",0xB5D6],
- ["8239CF34",0xB5D7],
- ["8239CF35",0xB5D8],
- ["8239CF36",0xB5D9],
- ["8239CF37",0xB5DA],
- ["8239CF38",0xB5DB],
- ["8239CF39",0xB5DC],
- ["8239D030",0xB5DD],
- ["8239D031",0xB5DE],
- ["8239D032",0xB5DF],
- ["8239D033",0xB5E0],
- ["8239D034",0xB5E1],
- ["8239D035",0xB5E2],
- ["8239D036",0xB5E3],
- ["8239D037",0xB5E4],
- ["8239D038",0xB5E5],
- ["8239D039",0xB5E6],
- ["8239D130",0xB5E7],
- ["8239D131",0xB5E8],
- ["8239D132",0xB5E9],
- ["8239D133",0xB5EA],
- ["8239D134",0xB5EB],
- ["8239D135",0xB5EC],
- ["8239D136",0xB5ED],
- ["8239D137",0xB5EE],
- ["8239D138",0xB5EF],
- ["8239D139",0xB5F0],
- ["8239D230",0xB5F1],
- ["8239D231",0xB5F2],
- ["8239D232",0xB5F3],
- ["8239D233",0xB5F4],
- ["8239D234",0xB5F5],
- ["8239D235",0xB5F6],
- ["8239D236",0xB5F7],
- ["8239D237",0xB5F8],
- ["8239D238",0xB5F9],
- ["8239D239",0xB5FA],
- ["8239D330",0xB5FB],
- ["8239D331",0xB5FC],
- ["8239D332",0xB5FD],
- ["8239D333",0xB5FE],
- ["8239D334",0xB5FF],
- ["8239D335",0xB600],
- ["8239D336",0xB601],
- ["8239D337",0xB602],
- ["8239D338",0xB603],
- ["8239D339",0xB604],
- ["8239D430",0xB605],
- ["8239D431",0xB606],
- ["8239D432",0xB607],
- ["8239D433",0xB608],
- ["8239D434",0xB609],
- ["8239D435",0xB60A],
- ["8239D436",0xB60B],
- ["8239D437",0xB60C],
- ["8239D438",0xB60D],
- ["8239D439",0xB60E],
- ["8239D530",0xB60F],
- ["8239D531",0xB610],
- ["8239D532",0xB611],
- ["8239D533",0xB612],
- ["8239D534",0xB613],
- ["8239D535",0xB614],
- ["8239D536",0xB615],
- ["8239D537",0xB616],
- ["8239D538",0xB617],
- ["8239D539",0xB618],
- ["8239D630",0xB619],
- ["8239D631",0xB61A],
- ["8239D632",0xB61B],
- ["8239D633",0xB61C],
- ["8239D634",0xB61D],
- ["8239D635",0xB61E],
- ["8239D636",0xB61F],
- ["8239D637",0xB620],
- ["8239D638",0xB621],
- ["8239D639",0xB622],
- ["8239D730",0xB623],
- ["8239D731",0xB624],
- ["8239D732",0xB625],
- ["8239D733",0xB626],
- ["8239D734",0xB627],
- ["8239D735",0xB628],
- ["8239D736",0xB629],
- ["8239D737",0xB62A],
- ["8239D738",0xB62B],
- ["8239D739",0xB62C],
- ["8239D830",0xB62D],
- ["8239D831",0xB62E],
- ["8239D832",0xB62F],
- ["8239D833",0xB630],
- ["8239D834",0xB631],
- ["8239D835",0xB632],
- ["8239D836",0xB633],
- ["8239D837",0xB634],
- ["8239D838",0xB635],
- ["8239D839",0xB636],
- ["8239D930",0xB637],
- ["8239D931",0xB638],
- ["8239D932",0xB639],
- ["8239D933",0xB63A],
- ["8239D934",0xB63B],
- ["8239D935",0xB63C],
- ["8239D936",0xB63D],
- ["8239D937",0xB63E],
- ["8239D938",0xB63F],
- ["8239D939",0xB640],
- ["8239DA30",0xB641],
- ["8239DA31",0xB642],
- ["8239DA32",0xB643],
- ["8239DA33",0xB644],
- ["8239DA34",0xB645],
- ["8239DA35",0xB646],
- ["8239DA36",0xB647],
- ["8239DA37",0xB648],
- ["8239DA38",0xB649],
- ["8239DA39",0xB64A],
- ["8239DB30",0xB64B],
- ["8239DB31",0xB64C],
- ["8239DB32",0xB64D],
- ["8239DB33",0xB64E],
- ["8239DB34",0xB64F],
- ["8239DB35",0xB650],
- ["8239DB36",0xB651],
- ["8239DB37",0xB652],
- ["8239DB38",0xB653],
- ["8239DB39",0xB654],
- ["8239DC30",0xB655],
- ["8239DC31",0xB656],
- ["8239DC32",0xB657],
- ["8239DC33",0xB658],
- ["8239DC34",0xB659],
- ["8239DC35",0xB65A],
- ["8239DC36",0xB65B],
- ["8239DC37",0xB65C],
- ["8239DC38",0xB65D],
- ["8239DC39",0xB65E],
- ["8239DD30",0xB65F],
- ["8239DD31",0xB660],
- ["8239DD32",0xB661],
- ["8239DD33",0xB662],
- ["8239DD34",0xB663],
- ["8239DD35",0xB664],
- ["8239DD36",0xB665],
- ["8239DD37",0xB666],
- ["8239DD38",0xB667],
- ["8239DD39",0xB668],
- ["8239DE30",0xB669],
- ["8239DE31",0xB66A],
- ["8239DE32",0xB66B],
- ["8239DE33",0xB66C],
- ["8239DE34",0xB66D],
- ["8239DE35",0xB66E],
- ["8239DE36",0xB66F],
- ["8239DE37",0xB670],
- ["8239DE38",0xB671],
- ["8239DE39",0xB672],
- ["8239DF30",0xB673],
- ["8239DF31",0xB674],
- ["8239DF32",0xB675],
- ["8239DF33",0xB676],
- ["8239DF34",0xB677],
- ["8239DF35",0xB678],
- ["8239DF36",0xB679],
- ["8239DF37",0xB67A],
- ["8239DF38",0xB67B],
- ["8239DF39",0xB67C],
- ["8239E030",0xB67D],
- ["8239E031",0xB67E],
- ["8239E032",0xB67F],
- ["8239E033",0xB680],
- ["8239E034",0xB681],
- ["8239E035",0xB682],
- ["8239E036",0xB683],
- ["8239E037",0xB684],
- ["8239E038",0xB685],
- ["8239E039",0xB686],
- ["8239E130",0xB687],
- ["8239E131",0xB688],
- ["8239E132",0xB689],
- ["8239E133",0xB68A],
- ["8239E134",0xB68B],
- ["8239E135",0xB68C],
- ["8239E136",0xB68D],
- ["8239E137",0xB68E],
- ["8239E138",0xB68F],
- ["8239E139",0xB690],
- ["8239E230",0xB691],
- ["8239E231",0xB692],
- ["8239E232",0xB693],
- ["8239E233",0xB694],
- ["8239E234",0xB695],
- ["8239E235",0xB696],
- ["8239E236",0xB697],
- ["8239E237",0xB698],
- ["8239E238",0xB699],
- ["8239E239",0xB69A],
- ["8239E330",0xB69B],
- ["8239E331",0xB69C],
- ["8239E332",0xB69D],
- ["8239E333",0xB69E],
- ["8239E334",0xB69F],
- ["8239E335",0xB6A0],
- ["8239E336",0xB6A1],
- ["8239E337",0xB6A2],
- ["8239E338",0xB6A3],
- ["8239E339",0xB6A4],
- ["8239E430",0xB6A5],
- ["8239E431",0xB6A6],
- ["8239E432",0xB6A7],
- ["8239E433",0xB6A8],
- ["8239E434",0xB6A9],
- ["8239E435",0xB6AA],
- ["8239E436",0xB6AB],
- ["8239E437",0xB6AC],
- ["8239E438",0xB6AD],
- ["8239E439",0xB6AE],
- ["8239E530",0xB6AF],
- ["8239E531",0xB6B0],
- ["8239E532",0xB6B1],
- ["8239E533",0xB6B2],
- ["8239E534",0xB6B3],
- ["8239E535",0xB6B4],
- ["8239E536",0xB6B5],
- ["8239E537",0xB6B6],
- ["8239E538",0xB6B7],
- ["8239E539",0xB6B8],
- ["8239E630",0xB6B9],
- ["8239E631",0xB6BA],
- ["8239E632",0xB6BB],
- ["8239E633",0xB6BC],
- ["8239E634",0xB6BD],
- ["8239E635",0xB6BE],
- ["8239E636",0xB6BF],
- ["8239E637",0xB6C0],
- ["8239E638",0xB6C1],
- ["8239E639",0xB6C2],
- ["8239E730",0xB6C3],
- ["8239E731",0xB6C4],
- ["8239E732",0xB6C5],
- ["8239E733",0xB6C6],
- ["8239E734",0xB6C7],
- ["8239E735",0xB6C8],
- ["8239E736",0xB6C9],
- ["8239E737",0xB6CA],
- ["8239E738",0xB6CB],
- ["8239E739",0xB6CC],
- ["8239E830",0xB6CD],
- ["8239E831",0xB6CE],
- ["8239E832",0xB6CF],
- ["8239E833",0xB6D0],
- ["8239E834",0xB6D1],
- ["8239E835",0xB6D2],
- ["8239E836",0xB6D3],
- ["8239E837",0xB6D4],
- ["8239E838",0xB6D5],
- ["8239E839",0xB6D6],
- ["8239E930",0xB6D7],
- ["8239E931",0xB6D8],
- ["8239E932",0xB6D9],
- ["8239E933",0xB6DA],
- ["8239E934",0xB6DB],
- ["8239E935",0xB6DC],
- ["8239E936",0xB6DD],
- ["8239E937",0xB6DE],
- ["8239E938",0xB6DF],
- ["8239E939",0xB6E0],
- ["8239EA30",0xB6E1],
- ["8239EA31",0xB6E2],
- ["8239EA32",0xB6E3],
- ["8239EA33",0xB6E4],
- ["8239EA34",0xB6E5],
- ["8239EA35",0xB6E6],
- ["8239EA36",0xB6E7],
- ["8239EA37",0xB6E8],
- ["8239EA38",0xB6E9],
- ["8239EA39",0xB6EA],
- ["8239EB30",0xB6EB],
- ["8239EB31",0xB6EC],
- ["8239EB32",0xB6ED],
- ["8239EB33",0xB6EE],
- ["8239EB34",0xB6EF],
- ["8239EB35",0xB6F0],
- ["8239EB36",0xB6F1],
- ["8239EB37",0xB6F2],
- ["8239EB38",0xB6F3],
- ["8239EB39",0xB6F4],
- ["8239EC30",0xB6F5],
- ["8239EC31",0xB6F6],
- ["8239EC32",0xB6F7],
- ["8239EC33",0xB6F8],
- ["8239EC34",0xB6F9],
- ["8239EC35",0xB6FA],
- ["8239EC36",0xB6FB],
- ["8239EC37",0xB6FC],
- ["8239EC38",0xB6FD],
- ["8239EC39",0xB6FE],
- ["8239ED30",0xB6FF],
- ["8239ED31",0xB700],
- ["8239ED32",0xB701],
- ["8239ED33",0xB702],
- ["8239ED34",0xB703],
- ["8239ED35",0xB704],
- ["8239ED36",0xB705],
- ["8239ED37",0xB706],
- ["8239ED38",0xB707],
- ["8239ED39",0xB708],
- ["8239EE30",0xB709],
- ["8239EE31",0xB70A],
- ["8239EE32",0xB70B],
- ["8239EE33",0xB70C],
- ["8239EE34",0xB70D],
- ["8239EE35",0xB70E],
- ["8239EE36",0xB70F],
- ["8239EE37",0xB710],
- ["8239EE38",0xB711],
- ["8239EE39",0xB712],
- ["8239EF30",0xB713],
- ["8239EF31",0xB714],
- ["8239EF32",0xB715],
- ["8239EF33",0xB716],
- ["8239EF34",0xB717],
- ["8239EF35",0xB718],
- ["8239EF36",0xB719],
- ["8239EF37",0xB71A],
- ["8239EF38",0xB71B],
- ["8239EF39",0xB71C],
- ["8239F030",0xB71D],
- ["8239F031",0xB71E],
- ["8239F032",0xB71F],
- ["8239F033",0xB720],
- ["8239F034",0xB721],
- ["8239F035",0xB722],
- ["8239F036",0xB723],
- ["8239F037",0xB724],
- ["8239F038",0xB725],
- ["8239F039",0xB726],
- ["8239F130",0xB727],
- ["8239F131",0xB728],
- ["8239F132",0xB729],
- ["8239F133",0xB72A],
- ["8239F134",0xB72B],
- ["8239F135",0xB72C],
- ["8239F136",0xB72D],
- ["8239F137",0xB72E],
- ["8239F138",0xB72F],
- ["8239F139",0xB730],
- ["8239F230",0xB731],
- ["8239F231",0xB732],
- ["8239F232",0xB733],
- ["8239F233",0xB734],
- ["8239F234",0xB735],
- ["8239F235",0xB736],
- ["8239F236",0xB737],
- ["8239F237",0xB738],
- ["8239F238",0xB739],
- ["8239F239",0xB73A],
- ["8239F330",0xB73B],
- ["8239F331",0xB73C],
- ["8239F332",0xB73D],
- ["8239F333",0xB73E],
- ["8239F334",0xB73F],
- ["8239F335",0xB740],
- ["8239F336",0xB741],
- ["8239F337",0xB742],
- ["8239F338",0xB743],
- ["8239F339",0xB744],
- ["8239F430",0xB745],
- ["8239F431",0xB746],
- ["8239F432",0xB747],
- ["8239F433",0xB748],
- ["8239F434",0xB749],
- ["8239F435",0xB74A],
- ["8239F436",0xB74B],
- ["8239F437",0xB74C],
- ["8239F438",0xB74D],
- ["8239F439",0xB74E],
- ["8239F530",0xB74F],
- ["8239F531",0xB750],
- ["8239F532",0xB751],
- ["8239F533",0xB752],
- ["8239F534",0xB753],
- ["8239F535",0xB754],
- ["8239F536",0xB755],
- ["8239F537",0xB756],
- ["8239F538",0xB757],
- ["8239F539",0xB758],
- ["8239F630",0xB759],
- ["8239F631",0xB75A],
- ["8239F632",0xB75B],
- ["8239F633",0xB75C],
- ["8239F634",0xB75D],
- ["8239F635",0xB75E],
- ["8239F636",0xB75F],
- ["8239F637",0xB760],
- ["8239F638",0xB761],
- ["8239F639",0xB762],
- ["8239F730",0xB763],
- ["8239F731",0xB764],
- ["8239F732",0xB765],
- ["8239F733",0xB766],
- ["8239F734",0xB767],
- ["8239F735",0xB768],
- ["8239F736",0xB769],
- ["8239F737",0xB76A],
- ["8239F738",0xB76B],
- ["8239F739",0xB76C],
- ["8239F830",0xB76D],
- ["8239F831",0xB76E],
- ["8239F832",0xB76F],
- ["8239F833",0xB770],
- ["8239F834",0xB771],
- ["8239F835",0xB772],
- ["8239F836",0xB773],
- ["8239F837",0xB774],
- ["8239F838",0xB775],
- ["8239F839",0xB776],
- ["8239F930",0xB777],
- ["8239F931",0xB778],
- ["8239F932",0xB779],
- ["8239F933",0xB77A],
- ["8239F934",0xB77B],
- ["8239F935",0xB77C],
- ["8239F936",0xB77D],
- ["8239F937",0xB77E],
- ["8239F938",0xB77F],
- ["8239F939",0xB780],
- ["8239FA30",0xB781],
- ["8239FA31",0xB782],
- ["8239FA32",0xB783],
- ["8239FA33",0xB784],
- ["8239FA34",0xB785],
- ["8239FA35",0xB786],
- ["8239FA36",0xB787],
- ["8239FA37",0xB788],
- ["8239FA38",0xB789],
- ["8239FA39",0xB78A],
- ["8239FB30",0xB78B],
- ["8239FB31",0xB78C],
- ["8239FB32",0xB78D],
- ["8239FB33",0xB78E],
- ["8239FB34",0xB78F],
- ["8239FB35",0xB790],
- ["8239FB36",0xB791],
- ["8239FB37",0xB792],
- ["8239FB38",0xB793],
- ["8239FB39",0xB794],
- ["8239FC30",0xB795],
- ["8239FC31",0xB796],
- ["8239FC32",0xB797],
- ["8239FC33",0xB798],
- ["8239FC34",0xB799],
- ["8239FC35",0xB79A],
- ["8239FC36",0xB79B],
- ["8239FC37",0xB79C],
- ["8239FC38",0xB79D],
- ["8239FC39",0xB79E],
- ["8239FD30",0xB79F],
- ["8239FD31",0xB7A0],
- ["8239FD32",0xB7A1],
- ["8239FD33",0xB7A2],
- ["8239FD34",0xB7A3],
- ["8239FD35",0xB7A4],
- ["8239FD36",0xB7A5],
- ["8239FD37",0xB7A6],
- ["8239FD38",0xB7A7],
- ["8239FD39",0xB7A8],
- ["8239FE30",0xB7A9],
- ["8239FE31",0xB7AA],
- ["8239FE32",0xB7AB],
- ["8239FE33",0xB7AC],
- ["8239FE34",0xB7AD],
- ["8239FE35",0xB7AE],
- ["8239FE36",0xB7AF],
- ["8239FE37",0xB7B0],
- ["8239FE38",0xB7B1],
- ["8239FE39",0xB7B2],
- ["83308130",0xB7B3],
- ["83308131",0xB7B4],
- ["83308132",0xB7B5],
- ["83308133",0xB7B6],
- ["83308134",0xB7B7],
- ["83308135",0xB7B8],
- ["83308136",0xB7B9],
- ["83308137",0xB7BA],
- ["83308138",0xB7BB],
- ["83308139",0xB7BC],
- ["83308230",0xB7BD],
- ["83308231",0xB7BE],
- ["83308232",0xB7BF],
- ["83308233",0xB7C0],
- ["83308234",0xB7C1],
- ["83308235",0xB7C2],
- ["83308236",0xB7C3],
- ["83308237",0xB7C4],
- ["83308238",0xB7C5],
- ["83308239",0xB7C6],
- ["83308330",0xB7C7],
- ["83308331",0xB7C8],
- ["83308332",0xB7C9],
- ["83308333",0xB7CA],
- ["83308334",0xB7CB],
- ["83308335",0xB7CC],
- ["83308336",0xB7CD],
- ["83308337",0xB7CE],
- ["83308338",0xB7CF],
- ["83308339",0xB7D0],
- ["83308430",0xB7D1],
- ["83308431",0xB7D2],
- ["83308432",0xB7D3],
- ["83308433",0xB7D4],
- ["83308434",0xB7D5],
- ["83308435",0xB7D6],
- ["83308436",0xB7D7],
- ["83308437",0xB7D8],
- ["83308438",0xB7D9],
- ["83308439",0xB7DA],
- ["83308530",0xB7DB],
- ["83308531",0xB7DC],
- ["83308532",0xB7DD],
- ["83308533",0xB7DE],
- ["83308534",0xB7DF],
- ["83308535",0xB7E0],
- ["83308536",0xB7E1],
- ["83308537",0xB7E2],
- ["83308538",0xB7E3],
- ["83308539",0xB7E4],
- ["83308630",0xB7E5],
- ["83308631",0xB7E6],
- ["83308632",0xB7E7],
- ["83308633",0xB7E8],
- ["83308634",0xB7E9],
- ["83308635",0xB7EA],
- ["83308636",0xB7EB],
- ["83308637",0xB7EC],
- ["83308638",0xB7ED],
- ["83308639",0xB7EE],
- ["83308730",0xB7EF],
- ["83308731",0xB7F0],
- ["83308732",0xB7F1],
- ["83308733",0xB7F2],
- ["83308734",0xB7F3],
- ["83308735",0xB7F4],
- ["83308736",0xB7F5],
- ["83308737",0xB7F6],
- ["83308738",0xB7F7],
- ["83308739",0xB7F8],
- ["83308830",0xB7F9],
- ["83308831",0xB7FA],
- ["83308832",0xB7FB],
- ["83308833",0xB7FC],
- ["83308834",0xB7FD],
- ["83308835",0xB7FE],
- ["83308836",0xB7FF],
- ["83308837",0xB800],
- ["83308838",0xB801],
- ["83308839",0xB802],
- ["83308930",0xB803],
- ["83308931",0xB804],
- ["83308932",0xB805],
- ["83308933",0xB806],
- ["83308934",0xB807],
- ["83308935",0xB808],
- ["83308936",0xB809],
- ["83308937",0xB80A],
- ["83308938",0xB80B],
- ["83308939",0xB80C],
- ["83308A30",0xB80D],
- ["83308A31",0xB80E],
- ["83308A32",0xB80F],
- ["83308A33",0xB810],
- ["83308A34",0xB811],
- ["83308A35",0xB812],
- ["83308A36",0xB813],
- ["83308A37",0xB814],
- ["83308A38",0xB815],
- ["83308A39",0xB816],
- ["83308B30",0xB817],
- ["83308B31",0xB818],
- ["83308B32",0xB819],
- ["83308B33",0xB81A],
- ["83308B34",0xB81B],
- ["83308B35",0xB81C],
- ["83308B36",0xB81D],
- ["83308B37",0xB81E],
- ["83308B38",0xB81F],
- ["83308B39",0xB820],
- ["83308C30",0xB821],
- ["83308C31",0xB822],
- ["83308C32",0xB823],
- ["83308C33",0xB824],
- ["83308C34",0xB825],
- ["83308C35",0xB826],
- ["83308C36",0xB827],
- ["83308C37",0xB828],
- ["83308C38",0xB829],
- ["83308C39",0xB82A],
- ["83308D30",0xB82B],
- ["83308D31",0xB82C],
- ["83308D32",0xB82D],
- ["83308D33",0xB82E],
- ["83308D34",0xB82F],
- ["83308D35",0xB830],
- ["83308D36",0xB831],
- ["83308D37",0xB832],
- ["83308D38",0xB833],
- ["83308D39",0xB834],
- ["83308E30",0xB835],
- ["83308E31",0xB836],
- ["83308E32",0xB837],
- ["83308E33",0xB838],
- ["83308E34",0xB839],
- ["83308E35",0xB83A],
- ["83308E36",0xB83B],
- ["83308E37",0xB83C],
- ["83308E38",0xB83D],
- ["83308E39",0xB83E],
- ["83308F30",0xB83F],
- ["83308F31",0xB840],
- ["83308F32",0xB841],
- ["83308F33",0xB842],
- ["83308F34",0xB843],
- ["83308F35",0xB844],
- ["83308F36",0xB845],
- ["83308F37",0xB846],
- ["83308F38",0xB847],
- ["83308F39",0xB848],
- ["83309030",0xB849],
- ["83309031",0xB84A],
- ["83309032",0xB84B],
- ["83309033",0xB84C],
- ["83309034",0xB84D],
- ["83309035",0xB84E],
- ["83309036",0xB84F],
- ["83309037",0xB850],
- ["83309038",0xB851],
- ["83309039",0xB852],
- ["83309130",0xB853],
- ["83309131",0xB854],
- ["83309132",0xB855],
- ["83309133",0xB856],
- ["83309134",0xB857],
- ["83309135",0xB858],
- ["83309136",0xB859],
- ["83309137",0xB85A],
- ["83309138",0xB85B],
- ["83309139",0xB85C],
- ["83309230",0xB85D],
- ["83309231",0xB85E],
- ["83309232",0xB85F],
- ["83309233",0xB860],
- ["83309234",0xB861],
- ["83309235",0xB862],
- ["83309236",0xB863],
- ["83309237",0xB864],
- ["83309238",0xB865],
- ["83309239",0xB866],
- ["83309330",0xB867],
- ["83309331",0xB868],
- ["83309332",0xB869],
- ["83309333",0xB86A],
- ["83309334",0xB86B],
- ["83309335",0xB86C],
- ["83309336",0xB86D],
- ["83309337",0xB86E],
- ["83309338",0xB86F],
- ["83309339",0xB870],
- ["83309430",0xB871],
- ["83309431",0xB872],
- ["83309432",0xB873],
- ["83309433",0xB874],
- ["83309434",0xB875],
- ["83309435",0xB876],
- ["83309436",0xB877],
- ["83309437",0xB878],
- ["83309438",0xB879],
- ["83309439",0xB87A],
- ["83309530",0xB87B],
- ["83309531",0xB87C],
- ["83309532",0xB87D],
- ["83309533",0xB87E],
- ["83309534",0xB87F],
- ["83309535",0xB880],
- ["83309536",0xB881],
- ["83309537",0xB882],
- ["83309538",0xB883],
- ["83309539",0xB884],
- ["83309630",0xB885],
- ["83309631",0xB886],
- ["83309632",0xB887],
- ["83309633",0xB888],
- ["83309634",0xB889],
- ["83309635",0xB88A],
- ["83309636",0xB88B],
- ["83309637",0xB88C],
- ["83309638",0xB88D],
- ["83309639",0xB88E],
- ["83309730",0xB88F],
- ["83309731",0xB890],
- ["83309732",0xB891],
- ["83309733",0xB892],
- ["83309734",0xB893],
- ["83309735",0xB894],
- ["83309736",0xB895],
- ["83309737",0xB896],
- ["83309738",0xB897],
- ["83309739",0xB898],
- ["83309830",0xB899],
- ["83309831",0xB89A],
- ["83309832",0xB89B],
- ["83309833",0xB89C],
- ["83309834",0xB89D],
- ["83309835",0xB89E],
- ["83309836",0xB89F],
- ["83309837",0xB8A0],
- ["83309838",0xB8A1],
- ["83309839",0xB8A2],
- ["83309930",0xB8A3],
- ["83309931",0xB8A4],
- ["83309932",0xB8A5],
- ["83309933",0xB8A6],
- ["83309934",0xB8A7],
- ["83309935",0xB8A8],
- ["83309936",0xB8A9],
- ["83309937",0xB8AA],
- ["83309938",0xB8AB],
- ["83309939",0xB8AC],
- ["83309A30",0xB8AD],
- ["83309A31",0xB8AE],
- ["83309A32",0xB8AF],
- ["83309A33",0xB8B0],
- ["83309A34",0xB8B1],
- ["83309A35",0xB8B2],
- ["83309A36",0xB8B3],
- ["83309A37",0xB8B4],
- ["83309A38",0xB8B5],
- ["83309A39",0xB8B6],
- ["83309B30",0xB8B7],
- ["83309B31",0xB8B8],
- ["83309B32",0xB8B9],
- ["83309B33",0xB8BA],
- ["83309B34",0xB8BB],
- ["83309B35",0xB8BC],
- ["83309B36",0xB8BD],
- ["83309B37",0xB8BE],
- ["83309B38",0xB8BF],
- ["83309B39",0xB8C0],
- ["83309C30",0xB8C1],
- ["83309C31",0xB8C2],
- ["83309C32",0xB8C3],
- ["83309C33",0xB8C4],
- ["83309C34",0xB8C5],
- ["83309C35",0xB8C6],
- ["83309C36",0xB8C7],
- ["83309C37",0xB8C8],
- ["83309C38",0xB8C9],
- ["83309C39",0xB8CA],
- ["83309D30",0xB8CB],
- ["83309D31",0xB8CC],
- ["83309D32",0xB8CD],
- ["83309D33",0xB8CE],
- ["83309D34",0xB8CF],
- ["83309D35",0xB8D0],
- ["83309D36",0xB8D1],
- ["83309D37",0xB8D2],
- ["83309D38",0xB8D3],
- ["83309D39",0xB8D4],
- ["83309E30",0xB8D5],
- ["83309E31",0xB8D6],
- ["83309E32",0xB8D7],
- ["83309E33",0xB8D8],
- ["83309E34",0xB8D9],
- ["83309E35",0xB8DA],
- ["83309E36",0xB8DB],
- ["83309E37",0xB8DC],
- ["83309E38",0xB8DD],
- ["83309E39",0xB8DE],
- ["83309F30",0xB8DF],
- ["83309F31",0xB8E0],
- ["83309F32",0xB8E1],
- ["83309F33",0xB8E2],
- ["83309F34",0xB8E3],
- ["83309F35",0xB8E4],
- ["83309F36",0xB8E5],
- ["83309F37",0xB8E6],
- ["83309F38",0xB8E7],
- ["83309F39",0xB8E8],
- ["8330A030",0xB8E9],
- ["8330A031",0xB8EA],
- ["8330A032",0xB8EB],
- ["8330A033",0xB8EC],
- ["8330A034",0xB8ED],
- ["8330A035",0xB8EE],
- ["8330A036",0xB8EF],
- ["8330A037",0xB8F0],
- ["8330A038",0xB8F1],
- ["8330A039",0xB8F2],
- ["8330A130",0xB8F3],
- ["8330A131",0xB8F4],
- ["8330A132",0xB8F5],
- ["8330A133",0xB8F6],
- ["8330A134",0xB8F7],
- ["8330A135",0xB8F8],
- ["8330A136",0xB8F9],
- ["8330A137",0xB8FA],
- ["8330A138",0xB8FB],
- ["8330A139",0xB8FC],
- ["8330A230",0xB8FD],
- ["8330A231",0xB8FE],
- ["8330A232",0xB8FF],
- ["8330A233",0xB900],
- ["8330A234",0xB901],
- ["8330A235",0xB902],
- ["8330A236",0xB903],
- ["8330A237",0xB904],
- ["8330A238",0xB905],
- ["8330A239",0xB906],
- ["8330A330",0xB907],
- ["8330A331",0xB908],
- ["8330A332",0xB909],
- ["8330A333",0xB90A],
- ["8330A334",0xB90B],
- ["8330A335",0xB90C],
- ["8330A336",0xB90D],
- ["8330A337",0xB90E],
- ["8330A338",0xB90F],
- ["8330A339",0xB910],
- ["8330A430",0xB911],
- ["8330A431",0xB912],
- ["8330A432",0xB913],
- ["8330A433",0xB914],
- ["8330A434",0xB915],
- ["8330A435",0xB916],
- ["8330A436",0xB917],
- ["8330A437",0xB918],
- ["8330A438",0xB919],
- ["8330A439",0xB91A],
- ["8330A530",0xB91B],
- ["8330A531",0xB91C],
- ["8330A532",0xB91D],
- ["8330A533",0xB91E],
- ["8330A534",0xB91F],
- ["8330A535",0xB920],
- ["8330A536",0xB921],
- ["8330A537",0xB922],
- ["8330A538",0xB923],
- ["8330A539",0xB924],
- ["8330A630",0xB925],
- ["8330A631",0xB926],
- ["8330A632",0xB927],
- ["8330A633",0xB928],
- ["8330A634",0xB929],
- ["8330A635",0xB92A],
- ["8330A636",0xB92B],
- ["8330A637",0xB92C],
- ["8330A638",0xB92D],
- ["8330A639",0xB92E],
- ["8330A730",0xB92F],
- ["8330A731",0xB930],
- ["8330A732",0xB931],
- ["8330A733",0xB932],
- ["8330A734",0xB933],
- ["8330A735",0xB934],
- ["8330A736",0xB935],
- ["8330A737",0xB936],
- ["8330A738",0xB937],
- ["8330A739",0xB938],
- ["8330A830",0xB939],
- ["8330A831",0xB93A],
- ["8330A832",0xB93B],
- ["8330A833",0xB93C],
- ["8330A834",0xB93D],
- ["8330A835",0xB93E],
- ["8330A836",0xB93F],
- ["8330A837",0xB940],
- ["8330A838",0xB941],
- ["8330A839",0xB942],
- ["8330A930",0xB943],
- ["8330A931",0xB944],
- ["8330A932",0xB945],
- ["8330A933",0xB946],
- ["8330A934",0xB947],
- ["8330A935",0xB948],
- ["8330A936",0xB949],
- ["8330A937",0xB94A],
- ["8330A938",0xB94B],
- ["8330A939",0xB94C],
- ["8330AA30",0xB94D],
- ["8330AA31",0xB94E],
- ["8330AA32",0xB94F],
- ["8330AA33",0xB950],
- ["8330AA34",0xB951],
- ["8330AA35",0xB952],
- ["8330AA36",0xB953],
- ["8330AA37",0xB954],
- ["8330AA38",0xB955],
- ["8330AA39",0xB956],
- ["8330AB30",0xB957],
- ["8330AB31",0xB958],
- ["8330AB32",0xB959],
- ["8330AB33",0xB95A],
- ["8330AB34",0xB95B],
- ["8330AB35",0xB95C],
- ["8330AB36",0xB95D],
- ["8330AB37",0xB95E],
- ["8330AB38",0xB95F],
- ["8330AB39",0xB960],
- ["8330AC30",0xB961],
- ["8330AC31",0xB962],
- ["8330AC32",0xB963],
- ["8330AC33",0xB964],
- ["8330AC34",0xB965],
- ["8330AC35",0xB966],
- ["8330AC36",0xB967],
- ["8330AC37",0xB968],
- ["8330AC38",0xB969],
- ["8330AC39",0xB96A],
- ["8330AD30",0xB96B],
- ["8330AD31",0xB96C],
- ["8330AD32",0xB96D],
- ["8330AD33",0xB96E],
- ["8330AD34",0xB96F],
- ["8330AD35",0xB970],
- ["8330AD36",0xB971],
- ["8330AD37",0xB972],
- ["8330AD38",0xB973],
- ["8330AD39",0xB974],
- ["8330AE30",0xB975],
- ["8330AE31",0xB976],
- ["8330AE32",0xB977],
- ["8330AE33",0xB978],
- ["8330AE34",0xB979],
- ["8330AE35",0xB97A],
- ["8330AE36",0xB97B],
- ["8330AE37",0xB97C],
- ["8330AE38",0xB97D],
- ["8330AE39",0xB97E],
- ["8330AF30",0xB97F],
- ["8330AF31",0xB980],
- ["8330AF32",0xB981],
- ["8330AF33",0xB982],
- ["8330AF34",0xB983],
- ["8330AF35",0xB984],
- ["8330AF36",0xB985],
- ["8330AF37",0xB986],
- ["8330AF38",0xB987],
- ["8330AF39",0xB988],
- ["8330B030",0xB989],
- ["8330B031",0xB98A],
- ["8330B032",0xB98B],
- ["8330B033",0xB98C],
- ["8330B034",0xB98D],
- ["8330B035",0xB98E],
- ["8330B036",0xB98F],
- ["8330B037",0xB990],
- ["8330B038",0xB991],
- ["8330B039",0xB992],
- ["8330B130",0xB993],
- ["8330B131",0xB994],
- ["8330B132",0xB995],
- ["8330B133",0xB996],
- ["8330B134",0xB997],
- ["8330B135",0xB998],
- ["8330B136",0xB999],
- ["8330B137",0xB99A],
- ["8330B138",0xB99B],
- ["8330B139",0xB99C],
- ["8330B230",0xB99D],
- ["8330B231",0xB99E],
- ["8330B232",0xB99F],
- ["8330B233",0xB9A0],
- ["8330B234",0xB9A1],
- ["8330B235",0xB9A2],
- ["8330B236",0xB9A3],
- ["8330B237",0xB9A4],
- ["8330B238",0xB9A5],
- ["8330B239",0xB9A6],
- ["8330B330",0xB9A7],
- ["8330B331",0xB9A8],
- ["8330B332",0xB9A9],
- ["8330B333",0xB9AA],
- ["8330B334",0xB9AB],
- ["8330B335",0xB9AC],
- ["8330B336",0xB9AD],
- ["8330B337",0xB9AE],
- ["8330B338",0xB9AF],
- ["8330B339",0xB9B0],
- ["8330B430",0xB9B1],
- ["8330B431",0xB9B2],
- ["8330B432",0xB9B3],
- ["8330B433",0xB9B4],
- ["8330B434",0xB9B5],
- ["8330B435",0xB9B6],
- ["8330B436",0xB9B7],
- ["8330B437",0xB9B8],
- ["8330B438",0xB9B9],
- ["8330B439",0xB9BA],
- ["8330B530",0xB9BB],
- ["8330B531",0xB9BC],
- ["8330B532",0xB9BD],
- ["8330B533",0xB9BE],
- ["8330B534",0xB9BF],
- ["8330B535",0xB9C0],
- ["8330B536",0xB9C1],
- ["8330B537",0xB9C2],
- ["8330B538",0xB9C3],
- ["8330B539",0xB9C4],
- ["8330B630",0xB9C5],
- ["8330B631",0xB9C6],
- ["8330B632",0xB9C7],
- ["8330B633",0xB9C8],
- ["8330B634",0xB9C9],
- ["8330B635",0xB9CA],
- ["8330B636",0xB9CB],
- ["8330B637",0xB9CC],
- ["8330B638",0xB9CD],
- ["8330B639",0xB9CE],
- ["8330B730",0xB9CF],
- ["8330B731",0xB9D0],
- ["8330B732",0xB9D1],
- ["8330B733",0xB9D2],
- ["8330B734",0xB9D3],
- ["8330B735",0xB9D4],
- ["8330B736",0xB9D5],
- ["8330B737",0xB9D6],
- ["8330B738",0xB9D7],
- ["8330B739",0xB9D8],
- ["8330B830",0xB9D9],
- ["8330B831",0xB9DA],
- ["8330B832",0xB9DB],
- ["8330B833",0xB9DC],
- ["8330B834",0xB9DD],
- ["8330B835",0xB9DE],
- ["8330B836",0xB9DF],
- ["8330B837",0xB9E0],
- ["8330B838",0xB9E1],
- ["8330B839",0xB9E2],
- ["8330B930",0xB9E3],
- ["8330B931",0xB9E4],
- ["8330B932",0xB9E5],
- ["8330B933",0xB9E6],
- ["8330B934",0xB9E7],
- ["8330B935",0xB9E8],
- ["8330B936",0xB9E9],
- ["8330B937",0xB9EA],
- ["8330B938",0xB9EB],
- ["8330B939",0xB9EC],
- ["8330BA30",0xB9ED],
- ["8330BA31",0xB9EE],
- ["8330BA32",0xB9EF],
- ["8330BA33",0xB9F0],
- ["8330BA34",0xB9F1],
- ["8330BA35",0xB9F2],
- ["8330BA36",0xB9F3],
- ["8330BA37",0xB9F4],
- ["8330BA38",0xB9F5],
- ["8330BA39",0xB9F6],
- ["8330BB30",0xB9F7],
- ["8330BB31",0xB9F8],
- ["8330BB32",0xB9F9],
- ["8330BB33",0xB9FA],
- ["8330BB34",0xB9FB],
- ["8330BB35",0xB9FC],
- ["8330BB36",0xB9FD],
- ["8330BB37",0xB9FE],
- ["8330BB38",0xB9FF],
- ["8330BB39",0xBA00],
- ["8330BC30",0xBA01],
- ["8330BC31",0xBA02],
- ["8330BC32",0xBA03],
- ["8330BC33",0xBA04],
- ["8330BC34",0xBA05],
- ["8330BC35",0xBA06],
- ["8330BC36",0xBA07],
- ["8330BC37",0xBA08],
- ["8330BC38",0xBA09],
- ["8330BC39",0xBA0A],
- ["8330BD30",0xBA0B],
- ["8330BD31",0xBA0C],
- ["8330BD32",0xBA0D],
- ["8330BD33",0xBA0E],
- ["8330BD34",0xBA0F],
- ["8330BD35",0xBA10],
- ["8330BD36",0xBA11],
- ["8330BD37",0xBA12],
- ["8330BD38",0xBA13],
- ["8330BD39",0xBA14],
- ["8330BE30",0xBA15],
- ["8330BE31",0xBA16],
- ["8330BE32",0xBA17],
- ["8330BE33",0xBA18],
- ["8330BE34",0xBA19],
- ["8330BE35",0xBA1A],
- ["8330BE36",0xBA1B],
- ["8330BE37",0xBA1C],
- ["8330BE38",0xBA1D],
- ["8330BE39",0xBA1E],
- ["8330BF30",0xBA1F],
- ["8330BF31",0xBA20],
- ["8330BF32",0xBA21],
- ["8330BF33",0xBA22],
- ["8330BF34",0xBA23],
- ["8330BF35",0xBA24],
- ["8330BF36",0xBA25],
- ["8330BF37",0xBA26],
- ["8330BF38",0xBA27],
- ["8330BF39",0xBA28],
- ["8330C030",0xBA29],
- ["8330C031",0xBA2A],
- ["8330C032",0xBA2B],
- ["8330C033",0xBA2C],
- ["8330C034",0xBA2D],
- ["8330C035",0xBA2E],
- ["8330C036",0xBA2F],
- ["8330C037",0xBA30],
- ["8330C038",0xBA31],
- ["8330C039",0xBA32],
- ["8330C130",0xBA33],
- ["8330C131",0xBA34],
- ["8330C132",0xBA35],
- ["8330C133",0xBA36],
- ["8330C134",0xBA37],
- ["8330C135",0xBA38],
- ["8330C136",0xBA39],
- ["8330C137",0xBA3A],
- ["8330C138",0xBA3B],
- ["8330C139",0xBA3C],
- ["8330C230",0xBA3D],
- ["8330C231",0xBA3E],
- ["8330C232",0xBA3F],
- ["8330C233",0xBA40],
- ["8330C234",0xBA41],
- ["8330C235",0xBA42],
- ["8330C236",0xBA43],
- ["8330C237",0xBA44],
- ["8330C238",0xBA45],
- ["8330C239",0xBA46],
- ["8330C330",0xBA47],
- ["8330C331",0xBA48],
- ["8330C332",0xBA49],
- ["8330C333",0xBA4A],
- ["8330C334",0xBA4B],
- ["8330C335",0xBA4C],
- ["8330C336",0xBA4D],
- ["8330C337",0xBA4E],
- ["8330C338",0xBA4F],
- ["8330C339",0xBA50],
- ["8330C430",0xBA51],
- ["8330C431",0xBA52],
- ["8330C432",0xBA53],
- ["8330C433",0xBA54],
- ["8330C434",0xBA55],
- ["8330C435",0xBA56],
- ["8330C436",0xBA57],
- ["8330C437",0xBA58],
- ["8330C438",0xBA59],
- ["8330C439",0xBA5A],
- ["8330C530",0xBA5B],
- ["8330C531",0xBA5C],
- ["8330C532",0xBA5D],
- ["8330C533",0xBA5E],
- ["8330C534",0xBA5F],
- ["8330C535",0xBA60],
- ["8330C536",0xBA61],
- ["8330C537",0xBA62],
- ["8330C538",0xBA63],
- ["8330C539",0xBA64],
- ["8330C630",0xBA65],
- ["8330C631",0xBA66],
- ["8330C632",0xBA67],
- ["8330C633",0xBA68],
- ["8330C634",0xBA69],
- ["8330C635",0xBA6A],
- ["8330C636",0xBA6B],
- ["8330C637",0xBA6C],
- ["8330C638",0xBA6D],
- ["8330C639",0xBA6E],
- ["8330C730",0xBA6F],
- ["8330C731",0xBA70],
- ["8330C732",0xBA71],
- ["8330C733",0xBA72],
- ["8330C734",0xBA73],
- ["8330C735",0xBA74],
- ["8330C736",0xBA75],
- ["8330C737",0xBA76],
- ["8330C738",0xBA77],
- ["8330C739",0xBA78],
- ["8330C830",0xBA79],
- ["8330C831",0xBA7A],
- ["8330C832",0xBA7B],
- ["8330C833",0xBA7C],
- ["8330C834",0xBA7D],
- ["8330C835",0xBA7E],
- ["8330C836",0xBA7F],
- ["8330C837",0xBA80],
- ["8330C838",0xBA81],
- ["8330C839",0xBA82],
- ["8330C930",0xBA83],
- ["8330C931",0xBA84],
- ["8330C932",0xBA85],
- ["8330C933",0xBA86],
- ["8330C934",0xBA87],
- ["8330C935",0xBA88],
- ["8330C936",0xBA89],
- ["8330C937",0xBA8A],
- ["8330C938",0xBA8B],
- ["8330C939",0xBA8C],
- ["8330CA30",0xBA8D],
- ["8330CA31",0xBA8E],
- ["8330CA32",0xBA8F],
- ["8330CA33",0xBA90],
- ["8330CA34",0xBA91],
- ["8330CA35",0xBA92],
- ["8330CA36",0xBA93],
- ["8330CA37",0xBA94],
- ["8330CA38",0xBA95],
- ["8330CA39",0xBA96],
- ["8330CB30",0xBA97],
- ["8330CB31",0xBA98],
- ["8330CB32",0xBA99],
- ["8330CB33",0xBA9A],
- ["8330CB34",0xBA9B],
- ["8330CB35",0xBA9C],
- ["8330CB36",0xBA9D],
- ["8330CB37",0xBA9E],
- ["8330CB38",0xBA9F],
- ["8330CB39",0xBAA0],
- ["8330CC30",0xBAA1],
- ["8330CC31",0xBAA2],
- ["8330CC32",0xBAA3],
- ["8330CC33",0xBAA4],
- ["8330CC34",0xBAA5],
- ["8330CC35",0xBAA6],
- ["8330CC36",0xBAA7],
- ["8330CC37",0xBAA8],
- ["8330CC38",0xBAA9],
- ["8330CC39",0xBAAA],
- ["8330CD30",0xBAAB],
- ["8330CD31",0xBAAC],
- ["8330CD32",0xBAAD],
- ["8330CD33",0xBAAE],
- ["8330CD34",0xBAAF],
- ["8330CD35",0xBAB0],
- ["8330CD36",0xBAB1],
- ["8330CD37",0xBAB2],
- ["8330CD38",0xBAB3],
- ["8330CD39",0xBAB4],
- ["8330CE30",0xBAB5],
- ["8330CE31",0xBAB6],
- ["8330CE32",0xBAB7],
- ["8330CE33",0xBAB8],
- ["8330CE34",0xBAB9],
- ["8330CE35",0xBABA],
- ["8330CE36",0xBABB],
- ["8330CE37",0xBABC],
- ["8330CE38",0xBABD],
- ["8330CE39",0xBABE],
- ["8330CF30",0xBABF],
- ["8330CF31",0xBAC0],
- ["8330CF32",0xBAC1],
- ["8330CF33",0xBAC2],
- ["8330CF34",0xBAC3],
- ["8330CF35",0xBAC4],
- ["8330CF36",0xBAC5],
- ["8330CF37",0xBAC6],
- ["8330CF38",0xBAC7],
- ["8330CF39",0xBAC8],
- ["8330D030",0xBAC9],
- ["8330D031",0xBACA],
- ["8330D032",0xBACB],
- ["8330D033",0xBACC],
- ["8330D034",0xBACD],
- ["8330D035",0xBACE],
- ["8330D036",0xBACF],
- ["8330D037",0xBAD0],
- ["8330D038",0xBAD1],
- ["8330D039",0xBAD2],
- ["8330D130",0xBAD3],
- ["8330D131",0xBAD4],
- ["8330D132",0xBAD5],
- ["8330D133",0xBAD6],
- ["8330D134",0xBAD7],
- ["8330D135",0xBAD8],
- ["8330D136",0xBAD9],
- ["8330D137",0xBADA],
- ["8330D138",0xBADB],
- ["8330D139",0xBADC],
- ["8330D230",0xBADD],
- ["8330D231",0xBADE],
- ["8330D232",0xBADF],
- ["8330D233",0xBAE0],
- ["8330D234",0xBAE1],
- ["8330D235",0xBAE2],
- ["8330D236",0xBAE3],
- ["8330D237",0xBAE4],
- ["8330D238",0xBAE5],
- ["8330D239",0xBAE6],
- ["8330D330",0xBAE7],
- ["8330D331",0xBAE8],
- ["8330D332",0xBAE9],
- ["8330D333",0xBAEA],
- ["8330D334",0xBAEB],
- ["8330D335",0xBAEC],
- ["8330D336",0xBAED],
- ["8330D337",0xBAEE],
- ["8330D338",0xBAEF],
- ["8330D339",0xBAF0],
- ["8330D430",0xBAF1],
- ["8330D431",0xBAF2],
- ["8330D432",0xBAF3],
- ["8330D433",0xBAF4],
- ["8330D434",0xBAF5],
- ["8330D435",0xBAF6],
- ["8330D436",0xBAF7],
- ["8330D437",0xBAF8],
- ["8330D438",0xBAF9],
- ["8330D439",0xBAFA],
- ["8330D530",0xBAFB],
- ["8330D531",0xBAFC],
- ["8330D532",0xBAFD],
- ["8330D533",0xBAFE],
- ["8330D534",0xBAFF],
- ["8330D535",0xBB00],
- ["8330D536",0xBB01],
- ["8330D537",0xBB02],
- ["8330D538",0xBB03],
- ["8330D539",0xBB04],
- ["8330D630",0xBB05],
- ["8330D631",0xBB06],
- ["8330D632",0xBB07],
- ["8330D633",0xBB08],
- ["8330D634",0xBB09],
- ["8330D635",0xBB0A],
- ["8330D636",0xBB0B],
- ["8330D637",0xBB0C],
- ["8330D638",0xBB0D],
- ["8330D639",0xBB0E],
- ["8330D730",0xBB0F],
- ["8330D731",0xBB10],
- ["8330D732",0xBB11],
- ["8330D733",0xBB12],
- ["8330D734",0xBB13],
- ["8330D735",0xBB14],
- ["8330D736",0xBB15],
- ["8330D737",0xBB16],
- ["8330D738",0xBB17],
- ["8330D739",0xBB18],
- ["8330D830",0xBB19],
- ["8330D831",0xBB1A],
- ["8330D832",0xBB1B],
- ["8330D833",0xBB1C],
- ["8330D834",0xBB1D],
- ["8330D835",0xBB1E],
- ["8330D836",0xBB1F],
- ["8330D837",0xBB20],
- ["8330D838",0xBB21],
- ["8330D839",0xBB22],
- ["8330D930",0xBB23],
- ["8330D931",0xBB24],
- ["8330D932",0xBB25],
- ["8330D933",0xBB26],
- ["8330D934",0xBB27],
- ["8330D935",0xBB28],
- ["8330D936",0xBB29],
- ["8330D937",0xBB2A],
- ["8330D938",0xBB2B],
- ["8330D939",0xBB2C],
- ["8330DA30",0xBB2D],
- ["8330DA31",0xBB2E],
- ["8330DA32",0xBB2F],
- ["8330DA33",0xBB30],
- ["8330DA34",0xBB31],
- ["8330DA35",0xBB32],
- ["8330DA36",0xBB33],
- ["8330DA37",0xBB34],
- ["8330DA38",0xBB35],
- ["8330DA39",0xBB36],
- ["8330DB30",0xBB37],
- ["8330DB31",0xBB38],
- ["8330DB32",0xBB39],
- ["8330DB33",0xBB3A],
- ["8330DB34",0xBB3B],
- ["8330DB35",0xBB3C],
- ["8330DB36",0xBB3D],
- ["8330DB37",0xBB3E],
- ["8330DB38",0xBB3F],
- ["8330DB39",0xBB40],
- ["8330DC30",0xBB41],
- ["8330DC31",0xBB42],
- ["8330DC32",0xBB43],
- ["8330DC33",0xBB44],
- ["8330DC34",0xBB45],
- ["8330DC35",0xBB46],
- ["8330DC36",0xBB47],
- ["8330DC37",0xBB48],
- ["8330DC38",0xBB49],
- ["8330DC39",0xBB4A],
- ["8330DD30",0xBB4B],
- ["8330DD31",0xBB4C],
- ["8330DD32",0xBB4D],
- ["8330DD33",0xBB4E],
- ["8330DD34",0xBB4F],
- ["8330DD35",0xBB50],
- ["8330DD36",0xBB51],
- ["8330DD37",0xBB52],
- ["8330DD38",0xBB53],
- ["8330DD39",0xBB54],
- ["8330DE30",0xBB55],
- ["8330DE31",0xBB56],
- ["8330DE32",0xBB57],
- ["8330DE33",0xBB58],
- ["8330DE34",0xBB59],
- ["8330DE35",0xBB5A],
- ["8330DE36",0xBB5B],
- ["8330DE37",0xBB5C],
- ["8330DE38",0xBB5D],
- ["8330DE39",0xBB5E],
- ["8330DF30",0xBB5F],
- ["8330DF31",0xBB60],
- ["8330DF32",0xBB61],
- ["8330DF33",0xBB62],
- ["8330DF34",0xBB63],
- ["8330DF35",0xBB64],
- ["8330DF36",0xBB65],
- ["8330DF37",0xBB66],
- ["8330DF38",0xBB67],
- ["8330DF39",0xBB68],
- ["8330E030",0xBB69],
- ["8330E031",0xBB6A],
- ["8330E032",0xBB6B],
- ["8330E033",0xBB6C],
- ["8330E034",0xBB6D],
- ["8330E035",0xBB6E],
- ["8330E036",0xBB6F],
- ["8330E037",0xBB70],
- ["8330E038",0xBB71],
- ["8330E039",0xBB72],
- ["8330E130",0xBB73],
- ["8330E131",0xBB74],
- ["8330E132",0xBB75],
- ["8330E133",0xBB76],
- ["8330E134",0xBB77],
- ["8330E135",0xBB78],
- ["8330E136",0xBB79],
- ["8330E137",0xBB7A],
- ["8330E138",0xBB7B],
- ["8330E139",0xBB7C],
- ["8330E230",0xBB7D],
- ["8330E231",0xBB7E],
- ["8330E232",0xBB7F],
- ["8330E233",0xBB80],
- ["8330E234",0xBB81],
- ["8330E235",0xBB82],
- ["8330E236",0xBB83],
- ["8330E237",0xBB84],
- ["8330E238",0xBB85],
- ["8330E239",0xBB86],
- ["8330E330",0xBB87],
- ["8330E331",0xBB88],
- ["8330E332",0xBB89],
- ["8330E333",0xBB8A],
- ["8330E334",0xBB8B],
- ["8330E335",0xBB8C],
- ["8330E336",0xBB8D],
- ["8330E337",0xBB8E],
- ["8330E338",0xBB8F],
- ["8330E339",0xBB90],
- ["8330E430",0xBB91],
- ["8330E431",0xBB92],
- ["8330E432",0xBB93],
- ["8330E433",0xBB94],
- ["8330E434",0xBB95],
- ["8330E435",0xBB96],
- ["8330E436",0xBB97],
- ["8330E437",0xBB98],
- ["8330E438",0xBB99],
- ["8330E439",0xBB9A],
- ["8330E530",0xBB9B],
- ["8330E531",0xBB9C],
- ["8330E532",0xBB9D],
- ["8330E533",0xBB9E],
- ["8330E534",0xBB9F],
- ["8330E535",0xBBA0],
- ["8330E536",0xBBA1],
- ["8330E537",0xBBA2],
- ["8330E538",0xBBA3],
- ["8330E539",0xBBA4],
- ["8330E630",0xBBA5],
- ["8330E631",0xBBA6],
- ["8330E632",0xBBA7],
- ["8330E633",0xBBA8],
- ["8330E634",0xBBA9],
- ["8330E635",0xBBAA],
- ["8330E636",0xBBAB],
- ["8330E637",0xBBAC],
- ["8330E638",0xBBAD],
- ["8330E639",0xBBAE],
- ["8330E730",0xBBAF],
- ["8330E731",0xBBB0],
- ["8330E732",0xBBB1],
- ["8330E733",0xBBB2],
- ["8330E734",0xBBB3],
- ["8330E735",0xBBB4],
- ["8330E736",0xBBB5],
- ["8330E737",0xBBB6],
- ["8330E738",0xBBB7],
- ["8330E739",0xBBB8],
- ["8330E830",0xBBB9],
- ["8330E831",0xBBBA],
- ["8330E832",0xBBBB],
- ["8330E833",0xBBBC],
- ["8330E834",0xBBBD],
- ["8330E835",0xBBBE],
- ["8330E836",0xBBBF],
- ["8330E837",0xBBC0],
- ["8330E838",0xBBC1],
- ["8330E839",0xBBC2],
- ["8330E930",0xBBC3],
- ["8330E931",0xBBC4],
- ["8330E932",0xBBC5],
- ["8330E933",0xBBC6],
- ["8330E934",0xBBC7],
- ["8330E935",0xBBC8],
- ["8330E936",0xBBC9],
- ["8330E937",0xBBCA],
- ["8330E938",0xBBCB],
- ["8330E939",0xBBCC],
- ["8330EA30",0xBBCD],
- ["8330EA31",0xBBCE],
- ["8330EA32",0xBBCF],
- ["8330EA33",0xBBD0],
- ["8330EA34",0xBBD1],
- ["8330EA35",0xBBD2],
- ["8330EA36",0xBBD3],
- ["8330EA37",0xBBD4],
- ["8330EA38",0xBBD5],
- ["8330EA39",0xBBD6],
- ["8330EB30",0xBBD7],
- ["8330EB31",0xBBD8],
- ["8330EB32",0xBBD9],
- ["8330EB33",0xBBDA],
- ["8330EB34",0xBBDB],
- ["8330EB35",0xBBDC],
- ["8330EB36",0xBBDD],
- ["8330EB37",0xBBDE],
- ["8330EB38",0xBBDF],
- ["8330EB39",0xBBE0],
- ["8330EC30",0xBBE1],
- ["8330EC31",0xBBE2],
- ["8330EC32",0xBBE3],
- ["8330EC33",0xBBE4],
- ["8330EC34",0xBBE5],
- ["8330EC35",0xBBE6],
- ["8330EC36",0xBBE7],
- ["8330EC37",0xBBE8],
- ["8330EC38",0xBBE9],
- ["8330EC39",0xBBEA],
- ["8330ED30",0xBBEB],
- ["8330ED31",0xBBEC],
- ["8330ED32",0xBBED],
- ["8330ED33",0xBBEE],
- ["8330ED34",0xBBEF],
- ["8330ED35",0xBBF0],
- ["8330ED36",0xBBF1],
- ["8330ED37",0xBBF2],
- ["8330ED38",0xBBF3],
- ["8330ED39",0xBBF4],
- ["8330EE30",0xBBF5],
- ["8330EE31",0xBBF6],
- ["8330EE32",0xBBF7],
- ["8330EE33",0xBBF8],
- ["8330EE34",0xBBF9],
- ["8330EE35",0xBBFA],
- ["8330EE36",0xBBFB],
- ["8330EE37",0xBBFC],
- ["8330EE38",0xBBFD],
- ["8330EE39",0xBBFE],
- ["8330EF30",0xBBFF],
- ["8330EF31",0xBC00],
- ["8330EF32",0xBC01],
- ["8330EF33",0xBC02],
- ["8330EF34",0xBC03],
- ["8330EF35",0xBC04],
- ["8330EF36",0xBC05],
- ["8330EF37",0xBC06],
- ["8330EF38",0xBC07],
- ["8330EF39",0xBC08],
- ["8330F030",0xBC09],
- ["8330F031",0xBC0A],
- ["8330F032",0xBC0B],
- ["8330F033",0xBC0C],
- ["8330F034",0xBC0D],
- ["8330F035",0xBC0E],
- ["8330F036",0xBC0F],
- ["8330F037",0xBC10],
- ["8330F038",0xBC11],
- ["8330F039",0xBC12],
- ["8330F130",0xBC13],
- ["8330F131",0xBC14],
- ["8330F132",0xBC15],
- ["8330F133",0xBC16],
- ["8330F134",0xBC17],
- ["8330F135",0xBC18],
- ["8330F136",0xBC19],
- ["8330F137",0xBC1A],
- ["8330F138",0xBC1B],
- ["8330F139",0xBC1C],
- ["8330F230",0xBC1D],
- ["8330F231",0xBC1E],
- ["8330F232",0xBC1F],
- ["8330F233",0xBC20],
- ["8330F234",0xBC21],
- ["8330F235",0xBC22],
- ["8330F236",0xBC23],
- ["8330F237",0xBC24],
- ["8330F238",0xBC25],
- ["8330F239",0xBC26],
- ["8330F330",0xBC27],
- ["8330F331",0xBC28],
- ["8330F332",0xBC29],
- ["8330F333",0xBC2A],
- ["8330F334",0xBC2B],
- ["8330F335",0xBC2C],
- ["8330F336",0xBC2D],
- ["8330F337",0xBC2E],
- ["8330F338",0xBC2F],
- ["8330F339",0xBC30],
- ["8330F430",0xBC31],
- ["8330F431",0xBC32],
- ["8330F432",0xBC33],
- ["8330F433",0xBC34],
- ["8330F434",0xBC35],
- ["8330F435",0xBC36],
- ["8330F436",0xBC37],
- ["8330F437",0xBC38],
- ["8330F438",0xBC39],
- ["8330F439",0xBC3A],
- ["8330F530",0xBC3B],
- ["8330F531",0xBC3C],
- ["8330F532",0xBC3D],
- ["8330F533",0xBC3E],
- ["8330F534",0xBC3F],
- ["8330F535",0xBC40],
- ["8330F536",0xBC41],
- ["8330F537",0xBC42],
- ["8330F538",0xBC43],
- ["8330F539",0xBC44],
- ["8330F630",0xBC45],
- ["8330F631",0xBC46],
- ["8330F632",0xBC47],
- ["8330F633",0xBC48],
- ["8330F634",0xBC49],
- ["8330F635",0xBC4A],
- ["8330F636",0xBC4B],
- ["8330F637",0xBC4C],
- ["8330F638",0xBC4D],
- ["8330F639",0xBC4E],
- ["8330F730",0xBC4F],
- ["8330F731",0xBC50],
- ["8330F732",0xBC51],
- ["8330F733",0xBC52],
- ["8330F734",0xBC53],
- ["8330F735",0xBC54],
- ["8330F736",0xBC55],
- ["8330F737",0xBC56],
- ["8330F738",0xBC57],
- ["8330F739",0xBC58],
- ["8330F830",0xBC59],
- ["8330F831",0xBC5A],
- ["8330F832",0xBC5B],
- ["8330F833",0xBC5C],
- ["8330F834",0xBC5D],
- ["8330F835",0xBC5E],
- ["8330F836",0xBC5F],
- ["8330F837",0xBC60],
- ["8330F838",0xBC61],
- ["8330F839",0xBC62],
- ["8330F930",0xBC63],
- ["8330F931",0xBC64],
- ["8330F932",0xBC65],
- ["8330F933",0xBC66],
- ["8330F934",0xBC67],
- ["8330F935",0xBC68],
- ["8330F936",0xBC69],
- ["8330F937",0xBC6A],
- ["8330F938",0xBC6B],
- ["8330F939",0xBC6C],
- ["8330FA30",0xBC6D],
- ["8330FA31",0xBC6E],
- ["8330FA32",0xBC6F],
- ["8330FA33",0xBC70],
- ["8330FA34",0xBC71],
- ["8330FA35",0xBC72],
- ["8330FA36",0xBC73],
- ["8330FA37",0xBC74],
- ["8330FA38",0xBC75],
- ["8330FA39",0xBC76],
- ["8330FB30",0xBC77],
- ["8330FB31",0xBC78],
- ["8330FB32",0xBC79],
- ["8330FB33",0xBC7A],
- ["8330FB34",0xBC7B],
- ["8330FB35",0xBC7C],
- ["8330FB36",0xBC7D],
- ["8330FB37",0xBC7E],
- ["8330FB38",0xBC7F],
- ["8330FB39",0xBC80],
- ["8330FC30",0xBC81],
- ["8330FC31",0xBC82],
- ["8330FC32",0xBC83],
- ["8330FC33",0xBC84],
- ["8330FC34",0xBC85],
- ["8330FC35",0xBC86],
- ["8330FC36",0xBC87],
- ["8330FC37",0xBC88],
- ["8330FC38",0xBC89],
- ["8330FC39",0xBC8A],
- ["8330FD30",0xBC8B],
- ["8330FD31",0xBC8C],
- ["8330FD32",0xBC8D],
- ["8330FD33",0xBC8E],
- ["8330FD34",0xBC8F],
- ["8330FD35",0xBC90],
- ["8330FD36",0xBC91],
- ["8330FD37",0xBC92],
- ["8330FD38",0xBC93],
- ["8330FD39",0xBC94],
- ["8330FE30",0xBC95],
- ["8330FE31",0xBC96],
- ["8330FE32",0xBC97],
- ["8330FE33",0xBC98],
- ["8330FE34",0xBC99],
- ["8330FE35",0xBC9A],
- ["8330FE36",0xBC9B],
- ["8330FE37",0xBC9C],
- ["8330FE38",0xBC9D],
- ["8330FE39",0xBC9E],
- ["83318130",0xBC9F],
- ["83318131",0xBCA0],
- ["83318132",0xBCA1],
- ["83318133",0xBCA2],
- ["83318134",0xBCA3],
- ["83318135",0xBCA4],
- ["83318136",0xBCA5],
- ["83318137",0xBCA6],
- ["83318138",0xBCA7],
- ["83318139",0xBCA8],
- ["83318230",0xBCA9],
- ["83318231",0xBCAA],
- ["83318232",0xBCAB],
- ["83318233",0xBCAC],
- ["83318234",0xBCAD],
- ["83318235",0xBCAE],
- ["83318236",0xBCAF],
- ["83318237",0xBCB0],
- ["83318238",0xBCB1],
- ["83318239",0xBCB2],
- ["83318330",0xBCB3],
- ["83318331",0xBCB4],
- ["83318332",0xBCB5],
- ["83318333",0xBCB6],
- ["83318334",0xBCB7],
- ["83318335",0xBCB8],
- ["83318336",0xBCB9],
- ["83318337",0xBCBA],
- ["83318338",0xBCBB],
- ["83318339",0xBCBC],
- ["83318430",0xBCBD],
- ["83318431",0xBCBE],
- ["83318432",0xBCBF],
- ["83318433",0xBCC0],
- ["83318434",0xBCC1],
- ["83318435",0xBCC2],
- ["83318436",0xBCC3],
- ["83318437",0xBCC4],
- ["83318438",0xBCC5],
- ["83318439",0xBCC6],
- ["83318530",0xBCC7],
- ["83318531",0xBCC8],
- ["83318532",0xBCC9],
- ["83318533",0xBCCA],
- ["83318534",0xBCCB],
- ["83318535",0xBCCC],
- ["83318536",0xBCCD],
- ["83318537",0xBCCE],
- ["83318538",0xBCCF],
- ["83318539",0xBCD0],
- ["83318630",0xBCD1],
- ["83318631",0xBCD2],
- ["83318632",0xBCD3],
- ["83318633",0xBCD4],
- ["83318634",0xBCD5],
- ["83318635",0xBCD6],
- ["83318636",0xBCD7],
- ["83318637",0xBCD8],
- ["83318638",0xBCD9],
- ["83318639",0xBCDA],
- ["83318730",0xBCDB],
- ["83318731",0xBCDC],
- ["83318732",0xBCDD],
- ["83318733",0xBCDE],
- ["83318734",0xBCDF],
- ["83318735",0xBCE0],
- ["83318736",0xBCE1],
- ["83318737",0xBCE2],
- ["83318738",0xBCE3],
- ["83318739",0xBCE4],
- ["83318830",0xBCE5],
- ["83318831",0xBCE6],
- ["83318832",0xBCE7],
- ["83318833",0xBCE8],
- ["83318834",0xBCE9],
- ["83318835",0xBCEA],
- ["83318836",0xBCEB],
- ["83318837",0xBCEC],
- ["83318838",0xBCED],
- ["83318839",0xBCEE],
- ["83318930",0xBCEF],
- ["83318931",0xBCF0],
- ["83318932",0xBCF1],
- ["83318933",0xBCF2],
- ["83318934",0xBCF3],
- ["83318935",0xBCF4],
- ["83318936",0xBCF5],
- ["83318937",0xBCF6],
- ["83318938",0xBCF7],
- ["83318939",0xBCF8],
- ["83318A30",0xBCF9],
- ["83318A31",0xBCFA],
- ["83318A32",0xBCFB],
- ["83318A33",0xBCFC],
- ["83318A34",0xBCFD],
- ["83318A35",0xBCFE],
- ["83318A36",0xBCFF],
- ["83318A37",0xBD00],
- ["83318A38",0xBD01],
- ["83318A39",0xBD02],
- ["83318B30",0xBD03],
- ["83318B31",0xBD04],
- ["83318B32",0xBD05],
- ["83318B33",0xBD06],
- ["83318B34",0xBD07],
- ["83318B35",0xBD08],
- ["83318B36",0xBD09],
- ["83318B37",0xBD0A],
- ["83318B38",0xBD0B],
- ["83318B39",0xBD0C],
- ["83318C30",0xBD0D],
- ["83318C31",0xBD0E],
- ["83318C32",0xBD0F],
- ["83318C33",0xBD10],
- ["83318C34",0xBD11],
- ["83318C35",0xBD12],
- ["83318C36",0xBD13],
- ["83318C37",0xBD14],
- ["83318C38",0xBD15],
- ["83318C39",0xBD16],
- ["83318D30",0xBD17],
- ["83318D31",0xBD18],
- ["83318D32",0xBD19],
- ["83318D33",0xBD1A],
- ["83318D34",0xBD1B],
- ["83318D35",0xBD1C],
- ["83318D36",0xBD1D],
- ["83318D37",0xBD1E],
- ["83318D38",0xBD1F],
- ["83318D39",0xBD20],
- ["83318E30",0xBD21],
- ["83318E31",0xBD22],
- ["83318E32",0xBD23],
- ["83318E33",0xBD24],
- ["83318E34",0xBD25],
- ["83318E35",0xBD26],
- ["83318E36",0xBD27],
- ["83318E37",0xBD28],
- ["83318E38",0xBD29],
- ["83318E39",0xBD2A],
- ["83318F30",0xBD2B],
- ["83318F31",0xBD2C],
- ["83318F32",0xBD2D],
- ["83318F33",0xBD2E],
- ["83318F34",0xBD2F],
- ["83318F35",0xBD30],
- ["83318F36",0xBD31],
- ["83318F37",0xBD32],
- ["83318F38",0xBD33],
- ["83318F39",0xBD34],
- ["83319030",0xBD35],
- ["83319031",0xBD36],
- ["83319032",0xBD37],
- ["83319033",0xBD38],
- ["83319034",0xBD39],
- ["83319035",0xBD3A],
- ["83319036",0xBD3B],
- ["83319037",0xBD3C],
- ["83319038",0xBD3D],
- ["83319039",0xBD3E],
- ["83319130",0xBD3F],
- ["83319131",0xBD40],
- ["83319132",0xBD41],
- ["83319133",0xBD42],
- ["83319134",0xBD43],
- ["83319135",0xBD44],
- ["83319136",0xBD45],
- ["83319137",0xBD46],
- ["83319138",0xBD47],
- ["83319139",0xBD48],
- ["83319230",0xBD49],
- ["83319231",0xBD4A],
- ["83319232",0xBD4B],
- ["83319233",0xBD4C],
- ["83319234",0xBD4D],
- ["83319235",0xBD4E],
- ["83319236",0xBD4F],
- ["83319237",0xBD50],
- ["83319238",0xBD51],
- ["83319239",0xBD52],
- ["83319330",0xBD53],
- ["83319331",0xBD54],
- ["83319332",0xBD55],
- ["83319333",0xBD56],
- ["83319334",0xBD57],
- ["83319335",0xBD58],
- ["83319336",0xBD59],
- ["83319337",0xBD5A],
- ["83319338",0xBD5B],
- ["83319339",0xBD5C],
- ["83319430",0xBD5D],
- ["83319431",0xBD5E],
- ["83319432",0xBD5F],
- ["83319433",0xBD60],
- ["83319434",0xBD61],
- ["83319435",0xBD62],
- ["83319436",0xBD63],
- ["83319437",0xBD64],
- ["83319438",0xBD65],
- ["83319439",0xBD66],
- ["83319530",0xBD67],
- ["83319531",0xBD68],
- ["83319532",0xBD69],
- ["83319533",0xBD6A],
- ["83319534",0xBD6B],
- ["83319535",0xBD6C],
- ["83319536",0xBD6D],
- ["83319537",0xBD6E],
- ["83319538",0xBD6F],
- ["83319539",0xBD70],
- ["83319630",0xBD71],
- ["83319631",0xBD72],
- ["83319632",0xBD73],
- ["83319633",0xBD74],
- ["83319634",0xBD75],
- ["83319635",0xBD76],
- ["83319636",0xBD77],
- ["83319637",0xBD78],
- ["83319638",0xBD79],
- ["83319639",0xBD7A],
- ["83319730",0xBD7B],
- ["83319731",0xBD7C],
- ["83319732",0xBD7D],
- ["83319733",0xBD7E],
- ["83319734",0xBD7F],
- ["83319735",0xBD80],
- ["83319736",0xBD81],
- ["83319737",0xBD82],
- ["83319738",0xBD83],
- ["83319739",0xBD84],
- ["83319830",0xBD85],
- ["83319831",0xBD86],
- ["83319832",0xBD87],
- ["83319833",0xBD88],
- ["83319834",0xBD89],
- ["83319835",0xBD8A],
- ["83319836",0xBD8B],
- ["83319837",0xBD8C],
- ["83319838",0xBD8D],
- ["83319839",0xBD8E],
- ["83319930",0xBD8F],
- ["83319931",0xBD90],
- ["83319932",0xBD91],
- ["83319933",0xBD92],
- ["83319934",0xBD93],
- ["83319935",0xBD94],
- ["83319936",0xBD95],
- ["83319937",0xBD96],
- ["83319938",0xBD97],
- ["83319939",0xBD98],
- ["83319A30",0xBD99],
- ["83319A31",0xBD9A],
- ["83319A32",0xBD9B],
- ["83319A33",0xBD9C],
- ["83319A34",0xBD9D],
- ["83319A35",0xBD9E],
- ["83319A36",0xBD9F],
- ["83319A37",0xBDA0],
- ["83319A38",0xBDA1],
- ["83319A39",0xBDA2],
- ["83319B30",0xBDA3],
- ["83319B31",0xBDA4],
- ["83319B32",0xBDA5],
- ["83319B33",0xBDA6],
- ["83319B34",0xBDA7],
- ["83319B35",0xBDA8],
- ["83319B36",0xBDA9],
- ["83319B37",0xBDAA],
- ["83319B38",0xBDAB],
- ["83319B39",0xBDAC],
- ["83319C30",0xBDAD],
- ["83319C31",0xBDAE],
- ["83319C32",0xBDAF],
- ["83319C33",0xBDB0],
- ["83319C34",0xBDB1],
- ["83319C35",0xBDB2],
- ["83319C36",0xBDB3],
- ["83319C37",0xBDB4],
- ["83319C38",0xBDB5],
- ["83319C39",0xBDB6],
- ["83319D30",0xBDB7],
- ["83319D31",0xBDB8],
- ["83319D32",0xBDB9],
- ["83319D33",0xBDBA],
- ["83319D34",0xBDBB],
- ["83319D35",0xBDBC],
- ["83319D36",0xBDBD],
- ["83319D37",0xBDBE],
- ["83319D38",0xBDBF],
- ["83319D39",0xBDC0],
- ["83319E30",0xBDC1],
- ["83319E31",0xBDC2],
- ["83319E32",0xBDC3],
- ["83319E33",0xBDC4],
- ["83319E34",0xBDC5],
- ["83319E35",0xBDC6],
- ["83319E36",0xBDC7],
- ["83319E37",0xBDC8],
- ["83319E38",0xBDC9],
- ["83319E39",0xBDCA],
- ["83319F30",0xBDCB],
- ["83319F31",0xBDCC],
- ["83319F32",0xBDCD],
- ["83319F33",0xBDCE],
- ["83319F34",0xBDCF],
- ["83319F35",0xBDD0],
- ["83319F36",0xBDD1],
- ["83319F37",0xBDD2],
- ["83319F38",0xBDD3],
- ["83319F39",0xBDD4],
- ["8331A030",0xBDD5],
- ["8331A031",0xBDD6],
- ["8331A032",0xBDD7],
- ["8331A033",0xBDD8],
- ["8331A034",0xBDD9],
- ["8331A035",0xBDDA],
- ["8331A036",0xBDDB],
- ["8331A037",0xBDDC],
- ["8331A038",0xBDDD],
- ["8331A039",0xBDDE],
- ["8331A130",0xBDDF],
- ["8331A131",0xBDE0],
- ["8331A132",0xBDE1],
- ["8331A133",0xBDE2],
- ["8331A134",0xBDE3],
- ["8331A135",0xBDE4],
- ["8331A136",0xBDE5],
- ["8331A137",0xBDE6],
- ["8331A138",0xBDE7],
- ["8331A139",0xBDE8],
- ["8331A230",0xBDE9],
- ["8331A231",0xBDEA],
- ["8331A232",0xBDEB],
- ["8331A233",0xBDEC],
- ["8331A234",0xBDED],
- ["8331A235",0xBDEE],
- ["8331A236",0xBDEF],
- ["8331A237",0xBDF0],
- ["8331A238",0xBDF1],
- ["8331A239",0xBDF2],
- ["8331A330",0xBDF3],
- ["8331A331",0xBDF4],
- ["8331A332",0xBDF5],
- ["8331A333",0xBDF6],
- ["8331A334",0xBDF7],
- ["8331A335",0xBDF8],
- ["8331A336",0xBDF9],
- ["8331A337",0xBDFA],
- ["8331A338",0xBDFB],
- ["8331A339",0xBDFC],
- ["8331A430",0xBDFD],
- ["8331A431",0xBDFE],
- ["8331A432",0xBDFF],
- ["8331A433",0xBE00],
- ["8331A434",0xBE01],
- ["8331A435",0xBE02],
- ["8331A436",0xBE03],
- ["8331A437",0xBE04],
- ["8331A438",0xBE05],
- ["8331A439",0xBE06],
- ["8331A530",0xBE07],
- ["8331A531",0xBE08],
- ["8331A532",0xBE09],
- ["8331A533",0xBE0A],
- ["8331A534",0xBE0B],
- ["8331A535",0xBE0C],
- ["8331A536",0xBE0D],
- ["8331A537",0xBE0E],
- ["8331A538",0xBE0F],
- ["8331A539",0xBE10],
- ["8331A630",0xBE11],
- ["8331A631",0xBE12],
- ["8331A632",0xBE13],
- ["8331A633",0xBE14],
- ["8331A634",0xBE15],
- ["8331A635",0xBE16],
- ["8331A636",0xBE17],
- ["8331A637",0xBE18],
- ["8331A638",0xBE19],
- ["8331A639",0xBE1A],
- ["8331A730",0xBE1B],
- ["8331A731",0xBE1C],
- ["8331A732",0xBE1D],
- ["8331A733",0xBE1E],
- ["8331A734",0xBE1F],
- ["8331A735",0xBE20],
- ["8331A736",0xBE21],
- ["8331A737",0xBE22],
- ["8331A738",0xBE23],
- ["8331A739",0xBE24],
- ["8331A830",0xBE25],
- ["8331A831",0xBE26],
- ["8331A832",0xBE27],
- ["8331A833",0xBE28],
- ["8331A834",0xBE29],
- ["8331A835",0xBE2A],
- ["8331A836",0xBE2B],
- ["8331A837",0xBE2C],
- ["8331A838",0xBE2D],
- ["8331A839",0xBE2E],
- ["8331A930",0xBE2F],
- ["8331A931",0xBE30],
- ["8331A932",0xBE31],
- ["8331A933",0xBE32],
- ["8331A934",0xBE33],
- ["8331A935",0xBE34],
- ["8331A936",0xBE35],
- ["8331A937",0xBE36],
- ["8331A938",0xBE37],
- ["8331A939",0xBE38],
- ["8331AA30",0xBE39],
- ["8331AA31",0xBE3A],
- ["8331AA32",0xBE3B],
- ["8331AA33",0xBE3C],
- ["8331AA34",0xBE3D],
- ["8331AA35",0xBE3E],
- ["8331AA36",0xBE3F],
- ["8331AA37",0xBE40],
- ["8331AA38",0xBE41],
- ["8331AA39",0xBE42],
- ["8331AB30",0xBE43],
- ["8331AB31",0xBE44],
- ["8331AB32",0xBE45],
- ["8331AB33",0xBE46],
- ["8331AB34",0xBE47],
- ["8331AB35",0xBE48],
- ["8331AB36",0xBE49],
- ["8331AB37",0xBE4A],
- ["8331AB38",0xBE4B],
- ["8331AB39",0xBE4C],
- ["8331AC30",0xBE4D],
- ["8331AC31",0xBE4E],
- ["8331AC32",0xBE4F],
- ["8331AC33",0xBE50],
- ["8331AC34",0xBE51],
- ["8331AC35",0xBE52],
- ["8331AC36",0xBE53],
- ["8331AC37",0xBE54],
- ["8331AC38",0xBE55],
- ["8331AC39",0xBE56],
- ["8331AD30",0xBE57],
- ["8331AD31",0xBE58],
- ["8331AD32",0xBE59],
- ["8331AD33",0xBE5A],
- ["8331AD34",0xBE5B],
- ["8331AD35",0xBE5C],
- ["8331AD36",0xBE5D],
- ["8331AD37",0xBE5E],
- ["8331AD38",0xBE5F],
- ["8331AD39",0xBE60],
- ["8331AE30",0xBE61],
- ["8331AE31",0xBE62],
- ["8331AE32",0xBE63],
- ["8331AE33",0xBE64],
- ["8331AE34",0xBE65],
- ["8331AE35",0xBE66],
- ["8331AE36",0xBE67],
- ["8331AE37",0xBE68],
- ["8331AE38",0xBE69],
- ["8331AE39",0xBE6A],
- ["8331AF30",0xBE6B],
- ["8331AF31",0xBE6C],
- ["8331AF32",0xBE6D],
- ["8331AF33",0xBE6E],
- ["8331AF34",0xBE6F],
- ["8331AF35",0xBE70],
- ["8331AF36",0xBE71],
- ["8331AF37",0xBE72],
- ["8331AF38",0xBE73],
- ["8331AF39",0xBE74],
- ["8331B030",0xBE75],
- ["8331B031",0xBE76],
- ["8331B032",0xBE77],
- ["8331B033",0xBE78],
- ["8331B034",0xBE79],
- ["8331B035",0xBE7A],
- ["8331B036",0xBE7B],
- ["8331B037",0xBE7C],
- ["8331B038",0xBE7D],
- ["8331B039",0xBE7E],
- ["8331B130",0xBE7F],
- ["8331B131",0xBE80],
- ["8331B132",0xBE81],
- ["8331B133",0xBE82],
- ["8331B134",0xBE83],
- ["8331B135",0xBE84],
- ["8331B136",0xBE85],
- ["8331B137",0xBE86],
- ["8331B138",0xBE87],
- ["8331B139",0xBE88],
- ["8331B230",0xBE89],
- ["8331B231",0xBE8A],
- ["8331B232",0xBE8B],
- ["8331B233",0xBE8C],
- ["8331B234",0xBE8D],
- ["8331B235",0xBE8E],
- ["8331B236",0xBE8F],
- ["8331B237",0xBE90],
- ["8331B238",0xBE91],
- ["8331B239",0xBE92],
- ["8331B330",0xBE93],
- ["8331B331",0xBE94],
- ["8331B332",0xBE95],
- ["8331B333",0xBE96],
- ["8331B334",0xBE97],
- ["8331B335",0xBE98],
- ["8331B336",0xBE99],
- ["8331B337",0xBE9A],
- ["8331B338",0xBE9B],
- ["8331B339",0xBE9C],
- ["8331B430",0xBE9D],
- ["8331B431",0xBE9E],
- ["8331B432",0xBE9F],
- ["8331B433",0xBEA0],
- ["8331B434",0xBEA1],
- ["8331B435",0xBEA2],
- ["8331B436",0xBEA3],
- ["8331B437",0xBEA4],
- ["8331B438",0xBEA5],
- ["8331B439",0xBEA6],
- ["8331B530",0xBEA7],
- ["8331B531",0xBEA8],
- ["8331B532",0xBEA9],
- ["8331B533",0xBEAA],
- ["8331B534",0xBEAB],
- ["8331B535",0xBEAC],
- ["8331B536",0xBEAD],
- ["8331B537",0xBEAE],
- ["8331B538",0xBEAF],
- ["8331B539",0xBEB0],
- ["8331B630",0xBEB1],
- ["8331B631",0xBEB2],
- ["8331B632",0xBEB3],
- ["8331B633",0xBEB4],
- ["8331B634",0xBEB5],
- ["8331B635",0xBEB6],
- ["8331B636",0xBEB7],
- ["8331B637",0xBEB8],
- ["8331B638",0xBEB9],
- ["8331B639",0xBEBA],
- ["8331B730",0xBEBB],
- ["8331B731",0xBEBC],
- ["8331B732",0xBEBD],
- ["8331B733",0xBEBE],
- ["8331B734",0xBEBF],
- ["8331B735",0xBEC0],
- ["8331B736",0xBEC1],
- ["8331B737",0xBEC2],
- ["8331B738",0xBEC3],
- ["8331B739",0xBEC4],
- ["8331B830",0xBEC5],
- ["8331B831",0xBEC6],
- ["8331B832",0xBEC7],
- ["8331B833",0xBEC8],
- ["8331B834",0xBEC9],
- ["8331B835",0xBECA],
- ["8331B836",0xBECB],
- ["8331B837",0xBECC],
- ["8331B838",0xBECD],
- ["8331B839",0xBECE],
- ["8331B930",0xBECF],
- ["8331B931",0xBED0],
- ["8331B932",0xBED1],
- ["8331B933",0xBED2],
- ["8331B934",0xBED3],
- ["8331B935",0xBED4],
- ["8331B936",0xBED5],
- ["8331B937",0xBED6],
- ["8331B938",0xBED7],
- ["8331B939",0xBED8],
- ["8331BA30",0xBED9],
- ["8331BA31",0xBEDA],
- ["8331BA32",0xBEDB],
- ["8331BA33",0xBEDC],
- ["8331BA34",0xBEDD],
- ["8331BA35",0xBEDE],
- ["8331BA36",0xBEDF],
- ["8331BA37",0xBEE0],
- ["8331BA38",0xBEE1],
- ["8331BA39",0xBEE2],
- ["8331BB30",0xBEE3],
- ["8331BB31",0xBEE4],
- ["8331BB32",0xBEE5],
- ["8331BB33",0xBEE6],
- ["8331BB34",0xBEE7],
- ["8331BB35",0xBEE8],
- ["8331BB36",0xBEE9],
- ["8331BB37",0xBEEA],
- ["8331BB38",0xBEEB],
- ["8331BB39",0xBEEC],
- ["8331BC30",0xBEED],
- ["8331BC31",0xBEEE],
- ["8331BC32",0xBEEF],
- ["8331BC33",0xBEF0],
- ["8331BC34",0xBEF1],
- ["8331BC35",0xBEF2],
- ["8331BC36",0xBEF3],
- ["8331BC37",0xBEF4],
- ["8331BC38",0xBEF5],
- ["8331BC39",0xBEF6],
- ["8331BD30",0xBEF7],
- ["8331BD31",0xBEF8],
- ["8331BD32",0xBEF9],
- ["8331BD33",0xBEFA],
- ["8331BD34",0xBEFB],
- ["8331BD35",0xBEFC],
- ["8331BD36",0xBEFD],
- ["8331BD37",0xBEFE],
- ["8331BD38",0xBEFF],
- ["8331BD39",0xBF00],
- ["8331BE30",0xBF01],
- ["8331BE31",0xBF02],
- ["8331BE32",0xBF03],
- ["8331BE33",0xBF04],
- ["8331BE34",0xBF05],
- ["8331BE35",0xBF06],
- ["8331BE36",0xBF07],
- ["8331BE37",0xBF08],
- ["8331BE38",0xBF09],
- ["8331BE39",0xBF0A],
- ["8331BF30",0xBF0B],
- ["8331BF31",0xBF0C],
- ["8331BF32",0xBF0D],
- ["8331BF33",0xBF0E],
- ["8331BF34",0xBF0F],
- ["8331BF35",0xBF10],
- ["8331BF36",0xBF11],
- ["8331BF37",0xBF12],
- ["8331BF38",0xBF13],
- ["8331BF39",0xBF14],
- ["8331C030",0xBF15],
- ["8331C031",0xBF16],
- ["8331C032",0xBF17],
- ["8331C033",0xBF18],
- ["8331C034",0xBF19],
- ["8331C035",0xBF1A],
- ["8331C036",0xBF1B],
- ["8331C037",0xBF1C],
- ["8331C038",0xBF1D],
- ["8331C039",0xBF1E],
- ["8331C130",0xBF1F],
- ["8331C131",0xBF20],
- ["8331C132",0xBF21],
- ["8331C133",0xBF22],
- ["8331C134",0xBF23],
- ["8331C135",0xBF24],
- ["8331C136",0xBF25],
- ["8331C137",0xBF26],
- ["8331C138",0xBF27],
- ["8331C139",0xBF28],
- ["8331C230",0xBF29],
- ["8331C231",0xBF2A],
- ["8331C232",0xBF2B],
- ["8331C233",0xBF2C],
- ["8331C234",0xBF2D],
- ["8331C235",0xBF2E],
- ["8331C236",0xBF2F],
- ["8331C237",0xBF30],
- ["8331C238",0xBF31],
- ["8331C239",0xBF32],
- ["8331C330",0xBF33],
- ["8331C331",0xBF34],
- ["8331C332",0xBF35],
- ["8331C333",0xBF36],
- ["8331C334",0xBF37],
- ["8331C335",0xBF38],
- ["8331C336",0xBF39],
- ["8331C337",0xBF3A],
- ["8331C338",0xBF3B],
- ["8331C339",0xBF3C],
- ["8331C430",0xBF3D],
- ["8331C431",0xBF3E],
- ["8331C432",0xBF3F],
- ["8331C433",0xBF40],
- ["8331C434",0xBF41],
- ["8331C435",0xBF42],
- ["8331C436",0xBF43],
- ["8331C437",0xBF44],
- ["8331C438",0xBF45],
- ["8331C439",0xBF46],
- ["8331C530",0xBF47],
- ["8331C531",0xBF48],
- ["8331C532",0xBF49],
- ["8331C533",0xBF4A],
- ["8331C534",0xBF4B],
- ["8331C535",0xBF4C],
- ["8331C536",0xBF4D],
- ["8331C537",0xBF4E],
- ["8331C538",0xBF4F],
- ["8331C539",0xBF50],
- ["8331C630",0xBF51],
- ["8331C631",0xBF52],
- ["8331C632",0xBF53],
- ["8331C633",0xBF54],
- ["8331C634",0xBF55],
- ["8331C635",0xBF56],
- ["8331C636",0xBF57],
- ["8331C637",0xBF58],
- ["8331C638",0xBF59],
- ["8331C639",0xBF5A],
- ["8331C730",0xBF5B],
- ["8331C731",0xBF5C],
- ["8331C732",0xBF5D],
- ["8331C733",0xBF5E],
- ["8331C734",0xBF5F],
- ["8331C735",0xBF60],
- ["8331C736",0xBF61],
- ["8331C737",0xBF62],
- ["8331C738",0xBF63],
- ["8331C739",0xBF64],
- ["8331C830",0xBF65],
- ["8331C831",0xBF66],
- ["8331C832",0xBF67],
- ["8331C833",0xBF68],
- ["8331C834",0xBF69],
- ["8331C835",0xBF6A],
- ["8331C836",0xBF6B],
- ["8331C837",0xBF6C],
- ["8331C838",0xBF6D],
- ["8331C839",0xBF6E],
- ["8331C930",0xBF6F],
- ["8331C931",0xBF70],
- ["8331C932",0xBF71],
- ["8331C933",0xBF72],
- ["8331C934",0xBF73],
- ["8331C935",0xBF74],
- ["8331C936",0xBF75],
- ["8331C937",0xBF76],
- ["8331C938",0xBF77],
- ["8331C939",0xBF78],
- ["8331CA30",0xBF79],
- ["8331CA31",0xBF7A],
- ["8331CA32",0xBF7B],
- ["8331CA33",0xBF7C],
- ["8331CA34",0xBF7D],
- ["8331CA35",0xBF7E],
- ["8331CA36",0xBF7F],
- ["8331CA37",0xBF80],
- ["8331CA38",0xBF81],
- ["8331CA39",0xBF82],
- ["8331CB30",0xBF83],
- ["8331CB31",0xBF84],
- ["8331CB32",0xBF85],
- ["8331CB33",0xBF86],
- ["8331CB34",0xBF87],
- ["8331CB35",0xBF88],
- ["8331CB36",0xBF89],
- ["8331CB37",0xBF8A],
- ["8331CB38",0xBF8B],
- ["8331CB39",0xBF8C],
- ["8331CC30",0xBF8D],
- ["8331CC31",0xBF8E],
- ["8331CC32",0xBF8F],
- ["8331CC33",0xBF90],
- ["8331CC34",0xBF91],
- ["8331CC35",0xBF92],
- ["8331CC36",0xBF93],
- ["8331CC37",0xBF94],
- ["8331CC38",0xBF95],
- ["8331CC39",0xBF96],
- ["8331CD30",0xBF97],
- ["8331CD31",0xBF98],
- ["8331CD32",0xBF99],
- ["8331CD33",0xBF9A],
- ["8331CD34",0xBF9B],
- ["8331CD35",0xBF9C],
- ["8331CD36",0xBF9D],
- ["8331CD37",0xBF9E],
- ["8331CD38",0xBF9F],
- ["8331CD39",0xBFA0],
- ["8331CE30",0xBFA1],
- ["8331CE31",0xBFA2],
- ["8331CE32",0xBFA3],
- ["8331CE33",0xBFA4],
- ["8331CE34",0xBFA5],
- ["8331CE35",0xBFA6],
- ["8331CE36",0xBFA7],
- ["8331CE37",0xBFA8],
- ["8331CE38",0xBFA9],
- ["8331CE39",0xBFAA],
- ["8331CF30",0xBFAB],
- ["8331CF31",0xBFAC],
- ["8331CF32",0xBFAD],
- ["8331CF33",0xBFAE],
- ["8331CF34",0xBFAF],
- ["8331CF35",0xBFB0],
- ["8331CF36",0xBFB1],
- ["8331CF37",0xBFB2],
- ["8331CF38",0xBFB3],
- ["8331CF39",0xBFB4],
- ["8331D030",0xBFB5],
- ["8331D031",0xBFB6],
- ["8331D032",0xBFB7],
- ["8331D033",0xBFB8],
- ["8331D034",0xBFB9],
- ["8331D035",0xBFBA],
- ["8331D036",0xBFBB],
- ["8331D037",0xBFBC],
- ["8331D038",0xBFBD],
- ["8331D039",0xBFBE],
- ["8331D130",0xBFBF],
- ["8331D131",0xBFC0],
- ["8331D132",0xBFC1],
- ["8331D133",0xBFC2],
- ["8331D134",0xBFC3],
- ["8331D135",0xBFC4],
- ["8331D136",0xBFC5],
- ["8331D137",0xBFC6],
- ["8331D138",0xBFC7],
- ["8331D139",0xBFC8],
- ["8331D230",0xBFC9],
- ["8331D231",0xBFCA],
- ["8331D232",0xBFCB],
- ["8331D233",0xBFCC],
- ["8331D234",0xBFCD],
- ["8331D235",0xBFCE],
- ["8331D236",0xBFCF],
- ["8331D237",0xBFD0],
- ["8331D238",0xBFD1],
- ["8331D239",0xBFD2],
- ["8331D330",0xBFD3],
- ["8331D331",0xBFD4],
- ["8331D332",0xBFD5],
- ["8331D333",0xBFD6],
- ["8331D334",0xBFD7],
- ["8331D335",0xBFD8],
- ["8331D336",0xBFD9],
- ["8331D337",0xBFDA],
- ["8331D338",0xBFDB],
- ["8331D339",0xBFDC],
- ["8331D430",0xBFDD],
- ["8331D431",0xBFDE],
- ["8331D432",0xBFDF],
- ["8331D433",0xBFE0],
- ["8331D434",0xBFE1],
- ["8331D435",0xBFE2],
- ["8331D436",0xBFE3],
- ["8331D437",0xBFE4],
- ["8331D438",0xBFE5],
- ["8331D439",0xBFE6],
- ["8331D530",0xBFE7],
- ["8331D531",0xBFE8],
- ["8331D532",0xBFE9],
- ["8331D533",0xBFEA],
- ["8331D534",0xBFEB],
- ["8331D535",0xBFEC],
- ["8331D536",0xBFED],
- ["8331D537",0xBFEE],
- ["8331D538",0xBFEF],
- ["8331D539",0xBFF0],
- ["8331D630",0xBFF1],
- ["8331D631",0xBFF2],
- ["8331D632",0xBFF3],
- ["8331D633",0xBFF4],
- ["8331D634",0xBFF5],
- ["8331D635",0xBFF6],
- ["8331D636",0xBFF7],
- ["8331D637",0xBFF8],
- ["8331D638",0xBFF9],
- ["8331D639",0xBFFA],
- ["8331D730",0xBFFB],
- ["8331D731",0xBFFC],
- ["8331D732",0xBFFD],
- ["8331D733",0xBFFE],
- ["8331D734",0xBFFF],
- ["8331D735",0xC000],
- ["8331D736",0xC001],
- ["8331D737",0xC002],
- ["8331D738",0xC003],
- ["8331D739",0xC004],
- ["8331D830",0xC005],
- ["8331D831",0xC006],
- ["8331D832",0xC007],
- ["8331D833",0xC008],
- ["8331D834",0xC009],
- ["8331D835",0xC00A],
- ["8331D836",0xC00B],
- ["8331D837",0xC00C],
- ["8331D838",0xC00D],
- ["8331D839",0xC00E],
- ["8331D930",0xC00F],
- ["8331D931",0xC010],
- ["8331D932",0xC011],
- ["8331D933",0xC012],
- ["8331D934",0xC013],
- ["8331D935",0xC014],
- ["8331D936",0xC015],
- ["8331D937",0xC016],
- ["8331D938",0xC017],
- ["8331D939",0xC018],
- ["8331DA30",0xC019],
- ["8331DA31",0xC01A],
- ["8331DA32",0xC01B],
- ["8331DA33",0xC01C],
- ["8331DA34",0xC01D],
- ["8331DA35",0xC01E],
- ["8331DA36",0xC01F],
- ["8331DA37",0xC020],
- ["8331DA38",0xC021],
- ["8331DA39",0xC022],
- ["8331DB30",0xC023],
- ["8331DB31",0xC024],
- ["8331DB32",0xC025],
- ["8331DB33",0xC026],
- ["8331DB34",0xC027],
- ["8331DB35",0xC028],
- ["8331DB36",0xC029],
- ["8331DB37",0xC02A],
- ["8331DB38",0xC02B],
- ["8331DB39",0xC02C],
- ["8331DC30",0xC02D],
- ["8331DC31",0xC02E],
- ["8331DC32",0xC02F],
- ["8331DC33",0xC030],
- ["8331DC34",0xC031],
- ["8331DC35",0xC032],
- ["8331DC36",0xC033],
- ["8331DC37",0xC034],
- ["8331DC38",0xC035],
- ["8331DC39",0xC036],
- ["8331DD30",0xC037],
- ["8331DD31",0xC038],
- ["8331DD32",0xC039],
- ["8331DD33",0xC03A],
- ["8331DD34",0xC03B],
- ["8331DD35",0xC03C],
- ["8331DD36",0xC03D],
- ["8331DD37",0xC03E],
- ["8331DD38",0xC03F],
- ["8331DD39",0xC040],
- ["8331DE30",0xC041],
- ["8331DE31",0xC042],
- ["8331DE32",0xC043],
- ["8331DE33",0xC044],
- ["8331DE34",0xC045],
- ["8331DE35",0xC046],
- ["8331DE36",0xC047],
- ["8331DE37",0xC048],
- ["8331DE38",0xC049],
- ["8331DE39",0xC04A],
- ["8331DF30",0xC04B],
- ["8331DF31",0xC04C],
- ["8331DF32",0xC04D],
- ["8331DF33",0xC04E],
- ["8331DF34",0xC04F],
- ["8331DF35",0xC050],
- ["8331DF36",0xC051],
- ["8331DF37",0xC052],
- ["8331DF38",0xC053],
- ["8331DF39",0xC054],
- ["8331E030",0xC055],
- ["8331E031",0xC056],
- ["8331E032",0xC057],
- ["8331E033",0xC058],
- ["8331E034",0xC059],
- ["8331E035",0xC05A],
- ["8331E036",0xC05B],
- ["8331E037",0xC05C],
- ["8331E038",0xC05D],
- ["8331E039",0xC05E],
- ["8331E130",0xC05F],
- ["8331E131",0xC060],
- ["8331E132",0xC061],
- ["8331E133",0xC062],
- ["8331E134",0xC063],
- ["8331E135",0xC064],
- ["8331E136",0xC065],
- ["8331E137",0xC066],
- ["8331E138",0xC067],
- ["8331E139",0xC068],
- ["8331E230",0xC069],
- ["8331E231",0xC06A],
- ["8331E232",0xC06B],
- ["8331E233",0xC06C],
- ["8331E234",0xC06D],
- ["8331E235",0xC06E],
- ["8331E236",0xC06F],
- ["8331E237",0xC070],
- ["8331E238",0xC071],
- ["8331E239",0xC072],
- ["8331E330",0xC073],
- ["8331E331",0xC074],
- ["8331E332",0xC075],
- ["8331E333",0xC076],
- ["8331E334",0xC077],
- ["8331E335",0xC078],
- ["8331E336",0xC079],
- ["8331E337",0xC07A],
- ["8331E338",0xC07B],
- ["8331E339",0xC07C],
- ["8331E430",0xC07D],
- ["8331E431",0xC07E],
- ["8331E432",0xC07F],
- ["8331E433",0xC080],
- ["8331E434",0xC081],
- ["8331E435",0xC082],
- ["8331E436",0xC083],
- ["8331E437",0xC084],
- ["8331E438",0xC085],
- ["8331E439",0xC086],
- ["8331E530",0xC087],
- ["8331E531",0xC088],
- ["8331E532",0xC089],
- ["8331E533",0xC08A],
- ["8331E534",0xC08B],
- ["8331E535",0xC08C],
- ["8331E536",0xC08D],
- ["8331E537",0xC08E],
- ["8331E538",0xC08F],
- ["8331E539",0xC090],
- ["8331E630",0xC091],
- ["8331E631",0xC092],
- ["8331E632",0xC093],
- ["8331E633",0xC094],
- ["8331E634",0xC095],
- ["8331E635",0xC096],
- ["8331E636",0xC097],
- ["8331E637",0xC098],
- ["8331E638",0xC099],
- ["8331E639",0xC09A],
- ["8331E730",0xC09B],
- ["8331E731",0xC09C],
- ["8331E732",0xC09D],
- ["8331E733",0xC09E],
- ["8331E734",0xC09F],
- ["8331E735",0xC0A0],
- ["8331E736",0xC0A1],
- ["8331E737",0xC0A2],
- ["8331E738",0xC0A3],
- ["8331E739",0xC0A4],
- ["8331E830",0xC0A5],
- ["8331E831",0xC0A6],
- ["8331E832",0xC0A7],
- ["8331E833",0xC0A8],
- ["8331E834",0xC0A9],
- ["8331E835",0xC0AA],
- ["8331E836",0xC0AB],
- ["8331E837",0xC0AC],
- ["8331E838",0xC0AD],
- ["8331E839",0xC0AE],
- ["8331E930",0xC0AF],
- ["8331E931",0xC0B0],
- ["8331E932",0xC0B1],
- ["8331E933",0xC0B2],
- ["8331E934",0xC0B3],
- ["8331E935",0xC0B4],
- ["8331E936",0xC0B5],
- ["8331E937",0xC0B6],
- ["8331E938",0xC0B7],
- ["8331E939",0xC0B8],
- ["8331EA30",0xC0B9],
- ["8331EA31",0xC0BA],
- ["8331EA32",0xC0BB],
- ["8331EA33",0xC0BC],
- ["8331EA34",0xC0BD],
- ["8331EA35",0xC0BE],
- ["8331EA36",0xC0BF],
- ["8331EA37",0xC0C0],
- ["8331EA38",0xC0C1],
- ["8331EA39",0xC0C2],
- ["8331EB30",0xC0C3],
- ["8331EB31",0xC0C4],
- ["8331EB32",0xC0C5],
- ["8331EB33",0xC0C6],
- ["8331EB34",0xC0C7],
- ["8331EB35",0xC0C8],
- ["8331EB36",0xC0C9],
- ["8331EB37",0xC0CA],
- ["8331EB38",0xC0CB],
- ["8331EB39",0xC0CC],
- ["8331EC30",0xC0CD],
- ["8331EC31",0xC0CE],
- ["8331EC32",0xC0CF],
- ["8331EC33",0xC0D0],
- ["8331EC34",0xC0D1],
- ["8331EC35",0xC0D2],
- ["8331EC36",0xC0D3],
- ["8331EC37",0xC0D4],
- ["8331EC38",0xC0D5],
- ["8331EC39",0xC0D6],
- ["8331ED30",0xC0D7],
- ["8331ED31",0xC0D8],
- ["8331ED32",0xC0D9],
- ["8331ED33",0xC0DA],
- ["8331ED34",0xC0DB],
- ["8331ED35",0xC0DC],
- ["8331ED36",0xC0DD],
- ["8331ED37",0xC0DE],
- ["8331ED38",0xC0DF],
- ["8331ED39",0xC0E0],
- ["8331EE30",0xC0E1],
- ["8331EE31",0xC0E2],
- ["8331EE32",0xC0E3],
- ["8331EE33",0xC0E4],
- ["8331EE34",0xC0E5],
- ["8331EE35",0xC0E6],
- ["8331EE36",0xC0E7],
- ["8331EE37",0xC0E8],
- ["8331EE38",0xC0E9],
- ["8331EE39",0xC0EA],
- ["8331EF30",0xC0EB],
- ["8331EF31",0xC0EC],
- ["8331EF32",0xC0ED],
- ["8331EF33",0xC0EE],
- ["8331EF34",0xC0EF],
- ["8331EF35",0xC0F0],
- ["8331EF36",0xC0F1],
- ["8331EF37",0xC0F2],
- ["8331EF38",0xC0F3],
- ["8331EF39",0xC0F4],
- ["8331F030",0xC0F5],
- ["8331F031",0xC0F6],
- ["8331F032",0xC0F7],
- ["8331F033",0xC0F8],
- ["8331F034",0xC0F9],
- ["8331F035",0xC0FA],
- ["8331F036",0xC0FB],
- ["8331F037",0xC0FC],
- ["8331F038",0xC0FD],
- ["8331F039",0xC0FE],
- ["8331F130",0xC0FF],
- ["8331F131",0xC100],
- ["8331F132",0xC101],
- ["8331F133",0xC102],
- ["8331F134",0xC103],
- ["8331F135",0xC104],
- ["8331F136",0xC105],
- ["8331F137",0xC106],
- ["8331F138",0xC107],
- ["8331F139",0xC108],
- ["8331F230",0xC109],
- ["8331F231",0xC10A],
- ["8331F232",0xC10B],
- ["8331F233",0xC10C],
- ["8331F234",0xC10D],
- ["8331F235",0xC10E],
- ["8331F236",0xC10F],
- ["8331F237",0xC110],
- ["8331F238",0xC111],
- ["8331F239",0xC112],
- ["8331F330",0xC113],
- ["8331F331",0xC114],
- ["8331F332",0xC115],
- ["8331F333",0xC116],
- ["8331F334",0xC117],
- ["8331F335",0xC118],
- ["8331F336",0xC119],
- ["8331F337",0xC11A],
- ["8331F338",0xC11B],
- ["8331F339",0xC11C],
- ["8331F430",0xC11D],
- ["8331F431",0xC11E],
- ["8331F432",0xC11F],
- ["8331F433",0xC120],
- ["8331F434",0xC121],
- ["8331F435",0xC122],
- ["8331F436",0xC123],
- ["8331F437",0xC124],
- ["8331F438",0xC125],
- ["8331F439",0xC126],
- ["8331F530",0xC127],
- ["8331F531",0xC128],
- ["8331F532",0xC129],
- ["8331F533",0xC12A],
- ["8331F534",0xC12B],
- ["8331F535",0xC12C],
- ["8331F536",0xC12D],
- ["8331F537",0xC12E],
- ["8331F538",0xC12F],
- ["8331F539",0xC130],
- ["8331F630",0xC131],
- ["8331F631",0xC132],
- ["8331F632",0xC133],
- ["8331F633",0xC134],
- ["8331F634",0xC135],
- ["8331F635",0xC136],
- ["8331F636",0xC137],
- ["8331F637",0xC138],
- ["8331F638",0xC139],
- ["8331F639",0xC13A],
- ["8331F730",0xC13B],
- ["8331F731",0xC13C],
- ["8331F732",0xC13D],
- ["8331F733",0xC13E],
- ["8331F734",0xC13F],
- ["8331F735",0xC140],
- ["8331F736",0xC141],
- ["8331F737",0xC142],
- ["8331F738",0xC143],
- ["8331F739",0xC144],
- ["8331F830",0xC145],
- ["8331F831",0xC146],
- ["8331F832",0xC147],
- ["8331F833",0xC148],
- ["8331F834",0xC149],
- ["8331F835",0xC14A],
- ["8331F836",0xC14B],
- ["8331F837",0xC14C],
- ["8331F838",0xC14D],
- ["8331F839",0xC14E],
- ["8331F930",0xC14F],
- ["8331F931",0xC150],
- ["8331F932",0xC151],
- ["8331F933",0xC152],
- ["8331F934",0xC153],
- ["8331F935",0xC154],
- ["8331F936",0xC155],
- ["8331F937",0xC156],
- ["8331F938",0xC157],
- ["8331F939",0xC158],
- ["8331FA30",0xC159],
- ["8331FA31",0xC15A],
- ["8331FA32",0xC15B],
- ["8331FA33",0xC15C],
- ["8331FA34",0xC15D],
- ["8331FA35",0xC15E],
- ["8331FA36",0xC15F],
- ["8331FA37",0xC160],
- ["8331FA38",0xC161],
- ["8331FA39",0xC162],
- ["8331FB30",0xC163],
- ["8331FB31",0xC164],
- ["8331FB32",0xC165],
- ["8331FB33",0xC166],
- ["8331FB34",0xC167],
- ["8331FB35",0xC168],
- ["8331FB36",0xC169],
- ["8331FB37",0xC16A],
- ["8331FB38",0xC16B],
- ["8331FB39",0xC16C],
- ["8331FC30",0xC16D],
- ["8331FC31",0xC16E],
- ["8331FC32",0xC16F],
- ["8331FC33",0xC170],
- ["8331FC34",0xC171],
- ["8331FC35",0xC172],
- ["8331FC36",0xC173],
- ["8331FC37",0xC174],
- ["8331FC38",0xC175],
- ["8331FC39",0xC176],
- ["8331FD30",0xC177],
- ["8331FD31",0xC178],
- ["8331FD32",0xC179],
- ["8331FD33",0xC17A],
- ["8331FD34",0xC17B],
- ["8331FD35",0xC17C],
- ["8331FD36",0xC17D],
- ["8331FD37",0xC17E],
- ["8331FD38",0xC17F],
- ["8331FD39",0xC180],
- ["8331FE30",0xC181],
- ["8331FE31",0xC182],
- ["8331FE32",0xC183],
- ["8331FE33",0xC184],
- ["8331FE34",0xC185],
- ["8331FE35",0xC186],
- ["8331FE36",0xC187],
- ["8331FE37",0xC188],
- ["8331FE38",0xC189],
- ["8331FE39",0xC18A],
- ["83328130",0xC18B],
- ["83328131",0xC18C],
- ["83328132",0xC18D],
- ["83328133",0xC18E],
- ["83328134",0xC18F],
- ["83328135",0xC190],
- ["83328136",0xC191],
- ["83328137",0xC192],
- ["83328138",0xC193],
- ["83328139",0xC194],
- ["83328230",0xC195],
- ["83328231",0xC196],
- ["83328232",0xC197],
- ["83328233",0xC198],
- ["83328234",0xC199],
- ["83328235",0xC19A],
- ["83328236",0xC19B],
- ["83328237",0xC19C],
- ["83328238",0xC19D],
- ["83328239",0xC19E],
- ["83328330",0xC19F],
- ["83328331",0xC1A0],
- ["83328332",0xC1A1],
- ["83328333",0xC1A2],
- ["83328334",0xC1A3],
- ["83328335",0xC1A4],
- ["83328336",0xC1A5],
- ["83328337",0xC1A6],
- ["83328338",0xC1A7],
- ["83328339",0xC1A8],
- ["83328430",0xC1A9],
- ["83328431",0xC1AA],
- ["83328432",0xC1AB],
- ["83328433",0xC1AC],
- ["83328434",0xC1AD],
- ["83328435",0xC1AE],
- ["83328436",0xC1AF],
- ["83328437",0xC1B0],
- ["83328438",0xC1B1],
- ["83328439",0xC1B2],
- ["83328530",0xC1B3],
- ["83328531",0xC1B4],
- ["83328532",0xC1B5],
- ["83328533",0xC1B6],
- ["83328534",0xC1B7],
- ["83328535",0xC1B8],
- ["83328536",0xC1B9],
- ["83328537",0xC1BA],
- ["83328538",0xC1BB],
- ["83328539",0xC1BC],
- ["83328630",0xC1BD],
- ["83328631",0xC1BE],
- ["83328632",0xC1BF],
- ["83328633",0xC1C0],
- ["83328634",0xC1C1],
- ["83328635",0xC1C2],
- ["83328636",0xC1C3],
- ["83328637",0xC1C4],
- ["83328638",0xC1C5],
- ["83328639",0xC1C6],
- ["83328730",0xC1C7],
- ["83328731",0xC1C8],
- ["83328732",0xC1C9],
- ["83328733",0xC1CA],
- ["83328734",0xC1CB],
- ["83328735",0xC1CC],
- ["83328736",0xC1CD],
- ["83328737",0xC1CE],
- ["83328738",0xC1CF],
- ["83328739",0xC1D0],
- ["83328830",0xC1D1],
- ["83328831",0xC1D2],
- ["83328832",0xC1D3],
- ["83328833",0xC1D4],
- ["83328834",0xC1D5],
- ["83328835",0xC1D6],
- ["83328836",0xC1D7],
- ["83328837",0xC1D8],
- ["83328838",0xC1D9],
- ["83328839",0xC1DA],
- ["83328930",0xC1DB],
- ["83328931",0xC1DC],
- ["83328932",0xC1DD],
- ["83328933",0xC1DE],
- ["83328934",0xC1DF],
- ["83328935",0xC1E0],
- ["83328936",0xC1E1],
- ["83328937",0xC1E2],
- ["83328938",0xC1E3],
- ["83328939",0xC1E4],
- ["83328A30",0xC1E5],
- ["83328A31",0xC1E6],
- ["83328A32",0xC1E7],
- ["83328A33",0xC1E8],
- ["83328A34",0xC1E9],
- ["83328A35",0xC1EA],
- ["83328A36",0xC1EB],
- ["83328A37",0xC1EC],
- ["83328A38",0xC1ED],
- ["83328A39",0xC1EE],
- ["83328B30",0xC1EF],
- ["83328B31",0xC1F0],
- ["83328B32",0xC1F1],
- ["83328B33",0xC1F2],
- ["83328B34",0xC1F3],
- ["83328B35",0xC1F4],
- ["83328B36",0xC1F5],
- ["83328B37",0xC1F6],
- ["83328B38",0xC1F7],
- ["83328B39",0xC1F8],
- ["83328C30",0xC1F9],
- ["83328C31",0xC1FA],
- ["83328C32",0xC1FB],
- ["83328C33",0xC1FC],
- ["83328C34",0xC1FD],
- ["83328C35",0xC1FE],
- ["83328C36",0xC1FF],
- ["83328C37",0xC200],
- ["83328C38",0xC201],
- ["83328C39",0xC202],
- ["83328D30",0xC203],
- ["83328D31",0xC204],
- ["83328D32",0xC205],
- ["83328D33",0xC206],
- ["83328D34",0xC207],
- ["83328D35",0xC208],
- ["83328D36",0xC209],
- ["83328D37",0xC20A],
- ["83328D38",0xC20B],
- ["83328D39",0xC20C],
- ["83328E30",0xC20D],
- ["83328E31",0xC20E],
- ["83328E32",0xC20F],
- ["83328E33",0xC210],
- ["83328E34",0xC211],
- ["83328E35",0xC212],
- ["83328E36",0xC213],
- ["83328E37",0xC214],
- ["83328E38",0xC215],
- ["83328E39",0xC216],
- ["83328F30",0xC217],
- ["83328F31",0xC218],
- ["83328F32",0xC219],
- ["83328F33",0xC21A],
- ["83328F34",0xC21B],
- ["83328F35",0xC21C],
- ["83328F36",0xC21D],
- ["83328F37",0xC21E],
- ["83328F38",0xC21F],
- ["83328F39",0xC220],
- ["83329030",0xC221],
- ["83329031",0xC222],
- ["83329032",0xC223],
- ["83329033",0xC224],
- ["83329034",0xC225],
- ["83329035",0xC226],
- ["83329036",0xC227],
- ["83329037",0xC228],
- ["83329038",0xC229],
- ["83329039",0xC22A],
- ["83329130",0xC22B],
- ["83329131",0xC22C],
- ["83329132",0xC22D],
- ["83329133",0xC22E],
- ["83329134",0xC22F],
- ["83329135",0xC230],
- ["83329136",0xC231],
- ["83329137",0xC232],
- ["83329138",0xC233],
- ["83329139",0xC234],
- ["83329230",0xC235],
- ["83329231",0xC236],
- ["83329232",0xC237],
- ["83329233",0xC238],
- ["83329234",0xC239],
- ["83329235",0xC23A],
- ["83329236",0xC23B],
- ["83329237",0xC23C],
- ["83329238",0xC23D],
- ["83329239",0xC23E],
- ["83329330",0xC23F],
- ["83329331",0xC240],
- ["83329332",0xC241],
- ["83329333",0xC242],
- ["83329334",0xC243],
- ["83329335",0xC244],
- ["83329336",0xC245],
- ["83329337",0xC246],
- ["83329338",0xC247],
- ["83329339",0xC248],
- ["83329430",0xC249],
- ["83329431",0xC24A],
- ["83329432",0xC24B],
- ["83329433",0xC24C],
- ["83329434",0xC24D],
- ["83329435",0xC24E],
- ["83329436",0xC24F],
- ["83329437",0xC250],
- ["83329438",0xC251],
- ["83329439",0xC252],
- ["83329530",0xC253],
- ["83329531",0xC254],
- ["83329532",0xC255],
- ["83329533",0xC256],
- ["83329534",0xC257],
- ["83329535",0xC258],
- ["83329536",0xC259],
- ["83329537",0xC25A],
- ["83329538",0xC25B],
- ["83329539",0xC25C],
- ["83329630",0xC25D],
- ["83329631",0xC25E],
- ["83329632",0xC25F],
- ["83329633",0xC260],
- ["83329634",0xC261],
- ["83329635",0xC262],
- ["83329636",0xC263],
- ["83329637",0xC264],
- ["83329638",0xC265],
- ["83329639",0xC266],
- ["83329730",0xC267],
- ["83329731",0xC268],
- ["83329732",0xC269],
- ["83329733",0xC26A],
- ["83329734",0xC26B],
- ["83329735",0xC26C],
- ["83329736",0xC26D],
- ["83329737",0xC26E],
- ["83329738",0xC26F],
- ["83329739",0xC270],
- ["83329830",0xC271],
- ["83329831",0xC272],
- ["83329832",0xC273],
- ["83329833",0xC274],
- ["83329834",0xC275],
- ["83329835",0xC276],
- ["83329836",0xC277],
- ["83329837",0xC278],
- ["83329838",0xC279],
- ["83329839",0xC27A],
- ["83329930",0xC27B],
- ["83329931",0xC27C],
- ["83329932",0xC27D],
- ["83329933",0xC27E],
- ["83329934",0xC27F],
- ["83329935",0xC280],
- ["83329936",0xC281],
- ["83329937",0xC282],
- ["83329938",0xC283],
- ["83329939",0xC284],
- ["83329A30",0xC285],
- ["83329A31",0xC286],
- ["83329A32",0xC287],
- ["83329A33",0xC288],
- ["83329A34",0xC289],
- ["83329A35",0xC28A],
- ["83329A36",0xC28B],
- ["83329A37",0xC28C],
- ["83329A38",0xC28D],
- ["83329A39",0xC28E],
- ["83329B30",0xC28F],
- ["83329B31",0xC290],
- ["83329B32",0xC291],
- ["83329B33",0xC292],
- ["83329B34",0xC293],
- ["83329B35",0xC294],
- ["83329B36",0xC295],
- ["83329B37",0xC296],
- ["83329B38",0xC297],
- ["83329B39",0xC298],
- ["83329C30",0xC299],
- ["83329C31",0xC29A],
- ["83329C32",0xC29B],
- ["83329C33",0xC29C],
- ["83329C34",0xC29D],
- ["83329C35",0xC29E],
- ["83329C36",0xC29F],
- ["83329C37",0xC2A0],
- ["83329C38",0xC2A1],
- ["83329C39",0xC2A2],
- ["83329D30",0xC2A3],
- ["83329D31",0xC2A4],
- ["83329D32",0xC2A5],
- ["83329D33",0xC2A6],
- ["83329D34",0xC2A7],
- ["83329D35",0xC2A8],
- ["83329D36",0xC2A9],
- ["83329D37",0xC2AA],
- ["83329D38",0xC2AB],
- ["83329D39",0xC2AC],
- ["83329E30",0xC2AD],
- ["83329E31",0xC2AE],
- ["83329E32",0xC2AF],
- ["83329E33",0xC2B0],
- ["83329E34",0xC2B1],
- ["83329E35",0xC2B2],
- ["83329E36",0xC2B3],
- ["83329E37",0xC2B4],
- ["83329E38",0xC2B5],
- ["83329E39",0xC2B6],
- ["83329F30",0xC2B7],
- ["83329F31",0xC2B8],
- ["83329F32",0xC2B9],
- ["83329F33",0xC2BA],
- ["83329F34",0xC2BB],
- ["83329F35",0xC2BC],
- ["83329F36",0xC2BD],
- ["83329F37",0xC2BE],
- ["83329F38",0xC2BF],
- ["83329F39",0xC2C0],
- ["8332A030",0xC2C1],
- ["8332A031",0xC2C2],
- ["8332A032",0xC2C3],
- ["8332A033",0xC2C4],
- ["8332A034",0xC2C5],
- ["8332A035",0xC2C6],
- ["8332A036",0xC2C7],
- ["8332A037",0xC2C8],
- ["8332A038",0xC2C9],
- ["8332A039",0xC2CA],
- ["8332A130",0xC2CB],
- ["8332A131",0xC2CC],
- ["8332A132",0xC2CD],
- ["8332A133",0xC2CE],
- ["8332A134",0xC2CF],
- ["8332A135",0xC2D0],
- ["8332A136",0xC2D1],
- ["8332A137",0xC2D2],
- ["8332A138",0xC2D3],
- ["8332A139",0xC2D4],
- ["8332A230",0xC2D5],
- ["8332A231",0xC2D6],
- ["8332A232",0xC2D7],
- ["8332A233",0xC2D8],
- ["8332A234",0xC2D9],
- ["8332A235",0xC2DA],
- ["8332A236",0xC2DB],
- ["8332A237",0xC2DC],
- ["8332A238",0xC2DD],
- ["8332A239",0xC2DE],
- ["8332A330",0xC2DF],
- ["8332A331",0xC2E0],
- ["8332A332",0xC2E1],
- ["8332A333",0xC2E2],
- ["8332A334",0xC2E3],
- ["8332A335",0xC2E4],
- ["8332A336",0xC2E5],
- ["8332A337",0xC2E6],
- ["8332A338",0xC2E7],
- ["8332A339",0xC2E8],
- ["8332A430",0xC2E9],
- ["8332A431",0xC2EA],
- ["8332A432",0xC2EB],
- ["8332A433",0xC2EC],
- ["8332A434",0xC2ED],
- ["8332A435",0xC2EE],
- ["8332A436",0xC2EF],
- ["8332A437",0xC2F0],
- ["8332A438",0xC2F1],
- ["8332A439",0xC2F2],
- ["8332A530",0xC2F3],
- ["8332A531",0xC2F4],
- ["8332A532",0xC2F5],
- ["8332A533",0xC2F6],
- ["8332A534",0xC2F7],
- ["8332A535",0xC2F8],
- ["8332A536",0xC2F9],
- ["8332A537",0xC2FA],
- ["8332A538",0xC2FB],
- ["8332A539",0xC2FC],
- ["8332A630",0xC2FD],
- ["8332A631",0xC2FE],
- ["8332A632",0xC2FF],
- ["8332A633",0xC300],
- ["8332A634",0xC301],
- ["8332A635",0xC302],
- ["8332A636",0xC303],
- ["8332A637",0xC304],
- ["8332A638",0xC305],
- ["8332A639",0xC306],
- ["8332A730",0xC307],
- ["8332A731",0xC308],
- ["8332A732",0xC309],
- ["8332A733",0xC30A],
- ["8332A734",0xC30B],
- ["8332A735",0xC30C],
- ["8332A736",0xC30D],
- ["8332A737",0xC30E],
- ["8332A738",0xC30F],
- ["8332A739",0xC310],
- ["8332A830",0xC311],
- ["8332A831",0xC312],
- ["8332A832",0xC313],
- ["8332A833",0xC314],
- ["8332A834",0xC315],
- ["8332A835",0xC316],
- ["8332A836",0xC317],
- ["8332A837",0xC318],
- ["8332A838",0xC319],
- ["8332A839",0xC31A],
- ["8332A930",0xC31B],
- ["8332A931",0xC31C],
- ["8332A932",0xC31D],
- ["8332A933",0xC31E],
- ["8332A934",0xC31F],
- ["8332A935",0xC320],
- ["8332A936",0xC321],
- ["8332A937",0xC322],
- ["8332A938",0xC323],
- ["8332A939",0xC324],
- ["8332AA30",0xC325],
- ["8332AA31",0xC326],
- ["8332AA32",0xC327],
- ["8332AA33",0xC328],
- ["8332AA34",0xC329],
- ["8332AA35",0xC32A],
- ["8332AA36",0xC32B],
- ["8332AA37",0xC32C],
- ["8332AA38",0xC32D],
- ["8332AA39",0xC32E],
- ["8332AB30",0xC32F],
- ["8332AB31",0xC330],
- ["8332AB32",0xC331],
- ["8332AB33",0xC332],
- ["8332AB34",0xC333],
- ["8332AB35",0xC334],
- ["8332AB36",0xC335],
- ["8332AB37",0xC336],
- ["8332AB38",0xC337],
- ["8332AB39",0xC338],
- ["8332AC30",0xC339],
- ["8332AC31",0xC33A],
- ["8332AC32",0xC33B],
- ["8332AC33",0xC33C],
- ["8332AC34",0xC33D],
- ["8332AC35",0xC33E],
- ["8332AC36",0xC33F],
- ["8332AC37",0xC340],
- ["8332AC38",0xC341],
- ["8332AC39",0xC342],
- ["8332AD30",0xC343],
- ["8332AD31",0xC344],
- ["8332AD32",0xC345],
- ["8332AD33",0xC346],
- ["8332AD34",0xC347],
- ["8332AD35",0xC348],
- ["8332AD36",0xC349],
- ["8332AD37",0xC34A],
- ["8332AD38",0xC34B],
- ["8332AD39",0xC34C],
- ["8332AE30",0xC34D],
- ["8332AE31",0xC34E],
- ["8332AE32",0xC34F],
- ["8332AE33",0xC350],
- ["8332AE34",0xC351],
- ["8332AE35",0xC352],
- ["8332AE36",0xC353],
- ["8332AE37",0xC354],
- ["8332AE38",0xC355],
- ["8332AE39",0xC356],
- ["8332AF30",0xC357],
- ["8332AF31",0xC358],
- ["8332AF32",0xC359],
- ["8332AF33",0xC35A],
- ["8332AF34",0xC35B],
- ["8332AF35",0xC35C],
- ["8332AF36",0xC35D],
- ["8332AF37",0xC35E],
- ["8332AF38",0xC35F],
- ["8332AF39",0xC360],
- ["8332B030",0xC361],
- ["8332B031",0xC362],
- ["8332B032",0xC363],
- ["8332B033",0xC364],
- ["8332B034",0xC365],
- ["8332B035",0xC366],
- ["8332B036",0xC367],
- ["8332B037",0xC368],
- ["8332B038",0xC369],
- ["8332B039",0xC36A],
- ["8332B130",0xC36B],
- ["8332B131",0xC36C],
- ["8332B132",0xC36D],
- ["8332B133",0xC36E],
- ["8332B134",0xC36F],
- ["8332B135",0xC370],
- ["8332B136",0xC371],
- ["8332B137",0xC372],
- ["8332B138",0xC373],
- ["8332B139",0xC374],
- ["8332B230",0xC375],
- ["8332B231",0xC376],
- ["8332B232",0xC377],
- ["8332B233",0xC378],
- ["8332B234",0xC379],
- ["8332B235",0xC37A],
- ["8332B236",0xC37B],
- ["8332B237",0xC37C],
- ["8332B238",0xC37D],
- ["8332B239",0xC37E],
- ["8332B330",0xC37F],
- ["8332B331",0xC380],
- ["8332B332",0xC381],
- ["8332B333",0xC382],
- ["8332B334",0xC383],
- ["8332B335",0xC384],
- ["8332B336",0xC385],
- ["8332B337",0xC386],
- ["8332B338",0xC387],
- ["8332B339",0xC388],
- ["8332B430",0xC389],
- ["8332B431",0xC38A],
- ["8332B432",0xC38B],
- ["8332B433",0xC38C],
- ["8332B434",0xC38D],
- ["8332B435",0xC38E],
- ["8332B436",0xC38F],
- ["8332B437",0xC390],
- ["8332B438",0xC391],
- ["8332B439",0xC392],
- ["8332B530",0xC393],
- ["8332B531",0xC394],
- ["8332B532",0xC395],
- ["8332B533",0xC396],
- ["8332B534",0xC397],
- ["8332B535",0xC398],
- ["8332B536",0xC399],
- ["8332B537",0xC39A],
- ["8332B538",0xC39B],
- ["8332B539",0xC39C],
- ["8332B630",0xC39D],
- ["8332B631",0xC39E],
- ["8332B632",0xC39F],
- ["8332B633",0xC3A0],
- ["8332B634",0xC3A1],
- ["8332B635",0xC3A2],
- ["8332B636",0xC3A3],
- ["8332B637",0xC3A4],
- ["8332B638",0xC3A5],
- ["8332B639",0xC3A6],
- ["8332B730",0xC3A7],
- ["8332B731",0xC3A8],
- ["8332B732",0xC3A9],
- ["8332B733",0xC3AA],
- ["8332B734",0xC3AB],
- ["8332B735",0xC3AC],
- ["8332B736",0xC3AD],
- ["8332B737",0xC3AE],
- ["8332B738",0xC3AF],
- ["8332B739",0xC3B0],
- ["8332B830",0xC3B1],
- ["8332B831",0xC3B2],
- ["8332B832",0xC3B3],
- ["8332B833",0xC3B4],
- ["8332B834",0xC3B5],
- ["8332B835",0xC3B6],
- ["8332B836",0xC3B7],
- ["8332B837",0xC3B8],
- ["8332B838",0xC3B9],
- ["8332B839",0xC3BA],
- ["8332B930",0xC3BB],
- ["8332B931",0xC3BC],
- ["8332B932",0xC3BD],
- ["8332B933",0xC3BE],
- ["8332B934",0xC3BF],
- ["8332B935",0xC3C0],
- ["8332B936",0xC3C1],
- ["8332B937",0xC3C2],
- ["8332B938",0xC3C3],
- ["8332B939",0xC3C4],
- ["8332BA30",0xC3C5],
- ["8332BA31",0xC3C6],
- ["8332BA32",0xC3C7],
- ["8332BA33",0xC3C8],
- ["8332BA34",0xC3C9],
- ["8332BA35",0xC3CA],
- ["8332BA36",0xC3CB],
- ["8332BA37",0xC3CC],
- ["8332BA38",0xC3CD],
- ["8332BA39",0xC3CE],
- ["8332BB30",0xC3CF],
- ["8332BB31",0xC3D0],
- ["8332BB32",0xC3D1],
- ["8332BB33",0xC3D2],
- ["8332BB34",0xC3D3],
- ["8332BB35",0xC3D4],
- ["8332BB36",0xC3D5],
- ["8332BB37",0xC3D6],
- ["8332BB38",0xC3D7],
- ["8332BB39",0xC3D8],
- ["8332BC30",0xC3D9],
- ["8332BC31",0xC3DA],
- ["8332BC32",0xC3DB],
- ["8332BC33",0xC3DC],
- ["8332BC34",0xC3DD],
- ["8332BC35",0xC3DE],
- ["8332BC36",0xC3DF],
- ["8332BC37",0xC3E0],
- ["8332BC38",0xC3E1],
- ["8332BC39",0xC3E2],
- ["8332BD30",0xC3E3],
- ["8332BD31",0xC3E4],
- ["8332BD32",0xC3E5],
- ["8332BD33",0xC3E6],
- ["8332BD34",0xC3E7],
- ["8332BD35",0xC3E8],
- ["8332BD36",0xC3E9],
- ["8332BD37",0xC3EA],
- ["8332BD38",0xC3EB],
- ["8332BD39",0xC3EC],
- ["8332BE30",0xC3ED],
- ["8332BE31",0xC3EE],
- ["8332BE32",0xC3EF],
- ["8332BE33",0xC3F0],
- ["8332BE34",0xC3F1],
- ["8332BE35",0xC3F2],
- ["8332BE36",0xC3F3],
- ["8332BE37",0xC3F4],
- ["8332BE38",0xC3F5],
- ["8332BE39",0xC3F6],
- ["8332BF30",0xC3F7],
- ["8332BF31",0xC3F8],
- ["8332BF32",0xC3F9],
- ["8332BF33",0xC3FA],
- ["8332BF34",0xC3FB],
- ["8332BF35",0xC3FC],
- ["8332BF36",0xC3FD],
- ["8332BF37",0xC3FE],
- ["8332BF38",0xC3FF],
- ["8332BF39",0xC400],
- ["8332C030",0xC401],
- ["8332C031",0xC402],
- ["8332C032",0xC403],
- ["8332C033",0xC404],
- ["8332C034",0xC405],
- ["8332C035",0xC406],
- ["8332C036",0xC407],
- ["8332C037",0xC408],
- ["8332C038",0xC409],
- ["8332C039",0xC40A],
- ["8332C130",0xC40B],
- ["8332C131",0xC40C],
- ["8332C132",0xC40D],
- ["8332C133",0xC40E],
- ["8332C134",0xC40F],
- ["8332C135",0xC410],
- ["8332C136",0xC411],
- ["8332C137",0xC412],
- ["8332C138",0xC413],
- ["8332C139",0xC414],
- ["8332C230",0xC415],
- ["8332C231",0xC416],
- ["8332C232",0xC417],
- ["8332C233",0xC418],
- ["8332C234",0xC419],
- ["8332C235",0xC41A],
- ["8332C236",0xC41B],
- ["8332C237",0xC41C],
- ["8332C238",0xC41D],
- ["8332C239",0xC41E],
- ["8332C330",0xC41F],
- ["8332C331",0xC420],
- ["8332C332",0xC421],
- ["8332C333",0xC422],
- ["8332C334",0xC423],
- ["8332C335",0xC424],
- ["8332C336",0xC425],
- ["8332C337",0xC426],
- ["8332C338",0xC427],
- ["8332C339",0xC428],
- ["8332C430",0xC429],
- ["8332C431",0xC42A],
- ["8332C432",0xC42B],
- ["8332C433",0xC42C],
- ["8332C434",0xC42D],
- ["8332C435",0xC42E],
- ["8332C436",0xC42F],
- ["8332C437",0xC430],
- ["8332C438",0xC431],
- ["8332C439",0xC432],
- ["8332C530",0xC433],
- ["8332C531",0xC434],
- ["8332C532",0xC435],
- ["8332C533",0xC436],
- ["8332C534",0xC437],
- ["8332C535",0xC438],
- ["8332C536",0xC439],
- ["8332C537",0xC43A],
- ["8332C538",0xC43B],
- ["8332C539",0xC43C],
- ["8332C630",0xC43D],
- ["8332C631",0xC43E],
- ["8332C632",0xC43F],
- ["8332C633",0xC440],
- ["8332C634",0xC441],
- ["8332C635",0xC442],
- ["8332C636",0xC443],
- ["8332C637",0xC444],
- ["8332C638",0xC445],
- ["8332C639",0xC446],
- ["8332C730",0xC447],
- ["8332C731",0xC448],
- ["8332C732",0xC449],
- ["8332C733",0xC44A],
- ["8332C734",0xC44B],
- ["8332C735",0xC44C],
- ["8332C736",0xC44D],
- ["8332C737",0xC44E],
- ["8332C738",0xC44F],
- ["8332C739",0xC450],
- ["8332C830",0xC451],
- ["8332C831",0xC452],
- ["8332C832",0xC453],
- ["8332C833",0xC454],
- ["8332C834",0xC455],
- ["8332C835",0xC456],
- ["8332C836",0xC457],
- ["8332C837",0xC458],
- ["8332C838",0xC459],
- ["8332C839",0xC45A],
- ["8332C930",0xC45B],
- ["8332C931",0xC45C],
- ["8332C932",0xC45D],
- ["8332C933",0xC45E],
- ["8332C934",0xC45F],
- ["8332C935",0xC460],
- ["8332C936",0xC461],
- ["8332C937",0xC462],
- ["8332C938",0xC463],
- ["8332C939",0xC464],
- ["8332CA30",0xC465],
- ["8332CA31",0xC466],
- ["8332CA32",0xC467],
- ["8332CA33",0xC468],
- ["8332CA34",0xC469],
- ["8332CA35",0xC46A],
- ["8332CA36",0xC46B],
- ["8332CA37",0xC46C],
- ["8332CA38",0xC46D],
- ["8332CA39",0xC46E],
- ["8332CB30",0xC46F],
- ["8332CB31",0xC470],
- ["8332CB32",0xC471],
- ["8332CB33",0xC472],
- ["8332CB34",0xC473],
- ["8332CB35",0xC474],
- ["8332CB36",0xC475],
- ["8332CB37",0xC476],
- ["8332CB38",0xC477],
- ["8332CB39",0xC478],
- ["8332CC30",0xC479],
- ["8332CC31",0xC47A],
- ["8332CC32",0xC47B],
- ["8332CC33",0xC47C],
- ["8332CC34",0xC47D],
- ["8332CC35",0xC47E],
- ["8332CC36",0xC47F],
- ["8332CC37",0xC480],
- ["8332CC38",0xC481],
- ["8332CC39",0xC482],
- ["8332CD30",0xC483],
- ["8332CD31",0xC484],
- ["8332CD32",0xC485],
- ["8332CD33",0xC486],
- ["8332CD34",0xC487],
- ["8332CD35",0xC488],
- ["8332CD36",0xC489],
- ["8332CD37",0xC48A],
- ["8332CD38",0xC48B],
- ["8332CD39",0xC48C],
- ["8332CE30",0xC48D],
- ["8332CE31",0xC48E],
- ["8332CE32",0xC48F],
- ["8332CE33",0xC490],
- ["8332CE34",0xC491],
- ["8332CE35",0xC492],
- ["8332CE36",0xC493],
- ["8332CE37",0xC494],
- ["8332CE38",0xC495],
- ["8332CE39",0xC496],
- ["8332CF30",0xC497],
- ["8332CF31",0xC498],
- ["8332CF32",0xC499],
- ["8332CF33",0xC49A],
- ["8332CF34",0xC49B],
- ["8332CF35",0xC49C],
- ["8332CF36",0xC49D],
- ["8332CF37",0xC49E],
- ["8332CF38",0xC49F],
- ["8332CF39",0xC4A0],
- ["8332D030",0xC4A1],
- ["8332D031",0xC4A2],
- ["8332D032",0xC4A3],
- ["8332D033",0xC4A4],
- ["8332D034",0xC4A5],
- ["8332D035",0xC4A6],
- ["8332D036",0xC4A7],
- ["8332D037",0xC4A8],
- ["8332D038",0xC4A9],
- ["8332D039",0xC4AA],
- ["8332D130",0xC4AB],
- ["8332D131",0xC4AC],
- ["8332D132",0xC4AD],
- ["8332D133",0xC4AE],
- ["8332D134",0xC4AF],
- ["8332D135",0xC4B0],
- ["8332D136",0xC4B1],
- ["8332D137",0xC4B2],
- ["8332D138",0xC4B3],
- ["8332D139",0xC4B4],
- ["8332D230",0xC4B5],
- ["8332D231",0xC4B6],
- ["8332D232",0xC4B7],
- ["8332D233",0xC4B8],
- ["8332D234",0xC4B9],
- ["8332D235",0xC4BA],
- ["8332D236",0xC4BB],
- ["8332D237",0xC4BC],
- ["8332D238",0xC4BD],
- ["8332D239",0xC4BE],
- ["8332D330",0xC4BF],
- ["8332D331",0xC4C0],
- ["8332D332",0xC4C1],
- ["8332D333",0xC4C2],
- ["8332D334",0xC4C3],
- ["8332D335",0xC4C4],
- ["8332D336",0xC4C5],
- ["8332D337",0xC4C6],
- ["8332D338",0xC4C7],
- ["8332D339",0xC4C8],
- ["8332D430",0xC4C9],
- ["8332D431",0xC4CA],
- ["8332D432",0xC4CB],
- ["8332D433",0xC4CC],
- ["8332D434",0xC4CD],
- ["8332D435",0xC4CE],
- ["8332D436",0xC4CF],
- ["8332D437",0xC4D0],
- ["8332D438",0xC4D1],
- ["8332D439",0xC4D2],
- ["8332D530",0xC4D3],
- ["8332D531",0xC4D4],
- ["8332D532",0xC4D5],
- ["8332D533",0xC4D6],
- ["8332D534",0xC4D7],
- ["8332D535",0xC4D8],
- ["8332D536",0xC4D9],
- ["8332D537",0xC4DA],
- ["8332D538",0xC4DB],
- ["8332D539",0xC4DC],
- ["8332D630",0xC4DD],
- ["8332D631",0xC4DE],
- ["8332D632",0xC4DF],
- ["8332D633",0xC4E0],
- ["8332D634",0xC4E1],
- ["8332D635",0xC4E2],
- ["8332D636",0xC4E3],
- ["8332D637",0xC4E4],
- ["8332D638",0xC4E5],
- ["8332D639",0xC4E6],
- ["8332D730",0xC4E7],
- ["8332D731",0xC4E8],
- ["8332D732",0xC4E9],
- ["8332D733",0xC4EA],
- ["8332D734",0xC4EB],
- ["8332D735",0xC4EC],
- ["8332D736",0xC4ED],
- ["8332D737",0xC4EE],
- ["8332D738",0xC4EF],
- ["8332D739",0xC4F0],
- ["8332D830",0xC4F1],
- ["8332D831",0xC4F2],
- ["8332D832",0xC4F3],
- ["8332D833",0xC4F4],
- ["8332D834",0xC4F5],
- ["8332D835",0xC4F6],
- ["8332D836",0xC4F7],
- ["8332D837",0xC4F8],
- ["8332D838",0xC4F9],
- ["8332D839",0xC4FA],
- ["8332D930",0xC4FB],
- ["8332D931",0xC4FC],
- ["8332D932",0xC4FD],
- ["8332D933",0xC4FE],
- ["8332D934",0xC4FF],
- ["8332D935",0xC500],
- ["8332D936",0xC501],
- ["8332D937",0xC502],
- ["8332D938",0xC503],
- ["8332D939",0xC504],
- ["8332DA30",0xC505],
- ["8332DA31",0xC506],
- ["8332DA32",0xC507],
- ["8332DA33",0xC508],
- ["8332DA34",0xC509],
- ["8332DA35",0xC50A],
- ["8332DA36",0xC50B],
- ["8332DA37",0xC50C],
- ["8332DA38",0xC50D],
- ["8332DA39",0xC50E],
- ["8332DB30",0xC50F],
- ["8332DB31",0xC510],
- ["8332DB32",0xC511],
- ["8332DB33",0xC512],
- ["8332DB34",0xC513],
- ["8332DB35",0xC514],
- ["8332DB36",0xC515],
- ["8332DB37",0xC516],
- ["8332DB38",0xC517],
- ["8332DB39",0xC518],
- ["8332DC30",0xC519],
- ["8332DC31",0xC51A],
- ["8332DC32",0xC51B],
- ["8332DC33",0xC51C],
- ["8332DC34",0xC51D],
- ["8332DC35",0xC51E],
- ["8332DC36",0xC51F],
- ["8332DC37",0xC520],
- ["8332DC38",0xC521],
- ["8332DC39",0xC522],
- ["8332DD30",0xC523],
- ["8332DD31",0xC524],
- ["8332DD32",0xC525],
- ["8332DD33",0xC526],
- ["8332DD34",0xC527],
- ["8332DD35",0xC528],
- ["8332DD36",0xC529],
- ["8332DD37",0xC52A],
- ["8332DD38",0xC52B],
- ["8332DD39",0xC52C],
- ["8332DE30",0xC52D],
- ["8332DE31",0xC52E],
- ["8332DE32",0xC52F],
- ["8332DE33",0xC530],
- ["8332DE34",0xC531],
- ["8332DE35",0xC532],
- ["8332DE36",0xC533],
- ["8332DE37",0xC534],
- ["8332DE38",0xC535],
- ["8332DE39",0xC536],
- ["8332DF30",0xC537],
- ["8332DF31",0xC538],
- ["8332DF32",0xC539],
- ["8332DF33",0xC53A],
- ["8332DF34",0xC53B],
- ["8332DF35",0xC53C],
- ["8332DF36",0xC53D],
- ["8332DF37",0xC53E],
- ["8332DF38",0xC53F],
- ["8332DF39",0xC540],
- ["8332E030",0xC541],
- ["8332E031",0xC542],
- ["8332E032",0xC543],
- ["8332E033",0xC544],
- ["8332E034",0xC545],
- ["8332E035",0xC546],
- ["8332E036",0xC547],
- ["8332E037",0xC548],
- ["8332E038",0xC549],
- ["8332E039",0xC54A],
- ["8332E130",0xC54B],
- ["8332E131",0xC54C],
- ["8332E132",0xC54D],
- ["8332E133",0xC54E],
- ["8332E134",0xC54F],
- ["8332E135",0xC550],
- ["8332E136",0xC551],
- ["8332E137",0xC552],
- ["8332E138",0xC553],
- ["8332E139",0xC554],
- ["8332E230",0xC555],
- ["8332E231",0xC556],
- ["8332E232",0xC557],
- ["8332E233",0xC558],
- ["8332E234",0xC559],
- ["8332E235",0xC55A],
- ["8332E236",0xC55B],
- ["8332E237",0xC55C],
- ["8332E238",0xC55D],
- ["8332E239",0xC55E],
- ["8332E330",0xC55F],
- ["8332E331",0xC560],
- ["8332E332",0xC561],
- ["8332E333",0xC562],
- ["8332E334",0xC563],
- ["8332E335",0xC564],
- ["8332E336",0xC565],
- ["8332E337",0xC566],
- ["8332E338",0xC567],
- ["8332E339",0xC568],
- ["8332E430",0xC569],
- ["8332E431",0xC56A],
- ["8332E432",0xC56B],
- ["8332E433",0xC56C],
- ["8332E434",0xC56D],
- ["8332E435",0xC56E],
- ["8332E436",0xC56F],
- ["8332E437",0xC570],
- ["8332E438",0xC571],
- ["8332E439",0xC572],
- ["8332E530",0xC573],
- ["8332E531",0xC574],
- ["8332E532",0xC575],
- ["8332E533",0xC576],
- ["8332E534",0xC577],
- ["8332E535",0xC578],
- ["8332E536",0xC579],
- ["8332E537",0xC57A],
- ["8332E538",0xC57B],
- ["8332E539",0xC57C],
- ["8332E630",0xC57D],
- ["8332E631",0xC57E],
- ["8332E632",0xC57F],
- ["8332E633",0xC580],
- ["8332E634",0xC581],
- ["8332E635",0xC582],
- ["8332E636",0xC583],
- ["8332E637",0xC584],
- ["8332E638",0xC585],
- ["8332E639",0xC586],
- ["8332E730",0xC587],
- ["8332E731",0xC588],
- ["8332E732",0xC589],
- ["8332E733",0xC58A],
- ["8332E734",0xC58B],
- ["8332E735",0xC58C],
- ["8332E736",0xC58D],
- ["8332E737",0xC58E],
- ["8332E738",0xC58F],
- ["8332E739",0xC590],
- ["8332E830",0xC591],
- ["8332E831",0xC592],
- ["8332E832",0xC593],
- ["8332E833",0xC594],
- ["8332E834",0xC595],
- ["8332E835",0xC596],
- ["8332E836",0xC597],
- ["8332E837",0xC598],
- ["8332E838",0xC599],
- ["8332E839",0xC59A],
- ["8332E930",0xC59B],
- ["8332E931",0xC59C],
- ["8332E932",0xC59D],
- ["8332E933",0xC59E],
- ["8332E934",0xC59F],
- ["8332E935",0xC5A0],
- ["8332E936",0xC5A1],
- ["8332E937",0xC5A2],
- ["8332E938",0xC5A3],
- ["8332E939",0xC5A4],
- ["8332EA30",0xC5A5],
- ["8332EA31",0xC5A6],
- ["8332EA32",0xC5A7],
- ["8332EA33",0xC5A8],
- ["8332EA34",0xC5A9],
- ["8332EA35",0xC5AA],
- ["8332EA36",0xC5AB],
- ["8332EA37",0xC5AC],
- ["8332EA38",0xC5AD],
- ["8332EA39",0xC5AE],
- ["8332EB30",0xC5AF],
- ["8332EB31",0xC5B0],
- ["8332EB32",0xC5B1],
- ["8332EB33",0xC5B2],
- ["8332EB34",0xC5B3],
- ["8332EB35",0xC5B4],
- ["8332EB36",0xC5B5],
- ["8332EB37",0xC5B6],
- ["8332EB38",0xC5B7],
- ["8332EB39",0xC5B8],
- ["8332EC30",0xC5B9],
- ["8332EC31",0xC5BA],
- ["8332EC32",0xC5BB],
- ["8332EC33",0xC5BC],
- ["8332EC34",0xC5BD],
- ["8332EC35",0xC5BE],
- ["8332EC36",0xC5BF],
- ["8332EC37",0xC5C0],
- ["8332EC38",0xC5C1],
- ["8332EC39",0xC5C2],
- ["8332ED30",0xC5C3],
- ["8332ED31",0xC5C4],
- ["8332ED32",0xC5C5],
- ["8332ED33",0xC5C6],
- ["8332ED34",0xC5C7],
- ["8332ED35",0xC5C8],
- ["8332ED36",0xC5C9],
- ["8332ED37",0xC5CA],
- ["8332ED38",0xC5CB],
- ["8332ED39",0xC5CC],
- ["8332EE30",0xC5CD],
- ["8332EE31",0xC5CE],
- ["8332EE32",0xC5CF],
- ["8332EE33",0xC5D0],
- ["8332EE34",0xC5D1],
- ["8332EE35",0xC5D2],
- ["8332EE36",0xC5D3],
- ["8332EE37",0xC5D4],
- ["8332EE38",0xC5D5],
- ["8332EE39",0xC5D6],
- ["8332EF30",0xC5D7],
- ["8332EF31",0xC5D8],
- ["8332EF32",0xC5D9],
- ["8332EF33",0xC5DA],
- ["8332EF34",0xC5DB],
- ["8332EF35",0xC5DC],
- ["8332EF36",0xC5DD],
- ["8332EF37",0xC5DE],
- ["8332EF38",0xC5DF],
- ["8332EF39",0xC5E0],
- ["8332F030",0xC5E1],
- ["8332F031",0xC5E2],
- ["8332F032",0xC5E3],
- ["8332F033",0xC5E4],
- ["8332F034",0xC5E5],
- ["8332F035",0xC5E6],
- ["8332F036",0xC5E7],
- ["8332F037",0xC5E8],
- ["8332F038",0xC5E9],
- ["8332F039",0xC5EA],
- ["8332F130",0xC5EB],
- ["8332F131",0xC5EC],
- ["8332F132",0xC5ED],
- ["8332F133",0xC5EE],
- ["8332F134",0xC5EF],
- ["8332F135",0xC5F0],
- ["8332F136",0xC5F1],
- ["8332F137",0xC5F2],
- ["8332F138",0xC5F3],
- ["8332F139",0xC5F4],
- ["8332F230",0xC5F5],
- ["8332F231",0xC5F6],
- ["8332F232",0xC5F7],
- ["8332F233",0xC5F8],
- ["8332F234",0xC5F9],
- ["8332F235",0xC5FA],
- ["8332F236",0xC5FB],
- ["8332F237",0xC5FC],
- ["8332F238",0xC5FD],
- ["8332F239",0xC5FE],
- ["8332F330",0xC5FF],
- ["8332F331",0xC600],
- ["8332F332",0xC601],
- ["8332F333",0xC602],
- ["8332F334",0xC603],
- ["8332F335",0xC604],
- ["8332F336",0xC605],
- ["8332F337",0xC606],
- ["8332F338",0xC607],
- ["8332F339",0xC608],
- ["8332F430",0xC609],
- ["8332F431",0xC60A],
- ["8332F432",0xC60B],
- ["8332F433",0xC60C],
- ["8332F434",0xC60D],
- ["8332F435",0xC60E],
- ["8332F436",0xC60F],
- ["8332F437",0xC610],
- ["8332F438",0xC611],
- ["8332F439",0xC612],
- ["8332F530",0xC613],
- ["8332F531",0xC614],
- ["8332F532",0xC615],
- ["8332F533",0xC616],
- ["8332F534",0xC617],
- ["8332F535",0xC618],
- ["8332F536",0xC619],
- ["8332F537",0xC61A],
- ["8332F538",0xC61B],
- ["8332F539",0xC61C],
- ["8332F630",0xC61D],
- ["8332F631",0xC61E],
- ["8332F632",0xC61F],
- ["8332F633",0xC620],
- ["8332F634",0xC621],
- ["8332F635",0xC622],
- ["8332F636",0xC623],
- ["8332F637",0xC624],
- ["8332F638",0xC625],
- ["8332F639",0xC626],
- ["8332F730",0xC627],
- ["8332F731",0xC628],
- ["8332F732",0xC629],
- ["8332F733",0xC62A],
- ["8332F734",0xC62B],
- ["8332F735",0xC62C],
- ["8332F736",0xC62D],
- ["8332F737",0xC62E],
- ["8332F738",0xC62F],
- ["8332F739",0xC630],
- ["8332F830",0xC631],
- ["8332F831",0xC632],
- ["8332F832",0xC633],
- ["8332F833",0xC634],
- ["8332F834",0xC635],
- ["8332F835",0xC636],
- ["8332F836",0xC637],
- ["8332F837",0xC638],
- ["8332F838",0xC639],
- ["8332F839",0xC63A],
- ["8332F930",0xC63B],
- ["8332F931",0xC63C],
- ["8332F932",0xC63D],
- ["8332F933",0xC63E],
- ["8332F934",0xC63F],
- ["8332F935",0xC640],
- ["8332F936",0xC641],
- ["8332F937",0xC642],
- ["8332F938",0xC643],
- ["8332F939",0xC644],
- ["8332FA30",0xC645],
- ["8332FA31",0xC646],
- ["8332FA32",0xC647],
- ["8332FA33",0xC648],
- ["8332FA34",0xC649],
- ["8332FA35",0xC64A],
- ["8332FA36",0xC64B],
- ["8332FA37",0xC64C],
- ["8332FA38",0xC64D],
- ["8332FA39",0xC64E],
- ["8332FB30",0xC64F],
- ["8332FB31",0xC650],
- ["8332FB32",0xC651],
- ["8332FB33",0xC652],
- ["8332FB34",0xC653],
- ["8332FB35",0xC654],
- ["8332FB36",0xC655],
- ["8332FB37",0xC656],
- ["8332FB38",0xC657],
- ["8332FB39",0xC658],
- ["8332FC30",0xC659],
- ["8332FC31",0xC65A],
- ["8332FC32",0xC65B],
- ["8332FC33",0xC65C],
- ["8332FC34",0xC65D],
- ["8332FC35",0xC65E],
- ["8332FC36",0xC65F],
- ["8332FC37",0xC660],
- ["8332FC38",0xC661],
- ["8332FC39",0xC662],
- ["8332FD30",0xC663],
- ["8332FD31",0xC664],
- ["8332FD32",0xC665],
- ["8332FD33",0xC666],
- ["8332FD34",0xC667],
- ["8332FD35",0xC668],
- ["8332FD36",0xC669],
- ["8332FD37",0xC66A],
- ["8332FD38",0xC66B],
- ["8332FD39",0xC66C],
- ["8332FE30",0xC66D],
- ["8332FE31",0xC66E],
- ["8332FE32",0xC66F],
- ["8332FE33",0xC670],
- ["8332FE34",0xC671],
- ["8332FE35",0xC672],
- ["8332FE36",0xC673],
- ["8332FE37",0xC674],
- ["8332FE38",0xC675],
- ["8332FE39",0xC676],
- ["83338130",0xC677],
- ["83338131",0xC678],
- ["83338132",0xC679],
- ["83338133",0xC67A],
- ["83338134",0xC67B],
- ["83338135",0xC67C],
- ["83338136",0xC67D],
- ["83338137",0xC67E],
- ["83338138",0xC67F],
- ["83338139",0xC680],
- ["83338230",0xC681],
- ["83338231",0xC682],
- ["83338232",0xC683],
- ["83338233",0xC684],
- ["83338234",0xC685],
- ["83338235",0xC686],
- ["83338236",0xC687],
- ["83338237",0xC688],
- ["83338238",0xC689],
- ["83338239",0xC68A],
- ["83338330",0xC68B],
- ["83338331",0xC68C],
- ["83338332",0xC68D],
- ["83338333",0xC68E],
- ["83338334",0xC68F],
- ["83338335",0xC690],
- ["83338336",0xC691],
- ["83338337",0xC692],
- ["83338338",0xC693],
- ["83338339",0xC694],
- ["83338430",0xC695],
- ["83338431",0xC696],
- ["83338432",0xC697],
- ["83338433",0xC698],
- ["83338434",0xC699],
- ["83338435",0xC69A],
- ["83338436",0xC69B],
- ["83338437",0xC69C],
- ["83338438",0xC69D],
- ["83338439",0xC69E],
- ["83338530",0xC69F],
- ["83338531",0xC6A0],
- ["83338532",0xC6A1],
- ["83338533",0xC6A2],
- ["83338534",0xC6A3],
- ["83338535",0xC6A4],
- ["83338536",0xC6A5],
- ["83338537",0xC6A6],
- ["83338538",0xC6A7],
- ["83338539",0xC6A8],
- ["83338630",0xC6A9],
- ["83338631",0xC6AA],
- ["83338632",0xC6AB],
- ["83338633",0xC6AC],
- ["83338634",0xC6AD],
- ["83338635",0xC6AE],
- ["83338636",0xC6AF],
- ["83338637",0xC6B0],
- ["83338638",0xC6B1],
- ["83338639",0xC6B2],
- ["83338730",0xC6B3],
- ["83338731",0xC6B4],
- ["83338732",0xC6B5],
- ["83338733",0xC6B6],
- ["83338734",0xC6B7],
- ["83338735",0xC6B8],
- ["83338736",0xC6B9],
- ["83338737",0xC6BA],
- ["83338738",0xC6BB],
- ["83338739",0xC6BC],
- ["83338830",0xC6BD],
- ["83338831",0xC6BE],
- ["83338832",0xC6BF],
- ["83338833",0xC6C0],
- ["83338834",0xC6C1],
- ["83338835",0xC6C2],
- ["83338836",0xC6C3],
- ["83338837",0xC6C4],
- ["83338838",0xC6C5],
- ["83338839",0xC6C6],
- ["83338930",0xC6C7],
- ["83338931",0xC6C8],
- ["83338932",0xC6C9],
- ["83338933",0xC6CA],
- ["83338934",0xC6CB],
- ["83338935",0xC6CC],
- ["83338936",0xC6CD],
- ["83338937",0xC6CE],
- ["83338938",0xC6CF],
- ["83338939",0xC6D0],
- ["83338A30",0xC6D1],
- ["83338A31",0xC6D2],
- ["83338A32",0xC6D3],
- ["83338A33",0xC6D4],
- ["83338A34",0xC6D5],
- ["83338A35",0xC6D6],
- ["83338A36",0xC6D7],
- ["83338A37",0xC6D8],
- ["83338A38",0xC6D9],
- ["83338A39",0xC6DA],
- ["83338B30",0xC6DB],
- ["83338B31",0xC6DC],
- ["83338B32",0xC6DD],
- ["83338B33",0xC6DE],
- ["83338B34",0xC6DF],
- ["83338B35",0xC6E0],
- ["83338B36",0xC6E1],
- ["83338B37",0xC6E2],
- ["83338B38",0xC6E3],
- ["83338B39",0xC6E4],
- ["83338C30",0xC6E5],
- ["83338C31",0xC6E6],
- ["83338C32",0xC6E7],
- ["83338C33",0xC6E8],
- ["83338C34",0xC6E9],
- ["83338C35",0xC6EA],
- ["83338C36",0xC6EB],
- ["83338C37",0xC6EC],
- ["83338C38",0xC6ED],
- ["83338C39",0xC6EE],
- ["83338D30",0xC6EF],
- ["83338D31",0xC6F0],
- ["83338D32",0xC6F1],
- ["83338D33",0xC6F2],
- ["83338D34",0xC6F3],
- ["83338D35",0xC6F4],
- ["83338D36",0xC6F5],
- ["83338D37",0xC6F6],
- ["83338D38",0xC6F7],
- ["83338D39",0xC6F8],
- ["83338E30",0xC6F9],
- ["83338E31",0xC6FA],
- ["83338E32",0xC6FB],
- ["83338E33",0xC6FC],
- ["83338E34",0xC6FD],
- ["83338E35",0xC6FE],
- ["83338E36",0xC6FF],
- ["83338E37",0xC700],
- ["83338E38",0xC701],
- ["83338E39",0xC702],
- ["83338F30",0xC703],
- ["83338F31",0xC704],
- ["83338F32",0xC705],
- ["83338F33",0xC706],
- ["83338F34",0xC707],
- ["83338F35",0xC708],
- ["83338F36",0xC709],
- ["83338F37",0xC70A],
- ["83338F38",0xC70B],
- ["83338F39",0xC70C],
- ["83339030",0xC70D],
- ["83339031",0xC70E],
- ["83339032",0xC70F],
- ["83339033",0xC710],
- ["83339034",0xC711],
- ["83339035",0xC712],
- ["83339036",0xC713],
- ["83339037",0xC714],
- ["83339038",0xC715],
- ["83339039",0xC716],
- ["83339130",0xC717],
- ["83339131",0xC718],
- ["83339132",0xC719],
- ["83339133",0xC71A],
- ["83339134",0xC71B],
- ["83339135",0xC71C],
- ["83339136",0xC71D],
- ["83339137",0xC71E],
- ["83339138",0xC71F],
- ["83339139",0xC720],
- ["83339230",0xC721],
- ["83339231",0xC722],
- ["83339232",0xC723],
- ["83339233",0xC724],
- ["83339234",0xC725],
- ["83339235",0xC726],
- ["83339236",0xC727],
- ["83339237",0xC728],
- ["83339238",0xC729],
- ["83339239",0xC72A],
- ["83339330",0xC72B],
- ["83339331",0xC72C],
- ["83339332",0xC72D],
- ["83339333",0xC72E],
- ["83339334",0xC72F],
- ["83339335",0xC730],
- ["83339336",0xC731],
- ["83339337",0xC732],
- ["83339338",0xC733],
- ["83339339",0xC734],
- ["83339430",0xC735],
- ["83339431",0xC736],
- ["83339432",0xC737],
- ["83339433",0xC738],
- ["83339434",0xC739],
- ["83339435",0xC73A],
- ["83339436",0xC73B],
- ["83339437",0xC73C],
- ["83339438",0xC73D],
- ["83339439",0xC73E],
- ["83339530",0xC73F],
- ["83339531",0xC740],
- ["83339532",0xC741],
- ["83339533",0xC742],
- ["83339534",0xC743],
- ["83339535",0xC744],
- ["83339536",0xC745],
- ["83339537",0xC746],
- ["83339538",0xC747],
- ["83339539",0xC748],
- ["83339630",0xC749],
- ["83339631",0xC74A],
- ["83339632",0xC74B],
- ["83339633",0xC74C],
- ["83339634",0xC74D],
- ["83339635",0xC74E],
- ["83339636",0xC74F],
- ["83339637",0xC750],
- ["83339638",0xC751],
- ["83339639",0xC752],
- ["83339730",0xC753],
- ["83339731",0xC754],
- ["83339732",0xC755],
- ["83339733",0xC756],
- ["83339734",0xC757],
- ["83339735",0xC758],
- ["83339736",0xC759],
- ["83339737",0xC75A],
- ["83339738",0xC75B],
- ["83339739",0xC75C],
- ["83339830",0xC75D],
- ["83339831",0xC75E],
- ["83339832",0xC75F],
- ["83339833",0xC760],
- ["83339834",0xC761],
- ["83339835",0xC762],
- ["83339836",0xC763],
- ["83339837",0xC764],
- ["83339838",0xC765],
- ["83339839",0xC766],
- ["83339930",0xC767],
- ["83339931",0xC768],
- ["83339932",0xC769],
- ["83339933",0xC76A],
- ["83339934",0xC76B],
- ["83339935",0xC76C],
- ["83339936",0xC76D],
- ["83339937",0xC76E],
- ["83339938",0xC76F],
- ["83339939",0xC770],
- ["83339A30",0xC771],
- ["83339A31",0xC772],
- ["83339A32",0xC773],
- ["83339A33",0xC774],
- ["83339A34",0xC775],
- ["83339A35",0xC776],
- ["83339A36",0xC777],
- ["83339A37",0xC778],
- ["83339A38",0xC779],
- ["83339A39",0xC77A],
- ["83339B30",0xC77B],
- ["83339B31",0xC77C],
- ["83339B32",0xC77D],
- ["83339B33",0xC77E],
- ["83339B34",0xC77F],
- ["83339B35",0xC780],
- ["83339B36",0xC781],
- ["83339B37",0xC782],
- ["83339B38",0xC783],
- ["83339B39",0xC784],
- ["83339C30",0xC785],
- ["83339C31",0xC786],
- ["83339C32",0xC787],
- ["83339C33",0xC788],
- ["83339C34",0xC789],
- ["83339C35",0xC78A],
- ["83339C36",0xC78B],
- ["83339C37",0xC78C],
- ["83339C38",0xC78D],
- ["83339C39",0xC78E],
- ["83339D30",0xC78F],
- ["83339D31",0xC790],
- ["83339D32",0xC791],
- ["83339D33",0xC792],
- ["83339D34",0xC793],
- ["83339D35",0xC794],
- ["83339D36",0xC795],
- ["83339D37",0xC796],
- ["83339D38",0xC797],
- ["83339D39",0xC798],
- ["83339E30",0xC799],
- ["83339E31",0xC79A],
- ["83339E32",0xC79B],
- ["83339E33",0xC79C],
- ["83339E34",0xC79D],
- ["83339E35",0xC79E],
- ["83339E36",0xC79F],
- ["83339E37",0xC7A0],
- ["83339E38",0xC7A1],
- ["83339E39",0xC7A2],
- ["83339F30",0xC7A3],
- ["83339F31",0xC7A4],
- ["83339F32",0xC7A5],
- ["83339F33",0xC7A6],
- ["83339F34",0xC7A7],
- ["83339F35",0xC7A8],
- ["83339F36",0xC7A9],
- ["83339F37",0xC7AA],
- ["83339F38",0xC7AB],
- ["83339F39",0xC7AC],
- ["8333A030",0xC7AD],
- ["8333A031",0xC7AE],
- ["8333A032",0xC7AF],
- ["8333A033",0xC7B0],
- ["8333A034",0xC7B1],
- ["8333A035",0xC7B2],
- ["8333A036",0xC7B3],
- ["8333A037",0xC7B4],
- ["8333A038",0xC7B5],
- ["8333A039",0xC7B6],
- ["8333A130",0xC7B7],
- ["8333A131",0xC7B8],
- ["8333A132",0xC7B9],
- ["8333A133",0xC7BA],
- ["8333A134",0xC7BB],
- ["8333A135",0xC7BC],
- ["8333A136",0xC7BD],
- ["8333A137",0xC7BE],
- ["8333A138",0xC7BF],
- ["8333A139",0xC7C0],
- ["8333A230",0xC7C1],
- ["8333A231",0xC7C2],
- ["8333A232",0xC7C3],
- ["8333A233",0xC7C4],
- ["8333A234",0xC7C5],
- ["8333A235",0xC7C6],
- ["8333A236",0xC7C7],
- ["8333A237",0xC7C8],
- ["8333A238",0xC7C9],
- ["8333A239",0xC7CA],
- ["8333A330",0xC7CB],
- ["8333A331",0xC7CC],
- ["8333A332",0xC7CD],
- ["8333A333",0xC7CE],
- ["8333A334",0xC7CF],
- ["8333A335",0xC7D0],
- ["8333A336",0xC7D1],
- ["8333A337",0xC7D2],
- ["8333A338",0xC7D3],
- ["8333A339",0xC7D4],
- ["8333A430",0xC7D5],
- ["8333A431",0xC7D6],
- ["8333A432",0xC7D7],
- ["8333A433",0xC7D8],
- ["8333A434",0xC7D9],
- ["8333A435",0xC7DA],
- ["8333A436",0xC7DB],
- ["8333A437",0xC7DC],
- ["8333A438",0xC7DD],
- ["8333A439",0xC7DE],
- ["8333A530",0xC7DF],
- ["8333A531",0xC7E0],
- ["8333A532",0xC7E1],
- ["8333A533",0xC7E2],
- ["8333A534",0xC7E3],
- ["8333A535",0xC7E4],
- ["8333A536",0xC7E5],
- ["8333A537",0xC7E6],
- ["8333A538",0xC7E7],
- ["8333A539",0xC7E8],
- ["8333A630",0xC7E9],
- ["8333A631",0xC7EA],
- ["8333A632",0xC7EB],
- ["8333A633",0xC7EC],
- ["8333A634",0xC7ED],
- ["8333A635",0xC7EE],
- ["8333A636",0xC7EF],
- ["8333A637",0xC7F0],
- ["8333A638",0xC7F1],
- ["8333A639",0xC7F2],
- ["8333A730",0xC7F3],
- ["8333A731",0xC7F4],
- ["8333A732",0xC7F5],
- ["8333A733",0xC7F6],
- ["8333A734",0xC7F7],
- ["8333A735",0xC7F8],
- ["8333A736",0xC7F9],
- ["8333A737",0xC7FA],
- ["8333A738",0xC7FB],
- ["8333A739",0xC7FC],
- ["8333A830",0xC7FD],
- ["8333A831",0xC7FE],
- ["8333A832",0xC7FF],
- ["8333A833",0xC800],
- ["8333A834",0xC801],
- ["8333A835",0xC802],
- ["8333A836",0xC803],
- ["8333A837",0xC804],
- ["8333A838",0xC805],
- ["8333A839",0xC806],
- ["8333A930",0xC807],
- ["8333A931",0xC808],
- ["8333A932",0xC809],
- ["8333A933",0xC80A],
- ["8333A934",0xC80B],
- ["8333A935",0xC80C],
- ["8333A936",0xC80D],
- ["8333A937",0xC80E],
- ["8333A938",0xC80F],
- ["8333A939",0xC810],
- ["8333AA30",0xC811],
- ["8333AA31",0xC812],
- ["8333AA32",0xC813],
- ["8333AA33",0xC814],
- ["8333AA34",0xC815],
- ["8333AA35",0xC816],
- ["8333AA36",0xC817],
- ["8333AA37",0xC818],
- ["8333AA38",0xC819],
- ["8333AA39",0xC81A],
- ["8333AB30",0xC81B],
- ["8333AB31",0xC81C],
- ["8333AB32",0xC81D],
- ["8333AB33",0xC81E],
- ["8333AB34",0xC81F],
- ["8333AB35",0xC820],
- ["8333AB36",0xC821],
- ["8333AB37",0xC822],
- ["8333AB38",0xC823],
- ["8333AB39",0xC824],
- ["8333AC30",0xC825],
- ["8333AC31",0xC826],
- ["8333AC32",0xC827],
- ["8333AC33",0xC828],
- ["8333AC34",0xC829],
- ["8333AC35",0xC82A],
- ["8333AC36",0xC82B],
- ["8333AC37",0xC82C],
- ["8333AC38",0xC82D],
- ["8333AC39",0xC82E],
- ["8333AD30",0xC82F],
- ["8333AD31",0xC830],
- ["8333AD32",0xC831],
- ["8333AD33",0xC832],
- ["8333AD34",0xC833],
- ["8333AD35",0xC834],
- ["8333AD36",0xC835],
- ["8333AD37",0xC836],
- ["8333AD38",0xC837],
- ["8333AD39",0xC838],
- ["8333AE30",0xC839],
- ["8333AE31",0xC83A],
- ["8333AE32",0xC83B],
- ["8333AE33",0xC83C],
- ["8333AE34",0xC83D],
- ["8333AE35",0xC83E],
- ["8333AE36",0xC83F],
- ["8333AE37",0xC840],
- ["8333AE38",0xC841],
- ["8333AE39",0xC842],
- ["8333AF30",0xC843],
- ["8333AF31",0xC844],
- ["8333AF32",0xC845],
- ["8333AF33",0xC846],
- ["8333AF34",0xC847],
- ["8333AF35",0xC848],
- ["8333AF36",0xC849],
- ["8333AF37",0xC84A],
- ["8333AF38",0xC84B],
- ["8333AF39",0xC84C],
- ["8333B030",0xC84D],
- ["8333B031",0xC84E],
- ["8333B032",0xC84F],
- ["8333B033",0xC850],
- ["8333B034",0xC851],
- ["8333B035",0xC852],
- ["8333B036",0xC853],
- ["8333B037",0xC854],
- ["8333B038",0xC855],
- ["8333B039",0xC856],
- ["8333B130",0xC857],
- ["8333B131",0xC858],
- ["8333B132",0xC859],
- ["8333B133",0xC85A],
- ["8333B134",0xC85B],
- ["8333B135",0xC85C],
- ["8333B136",0xC85D],
- ["8333B137",0xC85E],
- ["8333B138",0xC85F],
- ["8333B139",0xC860],
- ["8333B230",0xC861],
- ["8333B231",0xC862],
- ["8333B232",0xC863],
- ["8333B233",0xC864],
- ["8333B234",0xC865],
- ["8333B235",0xC866],
- ["8333B236",0xC867],
- ["8333B237",0xC868],
- ["8333B238",0xC869],
- ["8333B239",0xC86A],
- ["8333B330",0xC86B],
- ["8333B331",0xC86C],
- ["8333B332",0xC86D],
- ["8333B333",0xC86E],
- ["8333B334",0xC86F],
- ["8333B335",0xC870],
- ["8333B336",0xC871],
- ["8333B337",0xC872],
- ["8333B338",0xC873],
- ["8333B339",0xC874],
- ["8333B430",0xC875],
- ["8333B431",0xC876],
- ["8333B432",0xC877],
- ["8333B433",0xC878],
- ["8333B434",0xC879],
- ["8333B435",0xC87A],
- ["8333B436",0xC87B],
- ["8333B437",0xC87C],
- ["8333B438",0xC87D],
- ["8333B439",0xC87E],
- ["8333B530",0xC87F],
- ["8333B531",0xC880],
- ["8333B532",0xC881],
- ["8333B533",0xC882],
- ["8333B534",0xC883],
- ["8333B535",0xC884],
- ["8333B536",0xC885],
- ["8333B537",0xC886],
- ["8333B538",0xC887],
- ["8333B539",0xC888],
- ["8333B630",0xC889],
- ["8333B631",0xC88A],
- ["8333B632",0xC88B],
- ["8333B633",0xC88C],
- ["8333B634",0xC88D],
- ["8333B635",0xC88E],
- ["8333B636",0xC88F],
- ["8333B637",0xC890],
- ["8333B638",0xC891],
- ["8333B639",0xC892],
- ["8333B730",0xC893],
- ["8333B731",0xC894],
- ["8333B732",0xC895],
- ["8333B733",0xC896],
- ["8333B734",0xC897],
- ["8333B735",0xC898],
- ["8333B736",0xC899],
- ["8333B737",0xC89A],
- ["8333B738",0xC89B],
- ["8333B739",0xC89C],
- ["8333B830",0xC89D],
- ["8333B831",0xC89E],
- ["8333B832",0xC89F],
- ["8333B833",0xC8A0],
- ["8333B834",0xC8A1],
- ["8333B835",0xC8A2],
- ["8333B836",0xC8A3],
- ["8333B837",0xC8A4],
- ["8333B838",0xC8A5],
- ["8333B839",0xC8A6],
- ["8333B930",0xC8A7],
- ["8333B931",0xC8A8],
- ["8333B932",0xC8A9],
- ["8333B933",0xC8AA],
- ["8333B934",0xC8AB],
- ["8333B935",0xC8AC],
- ["8333B936",0xC8AD],
- ["8333B937",0xC8AE],
- ["8333B938",0xC8AF],
- ["8333B939",0xC8B0],
- ["8333BA30",0xC8B1],
- ["8333BA31",0xC8B2],
- ["8333BA32",0xC8B3],
- ["8333BA33",0xC8B4],
- ["8333BA34",0xC8B5],
- ["8333BA35",0xC8B6],
- ["8333BA36",0xC8B7],
- ["8333BA37",0xC8B8],
- ["8333BA38",0xC8B9],
- ["8333BA39",0xC8BA],
- ["8333BB30",0xC8BB],
- ["8333BB31",0xC8BC],
- ["8333BB32",0xC8BD],
- ["8333BB33",0xC8BE],
- ["8333BB34",0xC8BF],
- ["8333BB35",0xC8C0],
- ["8333BB36",0xC8C1],
- ["8333BB37",0xC8C2],
- ["8333BB38",0xC8C3],
- ["8333BB39",0xC8C4],
- ["8333BC30",0xC8C5],
- ["8333BC31",0xC8C6],
- ["8333BC32",0xC8C7],
- ["8333BC33",0xC8C8],
- ["8333BC34",0xC8C9],
- ["8333BC35",0xC8CA],
- ["8333BC36",0xC8CB],
- ["8333BC37",0xC8CC],
- ["8333BC38",0xC8CD],
- ["8333BC39",0xC8CE],
- ["8333BD30",0xC8CF],
- ["8333BD31",0xC8D0],
- ["8333BD32",0xC8D1],
- ["8333BD33",0xC8D2],
- ["8333BD34",0xC8D3],
- ["8333BD35",0xC8D4],
- ["8333BD36",0xC8D5],
- ["8333BD37",0xC8D6],
- ["8333BD38",0xC8D7],
- ["8333BD39",0xC8D8],
- ["8333BE30",0xC8D9],
- ["8333BE31",0xC8DA],
- ["8333BE32",0xC8DB],
- ["8333BE33",0xC8DC],
- ["8333BE34",0xC8DD],
- ["8333BE35",0xC8DE],
- ["8333BE36",0xC8DF],
- ["8333BE37",0xC8E0],
- ["8333BE38",0xC8E1],
- ["8333BE39",0xC8E2],
- ["8333BF30",0xC8E3],
- ["8333BF31",0xC8E4],
- ["8333BF32",0xC8E5],
- ["8333BF33",0xC8E6],
- ["8333BF34",0xC8E7],
- ["8333BF35",0xC8E8],
- ["8333BF36",0xC8E9],
- ["8333BF37",0xC8EA],
- ["8333BF38",0xC8EB],
- ["8333BF39",0xC8EC],
- ["8333C030",0xC8ED],
- ["8333C031",0xC8EE],
- ["8333C032",0xC8EF],
- ["8333C033",0xC8F0],
- ["8333C034",0xC8F1],
- ["8333C035",0xC8F2],
- ["8333C036",0xC8F3],
- ["8333C037",0xC8F4],
- ["8333C038",0xC8F5],
- ["8333C039",0xC8F6],
- ["8333C130",0xC8F7],
- ["8333C131",0xC8F8],
- ["8333C132",0xC8F9],
- ["8333C133",0xC8FA],
- ["8333C134",0xC8FB],
- ["8333C135",0xC8FC],
- ["8333C136",0xC8FD],
- ["8333C137",0xC8FE],
- ["8333C138",0xC8FF],
- ["8333C139",0xC900],
- ["8333C230",0xC901],
- ["8333C231",0xC902],
- ["8333C232",0xC903],
- ["8333C233",0xC904],
- ["8333C234",0xC905],
- ["8333C235",0xC906],
- ["8333C236",0xC907],
- ["8333C237",0xC908],
- ["8333C238",0xC909],
- ["8333C239",0xC90A],
- ["8333C330",0xC90B],
- ["8333C331",0xC90C],
- ["8333C332",0xC90D],
- ["8333C333",0xC90E],
- ["8333C334",0xC90F],
- ["8333C335",0xC910],
- ["8333C336",0xC911],
- ["8333C337",0xC912],
- ["8333C338",0xC913],
- ["8333C339",0xC914],
- ["8333C430",0xC915],
- ["8333C431",0xC916],
- ["8333C432",0xC917],
- ["8333C433",0xC918],
- ["8333C434",0xC919],
- ["8333C435",0xC91A],
- ["8333C436",0xC91B],
- ["8333C437",0xC91C],
- ["8333C438",0xC91D],
- ["8333C439",0xC91E],
- ["8333C530",0xC91F],
- ["8333C531",0xC920],
- ["8333C532",0xC921],
- ["8333C533",0xC922],
- ["8333C534",0xC923],
- ["8333C535",0xC924],
- ["8333C536",0xC925],
- ["8333C537",0xC926],
- ["8333C538",0xC927],
- ["8333C539",0xC928],
- ["8333C630",0xC929],
- ["8333C631",0xC92A],
- ["8333C632",0xC92B],
- ["8333C633",0xC92C],
- ["8333C634",0xC92D],
- ["8333C635",0xC92E],
- ["8333C636",0xC92F],
- ["8333C637",0xC930],
- ["8333C638",0xC931],
- ["8333C639",0xC932],
- ["8333C730",0xC933],
- ["8333C731",0xC934],
- ["8333C732",0xC935],
- ["8333C733",0xC936],
- ["8333C734",0xC937],
- ["8333C735",0xC938],
- ["8333C736",0xC939],
- ["8333C737",0xC93A],
- ["8333C738",0xC93B],
- ["8333C739",0xC93C],
- ["8333C830",0xC93D],
- ["8333C831",0xC93E],
- ["8333C832",0xC93F],
- ["8333C833",0xC940],
- ["8333C834",0xC941],
- ["8333C835",0xC942],
- ["8333C836",0xC943],
- ["8333C837",0xC944],
- ["8333C838",0xC945],
- ["8333C839",0xC946],
- ["8333C930",0xC947],
- ["8333C931",0xC948],
- ["8333C932",0xC949],
- ["8333C933",0xC94A],
- ["8333C934",0xC94B],
- ["8333C935",0xC94C],
- ["8333C936",0xC94D],
- ["8333C937",0xC94E],
- ["8333C938",0xC94F],
- ["8333C939",0xC950],
- ["8333CA30",0xC951],
- ["8333CA31",0xC952],
- ["8333CA32",0xC953],
- ["8333CA33",0xC954],
- ["8333CA34",0xC955],
- ["8333CA35",0xC956],
- ["8333CA36",0xC957],
- ["8333CA37",0xC958],
- ["8333CA38",0xC959],
- ["8333CA39",0xC95A],
- ["8333CB30",0xC95B],
- ["8333CB31",0xC95C],
- ["8333CB32",0xC95D],
- ["8333CB33",0xC95E],
- ["8333CB34",0xC95F],
- ["8333CB35",0xC960],
- ["8333CB36",0xC961],
- ["8333CB37",0xC962],
- ["8333CB38",0xC963],
- ["8333CB39",0xC964],
- ["8333CC30",0xC965],
- ["8333CC31",0xC966],
- ["8333CC32",0xC967],
- ["8333CC33",0xC968],
- ["8333CC34",0xC969],
- ["8333CC35",0xC96A],
- ["8333CC36",0xC96B],
- ["8333CC37",0xC96C],
- ["8333CC38",0xC96D],
- ["8333CC39",0xC96E],
- ["8333CD30",0xC96F],
- ["8333CD31",0xC970],
- ["8333CD32",0xC971],
- ["8333CD33",0xC972],
- ["8333CD34",0xC973],
- ["8333CD35",0xC974],
- ["8333CD36",0xC975],
- ["8333CD37",0xC976],
- ["8333CD38",0xC977],
- ["8333CD39",0xC978],
- ["8333CE30",0xC979],
- ["8333CE31",0xC97A],
- ["8333CE32",0xC97B],
- ["8333CE33",0xC97C],
- ["8333CE34",0xC97D],
- ["8333CE35",0xC97E],
- ["8333CE36",0xC97F],
- ["8333CE37",0xC980],
- ["8333CE38",0xC981],
- ["8333CE39",0xC982],
- ["8333CF30",0xC983],
- ["8333CF31",0xC984],
- ["8333CF32",0xC985],
- ["8333CF33",0xC986],
- ["8333CF34",0xC987],
- ["8333CF35",0xC988],
- ["8333CF36",0xC989],
- ["8333CF37",0xC98A],
- ["8333CF38",0xC98B],
- ["8333CF39",0xC98C],
- ["8333D030",0xC98D],
- ["8333D031",0xC98E],
- ["8333D032",0xC98F],
- ["8333D033",0xC990],
- ["8333D034",0xC991],
- ["8333D035",0xC992],
- ["8333D036",0xC993],
- ["8333D037",0xC994],
- ["8333D038",0xC995],
- ["8333D039",0xC996],
- ["8333D130",0xC997],
- ["8333D131",0xC998],
- ["8333D132",0xC999],
- ["8333D133",0xC99A],
- ["8333D134",0xC99B],
- ["8333D135",0xC99C],
- ["8333D136",0xC99D],
- ["8333D137",0xC99E],
- ["8333D138",0xC99F],
- ["8333D139",0xC9A0],
- ["8333D230",0xC9A1],
- ["8333D231",0xC9A2],
- ["8333D232",0xC9A3],
- ["8333D233",0xC9A4],
- ["8333D234",0xC9A5],
- ["8333D235",0xC9A6],
- ["8333D236",0xC9A7],
- ["8333D237",0xC9A8],
- ["8333D238",0xC9A9],
- ["8333D239",0xC9AA],
- ["8333D330",0xC9AB],
- ["8333D331",0xC9AC],
- ["8333D332",0xC9AD],
- ["8333D333",0xC9AE],
- ["8333D334",0xC9AF],
- ["8333D335",0xC9B0],
- ["8333D336",0xC9B1],
- ["8333D337",0xC9B2],
- ["8333D338",0xC9B3],
- ["8333D339",0xC9B4],
- ["8333D430",0xC9B5],
- ["8333D431",0xC9B6],
- ["8333D432",0xC9B7],
- ["8333D433",0xC9B8],
- ["8333D434",0xC9B9],
- ["8333D435",0xC9BA],
- ["8333D436",0xC9BB],
- ["8333D437",0xC9BC],
- ["8333D438",0xC9BD],
- ["8333D439",0xC9BE],
- ["8333D530",0xC9BF],
- ["8333D531",0xC9C0],
- ["8333D532",0xC9C1],
- ["8333D533",0xC9C2],
- ["8333D534",0xC9C3],
- ["8333D535",0xC9C4],
- ["8333D536",0xC9C5],
- ["8333D537",0xC9C6],
- ["8333D538",0xC9C7],
- ["8333D539",0xC9C8],
- ["8333D630",0xC9C9],
- ["8333D631",0xC9CA],
- ["8333D632",0xC9CB],
- ["8333D633",0xC9CC],
- ["8333D634",0xC9CD],
- ["8333D635",0xC9CE],
- ["8333D636",0xC9CF],
- ["8333D637",0xC9D0],
- ["8333D638",0xC9D1],
- ["8333D639",0xC9D2],
- ["8333D730",0xC9D3],
- ["8333D731",0xC9D4],
- ["8333D732",0xC9D5],
- ["8333D733",0xC9D6],
- ["8333D734",0xC9D7],
- ["8333D735",0xC9D8],
- ["8333D736",0xC9D9],
- ["8333D737",0xC9DA],
- ["8333D738",0xC9DB],
- ["8333D739",0xC9DC],
- ["8333D830",0xC9DD],
- ["8333D831",0xC9DE],
- ["8333D832",0xC9DF],
- ["8333D833",0xC9E0],
- ["8333D834",0xC9E1],
- ["8333D835",0xC9E2],
- ["8333D836",0xC9E3],
- ["8333D837",0xC9E4],
- ["8333D838",0xC9E5],
- ["8333D839",0xC9E6],
- ["8333D930",0xC9E7],
- ["8333D931",0xC9E8],
- ["8333D932",0xC9E9],
- ["8333D933",0xC9EA],
- ["8333D934",0xC9EB],
- ["8333D935",0xC9EC],
- ["8333D936",0xC9ED],
- ["8333D937",0xC9EE],
- ["8333D938",0xC9EF],
- ["8333D939",0xC9F0],
- ["8333DA30",0xC9F1],
- ["8333DA31",0xC9F2],
- ["8333DA32",0xC9F3],
- ["8333DA33",0xC9F4],
- ["8333DA34",0xC9F5],
- ["8333DA35",0xC9F6],
- ["8333DA36",0xC9F7],
- ["8333DA37",0xC9F8],
- ["8333DA38",0xC9F9],
- ["8333DA39",0xC9FA],
- ["8333DB30",0xC9FB],
- ["8333DB31",0xC9FC],
- ["8333DB32",0xC9FD],
- ["8333DB33",0xC9FE],
- ["8333DB34",0xC9FF],
- ["8333DB35",0xCA00],
- ["8333DB36",0xCA01],
- ["8333DB37",0xCA02],
- ["8333DB38",0xCA03],
- ["8333DB39",0xCA04],
- ["8333DC30",0xCA05],
- ["8333DC31",0xCA06],
- ["8333DC32",0xCA07],
- ["8333DC33",0xCA08],
- ["8333DC34",0xCA09],
- ["8333DC35",0xCA0A],
- ["8333DC36",0xCA0B],
- ["8333DC37",0xCA0C],
- ["8333DC38",0xCA0D],
- ["8333DC39",0xCA0E],
- ["8333DD30",0xCA0F],
- ["8333DD31",0xCA10],
- ["8333DD32",0xCA11],
- ["8333DD33",0xCA12],
- ["8333DD34",0xCA13],
- ["8333DD35",0xCA14],
- ["8333DD36",0xCA15],
- ["8333DD37",0xCA16],
- ["8333DD38",0xCA17],
- ["8333DD39",0xCA18],
- ["8333DE30",0xCA19],
- ["8333DE31",0xCA1A],
- ["8333DE32",0xCA1B],
- ["8333DE33",0xCA1C],
- ["8333DE34",0xCA1D],
- ["8333DE35",0xCA1E],
- ["8333DE36",0xCA1F],
- ["8333DE37",0xCA20],
- ["8333DE38",0xCA21],
- ["8333DE39",0xCA22],
- ["8333DF30",0xCA23],
- ["8333DF31",0xCA24],
- ["8333DF32",0xCA25],
- ["8333DF33",0xCA26],
- ["8333DF34",0xCA27],
- ["8333DF35",0xCA28],
- ["8333DF36",0xCA29],
- ["8333DF37",0xCA2A],
- ["8333DF38",0xCA2B],
- ["8333DF39",0xCA2C],
- ["8333E030",0xCA2D],
- ["8333E031",0xCA2E],
- ["8333E032",0xCA2F],
- ["8333E033",0xCA30],
- ["8333E034",0xCA31],
- ["8333E035",0xCA32],
- ["8333E036",0xCA33],
- ["8333E037",0xCA34],
- ["8333E038",0xCA35],
- ["8333E039",0xCA36],
- ["8333E130",0xCA37],
- ["8333E131",0xCA38],
- ["8333E132",0xCA39],
- ["8333E133",0xCA3A],
- ["8333E134",0xCA3B],
- ["8333E135",0xCA3C],
- ["8333E136",0xCA3D],
- ["8333E137",0xCA3E],
- ["8333E138",0xCA3F],
- ["8333E139",0xCA40],
- ["8333E230",0xCA41],
- ["8333E231",0xCA42],
- ["8333E232",0xCA43],
- ["8333E233",0xCA44],
- ["8333E234",0xCA45],
- ["8333E235",0xCA46],
- ["8333E236",0xCA47],
- ["8333E237",0xCA48],
- ["8333E238",0xCA49],
- ["8333E239",0xCA4A],
- ["8333E330",0xCA4B],
- ["8333E331",0xCA4C],
- ["8333E332",0xCA4D],
- ["8333E333",0xCA4E],
- ["8333E334",0xCA4F],
- ["8333E335",0xCA50],
- ["8333E336",0xCA51],
- ["8333E337",0xCA52],
- ["8333E338",0xCA53],
- ["8333E339",0xCA54],
- ["8333E430",0xCA55],
- ["8333E431",0xCA56],
- ["8333E432",0xCA57],
- ["8333E433",0xCA58],
- ["8333E434",0xCA59],
- ["8333E435",0xCA5A],
- ["8333E436",0xCA5B],
- ["8333E437",0xCA5C],
- ["8333E438",0xCA5D],
- ["8333E439",0xCA5E],
- ["8333E530",0xCA5F],
- ["8333E531",0xCA60],
- ["8333E532",0xCA61],
- ["8333E533",0xCA62],
- ["8333E534",0xCA63],
- ["8333E535",0xCA64],
- ["8333E536",0xCA65],
- ["8333E537",0xCA66],
- ["8333E538",0xCA67],
- ["8333E539",0xCA68],
- ["8333E630",0xCA69],
- ["8333E631",0xCA6A],
- ["8333E632",0xCA6B],
- ["8333E633",0xCA6C],
- ["8333E634",0xCA6D],
- ["8333E635",0xCA6E],
- ["8333E636",0xCA6F],
- ["8333E637",0xCA70],
- ["8333E638",0xCA71],
- ["8333E639",0xCA72],
- ["8333E730",0xCA73],
- ["8333E731",0xCA74],
- ["8333E732",0xCA75],
- ["8333E733",0xCA76],
- ["8333E734",0xCA77],
- ["8333E735",0xCA78],
- ["8333E736",0xCA79],
- ["8333E737",0xCA7A],
- ["8333E738",0xCA7B],
- ["8333E739",0xCA7C],
- ["8333E830",0xCA7D],
- ["8333E831",0xCA7E],
- ["8333E832",0xCA7F],
- ["8333E833",0xCA80],
- ["8333E834",0xCA81],
- ["8333E835",0xCA82],
- ["8333E836",0xCA83],
- ["8333E837",0xCA84],
- ["8333E838",0xCA85],
- ["8333E839",0xCA86],
- ["8333E930",0xCA87],
- ["8333E931",0xCA88],
- ["8333E932",0xCA89],
- ["8333E933",0xCA8A],
- ["8333E934",0xCA8B],
- ["8333E935",0xCA8C],
- ["8333E936",0xCA8D],
- ["8333E937",0xCA8E],
- ["8333E938",0xCA8F],
- ["8333E939",0xCA90],
- ["8333EA30",0xCA91],
- ["8333EA31",0xCA92],
- ["8333EA32",0xCA93],
- ["8333EA33",0xCA94],
- ["8333EA34",0xCA95],
- ["8333EA35",0xCA96],
- ["8333EA36",0xCA97],
- ["8333EA37",0xCA98],
- ["8333EA38",0xCA99],
- ["8333EA39",0xCA9A],
- ["8333EB30",0xCA9B],
- ["8333EB31",0xCA9C],
- ["8333EB32",0xCA9D],
- ["8333EB33",0xCA9E],
- ["8333EB34",0xCA9F],
- ["8333EB35",0xCAA0],
- ["8333EB36",0xCAA1],
- ["8333EB37",0xCAA2],
- ["8333EB38",0xCAA3],
- ["8333EB39",0xCAA4],
- ["8333EC30",0xCAA5],
- ["8333EC31",0xCAA6],
- ["8333EC32",0xCAA7],
- ["8333EC33",0xCAA8],
- ["8333EC34",0xCAA9],
- ["8333EC35",0xCAAA],
- ["8333EC36",0xCAAB],
- ["8333EC37",0xCAAC],
- ["8333EC38",0xCAAD],
- ["8333EC39",0xCAAE],
- ["8333ED30",0xCAAF],
- ["8333ED31",0xCAB0],
- ["8333ED32",0xCAB1],
- ["8333ED33",0xCAB2],
- ["8333ED34",0xCAB3],
- ["8333ED35",0xCAB4],
- ["8333ED36",0xCAB5],
- ["8333ED37",0xCAB6],
- ["8333ED38",0xCAB7],
- ["8333ED39",0xCAB8],
- ["8333EE30",0xCAB9],
- ["8333EE31",0xCABA],
- ["8333EE32",0xCABB],
- ["8333EE33",0xCABC],
- ["8333EE34",0xCABD],
- ["8333EE35",0xCABE],
- ["8333EE36",0xCABF],
- ["8333EE37",0xCAC0],
- ["8333EE38",0xCAC1],
- ["8333EE39",0xCAC2],
- ["8333EF30",0xCAC3],
- ["8333EF31",0xCAC4],
- ["8333EF32",0xCAC5],
- ["8333EF33",0xCAC6],
- ["8333EF34",0xCAC7],
- ["8333EF35",0xCAC8],
- ["8333EF36",0xCAC9],
- ["8333EF37",0xCACA],
- ["8333EF38",0xCACB],
- ["8333EF39",0xCACC],
- ["8333F030",0xCACD],
- ["8333F031",0xCACE],
- ["8333F032",0xCACF],
- ["8333F033",0xCAD0],
- ["8333F034",0xCAD1],
- ["8333F035",0xCAD2],
- ["8333F036",0xCAD3],
- ["8333F037",0xCAD4],
- ["8333F038",0xCAD5],
- ["8333F039",0xCAD6],
- ["8333F130",0xCAD7],
- ["8333F131",0xCAD8],
- ["8333F132",0xCAD9],
- ["8333F133",0xCADA],
- ["8333F134",0xCADB],
- ["8333F135",0xCADC],
- ["8333F136",0xCADD],
- ["8333F137",0xCADE],
- ["8333F138",0xCADF],
- ["8333F139",0xCAE0],
- ["8333F230",0xCAE1],
- ["8333F231",0xCAE2],
- ["8333F232",0xCAE3],
- ["8333F233",0xCAE4],
- ["8333F234",0xCAE5],
- ["8333F235",0xCAE6],
- ["8333F236",0xCAE7],
- ["8333F237",0xCAE8],
- ["8333F238",0xCAE9],
- ["8333F239",0xCAEA],
- ["8333F330",0xCAEB],
- ["8333F331",0xCAEC],
- ["8333F332",0xCAED],
- ["8333F333",0xCAEE],
- ["8333F334",0xCAEF],
- ["8333F335",0xCAF0],
- ["8333F336",0xCAF1],
- ["8333F337",0xCAF2],
- ["8333F338",0xCAF3],
- ["8333F339",0xCAF4],
- ["8333F430",0xCAF5],
- ["8333F431",0xCAF6],
- ["8333F432",0xCAF7],
- ["8333F433",0xCAF8],
- ["8333F434",0xCAF9],
- ["8333F435",0xCAFA],
- ["8333F436",0xCAFB],
- ["8333F437",0xCAFC],
- ["8333F438",0xCAFD],
- ["8333F439",0xCAFE],
- ["8333F530",0xCAFF],
- ["8333F531",0xCB00],
- ["8333F532",0xCB01],
- ["8333F533",0xCB02],
- ["8333F534",0xCB03],
- ["8333F535",0xCB04],
- ["8333F536",0xCB05],
- ["8333F537",0xCB06],
- ["8333F538",0xCB07],
- ["8333F539",0xCB08],
- ["8333F630",0xCB09],
- ["8333F631",0xCB0A],
- ["8333F632",0xCB0B],
- ["8333F633",0xCB0C],
- ["8333F634",0xCB0D],
- ["8333F635",0xCB0E],
- ["8333F636",0xCB0F],
- ["8333F637",0xCB10],
- ["8333F638",0xCB11],
- ["8333F639",0xCB12],
- ["8333F730",0xCB13],
- ["8333F731",0xCB14],
- ["8333F732",0xCB15],
- ["8333F733",0xCB16],
- ["8333F734",0xCB17],
- ["8333F735",0xCB18],
- ["8333F736",0xCB19],
- ["8333F737",0xCB1A],
- ["8333F738",0xCB1B],
- ["8333F739",0xCB1C],
- ["8333F830",0xCB1D],
- ["8333F831",0xCB1E],
- ["8333F832",0xCB1F],
- ["8333F833",0xCB20],
- ["8333F834",0xCB21],
- ["8333F835",0xCB22],
- ["8333F836",0xCB23],
- ["8333F837",0xCB24],
- ["8333F838",0xCB25],
- ["8333F839",0xCB26],
- ["8333F930",0xCB27],
- ["8333F931",0xCB28],
- ["8333F932",0xCB29],
- ["8333F933",0xCB2A],
- ["8333F934",0xCB2B],
- ["8333F935",0xCB2C],
- ["8333F936",0xCB2D],
- ["8333F937",0xCB2E],
- ["8333F938",0xCB2F],
- ["8333F939",0xCB30],
- ["8333FA30",0xCB31],
- ["8333FA31",0xCB32],
- ["8333FA32",0xCB33],
- ["8333FA33",0xCB34],
- ["8333FA34",0xCB35],
- ["8333FA35",0xCB36],
- ["8333FA36",0xCB37],
- ["8333FA37",0xCB38],
- ["8333FA38",0xCB39],
- ["8333FA39",0xCB3A],
- ["8333FB30",0xCB3B],
- ["8333FB31",0xCB3C],
- ["8333FB32",0xCB3D],
- ["8333FB33",0xCB3E],
- ["8333FB34",0xCB3F],
- ["8333FB35",0xCB40],
- ["8333FB36",0xCB41],
- ["8333FB37",0xCB42],
- ["8333FB38",0xCB43],
- ["8333FB39",0xCB44],
- ["8333FC30",0xCB45],
- ["8333FC31",0xCB46],
- ["8333FC32",0xCB47],
- ["8333FC33",0xCB48],
- ["8333FC34",0xCB49],
- ["8333FC35",0xCB4A],
- ["8333FC36",0xCB4B],
- ["8333FC37",0xCB4C],
- ["8333FC38",0xCB4D],
- ["8333FC39",0xCB4E],
- ["8333FD30",0xCB4F],
- ["8333FD31",0xCB50],
- ["8333FD32",0xCB51],
- ["8333FD33",0xCB52],
- ["8333FD34",0xCB53],
- ["8333FD35",0xCB54],
- ["8333FD36",0xCB55],
- ["8333FD37",0xCB56],
- ["8333FD38",0xCB57],
- ["8333FD39",0xCB58],
- ["8333FE30",0xCB59],
- ["8333FE31",0xCB5A],
- ["8333FE32",0xCB5B],
- ["8333FE33",0xCB5C],
- ["8333FE34",0xCB5D],
- ["8333FE35",0xCB5E],
- ["8333FE36",0xCB5F],
- ["8333FE37",0xCB60],
- ["8333FE38",0xCB61],
- ["8333FE39",0xCB62],
- ["83348130",0xCB63],
- ["83348131",0xCB64],
- ["83348132",0xCB65],
- ["83348133",0xCB66],
- ["83348134",0xCB67],
- ["83348135",0xCB68],
- ["83348136",0xCB69],
- ["83348137",0xCB6A],
- ["83348138",0xCB6B],
- ["83348139",0xCB6C],
- ["83348230",0xCB6D],
- ["83348231",0xCB6E],
- ["83348232",0xCB6F],
- ["83348233",0xCB70],
- ["83348234",0xCB71],
- ["83348235",0xCB72],
- ["83348236",0xCB73],
- ["83348237",0xCB74],
- ["83348238",0xCB75],
- ["83348239",0xCB76],
- ["83348330",0xCB77],
- ["83348331",0xCB78],
- ["83348332",0xCB79],
- ["83348333",0xCB7A],
- ["83348334",0xCB7B],
- ["83348335",0xCB7C],
- ["83348336",0xCB7D],
- ["83348337",0xCB7E],
- ["83348338",0xCB7F],
- ["83348339",0xCB80],
- ["83348430",0xCB81],
- ["83348431",0xCB82],
- ["83348432",0xCB83],
- ["83348433",0xCB84],
- ["83348434",0xCB85],
- ["83348435",0xCB86],
- ["83348436",0xCB87],
- ["83348437",0xCB88],
- ["83348438",0xCB89],
- ["83348439",0xCB8A],
- ["83348530",0xCB8B],
- ["83348531",0xCB8C],
- ["83348532",0xCB8D],
- ["83348533",0xCB8E],
- ["83348534",0xCB8F],
- ["83348535",0xCB90],
- ["83348536",0xCB91],
- ["83348537",0xCB92],
- ["83348538",0xCB93],
- ["83348539",0xCB94],
- ["83348630",0xCB95],
- ["83348631",0xCB96],
- ["83348632",0xCB97],
- ["83348633",0xCB98],
- ["83348634",0xCB99],
- ["83348635",0xCB9A],
- ["83348636",0xCB9B],
- ["83348637",0xCB9C],
- ["83348638",0xCB9D],
- ["83348639",0xCB9E],
- ["83348730",0xCB9F],
- ["83348731",0xCBA0],
- ["83348732",0xCBA1],
- ["83348733",0xCBA2],
- ["83348734",0xCBA3],
- ["83348735",0xCBA4],
- ["83348736",0xCBA5],
- ["83348737",0xCBA6],
- ["83348738",0xCBA7],
- ["83348739",0xCBA8],
- ["83348830",0xCBA9],
- ["83348831",0xCBAA],
- ["83348832",0xCBAB],
- ["83348833",0xCBAC],
- ["83348834",0xCBAD],
- ["83348835",0xCBAE],
- ["83348836",0xCBAF],
- ["83348837",0xCBB0],
- ["83348838",0xCBB1],
- ["83348839",0xCBB2],
- ["83348930",0xCBB3],
- ["83348931",0xCBB4],
- ["83348932",0xCBB5],
- ["83348933",0xCBB6],
- ["83348934",0xCBB7],
- ["83348935",0xCBB8],
- ["83348936",0xCBB9],
- ["83348937",0xCBBA],
- ["83348938",0xCBBB],
- ["83348939",0xCBBC],
- ["83348A30",0xCBBD],
- ["83348A31",0xCBBE],
- ["83348A32",0xCBBF],
- ["83348A33",0xCBC0],
- ["83348A34",0xCBC1],
- ["83348A35",0xCBC2],
- ["83348A36",0xCBC3],
- ["83348A37",0xCBC4],
- ["83348A38",0xCBC5],
- ["83348A39",0xCBC6],
- ["83348B30",0xCBC7],
- ["83348B31",0xCBC8],
- ["83348B32",0xCBC9],
- ["83348B33",0xCBCA],
- ["83348B34",0xCBCB],
- ["83348B35",0xCBCC],
- ["83348B36",0xCBCD],
- ["83348B37",0xCBCE],
- ["83348B38",0xCBCF],
- ["83348B39",0xCBD0],
- ["83348C30",0xCBD1],
- ["83348C31",0xCBD2],
- ["83348C32",0xCBD3],
- ["83348C33",0xCBD4],
- ["83348C34",0xCBD5],
- ["83348C35",0xCBD6],
- ["83348C36",0xCBD7],
- ["83348C37",0xCBD8],
- ["83348C38",0xCBD9],
- ["83348C39",0xCBDA],
- ["83348D30",0xCBDB],
- ["83348D31",0xCBDC],
- ["83348D32",0xCBDD],
- ["83348D33",0xCBDE],
- ["83348D34",0xCBDF],
- ["83348D35",0xCBE0],
- ["83348D36",0xCBE1],
- ["83348D37",0xCBE2],
- ["83348D38",0xCBE3],
- ["83348D39",0xCBE4],
- ["83348E30",0xCBE5],
- ["83348E31",0xCBE6],
- ["83348E32",0xCBE7],
- ["83348E33",0xCBE8],
- ["83348E34",0xCBE9],
- ["83348E35",0xCBEA],
- ["83348E36",0xCBEB],
- ["83348E37",0xCBEC],
- ["83348E38",0xCBED],
- ["83348E39",0xCBEE],
- ["83348F30",0xCBEF],
- ["83348F31",0xCBF0],
- ["83348F32",0xCBF1],
- ["83348F33",0xCBF2],
- ["83348F34",0xCBF3],
- ["83348F35",0xCBF4],
- ["83348F36",0xCBF5],
- ["83348F37",0xCBF6],
- ["83348F38",0xCBF7],
- ["83348F39",0xCBF8],
- ["83349030",0xCBF9],
- ["83349031",0xCBFA],
- ["83349032",0xCBFB],
- ["83349033",0xCBFC],
- ["83349034",0xCBFD],
- ["83349035",0xCBFE],
- ["83349036",0xCBFF],
- ["83349037",0xCC00],
- ["83349038",0xCC01],
- ["83349039",0xCC02],
- ["83349130",0xCC03],
- ["83349131",0xCC04],
- ["83349132",0xCC05],
- ["83349133",0xCC06],
- ["83349134",0xCC07],
- ["83349135",0xCC08],
- ["83349136",0xCC09],
- ["83349137",0xCC0A],
- ["83349138",0xCC0B],
- ["83349139",0xCC0C],
- ["83349230",0xCC0D],
- ["83349231",0xCC0E],
- ["83349232",0xCC0F],
- ["83349233",0xCC10],
- ["83349234",0xCC11],
- ["83349235",0xCC12],
- ["83349236",0xCC13],
- ["83349237",0xCC14],
- ["83349238",0xCC15],
- ["83349239",0xCC16],
- ["83349330",0xCC17],
- ["83349331",0xCC18],
- ["83349332",0xCC19],
- ["83349333",0xCC1A],
- ["83349334",0xCC1B],
- ["83349335",0xCC1C],
- ["83349336",0xCC1D],
- ["83349337",0xCC1E],
- ["83349338",0xCC1F],
- ["83349339",0xCC20],
- ["83349430",0xCC21],
- ["83349431",0xCC22],
- ["83349432",0xCC23],
- ["83349433",0xCC24],
- ["83349434",0xCC25],
- ["83349435",0xCC26],
- ["83349436",0xCC27],
- ["83349437",0xCC28],
- ["83349438",0xCC29],
- ["83349439",0xCC2A],
- ["83349530",0xCC2B],
- ["83349531",0xCC2C],
- ["83349532",0xCC2D],
- ["83349533",0xCC2E],
- ["83349534",0xCC2F],
- ["83349535",0xCC30],
- ["83349536",0xCC31],
- ["83349537",0xCC32],
- ["83349538",0xCC33],
- ["83349539",0xCC34],
- ["83349630",0xCC35],
- ["83349631",0xCC36],
- ["83349632",0xCC37],
- ["83349633",0xCC38],
- ["83349634",0xCC39],
- ["83349635",0xCC3A],
- ["83349636",0xCC3B],
- ["83349637",0xCC3C],
- ["83349638",0xCC3D],
- ["83349639",0xCC3E],
- ["83349730",0xCC3F],
- ["83349731",0xCC40],
- ["83349732",0xCC41],
- ["83349733",0xCC42],
- ["83349734",0xCC43],
- ["83349735",0xCC44],
- ["83349736",0xCC45],
- ["83349737",0xCC46],
- ["83349738",0xCC47],
- ["83349739",0xCC48],
- ["83349830",0xCC49],
- ["83349831",0xCC4A],
- ["83349832",0xCC4B],
- ["83349833",0xCC4C],
- ["83349834",0xCC4D],
- ["83349835",0xCC4E],
- ["83349836",0xCC4F],
- ["83349837",0xCC50],
- ["83349838",0xCC51],
- ["83349839",0xCC52],
- ["83349930",0xCC53],
- ["83349931",0xCC54],
- ["83349932",0xCC55],
- ["83349933",0xCC56],
- ["83349934",0xCC57],
- ["83349935",0xCC58],
- ["83349936",0xCC59],
- ["83349937",0xCC5A],
- ["83349938",0xCC5B],
- ["83349939",0xCC5C],
- ["83349A30",0xCC5D],
- ["83349A31",0xCC5E],
- ["83349A32",0xCC5F],
- ["83349A33",0xCC60],
- ["83349A34",0xCC61],
- ["83349A35",0xCC62],
- ["83349A36",0xCC63],
- ["83349A37",0xCC64],
- ["83349A38",0xCC65],
- ["83349A39",0xCC66],
- ["83349B30",0xCC67],
- ["83349B31",0xCC68],
- ["83349B32",0xCC69],
- ["83349B33",0xCC6A],
- ["83349B34",0xCC6B],
- ["83349B35",0xCC6C],
- ["83349B36",0xCC6D],
- ["83349B37",0xCC6E],
- ["83349B38",0xCC6F],
- ["83349B39",0xCC70],
- ["83349C30",0xCC71],
- ["83349C31",0xCC72],
- ["83349C32",0xCC73],
- ["83349C33",0xCC74],
- ["83349C34",0xCC75],
- ["83349C35",0xCC76],
- ["83349C36",0xCC77],
- ["83349C37",0xCC78],
- ["83349C38",0xCC79],
- ["83349C39",0xCC7A],
- ["83349D30",0xCC7B],
- ["83349D31",0xCC7C],
- ["83349D32",0xCC7D],
- ["83349D33",0xCC7E],
- ["83349D34",0xCC7F],
- ["83349D35",0xCC80],
- ["83349D36",0xCC81],
- ["83349D37",0xCC82],
- ["83349D38",0xCC83],
- ["83349D39",0xCC84],
- ["83349E30",0xCC85],
- ["83349E31",0xCC86],
- ["83349E32",0xCC87],
- ["83349E33",0xCC88],
- ["83349E34",0xCC89],
- ["83349E35",0xCC8A],
- ["83349E36",0xCC8B],
- ["83349E37",0xCC8C],
- ["83349E38",0xCC8D],
- ["83349E39",0xCC8E],
- ["83349F30",0xCC8F],
- ["83349F31",0xCC90],
- ["83349F32",0xCC91],
- ["83349F33",0xCC92],
- ["83349F34",0xCC93],
- ["83349F35",0xCC94],
- ["83349F36",0xCC95],
- ["83349F37",0xCC96],
- ["83349F38",0xCC97],
- ["83349F39",0xCC98],
- ["8334A030",0xCC99],
- ["8334A031",0xCC9A],
- ["8334A032",0xCC9B],
- ["8334A033",0xCC9C],
- ["8334A034",0xCC9D],
- ["8334A035",0xCC9E],
- ["8334A036",0xCC9F],
- ["8334A037",0xCCA0],
- ["8334A038",0xCCA1],
- ["8334A039",0xCCA2],
- ["8334A130",0xCCA3],
- ["8334A131",0xCCA4],
- ["8334A132",0xCCA5],
- ["8334A133",0xCCA6],
- ["8334A134",0xCCA7],
- ["8334A135",0xCCA8],
- ["8334A136",0xCCA9],
- ["8334A137",0xCCAA],
- ["8334A138",0xCCAB],
- ["8334A139",0xCCAC],
- ["8334A230",0xCCAD],
- ["8334A231",0xCCAE],
- ["8334A232",0xCCAF],
- ["8334A233",0xCCB0],
- ["8334A234",0xCCB1],
- ["8334A235",0xCCB2],
- ["8334A236",0xCCB3],
- ["8334A237",0xCCB4],
- ["8334A238",0xCCB5],
- ["8334A239",0xCCB6],
- ["8334A330",0xCCB7],
- ["8334A331",0xCCB8],
- ["8334A332",0xCCB9],
- ["8334A333",0xCCBA],
- ["8334A334",0xCCBB],
- ["8334A335",0xCCBC],
- ["8334A336",0xCCBD],
- ["8334A337",0xCCBE],
- ["8334A338",0xCCBF],
- ["8334A339",0xCCC0],
- ["8334A430",0xCCC1],
- ["8334A431",0xCCC2],
- ["8334A432",0xCCC3],
- ["8334A433",0xCCC4],
- ["8334A434",0xCCC5],
- ["8334A435",0xCCC6],
- ["8334A436",0xCCC7],
- ["8334A437",0xCCC8],
- ["8334A438",0xCCC9],
- ["8334A439",0xCCCA],
- ["8334A530",0xCCCB],
- ["8334A531",0xCCCC],
- ["8334A532",0xCCCD],
- ["8334A533",0xCCCE],
- ["8334A534",0xCCCF],
- ["8334A535",0xCCD0],
- ["8334A536",0xCCD1],
- ["8334A537",0xCCD2],
- ["8334A538",0xCCD3],
- ["8334A539",0xCCD4],
- ["8334A630",0xCCD5],
- ["8334A631",0xCCD6],
- ["8334A632",0xCCD7],
- ["8334A633",0xCCD8],
- ["8334A634",0xCCD9],
- ["8334A635",0xCCDA],
- ["8334A636",0xCCDB],
- ["8334A637",0xCCDC],
- ["8334A638",0xCCDD],
- ["8334A639",0xCCDE],
- ["8334A730",0xCCDF],
- ["8334A731",0xCCE0],
- ["8334A732",0xCCE1],
- ["8334A733",0xCCE2],
- ["8334A734",0xCCE3],
- ["8334A735",0xCCE4],
- ["8334A736",0xCCE5],
- ["8334A737",0xCCE6],
- ["8334A738",0xCCE7],
- ["8334A739",0xCCE8],
- ["8334A830",0xCCE9],
- ["8334A831",0xCCEA],
- ["8334A832",0xCCEB],
- ["8334A833",0xCCEC],
- ["8334A834",0xCCED],
- ["8334A835",0xCCEE],
- ["8334A836",0xCCEF],
- ["8334A837",0xCCF0],
- ["8334A838",0xCCF1],
- ["8334A839",0xCCF2],
- ["8334A930",0xCCF3],
- ["8334A931",0xCCF4],
- ["8334A932",0xCCF5],
- ["8334A933",0xCCF6],
- ["8334A934",0xCCF7],
- ["8334A935",0xCCF8],
- ["8334A936",0xCCF9],
- ["8334A937",0xCCFA],
- ["8334A938",0xCCFB],
- ["8334A939",0xCCFC],
- ["8334AA30",0xCCFD],
- ["8334AA31",0xCCFE],
- ["8334AA32",0xCCFF],
- ["8334AA33",0xCD00],
- ["8334AA34",0xCD01],
- ["8334AA35",0xCD02],
- ["8334AA36",0xCD03],
- ["8334AA37",0xCD04],
- ["8334AA38",0xCD05],
- ["8334AA39",0xCD06],
- ["8334AB30",0xCD07],
- ["8334AB31",0xCD08],
- ["8334AB32",0xCD09],
- ["8334AB33",0xCD0A],
- ["8334AB34",0xCD0B],
- ["8334AB35",0xCD0C],
- ["8334AB36",0xCD0D],
- ["8334AB37",0xCD0E],
- ["8334AB38",0xCD0F],
- ["8334AB39",0xCD10],
- ["8334AC30",0xCD11],
- ["8334AC31",0xCD12],
- ["8334AC32",0xCD13],
- ["8334AC33",0xCD14],
- ["8334AC34",0xCD15],
- ["8334AC35",0xCD16],
- ["8334AC36",0xCD17],
- ["8334AC37",0xCD18],
- ["8334AC38",0xCD19],
- ["8334AC39",0xCD1A],
- ["8334AD30",0xCD1B],
- ["8334AD31",0xCD1C],
- ["8334AD32",0xCD1D],
- ["8334AD33",0xCD1E],
- ["8334AD34",0xCD1F],
- ["8334AD35",0xCD20],
- ["8334AD36",0xCD21],
- ["8334AD37",0xCD22],
- ["8334AD38",0xCD23],
- ["8334AD39",0xCD24],
- ["8334AE30",0xCD25],
- ["8334AE31",0xCD26],
- ["8334AE32",0xCD27],
- ["8334AE33",0xCD28],
- ["8334AE34",0xCD29],
- ["8334AE35",0xCD2A],
- ["8334AE36",0xCD2B],
- ["8334AE37",0xCD2C],
- ["8334AE38",0xCD2D],
- ["8334AE39",0xCD2E],
- ["8334AF30",0xCD2F],
- ["8334AF31",0xCD30],
- ["8334AF32",0xCD31],
- ["8334AF33",0xCD32],
- ["8334AF34",0xCD33],
- ["8334AF35",0xCD34],
- ["8334AF36",0xCD35],
- ["8334AF37",0xCD36],
- ["8334AF38",0xCD37],
- ["8334AF39",0xCD38],
- ["8334B030",0xCD39],
- ["8334B031",0xCD3A],
- ["8334B032",0xCD3B],
- ["8334B033",0xCD3C],
- ["8334B034",0xCD3D],
- ["8334B035",0xCD3E],
- ["8334B036",0xCD3F],
- ["8334B037",0xCD40],
- ["8334B038",0xCD41],
- ["8334B039",0xCD42],
- ["8334B130",0xCD43],
- ["8334B131",0xCD44],
- ["8334B132",0xCD45],
- ["8334B133",0xCD46],
- ["8334B134",0xCD47],
- ["8334B135",0xCD48],
- ["8334B136",0xCD49],
- ["8334B137",0xCD4A],
- ["8334B138",0xCD4B],
- ["8334B139",0xCD4C],
- ["8334B230",0xCD4D],
- ["8334B231",0xCD4E],
- ["8334B232",0xCD4F],
- ["8334B233",0xCD50],
- ["8334B234",0xCD51],
- ["8334B235",0xCD52],
- ["8334B236",0xCD53],
- ["8334B237",0xCD54],
- ["8334B238",0xCD55],
- ["8334B239",0xCD56],
- ["8334B330",0xCD57],
- ["8334B331",0xCD58],
- ["8334B332",0xCD59],
- ["8334B333",0xCD5A],
- ["8334B334",0xCD5B],
- ["8334B335",0xCD5C],
- ["8334B336",0xCD5D],
- ["8334B337",0xCD5E],
- ["8334B338",0xCD5F],
- ["8334B339",0xCD60],
- ["8334B430",0xCD61],
- ["8334B431",0xCD62],
- ["8334B432",0xCD63],
- ["8334B433",0xCD64],
- ["8334B434",0xCD65],
- ["8334B435",0xCD66],
- ["8334B436",0xCD67],
- ["8334B437",0xCD68],
- ["8334B438",0xCD69],
- ["8334B439",0xCD6A],
- ["8334B530",0xCD6B],
- ["8334B531",0xCD6C],
- ["8334B532",0xCD6D],
- ["8334B533",0xCD6E],
- ["8334B534",0xCD6F],
- ["8334B535",0xCD70],
- ["8334B536",0xCD71],
- ["8334B537",0xCD72],
- ["8334B538",0xCD73],
- ["8334B539",0xCD74],
- ["8334B630",0xCD75],
- ["8334B631",0xCD76],
- ["8334B632",0xCD77],
- ["8334B633",0xCD78],
- ["8334B634",0xCD79],
- ["8334B635",0xCD7A],
- ["8334B636",0xCD7B],
- ["8334B637",0xCD7C],
- ["8334B638",0xCD7D],
- ["8334B639",0xCD7E],
- ["8334B730",0xCD7F],
- ["8334B731",0xCD80],
- ["8334B732",0xCD81],
- ["8334B733",0xCD82],
- ["8334B734",0xCD83],
- ["8334B735",0xCD84],
- ["8334B736",0xCD85],
- ["8334B737",0xCD86],
- ["8334B738",0xCD87],
- ["8334B739",0xCD88],
- ["8334B830",0xCD89],
- ["8334B831",0xCD8A],
- ["8334B832",0xCD8B],
- ["8334B833",0xCD8C],
- ["8334B834",0xCD8D],
- ["8334B835",0xCD8E],
- ["8334B836",0xCD8F],
- ["8334B837",0xCD90],
- ["8334B838",0xCD91],
- ["8334B839",0xCD92],
- ["8334B930",0xCD93],
- ["8334B931",0xCD94],
- ["8334B932",0xCD95],
- ["8334B933",0xCD96],
- ["8334B934",0xCD97],
- ["8334B935",0xCD98],
- ["8334B936",0xCD99],
- ["8334B937",0xCD9A],
- ["8334B938",0xCD9B],
- ["8334B939",0xCD9C],
- ["8334BA30",0xCD9D],
- ["8334BA31",0xCD9E],
- ["8334BA32",0xCD9F],
- ["8334BA33",0xCDA0],
- ["8334BA34",0xCDA1],
- ["8334BA35",0xCDA2],
- ["8334BA36",0xCDA3],
- ["8334BA37",0xCDA4],
- ["8334BA38",0xCDA5],
- ["8334BA39",0xCDA6],
- ["8334BB30",0xCDA7],
- ["8334BB31",0xCDA8],
- ["8334BB32",0xCDA9],
- ["8334BB33",0xCDAA],
- ["8334BB34",0xCDAB],
- ["8334BB35",0xCDAC],
- ["8334BB36",0xCDAD],
- ["8334BB37",0xCDAE],
- ["8334BB38",0xCDAF],
- ["8334BB39",0xCDB0],
- ["8334BC30",0xCDB1],
- ["8334BC31",0xCDB2],
- ["8334BC32",0xCDB3],
- ["8334BC33",0xCDB4],
- ["8334BC34",0xCDB5],
- ["8334BC35",0xCDB6],
- ["8334BC36",0xCDB7],
- ["8334BC37",0xCDB8],
- ["8334BC38",0xCDB9],
- ["8334BC39",0xCDBA],
- ["8334BD30",0xCDBB],
- ["8334BD31",0xCDBC],
- ["8334BD32",0xCDBD],
- ["8334BD33",0xCDBE],
- ["8334BD34",0xCDBF],
- ["8334BD35",0xCDC0],
- ["8334BD36",0xCDC1],
- ["8334BD37",0xCDC2],
- ["8334BD38",0xCDC3],
- ["8334BD39",0xCDC4],
- ["8334BE30",0xCDC5],
- ["8334BE31",0xCDC6],
- ["8334BE32",0xCDC7],
- ["8334BE33",0xCDC8],
- ["8334BE34",0xCDC9],
- ["8334BE35",0xCDCA],
- ["8334BE36",0xCDCB],
- ["8334BE37",0xCDCC],
- ["8334BE38",0xCDCD],
- ["8334BE39",0xCDCE],
- ["8334BF30",0xCDCF],
- ["8334BF31",0xCDD0],
- ["8334BF32",0xCDD1],
- ["8334BF33",0xCDD2],
- ["8334BF34",0xCDD3],
- ["8334BF35",0xCDD4],
- ["8334BF36",0xCDD5],
- ["8334BF37",0xCDD6],
- ["8334BF38",0xCDD7],
- ["8334BF39",0xCDD8],
- ["8334C030",0xCDD9],
- ["8334C031",0xCDDA],
- ["8334C032",0xCDDB],
- ["8334C033",0xCDDC],
- ["8334C034",0xCDDD],
- ["8334C035",0xCDDE],
- ["8334C036",0xCDDF],
- ["8334C037",0xCDE0],
- ["8334C038",0xCDE1],
- ["8334C039",0xCDE2],
- ["8334C130",0xCDE3],
- ["8334C131",0xCDE4],
- ["8334C132",0xCDE5],
- ["8334C133",0xCDE6],
- ["8334C134",0xCDE7],
- ["8334C135",0xCDE8],
- ["8334C136",0xCDE9],
- ["8334C137",0xCDEA],
- ["8334C138",0xCDEB],
- ["8334C139",0xCDEC],
- ["8334C230",0xCDED],
- ["8334C231",0xCDEE],
- ["8334C232",0xCDEF],
- ["8334C233",0xCDF0],
- ["8334C234",0xCDF1],
- ["8334C235",0xCDF2],
- ["8334C236",0xCDF3],
- ["8334C237",0xCDF4],
- ["8334C238",0xCDF5],
- ["8334C239",0xCDF6],
- ["8334C330",0xCDF7],
- ["8334C331",0xCDF8],
- ["8334C332",0xCDF9],
- ["8334C333",0xCDFA],
- ["8334C334",0xCDFB],
- ["8334C335",0xCDFC],
- ["8334C336",0xCDFD],
- ["8334C337",0xCDFE],
- ["8334C338",0xCDFF],
- ["8334C339",0xCE00],
- ["8334C430",0xCE01],
- ["8334C431",0xCE02],
- ["8334C432",0xCE03],
- ["8334C433",0xCE04],
- ["8334C434",0xCE05],
- ["8334C435",0xCE06],
- ["8334C436",0xCE07],
- ["8334C437",0xCE08],
- ["8334C438",0xCE09],
- ["8334C439",0xCE0A],
- ["8334C530",0xCE0B],
- ["8334C531",0xCE0C],
- ["8334C532",0xCE0D],
- ["8334C533",0xCE0E],
- ["8334C534",0xCE0F],
- ["8334C535",0xCE10],
- ["8334C536",0xCE11],
- ["8334C537",0xCE12],
- ["8334C538",0xCE13],
- ["8334C539",0xCE14],
- ["8334C630",0xCE15],
- ["8334C631",0xCE16],
- ["8334C632",0xCE17],
- ["8334C633",0xCE18],
- ["8334C634",0xCE19],
- ["8334C635",0xCE1A],
- ["8334C636",0xCE1B],
- ["8334C637",0xCE1C],
- ["8334C638",0xCE1D],
- ["8334C639",0xCE1E],
- ["8334C730",0xCE1F],
- ["8334C731",0xCE20],
- ["8334C732",0xCE21],
- ["8334C733",0xCE22],
- ["8334C734",0xCE23],
- ["8334C735",0xCE24],
- ["8334C736",0xCE25],
- ["8334C737",0xCE26],
- ["8334C738",0xCE27],
- ["8334C739",0xCE28],
- ["8334C830",0xCE29],
- ["8334C831",0xCE2A],
- ["8334C832",0xCE2B],
- ["8334C833",0xCE2C],
- ["8334C834",0xCE2D],
- ["8334C835",0xCE2E],
- ["8334C836",0xCE2F],
- ["8334C837",0xCE30],
- ["8334C838",0xCE31],
- ["8334C839",0xCE32],
- ["8334C930",0xCE33],
- ["8334C931",0xCE34],
- ["8334C932",0xCE35],
- ["8334C933",0xCE36],
- ["8334C934",0xCE37],
- ["8334C935",0xCE38],
- ["8334C936",0xCE39],
- ["8334C937",0xCE3A],
- ["8334C938",0xCE3B],
- ["8334C939",0xCE3C],
- ["8334CA30",0xCE3D],
- ["8334CA31",0xCE3E],
- ["8334CA32",0xCE3F],
- ["8334CA33",0xCE40],
- ["8334CA34",0xCE41],
- ["8334CA35",0xCE42],
- ["8334CA36",0xCE43],
- ["8334CA37",0xCE44],
- ["8334CA38",0xCE45],
- ["8334CA39",0xCE46],
- ["8334CB30",0xCE47],
- ["8334CB31",0xCE48],
- ["8334CB32",0xCE49],
- ["8334CB33",0xCE4A],
- ["8334CB34",0xCE4B],
- ["8334CB35",0xCE4C],
- ["8334CB36",0xCE4D],
- ["8334CB37",0xCE4E],
- ["8334CB38",0xCE4F],
- ["8334CB39",0xCE50],
- ["8334CC30",0xCE51],
- ["8334CC31",0xCE52],
- ["8334CC32",0xCE53],
- ["8334CC33",0xCE54],
- ["8334CC34",0xCE55],
- ["8334CC35",0xCE56],
- ["8334CC36",0xCE57],
- ["8334CC37",0xCE58],
- ["8334CC38",0xCE59],
- ["8334CC39",0xCE5A],
- ["8334CD30",0xCE5B],
- ["8334CD31",0xCE5C],
- ["8334CD32",0xCE5D],
- ["8334CD33",0xCE5E],
- ["8334CD34",0xCE5F],
- ["8334CD35",0xCE60],
- ["8334CD36",0xCE61],
- ["8334CD37",0xCE62],
- ["8334CD38",0xCE63],
- ["8334CD39",0xCE64],
- ["8334CE30",0xCE65],
- ["8334CE31",0xCE66],
- ["8334CE32",0xCE67],
- ["8334CE33",0xCE68],
- ["8334CE34",0xCE69],
- ["8334CE35",0xCE6A],
- ["8334CE36",0xCE6B],
- ["8334CE37",0xCE6C],
- ["8334CE38",0xCE6D],
- ["8334CE39",0xCE6E],
- ["8334CF30",0xCE6F],
- ["8334CF31",0xCE70],
- ["8334CF32",0xCE71],
- ["8334CF33",0xCE72],
- ["8334CF34",0xCE73],
- ["8334CF35",0xCE74],
- ["8334CF36",0xCE75],
- ["8334CF37",0xCE76],
- ["8334CF38",0xCE77],
- ["8334CF39",0xCE78],
- ["8334D030",0xCE79],
- ["8334D031",0xCE7A],
- ["8334D032",0xCE7B],
- ["8334D033",0xCE7C],
- ["8334D034",0xCE7D],
- ["8334D035",0xCE7E],
- ["8334D036",0xCE7F],
- ["8334D037",0xCE80],
- ["8334D038",0xCE81],
- ["8334D039",0xCE82],
- ["8334D130",0xCE83],
- ["8334D131",0xCE84],
- ["8334D132",0xCE85],
- ["8334D133",0xCE86],
- ["8334D134",0xCE87],
- ["8334D135",0xCE88],
- ["8334D136",0xCE89],
- ["8334D137",0xCE8A],
- ["8334D138",0xCE8B],
- ["8334D139",0xCE8C],
- ["8334D230",0xCE8D],
- ["8334D231",0xCE8E],
- ["8334D232",0xCE8F],
- ["8334D233",0xCE90],
- ["8334D234",0xCE91],
- ["8334D235",0xCE92],
- ["8334D236",0xCE93],
- ["8334D237",0xCE94],
- ["8334D238",0xCE95],
- ["8334D239",0xCE96],
- ["8334D330",0xCE97],
- ["8334D331",0xCE98],
- ["8334D332",0xCE99],
- ["8334D333",0xCE9A],
- ["8334D334",0xCE9B],
- ["8334D335",0xCE9C],
- ["8334D336",0xCE9D],
- ["8334D337",0xCE9E],
- ["8334D338",0xCE9F],
- ["8334D339",0xCEA0],
- ["8334D430",0xCEA1],
- ["8334D431",0xCEA2],
- ["8334D432",0xCEA3],
- ["8334D433",0xCEA4],
- ["8334D434",0xCEA5],
- ["8334D435",0xCEA6],
- ["8334D436",0xCEA7],
- ["8334D437",0xCEA8],
- ["8334D438",0xCEA9],
- ["8334D439",0xCEAA],
- ["8334D530",0xCEAB],
- ["8334D531",0xCEAC],
- ["8334D532",0xCEAD],
- ["8334D533",0xCEAE],
- ["8334D534",0xCEAF],
- ["8334D535",0xCEB0],
- ["8334D536",0xCEB1],
- ["8334D537",0xCEB2],
- ["8334D538",0xCEB3],
- ["8334D539",0xCEB4],
- ["8334D630",0xCEB5],
- ["8334D631",0xCEB6],
- ["8334D632",0xCEB7],
- ["8334D633",0xCEB8],
- ["8334D634",0xCEB9],
- ["8334D635",0xCEBA],
- ["8334D636",0xCEBB],
- ["8334D637",0xCEBC],
- ["8334D638",0xCEBD],
- ["8334D639",0xCEBE],
- ["8334D730",0xCEBF],
- ["8334D731",0xCEC0],
- ["8334D732",0xCEC1],
- ["8334D733",0xCEC2],
- ["8334D734",0xCEC3],
- ["8334D735",0xCEC4],
- ["8334D736",0xCEC5],
- ["8334D737",0xCEC6],
- ["8334D738",0xCEC7],
- ["8334D739",0xCEC8],
- ["8334D830",0xCEC9],
- ["8334D831",0xCECA],
- ["8334D832",0xCECB],
- ["8334D833",0xCECC],
- ["8334D834",0xCECD],
- ["8334D835",0xCECE],
- ["8334D836",0xCECF],
- ["8334D837",0xCED0],
- ["8334D838",0xCED1],
- ["8334D839",0xCED2],
- ["8334D930",0xCED3],
- ["8334D931",0xCED4],
- ["8334D932",0xCED5],
- ["8334D933",0xCED6],
- ["8334D934",0xCED7],
- ["8334D935",0xCED8],
- ["8334D936",0xCED9],
- ["8334D937",0xCEDA],
- ["8334D938",0xCEDB],
- ["8334D939",0xCEDC],
- ["8334DA30",0xCEDD],
- ["8334DA31",0xCEDE],
- ["8334DA32",0xCEDF],
- ["8334DA33",0xCEE0],
- ["8334DA34",0xCEE1],
- ["8334DA35",0xCEE2],
- ["8334DA36",0xCEE3],
- ["8334DA37",0xCEE4],
- ["8334DA38",0xCEE5],
- ["8334DA39",0xCEE6],
- ["8334DB30",0xCEE7],
- ["8334DB31",0xCEE8],
- ["8334DB32",0xCEE9],
- ["8334DB33",0xCEEA],
- ["8334DB34",0xCEEB],
- ["8334DB35",0xCEEC],
- ["8334DB36",0xCEED],
- ["8334DB37",0xCEEE],
- ["8334DB38",0xCEEF],
- ["8334DB39",0xCEF0],
- ["8334DC30",0xCEF1],
- ["8334DC31",0xCEF2],
- ["8334DC32",0xCEF3],
- ["8334DC33",0xCEF4],
- ["8334DC34",0xCEF5],
- ["8334DC35",0xCEF6],
- ["8334DC36",0xCEF7],
- ["8334DC37",0xCEF8],
- ["8334DC38",0xCEF9],
- ["8334DC39",0xCEFA],
- ["8334DD30",0xCEFB],
- ["8334DD31",0xCEFC],
- ["8334DD32",0xCEFD],
- ["8334DD33",0xCEFE],
- ["8334DD34",0xCEFF],
- ["8334DD35",0xCF00],
- ["8334DD36",0xCF01],
- ["8334DD37",0xCF02],
- ["8334DD38",0xCF03],
- ["8334DD39",0xCF04],
- ["8334DE30",0xCF05],
- ["8334DE31",0xCF06],
- ["8334DE32",0xCF07],
- ["8334DE33",0xCF08],
- ["8334DE34",0xCF09],
- ["8334DE35",0xCF0A],
- ["8334DE36",0xCF0B],
- ["8334DE37",0xCF0C],
- ["8334DE38",0xCF0D],
- ["8334DE39",0xCF0E],
- ["8334DF30",0xCF0F],
- ["8334DF31",0xCF10],
- ["8334DF32",0xCF11],
- ["8334DF33",0xCF12],
- ["8334DF34",0xCF13],
- ["8334DF35",0xCF14],
- ["8334DF36",0xCF15],
- ["8334DF37",0xCF16],
- ["8334DF38",0xCF17],
- ["8334DF39",0xCF18],
- ["8334E030",0xCF19],
- ["8334E031",0xCF1A],
- ["8334E032",0xCF1B],
- ["8334E033",0xCF1C],
- ["8334E034",0xCF1D],
- ["8334E035",0xCF1E],
- ["8334E036",0xCF1F],
- ["8334E037",0xCF20],
- ["8334E038",0xCF21],
- ["8334E039",0xCF22],
- ["8334E130",0xCF23],
- ["8334E131",0xCF24],
- ["8334E132",0xCF25],
- ["8334E133",0xCF26],
- ["8334E134",0xCF27],
- ["8334E135",0xCF28],
- ["8334E136",0xCF29],
- ["8334E137",0xCF2A],
- ["8334E138",0xCF2B],
- ["8334E139",0xCF2C],
- ["8334E230",0xCF2D],
- ["8334E231",0xCF2E],
- ["8334E232",0xCF2F],
- ["8334E233",0xCF30],
- ["8334E234",0xCF31],
- ["8334E235",0xCF32],
- ["8334E236",0xCF33],
- ["8334E237",0xCF34],
- ["8334E238",0xCF35],
- ["8334E239",0xCF36],
- ["8334E330",0xCF37],
- ["8334E331",0xCF38],
- ["8334E332",0xCF39],
- ["8334E333",0xCF3A],
- ["8334E334",0xCF3B],
- ["8334E335",0xCF3C],
- ["8334E336",0xCF3D],
- ["8334E337",0xCF3E],
- ["8334E338",0xCF3F],
- ["8334E339",0xCF40],
- ["8334E430",0xCF41],
- ["8334E431",0xCF42],
- ["8334E432",0xCF43],
- ["8334E433",0xCF44],
- ["8334E434",0xCF45],
- ["8334E435",0xCF46],
- ["8334E436",0xCF47],
- ["8334E437",0xCF48],
- ["8334E438",0xCF49],
- ["8334E439",0xCF4A],
- ["8334E530",0xCF4B],
- ["8334E531",0xCF4C],
- ["8334E532",0xCF4D],
- ["8334E533",0xCF4E],
- ["8334E534",0xCF4F],
- ["8334E535",0xCF50],
- ["8334E536",0xCF51],
- ["8334E537",0xCF52],
- ["8334E538",0xCF53],
- ["8334E539",0xCF54],
- ["8334E630",0xCF55],
- ["8334E631",0xCF56],
- ["8334E632",0xCF57],
- ["8334E633",0xCF58],
- ["8334E634",0xCF59],
- ["8334E635",0xCF5A],
- ["8334E636",0xCF5B],
- ["8334E637",0xCF5C],
- ["8334E638",0xCF5D],
- ["8334E639",0xCF5E],
- ["8334E730",0xCF5F],
- ["8334E731",0xCF60],
- ["8334E732",0xCF61],
- ["8334E733",0xCF62],
- ["8334E734",0xCF63],
- ["8334E735",0xCF64],
- ["8334E736",0xCF65],
- ["8334E737",0xCF66],
- ["8334E738",0xCF67],
- ["8334E739",0xCF68],
- ["8334E830",0xCF69],
- ["8334E831",0xCF6A],
- ["8334E832",0xCF6B],
- ["8334E833",0xCF6C],
- ["8334E834",0xCF6D],
- ["8334E835",0xCF6E],
- ["8334E836",0xCF6F],
- ["8334E837",0xCF70],
- ["8334E838",0xCF71],
- ["8334E839",0xCF72],
- ["8334E930",0xCF73],
- ["8334E931",0xCF74],
- ["8334E932",0xCF75],
- ["8334E933",0xCF76],
- ["8334E934",0xCF77],
- ["8334E935",0xCF78],
- ["8334E936",0xCF79],
- ["8334E937",0xCF7A],
- ["8334E938",0xCF7B],
- ["8334E939",0xCF7C],
- ["8334EA30",0xCF7D],
- ["8334EA31",0xCF7E],
- ["8334EA32",0xCF7F],
- ["8334EA33",0xCF80],
- ["8334EA34",0xCF81],
- ["8334EA35",0xCF82],
- ["8334EA36",0xCF83],
- ["8334EA37",0xCF84],
- ["8334EA38",0xCF85],
- ["8334EA39",0xCF86],
- ["8334EB30",0xCF87],
- ["8334EB31",0xCF88],
- ["8334EB32",0xCF89],
- ["8334EB33",0xCF8A],
- ["8334EB34",0xCF8B],
- ["8334EB35",0xCF8C],
- ["8334EB36",0xCF8D],
- ["8334EB37",0xCF8E],
- ["8334EB38",0xCF8F],
- ["8334EB39",0xCF90],
- ["8334EC30",0xCF91],
- ["8334EC31",0xCF92],
- ["8334EC32",0xCF93],
- ["8334EC33",0xCF94],
- ["8334EC34",0xCF95],
- ["8334EC35",0xCF96],
- ["8334EC36",0xCF97],
- ["8334EC37",0xCF98],
- ["8334EC38",0xCF99],
- ["8334EC39",0xCF9A],
- ["8334ED30",0xCF9B],
- ["8334ED31",0xCF9C],
- ["8334ED32",0xCF9D],
- ["8334ED33",0xCF9E],
- ["8334ED34",0xCF9F],
- ["8334ED35",0xCFA0],
- ["8334ED36",0xCFA1],
- ["8334ED37",0xCFA2],
- ["8334ED38",0xCFA3],
- ["8334ED39",0xCFA4],
- ["8334EE30",0xCFA5],
- ["8334EE31",0xCFA6],
- ["8334EE32",0xCFA7],
- ["8334EE33",0xCFA8],
- ["8334EE34",0xCFA9],
- ["8334EE35",0xCFAA],
- ["8334EE36",0xCFAB],
- ["8334EE37",0xCFAC],
- ["8334EE38",0xCFAD],
- ["8334EE39",0xCFAE],
- ["8334EF30",0xCFAF],
- ["8334EF31",0xCFB0],
- ["8334EF32",0xCFB1],
- ["8334EF33",0xCFB2],
- ["8334EF34",0xCFB3],
- ["8334EF35",0xCFB4],
- ["8334EF36",0xCFB5],
- ["8334EF37",0xCFB6],
- ["8334EF38",0xCFB7],
- ["8334EF39",0xCFB8],
- ["8334F030",0xCFB9],
- ["8334F031",0xCFBA],
- ["8334F032",0xCFBB],
- ["8334F033",0xCFBC],
- ["8334F034",0xCFBD],
- ["8334F035",0xCFBE],
- ["8334F036",0xCFBF],
- ["8334F037",0xCFC0],
- ["8334F038",0xCFC1],
- ["8334F039",0xCFC2],
- ["8334F130",0xCFC3],
- ["8334F131",0xCFC4],
- ["8334F132",0xCFC5],
- ["8334F133",0xCFC6],
- ["8334F134",0xCFC7],
- ["8334F135",0xCFC8],
- ["8334F136",0xCFC9],
- ["8334F137",0xCFCA],
- ["8334F138",0xCFCB],
- ["8334F139",0xCFCC],
- ["8334F230",0xCFCD],
- ["8334F231",0xCFCE],
- ["8334F232",0xCFCF],
- ["8334F233",0xCFD0],
- ["8334F234",0xCFD1],
- ["8334F235",0xCFD2],
- ["8334F236",0xCFD3],
- ["8334F237",0xCFD4],
- ["8334F238",0xCFD5],
- ["8334F239",0xCFD6],
- ["8334F330",0xCFD7],
- ["8334F331",0xCFD8],
- ["8334F332",0xCFD9],
- ["8334F333",0xCFDA],
- ["8334F334",0xCFDB],
- ["8334F335",0xCFDC],
- ["8334F336",0xCFDD],
- ["8334F337",0xCFDE],
- ["8334F338",0xCFDF],
- ["8334F339",0xCFE0],
- ["8334F430",0xCFE1],
- ["8334F431",0xCFE2],
- ["8334F432",0xCFE3],
- ["8334F433",0xCFE4],
- ["8334F434",0xCFE5],
- ["8334F435",0xCFE6],
- ["8334F436",0xCFE7],
- ["8334F437",0xCFE8],
- ["8334F438",0xCFE9],
- ["8334F439",0xCFEA],
- ["8334F530",0xCFEB],
- ["8334F531",0xCFEC],
- ["8334F532",0xCFED],
- ["8334F533",0xCFEE],
- ["8334F534",0xCFEF],
- ["8334F535",0xCFF0],
- ["8334F536",0xCFF1],
- ["8334F537",0xCFF2],
- ["8334F538",0xCFF3],
- ["8334F539",0xCFF4],
- ["8334F630",0xCFF5],
- ["8334F631",0xCFF6],
- ["8334F632",0xCFF7],
- ["8334F633",0xCFF8],
- ["8334F634",0xCFF9],
- ["8334F635",0xCFFA],
- ["8334F636",0xCFFB],
- ["8334F637",0xCFFC],
- ["8334F638",0xCFFD],
- ["8334F639",0xCFFE],
- ["8334F730",0xCFFF],
- ["8334F731",0xD000],
- ["8334F732",0xD001],
- ["8334F733",0xD002],
- ["8334F734",0xD003],
- ["8334F735",0xD004],
- ["8334F736",0xD005],
- ["8334F737",0xD006],
- ["8334F738",0xD007],
- ["8334F739",0xD008],
- ["8334F830",0xD009],
- ["8334F831",0xD00A],
- ["8334F832",0xD00B],
- ["8334F833",0xD00C],
- ["8334F834",0xD00D],
- ["8334F835",0xD00E],
- ["8334F836",0xD00F],
- ["8334F837",0xD010],
- ["8334F838",0xD011],
- ["8334F839",0xD012],
- ["8334F930",0xD013],
- ["8334F931",0xD014],
- ["8334F932",0xD015],
- ["8334F933",0xD016],
- ["8334F934",0xD017],
- ["8334F935",0xD018],
- ["8334F936",0xD019],
- ["8334F937",0xD01A],
- ["8334F938",0xD01B],
- ["8334F939",0xD01C],
- ["8334FA30",0xD01D],
- ["8334FA31",0xD01E],
- ["8334FA32",0xD01F],
- ["8334FA33",0xD020],
- ["8334FA34",0xD021],
- ["8334FA35",0xD022],
- ["8334FA36",0xD023],
- ["8334FA37",0xD024],
- ["8334FA38",0xD025],
- ["8334FA39",0xD026],
- ["8334FB30",0xD027],
- ["8334FB31",0xD028],
- ["8334FB32",0xD029],
- ["8334FB33",0xD02A],
- ["8334FB34",0xD02B],
- ["8334FB35",0xD02C],
- ["8334FB36",0xD02D],
- ["8334FB37",0xD02E],
- ["8334FB38",0xD02F],
- ["8334FB39",0xD030],
- ["8334FC30",0xD031],
- ["8334FC31",0xD032],
- ["8334FC32",0xD033],
- ["8334FC33",0xD034],
- ["8334FC34",0xD035],
- ["8334FC35",0xD036],
- ["8334FC36",0xD037],
- ["8334FC37",0xD038],
- ["8334FC38",0xD039],
- ["8334FC39",0xD03A],
- ["8334FD30",0xD03B],
- ["8334FD31",0xD03C],
- ["8334FD32",0xD03D],
- ["8334FD33",0xD03E],
- ["8334FD34",0xD03F],
- ["8334FD35",0xD040],
- ["8334FD36",0xD041],
- ["8334FD37",0xD042],
- ["8334FD38",0xD043],
- ["8334FD39",0xD044],
- ["8334FE30",0xD045],
- ["8334FE31",0xD046],
- ["8334FE32",0xD047],
- ["8334FE33",0xD048],
- ["8334FE34",0xD049],
- ["8334FE35",0xD04A],
- ["8334FE36",0xD04B],
- ["8334FE37",0xD04C],
- ["8334FE38",0xD04D],
- ["8334FE39",0xD04E],
- ["83358130",0xD04F],
- ["83358131",0xD050],
- ["83358132",0xD051],
- ["83358133",0xD052],
- ["83358134",0xD053],
- ["83358135",0xD054],
- ["83358136",0xD055],
- ["83358137",0xD056],
- ["83358138",0xD057],
- ["83358139",0xD058],
- ["83358230",0xD059],
- ["83358231",0xD05A],
- ["83358232",0xD05B],
- ["83358233",0xD05C],
- ["83358234",0xD05D],
- ["83358235",0xD05E],
- ["83358236",0xD05F],
- ["83358237",0xD060],
- ["83358238",0xD061],
- ["83358239",0xD062],
- ["83358330",0xD063],
- ["83358331",0xD064],
- ["83358332",0xD065],
- ["83358333",0xD066],
- ["83358334",0xD067],
- ["83358335",0xD068],
- ["83358336",0xD069],
- ["83358337",0xD06A],
- ["83358338",0xD06B],
- ["83358339",0xD06C],
- ["83358430",0xD06D],
- ["83358431",0xD06E],
- ["83358432",0xD06F],
- ["83358433",0xD070],
- ["83358434",0xD071],
- ["83358435",0xD072],
- ["83358436",0xD073],
- ["83358437",0xD074],
- ["83358438",0xD075],
- ["83358439",0xD076],
- ["83358530",0xD077],
- ["83358531",0xD078],
- ["83358532",0xD079],
- ["83358533",0xD07A],
- ["83358534",0xD07B],
- ["83358535",0xD07C],
- ["83358536",0xD07D],
- ["83358537",0xD07E],
- ["83358538",0xD07F],
- ["83358539",0xD080],
- ["83358630",0xD081],
- ["83358631",0xD082],
- ["83358632",0xD083],
- ["83358633",0xD084],
- ["83358634",0xD085],
- ["83358635",0xD086],
- ["83358636",0xD087],
- ["83358637",0xD088],
- ["83358638",0xD089],
- ["83358639",0xD08A],
- ["83358730",0xD08B],
- ["83358731",0xD08C],
- ["83358732",0xD08D],
- ["83358733",0xD08E],
- ["83358734",0xD08F],
- ["83358735",0xD090],
- ["83358736",0xD091],
- ["83358737",0xD092],
- ["83358738",0xD093],
- ["83358739",0xD094],
- ["83358830",0xD095],
- ["83358831",0xD096],
- ["83358832",0xD097],
- ["83358833",0xD098],
- ["83358834",0xD099],
- ["83358835",0xD09A],
- ["83358836",0xD09B],
- ["83358837",0xD09C],
- ["83358838",0xD09D],
- ["83358839",0xD09E],
- ["83358930",0xD09F],
- ["83358931",0xD0A0],
- ["83358932",0xD0A1],
- ["83358933",0xD0A2],
- ["83358934",0xD0A3],
- ["83358935",0xD0A4],
- ["83358936",0xD0A5],
- ["83358937",0xD0A6],
- ["83358938",0xD0A7],
- ["83358939",0xD0A8],
- ["83358A30",0xD0A9],
- ["83358A31",0xD0AA],
- ["83358A32",0xD0AB],
- ["83358A33",0xD0AC],
- ["83358A34",0xD0AD],
- ["83358A35",0xD0AE],
- ["83358A36",0xD0AF],
- ["83358A37",0xD0B0],
- ["83358A38",0xD0B1],
- ["83358A39",0xD0B2],
- ["83358B30",0xD0B3],
- ["83358B31",0xD0B4],
- ["83358B32",0xD0B5],
- ["83358B33",0xD0B6],
- ["83358B34",0xD0B7],
- ["83358B35",0xD0B8],
- ["83358B36",0xD0B9],
- ["83358B37",0xD0BA],
- ["83358B38",0xD0BB],
- ["83358B39",0xD0BC],
- ["83358C30",0xD0BD],
- ["83358C31",0xD0BE],
- ["83358C32",0xD0BF],
- ["83358C33",0xD0C0],
- ["83358C34",0xD0C1],
- ["83358C35",0xD0C2],
- ["83358C36",0xD0C3],
- ["83358C37",0xD0C4],
- ["83358C38",0xD0C5],
- ["83358C39",0xD0C6],
- ["83358D30",0xD0C7],
- ["83358D31",0xD0C8],
- ["83358D32",0xD0C9],
- ["83358D33",0xD0CA],
- ["83358D34",0xD0CB],
- ["83358D35",0xD0CC],
- ["83358D36",0xD0CD],
- ["83358D37",0xD0CE],
- ["83358D38",0xD0CF],
- ["83358D39",0xD0D0],
- ["83358E30",0xD0D1],
- ["83358E31",0xD0D2],
- ["83358E32",0xD0D3],
- ["83358E33",0xD0D4],
- ["83358E34",0xD0D5],
- ["83358E35",0xD0D6],
- ["83358E36",0xD0D7],
- ["83358E37",0xD0D8],
- ["83358E38",0xD0D9],
- ["83358E39",0xD0DA],
- ["83358F30",0xD0DB],
- ["83358F31",0xD0DC],
- ["83358F32",0xD0DD],
- ["83358F33",0xD0DE],
- ["83358F34",0xD0DF],
- ["83358F35",0xD0E0],
- ["83358F36",0xD0E1],
- ["83358F37",0xD0E2],
- ["83358F38",0xD0E3],
- ["83358F39",0xD0E4],
- ["83359030",0xD0E5],
- ["83359031",0xD0E6],
- ["83359032",0xD0E7],
- ["83359033",0xD0E8],
- ["83359034",0xD0E9],
- ["83359035",0xD0EA],
- ["83359036",0xD0EB],
- ["83359037",0xD0EC],
- ["83359038",0xD0ED],
- ["83359039",0xD0EE],
- ["83359130",0xD0EF],
- ["83359131",0xD0F0],
- ["83359132",0xD0F1],
- ["83359133",0xD0F2],
- ["83359134",0xD0F3],
- ["83359135",0xD0F4],
- ["83359136",0xD0F5],
- ["83359137",0xD0F6],
- ["83359138",0xD0F7],
- ["83359139",0xD0F8],
- ["83359230",0xD0F9],
- ["83359231",0xD0FA],
- ["83359232",0xD0FB],
- ["83359233",0xD0FC],
- ["83359234",0xD0FD],
- ["83359235",0xD0FE],
- ["83359236",0xD0FF],
- ["83359237",0xD100],
- ["83359238",0xD101],
- ["83359239",0xD102],
- ["83359330",0xD103],
- ["83359331",0xD104],
- ["83359332",0xD105],
- ["83359333",0xD106],
- ["83359334",0xD107],
- ["83359335",0xD108],
- ["83359336",0xD109],
- ["83359337",0xD10A],
- ["83359338",0xD10B],
- ["83359339",0xD10C],
- ["83359430",0xD10D],
- ["83359431",0xD10E],
- ["83359432",0xD10F],
- ["83359433",0xD110],
- ["83359434",0xD111],
- ["83359435",0xD112],
- ["83359436",0xD113],
- ["83359437",0xD114],
- ["83359438",0xD115],
- ["83359439",0xD116],
- ["83359530",0xD117],
- ["83359531",0xD118],
- ["83359532",0xD119],
- ["83359533",0xD11A],
- ["83359534",0xD11B],
- ["83359535",0xD11C],
- ["83359536",0xD11D],
- ["83359537",0xD11E],
- ["83359538",0xD11F],
- ["83359539",0xD120],
- ["83359630",0xD121],
- ["83359631",0xD122],
- ["83359632",0xD123],
- ["83359633",0xD124],
- ["83359634",0xD125],
- ["83359635",0xD126],
- ["83359636",0xD127],
- ["83359637",0xD128],
- ["83359638",0xD129],
- ["83359639",0xD12A],
- ["83359730",0xD12B],
- ["83359731",0xD12C],
- ["83359732",0xD12D],
- ["83359733",0xD12E],
- ["83359734",0xD12F],
- ["83359735",0xD130],
- ["83359736",0xD131],
- ["83359737",0xD132],
- ["83359738",0xD133],
- ["83359739",0xD134],
- ["83359830",0xD135],
- ["83359831",0xD136],
- ["83359832",0xD137],
- ["83359833",0xD138],
- ["83359834",0xD139],
- ["83359835",0xD13A],
- ["83359836",0xD13B],
- ["83359837",0xD13C],
- ["83359838",0xD13D],
- ["83359839",0xD13E],
- ["83359930",0xD13F],
- ["83359931",0xD140],
- ["83359932",0xD141],
- ["83359933",0xD142],
- ["83359934",0xD143],
- ["83359935",0xD144],
- ["83359936",0xD145],
- ["83359937",0xD146],
- ["83359938",0xD147],
- ["83359939",0xD148],
- ["83359A30",0xD149],
- ["83359A31",0xD14A],
- ["83359A32",0xD14B],
- ["83359A33",0xD14C],
- ["83359A34",0xD14D],
- ["83359A35",0xD14E],
- ["83359A36",0xD14F],
- ["83359A37",0xD150],
- ["83359A38",0xD151],
- ["83359A39",0xD152],
- ["83359B30",0xD153],
- ["83359B31",0xD154],
- ["83359B32",0xD155],
- ["83359B33",0xD156],
- ["83359B34",0xD157],
- ["83359B35",0xD158],
- ["83359B36",0xD159],
- ["83359B37",0xD15A],
- ["83359B38",0xD15B],
- ["83359B39",0xD15C],
- ["83359C30",0xD15D],
- ["83359C31",0xD15E],
- ["83359C32",0xD15F],
- ["83359C33",0xD160],
- ["83359C34",0xD161],
- ["83359C35",0xD162],
- ["83359C36",0xD163],
- ["83359C37",0xD164],
- ["83359C38",0xD165],
- ["83359C39",0xD166],
- ["83359D30",0xD167],
- ["83359D31",0xD168],
- ["83359D32",0xD169],
- ["83359D33",0xD16A],
- ["83359D34",0xD16B],
- ["83359D35",0xD16C],
- ["83359D36",0xD16D],
- ["83359D37",0xD16E],
- ["83359D38",0xD16F],
- ["83359D39",0xD170],
- ["83359E30",0xD171],
- ["83359E31",0xD172],
- ["83359E32",0xD173],
- ["83359E33",0xD174],
- ["83359E34",0xD175],
- ["83359E35",0xD176],
- ["83359E36",0xD177],
- ["83359E37",0xD178],
- ["83359E38",0xD179],
- ["83359E39",0xD17A],
- ["83359F30",0xD17B],
- ["83359F31",0xD17C],
- ["83359F32",0xD17D],
- ["83359F33",0xD17E],
- ["83359F34",0xD17F],
- ["83359F35",0xD180],
- ["83359F36",0xD181],
- ["83359F37",0xD182],
- ["83359F38",0xD183],
- ["83359F39",0xD184],
- ["8335A030",0xD185],
- ["8335A031",0xD186],
- ["8335A032",0xD187],
- ["8335A033",0xD188],
- ["8335A034",0xD189],
- ["8335A035",0xD18A],
- ["8335A036",0xD18B],
- ["8335A037",0xD18C],
- ["8335A038",0xD18D],
- ["8335A039",0xD18E],
- ["8335A130",0xD18F],
- ["8335A131",0xD190],
- ["8335A132",0xD191],
- ["8335A133",0xD192],
- ["8335A134",0xD193],
- ["8335A135",0xD194],
- ["8335A136",0xD195],
- ["8335A137",0xD196],
- ["8335A138",0xD197],
- ["8335A139",0xD198],
- ["8335A230",0xD199],
- ["8335A231",0xD19A],
- ["8335A232",0xD19B],
- ["8335A233",0xD19C],
- ["8335A234",0xD19D],
- ["8335A235",0xD19E],
- ["8335A236",0xD19F],
- ["8335A237",0xD1A0],
- ["8335A238",0xD1A1],
- ["8335A239",0xD1A2],
- ["8335A330",0xD1A3],
- ["8335A331",0xD1A4],
- ["8335A332",0xD1A5],
- ["8335A333",0xD1A6],
- ["8335A334",0xD1A7],
- ["8335A335",0xD1A8],
- ["8335A336",0xD1A9],
- ["8335A337",0xD1AA],
- ["8335A338",0xD1AB],
- ["8335A339",0xD1AC],
- ["8335A430",0xD1AD],
- ["8335A431",0xD1AE],
- ["8335A432",0xD1AF],
- ["8335A433",0xD1B0],
- ["8335A434",0xD1B1],
- ["8335A435",0xD1B2],
- ["8335A436",0xD1B3],
- ["8335A437",0xD1B4],
- ["8335A438",0xD1B5],
- ["8335A439",0xD1B6],
- ["8335A530",0xD1B7],
- ["8335A531",0xD1B8],
- ["8335A532",0xD1B9],
- ["8335A533",0xD1BA],
- ["8335A534",0xD1BB],
- ["8335A535",0xD1BC],
- ["8335A536",0xD1BD],
- ["8335A537",0xD1BE],
- ["8335A538",0xD1BF],
- ["8335A539",0xD1C0],
- ["8335A630",0xD1C1],
- ["8335A631",0xD1C2],
- ["8335A632",0xD1C3],
- ["8335A633",0xD1C4],
- ["8335A634",0xD1C5],
- ["8335A635",0xD1C6],
- ["8335A636",0xD1C7],
- ["8335A637",0xD1C8],
- ["8335A638",0xD1C9],
- ["8335A639",0xD1CA],
- ["8335A730",0xD1CB],
- ["8335A731",0xD1CC],
- ["8335A732",0xD1CD],
- ["8335A733",0xD1CE],
- ["8335A734",0xD1CF],
- ["8335A735",0xD1D0],
- ["8335A736",0xD1D1],
- ["8335A737",0xD1D2],
- ["8335A738",0xD1D3],
- ["8335A739",0xD1D4],
- ["8335A830",0xD1D5],
- ["8335A831",0xD1D6],
- ["8335A832",0xD1D7],
- ["8335A833",0xD1D8],
- ["8335A834",0xD1D9],
- ["8335A835",0xD1DA],
- ["8335A836",0xD1DB],
- ["8335A837",0xD1DC],
- ["8335A838",0xD1DD],
- ["8335A839",0xD1DE],
- ["8335A930",0xD1DF],
- ["8335A931",0xD1E0],
- ["8335A932",0xD1E1],
- ["8335A933",0xD1E2],
- ["8335A934",0xD1E3],
- ["8335A935",0xD1E4],
- ["8335A936",0xD1E5],
- ["8335A937",0xD1E6],
- ["8335A938",0xD1E7],
- ["8335A939",0xD1E8],
- ["8335AA30",0xD1E9],
- ["8335AA31",0xD1EA],
- ["8335AA32",0xD1EB],
- ["8335AA33",0xD1EC],
- ["8335AA34",0xD1ED],
- ["8335AA35",0xD1EE],
- ["8335AA36",0xD1EF],
- ["8335AA37",0xD1F0],
- ["8335AA38",0xD1F1],
- ["8335AA39",0xD1F2],
- ["8335AB30",0xD1F3],
- ["8335AB31",0xD1F4],
- ["8335AB32",0xD1F5],
- ["8335AB33",0xD1F6],
- ["8335AB34",0xD1F7],
- ["8335AB35",0xD1F8],
- ["8335AB36",0xD1F9],
- ["8335AB37",0xD1FA],
- ["8335AB38",0xD1FB],
- ["8335AB39",0xD1FC],
- ["8335AC30",0xD1FD],
- ["8335AC31",0xD1FE],
- ["8335AC32",0xD1FF],
- ["8335AC33",0xD200],
- ["8335AC34",0xD201],
- ["8335AC35",0xD202],
- ["8335AC36",0xD203],
- ["8335AC37",0xD204],
- ["8335AC38",0xD205],
- ["8335AC39",0xD206],
- ["8335AD30",0xD207],
- ["8335AD31",0xD208],
- ["8335AD32",0xD209],
- ["8335AD33",0xD20A],
- ["8335AD34",0xD20B],
- ["8335AD35",0xD20C],
- ["8335AD36",0xD20D],
- ["8335AD37",0xD20E],
- ["8335AD38",0xD20F],
- ["8335AD39",0xD210],
- ["8335AE30",0xD211],
- ["8335AE31",0xD212],
- ["8335AE32",0xD213],
- ["8335AE33",0xD214],
- ["8335AE34",0xD215],
- ["8335AE35",0xD216],
- ["8335AE36",0xD217],
- ["8335AE37",0xD218],
- ["8335AE38",0xD219],
- ["8335AE39",0xD21A],
- ["8335AF30",0xD21B],
- ["8335AF31",0xD21C],
- ["8335AF32",0xD21D],
- ["8335AF33",0xD21E],
- ["8335AF34",0xD21F],
- ["8335AF35",0xD220],
- ["8335AF36",0xD221],
- ["8335AF37",0xD222],
- ["8335AF38",0xD223],
- ["8335AF39",0xD224],
- ["8335B030",0xD225],
- ["8335B031",0xD226],
- ["8335B032",0xD227],
- ["8335B033",0xD228],
- ["8335B034",0xD229],
- ["8335B035",0xD22A],
- ["8335B036",0xD22B],
- ["8335B037",0xD22C],
- ["8335B038",0xD22D],
- ["8335B039",0xD22E],
- ["8335B130",0xD22F],
- ["8335B131",0xD230],
- ["8335B132",0xD231],
- ["8335B133",0xD232],
- ["8335B134",0xD233],
- ["8335B135",0xD234],
- ["8335B136",0xD235],
- ["8335B137",0xD236],
- ["8335B138",0xD237],
- ["8335B139",0xD238],
- ["8335B230",0xD239],
- ["8335B231",0xD23A],
- ["8335B232",0xD23B],
- ["8335B233",0xD23C],
- ["8335B234",0xD23D],
- ["8335B235",0xD23E],
- ["8335B236",0xD23F],
- ["8335B237",0xD240],
- ["8335B238",0xD241],
- ["8335B239",0xD242],
- ["8335B330",0xD243],
- ["8335B331",0xD244],
- ["8335B332",0xD245],
- ["8335B333",0xD246],
- ["8335B334",0xD247],
- ["8335B335",0xD248],
- ["8335B336",0xD249],
- ["8335B337",0xD24A],
- ["8335B338",0xD24B],
- ["8335B339",0xD24C],
- ["8335B430",0xD24D],
- ["8335B431",0xD24E],
- ["8335B432",0xD24F],
- ["8335B433",0xD250],
- ["8335B434",0xD251],
- ["8335B435",0xD252],
- ["8335B436",0xD253],
- ["8335B437",0xD254],
- ["8335B438",0xD255],
- ["8335B439",0xD256],
- ["8335B530",0xD257],
- ["8335B531",0xD258],
- ["8335B532",0xD259],
- ["8335B533",0xD25A],
- ["8335B534",0xD25B],
- ["8335B535",0xD25C],
- ["8335B536",0xD25D],
- ["8335B537",0xD25E],
- ["8335B538",0xD25F],
- ["8335B539",0xD260],
- ["8335B630",0xD261],
- ["8335B631",0xD262],
- ["8335B632",0xD263],
- ["8335B633",0xD264],
- ["8335B634",0xD265],
- ["8335B635",0xD266],
- ["8335B636",0xD267],
- ["8335B637",0xD268],
- ["8335B638",0xD269],
- ["8335B639",0xD26A],
- ["8335B730",0xD26B],
- ["8335B731",0xD26C],
- ["8335B732",0xD26D],
- ["8335B733",0xD26E],
- ["8335B734",0xD26F],
- ["8335B735",0xD270],
- ["8335B736",0xD271],
- ["8335B737",0xD272],
- ["8335B738",0xD273],
- ["8335B739",0xD274],
- ["8335B830",0xD275],
- ["8335B831",0xD276],
- ["8335B832",0xD277],
- ["8335B833",0xD278],
- ["8335B834",0xD279],
- ["8335B835",0xD27A],
- ["8335B836",0xD27B],
- ["8335B837",0xD27C],
- ["8335B838",0xD27D],
- ["8335B839",0xD27E],
- ["8335B930",0xD27F],
- ["8335B931",0xD280],
- ["8335B932",0xD281],
- ["8335B933",0xD282],
- ["8335B934",0xD283],
- ["8335B935",0xD284],
- ["8335B936",0xD285],
- ["8335B937",0xD286],
- ["8335B938",0xD287],
- ["8335B939",0xD288],
- ["8335BA30",0xD289],
- ["8335BA31",0xD28A],
- ["8335BA32",0xD28B],
- ["8335BA33",0xD28C],
- ["8335BA34",0xD28D],
- ["8335BA35",0xD28E],
- ["8335BA36",0xD28F],
- ["8335BA37",0xD290],
- ["8335BA38",0xD291],
- ["8335BA39",0xD292],
- ["8335BB30",0xD293],
- ["8335BB31",0xD294],
- ["8335BB32",0xD295],
- ["8335BB33",0xD296],
- ["8335BB34",0xD297],
- ["8335BB35",0xD298],
- ["8335BB36",0xD299],
- ["8335BB37",0xD29A],
- ["8335BB38",0xD29B],
- ["8335BB39",0xD29C],
- ["8335BC30",0xD29D],
- ["8335BC31",0xD29E],
- ["8335BC32",0xD29F],
- ["8335BC33",0xD2A0],
- ["8335BC34",0xD2A1],
- ["8335BC35",0xD2A2],
- ["8335BC36",0xD2A3],
- ["8335BC37",0xD2A4],
- ["8335BC38",0xD2A5],
- ["8335BC39",0xD2A6],
- ["8335BD30",0xD2A7],
- ["8335BD31",0xD2A8],
- ["8335BD32",0xD2A9],
- ["8335BD33",0xD2AA],
- ["8335BD34",0xD2AB],
- ["8335BD35",0xD2AC],
- ["8335BD36",0xD2AD],
- ["8335BD37",0xD2AE],
- ["8335BD38",0xD2AF],
- ["8335BD39",0xD2B0],
- ["8335BE30",0xD2B1],
- ["8335BE31",0xD2B2],
- ["8335BE32",0xD2B3],
- ["8335BE33",0xD2B4],
- ["8335BE34",0xD2B5],
- ["8335BE35",0xD2B6],
- ["8335BE36",0xD2B7],
- ["8335BE37",0xD2B8],
- ["8335BE38",0xD2B9],
- ["8335BE39",0xD2BA],
- ["8335BF30",0xD2BB],
- ["8335BF31",0xD2BC],
- ["8335BF32",0xD2BD],
- ["8335BF33",0xD2BE],
- ["8335BF34",0xD2BF],
- ["8335BF35",0xD2C0],
- ["8335BF36",0xD2C1],
- ["8335BF37",0xD2C2],
- ["8335BF38",0xD2C3],
- ["8335BF39",0xD2C4],
- ["8335C030",0xD2C5],
- ["8335C031",0xD2C6],
- ["8335C032",0xD2C7],
- ["8335C033",0xD2C8],
- ["8335C034",0xD2C9],
- ["8335C035",0xD2CA],
- ["8335C036",0xD2CB],
- ["8335C037",0xD2CC],
- ["8335C038",0xD2CD],
- ["8335C039",0xD2CE],
- ["8335C130",0xD2CF],
- ["8335C131",0xD2D0],
- ["8335C132",0xD2D1],
- ["8335C133",0xD2D2],
- ["8335C134",0xD2D3],
- ["8335C135",0xD2D4],
- ["8335C136",0xD2D5],
- ["8335C137",0xD2D6],
- ["8335C138",0xD2D7],
- ["8335C139",0xD2D8],
- ["8335C230",0xD2D9],
- ["8335C231",0xD2DA],
- ["8335C232",0xD2DB],
- ["8335C233",0xD2DC],
- ["8335C234",0xD2DD],
- ["8335C235",0xD2DE],
- ["8335C236",0xD2DF],
- ["8335C237",0xD2E0],
- ["8335C238",0xD2E1],
- ["8335C239",0xD2E2],
- ["8335C330",0xD2E3],
- ["8335C331",0xD2E4],
- ["8335C332",0xD2E5],
- ["8335C333",0xD2E6],
- ["8335C334",0xD2E7],
- ["8335C335",0xD2E8],
- ["8335C336",0xD2E9],
- ["8335C337",0xD2EA],
- ["8335C338",0xD2EB],
- ["8335C339",0xD2EC],
- ["8335C430",0xD2ED],
- ["8335C431",0xD2EE],
- ["8335C432",0xD2EF],
- ["8335C433",0xD2F0],
- ["8335C434",0xD2F1],
- ["8335C435",0xD2F2],
- ["8335C436",0xD2F3],
- ["8335C437",0xD2F4],
- ["8335C438",0xD2F5],
- ["8335C439",0xD2F6],
- ["8335C530",0xD2F7],
- ["8335C531",0xD2F8],
- ["8335C532",0xD2F9],
- ["8335C533",0xD2FA],
- ["8335C534",0xD2FB],
- ["8335C535",0xD2FC],
- ["8335C536",0xD2FD],
- ["8335C537",0xD2FE],
- ["8335C538",0xD2FF],
- ["8335C539",0xD300],
- ["8335C630",0xD301],
- ["8335C631",0xD302],
- ["8335C632",0xD303],
- ["8335C633",0xD304],
- ["8335C634",0xD305],
- ["8335C635",0xD306],
- ["8335C636",0xD307],
- ["8335C637",0xD308],
- ["8335C638",0xD309],
- ["8335C639",0xD30A],
- ["8335C730",0xD30B],
- ["8335C731",0xD30C],
- ["8335C732",0xD30D],
- ["8335C733",0xD30E],
- ["8335C734",0xD30F],
- ["8335C735",0xD310],
- ["8335C736",0xD311],
- ["8335C737",0xD312],
- ["8335C738",0xD313],
- ["8335C739",0xD314],
- ["8335C830",0xD315],
- ["8335C831",0xD316],
- ["8335C832",0xD317],
- ["8335C833",0xD318],
- ["8335C834",0xD319],
- ["8335C835",0xD31A],
- ["8335C836",0xD31B],
- ["8335C837",0xD31C],
- ["8335C838",0xD31D],
- ["8335C839",0xD31E],
- ["8335C930",0xD31F],
- ["8335C931",0xD320],
- ["8335C932",0xD321],
- ["8335C933",0xD322],
- ["8335C934",0xD323],
- ["8335C935",0xD324],
- ["8335C936",0xD325],
- ["8335C937",0xD326],
- ["8335C938",0xD327],
- ["8335C939",0xD328],
- ["8335CA30",0xD329],
- ["8335CA31",0xD32A],
- ["8335CA32",0xD32B],
- ["8335CA33",0xD32C],
- ["8335CA34",0xD32D],
- ["8335CA35",0xD32E],
- ["8335CA36",0xD32F],
- ["8335CA37",0xD330],
- ["8335CA38",0xD331],
- ["8335CA39",0xD332],
- ["8335CB30",0xD333],
- ["8335CB31",0xD334],
- ["8335CB32",0xD335],
- ["8335CB33",0xD336],
- ["8335CB34",0xD337],
- ["8335CB35",0xD338],
- ["8335CB36",0xD339],
- ["8335CB37",0xD33A],
- ["8335CB38",0xD33B],
- ["8335CB39",0xD33C],
- ["8335CC30",0xD33D],
- ["8335CC31",0xD33E],
- ["8335CC32",0xD33F],
- ["8335CC33",0xD340],
- ["8335CC34",0xD341],
- ["8335CC35",0xD342],
- ["8335CC36",0xD343],
- ["8335CC37",0xD344],
- ["8335CC38",0xD345],
- ["8335CC39",0xD346],
- ["8335CD30",0xD347],
- ["8335CD31",0xD348],
- ["8335CD32",0xD349],
- ["8335CD33",0xD34A],
- ["8335CD34",0xD34B],
- ["8335CD35",0xD34C],
- ["8335CD36",0xD34D],
- ["8335CD37",0xD34E],
- ["8335CD38",0xD34F],
- ["8335CD39",0xD350],
- ["8335CE30",0xD351],
- ["8335CE31",0xD352],
- ["8335CE32",0xD353],
- ["8335CE33",0xD354],
- ["8335CE34",0xD355],
- ["8335CE35",0xD356],
- ["8335CE36",0xD357],
- ["8335CE37",0xD358],
- ["8335CE38",0xD359],
- ["8335CE39",0xD35A],
- ["8335CF30",0xD35B],
- ["8335CF31",0xD35C],
- ["8335CF32",0xD35D],
- ["8335CF33",0xD35E],
- ["8335CF34",0xD35F],
- ["8335CF35",0xD360],
- ["8335CF36",0xD361],
- ["8335CF37",0xD362],
- ["8335CF38",0xD363],
- ["8335CF39",0xD364],
- ["8335D030",0xD365],
- ["8335D031",0xD366],
- ["8335D032",0xD367],
- ["8335D033",0xD368],
- ["8335D034",0xD369],
- ["8335D035",0xD36A],
- ["8335D036",0xD36B],
- ["8335D037",0xD36C],
- ["8335D038",0xD36D],
- ["8335D039",0xD36E],
- ["8335D130",0xD36F],
- ["8335D131",0xD370],
- ["8335D132",0xD371],
- ["8335D133",0xD372],
- ["8335D134",0xD373],
- ["8335D135",0xD374],
- ["8335D136",0xD375],
- ["8335D137",0xD376],
- ["8335D138",0xD377],
- ["8335D139",0xD378],
- ["8335D230",0xD379],
- ["8335D231",0xD37A],
- ["8335D232",0xD37B],
- ["8335D233",0xD37C],
- ["8335D234",0xD37D],
- ["8335D235",0xD37E],
- ["8335D236",0xD37F],
- ["8335D237",0xD380],
- ["8335D238",0xD381],
- ["8335D239",0xD382],
- ["8335D330",0xD383],
- ["8335D331",0xD384],
- ["8335D332",0xD385],
- ["8335D333",0xD386],
- ["8335D334",0xD387],
- ["8335D335",0xD388],
- ["8335D336",0xD389],
- ["8335D337",0xD38A],
- ["8335D338",0xD38B],
- ["8335D339",0xD38C],
- ["8335D430",0xD38D],
- ["8335D431",0xD38E],
- ["8335D432",0xD38F],
- ["8335D433",0xD390],
- ["8335D434",0xD391],
- ["8335D435",0xD392],
- ["8335D436",0xD393],
- ["8335D437",0xD394],
- ["8335D438",0xD395],
- ["8335D439",0xD396],
- ["8335D530",0xD397],
- ["8335D531",0xD398],
- ["8335D532",0xD399],
- ["8335D533",0xD39A],
- ["8335D534",0xD39B],
- ["8335D535",0xD39C],
- ["8335D536",0xD39D],
- ["8335D537",0xD39E],
- ["8335D538",0xD39F],
- ["8335D539",0xD3A0],
- ["8335D630",0xD3A1],
- ["8335D631",0xD3A2],
- ["8335D632",0xD3A3],
- ["8335D633",0xD3A4],
- ["8335D634",0xD3A5],
- ["8335D635",0xD3A6],
- ["8335D636",0xD3A7],
- ["8335D637",0xD3A8],
- ["8335D638",0xD3A9],
- ["8335D639",0xD3AA],
- ["8335D730",0xD3AB],
- ["8335D731",0xD3AC],
- ["8335D732",0xD3AD],
- ["8335D733",0xD3AE],
- ["8335D734",0xD3AF],
- ["8335D735",0xD3B0],
- ["8335D736",0xD3B1],
- ["8335D737",0xD3B2],
- ["8335D738",0xD3B3],
- ["8335D739",0xD3B4],
- ["8335D830",0xD3B5],
- ["8335D831",0xD3B6],
- ["8335D832",0xD3B7],
- ["8335D833",0xD3B8],
- ["8335D834",0xD3B9],
- ["8335D835",0xD3BA],
- ["8335D836",0xD3BB],
- ["8335D837",0xD3BC],
- ["8335D838",0xD3BD],
- ["8335D839",0xD3BE],
- ["8335D930",0xD3BF],
- ["8335D931",0xD3C0],
- ["8335D932",0xD3C1],
- ["8335D933",0xD3C2],
- ["8335D934",0xD3C3],
- ["8335D935",0xD3C4],
- ["8335D936",0xD3C5],
- ["8335D937",0xD3C6],
- ["8335D938",0xD3C7],
- ["8335D939",0xD3C8],
- ["8335DA30",0xD3C9],
- ["8335DA31",0xD3CA],
- ["8335DA32",0xD3CB],
- ["8335DA33",0xD3CC],
- ["8335DA34",0xD3CD],
- ["8335DA35",0xD3CE],
- ["8335DA36",0xD3CF],
- ["8335DA37",0xD3D0],
- ["8335DA38",0xD3D1],
- ["8335DA39",0xD3D2],
- ["8335DB30",0xD3D3],
- ["8335DB31",0xD3D4],
- ["8335DB32",0xD3D5],
- ["8335DB33",0xD3D6],
- ["8335DB34",0xD3D7],
- ["8335DB35",0xD3D8],
- ["8335DB36",0xD3D9],
- ["8335DB37",0xD3DA],
- ["8335DB38",0xD3DB],
- ["8335DB39",0xD3DC],
- ["8335DC30",0xD3DD],
- ["8335DC31",0xD3DE],
- ["8335DC32",0xD3DF],
- ["8335DC33",0xD3E0],
- ["8335DC34",0xD3E1],
- ["8335DC35",0xD3E2],
- ["8335DC36",0xD3E3],
- ["8335DC37",0xD3E4],
- ["8335DC38",0xD3E5],
- ["8335DC39",0xD3E6],
- ["8335DD30",0xD3E7],
- ["8335DD31",0xD3E8],
- ["8335DD32",0xD3E9],
- ["8335DD33",0xD3EA],
- ["8335DD34",0xD3EB],
- ["8335DD35",0xD3EC],
- ["8335DD36",0xD3ED],
- ["8335DD37",0xD3EE],
- ["8335DD38",0xD3EF],
- ["8335DD39",0xD3F0],
- ["8335DE30",0xD3F1],
- ["8335DE31",0xD3F2],
- ["8335DE32",0xD3F3],
- ["8335DE33",0xD3F4],
- ["8335DE34",0xD3F5],
- ["8335DE35",0xD3F6],
- ["8335DE36",0xD3F7],
- ["8335DE37",0xD3F8],
- ["8335DE38",0xD3F9],
- ["8335DE39",0xD3FA],
- ["8335DF30",0xD3FB],
- ["8335DF31",0xD3FC],
- ["8335DF32",0xD3FD],
- ["8335DF33",0xD3FE],
- ["8335DF34",0xD3FF],
- ["8335DF35",0xD400],
- ["8335DF36",0xD401],
- ["8335DF37",0xD402],
- ["8335DF38",0xD403],
- ["8335DF39",0xD404],
- ["8335E030",0xD405],
- ["8335E031",0xD406],
- ["8335E032",0xD407],
- ["8335E033",0xD408],
- ["8335E034",0xD409],
- ["8335E035",0xD40A],
- ["8335E036",0xD40B],
- ["8335E037",0xD40C],
- ["8335E038",0xD40D],
- ["8335E039",0xD40E],
- ["8335E130",0xD40F],
- ["8335E131",0xD410],
- ["8335E132",0xD411],
- ["8335E133",0xD412],
- ["8335E134",0xD413],
- ["8335E135",0xD414],
- ["8335E136",0xD415],
- ["8335E137",0xD416],
- ["8335E138",0xD417],
- ["8335E139",0xD418],
- ["8335E230",0xD419],
- ["8335E231",0xD41A],
- ["8335E232",0xD41B],
- ["8335E233",0xD41C],
- ["8335E234",0xD41D],
- ["8335E235",0xD41E],
- ["8335E236",0xD41F],
- ["8335E237",0xD420],
- ["8335E238",0xD421],
- ["8335E239",0xD422],
- ["8335E330",0xD423],
- ["8335E331",0xD424],
- ["8335E332",0xD425],
- ["8335E333",0xD426],
- ["8335E334",0xD427],
- ["8335E335",0xD428],
- ["8335E336",0xD429],
- ["8335E337",0xD42A],
- ["8335E338",0xD42B],
- ["8335E339",0xD42C],
- ["8335E430",0xD42D],
- ["8335E431",0xD42E],
- ["8335E432",0xD42F],
- ["8335E433",0xD430],
- ["8335E434",0xD431],
- ["8335E435",0xD432],
- ["8335E436",0xD433],
- ["8335E437",0xD434],
- ["8335E438",0xD435],
- ["8335E439",0xD436],
- ["8335E530",0xD437],
- ["8335E531",0xD438],
- ["8335E532",0xD439],
- ["8335E533",0xD43A],
- ["8335E534",0xD43B],
- ["8335E535",0xD43C],
- ["8335E536",0xD43D],
- ["8335E537",0xD43E],
- ["8335E538",0xD43F],
- ["8335E539",0xD440],
- ["8335E630",0xD441],
- ["8335E631",0xD442],
- ["8335E632",0xD443],
- ["8335E633",0xD444],
- ["8335E634",0xD445],
- ["8335E635",0xD446],
- ["8335E636",0xD447],
- ["8335E637",0xD448],
- ["8335E638",0xD449],
- ["8335E639",0xD44A],
- ["8335E730",0xD44B],
- ["8335E731",0xD44C],
- ["8335E732",0xD44D],
- ["8335E733",0xD44E],
- ["8335E734",0xD44F],
- ["8335E735",0xD450],
- ["8335E736",0xD451],
- ["8335E737",0xD452],
- ["8335E738",0xD453],
- ["8335E739",0xD454],
- ["8335E830",0xD455],
- ["8335E831",0xD456],
- ["8335E832",0xD457],
- ["8335E833",0xD458],
- ["8335E834",0xD459],
- ["8335E835",0xD45A],
- ["8335E836",0xD45B],
- ["8335E837",0xD45C],
- ["8335E838",0xD45D],
- ["8335E839",0xD45E],
- ["8335E930",0xD45F],
- ["8335E931",0xD460],
- ["8335E932",0xD461],
- ["8335E933",0xD462],
- ["8335E934",0xD463],
- ["8335E935",0xD464],
- ["8335E936",0xD465],
- ["8335E937",0xD466],
- ["8335E938",0xD467],
- ["8335E939",0xD468],
- ["8335EA30",0xD469],
- ["8335EA31",0xD46A],
- ["8335EA32",0xD46B],
- ["8335EA33",0xD46C],
- ["8335EA34",0xD46D],
- ["8335EA35",0xD46E],
- ["8335EA36",0xD46F],
- ["8335EA37",0xD470],
- ["8335EA38",0xD471],
- ["8335EA39",0xD472],
- ["8335EB30",0xD473],
- ["8335EB31",0xD474],
- ["8335EB32",0xD475],
- ["8335EB33",0xD476],
- ["8335EB34",0xD477],
- ["8335EB35",0xD478],
- ["8335EB36",0xD479],
- ["8335EB37",0xD47A],
- ["8335EB38",0xD47B],
- ["8335EB39",0xD47C],
- ["8335EC30",0xD47D],
- ["8335EC31",0xD47E],
- ["8335EC32",0xD47F],
- ["8335EC33",0xD480],
- ["8335EC34",0xD481],
- ["8335EC35",0xD482],
- ["8335EC36",0xD483],
- ["8335EC37",0xD484],
- ["8335EC38",0xD485],
- ["8335EC39",0xD486],
- ["8335ED30",0xD487],
- ["8335ED31",0xD488],
- ["8335ED32",0xD489],
- ["8335ED33",0xD48A],
- ["8335ED34",0xD48B],
- ["8335ED35",0xD48C],
- ["8335ED36",0xD48D],
- ["8335ED37",0xD48E],
- ["8335ED38",0xD48F],
- ["8335ED39",0xD490],
- ["8335EE30",0xD491],
- ["8335EE31",0xD492],
- ["8335EE32",0xD493],
- ["8335EE33",0xD494],
- ["8335EE34",0xD495],
- ["8335EE35",0xD496],
- ["8335EE36",0xD497],
- ["8335EE37",0xD498],
- ["8335EE38",0xD499],
- ["8335EE39",0xD49A],
- ["8335EF30",0xD49B],
- ["8335EF31",0xD49C],
- ["8335EF32",0xD49D],
- ["8335EF33",0xD49E],
- ["8335EF34",0xD49F],
- ["8335EF35",0xD4A0],
- ["8335EF36",0xD4A1],
- ["8335EF37",0xD4A2],
- ["8335EF38",0xD4A3],
- ["8335EF39",0xD4A4],
- ["8335F030",0xD4A5],
- ["8335F031",0xD4A6],
- ["8335F032",0xD4A7],
- ["8335F033",0xD4A8],
- ["8335F034",0xD4A9],
- ["8335F035",0xD4AA],
- ["8335F036",0xD4AB],
- ["8335F037",0xD4AC],
- ["8335F038",0xD4AD],
- ["8335F039",0xD4AE],
- ["8335F130",0xD4AF],
- ["8335F131",0xD4B0],
- ["8335F132",0xD4B1],
- ["8335F133",0xD4B2],
- ["8335F134",0xD4B3],
- ["8335F135",0xD4B4],
- ["8335F136",0xD4B5],
- ["8335F137",0xD4B6],
- ["8335F138",0xD4B7],
- ["8335F139",0xD4B8],
- ["8335F230",0xD4B9],
- ["8335F231",0xD4BA],
- ["8335F232",0xD4BB],
- ["8335F233",0xD4BC],
- ["8335F234",0xD4BD],
- ["8335F235",0xD4BE],
- ["8335F236",0xD4BF],
- ["8335F237",0xD4C0],
- ["8335F238",0xD4C1],
- ["8335F239",0xD4C2],
- ["8335F330",0xD4C3],
- ["8335F331",0xD4C4],
- ["8335F332",0xD4C5],
- ["8335F333",0xD4C6],
- ["8335F334",0xD4C7],
- ["8335F335",0xD4C8],
- ["8335F336",0xD4C9],
- ["8335F337",0xD4CA],
- ["8335F338",0xD4CB],
- ["8335F339",0xD4CC],
- ["8335F430",0xD4CD],
- ["8335F431",0xD4CE],
- ["8335F432",0xD4CF],
- ["8335F433",0xD4D0],
- ["8335F434",0xD4D1],
- ["8335F435",0xD4D2],
- ["8335F436",0xD4D3],
- ["8335F437",0xD4D4],
- ["8335F438",0xD4D5],
- ["8335F439",0xD4D6],
- ["8335F530",0xD4D7],
- ["8335F531",0xD4D8],
- ["8335F532",0xD4D9],
- ["8335F533",0xD4DA],
- ["8335F534",0xD4DB],
- ["8335F535",0xD4DC],
- ["8335F536",0xD4DD],
- ["8335F537",0xD4DE],
- ["8335F538",0xD4DF],
- ["8335F539",0xD4E0],
- ["8335F630",0xD4E1],
- ["8335F631",0xD4E2],
- ["8335F632",0xD4E3],
- ["8335F633",0xD4E4],
- ["8335F634",0xD4E5],
- ["8335F635",0xD4E6],
- ["8335F636",0xD4E7],
- ["8335F637",0xD4E8],
- ["8335F638",0xD4E9],
- ["8335F639",0xD4EA],
- ["8335F730",0xD4EB],
- ["8335F731",0xD4EC],
- ["8335F732",0xD4ED],
- ["8335F733",0xD4EE],
- ["8335F734",0xD4EF],
- ["8335F735",0xD4F0],
- ["8335F736",0xD4F1],
- ["8335F737",0xD4F2],
- ["8335F738",0xD4F3],
- ["8335F739",0xD4F4],
- ["8335F830",0xD4F5],
- ["8335F831",0xD4F6],
- ["8335F832",0xD4F7],
- ["8335F833",0xD4F8],
- ["8335F834",0xD4F9],
- ["8335F835",0xD4FA],
- ["8335F836",0xD4FB],
- ["8335F837",0xD4FC],
- ["8335F838",0xD4FD],
- ["8335F839",0xD4FE],
- ["8335F930",0xD4FF],
- ["8335F931",0xD500],
- ["8335F932",0xD501],
- ["8335F933",0xD502],
- ["8335F934",0xD503],
- ["8335F935",0xD504],
- ["8335F936",0xD505],
- ["8335F937",0xD506],
- ["8335F938",0xD507],
- ["8335F939",0xD508],
- ["8335FA30",0xD509],
- ["8335FA31",0xD50A],
- ["8335FA32",0xD50B],
- ["8335FA33",0xD50C],
- ["8335FA34",0xD50D],
- ["8335FA35",0xD50E],
- ["8335FA36",0xD50F],
- ["8335FA37",0xD510],
- ["8335FA38",0xD511],
- ["8335FA39",0xD512],
- ["8335FB30",0xD513],
- ["8335FB31",0xD514],
- ["8335FB32",0xD515],
- ["8335FB33",0xD516],
- ["8335FB34",0xD517],
- ["8335FB35",0xD518],
- ["8335FB36",0xD519],
- ["8335FB37",0xD51A],
- ["8335FB38",0xD51B],
- ["8335FB39",0xD51C],
- ["8335FC30",0xD51D],
- ["8335FC31",0xD51E],
- ["8335FC32",0xD51F],
- ["8335FC33",0xD520],
- ["8335FC34",0xD521],
- ["8335FC35",0xD522],
- ["8335FC36",0xD523],
- ["8335FC37",0xD524],
- ["8335FC38",0xD525],
- ["8335FC39",0xD526],
- ["8335FD30",0xD527],
- ["8335FD31",0xD528],
- ["8335FD32",0xD529],
- ["8335FD33",0xD52A],
- ["8335FD34",0xD52B],
- ["8335FD35",0xD52C],
- ["8335FD36",0xD52D],
- ["8335FD37",0xD52E],
- ["8335FD38",0xD52F],
- ["8335FD39",0xD530],
- ["8335FE30",0xD531],
- ["8335FE31",0xD532],
- ["8335FE32",0xD533],
- ["8335FE33",0xD534],
- ["8335FE34",0xD535],
- ["8335FE35",0xD536],
- ["8335FE36",0xD537],
- ["8335FE37",0xD538],
- ["8335FE38",0xD539],
- ["8335FE39",0xD53A],
- ["83368130",0xD53B],
- ["83368131",0xD53C],
- ["83368132",0xD53D],
- ["83368133",0xD53E],
- ["83368134",0xD53F],
- ["83368135",0xD540],
- ["83368136",0xD541],
- ["83368137",0xD542],
- ["83368138",0xD543],
- ["83368139",0xD544],
- ["83368230",0xD545],
- ["83368231",0xD546],
- ["83368232",0xD547],
- ["83368233",0xD548],
- ["83368234",0xD549],
- ["83368235",0xD54A],
- ["83368236",0xD54B],
- ["83368237",0xD54C],
- ["83368238",0xD54D],
- ["83368239",0xD54E],
- ["83368330",0xD54F],
- ["83368331",0xD550],
- ["83368332",0xD551],
- ["83368333",0xD552],
- ["83368334",0xD553],
- ["83368335",0xD554],
- ["83368336",0xD555],
- ["83368337",0xD556],
- ["83368338",0xD557],
- ["83368339",0xD558],
- ["83368430",0xD559],
- ["83368431",0xD55A],
- ["83368432",0xD55B],
- ["83368433",0xD55C],
- ["83368434",0xD55D],
- ["83368435",0xD55E],
- ["83368436",0xD55F],
- ["83368437",0xD560],
- ["83368438",0xD561],
- ["83368439",0xD562],
- ["83368530",0xD563],
- ["83368531",0xD564],
- ["83368532",0xD565],
- ["83368533",0xD566],
- ["83368534",0xD567],
- ["83368535",0xD568],
- ["83368536",0xD569],
- ["83368537",0xD56A],
- ["83368538",0xD56B],
- ["83368539",0xD56C],
- ["83368630",0xD56D],
- ["83368631",0xD56E],
- ["83368632",0xD56F],
- ["83368633",0xD570],
- ["83368634",0xD571],
- ["83368635",0xD572],
- ["83368636",0xD573],
- ["83368637",0xD574],
- ["83368638",0xD575],
- ["83368639",0xD576],
- ["83368730",0xD577],
- ["83368731",0xD578],
- ["83368732",0xD579],
- ["83368733",0xD57A],
- ["83368734",0xD57B],
- ["83368735",0xD57C],
- ["83368736",0xD57D],
- ["83368737",0xD57E],
- ["83368738",0xD57F],
- ["83368739",0xD580],
- ["83368830",0xD581],
- ["83368831",0xD582],
- ["83368832",0xD583],
- ["83368833",0xD584],
- ["83368834",0xD585],
- ["83368835",0xD586],
- ["83368836",0xD587],
- ["83368837",0xD588],
- ["83368838",0xD589],
- ["83368839",0xD58A],
- ["83368930",0xD58B],
- ["83368931",0xD58C],
- ["83368932",0xD58D],
- ["83368933",0xD58E],
- ["83368934",0xD58F],
- ["83368935",0xD590],
- ["83368936",0xD591],
- ["83368937",0xD592],
- ["83368938",0xD593],
- ["83368939",0xD594],
- ["83368A30",0xD595],
- ["83368A31",0xD596],
- ["83368A32",0xD597],
- ["83368A33",0xD598],
- ["83368A34",0xD599],
- ["83368A35",0xD59A],
- ["83368A36",0xD59B],
- ["83368A37",0xD59C],
- ["83368A38",0xD59D],
- ["83368A39",0xD59E],
- ["83368B30",0xD59F],
- ["83368B31",0xD5A0],
- ["83368B32",0xD5A1],
- ["83368B33",0xD5A2],
- ["83368B34",0xD5A3],
- ["83368B35",0xD5A4],
- ["83368B36",0xD5A5],
- ["83368B37",0xD5A6],
- ["83368B38",0xD5A7],
- ["83368B39",0xD5A8],
- ["83368C30",0xD5A9],
- ["83368C31",0xD5AA],
- ["83368C32",0xD5AB],
- ["83368C33",0xD5AC],
- ["83368C34",0xD5AD],
- ["83368C35",0xD5AE],
- ["83368C36",0xD5AF],
- ["83368C37",0xD5B0],
- ["83368C38",0xD5B1],
- ["83368C39",0xD5B2],
- ["83368D30",0xD5B3],
- ["83368D31",0xD5B4],
- ["83368D32",0xD5B5],
- ["83368D33",0xD5B6],
- ["83368D34",0xD5B7],
- ["83368D35",0xD5B8],
- ["83368D36",0xD5B9],
- ["83368D37",0xD5BA],
- ["83368D38",0xD5BB],
- ["83368D39",0xD5BC],
- ["83368E30",0xD5BD],
- ["83368E31",0xD5BE],
- ["83368E32",0xD5BF],
- ["83368E33",0xD5C0],
- ["83368E34",0xD5C1],
- ["83368E35",0xD5C2],
- ["83368E36",0xD5C3],
- ["83368E37",0xD5C4],
- ["83368E38",0xD5C5],
- ["83368E39",0xD5C6],
- ["83368F30",0xD5C7],
- ["83368F31",0xD5C8],
- ["83368F32",0xD5C9],
- ["83368F33",0xD5CA],
- ["83368F34",0xD5CB],
- ["83368F35",0xD5CC],
- ["83368F36",0xD5CD],
- ["83368F37",0xD5CE],
- ["83368F38",0xD5CF],
- ["83368F39",0xD5D0],
- ["83369030",0xD5D1],
- ["83369031",0xD5D2],
- ["83369032",0xD5D3],
- ["83369033",0xD5D4],
- ["83369034",0xD5D5],
- ["83369035",0xD5D6],
- ["83369036",0xD5D7],
- ["83369037",0xD5D8],
- ["83369038",0xD5D9],
- ["83369039",0xD5DA],
- ["83369130",0xD5DB],
- ["83369131",0xD5DC],
- ["83369132",0xD5DD],
- ["83369133",0xD5DE],
- ["83369134",0xD5DF],
- ["83369135",0xD5E0],
- ["83369136",0xD5E1],
- ["83369137",0xD5E2],
- ["83369138",0xD5E3],
- ["83369139",0xD5E4],
- ["83369230",0xD5E5],
- ["83369231",0xD5E6],
- ["83369232",0xD5E7],
- ["83369233",0xD5E8],
- ["83369234",0xD5E9],
- ["83369235",0xD5EA],
- ["83369236",0xD5EB],
- ["83369237",0xD5EC],
- ["83369238",0xD5ED],
- ["83369239",0xD5EE],
- ["83369330",0xD5EF],
- ["83369331",0xD5F0],
- ["83369332",0xD5F1],
- ["83369333",0xD5F2],
- ["83369334",0xD5F3],
- ["83369335",0xD5F4],
- ["83369336",0xD5F5],
- ["83369337",0xD5F6],
- ["83369338",0xD5F7],
- ["83369339",0xD5F8],
- ["83369430",0xD5F9],
- ["83369431",0xD5FA],
- ["83369432",0xD5FB],
- ["83369433",0xD5FC],
- ["83369434",0xD5FD],
- ["83369435",0xD5FE],
- ["83369436",0xD5FF],
- ["83369437",0xD600],
- ["83369438",0xD601],
- ["83369439",0xD602],
- ["83369530",0xD603],
- ["83369531",0xD604],
- ["83369532",0xD605],
- ["83369533",0xD606],
- ["83369534",0xD607],
- ["83369535",0xD608],
- ["83369536",0xD609],
- ["83369537",0xD60A],
- ["83369538",0xD60B],
- ["83369539",0xD60C],
- ["83369630",0xD60D],
- ["83369631",0xD60E],
- ["83369632",0xD60F],
- ["83369633",0xD610],
- ["83369634",0xD611],
- ["83369635",0xD612],
- ["83369636",0xD613],
- ["83369637",0xD614],
- ["83369638",0xD615],
- ["83369639",0xD616],
- ["83369730",0xD617],
- ["83369731",0xD618],
- ["83369732",0xD619],
- ["83369733",0xD61A],
- ["83369734",0xD61B],
- ["83369735",0xD61C],
- ["83369736",0xD61D],
- ["83369737",0xD61E],
- ["83369738",0xD61F],
- ["83369739",0xD620],
- ["83369830",0xD621],
- ["83369831",0xD622],
- ["83369832",0xD623],
- ["83369833",0xD624],
- ["83369834",0xD625],
- ["83369835",0xD626],
- ["83369836",0xD627],
- ["83369837",0xD628],
- ["83369838",0xD629],
- ["83369839",0xD62A],
- ["83369930",0xD62B],
- ["83369931",0xD62C],
- ["83369932",0xD62D],
- ["83369933",0xD62E],
- ["83369934",0xD62F],
- ["83369935",0xD630],
- ["83369936",0xD631],
- ["83369937",0xD632],
- ["83369938",0xD633],
- ["83369939",0xD634],
- ["83369A30",0xD635],
- ["83369A31",0xD636],
- ["83369A32",0xD637],
- ["83369A33",0xD638],
- ["83369A34",0xD639],
- ["83369A35",0xD63A],
- ["83369A36",0xD63B],
- ["83369A37",0xD63C],
- ["83369A38",0xD63D],
- ["83369A39",0xD63E],
- ["83369B30",0xD63F],
- ["83369B31",0xD640],
- ["83369B32",0xD641],
- ["83369B33",0xD642],
- ["83369B34",0xD643],
- ["83369B35",0xD644],
- ["83369B36",0xD645],
- ["83369B37",0xD646],
- ["83369B38",0xD647],
- ["83369B39",0xD648],
- ["83369C30",0xD649],
- ["83369C31",0xD64A],
- ["83369C32",0xD64B],
- ["83369C33",0xD64C],
- ["83369C34",0xD64D],
- ["83369C35",0xD64E],
- ["83369C36",0xD64F],
- ["83369C37",0xD650],
- ["83369C38",0xD651],
- ["83369C39",0xD652],
- ["83369D30",0xD653],
- ["83369D31",0xD654],
- ["83369D32",0xD655],
- ["83369D33",0xD656],
- ["83369D34",0xD657],
- ["83369D35",0xD658],
- ["83369D36",0xD659],
- ["83369D37",0xD65A],
- ["83369D38",0xD65B],
- ["83369D39",0xD65C],
- ["83369E30",0xD65D],
- ["83369E31",0xD65E],
- ["83369E32",0xD65F],
- ["83369E33",0xD660],
- ["83369E34",0xD661],
- ["83369E35",0xD662],
- ["83369E36",0xD663],
- ["83369E37",0xD664],
- ["83369E38",0xD665],
- ["83369E39",0xD666],
- ["83369F30",0xD667],
- ["83369F31",0xD668],
- ["83369F32",0xD669],
- ["83369F33",0xD66A],
- ["83369F34",0xD66B],
- ["83369F35",0xD66C],
- ["83369F36",0xD66D],
- ["83369F37",0xD66E],
- ["83369F38",0xD66F],
- ["83369F39",0xD670],
- ["8336A030",0xD671],
- ["8336A031",0xD672],
- ["8336A032",0xD673],
- ["8336A033",0xD674],
- ["8336A034",0xD675],
- ["8336A035",0xD676],
- ["8336A036",0xD677],
- ["8336A037",0xD678],
- ["8336A038",0xD679],
- ["8336A039",0xD67A],
- ["8336A130",0xD67B],
- ["8336A131",0xD67C],
- ["8336A132",0xD67D],
- ["8336A133",0xD67E],
- ["8336A134",0xD67F],
- ["8336A135",0xD680],
- ["8336A136",0xD681],
- ["8336A137",0xD682],
- ["8336A138",0xD683],
- ["8336A139",0xD684],
- ["8336A230",0xD685],
- ["8336A231",0xD686],
- ["8336A232",0xD687],
- ["8336A233",0xD688],
- ["8336A234",0xD689],
- ["8336A235",0xD68A],
- ["8336A236",0xD68B],
- ["8336A237",0xD68C],
- ["8336A238",0xD68D],
- ["8336A239",0xD68E],
- ["8336A330",0xD68F],
- ["8336A331",0xD690],
- ["8336A332",0xD691],
- ["8336A333",0xD692],
- ["8336A334",0xD693],
- ["8336A335",0xD694],
- ["8336A336",0xD695],
- ["8336A337",0xD696],
- ["8336A338",0xD697],
- ["8336A339",0xD698],
- ["8336A430",0xD699],
- ["8336A431",0xD69A],
- ["8336A432",0xD69B],
- ["8336A433",0xD69C],
- ["8336A434",0xD69D],
- ["8336A435",0xD69E],
- ["8336A436",0xD69F],
- ["8336A437",0xD6A0],
- ["8336A438",0xD6A1],
- ["8336A439",0xD6A2],
- ["8336A530",0xD6A3],
- ["8336A531",0xD6A4],
- ["8336A532",0xD6A5],
- ["8336A533",0xD6A6],
- ["8336A534",0xD6A7],
- ["8336A535",0xD6A8],
- ["8336A536",0xD6A9],
- ["8336A537",0xD6AA],
- ["8336A538",0xD6AB],
- ["8336A539",0xD6AC],
- ["8336A630",0xD6AD],
- ["8336A631",0xD6AE],
- ["8336A632",0xD6AF],
- ["8336A633",0xD6B0],
- ["8336A634",0xD6B1],
- ["8336A635",0xD6B2],
- ["8336A636",0xD6B3],
- ["8336A637",0xD6B4],
- ["8336A638",0xD6B5],
- ["8336A639",0xD6B6],
- ["8336A730",0xD6B7],
- ["8336A731",0xD6B8],
- ["8336A732",0xD6B9],
- ["8336A733",0xD6BA],
- ["8336A734",0xD6BB],
- ["8336A735",0xD6BC],
- ["8336A736",0xD6BD],
- ["8336A737",0xD6BE],
- ["8336A738",0xD6BF],
- ["8336A739",0xD6C0],
- ["8336A830",0xD6C1],
- ["8336A831",0xD6C2],
- ["8336A832",0xD6C3],
- ["8336A833",0xD6C4],
- ["8336A834",0xD6C5],
- ["8336A835",0xD6C6],
- ["8336A836",0xD6C7],
- ["8336A837",0xD6C8],
- ["8336A838",0xD6C9],
- ["8336A839",0xD6CA],
- ["8336A930",0xD6CB],
- ["8336A931",0xD6CC],
- ["8336A932",0xD6CD],
- ["8336A933",0xD6CE],
- ["8336A934",0xD6CF],
- ["8336A935",0xD6D0],
- ["8336A936",0xD6D1],
- ["8336A937",0xD6D2],
- ["8336A938",0xD6D3],
- ["8336A939",0xD6D4],
- ["8336AA30",0xD6D5],
- ["8336AA31",0xD6D6],
- ["8336AA32",0xD6D7],
- ["8336AA33",0xD6D8],
- ["8336AA34",0xD6D9],
- ["8336AA35",0xD6DA],
- ["8336AA36",0xD6DB],
- ["8336AA37",0xD6DC],
- ["8336AA38",0xD6DD],
- ["8336AA39",0xD6DE],
- ["8336AB30",0xD6DF],
- ["8336AB31",0xD6E0],
- ["8336AB32",0xD6E1],
- ["8336AB33",0xD6E2],
- ["8336AB34",0xD6E3],
- ["8336AB35",0xD6E4],
- ["8336AB36",0xD6E5],
- ["8336AB37",0xD6E6],
- ["8336AB38",0xD6E7],
- ["8336AB39",0xD6E8],
- ["8336AC30",0xD6E9],
- ["8336AC31",0xD6EA],
- ["8336AC32",0xD6EB],
- ["8336AC33",0xD6EC],
- ["8336AC34",0xD6ED],
- ["8336AC35",0xD6EE],
- ["8336AC36",0xD6EF],
- ["8336AC37",0xD6F0],
- ["8336AC38",0xD6F1],
- ["8336AC39",0xD6F2],
- ["8336AD30",0xD6F3],
- ["8336AD31",0xD6F4],
- ["8336AD32",0xD6F5],
- ["8336AD33",0xD6F6],
- ["8336AD34",0xD6F7],
- ["8336AD35",0xD6F8],
- ["8336AD36",0xD6F9],
- ["8336AD37",0xD6FA],
- ["8336AD38",0xD6FB],
- ["8336AD39",0xD6FC],
- ["8336AE30",0xD6FD],
- ["8336AE31",0xD6FE],
- ["8336AE32",0xD6FF],
- ["8336AE33",0xD700],
- ["8336AE34",0xD701],
- ["8336AE35",0xD702],
- ["8336AE36",0xD703],
- ["8336AE37",0xD704],
- ["8336AE38",0xD705],
- ["8336AE39",0xD706],
- ["8336AF30",0xD707],
- ["8336AF31",0xD708],
- ["8336AF32",0xD709],
- ["8336AF33",0xD70A],
- ["8336AF34",0xD70B],
- ["8336AF35",0xD70C],
- ["8336AF36",0xD70D],
- ["8336AF37",0xD70E],
- ["8336AF38",0xD70F],
- ["8336AF39",0xD710],
- ["8336B030",0xD711],
- ["8336B031",0xD712],
- ["8336B032",0xD713],
- ["8336B033",0xD714],
- ["8336B034",0xD715],
- ["8336B035",0xD716],
- ["8336B036",0xD717],
- ["8336B037",0xD718],
- ["8336B038",0xD719],
- ["8336B039",0xD71A],
- ["8336B130",0xD71B],
- ["8336B131",0xD71C],
- ["8336B132",0xD71D],
- ["8336B133",0xD71E],
- ["8336B134",0xD71F],
- ["8336B135",0xD720],
- ["8336B136",0xD721],
- ["8336B137",0xD722],
- ["8336B138",0xD723],
- ["8336B139",0xD724],
- ["8336B230",0xD725],
- ["8336B231",0xD726],
- ["8336B232",0xD727],
- ["8336B233",0xD728],
- ["8336B234",0xD729],
- ["8336B235",0xD72A],
- ["8336B236",0xD72B],
- ["8336B237",0xD72C],
- ["8336B238",0xD72D],
- ["8336B239",0xD72E],
- ["8336B330",0xD72F],
- ["8336B331",0xD730],
- ["8336B332",0xD731],
- ["8336B333",0xD732],
- ["8336B334",0xD733],
- ["8336B335",0xD734],
- ["8336B336",0xD735],
- ["8336B337",0xD736],
- ["8336B338",0xD737],
- ["8336B339",0xD738],
- ["8336B430",0xD739],
- ["8336B431",0xD73A],
- ["8336B432",0xD73B],
- ["8336B433",0xD73C],
- ["8336B434",0xD73D],
- ["8336B435",0xD73E],
- ["8336B436",0xD73F],
- ["8336B437",0xD740],
- ["8336B438",0xD741],
- ["8336B439",0xD742],
- ["8336B530",0xD743],
- ["8336B531",0xD744],
- ["8336B532",0xD745],
- ["8336B533",0xD746],
- ["8336B534",0xD747],
- ["8336B535",0xD748],
- ["8336B536",0xD749],
- ["8336B537",0xD74A],
- ["8336B538",0xD74B],
- ["8336B539",0xD74C],
- ["8336B630",0xD74D],
- ["8336B631",0xD74E],
- ["8336B632",0xD74F],
- ["8336B633",0xD750],
- ["8336B634",0xD751],
- ["8336B635",0xD752],
- ["8336B636",0xD753],
- ["8336B637",0xD754],
- ["8336B638",0xD755],
- ["8336B639",0xD756],
- ["8336B730",0xD757],
- ["8336B731",0xD758],
- ["8336B732",0xD759],
- ["8336B733",0xD75A],
- ["8336B734",0xD75B],
- ["8336B735",0xD75C],
- ["8336B736",0xD75D],
- ["8336B737",0xD75E],
- ["8336B738",0xD75F],
- ["8336B739",0xD760],
- ["8336B830",0xD761],
- ["8336B831",0xD762],
- ["8336B832",0xD763],
- ["8336B833",0xD764],
- ["8336B834",0xD765],
- ["8336B835",0xD766],
- ["8336B836",0xD767],
- ["8336B837",0xD768],
- ["8336B838",0xD769],
- ["8336B839",0xD76A],
- ["8336B930",0xD76B],
- ["8336B931",0xD76C],
- ["8336B932",0xD76D],
- ["8336B933",0xD76E],
- ["8336B934",0xD76F],
- ["8336B935",0xD770],
- ["8336B936",0xD771],
- ["8336B937",0xD772],
- ["8336B938",0xD773],
- ["8336B939",0xD774],
- ["8336BA30",0xD775],
- ["8336BA31",0xD776],
- ["8336BA32",0xD777],
- ["8336BA33",0xD778],
- ["8336BA34",0xD779],
- ["8336BA35",0xD77A],
- ["8336BA36",0xD77B],
- ["8336BA37",0xD77C],
- ["8336BA38",0xD77D],
- ["8336BA39",0xD77E],
- ["8336BB30",0xD77F],
- ["8336BB31",0xD780],
- ["8336BB32",0xD781],
- ["8336BB33",0xD782],
- ["8336BB34",0xD783],
- ["8336BB35",0xD784],
- ["8336BB36",0xD785],
- ["8336BB37",0xD786],
- ["8336BB38",0xD787],
- ["8336BB39",0xD788],
- ["8336BC30",0xD789],
- ["8336BC31",0xD78A],
- ["8336BC32",0xD78B],
- ["8336BC33",0xD78C],
- ["8336BC34",0xD78D],
- ["8336BC35",0xD78E],
- ["8336BC36",0xD78F],
- ["8336BC37",0xD790],
- ["8336BC38",0xD791],
- ["8336BC39",0xD792],
- ["8336BD30",0xD793],
- ["8336BD31",0xD794],
- ["8336BD32",0xD795],
- ["8336BD33",0xD796],
- ["8336BD34",0xD797],
- ["8336BD35",0xD798],
- ["8336BD36",0xD799],
- ["8336BD37",0xD79A],
- ["8336BD38",0xD79B],
- ["8336BD39",0xD79C],
- ["8336BE30",0xD79D],
- ["8336BE31",0xD79E],
- ["8336BE32",0xD79F],
- ["8336BE33",0xD7A0],
- ["8336BE34",0xD7A1],
- ["8336BE35",0xD7A2],
- ["8336BE36",0xD7A3],
- ["8336BE37",0xD7A4],
- ["8336BE38",0xD7A5],
- ["8336BE39",0xD7A6],
- ["8336BF30",0xD7A7],
- ["8336BF31",0xD7A8],
- ["8336BF32",0xD7A9],
- ["8336BF33",0xD7AA],
- ["8336BF34",0xD7AB],
- ["8336BF35",0xD7AC],
- ["8336BF36",0xD7AD],
- ["8336BF37",0xD7AE],
- ["8336BF38",0xD7AF],
- ["8336BF39",0xD7B0],
- ["8336C030",0xD7B1],
- ["8336C031",0xD7B2],
- ["8336C032",0xD7B3],
- ["8336C033",0xD7B4],
- ["8336C034",0xD7B5],
- ["8336C035",0xD7B6],
- ["8336C036",0xD7B7],
- ["8336C037",0xD7B8],
- ["8336C038",0xD7B9],
- ["8336C039",0xD7BA],
- ["8336C130",0xD7BB],
- ["8336C131",0xD7BC],
- ["8336C132",0xD7BD],
- ["8336C133",0xD7BE],
- ["8336C134",0xD7BF],
- ["8336C135",0xD7C0],
- ["8336C136",0xD7C1],
- ["8336C137",0xD7C2],
- ["8336C138",0xD7C3],
- ["8336C139",0xD7C4],
- ["8336C230",0xD7C5],
- ["8336C231",0xD7C6],
- ["8336C232",0xD7C7],
- ["8336C233",0xD7C8],
- ["8336C234",0xD7C9],
- ["8336C235",0xD7CA],
- ["8336C236",0xD7CB],
- ["8336C237",0xD7CC],
- ["8336C238",0xD7CD],
- ["8336C239",0xD7CE],
- ["8336C330",0xD7CF],
- ["8336C331",0xD7D0],
- ["8336C332",0xD7D1],
- ["8336C333",0xD7D2],
- ["8336C334",0xD7D3],
- ["8336C335",0xD7D4],
- ["8336C336",0xD7D5],
- ["8336C337",0xD7D6],
- ["8336C338",0xD7D7],
- ["8336C339",0xD7D8],
- ["8336C430",0xD7D9],
- ["8336C431",0xD7DA],
- ["8336C432",0xD7DB],
- ["8336C433",0xD7DC],
- ["8336C434",0xD7DD],
- ["8336C435",0xD7DE],
- ["8336C436",0xD7DF],
- ["8336C437",0xD7E0],
- ["8336C438",0xD7E1],
- ["8336C439",0xD7E2],
- ["8336C530",0xD7E3],
- ["8336C531",0xD7E4],
- ["8336C532",0xD7E5],
- ["8336C533",0xD7E6],
- ["8336C534",0xD7E7],
- ["8336C535",0xD7E8],
- ["8336C536",0xD7E9],
- ["8336C537",0xD7EA],
- ["8336C538",0xD7EB],
- ["8336C539",0xD7EC],
- ["8336C630",0xD7ED],
- ["8336C631",0xD7EE],
- ["8336C632",0xD7EF],
- ["8336C633",0xD7F0],
- ["8336C634",0xD7F1],
- ["8336C635",0xD7F2],
- ["8336C636",0xD7F3],
- ["8336C637",0xD7F4],
- ["8336C638",0xD7F5],
- ["8336C639",0xD7F6],
- ["8336C730",0xD7F7],
- ["8336C731",0xD7F8],
- ["8336C732",0xD7F9],
- ["8336C733",0xD7FA],
- ["8336C734",0xD7FB],
- ["8336C735",0xD7FC],
- ["8336C736",0xD7FD],
- ["8336C737",0xD7FE],
- ["8336C738",0xD7FF],
- ["AAA1",0xE000],
- ["AAA2",0xE001],
- ["AAA3",0xE002],
- ["AAA4",0xE003],
- ["AAA5",0xE004],
- ["AAA6",0xE005],
- ["AAA7",0xE006],
- ["AAA8",0xE007],
- ["AAA9",0xE008],
- ["AAAA",0xE009],
- ["AAAB",0xE00A],
- ["AAAC",0xE00B],
- ["AAAD",0xE00C],
- ["AAAE",0xE00D],
- ["AAAF",0xE00E],
- ["AAB0",0xE00F],
- ["AAB1",0xE010],
- ["AAB2",0xE011],
- ["AAB3",0xE012],
- ["AAB4",0xE013],
- ["AAB5",0xE014],
- ["AAB6",0xE015],
- ["AAB7",0xE016],
- ["AAB8",0xE017],
- ["AAB9",0xE018],
- ["AABA",0xE019],
- ["AABB",0xE01A],
- ["AABC",0xE01B],
- ["AABD",0xE01C],
- ["AABE",0xE01D],
- ["AABF",0xE01E],
- ["AAC0",0xE01F],
- ["AAC1",0xE020],
- ["AAC2",0xE021],
- ["AAC3",0xE022],
- ["AAC4",0xE023],
- ["AAC5",0xE024],
- ["AAC6",0xE025],
- ["AAC7",0xE026],
- ["AAC8",0xE027],
- ["AAC9",0xE028],
- ["AACA",0xE029],
- ["AACB",0xE02A],
- ["AACC",0xE02B],
- ["AACD",0xE02C],
- ["AACE",0xE02D],
- ["AACF",0xE02E],
- ["AAD0",0xE02F],
- ["AAD1",0xE030],
- ["AAD2",0xE031],
- ["AAD3",0xE032],
- ["AAD4",0xE033],
- ["AAD5",0xE034],
- ["AAD6",0xE035],
- ["AAD7",0xE036],
- ["AAD8",0xE037],
- ["AAD9",0xE038],
- ["AADA",0xE039],
- ["AADB",0xE03A],
- ["AADC",0xE03B],
- ["AADD",0xE03C],
- ["AADE",0xE03D],
- ["AADF",0xE03E],
- ["AAE0",0xE03F],
- ["AAE1",0xE040],
- ["AAE2",0xE041],
- ["AAE3",0xE042],
- ["AAE4",0xE043],
- ["AAE5",0xE044],
- ["AAE6",0xE045],
- ["AAE7",0xE046],
- ["AAE8",0xE047],
- ["AAE9",0xE048],
- ["AAEA",0xE049],
- ["AAEB",0xE04A],
- ["AAEC",0xE04B],
- ["AAED",0xE04C],
- ["AAEE",0xE04D],
- ["AAEF",0xE04E],
- ["AAF0",0xE04F],
- ["AAF1",0xE050],
- ["AAF2",0xE051],
- ["AAF3",0xE052],
- ["AAF4",0xE053],
- ["AAF5",0xE054],
- ["AAF6",0xE055],
- ["AAF7",0xE056],
- ["AAF8",0xE057],
- ["AAF9",0xE058],
- ["AAFA",0xE059],
- ["AAFB",0xE05A],
- ["AAFC",0xE05B],
- ["AAFD",0xE05C],
- ["AAFE",0xE05D],
- ["ABA1",0xE05E],
- ["ABA2",0xE05F],
- ["ABA3",0xE060],
- ["ABA4",0xE061],
- ["ABA5",0xE062],
- ["ABA6",0xE063],
- ["ABA7",0xE064],
- ["ABA8",0xE065],
- ["ABA9",0xE066],
- ["ABAA",0xE067],
- ["ABAB",0xE068],
- ["ABAC",0xE069],
- ["ABAD",0xE06A],
- ["ABAE",0xE06B],
- ["ABAF",0xE06C],
- ["ABB0",0xE06D],
- ["ABB1",0xE06E],
- ["ABB2",0xE06F],
- ["ABB3",0xE070],
- ["ABB4",0xE071],
- ["ABB5",0xE072],
- ["ABB6",0xE073],
- ["ABB7",0xE074],
- ["ABB8",0xE075],
- ["ABB9",0xE076],
- ["ABBA",0xE077],
- ["ABBB",0xE078],
- ["ABBC",0xE079],
- ["ABBD",0xE07A],
- ["ABBE",0xE07B],
- ["ABBF",0xE07C],
- ["ABC0",0xE07D],
- ["ABC1",0xE07E],
- ["ABC2",0xE07F],
- ["ABC3",0xE080],
- ["ABC4",0xE081],
- ["ABC5",0xE082],
- ["ABC6",0xE083],
- ["ABC7",0xE084],
- ["ABC8",0xE085],
- ["ABC9",0xE086],
- ["ABCA",0xE087],
- ["ABCB",0xE088],
- ["ABCC",0xE089],
- ["ABCD",0xE08A],
- ["ABCE",0xE08B],
- ["ABCF",0xE08C],
- ["ABD0",0xE08D],
- ["ABD1",0xE08E],
- ["ABD2",0xE08F],
- ["ABD3",0xE090],
- ["ABD4",0xE091],
- ["ABD5",0xE092],
- ["ABD6",0xE093],
- ["ABD7",0xE094],
- ["ABD8",0xE095],
- ["ABD9",0xE096],
- ["ABDA",0xE097],
- ["ABDB",0xE098],
- ["ABDC",0xE099],
- ["ABDD",0xE09A],
- ["ABDE",0xE09B],
- ["ABDF",0xE09C],
- ["ABE0",0xE09D],
- ["ABE1",0xE09E],
- ["ABE2",0xE09F],
- ["ABE3",0xE0A0],
- ["ABE4",0xE0A1],
- ["ABE5",0xE0A2],
- ["ABE6",0xE0A3],
- ["ABE7",0xE0A4],
- ["ABE8",0xE0A5],
- ["ABE9",0xE0A6],
- ["ABEA",0xE0A7],
- ["ABEB",0xE0A8],
- ["ABEC",0xE0A9],
- ["ABED",0xE0AA],
- ["ABEE",0xE0AB],
- ["ABEF",0xE0AC],
- ["ABF0",0xE0AD],
- ["ABF1",0xE0AE],
- ["ABF2",0xE0AF],
- ["ABF3",0xE0B0],
- ["ABF4",0xE0B1],
- ["ABF5",0xE0B2],
- ["ABF6",0xE0B3],
- ["ABF7",0xE0B4],
- ["ABF8",0xE0B5],
- ["ABF9",0xE0B6],
- ["ABFA",0xE0B7],
- ["ABFB",0xE0B8],
- ["ABFC",0xE0B9],
- ["ABFD",0xE0BA],
- ["ABFE",0xE0BB],
- ["ACA1",0xE0BC],
- ["ACA2",0xE0BD],
- ["ACA3",0xE0BE],
- ["ACA4",0xE0BF],
- ["ACA5",0xE0C0],
- ["ACA6",0xE0C1],
- ["ACA7",0xE0C2],
- ["ACA8",0xE0C3],
- ["ACA9",0xE0C4],
- ["ACAA",0xE0C5],
- ["ACAB",0xE0C6],
- ["ACAC",0xE0C7],
- ["ACAD",0xE0C8],
- ["ACAE",0xE0C9],
- ["ACAF",0xE0CA],
- ["ACB0",0xE0CB],
- ["ACB1",0xE0CC],
- ["ACB2",0xE0CD],
- ["ACB3",0xE0CE],
- ["ACB4",0xE0CF],
- ["ACB5",0xE0D0],
- ["ACB6",0xE0D1],
- ["ACB7",0xE0D2],
- ["ACB8",0xE0D3],
- ["ACB9",0xE0D4],
- ["ACBA",0xE0D5],
- ["ACBB",0xE0D6],
- ["ACBC",0xE0D7],
- ["ACBD",0xE0D8],
- ["ACBE",0xE0D9],
- ["ACBF",0xE0DA],
- ["ACC0",0xE0DB],
- ["ACC1",0xE0DC],
- ["ACC2",0xE0DD],
- ["ACC3",0xE0DE],
- ["ACC4",0xE0DF],
- ["ACC5",0xE0E0],
- ["ACC6",0xE0E1],
- ["ACC7",0xE0E2],
- ["ACC8",0xE0E3],
- ["ACC9",0xE0E4],
- ["ACCA",0xE0E5],
- ["ACCB",0xE0E6],
- ["ACCC",0xE0E7],
- ["ACCD",0xE0E8],
- ["ACCE",0xE0E9],
- ["ACCF",0xE0EA],
- ["ACD0",0xE0EB],
- ["ACD1",0xE0EC],
- ["ACD2",0xE0ED],
- ["ACD3",0xE0EE],
- ["ACD4",0xE0EF],
- ["ACD5",0xE0F0],
- ["ACD6",0xE0F1],
- ["ACD7",0xE0F2],
- ["ACD8",0xE0F3],
- ["ACD9",0xE0F4],
- ["ACDA",0xE0F5],
- ["ACDB",0xE0F6],
- ["ACDC",0xE0F7],
- ["ACDD",0xE0F8],
- ["ACDE",0xE0F9],
- ["ACDF",0xE0FA],
- ["ACE0",0xE0FB],
- ["ACE1",0xE0FC],
- ["ACE2",0xE0FD],
- ["ACE3",0xE0FE],
- ["ACE4",0xE0FF],
- ["ACE5",0xE100],
- ["ACE6",0xE101],
- ["ACE7",0xE102],
- ["ACE8",0xE103],
- ["ACE9",0xE104],
- ["ACEA",0xE105],
- ["ACEB",0xE106],
- ["ACEC",0xE107],
- ["ACED",0xE108],
- ["ACEE",0xE109],
- ["ACEF",0xE10A],
- ["ACF0",0xE10B],
- ["ACF1",0xE10C],
- ["ACF2",0xE10D],
- ["ACF3",0xE10E],
- ["ACF4",0xE10F],
- ["ACF5",0xE110],
- ["ACF6",0xE111],
- ["ACF7",0xE112],
- ["ACF8",0xE113],
- ["ACF9",0xE114],
- ["ACFA",0xE115],
- ["ACFB",0xE116],
- ["ACFC",0xE117],
- ["ACFD",0xE118],
- ["ACFE",0xE119],
- ["ADA1",0xE11A],
- ["ADA2",0xE11B],
- ["ADA3",0xE11C],
- ["ADA4",0xE11D],
- ["ADA5",0xE11E],
- ["ADA6",0xE11F],
- ["ADA7",0xE120],
- ["ADA8",0xE121],
- ["ADA9",0xE122],
- ["ADAA",0xE123],
- ["ADAB",0xE124],
- ["ADAC",0xE125],
- ["ADAD",0xE126],
- ["ADAE",0xE127],
- ["ADAF",0xE128],
- ["ADB0",0xE129],
- ["ADB1",0xE12A],
- ["ADB2",0xE12B],
- ["ADB3",0xE12C],
- ["ADB4",0xE12D],
- ["ADB5",0xE12E],
- ["ADB6",0xE12F],
- ["ADB7",0xE130],
- ["ADB8",0xE131],
- ["ADB9",0xE132],
- ["ADBA",0xE133],
- ["ADBB",0xE134],
- ["ADBC",0xE135],
- ["ADBD",0xE136],
- ["ADBE",0xE137],
- ["ADBF",0xE138],
- ["ADC0",0xE139],
- ["ADC1",0xE13A],
- ["ADC2",0xE13B],
- ["ADC3",0xE13C],
- ["ADC4",0xE13D],
- ["ADC5",0xE13E],
- ["ADC6",0xE13F],
- ["ADC7",0xE140],
- ["ADC8",0xE141],
- ["ADC9",0xE142],
- ["ADCA",0xE143],
- ["ADCB",0xE144],
- ["ADCC",0xE145],
- ["ADCD",0xE146],
- ["ADCE",0xE147],
- ["ADCF",0xE148],
- ["ADD0",0xE149],
- ["ADD1",0xE14A],
- ["ADD2",0xE14B],
- ["ADD3",0xE14C],
- ["ADD4",0xE14D],
- ["ADD5",0xE14E],
- ["ADD6",0xE14F],
- ["ADD7",0xE150],
- ["ADD8",0xE151],
- ["ADD9",0xE152],
- ["ADDA",0xE153],
- ["ADDB",0xE154],
- ["ADDC",0xE155],
- ["ADDD",0xE156],
- ["ADDE",0xE157],
- ["ADDF",0xE158],
- ["ADE0",0xE159],
- ["ADE1",0xE15A],
- ["ADE2",0xE15B],
- ["ADE3",0xE15C],
- ["ADE4",0xE15D],
- ["ADE5",0xE15E],
- ["ADE6",0xE15F],
- ["ADE7",0xE160],
- ["ADE8",0xE161],
- ["ADE9",0xE162],
- ["ADEA",0xE163],
- ["ADEB",0xE164],
- ["ADEC",0xE165],
- ["ADED",0xE166],
- ["ADEE",0xE167],
- ["ADEF",0xE168],
- ["ADF0",0xE169],
- ["ADF1",0xE16A],
- ["ADF2",0xE16B],
- ["ADF3",0xE16C],
- ["ADF4",0xE16D],
- ["ADF5",0xE16E],
- ["ADF6",0xE16F],
- ["ADF7",0xE170],
- ["ADF8",0xE171],
- ["ADF9",0xE172],
- ["ADFA",0xE173],
- ["ADFB",0xE174],
- ["ADFC",0xE175],
- ["ADFD",0xE176],
- ["ADFE",0xE177],
- ["AEA1",0xE178],
- ["AEA2",0xE179],
- ["AEA3",0xE17A],
- ["AEA4",0xE17B],
- ["AEA5",0xE17C],
- ["AEA6",0xE17D],
- ["AEA7",0xE17E],
- ["AEA8",0xE17F],
- ["AEA9",0xE180],
- ["AEAA",0xE181],
- ["AEAB",0xE182],
- ["AEAC",0xE183],
- ["AEAD",0xE184],
- ["AEAE",0xE185],
- ["AEAF",0xE186],
- ["AEB0",0xE187],
- ["AEB1",0xE188],
- ["AEB2",0xE189],
- ["AEB3",0xE18A],
- ["AEB4",0xE18B],
- ["AEB5",0xE18C],
- ["AEB6",0xE18D],
- ["AEB7",0xE18E],
- ["AEB8",0xE18F],
- ["AEB9",0xE190],
- ["AEBA",0xE191],
- ["AEBB",0xE192],
- ["AEBC",0xE193],
- ["AEBD",0xE194],
- ["AEBE",0xE195],
- ["AEBF",0xE196],
- ["AEC0",0xE197],
- ["AEC1",0xE198],
- ["AEC2",0xE199],
- ["AEC3",0xE19A],
- ["AEC4",0xE19B],
- ["AEC5",0xE19C],
- ["AEC6",0xE19D],
- ["AEC7",0xE19E],
- ["AEC8",0xE19F],
- ["AEC9",0xE1A0],
- ["AECA",0xE1A1],
- ["AECB",0xE1A2],
- ["AECC",0xE1A3],
- ["AECD",0xE1A4],
- ["AECE",0xE1A5],
- ["AECF",0xE1A6],
- ["AED0",0xE1A7],
- ["AED1",0xE1A8],
- ["AED2",0xE1A9],
- ["AED3",0xE1AA],
- ["AED4",0xE1AB],
- ["AED5",0xE1AC],
- ["AED6",0xE1AD],
- ["AED7",0xE1AE],
- ["AED8",0xE1AF],
- ["AED9",0xE1B0],
- ["AEDA",0xE1B1],
- ["AEDB",0xE1B2],
- ["AEDC",0xE1B3],
- ["AEDD",0xE1B4],
- ["AEDE",0xE1B5],
- ["AEDF",0xE1B6],
- ["AEE0",0xE1B7],
- ["AEE1",0xE1B8],
- ["AEE2",0xE1B9],
- ["AEE3",0xE1BA],
- ["AEE4",0xE1BB],
- ["AEE5",0xE1BC],
- ["AEE6",0xE1BD],
- ["AEE7",0xE1BE],
- ["AEE8",0xE1BF],
- ["AEE9",0xE1C0],
- ["AEEA",0xE1C1],
- ["AEEB",0xE1C2],
- ["AEEC",0xE1C3],
- ["AEED",0xE1C4],
- ["AEEE",0xE1C5],
- ["AEEF",0xE1C6],
- ["AEF0",0xE1C7],
- ["AEF1",0xE1C8],
- ["AEF2",0xE1C9],
- ["AEF3",0xE1CA],
- ["AEF4",0xE1CB],
- ["AEF5",0xE1CC],
- ["AEF6",0xE1CD],
- ["AEF7",0xE1CE],
- ["AEF8",0xE1CF],
- ["AEF9",0xE1D0],
- ["AEFA",0xE1D1],
- ["AEFB",0xE1D2],
- ["AEFC",0xE1D3],
- ["AEFD",0xE1D4],
- ["AEFE",0xE1D5],
- ["AFA1",0xE1D6],
- ["AFA2",0xE1D7],
- ["AFA3",0xE1D8],
- ["AFA4",0xE1D9],
- ["AFA5",0xE1DA],
- ["AFA6",0xE1DB],
- ["AFA7",0xE1DC],
- ["AFA8",0xE1DD],
- ["AFA9",0xE1DE],
- ["AFAA",0xE1DF],
- ["AFAB",0xE1E0],
- ["AFAC",0xE1E1],
- ["AFAD",0xE1E2],
- ["AFAE",0xE1E3],
- ["AFAF",0xE1E4],
- ["AFB0",0xE1E5],
- ["AFB1",0xE1E6],
- ["AFB2",0xE1E7],
- ["AFB3",0xE1E8],
- ["AFB4",0xE1E9],
- ["AFB5",0xE1EA],
- ["AFB6",0xE1EB],
- ["AFB7",0xE1EC],
- ["AFB8",0xE1ED],
- ["AFB9",0xE1EE],
- ["AFBA",0xE1EF],
- ["AFBB",0xE1F0],
- ["AFBC",0xE1F1],
- ["AFBD",0xE1F2],
- ["AFBE",0xE1F3],
- ["AFBF",0xE1F4],
- ["AFC0",0xE1F5],
- ["AFC1",0xE1F6],
- ["AFC2",0xE1F7],
- ["AFC3",0xE1F8],
- ["AFC4",0xE1F9],
- ["AFC5",0xE1FA],
- ["AFC6",0xE1FB],
- ["AFC7",0xE1FC],
- ["AFC8",0xE1FD],
- ["AFC9",0xE1FE],
- ["AFCA",0xE1FF],
- ["AFCB",0xE200],
- ["AFCC",0xE201],
- ["AFCD",0xE202],
- ["AFCE",0xE203],
- ["AFCF",0xE204],
- ["AFD0",0xE205],
- ["AFD1",0xE206],
- ["AFD2",0xE207],
- ["AFD3",0xE208],
- ["AFD4",0xE209],
- ["AFD5",0xE20A],
- ["AFD6",0xE20B],
- ["AFD7",0xE20C],
- ["AFD8",0xE20D],
- ["AFD9",0xE20E],
- ["AFDA",0xE20F],
- ["AFDB",0xE210],
- ["AFDC",0xE211],
- ["AFDD",0xE212],
- ["AFDE",0xE213],
- ["AFDF",0xE214],
- ["AFE0",0xE215],
- ["AFE1",0xE216],
- ["AFE2",0xE217],
- ["AFE3",0xE218],
- ["AFE4",0xE219],
- ["AFE5",0xE21A],
- ["AFE6",0xE21B],
- ["AFE7",0xE21C],
- ["AFE8",0xE21D],
- ["AFE9",0xE21E],
- ["AFEA",0xE21F],
- ["AFEB",0xE220],
- ["AFEC",0xE221],
- ["AFED",0xE222],
- ["AFEE",0xE223],
- ["AFEF",0xE224],
- ["AFF0",0xE225],
- ["AFF1",0xE226],
- ["AFF2",0xE227],
- ["AFF3",0xE228],
- ["AFF4",0xE229],
- ["AFF5",0xE22A],
- ["AFF6",0xE22B],
- ["AFF7",0xE22C],
- ["AFF8",0xE22D],
- ["AFF9",0xE22E],
- ["AFFA",0xE22F],
- ["AFFB",0xE230],
- ["AFFC",0xE231],
- ["AFFD",0xE232],
- ["AFFE",0xE233],
- ["F8A1",0xE234],
- ["F8A2",0xE235],
- ["F8A3",0xE236],
- ["F8A4",0xE237],
- ["F8A5",0xE238],
- ["F8A6",0xE239],
- ["F8A7",0xE23A],
- ["F8A8",0xE23B],
- ["F8A9",0xE23C],
- ["F8AA",0xE23D],
- ["F8AB",0xE23E],
- ["F8AC",0xE23F],
- ["F8AD",0xE240],
- ["F8AE",0xE241],
- ["F8AF",0xE242],
- ["F8B0",0xE243],
- ["F8B1",0xE244],
- ["F8B2",0xE245],
- ["F8B3",0xE246],
- ["F8B4",0xE247],
- ["F8B5",0xE248],
- ["F8B6",0xE249],
- ["F8B7",0xE24A],
- ["F8B8",0xE24B],
- ["F8B9",0xE24C],
- ["F8BA",0xE24D],
- ["F8BB",0xE24E],
- ["F8BC",0xE24F],
- ["F8BD",0xE250],
- ["F8BE",0xE251],
- ["F8BF",0xE252],
- ["F8C0",0xE253],
- ["F8C1",0xE254],
- ["F8C2",0xE255],
- ["F8C3",0xE256],
- ["F8C4",0xE257],
- ["F8C5",0xE258],
- ["F8C6",0xE259],
- ["F8C7",0xE25A],
- ["F8C8",0xE25B],
- ["F8C9",0xE25C],
- ["F8CA",0xE25D],
- ["F8CB",0xE25E],
- ["F8CC",0xE25F],
- ["F8CD",0xE260],
- ["F8CE",0xE261],
- ["F8CF",0xE262],
- ["F8D0",0xE263],
- ["F8D1",0xE264],
- ["F8D2",0xE265],
- ["F8D3",0xE266],
- ["F8D4",0xE267],
- ["F8D5",0xE268],
- ["F8D6",0xE269],
- ["F8D7",0xE26A],
- ["F8D8",0xE26B],
- ["F8D9",0xE26C],
- ["F8DA",0xE26D],
- ["F8DB",0xE26E],
- ["F8DC",0xE26F],
- ["F8DD",0xE270],
- ["F8DE",0xE271],
- ["F8DF",0xE272],
- ["F8E0",0xE273],
- ["F8E1",0xE274],
- ["F8E2",0xE275],
- ["F8E3",0xE276],
- ["F8E4",0xE277],
- ["F8E5",0xE278],
- ["F8E6",0xE279],
- ["F8E7",0xE27A],
- ["F8E8",0xE27B],
- ["F8E9",0xE27C],
- ["F8EA",0xE27D],
- ["F8EB",0xE27E],
- ["F8EC",0xE27F],
- ["F8ED",0xE280],
- ["F8EE",0xE281],
- ["F8EF",0xE282],
- ["F8F0",0xE283],
- ["F8F1",0xE284],
- ["F8F2",0xE285],
- ["F8F3",0xE286],
- ["F8F4",0xE287],
- ["F8F5",0xE288],
- ["F8F6",0xE289],
- ["F8F7",0xE28A],
- ["F8F8",0xE28B],
- ["F8F9",0xE28C],
- ["F8FA",0xE28D],
- ["F8FB",0xE28E],
- ["F8FC",0xE28F],
- ["F8FD",0xE290],
- ["F8FE",0xE291],
- ["F9A1",0xE292],
- ["F9A2",0xE293],
- ["F9A3",0xE294],
- ["F9A4",0xE295],
- ["F9A5",0xE296],
- ["F9A6",0xE297],
- ["F9A7",0xE298],
- ["F9A8",0xE299],
- ["F9A9",0xE29A],
- ["F9AA",0xE29B],
- ["F9AB",0xE29C],
- ["F9AC",0xE29D],
- ["F9AD",0xE29E],
- ["F9AE",0xE29F],
- ["F9AF",0xE2A0],
- ["F9B0",0xE2A1],
- ["F9B1",0xE2A2],
- ["F9B2",0xE2A3],
- ["F9B3",0xE2A4],
- ["F9B4",0xE2A5],
- ["F9B5",0xE2A6],
- ["F9B6",0xE2A7],
- ["F9B7",0xE2A8],
- ["F9B8",0xE2A9],
- ["F9B9",0xE2AA],
- ["F9BA",0xE2AB],
- ["F9BB",0xE2AC],
- ["F9BC",0xE2AD],
- ["F9BD",0xE2AE],
- ["F9BE",0xE2AF],
- ["F9BF",0xE2B0],
- ["F9C0",0xE2B1],
- ["F9C1",0xE2B2],
- ["F9C2",0xE2B3],
- ["F9C3",0xE2B4],
- ["F9C4",0xE2B5],
- ["F9C5",0xE2B6],
- ["F9C6",0xE2B7],
- ["F9C7",0xE2B8],
- ["F9C8",0xE2B9],
- ["F9C9",0xE2BA],
- ["F9CA",0xE2BB],
- ["F9CB",0xE2BC],
- ["F9CC",0xE2BD],
- ["F9CD",0xE2BE],
- ["F9CE",0xE2BF],
- ["F9CF",0xE2C0],
- ["F9D0",0xE2C1],
- ["F9D1",0xE2C2],
- ["F9D2",0xE2C3],
- ["F9D3",0xE2C4],
- ["F9D4",0xE2C5],
- ["F9D5",0xE2C6],
- ["F9D6",0xE2C7],
- ["F9D7",0xE2C8],
- ["F9D8",0xE2C9],
- ["F9D9",0xE2CA],
- ["F9DA",0xE2CB],
- ["F9DB",0xE2CC],
- ["F9DC",0xE2CD],
- ["F9DD",0xE2CE],
- ["F9DE",0xE2CF],
- ["F9DF",0xE2D0],
- ["F9E0",0xE2D1],
- ["F9E1",0xE2D2],
- ["F9E2",0xE2D3],
- ["F9E3",0xE2D4],
- ["F9E4",0xE2D5],
- ["F9E5",0xE2D6],
- ["F9E6",0xE2D7],
- ["F9E7",0xE2D8],
- ["F9E8",0xE2D9],
- ["F9E9",0xE2DA],
- ["F9EA",0xE2DB],
- ["F9EB",0xE2DC],
- ["F9EC",0xE2DD],
- ["F9ED",0xE2DE],
- ["F9EE",0xE2DF],
- ["F9EF",0xE2E0],
- ["F9F0",0xE2E1],
- ["F9F1",0xE2E2],
- ["F9F2",0xE2E3],
- ["F9F3",0xE2E4],
- ["F9F4",0xE2E5],
- ["F9F5",0xE2E6],
- ["F9F6",0xE2E7],
- ["F9F7",0xE2E8],
- ["F9F8",0xE2E9],
- ["F9F9",0xE2EA],
- ["F9FA",0xE2EB],
- ["F9FB",0xE2EC],
- ["F9FC",0xE2ED],
- ["F9FD",0xE2EE],
- ["F9FE",0xE2EF],
- ["FAA1",0xE2F0],
- ["FAA2",0xE2F1],
- ["FAA3",0xE2F2],
- ["FAA4",0xE2F3],
- ["FAA5",0xE2F4],
- ["FAA6",0xE2F5],
- ["FAA7",0xE2F6],
- ["FAA8",0xE2F7],
- ["FAA9",0xE2F8],
- ["FAAA",0xE2F9],
- ["FAAB",0xE2FA],
- ["FAAC",0xE2FB],
- ["FAAD",0xE2FC],
- ["FAAE",0xE2FD],
- ["FAAF",0xE2FE],
- ["FAB0",0xE2FF],
- ["FAB1",0xE300],
- ["FAB2",0xE301],
- ["FAB3",0xE302],
- ["FAB4",0xE303],
- ["FAB5",0xE304],
- ["FAB6",0xE305],
- ["FAB7",0xE306],
- ["FAB8",0xE307],
- ["FAB9",0xE308],
- ["FABA",0xE309],
- ["FABB",0xE30A],
- ["FABC",0xE30B],
- ["FABD",0xE30C],
- ["FABE",0xE30D],
- ["FABF",0xE30E],
- ["FAC0",0xE30F],
- ["FAC1",0xE310],
- ["FAC2",0xE311],
- ["FAC3",0xE312],
- ["FAC4",0xE313],
- ["FAC5",0xE314],
- ["FAC6",0xE315],
- ["FAC7",0xE316],
- ["FAC8",0xE317],
- ["FAC9",0xE318],
- ["FACA",0xE319],
- ["FACB",0xE31A],
- ["FACC",0xE31B],
- ["FACD",0xE31C],
- ["FACE",0xE31D],
- ["FACF",0xE31E],
- ["FAD0",0xE31F],
- ["FAD1",0xE320],
- ["FAD2",0xE321],
- ["FAD3",0xE322],
- ["FAD4",0xE323],
- ["FAD5",0xE324],
- ["FAD6",0xE325],
- ["FAD7",0xE326],
- ["FAD8",0xE327],
- ["FAD9",0xE328],
- ["FADA",0xE329],
- ["FADB",0xE32A],
- ["FADC",0xE32B],
- ["FADD",0xE32C],
- ["FADE",0xE32D],
- ["FADF",0xE32E],
- ["FAE0",0xE32F],
- ["FAE1",0xE330],
- ["FAE2",0xE331],
- ["FAE3",0xE332],
- ["FAE4",0xE333],
- ["FAE5",0xE334],
- ["FAE6",0xE335],
- ["FAE7",0xE336],
- ["FAE8",0xE337],
- ["FAE9",0xE338],
- ["FAEA",0xE339],
- ["FAEB",0xE33A],
- ["FAEC",0xE33B],
- ["FAED",0xE33C],
- ["FAEE",0xE33D],
- ["FAEF",0xE33E],
- ["FAF0",0xE33F],
- ["FAF1",0xE340],
- ["FAF2",0xE341],
- ["FAF3",0xE342],
- ["FAF4",0xE343],
- ["FAF5",0xE344],
- ["FAF6",0xE345],
- ["FAF7",0xE346],
- ["FAF8",0xE347],
- ["FAF9",0xE348],
- ["FAFA",0xE349],
- ["FAFB",0xE34A],
- ["FAFC",0xE34B],
- ["FAFD",0xE34C],
- ["FAFE",0xE34D],
- ["FBA1",0xE34E],
- ["FBA2",0xE34F],
- ["FBA3",0xE350],
- ["FBA4",0xE351],
- ["FBA5",0xE352],
- ["FBA6",0xE353],
- ["FBA7",0xE354],
- ["FBA8",0xE355],
- ["FBA9",0xE356],
- ["FBAA",0xE357],
- ["FBAB",0xE358],
- ["FBAC",0xE359],
- ["FBAD",0xE35A],
- ["FBAE",0xE35B],
- ["FBAF",0xE35C],
- ["FBB0",0xE35D],
- ["FBB1",0xE35E],
- ["FBB2",0xE35F],
- ["FBB3",0xE360],
- ["FBB4",0xE361],
- ["FBB5",0xE362],
- ["FBB6",0xE363],
- ["FBB7",0xE364],
- ["FBB8",0xE365],
- ["FBB9",0xE366],
- ["FBBA",0xE367],
- ["FBBB",0xE368],
- ["FBBC",0xE369],
- ["FBBD",0xE36A],
- ["FBBE",0xE36B],
- ["FBBF",0xE36C],
- ["FBC0",0xE36D],
- ["FBC1",0xE36E],
- ["FBC2",0xE36F],
- ["FBC3",0xE370],
- ["FBC4",0xE371],
- ["FBC5",0xE372],
- ["FBC6",0xE373],
- ["FBC7",0xE374],
- ["FBC8",0xE375],
- ["FBC9",0xE376],
- ["FBCA",0xE377],
- ["FBCB",0xE378],
- ["FBCC",0xE379],
- ["FBCD",0xE37A],
- ["FBCE",0xE37B],
- ["FBCF",0xE37C],
- ["FBD0",0xE37D],
- ["FBD1",0xE37E],
- ["FBD2",0xE37F],
- ["FBD3",0xE380],
- ["FBD4",0xE381],
- ["FBD5",0xE382],
- ["FBD6",0xE383],
- ["FBD7",0xE384],
- ["FBD8",0xE385],
- ["FBD9",0xE386],
- ["FBDA",0xE387],
- ["FBDB",0xE388],
- ["FBDC",0xE389],
- ["FBDD",0xE38A],
- ["FBDE",0xE38B],
- ["FBDF",0xE38C],
- ["FBE0",0xE38D],
- ["FBE1",0xE38E],
- ["FBE2",0xE38F],
- ["FBE3",0xE390],
- ["FBE4",0xE391],
- ["FBE5",0xE392],
- ["FBE6",0xE393],
- ["FBE7",0xE394],
- ["FBE8",0xE395],
- ["FBE9",0xE396],
- ["FBEA",0xE397],
- ["FBEB",0xE398],
- ["FBEC",0xE399],
- ["FBED",0xE39A],
- ["FBEE",0xE39B],
- ["FBEF",0xE39C],
- ["FBF0",0xE39D],
- ["FBF1",0xE39E],
- ["FBF2",0xE39F],
- ["FBF3",0xE3A0],
- ["FBF4",0xE3A1],
- ["FBF5",0xE3A2],
- ["FBF6",0xE3A3],
- ["FBF7",0xE3A4],
- ["FBF8",0xE3A5],
- ["FBF9",0xE3A6],
- ["FBFA",0xE3A7],
- ["FBFB",0xE3A8],
- ["FBFC",0xE3A9],
- ["FBFD",0xE3AA],
- ["FBFE",0xE3AB],
- ["FCA1",0xE3AC],
- ["FCA2",0xE3AD],
- ["FCA3",0xE3AE],
- ["FCA4",0xE3AF],
- ["FCA5",0xE3B0],
- ["FCA6",0xE3B1],
- ["FCA7",0xE3B2],
- ["FCA8",0xE3B3],
- ["FCA9",0xE3B4],
- ["FCAA",0xE3B5],
- ["FCAB",0xE3B6],
- ["FCAC",0xE3B7],
- ["FCAD",0xE3B8],
- ["FCAE",0xE3B9],
- ["FCAF",0xE3BA],
- ["FCB0",0xE3BB],
- ["FCB1",0xE3BC],
- ["FCB2",0xE3BD],
- ["FCB3",0xE3BE],
- ["FCB4",0xE3BF],
- ["FCB5",0xE3C0],
- ["FCB6",0xE3C1],
- ["FCB7",0xE3C2],
- ["FCB8",0xE3C3],
- ["FCB9",0xE3C4],
- ["FCBA",0xE3C5],
- ["FCBB",0xE3C6],
- ["FCBC",0xE3C7],
- ["FCBD",0xE3C8],
- ["FCBE",0xE3C9],
- ["FCBF",0xE3CA],
- ["FCC0",0xE3CB],
- ["FCC1",0xE3CC],
- ["FCC2",0xE3CD],
- ["FCC3",0xE3CE],
- ["FCC4",0xE3CF],
- ["FCC5",0xE3D0],
- ["FCC6",0xE3D1],
- ["FCC7",0xE3D2],
- ["FCC8",0xE3D3],
- ["FCC9",0xE3D4],
- ["FCCA",0xE3D5],
- ["FCCB",0xE3D6],
- ["FCCC",0xE3D7],
- ["FCCD",0xE3D8],
- ["FCCE",0xE3D9],
- ["FCCF",0xE3DA],
- ["FCD0",0xE3DB],
- ["FCD1",0xE3DC],
- ["FCD2",0xE3DD],
- ["FCD3",0xE3DE],
- ["FCD4",0xE3DF],
- ["FCD5",0xE3E0],
- ["FCD6",0xE3E1],
- ["FCD7",0xE3E2],
- ["FCD8",0xE3E3],
- ["FCD9",0xE3E4],
- ["FCDA",0xE3E5],
- ["FCDB",0xE3E6],
- ["FCDC",0xE3E7],
- ["FCDD",0xE3E8],
- ["FCDE",0xE3E9],
- ["FCDF",0xE3EA],
- ["FCE0",0xE3EB],
- ["FCE1",0xE3EC],
- ["FCE2",0xE3ED],
- ["FCE3",0xE3EE],
- ["FCE4",0xE3EF],
- ["FCE5",0xE3F0],
- ["FCE6",0xE3F1],
- ["FCE7",0xE3F2],
- ["FCE8",0xE3F3],
- ["FCE9",0xE3F4],
- ["FCEA",0xE3F5],
- ["FCEB",0xE3F6],
- ["FCEC",0xE3F7],
- ["FCED",0xE3F8],
- ["FCEE",0xE3F9],
- ["FCEF",0xE3FA],
- ["FCF0",0xE3FB],
- ["FCF1",0xE3FC],
- ["FCF2",0xE3FD],
- ["FCF3",0xE3FE],
- ["FCF4",0xE3FF],
- ["FCF5",0xE400],
- ["FCF6",0xE401],
- ["FCF7",0xE402],
- ["FCF8",0xE403],
- ["FCF9",0xE404],
- ["FCFA",0xE405],
- ["FCFB",0xE406],
- ["FCFC",0xE407],
- ["FCFD",0xE408],
- ["FCFE",0xE409],
- ["FDA1",0xE40A],
- ["FDA2",0xE40B],
- ["FDA3",0xE40C],
- ["FDA4",0xE40D],
- ["FDA5",0xE40E],
- ["FDA6",0xE40F],
- ["FDA7",0xE410],
- ["FDA8",0xE411],
- ["FDA9",0xE412],
- ["FDAA",0xE413],
- ["FDAB",0xE414],
- ["FDAC",0xE415],
- ["FDAD",0xE416],
- ["FDAE",0xE417],
- ["FDAF",0xE418],
- ["FDB0",0xE419],
- ["FDB1",0xE41A],
- ["FDB2",0xE41B],
- ["FDB3",0xE41C],
- ["FDB4",0xE41D],
- ["FDB5",0xE41E],
- ["FDB6",0xE41F],
- ["FDB7",0xE420],
- ["FDB8",0xE421],
- ["FDB9",0xE422],
- ["FDBA",0xE423],
- ["FDBB",0xE424],
- ["FDBC",0xE425],
- ["FDBD",0xE426],
- ["FDBE",0xE427],
- ["FDBF",0xE428],
- ["FDC0",0xE429],
- ["FDC1",0xE42A],
- ["FDC2",0xE42B],
- ["FDC3",0xE42C],
- ["FDC4",0xE42D],
- ["FDC5",0xE42E],
- ["FDC6",0xE42F],
- ["FDC7",0xE430],
- ["FDC8",0xE431],
- ["FDC9",0xE432],
- ["FDCA",0xE433],
- ["FDCB",0xE434],
- ["FDCC",0xE435],
- ["FDCD",0xE436],
- ["FDCE",0xE437],
- ["FDCF",0xE438],
- ["FDD0",0xE439],
- ["FDD1",0xE43A],
- ["FDD2",0xE43B],
- ["FDD3",0xE43C],
- ["FDD4",0xE43D],
- ["FDD5",0xE43E],
- ["FDD6",0xE43F],
- ["FDD7",0xE440],
- ["FDD8",0xE441],
- ["FDD9",0xE442],
- ["FDDA",0xE443],
- ["FDDB",0xE444],
- ["FDDC",0xE445],
- ["FDDD",0xE446],
- ["FDDE",0xE447],
- ["FDDF",0xE448],
- ["FDE0",0xE449],
- ["FDE1",0xE44A],
- ["FDE2",0xE44B],
- ["FDE3",0xE44C],
- ["FDE4",0xE44D],
- ["FDE5",0xE44E],
- ["FDE6",0xE44F],
- ["FDE7",0xE450],
- ["FDE8",0xE451],
- ["FDE9",0xE452],
- ["FDEA",0xE453],
- ["FDEB",0xE454],
- ["FDEC",0xE455],
- ["FDED",0xE456],
- ["FDEE",0xE457],
- ["FDEF",0xE458],
- ["FDF0",0xE459],
- ["FDF1",0xE45A],
- ["FDF2",0xE45B],
- ["FDF3",0xE45C],
- ["FDF4",0xE45D],
- ["FDF5",0xE45E],
- ["FDF6",0xE45F],
- ["FDF7",0xE460],
- ["FDF8",0xE461],
- ["FDF9",0xE462],
- ["FDFA",0xE463],
- ["FDFB",0xE464],
- ["FDFC",0xE465],
- ["FDFD",0xE466],
- ["FDFE",0xE467],
- ["FEA1",0xE468],
- ["FEA2",0xE469],
- ["FEA3",0xE46A],
- ["FEA4",0xE46B],
- ["FEA5",0xE46C],
- ["FEA6",0xE46D],
- ["FEA7",0xE46E],
- ["FEA8",0xE46F],
- ["FEA9",0xE470],
- ["FEAA",0xE471],
- ["FEAB",0xE472],
- ["FEAC",0xE473],
- ["FEAD",0xE474],
- ["FEAE",0xE475],
- ["FEAF",0xE476],
- ["FEB0",0xE477],
- ["FEB1",0xE478],
- ["FEB2",0xE479],
- ["FEB3",0xE47A],
- ["FEB4",0xE47B],
- ["FEB5",0xE47C],
- ["FEB6",0xE47D],
- ["FEB7",0xE47E],
- ["FEB8",0xE47F],
- ["FEB9",0xE480],
- ["FEBA",0xE481],
- ["FEBB",0xE482],
- ["FEBC",0xE483],
- ["FEBD",0xE484],
- ["FEBE",0xE485],
- ["FEBF",0xE486],
- ["FEC0",0xE487],
- ["FEC1",0xE488],
- ["FEC2",0xE489],
- ["FEC3",0xE48A],
- ["FEC4",0xE48B],
- ["FEC5",0xE48C],
- ["FEC6",0xE48D],
- ["FEC7",0xE48E],
- ["FEC8",0xE48F],
- ["FEC9",0xE490],
- ["FECA",0xE491],
- ["FECB",0xE492],
- ["FECC",0xE493],
- ["FECD",0xE494],
- ["FECE",0xE495],
- ["FECF",0xE496],
- ["FED0",0xE497],
- ["FED1",0xE498],
- ["FED2",0xE499],
- ["FED3",0xE49A],
- ["FED4",0xE49B],
- ["FED5",0xE49C],
- ["FED6",0xE49D],
- ["FED7",0xE49E],
- ["FED8",0xE49F],
- ["FED9",0xE4A0],
- ["FEDA",0xE4A1],
- ["FEDB",0xE4A2],
- ["FEDC",0xE4A3],
- ["FEDD",0xE4A4],
- ["FEDE",0xE4A5],
- ["FEDF",0xE4A6],
- ["FEE0",0xE4A7],
- ["FEE1",0xE4A8],
- ["FEE2",0xE4A9],
- ["FEE3",0xE4AA],
- ["FEE4",0xE4AB],
- ["FEE5",0xE4AC],
- ["FEE6",0xE4AD],
- ["FEE7",0xE4AE],
- ["FEE8",0xE4AF],
- ["FEE9",0xE4B0],
- ["FEEA",0xE4B1],
- ["FEEB",0xE4B2],
- ["FEEC",0xE4B3],
- ["FEED",0xE4B4],
- ["FEEE",0xE4B5],
- ["FEEF",0xE4B6],
- ["FEF0",0xE4B7],
- ["FEF1",0xE4B8],
- ["FEF2",0xE4B9],
- ["FEF3",0xE4BA],
- ["FEF4",0xE4BB],
- ["FEF5",0xE4BC],
- ["FEF6",0xE4BD],
- ["FEF7",0xE4BE],
- ["FEF8",0xE4BF],
- ["FEF9",0xE4C0],
- ["FEFA",0xE4C1],
- ["FEFB",0xE4C2],
- ["FEFC",0xE4C3],
- ["FEFD",0xE4C4],
- ["FEFE",0xE4C5],
- ["A140",0xE4C6],
- ["A141",0xE4C7],
- ["A142",0xE4C8],
- ["A143",0xE4C9],
- ["A144",0xE4CA],
- ["A145",0xE4CB],
- ["A146",0xE4CC],
- ["A147",0xE4CD],
- ["A148",0xE4CE],
- ["A149",0xE4CF],
- ["A14A",0xE4D0],
- ["A14B",0xE4D1],
- ["A14C",0xE4D2],
- ["A14D",0xE4D3],
- ["A14E",0xE4D4],
- ["A14F",0xE4D5],
- ["A150",0xE4D6],
- ["A151",0xE4D7],
- ["A152",0xE4D8],
- ["A153",0xE4D9],
- ["A154",0xE4DA],
- ["A155",0xE4DB],
- ["A156",0xE4DC],
- ["A157",0xE4DD],
- ["A158",0xE4DE],
- ["A159",0xE4DF],
- ["A15A",0xE4E0],
- ["A15B",0xE4E1],
- ["A15C",0xE4E2],
- ["A15D",0xE4E3],
- ["A15E",0xE4E4],
- ["A15F",0xE4E5],
- ["A160",0xE4E6],
- ["A161",0xE4E7],
- ["A162",0xE4E8],
- ["A163",0xE4E9],
- ["A164",0xE4EA],
- ["A165",0xE4EB],
- ["A166",0xE4EC],
- ["A167",0xE4ED],
- ["A168",0xE4EE],
- ["A169",0xE4EF],
- ["A16A",0xE4F0],
- ["A16B",0xE4F1],
- ["A16C",0xE4F2],
- ["A16D",0xE4F3],
- ["A16E",0xE4F4],
- ["A16F",0xE4F5],
- ["A170",0xE4F6],
- ["A171",0xE4F7],
- ["A172",0xE4F8],
- ["A173",0xE4F9],
- ["A174",0xE4FA],
- ["A175",0xE4FB],
- ["A176",0xE4FC],
- ["A177",0xE4FD],
- ["A178",0xE4FE],
- ["A179",0xE4FF],
- ["A17A",0xE500],
- ["A17B",0xE501],
- ["A17C",0xE502],
- ["A17D",0xE503],
- ["A17E",0xE504],
- ["A180",0xE505],
- ["A181",0xE506],
- ["A182",0xE507],
- ["A183",0xE508],
- ["A184",0xE509],
- ["A185",0xE50A],
- ["A186",0xE50B],
- ["A187",0xE50C],
- ["A188",0xE50D],
- ["A189",0xE50E],
- ["A18A",0xE50F],
- ["A18B",0xE510],
- ["A18C",0xE511],
- ["A18D",0xE512],
- ["A18E",0xE513],
- ["A18F",0xE514],
- ["A190",0xE515],
- ["A191",0xE516],
- ["A192",0xE517],
- ["A193",0xE518],
- ["A194",0xE519],
- ["A195",0xE51A],
- ["A196",0xE51B],
- ["A197",0xE51C],
- ["A198",0xE51D],
- ["A199",0xE51E],
- ["A19A",0xE51F],
- ["A19B",0xE520],
- ["A19C",0xE521],
- ["A19D",0xE522],
- ["A19E",0xE523],
- ["A19F",0xE524],
- ["A1A0",0xE525],
- ["A240",0xE526],
- ["A241",0xE527],
- ["A242",0xE528],
- ["A243",0xE529],
- ["A244",0xE52A],
- ["A245",0xE52B],
- ["A246",0xE52C],
- ["A247",0xE52D],
- ["A248",0xE52E],
- ["A249",0xE52F],
- ["A24A",0xE530],
- ["A24B",0xE531],
- ["A24C",0xE532],
- ["A24D",0xE533],
- ["A24E",0xE534],
- ["A24F",0xE535],
- ["A250",0xE536],
- ["A251",0xE537],
- ["A252",0xE538],
- ["A253",0xE539],
- ["A254",0xE53A],
- ["A255",0xE53B],
- ["A256",0xE53C],
- ["A257",0xE53D],
- ["A258",0xE53E],
- ["A259",0xE53F],
- ["A25A",0xE540],
- ["A25B",0xE541],
- ["A25C",0xE542],
- ["A25D",0xE543],
- ["A25E",0xE544],
- ["A25F",0xE545],
- ["A260",0xE546],
- ["A261",0xE547],
- ["A262",0xE548],
- ["A263",0xE549],
- ["A264",0xE54A],
- ["A265",0xE54B],
- ["A266",0xE54C],
- ["A267",0xE54D],
- ["A268",0xE54E],
- ["A269",0xE54F],
- ["A26A",0xE550],
- ["A26B",0xE551],
- ["A26C",0xE552],
- ["A26D",0xE553],
- ["A26E",0xE554],
- ["A26F",0xE555],
- ["A270",0xE556],
- ["A271",0xE557],
- ["A272",0xE558],
- ["A273",0xE559],
- ["A274",0xE55A],
- ["A275",0xE55B],
- ["A276",0xE55C],
- ["A277",0xE55D],
- ["A278",0xE55E],
- ["A279",0xE55F],
- ["A27A",0xE560],
- ["A27B",0xE561],
- ["A27C",0xE562],
- ["A27D",0xE563],
- ["A27E",0xE564],
- ["A280",0xE565],
- ["A281",0xE566],
- ["A282",0xE567],
- ["A283",0xE568],
- ["A284",0xE569],
- ["A285",0xE56A],
- ["A286",0xE56B],
- ["A287",0xE56C],
- ["A288",0xE56D],
- ["A289",0xE56E],
- ["A28A",0xE56F],
- ["A28B",0xE570],
- ["A28C",0xE571],
- ["A28D",0xE572],
- ["A28E",0xE573],
- ["A28F",0xE574],
- ["A290",0xE575],
- ["A291",0xE576],
- ["A292",0xE577],
- ["A293",0xE578],
- ["A294",0xE579],
- ["A295",0xE57A],
- ["A296",0xE57B],
- ["A297",0xE57C],
- ["A298",0xE57D],
- ["A299",0xE57E],
- ["A29A",0xE57F],
- ["A29B",0xE580],
- ["A29C",0xE581],
- ["A29D",0xE582],
- ["A29E",0xE583],
- ["A29F",0xE584],
- ["A2A0",0xE585],
- ["A340",0xE586],
- ["A341",0xE587],
- ["A342",0xE588],
- ["A343",0xE589],
- ["A344",0xE58A],
- ["A345",0xE58B],
- ["A346",0xE58C],
- ["A347",0xE58D],
- ["A348",0xE58E],
- ["A349",0xE58F],
- ["A34A",0xE590],
- ["A34B",0xE591],
- ["A34C",0xE592],
- ["A34D",0xE593],
- ["A34E",0xE594],
- ["A34F",0xE595],
- ["A350",0xE596],
- ["A351",0xE597],
- ["A352",0xE598],
- ["A353",0xE599],
- ["A354",0xE59A],
- ["A355",0xE59B],
- ["A356",0xE59C],
- ["A357",0xE59D],
- ["A358",0xE59E],
- ["A359",0xE59F],
- ["A35A",0xE5A0],
- ["A35B",0xE5A1],
- ["A35C",0xE5A2],
- ["A35D",0xE5A3],
- ["A35E",0xE5A4],
- ["A35F",0xE5A5],
- ["A360",0xE5A6],
- ["A361",0xE5A7],
- ["A362",0xE5A8],
- ["A363",0xE5A9],
- ["A364",0xE5AA],
- ["A365",0xE5AB],
- ["A366",0xE5AC],
- ["A367",0xE5AD],
- ["A368",0xE5AE],
- ["A369",0xE5AF],
- ["A36A",0xE5B0],
- ["A36B",0xE5B1],
- ["A36C",0xE5B2],
- ["A36D",0xE5B3],
- ["A36E",0xE5B4],
- ["A36F",0xE5B5],
- ["A370",0xE5B6],
- ["A371",0xE5B7],
- ["A372",0xE5B8],
- ["A373",0xE5B9],
- ["A374",0xE5BA],
- ["A375",0xE5BB],
- ["A376",0xE5BC],
- ["A377",0xE5BD],
- ["A378",0xE5BE],
- ["A379",0xE5BF],
- ["A37A",0xE5C0],
- ["A37B",0xE5C1],
- ["A37C",0xE5C2],
- ["A37D",0xE5C3],
- ["A37E",0xE5C4],
- ["A380",0xE5C5],
- ["A381",0xE5C6],
- ["A382",0xE5C7],
- ["A383",0xE5C8],
- ["A384",0xE5C9],
- ["A385",0xE5CA],
- ["A386",0xE5CB],
- ["A387",0xE5CC],
- ["A388",0xE5CD],
- ["A389",0xE5CE],
- ["A38A",0xE5CF],
- ["A38B",0xE5D0],
- ["A38C",0xE5D1],
- ["A38D",0xE5D2],
- ["A38E",0xE5D3],
- ["A38F",0xE5D4],
- ["A390",0xE5D5],
- ["A391",0xE5D6],
- ["A392",0xE5D7],
- ["A393",0xE5D8],
- ["A394",0xE5D9],
- ["A395",0xE5DA],
- ["A396",0xE5DB],
- ["A397",0xE5DC],
- ["A398",0xE5DD],
- ["A399",0xE5DE],
- ["A39A",0xE5DF],
- ["A39B",0xE5E0],
- ["A39C",0xE5E1],
- ["A39D",0xE5E2],
- ["A39E",0xE5E3],
- ["A39F",0xE5E4],
- ["A3A0",0xE5E5],
- ["A440",0xE5E6],
- ["A441",0xE5E7],
- ["A442",0xE5E8],
- ["A443",0xE5E9],
- ["A444",0xE5EA],
- ["A445",0xE5EB],
- ["A446",0xE5EC],
- ["A447",0xE5ED],
- ["A448",0xE5EE],
- ["A449",0xE5EF],
- ["A44A",0xE5F0],
- ["A44B",0xE5F1],
- ["A44C",0xE5F2],
- ["A44D",0xE5F3],
- ["A44E",0xE5F4],
- ["A44F",0xE5F5],
- ["A450",0xE5F6],
- ["A451",0xE5F7],
- ["A452",0xE5F8],
- ["A453",0xE5F9],
- ["A454",0xE5FA],
- ["A455",0xE5FB],
- ["A456",0xE5FC],
- ["A457",0xE5FD],
- ["A458",0xE5FE],
- ["A459",0xE5FF],
- ["A45A",0xE600],
- ["A45B",0xE601],
- ["A45C",0xE602],
- ["A45D",0xE603],
- ["A45E",0xE604],
- ["A45F",0xE605],
- ["A460",0xE606],
- ["A461",0xE607],
- ["A462",0xE608],
- ["A463",0xE609],
- ["A464",0xE60A],
- ["A465",0xE60B],
- ["A466",0xE60C],
- ["A467",0xE60D],
- ["A468",0xE60E],
- ["A469",0xE60F],
- ["A46A",0xE610],
- ["A46B",0xE611],
- ["A46C",0xE612],
- ["A46D",0xE613],
- ["A46E",0xE614],
- ["A46F",0xE615],
- ["A470",0xE616],
- ["A471",0xE617],
- ["A472",0xE618],
- ["A473",0xE619],
- ["A474",0xE61A],
- ["A475",0xE61B],
- ["A476",0xE61C],
- ["A477",0xE61D],
- ["A478",0xE61E],
- ["A479",0xE61F],
- ["A47A",0xE620],
- ["A47B",0xE621],
- ["A47C",0xE622],
- ["A47D",0xE623],
- ["A47E",0xE624],
- ["A480",0xE625],
- ["A481",0xE626],
- ["A482",0xE627],
- ["A483",0xE628],
- ["A484",0xE629],
- ["A485",0xE62A],
- ["A486",0xE62B],
- ["A487",0xE62C],
- ["A488",0xE62D],
- ["A489",0xE62E],
- ["A48A",0xE62F],
- ["A48B",0xE630],
- ["A48C",0xE631],
- ["A48D",0xE632],
- ["A48E",0xE633],
- ["A48F",0xE634],
- ["A490",0xE635],
- ["A491",0xE636],
- ["A492",0xE637],
- ["A493",0xE638],
- ["A494",0xE639],
- ["A495",0xE63A],
- ["A496",0xE63B],
- ["A497",0xE63C],
- ["A498",0xE63D],
- ["A499",0xE63E],
- ["A49A",0xE63F],
- ["A49B",0xE640],
- ["A49C",0xE641],
- ["A49D",0xE642],
- ["A49E",0xE643],
- ["A49F",0xE644],
- ["A4A0",0xE645],
- ["A540",0xE646],
- ["A541",0xE647],
- ["A542",0xE648],
- ["A543",0xE649],
- ["A544",0xE64A],
- ["A545",0xE64B],
- ["A546",0xE64C],
- ["A547",0xE64D],
- ["A548",0xE64E],
- ["A549",0xE64F],
- ["A54A",0xE650],
- ["A54B",0xE651],
- ["A54C",0xE652],
- ["A54D",0xE653],
- ["A54E",0xE654],
- ["A54F",0xE655],
- ["A550",0xE656],
- ["A551",0xE657],
- ["A552",0xE658],
- ["A553",0xE659],
- ["A554",0xE65A],
- ["A555",0xE65B],
- ["A556",0xE65C],
- ["A557",0xE65D],
- ["A558",0xE65E],
- ["A559",0xE65F],
- ["A55A",0xE660],
- ["A55B",0xE661],
- ["A55C",0xE662],
- ["A55D",0xE663],
- ["A55E",0xE664],
- ["A55F",0xE665],
- ["A560",0xE666],
- ["A561",0xE667],
- ["A562",0xE668],
- ["A563",0xE669],
- ["A564",0xE66A],
- ["A565",0xE66B],
- ["A566",0xE66C],
- ["A567",0xE66D],
- ["A568",0xE66E],
- ["A569",0xE66F],
- ["A56A",0xE670],
- ["A56B",0xE671],
- ["A56C",0xE672],
- ["A56D",0xE673],
- ["A56E",0xE674],
- ["A56F",0xE675],
- ["A570",0xE676],
- ["A571",0xE677],
- ["A572",0xE678],
- ["A573",0xE679],
- ["A574",0xE67A],
- ["A575",0xE67B],
- ["A576",0xE67C],
- ["A577",0xE67D],
- ["A578",0xE67E],
- ["A579",0xE67F],
- ["A57A",0xE680],
- ["A57B",0xE681],
- ["A57C",0xE682],
- ["A57D",0xE683],
- ["A57E",0xE684],
- ["A580",0xE685],
- ["A581",0xE686],
- ["A582",0xE687],
- ["A583",0xE688],
- ["A584",0xE689],
- ["A585",0xE68A],
- ["A586",0xE68B],
- ["A587",0xE68C],
- ["A588",0xE68D],
- ["A589",0xE68E],
- ["A58A",0xE68F],
- ["A58B",0xE690],
- ["A58C",0xE691],
- ["A58D",0xE692],
- ["A58E",0xE693],
- ["A58F",0xE694],
- ["A590",0xE695],
- ["A591",0xE696],
- ["A592",0xE697],
- ["A593",0xE698],
- ["A594",0xE699],
- ["A595",0xE69A],
- ["A596",0xE69B],
- ["A597",0xE69C],
- ["A598",0xE69D],
- ["A599",0xE69E],
- ["A59A",0xE69F],
- ["A59B",0xE6A0],
- ["A59C",0xE6A1],
- ["A59D",0xE6A2],
- ["A59E",0xE6A3],
- ["A59F",0xE6A4],
- ["A5A0",0xE6A5],
- ["A640",0xE6A6],
- ["A641",0xE6A7],
- ["A642",0xE6A8],
- ["A643",0xE6A9],
- ["A644",0xE6AA],
- ["A645",0xE6AB],
- ["A646",0xE6AC],
- ["A647",0xE6AD],
- ["A648",0xE6AE],
- ["A649",0xE6AF],
- ["A64A",0xE6B0],
- ["A64B",0xE6B1],
- ["A64C",0xE6B2],
- ["A64D",0xE6B3],
- ["A64E",0xE6B4],
- ["A64F",0xE6B5],
- ["A650",0xE6B6],
- ["A651",0xE6B7],
- ["A652",0xE6B8],
- ["A653",0xE6B9],
- ["A654",0xE6BA],
- ["A655",0xE6BB],
- ["A656",0xE6BC],
- ["A657",0xE6BD],
- ["A658",0xE6BE],
- ["A659",0xE6BF],
- ["A65A",0xE6C0],
- ["A65B",0xE6C1],
- ["A65C",0xE6C2],
- ["A65D",0xE6C3],
- ["A65E",0xE6C4],
- ["A65F",0xE6C5],
- ["A660",0xE6C6],
- ["A661",0xE6C7],
- ["A662",0xE6C8],
- ["A663",0xE6C9],
- ["A664",0xE6CA],
- ["A665",0xE6CB],
- ["A666",0xE6CC],
- ["A667",0xE6CD],
- ["A668",0xE6CE],
- ["A669",0xE6CF],
- ["A66A",0xE6D0],
- ["A66B",0xE6D1],
- ["A66C",0xE6D2],
- ["A66D",0xE6D3],
- ["A66E",0xE6D4],
- ["A66F",0xE6D5],
- ["A670",0xE6D6],
- ["A671",0xE6D7],
- ["A672",0xE6D8],
- ["A673",0xE6D9],
- ["A674",0xE6DA],
- ["A675",0xE6DB],
- ["A676",0xE6DC],
- ["A677",0xE6DD],
- ["A678",0xE6DE],
- ["A679",0xE6DF],
- ["A67A",0xE6E0],
- ["A67B",0xE6E1],
- ["A67C",0xE6E2],
- ["A67D",0xE6E3],
- ["A67E",0xE6E4],
- ["A680",0xE6E5],
- ["A681",0xE6E6],
- ["A682",0xE6E7],
- ["A683",0xE6E8],
- ["A684",0xE6E9],
- ["A685",0xE6EA],
- ["A686",0xE6EB],
- ["A687",0xE6EC],
- ["A688",0xE6ED],
- ["A689",0xE6EE],
- ["A68A",0xE6EF],
- ["A68B",0xE6F0],
- ["A68C",0xE6F1],
- ["A68D",0xE6F2],
- ["A68E",0xE6F3],
- ["A68F",0xE6F4],
- ["A690",0xE6F5],
- ["A691",0xE6F6],
- ["A692",0xE6F7],
- ["A693",0xE6F8],
- ["A694",0xE6F9],
- ["A695",0xE6FA],
- ["A696",0xE6FB],
- ["A697",0xE6FC],
- ["A698",0xE6FD],
- ["A699",0xE6FE],
- ["A69A",0xE6FF],
- ["A69B",0xE700],
- ["A69C",0xE701],
- ["A69D",0xE702],
- ["A69E",0xE703],
- ["A69F",0xE704],
- ["A6A0",0xE705],
- ["A740",0xE706],
- ["A741",0xE707],
- ["A742",0xE708],
- ["A743",0xE709],
- ["A744",0xE70A],
- ["A745",0xE70B],
- ["A746",0xE70C],
- ["A747",0xE70D],
- ["A748",0xE70E],
- ["A749",0xE70F],
- ["A74A",0xE710],
- ["A74B",0xE711],
- ["A74C",0xE712],
- ["A74D",0xE713],
- ["A74E",0xE714],
- ["A74F",0xE715],
- ["A750",0xE716],
- ["A751",0xE717],
- ["A752",0xE718],
- ["A753",0xE719],
- ["A754",0xE71A],
- ["A755",0xE71B],
- ["A756",0xE71C],
- ["A757",0xE71D],
- ["A758",0xE71E],
- ["A759",0xE71F],
- ["A75A",0xE720],
- ["A75B",0xE721],
- ["A75C",0xE722],
- ["A75D",0xE723],
- ["A75E",0xE724],
- ["A75F",0xE725],
- ["A760",0xE726],
- ["A761",0xE727],
- ["A762",0xE728],
- ["A763",0xE729],
- ["A764",0xE72A],
- ["A765",0xE72B],
- ["A766",0xE72C],
- ["A767",0xE72D],
- ["A768",0xE72E],
- ["A769",0xE72F],
- ["A76A",0xE730],
- ["A76B",0xE731],
- ["A76C",0xE732],
- ["A76D",0xE733],
- ["A76E",0xE734],
- ["A76F",0xE735],
- ["A770",0xE736],
- ["A771",0xE737],
- ["A772",0xE738],
- ["A773",0xE739],
- ["A774",0xE73A],
- ["A775",0xE73B],
- ["A776",0xE73C],
- ["A777",0xE73D],
- ["A778",0xE73E],
- ["A779",0xE73F],
- ["A77A",0xE740],
- ["A77B",0xE741],
- ["A77C",0xE742],
- ["A77D",0xE743],
- ["A77E",0xE744],
- ["A780",0xE745],
- ["A781",0xE746],
- ["A782",0xE747],
- ["A783",0xE748],
- ["A784",0xE749],
- ["A785",0xE74A],
- ["A786",0xE74B],
- ["A787",0xE74C],
- ["A788",0xE74D],
- ["A789",0xE74E],
- ["A78A",0xE74F],
- ["A78B",0xE750],
- ["A78C",0xE751],
- ["A78D",0xE752],
- ["A78E",0xE753],
- ["A78F",0xE754],
- ["A790",0xE755],
- ["A791",0xE756],
- ["A792",0xE757],
- ["A793",0xE758],
- ["A794",0xE759],
- ["A795",0xE75A],
- ["A796",0xE75B],
- ["A797",0xE75C],
- ["A798",0xE75D],
- ["A799",0xE75E],
- ["A79A",0xE75F],
- ["A79B",0xE760],
- ["A79C",0xE761],
- ["A79D",0xE762],
- ["A79E",0xE763],
- ["A79F",0xE764],
- ["A7A0",0xE765],
- ["A2AB",0xE766],
- ["A2AC",0xE767],
- ["A2AD",0xE768],
- ["A2AE",0xE769],
- ["A2AF",0xE76A],
- ["A2B0",0xE76B],
- ["8336C739",0xE76C],
- ["A2E4",0xE76D],
- ["A2EF",0xE76E],
- ["A2F0",0xE76F],
- ["A2FD",0xE770],
- ["A2FE",0xE771],
- ["A4F4",0xE772],
- ["A4F5",0xE773],
- ["A4F6",0xE774],
- ["A4F7",0xE775],
- ["A4F8",0xE776],
- ["A4F9",0xE777],
- ["A4FA",0xE778],
- ["A4FB",0xE779],
- ["A4FC",0xE77A],
- ["A4FD",0xE77B],
- ["A4FE",0xE77C],
- ["A5F7",0xE77D],
- ["A5F8",0xE77E],
- ["A5F9",0xE77F],
- ["A5FA",0xE780],
- ["A5FB",0xE781],
- ["A5FC",0xE782],
- ["A5FD",0xE783],
- ["A5FE",0xE784],
- ["A6B9",0xE785],
- ["A6BA",0xE786],
- ["A6BB",0xE787],
- ["A6BC",0xE788],
- ["A6BD",0xE789],
- ["A6BE",0xE78A],
- ["A6BF",0xE78B],
- ["A6C0",0xE78C],
- ["A6D9",0xE78D],
- ["A6DA",0xE78E],
- ["A6DB",0xE78F],
- ["A6DC",0xE790],
- ["A6DD",0xE791],
- ["A6DE",0xE792],
- ["A6DF",0xE793],
- ["A6EC",0xE794],
- ["A6ED",0xE795],
- ["A6F3",0xE796],
- ["A6F6",0xE797],
- ["A6F7",0xE798],
- ["A6F8",0xE799],
- ["A6F9",0xE79A],
- ["A6FA",0xE79B],
- ["A6FB",0xE79C],
- ["A6FC",0xE79D],
- ["A6FD",0xE79E],
- ["A6FE",0xE79F],
- ["A7C2",0xE7A0],
- ["A7C3",0xE7A1],
- ["A7C4",0xE7A2],
- ["A7C5",0xE7A3],
- ["A7C6",0xE7A4],
- ["A7C7",0xE7A5],
- ["A7C8",0xE7A6],
- ["A7C9",0xE7A7],
- ["A7CA",0xE7A8],
- ["A7CB",0xE7A9],
- ["A7CC",0xE7AA],
- ["A7CD",0xE7AB],
- ["A7CE",0xE7AC],
- ["A7CF",0xE7AD],
- ["A7D0",0xE7AE],
- ["A7F2",0xE7AF],
- ["A7F3",0xE7B0],
- ["A7F4",0xE7B1],
- ["A7F5",0xE7B2],
- ["A7F6",0xE7B3],
- ["A7F7",0xE7B4],
- ["A7F8",0xE7B5],
- ["A7F9",0xE7B6],
- ["A7FA",0xE7B7],
- ["A7FB",0xE7B8],
- ["A7FC",0xE7B9],
- ["A7FD",0xE7BA],
- ["A7FE",0xE7BB],
- ["A896",0xE7BC],
- ["A897",0xE7BD],
- ["A898",0xE7BE],
- ["A899",0xE7BF],
- ["A89A",0xE7C0],
- ["A89B",0xE7C1],
- ["A89C",0xE7C2],
- ["A89D",0xE7C3],
- ["A89E",0xE7C4],
- ["A89F",0xE7C5],
- ["A8A0",0xE7C6],
- ["A8BC",0xE7C7],
- ["8336C830",0xE7C8],
- ["A8C1",0xE7C9],
- ["A8C2",0xE7CA],
- ["A8C3",0xE7CB],
- ["A8C4",0xE7CC],
- ["A8EA",0xE7CD],
- ["A8EB",0xE7CE],
- ["A8EC",0xE7CF],
- ["A8ED",0xE7D0],
- ["A8EE",0xE7D1],
- ["A8EF",0xE7D2],
- ["A8F0",0xE7D3],
- ["A8F1",0xE7D4],
- ["A8F2",0xE7D5],
- ["A8F3",0xE7D6],
- ["A8F4",0xE7D7],
- ["A8F5",0xE7D8],
- ["A8F6",0xE7D9],
- ["A8F7",0xE7DA],
- ["A8F8",0xE7DB],
- ["A8F9",0xE7DC],
- ["A8FA",0xE7DD],
- ["A8FB",0xE7DE],
- ["A8FC",0xE7DF],
- ["A8FD",0xE7E0],
- ["A8FE",0xE7E1],
- ["A958",0xE7E2],
- ["A95B",0xE7E3],
- ["A95D",0xE7E4],
- ["A95E",0xE7E5],
- ["A95F",0xE7E6],
- ["8336C831",0xE7E7],
- ["8336C832",0xE7E8],
- ["8336C833",0xE7E9],
- ["8336C834",0xE7EA],
- ["8336C835",0xE7EB],
- ["8336C836",0xE7EC],
- ["8336C837",0xE7ED],
- ["8336C838",0xE7EE],
- ["8336C839",0xE7EF],
- ["8336C930",0xE7F0],
- ["8336C931",0xE7F1],
- ["8336C932",0xE7F2],
- ["8336C933",0xE7F3],
- ["A997",0xE7F4],
- ["A998",0xE7F5],
- ["A999",0xE7F6],
- ["A99A",0xE7F7],
- ["A99B",0xE7F8],
- ["A99C",0xE7F9],
- ["A99D",0xE7FA],
- ["A99E",0xE7FB],
- ["A99F",0xE7FC],
- ["A9A0",0xE7FD],
- ["A9A1",0xE7FE],
- ["A9A2",0xE7FF],
- ["A9A3",0xE800],
- ["A9F0",0xE801],
- ["A9F1",0xE802],
- ["A9F2",0xE803],
- ["A9F3",0xE804],
- ["A9F4",0xE805],
- ["A9F5",0xE806],
- ["A9F6",0xE807],
- ["A9F7",0xE808],
- ["A9F8",0xE809],
- ["A9F9",0xE80A],
- ["A9FA",0xE80B],
- ["A9FB",0xE80C],
- ["A9FC",0xE80D],
- ["A9FD",0xE80E],
- ["A9FE",0xE80F],
- ["D7FA",0xE810],
- ["D7FB",0xE811],
- ["D7FC",0xE812],
- ["D7FD",0xE813],
- ["D7FE",0xE814],
- ["8336C934",0xE815],
- ["FE51",0xE816],
- ["FE52",0xE817],
- ["FE53",0xE818],
- ["8336C935",0xE819],
- ["8336C936",0xE81A],
- ["8336C937",0xE81B],
- ["8336C938",0xE81C],
- ["8336C939",0xE81D],
- ["FE59",0xE81E],
- ["8336CA30",0xE81F],
- ["8336CA31",0xE820],
- ["8336CA32",0xE821],
- ["8336CA33",0xE822],
- ["8336CA34",0xE823],
- ["8336CA35",0xE824],
- ["8336CA36",0xE825],
- ["FE61",0xE826],
- ["8336CA37",0xE827],
- ["8336CA38",0xE828],
- ["8336CA39",0xE829],
- ["8336CB30",0xE82A],
- ["FE66",0xE82B],
- ["FE67",0xE82C],
- ["8336CB31",0xE82D],
- ["8336CB32",0xE82E],
- ["8336CB33",0xE82F],
- ["8336CB34",0xE830],
- ["FE6C",0xE831],
- ["FE6D",0xE832],
- ["8336CB35",0xE833],
- ["8336CB36",0xE834],
- ["8336CB37",0xE835],
- ["8336CB38",0xE836],
- ["8336CB39",0xE837],
- ["8336CC30",0xE838],
- ["8336CC31",0xE839],
- ["8336CC32",0xE83A],
- ["FE76",0xE83B],
- ["8336CC33",0xE83C],
- ["8336CC34",0xE83D],
- ["8336CC35",0xE83E],
- ["8336CC36",0xE83F],
- ["8336CC37",0xE840],
- ["8336CC38",0xE841],
- ["8336CC39",0xE842],
- ["FE7E",0xE843],
- ["8336CD30",0xE844],
- ["8336CD31",0xE845],
- ["8336CD32",0xE846],
- ["8336CD33",0xE847],
- ["8336CD34",0xE848],
- ["8336CD35",0xE849],
- ["8336CD36",0xE84A],
- ["8336CD37",0xE84B],
- ["8336CD38",0xE84C],
- ["8336CD39",0xE84D],
- ["8336CE30",0xE84E],
- ["8336CE31",0xE84F],
- ["8336CE32",0xE850],
- ["8336CE33",0xE851],
- ["8336CE34",0xE852],
- ["8336CE35",0xE853],
- ["FE90",0xE854],
- ["FE91",0xE855],
- ["8336CE36",0xE856],
- ["8336CE37",0xE857],
- ["8336CE38",0xE858],
- ["8336CE39",0xE859],
- ["8336CF30",0xE85A],
- ["8336CF31",0xE85B],
- ["8336CF32",0xE85C],
- ["8336CF33",0xE85D],
- ["8336CF34",0xE85E],
- ["8336CF35",0xE85F],
- ["8336CF36",0xE860],
- ["8336CF37",0xE861],
- ["8336CF38",0xE862],
- ["8336CF39",0xE863],
- ["FEA0",0xE864],
- ["8336D030",0xE865],
- ["8336D031",0xE866],
- ["8336D032",0xE867],
- ["8336D033",0xE868],
- ["8336D034",0xE869],
- ["8336D035",0xE86A],
- ["8336D036",0xE86B],
- ["8336D037",0xE86C],
- ["8336D038",0xE86D],
- ["8336D039",0xE86E],
- ["8336D130",0xE86F],
- ["8336D131",0xE870],
- ["8336D132",0xE871],
- ["8336D133",0xE872],
- ["8336D134",0xE873],
- ["8336D135",0xE874],
- ["8336D136",0xE875],
- ["8336D137",0xE876],
- ["8336D138",0xE877],
- ["8336D139",0xE878],
- ["8336D230",0xE879],
- ["8336D231",0xE87A],
- ["8336D232",0xE87B],
- ["8336D233",0xE87C],
- ["8336D234",0xE87D],
- ["8336D235",0xE87E],
- ["8336D236",0xE87F],
- ["8336D237",0xE880],
- ["8336D238",0xE881],
- ["8336D239",0xE882],
- ["8336D330",0xE883],
- ["8336D331",0xE884],
- ["8336D332",0xE885],
- ["8336D333",0xE886],
- ["8336D334",0xE887],
- ["8336D335",0xE888],
- ["8336D336",0xE889],
- ["8336D337",0xE88A],
- ["8336D338",0xE88B],
- ["8336D339",0xE88C],
- ["8336D430",0xE88D],
- ["8336D431",0xE88E],
- ["8336D432",0xE88F],
- ["8336D433",0xE890],
- ["8336D434",0xE891],
- ["8336D435",0xE892],
- ["8336D436",0xE893],
- ["8336D437",0xE894],
- ["8336D438",0xE895],
- ["8336D439",0xE896],
- ["8336D530",0xE897],
- ["8336D531",0xE898],
- ["8336D532",0xE899],
- ["8336D533",0xE89A],
- ["8336D534",0xE89B],
- ["8336D535",0xE89C],
- ["8336D536",0xE89D],
- ["8336D537",0xE89E],
- ["8336D538",0xE89F],
- ["8336D539",0xE8A0],
- ["8336D630",0xE8A1],
- ["8336D631",0xE8A2],
- ["8336D632",0xE8A3],
- ["8336D633",0xE8A4],
- ["8336D634",0xE8A5],
- ["8336D635",0xE8A6],
- ["8336D636",0xE8A7],
- ["8336D637",0xE8A8],
- ["8336D638",0xE8A9],
- ["8336D639",0xE8AA],
- ["8336D730",0xE8AB],
- ["8336D731",0xE8AC],
- ["8336D732",0xE8AD],
- ["8336D733",0xE8AE],
- ["8336D734",0xE8AF],
- ["8336D735",0xE8B0],
- ["8336D736",0xE8B1],
- ["8336D737",0xE8B2],
- ["8336D738",0xE8B3],
- ["8336D739",0xE8B4],
- ["8336D830",0xE8B5],
- ["8336D831",0xE8B6],
- ["8336D832",0xE8B7],
- ["8336D833",0xE8B8],
- ["8336D834",0xE8B9],
- ["8336D835",0xE8BA],
- ["8336D836",0xE8BB],
- ["8336D837",0xE8BC],
- ["8336D838",0xE8BD],
- ["8336D839",0xE8BE],
- ["8336D930",0xE8BF],
- ["8336D931",0xE8C0],
- ["8336D932",0xE8C1],
- ["8336D933",0xE8C2],
- ["8336D934",0xE8C3],
- ["8336D935",0xE8C4],
- ["8336D936",0xE8C5],
- ["8336D937",0xE8C6],
- ["8336D938",0xE8C7],
- ["8336D939",0xE8C8],
- ["8336DA30",0xE8C9],
- ["8336DA31",0xE8CA],
- ["8336DA32",0xE8CB],
- ["8336DA33",0xE8CC],
- ["8336DA34",0xE8CD],
- ["8336DA35",0xE8CE],
- ["8336DA36",0xE8CF],
- ["8336DA37",0xE8D0],
- ["8336DA38",0xE8D1],
- ["8336DA39",0xE8D2],
- ["8336DB30",0xE8D3],
- ["8336DB31",0xE8D4],
- ["8336DB32",0xE8D5],
- ["8336DB33",0xE8D6],
- ["8336DB34",0xE8D7],
- ["8336DB35",0xE8D8],
- ["8336DB36",0xE8D9],
- ["8336DB37",0xE8DA],
- ["8336DB38",0xE8DB],
- ["8336DB39",0xE8DC],
- ["8336DC30",0xE8DD],
- ["8336DC31",0xE8DE],
- ["8336DC32",0xE8DF],
- ["8336DC33",0xE8E0],
- ["8336DC34",0xE8E1],
- ["8336DC35",0xE8E2],
- ["8336DC36",0xE8E3],
- ["8336DC37",0xE8E4],
- ["8336DC38",0xE8E5],
- ["8336DC39",0xE8E6],
- ["8336DD30",0xE8E7],
- ["8336DD31",0xE8E8],
- ["8336DD32",0xE8E9],
- ["8336DD33",0xE8EA],
- ["8336DD34",0xE8EB],
- ["8336DD35",0xE8EC],
- ["8336DD36",0xE8ED],
- ["8336DD37",0xE8EE],
- ["8336DD38",0xE8EF],
- ["8336DD39",0xE8F0],
- ["8336DE30",0xE8F1],
- ["8336DE31",0xE8F2],
- ["8336DE32",0xE8F3],
- ["8336DE33",0xE8F4],
- ["8336DE34",0xE8F5],
- ["8336DE35",0xE8F6],
- ["8336DE36",0xE8F7],
- ["8336DE37",0xE8F8],
- ["8336DE38",0xE8F9],
- ["8336DE39",0xE8FA],
- ["8336DF30",0xE8FB],
- ["8336DF31",0xE8FC],
- ["8336DF32",0xE8FD],
- ["8336DF33",0xE8FE],
- ["8336DF34",0xE8FF],
- ["8336DF35",0xE900],
- ["8336DF36",0xE901],
- ["8336DF37",0xE902],
- ["8336DF38",0xE903],
- ["8336DF39",0xE904],
- ["8336E030",0xE905],
- ["8336E031",0xE906],
- ["8336E032",0xE907],
- ["8336E033",0xE908],
- ["8336E034",0xE909],
- ["8336E035",0xE90A],
- ["8336E036",0xE90B],
- ["8336E037",0xE90C],
- ["8336E038",0xE90D],
- ["8336E039",0xE90E],
- ["8336E130",0xE90F],
- ["8336E131",0xE910],
- ["8336E132",0xE911],
- ["8336E133",0xE912],
- ["8336E134",0xE913],
- ["8336E135",0xE914],
- ["8336E136",0xE915],
- ["8336E137",0xE916],
- ["8336E138",0xE917],
- ["8336E139",0xE918],
- ["8336E230",0xE919],
- ["8336E231",0xE91A],
- ["8336E232",0xE91B],
- ["8336E233",0xE91C],
- ["8336E234",0xE91D],
- ["8336E235",0xE91E],
- ["8336E236",0xE91F],
- ["8336E237",0xE920],
- ["8336E238",0xE921],
- ["8336E239",0xE922],
- ["8336E330",0xE923],
- ["8336E331",0xE924],
- ["8336E332",0xE925],
- ["8336E333",0xE926],
- ["8336E334",0xE927],
- ["8336E335",0xE928],
- ["8336E336",0xE929],
- ["8336E337",0xE92A],
- ["8336E338",0xE92B],
- ["8336E339",0xE92C],
- ["8336E430",0xE92D],
- ["8336E431",0xE92E],
- ["8336E432",0xE92F],
- ["8336E433",0xE930],
- ["8336E434",0xE931],
- ["8336E435",0xE932],
- ["8336E436",0xE933],
- ["8336E437",0xE934],
- ["8336E438",0xE935],
- ["8336E439",0xE936],
- ["8336E530",0xE937],
- ["8336E531",0xE938],
- ["8336E532",0xE939],
- ["8336E533",0xE93A],
- ["8336E534",0xE93B],
- ["8336E535",0xE93C],
- ["8336E536",0xE93D],
- ["8336E537",0xE93E],
- ["8336E538",0xE93F],
- ["8336E539",0xE940],
- ["8336E630",0xE941],
- ["8336E631",0xE942],
- ["8336E632",0xE943],
- ["8336E633",0xE944],
- ["8336E634",0xE945],
- ["8336E635",0xE946],
- ["8336E636",0xE947],
- ["8336E637",0xE948],
- ["8336E638",0xE949],
- ["8336E639",0xE94A],
- ["8336E730",0xE94B],
- ["8336E731",0xE94C],
- ["8336E732",0xE94D],
- ["8336E733",0xE94E],
- ["8336E734",0xE94F],
- ["8336E735",0xE950],
- ["8336E736",0xE951],
- ["8336E737",0xE952],
- ["8336E738",0xE953],
- ["8336E739",0xE954],
- ["8336E830",0xE955],
- ["8336E831",0xE956],
- ["8336E832",0xE957],
- ["8336E833",0xE958],
- ["8336E834",0xE959],
- ["8336E835",0xE95A],
- ["8336E836",0xE95B],
- ["8336E837",0xE95C],
- ["8336E838",0xE95D],
- ["8336E839",0xE95E],
- ["8336E930",0xE95F],
- ["8336E931",0xE960],
- ["8336E932",0xE961],
- ["8336E933",0xE962],
- ["8336E934",0xE963],
- ["8336E935",0xE964],
- ["8336E936",0xE965],
- ["8336E937",0xE966],
- ["8336E938",0xE967],
- ["8336E939",0xE968],
- ["8336EA30",0xE969],
- ["8336EA31",0xE96A],
- ["8336EA32",0xE96B],
- ["8336EA33",0xE96C],
- ["8336EA34",0xE96D],
- ["8336EA35",0xE96E],
- ["8336EA36",0xE96F],
- ["8336EA37",0xE970],
- ["8336EA38",0xE971],
- ["8336EA39",0xE972],
- ["8336EB30",0xE973],
- ["8336EB31",0xE974],
- ["8336EB32",0xE975],
- ["8336EB33",0xE976],
- ["8336EB34",0xE977],
- ["8336EB35",0xE978],
- ["8336EB36",0xE979],
- ["8336EB37",0xE97A],
- ["8336EB38",0xE97B],
- ["8336EB39",0xE97C],
- ["8336EC30",0xE97D],
- ["8336EC31",0xE97E],
- ["8336EC32",0xE97F],
- ["8336EC33",0xE980],
- ["8336EC34",0xE981],
- ["8336EC35",0xE982],
- ["8336EC36",0xE983],
- ["8336EC37",0xE984],
- ["8336EC38",0xE985],
- ["8336EC39",0xE986],
- ["8336ED30",0xE987],
- ["8336ED31",0xE988],
- ["8336ED32",0xE989],
- ["8336ED33",0xE98A],
- ["8336ED34",0xE98B],
- ["8336ED35",0xE98C],
- ["8336ED36",0xE98D],
- ["8336ED37",0xE98E],
- ["8336ED38",0xE98F],
- ["8336ED39",0xE990],
- ["8336EE30",0xE991],
- ["8336EE31",0xE992],
- ["8336EE32",0xE993],
- ["8336EE33",0xE994],
- ["8336EE34",0xE995],
- ["8336EE35",0xE996],
- ["8336EE36",0xE997],
- ["8336EE37",0xE998],
- ["8336EE38",0xE999],
- ["8336EE39",0xE99A],
- ["8336EF30",0xE99B],
- ["8336EF31",0xE99C],
- ["8336EF32",0xE99D],
- ["8336EF33",0xE99E],
- ["8336EF34",0xE99F],
- ["8336EF35",0xE9A0],
- ["8336EF36",0xE9A1],
- ["8336EF37",0xE9A2],
- ["8336EF38",0xE9A3],
- ["8336EF39",0xE9A4],
- ["8336F030",0xE9A5],
- ["8336F031",0xE9A6],
- ["8336F032",0xE9A7],
- ["8336F033",0xE9A8],
- ["8336F034",0xE9A9],
- ["8336F035",0xE9AA],
- ["8336F036",0xE9AB],
- ["8336F037",0xE9AC],
- ["8336F038",0xE9AD],
- ["8336F039",0xE9AE],
- ["8336F130",0xE9AF],
- ["8336F131",0xE9B0],
- ["8336F132",0xE9B1],
- ["8336F133",0xE9B2],
- ["8336F134",0xE9B3],
- ["8336F135",0xE9B4],
- ["8336F136",0xE9B5],
- ["8336F137",0xE9B6],
- ["8336F138",0xE9B7],
- ["8336F139",0xE9B8],
- ["8336F230",0xE9B9],
- ["8336F231",0xE9BA],
- ["8336F232",0xE9BB],
- ["8336F233",0xE9BC],
- ["8336F234",0xE9BD],
- ["8336F235",0xE9BE],
- ["8336F236",0xE9BF],
- ["8336F237",0xE9C0],
- ["8336F238",0xE9C1],
- ["8336F239",0xE9C2],
- ["8336F330",0xE9C3],
- ["8336F331",0xE9C4],
- ["8336F332",0xE9C5],
- ["8336F333",0xE9C6],
- ["8336F334",0xE9C7],
- ["8336F335",0xE9C8],
- ["8336F336",0xE9C9],
- ["8336F337",0xE9CA],
- ["8336F338",0xE9CB],
- ["8336F339",0xE9CC],
- ["8336F430",0xE9CD],
- ["8336F431",0xE9CE],
- ["8336F432",0xE9CF],
- ["8336F433",0xE9D0],
- ["8336F434",0xE9D1],
- ["8336F435",0xE9D2],
- ["8336F436",0xE9D3],
- ["8336F437",0xE9D4],
- ["8336F438",0xE9D5],
- ["8336F439",0xE9D6],
- ["8336F530",0xE9D7],
- ["8336F531",0xE9D8],
- ["8336F532",0xE9D9],
- ["8336F533",0xE9DA],
- ["8336F534",0xE9DB],
- ["8336F535",0xE9DC],
- ["8336F536",0xE9DD],
- ["8336F537",0xE9DE],
- ["8336F538",0xE9DF],
- ["8336F539",0xE9E0],
- ["8336F630",0xE9E1],
- ["8336F631",0xE9E2],
- ["8336F632",0xE9E3],
- ["8336F633",0xE9E4],
- ["8336F634",0xE9E5],
- ["8336F635",0xE9E6],
- ["8336F636",0xE9E7],
- ["8336F637",0xE9E8],
- ["8336F638",0xE9E9],
- ["8336F639",0xE9EA],
- ["8336F730",0xE9EB],
- ["8336F731",0xE9EC],
- ["8336F732",0xE9ED],
- ["8336F733",0xE9EE],
- ["8336F734",0xE9EF],
- ["8336F735",0xE9F0],
- ["8336F736",0xE9F1],
- ["8336F737",0xE9F2],
- ["8336F738",0xE9F3],
- ["8336F739",0xE9F4],
- ["8336F830",0xE9F5],
- ["8336F831",0xE9F6],
- ["8336F832",0xE9F7],
- ["8336F833",0xE9F8],
- ["8336F834",0xE9F9],
- ["8336F835",0xE9FA],
- ["8336F836",0xE9FB],
- ["8336F837",0xE9FC],
- ["8336F838",0xE9FD],
- ["8336F839",0xE9FE],
- ["8336F930",0xE9FF],
- ["8336F931",0xEA00],
- ["8336F932",0xEA01],
- ["8336F933",0xEA02],
- ["8336F934",0xEA03],
- ["8336F935",0xEA04],
- ["8336F936",0xEA05],
- ["8336F937",0xEA06],
- ["8336F938",0xEA07],
- ["8336F939",0xEA08],
- ["8336FA30",0xEA09],
- ["8336FA31",0xEA0A],
- ["8336FA32",0xEA0B],
- ["8336FA33",0xEA0C],
- ["8336FA34",0xEA0D],
- ["8336FA35",0xEA0E],
- ["8336FA36",0xEA0F],
- ["8336FA37",0xEA10],
- ["8336FA38",0xEA11],
- ["8336FA39",0xEA12],
- ["8336FB30",0xEA13],
- ["8336FB31",0xEA14],
- ["8336FB32",0xEA15],
- ["8336FB33",0xEA16],
- ["8336FB34",0xEA17],
- ["8336FB35",0xEA18],
- ["8336FB36",0xEA19],
- ["8336FB37",0xEA1A],
- ["8336FB38",0xEA1B],
- ["8336FB39",0xEA1C],
- ["8336FC30",0xEA1D],
- ["8336FC31",0xEA1E],
- ["8336FC32",0xEA1F],
- ["8336FC33",0xEA20],
- ["8336FC34",0xEA21],
- ["8336FC35",0xEA22],
- ["8336FC36",0xEA23],
- ["8336FC37",0xEA24],
- ["8336FC38",0xEA25],
- ["8336FC39",0xEA26],
- ["8336FD30",0xEA27],
- ["8336FD31",0xEA28],
- ["8336FD32",0xEA29],
- ["8336FD33",0xEA2A],
- ["8336FD34",0xEA2B],
- ["8336FD35",0xEA2C],
- ["8336FD36",0xEA2D],
- ["8336FD37",0xEA2E],
- ["8336FD38",0xEA2F],
- ["8336FD39",0xEA30],
- ["8336FE30",0xEA31],
- ["8336FE31",0xEA32],
- ["8336FE32",0xEA33],
- ["8336FE33",0xEA34],
- ["8336FE34",0xEA35],
- ["8336FE35",0xEA36],
- ["8336FE36",0xEA37],
- ["8336FE37",0xEA38],
- ["8336FE38",0xEA39],
- ["8336FE39",0xEA3A],
- ["83378130",0xEA3B],
- ["83378131",0xEA3C],
- ["83378132",0xEA3D],
- ["83378133",0xEA3E],
- ["83378134",0xEA3F],
- ["83378135",0xEA40],
- ["83378136",0xEA41],
- ["83378137",0xEA42],
- ["83378138",0xEA43],
- ["83378139",0xEA44],
- ["83378230",0xEA45],
- ["83378231",0xEA46],
- ["83378232",0xEA47],
- ["83378233",0xEA48],
- ["83378234",0xEA49],
- ["83378235",0xEA4A],
- ["83378236",0xEA4B],
- ["83378237",0xEA4C],
- ["83378238",0xEA4D],
- ["83378239",0xEA4E],
- ["83378330",0xEA4F],
- ["83378331",0xEA50],
- ["83378332",0xEA51],
- ["83378333",0xEA52],
- ["83378334",0xEA53],
- ["83378335",0xEA54],
- ["83378336",0xEA55],
- ["83378337",0xEA56],
- ["83378338",0xEA57],
- ["83378339",0xEA58],
- ["83378430",0xEA59],
- ["83378431",0xEA5A],
- ["83378432",0xEA5B],
- ["83378433",0xEA5C],
- ["83378434",0xEA5D],
- ["83378435",0xEA5E],
- ["83378436",0xEA5F],
- ["83378437",0xEA60],
- ["83378438",0xEA61],
- ["83378439",0xEA62],
- ["83378530",0xEA63],
- ["83378531",0xEA64],
- ["83378532",0xEA65],
- ["83378533",0xEA66],
- ["83378534",0xEA67],
- ["83378535",0xEA68],
- ["83378536",0xEA69],
- ["83378537",0xEA6A],
- ["83378538",0xEA6B],
- ["83378539",0xEA6C],
- ["83378630",0xEA6D],
- ["83378631",0xEA6E],
- ["83378632",0xEA6F],
- ["83378633",0xEA70],
- ["83378634",0xEA71],
- ["83378635",0xEA72],
- ["83378636",0xEA73],
- ["83378637",0xEA74],
- ["83378638",0xEA75],
- ["83378639",0xEA76],
- ["83378730",0xEA77],
- ["83378731",0xEA78],
- ["83378732",0xEA79],
- ["83378733",0xEA7A],
- ["83378734",0xEA7B],
- ["83378735",0xEA7C],
- ["83378736",0xEA7D],
- ["83378737",0xEA7E],
- ["83378738",0xEA7F],
- ["83378739",0xEA80],
- ["83378830",0xEA81],
- ["83378831",0xEA82],
- ["83378832",0xEA83],
- ["83378833",0xEA84],
- ["83378834",0xEA85],
- ["83378835",0xEA86],
- ["83378836",0xEA87],
- ["83378837",0xEA88],
- ["83378838",0xEA89],
- ["83378839",0xEA8A],
- ["83378930",0xEA8B],
- ["83378931",0xEA8C],
- ["83378932",0xEA8D],
- ["83378933",0xEA8E],
- ["83378934",0xEA8F],
- ["83378935",0xEA90],
- ["83378936",0xEA91],
- ["83378937",0xEA92],
- ["83378938",0xEA93],
- ["83378939",0xEA94],
- ["83378A30",0xEA95],
- ["83378A31",0xEA96],
- ["83378A32",0xEA97],
- ["83378A33",0xEA98],
- ["83378A34",0xEA99],
- ["83378A35",0xEA9A],
- ["83378A36",0xEA9B],
- ["83378A37",0xEA9C],
- ["83378A38",0xEA9D],
- ["83378A39",0xEA9E],
- ["83378B30",0xEA9F],
- ["83378B31",0xEAA0],
- ["83378B32",0xEAA1],
- ["83378B33",0xEAA2],
- ["83378B34",0xEAA3],
- ["83378B35",0xEAA4],
- ["83378B36",0xEAA5],
- ["83378B37",0xEAA6],
- ["83378B38",0xEAA7],
- ["83378B39",0xEAA8],
- ["83378C30",0xEAA9],
- ["83378C31",0xEAAA],
- ["83378C32",0xEAAB],
- ["83378C33",0xEAAC],
- ["83378C34",0xEAAD],
- ["83378C35",0xEAAE],
- ["83378C36",0xEAAF],
- ["83378C37",0xEAB0],
- ["83378C38",0xEAB1],
- ["83378C39",0xEAB2],
- ["83378D30",0xEAB3],
- ["83378D31",0xEAB4],
- ["83378D32",0xEAB5],
- ["83378D33",0xEAB6],
- ["83378D34",0xEAB7],
- ["83378D35",0xEAB8],
- ["83378D36",0xEAB9],
- ["83378D37",0xEABA],
- ["83378D38",0xEABB],
- ["83378D39",0xEABC],
- ["83378E30",0xEABD],
- ["83378E31",0xEABE],
- ["83378E32",0xEABF],
- ["83378E33",0xEAC0],
- ["83378E34",0xEAC1],
- ["83378E35",0xEAC2],
- ["83378E36",0xEAC3],
- ["83378E37",0xEAC4],
- ["83378E38",0xEAC5],
- ["83378E39",0xEAC6],
- ["83378F30",0xEAC7],
- ["83378F31",0xEAC8],
- ["83378F32",0xEAC9],
- ["83378F33",0xEACA],
- ["83378F34",0xEACB],
- ["83378F35",0xEACC],
- ["83378F36",0xEACD],
- ["83378F37",0xEACE],
- ["83378F38",0xEACF],
- ["83378F39",0xEAD0],
- ["83379030",0xEAD1],
- ["83379031",0xEAD2],
- ["83379032",0xEAD3],
- ["83379033",0xEAD4],
- ["83379034",0xEAD5],
- ["83379035",0xEAD6],
- ["83379036",0xEAD7],
- ["83379037",0xEAD8],
- ["83379038",0xEAD9],
- ["83379039",0xEADA],
- ["83379130",0xEADB],
- ["83379131",0xEADC],
- ["83379132",0xEADD],
- ["83379133",0xEADE],
- ["83379134",0xEADF],
- ["83379135",0xEAE0],
- ["83379136",0xEAE1],
- ["83379137",0xEAE2],
- ["83379138",0xEAE3],
- ["83379139",0xEAE4],
- ["83379230",0xEAE5],
- ["83379231",0xEAE6],
- ["83379232",0xEAE7],
- ["83379233",0xEAE8],
- ["83379234",0xEAE9],
- ["83379235",0xEAEA],
- ["83379236",0xEAEB],
- ["83379237",0xEAEC],
- ["83379238",0xEAED],
- ["83379239",0xEAEE],
- ["83379330",0xEAEF],
- ["83379331",0xEAF0],
- ["83379332",0xEAF1],
- ["83379333",0xEAF2],
- ["83379334",0xEAF3],
- ["83379335",0xEAF4],
- ["83379336",0xEAF5],
- ["83379337",0xEAF6],
- ["83379338",0xEAF7],
- ["83379339",0xEAF8],
- ["83379430",0xEAF9],
- ["83379431",0xEAFA],
- ["83379432",0xEAFB],
- ["83379433",0xEAFC],
- ["83379434",0xEAFD],
- ["83379435",0xEAFE],
- ["83379436",0xEAFF],
- ["83379437",0xEB00],
- ["83379438",0xEB01],
- ["83379439",0xEB02],
- ["83379530",0xEB03],
- ["83379531",0xEB04],
- ["83379532",0xEB05],
- ["83379533",0xEB06],
- ["83379534",0xEB07],
- ["83379535",0xEB08],
- ["83379536",0xEB09],
- ["83379537",0xEB0A],
- ["83379538",0xEB0B],
- ["83379539",0xEB0C],
- ["83379630",0xEB0D],
- ["83379631",0xEB0E],
- ["83379632",0xEB0F],
- ["83379633",0xEB10],
- ["83379634",0xEB11],
- ["83379635",0xEB12],
- ["83379636",0xEB13],
- ["83379637",0xEB14],
- ["83379638",0xEB15],
- ["83379639",0xEB16],
- ["83379730",0xEB17],
- ["83379731",0xEB18],
- ["83379732",0xEB19],
- ["83379733",0xEB1A],
- ["83379734",0xEB1B],
- ["83379735",0xEB1C],
- ["83379736",0xEB1D],
- ["83379737",0xEB1E],
- ["83379738",0xEB1F],
- ["83379739",0xEB20],
- ["83379830",0xEB21],
- ["83379831",0xEB22],
- ["83379832",0xEB23],
- ["83379833",0xEB24],
- ["83379834",0xEB25],
- ["83379835",0xEB26],
- ["83379836",0xEB27],
- ["83379837",0xEB28],
- ["83379838",0xEB29],
- ["83379839",0xEB2A],
- ["83379930",0xEB2B],
- ["83379931",0xEB2C],
- ["83379932",0xEB2D],
- ["83379933",0xEB2E],
- ["83379934",0xEB2F],
- ["83379935",0xEB30],
- ["83379936",0xEB31],
- ["83379937",0xEB32],
- ["83379938",0xEB33],
- ["83379939",0xEB34],
- ["83379A30",0xEB35],
- ["83379A31",0xEB36],
- ["83379A32",0xEB37],
- ["83379A33",0xEB38],
- ["83379A34",0xEB39],
- ["83379A35",0xEB3A],
- ["83379A36",0xEB3B],
- ["83379A37",0xEB3C],
- ["83379A38",0xEB3D],
- ["83379A39",0xEB3E],
- ["83379B30",0xEB3F],
- ["83379B31",0xEB40],
- ["83379B32",0xEB41],
- ["83379B33",0xEB42],
- ["83379B34",0xEB43],
- ["83379B35",0xEB44],
- ["83379B36",0xEB45],
- ["83379B37",0xEB46],
- ["83379B38",0xEB47],
- ["83379B39",0xEB48],
- ["83379C30",0xEB49],
- ["83379C31",0xEB4A],
- ["83379C32",0xEB4B],
- ["83379C33",0xEB4C],
- ["83379C34",0xEB4D],
- ["83379C35",0xEB4E],
- ["83379C36",0xEB4F],
- ["83379C37",0xEB50],
- ["83379C38",0xEB51],
- ["83379C39",0xEB52],
- ["83379D30",0xEB53],
- ["83379D31",0xEB54],
- ["83379D32",0xEB55],
- ["83379D33",0xEB56],
- ["83379D34",0xEB57],
- ["83379D35",0xEB58],
- ["83379D36",0xEB59],
- ["83379D37",0xEB5A],
- ["83379D38",0xEB5B],
- ["83379D39",0xEB5C],
- ["83379E30",0xEB5D],
- ["83379E31",0xEB5E],
- ["83379E32",0xEB5F],
- ["83379E33",0xEB60],
- ["83379E34",0xEB61],
- ["83379E35",0xEB62],
- ["83379E36",0xEB63],
- ["83379E37",0xEB64],
- ["83379E38",0xEB65],
- ["83379E39",0xEB66],
- ["83379F30",0xEB67],
- ["83379F31",0xEB68],
- ["83379F32",0xEB69],
- ["83379F33",0xEB6A],
- ["83379F34",0xEB6B],
- ["83379F35",0xEB6C],
- ["83379F36",0xEB6D],
- ["83379F37",0xEB6E],
- ["83379F38",0xEB6F],
- ["83379F39",0xEB70],
- ["8337A030",0xEB71],
- ["8337A031",0xEB72],
- ["8337A032",0xEB73],
- ["8337A033",0xEB74],
- ["8337A034",0xEB75],
- ["8337A035",0xEB76],
- ["8337A036",0xEB77],
- ["8337A037",0xEB78],
- ["8337A038",0xEB79],
- ["8337A039",0xEB7A],
- ["8337A130",0xEB7B],
- ["8337A131",0xEB7C],
- ["8337A132",0xEB7D],
- ["8337A133",0xEB7E],
- ["8337A134",0xEB7F],
- ["8337A135",0xEB80],
- ["8337A136",0xEB81],
- ["8337A137",0xEB82],
- ["8337A138",0xEB83],
- ["8337A139",0xEB84],
- ["8337A230",0xEB85],
- ["8337A231",0xEB86],
- ["8337A232",0xEB87],
- ["8337A233",0xEB88],
- ["8337A234",0xEB89],
- ["8337A235",0xEB8A],
- ["8337A236",0xEB8B],
- ["8337A237",0xEB8C],
- ["8337A238",0xEB8D],
- ["8337A239",0xEB8E],
- ["8337A330",0xEB8F],
- ["8337A331",0xEB90],
- ["8337A332",0xEB91],
- ["8337A333",0xEB92],
- ["8337A334",0xEB93],
- ["8337A335",0xEB94],
- ["8337A336",0xEB95],
- ["8337A337",0xEB96],
- ["8337A338",0xEB97],
- ["8337A339",0xEB98],
- ["8337A430",0xEB99],
- ["8337A431",0xEB9A],
- ["8337A432",0xEB9B],
- ["8337A433",0xEB9C],
- ["8337A434",0xEB9D],
- ["8337A435",0xEB9E],
- ["8337A436",0xEB9F],
- ["8337A437",0xEBA0],
- ["8337A438",0xEBA1],
- ["8337A439",0xEBA2],
- ["8337A530",0xEBA3],
- ["8337A531",0xEBA4],
- ["8337A532",0xEBA5],
- ["8337A533",0xEBA6],
- ["8337A534",0xEBA7],
- ["8337A535",0xEBA8],
- ["8337A536",0xEBA9],
- ["8337A537",0xEBAA],
- ["8337A538",0xEBAB],
- ["8337A539",0xEBAC],
- ["8337A630",0xEBAD],
- ["8337A631",0xEBAE],
- ["8337A632",0xEBAF],
- ["8337A633",0xEBB0],
- ["8337A634",0xEBB1],
- ["8337A635",0xEBB2],
- ["8337A636",0xEBB3],
- ["8337A637",0xEBB4],
- ["8337A638",0xEBB5],
- ["8337A639",0xEBB6],
- ["8337A730",0xEBB7],
- ["8337A731",0xEBB8],
- ["8337A732",0xEBB9],
- ["8337A733",0xEBBA],
- ["8337A734",0xEBBB],
- ["8337A735",0xEBBC],
- ["8337A736",0xEBBD],
- ["8337A737",0xEBBE],
- ["8337A738",0xEBBF],
- ["8337A739",0xEBC0],
- ["8337A830",0xEBC1],
- ["8337A831",0xEBC2],
- ["8337A832",0xEBC3],
- ["8337A833",0xEBC4],
- ["8337A834",0xEBC5],
- ["8337A835",0xEBC6],
- ["8337A836",0xEBC7],
- ["8337A837",0xEBC8],
- ["8337A838",0xEBC9],
- ["8337A839",0xEBCA],
- ["8337A930",0xEBCB],
- ["8337A931",0xEBCC],
- ["8337A932",0xEBCD],
- ["8337A933",0xEBCE],
- ["8337A934",0xEBCF],
- ["8337A935",0xEBD0],
- ["8337A936",0xEBD1],
- ["8337A937",0xEBD2],
- ["8337A938",0xEBD3],
- ["8337A939",0xEBD4],
- ["8337AA30",0xEBD5],
- ["8337AA31",0xEBD6],
- ["8337AA32",0xEBD7],
- ["8337AA33",0xEBD8],
- ["8337AA34",0xEBD9],
- ["8337AA35",0xEBDA],
- ["8337AA36",0xEBDB],
- ["8337AA37",0xEBDC],
- ["8337AA38",0xEBDD],
- ["8337AA39",0xEBDE],
- ["8337AB30",0xEBDF],
- ["8337AB31",0xEBE0],
- ["8337AB32",0xEBE1],
- ["8337AB33",0xEBE2],
- ["8337AB34",0xEBE3],
- ["8337AB35",0xEBE4],
- ["8337AB36",0xEBE5],
- ["8337AB37",0xEBE6],
- ["8337AB38",0xEBE7],
- ["8337AB39",0xEBE8],
- ["8337AC30",0xEBE9],
- ["8337AC31",0xEBEA],
- ["8337AC32",0xEBEB],
- ["8337AC33",0xEBEC],
- ["8337AC34",0xEBED],
- ["8337AC35",0xEBEE],
- ["8337AC36",0xEBEF],
- ["8337AC37",0xEBF0],
- ["8337AC38",0xEBF1],
- ["8337AC39",0xEBF2],
- ["8337AD30",0xEBF3],
- ["8337AD31",0xEBF4],
- ["8337AD32",0xEBF5],
- ["8337AD33",0xEBF6],
- ["8337AD34",0xEBF7],
- ["8337AD35",0xEBF8],
- ["8337AD36",0xEBF9],
- ["8337AD37",0xEBFA],
- ["8337AD38",0xEBFB],
- ["8337AD39",0xEBFC],
- ["8337AE30",0xEBFD],
- ["8337AE31",0xEBFE],
- ["8337AE32",0xEBFF],
- ["8337AE33",0xEC00],
- ["8337AE34",0xEC01],
- ["8337AE35",0xEC02],
- ["8337AE36",0xEC03],
- ["8337AE37",0xEC04],
- ["8337AE38",0xEC05],
- ["8337AE39",0xEC06],
- ["8337AF30",0xEC07],
- ["8337AF31",0xEC08],
- ["8337AF32",0xEC09],
- ["8337AF33",0xEC0A],
- ["8337AF34",0xEC0B],
- ["8337AF35",0xEC0C],
- ["8337AF36",0xEC0D],
- ["8337AF37",0xEC0E],
- ["8337AF38",0xEC0F],
- ["8337AF39",0xEC10],
- ["8337B030",0xEC11],
- ["8337B031",0xEC12],
- ["8337B032",0xEC13],
- ["8337B033",0xEC14],
- ["8337B034",0xEC15],
- ["8337B035",0xEC16],
- ["8337B036",0xEC17],
- ["8337B037",0xEC18],
- ["8337B038",0xEC19],
- ["8337B039",0xEC1A],
- ["8337B130",0xEC1B],
- ["8337B131",0xEC1C],
- ["8337B132",0xEC1D],
- ["8337B133",0xEC1E],
- ["8337B134",0xEC1F],
- ["8337B135",0xEC20],
- ["8337B136",0xEC21],
- ["8337B137",0xEC22],
- ["8337B138",0xEC23],
- ["8337B139",0xEC24],
- ["8337B230",0xEC25],
- ["8337B231",0xEC26],
- ["8337B232",0xEC27],
- ["8337B233",0xEC28],
- ["8337B234",0xEC29],
- ["8337B235",0xEC2A],
- ["8337B236",0xEC2B],
- ["8337B237",0xEC2C],
- ["8337B238",0xEC2D],
- ["8337B239",0xEC2E],
- ["8337B330",0xEC2F],
- ["8337B331",0xEC30],
- ["8337B332",0xEC31],
- ["8337B333",0xEC32],
- ["8337B334",0xEC33],
- ["8337B335",0xEC34],
- ["8337B336",0xEC35],
- ["8337B337",0xEC36],
- ["8337B338",0xEC37],
- ["8337B339",0xEC38],
- ["8337B430",0xEC39],
- ["8337B431",0xEC3A],
- ["8337B432",0xEC3B],
- ["8337B433",0xEC3C],
- ["8337B434",0xEC3D],
- ["8337B435",0xEC3E],
- ["8337B436",0xEC3F],
- ["8337B437",0xEC40],
- ["8337B438",0xEC41],
- ["8337B439",0xEC42],
- ["8337B530",0xEC43],
- ["8337B531",0xEC44],
- ["8337B532",0xEC45],
- ["8337B533",0xEC46],
- ["8337B534",0xEC47],
- ["8337B535",0xEC48],
- ["8337B536",0xEC49],
- ["8337B537",0xEC4A],
- ["8337B538",0xEC4B],
- ["8337B539",0xEC4C],
- ["8337B630",0xEC4D],
- ["8337B631",0xEC4E],
- ["8337B632",0xEC4F],
- ["8337B633",0xEC50],
- ["8337B634",0xEC51],
- ["8337B635",0xEC52],
- ["8337B636",0xEC53],
- ["8337B637",0xEC54],
- ["8337B638",0xEC55],
- ["8337B639",0xEC56],
- ["8337B730",0xEC57],
- ["8337B731",0xEC58],
- ["8337B732",0xEC59],
- ["8337B733",0xEC5A],
- ["8337B734",0xEC5B],
- ["8337B735",0xEC5C],
- ["8337B736",0xEC5D],
- ["8337B737",0xEC5E],
- ["8337B738",0xEC5F],
- ["8337B739",0xEC60],
- ["8337B830",0xEC61],
- ["8337B831",0xEC62],
- ["8337B832",0xEC63],
- ["8337B833",0xEC64],
- ["8337B834",0xEC65],
- ["8337B835",0xEC66],
- ["8337B836",0xEC67],
- ["8337B837",0xEC68],
- ["8337B838",0xEC69],
- ["8337B839",0xEC6A],
- ["8337B930",0xEC6B],
- ["8337B931",0xEC6C],
- ["8337B932",0xEC6D],
- ["8337B933",0xEC6E],
- ["8337B934",0xEC6F],
- ["8337B935",0xEC70],
- ["8337B936",0xEC71],
- ["8337B937",0xEC72],
- ["8337B938",0xEC73],
- ["8337B939",0xEC74],
- ["8337BA30",0xEC75],
- ["8337BA31",0xEC76],
- ["8337BA32",0xEC77],
- ["8337BA33",0xEC78],
- ["8337BA34",0xEC79],
- ["8337BA35",0xEC7A],
- ["8337BA36",0xEC7B],
- ["8337BA37",0xEC7C],
- ["8337BA38",0xEC7D],
- ["8337BA39",0xEC7E],
- ["8337BB30",0xEC7F],
- ["8337BB31",0xEC80],
- ["8337BB32",0xEC81],
- ["8337BB33",0xEC82],
- ["8337BB34",0xEC83],
- ["8337BB35",0xEC84],
- ["8337BB36",0xEC85],
- ["8337BB37",0xEC86],
- ["8337BB38",0xEC87],
- ["8337BB39",0xEC88],
- ["8337BC30",0xEC89],
- ["8337BC31",0xEC8A],
- ["8337BC32",0xEC8B],
- ["8337BC33",0xEC8C],
- ["8337BC34",0xEC8D],
- ["8337BC35",0xEC8E],
- ["8337BC36",0xEC8F],
- ["8337BC37",0xEC90],
- ["8337BC38",0xEC91],
- ["8337BC39",0xEC92],
- ["8337BD30",0xEC93],
- ["8337BD31",0xEC94],
- ["8337BD32",0xEC95],
- ["8337BD33",0xEC96],
- ["8337BD34",0xEC97],
- ["8337BD35",0xEC98],
- ["8337BD36",0xEC99],
- ["8337BD37",0xEC9A],
- ["8337BD38",0xEC9B],
- ["8337BD39",0xEC9C],
- ["8337BE30",0xEC9D],
- ["8337BE31",0xEC9E],
- ["8337BE32",0xEC9F],
- ["8337BE33",0xECA0],
- ["8337BE34",0xECA1],
- ["8337BE35",0xECA2],
- ["8337BE36",0xECA3],
- ["8337BE37",0xECA4],
- ["8337BE38",0xECA5],
- ["8337BE39",0xECA6],
- ["8337BF30",0xECA7],
- ["8337BF31",0xECA8],
- ["8337BF32",0xECA9],
- ["8337BF33",0xECAA],
- ["8337BF34",0xECAB],
- ["8337BF35",0xECAC],
- ["8337BF36",0xECAD],
- ["8337BF37",0xECAE],
- ["8337BF38",0xECAF],
- ["8337BF39",0xECB0],
- ["8337C030",0xECB1],
- ["8337C031",0xECB2],
- ["8337C032",0xECB3],
- ["8337C033",0xECB4],
- ["8337C034",0xECB5],
- ["8337C035",0xECB6],
- ["8337C036",0xECB7],
- ["8337C037",0xECB8],
- ["8337C038",0xECB9],
- ["8337C039",0xECBA],
- ["8337C130",0xECBB],
- ["8337C131",0xECBC],
- ["8337C132",0xECBD],
- ["8337C133",0xECBE],
- ["8337C134",0xECBF],
- ["8337C135",0xECC0],
- ["8337C136",0xECC1],
- ["8337C137",0xECC2],
- ["8337C138",0xECC3],
- ["8337C139",0xECC4],
- ["8337C230",0xECC5],
- ["8337C231",0xECC6],
- ["8337C232",0xECC7],
- ["8337C233",0xECC8],
- ["8337C234",0xECC9],
- ["8337C235",0xECCA],
- ["8337C236",0xECCB],
- ["8337C237",0xECCC],
- ["8337C238",0xECCD],
- ["8337C239",0xECCE],
- ["8337C330",0xECCF],
- ["8337C331",0xECD0],
- ["8337C332",0xECD1],
- ["8337C333",0xECD2],
- ["8337C334",0xECD3],
- ["8337C335",0xECD4],
- ["8337C336",0xECD5],
- ["8337C337",0xECD6],
- ["8337C338",0xECD7],
- ["8337C339",0xECD8],
- ["8337C430",0xECD9],
- ["8337C431",0xECDA],
- ["8337C432",0xECDB],
- ["8337C433",0xECDC],
- ["8337C434",0xECDD],
- ["8337C435",0xECDE],
- ["8337C436",0xECDF],
- ["8337C437",0xECE0],
- ["8337C438",0xECE1],
- ["8337C439",0xECE2],
- ["8337C530",0xECE3],
- ["8337C531",0xECE4],
- ["8337C532",0xECE5],
- ["8337C533",0xECE6],
- ["8337C534",0xECE7],
- ["8337C535",0xECE8],
- ["8337C536",0xECE9],
- ["8337C537",0xECEA],
- ["8337C538",0xECEB],
- ["8337C539",0xECEC],
- ["8337C630",0xECED],
- ["8337C631",0xECEE],
- ["8337C632",0xECEF],
- ["8337C633",0xECF0],
- ["8337C634",0xECF1],
- ["8337C635",0xECF2],
- ["8337C636",0xECF3],
- ["8337C637",0xECF4],
- ["8337C638",0xECF5],
- ["8337C639",0xECF6],
- ["8337C730",0xECF7],
- ["8337C731",0xECF8],
- ["8337C732",0xECF9],
- ["8337C733",0xECFA],
- ["8337C734",0xECFB],
- ["8337C735",0xECFC],
- ["8337C736",0xECFD],
- ["8337C737",0xECFE],
- ["8337C738",0xECFF],
- ["8337C739",0xED00],
- ["8337C830",0xED01],
- ["8337C831",0xED02],
- ["8337C832",0xED03],
- ["8337C833",0xED04],
- ["8337C834",0xED05],
- ["8337C835",0xED06],
- ["8337C836",0xED07],
- ["8337C837",0xED08],
- ["8337C838",0xED09],
- ["8337C839",0xED0A],
- ["8337C930",0xED0B],
- ["8337C931",0xED0C],
- ["8337C932",0xED0D],
- ["8337C933",0xED0E],
- ["8337C934",0xED0F],
- ["8337C935",0xED10],
- ["8337C936",0xED11],
- ["8337C937",0xED12],
- ["8337C938",0xED13],
- ["8337C939",0xED14],
- ["8337CA30",0xED15],
- ["8337CA31",0xED16],
- ["8337CA32",0xED17],
- ["8337CA33",0xED18],
- ["8337CA34",0xED19],
- ["8337CA35",0xED1A],
- ["8337CA36",0xED1B],
- ["8337CA37",0xED1C],
- ["8337CA38",0xED1D],
- ["8337CA39",0xED1E],
- ["8337CB30",0xED1F],
- ["8337CB31",0xED20],
- ["8337CB32",0xED21],
- ["8337CB33",0xED22],
- ["8337CB34",0xED23],
- ["8337CB35",0xED24],
- ["8337CB36",0xED25],
- ["8337CB37",0xED26],
- ["8337CB38",0xED27],
- ["8337CB39",0xED28],
- ["8337CC30",0xED29],
- ["8337CC31",0xED2A],
- ["8337CC32",0xED2B],
- ["8337CC33",0xED2C],
- ["8337CC34",0xED2D],
- ["8337CC35",0xED2E],
- ["8337CC36",0xED2F],
- ["8337CC37",0xED30],
- ["8337CC38",0xED31],
- ["8337CC39",0xED32],
- ["8337CD30",0xED33],
- ["8337CD31",0xED34],
- ["8337CD32",0xED35],
- ["8337CD33",0xED36],
- ["8337CD34",0xED37],
- ["8337CD35",0xED38],
- ["8337CD36",0xED39],
- ["8337CD37",0xED3A],
- ["8337CD38",0xED3B],
- ["8337CD39",0xED3C],
- ["8337CE30",0xED3D],
- ["8337CE31",0xED3E],
- ["8337CE32",0xED3F],
- ["8337CE33",0xED40],
- ["8337CE34",0xED41],
- ["8337CE35",0xED42],
- ["8337CE36",0xED43],
- ["8337CE37",0xED44],
- ["8337CE38",0xED45],
- ["8337CE39",0xED46],
- ["8337CF30",0xED47],
- ["8337CF31",0xED48],
- ["8337CF32",0xED49],
- ["8337CF33",0xED4A],
- ["8337CF34",0xED4B],
- ["8337CF35",0xED4C],
- ["8337CF36",0xED4D],
- ["8337CF37",0xED4E],
- ["8337CF38",0xED4F],
- ["8337CF39",0xED50],
- ["8337D030",0xED51],
- ["8337D031",0xED52],
- ["8337D032",0xED53],
- ["8337D033",0xED54],
- ["8337D034",0xED55],
- ["8337D035",0xED56],
- ["8337D036",0xED57],
- ["8337D037",0xED58],
- ["8337D038",0xED59],
- ["8337D039",0xED5A],
- ["8337D130",0xED5B],
- ["8337D131",0xED5C],
- ["8337D132",0xED5D],
- ["8337D133",0xED5E],
- ["8337D134",0xED5F],
- ["8337D135",0xED60],
- ["8337D136",0xED61],
- ["8337D137",0xED62],
- ["8337D138",0xED63],
- ["8337D139",0xED64],
- ["8337D230",0xED65],
- ["8337D231",0xED66],
- ["8337D232",0xED67],
- ["8337D233",0xED68],
- ["8337D234",0xED69],
- ["8337D235",0xED6A],
- ["8337D236",0xED6B],
- ["8337D237",0xED6C],
- ["8337D238",0xED6D],
- ["8337D239",0xED6E],
- ["8337D330",0xED6F],
- ["8337D331",0xED70],
- ["8337D332",0xED71],
- ["8337D333",0xED72],
- ["8337D334",0xED73],
- ["8337D335",0xED74],
- ["8337D336",0xED75],
- ["8337D337",0xED76],
- ["8337D338",0xED77],
- ["8337D339",0xED78],
- ["8337D430",0xED79],
- ["8337D431",0xED7A],
- ["8337D432",0xED7B],
- ["8337D433",0xED7C],
- ["8337D434",0xED7D],
- ["8337D435",0xED7E],
- ["8337D436",0xED7F],
- ["8337D437",0xED80],
- ["8337D438",0xED81],
- ["8337D439",0xED82],
- ["8337D530",0xED83],
- ["8337D531",0xED84],
- ["8337D532",0xED85],
- ["8337D533",0xED86],
- ["8337D534",0xED87],
- ["8337D535",0xED88],
- ["8337D536",0xED89],
- ["8337D537",0xED8A],
- ["8337D538",0xED8B],
- ["8337D539",0xED8C],
- ["8337D630",0xED8D],
- ["8337D631",0xED8E],
- ["8337D632",0xED8F],
- ["8337D633",0xED90],
- ["8337D634",0xED91],
- ["8337D635",0xED92],
- ["8337D636",0xED93],
- ["8337D637",0xED94],
- ["8337D638",0xED95],
- ["8337D639",0xED96],
- ["8337D730",0xED97],
- ["8337D731",0xED98],
- ["8337D732",0xED99],
- ["8337D733",0xED9A],
- ["8337D734",0xED9B],
- ["8337D735",0xED9C],
- ["8337D736",0xED9D],
- ["8337D737",0xED9E],
- ["8337D738",0xED9F],
- ["8337D739",0xEDA0],
- ["8337D830",0xEDA1],
- ["8337D831",0xEDA2],
- ["8337D832",0xEDA3],
- ["8337D833",0xEDA4],
- ["8337D834",0xEDA5],
- ["8337D835",0xEDA6],
- ["8337D836",0xEDA7],
- ["8337D837",0xEDA8],
- ["8337D838",0xEDA9],
- ["8337D839",0xEDAA],
- ["8337D930",0xEDAB],
- ["8337D931",0xEDAC],
- ["8337D932",0xEDAD],
- ["8337D933",0xEDAE],
- ["8337D934",0xEDAF],
- ["8337D935",0xEDB0],
- ["8337D936",0xEDB1],
- ["8337D937",0xEDB2],
- ["8337D938",0xEDB3],
- ["8337D939",0xEDB4],
- ["8337DA30",0xEDB5],
- ["8337DA31",0xEDB6],
- ["8337DA32",0xEDB7],
- ["8337DA33",0xEDB8],
- ["8337DA34",0xEDB9],
- ["8337DA35",0xEDBA],
- ["8337DA36",0xEDBB],
- ["8337DA37",0xEDBC],
- ["8337DA38",0xEDBD],
- ["8337DA39",0xEDBE],
- ["8337DB30",0xEDBF],
- ["8337DB31",0xEDC0],
- ["8337DB32",0xEDC1],
- ["8337DB33",0xEDC2],
- ["8337DB34",0xEDC3],
- ["8337DB35",0xEDC4],
- ["8337DB36",0xEDC5],
- ["8337DB37",0xEDC6],
- ["8337DB38",0xEDC7],
- ["8337DB39",0xEDC8],
- ["8337DC30",0xEDC9],
- ["8337DC31",0xEDCA],
- ["8337DC32",0xEDCB],
- ["8337DC33",0xEDCC],
- ["8337DC34",0xEDCD],
- ["8337DC35",0xEDCE],
- ["8337DC36",0xEDCF],
- ["8337DC37",0xEDD0],
- ["8337DC38",0xEDD1],
- ["8337DC39",0xEDD2],
- ["8337DD30",0xEDD3],
- ["8337DD31",0xEDD4],
- ["8337DD32",0xEDD5],
- ["8337DD33",0xEDD6],
- ["8337DD34",0xEDD7],
- ["8337DD35",0xEDD8],
- ["8337DD36",0xEDD9],
- ["8337DD37",0xEDDA],
- ["8337DD38",0xEDDB],
- ["8337DD39",0xEDDC],
- ["8337DE30",0xEDDD],
- ["8337DE31",0xEDDE],
- ["8337DE32",0xEDDF],
- ["8337DE33",0xEDE0],
- ["8337DE34",0xEDE1],
- ["8337DE35",0xEDE2],
- ["8337DE36",0xEDE3],
- ["8337DE37",0xEDE4],
- ["8337DE38",0xEDE5],
- ["8337DE39",0xEDE6],
- ["8337DF30",0xEDE7],
- ["8337DF31",0xEDE8],
- ["8337DF32",0xEDE9],
- ["8337DF33",0xEDEA],
- ["8337DF34",0xEDEB],
- ["8337DF35",0xEDEC],
- ["8337DF36",0xEDED],
- ["8337DF37",0xEDEE],
- ["8337DF38",0xEDEF],
- ["8337DF39",0xEDF0],
- ["8337E030",0xEDF1],
- ["8337E031",0xEDF2],
- ["8337E032",0xEDF3],
- ["8337E033",0xEDF4],
- ["8337E034",0xEDF5],
- ["8337E035",0xEDF6],
- ["8337E036",0xEDF7],
- ["8337E037",0xEDF8],
- ["8337E038",0xEDF9],
- ["8337E039",0xEDFA],
- ["8337E130",0xEDFB],
- ["8337E131",0xEDFC],
- ["8337E132",0xEDFD],
- ["8337E133",0xEDFE],
- ["8337E134",0xEDFF],
- ["8337E135",0xEE00],
- ["8337E136",0xEE01],
- ["8337E137",0xEE02],
- ["8337E138",0xEE03],
- ["8337E139",0xEE04],
- ["8337E230",0xEE05],
- ["8337E231",0xEE06],
- ["8337E232",0xEE07],
- ["8337E233",0xEE08],
- ["8337E234",0xEE09],
- ["8337E235",0xEE0A],
- ["8337E236",0xEE0B],
- ["8337E237",0xEE0C],
- ["8337E238",0xEE0D],
- ["8337E239",0xEE0E],
- ["8337E330",0xEE0F],
- ["8337E331",0xEE10],
- ["8337E332",0xEE11],
- ["8337E333",0xEE12],
- ["8337E334",0xEE13],
- ["8337E335",0xEE14],
- ["8337E336",0xEE15],
- ["8337E337",0xEE16],
- ["8337E338",0xEE17],
- ["8337E339",0xEE18],
- ["8337E430",0xEE19],
- ["8337E431",0xEE1A],
- ["8337E432",0xEE1B],
- ["8337E433",0xEE1C],
- ["8337E434",0xEE1D],
- ["8337E435",0xEE1E],
- ["8337E436",0xEE1F],
- ["8337E437",0xEE20],
- ["8337E438",0xEE21],
- ["8337E439",0xEE22],
- ["8337E530",0xEE23],
- ["8337E531",0xEE24],
- ["8337E532",0xEE25],
- ["8337E533",0xEE26],
- ["8337E534",0xEE27],
- ["8337E535",0xEE28],
- ["8337E536",0xEE29],
- ["8337E537",0xEE2A],
- ["8337E538",0xEE2B],
- ["8337E539",0xEE2C],
- ["8337E630",0xEE2D],
- ["8337E631",0xEE2E],
- ["8337E632",0xEE2F],
- ["8337E633",0xEE30],
- ["8337E634",0xEE31],
- ["8337E635",0xEE32],
- ["8337E636",0xEE33],
- ["8337E637",0xEE34],
- ["8337E638",0xEE35],
- ["8337E639",0xEE36],
- ["8337E730",0xEE37],
- ["8337E731",0xEE38],
- ["8337E732",0xEE39],
- ["8337E733",0xEE3A],
- ["8337E734",0xEE3B],
- ["8337E735",0xEE3C],
- ["8337E736",0xEE3D],
- ["8337E737",0xEE3E],
- ["8337E738",0xEE3F],
- ["8337E739",0xEE40],
- ["8337E830",0xEE41],
- ["8337E831",0xEE42],
- ["8337E832",0xEE43],
- ["8337E833",0xEE44],
- ["8337E834",0xEE45],
- ["8337E835",0xEE46],
- ["8337E836",0xEE47],
- ["8337E837",0xEE48],
- ["8337E838",0xEE49],
- ["8337E839",0xEE4A],
- ["8337E930",0xEE4B],
- ["8337E931",0xEE4C],
- ["8337E932",0xEE4D],
- ["8337E933",0xEE4E],
- ["8337E934",0xEE4F],
- ["8337E935",0xEE50],
- ["8337E936",0xEE51],
- ["8337E937",0xEE52],
- ["8337E938",0xEE53],
- ["8337E939",0xEE54],
- ["8337EA30",0xEE55],
- ["8337EA31",0xEE56],
- ["8337EA32",0xEE57],
- ["8337EA33",0xEE58],
- ["8337EA34",0xEE59],
- ["8337EA35",0xEE5A],
- ["8337EA36",0xEE5B],
- ["8337EA37",0xEE5C],
- ["8337EA38",0xEE5D],
- ["8337EA39",0xEE5E],
- ["8337EB30",0xEE5F],
- ["8337EB31",0xEE60],
- ["8337EB32",0xEE61],
- ["8337EB33",0xEE62],
- ["8337EB34",0xEE63],
- ["8337EB35",0xEE64],
- ["8337EB36",0xEE65],
- ["8337EB37",0xEE66],
- ["8337EB38",0xEE67],
- ["8337EB39",0xEE68],
- ["8337EC30",0xEE69],
- ["8337EC31",0xEE6A],
- ["8337EC32",0xEE6B],
- ["8337EC33",0xEE6C],
- ["8337EC34",0xEE6D],
- ["8337EC35",0xEE6E],
- ["8337EC36",0xEE6F],
- ["8337EC37",0xEE70],
- ["8337EC38",0xEE71],
- ["8337EC39",0xEE72],
- ["8337ED30",0xEE73],
- ["8337ED31",0xEE74],
- ["8337ED32",0xEE75],
- ["8337ED33",0xEE76],
- ["8337ED34",0xEE77],
- ["8337ED35",0xEE78],
- ["8337ED36",0xEE79],
- ["8337ED37",0xEE7A],
- ["8337ED38",0xEE7B],
- ["8337ED39",0xEE7C],
- ["8337EE30",0xEE7D],
- ["8337EE31",0xEE7E],
- ["8337EE32",0xEE7F],
- ["8337EE33",0xEE80],
- ["8337EE34",0xEE81],
- ["8337EE35",0xEE82],
- ["8337EE36",0xEE83],
- ["8337EE37",0xEE84],
- ["8337EE38",0xEE85],
- ["8337EE39",0xEE86],
- ["8337EF30",0xEE87],
- ["8337EF31",0xEE88],
- ["8337EF32",0xEE89],
- ["8337EF33",0xEE8A],
- ["8337EF34",0xEE8B],
- ["8337EF35",0xEE8C],
- ["8337EF36",0xEE8D],
- ["8337EF37",0xEE8E],
- ["8337EF38",0xEE8F],
- ["8337EF39",0xEE90],
- ["8337F030",0xEE91],
- ["8337F031",0xEE92],
- ["8337F032",0xEE93],
- ["8337F033",0xEE94],
- ["8337F034",0xEE95],
- ["8337F035",0xEE96],
- ["8337F036",0xEE97],
- ["8337F037",0xEE98],
- ["8337F038",0xEE99],
- ["8337F039",0xEE9A],
- ["8337F130",0xEE9B],
- ["8337F131",0xEE9C],
- ["8337F132",0xEE9D],
- ["8337F133",0xEE9E],
- ["8337F134",0xEE9F],
- ["8337F135",0xEEA0],
- ["8337F136",0xEEA1],
- ["8337F137",0xEEA2],
- ["8337F138",0xEEA3],
- ["8337F139",0xEEA4],
- ["8337F230",0xEEA5],
- ["8337F231",0xEEA6],
- ["8337F232",0xEEA7],
- ["8337F233",0xEEA8],
- ["8337F234",0xEEA9],
- ["8337F235",0xEEAA],
- ["8337F236",0xEEAB],
- ["8337F237",0xEEAC],
- ["8337F238",0xEEAD],
- ["8337F239",0xEEAE],
- ["8337F330",0xEEAF],
- ["8337F331",0xEEB0],
- ["8337F332",0xEEB1],
- ["8337F333",0xEEB2],
- ["8337F334",0xEEB3],
- ["8337F335",0xEEB4],
- ["8337F336",0xEEB5],
- ["8337F337",0xEEB6],
- ["8337F338",0xEEB7],
- ["8337F339",0xEEB8],
- ["8337F430",0xEEB9],
- ["8337F431",0xEEBA],
- ["8337F432",0xEEBB],
- ["8337F433",0xEEBC],
- ["8337F434",0xEEBD],
- ["8337F435",0xEEBE],
- ["8337F436",0xEEBF],
- ["8337F437",0xEEC0],
- ["8337F438",0xEEC1],
- ["8337F439",0xEEC2],
- ["8337F530",0xEEC3],
- ["8337F531",0xEEC4],
- ["8337F532",0xEEC5],
- ["8337F533",0xEEC6],
- ["8337F534",0xEEC7],
- ["8337F535",0xEEC8],
- ["8337F536",0xEEC9],
- ["8337F537",0xEECA],
- ["8337F538",0xEECB],
- ["8337F539",0xEECC],
- ["8337F630",0xEECD],
- ["8337F631",0xEECE],
- ["8337F632",0xEECF],
- ["8337F633",0xEED0],
- ["8337F634",0xEED1],
- ["8337F635",0xEED2],
- ["8337F636",0xEED3],
- ["8337F637",0xEED4],
- ["8337F638",0xEED5],
- ["8337F639",0xEED6],
- ["8337F730",0xEED7],
- ["8337F731",0xEED8],
- ["8337F732",0xEED9],
- ["8337F733",0xEEDA],
- ["8337F734",0xEEDB],
- ["8337F735",0xEEDC],
- ["8337F736",0xEEDD],
- ["8337F737",0xEEDE],
- ["8337F738",0xEEDF],
- ["8337F739",0xEEE0],
- ["8337F830",0xEEE1],
- ["8337F831",0xEEE2],
- ["8337F832",0xEEE3],
- ["8337F833",0xEEE4],
- ["8337F834",0xEEE5],
- ["8337F835",0xEEE6],
- ["8337F836",0xEEE7],
- ["8337F837",0xEEE8],
- ["8337F838",0xEEE9],
- ["8337F839",0xEEEA],
- ["8337F930",0xEEEB],
- ["8337F931",0xEEEC],
- ["8337F932",0xEEED],
- ["8337F933",0xEEEE],
- ["8337F934",0xEEEF],
- ["8337F935",0xEEF0],
- ["8337F936",0xEEF1],
- ["8337F937",0xEEF2],
- ["8337F938",0xEEF3],
- ["8337F939",0xEEF4],
- ["8337FA30",0xEEF5],
- ["8337FA31",0xEEF6],
- ["8337FA32",0xEEF7],
- ["8337FA33",0xEEF8],
- ["8337FA34",0xEEF9],
- ["8337FA35",0xEEFA],
- ["8337FA36",0xEEFB],
- ["8337FA37",0xEEFC],
- ["8337FA38",0xEEFD],
- ["8337FA39",0xEEFE],
- ["8337FB30",0xEEFF],
- ["8337FB31",0xEF00],
- ["8337FB32",0xEF01],
- ["8337FB33",0xEF02],
- ["8337FB34",0xEF03],
- ["8337FB35",0xEF04],
- ["8337FB36",0xEF05],
- ["8337FB37",0xEF06],
- ["8337FB38",0xEF07],
- ["8337FB39",0xEF08],
- ["8337FC30",0xEF09],
- ["8337FC31",0xEF0A],
- ["8337FC32",0xEF0B],
- ["8337FC33",0xEF0C],
- ["8337FC34",0xEF0D],
- ["8337FC35",0xEF0E],
- ["8337FC36",0xEF0F],
- ["8337FC37",0xEF10],
- ["8337FC38",0xEF11],
- ["8337FC39",0xEF12],
- ["8337FD30",0xEF13],
- ["8337FD31",0xEF14],
- ["8337FD32",0xEF15],
- ["8337FD33",0xEF16],
- ["8337FD34",0xEF17],
- ["8337FD35",0xEF18],
- ["8337FD36",0xEF19],
- ["8337FD37",0xEF1A],
- ["8337FD38",0xEF1B],
- ["8337FD39",0xEF1C],
- ["8337FE30",0xEF1D],
- ["8337FE31",0xEF1E],
- ["8337FE32",0xEF1F],
- ["8337FE33",0xEF20],
- ["8337FE34",0xEF21],
- ["8337FE35",0xEF22],
- ["8337FE36",0xEF23],
- ["8337FE37",0xEF24],
- ["8337FE38",0xEF25],
- ["8337FE39",0xEF26],
- ["83388130",0xEF27],
- ["83388131",0xEF28],
- ["83388132",0xEF29],
- ["83388133",0xEF2A],
- ["83388134",0xEF2B],
- ["83388135",0xEF2C],
- ["83388136",0xEF2D],
- ["83388137",0xEF2E],
- ["83388138",0xEF2F],
- ["83388139",0xEF30],
- ["83388230",0xEF31],
- ["83388231",0xEF32],
- ["83388232",0xEF33],
- ["83388233",0xEF34],
- ["83388234",0xEF35],
- ["83388235",0xEF36],
- ["83388236",0xEF37],
- ["83388237",0xEF38],
- ["83388238",0xEF39],
- ["83388239",0xEF3A],
- ["83388330",0xEF3B],
- ["83388331",0xEF3C],
- ["83388332",0xEF3D],
- ["83388333",0xEF3E],
- ["83388334",0xEF3F],
- ["83388335",0xEF40],
- ["83388336",0xEF41],
- ["83388337",0xEF42],
- ["83388338",0xEF43],
- ["83388339",0xEF44],
- ["83388430",0xEF45],
- ["83388431",0xEF46],
- ["83388432",0xEF47],
- ["83388433",0xEF48],
- ["83388434",0xEF49],
- ["83388435",0xEF4A],
- ["83388436",0xEF4B],
- ["83388437",0xEF4C],
- ["83388438",0xEF4D],
- ["83388439",0xEF4E],
- ["83388530",0xEF4F],
- ["83388531",0xEF50],
- ["83388532",0xEF51],
- ["83388533",0xEF52],
- ["83388534",0xEF53],
- ["83388535",0xEF54],
- ["83388536",0xEF55],
- ["83388537",0xEF56],
- ["83388538",0xEF57],
- ["83388539",0xEF58],
- ["83388630",0xEF59],
- ["83388631",0xEF5A],
- ["83388632",0xEF5B],
- ["83388633",0xEF5C],
- ["83388634",0xEF5D],
- ["83388635",0xEF5E],
- ["83388636",0xEF5F],
- ["83388637",0xEF60],
- ["83388638",0xEF61],
- ["83388639",0xEF62],
- ["83388730",0xEF63],
- ["83388731",0xEF64],
- ["83388732",0xEF65],
- ["83388733",0xEF66],
- ["83388734",0xEF67],
- ["83388735",0xEF68],
- ["83388736",0xEF69],
- ["83388737",0xEF6A],
- ["83388738",0xEF6B],
- ["83388739",0xEF6C],
- ["83388830",0xEF6D],
- ["83388831",0xEF6E],
- ["83388832",0xEF6F],
- ["83388833",0xEF70],
- ["83388834",0xEF71],
- ["83388835",0xEF72],
- ["83388836",0xEF73],
- ["83388837",0xEF74],
- ["83388838",0xEF75],
- ["83388839",0xEF76],
- ["83388930",0xEF77],
- ["83388931",0xEF78],
- ["83388932",0xEF79],
- ["83388933",0xEF7A],
- ["83388934",0xEF7B],
- ["83388935",0xEF7C],
- ["83388936",0xEF7D],
- ["83388937",0xEF7E],
- ["83388938",0xEF7F],
- ["83388939",0xEF80],
- ["83388A30",0xEF81],
- ["83388A31",0xEF82],
- ["83388A32",0xEF83],
- ["83388A33",0xEF84],
- ["83388A34",0xEF85],
- ["83388A35",0xEF86],
- ["83388A36",0xEF87],
- ["83388A37",0xEF88],
- ["83388A38",0xEF89],
- ["83388A39",0xEF8A],
- ["83388B30",0xEF8B],
- ["83388B31",0xEF8C],
- ["83388B32",0xEF8D],
- ["83388B33",0xEF8E],
- ["83388B34",0xEF8F],
- ["83388B35",0xEF90],
- ["83388B36",0xEF91],
- ["83388B37",0xEF92],
- ["83388B38",0xEF93],
- ["83388B39",0xEF94],
- ["83388C30",0xEF95],
- ["83388C31",0xEF96],
- ["83388C32",0xEF97],
- ["83388C33",0xEF98],
- ["83388C34",0xEF99],
- ["83388C35",0xEF9A],
- ["83388C36",0xEF9B],
- ["83388C37",0xEF9C],
- ["83388C38",0xEF9D],
- ["83388C39",0xEF9E],
- ["83388D30",0xEF9F],
- ["83388D31",0xEFA0],
- ["83388D32",0xEFA1],
- ["83388D33",0xEFA2],
- ["83388D34",0xEFA3],
- ["83388D35",0xEFA4],
- ["83388D36",0xEFA5],
- ["83388D37",0xEFA6],
- ["83388D38",0xEFA7],
- ["83388D39",0xEFA8],
- ["83388E30",0xEFA9],
- ["83388E31",0xEFAA],
- ["83388E32",0xEFAB],
- ["83388E33",0xEFAC],
- ["83388E34",0xEFAD],
- ["83388E35",0xEFAE],
- ["83388E36",0xEFAF],
- ["83388E37",0xEFB0],
- ["83388E38",0xEFB1],
- ["83388E39",0xEFB2],
- ["83388F30",0xEFB3],
- ["83388F31",0xEFB4],
- ["83388F32",0xEFB5],
- ["83388F33",0xEFB6],
- ["83388F34",0xEFB7],
- ["83388F35",0xEFB8],
- ["83388F36",0xEFB9],
- ["83388F37",0xEFBA],
- ["83388F38",0xEFBB],
- ["83388F39",0xEFBC],
- ["83389030",0xEFBD],
- ["83389031",0xEFBE],
- ["83389032",0xEFBF],
- ["83389033",0xEFC0],
- ["83389034",0xEFC1],
- ["83389035",0xEFC2],
- ["83389036",0xEFC3],
- ["83389037",0xEFC4],
- ["83389038",0xEFC5],
- ["83389039",0xEFC6],
- ["83389130",0xEFC7],
- ["83389131",0xEFC8],
- ["83389132",0xEFC9],
- ["83389133",0xEFCA],
- ["83389134",0xEFCB],
- ["83389135",0xEFCC],
- ["83389136",0xEFCD],
- ["83389137",0xEFCE],
- ["83389138",0xEFCF],
- ["83389139",0xEFD0],
- ["83389230",0xEFD1],
- ["83389231",0xEFD2],
- ["83389232",0xEFD3],
- ["83389233",0xEFD4],
- ["83389234",0xEFD5],
- ["83389235",0xEFD6],
- ["83389236",0xEFD7],
- ["83389237",0xEFD8],
- ["83389238",0xEFD9],
- ["83389239",0xEFDA],
- ["83389330",0xEFDB],
- ["83389331",0xEFDC],
- ["83389332",0xEFDD],
- ["83389333",0xEFDE],
- ["83389334",0xEFDF],
- ["83389335",0xEFE0],
- ["83389336",0xEFE1],
- ["83389337",0xEFE2],
- ["83389338",0xEFE3],
- ["83389339",0xEFE4],
- ["83389430",0xEFE5],
- ["83389431",0xEFE6],
- ["83389432",0xEFE7],
- ["83389433",0xEFE8],
- ["83389434",0xEFE9],
- ["83389435",0xEFEA],
- ["83389436",0xEFEB],
- ["83389437",0xEFEC],
- ["83389438",0xEFED],
- ["83389439",0xEFEE],
- ["83389530",0xEFEF],
- ["83389531",0xEFF0],
- ["83389532",0xEFF1],
- ["83389533",0xEFF2],
- ["83389534",0xEFF3],
- ["83389535",0xEFF4],
- ["83389536",0xEFF5],
- ["83389537",0xEFF6],
- ["83389538",0xEFF7],
- ["83389539",0xEFF8],
- ["83389630",0xEFF9],
- ["83389631",0xEFFA],
- ["83389632",0xEFFB],
- ["83389633",0xEFFC],
- ["83389634",0xEFFD],
- ["83389635",0xEFFE],
- ["83389636",0xEFFF],
- ["83389637",0xF000],
- ["83389638",0xF001],
- ["83389639",0xF002],
- ["83389730",0xF003],
- ["83389731",0xF004],
- ["83389732",0xF005],
- ["83389733",0xF006],
- ["83389734",0xF007],
- ["83389735",0xF008],
- ["83389736",0xF009],
- ["83389737",0xF00A],
- ["83389738",0xF00B],
- ["83389739",0xF00C],
- ["83389830",0xF00D],
- ["83389831",0xF00E],
- ["83389832",0xF00F],
- ["83389833",0xF010],
- ["83389834",0xF011],
- ["83389835",0xF012],
- ["83389836",0xF013],
- ["83389837",0xF014],
- ["83389838",0xF015],
- ["83389839",0xF016],
- ["83389930",0xF017],
- ["83389931",0xF018],
- ["83389932",0xF019],
- ["83389933",0xF01A],
- ["83389934",0xF01B],
- ["83389935",0xF01C],
- ["83389936",0xF01D],
- ["83389937",0xF01E],
- ["83389938",0xF01F],
- ["83389939",0xF020],
- ["83389A30",0xF021],
- ["83389A31",0xF022],
- ["83389A32",0xF023],
- ["83389A33",0xF024],
- ["83389A34",0xF025],
- ["83389A35",0xF026],
- ["83389A36",0xF027],
- ["83389A37",0xF028],
- ["83389A38",0xF029],
- ["83389A39",0xF02A],
- ["83389B30",0xF02B],
- ["83389B31",0xF02C],
- ["83389B32",0xF02D],
- ["83389B33",0xF02E],
- ["83389B34",0xF02F],
- ["83389B35",0xF030],
- ["83389B36",0xF031],
- ["83389B37",0xF032],
- ["83389B38",0xF033],
- ["83389B39",0xF034],
- ["83389C30",0xF035],
- ["83389C31",0xF036],
- ["83389C32",0xF037],
- ["83389C33",0xF038],
- ["83389C34",0xF039],
- ["83389C35",0xF03A],
- ["83389C36",0xF03B],
- ["83389C37",0xF03C],
- ["83389C38",0xF03D],
- ["83389C39",0xF03E],
- ["83389D30",0xF03F],
- ["83389D31",0xF040],
- ["83389D32",0xF041],
- ["83389D33",0xF042],
- ["83389D34",0xF043],
- ["83389D35",0xF044],
- ["83389D36",0xF045],
- ["83389D37",0xF046],
- ["83389D38",0xF047],
- ["83389D39",0xF048],
- ["83389E30",0xF049],
- ["83389E31",0xF04A],
- ["83389E32",0xF04B],
- ["83389E33",0xF04C],
- ["83389E34",0xF04D],
- ["83389E35",0xF04E],
- ["83389E36",0xF04F],
- ["83389E37",0xF050],
- ["83389E38",0xF051],
- ["83389E39",0xF052],
- ["83389F30",0xF053],
- ["83389F31",0xF054],
- ["83389F32",0xF055],
- ["83389F33",0xF056],
- ["83389F34",0xF057],
- ["83389F35",0xF058],
- ["83389F36",0xF059],
- ["83389F37",0xF05A],
- ["83389F38",0xF05B],
- ["83389F39",0xF05C],
- ["8338A030",0xF05D],
- ["8338A031",0xF05E],
- ["8338A032",0xF05F],
- ["8338A033",0xF060],
- ["8338A034",0xF061],
- ["8338A035",0xF062],
- ["8338A036",0xF063],
- ["8338A037",0xF064],
- ["8338A038",0xF065],
- ["8338A039",0xF066],
- ["8338A130",0xF067],
- ["8338A131",0xF068],
- ["8338A132",0xF069],
- ["8338A133",0xF06A],
- ["8338A134",0xF06B],
- ["8338A135",0xF06C],
- ["8338A136",0xF06D],
- ["8338A137",0xF06E],
- ["8338A138",0xF06F],
- ["8338A139",0xF070],
- ["8338A230",0xF071],
- ["8338A231",0xF072],
- ["8338A232",0xF073],
- ["8338A233",0xF074],
- ["8338A234",0xF075],
- ["8338A235",0xF076],
- ["8338A236",0xF077],
- ["8338A237",0xF078],
- ["8338A238",0xF079],
- ["8338A239",0xF07A],
- ["8338A330",0xF07B],
- ["8338A331",0xF07C],
- ["8338A332",0xF07D],
- ["8338A333",0xF07E],
- ["8338A334",0xF07F],
- ["8338A335",0xF080],
- ["8338A336",0xF081],
- ["8338A337",0xF082],
- ["8338A338",0xF083],
- ["8338A339",0xF084],
- ["8338A430",0xF085],
- ["8338A431",0xF086],
- ["8338A432",0xF087],
- ["8338A433",0xF088],
- ["8338A434",0xF089],
- ["8338A435",0xF08A],
- ["8338A436",0xF08B],
- ["8338A437",0xF08C],
- ["8338A438",0xF08D],
- ["8338A439",0xF08E],
- ["8338A530",0xF08F],
- ["8338A531",0xF090],
- ["8338A532",0xF091],
- ["8338A533",0xF092],
- ["8338A534",0xF093],
- ["8338A535",0xF094],
- ["8338A536",0xF095],
- ["8338A537",0xF096],
- ["8338A538",0xF097],
- ["8338A539",0xF098],
- ["8338A630",0xF099],
- ["8338A631",0xF09A],
- ["8338A632",0xF09B],
- ["8338A633",0xF09C],
- ["8338A634",0xF09D],
- ["8338A635",0xF09E],
- ["8338A636",0xF09F],
- ["8338A637",0xF0A0],
- ["8338A638",0xF0A1],
- ["8338A639",0xF0A2],
- ["8338A730",0xF0A3],
- ["8338A731",0xF0A4],
- ["8338A732",0xF0A5],
- ["8338A733",0xF0A6],
- ["8338A734",0xF0A7],
- ["8338A735",0xF0A8],
- ["8338A736",0xF0A9],
- ["8338A737",0xF0AA],
- ["8338A738",0xF0AB],
- ["8338A739",0xF0AC],
- ["8338A830",0xF0AD],
- ["8338A831",0xF0AE],
- ["8338A832",0xF0AF],
- ["8338A833",0xF0B0],
- ["8338A834",0xF0B1],
- ["8338A835",0xF0B2],
- ["8338A836",0xF0B3],
- ["8338A837",0xF0B4],
- ["8338A838",0xF0B5],
- ["8338A839",0xF0B6],
- ["8338A930",0xF0B7],
- ["8338A931",0xF0B8],
- ["8338A932",0xF0B9],
- ["8338A933",0xF0BA],
- ["8338A934",0xF0BB],
- ["8338A935",0xF0BC],
- ["8338A936",0xF0BD],
- ["8338A937",0xF0BE],
- ["8338A938",0xF0BF],
- ["8338A939",0xF0C0],
- ["8338AA30",0xF0C1],
- ["8338AA31",0xF0C2],
- ["8338AA32",0xF0C3],
- ["8338AA33",0xF0C4],
- ["8338AA34",0xF0C5],
- ["8338AA35",0xF0C6],
- ["8338AA36",0xF0C7],
- ["8338AA37",0xF0C8],
- ["8338AA38",0xF0C9],
- ["8338AA39",0xF0CA],
- ["8338AB30",0xF0CB],
- ["8338AB31",0xF0CC],
- ["8338AB32",0xF0CD],
- ["8338AB33",0xF0CE],
- ["8338AB34",0xF0CF],
- ["8338AB35",0xF0D0],
- ["8338AB36",0xF0D1],
- ["8338AB37",0xF0D2],
- ["8338AB38",0xF0D3],
- ["8338AB39",0xF0D4],
- ["8338AC30",0xF0D5],
- ["8338AC31",0xF0D6],
- ["8338AC32",0xF0D7],
- ["8338AC33",0xF0D8],
- ["8338AC34",0xF0D9],
- ["8338AC35",0xF0DA],
- ["8338AC36",0xF0DB],
- ["8338AC37",0xF0DC],
- ["8338AC38",0xF0DD],
- ["8338AC39",0xF0DE],
- ["8338AD30",0xF0DF],
- ["8338AD31",0xF0E0],
- ["8338AD32",0xF0E1],
- ["8338AD33",0xF0E2],
- ["8338AD34",0xF0E3],
- ["8338AD35",0xF0E4],
- ["8338AD36",0xF0E5],
- ["8338AD37",0xF0E6],
- ["8338AD38",0xF0E7],
- ["8338AD39",0xF0E8],
- ["8338AE30",0xF0E9],
- ["8338AE31",0xF0EA],
- ["8338AE32",0xF0EB],
- ["8338AE33",0xF0EC],
- ["8338AE34",0xF0ED],
- ["8338AE35",0xF0EE],
- ["8338AE36",0xF0EF],
- ["8338AE37",0xF0F0],
- ["8338AE38",0xF0F1],
- ["8338AE39",0xF0F2],
- ["8338AF30",0xF0F3],
- ["8338AF31",0xF0F4],
- ["8338AF32",0xF0F5],
- ["8338AF33",0xF0F6],
- ["8338AF34",0xF0F7],
- ["8338AF35",0xF0F8],
- ["8338AF36",0xF0F9],
- ["8338AF37",0xF0FA],
- ["8338AF38",0xF0FB],
- ["8338AF39",0xF0FC],
- ["8338B030",0xF0FD],
- ["8338B031",0xF0FE],
- ["8338B032",0xF0FF],
- ["8338B033",0xF100],
- ["8338B034",0xF101],
- ["8338B035",0xF102],
- ["8338B036",0xF103],
- ["8338B037",0xF104],
- ["8338B038",0xF105],
- ["8338B039",0xF106],
- ["8338B130",0xF107],
- ["8338B131",0xF108],
- ["8338B132",0xF109],
- ["8338B133",0xF10A],
- ["8338B134",0xF10B],
- ["8338B135",0xF10C],
- ["8338B136",0xF10D],
- ["8338B137",0xF10E],
- ["8338B138",0xF10F],
- ["8338B139",0xF110],
- ["8338B230",0xF111],
- ["8338B231",0xF112],
- ["8338B232",0xF113],
- ["8338B233",0xF114],
- ["8338B234",0xF115],
- ["8338B235",0xF116],
- ["8338B236",0xF117],
- ["8338B237",0xF118],
- ["8338B238",0xF119],
- ["8338B239",0xF11A],
- ["8338B330",0xF11B],
- ["8338B331",0xF11C],
- ["8338B332",0xF11D],
- ["8338B333",0xF11E],
- ["8338B334",0xF11F],
- ["8338B335",0xF120],
- ["8338B336",0xF121],
- ["8338B337",0xF122],
- ["8338B338",0xF123],
- ["8338B339",0xF124],
- ["8338B430",0xF125],
- ["8338B431",0xF126],
- ["8338B432",0xF127],
- ["8338B433",0xF128],
- ["8338B434",0xF129],
- ["8338B435",0xF12A],
- ["8338B436",0xF12B],
- ["8338B437",0xF12C],
- ["8338B438",0xF12D],
- ["8338B439",0xF12E],
- ["8338B530",0xF12F],
- ["8338B531",0xF130],
- ["8338B532",0xF131],
- ["8338B533",0xF132],
- ["8338B534",0xF133],
- ["8338B535",0xF134],
- ["8338B536",0xF135],
- ["8338B537",0xF136],
- ["8338B538",0xF137],
- ["8338B539",0xF138],
- ["8338B630",0xF139],
- ["8338B631",0xF13A],
- ["8338B632",0xF13B],
- ["8338B633",0xF13C],
- ["8338B634",0xF13D],
- ["8338B635",0xF13E],
- ["8338B636",0xF13F],
- ["8338B637",0xF140],
- ["8338B638",0xF141],
- ["8338B639",0xF142],
- ["8338B730",0xF143],
- ["8338B731",0xF144],
- ["8338B732",0xF145],
- ["8338B733",0xF146],
- ["8338B734",0xF147],
- ["8338B735",0xF148],
- ["8338B736",0xF149],
- ["8338B737",0xF14A],
- ["8338B738",0xF14B],
- ["8338B739",0xF14C],
- ["8338B830",0xF14D],
- ["8338B831",0xF14E],
- ["8338B832",0xF14F],
- ["8338B833",0xF150],
- ["8338B834",0xF151],
- ["8338B835",0xF152],
- ["8338B836",0xF153],
- ["8338B837",0xF154],
- ["8338B838",0xF155],
- ["8338B839",0xF156],
- ["8338B930",0xF157],
- ["8338B931",0xF158],
- ["8338B932",0xF159],
- ["8338B933",0xF15A],
- ["8338B934",0xF15B],
- ["8338B935",0xF15C],
- ["8338B936",0xF15D],
- ["8338B937",0xF15E],
- ["8338B938",0xF15F],
- ["8338B939",0xF160],
- ["8338BA30",0xF161],
- ["8338BA31",0xF162],
- ["8338BA32",0xF163],
- ["8338BA33",0xF164],
- ["8338BA34",0xF165],
- ["8338BA35",0xF166],
- ["8338BA36",0xF167],
- ["8338BA37",0xF168],
- ["8338BA38",0xF169],
- ["8338BA39",0xF16A],
- ["8338BB30",0xF16B],
- ["8338BB31",0xF16C],
- ["8338BB32",0xF16D],
- ["8338BB33",0xF16E],
- ["8338BB34",0xF16F],
- ["8338BB35",0xF170],
- ["8338BB36",0xF171],
- ["8338BB37",0xF172],
- ["8338BB38",0xF173],
- ["8338BB39",0xF174],
- ["8338BC30",0xF175],
- ["8338BC31",0xF176],
- ["8338BC32",0xF177],
- ["8338BC33",0xF178],
- ["8338BC34",0xF179],
- ["8338BC35",0xF17A],
- ["8338BC36",0xF17B],
- ["8338BC37",0xF17C],
- ["8338BC38",0xF17D],
- ["8338BC39",0xF17E],
- ["8338BD30",0xF17F],
- ["8338BD31",0xF180],
- ["8338BD32",0xF181],
- ["8338BD33",0xF182],
- ["8338BD34",0xF183],
- ["8338BD35",0xF184],
- ["8338BD36",0xF185],
- ["8338BD37",0xF186],
- ["8338BD38",0xF187],
- ["8338BD39",0xF188],
- ["8338BE30",0xF189],
- ["8338BE31",0xF18A],
- ["8338BE32",0xF18B],
- ["8338BE33",0xF18C],
- ["8338BE34",0xF18D],
- ["8338BE35",0xF18E],
- ["8338BE36",0xF18F],
- ["8338BE37",0xF190],
- ["8338BE38",0xF191],
- ["8338BE39",0xF192],
- ["8338BF30",0xF193],
- ["8338BF31",0xF194],
- ["8338BF32",0xF195],
- ["8338BF33",0xF196],
- ["8338BF34",0xF197],
- ["8338BF35",0xF198],
- ["8338BF36",0xF199],
- ["8338BF37",0xF19A],
- ["8338BF38",0xF19B],
- ["8338BF39",0xF19C],
- ["8338C030",0xF19D],
- ["8338C031",0xF19E],
- ["8338C032",0xF19F],
- ["8338C033",0xF1A0],
- ["8338C034",0xF1A1],
- ["8338C035",0xF1A2],
- ["8338C036",0xF1A3],
- ["8338C037",0xF1A4],
- ["8338C038",0xF1A5],
- ["8338C039",0xF1A6],
- ["8338C130",0xF1A7],
- ["8338C131",0xF1A8],
- ["8338C132",0xF1A9],
- ["8338C133",0xF1AA],
- ["8338C134",0xF1AB],
- ["8338C135",0xF1AC],
- ["8338C136",0xF1AD],
- ["8338C137",0xF1AE],
- ["8338C138",0xF1AF],
- ["8338C139",0xF1B0],
- ["8338C230",0xF1B1],
- ["8338C231",0xF1B2],
- ["8338C232",0xF1B3],
- ["8338C233",0xF1B4],
- ["8338C234",0xF1B5],
- ["8338C235",0xF1B6],
- ["8338C236",0xF1B7],
- ["8338C237",0xF1B8],
- ["8338C238",0xF1B9],
- ["8338C239",0xF1BA],
- ["8338C330",0xF1BB],
- ["8338C331",0xF1BC],
- ["8338C332",0xF1BD],
- ["8338C333",0xF1BE],
- ["8338C334",0xF1BF],
- ["8338C335",0xF1C0],
- ["8338C336",0xF1C1],
- ["8338C337",0xF1C2],
- ["8338C338",0xF1C3],
- ["8338C339",0xF1C4],
- ["8338C430",0xF1C5],
- ["8338C431",0xF1C6],
- ["8338C432",0xF1C7],
- ["8338C433",0xF1C8],
- ["8338C434",0xF1C9],
- ["8338C435",0xF1CA],
- ["8338C436",0xF1CB],
- ["8338C437",0xF1CC],
- ["8338C438",0xF1CD],
- ["8338C439",0xF1CE],
- ["8338C530",0xF1CF],
- ["8338C531",0xF1D0],
- ["8338C532",0xF1D1],
- ["8338C533",0xF1D2],
- ["8338C534",0xF1D3],
- ["8338C535",0xF1D4],
- ["8338C536",0xF1D5],
- ["8338C537",0xF1D6],
- ["8338C538",0xF1D7],
- ["8338C539",0xF1D8],
- ["8338C630",0xF1D9],
- ["8338C631",0xF1DA],
- ["8338C632",0xF1DB],
- ["8338C633",0xF1DC],
- ["8338C634",0xF1DD],
- ["8338C635",0xF1DE],
- ["8338C636",0xF1DF],
- ["8338C637",0xF1E0],
- ["8338C638",0xF1E1],
- ["8338C639",0xF1E2],
- ["8338C730",0xF1E3],
- ["8338C731",0xF1E4],
- ["8338C732",0xF1E5],
- ["8338C733",0xF1E6],
- ["8338C734",0xF1E7],
- ["8338C735",0xF1E8],
- ["8338C736",0xF1E9],
- ["8338C737",0xF1EA],
- ["8338C738",0xF1EB],
- ["8338C739",0xF1EC],
- ["8338C830",0xF1ED],
- ["8338C831",0xF1EE],
- ["8338C832",0xF1EF],
- ["8338C833",0xF1F0],
- ["8338C834",0xF1F1],
- ["8338C835",0xF1F2],
- ["8338C836",0xF1F3],
- ["8338C837",0xF1F4],
- ["8338C838",0xF1F5],
- ["8338C839",0xF1F6],
- ["8338C930",0xF1F7],
- ["8338C931",0xF1F8],
- ["8338C932",0xF1F9],
- ["8338C933",0xF1FA],
- ["8338C934",0xF1FB],
- ["8338C935",0xF1FC],
- ["8338C936",0xF1FD],
- ["8338C937",0xF1FE],
- ["8338C938",0xF1FF],
- ["8338C939",0xF200],
- ["8338CA30",0xF201],
- ["8338CA31",0xF202],
- ["8338CA32",0xF203],
- ["8338CA33",0xF204],
- ["8338CA34",0xF205],
- ["8338CA35",0xF206],
- ["8338CA36",0xF207],
- ["8338CA37",0xF208],
- ["8338CA38",0xF209],
- ["8338CA39",0xF20A],
- ["8338CB30",0xF20B],
- ["8338CB31",0xF20C],
- ["8338CB32",0xF20D],
- ["8338CB33",0xF20E],
- ["8338CB34",0xF20F],
- ["8338CB35",0xF210],
- ["8338CB36",0xF211],
- ["8338CB37",0xF212],
- ["8338CB38",0xF213],
- ["8338CB39",0xF214],
- ["8338CC30",0xF215],
- ["8338CC31",0xF216],
- ["8338CC32",0xF217],
- ["8338CC33",0xF218],
- ["8338CC34",0xF219],
- ["8338CC35",0xF21A],
- ["8338CC36",0xF21B],
- ["8338CC37",0xF21C],
- ["8338CC38",0xF21D],
- ["8338CC39",0xF21E],
- ["8338CD30",0xF21F],
- ["8338CD31",0xF220],
- ["8338CD32",0xF221],
- ["8338CD33",0xF222],
- ["8338CD34",0xF223],
- ["8338CD35",0xF224],
- ["8338CD36",0xF225],
- ["8338CD37",0xF226],
- ["8338CD38",0xF227],
- ["8338CD39",0xF228],
- ["8338CE30",0xF229],
- ["8338CE31",0xF22A],
- ["8338CE32",0xF22B],
- ["8338CE33",0xF22C],
- ["8338CE34",0xF22D],
- ["8338CE35",0xF22E],
- ["8338CE36",0xF22F],
- ["8338CE37",0xF230],
- ["8338CE38",0xF231],
- ["8338CE39",0xF232],
- ["8338CF30",0xF233],
- ["8338CF31",0xF234],
- ["8338CF32",0xF235],
- ["8338CF33",0xF236],
- ["8338CF34",0xF237],
- ["8338CF35",0xF238],
- ["8338CF36",0xF239],
- ["8338CF37",0xF23A],
- ["8338CF38",0xF23B],
- ["8338CF39",0xF23C],
- ["8338D030",0xF23D],
- ["8338D031",0xF23E],
- ["8338D032",0xF23F],
- ["8338D033",0xF240],
- ["8338D034",0xF241],
- ["8338D035",0xF242],
- ["8338D036",0xF243],
- ["8338D037",0xF244],
- ["8338D038",0xF245],
- ["8338D039",0xF246],
- ["8338D130",0xF247],
- ["8338D131",0xF248],
- ["8338D132",0xF249],
- ["8338D133",0xF24A],
- ["8338D134",0xF24B],
- ["8338D135",0xF24C],
- ["8338D136",0xF24D],
- ["8338D137",0xF24E],
- ["8338D138",0xF24F],
- ["8338D139",0xF250],
- ["8338D230",0xF251],
- ["8338D231",0xF252],
- ["8338D232",0xF253],
- ["8338D233",0xF254],
- ["8338D234",0xF255],
- ["8338D235",0xF256],
- ["8338D236",0xF257],
- ["8338D237",0xF258],
- ["8338D238",0xF259],
- ["8338D239",0xF25A],
- ["8338D330",0xF25B],
- ["8338D331",0xF25C],
- ["8338D332",0xF25D],
- ["8338D333",0xF25E],
- ["8338D334",0xF25F],
- ["8338D335",0xF260],
- ["8338D336",0xF261],
- ["8338D337",0xF262],
- ["8338D338",0xF263],
- ["8338D339",0xF264],
- ["8338D430",0xF265],
- ["8338D431",0xF266],
- ["8338D432",0xF267],
- ["8338D433",0xF268],
- ["8338D434",0xF269],
- ["8338D435",0xF26A],
- ["8338D436",0xF26B],
- ["8338D437",0xF26C],
- ["8338D438",0xF26D],
- ["8338D439",0xF26E],
- ["8338D530",0xF26F],
- ["8338D531",0xF270],
- ["8338D532",0xF271],
- ["8338D533",0xF272],
- ["8338D534",0xF273],
- ["8338D535",0xF274],
- ["8338D536",0xF275],
- ["8338D537",0xF276],
- ["8338D538",0xF277],
- ["8338D539",0xF278],
- ["8338D630",0xF279],
- ["8338D631",0xF27A],
- ["8338D632",0xF27B],
- ["8338D633",0xF27C],
- ["8338D634",0xF27D],
- ["8338D635",0xF27E],
- ["8338D636",0xF27F],
- ["8338D637",0xF280],
- ["8338D638",0xF281],
- ["8338D639",0xF282],
- ["8338D730",0xF283],
- ["8338D731",0xF284],
- ["8338D732",0xF285],
- ["8338D733",0xF286],
- ["8338D734",0xF287],
- ["8338D735",0xF288],
- ["8338D736",0xF289],
- ["8338D737",0xF28A],
- ["8338D738",0xF28B],
- ["8338D739",0xF28C],
- ["8338D830",0xF28D],
- ["8338D831",0xF28E],
- ["8338D832",0xF28F],
- ["8338D833",0xF290],
- ["8338D834",0xF291],
- ["8338D835",0xF292],
- ["8338D836",0xF293],
- ["8338D837",0xF294],
- ["8338D838",0xF295],
- ["8338D839",0xF296],
- ["8338D930",0xF297],
- ["8338D931",0xF298],
- ["8338D932",0xF299],
- ["8338D933",0xF29A],
- ["8338D934",0xF29B],
- ["8338D935",0xF29C],
- ["8338D936",0xF29D],
- ["8338D937",0xF29E],
- ["8338D938",0xF29F],
- ["8338D939",0xF2A0],
- ["8338DA30",0xF2A1],
- ["8338DA31",0xF2A2],
- ["8338DA32",0xF2A3],
- ["8338DA33",0xF2A4],
- ["8338DA34",0xF2A5],
- ["8338DA35",0xF2A6],
- ["8338DA36",0xF2A7],
- ["8338DA37",0xF2A8],
- ["8338DA38",0xF2A9],
- ["8338DA39",0xF2AA],
- ["8338DB30",0xF2AB],
- ["8338DB31",0xF2AC],
- ["8338DB32",0xF2AD],
- ["8338DB33",0xF2AE],
- ["8338DB34",0xF2AF],
- ["8338DB35",0xF2B0],
- ["8338DB36",0xF2B1],
- ["8338DB37",0xF2B2],
- ["8338DB38",0xF2B3],
- ["8338DB39",0xF2B4],
- ["8338DC30",0xF2B5],
- ["8338DC31",0xF2B6],
- ["8338DC32",0xF2B7],
- ["8338DC33",0xF2B8],
- ["8338DC34",0xF2B9],
- ["8338DC35",0xF2BA],
- ["8338DC36",0xF2BB],
- ["8338DC37",0xF2BC],
- ["8338DC38",0xF2BD],
- ["8338DC39",0xF2BE],
- ["8338DD30",0xF2BF],
- ["8338DD31",0xF2C0],
- ["8338DD32",0xF2C1],
- ["8338DD33",0xF2C2],
- ["8338DD34",0xF2C3],
- ["8338DD35",0xF2C4],
- ["8338DD36",0xF2C5],
- ["8338DD37",0xF2C6],
- ["8338DD38",0xF2C7],
- ["8338DD39",0xF2C8],
- ["8338DE30",0xF2C9],
- ["8338DE31",0xF2CA],
- ["8338DE32",0xF2CB],
- ["8338DE33",0xF2CC],
- ["8338DE34",0xF2CD],
- ["8338DE35",0xF2CE],
- ["8338DE36",0xF2CF],
- ["8338DE37",0xF2D0],
- ["8338DE38",0xF2D1],
- ["8338DE39",0xF2D2],
- ["8338DF30",0xF2D3],
- ["8338DF31",0xF2D4],
- ["8338DF32",0xF2D5],
- ["8338DF33",0xF2D6],
- ["8338DF34",0xF2D7],
- ["8338DF35",0xF2D8],
- ["8338DF36",0xF2D9],
- ["8338DF37",0xF2DA],
- ["8338DF38",0xF2DB],
- ["8338DF39",0xF2DC],
- ["8338E030",0xF2DD],
- ["8338E031",0xF2DE],
- ["8338E032",0xF2DF],
- ["8338E033",0xF2E0],
- ["8338E034",0xF2E1],
- ["8338E035",0xF2E2],
- ["8338E036",0xF2E3],
- ["8338E037",0xF2E4],
- ["8338E038",0xF2E5],
- ["8338E039",0xF2E6],
- ["8338E130",0xF2E7],
- ["8338E131",0xF2E8],
- ["8338E132",0xF2E9],
- ["8338E133",0xF2EA],
- ["8338E134",0xF2EB],
- ["8338E135",0xF2EC],
- ["8338E136",0xF2ED],
- ["8338E137",0xF2EE],
- ["8338E138",0xF2EF],
- ["8338E139",0xF2F0],
- ["8338E230",0xF2F1],
- ["8338E231",0xF2F2],
- ["8338E232",0xF2F3],
- ["8338E233",0xF2F4],
- ["8338E234",0xF2F5],
- ["8338E235",0xF2F6],
- ["8338E236",0xF2F7],
- ["8338E237",0xF2F8],
- ["8338E238",0xF2F9],
- ["8338E239",0xF2FA],
- ["8338E330",0xF2FB],
- ["8338E331",0xF2FC],
- ["8338E332",0xF2FD],
- ["8338E333",0xF2FE],
- ["8338E334",0xF2FF],
- ["8338E335",0xF300],
- ["8338E336",0xF301],
- ["8338E337",0xF302],
- ["8338E338",0xF303],
- ["8338E339",0xF304],
- ["8338E430",0xF305],
- ["8338E431",0xF306],
- ["8338E432",0xF307],
- ["8338E433",0xF308],
- ["8338E434",0xF309],
- ["8338E435",0xF30A],
- ["8338E436",0xF30B],
- ["8338E437",0xF30C],
- ["8338E438",0xF30D],
- ["8338E439",0xF30E],
- ["8338E530",0xF30F],
- ["8338E531",0xF310],
- ["8338E532",0xF311],
- ["8338E533",0xF312],
- ["8338E534",0xF313],
- ["8338E535",0xF314],
- ["8338E536",0xF315],
- ["8338E537",0xF316],
- ["8338E538",0xF317],
- ["8338E539",0xF318],
- ["8338E630",0xF319],
- ["8338E631",0xF31A],
- ["8338E632",0xF31B],
- ["8338E633",0xF31C],
- ["8338E634",0xF31D],
- ["8338E635",0xF31E],
- ["8338E636",0xF31F],
- ["8338E637",0xF320],
- ["8338E638",0xF321],
- ["8338E639",0xF322],
- ["8338E730",0xF323],
- ["8338E731",0xF324],
- ["8338E732",0xF325],
- ["8338E733",0xF326],
- ["8338E734",0xF327],
- ["8338E735",0xF328],
- ["8338E736",0xF329],
- ["8338E737",0xF32A],
- ["8338E738",0xF32B],
- ["8338E739",0xF32C],
- ["8338E830",0xF32D],
- ["8338E831",0xF32E],
- ["8338E832",0xF32F],
- ["8338E833",0xF330],
- ["8338E834",0xF331],
- ["8338E835",0xF332],
- ["8338E836",0xF333],
- ["8338E837",0xF334],
- ["8338E838",0xF335],
- ["8338E839",0xF336],
- ["8338E930",0xF337],
- ["8338E931",0xF338],
- ["8338E932",0xF339],
- ["8338E933",0xF33A],
- ["8338E934",0xF33B],
- ["8338E935",0xF33C],
- ["8338E936",0xF33D],
- ["8338E937",0xF33E],
- ["8338E938",0xF33F],
- ["8338E939",0xF340],
- ["8338EA30",0xF341],
- ["8338EA31",0xF342],
- ["8338EA32",0xF343],
- ["8338EA33",0xF344],
- ["8338EA34",0xF345],
- ["8338EA35",0xF346],
- ["8338EA36",0xF347],
- ["8338EA37",0xF348],
- ["8338EA38",0xF349],
- ["8338EA39",0xF34A],
- ["8338EB30",0xF34B],
- ["8338EB31",0xF34C],
- ["8338EB32",0xF34D],
- ["8338EB33",0xF34E],
- ["8338EB34",0xF34F],
- ["8338EB35",0xF350],
- ["8338EB36",0xF351],
- ["8338EB37",0xF352],
- ["8338EB38",0xF353],
- ["8338EB39",0xF354],
- ["8338EC30",0xF355],
- ["8338EC31",0xF356],
- ["8338EC32",0xF357],
- ["8338EC33",0xF358],
- ["8338EC34",0xF359],
- ["8338EC35",0xF35A],
- ["8338EC36",0xF35B],
- ["8338EC37",0xF35C],
- ["8338EC38",0xF35D],
- ["8338EC39",0xF35E],
- ["8338ED30",0xF35F],
- ["8338ED31",0xF360],
- ["8338ED32",0xF361],
- ["8338ED33",0xF362],
- ["8338ED34",0xF363],
- ["8338ED35",0xF364],
- ["8338ED36",0xF365],
- ["8338ED37",0xF366],
- ["8338ED38",0xF367],
- ["8338ED39",0xF368],
- ["8338EE30",0xF369],
- ["8338EE31",0xF36A],
- ["8338EE32",0xF36B],
- ["8338EE33",0xF36C],
- ["8338EE34",0xF36D],
- ["8338EE35",0xF36E],
- ["8338EE36",0xF36F],
- ["8338EE37",0xF370],
- ["8338EE38",0xF371],
- ["8338EE39",0xF372],
- ["8338EF30",0xF373],
- ["8338EF31",0xF374],
- ["8338EF32",0xF375],
- ["8338EF33",0xF376],
- ["8338EF34",0xF377],
- ["8338EF35",0xF378],
- ["8338EF36",0xF379],
- ["8338EF37",0xF37A],
- ["8338EF38",0xF37B],
- ["8338EF39",0xF37C],
- ["8338F030",0xF37D],
- ["8338F031",0xF37E],
- ["8338F032",0xF37F],
- ["8338F033",0xF380],
- ["8338F034",0xF381],
- ["8338F035",0xF382],
- ["8338F036",0xF383],
- ["8338F037",0xF384],
- ["8338F038",0xF385],
- ["8338F039",0xF386],
- ["8338F130",0xF387],
- ["8338F131",0xF388],
- ["8338F132",0xF389],
- ["8338F133",0xF38A],
- ["8338F134",0xF38B],
- ["8338F135",0xF38C],
- ["8338F136",0xF38D],
- ["8338F137",0xF38E],
- ["8338F138",0xF38F],
- ["8338F139",0xF390],
- ["8338F230",0xF391],
- ["8338F231",0xF392],
- ["8338F232",0xF393],
- ["8338F233",0xF394],
- ["8338F234",0xF395],
- ["8338F235",0xF396],
- ["8338F236",0xF397],
- ["8338F237",0xF398],
- ["8338F238",0xF399],
- ["8338F239",0xF39A],
- ["8338F330",0xF39B],
- ["8338F331",0xF39C],
- ["8338F332",0xF39D],
- ["8338F333",0xF39E],
- ["8338F334",0xF39F],
- ["8338F335",0xF3A0],
- ["8338F336",0xF3A1],
- ["8338F337",0xF3A2],
- ["8338F338",0xF3A3],
- ["8338F339",0xF3A4],
- ["8338F430",0xF3A5],
- ["8338F431",0xF3A6],
- ["8338F432",0xF3A7],
- ["8338F433",0xF3A8],
- ["8338F434",0xF3A9],
- ["8338F435",0xF3AA],
- ["8338F436",0xF3AB],
- ["8338F437",0xF3AC],
- ["8338F438",0xF3AD],
- ["8338F439",0xF3AE],
- ["8338F530",0xF3AF],
- ["8338F531",0xF3B0],
- ["8338F532",0xF3B1],
- ["8338F533",0xF3B2],
- ["8338F534",0xF3B3],
- ["8338F535",0xF3B4],
- ["8338F536",0xF3B5],
- ["8338F537",0xF3B6],
- ["8338F538",0xF3B7],
- ["8338F539",0xF3B8],
- ["8338F630",0xF3B9],
- ["8338F631",0xF3BA],
- ["8338F632",0xF3BB],
- ["8338F633",0xF3BC],
- ["8338F634",0xF3BD],
- ["8338F635",0xF3BE],
- ["8338F636",0xF3BF],
- ["8338F637",0xF3C0],
- ["8338F638",0xF3C1],
- ["8338F639",0xF3C2],
- ["8338F730",0xF3C3],
- ["8338F731",0xF3C4],
- ["8338F732",0xF3C5],
- ["8338F733",0xF3C6],
- ["8338F734",0xF3C7],
- ["8338F735",0xF3C8],
- ["8338F736",0xF3C9],
- ["8338F737",0xF3CA],
- ["8338F738",0xF3CB],
- ["8338F739",0xF3CC],
- ["8338F830",0xF3CD],
- ["8338F831",0xF3CE],
- ["8338F832",0xF3CF],
- ["8338F833",0xF3D0],
- ["8338F834",0xF3D1],
- ["8338F835",0xF3D2],
- ["8338F836",0xF3D3],
- ["8338F837",0xF3D4],
- ["8338F838",0xF3D5],
- ["8338F839",0xF3D6],
- ["8338F930",0xF3D7],
- ["8338F931",0xF3D8],
- ["8338F932",0xF3D9],
- ["8338F933",0xF3DA],
- ["8338F934",0xF3DB],
- ["8338F935",0xF3DC],
- ["8338F936",0xF3DD],
- ["8338F937",0xF3DE],
- ["8338F938",0xF3DF],
- ["8338F939",0xF3E0],
- ["8338FA30",0xF3E1],
- ["8338FA31",0xF3E2],
- ["8338FA32",0xF3E3],
- ["8338FA33",0xF3E4],
- ["8338FA34",0xF3E5],
- ["8338FA35",0xF3E6],
- ["8338FA36",0xF3E7],
- ["8338FA37",0xF3E8],
- ["8338FA38",0xF3E9],
- ["8338FA39",0xF3EA],
- ["8338FB30",0xF3EB],
- ["8338FB31",0xF3EC],
- ["8338FB32",0xF3ED],
- ["8338FB33",0xF3EE],
- ["8338FB34",0xF3EF],
- ["8338FB35",0xF3F0],
- ["8338FB36",0xF3F1],
- ["8338FB37",0xF3F2],
- ["8338FB38",0xF3F3],
- ["8338FB39",0xF3F4],
- ["8338FC30",0xF3F5],
- ["8338FC31",0xF3F6],
- ["8338FC32",0xF3F7],
- ["8338FC33",0xF3F8],
- ["8338FC34",0xF3F9],
- ["8338FC35",0xF3FA],
- ["8338FC36",0xF3FB],
- ["8338FC37",0xF3FC],
- ["8338FC38",0xF3FD],
- ["8338FC39",0xF3FE],
- ["8338FD30",0xF3FF],
- ["8338FD31",0xF400],
- ["8338FD32",0xF401],
- ["8338FD33",0xF402],
- ["8338FD34",0xF403],
- ["8338FD35",0xF404],
- ["8338FD36",0xF405],
- ["8338FD37",0xF406],
- ["8338FD38",0xF407],
- ["8338FD39",0xF408],
- ["8338FE30",0xF409],
- ["8338FE31",0xF40A],
- ["8338FE32",0xF40B],
- ["8338FE33",0xF40C],
- ["8338FE34",0xF40D],
- ["8338FE35",0xF40E],
- ["8338FE36",0xF40F],
- ["8338FE37",0xF410],
- ["8338FE38",0xF411],
- ["8338FE39",0xF412],
- ["83398130",0xF413],
- ["83398131",0xF414],
- ["83398132",0xF415],
- ["83398133",0xF416],
- ["83398134",0xF417],
- ["83398135",0xF418],
- ["83398136",0xF419],
- ["83398137",0xF41A],
- ["83398138",0xF41B],
- ["83398139",0xF41C],
- ["83398230",0xF41D],
- ["83398231",0xF41E],
- ["83398232",0xF41F],
- ["83398233",0xF420],
- ["83398234",0xF421],
- ["83398235",0xF422],
- ["83398236",0xF423],
- ["83398237",0xF424],
- ["83398238",0xF425],
- ["83398239",0xF426],
- ["83398330",0xF427],
- ["83398331",0xF428],
- ["83398332",0xF429],
- ["83398333",0xF42A],
- ["83398334",0xF42B],
- ["83398335",0xF42C],
- ["83398336",0xF42D],
- ["83398337",0xF42E],
- ["83398338",0xF42F],
- ["83398339",0xF430],
- ["83398430",0xF431],
- ["83398431",0xF432],
- ["83398432",0xF433],
- ["83398433",0xF434],
- ["83398434",0xF435],
- ["83398435",0xF436],
- ["83398436",0xF437],
- ["83398437",0xF438],
- ["83398438",0xF439],
- ["83398439",0xF43A],
- ["83398530",0xF43B],
- ["83398531",0xF43C],
- ["83398532",0xF43D],
- ["83398533",0xF43E],
- ["83398534",0xF43F],
- ["83398535",0xF440],
- ["83398536",0xF441],
- ["83398537",0xF442],
- ["83398538",0xF443],
- ["83398539",0xF444],
- ["83398630",0xF445],
- ["83398631",0xF446],
- ["83398632",0xF447],
- ["83398633",0xF448],
- ["83398634",0xF449],
- ["83398635",0xF44A],
- ["83398636",0xF44B],
- ["83398637",0xF44C],
- ["83398638",0xF44D],
- ["83398639",0xF44E],
- ["83398730",0xF44F],
- ["83398731",0xF450],
- ["83398732",0xF451],
- ["83398733",0xF452],
- ["83398734",0xF453],
- ["83398735",0xF454],
- ["83398736",0xF455],
- ["83398737",0xF456],
- ["83398738",0xF457],
- ["83398739",0xF458],
- ["83398830",0xF459],
- ["83398831",0xF45A],
- ["83398832",0xF45B],
- ["83398833",0xF45C],
- ["83398834",0xF45D],
- ["83398835",0xF45E],
- ["83398836",0xF45F],
- ["83398837",0xF460],
- ["83398838",0xF461],
- ["83398839",0xF462],
- ["83398930",0xF463],
- ["83398931",0xF464],
- ["83398932",0xF465],
- ["83398933",0xF466],
- ["83398934",0xF467],
- ["83398935",0xF468],
- ["83398936",0xF469],
- ["83398937",0xF46A],
- ["83398938",0xF46B],
- ["83398939",0xF46C],
- ["83398A30",0xF46D],
- ["83398A31",0xF46E],
- ["83398A32",0xF46F],
- ["83398A33",0xF470],
- ["83398A34",0xF471],
- ["83398A35",0xF472],
- ["83398A36",0xF473],
- ["83398A37",0xF474],
- ["83398A38",0xF475],
- ["83398A39",0xF476],
- ["83398B30",0xF477],
- ["83398B31",0xF478],
- ["83398B32",0xF479],
- ["83398B33",0xF47A],
- ["83398B34",0xF47B],
- ["83398B35",0xF47C],
- ["83398B36",0xF47D],
- ["83398B37",0xF47E],
- ["83398B38",0xF47F],
- ["83398B39",0xF480],
- ["83398C30",0xF481],
- ["83398C31",0xF482],
- ["83398C32",0xF483],
- ["83398C33",0xF484],
- ["83398C34",0xF485],
- ["83398C35",0xF486],
- ["83398C36",0xF487],
- ["83398C37",0xF488],
- ["83398C38",0xF489],
- ["83398C39",0xF48A],
- ["83398D30",0xF48B],
- ["83398D31",0xF48C],
- ["83398D32",0xF48D],
- ["83398D33",0xF48E],
- ["83398D34",0xF48F],
- ["83398D35",0xF490],
- ["83398D36",0xF491],
- ["83398D37",0xF492],
- ["83398D38",0xF493],
- ["83398D39",0xF494],
- ["83398E30",0xF495],
- ["83398E31",0xF496],
- ["83398E32",0xF497],
- ["83398E33",0xF498],
- ["83398E34",0xF499],
- ["83398E35",0xF49A],
- ["83398E36",0xF49B],
- ["83398E37",0xF49C],
- ["83398E38",0xF49D],
- ["83398E39",0xF49E],
- ["83398F30",0xF49F],
- ["83398F31",0xF4A0],
- ["83398F32",0xF4A1],
- ["83398F33",0xF4A2],
- ["83398F34",0xF4A3],
- ["83398F35",0xF4A4],
- ["83398F36",0xF4A5],
- ["83398F37",0xF4A6],
- ["83398F38",0xF4A7],
- ["83398F39",0xF4A8],
- ["83399030",0xF4A9],
- ["83399031",0xF4AA],
- ["83399032",0xF4AB],
- ["83399033",0xF4AC],
- ["83399034",0xF4AD],
- ["83399035",0xF4AE],
- ["83399036",0xF4AF],
- ["83399037",0xF4B0],
- ["83399038",0xF4B1],
- ["83399039",0xF4B2],
- ["83399130",0xF4B3],
- ["83399131",0xF4B4],
- ["83399132",0xF4B5],
- ["83399133",0xF4B6],
- ["83399134",0xF4B7],
- ["83399135",0xF4B8],
- ["83399136",0xF4B9],
- ["83399137",0xF4BA],
- ["83399138",0xF4BB],
- ["83399139",0xF4BC],
- ["83399230",0xF4BD],
- ["83399231",0xF4BE],
- ["83399232",0xF4BF],
- ["83399233",0xF4C0],
- ["83399234",0xF4C1],
- ["83399235",0xF4C2],
- ["83399236",0xF4C3],
- ["83399237",0xF4C4],
- ["83399238",0xF4C5],
- ["83399239",0xF4C6],
- ["83399330",0xF4C7],
- ["83399331",0xF4C8],
- ["83399332",0xF4C9],
- ["83399333",0xF4CA],
- ["83399334",0xF4CB],
- ["83399335",0xF4CC],
- ["83399336",0xF4CD],
- ["83399337",0xF4CE],
- ["83399338",0xF4CF],
- ["83399339",0xF4D0],
- ["83399430",0xF4D1],
- ["83399431",0xF4D2],
- ["83399432",0xF4D3],
- ["83399433",0xF4D4],
- ["83399434",0xF4D5],
- ["83399435",0xF4D6],
- ["83399436",0xF4D7],
- ["83399437",0xF4D8],
- ["83399438",0xF4D9],
- ["83399439",0xF4DA],
- ["83399530",0xF4DB],
- ["83399531",0xF4DC],
- ["83399532",0xF4DD],
- ["83399533",0xF4DE],
- ["83399534",0xF4DF],
- ["83399535",0xF4E0],
- ["83399536",0xF4E1],
- ["83399537",0xF4E2],
- ["83399538",0xF4E3],
- ["83399539",0xF4E4],
- ["83399630",0xF4E5],
- ["83399631",0xF4E6],
- ["83399632",0xF4E7],
- ["83399633",0xF4E8],
- ["83399634",0xF4E9],
- ["83399635",0xF4EA],
- ["83399636",0xF4EB],
- ["83399637",0xF4EC],
- ["83399638",0xF4ED],
- ["83399639",0xF4EE],
- ["83399730",0xF4EF],
- ["83399731",0xF4F0],
- ["83399732",0xF4F1],
- ["83399733",0xF4F2],
- ["83399734",0xF4F3],
- ["83399735",0xF4F4],
- ["83399736",0xF4F5],
- ["83399737",0xF4F6],
- ["83399738",0xF4F7],
- ["83399739",0xF4F8],
- ["83399830",0xF4F9],
- ["83399831",0xF4FA],
- ["83399832",0xF4FB],
- ["83399833",0xF4FC],
- ["83399834",0xF4FD],
- ["83399835",0xF4FE],
- ["83399836",0xF4FF],
- ["83399837",0xF500],
- ["83399838",0xF501],
- ["83399839",0xF502],
- ["83399930",0xF503],
- ["83399931",0xF504],
- ["83399932",0xF505],
- ["83399933",0xF506],
- ["83399934",0xF507],
- ["83399935",0xF508],
- ["83399936",0xF509],
- ["83399937",0xF50A],
- ["83399938",0xF50B],
- ["83399939",0xF50C],
- ["83399A30",0xF50D],
- ["83399A31",0xF50E],
- ["83399A32",0xF50F],
- ["83399A33",0xF510],
- ["83399A34",0xF511],
- ["83399A35",0xF512],
- ["83399A36",0xF513],
- ["83399A37",0xF514],
- ["83399A38",0xF515],
- ["83399A39",0xF516],
- ["83399B30",0xF517],
- ["83399B31",0xF518],
- ["83399B32",0xF519],
- ["83399B33",0xF51A],
- ["83399B34",0xF51B],
- ["83399B35",0xF51C],
- ["83399B36",0xF51D],
- ["83399B37",0xF51E],
- ["83399B38",0xF51F],
- ["83399B39",0xF520],
- ["83399C30",0xF521],
- ["83399C31",0xF522],
- ["83399C32",0xF523],
- ["83399C33",0xF524],
- ["83399C34",0xF525],
- ["83399C35",0xF526],
- ["83399C36",0xF527],
- ["83399C37",0xF528],
- ["83399C38",0xF529],
- ["83399C39",0xF52A],
- ["83399D30",0xF52B],
- ["83399D31",0xF52C],
- ["83399D32",0xF52D],
- ["83399D33",0xF52E],
- ["83399D34",0xF52F],
- ["83399D35",0xF530],
- ["83399D36",0xF531],
- ["83399D37",0xF532],
- ["83399D38",0xF533],
- ["83399D39",0xF534],
- ["83399E30",0xF535],
- ["83399E31",0xF536],
- ["83399E32",0xF537],
- ["83399E33",0xF538],
- ["83399E34",0xF539],
- ["83399E35",0xF53A],
- ["83399E36",0xF53B],
- ["83399E37",0xF53C],
- ["83399E38",0xF53D],
- ["83399E39",0xF53E],
- ["83399F30",0xF53F],
- ["83399F31",0xF540],
- ["83399F32",0xF541],
- ["83399F33",0xF542],
- ["83399F34",0xF543],
- ["83399F35",0xF544],
- ["83399F36",0xF545],
- ["83399F37",0xF546],
- ["83399F38",0xF547],
- ["83399F39",0xF548],
- ["8339A030",0xF549],
- ["8339A031",0xF54A],
- ["8339A032",0xF54B],
- ["8339A033",0xF54C],
- ["8339A034",0xF54D],
- ["8339A035",0xF54E],
- ["8339A036",0xF54F],
- ["8339A037",0xF550],
- ["8339A038",0xF551],
- ["8339A039",0xF552],
- ["8339A130",0xF553],
- ["8339A131",0xF554],
- ["8339A132",0xF555],
- ["8339A133",0xF556],
- ["8339A134",0xF557],
- ["8339A135",0xF558],
- ["8339A136",0xF559],
- ["8339A137",0xF55A],
- ["8339A138",0xF55B],
- ["8339A139",0xF55C],
- ["8339A230",0xF55D],
- ["8339A231",0xF55E],
- ["8339A232",0xF55F],
- ["8339A233",0xF560],
- ["8339A234",0xF561],
- ["8339A235",0xF562],
- ["8339A236",0xF563],
- ["8339A237",0xF564],
- ["8339A238",0xF565],
- ["8339A239",0xF566],
- ["8339A330",0xF567],
- ["8339A331",0xF568],
- ["8339A332",0xF569],
- ["8339A333",0xF56A],
- ["8339A334",0xF56B],
- ["8339A335",0xF56C],
- ["8339A336",0xF56D],
- ["8339A337",0xF56E],
- ["8339A338",0xF56F],
- ["8339A339",0xF570],
- ["8339A430",0xF571],
- ["8339A431",0xF572],
- ["8339A432",0xF573],
- ["8339A433",0xF574],
- ["8339A434",0xF575],
- ["8339A435",0xF576],
- ["8339A436",0xF577],
- ["8339A437",0xF578],
- ["8339A438",0xF579],
- ["8339A439",0xF57A],
- ["8339A530",0xF57B],
- ["8339A531",0xF57C],
- ["8339A532",0xF57D],
- ["8339A533",0xF57E],
- ["8339A534",0xF57F],
- ["8339A535",0xF580],
- ["8339A536",0xF581],
- ["8339A537",0xF582],
- ["8339A538",0xF583],
- ["8339A539",0xF584],
- ["8339A630",0xF585],
- ["8339A631",0xF586],
- ["8339A632",0xF587],
- ["8339A633",0xF588],
- ["8339A634",0xF589],
- ["8339A635",0xF58A],
- ["8339A636",0xF58B],
- ["8339A637",0xF58C],
- ["8339A638",0xF58D],
- ["8339A639",0xF58E],
- ["8339A730",0xF58F],
- ["8339A731",0xF590],
- ["8339A732",0xF591],
- ["8339A733",0xF592],
- ["8339A734",0xF593],
- ["8339A735",0xF594],
- ["8339A736",0xF595],
- ["8339A737",0xF596],
- ["8339A738",0xF597],
- ["8339A739",0xF598],
- ["8339A830",0xF599],
- ["8339A831",0xF59A],
- ["8339A832",0xF59B],
- ["8339A833",0xF59C],
- ["8339A834",0xF59D],
- ["8339A835",0xF59E],
- ["8339A836",0xF59F],
- ["8339A837",0xF5A0],
- ["8339A838",0xF5A1],
- ["8339A839",0xF5A2],
- ["8339A930",0xF5A3],
- ["8339A931",0xF5A4],
- ["8339A932",0xF5A5],
- ["8339A933",0xF5A6],
- ["8339A934",0xF5A7],
- ["8339A935",0xF5A8],
- ["8339A936",0xF5A9],
- ["8339A937",0xF5AA],
- ["8339A938",0xF5AB],
- ["8339A939",0xF5AC],
- ["8339AA30",0xF5AD],
- ["8339AA31",0xF5AE],
- ["8339AA32",0xF5AF],
- ["8339AA33",0xF5B0],
- ["8339AA34",0xF5B1],
- ["8339AA35",0xF5B2],
- ["8339AA36",0xF5B3],
- ["8339AA37",0xF5B4],
- ["8339AA38",0xF5B5],
- ["8339AA39",0xF5B6],
- ["8339AB30",0xF5B7],
- ["8339AB31",0xF5B8],
- ["8339AB32",0xF5B9],
- ["8339AB33",0xF5BA],
- ["8339AB34",0xF5BB],
- ["8339AB35",0xF5BC],
- ["8339AB36",0xF5BD],
- ["8339AB37",0xF5BE],
- ["8339AB38",0xF5BF],
- ["8339AB39",0xF5C0],
- ["8339AC30",0xF5C1],
- ["8339AC31",0xF5C2],
- ["8339AC32",0xF5C3],
- ["8339AC33",0xF5C4],
- ["8339AC34",0xF5C5],
- ["8339AC35",0xF5C6],
- ["8339AC36",0xF5C7],
- ["8339AC37",0xF5C8],
- ["8339AC38",0xF5C9],
- ["8339AC39",0xF5CA],
- ["8339AD30",0xF5CB],
- ["8339AD31",0xF5CC],
- ["8339AD32",0xF5CD],
- ["8339AD33",0xF5CE],
- ["8339AD34",0xF5CF],
- ["8339AD35",0xF5D0],
- ["8339AD36",0xF5D1],
- ["8339AD37",0xF5D2],
- ["8339AD38",0xF5D3],
- ["8339AD39",0xF5D4],
- ["8339AE30",0xF5D5],
- ["8339AE31",0xF5D6],
- ["8339AE32",0xF5D7],
- ["8339AE33",0xF5D8],
- ["8339AE34",0xF5D9],
- ["8339AE35",0xF5DA],
- ["8339AE36",0xF5DB],
- ["8339AE37",0xF5DC],
- ["8339AE38",0xF5DD],
- ["8339AE39",0xF5DE],
- ["8339AF30",0xF5DF],
- ["8339AF31",0xF5E0],
- ["8339AF32",0xF5E1],
- ["8339AF33",0xF5E2],
- ["8339AF34",0xF5E3],
- ["8339AF35",0xF5E4],
- ["8339AF36",0xF5E5],
- ["8339AF37",0xF5E6],
- ["8339AF38",0xF5E7],
- ["8339AF39",0xF5E8],
- ["8339B030",0xF5E9],
- ["8339B031",0xF5EA],
- ["8339B032",0xF5EB],
- ["8339B033",0xF5EC],
- ["8339B034",0xF5ED],
- ["8339B035",0xF5EE],
- ["8339B036",0xF5EF],
- ["8339B037",0xF5F0],
- ["8339B038",0xF5F1],
- ["8339B039",0xF5F2],
- ["8339B130",0xF5F3],
- ["8339B131",0xF5F4],
- ["8339B132",0xF5F5],
- ["8339B133",0xF5F6],
- ["8339B134",0xF5F7],
- ["8339B135",0xF5F8],
- ["8339B136",0xF5F9],
- ["8339B137",0xF5FA],
- ["8339B138",0xF5FB],
- ["8339B139",0xF5FC],
- ["8339B230",0xF5FD],
- ["8339B231",0xF5FE],
- ["8339B232",0xF5FF],
- ["8339B233",0xF600],
- ["8339B234",0xF601],
- ["8339B235",0xF602],
- ["8339B236",0xF603],
- ["8339B237",0xF604],
- ["8339B238",0xF605],
- ["8339B239",0xF606],
- ["8339B330",0xF607],
- ["8339B331",0xF608],
- ["8339B332",0xF609],
- ["8339B333",0xF60A],
- ["8339B334",0xF60B],
- ["8339B335",0xF60C],
- ["8339B336",0xF60D],
- ["8339B337",0xF60E],
- ["8339B338",0xF60F],
- ["8339B339",0xF610],
- ["8339B430",0xF611],
- ["8339B431",0xF612],
- ["8339B432",0xF613],
- ["8339B433",0xF614],
- ["8339B434",0xF615],
- ["8339B435",0xF616],
- ["8339B436",0xF617],
- ["8339B437",0xF618],
- ["8339B438",0xF619],
- ["8339B439",0xF61A],
- ["8339B530",0xF61B],
- ["8339B531",0xF61C],
- ["8339B532",0xF61D],
- ["8339B533",0xF61E],
- ["8339B534",0xF61F],
- ["8339B535",0xF620],
- ["8339B536",0xF621],
- ["8339B537",0xF622],
- ["8339B538",0xF623],
- ["8339B539",0xF624],
- ["8339B630",0xF625],
- ["8339B631",0xF626],
- ["8339B632",0xF627],
- ["8339B633",0xF628],
- ["8339B634",0xF629],
- ["8339B635",0xF62A],
- ["8339B636",0xF62B],
- ["8339B637",0xF62C],
- ["8339B638",0xF62D],
- ["8339B639",0xF62E],
- ["8339B730",0xF62F],
- ["8339B731",0xF630],
- ["8339B732",0xF631],
- ["8339B733",0xF632],
- ["8339B734",0xF633],
- ["8339B735",0xF634],
- ["8339B736",0xF635],
- ["8339B737",0xF636],
- ["8339B738",0xF637],
- ["8339B739",0xF638],
- ["8339B830",0xF639],
- ["8339B831",0xF63A],
- ["8339B832",0xF63B],
- ["8339B833",0xF63C],
- ["8339B834",0xF63D],
- ["8339B835",0xF63E],
- ["8339B836",0xF63F],
- ["8339B837",0xF640],
- ["8339B838",0xF641],
- ["8339B839",0xF642],
- ["8339B930",0xF643],
- ["8339B931",0xF644],
- ["8339B932",0xF645],
- ["8339B933",0xF646],
- ["8339B934",0xF647],
- ["8339B935",0xF648],
- ["8339B936",0xF649],
- ["8339B937",0xF64A],
- ["8339B938",0xF64B],
- ["8339B939",0xF64C],
- ["8339BA30",0xF64D],
- ["8339BA31",0xF64E],
- ["8339BA32",0xF64F],
- ["8339BA33",0xF650],
- ["8339BA34",0xF651],
- ["8339BA35",0xF652],
- ["8339BA36",0xF653],
- ["8339BA37",0xF654],
- ["8339BA38",0xF655],
- ["8339BA39",0xF656],
- ["8339BB30",0xF657],
- ["8339BB31",0xF658],
- ["8339BB32",0xF659],
- ["8339BB33",0xF65A],
- ["8339BB34",0xF65B],
- ["8339BB35",0xF65C],
- ["8339BB36",0xF65D],
- ["8339BB37",0xF65E],
- ["8339BB38",0xF65F],
- ["8339BB39",0xF660],
- ["8339BC30",0xF661],
- ["8339BC31",0xF662],
- ["8339BC32",0xF663],
- ["8339BC33",0xF664],
- ["8339BC34",0xF665],
- ["8339BC35",0xF666],
- ["8339BC36",0xF667],
- ["8339BC37",0xF668],
- ["8339BC38",0xF669],
- ["8339BC39",0xF66A],
- ["8339BD30",0xF66B],
- ["8339BD31",0xF66C],
- ["8339BD32",0xF66D],
- ["8339BD33",0xF66E],
- ["8339BD34",0xF66F],
- ["8339BD35",0xF670],
- ["8339BD36",0xF671],
- ["8339BD37",0xF672],
- ["8339BD38",0xF673],
- ["8339BD39",0xF674],
- ["8339BE30",0xF675],
- ["8339BE31",0xF676],
- ["8339BE32",0xF677],
- ["8339BE33",0xF678],
- ["8339BE34",0xF679],
- ["8339BE35",0xF67A],
- ["8339BE36",0xF67B],
- ["8339BE37",0xF67C],
- ["8339BE38",0xF67D],
- ["8339BE39",0xF67E],
- ["8339BF30",0xF67F],
- ["8339BF31",0xF680],
- ["8339BF32",0xF681],
- ["8339BF33",0xF682],
- ["8339BF34",0xF683],
- ["8339BF35",0xF684],
- ["8339BF36",0xF685],
- ["8339BF37",0xF686],
- ["8339BF38",0xF687],
- ["8339BF39",0xF688],
- ["8339C030",0xF689],
- ["8339C031",0xF68A],
- ["8339C032",0xF68B],
- ["8339C033",0xF68C],
- ["8339C034",0xF68D],
- ["8339C035",0xF68E],
- ["8339C036",0xF68F],
- ["8339C037",0xF690],
- ["8339C038",0xF691],
- ["8339C039",0xF692],
- ["8339C130",0xF693],
- ["8339C131",0xF694],
- ["8339C132",0xF695],
- ["8339C133",0xF696],
- ["8339C134",0xF697],
- ["8339C135",0xF698],
- ["8339C136",0xF699],
- ["8339C137",0xF69A],
- ["8339C138",0xF69B],
- ["8339C139",0xF69C],
- ["8339C230",0xF69D],
- ["8339C231",0xF69E],
- ["8339C232",0xF69F],
- ["8339C233",0xF6A0],
- ["8339C234",0xF6A1],
- ["8339C235",0xF6A2],
- ["8339C236",0xF6A3],
- ["8339C237",0xF6A4],
- ["8339C238",0xF6A5],
- ["8339C239",0xF6A6],
- ["8339C330",0xF6A7],
- ["8339C331",0xF6A8],
- ["8339C332",0xF6A9],
- ["8339C333",0xF6AA],
- ["8339C334",0xF6AB],
- ["8339C335",0xF6AC],
- ["8339C336",0xF6AD],
- ["8339C337",0xF6AE],
- ["8339C338",0xF6AF],
- ["8339C339",0xF6B0],
- ["8339C430",0xF6B1],
- ["8339C431",0xF6B2],
- ["8339C432",0xF6B3],
- ["8339C433",0xF6B4],
- ["8339C434",0xF6B5],
- ["8339C435",0xF6B6],
- ["8339C436",0xF6B7],
- ["8339C437",0xF6B8],
- ["8339C438",0xF6B9],
- ["8339C439",0xF6BA],
- ["8339C530",0xF6BB],
- ["8339C531",0xF6BC],
- ["8339C532",0xF6BD],
- ["8339C533",0xF6BE],
- ["8339C534",0xF6BF],
- ["8339C535",0xF6C0],
- ["8339C536",0xF6C1],
- ["8339C537",0xF6C2],
- ["8339C538",0xF6C3],
- ["8339C539",0xF6C4],
- ["8339C630",0xF6C5],
- ["8339C631",0xF6C6],
- ["8339C632",0xF6C7],
- ["8339C633",0xF6C8],
- ["8339C634",0xF6C9],
- ["8339C635",0xF6CA],
- ["8339C636",0xF6CB],
- ["8339C637",0xF6CC],
- ["8339C638",0xF6CD],
- ["8339C639",0xF6CE],
- ["8339C730",0xF6CF],
- ["8339C731",0xF6D0],
- ["8339C732",0xF6D1],
- ["8339C733",0xF6D2],
- ["8339C734",0xF6D3],
- ["8339C735",0xF6D4],
- ["8339C736",0xF6D5],
- ["8339C737",0xF6D6],
- ["8339C738",0xF6D7],
- ["8339C739",0xF6D8],
- ["8339C830",0xF6D9],
- ["8339C831",0xF6DA],
- ["8339C832",0xF6DB],
- ["8339C833",0xF6DC],
- ["8339C834",0xF6DD],
- ["8339C835",0xF6DE],
- ["8339C836",0xF6DF],
- ["8339C837",0xF6E0],
- ["8339C838",0xF6E1],
- ["8339C839",0xF6E2],
- ["8339C930",0xF6E3],
- ["8339C931",0xF6E4],
- ["8339C932",0xF6E5],
- ["8339C933",0xF6E6],
- ["8339C934",0xF6E7],
- ["8339C935",0xF6E8],
- ["8339C936",0xF6E9],
- ["8339C937",0xF6EA],
- ["8339C938",0xF6EB],
- ["8339C939",0xF6EC],
- ["8339CA30",0xF6ED],
- ["8339CA31",0xF6EE],
- ["8339CA32",0xF6EF],
- ["8339CA33",0xF6F0],
- ["8339CA34",0xF6F1],
- ["8339CA35",0xF6F2],
- ["8339CA36",0xF6F3],
- ["8339CA37",0xF6F4],
- ["8339CA38",0xF6F5],
- ["8339CA39",0xF6F6],
- ["8339CB30",0xF6F7],
- ["8339CB31",0xF6F8],
- ["8339CB32",0xF6F9],
- ["8339CB33",0xF6FA],
- ["8339CB34",0xF6FB],
- ["8339CB35",0xF6FC],
- ["8339CB36",0xF6FD],
- ["8339CB37",0xF6FE],
- ["8339CB38",0xF6FF],
- ["8339CB39",0xF700],
- ["8339CC30",0xF701],
- ["8339CC31",0xF702],
- ["8339CC32",0xF703],
- ["8339CC33",0xF704],
- ["8339CC34",0xF705],
- ["8339CC35",0xF706],
- ["8339CC36",0xF707],
- ["8339CC37",0xF708],
- ["8339CC38",0xF709],
- ["8339CC39",0xF70A],
- ["8339CD30",0xF70B],
- ["8339CD31",0xF70C],
- ["8339CD32",0xF70D],
- ["8339CD33",0xF70E],
- ["8339CD34",0xF70F],
- ["8339CD35",0xF710],
- ["8339CD36",0xF711],
- ["8339CD37",0xF712],
- ["8339CD38",0xF713],
- ["8339CD39",0xF714],
- ["8339CE30",0xF715],
- ["8339CE31",0xF716],
- ["8339CE32",0xF717],
- ["8339CE33",0xF718],
- ["8339CE34",0xF719],
- ["8339CE35",0xF71A],
- ["8339CE36",0xF71B],
- ["8339CE37",0xF71C],
- ["8339CE38",0xF71D],
- ["8339CE39",0xF71E],
- ["8339CF30",0xF71F],
- ["8339CF31",0xF720],
- ["8339CF32",0xF721],
- ["8339CF33",0xF722],
- ["8339CF34",0xF723],
- ["8339CF35",0xF724],
- ["8339CF36",0xF725],
- ["8339CF37",0xF726],
- ["8339CF38",0xF727],
- ["8339CF39",0xF728],
- ["8339D030",0xF729],
- ["8339D031",0xF72A],
- ["8339D032",0xF72B],
- ["8339D033",0xF72C],
- ["8339D034",0xF72D],
- ["8339D035",0xF72E],
- ["8339D036",0xF72F],
- ["8339D037",0xF730],
- ["8339D038",0xF731],
- ["8339D039",0xF732],
- ["8339D130",0xF733],
- ["8339D131",0xF734],
- ["8339D132",0xF735],
- ["8339D133",0xF736],
- ["8339D134",0xF737],
- ["8339D135",0xF738],
- ["8339D136",0xF739],
- ["8339D137",0xF73A],
- ["8339D138",0xF73B],
- ["8339D139",0xF73C],
- ["8339D230",0xF73D],
- ["8339D231",0xF73E],
- ["8339D232",0xF73F],
- ["8339D233",0xF740],
- ["8339D234",0xF741],
- ["8339D235",0xF742],
- ["8339D236",0xF743],
- ["8339D237",0xF744],
- ["8339D238",0xF745],
- ["8339D239",0xF746],
- ["8339D330",0xF747],
- ["8339D331",0xF748],
- ["8339D332",0xF749],
- ["8339D333",0xF74A],
- ["8339D334",0xF74B],
- ["8339D335",0xF74C],
- ["8339D336",0xF74D],
- ["8339D337",0xF74E],
- ["8339D338",0xF74F],
- ["8339D339",0xF750],
- ["8339D430",0xF751],
- ["8339D431",0xF752],
- ["8339D432",0xF753],
- ["8339D433",0xF754],
- ["8339D434",0xF755],
- ["8339D435",0xF756],
- ["8339D436",0xF757],
- ["8339D437",0xF758],
- ["8339D438",0xF759],
- ["8339D439",0xF75A],
- ["8339D530",0xF75B],
- ["8339D531",0xF75C],
- ["8339D532",0xF75D],
- ["8339D533",0xF75E],
- ["8339D534",0xF75F],
- ["8339D535",0xF760],
- ["8339D536",0xF761],
- ["8339D537",0xF762],
- ["8339D538",0xF763],
- ["8339D539",0xF764],
- ["8339D630",0xF765],
- ["8339D631",0xF766],
- ["8339D632",0xF767],
- ["8339D633",0xF768],
- ["8339D634",0xF769],
- ["8339D635",0xF76A],
- ["8339D636",0xF76B],
- ["8339D637",0xF76C],
- ["8339D638",0xF76D],
- ["8339D639",0xF76E],
- ["8339D730",0xF76F],
- ["8339D731",0xF770],
- ["8339D732",0xF771],
- ["8339D733",0xF772],
- ["8339D734",0xF773],
- ["8339D735",0xF774],
- ["8339D736",0xF775],
- ["8339D737",0xF776],
- ["8339D738",0xF777],
- ["8339D739",0xF778],
- ["8339D830",0xF779],
- ["8339D831",0xF77A],
- ["8339D832",0xF77B],
- ["8339D833",0xF77C],
- ["8339D834",0xF77D],
- ["8339D835",0xF77E],
- ["8339D836",0xF77F],
- ["8339D837",0xF780],
- ["8339D838",0xF781],
- ["8339D839",0xF782],
- ["8339D930",0xF783],
- ["8339D931",0xF784],
- ["8339D932",0xF785],
- ["8339D933",0xF786],
- ["8339D934",0xF787],
- ["8339D935",0xF788],
- ["8339D936",0xF789],
- ["8339D937",0xF78A],
- ["8339D938",0xF78B],
- ["8339D939",0xF78C],
- ["8339DA30",0xF78D],
- ["8339DA31",0xF78E],
- ["8339DA32",0xF78F],
- ["8339DA33",0xF790],
- ["8339DA34",0xF791],
- ["8339DA35",0xF792],
- ["8339DA36",0xF793],
- ["8339DA37",0xF794],
- ["8339DA38",0xF795],
- ["8339DA39",0xF796],
- ["8339DB30",0xF797],
- ["8339DB31",0xF798],
- ["8339DB32",0xF799],
- ["8339DB33",0xF79A],
- ["8339DB34",0xF79B],
- ["8339DB35",0xF79C],
- ["8339DB36",0xF79D],
- ["8339DB37",0xF79E],
- ["8339DB38",0xF79F],
- ["8339DB39",0xF7A0],
- ["8339DC30",0xF7A1],
- ["8339DC31",0xF7A2],
- ["8339DC32",0xF7A3],
- ["8339DC33",0xF7A4],
- ["8339DC34",0xF7A5],
- ["8339DC35",0xF7A6],
- ["8339DC36",0xF7A7],
- ["8339DC37",0xF7A8],
- ["8339DC38",0xF7A9],
- ["8339DC39",0xF7AA],
- ["8339DD30",0xF7AB],
- ["8339DD31",0xF7AC],
- ["8339DD32",0xF7AD],
- ["8339DD33",0xF7AE],
- ["8339DD34",0xF7AF],
- ["8339DD35",0xF7B0],
- ["8339DD36",0xF7B1],
- ["8339DD37",0xF7B2],
- ["8339DD38",0xF7B3],
- ["8339DD39",0xF7B4],
- ["8339DE30",0xF7B5],
- ["8339DE31",0xF7B6],
- ["8339DE32",0xF7B7],
- ["8339DE33",0xF7B8],
- ["8339DE34",0xF7B9],
- ["8339DE35",0xF7BA],
- ["8339DE36",0xF7BB],
- ["8339DE37",0xF7BC],
- ["8339DE38",0xF7BD],
- ["8339DE39",0xF7BE],
- ["8339DF30",0xF7BF],
- ["8339DF31",0xF7C0],
- ["8339DF32",0xF7C1],
- ["8339DF33",0xF7C2],
- ["8339DF34",0xF7C3],
- ["8339DF35",0xF7C4],
- ["8339DF36",0xF7C5],
- ["8339DF37",0xF7C6],
- ["8339DF38",0xF7C7],
- ["8339DF39",0xF7C8],
- ["8339E030",0xF7C9],
- ["8339E031",0xF7CA],
- ["8339E032",0xF7CB],
- ["8339E033",0xF7CC],
- ["8339E034",0xF7CD],
- ["8339E035",0xF7CE],
- ["8339E036",0xF7CF],
- ["8339E037",0xF7D0],
- ["8339E038",0xF7D1],
- ["8339E039",0xF7D2],
- ["8339E130",0xF7D3],
- ["8339E131",0xF7D4],
- ["8339E132",0xF7D5],
- ["8339E133",0xF7D6],
- ["8339E134",0xF7D7],
- ["8339E135",0xF7D8],
- ["8339E136",0xF7D9],
- ["8339E137",0xF7DA],
- ["8339E138",0xF7DB],
- ["8339E139",0xF7DC],
- ["8339E230",0xF7DD],
- ["8339E231",0xF7DE],
- ["8339E232",0xF7DF],
- ["8339E233",0xF7E0],
- ["8339E234",0xF7E1],
- ["8339E235",0xF7E2],
- ["8339E236",0xF7E3],
- ["8339E237",0xF7E4],
- ["8339E238",0xF7E5],
- ["8339E239",0xF7E6],
- ["8339E330",0xF7E7],
- ["8339E331",0xF7E8],
- ["8339E332",0xF7E9],
- ["8339E333",0xF7EA],
- ["8339E334",0xF7EB],
- ["8339E335",0xF7EC],
- ["8339E336",0xF7ED],
- ["8339E337",0xF7EE],
- ["8339E338",0xF7EF],
- ["8339E339",0xF7F0],
- ["8339E430",0xF7F1],
- ["8339E431",0xF7F2],
- ["8339E432",0xF7F3],
- ["8339E433",0xF7F4],
- ["8339E434",0xF7F5],
- ["8339E435",0xF7F6],
- ["8339E436",0xF7F7],
- ["8339E437",0xF7F8],
- ["8339E438",0xF7F9],
- ["8339E439",0xF7FA],
- ["8339E530",0xF7FB],
- ["8339E531",0xF7FC],
- ["8339E532",0xF7FD],
- ["8339E533",0xF7FE],
- ["8339E534",0xF7FF],
- ["8339E535",0xF800],
- ["8339E536",0xF801],
- ["8339E537",0xF802],
- ["8339E538",0xF803],
- ["8339E539",0xF804],
- ["8339E630",0xF805],
- ["8339E631",0xF806],
- ["8339E632",0xF807],
- ["8339E633",0xF808],
- ["8339E634",0xF809],
- ["8339E635",0xF80A],
- ["8339E636",0xF80B],
- ["8339E637",0xF80C],
- ["8339E638",0xF80D],
- ["8339E639",0xF80E],
- ["8339E730",0xF80F],
- ["8339E731",0xF810],
- ["8339E732",0xF811],
- ["8339E733",0xF812],
- ["8339E734",0xF813],
- ["8339E735",0xF814],
- ["8339E736",0xF815],
- ["8339E737",0xF816],
- ["8339E738",0xF817],
- ["8339E739",0xF818],
- ["8339E830",0xF819],
- ["8339E831",0xF81A],
- ["8339E832",0xF81B],
- ["8339E833",0xF81C],
- ["8339E834",0xF81D],
- ["8339E835",0xF81E],
- ["8339E836",0xF81F],
- ["8339E837",0xF820],
- ["8339E838",0xF821],
- ["8339E839",0xF822],
- ["8339E930",0xF823],
- ["8339E931",0xF824],
- ["8339E932",0xF825],
- ["8339E933",0xF826],
- ["8339E934",0xF827],
- ["8339E935",0xF828],
- ["8339E936",0xF829],
- ["8339E937",0xF82A],
- ["8339E938",0xF82B],
- ["8339E939",0xF82C],
- ["8339EA30",0xF82D],
- ["8339EA31",0xF82E],
- ["8339EA32",0xF82F],
- ["8339EA33",0xF830],
- ["8339EA34",0xF831],
- ["8339EA35",0xF832],
- ["8339EA36",0xF833],
- ["8339EA37",0xF834],
- ["8339EA38",0xF835],
- ["8339EA39",0xF836],
- ["8339EB30",0xF837],
- ["8339EB31",0xF838],
- ["8339EB32",0xF839],
- ["8339EB33",0xF83A],
- ["8339EB34",0xF83B],
- ["8339EB35",0xF83C],
- ["8339EB36",0xF83D],
- ["8339EB37",0xF83E],
- ["8339EB38",0xF83F],
- ["8339EB39",0xF840],
- ["8339EC30",0xF841],
- ["8339EC31",0xF842],
- ["8339EC32",0xF843],
- ["8339EC33",0xF844],
- ["8339EC34",0xF845],
- ["8339EC35",0xF846],
- ["8339EC36",0xF847],
- ["8339EC37",0xF848],
- ["8339EC38",0xF849],
- ["8339EC39",0xF84A],
- ["8339ED30",0xF84B],
- ["8339ED31",0xF84C],
- ["8339ED32",0xF84D],
- ["8339ED33",0xF84E],
- ["8339ED34",0xF84F],
- ["8339ED35",0xF850],
- ["8339ED36",0xF851],
- ["8339ED37",0xF852],
- ["8339ED38",0xF853],
- ["8339ED39",0xF854],
- ["8339EE30",0xF855],
- ["8339EE31",0xF856],
- ["8339EE32",0xF857],
- ["8339EE33",0xF858],
- ["8339EE34",0xF859],
- ["8339EE35",0xF85A],
- ["8339EE36",0xF85B],
- ["8339EE37",0xF85C],
- ["8339EE38",0xF85D],
- ["8339EE39",0xF85E],
- ["8339EF30",0xF85F],
- ["8339EF31",0xF860],
- ["8339EF32",0xF861],
- ["8339EF33",0xF862],
- ["8339EF34",0xF863],
- ["8339EF35",0xF864],
- ["8339EF36",0xF865],
- ["8339EF37",0xF866],
- ["8339EF38",0xF867],
- ["8339EF39",0xF868],
- ["8339F030",0xF869],
- ["8339F031",0xF86A],
- ["8339F032",0xF86B],
- ["8339F033",0xF86C],
- ["8339F034",0xF86D],
- ["8339F035",0xF86E],
- ["8339F036",0xF86F],
- ["8339F037",0xF870],
- ["8339F038",0xF871],
- ["8339F039",0xF872],
- ["8339F130",0xF873],
- ["8339F131",0xF874],
- ["8339F132",0xF875],
- ["8339F133",0xF876],
- ["8339F134",0xF877],
- ["8339F135",0xF878],
- ["8339F136",0xF879],
- ["8339F137",0xF87A],
- ["8339F138",0xF87B],
- ["8339F139",0xF87C],
- ["8339F230",0xF87D],
- ["8339F231",0xF87E],
- ["8339F232",0xF87F],
- ["8339F233",0xF880],
- ["8339F234",0xF881],
- ["8339F235",0xF882],
- ["8339F236",0xF883],
- ["8339F237",0xF884],
- ["8339F238",0xF885],
- ["8339F239",0xF886],
- ["8339F330",0xF887],
- ["8339F331",0xF888],
- ["8339F332",0xF889],
- ["8339F333",0xF88A],
- ["8339F334",0xF88B],
- ["8339F335",0xF88C],
- ["8339F336",0xF88D],
- ["8339F337",0xF88E],
- ["8339F338",0xF88F],
- ["8339F339",0xF890],
- ["8339F430",0xF891],
- ["8339F431",0xF892],
- ["8339F432",0xF893],
- ["8339F433",0xF894],
- ["8339F434",0xF895],
- ["8339F435",0xF896],
- ["8339F436",0xF897],
- ["8339F437",0xF898],
- ["8339F438",0xF899],
- ["8339F439",0xF89A],
- ["8339F530",0xF89B],
- ["8339F531",0xF89C],
- ["8339F532",0xF89D],
- ["8339F533",0xF89E],
- ["8339F534",0xF89F],
- ["8339F535",0xF8A0],
- ["8339F536",0xF8A1],
- ["8339F537",0xF8A2],
- ["8339F538",0xF8A3],
- ["8339F539",0xF8A4],
- ["8339F630",0xF8A5],
- ["8339F631",0xF8A6],
- ["8339F632",0xF8A7],
- ["8339F633",0xF8A8],
- ["8339F634",0xF8A9],
- ["8339F635",0xF8AA],
- ["8339F636",0xF8AB],
- ["8339F637",0xF8AC],
- ["8339F638",0xF8AD],
- ["8339F639",0xF8AE],
- ["8339F730",0xF8AF],
- ["8339F731",0xF8B0],
- ["8339F732",0xF8B1],
- ["8339F733",0xF8B2],
- ["8339F734",0xF8B3],
- ["8339F735",0xF8B4],
- ["8339F736",0xF8B5],
- ["8339F737",0xF8B6],
- ["8339F738",0xF8B7],
- ["8339F739",0xF8B8],
- ["8339F830",0xF8B9],
- ["8339F831",0xF8BA],
- ["8339F832",0xF8BB],
- ["8339F833",0xF8BC],
- ["8339F834",0xF8BD],
- ["8339F835",0xF8BE],
- ["8339F836",0xF8BF],
- ["8339F837",0xF8C0],
- ["8339F838",0xF8C1],
- ["8339F839",0xF8C2],
- ["8339F930",0xF8C3],
- ["8339F931",0xF8C4],
- ["8339F932",0xF8C5],
- ["8339F933",0xF8C6],
- ["8339F934",0xF8C7],
- ["8339F935",0xF8C8],
- ["8339F936",0xF8C9],
- ["8339F937",0xF8CA],
- ["8339F938",0xF8CB],
- ["8339F939",0xF8CC],
- ["8339FA30",0xF8CD],
- ["8339FA31",0xF8CE],
- ["8339FA32",0xF8CF],
- ["8339FA33",0xF8D0],
- ["8339FA34",0xF8D1],
- ["8339FA35",0xF8D2],
- ["8339FA36",0xF8D3],
- ["8339FA37",0xF8D4],
- ["8339FA38",0xF8D5],
- ["8339FA39",0xF8D6],
- ["8339FB30",0xF8D7],
- ["8339FB31",0xF8D8],
- ["8339FB32",0xF8D9],
- ["8339FB33",0xF8DA],
- ["8339FB34",0xF8DB],
- ["8339FB35",0xF8DC],
- ["8339FB36",0xF8DD],
- ["8339FB37",0xF8DE],
- ["8339FB38",0xF8DF],
- ["8339FB39",0xF8E0],
- ["8339FC30",0xF8E1],
- ["8339FC31",0xF8E2],
- ["8339FC32",0xF8E3],
- ["8339FC33",0xF8E4],
- ["8339FC34",0xF8E5],
- ["8339FC35",0xF8E6],
- ["8339FC36",0xF8E7],
- ["8339FC37",0xF8E8],
- ["8339FC38",0xF8E9],
- ["8339FC39",0xF8EA],
- ["8339FD30",0xF8EB],
- ["8339FD31",0xF8EC],
- ["8339FD32",0xF8ED],
- ["8339FD33",0xF8EE],
- ["8339FD34",0xF8EF],
- ["8339FD35",0xF8F0],
- ["8339FD36",0xF8F1],
- ["8339FD37",0xF8F2],
- ["8339FD38",0xF8F3],
- ["8339FD39",0xF8F4],
- ["8339FE30",0xF8F5],
- ["8339FE31",0xF8F6],
- ["8339FE32",0xF8F7],
- ["8339FE33",0xF8F8],
- ["8339FE34",0xF8F9],
- ["8339FE35",0xF8FA],
- ["8339FE36",0xF8FB],
- ["8339FE37",0xF8FC],
- ["8339FE38",0xF8FD],
- ["8339FE39",0xF8FE],
- ["84308130",0xF8FF],
- ["84308131",0xF900],
- ["84308132",0xF901],
- ["84308133",0xF902],
- ["84308134",0xF903],
- ["84308135",0xF904],
- ["84308136",0xF905],
- ["84308137",0xF906],
- ["84308138",0xF907],
- ["84308139",0xF908],
- ["84308230",0xF909],
- ["84308231",0xF90A],
- ["84308232",0xF90B],
- ["84308233",0xF90C],
- ["84308234",0xF90D],
- ["84308235",0xF90E],
- ["84308236",0xF90F],
- ["84308237",0xF910],
- ["84308238",0xF911],
- ["84308239",0xF912],
- ["84308330",0xF913],
- ["84308331",0xF914],
- ["84308332",0xF915],
- ["84308333",0xF916],
- ["84308334",0xF917],
- ["84308335",0xF918],
- ["84308336",0xF919],
- ["84308337",0xF91A],
- ["84308338",0xF91B],
- ["84308339",0xF91C],
- ["84308430",0xF91D],
- ["84308431",0xF91E],
- ["84308432",0xF91F],
- ["84308433",0xF920],
- ["84308434",0xF921],
- ["84308435",0xF922],
- ["84308436",0xF923],
- ["84308437",0xF924],
- ["84308438",0xF925],
- ["84308439",0xF926],
- ["84308530",0xF927],
- ["84308531",0xF928],
- ["84308532",0xF929],
- ["84308533",0xF92A],
- ["84308534",0xF92B],
- ["FD9C",0xF92C],
- ["84308535",0xF92D],
- ["84308536",0xF92E],
- ["84308537",0xF92F],
- ["84308538",0xF930],
- ["84308539",0xF931],
- ["84308630",0xF932],
- ["84308631",0xF933],
- ["84308632",0xF934],
- ["84308633",0xF935],
- ["84308634",0xF936],
- ["84308635",0xF937],
- ["84308636",0xF938],
- ["84308637",0xF939],
- ["84308638",0xF93A],
- ["84308639",0xF93B],
- ["84308730",0xF93C],
- ["84308731",0xF93D],
- ["84308732",0xF93E],
- ["84308733",0xF93F],
- ["84308734",0xF940],
- ["84308735",0xF941],
- ["84308736",0xF942],
- ["84308737",0xF943],
- ["84308738",0xF944],
- ["84308739",0xF945],
- ["84308830",0xF946],
- ["84308831",0xF947],
- ["84308832",0xF948],
- ["84308833",0xF949],
- ["84308834",0xF94A],
- ["84308835",0xF94B],
- ["84308836",0xF94C],
- ["84308837",0xF94D],
- ["84308838",0xF94E],
- ["84308839",0xF94F],
- ["84308930",0xF950],
- ["84308931",0xF951],
- ["84308932",0xF952],
- ["84308933",0xF953],
- ["84308934",0xF954],
- ["84308935",0xF955],
- ["84308936",0xF956],
- ["84308937",0xF957],
- ["84308938",0xF958],
- ["84308939",0xF959],
- ["84308A30",0xF95A],
- ["84308A31",0xF95B],
- ["84308A32",0xF95C],
- ["84308A33",0xF95D],
- ["84308A34",0xF95E],
- ["84308A35",0xF95F],
- ["84308A36",0xF960],
- ["84308A37",0xF961],
- ["84308A38",0xF962],
- ["84308A39",0xF963],
- ["84308B30",0xF964],
- ["84308B31",0xF965],
- ["84308B32",0xF966],
- ["84308B33",0xF967],
- ["84308B34",0xF968],
- ["84308B35",0xF969],
- ["84308B36",0xF96A],
- ["84308B37",0xF96B],
- ["84308B38",0xF96C],
- ["84308B39",0xF96D],
- ["84308C30",0xF96E],
- ["84308C31",0xF96F],
- ["84308C32",0xF970],
- ["84308C33",0xF971],
- ["84308C34",0xF972],
- ["84308C35",0xF973],
- ["84308C36",0xF974],
- ["84308C37",0xF975],
- ["84308C38",0xF976],
- ["84308C39",0xF977],
- ["84308D30",0xF978],
- ["FD9D",0xF979],
- ["84308D31",0xF97A],
- ["84308D32",0xF97B],
- ["84308D33",0xF97C],
- ["84308D34",0xF97D],
- ["84308D35",0xF97E],
- ["84308D36",0xF97F],
- ["84308D37",0xF980],
- ["84308D38",0xF981],
- ["84308D39",0xF982],
- ["84308E30",0xF983],
- ["84308E31",0xF984],
- ["84308E32",0xF985],
- ["84308E33",0xF986],
- ["84308E34",0xF987],
- ["84308E35",0xF988],
- ["84308E36",0xF989],
- ["84308E37",0xF98A],
- ["84308E38",0xF98B],
- ["84308E39",0xF98C],
- ["84308F30",0xF98D],
- ["84308F31",0xF98E],
- ["84308F32",0xF98F],
- ["84308F33",0xF990],
- ["84308F34",0xF991],
- ["84308F35",0xF992],
- ["84308F36",0xF993],
- ["84308F37",0xF994],
- ["FD9E",0xF995],
- ["84308F38",0xF996],
- ["84308F39",0xF997],
- ["84309030",0xF998],
- ["84309031",0xF999],
- ["84309032",0xF99A],
- ["84309033",0xF99B],
- ["84309034",0xF99C],
- ["84309035",0xF99D],
- ["84309036",0xF99E],
- ["84309037",0xF99F],
- ["84309038",0xF9A0],
- ["84309039",0xF9A1],
- ["84309130",0xF9A2],
- ["84309131",0xF9A3],
- ["84309132",0xF9A4],
- ["84309133",0xF9A5],
- ["84309134",0xF9A6],
- ["84309135",0xF9A7],
- ["84309136",0xF9A8],
- ["84309137",0xF9A9],
- ["84309138",0xF9AA],
- ["84309139",0xF9AB],
- ["84309230",0xF9AC],
- ["84309231",0xF9AD],
- ["84309232",0xF9AE],
- ["84309233",0xF9AF],
- ["84309234",0xF9B0],
- ["84309235",0xF9B1],
- ["84309236",0xF9B2],
- ["84309237",0xF9B3],
- ["84309238",0xF9B4],
- ["84309239",0xF9B5],
- ["84309330",0xF9B6],
- ["84309331",0xF9B7],
- ["84309332",0xF9B8],
- ["84309333",0xF9B9],
- ["84309334",0xF9BA],
- ["84309335",0xF9BB],
- ["84309336",0xF9BC],
- ["84309337",0xF9BD],
- ["84309338",0xF9BE],
- ["84309339",0xF9BF],
- ["84309430",0xF9C0],
- ["84309431",0xF9C1],
- ["84309432",0xF9C2],
- ["84309433",0xF9C3],
- ["84309434",0xF9C4],
- ["84309435",0xF9C5],
- ["84309436",0xF9C6],
- ["84309437",0xF9C7],
- ["84309438",0xF9C8],
- ["84309439",0xF9C9],
- ["84309530",0xF9CA],
- ["84309531",0xF9CB],
- ["84309532",0xF9CC],
- ["84309533",0xF9CD],
- ["84309534",0xF9CE],
- ["84309535",0xF9CF],
- ["84309536",0xF9D0],
- ["84309537",0xF9D1],
- ["84309538",0xF9D2],
- ["84309539",0xF9D3],
- ["84309630",0xF9D4],
- ["84309631",0xF9D5],
- ["84309632",0xF9D6],
- ["84309633",0xF9D7],
- ["84309634",0xF9D8],
- ["84309635",0xF9D9],
- ["84309636",0xF9DA],
- ["84309637",0xF9DB],
- ["84309638",0xF9DC],
- ["84309639",0xF9DD],
- ["84309730",0xF9DE],
- ["84309731",0xF9DF],
- ["84309732",0xF9E0],
- ["84309733",0xF9E1],
- ["84309734",0xF9E2],
- ["84309735",0xF9E3],
- ["84309736",0xF9E4],
- ["84309737",0xF9E5],
- ["84309738",0xF9E6],
- ["FD9F",0xF9E7],
- ["84309739",0xF9E8],
- ["84309830",0xF9E9],
- ["84309831",0xF9EA],
- ["84309832",0xF9EB],
- ["84309833",0xF9EC],
- ["84309834",0xF9ED],
- ["84309835",0xF9EE],
- ["84309836",0xF9EF],
- ["84309837",0xF9F0],
- ["FDA0",0xF9F1],
- ["84309838",0xF9F2],
- ["84309839",0xF9F3],
- ["84309930",0xF9F4],
- ["84309931",0xF9F5],
- ["84309932",0xF9F6],
- ["84309933",0xF9F7],
- ["84309934",0xF9F8],
- ["84309935",0xF9F9],
- ["84309936",0xF9FA],
- ["84309937",0xF9FB],
- ["84309938",0xF9FC],
- ["84309939",0xF9FD],
- ["84309A30",0xF9FE],
- ["84309A31",0xF9FF],
- ["84309A32",0xFA00],
- ["84309A33",0xFA01],
- ["84309A34",0xFA02],
- ["84309A35",0xFA03],
- ["84309A36",0xFA04],
- ["84309A37",0xFA05],
- ["84309A38",0xFA06],
- ["84309A39",0xFA07],
- ["84309B30",0xFA08],
- ["84309B31",0xFA09],
- ["84309B32",0xFA0A],
- ["84309B33",0xFA0B],
- ["FE40",0xFA0C],
- ["FE41",0xFA0D],
- ["FE42",0xFA0E],
- ["FE43",0xFA0F],
- ["84309B34",0xFA10],
- ["FE44",0xFA11],
- ["84309B35",0xFA12],
- ["FE45",0xFA13],
- ["FE46",0xFA14],
- ["84309B36",0xFA15],
- ["84309B37",0xFA16],
- ["84309B38",0xFA17],
- ["FE47",0xFA18],
- ["84309B39",0xFA19],
- ["84309C30",0xFA1A],
- ["84309C31",0xFA1B],
- ["84309C32",0xFA1C],
- ["84309C33",0xFA1D],
- ["84309C34",0xFA1E],
- ["FE48",0xFA1F],
- ["FE49",0xFA20],
- ["FE4A",0xFA21],
- ["84309C35",0xFA22],
- ["FE4B",0xFA23],
- ["FE4C",0xFA24],
- ["84309C36",0xFA25],
- ["84309C37",0xFA26],
- ["FE4D",0xFA27],
- ["FE4E",0xFA28],
- ["FE4F",0xFA29],
- ["84309C38",0xFA2A],
- ["84309C39",0xFA2B],
- ["84309D30",0xFA2C],
- ["84309D31",0xFA2D],
- ["84309D32",0xFA2E],
- ["84309D33",0xFA2F],
- ["84309D34",0xFA30],
- ["84309D35",0xFA31],
- ["84309D36",0xFA32],
- ["84309D37",0xFA33],
- ["84309D38",0xFA34],
- ["84309D39",0xFA35],
- ["84309E30",0xFA36],
- ["84309E31",0xFA37],
- ["84309E32",0xFA38],
- ["84309E33",0xFA39],
- ["84309E34",0xFA3A],
- ["84309E35",0xFA3B],
- ["84309E36",0xFA3C],
- ["84309E37",0xFA3D],
- ["84309E38",0xFA3E],
- ["84309E39",0xFA3F],
- ["84309F30",0xFA40],
- ["84309F31",0xFA41],
- ["84309F32",0xFA42],
- ["84309F33",0xFA43],
- ["84309F34",0xFA44],
- ["84309F35",0xFA45],
- ["84309F36",0xFA46],
- ["84309F37",0xFA47],
- ["84309F38",0xFA48],
- ["84309F39",0xFA49],
- ["8430A030",0xFA4A],
- ["8430A031",0xFA4B],
- ["8430A032",0xFA4C],
- ["8430A033",0xFA4D],
- ["8430A034",0xFA4E],
- ["8430A035",0xFA4F],
- ["8430A036",0xFA50],
- ["8430A037",0xFA51],
- ["8430A038",0xFA52],
- ["8430A039",0xFA53],
- ["8430A130",0xFA54],
- ["8430A131",0xFA55],
- ["8430A132",0xFA56],
- ["8430A133",0xFA57],
- ["8430A134",0xFA58],
- ["8430A135",0xFA59],
- ["8430A136",0xFA5A],
- ["8430A137",0xFA5B],
- ["8430A138",0xFA5C],
- ["8430A139",0xFA5D],
- ["8430A230",0xFA5E],
- ["8430A231",0xFA5F],
- ["8430A232",0xFA60],
- ["8430A233",0xFA61],
- ["8430A234",0xFA62],
- ["8430A235",0xFA63],
- ["8430A236",0xFA64],
- ["8430A237",0xFA65],
- ["8430A238",0xFA66],
- ["8430A239",0xFA67],
- ["8430A330",0xFA68],
- ["8430A331",0xFA69],
- ["8430A332",0xFA6A],
- ["8430A333",0xFA6B],
- ["8430A334",0xFA6C],
- ["8430A335",0xFA6D],
- ["8430A336",0xFA6E],
- ["8430A337",0xFA6F],
- ["8430A338",0xFA70],
- ["8430A339",0xFA71],
- ["8430A430",0xFA72],
- ["8430A431",0xFA73],
- ["8430A432",0xFA74],
- ["8430A433",0xFA75],
- ["8430A434",0xFA76],
- ["8430A435",0xFA77],
- ["8430A436",0xFA78],
- ["8430A437",0xFA79],
- ["8430A438",0xFA7A],
- ["8430A439",0xFA7B],
- ["8430A530",0xFA7C],
- ["8430A531",0xFA7D],
- ["8430A532",0xFA7E],
- ["8430A533",0xFA7F],
- ["8430A534",0xFA80],
- ["8430A535",0xFA81],
- ["8430A536",0xFA82],
- ["8430A537",0xFA83],
- ["8430A538",0xFA84],
- ["8430A539",0xFA85],
- ["8430A630",0xFA86],
- ["8430A631",0xFA87],
- ["8430A632",0xFA88],
- ["8430A633",0xFA89],
- ["8430A634",0xFA8A],
- ["8430A635",0xFA8B],
- ["8430A636",0xFA8C],
- ["8430A637",0xFA8D],
- ["8430A638",0xFA8E],
- ["8430A639",0xFA8F],
- ["8430A730",0xFA90],
- ["8430A731",0xFA91],
- ["8430A732",0xFA92],
- ["8430A733",0xFA93],
- ["8430A734",0xFA94],
- ["8430A735",0xFA95],
- ["8430A736",0xFA96],
- ["8430A737",0xFA97],
- ["8430A738",0xFA98],
- ["8430A739",0xFA99],
- ["8430A830",0xFA9A],
- ["8430A831",0xFA9B],
- ["8430A832",0xFA9C],
- ["8430A833",0xFA9D],
- ["8430A834",0xFA9E],
- ["8430A835",0xFA9F],
- ["8430A836",0xFAA0],
- ["8430A837",0xFAA1],
- ["8430A838",0xFAA2],
- ["8430A839",0xFAA3],
- ["8430A930",0xFAA4],
- ["8430A931",0xFAA5],
- ["8430A932",0xFAA6],
- ["8430A933",0xFAA7],
- ["8430A934",0xFAA8],
- ["8430A935",0xFAA9],
- ["8430A936",0xFAAA],
- ["8430A937",0xFAAB],
- ["8430A938",0xFAAC],
- ["8430A939",0xFAAD],
- ["8430AA30",0xFAAE],
- ["8430AA31",0xFAAF],
- ["8430AA32",0xFAB0],
- ["8430AA33",0xFAB1],
- ["8430AA34",0xFAB2],
- ["8430AA35",0xFAB3],
- ["8430AA36",0xFAB4],
- ["8430AA37",0xFAB5],
- ["8430AA38",0xFAB6],
- ["8430AA39",0xFAB7],
- ["8430AB30",0xFAB8],
- ["8430AB31",0xFAB9],
- ["8430AB32",0xFABA],
- ["8430AB33",0xFABB],
- ["8430AB34",0xFABC],
- ["8430AB35",0xFABD],
- ["8430AB36",0xFABE],
- ["8430AB37",0xFABF],
- ["8430AB38",0xFAC0],
- ["8430AB39",0xFAC1],
- ["8430AC30",0xFAC2],
- ["8430AC31",0xFAC3],
- ["8430AC32",0xFAC4],
- ["8430AC33",0xFAC5],
- ["8430AC34",0xFAC6],
- ["8430AC35",0xFAC7],
- ["8430AC36",0xFAC8],
- ["8430AC37",0xFAC9],
- ["8430AC38",0xFACA],
- ["8430AC39",0xFACB],
- ["8430AD30",0xFACC],
- ["8430AD31",0xFACD],
- ["8430AD32",0xFACE],
- ["8430AD33",0xFACF],
- ["8430AD34",0xFAD0],
- ["8430AD35",0xFAD1],
- ["8430AD36",0xFAD2],
- ["8430AD37",0xFAD3],
- ["8430AD38",0xFAD4],
- ["8430AD39",0xFAD5],
- ["8430AE30",0xFAD6],
- ["8430AE31",0xFAD7],
- ["8430AE32",0xFAD8],
- ["8430AE33",0xFAD9],
- ["8430AE34",0xFADA],
- ["8430AE35",0xFADB],
- ["8430AE36",0xFADC],
- ["8430AE37",0xFADD],
- ["8430AE38",0xFADE],
- ["8430AE39",0xFADF],
- ["8430AF30",0xFAE0],
- ["8430AF31",0xFAE1],
- ["8430AF32",0xFAE2],
- ["8430AF33",0xFAE3],
- ["8430AF34",0xFAE4],
- ["8430AF35",0xFAE5],
- ["8430AF36",0xFAE6],
- ["8430AF37",0xFAE7],
- ["8430AF38",0xFAE8],
- ["8430AF39",0xFAE9],
- ["8430B030",0xFAEA],
- ["8430B031",0xFAEB],
- ["8430B032",0xFAEC],
- ["8430B033",0xFAED],
- ["8430B034",0xFAEE],
- ["8430B035",0xFAEF],
- ["8430B036",0xFAF0],
- ["8430B037",0xFAF1],
- ["8430B038",0xFAF2],
- ["8430B039",0xFAF3],
- ["8430B130",0xFAF4],
- ["8430B131",0xFAF5],
- ["8430B132",0xFAF6],
- ["8430B133",0xFAF7],
- ["8430B134",0xFAF8],
- ["8430B135",0xFAF9],
- ["8430B136",0xFAFA],
- ["8430B137",0xFAFB],
- ["8430B138",0xFAFC],
- ["8430B139",0xFAFD],
- ["8430B230",0xFAFE],
- ["8430B231",0xFAFF],
- ["8430B232",0xFB00],
- ["8430B233",0xFB01],
- ["8430B234",0xFB02],
- ["8430B235",0xFB03],
- ["8430B236",0xFB04],
- ["8430B237",0xFB05],
- ["8430B238",0xFB06],
- ["8430B239",0xFB07],
- ["8430B330",0xFB08],
- ["8430B331",0xFB09],
- ["8430B332",0xFB0A],
- ["8430B333",0xFB0B],
- ["8430B334",0xFB0C],
- ["8430B335",0xFB0D],
- ["8430B336",0xFB0E],
- ["8430B337",0xFB0F],
- ["8430B338",0xFB10],
- ["8430B339",0xFB11],
- ["8430B430",0xFB12],
- ["8430B431",0xFB13],
- ["8430B432",0xFB14],
- ["8430B433",0xFB15],
- ["8430B434",0xFB16],
- ["8430B435",0xFB17],
- ["8430B436",0xFB18],
- ["8430B437",0xFB19],
- ["8430B438",0xFB1A],
- ["8430B439",0xFB1B],
- ["8430B530",0xFB1C],
- ["8430B531",0xFB1D],
- ["8430B532",0xFB1E],
- ["8430B533",0xFB1F],
- ["8430B534",0xFB20],
- ["8430B535",0xFB21],
- ["8430B536",0xFB22],
- ["8430B537",0xFB23],
- ["8430B538",0xFB24],
- ["8430B539",0xFB25],
- ["8430B630",0xFB26],
- ["8430B631",0xFB27],
- ["8430B632",0xFB28],
- ["8430B633",0xFB29],
- ["8430B634",0xFB2A],
- ["8430B635",0xFB2B],
- ["8430B636",0xFB2C],
- ["8430B637",0xFB2D],
- ["8430B638",0xFB2E],
- ["8430B639",0xFB2F],
- ["8430B730",0xFB30],
- ["8430B731",0xFB31],
- ["8430B732",0xFB32],
- ["8430B733",0xFB33],
- ["8430B734",0xFB34],
- ["8430B735",0xFB35],
- ["8430B736",0xFB36],
- ["8430B737",0xFB37],
- ["8430B738",0xFB38],
- ["8430B739",0xFB39],
- ["8430B830",0xFB3A],
- ["8430B831",0xFB3B],
- ["8430B832",0xFB3C],
- ["8430B833",0xFB3D],
- ["8430B834",0xFB3E],
- ["8430B835",0xFB3F],
- ["8430B836",0xFB40],
- ["8430B837",0xFB41],
- ["8430B838",0xFB42],
- ["8430B839",0xFB43],
- ["8430B930",0xFB44],
- ["8430B931",0xFB45],
- ["8430B932",0xFB46],
- ["8430B933",0xFB47],
- ["8430B934",0xFB48],
- ["8430B935",0xFB49],
- ["8430B936",0xFB4A],
- ["8430B937",0xFB4B],
- ["8430B938",0xFB4C],
- ["8430B939",0xFB4D],
- ["8430BA30",0xFB4E],
- ["8430BA31",0xFB4F],
- ["8430BA32",0xFB50],
- ["8430BA33",0xFB51],
- ["8430BA34",0xFB52],
- ["8430BA35",0xFB53],
- ["8430BA36",0xFB54],
- ["8430BA37",0xFB55],
- ["8430BA38",0xFB56],
- ["8430BA39",0xFB57],
- ["8430BB30",0xFB58],
- ["8430BB31",0xFB59],
- ["8430BB32",0xFB5A],
- ["8430BB33",0xFB5B],
- ["8430BB34",0xFB5C],
- ["8430BB35",0xFB5D],
- ["8430BB36",0xFB5E],
- ["8430BB37",0xFB5F],
- ["8430BB38",0xFB60],
- ["8430BB39",0xFB61],
- ["8430BC30",0xFB62],
- ["8430BC31",0xFB63],
- ["8430BC32",0xFB64],
- ["8430BC33",0xFB65],
- ["8430BC34",0xFB66],
- ["8430BC35",0xFB67],
- ["8430BC36",0xFB68],
- ["8430BC37",0xFB69],
- ["8430BC38",0xFB6A],
- ["8430BC39",0xFB6B],
- ["8430BD30",0xFB6C],
- ["8430BD31",0xFB6D],
- ["8430BD32",0xFB6E],
- ["8430BD33",0xFB6F],
- ["8430BD34",0xFB70],
- ["8430BD35",0xFB71],
- ["8430BD36",0xFB72],
- ["8430BD37",0xFB73],
- ["8430BD38",0xFB74],
- ["8430BD39",0xFB75],
- ["8430BE30",0xFB76],
- ["8430BE31",0xFB77],
- ["8430BE32",0xFB78],
- ["8430BE33",0xFB79],
- ["8430BE34",0xFB7A],
- ["8430BE35",0xFB7B],
- ["8430BE36",0xFB7C],
- ["8430BE37",0xFB7D],
- ["8430BE38",0xFB7E],
- ["8430BE39",0xFB7F],
- ["8430BF30",0xFB80],
- ["8430BF31",0xFB81],
- ["8430BF32",0xFB82],
- ["8430BF33",0xFB83],
- ["8430BF34",0xFB84],
- ["8430BF35",0xFB85],
- ["8430BF36",0xFB86],
- ["8430BF37",0xFB87],
- ["8430BF38",0xFB88],
- ["8430BF39",0xFB89],
- ["8430C030",0xFB8A],
- ["8430C031",0xFB8B],
- ["8430C032",0xFB8C],
- ["8430C033",0xFB8D],
- ["8430C034",0xFB8E],
- ["8430C035",0xFB8F],
- ["8430C036",0xFB90],
- ["8430C037",0xFB91],
- ["8430C038",0xFB92],
- ["8430C039",0xFB93],
- ["8430C130",0xFB94],
- ["8430C131",0xFB95],
- ["8430C132",0xFB96],
- ["8430C133",0xFB97],
- ["8430C134",0xFB98],
- ["8430C135",0xFB99],
- ["8430C136",0xFB9A],
- ["8430C137",0xFB9B],
- ["8430C138",0xFB9C],
- ["8430C139",0xFB9D],
- ["8430C230",0xFB9E],
- ["8430C231",0xFB9F],
- ["8430C232",0xFBA0],
- ["8430C233",0xFBA1],
- ["8430C234",0xFBA2],
- ["8430C235",0xFBA3],
- ["8430C236",0xFBA4],
- ["8430C237",0xFBA5],
- ["8430C238",0xFBA6],
- ["8430C239",0xFBA7],
- ["8430C330",0xFBA8],
- ["8430C331",0xFBA9],
- ["8430C332",0xFBAA],
- ["8430C333",0xFBAB],
- ["8430C334",0xFBAC],
- ["8430C335",0xFBAD],
- ["8430C336",0xFBAE],
- ["8430C337",0xFBAF],
- ["8430C338",0xFBB0],
- ["8430C339",0xFBB1],
- ["8430C430",0xFBB2],
- ["8430C431",0xFBB3],
- ["8430C432",0xFBB4],
- ["8430C433",0xFBB5],
- ["8430C434",0xFBB6],
- ["8430C435",0xFBB7],
- ["8430C436",0xFBB8],
- ["8430C437",0xFBB9],
- ["8430C438",0xFBBA],
- ["8430C439",0xFBBB],
- ["8430C530",0xFBBC],
- ["8430C531",0xFBBD],
- ["8430C532",0xFBBE],
- ["8430C533",0xFBBF],
- ["8430C534",0xFBC0],
- ["8430C535",0xFBC1],
- ["8430C536",0xFBC2],
- ["8430C537",0xFBC3],
- ["8430C538",0xFBC4],
- ["8430C539",0xFBC5],
- ["8430C630",0xFBC6],
- ["8430C631",0xFBC7],
- ["8430C632",0xFBC8],
- ["8430C633",0xFBC9],
- ["8430C634",0xFBCA],
- ["8430C635",0xFBCB],
- ["8430C636",0xFBCC],
- ["8430C637",0xFBCD],
- ["8430C638",0xFBCE],
- ["8430C639",0xFBCF],
- ["8430C730",0xFBD0],
- ["8430C731",0xFBD1],
- ["8430C732",0xFBD2],
- ["8430C733",0xFBD3],
- ["8430C734",0xFBD4],
- ["8430C735",0xFBD5],
- ["8430C736",0xFBD6],
- ["8430C737",0xFBD7],
- ["8430C738",0xFBD8],
- ["8430C739",0xFBD9],
- ["8430C830",0xFBDA],
- ["8430C831",0xFBDB],
- ["8430C832",0xFBDC],
- ["8430C833",0xFBDD],
- ["8430C834",0xFBDE],
- ["8430C835",0xFBDF],
- ["8430C836",0xFBE0],
- ["8430C837",0xFBE1],
- ["8430C838",0xFBE2],
- ["8430C839",0xFBE3],
- ["8430C930",0xFBE4],
- ["8430C931",0xFBE5],
- ["8430C932",0xFBE6],
- ["8430C933",0xFBE7],
- ["8430C934",0xFBE8],
- ["8430C935",0xFBE9],
- ["8430C936",0xFBEA],
- ["8430C937",0xFBEB],
- ["8430C938",0xFBEC],
- ["8430C939",0xFBED],
- ["8430CA30",0xFBEE],
- ["8430CA31",0xFBEF],
- ["8430CA32",0xFBF0],
- ["8430CA33",0xFBF1],
- ["8430CA34",0xFBF2],
- ["8430CA35",0xFBF3],
- ["8430CA36",0xFBF4],
- ["8430CA37",0xFBF5],
- ["8430CA38",0xFBF6],
- ["8430CA39",0xFBF7],
- ["8430CB30",0xFBF8],
- ["8430CB31",0xFBF9],
- ["8430CB32",0xFBFA],
- ["8430CB33",0xFBFB],
- ["8430CB34",0xFBFC],
- ["8430CB35",0xFBFD],
- ["8430CB36",0xFBFE],
- ["8430CB37",0xFBFF],
- ["8430CB38",0xFC00],
- ["8430CB39",0xFC01],
- ["8430CC30",0xFC02],
- ["8430CC31",0xFC03],
- ["8430CC32",0xFC04],
- ["8430CC33",0xFC05],
- ["8430CC34",0xFC06],
- ["8430CC35",0xFC07],
- ["8430CC36",0xFC08],
- ["8430CC37",0xFC09],
- ["8430CC38",0xFC0A],
- ["8430CC39",0xFC0B],
- ["8430CD30",0xFC0C],
- ["8430CD31",0xFC0D],
- ["8430CD32",0xFC0E],
- ["8430CD33",0xFC0F],
- ["8430CD34",0xFC10],
- ["8430CD35",0xFC11],
- ["8430CD36",0xFC12],
- ["8430CD37",0xFC13],
- ["8430CD38",0xFC14],
- ["8430CD39",0xFC15],
- ["8430CE30",0xFC16],
- ["8430CE31",0xFC17],
- ["8430CE32",0xFC18],
- ["8430CE33",0xFC19],
- ["8430CE34",0xFC1A],
- ["8430CE35",0xFC1B],
- ["8430CE36",0xFC1C],
- ["8430CE37",0xFC1D],
- ["8430CE38",0xFC1E],
- ["8430CE39",0xFC1F],
- ["8430CF30",0xFC20],
- ["8430CF31",0xFC21],
- ["8430CF32",0xFC22],
- ["8430CF33",0xFC23],
- ["8430CF34",0xFC24],
- ["8430CF35",0xFC25],
- ["8430CF36",0xFC26],
- ["8430CF37",0xFC27],
- ["8430CF38",0xFC28],
- ["8430CF39",0xFC29],
- ["8430D030",0xFC2A],
- ["8430D031",0xFC2B],
- ["8430D032",0xFC2C],
- ["8430D033",0xFC2D],
- ["8430D034",0xFC2E],
- ["8430D035",0xFC2F],
- ["8430D036",0xFC30],
- ["8430D037",0xFC31],
- ["8430D038",0xFC32],
- ["8430D039",0xFC33],
- ["8430D130",0xFC34],
- ["8430D131",0xFC35],
- ["8430D132",0xFC36],
- ["8430D133",0xFC37],
- ["8430D134",0xFC38],
- ["8430D135",0xFC39],
- ["8430D136",0xFC3A],
- ["8430D137",0xFC3B],
- ["8430D138",0xFC3C],
- ["8430D139",0xFC3D],
- ["8430D230",0xFC3E],
- ["8430D231",0xFC3F],
- ["8430D232",0xFC40],
- ["8430D233",0xFC41],
- ["8430D234",0xFC42],
- ["8430D235",0xFC43],
- ["8430D236",0xFC44],
- ["8430D237",0xFC45],
- ["8430D238",0xFC46],
- ["8430D239",0xFC47],
- ["8430D330",0xFC48],
- ["8430D331",0xFC49],
- ["8430D332",0xFC4A],
- ["8430D333",0xFC4B],
- ["8430D334",0xFC4C],
- ["8430D335",0xFC4D],
- ["8430D336",0xFC4E],
- ["8430D337",0xFC4F],
- ["8430D338",0xFC50],
- ["8430D339",0xFC51],
- ["8430D430",0xFC52],
- ["8430D431",0xFC53],
- ["8430D432",0xFC54],
- ["8430D433",0xFC55],
- ["8430D434",0xFC56],
- ["8430D435",0xFC57],
- ["8430D436",0xFC58],
- ["8430D437",0xFC59],
- ["8430D438",0xFC5A],
- ["8430D439",0xFC5B],
- ["8430D530",0xFC5C],
- ["8430D531",0xFC5D],
- ["8430D532",0xFC5E],
- ["8430D533",0xFC5F],
- ["8430D534",0xFC60],
- ["8430D535",0xFC61],
- ["8430D536",0xFC62],
- ["8430D537",0xFC63],
- ["8430D538",0xFC64],
- ["8430D539",0xFC65],
- ["8430D630",0xFC66],
- ["8430D631",0xFC67],
- ["8430D632",0xFC68],
- ["8430D633",0xFC69],
- ["8430D634",0xFC6A],
- ["8430D635",0xFC6B],
- ["8430D636",0xFC6C],
- ["8430D637",0xFC6D],
- ["8430D638",0xFC6E],
- ["8430D639",0xFC6F],
- ["8430D730",0xFC70],
- ["8430D731",0xFC71],
- ["8430D732",0xFC72],
- ["8430D733",0xFC73],
- ["8430D734",0xFC74],
- ["8430D735",0xFC75],
- ["8430D736",0xFC76],
- ["8430D737",0xFC77],
- ["8430D738",0xFC78],
- ["8430D739",0xFC79],
- ["8430D830",0xFC7A],
- ["8430D831",0xFC7B],
- ["8430D832",0xFC7C],
- ["8430D833",0xFC7D],
- ["8430D834",0xFC7E],
- ["8430D835",0xFC7F],
- ["8430D836",0xFC80],
- ["8430D837",0xFC81],
- ["8430D838",0xFC82],
- ["8430D839",0xFC83],
- ["8430D930",0xFC84],
- ["8430D931",0xFC85],
- ["8430D932",0xFC86],
- ["8430D933",0xFC87],
- ["8430D934",0xFC88],
- ["8430D935",0xFC89],
- ["8430D936",0xFC8A],
- ["8430D937",0xFC8B],
- ["8430D938",0xFC8C],
- ["8430D939",0xFC8D],
- ["8430DA30",0xFC8E],
- ["8430DA31",0xFC8F],
- ["8430DA32",0xFC90],
- ["8430DA33",0xFC91],
- ["8430DA34",0xFC92],
- ["8430DA35",0xFC93],
- ["8430DA36",0xFC94],
- ["8430DA37",0xFC95],
- ["8430DA38",0xFC96],
- ["8430DA39",0xFC97],
- ["8430DB30",0xFC98],
- ["8430DB31",0xFC99],
- ["8430DB32",0xFC9A],
- ["8430DB33",0xFC9B],
- ["8430DB34",0xFC9C],
- ["8430DB35",0xFC9D],
- ["8430DB36",0xFC9E],
- ["8430DB37",0xFC9F],
- ["8430DB38",0xFCA0],
- ["8430DB39",0xFCA1],
- ["8430DC30",0xFCA2],
- ["8430DC31",0xFCA3],
- ["8430DC32",0xFCA4],
- ["8430DC33",0xFCA5],
- ["8430DC34",0xFCA6],
- ["8430DC35",0xFCA7],
- ["8430DC36",0xFCA8],
- ["8430DC37",0xFCA9],
- ["8430DC38",0xFCAA],
- ["8430DC39",0xFCAB],
- ["8430DD30",0xFCAC],
- ["8430DD31",0xFCAD],
- ["8430DD32",0xFCAE],
- ["8430DD33",0xFCAF],
- ["8430DD34",0xFCB0],
- ["8430DD35",0xFCB1],
- ["8430DD36",0xFCB2],
- ["8430DD37",0xFCB3],
- ["8430DD38",0xFCB4],
- ["8430DD39",0xFCB5],
- ["8430DE30",0xFCB6],
- ["8430DE31",0xFCB7],
- ["8430DE32",0xFCB8],
- ["8430DE33",0xFCB9],
- ["8430DE34",0xFCBA],
- ["8430DE35",0xFCBB],
- ["8430DE36",0xFCBC],
- ["8430DE37",0xFCBD],
- ["8430DE38",0xFCBE],
- ["8430DE39",0xFCBF],
- ["8430DF30",0xFCC0],
- ["8430DF31",0xFCC1],
- ["8430DF32",0xFCC2],
- ["8430DF33",0xFCC3],
- ["8430DF34",0xFCC4],
- ["8430DF35",0xFCC5],
- ["8430DF36",0xFCC6],
- ["8430DF37",0xFCC7],
- ["8430DF38",0xFCC8],
- ["8430DF39",0xFCC9],
- ["8430E030",0xFCCA],
- ["8430E031",0xFCCB],
- ["8430E032",0xFCCC],
- ["8430E033",0xFCCD],
- ["8430E034",0xFCCE],
- ["8430E035",0xFCCF],
- ["8430E036",0xFCD0],
- ["8430E037",0xFCD1],
- ["8430E038",0xFCD2],
- ["8430E039",0xFCD3],
- ["8430E130",0xFCD4],
- ["8430E131",0xFCD5],
- ["8430E132",0xFCD6],
- ["8430E133",0xFCD7],
- ["8430E134",0xFCD8],
- ["8430E135",0xFCD9],
- ["8430E136",0xFCDA],
- ["8430E137",0xFCDB],
- ["8430E138",0xFCDC],
- ["8430E139",0xFCDD],
- ["8430E230",0xFCDE],
- ["8430E231",0xFCDF],
- ["8430E232",0xFCE0],
- ["8430E233",0xFCE1],
- ["8430E234",0xFCE2],
- ["8430E235",0xFCE3],
- ["8430E236",0xFCE4],
- ["8430E237",0xFCE5],
- ["8430E238",0xFCE6],
- ["8430E239",0xFCE7],
- ["8430E330",0xFCE8],
- ["8430E331",0xFCE9],
- ["8430E332",0xFCEA],
- ["8430E333",0xFCEB],
- ["8430E334",0xFCEC],
- ["8430E335",0xFCED],
- ["8430E336",0xFCEE],
- ["8430E337",0xFCEF],
- ["8430E338",0xFCF0],
- ["8430E339",0xFCF1],
- ["8430E430",0xFCF2],
- ["8430E431",0xFCF3],
- ["8430E432",0xFCF4],
- ["8430E433",0xFCF5],
- ["8430E434",0xFCF6],
- ["8430E435",0xFCF7],
- ["8430E436",0xFCF8],
- ["8430E437",0xFCF9],
- ["8430E438",0xFCFA],
- ["8430E439",0xFCFB],
- ["8430E530",0xFCFC],
- ["8430E531",0xFCFD],
- ["8430E532",0xFCFE],
- ["8430E533",0xFCFF],
- ["8430E534",0xFD00],
- ["8430E535",0xFD01],
- ["8430E536",0xFD02],
- ["8430E537",0xFD03],
- ["8430E538",0xFD04],
- ["8430E539",0xFD05],
- ["8430E630",0xFD06],
- ["8430E631",0xFD07],
- ["8430E632",0xFD08],
- ["8430E633",0xFD09],
- ["8430E634",0xFD0A],
- ["8430E635",0xFD0B],
- ["8430E636",0xFD0C],
- ["8430E637",0xFD0D],
- ["8430E638",0xFD0E],
- ["8430E639",0xFD0F],
- ["8430E730",0xFD10],
- ["8430E731",0xFD11],
- ["8430E732",0xFD12],
- ["8430E733",0xFD13],
- ["8430E734",0xFD14],
- ["8430E735",0xFD15],
- ["8430E736",0xFD16],
- ["8430E737",0xFD17],
- ["8430E738",0xFD18],
- ["8430E739",0xFD19],
- ["8430E830",0xFD1A],
- ["8430E831",0xFD1B],
- ["8430E832",0xFD1C],
- ["8430E833",0xFD1D],
- ["8430E834",0xFD1E],
- ["8430E835",0xFD1F],
- ["8430E836",0xFD20],
- ["8430E837",0xFD21],
- ["8430E838",0xFD22],
- ["8430E839",0xFD23],
- ["8430E930",0xFD24],
- ["8430E931",0xFD25],
- ["8430E932",0xFD26],
- ["8430E933",0xFD27],
- ["8430E934",0xFD28],
- ["8430E935",0xFD29],
- ["8430E936",0xFD2A],
- ["8430E937",0xFD2B],
- ["8430E938",0xFD2C],
- ["8430E939",0xFD2D],
- ["8430EA30",0xFD2E],
- ["8430EA31",0xFD2F],
- ["8430EA32",0xFD30],
- ["8430EA33",0xFD31],
- ["8430EA34",0xFD32],
- ["8430EA35",0xFD33],
- ["8430EA36",0xFD34],
- ["8430EA37",0xFD35],
- ["8430EA38",0xFD36],
- ["8430EA39",0xFD37],
- ["8430EB30",0xFD38],
- ["8430EB31",0xFD39],
- ["8430EB32",0xFD3A],
- ["8430EB33",0xFD3B],
- ["8430EB34",0xFD3C],
- ["8430EB35",0xFD3D],
- ["8430EB36",0xFD3E],
- ["8430EB37",0xFD3F],
- ["8430EB38",0xFD40],
- ["8430EB39",0xFD41],
- ["8430EC30",0xFD42],
- ["8430EC31",0xFD43],
- ["8430EC32",0xFD44],
- ["8430EC33",0xFD45],
- ["8430EC34",0xFD46],
- ["8430EC35",0xFD47],
- ["8430EC36",0xFD48],
- ["8430EC37",0xFD49],
- ["8430EC38",0xFD4A],
- ["8430EC39",0xFD4B],
- ["8430ED30",0xFD4C],
- ["8430ED31",0xFD4D],
- ["8430ED32",0xFD4E],
- ["8430ED33",0xFD4F],
- ["8430ED34",0xFD50],
- ["8430ED35",0xFD51],
- ["8430ED36",0xFD52],
- ["8430ED37",0xFD53],
- ["8430ED38",0xFD54],
- ["8430ED39",0xFD55],
- ["8430EE30",0xFD56],
- ["8430EE31",0xFD57],
- ["8430EE32",0xFD58],
- ["8430EE33",0xFD59],
- ["8430EE34",0xFD5A],
- ["8430EE35",0xFD5B],
- ["8430EE36",0xFD5C],
- ["8430EE37",0xFD5D],
- ["8430EE38",0xFD5E],
- ["8430EE39",0xFD5F],
- ["8430EF30",0xFD60],
- ["8430EF31",0xFD61],
- ["8430EF32",0xFD62],
- ["8430EF33",0xFD63],
- ["8430EF34",0xFD64],
- ["8430EF35",0xFD65],
- ["8430EF36",0xFD66],
- ["8430EF37",0xFD67],
- ["8430EF38",0xFD68],
- ["8430EF39",0xFD69],
- ["8430F030",0xFD6A],
- ["8430F031",0xFD6B],
- ["8430F032",0xFD6C],
- ["8430F033",0xFD6D],
- ["8430F034",0xFD6E],
- ["8430F035",0xFD6F],
- ["8430F036",0xFD70],
- ["8430F037",0xFD71],
- ["8430F038",0xFD72],
- ["8430F039",0xFD73],
- ["8430F130",0xFD74],
- ["8430F131",0xFD75],
- ["8430F132",0xFD76],
- ["8430F133",0xFD77],
- ["8430F134",0xFD78],
- ["8430F135",0xFD79],
- ["8430F136",0xFD7A],
- ["8430F137",0xFD7B],
- ["8430F138",0xFD7C],
- ["8430F139",0xFD7D],
- ["8430F230",0xFD7E],
- ["8430F231",0xFD7F],
- ["8430F232",0xFD80],
- ["8430F233",0xFD81],
- ["8430F234",0xFD82],
- ["8430F235",0xFD83],
- ["8430F236",0xFD84],
- ["8430F237",0xFD85],
- ["8430F238",0xFD86],
- ["8430F239",0xFD87],
- ["8430F330",0xFD88],
- ["8430F331",0xFD89],
- ["8430F332",0xFD8A],
- ["8430F333",0xFD8B],
- ["8430F334",0xFD8C],
- ["8430F335",0xFD8D],
- ["8430F336",0xFD8E],
- ["8430F337",0xFD8F],
- ["8430F338",0xFD90],
- ["8430F339",0xFD91],
- ["8430F430",0xFD92],
- ["8430F431",0xFD93],
- ["8430F432",0xFD94],
- ["8430F433",0xFD95],
- ["8430F434",0xFD96],
- ["8430F435",0xFD97],
- ["8430F436",0xFD98],
- ["8430F437",0xFD99],
- ["8430F438",0xFD9A],
- ["8430F439",0xFD9B],
- ["8430F530",0xFD9C],
- ["8430F531",0xFD9D],
- ["8430F532",0xFD9E],
- ["8430F533",0xFD9F],
- ["8430F534",0xFDA0],
- ["8430F535",0xFDA1],
- ["8430F536",0xFDA2],
- ["8430F537",0xFDA3],
- ["8430F538",0xFDA4],
- ["8430F539",0xFDA5],
- ["8430F630",0xFDA6],
- ["8430F631",0xFDA7],
- ["8430F632",0xFDA8],
- ["8430F633",0xFDA9],
- ["8430F634",0xFDAA],
- ["8430F635",0xFDAB],
- ["8430F636",0xFDAC],
- ["8430F637",0xFDAD],
- ["8430F638",0xFDAE],
- ["8430F639",0xFDAF],
- ["8430F730",0xFDB0],
- ["8430F731",0xFDB1],
- ["8430F732",0xFDB2],
- ["8430F733",0xFDB3],
- ["8430F734",0xFDB4],
- ["8430F735",0xFDB5],
- ["8430F736",0xFDB6],
- ["8430F737",0xFDB7],
- ["8430F738",0xFDB8],
- ["8430F739",0xFDB9],
- ["8430F830",0xFDBA],
- ["8430F831",0xFDBB],
- ["8430F832",0xFDBC],
- ["8430F833",0xFDBD],
- ["8430F834",0xFDBE],
- ["8430F835",0xFDBF],
- ["8430F836",0xFDC0],
- ["8430F837",0xFDC1],
- ["8430F838",0xFDC2],
- ["8430F839",0xFDC3],
- ["8430F930",0xFDC4],
- ["8430F931",0xFDC5],
- ["8430F932",0xFDC6],
- ["8430F933",0xFDC7],
- ["8430F934",0xFDC8],
- ["8430F935",0xFDC9],
- ["8430F936",0xFDCA],
- ["8430F937",0xFDCB],
- ["8430F938",0xFDCC],
- ["8430F939",0xFDCD],
- ["8430FA30",0xFDCE],
- ["8430FA31",0xFDCF],
- ["8430FA32",0xFDD0],
- ["8430FA33",0xFDD1],
- ["8430FA34",0xFDD2],
- ["8430FA35",0xFDD3],
- ["8430FA36",0xFDD4],
- ["8430FA37",0xFDD5],
- ["8430FA38",0xFDD6],
- ["8430FA39",0xFDD7],
- ["8430FB30",0xFDD8],
- ["8430FB31",0xFDD9],
- ["8430FB32",0xFDDA],
- ["8430FB33",0xFDDB],
- ["8430FB34",0xFDDC],
- ["8430FB35",0xFDDD],
- ["8430FB36",0xFDDE],
- ["8430FB37",0xFDDF],
- ["8430FB38",0xFDE0],
- ["8430FB39",0xFDE1],
- ["8430FC30",0xFDE2],
- ["8430FC31",0xFDE3],
- ["8430FC32",0xFDE4],
- ["8430FC33",0xFDE5],
- ["8430FC34",0xFDE6],
- ["8430FC35",0xFDE7],
- ["8430FC36",0xFDE8],
- ["8430FC37",0xFDE9],
- ["8430FC38",0xFDEA],
- ["8430FC39",0xFDEB],
- ["8430FD30",0xFDEC],
- ["8430FD31",0xFDED],
- ["8430FD32",0xFDEE],
- ["8430FD33",0xFDEF],
- ["8430FD34",0xFDF0],
- ["8430FD35",0xFDF1],
- ["8430FD36",0xFDF2],
- ["8430FD37",0xFDF3],
- ["8430FD38",0xFDF4],
- ["8430FD39",0xFDF5],
- ["8430FE30",0xFDF6],
- ["8430FE31",0xFDF7],
- ["8430FE32",0xFDF8],
- ["8430FE33",0xFDF9],
- ["8430FE34",0xFDFA],
- ["8430FE35",0xFDFB],
- ["8430FE36",0xFDFC],
- ["8430FE37",0xFDFD],
- ["8430FE38",0xFDFE],
- ["8430FE39",0xFDFF],
- ["84318130",0xFE00],
- ["84318131",0xFE01],
- ["84318132",0xFE02],
- ["84318133",0xFE03],
- ["84318134",0xFE04],
- ["84318135",0xFE05],
- ["84318136",0xFE06],
- ["84318137",0xFE07],
- ["84318138",0xFE08],
- ["84318139",0xFE09],
- ["84318230",0xFE0A],
- ["84318231",0xFE0B],
- ["84318232",0xFE0C],
- ["84318233",0xFE0D],
- ["84318234",0xFE0E],
- ["84318235",0xFE0F],
- ["84318236",0xFE10],
- ["84318237",0xFE11],
- ["84318238",0xFE12],
- ["84318239",0xFE13],
- ["84318330",0xFE14],
- ["84318331",0xFE15],
- ["84318332",0xFE16],
- ["84318333",0xFE17],
- ["84318334",0xFE18],
- ["84318335",0xFE19],
- ["84318336",0xFE1A],
- ["84318337",0xFE1B],
- ["84318338",0xFE1C],
- ["84318339",0xFE1D],
- ["84318430",0xFE1E],
- ["84318431",0xFE1F],
- ["84318432",0xFE20],
- ["84318433",0xFE21],
- ["84318434",0xFE22],
- ["84318435",0xFE23],
- ["84318436",0xFE24],
- ["84318437",0xFE25],
- ["84318438",0xFE26],
- ["84318439",0xFE27],
- ["84318530",0xFE28],
- ["84318531",0xFE29],
- ["84318532",0xFE2A],
- ["84318533",0xFE2B],
- ["84318534",0xFE2C],
- ["84318535",0xFE2D],
- ["84318536",0xFE2E],
- ["84318537",0xFE2F],
- ["A955",0xFE30],
- ["A6F2",0xFE31],
- ["84318538",0xFE32],
- ["A6F4",0xFE33],
- ["A6F5",0xFE34],
- ["A6E0",0xFE35],
- ["A6E1",0xFE36],
- ["A6F0",0xFE37],
- ["A6F1",0xFE38],
- ["A6E2",0xFE39],
- ["A6E3",0xFE3A],
- ["A6EE",0xFE3B],
- ["A6EF",0xFE3C],
- ["A6E6",0xFE3D],
- ["A6E7",0xFE3E],
- ["A6E4",0xFE3F],
- ["A6E5",0xFE40],
- ["A6E8",0xFE41],
- ["A6E9",0xFE42],
- ["A6EA",0xFE43],
- ["A6EB",0xFE44],
- ["84318539",0xFE45],
- ["84318630",0xFE46],
- ["84318631",0xFE47],
- ["84318632",0xFE48],
- ["A968",0xFE49],
- ["A969",0xFE4A],
- ["A96A",0xFE4B],
- ["A96B",0xFE4C],
- ["A96C",0xFE4D],
- ["A96D",0xFE4E],
- ["A96E",0xFE4F],
- ["A96F",0xFE50],
- ["A970",0xFE51],
- ["A971",0xFE52],
- ["84318633",0xFE53],
- ["A972",0xFE54],
- ["A973",0xFE55],
- ["A974",0xFE56],
- ["A975",0xFE57],
- ["84318634",0xFE58],
- ["A976",0xFE59],
- ["A977",0xFE5A],
- ["A978",0xFE5B],
- ["A979",0xFE5C],
- ["A97A",0xFE5D],
- ["A97B",0xFE5E],
- ["A97C",0xFE5F],
- ["A97D",0xFE60],
- ["A97E",0xFE61],
- ["A980",0xFE62],
- ["A981",0xFE63],
- ["A982",0xFE64],
- ["A983",0xFE65],
- ["A984",0xFE66],
- ["84318635",0xFE67],
- ["A985",0xFE68],
- ["A986",0xFE69],
- ["A987",0xFE6A],
- ["A988",0xFE6B],
- ["84318636",0xFE6C],
- ["84318637",0xFE6D],
- ["84318638",0xFE6E],
- ["84318639",0xFE6F],
- ["84318730",0xFE70],
- ["84318731",0xFE71],
- ["84318732",0xFE72],
- ["84318733",0xFE73],
- ["84318734",0xFE74],
- ["84318735",0xFE75],
- ["84318736",0xFE76],
- ["84318737",0xFE77],
- ["84318738",0xFE78],
- ["84318739",0xFE79],
- ["84318830",0xFE7A],
- ["84318831",0xFE7B],
- ["84318832",0xFE7C],
- ["84318833",0xFE7D],
- ["84318834",0xFE7E],
- ["84318835",0xFE7F],
- ["84318836",0xFE80],
- ["84318837",0xFE81],
- ["84318838",0xFE82],
- ["84318839",0xFE83],
- ["84318930",0xFE84],
- ["84318931",0xFE85],
- ["84318932",0xFE86],
- ["84318933",0xFE87],
- ["84318934",0xFE88],
- ["84318935",0xFE89],
- ["84318936",0xFE8A],
- ["84318937",0xFE8B],
- ["84318938",0xFE8C],
- ["84318939",0xFE8D],
- ["84318A30",0xFE8E],
- ["84318A31",0xFE8F],
- ["84318A32",0xFE90],
- ["84318A33",0xFE91],
- ["84318A34",0xFE92],
- ["84318A35",0xFE93],
- ["84318A36",0xFE94],
- ["84318A37",0xFE95],
- ["84318A38",0xFE96],
- ["84318A39",0xFE97],
- ["84318B30",0xFE98],
- ["84318B31",0xFE99],
- ["84318B32",0xFE9A],
- ["84318B33",0xFE9B],
- ["84318B34",0xFE9C],
- ["84318B35",0xFE9D],
- ["84318B36",0xFE9E],
- ["84318B37",0xFE9F],
- ["84318B38",0xFEA0],
- ["84318B39",0xFEA1],
- ["84318C30",0xFEA2],
- ["84318C31",0xFEA3],
- ["84318C32",0xFEA4],
- ["84318C33",0xFEA5],
- ["84318C34",0xFEA6],
- ["84318C35",0xFEA7],
- ["84318C36",0xFEA8],
- ["84318C37",0xFEA9],
- ["84318C38",0xFEAA],
- ["84318C39",0xFEAB],
- ["84318D30",0xFEAC],
- ["84318D31",0xFEAD],
- ["84318D32",0xFEAE],
- ["84318D33",0xFEAF],
- ["84318D34",0xFEB0],
- ["84318D35",0xFEB1],
- ["84318D36",0xFEB2],
- ["84318D37",0xFEB3],
- ["84318D38",0xFEB4],
- ["84318D39",0xFEB5],
- ["84318E30",0xFEB6],
- ["84318E31",0xFEB7],
- ["84318E32",0xFEB8],
- ["84318E33",0xFEB9],
- ["84318E34",0xFEBA],
- ["84318E35",0xFEBB],
- ["84318E36",0xFEBC],
- ["84318E37",0xFEBD],
- ["84318E38",0xFEBE],
- ["84318E39",0xFEBF],
- ["84318F30",0xFEC0],
- ["84318F31",0xFEC1],
- ["84318F32",0xFEC2],
- ["84318F33",0xFEC3],
- ["84318F34",0xFEC4],
- ["84318F35",0xFEC5],
- ["84318F36",0xFEC6],
- ["84318F37",0xFEC7],
- ["84318F38",0xFEC8],
- ["84318F39",0xFEC9],
- ["84319030",0xFECA],
- ["84319031",0xFECB],
- ["84319032",0xFECC],
- ["84319033",0xFECD],
- ["84319034",0xFECE],
- ["84319035",0xFECF],
- ["84319036",0xFED0],
- ["84319037",0xFED1],
- ["84319038",0xFED2],
- ["84319039",0xFED3],
- ["84319130",0xFED4],
- ["84319131",0xFED5],
- ["84319132",0xFED6],
- ["84319133",0xFED7],
- ["84319134",0xFED8],
- ["84319135",0xFED9],
- ["84319136",0xFEDA],
- ["84319137",0xFEDB],
- ["84319138",0xFEDC],
- ["84319139",0xFEDD],
- ["84319230",0xFEDE],
- ["84319231",0xFEDF],
- ["84319232",0xFEE0],
- ["84319233",0xFEE1],
- ["84319234",0xFEE2],
- ["84319235",0xFEE3],
- ["84319236",0xFEE4],
- ["84319237",0xFEE5],
- ["84319238",0xFEE6],
- ["84319239",0xFEE7],
- ["84319330",0xFEE8],
- ["84319331",0xFEE9],
- ["84319332",0xFEEA],
- ["84319333",0xFEEB],
- ["84319334",0xFEEC],
- ["84319335",0xFEED],
- ["84319336",0xFEEE],
- ["84319337",0xFEEF],
- ["84319338",0xFEF0],
- ["84319339",0xFEF1],
- ["84319430",0xFEF2],
- ["84319431",0xFEF3],
- ["84319432",0xFEF4],
- ["84319433",0xFEF5],
- ["84319434",0xFEF6],
- ["84319435",0xFEF7],
- ["84319436",0xFEF8],
- ["84319437",0xFEF9],
- ["84319438",0xFEFA],
- ["84319439",0xFEFB],
- ["84319530",0xFEFC],
- ["84319531",0xFEFD],
- ["84319532",0xFEFE],
- ["84319533",0xFEFF],
- ["84319534",0xFF00],
- ["A3A1",0xFF01],
- ["A3A2",0xFF02],
- ["A3A3",0xFF03],
- ["A1E7",0xFF04],
- ["A3A5",0xFF05],
- ["A3A6",0xFF06],
- ["A3A7",0xFF07],
- ["A3A8",0xFF08],
- ["A3A9",0xFF09],
- ["A3AA",0xFF0A],
- ["A3AB",0xFF0B],
- ["A3AC",0xFF0C],
- ["A3AD",0xFF0D],
- ["A3AE",0xFF0E],
- ["A3AF",0xFF0F],
- ["A3B0",0xFF10],
- ["A3B1",0xFF11],
- ["A3B2",0xFF12],
- ["A3B3",0xFF13],
- ["A3B4",0xFF14],
- ["A3B5",0xFF15],
- ["A3B6",0xFF16],
- ["A3B7",0xFF17],
- ["A3B8",0xFF18],
- ["A3B9",0xFF19],
- ["A3BA",0xFF1A],
- ["A3BB",0xFF1B],
- ["A3BC",0xFF1C],
- ["A3BD",0xFF1D],
- ["A3BE",0xFF1E],
- ["A3BF",0xFF1F],
- ["A3C0",0xFF20],
- ["A3C1",0xFF21],
- ["A3C2",0xFF22],
- ["A3C3",0xFF23],
- ["A3C4",0xFF24],
- ["A3C5",0xFF25],
- ["A3C6",0xFF26],
- ["A3C7",0xFF27],
- ["A3C8",0xFF28],
- ["A3C9",0xFF29],
- ["A3CA",0xFF2A],
- ["A3CB",0xFF2B],
- ["A3CC",0xFF2C],
- ["A3CD",0xFF2D],
- ["A3CE",0xFF2E],
- ["A3CF",0xFF2F],
- ["A3D0",0xFF30],
- ["A3D1",0xFF31],
- ["A3D2",0xFF32],
- ["A3D3",0xFF33],
- ["A3D4",0xFF34],
- ["A3D5",0xFF35],
- ["A3D6",0xFF36],
- ["A3D7",0xFF37],
- ["A3D8",0xFF38],
- ["A3D9",0xFF39],
- ["A3DA",0xFF3A],
- ["A3DB",0xFF3B],
- ["A3DC",0xFF3C],
- ["A3DD",0xFF3D],
- ["A3DE",0xFF3E],
- ["A3DF",0xFF3F],
- ["A3E0",0xFF40],
- ["A3E1",0xFF41],
- ["A3E2",0xFF42],
- ["A3E3",0xFF43],
- ["A3E4",0xFF44],
- ["A3E5",0xFF45],
- ["A3E6",0xFF46],
- ["A3E7",0xFF47],
- ["A3E8",0xFF48],
- ["A3E9",0xFF49],
- ["A3EA",0xFF4A],
- ["A3EB",0xFF4B],
- ["A3EC",0xFF4C],
- ["A3ED",0xFF4D],
- ["A3EE",0xFF4E],
- ["A3EF",0xFF4F],
- ["A3F0",0xFF50],
- ["A3F1",0xFF51],
- ["A3F2",0xFF52],
- ["A3F3",0xFF53],
- ["A3F4",0xFF54],
- ["A3F5",0xFF55],
- ["A3F6",0xFF56],
- ["A3F7",0xFF57],
- ["A3F8",0xFF58],
- ["A3F9",0xFF59],
- ["A3FA",0xFF5A],
- ["A3FB",0xFF5B],
- ["A3FC",0xFF5C],
- ["A3FD",0xFF5D],
- ["A1AB",0xFF5E],
- ["84319535",0xFF5F],
- ["84319536",0xFF60],
- ["84319537",0xFF61],
- ["84319538",0xFF62],
- ["84319539",0xFF63],
- ["84319630",0xFF64],
- ["84319631",0xFF65],
- ["84319632",0xFF66],
- ["84319633",0xFF67],
- ["84319634",0xFF68],
- ["84319635",0xFF69],
- ["84319636",0xFF6A],
- ["84319637",0xFF6B],
- ["84319638",0xFF6C],
- ["84319639",0xFF6D],
- ["84319730",0xFF6E],
- ["84319731",0xFF6F],
- ["84319732",0xFF70],
- ["84319733",0xFF71],
- ["84319734",0xFF72],
- ["84319735",0xFF73],
- ["84319736",0xFF74],
- ["84319737",0xFF75],
- ["84319738",0xFF76],
- ["84319739",0xFF77],
- ["84319830",0xFF78],
- ["84319831",0xFF79],
- ["84319832",0xFF7A],
- ["84319833",0xFF7B],
- ["84319834",0xFF7C],
- ["84319835",0xFF7D],
- ["84319836",0xFF7E],
- ["84319837",0xFF7F],
- ["84319838",0xFF80],
- ["84319839",0xFF81],
- ["84319930",0xFF82],
- ["84319931",0xFF83],
- ["84319932",0xFF84],
- ["84319933",0xFF85],
- ["84319934",0xFF86],
- ["84319935",0xFF87],
- ["84319936",0xFF88],
- ["84319937",0xFF89],
- ["84319938",0xFF8A],
- ["84319939",0xFF8B],
- ["84319A30",0xFF8C],
- ["84319A31",0xFF8D],
- ["84319A32",0xFF8E],
- ["84319A33",0xFF8F],
- ["84319A34",0xFF90],
- ["84319A35",0xFF91],
- ["84319A36",0xFF92],
- ["84319A37",0xFF93],
- ["84319A38",0xFF94],
- ["84319A39",0xFF95],
- ["84319B30",0xFF96],
- ["84319B31",0xFF97],
- ["84319B32",0xFF98],
- ["84319B33",0xFF99],
- ["84319B34",0xFF9A],
- ["84319B35",0xFF9B],
- ["84319B36",0xFF9C],
- ["84319B37",0xFF9D],
- ["84319B38",0xFF9E],
- ["84319B39",0xFF9F],
- ["84319C30",0xFFA0],
- ["84319C31",0xFFA1],
- ["84319C32",0xFFA2],
- ["84319C33",0xFFA3],
- ["84319C34",0xFFA4],
- ["84319C35",0xFFA5],
- ["84319C36",0xFFA6],
- ["84319C37",0xFFA7],
- ["84319C38",0xFFA8],
- ["84319C39",0xFFA9],
- ["84319D30",0xFFAA],
- ["84319D31",0xFFAB],
- ["84319D32",0xFFAC],
- ["84319D33",0xFFAD],
- ["84319D34",0xFFAE],
- ["84319D35",0xFFAF],
- ["84319D36",0xFFB0],
- ["84319D37",0xFFB1],
- ["84319D38",0xFFB2],
- ["84319D39",0xFFB3],
- ["84319E30",0xFFB4],
- ["84319E31",0xFFB5],
- ["84319E32",0xFFB6],
- ["84319E33",0xFFB7],
- ["84319E34",0xFFB8],
- ["84319E35",0xFFB9],
- ["84319E36",0xFFBA],
- ["84319E37",0xFFBB],
- ["84319E38",0xFFBC],
- ["84319E39",0xFFBD],
- ["84319F30",0xFFBE],
- ["84319F31",0xFFBF],
- ["84319F32",0xFFC0],
- ["84319F33",0xFFC1],
- ["84319F34",0xFFC2],
- ["84319F35",0xFFC3],
- ["84319F36",0xFFC4],
- ["84319F37",0xFFC5],
- ["84319F38",0xFFC6],
- ["84319F39",0xFFC7],
- ["8431A030",0xFFC8],
- ["8431A031",0xFFC9],
- ["8431A032",0xFFCA],
- ["8431A033",0xFFCB],
- ["8431A034",0xFFCC],
- ["8431A035",0xFFCD],
- ["8431A036",0xFFCE],
- ["8431A037",0xFFCF],
- ["8431A038",0xFFD0],
- ["8431A039",0xFFD1],
- ["8431A130",0xFFD2],
- ["8431A131",0xFFD3],
- ["8431A132",0xFFD4],
- ["8431A133",0xFFD5],
- ["8431A134",0xFFD6],
- ["8431A135",0xFFD7],
- ["8431A136",0xFFD8],
- ["8431A137",0xFFD9],
- ["8431A138",0xFFDA],
- ["8431A139",0xFFDB],
- ["8431A230",0xFFDC],
- ["8431A231",0xFFDD],
- ["8431A232",0xFFDE],
- ["8431A233",0xFFDF],
- ["A1E9",0xFFE0],
- ["A1EA",0xFFE1],
- ["A956",0xFFE2],
- ["A3FE",0xFFE3],
- ["A957",0xFFE4],
- ["A3A4",0xFFE5],
- ["8431A234",0xFFE6],
- ["8431A235",0xFFE7],
- ["8431A236",0xFFE8],
- ["8431A237",0xFFE9],
- ["8431A238",0xFFEA],
- ["8431A239",0xFFEB],
- ["8431A330",0xFFEC],
- ["8431A331",0xFFED],
- ["8431A332",0xFFEE],
- ["8431A333",0xFFEF],
- ["8431A334",0xFFF0],
- ["8431A335",0xFFF1],
- ["8431A336",0xFFF2],
- ["8431A337",0xFFF3],
- ["8431A338",0xFFF4],
- ["8431A339",0xFFF5],
- ["8431A430",0xFFF6],
- ["8431A431",0xFFF7],
- ["8431A432",0xFFF8],
- ["8431A433",0xFFF9],
- ["8431A434",0xFFFA],
- ["8431A435",0xFFFB],
- ["8431A436",0xFFFC],
- ["8431A437",0xFFFD],
- ["8431A438",0xFFFE],
- ["8431A439",0xFFFF],
-]
diff --git a/enc/trans/gb18030.trans b/enc/trans/gb18030.trans
deleted file mode 100644
index 700522c9f0..0000000000
--- a/enc/trans/gb18030.trans
+++ /dev/null
@@ -1,84 +0,0 @@
-#include "transcode_data.h"
-
-<%
- require "gb18030-tbl"
-
- transcode_tbl_only "GB18030", "UTF-8", [["{00-7f}", :nomap]] +
- GB18030_TO_UCS_TBL + [
- ["{90-e2}{30-39}{81-fe}{30-39}", :func_so],
- ["e3{30-31}{81-fe}{30-39}", :func_so],
- ["e332{81-99}{30-39}", :func_so],
- ["e3329a{30-35}", :func_so], # "E3329A35" is U+10FFFF
- ]
- transcode_tbl_only "UTF-8", "GB18030", [["{00-7f}", :nomap]] +
- GB18030_TO_UCS_TBL.map {|a,b| [b,a] } + [
- ["f0{90-bf}{80-bf}{80-bf}", :func_so],
- ["{f1-f3}{80-bf}{80-bf}{80-bf}", :func_so],
- ["f4{80-8f}{80-bf}{80-bf}", :func_so]
- ]
-%>
-
-<%= transcode_generated_code %>
-
-static ssize_t
-fun_so_from_gb18030(void *statep, const unsigned char *s, size_t l, unsigned char *o, size_t osize)
-{
- /* outside BMP only */
- /* u: Unicode Scalar Value */
- unsigned int u = (s[0]-0x90)*10*126*10 + (s[1]-0x30)*126*10 + (s[2]-0x81)*10 + (s[3]-0x30) + 0x10000;
- o[0] = 0xF0 | (u>>18);
- o[1] = 0x80 | ((u>>12)&0x3F);
- o[2] = 0x80 | ((u>>6)&0x3F);
- o[3] = 0x80 | (u&0x3F);
- return 4;
-}
-
-static ssize_t
-fun_so_to_gb18030(void *statep, const unsigned char *s, size_t l, unsigned char *o, size_t osize)
-{
- /* outside BMP only */
- /* u: Unicode Scalar Value */
- unsigned int u = ((s[0]&0x07)<<18) | ((s[1]&0x3F)<<12) | ((s[2]&0x3F)<<6) | (s[3]&0x3F);
- u -= 0x10000;
- o[3] = 0x30 + u%10;
- u /= 10;
- o[2] = 0x81 + u%126;
- u /= 126;
- o[1] = 0x30 + u%10;
- o[0] = 0x90 + u/10;
- return 4;
-}
-
-
-static const rb_transcoder
-rb_from_GB18030 = {
- "GB18030", "UTF-8", from_GB18030,
- TRANSCODE_TABLE_INFO,
- 1, /* input_unit_length */
- 4, /* max_input */
- 3, /* max_output */
- asciicompat_converter, /* asciicompat_type */
- 0, NULL, NULL, /* state_size, state_init, state_fini */
- NULL, NULL, NULL, fun_so_from_gb18030,
- NULL, NULL, NULL
-};
-static const rb_transcoder
-rb_to_GB18030 = {
- "UTF-8", "GB18030", to_GB18030,
- TRANSCODE_TABLE_INFO,
- 1, /* input_unit_length */
- 4, /* max_input */
- 4, /* max_output */
- asciicompat_converter, /* asciicompat_type */
- 0, NULL, NULL, /* state_size, state_init, state_fini */
- NULL, NULL, NULL, fun_so_to_gb18030,
- NULL, NULL, NULL
-};
-
-
-void
-Init_gb18030(void)
-{
- rb_register_transcoder(&rb_from_GB18030);
- rb_register_transcoder(&rb_to_GB18030);
-}
diff --git a/enc/trans/gbk-tbl.rb b/enc/trans/gbk-tbl.rb
deleted file mode 100644
index 5b4374bb61..0000000000
--- a/enc/trans/gbk-tbl.rb
+++ /dev/null
@@ -1,21793 +0,0 @@
-GBK_TO_UCS_TBL= [
- ["A1E8",0xA4],
- ["A1EC",0xA7],
- ["A1A7",0xA8],
- ["A1E3",0xB0],
- ["A1C0",0xB1],
- ["A1A4",0xB7],
- ["A1C1",0xD7],
- ["A8A4",0xE0],
- ["A8A2",0xE1],
- ["A8A8",0xE8],
- ["A8A6",0xE9],
- ["A8BA",0xEA],
- ["A8AC",0xEC],
- ["A8AA",0xED],
- ["A8B0",0xF2],
- ["A8AE",0xF3],
- ["A1C2",0xF7],
- ["A8B4",0xF9],
- ["A8B2",0xFA],
- ["A8B9",0xFC],
- ["A8A1",0x101],
- ["A8A5",0x113],
- ["A8A7",0x11B],
- ["A8A9",0x12B],
- ["A8BD",0x144],
- ["A8BE",0x148],
- ["A8AD",0x14D],
- ["A8B1",0x16B],
- ["A8A3",0x1CE],
- ["A8AB",0x1D0],
- ["A8AF",0x1D2],
- ["A8B3",0x1D4],
- ["A8B5",0x1D6],
- ["A8B6",0x1D8],
- ["A8B7",0x1DA],
- ["A8B8",0x1DC],
- ["A8BB",0x251],
- ["A8C0",0x261],
- ["A1A6",0x2C7],
- ["A1A5",0x2C9],
- ["A840",0x2CA],
- ["A841",0x2CB],
- ["A842",0x2D9],
- ["A6A1",0x391],
- ["A6A2",0x392],
- ["A6A3",0x393],
- ["A6A4",0x394],
- ["A6A5",0x395],
- ["A6A6",0x396],
- ["A6A7",0x397],
- ["A6A8",0x398],
- ["A6A9",0x399],
- ["A6AA",0x39A],
- ["A6AB",0x39B],
- ["A6AC",0x39C],
- ["A6AD",0x39D],
- ["A6AE",0x39E],
- ["A6AF",0x39F],
- ["A6B0",0x3A0],
- ["A6B1",0x3A1],
- ["A6B2",0x3A3],
- ["A6B3",0x3A4],
- ["A6B4",0x3A5],
- ["A6B5",0x3A6],
- ["A6B6",0x3A7],
- ["A6B7",0x3A8],
- ["A6B8",0x3A9],
- ["A6C1",0x3B1],
- ["A6C2",0x3B2],
- ["A6C3",0x3B3],
- ["A6C4",0x3B4],
- ["A6C5",0x3B5],
- ["A6C6",0x3B6],
- ["A6C7",0x3B7],
- ["A6C8",0x3B8],
- ["A6C9",0x3B9],
- ["A6CA",0x3BA],
- ["A6CB",0x3BB],
- ["A6CC",0x3BC],
- ["A6CD",0x3BD],
- ["A6CE",0x3BE],
- ["A6CF",0x3BF],
- ["A6D0",0x3C0],
- ["A6D1",0x3C1],
- ["A6D2",0x3C3],
- ["A6D3",0x3C4],
- ["A6D4",0x3C5],
- ["A6D5",0x3C6],
- ["A6D6",0x3C7],
- ["A6D7",0x3C8],
- ["A6D8",0x3C9],
- ["A7A7",0x401],
- ["A7A1",0x410],
- ["A7A2",0x411],
- ["A7A3",0x412],
- ["A7A4",0x413],
- ["A7A5",0x414],
- ["A7A6",0x415],
- ["A7A8",0x416],
- ["A7A9",0x417],
- ["A7AA",0x418],
- ["A7AB",0x419],
- ["A7AC",0x41A],
- ["A7AD",0x41B],
- ["A7AE",0x41C],
- ["A7AF",0x41D],
- ["A7B0",0x41E],
- ["A7B1",0x41F],
- ["A7B2",0x420],
- ["A7B3",0x421],
- ["A7B4",0x422],
- ["A7B5",0x423],
- ["A7B6",0x424],
- ["A7B7",0x425],
- ["A7B8",0x426],
- ["A7B9",0x427],
- ["A7BA",0x428],
- ["A7BB",0x429],
- ["A7BC",0x42A],
- ["A7BD",0x42B],
- ["A7BE",0x42C],
- ["A7BF",0x42D],
- ["A7C0",0x42E],
- ["A7C1",0x42F],
- ["A7D1",0x430],
- ["A7D2",0x431],
- ["A7D3",0x432],
- ["A7D4",0x433],
- ["A7D5",0x434],
- ["A7D6",0x435],
- ["A7D8",0x436],
- ["A7D9",0x437],
- ["A7DA",0x438],
- ["A7DB",0x439],
- ["A7DC",0x43A],
- ["A7DD",0x43B],
- ["A7DE",0x43C],
- ["A7DF",0x43D],
- ["A7E0",0x43E],
- ["A7E1",0x43F],
- ["A7E2",0x440],
- ["A7E3",0x441],
- ["A7E4",0x442],
- ["A7E5",0x443],
- ["A7E6",0x444],
- ["A7E7",0x445],
- ["A7E8",0x446],
- ["A7E9",0x447],
- ["A7EA",0x448],
- ["A7EB",0x449],
- ["A7EC",0x44A],
- ["A7ED",0x44B],
- ["A7EE",0x44C],
- ["A7EF",0x44D],
- ["A7F0",0x44E],
- ["A7F1",0x44F],
- ["A7D7",0x451],
- ["A95C",0x2010],
- ["A843",0x2013],
- ["A1AA",0x2014],
- ["A844",0x2015],
- ["A1AC",0x2016],
- ["A1AE",0x2018],
- ["A1AF",0x2019],
- ["A1B0",0x201C],
- ["A1B1",0x201D],
- ["A845",0x2025],
- ["A1AD",0x2026],
- ["A1EB",0x2030],
- ["A1E4",0x2032],
- ["A1E5",0x2033],
- ["A846",0x2035],
- ["A1F9",0x203B],
- ["A1E6",0x2103],
- ["A847",0x2105],
- ["A848",0x2109],
- ["A1ED",0x2116],
- ["A959",0x2121],
- ["A2F1",0x2160],
- ["A2F2",0x2161],
- ["A2F3",0x2162],
- ["A2F4",0x2163],
- ["A2F5",0x2164],
- ["A2F6",0x2165],
- ["A2F7",0x2166],
- ["A2F8",0x2167],
- ["A2F9",0x2168],
- ["A2FA",0x2169],
- ["A2FB",0x216A],
- ["A2FC",0x216B],
- ["A2A1",0x2170],
- ["A2A2",0x2171],
- ["A2A3",0x2172],
- ["A2A4",0x2173],
- ["A2A5",0x2174],
- ["A2A6",0x2175],
- ["A2A7",0x2176],
- ["A2A8",0x2177],
- ["A2A9",0x2178],
- ["A2AA",0x2179],
- ["A1FB",0x2190],
- ["A1FC",0x2191],
- ["A1FA",0x2192],
- ["A1FD",0x2193],
- ["A849",0x2196],
- ["A84A",0x2197],
- ["A84B",0x2198],
- ["A84C",0x2199],
- ["A1CA",0x2208],
- ["A1C7",0x220F],
- ["A1C6",0x2211],
- ["A84D",0x2215],
- ["A1CC",0x221A],
- ["A1D8",0x221D],
- ["A1DE",0x221E],
- ["A84E",0x221F],
- ["A1CF",0x2220],
- ["A84F",0x2223],
- ["A1CE",0x2225],
- ["A1C4",0x2227],
- ["A1C5",0x2228],
- ["A1C9",0x2229],
- ["A1C8",0x222A],
- ["A1D2",0x222B],
- ["A1D3",0x222E],
- ["A1E0",0x2234],
- ["A1DF",0x2235],
- ["A1C3",0x2236],
- ["A1CB",0x2237],
- ["A1D7",0x223D],
- ["A1D6",0x2248],
- ["A1D5",0x224C],
- ["A850",0x2252],
- ["A1D9",0x2260],
- ["A1D4",0x2261],
- ["A1DC",0x2264],
- ["A1DD",0x2265],
- ["A851",0x2266],
- ["A852",0x2267],
- ["A1DA",0x226E],
- ["A1DB",0x226F],
- ["A892",0x2295],
- ["A1D1",0x2299],
- ["A1CD",0x22A5],
- ["A853",0x22BF],
- ["A1D0",0x2312],
- ["A2D9",0x2460],
- ["A2DA",0x2461],
- ["A2DB",0x2462],
- ["A2DC",0x2463],
- ["A2DD",0x2464],
- ["A2DE",0x2465],
- ["A2DF",0x2466],
- ["A2E0",0x2467],
- ["A2E1",0x2468],
- ["A2E2",0x2469],
- ["A2C5",0x2474],
- ["A2C6",0x2475],
- ["A2C7",0x2476],
- ["A2C8",0x2477],
- ["A2C9",0x2478],
- ["A2CA",0x2479],
- ["A2CB",0x247A],
- ["A2CC",0x247B],
- ["A2CD",0x247C],
- ["A2CE",0x247D],
- ["A2CF",0x247E],
- ["A2D0",0x247F],
- ["A2D1",0x2480],
- ["A2D2",0x2481],
- ["A2D3",0x2482],
- ["A2D4",0x2483],
- ["A2D5",0x2484],
- ["A2D6",0x2485],
- ["A2D7",0x2486],
- ["A2D8",0x2487],
- ["A2B1",0x2488],
- ["A2B2",0x2489],
- ["A2B3",0x248A],
- ["A2B4",0x248B],
- ["A2B5",0x248C],
- ["A2B6",0x248D],
- ["A2B7",0x248E],
- ["A2B8",0x248F],
- ["A2B9",0x2490],
- ["A2BA",0x2491],
- ["A2BB",0x2492],
- ["A2BC",0x2493],
- ["A2BD",0x2494],
- ["A2BE",0x2495],
- ["A2BF",0x2496],
- ["A2C0",0x2497],
- ["A2C1",0x2498],
- ["A2C2",0x2499],
- ["A2C3",0x249A],
- ["A2C4",0x249B],
- ["A9A4",0x2500],
- ["A9A5",0x2501],
- ["A9A6",0x2502],
- ["A9A7",0x2503],
- ["A9A8",0x2504],
- ["A9A9",0x2505],
- ["A9AA",0x2506],
- ["A9AB",0x2507],
- ["A9AC",0x2508],
- ["A9AD",0x2509],
- ["A9AE",0x250A],
- ["A9AF",0x250B],
- ["A9B0",0x250C],
- ["A9B1",0x250D],
- ["A9B2",0x250E],
- ["A9B3",0x250F],
- ["A9B4",0x2510],
- ["A9B5",0x2511],
- ["A9B6",0x2512],
- ["A9B7",0x2513],
- ["A9B8",0x2514],
- ["A9B9",0x2515],
- ["A9BA",0x2516],
- ["A9BB",0x2517],
- ["A9BC",0x2518],
- ["A9BD",0x2519],
- ["A9BE",0x251A],
- ["A9BF",0x251B],
- ["A9C0",0x251C],
- ["A9C1",0x251D],
- ["A9C2",0x251E],
- ["A9C3",0x251F],
- ["A9C4",0x2520],
- ["A9C5",0x2521],
- ["A9C6",0x2522],
- ["A9C7",0x2523],
- ["A9C8",0x2524],
- ["A9C9",0x2525],
- ["A9CA",0x2526],
- ["A9CB",0x2527],
- ["A9CC",0x2528],
- ["A9CD",0x2529],
- ["A9CE",0x252A],
- ["A9CF",0x252B],
- ["A9D0",0x252C],
- ["A9D1",0x252D],
- ["A9D2",0x252E],
- ["A9D3",0x252F],
- ["A9D4",0x2530],
- ["A9D5",0x2531],
- ["A9D6",0x2532],
- ["A9D7",0x2533],
- ["A9D8",0x2534],
- ["A9D9",0x2535],
- ["A9DA",0x2536],
- ["A9DB",0x2537],
- ["A9DC",0x2538],
- ["A9DD",0x2539],
- ["A9DE",0x253A],
- ["A9DF",0x253B],
- ["A9E0",0x253C],
- ["A9E1",0x253D],
- ["A9E2",0x253E],
- ["A9E3",0x253F],
- ["A9E4",0x2540],
- ["A9E5",0x2541],
- ["A9E6",0x2542],
- ["A9E7",0x2543],
- ["A9E8",0x2544],
- ["A9E9",0x2545],
- ["A9EA",0x2546],
- ["A9EB",0x2547],
- ["A9EC",0x2548],
- ["A9ED",0x2549],
- ["A9EE",0x254A],
- ["A9EF",0x254B],
- ["A854",0x2550],
- ["A855",0x2551],
- ["A856",0x2552],
- ["A857",0x2553],
- ["A858",0x2554],
- ["A859",0x2555],
- ["A85A",0x2556],
- ["A85B",0x2557],
- ["A85C",0x2558],
- ["A85D",0x2559],
- ["A85E",0x255A],
- ["A85F",0x255B],
- ["A860",0x255C],
- ["A861",0x255D],
- ["A862",0x255E],
- ["A863",0x255F],
- ["A864",0x2560],
- ["A865",0x2561],
- ["A866",0x2562],
- ["A867",0x2563],
- ["A868",0x2564],
- ["A869",0x2565],
- ["A86A",0x2566],
- ["A86B",0x2567],
- ["A86C",0x2568],
- ["A86D",0x2569],
- ["A86E",0x256A],
- ["A86F",0x256B],
- ["A870",0x256C],
- ["A871",0x256D],
- ["A872",0x256E],
- ["A873",0x256F],
- ["A874",0x2570],
- ["A875",0x2571],
- ["A876",0x2572],
- ["A877",0x2573],
- ["A878",0x2581],
- ["A879",0x2582],
- ["A87A",0x2583],
- ["A87B",0x2584],
- ["A87C",0x2585],
- ["A87D",0x2586],
- ["A87E",0x2587],
- ["A880",0x2588],
- ["A881",0x2589],
- ["A882",0x258A],
- ["A883",0x258B],
- ["A884",0x258C],
- ["A885",0x258D],
- ["A886",0x258E],
- ["A887",0x258F],
- ["A888",0x2593],
- ["A889",0x2594],
- ["A88A",0x2595],
- ["A1F6",0x25A0],
- ["A1F5",0x25A1],
- ["A1F8",0x25B2],
- ["A1F7",0x25B3],
- ["A88B",0x25BC],
- ["A88C",0x25BD],
- ["A1F4",0x25C6],
- ["A1F3",0x25C7],
- ["A1F0",0x25CB],
- ["A1F2",0x25CE],
- ["A1F1",0x25CF],
- ["A88D",0x25E2],
- ["A88E",0x25E3],
- ["A88F",0x25E4],
- ["A890",0x25E5],
- ["A1EF",0x2605],
- ["A1EE",0x2606],
- ["A891",0x2609],
- ["A1E2",0x2640],
- ["A1E1",0x2642],
- ["A1A1",0x3000],
- ["A1A2",0x3001],
- ["A1A3",0x3002],
- ["A1A8",0x3003],
- ["A1A9",0x3005],
- ["A965",0x3006],
- ["A996",0x3007],
- ["A1B4",0x3008],
- ["A1B5",0x3009],
- ["A1B6",0x300A],
- ["A1B7",0x300B],
- ["A1B8",0x300C],
- ["A1B9",0x300D],
- ["A1BA",0x300E],
- ["A1BB",0x300F],
- ["A1BE",0x3010],
- ["A1BF",0x3011],
- ["A893",0x3012],
- ["A1FE",0x3013],
- ["A1B2",0x3014],
- ["A1B3",0x3015],
- ["A1BC",0x3016],
- ["A1BD",0x3017],
- ["A894",0x301D],
- ["A895",0x301E],
- ["A940",0x3021],
- ["A941",0x3022],
- ["A942",0x3023],
- ["A943",0x3024],
- ["A944",0x3025],
- ["A945",0x3026],
- ["A946",0x3027],
- ["A947",0x3028],
- ["A948",0x3029],
- ["A4A1",0x3041],
- ["A4A2",0x3042],
- ["A4A3",0x3043],
- ["A4A4",0x3044],
- ["A4A5",0x3045],
- ["A4A6",0x3046],
- ["A4A7",0x3047],
- ["A4A8",0x3048],
- ["A4A9",0x3049],
- ["A4AA",0x304A],
- ["A4AB",0x304B],
- ["A4AC",0x304C],
- ["A4AD",0x304D],
- ["A4AE",0x304E],
- ["A4AF",0x304F],
- ["A4B0",0x3050],
- ["A4B1",0x3051],
- ["A4B2",0x3052],
- ["A4B3",0x3053],
- ["A4B4",0x3054],
- ["A4B5",0x3055],
- ["A4B6",0x3056],
- ["A4B7",0x3057],
- ["A4B8",0x3058],
- ["A4B9",0x3059],
- ["A4BA",0x305A],
- ["A4BB",0x305B],
- ["A4BC",0x305C],
- ["A4BD",0x305D],
- ["A4BE",0x305E],
- ["A4BF",0x305F],
- ["A4C0",0x3060],
- ["A4C1",0x3061],
- ["A4C2",0x3062],
- ["A4C3",0x3063],
- ["A4C4",0x3064],
- ["A4C5",0x3065],
- ["A4C6",0x3066],
- ["A4C7",0x3067],
- ["A4C8",0x3068],
- ["A4C9",0x3069],
- ["A4CA",0x306A],
- ["A4CB",0x306B],
- ["A4CC",0x306C],
- ["A4CD",0x306D],
- ["A4CE",0x306E],
- ["A4CF",0x306F],
- ["A4D0",0x3070],
- ["A4D1",0x3071],
- ["A4D2",0x3072],
- ["A4D3",0x3073],
- ["A4D4",0x3074],
- ["A4D5",0x3075],
- ["A4D6",0x3076],
- ["A4D7",0x3077],
- ["A4D8",0x3078],
- ["A4D9",0x3079],
- ["A4DA",0x307A],
- ["A4DB",0x307B],
- ["A4DC",0x307C],
- ["A4DD",0x307D],
- ["A4DE",0x307E],
- ["A4DF",0x307F],
- ["A4E0",0x3080],
- ["A4E1",0x3081],
- ["A4E2",0x3082],
- ["A4E3",0x3083],
- ["A4E4",0x3084],
- ["A4E5",0x3085],
- ["A4E6",0x3086],
- ["A4E7",0x3087],
- ["A4E8",0x3088],
- ["A4E9",0x3089],
- ["A4EA",0x308A],
- ["A4EB",0x308B],
- ["A4EC",0x308C],
- ["A4ED",0x308D],
- ["A4EE",0x308E],
- ["A4EF",0x308F],
- ["A4F0",0x3090],
- ["A4F1",0x3091],
- ["A4F2",0x3092],
- ["A4F3",0x3093],
- ["A961",0x309B],
- ["A962",0x309C],
- ["A966",0x309D],
- ["A967",0x309E],
- ["A5A1",0x30A1],
- ["A5A2",0x30A2],
- ["A5A3",0x30A3],
- ["A5A4",0x30A4],
- ["A5A5",0x30A5],
- ["A5A6",0x30A6],
- ["A5A7",0x30A7],
- ["A5A8",0x30A8],
- ["A5A9",0x30A9],
- ["A5AA",0x30AA],
- ["A5AB",0x30AB],
- ["A5AC",0x30AC],
- ["A5AD",0x30AD],
- ["A5AE",0x30AE],
- ["A5AF",0x30AF],
- ["A5B0",0x30B0],
- ["A5B1",0x30B1],
- ["A5B2",0x30B2],
- ["A5B3",0x30B3],
- ["A5B4",0x30B4],
- ["A5B5",0x30B5],
- ["A5B6",0x30B6],
- ["A5B7",0x30B7],
- ["A5B8",0x30B8],
- ["A5B9",0x30B9],
- ["A5BA",0x30BA],
- ["A5BB",0x30BB],
- ["A5BC",0x30BC],
- ["A5BD",0x30BD],
- ["A5BE",0x30BE],
- ["A5BF",0x30BF],
- ["A5C0",0x30C0],
- ["A5C1",0x30C1],
- ["A5C2",0x30C2],
- ["A5C3",0x30C3],
- ["A5C4",0x30C4],
- ["A5C5",0x30C5],
- ["A5C6",0x30C6],
- ["A5C7",0x30C7],
- ["A5C8",0x30C8],
- ["A5C9",0x30C9],
- ["A5CA",0x30CA],
- ["A5CB",0x30CB],
- ["A5CC",0x30CC],
- ["A5CD",0x30CD],
- ["A5CE",0x30CE],
- ["A5CF",0x30CF],
- ["A5D0",0x30D0],
- ["A5D1",0x30D1],
- ["A5D2",0x30D2],
- ["A5D3",0x30D3],
- ["A5D4",0x30D4],
- ["A5D5",0x30D5],
- ["A5D6",0x30D6],
- ["A5D7",0x30D7],
- ["A5D8",0x30D8],
- ["A5D9",0x30D9],
- ["A5DA",0x30DA],
- ["A5DB",0x30DB],
- ["A5DC",0x30DC],
- ["A5DD",0x30DD],
- ["A5DE",0x30DE],
- ["A5DF",0x30DF],
- ["A5E0",0x30E0],
- ["A5E1",0x30E1],
- ["A5E2",0x30E2],
- ["A5E3",0x30E3],
- ["A5E4",0x30E4],
- ["A5E5",0x30E5],
- ["A5E6",0x30E6],
- ["A5E7",0x30E7],
- ["A5E8",0x30E8],
- ["A5E9",0x30E9],
- ["A5EA",0x30EA],
- ["A5EB",0x30EB],
- ["A5EC",0x30EC],
- ["A5ED",0x30ED],
- ["A5EE",0x30EE],
- ["A5EF",0x30EF],
- ["A5F0",0x30F0],
- ["A5F1",0x30F1],
- ["A5F2",0x30F2],
- ["A5F3",0x30F3],
- ["A5F4",0x30F4],
- ["A5F5",0x30F5],
- ["A5F6",0x30F6],
- ["A960",0x30FC],
- ["A963",0x30FD],
- ["A964",0x30FE],
- ["A8C5",0x3105],
- ["A8C6",0x3106],
- ["A8C7",0x3107],
- ["A8C8",0x3108],
- ["A8C9",0x3109],
- ["A8CA",0x310A],
- ["A8CB",0x310B],
- ["A8CC",0x310C],
- ["A8CD",0x310D],
- ["A8CE",0x310E],
- ["A8CF",0x310F],
- ["A8D0",0x3110],
- ["A8D1",0x3111],
- ["A8D2",0x3112],
- ["A8D3",0x3113],
- ["A8D4",0x3114],
- ["A8D5",0x3115],
- ["A8D6",0x3116],
- ["A8D7",0x3117],
- ["A8D8",0x3118],
- ["A8D9",0x3119],
- ["A8DA",0x311A],
- ["A8DB",0x311B],
- ["A8DC",0x311C],
- ["A8DD",0x311D],
- ["A8DE",0x311E],
- ["A8DF",0x311F],
- ["A8E0",0x3120],
- ["A8E1",0x3121],
- ["A8E2",0x3122],
- ["A8E3",0x3123],
- ["A8E4",0x3124],
- ["A8E5",0x3125],
- ["A8E6",0x3126],
- ["A8E7",0x3127],
- ["A8E8",0x3128],
- ["A8E9",0x3129],
- ["A2E5",0x3220],
- ["A2E6",0x3221],
- ["A2E7",0x3222],
- ["A2E8",0x3223],
- ["A2E9",0x3224],
- ["A2EA",0x3225],
- ["A2EB",0x3226],
- ["A2EC",0x3227],
- ["A2ED",0x3228],
- ["A2EE",0x3229],
- ["A95A",0x3231],
- ["A949",0x32A3],
- ["A94A",0x338E],
- ["A94B",0x338F],
- ["A94C",0x339C],
- ["A94D",0x339D],
- ["A94E",0x339E],
- ["A94F",0x33A1],
- ["A950",0x33C4],
- ["A951",0x33CE],
- ["A952",0x33D1],
- ["A953",0x33D2],
- ["A954",0x33D5],
- ["D2BB",0x4E00],
- ["B6A1",0x4E01],
- ["8140",0x4E02],
- ["C6DF",0x4E03],
- ["8141",0x4E04],
- ["8142",0x4E05],
- ["8143",0x4E06],
- ["CDF2",0x4E07],
- ["D5C9",0x4E08],
- ["C8FD",0x4E09],
- ["C9CF",0x4E0A],
- ["CFC2",0x4E0B],
- ["D8A2",0x4E0C],
- ["B2BB",0x4E0D],
- ["D3EB",0x4E0E],
- ["8144",0x4E0F],
- ["D8A4",0x4E10],
- ["B3F3",0x4E11],
- ["8145",0x4E12],
- ["D7A8",0x4E13],
- ["C7D2",0x4E14],
- ["D8A7",0x4E15],
- ["CAC0",0x4E16],
- ["8146",0x4E17],
- ["C7F0",0x4E18],
- ["B1FB",0x4E19],
- ["D2B5",0x4E1A],
- ["B4D4",0x4E1B],
- ["B6AB",0x4E1C],
- ["CBBF",0x4E1D],
- ["D8A9",0x4E1E],
- ["8147",0x4E1F],
- ["8148",0x4E20],
- ["8149",0x4E21],
- ["B6AA",0x4E22],
- ["814A",0x4E23],
- ["C1BD",0x4E24],
- ["D1CF",0x4E25],
- ["814B",0x4E26],
- ["C9A5",0x4E27],
- ["D8AD",0x4E28],
- ["814C",0x4E29],
- ["B8F6",0x4E2A],
- ["D1BE",0x4E2B],
- ["E3DC",0x4E2C],
- ["D6D0",0x4E2D],
- ["814D",0x4E2E],
- ["814E",0x4E2F],
- ["B7E1",0x4E30],
- ["814F",0x4E31],
- ["B4AE",0x4E32],
- ["8150",0x4E33],
- ["C1D9",0x4E34],
- ["8151",0x4E35],
- ["D8BC",0x4E36],
- ["8152",0x4E37],
- ["CDE8",0x4E38],
- ["B5A4",0x4E39],
- ["CEAA",0x4E3A],
- ["D6F7",0x4E3B],
- ["8153",0x4E3C],
- ["C0F6",0x4E3D],
- ["BED9",0x4E3E],
- ["D8AF",0x4E3F],
- ["8154",0x4E40],
- ["8155",0x4E41],
- ["8156",0x4E42],
- ["C4CB",0x4E43],
- ["8157",0x4E44],
- ["BEC3",0x4E45],
- ["8158",0x4E46],
- ["D8B1",0x4E47],
- ["C3B4",0x4E48],
- ["D2E5",0x4E49],
- ["8159",0x4E4A],
- ["D6AE",0x4E4B],
- ["CEDA",0x4E4C],
- ["D5A7",0x4E4D],
- ["BAF5",0x4E4E],
- ["B7A6",0x4E4F],
- ["C0D6",0x4E50],
- ["815A",0x4E51],
- ["C6B9",0x4E52],
- ["C5D2",0x4E53],
- ["C7C7",0x4E54],
- ["815B",0x4E55],
- ["B9D4",0x4E56],
- ["815C",0x4E57],
- ["B3CB",0x4E58],
- ["D2D2",0x4E59],
- ["815D",0x4E5A],
- ["815E",0x4E5B],
- ["D8BF",0x4E5C],
- ["BEC5",0x4E5D],
- ["C6F2",0x4E5E],
- ["D2B2",0x4E5F],
- ["CFB0",0x4E60],
- ["CFE7",0x4E61],
- ["815F",0x4E62],
- ["8160",0x4E63],
- ["8161",0x4E64],
- ["8162",0x4E65],
- ["CAE9",0x4E66],
- ["8163",0x4E67],
- ["8164",0x4E68],
- ["D8C0",0x4E69],
- ["8165",0x4E6A],
- ["8166",0x4E6B],
- ["8167",0x4E6C],
- ["8168",0x4E6D],
- ["8169",0x4E6E],
- ["816A",0x4E6F],
- ["C2F2",0x4E70],
- ["C2D2",0x4E71],
- ["816B",0x4E72],
- ["C8E9",0x4E73],
- ["816C",0x4E74],
- ["816D",0x4E75],
- ["816E",0x4E76],
- ["816F",0x4E77],
- ["8170",0x4E78],
- ["8171",0x4E79],
- ["8172",0x4E7A],
- ["8173",0x4E7B],
- ["8174",0x4E7C],
- ["8175",0x4E7D],
- ["C7AC",0x4E7E],
- ["8176",0x4E7F],
- ["8177",0x4E80],
- ["8178",0x4E81],
- ["8179",0x4E82],
- ["817A",0x4E83],
- ["817B",0x4E84],
- ["817C",0x4E85],
- ["C1CB",0x4E86],
- ["817D",0x4E87],
- ["D3E8",0x4E88],
- ["D5F9",0x4E89],
- ["817E",0x4E8A],
- ["CAC2",0x4E8B],
- ["B6FE",0x4E8C],
- ["D8A1",0x4E8D],
- ["D3DA",0x4E8E],
- ["BFF7",0x4E8F],
- ["8180",0x4E90],
- ["D4C6",0x4E91],
- ["BBA5",0x4E92],
- ["D8C1",0x4E93],
- ["CEE5",0x4E94],
- ["BEAE",0x4E95],
- ["8181",0x4E96],
- ["8182",0x4E97],
- ["D8A8",0x4E98],
- ["8183",0x4E99],
- ["D1C7",0x4E9A],
- ["D0A9",0x4E9B],
- ["8184",0x4E9C],
- ["8185",0x4E9D],
- ["8186",0x4E9E],
- ["D8BD",0x4E9F],
- ["D9EF",0x4EA0],
- ["CDF6",0x4EA1],
- ["BFBA",0x4EA2],
- ["8187",0x4EA3],
- ["BDBB",0x4EA4],
- ["BAA5",0x4EA5],
- ["D2E0",0x4EA6],
- ["B2FA",0x4EA7],
- ["BAE0",0x4EA8],
- ["C4B6",0x4EA9],
- ["8188",0x4EAA],
- ["CFED",0x4EAB],
- ["BEA9",0x4EAC],
- ["CDA4",0x4EAD],
- ["C1C1",0x4EAE],
- ["8189",0x4EAF],
- ["818A",0x4EB0],
- ["818B",0x4EB1],
- ["C7D7",0x4EB2],
- ["D9F1",0x4EB3],
- ["818C",0x4EB4],
- ["D9F4",0x4EB5],
- ["818D",0x4EB6],
- ["818E",0x4EB7],
- ["818F",0x4EB8],
- ["8190",0x4EB9],
- ["C8CB",0x4EBA],
- ["D8E9",0x4EBB],
- ["8191",0x4EBC],
- ["8192",0x4EBD],
- ["8193",0x4EBE],
- ["D2DA",0x4EBF],
- ["CAB2",0x4EC0],
- ["C8CA",0x4EC1],
- ["D8EC",0x4EC2],
- ["D8EA",0x4EC3],
- ["D8C6",0x4EC4],
- ["BDF6",0x4EC5],
- ["C6CD",0x4EC6],
- ["B3F0",0x4EC7],
- ["8194",0x4EC8],
- ["D8EB",0x4EC9],
- ["BDF1",0x4ECA],
- ["BDE9",0x4ECB],
- ["8195",0x4ECC],
- ["C8D4",0x4ECD],
- ["B4D3",0x4ECE],
- ["8196",0x4ECF],
- ["8197",0x4ED0],
- ["C2D8",0x4ED1],
- ["8198",0x4ED2],
- ["B2D6",0x4ED3],
- ["D7D0",0x4ED4],
- ["CACB",0x4ED5],
- ["CBFB",0x4ED6],
- ["D5CC",0x4ED7],
- ["B8B6",0x4ED8],
- ["CFC9",0x4ED9],
- ["8199",0x4EDA],
- ["819A",0x4EDB],
- ["819B",0x4EDC],
- ["D9DA",0x4EDD],
- ["D8F0",0x4EDE],
- ["C7AA",0x4EDF],
- ["819C",0x4EE0],
- ["D8EE",0x4EE1],
- ["819D",0x4EE2],
- ["B4FA",0x4EE3],
- ["C1EE",0x4EE4],
- ["D2D4",0x4EE5],
- ["819E",0x4EE6],
- ["819F",0x4EE7],
- ["D8ED",0x4EE8],
- ["81A0",0x4EE9],
- ["D2C7",0x4EEA],
- ["D8EF",0x4EEB],
- ["C3C7",0x4EEC],
- ["81A1",0x4EED],
- ["81A2",0x4EEE],
- ["81A3",0x4EEF],
- ["D1F6",0x4EF0],
- ["81A4",0x4EF1],
- ["D6D9",0x4EF2],
- ["D8F2",0x4EF3],
- ["81A5",0x4EF4],
- ["D8F5",0x4EF5],
- ["BCFE",0x4EF6],
- ["BCDB",0x4EF7],
- ["81A6",0x4EF8],
- ["81A7",0x4EF9],
- ["81A8",0x4EFA],
- ["C8CE",0x4EFB],
- ["81A9",0x4EFC],
- ["B7DD",0x4EFD],
- ["81AA",0x4EFE],
- ["B7C2",0x4EFF],
- ["81AB",0x4F00],
- ["C6F3",0x4F01],
- ["81AC",0x4F02],
- ["81AD",0x4F03],
- ["81AE",0x4F04],
- ["81AF",0x4F05],
- ["81B0",0x4F06],
- ["81B1",0x4F07],
- ["81B2",0x4F08],
- ["D8F8",0x4F09],
- ["D2C1",0x4F0A],
- ["81B3",0x4F0B],
- ["81B4",0x4F0C],
- ["CEE9",0x4F0D],
- ["BCBF",0x4F0E],
- ["B7FC",0x4F0F],
- ["B7A5",0x4F10],
- ["D0DD",0x4F11],
- ["81B5",0x4F12],
- ["81B6",0x4F13],
- ["81B7",0x4F14],
- ["81B8",0x4F15],
- ["81B9",0x4F16],
- ["D6DA",0x4F17],
- ["D3C5",0x4F18],
- ["BBEF",0x4F19],
- ["BBE1",0x4F1A],
- ["D8F1",0x4F1B],
- ["81BA",0x4F1C],
- ["81BB",0x4F1D],
- ["C9A1",0x4F1E],
- ["CEB0",0x4F1F],
- ["B4AB",0x4F20],
- ["81BC",0x4F21],
- ["D8F3",0x4F22],
- ["81BD",0x4F23],
- ["C9CB",0x4F24],
- ["D8F6",0x4F25],
- ["C2D7",0x4F26],
- ["D8F7",0x4F27],
- ["81BE",0x4F28],
- ["81BF",0x4F29],
- ["CEB1",0x4F2A],
- ["D8F9",0x4F2B],
- ["81C0",0x4F2C],
- ["81C1",0x4F2D],
- ["81C2",0x4F2E],
- ["B2AE",0x4F2F],
- ["B9C0",0x4F30],
- ["81C3",0x4F31],
- ["D9A3",0x4F32],
- ["81C4",0x4F33],
- ["B0E9",0x4F34],
- ["81C5",0x4F35],
- ["C1E6",0x4F36],
- ["81C6",0x4F37],
- ["C9EC",0x4F38],
- ["81C7",0x4F39],
- ["CBC5",0x4F3A],
- ["81C8",0x4F3B],
- ["CBC6",0x4F3C],
- ["D9A4",0x4F3D],
- ["81C9",0x4F3E],
- ["81CA",0x4F3F],
- ["81CB",0x4F40],
- ["81CC",0x4F41],
- ["81CD",0x4F42],
- ["B5E8",0x4F43],
- ["81CE",0x4F44],
- ["81CF",0x4F45],
- ["B5AB",0x4F46],
- ["81D0",0x4F47],
- ["81D1",0x4F48],
- ["81D2",0x4F49],
- ["81D3",0x4F4A],
- ["81D4",0x4F4B],
- ["81D5",0x4F4C],
- ["CEBB",0x4F4D],
- ["B5CD",0x4F4E],
- ["D7A1",0x4F4F],
- ["D7F4",0x4F50],
- ["D3D3",0x4F51],
- ["81D6",0x4F52],
- ["CCE5",0x4F53],
- ["81D7",0x4F54],
- ["BACE",0x4F55],
- ["81D8",0x4F56],
- ["D9A2",0x4F57],
- ["D9DC",0x4F58],
- ["D3E0",0x4F59],
- ["D8FD",0x4F5A],
- ["B7F0",0x4F5B],
- ["D7F7",0x4F5C],
- ["D8FE",0x4F5D],
- ["D8FA",0x4F5E],
- ["D9A1",0x4F5F],
- ["C4E3",0x4F60],
- ["81D9",0x4F61],
- ["81DA",0x4F62],
- ["D3B6",0x4F63],
- ["D8F4",0x4F64],
- ["D9DD",0x4F65],
- ["81DB",0x4F66],
- ["D8FB",0x4F67],
- ["81DC",0x4F68],
- ["C5E5",0x4F69],
- ["81DD",0x4F6A],
- ["81DE",0x4F6B],
- ["C0D0",0x4F6C],
- ["81DF",0x4F6D],
- ["81E0",0x4F6E],
- ["D1F0",0x4F6F],
- ["B0DB",0x4F70],
- ["81E1",0x4F71],
- ["81E2",0x4F72],
- ["BCD1",0x4F73],
- ["D9A6",0x4F74],
- ["81E3",0x4F75],
- ["D9A5",0x4F76],
- ["81E4",0x4F77],
- ["81E5",0x4F78],
- ["81E6",0x4F79],
- ["81E7",0x4F7A],
- ["D9AC",0x4F7B],
- ["D9AE",0x4F7C],
- ["81E8",0x4F7D],
- ["D9AB",0x4F7E],
- ["CAB9",0x4F7F],
- ["81E9",0x4F80],
- ["81EA",0x4F81],
- ["81EB",0x4F82],
- ["D9A9",0x4F83],
- ["D6B6",0x4F84],
- ["81EC",0x4F85],
- ["81ED",0x4F86],
- ["81EE",0x4F87],
- ["B3DE",0x4F88],
- ["D9A8",0x4F89],
- ["81EF",0x4F8A],
- ["C0FD",0x4F8B],
- ["81F0",0x4F8C],
- ["CACC",0x4F8D],
- ["81F1",0x4F8E],
- ["D9AA",0x4F8F],
- ["81F2",0x4F90],
- ["D9A7",0x4F91],
- ["81F3",0x4F92],
- ["81F4",0x4F93],
- ["D9B0",0x4F94],
- ["81F5",0x4F95],
- ["81F6",0x4F96],
- ["B6B1",0x4F97],
- ["81F7",0x4F98],
- ["81F8",0x4F99],
- ["81F9",0x4F9A],
- ["B9A9",0x4F9B],
- ["81FA",0x4F9C],
- ["D2C0",0x4F9D],
- ["81FB",0x4F9E],
- ["81FC",0x4F9F],
- ["CFC0",0x4FA0],
- ["81FD",0x4FA1],
- ["81FE",0x4FA2],
- ["C2C2",0x4FA3],
- ["8240",0x4FA4],
- ["BDC4",0x4FA5],
- ["D5EC",0x4FA6],
- ["B2E0",0x4FA7],
- ["C7C8",0x4FA8],
- ["BFEB",0x4FA9],
- ["D9AD",0x4FAA],
- ["8241",0x4FAB],
- ["D9AF",0x4FAC],
- ["8242",0x4FAD],
- ["CEEA",0x4FAE],
- ["BAEE",0x4FAF],
- ["8243",0x4FB0],
- ["8244",0x4FB1],
- ["8245",0x4FB2],
- ["8246",0x4FB3],
- ["8247",0x4FB4],
- ["C7D6",0x4FB5],
- ["8248",0x4FB6],
- ["8249",0x4FB7],
- ["824A",0x4FB8],
- ["824B",0x4FB9],
- ["824C",0x4FBA],
- ["824D",0x4FBB],
- ["824E",0x4FBC],
- ["824F",0x4FBD],
- ["8250",0x4FBE],
- ["B1E3",0x4FBF],
- ["8251",0x4FC0],
- ["8252",0x4FC1],
- ["8253",0x4FC2],
- ["B4D9",0x4FC3],
- ["B6ED",0x4FC4],
- ["D9B4",0x4FC5],
- ["8254",0x4FC6],
- ["8255",0x4FC7],
- ["8256",0x4FC8],
- ["8257",0x4FC9],
- ["BFA1",0x4FCA],
- ["8258",0x4FCB],
- ["8259",0x4FCC],
- ["825A",0x4FCD],
- ["D9DE",0x4FCE],
- ["C7CE",0x4FCF],
- ["C0FE",0x4FD0],
- ["D9B8",0x4FD1],
- ["825B",0x4FD2],
- ["825C",0x4FD3],
- ["825D",0x4FD4],
- ["825E",0x4FD5],
- ["825F",0x4FD6],
- ["CBD7",0x4FD7],
- ["B7FD",0x4FD8],
- ["8260",0x4FD9],
- ["D9B5",0x4FDA],
- ["8261",0x4FDB],
- ["D9B7",0x4FDC],
- ["B1A3",0x4FDD],
- ["D3E1",0x4FDE],
- ["D9B9",0x4FDF],
- ["8262",0x4FE0],
- ["D0C5",0x4FE1],
- ["8263",0x4FE2],
- ["D9B6",0x4FE3],
- ["8264",0x4FE4],
- ["8265",0x4FE5],
- ["D9B1",0x4FE6],
- ["8266",0x4FE7],
- ["D9B2",0x4FE8],
- ["C1A9",0x4FE9],
- ["D9B3",0x4FEA],
- ["8267",0x4FEB],
- ["8268",0x4FEC],
- ["BCF3",0x4FED],
- ["D0DE",0x4FEE],
- ["B8A9",0x4FEF],
- ["8269",0x4FF0],
- ["BEE3",0x4FF1],
- ["826A",0x4FF2],
- ["D9BD",0x4FF3],
- ["826B",0x4FF4],
- ["826C",0x4FF5],
- ["826D",0x4FF6],
- ["826E",0x4FF7],
- ["D9BA",0x4FF8],
- ["826F",0x4FF9],
- ["B0B3",0x4FFA],
- ["8270",0x4FFB],
- ["8271",0x4FFC],
- ["8272",0x4FFD],
- ["D9C2",0x4FFE],
- ["8273",0x4FFF],
- ["8274",0x5000],
- ["8275",0x5001],
- ["8276",0x5002],
- ["8277",0x5003],
- ["8278",0x5004],
- ["8279",0x5005],
- ["827A",0x5006],
- ["827B",0x5007],
- ["827C",0x5008],
- ["827D",0x5009],
- ["827E",0x500A],
- ["8280",0x500B],
- ["D9C4",0x500C],
- ["B1B6",0x500D],
- ["8281",0x500E],
- ["D9BF",0x500F],
- ["8282",0x5010],
- ["8283",0x5011],
- ["B5B9",0x5012],
- ["8284",0x5013],
- ["BEF3",0x5014],
- ["8285",0x5015],
- ["8286",0x5016],
- ["8287",0x5017],
- ["CCC8",0x5018],
- ["BAF2",0x5019],
- ["D2D0",0x501A],
- ["8288",0x501B],
- ["D9C3",0x501C],
- ["8289",0x501D],
- ["828A",0x501E],
- ["BDE8",0x501F],
- ["828B",0x5020],
- ["B3AB",0x5021],
- ["828C",0x5022],
- ["828D",0x5023],
- ["828E",0x5024],
- ["D9C5",0x5025],
- ["BEEB",0x5026],
- ["828F",0x5027],
- ["D9C6",0x5028],
- ["D9BB",0x5029],
- ["C4DF",0x502A],
- ["8290",0x502B],
- ["D9BE",0x502C],
- ["D9C1",0x502D],
- ["D9C0",0x502E],
- ["8291",0x502F],
- ["8292",0x5030],
- ["8293",0x5031],
- ["8294",0x5032],
- ["8295",0x5033],
- ["8296",0x5034],
- ["8297",0x5035],
- ["8298",0x5036],
- ["8299",0x5037],
- ["829A",0x5038],
- ["829B",0x5039],
- ["D5AE",0x503A],
- ["829C",0x503B],
- ["D6B5",0x503C],
- ["829D",0x503D],
- ["C7E3",0x503E],
- ["829E",0x503F],
- ["829F",0x5040],
- ["82A0",0x5041],
- ["82A1",0x5042],
- ["D9C8",0x5043],
- ["82A2",0x5044],
- ["82A3",0x5045],
- ["82A4",0x5046],
- ["BCD9",0x5047],
- ["D9CA",0x5048],
- ["82A5",0x5049],
- ["82A6",0x504A],
- ["82A7",0x504B],
- ["D9BC",0x504C],
- ["82A8",0x504D],
- ["D9CB",0x504E],
- ["C6AB",0x504F],
- ["82A9",0x5050],
- ["82AA",0x5051],
- ["82AB",0x5052],
- ["82AC",0x5053],
- ["82AD",0x5054],
- ["D9C9",0x5055],
- ["82AE",0x5056],
- ["82AF",0x5057],
- ["82B0",0x5058],
- ["82B1",0x5059],
- ["D7F6",0x505A],
- ["82B2",0x505B],
- ["CDA3",0x505C],
- ["82B3",0x505D],
- ["82B4",0x505E],
- ["82B5",0x505F],
- ["82B6",0x5060],
- ["82B7",0x5061],
- ["82B8",0x5062],
- ["82B9",0x5063],
- ["82BA",0x5064],
- ["BDA1",0x5065],
- ["82BB",0x5066],
- ["82BC",0x5067],
- ["82BD",0x5068],
- ["82BE",0x5069],
- ["82BF",0x506A],
- ["82C0",0x506B],
- ["D9CC",0x506C],
- ["82C1",0x506D],
- ["82C2",0x506E],
- ["82C3",0x506F],
- ["82C4",0x5070],
- ["82C5",0x5071],
- ["82C6",0x5072],
- ["82C7",0x5073],
- ["82C8",0x5074],
- ["82C9",0x5075],
- ["C5BC",0x5076],
- ["CDB5",0x5077],
- ["82CA",0x5078],
- ["82CB",0x5079],
- ["82CC",0x507A],
- ["D9CD",0x507B],
- ["82CD",0x507C],
- ["82CE",0x507D],
- ["D9C7",0x507E],
- ["B3A5",0x507F],
- ["BFFE",0x5080],
- ["82CF",0x5081],
- ["82D0",0x5082],
- ["82D1",0x5083],
- ["82D2",0x5084],
- ["B8B5",0x5085],
- ["82D3",0x5086],
- ["82D4",0x5087],
- ["C0FC",0x5088],
- ["82D5",0x5089],
- ["82D6",0x508A],
- ["82D7",0x508B],
- ["82D8",0x508C],
- ["B0F8",0x508D],
- ["82D9",0x508E],
- ["82DA",0x508F],
- ["82DB",0x5090],
- ["82DC",0x5091],
- ["82DD",0x5092],
- ["82DE",0x5093],
- ["82DF",0x5094],
- ["82E0",0x5095],
- ["82E1",0x5096],
- ["82E2",0x5097],
- ["82E3",0x5098],
- ["82E4",0x5099],
- ["82E5",0x509A],
- ["82E6",0x509B],
- ["82E7",0x509C],
- ["82E8",0x509D],
- ["82E9",0x509E],
- ["82EA",0x509F],
- ["82EB",0x50A0],
- ["82EC",0x50A1],
- ["82ED",0x50A2],
- ["B4F6",0x50A3],
- ["82EE",0x50A4],
- ["D9CE",0x50A5],
- ["82EF",0x50A6],
- ["D9CF",0x50A7],
- ["B4A2",0x50A8],
- ["D9D0",0x50A9],
- ["82F0",0x50AA],
- ["82F1",0x50AB],
- ["B4DF",0x50AC],
- ["82F2",0x50AD],
- ["82F3",0x50AE],
- ["82F4",0x50AF],
- ["82F5",0x50B0],
- ["82F6",0x50B1],
- ["B0C1",0x50B2],
- ["82F7",0x50B3],
- ["82F8",0x50B4],
- ["82F9",0x50B5],
- ["82FA",0x50B6],
- ["82FB",0x50B7],
- ["82FC",0x50B8],
- ["82FD",0x50B9],
- ["D9D1",0x50BA],
- ["C9B5",0x50BB],
- ["82FE",0x50BC],
- ["8340",0x50BD],
- ["8341",0x50BE],
- ["8342",0x50BF],
- ["8343",0x50C0],
- ["8344",0x50C1],
- ["8345",0x50C2],
- ["8346",0x50C3],
- ["8347",0x50C4],
- ["8348",0x50C5],
- ["8349",0x50C6],
- ["834A",0x50C7],
- ["834B",0x50C8],
- ["834C",0x50C9],
- ["834D",0x50CA],
- ["834E",0x50CB],
- ["834F",0x50CC],
- ["8350",0x50CD],
- ["8351",0x50CE],
- ["CFF1",0x50CF],
- ["8352",0x50D0],
- ["8353",0x50D1],
- ["8354",0x50D2],
- ["8355",0x50D3],
- ["8356",0x50D4],
- ["8357",0x50D5],
- ["D9D2",0x50D6],
- ["8358",0x50D7],
- ["8359",0x50D8],
- ["835A",0x50D9],
- ["C1C5",0x50DA],
- ["835B",0x50DB],
- ["835C",0x50DC],
- ["835D",0x50DD],
- ["835E",0x50DE],
- ["835F",0x50DF],
- ["8360",0x50E0],
- ["8361",0x50E1],
- ["8362",0x50E2],
- ["8363",0x50E3],
- ["8364",0x50E4],
- ["8365",0x50E5],
- ["D9D6",0x50E6],
- ["C9AE",0x50E7],
- ["8366",0x50E8],
- ["8367",0x50E9],
- ["8368",0x50EA],
- ["8369",0x50EB],
- ["D9D5",0x50EC],
- ["D9D4",0x50ED],
- ["D9D7",0x50EE],
- ["836A",0x50EF],
- ["836B",0x50F0],
- ["836C",0x50F1],
- ["836D",0x50F2],
- ["CBDB",0x50F3],
- ["836E",0x50F4],
- ["BDA9",0x50F5],
- ["836F",0x50F6],
- ["8370",0x50F7],
- ["8371",0x50F8],
- ["8372",0x50F9],
- ["8373",0x50FA],
- ["C6A7",0x50FB],
- ["8374",0x50FC],
- ["8375",0x50FD],
- ["8376",0x50FE],
- ["8377",0x50FF],
- ["8378",0x5100],
- ["8379",0x5101],
- ["837A",0x5102],
- ["837B",0x5103],
- ["837C",0x5104],
- ["837D",0x5105],
- ["D9D3",0x5106],
- ["D9D8",0x5107],
- ["837E",0x5108],
- ["8380",0x5109],
- ["8381",0x510A],
- ["D9D9",0x510B],
- ["8382",0x510C],
- ["8383",0x510D],
- ["8384",0x510E],
- ["8385",0x510F],
- ["8386",0x5110],
- ["8387",0x5111],
- ["C8E5",0x5112],
- ["8388",0x5113],
- ["8389",0x5114],
- ["838A",0x5115],
- ["838B",0x5116],
- ["838C",0x5117],
- ["838D",0x5118],
- ["838E",0x5119],
- ["838F",0x511A],
- ["8390",0x511B],
- ["8391",0x511C],
- ["8392",0x511D],
- ["8393",0x511E],
- ["8394",0x511F],
- ["8395",0x5120],
- ["C0DC",0x5121],
- ["8396",0x5122],
- ["8397",0x5123],
- ["8398",0x5124],
- ["8399",0x5125],
- ["839A",0x5126],
- ["839B",0x5127],
- ["839C",0x5128],
- ["839D",0x5129],
- ["839E",0x512A],
- ["839F",0x512B],
- ["83A0",0x512C],
- ["83A1",0x512D],
- ["83A2",0x512E],
- ["83A3",0x512F],
- ["83A4",0x5130],
- ["83A5",0x5131],
- ["83A6",0x5132],
- ["83A7",0x5133],
- ["83A8",0x5134],
- ["83A9",0x5135],
- ["83AA",0x5136],
- ["83AB",0x5137],
- ["83AC",0x5138],
- ["83AD",0x5139],
- ["83AE",0x513A],
- ["83AF",0x513B],
- ["83B0",0x513C],
- ["83B1",0x513D],
- ["83B2",0x513E],
- ["B6F9",0x513F],
- ["D8A3",0x5140],
- ["D4CA",0x5141],
- ["83B3",0x5142],
- ["D4AA",0x5143],
- ["D0D6",0x5144],
- ["B3E4",0x5145],
- ["D5D7",0x5146],
- ["83B4",0x5147],
- ["CFC8",0x5148],
- ["B9E2",0x5149],
- ["83B5",0x514A],
- ["BFCB",0x514B],
- ["83B6",0x514C],
- ["C3E2",0x514D],
- ["83B7",0x514E],
- ["83B8",0x514F],
- ["83B9",0x5150],
- ["B6D2",0x5151],
- ["83BA",0x5152],
- ["83BB",0x5153],
- ["CDC3",0x5154],
- ["D9EE",0x5155],
- ["D9F0",0x5156],
- ["83BC",0x5157],
- ["83BD",0x5158],
- ["83BE",0x5159],
- ["B5B3",0x515A],
- ["83BF",0x515B],
- ["B6B5",0x515C],
- ["83C0",0x515D],
- ["83C1",0x515E],
- ["83C2",0x515F],
- ["83C3",0x5160],
- ["83C4",0x5161],
- ["BEA4",0x5162],
- ["83C5",0x5163],
- ["83C6",0x5164],
- ["C8EB",0x5165],
- ["83C7",0x5166],
- ["83C8",0x5167],
- ["C8AB",0x5168],
- ["83C9",0x5169],
- ["83CA",0x516A],
- ["B0CB",0x516B],
- ["B9AB",0x516C],
- ["C1F9",0x516D],
- ["D9E2",0x516E],
- ["83CB",0x516F],
- ["C0BC",0x5170],
- ["B9B2",0x5171],
- ["83CC",0x5172],
- ["B9D8",0x5173],
- ["D0CB",0x5174],
- ["B1F8",0x5175],
- ["C6E4",0x5176],
- ["BEDF",0x5177],
- ["B5E4",0x5178],
- ["D7C8",0x5179],
- ["83CD",0x517A],
- ["D1F8",0x517B],
- ["BCE6",0x517C],
- ["CADE",0x517D],
- ["83CE",0x517E],
- ["83CF",0x517F],
- ["BCBD",0x5180],
- ["D9E6",0x5181],
- ["D8E7",0x5182],
- ["83D0",0x5183],
- ["83D1",0x5184],
- ["C4DA",0x5185],
- ["83D2",0x5186],
- ["83D3",0x5187],
- ["B8D4",0x5188],
- ["C8BD",0x5189],
- ["83D4",0x518A],
- ["83D5",0x518B],
- ["B2E1",0x518C],
- ["D4D9",0x518D],
- ["83D6",0x518E],
- ["83D7",0x518F],
- ["83D8",0x5190],
- ["83D9",0x5191],
- ["C3B0",0x5192],
- ["83DA",0x5193],
- ["83DB",0x5194],
- ["C3E1",0x5195],
- ["DAA2",0x5196],
- ["C8DF",0x5197],
- ["83DC",0x5198],
- ["D0B4",0x5199],
- ["83DD",0x519A],
- ["BEFC",0x519B],
- ["C5A9",0x519C],
- ["83DE",0x519D],
- ["83DF",0x519E],
- ["83E0",0x519F],
- ["B9DA",0x51A0],
- ["83E1",0x51A1],
- ["DAA3",0x51A2],
- ["83E2",0x51A3],
- ["D4A9",0x51A4],
- ["DAA4",0x51A5],
- ["83E3",0x51A6],
- ["83E4",0x51A7],
- ["83E5",0x51A8],
- ["83E6",0x51A9],
- ["83E7",0x51AA],
- ["D9FB",0x51AB],
- ["B6AC",0x51AC],
- ["83E8",0x51AD],
- ["83E9",0x51AE],
- ["B7EB",0x51AF],
- ["B1F9",0x51B0],
- ["D9FC",0x51B1],
- ["B3E5",0x51B2],
- ["BEF6",0x51B3],
- ["83EA",0x51B4],
- ["BFF6",0x51B5],
- ["D2B1",0x51B6],
- ["C0E4",0x51B7],
- ["83EB",0x51B8],
- ["83EC",0x51B9],
- ["83ED",0x51BA],
- ["B6B3",0x51BB],
- ["D9FE",0x51BC],
- ["D9FD",0x51BD],
- ["83EE",0x51BE],
- ["83EF",0x51BF],
- ["BEBB",0x51C0],
- ["83F0",0x51C1],
- ["83F1",0x51C2],
- ["83F2",0x51C3],
- ["C6E0",0x51C4],
- ["83F3",0x51C5],
- ["D7BC",0x51C6],
- ["DAA1",0x51C7],
- ["83F4",0x51C8],
- ["C1B9",0x51C9],
- ["83F5",0x51CA],
- ["B5F2",0x51CB],
- ["C1E8",0x51CC],
- ["83F6",0x51CD],
- ["83F7",0x51CE],
- ["BCF5",0x51CF],
- ["83F8",0x51D0],
- ["B4D5",0x51D1],
- ["83F9",0x51D2],
- ["83FA",0x51D3],
- ["83FB",0x51D4],
- ["83FC",0x51D5],
- ["83FD",0x51D6],
- ["83FE",0x51D7],
- ["8440",0x51D8],
- ["8441",0x51D9],
- ["8442",0x51DA],
- ["C1DD",0x51DB],
- ["8443",0x51DC],
- ["C4FD",0x51DD],
- ["8444",0x51DE],
- ["8445",0x51DF],
- ["BCB8",0x51E0],
- ["B7B2",0x51E1],
- ["8446",0x51E2],
- ["8447",0x51E3],
- ["B7EF",0x51E4],
- ["8448",0x51E5],
- ["8449",0x51E6],
- ["844A",0x51E7],
- ["844B",0x51E8],
- ["844C",0x51E9],
- ["844D",0x51EA],
- ["D9EC",0x51EB],
- ["844E",0x51EC],
- ["C6BE",0x51ED],
- ["844F",0x51EE],
- ["BFAD",0x51EF],
- ["BBCB",0x51F0],
- ["8450",0x51F1],
- ["8451",0x51F2],
- ["B5CA",0x51F3],
- ["8452",0x51F4],
- ["DBC9",0x51F5],
- ["D0D7",0x51F6],
- ["8453",0x51F7],
- ["CDB9",0x51F8],
- ["B0BC",0x51F9],
- ["B3F6",0x51FA],
- ["BBF7",0x51FB],
- ["DBCA",0x51FC],
- ["BAAF",0x51FD],
- ["8454",0x51FE],
- ["D4E4",0x51FF],
- ["B5B6",0x5200],
- ["B5F3",0x5201],
- ["D8D6",0x5202],
- ["C8D0",0x5203],
- ["8455",0x5204],
- ["8456",0x5205],
- ["B7D6",0x5206],
- ["C7D0",0x5207],
- ["D8D7",0x5208],
- ["8457",0x5209],
- ["BFAF",0x520A],
- ["8458",0x520B],
- ["8459",0x520C],
- ["DBBB",0x520D],
- ["D8D8",0x520E],
- ["845A",0x520F],
- ["845B",0x5210],
- ["D0CC",0x5211],
- ["BBAE",0x5212],
- ["845C",0x5213],
- ["845D",0x5214],
- ["845E",0x5215],
- ["EBBE",0x5216],
- ["C1D0",0x5217],
- ["C1F5",0x5218],
- ["D4F2",0x5219],
- ["B8D5",0x521A],
- ["B4B4",0x521B],
- ["845F",0x521C],
- ["B3F5",0x521D],
- ["8460",0x521E],
- ["8461",0x521F],
- ["C9BE",0x5220],
- ["8462",0x5221],
- ["8463",0x5222],
- ["8464",0x5223],
- ["C5D0",0x5224],
- ["8465",0x5225],
- ["8466",0x5226],
- ["8467",0x5227],
- ["C5D9",0x5228],
- ["C0FB",0x5229],
- ["8468",0x522A],
- ["B1F0",0x522B],
- ["8469",0x522C],
- ["D8D9",0x522D],
- ["B9CE",0x522E],
- ["846A",0x522F],
- ["B5BD",0x5230],
- ["846B",0x5231],
- ["846C",0x5232],
- ["D8DA",0x5233],
- ["846D",0x5234],
- ["846E",0x5235],
- ["D6C6",0x5236],
- ["CBA2",0x5237],
- ["C8AF",0x5238],
- ["C9B2",0x5239],
- ["B4CC",0x523A],
- ["BFCC",0x523B],
- ["846F",0x523C],
- ["B9F4",0x523D],
- ["8470",0x523E],
- ["D8DB",0x523F],
- ["D8DC",0x5240],
- ["B6E7",0x5241],
- ["BCC1",0x5242],
- ["CCEA",0x5243],
- ["8471",0x5244],
- ["8472",0x5245],
- ["8473",0x5246],
- ["8474",0x5247],
- ["8475",0x5248],
- ["8476",0x5249],
- ["CFF7",0x524A],
- ["8477",0x524B],
- ["D8DD",0x524C],
- ["C7B0",0x524D],
- ["8478",0x524E],
- ["8479",0x524F],
- ["B9D0",0x5250],
- ["BDA3",0x5251],
- ["847A",0x5252],
- ["847B",0x5253],
- ["CCDE",0x5254],
- ["847C",0x5255],
- ["C6CA",0x5256],
- ["847D",0x5257],
- ["847E",0x5258],
- ["8480",0x5259],
- ["8481",0x525A],
- ["8482",0x525B],
- ["D8E0",0x525C],
- ["8483",0x525D],
- ["D8DE",0x525E],
- ["8484",0x525F],
- ["8485",0x5260],
- ["D8DF",0x5261],
- ["8486",0x5262],
- ["8487",0x5263],
- ["8488",0x5264],
- ["B0FE",0x5265],
- ["8489",0x5266],
- ["BEE7",0x5267],
- ["848A",0x5268],
- ["CAA3",0x5269],
- ["BCF4",0x526A],
- ["848B",0x526B],
- ["848C",0x526C],
- ["848D",0x526D],
- ["848E",0x526E],
- ["B8B1",0x526F],
- ["848F",0x5270],
- ["8490",0x5271],
- ["B8EE",0x5272],
- ["8491",0x5273],
- ["8492",0x5274],
- ["8493",0x5275],
- ["8494",0x5276],
- ["8495",0x5277],
- ["8496",0x5278],
- ["8497",0x5279],
- ["8498",0x527A],
- ["8499",0x527B],
- ["849A",0x527C],
- ["D8E2",0x527D],
- ["849B",0x527E],
- ["BDCB",0x527F],
- ["849C",0x5280],
- ["D8E4",0x5281],
- ["D8E3",0x5282],
- ["849D",0x5283],
- ["849E",0x5284],
- ["849F",0x5285],
- ["84A0",0x5286],
- ["84A1",0x5287],
- ["C5FC",0x5288],
- ["84A2",0x5289],
- ["84A3",0x528A],
- ["84A4",0x528B],
- ["84A5",0x528C],
- ["84A6",0x528D],
- ["84A7",0x528E],
- ["84A8",0x528F],
- ["D8E5",0x5290],
- ["84A9",0x5291],
- ["84AA",0x5292],
- ["D8E6",0x5293],
- ["84AB",0x5294],
- ["84AC",0x5295],
- ["84AD",0x5296],
- ["84AE",0x5297],
- ["84AF",0x5298],
- ["84B0",0x5299],
- ["84B1",0x529A],
- ["C1A6",0x529B],
- ["84B2",0x529C],
- ["C8B0",0x529D],
- ["B0EC",0x529E],
- ["B9A6",0x529F],
- ["BCD3",0x52A0],
- ["CEF1",0x52A1],
- ["DBBD",0x52A2],
- ["C1D3",0x52A3],
- ["84B3",0x52A4],
- ["84B4",0x52A5],
- ["84B5",0x52A6],
- ["84B6",0x52A7],
- ["B6AF",0x52A8],
- ["D6FA",0x52A9],
- ["C5AC",0x52AA],
- ["BDD9",0x52AB],
- ["DBBE",0x52AC],
- ["DBBF",0x52AD],
- ["84B7",0x52AE],
- ["84B8",0x52AF],
- ["84B9",0x52B0],
- ["C0F8",0x52B1],
- ["BEA2",0x52B2],
- ["C0CD",0x52B3],
- ["84BA",0x52B4],
- ["84BB",0x52B5],
- ["84BC",0x52B6],
- ["84BD",0x52B7],
- ["84BE",0x52B8],
- ["84BF",0x52B9],
- ["84C0",0x52BA],
- ["84C1",0x52BB],
- ["84C2",0x52BC],
- ["84C3",0x52BD],
- ["DBC0",0x52BE],
- ["CAC6",0x52BF],
- ["84C4",0x52C0],
- ["84C5",0x52C1],
- ["84C6",0x52C2],
- ["B2AA",0x52C3],
- ["84C7",0x52C4],
- ["84C8",0x52C5],
- ["84C9",0x52C6],
- ["D3C2",0x52C7],
- ["84CA",0x52C8],
- ["C3E3",0x52C9],
- ["84CB",0x52CA],
- ["D1AB",0x52CB],
- ["84CC",0x52CC],
- ["84CD",0x52CD],
- ["84CE",0x52CE],
- ["84CF",0x52CF],
- ["DBC2",0x52D0],
- ["84D0",0x52D1],
- ["C0D5",0x52D2],
- ["84D1",0x52D3],
- ["84D2",0x52D4],
- ["84D3",0x52D5],
- ["DBC3",0x52D6],
- ["84D4",0x52D7],
- ["BFB1",0x52D8],
- ["84D5",0x52D9],
- ["84D6",0x52DA],
- ["84D7",0x52DB],
- ["84D8",0x52DC],
- ["84D9",0x52DD],
- ["84DA",0x52DE],
- ["C4BC",0x52DF],
- ["84DB",0x52E0],
- ["84DC",0x52E1],
- ["84DD",0x52E2],
- ["84DE",0x52E3],
- ["C7DA",0x52E4],
- ["84DF",0x52E5],
- ["84E0",0x52E6],
- ["84E1",0x52E7],
- ["84E2",0x52E8],
- ["84E3",0x52E9],
- ["84E4",0x52EA],
- ["84E5",0x52EB],
- ["84E6",0x52EC],
- ["84E7",0x52ED],
- ["84E8",0x52EE],
- ["84E9",0x52EF],
- ["DBC4",0x52F0],
- ["84EA",0x52F1],
- ["84EB",0x52F2],
- ["84EC",0x52F3],
- ["84ED",0x52F4],
- ["84EE",0x52F5],
- ["84EF",0x52F6],
- ["84F0",0x52F7],
- ["84F1",0x52F8],
- ["D9E8",0x52F9],
- ["C9D7",0x52FA],
- ["84F2",0x52FB],
- ["84F3",0x52FC],
- ["84F4",0x52FD],
- ["B9B4",0x52FE],
- ["CEF0",0x52FF],
- ["D4C8",0x5300],
- ["84F5",0x5301],
- ["84F6",0x5302],
- ["84F7",0x5303],
- ["84F8",0x5304],
- ["B0FC",0x5305],
- ["B4D2",0x5306],
- ["84F9",0x5307],
- ["D0D9",0x5308],
- ["84FA",0x5309],
- ["84FB",0x530A],
- ["84FC",0x530B],
- ["84FD",0x530C],
- ["D9E9",0x530D],
- ["84FE",0x530E],
- ["DECB",0x530F],
- ["D9EB",0x5310],
- ["8540",0x5311],
- ["8541",0x5312],
- ["8542",0x5313],
- ["8543",0x5314],
- ["D8B0",0x5315],
- ["BBAF",0x5316],
- ["B1B1",0x5317],
- ["8544",0x5318],
- ["B3D7",0x5319],
- ["D8CE",0x531A],
- ["8545",0x531B],
- ["8546",0x531C],
- ["D4D1",0x531D],
- ["8547",0x531E],
- ["8548",0x531F],
- ["BDB3",0x5320],
- ["BFEF",0x5321],
- ["8549",0x5322],
- ["CFBB",0x5323],
- ["854A",0x5324],
- ["854B",0x5325],
- ["D8D0",0x5326],
- ["854C",0x5327],
- ["854D",0x5328],
- ["854E",0x5329],
- ["B7CB",0x532A],
- ["854F",0x532B],
- ["8550",0x532C],
- ["8551",0x532D],
- ["D8D1",0x532E],
- ["8552",0x532F],
- ["8553",0x5330],
- ["8554",0x5331],
- ["8555",0x5332],
- ["8556",0x5333],
- ["8557",0x5334],
- ["8558",0x5335],
- ["8559",0x5336],
- ["855A",0x5337],
- ["855B",0x5338],
- ["C6A5",0x5339],
- ["C7F8",0x533A],
- ["D2BD",0x533B],
- ["855C",0x533C],
- ["855D",0x533D],
- ["D8D2",0x533E],
- ["C4E4",0x533F],
- ["855E",0x5340],
- ["CAAE",0x5341],
- ["855F",0x5342],
- ["C7A7",0x5343],
- ["8560",0x5344],
- ["D8A6",0x5345],
- ["8561",0x5346],
- ["C9FD",0x5347],
- ["CEE7",0x5348],
- ["BBDC",0x5349],
- ["B0EB",0x534A],
- ["8562",0x534B],
- ["8563",0x534C],
- ["8564",0x534D],
- ["BBAA",0x534E],
- ["D0AD",0x534F],
- ["8565",0x5350],
- ["B1B0",0x5351],
- ["D7E4",0x5352],
- ["D7BF",0x5353],
- ["8566",0x5354],
- ["B5A5",0x5355],
- ["C2F4",0x5356],
- ["C4CF",0x5357],
- ["8567",0x5358],
- ["8568",0x5359],
- ["B2A9",0x535A],
- ["8569",0x535B],
- ["B2B7",0x535C],
- ["856A",0x535D],
- ["B1E5",0x535E],
- ["DFB2",0x535F],
- ["D5BC",0x5360],
- ["BFA8",0x5361],
- ["C2AC",0x5362],
- ["D8D5",0x5363],
- ["C2B1",0x5364],
- ["856B",0x5365],
- ["D8D4",0x5366],
- ["CED4",0x5367],
- ["856C",0x5368],
- ["DAE0",0x5369],
- ["856D",0x536A],
- ["CEC0",0x536B],
- ["856E",0x536C],
- ["856F",0x536D],
- ["D8B4",0x536E],
- ["C3AE",0x536F],
- ["D3A1",0x5370],
- ["CEA3",0x5371],
- ["8570",0x5372],
- ["BCB4",0x5373],
- ["C8B4",0x5374],
- ["C2D1",0x5375],
- ["8571",0x5376],
- ["BEED",0x5377],
- ["D0B6",0x5378],
- ["8572",0x5379],
- ["DAE1",0x537A],
- ["8573",0x537B],
- ["8574",0x537C],
- ["8575",0x537D],
- ["8576",0x537E],
- ["C7E4",0x537F],
- ["8577",0x5380],
- ["8578",0x5381],
- ["B3A7",0x5382],
- ["8579",0x5383],
- ["B6F2",0x5384],
- ["CCFC",0x5385],
- ["C0FA",0x5386],
- ["857A",0x5387],
- ["857B",0x5388],
- ["C0F7",0x5389],
- ["857C",0x538A],
- ["D1B9",0x538B],
- ["D1E1",0x538C],
- ["D8C7",0x538D],
- ["857D",0x538E],
- ["857E",0x538F],
- ["8580",0x5390],
- ["8581",0x5391],
- ["8582",0x5392],
- ["8583",0x5393],
- ["8584",0x5394],
- ["B2DE",0x5395],
- ["8585",0x5396],
- ["8586",0x5397],
- ["C0E5",0x5398],
- ["8587",0x5399],
- ["BAF1",0x539A],
- ["8588",0x539B],
- ["8589",0x539C],
- ["D8C8",0x539D],
- ["858A",0x539E],
- ["D4AD",0x539F],
- ["858B",0x53A0],
- ["858C",0x53A1],
- ["CFE1",0x53A2],
- ["D8C9",0x53A3],
- ["858D",0x53A4],
- ["D8CA",0x53A5],
- ["CFC3",0x53A6],
- ["858E",0x53A7],
- ["B3F8",0x53A8],
- ["BEC7",0x53A9],
- ["858F",0x53AA],
- ["8590",0x53AB],
- ["8591",0x53AC],
- ["8592",0x53AD],
- ["D8CB",0x53AE],
- ["8593",0x53AF],
- ["8594",0x53B0],
- ["8595",0x53B1],
- ["8596",0x53B2],
- ["8597",0x53B3],
- ["8598",0x53B4],
- ["8599",0x53B5],
- ["DBCC",0x53B6],
- ["859A",0x53B7],
- ["859B",0x53B8],
- ["859C",0x53B9],
- ["859D",0x53BA],
- ["C8A5",0x53BB],
- ["859E",0x53BC],
- ["859F",0x53BD],
- ["85A0",0x53BE],
- ["CFD8",0x53BF],
- ["85A1",0x53C0],
- ["C8FE",0x53C1],
- ["B2CE",0x53C2],
- ["85A2",0x53C3],
- ["85A3",0x53C4],
- ["85A4",0x53C5],
- ["85A5",0x53C6],
- ["85A6",0x53C7],
- ["D3D6",0x53C8],
- ["B2E6",0x53C9],
- ["BCB0",0x53CA],
- ["D3D1",0x53CB],
- ["CBAB",0x53CC],
- ["B7B4",0x53CD],
- ["85A7",0x53CE],
- ["85A8",0x53CF],
- ["85A9",0x53D0],
- ["B7A2",0x53D1],
- ["85AA",0x53D2],
- ["85AB",0x53D3],
- ["CAE5",0x53D4],
- ["85AC",0x53D5],
- ["C8A1",0x53D6],
- ["CADC",0x53D7],
- ["B1E4",0x53D8],
- ["D0F0",0x53D9],
- ["85AD",0x53DA],
- ["C5D1",0x53DB],
- ["85AE",0x53DC],
- ["85AF",0x53DD],
- ["85B0",0x53DE],
- ["DBC5",0x53DF],
- ["B5FE",0x53E0],
- ["85B1",0x53E1],
- ["85B2",0x53E2],
- ["BFDA",0x53E3],
- ["B9C5",0x53E4],
- ["BEE4",0x53E5],
- ["C1ED",0x53E6],
- ["85B3",0x53E7],
- ["DFB6",0x53E8],
- ["DFB5",0x53E9],
- ["D6BB",0x53EA],
- ["BDD0",0x53EB],
- ["D5D9",0x53EC],
- ["B0C8",0x53ED],
- ["B6A3",0x53EE],
- ["BFC9",0x53EF],
- ["CCA8",0x53F0],
- ["DFB3",0x53F1],
- ["CAB7",0x53F2],
- ["D3D2",0x53F3],
- ["85B4",0x53F4],
- ["D8CF",0x53F5],
- ["D2B6",0x53F6],
- ["BAC5",0x53F7],
- ["CBBE",0x53F8],
- ["CCBE",0x53F9],
- ["85B5",0x53FA],
- ["DFB7",0x53FB],
- ["B5F0",0x53FC],
- ["DFB4",0x53FD],
- ["85B6",0x53FE],
- ["85B7",0x53FF],
- ["85B8",0x5400],
- ["D3F5",0x5401],
- ["85B9",0x5402],
- ["B3D4",0x5403],
- ["B8F7",0x5404],
- ["85BA",0x5405],
- ["DFBA",0x5406],
- ["85BB",0x5407],
- ["BACF",0x5408],
- ["BCAA",0x5409],
- ["B5F5",0x540A],
- ["85BC",0x540B],
- ["CDAC",0x540C],
- ["C3FB",0x540D],
- ["BAF3",0x540E],
- ["C0F4",0x540F],
- ["CDC2",0x5410],
- ["CFF2",0x5411],
- ["DFB8",0x5412],
- ["CFC5",0x5413],
- ["85BD",0x5414],
- ["C2C0",0x5415],
- ["DFB9",0x5416],
- ["C2F0",0x5417],
- ["85BE",0x5418],
- ["85BF",0x5419],
- ["85C0",0x541A],
- ["BEFD",0x541B],
- ["85C1",0x541C],
- ["C1DF",0x541D],
- ["CDCC",0x541E],
- ["D2F7",0x541F],
- ["B7CD",0x5420],
- ["DFC1",0x5421],
- ["85C2",0x5422],
- ["DFC4",0x5423],
- ["85C3",0x5424],
- ["85C4",0x5425],
- ["B7F1",0x5426],
- ["B0C9",0x5427],
- ["B6D6",0x5428],
- ["B7D4",0x5429],
- ["85C5",0x542A],
- ["BAAC",0x542B],
- ["CCFD",0x542C],
- ["BFD4",0x542D],
- ["CBB1",0x542E],
- ["C6F4",0x542F],
- ["85C6",0x5430],
- ["D6A8",0x5431],
- ["DFC5",0x5432],
- ["85C7",0x5433],
- ["CEE2",0x5434],
- ["B3B3",0x5435],
- ["85C8",0x5436],
- ["85C9",0x5437],
- ["CEFC",0x5438],
- ["B4B5",0x5439],
- ["85CA",0x543A],
- ["CEC7",0x543B],
- ["BAF0",0x543C],
- ["85CB",0x543D],
- ["CEE1",0x543E],
- ["85CC",0x543F],
- ["D1BD",0x5440],
- ["85CD",0x5441],
- ["85CE",0x5442],
- ["DFC0",0x5443],
- ["85CF",0x5444],
- ["85D0",0x5445],
- ["B4F4",0x5446],
- ["85D1",0x5447],
- ["B3CA",0x5448],
- ["85D2",0x5449],
- ["B8E6",0x544A],
- ["DFBB",0x544B],
- ["85D3",0x544C],
- ["85D4",0x544D],
- ["85D5",0x544E],
- ["85D6",0x544F],
- ["C4C5",0x5450],
- ["85D7",0x5451],
- ["DFBC",0x5452],
- ["DFBD",0x5453],
- ["DFBE",0x5454],
- ["C5BB",0x5455],
- ["DFBF",0x5456],
- ["DFC2",0x5457],
- ["D4B1",0x5458],
- ["DFC3",0x5459],
- ["85D8",0x545A],
- ["C7BA",0x545B],
- ["CED8",0x545C],
- ["85D9",0x545D],
- ["85DA",0x545E],
- ["85DB",0x545F],
- ["85DC",0x5460],
- ["85DD",0x5461],
- ["C4D8",0x5462],
- ["85DE",0x5463],
- ["DFCA",0x5464],
- ["85DF",0x5465],
- ["DFCF",0x5466],
- ["85E0",0x5467],
- ["D6DC",0x5468],
- ["85E1",0x5469],
- ["85E2",0x546A],
- ["85E3",0x546B],
- ["85E4",0x546C],
- ["85E5",0x546D],
- ["85E6",0x546E],
- ["85E7",0x546F],
- ["85E8",0x5470],
- ["DFC9",0x5471],
- ["DFDA",0x5472],
- ["CEB6",0x5473],
- ["85E9",0x5474],
- ["BAC7",0x5475],
- ["DFCE",0x5476],
- ["DFC8",0x5477],
- ["C5DE",0x5478],
- ["85EA",0x5479],
- ["85EB",0x547A],
- ["C9EB",0x547B],
- ["BAF4",0x547C],
- ["C3FC",0x547D],
- ["85EC",0x547E],
- ["85ED",0x547F],
- ["BED7",0x5480],
- ["85EE",0x5481],
- ["DFC6",0x5482],
- ["85EF",0x5483],
- ["DFCD",0x5484],
- ["85F0",0x5485],
- ["C5D8",0x5486],
- ["85F1",0x5487],
- ["85F2",0x5488],
- ["85F3",0x5489],
- ["85F4",0x548A],
- ["D5A6",0x548B],
- ["BACD",0x548C],
- ["85F5",0x548D],
- ["BECC",0x548E],
- ["D3BD",0x548F],
- ["B8C0",0x5490],
- ["85F6",0x5491],
- ["D6E4",0x5492],
- ["85F7",0x5493],
- ["DFC7",0x5494],
- ["B9BE",0x5495],
- ["BFA7",0x5496],
- ["85F8",0x5497],
- ["85F9",0x5498],
- ["C1FC",0x5499],
- ["DFCB",0x549A],
- ["DFCC",0x549B],
- ["85FA",0x549C],
- ["DFD0",0x549D],
- ["85FB",0x549E],
- ["85FC",0x549F],
- ["85FD",0x54A0],
- ["85FE",0x54A1],
- ["8640",0x54A2],
- ["DFDB",0x54A3],
- ["DFE5",0x54A4],
- ["8641",0x54A5],
- ["DFD7",0x54A6],
- ["DFD6",0x54A7],
- ["D7C9",0x54A8],
- ["DFE3",0x54A9],
- ["DFE4",0x54AA],
- ["E5EB",0x54AB],
- ["D2A7",0x54AC],
- ["DFD2",0x54AD],
- ["8642",0x54AE],
- ["BFA9",0x54AF],
- ["8643",0x54B0],
- ["D4DB",0x54B1],
- ["8644",0x54B2],
- ["BFC8",0x54B3],
- ["DFD4",0x54B4],
- ["8645",0x54B5],
- ["8646",0x54B6],
- ["8647",0x54B7],
- ["CFCC",0x54B8],
- ["8648",0x54B9],
- ["8649",0x54BA],
- ["DFDD",0x54BB],
- ["864A",0x54BC],
- ["D1CA",0x54BD],
- ["864B",0x54BE],
- ["DFDE",0x54BF],
- ["B0A7",0x54C0],
- ["C6B7",0x54C1],
- ["DFD3",0x54C2],
- ["864C",0x54C3],
- ["BAE5",0x54C4],
- ["864D",0x54C5],
- ["B6DF",0x54C6],
- ["CDDB",0x54C7],
- ["B9FE",0x54C8],
- ["D4D5",0x54C9],
- ["864E",0x54CA],
- ["864F",0x54CB],
- ["DFDF",0x54CC],
- ["CFEC",0x54CD],
- ["B0A5",0x54CE],
- ["DFE7",0x54CF],
- ["DFD1",0x54D0],
- ["D1C6",0x54D1],
- ["DFD5",0x54D2],
- ["DFD8",0x54D3],
- ["DFD9",0x54D4],
- ["DFDC",0x54D5],
- ["8650",0x54D6],
- ["BBA9",0x54D7],
- ["8651",0x54D8],
- ["DFE0",0x54D9],
- ["DFE1",0x54DA],
- ["8652",0x54DB],
- ["DFE2",0x54DC],
- ["DFE6",0x54DD],
- ["DFE8",0x54DE],
- ["D3B4",0x54DF],
- ["8653",0x54E0],
- ["8654",0x54E1],
- ["8655",0x54E2],
- ["8656",0x54E3],
- ["8657",0x54E4],
- ["B8E7",0x54E5],
- ["C5B6",0x54E6],
- ["DFEA",0x54E7],
- ["C9DA",0x54E8],
- ["C1A8",0x54E9],
- ["C4C4",0x54EA],
- ["8658",0x54EB],
- ["8659",0x54EC],
- ["BFDE",0x54ED],
- ["CFF8",0x54EE],
- ["865A",0x54EF],
- ["865B",0x54F0],
- ["865C",0x54F1],
- ["D5DC",0x54F2],
- ["DFEE",0x54F3],
- ["865D",0x54F4],
- ["865E",0x54F5],
- ["865F",0x54F6],
- ["8660",0x54F7],
- ["8661",0x54F8],
- ["8662",0x54F9],
- ["B2B8",0x54FA],
- ["8663",0x54FB],
- ["BADF",0x54FC],
- ["DFEC",0x54FD],
- ["8664",0x54FE],
- ["DBC1",0x54FF],
- ["8665",0x5500],
- ["D1E4",0x5501],
- ["8666",0x5502],
- ["8667",0x5503],
- ["8668",0x5504],
- ["8669",0x5505],
- ["CBF4",0x5506],
- ["B4BD",0x5507],
- ["866A",0x5508],
- ["B0A6",0x5509],
- ["866B",0x550A],
- ["866C",0x550B],
- ["866D",0x550C],
- ["866E",0x550D],
- ["866F",0x550E],
- ["DFF1",0x550F],
- ["CCC6",0x5510],
- ["DFF2",0x5511],
- ["8670",0x5512],
- ["8671",0x5513],
- ["DFED",0x5514],
- ["8672",0x5515],
- ["8673",0x5516],
- ["8674",0x5517],
- ["8675",0x5518],
- ["8676",0x5519],
- ["8677",0x551A],
- ["DFE9",0x551B],
- ["8678",0x551C],
- ["8679",0x551D],
- ["867A",0x551E],
- ["867B",0x551F],
- ["DFEB",0x5520],
- ["867C",0x5521],
- ["DFEF",0x5522],
- ["DFF0",0x5523],
- ["BBBD",0x5524],
- ["867D",0x5525],
- ["867E",0x5526],
- ["DFF3",0x5527],
- ["8680",0x5528],
- ["8681",0x5529],
- ["DFF4",0x552A],
- ["8682",0x552B],
- ["BBA3",0x552C],
- ["8683",0x552D],
- ["CADB",0x552E],
- ["CEA8",0x552F],
- ["E0A7",0x5530],
- ["B3AA",0x5531],
- ["8684",0x5532],
- ["E0A6",0x5533],
- ["8685",0x5534],
- ["8686",0x5535],
- ["8687",0x5536],
- ["E0A1",0x5537],
- ["8688",0x5538],
- ["8689",0x5539],
- ["868A",0x553A],
- ["868B",0x553B],
- ["DFFE",0x553C],
- ["868C",0x553D],
- ["CDD9",0x553E],
- ["DFFC",0x553F],
- ["868D",0x5540],
- ["DFFA",0x5541],
- ["868E",0x5542],
- ["BFD0",0x5543],
- ["D7C4",0x5544],
- ["868F",0x5545],
- ["C9CC",0x5546],
- ["8690",0x5547],
- ["8691",0x5548],
- ["DFF8",0x5549],
- ["B0A1",0x554A],
- ["8692",0x554B],
- ["8693",0x554C],
- ["8694",0x554D],
- ["8695",0x554E],
- ["8696",0x554F],
- ["DFFD",0x5550],
- ["8697",0x5551],
- ["8698",0x5552],
- ["8699",0x5553],
- ["869A",0x5554],
- ["DFFB",0x5555],
- ["E0A2",0x5556],
- ["869B",0x5557],
- ["869C",0x5558],
- ["869D",0x5559],
- ["869E",0x555A],
- ["869F",0x555B],
- ["E0A8",0x555C],
- ["86A0",0x555D],
- ["86A1",0x555E],
- ["86A2",0x555F],
- ["86A3",0x5560],
- ["B7C8",0x5561],
- ["86A4",0x5562],
- ["86A5",0x5563],
- ["C6A1",0x5564],
- ["C9B6",0x5565],
- ["C0B2",0x5566],
- ["DFF5",0x5567],
- ["86A6",0x5568],
- ["86A7",0x5569],
- ["C5BE",0x556A],
- ["86A8",0x556B],
- ["D8C4",0x556C],
- ["DFF9",0x556D],
- ["C4F6",0x556E],
- ["86A9",0x556F],
- ["86AA",0x5570],
- ["86AB",0x5571],
- ["86AC",0x5572],
- ["86AD",0x5573],
- ["86AE",0x5574],
- ["E0A3",0x5575],
- ["E0A4",0x5576],
- ["E0A5",0x5577],
- ["D0A5",0x5578],
- ["86AF",0x5579],
- ["86B0",0x557A],
- ["E0B4",0x557B],
- ["CCE4",0x557C],
- ["86B1",0x557D],
- ["E0B1",0x557E],
- ["86B2",0x557F],
- ["BFA6",0x5580],
- ["E0AF",0x5581],
- ["CEB9",0x5582],
- ["E0AB",0x5583],
- ["C9C6",0x5584],
- ["86B3",0x5585],
- ["86B4",0x5586],
- ["C0AE",0x5587],
- ["E0AE",0x5588],
- ["BAED",0x5589],
- ["BAB0",0x558A],
- ["E0A9",0x558B],
- ["86B5",0x558C],
- ["86B6",0x558D],
- ["86B7",0x558E],
- ["DFF6",0x558F],
- ["86B8",0x5590],
- ["E0B3",0x5591],
- ["86B9",0x5592],
- ["86BA",0x5593],
- ["E0B8",0x5594],
- ["86BB",0x5595],
- ["86BC",0x5596],
- ["86BD",0x5597],
- ["B4AD",0x5598],
- ["E0B9",0x5599],
- ["86BE",0x559A],
- ["86BF",0x559B],
- ["CFB2",0x559C],
- ["BAC8",0x559D],
- ["86C0",0x559E],
- ["E0B0",0x559F],
- ["86C1",0x55A0],
- ["86C2",0x55A1],
- ["86C3",0x55A2],
- ["86C4",0x55A3],
- ["86C5",0x55A4],
- ["86C6",0x55A5],
- ["86C7",0x55A6],
- ["D0FA",0x55A7],
- ["86C8",0x55A8],
- ["86C9",0x55A9],
- ["86CA",0x55AA],
- ["86CB",0x55AB],
- ["86CC",0x55AC],
- ["86CD",0x55AD],
- ["86CE",0x55AE],
- ["86CF",0x55AF],
- ["86D0",0x55B0],
- ["E0AC",0x55B1],
- ["86D1",0x55B2],
- ["D4FB",0x55B3],
- ["86D2",0x55B4],
- ["DFF7",0x55B5],
- ["86D3",0x55B6],
- ["C5E7",0x55B7],
- ["86D4",0x55B8],
- ["E0AD",0x55B9],
- ["86D5",0x55BA],
- ["D3F7",0x55BB],
- ["86D6",0x55BC],
- ["E0B6",0x55BD],
- ["E0B7",0x55BE],
- ["86D7",0x55BF],
- ["86D8",0x55C0],
- ["86D9",0x55C1],
- ["86DA",0x55C2],
- ["86DB",0x55C3],
- ["E0C4",0x55C4],
- ["D0E1",0x55C5],
- ["86DC",0x55C6],
- ["86DD",0x55C7],
- ["86DE",0x55C8],
- ["E0BC",0x55C9],
- ["86DF",0x55CA],
- ["86E0",0x55CB],
- ["E0C9",0x55CC],
- ["E0CA",0x55CD],
- ["86E1",0x55CE],
- ["86E2",0x55CF],
- ["86E3",0x55D0],
- ["E0BE",0x55D1],
- ["E0AA",0x55D2],
- ["C9A4",0x55D3],
- ["E0C1",0x55D4],
- ["86E4",0x55D5],
- ["E0B2",0x55D6],
- ["86E5",0x55D7],
- ["86E6",0x55D8],
- ["86E7",0x55D9],
- ["86E8",0x55DA],
- ["86E9",0x55DB],
- ["CAC8",0x55DC],
- ["E0C3",0x55DD],
- ["86EA",0x55DE],
- ["E0B5",0x55DF],
- ["86EB",0x55E0],
- ["CECB",0x55E1],
- ["86EC",0x55E2],
- ["CBC3",0x55E3],
- ["E0CD",0x55E4],
- ["E0C6",0x55E5],
- ["E0C2",0x55E6],
- ["86ED",0x55E7],
- ["E0CB",0x55E8],
- ["86EE",0x55E9],
- ["E0BA",0x55EA],
- ["E0BF",0x55EB],
- ["E0C0",0x55EC],
- ["86EF",0x55ED],
- ["86F0",0x55EE],
- ["E0C5",0x55EF],
- ["86F1",0x55F0],
- ["86F2",0x55F1],
- ["E0C7",0x55F2],
- ["E0C8",0x55F3],
- ["86F3",0x55F4],
- ["E0CC",0x55F5],
- ["86F4",0x55F6],
- ["E0BB",0x55F7],
- ["86F5",0x55F8],
- ["86F6",0x55F9],
- ["86F7",0x55FA],
- ["86F8",0x55FB],
- ["86F9",0x55FC],
- ["CBD4",0x55FD],
- ["E0D5",0x55FE],
- ["86FA",0x55FF],
- ["E0D6",0x5600],
- ["E0D2",0x5601],
- ["86FB",0x5602],
- ["86FC",0x5603],
- ["86FD",0x5604],
- ["86FE",0x5605],
- ["8740",0x5606],
- ["8741",0x5607],
- ["E0D0",0x5608],
- ["BCCE",0x5609],
- ["8742",0x560A],
- ["8743",0x560B],
- ["E0D1",0x560C],
- ["8744",0x560D],
- ["B8C2",0x560E],
- ["D8C5",0x560F],
- ["8745",0x5610],
- ["8746",0x5611],
- ["8747",0x5612],
- ["8748",0x5613],
- ["8749",0x5614],
- ["874A",0x5615],
- ["874B",0x5616],
- ["874C",0x5617],
- ["D0EA",0x5618],
- ["874D",0x5619],
- ["874E",0x561A],
- ["C2EF",0x561B],
- ["874F",0x561C],
- ["8750",0x561D],
- ["E0CF",0x561E],
- ["E0BD",0x561F],
- ["8751",0x5620],
- ["8752",0x5621],
- ["8753",0x5622],
- ["E0D4",0x5623],
- ["E0D3",0x5624],
- ["8754",0x5625],
- ["8755",0x5626],
- ["E0D7",0x5627],
- ["8756",0x5628],
- ["8757",0x5629],
- ["8758",0x562A],
- ["8759",0x562B],
- ["E0DC",0x562C],
- ["E0D8",0x562D],
- ["875A",0x562E],
- ["875B",0x562F],
- ["875C",0x5630],
- ["D6F6",0x5631],
- ["B3B0",0x5632],
- ["875D",0x5633],
- ["D7EC",0x5634],
- ["875E",0x5635],
- ["CBBB",0x5636],
- ["875F",0x5637],
- ["8760",0x5638],
- ["E0DA",0x5639],
- ["8761",0x563A],
- ["CEFB",0x563B],
- ["8762",0x563C],
- ["8763",0x563D],
- ["8764",0x563E],
- ["BAD9",0x563F],
- ["8765",0x5640],
- ["8766",0x5641],
- ["8767",0x5642],
- ["8768",0x5643],
- ["8769",0x5644],
- ["876A",0x5645],
- ["876B",0x5646],
- ["876C",0x5647],
- ["876D",0x5648],
- ["876E",0x5649],
- ["876F",0x564A],
- ["8770",0x564B],
- ["E0E1",0x564C],
- ["E0DD",0x564D],
- ["D2AD",0x564E],
- ["8771",0x564F],
- ["8772",0x5650],
- ["8773",0x5651],
- ["8774",0x5652],
- ["8775",0x5653],
- ["E0E2",0x5654],
- ["8776",0x5655],
- ["8777",0x5656],
- ["E0DB",0x5657],
- ["E0D9",0x5658],
- ["E0DF",0x5659],
- ["8778",0x565A],
- ["8779",0x565B],
- ["E0E0",0x565C],
- ["877A",0x565D],
- ["877B",0x565E],
- ["877C",0x565F],
- ["877D",0x5660],
- ["877E",0x5661],
- ["E0DE",0x5662],
- ["8780",0x5663],
- ["E0E4",0x5664],
- ["8781",0x5665],
- ["8782",0x5666],
- ["8783",0x5667],
- ["C6F7",0x5668],
- ["D8AC",0x5669],
- ["D4EB",0x566A],
- ["E0E6",0x566B],
- ["CAC9",0x566C],
- ["8784",0x566D],
- ["8785",0x566E],
- ["8786",0x566F],
- ["8787",0x5670],
- ["E0E5",0x5671],
- ["8788",0x5672],
- ["8789",0x5673],
- ["878A",0x5674],
- ["878B",0x5675],
- ["B8C1",0x5676],
- ["878C",0x5677],
- ["878D",0x5678],
- ["878E",0x5679],
- ["878F",0x567A],
- ["E0E7",0x567B],
- ["E0E8",0x567C],
- ["8790",0x567D],
- ["8791",0x567E],
- ["8792",0x567F],
- ["8793",0x5680],
- ["8794",0x5681],
- ["8795",0x5682],
- ["8796",0x5683],
- ["8797",0x5684],
- ["E0E9",0x5685],
- ["E0E3",0x5686],
- ["8798",0x5687],
- ["8799",0x5688],
- ["879A",0x5689],
- ["879B",0x568A],
- ["879C",0x568B],
- ["879D",0x568C],
- ["879E",0x568D],
- ["BABF",0x568E],
- ["CCE7",0x568F],
- ["879F",0x5690],
- ["87A0",0x5691],
- ["87A1",0x5692],
- ["E0EA",0x5693],
- ["87A2",0x5694],
- ["87A3",0x5695],
- ["87A4",0x5696],
- ["87A5",0x5697],
- ["87A6",0x5698],
- ["87A7",0x5699],
- ["87A8",0x569A],
- ["87A9",0x569B],
- ["87AA",0x569C],
- ["87AB",0x569D],
- ["87AC",0x569E],
- ["87AD",0x569F],
- ["87AE",0x56A0],
- ["87AF",0x56A1],
- ["87B0",0x56A2],
- ["CFF9",0x56A3],
- ["87B1",0x56A4],
- ["87B2",0x56A5],
- ["87B3",0x56A6],
- ["87B4",0x56A7],
- ["87B5",0x56A8],
- ["87B6",0x56A9],
- ["87B7",0x56AA],
- ["87B8",0x56AB],
- ["87B9",0x56AC],
- ["87BA",0x56AD],
- ["87BB",0x56AE],
- ["E0EB",0x56AF],
- ["87BC",0x56B0],
- ["87BD",0x56B1],
- ["87BE",0x56B2],
- ["87BF",0x56B3],
- ["87C0",0x56B4],
- ["87C1",0x56B5],
- ["87C2",0x56B6],
- ["C8C2",0x56B7],
- ["87C3",0x56B8],
- ["87C4",0x56B9],
- ["87C5",0x56BA],
- ["87C6",0x56BB],
- ["BDC0",0x56BC],
- ["87C7",0x56BD],
- ["87C8",0x56BE],
- ["87C9",0x56BF],
- ["87CA",0x56C0],
- ["87CB",0x56C1],
- ["87CC",0x56C2],
- ["87CD",0x56C3],
- ["87CE",0x56C4],
- ["87CF",0x56C5],
- ["87D0",0x56C6],
- ["87D1",0x56C7],
- ["87D2",0x56C8],
- ["87D3",0x56C9],
- ["C4D2",0x56CA],
- ["87D4",0x56CB],
- ["87D5",0x56CC],
- ["87D6",0x56CD],
- ["87D7",0x56CE],
- ["87D8",0x56CF],
- ["87D9",0x56D0],
- ["87DA",0x56D1],
- ["87DB",0x56D2],
- ["87DC",0x56D3],
- ["E0EC",0x56D4],
- ["87DD",0x56D5],
- ["87DE",0x56D6],
- ["E0ED",0x56D7],
- ["87DF",0x56D8],
- ["87E0",0x56D9],
- ["C7F4",0x56DA],
- ["CBC4",0x56DB],
- ["87E1",0x56DC],
- ["E0EE",0x56DD],
- ["BBD8",0x56DE],
- ["D8B6",0x56DF],
- ["D2F2",0x56E0],
- ["E0EF",0x56E1],
- ["CDC5",0x56E2],
- ["87E2",0x56E3],
- ["B6DA",0x56E4],
- ["87E3",0x56E5],
- ["87E4",0x56E6],
- ["87E5",0x56E7],
- ["87E6",0x56E8],
- ["87E7",0x56E9],
- ["87E8",0x56EA],
- ["E0F1",0x56EB],
- ["87E9",0x56EC],
- ["D4B0",0x56ED],
- ["87EA",0x56EE],
- ["87EB",0x56EF],
- ["C0A7",0x56F0],
- ["B4D1",0x56F1],
- ["87EC",0x56F2],
- ["87ED",0x56F3],
- ["CEA7",0x56F4],
- ["E0F0",0x56F5],
- ["87EE",0x56F6],
- ["87EF",0x56F7],
- ["87F0",0x56F8],
- ["E0F2",0x56F9],
- ["B9CC",0x56FA],
- ["87F1",0x56FB],
- ["87F2",0x56FC],
- ["B9FA",0x56FD],
- ["CDBC",0x56FE],
- ["E0F3",0x56FF],
- ["87F3",0x5700],
- ["87F4",0x5701],
- ["87F5",0x5702],
- ["C6D4",0x5703],
- ["E0F4",0x5704],
- ["87F6",0x5705],
- ["D4B2",0x5706],
- ["87F7",0x5707],
- ["C8A6",0x5708],
- ["E0F6",0x5709],
- ["E0F5",0x570A],
- ["87F8",0x570B],
- ["87F9",0x570C],
- ["87FA",0x570D],
- ["87FB",0x570E],
- ["87FC",0x570F],
- ["87FD",0x5710],
- ["87FE",0x5711],
- ["8840",0x5712],
- ["8841",0x5713],
- ["8842",0x5714],
- ["8843",0x5715],
- ["8844",0x5716],
- ["8845",0x5717],
- ["8846",0x5718],
- ["8847",0x5719],
- ["8848",0x571A],
- ["8849",0x571B],
- ["E0F7",0x571C],
- ["884A",0x571D],
- ["884B",0x571E],
- ["CDC1",0x571F],
- ["884C",0x5720],
- ["884D",0x5721],
- ["884E",0x5722],
- ["CAA5",0x5723],
- ["884F",0x5724],
- ["8850",0x5725],
- ["8851",0x5726],
- ["8852",0x5727],
- ["D4DA",0x5728],
- ["DBD7",0x5729],
- ["DBD9",0x572A],
- ["8853",0x572B],
- ["DBD8",0x572C],
- ["B9E7",0x572D],
- ["DBDC",0x572E],
- ["DBDD",0x572F],
- ["B5D8",0x5730],
- ["8854",0x5731],
- ["8855",0x5732],
- ["DBDA",0x5733],
- ["8856",0x5734],
- ["8857",0x5735],
- ["8858",0x5736],
- ["8859",0x5737],
- ["885A",0x5738],
- ["DBDB",0x5739],
- ["B3A1",0x573A],
- ["DBDF",0x573B],
- ["885B",0x573C],
- ["885C",0x573D],
- ["BBF8",0x573E],
- ["885D",0x573F],
- ["D6B7",0x5740],
- ["885E",0x5741],
- ["DBE0",0x5742],
- ["885F",0x5743],
- ["8860",0x5744],
- ["8861",0x5745],
- ["8862",0x5746],
- ["BEF9",0x5747],
- ["8863",0x5748],
- ["8864",0x5749],
- ["B7BB",0x574A],
- ["8865",0x574B],
- ["DBD0",0x574C],
- ["CCAE",0x574D],
- ["BFB2",0x574E],
- ["BBB5",0x574F],
- ["D7F8",0x5750],
- ["BFD3",0x5751],
- ["8866",0x5752],
- ["8867",0x5753],
- ["8868",0x5754],
- ["8869",0x5755],
- ["886A",0x5756],
- ["BFE9",0x5757],
- ["886B",0x5758],
- ["886C",0x5759],
- ["BCE1",0x575A],
- ["CCB3",0x575B],
- ["DBDE",0x575C],
- ["B0D3",0x575D],
- ["CEEB",0x575E],
- ["B7D8",0x575F],
- ["D7B9",0x5760],
- ["C6C2",0x5761],
- ["886D",0x5762],
- ["886E",0x5763],
- ["C0A4",0x5764],
- ["886F",0x5765],
- ["CCB9",0x5766],
- ["8870",0x5767],
- ["DBE7",0x5768],
- ["DBE1",0x5769],
- ["C6BA",0x576A],
- ["DBE3",0x576B],
- ["8871",0x576C],
- ["DBE8",0x576D],
- ["8872",0x576E],
- ["C5F7",0x576F],
- ["8873",0x5770],
- ["8874",0x5771],
- ["8875",0x5772],
- ["DBEA",0x5773],
- ["8876",0x5774],
- ["8877",0x5775],
- ["DBE9",0x5776],
- ["BFC0",0x5777],
- ["8878",0x5778],
- ["8879",0x5779],
- ["887A",0x577A],
- ["DBE6",0x577B],
- ["DBE5",0x577C],
- ["887B",0x577D],
- ["887C",0x577E],
- ["887D",0x577F],
- ["887E",0x5780],
- ["8880",0x5781],
- ["B4B9",0x5782],
- ["C0AC",0x5783],
- ["C2A2",0x5784],
- ["DBE2",0x5785],
- ["DBE4",0x5786],
- ["8881",0x5787],
- ["8882",0x5788],
- ["8883",0x5789],
- ["8884",0x578A],
- ["D0CD",0x578B],
- ["DBED",0x578C],
- ["8885",0x578D],
- ["8886",0x578E],
- ["8887",0x578F],
- ["8888",0x5790],
- ["8889",0x5791],
- ["C0DD",0x5792],
- ["DBF2",0x5793],
- ["888A",0x5794],
- ["888B",0x5795],
- ["888C",0x5796],
- ["888D",0x5797],
- ["888E",0x5798],
- ["888F",0x5799],
- ["8890",0x579A],
- ["B6E2",0x579B],
- ["8891",0x579C],
- ["8892",0x579D],
- ["8893",0x579E],
- ["8894",0x579F],
- ["DBF3",0x57A0],
- ["DBD2",0x57A1],
- ["B9B8",0x57A2],
- ["D4AB",0x57A3],
- ["DBEC",0x57A4],
- ["8895",0x57A5],
- ["BFD1",0x57A6],
- ["DBF0",0x57A7],
- ["8896",0x57A8],
- ["DBD1",0x57A9],
- ["8897",0x57AA],
- ["B5E6",0x57AB],
- ["8898",0x57AC],
- ["DBEB",0x57AD],
- ["BFE5",0x57AE],
- ["8899",0x57AF],
- ["889A",0x57B0],
- ["889B",0x57B1],
- ["DBEE",0x57B2],
- ["889C",0x57B3],
- ["DBF1",0x57B4],
- ["889D",0x57B5],
- ["889E",0x57B6],
- ["889F",0x57B7],
- ["DBF9",0x57B8],
- ["88A0",0x57B9],
- ["88A1",0x57BA],
- ["88A2",0x57BB],
- ["88A3",0x57BC],
- ["88A4",0x57BD],
- ["88A5",0x57BE],
- ["88A6",0x57BF],
- ["88A7",0x57C0],
- ["88A8",0x57C1],
- ["B9A1",0x57C2],
- ["B0A3",0x57C3],
- ["88A9",0x57C4],
- ["88AA",0x57C5],
- ["88AB",0x57C6],
- ["88AC",0x57C7],
- ["88AD",0x57C8],
- ["88AE",0x57C9],
- ["88AF",0x57CA],
- ["C2F1",0x57CB],
- ["88B0",0x57CC],
- ["88B1",0x57CD],
- ["B3C7",0x57CE],
- ["DBEF",0x57CF],
- ["88B2",0x57D0],
- ["88B3",0x57D1],
- ["DBF8",0x57D2],
- ["88B4",0x57D3],
- ["C6D2",0x57D4],
- ["DBF4",0x57D5],
- ["88B5",0x57D6],
- ["88B6",0x57D7],
- ["DBF5",0x57D8],
- ["DBF7",0x57D9],
- ["DBF6",0x57DA],
- ["88B7",0x57DB],
- ["88B8",0x57DC],
- ["DBFE",0x57DD],
- ["88B9",0x57DE],
- ["D3F2",0x57DF],
- ["B2BA",0x57E0],
- ["88BA",0x57E1],
- ["88BB",0x57E2],
- ["88BC",0x57E3],
- ["DBFD",0x57E4],
- ["88BD",0x57E5],
- ["88BE",0x57E6],
- ["88BF",0x57E7],
- ["88C0",0x57E8],
- ["88C1",0x57E9],
- ["88C2",0x57EA],
- ["88C3",0x57EB],
- ["88C4",0x57EC],
- ["DCA4",0x57ED],
- ["88C5",0x57EE],
- ["DBFB",0x57EF],
- ["88C6",0x57F0],
- ["88C7",0x57F1],
- ["88C8",0x57F2],
- ["88C9",0x57F3],
- ["DBFA",0x57F4],
- ["88CA",0x57F5],
- ["88CB",0x57F6],
- ["88CC",0x57F7],
- ["DBFC",0x57F8],
- ["C5E0",0x57F9],
- ["BBF9",0x57FA],
- ["88CD",0x57FB],
- ["88CE",0x57FC],
- ["DCA3",0x57FD],
- ["88CF",0x57FE],
- ["88D0",0x57FF],
- ["DCA5",0x5800],
- ["88D1",0x5801],
- ["CCC3",0x5802],
- ["88D2",0x5803],
- ["88D3",0x5804],
- ["88D4",0x5805],
- ["B6D1",0x5806],
- ["DDC0",0x5807],
- ["88D5",0x5808],
- ["88D6",0x5809],
- ["88D7",0x580A],
- ["DCA1",0x580B],
- ["88D8",0x580C],
- ["DCA2",0x580D],
- ["88D9",0x580E],
- ["88DA",0x580F],
- ["88DB",0x5810],
- ["C7B5",0x5811],
- ["88DC",0x5812],
- ["88DD",0x5813],
- ["88DE",0x5814],
- ["B6E9",0x5815],
- ["88DF",0x5816],
- ["88E0",0x5817],
- ["88E1",0x5818],
- ["DCA7",0x5819],
- ["88E2",0x581A],
- ["88E3",0x581B],
- ["88E4",0x581C],
- ["88E5",0x581D],
- ["DCA6",0x581E],
- ["88E6",0x581F],
- ["DCA9",0x5820],
- ["B1A4",0x5821],
- ["88E7",0x5822],
- ["88E8",0x5823],
- ["B5CC",0x5824],
- ["88E9",0x5825],
- ["88EA",0x5826],
- ["88EB",0x5827],
- ["88EC",0x5828],
- ["88ED",0x5829],
- ["BFB0",0x582A],
- ["88EE",0x582B],
- ["88EF",0x582C],
- ["88F0",0x582D],
- ["88F1",0x582E],
- ["88F2",0x582F],
- ["D1DF",0x5830],
- ["88F3",0x5831],
- ["88F4",0x5832],
- ["88F5",0x5833],
- ["88F6",0x5834],
- ["B6C2",0x5835],
- ["88F7",0x5836],
- ["88F8",0x5837],
- ["88F9",0x5838],
- ["88FA",0x5839],
- ["88FB",0x583A],
- ["88FC",0x583B],
- ["88FD",0x583C],
- ["88FE",0x583D],
- ["8940",0x583E],
- ["8941",0x583F],
- ["8942",0x5840],
- ["8943",0x5841],
- ["8944",0x5842],
- ["8945",0x5843],
- ["DCA8",0x5844],
- ["8946",0x5845],
- ["8947",0x5846],
- ["8948",0x5847],
- ["8949",0x5848],
- ["894A",0x5849],
- ["894B",0x584A],
- ["894C",0x584B],
- ["CBFA",0x584C],
- ["EBF3",0x584D],
- ["894D",0x584E],
- ["894E",0x584F],
- ["894F",0x5850],
- ["CBDC",0x5851],
- ["8950",0x5852],
- ["8951",0x5853],
- ["CBFE",0x5854],
- ["8952",0x5855],
- ["8953",0x5856],
- ["8954",0x5857],
- ["CCC1",0x5858],
- ["8955",0x5859],
- ["8956",0x585A],
- ["8957",0x585B],
- ["8958",0x585C],
- ["8959",0x585D],
- ["C8FB",0x585E],
- ["895A",0x585F],
- ["895B",0x5860],
- ["895C",0x5861],
- ["895D",0x5862],
- ["895E",0x5863],
- ["895F",0x5864],
- ["DCAA",0x5865],
- ["8960",0x5866],
- ["8961",0x5867],
- ["8962",0x5868],
- ["8963",0x5869],
- ["8964",0x586A],
- ["CCEE",0x586B],
- ["DCAB",0x586C],
- ["8965",0x586D],
- ["8966",0x586E],
- ["8967",0x586F],
- ["8968",0x5870],
- ["8969",0x5871],
- ["896A",0x5872],
- ["896B",0x5873],
- ["896C",0x5874],
- ["896D",0x5875],
- ["896E",0x5876],
- ["896F",0x5877],
- ["8970",0x5878],
- ["8971",0x5879],
- ["8972",0x587A],
- ["8973",0x587B],
- ["8974",0x587C],
- ["8975",0x587D],
- ["DBD3",0x587E],
- ["8976",0x587F],
- ["DCAF",0x5880],
- ["DCAC",0x5881],
- ["8977",0x5882],
- ["BEB3",0x5883],
- ["8978",0x5884],
- ["CAFB",0x5885],
- ["8979",0x5886],
- ["897A",0x5887],
- ["897B",0x5888],
- ["DCAD",0x5889],
- ["897C",0x588A],
- ["897D",0x588B],
- ["897E",0x588C],
- ["8980",0x588D],
- ["8981",0x588E],
- ["8982",0x588F],
- ["8983",0x5890],
- ["8984",0x5891],
- ["C9CA",0x5892],
- ["C4B9",0x5893],
- ["8985",0x5894],
- ["8986",0x5895],
- ["8987",0x5896],
- ["8988",0x5897],
- ["8989",0x5898],
- ["C7BD",0x5899],
- ["DCAE",0x589A],
- ["898A",0x589B],
- ["898B",0x589C],
- ["898C",0x589D],
- ["D4F6",0x589E],
- ["D0E6",0x589F],
- ["898D",0x58A0],
- ["898E",0x58A1],
- ["898F",0x58A2],
- ["8990",0x58A3],
- ["8991",0x58A4],
- ["8992",0x58A5],
- ["8993",0x58A6],
- ["8994",0x58A7],
- ["C4AB",0x58A8],
- ["B6D5",0x58A9],
- ["8995",0x58AA],
- ["8996",0x58AB],
- ["8997",0x58AC],
- ["8998",0x58AD],
- ["8999",0x58AE],
- ["899A",0x58AF],
- ["899B",0x58B0],
- ["899C",0x58B1],
- ["899D",0x58B2],
- ["899E",0x58B3],
- ["899F",0x58B4],
- ["89A0",0x58B5],
- ["89A1",0x58B6],
- ["89A2",0x58B7],
- ["89A3",0x58B8],
- ["89A4",0x58B9],
- ["89A5",0x58BA],
- ["89A6",0x58BB],
- ["DBD4",0x58BC],
- ["89A7",0x58BD],
- ["89A8",0x58BE],
- ["89A9",0x58BF],
- ["89AA",0x58C0],
- ["B1DA",0x58C1],
- ["89AB",0x58C2],
- ["89AC",0x58C3],
- ["89AD",0x58C4],
- ["DBD5",0x58C5],
- ["89AE",0x58C6],
- ["89AF",0x58C7],
- ["89B0",0x58C8],
- ["89B1",0x58C9],
- ["89B2",0x58CA],
- ["89B3",0x58CB],
- ["89B4",0x58CC],
- ["89B5",0x58CD],
- ["89B6",0x58CE],
- ["89B7",0x58CF],
- ["89B8",0x58D0],
- ["DBD6",0x58D1],
- ["89B9",0x58D2],
- ["89BA",0x58D3],
- ["89BB",0x58D4],
- ["BABE",0x58D5],
- ["89BC",0x58D6],
- ["89BD",0x58D7],
- ["89BE",0x58D8],
- ["89BF",0x58D9],
- ["89C0",0x58DA],
- ["89C1",0x58DB],
- ["89C2",0x58DC],
- ["89C3",0x58DD],
- ["89C4",0x58DE],
- ["89C5",0x58DF],
- ["89C6",0x58E0],
- ["89C7",0x58E1],
- ["89C8",0x58E2],
- ["89C9",0x58E3],
- ["C8C0",0x58E4],
- ["89CA",0x58E5],
- ["89CB",0x58E6],
- ["89CC",0x58E7],
- ["89CD",0x58E8],
- ["89CE",0x58E9],
- ["89CF",0x58EA],
- ["CABF",0x58EB],
- ["C8C9",0x58EC],
- ["89D0",0x58ED],
- ["D7B3",0x58EE],
- ["89D1",0x58EF],
- ["C9F9",0x58F0],
- ["89D2",0x58F1],
- ["89D3",0x58F2],
- ["BFC7",0x58F3],
- ["89D4",0x58F4],
- ["89D5",0x58F5],
- ["BAF8",0x58F6],
- ["89D6",0x58F7],
- ["89D7",0x58F8],
- ["D2BC",0x58F9],
- ["89D8",0x58FA],
- ["89D9",0x58FB],
- ["89DA",0x58FC],
- ["89DB",0x58FD],
- ["89DC",0x58FE],
- ["89DD",0x58FF],
- ["89DE",0x5900],
- ["89DF",0x5901],
- ["E2BA",0x5902],
- ["89E0",0x5903],
- ["B4A6",0x5904],
- ["89E1",0x5905],
- ["89E2",0x5906],
- ["B1B8",0x5907],
- ["89E3",0x5908],
- ["89E4",0x5909],
- ["89E5",0x590A],
- ["89E6",0x590B],
- ["89E7",0x590C],
- ["B8B4",0x590D],
- ["89E8",0x590E],
- ["CFC4",0x590F],
- ["89E9",0x5910],
- ["89EA",0x5911],
- ["89EB",0x5912],
- ["89EC",0x5913],
- ["D9E7",0x5914],
- ["CFA6",0x5915],
- ["CDE2",0x5916],
- ["89ED",0x5917],
- ["89EE",0x5918],
- ["D9ED",0x5919],
- ["B6E0",0x591A],
- ["89EF",0x591B],
- ["D2B9",0x591C],
- ["89F0",0x591D],
- ["89F1",0x591E],
- ["B9BB",0x591F],
- ["89F2",0x5920],
- ["89F3",0x5921],
- ["89F4",0x5922],
- ["89F5",0x5923],
- ["E2B9",0x5924],
- ["E2B7",0x5925],
- ["89F6",0x5926],
- ["B4F3",0x5927],
- ["89F7",0x5928],
- ["CCEC",0x5929],
- ["CCAB",0x592A],
- ["B7F2",0x592B],
- ["89F8",0x592C],
- ["D8B2",0x592D],
- ["D1EB",0x592E],
- ["BABB",0x592F],
- ["89F9",0x5930],
- ["CAA7",0x5931],
- ["89FA",0x5932],
- ["89FB",0x5933],
- ["CDB7",0x5934],
- ["89FC",0x5935],
- ["89FD",0x5936],
- ["D2C4",0x5937],
- ["BFE4",0x5938],
- ["BCD0",0x5939],
- ["B6E1",0x593A],
- ["89FE",0x593B],
- ["DEC5",0x593C],
- ["8A40",0x593D],
- ["8A41",0x593E],
- ["8A42",0x593F],
- ["8A43",0x5940],
- ["DEC6",0x5941],
- ["DBBC",0x5942],
- ["8A44",0x5943],
- ["D1D9",0x5944],
- ["8A45",0x5945],
- ["8A46",0x5946],
- ["C6E6",0x5947],
- ["C4CE",0x5948],
- ["B7EE",0x5949],
- ["8A47",0x594A],
- ["B7DC",0x594B],
- ["8A48",0x594C],
- ["8A49",0x594D],
- ["BFFC",0x594E],
- ["D7E0",0x594F],
- ["8A4A",0x5950],
- ["C6F5",0x5951],
- ["8A4B",0x5952],
- ["8A4C",0x5953],
- ["B1BC",0x5954],
- ["DEC8",0x5955],
- ["BDB1",0x5956],
- ["CCD7",0x5957],
- ["DECA",0x5958],
- ["8A4D",0x5959],
- ["DEC9",0x595A],
- ["8A4E",0x595B],
- ["8A4F",0x595C],
- ["8A50",0x595D],
- ["8A51",0x595E],
- ["8A52",0x595F],
- ["B5EC",0x5960],
- ["8A53",0x5961],
- ["C9DD",0x5962],
- ["8A54",0x5963],
- ["8A55",0x5964],
- ["B0C2",0x5965],
- ["8A56",0x5966],
- ["8A57",0x5967],
- ["8A58",0x5968],
- ["8A59",0x5969],
- ["8A5A",0x596A],
- ["8A5B",0x596B],
- ["8A5C",0x596C],
- ["8A5D",0x596D],
- ["8A5E",0x596E],
- ["8A5F",0x596F],
- ["8A60",0x5970],
- ["8A61",0x5971],
- ["8A62",0x5972],
- ["C5AE",0x5973],
- ["C5AB",0x5974],
- ["8A63",0x5975],
- ["C4CC",0x5976],
- ["8A64",0x5977],
- ["BCE9",0x5978],
- ["CBFD",0x5979],
- ["8A65",0x597A],
- ["8A66",0x597B],
- ["8A67",0x597C],
- ["BAC3",0x597D],
- ["8A68",0x597E],
- ["8A69",0x597F],
- ["8A6A",0x5980],
- ["E5F9",0x5981],
- ["C8E7",0x5982],
- ["E5FA",0x5983],
- ["CDFD",0x5984],
- ["8A6B",0x5985],
- ["D7B1",0x5986],
- ["B8BE",0x5987],
- ["C2E8",0x5988],
- ["8A6C",0x5989],
- ["C8D1",0x598A],
- ["8A6D",0x598B],
- ["8A6E",0x598C],
- ["E5FB",0x598D],
- ["8A6F",0x598E],
- ["8A70",0x598F],
- ["8A71",0x5990],
- ["8A72",0x5991],
- ["B6CA",0x5992],
- ["BCCB",0x5993],
- ["8A73",0x5994],
- ["8A74",0x5995],
- ["D1FD",0x5996],
- ["E6A1",0x5997],
- ["8A75",0x5998],
- ["C3EE",0x5999],
- ["8A76",0x599A],
- ["8A77",0x599B],
- ["8A78",0x599C],
- ["8A79",0x599D],
- ["E6A4",0x599E],
- ["8A7A",0x599F],
- ["8A7B",0x59A0],
- ["8A7C",0x59A1],
- ["8A7D",0x59A2],
- ["E5FE",0x59A3],
- ["E6A5",0x59A4],
- ["CDD7",0x59A5],
- ["8A7E",0x59A6],
- ["8A80",0x59A7],
- ["B7C1",0x59A8],
- ["E5FC",0x59A9],
- ["E5FD",0x59AA],
- ["E6A3",0x59AB],
- ["8A81",0x59AC],
- ["8A82",0x59AD],
- ["C4DD",0x59AE],
- ["E6A8",0x59AF],
- ["8A83",0x59B0],
- ["8A84",0x59B1],
- ["E6A7",0x59B2],
- ["8A85",0x59B3],
- ["8A86",0x59B4],
- ["8A87",0x59B5],
- ["8A88",0x59B6],
- ["8A89",0x59B7],
- ["8A8A",0x59B8],
- ["C3C3",0x59B9],
- ["8A8B",0x59BA],
- ["C6DE",0x59BB],
- ["8A8C",0x59BC],
- ["8A8D",0x59BD],
- ["E6AA",0x59BE],
- ["8A8E",0x59BF],
- ["8A8F",0x59C0],
- ["8A90",0x59C1],
- ["8A91",0x59C2],
- ["8A92",0x59C3],
- ["8A93",0x59C4],
- ["8A94",0x59C5],
- ["C4B7",0x59C6],
- ["8A95",0x59C7],
- ["8A96",0x59C8],
- ["8A97",0x59C9],
- ["E6A2",0x59CA],
- ["CABC",0x59CB],
- ["8A98",0x59CC],
- ["8A99",0x59CD],
- ["8A9A",0x59CE],
- ["8A9B",0x59CF],
- ["BDE3",0x59D0],
- ["B9C3",0x59D1],
- ["E6A6",0x59D2],
- ["D0D5",0x59D3],
- ["CEAF",0x59D4],
- ["8A9C",0x59D5],
- ["8A9D",0x59D6],
- ["E6A9",0x59D7],
- ["E6B0",0x59D8],
- ["8A9E",0x59D9],
- ["D2A6",0x59DA],
- ["8A9F",0x59DB],
- ["BDAA",0x59DC],
- ["E6AD",0x59DD],
- ["8AA0",0x59DE],
- ["8AA1",0x59DF],
- ["8AA2",0x59E0],
- ["8AA3",0x59E1],
- ["8AA4",0x59E2],
- ["E6AF",0x59E3],
- ["8AA5",0x59E4],
- ["C0D1",0x59E5],
- ["8AA6",0x59E6],
- ["8AA7",0x59E7],
- ["D2CC",0x59E8],
- ["8AA8",0x59E9],
- ["8AA9",0x59EA],
- ["8AAA",0x59EB],
- ["BCA7",0x59EC],
- ["8AAB",0x59ED],
- ["8AAC",0x59EE],
- ["8AAD",0x59EF],
- ["8AAE",0x59F0],
- ["8AAF",0x59F1],
- ["8AB0",0x59F2],
- ["8AB1",0x59F3],
- ["8AB2",0x59F4],
- ["8AB3",0x59F5],
- ["8AB4",0x59F6],
- ["8AB5",0x59F7],
- ["8AB6",0x59F8],
- ["E6B1",0x59F9],
- ["8AB7",0x59FA],
- ["D2F6",0x59FB],
- ["8AB8",0x59FC],
- ["8AB9",0x59FD],
- ["8ABA",0x59FE],
- ["D7CB",0x59FF],
- ["8ABB",0x5A00],
- ["CDFE",0x5A01],
- ["8ABC",0x5A02],
- ["CDDE",0x5A03],
- ["C2A6",0x5A04],
- ["E6AB",0x5A05],
- ["E6AC",0x5A06],
- ["BDBF",0x5A07],
- ["E6AE",0x5A08],
- ["E6B3",0x5A09],
- ["8ABD",0x5A0A],
- ["8ABE",0x5A0B],
- ["E6B2",0x5A0C],
- ["8ABF",0x5A0D],
- ["8AC0",0x5A0E],
- ["8AC1",0x5A0F],
- ["8AC2",0x5A10],
- ["E6B6",0x5A11],
- ["8AC3",0x5A12],
- ["E6B8",0x5A13],
- ["8AC4",0x5A14],
- ["8AC5",0x5A15],
- ["8AC6",0x5A16],
- ["8AC7",0x5A17],
- ["C4EF",0x5A18],
- ["8AC8",0x5A19],
- ["8AC9",0x5A1A],
- ["8ACA",0x5A1B],
- ["C4C8",0x5A1C],
- ["8ACB",0x5A1D],
- ["8ACC",0x5A1E],
- ["BEEA",0x5A1F],
- ["C9EF",0x5A20],
- ["8ACD",0x5A21],
- ["8ACE",0x5A22],
- ["E6B7",0x5A23],
- ["8ACF",0x5A24],
- ["B6F0",0x5A25],
- ["8AD0",0x5A26],
- ["8AD1",0x5A27],
- ["8AD2",0x5A28],
- ["C3E4",0x5A29],
- ["8AD3",0x5A2A],
- ["8AD4",0x5A2B],
- ["8AD5",0x5A2C],
- ["8AD6",0x5A2D],
- ["8AD7",0x5A2E],
- ["8AD8",0x5A2F],
- ["8AD9",0x5A30],
- ["D3E9",0x5A31],
- ["E6B4",0x5A32],
- ["8ADA",0x5A33],
- ["E6B5",0x5A34],
- ["8ADB",0x5A35],
- ["C8A2",0x5A36],
- ["8ADC",0x5A37],
- ["8ADD",0x5A38],
- ["8ADE",0x5A39],
- ["8ADF",0x5A3A],
- ["8AE0",0x5A3B],
- ["E6BD",0x5A3C],
- ["8AE1",0x5A3D],
- ["8AE2",0x5A3E],
- ["8AE3",0x5A3F],
- ["E6B9",0x5A40],
- ["8AE4",0x5A41],
- ["8AE5",0x5A42],
- ["8AE6",0x5A43],
- ["8AE7",0x5A44],
- ["8AE8",0x5A45],
- ["C6C5",0x5A46],
- ["8AE9",0x5A47],
- ["8AEA",0x5A48],
- ["CDF1",0x5A49],
- ["E6BB",0x5A4A],
- ["8AEB",0x5A4B],
- ["8AEC",0x5A4C],
- ["8AED",0x5A4D],
- ["8AEE",0x5A4E],
- ["8AEF",0x5A4F],
- ["8AF0",0x5A50],
- ["8AF1",0x5A51],
- ["8AF2",0x5A52],
- ["8AF3",0x5A53],
- ["8AF4",0x5A54],
- ["E6BC",0x5A55],
- ["8AF5",0x5A56],
- ["8AF6",0x5A57],
- ["8AF7",0x5A58],
- ["8AF8",0x5A59],
- ["BBE9",0x5A5A],
- ["8AF9",0x5A5B],
- ["8AFA",0x5A5C],
- ["8AFB",0x5A5D],
- ["8AFC",0x5A5E],
- ["8AFD",0x5A5F],
- ["8AFE",0x5A60],
- ["8B40",0x5A61],
- ["E6BE",0x5A62],
- ["8B41",0x5A63],
- ["8B42",0x5A64],
- ["8B43",0x5A65],
- ["8B44",0x5A66],
- ["E6BA",0x5A67],
- ["8B45",0x5A68],
- ["8B46",0x5A69],
- ["C0B7",0x5A6A],
- ["8B47",0x5A6B],
- ["8B48",0x5A6C],
- ["8B49",0x5A6D],
- ["8B4A",0x5A6E],
- ["8B4B",0x5A6F],
- ["8B4C",0x5A70],
- ["8B4D",0x5A71],
- ["8B4E",0x5A72],
- ["8B4F",0x5A73],
- ["D3A4",0x5A74],
- ["E6BF",0x5A75],
- ["C9F4",0x5A76],
- ["E6C3",0x5A77],
- ["8B50",0x5A78],
- ["8B51",0x5A79],
- ["E6C4",0x5A7A],
- ["8B52",0x5A7B],
- ["8B53",0x5A7C],
- ["8B54",0x5A7D],
- ["8B55",0x5A7E],
- ["D0F6",0x5A7F],
- ["8B56",0x5A80],
- ["8B57",0x5A81],
- ["8B58",0x5A82],
- ["8B59",0x5A83],
- ["8B5A",0x5A84],
- ["8B5B",0x5A85],
- ["8B5C",0x5A86],
- ["8B5D",0x5A87],
- ["8B5E",0x5A88],
- ["8B5F",0x5A89],
- ["8B60",0x5A8A],
- ["8B61",0x5A8B],
- ["8B62",0x5A8C],
- ["8B63",0x5A8D],
- ["8B64",0x5A8E],
- ["8B65",0x5A8F],
- ["8B66",0x5A90],
- ["8B67",0x5A91],
- ["C3BD",0x5A92],
- ["8B68",0x5A93],
- ["8B69",0x5A94],
- ["8B6A",0x5A95],
- ["8B6B",0x5A96],
- ["8B6C",0x5A97],
- ["8B6D",0x5A98],
- ["8B6E",0x5A99],
- ["C3C4",0x5A9A],
- ["E6C2",0x5A9B],
- ["8B6F",0x5A9C],
- ["8B70",0x5A9D],
- ["8B71",0x5A9E],
- ["8B72",0x5A9F],
- ["8B73",0x5AA0],
- ["8B74",0x5AA1],
- ["8B75",0x5AA2],
- ["8B76",0x5AA3],
- ["8B77",0x5AA4],
- ["8B78",0x5AA5],
- ["8B79",0x5AA6],
- ["8B7A",0x5AA7],
- ["8B7B",0x5AA8],
- ["8B7C",0x5AA9],
- ["E6C1",0x5AAA],
- ["8B7D",0x5AAB],
- ["8B7E",0x5AAC],
- ["8B80",0x5AAD],
- ["8B81",0x5AAE],
- ["8B82",0x5AAF],
- ["8B83",0x5AB0],
- ["8B84",0x5AB1],
- ["E6C7",0x5AB2],
- ["CFB1",0x5AB3],
- ["8B85",0x5AB4],
- ["EBF4",0x5AB5],
- ["8B86",0x5AB6],
- ["8B87",0x5AB7],
- ["E6CA",0x5AB8],
- ["8B88",0x5AB9],
- ["8B89",0x5ABA],
- ["8B8A",0x5ABB],
- ["8B8B",0x5ABC],
- ["8B8C",0x5ABD],
- ["E6C5",0x5ABE],
- ["8B8D",0x5ABF],
- ["8B8E",0x5AC0],
- ["BCDE",0x5AC1],
- ["C9A9",0x5AC2],
- ["8B8F",0x5AC3],
- ["8B90",0x5AC4],
- ["8B91",0x5AC5],
- ["8B92",0x5AC6],
- ["8B93",0x5AC7],
- ["8B94",0x5AC8],
- ["BCB5",0x5AC9],
- ["8B95",0x5ACA],
- ["8B96",0x5ACB],
- ["CFD3",0x5ACC],
- ["8B97",0x5ACD],
- ["8B98",0x5ACE],
- ["8B99",0x5ACF],
- ["8B9A",0x5AD0],
- ["8B9B",0x5AD1],
- ["E6C8",0x5AD2],
- ["8B9C",0x5AD3],
- ["E6C9",0x5AD4],
- ["8B9D",0x5AD5],
- ["E6CE",0x5AD6],
- ["8B9E",0x5AD7],
- ["E6D0",0x5AD8],
- ["8B9F",0x5AD9],
- ["8BA0",0x5ADA],
- ["8BA1",0x5ADB],
- ["E6D1",0x5ADC],
- ["8BA2",0x5ADD],
- ["8BA3",0x5ADE],
- ["8BA4",0x5ADF],
- ["E6CB",0x5AE0],
- ["B5D5",0x5AE1],
- ["8BA5",0x5AE2],
- ["E6CC",0x5AE3],
- ["8BA6",0x5AE4],
- ["8BA7",0x5AE5],
- ["E6CF",0x5AE6],
- ["8BA8",0x5AE7],
- ["8BA9",0x5AE8],
- ["C4DB",0x5AE9],
- ["8BAA",0x5AEA],
- ["E6C6",0x5AEB],
- ["8BAB",0x5AEC],
- ["8BAC",0x5AED],
- ["8BAD",0x5AEE],
- ["8BAE",0x5AEF],
- ["8BAF",0x5AF0],
- ["E6CD",0x5AF1],
- ["8BB0",0x5AF2],
- ["8BB1",0x5AF3],
- ["8BB2",0x5AF4],
- ["8BB3",0x5AF5],
- ["8BB4",0x5AF6],
- ["8BB5",0x5AF7],
- ["8BB6",0x5AF8],
- ["8BB7",0x5AF9],
- ["8BB8",0x5AFA],
- ["8BB9",0x5AFB],
- ["8BBA",0x5AFC],
- ["8BBB",0x5AFD],
- ["8BBC",0x5AFE],
- ["8BBD",0x5AFF],
- ["8BBE",0x5B00],
- ["8BBF",0x5B01],
- ["8BC0",0x5B02],
- ["8BC1",0x5B03],
- ["8BC2",0x5B04],
- ["8BC3",0x5B05],
- ["8BC4",0x5B06],
- ["8BC5",0x5B07],
- ["8BC6",0x5B08],
- ["E6D2",0x5B09],
- ["8BC7",0x5B0A],
- ["8BC8",0x5B0B],
- ["8BC9",0x5B0C],
- ["8BCA",0x5B0D],
- ["8BCB",0x5B0E],
- ["8BCC",0x5B0F],
- ["8BCD",0x5B10],
- ["8BCE",0x5B11],
- ["8BCF",0x5B12],
- ["8BD0",0x5B13],
- ["8BD1",0x5B14],
- ["8BD2",0x5B15],
- ["E6D4",0x5B16],
- ["E6D3",0x5B17],
- ["8BD3",0x5B18],
- ["8BD4",0x5B19],
- ["8BD5",0x5B1A],
- ["8BD6",0x5B1B],
- ["8BD7",0x5B1C],
- ["8BD8",0x5B1D],
- ["8BD9",0x5B1E],
- ["8BDA",0x5B1F],
- ["8BDB",0x5B20],
- ["8BDC",0x5B21],
- ["8BDD",0x5B22],
- ["8BDE",0x5B23],
- ["8BDF",0x5B24],
- ["8BE0",0x5B25],
- ["8BE1",0x5B26],
- ["8BE2",0x5B27],
- ["8BE3",0x5B28],
- ["8BE4",0x5B29],
- ["8BE5",0x5B2A],
- ["8BE6",0x5B2B],
- ["8BE7",0x5B2C],
- ["8BE8",0x5B2D],
- ["8BE9",0x5B2E],
- ["8BEA",0x5B2F],
- ["8BEB",0x5B30],
- ["8BEC",0x5B31],
- ["E6D5",0x5B32],
- ["8BED",0x5B33],
- ["D9F8",0x5B34],
- ["8BEE",0x5B35],
- ["8BEF",0x5B36],
- ["E6D6",0x5B37],
- ["8BF0",0x5B38],
- ["8BF1",0x5B39],
- ["8BF2",0x5B3A],
- ["8BF3",0x5B3B],
- ["8BF4",0x5B3C],
- ["8BF5",0x5B3D],
- ["8BF6",0x5B3E],
- ["8BF7",0x5B3F],
- ["E6D7",0x5B40],
- ["8BF8",0x5B41],
- ["8BF9",0x5B42],
- ["8BFA",0x5B43],
- ["8BFB",0x5B44],
- ["8BFC",0x5B45],
- ["8BFD",0x5B46],
- ["8BFE",0x5B47],
- ["8C40",0x5B48],
- ["8C41",0x5B49],
- ["8C42",0x5B4A],
- ["8C43",0x5B4B],
- ["8C44",0x5B4C],
- ["8C45",0x5B4D],
- ["8C46",0x5B4E],
- ["8C47",0x5B4F],
- ["D7D3",0x5B50],
- ["E6DD",0x5B51],
- ["8C48",0x5B52],
- ["E6DE",0x5B53],
- ["BFD7",0x5B54],
- ["D4D0",0x5B55],
- ["8C49",0x5B56],
- ["D7D6",0x5B57],
- ["B4E6",0x5B58],
- ["CBEF",0x5B59],
- ["E6DA",0x5B5A],
- ["D8C3",0x5B5B],
- ["D7CE",0x5B5C],
- ["D0A2",0x5B5D],
- ["8C4A",0x5B5E],
- ["C3CF",0x5B5F],
- ["8C4B",0x5B60],
- ["8C4C",0x5B61],
- ["E6DF",0x5B62],
- ["BCBE",0x5B63],
- ["B9C2",0x5B64],
- ["E6DB",0x5B65],
- ["D1A7",0x5B66],
- ["8C4D",0x5B67],
- ["8C4E",0x5B68],
- ["BAA2",0x5B69],
- ["C2CF",0x5B6A],
- ["8C4F",0x5B6B],
- ["D8AB",0x5B6C],
- ["8C50",0x5B6D],
- ["8C51",0x5B6E],
- ["8C52",0x5B6F],
- ["CAEB",0x5B70],
- ["E5EE",0x5B71],
- ["8C53",0x5B72],
- ["E6DC",0x5B73],
- ["8C54",0x5B74],
- ["B7F5",0x5B75],
- ["8C55",0x5B76],
- ["8C56",0x5B77],
- ["8C57",0x5B78],
- ["8C58",0x5B79],
- ["C8E6",0x5B7A],
- ["8C59",0x5B7B],
- ["8C5A",0x5B7C],
- ["C4F5",0x5B7D],
- ["8C5B",0x5B7E],
- ["8C5C",0x5B7F],
- ["E5B2",0x5B80],
- ["C4FE",0x5B81],
- ["8C5D",0x5B82],
- ["CBFC",0x5B83],
- ["E5B3",0x5B84],
- ["D5AC",0x5B85],
- ["8C5E",0x5B86],
- ["D3EE",0x5B87],
- ["CAD8",0x5B88],
- ["B0B2",0x5B89],
- ["8C5F",0x5B8A],
- ["CBCE",0x5B8B],
- ["CDEA",0x5B8C],
- ["8C60",0x5B8D],
- ["8C61",0x5B8E],
- ["BAEA",0x5B8F],
- ["8C62",0x5B90],
- ["8C63",0x5B91],
- ["8C64",0x5B92],
- ["E5B5",0x5B93],
- ["8C65",0x5B94],
- ["E5B4",0x5B95],
- ["8C66",0x5B96],
- ["D7DA",0x5B97],
- ["B9D9",0x5B98],
- ["D6E6",0x5B99],
- ["B6A8",0x5B9A],
- ["CDF0",0x5B9B],
- ["D2CB",0x5B9C],
- ["B1A6",0x5B9D],
- ["CAB5",0x5B9E],
- ["8C67",0x5B9F],
- ["B3E8",0x5BA0],
- ["C9F3",0x5BA1],
- ["BFCD",0x5BA2],
- ["D0FB",0x5BA3],
- ["CAD2",0x5BA4],
- ["E5B6",0x5BA5],
- ["BBC2",0x5BA6],
- ["8C68",0x5BA7],
- ["8C69",0x5BA8],
- ["8C6A",0x5BA9],
- ["CFDC",0x5BAA],
- ["B9AC",0x5BAB],
- ["8C6B",0x5BAC],
- ["8C6C",0x5BAD],
- ["8C6D",0x5BAE],
- ["8C6E",0x5BAF],
- ["D4D7",0x5BB0],
- ["8C6F",0x5BB1],
- ["8C70",0x5BB2],
- ["BAA6",0x5BB3],
- ["D1E7",0x5BB4],
- ["CFFC",0x5BB5],
- ["BCD2",0x5BB6],
- ["8C71",0x5BB7],
- ["E5B7",0x5BB8],
- ["C8DD",0x5BB9],
- ["8C72",0x5BBA],
- ["8C73",0x5BBB],
- ["8C74",0x5BBC],
- ["BFED",0x5BBD],
- ["B1F6",0x5BBE],
- ["CBDE",0x5BBF],
- ["8C75",0x5BC0],
- ["8C76",0x5BC1],
- ["BCC5",0x5BC2],
- ["8C77",0x5BC3],
- ["BCC4",0x5BC4],
- ["D2FA",0x5BC5],
- ["C3DC",0x5BC6],
- ["BFDC",0x5BC7],
- ["8C78",0x5BC8],
- ["8C79",0x5BC9],
- ["8C7A",0x5BCA],
- ["8C7B",0x5BCB],
- ["B8BB",0x5BCC],
- ["8C7C",0x5BCD],
- ["8C7D",0x5BCE],
- ["8C7E",0x5BCF],
- ["C3C2",0x5BD0],
- ["8C80",0x5BD1],
- ["BAAE",0x5BD2],
- ["D4A2",0x5BD3],
- ["8C81",0x5BD4],
- ["8C82",0x5BD5],
- ["8C83",0x5BD6],
- ["8C84",0x5BD7],
- ["8C85",0x5BD8],
- ["8C86",0x5BD9],
- ["8C87",0x5BDA],
- ["8C88",0x5BDB],
- ["8C89",0x5BDC],
- ["C7DE",0x5BDD],
- ["C4AF",0x5BDE],
- ["B2EC",0x5BDF],
- ["8C8A",0x5BE0],
- ["B9D1",0x5BE1],
- ["8C8B",0x5BE2],
- ["8C8C",0x5BE3],
- ["E5BB",0x5BE4],
- ["C1C8",0x5BE5],
- ["8C8D",0x5BE6],
- ["8C8E",0x5BE7],
- ["D5AF",0x5BE8],
- ["8C8F",0x5BE9],
- ["8C90",0x5BEA],
- ["8C91",0x5BEB],
- ["8C92",0x5BEC],
- ["8C93",0x5BED],
- ["E5BC",0x5BEE],
- ["8C94",0x5BEF],
- ["E5BE",0x5BF0],
- ["8C95",0x5BF1],
- ["8C96",0x5BF2],
- ["8C97",0x5BF3],
- ["8C98",0x5BF4],
- ["8C99",0x5BF5],
- ["8C9A",0x5BF6],
- ["8C9B",0x5BF7],
- ["B4E7",0x5BF8],
- ["B6D4",0x5BF9],
- ["CBC2",0x5BFA],
- ["D1B0",0x5BFB],
- ["B5BC",0x5BFC],
- ["8C9C",0x5BFD],
- ["8C9D",0x5BFE],
- ["CAD9",0x5BFF],
- ["8C9E",0x5C00],
- ["B7E2",0x5C01],
- ["8C9F",0x5C02],
- ["8CA0",0x5C03],
- ["C9E4",0x5C04],
- ["8CA1",0x5C05],
- ["BDAB",0x5C06],
- ["8CA2",0x5C07],
- ["8CA3",0x5C08],
- ["CEBE",0x5C09],
- ["D7F0",0x5C0A],
- ["8CA4",0x5C0B],
- ["8CA5",0x5C0C],
- ["8CA6",0x5C0D],
- ["8CA7",0x5C0E],
- ["D0A1",0x5C0F],
- ["8CA8",0x5C10],
- ["C9D9",0x5C11],
- ["8CA9",0x5C12],
- ["8CAA",0x5C13],
- ["B6FB",0x5C14],
- ["E6D8",0x5C15],
- ["BCE2",0x5C16],
- ["8CAB",0x5C17],
- ["B3BE",0x5C18],
- ["8CAC",0x5C19],
- ["C9D0",0x5C1A],
- ["8CAD",0x5C1B],
- ["E6D9",0x5C1C],
- ["B3A2",0x5C1D],
- ["8CAE",0x5C1E],
- ["8CAF",0x5C1F],
- ["8CB0",0x5C20],
- ["8CB1",0x5C21],
- ["DECC",0x5C22],
- ["8CB2",0x5C23],
- ["D3C8",0x5C24],
- ["DECD",0x5C25],
- ["8CB3",0x5C26],
- ["D2A2",0x5C27],
- ["8CB4",0x5C28],
- ["8CB5",0x5C29],
- ["8CB6",0x5C2A],
- ["8CB7",0x5C2B],
- ["DECE",0x5C2C],
- ["8CB8",0x5C2D],
- ["8CB9",0x5C2E],
- ["8CBA",0x5C2F],
- ["8CBB",0x5C30],
- ["BECD",0x5C31],
- ["8CBC",0x5C32],
- ["8CBD",0x5C33],
- ["DECF",0x5C34],
- ["8CBE",0x5C35],
- ["8CBF",0x5C36],
- ["8CC0",0x5C37],
- ["CAAC",0x5C38],
- ["D2FC",0x5C39],
- ["B3DF",0x5C3A],
- ["E5EA",0x5C3B],
- ["C4E1",0x5C3C],
- ["BEA1",0x5C3D],
- ["CEB2",0x5C3E],
- ["C4F2",0x5C3F],
- ["BED6",0x5C40],
- ["C6A8",0x5C41],
- ["B2E3",0x5C42],
- ["8CC1",0x5C43],
- ["8CC2",0x5C44],
- ["BED3",0x5C45],
- ["8CC3",0x5C46],
- ["8CC4",0x5C47],
- ["C7FC",0x5C48],
- ["CCEB",0x5C49],
- ["BDEC",0x5C4A],
- ["CEDD",0x5C4B],
- ["8CC5",0x5C4C],
- ["8CC6",0x5C4D],
- ["CABA",0x5C4E],
- ["C6C1",0x5C4F],
- ["E5EC",0x5C50],
- ["D0BC",0x5C51],
- ["8CC7",0x5C52],
- ["8CC8",0x5C53],
- ["8CC9",0x5C54],
- ["D5B9",0x5C55],
- ["8CCA",0x5C56],
- ["8CCB",0x5C57],
- ["8CCC",0x5C58],
- ["E5ED",0x5C59],
- ["8CCD",0x5C5A],
- ["8CCE",0x5C5B],
- ["8CCF",0x5C5C],
- ["8CD0",0x5C5D],
- ["CAF4",0x5C5E],
- ["8CD1",0x5C5F],
- ["CDC0",0x5C60],
- ["C2C5",0x5C61],
- ["8CD2",0x5C62],
- ["E5EF",0x5C63],
- ["8CD3",0x5C64],
- ["C2C4",0x5C65],
- ["E5F0",0x5C66],
- ["8CD4",0x5C67],
- ["8CD5",0x5C68],
- ["8CD6",0x5C69],
- ["8CD7",0x5C6A],
- ["8CD8",0x5C6B],
- ["8CD9",0x5C6C],
- ["8CDA",0x5C6D],
- ["E5F8",0x5C6E],
- ["CDCD",0x5C6F],
- ["8CDB",0x5C70],
- ["C9BD",0x5C71],
- ["8CDC",0x5C72],
- ["8CDD",0x5C73],
- ["8CDE",0x5C74],
- ["8CDF",0x5C75],
- ["8CE0",0x5C76],
- ["8CE1",0x5C77],
- ["8CE2",0x5C78],
- ["D2D9",0x5C79],
- ["E1A8",0x5C7A],
- ["8CE3",0x5C7B],
- ["8CE4",0x5C7C],
- ["8CE5",0x5C7D],
- ["8CE6",0x5C7E],
- ["D3EC",0x5C7F],
- ["8CE7",0x5C80],
- ["CBEA",0x5C81],
- ["C6F1",0x5C82],
- ["8CE8",0x5C83],
- ["8CE9",0x5C84],
- ["8CEA",0x5C85],
- ["8CEB",0x5C86],
- ["8CEC",0x5C87],
- ["E1AC",0x5C88],
- ["8CED",0x5C89],
- ["8CEE",0x5C8A],
- ["8CEF",0x5C8B],
- ["E1A7",0x5C8C],
- ["E1A9",0x5C8D],
- ["8CF0",0x5C8E],
- ["8CF1",0x5C8F],
- ["E1AA",0x5C90],
- ["E1AF",0x5C91],
- ["8CF2",0x5C92],
- ["8CF3",0x5C93],
- ["B2ED",0x5C94],
- ["8CF4",0x5C95],
- ["E1AB",0x5C96],
- ["B8DA",0x5C97],
- ["E1AD",0x5C98],
- ["E1AE",0x5C99],
- ["E1B0",0x5C9A],
- ["B5BA",0x5C9B],
- ["E1B1",0x5C9C],
- ["8CF5",0x5C9D],
- ["8CF6",0x5C9E],
- ["8CF7",0x5C9F],
- ["8CF8",0x5CA0],
- ["8CF9",0x5CA1],
- ["E1B3",0x5CA2],
- ["E1B8",0x5CA3],
- ["8CFA",0x5CA4],
- ["8CFB",0x5CA5],
- ["8CFC",0x5CA6],
- ["8CFD",0x5CA7],
- ["8CFE",0x5CA8],
- ["D1D2",0x5CA9],
- ["8D40",0x5CAA],
- ["E1B6",0x5CAB],
- ["E1B5",0x5CAC],
- ["C1EB",0x5CAD],
- ["8D41",0x5CAE],
- ["8D42",0x5CAF],
- ["8D43",0x5CB0],
- ["E1B7",0x5CB1],
- ["8D44",0x5CB2],
- ["D4C0",0x5CB3],
- ["8D45",0x5CB4],
- ["E1B2",0x5CB5],
- ["8D46",0x5CB6],
- ["E1BA",0x5CB7],
- ["B0B6",0x5CB8],
- ["8D47",0x5CB9],
- ["8D48",0x5CBA],
- ["8D49",0x5CBB],
- ["8D4A",0x5CBC],
- ["E1B4",0x5CBD],
- ["8D4B",0x5CBE],
- ["BFF9",0x5CBF],
- ["8D4C",0x5CC0],
- ["E1B9",0x5CC1],
- ["8D4D",0x5CC2],
- ["8D4E",0x5CC3],
- ["E1BB",0x5CC4],
- ["8D4F",0x5CC5],
- ["8D50",0x5CC6],
- ["8D51",0x5CC7],
- ["8D52",0x5CC8],
- ["8D53",0x5CC9],
- ["8D54",0x5CCA],
- ["E1BE",0x5CCB],
- ["8D55",0x5CCC],
- ["8D56",0x5CCD],
- ["8D57",0x5CCE],
- ["8D58",0x5CCF],
- ["8D59",0x5CD0],
- ["8D5A",0x5CD1],
- ["E1BC",0x5CD2],
- ["8D5B",0x5CD3],
- ["8D5C",0x5CD4],
- ["8D5D",0x5CD5],
- ["8D5E",0x5CD6],
- ["8D5F",0x5CD7],
- ["8D60",0x5CD8],
- ["D6C5",0x5CD9],
- ["8D61",0x5CDA],
- ["8D62",0x5CDB],
- ["8D63",0x5CDC],
- ["8D64",0x5CDD],
- ["8D65",0x5CDE],
- ["8D66",0x5CDF],
- ["8D67",0x5CE0],
- ["CFBF",0x5CE1],
- ["8D68",0x5CE2],
- ["8D69",0x5CE3],
- ["E1BD",0x5CE4],
- ["E1BF",0x5CE5],
- ["C2CD",0x5CE6],
- ["8D6A",0x5CE7],
- ["B6EB",0x5CE8],
- ["8D6B",0x5CE9],
- ["D3F8",0x5CEA],
- ["8D6C",0x5CEB],
- ["8D6D",0x5CEC],
- ["C7CD",0x5CED],
- ["8D6E",0x5CEE],
- ["8D6F",0x5CEF],
- ["B7E5",0x5CF0],
- ["8D70",0x5CF1],
- ["8D71",0x5CF2],
- ["8D72",0x5CF3],
- ["8D73",0x5CF4],
- ["8D74",0x5CF5],
- ["8D75",0x5CF6],
- ["8D76",0x5CF7],
- ["8D77",0x5CF8],
- ["8D78",0x5CF9],
- ["8D79",0x5CFA],
- ["BEFE",0x5CFB],
- ["8D7A",0x5CFC],
- ["8D7B",0x5CFD],
- ["8D7C",0x5CFE],
- ["8D7D",0x5CFF],
- ["8D7E",0x5D00],
- ["8D80",0x5D01],
- ["E1C0",0x5D02],
- ["E1C1",0x5D03],
- ["8D81",0x5D04],
- ["8D82",0x5D05],
- ["E1C7",0x5D06],
- ["B3E7",0x5D07],
- ["8D83",0x5D08],
- ["8D84",0x5D09],
- ["8D85",0x5D0A],
- ["8D86",0x5D0B],
- ["8D87",0x5D0C],
- ["8D88",0x5D0D],
- ["C6E9",0x5D0E],
- ["8D89",0x5D0F],
- ["8D8A",0x5D10],
- ["8D8B",0x5D11],
- ["8D8C",0x5D12],
- ["8D8D",0x5D13],
- ["B4DE",0x5D14],
- ["8D8E",0x5D15],
- ["D1C2",0x5D16],
- ["8D8F",0x5D17],
- ["8D90",0x5D18],
- ["8D91",0x5D19],
- ["8D92",0x5D1A],
- ["E1C8",0x5D1B],
- ["8D93",0x5D1C],
- ["8D94",0x5D1D],
- ["E1C6",0x5D1E],
- ["8D95",0x5D1F],
- ["8D96",0x5D20],
- ["8D97",0x5D21],
- ["8D98",0x5D22],
- ["8D99",0x5D23],
- ["E1C5",0x5D24],
- ["8D9A",0x5D25],
- ["E1C3",0x5D26],
- ["E1C2",0x5D27],
- ["8D9B",0x5D28],
- ["B1C0",0x5D29],
- ["8D9C",0x5D2A],
- ["8D9D",0x5D2B],
- ["8D9E",0x5D2C],
- ["D5B8",0x5D2D],
- ["E1C4",0x5D2E],
- ["8D9F",0x5D2F],
- ["8DA0",0x5D30],
- ["8DA1",0x5D31],
- ["8DA2",0x5D32],
- ["8DA3",0x5D33],
- ["E1CB",0x5D34],
- ["8DA4",0x5D35],
- ["8DA5",0x5D36],
- ["8DA6",0x5D37],
- ["8DA7",0x5D38],
- ["8DA8",0x5D39],
- ["8DA9",0x5D3A],
- ["8DAA",0x5D3B],
- ["8DAB",0x5D3C],
- ["E1CC",0x5D3D],
- ["E1CA",0x5D3E],
- ["8DAC",0x5D3F],
- ["8DAD",0x5D40],
- ["8DAE",0x5D41],
- ["8DAF",0x5D42],
- ["8DB0",0x5D43],
- ["8DB1",0x5D44],
- ["8DB2",0x5D45],
- ["8DB3",0x5D46],
- ["EFFA",0x5D47],
- ["8DB4",0x5D48],
- ["8DB5",0x5D49],
- ["E1D3",0x5D4A],
- ["E1D2",0x5D4B],
- ["C7B6",0x5D4C],
- ["8DB6",0x5D4D],
- ["8DB7",0x5D4E],
- ["8DB8",0x5D4F],
- ["8DB9",0x5D50],
- ["8DBA",0x5D51],
- ["8DBB",0x5D52],
- ["8DBC",0x5D53],
- ["8DBD",0x5D54],
- ["8DBE",0x5D55],
- ["8DBF",0x5D56],
- ["8DC0",0x5D57],
- ["E1C9",0x5D58],
- ["8DC1",0x5D59],
- ["8DC2",0x5D5A],
- ["E1CE",0x5D5B],
- ["8DC3",0x5D5C],
- ["E1D0",0x5D5D],
- ["8DC4",0x5D5E],
- ["8DC5",0x5D5F],
- ["8DC6",0x5D60],
- ["8DC7",0x5D61],
- ["8DC8",0x5D62],
- ["8DC9",0x5D63],
- ["8DCA",0x5D64],
- ["8DCB",0x5D65],
- ["8DCC",0x5D66],
- ["8DCD",0x5D67],
- ["8DCE",0x5D68],
- ["E1D4",0x5D69],
- ["8DCF",0x5D6A],
- ["E1D1",0x5D6B],
- ["E1CD",0x5D6C],
- ["8DD0",0x5D6D],
- ["8DD1",0x5D6E],
- ["E1CF",0x5D6F],
- ["8DD2",0x5D70],
- ["8DD3",0x5D71],
- ["8DD4",0x5D72],
- ["8DD5",0x5D73],
- ["E1D5",0x5D74],
- ["8DD6",0x5D75],
- ["8DD7",0x5D76],
- ["8DD8",0x5D77],
- ["8DD9",0x5D78],
- ["8DDA",0x5D79],
- ["8DDB",0x5D7A],
- ["8DDC",0x5D7B],
- ["8DDD",0x5D7C],
- ["8DDE",0x5D7D],
- ["8DDF",0x5D7E],
- ["8DE0",0x5D7F],
- ["8DE1",0x5D80],
- ["8DE2",0x5D81],
- ["E1D6",0x5D82],
- ["8DE3",0x5D83],
- ["8DE4",0x5D84],
- ["8DE5",0x5D85],
- ["8DE6",0x5D86],
- ["8DE7",0x5D87],
- ["8DE8",0x5D88],
- ["8DE9",0x5D89],
- ["8DEA",0x5D8A],
- ["8DEB",0x5D8B],
- ["8DEC",0x5D8C],
- ["8DED",0x5D8D],
- ["8DEE",0x5D8E],
- ["8DEF",0x5D8F],
- ["8DF0",0x5D90],
- ["8DF1",0x5D91],
- ["8DF2",0x5D92],
- ["8DF3",0x5D93],
- ["8DF4",0x5D94],
- ["8DF5",0x5D95],
- ["8DF6",0x5D96],
- ["8DF7",0x5D97],
- ["8DF8",0x5D98],
- ["E1D7",0x5D99],
- ["8DF9",0x5D9A],
- ["8DFA",0x5D9B],
- ["8DFB",0x5D9C],
- ["E1D8",0x5D9D],
- ["8DFC",0x5D9E],
- ["8DFD",0x5D9F],
- ["8DFE",0x5DA0],
- ["8E40",0x5DA1],
- ["8E41",0x5DA2],
- ["8E42",0x5DA3],
- ["8E43",0x5DA4],
- ["8E44",0x5DA5],
- ["8E45",0x5DA6],
- ["8E46",0x5DA7],
- ["8E47",0x5DA8],
- ["8E48",0x5DA9],
- ["8E49",0x5DAA],
- ["8E4A",0x5DAB],
- ["8E4B",0x5DAC],
- ["8E4C",0x5DAD],
- ["8E4D",0x5DAE],
- ["8E4E",0x5DAF],
- ["8E4F",0x5DB0],
- ["8E50",0x5DB1],
- ["8E51",0x5DB2],
- ["8E52",0x5DB3],
- ["8E53",0x5DB4],
- ["8E54",0x5DB5],
- ["8E55",0x5DB6],
- ["E1DA",0x5DB7],
- ["8E56",0x5DB8],
- ["8E57",0x5DB9],
- ["8E58",0x5DBA],
- ["8E59",0x5DBB],
- ["8E5A",0x5DBC],
- ["8E5B",0x5DBD],
- ["8E5C",0x5DBE],
- ["8E5D",0x5DBF],
- ["8E5E",0x5DC0],
- ["8E5F",0x5DC1],
- ["8E60",0x5DC2],
- ["8E61",0x5DC3],
- ["8E62",0x5DC4],
- ["E1DB",0x5DC5],
- ["8E63",0x5DC6],
- ["8E64",0x5DC7],
- ["8E65",0x5DC8],
- ["8E66",0x5DC9],
- ["8E67",0x5DCA],
- ["8E68",0x5DCB],
- ["8E69",0x5DCC],
- ["CEA1",0x5DCD],
- ["8E6A",0x5DCE],
- ["8E6B",0x5DCF],
- ["8E6C",0x5DD0],
- ["8E6D",0x5DD1],
- ["8E6E",0x5DD2],
- ["8E6F",0x5DD3],
- ["8E70",0x5DD4],
- ["8E71",0x5DD5],
- ["8E72",0x5DD6],
- ["8E73",0x5DD7],
- ["8E74",0x5DD8],
- ["8E75",0x5DD9],
- ["8E76",0x5DDA],
- ["E7DD",0x5DDB],
- ["8E77",0x5DDC],
- ["B4A8",0x5DDD],
- ["D6DD",0x5DDE],
- ["8E78",0x5DDF],
- ["8E79",0x5DE0],
- ["D1B2",0x5DE1],
- ["B3B2",0x5DE2],
- ["8E7A",0x5DE3],
- ["8E7B",0x5DE4],
- ["B9A4",0x5DE5],
- ["D7F3",0x5DE6],
- ["C7C9",0x5DE7],
- ["BEDE",0x5DE8],
- ["B9AE",0x5DE9],
- ["8E7C",0x5DEA],
- ["CED7",0x5DEB],
- ["8E7D",0x5DEC],
- ["8E7E",0x5DED],
- ["B2EE",0x5DEE],
- ["DBCF",0x5DEF],
- ["8E80",0x5DF0],
- ["BCBA",0x5DF1],
- ["D2D1",0x5DF2],
- ["CBC8",0x5DF3],
- ["B0CD",0x5DF4],
- ["8E81",0x5DF5],
- ["8E82",0x5DF6],
- ["CFEF",0x5DF7],
- ["8E83",0x5DF8],
- ["8E84",0x5DF9],
- ["8E85",0x5DFA],
- ["8E86",0x5DFB],
- ["8E87",0x5DFC],
- ["D9E3",0x5DFD],
- ["BDED",0x5DFE],
- ["8E88",0x5DFF],
- ["8E89",0x5E00],
- ["B1D2",0x5E01],
- ["CAD0",0x5E02],
- ["B2BC",0x5E03],
- ["8E8A",0x5E04],
- ["CBA7",0x5E05],
- ["B7AB",0x5E06],
- ["8E8B",0x5E07],
- ["CAA6",0x5E08],
- ["8E8C",0x5E09],
- ["8E8D",0x5E0A],
- ["8E8E",0x5E0B],
- ["CFA3",0x5E0C],
- ["8E8F",0x5E0D],
- ["8E90",0x5E0E],
- ["E0F8",0x5E0F],
- ["D5CA",0x5E10],
- ["E0FB",0x5E11],
- ["8E91",0x5E12],
- ["8E92",0x5E13],
- ["E0FA",0x5E14],
- ["C5C1",0x5E15],
- ["CCFB",0x5E16],
- ["8E93",0x5E17],
- ["C1B1",0x5E18],
- ["E0F9",0x5E19],
- ["D6E3",0x5E1A],
- ["B2AF",0x5E1B],
- ["D6C4",0x5E1C],
- ["B5DB",0x5E1D],
- ["8E94",0x5E1E],
- ["8E95",0x5E1F],
- ["8E96",0x5E20],
- ["8E97",0x5E21],
- ["8E98",0x5E22],
- ["8E99",0x5E23],
- ["8E9A",0x5E24],
- ["8E9B",0x5E25],
- ["B4F8",0x5E26],
- ["D6A1",0x5E27],
- ["8E9C",0x5E28],
- ["8E9D",0x5E29],
- ["8E9E",0x5E2A],
- ["8E9F",0x5E2B],
- ["8EA0",0x5E2C],
- ["CFAF",0x5E2D],
- ["B0EF",0x5E2E],
- ["8EA1",0x5E2F],
- ["8EA2",0x5E30],
- ["E0FC",0x5E31],
- ["8EA3",0x5E32],
- ["8EA4",0x5E33],
- ["8EA5",0x5E34],
- ["8EA6",0x5E35],
- ["8EA7",0x5E36],
- ["E1A1",0x5E37],
- ["B3A3",0x5E38],
- ["8EA8",0x5E39],
- ["8EA9",0x5E3A],
- ["E0FD",0x5E3B],
- ["E0FE",0x5E3C],
- ["C3B1",0x5E3D],
- ["8EAA",0x5E3E],
- ["8EAB",0x5E3F],
- ["8EAC",0x5E40],
- ["8EAD",0x5E41],
- ["C3DD",0x5E42],
- ["8EAE",0x5E43],
- ["E1A2",0x5E44],
- ["B7F9",0x5E45],
- ["8EAF",0x5E46],
- ["8EB0",0x5E47],
- ["8EB1",0x5E48],
- ["8EB2",0x5E49],
- ["8EB3",0x5E4A],
- ["8EB4",0x5E4B],
- ["BBCF",0x5E4C],
- ["8EB5",0x5E4D],
- ["8EB6",0x5E4E],
- ["8EB7",0x5E4F],
- ["8EB8",0x5E50],
- ["8EB9",0x5E51],
- ["8EBA",0x5E52],
- ["8EBB",0x5E53],
- ["E1A3",0x5E54],
- ["C4BB",0x5E55],
- ["8EBC",0x5E56],
- ["8EBD",0x5E57],
- ["8EBE",0x5E58],
- ["8EBF",0x5E59],
- ["8EC0",0x5E5A],
- ["E1A4",0x5E5B],
- ["8EC1",0x5E5C],
- ["8EC2",0x5E5D],
- ["E1A5",0x5E5E],
- ["8EC3",0x5E5F],
- ["8EC4",0x5E60],
- ["E1A6",0x5E61],
- ["B4B1",0x5E62],
- ["8EC5",0x5E63],
- ["8EC6",0x5E64],
- ["8EC7",0x5E65],
- ["8EC8",0x5E66],
- ["8EC9",0x5E67],
- ["8ECA",0x5E68],
- ["8ECB",0x5E69],
- ["8ECC",0x5E6A],
- ["8ECD",0x5E6B],
- ["8ECE",0x5E6C],
- ["8ECF",0x5E6D],
- ["8ED0",0x5E6E],
- ["8ED1",0x5E6F],
- ["8ED2",0x5E70],
- ["8ED3",0x5E71],
- ["B8C9",0x5E72],
- ["C6BD",0x5E73],
- ["C4EA",0x5E74],
- ["8ED4",0x5E75],
- ["B2A2",0x5E76],
- ["8ED5",0x5E77],
- ["D0D2",0x5E78],
- ["8ED6",0x5E79],
- ["E7DB",0x5E7A],
- ["BBC3",0x5E7B],
- ["D3D7",0x5E7C],
- ["D3C4",0x5E7D],
- ["8ED7",0x5E7E],
- ["B9E3",0x5E7F],
- ["E2CF",0x5E80],
- ["8ED8",0x5E81],
- ["8ED9",0x5E82],
- ["8EDA",0x5E83],
- ["D7AF",0x5E84],
- ["8EDB",0x5E85],
- ["C7EC",0x5E86],
- ["B1D3",0x5E87],
- ["8EDC",0x5E88],
- ["8EDD",0x5E89],
- ["B4B2",0x5E8A],
- ["E2D1",0x5E8B],
- ["8EDE",0x5E8C],
- ["8EDF",0x5E8D],
- ["8EE0",0x5E8E],
- ["D0F2",0x5E8F],
- ["C2AE",0x5E90],
- ["E2D0",0x5E91],
- ["8EE1",0x5E92],
- ["BFE2",0x5E93],
- ["D3A6",0x5E94],
- ["B5D7",0x5E95],
- ["E2D2",0x5E96],
- ["B5EA",0x5E97],
- ["8EE2",0x5E98],
- ["C3ED",0x5E99],
- ["B8FD",0x5E9A],
- ["8EE3",0x5E9B],
- ["B8AE",0x5E9C],
- ["8EE4",0x5E9D],
- ["C5D3",0x5E9E],
- ["B7CF",0x5E9F],
- ["E2D4",0x5EA0],
- ["8EE5",0x5EA1],
- ["8EE6",0x5EA2],
- ["8EE7",0x5EA3],
- ["8EE8",0x5EA4],
- ["E2D3",0x5EA5],
- ["B6C8",0x5EA6],
- ["D7F9",0x5EA7],
- ["8EE9",0x5EA8],
- ["8EEA",0x5EA9],
- ["8EEB",0x5EAA],
- ["8EEC",0x5EAB],
- ["8EED",0x5EAC],
- ["CDA5",0x5EAD],
- ["8EEE",0x5EAE],
- ["8EEF",0x5EAF],
- ["8EF0",0x5EB0],
- ["8EF1",0x5EB1],
- ["8EF2",0x5EB2],
- ["E2D8",0x5EB3],
- ["8EF3",0x5EB4],
- ["E2D6",0x5EB5],
- ["CAFC",0x5EB6],
- ["BFB5",0x5EB7],
- ["D3B9",0x5EB8],
- ["E2D5",0x5EB9],
- ["8EF4",0x5EBA],
- ["8EF5",0x5EBB],
- ["8EF6",0x5EBC],
- ["8EF7",0x5EBD],
- ["E2D7",0x5EBE],
- ["8EF8",0x5EBF],
- ["8EF9",0x5EC0],
- ["8EFA",0x5EC1],
- ["8EFB",0x5EC2],
- ["8EFC",0x5EC3],
- ["8EFD",0x5EC4],
- ["8EFE",0x5EC5],
- ["8F40",0x5EC6],
- ["8F41",0x5EC7],
- ["8F42",0x5EC8],
- ["C1AE",0x5EC9],
- ["C0C8",0x5ECA],
- ["8F43",0x5ECB],
- ["8F44",0x5ECC],
- ["8F45",0x5ECD],
- ["8F46",0x5ECE],
- ["8F47",0x5ECF],
- ["8F48",0x5ED0],
- ["E2DB",0x5ED1],
- ["E2DA",0x5ED2],
- ["C0AA",0x5ED3],
- ["8F49",0x5ED4],
- ["8F4A",0x5ED5],
- ["C1CE",0x5ED6],
- ["8F4B",0x5ED7],
- ["8F4C",0x5ED8],
- ["8F4D",0x5ED9],
- ["8F4E",0x5EDA],
- ["E2DC",0x5EDB],
- ["8F4F",0x5EDC],
- ["8F50",0x5EDD],
- ["8F51",0x5EDE],
- ["8F52",0x5EDF],
- ["8F53",0x5EE0],
- ["8F54",0x5EE1],
- ["8F55",0x5EE2],
- ["8F56",0x5EE3],
- ["8F57",0x5EE4],
- ["8F58",0x5EE5],
- ["8F59",0x5EE6],
- ["8F5A",0x5EE7],
- ["E2DD",0x5EE8],
- ["8F5B",0x5EE9],
- ["E2DE",0x5EEA],
- ["8F5C",0x5EEB],
- ["8F5D",0x5EEC],
- ["8F5E",0x5EED],
- ["8F5F",0x5EEE],
- ["8F60",0x5EEF],
- ["8F61",0x5EF0],
- ["8F62",0x5EF1],
- ["8F63",0x5EF2],
- ["8F64",0x5EF3],
- ["DBC8",0x5EF4],
- ["8F65",0x5EF5],
- ["D1D3",0x5EF6],
- ["CDA2",0x5EF7],
- ["8F66",0x5EF8],
- ["8F67",0x5EF9],
- ["BDA8",0x5EFA],
- ["8F68",0x5EFB],
- ["8F69",0x5EFC],
- ["8F6A",0x5EFD],
- ["DEC3",0x5EFE],
- ["D8A5",0x5EFF],
- ["BFAA",0x5F00],
- ["DBCD",0x5F01],
- ["D2EC",0x5F02],
- ["C6FA",0x5F03],
- ["C5AA",0x5F04],
- ["8F6B",0x5F05],
- ["8F6C",0x5F06],
- ["8F6D",0x5F07],
- ["DEC4",0x5F08],
- ["8F6E",0x5F09],
- ["B1D7",0x5F0A],
- ["DFAE",0x5F0B],
- ["8F6F",0x5F0C],
- ["8F70",0x5F0D],
- ["8F71",0x5F0E],
- ["CABD",0x5F0F],
- ["8F72",0x5F10],
- ["DFB1",0x5F11],
- ["8F73",0x5F12],
- ["B9AD",0x5F13],
- ["8F74",0x5F14],
- ["D2FD",0x5F15],
- ["8F75",0x5F16],
- ["B8A5",0x5F17],
- ["BAEB",0x5F18],
- ["8F76",0x5F19],
- ["8F77",0x5F1A],
- ["B3DA",0x5F1B],
- ["8F78",0x5F1C],
- ["8F79",0x5F1D],
- ["8F7A",0x5F1E],
- ["B5DC",0x5F1F],
- ["D5C5",0x5F20],
- ["8F7B",0x5F21],
- ["8F7C",0x5F22],
- ["8F7D",0x5F23],
- ["8F7E",0x5F24],
- ["C3D6",0x5F25],
- ["CFD2",0x5F26],
- ["BBA1",0x5F27],
- ["8F80",0x5F28],
- ["E5F3",0x5F29],
- ["E5F2",0x5F2A],
- ["8F81",0x5F2B],
- ["8F82",0x5F2C],
- ["E5F4",0x5F2D],
- ["8F83",0x5F2E],
- ["CDE4",0x5F2F],
- ["8F84",0x5F30],
- ["C8F5",0x5F31],
- ["8F85",0x5F32],
- ["8F86",0x5F33],
- ["8F87",0x5F34],
- ["8F88",0x5F35],
- ["8F89",0x5F36],
- ["8F8A",0x5F37],
- ["8F8B",0x5F38],
- ["B5AF",0x5F39],
- ["C7BF",0x5F3A],
- ["8F8C",0x5F3B],
- ["E5F6",0x5F3C],
- ["8F8D",0x5F3D],
- ["8F8E",0x5F3E],
- ["8F8F",0x5F3F],
- ["ECB0",0x5F40],
- ["8F90",0x5F41],
- ["8F91",0x5F42],
- ["8F92",0x5F43],
- ["8F93",0x5F44],
- ["8F94",0x5F45],
- ["8F95",0x5F46],
- ["8F96",0x5F47],
- ["8F97",0x5F48],
- ["8F98",0x5F49],
- ["8F99",0x5F4A],
- ["8F9A",0x5F4B],
- ["8F9B",0x5F4C],
- ["8F9C",0x5F4D],
- ["8F9D",0x5F4E],
- ["8F9E",0x5F4F],
- ["E5E6",0x5F50],
- ["8F9F",0x5F51],
- ["B9E9",0x5F52],
- ["B5B1",0x5F53],
- ["8FA0",0x5F54],
- ["C2BC",0x5F55],
- ["E5E8",0x5F56],
- ["E5E7",0x5F57],
- ["E5E9",0x5F58],
- ["8FA1",0x5F59],
- ["8FA2",0x5F5A],
- ["8FA3",0x5F5B],
- ["8FA4",0x5F5C],
- ["D2CD",0x5F5D],
- ["8FA5",0x5F5E],
- ["8FA6",0x5F5F],
- ["8FA7",0x5F60],
- ["E1EA",0x5F61],
- ["D0CE",0x5F62],
- ["8FA8",0x5F63],
- ["CDAE",0x5F64],
- ["8FA9",0x5F65],
- ["D1E5",0x5F66],
- ["8FAA",0x5F67],
- ["8FAB",0x5F68],
- ["B2CA",0x5F69],
- ["B1EB",0x5F6A],
- ["8FAC",0x5F6B],
- ["B1F2",0x5F6C],
- ["C5ED",0x5F6D],
- ["8FAD",0x5F6E],
- ["8FAE",0x5F6F],
- ["D5C3",0x5F70],
- ["D3B0",0x5F71],
- ["8FAF",0x5F72],
- ["E1DC",0x5F73],
- ["8FB0",0x5F74],
- ["8FB1",0x5F75],
- ["8FB2",0x5F76],
- ["E1DD",0x5F77],
- ["8FB3",0x5F78],
- ["D2DB",0x5F79],
- ["8FB4",0x5F7A],
- ["B3B9",0x5F7B],
- ["B1CB",0x5F7C],
- ["8FB5",0x5F7D],
- ["8FB6",0x5F7E],
- ["8FB7",0x5F7F],
- ["CDF9",0x5F80],
- ["D5F7",0x5F81],
- ["E1DE",0x5F82],
- ["8FB8",0x5F83],
- ["BEB6",0x5F84],
- ["B4FD",0x5F85],
- ["8FB9",0x5F86],
- ["E1DF",0x5F87],
- ["BADC",0x5F88],
- ["E1E0",0x5F89],
- ["BBB2",0x5F8A],
- ["C2C9",0x5F8B],
- ["E1E1",0x5F8C],
- ["8FBA",0x5F8D],
- ["8FBB",0x5F8E],
- ["8FBC",0x5F8F],
- ["D0EC",0x5F90],
- ["8FBD",0x5F91],
- ["CDBD",0x5F92],
- ["8FBE",0x5F93],
- ["8FBF",0x5F94],
- ["E1E2",0x5F95],
- ["8FC0",0x5F96],
- ["B5C3",0x5F97],
- ["C5C7",0x5F98],
- ["E1E3",0x5F99],
- ["8FC1",0x5F9A],
- ["8FC2",0x5F9B],
- ["E1E4",0x5F9C],
- ["8FC3",0x5F9D],
- ["8FC4",0x5F9E],
- ["8FC5",0x5F9F],
- ["8FC6",0x5FA0],
- ["D3F9",0x5FA1],
- ["8FC7",0x5FA2],
- ["8FC8",0x5FA3],
- ["8FC9",0x5FA4],
- ["8FCA",0x5FA5],
- ["8FCB",0x5FA6],
- ["8FCC",0x5FA7],
- ["E1E5",0x5FA8],
- ["8FCD",0x5FA9],
- ["D1AD",0x5FAA],
- ["8FCE",0x5FAB],
- ["8FCF",0x5FAC],
- ["E1E6",0x5FAD],
- ["CEA2",0x5FAE],
- ["8FD0",0x5FAF],
- ["8FD1",0x5FB0],
- ["8FD2",0x5FB1],
- ["8FD3",0x5FB2],
- ["8FD4",0x5FB3],
- ["8FD5",0x5FB4],
- ["E1E7",0x5FB5],
- ["8FD6",0x5FB6],
- ["B5C2",0x5FB7],
- ["8FD7",0x5FB8],
- ["8FD8",0x5FB9],
- ["8FD9",0x5FBA],
- ["8FDA",0x5FBB],
- ["E1E8",0x5FBC],
- ["BBD5",0x5FBD],
- ["8FDB",0x5FBE],
- ["8FDC",0x5FBF],
- ["8FDD",0x5FC0],
- ["8FDE",0x5FC1],
- ["8FDF",0x5FC2],
- ["D0C4",0x5FC3],
- ["E2E0",0x5FC4],
- ["B1D8",0x5FC5],
- ["D2E4",0x5FC6],
- ["8FE0",0x5FC7],
- ["8FE1",0x5FC8],
- ["E2E1",0x5FC9],
- ["8FE2",0x5FCA],
- ["8FE3",0x5FCB],
- ["BCC9",0x5FCC],
- ["C8CC",0x5FCD],
- ["8FE4",0x5FCE],
- ["E2E3",0x5FCF],
- ["ECFE",0x5FD0],
- ["ECFD",0x5FD1],
- ["DFAF",0x5FD2],
- ["8FE5",0x5FD3],
- ["8FE6",0x5FD4],
- ["8FE7",0x5FD5],
- ["E2E2",0x5FD6],
- ["D6BE",0x5FD7],
- ["CDFC",0x5FD8],
- ["C3A6",0x5FD9],
- ["8FE8",0x5FDA],
- ["8FE9",0x5FDB],
- ["8FEA",0x5FDC],
- ["E3C3",0x5FDD],
- ["8FEB",0x5FDE],
- ["8FEC",0x5FDF],
- ["D6D2",0x5FE0],
- ["E2E7",0x5FE1],
- ["8FED",0x5FE2],
- ["8FEE",0x5FE3],
- ["E2E8",0x5FE4],
- ["8FEF",0x5FE5],
- ["8FF0",0x5FE6],
- ["D3C7",0x5FE7],
- ["8FF1",0x5FE8],
- ["8FF2",0x5FE9],
- ["E2EC",0x5FEA],
- ["BFEC",0x5FEB],
- ["8FF3",0x5FEC],
- ["E2ED",0x5FED],
- ["E2E5",0x5FEE],
- ["8FF4",0x5FEF],
- ["8FF5",0x5FF0],
- ["B3C0",0x5FF1],
- ["8FF6",0x5FF2],
- ["8FF7",0x5FF3],
- ["8FF8",0x5FF4],
- ["C4EE",0x5FF5],
- ["8FF9",0x5FF6],
- ["8FFA",0x5FF7],
- ["E2EE",0x5FF8],
- ["8FFB",0x5FF9],
- ["8FFC",0x5FFA],
- ["D0C3",0x5FFB],
- ["8FFD",0x5FFC],
- ["BAF6",0x5FFD],
- ["E2E9",0x5FFE],
- ["B7DE",0x5FFF],
- ["BBB3",0x6000],
- ["CCAC",0x6001],
- ["CBCB",0x6002],
- ["E2E4",0x6003],
- ["E2E6",0x6004],
- ["E2EA",0x6005],
- ["E2EB",0x6006],
- ["8FFE",0x6007],
- ["9040",0x6008],
- ["9041",0x6009],
- ["E2F7",0x600A],
- ["9042",0x600B],
- ["9043",0x600C],
- ["E2F4",0x600D],
- ["D4F5",0x600E],
- ["E2F3",0x600F],
- ["9044",0x6010],
- ["9045",0x6011],
- ["C5AD",0x6012],
- ["9046",0x6013],
- ["D5FA",0x6014],
- ["C5C2",0x6015],
- ["B2C0",0x6016],
- ["9047",0x6017],
- ["9048",0x6018],
- ["E2EF",0x6019],
- ["9049",0x601A],
- ["E2F2",0x601B],
- ["C1AF",0x601C],
- ["CBBC",0x601D],
- ["904A",0x601E],
- ["904B",0x601F],
- ["B5A1",0x6020],
- ["E2F9",0x6021],
- ["904C",0x6022],
- ["904D",0x6023],
- ["904E",0x6024],
- ["BCB1",0x6025],
- ["E2F1",0x6026],
- ["D0D4",0x6027],
- ["D4B9",0x6028],
- ["E2F5",0x6029],
- ["B9D6",0x602A],
- ["E2F6",0x602B],
- ["904F",0x602C],
- ["9050",0x602D],
- ["9051",0x602E],
- ["C7D3",0x602F],
- ["9052",0x6030],
- ["9053",0x6031],
- ["9054",0x6032],
- ["9055",0x6033],
- ["9056",0x6034],
- ["E2F0",0x6035],
- ["9057",0x6036],
- ["9058",0x6037],
- ["9059",0x6038],
- ["905A",0x6039],
- ["905B",0x603A],
- ["D7DC",0x603B],
- ["EDA1",0x603C],
- ["905C",0x603D],
- ["905D",0x603E],
- ["E2F8",0x603F],
- ["905E",0x6040],
- ["EDA5",0x6041],
- ["E2FE",0x6042],
- ["CAD1",0x6043],
- ["905F",0x6044],
- ["9060",0x6045],
- ["9061",0x6046],
- ["9062",0x6047],
- ["9063",0x6048],
- ["9064",0x6049],
- ["9065",0x604A],
- ["C1B5",0x604B],
- ["9066",0x604C],
- ["BBD0",0x604D],
- ["9067",0x604E],
- ["9068",0x604F],
- ["BFD6",0x6050],
- ["9069",0x6051],
- ["BAE3",0x6052],
- ["906A",0x6053],
- ["906B",0x6054],
- ["CBA1",0x6055],
- ["906C",0x6056],
- ["906D",0x6057],
- ["906E",0x6058],
- ["EDA6",0x6059],
- ["EDA3",0x605A],
- ["906F",0x605B],
- ["9070",0x605C],
- ["EDA2",0x605D],
- ["9071",0x605E],
- ["9072",0x605F],
- ["9073",0x6060],
- ["9074",0x6061],
- ["BBD6",0x6062],
- ["EDA7",0x6063],
- ["D0F4",0x6064],
- ["9075",0x6065],
- ["9076",0x6066],
- ["EDA4",0x6067],
- ["BADE",0x6068],
- ["B6F7",0x6069],
- ["E3A1",0x606A],
- ["B6B2",0x606B],
- ["CCF1",0x606C],
- ["B9A7",0x606D],
- ["9077",0x606E],
- ["CFA2",0x606F],
- ["C7A1",0x6070],
- ["9078",0x6071],
- ["9079",0x6072],
- ["BFD2",0x6073],
- ["907A",0x6074],
- ["907B",0x6075],
- ["B6F1",0x6076],
- ["907C",0x6077],
- ["E2FA",0x6078],
- ["E2FB",0x6079],
- ["E2FD",0x607A],
- ["E2FC",0x607B],
- ["C4D5",0x607C],
- ["E3A2",0x607D],
- ["907D",0x607E],
- ["D3C1",0x607F],
- ["907E",0x6080],
- ["9080",0x6081],
- ["9081",0x6082],
- ["E3A7",0x6083],
- ["C7C4",0x6084],
- ["9082",0x6085],
- ["9083",0x6086],
- ["9084",0x6087],
- ["9085",0x6088],
- ["CFA4",0x6089],
- ["9086",0x608A],
- ["9087",0x608B],
- ["E3A9",0x608C],
- ["BAB7",0x608D],
- ["9088",0x608E],
- ["9089",0x608F],
- ["908A",0x6090],
- ["908B",0x6091],
- ["E3A8",0x6092],
- ["908C",0x6093],
- ["BBDA",0x6094],
- ["908D",0x6095],
- ["E3A3",0x6096],
- ["908E",0x6097],
- ["908F",0x6098],
- ["9090",0x6099],
- ["E3A4",0x609A],
- ["E3AA",0x609B],
- ["9091",0x609C],
- ["E3A6",0x609D],
- ["9092",0x609E],
- ["CEF2",0x609F],
- ["D3C6",0x60A0],
- ["9093",0x60A1],
- ["9094",0x60A2],
- ["BBBC",0x60A3],
- ["9095",0x60A4],
- ["9096",0x60A5],
- ["D4C3",0x60A6],
- ["9097",0x60A7],
- ["C4FA",0x60A8],
- ["9098",0x60A9],
- ["9099",0x60AA],
- ["EDA8",0x60AB],
- ["D0FC",0x60AC],
- ["E3A5",0x60AD],
- ["909A",0x60AE],
- ["C3F5",0x60AF],
- ["909B",0x60B0],
- ["E3AD",0x60B1],
- ["B1AF",0x60B2],
- ["909C",0x60B3],
- ["E3B2",0x60B4],
- ["909D",0x60B5],
- ["909E",0x60B6],
- ["909F",0x60B7],
- ["BCC2",0x60B8],
- ["90A0",0x60B9],
- ["90A1",0x60BA],
- ["E3AC",0x60BB],
- ["B5BF",0x60BC],
- ["90A2",0x60BD],
- ["90A3",0x60BE],
- ["90A4",0x60BF],
- ["90A5",0x60C0],
- ["90A6",0x60C1],
- ["90A7",0x60C2],
- ["90A8",0x60C3],
- ["90A9",0x60C4],
- ["C7E9",0x60C5],
- ["E3B0",0x60C6],
- ["90AA",0x60C7],
- ["90AB",0x60C8],
- ["90AC",0x60C9],
- ["BEAA",0x60CA],
- ["CDEF",0x60CB],
- ["90AD",0x60CC],
- ["90AE",0x60CD],
- ["90AF",0x60CE],
- ["90B0",0x60CF],
- ["90B1",0x60D0],
- ["BBF3",0x60D1],
- ["90B2",0x60D2],
- ["90B3",0x60D3],
- ["90B4",0x60D4],
- ["CCE8",0x60D5],
- ["90B5",0x60D6],
- ["90B6",0x60D7],
- ["E3AF",0x60D8],
- ["90B7",0x60D9],
- ["E3B1",0x60DA],
- ["90B8",0x60DB],
- ["CFA7",0x60DC],
- ["E3AE",0x60DD],
- ["90B9",0x60DE],
- ["CEA9",0x60DF],
- ["BBDD",0x60E0],
- ["90BA",0x60E1],
- ["90BB",0x60E2],
- ["90BC",0x60E3],
- ["90BD",0x60E4],
- ["90BE",0x60E5],
- ["B5EB",0x60E6],
- ["BEE5",0x60E7],
- ["B2D2",0x60E8],
- ["B3CD",0x60E9],
- ["90BF",0x60EA],
- ["B1B9",0x60EB],
- ["E3AB",0x60EC],
- ["B2D1",0x60ED],
- ["B5AC",0x60EE],
- ["B9DF",0x60EF],
- ["B6E8",0x60F0],
- ["90C0",0x60F1],
- ["90C1",0x60F2],
- ["CFEB",0x60F3],
- ["E3B7",0x60F4],
- ["90C2",0x60F5],
- ["BBCC",0x60F6],
- ["90C3",0x60F7],
- ["90C4",0x60F8],
- ["C8C7",0x60F9],
- ["D0CA",0x60FA],
- ["90C5",0x60FB],
- ["90C6",0x60FC],
- ["90C7",0x60FD],
- ["90C8",0x60FE],
- ["90C9",0x60FF],
- ["E3B8",0x6100],
- ["B3EE",0x6101],
- ["90CA",0x6102],
- ["90CB",0x6103],
- ["90CC",0x6104],
- ["90CD",0x6105],
- ["EDA9",0x6106],
- ["90CE",0x6107],
- ["D3FA",0x6108],
- ["D3E4",0x6109],
- ["90CF",0x610A],
- ["90D0",0x610B],
- ["90D1",0x610C],
- ["EDAA",0x610D],
- ["E3B9",0x610E],
- ["D2E2",0x610F],
- ["90D2",0x6110],
- ["90D3",0x6111],
- ["90D4",0x6112],
- ["90D5",0x6113],
- ["90D6",0x6114],
- ["E3B5",0x6115],
- ["90D7",0x6116],
- ["90D8",0x6117],
- ["90D9",0x6118],
- ["90DA",0x6119],
- ["D3DE",0x611A],
- ["90DB",0x611B],
- ["90DC",0x611C],
- ["90DD",0x611D],
- ["90DE",0x611E],
- ["B8D0",0x611F],
- ["E3B3",0x6120],
- ["90DF",0x6121],
- ["90E0",0x6122],
- ["E3B6",0x6123],
- ["B7DF",0x6124],
- ["90E1",0x6125],
- ["E3B4",0x6126],
- ["C0A2",0x6127],
- ["90E2",0x6128],
- ["90E3",0x6129],
- ["90E4",0x612A],
- ["E3BA",0x612B],
- ["90E5",0x612C],
- ["90E6",0x612D],
- ["90E7",0x612E],
- ["90E8",0x612F],
- ["90E9",0x6130],
- ["90EA",0x6131],
- ["90EB",0x6132],
- ["90EC",0x6133],
- ["90ED",0x6134],
- ["90EE",0x6135],
- ["90EF",0x6136],
- ["90F0",0x6137],
- ["90F1",0x6138],
- ["90F2",0x6139],
- ["90F3",0x613A],
- ["90F4",0x613B],
- ["90F5",0x613C],
- ["90F6",0x613D],
- ["90F7",0x613E],
- ["D4B8",0x613F],
- ["90F8",0x6140],
- ["90F9",0x6141],
- ["90FA",0x6142],
- ["90FB",0x6143],
- ["90FC",0x6144],
- ["90FD",0x6145],
- ["90FE",0x6146],
- ["9140",0x6147],
- ["B4C8",0x6148],
- ["9141",0x6149],
- ["E3BB",0x614A],
- ["9142",0x614B],
- ["BBC5",0x614C],
- ["9143",0x614D],
- ["C9F7",0x614E],
- ["9144",0x614F],
- ["9145",0x6150],
- ["C9E5",0x6151],
- ["9146",0x6152],
- ["9147",0x6153],
- ["9148",0x6154],
- ["C4BD",0x6155],
- ["9149",0x6156],
- ["914A",0x6157],
- ["914B",0x6158],
- ["914C",0x6159],
- ["914D",0x615A],
- ["914E",0x615B],
- ["914F",0x615C],
- ["EDAB",0x615D],
- ["9150",0x615E],
- ["9151",0x615F],
- ["9152",0x6160],
- ["9153",0x6161],
- ["C2FD",0x6162],
- ["9154",0x6163],
- ["9155",0x6164],
- ["9156",0x6165],
- ["9157",0x6166],
- ["BBDB",0x6167],
- ["BFAE",0x6168],
- ["9158",0x6169],
- ["9159",0x616A],
- ["915A",0x616B],
- ["915B",0x616C],
- ["915C",0x616D],
- ["915D",0x616E],
- ["915E",0x616F],
- ["CEBF",0x6170],
- ["915F",0x6171],
- ["9160",0x6172],
- ["9161",0x6173],
- ["9162",0x6174],
- ["E3BC",0x6175],
- ["9163",0x6176],
- ["BFB6",0x6177],
- ["9164",0x6178],
- ["9165",0x6179],
- ["9166",0x617A],
- ["9167",0x617B],
- ["9168",0x617C],
- ["9169",0x617D],
- ["916A",0x617E],
- ["916B",0x617F],
- ["916C",0x6180],
- ["916D",0x6181],
- ["916E",0x6182],
- ["916F",0x6183],
- ["9170",0x6184],
- ["9171",0x6185],
- ["9172",0x6186],
- ["9173",0x6187],
- ["9174",0x6188],
- ["9175",0x6189],
- ["9176",0x618A],
- ["B1EF",0x618B],
- ["9177",0x618C],
- ["9178",0x618D],
- ["D4F7",0x618E],
- ["9179",0x618F],
- ["917A",0x6190],
- ["917B",0x6191],
- ["917C",0x6192],
- ["917D",0x6193],
- ["E3BE",0x6194],
- ["917E",0x6195],
- ["9180",0x6196],
- ["9181",0x6197],
- ["9182",0x6198],
- ["9183",0x6199],
- ["9184",0x619A],
- ["9185",0x619B],
- ["9186",0x619C],
- ["EDAD",0x619D],
- ["9187",0x619E],
- ["9188",0x619F],
- ["9189",0x61A0],
- ["918A",0x61A1],
- ["918B",0x61A2],
- ["918C",0x61A3],
- ["918D",0x61A4],
- ["918E",0x61A5],
- ["918F",0x61A6],
- ["E3BF",0x61A7],
- ["BAA9",0x61A8],
- ["EDAC",0x61A9],
- ["9190",0x61AA],
- ["9191",0x61AB],
- ["E3BD",0x61AC],
- ["9192",0x61AD],
- ["9193",0x61AE],
- ["9194",0x61AF],
- ["9195",0x61B0],
- ["9196",0x61B1],
- ["9197",0x61B2],
- ["9198",0x61B3],
- ["9199",0x61B4],
- ["919A",0x61B5],
- ["919B",0x61B6],
- ["E3C0",0x61B7],
- ["919C",0x61B8],
- ["919D",0x61B9],
- ["919E",0x61BA],
- ["919F",0x61BB],
- ["91A0",0x61BC],
- ["91A1",0x61BD],
- ["BAB6",0x61BE],
- ["91A2",0x61BF],
- ["91A3",0x61C0],
- ["91A4",0x61C1],
- ["B6AE",0x61C2],
- ["91A5",0x61C3],
- ["91A6",0x61C4],
- ["91A7",0x61C5],
- ["91A8",0x61C6],
- ["91A9",0x61C7],
- ["D0B8",0x61C8],
- ["91AA",0x61C9],
- ["B0C3",0x61CA],
- ["EDAE",0x61CB],
- ["91AB",0x61CC],
- ["91AC",0x61CD],
- ["91AD",0x61CE],
- ["91AE",0x61CF],
- ["91AF",0x61D0],
- ["EDAF",0x61D1],
- ["C0C1",0x61D2],
- ["91B0",0x61D3],
- ["E3C1",0x61D4],
- ["91B1",0x61D5],
- ["91B2",0x61D6],
- ["91B3",0x61D7],
- ["91B4",0x61D8],
- ["91B5",0x61D9],
- ["91B6",0x61DA],
- ["91B7",0x61DB],
- ["91B8",0x61DC],
- ["91B9",0x61DD],
- ["91BA",0x61DE],
- ["91BB",0x61DF],
- ["91BC",0x61E0],
- ["91BD",0x61E1],
- ["91BE",0x61E2],
- ["91BF",0x61E3],
- ["91C0",0x61E4],
- ["91C1",0x61E5],
- ["C5B3",0x61E6],
- ["91C2",0x61E7],
- ["91C3",0x61E8],
- ["91C4",0x61E9],
- ["91C5",0x61EA],
- ["91C6",0x61EB],
- ["91C7",0x61EC],
- ["91C8",0x61ED],
- ["91C9",0x61EE],
- ["91CA",0x61EF],
- ["91CB",0x61F0],
- ["91CC",0x61F1],
- ["91CD",0x61F2],
- ["91CE",0x61F3],
- ["91CF",0x61F4],
- ["E3C2",0x61F5],
- ["91D0",0x61F6],
- ["91D1",0x61F7],
- ["91D2",0x61F8],
- ["91D3",0x61F9],
- ["91D4",0x61FA],
- ["91D5",0x61FB],
- ["91D6",0x61FC],
- ["91D7",0x61FD],
- ["91D8",0x61FE],
- ["DCB2",0x61FF],
- ["91D9",0x6200],
- ["91DA",0x6201],
- ["91DB",0x6202],
- ["91DC",0x6203],
- ["91DD",0x6204],
- ["91DE",0x6205],
- ["EDB0",0x6206],
- ["91DF",0x6207],
- ["B8EA",0x6208],
- ["91E0",0x6209],
- ["CEEC",0x620A],
- ["EAA7",0x620B],
- ["D0E7",0x620C],
- ["CAF9",0x620D],
- ["C8D6",0x620E],
- ["CFB7",0x620F],
- ["B3C9",0x6210],
- ["CED2",0x6211],
- ["BDE4",0x6212],
- ["91E1",0x6213],
- ["91E2",0x6214],
- ["E3DE",0x6215],
- ["BBF2",0x6216],
- ["EAA8",0x6217],
- ["D5BD",0x6218],
- ["91E3",0x6219],
- ["C6DD",0x621A],
- ["EAA9",0x621B],
- ["91E4",0x621C],
- ["91E5",0x621D],
- ["91E6",0x621E],
- ["EAAA",0x621F],
- ["91E7",0x6220],
- ["EAAC",0x6221],
- ["EAAB",0x6222],
- ["91E8",0x6223],
- ["EAAE",0x6224],
- ["EAAD",0x6225],
- ["91E9",0x6226],
- ["91EA",0x6227],
- ["91EB",0x6228],
- ["91EC",0x6229],
- ["BDD8",0x622A],
- ["91ED",0x622B],
- ["EAAF",0x622C],
- ["91EE",0x622D],
- ["C2BE",0x622E],
- ["91EF",0x622F],
- ["91F0",0x6230],
- ["91F1",0x6231],
- ["91F2",0x6232],
- ["B4C1",0x6233],
- ["B4F7",0x6234],
- ["91F3",0x6235],
- ["91F4",0x6236],
- ["BBA7",0x6237],
- ["91F5",0x6238],
- ["91F6",0x6239],
- ["91F7",0x623A],
- ["91F8",0x623B],
- ["91F9",0x623C],
- ["ECE6",0x623D],
- ["ECE5",0x623E],
- ["B7BF",0x623F],
- ["CBF9",0x6240],
- ["B1E2",0x6241],
- ["91FA",0x6242],
- ["ECE7",0x6243],
- ["91FB",0x6244],
- ["91FC",0x6245],
- ["91FD",0x6246],
- ["C9C8",0x6247],
- ["ECE8",0x6248],
- ["ECE9",0x6249],
- ["91FE",0x624A],
- ["CAD6",0x624B],
- ["DED0",0x624C],
- ["B2C5",0x624D],
- ["D4FA",0x624E],
- ["9240",0x624F],
- ["9241",0x6250],
- ["C6CB",0x6251],
- ["B0C7",0x6252],
- ["B4F2",0x6253],
- ["C8D3",0x6254],
- ["9242",0x6255],
- ["9243",0x6256],
- ["9244",0x6257],
- ["CDD0",0x6258],
- ["9245",0x6259],
- ["9246",0x625A],
- ["BFB8",0x625B],
- ["9247",0x625C],
- ["9248",0x625D],
- ["9249",0x625E],
- ["924A",0x625F],
- ["924B",0x6260],
- ["924C",0x6261],
- ["924D",0x6262],
- ["BFDB",0x6263],
- ["924E",0x6264],
- ["924F",0x6265],
- ["C7A4",0x6266],
- ["D6B4",0x6267],
- ["9250",0x6268],
- ["C0A9",0x6269],
- ["DED1",0x626A],
- ["C9A8",0x626B],
- ["D1EF",0x626C],
- ["C5A4",0x626D],
- ["B0E7",0x626E],
- ["B3B6",0x626F],
- ["C8C5",0x6270],
- ["9251",0x6271],
- ["9252",0x6272],
- ["B0E2",0x6273],
- ["9253",0x6274],
- ["9254",0x6275],
- ["B7F6",0x6276],
- ["9255",0x6277],
- ["9256",0x6278],
- ["C5FA",0x6279],
- ["9257",0x627A],
- ["9258",0x627B],
- ["B6F3",0x627C],
- ["9259",0x627D],
- ["D5D2",0x627E],
- ["B3D0",0x627F],
- ["BCBC",0x6280],
- ["925A",0x6281],
- ["925B",0x6282],
- ["925C",0x6283],
- ["B3AD",0x6284],
- ["925D",0x6285],
- ["925E",0x6286],
- ["925F",0x6287],
- ["9260",0x6288],
- ["BEF1",0x6289],
- ["B0D1",0x628A],
- ["9261",0x628B],
- ["9262",0x628C],
- ["9263",0x628D],
- ["9264",0x628E],
- ["9265",0x628F],
- ["9266",0x6290],
- ["D2D6",0x6291],
- ["CAE3",0x6292],
- ["D7A5",0x6293],
- ["9267",0x6294],
- ["CDB6",0x6295],
- ["B6B6",0x6296],
- ["BFB9",0x6297],
- ["D5DB",0x6298],
- ["9268",0x6299],
- ["B8A7",0x629A],
- ["C5D7",0x629B],
- ["9269",0x629C],
- ["926A",0x629D],
- ["926B",0x629E],
- ["DED2",0x629F],
- ["BFD9",0x62A0],
- ["C2D5",0x62A1],
- ["C7C0",0x62A2],
- ["926C",0x62A3],
- ["BBA4",0x62A4],
- ["B1A8",0x62A5],
- ["926D",0x62A6],
- ["926E",0x62A7],
- ["C5EA",0x62A8],
- ["926F",0x62A9],
- ["9270",0x62AA],
- ["C5FB",0x62AB],
- ["CCA7",0x62AC],
- ["9271",0x62AD],
- ["9272",0x62AE],
- ["9273",0x62AF],
- ["9274",0x62B0],
- ["B1A7",0x62B1],
- ["9275",0x62B2],
- ["9276",0x62B3],
- ["9277",0x62B4],
- ["B5D6",0x62B5],
- ["9278",0x62B6],
- ["9279",0x62B7],
- ["927A",0x62B8],
- ["C4A8",0x62B9],
- ["927B",0x62BA],
- ["DED3",0x62BB],
- ["D1BA",0x62BC],
- ["B3E9",0x62BD],
- ["927C",0x62BE],
- ["C3F2",0x62BF],
- ["927D",0x62C0],
- ["927E",0x62C1],
- ["B7F7",0x62C2],
- ["9280",0x62C3],
- ["D6F4",0x62C4],
- ["B5A3",0x62C5],
- ["B2F0",0x62C6],
- ["C4B4",0x62C7],
- ["C4E9",0x62C8],
- ["C0AD",0x62C9],
- ["DED4",0x62CA],
- ["9281",0x62CB],
- ["B0E8",0x62CC],
- ["C5C4",0x62CD],
- ["C1E0",0x62CE],
- ["9282",0x62CF],
- ["B9D5",0x62D0],
- ["9283",0x62D1],
- ["BEDC",0x62D2],
- ["CDD8",0x62D3],
- ["B0CE",0x62D4],
- ["9284",0x62D5],
- ["CDCF",0x62D6],
- ["DED6",0x62D7],
- ["BED0",0x62D8],
- ["D7BE",0x62D9],
- ["DED5",0x62DA],
- ["D5D0",0x62DB],
- ["B0DD",0x62DC],
- ["9285",0x62DD],
- ["9286",0x62DE],
- ["C4E2",0x62DF],
- ["9287",0x62E0],
- ["9288",0x62E1],
- ["C2A3",0x62E2],
- ["BCF0",0x62E3],
- ["9289",0x62E4],
- ["D3B5",0x62E5],
- ["C0B9",0x62E6],
- ["C5A1",0x62E7],
- ["B2A6",0x62E8],
- ["D4F1",0x62E9],
- ["928A",0x62EA],
- ["928B",0x62EB],
- ["C0A8",0x62EC],
- ["CAC3",0x62ED],
- ["DED7",0x62EE],
- ["D5FC",0x62EF],
- ["928C",0x62F0],
- ["B9B0",0x62F1],
- ["928D",0x62F2],
- ["C8AD",0x62F3],
- ["CBA9",0x62F4],
- ["928E",0x62F5],
- ["DED9",0x62F6],
- ["BFBD",0x62F7],
- ["928F",0x62F8],
- ["9290",0x62F9],
- ["9291",0x62FA],
- ["9292",0x62FB],
- ["C6B4",0x62FC],
- ["D7A7",0x62FD],
- ["CAB0",0x62FE],
- ["C4C3",0x62FF],
- ["9293",0x6300],
- ["B3D6",0x6301],
- ["B9D2",0x6302],
- ["9294",0x6303],
- ["9295",0x6304],
- ["9296",0x6305],
- ["9297",0x6306],
- ["D6B8",0x6307],
- ["EAFC",0x6308],
- ["B0B4",0x6309],
- ["9298",0x630A],
- ["9299",0x630B],
- ["929A",0x630C],
- ["929B",0x630D],
- ["BFE6",0x630E],
- ["929C",0x630F],
- ["929D",0x6310],
- ["CCF4",0x6311],
- ["929E",0x6312],
- ["929F",0x6313],
- ["92A0",0x6314],
- ["92A1",0x6315],
- ["CDDA",0x6316],
- ["92A2",0x6317],
- ["92A3",0x6318],
- ["92A4",0x6319],
- ["D6BF",0x631A],
- ["C2CE",0x631B],
- ["92A5",0x631C],
- ["CECE",0x631D],
- ["CCA2",0x631E],
- ["D0AE",0x631F],
- ["C4D3",0x6320],
- ["B5B2",0x6321],
- ["DED8",0x6322],
- ["D5F5",0x6323],
- ["BCB7",0x6324],
- ["BBD3",0x6325],
- ["92A6",0x6326],
- ["92A7",0x6327],
- ["B0A4",0x6328],
- ["92A8",0x6329],
- ["C5B2",0x632A],
- ["B4EC",0x632B],
- ["92A9",0x632C],
- ["92AA",0x632D],
- ["92AB",0x632E],
- ["D5F1",0x632F],
- ["92AC",0x6330],
- ["92AD",0x6331],
- ["EAFD",0x6332],
- ["92AE",0x6333],
- ["92AF",0x6334],
- ["92B0",0x6335],
- ["92B1",0x6336],
- ["92B2",0x6337],
- ["92B3",0x6338],
- ["DEDA",0x6339],
- ["CDA6",0x633A],
- ["92B4",0x633B],
- ["92B5",0x633C],
- ["CDEC",0x633D],
- ["92B6",0x633E],
- ["92B7",0x633F],
- ["92B8",0x6340],
- ["92B9",0x6341],
- ["CEE6",0x6342],
- ["DEDC",0x6343],
- ["92BA",0x6344],
- ["CDB1",0x6345],
- ["C0A6",0x6346],
- ["92BB",0x6347],
- ["92BC",0x6348],
- ["D7BD",0x6349],
- ["92BD",0x634A],
- ["DEDB",0x634B],
- ["B0C6",0x634C],
- ["BAB4",0x634D],
- ["C9D3",0x634E],
- ["C4F3",0x634F],
- ["BEE8",0x6350],
- ["92BE",0x6351],
- ["92BF",0x6352],
- ["92C0",0x6353],
- ["92C1",0x6354],
- ["B2B6",0x6355],
- ["92C2",0x6356],
- ["92C3",0x6357],
- ["92C4",0x6358],
- ["92C5",0x6359],
- ["92C6",0x635A],
- ["92C7",0x635B],
- ["92C8",0x635C],
- ["92C9",0x635D],
- ["C0CC",0x635E],
- ["CBF0",0x635F],
- ["92CA",0x6360],
- ["BCF1",0x6361],
- ["BBBB",0x6362],
- ["B5B7",0x6363],
- ["92CB",0x6364],
- ["92CC",0x6365],
- ["92CD",0x6366],
- ["C5F5",0x6367],
- ["92CE",0x6368],
- ["DEE6",0x6369],
- ["92CF",0x636A],
- ["92D0",0x636B],
- ["92D1",0x636C],
- ["DEE3",0x636D],
- ["BEDD",0x636E],
- ["92D2",0x636F],
- ["92D3",0x6370],
- ["DEDF",0x6371],
- ["92D4",0x6372],
- ["92D5",0x6373],
- ["92D6",0x6374],
- ["92D7",0x6375],
- ["B4B7",0x6376],
- ["BDDD",0x6377],
- ["92D8",0x6378],
- ["92D9",0x6379],
- ["DEE0",0x637A],
- ["C4ED",0x637B],
- ["92DA",0x637C],
- ["92DB",0x637D],
- ["92DC",0x637E],
- ["92DD",0x637F],
- ["CFC6",0x6380],
- ["92DE",0x6381],
- ["B5E0",0x6382],
- ["92DF",0x6383],
- ["92E0",0x6384],
- ["92E1",0x6385],
- ["92E2",0x6386],
- ["B6DE",0x6387],
- ["CADA",0x6388],
- ["B5F4",0x6389],
- ["DEE5",0x638A],
- ["92E3",0x638B],
- ["D5C6",0x638C],
- ["92E4",0x638D],
- ["DEE1",0x638E],
- ["CCCD",0x638F],
- ["C6FE",0x6390],
- ["92E5",0x6391],
- ["C5C5",0x6392],
- ["92E6",0x6393],
- ["92E7",0x6394],
- ["92E8",0x6395],
- ["D2B4",0x6396],
- ["92E9",0x6397],
- ["BEF2",0x6398],
- ["92EA",0x6399],
- ["92EB",0x639A],
- ["92EC",0x639B],
- ["92ED",0x639C],
- ["92EE",0x639D],
- ["92EF",0x639E],
- ["92F0",0x639F],
- ["C2D3",0x63A0],
- ["92F1",0x63A1],
- ["CCBD",0x63A2],
- ["B3B8",0x63A3],
- ["92F2",0x63A4],
- ["BDD3",0x63A5],
- ["92F3",0x63A6],
- ["BFD8",0x63A7],
- ["CDC6",0x63A8],
- ["D1DA",0x63A9],
- ["B4EB",0x63AA],
- ["92F4",0x63AB],
- ["DEE4",0x63AC],
- ["DEDD",0x63AD],
- ["DEE7",0x63AE],
- ["92F5",0x63AF],
- ["EAFE",0x63B0],
- ["92F6",0x63B1],
- ["92F7",0x63B2],
- ["C2B0",0x63B3],
- ["DEE2",0x63B4],
- ["92F8",0x63B5],
- ["92F9",0x63B6],
- ["D6C0",0x63B7],
- ["B5A7",0x63B8],
- ["92FA",0x63B9],
- ["B2F4",0x63BA],
- ["92FB",0x63BB],
- ["DEE8",0x63BC],
- ["92FC",0x63BD],
- ["DEF2",0x63BE],
- ["92FD",0x63BF],
- ["92FE",0x63C0],
- ["9340",0x63C1],
- ["9341",0x63C2],
- ["9342",0x63C3],
- ["DEED",0x63C4],
- ["9343",0x63C5],
- ["DEF1",0x63C6],
- ["9344",0x63C7],
- ["9345",0x63C8],
- ["C8E0",0x63C9],
- ["9346",0x63CA],
- ["9347",0x63CB],
- ["9348",0x63CC],
- ["D7E1",0x63CD],
- ["DEEF",0x63CE],
- ["C3E8",0x63CF],
- ["CCE1",0x63D0],
- ["9349",0x63D1],
- ["B2E5",0x63D2],
- ["934A",0x63D3],
- ["934B",0x63D4],
- ["934C",0x63D5],
- ["D2BE",0x63D6],
- ["934D",0x63D7],
- ["934E",0x63D8],
- ["934F",0x63D9],
- ["9350",0x63DA],
- ["9351",0x63DB],
- ["9352",0x63DC],
- ["9353",0x63DD],
- ["DEEE",0x63DE],
- ["9354",0x63DF],
- ["DEEB",0x63E0],
- ["CED5",0x63E1],
- ["9355",0x63E2],
- ["B4A7",0x63E3],
- ["9356",0x63E4],
- ["9357",0x63E5],
- ["9358",0x63E6],
- ["9359",0x63E7],
- ["935A",0x63E8],
- ["BFAB",0x63E9],
- ["BEBE",0x63EA],
- ["935B",0x63EB],
- ["935C",0x63EC],
- ["BDD2",0x63ED],
- ["935D",0x63EE],
- ["935E",0x63EF],
- ["935F",0x63F0],
- ["9360",0x63F1],
- ["DEE9",0x63F2],
- ["9361",0x63F3],
- ["D4AE",0x63F4],
- ["9362",0x63F5],
- ["DEDE",0x63F6],
- ["9363",0x63F7],
- ["DEEA",0x63F8],
- ["9364",0x63F9],
- ["9365",0x63FA],
- ["9366",0x63FB],
- ["9367",0x63FC],
- ["C0BF",0x63FD],
- ["9368",0x63FE],
- ["DEEC",0x63FF],
- ["B2F3",0x6400],
- ["B8E9",0x6401],
- ["C2A7",0x6402],
- ["9369",0x6403],
- ["936A",0x6404],
- ["BDC1",0x6405],
- ["936B",0x6406],
- ["936C",0x6407],
- ["936D",0x6408],
- ["936E",0x6409],
- ["936F",0x640A],
- ["DEF5",0x640B],
- ["DEF8",0x640C],
- ["9370",0x640D],
- ["9371",0x640E],
- ["B2AB",0x640F],
- ["B4A4",0x6410],
- ["9372",0x6411],
- ["9373",0x6412],
- ["B4EA",0x6413],
- ["C9A6",0x6414],
- ["9374",0x6415],
- ["9375",0x6416],
- ["9376",0x6417],
- ["9377",0x6418],
- ["9378",0x6419],
- ["9379",0x641A],
- ["DEF6",0x641B],
- ["CBD1",0x641C],
- ["937A",0x641D],
- ["B8E3",0x641E],
- ["937B",0x641F],
- ["DEF7",0x6420],
- ["DEFA",0x6421],
- ["937C",0x6422],
- ["937D",0x6423],
- ["937E",0x6424],
- ["9380",0x6425],
- ["DEF9",0x6426],
- ["9381",0x6427],
- ["9382",0x6428],
- ["9383",0x6429],
- ["CCC2",0x642A],
- ["9384",0x642B],
- ["B0E1",0x642C],
- ["B4EE",0x642D],
- ["9385",0x642E],
- ["9386",0x642F],
- ["9387",0x6430],
- ["9388",0x6431],
- ["9389",0x6432],
- ["938A",0x6433],
- ["E5BA",0x6434],
- ["938B",0x6435],
- ["938C",0x6436],
- ["938D",0x6437],
- ["938E",0x6438],
- ["938F",0x6439],
- ["D0AF",0x643A],
- ["9390",0x643B],
- ["9391",0x643C],
- ["B2EB",0x643D],
- ["9392",0x643E],
- ["EBA1",0x643F],
- ["9393",0x6440],
- ["DEF4",0x6441],
- ["9394",0x6442],
- ["9395",0x6443],
- ["C9E3",0x6444],
- ["DEF3",0x6445],
- ["B0DA",0x6446],
- ["D2A1",0x6447],
- ["B1F7",0x6448],
- ["9396",0x6449],
- ["CCAF",0x644A],
- ["9397",0x644B],
- ["9398",0x644C],
- ["9399",0x644D],
- ["939A",0x644E],
- ["939B",0x644F],
- ["939C",0x6450],
- ["939D",0x6451],
- ["DEF0",0x6452],
- ["939E",0x6453],
- ["CBA4",0x6454],
- ["939F",0x6455],
- ["93A0",0x6456],
- ["93A1",0x6457],
- ["D5AA",0x6458],
- ["93A2",0x6459],
- ["93A3",0x645A],
- ["93A4",0x645B],
- ["93A5",0x645C],
- ["93A6",0x645D],
- ["DEFB",0x645E],
- ["93A7",0x645F],
- ["93A8",0x6460],
- ["93A9",0x6461],
- ["93AA",0x6462],
- ["93AB",0x6463],
- ["93AC",0x6464],
- ["93AD",0x6465],
- ["93AE",0x6466],
- ["B4DD",0x6467],
- ["93AF",0x6468],
- ["C4A6",0x6469],
- ["93B0",0x646A],
- ["93B1",0x646B],
- ["93B2",0x646C],
- ["DEFD",0x646D],
- ["93B3",0x646E],
- ["93B4",0x646F],
- ["93B5",0x6470],
- ["93B6",0x6471],
- ["93B7",0x6472],
- ["93B8",0x6473],
- ["93B9",0x6474],
- ["93BA",0x6475],
- ["93BB",0x6476],
- ["93BC",0x6477],
- ["C3FE",0x6478],
- ["C4A1",0x6479],
- ["DFA1",0x647A],
- ["93BD",0x647B],
- ["93BE",0x647C],
- ["93BF",0x647D],
- ["93C0",0x647E],
- ["93C1",0x647F],
- ["93C2",0x6480],
- ["93C3",0x6481],
- ["C1CC",0x6482],
- ["93C4",0x6483],
- ["DEFC",0x6484],
- ["BEEF",0x6485],
- ["93C5",0x6486],
- ["C6B2",0x6487],
- ["93C6",0x6488],
- ["93C7",0x6489],
- ["93C8",0x648A],
- ["93C9",0x648B],
- ["93CA",0x648C],
- ["93CB",0x648D],
- ["93CC",0x648E],
- ["93CD",0x648F],
- ["93CE",0x6490],
- ["B3C5",0x6491],
- ["C8F6",0x6492],
- ["93CF",0x6493],
- ["93D0",0x6494],
- ["CBBA",0x6495],
- ["DEFE",0x6496],
- ["93D1",0x6497],
- ["93D2",0x6498],
- ["DFA4",0x6499],
- ["93D3",0x649A],
- ["93D4",0x649B],
- ["93D5",0x649C],
- ["93D6",0x649D],
- ["D7B2",0x649E],
- ["93D7",0x649F],
- ["93D8",0x64A0],
- ["93D9",0x64A1],
- ["93DA",0x64A2],
- ["93DB",0x64A3],
- ["B3B7",0x64A4],
- ["93DC",0x64A5],
- ["93DD",0x64A6],
- ["93DE",0x64A7],
- ["93DF",0x64A8],
- ["C1C3",0x64A9],
- ["93E0",0x64AA],
- ["93E1",0x64AB],
- ["C7CB",0x64AC],
- ["B2A5",0x64AD],
- ["B4E9",0x64AE],
- ["93E2",0x64AF],
- ["D7AB",0x64B0],
- ["93E3",0x64B1],
- ["93E4",0x64B2],
- ["93E5",0x64B3],
- ["93E6",0x64B4],
- ["C4EC",0x64B5],
- ["93E7",0x64B6],
- ["DFA2",0x64B7],
- ["DFA3",0x64B8],
- ["93E8",0x64B9],
- ["DFA5",0x64BA],
- ["93E9",0x64BB],
- ["BAB3",0x64BC],
- ["93EA",0x64BD],
- ["93EB",0x64BE],
- ["93EC",0x64BF],
- ["DFA6",0x64C0],
- ["93ED",0x64C1],
- ["C0DE",0x64C2],
- ["93EE",0x64C3],
- ["93EF",0x64C4],
- ["C9C3",0x64C5],
- ["93F0",0x64C6],
- ["93F1",0x64C7],
- ["93F2",0x64C8],
- ["93F3",0x64C9],
- ["93F4",0x64CA],
- ["93F5",0x64CB],
- ["93F6",0x64CC],
- ["B2D9",0x64CD],
- ["C7E6",0x64CE],
- ["93F7",0x64CF],
- ["DFA7",0x64D0],
- ["93F8",0x64D1],
- ["C7DC",0x64D2],
- ["93F9",0x64D3],
- ["93FA",0x64D4],
- ["93FB",0x64D5],
- ["93FC",0x64D6],
- ["DFA8",0x64D7],
- ["EBA2",0x64D8],
- ["93FD",0x64D9],
- ["93FE",0x64DA],
- ["9440",0x64DB],
- ["9441",0x64DC],
- ["9442",0x64DD],
- ["CBD3",0x64DE],
- ["9443",0x64DF],
- ["9444",0x64E0],
- ["9445",0x64E1],
- ["DFAA",0x64E2],
- ["9446",0x64E3],
- ["DFA9",0x64E4],
- ["9447",0x64E5],
- ["B2C1",0x64E6],
- ["9448",0x64E7],
- ["9449",0x64E8],
- ["944A",0x64E9],
- ["944B",0x64EA],
- ["944C",0x64EB],
- ["944D",0x64EC],
- ["944E",0x64ED],
- ["944F",0x64EE],
- ["9450",0x64EF],
- ["9451",0x64F0],
- ["9452",0x64F1],
- ["9453",0x64F2],
- ["9454",0x64F3],
- ["9455",0x64F4],
- ["9456",0x64F5],
- ["9457",0x64F6],
- ["9458",0x64F7],
- ["9459",0x64F8],
- ["945A",0x64F9],
- ["945B",0x64FA],
- ["945C",0x64FB],
- ["945D",0x64FC],
- ["945E",0x64FD],
- ["945F",0x64FE],
- ["9460",0x64FF],
- ["C5CA",0x6500],
- ["9461",0x6501],
- ["9462",0x6502],
- ["9463",0x6503],
- ["9464",0x6504],
- ["9465",0x6505],
- ["9466",0x6506],
- ["9467",0x6507],
- ["9468",0x6508],
- ["DFAB",0x6509],
- ["9469",0x650A],
- ["946A",0x650B],
- ["946B",0x650C],
- ["946C",0x650D],
- ["946D",0x650E],
- ["946E",0x650F],
- ["946F",0x6510],
- ["9470",0x6511],
- ["D4DC",0x6512],
- ["9471",0x6513],
- ["9472",0x6514],
- ["9473",0x6515],
- ["9474",0x6516],
- ["9475",0x6517],
- ["C8C1",0x6518],
- ["9476",0x6519],
- ["9477",0x651A],
- ["9478",0x651B],
- ["9479",0x651C],
- ["947A",0x651D],
- ["947B",0x651E],
- ["947C",0x651F],
- ["947D",0x6520],
- ["947E",0x6521],
- ["9480",0x6522],
- ["9481",0x6523],
- ["9482",0x6524],
- ["DFAC",0x6525],
- ["9483",0x6526],
- ["9484",0x6527],
- ["9485",0x6528],
- ["9486",0x6529],
- ["9487",0x652A],
- ["BEF0",0x652B],
- ["9488",0x652C],
- ["9489",0x652D],
- ["DFAD",0x652E],
- ["D6A7",0x652F],
- ["948A",0x6530],
- ["948B",0x6531],
- ["948C",0x6532],
- ["948D",0x6533],
- ["EAB7",0x6534],
- ["EBB6",0x6535],
- ["CAD5",0x6536],
- ["948E",0x6537],
- ["D8FC",0x6538],
- ["B8C4",0x6539],
- ["948F",0x653A],
- ["B9A5",0x653B],
- ["9490",0x653C],
- ["9491",0x653D],
- ["B7C5",0x653E],
- ["D5FE",0x653F],
- ["9492",0x6540],
- ["9493",0x6541],
- ["9494",0x6542],
- ["9495",0x6543],
- ["9496",0x6544],
- ["B9CA",0x6545],
- ["9497",0x6546],
- ["9498",0x6547],
- ["D0A7",0x6548],
- ["F4CD",0x6549],
- ["9499",0x654A],
- ["949A",0x654B],
- ["B5D0",0x654C],
- ["949B",0x654D],
- ["949C",0x654E],
- ["C3F4",0x654F],
- ["949D",0x6550],
- ["BEC8",0x6551],
- ["949E",0x6552],
- ["949F",0x6553],
- ["94A0",0x6554],
- ["EBB7",0x6555],
- ["B0BD",0x6556],
- ["94A1",0x6557],
- ["94A2",0x6558],
- ["BDCC",0x6559],
- ["94A3",0x655A],
- ["C1B2",0x655B],
- ["94A4",0x655C],
- ["B1D6",0x655D],
- ["B3A8",0x655E],
- ["94A5",0x655F],
- ["94A6",0x6560],
- ["94A7",0x6561],
- ["B8D2",0x6562],
- ["C9A2",0x6563],
- ["94A8",0x6564],
- ["94A9",0x6565],
- ["B6D8",0x6566],
- ["94AA",0x6567],
- ["94AB",0x6568],
- ["94AC",0x6569],
- ["94AD",0x656A],
- ["EBB8",0x656B],
- ["BEB4",0x656C],
- ["94AE",0x656D],
- ["94AF",0x656E],
- ["94B0",0x656F],
- ["CAFD",0x6570],
- ["94B1",0x6571],
- ["C7C3",0x6572],
- ["94B2",0x6573],
- ["D5FB",0x6574],
- ["94B3",0x6575],
- ["94B4",0x6576],
- ["B7F3",0x6577],
- ["94B5",0x6578],
- ["94B6",0x6579],
- ["94B7",0x657A],
- ["94B8",0x657B],
- ["94B9",0x657C],
- ["94BA",0x657D],
- ["94BB",0x657E],
- ["94BC",0x657F],
- ["94BD",0x6580],
- ["94BE",0x6581],
- ["94BF",0x6582],
- ["94C0",0x6583],
- ["94C1",0x6584],
- ["94C2",0x6585],
- ["94C3",0x6586],
- ["CEC4",0x6587],
- ["94C4",0x6588],
- ["94C5",0x6589],
- ["94C6",0x658A],
- ["D5AB",0x658B],
- ["B1F3",0x658C],
- ["94C7",0x658D],
- ["94C8",0x658E],
- ["94C9",0x658F],
- ["ECB3",0x6590],
- ["B0DF",0x6591],
- ["94CA",0x6592],
- ["ECB5",0x6593],
- ["94CB",0x6594],
- ["94CC",0x6595],
- ["94CD",0x6596],
- ["B6B7",0x6597],
- ["94CE",0x6598],
- ["C1CF",0x6599],
- ["94CF",0x659A],
- ["F5FA",0x659B],
- ["D0B1",0x659C],
- ["94D0",0x659D],
- ["94D1",0x659E],
- ["D5E5",0x659F],
- ["94D2",0x65A0],
- ["CED3",0x65A1],
- ["94D3",0x65A2],
- ["94D4",0x65A3],
- ["BDEF",0x65A4],
- ["B3E2",0x65A5],
- ["94D5",0x65A6],
- ["B8AB",0x65A7],
- ["94D6",0x65A8],
- ["D5B6",0x65A9],
- ["94D7",0x65AA],
- ["EDBD",0x65AB],
- ["94D8",0x65AC],
- ["B6CF",0x65AD],
- ["94D9",0x65AE],
- ["CBB9",0x65AF],
- ["D0C2",0x65B0],
- ["94DA",0x65B1],
- ["94DB",0x65B2],
- ["94DC",0x65B3],
- ["94DD",0x65B4],
- ["94DE",0x65B5],
- ["94DF",0x65B6],
- ["94E0",0x65B7],
- ["94E1",0x65B8],
- ["B7BD",0x65B9],
- ["94E2",0x65BA],
- ["94E3",0x65BB],
- ["ECB6",0x65BC],
- ["CAA9",0x65BD],
- ["94E4",0x65BE],
- ["94E5",0x65BF],
- ["94E6",0x65C0],
- ["C5D4",0x65C1],
- ["94E7",0x65C2],
- ["ECB9",0x65C3],
- ["ECB8",0x65C4],
- ["C2C3",0x65C5],
- ["ECB7",0x65C6],
- ["94E8",0x65C7],
- ["94E9",0x65C8],
- ["94EA",0x65C9],
- ["94EB",0x65CA],
- ["D0FD",0x65CB],
- ["ECBA",0x65CC],
- ["94EC",0x65CD],
- ["ECBB",0x65CE],
- ["D7E5",0x65CF],
- ["94ED",0x65D0],
- ["94EE",0x65D1],
- ["ECBC",0x65D2],
- ["94EF",0x65D3],
- ["94F0",0x65D4],
- ["94F1",0x65D5],
- ["ECBD",0x65D6],
- ["C6EC",0x65D7],
- ["94F2",0x65D8],
- ["94F3",0x65D9],
- ["94F4",0x65DA],
- ["94F5",0x65DB],
- ["94F6",0x65DC],
- ["94F7",0x65DD],
- ["94F8",0x65DE],
- ["94F9",0x65DF],
- ["CEDE",0x65E0],
- ["94FA",0x65E1],
- ["BCC8",0x65E2],
- ["94FB",0x65E3],
- ["94FC",0x65E4],
- ["C8D5",0x65E5],
- ["B5A9",0x65E6],
- ["BEC9",0x65E7],
- ["D6BC",0x65E8],
- ["D4E7",0x65E9],
- ["94FD",0x65EA],
- ["94FE",0x65EB],
- ["D1AE",0x65EC],
- ["D0F1",0x65ED],
- ["EAB8",0x65EE],
- ["EAB9",0x65EF],
- ["EABA",0x65F0],
- ["BAB5",0x65F1],
- ["9540",0x65F2],
- ["9541",0x65F3],
- ["9542",0x65F4],
- ["9543",0x65F5],
- ["CAB1",0x65F6],
- ["BFF5",0x65F7],
- ["9544",0x65F8],
- ["9545",0x65F9],
- ["CDFA",0x65FA],
- ["9546",0x65FB],
- ["9547",0x65FC],
- ["9548",0x65FD],
- ["9549",0x65FE],
- ["954A",0x65FF],
- ["EAC0",0x6600],
- ["954B",0x6601],
- ["B0BA",0x6602],
- ["EABE",0x6603],
- ["954C",0x6604],
- ["954D",0x6605],
- ["C0A5",0x6606],
- ["954E",0x6607],
- ["954F",0x6608],
- ["9550",0x6609],
- ["EABB",0x660A],
- ["9551",0x660B],
- ["B2FD",0x660C],
- ["9552",0x660D],
- ["C3F7",0x660E],
- ["BBE8",0x660F],
- ["9553",0x6610],
- ["9554",0x6611],
- ["9555",0x6612],
- ["D2D7",0x6613],
- ["CEF4",0x6614],
- ["EABF",0x6615],
- ["9556",0x6616],
- ["9557",0x6617],
- ["9558",0x6618],
- ["EABC",0x6619],
- ["9559",0x661A],
- ["955A",0x661B],
- ["955B",0x661C],
- ["EAC3",0x661D],
- ["955C",0x661E],
- ["D0C7",0x661F],
- ["D3B3",0x6620],
- ["955D",0x6621],
- ["955E",0x6622],
- ["955F",0x6623],
- ["9560",0x6624],
- ["B4BA",0x6625],
- ["9561",0x6626],
- ["C3C1",0x6627],
- ["D7F2",0x6628],
- ["9562",0x6629],
- ["9563",0x662A],
- ["9564",0x662B],
- ["9565",0x662C],
- ["D5D1",0x662D],
- ["9566",0x662E],
- ["CAC7",0x662F],
- ["9567",0x6630],
- ["EAC5",0x6631],
- ["9568",0x6632],
- ["9569",0x6633],
- ["EAC4",0x6634],
- ["EAC7",0x6635],
- ["EAC6",0x6636],
- ["956A",0x6637],
- ["956B",0x6638],
- ["956C",0x6639],
- ["956D",0x663A],
- ["956E",0x663B],
- ["D6E7",0x663C],
- ["956F",0x663D],
- ["CFD4",0x663E],
- ["9570",0x663F],
- ["9571",0x6640],
- ["EACB",0x6641],
- ["9572",0x6642],
- ["BBCE",0x6643],
- ["9573",0x6644],
- ["9574",0x6645],
- ["9575",0x6646],
- ["9576",0x6647],
- ["9577",0x6648],
- ["9578",0x6649],
- ["9579",0x664A],
- ["BDFA",0x664B],
- ["C9CE",0x664C],
- ["957A",0x664D],
- ["957B",0x664E],
- ["EACC",0x664F],
- ["957C",0x6650],
- ["957D",0x6651],
- ["C9B9",0x6652],
- ["CFFE",0x6653],
- ["EACA",0x6654],
- ["D4CE",0x6655],
- ["EACD",0x6656],
- ["EACF",0x6657],
- ["957E",0x6658],
- ["9580",0x6659],
- ["CDED",0x665A],
- ["9581",0x665B],
- ["9582",0x665C],
- ["9583",0x665D],
- ["9584",0x665E],
- ["EAC9",0x665F],
- ["9585",0x6660],
- ["EACE",0x6661],
- ["9586",0x6662],
- ["9587",0x6663],
- ["CEEE",0x6664],
- ["9588",0x6665],
- ["BBDE",0x6666],
- ["9589",0x6667],
- ["B3BF",0x6668],
- ["958A",0x6669],
- ["958B",0x666A],
- ["958C",0x666B],
- ["958D",0x666C],
- ["958E",0x666D],
- ["C6D5",0x666E],
- ["BEB0",0x666F],
- ["CEFA",0x6670],
- ["958F",0x6671],
- ["9590",0x6672],
- ["9591",0x6673],
- ["C7E7",0x6674],
- ["9592",0x6675],
- ["BEA7",0x6676],
- ["EAD0",0x6677],
- ["9593",0x6678],
- ["9594",0x6679],
- ["D6C7",0x667A],
- ["9595",0x667B],
- ["9596",0x667C],
- ["9597",0x667D],
- ["C1C0",0x667E],
- ["9598",0x667F],
- ["9599",0x6680],
- ["959A",0x6681],
- ["D4DD",0x6682],
- ["959B",0x6683],
- ["EAD1",0x6684],
- ["959C",0x6685],
- ["959D",0x6686],
- ["CFBE",0x6687],
- ["959E",0x6688],
- ["959F",0x6689],
- ["95A0",0x668A],
- ["95A1",0x668B],
- ["EAD2",0x668C],
- ["95A2",0x668D],
- ["95A3",0x668E],
- ["95A4",0x668F],
- ["95A5",0x6690],
- ["CAEE",0x6691],
- ["95A6",0x6692],
- ["95A7",0x6693],
- ["95A8",0x6694],
- ["95A9",0x6695],
- ["C5AF",0x6696],
- ["B0B5",0x6697],
- ["95AA",0x6698],
- ["95AB",0x6699],
- ["95AC",0x669A],
- ["95AD",0x669B],
- ["95AE",0x669C],
- ["EAD4",0x669D],
- ["95AF",0x669E],
- ["95B0",0x669F],
- ["95B1",0x66A0],
- ["95B2",0x66A1],
- ["95B3",0x66A2],
- ["95B4",0x66A3],
- ["95B5",0x66A4],
- ["95B6",0x66A5],
- ["95B7",0x66A6],
- ["EAD3",0x66A7],
- ["F4DF",0x66A8],
- ["95B8",0x66A9],
- ["95B9",0x66AA],
- ["95BA",0x66AB],
- ["95BB",0x66AC],
- ["95BC",0x66AD],
- ["C4BA",0x66AE],
- ["95BD",0x66AF],
- ["95BE",0x66B0],
- ["95BF",0x66B1],
- ["95C0",0x66B2],
- ["95C1",0x66B3],
- ["B1A9",0x66B4],
- ["95C2",0x66B5],
- ["95C3",0x66B6],
- ["95C4",0x66B7],
- ["95C5",0x66B8],
- ["E5DF",0x66B9],
- ["95C6",0x66BA],
- ["95C7",0x66BB],
- ["95C8",0x66BC],
- ["95C9",0x66BD],
- ["EAD5",0x66BE],
- ["95CA",0x66BF],
- ["95CB",0x66C0],
- ["95CC",0x66C1],
- ["95CD",0x66C2],
- ["95CE",0x66C3],
- ["95CF",0x66C4],
- ["95D0",0x66C5],
- ["95D1",0x66C6],
- ["95D2",0x66C7],
- ["95D3",0x66C8],
- ["95D4",0x66C9],
- ["95D5",0x66CA],
- ["95D6",0x66CB],
- ["95D7",0x66CC],
- ["95D8",0x66CD],
- ["95D9",0x66CE],
- ["95DA",0x66CF],
- ["95DB",0x66D0],
- ["95DC",0x66D1],
- ["95DD",0x66D2],
- ["95DE",0x66D3],
- ["95DF",0x66D4],
- ["95E0",0x66D5],
- ["95E1",0x66D6],
- ["95E2",0x66D7],
- ["95E3",0x66D8],
- ["CAEF",0x66D9],
- ["95E4",0x66DA],
- ["EAD6",0x66DB],
- ["EAD7",0x66DC],
- ["C6D8",0x66DD],
- ["95E5",0x66DE],
- ["95E6",0x66DF],
- ["95E7",0x66E0],
- ["95E8",0x66E1],
- ["95E9",0x66E2],
- ["95EA",0x66E3],
- ["95EB",0x66E4],
- ["95EC",0x66E5],
- ["EAD8",0x66E6],
- ["95ED",0x66E7],
- ["95EE",0x66E8],
- ["EAD9",0x66E9],
- ["95EF",0x66EA],
- ["95F0",0x66EB],
- ["95F1",0x66EC],
- ["95F2",0x66ED],
- ["95F3",0x66EE],
- ["95F4",0x66EF],
- ["D4BB",0x66F0],
- ["95F5",0x66F1],
- ["C7FA",0x66F2],
- ["D2B7",0x66F3],
- ["B8FC",0x66F4],
- ["95F6",0x66F5],
- ["95F7",0x66F6],
- ["EAC2",0x66F7],
- ["95F8",0x66F8],
- ["B2DC",0x66F9],
- ["95F9",0x66FA],
- ["95FA",0x66FB],
- ["C2FC",0x66FC],
- ["95FB",0x66FD],
- ["D4F8",0x66FE],
- ["CCE6",0x66FF],
- ["D7EE",0x6700],
- ["95FC",0x6701],
- ["95FD",0x6702],
- ["95FE",0x6703],
- ["9640",0x6704],
- ["9641",0x6705],
- ["9642",0x6706],
- ["9643",0x6707],
- ["D4C2",0x6708],
- ["D3D0",0x6709],
- ["EBC3",0x670A],
- ["C5F3",0x670B],
- ["9644",0x670C],
- ["B7FE",0x670D],
- ["9645",0x670E],
- ["9646",0x670F],
- ["EBD4",0x6710],
- ["9647",0x6711],
- ["9648",0x6712],
- ["9649",0x6713],
- ["CBB7",0x6714],
- ["EBDE",0x6715],
- ["964A",0x6716],
- ["C0CA",0x6717],
- ["964B",0x6718],
- ["964C",0x6719],
- ["964D",0x671A],
- ["CDFB",0x671B],
- ["964E",0x671C],
- ["B3AF",0x671D],
- ["964F",0x671E],
- ["C6DA",0x671F],
- ["9650",0x6720],
- ["9651",0x6721],
- ["9652",0x6722],
- ["9653",0x6723],
- ["9654",0x6724],
- ["9655",0x6725],
- ["EBFC",0x6726],
- ["9656",0x6727],
- ["C4BE",0x6728],
- ["9657",0x6729],
- ["CEB4",0x672A],
- ["C4A9",0x672B],
- ["B1BE",0x672C],
- ["D4FD",0x672D],
- ["9658",0x672E],
- ["CAF5",0x672F],
- ["9659",0x6730],
- ["D6EC",0x6731],
- ["965A",0x6732],
- ["965B",0x6733],
- ["C6D3",0x6734],
- ["B6E4",0x6735],
- ["965C",0x6736],
- ["965D",0x6737],
- ["965E",0x6738],
- ["965F",0x6739],
- ["BBFA",0x673A],
- ["9660",0x673B],
- ["9661",0x673C],
- ["D0E0",0x673D],
- ["9662",0x673E],
- ["9663",0x673F],
- ["C9B1",0x6740],
- ["9664",0x6741],
- ["D4D3",0x6742],
- ["C8A8",0x6743],
- ["9665",0x6744],
- ["9666",0x6745],
- ["B8CB",0x6746],
- ["9667",0x6747],
- ["E8BE",0x6748],
- ["C9BC",0x6749],
- ["9668",0x674A],
- ["9669",0x674B],
- ["E8BB",0x674C],
- ["966A",0x674D],
- ["C0EE",0x674E],
- ["D0D3",0x674F],
- ["B2C4",0x6750],
- ["B4E5",0x6751],
- ["966B",0x6752],
- ["E8BC",0x6753],
- ["966C",0x6754],
- ["966D",0x6755],
- ["D5C8",0x6756],
- ["966E",0x6757],
- ["966F",0x6758],
- ["9670",0x6759],
- ["9671",0x675A],
- ["9672",0x675B],
- ["B6C5",0x675C],
- ["9673",0x675D],
- ["E8BD",0x675E],
- ["CAF8",0x675F],
- ["B8DC",0x6760],
- ["CCF5",0x6761],
- ["9674",0x6762],
- ["9675",0x6763],
- ["9676",0x6764],
- ["C0B4",0x6765],
- ["9677",0x6766],
- ["9678",0x6767],
- ["D1EE",0x6768],
- ["E8BF",0x6769],
- ["E8C2",0x676A],
- ["9679",0x676B],
- ["967A",0x676C],
- ["BABC",0x676D],
- ["967B",0x676E],
- ["B1AD",0x676F],
- ["BDDC",0x6770],
- ["967C",0x6771],
- ["EABD",0x6772],
- ["E8C3",0x6773],
- ["967D",0x6774],
- ["E8C6",0x6775],
- ["967E",0x6776],
- ["E8CB",0x6777],
- ["9680",0x6778],
- ["9681",0x6779],
- ["9682",0x677A],
- ["9683",0x677B],
- ["E8CC",0x677C],
- ["9684",0x677D],
- ["CBC9",0x677E],
- ["B0E5",0x677F],
- ["9685",0x6780],
- ["BCAB",0x6781],
- ["9686",0x6782],
- ["9687",0x6783],
- ["B9B9",0x6784],
- ["9688",0x6785],
- ["9689",0x6786],
- ["E8C1",0x6787],
- ["968A",0x6788],
- ["CDF7",0x6789],
- ["968B",0x678A],
- ["E8CA",0x678B],
- ["968C",0x678C],
- ["968D",0x678D],
- ["968E",0x678E],
- ["968F",0x678F],
- ["CEF6",0x6790],
- ["9690",0x6791],
- ["9691",0x6792],
- ["9692",0x6793],
- ["9693",0x6794],
- ["D5ED",0x6795],
- ["9694",0x6796],
- ["C1D6",0x6797],
- ["E8C4",0x6798],
- ["9695",0x6799],
- ["C3B6",0x679A],
- ["9696",0x679B],
- ["B9FB",0x679C],
- ["D6A6",0x679D],
- ["E8C8",0x679E],
- ["9697",0x679F],
- ["9698",0x67A0],
- ["9699",0x67A1],
- ["CAE0",0x67A2],
- ["D4E6",0x67A3],
- ["969A",0x67A4],
- ["E8C0",0x67A5],
- ["969B",0x67A6],
- ["E8C5",0x67A7],
- ["E8C7",0x67A8],
- ["969C",0x67A9],
- ["C7B9",0x67AA],
- ["B7E3",0x67AB],
- ["969D",0x67AC],
- ["E8C9",0x67AD],
- ["969E",0x67AE],
- ["BFDD",0x67AF],
- ["E8D2",0x67B0],
- ["969F",0x67B1],
- ["96A0",0x67B2],
- ["E8D7",0x67B3],
- ["96A1",0x67B4],
- ["E8D5",0x67B5],
- ["BCDC",0x67B6],
- ["BCCF",0x67B7],
- ["E8DB",0x67B8],
- ["96A2",0x67B9],
- ["96A3",0x67BA],
- ["96A4",0x67BB],
- ["96A5",0x67BC],
- ["96A6",0x67BD],
- ["96A7",0x67BE],
- ["96A8",0x67BF],
- ["96A9",0x67C0],
- ["E8DE",0x67C1],
- ["96AA",0x67C2],
- ["E8DA",0x67C3],
- ["B1FA",0x67C4],
- ["96AB",0x67C5],
- ["96AC",0x67C6],
- ["96AD",0x67C7],
- ["96AE",0x67C8],
- ["96AF",0x67C9],
- ["96B0",0x67CA],
- ["96B1",0x67CB],
- ["96B2",0x67CC],
- ["96B3",0x67CD],
- ["96B4",0x67CE],
- ["B0D8",0x67CF],
- ["C4B3",0x67D0],
- ["B8CC",0x67D1],
- ["C6E2",0x67D2],
- ["C8BE",0x67D3],
- ["C8E1",0x67D4],
- ["96B5",0x67D5],
- ["96B6",0x67D6],
- ["96B7",0x67D7],
- ["E8CF",0x67D8],
- ["E8D4",0x67D9],
- ["E8D6",0x67DA],
- ["96B8",0x67DB],
- ["B9F1",0x67DC],
- ["E8D8",0x67DD],
- ["D7F5",0x67DE],
- ["96B9",0x67DF],
- ["C4FB",0x67E0],
- ["96BA",0x67E1],
- ["E8DC",0x67E2],
- ["96BB",0x67E3],
- ["96BC",0x67E4],
- ["B2E9",0x67E5],
- ["96BD",0x67E6],
- ["96BE",0x67E7],
- ["96BF",0x67E8],
- ["E8D1",0x67E9],
- ["96C0",0x67EA],
- ["96C1",0x67EB],
- ["BCED",0x67EC],
- ["96C2",0x67ED],
- ["96C3",0x67EE],
- ["BFC2",0x67EF],
- ["E8CD",0x67F0],
- ["D6F9",0x67F1],
- ["96C4",0x67F2],
- ["C1F8",0x67F3],
- ["B2F1",0x67F4],
- ["96C5",0x67F5],
- ["96C6",0x67F6],
- ["96C7",0x67F7],
- ["96C8",0x67F8],
- ["96C9",0x67F9],
- ["96CA",0x67FA],
- ["96CB",0x67FB],
- ["96CC",0x67FC],
- ["E8DF",0x67FD],
- ["96CD",0x67FE],
- ["CAC1",0x67FF],
- ["E8D9",0x6800],
- ["96CE",0x6801],
- ["96CF",0x6802],
- ["96D0",0x6803],
- ["96D1",0x6804],
- ["D5A4",0x6805],
- ["96D2",0x6806],
- ["B1EA",0x6807],
- ["D5BB",0x6808],
- ["E8CE",0x6809],
- ["E8D0",0x680A],
- ["B6B0",0x680B],
- ["E8D3",0x680C],
- ["96D3",0x680D],
- ["E8DD",0x680E],
- ["C0B8",0x680F],
- ["96D4",0x6810],
- ["CAF7",0x6811],
- ["96D5",0x6812],
- ["CBA8",0x6813],
- ["96D6",0x6814],
- ["96D7",0x6815],
- ["C6DC",0x6816],
- ["C0F5",0x6817],
- ["96D8",0x6818],
- ["96D9",0x6819],
- ["96DA",0x681A],
- ["96DB",0x681B],
- ["96DC",0x681C],
- ["E8E9",0x681D],
- ["96DD",0x681E],
- ["96DE",0x681F],
- ["96DF",0x6820],
- ["D0A3",0x6821],
- ["96E0",0x6822],
- ["96E1",0x6823],
- ["96E2",0x6824],
- ["96E3",0x6825],
- ["96E4",0x6826],
- ["96E5",0x6827],
- ["96E6",0x6828],
- ["E8F2",0x6829],
- ["D6EA",0x682A],
- ["96E7",0x682B],
- ["96E8",0x682C],
- ["96E9",0x682D],
- ["96EA",0x682E],
- ["96EB",0x682F],
- ["96EC",0x6830],
- ["96ED",0x6831],
- ["E8E0",0x6832],
- ["E8E1",0x6833],
- ["96EE",0x6834],
- ["96EF",0x6835],
- ["96F0",0x6836],
- ["D1F9",0x6837],
- ["BACB",0x6838],
- ["B8F9",0x6839],
- ["96F1",0x683A],
- ["96F2",0x683B],
- ["B8F1",0x683C],
- ["D4D4",0x683D],
- ["E8EF",0x683E],
- ["96F3",0x683F],
- ["E8EE",0x6840],
- ["E8EC",0x6841],
- ["B9F0",0x6842],
- ["CCD2",0x6843],
- ["E8E6",0x6844],
- ["CEA6",0x6845],
- ["BFF2",0x6846],
- ["96F4",0x6847],
- ["B0B8",0x6848],
- ["E8F1",0x6849],
- ["E8F0",0x684A],
- ["96F5",0x684B],
- ["D7C0",0x684C],
- ["96F6",0x684D],
- ["E8E4",0x684E],
- ["96F7",0x684F],
- ["CDA9",0x6850],
- ["C9A3",0x6851],
- ["96F8",0x6852],
- ["BBB8",0x6853],
- ["BDDB",0x6854],
- ["E8EA",0x6855],
- ["96F9",0x6856],
- ["96FA",0x6857],
- ["96FB",0x6858],
- ["96FC",0x6859],
- ["96FD",0x685A],
- ["96FE",0x685B],
- ["9740",0x685C],
- ["9741",0x685D],
- ["9742",0x685E],
- ["9743",0x685F],
- ["E8E2",0x6860],
- ["E8E3",0x6861],
- ["E8E5",0x6862],
- ["B5B5",0x6863],
- ["E8E7",0x6864],
- ["C7C5",0x6865],
- ["E8EB",0x6866],
- ["E8ED",0x6867],
- ["BDB0",0x6868],
- ["D7AE",0x6869],
- ["9744",0x686A],
- ["E8F8",0x686B],
- ["9745",0x686C],
- ["9746",0x686D],
- ["9747",0x686E],
- ["9748",0x686F],
- ["9749",0x6870],
- ["974A",0x6871],
- ["974B",0x6872],
- ["974C",0x6873],
- ["E8F5",0x6874],
- ["974D",0x6875],
- ["CDB0",0x6876],
- ["E8F6",0x6877],
- ["974E",0x6878],
- ["974F",0x6879],
- ["9750",0x687A],
- ["9751",0x687B],
- ["9752",0x687C],
- ["9753",0x687D],
- ["9754",0x687E],
- ["9755",0x687F],
- ["9756",0x6880],
- ["C1BA",0x6881],
- ["9757",0x6882],
- ["E8E8",0x6883],
- ["9758",0x6884],
- ["C3B7",0x6885],
- ["B0F0",0x6886],
- ["9759",0x6887],
- ["975A",0x6888],
- ["975B",0x6889],
- ["975C",0x688A],
- ["975D",0x688B],
- ["975E",0x688C],
- ["975F",0x688D],
- ["9760",0x688E],
- ["E8F4",0x688F],
- ["9761",0x6890],
- ["9762",0x6891],
- ["9763",0x6892],
- ["E8F7",0x6893],
- ["9764",0x6894],
- ["9765",0x6895],
- ["9766",0x6896],
- ["B9A3",0x6897],
- ["9767",0x6898],
- ["9768",0x6899],
- ["9769",0x689A],
- ["976A",0x689B],
- ["976B",0x689C],
- ["976C",0x689D],
- ["976D",0x689E],
- ["976E",0x689F],
- ["976F",0x68A0],
- ["9770",0x68A1],
- ["C9D2",0x68A2],
- ["9771",0x68A3],
- ["9772",0x68A4],
- ["9773",0x68A5],
- ["C3CE",0x68A6],
- ["CEE0",0x68A7],
- ["C0E6",0x68A8],
- ["9774",0x68A9],
- ["9775",0x68AA],
- ["9776",0x68AB],
- ["9777",0x68AC],
- ["CBF3",0x68AD],
- ["9778",0x68AE],
- ["CCDD",0x68AF],
- ["D0B5",0x68B0],
- ["9779",0x68B1],
- ["977A",0x68B2],
- ["CAE1",0x68B3],
- ["977B",0x68B4],
- ["E8F3",0x68B5],
- ["977C",0x68B6],
- ["977D",0x68B7],
- ["977E",0x68B8],
- ["9780",0x68B9],
- ["9781",0x68BA],
- ["9782",0x68BB],
- ["9783",0x68BC],
- ["9784",0x68BD],
- ["9785",0x68BE],
- ["9786",0x68BF],
- ["BCEC",0x68C0],
- ["9787",0x68C1],
- ["E8F9",0x68C2],
- ["9788",0x68C3],
- ["9789",0x68C4],
- ["978A",0x68C5],
- ["978B",0x68C6],
- ["978C",0x68C7],
- ["978D",0x68C8],
- ["C3DE",0x68C9],
- ["978E",0x68CA],
- ["C6E5",0x68CB],
- ["978F",0x68CC],
- ["B9F7",0x68CD],
- ["9790",0x68CE],
- ["9791",0x68CF],
- ["9792",0x68D0],
- ["9793",0x68D1],
- ["B0F4",0x68D2],
- ["9794",0x68D3],
- ["9795",0x68D4],
- ["D7D8",0x68D5],
- ["9796",0x68D6],
- ["9797",0x68D7],
- ["BCAC",0x68D8],
- ["9798",0x68D9],
- ["C5EF",0x68DA],
- ["9799",0x68DB],
- ["979A",0x68DC],
- ["979B",0x68DD],
- ["979C",0x68DE],
- ["979D",0x68DF],
- ["CCC4",0x68E0],
- ["979E",0x68E1],
- ["979F",0x68E2],
- ["E9A6",0x68E3],
- ["97A0",0x68E4],
- ["97A1",0x68E5],
- ["97A2",0x68E6],
- ["97A3",0x68E7],
- ["97A4",0x68E8],
- ["97A5",0x68E9],
- ["97A6",0x68EA],
- ["97A7",0x68EB],
- ["97A8",0x68EC],
- ["97A9",0x68ED],
- ["C9AD",0x68EE],
- ["97AA",0x68EF],
- ["E9A2",0x68F0],
- ["C0E2",0x68F1],
- ["97AB",0x68F2],
- ["97AC",0x68F3],
- ["97AD",0x68F4],
- ["BFC3",0x68F5],
- ["97AE",0x68F6],
- ["97AF",0x68F7],
- ["97B0",0x68F8],
- ["E8FE",0x68F9],
- ["B9D7",0x68FA],
- ["97B1",0x68FB],
- ["E8FB",0x68FC],
- ["97B2",0x68FD],
- ["97B3",0x68FE],
- ["97B4",0x68FF],
- ["97B5",0x6900],
- ["E9A4",0x6901],
- ["97B6",0x6902],
- ["97B7",0x6903],
- ["97B8",0x6904],
- ["D2CE",0x6905],
- ["97B9",0x6906],
- ["97BA",0x6907],
- ["97BB",0x6908],
- ["97BC",0x6909],
- ["97BD",0x690A],
- ["E9A3",0x690B],
- ["97BE",0x690C],
- ["D6B2",0x690D],
- ["D7B5",0x690E],
- ["97BF",0x690F],
- ["E9A7",0x6910],
- ["97C0",0x6911],
- ["BDB7",0x6912],
- ["97C1",0x6913],
- ["97C2",0x6914],
- ["97C3",0x6915],
- ["97C4",0x6916],
- ["97C5",0x6917],
- ["97C6",0x6918],
- ["97C7",0x6919],
- ["97C8",0x691A],
- ["97C9",0x691B],
- ["97CA",0x691C],
- ["97CB",0x691D],
- ["97CC",0x691E],
- ["E8FC",0x691F],
- ["E8FD",0x6920],
- ["97CD",0x6921],
- ["97CE",0x6922],
- ["97CF",0x6923],
- ["E9A1",0x6924],
- ["97D0",0x6925],
- ["97D1",0x6926],
- ["97D2",0x6927],
- ["97D3",0x6928],
- ["97D4",0x6929],
- ["97D5",0x692A],
- ["97D6",0x692B],
- ["97D7",0x692C],
- ["CDD6",0x692D],
- ["97D8",0x692E],
- ["97D9",0x692F],
- ["D2AC",0x6930],
- ["97DA",0x6931],
- ["97DB",0x6932],
- ["97DC",0x6933],
- ["E9B2",0x6934],
- ["97DD",0x6935],
- ["97DE",0x6936],
- ["97DF",0x6937],
- ["97E0",0x6938],
- ["E9A9",0x6939],
- ["97E1",0x693A],
- ["97E2",0x693B],
- ["97E3",0x693C],
- ["B4AA",0x693D],
- ["97E4",0x693E],
- ["B4BB",0x693F],
- ["97E5",0x6940],
- ["97E6",0x6941],
- ["E9AB",0x6942],
- ["97E7",0x6943],
- ["97E8",0x6944],
- ["97E9",0x6945],
- ["97EA",0x6946],
- ["97EB",0x6947],
- ["97EC",0x6948],
- ["97ED",0x6949],
- ["97EE",0x694A],
- ["97EF",0x694B],
- ["97F0",0x694C],
- ["97F1",0x694D],
- ["97F2",0x694E],
- ["97F3",0x694F],
- ["97F4",0x6950],
- ["97F5",0x6951],
- ["97F6",0x6952],
- ["97F7",0x6953],
- ["D0A8",0x6954],
- ["97F8",0x6955],
- ["97F9",0x6956],
- ["E9A5",0x6957],
- ["97FA",0x6958],
- ["97FB",0x6959],
- ["B3FE",0x695A],
- ["97FC",0x695B],
- ["97FD",0x695C],
- ["E9AC",0x695D],
- ["C0E3",0x695E],
- ["97FE",0x695F],
- ["E9AA",0x6960],
- ["9840",0x6961],
- ["9841",0x6962],
- ["E9B9",0x6963],
- ["9842",0x6964],
- ["9843",0x6965],
- ["E9B8",0x6966],
- ["9844",0x6967],
- ["9845",0x6968],
- ["9846",0x6969],
- ["9847",0x696A],
- ["E9AE",0x696B],
- ["9848",0x696C],
- ["9849",0x696D],
- ["E8FA",0x696E],
- ["984A",0x696F],
- ["984B",0x6970],
- ["E9A8",0x6971],
- ["984C",0x6972],
- ["984D",0x6973],
- ["984E",0x6974],
- ["984F",0x6975],
- ["9850",0x6976],
- ["BFAC",0x6977],
- ["E9B1",0x6978],
- ["E9BA",0x6979],
- ["9851",0x697A],
- ["9852",0x697B],
- ["C2A5",0x697C],
- ["9853",0x697D],
- ["9854",0x697E],
- ["9855",0x697F],
- ["E9AF",0x6980],
- ["9856",0x6981],
- ["B8C5",0x6982],
- ["9857",0x6983],
- ["E9AD",0x6984],
- ["9858",0x6985],
- ["D3DC",0x6986],
- ["E9B4",0x6987],
- ["E9B5",0x6988],
- ["E9B7",0x6989],
- ["9859",0x698A],
- ["985A",0x698B],
- ["985B",0x698C],
- ["E9C7",0x698D],
- ["985C",0x698E],
- ["985D",0x698F],
- ["985E",0x6990],
- ["985F",0x6991],
- ["9860",0x6992],
- ["9861",0x6993],
- ["C0C6",0x6994],
- ["E9C5",0x6995],
- ["9862",0x6996],
- ["9863",0x6997],
- ["E9B0",0x6998],
- ["9864",0x6999],
- ["9865",0x699A],
- ["E9BB",0x699B],
- ["B0F1",0x699C],
- ["9866",0x699D],
- ["9867",0x699E],
- ["9868",0x699F],
- ["9869",0x69A0],
- ["986A",0x69A1],
- ["986B",0x69A2],
- ["986C",0x69A3],
- ["986D",0x69A4],
- ["986E",0x69A5],
- ["986F",0x69A6],
- ["E9BC",0x69A7],
- ["D5A5",0x69A8],
- ["9870",0x69A9],
- ["9871",0x69AA],
- ["E9BE",0x69AB],
- ["9872",0x69AC],
- ["E9BF",0x69AD],
- ["9873",0x69AE],
- ["9874",0x69AF],
- ["9875",0x69B0],
- ["E9C1",0x69B1],
- ["9876",0x69B2],
- ["9877",0x69B3],
- ["C1F1",0x69B4],
- ["9878",0x69B5],
- ["9879",0x69B6],
- ["C8B6",0x69B7],
- ["987A",0x69B8],
- ["987B",0x69B9],
- ["987C",0x69BA],
- ["E9BD",0x69BB],
- ["987D",0x69BC],
- ["987E",0x69BD],
- ["9880",0x69BE],
- ["9881",0x69BF],
- ["9882",0x69C0],
- ["E9C2",0x69C1],
- ["9883",0x69C2],
- ["9884",0x69C3],
- ["9885",0x69C4],
- ["9886",0x69C5],
- ["9887",0x69C6],
- ["9888",0x69C7],
- ["9889",0x69C8],
- ["988A",0x69C9],
- ["E9C3",0x69CA],
- ["988B",0x69CB],
- ["E9B3",0x69CC],
- ["988C",0x69CD],
- ["E9B6",0x69CE],
- ["988D",0x69CF],
- ["BBB1",0x69D0],
- ["988E",0x69D1],
- ["988F",0x69D2],
- ["9890",0x69D3],
- ["E9C0",0x69D4],
- ["9891",0x69D5],
- ["9892",0x69D6],
- ["9893",0x69D7],
- ["9894",0x69D8],
- ["9895",0x69D9],
- ["9896",0x69DA],
- ["BCF7",0x69DB],
- ["9897",0x69DC],
- ["9898",0x69DD],
- ["9899",0x69DE],
- ["E9C4",0x69DF],
- ["E9C6",0x69E0],
- ["989A",0x69E1],
- ["989B",0x69E2],
- ["989C",0x69E3],
- ["989D",0x69E4],
- ["989E",0x69E5],
- ["989F",0x69E6],
- ["98A0",0x69E7],
- ["98A1",0x69E8],
- ["98A2",0x69E9],
- ["98A3",0x69EA],
- ["98A4",0x69EB],
- ["98A5",0x69EC],
- ["E9CA",0x69ED],
- ["98A6",0x69EE],
- ["98A7",0x69EF],
- ["98A8",0x69F0],
- ["98A9",0x69F1],
- ["E9CE",0x69F2],
- ["98AA",0x69F3],
- ["98AB",0x69F4],
- ["98AC",0x69F5],
- ["98AD",0x69F6],
- ["98AE",0x69F7],
- ["98AF",0x69F8],
- ["98B0",0x69F9],
- ["98B1",0x69FA],
- ["98B2",0x69FB],
- ["98B3",0x69FC],
- ["B2DB",0x69FD],
- ["98B4",0x69FE],
- ["E9C8",0x69FF],
- ["98B5",0x6A00],
- ["98B6",0x6A01],
- ["98B7",0x6A02],
- ["98B8",0x6A03],
- ["98B9",0x6A04],
- ["98BA",0x6A05],
- ["98BB",0x6A06],
- ["98BC",0x6A07],
- ["98BD",0x6A08],
- ["98BE",0x6A09],
- ["B7AE",0x6A0A],
- ["98BF",0x6A0B],
- ["98C0",0x6A0C],
- ["98C1",0x6A0D],
- ["98C2",0x6A0E],
- ["98C3",0x6A0F],
- ["98C4",0x6A10],
- ["98C5",0x6A11],
- ["98C6",0x6A12],
- ["98C7",0x6A13],
- ["98C8",0x6A14],
- ["98C9",0x6A15],
- ["98CA",0x6A16],
- ["E9CB",0x6A17],
- ["E9CC",0x6A18],
- ["98CB",0x6A19],
- ["98CC",0x6A1A],
- ["98CD",0x6A1B],
- ["98CE",0x6A1C],
- ["98CF",0x6A1D],
- ["98D0",0x6A1E],
- ["D5C1",0x6A1F],
- ["98D1",0x6A20],
- ["C4A3",0x6A21],
- ["98D2",0x6A22],
- ["98D3",0x6A23],
- ["98D4",0x6A24],
- ["98D5",0x6A25],
- ["98D6",0x6A26],
- ["98D7",0x6A27],
- ["E9D8",0x6A28],
- ["98D8",0x6A29],
- ["BAE1",0x6A2A],
- ["98D9",0x6A2B],
- ["98DA",0x6A2C],
- ["98DB",0x6A2D],
- ["98DC",0x6A2E],
- ["E9C9",0x6A2F],
- ["98DD",0x6A30],
- ["D3A3",0x6A31],
- ["98DE",0x6A32],
- ["98DF",0x6A33],
- ["98E0",0x6A34],
- ["E9D4",0x6A35],
- ["98E1",0x6A36],
- ["98E2",0x6A37],
- ["98E3",0x6A38],
- ["98E4",0x6A39],
- ["98E5",0x6A3A],
- ["98E6",0x6A3B],
- ["98E7",0x6A3C],
- ["E9D7",0x6A3D],
- ["E9D0",0x6A3E],
- ["98E8",0x6A3F],
- ["98E9",0x6A40],
- ["98EA",0x6A41],
- ["98EB",0x6A42],
- ["98EC",0x6A43],
- ["E9CF",0x6A44],
- ["98ED",0x6A45],
- ["98EE",0x6A46],
- ["C7C1",0x6A47],
- ["98EF",0x6A48],
- ["98F0",0x6A49],
- ["98F1",0x6A4A],
- ["98F2",0x6A4B],
- ["98F3",0x6A4C],
- ["98F4",0x6A4D],
- ["98F5",0x6A4E],
- ["98F6",0x6A4F],
- ["E9D2",0x6A50],
- ["98F7",0x6A51],
- ["98F8",0x6A52],
- ["98F9",0x6A53],
- ["98FA",0x6A54],
- ["98FB",0x6A55],
- ["98FC",0x6A56],
- ["98FD",0x6A57],
- ["E9D9",0x6A58],
- ["B3C8",0x6A59],
- ["98FE",0x6A5A],
- ["E9D3",0x6A5B],
- ["9940",0x6A5C],
- ["9941",0x6A5D],
- ["9942",0x6A5E],
- ["9943",0x6A5F],
- ["9944",0x6A60],
- ["CFF0",0x6A61],
- ["9945",0x6A62],
- ["9946",0x6A63],
- ["9947",0x6A64],
- ["E9CD",0x6A65],
- ["9948",0x6A66],
- ["9949",0x6A67],
- ["994A",0x6A68],
- ["994B",0x6A69],
- ["994C",0x6A6A],
- ["994D",0x6A6B],
- ["994E",0x6A6C],
- ["994F",0x6A6D],
- ["9950",0x6A6E],
- ["9951",0x6A6F],
- ["9952",0x6A70],
- ["B3F7",0x6A71],
- ["9953",0x6A72],
- ["9954",0x6A73],
- ["9955",0x6A74],
- ["9956",0x6A75],
- ["9957",0x6A76],
- ["9958",0x6A77],
- ["9959",0x6A78],
- ["E9D6",0x6A79],
- ["995A",0x6A7A],
- ["995B",0x6A7B],
- ["E9DA",0x6A7C],
- ["995C",0x6A7D],
- ["995D",0x6A7E],
- ["995E",0x6A7F],
- ["CCB4",0x6A80],
- ["995F",0x6A81],
- ["9960",0x6A82],
- ["9961",0x6A83],
- ["CFAD",0x6A84],
- ["9962",0x6A85],
- ["9963",0x6A86],
- ["9964",0x6A87],
- ["9965",0x6A88],
- ["9966",0x6A89],
- ["9967",0x6A8A],
- ["9968",0x6A8B],
- ["9969",0x6A8C],
- ["996A",0x6A8D],
- ["E9D5",0x6A8E],
- ["996B",0x6A8F],
- ["E9DC",0x6A90],
- ["E9DB",0x6A91],
- ["996C",0x6A92],
- ["996D",0x6A93],
- ["996E",0x6A94],
- ["996F",0x6A95],
- ["9970",0x6A96],
- ["E9DE",0x6A97],
- ["9971",0x6A98],
- ["9972",0x6A99],
- ["9973",0x6A9A],
- ["9974",0x6A9B],
- ["9975",0x6A9C],
- ["9976",0x6A9D],
- ["9977",0x6A9E],
- ["9978",0x6A9F],
- ["E9D1",0x6AA0],
- ["9979",0x6AA1],
- ["997A",0x6AA2],
- ["997B",0x6AA3],
- ["997C",0x6AA4],
- ["997D",0x6AA5],
- ["997E",0x6AA6],
- ["9980",0x6AA7],
- ["9981",0x6AA8],
- ["E9DD",0x6AA9],
- ["9982",0x6AAA],
- ["E9DF",0x6AAB],
- ["C3CA",0x6AAC],
- ["9983",0x6AAD],
- ["9984",0x6AAE],
- ["9985",0x6AAF],
- ["9986",0x6AB0],
- ["9987",0x6AB1],
- ["9988",0x6AB2],
- ["9989",0x6AB3],
- ["998A",0x6AB4],
- ["998B",0x6AB5],
- ["998C",0x6AB6],
- ["998D",0x6AB7],
- ["998E",0x6AB8],
- ["998F",0x6AB9],
- ["9990",0x6ABA],
- ["9991",0x6ABB],
- ["9992",0x6ABC],
- ["9993",0x6ABD],
- ["9994",0x6ABE],
- ["9995",0x6ABF],
- ["9996",0x6AC0],
- ["9997",0x6AC1],
- ["9998",0x6AC2],
- ["9999",0x6AC3],
- ["999A",0x6AC4],
- ["999B",0x6AC5],
- ["999C",0x6AC6],
- ["999D",0x6AC7],
- ["999E",0x6AC8],
- ["999F",0x6AC9],
- ["99A0",0x6ACA],
- ["99A1",0x6ACB],
- ["99A2",0x6ACC],
- ["99A3",0x6ACD],
- ["99A4",0x6ACE],
- ["99A5",0x6ACF],
- ["99A6",0x6AD0],
- ["99A7",0x6AD1],
- ["99A8",0x6AD2],
- ["99A9",0x6AD3],
- ["99AA",0x6AD4],
- ["99AB",0x6AD5],
- ["99AC",0x6AD6],
- ["99AD",0x6AD7],
- ["99AE",0x6AD8],
- ["99AF",0x6AD9],
- ["99B0",0x6ADA],
- ["99B1",0x6ADB],
- ["99B2",0x6ADC],
- ["99B3",0x6ADD],
- ["99B4",0x6ADE],
- ["99B5",0x6ADF],
- ["99B6",0x6AE0],
- ["99B7",0x6AE1],
- ["99B8",0x6AE2],
- ["99B9",0x6AE3],
- ["99BA",0x6AE4],
- ["99BB",0x6AE5],
- ["99BC",0x6AE6],
- ["99BD",0x6AE7],
- ["99BE",0x6AE8],
- ["99BF",0x6AE9],
- ["99C0",0x6AEA],
- ["99C1",0x6AEB],
- ["99C2",0x6AEC],
- ["99C3",0x6AED],
- ["99C4",0x6AEE],
- ["99C5",0x6AEF],
- ["99C6",0x6AF0],
- ["99C7",0x6AF1],
- ["99C8",0x6AF2],
- ["99C9",0x6AF3],
- ["99CA",0x6AF4],
- ["99CB",0x6AF5],
- ["99CC",0x6AF6],
- ["99CD",0x6AF7],
- ["99CE",0x6AF8],
- ["99CF",0x6AF9],
- ["99D0",0x6AFA],
- ["99D1",0x6AFB],
- ["99D2",0x6AFC],
- ["99D3",0x6AFD],
- ["99D4",0x6AFE],
- ["99D5",0x6AFF],
- ["99D6",0x6B00],
- ["99D7",0x6B01],
- ["99D8",0x6B02],
- ["99D9",0x6B03],
- ["99DA",0x6B04],
- ["99DB",0x6B05],
- ["99DC",0x6B06],
- ["99DD",0x6B07],
- ["99DE",0x6B08],
- ["99DF",0x6B09],
- ["99E0",0x6B0A],
- ["99E1",0x6B0B],
- ["99E2",0x6B0C],
- ["99E3",0x6B0D],
- ["99E4",0x6B0E],
- ["99E5",0x6B0F],
- ["99E6",0x6B10],
- ["99E7",0x6B11],
- ["99E8",0x6B12],
- ["99E9",0x6B13],
- ["99EA",0x6B14],
- ["99EB",0x6B15],
- ["99EC",0x6B16],
- ["99ED",0x6B17],
- ["99EE",0x6B18],
- ["99EF",0x6B19],
- ["99F0",0x6B1A],
- ["99F1",0x6B1B],
- ["99F2",0x6B1C],
- ["99F3",0x6B1D],
- ["99F4",0x6B1E],
- ["99F5",0x6B1F],
- ["C7B7",0x6B20],
- ["B4CE",0x6B21],
- ["BBB6",0x6B22],
- ["D0C0",0x6B23],
- ["ECA3",0x6B24],
- ["99F6",0x6B25],
- ["99F7",0x6B26],
- ["C5B7",0x6B27],
- ["99F8",0x6B28],
- ["99F9",0x6B29],
- ["99FA",0x6B2A],
- ["99FB",0x6B2B],
- ["99FC",0x6B2C],
- ["99FD",0x6B2D],
- ["99FE",0x6B2E],
- ["9A40",0x6B2F],
- ["9A41",0x6B30],
- ["9A42",0x6B31],
- ["D3FB",0x6B32],
- ["9A43",0x6B33],
- ["9A44",0x6B34],
- ["9A45",0x6B35],
- ["9A46",0x6B36],
- ["ECA4",0x6B37],
- ["9A47",0x6B38],
- ["ECA5",0x6B39],
- ["C6DB",0x6B3A],
- ["9A48",0x6B3B],
- ["9A49",0x6B3C],
- ["9A4A",0x6B3D],
- ["BFEE",0x6B3E],
- ["9A4B",0x6B3F],
- ["9A4C",0x6B40],
- ["9A4D",0x6B41],
- ["9A4E",0x6B42],
- ["ECA6",0x6B43],
- ["9A4F",0x6B44],
- ["9A50",0x6B45],
- ["ECA7",0x6B46],
- ["D0AA",0x6B47],
- ["9A51",0x6B48],
- ["C7B8",0x6B49],
- ["9A52",0x6B4A],
- ["9A53",0x6B4B],
- ["B8E8",0x6B4C],
- ["9A54",0x6B4D],
- ["9A55",0x6B4E],
- ["9A56",0x6B4F],
- ["9A57",0x6B50],
- ["9A58",0x6B51],
- ["9A59",0x6B52],
- ["9A5A",0x6B53],
- ["9A5B",0x6B54],
- ["9A5C",0x6B55],
- ["9A5D",0x6B56],
- ["9A5E",0x6B57],
- ["9A5F",0x6B58],
- ["ECA8",0x6B59],
- ["9A60",0x6B5A],
- ["9A61",0x6B5B],
- ["9A62",0x6B5C],
- ["9A63",0x6B5D],
- ["9A64",0x6B5E],
- ["9A65",0x6B5F],
- ["9A66",0x6B60],
- ["9A67",0x6B61],
- ["D6B9",0x6B62],
- ["D5FD",0x6B63],
- ["B4CB",0x6B64],
- ["B2BD",0x6B65],
- ["CEE4",0x6B66],
- ["C6E7",0x6B67],
- ["9A68",0x6B68],
- ["9A69",0x6B69],
- ["CDE1",0x6B6A],
- ["9A6A",0x6B6B],
- ["9A6B",0x6B6C],
- ["9A6C",0x6B6D],
- ["9A6D",0x6B6E],
- ["9A6E",0x6B6F],
- ["9A6F",0x6B70],
- ["9A70",0x6B71],
- ["9A71",0x6B72],
- ["9A72",0x6B73],
- ["9A73",0x6B74],
- ["9A74",0x6B75],
- ["9A75",0x6B76],
- ["9A76",0x6B77],
- ["9A77",0x6B78],
- ["B4F5",0x6B79],
- ["9A78",0x6B7A],
- ["CBC0",0x6B7B],
- ["BCDF",0x6B7C],
- ["9A79",0x6B7D],
- ["9A7A",0x6B7E],
- ["9A7B",0x6B7F],
- ["9A7C",0x6B80],
- ["E9E2",0x6B81],
- ["E9E3",0x6B82],
- ["D1EA",0x6B83],
- ["E9E5",0x6B84],
- ["9A7D",0x6B85],
- ["B4F9",0x6B86],
- ["E9E4",0x6B87],
- ["9A7E",0x6B88],
- ["D1B3",0x6B89],
- ["CAE2",0x6B8A],
- ["B2D0",0x6B8B],
- ["9A80",0x6B8C],
- ["E9E8",0x6B8D],
- ["9A81",0x6B8E],
- ["9A82",0x6B8F],
- ["9A83",0x6B90],
- ["9A84",0x6B91],
- ["E9E6",0x6B92],
- ["E9E7",0x6B93],
- ["9A85",0x6B94],
- ["9A86",0x6B95],
- ["D6B3",0x6B96],
- ["9A87",0x6B97],
- ["9A88",0x6B98],
- ["9A89",0x6B99],
- ["E9E9",0x6B9A],
- ["E9EA",0x6B9B],
- ["9A8A",0x6B9C],
- ["9A8B",0x6B9D],
- ["9A8C",0x6B9E],
- ["9A8D",0x6B9F],
- ["9A8E",0x6BA0],
- ["E9EB",0x6BA1],
- ["9A8F",0x6BA2],
- ["9A90",0x6BA3],
- ["9A91",0x6BA4],
- ["9A92",0x6BA5],
- ["9A93",0x6BA6],
- ["9A94",0x6BA7],
- ["9A95",0x6BA8],
- ["9A96",0x6BA9],
- ["E9EC",0x6BAA],
- ["9A97",0x6BAB],
- ["9A98",0x6BAC],
- ["9A99",0x6BAD],
- ["9A9A",0x6BAE],
- ["9A9B",0x6BAF],
- ["9A9C",0x6BB0],
- ["9A9D",0x6BB1],
- ["9A9E",0x6BB2],
- ["ECAF",0x6BB3],
- ["C5B9",0x6BB4],
- ["B6CE",0x6BB5],
- ["9A9F",0x6BB6],
- ["D2F3",0x6BB7],
- ["9AA0",0x6BB8],
- ["9AA1",0x6BB9],
- ["9AA2",0x6BBA],
- ["9AA3",0x6BBB],
- ["9AA4",0x6BBC],
- ["9AA5",0x6BBD],
- ["9AA6",0x6BBE],
- ["B5EE",0x6BBF],
- ["9AA7",0x6BC0],
- ["BBD9",0x6BC1],
- ["ECB1",0x6BC2],
- ["9AA8",0x6BC3],
- ["9AA9",0x6BC4],
- ["D2E3",0x6BC5],
- ["9AAA",0x6BC6],
- ["9AAB",0x6BC7],
- ["9AAC",0x6BC8],
- ["9AAD",0x6BC9],
- ["9AAE",0x6BCA],
- ["CEE3",0x6BCB],
- ["9AAF",0x6BCC],
- ["C4B8",0x6BCD],
- ["9AB0",0x6BCE],
- ["C3BF",0x6BCF],
- ["9AB1",0x6BD0],
- ["9AB2",0x6BD1],
- ["B6BE",0x6BD2],
- ["D8B9",0x6BD3],
- ["B1C8",0x6BD4],
- ["B1CF",0x6BD5],
- ["B1D1",0x6BD6],
- ["C5FE",0x6BD7],
- ["9AB3",0x6BD8],
- ["B1D0",0x6BD9],
- ["9AB4",0x6BDA],
- ["C3AB",0x6BDB],
- ["9AB5",0x6BDC],
- ["9AB6",0x6BDD],
- ["9AB7",0x6BDE],
- ["9AB8",0x6BDF],
- ["9AB9",0x6BE0],
- ["D5B1",0x6BE1],
- ["9ABA",0x6BE2],
- ["9ABB",0x6BE3],
- ["9ABC",0x6BE4],
- ["9ABD",0x6BE5],
- ["9ABE",0x6BE6],
- ["9ABF",0x6BE7],
- ["9AC0",0x6BE8],
- ["9AC1",0x6BE9],
- ["EBA4",0x6BEA],
- ["BAC1",0x6BEB],
- ["9AC2",0x6BEC],
- ["9AC3",0x6BED],
- ["9AC4",0x6BEE],
- ["CCBA",0x6BEF],
- ["9AC5",0x6BF0],
- ["9AC6",0x6BF1],
- ["9AC7",0x6BF2],
- ["EBA5",0x6BF3],
- ["9AC8",0x6BF4],
- ["EBA7",0x6BF5],
- ["9AC9",0x6BF6],
- ["9ACA",0x6BF7],
- ["9ACB",0x6BF8],
- ["EBA8",0x6BF9],
- ["9ACC",0x6BFA],
- ["9ACD",0x6BFB],
- ["9ACE",0x6BFC],
- ["EBA6",0x6BFD],
- ["9ACF",0x6BFE],
- ["9AD0",0x6BFF],
- ["9AD1",0x6C00],
- ["9AD2",0x6C01],
- ["9AD3",0x6C02],
- ["9AD4",0x6C03],
- ["9AD5",0x6C04],
- ["EBA9",0x6C05],
- ["EBAB",0x6C06],
- ["EBAA",0x6C07],
- ["9AD6",0x6C08],
- ["9AD7",0x6C09],
- ["9AD8",0x6C0A],
- ["9AD9",0x6C0B],
- ["9ADA",0x6C0C],
- ["EBAC",0x6C0D],
- ["9ADB",0x6C0E],
- ["CACF",0x6C0F],
- ["D8B5",0x6C10],
- ["C3F1",0x6C11],
- ["9ADC",0x6C12],
- ["C3A5",0x6C13],
- ["C6F8",0x6C14],
- ["EBAD",0x6C15],
- ["C4CA",0x6C16],
- ["9ADD",0x6C17],
- ["EBAE",0x6C18],
- ["EBAF",0x6C19],
- ["EBB0",0x6C1A],
- ["B7D5",0x6C1B],
- ["9ADE",0x6C1C],
- ["9ADF",0x6C1D],
- ["9AE0",0x6C1E],
- ["B7FA",0x6C1F],
- ["9AE1",0x6C20],
- ["EBB1",0x6C21],
- ["C7E2",0x6C22],
- ["9AE2",0x6C23],
- ["EBB3",0x6C24],
- ["9AE3",0x6C25],
- ["BAA4",0x6C26],
- ["D1F5",0x6C27],
- ["B0B1",0x6C28],
- ["EBB2",0x6C29],
- ["EBB4",0x6C2A],
- ["9AE4",0x6C2B],
- ["9AE5",0x6C2C],
- ["9AE6",0x6C2D],
- ["B5AA",0x6C2E],
- ["C2C8",0x6C2F],
- ["C7E8",0x6C30],
- ["9AE7",0x6C31],
- ["EBB5",0x6C32],
- ["9AE8",0x6C33],
- ["CBAE",0x6C34],
- ["E3DF",0x6C35],
- ["9AE9",0x6C36],
- ["9AEA",0x6C37],
- ["D3C0",0x6C38],
- ["9AEB",0x6C39],
- ["9AEC",0x6C3A],
- ["9AED",0x6C3B],
- ["9AEE",0x6C3C],
- ["D9DB",0x6C3D],
- ["9AEF",0x6C3E],
- ["9AF0",0x6C3F],
- ["CDA1",0x6C40],
- ["D6AD",0x6C41],
- ["C7F3",0x6C42],
- ["9AF1",0x6C43],
- ["9AF2",0x6C44],
- ["9AF3",0x6C45],
- ["D9E0",0x6C46],
- ["BBE3",0x6C47],
- ["9AF4",0x6C48],
- ["BABA",0x6C49],
- ["E3E2",0x6C4A],
- ["9AF5",0x6C4B],
- ["9AF6",0x6C4C],
- ["9AF7",0x6C4D],
- ["9AF8",0x6C4E],
- ["9AF9",0x6C4F],
- ["CFAB",0x6C50],
- ["9AFA",0x6C51],
- ["9AFB",0x6C52],
- ["9AFC",0x6C53],
- ["E3E0",0x6C54],
- ["C9C7",0x6C55],
- ["9AFD",0x6C56],
- ["BAB9",0x6C57],
- ["9AFE",0x6C58],
- ["9B40",0x6C59],
- ["9B41",0x6C5A],
- ["D1B4",0x6C5B],
- ["E3E1",0x6C5C],
- ["C8EA",0x6C5D],
- ["B9AF",0x6C5E],
- ["BDAD",0x6C5F],
- ["B3D8",0x6C60],
- ["CEDB",0x6C61],
- ["9B42",0x6C62],
- ["9B43",0x6C63],
- ["CCC0",0x6C64],
- ["9B44",0x6C65],
- ["9B45",0x6C66],
- ["9B46",0x6C67],
- ["E3E8",0x6C68],
- ["E3E9",0x6C69],
- ["CDF4",0x6C6A],
- ["9B47",0x6C6B],
- ["9B48",0x6C6C],
- ["9B49",0x6C6D],
- ["9B4A",0x6C6E],
- ["9B4B",0x6C6F],
- ["CCAD",0x6C70],
- ["9B4C",0x6C71],
- ["BCB3",0x6C72],
- ["9B4D",0x6C73],
- ["E3EA",0x6C74],
- ["9B4E",0x6C75],
- ["E3EB",0x6C76],
- ["9B4F",0x6C77],
- ["9B50",0x6C78],
- ["D0DA",0x6C79],
- ["9B51",0x6C7A],
- ["9B52",0x6C7B],
- ["9B53",0x6C7C],
- ["C6FB",0x6C7D],
- ["B7DA",0x6C7E],
- ["9B54",0x6C7F],
- ["9B55",0x6C80],
- ["C7DF",0x6C81],
- ["D2CA",0x6C82],
- ["CED6",0x6C83],
- ["9B56",0x6C84],
- ["E3E4",0x6C85],
- ["E3EC",0x6C86],
- ["9B57",0x6C87],
- ["C9F2",0x6C88],
- ["B3C1",0x6C89],
- ["9B58",0x6C8A],
- ["9B59",0x6C8B],
- ["E3E7",0x6C8C],
- ["9B5A",0x6C8D],
- ["9B5B",0x6C8E],
- ["C6E3",0x6C8F],
- ["E3E5",0x6C90],
- ["9B5C",0x6C91],
- ["9B5D",0x6C92],
- ["EDB3",0x6C93],
- ["E3E6",0x6C94],
- ["9B5E",0x6C95],
- ["9B5F",0x6C96],
- ["9B60",0x6C97],
- ["9B61",0x6C98],
- ["C9B3",0x6C99],
- ["9B62",0x6C9A],
- ["C5E6",0x6C9B],
- ["9B63",0x6C9C],
- ["9B64",0x6C9D],
- ["9B65",0x6C9E],
- ["B9B5",0x6C9F],
- ["9B66",0x6CA0],
- ["C3BB",0x6CA1],
- ["9B67",0x6CA2],
- ["E3E3",0x6CA3],
- ["C5BD",0x6CA4],
- ["C1A4",0x6CA5],
- ["C2D9",0x6CA6],
- ["B2D7",0x6CA7],
- ["9B68",0x6CA8],
- ["E3ED",0x6CA9],
- ["BBA6",0x6CAA],
- ["C4AD",0x6CAB],
- ["9B69",0x6CAC],
- ["E3F0",0x6CAD],
- ["BEDA",0x6CAE],
- ["9B6A",0x6CAF],
- ["9B6B",0x6CB0],
- ["E3FB",0x6CB1],
- ["E3F5",0x6CB2],
- ["BAD3",0x6CB3],
- ["9B6C",0x6CB4],
- ["9B6D",0x6CB5],
- ["9B6E",0x6CB6],
- ["9B6F",0x6CB7],
- ["B7D0",0x6CB8],
- ["D3CD",0x6CB9],
- ["9B70",0x6CBA],
- ["D6CE",0x6CBB],
- ["D5D3",0x6CBC],
- ["B9C1",0x6CBD],
- ["D5B4",0x6CBE],
- ["D1D8",0x6CBF],
- ["9B71",0x6CC0],
- ["9B72",0x6CC1],
- ["9B73",0x6CC2],
- ["9B74",0x6CC3],
- ["D0B9",0x6CC4],
- ["C7F6",0x6CC5],
- ["9B75",0x6CC6],
- ["9B76",0x6CC7],
- ["9B77",0x6CC8],
- ["C8AA",0x6CC9],
- ["B2B4",0x6CCA],
- ["9B78",0x6CCB],
- ["C3DA",0x6CCC],
- ["9B79",0x6CCD],
- ["9B7A",0x6CCE],
- ["9B7B",0x6CCF],
- ["E3EE",0x6CD0],
- ["9B7C",0x6CD1],
- ["9B7D",0x6CD2],
- ["E3FC",0x6CD3],
- ["E3EF",0x6CD4],
- ["B7A8",0x6CD5],
- ["E3F7",0x6CD6],
- ["E3F4",0x6CD7],
- ["9B7E",0x6CD8],
- ["9B80",0x6CD9],
- ["9B81",0x6CDA],
- ["B7BA",0x6CDB],
- ["9B82",0x6CDC],
- ["9B83",0x6CDD],
- ["C5A2",0x6CDE],
- ["9B84",0x6CDF],
- ["E3F6",0x6CE0],
- ["C5DD",0x6CE1],
- ["B2A8",0x6CE2],
- ["C6FC",0x6CE3],
- ["9B85",0x6CE4],
- ["C4E0",0x6CE5],
- ["9B86",0x6CE6],
- ["9B87",0x6CE7],
- ["D7A2",0x6CE8],
- ["9B88",0x6CE9],
- ["C0E1",0x6CEA],
- ["E3F9",0x6CEB],
- ["9B89",0x6CEC],
- ["9B8A",0x6CED],
- ["E3FA",0x6CEE],
- ["E3FD",0x6CEF],
- ["CCA9",0x6CF0],
- ["E3F3",0x6CF1],
- ["9B8B",0x6CF2],
- ["D3BE",0x6CF3],
- ["9B8C",0x6CF4],
- ["B1C3",0x6CF5],
- ["EDB4",0x6CF6],
- ["E3F1",0x6CF7],
- ["E3F2",0x6CF8],
- ["9B8D",0x6CF9],
- ["E3F8",0x6CFA],
- ["D0BA",0x6CFB],
- ["C6C3",0x6CFC],
- ["D4F3",0x6CFD],
- ["E3FE",0x6CFE],
- ["9B8E",0x6CFF],
- ["9B8F",0x6D00],
- ["BDE0",0x6D01],
- ["9B90",0x6D02],
- ["9B91",0x6D03],
- ["E4A7",0x6D04],
- ["9B92",0x6D05],
- ["9B93",0x6D06],
- ["E4A6",0x6D07],
- ["9B94",0x6D08],
- ["9B95",0x6D09],
- ["9B96",0x6D0A],
- ["D1F3",0x6D0B],
- ["E4A3",0x6D0C],
- ["9B97",0x6D0D],
- ["E4A9",0x6D0E],
- ["9B98",0x6D0F],
- ["9B99",0x6D10],
- ["9B9A",0x6D11],
- ["C8F7",0x6D12],
- ["9B9B",0x6D13],
- ["9B9C",0x6D14],
- ["9B9D",0x6D15],
- ["9B9E",0x6D16],
- ["CFB4",0x6D17],
- ["9B9F",0x6D18],
- ["E4A8",0x6D19],
- ["E4AE",0x6D1A],
- ["C2E5",0x6D1B],
- ["9BA0",0x6D1C],
- ["9BA1",0x6D1D],
- ["B6B4",0x6D1E],
- ["9BA2",0x6D1F],
- ["9BA3",0x6D20],
- ["9BA4",0x6D21],
- ["9BA5",0x6D22],
- ["9BA6",0x6D23],
- ["9BA7",0x6D24],
- ["BDF2",0x6D25],
- ["9BA8",0x6D26],
- ["E4A2",0x6D27],
- ["9BA9",0x6D28],
- ["9BAA",0x6D29],
- ["BAE9",0x6D2A],
- ["E4AA",0x6D2B],
- ["9BAB",0x6D2C],
- ["9BAC",0x6D2D],
- ["E4AC",0x6D2E],
- ["9BAD",0x6D2F],
- ["9BAE",0x6D30],
- ["B6FD",0x6D31],
- ["D6DE",0x6D32],
- ["E4B2",0x6D33],
- ["9BAF",0x6D34],
- ["E4AD",0x6D35],
- ["9BB0",0x6D36],
- ["9BB1",0x6D37],
- ["9BB2",0x6D38],
- ["E4A1",0x6D39],
- ["9BB3",0x6D3A],
- ["BBEE",0x6D3B],
- ["CDDD",0x6D3C],
- ["C7A2",0x6D3D],
- ["C5C9",0x6D3E],
- ["9BB4",0x6D3F],
- ["9BB5",0x6D40],
- ["C1F7",0x6D41],
- ["9BB6",0x6D42],
- ["E4A4",0x6D43],
- ["9BB7",0x6D44],
- ["C7B3",0x6D45],
- ["BDAC",0x6D46],
- ["BDBD",0x6D47],
- ["E4A5",0x6D48],
- ["9BB8",0x6D49],
- ["D7C7",0x6D4A],
- ["B2E2",0x6D4B],
- ["9BB9",0x6D4C],
- ["E4AB",0x6D4D],
- ["BCC3",0x6D4E],
- ["E4AF",0x6D4F],
- ["9BBA",0x6D50],
- ["BBEB",0x6D51],
- ["E4B0",0x6D52],
- ["C5A8",0x6D53],
- ["E4B1",0x6D54],
- ["9BBB",0x6D55],
- ["9BBC",0x6D56],
- ["9BBD",0x6D57],
- ["9BBE",0x6D58],
- ["D5E3",0x6D59],
- ["BFA3",0x6D5A],
- ["9BBF",0x6D5B],
- ["E4BA",0x6D5C],
- ["9BC0",0x6D5D],
- ["E4B7",0x6D5E],
- ["9BC1",0x6D5F],
- ["E4BB",0x6D60],
- ["9BC2",0x6D61],
- ["9BC3",0x6D62],
- ["E4BD",0x6D63],
- ["9BC4",0x6D64],
- ["9BC5",0x6D65],
- ["C6D6",0x6D66],
- ["9BC6",0x6D67],
- ["9BC7",0x6D68],
- ["BAC6",0x6D69],
- ["C0CB",0x6D6A],
- ["9BC8",0x6D6B],
- ["9BC9",0x6D6C],
- ["9BCA",0x6D6D],
- ["B8A1",0x6D6E],
- ["E4B4",0x6D6F],
- ["9BCB",0x6D70],
- ["9BCC",0x6D71],
- ["9BCD",0x6D72],
- ["9BCE",0x6D73],
- ["D4A1",0x6D74],
- ["9BCF",0x6D75],
- ["9BD0",0x6D76],
- ["BAA3",0x6D77],
- ["BDFE",0x6D78],
- ["9BD1",0x6D79],
- ["9BD2",0x6D7A],
- ["9BD3",0x6D7B],
- ["E4BC",0x6D7C],
- ["9BD4",0x6D7D],
- ["9BD5",0x6D7E],
- ["9BD6",0x6D7F],
- ["9BD7",0x6D80],
- ["9BD8",0x6D81],
- ["CDBF",0x6D82],
- ["9BD9",0x6D83],
- ["9BDA",0x6D84],
- ["C4F9",0x6D85],
- ["9BDB",0x6D86],
- ["9BDC",0x6D87],
- ["CFFB",0x6D88],
- ["C9E6",0x6D89],
- ["9BDD",0x6D8A],
- ["9BDE",0x6D8B],
- ["D3BF",0x6D8C],
- ["9BDF",0x6D8D],
- ["CFD1",0x6D8E],
- ["9BE0",0x6D8F],
- ["9BE1",0x6D90],
- ["E4B3",0x6D91],
- ["9BE2",0x6D92],
- ["E4B8",0x6D93],
- ["E4B9",0x6D94],
- ["CCE9",0x6D95],
- ["9BE3",0x6D96],
- ["9BE4",0x6D97],
- ["9BE5",0x6D98],
- ["9BE6",0x6D99],
- ["9BE7",0x6D9A],
- ["CCCE",0x6D9B],
- ["9BE8",0x6D9C],
- ["C0D4",0x6D9D],
- ["E4B5",0x6D9E],
- ["C1B0",0x6D9F],
- ["E4B6",0x6DA0],
- ["CED0",0x6DA1],
- ["9BE9",0x6DA2],
- ["BBC1",0x6DA3],
- ["B5D3",0x6DA4],
- ["9BEA",0x6DA5],
- ["C8F3",0x6DA6],
- ["BDA7",0x6DA7],
- ["D5C7",0x6DA8],
- ["C9AC",0x6DA9],
- ["B8A2",0x6DAA],
- ["E4CA",0x6DAB],
- ["9BEB",0x6DAC],
- ["9BEC",0x6DAD],
- ["E4CC",0x6DAE],
- ["D1C4",0x6DAF],
- ["9BED",0x6DB0],
- ["9BEE",0x6DB1],
- ["D2BA",0x6DB2],
- ["9BEF",0x6DB3],
- ["9BF0",0x6DB4],
- ["BAAD",0x6DB5],
- ["9BF1",0x6DB6],
- ["9BF2",0x6DB7],
- ["BAD4",0x6DB8],
- ["9BF3",0x6DB9],
- ["9BF4",0x6DBA],
- ["9BF5",0x6DBB],
- ["9BF6",0x6DBC],
- ["9BF7",0x6DBD],
- ["9BF8",0x6DBE],
- ["E4C3",0x6DBF],
- ["B5ED",0x6DC0],
- ["9BF9",0x6DC1],
- ["9BFA",0x6DC2],
- ["9BFB",0x6DC3],
- ["D7CD",0x6DC4],
- ["E4C0",0x6DC5],
- ["CFFD",0x6DC6],
- ["E4BF",0x6DC7],
- ["9BFC",0x6DC8],
- ["9BFD",0x6DC9],
- ["9BFE",0x6DCA],
- ["C1DC",0x6DCB],
- ["CCCA",0x6DCC],
- ["9C40",0x6DCD],
- ["9C41",0x6DCE],
- ["9C42",0x6DCF],
- ["9C43",0x6DD0],
- ["CAE7",0x6DD1],
- ["9C44",0x6DD2],
- ["9C45",0x6DD3],
- ["9C46",0x6DD4],
- ["9C47",0x6DD5],
- ["C4D7",0x6DD6],
- ["9C48",0x6DD7],
- ["CCD4",0x6DD8],
- ["E4C8",0x6DD9],
- ["9C49",0x6DDA],
- ["9C4A",0x6DDB],
- ["9C4B",0x6DDC],
- ["E4C7",0x6DDD],
- ["E4C1",0x6DDE],
- ["9C4C",0x6DDF],
- ["E4C4",0x6DE0],
- ["B5AD",0x6DE1],
- ["9C4D",0x6DE2],
- ["9C4E",0x6DE3],
- ["D3D9",0x6DE4],
- ["9C4F",0x6DE5],
- ["E4C6",0x6DE6],
- ["9C50",0x6DE7],
- ["9C51",0x6DE8],
- ["9C52",0x6DE9],
- ["9C53",0x6DEA],
- ["D2F9",0x6DEB],
- ["B4E3",0x6DEC],
- ["9C54",0x6DED],
- ["BBB4",0x6DEE],
- ["9C55",0x6DEF],
- ["9C56",0x6DF0],
- ["C9EE",0x6DF1],
- ["9C57",0x6DF2],
- ["B4BE",0x6DF3],
- ["9C58",0x6DF4],
- ["9C59",0x6DF5],
- ["9C5A",0x6DF6],
- ["BBEC",0x6DF7],
- ["9C5B",0x6DF8],
- ["D1CD",0x6DF9],
- ["9C5C",0x6DFA],
- ["CCED",0x6DFB],
- ["EDB5",0x6DFC],
- ["9C5D",0x6DFD],
- ["9C5E",0x6DFE],
- ["9C5F",0x6DFF],
- ["9C60",0x6E00],
- ["9C61",0x6E01],
- ["9C62",0x6E02],
- ["9C63",0x6E03],
- ["9C64",0x6E04],
- ["C7E5",0x6E05],
- ["9C65",0x6E06],
- ["9C66",0x6E07],
- ["9C67",0x6E08],
- ["9C68",0x6E09],
- ["D4A8",0x6E0A],
- ["9C69",0x6E0B],
- ["E4CB",0x6E0C],
- ["D7D5",0x6E0D],
- ["E4C2",0x6E0E],
- ["9C6A",0x6E0F],
- ["BDA5",0x6E10],
- ["E4C5",0x6E11],
- ["9C6B",0x6E12],
- ["9C6C",0x6E13],
- ["D3E6",0x6E14],
- ["9C6D",0x6E15],
- ["E4C9",0x6E16],
- ["C9F8",0x6E17],
- ["9C6E",0x6E18],
- ["9C6F",0x6E19],
- ["E4BE",0x6E1A],
- ["9C70",0x6E1B],
- ["9C71",0x6E1C],
- ["D3E5",0x6E1D],
- ["9C72",0x6E1E],
- ["9C73",0x6E1F],
- ["C7FE",0x6E20],
- ["B6C9",0x6E21],
- ["9C74",0x6E22],
- ["D4FC",0x6E23],
- ["B2B3",0x6E24],
- ["E4D7",0x6E25],
- ["9C75",0x6E26],
- ["9C76",0x6E27],
- ["9C77",0x6E28],
- ["CEC2",0x6E29],
- ["9C78",0x6E2A],
- ["E4CD",0x6E2B],
- ["9C79",0x6E2C],
- ["CEBC",0x6E2D],
- ["9C7A",0x6E2E],
- ["B8DB",0x6E2F],
- ["9C7B",0x6E30],
- ["9C7C",0x6E31],
- ["E4D6",0x6E32],
- ["9C7D",0x6E33],
- ["BFCA",0x6E34],
- ["9C7E",0x6E35],
- ["9C80",0x6E36],
- ["9C81",0x6E37],
- ["D3CE",0x6E38],
- ["9C82",0x6E39],
- ["C3EC",0x6E3A],
- ["9C83",0x6E3B],
- ["9C84",0x6E3C],
- ["9C85",0x6E3D],
- ["9C86",0x6E3E],
- ["9C87",0x6E3F],
- ["9C88",0x6E40],
- ["9C89",0x6E41],
- ["9C8A",0x6E42],
- ["C5C8",0x6E43],
- ["E4D8",0x6E44],
- ["9C8B",0x6E45],
- ["9C8C",0x6E46],
- ["9C8D",0x6E47],
- ["9C8E",0x6E48],
- ["9C8F",0x6E49],
- ["9C90",0x6E4A],
- ["9C91",0x6E4B],
- ["9C92",0x6E4C],
- ["CDC4",0x6E4D],
- ["E4CF",0x6E4E],
- ["9C93",0x6E4F],
- ["9C94",0x6E50],
- ["9C95",0x6E51],
- ["9C96",0x6E52],
- ["E4D4",0x6E53],
- ["E4D5",0x6E54],
- ["9C97",0x6E55],
- ["BAFE",0x6E56],
- ["9C98",0x6E57],
- ["CFE6",0x6E58],
- ["9C99",0x6E59],
- ["9C9A",0x6E5A],
- ["D5BF",0x6E5B],
- ["9C9B",0x6E5C],
- ["9C9C",0x6E5D],
- ["9C9D",0x6E5E],
- ["E4D2",0x6E5F],
- ["9C9E",0x6E60],
- ["9C9F",0x6E61],
- ["9CA0",0x6E62],
- ["9CA1",0x6E63],
- ["9CA2",0x6E64],
- ["9CA3",0x6E65],
- ["9CA4",0x6E66],
- ["9CA5",0x6E67],
- ["9CA6",0x6E68],
- ["9CA7",0x6E69],
- ["9CA8",0x6E6A],
- ["E4D0",0x6E6B],
- ["9CA9",0x6E6C],
- ["9CAA",0x6E6D],
- ["E4CE",0x6E6E],
- ["9CAB",0x6E6F],
- ["9CAC",0x6E70],
- ["9CAD",0x6E71],
- ["9CAE",0x6E72],
- ["9CAF",0x6E73],
- ["9CB0",0x6E74],
- ["9CB1",0x6E75],
- ["9CB2",0x6E76],
- ["9CB3",0x6E77],
- ["9CB4",0x6E78],
- ["9CB5",0x6E79],
- ["9CB6",0x6E7A],
- ["9CB7",0x6E7B],
- ["9CB8",0x6E7C],
- ["9CB9",0x6E7D],
- ["CDE5",0x6E7E],
- ["CAAA",0x6E7F],
- ["9CBA",0x6E80],
- ["9CBB",0x6E81],
- ["9CBC",0x6E82],
- ["C0A3",0x6E83],
- ["9CBD",0x6E84],
- ["BDA6",0x6E85],
- ["E4D3",0x6E86],
- ["9CBE",0x6E87],
- ["9CBF",0x6E88],
- ["B8C8",0x6E89],
- ["9CC0",0x6E8A],
- ["9CC1",0x6E8B],
- ["9CC2",0x6E8C],
- ["9CC3",0x6E8D],
- ["9CC4",0x6E8E],
- ["E4E7",0x6E8F],
- ["D4B4",0x6E90],
- ["9CC5",0x6E91],
- ["9CC6",0x6E92],
- ["9CC7",0x6E93],
- ["9CC8",0x6E94],
- ["9CC9",0x6E95],
- ["9CCA",0x6E96],
- ["9CCB",0x6E97],
- ["E4DB",0x6E98],
- ["9CCC",0x6E99],
- ["9CCD",0x6E9A],
- ["9CCE",0x6E9B],
- ["C1EF",0x6E9C],
- ["9CCF",0x6E9D],
- ["9CD0",0x6E9E],
- ["E4E9",0x6E9F],
- ["9CD1",0x6EA0],
- ["9CD2",0x6EA1],
- ["D2E7",0x6EA2],
- ["9CD3",0x6EA3],
- ["9CD4",0x6EA4],
- ["E4DF",0x6EA5],
- ["9CD5",0x6EA6],
- ["E4E0",0x6EA7],
- ["9CD6",0x6EA8],
- ["9CD7",0x6EA9],
- ["CFAA",0x6EAA],
- ["9CD8",0x6EAB],
- ["9CD9",0x6EAC],
- ["9CDA",0x6EAD],
- ["9CDB",0x6EAE],
- ["CBDD",0x6EAF],
- ["9CDC",0x6EB0],
- ["E4DA",0x6EB1],
- ["E4D1",0x6EB2],
- ["9CDD",0x6EB3],
- ["E4E5",0x6EB4],
- ["9CDE",0x6EB5],
- ["C8DC",0x6EB6],
- ["E4E3",0x6EB7],
- ["9CDF",0x6EB8],
- ["9CE0",0x6EB9],
- ["C4E7",0x6EBA],
- ["E4E2",0x6EBB],
- ["9CE1",0x6EBC],
- ["E4E1",0x6EBD],
- ["9CE2",0x6EBE],
- ["9CE3",0x6EBF],
- ["9CE4",0x6EC0],
- ["B3FC",0x6EC1],
- ["E4E8",0x6EC2],
- ["9CE5",0x6EC3],
- ["9CE6",0x6EC4],
- ["9CE7",0x6EC5],
- ["9CE8",0x6EC6],
- ["B5E1",0x6EC7],
- ["9CE9",0x6EC8],
- ["9CEA",0x6EC9],
- ["9CEB",0x6ECA],
- ["D7CC",0x6ECB],
- ["9CEC",0x6ECC],
- ["9CED",0x6ECD],
- ["9CEE",0x6ECE],
- ["E4E6",0x6ECF],
- ["9CEF",0x6ED0],
- ["BBAC",0x6ED1],
- ["9CF0",0x6ED2],
- ["D7D2",0x6ED3],
- ["CCCF",0x6ED4],
- ["EBF8",0x6ED5],
- ["9CF1",0x6ED6],
- ["E4E4",0x6ED7],
- ["9CF2",0x6ED8],
- ["9CF3",0x6ED9],
- ["B9F6",0x6EDA],
- ["9CF4",0x6EDB],
- ["9CF5",0x6EDC],
- ["9CF6",0x6EDD],
- ["D6CD",0x6EDE],
- ["E4D9",0x6EDF],
- ["E4DC",0x6EE0],
- ["C2FA",0x6EE1],
- ["E4DE",0x6EE2],
- ["9CF7",0x6EE3],
- ["C2CB",0x6EE4],
- ["C0C4",0x6EE5],
- ["C2D0",0x6EE6],
- ["9CF8",0x6EE7],
- ["B1F5",0x6EE8],
- ["CCB2",0x6EE9],
- ["9CF9",0x6EEA],
- ["9CFA",0x6EEB],
- ["9CFB",0x6EEC],
- ["9CFC",0x6EED],
- ["9CFD",0x6EEE],
- ["9CFE",0x6EEF],
- ["9D40",0x6EF0],
- ["9D41",0x6EF1],
- ["9D42",0x6EF2],
- ["9D43",0x6EF3],
- ["B5CE",0x6EF4],
- ["9D44",0x6EF5],
- ["9D45",0x6EF6],
- ["9D46",0x6EF7],
- ["9D47",0x6EF8],
- ["E4EF",0x6EF9],
- ["9D48",0x6EFA],
- ["9D49",0x6EFB],
- ["9D4A",0x6EFC],
- ["9D4B",0x6EFD],
- ["9D4C",0x6EFE],
- ["9D4D",0x6EFF],
- ["9D4E",0x6F00],
- ["9D4F",0x6F01],
- ["C6AF",0x6F02],
- ["9D50",0x6F03],
- ["9D51",0x6F04],
- ["9D52",0x6F05],
- ["C6E1",0x6F06],
- ["9D53",0x6F07],
- ["9D54",0x6F08],
- ["E4F5",0x6F09],
- ["9D55",0x6F0A],
- ["9D56",0x6F0B],
- ["9D57",0x6F0C],
- ["9D58",0x6F0D],
- ["9D59",0x6F0E],
- ["C2A9",0x6F0F],
- ["9D5A",0x6F10],
- ["9D5B",0x6F11],
- ["9D5C",0x6F12],
- ["C0EC",0x6F13],
- ["D1DD",0x6F14],
- ["E4EE",0x6F15],
- ["9D5D",0x6F16],
- ["9D5E",0x6F17],
- ["9D5F",0x6F18],
- ["9D60",0x6F19],
- ["9D61",0x6F1A],
- ["9D62",0x6F1B],
- ["9D63",0x6F1C],
- ["9D64",0x6F1D],
- ["9D65",0x6F1E],
- ["9D66",0x6F1F],
- ["C4AE",0x6F20],
- ["9D67",0x6F21],
- ["9D68",0x6F22],
- ["9D69",0x6F23],
- ["E4ED",0x6F24],
- ["9D6A",0x6F25],
- ["9D6B",0x6F26],
- ["9D6C",0x6F27],
- ["9D6D",0x6F28],
- ["E4F6",0x6F29],
- ["E4F4",0x6F2A],
- ["C2FE",0x6F2B],
- ["9D6E",0x6F2C],
- ["E4DD",0x6F2D],
- ["9D6F",0x6F2E],
- ["E4F0",0x6F2F],
- ["9D70",0x6F30],
- ["CAFE",0x6F31],
- ["9D71",0x6F32],
- ["D5C4",0x6F33],
- ["9D72",0x6F34],
- ["9D73",0x6F35],
- ["E4F1",0x6F36],
- ["9D74",0x6F37],
- ["9D75",0x6F38],
- ["9D76",0x6F39],
- ["9D77",0x6F3A],
- ["9D78",0x6F3B],
- ["9D79",0x6F3C],
- ["9D7A",0x6F3D],
- ["D1FA",0x6F3E],
- ["9D7B",0x6F3F],
- ["9D7C",0x6F40],
- ["9D7D",0x6F41],
- ["9D7E",0x6F42],
- ["9D80",0x6F43],
- ["9D81",0x6F44],
- ["9D82",0x6F45],
- ["E4EB",0x6F46],
- ["E4EC",0x6F47],
- ["9D83",0x6F48],
- ["9D84",0x6F49],
- ["9D85",0x6F4A],
- ["E4F2",0x6F4B],
- ["9D86",0x6F4C],
- ["CEAB",0x6F4D],
- ["9D87",0x6F4E],
- ["9D88",0x6F4F],
- ["9D89",0x6F50],
- ["9D8A",0x6F51],
- ["9D8B",0x6F52],
- ["9D8C",0x6F53],
- ["9D8D",0x6F54],
- ["9D8E",0x6F55],
- ["9D8F",0x6F56],
- ["9D90",0x6F57],
- ["C5CB",0x6F58],
- ["9D91",0x6F59],
- ["9D92",0x6F5A],
- ["9D93",0x6F5B],
- ["C7B1",0x6F5C],
- ["9D94",0x6F5D],
- ["C2BA",0x6F5E],
- ["9D95",0x6F5F],
- ["9D96",0x6F60],
- ["9D97",0x6F61],
- ["E4EA",0x6F62],
- ["9D98",0x6F63],
- ["9D99",0x6F64],
- ["9D9A",0x6F65],
- ["C1CA",0x6F66],
- ["9D9B",0x6F67],
- ["9D9C",0x6F68],
- ["9D9D",0x6F69],
- ["9D9E",0x6F6A],
- ["9D9F",0x6F6B],
- ["9DA0",0x6F6C],
- ["CCB6",0x6F6D],
- ["B3B1",0x6F6E],
- ["9DA1",0x6F6F],
- ["9DA2",0x6F70],
- ["9DA3",0x6F71],
- ["E4FB",0x6F72],
- ["9DA4",0x6F73],
- ["E4F3",0x6F74],
- ["9DA5",0x6F75],
- ["9DA6",0x6F76],
- ["9DA7",0x6F77],
- ["E4FA",0x6F78],
- ["9DA8",0x6F79],
- ["E4FD",0x6F7A],
- ["9DA9",0x6F7B],
- ["E4FC",0x6F7C],
- ["9DAA",0x6F7D],
- ["9DAB",0x6F7E],
- ["9DAC",0x6F7F],
- ["9DAD",0x6F80],
- ["9DAE",0x6F81],
- ["9DAF",0x6F82],
- ["9DB0",0x6F83],
- ["B3CE",0x6F84],
- ["9DB1",0x6F85],
- ["9DB2",0x6F86],
- ["9DB3",0x6F87],
- ["B3BA",0x6F88],
- ["E4F7",0x6F89],
- ["9DB4",0x6F8A],
- ["9DB5",0x6F8B],
- ["E4F9",0x6F8C],
- ["E4F8",0x6F8D],
- ["C5EC",0x6F8E],
- ["9DB6",0x6F8F],
- ["9DB7",0x6F90],
- ["9DB8",0x6F91],
- ["9DB9",0x6F92],
- ["9DBA",0x6F93],
- ["9DBB",0x6F94],
- ["9DBC",0x6F95],
- ["9DBD",0x6F96],
- ["9DBE",0x6F97],
- ["9DBF",0x6F98],
- ["9DC0",0x6F99],
- ["9DC1",0x6F9A],
- ["9DC2",0x6F9B],
- ["C0BD",0x6F9C],
- ["9DC3",0x6F9D],
- ["9DC4",0x6F9E],
- ["9DC5",0x6F9F],
- ["9DC6",0x6FA0],
- ["D4E8",0x6FA1],
- ["9DC7",0x6FA2],
- ["9DC8",0x6FA3],
- ["9DC9",0x6FA4],
- ["9DCA",0x6FA5],
- ["9DCB",0x6FA6],
- ["E5A2",0x6FA7],
- ["9DCC",0x6FA8],
- ["9DCD",0x6FA9],
- ["9DCE",0x6FAA],
- ["9DCF",0x6FAB],
- ["9DD0",0x6FAC],
- ["9DD1",0x6FAD],
- ["9DD2",0x6FAE],
- ["9DD3",0x6FAF],
- ["9DD4",0x6FB0],
- ["9DD5",0x6FB1],
- ["9DD6",0x6FB2],
- ["B0C4",0x6FB3],
- ["9DD7",0x6FB4],
- ["9DD8",0x6FB5],
- ["E5A4",0x6FB6],
- ["9DD9",0x6FB7],
- ["9DDA",0x6FB8],
- ["E5A3",0x6FB9],
- ["9DDB",0x6FBA],
- ["9DDC",0x6FBB],
- ["9DDD",0x6FBC],
- ["9DDE",0x6FBD],
- ["9DDF",0x6FBE],
- ["9DE0",0x6FBF],
- ["BCA4",0x6FC0],
- ["9DE1",0x6FC1],
- ["E5A5",0x6FC2],
- ["9DE2",0x6FC3],
- ["9DE3",0x6FC4],
- ["9DE4",0x6FC5],
- ["9DE5",0x6FC6],
- ["9DE6",0x6FC7],
- ["9DE7",0x6FC8],
- ["E5A1",0x6FC9],
- ["9DE8",0x6FCA],
- ["9DE9",0x6FCB],
- ["9DEA",0x6FCC],
- ["9DEB",0x6FCD],
- ["9DEC",0x6FCE],
- ["9DED",0x6FCF],
- ["9DEE",0x6FD0],
- ["E4FE",0x6FD1],
- ["B1F4",0x6FD2],
- ["9DEF",0x6FD3],
- ["9DF0",0x6FD4],
- ["9DF1",0x6FD5],
- ["9DF2",0x6FD6],
- ["9DF3",0x6FD7],
- ["9DF4",0x6FD8],
- ["9DF5",0x6FD9],
- ["9DF6",0x6FDA],
- ["9DF7",0x6FDB],
- ["9DF8",0x6FDC],
- ["9DF9",0x6FDD],
- ["E5A8",0x6FDE],
- ["9DFA",0x6FDF],
- ["E5A9",0x6FE0],
- ["E5A6",0x6FE1],
- ["9DFB",0x6FE2],
- ["9DFC",0x6FE3],
- ["9DFD",0x6FE4],
- ["9DFE",0x6FE5],
- ["9E40",0x6FE6],
- ["9E41",0x6FE7],
- ["9E42",0x6FE8],
- ["9E43",0x6FE9],
- ["9E44",0x6FEA],
- ["9E45",0x6FEB],
- ["9E46",0x6FEC],
- ["9E47",0x6FED],
- ["E5A7",0x6FEE],
- ["E5AA",0x6FEF],
- ["9E48",0x6FF0],
- ["9E49",0x6FF1],
- ["9E4A",0x6FF2],
- ["9E4B",0x6FF3],
- ["9E4C",0x6FF4],
- ["9E4D",0x6FF5],
- ["9E4E",0x6FF6],
- ["9E4F",0x6FF7],
- ["9E50",0x6FF8],
- ["9E51",0x6FF9],
- ["9E52",0x6FFA],
- ["9E53",0x6FFB],
- ["9E54",0x6FFC],
- ["9E55",0x6FFD],
- ["9E56",0x6FFE],
- ["9E57",0x6FFF],
- ["9E58",0x7000],
- ["9E59",0x7001],
- ["9E5A",0x7002],
- ["9E5B",0x7003],
- ["9E5C",0x7004],
- ["9E5D",0x7005],
- ["9E5E",0x7006],
- ["9E5F",0x7007],
- ["9E60",0x7008],
- ["9E61",0x7009],
- ["9E62",0x700A],
- ["9E63",0x700B],
- ["9E64",0x700C],
- ["9E65",0x700D],
- ["9E66",0x700E],
- ["9E67",0x700F],
- ["9E68",0x7010],
- ["C6D9",0x7011],
- ["9E69",0x7012],
- ["9E6A",0x7013],
- ["9E6B",0x7014],
- ["9E6C",0x7015],
- ["9E6D",0x7016],
- ["9E6E",0x7017],
- ["9E6F",0x7018],
- ["9E70",0x7019],
- ["E5AB",0x701A],
- ["E5AD",0x701B],
- ["9E71",0x701C],
- ["9E72",0x701D],
- ["9E73",0x701E],
- ["9E74",0x701F],
- ["9E75",0x7020],
- ["9E76",0x7021],
- ["9E77",0x7022],
- ["E5AC",0x7023],
- ["9E78",0x7024],
- ["9E79",0x7025],
- ["9E7A",0x7026],
- ["9E7B",0x7027],
- ["9E7C",0x7028],
- ["9E7D",0x7029],
- ["9E7E",0x702A],
- ["9E80",0x702B],
- ["9E81",0x702C],
- ["9E82",0x702D],
- ["9E83",0x702E],
- ["9E84",0x702F],
- ["9E85",0x7030],
- ["9E86",0x7031],
- ["9E87",0x7032],
- ["9E88",0x7033],
- ["9E89",0x7034],
- ["E5AF",0x7035],
- ["9E8A",0x7036],
- ["9E8B",0x7037],
- ["9E8C",0x7038],
- ["E5AE",0x7039],
- ["9E8D",0x703A],
- ["9E8E",0x703B],
- ["9E8F",0x703C],
- ["9E90",0x703D],
- ["9E91",0x703E],
- ["9E92",0x703F],
- ["9E93",0x7040],
- ["9E94",0x7041],
- ["9E95",0x7042],
- ["9E96",0x7043],
- ["9E97",0x7044],
- ["9E98",0x7045],
- ["9E99",0x7046],
- ["9E9A",0x7047],
- ["9E9B",0x7048],
- ["9E9C",0x7049],
- ["9E9D",0x704A],
- ["9E9E",0x704B],
- ["B9E0",0x704C],
- ["9E9F",0x704D],
- ["9EA0",0x704E],
- ["E5B0",0x704F],
- ["9EA1",0x7050],
- ["9EA2",0x7051],
- ["9EA3",0x7052],
- ["9EA4",0x7053],
- ["9EA5",0x7054],
- ["9EA6",0x7055],
- ["9EA7",0x7056],
- ["9EA8",0x7057],
- ["9EA9",0x7058],
- ["9EAA",0x7059],
- ["9EAB",0x705A],
- ["9EAC",0x705B],
- ["9EAD",0x705C],
- ["9EAE",0x705D],
- ["E5B1",0x705E],
- ["9EAF",0x705F],
- ["9EB0",0x7060],
- ["9EB1",0x7061],
- ["9EB2",0x7062],
- ["9EB3",0x7063],
- ["9EB4",0x7064],
- ["9EB5",0x7065],
- ["9EB6",0x7066],
- ["9EB7",0x7067],
- ["9EB8",0x7068],
- ["9EB9",0x7069],
- ["9EBA",0x706A],
- ["BBF0",0x706B],
- ["ECE1",0x706C],
- ["C3F0",0x706D],
- ["9EBB",0x706E],
- ["B5C6",0x706F],
- ["BBD2",0x7070],
- ["9EBC",0x7071],
- ["9EBD",0x7072],
- ["9EBE",0x7073],
- ["9EBF",0x7074],
- ["C1E9",0x7075],
- ["D4EE",0x7076],
- ["9EC0",0x7077],
- ["BEC4",0x7078],
- ["9EC1",0x7079],
- ["9EC2",0x707A],
- ["9EC3",0x707B],
- ["D7C6",0x707C],
- ["9EC4",0x707D],
- ["D4D6",0x707E],
- ["B2D3",0x707F],
- ["ECBE",0x7080],
- ["9EC5",0x7081],
- ["9EC6",0x7082],
- ["9EC7",0x7083],
- ["9EC8",0x7084],
- ["EAC1",0x7085],
- ["9EC9",0x7086],
- ["9ECA",0x7087],
- ["9ECB",0x7088],
- ["C2AF",0x7089],
- ["B4B6",0x708A],
- ["9ECC",0x708B],
- ["9ECD",0x708C],
- ["9ECE",0x708D],
- ["D1D7",0x708E],
- ["9ECF",0x708F],
- ["9ED0",0x7090],
- ["9ED1",0x7091],
- ["B3B4",0x7092],
- ["9ED2",0x7093],
- ["C8B2",0x7094],
- ["BFBB",0x7095],
- ["ECC0",0x7096],
- ["9ED3",0x7097],
- ["9ED4",0x7098],
- ["D6CB",0x7099],
- ["9ED5",0x709A],
- ["9ED6",0x709B],
- ["ECBF",0x709C],
- ["ECC1",0x709D],
- ["9ED7",0x709E],
- ["9ED8",0x709F],
- ["9ED9",0x70A0],
- ["9EDA",0x70A1],
- ["9EDB",0x70A2],
- ["9EDC",0x70A3],
- ["9EDD",0x70A4],
- ["9EDE",0x70A5],
- ["9EDF",0x70A6],
- ["9EE0",0x70A7],
- ["9EE1",0x70A8],
- ["9EE2",0x70A9],
- ["9EE3",0x70AA],
- ["ECC5",0x70AB],
- ["BEE6",0x70AC],
- ["CCBF",0x70AD],
- ["C5DA",0x70AE],
- ["BEBC",0x70AF],
- ["9EE4",0x70B0],
- ["ECC6",0x70B1],
- ["9EE5",0x70B2],
- ["B1FE",0x70B3],
- ["9EE6",0x70B4],
- ["9EE7",0x70B5],
- ["9EE8",0x70B6],
- ["ECC4",0x70B7],
- ["D5A8",0x70B8],
- ["B5E3",0x70B9],
- ["9EE9",0x70BA],
- ["ECC2",0x70BB],
- ["C1B6",0x70BC],
- ["B3E3",0x70BD],
- ["9EEA",0x70BE],
- ["9EEB",0x70BF],
- ["ECC3",0x70C0],
- ["CBB8",0x70C1],
- ["C0C3",0x70C2],
- ["CCFE",0x70C3],
- ["9EEC",0x70C4],
- ["9EED",0x70C5],
- ["9EEE",0x70C6],
- ["9EEF",0x70C7],
- ["C1D2",0x70C8],
- ["9EF0",0x70C9],
- ["ECC8",0x70CA],
- ["9EF1",0x70CB],
- ["9EF2",0x70CC],
- ["9EF3",0x70CD],
- ["9EF4",0x70CE],
- ["9EF5",0x70CF],
- ["9EF6",0x70D0],
- ["9EF7",0x70D1],
- ["9EF8",0x70D2],
- ["9EF9",0x70D3],
- ["9EFA",0x70D4],
- ["9EFB",0x70D5],
- ["9EFC",0x70D6],
- ["9EFD",0x70D7],
- ["BAE6",0x70D8],
- ["C0D3",0x70D9],
- ["9EFE",0x70DA],
- ["D6F2",0x70DB],
- ["9F40",0x70DC],
- ["9F41",0x70DD],
- ["9F42",0x70DE],
- ["D1CC",0x70DF],
- ["9F43",0x70E0],
- ["9F44",0x70E1],
- ["9F45",0x70E2],
- ["9F46",0x70E3],
- ["BFBE",0x70E4],
- ["9F47",0x70E5],
- ["B7B3",0x70E6],
- ["C9D5",0x70E7],
- ["ECC7",0x70E8],
- ["BBE2",0x70E9],
- ["9F48",0x70EA],
- ["CCCC",0x70EB],
- ["BDFD",0x70EC],
- ["C8C8",0x70ED],
- ["9F49",0x70EE],
- ["CFA9",0x70EF],
- ["9F4A",0x70F0],
- ["9F4B",0x70F1],
- ["9F4C",0x70F2],
- ["9F4D",0x70F3],
- ["9F4E",0x70F4],
- ["9F4F",0x70F5],
- ["9F50",0x70F6],
- ["CDE9",0x70F7],
- ["9F51",0x70F8],
- ["C5EB",0x70F9],
- ["9F52",0x70FA],
- ["9F53",0x70FB],
- ["9F54",0x70FC],
- ["B7E9",0x70FD],
- ["9F55",0x70FE],
- ["9F56",0x70FF],
- ["9F57",0x7100],
- ["9F58",0x7101],
- ["9F59",0x7102],
- ["9F5A",0x7103],
- ["9F5B",0x7104],
- ["9F5C",0x7105],
- ["9F5D",0x7106],
- ["9F5E",0x7107],
- ["9F5F",0x7108],
- ["D1C9",0x7109],
- ["BAB8",0x710A],
- ["9F60",0x710B],
- ["9F61",0x710C],
- ["9F62",0x710D],
- ["9F63",0x710E],
- ["9F64",0x710F],
- ["ECC9",0x7110],
- ["9F65",0x7111],
- ["9F66",0x7112],
- ["ECCA",0x7113],
- ["9F67",0x7114],
- ["BBC0",0x7115],
- ["ECCB",0x7116],
- ["9F68",0x7117],
- ["ECE2",0x7118],
- ["B1BA",0x7119],
- ["B7D9",0x711A],
- ["9F69",0x711B],
- ["9F6A",0x711C],
- ["9F6B",0x711D],
- ["9F6C",0x711E],
- ["9F6D",0x711F],
- ["9F6E",0x7120],
- ["9F6F",0x7121],
- ["9F70",0x7122],
- ["9F71",0x7123],
- ["9F72",0x7124],
- ["9F73",0x7125],
- ["BDB9",0x7126],
- ["9F74",0x7127],
- ["9F75",0x7128],
- ["9F76",0x7129],
- ["9F77",0x712A],
- ["9F78",0x712B],
- ["9F79",0x712C],
- ["9F7A",0x712D],
- ["9F7B",0x712E],
- ["ECCC",0x712F],
- ["D1E6",0x7130],
- ["ECCD",0x7131],
- ["9F7C",0x7132],
- ["9F7D",0x7133],
- ["9F7E",0x7134],
- ["9F80",0x7135],
- ["C8BB",0x7136],
- ["9F81",0x7137],
- ["9F82",0x7138],
- ["9F83",0x7139],
- ["9F84",0x713A],
- ["9F85",0x713B],
- ["9F86",0x713C],
- ["9F87",0x713D],
- ["9F88",0x713E],
- ["9F89",0x713F],
- ["9F8A",0x7140],
- ["9F8B",0x7141],
- ["9F8C",0x7142],
- ["9F8D",0x7143],
- ["9F8E",0x7144],
- ["ECD1",0x7145],
- ["9F8F",0x7146],
- ["9F90",0x7147],
- ["9F91",0x7148],
- ["9F92",0x7149],
- ["ECD3",0x714A],
- ["9F93",0x714B],
- ["BBCD",0x714C],
- ["9F94",0x714D],
- ["BCE5",0x714E],
- ["9F95",0x714F],
- ["9F96",0x7150],
- ["9F97",0x7151],
- ["9F98",0x7152],
- ["9F99",0x7153],
- ["9F9A",0x7154],
- ["9F9B",0x7155],
- ["9F9C",0x7156],
- ["9F9D",0x7157],
- ["9F9E",0x7158],
- ["9F9F",0x7159],
- ["9FA0",0x715A],
- ["9FA1",0x715B],
- ["ECCF",0x715C],
- ["9FA2",0x715D],
- ["C9B7",0x715E],
- ["9FA3",0x715F],
- ["9FA4",0x7160],
- ["9FA5",0x7161],
- ["9FA6",0x7162],
- ["9FA7",0x7163],
- ["C3BA",0x7164],
- ["9FA8",0x7165],
- ["ECE3",0x7166],
- ["D5D5",0x7167],
- ["ECD0",0x7168],
- ["9FA9",0x7169],
- ["9FAA",0x716A],
- ["9FAB",0x716B],
- ["9FAC",0x716C],
- ["9FAD",0x716D],
- ["D6F3",0x716E],
- ["9FAE",0x716F],
- ["9FAF",0x7170],
- ["9FB0",0x7171],
- ["ECD2",0x7172],
- ["ECCE",0x7173],
- ["9FB1",0x7174],
- ["9FB2",0x7175],
- ["9FB3",0x7176],
- ["9FB4",0x7177],
- ["ECD4",0x7178],
- ["9FB5",0x7179],
- ["ECD5",0x717A],
- ["9FB6",0x717B],
- ["9FB7",0x717C],
- ["C9BF",0x717D],
- ["9FB8",0x717E],
- ["9FB9",0x717F],
- ["9FBA",0x7180],
- ["9FBB",0x7181],
- ["9FBC",0x7182],
- ["9FBD",0x7183],
- ["CFA8",0x7184],
- ["9FBE",0x7185],
- ["9FBF",0x7186],
- ["9FC0",0x7187],
- ["9FC1",0x7188],
- ["9FC2",0x7189],
- ["D0DC",0x718A],
- ["9FC3",0x718B],
- ["9FC4",0x718C],
- ["9FC5",0x718D],
- ["9FC6",0x718E],
- ["D1AC",0x718F],
- ["9FC7",0x7190],
- ["9FC8",0x7191],
- ["9FC9",0x7192],
- ["9FCA",0x7193],
- ["C8DB",0x7194],
- ["9FCB",0x7195],
- ["9FCC",0x7196],
- ["9FCD",0x7197],
- ["ECD6",0x7198],
- ["CEF5",0x7199],
- ["9FCE",0x719A],
- ["9FCF",0x719B],
- ["9FD0",0x719C],
- ["9FD1",0x719D],
- ["9FD2",0x719E],
- ["CAEC",0x719F],
- ["ECDA",0x71A0],
- ["9FD3",0x71A1],
- ["9FD4",0x71A2],
- ["9FD5",0x71A3],
- ["9FD6",0x71A4],
- ["9FD7",0x71A5],
- ["9FD8",0x71A6],
- ["9FD9",0x71A7],
- ["ECD9",0x71A8],
- ["9FDA",0x71A9],
- ["9FDB",0x71AA],
- ["9FDC",0x71AB],
- ["B0BE",0x71AC],
- ["9FDD",0x71AD],
- ["9FDE",0x71AE],
- ["9FDF",0x71AF],
- ["9FE0",0x71B0],
- ["9FE1",0x71B1],
- ["9FE2",0x71B2],
- ["ECD7",0x71B3],
- ["9FE3",0x71B4],
- ["ECD8",0x71B5],
- ["9FE4",0x71B6],
- ["9FE5",0x71B7],
- ["9FE6",0x71B8],
- ["ECE4",0x71B9],
- ["9FE7",0x71BA],
- ["9FE8",0x71BB],
- ["9FE9",0x71BC],
- ["9FEA",0x71BD],
- ["9FEB",0x71BE],
- ["9FEC",0x71BF],
- ["9FED",0x71C0],
- ["9FEE",0x71C1],
- ["9FEF",0x71C2],
- ["C8BC",0x71C3],
- ["9FF0",0x71C4],
- ["9FF1",0x71C5],
- ["9FF2",0x71C6],
- ["9FF3",0x71C7],
- ["9FF4",0x71C8],
- ["9FF5",0x71C9],
- ["9FF6",0x71CA],
- ["9FF7",0x71CB],
- ["9FF8",0x71CC],
- ["9FF9",0x71CD],
- ["C1C7",0x71CE],
- ["9FFA",0x71CF],
- ["9FFB",0x71D0],
- ["9FFC",0x71D1],
- ["9FFD",0x71D2],
- ["9FFE",0x71D3],
- ["ECDC",0x71D4],
- ["D1E0",0x71D5],
- ["A040",0x71D6],
- ["A041",0x71D7],
- ["A042",0x71D8],
- ["A043",0x71D9],
- ["A044",0x71DA],
- ["A045",0x71DB],
- ["A046",0x71DC],
- ["A047",0x71DD],
- ["A048",0x71DE],
- ["A049",0x71DF],
- ["ECDB",0x71E0],
- ["A04A",0x71E1],
- ["A04B",0x71E2],
- ["A04C",0x71E3],
- ["A04D",0x71E4],
- ["D4EF",0x71E5],
- ["A04E",0x71E6],
- ["ECDD",0x71E7],
- ["A04F",0x71E8],
- ["A050",0x71E9],
- ["A051",0x71EA],
- ["A052",0x71EB],
- ["A053",0x71EC],
- ["A054",0x71ED],
- ["DBC6",0x71EE],
- ["A055",0x71EF],
- ["A056",0x71F0],
- ["A057",0x71F1],
- ["A058",0x71F2],
- ["A059",0x71F3],
- ["A05A",0x71F4],
- ["A05B",0x71F5],
- ["A05C",0x71F6],
- ["A05D",0x71F7],
- ["A05E",0x71F8],
- ["ECDE",0x71F9],
- ["A05F",0x71FA],
- ["A060",0x71FB],
- ["A061",0x71FC],
- ["A062",0x71FD],
- ["A063",0x71FE],
- ["A064",0x71FF],
- ["A065",0x7200],
- ["A066",0x7201],
- ["A067",0x7202],
- ["A068",0x7203],
- ["A069",0x7204],
- ["A06A",0x7205],
- ["B1AC",0x7206],
- ["A06B",0x7207],
- ["A06C",0x7208],
- ["A06D",0x7209],
- ["A06E",0x720A],
- ["A06F",0x720B],
- ["A070",0x720C],
- ["A071",0x720D],
- ["A072",0x720E],
- ["A073",0x720F],
- ["A074",0x7210],
- ["A075",0x7211],
- ["A076",0x7212],
- ["A077",0x7213],
- ["A078",0x7214],
- ["A079",0x7215],
- ["A07A",0x7216],
- ["A07B",0x7217],
- ["A07C",0x7218],
- ["A07D",0x7219],
- ["A07E",0x721A],
- ["A080",0x721B],
- ["A081",0x721C],
- ["ECDF",0x721D],
- ["A082",0x721E],
- ["A083",0x721F],
- ["A084",0x7220],
- ["A085",0x7221],
- ["A086",0x7222],
- ["A087",0x7223],
- ["A088",0x7224],
- ["A089",0x7225],
- ["A08A",0x7226],
- ["A08B",0x7227],
- ["ECE0",0x7228],
- ["A08C",0x7229],
- ["D7A6",0x722A],
- ["A08D",0x722B],
- ["C5C0",0x722C],
- ["A08E",0x722D],
- ["A08F",0x722E],
- ["A090",0x722F],
- ["EBBC",0x7230],
- ["B0AE",0x7231],
- ["A091",0x7232],
- ["A092",0x7233],
- ["A093",0x7234],
- ["BEF4",0x7235],
- ["B8B8",0x7236],
- ["D2AF",0x7237],
- ["B0D6",0x7238],
- ["B5F9",0x7239],
- ["A094",0x723A],
- ["D8B3",0x723B],
- ["A095",0x723C],
- ["CBAC",0x723D],
- ["A096",0x723E],
- ["E3DD",0x723F],
- ["A097",0x7240],
- ["A098",0x7241],
- ["A099",0x7242],
- ["A09A",0x7243],
- ["A09B",0x7244],
- ["A09C",0x7245],
- ["A09D",0x7246],
- ["C6AC",0x7247],
- ["B0E6",0x7248],
- ["A09E",0x7249],
- ["A09F",0x724A],
- ["A0A0",0x724B],
- ["C5C6",0x724C],
- ["EBB9",0x724D],
- ["A0A1",0x724E],
- ["A0A2",0x724F],
- ["A0A3",0x7250],
- ["A0A4",0x7251],
- ["EBBA",0x7252],
- ["A0A5",0x7253],
- ["A0A6",0x7254],
- ["A0A7",0x7255],
- ["EBBB",0x7256],
- ["A0A8",0x7257],
- ["A0A9",0x7258],
- ["D1C0",0x7259],
- ["A0AA",0x725A],
- ["C5A3",0x725B],
- ["A0AB",0x725C],
- ["EAF2",0x725D],
- ["A0AC",0x725E],
- ["C4B2",0x725F],
- ["A0AD",0x7260],
- ["C4B5",0x7261],
- ["C0CE",0x7262],
- ["A0AE",0x7263],
- ["A0AF",0x7264],
- ["A0B0",0x7265],
- ["EAF3",0x7266],
- ["C4C1",0x7267],
- ["A0B1",0x7268],
- ["CEEF",0x7269],
- ["A0B2",0x726A],
- ["A0B3",0x726B],
- ["A0B4",0x726C],
- ["A0B5",0x726D],
- ["EAF0",0x726E],
- ["EAF4",0x726F],
- ["A0B6",0x7270],
- ["A0B7",0x7271],
- ["C9FC",0x7272],
- ["A0B8",0x7273],
- ["A0B9",0x7274],
- ["C7A3",0x7275],
- ["A0BA",0x7276],
- ["A0BB",0x7277],
- ["A0BC",0x7278],
- ["CCD8",0x7279],
- ["CEFE",0x727A],
- ["A0BD",0x727B],
- ["A0BE",0x727C],
- ["A0BF",0x727D],
- ["EAF5",0x727E],
- ["EAF6",0x727F],
- ["CFAC",0x7280],
- ["C0E7",0x7281],
- ["A0C0",0x7282],
- ["A0C1",0x7283],
- ["EAF7",0x7284],
- ["A0C2",0x7285],
- ["A0C3",0x7286],
- ["A0C4",0x7287],
- ["A0C5",0x7288],
- ["A0C6",0x7289],
- ["B6BF",0x728A],
- ["EAF8",0x728B],
- ["A0C7",0x728C],
- ["EAF9",0x728D],
- ["A0C8",0x728E],
- ["EAFA",0x728F],
- ["A0C9",0x7290],
- ["A0CA",0x7291],
- ["EAFB",0x7292],
- ["A0CB",0x7293],
- ["A0CC",0x7294],
- ["A0CD",0x7295],
- ["A0CE",0x7296],
- ["A0CF",0x7297],
- ["A0D0",0x7298],
- ["A0D1",0x7299],
- ["A0D2",0x729A],
- ["A0D3",0x729B],
- ["A0D4",0x729C],
- ["A0D5",0x729D],
- ["A0D6",0x729E],
- ["EAF1",0x729F],
- ["A0D7",0x72A0],
- ["A0D8",0x72A1],
- ["A0D9",0x72A2],
- ["A0DA",0x72A3],
- ["A0DB",0x72A4],
- ["A0DC",0x72A5],
- ["A0DD",0x72A6],
- ["A0DE",0x72A7],
- ["A0DF",0x72A8],
- ["A0E0",0x72A9],
- ["A0E1",0x72AA],
- ["A0E2",0x72AB],
- ["C8AE",0x72AC],
- ["E1EB",0x72AD],
- ["A0E3",0x72AE],
- ["B7B8",0x72AF],
- ["E1EC",0x72B0],
- ["A0E4",0x72B1],
- ["A0E5",0x72B2],
- ["A0E6",0x72B3],
- ["E1ED",0x72B4],
- ["A0E7",0x72B5],
- ["D7B4",0x72B6],
- ["E1EE",0x72B7],
- ["E1EF",0x72B8],
- ["D3CC",0x72B9],
- ["A0E8",0x72BA],
- ["A0E9",0x72BB],
- ["A0EA",0x72BC],
- ["A0EB",0x72BD],
- ["A0EC",0x72BE],
- ["A0ED",0x72BF],
- ["A0EE",0x72C0],
- ["E1F1",0x72C1],
- ["BFF1",0x72C2],
- ["E1F0",0x72C3],
- ["B5D2",0x72C4],
- ["A0EF",0x72C5],
- ["A0F0",0x72C6],
- ["A0F1",0x72C7],
- ["B1B7",0x72C8],
- ["A0F2",0x72C9],
- ["A0F3",0x72CA],
- ["A0F4",0x72CB],
- ["A0F5",0x72CC],
- ["E1F3",0x72CD],
- ["E1F2",0x72CE],
- ["A0F6",0x72CF],
- ["BAFC",0x72D0],
- ["A0F7",0x72D1],
- ["E1F4",0x72D2],
- ["A0F8",0x72D3],
- ["A0F9",0x72D4],
- ["A0FA",0x72D5],
- ["A0FB",0x72D6],
- ["B9B7",0x72D7],
- ["A0FC",0x72D8],
- ["BED1",0x72D9],
- ["A0FD",0x72DA],
- ["A0FE",0x72DB],
- ["AA40",0x72DC],
- ["AA41",0x72DD],
- ["C4FC",0x72DE],
- ["AA42",0x72DF],
- ["BADD",0x72E0],
- ["BDC6",0x72E1],
- ["AA43",0x72E2],
- ["AA44",0x72E3],
- ["AA45",0x72E4],
- ["AA46",0x72E5],
- ["AA47",0x72E6],
- ["AA48",0x72E7],
- ["E1F5",0x72E8],
- ["E1F7",0x72E9],
- ["AA49",0x72EA],
- ["AA4A",0x72EB],
- ["B6C0",0x72EC],
- ["CFC1",0x72ED],
- ["CAA8",0x72EE],
- ["E1F6",0x72EF],
- ["D5F8",0x72F0],
- ["D3FC",0x72F1],
- ["E1F8",0x72F2],
- ["E1FC",0x72F3],
- ["E1F9",0x72F4],
- ["AA4B",0x72F5],
- ["AA4C",0x72F6],
- ["E1FA",0x72F7],
- ["C0EA",0x72F8],
- ["AA4D",0x72F9],
- ["E1FE",0x72FA],
- ["E2A1",0x72FB],
- ["C0C7",0x72FC],
- ["AA4E",0x72FD],
- ["AA4F",0x72FE],
- ["AA50",0x72FF],
- ["AA51",0x7300],
- ["E1FB",0x7301],
- ["AA52",0x7302],
- ["E1FD",0x7303],
- ["AA53",0x7304],
- ["AA54",0x7305],
- ["AA55",0x7306],
- ["AA56",0x7307],
- ["AA57",0x7308],
- ["AA58",0x7309],
- ["E2A5",0x730A],
- ["AA59",0x730B],
- ["AA5A",0x730C],
- ["AA5B",0x730D],
- ["C1D4",0x730E],
- ["AA5C",0x730F],
- ["AA5D",0x7310],
- ["AA5E",0x7311],
- ["AA5F",0x7312],
- ["E2A3",0x7313],
- ["AA60",0x7314],
- ["E2A8",0x7315],
- ["B2FE",0x7316],
- ["E2A2",0x7317],
- ["AA61",0x7318],
- ["AA62",0x7319],
- ["AA63",0x731A],
- ["C3CD",0x731B],
- ["B2C2",0x731C],
- ["E2A7",0x731D],
- ["E2A6",0x731E],
- ["AA64",0x731F],
- ["AA65",0x7320],
- ["E2A4",0x7321],
- ["E2A9",0x7322],
- ["AA66",0x7323],
- ["AA67",0x7324],
- ["E2AB",0x7325],
- ["AA68",0x7326],
- ["AA69",0x7327],
- ["AA6A",0x7328],
- ["D0C9",0x7329],
- ["D6ED",0x732A],
- ["C3A8",0x732B],
- ["E2AC",0x732C],
- ["AA6B",0x732D],
- ["CFD7",0x732E],
- ["AA6C",0x732F],
- ["AA6D",0x7330],
- ["E2AE",0x7331],
- ["AA6E",0x7332],
- ["AA6F",0x7333],
- ["BAEF",0x7334],
- ["AA70",0x7335],
- ["AA71",0x7336],
- ["E9E0",0x7337],
- ["E2AD",0x7338],
- ["E2AA",0x7339],
- ["AA72",0x733A],
- ["AA73",0x733B],
- ["AA74",0x733C],
- ["AA75",0x733D],
- ["BBAB",0x733E],
- ["D4B3",0x733F],
- ["AA76",0x7340],
- ["AA77",0x7341],
- ["AA78",0x7342],
- ["AA79",0x7343],
- ["AA7A",0x7344],
- ["AA7B",0x7345],
- ["AA7C",0x7346],
- ["AA7D",0x7347],
- ["AA7E",0x7348],
- ["AA80",0x7349],
- ["AA81",0x734A],
- ["AA82",0x734B],
- ["AA83",0x734C],
- ["E2B0",0x734D],
- ["AA84",0x734E],
- ["AA85",0x734F],
- ["E2AF",0x7350],
- ["AA86",0x7351],
- ["E9E1",0x7352],
- ["AA87",0x7353],
- ["AA88",0x7354],
- ["AA89",0x7355],
- ["AA8A",0x7356],
- ["E2B1",0x7357],
- ["AA8B",0x7358],
- ["AA8C",0x7359],
- ["AA8D",0x735A],
- ["AA8E",0x735B],
- ["AA8F",0x735C],
- ["AA90",0x735D],
- ["AA91",0x735E],
- ["AA92",0x735F],
- ["E2B2",0x7360],
- ["AA93",0x7361],
- ["AA94",0x7362],
- ["AA95",0x7363],
- ["AA96",0x7364],
- ["AA97",0x7365],
- ["AA98",0x7366],
- ["AA99",0x7367],
- ["AA9A",0x7368],
- ["AA9B",0x7369],
- ["AA9C",0x736A],
- ["AA9D",0x736B],
- ["E2B3",0x736C],
- ["CCA1",0x736D],
- ["AA9E",0x736E],
- ["E2B4",0x736F],
- ["AA9F",0x7370],
- ["AAA0",0x7371],
- ["AB40",0x7372],
- ["AB41",0x7373],
- ["AB42",0x7374],
- ["AB43",0x7375],
- ["AB44",0x7376],
- ["AB45",0x7377],
- ["AB46",0x7378],
- ["AB47",0x7379],
- ["AB48",0x737A],
- ["AB49",0x737B],
- ["AB4A",0x737C],
- ["AB4B",0x737D],
- ["E2B5",0x737E],
- ["AB4C",0x737F],
- ["AB4D",0x7380],
- ["AB4E",0x7381],
- ["AB4F",0x7382],
- ["AB50",0x7383],
- ["D0FE",0x7384],
- ["AB51",0x7385],
- ["AB52",0x7386],
- ["C2CA",0x7387],
- ["AB53",0x7388],
- ["D3F1",0x7389],
- ["AB54",0x738A],
- ["CDF5",0x738B],
- ["AB55",0x738C],
- ["AB56",0x738D],
- ["E7E0",0x738E],
- ["AB57",0x738F],
- ["AB58",0x7390],
- ["E7E1",0x7391],
- ["AB59",0x7392],
- ["AB5A",0x7393],
- ["AB5B",0x7394],
- ["AB5C",0x7395],
- ["BEC1",0x7396],
- ["AB5D",0x7397],
- ["AB5E",0x7398],
- ["AB5F",0x7399],
- ["AB60",0x739A],
- ["C2EA",0x739B],
- ["AB61",0x739C],
- ["AB62",0x739D],
- ["AB63",0x739E],
- ["E7E4",0x739F],
- ["AB64",0x73A0],
- ["AB65",0x73A1],
- ["E7E3",0x73A2],
- ["AB66",0x73A3],
- ["AB67",0x73A4],
- ["AB68",0x73A5],
- ["AB69",0x73A6],
- ["AB6A",0x73A7],
- ["AB6B",0x73A8],
- ["CDE6",0x73A9],
- ["AB6C",0x73AA],
- ["C3B5",0x73AB],
- ["AB6D",0x73AC],
- ["AB6E",0x73AD],
- ["E7E2",0x73AE],
- ["BBB7",0x73AF],
- ["CFD6",0x73B0],
- ["AB6F",0x73B1],
- ["C1E1",0x73B2],
- ["E7E9",0x73B3],
- ["AB70",0x73B4],
- ["AB71",0x73B5],
- ["AB72",0x73B6],
- ["E7E8",0x73B7],
- ["AB73",0x73B8],
- ["AB74",0x73B9],
- ["E7F4",0x73BA],
- ["B2A3",0x73BB],
- ["AB75",0x73BC],
- ["AB76",0x73BD],
- ["AB77",0x73BE],
- ["AB78",0x73BF],
- ["E7EA",0x73C0],
- ["AB79",0x73C1],
- ["E7E6",0x73C2],
- ["AB7A",0x73C3],
- ["AB7B",0x73C4],
- ["AB7C",0x73C5],
- ["AB7D",0x73C6],
- ["AB7E",0x73C7],
- ["E7EC",0x73C8],
- ["E7EB",0x73C9],
- ["C9BA",0x73CA],
- ["AB80",0x73CB],
- ["AB81",0x73CC],
- ["D5E4",0x73CD],
- ["AB82",0x73CE],
- ["E7E5",0x73CF],
- ["B7A9",0x73D0],
- ["E7E7",0x73D1],
- ["AB83",0x73D2],
- ["AB84",0x73D3],
- ["AB85",0x73D4],
- ["AB86",0x73D5],
- ["AB87",0x73D6],
- ["AB88",0x73D7],
- ["AB89",0x73D8],
- ["E7EE",0x73D9],
- ["AB8A",0x73DA],
- ["AB8B",0x73DB],
- ["AB8C",0x73DC],
- ["AB8D",0x73DD],
- ["E7F3",0x73DE],
- ["AB8E",0x73DF],
- ["D6E9",0x73E0],
- ["AB8F",0x73E1],
- ["AB90",0x73E2],
- ["AB91",0x73E3],
- ["AB92",0x73E4],
- ["E7ED",0x73E5],
- ["AB93",0x73E6],
- ["E7F2",0x73E7],
- ["AB94",0x73E8],
- ["E7F1",0x73E9],
- ["AB95",0x73EA],
- ["AB96",0x73EB],
- ["AB97",0x73EC],
- ["B0E0",0x73ED],
- ["AB98",0x73EE],
- ["AB99",0x73EF],
- ["AB9A",0x73F0],
- ["AB9B",0x73F1],
- ["E7F5",0x73F2],
- ["AB9C",0x73F3],
- ["AB9D",0x73F4],
- ["AB9E",0x73F5],
- ["AB9F",0x73F6],
- ["ABA0",0x73F7],
- ["AC40",0x73F8],
- ["AC41",0x73F9],
- ["AC42",0x73FA],
- ["AC43",0x73FB],
- ["AC44",0x73FC],
- ["AC45",0x73FD],
- ["AC46",0x73FE],
- ["AC47",0x73FF],
- ["AC48",0x7400],
- ["AC49",0x7401],
- ["AC4A",0x7402],
- ["C7F2",0x7403],
- ["AC4B",0x7404],
- ["C0C5",0x7405],
- ["C0ED",0x7406],
- ["AC4C",0x7407],
- ["AC4D",0x7408],
- ["C1F0",0x7409],
- ["E7F0",0x740A],
- ["AC4E",0x740B],
- ["AC4F",0x740C],
- ["AC50",0x740D],
- ["AC51",0x740E],
- ["E7F6",0x740F],
- ["CBF6",0x7410],
- ["AC52",0x7411],
- ["AC53",0x7412],
- ["AC54",0x7413],
- ["AC55",0x7414],
- ["AC56",0x7415],
- ["AC57",0x7416],
- ["AC58",0x7417],
- ["AC59",0x7418],
- ["AC5A",0x7419],
- ["E8A2",0x741A],
- ["E8A1",0x741B],
- ["AC5B",0x741C],
- ["AC5C",0x741D],
- ["AC5D",0x741E],
- ["AC5E",0x741F],
- ["AC5F",0x7420],
- ["AC60",0x7421],
- ["D7C1",0x7422],
- ["AC61",0x7423],
- ["AC62",0x7424],
- ["E7FA",0x7425],
- ["E7F9",0x7426],
- ["AC63",0x7427],
- ["E7FB",0x7428],
- ["AC64",0x7429],
- ["E7F7",0x742A],
- ["AC65",0x742B],
- ["E7FE",0x742C],
- ["AC66",0x742D],
- ["E7FD",0x742E],
- ["AC67",0x742F],
- ["E7FC",0x7430],
- ["AC68",0x7431],
- ["AC69",0x7432],
- ["C1D5",0x7433],
- ["C7D9",0x7434],
- ["C5FD",0x7435],
- ["C5C3",0x7436],
- ["AC6A",0x7437],
- ["AC6B",0x7438],
- ["AC6C",0x7439],
- ["AC6D",0x743A],
- ["AC6E",0x743B],
- ["C7ED",0x743C],
- ["AC6F",0x743D],
- ["AC70",0x743E],
- ["AC71",0x743F],
- ["AC72",0x7440],
- ["E8A3",0x7441],
- ["AC73",0x7442],
- ["AC74",0x7443],
- ["AC75",0x7444],
- ["AC76",0x7445],
- ["AC77",0x7446],
- ["AC78",0x7447],
- ["AC79",0x7448],
- ["AC7A",0x7449],
- ["AC7B",0x744A],
- ["AC7C",0x744B],
- ["AC7D",0x744C],
- ["AC7E",0x744D],
- ["AC80",0x744E],
- ["AC81",0x744F],
- ["AC82",0x7450],
- ["AC83",0x7451],
- ["AC84",0x7452],
- ["AC85",0x7453],
- ["AC86",0x7454],
- ["E8A6",0x7455],
- ["AC87",0x7456],
- ["E8A5",0x7457],
- ["AC88",0x7458],
- ["E8A7",0x7459],
- ["BAF7",0x745A],
- ["E7F8",0x745B],
- ["E8A4",0x745C],
- ["AC89",0x745D],
- ["C8F0",0x745E],
- ["C9AA",0x745F],
- ["AC8A",0x7460],
- ["AC8B",0x7461],
- ["AC8C",0x7462],
- ["AC8D",0x7463],
- ["AC8E",0x7464],
- ["AC8F",0x7465],
- ["AC90",0x7466],
- ["AC91",0x7467],
- ["AC92",0x7468],
- ["AC93",0x7469],
- ["AC94",0x746A],
- ["AC95",0x746B],
- ["AC96",0x746C],
- ["E8A9",0x746D],
- ["AC97",0x746E],
- ["AC98",0x746F],
- ["B9E5",0x7470],
- ["AC99",0x7471],
- ["AC9A",0x7472],
- ["AC9B",0x7473],
- ["AC9C",0x7474],
- ["AC9D",0x7475],
- ["D1FE",0x7476],
- ["E8A8",0x7477],
- ["AC9E",0x7478],
- ["AC9F",0x7479],
- ["ACA0",0x747A],
- ["AD40",0x747B],
- ["AD41",0x747C],
- ["AD42",0x747D],
- ["E8AA",0x747E],
- ["AD43",0x747F],
- ["E8AD",0x7480],
- ["E8AE",0x7481],
- ["AD44",0x7482],
- ["C1A7",0x7483],
- ["AD45",0x7484],
- ["AD46",0x7485],
- ["AD47",0x7486],
- ["E8AF",0x7487],
- ["AD48",0x7488],
- ["AD49",0x7489],
- ["AD4A",0x748A],
- ["E8B0",0x748B],
- ["AD4B",0x748C],
- ["AD4C",0x748D],
- ["E8AC",0x748E],
- ["AD4D",0x748F],
- ["E8B4",0x7490],
- ["AD4E",0x7491],
- ["AD4F",0x7492],
- ["AD50",0x7493],
- ["AD51",0x7494],
- ["AD52",0x7495],
- ["AD53",0x7496],
- ["AD54",0x7497],
- ["AD55",0x7498],
- ["AD56",0x7499],
- ["AD57",0x749A],
- ["AD58",0x749B],
- ["E8AB",0x749C],
- ["AD59",0x749D],
- ["E8B1",0x749E],
- ["AD5A",0x749F],
- ["AD5B",0x74A0],
- ["AD5C",0x74A1],
- ["AD5D",0x74A2],
- ["AD5E",0x74A3],
- ["AD5F",0x74A4],
- ["AD60",0x74A5],
- ["AD61",0x74A6],
- ["E8B5",0x74A7],
- ["E8B2",0x74A8],
- ["E8B3",0x74A9],
- ["AD62",0x74AA],
- ["AD63",0x74AB],
- ["AD64",0x74AC],
- ["AD65",0x74AD],
- ["AD66",0x74AE],
- ["AD67",0x74AF],
- ["AD68",0x74B0],
- ["AD69",0x74B1],
- ["AD6A",0x74B2],
- ["AD6B",0x74B3],
- ["AD6C",0x74B4],
- ["AD6D",0x74B5],
- ["AD6E",0x74B6],
- ["AD6F",0x74B7],
- ["AD70",0x74B8],
- ["AD71",0x74B9],
- ["E8B7",0x74BA],
- ["AD72",0x74BB],
- ["AD73",0x74BC],
- ["AD74",0x74BD],
- ["AD75",0x74BE],
- ["AD76",0x74BF],
- ["AD77",0x74C0],
- ["AD78",0x74C1],
- ["AD79",0x74C2],
- ["AD7A",0x74C3],
- ["AD7B",0x74C4],
- ["AD7C",0x74C5],
- ["AD7D",0x74C6],
- ["AD7E",0x74C7],
- ["AD80",0x74C8],
- ["AD81",0x74C9],
- ["AD82",0x74CA],
- ["AD83",0x74CB],
- ["AD84",0x74CC],
- ["AD85",0x74CD],
- ["AD86",0x74CE],
- ["AD87",0x74CF],
- ["AD88",0x74D0],
- ["AD89",0x74D1],
- ["E8B6",0x74D2],
- ["AD8A",0x74D3],
- ["AD8B",0x74D4],
- ["AD8C",0x74D5],
- ["AD8D",0x74D6],
- ["AD8E",0x74D7],
- ["AD8F",0x74D8],
- ["AD90",0x74D9],
- ["AD91",0x74DA],
- ["AD92",0x74DB],
- ["B9CF",0x74DC],
- ["AD93",0x74DD],
- ["F0AC",0x74DE],
- ["AD94",0x74DF],
- ["F0AD",0x74E0],
- ["AD95",0x74E1],
- ["C6B0",0x74E2],
- ["B0EA",0x74E3],
- ["C8BF",0x74E4],
- ["AD96",0x74E5],
- ["CDDF",0x74E6],
- ["AD97",0x74E7],
- ["AD98",0x74E8],
- ["AD99",0x74E9],
- ["AD9A",0x74EA],
- ["AD9B",0x74EB],
- ["AD9C",0x74EC],
- ["AD9D",0x74ED],
- ["CECD",0x74EE],
- ["EAB1",0x74EF],
- ["AD9E",0x74F0],
- ["AD9F",0x74F1],
- ["ADA0",0x74F2],
- ["AE40",0x74F3],
- ["EAB2",0x74F4],
- ["AE41",0x74F5],
- ["C6BF",0x74F6],
- ["B4C9",0x74F7],
- ["AE42",0x74F8],
- ["AE43",0x74F9],
- ["AE44",0x74FA],
- ["AE45",0x74FB],
- ["AE46",0x74FC],
- ["AE47",0x74FD],
- ["AE48",0x74FE],
- ["EAB3",0x74FF],
- ["AE49",0x7500],
- ["AE4A",0x7501],
- ["AE4B",0x7502],
- ["AE4C",0x7503],
- ["D5E7",0x7504],
- ["AE4D",0x7505],
- ["AE4E",0x7506],
- ["AE4F",0x7507],
- ["AE50",0x7508],
- ["AE51",0x7509],
- ["AE52",0x750A],
- ["AE53",0x750B],
- ["AE54",0x750C],
- ["DDF9",0x750D],
- ["AE55",0x750E],
- ["EAB4",0x750F],
- ["AE56",0x7510],
- ["EAB5",0x7511],
- ["AE57",0x7512],
- ["EAB6",0x7513],
- ["AE58",0x7514],
- ["AE59",0x7515],
- ["AE5A",0x7516],
- ["AE5B",0x7517],
- ["B8CA",0x7518],
- ["DFB0",0x7519],
- ["C9F5",0x751A],
- ["AE5C",0x751B],
- ["CCF0",0x751C],
- ["AE5D",0x751D],
- ["AE5E",0x751E],
- ["C9FA",0x751F],
- ["AE5F",0x7520],
- ["AE60",0x7521],
- ["AE61",0x7522],
- ["AE62",0x7523],
- ["AE63",0x7524],
- ["C9FB",0x7525],
- ["AE64",0x7526],
- ["AE65",0x7527],
- ["D3C3",0x7528],
- ["CBA6",0x7529],
- ["AE66",0x752A],
- ["B8A6",0x752B],
- ["F0AE",0x752C],
- ["B1C2",0x752D],
- ["AE67",0x752E],
- ["E5B8",0x752F],
- ["CCEF",0x7530],
- ["D3C9",0x7531],
- ["BCD7",0x7532],
- ["C9EA",0x7533],
- ["AE68",0x7534],
- ["B5E7",0x7535],
- ["AE69",0x7536],
- ["C4D0",0x7537],
- ["B5E9",0x7538],
- ["AE6A",0x7539],
- ["EEAE",0x753A],
- ["BBAD",0x753B],
- ["AE6B",0x753C],
- ["AE6C",0x753D],
- ["E7DE",0x753E],
- ["AE6D",0x753F],
- ["EEAF",0x7540],
- ["AE6E",0x7541],
- ["AE6F",0x7542],
- ["AE70",0x7543],
- ["AE71",0x7544],
- ["B3A9",0x7545],
- ["AE72",0x7546],
- ["AE73",0x7547],
- ["EEB2",0x7548],
- ["AE74",0x7549],
- ["AE75",0x754A],
- ["EEB1",0x754B],
- ["BDE7",0x754C],
- ["AE76",0x754D],
- ["EEB0",0x754E],
- ["CEB7",0x754F],
- ["AE77",0x7550],
- ["AE78",0x7551],
- ["AE79",0x7552],
- ["AE7A",0x7553],
- ["C5CF",0x7554],
- ["AE7B",0x7555],
- ["AE7C",0x7556],
- ["AE7D",0x7557],
- ["AE7E",0x7558],
- ["C1F4",0x7559],
- ["DBCE",0x755A],
- ["EEB3",0x755B],
- ["D0F3",0x755C],
- ["AE80",0x755D],
- ["AE81",0x755E],
- ["AE82",0x755F],
- ["AE83",0x7560],
- ["AE84",0x7561],
- ["AE85",0x7562],
- ["AE86",0x7563],
- ["AE87",0x7564],
- ["C2D4",0x7565],
- ["C6E8",0x7566],
- ["AE88",0x7567],
- ["AE89",0x7568],
- ["AE8A",0x7569],
- ["B7AC",0x756A],
- ["AE8B",0x756B],
- ["AE8C",0x756C],
- ["AE8D",0x756D],
- ["AE8E",0x756E],
- ["AE8F",0x756F],
- ["AE90",0x7570],
- ["AE91",0x7571],
- ["EEB4",0x7572],
- ["AE92",0x7573],
- ["B3EB",0x7574],
- ["AE93",0x7575],
- ["AE94",0x7576],
- ["AE95",0x7577],
- ["BBFB",0x7578],
- ["EEB5",0x7579],
- ["AE96",0x757A],
- ["AE97",0x757B],
- ["AE98",0x757C],
- ["AE99",0x757D],
- ["AE9A",0x757E],
- ["E7DC",0x757F],
- ["AE9B",0x7580],
- ["AE9C",0x7581],
- ["AE9D",0x7582],
- ["EEB6",0x7583],
- ["AE9E",0x7584],
- ["AE9F",0x7585],
- ["BDAE",0x7586],
- ["AEA0",0x7587],
- ["AF40",0x7588],
- ["AF41",0x7589],
- ["AF42",0x758A],
- ["F1E2",0x758B],
- ["AF43",0x758C],
- ["AF44",0x758D],
- ["AF45",0x758E],
- ["CAE8",0x758F],
- ["AF46",0x7590],
- ["D2C9",0x7591],
- ["F0DA",0x7592],
- ["AF47",0x7593],
- ["F0DB",0x7594],
- ["AF48",0x7595],
- ["F0DC",0x7596],
- ["C1C6",0x7597],
- ["AF49",0x7598],
- ["B8ED",0x7599],
- ["BECE",0x759A],
- ["AF4A",0x759B],
- ["AF4B",0x759C],
- ["F0DE",0x759D],
- ["AF4C",0x759E],
- ["C5B1",0x759F],
- ["F0DD",0x75A0],
- ["D1F1",0x75A1],
- ["AF4D",0x75A2],
- ["F0E0",0x75A3],
- ["B0CC",0x75A4],
- ["BDEA",0x75A5],
- ["AF4E",0x75A6],
- ["AF4F",0x75A7],
- ["AF50",0x75A8],
- ["AF51",0x75A9],
- ["AF52",0x75AA],
- ["D2DF",0x75AB],
- ["F0DF",0x75AC],
- ["AF53",0x75AD],
- ["B4AF",0x75AE],
- ["B7E8",0x75AF],
- ["F0E6",0x75B0],
- ["F0E5",0x75B1],
- ["C6A3",0x75B2],
- ["F0E1",0x75B3],
- ["F0E2",0x75B4],
- ["B4C3",0x75B5],
- ["AF54",0x75B6],
- ["AF55",0x75B7],
- ["F0E3",0x75B8],
- ["D5EE",0x75B9],
- ["AF56",0x75BA],
- ["AF57",0x75BB],
- ["CCDB",0x75BC],
- ["BED2",0x75BD],
- ["BCB2",0x75BE],
- ["AF58",0x75BF],
- ["AF59",0x75C0],
- ["AF5A",0x75C1],
- ["F0E8",0x75C2],
- ["F0E7",0x75C3],
- ["F0E4",0x75C4],
- ["B2A1",0x75C5],
- ["AF5B",0x75C6],
- ["D6A2",0x75C7],
- ["D3B8",0x75C8],
- ["BEB7",0x75C9],
- ["C8AC",0x75CA],
- ["AF5C",0x75CB],
- ["AF5D",0x75CC],
- ["F0EA",0x75CD],
- ["AF5E",0x75CE],
- ["AF5F",0x75CF],
- ["AF60",0x75D0],
- ["AF61",0x75D1],
- ["D1F7",0x75D2],
- ["AF62",0x75D3],
- ["D6CC",0x75D4],
- ["BADB",0x75D5],
- ["F0E9",0x75D6],
- ["AF63",0x75D7],
- ["B6BB",0x75D8],
- ["AF64",0x75D9],
- ["AF65",0x75DA],
- ["CDB4",0x75DB],
- ["AF66",0x75DC],
- ["AF67",0x75DD],
- ["C6A6",0x75DE],
- ["AF68",0x75DF],
- ["AF69",0x75E0],
- ["AF6A",0x75E1],
- ["C1A1",0x75E2],
- ["F0EB",0x75E3],
- ["F0EE",0x75E4],
- ["AF6B",0x75E5],
- ["F0ED",0x75E6],
- ["F0F0",0x75E7],
- ["F0EC",0x75E8],
- ["AF6C",0x75E9],
- ["BBBE",0x75EA],
- ["F0EF",0x75EB],
- ["AF6D",0x75EC],
- ["AF6E",0x75ED],
- ["AF6F",0x75EE],
- ["AF70",0x75EF],
- ["CCB5",0x75F0],
- ["F0F2",0x75F1],
- ["AF71",0x75F2],
- ["AF72",0x75F3],
- ["B3D5",0x75F4],
- ["AF73",0x75F5],
- ["AF74",0x75F6],
- ["AF75",0x75F7],
- ["AF76",0x75F8],
- ["B1D4",0x75F9],
- ["AF77",0x75FA],
- ["AF78",0x75FB],
- ["F0F3",0x75FC],
- ["AF79",0x75FD],
- ["AF7A",0x75FE],
- ["F0F4",0x75FF],
- ["F0F6",0x7600],
- ["B4E1",0x7601],
- ["AF7B",0x7602],
- ["F0F1",0x7603],
- ["AF7C",0x7604],
- ["F0F7",0x7605],
- ["AF7D",0x7606],
- ["AF7E",0x7607],
- ["AF80",0x7608],
- ["AF81",0x7609],
- ["F0FA",0x760A],
- ["AF82",0x760B],
- ["F0F8",0x760C],
- ["AF83",0x760D],
- ["AF84",0x760E],
- ["AF85",0x760F],
- ["F0F5",0x7610],
- ["AF86",0x7611],
- ["AF87",0x7612],
- ["AF88",0x7613],
- ["AF89",0x7614],
- ["F0FD",0x7615],
- ["AF8A",0x7616],
- ["F0F9",0x7617],
- ["F0FC",0x7618],
- ["F0FE",0x7619],
- ["AF8B",0x761A],
- ["F1A1",0x761B],
- ["AF8C",0x761C],
- ["AF8D",0x761D],
- ["AF8E",0x761E],
- ["CEC1",0x761F],
- ["F1A4",0x7620],
- ["AF8F",0x7621],
- ["F1A3",0x7622],
- ["AF90",0x7623],
- ["C1F6",0x7624],
- ["F0FB",0x7625],
- ["CADD",0x7626],
- ["AF91",0x7627],
- ["AF92",0x7628],
- ["B4F1",0x7629],
- ["B1F1",0x762A],
- ["CCB1",0x762B],
- ["AF93",0x762C],
- ["F1A6",0x762D],
- ["AF94",0x762E],
- ["AF95",0x762F],
- ["F1A7",0x7630],
- ["AF96",0x7631],
- ["AF97",0x7632],
- ["F1AC",0x7633],
- ["D5CE",0x7634],
- ["F1A9",0x7635],
- ["AF98",0x7636],
- ["AF99",0x7637],
- ["C8B3",0x7638],
- ["AF9A",0x7639],
- ["AF9B",0x763A],
- ["AF9C",0x763B],
- ["F1A2",0x763C],
- ["AF9D",0x763D],
- ["F1AB",0x763E],
- ["F1A8",0x763F],
- ["F1A5",0x7640],
- ["AF9E",0x7641],
- ["AF9F",0x7642],
- ["F1AA",0x7643],
- ["AFA0",0x7644],
- ["B040",0x7645],
- ["B041",0x7646],
- ["B042",0x7647],
- ["B043",0x7648],
- ["B044",0x7649],
- ["B045",0x764A],
- ["B046",0x764B],
- ["B0A9",0x764C],
- ["F1AD",0x764D],
- ["B047",0x764E],
- ["B048",0x764F],
- ["B049",0x7650],
- ["B04A",0x7651],
- ["B04B",0x7652],
- ["B04C",0x7653],
- ["F1AF",0x7654],
- ["B04D",0x7655],
- ["F1B1",0x7656],
- ["B04E",0x7657],
- ["B04F",0x7658],
- ["B050",0x7659],
- ["B051",0x765A],
- ["B052",0x765B],
- ["F1B0",0x765C],
- ["B053",0x765D],
- ["F1AE",0x765E],
- ["B054",0x765F],
- ["B055",0x7660],
- ["B056",0x7661],
- ["B057",0x7662],
- ["D1A2",0x7663],
- ["B058",0x7664],
- ["B059",0x7665],
- ["B05A",0x7666],
- ["B05B",0x7667],
- ["B05C",0x7668],
- ["B05D",0x7669],
- ["B05E",0x766A],
- ["F1B2",0x766B],
- ["B05F",0x766C],
- ["B060",0x766D],
- ["B061",0x766E],
- ["F1B3",0x766F],
- ["B062",0x7670],
- ["B063",0x7671],
- ["B064",0x7672],
- ["B065",0x7673],
- ["B066",0x7674],
- ["B067",0x7675],
- ["B068",0x7676],
- ["B069",0x7677],
- ["B9EF",0x7678],
- ["B06A",0x7679],
- ["B06B",0x767A],
- ["B5C7",0x767B],
- ["B06C",0x767C],
- ["B0D7",0x767D],
- ["B0D9",0x767E],
- ["B06D",0x767F],
- ["B06E",0x7680],
- ["B06F",0x7681],
- ["D4ED",0x7682],
- ["B070",0x7683],
- ["B5C4",0x7684],
- ["B071",0x7685],
- ["BDD4",0x7686],
- ["BBCA",0x7687],
- ["F0A7",0x7688],
- ["B072",0x7689],
- ["B073",0x768A],
- ["B8DE",0x768B],
- ["B074",0x768C],
- ["B075",0x768D],
- ["F0A8",0x768E],
- ["B076",0x768F],
- ["B077",0x7690],
- ["B0A8",0x7691],
- ["B078",0x7692],
- ["F0A9",0x7693],
- ["B079",0x7694],
- ["B07A",0x7695],
- ["CDEE",0x7696],
- ["B07B",0x7697],
- ["B07C",0x7698],
- ["F0AA",0x7699],
- ["B07D",0x769A],
- ["B07E",0x769B],
- ["B080",0x769C],
- ["B081",0x769D],
- ["B082",0x769E],
- ["B083",0x769F],
- ["B084",0x76A0],
- ["B085",0x76A1],
- ["B086",0x76A2],
- ["B087",0x76A3],
- ["F0AB",0x76A4],
- ["B088",0x76A5],
- ["B089",0x76A6],
- ["B08A",0x76A7],
- ["B08B",0x76A8],
- ["B08C",0x76A9],
- ["B08D",0x76AA],
- ["B08E",0x76AB],
- ["B08F",0x76AC],
- ["B090",0x76AD],
- ["C6A4",0x76AE],
- ["B091",0x76AF],
- ["B092",0x76B0],
- ["D6E5",0x76B1],
- ["F1E4",0x76B2],
- ["B093",0x76B3],
- ["F1E5",0x76B4],
- ["B094",0x76B5],
- ["B095",0x76B6],
- ["B096",0x76B7],
- ["B097",0x76B8],
- ["B098",0x76B9],
- ["B099",0x76BA],
- ["B09A",0x76BB],
- ["B09B",0x76BC],
- ["B09C",0x76BD],
- ["B09D",0x76BE],
- ["C3F3",0x76BF],
- ["B09E",0x76C0],
- ["B09F",0x76C1],
- ["D3DB",0x76C2],
- ["B0A0",0x76C3],
- ["B140",0x76C4],
- ["D6D1",0x76C5],
- ["C5E8",0x76C6],
- ["B141",0x76C7],
- ["D3AF",0x76C8],
- ["B142",0x76C9],
- ["D2E6",0x76CA],
- ["B143",0x76CB],
- ["B144",0x76CC],
- ["EEC1",0x76CD],
- ["B0BB",0x76CE],
- ["D5B5",0x76CF],
- ["D1CE",0x76D0],
- ["BCE0",0x76D1],
- ["BAD0",0x76D2],
- ["B145",0x76D3],
- ["BFF8",0x76D4],
- ["B146",0x76D5],
- ["B8C7",0x76D6],
- ["B5C1",0x76D7],
- ["C5CC",0x76D8],
- ["B147",0x76D9],
- ["B148",0x76DA],
- ["CAA2",0x76DB],
- ["B149",0x76DC],
- ["B14A",0x76DD],
- ["B14B",0x76DE],
- ["C3CB",0x76DF],
- ["B14C",0x76E0],
- ["B14D",0x76E1],
- ["B14E",0x76E2],
- ["B14F",0x76E3],
- ["B150",0x76E4],
- ["EEC2",0x76E5],
- ["B151",0x76E6],
- ["B152",0x76E7],
- ["B153",0x76E8],
- ["B154",0x76E9],
- ["B155",0x76EA],
- ["B156",0x76EB],
- ["B157",0x76EC],
- ["B158",0x76ED],
- ["C4BF",0x76EE],
- ["B6A2",0x76EF],
- ["B159",0x76F0],
- ["EDEC",0x76F1],
- ["C3A4",0x76F2],
- ["B15A",0x76F3],
- ["D6B1",0x76F4],
- ["B15B",0x76F5],
- ["B15C",0x76F6],
- ["B15D",0x76F7],
- ["CFE0",0x76F8],
- ["EDEF",0x76F9],
- ["B15E",0x76FA],
- ["B15F",0x76FB],
- ["C5CE",0x76FC],
- ["B160",0x76FD],
- ["B6DC",0x76FE],
- ["B161",0x76FF],
- ["B162",0x7700],
- ["CAA1",0x7701],
- ["B163",0x7702],
- ["B164",0x7703],
- ["EDED",0x7704],
- ["B165",0x7705],
- ["B166",0x7706],
- ["EDF0",0x7707],
- ["EDF1",0x7708],
- ["C3BC",0x7709],
- ["B167",0x770A],
- ["BFB4",0x770B],
- ["B168",0x770C],
- ["EDEE",0x770D],
- ["B169",0x770E],
- ["B16A",0x770F],
- ["B16B",0x7710],
- ["B16C",0x7711],
- ["B16D",0x7712],
- ["B16E",0x7713],
- ["B16F",0x7714],
- ["B170",0x7715],
- ["B171",0x7716],
- ["B172",0x7717],
- ["B173",0x7718],
- ["EDF4",0x7719],
- ["EDF2",0x771A],
- ["B174",0x771B],
- ["B175",0x771C],
- ["B176",0x771D],
- ["B177",0x771E],
- ["D5E6",0x771F],
- ["C3DF",0x7720],
- ["B178",0x7721],
- ["EDF3",0x7722],
- ["B179",0x7723],
- ["B17A",0x7724],
- ["B17B",0x7725],
- ["EDF6",0x7726],
- ["B17C",0x7727],
- ["D5A3",0x7728],
- ["D1A3",0x7729],
- ["B17D",0x772A],
- ["B17E",0x772B],
- ["B180",0x772C],
- ["EDF5",0x772D],
- ["B181",0x772E],
- ["C3D0",0x772F],
- ["B182",0x7730],
- ["B183",0x7731],
- ["B184",0x7732],
- ["B185",0x7733],
- ["B186",0x7734],
- ["EDF7",0x7735],
- ["BFF4",0x7736],
- ["BEEC",0x7737],
- ["EDF8",0x7738],
- ["B187",0x7739],
- ["CCF7",0x773A],
- ["B188",0x773B],
- ["D1DB",0x773C],
- ["B189",0x773D],
- ["B18A",0x773E],
- ["B18B",0x773F],
- ["D7C5",0x7740],
- ["D5F6",0x7741],
- ["B18C",0x7742],
- ["EDFC",0x7743],
- ["B18D",0x7744],
- ["B18E",0x7745],
- ["B18F",0x7746],
- ["EDFB",0x7747],
- ["B190",0x7748],
- ["B191",0x7749],
- ["B192",0x774A],
- ["B193",0x774B],
- ["B194",0x774C],
- ["B195",0x774D],
- ["B196",0x774E],
- ["B197",0x774F],
- ["EDF9",0x7750],
- ["EDFA",0x7751],
- ["B198",0x7752],
- ["B199",0x7753],
- ["B19A",0x7754],
- ["B19B",0x7755],
- ["B19C",0x7756],
- ["B19D",0x7757],
- ["B19E",0x7758],
- ["B19F",0x7759],
- ["EDFD",0x775A],
- ["BEA6",0x775B],
- ["B1A0",0x775C],
- ["B240",0x775D],
- ["B241",0x775E],
- ["B242",0x775F],
- ["B243",0x7760],
- ["CBAF",0x7761],
- ["EEA1",0x7762],
- ["B6BD",0x7763],
- ["B244",0x7764],
- ["EEA2",0x7765],
- ["C4C0",0x7766],
- ["B245",0x7767],
- ["EDFE",0x7768],
- ["B246",0x7769],
- ["B247",0x776A],
- ["BDDE",0x776B],
- ["B2C7",0x776C],
- ["B248",0x776D],
- ["B249",0x776E],
- ["B24A",0x776F],
- ["B24B",0x7770],
- ["B24C",0x7771],
- ["B24D",0x7772],
- ["B24E",0x7773],
- ["B24F",0x7774],
- ["B250",0x7775],
- ["B251",0x7776],
- ["B252",0x7777],
- ["B253",0x7778],
- ["B6C3",0x7779],
- ["B254",0x777A],
- ["B255",0x777B],
- ["B256",0x777C],
- ["EEA5",0x777D],
- ["D8BA",0x777E],
- ["EEA3",0x777F],
- ["EEA6",0x7780],
- ["B257",0x7781],
- ["B258",0x7782],
- ["B259",0x7783],
- ["C3E9",0x7784],
- ["B3F2",0x7785],
- ["B25A",0x7786],
- ["B25B",0x7787],
- ["B25C",0x7788],
- ["B25D",0x7789],
- ["B25E",0x778A],
- ["B25F",0x778B],
- ["EEA7",0x778C],
- ["EEA4",0x778D],
- ["CFB9",0x778E],
- ["B260",0x778F],
- ["B261",0x7790],
- ["EEA8",0x7791],
- ["C2F7",0x7792],
- ["B262",0x7793],
- ["B263",0x7794],
- ["B264",0x7795],
- ["B265",0x7796],
- ["B266",0x7797],
- ["B267",0x7798],
- ["B268",0x7799],
- ["B269",0x779A],
- ["B26A",0x779B],
- ["B26B",0x779C],
- ["B26C",0x779D],
- ["B26D",0x779E],
- ["EEA9",0x779F],
- ["EEAA",0x77A0],
- ["B26E",0x77A1],
- ["DEAB",0x77A2],
- ["B26F",0x77A3],
- ["B270",0x77A4],
- ["C6B3",0x77A5],
- ["B271",0x77A6],
- ["C7C6",0x77A7],
- ["B272",0x77A8],
- ["D6F5",0x77A9],
- ["B5C9",0x77AA],
- ["B273",0x77AB],
- ["CBB2",0x77AC],
- ["B274",0x77AD],
- ["B275",0x77AE],
- ["B276",0x77AF],
- ["EEAB",0x77B0],
- ["B277",0x77B1],
- ["B278",0x77B2],
- ["CDAB",0x77B3],
- ["B279",0x77B4],
- ["EEAC",0x77B5],
- ["B27A",0x77B6],
- ["B27B",0x77B7],
- ["B27C",0x77B8],
- ["B27D",0x77B9],
- ["B27E",0x77BA],
- ["D5B0",0x77BB],
- ["B280",0x77BC],
- ["EEAD",0x77BD],
- ["B281",0x77BE],
- ["F6C4",0x77BF],
- ["B282",0x77C0],
- ["B283",0x77C1],
- ["B284",0x77C2],
- ["B285",0x77C3],
- ["B286",0x77C4],
- ["B287",0x77C5],
- ["B288",0x77C6],
- ["B289",0x77C7],
- ["B28A",0x77C8],
- ["B28B",0x77C9],
- ["B28C",0x77CA],
- ["B28D",0x77CB],
- ["B28E",0x77CC],
- ["DBC7",0x77CD],
- ["B28F",0x77CE],
- ["B290",0x77CF],
- ["B291",0x77D0],
- ["B292",0x77D1],
- ["B293",0x77D2],
- ["B294",0x77D3],
- ["B295",0x77D4],
- ["B296",0x77D5],
- ["B297",0x77D6],
- ["B4A3",0x77D7],
- ["B298",0x77D8],
- ["B299",0x77D9],
- ["B29A",0x77DA],
- ["C3AC",0x77DB],
- ["F1E6",0x77DC],
- ["B29B",0x77DD],
- ["B29C",0x77DE],
- ["B29D",0x77DF],
- ["B29E",0x77E0],
- ["B29F",0x77E1],
- ["CAB8",0x77E2],
- ["D2D3",0x77E3],
- ["B2A0",0x77E4],
- ["D6AA",0x77E5],
- ["B340",0x77E6],
- ["EFF2",0x77E7],
- ["B341",0x77E8],
- ["BED8",0x77E9],
- ["B342",0x77EA],
- ["BDC3",0x77EB],
- ["EFF3",0x77EC],
- ["B6CC",0x77ED],
- ["B0AB",0x77EE],
- ["B343",0x77EF],
- ["B344",0x77F0],
- ["B345",0x77F1],
- ["B346",0x77F2],
- ["CAAF",0x77F3],
- ["B347",0x77F4],
- ["B348",0x77F5],
- ["EDB6",0x77F6],
- ["B349",0x77F7],
- ["EDB7",0x77F8],
- ["B34A",0x77F9],
- ["B34B",0x77FA],
- ["B34C",0x77FB],
- ["B34D",0x77FC],
- ["CEF9",0x77FD],
- ["B7AF",0x77FE],
- ["BFF3",0x77FF],
- ["EDB8",0x7800],
- ["C2EB",0x7801],
- ["C9B0",0x7802],
- ["B34E",0x7803],
- ["B34F",0x7804],
- ["B350",0x7805],
- ["B351",0x7806],
- ["B352",0x7807],
- ["B353",0x7808],
- ["EDB9",0x7809],
- ["B354",0x780A],
- ["B355",0x780B],
- ["C6F6",0x780C],
- ["BFB3",0x780D],
- ["B356",0x780E],
- ["B357",0x780F],
- ["B358",0x7810],
- ["EDBC",0x7811],
- ["C5F8",0x7812],
- ["B359",0x7813],
- ["D1D0",0x7814],
- ["B35A",0x7815],
- ["D7A9",0x7816],
- ["EDBA",0x7817],
- ["EDBB",0x7818],
- ["B35B",0x7819],
- ["D1E2",0x781A],
- ["B35C",0x781B],
- ["EDBF",0x781C],
- ["EDC0",0x781D],
- ["B35D",0x781E],
- ["EDC4",0x781F],
- ["B35E",0x7820],
- ["B35F",0x7821],
- ["B360",0x7822],
- ["EDC8",0x7823],
- ["B361",0x7824],
- ["EDC6",0x7825],
- ["EDCE",0x7826],
- ["D5E8",0x7827],
- ["B362",0x7828],
- ["EDC9",0x7829],
- ["B363",0x782A],
- ["B364",0x782B],
- ["EDC7",0x782C],
- ["EDBE",0x782D],
- ["B365",0x782E],
- ["B366",0x782F],
- ["C5E9",0x7830],
- ["B367",0x7831],
- ["B368",0x7832],
- ["B369",0x7833],
- ["C6C6",0x7834],
- ["B36A",0x7835],
- ["B36B",0x7836],
- ["C9E9",0x7837],
- ["D4D2",0x7838],
- ["EDC1",0x7839],
- ["EDC2",0x783A],
- ["EDC3",0x783B],
- ["EDC5",0x783C],
- ["B36C",0x783D],
- ["C0F9",0x783E],
- ["B36D",0x783F],
- ["B4A1",0x7840],
- ["B36E",0x7841],
- ["B36F",0x7842],
- ["B370",0x7843],
- ["B371",0x7844],
- ["B9E8",0x7845],
- ["B372",0x7846],
- ["EDD0",0x7847],
- ["B373",0x7848],
- ["B374",0x7849],
- ["B375",0x784A],
- ["B376",0x784B],
- ["EDD1",0x784C],
- ["B377",0x784D],
- ["EDCA",0x784E],
- ["B378",0x784F],
- ["EDCF",0x7850],
- ["B379",0x7851],
- ["CEF8",0x7852],
- ["B37A",0x7853],
- ["B37B",0x7854],
- ["CBB6",0x7855],
- ["EDCC",0x7856],
- ["EDCD",0x7857],
- ["B37C",0x7858],
- ["B37D",0x7859],
- ["B37E",0x785A],
- ["B380",0x785B],
- ["B381",0x785C],
- ["CFF5",0x785D],
- ["B382",0x785E],
- ["B383",0x785F],
- ["B384",0x7860],
- ["B385",0x7861],
- ["B386",0x7862],
- ["B387",0x7863],
- ["B388",0x7864],
- ["B389",0x7865],
- ["B38A",0x7866],
- ["B38B",0x7867],
- ["B38C",0x7868],
- ["B38D",0x7869],
- ["EDD2",0x786A],
- ["C1F2",0x786B],
- ["D3B2",0x786C],
- ["EDCB",0x786D],
- ["C8B7",0x786E],
- ["B38E",0x786F],
- ["B38F",0x7870],
- ["B390",0x7871],
- ["B391",0x7872],
- ["B392",0x7873],
- ["B393",0x7874],
- ["B394",0x7875],
- ["B395",0x7876],
- ["BCEF",0x7877],
- ["B396",0x7878],
- ["B397",0x7879],
- ["B398",0x787A],
- ["B399",0x787B],
- ["C5F0",0x787C],
- ["B39A",0x787D],
- ["B39B",0x787E],
- ["B39C",0x787F],
- ["B39D",0x7880],
- ["B39E",0x7881],
- ["B39F",0x7882],
- ["B3A0",0x7883],
- ["B440",0x7884],
- ["B441",0x7885],
- ["B442",0x7886],
- ["EDD6",0x7887],
- ["B443",0x7888],
- ["B5EF",0x7889],
- ["B444",0x788A],
- ["B445",0x788B],
- ["C2B5",0x788C],
- ["B0AD",0x788D],
- ["CBE9",0x788E],
- ["B446",0x788F],
- ["B447",0x7890],
- ["B1AE",0x7891],
- ["B448",0x7892],
- ["EDD4",0x7893],
- ["B449",0x7894],
- ["B44A",0x7895],
- ["B44B",0x7896],
- ["CDEB",0x7897],
- ["B5E2",0x7898],
- ["B44C",0x7899],
- ["EDD5",0x789A],
- ["EDD3",0x789B],
- ["EDD7",0x789C],
- ["B44D",0x789D],
- ["B44E",0x789E],
- ["B5FA",0x789F],
- ["B44F",0x78A0],
- ["EDD8",0x78A1],
- ["B450",0x78A2],
- ["EDD9",0x78A3],
- ["B451",0x78A4],
- ["EDDC",0x78A5],
- ["B452",0x78A6],
- ["B1CC",0x78A7],
- ["B453",0x78A8],
- ["B454",0x78A9],
- ["B455",0x78AA],
- ["B456",0x78AB],
- ["B457",0x78AC],
- ["B458",0x78AD],
- ["B459",0x78AE],
- ["B45A",0x78AF],
- ["C5F6",0x78B0],
- ["BCEE",0x78B1],
- ["EDDA",0x78B2],
- ["CCBC",0x78B3],
- ["B2EA",0x78B4],
- ["B45B",0x78B5],
- ["B45C",0x78B6],
- ["B45D",0x78B7],
- ["B45E",0x78B8],
- ["EDDB",0x78B9],
- ["B45F",0x78BA],
- ["B460",0x78BB],
- ["B461",0x78BC],
- ["B462",0x78BD],
- ["C4EB",0x78BE],
- ["B463",0x78BF],
- ["B464",0x78C0],
- ["B4C5",0x78C1],
- ["B465",0x78C2],
- ["B466",0x78C3],
- ["B467",0x78C4],
- ["B0F5",0x78C5],
- ["B468",0x78C6],
- ["B469",0x78C7],
- ["B46A",0x78C8],
- ["EDDF",0x78C9],
- ["C0DA",0x78CA],
- ["B4E8",0x78CB],
- ["B46B",0x78CC],
- ["B46C",0x78CD],
- ["B46D",0x78CE],
- ["B46E",0x78CF],
- ["C5CD",0x78D0],
- ["B46F",0x78D1],
- ["B470",0x78D2],
- ["B471",0x78D3],
- ["EDDD",0x78D4],
- ["BFC4",0x78D5],
- ["B472",0x78D6],
- ["B473",0x78D7],
- ["B474",0x78D8],
- ["EDDE",0x78D9],
- ["B475",0x78DA],
- ["B476",0x78DB],
- ["B477",0x78DC],
- ["B478",0x78DD],
- ["B479",0x78DE],
- ["B47A",0x78DF],
- ["B47B",0x78E0],
- ["B47C",0x78E1],
- ["B47D",0x78E2],
- ["B47E",0x78E3],
- ["B480",0x78E4],
- ["B481",0x78E5],
- ["B482",0x78E6],
- ["B483",0x78E7],
- ["C4A5",0x78E8],
- ["B484",0x78E9],
- ["B485",0x78EA],
- ["B486",0x78EB],
- ["EDE0",0x78EC],
- ["B487",0x78ED],
- ["B488",0x78EE],
- ["B489",0x78EF],
- ["B48A",0x78F0],
- ["B48B",0x78F1],
- ["EDE1",0x78F2],
- ["B48C",0x78F3],
- ["EDE3",0x78F4],
- ["B48D",0x78F5],
- ["B48E",0x78F6],
- ["C1D7",0x78F7],
- ["B48F",0x78F8],
- ["B490",0x78F9],
- ["BBC7",0x78FA],
- ["B491",0x78FB],
- ["B492",0x78FC],
- ["B493",0x78FD],
- ["B494",0x78FE],
- ["B495",0x78FF],
- ["B496",0x7900],
- ["BDB8",0x7901],
- ["B497",0x7902],
- ["B498",0x7903],
- ["B499",0x7904],
- ["EDE2",0x7905],
- ["B49A",0x7906],
- ["B49B",0x7907],
- ["B49C",0x7908],
- ["B49D",0x7909],
- ["B49E",0x790A],
- ["B49F",0x790B],
- ["B4A0",0x790C],
- ["B540",0x790D],
- ["B541",0x790E],
- ["B542",0x790F],
- ["B543",0x7910],
- ["B544",0x7911],
- ["B545",0x7912],
- ["EDE4",0x7913],
- ["B546",0x7914],
- ["B547",0x7915],
- ["B548",0x7916],
- ["B549",0x7917],
- ["B54A",0x7918],
- ["B54B",0x7919],
- ["B54C",0x791A],
- ["B54D",0x791B],
- ["B54E",0x791C],
- ["B54F",0x791D],
- ["EDE6",0x791E],
- ["B550",0x791F],
- ["B551",0x7920],
- ["B552",0x7921],
- ["B553",0x7922],
- ["B554",0x7923],
- ["EDE5",0x7924],
- ["B555",0x7925],
- ["B556",0x7926],
- ["B557",0x7927],
- ["B558",0x7928],
- ["B559",0x7929],
- ["B55A",0x792A],
- ["B55B",0x792B],
- ["B55C",0x792C],
- ["B55D",0x792D],
- ["B55E",0x792E],
- ["B55F",0x792F],
- ["B560",0x7930],
- ["B561",0x7931],
- ["B562",0x7932],
- ["B563",0x7933],
- ["EDE7",0x7934],
- ["B564",0x7935],
- ["B565",0x7936],
- ["B566",0x7937],
- ["B567",0x7938],
- ["B568",0x7939],
- ["CABE",0x793A],
- ["ECEA",0x793B],
- ["C0F1",0x793C],
- ["B569",0x793D],
- ["C9E7",0x793E],
- ["B56A",0x793F],
- ["ECEB",0x7940],
- ["C6EE",0x7941],
- ["B56B",0x7942],
- ["B56C",0x7943],
- ["B56D",0x7944],
- ["B56E",0x7945],
- ["ECEC",0x7946],
- ["B56F",0x7947],
- ["C6ED",0x7948],
- ["ECED",0x7949],
- ["B570",0x794A],
- ["B571",0x794B],
- ["B572",0x794C],
- ["B573",0x794D],
- ["B574",0x794E],
- ["B575",0x794F],
- ["B576",0x7950],
- ["B577",0x7951],
- ["B578",0x7952],
- ["ECF0",0x7953],
- ["B579",0x7954],
- ["B57A",0x7955],
- ["D7E6",0x7956],
- ["ECF3",0x7957],
- ["B57B",0x7958],
- ["B57C",0x7959],
- ["ECF1",0x795A],
- ["ECEE",0x795B],
- ["ECEF",0x795C],
- ["D7A3",0x795D],
- ["C9F1",0x795E],
- ["CBEE",0x795F],
- ["ECF4",0x7960],
- ["B57D",0x7961],
- ["ECF2",0x7962],
- ["B57E",0x7963],
- ["B580",0x7964],
- ["CFE9",0x7965],
- ["B581",0x7966],
- ["ECF6",0x7967],
- ["C6B1",0x7968],
- ["B582",0x7969],
- ["B583",0x796A],
- ["B584",0x796B],
- ["B585",0x796C],
- ["BCC0",0x796D],
- ["B586",0x796E],
- ["ECF5",0x796F],
- ["B587",0x7970],
- ["B588",0x7971],
- ["B589",0x7972],
- ["B58A",0x7973],
- ["B58B",0x7974],
- ["B58C",0x7975],
- ["B58D",0x7976],
- ["B5BB",0x7977],
- ["BBF6",0x7978],
- ["B58E",0x7979],
- ["ECF7",0x797A],
- ["B58F",0x797B],
- ["B590",0x797C],
- ["B591",0x797D],
- ["B592",0x797E],
- ["B593",0x797F],
- ["D9F7",0x7980],
- ["BDFB",0x7981],
- ["B594",0x7982],
- ["B595",0x7983],
- ["C2BB",0x7984],
- ["ECF8",0x7985],
- ["B596",0x7986],
- ["B597",0x7987],
- ["B598",0x7988],
- ["B599",0x7989],
- ["ECF9",0x798A],
- ["B59A",0x798B],
- ["B59B",0x798C],
- ["B59C",0x798D],
- ["B59D",0x798E],
- ["B8A3",0x798F],
- ["B59E",0x7990],
- ["B59F",0x7991],
- ["B5A0",0x7992],
- ["B640",0x7993],
- ["B641",0x7994],
- ["B642",0x7995],
- ["B643",0x7996],
- ["B644",0x7997],
- ["B645",0x7998],
- ["B646",0x7999],
- ["ECFA",0x799A],
- ["B647",0x799B],
- ["B648",0x799C],
- ["B649",0x799D],
- ["B64A",0x799E],
- ["B64B",0x799F],
- ["B64C",0x79A0],
- ["B64D",0x79A1],
- ["B64E",0x79A2],
- ["B64F",0x79A3],
- ["B650",0x79A4],
- ["B651",0x79A5],
- ["B652",0x79A6],
- ["ECFB",0x79A7],
- ["B653",0x79A8],
- ["B654",0x79A9],
- ["B655",0x79AA],
- ["B656",0x79AB],
- ["B657",0x79AC],
- ["B658",0x79AD],
- ["B659",0x79AE],
- ["B65A",0x79AF],
- ["B65B",0x79B0],
- ["B65C",0x79B1],
- ["B65D",0x79B2],
- ["ECFC",0x79B3],
- ["B65E",0x79B4],
- ["B65F",0x79B5],
- ["B660",0x79B6],
- ["B661",0x79B7],
- ["B662",0x79B8],
- ["D3ED",0x79B9],
- ["D8AE",0x79BA],
- ["C0EB",0x79BB],
- ["B663",0x79BC],
- ["C7DD",0x79BD],
- ["BACC",0x79BE],
- ["B664",0x79BF],
- ["D0E3",0x79C0],
- ["CBBD",0x79C1],
- ["B665",0x79C2],
- ["CDBA",0x79C3],
- ["B666",0x79C4],
- ["B667",0x79C5],
- ["B8D1",0x79C6],
- ["B668",0x79C7],
- ["B669",0x79C8],
- ["B1FC",0x79C9],
- ["B66A",0x79CA],
- ["C7EF",0x79CB],
- ["B66B",0x79CC],
- ["D6D6",0x79CD],
- ["B66C",0x79CE],
- ["B66D",0x79CF],
- ["B66E",0x79D0],
- ["BFC6",0x79D1],
- ["C3EB",0x79D2],
- ["B66F",0x79D3],
- ["B670",0x79D4],
- ["EFF5",0x79D5],
- ["B671",0x79D6],
- ["B672",0x79D7],
- ["C3D8",0x79D8],
- ["B673",0x79D9],
- ["B674",0x79DA],
- ["B675",0x79DB],
- ["B676",0x79DC],
- ["B677",0x79DD],
- ["B678",0x79DE],
- ["D7E2",0x79DF],
- ["B679",0x79E0],
- ["B67A",0x79E1],
- ["B67B",0x79E2],
- ["EFF7",0x79E3],
- ["B3D3",0x79E4],
- ["B67C",0x79E5],
- ["C7D8",0x79E6],
- ["D1ED",0x79E7],
- ["B67D",0x79E8],
- ["D6C8",0x79E9],
- ["B67E",0x79EA],
- ["EFF8",0x79EB],
- ["B680",0x79EC],
- ["EFF6",0x79ED],
- ["B681",0x79EE],
- ["BBFD",0x79EF],
- ["B3C6",0x79F0],
- ["B682",0x79F1],
- ["B683",0x79F2],
- ["B684",0x79F3],
- ["B685",0x79F4],
- ["B686",0x79F5],
- ["B687",0x79F6],
- ["B688",0x79F7],
- ["BDD5",0x79F8],
- ["B689",0x79F9],
- ["B68A",0x79FA],
- ["D2C6",0x79FB],
- ["B68B",0x79FC],
- ["BBE0",0x79FD],
- ["B68C",0x79FE],
- ["B68D",0x79FF],
- ["CFA1",0x7A00],
- ["B68E",0x7A01],
- ["EFFC",0x7A02],
- ["EFFB",0x7A03],
- ["B68F",0x7A04],
- ["B690",0x7A05],
- ["EFF9",0x7A06],
- ["B691",0x7A07],
- ["B692",0x7A08],
- ["B693",0x7A09],
- ["B694",0x7A0A],
- ["B3CC",0x7A0B],
- ["B695",0x7A0C],
- ["C9D4",0x7A0D],
- ["CBB0",0x7A0E],
- ["B696",0x7A0F],
- ["B697",0x7A10],
- ["B698",0x7A11],
- ["B699",0x7A12],
- ["B69A",0x7A13],
- ["EFFE",0x7A14],
- ["B69B",0x7A15],
- ["B69C",0x7A16],
- ["B0DE",0x7A17],
- ["B69D",0x7A18],
- ["B69E",0x7A19],
- ["D6C9",0x7A1A],
- ["B69F",0x7A1B],
- ["B6A0",0x7A1C],
- ["B740",0x7A1D],
- ["EFFD",0x7A1E],
- ["B741",0x7A1F],
- ["B3ED",0x7A20],
- ["B742",0x7A21],
- ["B743",0x7A22],
- ["F6D5",0x7A23],
- ["B744",0x7A24],
- ["B745",0x7A25],
- ["B746",0x7A26],
- ["B747",0x7A27],
- ["B748",0x7A28],
- ["B749",0x7A29],
- ["B74A",0x7A2A],
- ["B74B",0x7A2B],
- ["B74C",0x7A2C],
- ["B74D",0x7A2D],
- ["B74E",0x7A2E],
- ["B74F",0x7A2F],
- ["B750",0x7A30],
- ["B751",0x7A31],
- ["B752",0x7A32],
- ["CEC8",0x7A33],
- ["B753",0x7A34],
- ["B754",0x7A35],
- ["B755",0x7A36],
- ["F0A2",0x7A37],
- ["B756",0x7A38],
- ["F0A1",0x7A39],
- ["B757",0x7A3A],
- ["B5BE",0x7A3B],
- ["BCDA",0x7A3C],
- ["BBFC",0x7A3D],
- ["B758",0x7A3E],
- ["B8E5",0x7A3F],
- ["B759",0x7A40],
- ["B75A",0x7A41],
- ["B75B",0x7A42],
- ["B75C",0x7A43],
- ["B75D",0x7A44],
- ["B75E",0x7A45],
- ["C4C2",0x7A46],
- ["B75F",0x7A47],
- ["B760",0x7A48],
- ["B761",0x7A49],
- ["B762",0x7A4A],
- ["B763",0x7A4B],
- ["B764",0x7A4C],
- ["B765",0x7A4D],
- ["B766",0x7A4E],
- ["B767",0x7A4F],
- ["B768",0x7A50],
- ["F0A3",0x7A51],
- ["B769",0x7A52],
- ["B76A",0x7A53],
- ["B76B",0x7A54],
- ["B76C",0x7A55],
- ["B76D",0x7A56],
- ["CBEB",0x7A57],
- ["B76E",0x7A58],
- ["B76F",0x7A59],
- ["B770",0x7A5A],
- ["B771",0x7A5B],
- ["B772",0x7A5C],
- ["B773",0x7A5D],
- ["B774",0x7A5E],
- ["B775",0x7A5F],
- ["B776",0x7A60],
- ["B777",0x7A61],
- ["B778",0x7A62],
- ["B779",0x7A63],
- ["B77A",0x7A64],
- ["B77B",0x7A65],
- ["B77C",0x7A66],
- ["B77D",0x7A67],
- ["B77E",0x7A68],
- ["B780",0x7A69],
- ["B781",0x7A6A],
- ["B782",0x7A6B],
- ["B783",0x7A6C],
- ["B784",0x7A6D],
- ["B785",0x7A6E],
- ["B786",0x7A6F],
- ["F0A6",0x7A70],
- ["B787",0x7A71],
- ["B788",0x7A72],
- ["B789",0x7A73],
- ["D1A8",0x7A74],
- ["B78A",0x7A75],
- ["BEBF",0x7A76],
- ["C7EE",0x7A77],
- ["F1B6",0x7A78],
- ["F1B7",0x7A79],
- ["BFD5",0x7A7A],
- ["B78B",0x7A7B],
- ["B78C",0x7A7C],
- ["B78D",0x7A7D],
- ["B78E",0x7A7E],
- ["B4A9",0x7A7F],
- ["F1B8",0x7A80],
- ["CDBB",0x7A81],
- ["B78F",0x7A82],
- ["C7D4",0x7A83],
- ["D5AD",0x7A84],
- ["B790",0x7A85],
- ["F1B9",0x7A86],
- ["B791",0x7A87],
- ["F1BA",0x7A88],
- ["B792",0x7A89],
- ["B793",0x7A8A],
- ["B794",0x7A8B],
- ["B795",0x7A8C],
- ["C7CF",0x7A8D],
- ["B796",0x7A8E],
- ["B797",0x7A8F],
- ["B798",0x7A90],
- ["D2A4",0x7A91],
- ["D6CF",0x7A92],
- ["B799",0x7A93],
- ["B79A",0x7A94],
- ["F1BB",0x7A95],
- ["BDD1",0x7A96],
- ["B4B0",0x7A97],
- ["BEBD",0x7A98],
- ["B79B",0x7A99],
- ["B79C",0x7A9A],
- ["B79D",0x7A9B],
- ["B4DC",0x7A9C],
- ["CED1",0x7A9D],
- ["B79E",0x7A9E],
- ["BFDF",0x7A9F],
- ["F1BD",0x7AA0],
- ["B79F",0x7AA1],
- ["B7A0",0x7AA2],
- ["B840",0x7AA3],
- ["B841",0x7AA4],
- ["BFFA",0x7AA5],
- ["F1BC",0x7AA6],
- ["B842",0x7AA7],
- ["F1BF",0x7AA8],
- ["B843",0x7AA9],
- ["B844",0x7AAA],
- ["B845",0x7AAB],
- ["F1BE",0x7AAC],
- ["F1C0",0x7AAD],
- ["B846",0x7AAE],
- ["B847",0x7AAF],
- ["B848",0x7AB0],
- ["B849",0x7AB1],
- ["B84A",0x7AB2],
- ["F1C1",0x7AB3],
- ["B84B",0x7AB4],
- ["B84C",0x7AB5],
- ["B84D",0x7AB6],
- ["B84E",0x7AB7],
- ["B84F",0x7AB8],
- ["B850",0x7AB9],
- ["B851",0x7ABA],
- ["B852",0x7ABB],
- ["B853",0x7ABC],
- ["B854",0x7ABD],
- ["B855",0x7ABE],
- ["C1FE",0x7ABF],
- ["B856",0x7AC0],
- ["B857",0x7AC1],
- ["B858",0x7AC2],
- ["B859",0x7AC3],
- ["B85A",0x7AC4],
- ["B85B",0x7AC5],
- ["B85C",0x7AC6],
- ["B85D",0x7AC7],
- ["B85E",0x7AC8],
- ["B85F",0x7AC9],
- ["B860",0x7ACA],
- ["C1A2",0x7ACB],
- ["B861",0x7ACC],
- ["B862",0x7ACD],
- ["B863",0x7ACE],
- ["B864",0x7ACF],
- ["B865",0x7AD0],
- ["B866",0x7AD1],
- ["B867",0x7AD2],
- ["B868",0x7AD3],
- ["B869",0x7AD4],
- ["B86A",0x7AD5],
- ["CAFA",0x7AD6],
- ["B86B",0x7AD7],
- ["B86C",0x7AD8],
- ["D5BE",0x7AD9],
- ["B86D",0x7ADA],
- ["B86E",0x7ADB],
- ["B86F",0x7ADC],
- ["B870",0x7ADD],
- ["BEBA",0x7ADE],
- ["BEB9",0x7ADF],
- ["D5C2",0x7AE0],
- ["B871",0x7AE1],
- ["B872",0x7AE2],
- ["BFA2",0x7AE3],
- ["B873",0x7AE4],
- ["CDAF",0x7AE5],
- ["F1B5",0x7AE6],
- ["B874",0x7AE7],
- ["B875",0x7AE8],
- ["B876",0x7AE9],
- ["B877",0x7AEA],
- ["B878",0x7AEB],
- ["B879",0x7AEC],
- ["BDDF",0x7AED],
- ["B87A",0x7AEE],
- ["B6CB",0x7AEF],
- ["B87B",0x7AF0],
- ["B87C",0x7AF1],
- ["B87D",0x7AF2],
- ["B87E",0x7AF3],
- ["B880",0x7AF4],
- ["B881",0x7AF5],
- ["B882",0x7AF6],
- ["B883",0x7AF7],
- ["B884",0x7AF8],
- ["D6F1",0x7AF9],
- ["F3C3",0x7AFA],
- ["B885",0x7AFB],
- ["B886",0x7AFC],
- ["F3C4",0x7AFD],
- ["B887",0x7AFE],
- ["B8CD",0x7AFF],
- ["B888",0x7B00],
- ["B889",0x7B01],
- ["B88A",0x7B02],
- ["F3C6",0x7B03],
- ["F3C7",0x7B04],
- ["B88B",0x7B05],
- ["B0CA",0x7B06],
- ["B88C",0x7B07],
- ["F3C5",0x7B08],
- ["B88D",0x7B09],
- ["F3C9",0x7B0A],
- ["CBF1",0x7B0B],
- ["B88E",0x7B0C],
- ["B88F",0x7B0D],
- ["B890",0x7B0E],
- ["F3CB",0x7B0F],
- ["B891",0x7B10],
- ["D0A6",0x7B11],
- ["B892",0x7B12],
- ["B893",0x7B13],
- ["B1CA",0x7B14],
- ["F3C8",0x7B15],
- ["B894",0x7B16],
- ["B895",0x7B17],
- ["B896",0x7B18],
- ["F3CF",0x7B19],
- ["B897",0x7B1A],
- ["B5D1",0x7B1B],
- ["B898",0x7B1C],
- ["B899",0x7B1D],
- ["F3D7",0x7B1E],
- ["B89A",0x7B1F],
- ["F3D2",0x7B20],
- ["B89B",0x7B21],
- ["B89C",0x7B22],
- ["B89D",0x7B23],
- ["F3D4",0x7B24],
- ["F3D3",0x7B25],
- ["B7FB",0x7B26],
- ["B89E",0x7B27],
- ["B1BF",0x7B28],
- ["B89F",0x7B29],
- ["F3CE",0x7B2A],
- ["F3CA",0x7B2B],
- ["B5DA",0x7B2C],
- ["B8A0",0x7B2D],
- ["F3D0",0x7B2E],
- ["B940",0x7B2F],
- ["B941",0x7B30],
- ["F3D1",0x7B31],
- ["B942",0x7B32],
- ["F3D5",0x7B33],
- ["B943",0x7B34],
- ["B944",0x7B35],
- ["B945",0x7B36],
- ["B946",0x7B37],
- ["F3CD",0x7B38],
- ["B947",0x7B39],
- ["BCE3",0x7B3A],
- ["B948",0x7B3B],
- ["C1FD",0x7B3C],
- ["B949",0x7B3D],
- ["F3D6",0x7B3E],
- ["B94A",0x7B3F],
- ["B94B",0x7B40],
- ["B94C",0x7B41],
- ["B94D",0x7B42],
- ["B94E",0x7B43],
- ["B94F",0x7B44],
- ["F3DA",0x7B45],
- ["B950",0x7B46],
- ["F3CC",0x7B47],
- ["B951",0x7B48],
- ["B5C8",0x7B49],
- ["B952",0x7B4A],
- ["BDEE",0x7B4B],
- ["F3DC",0x7B4C],
- ["B953",0x7B4D],
- ["B954",0x7B4E],
- ["B7A4",0x7B4F],
- ["BFF0",0x7B50],
- ["D6FE",0x7B51],
- ["CDB2",0x7B52],
- ["B955",0x7B53],
- ["B4F0",0x7B54],
- ["B956",0x7B55],
- ["B2DF",0x7B56],
- ["B957",0x7B57],
- ["F3D8",0x7B58],
- ["B958",0x7B59],
- ["F3D9",0x7B5A],
- ["C9B8",0x7B5B],
- ["B959",0x7B5C],
- ["F3DD",0x7B5D],
- ["B95A",0x7B5E],
- ["B95B",0x7B5F],
- ["F3DE",0x7B60],
- ["B95C",0x7B61],
- ["F3E1",0x7B62],
- ["B95D",0x7B63],
- ["B95E",0x7B64],
- ["B95F",0x7B65],
- ["B960",0x7B66],
- ["B961",0x7B67],
- ["B962",0x7B68],
- ["B963",0x7B69],
- ["B964",0x7B6A],
- ["B965",0x7B6B],
- ["B966",0x7B6C],
- ["B967",0x7B6D],
- ["F3DF",0x7B6E],
- ["B968",0x7B6F],
- ["B969",0x7B70],
- ["F3E3",0x7B71],
- ["F3E2",0x7B72],
- ["B96A",0x7B73],
- ["B96B",0x7B74],
- ["F3DB",0x7B75],
- ["B96C",0x7B76],
- ["BFEA",0x7B77],
- ["B96D",0x7B78],
- ["B3EF",0x7B79],
- ["B96E",0x7B7A],
- ["F3E0",0x7B7B],
- ["B96F",0x7B7C],
- ["B970",0x7B7D],
- ["C7A9",0x7B7E],
- ["B971",0x7B7F],
- ["BCF2",0x7B80],
- ["B972",0x7B81],
- ["B973",0x7B82],
- ["B974",0x7B83],
- ["B975",0x7B84],
- ["F3EB",0x7B85],
- ["B976",0x7B86],
- ["B977",0x7B87],
- ["B978",0x7B88],
- ["B979",0x7B89],
- ["B97A",0x7B8A],
- ["B97B",0x7B8B],
- ["B97C",0x7B8C],
- ["B9BF",0x7B8D],
- ["B97D",0x7B8E],
- ["B97E",0x7B8F],
- ["F3E4",0x7B90],
- ["B980",0x7B91],
- ["B981",0x7B92],
- ["B982",0x7B93],
- ["B2AD",0x7B94],
- ["BBFE",0x7B95],
- ["B983",0x7B96],
- ["CBE3",0x7B97],
- ["B984",0x7B98],
- ["B985",0x7B99],
- ["B986",0x7B9A],
- ["B987",0x7B9B],
- ["F3ED",0x7B9C],
- ["F3E9",0x7B9D],
- ["B988",0x7B9E],
- ["B989",0x7B9F],
- ["B98A",0x7BA0],
- ["B9DC",0x7BA1],
- ["F3EE",0x7BA2],
- ["B98B",0x7BA3],
- ["B98C",0x7BA4],
- ["B98D",0x7BA5],
- ["F3E5",0x7BA6],
- ["F3E6",0x7BA7],
- ["F3EA",0x7BA8],
- ["C2E1",0x7BA9],
- ["F3EC",0x7BAA],
- ["F3EF",0x7BAB],
- ["F3E8",0x7BAC],
- ["BCFD",0x7BAD],
- ["B98E",0x7BAE],
- ["B98F",0x7BAF],
- ["B990",0x7BB0],
- ["CFE4",0x7BB1],
- ["B991",0x7BB2],
- ["B992",0x7BB3],
- ["F3F0",0x7BB4],
- ["B993",0x7BB5],
- ["B994",0x7BB6],
- ["B995",0x7BB7],
- ["F3E7",0x7BB8],
- ["B996",0x7BB9],
- ["B997",0x7BBA],
- ["B998",0x7BBB],
- ["B999",0x7BBC],
- ["B99A",0x7BBD],
- ["B99B",0x7BBE],
- ["B99C",0x7BBF],
- ["B99D",0x7BC0],
- ["F3F2",0x7BC1],
- ["B99E",0x7BC2],
- ["B99F",0x7BC3],
- ["B9A0",0x7BC4],
- ["BA40",0x7BC5],
- ["D7AD",0x7BC6],
- ["C6AA",0x7BC7],
- ["BA41",0x7BC8],
- ["BA42",0x7BC9],
- ["BA43",0x7BCA],
- ["BA44",0x7BCB],
- ["F3F3",0x7BCC],
- ["BA45",0x7BCD],
- ["BA46",0x7BCE],
- ["BA47",0x7BCF],
- ["BA48",0x7BD0],
- ["F3F1",0x7BD1],
- ["BA49",0x7BD2],
- ["C2A8",0x7BD3],
- ["BA4A",0x7BD4],
- ["BA4B",0x7BD5],
- ["BA4C",0x7BD6],
- ["BA4D",0x7BD7],
- ["BA4E",0x7BD8],
- ["B8DD",0x7BD9],
- ["F3F5",0x7BDA],
- ["BA4F",0x7BDB],
- ["BA50",0x7BDC],
- ["F3F4",0x7BDD],
- ["BA51",0x7BDE],
- ["BA52",0x7BDF],
- ["BA53",0x7BE0],
- ["B4DB",0x7BE1],
- ["BA54",0x7BE2],
- ["BA55",0x7BE3],
- ["BA56",0x7BE4],
- ["F3F6",0x7BE5],
- ["F3F7",0x7BE6],
- ["BA57",0x7BE7],
- ["BA58",0x7BE8],
- ["BA59",0x7BE9],
- ["F3F8",0x7BEA],
- ["BA5A",0x7BEB],
- ["BA5B",0x7BEC],
- ["BA5C",0x7BED],
- ["C0BA",0x7BEE],
- ["BA5D",0x7BEF],
- ["BA5E",0x7BF0],
- ["C0E9",0x7BF1],
- ["BA5F",0x7BF2],
- ["BA60",0x7BF3],
- ["BA61",0x7BF4],
- ["BA62",0x7BF5],
- ["BA63",0x7BF6],
- ["C5F1",0x7BF7],
- ["BA64",0x7BF8],
- ["BA65",0x7BF9],
- ["BA66",0x7BFA],
- ["BA67",0x7BFB],
- ["F3FB",0x7BFC],
- ["BA68",0x7BFD],
- ["F3FA",0x7BFE],
- ["BA69",0x7BFF],
- ["BA6A",0x7C00],
- ["BA6B",0x7C01],
- ["BA6C",0x7C02],
- ["BA6D",0x7C03],
- ["BA6E",0x7C04],
- ["BA6F",0x7C05],
- ["BA70",0x7C06],
- ["B4D8",0x7C07],
- ["BA71",0x7C08],
- ["BA72",0x7C09],
- ["BA73",0x7C0A],
- ["F3FE",0x7C0B],
- ["F3F9",0x7C0C],
- ["BA74",0x7C0D],
- ["BA75",0x7C0E],
- ["F3FC",0x7C0F],
- ["BA76",0x7C10],
- ["BA77",0x7C11],
- ["BA78",0x7C12],
- ["BA79",0x7C13],
- ["BA7A",0x7C14],
- ["BA7B",0x7C15],
- ["F3FD",0x7C16],
- ["BA7C",0x7C17],
- ["BA7D",0x7C18],
- ["BA7E",0x7C19],
- ["BA80",0x7C1A],
- ["BA81",0x7C1B],
- ["BA82",0x7C1C],
- ["BA83",0x7C1D],
- ["BA84",0x7C1E],
- ["F4A1",0x7C1F],
- ["BA85",0x7C20],
- ["BA86",0x7C21],
- ["BA87",0x7C22],
- ["BA88",0x7C23],
- ["BA89",0x7C24],
- ["BA8A",0x7C25],
- ["F4A3",0x7C26],
- ["BBC9",0x7C27],
- ["BA8B",0x7C28],
- ["BA8C",0x7C29],
- ["F4A2",0x7C2A],
- ["BA8D",0x7C2B],
- ["BA8E",0x7C2C],
- ["BA8F",0x7C2D],
- ["BA90",0x7C2E],
- ["BA91",0x7C2F],
- ["BA92",0x7C30],
- ["BA93",0x7C31],
- ["BA94",0x7C32],
- ["BA95",0x7C33],
- ["BA96",0x7C34],
- ["BA97",0x7C35],
- ["BA98",0x7C36],
- ["BA99",0x7C37],
- ["F4A4",0x7C38],
- ["BA9A",0x7C39],
- ["BA9B",0x7C3A],
- ["BA9C",0x7C3B],
- ["BA9D",0x7C3C],
- ["BA9E",0x7C3D],
- ["BA9F",0x7C3E],
- ["B2BE",0x7C3F],
- ["F4A6",0x7C40],
- ["F4A5",0x7C41],
- ["BAA0",0x7C42],
- ["BB40",0x7C43],
- ["BB41",0x7C44],
- ["BB42",0x7C45],
- ["BB43",0x7C46],
- ["BB44",0x7C47],
- ["BB45",0x7C48],
- ["BB46",0x7C49],
- ["BB47",0x7C4A],
- ["BB48",0x7C4B],
- ["BB49",0x7C4C],
- ["BCAE",0x7C4D],
- ["BB4A",0x7C4E],
- ["BB4B",0x7C4F],
- ["BB4C",0x7C50],
- ["BB4D",0x7C51],
- ["BB4E",0x7C52],
- ["BB4F",0x7C53],
- ["BB50",0x7C54],
- ["BB51",0x7C55],
- ["BB52",0x7C56],
- ["BB53",0x7C57],
- ["BB54",0x7C58],
- ["BB55",0x7C59],
- ["BB56",0x7C5A],
- ["BB57",0x7C5B],
- ["BB58",0x7C5C],
- ["BB59",0x7C5D],
- ["BB5A",0x7C5E],
- ["BB5B",0x7C5F],
- ["BB5C",0x7C60],
- ["BB5D",0x7C61],
- ["BB5E",0x7C62],
- ["BB5F",0x7C63],
- ["BB60",0x7C64],
- ["BB61",0x7C65],
- ["BB62",0x7C66],
- ["BB63",0x7C67],
- ["BB64",0x7C68],
- ["BB65",0x7C69],
- ["BB66",0x7C6A],
- ["BB67",0x7C6B],
- ["BB68",0x7C6C],
- ["BB69",0x7C6D],
- ["BB6A",0x7C6E],
- ["BB6B",0x7C6F],
- ["BB6C",0x7C70],
- ["BB6D",0x7C71],
- ["BB6E",0x7C72],
- ["C3D7",0x7C73],
- ["D9E1",0x7C74],
- ["BB6F",0x7C75],
- ["BB70",0x7C76],
- ["BB71",0x7C77],
- ["BB72",0x7C78],
- ["BB73",0x7C79],
- ["BB74",0x7C7A],
- ["C0E0",0x7C7B],
- ["F4CC",0x7C7C],
- ["D7D1",0x7C7D],
- ["BB75",0x7C7E],
- ["BB76",0x7C7F],
- ["BB77",0x7C80],
- ["BB78",0x7C81],
- ["BB79",0x7C82],
- ["BB7A",0x7C83],
- ["BB7B",0x7C84],
- ["BB7C",0x7C85],
- ["BB7D",0x7C86],
- ["BB7E",0x7C87],
- ["BB80",0x7C88],
- ["B7DB",0x7C89],
- ["BB81",0x7C8A],
- ["BB82",0x7C8B],
- ["BB83",0x7C8C],
- ["BB84",0x7C8D],
- ["BB85",0x7C8E],
- ["BB86",0x7C8F],
- ["BB87",0x7C90],
- ["F4CE",0x7C91],
- ["C1A3",0x7C92],
- ["BB88",0x7C93],
- ["BB89",0x7C94],
- ["C6C9",0x7C95],
- ["BB8A",0x7C96],
- ["B4D6",0x7C97],
- ["D5B3",0x7C98],
- ["BB8B",0x7C99],
- ["BB8C",0x7C9A],
- ["BB8D",0x7C9B],
- ["F4D0",0x7C9C],
- ["F4CF",0x7C9D],
- ["F4D1",0x7C9E],
- ["CBDA",0x7C9F],
- ["BB8E",0x7CA0],
- ["BB8F",0x7CA1],
- ["F4D2",0x7CA2],
- ["BB90",0x7CA3],
- ["D4C1",0x7CA4],
- ["D6E0",0x7CA5],
- ["BB91",0x7CA6],
- ["BB92",0x7CA7],
- ["BB93",0x7CA8],
- ["BB94",0x7CA9],
- ["B7E0",0x7CAA],
- ["BB95",0x7CAB],
- ["BB96",0x7CAC],
- ["BB97",0x7CAD],
- ["C1B8",0x7CAE],
- ["BB98",0x7CAF],
- ["BB99",0x7CB0],
- ["C1BB",0x7CB1],
- ["F4D3",0x7CB2],
- ["BEAC",0x7CB3],
- ["BB9A",0x7CB4],
- ["BB9B",0x7CB5],
- ["BB9C",0x7CB6],
- ["BB9D",0x7CB7],
- ["BB9E",0x7CB8],
- ["B4E2",0x7CB9],
- ["BB9F",0x7CBA],
- ["BBA0",0x7CBB],
- ["F4D4",0x7CBC],
- ["F4D5",0x7CBD],
- ["BEAB",0x7CBE],
- ["BC40",0x7CBF],
- ["BC41",0x7CC0],
- ["F4D6",0x7CC1],
- ["BC42",0x7CC2],
- ["BC43",0x7CC3],
- ["BC44",0x7CC4],
- ["F4DB",0x7CC5],
- ["BC45",0x7CC6],
- ["F4D7",0x7CC7],
- ["F4DA",0x7CC8],
- ["BC46",0x7CC9],
- ["BAFD",0x7CCA],
- ["BC47",0x7CCB],
- ["F4D8",0x7CCC],
- ["F4D9",0x7CCD],
- ["BC48",0x7CCE],
- ["BC49",0x7CCF],
- ["BC4A",0x7CD0],
- ["BC4B",0x7CD1],
- ["BC4C",0x7CD2],
- ["BC4D",0x7CD3],
- ["BC4E",0x7CD4],
- ["B8E2",0x7CD5],
- ["CCC7",0x7CD6],
- ["F4DC",0x7CD7],
- ["BC4F",0x7CD8],
- ["B2DA",0x7CD9],
- ["BC50",0x7CDA],
- ["BC51",0x7CDB],
- ["C3D3",0x7CDC],
- ["BC52",0x7CDD],
- ["BC53",0x7CDE],
- ["D4E3",0x7CDF],
- ["BFB7",0x7CE0],
- ["BC54",0x7CE1],
- ["BC55",0x7CE2],
- ["BC56",0x7CE3],
- ["BC57",0x7CE4],
- ["BC58",0x7CE5],
- ["BC59",0x7CE6],
- ["BC5A",0x7CE7],
- ["F4DD",0x7CE8],
- ["BC5B",0x7CE9],
- ["BC5C",0x7CEA],
- ["BC5D",0x7CEB],
- ["BC5E",0x7CEC],
- ["BC5F",0x7CED],
- ["BC60",0x7CEE],
- ["C5B4",0x7CEF],
- ["BC61",0x7CF0],
- ["BC62",0x7CF1],
- ["BC63",0x7CF2],
- ["BC64",0x7CF3],
- ["BC65",0x7CF4],
- ["BC66",0x7CF5],
- ["BC67",0x7CF6],
- ["BC68",0x7CF7],
- ["F4E9",0x7CF8],
- ["BC69",0x7CF9],
- ["BC6A",0x7CFA],
- ["CFB5",0x7CFB],
- ["BC6B",0x7CFC],
- ["BC6C",0x7CFD],
- ["BC6D",0x7CFE],
- ["BC6E",0x7CFF],
- ["BC6F",0x7D00],
- ["BC70",0x7D01],
- ["BC71",0x7D02],
- ["BC72",0x7D03],
- ["BC73",0x7D04],
- ["BC74",0x7D05],
- ["BC75",0x7D06],
- ["BC76",0x7D07],
- ["BC77",0x7D08],
- ["BC78",0x7D09],
- ["CEC9",0x7D0A],
- ["BC79",0x7D0B],
- ["BC7A",0x7D0C],
- ["BC7B",0x7D0D],
- ["BC7C",0x7D0E],
- ["BC7D",0x7D0F],
- ["BC7E",0x7D10],
- ["BC80",0x7D11],
- ["BC81",0x7D12],
- ["BC82",0x7D13],
- ["BC83",0x7D14],
- ["BC84",0x7D15],
- ["BC85",0x7D16],
- ["BC86",0x7D17],
- ["BC87",0x7D18],
- ["BC88",0x7D19],
- ["BC89",0x7D1A],
- ["BC8A",0x7D1B],
- ["BC8B",0x7D1C],
- ["BC8C",0x7D1D],
- ["BC8D",0x7D1E],
- ["BC8E",0x7D1F],
- ["CBD8",0x7D20],
- ["BC8F",0x7D21],
- ["CBF7",0x7D22],
- ["BC90",0x7D23],
- ["BC91",0x7D24],
- ["BC92",0x7D25],
- ["BC93",0x7D26],
- ["BDF4",0x7D27],
- ["BC94",0x7D28],
- ["BC95",0x7D29],
- ["BC96",0x7D2A],
- ["D7CF",0x7D2B],
- ["BC97",0x7D2C],
- ["BC98",0x7D2D],
- ["BC99",0x7D2E],
- ["C0DB",0x7D2F],
- ["BC9A",0x7D30],
- ["BC9B",0x7D31],
- ["BC9C",0x7D32],
- ["BC9D",0x7D33],
- ["BC9E",0x7D34],
- ["BC9F",0x7D35],
- ["BCA0",0x7D36],
- ["BD40",0x7D37],
- ["BD41",0x7D38],
- ["BD42",0x7D39],
- ["BD43",0x7D3A],
- ["BD44",0x7D3B],
- ["BD45",0x7D3C],
- ["BD46",0x7D3D],
- ["BD47",0x7D3E],
- ["BD48",0x7D3F],
- ["BD49",0x7D40],
- ["BD4A",0x7D41],
- ["BD4B",0x7D42],
- ["BD4C",0x7D43],
- ["BD4D",0x7D44],
- ["BD4E",0x7D45],
- ["BD4F",0x7D46],
- ["BD50",0x7D47],
- ["BD51",0x7D48],
- ["BD52",0x7D49],
- ["BD53",0x7D4A],
- ["BD54",0x7D4B],
- ["BD55",0x7D4C],
- ["BD56",0x7D4D],
- ["BD57",0x7D4E],
- ["BD58",0x7D4F],
- ["BD59",0x7D50],
- ["BD5A",0x7D51],
- ["BD5B",0x7D52],
- ["BD5C",0x7D53],
- ["BD5D",0x7D54],
- ["BD5E",0x7D55],
- ["BD5F",0x7D56],
- ["BD60",0x7D57],
- ["BD61",0x7D58],
- ["BD62",0x7D59],
- ["BD63",0x7D5A],
- ["BD64",0x7D5B],
- ["BD65",0x7D5C],
- ["BD66",0x7D5D],
- ["BD67",0x7D5E],
- ["BD68",0x7D5F],
- ["BD69",0x7D60],
- ["BD6A",0x7D61],
- ["BD6B",0x7D62],
- ["BD6C",0x7D63],
- ["BD6D",0x7D64],
- ["BD6E",0x7D65],
- ["BD6F",0x7D66],
- ["BD70",0x7D67],
- ["BD71",0x7D68],
- ["BD72",0x7D69],
- ["BD73",0x7D6A],
- ["BD74",0x7D6B],
- ["BD75",0x7D6C],
- ["BD76",0x7D6D],
- ["D0F5",0x7D6E],
- ["BD77",0x7D6F],
- ["BD78",0x7D70],
- ["BD79",0x7D71],
- ["BD7A",0x7D72],
- ["BD7B",0x7D73],
- ["BD7C",0x7D74],
- ["BD7D",0x7D75],
- ["BD7E",0x7D76],
- ["F4EA",0x7D77],
- ["BD80",0x7D78],
- ["BD81",0x7D79],
- ["BD82",0x7D7A],
- ["BD83",0x7D7B],
- ["BD84",0x7D7C],
- ["BD85",0x7D7D],
- ["BD86",0x7D7E],
- ["BD87",0x7D7F],
- ["BD88",0x7D80],
- ["BD89",0x7D81],
- ["BD8A",0x7D82],
- ["BD8B",0x7D83],
- ["BD8C",0x7D84],
- ["BD8D",0x7D85],
- ["BD8E",0x7D86],
- ["BD8F",0x7D87],
- ["BD90",0x7D88],
- ["BD91",0x7D89],
- ["BD92",0x7D8A],
- ["BD93",0x7D8B],
- ["BD94",0x7D8C],
- ["BD95",0x7D8D],
- ["BD96",0x7D8E],
- ["BD97",0x7D8F],
- ["BD98",0x7D90],
- ["BD99",0x7D91],
- ["BD9A",0x7D92],
- ["BD9B",0x7D93],
- ["BD9C",0x7D94],
- ["BD9D",0x7D95],
- ["BD9E",0x7D96],
- ["BD9F",0x7D97],
- ["BDA0",0x7D98],
- ["BE40",0x7D99],
- ["BE41",0x7D9A],
- ["BE42",0x7D9B],
- ["BE43",0x7D9C],
- ["BE44",0x7D9D],
- ["BE45",0x7D9E],
- ["BE46",0x7D9F],
- ["BE47",0x7DA0],
- ["BE48",0x7DA1],
- ["BE49",0x7DA2],
- ["BE4A",0x7DA3],
- ["BE4B",0x7DA4],
- ["BE4C",0x7DA5],
- ["F4EB",0x7DA6],
- ["BE4D",0x7DA7],
- ["BE4E",0x7DA8],
- ["BE4F",0x7DA9],
- ["BE50",0x7DAA],
- ["BE51",0x7DAB],
- ["BE52",0x7DAC],
- ["BE53",0x7DAD],
- ["F4EC",0x7DAE],
- ["BE54",0x7DAF],
- ["BE55",0x7DB0],
- ["BE56",0x7DB1],
- ["BE57",0x7DB2],
- ["BE58",0x7DB3],
- ["BE59",0x7DB4],
- ["BE5A",0x7DB5],
- ["BE5B",0x7DB6],
- ["BE5C",0x7DB7],
- ["BE5D",0x7DB8],
- ["BE5E",0x7DB9],
- ["BE5F",0x7DBA],
- ["BE60",0x7DBB],
- ["BE61",0x7DBC],
- ["BE62",0x7DBD],
- ["BE63",0x7DBE],
- ["BE64",0x7DBF],
- ["BE65",0x7DC0],
- ["BE66",0x7DC1],
- ["BE67",0x7DC2],
- ["BE68",0x7DC3],
- ["BE69",0x7DC4],
- ["BE6A",0x7DC5],
- ["BE6B",0x7DC6],
- ["BE6C",0x7DC7],
- ["BE6D",0x7DC8],
- ["BE6E",0x7DC9],
- ["BE6F",0x7DCA],
- ["BE70",0x7DCB],
- ["BE71",0x7DCC],
- ["BE72",0x7DCD],
- ["BE73",0x7DCE],
- ["BE74",0x7DCF],
- ["BE75",0x7DD0],
- ["BE76",0x7DD1],
- ["BE77",0x7DD2],
- ["BE78",0x7DD3],
- ["BE79",0x7DD4],
- ["BE7A",0x7DD5],
- ["BE7B",0x7DD6],
- ["BE7C",0x7DD7],
- ["BE7D",0x7DD8],
- ["BE7E",0x7DD9],
- ["BE80",0x7DDA],
- ["BE81",0x7DDB],
- ["BE82",0x7DDC],
- ["BE83",0x7DDD],
- ["BE84",0x7DDE],
- ["BE85",0x7DDF],
- ["BE86",0x7DE0],
- ["BE87",0x7DE1],
- ["BE88",0x7DE2],
- ["BE89",0x7DE3],
- ["BE8A",0x7DE4],
- ["BE8B",0x7DE5],
- ["BE8C",0x7DE6],
- ["BE8D",0x7DE7],
- ["BE8E",0x7DE8],
- ["BE8F",0x7DE9],
- ["BE90",0x7DEA],
- ["BE91",0x7DEB],
- ["BE92",0x7DEC],
- ["BE93",0x7DED],
- ["BE94",0x7DEE],
- ["BE95",0x7DEF],
- ["BE96",0x7DF0],
- ["BE97",0x7DF1],
- ["BE98",0x7DF2],
- ["BE99",0x7DF3],
- ["BE9A",0x7DF4],
- ["BE9B",0x7DF5],
- ["BE9C",0x7DF6],
- ["BE9D",0x7DF7],
- ["BE9E",0x7DF8],
- ["BE9F",0x7DF9],
- ["BEA0",0x7DFA],
- ["BF40",0x7DFB],
- ["BF41",0x7DFC],
- ["BF42",0x7DFD],
- ["BF43",0x7DFE],
- ["BF44",0x7DFF],
- ["BF45",0x7E00],
- ["BF46",0x7E01],
- ["BF47",0x7E02],
- ["BF48",0x7E03],
- ["BF49",0x7E04],
- ["BF4A",0x7E05],
- ["BF4B",0x7E06],
- ["BF4C",0x7E07],
- ["BF4D",0x7E08],
- ["BF4E",0x7E09],
- ["BF4F",0x7E0A],
- ["BF50",0x7E0B],
- ["BF51",0x7E0C],
- ["BF52",0x7E0D],
- ["BF53",0x7E0E],
- ["BF54",0x7E0F],
- ["BF55",0x7E10],
- ["BF56",0x7E11],
- ["BF57",0x7E12],
- ["BF58",0x7E13],
- ["BF59",0x7E14],
- ["BF5A",0x7E15],
- ["BF5B",0x7E16],
- ["BF5C",0x7E17],
- ["BF5D",0x7E18],
- ["BF5E",0x7E19],
- ["BF5F",0x7E1A],
- ["BF60",0x7E1B],
- ["BF61",0x7E1C],
- ["BF62",0x7E1D],
- ["BF63",0x7E1E],
- ["BF64",0x7E1F],
- ["BF65",0x7E20],
- ["BF66",0x7E21],
- ["BF67",0x7E22],
- ["BF68",0x7E23],
- ["BF69",0x7E24],
- ["BF6A",0x7E25],
- ["BF6B",0x7E26],
- ["BF6C",0x7E27],
- ["BF6D",0x7E28],
- ["BF6E",0x7E29],
- ["BF6F",0x7E2A],
- ["BF70",0x7E2B],
- ["BF71",0x7E2C],
- ["BF72",0x7E2D],
- ["BF73",0x7E2E],
- ["BF74",0x7E2F],
- ["BF75",0x7E30],
- ["BF76",0x7E31],
- ["BF77",0x7E32],
- ["BF78",0x7E33],
- ["BF79",0x7E34],
- ["BF7A",0x7E35],
- ["BF7B",0x7E36],
- ["BF7C",0x7E37],
- ["BF7D",0x7E38],
- ["BF7E",0x7E39],
- ["BF80",0x7E3A],
- ["F7E3",0x7E3B],
- ["BF81",0x7E3C],
- ["BF82",0x7E3D],
- ["BF83",0x7E3E],
- ["BF84",0x7E3F],
- ["BF85",0x7E40],
- ["B7B1",0x7E41],
- ["BF86",0x7E42],
- ["BF87",0x7E43],
- ["BF88",0x7E44],
- ["BF89",0x7E45],
- ["BF8A",0x7E46],
- ["F4ED",0x7E47],
- ["BF8B",0x7E48],
- ["BF8C",0x7E49],
- ["BF8D",0x7E4A],
- ["BF8E",0x7E4B],
- ["BF8F",0x7E4C],
- ["BF90",0x7E4D],
- ["BF91",0x7E4E],
- ["BF92",0x7E4F],
- ["BF93",0x7E50],
- ["BF94",0x7E51],
- ["BF95",0x7E52],
- ["BF96",0x7E53],
- ["BF97",0x7E54],
- ["BF98",0x7E55],
- ["BF99",0x7E56],
- ["BF9A",0x7E57],
- ["BF9B",0x7E58],
- ["BF9C",0x7E59],
- ["BF9D",0x7E5A],
- ["BF9E",0x7E5B],
- ["BF9F",0x7E5C],
- ["BFA0",0x7E5D],
- ["C040",0x7E5E],
- ["C041",0x7E5F],
- ["C042",0x7E60],
- ["C043",0x7E61],
- ["C044",0x7E62],
- ["C045",0x7E63],
- ["C046",0x7E64],
- ["C047",0x7E65],
- ["C048",0x7E66],
- ["C049",0x7E67],
- ["C04A",0x7E68],
- ["C04B",0x7E69],
- ["C04C",0x7E6A],
- ["C04D",0x7E6B],
- ["C04E",0x7E6C],
- ["C04F",0x7E6D],
- ["C050",0x7E6E],
- ["C051",0x7E6F],
- ["C052",0x7E70],
- ["C053",0x7E71],
- ["C054",0x7E72],
- ["C055",0x7E73],
- ["C056",0x7E74],
- ["C057",0x7E75],
- ["C058",0x7E76],
- ["C059",0x7E77],
- ["C05A",0x7E78],
- ["C05B",0x7E79],
- ["C05C",0x7E7A],
- ["C05D",0x7E7B],
- ["C05E",0x7E7C],
- ["C05F",0x7E7D],
- ["C060",0x7E7E],
- ["C061",0x7E7F],
- ["C062",0x7E80],
- ["C063",0x7E81],
- ["D7EB",0x7E82],
- ["C064",0x7E83],
- ["C065",0x7E84],
- ["C066",0x7E85],
- ["C067",0x7E86],
- ["C068",0x7E87],
- ["C069",0x7E88],
- ["C06A",0x7E89],
- ["C06B",0x7E8A],
- ["C06C",0x7E8B],
- ["C06D",0x7E8C],
- ["C06E",0x7E8D],
- ["C06F",0x7E8E],
- ["C070",0x7E8F],
- ["C071",0x7E90],
- ["C072",0x7E91],
- ["C073",0x7E92],
- ["C074",0x7E93],
- ["C075",0x7E94],
- ["C076",0x7E95],
- ["C077",0x7E96],
- ["C078",0x7E97],
- ["C079",0x7E98],
- ["C07A",0x7E99],
- ["C07B",0x7E9A],
- ["F4EE",0x7E9B],
- ["C07C",0x7E9C],
- ["C07D",0x7E9D],
- ["C07E",0x7E9E],
- ["E6F9",0x7E9F],
- ["BEC0",0x7EA0],
- ["E6FA",0x7EA1],
- ["BAEC",0x7EA2],
- ["E6FB",0x7EA3],
- ["CFCB",0x7EA4],
- ["E6FC",0x7EA5],
- ["D4BC",0x7EA6],
- ["BCB6",0x7EA7],
- ["E6FD",0x7EA8],
- ["E6FE",0x7EA9],
- ["BCCD",0x7EAA],
- ["C8D2",0x7EAB],
- ["CEB3",0x7EAC],
- ["E7A1",0x7EAD],
- ["C080",0x7EAE],
- ["B4BF",0x7EAF],
- ["E7A2",0x7EB0],
- ["C9B4",0x7EB1],
- ["B8D9",0x7EB2],
- ["C4C9",0x7EB3],
- ["C081",0x7EB4],
- ["D7DD",0x7EB5],
- ["C2DA",0x7EB6],
- ["B7D7",0x7EB7],
- ["D6BD",0x7EB8],
- ["CEC6",0x7EB9],
- ["B7C4",0x7EBA],
- ["C082",0x7EBB],
- ["C083",0x7EBC],
- ["C5A6",0x7EBD],
- ["E7A3",0x7EBE],
- ["CFDF",0x7EBF],
- ["E7A4",0x7EC0],
- ["E7A5",0x7EC1],
- ["E7A6",0x7EC2],
- ["C1B7",0x7EC3],
- ["D7E9",0x7EC4],
- ["C9F0",0x7EC5],
- ["CFB8",0x7EC6],
- ["D6AF",0x7EC7],
- ["D6D5",0x7EC8],
- ["E7A7",0x7EC9],
- ["B0ED",0x7ECA],
- ["E7A8",0x7ECB],
- ["E7A9",0x7ECC],
- ["C9DC",0x7ECD],
- ["D2EF",0x7ECE],
- ["BEAD",0x7ECF],
- ["E7AA",0x7ED0],
- ["B0F3",0x7ED1],
- ["C8DE",0x7ED2],
- ["BDE1",0x7ED3],
- ["E7AB",0x7ED4],
- ["C8C6",0x7ED5],
- ["C084",0x7ED6],
- ["E7AC",0x7ED7],
- ["BBE6",0x7ED8],
- ["B8F8",0x7ED9],
- ["D1A4",0x7EDA],
- ["E7AD",0x7EDB],
- ["C2E7",0x7EDC],
- ["BEF8",0x7EDD],
- ["BDCA",0x7EDE],
- ["CDB3",0x7EDF],
- ["E7AE",0x7EE0],
- ["E7AF",0x7EE1],
- ["BEEE",0x7EE2],
- ["D0E5",0x7EE3],
- ["C085",0x7EE4],
- ["CBE7",0x7EE5],
- ["CCD0",0x7EE6],
- ["BCCC",0x7EE7],
- ["E7B0",0x7EE8],
- ["BCA8",0x7EE9],
- ["D0F7",0x7EEA],
- ["E7B1",0x7EEB],
- ["C086",0x7EEC],
- ["D0F8",0x7EED],
- ["E7B2",0x7EEE],
- ["E7B3",0x7EEF],
- ["B4C2",0x7EF0],
- ["E7B4",0x7EF1],
- ["E7B5",0x7EF2],
- ["C9FE",0x7EF3],
- ["CEAC",0x7EF4],
- ["C3E0",0x7EF5],
- ["E7B7",0x7EF6],
- ["B1C1",0x7EF7],
- ["B3F1",0x7EF8],
- ["C087",0x7EF9],
- ["E7B8",0x7EFA],
- ["E7B9",0x7EFB],
- ["D7DB",0x7EFC],
- ["D5C0",0x7EFD],
- ["E7BA",0x7EFE],
- ["C2CC",0x7EFF],
- ["D7BA",0x7F00],
- ["E7BB",0x7F01],
- ["E7BC",0x7F02],
- ["E7BD",0x7F03],
- ["BCEA",0x7F04],
- ["C3E5",0x7F05],
- ["C0C2",0x7F06],
- ["E7BE",0x7F07],
- ["E7BF",0x7F08],
- ["BCA9",0x7F09],
- ["C088",0x7F0A],
- ["E7C0",0x7F0B],
- ["E7C1",0x7F0C],
- ["E7B6",0x7F0D],
- ["B6D0",0x7F0E],
- ["E7C2",0x7F0F],
- ["C089",0x7F10],
- ["E7C3",0x7F11],
- ["E7C4",0x7F12],
- ["BBBA",0x7F13],
- ["B5DE",0x7F14],
- ["C2C6",0x7F15],
- ["B1E0",0x7F16],
- ["E7C5",0x7F17],
- ["D4B5",0x7F18],
- ["E7C6",0x7F19],
- ["B8BF",0x7F1A],
- ["E7C8",0x7F1B],
- ["E7C7",0x7F1C],
- ["B7EC",0x7F1D],
- ["C08A",0x7F1E],
- ["E7C9",0x7F1F],
- ["B2F8",0x7F20],
- ["E7CA",0x7F21],
- ["E7CB",0x7F22],
- ["E7CC",0x7F23],
- ["E7CD",0x7F24],
- ["E7CE",0x7F25],
- ["E7CF",0x7F26],
- ["E7D0",0x7F27],
- ["D3A7",0x7F28],
- ["CBF5",0x7F29],
- ["E7D1",0x7F2A],
- ["E7D2",0x7F2B],
- ["E7D3",0x7F2C],
- ["E7D4",0x7F2D],
- ["C9C9",0x7F2E],
- ["E7D5",0x7F2F],
- ["E7D6",0x7F30],
- ["E7D7",0x7F31],
- ["E7D8",0x7F32],
- ["E7D9",0x7F33],
- ["BDC9",0x7F34],
- ["E7DA",0x7F35],
- ["F3BE",0x7F36],
- ["C08B",0x7F37],
- ["B8D7",0x7F38],
- ["C08C",0x7F39],
- ["C8B1",0x7F3A],
- ["C08D",0x7F3B],
- ["C08E",0x7F3C],
- ["C08F",0x7F3D],
- ["C090",0x7F3E],
- ["C091",0x7F3F],
- ["C092",0x7F40],
- ["C093",0x7F41],
- ["F3BF",0x7F42],
- ["C094",0x7F43],
- ["F3C0",0x7F44],
- ["F3C1",0x7F45],
- ["C095",0x7F46],
- ["C096",0x7F47],
- ["C097",0x7F48],
- ["C098",0x7F49],
- ["C099",0x7F4A],
- ["C09A",0x7F4B],
- ["C09B",0x7F4C],
- ["C09C",0x7F4D],
- ["C09D",0x7F4E],
- ["C09E",0x7F4F],
- ["B9DE",0x7F50],
- ["CDF8",0x7F51],
- ["C09F",0x7F52],
- ["C0A0",0x7F53],
- ["D8E8",0x7F54],
- ["BAB1",0x7F55],
- ["C140",0x7F56],
- ["C2DE",0x7F57],
- ["EEB7",0x7F58],
- ["C141",0x7F59],
- ["B7A3",0x7F5A],
- ["C142",0x7F5B],
- ["C143",0x7F5C],
- ["C144",0x7F5D],
- ["C145",0x7F5E],
- ["EEB9",0x7F5F],
- ["C146",0x7F60],
- ["EEB8",0x7F61],
- ["B0D5",0x7F62],
- ["C147",0x7F63],
- ["C148",0x7F64],
- ["C149",0x7F65],
- ["C14A",0x7F66],
- ["C14B",0x7F67],
- ["EEBB",0x7F68],
- ["D5D6",0x7F69],
- ["D7EF",0x7F6A],
- ["C14C",0x7F6B],
- ["C14D",0x7F6C],
- ["C14E",0x7F6D],
- ["D6C3",0x7F6E],
- ["C14F",0x7F6F],
- ["C150",0x7F70],
- ["EEBD",0x7F71],
- ["CAF0",0x7F72],
- ["C151",0x7F73],
- ["EEBC",0x7F74],
- ["C152",0x7F75],
- ["C153",0x7F76],
- ["C154",0x7F77],
- ["C155",0x7F78],
- ["EEBE",0x7F79],
- ["C156",0x7F7A],
- ["C157",0x7F7B],
- ["C158",0x7F7C],
- ["C159",0x7F7D],
- ["EEC0",0x7F7E],
- ["C15A",0x7F7F],
- ["C15B",0x7F80],
- ["EEBF",0x7F81],
- ["C15C",0x7F82],
- ["C15D",0x7F83],
- ["C15E",0x7F84],
- ["C15F",0x7F85],
- ["C160",0x7F86],
- ["C161",0x7F87],
- ["C162",0x7F88],
- ["C163",0x7F89],
- ["D1F2",0x7F8A],
- ["C164",0x7F8B],
- ["C7BC",0x7F8C],
- ["C165",0x7F8D],
- ["C3C0",0x7F8E],
- ["C166",0x7F8F],
- ["C167",0x7F90],
- ["C168",0x7F91],
- ["C169",0x7F92],
- ["C16A",0x7F93],
- ["B8E1",0x7F94],
- ["C16B",0x7F95],
- ["C16C",0x7F96],
- ["C16D",0x7F97],
- ["C16E",0x7F98],
- ["C16F",0x7F99],
- ["C1E7",0x7F9A],
- ["C170",0x7F9B],
- ["C171",0x7F9C],
- ["F4C6",0x7F9D],
- ["D0DF",0x7F9E],
- ["F4C7",0x7F9F],
- ["C172",0x7FA0],
- ["CFDB",0x7FA1],
- ["C173",0x7FA2],
- ["C174",0x7FA3],
- ["C8BA",0x7FA4],
- ["C175",0x7FA5],
- ["C176",0x7FA6],
- ["F4C8",0x7FA7],
- ["C177",0x7FA8],
- ["C178",0x7FA9],
- ["C179",0x7FAA],
- ["C17A",0x7FAB],
- ["C17B",0x7FAC],
- ["C17C",0x7FAD],
- ["C17D",0x7FAE],
- ["F4C9",0x7FAF],
- ["F4CA",0x7FB0],
- ["C17E",0x7FB1],
- ["F4CB",0x7FB2],
- ["C180",0x7FB3],
- ["C181",0x7FB4],
- ["C182",0x7FB5],
- ["C183",0x7FB6],
- ["C184",0x7FB7],
- ["D9FA",0x7FB8],
- ["B8FE",0x7FB9],
- ["C185",0x7FBA],
- ["C186",0x7FBB],
- ["E5F1",0x7FBC],
- ["D3F0",0x7FBD],
- ["C187",0x7FBE],
- ["F4E0",0x7FBF],
- ["C188",0x7FC0],
- ["CECC",0x7FC1],
- ["C189",0x7FC2],
- ["C18A",0x7FC3],
- ["C18B",0x7FC4],
- ["B3E1",0x7FC5],
- ["C18C",0x7FC6],
- ["C18D",0x7FC7],
- ["C18E",0x7FC8],
- ["C18F",0x7FC9],
- ["F1B4",0x7FCA],
- ["C190",0x7FCB],
- ["D2EE",0x7FCC],
- ["C191",0x7FCD],
- ["F4E1",0x7FCE],
- ["C192",0x7FCF],
- ["C193",0x7FD0],
- ["C194",0x7FD1],
- ["C195",0x7FD2],
- ["C196",0x7FD3],
- ["CFE8",0x7FD4],
- ["F4E2",0x7FD5],
- ["C197",0x7FD6],
- ["C198",0x7FD7],
- ["C7CC",0x7FD8],
- ["C199",0x7FD9],
- ["C19A",0x7FDA],
- ["C19B",0x7FDB],
- ["C19C",0x7FDC],
- ["C19D",0x7FDD],
- ["C19E",0x7FDE],
- ["B5D4",0x7FDF],
- ["B4E4",0x7FE0],
- ["F4E4",0x7FE1],
- ["C19F",0x7FE2],
- ["C1A0",0x7FE3],
- ["C240",0x7FE4],
- ["F4E3",0x7FE5],
- ["F4E5",0x7FE6],
- ["C241",0x7FE7],
- ["C242",0x7FE8],
- ["F4E6",0x7FE9],
- ["C243",0x7FEA],
- ["C244",0x7FEB],
- ["C245",0x7FEC],
- ["C246",0x7FED],
- ["F4E7",0x7FEE],
- ["C247",0x7FEF],
- ["BAB2",0x7FF0],
- ["B0BF",0x7FF1],
- ["C248",0x7FF2],
- ["F4E8",0x7FF3],
- ["C249",0x7FF4],
- ["C24A",0x7FF5],
- ["C24B",0x7FF6],
- ["C24C",0x7FF7],
- ["C24D",0x7FF8],
- ["C24E",0x7FF9],
- ["C24F",0x7FFA],
- ["B7AD",0x7FFB],
- ["D2ED",0x7FFC],
- ["C250",0x7FFD],
- ["C251",0x7FFE],
- ["C252",0x7FFF],
- ["D2AB",0x8000],
- ["C0CF",0x8001],
- ["C253",0x8002],
- ["BFBC",0x8003],
- ["EBA3",0x8004],
- ["D5DF",0x8005],
- ["EAC8",0x8006],
- ["C254",0x8007],
- ["C255",0x8008],
- ["C256",0x8009],
- ["C257",0x800A],
- ["F1F3",0x800B],
- ["B6F8",0x800C],
- ["CBA3",0x800D],
- ["C258",0x800E],
- ["C259",0x800F],
- ["C4CD",0x8010],
- ["C25A",0x8011],
- ["F1E7",0x8012],
- ["C25B",0x8013],
- ["F1E8",0x8014],
- ["B8FB",0x8015],
- ["F1E9",0x8016],
- ["BAC4",0x8017],
- ["D4C5",0x8018],
- ["B0D2",0x8019],
- ["C25C",0x801A],
- ["C25D",0x801B],
- ["F1EA",0x801C],
- ["C25E",0x801D],
- ["C25F",0x801E],
- ["C260",0x801F],
- ["F1EB",0x8020],
- ["C261",0x8021],
- ["F1EC",0x8022],
- ["C262",0x8023],
- ["C263",0x8024],
- ["F1ED",0x8025],
- ["F1EE",0x8026],
- ["F1EF",0x8027],
- ["F1F1",0x8028],
- ["F1F0",0x8029],
- ["C5D5",0x802A],
- ["C264",0x802B],
- ["C265",0x802C],
- ["C266",0x802D],
- ["C267",0x802E],
- ["C268",0x802F],
- ["C269",0x8030],
- ["F1F2",0x8031],
- ["C26A",0x8032],
- ["B6FA",0x8033],
- ["C26B",0x8034],
- ["F1F4",0x8035],
- ["D2AE",0x8036],
- ["DEC7",0x8037],
- ["CBCA",0x8038],
- ["C26C",0x8039],
- ["C26D",0x803A],
- ["B3DC",0x803B],
- ["C26E",0x803C],
- ["B5A2",0x803D],
- ["C26F",0x803E],
- ["B9A2",0x803F],
- ["C270",0x8040],
- ["C271",0x8041],
- ["C4F4",0x8042],
- ["F1F5",0x8043],
- ["C272",0x8044],
- ["C273",0x8045],
- ["F1F6",0x8046],
- ["C274",0x8047],
- ["C275",0x8048],
- ["C276",0x8049],
- ["C1C4",0x804A],
- ["C1FB",0x804B],
- ["D6B0",0x804C],
- ["F1F7",0x804D],
- ["C277",0x804E],
- ["C278",0x804F],
- ["C279",0x8050],
- ["C27A",0x8051],
- ["F1F8",0x8052],
- ["C27B",0x8053],
- ["C1AA",0x8054],
- ["C27C",0x8055],
- ["C27D",0x8056],
- ["C27E",0x8057],
- ["C6B8",0x8058],
- ["C280",0x8059],
- ["BEDB",0x805A],
- ["C281",0x805B],
- ["C282",0x805C],
- ["C283",0x805D],
- ["C284",0x805E],
- ["C285",0x805F],
- ["C286",0x8060],
- ["C287",0x8061],
- ["C288",0x8062],
- ["C289",0x8063],
- ["C28A",0x8064],
- ["C28B",0x8065],
- ["C28C",0x8066],
- ["C28D",0x8067],
- ["C28E",0x8068],
- ["F1F9",0x8069],
- ["B4CF",0x806A],
- ["C28F",0x806B],
- ["C290",0x806C],
- ["C291",0x806D],
- ["C292",0x806E],
- ["C293",0x806F],
- ["C294",0x8070],
- ["F1FA",0x8071],
- ["C295",0x8072],
- ["C296",0x8073],
- ["C297",0x8074],
- ["C298",0x8075],
- ["C299",0x8076],
- ["C29A",0x8077],
- ["C29B",0x8078],
- ["C29C",0x8079],
- ["C29D",0x807A],
- ["C29E",0x807B],
- ["C29F",0x807C],
- ["C2A0",0x807D],
- ["C340",0x807E],
- ["EDB2",0x807F],
- ["EDB1",0x8080],
- ["C341",0x8081],
- ["C342",0x8082],
- ["CBE0",0x8083],
- ["D2DE",0x8084],
- ["C343",0x8085],
- ["CBC1",0x8086],
- ["D5D8",0x8087],
- ["C344",0x8088],
- ["C8E2",0x8089],
- ["C345",0x808A],
- ["C0DF",0x808B],
- ["BCA1",0x808C],
- ["C346",0x808D],
- ["C347",0x808E],
- ["C348",0x808F],
- ["C349",0x8090],
- ["C34A",0x8091],
- ["C34B",0x8092],
- ["EBC1",0x8093],
- ["C34C",0x8094],
- ["C34D",0x8095],
- ["D0A4",0x8096],
- ["C34E",0x8097],
- ["D6E2",0x8098],
- ["C34F",0x8099],
- ["B6C7",0x809A],
- ["B8D8",0x809B],
- ["EBC0",0x809C],
- ["B8CE",0x809D],
- ["C350",0x809E],
- ["EBBF",0x809F],
- ["B3A6",0x80A0],
- ["B9C9",0x80A1],
- ["D6AB",0x80A2],
- ["C351",0x80A3],
- ["B7F4",0x80A4],
- ["B7CA",0x80A5],
- ["C352",0x80A6],
- ["C353",0x80A7],
- ["C354",0x80A8],
- ["BCE7",0x80A9],
- ["B7BE",0x80AA],
- ["EBC6",0x80AB],
- ["C355",0x80AC],
- ["EBC7",0x80AD],
- ["B0B9",0x80AE],
- ["BFCF",0x80AF],
- ["C356",0x80B0],
- ["EBC5",0x80B1],
- ["D3FD",0x80B2],
- ["C357",0x80B3],
- ["EBC8",0x80B4],
- ["C358",0x80B5],
- ["C359",0x80B6],
- ["EBC9",0x80B7],
- ["C35A",0x80B8],
- ["C35B",0x80B9],
- ["B7CE",0x80BA],
- ["C35C",0x80BB],
- ["EBC2",0x80BC],
- ["EBC4",0x80BD],
- ["C9F6",0x80BE],
- ["D6D7",0x80BF],
- ["D5CD",0x80C0],
- ["D0B2",0x80C1],
- ["EBCF",0x80C2],
- ["CEB8",0x80C3],
- ["EBD0",0x80C4],
- ["C35D",0x80C5],
- ["B5A8",0x80C6],
- ["C35E",0x80C7],
- ["C35F",0x80C8],
- ["C360",0x80C9],
- ["C361",0x80CA],
- ["C362",0x80CB],
- ["B1B3",0x80CC],
- ["EBD2",0x80CD],
- ["CCA5",0x80CE],
- ["C363",0x80CF],
- ["C364",0x80D0],
- ["C365",0x80D1],
- ["C366",0x80D2],
- ["C367",0x80D3],
- ["C368",0x80D4],
- ["C369",0x80D5],
- ["C5D6",0x80D6],
- ["EBD3",0x80D7],
- ["C36A",0x80D8],
- ["EBD1",0x80D9],
- ["C5DF",0x80DA],
- ["EBCE",0x80DB],
- ["CAA4",0x80DC],
- ["EBD5",0x80DD],
- ["B0FB",0x80DE],
- ["C36B",0x80DF],
- ["C36C",0x80E0],
- ["BAFA",0x80E1],
- ["C36D",0x80E2],
- ["C36E",0x80E3],
- ["D8B7",0x80E4],
- ["F1E3",0x80E5],
- ["C36F",0x80E6],
- ["EBCA",0x80E7],
- ["EBCB",0x80E8],
- ["EBCC",0x80E9],
- ["EBCD",0x80EA],
- ["EBD6",0x80EB],
- ["E6C0",0x80EC],
- ["EBD9",0x80ED],
- ["C370",0x80EE],
- ["BFE8",0x80EF],
- ["D2C8",0x80F0],
- ["EBD7",0x80F1],
- ["EBDC",0x80F2],
- ["B8EC",0x80F3],
- ["EBD8",0x80F4],
- ["C371",0x80F5],
- ["BDBA",0x80F6],
- ["C372",0x80F7],
- ["D0D8",0x80F8],
- ["C373",0x80F9],
- ["B0B7",0x80FA],
- ["C374",0x80FB],
- ["EBDD",0x80FC],
- ["C4DC",0x80FD],
- ["C375",0x80FE],
- ["C376",0x80FF],
- ["C377",0x8100],
- ["C378",0x8101],
- ["D6AC",0x8102],
- ["C379",0x8103],
- ["C37A",0x8104],
- ["C37B",0x8105],
- ["B4E0",0x8106],
- ["C37C",0x8107],
- ["C37D",0x8108],
- ["C2F6",0x8109],
- ["BCB9",0x810A],
- ["C37E",0x810B],
- ["C380",0x810C],
- ["EBDA",0x810D],
- ["EBDB",0x810E],
- ["D4E0",0x810F],
- ["C6EA",0x8110],
- ["C4D4",0x8111],
- ["EBDF",0x8112],
- ["C5A7",0x8113],
- ["D9F5",0x8114],
- ["C381",0x8115],
- ["B2B1",0x8116],
- ["C382",0x8117],
- ["EBE4",0x8118],
- ["C383",0x8119],
- ["BDC5",0x811A],
- ["C384",0x811B],
- ["C385",0x811C],
- ["C386",0x811D],
- ["EBE2",0x811E],
- ["C387",0x811F],
- ["C388",0x8120],
- ["C389",0x8121],
- ["C38A",0x8122],
- ["C38B",0x8123],
- ["C38C",0x8124],
- ["C38D",0x8125],
- ["C38E",0x8126],
- ["C38F",0x8127],
- ["C390",0x8128],
- ["C391",0x8129],
- ["C392",0x812A],
- ["C393",0x812B],
- ["EBE3",0x812C],
- ["C394",0x812D],
- ["C395",0x812E],
- ["B8AC",0x812F],
- ["C396",0x8130],
- ["CDD1",0x8131],
- ["EBE5",0x8132],
- ["C397",0x8133],
- ["C398",0x8134],
- ["C399",0x8135],
- ["EBE1",0x8136],
- ["C39A",0x8137],
- ["C1B3",0x8138],
- ["C39B",0x8139],
- ["C39C",0x813A],
- ["C39D",0x813B],
- ["C39E",0x813C],
- ["C39F",0x813D],
- ["C6A2",0x813E],
- ["C3A0",0x813F],
- ["C440",0x8140],
- ["C441",0x8141],
- ["C442",0x8142],
- ["C443",0x8143],
- ["C444",0x8144],
- ["C445",0x8145],
- ["CCF3",0x8146],
- ["C446",0x8147],
- ["EBE6",0x8148],
- ["C447",0x8149],
- ["C0B0",0x814A],
- ["D2B8",0x814B],
- ["EBE7",0x814C],
- ["C448",0x814D],
- ["C449",0x814E],
- ["C44A",0x814F],
- ["B8AF",0x8150],
- ["B8AD",0x8151],
- ["C44B",0x8152],
- ["EBE8",0x8153],
- ["C7BB",0x8154],
- ["CDF3",0x8155],
- ["C44C",0x8156],
- ["C44D",0x8157],
- ["C44E",0x8158],
- ["EBEA",0x8159],
- ["EBEB",0x815A],
- ["C44F",0x815B],
- ["C450",0x815C],
- ["C451",0x815D],
- ["C452",0x815E],
- ["C453",0x815F],
- ["EBED",0x8160],
- ["C454",0x8161],
- ["C455",0x8162],
- ["C456",0x8163],
- ["C457",0x8164],
- ["D0C8",0x8165],
- ["C458",0x8166],
- ["EBF2",0x8167],
- ["C459",0x8168],
- ["EBEE",0x8169],
- ["C45A",0x816A],
- ["C45B",0x816B],
- ["C45C",0x816C],
- ["EBF1",0x816D],
- ["C8F9",0x816E],
- ["C45D",0x816F],
- ["D1FC",0x8170],
- ["EBEC",0x8171],
- ["C45E",0x8172],
- ["C45F",0x8173],
- ["EBE9",0x8174],
- ["C460",0x8175],
- ["C461",0x8176],
- ["C462",0x8177],
- ["C463",0x8178],
- ["B8B9",0x8179],
- ["CFD9",0x817A],
- ["C4E5",0x817B],
- ["EBEF",0x817C],
- ["EBF0",0x817D],
- ["CCDA",0x817E],
- ["CDC8",0x817F],
- ["B0F2",0x8180],
- ["C464",0x8181],
- ["EBF6",0x8182],
- ["C465",0x8183],
- ["C466",0x8184],
- ["C467",0x8185],
- ["C468",0x8186],
- ["C469",0x8187],
- ["EBF5",0x8188],
- ["C46A",0x8189],
- ["B2B2",0x818A],
- ["C46B",0x818B],
- ["C46C",0x818C],
- ["C46D",0x818D],
- ["C46E",0x818E],
- ["B8E0",0x818F],
- ["C46F",0x8190],
- ["EBF7",0x8191],
- ["C470",0x8192],
- ["C471",0x8193],
- ["C472",0x8194],
- ["C473",0x8195],
- ["C474",0x8196],
- ["C475",0x8197],
- ["B1EC",0x8198],
- ["C476",0x8199],
- ["C477",0x819A],
- ["CCC5",0x819B],
- ["C4A4",0x819C],
- ["CFA5",0x819D],
- ["C478",0x819E],
- ["C479",0x819F],
- ["C47A",0x81A0],
- ["C47B",0x81A1],
- ["C47C",0x81A2],
- ["EBF9",0x81A3],
- ["C47D",0x81A4],
- ["C47E",0x81A5],
- ["ECA2",0x81A6],
- ["C480",0x81A7],
- ["C5F2",0x81A8],
- ["C481",0x81A9],
- ["EBFA",0x81AA],
- ["C482",0x81AB],
- ["C483",0x81AC],
- ["C484",0x81AD],
- ["C485",0x81AE],
- ["C486",0x81AF],
- ["C487",0x81B0],
- ["C488",0x81B1],
- ["C489",0x81B2],
- ["C9C5",0x81B3],
- ["C48A",0x81B4],
- ["C48B",0x81B5],
- ["C48C",0x81B6],
- ["C48D",0x81B7],
- ["C48E",0x81B8],
- ["C48F",0x81B9],
- ["E2DF",0x81BA],
- ["EBFE",0x81BB],
- ["C490",0x81BC],
- ["C491",0x81BD],
- ["C492",0x81BE],
- ["C493",0x81BF],
- ["CDCE",0x81C0],
- ["ECA1",0x81C1],
- ["B1DB",0x81C2],
- ["D3B7",0x81C3],
- ["C494",0x81C4],
- ["C495",0x81C5],
- ["D2DC",0x81C6],
- ["C496",0x81C7],
- ["C497",0x81C8],
- ["C498",0x81C9],
- ["EBFD",0x81CA],
- ["C499",0x81CB],
- ["EBFB",0x81CC],
- ["C49A",0x81CD],
- ["C49B",0x81CE],
- ["C49C",0x81CF],
- ["C49D",0x81D0],
- ["C49E",0x81D1],
- ["C49F",0x81D2],
- ["C4A0",0x81D3],
- ["C540",0x81D4],
- ["C541",0x81D5],
- ["C542",0x81D6],
- ["C543",0x81D7],
- ["C544",0x81D8],
- ["C545",0x81D9],
- ["C546",0x81DA],
- ["C547",0x81DB],
- ["C548",0x81DC],
- ["C549",0x81DD],
- ["C54A",0x81DE],
- ["C54B",0x81DF],
- ["C54C",0x81E0],
- ["C54D",0x81E1],
- ["C54E",0x81E2],
- ["B3BC",0x81E3],
- ["C54F",0x81E4],
- ["C550",0x81E5],
- ["C551",0x81E6],
- ["EAB0",0x81E7],
- ["C552",0x81E8],
- ["C553",0x81E9],
- ["D7D4",0x81EA],
- ["C554",0x81EB],
- ["F4AB",0x81EC],
- ["B3F4",0x81ED],
- ["C555",0x81EE],
- ["C556",0x81EF],
- ["C557",0x81F0],
- ["C558",0x81F1],
- ["C559",0x81F2],
- ["D6C1",0x81F3],
- ["D6C2",0x81F4],
- ["C55A",0x81F5],
- ["C55B",0x81F6],
- ["C55C",0x81F7],
- ["C55D",0x81F8],
- ["C55E",0x81F9],
- ["C55F",0x81FA],
- ["D5E9",0x81FB],
- ["BECA",0x81FC],
- ["C560",0x81FD],
- ["F4A7",0x81FE],
- ["C561",0x81FF],
- ["D2A8",0x8200],
- ["F4A8",0x8201],
- ["F4A9",0x8202],
- ["C562",0x8203],
- ["F4AA",0x8204],
- ["BECB",0x8205],
- ["D3DF",0x8206],
- ["C563",0x8207],
- ["C564",0x8208],
- ["C565",0x8209],
- ["C566",0x820A],
- ["C567",0x820B],
- ["C9E0",0x820C],
- ["C9E1",0x820D],
- ["C568",0x820E],
- ["C569",0x820F],
- ["F3C2",0x8210],
- ["C56A",0x8211],
- ["CAE6",0x8212],
- ["C56B",0x8213],
- ["CCF2",0x8214],
- ["C56C",0x8215],
- ["C56D",0x8216],
- ["C56E",0x8217],
- ["C56F",0x8218],
- ["C570",0x8219],
- ["C571",0x821A],
- ["E2B6",0x821B],
- ["CBB4",0x821C],
- ["C572",0x821D],
- ["CEE8",0x821E],
- ["D6DB",0x821F],
- ["C573",0x8220],
- ["F4AD",0x8221],
- ["F4AE",0x8222],
- ["F4AF",0x8223],
- ["C574",0x8224],
- ["C575",0x8225],
- ["C576",0x8226],
- ["C577",0x8227],
- ["F4B2",0x8228],
- ["C578",0x8229],
- ["BABD",0x822A],
- ["F4B3",0x822B],
- ["B0E3",0x822C],
- ["F4B0",0x822D],
- ["C579",0x822E],
- ["F4B1",0x822F],
- ["BDA2",0x8230],
- ["B2D5",0x8231],
- ["C57A",0x8232],
- ["F4B6",0x8233],
- ["F4B7",0x8234],
- ["B6E6",0x8235],
- ["B2B0",0x8236],
- ["CFCF",0x8237],
- ["F4B4",0x8238],
- ["B4AC",0x8239],
- ["C57B",0x823A],
- ["F4B5",0x823B],
- ["C57C",0x823C],
- ["C57D",0x823D],
- ["F4B8",0x823E],
- ["C57E",0x823F],
- ["C580",0x8240],
- ["C581",0x8241],
- ["C582",0x8242],
- ["C583",0x8243],
- ["F4B9",0x8244],
- ["C584",0x8245],
- ["C585",0x8246],
- ["CDA7",0x8247],
- ["C586",0x8248],
- ["F4BA",0x8249],
- ["C587",0x824A],
- ["F4BB",0x824B],
- ["C588",0x824C],
- ["C589",0x824D],
- ["C58A",0x824E],
- ["F4BC",0x824F],
- ["C58B",0x8250],
- ["C58C",0x8251],
- ["C58D",0x8252],
- ["C58E",0x8253],
- ["C58F",0x8254],
- ["C590",0x8255],
- ["C591",0x8256],
- ["C592",0x8257],
- ["CBD2",0x8258],
- ["C593",0x8259],
- ["F4BD",0x825A],
- ["C594",0x825B],
- ["C595",0x825C],
- ["C596",0x825D],
- ["C597",0x825E],
- ["F4BE",0x825F],
- ["C598",0x8260],
- ["C599",0x8261],
- ["C59A",0x8262],
- ["C59B",0x8263],
- ["C59C",0x8264],
- ["C59D",0x8265],
- ["C59E",0x8266],
- ["C59F",0x8267],
- ["F4BF",0x8268],
- ["C5A0",0x8269],
- ["C640",0x826A],
- ["C641",0x826B],
- ["C642",0x826C],
- ["C643",0x826D],
- ["F4DE",0x826E],
- ["C1BC",0x826F],
- ["BCE8",0x8270],
- ["C644",0x8271],
- ["C9AB",0x8272],
- ["D1DE",0x8273],
- ["E5F5",0x8274],
- ["C645",0x8275],
- ["C646",0x8276],
- ["C647",0x8277],
- ["C648",0x8278],
- ["DCB3",0x8279],
- ["D2D5",0x827A],
- ["C649",0x827B],
- ["C64A",0x827C],
- ["DCB4",0x827D],
- ["B0AC",0x827E],
- ["DCB5",0x827F],
- ["C64B",0x8280],
- ["C64C",0x8281],
- ["BDDA",0x8282],
- ["C64D",0x8283],
- ["DCB9",0x8284],
- ["C64E",0x8285],
- ["C64F",0x8286],
- ["C650",0x8287],
- ["D8C2",0x8288],
- ["C651",0x8289],
- ["DCB7",0x828A],
- ["D3F3",0x828B],
- ["C652",0x828C],
- ["C9D6",0x828D],
- ["DCBA",0x828E],
- ["DCB6",0x828F],
- ["C653",0x8290],
- ["DCBB",0x8291],
- ["C3A2",0x8292],
- ["C654",0x8293],
- ["C655",0x8294],
- ["C656",0x8295],
- ["C657",0x8296],
- ["DCBC",0x8297],
- ["DCC5",0x8298],
- ["DCBD",0x8299],
- ["C658",0x829A],
- ["C659",0x829B],
- ["CEDF",0x829C],
- ["D6A5",0x829D],
- ["C65A",0x829E],
- ["DCCF",0x829F],
- ["C65B",0x82A0],
- ["DCCD",0x82A1],
- ["C65C",0x82A2],
- ["C65D",0x82A3],
- ["DCD2",0x82A4],
- ["BDE6",0x82A5],
- ["C2AB",0x82A6],
- ["C65E",0x82A7],
- ["DCB8",0x82A8],
- ["DCCB",0x82A9],
- ["DCCE",0x82AA],
- ["DCBE",0x82AB],
- ["B7D2",0x82AC],
- ["B0C5",0x82AD],
- ["DCC7",0x82AE],
- ["D0BE",0x82AF],
- ["DCC1",0x82B0],
- ["BBA8",0x82B1],
- ["C65F",0x82B2],
- ["B7BC",0x82B3],
- ["DCCC",0x82B4],
- ["C660",0x82B5],
- ["C661",0x82B6],
- ["DCC6",0x82B7],
- ["DCBF",0x82B8],
- ["C7DB",0x82B9],
- ["C662",0x82BA],
- ["C663",0x82BB],
- ["C664",0x82BC],
- ["D1BF",0x82BD],
- ["DCC0",0x82BE],
- ["C665",0x82BF],
- ["C666",0x82C0],
- ["DCCA",0x82C1],
- ["C667",0x82C2],
- ["C668",0x82C3],
- ["DCD0",0x82C4],
- ["C669",0x82C5],
- ["C66A",0x82C6],
- ["CEAD",0x82C7],
- ["DCC2",0x82C8],
- ["C66B",0x82C9],
- ["DCC3",0x82CA],
- ["DCC8",0x82CB],
- ["DCC9",0x82CC],
- ["B2D4",0x82CD],
- ["DCD1",0x82CE],
- ["CBD5",0x82CF],
- ["C66C",0x82D0],
- ["D4B7",0x82D1],
- ["DCDB",0x82D2],
- ["DCDF",0x82D3],
- ["CCA6",0x82D4],
- ["DCE6",0x82D5],
- ["C66D",0x82D6],
- ["C3E7",0x82D7],
- ["DCDC",0x82D8],
- ["C66E",0x82D9],
- ["C66F",0x82DA],
- ["BFC1",0x82DB],
- ["DCD9",0x82DC],
- ["C670",0x82DD],
- ["B0FA",0x82DE],
- ["B9B6",0x82DF],
- ["DCE5",0x82E0],
- ["DCD3",0x82E1],
- ["C671",0x82E2],
- ["DCC4",0x82E3],
- ["DCD6",0x82E4],
- ["C8F4",0x82E5],
- ["BFE0",0x82E6],
- ["C672",0x82E7],
- ["C673",0x82E8],
- ["C674",0x82E9],
- ["C675",0x82EA],
- ["C9BB",0x82EB],
- ["C676",0x82EC],
- ["C677",0x82ED],
- ["C678",0x82EE],
- ["B1BD",0x82EF],
- ["C679",0x82F0],
- ["D3A2",0x82F1],
- ["C67A",0x82F2],
- ["C67B",0x82F3],
- ["DCDA",0x82F4],
- ["C67C",0x82F5],
- ["C67D",0x82F6],
- ["DCD5",0x82F7],
- ["C67E",0x82F8],
- ["C6BB",0x82F9],
- ["C680",0x82FA],
- ["DCDE",0x82FB],
- ["C681",0x82FC],
- ["C682",0x82FD],
- ["C683",0x82FE],
- ["C684",0x82FF],
- ["C685",0x8300],
- ["D7C2",0x8301],
- ["C3AF",0x8302],
- ["B7B6",0x8303],
- ["C7D1",0x8304],
- ["C3A9",0x8305],
- ["DCE2",0x8306],
- ["DCD8",0x8307],
- ["DCEB",0x8308],
- ["DCD4",0x8309],
- ["C686",0x830A],
- ["C687",0x830B],
- ["DCDD",0x830C],
- ["C688",0x830D],
- ["BEA5",0x830E],
- ["DCD7",0x830F],
- ["C689",0x8310],
- ["DCE0",0x8311],
- ["C68A",0x8312],
- ["C68B",0x8313],
- ["DCE3",0x8314],
- ["DCE4",0x8315],
- ["C68C",0x8316],
- ["DCF8",0x8317],
- ["C68D",0x8318],
- ["C68E",0x8319],
- ["DCE1",0x831A],
- ["DDA2",0x831B],
- ["DCE7",0x831C],
- ["C68F",0x831D],
- ["C690",0x831E],
- ["C691",0x831F],
- ["C692",0x8320],
- ["C693",0x8321],
- ["C694",0x8322],
- ["C695",0x8323],
- ["C696",0x8324],
- ["C697",0x8325],
- ["C698",0x8326],
- ["BCEB",0x8327],
- ["B4C4",0x8328],
- ["C699",0x8329],
- ["C69A",0x832A],
- ["C3A3",0x832B],
- ["B2E7",0x832C],
- ["DCFA",0x832D],
- ["C69B",0x832E],
- ["DCF2",0x832F],
- ["C69C",0x8330],
- ["DCEF",0x8331],
- ["C69D",0x8332],
- ["DCFC",0x8333],
- ["DCEE",0x8334],
- ["D2F0",0x8335],
- ["B2E8",0x8336],
- ["C69E",0x8337],
- ["C8D7",0x8338],
- ["C8E3",0x8339],
- ["DCFB",0x833A],
- ["C69F",0x833B],
- ["DCED",0x833C],
- ["C6A0",0x833D],
- ["C740",0x833E],
- ["C741",0x833F],
- ["DCF7",0x8340],
- ["C742",0x8341],
- ["C743",0x8342],
- ["DCF5",0x8343],
- ["C744",0x8344],
- ["C745",0x8345],
- ["BEA3",0x8346],
- ["DCF4",0x8347],
- ["C746",0x8348],
- ["B2DD",0x8349],
- ["C747",0x834A],
- ["C748",0x834B],
- ["C749",0x834C],
- ["C74A",0x834D],
- ["C74B",0x834E],
- ["DCF3",0x834F],
- ["BCF6",0x8350],
- ["DCE8",0x8351],
- ["BBC4",0x8352],
- ["C74C",0x8353],
- ["C0F3",0x8354],
- ["C74D",0x8355],
- ["C74E",0x8356],
- ["C74F",0x8357],
- ["C750",0x8358],
- ["C751",0x8359],
- ["BCD4",0x835A],
- ["DCE9",0x835B],
- ["DCEA",0x835C],
- ["C752",0x835D],
- ["DCF1",0x835E],
- ["DCF6",0x835F],
- ["DCF9",0x8360],
- ["B5B4",0x8361],
- ["C753",0x8362],
- ["C8D9",0x8363],
- ["BBE7",0x8364],
- ["DCFE",0x8365],
- ["DCFD",0x8366],
- ["D3AB",0x8367],
- ["DDA1",0x8368],
- ["DDA3",0x8369],
- ["DDA5",0x836A],
- ["D2F1",0x836B],
- ["DDA4",0x836C],
- ["DDA6",0x836D],
- ["DDA7",0x836E],
- ["D2A9",0x836F],
- ["C754",0x8370],
- ["C755",0x8371],
- ["C756",0x8372],
- ["C757",0x8373],
- ["C758",0x8374],
- ["C759",0x8375],
- ["C75A",0x8376],
- ["BAC9",0x8377],
- ["DDA9",0x8378],
- ["C75B",0x8379],
- ["C75C",0x837A],
- ["DDB6",0x837B],
- ["DDB1",0x837C],
- ["DDB4",0x837D],
- ["C75D",0x837E],
- ["C75E",0x837F],
- ["C75F",0x8380],
- ["C760",0x8381],
- ["C761",0x8382],
- ["C762",0x8383],
- ["C763",0x8384],
- ["DDB0",0x8385],
- ["C6CE",0x8386],
- ["C764",0x8387],
- ["C765",0x8388],
- ["C0F2",0x8389],
- ["C766",0x838A],
- ["C767",0x838B],
- ["C768",0x838C],
- ["C769",0x838D],
- ["C9AF",0x838E],
- ["C76A",0x838F],
- ["C76B",0x8390],
- ["C76C",0x8391],
- ["DCEC",0x8392],
- ["DDAE",0x8393],
- ["C76D",0x8394],
- ["C76E",0x8395],
- ["C76F",0x8396],
- ["C770",0x8397],
- ["DDB7",0x8398],
- ["C771",0x8399],
- ["C772",0x839A],
- ["DCF0",0x839B],
- ["DDAF",0x839C],
- ["C773",0x839D],
- ["DDB8",0x839E],
- ["C774",0x839F],
- ["DDAC",0x83A0],
- ["C775",0x83A1],
- ["C776",0x83A2],
- ["C777",0x83A3],
- ["C778",0x83A4],
- ["C779",0x83A5],
- ["C77A",0x83A6],
- ["C77B",0x83A7],
- ["DDB9",0x83A8],
- ["DDB3",0x83A9],
- ["DDAD",0x83AA],
- ["C4AA",0x83AB],
- ["C77C",0x83AC],
- ["C77D",0x83AD],
- ["C77E",0x83AE],
- ["C780",0x83AF],
- ["DDA8",0x83B0],
- ["C0B3",0x83B1],
- ["C1AB",0x83B2],
- ["DDAA",0x83B3],
- ["DDAB",0x83B4],
- ["C781",0x83B5],
- ["DDB2",0x83B6],
- ["BBF1",0x83B7],
- ["DDB5",0x83B8],
- ["D3A8",0x83B9],
- ["DDBA",0x83BA],
- ["C782",0x83BB],
- ["DDBB",0x83BC],
- ["C3A7",0x83BD],
- ["C783",0x83BE],
- ["C784",0x83BF],
- ["DDD2",0x83C0],
- ["DDBC",0x83C1],
- ["C785",0x83C2],
- ["C786",0x83C3],
- ["C787",0x83C4],
- ["DDD1",0x83C5],
- ["C788",0x83C6],
- ["B9BD",0x83C7],
- ["C789",0x83C8],
- ["C78A",0x83C9],
- ["BED5",0x83CA],
- ["C78B",0x83CB],
- ["BEFA",0x83CC],
- ["C78C",0x83CD],
- ["C78D",0x83CE],
- ["BACA",0x83CF],
- ["C78E",0x83D0],
- ["C78F",0x83D1],
- ["C790",0x83D2],
- ["C791",0x83D3],
- ["DDCA",0x83D4],
- ["C792",0x83D5],
- ["DDC5",0x83D6],
- ["C793",0x83D7],
- ["DDBF",0x83D8],
- ["C794",0x83D9],
- ["C795",0x83DA],
- ["C796",0x83DB],
- ["B2CB",0x83DC],
- ["DDC3",0x83DD],
- ["C797",0x83DE],
- ["DDCB",0x83DF],
- ["B2A4",0x83E0],
- ["DDD5",0x83E1],
- ["C798",0x83E2],
- ["C799",0x83E3],
- ["C79A",0x83E4],
- ["DDBE",0x83E5],
- ["C79B",0x83E6],
- ["C79C",0x83E7],
- ["C79D",0x83E8],
- ["C6D0",0x83E9],
- ["DDD0",0x83EA],
- ["C79E",0x83EB],
- ["C79F",0x83EC],
- ["C7A0",0x83ED],
- ["C840",0x83EE],
- ["C841",0x83EF],
- ["DDD4",0x83F0],
- ["C1E2",0x83F1],
- ["B7C6",0x83F2],
- ["C842",0x83F3],
- ["C843",0x83F4],
- ["C844",0x83F5],
- ["C845",0x83F6],
- ["C846",0x83F7],
- ["DDCE",0x83F8],
- ["DDCF",0x83F9],
- ["C847",0x83FA],
- ["C848",0x83FB],
- ["C849",0x83FC],
- ["DDC4",0x83FD],
- ["C84A",0x83FE],
- ["C84B",0x83FF],
- ["C84C",0x8400],
- ["DDBD",0x8401],
- ["C84D",0x8402],
- ["DDCD",0x8403],
- ["CCD1",0x8404],
- ["C84E",0x8405],
- ["DDC9",0x8406],
- ["C84F",0x8407],
- ["C850",0x8408],
- ["C851",0x8409],
- ["C852",0x840A],
- ["DDC2",0x840B],
- ["C3C8",0x840C],
- ["C6BC",0x840D],
- ["CEAE",0x840E],
- ["DDCC",0x840F],
- ["C853",0x8410],
- ["DDC8",0x8411],
- ["C854",0x8412],
- ["C855",0x8413],
- ["C856",0x8414],
- ["C857",0x8415],
- ["C858",0x8416],
- ["C859",0x8417],
- ["DDC1",0x8418],
- ["C85A",0x8419],
- ["C85B",0x841A],
- ["C85C",0x841B],
- ["DDC6",0x841C],
- ["C2DC",0x841D],
- ["C85D",0x841E],
- ["C85E",0x841F],
- ["C85F",0x8420],
- ["C860",0x8421],
- ["C861",0x8422],
- ["C862",0x8423],
- ["D3A9",0x8424],
- ["D3AA",0x8425],
- ["DDD3",0x8426],
- ["CFF4",0x8427],
- ["C8F8",0x8428],
- ["C863",0x8429],
- ["C864",0x842A],
- ["C865",0x842B],
- ["C866",0x842C],
- ["C867",0x842D],
- ["C868",0x842E],
- ["C869",0x842F],
- ["C86A",0x8430],
- ["DDE6",0x8431],
- ["C86B",0x8432],
- ["C86C",0x8433],
- ["C86D",0x8434],
- ["C86E",0x8435],
- ["C86F",0x8436],
- ["C870",0x8437],
- ["DDC7",0x8438],
- ["C871",0x8439],
- ["C872",0x843A],
- ["C873",0x843B],
- ["DDE0",0x843C],
- ["C2E4",0x843D],
- ["C874",0x843E],
- ["C875",0x843F],
- ["C876",0x8440],
- ["C877",0x8441],
- ["C878",0x8442],
- ["C879",0x8443],
- ["C87A",0x8444],
- ["C87B",0x8445],
- ["DDE1",0x8446],
- ["C87C",0x8447],
- ["C87D",0x8448],
- ["C87E",0x8449],
- ["C880",0x844A],
- ["C881",0x844B],
- ["C882",0x844C],
- ["C883",0x844D],
- ["C884",0x844E],
- ["C885",0x844F],
- ["C886",0x8450],
- ["DDD7",0x8451],
- ["C887",0x8452],
- ["C888",0x8453],
- ["C889",0x8454],
- ["C88A",0x8455],
- ["C88B",0x8456],
- ["D6F8",0x8457],
- ["C88C",0x8458],
- ["DDD9",0x8459],
- ["DDD8",0x845A],
- ["B8F0",0x845B],
- ["DDD6",0x845C],
- ["C88D",0x845D],
- ["C88E",0x845E],
- ["C88F",0x845F],
- ["C890",0x8460],
- ["C6CF",0x8461],
- ["C891",0x8462],
- ["B6AD",0x8463],
- ["C892",0x8464],
- ["C893",0x8465],
- ["C894",0x8466],
- ["C895",0x8467],
- ["C896",0x8468],
- ["DDE2",0x8469],
- ["C897",0x846A],
- ["BAF9",0x846B],
- ["D4E1",0x846C],
- ["DDE7",0x846D],
- ["C898",0x846E],
- ["C899",0x846F],
- ["C89A",0x8470],
- ["B4D0",0x8471],
- ["C89B",0x8472],
- ["DDDA",0x8473],
- ["C89C",0x8474],
- ["BFFB",0x8475],
- ["DDE3",0x8476],
- ["C89D",0x8477],
- ["DDDF",0x8478],
- ["C89E",0x8479],
- ["DDDD",0x847A],
- ["C89F",0x847B],
- ["C8A0",0x847C],
- ["C940",0x847D],
- ["C941",0x847E],
- ["C942",0x847F],
- ["C943",0x8480],
- ["C944",0x8481],
- ["B5D9",0x8482],
- ["C945",0x8483],
- ["C946",0x8484],
- ["C947",0x8485],
- ["C948",0x8486],
- ["DDDB",0x8487],
- ["DDDC",0x8488],
- ["DDDE",0x8489],
- ["C949",0x848A],
- ["BDAF",0x848B],
- ["DDE4",0x848C],
- ["C94A",0x848D],
- ["DDE5",0x848E],
- ["C94B",0x848F],
- ["C94C",0x8490],
- ["C94D",0x8491],
- ["C94E",0x8492],
- ["C94F",0x8493],
- ["C950",0x8494],
- ["C951",0x8495],
- ["C952",0x8496],
- ["DDF5",0x8497],
- ["C953",0x8498],
- ["C3C9",0x8499],
- ["C954",0x849A],
- ["C955",0x849B],
- ["CBE2",0x849C],
- ["C956",0x849D],
- ["C957",0x849E],
- ["C958",0x849F],
- ["C959",0x84A0],
- ["DDF2",0x84A1],
- ["C95A",0x84A2],
- ["C95B",0x84A3],
- ["C95C",0x84A4],
- ["C95D",0x84A5],
- ["C95E",0x84A6],
- ["C95F",0x84A7],
- ["C960",0x84A8],
- ["C961",0x84A9],
- ["C962",0x84AA],
- ["C963",0x84AB],
- ["C964",0x84AC],
- ["C965",0x84AD],
- ["C966",0x84AE],
- ["D8E1",0x84AF],
- ["C967",0x84B0],
- ["C968",0x84B1],
- ["C6D1",0x84B2],
- ["C969",0x84B3],
- ["DDF4",0x84B4],
- ["C96A",0x84B5],
- ["C96B",0x84B6],
- ["C96C",0x84B7],
- ["D5F4",0x84B8],
- ["DDF3",0x84B9],
- ["DDF0",0x84BA],
- ["C96D",0x84BB],
- ["C96E",0x84BC],
- ["DDEC",0x84BD],
- ["C96F",0x84BE],
- ["DDEF",0x84BF],
- ["C970",0x84C0],
- ["DDE8",0x84C1],
- ["C971",0x84C2],
- ["C972",0x84C3],
- ["D0EE",0x84C4],
- ["C973",0x84C5],
- ["C974",0x84C6],
- ["C975",0x84C7],
- ["C976",0x84C8],
- ["C8D8",0x84C9],
- ["DDEE",0x84CA],
- ["C977",0x84CB],
- ["C978",0x84CC],
- ["DDE9",0x84CD],
- ["C979",0x84CE],
- ["C97A",0x84CF],
- ["DDEA",0x84D0],
- ["CBF2",0x84D1],
- ["C97B",0x84D2],
- ["DDED",0x84D3],
- ["C97C",0x84D4],
- ["C97D",0x84D5],
- ["B1CD",0x84D6],
- ["C97E",0x84D7],
- ["C980",0x84D8],
- ["C981",0x84D9],
- ["C982",0x84DA],
- ["C983",0x84DB],
- ["C984",0x84DC],
- ["C0B6",0x84DD],
- ["C985",0x84DE],
- ["BCBB",0x84DF],
- ["DDF1",0x84E0],
- ["C986",0x84E1],
- ["C987",0x84E2],
- ["DDF7",0x84E3],
- ["C988",0x84E4],
- ["DDF6",0x84E5],
- ["DDEB",0x84E6],
- ["C989",0x84E7],
- ["C98A",0x84E8],
- ["C98B",0x84E9],
- ["C98C",0x84EA],
- ["C98D",0x84EB],
- ["C5EE",0x84EC],
- ["C98E",0x84ED],
- ["C98F",0x84EE],
- ["C990",0x84EF],
- ["DDFB",0x84F0],
- ["C991",0x84F1],
- ["C992",0x84F2],
- ["C993",0x84F3],
- ["C994",0x84F4],
- ["C995",0x84F5],
- ["C996",0x84F6],
- ["C997",0x84F7],
- ["C998",0x84F8],
- ["C999",0x84F9],
- ["C99A",0x84FA],
- ["C99B",0x84FB],
- ["DEA4",0x84FC],
- ["C99C",0x84FD],
- ["C99D",0x84FE],
- ["DEA3",0x84FF],
- ["C99E",0x8500],
- ["C99F",0x8501],
- ["C9A0",0x8502],
- ["CA40",0x8503],
- ["CA41",0x8504],
- ["CA42",0x8505],
- ["CA43",0x8506],
- ["CA44",0x8507],
- ["CA45",0x8508],
- ["CA46",0x8509],
- ["CA47",0x850A],
- ["CA48",0x850B],
- ["DDF8",0x850C],
- ["CA49",0x850D],
- ["CA4A",0x850E],
- ["CA4B",0x850F],
- ["CA4C",0x8510],
- ["C3EF",0x8511],
- ["CA4D",0x8512],
- ["C2FB",0x8513],
- ["CA4E",0x8514],
- ["CA4F",0x8515],
- ["CA50",0x8516],
- ["D5E1",0x8517],
- ["CA51",0x8518],
- ["CA52",0x8519],
- ["CEB5",0x851A],
- ["CA53",0x851B],
- ["CA54",0x851C],
- ["CA55",0x851D],
- ["CA56",0x851E],
- ["DDFD",0x851F],
- ["CA57",0x8520],
- ["B2CC",0x8521],
- ["CA58",0x8522],
- ["CA59",0x8523],
- ["CA5A",0x8524],
- ["CA5B",0x8525],
- ["CA5C",0x8526],
- ["CA5D",0x8527],
- ["CA5E",0x8528],
- ["CA5F",0x8529],
- ["CA60",0x852A],
- ["C4E8",0x852B],
- ["CADF",0x852C],
- ["CA61",0x852D],
- ["CA62",0x852E],
- ["CA63",0x852F],
- ["CA64",0x8530],
- ["CA65",0x8531],
- ["CA66",0x8532],
- ["CA67",0x8533],
- ["CA68",0x8534],
- ["CA69",0x8535],
- ["CA6A",0x8536],
- ["C7BE",0x8537],
- ["DDFA",0x8538],
- ["DDFC",0x8539],
- ["DDFE",0x853A],
- ["DEA2",0x853B],
- ["B0AA",0x853C],
- ["B1CE",0x853D],
- ["CA6B",0x853E],
- ["CA6C",0x853F],
- ["CA6D",0x8540],
- ["CA6E",0x8541],
- ["CA6F",0x8542],
- ["DEAC",0x8543],
- ["CA70",0x8544],
- ["CA71",0x8545],
- ["CA72",0x8546],
- ["CA73",0x8547],
- ["DEA6",0x8548],
- ["BDB6",0x8549],
- ["C8EF",0x854A],
- ["CA74",0x854B],
- ["CA75",0x854C],
- ["CA76",0x854D],
- ["CA77",0x854E],
- ["CA78",0x854F],
- ["CA79",0x8550],
- ["CA7A",0x8551],
- ["CA7B",0x8552],
- ["CA7C",0x8553],
- ["CA7D",0x8554],
- ["CA7E",0x8555],
- ["DEA1",0x8556],
- ["CA80",0x8557],
- ["CA81",0x8558],
- ["DEA5",0x8559],
- ["CA82",0x855A],
- ["CA83",0x855B],
- ["CA84",0x855C],
- ["CA85",0x855D],
- ["DEA9",0x855E],
- ["CA86",0x855F],
- ["CA87",0x8560],
- ["CA88",0x8561],
- ["CA89",0x8562],
- ["CA8A",0x8563],
- ["DEA8",0x8564],
- ["CA8B",0x8565],
- ["CA8C",0x8566],
- ["CA8D",0x8567],
- ["DEA7",0x8568],
- ["CA8E",0x8569],
- ["CA8F",0x856A],
- ["CA90",0x856B],
- ["CA91",0x856C],
- ["CA92",0x856D],
- ["CA93",0x856E],
- ["CA94",0x856F],
- ["CA95",0x8570],
- ["CA96",0x8571],
- ["DEAD",0x8572],
- ["CA97",0x8573],
- ["D4CC",0x8574],
- ["CA98",0x8575],
- ["CA99",0x8576],
- ["CA9A",0x8577],
- ["CA9B",0x8578],
- ["DEB3",0x8579],
- ["DEAA",0x857A],
- ["DEAE",0x857B],
- ["CA9C",0x857C],
- ["CA9D",0x857D],
- ["C0D9",0x857E],
- ["CA9E",0x857F],
- ["CA9F",0x8580],
- ["CAA0",0x8581],
- ["CB40",0x8582],
- ["CB41",0x8583],
- ["B1A1",0x8584],
- ["DEB6",0x8585],
- ["CB42",0x8586],
- ["DEB1",0x8587],
- ["CB43",0x8588],
- ["CB44",0x8589],
- ["CB45",0x858A],
- ["CB46",0x858B],
- ["CB47",0x858C],
- ["CB48",0x858D],
- ["CB49",0x858E],
- ["DEB2",0x858F],
- ["CB4A",0x8590],
- ["CB4B",0x8591],
- ["CB4C",0x8592],
- ["CB4D",0x8593],
- ["CB4E",0x8594],
- ["CB4F",0x8595],
- ["CB50",0x8596],
- ["CB51",0x8597],
- ["CB52",0x8598],
- ["CB53",0x8599],
- ["CB54",0x859A],
- ["D1A6",0x859B],
- ["DEB5",0x859C],
- ["CB55",0x859D],
- ["CB56",0x859E],
- ["CB57",0x859F],
- ["CB58",0x85A0],
- ["CB59",0x85A1],
- ["CB5A",0x85A2],
- ["CB5B",0x85A3],
- ["DEAF",0x85A4],
- ["CB5C",0x85A5],
- ["CB5D",0x85A6],
- ["CB5E",0x85A7],
- ["DEB0",0x85A8],
- ["CB5F",0x85A9],
- ["D0BD",0x85AA],
- ["CB60",0x85AB],
- ["CB61",0x85AC],
- ["CB62",0x85AD],
- ["DEB4",0x85AE],
- ["CAED",0x85AF],
- ["DEB9",0x85B0],
- ["CB63",0x85B1],
- ["CB64",0x85B2],
- ["CB65",0x85B3],
- ["CB66",0x85B4],
- ["CB67",0x85B5],
- ["CB68",0x85B6],
- ["DEB8",0x85B7],
- ["CB69",0x85B8],
- ["DEB7",0x85B9],
- ["CB6A",0x85BA],
- ["CB6B",0x85BB],
- ["CB6C",0x85BC],
- ["CB6D",0x85BD],
- ["CB6E",0x85BE],
- ["CB6F",0x85BF],
- ["CB70",0x85C0],
- ["DEBB",0x85C1],
- ["CB71",0x85C2],
- ["CB72",0x85C3],
- ["CB73",0x85C4],
- ["CB74",0x85C5],
- ["CB75",0x85C6],
- ["CB76",0x85C7],
- ["CB77",0x85C8],
- ["BDE5",0x85C9],
- ["CB78",0x85CA],
- ["CB79",0x85CB],
- ["CB7A",0x85CC],
- ["CB7B",0x85CD],
- ["CB7C",0x85CE],
- ["B2D8",0x85CF],
- ["C3EA",0x85D0],
- ["CB7D",0x85D1],
- ["CB7E",0x85D2],
- ["DEBA",0x85D3],
- ["CB80",0x85D4],
- ["C5BA",0x85D5],
- ["CB81",0x85D6],
- ["CB82",0x85D7],
- ["CB83",0x85D8],
- ["CB84",0x85D9],
- ["CB85",0x85DA],
- ["CB86",0x85DB],
- ["DEBC",0x85DC],
- ["CB87",0x85DD],
- ["CB88",0x85DE],
- ["CB89",0x85DF],
- ["CB8A",0x85E0],
- ["CB8B",0x85E1],
- ["CB8C",0x85E2],
- ["CB8D",0x85E3],
- ["CCD9",0x85E4],
- ["CB8E",0x85E5],
- ["CB8F",0x85E6],
- ["CB90",0x85E7],
- ["CB91",0x85E8],
- ["B7AA",0x85E9],
- ["CB92",0x85EA],
- ["CB93",0x85EB],
- ["CB94",0x85EC],
- ["CB95",0x85ED],
- ["CB96",0x85EE],
- ["CB97",0x85EF],
- ["CB98",0x85F0],
- ["CB99",0x85F1],
- ["CB9A",0x85F2],
- ["CB9B",0x85F3],
- ["CB9C",0x85F4],
- ["CB9D",0x85F5],
- ["CB9E",0x85F6],
- ["CB9F",0x85F7],
- ["CBA0",0x85F8],
- ["CC40",0x85F9],
- ["CC41",0x85FA],
- ["D4E5",0x85FB],
- ["CC42",0x85FC],
- ["CC43",0x85FD],
- ["CC44",0x85FE],
- ["DEBD",0x85FF],
- ["CC45",0x8600],
- ["CC46",0x8601],
- ["CC47",0x8602],
- ["CC48",0x8603],
- ["CC49",0x8604],
- ["DEBF",0x8605],
- ["CC4A",0x8606],
- ["CC4B",0x8607],
- ["CC4C",0x8608],
- ["CC4D",0x8609],
- ["CC4E",0x860A],
- ["CC4F",0x860B],
- ["CC50",0x860C],
- ["CC51",0x860D],
- ["CC52",0x860E],
- ["CC53",0x860F],
- ["CC54",0x8610],
- ["C4A2",0x8611],
- ["CC55",0x8612],
- ["CC56",0x8613],
- ["CC57",0x8614],
- ["CC58",0x8615],
- ["DEC1",0x8616],
- ["CC59",0x8617],
- ["CC5A",0x8618],
- ["CC5B",0x8619],
- ["CC5C",0x861A],
- ["CC5D",0x861B],
- ["CC5E",0x861C],
- ["CC5F",0x861D],
- ["CC60",0x861E],
- ["CC61",0x861F],
- ["CC62",0x8620],
- ["CC63",0x8621],
- ["CC64",0x8622],
- ["CC65",0x8623],
- ["CC66",0x8624],
- ["CC67",0x8625],
- ["CC68",0x8626],
- ["DEBE",0x8627],
- ["CC69",0x8628],
- ["DEC0",0x8629],
- ["CC6A",0x862A],
- ["CC6B",0x862B],
- ["CC6C",0x862C],
- ["CC6D",0x862D],
- ["CC6E",0x862E],
- ["CC6F",0x862F],
- ["CC70",0x8630],
- ["CC71",0x8631],
- ["CC72",0x8632],
- ["CC73",0x8633],
- ["CC74",0x8634],
- ["CC75",0x8635],
- ["CC76",0x8636],
- ["CC77",0x8637],
- ["D5BA",0x8638],
- ["CC78",0x8639],
- ["CC79",0x863A],
- ["CC7A",0x863B],
- ["DEC2",0x863C],
- ["CC7B",0x863D],
- ["CC7C",0x863E],
- ["CC7D",0x863F],
- ["CC7E",0x8640],
- ["CC80",0x8641],
- ["CC81",0x8642],
- ["CC82",0x8643],
- ["CC83",0x8644],
- ["CC84",0x8645],
- ["CC85",0x8646],
- ["CC86",0x8647],
- ["CC87",0x8648],
- ["CC88",0x8649],
- ["CC89",0x864A],
- ["CC8A",0x864B],
- ["CC8B",0x864C],
- ["F2AE",0x864D],
- ["BBA2",0x864E],
- ["C2B2",0x864F],
- ["C5B0",0x8650],
- ["C2C7",0x8651],
- ["CC8C",0x8652],
- ["CC8D",0x8653],
- ["F2AF",0x8654],
- ["CC8E",0x8655],
- ["CC8F",0x8656],
- ["CC90",0x8657],
- ["CC91",0x8658],
- ["CC92",0x8659],
- ["D0E9",0x865A],
- ["CC93",0x865B],
- ["CC94",0x865C],
- ["CC95",0x865D],
- ["D3DD",0x865E],
- ["CC96",0x865F],
- ["CC97",0x8660],
- ["CC98",0x8661],
- ["EBBD",0x8662],
- ["CC99",0x8663],
- ["CC9A",0x8664],
- ["CC9B",0x8665],
- ["CC9C",0x8666],
- ["CC9D",0x8667],
- ["CC9E",0x8668],
- ["CC9F",0x8669],
- ["CCA0",0x866A],
- ["B3E6",0x866B],
- ["F2B0",0x866C],
- ["CD40",0x866D],
- ["F2B1",0x866E],
- ["CD41",0x866F],
- ["CD42",0x8670],
- ["CAAD",0x8671],
- ["CD43",0x8672],
- ["CD44",0x8673],
- ["CD45",0x8674],
- ["CD46",0x8675],
- ["CD47",0x8676],
- ["CD48",0x8677],
- ["CD49",0x8678],
- ["BAE7",0x8679],
- ["F2B3",0x867A],
- ["F2B5",0x867B],
- ["F2B4",0x867C],
- ["CBE4",0x867D],
- ["CFBA",0x867E],
- ["F2B2",0x867F],
- ["CAB4",0x8680],
- ["D2CF",0x8681],
- ["C2EC",0x8682],
- ["CD4A",0x8683],
- ["CD4B",0x8684],
- ["CD4C",0x8685],
- ["CD4D",0x8686],
- ["CD4E",0x8687],
- ["CD4F",0x8688],
- ["CD50",0x8689],
- ["CEC3",0x868A],
- ["F2B8",0x868B],
- ["B0F6",0x868C],
- ["F2B7",0x868D],
- ["CD51",0x868E],
- ["CD52",0x868F],
- ["CD53",0x8690],
- ["CD54",0x8691],
- ["CD55",0x8692],
- ["F2BE",0x8693],
- ["CD56",0x8694],
- ["B2CF",0x8695],
- ["CD57",0x8696],
- ["CD58",0x8697],
- ["CD59",0x8698],
- ["CD5A",0x8699],
- ["CD5B",0x869A],
- ["CD5C",0x869B],
- ["D1C1",0x869C],
- ["F2BA",0x869D],
- ["CD5D",0x869E],
- ["CD5E",0x869F],
- ["CD5F",0x86A0],
- ["CD60",0x86A1],
- ["CD61",0x86A2],
- ["F2BC",0x86A3],
- ["D4E9",0x86A4],
- ["CD62",0x86A5],
- ["CD63",0x86A6],
- ["F2BB",0x86A7],
- ["F2B6",0x86A8],
- ["F2BF",0x86A9],
- ["F2BD",0x86AA],
- ["CD64",0x86AB],
- ["F2B9",0x86AC],
- ["CD65",0x86AD],
- ["CD66",0x86AE],
- ["F2C7",0x86AF],
- ["F2C4",0x86B0],
- ["F2C6",0x86B1],
- ["CD67",0x86B2],
- ["CD68",0x86B3],
- ["F2CA",0x86B4],
- ["F2C2",0x86B5],
- ["F2C0",0x86B6],
- ["CD69",0x86B7],
- ["CD6A",0x86B8],
- ["CD6B",0x86B9],
- ["F2C5",0x86BA],
- ["CD6C",0x86BB],
- ["CD6D",0x86BC],
- ["CD6E",0x86BD],
- ["CD6F",0x86BE],
- ["CD70",0x86BF],
- ["D6FB",0x86C0],
- ["CD71",0x86C1],
- ["CD72",0x86C2],
- ["CD73",0x86C3],
- ["F2C1",0x86C4],
- ["CD74",0x86C5],
- ["C7F9",0x86C6],
- ["C9DF",0x86C7],
- ["CD75",0x86C8],
- ["F2C8",0x86C9],
- ["B9C6",0x86CA],
- ["B5B0",0x86CB],
- ["CD76",0x86CC],
- ["CD77",0x86CD],
- ["F2C3",0x86CE],
- ["F2C9",0x86CF],
- ["F2D0",0x86D0],
- ["F2D6",0x86D1],
- ["CD78",0x86D2],
- ["CD79",0x86D3],
- ["BBD7",0x86D4],
- ["CD7A",0x86D5],
- ["CD7B",0x86D6],
- ["CD7C",0x86D7],
- ["F2D5",0x86D8],
- ["CDDC",0x86D9],
- ["CD7D",0x86DA],
- ["D6EB",0x86DB],
- ["CD7E",0x86DC],
- ["CD80",0x86DD],
- ["F2D2",0x86DE],
- ["F2D4",0x86DF],
- ["CD81",0x86E0],
- ["CD82",0x86E1],
- ["CD83",0x86E2],
- ["CD84",0x86E3],
- ["B8F2",0x86E4],
- ["CD85",0x86E5],
- ["CD86",0x86E6],
- ["CD87",0x86E7],
- ["CD88",0x86E8],
- ["F2CB",0x86E9],
- ["CD89",0x86EA],
- ["CD8A",0x86EB],
- ["CD8B",0x86EC],
- ["F2CE",0x86ED],
- ["C2F9",0x86EE],
- ["CD8C",0x86EF],
- ["D5DD",0x86F0],
- ["F2CC",0x86F1],
- ["F2CD",0x86F2],
- ["F2CF",0x86F3],
- ["F2D3",0x86F4],
- ["CD8D",0x86F5],
- ["CD8E",0x86F6],
- ["CD8F",0x86F7],
- ["F2D9",0x86F8],
- ["D3BC",0x86F9],
- ["CD90",0x86FA],
- ["CD91",0x86FB],
- ["CD92",0x86FC],
- ["CD93",0x86FD],
- ["B6EA",0x86FE],
- ["CD94",0x86FF],
- ["CAF1",0x8700],
- ["CD95",0x8701],
- ["B7E4",0x8702],
- ["F2D7",0x8703],
- ["CD96",0x8704],
- ["CD97",0x8705],
- ["CD98",0x8706],
- ["F2D8",0x8707],
- ["F2DA",0x8708],
- ["F2DD",0x8709],
- ["F2DB",0x870A],
- ["CD99",0x870B],
- ["CD9A",0x870C],
- ["F2DC",0x870D],
- ["CD9B",0x870E],
- ["CD9C",0x870F],
- ["CD9D",0x8710],
- ["CD9E",0x8711],
- ["D1D1",0x8712],
- ["F2D1",0x8713],
- ["CD9F",0x8714],
- ["CDC9",0x8715],
- ["CDA0",0x8716],
- ["CECF",0x8717],
- ["D6A9",0x8718],
- ["CE40",0x8719],
- ["F2E3",0x871A],
- ["CE41",0x871B],
- ["C3DB",0x871C],
- ["CE42",0x871D],
- ["F2E0",0x871E],
- ["CE43",0x871F],
- ["CE44",0x8720],
- ["C0AF",0x8721],
- ["F2EC",0x8722],
- ["F2DE",0x8723],
- ["CE45",0x8724],
- ["F2E1",0x8725],
- ["CE46",0x8726],
- ["CE47",0x8727],
- ["CE48",0x8728],
- ["F2E8",0x8729],
- ["CE49",0x872A],
- ["CE4A",0x872B],
- ["CE4B",0x872C],
- ["CE4C",0x872D],
- ["F2E2",0x872E],
- ["CE4D",0x872F],
- ["CE4E",0x8730],
- ["F2E7",0x8731],
- ["CE4F",0x8732],
- ["CE50",0x8733],
- ["F2E6",0x8734],
- ["CE51",0x8735],
- ["CE52",0x8736],
- ["F2E9",0x8737],
- ["CE53",0x8738],
- ["CE54",0x8739],
- ["CE55",0x873A],
- ["F2DF",0x873B],
- ["CE56",0x873C],
- ["CE57",0x873D],
- ["F2E4",0x873E],
- ["F2EA",0x873F],
- ["CE58",0x8740],
- ["CE59",0x8741],
- ["CE5A",0x8742],
- ["CE5B",0x8743],
- ["CE5C",0x8744],
- ["CE5D",0x8745],
- ["CE5E",0x8746],
- ["D3AC",0x8747],
- ["F2E5",0x8748],
- ["B2F5",0x8749],
- ["CE5F",0x874A],
- ["CE60",0x874B],
- ["F2F2",0x874C],
- ["CE61",0x874D],
- ["D0AB",0x874E],
- ["CE62",0x874F],
- ["CE63",0x8750],
- ["CE64",0x8751],
- ["CE65",0x8752],
- ["F2F5",0x8753],
- ["CE66",0x8754],
- ["CE67",0x8755],
- ["CE68",0x8756],
- ["BBC8",0x8757],
- ["CE69",0x8758],
- ["F2F9",0x8759],
- ["CE6A",0x875A],
- ["CE6B",0x875B],
- ["CE6C",0x875C],
- ["CE6D",0x875D],
- ["CE6E",0x875E],
- ["CE6F",0x875F],
- ["F2F0",0x8760],
- ["CE70",0x8761],
- ["CE71",0x8762],
- ["F2F6",0x8763],
- ["F2F8",0x8764],
- ["F2FA",0x8765],
- ["CE72",0x8766],
- ["CE73",0x8767],
- ["CE74",0x8768],
- ["CE75",0x8769],
- ["CE76",0x876A],
- ["CE77",0x876B],
- ["CE78",0x876C],
- ["CE79",0x876D],
- ["F2F3",0x876E],
- ["CE7A",0x876F],
- ["F2F1",0x8770],
- ["CE7B",0x8771],
- ["CE7C",0x8772],
- ["CE7D",0x8773],
- ["BAFB",0x8774],
- ["CE7E",0x8775],
- ["B5FB",0x8776],
- ["CE80",0x8777],
- ["CE81",0x8778],
- ["CE82",0x8779],
- ["CE83",0x877A],
- ["F2EF",0x877B],
- ["F2F7",0x877C],
- ["F2ED",0x877D],
- ["F2EE",0x877E],
- ["CE84",0x877F],
- ["CE85",0x8780],
- ["CE86",0x8781],
- ["F2EB",0x8782],
- ["F3A6",0x8783],
- ["CE87",0x8784],
- ["F3A3",0x8785],
- ["CE88",0x8786],
- ["CE89",0x8787],
- ["F3A2",0x8788],
- ["CE8A",0x8789],
- ["CE8B",0x878A],
- ["F2F4",0x878B],
- ["CE8C",0x878C],
- ["C8DA",0x878D],
- ["CE8D",0x878E],
- ["CE8E",0x878F],
- ["CE8F",0x8790],
- ["CE90",0x8791],
- ["CE91",0x8792],
- ["F2FB",0x8793],
- ["CE92",0x8794],
- ["CE93",0x8795],
- ["CE94",0x8796],
- ["F3A5",0x8797],
- ["CE95",0x8798],
- ["CE96",0x8799],
- ["CE97",0x879A],
- ["CE98",0x879B],
- ["CE99",0x879C],
- ["CE9A",0x879D],
- ["CE9B",0x879E],
- ["C3F8",0x879F],
- ["CE9C",0x87A0],
- ["CE9D",0x87A1],
- ["CE9E",0x87A2],
- ["CE9F",0x87A3],
- ["CEA0",0x87A4],
- ["CF40",0x87A5],
- ["CF41",0x87A6],
- ["CF42",0x87A7],
- ["F2FD",0x87A8],
- ["CF43",0x87A9],
- ["CF44",0x87AA],
- ["F3A7",0x87AB],
- ["F3A9",0x87AC],
- ["F3A4",0x87AD],
- ["CF45",0x87AE],
- ["F2FC",0x87AF],
- ["CF46",0x87B0],
- ["CF47",0x87B1],
- ["CF48",0x87B2],
- ["F3AB",0x87B3],
- ["CF49",0x87B4],
- ["F3AA",0x87B5],
- ["CF4A",0x87B6],
- ["CF4B",0x87B7],
- ["CF4C",0x87B8],
- ["CF4D",0x87B9],
- ["C2DD",0x87BA],
- ["CF4E",0x87BB],
- ["CF4F",0x87BC],
- ["F3AE",0x87BD],
- ["CF50",0x87BE],
- ["CF51",0x87BF],
- ["F3B0",0x87C0],
- ["CF52",0x87C1],
- ["CF53",0x87C2],
- ["CF54",0x87C3],
- ["CF55",0x87C4],
- ["CF56",0x87C5],
- ["F3A1",0x87C6],
- ["CF57",0x87C7],
- ["CF58",0x87C8],
- ["CF59",0x87C9],
- ["F3B1",0x87CA],
- ["F3AC",0x87CB],
- ["CF5A",0x87CC],
- ["CF5B",0x87CD],
- ["CF5C",0x87CE],
- ["CF5D",0x87CF],
- ["CF5E",0x87D0],
- ["F3AF",0x87D1],
- ["F2FE",0x87D2],
- ["F3AD",0x87D3],
- ["CF5F",0x87D4],
- ["CF60",0x87D5],
- ["CF61",0x87D6],
- ["CF62",0x87D7],
- ["CF63",0x87D8],
- ["CF64",0x87D9],
- ["CF65",0x87DA],
- ["F3B2",0x87DB],
- ["CF66",0x87DC],
- ["CF67",0x87DD],
- ["CF68",0x87DE],
- ["CF69",0x87DF],
- ["F3B4",0x87E0],
- ["CF6A",0x87E1],
- ["CF6B",0x87E2],
- ["CF6C",0x87E3],
- ["CF6D",0x87E4],
- ["F3A8",0x87E5],
- ["CF6E",0x87E6],
- ["CF6F",0x87E7],
- ["CF70",0x87E8],
- ["CF71",0x87E9],
- ["F3B3",0x87EA],
- ["CF72",0x87EB],
- ["CF73",0x87EC],
- ["CF74",0x87ED],
- ["F3B5",0x87EE],
- ["CF75",0x87EF],
- ["CF76",0x87F0],
- ["CF77",0x87F1],
- ["CF78",0x87F2],
- ["CF79",0x87F3],
- ["CF7A",0x87F4],
- ["CF7B",0x87F5],
- ["CF7C",0x87F6],
- ["CF7D",0x87F7],
- ["CF7E",0x87F8],
- ["D0B7",0x87F9],
- ["CF80",0x87FA],
- ["CF81",0x87FB],
- ["CF82",0x87FC],
- ["CF83",0x87FD],
- ["F3B8",0x87FE],
- ["CF84",0x87FF],
- ["CF85",0x8800],
- ["CF86",0x8801],
- ["CF87",0x8802],
- ["D9F9",0x8803],
- ["CF88",0x8804],
- ["CF89",0x8805],
- ["CF8A",0x8806],
- ["CF8B",0x8807],
- ["CF8C",0x8808],
- ["CF8D",0x8809],
- ["F3B9",0x880A],
- ["CF8E",0x880B],
- ["CF8F",0x880C],
- ["CF90",0x880D],
- ["CF91",0x880E],
- ["CF92",0x880F],
- ["CF93",0x8810],
- ["CF94",0x8811],
- ["CF95",0x8812],
- ["F3B7",0x8813],
- ["CF96",0x8814],
- ["C8E4",0x8815],
- ["F3B6",0x8816],
- ["CF97",0x8817],
- ["CF98",0x8818],
- ["CF99",0x8819],
- ["CF9A",0x881A],
- ["F3BA",0x881B],
- ["CF9B",0x881C],
- ["CF9C",0x881D],
- ["CF9D",0x881E],
- ["CF9E",0x881F],
- ["CF9F",0x8820],
- ["F3BB",0x8821],
- ["B4C0",0x8822],
- ["CFA0",0x8823],
- ["D040",0x8824],
- ["D041",0x8825],
- ["D042",0x8826],
- ["D043",0x8827],
- ["D044",0x8828],
- ["D045",0x8829],
- ["D046",0x882A],
- ["D047",0x882B],
- ["D048",0x882C],
- ["D049",0x882D],
- ["D04A",0x882E],
- ["D04B",0x882F],
- ["D04C",0x8830],
- ["D04D",0x8831],
- ["EEC3",0x8832],
- ["D04E",0x8833],
- ["D04F",0x8834],
- ["D050",0x8835],
- ["D051",0x8836],
- ["D052",0x8837],
- ["D053",0x8838],
- ["F3BC",0x8839],
- ["D054",0x883A],
- ["D055",0x883B],
- ["F3BD",0x883C],
- ["D056",0x883D],
- ["D057",0x883E],
- ["D058",0x883F],
- ["D1AA",0x8840],
- ["D059",0x8841],
- ["D05A",0x8842],
- ["D05B",0x8843],
- ["F4AC",0x8844],
- ["D0C6",0x8845],
- ["D05C",0x8846],
- ["D05D",0x8847],
- ["D05E",0x8848],
- ["D05F",0x8849],
- ["D060",0x884A],
- ["D061",0x884B],
- ["D0D0",0x884C],
- ["D1DC",0x884D],
- ["D062",0x884E],
- ["D063",0x884F],
- ["D064",0x8850],
- ["D065",0x8851],
- ["D066",0x8852],
- ["D067",0x8853],
- ["CFCE",0x8854],
- ["D068",0x8855],
- ["D069",0x8856],
- ["BDD6",0x8857],
- ["D06A",0x8858],
- ["D1C3",0x8859],
- ["D06B",0x885A],
- ["D06C",0x885B],
- ["D06D",0x885C],
- ["D06E",0x885D],
- ["D06F",0x885E],
- ["D070",0x885F],
- ["D071",0x8860],
- ["BAE2",0x8861],
- ["E1E9",0x8862],
- ["D2C2",0x8863],
- ["F1C2",0x8864],
- ["B2B9",0x8865],
- ["D072",0x8866],
- ["D073",0x8867],
- ["B1ED",0x8868],
- ["F1C3",0x8869],
- ["D074",0x886A],
- ["C9C0",0x886B],
- ["B3C4",0x886C],
- ["D075",0x886D],
- ["D9F2",0x886E],
- ["D076",0x886F],
- ["CBA5",0x8870],
- ["D077",0x8871],
- ["F1C4",0x8872],
- ["D078",0x8873],
- ["D079",0x8874],
- ["D07A",0x8875],
- ["D07B",0x8876],
- ["D6D4",0x8877],
- ["D07C",0x8878],
- ["D07D",0x8879],
- ["D07E",0x887A],
- ["D080",0x887B],
- ["D081",0x887C],
- ["F1C5",0x887D],
- ["F4C0",0x887E],
- ["F1C6",0x887F],
- ["D082",0x8880],
- ["D4AC",0x8881],
- ["F1C7",0x8882],
- ["D083",0x8883],
- ["B0C0",0x8884],
- ["F4C1",0x8885],
- ["D084",0x8886],
- ["D085",0x8887],
- ["F4C2",0x8888],
- ["D086",0x8889],
- ["D087",0x888A],
- ["B4FC",0x888B],
- ["D088",0x888C],
- ["C5DB",0x888D],
- ["D089",0x888E],
- ["D08A",0x888F],
- ["D08B",0x8890],
- ["D08C",0x8891],
- ["CCBB",0x8892],
- ["D08D",0x8893],
- ["D08E",0x8894],
- ["D08F",0x8895],
- ["D0E4",0x8896],
- ["D090",0x8897],
- ["D091",0x8898],
- ["D092",0x8899],
- ["D093",0x889A],
- ["D094",0x889B],
- ["CDE0",0x889C],
- ["D095",0x889D],
- ["D096",0x889E],
- ["D097",0x889F],
- ["D098",0x88A0],
- ["D099",0x88A1],
- ["F1C8",0x88A2],
- ["D09A",0x88A3],
- ["D9F3",0x88A4],
- ["D09B",0x88A5],
- ["D09C",0x88A6],
- ["D09D",0x88A7],
- ["D09E",0x88A8],
- ["D09F",0x88A9],
- ["D0A0",0x88AA],
- ["B1BB",0x88AB],
- ["D140",0x88AC],
- ["CFAE",0x88AD],
- ["D141",0x88AE],
- ["D142",0x88AF],
- ["D143",0x88B0],
- ["B8A4",0x88B1],
- ["D144",0x88B2],
- ["D145",0x88B3],
- ["D146",0x88B4],
- ["D147",0x88B5],
- ["D148",0x88B6],
- ["F1CA",0x88B7],
- ["D149",0x88B8],
- ["D14A",0x88B9],
- ["D14B",0x88BA],
- ["D14C",0x88BB],
- ["F1CB",0x88BC],
- ["D14D",0x88BD],
- ["D14E",0x88BE],
- ["D14F",0x88BF],
- ["D150",0x88C0],
- ["B2C3",0x88C1],
- ["C1D1",0x88C2],
- ["D151",0x88C3],
- ["D152",0x88C4],
- ["D7B0",0x88C5],
- ["F1C9",0x88C6],
- ["D153",0x88C7],
- ["D154",0x88C8],
- ["F1CC",0x88C9],
- ["D155",0x88CA],
- ["D156",0x88CB],
- ["D157",0x88CC],
- ["D158",0x88CD],
- ["F1CE",0x88CE],
- ["D159",0x88CF],
- ["D15A",0x88D0],
- ["D15B",0x88D1],
- ["D9F6",0x88D2],
- ["D15C",0x88D3],
- ["D2E1",0x88D4],
- ["D4A3",0x88D5],
- ["D15D",0x88D6],
- ["D15E",0x88D7],
- ["F4C3",0x88D8],
- ["C8B9",0x88D9],
- ["D15F",0x88DA],
- ["D160",0x88DB],
- ["D161",0x88DC],
- ["D162",0x88DD],
- ["D163",0x88DE],
- ["F4C4",0x88DF],
- ["D164",0x88E0],
- ["D165",0x88E1],
- ["F1CD",0x88E2],
- ["F1CF",0x88E3],
- ["BFE3",0x88E4],
- ["F1D0",0x88E5],
- ["D166",0x88E6],
- ["D167",0x88E7],
- ["F1D4",0x88E8],
- ["D168",0x88E9],
- ["D169",0x88EA],
- ["D16A",0x88EB],
- ["D16B",0x88EC],
- ["D16C",0x88ED],
- ["D16D",0x88EE],
- ["D16E",0x88EF],
- ["F1D6",0x88F0],
- ["F1D1",0x88F1],
- ["D16F",0x88F2],
- ["C9D1",0x88F3],
- ["C5E1",0x88F4],
- ["D170",0x88F5],
- ["D171",0x88F6],
- ["D172",0x88F7],
- ["C2E3",0x88F8],
- ["B9FC",0x88F9],
- ["D173",0x88FA],
- ["D174",0x88FB],
- ["F1D3",0x88FC],
- ["D175",0x88FD],
- ["F1D5",0x88FE],
- ["D176",0x88FF],
- ["D177",0x8900],
- ["D178",0x8901],
- ["B9D3",0x8902],
- ["D179",0x8903],
- ["D17A",0x8904],
- ["D17B",0x8905],
- ["D17C",0x8906],
- ["D17D",0x8907],
- ["D17E",0x8908],
- ["D180",0x8909],
- ["F1DB",0x890A],
- ["D181",0x890B],
- ["D182",0x890C],
- ["D183",0x890D],
- ["D184",0x890E],
- ["D185",0x890F],
- ["BAD6",0x8910],
- ["D186",0x8911],
- ["B0FD",0x8912],
- ["F1D9",0x8913],
- ["D187",0x8914],
- ["D188",0x8915],
- ["D189",0x8916],
- ["D18A",0x8917],
- ["D18B",0x8918],
- ["F1D8",0x8919],
- ["F1D2",0x891A],
- ["F1DA",0x891B],
- ["D18C",0x891C],
- ["D18D",0x891D],
- ["D18E",0x891E],
- ["D18F",0x891F],
- ["D190",0x8920],
- ["F1D7",0x8921],
- ["D191",0x8922],
- ["D192",0x8923],
- ["D193",0x8924],
- ["C8EC",0x8925],
- ["D194",0x8926],
- ["D195",0x8927],
- ["D196",0x8928],
- ["D197",0x8929],
- ["CDCA",0x892A],
- ["F1DD",0x892B],
- ["D198",0x892C],
- ["D199",0x892D],
- ["D19A",0x892E],
- ["D19B",0x892F],
- ["E5BD",0x8930],
- ["D19C",0x8931],
- ["D19D",0x8932],
- ["D19E",0x8933],
- ["F1DC",0x8934],
- ["D19F",0x8935],
- ["F1DE",0x8936],
- ["D1A0",0x8937],
- ["D240",0x8938],
- ["D241",0x8939],
- ["D242",0x893A],
- ["D243",0x893B],
- ["D244",0x893C],
- ["D245",0x893D],
- ["D246",0x893E],
- ["D247",0x893F],
- ["D248",0x8940],
- ["F1DF",0x8941],
- ["D249",0x8942],
- ["D24A",0x8943],
- ["CFE5",0x8944],
- ["D24B",0x8945],
- ["D24C",0x8946],
- ["D24D",0x8947],
- ["D24E",0x8948],
- ["D24F",0x8949],
- ["D250",0x894A],
- ["D251",0x894B],
- ["D252",0x894C],
- ["D253",0x894D],
- ["D254",0x894E],
- ["D255",0x894F],
- ["D256",0x8950],
- ["D257",0x8951],
- ["D258",0x8952],
- ["D259",0x8953],
- ["D25A",0x8954],
- ["D25B",0x8955],
- ["D25C",0x8956],
- ["D25D",0x8957],
- ["D25E",0x8958],
- ["D25F",0x8959],
- ["D260",0x895A],
- ["D261",0x895B],
- ["D262",0x895C],
- ["D263",0x895D],
- ["F4C5",0x895E],
- ["BDF3",0x895F],
- ["D264",0x8960],
- ["D265",0x8961],
- ["D266",0x8962],
- ["D267",0x8963],
- ["D268",0x8964],
- ["D269",0x8965],
- ["F1E0",0x8966],
- ["D26A",0x8967],
- ["D26B",0x8968],
- ["D26C",0x8969],
- ["D26D",0x896A],
- ["D26E",0x896B],
- ["D26F",0x896C],
- ["D270",0x896D],
- ["D271",0x896E],
- ["D272",0x896F],
- ["D273",0x8970],
- ["D274",0x8971],
- ["D275",0x8972],
- ["D276",0x8973],
- ["D277",0x8974],
- ["D278",0x8975],
- ["D279",0x8976],
- ["D27A",0x8977],
- ["D27B",0x8978],
- ["D27C",0x8979],
- ["D27D",0x897A],
- ["F1E1",0x897B],
- ["D27E",0x897C],
- ["D280",0x897D],
- ["D281",0x897E],
- ["CEF7",0x897F],
- ["D282",0x8980],
- ["D2AA",0x8981],
- ["D283",0x8982],
- ["F1FB",0x8983],
- ["D284",0x8984],
- ["D285",0x8985],
- ["B8B2",0x8986],
- ["D286",0x8987],
- ["D287",0x8988],
- ["D288",0x8989],
- ["D289",0x898A],
- ["D28A",0x898B],
- ["D28B",0x898C],
- ["D28C",0x898D],
- ["D28D",0x898E],
- ["D28E",0x898F],
- ["D28F",0x8990],
- ["D290",0x8991],
- ["D291",0x8992],
- ["D292",0x8993],
- ["D293",0x8994],
- ["D294",0x8995],
- ["D295",0x8996],
- ["D296",0x8997],
- ["D297",0x8998],
- ["D298",0x8999],
- ["D299",0x899A],
- ["D29A",0x899B],
- ["D29B",0x899C],
- ["D29C",0x899D],
- ["D29D",0x899E],
- ["D29E",0x899F],
- ["D29F",0x89A0],
- ["D2A0",0x89A1],
- ["D340",0x89A2],
- ["D341",0x89A3],
- ["D342",0x89A4],
- ["D343",0x89A5],
- ["D344",0x89A6],
- ["D345",0x89A7],
- ["D346",0x89A8],
- ["D347",0x89A9],
- ["D348",0x89AA],
- ["D349",0x89AB],
- ["D34A",0x89AC],
- ["D34B",0x89AD],
- ["D34C",0x89AE],
- ["D34D",0x89AF],
- ["D34E",0x89B0],
- ["D34F",0x89B1],
- ["D350",0x89B2],
- ["D351",0x89B3],
- ["D352",0x89B4],
- ["D353",0x89B5],
- ["D354",0x89B6],
- ["D355",0x89B7],
- ["D356",0x89B8],
- ["D357",0x89B9],
- ["D358",0x89BA],
- ["D359",0x89BB],
- ["D35A",0x89BC],
- ["D35B",0x89BD],
- ["D35C",0x89BE],
- ["D35D",0x89BF],
- ["D35E",0x89C0],
- ["BCFB",0x89C1],
- ["B9DB",0x89C2],
- ["D35F",0x89C3],
- ["B9E6",0x89C4],
- ["C3D9",0x89C5],
- ["CAD3",0x89C6],
- ["EAE8",0x89C7],
- ["C0C0",0x89C8],
- ["BEF5",0x89C9],
- ["EAE9",0x89CA],
- ["EAEA",0x89CB],
- ["EAEB",0x89CC],
- ["D360",0x89CD],
- ["EAEC",0x89CE],
- ["EAED",0x89CF],
- ["EAEE",0x89D0],
- ["EAEF",0x89D1],
- ["BDC7",0x89D2],
- ["D361",0x89D3],
- ["D362",0x89D4],
- ["D363",0x89D5],
- ["F5FB",0x89D6],
- ["D364",0x89D7],
- ["D365",0x89D8],
- ["D366",0x89D9],
- ["F5FD",0x89DA],
- ["D367",0x89DB],
- ["F5FE",0x89DC],
- ["D368",0x89DD],
- ["F5FC",0x89DE],
- ["D369",0x89DF],
- ["D36A",0x89E0],
- ["D36B",0x89E1],
- ["D36C",0x89E2],
- ["BDE2",0x89E3],
- ["D36D",0x89E4],
- ["F6A1",0x89E5],
- ["B4A5",0x89E6],
- ["D36E",0x89E7],
- ["D36F",0x89E8],
- ["D370",0x89E9],
- ["D371",0x89EA],
- ["F6A2",0x89EB],
- ["D372",0x89EC],
- ["D373",0x89ED],
- ["D374",0x89EE],
- ["F6A3",0x89EF],
- ["D375",0x89F0],
- ["D376",0x89F1],
- ["D377",0x89F2],
- ["ECB2",0x89F3],
- ["D378",0x89F4],
- ["D379",0x89F5],
- ["D37A",0x89F6],
- ["D37B",0x89F7],
- ["D37C",0x89F8],
- ["D37D",0x89F9],
- ["D37E",0x89FA],
- ["D380",0x89FB],
- ["D381",0x89FC],
- ["D382",0x89FD],
- ["D383",0x89FE],
- ["D384",0x89FF],
- ["D1D4",0x8A00],
- ["D385",0x8A01],
- ["D386",0x8A02],
- ["D387",0x8A03],
- ["D388",0x8A04],
- ["D389",0x8A05],
- ["D38A",0x8A06],
- ["D9EA",0x8A07],
- ["D38B",0x8A08],
- ["D38C",0x8A09],
- ["D38D",0x8A0A],
- ["D38E",0x8A0B],
- ["D38F",0x8A0C],
- ["D390",0x8A0D],
- ["D391",0x8A0E],
- ["D392",0x8A0F],
- ["D393",0x8A10],
- ["D394",0x8A11],
- ["D395",0x8A12],
- ["D396",0x8A13],
- ["D397",0x8A14],
- ["D398",0x8A15],
- ["D399",0x8A16],
- ["D39A",0x8A17],
- ["D39B",0x8A18],
- ["D39C",0x8A19],
- ["D39D",0x8A1A],
- ["D39E",0x8A1B],
- ["D39F",0x8A1C],
- ["D3A0",0x8A1D],
- ["D440",0x8A1E],
- ["D441",0x8A1F],
- ["D442",0x8A20],
- ["D443",0x8A21],
- ["D444",0x8A22],
- ["D445",0x8A23],
- ["D446",0x8A24],
- ["D447",0x8A25],
- ["D448",0x8A26],
- ["D449",0x8A27],
- ["D44A",0x8A28],
- ["D44B",0x8A29],
- ["D44C",0x8A2A],
- ["D44D",0x8A2B],
- ["D44E",0x8A2C],
- ["D44F",0x8A2D],
- ["D450",0x8A2E],
- ["D451",0x8A2F],
- ["D452",0x8A30],
- ["D453",0x8A31],
- ["D454",0x8A32],
- ["D455",0x8A33],
- ["D456",0x8A34],
- ["D457",0x8A35],
- ["D458",0x8A36],
- ["D459",0x8A37],
- ["D45A",0x8A38],
- ["D45B",0x8A39],
- ["D45C",0x8A3A],
- ["D45D",0x8A3B],
- ["D45E",0x8A3C],
- ["D45F",0x8A3D],
- ["F6A4",0x8A3E],
- ["D460",0x8A3F],
- ["D461",0x8A40],
- ["D462",0x8A41],
- ["D463",0x8A42],
- ["D464",0x8A43],
- ["D465",0x8A44],
- ["D466",0x8A45],
- ["D467",0x8A46],
- ["D468",0x8A47],
- ["EEBA",0x8A48],
- ["D469",0x8A49],
- ["D46A",0x8A4A],
- ["D46B",0x8A4B],
- ["D46C",0x8A4C],
- ["D46D",0x8A4D],
- ["D46E",0x8A4E],
- ["D46F",0x8A4F],
- ["D470",0x8A50],
- ["D471",0x8A51],
- ["D472",0x8A52],
- ["D473",0x8A53],
- ["D474",0x8A54],
- ["D475",0x8A55],
- ["D476",0x8A56],
- ["D477",0x8A57],
- ["D478",0x8A58],
- ["D479",0x8A59],
- ["D47A",0x8A5A],
- ["D47B",0x8A5B],
- ["D47C",0x8A5C],
- ["D47D",0x8A5D],
- ["D47E",0x8A5E],
- ["D480",0x8A5F],
- ["D481",0x8A60],
- ["D482",0x8A61],
- ["D483",0x8A62],
- ["D484",0x8A63],
- ["D485",0x8A64],
- ["D486",0x8A65],
- ["D487",0x8A66],
- ["D488",0x8A67],
- ["D489",0x8A68],
- ["D48A",0x8A69],
- ["D48B",0x8A6A],
- ["D48C",0x8A6B],
- ["D48D",0x8A6C],
- ["D48E",0x8A6D],
- ["D48F",0x8A6E],
- ["D490",0x8A6F],
- ["D491",0x8A70],
- ["D492",0x8A71],
- ["D493",0x8A72],
- ["D494",0x8A73],
- ["D495",0x8A74],
- ["D496",0x8A75],
- ["D497",0x8A76],
- ["D498",0x8A77],
- ["D499",0x8A78],
- ["D5B2",0x8A79],
- ["D49A",0x8A7A],
- ["D49B",0x8A7B],
- ["D49C",0x8A7C],
- ["D49D",0x8A7D],
- ["D49E",0x8A7E],
- ["D49F",0x8A7F],
- ["D4A0",0x8A80],
- ["D540",0x8A81],
- ["D541",0x8A82],
- ["D542",0x8A83],
- ["D543",0x8A84],
- ["D544",0x8A85],
- ["D545",0x8A86],
- ["D546",0x8A87],
- ["D547",0x8A88],
- ["D3FE",0x8A89],
- ["CCDC",0x8A8A],
- ["D548",0x8A8B],
- ["D549",0x8A8C],
- ["D54A",0x8A8D],
- ["D54B",0x8A8E],
- ["D54C",0x8A8F],
- ["D54D",0x8A90],
- ["D54E",0x8A91],
- ["D54F",0x8A92],
- ["CAC4",0x8A93],
- ["D550",0x8A94],
- ["D551",0x8A95],
- ["D552",0x8A96],
- ["D553",0x8A97],
- ["D554",0x8A98],
- ["D555",0x8A99],
- ["D556",0x8A9A],
- ["D557",0x8A9B],
- ["D558",0x8A9C],
- ["D559",0x8A9D],
- ["D55A",0x8A9E],
- ["D55B",0x8A9F],
- ["D55C",0x8AA0],
- ["D55D",0x8AA1],
- ["D55E",0x8AA2],
- ["D55F",0x8AA3],
- ["D560",0x8AA4],
- ["D561",0x8AA5],
- ["D562",0x8AA6],
- ["D563",0x8AA7],
- ["D564",0x8AA8],
- ["D565",0x8AA9],
- ["D566",0x8AAA],
- ["D567",0x8AAB],
- ["D568",0x8AAC],
- ["D569",0x8AAD],
- ["D56A",0x8AAE],
- ["D56B",0x8AAF],
- ["D56C",0x8AB0],
- ["D56D",0x8AB1],
- ["D56E",0x8AB2],
- ["D56F",0x8AB3],
- ["D570",0x8AB4],
- ["D571",0x8AB5],
- ["D572",0x8AB6],
- ["D573",0x8AB7],
- ["D574",0x8AB8],
- ["D575",0x8AB9],
- ["D576",0x8ABA],
- ["D577",0x8ABB],
- ["D578",0x8ABC],
- ["D579",0x8ABD],
- ["D57A",0x8ABE],
- ["D57B",0x8ABF],
- ["D57C",0x8AC0],
- ["D57D",0x8AC1],
- ["D57E",0x8AC2],
- ["D580",0x8AC3],
- ["D581",0x8AC4],
- ["D582",0x8AC5],
- ["D583",0x8AC6],
- ["D584",0x8AC7],
- ["D585",0x8AC8],
- ["D586",0x8AC9],
- ["D587",0x8ACA],
- ["D588",0x8ACB],
- ["D589",0x8ACC],
- ["D58A",0x8ACD],
- ["D58B",0x8ACE],
- ["D58C",0x8ACF],
- ["D58D",0x8AD0],
- ["D58E",0x8AD1],
- ["D58F",0x8AD2],
- ["D590",0x8AD3],
- ["D591",0x8AD4],
- ["D592",0x8AD5],
- ["D593",0x8AD6],
- ["D594",0x8AD7],
- ["D595",0x8AD8],
- ["D596",0x8AD9],
- ["D597",0x8ADA],
- ["D598",0x8ADB],
- ["D599",0x8ADC],
- ["D59A",0x8ADD],
- ["D59B",0x8ADE],
- ["D59C",0x8ADF],
- ["D59D",0x8AE0],
- ["D59E",0x8AE1],
- ["D59F",0x8AE2],
- ["D5A0",0x8AE3],
- ["D640",0x8AE4],
- ["D641",0x8AE5],
- ["D642",0x8AE6],
- ["D643",0x8AE7],
- ["D644",0x8AE8],
- ["D645",0x8AE9],
- ["D646",0x8AEA],
- ["D647",0x8AEB],
- ["D648",0x8AEC],
- ["D649",0x8AED],
- ["D64A",0x8AEE],
- ["D64B",0x8AEF],
- ["D64C",0x8AF0],
- ["D64D",0x8AF1],
- ["D64E",0x8AF2],
- ["D64F",0x8AF3],
- ["D650",0x8AF4],
- ["D651",0x8AF5],
- ["D652",0x8AF6],
- ["D653",0x8AF7],
- ["D654",0x8AF8],
- ["D655",0x8AF9],
- ["D656",0x8AFA],
- ["D657",0x8AFB],
- ["D658",0x8AFC],
- ["D659",0x8AFD],
- ["D65A",0x8AFE],
- ["D65B",0x8AFF],
- ["D65C",0x8B00],
- ["D65D",0x8B01],
- ["D65E",0x8B02],
- ["D65F",0x8B03],
- ["D660",0x8B04],
- ["D661",0x8B05],
- ["D662",0x8B06],
- ["E5C0",0x8B07],
- ["D663",0x8B08],
- ["D664",0x8B09],
- ["D665",0x8B0A],
- ["D666",0x8B0B],
- ["D667",0x8B0C],
- ["D668",0x8B0D],
- ["D669",0x8B0E],
- ["D66A",0x8B0F],
- ["D66B",0x8B10],
- ["D66C",0x8B11],
- ["D66D",0x8B12],
- ["D66E",0x8B13],
- ["D66F",0x8B14],
- ["D670",0x8B15],
- ["D671",0x8B16],
- ["D672",0x8B17],
- ["D673",0x8B18],
- ["D674",0x8B19],
- ["D675",0x8B1A],
- ["D676",0x8B1B],
- ["D677",0x8B1C],
- ["D678",0x8B1D],
- ["D679",0x8B1E],
- ["D67A",0x8B1F],
- ["D67B",0x8B20],
- ["D67C",0x8B21],
- ["D67D",0x8B22],
- ["D67E",0x8B23],
- ["D680",0x8B24],
- ["D681",0x8B25],
- ["F6A5",0x8B26],
- ["D682",0x8B27],
- ["D683",0x8B28],
- ["D684",0x8B29],
- ["D685",0x8B2A],
- ["D686",0x8B2B],
- ["D687",0x8B2C],
- ["D688",0x8B2D],
- ["D689",0x8B2E],
- ["D68A",0x8B2F],
- ["D68B",0x8B30],
- ["D68C",0x8B31],
- ["D68D",0x8B32],
- ["D68E",0x8B33],
- ["D68F",0x8B34],
- ["D690",0x8B35],
- ["D691",0x8B36],
- ["D692",0x8B37],
- ["D693",0x8B38],
- ["D694",0x8B39],
- ["D695",0x8B3A],
- ["D696",0x8B3B],
- ["D697",0x8B3C],
- ["D698",0x8B3D],
- ["D699",0x8B3E],
- ["D69A",0x8B3F],
- ["D69B",0x8B40],
- ["D69C",0x8B41],
- ["D69D",0x8B42],
- ["D69E",0x8B43],
- ["D69F",0x8B44],
- ["D6A0",0x8B45],
- ["D740",0x8B46],
- ["D741",0x8B47],
- ["D742",0x8B48],
- ["D743",0x8B49],
- ["D744",0x8B4A],
- ["D745",0x8B4B],
- ["D746",0x8B4C],
- ["D747",0x8B4D],
- ["D748",0x8B4E],
- ["D749",0x8B4F],
- ["D74A",0x8B50],
- ["D74B",0x8B51],
- ["D74C",0x8B52],
- ["D74D",0x8B53],
- ["D74E",0x8B54],
- ["D74F",0x8B55],
- ["D750",0x8B56],
- ["D751",0x8B57],
- ["D752",0x8B58],
- ["D753",0x8B59],
- ["D754",0x8B5A],
- ["D755",0x8B5B],
- ["D756",0x8B5C],
- ["D757",0x8B5D],
- ["D758",0x8B5E],
- ["D759",0x8B5F],
- ["D75A",0x8B60],
- ["D75B",0x8B61],
- ["D75C",0x8B62],
- ["D75D",0x8B63],
- ["D75E",0x8B64],
- ["D75F",0x8B65],
- ["BEAF",0x8B66],
- ["D760",0x8B67],
- ["D761",0x8B68],
- ["D762",0x8B69],
- ["D763",0x8B6A],
- ["D764",0x8B6B],
- ["C6A9",0x8B6C],
- ["D765",0x8B6D],
- ["D766",0x8B6E],
- ["D767",0x8B6F],
- ["D768",0x8B70],
- ["D769",0x8B71],
- ["D76A",0x8B72],
- ["D76B",0x8B73],
- ["D76C",0x8B74],
- ["D76D",0x8B75],
- ["D76E",0x8B76],
- ["D76F",0x8B77],
- ["D770",0x8B78],
- ["D771",0x8B79],
- ["D772",0x8B7A],
- ["D773",0x8B7B],
- ["D774",0x8B7C],
- ["D775",0x8B7D],
- ["D776",0x8B7E],
- ["D777",0x8B7F],
- ["D778",0x8B80],
- ["D779",0x8B81],
- ["D77A",0x8B82],
- ["D77B",0x8B83],
- ["D77C",0x8B84],
- ["D77D",0x8B85],
- ["D77E",0x8B86],
- ["D780",0x8B87],
- ["D781",0x8B88],
- ["D782",0x8B89],
- ["D783",0x8B8A],
- ["D784",0x8B8B],
- ["D785",0x8B8C],
- ["D786",0x8B8D],
- ["D787",0x8B8E],
- ["D788",0x8B8F],
- ["D789",0x8B90],
- ["D78A",0x8B91],
- ["D78B",0x8B92],
- ["D78C",0x8B93],
- ["D78D",0x8B94],
- ["D78E",0x8B95],
- ["D78F",0x8B96],
- ["D790",0x8B97],
- ["D791",0x8B98],
- ["D792",0x8B99],
- ["D793",0x8B9A],
- ["D794",0x8B9B],
- ["D795",0x8B9C],
- ["D796",0x8B9D],
- ["D797",0x8B9E],
- ["D798",0x8B9F],
- ["DAA5",0x8BA0],
- ["BCC6",0x8BA1],
- ["B6A9",0x8BA2],
- ["B8BC",0x8BA3],
- ["C8CF",0x8BA4],
- ["BCA5",0x8BA5],
- ["DAA6",0x8BA6],
- ["DAA7",0x8BA7],
- ["CCD6",0x8BA8],
- ["C8C3",0x8BA9],
- ["DAA8",0x8BAA],
- ["C6FD",0x8BAB],
- ["D799",0x8BAC],
- ["D1B5",0x8BAD],
- ["D2E9",0x8BAE],
- ["D1B6",0x8BAF],
- ["BCC7",0x8BB0],
- ["D79A",0x8BB1],
- ["BDB2",0x8BB2],
- ["BBE4",0x8BB3],
- ["DAA9",0x8BB4],
- ["DAAA",0x8BB5],
- ["D1C8",0x8BB6],
- ["DAAB",0x8BB7],
- ["D0ED",0x8BB8],
- ["B6EF",0x8BB9],
- ["C2DB",0x8BBA],
- ["D79B",0x8BBB],
- ["CBCF",0x8BBC],
- ["B7ED",0x8BBD],
- ["C9E8",0x8BBE],
- ["B7C3",0x8BBF],
- ["BEF7",0x8BC0],
- ["D6A4",0x8BC1],
- ["DAAC",0x8BC2],
- ["DAAD",0x8BC3],
- ["C6C0",0x8BC4],
- ["D7E7",0x8BC5],
- ["CAB6",0x8BC6],
- ["D79C",0x8BC7],
- ["D5A9",0x8BC8],
- ["CBDF",0x8BC9],
- ["D5EF",0x8BCA],
- ["DAAE",0x8BCB],
- ["D6DF",0x8BCC],
- ["B4CA",0x8BCD],
- ["DAB0",0x8BCE],
- ["DAAF",0x8BCF],
- ["D79D",0x8BD0],
- ["D2EB",0x8BD1],
- ["DAB1",0x8BD2],
- ["DAB2",0x8BD3],
- ["DAB3",0x8BD4],
- ["CAD4",0x8BD5],
- ["DAB4",0x8BD6],
- ["CAAB",0x8BD7],
- ["DAB5",0x8BD8],
- ["DAB6",0x8BD9],
- ["B3CF",0x8BDA],
- ["D6EF",0x8BDB],
- ["DAB7",0x8BDC],
- ["BBB0",0x8BDD],
- ["B5AE",0x8BDE],
- ["DAB8",0x8BDF],
- ["DAB9",0x8BE0],
- ["B9EE",0x8BE1],
- ["D1AF",0x8BE2],
- ["D2E8",0x8BE3],
- ["DABA",0x8BE4],
- ["B8C3",0x8BE5],
- ["CFEA",0x8BE6],
- ["B2EF",0x8BE7],
- ["DABB",0x8BE8],
- ["DABC",0x8BE9],
- ["D79E",0x8BEA],
- ["BDEB",0x8BEB],
- ["CEDC",0x8BEC],
- ["D3EF",0x8BED],
- ["DABD",0x8BEE],
- ["CEF3",0x8BEF],
- ["DABE",0x8BF0],
- ["D3D5",0x8BF1],
- ["BBE5",0x8BF2],
- ["DABF",0x8BF3],
- ["CBB5",0x8BF4],
- ["CBD0",0x8BF5],
- ["DAC0",0x8BF6],
- ["C7EB",0x8BF7],
- ["D6EE",0x8BF8],
- ["DAC1",0x8BF9],
- ["C5B5",0x8BFA],
- ["B6C1",0x8BFB],
- ["DAC2",0x8BFC],
- ["B7CC",0x8BFD],
- ["BFCE",0x8BFE],
- ["DAC3",0x8BFF],
- ["DAC4",0x8C00],
- ["CBAD",0x8C01],
- ["DAC5",0x8C02],
- ["B5F7",0x8C03],
- ["DAC6",0x8C04],
- ["C1C2",0x8C05],
- ["D7BB",0x8C06],
- ["DAC7",0x8C07],
- ["CCB8",0x8C08],
- ["D79F",0x8C09],
- ["D2EA",0x8C0A],
- ["C4B1",0x8C0B],
- ["DAC8",0x8C0C],
- ["B5FD",0x8C0D],
- ["BBD1",0x8C0E],
- ["DAC9",0x8C0F],
- ["D0B3",0x8C10],
- ["DACA",0x8C11],
- ["DACB",0x8C12],
- ["CEBD",0x8C13],
- ["DACC",0x8C14],
- ["DACD",0x8C15],
- ["DACE",0x8C16],
- ["B2F7",0x8C17],
- ["DAD1",0x8C18],
- ["DACF",0x8C19],
- ["D1E8",0x8C1A],
- ["DAD0",0x8C1B],
- ["C3D5",0x8C1C],
- ["DAD2",0x8C1D],
- ["D7A0",0x8C1E],
- ["DAD3",0x8C1F],
- ["DAD4",0x8C20],
- ["DAD5",0x8C21],
- ["D0BB",0x8C22],
- ["D2A5",0x8C23],
- ["B0F9",0x8C24],
- ["DAD6",0x8C25],
- ["C7AB",0x8C26],
- ["DAD7",0x8C27],
- ["BDF7",0x8C28],
- ["C3A1",0x8C29],
- ["DAD8",0x8C2A],
- ["DAD9",0x8C2B],
- ["C3FD",0x8C2C],
- ["CCB7",0x8C2D],
- ["DADA",0x8C2E],
- ["DADB",0x8C2F],
- ["C0BE",0x8C30],
- ["C6D7",0x8C31],
- ["DADC",0x8C32],
- ["DADD",0x8C33],
- ["C7B4",0x8C34],
- ["DADE",0x8C35],
- ["DADF",0x8C36],
- ["B9C8",0x8C37],
- ["D840",0x8C38],
- ["D841",0x8C39],
- ["D842",0x8C3A],
- ["D843",0x8C3B],
- ["D844",0x8C3C],
- ["D845",0x8C3D],
- ["D846",0x8C3E],
- ["D847",0x8C3F],
- ["D848",0x8C40],
- ["BBED",0x8C41],
- ["D849",0x8C42],
- ["D84A",0x8C43],
- ["D84B",0x8C44],
- ["D84C",0x8C45],
- ["B6B9",0x8C46],
- ["F4F8",0x8C47],
- ["D84D",0x8C48],
- ["F4F9",0x8C49],
- ["D84E",0x8C4A],
- ["D84F",0x8C4B],
- ["CDE3",0x8C4C],
- ["D850",0x8C4D],
- ["D851",0x8C4E],
- ["D852",0x8C4F],
- ["D853",0x8C50],
- ["D854",0x8C51],
- ["D855",0x8C52],
- ["D856",0x8C53],
- ["D857",0x8C54],
- ["F5B9",0x8C55],
- ["D858",0x8C56],
- ["D859",0x8C57],
- ["D85A",0x8C58],
- ["D85B",0x8C59],
- ["EBE0",0x8C5A],
- ["D85C",0x8C5B],
- ["D85D",0x8C5C],
- ["D85E",0x8C5D],
- ["D85F",0x8C5E],
- ["D860",0x8C5F],
- ["D861",0x8C60],
- ["CFF3",0x8C61],
- ["BBBF",0x8C62],
- ["D862",0x8C63],
- ["D863",0x8C64],
- ["D864",0x8C65],
- ["D865",0x8C66],
- ["D866",0x8C67],
- ["D867",0x8C68],
- ["D868",0x8C69],
- ["BAC0",0x8C6A],
- ["D4A5",0x8C6B],
- ["D869",0x8C6C],
- ["D86A",0x8C6D],
- ["D86B",0x8C6E],
- ["D86C",0x8C6F],
- ["D86D",0x8C70],
- ["D86E",0x8C71],
- ["D86F",0x8C72],
- ["E1D9",0x8C73],
- ["D870",0x8C74],
- ["D871",0x8C75],
- ["D872",0x8C76],
- ["D873",0x8C77],
- ["F5F4",0x8C78],
- ["B1AA",0x8C79],
- ["B2F2",0x8C7A],
- ["D874",0x8C7B],
- ["D875",0x8C7C],
- ["D876",0x8C7D],
- ["D877",0x8C7E],
- ["D878",0x8C7F],
- ["D879",0x8C80],
- ["D87A",0x8C81],
- ["F5F5",0x8C82],
- ["D87B",0x8C83],
- ["D87C",0x8C84],
- ["F5F7",0x8C85],
- ["D87D",0x8C86],
- ["D87E",0x8C87],
- ["D880",0x8C88],
- ["BAD1",0x8C89],
- ["F5F6",0x8C8A],
- ["D881",0x8C8B],
- ["C3B2",0x8C8C],
- ["D882",0x8C8D],
- ["D883",0x8C8E],
- ["D884",0x8C8F],
- ["D885",0x8C90],
- ["D886",0x8C91],
- ["D887",0x8C92],
- ["D888",0x8C93],
- ["F5F9",0x8C94],
- ["D889",0x8C95],
- ["D88A",0x8C96],
- ["D88B",0x8C97],
- ["F5F8",0x8C98],
- ["D88C",0x8C99],
- ["D88D",0x8C9A],
- ["D88E",0x8C9B],
- ["D88F",0x8C9C],
- ["D890",0x8C9D],
- ["D891",0x8C9E],
- ["D892",0x8C9F],
- ["D893",0x8CA0],
- ["D894",0x8CA1],
- ["D895",0x8CA2],
- ["D896",0x8CA3],
- ["D897",0x8CA4],
- ["D898",0x8CA5],
- ["D899",0x8CA6],
- ["D89A",0x8CA7],
- ["D89B",0x8CA8],
- ["D89C",0x8CA9],
- ["D89D",0x8CAA],
- ["D89E",0x8CAB],
- ["D89F",0x8CAC],
- ["D8A0",0x8CAD],
- ["D940",0x8CAE],
- ["D941",0x8CAF],
- ["D942",0x8CB0],
- ["D943",0x8CB1],
- ["D944",0x8CB2],
- ["D945",0x8CB3],
- ["D946",0x8CB4],
- ["D947",0x8CB5],
- ["D948",0x8CB6],
- ["D949",0x8CB7],
- ["D94A",0x8CB8],
- ["D94B",0x8CB9],
- ["D94C",0x8CBA],
- ["D94D",0x8CBB],
- ["D94E",0x8CBC],
- ["D94F",0x8CBD],
- ["D950",0x8CBE],
- ["D951",0x8CBF],
- ["D952",0x8CC0],
- ["D953",0x8CC1],
- ["D954",0x8CC2],
- ["D955",0x8CC3],
- ["D956",0x8CC4],
- ["D957",0x8CC5],
- ["D958",0x8CC6],
- ["D959",0x8CC7],
- ["D95A",0x8CC8],
- ["D95B",0x8CC9],
- ["D95C",0x8CCA],
- ["D95D",0x8CCB],
- ["D95E",0x8CCC],
- ["D95F",0x8CCD],
- ["D960",0x8CCE],
- ["D961",0x8CCF],
- ["D962",0x8CD0],
- ["D963",0x8CD1],
- ["D964",0x8CD2],
- ["D965",0x8CD3],
- ["D966",0x8CD4],
- ["D967",0x8CD5],
- ["D968",0x8CD6],
- ["D969",0x8CD7],
- ["D96A",0x8CD8],
- ["D96B",0x8CD9],
- ["D96C",0x8CDA],
- ["D96D",0x8CDB],
- ["D96E",0x8CDC],
- ["D96F",0x8CDD],
- ["D970",0x8CDE],
- ["D971",0x8CDF],
- ["D972",0x8CE0],
- ["D973",0x8CE1],
- ["D974",0x8CE2],
- ["D975",0x8CE3],
- ["D976",0x8CE4],
- ["D977",0x8CE5],
- ["D978",0x8CE6],
- ["D979",0x8CE7],
- ["D97A",0x8CE8],
- ["D97B",0x8CE9],
- ["D97C",0x8CEA],
- ["D97D",0x8CEB],
- ["D97E",0x8CEC],
- ["D980",0x8CED],
- ["D981",0x8CEE],
- ["D982",0x8CEF],
- ["D983",0x8CF0],
- ["D984",0x8CF1],
- ["D985",0x8CF2],
- ["D986",0x8CF3],
- ["D987",0x8CF4],
- ["D988",0x8CF5],
- ["D989",0x8CF6],
- ["D98A",0x8CF7],
- ["D98B",0x8CF8],
- ["D98C",0x8CF9],
- ["D98D",0x8CFA],
- ["D98E",0x8CFB],
- ["D98F",0x8CFC],
- ["D990",0x8CFD],
- ["D991",0x8CFE],
- ["D992",0x8CFF],
- ["D993",0x8D00],
- ["D994",0x8D01],
- ["D995",0x8D02],
- ["D996",0x8D03],
- ["D997",0x8D04],
- ["D998",0x8D05],
- ["D999",0x8D06],
- ["D99A",0x8D07],
- ["D99B",0x8D08],
- ["D99C",0x8D09],
- ["D99D",0x8D0A],
- ["D99E",0x8D0B],
- ["D99F",0x8D0C],
- ["D9A0",0x8D0D],
- ["DA40",0x8D0E],
- ["DA41",0x8D0F],
- ["DA42",0x8D10],
- ["DA43",0x8D11],
- ["DA44",0x8D12],
- ["DA45",0x8D13],
- ["DA46",0x8D14],
- ["DA47",0x8D15],
- ["DA48",0x8D16],
- ["DA49",0x8D17],
- ["DA4A",0x8D18],
- ["DA4B",0x8D19],
- ["DA4C",0x8D1A],
- ["DA4D",0x8D1B],
- ["DA4E",0x8D1C],
- ["B1B4",0x8D1D],
- ["D5EA",0x8D1E],
- ["B8BA",0x8D1F],
- ["DA4F",0x8D20],
- ["B9B1",0x8D21],
- ["B2C6",0x8D22],
- ["D4F0",0x8D23],
- ["CFCD",0x8D24],
- ["B0DC",0x8D25],
- ["D5CB",0x8D26],
- ["BBF5",0x8D27],
- ["D6CA",0x8D28],
- ["B7B7",0x8D29],
- ["CCB0",0x8D2A],
- ["C6B6",0x8D2B],
- ["B1E1",0x8D2C],
- ["B9BA",0x8D2D],
- ["D6FC",0x8D2E],
- ["B9E1",0x8D2F],
- ["B7A1",0x8D30],
- ["BCFA",0x8D31],
- ["EADA",0x8D32],
- ["EADB",0x8D33],
- ["CCF9",0x8D34],
- ["B9F3",0x8D35],
- ["EADC",0x8D36],
- ["B4FB",0x8D37],
- ["C3B3",0x8D38],
- ["B7D1",0x8D39],
- ["BAD8",0x8D3A],
- ["EADD",0x8D3B],
- ["D4F4",0x8D3C],
- ["EADE",0x8D3D],
- ["BCD6",0x8D3E],
- ["BBDF",0x8D3F],
- ["EADF",0x8D40],
- ["C1DE",0x8D41],
- ["C2B8",0x8D42],
- ["D4DF",0x8D43],
- ["D7CA",0x8D44],
- ["EAE0",0x8D45],
- ["EAE1",0x8D46],
- ["EAE4",0x8D47],
- ["EAE2",0x8D48],
- ["EAE3",0x8D49],
- ["C9DE",0x8D4A],
- ["B8B3",0x8D4B],
- ["B6C4",0x8D4C],
- ["EAE5",0x8D4D],
- ["CAEA",0x8D4E],
- ["C9CD",0x8D4F],
- ["B4CD",0x8D50],
- ["DA50",0x8D51],
- ["DA51",0x8D52],
- ["E2D9",0x8D53],
- ["C5E2",0x8D54],
- ["EAE6",0x8D55],
- ["C0B5",0x8D56],
- ["DA52",0x8D57],
- ["D7B8",0x8D58],
- ["EAE7",0x8D59],
- ["D7AC",0x8D5A],
- ["C8FC",0x8D5B],
- ["D8D3",0x8D5C],
- ["D8CD",0x8D5D],
- ["D4DE",0x8D5E],
- ["DA53",0x8D5F],
- ["D4F9",0x8D60],
- ["C9C4",0x8D61],
- ["D3AE",0x8D62],
- ["B8D3",0x8D63],
- ["B3E0",0x8D64],
- ["DA54",0x8D65],
- ["C9E2",0x8D66],
- ["F4F6",0x8D67],
- ["DA55",0x8D68],
- ["DA56",0x8D69],
- ["DA57",0x8D6A],
- ["BAD5",0x8D6B],
- ["DA58",0x8D6C],
- ["F4F7",0x8D6D],
- ["DA59",0x8D6E],
- ["DA5A",0x8D6F],
- ["D7DF",0x8D70],
- ["DA5B",0x8D71],
- ["DA5C",0x8D72],
- ["F4F1",0x8D73],
- ["B8B0",0x8D74],
- ["D5D4",0x8D75],
- ["B8CF",0x8D76],
- ["C6F0",0x8D77],
- ["DA5D",0x8D78],
- ["DA5E",0x8D79],
- ["DA5F",0x8D7A],
- ["DA60",0x8D7B],
- ["DA61",0x8D7C],
- ["DA62",0x8D7D],
- ["DA63",0x8D7E],
- ["DA64",0x8D7F],
- ["DA65",0x8D80],
- ["B3C3",0x8D81],
- ["DA66",0x8D82],
- ["DA67",0x8D83],
- ["F4F2",0x8D84],
- ["B3AC",0x8D85],
- ["DA68",0x8D86],
- ["DA69",0x8D87],
- ["DA6A",0x8D88],
- ["DA6B",0x8D89],
- ["D4BD",0x8D8A],
- ["C7F7",0x8D8B],
- ["DA6C",0x8D8C],
- ["DA6D",0x8D8D],
- ["DA6E",0x8D8E],
- ["DA6F",0x8D8F],
- ["DA70",0x8D90],
- ["F4F4",0x8D91],
- ["DA71",0x8D92],
- ["DA72",0x8D93],
- ["F4F3",0x8D94],
- ["DA73",0x8D95],
- ["DA74",0x8D96],
- ["DA75",0x8D97],
- ["DA76",0x8D98],
- ["DA77",0x8D99],
- ["DA78",0x8D9A],
- ["DA79",0x8D9B],
- ["DA7A",0x8D9C],
- ["DA7B",0x8D9D],
- ["DA7C",0x8D9E],
- ["CCCB",0x8D9F],
- ["DA7D",0x8DA0],
- ["DA7E",0x8DA1],
- ["DA80",0x8DA2],
- ["C8A4",0x8DA3],
- ["DA81",0x8DA4],
- ["DA82",0x8DA5],
- ["DA83",0x8DA6],
- ["DA84",0x8DA7],
- ["DA85",0x8DA8],
- ["DA86",0x8DA9],
- ["DA87",0x8DAA],
- ["DA88",0x8DAB],
- ["DA89",0x8DAC],
- ["DA8A",0x8DAD],
- ["DA8B",0x8DAE],
- ["DA8C",0x8DAF],
- ["DA8D",0x8DB0],
- ["F4F5",0x8DB1],
- ["DA8E",0x8DB2],
- ["D7E3",0x8DB3],
- ["C5BF",0x8DB4],
- ["F5C0",0x8DB5],
- ["DA8F",0x8DB6],
- ["DA90",0x8DB7],
- ["F5BB",0x8DB8],
- ["DA91",0x8DB9],
- ["F5C3",0x8DBA],
- ["DA92",0x8DBB],
- ["F5C2",0x8DBC],
- ["DA93",0x8DBD],
- ["D6BA",0x8DBE],
- ["F5C1",0x8DBF],
- ["DA94",0x8DC0],
- ["DA95",0x8DC1],
- ["DA96",0x8DC2],
- ["D4BE",0x8DC3],
- ["F5C4",0x8DC4],
- ["DA97",0x8DC5],
- ["F5CC",0x8DC6],
- ["DA98",0x8DC7],
- ["DA99",0x8DC8],
- ["DA9A",0x8DC9],
- ["DA9B",0x8DCA],
- ["B0CF",0x8DCB],
- ["B5F8",0x8DCC],
- ["DA9C",0x8DCD],
- ["F5C9",0x8DCE],
- ["F5CA",0x8DCF],
- ["DA9D",0x8DD0],
- ["C5DC",0x8DD1],
- ["DA9E",0x8DD2],
- ["DA9F",0x8DD3],
- ["DAA0",0x8DD4],
- ["DB40",0x8DD5],
- ["F5C5",0x8DD6],
- ["F5C6",0x8DD7],
- ["DB41",0x8DD8],
- ["DB42",0x8DD9],
- ["F5C7",0x8DDA],
- ["F5CB",0x8DDB],
- ["DB43",0x8DDC],
- ["BEE0",0x8DDD],
- ["F5C8",0x8DDE],
- ["B8FA",0x8DDF],
- ["DB44",0x8DE0],
- ["DB45",0x8DE1],
- ["DB46",0x8DE2],
- ["F5D0",0x8DE3],
- ["F5D3",0x8DE4],
- ["DB47",0x8DE5],
- ["DB48",0x8DE6],
- ["DB49",0x8DE7],
- ["BFE7",0x8DE8],
- ["DB4A",0x8DE9],
- ["B9F2",0x8DEA],
- ["F5BC",0x8DEB],
- ["F5CD",0x8DEC],
- ["DB4B",0x8DED],
- ["DB4C",0x8DEE],
- ["C2B7",0x8DEF],
- ["DB4D",0x8DF0],
- ["DB4E",0x8DF1],
- ["DB4F",0x8DF2],
- ["CCF8",0x8DF3],
- ["DB50",0x8DF4],
- ["BCF9",0x8DF5],
- ["DB51",0x8DF6],
- ["F5CE",0x8DF7],
- ["F5CF",0x8DF8],
- ["F5D1",0x8DF9],
- ["B6E5",0x8DFA],
- ["F5D2",0x8DFB],
- ["DB52",0x8DFC],
- ["F5D5",0x8DFD],
- ["DB53",0x8DFE],
- ["DB54",0x8DFF],
- ["DB55",0x8E00],
- ["DB56",0x8E01],
- ["DB57",0x8E02],
- ["DB58",0x8E03],
- ["DB59",0x8E04],
- ["F5BD",0x8E05],
- ["DB5A",0x8E06],
- ["DB5B",0x8E07],
- ["DB5C",0x8E08],
- ["F5D4",0x8E09],
- ["D3BB",0x8E0A],
- ["DB5D",0x8E0B],
- ["B3EC",0x8E0C],
- ["DB5E",0x8E0D],
- ["DB5F",0x8E0E],
- ["CCA4",0x8E0F],
- ["DB60",0x8E10],
- ["DB61",0x8E11],
- ["DB62",0x8E12],
- ["DB63",0x8E13],
- ["F5D6",0x8E14],
- ["DB64",0x8E15],
- ["DB65",0x8E16],
- ["DB66",0x8E17],
- ["DB67",0x8E18],
- ["DB68",0x8E19],
- ["DB69",0x8E1A],
- ["DB6A",0x8E1B],
- ["DB6B",0x8E1C],
- ["F5D7",0x8E1D],
- ["BEE1",0x8E1E],
- ["F5D8",0x8E1F],
- ["DB6C",0x8E20],
- ["DB6D",0x8E21],
- ["CCDF",0x8E22],
- ["F5DB",0x8E23],
- ["DB6E",0x8E24],
- ["DB6F",0x8E25],
- ["DB70",0x8E26],
- ["DB71",0x8E27],
- ["DB72",0x8E28],
- ["B2C8",0x8E29],
- ["D7D9",0x8E2A],
- ["DB73",0x8E2B],
- ["F5D9",0x8E2C],
- ["DB74",0x8E2D],
- ["F5DA",0x8E2E],
- ["F5DC",0x8E2F],
- ["DB75",0x8E30],
- ["F5E2",0x8E31],
- ["DB76",0x8E32],
- ["DB77",0x8E33],
- ["DB78",0x8E34],
- ["F5E0",0x8E35],
- ["DB79",0x8E36],
- ["DB7A",0x8E37],
- ["DB7B",0x8E38],
- ["F5DF",0x8E39],
- ["F5DD",0x8E3A],
- ["DB7C",0x8E3B],
- ["DB7D",0x8E3C],
- ["F5E1",0x8E3D],
- ["DB7E",0x8E3E],
- ["DB80",0x8E3F],
- ["F5DE",0x8E40],
- ["F5E4",0x8E41],
- ["F5E5",0x8E42],
- ["DB81",0x8E43],
- ["CCE3",0x8E44],
- ["DB82",0x8E45],
- ["DB83",0x8E46],
- ["E5BF",0x8E47],
- ["B5B8",0x8E48],
- ["F5E3",0x8E49],
- ["F5E8",0x8E4A],
- ["CCA3",0x8E4B],
- ["DB84",0x8E4C],
- ["DB85",0x8E4D],
- ["DB86",0x8E4E],
- ["DB87",0x8E4F],
- ["DB88",0x8E50],
- ["F5E6",0x8E51],
- ["F5E7",0x8E52],
- ["DB89",0x8E53],
- ["DB8A",0x8E54],
- ["DB8B",0x8E55],
- ["DB8C",0x8E56],
- ["DB8D",0x8E57],
- ["DB8E",0x8E58],
- ["F5BE",0x8E59],
- ["DB8F",0x8E5A],
- ["DB90",0x8E5B],
- ["DB91",0x8E5C],
- ["DB92",0x8E5D],
- ["DB93",0x8E5E],
- ["DB94",0x8E5F],
- ["DB95",0x8E60],
- ["DB96",0x8E61],
- ["DB97",0x8E62],
- ["DB98",0x8E63],
- ["DB99",0x8E64],
- ["DB9A",0x8E65],
- ["B1C4",0x8E66],
- ["DB9B",0x8E67],
- ["DB9C",0x8E68],
- ["F5BF",0x8E69],
- ["DB9D",0x8E6A],
- ["DB9E",0x8E6B],
- ["B5C5",0x8E6C],
- ["B2E4",0x8E6D],
- ["DB9F",0x8E6E],
- ["F5EC",0x8E6F],
- ["F5E9",0x8E70],
- ["DBA0",0x8E71],
- ["B6D7",0x8E72],
- ["DC40",0x8E73],
- ["F5ED",0x8E74],
- ["DC41",0x8E75],
- ["F5EA",0x8E76],
- ["DC42",0x8E77],
- ["DC43",0x8E78],
- ["DC44",0x8E79],
- ["DC45",0x8E7A],
- ["DC46",0x8E7B],
- ["F5EB",0x8E7C],
- ["DC47",0x8E7D],
- ["DC48",0x8E7E],
- ["B4DA",0x8E7F],
- ["DC49",0x8E80],
- ["D4EA",0x8E81],
- ["DC4A",0x8E82],
- ["DC4B",0x8E83],
- ["DC4C",0x8E84],
- ["F5EE",0x8E85],
- ["DC4D",0x8E86],
- ["B3F9",0x8E87],
- ["DC4E",0x8E88],
- ["DC4F",0x8E89],
- ["DC50",0x8E8A],
- ["DC51",0x8E8B],
- ["DC52",0x8E8C],
- ["DC53",0x8E8D],
- ["DC54",0x8E8E],
- ["F5EF",0x8E8F],
- ["F5F1",0x8E90],
- ["DC55",0x8E91],
- ["DC56",0x8E92],
- ["DC57",0x8E93],
- ["F5F0",0x8E94],
- ["DC58",0x8E95],
- ["DC59",0x8E96],
- ["DC5A",0x8E97],
- ["DC5B",0x8E98],
- ["DC5C",0x8E99],
- ["DC5D",0x8E9A],
- ["DC5E",0x8E9B],
- ["F5F2",0x8E9C],
- ["DC5F",0x8E9D],
- ["F5F3",0x8E9E],
- ["DC60",0x8E9F],
- ["DC61",0x8EA0],
- ["DC62",0x8EA1],
- ["DC63",0x8EA2],
- ["DC64",0x8EA3],
- ["DC65",0x8EA4],
- ["DC66",0x8EA5],
- ["DC67",0x8EA6],
- ["DC68",0x8EA7],
- ["DC69",0x8EA8],
- ["DC6A",0x8EA9],
- ["DC6B",0x8EAA],
- ["C9ED",0x8EAB],
- ["B9AA",0x8EAC],
- ["DC6C",0x8EAD],
- ["DC6D",0x8EAE],
- ["C7FB",0x8EAF],
- ["DC6E",0x8EB0],
- ["DC6F",0x8EB1],
- ["B6E3",0x8EB2],
- ["DC70",0x8EB3],
- ["DC71",0x8EB4],
- ["DC72",0x8EB5],
- ["DC73",0x8EB6],
- ["DC74",0x8EB7],
- ["DC75",0x8EB8],
- ["DC76",0x8EB9],
- ["CCC9",0x8EBA],
- ["DC77",0x8EBB],
- ["DC78",0x8EBC],
- ["DC79",0x8EBD],
- ["DC7A",0x8EBE],
- ["DC7B",0x8EBF],
- ["DC7C",0x8EC0],
- ["DC7D",0x8EC1],
- ["DC7E",0x8EC2],
- ["DC80",0x8EC3],
- ["DC81",0x8EC4],
- ["DC82",0x8EC5],
- ["DC83",0x8EC6],
- ["DC84",0x8EC7],
- ["DC85",0x8EC8],
- ["DC86",0x8EC9],
- ["DC87",0x8ECA],
- ["DC88",0x8ECB],
- ["DC89",0x8ECC],
- ["DC8A",0x8ECD],
- ["EAA6",0x8ECE],
- ["DC8B",0x8ECF],
- ["DC8C",0x8ED0],
- ["DC8D",0x8ED1],
- ["DC8E",0x8ED2],
- ["DC8F",0x8ED3],
- ["DC90",0x8ED4],
- ["DC91",0x8ED5],
- ["DC92",0x8ED6],
- ["DC93",0x8ED7],
- ["DC94",0x8ED8],
- ["DC95",0x8ED9],
- ["DC96",0x8EDA],
- ["DC97",0x8EDB],
- ["DC98",0x8EDC],
- ["DC99",0x8EDD],
- ["DC9A",0x8EDE],
- ["DC9B",0x8EDF],
- ["DC9C",0x8EE0],
- ["DC9D",0x8EE1],
- ["DC9E",0x8EE2],
- ["DC9F",0x8EE3],
- ["DCA0",0x8EE4],
- ["DD40",0x8EE5],
- ["DD41",0x8EE6],
- ["DD42",0x8EE7],
- ["DD43",0x8EE8],
- ["DD44",0x8EE9],
- ["DD45",0x8EEA],
- ["DD46",0x8EEB],
- ["DD47",0x8EEC],
- ["DD48",0x8EED],
- ["DD49",0x8EEE],
- ["DD4A",0x8EEF],
- ["DD4B",0x8EF0],
- ["DD4C",0x8EF1],
- ["DD4D",0x8EF2],
- ["DD4E",0x8EF3],
- ["DD4F",0x8EF4],
- ["DD50",0x8EF5],
- ["DD51",0x8EF6],
- ["DD52",0x8EF7],
- ["DD53",0x8EF8],
- ["DD54",0x8EF9],
- ["DD55",0x8EFA],
- ["DD56",0x8EFB],
- ["DD57",0x8EFC],
- ["DD58",0x8EFD],
- ["DD59",0x8EFE],
- ["DD5A",0x8EFF],
- ["DD5B",0x8F00],
- ["DD5C",0x8F01],
- ["DD5D",0x8F02],
- ["DD5E",0x8F03],
- ["DD5F",0x8F04],
- ["DD60",0x8F05],
- ["DD61",0x8F06],
- ["DD62",0x8F07],
- ["DD63",0x8F08],
- ["DD64",0x8F09],
- ["DD65",0x8F0A],
- ["DD66",0x8F0B],
- ["DD67",0x8F0C],
- ["DD68",0x8F0D],
- ["DD69",0x8F0E],
- ["DD6A",0x8F0F],
- ["DD6B",0x8F10],
- ["DD6C",0x8F11],
- ["DD6D",0x8F12],
- ["DD6E",0x8F13],
- ["DD6F",0x8F14],
- ["DD70",0x8F15],
- ["DD71",0x8F16],
- ["DD72",0x8F17],
- ["DD73",0x8F18],
- ["DD74",0x8F19],
- ["DD75",0x8F1A],
- ["DD76",0x8F1B],
- ["DD77",0x8F1C],
- ["DD78",0x8F1D],
- ["DD79",0x8F1E],
- ["DD7A",0x8F1F],
- ["DD7B",0x8F20],
- ["DD7C",0x8F21],
- ["DD7D",0x8F22],
- ["DD7E",0x8F23],
- ["DD80",0x8F24],
- ["DD81",0x8F25],
- ["DD82",0x8F26],
- ["DD83",0x8F27],
- ["DD84",0x8F28],
- ["DD85",0x8F29],
- ["DD86",0x8F2A],
- ["DD87",0x8F2B],
- ["DD88",0x8F2C],
- ["DD89",0x8F2D],
- ["DD8A",0x8F2E],
- ["DD8B",0x8F2F],
- ["DD8C",0x8F30],
- ["DD8D",0x8F31],
- ["DD8E",0x8F32],
- ["DD8F",0x8F33],
- ["DD90",0x8F34],
- ["DD91",0x8F35],
- ["DD92",0x8F36],
- ["DD93",0x8F37],
- ["DD94",0x8F38],
- ["DD95",0x8F39],
- ["DD96",0x8F3A],
- ["DD97",0x8F3B],
- ["DD98",0x8F3C],
- ["DD99",0x8F3D],
- ["DD9A",0x8F3E],
- ["DD9B",0x8F3F],
- ["DD9C",0x8F40],
- ["DD9D",0x8F41],
- ["DD9E",0x8F42],
- ["DD9F",0x8F43],
- ["DDA0",0x8F44],
- ["DE40",0x8F45],
- ["DE41",0x8F46],
- ["DE42",0x8F47],
- ["DE43",0x8F48],
- ["DE44",0x8F49],
- ["DE45",0x8F4A],
- ["DE46",0x8F4B],
- ["DE47",0x8F4C],
- ["DE48",0x8F4D],
- ["DE49",0x8F4E],
- ["DE4A",0x8F4F],
- ["DE4B",0x8F50],
- ["DE4C",0x8F51],
- ["DE4D",0x8F52],
- ["DE4E",0x8F53],
- ["DE4F",0x8F54],
- ["DE50",0x8F55],
- ["DE51",0x8F56],
- ["DE52",0x8F57],
- ["DE53",0x8F58],
- ["DE54",0x8F59],
- ["DE55",0x8F5A],
- ["DE56",0x8F5B],
- ["DE57",0x8F5C],
- ["DE58",0x8F5D],
- ["DE59",0x8F5E],
- ["DE5A",0x8F5F],
- ["DE5B",0x8F60],
- ["DE5C",0x8F61],
- ["DE5D",0x8F62],
- ["DE5E",0x8F63],
- ["DE5F",0x8F64],
- ["DE60",0x8F65],
- ["B3B5",0x8F66],
- ["D4FE",0x8F67],
- ["B9EC",0x8F68],
- ["D0F9",0x8F69],
- ["DE61",0x8F6A],
- ["E9ED",0x8F6B],
- ["D7AA",0x8F6C],
- ["E9EE",0x8F6D],
- ["C2D6",0x8F6E],
- ["C8ED",0x8F6F],
- ["BAE4",0x8F70],
- ["E9EF",0x8F71],
- ["E9F0",0x8F72],
- ["E9F1",0x8F73],
- ["D6E1",0x8F74],
- ["E9F2",0x8F75],
- ["E9F3",0x8F76],
- ["E9F5",0x8F77],
- ["E9F4",0x8F78],
- ["E9F6",0x8F79],
- ["E9F7",0x8F7A],
- ["C7E1",0x8F7B],
- ["E9F8",0x8F7C],
- ["D4D8",0x8F7D],
- ["E9F9",0x8F7E],
- ["BDCE",0x8F7F],
- ["DE62",0x8F80],
- ["E9FA",0x8F81],
- ["E9FB",0x8F82],
- ["BDCF",0x8F83],
- ["E9FC",0x8F84],
- ["B8A8",0x8F85],
- ["C1BE",0x8F86],
- ["E9FD",0x8F87],
- ["B1B2",0x8F88],
- ["BBD4",0x8F89],
- ["B9F5",0x8F8A],
- ["E9FE",0x8F8B],
- ["DE63",0x8F8C],
- ["EAA1",0x8F8D],
- ["EAA2",0x8F8E],
- ["EAA3",0x8F8F],
- ["B7F8",0x8F90],
- ["BCAD",0x8F91],
- ["DE64",0x8F92],
- ["CAE4",0x8F93],
- ["E0CE",0x8F94],
- ["D4AF",0x8F95],
- ["CFBD",0x8F96],
- ["D5B7",0x8F97],
- ["EAA4",0x8F98],
- ["D5DE",0x8F99],
- ["EAA5",0x8F9A],
- ["D0C1",0x8F9B],
- ["B9BC",0x8F9C],
- ["DE65",0x8F9D],
- ["B4C7",0x8F9E],
- ["B1D9",0x8F9F],
- ["DE66",0x8FA0],
- ["DE67",0x8FA1],
- ["DE68",0x8FA2],
- ["C0B1",0x8FA3],
- ["DE69",0x8FA4],
- ["DE6A",0x8FA5],
- ["DE6B",0x8FA6],
- ["DE6C",0x8FA7],
- ["B1E6",0x8FA8],
- ["B1E7",0x8FA9],
- ["DE6D",0x8FAA],
- ["B1E8",0x8FAB],
- ["DE6E",0x8FAC],
- ["DE6F",0x8FAD],
- ["DE70",0x8FAE],
- ["DE71",0x8FAF],
- ["B3BD",0x8FB0],
- ["C8E8",0x8FB1],
- ["DE72",0x8FB2],
- ["DE73",0x8FB3],
- ["DE74",0x8FB4],
- ["DE75",0x8FB5],
- ["E5C1",0x8FB6],
- ["DE76",0x8FB7],
- ["DE77",0x8FB8],
- ["B1DF",0x8FB9],
- ["DE78",0x8FBA],
- ["DE79",0x8FBB],
- ["DE7A",0x8FBC],
- ["C1C9",0x8FBD],
- ["B4EF",0x8FBE],
- ["DE7B",0x8FBF],
- ["DE7C",0x8FC0],
- ["C7A8",0x8FC1],
- ["D3D8",0x8FC2],
- ["DE7D",0x8FC3],
- ["C6F9",0x8FC4],
- ["D1B8",0x8FC5],
- ["DE7E",0x8FC6],
- ["B9FD",0x8FC7],
- ["C2F5",0x8FC8],
- ["DE80",0x8FC9],
- ["DE81",0x8FCA],
- ["DE82",0x8FCB],
- ["DE83",0x8FCC],
- ["DE84",0x8FCD],
- ["D3AD",0x8FCE],
- ["DE85",0x8FCF],
- ["D4CB",0x8FD0],
- ["BDFC",0x8FD1],
- ["DE86",0x8FD2],
- ["E5C2",0x8FD3],
- ["B7B5",0x8FD4],
- ["E5C3",0x8FD5],
- ["DE87",0x8FD6],
- ["DE88",0x8FD7],
- ["BBB9",0x8FD8],
- ["D5E2",0x8FD9],
- ["DE89",0x8FDA],
- ["BDF8",0x8FDB],
- ["D4B6",0x8FDC],
- ["CEA5",0x8FDD],
- ["C1AC",0x8FDE],
- ["B3D9",0x8FDF],
- ["DE8A",0x8FE0],
- ["DE8B",0x8FE1],
- ["CCF6",0x8FE2],
- ["DE8C",0x8FE3],
- ["E5C6",0x8FE4],
- ["E5C4",0x8FE5],
- ["E5C8",0x8FE6],
- ["DE8D",0x8FE7],
- ["E5CA",0x8FE8],
- ["E5C7",0x8FE9],
- ["B5CF",0x8FEA],
- ["C6C8",0x8FEB],
- ["DE8E",0x8FEC],
- ["B5FC",0x8FED],
- ["E5C5",0x8FEE],
- ["DE8F",0x8FEF],
- ["CAF6",0x8FF0],
- ["DE90",0x8FF1],
- ["DE91",0x8FF2],
- ["E5C9",0x8FF3],
- ["DE92",0x8FF4],
- ["DE93",0x8FF5],
- ["DE94",0x8FF6],
- ["C3D4",0x8FF7],
- ["B1C5",0x8FF8],
- ["BCA3",0x8FF9],
- ["DE95",0x8FFA],
- ["DE96",0x8FFB],
- ["DE97",0x8FFC],
- ["D7B7",0x8FFD],
- ["DE98",0x8FFE],
- ["DE99",0x8FFF],
- ["CDCB",0x9000],
- ["CBCD",0x9001],
- ["CACA",0x9002],
- ["CCD3",0x9003],
- ["E5CC",0x9004],
- ["E5CB",0x9005],
- ["C4E6",0x9006],
- ["DE9A",0x9007],
- ["DE9B",0x9008],
- ["D1A1",0x9009],
- ["D1B7",0x900A],
- ["E5CD",0x900B],
- ["DE9C",0x900C],
- ["E5D0",0x900D],
- ["DE9D",0x900E],
- ["CDB8",0x900F],
- ["D6F0",0x9010],
- ["E5CF",0x9011],
- ["B5DD",0x9012],
- ["DE9E",0x9013],
- ["CDBE",0x9014],
- ["DE9F",0x9015],
- ["E5D1",0x9016],
- ["B6BA",0x9017],
- ["DEA0",0x9018],
- ["DF40",0x9019],
- ["CDA8",0x901A],
- ["B9E4",0x901B],
- ["DF41",0x901C],
- ["CAC5",0x901D],
- ["B3D1",0x901E],
- ["CBD9",0x901F],
- ["D4EC",0x9020],
- ["E5D2",0x9021],
- ["B7EA",0x9022],
- ["DF42",0x9023],
- ["DF43",0x9024],
- ["DF44",0x9025],
- ["E5CE",0x9026],
- ["DF45",0x9027],
- ["DF46",0x9028],
- ["DF47",0x9029],
- ["DF48",0x902A],
- ["DF49",0x902B],
- ["DF4A",0x902C],
- ["E5D5",0x902D],
- ["B4FE",0x902E],
- ["E5D6",0x902F],
- ["DF4B",0x9030],
- ["DF4C",0x9031],
- ["DF4D",0x9032],
- ["DF4E",0x9033],
- ["DF4F",0x9034],
- ["E5D3",0x9035],
- ["E5D4",0x9036],
- ["DF50",0x9037],
- ["D2DD",0x9038],
- ["DF51",0x9039],
- ["DF52",0x903A],
- ["C2DF",0x903B],
- ["B1C6",0x903C],
- ["DF53",0x903D],
- ["D3E2",0x903E],
- ["DF54",0x903F],
- ["DF55",0x9040],
- ["B6DD",0x9041],
- ["CBEC",0x9042],
- ["DF56",0x9043],
- ["E5D7",0x9044],
- ["DF57",0x9045],
- ["DF58",0x9046],
- ["D3F6",0x9047],
- ["DF59",0x9048],
- ["DF5A",0x9049],
- ["DF5B",0x904A],
- ["DF5C",0x904B],
- ["DF5D",0x904C],
- ["B1E9",0x904D],
- ["DF5E",0x904E],
- ["B6F4",0x904F],
- ["E5DA",0x9050],
- ["E5D8",0x9051],
- ["E5D9",0x9052],
- ["B5C0",0x9053],
- ["DF5F",0x9054],
- ["DF60",0x9055],
- ["DF61",0x9056],
- ["D2C5",0x9057],
- ["E5DC",0x9058],
- ["DF62",0x9059],
- ["DF63",0x905A],
- ["E5DE",0x905B],
- ["DF64",0x905C],
- ["DF65",0x905D],
- ["DF66",0x905E],
- ["DF67",0x905F],
- ["DF68",0x9060],
- ["DF69",0x9061],
- ["E5DD",0x9062],
- ["C7B2",0x9063],
- ["DF6A",0x9064],
- ["D2A3",0x9065],
- ["DF6B",0x9066],
- ["DF6C",0x9067],
- ["E5DB",0x9068],
- ["DF6D",0x9069],
- ["DF6E",0x906A],
- ["DF6F",0x906B],
- ["DF70",0x906C],
- ["D4E2",0x906D],
- ["D5DA",0x906E],
- ["DF71",0x906F],
- ["DF72",0x9070],
- ["DF73",0x9071],
- ["DF74",0x9072],
- ["DF75",0x9073],
- ["E5E0",0x9074],
- ["D7F1",0x9075],
- ["DF76",0x9076],
- ["DF77",0x9077],
- ["DF78",0x9078],
- ["DF79",0x9079],
- ["DF7A",0x907A],
- ["DF7B",0x907B],
- ["DF7C",0x907C],
- ["E5E1",0x907D],
- ["DF7D",0x907E],
- ["B1DC",0x907F],
- ["D1FB",0x9080],
- ["DF7E",0x9081],
- ["E5E2",0x9082],
- ["E5E4",0x9083],
- ["DF80",0x9084],
- ["DF81",0x9085],
- ["DF82",0x9086],
- ["DF83",0x9087],
- ["E5E3",0x9088],
- ["DF84",0x9089],
- ["DF85",0x908A],
- ["E5E5",0x908B],
- ["DF86",0x908C],
- ["DF87",0x908D],
- ["DF88",0x908E],
- ["DF89",0x908F],
- ["DF8A",0x9090],
- ["D2D8",0x9091],
- ["DF8B",0x9092],
- ["B5CB",0x9093],
- ["DF8C",0x9094],
- ["E7DF",0x9095],
- ["DF8D",0x9096],
- ["DAF5",0x9097],
- ["DF8E",0x9098],
- ["DAF8",0x9099],
- ["DF8F",0x909A],
- ["DAF6",0x909B],
- ["DF90",0x909C],
- ["DAF7",0x909D],
- ["DF91",0x909E],
- ["DF92",0x909F],
- ["DF93",0x90A0],
- ["DAFA",0x90A1],
- ["D0CF",0x90A2],
- ["C4C7",0x90A3],
- ["DF94",0x90A4],
- ["DF95",0x90A5],
- ["B0EE",0x90A6],
- ["DF96",0x90A7],
- ["DF97",0x90A8],
- ["DF98",0x90A9],
- ["D0B0",0x90AA],
- ["DF99",0x90AB],
- ["DAF9",0x90AC],
- ["DF9A",0x90AD],
- ["D3CA",0x90AE],
- ["BAAA",0x90AF],
- ["DBA2",0x90B0],
- ["C7F1",0x90B1],
- ["DF9B",0x90B2],
- ["DAFC",0x90B3],
- ["DAFB",0x90B4],
- ["C9DB",0x90B5],
- ["DAFD",0x90B6],
- ["DF9C",0x90B7],
- ["DBA1",0x90B8],
- ["D7DE",0x90B9],
- ["DAFE",0x90BA],
- ["C1DA",0x90BB],
- ["DF9D",0x90BC],
- ["DF9E",0x90BD],
- ["DBA5",0x90BE],
- ["DF9F",0x90BF],
- ["DFA0",0x90C0],
- ["D3F4",0x90C1],
- ["E040",0x90C2],
- ["E041",0x90C3],
- ["DBA7",0x90C4],
- ["DBA4",0x90C5],
- ["E042",0x90C6],
- ["DBA8",0x90C7],
- ["E043",0x90C8],
- ["E044",0x90C9],
- ["BDBC",0x90CA],
- ["E045",0x90CB],
- ["E046",0x90CC],
- ["E047",0x90CD],
- ["C0C9",0x90CE],
- ["DBA3",0x90CF],
- ["DBA6",0x90D0],
- ["D6A3",0x90D1],
- ["E048",0x90D2],
- ["DBA9",0x90D3],
- ["E049",0x90D4],
- ["E04A",0x90D5],
- ["E04B",0x90D6],
- ["DBAD",0x90D7],
- ["E04C",0x90D8],
- ["E04D",0x90D9],
- ["E04E",0x90DA],
- ["DBAE",0x90DB],
- ["DBAC",0x90DC],
- ["BAC2",0x90DD],
- ["E04F",0x90DE],
- ["E050",0x90DF],
- ["E051",0x90E0],
- ["BFA4",0x90E1],
- ["DBAB",0x90E2],
- ["E052",0x90E3],
- ["E053",0x90E4],
- ["E054",0x90E5],
- ["DBAA",0x90E6],
- ["D4C7",0x90E7],
- ["B2BF",0x90E8],
- ["E055",0x90E9],
- ["E056",0x90EA],
- ["DBAF",0x90EB],
- ["E057",0x90EC],
- ["B9F9",0x90ED],
- ["E058",0x90EE],
- ["DBB0",0x90EF],
- ["E059",0x90F0],
- ["E05A",0x90F1],
- ["E05B",0x90F2],
- ["E05C",0x90F3],
- ["B3BB",0x90F4],
- ["E05D",0x90F5],
- ["E05E",0x90F6],
- ["E05F",0x90F7],
- ["B5A6",0x90F8],
- ["E060",0x90F9],
- ["E061",0x90FA],
- ["E062",0x90FB],
- ["E063",0x90FC],
- ["B6BC",0x90FD],
- ["DBB1",0x90FE],
- ["E064",0x90FF],
- ["E065",0x9100],
- ["E066",0x9101],
- ["B6F5",0x9102],
- ["E067",0x9103],
- ["DBB2",0x9104],
- ["E068",0x9105],
- ["E069",0x9106],
- ["E06A",0x9107],
- ["E06B",0x9108],
- ["E06C",0x9109],
- ["E06D",0x910A],
- ["E06E",0x910B],
- ["E06F",0x910C],
- ["E070",0x910D],
- ["E071",0x910E],
- ["E072",0x910F],
- ["E073",0x9110],
- ["E074",0x9111],
- ["E075",0x9112],
- ["E076",0x9113],
- ["E077",0x9114],
- ["E078",0x9115],
- ["E079",0x9116],
- ["E07A",0x9117],
- ["E07B",0x9118],
- ["B1C9",0x9119],
- ["E07C",0x911A],
- ["E07D",0x911B],
- ["E07E",0x911C],
- ["E080",0x911D],
- ["DBB4",0x911E],
- ["E081",0x911F],
- ["E082",0x9120],
- ["E083",0x9121],
- ["DBB3",0x9122],
- ["DBB5",0x9123],
- ["E084",0x9124],
- ["E085",0x9125],
- ["E086",0x9126],
- ["E087",0x9127],
- ["E088",0x9128],
- ["E089",0x9129],
- ["E08A",0x912A],
- ["E08B",0x912B],
- ["E08C",0x912C],
- ["E08D",0x912D],
- ["E08E",0x912E],
- ["DBB7",0x912F],
- ["E08F",0x9130],
- ["DBB6",0x9131],
- ["E090",0x9132],
- ["E091",0x9133],
- ["E092",0x9134],
- ["E093",0x9135],
- ["E094",0x9136],
- ["E095",0x9137],
- ["E096",0x9138],
- ["DBB8",0x9139],
- ["E097",0x913A],
- ["E098",0x913B],
- ["E099",0x913C],
- ["E09A",0x913D],
- ["E09B",0x913E],
- ["E09C",0x913F],
- ["E09D",0x9140],
- ["E09E",0x9141],
- ["E09F",0x9142],
- ["DBB9",0x9143],
- ["E0A0",0x9144],
- ["E140",0x9145],
- ["DBBA",0x9146],
- ["E141",0x9147],
- ["E142",0x9148],
- ["D3CF",0x9149],
- ["F4FA",0x914A],
- ["C7F5",0x914B],
- ["D7C3",0x914C],
- ["C5E4",0x914D],
- ["F4FC",0x914E],
- ["F4FD",0x914F],
- ["F4FB",0x9150],
- ["E143",0x9151],
- ["BEC6",0x9152],
- ["E144",0x9153],
- ["E145",0x9154],
- ["E146",0x9155],
- ["E147",0x9156],
- ["D0EF",0x9157],
- ["E148",0x9158],
- ["E149",0x9159],
- ["B7D3",0x915A],
- ["E14A",0x915B],
- ["E14B",0x915C],
- ["D4CD",0x915D],
- ["CCAA",0x915E],
- ["E14C",0x915F],
- ["E14D",0x9160],
- ["F5A2",0x9161],
- ["F5A1",0x9162],
- ["BAA8",0x9163],
- ["F4FE",0x9164],
- ["CBD6",0x9165],
- ["E14E",0x9166],
- ["E14F",0x9167],
- ["E150",0x9168],
- ["F5A4",0x9169],
- ["C0D2",0x916A],
- ["E151",0x916B],
- ["B3EA",0x916C],
- ["E152",0x916D],
- ["CDAA",0x916E],
- ["F5A5",0x916F],
- ["F5A3",0x9170],
- ["BDB4",0x9171],
- ["F5A8",0x9172],
- ["E153",0x9173],
- ["F5A9",0x9174],
- ["BDCD",0x9175],
- ["C3B8",0x9176],
- ["BFE1",0x9177],
- ["CBE1",0x9178],
- ["F5AA",0x9179],
- ["E154",0x917A],
- ["E155",0x917B],
- ["E156",0x917C],
- ["F5A6",0x917D],
- ["F5A7",0x917E],
- ["C4F0",0x917F],
- ["E157",0x9180],
- ["E158",0x9181],
- ["E159",0x9182],
- ["E15A",0x9183],
- ["E15B",0x9184],
- ["F5AC",0x9185],
- ["E15C",0x9186],
- ["B4BC",0x9187],
- ["E15D",0x9188],
- ["D7ED",0x9189],
- ["E15E",0x918A],
- ["B4D7",0x918B],
- ["F5AB",0x918C],
- ["F5AE",0x918D],
- ["E15F",0x918E],
- ["E160",0x918F],
- ["F5AD",0x9190],
- ["F5AF",0x9191],
- ["D0D1",0x9192],
- ["E161",0x9193],
- ["E162",0x9194],
- ["E163",0x9195],
- ["E164",0x9196],
- ["E165",0x9197],
- ["E166",0x9198],
- ["E167",0x9199],
- ["C3D1",0x919A],
- ["C8A9",0x919B],
- ["E168",0x919C],
- ["E169",0x919D],
- ["E16A",0x919E],
- ["E16B",0x919F],
- ["E16C",0x91A0],
- ["E16D",0x91A1],
- ["F5B0",0x91A2],
- ["F5B1",0x91A3],
- ["E16E",0x91A4],
- ["E16F",0x91A5],
- ["E170",0x91A6],
- ["E171",0x91A7],
- ["E172",0x91A8],
- ["E173",0x91A9],
- ["F5B2",0x91AA],
- ["E174",0x91AB],
- ["E175",0x91AC],
- ["F5B3",0x91AD],
- ["F5B4",0x91AE],
- ["F5B5",0x91AF],
- ["E176",0x91B0],
- ["E177",0x91B1],
- ["E178",0x91B2],
- ["E179",0x91B3],
- ["F5B7",0x91B4],
- ["F5B6",0x91B5],
- ["E17A",0x91B6],
- ["E17B",0x91B7],
- ["E17C",0x91B8],
- ["E17D",0x91B9],
- ["F5B8",0x91BA],
- ["E17E",0x91BB],
- ["E180",0x91BC],
- ["E181",0x91BD],
- ["E182",0x91BE],
- ["E183",0x91BF],
- ["E184",0x91C0],
- ["E185",0x91C1],
- ["E186",0x91C2],
- ["E187",0x91C3],
- ["E188",0x91C4],
- ["E189",0x91C5],
- ["E18A",0x91C6],
- ["B2C9",0x91C7],
- ["E18B",0x91C8],
- ["D3D4",0x91C9],
- ["CACD",0x91CA],
- ["E18C",0x91CB],
- ["C0EF",0x91CC],
- ["D6D8",0x91CD],
- ["D2B0",0x91CE],
- ["C1BF",0x91CF],
- ["E18D",0x91D0],
- ["BDF0",0x91D1],
- ["E18E",0x91D2],
- ["E18F",0x91D3],
- ["E190",0x91D4],
- ["E191",0x91D5],
- ["E192",0x91D6],
- ["E193",0x91D7],
- ["E194",0x91D8],
- ["E195",0x91D9],
- ["E196",0x91DA],
- ["E197",0x91DB],
- ["B8AA",0x91DC],
- ["E198",0x91DD],
- ["E199",0x91DE],
- ["E19A",0x91DF],
- ["E19B",0x91E0],
- ["E19C",0x91E1],
- ["E19D",0x91E2],
- ["E19E",0x91E3],
- ["E19F",0x91E4],
- ["E1A0",0x91E5],
- ["E240",0x91E6],
- ["E241",0x91E7],
- ["E242",0x91E8],
- ["E243",0x91E9],
- ["E244",0x91EA],
- ["E245",0x91EB],
- ["E246",0x91EC],
- ["E247",0x91ED],
- ["E248",0x91EE],
- ["E249",0x91EF],
- ["E24A",0x91F0],
- ["E24B",0x91F1],
- ["E24C",0x91F2],
- ["E24D",0x91F3],
- ["E24E",0x91F4],
- ["E24F",0x91F5],
- ["E250",0x91F6],
- ["E251",0x91F7],
- ["E252",0x91F8],
- ["E253",0x91F9],
- ["E254",0x91FA],
- ["E255",0x91FB],
- ["E256",0x91FC],
- ["E257",0x91FD],
- ["E258",0x91FE],
- ["E259",0x91FF],
- ["E25A",0x9200],
- ["E25B",0x9201],
- ["E25C",0x9202],
- ["E25D",0x9203],
- ["E25E",0x9204],
- ["E25F",0x9205],
- ["E260",0x9206],
- ["E261",0x9207],
- ["E262",0x9208],
- ["E263",0x9209],
- ["E264",0x920A],
- ["E265",0x920B],
- ["E266",0x920C],
- ["E267",0x920D],
- ["E268",0x920E],
- ["E269",0x920F],
- ["E26A",0x9210],
- ["E26B",0x9211],
- ["E26C",0x9212],
- ["E26D",0x9213],
- ["E26E",0x9214],
- ["E26F",0x9215],
- ["E270",0x9216],
- ["E271",0x9217],
- ["E272",0x9218],
- ["E273",0x9219],
- ["E274",0x921A],
- ["E275",0x921B],
- ["E276",0x921C],
- ["E277",0x921D],
- ["E278",0x921E],
- ["E279",0x921F],
- ["E27A",0x9220],
- ["E27B",0x9221],
- ["E27C",0x9222],
- ["E27D",0x9223],
- ["E27E",0x9224],
- ["E280",0x9225],
- ["E281",0x9226],
- ["E282",0x9227],
- ["E283",0x9228],
- ["E284",0x9229],
- ["E285",0x922A],
- ["E286",0x922B],
- ["E287",0x922C],
- ["E288",0x922D],
- ["E289",0x922E],
- ["E28A",0x922F],
- ["E28B",0x9230],
- ["E28C",0x9231],
- ["E28D",0x9232],
- ["E28E",0x9233],
- ["E28F",0x9234],
- ["E290",0x9235],
- ["E291",0x9236],
- ["E292",0x9237],
- ["E293",0x9238],
- ["E294",0x9239],
- ["E295",0x923A],
- ["E296",0x923B],
- ["E297",0x923C],
- ["E298",0x923D],
- ["E299",0x923E],
- ["E29A",0x923F],
- ["E29B",0x9240],
- ["E29C",0x9241],
- ["E29D",0x9242],
- ["E29E",0x9243],
- ["E29F",0x9244],
- ["E2A0",0x9245],
- ["E340",0x9246],
- ["E341",0x9247],
- ["E342",0x9248],
- ["E343",0x9249],
- ["E344",0x924A],
- ["E345",0x924B],
- ["E346",0x924C],
- ["E347",0x924D],
- ["E348",0x924E],
- ["E349",0x924F],
- ["E34A",0x9250],
- ["E34B",0x9251],
- ["E34C",0x9252],
- ["E34D",0x9253],
- ["E34E",0x9254],
- ["E34F",0x9255],
- ["E350",0x9256],
- ["E351",0x9257],
- ["E352",0x9258],
- ["E353",0x9259],
- ["E354",0x925A],
- ["E355",0x925B],
- ["E356",0x925C],
- ["E357",0x925D],
- ["E358",0x925E],
- ["E359",0x925F],
- ["E35A",0x9260],
- ["E35B",0x9261],
- ["E35C",0x9262],
- ["E35D",0x9263],
- ["E35E",0x9264],
- ["E35F",0x9265],
- ["E360",0x9266],
- ["E361",0x9267],
- ["E362",0x9268],
- ["E363",0x9269],
- ["E364",0x926A],
- ["E365",0x926B],
- ["E366",0x926C],
- ["E367",0x926D],
- ["E368",0x926E],
- ["E369",0x926F],
- ["E36A",0x9270],
- ["E36B",0x9271],
- ["E36C",0x9272],
- ["E36D",0x9273],
- ["BCF8",0x9274],
- ["E36E",0x9275],
- ["E36F",0x9276],
- ["E370",0x9277],
- ["E371",0x9278],
- ["E372",0x9279],
- ["E373",0x927A],
- ["E374",0x927B],
- ["E375",0x927C],
- ["E376",0x927D],
- ["E377",0x927E],
- ["E378",0x927F],
- ["E379",0x9280],
- ["E37A",0x9281],
- ["E37B",0x9282],
- ["E37C",0x9283],
- ["E37D",0x9284],
- ["E37E",0x9285],
- ["E380",0x9286],
- ["E381",0x9287],
- ["E382",0x9288],
- ["E383",0x9289],
- ["E384",0x928A],
- ["E385",0x928B],
- ["E386",0x928C],
- ["E387",0x928D],
- ["F6C6",0x928E],
- ["E388",0x928F],
- ["E389",0x9290],
- ["E38A",0x9291],
- ["E38B",0x9292],
- ["E38C",0x9293],
- ["E38D",0x9294],
- ["E38E",0x9295],
- ["E38F",0x9296],
- ["E390",0x9297],
- ["E391",0x9298],
- ["E392",0x9299],
- ["E393",0x929A],
- ["E394",0x929B],
- ["E395",0x929C],
- ["E396",0x929D],
- ["E397",0x929E],
- ["E398",0x929F],
- ["E399",0x92A0],
- ["E39A",0x92A1],
- ["E39B",0x92A2],
- ["E39C",0x92A3],
- ["E39D",0x92A4],
- ["E39E",0x92A5],
- ["E39F",0x92A6],
- ["E3A0",0x92A7],
- ["E440",0x92A8],
- ["E441",0x92A9],
- ["E442",0x92AA],
- ["E443",0x92AB],
- ["E444",0x92AC],
- ["E445",0x92AD],
- ["F6C7",0x92AE],
- ["E446",0x92AF],
- ["E447",0x92B0],
- ["E448",0x92B1],
- ["E449",0x92B2],
- ["E44A",0x92B3],
- ["E44B",0x92B4],
- ["E44C",0x92B5],
- ["E44D",0x92B6],
- ["E44E",0x92B7],
- ["E44F",0x92B8],
- ["E450",0x92B9],
- ["E451",0x92BA],
- ["E452",0x92BB],
- ["E453",0x92BC],
- ["E454",0x92BD],
- ["E455",0x92BE],
- ["E456",0x92BF],
- ["E457",0x92C0],
- ["E458",0x92C1],
- ["E459",0x92C2],
- ["E45A",0x92C3],
- ["E45B",0x92C4],
- ["E45C",0x92C5],
- ["E45D",0x92C6],
- ["E45E",0x92C7],
- ["F6C8",0x92C8],
- ["E45F",0x92C9],
- ["E460",0x92CA],
- ["E461",0x92CB],
- ["E462",0x92CC],
- ["E463",0x92CD],
- ["E464",0x92CE],
- ["E465",0x92CF],
- ["E466",0x92D0],
- ["E467",0x92D1],
- ["E468",0x92D2],
- ["E469",0x92D3],
- ["E46A",0x92D4],
- ["E46B",0x92D5],
- ["E46C",0x92D6],
- ["E46D",0x92D7],
- ["E46E",0x92D8],
- ["E46F",0x92D9],
- ["E470",0x92DA],
- ["E471",0x92DB],
- ["E472",0x92DC],
- ["E473",0x92DD],
- ["E474",0x92DE],
- ["E475",0x92DF],
- ["E476",0x92E0],
- ["E477",0x92E1],
- ["E478",0x92E2],
- ["E479",0x92E3],
- ["E47A",0x92E4],
- ["E47B",0x92E5],
- ["E47C",0x92E6],
- ["E47D",0x92E7],
- ["E47E",0x92E8],
- ["E480",0x92E9],
- ["E481",0x92EA],
- ["E482",0x92EB],
- ["E483",0x92EC],
- ["E484",0x92ED],
- ["E485",0x92EE],
- ["E486",0x92EF],
- ["E487",0x92F0],
- ["E488",0x92F1],
- ["E489",0x92F2],
- ["E48A",0x92F3],
- ["E48B",0x92F4],
- ["E48C",0x92F5],
- ["E48D",0x92F6],
- ["E48E",0x92F7],
- ["E48F",0x92F8],
- ["E490",0x92F9],
- ["E491",0x92FA],
- ["E492",0x92FB],
- ["E493",0x92FC],
- ["E494",0x92FD],
- ["E495",0x92FE],
- ["E496",0x92FF],
- ["E497",0x9300],
- ["E498",0x9301],
- ["E499",0x9302],
- ["E49A",0x9303],
- ["E49B",0x9304],
- ["E49C",0x9305],
- ["E49D",0x9306],
- ["E49E",0x9307],
- ["E49F",0x9308],
- ["E4A0",0x9309],
- ["E540",0x930A],
- ["E541",0x930B],
- ["E542",0x930C],
- ["E543",0x930D],
- ["E544",0x930E],
- ["E545",0x930F],
- ["E546",0x9310],
- ["E547",0x9311],
- ["E548",0x9312],
- ["E549",0x9313],
- ["E54A",0x9314],
- ["E54B",0x9315],
- ["E54C",0x9316],
- ["E54D",0x9317],
- ["E54E",0x9318],
- ["E54F",0x9319],
- ["E550",0x931A],
- ["E551",0x931B],
- ["E552",0x931C],
- ["E553",0x931D],
- ["E554",0x931E],
- ["E555",0x931F],
- ["E556",0x9320],
- ["E557",0x9321],
- ["E558",0x9322],
- ["E559",0x9323],
- ["E55A",0x9324],
- ["E55B",0x9325],
- ["E55C",0x9326],
- ["E55D",0x9327],
- ["E55E",0x9328],
- ["E55F",0x9329],
- ["E560",0x932A],
- ["E561",0x932B],
- ["E562",0x932C],
- ["E563",0x932D],
- ["E564",0x932E],
- ["E565",0x932F],
- ["E566",0x9330],
- ["E567",0x9331],
- ["E568",0x9332],
- ["E569",0x9333],
- ["E56A",0x9334],
- ["E56B",0x9335],
- ["E56C",0x9336],
- ["E56D",0x9337],
- ["E56E",0x9338],
- ["E56F",0x9339],
- ["E570",0x933A],
- ["E571",0x933B],
- ["E572",0x933C],
- ["E573",0x933D],
- ["F6C9",0x933E],
- ["E574",0x933F],
- ["E575",0x9340],
- ["E576",0x9341],
- ["E577",0x9342],
- ["E578",0x9343],
- ["E579",0x9344],
- ["E57A",0x9345],
- ["E57B",0x9346],
- ["E57C",0x9347],
- ["E57D",0x9348],
- ["E57E",0x9349],
- ["E580",0x934A],
- ["E581",0x934B],
- ["E582",0x934C],
- ["E583",0x934D],
- ["E584",0x934E],
- ["E585",0x934F],
- ["E586",0x9350],
- ["E587",0x9351],
- ["E588",0x9352],
- ["E589",0x9353],
- ["E58A",0x9354],
- ["E58B",0x9355],
- ["E58C",0x9356],
- ["E58D",0x9357],
- ["E58E",0x9358],
- ["E58F",0x9359],
- ["E590",0x935A],
- ["E591",0x935B],
- ["E592",0x935C],
- ["E593",0x935D],
- ["E594",0x935E],
- ["E595",0x935F],
- ["E596",0x9360],
- ["E597",0x9361],
- ["E598",0x9362],
- ["E599",0x9363],
- ["E59A",0x9364],
- ["E59B",0x9365],
- ["E59C",0x9366],
- ["E59D",0x9367],
- ["E59E",0x9368],
- ["E59F",0x9369],
- ["F6CA",0x936A],
- ["E5A0",0x936B],
- ["E640",0x936C],
- ["E641",0x936D],
- ["E642",0x936E],
- ["E643",0x936F],
- ["E644",0x9370],
- ["E645",0x9371],
- ["E646",0x9372],
- ["E647",0x9373],
- ["E648",0x9374],
- ["E649",0x9375],
- ["E64A",0x9376],
- ["E64B",0x9377],
- ["E64C",0x9378],
- ["E64D",0x9379],
- ["E64E",0x937A],
- ["E64F",0x937B],
- ["E650",0x937C],
- ["E651",0x937D],
- ["E652",0x937E],
- ["E653",0x937F],
- ["E654",0x9380],
- ["E655",0x9381],
- ["E656",0x9382],
- ["E657",0x9383],
- ["E658",0x9384],
- ["E659",0x9385],
- ["E65A",0x9386],
- ["E65B",0x9387],
- ["E65C",0x9388],
- ["E65D",0x9389],
- ["E65E",0x938A],
- ["E65F",0x938B],
- ["E660",0x938C],
- ["E661",0x938D],
- ["E662",0x938E],
- ["F6CC",0x938F],
- ["E663",0x9390],
- ["E664",0x9391],
- ["E665",0x9392],
- ["E666",0x9393],
- ["E667",0x9394],
- ["E668",0x9395],
- ["E669",0x9396],
- ["E66A",0x9397],
- ["E66B",0x9398],
- ["E66C",0x9399],
- ["E66D",0x939A],
- ["E66E",0x939B],
- ["E66F",0x939C],
- ["E670",0x939D],
- ["E671",0x939E],
- ["E672",0x939F],
- ["E673",0x93A0],
- ["E674",0x93A1],
- ["E675",0x93A2],
- ["E676",0x93A3],
- ["E677",0x93A4],
- ["E678",0x93A5],
- ["E679",0x93A6],
- ["E67A",0x93A7],
- ["E67B",0x93A8],
- ["E67C",0x93A9],
- ["E67D",0x93AA],
- ["E67E",0x93AB],
- ["E680",0x93AC],
- ["E681",0x93AD],
- ["E682",0x93AE],
- ["E683",0x93AF],
- ["E684",0x93B0],
- ["E685",0x93B1],
- ["E686",0x93B2],
- ["E687",0x93B3],
- ["E688",0x93B4],
- ["E689",0x93B5],
- ["E68A",0x93B6],
- ["E68B",0x93B7],
- ["E68C",0x93B8],
- ["E68D",0x93B9],
- ["E68E",0x93BA],
- ["E68F",0x93BB],
- ["E690",0x93BC],
- ["E691",0x93BD],
- ["E692",0x93BE],
- ["E693",0x93BF],
- ["E694",0x93C0],
- ["E695",0x93C1],
- ["E696",0x93C2],
- ["E697",0x93C3],
- ["E698",0x93C4],
- ["E699",0x93C5],
- ["E69A",0x93C6],
- ["E69B",0x93C7],
- ["E69C",0x93C8],
- ["E69D",0x93C9],
- ["F6CB",0x93CA],
- ["E69E",0x93CB],
- ["E69F",0x93CC],
- ["E6A0",0x93CD],
- ["E740",0x93CE],
- ["E741",0x93CF],
- ["E742",0x93D0],
- ["E743",0x93D1],
- ["E744",0x93D2],
- ["E745",0x93D3],
- ["E746",0x93D4],
- ["E747",0x93D5],
- ["F7E9",0x93D6],
- ["E748",0x93D7],
- ["E749",0x93D8],
- ["E74A",0x93D9],
- ["E74B",0x93DA],
- ["E74C",0x93DB],
- ["E74D",0x93DC],
- ["E74E",0x93DD],
- ["E74F",0x93DE],
- ["E750",0x93DF],
- ["E751",0x93E0],
- ["E752",0x93E1],
- ["E753",0x93E2],
- ["E754",0x93E3],
- ["E755",0x93E4],
- ["E756",0x93E5],
- ["E757",0x93E6],
- ["E758",0x93E7],
- ["E759",0x93E8],
- ["E75A",0x93E9],
- ["E75B",0x93EA],
- ["E75C",0x93EB],
- ["E75D",0x93EC],
- ["E75E",0x93ED],
- ["E75F",0x93EE],
- ["E760",0x93EF],
- ["E761",0x93F0],
- ["E762",0x93F1],
- ["E763",0x93F2],
- ["E764",0x93F3],
- ["E765",0x93F4],
- ["E766",0x93F5],
- ["E767",0x93F6],
- ["E768",0x93F7],
- ["E769",0x93F8],
- ["E76A",0x93F9],
- ["E76B",0x93FA],
- ["E76C",0x93FB],
- ["E76D",0x93FC],
- ["E76E",0x93FD],
- ["E76F",0x93FE],
- ["E770",0x93FF],
- ["E771",0x9400],
- ["E772",0x9401],
- ["E773",0x9402],
- ["E774",0x9403],
- ["E775",0x9404],
- ["E776",0x9405],
- ["E777",0x9406],
- ["E778",0x9407],
- ["E779",0x9408],
- ["E77A",0x9409],
- ["E77B",0x940A],
- ["E77C",0x940B],
- ["E77D",0x940C],
- ["E77E",0x940D],
- ["E780",0x940E],
- ["E781",0x940F],
- ["E782",0x9410],
- ["E783",0x9411],
- ["E784",0x9412],
- ["E785",0x9413],
- ["E786",0x9414],
- ["E787",0x9415],
- ["E788",0x9416],
- ["E789",0x9417],
- ["E78A",0x9418],
- ["E78B",0x9419],
- ["E78C",0x941A],
- ["E78D",0x941B],
- ["E78E",0x941C],
- ["E78F",0x941D],
- ["E790",0x941E],
- ["E791",0x941F],
- ["E792",0x9420],
- ["E793",0x9421],
- ["E794",0x9422],
- ["E795",0x9423],
- ["E796",0x9424],
- ["E797",0x9425],
- ["E798",0x9426],
- ["E799",0x9427],
- ["E79A",0x9428],
- ["E79B",0x9429],
- ["E79C",0x942A],
- ["E79D",0x942B],
- ["E79E",0x942C],
- ["E79F",0x942D],
- ["E7A0",0x942E],
- ["E840",0x942F],
- ["E841",0x9430],
- ["E842",0x9431],
- ["E843",0x9432],
- ["E844",0x9433],
- ["E845",0x9434],
- ["E846",0x9435],
- ["E847",0x9436],
- ["E848",0x9437],
- ["E849",0x9438],
- ["E84A",0x9439],
- ["E84B",0x943A],
- ["E84C",0x943B],
- ["E84D",0x943C],
- ["E84E",0x943D],
- ["F6CD",0x943E],
- ["E84F",0x943F],
- ["E850",0x9440],
- ["E851",0x9441],
- ["E852",0x9442],
- ["E853",0x9443],
- ["E854",0x9444],
- ["E855",0x9445],
- ["E856",0x9446],
- ["E857",0x9447],
- ["E858",0x9448],
- ["E859",0x9449],
- ["E85A",0x944A],
- ["E85B",0x944B],
- ["E85C",0x944C],
- ["E85D",0x944D],
- ["E85E",0x944E],
- ["E85F",0x944F],
- ["E860",0x9450],
- ["E861",0x9451],
- ["E862",0x9452],
- ["E863",0x9453],
- ["E864",0x9454],
- ["E865",0x9455],
- ["E866",0x9456],
- ["E867",0x9457],
- ["E868",0x9458],
- ["E869",0x9459],
- ["E86A",0x945A],
- ["E86B",0x945B],
- ["E86C",0x945C],
- ["E86D",0x945D],
- ["E86E",0x945E],
- ["E86F",0x945F],
- ["E870",0x9460],
- ["E871",0x9461],
- ["E872",0x9462],
- ["E873",0x9463],
- ["E874",0x9464],
- ["E875",0x9465],
- ["E876",0x9466],
- ["E877",0x9467],
- ["E878",0x9468],
- ["E879",0x9469],
- ["E87A",0x946A],
- ["F6CE",0x946B],
- ["E87B",0x946C],
- ["E87C",0x946D],
- ["E87D",0x946E],
- ["E87E",0x946F],
- ["E880",0x9470],
- ["E881",0x9471],
- ["E882",0x9472],
- ["E883",0x9473],
- ["E884",0x9474],
- ["E885",0x9475],
- ["E886",0x9476],
- ["E887",0x9477],
- ["E888",0x9478],
- ["E889",0x9479],
- ["E88A",0x947A],
- ["E88B",0x947B],
- ["E88C",0x947C],
- ["E88D",0x947D],
- ["E88E",0x947E],
- ["E88F",0x947F],
- ["E890",0x9480],
- ["E891",0x9481],
- ["E892",0x9482],
- ["E893",0x9483],
- ["E894",0x9484],
- ["EEC4",0x9485],
- ["EEC5",0x9486],
- ["EEC6",0x9487],
- ["D5EB",0x9488],
- ["B6A4",0x9489],
- ["EEC8",0x948A],
- ["EEC7",0x948B],
- ["EEC9",0x948C],
- ["EECA",0x948D],
- ["C7A5",0x948E],
- ["EECB",0x948F],
- ["EECC",0x9490],
- ["E895",0x9491],
- ["B7B0",0x9492],
- ["B5F6",0x9493],
- ["EECD",0x9494],
- ["EECF",0x9495],
- ["E896",0x9496],
- ["EECE",0x9497],
- ["E897",0x9498],
- ["B8C6",0x9499],
- ["EED0",0x949A],
- ["EED1",0x949B],
- ["EED2",0x949C],
- ["B6DB",0x949D],
- ["B3AE",0x949E],
- ["D6D3",0x949F],
- ["C4C6",0x94A0],
- ["B1B5",0x94A1],
- ["B8D6",0x94A2],
- ["EED3",0x94A3],
- ["EED4",0x94A4],
- ["D4BF",0x94A5],
- ["C7D5",0x94A6],
- ["BEFB",0x94A7],
- ["CED9",0x94A8],
- ["B9B3",0x94A9],
- ["EED6",0x94AA],
- ["EED5",0x94AB],
- ["EED8",0x94AC],
- ["EED7",0x94AD],
- ["C5A5",0x94AE],
- ["EED9",0x94AF],
- ["EEDA",0x94B0],
- ["C7AE",0x94B1],
- ["EEDB",0x94B2],
- ["C7AF",0x94B3],
- ["EEDC",0x94B4],
- ["B2A7",0x94B5],
- ["EEDD",0x94B6],
- ["EEDE",0x94B7],
- ["EEDF",0x94B8],
- ["EEE0",0x94B9],
- ["EEE1",0x94BA],
- ["D7EA",0x94BB],
- ["EEE2",0x94BC],
- ["EEE3",0x94BD],
- ["BCD8",0x94BE],
- ["EEE4",0x94BF],
- ["D3CB",0x94C0],
- ["CCFA",0x94C1],
- ["B2AC",0x94C2],
- ["C1E5",0x94C3],
- ["EEE5",0x94C4],
- ["C7A6",0x94C5],
- ["C3AD",0x94C6],
- ["E898",0x94C7],
- ["EEE6",0x94C8],
- ["EEE7",0x94C9],
- ["EEE8",0x94CA],
- ["EEE9",0x94CB],
- ["EEEA",0x94CC],
- ["EEEB",0x94CD],
- ["EEEC",0x94CE],
- ["E899",0x94CF],
- ["EEED",0x94D0],
- ["EEEE",0x94D1],
- ["EEEF",0x94D2],
- ["E89A",0x94D3],
- ["E89B",0x94D4],
- ["EEF0",0x94D5],
- ["EEF1",0x94D6],
- ["EEF2",0x94D7],
- ["EEF4",0x94D8],
- ["EEF3",0x94D9],
- ["E89C",0x94DA],
- ["EEF5",0x94DB],
- ["CDAD",0x94DC],
- ["C2C1",0x94DD],
- ["EEF6",0x94DE],
- ["EEF7",0x94DF],
- ["EEF8",0x94E0],
- ["D5A1",0x94E1],
- ["EEF9",0x94E2],
- ["CFB3",0x94E3],
- ["EEFA",0x94E4],
- ["EEFB",0x94E5],
- ["E89D",0x94E6],
- ["EEFC",0x94E7],
- ["EEFD",0x94E8],
- ["EFA1",0x94E9],
- ["EEFE",0x94EA],
- ["EFA2",0x94EB],
- ["B8F5",0x94EC],
- ["C3FA",0x94ED],
- ["EFA3",0x94EE],
- ["EFA4",0x94EF],
- ["BDC2",0x94F0],
- ["D2BF",0x94F1],
- ["B2F9",0x94F2],
- ["EFA5",0x94F3],
- ["EFA6",0x94F4],
- ["EFA7",0x94F5],
- ["D2F8",0x94F6],
- ["EFA8",0x94F7],
- ["D6FD",0x94F8],
- ["EFA9",0x94F9],
- ["C6CC",0x94FA],
- ["E89E",0x94FB],
- ["EFAA",0x94FC],
- ["EFAB",0x94FD],
- ["C1B4",0x94FE],
- ["EFAC",0x94FF],
- ["CFFA",0x9500],
- ["CBF8",0x9501],
- ["EFAE",0x9502],
- ["EFAD",0x9503],
- ["B3FA",0x9504],
- ["B9F8",0x9505],
- ["EFAF",0x9506],
- ["EFB0",0x9507],
- ["D0E2",0x9508],
- ["EFB1",0x9509],
- ["EFB2",0x950A],
- ["B7E6",0x950B],
- ["D0BF",0x950C],
- ["EFB3",0x950D],
- ["EFB4",0x950E],
- ["EFB5",0x950F],
- ["C8F1",0x9510],
- ["CCE0",0x9511],
- ["EFB6",0x9512],
- ["EFB7",0x9513],
- ["EFB8",0x9514],
- ["EFB9",0x9515],
- ["EFBA",0x9516],
- ["D5E0",0x9517],
- ["EFBB",0x9518],
- ["B4ED",0x9519],
- ["C3AA",0x951A],
- ["EFBC",0x951B],
- ["E89F",0x951C],
- ["EFBD",0x951D],
- ["EFBE",0x951E],
- ["EFBF",0x951F],
- ["E8A0",0x9520],
- ["CEFD",0x9521],
- ["EFC0",0x9522],
- ["C2E0",0x9523],
- ["B4B8",0x9524],
- ["D7B6",0x9525],
- ["BDF5",0x9526],
- ["E940",0x9527],
- ["CFC7",0x9528],
- ["EFC3",0x9529],
- ["EFC1",0x952A],
- ["EFC2",0x952B],
- ["EFC4",0x952C],
- ["B6A7",0x952D],
- ["BCFC",0x952E],
- ["BEE2",0x952F],
- ["C3CC",0x9530],
- ["EFC5",0x9531],
- ["EFC6",0x9532],
- ["E941",0x9533],
- ["EFC7",0x9534],
- ["EFCF",0x9535],
- ["EFC8",0x9536],
- ["EFC9",0x9537],
- ["EFCA",0x9538],
- ["C7C2",0x9539],
- ["EFF1",0x953A],
- ["B6CD",0x953B],
- ["EFCB",0x953C],
- ["E942",0x953D],
- ["EFCC",0x953E],
- ["EFCD",0x953F],
- ["B6C6",0x9540],
- ["C3BE",0x9541],
- ["EFCE",0x9542],
- ["E943",0x9543],
- ["EFD0",0x9544],
- ["EFD1",0x9545],
- ["EFD2",0x9546],
- ["D5F2",0x9547],
- ["E944",0x9548],
- ["EFD3",0x9549],
- ["C4F7",0x954A],
- ["E945",0x954B],
- ["EFD4",0x954C],
- ["C4F8",0x954D],
- ["EFD5",0x954E],
- ["EFD6",0x954F],
- ["B8E4",0x9550],
- ["B0F7",0x9551],
- ["EFD7",0x9552],
- ["EFD8",0x9553],
- ["EFD9",0x9554],
- ["E946",0x9555],
- ["EFDA",0x9556],
- ["EFDB",0x9557],
- ["EFDC",0x9558],
- ["EFDD",0x9559],
- ["E947",0x955A],
- ["EFDE",0x955B],
- ["BEB5",0x955C],
- ["EFE1",0x955D],
- ["EFDF",0x955E],
- ["EFE0",0x955F],
- ["E948",0x9560],
- ["EFE2",0x9561],
- ["EFE3",0x9562],
- ["C1CD",0x9563],
- ["EFE4",0x9564],
- ["EFE5",0x9565],
- ["EFE6",0x9566],
- ["EFE7",0x9567],
- ["EFE8",0x9568],
- ["EFE9",0x9569],
- ["EFEA",0x956A],
- ["EFEB",0x956B],
- ["EFEC",0x956C],
- ["C0D8",0x956D],
- ["E949",0x956E],
- ["EFED",0x956F],
- ["C1AD",0x9570],
- ["EFEE",0x9571],
- ["EFEF",0x9572],
- ["EFF0",0x9573],
- ["E94A",0x9574],
- ["E94B",0x9575],
- ["CFE2",0x9576],
- ["E94C",0x9577],
- ["E94D",0x9578],
- ["E94E",0x9579],
- ["E94F",0x957A],
- ["E950",0x957B],
- ["E951",0x957C],
- ["E952",0x957D],
- ["E953",0x957E],
- ["B3A4",0x957F],
- ["E954",0x9580],
- ["E955",0x9581],
- ["E956",0x9582],
- ["E957",0x9583],
- ["E958",0x9584],
- ["E959",0x9585],
- ["E95A",0x9586],
- ["E95B",0x9587],
- ["E95C",0x9588],
- ["E95D",0x9589],
- ["E95E",0x958A],
- ["E95F",0x958B],
- ["E960",0x958C],
- ["E961",0x958D],
- ["E962",0x958E],
- ["E963",0x958F],
- ["E964",0x9590],
- ["E965",0x9591],
- ["E966",0x9592],
- ["E967",0x9593],
- ["E968",0x9594],
- ["E969",0x9595],
- ["E96A",0x9596],
- ["E96B",0x9597],
- ["E96C",0x9598],
- ["E96D",0x9599],
- ["E96E",0x959A],
- ["E96F",0x959B],
- ["E970",0x959C],
- ["E971",0x959D],
- ["E972",0x959E],
- ["E973",0x959F],
- ["E974",0x95A0],
- ["E975",0x95A1],
- ["E976",0x95A2],
- ["E977",0x95A3],
- ["E978",0x95A4],
- ["E979",0x95A5],
- ["E97A",0x95A6],
- ["E97B",0x95A7],
- ["E97C",0x95A8],
- ["E97D",0x95A9],
- ["E97E",0x95AA],
- ["E980",0x95AB],
- ["E981",0x95AC],
- ["E982",0x95AD],
- ["E983",0x95AE],
- ["E984",0x95AF],
- ["E985",0x95B0],
- ["E986",0x95B1],
- ["E987",0x95B2],
- ["E988",0x95B3],
- ["E989",0x95B4],
- ["E98A",0x95B5],
- ["E98B",0x95B6],
- ["E98C",0x95B7],
- ["E98D",0x95B8],
- ["E98E",0x95B9],
- ["E98F",0x95BA],
- ["E990",0x95BB],
- ["E991",0x95BC],
- ["E992",0x95BD],
- ["E993",0x95BE],
- ["E994",0x95BF],
- ["E995",0x95C0],
- ["E996",0x95C1],
- ["E997",0x95C2],
- ["E998",0x95C3],
- ["E999",0x95C4],
- ["E99A",0x95C5],
- ["E99B",0x95C6],
- ["E99C",0x95C7],
- ["E99D",0x95C8],
- ["E99E",0x95C9],
- ["E99F",0x95CA],
- ["E9A0",0x95CB],
- ["EA40",0x95CC],
- ["EA41",0x95CD],
- ["EA42",0x95CE],
- ["EA43",0x95CF],
- ["EA44",0x95D0],
- ["EA45",0x95D1],
- ["EA46",0x95D2],
- ["EA47",0x95D3],
- ["EA48",0x95D4],
- ["EA49",0x95D5],
- ["EA4A",0x95D6],
- ["EA4B",0x95D7],
- ["EA4C",0x95D8],
- ["EA4D",0x95D9],
- ["EA4E",0x95DA],
- ["EA4F",0x95DB],
- ["EA50",0x95DC],
- ["EA51",0x95DD],
- ["EA52",0x95DE],
- ["EA53",0x95DF],
- ["EA54",0x95E0],
- ["EA55",0x95E1],
- ["EA56",0x95E2],
- ["EA57",0x95E3],
- ["EA58",0x95E4],
- ["EA59",0x95E5],
- ["EA5A",0x95E6],
- ["EA5B",0x95E7],
- ["C3C5",0x95E8],
- ["E3C5",0x95E9],
- ["C9C1",0x95EA],
- ["E3C6",0x95EB],
- ["EA5C",0x95EC],
- ["B1D5",0x95ED],
- ["CECA",0x95EE],
- ["B4B3",0x95EF],
- ["C8F2",0x95F0],
- ["E3C7",0x95F1],
- ["CFD0",0x95F2],
- ["E3C8",0x95F3],
- ["BCE4",0x95F4],
- ["E3C9",0x95F5],
- ["E3CA",0x95F6],
- ["C3C6",0x95F7],
- ["D5A2",0x95F8],
- ["C4D6",0x95F9],
- ["B9EB",0x95FA],
- ["CEC5",0x95FB],
- ["E3CB",0x95FC],
- ["C3F6",0x95FD],
- ["E3CC",0x95FE],
- ["EA5D",0x95FF],
- ["B7A7",0x9600],
- ["B8F3",0x9601],
- ["BAD2",0x9602],
- ["E3CD",0x9603],
- ["E3CE",0x9604],
- ["D4C4",0x9605],
- ["E3CF",0x9606],
- ["EA5E",0x9607],
- ["E3D0",0x9608],
- ["D1CB",0x9609],
- ["E3D1",0x960A],
- ["E3D2",0x960B],
- ["E3D3",0x960C],
- ["E3D4",0x960D],
- ["D1D6",0x960E],
- ["E3D5",0x960F],
- ["B2FB",0x9610],
- ["C0BB",0x9611],
- ["E3D6",0x9612],
- ["EA5F",0x9613],
- ["C0AB",0x9614],
- ["E3D7",0x9615],
- ["E3D8",0x9616],
- ["E3D9",0x9617],
- ["EA60",0x9618],
- ["E3DA",0x9619],
- ["E3DB",0x961A],
- ["EA61",0x961B],
- ["B8B7",0x961C],
- ["DAE2",0x961D],
- ["EA62",0x961E],
- ["B6D3",0x961F],
- ["EA63",0x9620],
- ["DAE4",0x9621],
- ["DAE3",0x9622],
- ["EA64",0x9623],
- ["EA65",0x9624],
- ["EA66",0x9625],
- ["EA67",0x9626],
- ["EA68",0x9627],
- ["EA69",0x9628],
- ["EA6A",0x9629],
- ["DAE6",0x962A],
- ["EA6B",0x962B],
- ["EA6C",0x962C],
- ["EA6D",0x962D],
- ["C8EE",0x962E],
- ["EA6E",0x962F],
- ["EA6F",0x9630],
- ["DAE5",0x9631],
- ["B7C0",0x9632],
- ["D1F4",0x9633],
- ["D2F5",0x9634],
- ["D5F3",0x9635],
- ["BDD7",0x9636],
- ["EA70",0x9637],
- ["EA71",0x9638],
- ["EA72",0x9639],
- ["EA73",0x963A],
- ["D7E8",0x963B],
- ["DAE8",0x963C],
- ["DAE7",0x963D],
- ["EA74",0x963E],
- ["B0A2",0x963F],
- ["CDD3",0x9640],
- ["EA75",0x9641],
- ["DAE9",0x9642],
- ["EA76",0x9643],
- ["B8BD",0x9644],
- ["BCCA",0x9645],
- ["C2BD",0x9646],
- ["C2A4",0x9647],
- ["B3C2",0x9648],
- ["DAEA",0x9649],
- ["EA77",0x964A],
- ["C2AA",0x964B],
- ["C4B0",0x964C],
- ["BDB5",0x964D],
- ["EA78",0x964E],
- ["EA79",0x964F],
- ["CFDE",0x9650],
- ["EA7A",0x9651],
- ["EA7B",0x9652],
- ["EA7C",0x9653],
- ["DAEB",0x9654],
- ["C9C2",0x9655],
- ["EA7D",0x9656],
- ["EA7E",0x9657],
- ["EA80",0x9658],
- ["EA81",0x9659],
- ["EA82",0x965A],
- ["B1DD",0x965B],
- ["EA83",0x965C],
- ["EA84",0x965D],
- ["EA85",0x965E],
- ["DAEC",0x965F],
- ["EA86",0x9660],
- ["B6B8",0x9661],
- ["D4BA",0x9662],
- ["EA87",0x9663],
- ["B3FD",0x9664],
- ["EA88",0x9665],
- ["EA89",0x9666],
- ["DAED",0x9667],
- ["D4C9",0x9668],
- ["CFD5",0x9669],
- ["C5E3",0x966A],
- ["EA8A",0x966B],
- ["DAEE",0x966C],
- ["EA8B",0x966D],
- ["EA8C",0x966E],
- ["EA8D",0x966F],
- ["EA8E",0x9670],
- ["EA8F",0x9671],
- ["DAEF",0x9672],
- ["EA90",0x9673],
- ["DAF0",0x9674],
- ["C1EA",0x9675],
- ["CCD5",0x9676],
- ["CFDD",0x9677],
- ["EA91",0x9678],
- ["EA92",0x9679],
- ["EA93",0x967A],
- ["EA94",0x967B],
- ["EA95",0x967C],
- ["EA96",0x967D],
- ["EA97",0x967E],
- ["EA98",0x967F],
- ["EA99",0x9680],
- ["EA9A",0x9681],
- ["EA9B",0x9682],
- ["EA9C",0x9683],
- ["EA9D",0x9684],
- ["D3E7",0x9685],
- ["C2A1",0x9686],
- ["EA9E",0x9687],
- ["DAF1",0x9688],
- ["EA9F",0x9689],
- ["EAA0",0x968A],
- ["CBE5",0x968B],
- ["EB40",0x968C],
- ["DAF2",0x968D],
- ["EB41",0x968E],
- ["CBE6",0x968F],
- ["D2FE",0x9690],
- ["EB42",0x9691],
- ["EB43",0x9692],
- ["EB44",0x9693],
- ["B8F4",0x9694],
- ["EB45",0x9695],
- ["EB46",0x9696],
- ["DAF3",0x9697],
- ["B0AF",0x9698],
- ["CFB6",0x9699],
- ["EB47",0x969A],
- ["EB48",0x969B],
- ["D5CF",0x969C],
- ["EB49",0x969D],
- ["EB4A",0x969E],
- ["EB4B",0x969F],
- ["EB4C",0x96A0],
- ["EB4D",0x96A1],
- ["EB4E",0x96A2],
- ["EB4F",0x96A3],
- ["EB50",0x96A4],
- ["EB51",0x96A5],
- ["EB52",0x96A6],
- ["CBED",0x96A7],
- ["EB53",0x96A8],
- ["EB54",0x96A9],
- ["EB55",0x96AA],
- ["EB56",0x96AB],
- ["EB57",0x96AC],
- ["EB58",0x96AD],
- ["EB59",0x96AE],
- ["EB5A",0x96AF],
- ["DAF4",0x96B0],
- ["EB5B",0x96B1],
- ["EB5C",0x96B2],
- ["E3C4",0x96B3],
- ["EB5D",0x96B4],
- ["EB5E",0x96B5],
- ["C1A5",0x96B6],
- ["EB5F",0x96B7],
- ["EB60",0x96B8],
- ["F6BF",0x96B9],
- ["EB61",0x96BA],
- ["EB62",0x96BB],
- ["F6C0",0x96BC],
- ["F6C1",0x96BD],
- ["C4D1",0x96BE],
- ["EB63",0x96BF],
- ["C8B8",0x96C0],
- ["D1E3",0x96C1],
- ["EB64",0x96C2],
- ["EB65",0x96C3],
- ["D0DB",0x96C4],
- ["D1C5",0x96C5],
- ["BCAF",0x96C6],
- ["B9CD",0x96C7],
- ["EB66",0x96C8],
- ["EFF4",0x96C9],
- ["EB67",0x96CA],
- ["EB68",0x96CB],
- ["B4C6",0x96CC],
- ["D3BA",0x96CD],
- ["F6C2",0x96CE],
- ["B3FB",0x96CF],
- ["EB69",0x96D0],
- ["EB6A",0x96D1],
- ["F6C3",0x96D2],
- ["EB6B",0x96D3],
- ["EB6C",0x96D4],
- ["B5F1",0x96D5],
- ["EB6D",0x96D6],
- ["EB6E",0x96D7],
- ["EB6F",0x96D8],
- ["EB70",0x96D9],
- ["EB71",0x96DA],
- ["EB72",0x96DB],
- ["EB73",0x96DC],
- ["EB74",0x96DD],
- ["EB75",0x96DE],
- ["EB76",0x96DF],
- ["F6C5",0x96E0],
- ["EB77",0x96E1],
- ["EB78",0x96E2],
- ["EB79",0x96E3],
- ["EB7A",0x96E4],
- ["EB7B",0x96E5],
- ["EB7C",0x96E6],
- ["EB7D",0x96E7],
- ["D3EA",0x96E8],
- ["F6A7",0x96E9],
- ["D1A9",0x96EA],
- ["EB7E",0x96EB],
- ["EB80",0x96EC],
- ["EB81",0x96ED],
- ["EB82",0x96EE],
- ["F6A9",0x96EF],
- ["EB83",0x96F0],
- ["EB84",0x96F1],
- ["EB85",0x96F2],
- ["F6A8",0x96F3],
- ["EB86",0x96F4],
- ["EB87",0x96F5],
- ["C1E3",0x96F6],
- ["C0D7",0x96F7],
- ["EB88",0x96F8],
- ["B1A2",0x96F9],
- ["EB89",0x96FA],
- ["EB8A",0x96FB],
- ["EB8B",0x96FC],
- ["EB8C",0x96FD],
- ["CEED",0x96FE],
- ["EB8D",0x96FF],
- ["D0E8",0x9700],
- ["F6AB",0x9701],
- ["EB8E",0x9702],
- ["EB8F",0x9703],
- ["CFF6",0x9704],
- ["EB90",0x9705],
- ["F6AA",0x9706],
- ["D5F0",0x9707],
- ["F6AC",0x9708],
- ["C3B9",0x9709],
- ["EB91",0x970A],
- ["EB92",0x970B],
- ["EB93",0x970C],
- ["BBF4",0x970D],
- ["F6AE",0x970E],
- ["F6AD",0x970F],
- ["EB94",0x9710],
- ["EB95",0x9711],
- ["EB96",0x9712],
- ["C4DE",0x9713],
- ["EB97",0x9714],
- ["EB98",0x9715],
- ["C1D8",0x9716],
- ["EB99",0x9717],
- ["EB9A",0x9718],
- ["EB9B",0x9719],
- ["EB9C",0x971A],
- ["EB9D",0x971B],
- ["CBAA",0x971C],
- ["EB9E",0x971D],
- ["CFBC",0x971E],
- ["EB9F",0x971F],
- ["EBA0",0x9720],
- ["EC40",0x9721],
- ["EC41",0x9722],
- ["EC42",0x9723],
- ["EC43",0x9724],
- ["EC44",0x9725],
- ["EC45",0x9726],
- ["EC46",0x9727],
- ["EC47",0x9728],
- ["EC48",0x9729],
- ["F6AF",0x972A],
- ["EC49",0x972B],
- ["EC4A",0x972C],
- ["F6B0",0x972D],
- ["EC4B",0x972E],
- ["EC4C",0x972F],
- ["F6B1",0x9730],
- ["EC4D",0x9731],
- ["C2B6",0x9732],
- ["EC4E",0x9733],
- ["EC4F",0x9734],
- ["EC50",0x9735],
- ["EC51",0x9736],
- ["EC52",0x9737],
- ["B0D4",0x9738],
- ["C5F9",0x9739],
- ["EC53",0x973A],
- ["EC54",0x973B],
- ["EC55",0x973C],
- ["EC56",0x973D],
- ["F6B2",0x973E],
- ["EC57",0x973F],
- ["EC58",0x9740],
- ["EC59",0x9741],
- ["EC5A",0x9742],
- ["EC5B",0x9743],
- ["EC5C",0x9744],
- ["EC5D",0x9745],
- ["EC5E",0x9746],
- ["EC5F",0x9747],
- ["EC60",0x9748],
- ["EC61",0x9749],
- ["EC62",0x974A],
- ["EC63",0x974B],
- ["EC64",0x974C],
- ["EC65",0x974D],
- ["EC66",0x974E],
- ["EC67",0x974F],
- ["EC68",0x9750],
- ["EC69",0x9751],
- ["C7E0",0x9752],
- ["F6A6",0x9753],
- ["EC6A",0x9754],
- ["EC6B",0x9755],
- ["BEB8",0x9756],
- ["EC6C",0x9757],
- ["EC6D",0x9758],
- ["BEB2",0x9759],
- ["EC6E",0x975A],
- ["B5E5",0x975B],
- ["EC6F",0x975C],
- ["EC70",0x975D],
- ["B7C7",0x975E],
- ["EC71",0x975F],
- ["BFBF",0x9760],
- ["C3D2",0x9761],
- ["C3E6",0x9762],
- ["EC72",0x9763],
- ["EC73",0x9764],
- ["D8CC",0x9765],
- ["EC74",0x9766],
- ["EC75",0x9767],
- ["EC76",0x9768],
- ["B8EF",0x9769],
- ["EC77",0x976A],
- ["EC78",0x976B],
- ["EC79",0x976C],
- ["EC7A",0x976D],
- ["EC7B",0x976E],
- ["EC7C",0x976F],
- ["EC7D",0x9770],
- ["EC7E",0x9771],
- ["EC80",0x9772],
- ["BDF9",0x9773],
- ["D1A5",0x9774],
- ["EC81",0x9775],
- ["B0D0",0x9776],
- ["EC82",0x9777],
- ["EC83",0x9778],
- ["EC84",0x9779],
- ["EC85",0x977A],
- ["EC86",0x977B],
- ["F7B0",0x977C],
- ["EC87",0x977D],
- ["EC88",0x977E],
- ["EC89",0x977F],
- ["EC8A",0x9780],
- ["EC8B",0x9781],
- ["EC8C",0x9782],
- ["EC8D",0x9783],
- ["EC8E",0x9784],
- ["F7B1",0x9785],
- ["EC8F",0x9786],
- ["EC90",0x9787],
- ["EC91",0x9788],
- ["EC92",0x9789],
- ["EC93",0x978A],
- ["D0AC",0x978B],
- ["EC94",0x978C],
- ["B0B0",0x978D],
- ["EC95",0x978E],
- ["EC96",0x978F],
- ["EC97",0x9790],
- ["F7B2",0x9791],
- ["F7B3",0x9792],
- ["EC98",0x9793],
- ["F7B4",0x9794],
- ["EC99",0x9795],
- ["EC9A",0x9796],
- ["EC9B",0x9797],
- ["C7CA",0x9798],
- ["EC9C",0x9799],
- ["EC9D",0x979A],
- ["EC9E",0x979B],
- ["EC9F",0x979C],
- ["ECA0",0x979D],
- ["ED40",0x979E],
- ["ED41",0x979F],
- ["BECF",0x97A0],
- ["ED42",0x97A1],
- ["ED43",0x97A2],
- ["F7B7",0x97A3],
- ["ED44",0x97A4],
- ["ED45",0x97A5],
- ["ED46",0x97A6],
- ["ED47",0x97A7],
- ["ED48",0x97A8],
- ["ED49",0x97A9],
- ["ED4A",0x97AA],
- ["F7B6",0x97AB],
- ["ED4B",0x97AC],
- ["B1DE",0x97AD],
- ["ED4C",0x97AE],
- ["F7B5",0x97AF],
- ["ED4D",0x97B0],
- ["ED4E",0x97B1],
- ["F7B8",0x97B2],
- ["ED4F",0x97B3],
- ["F7B9",0x97B4],
- ["ED50",0x97B5],
- ["ED51",0x97B6],
- ["ED52",0x97B7],
- ["ED53",0x97B8],
- ["ED54",0x97B9],
- ["ED55",0x97BA],
- ["ED56",0x97BB],
- ["ED57",0x97BC],
- ["ED58",0x97BD],
- ["ED59",0x97BE],
- ["ED5A",0x97BF],
- ["ED5B",0x97C0],
- ["ED5C",0x97C1],
- ["ED5D",0x97C2],
- ["ED5E",0x97C3],
- ["ED5F",0x97C4],
- ["ED60",0x97C5],
- ["ED61",0x97C6],
- ["ED62",0x97C7],
- ["ED63",0x97C8],
- ["ED64",0x97C9],
- ["ED65",0x97CA],
- ["ED66",0x97CB],
- ["ED67",0x97CC],
- ["ED68",0x97CD],
- ["ED69",0x97CE],
- ["ED6A",0x97CF],
- ["ED6B",0x97D0],
- ["ED6C",0x97D1],
- ["ED6D",0x97D2],
- ["ED6E",0x97D3],
- ["ED6F",0x97D4],
- ["ED70",0x97D5],
- ["ED71",0x97D6],
- ["ED72",0x97D7],
- ["ED73",0x97D8],
- ["ED74",0x97D9],
- ["ED75",0x97DA],
- ["ED76",0x97DB],
- ["ED77",0x97DC],
- ["ED78",0x97DD],
- ["ED79",0x97DE],
- ["ED7A",0x97DF],
- ["ED7B",0x97E0],
- ["ED7C",0x97E1],
- ["ED7D",0x97E2],
- ["ED7E",0x97E3],
- ["ED80",0x97E4],
- ["ED81",0x97E5],
- ["CEA4",0x97E6],
- ["C8CD",0x97E7],
- ["ED82",0x97E8],
- ["BAAB",0x97E9],
- ["E8B8",0x97EA],
- ["E8B9",0x97EB],
- ["E8BA",0x97EC],
- ["BEC2",0x97ED],
- ["ED83",0x97EE],
- ["ED84",0x97EF],
- ["ED85",0x97F0],
- ["ED86",0x97F1],
- ["ED87",0x97F2],
- ["D2F4",0x97F3],
- ["ED88",0x97F4],
- ["D4CF",0x97F5],
- ["C9D8",0x97F6],
- ["ED89",0x97F7],
- ["ED8A",0x97F8],
- ["ED8B",0x97F9],
- ["ED8C",0x97FA],
- ["ED8D",0x97FB],
- ["ED8E",0x97FC],
- ["ED8F",0x97FD],
- ["ED90",0x97FE],
- ["ED91",0x97FF],
- ["ED92",0x9800],
- ["ED93",0x9801],
- ["ED94",0x9802],
- ["ED95",0x9803],
- ["ED96",0x9804],
- ["ED97",0x9805],
- ["ED98",0x9806],
- ["ED99",0x9807],
- ["ED9A",0x9808],
- ["ED9B",0x9809],
- ["ED9C",0x980A],
- ["ED9D",0x980B],
- ["ED9E",0x980C],
- ["ED9F",0x980D],
- ["EDA0",0x980E],
- ["EE40",0x980F],
- ["EE41",0x9810],
- ["EE42",0x9811],
- ["EE43",0x9812],
- ["EE44",0x9813],
- ["EE45",0x9814],
- ["EE46",0x9815],
- ["EE47",0x9816],
- ["EE48",0x9817],
- ["EE49",0x9818],
- ["EE4A",0x9819],
- ["EE4B",0x981A],
- ["EE4C",0x981B],
- ["EE4D",0x981C],
- ["EE4E",0x981D],
- ["EE4F",0x981E],
- ["EE50",0x981F],
- ["EE51",0x9820],
- ["EE52",0x9821],
- ["EE53",0x9822],
- ["EE54",0x9823],
- ["EE55",0x9824],
- ["EE56",0x9825],
- ["EE57",0x9826],
- ["EE58",0x9827],
- ["EE59",0x9828],
- ["EE5A",0x9829],
- ["EE5B",0x982A],
- ["EE5C",0x982B],
- ["EE5D",0x982C],
- ["EE5E",0x982D],
- ["EE5F",0x982E],
- ["EE60",0x982F],
- ["EE61",0x9830],
- ["EE62",0x9831],
- ["EE63",0x9832],
- ["EE64",0x9833],
- ["EE65",0x9834],
- ["EE66",0x9835],
- ["EE67",0x9836],
- ["EE68",0x9837],
- ["EE69",0x9838],
- ["EE6A",0x9839],
- ["EE6B",0x983A],
- ["EE6C",0x983B],
- ["EE6D",0x983C],
- ["EE6E",0x983D],
- ["EE6F",0x983E],
- ["EE70",0x983F],
- ["EE71",0x9840],
- ["EE72",0x9841],
- ["EE73",0x9842],
- ["EE74",0x9843],
- ["EE75",0x9844],
- ["EE76",0x9845],
- ["EE77",0x9846],
- ["EE78",0x9847],
- ["EE79",0x9848],
- ["EE7A",0x9849],
- ["EE7B",0x984A],
- ["EE7C",0x984B],
- ["EE7D",0x984C],
- ["EE7E",0x984D],
- ["EE80",0x984E],
- ["EE81",0x984F],
- ["EE82",0x9850],
- ["EE83",0x9851],
- ["EE84",0x9852],
- ["EE85",0x9853],
- ["EE86",0x9854],
- ["EE87",0x9855],
- ["EE88",0x9856],
- ["EE89",0x9857],
- ["EE8A",0x9858],
- ["EE8B",0x9859],
- ["EE8C",0x985A],
- ["EE8D",0x985B],
- ["EE8E",0x985C],
- ["EE8F",0x985D],
- ["EE90",0x985E],
- ["EE91",0x985F],
- ["EE92",0x9860],
- ["EE93",0x9861],
- ["EE94",0x9862],
- ["EE95",0x9863],
- ["EE96",0x9864],
- ["EE97",0x9865],
- ["EE98",0x9866],
- ["EE99",0x9867],
- ["EE9A",0x9868],
- ["EE9B",0x9869],
- ["EE9C",0x986A],
- ["EE9D",0x986B],
- ["EE9E",0x986C],
- ["EE9F",0x986D],
- ["EEA0",0x986E],
- ["EF40",0x986F],
- ["EF41",0x9870],
- ["EF42",0x9871],
- ["EF43",0x9872],
- ["EF44",0x9873],
- ["EF45",0x9874],
- ["D2B3",0x9875],
- ["B6A5",0x9876],
- ["C7EA",0x9877],
- ["F1FC",0x9878],
- ["CFEE",0x9879],
- ["CBB3",0x987A],
- ["D0EB",0x987B],
- ["E7EF",0x987C],
- ["CDE7",0x987D],
- ["B9CB",0x987E],
- ["B6D9",0x987F],
- ["F1FD",0x9880],
- ["B0E4",0x9881],
- ["CBCC",0x9882],
- ["F1FE",0x9883],
- ["D4A4",0x9884],
- ["C2AD",0x9885],
- ["C1EC",0x9886],
- ["C6C4",0x9887],
- ["BEB1",0x9888],
- ["F2A1",0x9889],
- ["BCD5",0x988A],
- ["EF46",0x988B],
- ["F2A2",0x988C],
- ["F2A3",0x988D],
- ["EF47",0x988E],
- ["F2A4",0x988F],
- ["D2C3",0x9890],
- ["C6B5",0x9891],
- ["EF48",0x9892],
- ["CDC7",0x9893],
- ["F2A5",0x9894],
- ["EF49",0x9895],
- ["D3B1",0x9896],
- ["BFC5",0x9897],
- ["CCE2",0x9898],
- ["EF4A",0x9899],
- ["F2A6",0x989A],
- ["F2A7",0x989B],
- ["D1D5",0x989C],
- ["B6EE",0x989D],
- ["F2A8",0x989E],
- ["F2A9",0x989F],
- ["B5DF",0x98A0],
- ["F2AA",0x98A1],
- ["F2AB",0x98A2],
- ["EF4B",0x98A3],
- ["B2FC",0x98A4],
- ["F2AC",0x98A5],
- ["F2AD",0x98A6],
- ["C8A7",0x98A7],
- ["EF4C",0x98A8],
- ["EF4D",0x98A9],
- ["EF4E",0x98AA],
- ["EF4F",0x98AB],
- ["EF50",0x98AC],
- ["EF51",0x98AD],
- ["EF52",0x98AE],
- ["EF53",0x98AF],
- ["EF54",0x98B0],
- ["EF55",0x98B1],
- ["EF56",0x98B2],
- ["EF57",0x98B3],
- ["EF58",0x98B4],
- ["EF59",0x98B5],
- ["EF5A",0x98B6],
- ["EF5B",0x98B7],
- ["EF5C",0x98B8],
- ["EF5D",0x98B9],
- ["EF5E",0x98BA],
- ["EF5F",0x98BB],
- ["EF60",0x98BC],
- ["EF61",0x98BD],
- ["EF62",0x98BE],
- ["EF63",0x98BF],
- ["EF64",0x98C0],
- ["EF65",0x98C1],
- ["EF66",0x98C2],
- ["EF67",0x98C3],
- ["EF68",0x98C4],
- ["EF69",0x98C5],
- ["EF6A",0x98C6],
- ["EF6B",0x98C7],
- ["EF6C",0x98C8],
- ["EF6D",0x98C9],
- ["EF6E",0x98CA],
- ["EF6F",0x98CB],
- ["EF70",0x98CC],
- ["EF71",0x98CD],
- ["B7E7",0x98CE],
- ["EF72",0x98CF],
- ["EF73",0x98D0],
- ["ECA9",0x98D1],
- ["ECAA",0x98D2],
- ["ECAB",0x98D3],
- ["EF74",0x98D4],
- ["ECAC",0x98D5],
- ["EF75",0x98D6],
- ["EF76",0x98D7],
- ["C6AE",0x98D8],
- ["ECAD",0x98D9],
- ["ECAE",0x98DA],
- ["EF77",0x98DB],
- ["EF78",0x98DC],
- ["EF79",0x98DD],
- ["B7C9",0x98DE],
- ["CAB3",0x98DF],
- ["EF7A",0x98E0],
- ["EF7B",0x98E1],
- ["EF7C",0x98E2],
- ["EF7D",0x98E3],
- ["EF7E",0x98E4],
- ["EF80",0x98E5],
- ["EF81",0x98E6],
- ["E2B8",0x98E7],
- ["F7CF",0x98E8],
- ["EF82",0x98E9],
- ["EF83",0x98EA],
- ["EF84",0x98EB],
- ["EF85",0x98EC],
- ["EF86",0x98ED],
- ["EF87",0x98EE],
- ["EF88",0x98EF],
- ["EF89",0x98F0],
- ["EF8A",0x98F1],
- ["EF8B",0x98F2],
- ["EF8C",0x98F3],
- ["EF8D",0x98F4],
- ["EF8E",0x98F5],
- ["EF8F",0x98F6],
- ["EF90",0x98F7],
- ["EF91",0x98F8],
- ["EF92",0x98F9],
- ["EF93",0x98FA],
- ["EF94",0x98FB],
- ["EF95",0x98FC],
- ["EF96",0x98FD],
- ["EF97",0x98FE],
- ["EF98",0x98FF],
- ["EF99",0x9900],
- ["EF9A",0x9901],
- ["EF9B",0x9902],
- ["EF9C",0x9903],
- ["EF9D",0x9904],
- ["EF9E",0x9905],
- ["EF9F",0x9906],
- ["EFA0",0x9907],
- ["F040",0x9908],
- ["F041",0x9909],
- ["F042",0x990A],
- ["F043",0x990B],
- ["F044",0x990C],
- ["F7D0",0x990D],
- ["F045",0x990E],
- ["F046",0x990F],
- ["B2CD",0x9910],
- ["F047",0x9911],
- ["F048",0x9912],
- ["F049",0x9913],
- ["F04A",0x9914],
- ["F04B",0x9915],
- ["F04C",0x9916],
- ["F04D",0x9917],
- ["F04E",0x9918],
- ["F04F",0x9919],
- ["F050",0x991A],
- ["F051",0x991B],
- ["F052",0x991C],
- ["F053",0x991D],
- ["F054",0x991E],
- ["F055",0x991F],
- ["F056",0x9920],
- ["F057",0x9921],
- ["F058",0x9922],
- ["F059",0x9923],
- ["F05A",0x9924],
- ["F05B",0x9925],
- ["F05C",0x9926],
- ["F05D",0x9927],
- ["F05E",0x9928],
- ["F05F",0x9929],
- ["F060",0x992A],
- ["F061",0x992B],
- ["F062",0x992C],
- ["F063",0x992D],
- ["F7D1",0x992E],
- ["F064",0x992F],
- ["F065",0x9930],
- ["F066",0x9931],
- ["F067",0x9932],
- ["F068",0x9933],
- ["F069",0x9934],
- ["F06A",0x9935],
- ["F06B",0x9936],
- ["F06C",0x9937],
- ["F06D",0x9938],
- ["F06E",0x9939],
- ["F06F",0x993A],
- ["F070",0x993B],
- ["F071",0x993C],
- ["F072",0x993D],
- ["F073",0x993E],
- ["F074",0x993F],
- ["F075",0x9940],
- ["F076",0x9941],
- ["F077",0x9942],
- ["F078",0x9943],
- ["F079",0x9944],
- ["F07A",0x9945],
- ["F07B",0x9946],
- ["F07C",0x9947],
- ["F07D",0x9948],
- ["F07E",0x9949],
- ["F080",0x994A],
- ["F081",0x994B],
- ["F082",0x994C],
- ["F083",0x994D],
- ["F084",0x994E],
- ["F085",0x994F],
- ["F086",0x9950],
- ["F087",0x9951],
- ["F088",0x9952],
- ["F089",0x9953],
- ["F7D3",0x9954],
- ["F7D2",0x9955],
- ["F08A",0x9956],
- ["F08B",0x9957],
- ["F08C",0x9958],
- ["F08D",0x9959],
- ["F08E",0x995A],
- ["F08F",0x995B],
- ["F090",0x995C],
- ["F091",0x995D],
- ["F092",0x995E],
- ["F093",0x995F],
- ["F094",0x9960],
- ["F095",0x9961],
- ["F096",0x9962],
- ["E2BB",0x9963],
- ["F097",0x9964],
- ["BCA2",0x9965],
- ["F098",0x9966],
- ["E2BC",0x9967],
- ["E2BD",0x9968],
- ["E2BE",0x9969],
- ["E2BF",0x996A],
- ["E2C0",0x996B],
- ["E2C1",0x996C],
- ["B7B9",0x996D],
- ["D2FB",0x996E],
- ["BDA4",0x996F],
- ["CACE",0x9970],
- ["B1A5",0x9971],
- ["CBC7",0x9972],
- ["F099",0x9973],
- ["E2C2",0x9974],
- ["B6FC",0x9975],
- ["C8C4",0x9976],
- ["E2C3",0x9977],
- ["F09A",0x9978],
- ["F09B",0x9979],
- ["BDC8",0x997A],
- ["F09C",0x997B],
- ["B1FD",0x997C],
- ["E2C4",0x997D],
- ["F09D",0x997E],
- ["B6F6",0x997F],
- ["E2C5",0x9980],
- ["C4D9",0x9981],
- ["F09E",0x9982],
- ["F09F",0x9983],
- ["E2C6",0x9984],
- ["CFDA",0x9985],
- ["B9DD",0x9986],
- ["E2C7",0x9987],
- ["C0A1",0x9988],
- ["F0A0",0x9989],
- ["E2C8",0x998A],
- ["B2F6",0x998B],
- ["F140",0x998C],
- ["E2C9",0x998D],
- ["F141",0x998E],
- ["C1F3",0x998F],
- ["E2CA",0x9990],
- ["E2CB",0x9991],
- ["C2F8",0x9992],
- ["E2CC",0x9993],
- ["E2CD",0x9994],
- ["E2CE",0x9995],
- ["CAD7",0x9996],
- ["D8B8",0x9997],
- ["D9E5",0x9998],
- ["CFE3",0x9999],
- ["F142",0x999A],
- ["F143",0x999B],
- ["F144",0x999C],
- ["F145",0x999D],
- ["F146",0x999E],
- ["F147",0x999F],
- ["F148",0x99A0],
- ["F149",0x99A1],
- ["F14A",0x99A2],
- ["F14B",0x99A3],
- ["F14C",0x99A4],
- ["F0A5",0x99A5],
- ["F14D",0x99A6],
- ["F14E",0x99A7],
- ["DCB0",0x99A8],
- ["F14F",0x99A9],
- ["F150",0x99AA],
- ["F151",0x99AB],
- ["F152",0x99AC],
- ["F153",0x99AD],
- ["F154",0x99AE],
- ["F155",0x99AF],
- ["F156",0x99B0],
- ["F157",0x99B1],
- ["F158",0x99B2],
- ["F159",0x99B3],
- ["F15A",0x99B4],
- ["F15B",0x99B5],
- ["F15C",0x99B6],
- ["F15D",0x99B7],
- ["F15E",0x99B8],
- ["F15F",0x99B9],
- ["F160",0x99BA],
- ["F161",0x99BB],
- ["F162",0x99BC],
- ["F163",0x99BD],
- ["F164",0x99BE],
- ["F165",0x99BF],
- ["F166",0x99C0],
- ["F167",0x99C1],
- ["F168",0x99C2],
- ["F169",0x99C3],
- ["F16A",0x99C4],
- ["F16B",0x99C5],
- ["F16C",0x99C6],
- ["F16D",0x99C7],
- ["F16E",0x99C8],
- ["F16F",0x99C9],
- ["F170",0x99CA],
- ["F171",0x99CB],
- ["F172",0x99CC],
- ["F173",0x99CD],
- ["F174",0x99CE],
- ["F175",0x99CF],
- ["F176",0x99D0],
- ["F177",0x99D1],
- ["F178",0x99D2],
- ["F179",0x99D3],
- ["F17A",0x99D4],
- ["F17B",0x99D5],
- ["F17C",0x99D6],
- ["F17D",0x99D7],
- ["F17E",0x99D8],
- ["F180",0x99D9],
- ["F181",0x99DA],
- ["F182",0x99DB],
- ["F183",0x99DC],
- ["F184",0x99DD],
- ["F185",0x99DE],
- ["F186",0x99DF],
- ["F187",0x99E0],
- ["F188",0x99E1],
- ["F189",0x99E2],
- ["F18A",0x99E3],
- ["F18B",0x99E4],
- ["F18C",0x99E5],
- ["F18D",0x99E6],
- ["F18E",0x99E7],
- ["F18F",0x99E8],
- ["F190",0x99E9],
- ["F191",0x99EA],
- ["F192",0x99EB],
- ["F193",0x99EC],
- ["F194",0x99ED],
- ["F195",0x99EE],
- ["F196",0x99EF],
- ["F197",0x99F0],
- ["F198",0x99F1],
- ["F199",0x99F2],
- ["F19A",0x99F3],
- ["F19B",0x99F4],
- ["F19C",0x99F5],
- ["F19D",0x99F6],
- ["F19E",0x99F7],
- ["F19F",0x99F8],
- ["F1A0",0x99F9],
- ["F240",0x99FA],
- ["F241",0x99FB],
- ["F242",0x99FC],
- ["F243",0x99FD],
- ["F244",0x99FE],
- ["F245",0x99FF],
- ["F246",0x9A00],
- ["F247",0x9A01],
- ["F248",0x9A02],
- ["F249",0x9A03],
- ["F24A",0x9A04],
- ["F24B",0x9A05],
- ["F24C",0x9A06],
- ["F24D",0x9A07],
- ["F24E",0x9A08],
- ["F24F",0x9A09],
- ["F250",0x9A0A],
- ["F251",0x9A0B],
- ["F252",0x9A0C],
- ["F253",0x9A0D],
- ["F254",0x9A0E],
- ["F255",0x9A0F],
- ["F256",0x9A10],
- ["F257",0x9A11],
- ["F258",0x9A12],
- ["F259",0x9A13],
- ["F25A",0x9A14],
- ["F25B",0x9A15],
- ["F25C",0x9A16],
- ["F25D",0x9A17],
- ["F25E",0x9A18],
- ["F25F",0x9A19],
- ["F260",0x9A1A],
- ["F261",0x9A1B],
- ["F262",0x9A1C],
- ["F263",0x9A1D],
- ["F264",0x9A1E],
- ["F265",0x9A1F],
- ["F266",0x9A20],
- ["F267",0x9A21],
- ["F268",0x9A22],
- ["F269",0x9A23],
- ["F26A",0x9A24],
- ["F26B",0x9A25],
- ["F26C",0x9A26],
- ["F26D",0x9A27],
- ["F26E",0x9A28],
- ["F26F",0x9A29],
- ["F270",0x9A2A],
- ["F271",0x9A2B],
- ["F272",0x9A2C],
- ["F273",0x9A2D],
- ["F274",0x9A2E],
- ["F275",0x9A2F],
- ["F276",0x9A30],
- ["F277",0x9A31],
- ["F278",0x9A32],
- ["F279",0x9A33],
- ["F27A",0x9A34],
- ["F27B",0x9A35],
- ["F27C",0x9A36],
- ["F27D",0x9A37],
- ["F27E",0x9A38],
- ["F280",0x9A39],
- ["F281",0x9A3A],
- ["F282",0x9A3B],
- ["F283",0x9A3C],
- ["F284",0x9A3D],
- ["F285",0x9A3E],
- ["F286",0x9A3F],
- ["F287",0x9A40],
- ["F288",0x9A41],
- ["F289",0x9A42],
- ["F28A",0x9A43],
- ["F28B",0x9A44],
- ["F28C",0x9A45],
- ["F28D",0x9A46],
- ["F28E",0x9A47],
- ["F28F",0x9A48],
- ["F290",0x9A49],
- ["F291",0x9A4A],
- ["F292",0x9A4B],
- ["F293",0x9A4C],
- ["F294",0x9A4D],
- ["F295",0x9A4E],
- ["F296",0x9A4F],
- ["F297",0x9A50],
- ["F298",0x9A51],
- ["F299",0x9A52],
- ["F29A",0x9A53],
- ["F29B",0x9A54],
- ["F29C",0x9A55],
- ["F29D",0x9A56],
- ["F29E",0x9A57],
- ["F29F",0x9A58],
- ["F2A0",0x9A59],
- ["F340",0x9A5A],
- ["F341",0x9A5B],
- ["F342",0x9A5C],
- ["F343",0x9A5D],
- ["F344",0x9A5E],
- ["F345",0x9A5F],
- ["F346",0x9A60],
- ["F347",0x9A61],
- ["F348",0x9A62],
- ["F349",0x9A63],
- ["F34A",0x9A64],
- ["F34B",0x9A65],
- ["F34C",0x9A66],
- ["F34D",0x9A67],
- ["F34E",0x9A68],
- ["F34F",0x9A69],
- ["F350",0x9A6A],
- ["F351",0x9A6B],
- ["C2ED",0x9A6C],
- ["D4A6",0x9A6D],
- ["CDD4",0x9A6E],
- ["D1B1",0x9A6F],
- ["B3DB",0x9A70],
- ["C7FD",0x9A71],
- ["F352",0x9A72],
- ["B2B5",0x9A73],
- ["C2BF",0x9A74],
- ["E6E0",0x9A75],
- ["CABB",0x9A76],
- ["E6E1",0x9A77],
- ["E6E2",0x9A78],
- ["BED4",0x9A79],
- ["E6E3",0x9A7A],
- ["D7A4",0x9A7B],
- ["CDD5",0x9A7C],
- ["E6E5",0x9A7D],
- ["BCDD",0x9A7E],
- ["E6E4",0x9A7F],
- ["E6E6",0x9A80],
- ["E6E7",0x9A81],
- ["C2EE",0x9A82],
- ["F353",0x9A83],
- ["BDBE",0x9A84],
- ["E6E8",0x9A85],
- ["C2E6",0x9A86],
- ["BAA7",0x9A87],
- ["E6E9",0x9A88],
- ["F354",0x9A89],
- ["E6EA",0x9A8A],
- ["B3D2",0x9A8B],
- ["D1E9",0x9A8C],
- ["F355",0x9A8D],
- ["F356",0x9A8E],
- ["BFA5",0x9A8F],
- ["E6EB",0x9A90],
- ["C6EF",0x9A91],
- ["E6EC",0x9A92],
- ["E6ED",0x9A93],
- ["F357",0x9A94],
- ["F358",0x9A95],
- ["E6EE",0x9A96],
- ["C6AD",0x9A97],
- ["E6EF",0x9A98],
- ["F359",0x9A99],
- ["C9A7",0x9A9A],
- ["E6F0",0x9A9B],
- ["E6F1",0x9A9C],
- ["E6F2",0x9A9D],
- ["E5B9",0x9A9E],
- ["E6F3",0x9A9F],
- ["E6F4",0x9AA0],
- ["C2E2",0x9AA1],
- ["E6F5",0x9AA2],
- ["E6F6",0x9AA3],
- ["D6E8",0x9AA4],
- ["E6F7",0x9AA5],
- ["F35A",0x9AA6],
- ["E6F8",0x9AA7],
- ["B9C7",0x9AA8],
- ["F35B",0x9AA9],
- ["F35C",0x9AAA],
- ["F35D",0x9AAB],
- ["F35E",0x9AAC],
- ["F35F",0x9AAD],
- ["F360",0x9AAE],
- ["F361",0x9AAF],
- ["F7BB",0x9AB0],
- ["F7BA",0x9AB1],
- ["F362",0x9AB2],
- ["F363",0x9AB3],
- ["F364",0x9AB4],
- ["F365",0x9AB5],
- ["F7BE",0x9AB6],
- ["F7BC",0x9AB7],
- ["BAA1",0x9AB8],
- ["F366",0x9AB9],
- ["F7BF",0x9ABA],
- ["F367",0x9ABB],
- ["F7C0",0x9ABC],
- ["F368",0x9ABD],
- ["F369",0x9ABE],
- ["F36A",0x9ABF],
- ["F7C2",0x9AC0],
- ["F7C1",0x9AC1],
- ["F7C4",0x9AC2],
- ["F36B",0x9AC3],
- ["F36C",0x9AC4],
- ["F7C3",0x9AC5],
- ["F36D",0x9AC6],
- ["F36E",0x9AC7],
- ["F36F",0x9AC8],
- ["F370",0x9AC9],
- ["F371",0x9ACA],
- ["F7C5",0x9ACB],
- ["F7C6",0x9ACC],
- ["F372",0x9ACD],
- ["F373",0x9ACE],
- ["F374",0x9ACF],
- ["F375",0x9AD0],
- ["F7C7",0x9AD1],
- ["F376",0x9AD2],
- ["CBE8",0x9AD3],
- ["F377",0x9AD4],
- ["F378",0x9AD5],
- ["F379",0x9AD6],
- ["F37A",0x9AD7],
- ["B8DF",0x9AD8],
- ["F37B",0x9AD9],
- ["F37C",0x9ADA],
- ["F37D",0x9ADB],
- ["F37E",0x9ADC],
- ["F380",0x9ADD],
- ["F381",0x9ADE],
- ["F7D4",0x9ADF],
- ["F382",0x9AE0],
- ["F7D5",0x9AE1],
- ["F383",0x9AE2],
- ["F384",0x9AE3],
- ["F385",0x9AE4],
- ["F386",0x9AE5],
- ["F7D6",0x9AE6],
- ["F387",0x9AE7],
- ["F388",0x9AE8],
- ["F389",0x9AE9],
- ["F38A",0x9AEA],
- ["F7D8",0x9AEB],
- ["F38B",0x9AEC],
- ["F7DA",0x9AED],
- ["F38C",0x9AEE],
- ["F7D7",0x9AEF],
- ["F38D",0x9AF0],
- ["F38E",0x9AF1],
- ["F38F",0x9AF2],
- ["F390",0x9AF3],
- ["F391",0x9AF4],
- ["F392",0x9AF5],
- ["F393",0x9AF6],
- ["F394",0x9AF7],
- ["F395",0x9AF8],
- ["F7DB",0x9AF9],
- ["F396",0x9AFA],
- ["F7D9",0x9AFB],
- ["F397",0x9AFC],
- ["F398",0x9AFD],
- ["F399",0x9AFE],
- ["F39A",0x9AFF],
- ["F39B",0x9B00],
- ["F39C",0x9B01],
- ["F39D",0x9B02],
- ["D7D7",0x9B03],
- ["F39E",0x9B04],
- ["F39F",0x9B05],
- ["F3A0",0x9B06],
- ["F440",0x9B07],
- ["F7DC",0x9B08],
- ["F441",0x9B09],
- ["F442",0x9B0A],
- ["F443",0x9B0B],
- ["F444",0x9B0C],
- ["F445",0x9B0D],
- ["F446",0x9B0E],
- ["F7DD",0x9B0F],
- ["F447",0x9B10],
- ["F448",0x9B11],
- ["F449",0x9B12],
- ["F7DE",0x9B13],
- ["F44A",0x9B14],
- ["F44B",0x9B15],
- ["F44C",0x9B16],
- ["F44D",0x9B17],
- ["F44E",0x9B18],
- ["F44F",0x9B19],
- ["F450",0x9B1A],
- ["F451",0x9B1B],
- ["F452",0x9B1C],
- ["F453",0x9B1D],
- ["F454",0x9B1E],
- ["F7DF",0x9B1F],
- ["F455",0x9B20],
- ["F456",0x9B21],
- ["F457",0x9B22],
- ["F7E0",0x9B23],
- ["F458",0x9B24],
- ["F459",0x9B25],
- ["F45A",0x9B26],
- ["F45B",0x9B27],
- ["F45C",0x9B28],
- ["F45D",0x9B29],
- ["F45E",0x9B2A],
- ["F45F",0x9B2B],
- ["F460",0x9B2C],
- ["F461",0x9B2D],
- ["F462",0x9B2E],
- ["DBCB",0x9B2F],
- ["F463",0x9B30],
- ["F464",0x9B31],
- ["D8AA",0x9B32],
- ["F465",0x9B33],
- ["F466",0x9B34],
- ["F467",0x9B35],
- ["F468",0x9B36],
- ["F469",0x9B37],
- ["F46A",0x9B38],
- ["F46B",0x9B39],
- ["F46C",0x9B3A],
- ["E5F7",0x9B3B],
- ["B9ED",0x9B3C],
- ["F46D",0x9B3D],
- ["F46E",0x9B3E],
- ["F46F",0x9B3F],
- ["F470",0x9B40],
- ["BFFD",0x9B41],
- ["BBEA",0x9B42],
- ["F7C9",0x9B43],
- ["C6C7",0x9B44],
- ["F7C8",0x9B45],
- ["F471",0x9B46],
- ["F7CA",0x9B47],
- ["F7CC",0x9B48],
- ["F7CB",0x9B49],
- ["F472",0x9B4A],
- ["F473",0x9B4B],
- ["F474",0x9B4C],
- ["F7CD",0x9B4D],
- ["F475",0x9B4E],
- ["CEBA",0x9B4F],
- ["F476",0x9B50],
- ["F7CE",0x9B51],
- ["F477",0x9B52],
- ["F478",0x9B53],
- ["C4A7",0x9B54],
- ["F479",0x9B55],
- ["F47A",0x9B56],
- ["F47B",0x9B57],
- ["F47C",0x9B58],
- ["F47D",0x9B59],
- ["F47E",0x9B5A],
- ["F480",0x9B5B],
- ["F481",0x9B5C],
- ["F482",0x9B5D],
- ["F483",0x9B5E],
- ["F484",0x9B5F],
- ["F485",0x9B60],
- ["F486",0x9B61],
- ["F487",0x9B62],
- ["F488",0x9B63],
- ["F489",0x9B64],
- ["F48A",0x9B65],
- ["F48B",0x9B66],
- ["F48C",0x9B67],
- ["F48D",0x9B68],
- ["F48E",0x9B69],
- ["F48F",0x9B6A],
- ["F490",0x9B6B],
- ["F491",0x9B6C],
- ["F492",0x9B6D],
- ["F493",0x9B6E],
- ["F494",0x9B6F],
- ["F495",0x9B70],
- ["F496",0x9B71],
- ["F497",0x9B72],
- ["F498",0x9B73],
- ["F499",0x9B74],
- ["F49A",0x9B75],
- ["F49B",0x9B76],
- ["F49C",0x9B77],
- ["F49D",0x9B78],
- ["F49E",0x9B79],
- ["F49F",0x9B7A],
- ["F4A0",0x9B7B],
- ["F540",0x9B7C],
- ["F541",0x9B7D],
- ["F542",0x9B7E],
- ["F543",0x9B7F],
- ["F544",0x9B80],
- ["F545",0x9B81],
- ["F546",0x9B82],
- ["F547",0x9B83],
- ["F548",0x9B84],
- ["F549",0x9B85],
- ["F54A",0x9B86],
- ["F54B",0x9B87],
- ["F54C",0x9B88],
- ["F54D",0x9B89],
- ["F54E",0x9B8A],
- ["F54F",0x9B8B],
- ["F550",0x9B8C],
- ["F551",0x9B8D],
- ["F552",0x9B8E],
- ["F553",0x9B8F],
- ["F554",0x9B90],
- ["F555",0x9B91],
- ["F556",0x9B92],
- ["F557",0x9B93],
- ["F558",0x9B94],
- ["F559",0x9B95],
- ["F55A",0x9B96],
- ["F55B",0x9B97],
- ["F55C",0x9B98],
- ["F55D",0x9B99],
- ["F55E",0x9B9A],
- ["F55F",0x9B9B],
- ["F560",0x9B9C],
- ["F561",0x9B9D],
- ["F562",0x9B9E],
- ["F563",0x9B9F],
- ["F564",0x9BA0],
- ["F565",0x9BA1],
- ["F566",0x9BA2],
- ["F567",0x9BA3],
- ["F568",0x9BA4],
- ["F569",0x9BA5],
- ["F56A",0x9BA6],
- ["F56B",0x9BA7],
- ["F56C",0x9BA8],
- ["F56D",0x9BA9],
- ["F56E",0x9BAA],
- ["F56F",0x9BAB],
- ["F570",0x9BAC],
- ["F571",0x9BAD],
- ["F572",0x9BAE],
- ["F573",0x9BAF],
- ["F574",0x9BB0],
- ["F575",0x9BB1],
- ["F576",0x9BB2],
- ["F577",0x9BB3],
- ["F578",0x9BB4],
- ["F579",0x9BB5],
- ["F57A",0x9BB6],
- ["F57B",0x9BB7],
- ["F57C",0x9BB8],
- ["F57D",0x9BB9],
- ["F57E",0x9BBA],
- ["F580",0x9BBB],
- ["F581",0x9BBC],
- ["F582",0x9BBD],
- ["F583",0x9BBE],
- ["F584",0x9BBF],
- ["F585",0x9BC0],
- ["F586",0x9BC1],
- ["F587",0x9BC2],
- ["F588",0x9BC3],
- ["F589",0x9BC4],
- ["F58A",0x9BC5],
- ["F58B",0x9BC6],
- ["F58C",0x9BC7],
- ["F58D",0x9BC8],
- ["F58E",0x9BC9],
- ["F58F",0x9BCA],
- ["F590",0x9BCB],
- ["F591",0x9BCC],
- ["F592",0x9BCD],
- ["F593",0x9BCE],
- ["F594",0x9BCF],
- ["F595",0x9BD0],
- ["F596",0x9BD1],
- ["F597",0x9BD2],
- ["F598",0x9BD3],
- ["F599",0x9BD4],
- ["F59A",0x9BD5],
- ["F59B",0x9BD6],
- ["F59C",0x9BD7],
- ["F59D",0x9BD8],
- ["F59E",0x9BD9],
- ["F59F",0x9BDA],
- ["F5A0",0x9BDB],
- ["F640",0x9BDC],
- ["F641",0x9BDD],
- ["F642",0x9BDE],
- ["F643",0x9BDF],
- ["F644",0x9BE0],
- ["F645",0x9BE1],
- ["F646",0x9BE2],
- ["F647",0x9BE3],
- ["F648",0x9BE4],
- ["F649",0x9BE5],
- ["F64A",0x9BE6],
- ["F64B",0x9BE7],
- ["F64C",0x9BE8],
- ["F64D",0x9BE9],
- ["F64E",0x9BEA],
- ["F64F",0x9BEB],
- ["F650",0x9BEC],
- ["F651",0x9BED],
- ["F652",0x9BEE],
- ["F653",0x9BEF],
- ["F654",0x9BF0],
- ["F655",0x9BF1],
- ["F656",0x9BF2],
- ["F657",0x9BF3],
- ["F658",0x9BF4],
- ["F659",0x9BF5],
- ["F65A",0x9BF6],
- ["F65B",0x9BF7],
- ["F65C",0x9BF8],
- ["F65D",0x9BF9],
- ["F65E",0x9BFA],
- ["F65F",0x9BFB],
- ["F660",0x9BFC],
- ["F661",0x9BFD],
- ["F662",0x9BFE],
- ["F663",0x9BFF],
- ["F664",0x9C00],
- ["F665",0x9C01],
- ["F666",0x9C02],
- ["F667",0x9C03],
- ["F668",0x9C04],
- ["F669",0x9C05],
- ["F66A",0x9C06],
- ["F66B",0x9C07],
- ["F66C",0x9C08],
- ["F66D",0x9C09],
- ["F66E",0x9C0A],
- ["F66F",0x9C0B],
- ["F670",0x9C0C],
- ["F671",0x9C0D],
- ["F672",0x9C0E],
- ["F673",0x9C0F],
- ["F674",0x9C10],
- ["F675",0x9C11],
- ["F676",0x9C12],
- ["F677",0x9C13],
- ["F678",0x9C14],
- ["F679",0x9C15],
- ["F67A",0x9C16],
- ["F67B",0x9C17],
- ["F67C",0x9C18],
- ["F67D",0x9C19],
- ["F67E",0x9C1A],
- ["F680",0x9C1B],
- ["F681",0x9C1C],
- ["F682",0x9C1D],
- ["F683",0x9C1E],
- ["F684",0x9C1F],
- ["F685",0x9C20],
- ["F686",0x9C21],
- ["F687",0x9C22],
- ["F688",0x9C23],
- ["F689",0x9C24],
- ["F68A",0x9C25],
- ["F68B",0x9C26],
- ["F68C",0x9C27],
- ["F68D",0x9C28],
- ["F68E",0x9C29],
- ["F68F",0x9C2A],
- ["F690",0x9C2B],
- ["F691",0x9C2C],
- ["F692",0x9C2D],
- ["F693",0x9C2E],
- ["F694",0x9C2F],
- ["F695",0x9C30],
- ["F696",0x9C31],
- ["F697",0x9C32],
- ["F698",0x9C33],
- ["F699",0x9C34],
- ["F69A",0x9C35],
- ["F69B",0x9C36],
- ["F69C",0x9C37],
- ["F69D",0x9C38],
- ["F69E",0x9C39],
- ["F69F",0x9C3A],
- ["F6A0",0x9C3B],
- ["F740",0x9C3C],
- ["F741",0x9C3D],
- ["F742",0x9C3E],
- ["F743",0x9C3F],
- ["F744",0x9C40],
- ["F745",0x9C41],
- ["F746",0x9C42],
- ["F747",0x9C43],
- ["F748",0x9C44],
- ["F749",0x9C45],
- ["F74A",0x9C46],
- ["F74B",0x9C47],
- ["F74C",0x9C48],
- ["F74D",0x9C49],
- ["F74E",0x9C4A],
- ["F74F",0x9C4B],
- ["F750",0x9C4C],
- ["F751",0x9C4D],
- ["F752",0x9C4E],
- ["F753",0x9C4F],
- ["F754",0x9C50],
- ["F755",0x9C51],
- ["F756",0x9C52],
- ["F757",0x9C53],
- ["F758",0x9C54],
- ["F759",0x9C55],
- ["F75A",0x9C56],
- ["F75B",0x9C57],
- ["F75C",0x9C58],
- ["F75D",0x9C59],
- ["F75E",0x9C5A],
- ["F75F",0x9C5B],
- ["F760",0x9C5C],
- ["F761",0x9C5D],
- ["F762",0x9C5E],
- ["F763",0x9C5F],
- ["F764",0x9C60],
- ["F765",0x9C61],
- ["F766",0x9C62],
- ["F767",0x9C63],
- ["F768",0x9C64],
- ["F769",0x9C65],
- ["F76A",0x9C66],
- ["F76B",0x9C67],
- ["F76C",0x9C68],
- ["F76D",0x9C69],
- ["F76E",0x9C6A],
- ["F76F",0x9C6B],
- ["F770",0x9C6C],
- ["F771",0x9C6D],
- ["F772",0x9C6E],
- ["F773",0x9C6F],
- ["F774",0x9C70],
- ["F775",0x9C71],
- ["F776",0x9C72],
- ["F777",0x9C73],
- ["F778",0x9C74],
- ["F779",0x9C75],
- ["F77A",0x9C76],
- ["F77B",0x9C77],
- ["F77C",0x9C78],
- ["F77D",0x9C79],
- ["F77E",0x9C7A],
- ["F780",0x9C7B],
- ["D3E3",0x9C7C],
- ["F781",0x9C7D],
- ["F782",0x9C7E],
- ["F6CF",0x9C7F],
- ["F783",0x9C80],
- ["C2B3",0x9C81],
- ["F6D0",0x9C82],
- ["F784",0x9C83],
- ["F785",0x9C84],
- ["F6D1",0x9C85],
- ["F6D2",0x9C86],
- ["F6D3",0x9C87],
- ["F6D4",0x9C88],
- ["F786",0x9C89],
- ["F787",0x9C8A],
- ["F6D6",0x9C8B],
- ["F788",0x9C8C],
- ["B1AB",0x9C8D],
- ["F6D7",0x9C8E],
- ["F789",0x9C8F],
- ["F6D8",0x9C90],
- ["F6D9",0x9C91],
- ["F6DA",0x9C92],
- ["F78A",0x9C93],
- ["F6DB",0x9C94],
- ["F6DC",0x9C95],
- ["F78B",0x9C96],
- ["F78C",0x9C97],
- ["F78D",0x9C98],
- ["F78E",0x9C99],
- ["F6DD",0x9C9A],
- ["F6DE",0x9C9B],
- ["CFCA",0x9C9C],
- ["F78F",0x9C9D],
- ["F6DF",0x9C9E],
- ["F6E0",0x9C9F],
- ["F6E1",0x9CA0],
- ["F6E2",0x9CA1],
- ["F6E3",0x9CA2],
- ["F6E4",0x9CA3],
- ["C0F0",0x9CA4],
- ["F6E5",0x9CA5],
- ["F6E6",0x9CA6],
- ["F6E7",0x9CA7],
- ["F6E8",0x9CA8],
- ["F6E9",0x9CA9],
- ["F790",0x9CAA],
- ["F6EA",0x9CAB],
- ["F791",0x9CAC],
- ["F6EB",0x9CAD],
- ["F6EC",0x9CAE],
- ["F792",0x9CAF],
- ["F6ED",0x9CB0],
- ["F6EE",0x9CB1],
- ["F6EF",0x9CB2],
- ["F6F0",0x9CB3],
- ["F6F1",0x9CB4],
- ["F6F2",0x9CB5],
- ["F6F3",0x9CB6],
- ["F6F4",0x9CB7],
- ["BEA8",0x9CB8],
- ["F793",0x9CB9],
- ["F6F5",0x9CBA],
- ["F6F6",0x9CBB],
- ["F6F7",0x9CBC],
- ["F6F8",0x9CBD],
- ["F794",0x9CBE],
- ["F795",0x9CBF],
- ["F796",0x9CC0],
- ["F797",0x9CC1],
- ["F798",0x9CC2],
- ["C8FA",0x9CC3],
- ["F6F9",0x9CC4],
- ["F6FA",0x9CC5],
- ["F6FB",0x9CC6],
- ["F6FC",0x9CC7],
- ["F799",0x9CC8],
- ["F79A",0x9CC9],
- ["F6FD",0x9CCA],
- ["F6FE",0x9CCB],
- ["F7A1",0x9CCC],
- ["F7A2",0x9CCD],
- ["F7A3",0x9CCE],
- ["F7A4",0x9CCF],
- ["F7A5",0x9CD0],
- ["F79B",0x9CD1],
- ["F79C",0x9CD2],
- ["F7A6",0x9CD3],
- ["F7A7",0x9CD4],
- ["F7A8",0x9CD5],
- ["B1EE",0x9CD6],
- ["F7A9",0x9CD7],
- ["F7AA",0x9CD8],
- ["F7AB",0x9CD9],
- ["F79D",0x9CDA],
- ["F79E",0x9CDB],
- ["F7AC",0x9CDC],
- ["F7AD",0x9CDD],
- ["C1DB",0x9CDE],
- ["F7AE",0x9CDF],
- ["F79F",0x9CE0],
- ["F7A0",0x9CE1],
- ["F7AF",0x9CE2],
- ["F840",0x9CE3],
- ["F841",0x9CE4],
- ["F842",0x9CE5],
- ["F843",0x9CE6],
- ["F844",0x9CE7],
- ["F845",0x9CE8],
- ["F846",0x9CE9],
- ["F847",0x9CEA],
- ["F848",0x9CEB],
- ["F849",0x9CEC],
- ["F84A",0x9CED],
- ["F84B",0x9CEE],
- ["F84C",0x9CEF],
- ["F84D",0x9CF0],
- ["F84E",0x9CF1],
- ["F84F",0x9CF2],
- ["F850",0x9CF3],
- ["F851",0x9CF4],
- ["F852",0x9CF5],
- ["F853",0x9CF6],
- ["F854",0x9CF7],
- ["F855",0x9CF8],
- ["F856",0x9CF9],
- ["F857",0x9CFA],
- ["F858",0x9CFB],
- ["F859",0x9CFC],
- ["F85A",0x9CFD],
- ["F85B",0x9CFE],
- ["F85C",0x9CFF],
- ["F85D",0x9D00],
- ["F85E",0x9D01],
- ["F85F",0x9D02],
- ["F860",0x9D03],
- ["F861",0x9D04],
- ["F862",0x9D05],
- ["F863",0x9D06],
- ["F864",0x9D07],
- ["F865",0x9D08],
- ["F866",0x9D09],
- ["F867",0x9D0A],
- ["F868",0x9D0B],
- ["F869",0x9D0C],
- ["F86A",0x9D0D],
- ["F86B",0x9D0E],
- ["F86C",0x9D0F],
- ["F86D",0x9D10],
- ["F86E",0x9D11],
- ["F86F",0x9D12],
- ["F870",0x9D13],
- ["F871",0x9D14],
- ["F872",0x9D15],
- ["F873",0x9D16],
- ["F874",0x9D17],
- ["F875",0x9D18],
- ["F876",0x9D19],
- ["F877",0x9D1A],
- ["F878",0x9D1B],
- ["F879",0x9D1C],
- ["F87A",0x9D1D],
- ["F87B",0x9D1E],
- ["F87C",0x9D1F],
- ["F87D",0x9D20],
- ["F87E",0x9D21],
- ["F880",0x9D22],
- ["F881",0x9D23],
- ["F882",0x9D24],
- ["F883",0x9D25],
- ["F884",0x9D26],
- ["F885",0x9D27],
- ["F886",0x9D28],
- ["F887",0x9D29],
- ["F888",0x9D2A],
- ["F889",0x9D2B],
- ["F88A",0x9D2C],
- ["F88B",0x9D2D],
- ["F88C",0x9D2E],
- ["F88D",0x9D2F],
- ["F88E",0x9D30],
- ["F88F",0x9D31],
- ["F890",0x9D32],
- ["F891",0x9D33],
- ["F892",0x9D34],
- ["F893",0x9D35],
- ["F894",0x9D36],
- ["F895",0x9D37],
- ["F896",0x9D38],
- ["F897",0x9D39],
- ["F898",0x9D3A],
- ["F899",0x9D3B],
- ["F89A",0x9D3C],
- ["F89B",0x9D3D],
- ["F89C",0x9D3E],
- ["F89D",0x9D3F],
- ["F89E",0x9D40],
- ["F89F",0x9D41],
- ["F8A0",0x9D42],
- ["F940",0x9D43],
- ["F941",0x9D44],
- ["F942",0x9D45],
- ["F943",0x9D46],
- ["F944",0x9D47],
- ["F945",0x9D48],
- ["F946",0x9D49],
- ["F947",0x9D4A],
- ["F948",0x9D4B],
- ["F949",0x9D4C],
- ["F94A",0x9D4D],
- ["F94B",0x9D4E],
- ["F94C",0x9D4F],
- ["F94D",0x9D50],
- ["F94E",0x9D51],
- ["F94F",0x9D52],
- ["F950",0x9D53],
- ["F951",0x9D54],
- ["F952",0x9D55],
- ["F953",0x9D56],
- ["F954",0x9D57],
- ["F955",0x9D58],
- ["F956",0x9D59],
- ["F957",0x9D5A],
- ["F958",0x9D5B],
- ["F959",0x9D5C],
- ["F95A",0x9D5D],
- ["F95B",0x9D5E],
- ["F95C",0x9D5F],
- ["F95D",0x9D60],
- ["F95E",0x9D61],
- ["F95F",0x9D62],
- ["F960",0x9D63],
- ["F961",0x9D64],
- ["F962",0x9D65],
- ["F963",0x9D66],
- ["F964",0x9D67],
- ["F965",0x9D68],
- ["F966",0x9D69],
- ["F967",0x9D6A],
- ["F968",0x9D6B],
- ["F969",0x9D6C],
- ["F96A",0x9D6D],
- ["F96B",0x9D6E],
- ["F96C",0x9D6F],
- ["F96D",0x9D70],
- ["F96E",0x9D71],
- ["F96F",0x9D72],
- ["F970",0x9D73],
- ["F971",0x9D74],
- ["F972",0x9D75],
- ["F973",0x9D76],
- ["F974",0x9D77],
- ["F975",0x9D78],
- ["F976",0x9D79],
- ["F977",0x9D7A],
- ["F978",0x9D7B],
- ["F979",0x9D7C],
- ["F97A",0x9D7D],
- ["F97B",0x9D7E],
- ["F97C",0x9D7F],
- ["F97D",0x9D80],
- ["F97E",0x9D81],
- ["F980",0x9D82],
- ["F981",0x9D83],
- ["F982",0x9D84],
- ["F983",0x9D85],
- ["F984",0x9D86],
- ["F985",0x9D87],
- ["F986",0x9D88],
- ["F987",0x9D89],
- ["F988",0x9D8A],
- ["F989",0x9D8B],
- ["F98A",0x9D8C],
- ["F98B",0x9D8D],
- ["F98C",0x9D8E],
- ["F98D",0x9D8F],
- ["F98E",0x9D90],
- ["F98F",0x9D91],
- ["F990",0x9D92],
- ["F991",0x9D93],
- ["F992",0x9D94],
- ["F993",0x9D95],
- ["F994",0x9D96],
- ["F995",0x9D97],
- ["F996",0x9D98],
- ["F997",0x9D99],
- ["F998",0x9D9A],
- ["F999",0x9D9B],
- ["F99A",0x9D9C],
- ["F99B",0x9D9D],
- ["F99C",0x9D9E],
- ["F99D",0x9D9F],
- ["F99E",0x9DA0],
- ["F99F",0x9DA1],
- ["F9A0",0x9DA2],
- ["FA40",0x9DA3],
- ["FA41",0x9DA4],
- ["FA42",0x9DA5],
- ["FA43",0x9DA6],
- ["FA44",0x9DA7],
- ["FA45",0x9DA8],
- ["FA46",0x9DA9],
- ["FA47",0x9DAA],
- ["FA48",0x9DAB],
- ["FA49",0x9DAC],
- ["FA4A",0x9DAD],
- ["FA4B",0x9DAE],
- ["FA4C",0x9DAF],
- ["FA4D",0x9DB0],
- ["FA4E",0x9DB1],
- ["FA4F",0x9DB2],
- ["FA50",0x9DB3],
- ["FA51",0x9DB4],
- ["FA52",0x9DB5],
- ["FA53",0x9DB6],
- ["FA54",0x9DB7],
- ["FA55",0x9DB8],
- ["FA56",0x9DB9],
- ["FA57",0x9DBA],
- ["FA58",0x9DBB],
- ["FA59",0x9DBC],
- ["FA5A",0x9DBD],
- ["FA5B",0x9DBE],
- ["FA5C",0x9DBF],
- ["FA5D",0x9DC0],
- ["FA5E",0x9DC1],
- ["FA5F",0x9DC2],
- ["FA60",0x9DC3],
- ["FA61",0x9DC4],
- ["FA62",0x9DC5],
- ["FA63",0x9DC6],
- ["FA64",0x9DC7],
- ["FA65",0x9DC8],
- ["FA66",0x9DC9],
- ["FA67",0x9DCA],
- ["FA68",0x9DCB],
- ["FA69",0x9DCC],
- ["FA6A",0x9DCD],
- ["FA6B",0x9DCE],
- ["FA6C",0x9DCF],
- ["FA6D",0x9DD0],
- ["FA6E",0x9DD1],
- ["FA6F",0x9DD2],
- ["FA70",0x9DD3],
- ["FA71",0x9DD4],
- ["FA72",0x9DD5],
- ["FA73",0x9DD6],
- ["FA74",0x9DD7],
- ["FA75",0x9DD8],
- ["FA76",0x9DD9],
- ["FA77",0x9DDA],
- ["FA78",0x9DDB],
- ["FA79",0x9DDC],
- ["FA7A",0x9DDD],
- ["FA7B",0x9DDE],
- ["FA7C",0x9DDF],
- ["FA7D",0x9DE0],
- ["FA7E",0x9DE1],
- ["FA80",0x9DE2],
- ["FA81",0x9DE3],
- ["FA82",0x9DE4],
- ["FA83",0x9DE5],
- ["FA84",0x9DE6],
- ["FA85",0x9DE7],
- ["FA86",0x9DE8],
- ["FA87",0x9DE9],
- ["FA88",0x9DEA],
- ["FA89",0x9DEB],
- ["FA8A",0x9DEC],
- ["FA8B",0x9DED],
- ["FA8C",0x9DEE],
- ["FA8D",0x9DEF],
- ["FA8E",0x9DF0],
- ["FA8F",0x9DF1],
- ["FA90",0x9DF2],
- ["FA91",0x9DF3],
- ["FA92",0x9DF4],
- ["FA93",0x9DF5],
- ["FA94",0x9DF6],
- ["FA95",0x9DF7],
- ["FA96",0x9DF8],
- ["FA97",0x9DF9],
- ["FA98",0x9DFA],
- ["FA99",0x9DFB],
- ["FA9A",0x9DFC],
- ["FA9B",0x9DFD],
- ["FA9C",0x9DFE],
- ["FA9D",0x9DFF],
- ["FA9E",0x9E00],
- ["FA9F",0x9E01],
- ["FAA0",0x9E02],
- ["FB40",0x9E03],
- ["FB41",0x9E04],
- ["FB42",0x9E05],
- ["FB43",0x9E06],
- ["FB44",0x9E07],
- ["FB45",0x9E08],
- ["FB46",0x9E09],
- ["FB47",0x9E0A],
- ["FB48",0x9E0B],
- ["FB49",0x9E0C],
- ["FB4A",0x9E0D],
- ["FB4B",0x9E0E],
- ["FB4C",0x9E0F],
- ["FB4D",0x9E10],
- ["FB4E",0x9E11],
- ["FB4F",0x9E12],
- ["FB50",0x9E13],
- ["FB51",0x9E14],
- ["FB52",0x9E15],
- ["FB53",0x9E16],
- ["FB54",0x9E17],
- ["FB55",0x9E18],
- ["FB56",0x9E19],
- ["FB57",0x9E1A],
- ["FB58",0x9E1B],
- ["FB59",0x9E1C],
- ["FB5A",0x9E1D],
- ["FB5B",0x9E1E],
- ["C4F1",0x9E1F],
- ["F0AF",0x9E20],
- ["BCA6",0x9E21],
- ["F0B0",0x9E22],
- ["C3F9",0x9E23],
- ["FB5C",0x9E24],
- ["C5B8",0x9E25],
- ["D1BB",0x9E26],
- ["FB5D",0x9E27],
- ["F0B1",0x9E28],
- ["F0B2",0x9E29],
- ["F0B3",0x9E2A],
- ["F0B4",0x9E2B],
- ["F0B5",0x9E2C],
- ["D1BC",0x9E2D],
- ["FB5E",0x9E2E],
- ["D1EC",0x9E2F],
- ["FB5F",0x9E30],
- ["F0B7",0x9E31],
- ["F0B6",0x9E32],
- ["D4A7",0x9E33],
- ["FB60",0x9E34],
- ["CDD2",0x9E35],
- ["F0B8",0x9E36],
- ["F0BA",0x9E37],
- ["F0B9",0x9E38],
- ["F0BB",0x9E39],
- ["F0BC",0x9E3A],
- ["FB61",0x9E3B],
- ["FB62",0x9E3C],
- ["B8EB",0x9E3D],
- ["F0BD",0x9E3E],
- ["BAE8",0x9E3F],
- ["FB63",0x9E40],
- ["F0BE",0x9E41],
- ["F0BF",0x9E42],
- ["BEE9",0x9E43],
- ["F0C0",0x9E44],
- ["B6EC",0x9E45],
- ["F0C1",0x9E46],
- ["F0C2",0x9E47],
- ["F0C3",0x9E48],
- ["F0C4",0x9E49],
- ["C8B5",0x9E4A],
- ["F0C5",0x9E4B],
- ["F0C6",0x9E4C],
- ["FB64",0x9E4D],
- ["F0C7",0x9E4E],
- ["C5F4",0x9E4F],
- ["FB65",0x9E50],
- ["F0C8",0x9E51],
- ["FB66",0x9E52],
- ["FB67",0x9E53],
- ["FB68",0x9E54],
- ["F0C9",0x9E55],
- ["FB69",0x9E56],
- ["F0CA",0x9E57],
- ["F7BD",0x9E58],
- ["FB6A",0x9E59],
- ["F0CB",0x9E5A],
- ["F0CC",0x9E5B],
- ["F0CD",0x9E5C],
- ["FB6B",0x9E5D],
- ["F0CE",0x9E5E],
- ["FB6C",0x9E5F],
- ["FB6D",0x9E60],
- ["FB6E",0x9E61],
- ["FB6F",0x9E62],
- ["F0CF",0x9E63],
- ["BAD7",0x9E64],
- ["FB70",0x9E65],
- ["F0D0",0x9E66],
- ["F0D1",0x9E67],
- ["F0D2",0x9E68],
- ["F0D3",0x9E69],
- ["F0D4",0x9E6A],
- ["F0D5",0x9E6B],
- ["F0D6",0x9E6C],
- ["F0D8",0x9E6D],
- ["FB71",0x9E6E],
- ["FB72",0x9E6F],
- ["D3A5",0x9E70],
- ["F0D7",0x9E71],
- ["FB73",0x9E72],
- ["F0D9",0x9E73],
- ["FB74",0x9E74],
- ["FB75",0x9E75],
- ["FB76",0x9E76],
- ["FB77",0x9E77],
- ["FB78",0x9E78],
- ["FB79",0x9E79],
- ["FB7A",0x9E7A],
- ["FB7B",0x9E7B],
- ["FB7C",0x9E7C],
- ["FB7D",0x9E7D],
- ["F5BA",0x9E7E],
- ["C2B9",0x9E7F],
- ["FB7E",0x9E80],
- ["FB80",0x9E81],
- ["F7E4",0x9E82],
- ["FB81",0x9E83],
- ["FB82",0x9E84],
- ["FB83",0x9E85],
- ["FB84",0x9E86],
- ["F7E5",0x9E87],
- ["F7E6",0x9E88],
- ["FB85",0x9E89],
- ["FB86",0x9E8A],
- ["F7E7",0x9E8B],
- ["FB87",0x9E8C],
- ["FB88",0x9E8D],
- ["FB89",0x9E8E],
- ["FB8A",0x9E8F],
- ["FB8B",0x9E90],
- ["FB8C",0x9E91],
- ["F7E8",0x9E92],
- ["C2B4",0x9E93],
- ["FB8D",0x9E94],
- ["FB8E",0x9E95],
- ["FB8F",0x9E96],
- ["FB90",0x9E97],
- ["FB91",0x9E98],
- ["FB92",0x9E99],
- ["FB93",0x9E9A],
- ["FB94",0x9E9B],
- ["FB95",0x9E9C],
- ["F7EA",0x9E9D],
- ["FB96",0x9E9E],
- ["F7EB",0x9E9F],
- ["FB97",0x9EA0],
- ["FB98",0x9EA1],
- ["FB99",0x9EA2],
- ["FB9A",0x9EA3],
- ["FB9B",0x9EA4],
- ["FB9C",0x9EA5],
- ["C2F3",0x9EA6],
- ["FB9D",0x9EA7],
- ["FB9E",0x9EA8],
- ["FB9F",0x9EA9],
- ["FBA0",0x9EAA],
- ["FC40",0x9EAB],
- ["FC41",0x9EAC],
- ["FC42",0x9EAD],
- ["FC43",0x9EAE],
- ["FC44",0x9EAF],
- ["FC45",0x9EB0],
- ["FC46",0x9EB1],
- ["FC47",0x9EB2],
- ["FC48",0x9EB3],
- ["F4F0",0x9EB4],
- ["FC49",0x9EB5],
- ["FC4A",0x9EB6],
- ["FC4B",0x9EB7],
- ["F4EF",0x9EB8],
- ["FC4C",0x9EB9],
- ["FC4D",0x9EBA],
- ["C2E9",0x9EBB],
- ["FC4E",0x9EBC],
- ["F7E1",0x9EBD],
- ["F7E2",0x9EBE],
- ["FC4F",0x9EBF],
- ["FC50",0x9EC0],
- ["FC51",0x9EC1],
- ["FC52",0x9EC2],
- ["FC53",0x9EC3],
- ["BBC6",0x9EC4],
- ["FC54",0x9EC5],
- ["FC55",0x9EC6],
- ["FC56",0x9EC7],
- ["FC57",0x9EC8],
- ["D9E4",0x9EC9],
- ["FC58",0x9ECA],
- ["FC59",0x9ECB],
- ["FC5A",0x9ECC],
- ["CAF2",0x9ECD],
- ["C0E8",0x9ECE],
- ["F0A4",0x9ECF],
- ["FC5B",0x9ED0],
- ["BADA",0x9ED1],
- ["FC5C",0x9ED2],
- ["FC5D",0x9ED3],
- ["C7AD",0x9ED4],
- ["FC5E",0x9ED5],
- ["FC5F",0x9ED6],
- ["FC60",0x9ED7],
- ["C4AC",0x9ED8],
- ["FC61",0x9ED9],
- ["FC62",0x9EDA],
- ["F7EC",0x9EDB],
- ["F7ED",0x9EDC],
- ["F7EE",0x9EDD],
- ["FC63",0x9EDE],
- ["F7F0",0x9EDF],
- ["F7EF",0x9EE0],
- ["FC64",0x9EE1],
- ["F7F1",0x9EE2],
- ["FC65",0x9EE3],
- ["FC66",0x9EE4],
- ["F7F4",0x9EE5],
- ["FC67",0x9EE6],
- ["F7F3",0x9EE7],
- ["FC68",0x9EE8],
- ["F7F2",0x9EE9],
- ["F7F5",0x9EEA],
- ["FC69",0x9EEB],
- ["FC6A",0x9EEC],
- ["FC6B",0x9EED],
- ["FC6C",0x9EEE],
- ["F7F6",0x9EEF],
- ["FC6D",0x9EF0],
- ["FC6E",0x9EF1],
- ["FC6F",0x9EF2],
- ["FC70",0x9EF3],
- ["FC71",0x9EF4],
- ["FC72",0x9EF5],
- ["FC73",0x9EF6],
- ["FC74",0x9EF7],
- ["FC75",0x9EF8],
- ["EDE9",0x9EF9],
- ["FC76",0x9EFA],
- ["EDEA",0x9EFB],
- ["EDEB",0x9EFC],
- ["FC77",0x9EFD],
- ["F6BC",0x9EFE],
- ["FC78",0x9EFF],
- ["FC79",0x9F00],
- ["FC7A",0x9F01],
- ["FC7B",0x9F02],
- ["FC7C",0x9F03],
- ["FC7D",0x9F04],
- ["FC7E",0x9F05],
- ["FC80",0x9F06],
- ["FC81",0x9F07],
- ["FC82",0x9F08],
- ["FC83",0x9F09],
- ["FC84",0x9F0A],
- ["F6BD",0x9F0B],
- ["FC85",0x9F0C],
- ["F6BE",0x9F0D],
- ["B6A6",0x9F0E],
- ["FC86",0x9F0F],
- ["D8BE",0x9F10],
- ["FC87",0x9F11],
- ["FC88",0x9F12],
- ["B9C4",0x9F13],
- ["FC89",0x9F14],
- ["FC8A",0x9F15],
- ["FC8B",0x9F16],
- ["D8BB",0x9F17],
- ["FC8C",0x9F18],
- ["DCB1",0x9F19],
- ["FC8D",0x9F1A],
- ["FC8E",0x9F1B],
- ["FC8F",0x9F1C],
- ["FC90",0x9F1D],
- ["FC91",0x9F1E],
- ["FC92",0x9F1F],
- ["CAF3",0x9F20],
- ["FC93",0x9F21],
- ["F7F7",0x9F22],
- ["FC94",0x9F23],
- ["FC95",0x9F24],
- ["FC96",0x9F25],
- ["FC97",0x9F26],
- ["FC98",0x9F27],
- ["FC99",0x9F28],
- ["FC9A",0x9F29],
- ["FC9B",0x9F2A],
- ["FC9C",0x9F2B],
- ["F7F8",0x9F2C],
- ["FC9D",0x9F2D],
- ["FC9E",0x9F2E],
- ["F7F9",0x9F2F],
- ["FC9F",0x9F30],
- ["FCA0",0x9F31],
- ["FD40",0x9F32],
- ["FD41",0x9F33],
- ["FD42",0x9F34],
- ["FD43",0x9F35],
- ["FD44",0x9F36],
- ["F7FB",0x9F37],
- ["FD45",0x9F38],
- ["F7FA",0x9F39],
- ["FD46",0x9F3A],
- ["B1C7",0x9F3B],
- ["FD47",0x9F3C],
- ["F7FC",0x9F3D],
- ["F7FD",0x9F3E],
- ["FD48",0x9F3F],
- ["FD49",0x9F40],
- ["FD4A",0x9F41],
- ["FD4B",0x9F42],
- ["FD4C",0x9F43],
- ["F7FE",0x9F44],
- ["FD4D",0x9F45],
- ["FD4E",0x9F46],
- ["FD4F",0x9F47],
- ["FD50",0x9F48],
- ["FD51",0x9F49],
- ["FD52",0x9F4A],
- ["FD53",0x9F4B],
- ["FD54",0x9F4C],
- ["FD55",0x9F4D],
- ["FD56",0x9F4E],
- ["FD57",0x9F4F],
- ["C6EB",0x9F50],
- ["ECB4",0x9F51],
- ["FD58",0x9F52],
- ["FD59",0x9F53],
- ["FD5A",0x9F54],
- ["FD5B",0x9F55],
- ["FD5C",0x9F56],
- ["FD5D",0x9F57],
- ["FD5E",0x9F58],
- ["FD5F",0x9F59],
- ["FD60",0x9F5A],
- ["FD61",0x9F5B],
- ["FD62",0x9F5C],
- ["FD63",0x9F5D],
- ["FD64",0x9F5E],
- ["FD65",0x9F5F],
- ["FD66",0x9F60],
- ["FD67",0x9F61],
- ["FD68",0x9F62],
- ["FD69",0x9F63],
- ["FD6A",0x9F64],
- ["FD6B",0x9F65],
- ["FD6C",0x9F66],
- ["FD6D",0x9F67],
- ["FD6E",0x9F68],
- ["FD6F",0x9F69],
- ["FD70",0x9F6A],
- ["FD71",0x9F6B],
- ["FD72",0x9F6C],
- ["FD73",0x9F6D],
- ["FD74",0x9F6E],
- ["FD75",0x9F6F],
- ["FD76",0x9F70],
- ["FD77",0x9F71],
- ["FD78",0x9F72],
- ["FD79",0x9F73],
- ["FD7A",0x9F74],
- ["FD7B",0x9F75],
- ["FD7C",0x9F76],
- ["FD7D",0x9F77],
- ["FD7E",0x9F78],
- ["FD80",0x9F79],
- ["FD81",0x9F7A],
- ["FD82",0x9F7B],
- ["FD83",0x9F7C],
- ["FD84",0x9F7D],
- ["FD85",0x9F7E],
- ["B3DD",0x9F7F],
- ["F6B3",0x9F80],
- ["FD86",0x9F81],
- ["FD87",0x9F82],
- ["F6B4",0x9F83],
- ["C1E4",0x9F84],
- ["F6B5",0x9F85],
- ["F6B6",0x9F86],
- ["F6B7",0x9F87],
- ["F6B8",0x9F88],
- ["F6B9",0x9F89],
- ["F6BA",0x9F8A],
- ["C8A3",0x9F8B],
- ["F6BB",0x9F8C],
- ["FD88",0x9F8D],
- ["FD89",0x9F8E],
- ["FD8A",0x9F8F],
- ["FD8B",0x9F90],
- ["FD8C",0x9F91],
- ["FD8D",0x9F92],
- ["FD8E",0x9F93],
- ["FD8F",0x9F94],
- ["FD90",0x9F95],
- ["FD91",0x9F96],
- ["FD92",0x9F97],
- ["FD93",0x9F98],
- ["C1FA",0x9F99],
- ["B9A8",0x9F9A],
- ["EDE8",0x9F9B],
- ["FD94",0x9F9C],
- ["FD95",0x9F9D],
- ["FD96",0x9F9E],
- ["B9EA",0x9F9F],
- ["D9DF",0x9FA0],
- ["FD97",0x9FA1],
- ["FD98",0x9FA2],
- ["FD99",0x9FA3],
- ["FD9A",0x9FA4],
- ["FD9B",0x9FA5],
- ["FD9C",0xF92C],
- ["FD9D",0xF979],
- ["FD9E",0xF995],
- ["FD9F",0xF9E7],
- ["FDA0",0xF9F1],
- ["FE40",0xFA0C],
- ["FE41",0xFA0D],
- ["FE42",0xFA0E],
- ["FE43",0xFA0F],
- ["FE44",0xFA11],
- ["FE45",0xFA13],
- ["FE46",0xFA14],
- ["FE47",0xFA18],
- ["FE48",0xFA1F],
- ["FE49",0xFA20],
- ["FE4A",0xFA21],
- ["FE4B",0xFA23],
- ["FE4C",0xFA24],
- ["FE4D",0xFA27],
- ["FE4E",0xFA28],
- ["FE4F",0xFA29],
- ["A955",0xFE30],
- ["A6F2",0xFE31],
- ["A6F4",0xFE33],
- ["A6F5",0xFE34],
- ["A6E0",0xFE35],
- ["A6E1",0xFE36],
- ["A6F0",0xFE37],
- ["A6F1",0xFE38],
- ["A6E2",0xFE39],
- ["A6E3",0xFE3A],
- ["A6EE",0xFE3B],
- ["A6EF",0xFE3C],
- ["A6E6",0xFE3D],
- ["A6E7",0xFE3E],
- ["A6E4",0xFE3F],
- ["A6E5",0xFE40],
- ["A6E8",0xFE41],
- ["A6E9",0xFE42],
- ["A6EA",0xFE43],
- ["A6EB",0xFE44],
- ["A968",0xFE49],
- ["A969",0xFE4A],
- ["A96A",0xFE4B],
- ["A96B",0xFE4C],
- ["A96C",0xFE4D],
- ["A96D",0xFE4E],
- ["A96E",0xFE4F],
- ["A96F",0xFE50],
- ["A970",0xFE51],
- ["A971",0xFE52],
- ["A972",0xFE54],
- ["A973",0xFE55],
- ["A974",0xFE56],
- ["A975",0xFE57],
- ["A976",0xFE59],
- ["A977",0xFE5A],
- ["A978",0xFE5B],
- ["A979",0xFE5C],
- ["A97A",0xFE5D],
- ["A97B",0xFE5E],
- ["A97C",0xFE5F],
- ["A97D",0xFE60],
- ["A97E",0xFE61],
- ["A980",0xFE62],
- ["A981",0xFE63],
- ["A982",0xFE64],
- ["A983",0xFE65],
- ["A984",0xFE66],
- ["A985",0xFE68],
- ["A986",0xFE69],
- ["A987",0xFE6A],
- ["A988",0xFE6B],
- ["A3A1",0xFF01],
- ["A3A2",0xFF02],
- ["A3A3",0xFF03],
- ["A1E7",0xFF04],
- ["A3A5",0xFF05],
- ["A3A6",0xFF06],
- ["A3A7",0xFF07],
- ["A3A8",0xFF08],
- ["A3A9",0xFF09],
- ["A3AA",0xFF0A],
- ["A3AB",0xFF0B],
- ["A3AC",0xFF0C],
- ["A3AD",0xFF0D],
- ["A3AE",0xFF0E],
- ["A3AF",0xFF0F],
- ["A3B0",0xFF10],
- ["A3B1",0xFF11],
- ["A3B2",0xFF12],
- ["A3B3",0xFF13],
- ["A3B4",0xFF14],
- ["A3B5",0xFF15],
- ["A3B6",0xFF16],
- ["A3B7",0xFF17],
- ["A3B8",0xFF18],
- ["A3B9",0xFF19],
- ["A3BA",0xFF1A],
- ["A3BB",0xFF1B],
- ["A3BC",0xFF1C],
- ["A3BD",0xFF1D],
- ["A3BE",0xFF1E],
- ["A3BF",0xFF1F],
- ["A3C0",0xFF20],
- ["A3C1",0xFF21],
- ["A3C2",0xFF22],
- ["A3C3",0xFF23],
- ["A3C4",0xFF24],
- ["A3C5",0xFF25],
- ["A3C6",0xFF26],
- ["A3C7",0xFF27],
- ["A3C8",0xFF28],
- ["A3C9",0xFF29],
- ["A3CA",0xFF2A],
- ["A3CB",0xFF2B],
- ["A3CC",0xFF2C],
- ["A3CD",0xFF2D],
- ["A3CE",0xFF2E],
- ["A3CF",0xFF2F],
- ["A3D0",0xFF30],
- ["A3D1",0xFF31],
- ["A3D2",0xFF32],
- ["A3D3",0xFF33],
- ["A3D4",0xFF34],
- ["A3D5",0xFF35],
- ["A3D6",0xFF36],
- ["A3D7",0xFF37],
- ["A3D8",0xFF38],
- ["A3D9",0xFF39],
- ["A3DA",0xFF3A],
- ["A3DB",0xFF3B],
- ["A3DC",0xFF3C],
- ["A3DD",0xFF3D],
- ["A3DE",0xFF3E],
- ["A3DF",0xFF3F],
- ["A3E0",0xFF40],
- ["A3E1",0xFF41],
- ["A3E2",0xFF42],
- ["A3E3",0xFF43],
- ["A3E4",0xFF44],
- ["A3E5",0xFF45],
- ["A3E6",0xFF46],
- ["A3E7",0xFF47],
- ["A3E8",0xFF48],
- ["A3E9",0xFF49],
- ["A3EA",0xFF4A],
- ["A3EB",0xFF4B],
- ["A3EC",0xFF4C],
- ["A3ED",0xFF4D],
- ["A3EE",0xFF4E],
- ["A3EF",0xFF4F],
- ["A3F0",0xFF50],
- ["A3F1",0xFF51],
- ["A3F2",0xFF52],
- ["A3F3",0xFF53],
- ["A3F4",0xFF54],
- ["A3F5",0xFF55],
- ["A3F6",0xFF56],
- ["A3F7",0xFF57],
- ["A3F8",0xFF58],
- ["A3F9",0xFF59],
- ["A3FA",0xFF5A],
- ["A3FB",0xFF5B],
- ["A3FC",0xFF5C],
- ["A3FD",0xFF5D],
- ["A1AB",0xFF5E],
- ["A1E9",0xFFE0],
- ["A1EA",0xFFE1],
- ["A956",0xFFE2],
- ["A3FE",0xFFE3],
- ["A957",0xFFE4],
- ["A3A4",0xFFE5],
-] \ No newline at end of file
diff --git a/enc/trans/gbk.trans b/enc/trans/gbk.trans
deleted file mode 100644
index 0df148198e..0000000000
--- a/enc/trans/gbk.trans
+++ /dev/null
@@ -1,16 +0,0 @@
-#include "transcode_data.h"
-
-<%
- require "gbk-tbl"
-
- transcode_tblgen "GBK", "UTF-8", [["{00-7f}", :nomap], *GBK_TO_UCS_TBL]
- transcode_tblgen "UTF-8", "GBK", [["{00-7f}", :nomap], *GBK_TO_UCS_TBL.map {|a,b| [b,a] }]
-%>
-
-<%= transcode_generated_code %>
-
-void
-Init_gbk(void)
-{
-<%= transcode_register_code %>
-}
diff --git a/enc/trans/ibm437-tbl.rb b/enc/trans/ibm437-tbl.rb
deleted file mode 100644
index 5ae64d621e..0000000000
--- a/enc/trans/ibm437-tbl.rb
+++ /dev/null
@@ -1,130 +0,0 @@
-IBM437_TO_UCS_TBL = [
- ["FF",0xA0],
- ["AD",0xA1],
- ["9B",0xA2],
- ["9C",0xA3],
- ["9D",0xA5],
- ["A6",0xAA],
- ["AE",0xAB],
- ["AA",0xAC],
- ["F8",0xB0],
- ["F1",0xB1],
- ["FD",0xB2],
- ["E6",0xB5],
- ["FA",0xB7],
- ["A7",0xBA],
- ["AF",0xBB],
- ["AC",0xBC],
- ["AB",0xBD],
- ["A8",0xBF],
- ["8E",0xC4],
- ["8F",0xC5],
- ["92",0xC6],
- ["80",0xC7],
- ["90",0xC9],
- ["A5",0xD1],
- ["99",0xD6],
- ["9A",0xDC],
- ["E1",0xDF],
- ["85",0xE0],
- ["A0",0xE1],
- ["83",0xE2],
- ["84",0xE4],
- ["86",0xE5],
- ["91",0xE6],
- ["87",0xE7],
- ["8A",0xE8],
- ["82",0xE9],
- ["88",0xEA],
- ["89",0xEB],
- ["8D",0xEC],
- ["A1",0xED],
- ["8C",0xEE],
- ["8B",0xEF],
- ["A4",0xF1],
- ["95",0xF2],
- ["A2",0xF3],
- ["93",0xF4],
- ["94",0xF6],
- ["F6",0xF7],
- ["97",0xF9],
- ["A3",0xFA],
- ["96",0xFB],
- ["81",0xFC],
- ["98",0xFF],
- ["9F",0x192],
- ["E2",0x393],
- ["E9",0x398],
- ["E4",0x3A3],
- ["E8",0x3A6],
- ["EA",0x3A9],
- ["E0",0x3B1],
- ["EB",0x3B4],
- ["EE",0x3B5],
- ["E3",0x3C0],
- ["E5",0x3C3],
- ["E7",0x3C4],
- ["ED",0x3C6],
- ["FC",0x207F],
- ["9E",0x20A7],
- ["F9",0x2219],
- ["FB",0x221A],
- ["EC",0x221E],
- ["EF",0x2229],
- ["F7",0x2248],
- ["F0",0x2261],
- ["F3",0x2264],
- ["F2",0x2265],
- ["A9",0x2310],
- ["F4",0x2320],
- ["F5",0x2321],
- ["C4",0x2500],
- ["B3",0x2502],
- ["DA",0x250C],
- ["BF",0x2510],
- ["C0",0x2514],
- ["D9",0x2518],
- ["C3",0x251C],
- ["B4",0x2524],
- ["C2",0x252C],
- ["C1",0x2534],
- ["C5",0x253C],
- ["CD",0x2550],
- ["BA",0x2551],
- ["D5",0x2552],
- ["D6",0x2553],
- ["C9",0x2554],
- ["B8",0x2555],
- ["B7",0x2556],
- ["BB",0x2557],
- ["D4",0x2558],
- ["D3",0x2559],
- ["C8",0x255A],
- ["BE",0x255B],
- ["BD",0x255C],
- ["BC",0x255D],
- ["C6",0x255E],
- ["C7",0x255F],
- ["CC",0x2560],
- ["B5",0x2561],
- ["B6",0x2562],
- ["B9",0x2563],
- ["D1",0x2564],
- ["D2",0x2565],
- ["CB",0x2566],
- ["CF",0x2567],
- ["D0",0x2568],
- ["CA",0x2569],
- ["D8",0x256A],
- ["D7",0x256B],
- ["CE",0x256C],
- ["DF",0x2580],
- ["DC",0x2584],
- ["DB",0x2588],
- ["DD",0x258C],
- ["DE",0x2590],
- ["B0",0x2591],
- ["B1",0x2592],
- ["B2",0x2593],
- ["FE",0x25A0],
-] \ No newline at end of file
diff --git a/enc/trans/ibm775-tbl.rb b/enc/trans/ibm775-tbl.rb
deleted file mode 100644
index f55679f409..0000000000
--- a/enc/trans/ibm775-tbl.rb
+++ /dev/null
@@ -1,130 +0,0 @@
-IBM775_TO_UCS_TBL = [
- ["FF",0xA0],
- ["96",0xA2],
- ["9C",0xA3],
- ["9F",0xA4],
- ["A7",0xA6],
- ["F5",0xA7],
- ["A8",0xA9],
- ["AE",0xAB],
- ["AA",0xAC],
- ["F0",0xAD],
- ["A9",0xAE],
- ["F8",0xB0],
- ["F1",0xB1],
- ["FD",0xB2],
- ["FC",0xB3],
- ["E6",0xB5],
- ["F4",0xB6],
- ["FA",0xB7],
- ["FB",0xB9],
- ["AF",0xBB],
- ["AC",0xBC],
- ["AB",0xBD],
- ["F3",0xBE],
- ["8E",0xC4],
- ["8F",0xC5],
- ["92",0xC6],
- ["90",0xC9],
- ["E0",0xD3],
- ["E5",0xD5],
- ["99",0xD6],
- ["9E",0xD7],
- ["9D",0xD8],
- ["9A",0xDC],
- ["E1",0xDF],
- ["84",0xE4],
- ["86",0xE5],
- ["91",0xE6],
- ["82",0xE9],
- ["A2",0xF3],
- ["E4",0xF5],
- ["94",0xF6],
- ["F6",0xF7],
- ["9B",0xF8],
- ["81",0xFC],
- ["A0",0x100],
- ["83",0x101],
- ["B5",0x104],
- ["D0",0x105],
- ["80",0x106],
- ["87",0x107],
- ["B6",0x10C],
- ["D1",0x10D],
- ["ED",0x112],
- ["89",0x113],
- ["B8",0x116],
- ["D3",0x117],
- ["B7",0x118],
- ["D2",0x119],
- ["95",0x122],
- ["85",0x123],
- ["A1",0x12A],
- ["8C",0x12B],
- ["BD",0x12E],
- ["D4",0x12F],
- ["E8",0x136],
- ["E9",0x137],
- ["EA",0x13B],
- ["EB",0x13C],
- ["AD",0x141],
- ["88",0x142],
- ["E3",0x143],
- ["E7",0x144],
- ["EE",0x145],
- ["EC",0x146],
- ["E2",0x14C],
- ["93",0x14D],
- ["8A",0x156],
- ["8B",0x157],
- ["97",0x15A],
- ["98",0x15B],
- ["BE",0x160],
- ["D5",0x161],
- ["C7",0x16A],
- ["D7",0x16B],
- ["C6",0x172],
- ["D6",0x173],
- ["8D",0x179],
- ["A5",0x17A],
- ["A3",0x17B],
- ["A4",0x17C],
- ["CF",0x17D],
- ["D8",0x17E],
- ["EF",0x2019],
- ["F2",0x201C],
- ["A6",0x201D],
- ["F7",0x201E],
- ["F9",0x2219],
- ["C4",0x2500],
- ["B3",0x2502],
- ["DA",0x250C],
- ["BF",0x2510],
- ["C0",0x2514],
- ["D9",0x2518],
- ["C3",0x251C],
- ["B4",0x2524],
- ["C2",0x252C],
- ["C1",0x2534],
- ["C5",0x253C],
- ["CD",0x2550],
- ["BA",0x2551],
- ["C9",0x2554],
- ["BB",0x2557],
- ["C8",0x255A],
- ["BC",0x255D],
- ["CC",0x2560],
- ["B9",0x2563],
- ["CB",0x2566],
- ["CA",0x2569],
- ["CE",0x256C],
- ["DF",0x2580],
- ["DC",0x2584],
- ["DB",0x2588],
- ["DD",0x258C],
- ["DE",0x2590],
- ["B0",0x2591],
- ["B1",0x2592],
- ["B2",0x2593],
- ["FE",0x25A0],
-] \ No newline at end of file
diff --git a/enc/trans/ibm852-tbl.rb b/enc/trans/ibm852-tbl.rb
deleted file mode 100644
index 6cec51cf80..0000000000
--- a/enc/trans/ibm852-tbl.rb
+++ /dev/null
@@ -1,130 +0,0 @@
-IBM852_TO_UCS_TBL = [
- ["FF",0xA0],
- ["CF",0xA4],
- ["F5",0xA7],
- ["F9",0xA8],
- ["AE",0xAB],
- ["AA",0xAC],
- ["F0",0xAD],
- ["F8",0xB0],
- ["EF",0xB4],
- ["F7",0xB8],
- ["AF",0xBB],
- ["B5",0xC1],
- ["B6",0xC2],
- ["8E",0xC4],
- ["80",0xC7],
- ["90",0xC9],
- ["D3",0xCB],
- ["D6",0xCD],
- ["D7",0xCE],
- ["E0",0xD3],
- ["E2",0xD4],
- ["99",0xD6],
- ["9E",0xD7],
- ["E9",0xDA],
- ["9A",0xDC],
- ["ED",0xDD],
- ["E1",0xDF],
- ["A0",0xE1],
- ["83",0xE2],
- ["84",0xE4],
- ["87",0xE7],
- ["82",0xE9],
- ["89",0xEB],
- ["A1",0xED],
- ["8C",0xEE],
- ["A2",0xF3],
- ["93",0xF4],
- ["94",0xF6],
- ["F6",0xF7],
- ["A3",0xFA],
- ["81",0xFC],
- ["EC",0xFD],
- ["C6",0x102],
- ["C7",0x103],
- ["A4",0x104],
- ["A5",0x105],
- ["8F",0x106],
- ["86",0x107],
- ["AC",0x10C],
- ["9F",0x10D],
- ["D2",0x10E],
- ["D4",0x10F],
- ["D1",0x110],
- ["D0",0x111],
- ["A8",0x118],
- ["A9",0x119],
- ["B7",0x11A],
- ["D8",0x11B],
- ["91",0x139],
- ["92",0x13A],
- ["95",0x13D],
- ["96",0x13E],
- ["9D",0x141],
- ["88",0x142],
- ["E3",0x143],
- ["E4",0x144],
- ["D5",0x147],
- ["E5",0x148],
- ["8A",0x150],
- ["8B",0x151],
- ["E8",0x154],
- ["EA",0x155],
- ["FC",0x158],
- ["FD",0x159],
- ["97",0x15A],
- ["98",0x15B],
- ["B8",0x15E],
- ["AD",0x15F],
- ["E6",0x160],
- ["E7",0x161],
- ["DD",0x162],
- ["EE",0x163],
- ["9B",0x164],
- ["9C",0x165],
- ["DE",0x16E],
- ["85",0x16F],
- ["EB",0x170],
- ["FB",0x171],
- ["8D",0x179],
- ["AB",0x17A],
- ["BD",0x17B],
- ["BE",0x17C],
- ["A6",0x17D],
- ["A7",0x17E],
- ["F3",0x2C7],
- ["F4",0x2D8],
- ["FA",0x2D9],
- ["F2",0x2DB],
- ["F1",0x2DD],
- ["C4",0x2500],
- ["B3",0x2502],
- ["DA",0x250C],
- ["BF",0x2510],
- ["C0",0x2514],
- ["D9",0x2518],
- ["C3",0x251C],
- ["B4",0x2524],
- ["C2",0x252C],
- ["C1",0x2534],
- ["C5",0x253C],
- ["CD",0x2550],
- ["BA",0x2551],
- ["C9",0x2554],
- ["BB",0x2557],
- ["C8",0x255A],
- ["BC",0x255D],
- ["CC",0x2560],
- ["B9",0x2563],
- ["CB",0x2566],
- ["CA",0x2569],
- ["CE",0x256C],
- ["DF",0x2580],
- ["DC",0x2584],
- ["DB",0x2588],
- ["B0",0x2591],
- ["B1",0x2592],
- ["B2",0x2593],
- ["FE",0x25A0],
-] \ No newline at end of file
diff --git a/enc/trans/ibm855-tbl.rb b/enc/trans/ibm855-tbl.rb
deleted file mode 100644
index 7e0cc5014f..0000000000
--- a/enc/trans/ibm855-tbl.rb
+++ /dev/null
@@ -1,130 +0,0 @@
-IBM855_TO_UCS_TBL = [
- ["FF",0xA0],
- ["CF",0xA4],
- ["FD",0xA7],
- ["AE",0xAB],
- ["F0",0xAD],
- ["AF",0xBB],
- ["85",0x401],
- ["81",0x402],
- ["83",0x403],
- ["87",0x404],
- ["89",0x405],
- ["8B",0x406],
- ["8D",0x407],
- ["8F",0x408],
- ["91",0x409],
- ["93",0x40A],
- ["95",0x40B],
- ["97",0x40C],
- ["99",0x40E],
- ["9B",0x40F],
- ["A1",0x410],
- ["A3",0x411],
- ["EC",0x412],
- ["AD",0x413],
- ["A7",0x414],
- ["A9",0x415],
- ["EA",0x416],
- ["F4",0x417],
- ["B8",0x418],
- ["BE",0x419],
- ["C7",0x41A],
- ["D1",0x41B],
- ["D3",0x41C],
- ["D5",0x41D],
- ["D7",0x41E],
- ["DD",0x41F],
- ["E2",0x420],
- ["E4",0x421],
- ["E6",0x422],
- ["E8",0x423],
- ["AB",0x424],
- ["B6",0x425],
- ["A5",0x426],
- ["FC",0x427],
- ["F6",0x428],
- ["FA",0x429],
- ["9F",0x42A],
- ["F2",0x42B],
- ["EE",0x42C],
- ["F8",0x42D],
- ["9D",0x42E],
- ["E0",0x42F],
- ["A0",0x430],
- ["A2",0x431],
- ["EB",0x432],
- ["AC",0x433],
- ["A6",0x434],
- ["A8",0x435],
- ["E9",0x436],
- ["F3",0x437],
- ["B7",0x438],
- ["BD",0x439],
- ["C6",0x43A],
- ["D0",0x43B],
- ["D2",0x43C],
- ["D4",0x43D],
- ["D6",0x43E],
- ["D8",0x43F],
- ["E1",0x440],
- ["E3",0x441],
- ["E5",0x442],
- ["E7",0x443],
- ["AA",0x444],
- ["B5",0x445],
- ["A4",0x446],
- ["FB",0x447],
- ["F5",0x448],
- ["F9",0x449],
- ["9E",0x44A],
- ["F1",0x44B],
- ["ED",0x44C],
- ["F7",0x44D],
- ["9C",0x44E],
- ["DE",0x44F],
- ["84",0x451],
- ["80",0x452],
- ["82",0x453],
- ["86",0x454],
- ["88",0x455],
- ["8A",0x456],
- ["8C",0x457],
- ["8E",0x458],
- ["90",0x459],
- ["92",0x45A],
- ["94",0x45B],
- ["96",0x45C],
- ["98",0x45E],
- ["9A",0x45F],
- ["EF",0x2116],
- ["C4",0x2500],
- ["B3",0x2502],
- ["DA",0x250C],
- ["BF",0x2510],
- ["C0",0x2514],
- ["D9",0x2518],
- ["C3",0x251C],
- ["B4",0x2524],
- ["C2",0x252C],
- ["C1",0x2534],
- ["C5",0x253C],
- ["CD",0x2550],
- ["BA",0x2551],
- ["C9",0x2554],
- ["BB",0x2557],
- ["C8",0x255A],
- ["BC",0x255D],
- ["CC",0x2560],
- ["B9",0x2563],
- ["CB",0x2566],
- ["CA",0x2569],
- ["CE",0x256C],
- ["DF",0x2580],
- ["DC",0x2584],
- ["DB",0x2588],
- ["B0",0x2591],
- ["B1",0x2592],
- ["B2",0x2593],
- ["FE",0x25A0],
-] \ No newline at end of file
diff --git a/enc/trans/ibm857-tbl.rb b/enc/trans/ibm857-tbl.rb
deleted file mode 100644
index 5b20d389d3..0000000000
--- a/enc/trans/ibm857-tbl.rb
+++ /dev/null
@@ -1,127 +0,0 @@
-IBM857_TO_UCS_TBL = [
- ["FF",0xA0],
- ["AD",0xA1],
- ["BD",0xA2],
- ["9C",0xA3],
- ["CF",0xA4],
- ["BE",0xA5],
- ["DD",0xA6],
- ["F5",0xA7],
- ["F9",0xA8],
- ["B8",0xA9],
- ["D1",0xAA],
- ["AE",0xAB],
- ["AA",0xAC],
- ["F0",0xAD],
- ["A9",0xAE],
- ["EE",0xAF],
- ["F8",0xB0],
- ["F1",0xB1],
- ["FD",0xB2],
- ["FC",0xB3],
- ["EF",0xB4],
- ["E6",0xB5],
- ["F4",0xB6],
- ["FA",0xB7],
- ["F7",0xB8],
- ["FB",0xB9],
- ["D0",0xBA],
- ["AF",0xBB],
- ["AC",0xBC],
- ["AB",0xBD],
- ["F3",0xBE],
- ["A8",0xBF],
- ["B7",0xC0],
- ["B5",0xC1],
- ["B6",0xC2],
- ["C7",0xC3],
- ["8E",0xC4],
- ["8F",0xC5],
- ["92",0xC6],
- ["80",0xC7],
- ["D4",0xC8],
- ["90",0xC9],
- ["D2",0xCA],
- ["D3",0xCB],
- ["DE",0xCC],
- ["D6",0xCD],
- ["D7",0xCE],
- ["D8",0xCF],
- ["A5",0xD1],
- ["E3",0xD2],
- ["E0",0xD3],
- ["E2",0xD4],
- ["E5",0xD5],
- ["99",0xD6],
- ["E8",0xD7],
- ["9D",0xD8],
- ["EB",0xD9],
- ["E9",0xDA],
- ["EA",0xDB],
- ["9A",0xDC],
- ["E1",0xDF],
- ["85",0xE0],
- ["A0",0xE1],
- ["83",0xE2],
- ["C6",0xE3],
- ["84",0xE4],
- ["86",0xE5],
- ["91",0xE6],
- ["87",0xE7],
- ["8A",0xE8],
- ["82",0xE9],
- ["88",0xEA],
- ["89",0xEB],
- ["EC",0xEC],
- ["A1",0xED],
- ["8C",0xEE],
- ["8B",0xEF],
- ["A4",0xF1],
- ["95",0xF2],
- ["A2",0xF3],
- ["93",0xF4],
- ["E4",0xF5],
- ["94",0xF6],
- ["F6",0xF7],
- ["9B",0xF8],
- ["97",0xF9],
- ["A3",0xFA],
- ["96",0xFB],
- ["81",0xFC],
- ["ED",0xFF],
- ["A6",0x11E],
- ["A7",0x11F],
- ["98",0x130],
- ["8D",0x131],
- ["9E",0x15E],
- ["9F",0x15F],
- ["C4",0x2500],
- ["B3",0x2502],
- ["DA",0x250C],
- ["BF",0x2510],
- ["C0",0x2514],
- ["D9",0x2518],
- ["C3",0x251C],
- ["B4",0x2524],
- ["C2",0x252C],
- ["C1",0x2534],
- ["C5",0x253C],
- ["CD",0x2550],
- ["BA",0x2551],
- ["C9",0x2554],
- ["BB",0x2557],
- ["C8",0x255A],
- ["BC",0x255D],
- ["CC",0x2560],
- ["B9",0x2563],
- ["CB",0x2566],
- ["CA",0x2569],
- ["CE",0x256C],
- ["DF",0x2580],
- ["DC",0x2584],
- ["DB",0x2588],
- ["B0",0x2591],
- ["B1",0x2592],
- ["B2",0x2593],
- ["FE",0x25A0],
-] \ No newline at end of file
diff --git a/enc/trans/ibm860-tbl.rb b/enc/trans/ibm860-tbl.rb
deleted file mode 100644
index ae218a129f..0000000000
--- a/enc/trans/ibm860-tbl.rb
+++ /dev/null
@@ -1,130 +0,0 @@
-IBM860_TO_UCS_TBL = [
- ["FF",0xA0],
- ["AD",0xA1],
- ["9B",0xA2],
- ["9C",0xA3],
- ["A6",0xAA],
- ["AE",0xAB],
- ["AA",0xAC],
- ["F8",0xB0],
- ["F1",0xB1],
- ["FD",0xB2],
- ["E6",0xB5],
- ["FA",0xB7],
- ["A7",0xBA],
- ["AF",0xBB],
- ["AC",0xBC],
- ["AB",0xBD],
- ["A8",0xBF],
- ["91",0xC0],
- ["86",0xC1],
- ["8F",0xC2],
- ["8E",0xC3],
- ["80",0xC7],
- ["92",0xC8],
- ["90",0xC9],
- ["89",0xCA],
- ["98",0xCC],
- ["8B",0xCD],
- ["A5",0xD1],
- ["A9",0xD2],
- ["9F",0xD3],
- ["8C",0xD4],
- ["99",0xD5],
- ["9D",0xD9],
- ["96",0xDA],
- ["9A",0xDC],
- ["E1",0xDF],
- ["85",0xE0],
- ["A0",0xE1],
- ["83",0xE2],
- ["84",0xE3],
- ["87",0xE7],
- ["8A",0xE8],
- ["82",0xE9],
- ["88",0xEA],
- ["8D",0xEC],
- ["A1",0xED],
- ["A4",0xF1],
- ["95",0xF2],
- ["A2",0xF3],
- ["93",0xF4],
- ["94",0xF5],
- ["F6",0xF7],
- ["97",0xF9],
- ["A3",0xFA],
- ["81",0xFC],
- ["E2",0x393],
- ["E9",0x398],
- ["E4",0x3A3],
- ["E8",0x3A6],
- ["EA",0x3A9],
- ["E0",0x3B1],
- ["EB",0x3B4],
- ["EE",0x3B5],
- ["E3",0x3C0],
- ["E5",0x3C3],
- ["E7",0x3C4],
- ["ED",0x3C6],
- ["FC",0x207F],
- ["9E",0x20A7],
- ["F9",0x2219],
- ["FB",0x221A],
- ["EC",0x221E],
- ["EF",0x2229],
- ["F7",0x2248],
- ["F0",0x2261],
- ["F3",0x2264],
- ["F2",0x2265],
- ["F4",0x2320],
- ["F5",0x2321],
- ["C4",0x2500],
- ["B3",0x2502],
- ["DA",0x250C],
- ["BF",0x2510],
- ["C0",0x2514],
- ["D9",0x2518],
- ["C3",0x251C],
- ["B4",0x2524],
- ["C2",0x252C],
- ["C1",0x2534],
- ["C5",0x253C],
- ["CD",0x2550],
- ["BA",0x2551],
- ["D5",0x2552],
- ["D6",0x2553],
- ["C9",0x2554],
- ["B8",0x2555],
- ["B7",0x2556],
- ["BB",0x2557],
- ["D4",0x2558],
- ["D3",0x2559],
- ["C8",0x255A],
- ["BE",0x255B],
- ["BD",0x255C],
- ["BC",0x255D],
- ["C6",0x255E],
- ["C7",0x255F],
- ["CC",0x2560],
- ["B5",0x2561],
- ["B6",0x2562],
- ["B9",0x2563],
- ["D1",0x2564],
- ["D2",0x2565],
- ["CB",0x2566],
- ["CF",0x2567],
- ["D0",0x2568],
- ["CA",0x2569],
- ["D8",0x256A],
- ["D7",0x256B],
- ["CE",0x256C],
- ["DF",0x2580],
- ["DC",0x2584],
- ["DB",0x2588],
- ["DD",0x258C],
- ["DE",0x2590],
- ["B0",0x2591],
- ["B1",0x2592],
- ["B2",0x2593],
- ["FE",0x25A0],
-] \ No newline at end of file
diff --git a/enc/trans/ibm861-tbl.rb b/enc/trans/ibm861-tbl.rb
deleted file mode 100644
index c24042a76c..0000000000
--- a/enc/trans/ibm861-tbl.rb
+++ /dev/null
@@ -1,130 +0,0 @@
-IBM861_TO_UCS_TBL = [
- ["FF",0xA0],
- ["AD",0xA1],
- ["9C",0xA3],
- ["AE",0xAB],
- ["AA",0xAC],
- ["F8",0xB0],
- ["F1",0xB1],
- ["FD",0xB2],
- ["E6",0xB5],
- ["FA",0xB7],
- ["AF",0xBB],
- ["AC",0xBC],
- ["AB",0xBD],
- ["A8",0xBF],
- ["A4",0xC1],
- ["8E",0xC4],
- ["8F",0xC5],
- ["92",0xC6],
- ["80",0xC7],
- ["90",0xC9],
- ["A5",0xCD],
- ["8B",0xD0],
- ["A6",0xD3],
- ["99",0xD6],
- ["9D",0xD8],
- ["A7",0xDA],
- ["9A",0xDC],
- ["97",0xDD],
- ["8D",0xDE],
- ["E1",0xDF],
- ["85",0xE0],
- ["A0",0xE1],
- ["83",0xE2],
- ["84",0xE4],
- ["86",0xE5],
- ["91",0xE6],
- ["87",0xE7],
- ["8A",0xE8],
- ["82",0xE9],
- ["88",0xEA],
- ["89",0xEB],
- ["A1",0xED],
- ["8C",0xF0],
- ["A2",0xF3],
- ["93",0xF4],
- ["94",0xF6],
- ["F6",0xF7],
- ["9B",0xF8],
- ["A3",0xFA],
- ["96",0xFB],
- ["81",0xFC],
- ["98",0xFD],
- ["95",0xFE],
- ["9F",0x192],
- ["E2",0x393],
- ["E9",0x398],
- ["E4",0x3A3],
- ["E8",0x3A6],
- ["EA",0x3A9],
- ["E0",0x3B1],
- ["EB",0x3B4],
- ["EE",0x3B5],
- ["E3",0x3C0],
- ["E5",0x3C3],
- ["E7",0x3C4],
- ["ED",0x3C6],
- ["FC",0x207F],
- ["9E",0x20A7],
- ["F9",0x2219],
- ["FB",0x221A],
- ["EC",0x221E],
- ["EF",0x2229],
- ["F7",0x2248],
- ["F0",0x2261],
- ["F3",0x2264],
- ["F2",0x2265],
- ["A9",0x2310],
- ["F4",0x2320],
- ["F5",0x2321],
- ["C4",0x2500],
- ["B3",0x2502],
- ["DA",0x250C],
- ["BF",0x2510],
- ["C0",0x2514],
- ["D9",0x2518],
- ["C3",0x251C],
- ["B4",0x2524],
- ["C2",0x252C],
- ["C1",0x2534],
- ["C5",0x253C],
- ["CD",0x2550],
- ["BA",0x2551],
- ["D5",0x2552],
- ["D6",0x2553],
- ["C9",0x2554],
- ["B8",0x2555],
- ["B7",0x2556],
- ["BB",0x2557],
- ["D4",0x2558],
- ["D3",0x2559],
- ["C8",0x255A],
- ["BE",0x255B],
- ["BD",0x255C],
- ["BC",0x255D],
- ["C6",0x255E],
- ["C7",0x255F],
- ["CC",0x2560],
- ["B5",0x2561],
- ["B6",0x2562],
- ["B9",0x2563],
- ["D1",0x2564],
- ["D2",0x2565],
- ["CB",0x2566],
- ["CF",0x2567],
- ["D0",0x2568],
- ["CA",0x2569],
- ["D8",0x256A],
- ["D7",0x256B],
- ["CE",0x256C],
- ["DF",0x2580],
- ["DC",0x2584],
- ["DB",0x2588],
- ["DD",0x258C],
- ["DE",0x2590],
- ["B0",0x2591],
- ["B1",0x2592],
- ["B2",0x2593],
- ["FE",0x25A0],
-] \ No newline at end of file
diff --git a/enc/trans/ibm862-tbl.rb b/enc/trans/ibm862-tbl.rb
deleted file mode 100644
index 31d6fb0243..0000000000
--- a/enc/trans/ibm862-tbl.rb
+++ /dev/null
@@ -1,130 +0,0 @@
-IBM862_TO_UCS_TBL = [
- ["FF",0xA0],
- ["AD",0xA1],
- ["9B",0xA2],
- ["9C",0xA3],
- ["9D",0xA5],
- ["A6",0xAA],
- ["AE",0xAB],
- ["AA",0xAC],
- ["F8",0xB0],
- ["F1",0xB1],
- ["FD",0xB2],
- ["E6",0xB5],
- ["FA",0xB7],
- ["A7",0xBA],
- ["AF",0xBB],
- ["AC",0xBC],
- ["AB",0xBD],
- ["A8",0xBF],
- ["A5",0xD1],
- ["E1",0xDF],
- ["A0",0xE1],
- ["A1",0xED],
- ["A4",0xF1],
- ["A2",0xF3],
- ["F6",0xF7],
- ["A3",0xFA],
- ["9F",0x192],
- ["E2",0x393],
- ["E9",0x398],
- ["E4",0x3A3],
- ["E8",0x3A6],
- ["EA",0x3A9],
- ["E0",0x3B1],
- ["EB",0x3B4],
- ["EE",0x3B5],
- ["E3",0x3C0],
- ["E5",0x3C3],
- ["E7",0x3C4],
- ["ED",0x3C6],
- ["80",0x5D0],
- ["81",0x5D1],
- ["82",0x5D2],
- ["83",0x5D3],
- ["84",0x5D4],
- ["85",0x5D5],
- ["86",0x5D6],
- ["87",0x5D7],
- ["88",0x5D8],
- ["89",0x5D9],
- ["8A",0x5DA],
- ["8B",0x5DB],
- ["8C",0x5DC],
- ["8D",0x5DD],
- ["8E",0x5DE],
- ["8F",0x5DF],
- ["90",0x5E0],
- ["91",0x5E1],
- ["92",0x5E2],
- ["93",0x5E3],
- ["94",0x5E4],
- ["95",0x5E5],
- ["96",0x5E6],
- ["97",0x5E7],
- ["98",0x5E8],
- ["99",0x5E9],
- ["9A",0x5EA],
- ["FC",0x207F],
- ["9E",0x20A7],
- ["F9",0x2219],
- ["FB",0x221A],
- ["EC",0x221E],
- ["EF",0x2229],
- ["F7",0x2248],
- ["F0",0x2261],
- ["F3",0x2264],
- ["F2",0x2265],
- ["A9",0x2310],
- ["F4",0x2320],
- ["F5",0x2321],
- ["C4",0x2500],
- ["B3",0x2502],
- ["DA",0x250C],
- ["BF",0x2510],
- ["C0",0x2514],
- ["D9",0x2518],
- ["C3",0x251C],
- ["B4",0x2524],
- ["C2",0x252C],
- ["C1",0x2534],
- ["C5",0x253C],
- ["CD",0x2550],
- ["BA",0x2551],
- ["D5",0x2552],
- ["D6",0x2553],
- ["C9",0x2554],
- ["B8",0x2555],
- ["B7",0x2556],
- ["BB",0x2557],
- ["D4",0x2558],
- ["D3",0x2559],
- ["C8",0x255A],
- ["BE",0x255B],
- ["BD",0x255C],
- ["BC",0x255D],
- ["C6",0x255E],
- ["C7",0x255F],
- ["CC",0x2560],
- ["B5",0x2561],
- ["B6",0x2562],
- ["B9",0x2563],
- ["D1",0x2564],
- ["D2",0x2565],
- ["CB",0x2566],
- ["CF",0x2567],
- ["D0",0x2568],
- ["CA",0x2569],
- ["D8",0x256A],
- ["D7",0x256B],
- ["CE",0x256C],
- ["DF",0x2580],
- ["DC",0x2584],
- ["DB",0x2588],
- ["DD",0x258C],
- ["DE",0x2590],
- ["B0",0x2591],
- ["B1",0x2592],
- ["B2",0x2593],
- ["FE",0x25A0],
-] \ No newline at end of file
diff --git a/enc/trans/ibm863-tbl.rb b/enc/trans/ibm863-tbl.rb
deleted file mode 100644
index db110cf38c..0000000000
--- a/enc/trans/ibm863-tbl.rb
+++ /dev/null
@@ -1,130 +0,0 @@
-IBM863_TO_UCS_TBL = [
- ["FF",0xA0],
- ["9B",0xA2],
- ["9C",0xA3],
- ["98",0xA4],
- ["A0",0xA6],
- ["8F",0xA7],
- ["A4",0xA8],
- ["AE",0xAB],
- ["AA",0xAC],
- ["A7",0xAF],
- ["F8",0xB0],
- ["F1",0xB1],
- ["FD",0xB2],
- ["A6",0xB3],
- ["A1",0xB4],
- ["E6",0xB5],
- ["86",0xB6],
- ["FA",0xB7],
- ["A5",0xB8],
- ["AF",0xBB],
- ["AC",0xBC],
- ["AB",0xBD],
- ["AD",0xBE],
- ["8E",0xC0],
- ["84",0xC2],
- ["80",0xC7],
- ["91",0xC8],
- ["90",0xC9],
- ["92",0xCA],
- ["94",0xCB],
- ["A8",0xCE],
- ["95",0xCF],
- ["99",0xD4],
- ["9D",0xD9],
- ["9E",0xDB],
- ["9A",0xDC],
- ["E1",0xDF],
- ["85",0xE0],
- ["83",0xE2],
- ["87",0xE7],
- ["8A",0xE8],
- ["82",0xE9],
- ["88",0xEA],
- ["89",0xEB],
- ["8C",0xEE],
- ["8B",0xEF],
- ["A2",0xF3],
- ["93",0xF4],
- ["F6",0xF7],
- ["97",0xF9],
- ["A3",0xFA],
- ["96",0xFB],
- ["81",0xFC],
- ["9F",0x192],
- ["E2",0x393],
- ["E9",0x398],
- ["E4",0x3A3],
- ["E8",0x3A6],
- ["EA",0x3A9],
- ["E0",0x3B1],
- ["EB",0x3B4],
- ["EE",0x3B5],
- ["E3",0x3C0],
- ["E5",0x3C3],
- ["E7",0x3C4],
- ["ED",0x3C6],
- ["8D",0x2017],
- ["FC",0x207F],
- ["F9",0x2219],
- ["FB",0x221A],
- ["EC",0x221E],
- ["EF",0x2229],
- ["F7",0x2248],
- ["F0",0x2261],
- ["F3",0x2264],
- ["F2",0x2265],
- ["A9",0x2310],
- ["F4",0x2320],
- ["F5",0x2321],
- ["C4",0x2500],
- ["B3",0x2502],
- ["DA",0x250C],
- ["BF",0x2510],
- ["C0",0x2514],
- ["D9",0x2518],
- ["C3",0x251C],
- ["B4",0x2524],
- ["C2",0x252C],
- ["C1",0x2534],
- ["C5",0x253C],
- ["CD",0x2550],
- ["BA",0x2551],
- ["D5",0x2552],
- ["D6",0x2553],
- ["C9",0x2554],
- ["B8",0x2555],
- ["B7",0x2556],
- ["BB",0x2557],
- ["D4",0x2558],
- ["D3",0x2559],
- ["C8",0x255A],
- ["BE",0x255B],
- ["BD",0x255C],
- ["BC",0x255D],
- ["C6",0x255E],
- ["C7",0x255F],
- ["CC",0x2560],
- ["B5",0x2561],
- ["B6",0x2562],
- ["B9",0x2563],
- ["D1",0x2564],
- ["D2",0x2565],
- ["CB",0x2566],
- ["CF",0x2567],
- ["D0",0x2568],
- ["CA",0x2569],
- ["D8",0x256A],
- ["D7",0x256B],
- ["CE",0x256C],
- ["DF",0x2580],
- ["DC",0x2584],
- ["DB",0x2588],
- ["DD",0x258C],
- ["DE",0x2590],
- ["B0",0x2591],
- ["B1",0x2592],
- ["B2",0x2593],
- ["FE",0x25A0],
-] \ No newline at end of file
diff --git a/enc/trans/ibm865-tbl.rb b/enc/trans/ibm865-tbl.rb
deleted file mode 100644
index 22e322fb31..0000000000
--- a/enc/trans/ibm865-tbl.rb
+++ /dev/null
@@ -1,130 +0,0 @@
-IBM865_TO_UCS_TBL = [
- ["FF",0xA0],
- ["AD",0xA1],
- ["9C",0xA3],
- ["AF",0xA4],
- ["A6",0xAA],
- ["AE",0xAB],
- ["AA",0xAC],
- ["F8",0xB0],
- ["F1",0xB1],
- ["FD",0xB2],
- ["E6",0xB5],
- ["FA",0xB7],
- ["A7",0xBA],
- ["AC",0xBC],
- ["AB",0xBD],
- ["A8",0xBF],
- ["8E",0xC4],
- ["8F",0xC5],
- ["92",0xC6],
- ["80",0xC7],
- ["90",0xC9],
- ["A5",0xD1],
- ["99",0xD6],
- ["9D",0xD8],
- ["9A",0xDC],
- ["E1",0xDF],
- ["85",0xE0],
- ["A0",0xE1],
- ["83",0xE2],
- ["84",0xE4],
- ["86",0xE5],
- ["91",0xE6],
- ["87",0xE7],
- ["8A",0xE8],
- ["82",0xE9],
- ["88",0xEA],
- ["89",0xEB],
- ["8D",0xEC],
- ["A1",0xED],
- ["8C",0xEE],
- ["8B",0xEF],
- ["A4",0xF1],
- ["95",0xF2],
- ["A2",0xF3],
- ["93",0xF4],
- ["94",0xF6],
- ["F6",0xF7],
- ["9B",0xF8],
- ["97",0xF9],
- ["A3",0xFA],
- ["96",0xFB],
- ["81",0xFC],
- ["98",0xFF],
- ["9F",0x192],
- ["E2",0x393],
- ["E9",0x398],
- ["E4",0x3A3],
- ["E8",0x3A6],
- ["EA",0x3A9],
- ["E0",0x3B1],
- ["EB",0x3B4],
- ["EE",0x3B5],
- ["E3",0x3C0],
- ["E5",0x3C3],
- ["E7",0x3C4],
- ["ED",0x3C6],
- ["FC",0x207F],
- ["9E",0x20A7],
- ["F9",0x2219],
- ["FB",0x221A],
- ["EC",0x221E],
- ["EF",0x2229],
- ["F7",0x2248],
- ["F0",0x2261],
- ["F3",0x2264],
- ["F2",0x2265],
- ["A9",0x2310],
- ["F4",0x2320],
- ["F5",0x2321],
- ["C4",0x2500],
- ["B3",0x2502],
- ["DA",0x250C],
- ["BF",0x2510],
- ["C0",0x2514],
- ["D9",0x2518],
- ["C3",0x251C],
- ["B4",0x2524],
- ["C2",0x252C],
- ["C1",0x2534],
- ["C5",0x253C],
- ["CD",0x2550],
- ["BA",0x2551],
- ["D5",0x2552],
- ["D6",0x2553],
- ["C9",0x2554],
- ["B8",0x2555],
- ["B7",0x2556],
- ["BB",0x2557],
- ["D4",0x2558],
- ["D3",0x2559],
- ["C8",0x255A],
- ["BE",0x255B],
- ["BD",0x255C],
- ["BC",0x255D],
- ["C6",0x255E],
- ["C7",0x255F],
- ["CC",0x2560],
- ["B5",0x2561],
- ["B6",0x2562],
- ["B9",0x2563],
- ["D1",0x2564],
- ["D2",0x2565],
- ["CB",0x2566],
- ["CF",0x2567],
- ["D0",0x2568],
- ["CA",0x2569],
- ["D8",0x256A],
- ["D7",0x256B],
- ["CE",0x256C],
- ["DF",0x2580],
- ["DC",0x2584],
- ["DB",0x2588],
- ["DD",0x258C],
- ["DE",0x2590],
- ["B0",0x2591],
- ["B1",0x2592],
- ["B2",0x2593],
- ["FE",0x25A0],
-] \ No newline at end of file
diff --git a/enc/trans/ibm866-tbl.rb b/enc/trans/ibm866-tbl.rb
deleted file mode 100644
index 95b9ee7534..0000000000
--- a/enc/trans/ibm866-tbl.rb
+++ /dev/null
@@ -1,130 +0,0 @@
-IBM866_TO_UCS_TBL = [
- ["FF",0xA0],
- ["FD",0xA4],
- ["F8",0xB0],
- ["FA",0xB7],
- ["F0",0x401],
- ["F2",0x404],
- ["F4",0x407],
- ["F6",0x40E],
- ["80",0x410],
- ["81",0x411],
- ["82",0x412],
- ["83",0x413],
- ["84",0x414],
- ["85",0x415],
- ["86",0x416],
- ["87",0x417],
- ["88",0x418],
- ["89",0x419],
- ["8A",0x41A],
- ["8B",0x41B],
- ["8C",0x41C],
- ["8D",0x41D],
- ["8E",0x41E],
- ["8F",0x41F],
- ["90",0x420],
- ["91",0x421],
- ["92",0x422],
- ["93",0x423],
- ["94",0x424],
- ["95",0x425],
- ["96",0x426],
- ["97",0x427],
- ["98",0x428],
- ["99",0x429],
- ["9A",0x42A],
- ["9B",0x42B],
- ["9C",0x42C],
- ["9D",0x42D],
- ["9E",0x42E],
- ["9F",0x42F],
- ["A0",0x430],
- ["A1",0x431],
- ["A2",0x432],
- ["A3",0x433],
- ["A4",0x434],
- ["A5",0x435],
- ["A6",0x436],
- ["A7",0x437],
- ["A8",0x438],
- ["A9",0x439],
- ["AA",0x43A],
- ["AB",0x43B],
- ["AC",0x43C],
- ["AD",0x43D],
- ["AE",0x43E],
- ["AF",0x43F],
- ["E0",0x440],
- ["E1",0x441],
- ["E2",0x442],
- ["E3",0x443],
- ["E4",0x444],
- ["E5",0x445],
- ["E6",0x446],
- ["E7",0x447],
- ["E8",0x448],
- ["E9",0x449],
- ["EA",0x44A],
- ["EB",0x44B],
- ["EC",0x44C],
- ["ED",0x44D],
- ["EE",0x44E],
- ["EF",0x44F],
- ["F1",0x451],
- ["F3",0x454],
- ["F5",0x457],
- ["F7",0x45E],
- ["FC",0x2116],
- ["F9",0x2219],
- ["FB",0x221A],
- ["C4",0x2500],
- ["B3",0x2502],
- ["DA",0x250C],
- ["BF",0x2510],
- ["C0",0x2514],
- ["D9",0x2518],
- ["C3",0x251C],
- ["B4",0x2524],
- ["C2",0x252C],
- ["C1",0x2534],
- ["C5",0x253C],
- ["CD",0x2550],
- ["BA",0x2551],
- ["D5",0x2552],
- ["D6",0x2553],
- ["C9",0x2554],
- ["B8",0x2555],
- ["B7",0x2556],
- ["BB",0x2557],
- ["D4",0x2558],
- ["D3",0x2559],
- ["C8",0x255A],
- ["BE",0x255B],
- ["BD",0x255C],
- ["BC",0x255D],
- ["C6",0x255E],
- ["C7",0x255F],
- ["CC",0x2560],
- ["B5",0x2561],
- ["B6",0x2562],
- ["B9",0x2563],
- ["D1",0x2564],
- ["D2",0x2565],
- ["CB",0x2566],
- ["CF",0x2567],
- ["D0",0x2568],
- ["CA",0x2569],
- ["D8",0x256A],
- ["D7",0x256B],
- ["CE",0x256C],
- ["DF",0x2580],
- ["DC",0x2584],
- ["DB",0x2588],
- ["DD",0x258C],
- ["DE",0x2590],
- ["B0",0x2591],
- ["B1",0x2592],
- ["B2",0x2593],
- ["FE",0x25A0],
-] \ No newline at end of file
diff --git a/enc/trans/ibm869-tbl.rb b/enc/trans/ibm869-tbl.rb
deleted file mode 100644
index 437e41ad98..0000000000
--- a/enc/trans/ibm869-tbl.rb
+++ /dev/null
@@ -1,121 +0,0 @@
-IBM869_TO_UCS_TBL = [
- ["FF",0xA0],
- ["9C",0xA3],
- ["8A",0xA6],
- ["F5",0xA7],
- ["F9",0xA8],
- ["97",0xA9],
- ["AE",0xAB],
- ["89",0xAC],
- ["F0",0xAD],
- ["F8",0xB0],
- ["F1",0xB1],
- ["99",0xB2],
- ["9A",0xB3],
- ["88",0xB7],
- ["AF",0xBB],
- ["AB",0xBD],
- ["EF",0x384],
- ["F7",0x385],
- ["86",0x386],
- ["8D",0x388],
- ["8F",0x389],
- ["90",0x38A],
- ["92",0x38C],
- ["95",0x38E],
- ["98",0x38F],
- ["A1",0x390],
- ["A4",0x391],
- ["A5",0x392],
- ["A6",0x393],
- ["A7",0x394],
- ["A8",0x395],
- ["A9",0x396],
- ["AA",0x397],
- ["AC",0x398],
- ["AD",0x399],
- ["B5",0x39A],
- ["B6",0x39B],
- ["B7",0x39C],
- ["B8",0x39D],
- ["BD",0x39E],
- ["BE",0x39F],
- ["C6",0x3A0],
- ["C7",0x3A1],
- ["CF",0x3A3],
- ["D0",0x3A4],
- ["D1",0x3A5],
- ["D2",0x3A6],
- ["D3",0x3A7],
- ["D4",0x3A8],
- ["D5",0x3A9],
- ["91",0x3AA],
- ["96",0x3AB],
- ["9B",0x3AC],
- ["9D",0x3AD],
- ["9E",0x3AE],
- ["9F",0x3AF],
- ["FC",0x3B0],
- ["D6",0x3B1],
- ["D7",0x3B2],
- ["D8",0x3B3],
- ["DD",0x3B4],
- ["DE",0x3B5],
- ["E0",0x3B6],
- ["E1",0x3B7],
- ["E2",0x3B8],
- ["E3",0x3B9],
- ["E4",0x3BA],
- ["E5",0x3BB],
- ["E6",0x3BC],
- ["E7",0x3BD],
- ["E8",0x3BE],
- ["E9",0x3BF],
- ["EA",0x3C0],
- ["EB",0x3C1],
- ["ED",0x3C2],
- ["EC",0x3C3],
- ["EE",0x3C4],
- ["F2",0x3C5],
- ["F3",0x3C6],
- ["F4",0x3C7],
- ["F6",0x3C8],
- ["FA",0x3C9],
- ["A0",0x3CA],
- ["FB",0x3CB],
- ["A2",0x3CC],
- ["A3",0x3CD],
- ["FD",0x3CE],
- ["8E",0x2015],
- ["8B",0x2018],
- ["8C",0x2019],
- ["C4",0x2500],
- ["B3",0x2502],
- ["DA",0x250C],
- ["BF",0x2510],
- ["C0",0x2514],
- ["D9",0x2518],
- ["C3",0x251C],
- ["B4",0x2524],
- ["C2",0x252C],
- ["C1",0x2534],
- ["C5",0x253C],
- ["CD",0x2550],
- ["BA",0x2551],
- ["C9",0x2554],
- ["BB",0x2557],
- ["C8",0x255A],
- ["BC",0x255D],
- ["CC",0x2560],
- ["B9",0x2563],
- ["CB",0x2566],
- ["CA",0x2569],
- ["CE",0x256C],
- ["DF",0x2580],
- ["DC",0x2584],
- ["DB",0x2588],
- ["B0",0x2591],
- ["B1",0x2592],
- ["B2",0x2593],
- ["FE",0x25A0],
-] \ No newline at end of file
diff --git a/enc/trans/iso-8859-1-tbl.rb b/enc/trans/iso-8859-1-tbl.rb
deleted file mode 100644
index 05397e6417..0000000000
--- a/enc/trans/iso-8859-1-tbl.rb
+++ /dev/null
@@ -1,98 +0,0 @@
-ISO_8859_1_TO_UCS_TBL = [
- ["A0",0xA0],
- ["A1",0xA1],
- ["A2",0xA2],
- ["A3",0xA3],
- ["A4",0xA4],
- ["A5",0xA5],
- ["A6",0xA6],
- ["A7",0xA7],
- ["A8",0xA8],
- ["A9",0xA9],
- ["AA",0xAA],
- ["AB",0xAB],
- ["AC",0xAC],
- ["AD",0xAD],
- ["AE",0xAE],
- ["AF",0xAF],
- ["B0",0xB0],
- ["B1",0xB1],
- ["B2",0xB2],
- ["B3",0xB3],
- ["B4",0xB4],
- ["B5",0xB5],
- ["B6",0xB6],
- ["B7",0xB7],
- ["B8",0xB8],
- ["B9",0xB9],
- ["BA",0xBA],
- ["BB",0xBB],
- ["BC",0xBC],
- ["BD",0xBD],
- ["BE",0xBE],
- ["BF",0xBF],
- ["C0",0xC0],
- ["C1",0xC1],
- ["C2",0xC2],
- ["C3",0xC3],
- ["C4",0xC4],
- ["C5",0xC5],
- ["C6",0xC6],
- ["C7",0xC7],
- ["C8",0xC8],
- ["C9",0xC9],
- ["CA",0xCA],
- ["CB",0xCB],
- ["CC",0xCC],
- ["CD",0xCD],
- ["CE",0xCE],
- ["CF",0xCF],
- ["D0",0xD0],
- ["D1",0xD1],
- ["D2",0xD2],
- ["D3",0xD3],
- ["D4",0xD4],
- ["D5",0xD5],
- ["D6",0xD6],
- ["D7",0xD7],
- ["D8",0xD8],
- ["D9",0xD9],
- ["DA",0xDA],
- ["DB",0xDB],
- ["DC",0xDC],
- ["DD",0xDD],
- ["DE",0xDE],
- ["DF",0xDF],
- ["E0",0xE0],
- ["E1",0xE1],
- ["E2",0xE2],
- ["E3",0xE3],
- ["E4",0xE4],
- ["E5",0xE5],
- ["E6",0xE6],
- ["E7",0xE7],
- ["E8",0xE8],
- ["E9",0xE9],
- ["EA",0xEA],
- ["EB",0xEB],
- ["EC",0xEC],
- ["ED",0xED],
- ["EE",0xEE],
- ["EF",0xEF],
- ["F0",0xF0],
- ["F1",0xF1],
- ["F2",0xF2],
- ["F3",0xF3],
- ["F4",0xF4],
- ["F5",0xF5],
- ["F6",0xF6],
- ["F7",0xF7],
- ["F8",0xF8],
- ["F9",0xF9],
- ["FA",0xFA],
- ["FB",0xFB],
- ["FC",0xFC],
- ["FD",0xFD],
- ["FE",0xFE],
- ["FF",0xFF],
-]
diff --git a/enc/trans/iso-8859-10-tbl.rb b/enc/trans/iso-8859-10-tbl.rb
deleted file mode 100644
index 8104f526cc..0000000000
--- a/enc/trans/iso-8859-10-tbl.rb
+++ /dev/null
@@ -1,98 +0,0 @@
-ISO_8859_10_TO_UCS_TBL = [
- ["A0",0xA0],
- ["A1",0x104],
- ["A2",0x112],
- ["A3",0x122],
- ["A4",0x12A],
- ["A5",0x128],
- ["A6",0x136],
- ["A7",0xA7],
- ["A8",0x13B],
- ["A9",0x110],
- ["AA",0x160],
- ["AB",0x166],
- ["AC",0x17D],
- ["AD",0xAD],
- ["AE",0x16A],
- ["AF",0x14A],
- ["B0",0xB0],
- ["B1",0x105],
- ["B2",0x113],
- ["B3",0x123],
- ["B4",0x12B],
- ["B5",0x129],
- ["B6",0x137],
- ["B7",0xB7],
- ["B8",0x13C],
- ["B9",0x111],
- ["BA",0x161],
- ["BB",0x167],
- ["BC",0x17E],
- ["BD",0x2015],
- ["BE",0x16B],
- ["BF",0x14B],
- ["C0",0x100],
- ["C1",0xC1],
- ["C2",0xC2],
- ["C3",0xC3],
- ["C4",0xC4],
- ["C5",0xC5],
- ["C6",0xC6],
- ["C7",0x12E],
- ["C8",0x10C],
- ["C9",0xC9],
- ["CA",0x118],
- ["CB",0xCB],
- ["CC",0x116],
- ["CD",0xCD],
- ["CE",0xCE],
- ["CF",0xCF],
- ["D0",0xD0],
- ["D1",0x145],
- ["D2",0x14C],
- ["D3",0xD3],
- ["D4",0xD4],
- ["D5",0xD5],
- ["D6",0xD6],
- ["D7",0x168],
- ["D8",0xD8],
- ["D9",0x172],
- ["DA",0xDA],
- ["DB",0xDB],
- ["DC",0xDC],
- ["DD",0xDD],
- ["DE",0xDE],
- ["DF",0xDF],
- ["E0",0x101],
- ["E1",0xE1],
- ["E2",0xE2],
- ["E3",0xE3],
- ["E4",0xE4],
- ["E5",0xE5],
- ["E6",0xE6],
- ["E7",0x12F],
- ["E8",0x10D],
- ["E9",0xE9],
- ["EA",0x119],
- ["EB",0xEB],
- ["EC",0x117],
- ["ED",0xED],
- ["EE",0xEE],
- ["EF",0xEF],
- ["F0",0xF0],
- ["F1",0x146],
- ["F2",0x14D],
- ["F3",0xF3],
- ["F4",0xF4],
- ["F5",0xF5],
- ["F6",0xF6],
- ["F7",0x169],
- ["F8",0xF8],
- ["F9",0x173],
- ["FA",0xFA],
- ["FB",0xFB],
- ["FC",0xFC],
- ["FD",0xFD],
- ["FE",0xFE],
- ["FF",0x138],
-]
diff --git a/enc/trans/iso-8859-11-tbl.rb b/enc/trans/iso-8859-11-tbl.rb
deleted file mode 100644
index 686631c294..0000000000
--- a/enc/trans/iso-8859-11-tbl.rb
+++ /dev/null
@@ -1,90 +0,0 @@
-ISO_8859_11_TO_UCS_TBL = [
- ["A0",0xA0],
- ["A1",0xE01],
- ["A2",0xE02],
- ["A3",0xE03],
- ["A4",0xE04],
- ["A5",0xE05],
- ["A6",0xE06],
- ["A7",0xE07],
- ["A8",0xE08],
- ["A9",0xE09],
- ["AA",0xE0A],
- ["AB",0xE0B],
- ["AC",0xE0C],
- ["AD",0xE0D],
- ["AE",0xE0E],
- ["AF",0xE0F],
- ["B0",0xE10],
- ["B1",0xE11],
- ["B2",0xE12],
- ["B3",0xE13],
- ["B4",0xE14],
- ["B5",0xE15],
- ["B6",0xE16],
- ["B7",0xE17],
- ["B8",0xE18],
- ["B9",0xE19],
- ["BA",0xE1A],
- ["BB",0xE1B],
- ["BC",0xE1C],
- ["BD",0xE1D],
- ["BE",0xE1E],
- ["BF",0xE1F],
- ["C0",0xE20],
- ["C1",0xE21],
- ["C2",0xE22],
- ["C3",0xE23],
- ["C4",0xE24],
- ["C5",0xE25],
- ["C6",0xE26],
- ["C7",0xE27],
- ["C8",0xE28],
- ["C9",0xE29],
- ["CA",0xE2A],
- ["CB",0xE2B],
- ["CC",0xE2C],
- ["CD",0xE2D],
- ["CE",0xE2E],
- ["CF",0xE2F],
- ["D0",0xE30],
- ["D1",0xE31],
- ["D2",0xE32],
- ["D3",0xE33],
- ["D4",0xE34],
- ["D5",0xE35],
- ["D6",0xE36],
- ["D7",0xE37],
- ["D8",0xE38],
- ["D9",0xE39],
- ["DA",0xE3A],
- ["DF",0xE3F],
- ["E0",0xE40],
- ["E1",0xE41],
- ["E2",0xE42],
- ["E3",0xE43],
- ["E4",0xE44],
- ["E5",0xE45],
- ["E6",0xE46],
- ["E7",0xE47],
- ["E8",0xE48],
- ["E9",0xE49],
- ["EA",0xE4A],
- ["EB",0xE4B],
- ["EC",0xE4C],
- ["ED",0xE4D],
- ["EE",0xE4E],
- ["EF",0xE4F],
- ["F0",0xE50],
- ["F1",0xE51],
- ["F2",0xE52],
- ["F3",0xE53],
- ["F4",0xE54],
- ["F5",0xE55],
- ["F6",0xE56],
- ["F7",0xE57],
- ["F8",0xE58],
- ["F9",0xE59],
- ["FA",0xE5A],
- ["FB",0xE5B],
-]
diff --git a/enc/trans/iso-8859-13-tbl.rb b/enc/trans/iso-8859-13-tbl.rb
deleted file mode 100644
index 832d012c96..0000000000
--- a/enc/trans/iso-8859-13-tbl.rb
+++ /dev/null
@@ -1,98 +0,0 @@
-ISO_8859_13_TO_UCS_TBL = [
- ["A0",0xA0],
- ["A1",0x201D],
- ["A2",0xA2],
- ["A3",0xA3],
- ["A4",0xA4],
- ["A5",0x201E],
- ["A6",0xA6],
- ["A7",0xA7],
- ["A8",0xD8],
- ["A9",0xA9],
- ["AA",0x156],
- ["AB",0xAB],
- ["AC",0xAC],
- ["AD",0xAD],
- ["AE",0xAE],
- ["AF",0xC6],
- ["B0",0xB0],
- ["B1",0xB1],
- ["B2",0xB2],
- ["B3",0xB3],
- ["B4",0x201C],
- ["B5",0xB5],
- ["B6",0xB6],
- ["B7",0xB7],
- ["B8",0xF8],
- ["B9",0xB9],
- ["BA",0x157],
- ["BB",0xBB],
- ["BC",0xBC],
- ["BD",0xBD],
- ["BE",0xBE],
- ["BF",0xE6],
- ["C0",0x104],
- ["C1",0x12E],
- ["C2",0x100],
- ["C3",0x106],
- ["C4",0xC4],
- ["C5",0xC5],
- ["C6",0x118],
- ["C7",0x112],
- ["C8",0x10C],
- ["C9",0xC9],
- ["CA",0x179],
- ["CB",0x116],
- ["CC",0x122],
- ["CD",0x136],
- ["CE",0x12A],
- ["CF",0x13B],
- ["D0",0x160],
- ["D1",0x143],
- ["D2",0x145],
- ["D3",0xD3],
- ["D4",0x14C],
- ["D5",0xD5],
- ["D6",0xD6],
- ["D7",0xD7],
- ["D8",0x172],
- ["D9",0x141],
- ["DA",0x15A],
- ["DB",0x16A],
- ["DC",0xDC],
- ["DD",0x17B],
- ["DE",0x17D],
- ["DF",0xDF],
- ["E0",0x105],
- ["E1",0x12F],
- ["E2",0x101],
- ["E3",0x107],
- ["E4",0xE4],
- ["E5",0xE5],
- ["E6",0x119],
- ["E7",0x113],
- ["E8",0x10D],
- ["E9",0xE9],
- ["EA",0x17A],
- ["EB",0x117],
- ["EC",0x123],
- ["ED",0x137],
- ["EE",0x12B],
- ["EF",0x13C],
- ["F0",0x161],
- ["F1",0x144],
- ["F2",0x146],
- ["F3",0xF3],
- ["F4",0x14D],
- ["F5",0xF5],
- ["F6",0xF6],
- ["F7",0xF7],
- ["F8",0x173],
- ["F9",0x142],
- ["FA",0x15B],
- ["FB",0x16B],
- ["FC",0xFC],
- ["FD",0x17C],
- ["FE",0x17E],
- ["FF",0x2019],
-]
diff --git a/enc/trans/iso-8859-14-tbl.rb b/enc/trans/iso-8859-14-tbl.rb
deleted file mode 100644
index db5c13996a..0000000000
--- a/enc/trans/iso-8859-14-tbl.rb
+++ /dev/null
@@ -1,98 +0,0 @@
-ISO_8859_14_TO_UCS_TBL = [
- ["A0",0xA0],
- ["A1",0x1E02],
- ["A2",0x1E03],
- ["A3",0xA3],
- ["A4",0x10A],
- ["A5",0x10B],
- ["A6",0x1E0A],
- ["A7",0xA7],
- ["A8",0x1E80],
- ["A9",0xA9],
- ["AA",0x1E82],
- ["AB",0x1E0B],
- ["AC",0x1EF2],
- ["AD",0xAD],
- ["AE",0xAE],
- ["AF",0x178],
- ["B0",0x1E1E],
- ["B1",0x1E1F],
- ["B2",0x120],
- ["B3",0x121],
- ["B4",0x1E40],
- ["B5",0x1E41],
- ["B6",0xB6],
- ["B7",0x1E56],
- ["B8",0x1E81],
- ["B9",0x1E57],
- ["BA",0x1E83],
- ["BB",0x1E60],
- ["BC",0x1EF3],
- ["BD",0x1E84],
- ["BE",0x1E85],
- ["BF",0x1E61],
- ["C0",0xC0],
- ["C1",0xC1],
- ["C2",0xC2],
- ["C3",0xC3],
- ["C4",0xC4],
- ["C5",0xC5],
- ["C6",0xC6],
- ["C7",0xC7],
- ["C8",0xC8],
- ["C9",0xC9],
- ["CA",0xCA],
- ["CB",0xCB],
- ["CC",0xCC],
- ["CD",0xCD],
- ["CE",0xCE],
- ["CF",0xCF],
- ["D0",0x174],
- ["D1",0xD1],
- ["D2",0xD2],
- ["D3",0xD3],
- ["D4",0xD4],
- ["D5",0xD5],
- ["D6",0xD6],
- ["D7",0x1E6A],
- ["D8",0xD8],
- ["D9",0xD9],
- ["DA",0xDA],
- ["DB",0xDB],
- ["DC",0xDC],
- ["DD",0xDD],
- ["DE",0x176],
- ["DF",0xDF],
- ["E0",0xE0],
- ["E1",0xE1],
- ["E2",0xE2],
- ["E3",0xE3],
- ["E4",0xE4],
- ["E5",0xE5],
- ["E6",0xE6],
- ["E7",0xE7],
- ["E8",0xE8],
- ["E9",0xE9],
- ["EA",0xEA],
- ["EB",0xEB],
- ["EC",0xEC],
- ["ED",0xED],
- ["EE",0xEE],
- ["EF",0xEF],
- ["F0",0x175],
- ["F1",0xF1],
- ["F2",0xF2],
- ["F3",0xF3],
- ["F4",0xF4],
- ["F5",0xF5],
- ["F6",0xF6],
- ["F7",0x1E6B],
- ["F8",0xF8],
- ["F9",0xF9],
- ["FA",0xFA],
- ["FB",0xFB],
- ["FC",0xFC],
- ["FD",0xFD],
- ["FE",0x177],
- ["FF",0xFF],
-]
diff --git a/enc/trans/iso-8859-15-tbl.rb b/enc/trans/iso-8859-15-tbl.rb
deleted file mode 100644
index 54d952a25f..0000000000
--- a/enc/trans/iso-8859-15-tbl.rb
+++ /dev/null
@@ -1,98 +0,0 @@
-ISO_8859_15_TO_UCS_TBL = [
- ["A0",0xA0],
- ["A1",0xA1],
- ["A2",0xA2],
- ["A3",0xA3],
- ["A4",0x20AC],
- ["A5",0xA5],
- ["A6",0x160],
- ["A7",0xA7],
- ["A8",0x161],
- ["A9",0xA9],
- ["AA",0xAA],
- ["AB",0xAB],
- ["AC",0xAC],
- ["AD",0xAD],
- ["AE",0xAE],
- ["AF",0xAF],
- ["B0",0xB0],
- ["B1",0xB1],
- ["B2",0xB2],
- ["B3",0xB3],
- ["B4",0x17D],
- ["B5",0xB5],
- ["B6",0xB6],
- ["B7",0xB7],
- ["B8",0x17E],
- ["B9",0xB9],
- ["BA",0xBA],
- ["BB",0xBB],
- ["BC",0x152],
- ["BD",0x153],
- ["BE",0x178],
- ["BF",0xBF],
- ["C0",0xC0],
- ["C1",0xC1],
- ["C2",0xC2],
- ["C3",0xC3],
- ["C4",0xC4],
- ["C5",0xC5],
- ["C6",0xC6],
- ["C7",0xC7],
- ["C8",0xC8],
- ["C9",0xC9],
- ["CA",0xCA],
- ["CB",0xCB],
- ["CC",0xCC],
- ["CD",0xCD],
- ["CE",0xCE],
- ["CF",0xCF],
- ["D0",0xD0],
- ["D1",0xD1],
- ["D2",0xD2],
- ["D3",0xD3],
- ["D4",0xD4],
- ["D5",0xD5],
- ["D6",0xD6],
- ["D7",0xD7],
- ["D8",0xD8],
- ["D9",0xD9],
- ["DA",0xDA],
- ["DB",0xDB],
- ["DC",0xDC],
- ["DD",0xDD],
- ["DE",0xDE],
- ["DF",0xDF],
- ["E0",0xE0],
- ["E1",0xE1],
- ["E2",0xE2],
- ["E3",0xE3],
- ["E4",0xE4],
- ["E5",0xE5],
- ["E6",0xE6],
- ["E7",0xE7],
- ["E8",0xE8],
- ["E9",0xE9],
- ["EA",0xEA],
- ["EB",0xEB],
- ["EC",0xEC],
- ["ED",0xED],
- ["EE",0xEE],
- ["EF",0xEF],
- ["F0",0xF0],
- ["F1",0xF1],
- ["F2",0xF2],
- ["F3",0xF3],
- ["F4",0xF4],
- ["F5",0xF5],
- ["F6",0xF6],
- ["F7",0xF7],
- ["F8",0xF8],
- ["F9",0xF9],
- ["FA",0xFA],
- ["FB",0xFB],
- ["FC",0xFC],
- ["FD",0xFD],
- ["FE",0xFE],
- ["FF",0xFF],
-]
diff --git a/enc/trans/iso-8859-2-tbl.rb b/enc/trans/iso-8859-2-tbl.rb
deleted file mode 100644
index adf2bb1182..0000000000
--- a/enc/trans/iso-8859-2-tbl.rb
+++ /dev/null
@@ -1,98 +0,0 @@
-ISO_8859_2_TO_UCS_TBL = [
- ["A0",0xA0],
- ["A1",0x104],
- ["A2",0x2D8],
- ["A3",0x141],
- ["A4",0xA4],
- ["A5",0x13D],
- ["A6",0x15A],
- ["A7",0xA7],
- ["A8",0xA8],
- ["A9",0x160],
- ["AA",0x15E],
- ["AB",0x164],
- ["AC",0x179],
- ["AD",0xAD],
- ["AE",0x17D],
- ["AF",0x17B],
- ["B0",0xB0],
- ["B1",0x105],
- ["B2",0x2DB],
- ["B3",0x142],
- ["B4",0xB4],
- ["B5",0x13E],
- ["B6",0x15B],
- ["B7",0x2C7],
- ["B8",0xB8],
- ["B9",0x161],
- ["BA",0x15F],
- ["BB",0x165],
- ["BC",0x17A],
- ["BD",0x2DD],
- ["BE",0x17E],
- ["BF",0x17C],
- ["C0",0x154],
- ["C1",0xC1],
- ["C2",0xC2],
- ["C3",0x102],
- ["C4",0xC4],
- ["C5",0x139],
- ["C6",0x106],
- ["C7",0xC7],
- ["C8",0x10C],
- ["C9",0xC9],
- ["CA",0x118],
- ["CB",0xCB],
- ["CC",0x11A],
- ["CD",0xCD],
- ["CE",0xCE],
- ["CF",0x10E],
- ["D0",0x110],
- ["D1",0x143],
- ["D2",0x147],
- ["D3",0xD3],
- ["D4",0xD4],
- ["D5",0x150],
- ["D6",0xD6],
- ["D7",0xD7],
- ["D8",0x158],
- ["D9",0x16E],
- ["DA",0xDA],
- ["DB",0x170],
- ["DC",0xDC],
- ["DD",0xDD],
- ["DE",0x162],
- ["DF",0xDF],
- ["E0",0x155],
- ["E1",0xE1],
- ["E2",0xE2],
- ["E3",0x103],
- ["E4",0xE4],
- ["E5",0x13A],
- ["E6",0x107],
- ["E7",0xE7],
- ["E8",0x10D],
- ["E9",0xE9],
- ["EA",0x119],
- ["EB",0xEB],
- ["EC",0x11B],
- ["ED",0xED],
- ["EE",0xEE],
- ["EF",0x10F],
- ["F0",0x111],
- ["F1",0x144],
- ["F2",0x148],
- ["F3",0xF3],
- ["F4",0xF4],
- ["F5",0x151],
- ["F6",0xF6],
- ["F7",0xF7],
- ["F8",0x159],
- ["F9",0x16F],
- ["FA",0xFA],
- ["FB",0x171],
- ["FC",0xFC],
- ["FD",0xFD],
- ["FE",0x163],
- ["FF",0x2D9],
-]
diff --git a/enc/trans/iso-8859-3-tbl.rb b/enc/trans/iso-8859-3-tbl.rb
deleted file mode 100644
index 4751ee0c0a..0000000000
--- a/enc/trans/iso-8859-3-tbl.rb
+++ /dev/null
@@ -1,91 +0,0 @@
-ISO_8859_3_TO_UCS_TBL = [
- ["A0",0xA0],
- ["A1",0x126],
- ["A2",0x2D8],
- ["A3",0xA3],
- ["A4",0xA4],
- ["A6",0x124],
- ["A7",0xA7],
- ["A8",0xA8],
- ["A9",0x130],
- ["AA",0x15E],
- ["AB",0x11E],
- ["AC",0x134],
- ["AD",0xAD],
- ["AF",0x17B],
- ["B0",0xB0],
- ["B1",0x127],
- ["B2",0xB2],
- ["B3",0xB3],
- ["B4",0xB4],
- ["B5",0xB5],
- ["B6",0x125],
- ["B7",0xB7],
- ["B8",0xB8],
- ["B9",0x131],
- ["BA",0x15F],
- ["BB",0x11F],
- ["BC",0x135],
- ["BD",0xBD],
- ["BF",0x17C],
- ["C0",0xC0],
- ["C1",0xC1],
- ["C2",0xC2],
- ["C4",0xC4],
- ["C5",0x10A],
- ["C6",0x108],
- ["C7",0xC7],
- ["C8",0xC8],
- ["C9",0xC9],
- ["CA",0xCA],
- ["CB",0xCB],
- ["CC",0xCC],
- ["CD",0xCD],
- ["CE",0xCE],
- ["CF",0xCF],
- ["D1",0xD1],
- ["D2",0xD2],
- ["D3",0xD3],
- ["D4",0xD4],
- ["D5",0x120],
- ["D6",0xD6],
- ["D7",0xD7],
- ["D8",0x11C],
- ["D9",0xD9],
- ["DA",0xDA],
- ["DB",0xDB],
- ["DC",0xDC],
- ["DD",0x16C],
- ["DE",0x15C],
- ["DF",0xDF],
- ["E0",0xE0],
- ["E1",0xE1],
- ["E2",0xE2],
- ["E4",0xE4],
- ["E5",0x10B],
- ["E6",0x109],
- ["E7",0xE7],
- ["E8",0xE8],
- ["E9",0xE9],
- ["EA",0xEA],
- ["EB",0xEB],
- ["EC",0xEC],
- ["ED",0xED],
- ["EE",0xEE],
- ["EF",0xEF],
- ["F1",0xF1],
- ["F2",0xF2],
- ["F3",0xF3],
- ["F4",0xF4],
- ["F5",0x121],
- ["F6",0xF6],
- ["F7",0xF7],
- ["F8",0x11D],
- ["F9",0xF9],
- ["FA",0xFA],
- ["FB",0xFB],
- ["FC",0xFC],
- ["FD",0x16D],
- ["FE",0x15D],
- ["FF",0x2D9],
-]
diff --git a/enc/trans/iso-8859-4-tbl.rb b/enc/trans/iso-8859-4-tbl.rb
deleted file mode 100644
index ff13883321..0000000000
--- a/enc/trans/iso-8859-4-tbl.rb
+++ /dev/null
@@ -1,98 +0,0 @@
-ISO_8859_4_TO_UCS_TBL = [
- ["A0",0xA0],
- ["A1",0x104],
- ["A2",0x138],
- ["A3",0x156],
- ["A4",0xA4],
- ["A5",0x128],
- ["A6",0x13B],
- ["A7",0xA7],
- ["A8",0xA8],
- ["A9",0x160],
- ["AA",0x112],
- ["AB",0x122],
- ["AC",0x166],
- ["AD",0xAD],
- ["AE",0x17D],
- ["AF",0xAF],
- ["B0",0xB0],
- ["B1",0x105],
- ["B2",0x2DB],
- ["B3",0x157],
- ["B4",0xB4],
- ["B5",0x129],
- ["B6",0x13C],
- ["B7",0x2C7],
- ["B8",0xB8],
- ["B9",0x161],
- ["BA",0x113],
- ["BB",0x123],
- ["BC",0x167],
- ["BD",0x14A],
- ["BE",0x17E],
- ["BF",0x14B],
- ["C0",0x100],
- ["C1",0xC1],
- ["C2",0xC2],
- ["C3",0xC3],
- ["C4",0xC4],
- ["C5",0xC5],
- ["C6",0xC6],
- ["C7",0x12E],
- ["C8",0x10C],
- ["C9",0xC9],
- ["CA",0x118],
- ["CB",0xCB],
- ["CC",0x116],
- ["CD",0xCD],
- ["CE",0xCE],
- ["CF",0x12A],
- ["D0",0x110],
- ["D1",0x145],
- ["D2",0x14C],
- ["D3",0x136],
- ["D4",0xD4],
- ["D5",0xD5],
- ["D6",0xD6],
- ["D7",0xD7],
- ["D8",0xD8],
- ["D9",0x172],
- ["DA",0xDA],
- ["DB",0xDB],
- ["DC",0xDC],
- ["DD",0x168],
- ["DE",0x16A],
- ["DF",0xDF],
- ["E0",0x101],
- ["E1",0xE1],
- ["E2",0xE2],
- ["E3",0xE3],
- ["E4",0xE4],
- ["E5",0xE5],
- ["E6",0xE6],
- ["E7",0x12F],
- ["E8",0x10D],
- ["E9",0xE9],
- ["EA",0x119],
- ["EB",0xEB],
- ["EC",0x117],
- ["ED",0xED],
- ["EE",0xEE],
- ["EF",0x12B],
- ["F0",0x111],
- ["F1",0x146],
- ["F2",0x14D],
- ["F3",0x137],
- ["F4",0xF4],
- ["F5",0xF5],
- ["F6",0xF6],
- ["F7",0xF7],
- ["F8",0xF8],
- ["F9",0x173],
- ["FA",0xFA],
- ["FB",0xFB],
- ["FC",0xFC],
- ["FD",0x169],
- ["FE",0x16B],
- ["FF",0x2D9],
-]
diff --git a/enc/trans/iso-8859-5-tbl.rb b/enc/trans/iso-8859-5-tbl.rb
deleted file mode 100644
index b0ef366a27..0000000000
--- a/enc/trans/iso-8859-5-tbl.rb
+++ /dev/null
@@ -1,98 +0,0 @@
-ISO_8859_5_TO_UCS_TBL = [
- ["A0",0xA0],
- ["A1",0x401],
- ["A2",0x402],
- ["A3",0x403],
- ["A4",0x404],
- ["A5",0x405],
- ["A6",0x406],
- ["A7",0x407],
- ["A8",0x408],
- ["A9",0x409],
- ["AA",0x40A],
- ["AB",0x40B],
- ["AC",0x40C],
- ["AD",0xAD],
- ["AE",0x40E],
- ["AF",0x40F],
- ["B0",0x410],
- ["B1",0x411],
- ["B2",0x412],
- ["B3",0x413],
- ["B4",0x414],
- ["B5",0x415],
- ["B6",0x416],
- ["B7",0x417],
- ["B8",0x418],
- ["B9",0x419],
- ["BA",0x41A],
- ["BB",0x41B],
- ["BC",0x41C],
- ["BD",0x41D],
- ["BE",0x41E],
- ["BF",0x41F],
- ["C0",0x420],
- ["C1",0x421],
- ["C2",0x422],
- ["C3",0x423],
- ["C4",0x424],
- ["C5",0x425],
- ["C6",0x426],
- ["C7",0x427],
- ["C8",0x428],
- ["C9",0x429],
- ["CA",0x42A],
- ["CB",0x42B],
- ["CC",0x42C],
- ["CD",0x42D],
- ["CE",0x42E],
- ["CF",0x42F],
- ["D0",0x430],
- ["D1",0x431],
- ["D2",0x432],
- ["D3",0x433],
- ["D4",0x434],
- ["D5",0x435],
- ["D6",0x436],
- ["D7",0x437],
- ["D8",0x438],
- ["D9",0x439],
- ["DA",0x43A],
- ["DB",0x43B],
- ["DC",0x43C],
- ["DD",0x43D],
- ["DE",0x43E],
- ["DF",0x43F],
- ["E0",0x440],
- ["E1",0x441],
- ["E2",0x442],
- ["E3",0x443],
- ["E4",0x444],
- ["E5",0x445],
- ["E6",0x446],
- ["E7",0x447],
- ["E8",0x448],
- ["E9",0x449],
- ["EA",0x44A],
- ["EB",0x44B],
- ["EC",0x44C],
- ["ED",0x44D],
- ["EE",0x44E],
- ["EF",0x44F],
- ["F0",0x2116],
- ["F1",0x451],
- ["F2",0x452],
- ["F3",0x453],
- ["F4",0x454],
- ["F5",0x455],
- ["F6",0x456],
- ["F7",0x457],
- ["F8",0x458],
- ["F9",0x459],
- ["FA",0x45A],
- ["FB",0x45B],
- ["FC",0x45C],
- ["FD",0xA7],
- ["FE",0x45E],
- ["FF",0x45F],
-]
diff --git a/enc/trans/iso-8859-6-tbl.rb b/enc/trans/iso-8859-6-tbl.rb
deleted file mode 100644
index d387372b98..0000000000
--- a/enc/trans/iso-8859-6-tbl.rb
+++ /dev/null
@@ -1,53 +0,0 @@
-ISO_8859_6_TO_UCS_TBL = [
- ["A0",0xA0],
- ["A4",0xA4],
- ["AC",0x60C],
- ["AD",0xAD],
- ["BB",0x61B],
- ["BF",0x61F],
- ["C1",0x621],
- ["C2",0x622],
- ["C3",0x623],
- ["C4",0x624],
- ["C5",0x625],
- ["C6",0x626],
- ["C7",0x627],
- ["C8",0x628],
- ["C9",0x629],
- ["CA",0x62A],
- ["CB",0x62B],
- ["CC",0x62C],
- ["CD",0x62D],
- ["CE",0x62E],
- ["CF",0x62F],
- ["D0",0x630],
- ["D1",0x631],
- ["D2",0x632],
- ["D3",0x633],
- ["D4",0x634],
- ["D5",0x635],
- ["D6",0x636],
- ["D7",0x637],
- ["D8",0x638],
- ["D9",0x639],
- ["DA",0x63A],
- ["E0",0x640],
- ["E1",0x641],
- ["E2",0x642],
- ["E3",0x643],
- ["E4",0x644],
- ["E5",0x645],
- ["E6",0x646],
- ["E7",0x647],
- ["E8",0x648],
- ["E9",0x649],
- ["EA",0x64A],
- ["EB",0x64B],
- ["EC",0x64C],
- ["ED",0x64D],
- ["EE",0x64E],
- ["EF",0x64F],
- ["F0",0x650],
- ["F1",0x651],
- ["F2",0x652],
-]
diff --git a/enc/trans/iso-8859-7-tbl.rb b/enc/trans/iso-8859-7-tbl.rb
deleted file mode 100644
index 4ebce5c1f1..0000000000
--- a/enc/trans/iso-8859-7-tbl.rb
+++ /dev/null
@@ -1,95 +0,0 @@
-ISO_8859_7_TO_UCS_TBL = [
- ["A0",0xA0],
- ["A1",0x2018],
- ["A2",0x2019],
- ["A3",0xA3],
- ["A4",0x20AC],
- ["A5",0x20AF],
- ["A6",0xA6],
- ["A7",0xA7],
- ["A8",0xA8],
- ["A9",0xA9],
- ["AA",0x37A],
- ["AB",0xAB],
- ["AC",0xAC],
- ["AD",0xAD],
- ["AF",0x2015],
- ["B0",0xB0],
- ["B1",0xB1],
- ["B2",0xB2],
- ["B3",0xB3],
- ["B4",0x384],
- ["B5",0x385],
- ["B6",0x386],
- ["B7",0xB7],
- ["B8",0x388],
- ["B9",0x389],
- ["BA",0x38A],
- ["BB",0xBB],
- ["BC",0x38C],
- ["BD",0xBD],
- ["BE",0x38E],
- ["BF",0x38F],
- ["C0",0x390],
- ["C1",0x391],
- ["C2",0x392],
- ["C3",0x393],
- ["C4",0x394],
- ["C5",0x395],
- ["C6",0x396],
- ["C7",0x397],
- ["C8",0x398],
- ["C9",0x399],
- ["CA",0x39A],
- ["CB",0x39B],
- ["CC",0x39C],
- ["CD",0x39D],
- ["CE",0x39E],
- ["CF",0x39F],
- ["D0",0x3A0],
- ["D1",0x3A1],
- ["D3",0x3A3],
- ["D4",0x3A4],
- ["D5",0x3A5],
- ["D6",0x3A6],
- ["D7",0x3A7],
- ["D8",0x3A8],
- ["D9",0x3A9],
- ["DA",0x3AA],
- ["DB",0x3AB],
- ["DC",0x3AC],
- ["DD",0x3AD],
- ["DE",0x3AE],
- ["DF",0x3AF],
- ["E0",0x3B0],
- ["E1",0x3B1],
- ["E2",0x3B2],
- ["E3",0x3B3],
- ["E4",0x3B4],
- ["E5",0x3B5],
- ["E6",0x3B6],
- ["E7",0x3B7],
- ["E8",0x3B8],
- ["E9",0x3B9],
- ["EA",0x3BA],
- ["EB",0x3BB],
- ["EC",0x3BC],
- ["ED",0x3BD],
- ["EE",0x3BE],
- ["EF",0x3BF],
- ["F0",0x3C0],
- ["F1",0x3C1],
- ["F2",0x3C2],
- ["F3",0x3C3],
- ["F4",0x3C4],
- ["F5",0x3C5],
- ["F6",0x3C6],
- ["F7",0x3C7],
- ["F8",0x3C8],
- ["F9",0x3C9],
- ["FA",0x3CA],
- ["FB",0x3CB],
- ["FC",0x3CC],
- ["FD",0x3CD],
- ["FE",0x3CE],
-]
diff --git a/enc/trans/iso-8859-8-tbl.rb b/enc/trans/iso-8859-8-tbl.rb
deleted file mode 100644
index d0806f4524..0000000000
--- a/enc/trans/iso-8859-8-tbl.rb
+++ /dev/null
@@ -1,62 +0,0 @@
-ISO_8859_8_TO_UCS_TBL = [
- ["A0",0xA0],
- ["A2",0xA2],
- ["A3",0xA3],
- ["A4",0xA4],
- ["A5",0xA5],
- ["A6",0xA6],
- ["A7",0xA7],
- ["A8",0xA8],
- ["A9",0xA9],
- ["AA",0xD7],
- ["AB",0xAB],
- ["AC",0xAC],
- ["AD",0xAD],
- ["AE",0xAE],
- ["AF",0xAF],
- ["B0",0xB0],
- ["B1",0xB1],
- ["B2",0xB2],
- ["B3",0xB3],
- ["B4",0xB4],
- ["B5",0xB5],
- ["B6",0xB6],
- ["B7",0xB7],
- ["B8",0xB8],
- ["B9",0xB9],
- ["BA",0xF7],
- ["BB",0xBB],
- ["BC",0xBC],
- ["BD",0xBD],
- ["BE",0xBE],
- ["DF",0x2017],
- ["E0",0x5D0],
- ["E1",0x5D1],
- ["E2",0x5D2],
- ["E3",0x5D3],
- ["E4",0x5D4],
- ["E5",0x5D5],
- ["E6",0x5D6],
- ["E7",0x5D7],
- ["E8",0x5D8],
- ["E9",0x5D9],
- ["EA",0x5DA],
- ["EB",0x5DB],
- ["EC",0x5DC],
- ["ED",0x5DD],
- ["EE",0x5DE],
- ["EF",0x5DF],
- ["F0",0x5E0],
- ["F1",0x5E1],
- ["F2",0x5E2],
- ["F3",0x5E3],
- ["F4",0x5E4],
- ["F5",0x5E5],
- ["F6",0x5E6],
- ["F7",0x5E7],
- ["F8",0x5E8],
- ["F9",0x5E9],
- ["FA",0x5EA],
- ["FD",0x200E],
- ["FE",0x200F],
-]
diff --git a/enc/trans/iso-8859-9-tbl.rb b/enc/trans/iso-8859-9-tbl.rb
deleted file mode 100644
index 0cd92d61e9..0000000000
--- a/enc/trans/iso-8859-9-tbl.rb
+++ /dev/null
@@ -1,98 +0,0 @@
-ISO_8859_9_TO_UCS_TBL = [
- ["A0",0xA0],
- ["A1",0xA1],
- ["A2",0xA2],
- ["A3",0xA3],
- ["A4",0xA4],
- ["A5",0xA5],
- ["A6",0xA6],
- ["A7",0xA7],
- ["A8",0xA8],
- ["A9",0xA9],
- ["AA",0xAA],
- ["AB",0xAB],
- ["AC",0xAC],
- ["AD",0xAD],
- ["AE",0xAE],
- ["AF",0xAF],
- ["B0",0xB0],
- ["B1",0xB1],
- ["B2",0xB2],
- ["B3",0xB3],
- ["B4",0xB4],
- ["B5",0xB5],
- ["B6",0xB6],
- ["B7",0xB7],
- ["B8",0xB8],
- ["B9",0xB9],
- ["BA",0xBA],
- ["BB",0xBB],
- ["BC",0xBC],
- ["BD",0xBD],
- ["BE",0xBE],
- ["BF",0xBF],
- ["C0",0xC0],
- ["C1",0xC1],
- ["C2",0xC2],
- ["C3",0xC3],
- ["C4",0xC4],
- ["C5",0xC5],
- ["C6",0xC6],
- ["C7",0xC7],
- ["C8",0xC8],
- ["C9",0xC9],
- ["CA",0xCA],
- ["CB",0xCB],
- ["CC",0xCC],
- ["CD",0xCD],
- ["CE",0xCE],
- ["CF",0xCF],
- ["D0",0x11E],
- ["D1",0xD1],
- ["D2",0xD2],
- ["D3",0xD3],
- ["D4",0xD4],
- ["D5",0xD5],
- ["D6",0xD6],
- ["D7",0xD7],
- ["D8",0xD8],
- ["D9",0xD9],
- ["DA",0xDA],
- ["DB",0xDB],
- ["DC",0xDC],
- ["DD",0x130],
- ["DE",0x15E],
- ["DF",0xDF],
- ["E0",0xE0],
- ["E1",0xE1],
- ["E2",0xE2],
- ["E3",0xE3],
- ["E4",0xE4],
- ["E5",0xE5],
- ["E6",0xE6],
- ["E7",0xE7],
- ["E8",0xE8],
- ["E9",0xE9],
- ["EA",0xEA],
- ["EB",0xEB],
- ["EC",0xEC],
- ["ED",0xED],
- ["EE",0xEE],
- ["EF",0xEF],
- ["F0",0x11F],
- ["F1",0xF1],
- ["F2",0xF2],
- ["F3",0xF3],
- ["F4",0xF4],
- ["F5",0xF5],
- ["F6",0xF6],
- ["F7",0xF7],
- ["F8",0xF8],
- ["F9",0xF9],
- ["FA",0xFA],
- ["FB",0xFB],
- ["FC",0xFC],
- ["FD",0x131],
- ["FE",0x15F],
- ["FF",0xFF],
-]
diff --git a/enc/trans/iso2022.trans b/enc/trans/iso2022.trans
deleted file mode 100644
index a93f211f62..0000000000
--- a/enc/trans/iso2022.trans
+++ /dev/null
@@ -1,438 +0,0 @@
-#include "transcode_data.h"
-
-<%
- map = {
- "1b2842" => :func_so, # designate US-ASCII to G0. "ESC ( B"
- "1b284a" => :func_so, # designate JIS X 0201 latin to G0. "ESC ( J"
- "1b2440" => :func_so, # designate JIS X 0208 1978 to G0. "ESC $ @"
- "1b2442" => :func_so, # designate JIS X 0208 1983 to G0. "ESC $ B"
- "{00-0d,10-1a,1c-7f}" => :func_si,
- }
- transcode_generate_node(ActionMap.parse(map), "iso2022jp_decoder")
-
- map_jisx0208_rest = {
- "{21-7e}" => :func_so
- }
- transcode_generate_node(ActionMap.parse(map_jisx0208_rest), "iso2022jp_decoder_jisx0208_rest")
-
- map = {
- "{00-0d,10-1a,1c-7f}" => :func_so,
- "90{a1-fe}{a1-fe}" => :func_so,
- "92{a1-fe}{a1-fe}" => :func_so,
- }
- transcode_generate_node(ActionMap.parse(map), "iso2022jp_encoder")
-
- map = {
- "{00-0d,10-1a,1c-7f}" => :nomap,
- "90{a1-fe}{a1-fe}" => :func_so,
- "92{a1-fe}{a1-fe}" => :func_so,
- }
- transcode_generate_node(ActionMap.parse(map), "stateless_iso2022jp_to_eucjp")
-
- map = {
- "{0e,0f,1b}" => :undef,
- "{00-0d,10-1a,1c-7f}" => :nomap,
- "{a1-fe}{a1-fe}" => :func_so,
- "8e{a1-fe}" => :undef,
- "8f{a1-fe}{a1-fe}" => :undef,
- }
- transcode_generate_node(ActionMap.parse(map), "eucjp_to_stateless_iso2022jp")
-
- map = {
- "1b2842" => :func_so, # designate US-ASCII to G0. "ESC ( B"
- "1b2849" => :func_so, # designate JIS X 0201 katakana to G0. "ESC ( I"
- "1b284a" => :func_so, # designate JIS X 0201 latin to G0. "ESC ( J"
- "1b2440" => :func_so, # designate JIS X 0208 1978 to G0. "ESC $ @"
- "1b2442" => :func_so, # designate JIS X 0208 1983 to G0. "ESC $ B"
- "0e" => :func_so, # designate JIS X 0201 katakana to G0. "SO"
- "0f" => :func_so, # designate US-ASCII to G0. "SI"
- "{00-0d,10-1a,1c-92}" => :func_si,
- }
- transcode_generate_node(ActionMap.parse(map), "cp50221_decoder")
-
- map = {
- "{0e,0f,1b}" => :undef,
- "{00-0d,10-1a,1c-7f}" => :func_so,
- "{a1-fe}{a1-fe}" => :func_so,
- "8e{a1-fe}" => :func_so,
- }
- transcode_generate_node(ActionMap.parse(map), "cp50221_encoder")
-
-%>
-
-<%= transcode_generated_code %>
-
-#define G0_ASCII 0
-/* ignore JIS X 0201 latin */
-#define G0_JISX0208_1978 1
-#define G0_JISX0208_1983 2
-#define G0_JISX0201_KATAKANA 3
-
-#define EMACS_MULE_LEADING_CODE_JISX0208_1978 0220
-#define EMACS_MULE_LEADING_CODE_JISX0208_1983 0222
-
-static int
-iso2022jp_init(void *statep)
-{
- unsigned char *sp = statep;
- *sp = G0_ASCII;
- return 0;
-}
-
-static VALUE
-fun_si_iso2022jp_decoder(void *statep, const unsigned char *s, size_t l)
-{
- unsigned char *sp = statep;
- if (*sp == G0_ASCII)
- return (VALUE)NOMAP;
- else if (0x21 <= s[0] && s[0] <= 0x7e)
- return (VALUE)iso2022jp_decoder_jisx0208_rest;
- else
- return (VALUE)INVALID;
-}
-
-static ssize_t
-fun_so_iso2022jp_decoder(void *statep, const unsigned char *s, size_t l, unsigned char* o, size_t osize)
-{
- unsigned char *sp = statep;
- if (s[0] == 0x1b) {
- if (s[1] == '(') {
- switch (s[l-1]) {
- case 'B':
- case 'J':
- *sp = G0_ASCII;
- break;
- }
- }
- else {
- switch (s[l-1]) {
- case '@':
- *sp = G0_JISX0208_1978;
- break;
-
- case 'B':
- *sp = G0_JISX0208_1983;
- break;
- }
- }
- return 0;
- }
- else {
- if (*sp == G0_JISX0208_1978)
- o[0] = EMACS_MULE_LEADING_CODE_JISX0208_1978;
- else
- o[0] = EMACS_MULE_LEADING_CODE_JISX0208_1983;
- o[1] = s[0] | 0x80;
- o[2] = s[1] | 0x80;
- return 3;
- }
-}
-
-static const rb_transcoder
-rb_iso2022jp_decoder = {
- "ISO-2022-JP", "stateless-ISO-2022-JP", iso2022jp_decoder,
- TRANSCODE_TABLE_INFO,
- 1, /* input_unit_length */
- 3, /* max_input */
- 3, /* max_output */
- asciicompat_decoder, /* asciicompat_type */
- 1, iso2022jp_init, iso2022jp_init, /* state_size, state_init, state_fini */
- NULL, fun_si_iso2022jp_decoder, NULL, fun_so_iso2022jp_decoder
-};
-
-static ssize_t
-fun_so_iso2022jp_encoder(void *statep, const unsigned char *s, size_t l, unsigned char *o, size_t osize)
-{
- unsigned char *sp = statep;
- unsigned char *output0 = o;
- int newstate;
-
- if (l == 1)
- newstate = G0_ASCII;
- else if (s[0] == EMACS_MULE_LEADING_CODE_JISX0208_1978)
- newstate = G0_JISX0208_1978;
- else
- newstate = G0_JISX0208_1983;
-
- if (*sp != newstate) {
- if (newstate == G0_ASCII) {
- *o++ = 0x1b;
- *o++ = '(';
- *o++ = 'B';
- }
- else if (newstate == G0_JISX0208_1978) {
- *o++ = 0x1b;
- *o++ = '$';
- *o++ = '@';
- }
- else {
- *o++ = 0x1b;
- *o++ = '$';
- *o++ = 'B';
- }
- *sp = newstate;
- }
-
- if (l == 1) {
- *o++ = s[0] & 0x7f;
- }
- else {
- *o++ = s[1] & 0x7f;
- *o++ = s[2] & 0x7f;
- }
-
- return o - output0;
-}
-
-static ssize_t
-iso2022jp_encoder_reset_sequence_size(void *statep)
-{
- unsigned char *sp = statep;
- if (*sp != G0_ASCII)
- return 3;
- return 0;
-}
-
-static ssize_t
-finish_iso2022jp_encoder(void *statep, unsigned char *o, size_t osize)
-{
- unsigned char *sp = statep;
- unsigned char *output0 = o;
-
- if (*sp == G0_ASCII)
- return 0;
-
- *o++ = 0x1b;
- *o++ = '(';
- *o++ = 'B';
- *sp = G0_ASCII;
-
- return o - output0;
-}
-
-static const rb_transcoder
-rb_iso2022jp_encoder = {
- "stateless-ISO-2022-JP", "ISO-2022-JP", iso2022jp_encoder,
- TRANSCODE_TABLE_INFO,
- 1, /* input_unit_length */
- 3, /* max_input */
- 5, /* max_output */
- asciicompat_encoder, /* asciicompat_type */
- 1, iso2022jp_init, iso2022jp_init, /* state_size, state_init, state_fini */
- NULL, NULL, NULL, fun_so_iso2022jp_encoder,
- finish_iso2022jp_encoder,
- iso2022jp_encoder_reset_sequence_size, finish_iso2022jp_encoder
-};
-
-static ssize_t
-fun_so_stateless_iso2022jp_to_eucjp(void *statep, const unsigned char *s, size_t l, unsigned char *o, size_t osize)
-{
- o[0] = s[1];
- o[1] = s[2];
- return 2;
-}
-
-static const rb_transcoder
-rb_stateless_iso2022jp_to_eucjp = {
- "stateless-ISO-2022-JP", "EUC-JP", stateless_iso2022jp_to_eucjp,
- TRANSCODE_TABLE_INFO,
- 1, /* input_unit_length */
- 3, /* max_input */
- 2, /* max_output */
- asciicompat_converter, /* asciicompat_type */
- 0, NULL, NULL, /* state_size, state_init, state_fini */
- NULL, NULL, NULL, fun_so_stateless_iso2022jp_to_eucjp,
-};
-
-static ssize_t
-fun_so_eucjp_to_stateless_iso2022jp(void *statep, const unsigned char *s, size_t l, unsigned char *o, size_t osize)
-{
- o[0] = EMACS_MULE_LEADING_CODE_JISX0208_1983;
- o[1] = s[0];
- o[2] = s[1];
- return 3;
-}
-
-static const rb_transcoder
-rb_eucjp_to_stateless_iso2022jp = {
- "EUC-JP", "stateless-ISO-2022-JP", eucjp_to_stateless_iso2022jp,
- TRANSCODE_TABLE_INFO,
- 1, /* input_unit_length */
- 3, /* max_input */
- 3, /* max_output */
- asciicompat_converter, /* asciicompat_type */
- 0, NULL, NULL, /* state_size, state_init, state_fini */
- NULL, NULL, NULL, fun_so_eucjp_to_stateless_iso2022jp,
-};
-
-static VALUE
-fun_si_cp50221_decoder(void *statep, const unsigned char *s, size_t l)
-{
- unsigned char *sp = statep;
- switch (*sp) {
- case G0_ASCII:
- return (VALUE)NOMAP;
- case G0_JISX0201_KATAKANA:
- if (0x21 <= s[0] && s[0] <= 0x5f)
- return (VALUE)FUNso;
- break;
- case G0_JISX0208_1978:
- if (0x21 <= s[0] && s[0] <= 0x28 || 0x30 <= s[0] && s[0] <= 0x74)
- return (VALUE)iso2022jp_decoder_jisx0208_rest;
- break;
- case G0_JISX0208_1983:
- if (0x21 <= s[0] && s[0] <= 0x28 ||
- s[0] == 0x2D ||
- 0x30 <= s[0] && s[0] <= 0x74 ||
- 0x79 <= s[0] && s[0] <= 0x7C)
- /* 0x7F <= s[0] && s[0] <= 0x92) */
- return (VALUE)iso2022jp_decoder_jisx0208_rest;
- break;
- }
- return (VALUE)INVALID;
-}
-
-static ssize_t
-fun_so_cp50221_decoder(void *statep, const unsigned char *s, size_t l, unsigned char* o, size_t osize)
-{
- unsigned char *sp = statep;
- switch (s[0]) {
- case 0x1b:
- if (s[1] == '(') {
- switch (s[l-1]) {
- case 'B':
- case 'J':
- *sp = G0_ASCII;
- break;
- case 'I':
- *sp = G0_JISX0201_KATAKANA;
- break;
- }
- }
- else {
- switch (s[l-1]) {
- case '@':
- *sp = G0_JISX0208_1978;
- break;
- case 'B':
- *sp = G0_JISX0208_1983;
- break;
- }
- }
- return 0;
- case 0x0E:
- *sp = G0_JISX0201_KATAKANA;
- return 0;
- case 0x0F:
- *sp = G0_ASCII;
- return 0;
- default:
- if (*sp == G0_JISX0201_KATAKANA) {
- o[0] = 0x8E;
- o[1] = s[0] | 0x80;
- }
- /* else if (0x7F == s[0] && s[0] <= 0x88) { */
- /* User Defined Characters */
- /* o[n++] = s[0] | 0xE0; */
- /* o[n++] = s[1] | 0x80; */
- /* else if (0x89 <= s[0] && s[0] <= 0x92) { */
- /* User Defined Characters 2 */
- /* o[n++] = 0x8f; */
- /* o[n++] = s[0] + 0x6C; */
- /* o[n++] = s[1] | 0x80; */
- /* } */
- else {
- /* JIS X 0208 */
- /* NEC Special Characters */
- /* NEC-selected IBM extended Characters */
- o[0] = s[0] | 0x80;
- o[1] = s[1] | 0x80;
- }
- return 2;
- }
-}
-
-static const rb_transcoder
-rb_cp50221_decoder = {
- "CP50221", "cp51932", cp50221_decoder,
- TRANSCODE_TABLE_INFO,
- 1, /* input_unit_length */
- 3, /* max_input */
- 3, /* max_output */
- asciicompat_decoder, /* asciicompat_type */
- 1, iso2022jp_init, iso2022jp_init, /* state_size, state_init, state_fini */
- NULL, fun_si_cp50221_decoder, NULL, fun_so_cp50221_decoder
-};
-
-static ssize_t
-fun_so_cp50221_encoder(void *statep, const unsigned char *s, size_t l, unsigned char *o, size_t osize)
-{
- unsigned char *sp = statep;
- unsigned char *output0 = o;
- int newstate;
-
- if (l == 1)
- newstate = G0_ASCII;
- else if (s[0] == 0x8E) {
- s++;
- l = 1;
- newstate = G0_JISX0201_KATAKANA;
- }
- else
- newstate = G0_JISX0208_1983;
-
- if (*sp != newstate) {
- if (newstate == G0_ASCII) {
- *o++ = 0x1b;
- *o++ = '(';
- *o++ = 'B';
- }
- else if (newstate == G0_JISX0201_KATAKANA) {
- *o++ = 0x1b;
- *o++ = '(';
- *o++ = 'I';
- }
- else {
- *o++ = 0x1b;
- *o++ = '$';
- *o++ = 'B';
- }
- *sp = newstate;
- }
-
- if (l == 1) {
- *o++ = s[0] & 0x7f;
- }
- else {
- *o++ = s[0] & 0x7f;
- *o++ = s[1] & 0x7f;
- }
-
- return o - output0;
-}
-
-static const rb_transcoder
-rb_cp50221_encoder = {
- "CP51932", "CP50221", cp50221_encoder,
- TRANSCODE_TABLE_INFO,
- 1, /* input_unit_length */
- 3, /* max_input */
- 5, /* max_output */
- asciicompat_encoder, /* asciicompat_type */
- 1, iso2022jp_init, iso2022jp_init, /* state_size, state_init, state_fini */
- NULL, NULL, NULL, fun_so_cp50221_encoder,
- finish_iso2022jp_encoder,
- iso2022jp_encoder_reset_sequence_size, finish_iso2022jp_encoder
-};
-
-void
-Init_iso2022(void)
-{
- rb_register_transcoder(&rb_iso2022jp_decoder);
- rb_register_transcoder(&rb_iso2022jp_encoder);
- rb_register_transcoder(&rb_stateless_iso2022jp_to_eucjp);
- rb_register_transcoder(&rb_eucjp_to_stateless_iso2022jp);
- rb_register_transcoder(&rb_cp50221_decoder);
- rb_register_transcoder(&rb_cp50221_encoder);
-}
-
diff --git a/enc/trans/japanese.trans b/enc/trans/japanese.trans
deleted file mode 100644
index ce5d0bb70f..0000000000
--- a/enc/trans/japanese.trans
+++ /dev/null
@@ -1,98 +0,0 @@
-#include "transcode_data.h"
-
-<%
- map = {}
- map["{00-7f}"] = :nomap
- map["{a1-fe}{a1-fe}"] = :func_so
- map["8e{a1-df}"] = :func_so
- map["8e{e0-fe}"] = :undef
- map["8f{a1-fe}{a1-fe}"] = :undef
- transcode_generate_node(ActionMap.parse(map), "eucjp2sjis")
-
- map = {}
- map["{00-7f}"] = :nomap
- map["{81-9f,e0-ef}{40-7e,80-fc}"] = :func_so
- map["{f0-fc}{40-7e,80-fc}"] = :undef
- map["{a1-df}"] = :func_so
- transcode_generate_node(ActionMap.parse(map), "sjis2eucjp")
-%>
-
-<%= transcode_generated_code %>
-
-static ssize_t
-fun_so_eucjp2sjis(void *statep, const unsigned char *s, size_t l, unsigned char *o, size_t osize)
-{
- if (s[0] == 0x8e) {
- o[0] = s[1];
- return 1;
- }
- else {
- int h, m, l;
- m = s[0] & 1;
- h = (s[0]+m) >> 1;
- h += s[0] < 0xdf ? 0x30 : 0x70;
- l = s[1] - m * 94 - 3;
- if (0x7f <= l)
- l++;
- o[0] = h;
- o[1] = l;
- return 2;
- }
-}
-
-static ssize_t
-fun_so_sjis2eucjp(void *statep, const unsigned char *s, size_t l, unsigned char *o, size_t osize)
-{
- if (l == 1) {
- o[0] = '\x8e';
- o[1] = s[0];
- return 2;
- }
- else {
- int h, l;
- h = s[0];
- l = s[1];
- if (0xe0 <= h)
- h -= 64;
- l += l < 0x80 ? 0x61 : 0x60;
- h = h * 2 - 0x61;
- if (0xfe < l) {
- l -= 94;
- h += 1;
- }
- o[0] = h;
- o[1] = l;
- return 2;
- }
-}
-
-static const rb_transcoder
-rb_eucjp2sjis = {
- "EUC-JP", "Shift_JIS", eucjp2sjis,
- TRANSCODE_TABLE_INFO,
- 1, /* input_unit_length */
- 3, /* max_input */
- 2, /* max_output */
- asciicompat_converter, /* asciicompat_type */
- 0, NULL, NULL, /* state_size, state_init, state_fini */
- NULL, NULL, NULL, fun_so_eucjp2sjis
-};
-
-static const rb_transcoder
-rb_sjis2eucjp = {
- "Shift_JIS", "EUC-JP", sjis2eucjp,
- TRANSCODE_TABLE_INFO,
- 1, /* input_unit_length */
- 2, /* max_input */
- 2, /* max_output */
- asciicompat_converter, /* asciicompat_type */
- 0, NULL, NULL, /* state_size, state_init, state_fini */
- NULL, NULL, NULL, fun_so_sjis2eucjp
-};
-
-void
-Init_japanese(void)
-{
- rb_register_transcoder(&rb_eucjp2sjis);
- rb_register_transcoder(&rb_sjis2eucjp);
-}
diff --git a/enc/trans/japanese_euc.trans b/enc/trans/japanese_euc.trans
deleted file mode 100644
index a976fe57d3..0000000000
--- a/enc/trans/japanese_euc.trans
+++ /dev/null
@@ -1,46 +0,0 @@
-#include "transcode_data.h"
-
-<%
- transcode_tblgen "EUC-JP", "UTF-8",
- [["{00-7f}", :nomap]] +
- citrus_decode_mapsrc("euc", 0x8080, "JISX0208:1990/UCS") +
- citrus_decode_mapsrc("euc", 0x0080, "JISX0201-KANA/UCS") +
- citrus_decode_mapsrc("euc", 0x8000, "JISX0212/UCS")
-
- transcode_tblgen "eucJP-ms", "UTF-8",
- [["{00-7f}", :nomap]] +
- citrus_decode_mapsrc("euc", 0x8080, "JISX0208VDC:NEC/UCS,JISX0208UDC/UCS,JISX0208:MS/UCS") +
- citrus_decode_mapsrc("euc", 0x0080, "JISX0201-KANA/UCS") +
- citrus_decode_mapsrc("euc", 0x8000, "JISX0212VDC:IBM/UCS,JISX0212UDC/UCS,JISX0212:MS/UCS")
-
- transcode_tblgen "CP51932", "UTF-8",
- [["{00-7f}", :nomap]] +
- citrus_decode_mapsrc("euc", 0x8080, "JISX0208VDC:NEC/UCS,CP932VDC:NEC_IBM/UCS,JISX0208:MS/UCS") +
- citrus_decode_mapsrc("euc", 0x0080, "JISX0201-KANA/UCS")
-
-
- transcode_tblgen "UTF-8", "EUC-JP",
- [["{00-7f}", :nomap]] +
- citrus_decode_mapsrc("euc", 0x8080, "UCS/JISX0208:1990") +
- citrus_decode_mapsrc("euc", 0x0080, "UCS/JISX0201-KANA") +
- citrus_decode_mapsrc("euc", 0x8000, "UCS/JISX0212")
-
- transcode_tblgen "UTF-8", "eucJP-ms",
- [["{00-7f}", :nomap]] +
- citrus_decode_mapsrc("euc", 0x8080, "UCS/JISX0208:MS,UCS/JISX0208VDC:NEC,UCS/JISX0208UDC") +
- citrus_decode_mapsrc("euc", 0x0080, "UCS/JISX0201-KANA") +
- citrus_decode_mapsrc("euc", 0x8000, "UCS/JISX0212VDC:IBM,UCS/JISX0212UDC,UCS/JISX0212:MS")
-
- transcode_tblgen "UTF-8", "CP51932",
- [["{00-7f}", :nomap]] +
- citrus_decode_mapsrc("euc", 0x8080, "UCS/JISX0208:MS,UCS/JISX0208VDC:NEC,UCS/CP932VDC:NEC_IBM") +
- citrus_decode_mapsrc("euc", 0x0080, "UCS/JISX0201-KANA")
-%>
-
-<%= transcode_generated_code %>
-
-void
-Init_japanese_euc(void)
-{
-<%= transcode_register_code %>
-}
diff --git a/enc/trans/japanese_sjis.trans b/enc/trans/japanese_sjis.trans
deleted file mode 100644
index 00eace27a3..0000000000
--- a/enc/trans/japanese_sjis.trans
+++ /dev/null
@@ -1,34 +0,0 @@
-#include "transcode_data.h"
-
-<%
- transcode_tblgen "Shift_JIS", "UTF-8",
- [["{00-7f}", :nomap]] +
- citrus_decode_mapsrc("mskanji", 1, "JISX0201-KANA/UCS") +
- citrus_decode_mapsrc("mskanji", 2, "JISX0208:1990/UCS")
-
- transcode_tblgen "Windows-31J", "UTF-8",
- [["{00-7f}", :nomap]] +
- citrus_decode_mapsrc("mskanji", 1, "JISX0201-KANA/UCS") +
- citrus_decode_mapsrc("mskanji", 2,
- "JISX0208VDC:NEC/UCS,CP932VDC:NEC_IBM/UCS,CP932VDC:IBM/UCS,CP932UDA/UCS,JISX0208:MS/UCS")
-
-
- transcode_tblgen "UTF-8", "Shift_JIS",
- [["{00-7f}", :nomap]] +
- citrus_decode_mapsrc("mskanji", 1, "UCS/JISX0201-KANA") +
- citrus_decode_mapsrc("mskanji", 2, "UCS/JISX0208:1990")
-
- transcode_tblgen "UTF-8", "Windows-31J",
- [["{00-7f}", :nomap]] +
- citrus_decode_mapsrc("mskanji", 1, "UCS/JISX0201-KANA") +
- citrus_decode_mapsrc("mskanji", 2,
- "UCS/JISX0208:MS,UCS/JISX0208VDC:NEC,UCS/CP932VDC:IBM,UCS/CP932VDC:NEC_IBM,UCS/CP932UDA")
-%>
-
-<%= transcode_generated_code %>
-
-void
-Init_japanese_sjis(void)
-{
-<%= transcode_register_code %>
-}
diff --git a/enc/trans/koi8-r-tbl.rb b/enc/trans/koi8-r-tbl.rb
deleted file mode 100644
index a1f55ff2e3..0000000000
--- a/enc/trans/koi8-r-tbl.rb
+++ /dev/null
@@ -1,130 +0,0 @@
-KOI8_R_TO_UCS_TBL = [
- ["9A",0xA0],
- ["BF",0xA9],
- ["9C",0xB0],
- ["9D",0xB2],
- ["9E",0xB7],
- ["9F",0xF7],
- ["B3",0x401],
- ["E1",0x410],
- ["E2",0x411],
- ["F7",0x412],
- ["E7",0x413],
- ["E4",0x414],
- ["E5",0x415],
- ["F6",0x416],
- ["FA",0x417],
- ["E9",0x418],
- ["EA",0x419],
- ["EB",0x41A],
- ["EC",0x41B],
- ["ED",0x41C],
- ["EE",0x41D],
- ["EF",0x41E],
- ["F0",0x41F],
- ["F2",0x420],
- ["F3",0x421],
- ["F4",0x422],
- ["F5",0x423],
- ["E6",0x424],
- ["E8",0x425],
- ["E3",0x426],
- ["FE",0x427],
- ["FB",0x428],
- ["FD",0x429],
- ["FF",0x42A],
- ["F9",0x42B],
- ["F8",0x42C],
- ["FC",0x42D],
- ["E0",0x42E],
- ["F1",0x42F],
- ["C1",0x430],
- ["C2",0x431],
- ["D7",0x432],
- ["C7",0x433],
- ["C4",0x434],
- ["C5",0x435],
- ["D6",0x436],
- ["DA",0x437],
- ["C9",0x438],
- ["CA",0x439],
- ["CB",0x43A],
- ["CC",0x43B],
- ["CD",0x43C],
- ["CE",0x43D],
- ["CF",0x43E],
- ["D0",0x43F],
- ["D2",0x440],
- ["D3",0x441],
- ["D4",0x442],
- ["D5",0x443],
- ["C6",0x444],
- ["C8",0x445],
- ["C3",0x446],
- ["DE",0x447],
- ["DB",0x448],
- ["DD",0x449],
- ["DF",0x44A],
- ["D9",0x44B],
- ["D8",0x44C],
- ["DC",0x44D],
- ["C0",0x44E],
- ["D1",0x44F],
- ["A3",0x451],
- ["95",0x2219],
- ["96",0x221A],
- ["97",0x2248],
- ["98",0x2264],
- ["99",0x2265],
- ["93",0x2320],
- ["9B",0x2321],
- ["80",0x2500],
- ["81",0x2502],
- ["82",0x250C],
- ["83",0x2510],
- ["84",0x2514],
- ["85",0x2518],
- ["86",0x251C],
- ["87",0x2524],
- ["88",0x252C],
- ["89",0x2534],
- ["8A",0x253C],
- ["A0",0x2550],
- ["A1",0x2551],
- ["A2",0x2552],
- ["A4",0x2553],
- ["A5",0x2554],
- ["A6",0x2555],
- ["A7",0x2556],
- ["A8",0x2557],
- ["A9",0x2558],
- ["AA",0x2559],
- ["AB",0x255A],
- ["AC",0x255B],
- ["AD",0x255C],
- ["AE",0x255D],
- ["AF",0x255E],
- ["B0",0x255F],
- ["B1",0x2560],
- ["B2",0x2561],
- ["B4",0x2562],
- ["B5",0x2563],
- ["B6",0x2564],
- ["B7",0x2565],
- ["B8",0x2566],
- ["B9",0x2567],
- ["BA",0x2568],
- ["BB",0x2569],
- ["BC",0x256A],
- ["BD",0x256B],
- ["BE",0x256C],
- ["8B",0x2580],
- ["8C",0x2584],
- ["8D",0x2588],
- ["8E",0x258C],
- ["8F",0x2590],
- ["90",0x2591],
- ["91",0x2592],
- ["92",0x2593],
- ["94",0x25A0],
-] \ No newline at end of file
diff --git a/enc/trans/koi8-u-tbl.rb b/enc/trans/koi8-u-tbl.rb
deleted file mode 100644
index e87aa1aa3f..0000000000
--- a/enc/trans/koi8-u-tbl.rb
+++ /dev/null
@@ -1,130 +0,0 @@
-KOI8_U_TO_UCS_TBL = [
- ["9A",0xA0],
- ["BF",0xA9],
- ["9C",0xB0],
- ["9D",0xB2],
- ["9E",0xB7],
- ["9F",0xF7],
- ["B3",0x401],
- ["B4",0x404],
- ["B6",0x406],
- ["B7",0x407],
- ["E1",0x410],
- ["E2",0x411],
- ["F7",0x412],
- ["E7",0x413],
- ["E4",0x414],
- ["E5",0x415],
- ["F6",0x416],
- ["FA",0x417],
- ["E9",0x418],
- ["EA",0x419],
- ["EB",0x41A],
- ["EC",0x41B],
- ["ED",0x41C],
- ["EE",0x41D],
- ["EF",0x41E],
- ["F0",0x41F],
- ["F2",0x420],
- ["F3",0x421],
- ["F4",0x422],
- ["F5",0x423],
- ["E6",0x424],
- ["E8",0x425],
- ["E3",0x426],
- ["FE",0x427],
- ["FB",0x428],
- ["FD",0x429],
- ["FF",0x42A],
- ["F9",0x42B],
- ["F8",0x42C],
- ["FC",0x42D],
- ["E0",0x42E],
- ["F1",0x42F],
- ["C1",0x430],
- ["C2",0x431],
- ["D7",0x432],
- ["C7",0x433],
- ["C4",0x434],
- ["C5",0x435],
- ["D6",0x436],
- ["DA",0x437],
- ["C9",0x438],
- ["CA",0x439],
- ["CB",0x43A],
- ["CC",0x43B],
- ["CD",0x43C],
- ["CE",0x43D],
- ["CF",0x43E],
- ["D0",0x43F],
- ["D2",0x440],
- ["D3",0x441],
- ["D4",0x442],
- ["D5",0x443],
- ["C6",0x444],
- ["C8",0x445],
- ["C3",0x446],
- ["DE",0x447],
- ["DB",0x448],
- ["DD",0x449],
- ["DF",0x44A],
- ["D9",0x44B],
- ["D8",0x44C],
- ["DC",0x44D],
- ["C0",0x44E],
- ["D1",0x44F],
- ["A3",0x451],
- ["A4",0x454],
- ["A6",0x456],
- ["A7",0x457],
- ["BD",0x490],
- ["AD",0x491],
- ["95",0x2219],
- ["96",0x221A],
- ["97",0x2248],
- ["98",0x2264],
- ["99",0x2265],
- ["93",0x2320],
- ["9B",0x2321],
- ["80",0x2500],
- ["81",0x2502],
- ["82",0x250C],
- ["83",0x2510],
- ["84",0x2514],
- ["85",0x2518],
- ["86",0x251C],
- ["87",0x2524],
- ["88",0x252C],
- ["89",0x2534],
- ["8A",0x253C],
- ["A0",0x2550],
- ["A1",0x2551],
- ["A2",0x2552],
- ["A5",0x2554],
- ["A8",0x2557],
- ["A9",0x2558],
- ["AA",0x2559],
- ["AB",0x255A],
- ["AC",0x255B],
- ["AE",0x255D],
- ["AF",0x255E],
- ["B0",0x255F],
- ["B1",0x2560],
- ["B2",0x2561],
- ["B5",0x2563],
- ["B8",0x2566],
- ["B9",0x2567],
- ["BA",0x2568],
- ["BB",0x2569],
- ["BC",0x256A],
- ["BE",0x256C],
- ["8B",0x2580],
- ["8C",0x2584],
- ["8D",0x2588],
- ["8E",0x258C],
- ["8F",0x2590],
- ["90",0x2591],
- ["91",0x2592],
- ["92",0x2593],
- ["94",0x25A0],
-] \ No newline at end of file
diff --git a/enc/trans/korean.trans b/enc/trans/korean.trans
deleted file mode 100644
index ef1cdfcb8e..0000000000
--- a/enc/trans/korean.trans
+++ /dev/null
@@ -1,19 +0,0 @@
-#include "transcode_data.h"
-
-<%
- require "euckr-tbl"
- require "cp949-tbl"
-
- transcode_tblgen "UTF-8", "EUC-KR", [["{00-7f}", :nomap], *UCS_TO_EUCKR_TBL]
- transcode_tblgen "EUC-KR", "UTF-8", [["{00-7f}", :nomap], *EUCKR_TO_UCS_TBL]
- transcode_tblgen "UTF-8", "CP949", [["{00-7f}", :nomap], *UCS_TO_CP949_TBL]
- transcode_tblgen "CP949", "UTF-8", [["{00-7f}", :nomap], *CP949_TO_UCS_TBL]
-%>
-
-<%= transcode_generated_code %>
-
-void
-Init_korean(void)
-{
-<%= transcode_register_code %>
-}
diff --git a/enc/trans/maccroatian-tbl.rb b/enc/trans/maccroatian-tbl.rb
deleted file mode 100644
index 359878ec1f..0000000000
--- a/enc/trans/maccroatian-tbl.rb
+++ /dev/null
@@ -1,129 +0,0 @@
-MACCROATIAN_TO_UCS_TBL = [
- ["CA",0xA0],
- ["C1",0xA1],
- ["A2",0xA2],
- ["A3",0xA3],
- ["DB",0xA4],
- ["A4",0xA7],
- ["AC",0xA8],
- ["D9",0xA9],
- ["BB",0xAA],
- ["C7",0xAB],
- ["C2",0xAC],
- ["A8",0xAE],
- ["F8",0xAF],
- ["A1",0xB0],
- ["B1",0xB1],
- ["AB",0xB4],
- ["B5",0xB5],
- ["A6",0xB6],
- ["E1",0xB7],
- ["FC",0xB8],
- ["BC",0xBA],
- ["DF",0xBB],
- ["C0",0xBF],
- ["CB",0xC0],
- ["E7",0xC1],
- ["E5",0xC2],
- ["CC",0xC3],
- ["80",0xC4],
- ["81",0xC5],
- ["DE",0xC6],
- ["82",0xC7],
- ["E9",0xC8],
- ["83",0xC9],
- ["FD",0xCA],
- ["FA",0xCB],
- ["ED",0xCC],
- ["EA",0xCD],
- ["EB",0xCE],
- ["EC",0xCF],
- ["84",0xD1],
- ["F1",0xD2],
- ["EE",0xD3],
- ["EF",0xD4],
- ["CD",0xD5],
- ["85",0xD6],
- ["AF",0xD8],
- ["F4",0xD9],
- ["F2",0xDA],
- ["F3",0xDB],
- ["86",0xDC],
- ["A7",0xDF],
- ["88",0xE0],
- ["87",0xE1],
- ["89",0xE2],
- ["8B",0xE3],
- ["8A",0xE4],
- ["8C",0xE5],
- ["FE",0xE6],
- ["8D",0xE7],
- ["8F",0xE8],
- ["8E",0xE9],
- ["90",0xEA],
- ["91",0xEB],
- ["93",0xEC],
- ["92",0xED],
- ["94",0xEE],
- ["95",0xEF],
- ["96",0xF1],
- ["98",0xF2],
- ["97",0xF3],
- ["99",0xF4],
- ["9B",0xF5],
- ["9A",0xF6],
- ["D6",0xF7],
- ["BF",0xF8],
- ["9D",0xF9],
- ["9C",0xFA],
- ["9E",0xFB],
- ["9F",0xFC],
- ["C6",0x106],
- ["E6",0x107],
- ["C8",0x10C],
- ["E8",0x10D],
- ["D0",0x110],
- ["F0",0x111],
- ["F5",0x131],
- ["CE",0x152],
- ["CF",0x153],
- ["A9",0x160],
- ["B9",0x161],
- ["AE",0x17D],
- ["BE",0x17E],
- ["C4",0x192],
- ["F6",0x2C6],
- ["FF",0x2C7],
- ["FB",0x2DA],
- ["F7",0x2DC],
- ["F9",0x3C0],
- ["E0",0x2013],
- ["D1",0x2014],
- ["D4",0x2018],
- ["D5",0x2019],
- ["E2",0x201A],
- ["D2",0x201C],
- ["D3",0x201D],
- ["E3",0x201E],
- ["A0",0x2020],
- ["A5",0x2022],
- ["C9",0x2026],
- ["E4",0x2030],
- ["DC",0x2039],
- ["DD",0x203A],
- ["DA",0x2044],
- ["AA",0x2122],
- ["BD",0x2126],
- ["B6",0x2202],
- ["B4",0x2206],
- ["B8",0x220F],
- ["B7",0x2211],
- ["C3",0x221A],
- ["B0",0x221E],
- ["BA",0x222B],
- ["C5",0x2248],
- ["AD",0x2260],
- ["B2",0x2264],
- ["B3",0x2265],
- ["D7",0x25CA],
-] \ No newline at end of file
diff --git a/enc/trans/maccyrillic-tbl.rb b/enc/trans/maccyrillic-tbl.rb
deleted file mode 100644
index 378aa8c3bc..0000000000
--- a/enc/trans/maccyrillic-tbl.rb
+++ /dev/null
@@ -1,130 +0,0 @@
-MACCYRILLIC_TO_UCS_TBL = [
- ["CA",0xA0],
- ["A2",0xA2],
- ["A3",0xA3],
- ["FF",0xA4],
- ["A4",0xA7],
- ["A9",0xA9],
- ["C7",0xAB],
- ["C2",0xAC],
- ["A8",0xAE],
- ["A1",0xB0],
- ["B1",0xB1],
- ["B5",0xB5],
- ["A6",0xB6],
- ["C8",0xBB],
- ["D6",0xF7],
- ["C4",0x192],
- ["DD",0x401],
- ["AB",0x402],
- ["AE",0x403],
- ["B8",0x404],
- ["C1",0x405],
- ["A7",0x406],
- ["BA",0x407],
- ["B7",0x408],
- ["BC",0x409],
- ["BE",0x40A],
- ["CB",0x40B],
- ["CD",0x40C],
- ["D8",0x40E],
- ["DA",0x40F],
- ["80",0x410],
- ["81",0x411],
- ["82",0x412],
- ["83",0x413],
- ["84",0x414],
- ["85",0x415],
- ["86",0x416],
- ["87",0x417],
- ["88",0x418],
- ["89",0x419],
- ["8A",0x41A],
- ["8B",0x41B],
- ["8C",0x41C],
- ["8D",0x41D],
- ["8E",0x41E],
- ["8F",0x41F],
- ["90",0x420],
- ["91",0x421],
- ["92",0x422],
- ["93",0x423],
- ["94",0x424],
- ["95",0x425],
- ["96",0x426],
- ["97",0x427],
- ["98",0x428],
- ["99",0x429],
- ["9A",0x42A],
- ["9B",0x42B],
- ["9C",0x42C],
- ["9D",0x42D],
- ["9E",0x42E],
- ["9F",0x42F],
- ["E0",0x430],
- ["E1",0x431],
- ["E2",0x432],
- ["E3",0x433],
- ["E4",0x434],
- ["E5",0x435],
- ["E6",0x436],
- ["E7",0x437],
- ["E8",0x438],
- ["E9",0x439],
- ["EA",0x43A],
- ["EB",0x43B],
- ["EC",0x43C],
- ["ED",0x43D],
- ["EE",0x43E],
- ["EF",0x43F],
- ["F0",0x440],
- ["F1",0x441],
- ["F2",0x442],
- ["F3",0x443],
- ["F4",0x444],
- ["F5",0x445],
- ["F6",0x446],
- ["F7",0x447],
- ["F8",0x448],
- ["F9",0x449],
- ["FA",0x44A],
- ["FB",0x44B],
- ["FC",0x44C],
- ["FD",0x44D],
- ["FE",0x44E],
- ["DF",0x44F],
- ["DE",0x451],
- ["AC",0x452],
- ["AF",0x453],
- ["B9",0x454],
- ["CF",0x455],
- ["B4",0x456],
- ["BB",0x457],
- ["C0",0x458],
- ["BD",0x459],
- ["BF",0x45A],
- ["CC",0x45B],
- ["CE",0x45C],
- ["D9",0x45E],
- ["DB",0x45F],
- ["D0",0x2013],
- ["D1",0x2014],
- ["D4",0x2018],
- ["D5",0x2019],
- ["D2",0x201C],
- ["D3",0x201D],
- ["D7",0x201E],
- ["A0",0x2020],
- ["A5",0x2022],
- ["C9",0x2026],
- ["DC",0x2116],
- ["AA",0x2122],
- ["B6",0x2202],
- ["C6",0x2206],
- ["C3",0x221A],
- ["B0",0x221E],
- ["C5",0x2248],
- ["AD",0x2260],
- ["B2",0x2264],
- ["B3",0x2265],
-] \ No newline at end of file
diff --git a/enc/trans/macgreek-tbl.rb b/enc/trans/macgreek-tbl.rb
deleted file mode 100644
index 7f75fde6d2..0000000000
--- a/enc/trans/macgreek-tbl.rb
+++ /dev/null
@@ -1,129 +0,0 @@
-MACGREEK_TO_UCS_TBL = [
- ["CA",0xA0],
- ["92",0xA3],
- ["B4",0xA5],
- ["9B",0xA6],
- ["AC",0xA7],
- ["8C",0xA8],
- ["A9",0xA9],
- ["C7",0xAB],
- ["C2",0xAC],
- ["9C",0xAD],
- ["A8",0xAE],
- ["AE",0xB0],
- ["B1",0xB1],
- ["82",0xB2],
- ["84",0xB3],
- ["81",0xB9],
- ["C8",0xBB],
- ["97",0xBD],
- ["80",0xC4],
- ["83",0xC9],
- ["85",0xD6],
- ["86",0xDC],
- ["A7",0xDF],
- ["88",0xE0],
- ["89",0xE2],
- ["8A",0xE4],
- ["8D",0xE7],
- ["8F",0xE8],
- ["8E",0xE9],
- ["90",0xEA],
- ["91",0xEB],
- ["94",0xEE],
- ["95",0xEF],
- ["99",0xF4],
- ["9A",0xF6],
- ["D6",0xF7],
- ["9D",0xF9],
- ["9E",0xFB],
- ["9F",0xFC],
- ["CF",0x153],
- ["8B",0x384],
- ["87",0x385],
- ["CD",0x386],
- ["AF",0x387],
- ["CE",0x388],
- ["D7",0x389],
- ["D8",0x38A],
- ["D9",0x38C],
- ["DA",0x38E],
- ["DF",0x38F],
- ["FD",0x390],
- ["B0",0x391],
- ["B5",0x392],
- ["A1",0x393],
- ["A2",0x394],
- ["B6",0x395],
- ["B7",0x396],
- ["B8",0x397],
- ["A3",0x398],
- ["B9",0x399],
- ["BA",0x39A],
- ["A4",0x39B],
- ["BB",0x39C],
- ["C1",0x39D],
- ["A5",0x39E],
- ["C3",0x39F],
- ["A6",0x3A0],
- ["C4",0x3A1],
- ["AA",0x3A3],
- ["C6",0x3A4],
- ["CB",0x3A5],
- ["BC",0x3A6],
- ["CC",0x3A7],
- ["BE",0x3A8],
- ["BF",0x3A9],
- ["AB",0x3AA],
- ["BD",0x3AB],
- ["C0",0x3AC],
- ["DB",0x3AD],
- ["DC",0x3AE],
- ["DD",0x3AF],
- ["FE",0x3B0],
- ["E1",0x3B1],
- ["E2",0x3B2],
- ["E7",0x3B3],
- ["E4",0x3B4],
- ["E5",0x3B5],
- ["FA",0x3B6],
- ["E8",0x3B7],
- ["F5",0x3B8],
- ["E9",0x3B9],
- ["EB",0x3BA],
- ["EC",0x3BB],
- ["ED",0x3BC],
- ["EE",0x3BD],
- ["EA",0x3BE],
- ["EF",0x3BF],
- ["F0",0x3C0],
- ["F2",0x3C1],
- ["F7",0x3C2],
- ["F3",0x3C3],
- ["F4",0x3C4],
- ["F9",0x3C5],
- ["E6",0x3C6],
- ["F8",0x3C7],
- ["E3",0x3C8],
- ["F6",0x3C9],
- ["FB",0x3CA],
- ["FC",0x3CB],
- ["DE",0x3CC],
- ["E0",0x3CD],
- ["F1",0x3CE],
- ["D0",0x2013],
- ["D1",0x2015],
- ["D4",0x2018],
- ["D5",0x2019],
- ["D2",0x201C],
- ["D3",0x201D],
- ["A0",0x2020],
- ["96",0x2022],
- ["C9",0x2026],
- ["98",0x2030],
- ["93",0x2122],
- ["C5",0x2248],
- ["AD",0x2260],
- ["B2",0x2264],
- ["B3",0x2265],
-] \ No newline at end of file
diff --git a/enc/trans/maciceland-tbl.rb b/enc/trans/maciceland-tbl.rb
deleted file mode 100644
index 818d992274..0000000000
--- a/enc/trans/maciceland-tbl.rb
+++ /dev/null
@@ -1,129 +0,0 @@
-MACICELAND_TO_UCS_TBL = [
- ["CA",0xA0],
- ["C1",0xA1],
- ["A2",0xA2],
- ["A3",0xA3],
- ["DB",0xA4],
- ["B4",0xA5],
- ["A4",0xA7],
- ["AC",0xA8],
- ["A9",0xA9],
- ["BB",0xAA],
- ["C7",0xAB],
- ["C2",0xAC],
- ["A8",0xAE],
- ["F8",0xAF],
- ["A1",0xB0],
- ["B1",0xB1],
- ["AB",0xB4],
- ["B5",0xB5],
- ["A6",0xB6],
- ["E1",0xB7],
- ["FC",0xB8],
- ["BC",0xBA],
- ["C8",0xBB],
- ["C0",0xBF],
- ["CB",0xC0],
- ["E7",0xC1],
- ["E5",0xC2],
- ["CC",0xC3],
- ["80",0xC4],
- ["81",0xC5],
- ["AE",0xC6],
- ["82",0xC7],
- ["E9",0xC8],
- ["83",0xC9],
- ["E6",0xCA],
- ["E8",0xCB],
- ["ED",0xCC],
- ["EA",0xCD],
- ["EB",0xCE],
- ["EC",0xCF],
- ["DC",0xD0],
- ["84",0xD1],
- ["F1",0xD2],
- ["EE",0xD3],
- ["EF",0xD4],
- ["CD",0xD5],
- ["85",0xD6],
- ["AF",0xD8],
- ["F4",0xD9],
- ["F2",0xDA],
- ["F3",0xDB],
- ["86",0xDC],
- ["A0",0xDD],
- ["DE",0xDE],
- ["A7",0xDF],
- ["88",0xE0],
- ["87",0xE1],
- ["89",0xE2],
- ["8B",0xE3],
- ["8A",0xE4],
- ["8C",0xE5],
- ["BE",0xE6],
- ["8D",0xE7],
- ["8F",0xE8],
- ["8E",0xE9],
- ["90",0xEA],
- ["91",0xEB],
- ["93",0xEC],
- ["92",0xED],
- ["94",0xEE],
- ["95",0xEF],
- ["DD",0xF0],
- ["96",0xF1],
- ["98",0xF2],
- ["97",0xF3],
- ["99",0xF4],
- ["9B",0xF5],
- ["9A",0xF6],
- ["D6",0xF7],
- ["BF",0xF8],
- ["9D",0xF9],
- ["9C",0xFA],
- ["9E",0xFB],
- ["9F",0xFC],
- ["E0",0xFD],
- ["DF",0xFE],
- ["D8",0xFF],
- ["F5",0x131],
- ["CE",0x152],
- ["CF",0x153],
- ["D9",0x178],
- ["C4",0x192],
- ["F6",0x2C6],
- ["FF",0x2C7],
- ["F9",0x2D8],
- ["FA",0x2D9],
- ["FB",0x2DA],
- ["FE",0x2DB],
- ["F7",0x2DC],
- ["FD",0x2DD],
- ["B9",0x3C0],
- ["D0",0x2013],
- ["D1",0x2014],
- ["D4",0x2018],
- ["D5",0x2019],
- ["E2",0x201A],
- ["D2",0x201C],
- ["D3",0x201D],
- ["E3",0x201E],
- ["A5",0x2022],
- ["C9",0x2026],
- ["E4",0x2030],
- ["DA",0x2044],
- ["AA",0x2122],
- ["BD",0x2126],
- ["B6",0x2202],
- ["C6",0x2206],
- ["B8",0x220F],
- ["B7",0x2211],
- ["C3",0x221A],
- ["B0",0x221E],
- ["BA",0x222B],
- ["C5",0x2248],
- ["AD",0x2260],
- ["B2",0x2264],
- ["B3",0x2265],
- ["D7",0x25CA],
-] \ No newline at end of file
diff --git a/enc/trans/macroman-tbl.rb b/enc/trans/macroman-tbl.rb
deleted file mode 100644
index 8f74eea27f..0000000000
--- a/enc/trans/macroman-tbl.rb
+++ /dev/null
@@ -1,129 +0,0 @@
-MACROMAN_TO_UCS_TBL = [
- ["CA",0xA0],
- ["C1",0xA1],
- ["A2",0xA2],
- ["A3",0xA3],
- ["DB",0xA4],
- ["B4",0xA5],
- ["A4",0xA7],
- ["AC",0xA8],
- ["A9",0xA9],
- ["BB",0xAA],
- ["C7",0xAB],
- ["C2",0xAC],
- ["A8",0xAE],
- ["F8",0xAF],
- ["A1",0xB0],
- ["B1",0xB1],
- ["AB",0xB4],
- ["B5",0xB5],
- ["A6",0xB6],
- ["E1",0xB7],
- ["FC",0xB8],
- ["BC",0xBA],
- ["C8",0xBB],
- ["C0",0xBF],
- ["CB",0xC0],
- ["E7",0xC1],
- ["E5",0xC2],
- ["CC",0xC3],
- ["80",0xC4],
- ["81",0xC5],
- ["AE",0xC6],
- ["82",0xC7],
- ["E9",0xC8],
- ["83",0xC9],
- ["E6",0xCA],
- ["E8",0xCB],
- ["ED",0xCC],
- ["EA",0xCD],
- ["EB",0xCE],
- ["EC",0xCF],
- ["84",0xD1],
- ["F1",0xD2],
- ["EE",0xD3],
- ["EF",0xD4],
- ["CD",0xD5],
- ["85",0xD6],
- ["AF",0xD8],
- ["F4",0xD9],
- ["F2",0xDA],
- ["F3",0xDB],
- ["86",0xDC],
- ["A7",0xDF],
- ["88",0xE0],
- ["87",0xE1],
- ["89",0xE2],
- ["8B",0xE3],
- ["8A",0xE4],
- ["8C",0xE5],
- ["BE",0xE6],
- ["8D",0xE7],
- ["8F",0xE8],
- ["8E",0xE9],
- ["90",0xEA],
- ["91",0xEB],
- ["93",0xEC],
- ["92",0xED],
- ["94",0xEE],
- ["95",0xEF],
- ["96",0xF1],
- ["98",0xF2],
- ["97",0xF3],
- ["99",0xF4],
- ["9B",0xF5],
- ["9A",0xF6],
- ["D6",0xF7],
- ["BF",0xF8],
- ["9D",0xF9],
- ["9C",0xFA],
- ["9E",0xFB],
- ["9F",0xFC],
- ["D8",0xFF],
- ["F5",0x131],
- ["CE",0x152],
- ["CF",0x153],
- ["D9",0x178],
- ["C4",0x192],
- ["F6",0x2C6],
- ["FF",0x2C7],
- ["F9",0x2D8],
- ["FA",0x2D9],
- ["FB",0x2DA],
- ["FE",0x2DB],
- ["F7",0x2DC],
- ["FD",0x2DD],
- ["B9",0x3C0],
- ["D0",0x2013],
- ["D1",0x2014],
- ["D4",0x2018],
- ["D5",0x2019],
- ["E2",0x201A],
- ["D2",0x201C],
- ["D3",0x201D],
- ["E3",0x201E],
- ["A0",0x2020],
- ["E0",0x2021],
- ["A5",0x2022],
- ["C9",0x2026],
- ["E4",0x2030],
- ["DC",0x2039],
- ["DD",0x203A],
- ["DA",0x2044],
- ["AA",0x2122],
- ["BD",0x2126],
- ["B6",0x2202],
- ["C6",0x2206],
- ["B8",0x220F],
- ["B7",0x2211],
- ["C3",0x221A],
- ["B0",0x221E],
- ["BA",0x222B],
- ["C5",0x2248],
- ["AD",0x2260],
- ["B2",0x2264],
- ["B3",0x2265],
- ["D7",0x25CA],
- ["DE",0xFB01],
- ["DF",0xFB02],
-] \ No newline at end of file
diff --git a/enc/trans/macromania-tbl.rb b/enc/trans/macromania-tbl.rb
deleted file mode 100644
index ff95c5e957..0000000000
--- a/enc/trans/macromania-tbl.rb
+++ /dev/null
@@ -1,129 +0,0 @@
-MACROMANIA_TO_UCS_TBL = [
- ["CA",0xA0],
- ["C1",0xA1],
- ["A2",0xA2],
- ["A3",0xA3],
- ["DB",0xA4],
- ["B4",0xA5],
- ["A4",0xA7],
- ["AC",0xA8],
- ["A9",0xA9],
- ["BB",0xAA],
- ["C7",0xAB],
- ["C2",0xAC],
- ["A8",0xAE],
- ["F8",0xAF],
- ["A1",0xB0],
- ["B1",0xB1],
- ["AB",0xB4],
- ["B5",0xB5],
- ["A6",0xB6],
- ["E1",0xB7],
- ["FC",0xB8],
- ["BC",0xBA],
- ["C8",0xBB],
- ["C0",0xBF],
- ["CB",0xC0],
- ["E7",0xC1],
- ["E5",0xC2],
- ["CC",0xC3],
- ["80",0xC4],
- ["81",0xC5],
- ["82",0xC7],
- ["E9",0xC8],
- ["83",0xC9],
- ["E6",0xCA],
- ["E8",0xCB],
- ["ED",0xCC],
- ["EA",0xCD],
- ["EB",0xCE],
- ["EC",0xCF],
- ["84",0xD1],
- ["F1",0xD2],
- ["EE",0xD3],
- ["EF",0xD4],
- ["CD",0xD5],
- ["85",0xD6],
- ["F4",0xD9],
- ["F2",0xDA],
- ["F3",0xDB],
- ["86",0xDC],
- ["A7",0xDF],
- ["88",0xE0],
- ["87",0xE1],
- ["89",0xE2],
- ["8B",0xE3],
- ["8A",0xE4],
- ["8C",0xE5],
- ["8D",0xE7],
- ["8F",0xE8],
- ["8E",0xE9],
- ["90",0xEA],
- ["91",0xEB],
- ["93",0xEC],
- ["92",0xED],
- ["94",0xEE],
- ["95",0xEF],
- ["96",0xF1],
- ["98",0xF2],
- ["97",0xF3],
- ["99",0xF4],
- ["9B",0xF5],
- ["9A",0xF6],
- ["D6",0xF7],
- ["9D",0xF9],
- ["9C",0xFA],
- ["9E",0xFB],
- ["9F",0xFC],
- ["D8",0xFF],
- ["AE",0x102],
- ["BE",0x103],
- ["F5",0x131],
- ["CE",0x152],
- ["CF",0x153],
- ["AF",0x15E],
- ["BF",0x15F],
- ["DE",0x162],
- ["DF",0x163],
- ["D9",0x178],
- ["C4",0x192],
- ["F6",0x2C6],
- ["FF",0x2C7],
- ["F9",0x2D8],
- ["FA",0x2D9],
- ["FB",0x2DA],
- ["FE",0x2DB],
- ["F7",0x2DC],
- ["FD",0x2DD],
- ["B9",0x3C0],
- ["D0",0x2013],
- ["D1",0x2014],
- ["D4",0x2018],
- ["D5",0x2019],
- ["E2",0x201A],
- ["D2",0x201C],
- ["D3",0x201D],
- ["E3",0x201E],
- ["A0",0x2020],
- ["E0",0x2021],
- ["A5",0x2022],
- ["C9",0x2026],
- ["E4",0x2030],
- ["DC",0x2039],
- ["DD",0x203A],
- ["DA",0x2044],
- ["AA",0x2122],
- ["BD",0x2126],
- ["B6",0x2202],
- ["C6",0x2206],
- ["B8",0x220F],
- ["B7",0x2211],
- ["C3",0x221A],
- ["B0",0x221E],
- ["BA",0x222B],
- ["C5",0x2248],
- ["AD",0x2260],
- ["B2",0x2264],
- ["B3",0x2265],
- ["D7",0x25CA],
-] \ No newline at end of file
diff --git a/enc/trans/macturkish-tbl.rb b/enc/trans/macturkish-tbl.rb
deleted file mode 100644
index 2358672ed6..0000000000
--- a/enc/trans/macturkish-tbl.rb
+++ /dev/null
@@ -1,128 +0,0 @@
-MACTURKISH_TO_UCS_TBL = [
- ["CA",0xA0],
- ["C1",0xA1],
- ["A2",0xA2],
- ["A3",0xA3],
- ["B4",0xA5],
- ["A4",0xA7],
- ["AC",0xA8],
- ["A9",0xA9],
- ["BB",0xAA],
- ["C7",0xAB],
- ["C2",0xAC],
- ["A8",0xAE],
- ["F8",0xAF],
- ["A1",0xB0],
- ["B1",0xB1],
- ["AB",0xB4],
- ["B5",0xB5],
- ["A6",0xB6],
- ["E1",0xB7],
- ["FC",0xB8],
- ["BC",0xBA],
- ["C8",0xBB],
- ["C0",0xBF],
- ["CB",0xC0],
- ["E7",0xC1],
- ["E5",0xC2],
- ["CC",0xC3],
- ["80",0xC4],
- ["81",0xC5],
- ["AE",0xC6],
- ["82",0xC7],
- ["E9",0xC8],
- ["83",0xC9],
- ["E6",0xCA],
- ["E8",0xCB],
- ["ED",0xCC],
- ["EA",0xCD],
- ["EB",0xCE],
- ["EC",0xCF],
- ["84",0xD1],
- ["F1",0xD2],
- ["EE",0xD3],
- ["EF",0xD4],
- ["CD",0xD5],
- ["85",0xD6],
- ["AF",0xD8],
- ["F4",0xD9],
- ["F2",0xDA],
- ["F3",0xDB],
- ["86",0xDC],
- ["A7",0xDF],
- ["88",0xE0],
- ["87",0xE1],
- ["89",0xE2],
- ["8B",0xE3],
- ["8A",0xE4],
- ["8C",0xE5],
- ["BE",0xE6],
- ["8D",0xE7],
- ["8F",0xE8],
- ["8E",0xE9],
- ["90",0xEA],
- ["91",0xEB],
- ["93",0xEC],
- ["92",0xED],
- ["94",0xEE],
- ["95",0xEF],
- ["96",0xF1],
- ["98",0xF2],
- ["97",0xF3],
- ["99",0xF4],
- ["9B",0xF5],
- ["9A",0xF6],
- ["D6",0xF7],
- ["BF",0xF8],
- ["9D",0xF9],
- ["9C",0xFA],
- ["9E",0xFB],
- ["9F",0xFC],
- ["D8",0xFF],
- ["DA",0x11E],
- ["DB",0x11F],
- ["DC",0x130],
- ["DD",0x131],
- ["CE",0x152],
- ["CF",0x153],
- ["DE",0x15E],
- ["DF",0x15F],
- ["D9",0x178],
- ["C4",0x192],
- ["F6",0x2C6],
- ["FF",0x2C7],
- ["F9",0x2D8],
- ["FA",0x2D9],
- ["FB",0x2DA],
- ["FE",0x2DB],
- ["F7",0x2DC],
- ["FD",0x2DD],
- ["B9",0x3C0],
- ["D0",0x2013],
- ["D1",0x2014],
- ["D4",0x2018],
- ["D5",0x2019],
- ["E2",0x201A],
- ["D2",0x201C],
- ["D3",0x201D],
- ["E3",0x201E],
- ["A0",0x2020],
- ["E0",0x2021],
- ["A5",0x2022],
- ["C9",0x2026],
- ["E4",0x2030],
- ["AA",0x2122],
- ["BD",0x2126],
- ["B6",0x2202],
- ["C6",0x2206],
- ["B8",0x220F],
- ["B7",0x2211],
- ["C3",0x221A],
- ["B0",0x221E],
- ["BA",0x222B],
- ["C5",0x2248],
- ["AD",0x2260],
- ["B2",0x2264],
- ["B3",0x2265],
- ["D7",0x25CA],
-] \ No newline at end of file
diff --git a/enc/trans/macukraine-tbl.rb b/enc/trans/macukraine-tbl.rb
deleted file mode 100644
index 6941af654d..0000000000
--- a/enc/trans/macukraine-tbl.rb
+++ /dev/null
@@ -1,130 +0,0 @@
-MACUKRAINE_TO_UCS_TBL = [
- ["CA",0xA0],
- ["A3",0xA3],
- ["FF",0xA4],
- ["A4",0xA7],
- ["A9",0xA9],
- ["C7",0xAB],
- ["C2",0xAC],
- ["A8",0xAE],
- ["A1",0xB0],
- ["B1",0xB1],
- ["B5",0xB5],
- ["A6",0xB6],
- ["C8",0xBB],
- ["D6",0xF7],
- ["C4",0x192],
- ["DD",0x401],
- ["AB",0x402],
- ["AE",0x403],
- ["B8",0x404],
- ["C1",0x405],
- ["A7",0x406],
- ["BA",0x407],
- ["B7",0x408],
- ["BC",0x409],
- ["BE",0x40A],
- ["CB",0x40B],
- ["CD",0x40C],
- ["D8",0x40E],
- ["DA",0x40F],
- ["80",0x410],
- ["81",0x411],
- ["82",0x412],
- ["83",0x413],
- ["84",0x414],
- ["85",0x415],
- ["86",0x416],
- ["87",0x417],
- ["88",0x418],
- ["89",0x419],
- ["8A",0x41A],
- ["8B",0x41B],
- ["8C",0x41C],
- ["8D",0x41D],
- ["8E",0x41E],
- ["8F",0x41F],
- ["90",0x420],
- ["91",0x421],
- ["92",0x422],
- ["93",0x423],
- ["94",0x424],
- ["95",0x425],
- ["96",0x426],
- ["97",0x427],
- ["98",0x428],
- ["99",0x429],
- ["9A",0x42A],
- ["9B",0x42B],
- ["9C",0x42C],
- ["9D",0x42D],
- ["9E",0x42E],
- ["9F",0x42F],
- ["E0",0x430],
- ["E1",0x431],
- ["E2",0x432],
- ["E3",0x433],
- ["E4",0x434],
- ["E5",0x435],
- ["E6",0x436],
- ["E7",0x437],
- ["E8",0x438],
- ["E9",0x439],
- ["EA",0x43A],
- ["EB",0x43B],
- ["EC",0x43C],
- ["ED",0x43D],
- ["EE",0x43E],
- ["EF",0x43F],
- ["F0",0x440],
- ["F1",0x441],
- ["F2",0x442],
- ["F3",0x443],
- ["F4",0x444],
- ["F5",0x445],
- ["F6",0x446],
- ["F7",0x447],
- ["F8",0x448],
- ["F9",0x449],
- ["FA",0x44A],
- ["FB",0x44B],
- ["FC",0x44C],
- ["FD",0x44D],
- ["FE",0x44E],
- ["DF",0x44F],
- ["DE",0x451],
- ["AC",0x452],
- ["AF",0x453],
- ["B9",0x454],
- ["CF",0x455],
- ["B4",0x456],
- ["BB",0x457],
- ["C0",0x458],
- ["BD",0x459],
- ["BF",0x45A],
- ["CC",0x45B],
- ["CE",0x45C],
- ["D9",0x45E],
- ["DB",0x45F],
- ["A2",0x490],
- ["B6",0x491],
- ["D0",0x2013],
- ["D1",0x2014],
- ["D4",0x2018],
- ["D5",0x2019],
- ["D2",0x201C],
- ["D3",0x201D],
- ["D7",0x201E],
- ["A0",0x2020],
- ["A5",0x2022],
- ["C9",0x2026],
- ["DC",0x2116],
- ["AA",0x2122],
- ["C6",0x2206],
- ["C3",0x221A],
- ["B0",0x221E],
- ["C5",0x2248],
- ["AD",0x2260],
- ["B2",0x2264],
- ["B3",0x2265],
-] \ No newline at end of file
diff --git a/enc/trans/newline.trans b/enc/trans/newline.trans
deleted file mode 100644
index d62034aa49..0000000000
--- a/enc/trans/newline.trans
+++ /dev/null
@@ -1,131 +0,0 @@
-#include "transcode_data.h"
-
-<%
- map_normalize = {}
- map_normalize["{00-ff}"] = :func_so
-
- transcode_generate_node(ActionMap.parse(map_normalize), "universal_newline")
-
- map_crlf = {}
- map_crlf["{00-09,0b-ff}"] = :nomap
- map_crlf["0a"] = "0d0a"
-
- transcode_generate_node(ActionMap.parse(map_crlf), "crlf_newline")
-
- map_cr = {}
- map_cr["{00-09,0b-ff}"] = :nomap
- map_cr["0a"] = "0d"
-
- transcode_generate_node(ActionMap.parse(map_cr), "cr_newline")
-%>
-
-<%= transcode_generated_code %>
-
-#define STATE (sp[0])
-#define NORMAL 0
-#define JUST_AFTER_CR 1
-
-/* no way to access this information, yet. */
-#define NEWLINES_MET (sp[1])
-#define MET_LF 0x01
-#define MET_CRLF 0x02
-#define MET_CR 0x04
-
-static int
-universal_newline_init(void *statep)
-{
- unsigned char *sp = statep;
- STATE = NORMAL;
- NEWLINES_MET = 0;
- return 0;
-}
-
-static ssize_t
-fun_so_universal_newline(void *statep, const unsigned char *s, size_t l, unsigned char *o, size_t osize)
-{
- unsigned char *sp = statep;
- int len;
- if (s[0] == '\n') {
- if (STATE == NORMAL) {
- NEWLINES_MET |= MET_LF;
- o[0] = '\n';
- len = 1;
- }
- else { /* JUST_AFTER_CR */
- NEWLINES_MET |= MET_CRLF;
- len = 0;
- }
- STATE = NORMAL;
- }
- else {
- if (STATE == JUST_AFTER_CR)
- NEWLINES_MET |= MET_CR;
- if (s[0] == '\r') {
- o[0] = '\n';
- len = 1;
- STATE = JUST_AFTER_CR;
- }
- else {
- o[0] = s[0];
- len = 1;
- STATE = NORMAL;
- }
- }
-
- return len;
-}
-
-static ssize_t
-universal_newline_finish(void *statep, unsigned char *o, size_t osize)
-{
- unsigned char *sp = statep;
- if (STATE == JUST_AFTER_CR)
- NEWLINES_MET |= MET_CR;
- STATE = NORMAL;
- return 0;
-}
-
-static const rb_transcoder
-rb_universal_newline = {
- "", "universal_newline", universal_newline,
- TRANSCODE_TABLE_INFO,
- 1, /* input_unit_length */
- 1, /* max_input */
- 1, /* max_output */
- asciicompat_converter, /* asciicompat_type */
- 2, universal_newline_init, universal_newline_init, /* state_size, state_init, state_fini */
- NULL, NULL, NULL, fun_so_universal_newline,
- universal_newline_finish
-};
-
-static const rb_transcoder
-rb_crlf_newline = {
- "", "crlf_newline", crlf_newline,
- TRANSCODE_TABLE_INFO,
- 1, /* input_unit_length */
- 1, /* max_input */
- 2, /* max_output */
- asciicompat_converter, /* asciicompat_type */
- 0, NULL, NULL, /* state_size, state_init, state_fini */
- NULL, NULL, NULL, NULL
-};
-
-static const rb_transcoder
-rb_cr_newline = {
- "", "cr_newline", cr_newline,
- TRANSCODE_TABLE_INFO,
- 1, /* input_unit_length */
- 1, /* max_input */
- 1, /* max_output */
- asciicompat_converter, /* asciicompat_type */
- 0, NULL, NULL, /* state_size, state_init, state_fini */
- NULL, NULL, NULL, NULL
-};
-
-void
-Init_newline(void)
-{
- rb_register_transcoder(&rb_universal_newline);
- rb_register_transcoder(&rb_crlf_newline);
- rb_register_transcoder(&rb_cr_newline);
-}
diff --git a/enc/trans/single_byte.trans b/enc/trans/single_byte.trans
deleted file mode 100644
index 0d42740d30..0000000000
--- a/enc/trans/single_byte.trans
+++ /dev/null
@@ -1,91 +0,0 @@
-#include "transcode_data.h"
-
-<%
- us_ascii_map = [["{00-7f}", :nomap]]
-
- transcode_tblgen "US-ASCII", "UTF-8", us_ascii_map
- transcode_tblgen "UTF-8", "US-ASCII", us_ascii_map
- transcode_tblgen "ASCII-8BIT", "UTF-8", us_ascii_map
- transcode_tblgen "UTF-8", "ASCII-8BIT", us_ascii_map
-
- CONTROL1_TO_UCS_TBL = (0x80..0x9f).map {|c| ["%02X" % c, c] }
-
- # Generate transcoding tables for single byte encoding from
- # encoding name using table file.
- #
- # Conventions:
- # name: encoding name as string, UPPER case, hyphens (e.g. 'ISO-8859-3')
- # 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)
- 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")
- set_valid_byte_pattern(name, '1byte')
- code = ''
- code << transcode_tblgen(name, "UTF-8", [["{00-7f}", :nomap], *tbl_to_ucs])
- 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"
- transcode_tblgen_singlebyte "ISO-8859-2"
- transcode_tblgen_singlebyte "ISO-8859-3"
- transcode_tblgen_singlebyte "ISO-8859-4"
- transcode_tblgen_singlebyte "ISO-8859-5"
- transcode_tblgen_singlebyte "ISO-8859-6"
- transcode_tblgen_singlebyte "ISO-8859-7"
- transcode_tblgen_singlebyte "ISO-8859-8"
- transcode_tblgen_singlebyte "ISO-8859-9"
- transcode_tblgen_singlebyte "ISO-8859-10"
- transcode_tblgen_singlebyte "ISO-8859-11"
- transcode_tblgen_singlebyte "ISO-8859-13"
- transcode_tblgen_singlebyte "ISO-8859-14"
- transcode_tblgen_singlebyte "ISO-8859-15"
- transcode_tblgen_singlebyte "WINDOWS-874"
- transcode_tblgen_singlebyte "WINDOWS-1250"
- transcode_tblgen_singlebyte "WINDOWS-1251"
- transcode_tblgen_singlebyte "WINDOWS-1252"
- transcode_tblgen_singlebyte "WINDOWS-1253"
- transcode_tblgen_singlebyte "WINDOWS-1254"
- transcode_tblgen_singlebyte "WINDOWS-1255"
- transcode_tblgen_singlebyte "WINDOWS-1256"
- transcode_tblgen_singlebyte "WINDOWS-1257"
- transcode_tblgen_singlebyte "IBM437"
- transcode_tblgen_singlebyte "IBM775"
- transcode_tblgen_singlebyte "IBM852"
- transcode_tblgen_singlebyte "IBM855"
- transcode_tblgen_singlebyte "IBM857"
- transcode_tblgen_singlebyte "IBM860"
- transcode_tblgen_singlebyte "IBM861"
- transcode_tblgen_singlebyte "IBM862"
- transcode_tblgen_singlebyte "IBM863"
- transcode_tblgen_singlebyte "IBM865"
- transcode_tblgen_singlebyte "IBM866"
- transcode_tblgen_singlebyte "IBM869"
- transcode_tblgen_singlebyte "MACCROATIAN"
- transcode_tblgen_singlebyte "MACCYRILLIC"
- transcode_tblgen_singlebyte "MACGREEK"
- transcode_tblgen_singlebyte "MACICELAND"
- transcode_tblgen_singlebyte "MACROMAN"
- transcode_tblgen_singlebyte "MACROMANIA"
- transcode_tblgen_singlebyte "MACTURKISH"
- transcode_tblgen_singlebyte "MACUKRAINE"
- transcode_tblgen_singlebyte "KOI8-U"
- transcode_tblgen_singlebyte "KOI8-R"
- transcode_tblgen_singlebyte "TIS-620"
- transcode_tblgen_singlebyte "CP850"
- transcode_tblgen_singlebyte "CP852"
- transcode_tblgen_singlebyte "CP855"
-%>
-
-<%= transcode_generated_code %>
-
-void
-Init_single_byte(void)
-{
-<%= transcode_register_code %>
-}
-
diff --git a/enc/trans/tis-620-tbl.rb b/enc/trans/tis-620-tbl.rb
deleted file mode 100644
index a2f605730a..0000000000
--- a/enc/trans/tis-620-tbl.rb
+++ /dev/null
@@ -1,89 +0,0 @@
-TIS_620_TO_UCS_TBL = [
- ["A1",0xE01],
- ["A2",0xE02],
- ["A3",0xE03],
- ["A4",0xE04],
- ["A5",0xE05],
- ["A6",0xE06],
- ["A7",0xE07],
- ["A8",0xE08],
- ["A9",0xE09],
- ["AA",0xE0A],
- ["AB",0xE0B],
- ["AC",0xE0C],
- ["AD",0xE0D],
- ["AE",0xE0E],
- ["AF",0xE0F],
- ["B0",0xE10],
- ["B1",0xE11],
- ["B2",0xE12],
- ["B3",0xE13],
- ["B4",0xE14],
- ["B5",0xE15],
- ["B6",0xE16],
- ["B7",0xE17],
- ["B8",0xE18],
- ["B9",0xE19],
- ["BA",0xE1A],
- ["BB",0xE1B],
- ["BC",0xE1C],
- ["BD",0xE1D],
- ["BE",0xE1E],
- ["BF",0xE1F],
- ["C0",0xE20],
- ["C1",0xE21],
- ["C2",0xE22],
- ["C3",0xE23],
- ["C4",0xE24],
- ["C5",0xE25],
- ["C6",0xE26],
- ["C7",0xE27],
- ["C8",0xE28],
- ["C9",0xE29],
- ["CA",0xE2A],
- ["CB",0xE2B],
- ["CC",0xE2C],
- ["CD",0xE2D],
- ["CE",0xE2E],
- ["CF",0xE2F],
- ["D0",0xE30],
- ["D1",0xE31],
- ["D2",0xE32],
- ["D3",0xE33],
- ["D4",0xE34],
- ["D5",0xE35],
- ["D6",0xE36],
- ["D7",0xE37],
- ["D8",0xE38],
- ["D9",0xE39],
- ["DA",0xE3A],
- ["DF",0xE3F],
- ["E0",0xE40],
- ["E1",0xE41],
- ["E2",0xE42],
- ["E3",0xE43],
- ["E4",0xE44],
- ["E5",0xE45],
- ["E6",0xE46],
- ["E7",0xE47],
- ["E8",0xE48],
- ["E9",0xE49],
- ["EA",0xE4A],
- ["EB",0xE4B],
- ["EC",0xE4C],
- ["ED",0xE4D],
- ["EE",0xE4E],
- ["EF",0xE4F],
- ["F0",0xE50],
- ["F1",0xE51],
- ["F2",0xE52],
- ["F3",0xE53],
- ["F4",0xE54],
- ["F5",0xE55],
- ["F6",0xE56],
- ["F7",0xE57],
- ["F8",0xE58],
- ["F9",0xE59],
- ["FA",0xE5A],
- ["FB",0xE5B],
-]
diff --git a/enc/trans/transdb.c b/enc/trans/transdb.c
deleted file mode 100644
index d6ac41e967..0000000000
--- a/enc/trans/transdb.c
+++ /dev/null
@@ -1,18 +0,0 @@
-/**********************************************************************
-
- enc/trans/transdb.c -
-
- $Author$
- created at: Mon Apr 7 15:51:31 2008
-
- Copyright (C) 2008 Yukihiro Matsumoto
-
-**********************************************************************/
-
-void rb_declare_transcoder(const char *enc1, const char *enc2, const char *lib);
-
-void
-Init_transdb(void)
-{
-#include "transdb.h"
-}
diff --git a/enc/trans/utf8_mac-tbl.rb b/enc/trans/utf8_mac-tbl.rb
deleted file mode 100644
index f43478bd3e..0000000000
--- a/enc/trans/utf8_mac-tbl.rb
+++ /dev/null
@@ -1,945 +0,0 @@
-# http://developer.apple.com/technotes/tn/tn1150table.html
-MAC_DECOMPOSE_TBL = [
- ["c380", "41cc80"],
- ["c381", "41cc81"],
- ["c382", "41cc82"],
- ["c383", "41cc83"],
- ["c384", "41cc88"],
- ["c385", "41cc8a"],
- ["c387", "43cca7"],
- ["c388", "45cc80"],
- ["c389", "45cc81"],
- ["c38a", "45cc82"],
- ["c38b", "45cc88"],
- ["c38c", "49cc80"],
- ["c38d", "49cc81"],
- ["c38e", "49cc82"],
- ["c38f", "49cc88"],
- ["c391", "4ecc83"],
- ["c392", "4fcc80"],
- ["c393", "4fcc81"],
- ["c394", "4fcc82"],
- ["c395", "4fcc83"],
- ["c396", "4fcc88"],
- ["c399", "55cc80"],
- ["c39a", "55cc81"],
- ["c39b", "55cc82"],
- ["c39c", "55cc88"],
- ["c39d", "59cc81"],
- ["c3a0", "61cc80"],
- ["c3a1", "61cc81"],
- ["c3a2", "61cc82"],
- ["c3a3", "61cc83"],
- ["c3a4", "61cc88"],
- ["c3a5", "61cc8a"],
- ["c3a7", "63cca7"],
- ["c3a8", "65cc80"],
- ["c3a9", "65cc81"],
- ["c3aa", "65cc82"],
- ["c3ab", "65cc88"],
- ["c3ac", "69cc80"],
- ["c3ad", "69cc81"],
- ["c3ae", "69cc82"],
- ["c3af", "69cc88"],
- ["c3b1", "6ecc83"],
- ["c3b2", "6fcc80"],
- ["c3b3", "6fcc81"],
- ["c3b4", "6fcc82"],
- ["c3b5", "6fcc83"],
- ["c3b6", "6fcc88"],
- ["c3b9", "75cc80"],
- ["c3ba", "75cc81"],
- ["c3bb", "75cc82"],
- ["c3bc", "75cc88"],
- ["c3bd", "79cc81"],
- ["c3bf", "79cc88"],
- ["c480", "41cc84"],
- ["c481", "61cc84"],
- ["c482", "41cc86"],
- ["c483", "61cc86"],
- ["c484", "41cca8"],
- ["c485", "61cca8"],
- ["c486", "43cc81"],
- ["c487", "63cc81"],
- ["c488", "43cc82"],
- ["c489", "63cc82"],
- ["c48a", "43cc87"],
- ["c48b", "63cc87"],
- ["c48c", "43cc8c"],
- ["c48d", "63cc8c"],
- ["c48e", "44cc8c"],
- ["c48f", "64cc8c"],
- ["c492", "45cc84"],
- ["c493", "65cc84"],
- ["c494", "45cc86"],
- ["c495", "65cc86"],
- ["c496", "45cc87"],
- ["c497", "65cc87"],
- ["c498", "45cca8"],
- ["c499", "65cca8"],
- ["c49a", "45cc8c"],
- ["c49b", "65cc8c"],
- ["c49c", "47cc82"],
- ["c49d", "67cc82"],
- ["c49e", "47cc86"],
- ["c49f", "67cc86"],
- ["c4a0", "47cc87"],
- ["c4a1", "67cc87"],
- ["c4a2", "47cca7"],
- ["c4a3", "67cca7"],
- ["c4a4", "48cc82"],
- ["c4a5", "68cc82"],
- ["c4a8", "49cc83"],
- ["c4a9", "69cc83"],
- ["c4aa", "49cc84"],
- ["c4ab", "69cc84"],
- ["c4ac", "49cc86"],
- ["c4ad", "69cc86"],
- ["c4ae", "49cca8"],
- ["c4af", "69cca8"],
- ["c4b0", "49cc87"],
- ["c4b4", "4acc82"],
- ["c4b5", "6acc82"],
- ["c4b6", "4bcca7"],
- ["c4b7", "6bcca7"],
- ["c4b9", "4ccc81"],
- ["c4ba", "6ccc81"],
- ["c4bb", "4ccca7"],
- ["c4bc", "6ccca7"],
- ["c4bd", "4ccc8c"],
- ["c4be", "6ccc8c"],
- ["c583", "4ecc81"],
- ["c584", "6ecc81"],
- ["c585", "4ecca7"],
- ["c586", "6ecca7"],
- ["c587", "4ecc8c"],
- ["c588", "6ecc8c"],
- ["c58c", "4fcc84"],
- ["c58d", "6fcc84"],
- ["c58e", "4fcc86"],
- ["c58f", "6fcc86"],
- ["c590", "4fcc8b"],
- ["c591", "6fcc8b"],
- ["c594", "52cc81"],
- ["c595", "72cc81"],
- ["c596", "52cca7"],
- ["c597", "72cca7"],
- ["c598", "52cc8c"],
- ["c599", "72cc8c"],
- ["c59a", "53cc81"],
- ["c59b", "73cc81"],
- ["c59c", "53cc82"],
- ["c59d", "73cc82"],
- ["c59e", "53cca7"],
- ["c59f", "73cca7"],
- ["c5a0", "53cc8c"],
- ["c5a1", "73cc8c"],
- ["c5a2", "54cca7"],
- ["c5a3", "74cca7"],
- ["c5a4", "54cc8c"],
- ["c5a5", "74cc8c"],
- ["c5a8", "55cc83"],
- ["c5a9", "75cc83"],
- ["c5aa", "55cc84"],
- ["c5ab", "75cc84"],
- ["c5ac", "55cc86"],
- ["c5ad", "75cc86"],
- ["c5ae", "55cc8a"],
- ["c5af", "75cc8a"],
- ["c5b0", "55cc8b"],
- ["c5b1", "75cc8b"],
- ["c5b2", "55cca8"],
- ["c5b3", "75cca8"],
- ["c5b4", "57cc82"],
- ["c5b5", "77cc82"],
- ["c5b6", "59cc82"],
- ["c5b7", "79cc82"],
- ["c5b8", "59cc88"],
- ["c5b9", "5acc81"],
- ["c5ba", "7acc81"],
- ["c5bb", "5acc87"],
- ["c5bc", "7acc87"],
- ["c5bd", "5acc8c"],
- ["c5be", "7acc8c"],
- ["c6a0", "4fcc9b"],
- ["c6a1", "6fcc9b"],
- ["c6af", "55cc9b"],
- ["c6b0", "75cc9b"],
- ["c78d", "41cc8c"],
- ["c78e", "61cc8c"],
- ["c78f", "49cc8c"],
- ["c790", "69cc8c"],
- ["c791", "4fcc8c"],
- ["c792", "6fcc8c"],
- ["c793", "55cc8c"],
- ["c794", "75cc8c"],
- ["c795", "55cc88cc84"],
- ["c796", "75cc88cc84"],
- ["c797", "55cc88cc81"],
- ["c798", "75cc88cc81"],
- ["c799", "55cc88cc8c"],
- ["c79a", "75cc88cc8c"],
- ["c79b", "55cc88cc80"],
- ["c79c", "75cc88cc80"],
- ["c79e", "41cc88cc84"],
- ["c79f", "61cc88cc84"],
- ["c7a0", "41cc87cc84"],
- ["c7a1", "61cc87cc84"],
- ["c7a2", "c386cc84"],
- ["c7a3", "c3a6cc84"],
- ["c7a6", "47cc8c"],
- ["c7a7", "67cc8c"],
- ["c7a8", "4bcc8c"],
- ["c7a9", "6bcc8c"],
- ["c7aa", "4fcca8"],
- ["c7ab", "6fcca8"],
- ["c7ac", "4fcca8cc84"],
- ["c7ad", "6fcca8cc84"],
- ["c7ae", "c6b7cc8c"],
- ["c7af", "ca92cc8c"],
- ["c7b0", "6acc8c"],
- ["c7b4", "47cc81"],
- ["c7b5", "67cc81"],
- ["c7ba", "41cc8acc81"],
- ["c7bb", "61cc8acc81"],
- ["c7bc", "c386cc81"],
- ["c7bd", "c3a6cc81"],
- ["c7be", "c398cc81"],
- ["c7bf", "c3b8cc81"],
- ["c880", "41cc8f"],
- ["c881", "61cc8f"],
- ["c882", "41cc91"],
- ["c883", "61cc91"],
- ["c884", "45cc8f"],
- ["c885", "65cc8f"],
- ["c886", "45cc91"],
- ["c887", "65cc91"],
- ["c888", "49cc8f"],
- ["c889", "69cc8f"],
- ["c88a", "49cc91"],
- ["c88b", "69cc91"],
- ["c88c", "4fcc8f"],
- ["c88d", "6fcc8f"],
- ["c88e", "4fcc91"],
- ["c88f", "6fcc91"],
- ["c890", "52cc8f"],
- ["c891", "72cc8f"],
- ["c892", "52cc91"],
- ["c893", "72cc91"],
- ["c894", "55cc8f"],
- ["c895", "75cc8f"],
- ["c896", "55cc91"],
- ["c897", "75cc91"],
- ["cc90", "cc86cc87"],
- ["cd80", "cc80"],
- ["cd81", "cc81"],
- ["cd83", "cc93"],
- ["cd84", "cc88cc8d"],
- ["cdb4", "cab9"],
- ["cdbe", "3b"],
- ["ce85", "c2a8cc8d"],
- ["ce86", "ce91cc8d"],
- ["ce87", "c2b7"],
- ["ce88", "ce95cc8d"],
- ["ce89", "ce97cc8d"],
- ["ce8a", "ce99cc8d"],
- ["ce8c", "ce9fcc8d"],
- ["ce8e", "cea5cc8d"],
- ["ce8f", "cea9cc8d"],
- ["ce90", "ceb9cc88cc8d"],
- ["ceaa", "ce99cc88"],
- ["ceab", "cea5cc88"],
- ["ceac", "ceb1cc8d"],
- ["cead", "ceb5cc8d"],
- ["ceae", "ceb7cc8d"],
- ["ceaf", "ceb9cc8d"],
- ["ceb0", "cf85cc88cc8d"],
- ["cf8a", "ceb9cc88"],
- ["cf8b", "cf85cc88"],
- ["cf8c", "cebfcc8d"],
- ["cf8d", "cf85cc8d"],
- ["cf8e", "cf89cc8d"],
- ["cf93", "cf92cc8d"],
- ["cf94", "cf92cc88"],
- ["d081", "d095cc88"],
- ["d083", "d093cc81"],
- ["d087", "d086cc88"],
- ["d08c", "d09acc81"],
- ["d08e", "d0a3cc86"],
- ["d099", "d098cc86"],
- ["d0b9", "d0b8cc86"],
- ["d191", "d0b5cc88"],
- ["d193", "d0b3cc81"],
- ["d197", "d196cc88"],
- ["d19c", "d0bacc81"],
- ["d19e", "d183cc86"],
- ["d1b6", "d1b4cc8f"],
- ["d1b7", "d1b5cc8f"],
- ["d381", "d096cc86"],
- ["d382", "d0b6cc86"],
- ["d390", "d090cc86"],
- ["d391", "d0b0cc86"],
- ["d392", "d090cc88"],
- ["d393", "d0b0cc88"],
- ["d394", "c386"],
- ["d395", "c3a6"],
- ["d396", "d095cc86"],
- ["d397", "d0b5cc86"],
- ["d398", "c68f"],
- ["d399", "c999"],
- ["d39a", "c68fcc88"],
- ["d39b", "c999cc88"],
- ["d39c", "d096cc88"],
- ["d39d", "d0b6cc88"],
- ["d39e", "d097cc88"],
- ["d39f", "d0b7cc88"],
- ["d3a0", "c6b7"],
- ["d3a1", "ca92"],
- ["d3a2", "d098cc84"],
- ["d3a3", "d0b8cc84"],
- ["d3a4", "d098cc88"],
- ["d3a5", "d0b8cc88"],
- ["d3a6", "d09ecc88"],
- ["d3a7", "d0becc88"],
- ["d3a8", "c69f"],
- ["d3a9", "c9b5"],
- ["d3aa", "c69fcc88"],
- ["d3ab", "c9b5cc88"],
- ["d3ae", "d0a3cc84"],
- ["d3af", "d183cc84"],
- ["d3b0", "d0a3cc88"],
- ["d3b1", "d183cc88"],
- ["d3b2", "d0a3cc8b"],
- ["d3b3", "d183cc8b"],
- ["d3b4", "d0a7cc88"],
- ["d3b5", "d187cc88"],
- ["d3b8", "d0abcc88"],
- ["d3b9", "d18bcc88"],
- ["e0a4a9", "e0a4a8e0a4bc"],
- ["e0a4b1", "e0a4b0e0a4bc"],
- ["e0a4b4", "e0a4b3e0a4bc"],
- ["e0a598", "e0a495e0a4bc"],
- ["e0a599", "e0a496e0a4bc"],
- ["e0a59a", "e0a497e0a4bc"],
- ["e0a59b", "e0a49ce0a4bc"],
- ["e0a59c", "e0a4a1e0a4bc"],
- ["e0a59d", "e0a4a2e0a4bc"],
- ["e0a59e", "e0a4abe0a4bc"],
- ["e0a59f", "e0a4afe0a4bc"],
- ["e0a6b0", "e0a6ace0a6bc"],
- ["e0a78b", "e0a787e0a6be"],
- ["e0a78c", "e0a787e0a797"],
- ["e0a79c", "e0a6a1e0a6bc"],
- ["e0a79d", "e0a6a2e0a6bc"],
- ["e0a79f", "e0a6afe0a6bc"],
- ["e0a999", "e0a896e0a8bc"],
- ["e0a99a", "e0a897e0a8bc"],
- ["e0a99b", "e0a89ce0a8bc"],
- ["e0a99c", "e0a8a1e0a8bc"],
- ["e0a99e", "e0a8abe0a8bc"],
- ["e0ad88", "e0ad87e0ad96"],
- ["e0ad8b", "e0ad87e0acbe"],
- ["e0ad8c", "e0ad87e0ad97"],
- ["e0ad9c", "e0aca1e0acbc"],
- ["e0ad9d", "e0aca2e0acbc"],
- ["e0ad9f", "e0acafe0acbc"],
- ["e0ae94", "e0ae92e0af97"],
- ["e0af8a", "e0af86e0aebe"],
- ["e0af8b", "e0af87e0aebe"],
- ["e0af8c", "e0af86e0af97"],
- ["e0b188", "e0b186e0b196"],
- ["e0b380", "e0b2bfe0b395"],
- ["e0b387", "e0b386e0b395"],
- ["e0b388", "e0b386e0b396"],
- ["e0b38a", "e0b386e0b382"],
- ["e0b38b", "e0b386e0b382e0b395"],
- ["e0b58a", "e0b586e0b4be"],
- ["e0b58b", "e0b587e0b4be"],
- ["e0b58c", "e0b586e0b597"],
- ["e0b8b3", "e0b98de0b8b2"],
- ["e0bab3", "e0bb8de0bab2"],
- ["e0bd83", "e0bd82e0beb7"],
- ["e0bd8d", "e0bd8ce0beb7"],
- ["e0bd92", "e0bd91e0beb7"],
- ["e0bd97", "e0bd96e0beb7"],
- ["e0bd9c", "e0bd9be0beb7"],
- ["e0bda9", "e0bd80e0beb5"],
- ["e0bdb3", "e0bdb2e0bdb1"],
- ["e0bdb5", "e0bdb4e0bdb1"],
- ["e0bdb6", "e0beb2e0be80"],
- ["e0bdb7", "e0beb2e0be80e0bdb1"],
- ["e0bdb8", "e0beb3e0be80"],
- ["e0bdb9", "e0beb3e0be80e0bdb1"],
- ["e0be81", "e0be80e0bdb1"],
- ["e0be93", "e0be92e0beb7"],
- ["e0be9d", "e0be9ce0beb7"],
- ["e0bea2", "e0bea1e0beb7"],
- ["e0bea7", "e0bea6e0beb7"],
- ["e0beac", "e0beabe0beb7"],
- ["e0beb9", "e0be90e0beb5"],
- ["e1b880", "41cca5"],
- ["e1b881", "61cca5"],
- ["e1b882", "42cc87"],
- ["e1b883", "62cc87"],
- ["e1b884", "42cca3"],
- ["e1b885", "62cca3"],
- ["e1b886", "42ccb1"],
- ["e1b887", "62ccb1"],
- ["e1b888", "43cca7cc81"],
- ["e1b889", "63cca7cc81"],
- ["e1b88a", "44cc87"],
- ["e1b88b", "64cc87"],
- ["e1b88c", "44cca3"],
- ["e1b88d", "64cca3"],
- ["e1b88e", "44ccb1"],
- ["e1b88f", "64ccb1"],
- ["e1b890", "44cca7"],
- ["e1b891", "64cca7"],
- ["e1b892", "44ccad"],
- ["e1b893", "64ccad"],
- ["e1b894", "45cc84cc80"],
- ["e1b895", "65cc84cc80"],
- ["e1b896", "45cc84cc81"],
- ["e1b897", "65cc84cc81"],
- ["e1b898", "45ccad"],
- ["e1b899", "65ccad"],
- ["e1b89a", "45ccb0"],
- ["e1b89b", "65ccb0"],
- ["e1b89c", "45cca7cc86"],
- ["e1b89d", "65cca7cc86"],
- ["e1b89e", "46cc87"],
- ["e1b89f", "66cc87"],
- ["e1b8a0", "47cc84"],
- ["e1b8a1", "67cc84"],
- ["e1b8a2", "48cc87"],
- ["e1b8a3", "68cc87"],
- ["e1b8a4", "48cca3"],
- ["e1b8a5", "68cca3"],
- ["e1b8a6", "48cc88"],
- ["e1b8a7", "68cc88"],
- ["e1b8a8", "48cca7"],
- ["e1b8a9", "68cca7"],
- ["e1b8aa", "48ccae"],
- ["e1b8ab", "68ccae"],
- ["e1b8ac", "49ccb0"],
- ["e1b8ad", "69ccb0"],
- ["e1b8ae", "49cc88cc81"],
- ["e1b8af", "69cc88cc81"],
- ["e1b8b0", "4bcc81"],
- ["e1b8b1", "6bcc81"],
- ["e1b8b2", "4bcca3"],
- ["e1b8b3", "6bcca3"],
- ["e1b8b4", "4bccb1"],
- ["e1b8b5", "6bccb1"],
- ["e1b8b6", "4ccca3"],
- ["e1b8b7", "6ccca3"],
- ["e1b8b8", "4ccca3cc84"],
- ["e1b8b9", "6ccca3cc84"],
- ["e1b8ba", "4cccb1"],
- ["e1b8bb", "6cccb1"],
- ["e1b8bc", "4cccad"],
- ["e1b8bd", "6cccad"],
- ["e1b8be", "4dcc81"],
- ["e1b8bf", "6dcc81"],
- ["e1b980", "4dcc87"],
- ["e1b981", "6dcc87"],
- ["e1b982", "4dcca3"],
- ["e1b983", "6dcca3"],
- ["e1b984", "4ecc87"],
- ["e1b985", "6ecc87"],
- ["e1b986", "4ecca3"],
- ["e1b987", "6ecca3"],
- ["e1b988", "4eccb1"],
- ["e1b989", "6eccb1"],
- ["e1b98a", "4eccad"],
- ["e1b98b", "6eccad"],
- ["e1b98c", "4fcc83cc81"],
- ["e1b98d", "6fcc83cc81"],
- ["e1b98e", "4fcc83cc88"],
- ["e1b98f", "6fcc83cc88"],
- ["e1b990", "4fcc84cc80"],
- ["e1b991", "6fcc84cc80"],
- ["e1b992", "4fcc84cc81"],
- ["e1b993", "6fcc84cc81"],
- ["e1b994", "50cc81"],
- ["e1b995", "70cc81"],
- ["e1b996", "50cc87"],
- ["e1b997", "70cc87"],
- ["e1b998", "52cc87"],
- ["e1b999", "72cc87"],
- ["e1b99a", "52cca3"],
- ["e1b99b", "72cca3"],
- ["e1b99c", "52cca3cc84"],
- ["e1b99d", "72cca3cc84"],
- ["e1b99e", "52ccb1"],
- ["e1b99f", "72ccb1"],
- ["e1b9a0", "53cc87"],
- ["e1b9a1", "73cc87"],
- ["e1b9a2", "53cca3"],
- ["e1b9a3", "73cca3"],
- ["e1b9a4", "53cc81cc87"],
- ["e1b9a5", "73cc81cc87"],
- ["e1b9a6", "53cc8ccc87"],
- ["e1b9a7", "73cc8ccc87"],
- ["e1b9a8", "53cca3cc87"],
- ["e1b9a9", "73cca3cc87"],
- ["e1b9aa", "54cc87"],
- ["e1b9ab", "74cc87"],
- ["e1b9ac", "54cca3"],
- ["e1b9ad", "74cca3"],
- ["e1b9ae", "54ccb1"],
- ["e1b9af", "74ccb1"],
- ["e1b9b0", "54ccad"],
- ["e1b9b1", "74ccad"],
- ["e1b9b2", "55cca4"],
- ["e1b9b3", "75cca4"],
- ["e1b9b4", "55ccb0"],
- ["e1b9b5", "75ccb0"],
- ["e1b9b6", "55ccad"],
- ["e1b9b7", "75ccad"],
- ["e1b9b8", "55cc83cc81"],
- ["e1b9b9", "75cc83cc81"],
- ["e1b9ba", "55cc84cc88"],
- ["e1b9bb", "75cc84cc88"],
- ["e1b9bc", "56cc83"],
- ["e1b9bd", "76cc83"],
- ["e1b9be", "56cca3"],
- ["e1b9bf", "76cca3"],
- ["e1ba80", "57cc80"],
- ["e1ba81", "77cc80"],
- ["e1ba82", "57cc81"],
- ["e1ba83", "77cc81"],
- ["e1ba84", "57cc88"],
- ["e1ba85", "77cc88"],
- ["e1ba86", "57cc87"],
- ["e1ba87", "77cc87"],
- ["e1ba88", "57cca3"],
- ["e1ba89", "77cca3"],
- ["e1ba8a", "58cc87"],
- ["e1ba8b", "78cc87"],
- ["e1ba8c", "58cc88"],
- ["e1ba8d", "78cc88"],
- ["e1ba8e", "59cc87"],
- ["e1ba8f", "79cc87"],
- ["e1ba90", "5acc82"],
- ["e1ba91", "7acc82"],
- ["e1ba92", "5acca3"],
- ["e1ba93", "7acca3"],
- ["e1ba94", "5accb1"],
- ["e1ba95", "7accb1"],
- ["e1ba96", "68ccb1"],
- ["e1ba97", "74cc88"],
- ["e1ba98", "77cc8a"],
- ["e1ba99", "79cc8a"],
- ["e1ba9b", "c5bfcc87"],
- ["e1baa0", "41cca3"],
- ["e1baa1", "61cca3"],
- ["e1baa2", "41cc89"],
- ["e1baa3", "61cc89"],
- ["e1baa4", "41cc82cc81"],
- ["e1baa5", "61cc82cc81"],
- ["e1baa6", "41cc82cc80"],
- ["e1baa7", "61cc82cc80"],
- ["e1baa8", "41cc82cc89"],
- ["e1baa9", "61cc82cc89"],
- ["e1baaa", "41cc82cc83"],
- ["e1baab", "61cc82cc83"],
- ["e1baac", "41cca3cc82"],
- ["e1baad", "61cca3cc82"],
- ["e1baae", "41cc86cc81"],
- ["e1baaf", "61cc86cc81"],
- ["e1bab0", "41cc86cc80"],
- ["e1bab1", "61cc86cc80"],
- ["e1bab2", "41cc86cc89"],
- ["e1bab3", "61cc86cc89"],
- ["e1bab4", "41cc86cc83"],
- ["e1bab5", "61cc86cc83"],
- ["e1bab6", "41cca3cc86"],
- ["e1bab7", "61cca3cc86"],
- ["e1bab8", "45cca3"],
- ["e1bab9", "65cca3"],
- ["e1baba", "45cc89"],
- ["e1babb", "65cc89"],
- ["e1babc", "45cc83"],
- ["e1babd", "65cc83"],
- ["e1babe", "45cc82cc81"],
- ["e1babf", "65cc82cc81"],
- ["e1bb80", "45cc82cc80"],
- ["e1bb81", "65cc82cc80"],
- ["e1bb82", "45cc82cc89"],
- ["e1bb83", "65cc82cc89"],
- ["e1bb84", "45cc82cc83"],
- ["e1bb85", "65cc82cc83"],
- ["e1bb86", "45cca3cc82"],
- ["e1bb87", "65cca3cc82"],
- ["e1bb88", "49cc89"],
- ["e1bb89", "69cc89"],
- ["e1bb8a", "49cca3"],
- ["e1bb8b", "69cca3"],
- ["e1bb8c", "4fcca3"],
- ["e1bb8d", "6fcca3"],
- ["e1bb8e", "4fcc89"],
- ["e1bb8f", "6fcc89"],
- ["e1bb90", "4fcc82cc81"],
- ["e1bb91", "6fcc82cc81"],
- ["e1bb92", "4fcc82cc80"],
- ["e1bb93", "6fcc82cc80"],
- ["e1bb94", "4fcc82cc89"],
- ["e1bb95", "6fcc82cc89"],
- ["e1bb96", "4fcc82cc83"],
- ["e1bb97", "6fcc82cc83"],
- ["e1bb98", "4fcca3cc82"],
- ["e1bb99", "6fcca3cc82"],
- ["e1bb9a", "4fcc9bcc81"],
- ["e1bb9b", "6fcc9bcc81"],
- ["e1bb9c", "4fcc9bcc80"],
- ["e1bb9d", "6fcc9bcc80"],
- ["e1bb9e", "4fcc9bcc89"],
- ["e1bb9f", "6fcc9bcc89"],
- ["e1bba0", "4fcc9bcc83"],
- ["e1bba1", "6fcc9bcc83"],
- ["e1bba2", "4fcc9bcca3"],
- ["e1bba3", "6fcc9bcca3"],
- ["e1bba4", "55cca3"],
- ["e1bba5", "75cca3"],
- ["e1bba6", "55cc89"],
- ["e1bba7", "75cc89"],
- ["e1bba8", "55cc9bcc81"],
- ["e1bba9", "75cc9bcc81"],
- ["e1bbaa", "55cc9bcc80"],
- ["e1bbab", "75cc9bcc80"],
- ["e1bbac", "55cc9bcc89"],
- ["e1bbad", "75cc9bcc89"],
- ["e1bbae", "55cc9bcc83"],
- ["e1bbaf", "75cc9bcc83"],
- ["e1bbb0", "55cc9bcca3"],
- ["e1bbb1", "75cc9bcca3"],
- ["e1bbb2", "59cc80"],
- ["e1bbb3", "79cc80"],
- ["e1bbb4", "59cca3"],
- ["e1bbb5", "79cca3"],
- ["e1bbb6", "59cc89"],
- ["e1bbb7", "79cc89"],
- ["e1bbb8", "59cc83"],
- ["e1bbb9", "79cc83"],
- ["e1bc80", "ceb1cc93"],
- ["e1bc81", "ceb1cc94"],
- ["e1bc82", "ceb1cc93cc80"],
- ["e1bc83", "ceb1cc94cc80"],
- ["e1bc84", "ceb1cc93cc81"],
- ["e1bc85", "ceb1cc94cc81"],
- ["e1bc86", "ceb1cc93cd82"],
- ["e1bc87", "ceb1cc94cd82"],
- ["e1bc88", "ce91cc93"],
- ["e1bc89", "ce91cc94"],
- ["e1bc8a", "ce91cc93cc80"],
- ["e1bc8b", "ce91cc94cc80"],
- ["e1bc8c", "ce91cc93cc81"],
- ["e1bc8d", "ce91cc94cc81"],
- ["e1bc8e", "ce91cc93cd82"],
- ["e1bc8f", "ce91cc94cd82"],
- ["e1bc90", "ceb5cc93"],
- ["e1bc91", "ceb5cc94"],
- ["e1bc92", "ceb5cc93cc80"],
- ["e1bc93", "ceb5cc94cc80"],
- ["e1bc94", "ceb5cc93cc81"],
- ["e1bc95", "ceb5cc94cc81"],
- ["e1bc98", "ce95cc93"],
- ["e1bc99", "ce95cc94"],
- ["e1bc9a", "ce95cc93cc80"],
- ["e1bc9b", "ce95cc94cc80"],
- ["e1bc9c", "ce95cc93cc81"],
- ["e1bc9d", "ce95cc94cc81"],
- ["e1bca0", "ceb7cc93"],
- ["e1bca1", "ceb7cc94"],
- ["e1bca2", "ceb7cc93cc80"],
- ["e1bca3", "ceb7cc94cc80"],
- ["e1bca4", "ceb7cc93cc81"],
- ["e1bca5", "ceb7cc94cc81"],
- ["e1bca6", "ceb7cc93cd82"],
- ["e1bca7", "ceb7cc94cd82"],
- ["e1bca8", "ce97cc93"],
- ["e1bca9", "ce97cc94"],
- ["e1bcaa", "ce97cc93cc80"],
- ["e1bcab", "ce97cc94cc80"],
- ["e1bcac", "ce97cc93cc81"],
- ["e1bcad", "ce97cc94cc81"],
- ["e1bcae", "ce97cc93cd82"],
- ["e1bcaf", "ce97cc94cd82"],
- ["e1bcb0", "ceb9cc93"],
- ["e1bcb1", "ceb9cc94"],
- ["e1bcb2", "ceb9cc93cc80"],
- ["e1bcb3", "ceb9cc94cc80"],
- ["e1bcb4", "ceb9cc93cc81"],
- ["e1bcb5", "ceb9cc94cc81"],
- ["e1bcb6", "ceb9cc93cd82"],
- ["e1bcb7", "ceb9cc94cd82"],
- ["e1bcb8", "ce99cc93"],
- ["e1bcb9", "ce99cc94"],
- ["e1bcba", "ce99cc93cc80"],
- ["e1bcbb", "ce99cc94cc80"],
- ["e1bcbc", "ce99cc93cc81"],
- ["e1bcbd", "ce99cc94cc81"],
- ["e1bcbe", "ce99cc93cd82"],
- ["e1bcbf", "ce99cc94cd82"],
- ["e1bd80", "cebfcc93"],
- ["e1bd81", "cebfcc94"],
- ["e1bd82", "cebfcc93cc80"],
- ["e1bd83", "cebfcc94cc80"],
- ["e1bd84", "cebfcc93cc81"],
- ["e1bd85", "cebfcc94cc81"],
- ["e1bd88", "ce9fcc93"],
- ["e1bd89", "ce9fcc94"],
- ["e1bd8a", "ce9fcc93cc80"],
- ["e1bd8b", "ce9fcc94cc80"],
- ["e1bd8c", "ce9fcc93cc81"],
- ["e1bd8d", "ce9fcc94cc81"],
- ["e1bd90", "cf85cc93"],
- ["e1bd91", "cf85cc94"],
- ["e1bd92", "cf85cc93cc80"],
- ["e1bd93", "cf85cc94cc80"],
- ["e1bd94", "cf85cc93cc81"],
- ["e1bd95", "cf85cc94cc81"],
- ["e1bd96", "cf85cc93cd82"],
- ["e1bd97", "cf85cc94cd82"],
- ["e1bd99", "cea5cc94"],
- ["e1bd9b", "cea5cc94cc80"],
- ["e1bd9d", "cea5cc94cc81"],
- ["e1bd9f", "cea5cc94cd82"],
- ["e1bda0", "cf89cc93"],
- ["e1bda1", "cf89cc94"],
- ["e1bda2", "cf89cc93cc80"],
- ["e1bda3", "cf89cc94cc80"],
- ["e1bda4", "cf89cc93cc81"],
- ["e1bda5", "cf89cc94cc81"],
- ["e1bda6", "cf89cc93cd82"],
- ["e1bda7", "cf89cc94cd82"],
- ["e1bda8", "cea9cc93"],
- ["e1bda9", "cea9cc94"],
- ["e1bdaa", "cea9cc93cc80"],
- ["e1bdab", "cea9cc94cc80"],
- ["e1bdac", "cea9cc93cc81"],
- ["e1bdad", "cea9cc94cc81"],
- ["e1bdae", "cea9cc93cd82"],
- ["e1bdaf", "cea9cc94cd82"],
- ["e1bdb0", "ceb1cc80"],
- ["e1bdb1", "ceb1cc81"],
- ["e1bdb2", "ceb5cc80"],
- ["e1bdb3", "ceb5cc81"],
- ["e1bdb4", "ceb7cc80"],
- ["e1bdb5", "ceb7cc81"],
- ["e1bdb6", "ceb9cc80"],
- ["e1bdb7", "ceb9cc81"],
- ["e1bdb8", "cebfcc80"],
- ["e1bdb9", "cebfcc81"],
- ["e1bdba", "cf85cc80"],
- ["e1bdbb", "cf85cc81"],
- ["e1bdbc", "cf89cc80"],
- ["e1bdbd", "cf89cc81"],
- ["e1be80", "ceb1cd85cc93"],
- ["e1be81", "ceb1cd85cc94"],
- ["e1be82", "ceb1cd85cc93cc80"],
- ["e1be83", "ceb1cd85cc94cc80"],
- ["e1be84", "ceb1cd85cc93cc81"],
- ["e1be85", "ceb1cd85cc94cc81"],
- ["e1be86", "ceb1cd85cc93cd82"],
- ["e1be87", "ceb1cd85cc94cd82"],
- ["e1be88", "ce91cd85cc93"],
- ["e1be89", "ce91cd85cc94"],
- ["e1be8a", "ce91cd85cc93cc80"],
- ["e1be8b", "ce91cd85cc94cc80"],
- ["e1be8c", "ce91cd85cc93cc81"],
- ["e1be8d", "ce91cd85cc94cc81"],
- ["e1be8e", "ce91cd85cc93cd82"],
- ["e1be8f", "ce91cd85cc94cd82"],
- ["e1be90", "ceb7cd85cc93"],
- ["e1be91", "ceb7cd85cc94"],
- ["e1be92", "ceb7cd85cc93cc80"],
- ["e1be93", "ceb7cd85cc94cc80"],
- ["e1be94", "ceb7cd85cc93cc81"],
- ["e1be95", "ceb7cd85cc94cc81"],
- ["e1be96", "ceb7cd85cc93cd82"],
- ["e1be97", "ceb7cd85cc94cd82"],
- ["e1be98", "ce97cd85cc93"],
- ["e1be99", "ce97cd85cc94"],
- ["e1be9a", "ce97cd85cc93cc80"],
- ["e1be9b", "ce97cd85cc94cc80"],
- ["e1be9c", "ce97cd85cc93cc81"],
- ["e1be9d", "ce97cd85cc94cc81"],
- ["e1be9e", "ce97cd85cc93cd82"],
- ["e1be9f", "ce97cd85cc94cd82"],
- ["e1bea0", "cf89cd85cc93"],
- ["e1bea1", "cf89cd85cc94"],
- ["e1bea2", "cf89cd85cc93cc80"],
- ["e1bea3", "cf89cd85cc94cc80"],
- ["e1bea4", "cf89cd85cc93cc81"],
- ["e1bea5", "cf89cd85cc94cc81"],
- ["e1bea6", "cf89cd85cc93cd82"],
- ["e1bea7", "cf89cd85cc94cd82"],
- ["e1bea8", "cea9cd85cc93"],
- ["e1bea9", "cea9cd85cc94"],
- ["e1beaa", "cea9cd85cc93cc80"],
- ["e1beab", "cea9cd85cc94cc80"],
- ["e1beac", "cea9cd85cc93cc81"],
- ["e1bead", "cea9cd85cc94cc81"],
- ["e1beae", "cea9cd85cc93cd82"],
- ["e1beaf", "cea9cd85cc94cd82"],
- ["e1beb0", "ceb1cc86"],
- ["e1beb1", "ceb1cc84"],
- ["e1beb2", "ceb1cd85cc80"],
- ["e1beb3", "ceb1cd85"],
- ["e1beb4", "ceb1cd85cc81"],
- ["e1beb6", "ceb1cd82"],
- ["e1beb7", "ceb1cd85cd82"],
- ["e1beb8", "ce91cc86"],
- ["e1beb9", "ce91cc84"],
- ["e1beba", "ce91cc80"],
- ["e1bebb", "ce91cc81"],
- ["e1bebc", "ce91cd85"],
- ["e1bebe", "ceb9"],
- ["e1bf81", "c2a8cd82"],
- ["e1bf82", "ceb7cd85cc80"],
- ["e1bf83", "ceb7cd85"],
- ["e1bf84", "ceb7cd85cc81"],
- ["e1bf86", "ceb7cd82"],
- ["e1bf87", "ceb7cd85cd82"],
- ["e1bf88", "ce95cc80"],
- ["e1bf89", "ce95cc81"],
- ["e1bf8a", "ce97cc80"],
- ["e1bf8b", "ce97cc81"],
- ["e1bf8c", "ce97cd85"],
- ["e1bf8d", "e1bebfcc80"],
- ["e1bf8e", "e1bebfcc81"],
- ["e1bf8f", "e1bebfcd82"],
- ["e1bf90", "ceb9cc86"],
- ["e1bf91", "ceb9cc84"],
- ["e1bf92", "ceb9cc88cc80"],
- ["e1bf93", "ceb9cc88cc81"],
- ["e1bf96", "ceb9cd82"],
- ["e1bf97", "ceb9cc88cd82"],
- ["e1bf98", "ce99cc86"],
- ["e1bf99", "ce99cc84"],
- ["e1bf9a", "ce99cc80"],
- ["e1bf9b", "ce99cc81"],
- ["e1bf9d", "e1bfbecc80"],
- ["e1bf9e", "e1bfbecc81"],
- ["e1bf9f", "e1bfbecd82"],
- ["e1bfa0", "cf85cc86"],
- ["e1bfa1", "cf85cc84"],
- ["e1bfa2", "cf85cc88cc80"],
- ["e1bfa3", "cf85cc88cc81"],
- ["e1bfa4", "cf81cc93"],
- ["e1bfa5", "cf81cc94"],
- ["e1bfa6", "cf85cd82"],
- ["e1bfa7", "cf85cc88cd82"],
- ["e1bfa8", "cea5cc86"],
- ["e1bfa9", "cea5cc84"],
- ["e1bfaa", "cea5cc80"],
- ["e1bfab", "cea5cc81"],
- ["e1bfac", "cea1cc94"],
- ["e1bfad", "c2a8cc80"],
- ["e1bfae", "c2a8cc81"],
- ["e1bfaf", "60"],
- ["e1bfb2", "cf89cd85cc80"],
- ["e1bfb3", "cf89cd85"],
- ["e1bfb4", "cebfcd85cc81"],
- ["e1bfb6", "cf89cd82"],
- ["e1bfb7", "cf89cd85cd82"],
- ["e1bfb8", "ce9fcc80"],
- ["e1bfb9", "ce9fcc81"],
- ["e1bfba", "cea9cc80"],
- ["e1bfbb", "cea9cc81"],
- ["e1bfbc", "cea9cd85"],
- ["e1bfbd", "c2b4"],
- ["e3818c", "e3818be38299"],
- ["e3818e", "e3818de38299"],
- ["e38190", "e3818fe38299"],
- ["e38192", "e38191e38299"],
- ["e38194", "e38193e38299"],
- ["e38196", "e38195e38299"],
- ["e38198", "e38197e38299"],
- ["e3819a", "e38199e38299"],
- ["e3819c", "e3819be38299"],
- ["e3819e", "e3819de38299"],
- ["e381a0", "e3819fe38299"],
- ["e381a2", "e381a1e38299"],
- ["e381a5", "e381a4e38299"],
- ["e381a7", "e381a6e38299"],
- ["e381a9", "e381a8e38299"],
- ["e381b0", "e381afe38299"],
- ["e381b1", "e381afe3829a"],
- ["e381b3", "e381b2e38299"],
- ["e381b4", "e381b2e3829a"],
- ["e381b6", "e381b5e38299"],
- ["e381b7", "e381b5e3829a"],
- ["e381b9", "e381b8e38299"],
- ["e381ba", "e381b8e3829a"],
- ["e381bc", "e381bbe38299"],
- ["e381bd", "e381bbe3829a"],
- ["e38294", "e38186e38299"],
- ["e3829e", "e3829de38299"],
- ["e382ac", "e382abe38299"],
- ["e382ae", "e382ade38299"],
- ["e382b0", "e382afe38299"],
- ["e382b2", "e382b1e38299"],
- ["e382b4", "e382b3e38299"],
- ["e382b6", "e382b5e38299"],
- ["e382b8", "e382b7e38299"],
- ["e382ba", "e382b9e38299"],
- ["e382bc", "e382bbe38299"],
- ["e382be", "e382bde38299"],
- ["e38380", "e382bfe38299"],
- ["e38382", "e38381e38299"],
- ["e38385", "e38384e38299"],
- ["e38387", "e38386e38299"],
- ["e38389", "e38388e38299"],
- ["e38390", "e3838fe38299"],
- ["e38391", "e3838fe3829a"],
- ["e38393", "e38392e38299"],
- ["e38394", "e38392e3829a"],
- ["e38396", "e38395e38299"],
- ["e38397", "e38395e3829a"],
- ["e38399", "e38398e38299"],
- ["e3839a", "e38398e3829a"],
- ["e3839c", "e3839be38299"],
- ["e3839d", "e3839be3829a"],
- ["e383b4", "e382a6e38299"],
- ["e383b7", "e383afe38299"],
- ["e383b8", "e383b0e38299"],
- ["e383b9", "e383b1e38299"],
- ["e383ba", "e383b2e38299"],
- ["e383be", "e383bde38299"],
- ["efac9f", "d7b2d6b7"],
- ["efacaa", "d7a9d781"],
- ["efacab", "d7a9d782"],
- ["efacac", "d7a9d6bcd781"],
- ["efacad", "d7a9d6bcd782"],
- ["efacae", "d790d6b7"],
- ["efacaf", "d790d6b8"],
- ["efacb0", "d790d6bc"],
- ["efacb1", "d791d6bc"],
- ["efacb2", "d792d6bc"],
- ["efacb3", "d793d6bc"],
- ["efacb4", "d794d6bc"],
- ["efacb5", "d795d6bc"],
- ["efacb6", "d796d6bc"],
- ["efacb8", "d798d6bc"],
- ["efacb9", "d799d6bc"],
- ["efacba", "d79ad6bc"],
- ["efacbb", "d79bd6bc"],
- ["efacbc", "d79cd6bc"],
- ["efacbe", "d79ed6bc"],
- ["efad80", "d7a0d6bc"],
- ["efad81", "d7a1d6bc"],
- ["efad83", "d7a3d6bc"],
- ["efad84", "d7a4d6bc"],
- ["efad86", "d7a6d6bc"],
- ["efad87", "d7a7d6bc"],
- ["efad88", "d7a8d6bc"],
- ["efad89", "d7a9d6bc"],
- ["efad8a", "d7aad6bc"],
- ["efad8b", "d795d6b9"],
- ["efad8c", "d791d6bf"],
- ["efad8d", "d79bd6bf"],
- ["efad8e", "d7a4d6bf"],
-]
diff --git a/enc/trans/utf8_mac.trans b/enc/trans/utf8_mac.trans
deleted file mode 100644
index 7569c34ac0..0000000000
--- a/enc/trans/utf8_mac.trans
+++ /dev/null
@@ -1,242 +0,0 @@
-#include "transcode_data.h"
-
-<%
- require 'utf8_mac-tbl'
-
- transcode_tblgen("UTF-8", "UTF8-MAC",
- MAC_DECOMPOSE_TBL + [
- ["{00-7F}", :nomap],
- ["{c2-df}{80-bf}", :nomap0],
- ["e0{a0-bf}{80-bf}", :nomap0],
- ["{e1-ec}{80-bf}{80-bf}", :nomap0],
- ["ed{80-9f}{80-bf}", :nomap0],
- ["{ee-ef}{80-bf}{80-bf}", :nomap0],
- ["f0{90-bf}{80-bf}{80-bf}", :nomap0],
- ["{f1-f3}{80-bf}{80-bf}{80-bf}", :nomap0],
- ])
-
- map = {}
- map["{00-7f}"] = :func_so
- map["{c2-df}{80-bf}"] = :func_so
- map["e0{a0-bf}{80-bf}"] = :func_so
- map["{e1-ec}{80-bf}{80-bf}"] = :func_so
- map["ed{80-9f}{80-bf}"] = :func_so
- map["{ee-ef}{80-bf}{80-bf}"] = :func_so
- map["f0{90-bf}{80-bf}{80-bf}"] = :func_so
- map["{f1-f3}{80-bf}{80-bf}{80-bf}"] = :func_so
- map["f4{80-8f}{80-bf}{80-bf}"] = :func_so
- transcode_generate_node(ActionMap.parse(map), "from_UTF8_MAC")
-
- ary = MAC_DECOMPOSE_TBL.select{|k,v|v.scan(/[0-7C-F].(?:[89AB].)*/i).length == 3}
- transcode_generate_node(ActionMap.parse(ary.map{|k,v|[v,k]}), "from_utf8_mac_nfc3")
-
- ary = MAC_DECOMPOSE_TBL.select{|k,v|v.scan(/[0-7C-F].(?:[89AB].)*/i).length == 2}
- transcode_generate_node(ActionMap.parse(ary.map{|k,v|[v,k]}), "from_utf8_mac_nfc2")
-%>
-
-<%= transcode_generated_code %>
-
-#define BYTE_ADDR(index) (<%= OUTPUT_PREFIX %>byte_array + (index))
-#define WORD_ADDR(index) (<%= OUTPUT_PREFIX %>word_array + INFO2WORDINDEX(index))
-#define BL_BASE BYTE_ADDR(BYTE_LOOKUP_BASE(WORD_ADDR(next_info)))
-#define BL_INFO WORD_ADDR(BYTE_LOOKUP_INFO(WORD_ADDR(next_info)))
-#define BL_MIN_BYTE (BL_BASE[0])
-#define BL_MAX_BYTE (BL_BASE[1])
-#define BL_OFFSET(byte) (BL_BASE[2+(byte)-BL_MIN_BYTE])
-#define BL_ACTION(byte) (BL_INFO[BL_OFFSET((byte))])
-
-#define STATUS_BUF_SIZE 16
-struct from_utf8_mac_status {
- unsigned char buf[STATUS_BUF_SIZE];
- int beg;
- int end;
- int len;
-};
-#define buf_length(sp) (sp->len)
-
-int
-buf_bytesize(struct from_utf8_mac_status *sp)
-{
- int size = sp->end - sp->beg + STATUS_BUF_SIZE;
- size %= STATUS_BUF_SIZE;
- return size;
-}
-
-void
-buf_push(struct from_utf8_mac_status *sp, const unsigned char *p, ssize_t l)
-{
- const unsigned char *pend = p + l;
- while (p < pend) {
- sp->buf[sp->end++] = *p++;
- sp->end %= STATUS_BUF_SIZE;
- }
- sp->len++;
-}
-
-unsigned char
-buf_shift(struct from_utf8_mac_status *sp)
-{
- unsigned char c = sp->buf[sp->beg++];
- sp->beg %= STATUS_BUF_SIZE;
- if ((c & 0xC0) != 0x80) sp->len--;
- return c;
-}
-
-void
-buf_shift_char(struct from_utf8_mac_status *sp)
-{
- while (sp->beg != sp->end) {
- buf_shift(sp);
- if ((sp->buf[sp->beg] & 0xC0) != 0x80) break;
- }
-}
-
-void
-buf_clear(struct from_utf8_mac_status *sp)
-{
- sp->beg = sp->end = sp->len = 0;
-}
-
-unsigned char
-buf_at(struct from_utf8_mac_status *sp, int pos)
-{
- pos += sp->beg;
- pos %= STATUS_BUF_SIZE;
- return sp->buf[pos];
-}
-
-int
-buf_output_char(struct from_utf8_mac_status *sp, unsigned char *o)
-{
- int n = 0;
- while (sp->beg != sp->end) {
- o[n++] = buf_shift(sp);
- if ((sp->buf[sp->beg] & 0xC0) != 0x80) break;
- }
- return n;
-}
-
-int
-buf_output_all(struct from_utf8_mac_status *sp, unsigned char *o)
-{
- int n = 0;
- while (sp->beg != sp->end) {
- o[n++] = buf_shift(sp);
- }
- return n;
-}
-
-VALUE
-get_info(VALUE next_info, struct from_utf8_mac_status *sp) {
- int pos = 0;
- while (pos < buf_bytesize(sp)) {
- unsigned char next_byte = buf_at(sp, pos++);
- if (next_byte < BL_MIN_BYTE || BL_MAX_BYTE < next_byte)
- next_info = INVALID;
- else {
- next_info = (VALUE)BL_ACTION(next_byte);
- }
- if ((next_info & 3) == 0) continue;
- break;
- }
- return next_info;
-}
-
-int
-buf_apply(int mode, struct from_utf8_mac_status *sp, unsigned char *o)
-{
- int n = 0;
- VALUE next_info = mode == 3 ? from_utf8_mac_nfc3 : from_utf8_mac_nfc2;
- next_info = get_info(next_info, sp);
- switch (next_info & 0x1F) {
- case THREEbt:
- o[n++] = getBT1(next_info);
- case TWObt:
- o[n++] = getBT2(next_info);
- o[n++] = getBT3(next_info);
- if (mode == 3) {
- buf_clear(sp);
- }
- else {
- buf_shift_char(sp);
- buf_shift_char(sp);
- }
- break;
- default:
- return 0;
- }
- return n;
-}
-
-static int
-from_utf8_mac_init(void *statep)
-{
- struct from_utf8_mac_status *sp = statep;
- buf_clear(sp);
- return 0;
-}
-
-static ssize_t
-from_utf8_mac_finish(void *statep,
- unsigned char *o, size_t osize)
-{
- struct from_utf8_mac_status *sp = statep;
- int n;
- if (buf_length(sp) == 0) return 0;
- n = buf_apply(2, sp, o) + buf_output_all(sp, o);
- return n;
-}
-
-static ssize_t
-fun_so_from_utf8_mac(void *statep,
- const unsigned char *s, size_t l,
- unsigned char *o, size_t osize)
-{
- struct from_utf8_mac_status *sp = statep;
- int n = 0;
-
- switch (l) {
- case 1:
- n = from_utf8_mac_finish(sp, o, osize);
- break;
- case 4:
- n = from_utf8_mac_finish(sp, o, osize);
- o[n++] = *s++;
- o[n++] = *s++;
- o[n++] = *s++;
- o[n++] = *s++;
- return n;
- }
-
- buf_push(sp, s, l);
- if (buf_length(sp) < 3) return n;
-
- n = buf_apply(3, sp, o);
- if (n > 0) return n;
-
- n = buf_apply(2, sp, o);
- if (n > 0) return n;
-
- return buf_output_char(sp, o);
-}
-
-static const rb_transcoder
-rb_from_UTF8_MAC = {
- "UTF8-MAC", "UTF-8", from_UTF8_MAC,
- TRANSCODE_TABLE_INFO,
- 1, /* input_unit_length */
- 4, /* max_input */
- 10, /* max_output */
- asciicompat_encoder, /* asciicompat_type */
- sizeof(struct from_utf8_mac_status), from_utf8_mac_init, from_utf8_mac_init,
- NULL, NULL, NULL, fun_so_from_utf8_mac,
- from_utf8_mac_finish
-};
-
-void
-Init_utf8_mac(void)
-{
-<%= transcode_register_code %>
- rb_register_transcoder(&rb_from_UTF8_MAC);
-}
-
diff --git a/enc/trans/utf_16_32.trans b/enc/trans/utf_16_32.trans
deleted file mode 100644
index 1bf6ed0975..0000000000
--- a/enc/trans/utf_16_32.trans
+++ /dev/null
@@ -1,369 +0,0 @@
-#include "transcode_data.h"
-
-<%
- map = {}
- map["{00-ff}{00-d7,e0-ff}"] = :func_so
- map["{00-ff}{d8-db}{00-ff}{dc-df}"] = :func_so
- transcode_generate_node(ActionMap.parse(map), "from_UTF_16LE")
-
- map = {}
- map["{00-ff}{00-d7,e0-ff}0000"] = :func_so
- map["{00-ff}{00-ff}{01-10}00"] = :func_so
- transcode_generate_node(ActionMap.parse(map), "from_UTF_32LE")
-
- map = {}
- map["{00-d7,e0-ff}{00-ff}"] = :func_so
- map["{d8-db}{00-ff}{dc-df}{00-ff}"] = :func_so
- transcode_generate_node(ActionMap.parse(map), "from_UTF_16BE")
-
- map = {}
- map["0000{00-d7,e0-ff}{00-ff}"] = :func_so
- map["00{01-10}{00-ff}{00-ff}"] = :func_so
- transcode_generate_node(ActionMap.parse(map), "from_UTF_32BE")
-
- map = {}
- map["{00-7f}"] = :func_so
- map["{c2-df}{80-bf}"] = :func_so
- map["e0{a0-bf}{80-bf}"] = :func_so
- map["{e1-ec}{80-bf}{80-bf}"] = :func_so
- map["ed{80-9f}{80-bf}"] = :func_so
- map["{ee-ef}{80-bf}{80-bf}"] = :func_so
- map["f0{90-bf}{80-bf}{80-bf}"] = :func_so
- map["{f1-f3}{80-bf}{80-bf}{80-bf}"] = :func_so
- map["f4{80-8f}{80-bf}{80-bf}"] = :func_so
- am = ActionMap.parse(map)
- transcode_generate_node(am, "from_UTF_8")
-%>
-
-<%= transcode_generated_code %>
-
-static ssize_t
-fun_so_from_utf_16be(void *statep, const unsigned char *s, size_t l, unsigned char *o, size_t osize)
-{
- if (!s[0] && s[1]<0x80) {
- o[0] = s[1];
- return 1;
- }
- else if (s[0]<0x08) {
- o[0] = 0xC0 | (s[0]<<2) | (s[1]>>6);
- o[1] = 0x80 | (s[1]&0x3F);
- return 2;
- }
- else if ((s[0]&0xF8)!=0xD8) {
- o[0] = 0xE0 | (s[0]>>4);
- o[1] = 0x80 | ((s[0]&0x0F)<<2) | (s[1]>>6);
- o[2] = 0x80 | (s[1]&0x3F);
- return 3;
- }
- else {
- unsigned int u = (((s[0]&0x03)<<2)|(s[1]>>6)) + 1;
- o[0] = 0xF0 | (u>>2);
- o[1] = 0x80 | ((u&0x03)<<4) | ((s[1]>>2)&0x0F);
- o[2] = 0x80 | ((s[1]&0x03)<<4) | ((s[2]&0x03)<<2) | (s[3]>>6);
- o[3] = 0x80 | (s[3]&0x3F);
- return 4;
- }
-}
-
-static ssize_t
-fun_so_to_utf_16be(void *statep, const unsigned char *s, size_t l, unsigned char *o, size_t osize)
-{
- if (!(s[0]&0x80)) {
- o[0] = 0x00;
- o[1] = s[0];
- return 2;
- }
- else if ((s[0]&0xE0)==0xC0) {
- o[0] = (s[0]>>2)&0x07;
- o[1] = ((s[0]&0x03)<<6) | (s[1]&0x3F);
- return 2;
- }
- else if ((s[0]&0xF0)==0xE0) {
- o[0] = (s[0]<<4) | ((s[1]>>2)^0x20);
- o[1] = (s[1]<<6) | (s[2]^0x80);
- return 2;
- }
- else {
- int w = (((s[0]&0x07)<<2) | ((s[1]>>4)&0x03)) - 1;
- o[0] = 0xD8 | (w>>2);
- o[1] = (w<<6) | ((s[1]&0x0F)<<2) | ((s[2]>>4)-8);
- o[2] = 0xDC | ((s[2]>>2)&0x03);
- o[3] = (s[2]<<6) | (s[3]&~0x80);
- return 4;
- }
-}
-
-static ssize_t
-fun_so_from_utf_16le(void *statep, const unsigned char *s, size_t l, unsigned char *o, size_t osize)
-{
- if (!s[1] && s[0]<0x80) {
- o[0] = s[0];
- return 1;
- }
- else if (s[1]<0x08) {
- o[0] = 0xC0 | (s[1]<<2) | (s[0]>>6);
- o[1] = 0x80 | (s[0]&0x3F);
- return 2;
- }
- else if ((s[1]&0xF8)!=0xD8) {
- o[0] = 0xE0 | (s[1]>>4);
- o[1] = 0x80 | ((s[1]&0x0F)<<2) | (s[0]>>6);
- o[2] = 0x80 | (s[0]&0x3F);
- return 3;
- }
- else {
- unsigned int u = (((s[1]&0x03)<<2)|(s[0]>>6)) + 1;
- o[0] = 0xF0 | u>>2;
- o[1] = 0x80 | ((u&0x03)<<4) | ((s[0]>>2)&0x0F);
- o[2] = 0x80 | ((s[0]&0x03)<<4) | ((s[3]&0x03)<<2) | (s[2]>>6);
- o[3] = 0x80 | (s[2]&0x3F);
- return 4;
- }
-}
-
-static ssize_t
-fun_so_to_utf_16le(void *statep, const unsigned char *s, size_t l, unsigned char *o, size_t osize)
-{
- if (!(s[0]&0x80)) {
- o[1] = 0x00;
- o[0] = s[0];
- return 2;
- }
- else if ((s[0]&0xE0)==0xC0) {
- o[1] = (s[0]>>2)&0x07;
- o[0] = ((s[0]&0x03)<<6) | (s[1]&0x3F);
- return 2;
- }
- else if ((s[0]&0xF0)==0xE0) {
- o[1] = (s[0]<<4) | ((s[1]>>2)^0x20);
- o[0] = (s[1]<<6) | (s[2]^0x80);
- return 2;
- }
- else {
- int w = (((s[0]&0x07)<<2) | ((s[1]>>4)&0x03)) - 1;
- o[1] = 0xD8 | (w>>2);
- o[0] = (w<<6) | ((s[1]&0x0F)<<2) | ((s[2]>>4)-8);
- o[3] = 0xDC | ((s[2]>>2)&0x03);
- o[2] = (s[2]<<6) | (s[3]&~0x80);
- return 4;
- }
-}
-
-static ssize_t
-fun_so_from_utf_32be(void *statep, const unsigned char *s, size_t l, unsigned char *o, size_t osize)
-{
- if (!s[1]) {
- if (s[2]==0 && s[3]<0x80) {
- o[0] = s[3];
- return 1;
- }
- else if (s[2]<0x08) {
- o[0] = 0xC0 | (s[2]<<2) | (s[3]>>6);
- o[1] = 0x80 | (s[3]&0x3F);
- return 2;
- }
- else {
- o[0] = 0xE0 | (s[2]>>4);
- o[1] = 0x80 | ((s[2]&0x0F)<<2) | (s[3]>>6);
- o[2] = 0x80 | (s[3]&0x3F);
- return 3;
- }
- }
- else {
- o[0] = 0xF0 | (s[1]>>2);
- o[1] = 0x80 | ((s[1]&0x03)<<4) | (s[2]>>4);
- o[2] = 0x80 | ((s[2]&0x0F)<<2) | (s[3]>>6);
- o[3] = 0x80 | (s[3]&0x3F);
- return 4;
- }
-}
-
-static ssize_t
-fun_so_to_utf_32be(void *statep, const unsigned char *s, size_t l, unsigned char *o, size_t osize)
-{
- o[0] = 0;
- if (!(s[0]&0x80)) {
- o[1] = o[2] = 0x00;
- o[3] = s[0];
- }
- else if ((s[0]&0xE0)==0xC0) {
- o[1] = 0x00;
- o[2] = (s[0]>>2)&0x07;
- o[3] = ((s[0]&0x03)<<6) | (s[1]&0x3F);
- }
- else if ((s[0]&0xF0)==0xE0) {
- o[1] = 0x00;
- o[2] = (s[0]<<4) | ((s[1]>>2)^0x20);
- o[3] = (s[1]<<6) | (s[2]^0x80);
- }
- else {
- o[1] = ((s[0]&0x07)<<2) | ((s[1]>>4)&0x03);
- o[2] = ((s[1]&0x0F)<<4) | ((s[2]>>2)&0x0F);
- o[3] = ((s[2]&0x03)<<6) | (s[3]&0x3F);
- }
- return 4;
-}
-
-static ssize_t
-fun_so_from_utf_32le(void *statep, const unsigned char *s, size_t l, unsigned char *o, size_t osize)
-{
- if (!s[2]) {
- if (s[1]==0 && s[0]<0x80) {
- o[0] = s[0];
- return 1;
- }
- else if (s[1]<0x08) {
- o[0] = 0xC0 | (s[1]<<2) | (s[0]>>6);
- o[1] = 0x80 | (s[0]&0x3F);
- return 2;
- }
- else {
- o[0] = 0xE0 | (s[1]>>4);
- o[1] = 0x80 | ((s[1]&0x0F)<<2) | (s[0]>>6);
- o[2] = 0x80 | (s[0]&0x3F);
- return 3;
- }
- }
- else {
- o[0] = 0xF0 | (s[2]>>2);
- o[1] = 0x80 | ((s[2]&0x03)<<4) | (s[1]>>4);
- o[2] = 0x80 | ((s[1]&0x0F)<<2) | (s[0]>>6);
- o[3] = 0x80 | (s[0]&0x3F);
- return 4;
- }
-}
-
-static ssize_t
-fun_so_to_utf_32le(void *statep, const unsigned char *s, size_t l, unsigned char *o, size_t osize)
-{
- o[3] = 0;
- if (!(s[0]&0x80)) {
- o[2] = o[1] = 0x00;
- o[0] = s[0];
- }
- else if ((s[0]&0xE0)==0xC0) {
- o[2] = 0x00;
- o[1] = (s[0]>>2)&0x07;
- o[0] = ((s[0]&0x03)<<6) | (s[1]&0x3F);
- }
- else if ((s[0]&0xF0)==0xE0) {
- o[2] = 0x00;
- o[1] = (s[0]<<4) | ((s[1]>>2)^0x20);
- o[0] = (s[1]<<6) | (s[2]^0x80);
- }
- else {
- o[2] = ((s[0]&0x07)<<2) | ((s[1]>>4)&0x03);
- o[1] = ((s[1]&0x0F)<<4) | ((s[2]>>2)&0x0F);
- o[0] = ((s[2]&0x03)<<6) | (s[3]&0x3F);
- }
- return 4;
-}
-
-static const rb_transcoder
-rb_from_UTF_16BE = {
- "UTF-16BE", "UTF-8", from_UTF_16BE,
- TRANSCODE_TABLE_INFO,
- 2, /* input_unit_length */
- 4, /* max_input */
- 4, /* max_output */
- asciicompat_decoder, /* asciicompat_type */
- 0, NULL, NULL, /* state_size, state_init, state_fini */
- NULL, NULL, NULL, fun_so_from_utf_16be
-};
-
-static const rb_transcoder
-rb_to_UTF_16BE = {
- "UTF-8", "UTF-16BE", from_UTF_8,
- TRANSCODE_TABLE_INFO,
- 1, /* input_unit_length */
- 4, /* max_input */
- 4, /* max_output */
- asciicompat_encoder, /* asciicompat_type */
- 0, NULL, NULL, /* state_size, state_init, state_fini */
- NULL, NULL, NULL, fun_so_to_utf_16be
-};
-
-static const rb_transcoder
-rb_from_UTF_16LE = {
- "UTF-16LE", "UTF-8", from_UTF_16LE,
- TRANSCODE_TABLE_INFO,
- 2, /* input_unit_length */
- 4, /* max_input */
- 4, /* max_output */
- asciicompat_decoder, /* asciicompat_type */
- 0, NULL, NULL, /* state_size, state_init, state_fini */
- NULL, NULL, NULL, fun_so_from_utf_16le
-};
-
-static const rb_transcoder
-rb_to_UTF_16LE = {
- "UTF-8", "UTF-16LE", from_UTF_8,
- TRANSCODE_TABLE_INFO,
- 1, /* input_unit_length */
- 4, /* max_input */
- 4, /* max_output */
- asciicompat_encoder, /* asciicompat_type */
- 0, NULL, NULL, /* state_size, state_init, state_fini */
- NULL, NULL, NULL, fun_so_to_utf_16le
-};
-
-static const rb_transcoder
-rb_from_UTF_32BE = {
- "UTF-32BE", "UTF-8", from_UTF_32BE,
- TRANSCODE_TABLE_INFO,
- 4, /* input_unit_length */
- 4, /* max_input */
- 4, /* max_output */
- asciicompat_decoder, /* asciicompat_type */
- 0, NULL, NULL, /* state_size, state_init, state_fini */
- NULL, NULL, NULL, fun_so_from_utf_32be
-};
-
-static const rb_transcoder
-rb_to_UTF_32BE = {
- "UTF-8", "UTF-32BE", from_UTF_8,
- TRANSCODE_TABLE_INFO,
- 1, /* input_unit_length */
- 4, /* max_input */
- 4, /* max_output */
- asciicompat_encoder, /* asciicompat_type */
- 0, NULL, NULL, /* state_size, state_init, state_fini */
- NULL, NULL, NULL, fun_so_to_utf_32be
-};
-
-static const rb_transcoder
-rb_from_UTF_32LE = {
- "UTF-32LE", "UTF-8", from_UTF_32LE,
- TRANSCODE_TABLE_INFO,
- 4, /* input_unit_length */
- 4, /* max_input */
- 4, /* max_output */
- asciicompat_decoder, /* asciicompat_type */
- 0, NULL, NULL, /* state_size, state_init, state_fini */
- NULL, NULL, NULL, fun_so_from_utf_32le
-};
-
-static const rb_transcoder
-rb_to_UTF_32LE = {
- "UTF-8", "UTF-32LE", from_UTF_8,
- TRANSCODE_TABLE_INFO,
- 1, /* input_unit_length */
- 4, /* max_input */
- 4, /* max_output */
- asciicompat_encoder, /* asciicompat_type */
- 0, NULL, NULL, /* state_size, state_init, state_fini */
- NULL, NULL, NULL, fun_so_to_utf_32le
-};
-
-void
-Init_utf_16_32(void)
-{
- rb_register_transcoder(&rb_from_UTF_16BE);
- rb_register_transcoder(&rb_to_UTF_16BE);
- rb_register_transcoder(&rb_from_UTF_16LE);
- rb_register_transcoder(&rb_to_UTF_16LE);
- rb_register_transcoder(&rb_from_UTF_32BE);
- rb_register_transcoder(&rb_to_UTF_32BE);
- rb_register_transcoder(&rb_from_UTF_32LE);
- rb_register_transcoder(&rb_to_UTF_32LE);
-}
diff --git a/enc/trans/windows-1250-tbl.rb b/enc/trans/windows-1250-tbl.rb
deleted file mode 100644
index 52063e17b1..0000000000
--- a/enc/trans/windows-1250-tbl.rb
+++ /dev/null
@@ -1,125 +0,0 @@
-WINDOWS_1250_TO_UCS_TBL = [
- ["A0",0xA0],
- ["A4",0xA4],
- ["A6",0xA6],
- ["A7",0xA7],
- ["A8",0xA8],
- ["A9",0xA9],
- ["AB",0xAB],
- ["AC",0xAC],
- ["AD",0xAD],
- ["AE",0xAE],
- ["B0",0xB0],
- ["B1",0xB1],
- ["B4",0xB4],
- ["B5",0xB5],
- ["B6",0xB6],
- ["B7",0xB7],
- ["B8",0xB8],
- ["BB",0xBB],
- ["C1",0xC1],
- ["C2",0xC2],
- ["C4",0xC4],
- ["C7",0xC7],
- ["C9",0xC9],
- ["CB",0xCB],
- ["CD",0xCD],
- ["CE",0xCE],
- ["D3",0xD3],
- ["D4",0xD4],
- ["D6",0xD6],
- ["D7",0xD7],
- ["DA",0xDA],
- ["DC",0xDC],
- ["DD",0xDD],
- ["DF",0xDF],
- ["E1",0xE1],
- ["E2",0xE2],
- ["E4",0xE4],
- ["E7",0xE7],
- ["E9",0xE9],
- ["EB",0xEB],
- ["ED",0xED],
- ["EE",0xEE],
- ["F3",0xF3],
- ["F4",0xF4],
- ["F6",0xF6],
- ["F7",0xF7],
- ["FA",0xFA],
- ["FC",0xFC],
- ["FD",0xFD],
- ["C3",0x102],
- ["E3",0x103],
- ["A5",0x104],
- ["B9",0x105],
- ["C6",0x106],
- ["E6",0x107],
- ["C8",0x10C],
- ["E8",0x10D],
- ["CF",0x10E],
- ["EF",0x10F],
- ["D0",0x110],
- ["F0",0x111],
- ["CA",0x118],
- ["EA",0x119],
- ["CC",0x11A],
- ["EC",0x11B],
- ["C5",0x139],
- ["E5",0x13A],
- ["BC",0x13D],
- ["BE",0x13E],
- ["A3",0x141],
- ["B3",0x142],
- ["D1",0x143],
- ["F1",0x144],
- ["D2",0x147],
- ["F2",0x148],
- ["D5",0x150],
- ["F5",0x151],
- ["C0",0x154],
- ["E0",0x155],
- ["D8",0x158],
- ["F8",0x159],
- ["8C",0x15A],
- ["9C",0x15B],
- ["AA",0x15E],
- ["BA",0x15F],
- ["8A",0x160],
- ["9A",0x161],
- ["DE",0x162],
- ["FE",0x163],
- ["8D",0x164],
- ["9D",0x165],
- ["D9",0x16E],
- ["F9",0x16F],
- ["DB",0x170],
- ["FB",0x171],
- ["8F",0x179],
- ["9F",0x17A],
- ["AF",0x17B],
- ["BF",0x17C],
- ["8E",0x17D],
- ["9E",0x17E],
- ["A1",0x2C7],
- ["A2",0x2D8],
- ["FF",0x2D9],
- ["B2",0x2DB],
- ["BD",0x2DD],
- ["96",0x2013],
- ["97",0x2014],
- ["91",0x2018],
- ["92",0x2019],
- ["82",0x201A],
- ["93",0x201C],
- ["94",0x201D],
- ["84",0x201E],
- ["86",0x2020],
- ["87",0x2021],
- ["95",0x2022],
- ["85",0x2026],
- ["89",0x2030],
- ["8B",0x2039],
- ["9B",0x203A],
- ["80",0x20AC],
- ["99",0x2122],
-] \ No newline at end of file
diff --git a/enc/trans/windows-1251-tbl.rb b/enc/trans/windows-1251-tbl.rb
deleted file mode 100644
index 870c718b72..0000000000
--- a/enc/trans/windows-1251-tbl.rb
+++ /dev/null
@@ -1,129 +0,0 @@
-WINDOWS_1251_TO_UCS_TBL = [
- ["A0",0xA0],
- ["A4",0xA4],
- ["A6",0xA6],
- ["A7",0xA7],
- ["A9",0xA9],
- ["AB",0xAB],
- ["AC",0xAC],
- ["AD",0xAD],
- ["AE",0xAE],
- ["B0",0xB0],
- ["B1",0xB1],
- ["B5",0xB5],
- ["B6",0xB6],
- ["B7",0xB7],
- ["BB",0xBB],
- ["A8",0x401],
- ["80",0x402],
- ["81",0x403],
- ["AA",0x404],
- ["BD",0x405],
- ["B2",0x406],
- ["AF",0x407],
- ["A3",0x408],
- ["8A",0x409],
- ["8C",0x40A],
- ["8E",0x40B],
- ["8D",0x40C],
- ["A1",0x40E],
- ["8F",0x40F],
- ["C0",0x410],
- ["C1",0x411],
- ["C2",0x412],
- ["C3",0x413],
- ["C4",0x414],
- ["C5",0x415],
- ["C6",0x416],
- ["C7",0x417],
- ["C8",0x418],
- ["C9",0x419],
- ["CA",0x41A],
- ["CB",0x41B],
- ["CC",0x41C],
- ["CD",0x41D],
- ["CE",0x41E],
- ["CF",0x41F],
- ["D0",0x420],
- ["D1",0x421],
- ["D2",0x422],
- ["D3",0x423],
- ["D4",0x424],
- ["D5",0x425],
- ["D6",0x426],
- ["D7",0x427],
- ["D8",0x428],
- ["D9",0x429],
- ["DA",0x42A],
- ["DB",0x42B],
- ["DC",0x42C],
- ["DD",0x42D],
- ["DE",0x42E],
- ["DF",0x42F],
- ["E0",0x430],
- ["E1",0x431],
- ["E2",0x432],
- ["E3",0x433],
- ["E4",0x434],
- ["E5",0x435],
- ["E6",0x436],
- ["E7",0x437],
- ["E8",0x438],
- ["E9",0x439],
- ["EA",0x43A],
- ["EB",0x43B],
- ["EC",0x43C],
- ["ED",0x43D],
- ["EE",0x43E],
- ["EF",0x43F],
- ["F0",0x440],
- ["F1",0x441],
- ["F2",0x442],
- ["F3",0x443],
- ["F4",0x444],
- ["F5",0x445],
- ["F6",0x446],
- ["F7",0x447],
- ["F8",0x448],
- ["F9",0x449],
- ["FA",0x44A],
- ["FB",0x44B],
- ["FC",0x44C],
- ["FD",0x44D],
- ["FE",0x44E],
- ["FF",0x44F],
- ["B8",0x451],
- ["90",0x452],
- ["83",0x453],
- ["BA",0x454],
- ["BE",0x455],
- ["B3",0x456],
- ["BF",0x457],
- ["BC",0x458],
- ["9A",0x459],
- ["9C",0x45A],
- ["9E",0x45B],
- ["9D",0x45C],
- ["A2",0x45E],
- ["9F",0x45F],
- ["A5",0x490],
- ["B4",0x491],
- ["96",0x2013],
- ["97",0x2014],
- ["91",0x2018],
- ["92",0x2019],
- ["82",0x201A],
- ["93",0x201C],
- ["94",0x201D],
- ["84",0x201E],
- ["86",0x2020],
- ["87",0x2021],
- ["95",0x2022],
- ["85",0x2026],
- ["89",0x2030],
- ["8B",0x2039],
- ["9B",0x203A],
- ["88",0x20AC],
- ["B9",0x2116],
- ["99",0x2122],
-] \ No newline at end of file
diff --git a/enc/trans/windows-1252-tbl.rb b/enc/trans/windows-1252-tbl.rb
deleted file mode 100644
index cefc72dff2..0000000000
--- a/enc/trans/windows-1252-tbl.rb
+++ /dev/null
@@ -1,125 +0,0 @@
-WINDOWS_1252_TO_UCS_TBL = [
- ["A0",0xA0],
- ["A1",0xA1],
- ["A2",0xA2],
- ["A3",0xA3],
- ["A4",0xA4],
- ["A5",0xA5],
- ["A6",0xA6],
- ["A7",0xA7],
- ["A8",0xA8],
- ["A9",0xA9],
- ["AA",0xAA],
- ["AB",0xAB],
- ["AC",0xAC],
- ["AD",0xAD],
- ["AE",0xAE],
- ["AF",0xAF],
- ["B0",0xB0],
- ["B1",0xB1],
- ["B2",0xB2],
- ["B3",0xB3],
- ["B4",0xB4],
- ["B5",0xB5],
- ["B6",0xB6],
- ["B7",0xB7],
- ["B8",0xB8],
- ["B9",0xB9],
- ["BA",0xBA],
- ["BB",0xBB],
- ["BC",0xBC],
- ["BD",0xBD],
- ["BE",0xBE],
- ["BF",0xBF],
- ["C0",0xC0],
- ["C1",0xC1],
- ["C2",0xC2],
- ["C3",0xC3],
- ["C4",0xC4],
- ["C5",0xC5],
- ["C6",0xC6],
- ["C7",0xC7],
- ["C8",0xC8],
- ["C9",0xC9],
- ["CA",0xCA],
- ["CB",0xCB],
- ["CC",0xCC],
- ["CD",0xCD],
- ["CE",0xCE],
- ["CF",0xCF],
- ["D0",0xD0],
- ["D1",0xD1],
- ["D2",0xD2],
- ["D3",0xD3],
- ["D4",0xD4],
- ["D5",0xD5],
- ["D6",0xD6],
- ["D7",0xD7],
- ["D8",0xD8],
- ["D9",0xD9],
- ["DA",0xDA],
- ["DB",0xDB],
- ["DC",0xDC],
- ["DD",0xDD],
- ["DE",0xDE],
- ["DF",0xDF],
- ["E0",0xE0],
- ["E1",0xE1],
- ["E2",0xE2],
- ["E3",0xE3],
- ["E4",0xE4],
- ["E5",0xE5],
- ["E6",0xE6],
- ["E7",0xE7],
- ["E8",0xE8],
- ["E9",0xE9],
- ["EA",0xEA],
- ["EB",0xEB],
- ["EC",0xEC],
- ["ED",0xED],
- ["EE",0xEE],
- ["EF",0xEF],
- ["F0",0xF0],
- ["F1",0xF1],
- ["F2",0xF2],
- ["F3",0xF3],
- ["F4",0xF4],
- ["F5",0xF5],
- ["F6",0xF6],
- ["F7",0xF7],
- ["F8",0xF8],
- ["F9",0xF9],
- ["FA",0xFA],
- ["FB",0xFB],
- ["FC",0xFC],
- ["FD",0xFD],
- ["FE",0xFE],
- ["FF",0xFF],
- ["8C",0x152],
- ["9C",0x153],
- ["8A",0x160],
- ["9A",0x161],
- ["9F",0x178],
- ["8E",0x17D],
- ["9E",0x17E],
- ["83",0x192],
- ["88",0x2C6],
- ["98",0x2DC],
- ["96",0x2013],
- ["97",0x2014],
- ["91",0x2018],
- ["92",0x2019],
- ["82",0x201A],
- ["93",0x201C],
- ["94",0x201D],
- ["84",0x201E],
- ["86",0x2020],
- ["87",0x2021],
- ["95",0x2022],
- ["85",0x2026],
- ["89",0x2030],
- ["8B",0x2039],
- ["9B",0x203A],
- ["80",0x20AC],
- ["99",0x2122],
-] \ No newline at end of file
diff --git a/enc/trans/windows-1253-tbl.rb b/enc/trans/windows-1253-tbl.rb
deleted file mode 100644
index 132edb60ba..0000000000
--- a/enc/trans/windows-1253-tbl.rb
+++ /dev/null
@@ -1,113 +0,0 @@
-WINDOWS_1253_TO_UCS_TBL = [
- ["A0",0xA0],
- ["A3",0xA3],
- ["A4",0xA4],
- ["A5",0xA5],
- ["A6",0xA6],
- ["A7",0xA7],
- ["A8",0xA8],
- ["A9",0xA9],
- ["AB",0xAB],
- ["AC",0xAC],
- ["AD",0xAD],
- ["AE",0xAE],
- ["B0",0xB0],
- ["B1",0xB1],
- ["B2",0xB2],
- ["B3",0xB3],
- ["B5",0xB5],
- ["B6",0xB6],
- ["B7",0xB7],
- ["BB",0xBB],
- ["BD",0xBD],
- ["83",0x192],
- ["B4",0x384],
- ["A1",0x385],
- ["A2",0x386],
- ["B8",0x388],
- ["B9",0x389],
- ["BA",0x38A],
- ["BC",0x38C],
- ["BE",0x38E],
- ["BF",0x38F],
- ["C0",0x390],
- ["C1",0x391],
- ["C2",0x392],
- ["C3",0x393],
- ["C4",0x394],
- ["C5",0x395],
- ["C6",0x396],
- ["C7",0x397],
- ["C8",0x398],
- ["C9",0x399],
- ["CA",0x39A],
- ["CB",0x39B],
- ["CC",0x39C],
- ["CD",0x39D],
- ["CE",0x39E],
- ["CF",0x39F],
- ["D0",0x3A0],
- ["D1",0x3A1],
- ["D3",0x3A3],
- ["D4",0x3A4],
- ["D5",0x3A5],
- ["D6",0x3A6],
- ["D7",0x3A7],
- ["D8",0x3A8],
- ["D9",0x3A9],
- ["DA",0x3AA],
- ["DB",0x3AB],
- ["DC",0x3AC],
- ["DD",0x3AD],
- ["DE",0x3AE],
- ["DF",0x3AF],
- ["E0",0x3B0],
- ["E1",0x3B1],
- ["E2",0x3B2],
- ["E3",0x3B3],
- ["E4",0x3B4],
- ["E5",0x3B5],
- ["E6",0x3B6],
- ["E7",0x3B7],
- ["E8",0x3B8],
- ["E9",0x3B9],
- ["EA",0x3BA],
- ["EB",0x3BB],
- ["EC",0x3BC],
- ["ED",0x3BD],
- ["EE",0x3BE],
- ["EF",0x3BF],
- ["F0",0x3C0],
- ["F1",0x3C1],
- ["F2",0x3C2],
- ["F3",0x3C3],
- ["F4",0x3C4],
- ["F5",0x3C5],
- ["F6",0x3C6],
- ["F7",0x3C7],
- ["F8",0x3C8],
- ["F9",0x3C9],
- ["FA",0x3CA],
- ["FB",0x3CB],
- ["FC",0x3CC],
- ["FD",0x3CD],
- ["FE",0x3CE],
- ["96",0x2013],
- ["97",0x2014],
- ["AF",0x2015],
- ["91",0x2018],
- ["92",0x2019],
- ["82",0x201A],
- ["93",0x201C],
- ["94",0x201D],
- ["84",0x201E],
- ["86",0x2020],
- ["87",0x2021],
- ["95",0x2022],
- ["85",0x2026],
- ["89",0x2030],
- ["8B",0x2039],
- ["9B",0x203A],
- ["80",0x20AC],
- ["99",0x2122],
-] \ No newline at end of file
diff --git a/enc/trans/windows-1254-tbl.rb b/enc/trans/windows-1254-tbl.rb
deleted file mode 100644
index 81a747afaa..0000000000
--- a/enc/trans/windows-1254-tbl.rb
+++ /dev/null
@@ -1,123 +0,0 @@
-WINDOWS_1254_TO_UCS_TBL = [
- ["A0",0xA0],
- ["A1",0xA1],
- ["A2",0xA2],
- ["A3",0xA3],
- ["A4",0xA4],
- ["A5",0xA5],
- ["A6",0xA6],
- ["A7",0xA7],
- ["A8",0xA8],
- ["A9",0xA9],
- ["AA",0xAA],
- ["AB",0xAB],
- ["AC",0xAC],
- ["AD",0xAD],
- ["AE",0xAE],
- ["AF",0xAF],
- ["B0",0xB0],
- ["B1",0xB1],
- ["B2",0xB2],
- ["B3",0xB3],
- ["B4",0xB4],
- ["B5",0xB5],
- ["B6",0xB6],
- ["B7",0xB7],
- ["B8",0xB8],
- ["B9",0xB9],
- ["BA",0xBA],
- ["BB",0xBB],
- ["BC",0xBC],
- ["BD",0xBD],
- ["BE",0xBE],
- ["BF",0xBF],
- ["C0",0xC0],
- ["C1",0xC1],
- ["C2",0xC2],
- ["C3",0xC3],
- ["C4",0xC4],
- ["C5",0xC5],
- ["C6",0xC6],
- ["C7",0xC7],
- ["C8",0xC8],
- ["C9",0xC9],
- ["CA",0xCA],
- ["CB",0xCB],
- ["CC",0xCC],
- ["CD",0xCD],
- ["CE",0xCE],
- ["CF",0xCF],
- ["D1",0xD1],
- ["D2",0xD2],
- ["D3",0xD3],
- ["D4",0xD4],
- ["D5",0xD5],
- ["D6",0xD6],
- ["D7",0xD7],
- ["D8",0xD8],
- ["D9",0xD9],
- ["DA",0xDA],
- ["DB",0xDB],
- ["DC",0xDC],
- ["DF",0xDF],
- ["E0",0xE0],
- ["E1",0xE1],
- ["E2",0xE2],
- ["E3",0xE3],
- ["E4",0xE4],
- ["E5",0xE5],
- ["E6",0xE6],
- ["E7",0xE7],
- ["E8",0xE8],
- ["E9",0xE9],
- ["EA",0xEA],
- ["EB",0xEB],
- ["EC",0xEC],
- ["ED",0xED],
- ["EE",0xEE],
- ["EF",0xEF],
- ["F1",0xF1],
- ["F2",0xF2],
- ["F3",0xF3],
- ["F4",0xF4],
- ["F5",0xF5],
- ["F6",0xF6],
- ["F7",0xF7],
- ["F8",0xF8],
- ["F9",0xF9],
- ["FA",0xFA],
- ["FB",0xFB],
- ["FC",0xFC],
- ["FF",0xFF],
- ["D0",0x11E],
- ["F0",0x11F],
- ["DD",0x130],
- ["FD",0x131],
- ["8C",0x152],
- ["9C",0x153],
- ["DE",0x15E],
- ["FE",0x15F],
- ["8A",0x160],
- ["9A",0x161],
- ["9F",0x178],
- ["83",0x192],
- ["88",0x2C6],
- ["98",0x2DC],
- ["96",0x2013],
- ["97",0x2014],
- ["91",0x2018],
- ["92",0x2019],
- ["82",0x201A],
- ["93",0x201C],
- ["94",0x201D],
- ["84",0x201E],
- ["86",0x2020],
- ["87",0x2021],
- ["95",0x2022],
- ["85",0x2026],
- ["89",0x2030],
- ["8B",0x2039],
- ["9B",0x203A],
- ["80",0x20AC],
- ["99",0x2122],
-] \ No newline at end of file
diff --git a/enc/trans/windows-1255-tbl.rb b/enc/trans/windows-1255-tbl.rb
deleted file mode 100644
index 9084a56a10..0000000000
--- a/enc/trans/windows-1255-tbl.rb
+++ /dev/null
@@ -1,141 +0,0 @@
-WINDOWS_1255_TO_UCS_TBL = [
- ["A0",0xA0],
- ["A1",0xA1],
- ["A2",0xA2],
- ["A3",0xA3],
- ["A5",0xA5],
- ["A6",0xA6],
- ["A7",0xA7],
- ["A8",0xA8],
- ["A9",0xA9],
- ["AB",0xAB],
- ["AC",0xAC],
- ["AD",0xAD],
- ["AE",0xAE],
- ["AF",0xAF],
- ["B0",0xB0],
- ["B1",0xB1],
- ["B2",0xB2],
- ["B3",0xB3],
- ["B4",0xB4],
- ["B5",0xB5],
- ["B6",0xB6],
- ["B7",0xB7],
- ["B8",0xB8],
- ["B9",0xB9],
- ["BB",0xBB],
- ["BC",0xBC],
- ["BD",0xBD],
- ["BE",0xBE],
- ["BF",0xBF],
- ["AA",0xD7],
- ["BA",0xF7],
- ["83",0x192],
- ["88",0x2C6],
- ["98",0x2DC],
- ["C0",0x5B0],
- ["C1",0x5B1],
- ["C2",0x5B2],
- ["C3",0x5B3],
- ["C4",0x5B4],
- ["C5",0x5B5],
- ["C6",0x5B6],
- ["C7",0x5B7],
- ["C8",0x5B8],
- ["C9",0x5B9],
- ["CB",0x5BB],
- ["CC",0x5BC],
- ["CD",0x5BD],
- ["CE",0x5BE],
- ["CF",0x5BF],
- ["D0",0x5C0],
- ["D1",0x5C1],
- ["D2",0x5C2],
- ["D3",0x5C3],
- ["E0",0x5D0],
- ["E1",0x5D1],
- ["E2",0x5D2],
- ["E3",0x5D3],
- ["E4",0x5D4],
- ["E5",0x5D5],
- ["E6",0x5D6],
- ["E7",0x5D7],
- ["E8",0x5D8],
- ["E9",0x5D9],
- ["EA",0x5DA],
- ["EB",0x5DB],
- ["EC",0x5DC],
- ["ED",0x5DD],
- ["EE",0x5DE],
- ["EF",0x5DF],
- ["F0",0x5E0],
- ["F1",0x5E1],
- ["F2",0x5E2],
- ["F3",0x5E3],
- ["F4",0x5E4],
- ["F5",0x5E5],
- ["F6",0x5E6],
- ["F7",0x5E7],
- ["F8",0x5E8],
- ["F9",0x5E9],
- ["FA",0x5EA],
- ["D4",0x5F0],
- ["D5",0x5F1],
- ["D6",0x5F2],
- ["D7",0x5F3],
- ["D8",0x5F4],
- ["FD",0x200E],
- ["FE",0x200F],
- ["96",0x2013],
- ["97",0x2014],
- ["91",0x2018],
- ["92",0x2019],
- ["82",0x201A],
- ["93",0x201C],
- ["94",0x201D],
- ["84",0x201E],
- ["86",0x2020],
- ["87",0x2021],
- ["95",0x2022],
- ["85",0x2026],
- ["89",0x2030],
- ["8B",0x2039],
- ["9B",0x203A],
- ["A4",0x20AA],
- ["80",0x20AC],
- ["99",0x2122],
- ["E9C4",0xFB1D],
- ["D6C7",0xFB1F],
- ["F9D1",0xFB2A],
- ["F9D2",0xFB2B],
- ["F9CCD1",0xFB2C],
- ["F9CCD2",0xFB2D],
- ["E0C7",0xFB2E],
- ["E0C8",0xFB2F],
- ["E0CC",0xFB30],
- ["E1CC",0xFB31],
- ["E2CC",0xFB32],
- ["E3CC",0xFB33],
- ["E4CC",0xFB34],
- ["E5CC",0xFB35],
- ["E6CC",0xFB36],
- ["E8CC",0xFB38],
- ["E9CC",0xFB39],
- ["EACC",0xFB3A],
- ["EBCC",0xFB3B],
- ["ECCC",0xFB3C],
- ["EECC",0xFB3E],
- ["F0CC",0xFB40],
- ["F1CC",0xFB41],
- ["F3CC",0xFB43],
- ["F4CC",0xFB44],
- ["F6CC",0xFB46],
- ["F7CC",0xFB47],
- ["F8CC",0xFB48],
- ["F9CC",0xFB49],
- ["FACC",0xFB4A],
- ["E5C9",0xFB4B],
- ["E1CF",0xFB4C],
- ["EBCF",0xFB4D],
- ["F4CF",0xFB4E],
-] \ No newline at end of file
diff --git a/enc/trans/windows-1256-tbl.rb b/enc/trans/windows-1256-tbl.rb
deleted file mode 100644
index 25c5874fb0..0000000000
--- a/enc/trans/windows-1256-tbl.rb
+++ /dev/null
@@ -1,130 +0,0 @@
-WINDOWS_1256_TO_UCS_TBL = [
- ["A0",0xA0],
- ["A2",0xA2],
- ["A3",0xA3],
- ["A4",0xA4],
- ["A5",0xA5],
- ["A6",0xA6],
- ["A7",0xA7],
- ["A8",0xA8],
- ["A9",0xA9],
- ["AB",0xAB],
- ["AC",0xAC],
- ["AD",0xAD],
- ["AE",0xAE],
- ["AF",0xAF],
- ["B0",0xB0],
- ["B1",0xB1],
- ["B2",0xB2],
- ["B3",0xB3],
- ["B4",0xB4],
- ["B5",0xB5],
- ["B6",0xB6],
- ["B7",0xB7],
- ["B8",0xB8],
- ["B9",0xB9],
- ["BB",0xBB],
- ["BC",0xBC],
- ["BD",0xBD],
- ["BE",0xBE],
- ["D7",0xD7],
- ["E0",0xE0],
- ["E2",0xE2],
- ["E7",0xE7],
- ["E8",0xE8],
- ["E9",0xE9],
- ["EA",0xEA],
- ["EB",0xEB],
- ["EE",0xEE],
- ["EF",0xEF],
- ["F4",0xF4],
- ["F7",0xF7],
- ["F9",0xF9],
- ["FB",0xFB],
- ["FC",0xFC],
- ["8C",0x152],
- ["9C",0x153],
- ["83",0x192],
- ["88",0x2C6],
- ["A1",0x60C],
- ["BA",0x61B],
- ["BF",0x61F],
- ["C1",0x621],
- ["C2",0x622],
- ["C3",0x623],
- ["C4",0x624],
- ["C5",0x625],
- ["C6",0x626],
- ["C7",0x627],
- ["C8",0x628],
- ["C9",0x629],
- ["CA",0x62A],
- ["CB",0x62B],
- ["CC",0x62C],
- ["CD",0x62D],
- ["CE",0x62E],
- ["CF",0x62F],
- ["D0",0x630],
- ["D1",0x631],
- ["D2",0x632],
- ["D3",0x633],
- ["D4",0x634],
- ["D5",0x635],
- ["D6",0x636],
- ["D8",0x637],
- ["D9",0x638],
- ["DA",0x639],
- ["DB",0x63A],
- ["DC",0x640],
- ["DD",0x641],
- ["DE",0x642],
- ["DF",0x643],
- ["E1",0x644],
- ["E3",0x645],
- ["E4",0x646],
- ["E5",0x647],
- ["E6",0x648],
- ["EC",0x649],
- ["ED",0x64A],
- ["F0",0x64B],
- ["F1",0x64C],
- ["F2",0x64D],
- ["F3",0x64E],
- ["F5",0x64F],
- ["F6",0x650],
- ["F8",0x651],
- ["FA",0x652],
- ["8A",0x679],
- ["81",0x67E],
- ["8D",0x686],
- ["8F",0x688],
- ["9A",0x691],
- ["8E",0x698],
- ["98",0x6A9],
- ["90",0x6AF],
- ["9F",0x6BA],
- ["AA",0x6BE],
- ["C0",0x6C1],
- ["FF",0x6D2],
- ["9D",0x200C],
- ["9E",0x200D],
- ["FD",0x200E],
- ["FE",0x200F],
- ["96",0x2013],
- ["97",0x2014],
- ["91",0x2018],
- ["92",0x2019],
- ["82",0x201A],
- ["93",0x201C],
- ["94",0x201D],
- ["84",0x201E],
- ["86",0x2020],
- ["87",0x2021],
- ["95",0x2022],
- ["85",0x2026],
- ["89",0x2030],
- ["8B",0x2039],
- ["9B",0x203A],
- ["80",0x20AC],
- ["99",0x2122],
-] \ No newline at end of file
diff --git a/enc/trans/windows-1257-tbl.rb b/enc/trans/windows-1257-tbl.rb
deleted file mode 100644
index 9e89b2b0b5..0000000000
--- a/enc/trans/windows-1257-tbl.rb
+++ /dev/null
@@ -1,118 +0,0 @@
-WINDOWS_1257_TO_UCS_TBL = [
- ["A0",0xA0],
- ["A2",0xA2],
- ["A3",0xA3],
- ["A4",0xA4],
- ["A6",0xA6],
- ["A7",0xA7],
- ["8D",0xA8],
- ["A9",0xA9],
- ["AB",0xAB],
- ["AC",0xAC],
- ["AD",0xAD],
- ["AE",0xAE],
- ["9D",0xAF],
- ["B0",0xB0],
- ["B1",0xB1],
- ["B2",0xB2],
- ["B3",0xB3],
- ["B4",0xB4],
- ["B5",0xB5],
- ["B6",0xB6],
- ["B7",0xB7],
- ["8F",0xB8],
- ["B9",0xB9],
- ["BB",0xBB],
- ["BC",0xBC],
- ["BD",0xBD],
- ["BE",0xBE],
- ["C4",0xC4],
- ["C5",0xC5],
- ["AF",0xC6],
- ["C9",0xC9],
- ["D3",0xD3],
- ["D5",0xD5],
- ["D6",0xD6],
- ["D7",0xD7],
- ["A8",0xD8],
- ["DC",0xDC],
- ["DF",0xDF],
- ["E4",0xE4],
- ["E5",0xE5],
- ["BF",0xE6],
- ["E9",0xE9],
- ["F3",0xF3],
- ["F5",0xF5],
- ["F6",0xF6],
- ["F7",0xF7],
- ["B8",0xF8],
- ["FC",0xFC],
- ["C2",0x100],
- ["E2",0x101],
- ["C0",0x104],
- ["E0",0x105],
- ["C3",0x106],
- ["E3",0x107],
- ["C8",0x10C],
- ["E8",0x10D],
- ["C7",0x112],
- ["E7",0x113],
- ["CB",0x116],
- ["EB",0x117],
- ["C6",0x118],
- ["E6",0x119],
- ["CC",0x122],
- ["EC",0x123],
- ["CE",0x12A],
- ["EE",0x12B],
- ["C1",0x12E],
- ["E1",0x12F],
- ["CD",0x136],
- ["ED",0x137],
- ["CF",0x13B],
- ["EF",0x13C],
- ["D9",0x141],
- ["F9",0x142],
- ["D1",0x143],
- ["F1",0x144],
- ["D2",0x145],
- ["F2",0x146],
- ["D4",0x14C],
- ["F4",0x14D],
- ["AA",0x156],
- ["BA",0x157],
- ["DA",0x15A],
- ["FA",0x15B],
- ["D0",0x160],
- ["F0",0x161],
- ["DB",0x16A],
- ["FB",0x16B],
- ["D8",0x172],
- ["F8",0x173],
- ["CA",0x179],
- ["EA",0x17A],
- ["DD",0x17B],
- ["FD",0x17C],
- ["DE",0x17D],
- ["FE",0x17E],
- ["8E",0x2C7],
- ["FF",0x2D9],
- ["9E",0x2DB],
- ["96",0x2013],
- ["97",0x2014],
- ["91",0x2018],
- ["92",0x2019],
- ["82",0x201A],
- ["93",0x201C],
- ["94",0x201D],
- ["84",0x201E],
- ["86",0x2020],
- ["87",0x2021],
- ["95",0x2022],
- ["85",0x2026],
- ["89",0x2030],
- ["8B",0x2039],
- ["9B",0x203A],
- ["80",0x20AC],
- ["99",0x2122],
-] \ No newline at end of file
diff --git a/enc/trans/windows-874-tbl.rb b/enc/trans/windows-874-tbl.rb
deleted file mode 100644
index 0552df3d28..0000000000
--- a/enc/trans/windows-874-tbl.rb
+++ /dev/null
@@ -1,99 +0,0 @@
-WINDOWS_874_TO_UCS_TBL = [
- ["A0",0xA0],
- ["A1",0xE01],
- ["A2",0xE02],
- ["A3",0xE03],
- ["A4",0xE04],
- ["A5",0xE05],
- ["A6",0xE06],
- ["A7",0xE07],
- ["A8",0xE08],
- ["A9",0xE09],
- ["AA",0xE0A],
- ["AB",0xE0B],
- ["AC",0xE0C],
- ["AD",0xE0D],
- ["AE",0xE0E],
- ["AF",0xE0F],
- ["B0",0xE10],
- ["B1",0xE11],
- ["B2",0xE12],
- ["B3",0xE13],
- ["B4",0xE14],
- ["B5",0xE15],
- ["B6",0xE16],
- ["B7",0xE17],
- ["B8",0xE18],
- ["B9",0xE19],
- ["BA",0xE1A],
- ["BB",0xE1B],
- ["BC",0xE1C],
- ["BD",0xE1D],
- ["BE",0xE1E],
- ["BF",0xE1F],
- ["C0",0xE20],
- ["C1",0xE21],
- ["C2",0xE22],
- ["C3",0xE23],
- ["C4",0xE24],
- ["C5",0xE25],
- ["C6",0xE26],
- ["C7",0xE27],
- ["C8",0xE28],
- ["C9",0xE29],
- ["CA",0xE2A],
- ["CB",0xE2B],
- ["CC",0xE2C],
- ["CD",0xE2D],
- ["CE",0xE2E],
- ["CF",0xE2F],
- ["D0",0xE30],
- ["D1",0xE31],
- ["D2",0xE32],
- ["D3",0xE33],
- ["D4",0xE34],
- ["D5",0xE35],
- ["D6",0xE36],
- ["D7",0xE37],
- ["D8",0xE38],
- ["D9",0xE39],
- ["DA",0xE3A],
- ["DF",0xE3F],
- ["E0",0xE40],
- ["E1",0xE41],
- ["E2",0xE42],
- ["E3",0xE43],
- ["E4",0xE44],
- ["E5",0xE45],
- ["E6",0xE46],
- ["E7",0xE47],
- ["E8",0xE48],
- ["E9",0xE49],
- ["EA",0xE4A],
- ["EB",0xE4B],
- ["EC",0xE4C],
- ["ED",0xE4D],
- ["EE",0xE4E],
- ["EF",0xE4F],
- ["F0",0xE50],
- ["F1",0xE51],
- ["F2",0xE52],
- ["F3",0xE53],
- ["F4",0xE54],
- ["F5",0xE55],
- ["F6",0xE56],
- ["F7",0xE57],
- ["F8",0xE58],
- ["F9",0xE59],
- ["FA",0xE5A],
- ["FB",0xE5B],
- ["96",0x2013],
- ["97",0x2014],
- ["91",0x2018],
- ["92",0x2019],
- ["93",0x201C],
- ["94",0x201D],
- ["95",0x2022],
- ["85",0x2026],
- ["80",0x20AC],
-] \ No newline at end of file
diff --git a/enc/unicode.c b/enc/unicode.c
deleted file mode 100644
index 2dfcbba3f6..0000000000
--- a/enc/unicode.c
+++ /dev/null
@@ -1,11359 +0,0 @@
-/**********************************************************************
- unicode.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 "regint.h"
-
-#define ONIGENC_IS_UNICODE_ISO_8859_1_CTYPE(code,ctype) \
- ((EncUNICODE_ISO_8859_1_CtypeTable[code] & CTYPE_TO_BIT(ctype)) != 0)
-#if 0
-#define ONIGENC_IS_UNICODE_ISO_8859_1_BIT_CTYPE(code,cbit) \
- ((EncUNICODE_ISO_8859_1_CtypeTable[code] & (cbit)) != 0)
-#endif
-
-static const unsigned short EncUNICODE_ISO_8859_1_CtypeTable[256] = {
- 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008,
- 0x4008, 0x428c, 0x4289, 0x4288, 0x4288, 0x4288, 0x4008, 0x4008,
- 0x4008, 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, 0x0288, 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, 0x00a0, 0x00a0, 0x00a0,
- 0x00a0, 0x00a0, 0x30e2, 0x01a0, 0x00a0, 0x00a8, 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
-};
-
-/* 'NEWLINE' */
-static const OnigCodePoint CR_NEWLINE[] = {
- 1,
- 0x000a, 0x000a
-}; /* CR_NEWLINE */
-
-/* 'Alpha': [[:Alpha:]] */
-static const OnigCodePoint CR_Alpha[] = {
- 418,
- 0x0041, 0x005a,
- 0x0061, 0x007a,
- 0x00aa, 0x00aa,
- 0x00b5, 0x00b5,
- 0x00ba, 0x00ba,
- 0x00c0, 0x00d6,
- 0x00d8, 0x00f6,
- 0x00f8, 0x0241,
- 0x0250, 0x02c1,
- 0x02c6, 0x02d1,
- 0x02e0, 0x02e4,
- 0x02ee, 0x02ee,
- 0x0300, 0x036f,
- 0x037a, 0x037a,
- 0x0386, 0x0386,
- 0x0388, 0x038a,
- 0x038c, 0x038c,
- 0x038e, 0x03a1,
- 0x03a3, 0x03ce,
- 0x03d0, 0x03f5,
- 0x03f7, 0x0481,
- 0x0483, 0x0486,
- 0x0488, 0x04ce,
- 0x04d0, 0x04f9,
- 0x0500, 0x050f,
- 0x0531, 0x0556,
- 0x0559, 0x0559,
- 0x0561, 0x0587,
- 0x0591, 0x05b9,
- 0x05bb, 0x05bd,
- 0x05bf, 0x05bf,
- 0x05c1, 0x05c2,
- 0x05c4, 0x05c5,
- 0x05c7, 0x05c7,
- 0x05d0, 0x05ea,
- 0x05f0, 0x05f2,
- 0x0610, 0x0615,
- 0x0621, 0x063a,
- 0x0640, 0x065e,
- 0x066e, 0x06d3,
- 0x06d5, 0x06dc,
- 0x06de, 0x06e8,
- 0x06ea, 0x06ef,
- 0x06fa, 0x06fc,
- 0x06ff, 0x06ff,
- 0x0710, 0x074a,
- 0x074d, 0x076d,
- 0x0780, 0x07b1,
- 0x0901, 0x0939,
- 0x093c, 0x094d,
- 0x0950, 0x0954,
- 0x0958, 0x0963,
- 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,
- 0x09f0, 0x09f1,
- 0x0a01, 0x0a03,
- 0x0a05, 0x0a0a,
- 0x0a0f, 0x0a10,
- 0x0a13, 0x0a28,
- 0x0a2a, 0x0a30,
- 0x0a32, 0x0a33,
- 0x0a35, 0x0a36,
- 0x0a38, 0x0a39,
- 0x0a3c, 0x0a3c,
- 0x0a3e, 0x0a42,
- 0x0a47, 0x0a48,
- 0x0a4b, 0x0a4d,
- 0x0a59, 0x0a5c,
- 0x0a5e, 0x0a5e,
- 0x0a70, 0x0a74,
- 0x0a81, 0x0a83,
- 0x0a85, 0x0a8d,
- 0x0a8f, 0x0a91,
- 0x0a93, 0x0aa8,
- 0x0aaa, 0x0ab0,
- 0x0ab2, 0x0ab3,
- 0x0ab5, 0x0ab9,
- 0x0abc, 0x0ac5,
- 0x0ac7, 0x0ac9,
- 0x0acb, 0x0acd,
- 0x0ad0, 0x0ad0,
- 0x0ae0, 0x0ae3,
- 0x0b01, 0x0b03,
- 0x0b05, 0x0b0c,
- 0x0b0f, 0x0b10,
- 0x0b13, 0x0b28,
- 0x0b2a, 0x0b30,
- 0x0b32, 0x0b33,
- 0x0b35, 0x0b39,
- 0x0b3c, 0x0b43,
- 0x0b47, 0x0b48,
- 0x0b4b, 0x0b4d,
- 0x0b56, 0x0b57,
- 0x0b5c, 0x0b5d,
- 0x0b5f, 0x0b61,
- 0x0b71, 0x0b71,
- 0x0b82, 0x0b83,
- 0x0b85, 0x0b8a,
- 0x0b8e, 0x0b90,
- 0x0b92, 0x0b95,
- 0x0b99, 0x0b9a,
- 0x0b9c, 0x0b9c,
- 0x0b9e, 0x0b9f,
- 0x0ba3, 0x0ba4,
- 0x0ba8, 0x0baa,
- 0x0bae, 0x0bb9,
- 0x0bbe, 0x0bc2,
- 0x0bc6, 0x0bc8,
- 0x0bca, 0x0bcd,
- 0x0bd7, 0x0bd7,
- 0x0c01, 0x0c03,
- 0x0c05, 0x0c0c,
- 0x0c0e, 0x0c10,
- 0x0c12, 0x0c28,
- 0x0c2a, 0x0c33,
- 0x0c35, 0x0c39,
- 0x0c3e, 0x0c44,
- 0x0c46, 0x0c48,
- 0x0c4a, 0x0c4d,
- 0x0c55, 0x0c56,
- 0x0c60, 0x0c61,
- 0x0c82, 0x0c83,
- 0x0c85, 0x0c8c,
- 0x0c8e, 0x0c90,
- 0x0c92, 0x0ca8,
- 0x0caa, 0x0cb3,
- 0x0cb5, 0x0cb9,
- 0x0cbc, 0x0cc4,
- 0x0cc6, 0x0cc8,
- 0x0cca, 0x0ccd,
- 0x0cd5, 0x0cd6,
- 0x0cde, 0x0cde,
- 0x0ce0, 0x0ce1,
- 0x0d02, 0x0d03,
- 0x0d05, 0x0d0c,
- 0x0d0e, 0x0d10,
- 0x0d12, 0x0d28,
- 0x0d2a, 0x0d39,
- 0x0d3e, 0x0d43,
- 0x0d46, 0x0d48,
- 0x0d4a, 0x0d4d,
- 0x0d57, 0x0d57,
- 0x0d60, 0x0d61,
- 0x0d82, 0x0d83,
- 0x0d85, 0x0d96,
- 0x0d9a, 0x0db1,
- 0x0db3, 0x0dbb,
- 0x0dbd, 0x0dbd,
- 0x0dc0, 0x0dc6,
- 0x0dca, 0x0dca,
- 0x0dcf, 0x0dd4,
- 0x0dd6, 0x0dd6,
- 0x0dd8, 0x0ddf,
- 0x0df2, 0x0df3,
- 0x0e01, 0x0e3a,
- 0x0e40, 0x0e4e,
- 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,
- 0x0edc, 0x0edd,
- 0x0f00, 0x0f00,
- 0x0f18, 0x0f19,
- 0x0f35, 0x0f35,
- 0x0f37, 0x0f37,
- 0x0f39, 0x0f39,
- 0x0f3e, 0x0f47,
- 0x0f49, 0x0f6a,
- 0x0f71, 0x0f84,
- 0x0f86, 0x0f8b,
- 0x0f90, 0x0f97,
- 0x0f99, 0x0fbc,
- 0x0fc6, 0x0fc6,
- 0x1000, 0x1021,
- 0x1023, 0x1027,
- 0x1029, 0x102a,
- 0x102c, 0x1032,
- 0x1036, 0x1039,
- 0x1050, 0x1059,
- 0x10a0, 0x10c5,
- 0x10d0, 0x10fa,
- 0x10fc, 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, 0x135f,
- 0x1380, 0x138f,
- 0x13a0, 0x13f4,
- 0x1401, 0x166c,
- 0x166f, 0x1676,
- 0x1681, 0x169a,
- 0x16a0, 0x16ea,
- 0x1700, 0x170c,
- 0x170e, 0x1714,
- 0x1720, 0x1734,
- 0x1740, 0x1753,
- 0x1760, 0x176c,
- 0x176e, 0x1770,
- 0x1772, 0x1773,
- 0x1780, 0x17b3,
- 0x17b6, 0x17d3,
- 0x17d7, 0x17d7,
- 0x17dc, 0x17dd,
- 0x180b, 0x180d,
- 0x1820, 0x1877,
- 0x1880, 0x18a9,
- 0x1900, 0x191c,
- 0x1920, 0x192b,
- 0x1930, 0x193b,
- 0x1950, 0x196d,
- 0x1970, 0x1974,
- 0x1980, 0x19a9,
- 0x19b0, 0x19c9,
- 0x1a00, 0x1a1b,
- 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, 0x1fbc,
- 0x1fbe, 0x1fbe,
- 0x1fc2, 0x1fc4,
- 0x1fc6, 0x1fcc,
- 0x1fd0, 0x1fd3,
- 0x1fd6, 0x1fdb,
- 0x1fe0, 0x1fec,
- 0x1ff2, 0x1ff4,
- 0x1ff6, 0x1ffc,
- 0x2071, 0x2071,
- 0x207f, 0x207f,
- 0x2090, 0x2094,
- 0x20d0, 0x20eb,
- 0x2102, 0x2102,
- 0x2107, 0x2107,
- 0x210a, 0x2113,
- 0x2115, 0x2115,
- 0x2119, 0x211d,
- 0x2124, 0x2124,
- 0x2126, 0x2126,
- 0x2128, 0x2128,
- 0x212a, 0x212d,
- 0x212f, 0x2131,
- 0x2133, 0x2139,
- 0x213c, 0x213f,
- 0x2145, 0x2149,
- 0x2c00, 0x2c2e,
- 0x2c30, 0x2c5e,
- 0x2c80, 0x2ce4,
- 0x2d00, 0x2d25,
- 0x2d30, 0x2d65,
- 0x2d6f, 0x2d6f,
- 0x2d80, 0x2d96,
- 0x2da0, 0x2da6,
- 0x2da8, 0x2dae,
- 0x2db0, 0x2db6,
- 0x2db8, 0x2dbe,
- 0x2dc0, 0x2dc6,
- 0x2dc8, 0x2dce,
- 0x2dd0, 0x2dd6,
- 0x2dd8, 0x2dde,
- 0x3005, 0x3006,
- 0x302a, 0x302f,
- 0x3031, 0x3035,
- 0x303b, 0x303c,
- 0x3041, 0x3096,
- 0x3099, 0x309a,
- 0x309d, 0x309f,
- 0x30a1, 0x30fa,
- 0x30fc, 0x30ff,
- 0x3105, 0x312c,
- 0x3131, 0x318e,
- 0x31a0, 0x31b7,
- 0x31f0, 0x31ff,
- 0x3400, 0x4db5,
- 0x4e00, 0x9fbb,
- 0xa000, 0xa48c,
- 0xa800, 0xa827,
- 0xac00, 0xd7a3,
- 0xf900, 0xfa2d,
- 0xfa30, 0xfa6a,
- 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, 0xfe23,
- 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,
- 0x10300, 0x1031e,
- 0x10330, 0x10349,
- 0x10380, 0x1039d,
- 0x103a0, 0x103c3,
- 0x103c8, 0x103cf,
- 0x10400, 0x1049d,
- 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, 0x10a3f,
- 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, 0x1d7c9,
- 0x20000, 0x2a6d6,
- 0x2f800, 0x2fa1d,
- 0xe0100, 0xe01ef
-}; /* 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[] = {
- 19,
- 0x0000, 0x001f,
- 0x007f, 0x009f,
- 0x00ad, 0x00ad,
- 0x0600, 0x0603,
- 0x06dd, 0x06dd,
- 0x070f, 0x070f,
- 0x17b4, 0x17b5,
- 0x200b, 0x200f,
- 0x202a, 0x202e,
- 0x2060, 0x2063,
- 0x206a, 0x206f,
- 0xd800, 0xf8ff,
- 0xfeff, 0xfeff,
- 0xfff9, 0xfffb,
- 0x1d173, 0x1d17a,
- 0xe0001, 0xe0001,
- 0xe0020, 0xe007f,
- 0xf0000, 0xffffd,
- 0x100000, 0x10fffd
-}; /* CR_Cntrl */
-
-/* 'Digit': [[:Digit:]] */
-static const OnigCodePoint CR_Digit[] = {
- 23,
- 0x0030, 0x0039,
- 0x0660, 0x0669,
- 0x06f0, 0x06f9,
- 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,
- 0x17e0, 0x17e9,
- 0x1810, 0x1819,
- 0x1946, 0x194f,
- 0x19d0, 0x19d9,
- 0xff10, 0xff19,
- 0x104a0, 0x104a9,
- 0x1d7ce, 0x1d7ff
-}; /* CR_Digit */
-
-/* 'Graph': [[:Graph:]] */
-static const OnigCodePoint CR_Graph[] = {
- 424,
- 0x0021, 0x007e,
- 0x00a1, 0x0241,
- 0x0250, 0x036f,
- 0x0374, 0x0375,
- 0x037a, 0x037a,
- 0x037e, 0x037e,
- 0x0384, 0x038a,
- 0x038c, 0x038c,
- 0x038e, 0x03a1,
- 0x03a3, 0x03ce,
- 0x03d0, 0x0486,
- 0x0488, 0x04ce,
- 0x04d0, 0x04f9,
- 0x0500, 0x050f,
- 0x0531, 0x0556,
- 0x0559, 0x055f,
- 0x0561, 0x0587,
- 0x0589, 0x058a,
- 0x0591, 0x05b9,
- 0x05bb, 0x05c7,
- 0x05d0, 0x05ea,
- 0x05f0, 0x05f4,
- 0x0600, 0x0603,
- 0x060b, 0x0615,
- 0x061b, 0x061b,
- 0x061e, 0x061f,
- 0x0621, 0x063a,
- 0x0640, 0x065e,
- 0x0660, 0x070d,
- 0x070f, 0x074a,
- 0x074d, 0x076d,
- 0x0780, 0x07b1,
- 0x0901, 0x0939,
- 0x093c, 0x094d,
- 0x0950, 0x0954,
- 0x0958, 0x0970,
- 0x097d, 0x097d,
- 0x0981, 0x0983,
- 0x0985, 0x098c,
- 0x098f, 0x0990,
- 0x0993, 0x09a8,
- 0x09aa, 0x09b0,
- 0x09b2, 0x09b2,
- 0x09b6, 0x09b9,
- 0x09bc, 0x09c4,
- 0x09c7, 0x09c8,
- 0x09cb, 0x09ce,
- 0x09d7, 0x09d7,
- 0x09dc, 0x09dd,
- 0x09df, 0x09e3,
- 0x09e6, 0x09fa,
- 0x0a01, 0x0a03,
- 0x0a05, 0x0a0a,
- 0x0a0f, 0x0a10,
- 0x0a13, 0x0a28,
- 0x0a2a, 0x0a30,
- 0x0a32, 0x0a33,
- 0x0a35, 0x0a36,
- 0x0a38, 0x0a39,
- 0x0a3c, 0x0a3c,
- 0x0a3e, 0x0a42,
- 0x0a47, 0x0a48,
- 0x0a4b, 0x0a4d,
- 0x0a59, 0x0a5c,
- 0x0a5e, 0x0a5e,
- 0x0a66, 0x0a74,
- 0x0a81, 0x0a83,
- 0x0a85, 0x0a8d,
- 0x0a8f, 0x0a91,
- 0x0a93, 0x0aa8,
- 0x0aaa, 0x0ab0,
- 0x0ab2, 0x0ab3,
- 0x0ab5, 0x0ab9,
- 0x0abc, 0x0ac5,
- 0x0ac7, 0x0ac9,
- 0x0acb, 0x0acd,
- 0x0ad0, 0x0ad0,
- 0x0ae0, 0x0ae3,
- 0x0ae6, 0x0aef,
- 0x0af1, 0x0af1,
- 0x0b01, 0x0b03,
- 0x0b05, 0x0b0c,
- 0x0b0f, 0x0b10,
- 0x0b13, 0x0b28,
- 0x0b2a, 0x0b30,
- 0x0b32, 0x0b33,
- 0x0b35, 0x0b39,
- 0x0b3c, 0x0b43,
- 0x0b47, 0x0b48,
- 0x0b4b, 0x0b4d,
- 0x0b56, 0x0b57,
- 0x0b5c, 0x0b5d,
- 0x0b5f, 0x0b61,
- 0x0b66, 0x0b71,
- 0x0b82, 0x0b83,
- 0x0b85, 0x0b8a,
- 0x0b8e, 0x0b90,
- 0x0b92, 0x0b95,
- 0x0b99, 0x0b9a,
- 0x0b9c, 0x0b9c,
- 0x0b9e, 0x0b9f,
- 0x0ba3, 0x0ba4,
- 0x0ba8, 0x0baa,
- 0x0bae, 0x0bb9,
- 0x0bbe, 0x0bc2,
- 0x0bc6, 0x0bc8,
- 0x0bca, 0x0bcd,
- 0x0bd7, 0x0bd7,
- 0x0be6, 0x0bfa,
- 0x0c01, 0x0c03,
- 0x0c05, 0x0c0c,
- 0x0c0e, 0x0c10,
- 0x0c12, 0x0c28,
- 0x0c2a, 0x0c33,
- 0x0c35, 0x0c39,
- 0x0c3e, 0x0c44,
- 0x0c46, 0x0c48,
- 0x0c4a, 0x0c4d,
- 0x0c55, 0x0c56,
- 0x0c60, 0x0c61,
- 0x0c66, 0x0c6f,
- 0x0c82, 0x0c83,
- 0x0c85, 0x0c8c,
- 0x0c8e, 0x0c90,
- 0x0c92, 0x0ca8,
- 0x0caa, 0x0cb3,
- 0x0cb5, 0x0cb9,
- 0x0cbc, 0x0cc4,
- 0x0cc6, 0x0cc8,
- 0x0cca, 0x0ccd,
- 0x0cd5, 0x0cd6,
- 0x0cde, 0x0cde,
- 0x0ce0, 0x0ce1,
- 0x0ce6, 0x0cef,
- 0x0d02, 0x0d03,
- 0x0d05, 0x0d0c,
- 0x0d0e, 0x0d10,
- 0x0d12, 0x0d28,
- 0x0d2a, 0x0d39,
- 0x0d3e, 0x0d43,
- 0x0d46, 0x0d48,
- 0x0d4a, 0x0d4d,
- 0x0d57, 0x0d57,
- 0x0d60, 0x0d61,
- 0x0d66, 0x0d6f,
- 0x0d82, 0x0d83,
- 0x0d85, 0x0d96,
- 0x0d9a, 0x0db1,
- 0x0db3, 0x0dbb,
- 0x0dbd, 0x0dbd,
- 0x0dc0, 0x0dc6,
- 0x0dca, 0x0dca,
- 0x0dcf, 0x0dd4,
- 0x0dd6, 0x0dd6,
- 0x0dd8, 0x0ddf,
- 0x0df2, 0x0df4,
- 0x0e01, 0x0e3a,
- 0x0e3f, 0x0e5b,
- 0x0e81, 0x0e82,
- 0x0e84, 0x0e84,
- 0x0e87, 0x0e88,
- 0x0e8a, 0x0e8a,
- 0x0e8d, 0x0e8d,
- 0x0e94, 0x0e97,
- 0x0e99, 0x0e9f,
- 0x0ea1, 0x0ea3,
- 0x0ea5, 0x0ea5,
- 0x0ea7, 0x0ea7,
- 0x0eaa, 0x0eab,
- 0x0ead, 0x0eb9,
- 0x0ebb, 0x0ebd,
- 0x0ec0, 0x0ec4,
- 0x0ec6, 0x0ec6,
- 0x0ec8, 0x0ecd,
- 0x0ed0, 0x0ed9,
- 0x0edc, 0x0edd,
- 0x0f00, 0x0f47,
- 0x0f49, 0x0f6a,
- 0x0f71, 0x0f8b,
- 0x0f90, 0x0f97,
- 0x0f99, 0x0fbc,
- 0x0fbe, 0x0fcc,
- 0x0fcf, 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,
- 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, 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,
- 0x200b, 0x2027,
- 0x202a, 0x202e,
- 0x2030, 0x205e,
- 0x2060, 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,
- 0x3001, 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,
- 0xe000, 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,
- 0xfdf0, 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, 0xfffd,
- 0x10000, 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,
- 0x20000, 0x2a6d6,
- 0x2f800, 0x2fa1d,
- 0xe0001, 0xe0001,
- 0xe0020, 0xe007f,
- 0xe0100, 0xe01ef,
- 0xf0000, 0xffffd,
- 0x100000, 0x10fffd
-}; /* CR_Graph */
-
-/* 'Lower': [[:Lower:]] */
-static const OnigCodePoint CR_Lower[] = {
- 480,
- 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,
- 0x0250, 0x02af,
- 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, 0x04ce,
- 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,
- 0x0501, 0x0501,
- 0x0503, 0x0503,
- 0x0505, 0x0505,
- 0x0507, 0x0507,
- 0x0509, 0x0509,
- 0x050b, 0x050b,
- 0x050d, 0x050d,
- 0x050f, 0x050f,
- 0x0561, 0x0587,
- 0x1d00, 0x1d2b,
- 0x1d62, 0x1d77,
- 0x1d79, 0x1d9a,
- 0x1e01, 0x1e01,
- 0x1e03, 0x1e03,
- 0x1e05, 0x1e05,
- 0x1e07, 0x1e07,
- 0x1e09, 0x1e09,
- 0x1e0b, 0x1e0b,
- 0x1e0d, 0x1e0d,
- 0x1e0f, 0x1e0f,
- 0x1e11, 0x1e11,
- 0x1e13, 0x1e13,
- 0x1e15, 0x1e15,
- 0x1e17, 0x1e17,
- 0x1e19, 0x1e19,
- 0x1e1b, 0x1e1b,
- 0x1e1d, 0x1e1d,
- 0x1e1f, 0x1e1f,
- 0x1e21, 0x1e21,
- 0x1e23, 0x1e23,
- 0x1e25, 0x1e25,
- 0x1e27, 0x1e27,
- 0x1e29, 0x1e29,
- 0x1e2b, 0x1e2b,
- 0x1e2d, 0x1e2d,
- 0x1e2f, 0x1e2f,
- 0x1e31, 0x1e31,
- 0x1e33, 0x1e33,
- 0x1e35, 0x1e35,
- 0x1e37, 0x1e37,
- 0x1e39, 0x1e39,
- 0x1e3b, 0x1e3b,
- 0x1e3d, 0x1e3d,
- 0x1e3f, 0x1e3f,
- 0x1e41, 0x1e41,
- 0x1e43, 0x1e43,
- 0x1e45, 0x1e45,
- 0x1e47, 0x1e47,
- 0x1e49, 0x1e49,
- 0x1e4b, 0x1e4b,
- 0x1e4d, 0x1e4d,
- 0x1e4f, 0x1e4f,
- 0x1e51, 0x1e51,
- 0x1e53, 0x1e53,
- 0x1e55, 0x1e55,
- 0x1e57, 0x1e57,
- 0x1e59, 0x1e59,
- 0x1e5b, 0x1e5b,
- 0x1e5d, 0x1e5d,
- 0x1e5f, 0x1e5f,
- 0x1e61, 0x1e61,
- 0x1e63, 0x1e63,
- 0x1e65, 0x1e65,
- 0x1e67, 0x1e67,
- 0x1e69, 0x1e69,
- 0x1e6b, 0x1e6b,
- 0x1e6d, 0x1e6d,
- 0x1e6f, 0x1e6f,
- 0x1e71, 0x1e71,
- 0x1e73, 0x1e73,
- 0x1e75, 0x1e75,
- 0x1e77, 0x1e77,
- 0x1e79, 0x1e79,
- 0x1e7b, 0x1e7b,
- 0x1e7d, 0x1e7d,
- 0x1e7f, 0x1e7f,
- 0x1e81, 0x1e81,
- 0x1e83, 0x1e83,
- 0x1e85, 0x1e85,
- 0x1e87, 0x1e87,
- 0x1e89, 0x1e89,
- 0x1e8b, 0x1e8b,
- 0x1e8d, 0x1e8d,
- 0x1e8f, 0x1e8f,
- 0x1e91, 0x1e91,
- 0x1e93, 0x1e93,
- 0x1e95, 0x1e9b,
- 0x1ea1, 0x1ea1,
- 0x1ea3, 0x1ea3,
- 0x1ea5, 0x1ea5,
- 0x1ea7, 0x1ea7,
- 0x1ea9, 0x1ea9,
- 0x1eab, 0x1eab,
- 0x1ead, 0x1ead,
- 0x1eaf, 0x1eaf,
- 0x1eb1, 0x1eb1,
- 0x1eb3, 0x1eb3,
- 0x1eb5, 0x1eb5,
- 0x1eb7, 0x1eb7,
- 0x1eb9, 0x1eb9,
- 0x1ebb, 0x1ebb,
- 0x1ebd, 0x1ebd,
- 0x1ebf, 0x1ebf,
- 0x1ec1, 0x1ec1,
- 0x1ec3, 0x1ec3,
- 0x1ec5, 0x1ec5,
- 0x1ec7, 0x1ec7,
- 0x1ec9, 0x1ec9,
- 0x1ecb, 0x1ecb,
- 0x1ecd, 0x1ecd,
- 0x1ecf, 0x1ecf,
- 0x1ed1, 0x1ed1,
- 0x1ed3, 0x1ed3,
- 0x1ed5, 0x1ed5,
- 0x1ed7, 0x1ed7,
- 0x1ed9, 0x1ed9,
- 0x1edb, 0x1edb,
- 0x1edd, 0x1edd,
- 0x1edf, 0x1edf,
- 0x1ee1, 0x1ee1,
- 0x1ee3, 0x1ee3,
- 0x1ee5, 0x1ee5,
- 0x1ee7, 0x1ee7,
- 0x1ee9, 0x1ee9,
- 0x1eeb, 0x1eeb,
- 0x1eed, 0x1eed,
- 0x1eef, 0x1eef,
- 0x1ef1, 0x1ef1,
- 0x1ef3, 0x1ef3,
- 0x1ef5, 0x1ef5,
- 0x1ef7, 0x1ef7,
- 0x1ef9, 0x1ef9,
- 0x1f00, 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,
- 0x210a, 0x210a,
- 0x210e, 0x210f,
- 0x2113, 0x2113,
- 0x212f, 0x212f,
- 0x2134, 0x2134,
- 0x2139, 0x2139,
- 0x213c, 0x213d,
- 0x2146, 0x2149,
- 0x2c30, 0x2c5e,
- 0x2c81, 0x2c81,
- 0x2c83, 0x2c83,
- 0x2c85, 0x2c85,
- 0x2c87, 0x2c87,
- 0x2c89, 0x2c89,
- 0x2c8b, 0x2c8b,
- 0x2c8d, 0x2c8d,
- 0x2c8f, 0x2c8f,
- 0x2c91, 0x2c91,
- 0x2c93, 0x2c93,
- 0x2c95, 0x2c95,
- 0x2c97, 0x2c97,
- 0x2c99, 0x2c99,
- 0x2c9b, 0x2c9b,
- 0x2c9d, 0x2c9d,
- 0x2c9f, 0x2c9f,
- 0x2ca1, 0x2ca1,
- 0x2ca3, 0x2ca3,
- 0x2ca5, 0x2ca5,
- 0x2ca7, 0x2ca7,
- 0x2ca9, 0x2ca9,
- 0x2cab, 0x2cab,
- 0x2cad, 0x2cad,
- 0x2caf, 0x2caf,
- 0x2cb1, 0x2cb1,
- 0x2cb3, 0x2cb3,
- 0x2cb5, 0x2cb5,
- 0x2cb7, 0x2cb7,
- 0x2cb9, 0x2cb9,
- 0x2cbb, 0x2cbb,
- 0x2cbd, 0x2cbd,
- 0x2cbf, 0x2cbf,
- 0x2cc1, 0x2cc1,
- 0x2cc3, 0x2cc3,
- 0x2cc5, 0x2cc5,
- 0x2cc7, 0x2cc7,
- 0x2cc9, 0x2cc9,
- 0x2ccb, 0x2ccb,
- 0x2ccd, 0x2ccd,
- 0x2ccf, 0x2ccf,
- 0x2cd1, 0x2cd1,
- 0x2cd3, 0x2cd3,
- 0x2cd5, 0x2cd5,
- 0x2cd7, 0x2cd7,
- 0x2cd9, 0x2cd9,
- 0x2cdb, 0x2cdb,
- 0x2cdd, 0x2cdd,
- 0x2cdf, 0x2cdf,
- 0x2ce1, 0x2ce1,
- 0x2ce3, 0x2ce4,
- 0x2d00, 0x2d25,
- 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
-}; /* CR_Lower */
-
-/* 'Print': [[:Print:]] */
-static const OnigCodePoint CR_Print[] = {
- 423,
- 0x0009, 0x000d,
- 0x0020, 0x007e,
- 0x0085, 0x0085,
- 0x00a0, 0x0241,
- 0x0250, 0x036f,
- 0x0374, 0x0375,
- 0x037a, 0x037a,
- 0x037e, 0x037e,
- 0x0384, 0x038a,
- 0x038c, 0x038c,
- 0x038e, 0x03a1,
- 0x03a3, 0x03ce,
- 0x03d0, 0x0486,
- 0x0488, 0x04ce,
- 0x04d0, 0x04f9,
- 0x0500, 0x050f,
- 0x0531, 0x0556,
- 0x0559, 0x055f,
- 0x0561, 0x0587,
- 0x0589, 0x058a,
- 0x0591, 0x05b9,
- 0x05bb, 0x05c7,
- 0x05d0, 0x05ea,
- 0x05f0, 0x05f4,
- 0x0600, 0x0603,
- 0x060b, 0x0615,
- 0x061b, 0x061b,
- 0x061e, 0x061f,
- 0x0621, 0x063a,
- 0x0640, 0x065e,
- 0x0660, 0x070d,
- 0x070f, 0x074a,
- 0x074d, 0x076d,
- 0x0780, 0x07b1,
- 0x0901, 0x0939,
- 0x093c, 0x094d,
- 0x0950, 0x0954,
- 0x0958, 0x0970,
- 0x097d, 0x097d,
- 0x0981, 0x0983,
- 0x0985, 0x098c,
- 0x098f, 0x0990,
- 0x0993, 0x09a8,
- 0x09aa, 0x09b0,
- 0x09b2, 0x09b2,
- 0x09b6, 0x09b9,
- 0x09bc, 0x09c4,
- 0x09c7, 0x09c8,
- 0x09cb, 0x09ce,
- 0x09d7, 0x09d7,
- 0x09dc, 0x09dd,
- 0x09df, 0x09e3,
- 0x09e6, 0x09fa,
- 0x0a01, 0x0a03,
- 0x0a05, 0x0a0a,
- 0x0a0f, 0x0a10,
- 0x0a13, 0x0a28,
- 0x0a2a, 0x0a30,
- 0x0a32, 0x0a33,
- 0x0a35, 0x0a36,
- 0x0a38, 0x0a39,
- 0x0a3c, 0x0a3c,
- 0x0a3e, 0x0a42,
- 0x0a47, 0x0a48,
- 0x0a4b, 0x0a4d,
- 0x0a59, 0x0a5c,
- 0x0a5e, 0x0a5e,
- 0x0a66, 0x0a74,
- 0x0a81, 0x0a83,
- 0x0a85, 0x0a8d,
- 0x0a8f, 0x0a91,
- 0x0a93, 0x0aa8,
- 0x0aaa, 0x0ab0,
- 0x0ab2, 0x0ab3,
- 0x0ab5, 0x0ab9,
- 0x0abc, 0x0ac5,
- 0x0ac7, 0x0ac9,
- 0x0acb, 0x0acd,
- 0x0ad0, 0x0ad0,
- 0x0ae0, 0x0ae3,
- 0x0ae6, 0x0aef,
- 0x0af1, 0x0af1,
- 0x0b01, 0x0b03,
- 0x0b05, 0x0b0c,
- 0x0b0f, 0x0b10,
- 0x0b13, 0x0b28,
- 0x0b2a, 0x0b30,
- 0x0b32, 0x0b33,
- 0x0b35, 0x0b39,
- 0x0b3c, 0x0b43,
- 0x0b47, 0x0b48,
- 0x0b4b, 0x0b4d,
- 0x0b56, 0x0b57,
- 0x0b5c, 0x0b5d,
- 0x0b5f, 0x0b61,
- 0x0b66, 0x0b71,
- 0x0b82, 0x0b83,
- 0x0b85, 0x0b8a,
- 0x0b8e, 0x0b90,
- 0x0b92, 0x0b95,
- 0x0b99, 0x0b9a,
- 0x0b9c, 0x0b9c,
- 0x0b9e, 0x0b9f,
- 0x0ba3, 0x0ba4,
- 0x0ba8, 0x0baa,
- 0x0bae, 0x0bb9,
- 0x0bbe, 0x0bc2,
- 0x0bc6, 0x0bc8,
- 0x0bca, 0x0bcd,
- 0x0bd7, 0x0bd7,
- 0x0be6, 0x0bfa,
- 0x0c01, 0x0c03,
- 0x0c05, 0x0c0c,
- 0x0c0e, 0x0c10,
- 0x0c12, 0x0c28,
- 0x0c2a, 0x0c33,
- 0x0c35, 0x0c39,
- 0x0c3e, 0x0c44,
- 0x0c46, 0x0c48,
- 0x0c4a, 0x0c4d,
- 0x0c55, 0x0c56,
- 0x0c60, 0x0c61,
- 0x0c66, 0x0c6f,
- 0x0c82, 0x0c83,
- 0x0c85, 0x0c8c,
- 0x0c8e, 0x0c90,
- 0x0c92, 0x0ca8,
- 0x0caa, 0x0cb3,
- 0x0cb5, 0x0cb9,
- 0x0cbc, 0x0cc4,
- 0x0cc6, 0x0cc8,
- 0x0cca, 0x0ccd,
- 0x0cd5, 0x0cd6,
- 0x0cde, 0x0cde,
- 0x0ce0, 0x0ce1,
- 0x0ce6, 0x0cef,
- 0x0d02, 0x0d03,
- 0x0d05, 0x0d0c,
- 0x0d0e, 0x0d10,
- 0x0d12, 0x0d28,
- 0x0d2a, 0x0d39,
- 0x0d3e, 0x0d43,
- 0x0d46, 0x0d48,
- 0x0d4a, 0x0d4d,
- 0x0d57, 0x0d57,
- 0x0d60, 0x0d61,
- 0x0d66, 0x0d6f,
- 0x0d82, 0x0d83,
- 0x0d85, 0x0d96,
- 0x0d9a, 0x0db1,
- 0x0db3, 0x0dbb,
- 0x0dbd, 0x0dbd,
- 0x0dc0, 0x0dc6,
- 0x0dca, 0x0dca,
- 0x0dcf, 0x0dd4,
- 0x0dd6, 0x0dd6,
- 0x0dd8, 0x0ddf,
- 0x0df2, 0x0df4,
- 0x0e01, 0x0e3a,
- 0x0e3f, 0x0e5b,
- 0x0e81, 0x0e82,
- 0x0e84, 0x0e84,
- 0x0e87, 0x0e88,
- 0x0e8a, 0x0e8a,
- 0x0e8d, 0x0e8d,
- 0x0e94, 0x0e97,
- 0x0e99, 0x0e9f,
- 0x0ea1, 0x0ea3,
- 0x0ea5, 0x0ea5,
- 0x0ea7, 0x0ea7,
- 0x0eaa, 0x0eab,
- 0x0ead, 0x0eb9,
- 0x0ebb, 0x0ebd,
- 0x0ec0, 0x0ec4,
- 0x0ec6, 0x0ec6,
- 0x0ec8, 0x0ecd,
- 0x0ed0, 0x0ed9,
- 0x0edc, 0x0edd,
- 0x0f00, 0x0f47,
- 0x0f49, 0x0f6a,
- 0x0f71, 0x0f8b,
- 0x0f90, 0x0f97,
- 0x0f99, 0x0fbc,
- 0x0fbe, 0x0fcc,
- 0x0fcf, 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,
- 0xe000, 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,
- 0xfdf0, 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, 0xfffd,
- 0x10000, 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,
- 0x20000, 0x2a6d6,
- 0x2f800, 0x2fa1d,
- 0xe0001, 0xe0001,
- 0xe0020, 0xe007f,
- 0xe0100, 0xe01ef,
- 0xf0000, 0xffffd,
- 0x100000, 0x10fffd
-}; /* CR_Print */
-
-/* 'Punct': [[:Punct:]] */
-static const OnigCodePoint CR_Punct[] = {
- 96,
- 0x0021, 0x0023,
- 0x0025, 0x002a,
- 0x002c, 0x002f,
- 0x003a, 0x003b,
- 0x003f, 0x0040,
- 0x005b, 0x005d,
- 0x005f, 0x005f,
- 0x007b, 0x007b,
- 0x007d, 0x007d,
- 0x00a1, 0x00a1,
- 0x00ab, 0x00ab,
- 0x00b7, 0x00b7,
- 0x00bb, 0x00bb,
- 0x00bf, 0x00bf,
- 0x037e, 0x037e,
- 0x0387, 0x0387,
- 0x055a, 0x055f,
- 0x0589, 0x058a,
- 0x05be, 0x05be,
- 0x05c0, 0x05c0,
- 0x05c3, 0x05c3,
- 0x05c6, 0x05c6,
- 0x05f3, 0x05f4,
- 0x060c, 0x060d,
- 0x061b, 0x061b,
- 0x061e, 0x061f,
- 0x066a, 0x066d,
- 0x06d4, 0x06d4,
- 0x0700, 0x070d,
- 0x0964, 0x0965,
- 0x0970, 0x0970,
- 0x0df4, 0x0df4,
- 0x0e4f, 0x0e4f,
- 0x0e5a, 0x0e5b,
- 0x0f04, 0x0f12,
- 0x0f3a, 0x0f3d,
- 0x0f85, 0x0f85,
- 0x0fd0, 0x0fd1,
- 0x104a, 0x104f,
- 0x10fb, 0x10fb,
- 0x1361, 0x1368,
- 0x166d, 0x166e,
- 0x169b, 0x169c,
- 0x16eb, 0x16ed,
- 0x1735, 0x1736,
- 0x17d4, 0x17d6,
- 0x17d8, 0x17da,
- 0x1800, 0x180a,
- 0x1944, 0x1945,
- 0x19de, 0x19df,
- 0x1a1e, 0x1a1f,
- 0x2010, 0x2027,
- 0x2030, 0x2043,
- 0x2045, 0x2051,
- 0x2053, 0x205e,
- 0x207d, 0x207e,
- 0x208d, 0x208e,
- 0x2329, 0x232a,
- 0x23b4, 0x23b6,
- 0x2768, 0x2775,
- 0x27c5, 0x27c6,
- 0x27e6, 0x27eb,
- 0x2983, 0x2998,
- 0x29d8, 0x29db,
- 0x29fc, 0x29fd,
- 0x2cf9, 0x2cfc,
- 0x2cfe, 0x2cff,
- 0x2e00, 0x2e17,
- 0x2e1c, 0x2e1d,
- 0x3001, 0x3003,
- 0x3008, 0x3011,
- 0x3014, 0x301f,
- 0x3030, 0x3030,
- 0x303d, 0x303d,
- 0x30a0, 0x30a0,
- 0x30fb, 0x30fb,
- 0xfd3e, 0xfd3f,
- 0xfe10, 0xfe19,
- 0xfe30, 0xfe52,
- 0xfe54, 0xfe61,
- 0xfe63, 0xfe63,
- 0xfe68, 0xfe68,
- 0xfe6a, 0xfe6b,
- 0xff01, 0xff03,
- 0xff05, 0xff0a,
- 0xff0c, 0xff0f,
- 0xff1a, 0xff1b,
- 0xff1f, 0xff20,
- 0xff3b, 0xff3d,
- 0xff3f, 0xff3f,
- 0xff5b, 0xff5b,
- 0xff5d, 0xff5d,
- 0xff5f, 0xff65,
- 0x10100, 0x10101,
- 0x1039f, 0x1039f,
- 0x10a50, 0x10a58
-}; /* 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[] = {
- 476,
- 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,
- 0x0386, 0x0386,
- 0x0388, 0x038a,
- 0x038c, 0x038c,
- 0x038e, 0x038f,
- 0x0391, 0x03a1,
- 0x03a3, 0x03ab,
- 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,
- 0x0500, 0x0500,
- 0x0502, 0x0502,
- 0x0504, 0x0504,
- 0x0506, 0x0506,
- 0x0508, 0x0508,
- 0x050a, 0x050a,
- 0x050c, 0x050c,
- 0x050e, 0x050e,
- 0x0531, 0x0556,
- 0x10a0, 0x10c5,
- 0x1e00, 0x1e00,
- 0x1e02, 0x1e02,
- 0x1e04, 0x1e04,
- 0x1e06, 0x1e06,
- 0x1e08, 0x1e08,
- 0x1e0a, 0x1e0a,
- 0x1e0c, 0x1e0c,
- 0x1e0e, 0x1e0e,
- 0x1e10, 0x1e10,
- 0x1e12, 0x1e12,
- 0x1e14, 0x1e14,
- 0x1e16, 0x1e16,
- 0x1e18, 0x1e18,
- 0x1e1a, 0x1e1a,
- 0x1e1c, 0x1e1c,
- 0x1e1e, 0x1e1e,
- 0x1e20, 0x1e20,
- 0x1e22, 0x1e22,
- 0x1e24, 0x1e24,
- 0x1e26, 0x1e26,
- 0x1e28, 0x1e28,
- 0x1e2a, 0x1e2a,
- 0x1e2c, 0x1e2c,
- 0x1e2e, 0x1e2e,
- 0x1e30, 0x1e30,
- 0x1e32, 0x1e32,
- 0x1e34, 0x1e34,
- 0x1e36, 0x1e36,
- 0x1e38, 0x1e38,
- 0x1e3a, 0x1e3a,
- 0x1e3c, 0x1e3c,
- 0x1e3e, 0x1e3e,
- 0x1e40, 0x1e40,
- 0x1e42, 0x1e42,
- 0x1e44, 0x1e44,
- 0x1e46, 0x1e46,
- 0x1e48, 0x1e48,
- 0x1e4a, 0x1e4a,
- 0x1e4c, 0x1e4c,
- 0x1e4e, 0x1e4e,
- 0x1e50, 0x1e50,
- 0x1e52, 0x1e52,
- 0x1e54, 0x1e54,
- 0x1e56, 0x1e56,
- 0x1e58, 0x1e58,
- 0x1e5a, 0x1e5a,
- 0x1e5c, 0x1e5c,
- 0x1e5e, 0x1e5e,
- 0x1e60, 0x1e60,
- 0x1e62, 0x1e62,
- 0x1e64, 0x1e64,
- 0x1e66, 0x1e66,
- 0x1e68, 0x1e68,
- 0x1e6a, 0x1e6a,
- 0x1e6c, 0x1e6c,
- 0x1e6e, 0x1e6e,
- 0x1e70, 0x1e70,
- 0x1e72, 0x1e72,
- 0x1e74, 0x1e74,
- 0x1e76, 0x1e76,
- 0x1e78, 0x1e78,
- 0x1e7a, 0x1e7a,
- 0x1e7c, 0x1e7c,
- 0x1e7e, 0x1e7e,
- 0x1e80, 0x1e80,
- 0x1e82, 0x1e82,
- 0x1e84, 0x1e84,
- 0x1e86, 0x1e86,
- 0x1e88, 0x1e88,
- 0x1e8a, 0x1e8a,
- 0x1e8c, 0x1e8c,
- 0x1e8e, 0x1e8e,
- 0x1e90, 0x1e90,
- 0x1e92, 0x1e92,
- 0x1e94, 0x1e94,
- 0x1ea0, 0x1ea0,
- 0x1ea2, 0x1ea2,
- 0x1ea4, 0x1ea4,
- 0x1ea6, 0x1ea6,
- 0x1ea8, 0x1ea8,
- 0x1eaa, 0x1eaa,
- 0x1eac, 0x1eac,
- 0x1eae, 0x1eae,
- 0x1eb0, 0x1eb0,
- 0x1eb2, 0x1eb2,
- 0x1eb4, 0x1eb4,
- 0x1eb6, 0x1eb6,
- 0x1eb8, 0x1eb8,
- 0x1eba, 0x1eba,
- 0x1ebc, 0x1ebc,
- 0x1ebe, 0x1ebe,
- 0x1ec0, 0x1ec0,
- 0x1ec2, 0x1ec2,
- 0x1ec4, 0x1ec4,
- 0x1ec6, 0x1ec6,
- 0x1ec8, 0x1ec8,
- 0x1eca, 0x1eca,
- 0x1ecc, 0x1ecc,
- 0x1ece, 0x1ece,
- 0x1ed0, 0x1ed0,
- 0x1ed2, 0x1ed2,
- 0x1ed4, 0x1ed4,
- 0x1ed6, 0x1ed6,
- 0x1ed8, 0x1ed8,
- 0x1eda, 0x1eda,
- 0x1edc, 0x1edc,
- 0x1ede, 0x1ede,
- 0x1ee0, 0x1ee0,
- 0x1ee2, 0x1ee2,
- 0x1ee4, 0x1ee4,
- 0x1ee6, 0x1ee6,
- 0x1ee8, 0x1ee8,
- 0x1eea, 0x1eea,
- 0x1eec, 0x1eec,
- 0x1eee, 0x1eee,
- 0x1ef0, 0x1ef0,
- 0x1ef2, 0x1ef2,
- 0x1ef4, 0x1ef4,
- 0x1ef6, 0x1ef6,
- 0x1ef8, 0x1ef8,
- 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, 0x2131,
- 0x2133, 0x2133,
- 0x213e, 0x213f,
- 0x2145, 0x2145,
- 0x2c00, 0x2c2e,
- 0x2c80, 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,
- 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
-}; /* 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[] = {
- 464,
- 0x0030, 0x0039,
- 0x0041, 0x005a,
- 0x005f, 0x005f,
- 0x0061, 0x007a,
- 0x00aa, 0x00aa,
- 0x00b2, 0x00b3,
- 0x00b5, 0x00b5,
- 0x00b9, 0x00ba,
- 0x00bc, 0x00be,
- 0x00c0, 0x00d6,
- 0x00d8, 0x00f6,
- 0x00f8, 0x0241,
- 0x0250, 0x02c1,
- 0x02c6, 0x02d1,
- 0x02e0, 0x02e4,
- 0x02ee, 0x02ee,
- 0x0300, 0x036f,
- 0x037a, 0x037a,
- 0x0386, 0x0386,
- 0x0388, 0x038a,
- 0x038c, 0x038c,
- 0x038e, 0x03a1,
- 0x03a3, 0x03ce,
- 0x03d0, 0x03f5,
- 0x03f7, 0x0481,
- 0x0483, 0x0486,
- 0x0488, 0x04ce,
- 0x04d0, 0x04f9,
- 0x0500, 0x050f,
- 0x0531, 0x0556,
- 0x0559, 0x0559,
- 0x0561, 0x0587,
- 0x0591, 0x05b9,
- 0x05bb, 0x05bd,
- 0x05bf, 0x05bf,
- 0x05c1, 0x05c2,
- 0x05c4, 0x05c5,
- 0x05c7, 0x05c7,
- 0x05d0, 0x05ea,
- 0x05f0, 0x05f2,
- 0x0610, 0x0615,
- 0x0621, 0x063a,
- 0x0640, 0x065e,
- 0x0660, 0x0669,
- 0x066e, 0x06d3,
- 0x06d5, 0x06dc,
- 0x06de, 0x06e8,
- 0x06ea, 0x06fc,
- 0x06ff, 0x06ff,
- 0x0710, 0x074a,
- 0x074d, 0x076d,
- 0x0780, 0x07b1,
- 0x0901, 0x0939,
- 0x093c, 0x094d,
- 0x0950, 0x0954,
- 0x0958, 0x0963,
- 0x0966, 0x096f,
- 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, 0x09f1,
- 0x09f4, 0x09f9,
- 0x0a01, 0x0a03,
- 0x0a05, 0x0a0a,
- 0x0a0f, 0x0a10,
- 0x0a13, 0x0a28,
- 0x0a2a, 0x0a30,
- 0x0a32, 0x0a33,
- 0x0a35, 0x0a36,
- 0x0a38, 0x0a39,
- 0x0a3c, 0x0a3c,
- 0x0a3e, 0x0a42,
- 0x0a47, 0x0a48,
- 0x0a4b, 0x0a4d,
- 0x0a59, 0x0a5c,
- 0x0a5e, 0x0a5e,
- 0x0a66, 0x0a74,
- 0x0a81, 0x0a83,
- 0x0a85, 0x0a8d,
- 0x0a8f, 0x0a91,
- 0x0a93, 0x0aa8,
- 0x0aaa, 0x0ab0,
- 0x0ab2, 0x0ab3,
- 0x0ab5, 0x0ab9,
- 0x0abc, 0x0ac5,
- 0x0ac7, 0x0ac9,
- 0x0acb, 0x0acd,
- 0x0ad0, 0x0ad0,
- 0x0ae0, 0x0ae3,
- 0x0ae6, 0x0aef,
- 0x0b01, 0x0b03,
- 0x0b05, 0x0b0c,
- 0x0b0f, 0x0b10,
- 0x0b13, 0x0b28,
- 0x0b2a, 0x0b30,
- 0x0b32, 0x0b33,
- 0x0b35, 0x0b39,
- 0x0b3c, 0x0b43,
- 0x0b47, 0x0b48,
- 0x0b4b, 0x0b4d,
- 0x0b56, 0x0b57,
- 0x0b5c, 0x0b5d,
- 0x0b5f, 0x0b61,
- 0x0b66, 0x0b6f,
- 0x0b71, 0x0b71,
- 0x0b82, 0x0b83,
- 0x0b85, 0x0b8a,
- 0x0b8e, 0x0b90,
- 0x0b92, 0x0b95,
- 0x0b99, 0x0b9a,
- 0x0b9c, 0x0b9c,
- 0x0b9e, 0x0b9f,
- 0x0ba3, 0x0ba4,
- 0x0ba8, 0x0baa,
- 0x0bae, 0x0bb9,
- 0x0bbe, 0x0bc2,
- 0x0bc6, 0x0bc8,
- 0x0bca, 0x0bcd,
- 0x0bd7, 0x0bd7,
- 0x0be6, 0x0bf2,
- 0x0c01, 0x0c03,
- 0x0c05, 0x0c0c,
- 0x0c0e, 0x0c10,
- 0x0c12, 0x0c28,
- 0x0c2a, 0x0c33,
- 0x0c35, 0x0c39,
- 0x0c3e, 0x0c44,
- 0x0c46, 0x0c48,
- 0x0c4a, 0x0c4d,
- 0x0c55, 0x0c56,
- 0x0c60, 0x0c61,
- 0x0c66, 0x0c6f,
- 0x0c82, 0x0c83,
- 0x0c85, 0x0c8c,
- 0x0c8e, 0x0c90,
- 0x0c92, 0x0ca8,
- 0x0caa, 0x0cb3,
- 0x0cb5, 0x0cb9,
- 0x0cbc, 0x0cc4,
- 0x0cc6, 0x0cc8,
- 0x0cca, 0x0ccd,
- 0x0cd5, 0x0cd6,
- 0x0cde, 0x0cde,
- 0x0ce0, 0x0ce1,
- 0x0ce6, 0x0cef,
- 0x0d02, 0x0d03,
- 0x0d05, 0x0d0c,
- 0x0d0e, 0x0d10,
- 0x0d12, 0x0d28,
- 0x0d2a, 0x0d39,
- 0x0d3e, 0x0d43,
- 0x0d46, 0x0d48,
- 0x0d4a, 0x0d4d,
- 0x0d57, 0x0d57,
- 0x0d60, 0x0d61,
- 0x0d66, 0x0d6f,
- 0x0d82, 0x0d83,
- 0x0d85, 0x0d96,
- 0x0d9a, 0x0db1,
- 0x0db3, 0x0dbb,
- 0x0dbd, 0x0dbd,
- 0x0dc0, 0x0dc6,
- 0x0dca, 0x0dca,
- 0x0dcf, 0x0dd4,
- 0x0dd6, 0x0dd6,
- 0x0dd8, 0x0ddf,
- 0x0df2, 0x0df3,
- 0x0e01, 0x0e3a,
- 0x0e40, 0x0e4e,
- 0x0e50, 0x0e59,
- 0x0e81, 0x0e82,
- 0x0e84, 0x0e84,
- 0x0e87, 0x0e88,
- 0x0e8a, 0x0e8a,
- 0x0e8d, 0x0e8d,
- 0x0e94, 0x0e97,
- 0x0e99, 0x0e9f,
- 0x0ea1, 0x0ea3,
- 0x0ea5, 0x0ea5,
- 0x0ea7, 0x0ea7,
- 0x0eaa, 0x0eab,
- 0x0ead, 0x0eb9,
- 0x0ebb, 0x0ebd,
- 0x0ec0, 0x0ec4,
- 0x0ec6, 0x0ec6,
- 0x0ec8, 0x0ecd,
- 0x0ed0, 0x0ed9,
- 0x0edc, 0x0edd,
- 0x0f00, 0x0f00,
- 0x0f18, 0x0f19,
- 0x0f20, 0x0f33,
- 0x0f35, 0x0f35,
- 0x0f37, 0x0f37,
- 0x0f39, 0x0f39,
- 0x0f3e, 0x0f47,
- 0x0f49, 0x0f6a,
- 0x0f71, 0x0f84,
- 0x0f86, 0x0f8b,
- 0x0f90, 0x0f97,
- 0x0f99, 0x0fbc,
- 0x0fc6, 0x0fc6,
- 0x1000, 0x1021,
- 0x1023, 0x1027,
- 0x1029, 0x102a,
- 0x102c, 0x1032,
- 0x1036, 0x1039,
- 0x1040, 0x1049,
- 0x1050, 0x1059,
- 0x10a0, 0x10c5,
- 0x10d0, 0x10fa,
- 0x10fc, 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, 0x135f,
- 0x1369, 0x137c,
- 0x1380, 0x138f,
- 0x13a0, 0x13f4,
- 0x1401, 0x166c,
- 0x166f, 0x1676,
- 0x1681, 0x169a,
- 0x16a0, 0x16ea,
- 0x16ee, 0x16f0,
- 0x1700, 0x170c,
- 0x170e, 0x1714,
- 0x1720, 0x1734,
- 0x1740, 0x1753,
- 0x1760, 0x176c,
- 0x176e, 0x1770,
- 0x1772, 0x1773,
- 0x1780, 0x17b3,
- 0x17b6, 0x17d3,
- 0x17d7, 0x17d7,
- 0x17dc, 0x17dd,
- 0x17e0, 0x17e9,
- 0x17f0, 0x17f9,
- 0x180b, 0x180d,
- 0x1810, 0x1819,
- 0x1820, 0x1877,
- 0x1880, 0x18a9,
- 0x1900, 0x191c,
- 0x1920, 0x192b,
- 0x1930, 0x193b,
- 0x1946, 0x196d,
- 0x1970, 0x1974,
- 0x1980, 0x19a9,
- 0x19b0, 0x19c9,
- 0x19d0, 0x19d9,
- 0x1a00, 0x1a1b,
- 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, 0x1fbc,
- 0x1fbe, 0x1fbe,
- 0x1fc2, 0x1fc4,
- 0x1fc6, 0x1fcc,
- 0x1fd0, 0x1fd3,
- 0x1fd6, 0x1fdb,
- 0x1fe0, 0x1fec,
- 0x1ff2, 0x1ff4,
- 0x1ff6, 0x1ffc,
- 0x203f, 0x2040,
- 0x2054, 0x2054,
- 0x2070, 0x2071,
- 0x2074, 0x2079,
- 0x207f, 0x2089,
- 0x2090, 0x2094,
- 0x20d0, 0x20eb,
- 0x2102, 0x2102,
- 0x2107, 0x2107,
- 0x210a, 0x2113,
- 0x2115, 0x2115,
- 0x2119, 0x211d,
- 0x2124, 0x2124,
- 0x2126, 0x2126,
- 0x2128, 0x2128,
- 0x212a, 0x212d,
- 0x212f, 0x2131,
- 0x2133, 0x2139,
- 0x213c, 0x213f,
- 0x2145, 0x2149,
- 0x2153, 0x2183,
- 0x2460, 0x249b,
- 0x24ea, 0x24ff,
- 0x2776, 0x2793,
- 0x2c00, 0x2c2e,
- 0x2c30, 0x2c5e,
- 0x2c80, 0x2ce4,
- 0x2cfd, 0x2cfd,
- 0x2d00, 0x2d25,
- 0x2d30, 0x2d65,
- 0x2d6f, 0x2d6f,
- 0x2d80, 0x2d96,
- 0x2da0, 0x2da6,
- 0x2da8, 0x2dae,
- 0x2db0, 0x2db6,
- 0x2db8, 0x2dbe,
- 0x2dc0, 0x2dc6,
- 0x2dc8, 0x2dce,
- 0x2dd0, 0x2dd6,
- 0x2dd8, 0x2dde,
- 0x3005, 0x3007,
- 0x3021, 0x302f,
- 0x3031, 0x3035,
- 0x3038, 0x303c,
- 0x3041, 0x3096,
- 0x3099, 0x309a,
- 0x309d, 0x309f,
- 0x30a1, 0x30fa,
- 0x30fc, 0x30ff,
- 0x3105, 0x312c,
- 0x3131, 0x318e,
- 0x3192, 0x3195,
- 0x31a0, 0x31b7,
- 0x31f0, 0x31ff,
- 0x3220, 0x3229,
- 0x3251, 0x325f,
- 0x3280, 0x3289,
- 0x32b1, 0x32bf,
- 0x3400, 0x4db5,
- 0x4e00, 0x9fbb,
- 0xa000, 0xa48c,
- 0xa800, 0xa827,
- 0xac00, 0xd7a3,
- 0xf900, 0xfa2d,
- 0xfa30, 0xfa6a,
- 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, 0xfe23,
- 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,
- 0x10107, 0x10133,
- 0x10140, 0x10178,
- 0x1018a, 0x1018a,
- 0x10300, 0x1031e,
- 0x10320, 0x10323,
- 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, 0x1083f,
- 0x10a00, 0x10a03,
- 0x10a05, 0x10a06,
- 0x10a0c, 0x10a13,
- 0x10a15, 0x10a17,
- 0x10a19, 0x10a33,
- 0x10a38, 0x10a3a,
- 0x10a3f, 0x10a47,
- 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, 0x1d7c9,
- 0x1d7ce, 0x1d7ff,
- 0x20000, 0x2a6d6,
- 0x2f800, 0x2fa1d,
- 0xe0100, 0xe01ef
-}; /* CR_Word */
-
-/* 'Alnum': [[:Alnum:]] */
-static const OnigCodePoint CR_Alnum[] = {
- 436,
- 0x0030, 0x0039,
- 0x0041, 0x005a,
- 0x0061, 0x007a,
- 0x00aa, 0x00aa,
- 0x00b5, 0x00b5,
- 0x00ba, 0x00ba,
- 0x00c0, 0x00d6,
- 0x00d8, 0x00f6,
- 0x00f8, 0x0241,
- 0x0250, 0x02c1,
- 0x02c6, 0x02d1,
- 0x02e0, 0x02e4,
- 0x02ee, 0x02ee,
- 0x0300, 0x036f,
- 0x037a, 0x037a,
- 0x0386, 0x0386,
- 0x0388, 0x038a,
- 0x038c, 0x038c,
- 0x038e, 0x03a1,
- 0x03a3, 0x03ce,
- 0x03d0, 0x03f5,
- 0x03f7, 0x0481,
- 0x0483, 0x0486,
- 0x0488, 0x04ce,
- 0x04d0, 0x04f9,
- 0x0500, 0x050f,
- 0x0531, 0x0556,
- 0x0559, 0x0559,
- 0x0561, 0x0587,
- 0x0591, 0x05b9,
- 0x05bb, 0x05bd,
- 0x05bf, 0x05bf,
- 0x05c1, 0x05c2,
- 0x05c4, 0x05c5,
- 0x05c7, 0x05c7,
- 0x05d0, 0x05ea,
- 0x05f0, 0x05f2,
- 0x0610, 0x0615,
- 0x0621, 0x063a,
- 0x0640, 0x065e,
- 0x0660, 0x0669,
- 0x066e, 0x06d3,
- 0x06d5, 0x06dc,
- 0x06de, 0x06e8,
- 0x06ea, 0x06fc,
- 0x06ff, 0x06ff,
- 0x0710, 0x074a,
- 0x074d, 0x076d,
- 0x0780, 0x07b1,
- 0x0901, 0x0939,
- 0x093c, 0x094d,
- 0x0950, 0x0954,
- 0x0958, 0x0963,
- 0x0966, 0x096f,
- 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, 0x09f1,
- 0x0a01, 0x0a03,
- 0x0a05, 0x0a0a,
- 0x0a0f, 0x0a10,
- 0x0a13, 0x0a28,
- 0x0a2a, 0x0a30,
- 0x0a32, 0x0a33,
- 0x0a35, 0x0a36,
- 0x0a38, 0x0a39,
- 0x0a3c, 0x0a3c,
- 0x0a3e, 0x0a42,
- 0x0a47, 0x0a48,
- 0x0a4b, 0x0a4d,
- 0x0a59, 0x0a5c,
- 0x0a5e, 0x0a5e,
- 0x0a66, 0x0a74,
- 0x0a81, 0x0a83,
- 0x0a85, 0x0a8d,
- 0x0a8f, 0x0a91,
- 0x0a93, 0x0aa8,
- 0x0aaa, 0x0ab0,
- 0x0ab2, 0x0ab3,
- 0x0ab5, 0x0ab9,
- 0x0abc, 0x0ac5,
- 0x0ac7, 0x0ac9,
- 0x0acb, 0x0acd,
- 0x0ad0, 0x0ad0,
- 0x0ae0, 0x0ae3,
- 0x0ae6, 0x0aef,
- 0x0b01, 0x0b03,
- 0x0b05, 0x0b0c,
- 0x0b0f, 0x0b10,
- 0x0b13, 0x0b28,
- 0x0b2a, 0x0b30,
- 0x0b32, 0x0b33,
- 0x0b35, 0x0b39,
- 0x0b3c, 0x0b43,
- 0x0b47, 0x0b48,
- 0x0b4b, 0x0b4d,
- 0x0b56, 0x0b57,
- 0x0b5c, 0x0b5d,
- 0x0b5f, 0x0b61,
- 0x0b66, 0x0b6f,
- 0x0b71, 0x0b71,
- 0x0b82, 0x0b83,
- 0x0b85, 0x0b8a,
- 0x0b8e, 0x0b90,
- 0x0b92, 0x0b95,
- 0x0b99, 0x0b9a,
- 0x0b9c, 0x0b9c,
- 0x0b9e, 0x0b9f,
- 0x0ba3, 0x0ba4,
- 0x0ba8, 0x0baa,
- 0x0bae, 0x0bb9,
- 0x0bbe, 0x0bc2,
- 0x0bc6, 0x0bc8,
- 0x0bca, 0x0bcd,
- 0x0bd7, 0x0bd7,
- 0x0be6, 0x0bef,
- 0x0c01, 0x0c03,
- 0x0c05, 0x0c0c,
- 0x0c0e, 0x0c10,
- 0x0c12, 0x0c28,
- 0x0c2a, 0x0c33,
- 0x0c35, 0x0c39,
- 0x0c3e, 0x0c44,
- 0x0c46, 0x0c48,
- 0x0c4a, 0x0c4d,
- 0x0c55, 0x0c56,
- 0x0c60, 0x0c61,
- 0x0c66, 0x0c6f,
- 0x0c82, 0x0c83,
- 0x0c85, 0x0c8c,
- 0x0c8e, 0x0c90,
- 0x0c92, 0x0ca8,
- 0x0caa, 0x0cb3,
- 0x0cb5, 0x0cb9,
- 0x0cbc, 0x0cc4,
- 0x0cc6, 0x0cc8,
- 0x0cca, 0x0ccd,
- 0x0cd5, 0x0cd6,
- 0x0cde, 0x0cde,
- 0x0ce0, 0x0ce1,
- 0x0ce6, 0x0cef,
- 0x0d02, 0x0d03,
- 0x0d05, 0x0d0c,
- 0x0d0e, 0x0d10,
- 0x0d12, 0x0d28,
- 0x0d2a, 0x0d39,
- 0x0d3e, 0x0d43,
- 0x0d46, 0x0d48,
- 0x0d4a, 0x0d4d,
- 0x0d57, 0x0d57,
- 0x0d60, 0x0d61,
- 0x0d66, 0x0d6f,
- 0x0d82, 0x0d83,
- 0x0d85, 0x0d96,
- 0x0d9a, 0x0db1,
- 0x0db3, 0x0dbb,
- 0x0dbd, 0x0dbd,
- 0x0dc0, 0x0dc6,
- 0x0dca, 0x0dca,
- 0x0dcf, 0x0dd4,
- 0x0dd6, 0x0dd6,
- 0x0dd8, 0x0ddf,
- 0x0df2, 0x0df3,
- 0x0e01, 0x0e3a,
- 0x0e40, 0x0e4e,
- 0x0e50, 0x0e59,
- 0x0e81, 0x0e82,
- 0x0e84, 0x0e84,
- 0x0e87, 0x0e88,
- 0x0e8a, 0x0e8a,
- 0x0e8d, 0x0e8d,
- 0x0e94, 0x0e97,
- 0x0e99, 0x0e9f,
- 0x0ea1, 0x0ea3,
- 0x0ea5, 0x0ea5,
- 0x0ea7, 0x0ea7,
- 0x0eaa, 0x0eab,
- 0x0ead, 0x0eb9,
- 0x0ebb, 0x0ebd,
- 0x0ec0, 0x0ec4,
- 0x0ec6, 0x0ec6,
- 0x0ec8, 0x0ecd,
- 0x0ed0, 0x0ed9,
- 0x0edc, 0x0edd,
- 0x0f00, 0x0f00,
- 0x0f18, 0x0f19,
- 0x0f20, 0x0f29,
- 0x0f35, 0x0f35,
- 0x0f37, 0x0f37,
- 0x0f39, 0x0f39,
- 0x0f3e, 0x0f47,
- 0x0f49, 0x0f6a,
- 0x0f71, 0x0f84,
- 0x0f86, 0x0f8b,
- 0x0f90, 0x0f97,
- 0x0f99, 0x0fbc,
- 0x0fc6, 0x0fc6,
- 0x1000, 0x1021,
- 0x1023, 0x1027,
- 0x1029, 0x102a,
- 0x102c, 0x1032,
- 0x1036, 0x1039,
- 0x1040, 0x1049,
- 0x1050, 0x1059,
- 0x10a0, 0x10c5,
- 0x10d0, 0x10fa,
- 0x10fc, 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, 0x135f,
- 0x1380, 0x138f,
- 0x13a0, 0x13f4,
- 0x1401, 0x166c,
- 0x166f, 0x1676,
- 0x1681, 0x169a,
- 0x16a0, 0x16ea,
- 0x1700, 0x170c,
- 0x170e, 0x1714,
- 0x1720, 0x1734,
- 0x1740, 0x1753,
- 0x1760, 0x176c,
- 0x176e, 0x1770,
- 0x1772, 0x1773,
- 0x1780, 0x17b3,
- 0x17b6, 0x17d3,
- 0x17d7, 0x17d7,
- 0x17dc, 0x17dd,
- 0x17e0, 0x17e9,
- 0x180b, 0x180d,
- 0x1810, 0x1819,
- 0x1820, 0x1877,
- 0x1880, 0x18a9,
- 0x1900, 0x191c,
- 0x1920, 0x192b,
- 0x1930, 0x193b,
- 0x1946, 0x196d,
- 0x1970, 0x1974,
- 0x1980, 0x19a9,
- 0x19b0, 0x19c9,
- 0x19d0, 0x19d9,
- 0x1a00, 0x1a1b,
- 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, 0x1fbc,
- 0x1fbe, 0x1fbe,
- 0x1fc2, 0x1fc4,
- 0x1fc6, 0x1fcc,
- 0x1fd0, 0x1fd3,
- 0x1fd6, 0x1fdb,
- 0x1fe0, 0x1fec,
- 0x1ff2, 0x1ff4,
- 0x1ff6, 0x1ffc,
- 0x2071, 0x2071,
- 0x207f, 0x207f,
- 0x2090, 0x2094,
- 0x20d0, 0x20eb,
- 0x2102, 0x2102,
- 0x2107, 0x2107,
- 0x210a, 0x2113,
- 0x2115, 0x2115,
- 0x2119, 0x211d,
- 0x2124, 0x2124,
- 0x2126, 0x2126,
- 0x2128, 0x2128,
- 0x212a, 0x212d,
- 0x212f, 0x2131,
- 0x2133, 0x2139,
- 0x213c, 0x213f,
- 0x2145, 0x2149,
- 0x2c00, 0x2c2e,
- 0x2c30, 0x2c5e,
- 0x2c80, 0x2ce4,
- 0x2d00, 0x2d25,
- 0x2d30, 0x2d65,
- 0x2d6f, 0x2d6f,
- 0x2d80, 0x2d96,
- 0x2da0, 0x2da6,
- 0x2da8, 0x2dae,
- 0x2db0, 0x2db6,
- 0x2db8, 0x2dbe,
- 0x2dc0, 0x2dc6,
- 0x2dc8, 0x2dce,
- 0x2dd0, 0x2dd6,
- 0x2dd8, 0x2dde,
- 0x3005, 0x3006,
- 0x302a, 0x302f,
- 0x3031, 0x3035,
- 0x303b, 0x303c,
- 0x3041, 0x3096,
- 0x3099, 0x309a,
- 0x309d, 0x309f,
- 0x30a1, 0x30fa,
- 0x30fc, 0x30ff,
- 0x3105, 0x312c,
- 0x3131, 0x318e,
- 0x31a0, 0x31b7,
- 0x31f0, 0x31ff,
- 0x3400, 0x4db5,
- 0x4e00, 0x9fbb,
- 0xa000, 0xa48c,
- 0xa800, 0xa827,
- 0xac00, 0xd7a3,
- 0xf900, 0xfa2d,
- 0xfa30, 0xfa6a,
- 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, 0xfe23,
- 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,
- 0x10300, 0x1031e,
- 0x10330, 0x10349,
- 0x10380, 0x1039d,
- 0x103a0, 0x103c3,
- 0x103c8, 0x103cf,
- 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, 0x10a3f,
- 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, 0x1d7c9,
- 0x1d7ce, 0x1d7ff,
- 0x20000, 0x2a6d6,
- 0x2f800, 0x2fa1d,
- 0xe0100, 0xe01ef
-}; /* 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[] = {
- 420,
- 0x0000, 0x0241,
- 0x0250, 0x036f,
- 0x0374, 0x0375,
- 0x037a, 0x037a,
- 0x037e, 0x037e,
- 0x0384, 0x038a,
- 0x038c, 0x038c,
- 0x038e, 0x03a1,
- 0x03a3, 0x03ce,
- 0x03d0, 0x0486,
- 0x0488, 0x04ce,
- 0x04d0, 0x04f9,
- 0x0500, 0x050f,
- 0x0531, 0x0556,
- 0x0559, 0x055f,
- 0x0561, 0x0587,
- 0x0589, 0x058a,
- 0x0591, 0x05b9,
- 0x05bb, 0x05c7,
- 0x05d0, 0x05ea,
- 0x05f0, 0x05f4,
- 0x0600, 0x0603,
- 0x060b, 0x0615,
- 0x061b, 0x061b,
- 0x061e, 0x061f,
- 0x0621, 0x063a,
- 0x0640, 0x065e,
- 0x0660, 0x070d,
- 0x070f, 0x074a,
- 0x074d, 0x076d,
- 0x0780, 0x07b1,
- 0x0901, 0x0939,
- 0x093c, 0x094d,
- 0x0950, 0x0954,
- 0x0958, 0x0970,
- 0x097d, 0x097d,
- 0x0981, 0x0983,
- 0x0985, 0x098c,
- 0x098f, 0x0990,
- 0x0993, 0x09a8,
- 0x09aa, 0x09b0,
- 0x09b2, 0x09b2,
- 0x09b6, 0x09b9,
- 0x09bc, 0x09c4,
- 0x09c7, 0x09c8,
- 0x09cb, 0x09ce,
- 0x09d7, 0x09d7,
- 0x09dc, 0x09dd,
- 0x09df, 0x09e3,
- 0x09e6, 0x09fa,
- 0x0a01, 0x0a03,
- 0x0a05, 0x0a0a,
- 0x0a0f, 0x0a10,
- 0x0a13, 0x0a28,
- 0x0a2a, 0x0a30,
- 0x0a32, 0x0a33,
- 0x0a35, 0x0a36,
- 0x0a38, 0x0a39,
- 0x0a3c, 0x0a3c,
- 0x0a3e, 0x0a42,
- 0x0a47, 0x0a48,
- 0x0a4b, 0x0a4d,
- 0x0a59, 0x0a5c,
- 0x0a5e, 0x0a5e,
- 0x0a66, 0x0a74,
- 0x0a81, 0x0a83,
- 0x0a85, 0x0a8d,
- 0x0a8f, 0x0a91,
- 0x0a93, 0x0aa8,
- 0x0aaa, 0x0ab0,
- 0x0ab2, 0x0ab3,
- 0x0ab5, 0x0ab9,
- 0x0abc, 0x0ac5,
- 0x0ac7, 0x0ac9,
- 0x0acb, 0x0acd,
- 0x0ad0, 0x0ad0,
- 0x0ae0, 0x0ae3,
- 0x0ae6, 0x0aef,
- 0x0af1, 0x0af1,
- 0x0b01, 0x0b03,
- 0x0b05, 0x0b0c,
- 0x0b0f, 0x0b10,
- 0x0b13, 0x0b28,
- 0x0b2a, 0x0b30,
- 0x0b32, 0x0b33,
- 0x0b35, 0x0b39,
- 0x0b3c, 0x0b43,
- 0x0b47, 0x0b48,
- 0x0b4b, 0x0b4d,
- 0x0b56, 0x0b57,
- 0x0b5c, 0x0b5d,
- 0x0b5f, 0x0b61,
- 0x0b66, 0x0b71,
- 0x0b82, 0x0b83,
- 0x0b85, 0x0b8a,
- 0x0b8e, 0x0b90,
- 0x0b92, 0x0b95,
- 0x0b99, 0x0b9a,
- 0x0b9c, 0x0b9c,
- 0x0b9e, 0x0b9f,
- 0x0ba3, 0x0ba4,
- 0x0ba8, 0x0baa,
- 0x0bae, 0x0bb9,
- 0x0bbe, 0x0bc2,
- 0x0bc6, 0x0bc8,
- 0x0bca, 0x0bcd,
- 0x0bd7, 0x0bd7,
- 0x0be6, 0x0bfa,
- 0x0c01, 0x0c03,
- 0x0c05, 0x0c0c,
- 0x0c0e, 0x0c10,
- 0x0c12, 0x0c28,
- 0x0c2a, 0x0c33,
- 0x0c35, 0x0c39,
- 0x0c3e, 0x0c44,
- 0x0c46, 0x0c48,
- 0x0c4a, 0x0c4d,
- 0x0c55, 0x0c56,
- 0x0c60, 0x0c61,
- 0x0c66, 0x0c6f,
- 0x0c82, 0x0c83,
- 0x0c85, 0x0c8c,
- 0x0c8e, 0x0c90,
- 0x0c92, 0x0ca8,
- 0x0caa, 0x0cb3,
- 0x0cb5, 0x0cb9,
- 0x0cbc, 0x0cc4,
- 0x0cc6, 0x0cc8,
- 0x0cca, 0x0ccd,
- 0x0cd5, 0x0cd6,
- 0x0cde, 0x0cde,
- 0x0ce0, 0x0ce1,
- 0x0ce6, 0x0cef,
- 0x0d02, 0x0d03,
- 0x0d05, 0x0d0c,
- 0x0d0e, 0x0d10,
- 0x0d12, 0x0d28,
- 0x0d2a, 0x0d39,
- 0x0d3e, 0x0d43,
- 0x0d46, 0x0d48,
- 0x0d4a, 0x0d4d,
- 0x0d57, 0x0d57,
- 0x0d60, 0x0d61,
- 0x0d66, 0x0d6f,
- 0x0d82, 0x0d83,
- 0x0d85, 0x0d96,
- 0x0d9a, 0x0db1,
- 0x0db3, 0x0dbb,
- 0x0dbd, 0x0dbd,
- 0x0dc0, 0x0dc6,
- 0x0dca, 0x0dca,
- 0x0dcf, 0x0dd4,
- 0x0dd6, 0x0dd6,
- 0x0dd8, 0x0ddf,
- 0x0df2, 0x0df4,
- 0x0e01, 0x0e3a,
- 0x0e3f, 0x0e5b,
- 0x0e81, 0x0e82,
- 0x0e84, 0x0e84,
- 0x0e87, 0x0e88,
- 0x0e8a, 0x0e8a,
- 0x0e8d, 0x0e8d,
- 0x0e94, 0x0e97,
- 0x0e99, 0x0e9f,
- 0x0ea1, 0x0ea3,
- 0x0ea5, 0x0ea5,
- 0x0ea7, 0x0ea7,
- 0x0eaa, 0x0eab,
- 0x0ead, 0x0eb9,
- 0x0ebb, 0x0ebd,
- 0x0ec0, 0x0ec4,
- 0x0ec6, 0x0ec6,
- 0x0ec8, 0x0ecd,
- 0x0ed0, 0x0ed9,
- 0x0edc, 0x0edd,
- 0x0f00, 0x0f47,
- 0x0f49, 0x0f6a,
- 0x0f71, 0x0f8b,
- 0x0f90, 0x0f97,
- 0x0f99, 0x0fbc,
- 0x0fbe, 0x0fcc,
- 0x0fcf, 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,
- 0xfdf0, 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, 0xfffd,
- 0x10000, 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,
- 0x20000, 0x2a6d6,
- 0x2f800, 0x2fa1d,
- 0xe0001, 0xe0001,
- 0xe0020, 0xe007f,
- 0xe0100, 0xe01ef,
- 0xf0000, 0xffffd,
- 0x100000, 0x10fffd
-}; /* CR_Assigned */
-
-/* 'C': Major Category */
-static const OnigCodePoint CR_C[] = {
- 422,
- 0x0000, 0x001f,
- 0x007f, 0x009f,
- 0x00ad, 0x00ad,
- 0x0242, 0x024f,
- 0x0370, 0x0373,
- 0x0376, 0x0379,
- 0x037b, 0x037d,
- 0x037f, 0x0383,
- 0x038b, 0x038b,
- 0x038d, 0x038d,
- 0x03a2, 0x03a2,
- 0x03cf, 0x03cf,
- 0x0487, 0x0487,
- 0x04cf, 0x04cf,
- 0x04fa, 0x04ff,
- 0x0510, 0x0530,
- 0x0557, 0x0558,
- 0x0560, 0x0560,
- 0x0588, 0x0588,
- 0x058b, 0x0590,
- 0x05ba, 0x05ba,
- 0x05c8, 0x05cf,
- 0x05eb, 0x05ef,
- 0x05f5, 0x060a,
- 0x0616, 0x061a,
- 0x061c, 0x061d,
- 0x0620, 0x0620,
- 0x063b, 0x063f,
- 0x065f, 0x065f,
- 0x06dd, 0x06dd,
- 0x070e, 0x070f,
- 0x074b, 0x074c,
- 0x076e, 0x077f,
- 0x07b2, 0x0900,
- 0x093a, 0x093b,
- 0x094e, 0x094f,
- 0x0955, 0x0957,
- 0x0971, 0x097c,
- 0x097e, 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,
- 0x09fb, 0x0a00,
- 0x0a04, 0x0a04,
- 0x0a0b, 0x0a0e,
- 0x0a11, 0x0a12,
- 0x0a29, 0x0a29,
- 0x0a31, 0x0a31,
- 0x0a34, 0x0a34,
- 0x0a37, 0x0a37,
- 0x0a3a, 0x0a3b,
- 0x0a3d, 0x0a3d,
- 0x0a43, 0x0a46,
- 0x0a49, 0x0a4a,
- 0x0a4e, 0x0a58,
- 0x0a5d, 0x0a5d,
- 0x0a5f, 0x0a65,
- 0x0a75, 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,
- 0x0af0, 0x0af0,
- 0x0af2, 0x0b00,
- 0x0b04, 0x0b04,
- 0x0b0d, 0x0b0e,
- 0x0b11, 0x0b12,
- 0x0b29, 0x0b29,
- 0x0b31, 0x0b31,
- 0x0b34, 0x0b34,
- 0x0b3a, 0x0b3b,
- 0x0b44, 0x0b46,
- 0x0b49, 0x0b4a,
- 0x0b4e, 0x0b55,
- 0x0b58, 0x0b5b,
- 0x0b5e, 0x0b5e,
- 0x0b62, 0x0b65,
- 0x0b72, 0x0b81,
- 0x0b84, 0x0b84,
- 0x0b8b, 0x0b8d,
- 0x0b91, 0x0b91,
- 0x0b96, 0x0b98,
- 0x0b9b, 0x0b9b,
- 0x0b9d, 0x0b9d,
- 0x0ba0, 0x0ba2,
- 0x0ba5, 0x0ba7,
- 0x0bab, 0x0bad,
- 0x0bba, 0x0bbd,
- 0x0bc3, 0x0bc5,
- 0x0bc9, 0x0bc9,
- 0x0bce, 0x0bd6,
- 0x0bd8, 0x0be5,
- 0x0bfb, 0x0c00,
- 0x0c04, 0x0c04,
- 0x0c0d, 0x0c0d,
- 0x0c11, 0x0c11,
- 0x0c29, 0x0c29,
- 0x0c34, 0x0c34,
- 0x0c3a, 0x0c3d,
- 0x0c45, 0x0c45,
- 0x0c49, 0x0c49,
- 0x0c4e, 0x0c54,
- 0x0c57, 0x0c5f,
- 0x0c62, 0x0c65,
- 0x0c70, 0x0c81,
- 0x0c84, 0x0c84,
- 0x0c8d, 0x0c8d,
- 0x0c91, 0x0c91,
- 0x0ca9, 0x0ca9,
- 0x0cb4, 0x0cb4,
- 0x0cba, 0x0cbb,
- 0x0cc5, 0x0cc5,
- 0x0cc9, 0x0cc9,
- 0x0cce, 0x0cd4,
- 0x0cd7, 0x0cdd,
- 0x0cdf, 0x0cdf,
- 0x0ce2, 0x0ce5,
- 0x0cf0, 0x0d01,
- 0x0d04, 0x0d04,
- 0x0d0d, 0x0d0d,
- 0x0d11, 0x0d11,
- 0x0d29, 0x0d29,
- 0x0d3a, 0x0d3d,
- 0x0d44, 0x0d45,
- 0x0d49, 0x0d49,
- 0x0d4e, 0x0d56,
- 0x0d58, 0x0d5f,
- 0x0d62, 0x0d65,
- 0x0d70, 0x0d81,
- 0x0d84, 0x0d84,
- 0x0d97, 0x0d99,
- 0x0db2, 0x0db2,
- 0x0dbc, 0x0dbc,
- 0x0dbe, 0x0dbf,
- 0x0dc7, 0x0dc9,
- 0x0dcb, 0x0dce,
- 0x0dd5, 0x0dd5,
- 0x0dd7, 0x0dd7,
- 0x0de0, 0x0df1,
- 0x0df5, 0x0e00,
- 0x0e3b, 0x0e3e,
- 0x0e5c, 0x0e80,
- 0x0e83, 0x0e83,
- 0x0e85, 0x0e86,
- 0x0e89, 0x0e89,
- 0x0e8b, 0x0e8c,
- 0x0e8e, 0x0e93,
- 0x0e98, 0x0e98,
- 0x0ea0, 0x0ea0,
- 0x0ea4, 0x0ea4,
- 0x0ea6, 0x0ea6,
- 0x0ea8, 0x0ea9,
- 0x0eac, 0x0eac,
- 0x0eba, 0x0eba,
- 0x0ebe, 0x0ebf,
- 0x0ec5, 0x0ec5,
- 0x0ec7, 0x0ec7,
- 0x0ece, 0x0ecf,
- 0x0eda, 0x0edb,
- 0x0ede, 0x0eff,
- 0x0f48, 0x0f48,
- 0x0f6b, 0x0f70,
- 0x0f8c, 0x0f8f,
- 0x0f98, 0x0f98,
- 0x0fbd, 0x0fbd,
- 0x0fcd, 0x0fce,
- 0x0fd2, 0x0fff,
- 0x1022, 0x1022,
- 0x1028, 0x1028,
- 0x102b, 0x102b,
- 0x1033, 0x1035,
- 0x103a, 0x103f,
- 0x105a, 0x109f,
- 0x10c6, 0x10cf,
- 0x10fd, 0x10ff,
- 0x115a, 0x115e,
- 0x11a3, 0x11a7,
- 0x11fa, 0x11ff,
- 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, 0x135e,
- 0x137d, 0x137f,
- 0x139a, 0x139f,
- 0x13f5, 0x1400,
- 0x1677, 0x167f,
- 0x169d, 0x169f,
- 0x16f1, 0x16ff,
- 0x170d, 0x170d,
- 0x1715, 0x171f,
- 0x1737, 0x173f,
- 0x1754, 0x175f,
- 0x176d, 0x176d,
- 0x1771, 0x1771,
- 0x1774, 0x177f,
- 0x17b4, 0x17b5,
- 0x17de, 0x17df,
- 0x17ea, 0x17ef,
- 0x17fa, 0x17ff,
- 0x180f, 0x180f,
- 0x181a, 0x181f,
- 0x1878, 0x187f,
- 0x18aa, 0x18ff,
- 0x191d, 0x191f,
- 0x192c, 0x192f,
- 0x193c, 0x193f,
- 0x1941, 0x1943,
- 0x196e, 0x196f,
- 0x1975, 0x197f,
- 0x19aa, 0x19af,
- 0x19ca, 0x19cf,
- 0x19da, 0x19dd,
- 0x1a1c, 0x1a1d,
- 0x1a20, 0x1cff,
- 0x1dc4, 0x1dff,
- 0x1e9c, 0x1e9f,
- 0x1efa, 0x1eff,
- 0x1f16, 0x1f17,
- 0x1f1e, 0x1f1f,
- 0x1f46, 0x1f47,
- 0x1f4e, 0x1f4f,
- 0x1f58, 0x1f58,
- 0x1f5a, 0x1f5a,
- 0x1f5c, 0x1f5c,
- 0x1f5e, 0x1f5e,
- 0x1f7e, 0x1f7f,
- 0x1fb5, 0x1fb5,
- 0x1fc5, 0x1fc5,
- 0x1fd4, 0x1fd5,
- 0x1fdc, 0x1fdc,
- 0x1ff0, 0x1ff1,
- 0x1ff5, 0x1ff5,
- 0x1fff, 0x1fff,
- 0x200b, 0x200f,
- 0x202a, 0x202e,
- 0x2060, 0x206f,
- 0x2072, 0x2073,
- 0x208f, 0x208f,
- 0x2095, 0x209f,
- 0x20b6, 0x20cf,
- 0x20ec, 0x20ff,
- 0x214d, 0x2152,
- 0x2184, 0x218f,
- 0x23dc, 0x23ff,
- 0x2427, 0x243f,
- 0x244b, 0x245f,
- 0x269d, 0x269f,
- 0x26b2, 0x2700,
- 0x2705, 0x2705,
- 0x270a, 0x270b,
- 0x2728, 0x2728,
- 0x274c, 0x274c,
- 0x274e, 0x274e,
- 0x2753, 0x2755,
- 0x2757, 0x2757,
- 0x275f, 0x2760,
- 0x2795, 0x2797,
- 0x27b0, 0x27b0,
- 0x27bf, 0x27bf,
- 0x27c7, 0x27cf,
- 0x27ec, 0x27ef,
- 0x2b14, 0x2bff,
- 0x2c2f, 0x2c2f,
- 0x2c5f, 0x2c7f,
- 0x2ceb, 0x2cf8,
- 0x2d26, 0x2d2f,
- 0x2d66, 0x2d6e,
- 0x2d70, 0x2d7f,
- 0x2d97, 0x2d9f,
- 0x2da7, 0x2da7,
- 0x2daf, 0x2daf,
- 0x2db7, 0x2db7,
- 0x2dbf, 0x2dbf,
- 0x2dc7, 0x2dc7,
- 0x2dcf, 0x2dcf,
- 0x2dd7, 0x2dd7,
- 0x2ddf, 0x2dff,
- 0x2e18, 0x2e1b,
- 0x2e1e, 0x2e7f,
- 0x2e9a, 0x2e9a,
- 0x2ef4, 0x2eff,
- 0x2fd6, 0x2fef,
- 0x2ffc, 0x2fff,
- 0x3040, 0x3040,
- 0x3097, 0x3098,
- 0x3100, 0x3104,
- 0x312d, 0x3130,
- 0x318f, 0x318f,
- 0x31b8, 0x31bf,
- 0x31d0, 0x31ef,
- 0x321f, 0x321f,
- 0x3244, 0x324f,
- 0x32ff, 0x32ff,
- 0x4db6, 0x4dbf,
- 0x9fbc, 0x9fff,
- 0xa48d, 0xa48f,
- 0xa4c7, 0xa6ff,
- 0xa717, 0xa7ff,
- 0xa82c, 0xabff,
- 0xd7a4, 0xf8ff,
- 0xfa2e, 0xfa2f,
- 0xfa6b, 0xfa6f,
- 0xfada, 0xfaff,
- 0xfb07, 0xfb12,
- 0xfb18, 0xfb1c,
- 0xfb37, 0xfb37,
- 0xfb3d, 0xfb3d,
- 0xfb3f, 0xfb3f,
- 0xfb42, 0xfb42,
- 0xfb45, 0xfb45,
- 0xfbb2, 0xfbd2,
- 0xfd40, 0xfd4f,
- 0xfd90, 0xfd91,
- 0xfdc8, 0xfdef,
- 0xfdfe, 0xfdff,
- 0xfe1a, 0xfe1f,
- 0xfe24, 0xfe2f,
- 0xfe53, 0xfe53,
- 0xfe67, 0xfe67,
- 0xfe6c, 0xfe6f,
- 0xfe75, 0xfe75,
- 0xfefd, 0xff00,
- 0xffbf, 0xffc1,
- 0xffc8, 0xffc9,
- 0xffd0, 0xffd1,
- 0xffd8, 0xffd9,
- 0xffdd, 0xffdf,
- 0xffe7, 0xffe7,
- 0xffef, 0xfffb,
- 0xfffe, 0xffff,
- 0x1000c, 0x1000c,
- 0x10027, 0x10027,
- 0x1003b, 0x1003b,
- 0x1003e, 0x1003e,
- 0x1004e, 0x1004f,
- 0x1005e, 0x1007f,
- 0x100fb, 0x100ff,
- 0x10103, 0x10106,
- 0x10134, 0x10136,
- 0x1018b, 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,
- 0x10840, 0x109ff,
- 0x10a04, 0x10a04,
- 0x10a07, 0x10a0b,
- 0x10a14, 0x10a14,
- 0x10a18, 0x10a18,
- 0x10a34, 0x10a37,
- 0x10a3b, 0x10a3e,
- 0x10a48, 0x10a4f,
- 0x10a59, 0x1cfff,
- 0x1d0f6, 0x1d0ff,
- 0x1d127, 0x1d129,
- 0x1d173, 0x1d17a,
- 0x1d1de, 0x1d1ff,
- 0x1d246, 0x1d2ff,
- 0x1d357, 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,
- 0x1d7ca, 0x1d7cd,
- 0x1d800, 0x1ffff,
- 0x2a6d7, 0x2f7ff,
- 0x2fa1e, 0xe00ff,
- 0xe01f0, 0x10ffff
-}; /* CR_C */
-
-/* 'Cc': General Category */
-static const OnigCodePoint CR_Cc[] = {
- 2,
- 0x0000, 0x001f,
- 0x007f, 0x009f
-}; /* CR_Cc */
-
-/* 'Cf': General Category */
-static const OnigCodePoint CR_Cf[] = {
- 14,
- 0x00ad, 0x00ad,
- 0x0600, 0x0603,
- 0x06dd, 0x06dd,
- 0x070f, 0x070f,
- 0x17b4, 0x17b5,
- 0x200b, 0x200f,
- 0x202a, 0x202e,
- 0x2060, 0x2063,
- 0x206a, 0x206f,
- 0xfeff, 0xfeff,
- 0xfff9, 0xfffb,
- 0x1d173, 0x1d17a,
- 0xe0001, 0xe0001,
- 0xe0020, 0xe007f
-}; /* CR_Cf */
-
-/* 'Cn': General Category */
-static const OnigCodePoint CR_Cn[] = {
- 420,
- 0x0242, 0x024f,
- 0x0370, 0x0373,
- 0x0376, 0x0379,
- 0x037b, 0x037d,
- 0x037f, 0x0383,
- 0x038b, 0x038b,
- 0x038d, 0x038d,
- 0x03a2, 0x03a2,
- 0x03cf, 0x03cf,
- 0x0487, 0x0487,
- 0x04cf, 0x04cf,
- 0x04fa, 0x04ff,
- 0x0510, 0x0530,
- 0x0557, 0x0558,
- 0x0560, 0x0560,
- 0x0588, 0x0588,
- 0x058b, 0x0590,
- 0x05ba, 0x05ba,
- 0x05c8, 0x05cf,
- 0x05eb, 0x05ef,
- 0x05f5, 0x05ff,
- 0x0604, 0x060a,
- 0x0616, 0x061a,
- 0x061c, 0x061d,
- 0x0620, 0x0620,
- 0x063b, 0x063f,
- 0x065f, 0x065f,
- 0x070e, 0x070e,
- 0x074b, 0x074c,
- 0x076e, 0x077f,
- 0x07b2, 0x0900,
- 0x093a, 0x093b,
- 0x094e, 0x094f,
- 0x0955, 0x0957,
- 0x0971, 0x097c,
- 0x097e, 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,
- 0x09fb, 0x0a00,
- 0x0a04, 0x0a04,
- 0x0a0b, 0x0a0e,
- 0x0a11, 0x0a12,
- 0x0a29, 0x0a29,
- 0x0a31, 0x0a31,
- 0x0a34, 0x0a34,
- 0x0a37, 0x0a37,
- 0x0a3a, 0x0a3b,
- 0x0a3d, 0x0a3d,
- 0x0a43, 0x0a46,
- 0x0a49, 0x0a4a,
- 0x0a4e, 0x0a58,
- 0x0a5d, 0x0a5d,
- 0x0a5f, 0x0a65,
- 0x0a75, 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,
- 0x0af0, 0x0af0,
- 0x0af2, 0x0b00,
- 0x0b04, 0x0b04,
- 0x0b0d, 0x0b0e,
- 0x0b11, 0x0b12,
- 0x0b29, 0x0b29,
- 0x0b31, 0x0b31,
- 0x0b34, 0x0b34,
- 0x0b3a, 0x0b3b,
- 0x0b44, 0x0b46,
- 0x0b49, 0x0b4a,
- 0x0b4e, 0x0b55,
- 0x0b58, 0x0b5b,
- 0x0b5e, 0x0b5e,
- 0x0b62, 0x0b65,
- 0x0b72, 0x0b81,
- 0x0b84, 0x0b84,
- 0x0b8b, 0x0b8d,
- 0x0b91, 0x0b91,
- 0x0b96, 0x0b98,
- 0x0b9b, 0x0b9b,
- 0x0b9d, 0x0b9d,
- 0x0ba0, 0x0ba2,
- 0x0ba5, 0x0ba7,
- 0x0bab, 0x0bad,
- 0x0bba, 0x0bbd,
- 0x0bc3, 0x0bc5,
- 0x0bc9, 0x0bc9,
- 0x0bce, 0x0bd6,
- 0x0bd8, 0x0be5,
- 0x0bfb, 0x0c00,
- 0x0c04, 0x0c04,
- 0x0c0d, 0x0c0d,
- 0x0c11, 0x0c11,
- 0x0c29, 0x0c29,
- 0x0c34, 0x0c34,
- 0x0c3a, 0x0c3d,
- 0x0c45, 0x0c45,
- 0x0c49, 0x0c49,
- 0x0c4e, 0x0c54,
- 0x0c57, 0x0c5f,
- 0x0c62, 0x0c65,
- 0x0c70, 0x0c81,
- 0x0c84, 0x0c84,
- 0x0c8d, 0x0c8d,
- 0x0c91, 0x0c91,
- 0x0ca9, 0x0ca9,
- 0x0cb4, 0x0cb4,
- 0x0cba, 0x0cbb,
- 0x0cc5, 0x0cc5,
- 0x0cc9, 0x0cc9,
- 0x0cce, 0x0cd4,
- 0x0cd7, 0x0cdd,
- 0x0cdf, 0x0cdf,
- 0x0ce2, 0x0ce5,
- 0x0cf0, 0x0d01,
- 0x0d04, 0x0d04,
- 0x0d0d, 0x0d0d,
- 0x0d11, 0x0d11,
- 0x0d29, 0x0d29,
- 0x0d3a, 0x0d3d,
- 0x0d44, 0x0d45,
- 0x0d49, 0x0d49,
- 0x0d4e, 0x0d56,
- 0x0d58, 0x0d5f,
- 0x0d62, 0x0d65,
- 0x0d70, 0x0d81,
- 0x0d84, 0x0d84,
- 0x0d97, 0x0d99,
- 0x0db2, 0x0db2,
- 0x0dbc, 0x0dbc,
- 0x0dbe, 0x0dbf,
- 0x0dc7, 0x0dc9,
- 0x0dcb, 0x0dce,
- 0x0dd5, 0x0dd5,
- 0x0dd7, 0x0dd7,
- 0x0de0, 0x0df1,
- 0x0df5, 0x0e00,
- 0x0e3b, 0x0e3e,
- 0x0e5c, 0x0e80,
- 0x0e83, 0x0e83,
- 0x0e85, 0x0e86,
- 0x0e89, 0x0e89,
- 0x0e8b, 0x0e8c,
- 0x0e8e, 0x0e93,
- 0x0e98, 0x0e98,
- 0x0ea0, 0x0ea0,
- 0x0ea4, 0x0ea4,
- 0x0ea6, 0x0ea6,
- 0x0ea8, 0x0ea9,
- 0x0eac, 0x0eac,
- 0x0eba, 0x0eba,
- 0x0ebe, 0x0ebf,
- 0x0ec5, 0x0ec5,
- 0x0ec7, 0x0ec7,
- 0x0ece, 0x0ecf,
- 0x0eda, 0x0edb,
- 0x0ede, 0x0eff,
- 0x0f48, 0x0f48,
- 0x0f6b, 0x0f70,
- 0x0f8c, 0x0f8f,
- 0x0f98, 0x0f98,
- 0x0fbd, 0x0fbd,
- 0x0fcd, 0x0fce,
- 0x0fd2, 0x0fff,
- 0x1022, 0x1022,
- 0x1028, 0x1028,
- 0x102b, 0x102b,
- 0x1033, 0x1035,
- 0x103a, 0x103f,
- 0x105a, 0x109f,
- 0x10c6, 0x10cf,
- 0x10fd, 0x10ff,
- 0x115a, 0x115e,
- 0x11a3, 0x11a7,
- 0x11fa, 0x11ff,
- 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, 0x135e,
- 0x137d, 0x137f,
- 0x139a, 0x139f,
- 0x13f5, 0x1400,
- 0x1677, 0x167f,
- 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,
- 0x18aa, 0x18ff,
- 0x191d, 0x191f,
- 0x192c, 0x192f,
- 0x193c, 0x193f,
- 0x1941, 0x1943,
- 0x196e, 0x196f,
- 0x1975, 0x197f,
- 0x19aa, 0x19af,
- 0x19ca, 0x19cf,
- 0x19da, 0x19dd,
- 0x1a1c, 0x1a1d,
- 0x1a20, 0x1cff,
- 0x1dc4, 0x1dff,
- 0x1e9c, 0x1e9f,
- 0x1efa, 0x1eff,
- 0x1f16, 0x1f17,
- 0x1f1e, 0x1f1f,
- 0x1f46, 0x1f47,
- 0x1f4e, 0x1f4f,
- 0x1f58, 0x1f58,
- 0x1f5a, 0x1f5a,
- 0x1f5c, 0x1f5c,
- 0x1f5e, 0x1f5e,
- 0x1f7e, 0x1f7f,
- 0x1fb5, 0x1fb5,
- 0x1fc5, 0x1fc5,
- 0x1fd4, 0x1fd5,
- 0x1fdc, 0x1fdc,
- 0x1ff0, 0x1ff1,
- 0x1ff5, 0x1ff5,
- 0x1fff, 0x1fff,
- 0x2064, 0x2069,
- 0x2072, 0x2073,
- 0x208f, 0x208f,
- 0x2095, 0x209f,
- 0x20b6, 0x20cf,
- 0x20ec, 0x20ff,
- 0x214d, 0x2152,
- 0x2184, 0x218f,
- 0x23dc, 0x23ff,
- 0x2427, 0x243f,
- 0x244b, 0x245f,
- 0x269d, 0x269f,
- 0x26b2, 0x2700,
- 0x2705, 0x2705,
- 0x270a, 0x270b,
- 0x2728, 0x2728,
- 0x274c, 0x274c,
- 0x274e, 0x274e,
- 0x2753, 0x2755,
- 0x2757, 0x2757,
- 0x275f, 0x2760,
- 0x2795, 0x2797,
- 0x27b0, 0x27b0,
- 0x27bf, 0x27bf,
- 0x27c7, 0x27cf,
- 0x27ec, 0x27ef,
- 0x2b14, 0x2bff,
- 0x2c2f, 0x2c2f,
- 0x2c5f, 0x2c7f,
- 0x2ceb, 0x2cf8,
- 0x2d26, 0x2d2f,
- 0x2d66, 0x2d6e,
- 0x2d70, 0x2d7f,
- 0x2d97, 0x2d9f,
- 0x2da7, 0x2da7,
- 0x2daf, 0x2daf,
- 0x2db7, 0x2db7,
- 0x2dbf, 0x2dbf,
- 0x2dc7, 0x2dc7,
- 0x2dcf, 0x2dcf,
- 0x2dd7, 0x2dd7,
- 0x2ddf, 0x2dff,
- 0x2e18, 0x2e1b,
- 0x2e1e, 0x2e7f,
- 0x2e9a, 0x2e9a,
- 0x2ef4, 0x2eff,
- 0x2fd6, 0x2fef,
- 0x2ffc, 0x2fff,
- 0x3040, 0x3040,
- 0x3097, 0x3098,
- 0x3100, 0x3104,
- 0x312d, 0x3130,
- 0x318f, 0x318f,
- 0x31b8, 0x31bf,
- 0x31d0, 0x31ef,
- 0x321f, 0x321f,
- 0x3244, 0x324f,
- 0x32ff, 0x32ff,
- 0x4db6, 0x4dbf,
- 0x9fbc, 0x9fff,
- 0xa48d, 0xa48f,
- 0xa4c7, 0xa6ff,
- 0xa717, 0xa7ff,
- 0xa82c, 0xabff,
- 0xd7a4, 0xd7ff,
- 0xfa2e, 0xfa2f,
- 0xfa6b, 0xfa6f,
- 0xfada, 0xfaff,
- 0xfb07, 0xfb12,
- 0xfb18, 0xfb1c,
- 0xfb37, 0xfb37,
- 0xfb3d, 0xfb3d,
- 0xfb3f, 0xfb3f,
- 0xfb42, 0xfb42,
- 0xfb45, 0xfb45,
- 0xfbb2, 0xfbd2,
- 0xfd40, 0xfd4f,
- 0xfd90, 0xfd91,
- 0xfdc8, 0xfdef,
- 0xfdfe, 0xfdff,
- 0xfe1a, 0xfe1f,
- 0xfe24, 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, 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,
- 0x10840, 0x109ff,
- 0x10a04, 0x10a04,
- 0x10a07, 0x10a0b,
- 0x10a14, 0x10a14,
- 0x10a18, 0x10a18,
- 0x10a34, 0x10a37,
- 0x10a3b, 0x10a3e,
- 0x10a48, 0x10a4f,
- 0x10a59, 0x1cfff,
- 0x1d0f6, 0x1d0ff,
- 0x1d127, 0x1d129,
- 0x1d1de, 0x1d1ff,
- 0x1d246, 0x1d2ff,
- 0x1d357, 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,
- 0x1d7ca, 0x1d7cd,
- 0x1d800, 0x1ffff,
- 0x2a6d7, 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[] = {
- 347,
- 0x0041, 0x005a,
- 0x0061, 0x007a,
- 0x00aa, 0x00aa,
- 0x00b5, 0x00b5,
- 0x00ba, 0x00ba,
- 0x00c0, 0x00d6,
- 0x00d8, 0x00f6,
- 0x00f8, 0x0241,
- 0x0250, 0x02c1,
- 0x02c6, 0x02d1,
- 0x02e0, 0x02e4,
- 0x02ee, 0x02ee,
- 0x037a, 0x037a,
- 0x0386, 0x0386,
- 0x0388, 0x038a,
- 0x038c, 0x038c,
- 0x038e, 0x03a1,
- 0x03a3, 0x03ce,
- 0x03d0, 0x03f5,
- 0x03f7, 0x0481,
- 0x048a, 0x04ce,
- 0x04d0, 0x04f9,
- 0x0500, 0x050f,
- 0x0531, 0x0556,
- 0x0559, 0x0559,
- 0x0561, 0x0587,
- 0x05d0, 0x05ea,
- 0x05f0, 0x05f2,
- 0x0621, 0x063a,
- 0x0640, 0x064a,
- 0x066e, 0x066f,
- 0x0671, 0x06d3,
- 0x06d5, 0x06d5,
- 0x06e5, 0x06e6,
- 0x06ee, 0x06ef,
- 0x06fa, 0x06fc,
- 0x06ff, 0x06ff,
- 0x0710, 0x0710,
- 0x0712, 0x072f,
- 0x074d, 0x076d,
- 0x0780, 0x07a5,
- 0x07b1, 0x07b1,
- 0x0904, 0x0939,
- 0x093d, 0x093d,
- 0x0950, 0x0950,
- 0x0958, 0x0961,
- 0x097d, 0x097d,
- 0x0985, 0x098c,
- 0x098f, 0x0990,
- 0x0993, 0x09a8,
- 0x09aa, 0x09b0,
- 0x09b2, 0x09b2,
- 0x09b6, 0x09b9,
- 0x09bd, 0x09bd,
- 0x09ce, 0x09ce,
- 0x09dc, 0x09dd,
- 0x09df, 0x09e1,
- 0x09f0, 0x09f1,
- 0x0a05, 0x0a0a,
- 0x0a0f, 0x0a10,
- 0x0a13, 0x0a28,
- 0x0a2a, 0x0a30,
- 0x0a32, 0x0a33,
- 0x0a35, 0x0a36,
- 0x0a38, 0x0a39,
- 0x0a59, 0x0a5c,
- 0x0a5e, 0x0a5e,
- 0x0a72, 0x0a74,
- 0x0a85, 0x0a8d,
- 0x0a8f, 0x0a91,
- 0x0a93, 0x0aa8,
- 0x0aaa, 0x0ab0,
- 0x0ab2, 0x0ab3,
- 0x0ab5, 0x0ab9,
- 0x0abd, 0x0abd,
- 0x0ad0, 0x0ad0,
- 0x0ae0, 0x0ae1,
- 0x0b05, 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,
- 0x0c05, 0x0c0c,
- 0x0c0e, 0x0c10,
- 0x0c12, 0x0c28,
- 0x0c2a, 0x0c33,
- 0x0c35, 0x0c39,
- 0x0c60, 0x0c61,
- 0x0c85, 0x0c8c,
- 0x0c8e, 0x0c90,
- 0x0c92, 0x0ca8,
- 0x0caa, 0x0cb3,
- 0x0cb5, 0x0cb9,
- 0x0cbd, 0x0cbd,
- 0x0cde, 0x0cde,
- 0x0ce0, 0x0ce1,
- 0x0d05, 0x0d0c,
- 0x0d0e, 0x0d10,
- 0x0d12, 0x0d28,
- 0x0d2a, 0x0d39,
- 0x0d60, 0x0d61,
- 0x0d85, 0x0d96,
- 0x0d9a, 0x0db1,
- 0x0db3, 0x0dbb,
- 0x0dbd, 0x0dbd,
- 0x0dc0, 0x0dc6,
- 0x0e01, 0x0e30,
- 0x0e32, 0x0e33,
- 0x0e40, 0x0e46,
- 0x0e81, 0x0e82,
- 0x0e84, 0x0e84,
- 0x0e87, 0x0e88,
- 0x0e8a, 0x0e8a,
- 0x0e8d, 0x0e8d,
- 0x0e94, 0x0e97,
- 0x0e99, 0x0e9f,
- 0x0ea1, 0x0ea3,
- 0x0ea5, 0x0ea5,
- 0x0ea7, 0x0ea7,
- 0x0eaa, 0x0eab,
- 0x0ead, 0x0eb0,
- 0x0eb2, 0x0eb3,
- 0x0ebd, 0x0ebd,
- 0x0ec0, 0x0ec4,
- 0x0ec6, 0x0ec6,
- 0x0edc, 0x0edd,
- 0x0f00, 0x0f00,
- 0x0f40, 0x0f47,
- 0x0f49, 0x0f6a,
- 0x0f88, 0x0f8b,
- 0x1000, 0x1021,
- 0x1023, 0x1027,
- 0x1029, 0x102a,
- 0x1050, 0x1055,
- 0x10a0, 0x10c5,
- 0x10d0, 0x10fa,
- 0x10fc, 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,
- 0x1380, 0x138f,
- 0x13a0, 0x13f4,
- 0x1401, 0x166c,
- 0x166f, 0x1676,
- 0x1681, 0x169a,
- 0x16a0, 0x16ea,
- 0x1700, 0x170c,
- 0x170e, 0x1711,
- 0x1720, 0x1731,
- 0x1740, 0x1751,
- 0x1760, 0x176c,
- 0x176e, 0x1770,
- 0x1780, 0x17b3,
- 0x17d7, 0x17d7,
- 0x17dc, 0x17dc,
- 0x1820, 0x1877,
- 0x1880, 0x18a8,
- 0x1900, 0x191c,
- 0x1950, 0x196d,
- 0x1970, 0x1974,
- 0x1980, 0x19a9,
- 0x19c1, 0x19c7,
- 0x1a00, 0x1a16,
- 0x1d00, 0x1dbf,
- 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, 0x1fbc,
- 0x1fbe, 0x1fbe,
- 0x1fc2, 0x1fc4,
- 0x1fc6, 0x1fcc,
- 0x1fd0, 0x1fd3,
- 0x1fd6, 0x1fdb,
- 0x1fe0, 0x1fec,
- 0x1ff2, 0x1ff4,
- 0x1ff6, 0x1ffc,
- 0x2071, 0x2071,
- 0x207f, 0x207f,
- 0x2090, 0x2094,
- 0x2102, 0x2102,
- 0x2107, 0x2107,
- 0x210a, 0x2113,
- 0x2115, 0x2115,
- 0x2119, 0x211d,
- 0x2124, 0x2124,
- 0x2126, 0x2126,
- 0x2128, 0x2128,
- 0x212a, 0x212d,
- 0x212f, 0x2131,
- 0x2133, 0x2139,
- 0x213c, 0x213f,
- 0x2145, 0x2149,
- 0x2c00, 0x2c2e,
- 0x2c30, 0x2c5e,
- 0x2c80, 0x2ce4,
- 0x2d00, 0x2d25,
- 0x2d30, 0x2d65,
- 0x2d6f, 0x2d6f,
- 0x2d80, 0x2d96,
- 0x2da0, 0x2da6,
- 0x2da8, 0x2dae,
- 0x2db0, 0x2db6,
- 0x2db8, 0x2dbe,
- 0x2dc0, 0x2dc6,
- 0x2dc8, 0x2dce,
- 0x2dd0, 0x2dd6,
- 0x2dd8, 0x2dde,
- 0x3005, 0x3006,
- 0x3031, 0x3035,
- 0x303b, 0x303c,
- 0x3041, 0x3096,
- 0x309d, 0x309f,
- 0x30a1, 0x30fa,
- 0x30fc, 0x30ff,
- 0x3105, 0x312c,
- 0x3131, 0x318e,
- 0x31a0, 0x31b7,
- 0x31f0, 0x31ff,
- 0x3400, 0x4db5,
- 0x4e00, 0x9fbb,
- 0xa000, 0xa48c,
- 0xa800, 0xa801,
- 0xa803, 0xa805,
- 0xa807, 0xa80a,
- 0xa80c, 0xa822,
- 0xac00, 0xd7a3,
- 0xf900, 0xfa2d,
- 0xfa30, 0xfa6a,
- 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,
- 0x10300, 0x1031e,
- 0x10330, 0x10349,
- 0x10380, 0x1039d,
- 0x103a0, 0x103c3,
- 0x103c8, 0x103cf,
- 0x10400, 0x1049d,
- 0x10800, 0x10805,
- 0x10808, 0x10808,
- 0x1080a, 0x10835,
- 0x10837, 0x10838,
- 0x1083c, 0x1083c,
- 0x1083f, 0x1083f,
- 0x10a00, 0x10a00,
- 0x10a10, 0x10a13,
- 0x10a15, 0x10a17,
- 0x10a19, 0x10a33,
- 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, 0x1d7c9,
- 0x20000, 0x2a6d6,
- 0x2f800, 0x2fa1d
-}; /* CR_L */
-
-/* 'Ll': General Category */
-static const OnigCodePoint CR_Ll[] = {
- 480,
- 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,
- 0x0250, 0x02af,
- 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, 0x04ce,
- 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,
- 0x0501, 0x0501,
- 0x0503, 0x0503,
- 0x0505, 0x0505,
- 0x0507, 0x0507,
- 0x0509, 0x0509,
- 0x050b, 0x050b,
- 0x050d, 0x050d,
- 0x050f, 0x050f,
- 0x0561, 0x0587,
- 0x1d00, 0x1d2b,
- 0x1d62, 0x1d77,
- 0x1d79, 0x1d9a,
- 0x1e01, 0x1e01,
- 0x1e03, 0x1e03,
- 0x1e05, 0x1e05,
- 0x1e07, 0x1e07,
- 0x1e09, 0x1e09,
- 0x1e0b, 0x1e0b,
- 0x1e0d, 0x1e0d,
- 0x1e0f, 0x1e0f,
- 0x1e11, 0x1e11,
- 0x1e13, 0x1e13,
- 0x1e15, 0x1e15,
- 0x1e17, 0x1e17,
- 0x1e19, 0x1e19,
- 0x1e1b, 0x1e1b,
- 0x1e1d, 0x1e1d,
- 0x1e1f, 0x1e1f,
- 0x1e21, 0x1e21,
- 0x1e23, 0x1e23,
- 0x1e25, 0x1e25,
- 0x1e27, 0x1e27,
- 0x1e29, 0x1e29,
- 0x1e2b, 0x1e2b,
- 0x1e2d, 0x1e2d,
- 0x1e2f, 0x1e2f,
- 0x1e31, 0x1e31,
- 0x1e33, 0x1e33,
- 0x1e35, 0x1e35,
- 0x1e37, 0x1e37,
- 0x1e39, 0x1e39,
- 0x1e3b, 0x1e3b,
- 0x1e3d, 0x1e3d,
- 0x1e3f, 0x1e3f,
- 0x1e41, 0x1e41,
- 0x1e43, 0x1e43,
- 0x1e45, 0x1e45,
- 0x1e47, 0x1e47,
- 0x1e49, 0x1e49,
- 0x1e4b, 0x1e4b,
- 0x1e4d, 0x1e4d,
- 0x1e4f, 0x1e4f,
- 0x1e51, 0x1e51,
- 0x1e53, 0x1e53,
- 0x1e55, 0x1e55,
- 0x1e57, 0x1e57,
- 0x1e59, 0x1e59,
- 0x1e5b, 0x1e5b,
- 0x1e5d, 0x1e5d,
- 0x1e5f, 0x1e5f,
- 0x1e61, 0x1e61,
- 0x1e63, 0x1e63,
- 0x1e65, 0x1e65,
- 0x1e67, 0x1e67,
- 0x1e69, 0x1e69,
- 0x1e6b, 0x1e6b,
- 0x1e6d, 0x1e6d,
- 0x1e6f, 0x1e6f,
- 0x1e71, 0x1e71,
- 0x1e73, 0x1e73,
- 0x1e75, 0x1e75,
- 0x1e77, 0x1e77,
- 0x1e79, 0x1e79,
- 0x1e7b, 0x1e7b,
- 0x1e7d, 0x1e7d,
- 0x1e7f, 0x1e7f,
- 0x1e81, 0x1e81,
- 0x1e83, 0x1e83,
- 0x1e85, 0x1e85,
- 0x1e87, 0x1e87,
- 0x1e89, 0x1e89,
- 0x1e8b, 0x1e8b,
- 0x1e8d, 0x1e8d,
- 0x1e8f, 0x1e8f,
- 0x1e91, 0x1e91,
- 0x1e93, 0x1e93,
- 0x1e95, 0x1e9b,
- 0x1ea1, 0x1ea1,
- 0x1ea3, 0x1ea3,
- 0x1ea5, 0x1ea5,
- 0x1ea7, 0x1ea7,
- 0x1ea9, 0x1ea9,
- 0x1eab, 0x1eab,
- 0x1ead, 0x1ead,
- 0x1eaf, 0x1eaf,
- 0x1eb1, 0x1eb1,
- 0x1eb3, 0x1eb3,
- 0x1eb5, 0x1eb5,
- 0x1eb7, 0x1eb7,
- 0x1eb9, 0x1eb9,
- 0x1ebb, 0x1ebb,
- 0x1ebd, 0x1ebd,
- 0x1ebf, 0x1ebf,
- 0x1ec1, 0x1ec1,
- 0x1ec3, 0x1ec3,
- 0x1ec5, 0x1ec5,
- 0x1ec7, 0x1ec7,
- 0x1ec9, 0x1ec9,
- 0x1ecb, 0x1ecb,
- 0x1ecd, 0x1ecd,
- 0x1ecf, 0x1ecf,
- 0x1ed1, 0x1ed1,
- 0x1ed3, 0x1ed3,
- 0x1ed5, 0x1ed5,
- 0x1ed7, 0x1ed7,
- 0x1ed9, 0x1ed9,
- 0x1edb, 0x1edb,
- 0x1edd, 0x1edd,
- 0x1edf, 0x1edf,
- 0x1ee1, 0x1ee1,
- 0x1ee3, 0x1ee3,
- 0x1ee5, 0x1ee5,
- 0x1ee7, 0x1ee7,
- 0x1ee9, 0x1ee9,
- 0x1eeb, 0x1eeb,
- 0x1eed, 0x1eed,
- 0x1eef, 0x1eef,
- 0x1ef1, 0x1ef1,
- 0x1ef3, 0x1ef3,
- 0x1ef5, 0x1ef5,
- 0x1ef7, 0x1ef7,
- 0x1ef9, 0x1ef9,
- 0x1f00, 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,
- 0x210a, 0x210a,
- 0x210e, 0x210f,
- 0x2113, 0x2113,
- 0x212f, 0x212f,
- 0x2134, 0x2134,
- 0x2139, 0x2139,
- 0x213c, 0x213d,
- 0x2146, 0x2149,
- 0x2c30, 0x2c5e,
- 0x2c81, 0x2c81,
- 0x2c83, 0x2c83,
- 0x2c85, 0x2c85,
- 0x2c87, 0x2c87,
- 0x2c89, 0x2c89,
- 0x2c8b, 0x2c8b,
- 0x2c8d, 0x2c8d,
- 0x2c8f, 0x2c8f,
- 0x2c91, 0x2c91,
- 0x2c93, 0x2c93,
- 0x2c95, 0x2c95,
- 0x2c97, 0x2c97,
- 0x2c99, 0x2c99,
- 0x2c9b, 0x2c9b,
- 0x2c9d, 0x2c9d,
- 0x2c9f, 0x2c9f,
- 0x2ca1, 0x2ca1,
- 0x2ca3, 0x2ca3,
- 0x2ca5, 0x2ca5,
- 0x2ca7, 0x2ca7,
- 0x2ca9, 0x2ca9,
- 0x2cab, 0x2cab,
- 0x2cad, 0x2cad,
- 0x2caf, 0x2caf,
- 0x2cb1, 0x2cb1,
- 0x2cb3, 0x2cb3,
- 0x2cb5, 0x2cb5,
- 0x2cb7, 0x2cb7,
- 0x2cb9, 0x2cb9,
- 0x2cbb, 0x2cbb,
- 0x2cbd, 0x2cbd,
- 0x2cbf, 0x2cbf,
- 0x2cc1, 0x2cc1,
- 0x2cc3, 0x2cc3,
- 0x2cc5, 0x2cc5,
- 0x2cc7, 0x2cc7,
- 0x2cc9, 0x2cc9,
- 0x2ccb, 0x2ccb,
- 0x2ccd, 0x2ccd,
- 0x2ccf, 0x2ccf,
- 0x2cd1, 0x2cd1,
- 0x2cd3, 0x2cd3,
- 0x2cd5, 0x2cd5,
- 0x2cd7, 0x2cd7,
- 0x2cd9, 0x2cd9,
- 0x2cdb, 0x2cdb,
- 0x2cdd, 0x2cdd,
- 0x2cdf, 0x2cdf,
- 0x2ce1, 0x2ce1,
- 0x2ce3, 0x2ce4,
- 0x2d00, 0x2d25,
- 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
-}; /* CR_Ll */
-
-/* 'Lm': General Category */
-static const OnigCodePoint CR_Lm[] = {
- 26,
- 0x02b0, 0x02c1,
- 0x02c6, 0x02d1,
- 0x02e0, 0x02e4,
- 0x02ee, 0x02ee,
- 0x037a, 0x037a,
- 0x0559, 0x0559,
- 0x0640, 0x0640,
- 0x06e5, 0x06e6,
- 0x0e46, 0x0e46,
- 0x0ec6, 0x0ec6,
- 0x10fc, 0x10fc,
- 0x17d7, 0x17d7,
- 0x1843, 0x1843,
- 0x1d2c, 0x1d61,
- 0x1d78, 0x1d78,
- 0x1d9b, 0x1dbf,
- 0x2090, 0x2094,
- 0x2d6f, 0x2d6f,
- 0x3005, 0x3005,
- 0x3031, 0x3035,
- 0x303b, 0x303b,
- 0x309d, 0x309e,
- 0x30fc, 0x30fe,
- 0xa015, 0xa015,
- 0xff70, 0xff70,
- 0xff9e, 0xff9f
-}; /* CR_Lm */
-
-/* 'Lo': General Category */
-static const OnigCodePoint CR_Lo[] = {
- 245,
- 0x01bb, 0x01bb,
- 0x01c0, 0x01c3,
- 0x05d0, 0x05ea,
- 0x05f0, 0x05f2,
- 0x0621, 0x063a,
- 0x0641, 0x064a,
- 0x066e, 0x066f,
- 0x0671, 0x06d3,
- 0x06d5, 0x06d5,
- 0x06ee, 0x06ef,
- 0x06fa, 0x06fc,
- 0x06ff, 0x06ff,
- 0x0710, 0x0710,
- 0x0712, 0x072f,
- 0x074d, 0x076d,
- 0x0780, 0x07a5,
- 0x07b1, 0x07b1,
- 0x0904, 0x0939,
- 0x093d, 0x093d,
- 0x0950, 0x0950,
- 0x0958, 0x0961,
- 0x097d, 0x097d,
- 0x0985, 0x098c,
- 0x098f, 0x0990,
- 0x0993, 0x09a8,
- 0x09aa, 0x09b0,
- 0x09b2, 0x09b2,
- 0x09b6, 0x09b9,
- 0x09bd, 0x09bd,
- 0x09ce, 0x09ce,
- 0x09dc, 0x09dd,
- 0x09df, 0x09e1,
- 0x09f0, 0x09f1,
- 0x0a05, 0x0a0a,
- 0x0a0f, 0x0a10,
- 0x0a13, 0x0a28,
- 0x0a2a, 0x0a30,
- 0x0a32, 0x0a33,
- 0x0a35, 0x0a36,
- 0x0a38, 0x0a39,
- 0x0a59, 0x0a5c,
- 0x0a5e, 0x0a5e,
- 0x0a72, 0x0a74,
- 0x0a85, 0x0a8d,
- 0x0a8f, 0x0a91,
- 0x0a93, 0x0aa8,
- 0x0aaa, 0x0ab0,
- 0x0ab2, 0x0ab3,
- 0x0ab5, 0x0ab9,
- 0x0abd, 0x0abd,
- 0x0ad0, 0x0ad0,
- 0x0ae0, 0x0ae1,
- 0x0b05, 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,
- 0x0c05, 0x0c0c,
- 0x0c0e, 0x0c10,
- 0x0c12, 0x0c28,
- 0x0c2a, 0x0c33,
- 0x0c35, 0x0c39,
- 0x0c60, 0x0c61,
- 0x0c85, 0x0c8c,
- 0x0c8e, 0x0c90,
- 0x0c92, 0x0ca8,
- 0x0caa, 0x0cb3,
- 0x0cb5, 0x0cb9,
- 0x0cbd, 0x0cbd,
- 0x0cde, 0x0cde,
- 0x0ce0, 0x0ce1,
- 0x0d05, 0x0d0c,
- 0x0d0e, 0x0d10,
- 0x0d12, 0x0d28,
- 0x0d2a, 0x0d39,
- 0x0d60, 0x0d61,
- 0x0d85, 0x0d96,
- 0x0d9a, 0x0db1,
- 0x0db3, 0x0dbb,
- 0x0dbd, 0x0dbd,
- 0x0dc0, 0x0dc6,
- 0x0e01, 0x0e30,
- 0x0e32, 0x0e33,
- 0x0e40, 0x0e45,
- 0x0e81, 0x0e82,
- 0x0e84, 0x0e84,
- 0x0e87, 0x0e88,
- 0x0e8a, 0x0e8a,
- 0x0e8d, 0x0e8d,
- 0x0e94, 0x0e97,
- 0x0e99, 0x0e9f,
- 0x0ea1, 0x0ea3,
- 0x0ea5, 0x0ea5,
- 0x0ea7, 0x0ea7,
- 0x0eaa, 0x0eab,
- 0x0ead, 0x0eb0,
- 0x0eb2, 0x0eb3,
- 0x0ebd, 0x0ebd,
- 0x0ec0, 0x0ec4,
- 0x0edc, 0x0edd,
- 0x0f00, 0x0f00,
- 0x0f40, 0x0f47,
- 0x0f49, 0x0f6a,
- 0x0f88, 0x0f8b,
- 0x1000, 0x1021,
- 0x1023, 0x1027,
- 0x1029, 0x102a,
- 0x1050, 0x1055,
- 0x10d0, 0x10fa,
- 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,
- 0x1380, 0x138f,
- 0x13a0, 0x13f4,
- 0x1401, 0x166c,
- 0x166f, 0x1676,
- 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,
- 0x1900, 0x191c,
- 0x1950, 0x196d,
- 0x1970, 0x1974,
- 0x1980, 0x19a9,
- 0x19c1, 0x19c7,
- 0x1a00, 0x1a16,
- 0x2135, 0x2138,
- 0x2d30, 0x2d65,
- 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, 0x312c,
- 0x3131, 0x318e,
- 0x31a0, 0x31b7,
- 0x31f0, 0x31ff,
- 0x3400, 0x4db5,
- 0x4e00, 0x9fbb,
- 0xa000, 0xa014,
- 0xa016, 0xa48c,
- 0xa800, 0xa801,
- 0xa803, 0xa805,
- 0xa807, 0xa80a,
- 0xa80c, 0xa822,
- 0xac00, 0xd7a3,
- 0xf900, 0xfa2d,
- 0xfa30, 0xfa6a,
- 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,
- 0x10300, 0x1031e,
- 0x10330, 0x10349,
- 0x10380, 0x1039d,
- 0x103a0, 0x103c3,
- 0x103c8, 0x103cf,
- 0x10450, 0x1049d,
- 0x10800, 0x10805,
- 0x10808, 0x10808,
- 0x1080a, 0x10835,
- 0x10837, 0x10838,
- 0x1083c, 0x1083c,
- 0x1083f, 0x1083f,
- 0x10a00, 0x10a00,
- 0x10a10, 0x10a13,
- 0x10a15, 0x10a17,
- 0x10a19, 0x10a33,
- 0x20000, 0x2a6d6,
- 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[] = {
- 476,
- 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,
- 0x0386, 0x0386,
- 0x0388, 0x038a,
- 0x038c, 0x038c,
- 0x038e, 0x038f,
- 0x0391, 0x03a1,
- 0x03a3, 0x03ab,
- 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,
- 0x0500, 0x0500,
- 0x0502, 0x0502,
- 0x0504, 0x0504,
- 0x0506, 0x0506,
- 0x0508, 0x0508,
- 0x050a, 0x050a,
- 0x050c, 0x050c,
- 0x050e, 0x050e,
- 0x0531, 0x0556,
- 0x10a0, 0x10c5,
- 0x1e00, 0x1e00,
- 0x1e02, 0x1e02,
- 0x1e04, 0x1e04,
- 0x1e06, 0x1e06,
- 0x1e08, 0x1e08,
- 0x1e0a, 0x1e0a,
- 0x1e0c, 0x1e0c,
- 0x1e0e, 0x1e0e,
- 0x1e10, 0x1e10,
- 0x1e12, 0x1e12,
- 0x1e14, 0x1e14,
- 0x1e16, 0x1e16,
- 0x1e18, 0x1e18,
- 0x1e1a, 0x1e1a,
- 0x1e1c, 0x1e1c,
- 0x1e1e, 0x1e1e,
- 0x1e20, 0x1e20,
- 0x1e22, 0x1e22,
- 0x1e24, 0x1e24,
- 0x1e26, 0x1e26,
- 0x1e28, 0x1e28,
- 0x1e2a, 0x1e2a,
- 0x1e2c, 0x1e2c,
- 0x1e2e, 0x1e2e,
- 0x1e30, 0x1e30,
- 0x1e32, 0x1e32,
- 0x1e34, 0x1e34,
- 0x1e36, 0x1e36,
- 0x1e38, 0x1e38,
- 0x1e3a, 0x1e3a,
- 0x1e3c, 0x1e3c,
- 0x1e3e, 0x1e3e,
- 0x1e40, 0x1e40,
- 0x1e42, 0x1e42,
- 0x1e44, 0x1e44,
- 0x1e46, 0x1e46,
- 0x1e48, 0x1e48,
- 0x1e4a, 0x1e4a,
- 0x1e4c, 0x1e4c,
- 0x1e4e, 0x1e4e,
- 0x1e50, 0x1e50,
- 0x1e52, 0x1e52,
- 0x1e54, 0x1e54,
- 0x1e56, 0x1e56,
- 0x1e58, 0x1e58,
- 0x1e5a, 0x1e5a,
- 0x1e5c, 0x1e5c,
- 0x1e5e, 0x1e5e,
- 0x1e60, 0x1e60,
- 0x1e62, 0x1e62,
- 0x1e64, 0x1e64,
- 0x1e66, 0x1e66,
- 0x1e68, 0x1e68,
- 0x1e6a, 0x1e6a,
- 0x1e6c, 0x1e6c,
- 0x1e6e, 0x1e6e,
- 0x1e70, 0x1e70,
- 0x1e72, 0x1e72,
- 0x1e74, 0x1e74,
- 0x1e76, 0x1e76,
- 0x1e78, 0x1e78,
- 0x1e7a, 0x1e7a,
- 0x1e7c, 0x1e7c,
- 0x1e7e, 0x1e7e,
- 0x1e80, 0x1e80,
- 0x1e82, 0x1e82,
- 0x1e84, 0x1e84,
- 0x1e86, 0x1e86,
- 0x1e88, 0x1e88,
- 0x1e8a, 0x1e8a,
- 0x1e8c, 0x1e8c,
- 0x1e8e, 0x1e8e,
- 0x1e90, 0x1e90,
- 0x1e92, 0x1e92,
- 0x1e94, 0x1e94,
- 0x1ea0, 0x1ea0,
- 0x1ea2, 0x1ea2,
- 0x1ea4, 0x1ea4,
- 0x1ea6, 0x1ea6,
- 0x1ea8, 0x1ea8,
- 0x1eaa, 0x1eaa,
- 0x1eac, 0x1eac,
- 0x1eae, 0x1eae,
- 0x1eb0, 0x1eb0,
- 0x1eb2, 0x1eb2,
- 0x1eb4, 0x1eb4,
- 0x1eb6, 0x1eb6,
- 0x1eb8, 0x1eb8,
- 0x1eba, 0x1eba,
- 0x1ebc, 0x1ebc,
- 0x1ebe, 0x1ebe,
- 0x1ec0, 0x1ec0,
- 0x1ec2, 0x1ec2,
- 0x1ec4, 0x1ec4,
- 0x1ec6, 0x1ec6,
- 0x1ec8, 0x1ec8,
- 0x1eca, 0x1eca,
- 0x1ecc, 0x1ecc,
- 0x1ece, 0x1ece,
- 0x1ed0, 0x1ed0,
- 0x1ed2, 0x1ed2,
- 0x1ed4, 0x1ed4,
- 0x1ed6, 0x1ed6,
- 0x1ed8, 0x1ed8,
- 0x1eda, 0x1eda,
- 0x1edc, 0x1edc,
- 0x1ede, 0x1ede,
- 0x1ee0, 0x1ee0,
- 0x1ee2, 0x1ee2,
- 0x1ee4, 0x1ee4,
- 0x1ee6, 0x1ee6,
- 0x1ee8, 0x1ee8,
- 0x1eea, 0x1eea,
- 0x1eec, 0x1eec,
- 0x1eee, 0x1eee,
- 0x1ef0, 0x1ef0,
- 0x1ef2, 0x1ef2,
- 0x1ef4, 0x1ef4,
- 0x1ef6, 0x1ef6,
- 0x1ef8, 0x1ef8,
- 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, 0x2131,
- 0x2133, 0x2133,
- 0x213e, 0x213f,
- 0x2145, 0x2145,
- 0x2c00, 0x2c2e,
- 0x2c80, 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,
- 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
-}; /* CR_Lu */
-
-/* 'M': Major Category */
-static const OnigCodePoint CR_M[] = {
- 133,
- 0x0300, 0x036f,
- 0x0483, 0x0486,
- 0x0488, 0x0489,
- 0x0591, 0x05b9,
- 0x05bb, 0x05bd,
- 0x05bf, 0x05bf,
- 0x05c1, 0x05c2,
- 0x05c4, 0x05c5,
- 0x05c7, 0x05c7,
- 0x0610, 0x0615,
- 0x064b, 0x065e,
- 0x0670, 0x0670,
- 0x06d6, 0x06dc,
- 0x06de, 0x06e4,
- 0x06e7, 0x06e8,
- 0x06ea, 0x06ed,
- 0x0711, 0x0711,
- 0x0730, 0x074a,
- 0x07a6, 0x07b0,
- 0x0901, 0x0903,
- 0x093c, 0x093c,
- 0x093e, 0x094d,
- 0x0951, 0x0954,
- 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,
- 0x0a70, 0x0a71,
- 0x0a81, 0x0a83,
- 0x0abc, 0x0abc,
- 0x0abe, 0x0ac5,
- 0x0ac7, 0x0ac9,
- 0x0acb, 0x0acd,
- 0x0ae2, 0x0ae3,
- 0x0b01, 0x0b03,
- 0x0b3c, 0x0b3c,
- 0x0b3e, 0x0b43,
- 0x0b47, 0x0b48,
- 0x0b4b, 0x0b4d,
- 0x0b56, 0x0b57,
- 0x0b82, 0x0b82,
- 0x0bbe, 0x0bc2,
- 0x0bc6, 0x0bc8,
- 0x0bca, 0x0bcd,
- 0x0bd7, 0x0bd7,
- 0x0c01, 0x0c03,
- 0x0c3e, 0x0c44,
- 0x0c46, 0x0c48,
- 0x0c4a, 0x0c4d,
- 0x0c55, 0x0c56,
- 0x0c82, 0x0c83,
- 0x0cbc, 0x0cbc,
- 0x0cbe, 0x0cc4,
- 0x0cc6, 0x0cc8,
- 0x0cca, 0x0ccd,
- 0x0cd5, 0x0cd6,
- 0x0d02, 0x0d03,
- 0x0d3e, 0x0d43,
- 0x0d46, 0x0d48,
- 0x0d4a, 0x0d4d,
- 0x0d57, 0x0d57,
- 0x0d82, 0x0d83,
- 0x0dca, 0x0dca,
- 0x0dcf, 0x0dd4,
- 0x0dd6, 0x0dd6,
- 0x0dd8, 0x0ddf,
- 0x0df2, 0x0df3,
- 0x0e31, 0x0e31,
- 0x0e34, 0x0e3a,
- 0x0e47, 0x0e4e,
- 0x0eb1, 0x0eb1,
- 0x0eb4, 0x0eb9,
- 0x0ebb, 0x0ebc,
- 0x0ec8, 0x0ecd,
- 0x0f18, 0x0f19,
- 0x0f35, 0x0f35,
- 0x0f37, 0x0f37,
- 0x0f39, 0x0f39,
- 0x0f3e, 0x0f3f,
- 0x0f71, 0x0f84,
- 0x0f86, 0x0f87,
- 0x0f90, 0x0f97,
- 0x0f99, 0x0fbc,
- 0x0fc6, 0x0fc6,
- 0x102c, 0x1032,
- 0x1036, 0x1039,
- 0x1056, 0x1059,
- 0x135f, 0x135f,
- 0x1712, 0x1714,
- 0x1732, 0x1734,
- 0x1752, 0x1753,
- 0x1772, 0x1773,
- 0x17b6, 0x17d3,
- 0x17dd, 0x17dd,
- 0x180b, 0x180d,
- 0x18a9, 0x18a9,
- 0x1920, 0x192b,
- 0x1930, 0x193b,
- 0x19b0, 0x19c0,
- 0x19c8, 0x19c9,
- 0x1a17, 0x1a1b,
- 0x1dc0, 0x1dc3,
- 0x20d0, 0x20eb,
- 0x302a, 0x302f,
- 0x3099, 0x309a,
- 0xa802, 0xa802,
- 0xa806, 0xa806,
- 0xa80b, 0xa80b,
- 0xa823, 0xa827,
- 0xfb1e, 0xfb1e,
- 0xfe00, 0xfe0f,
- 0xfe20, 0xfe23,
- 0x10a01, 0x10a03,
- 0x10a05, 0x10a06,
- 0x10a0c, 0x10a0f,
- 0x10a38, 0x10a3a,
- 0x10a3f, 0x10a3f,
- 0x1d165, 0x1d169,
- 0x1d16d, 0x1d172,
- 0x1d17b, 0x1d182,
- 0x1d185, 0x1d18b,
- 0x1d1aa, 0x1d1ad,
- 0x1d242, 0x1d244,
- 0xe0100, 0xe01ef
-}; /* CR_M */
-
-/* 'Mc': General Category */
-static const OnigCodePoint CR_Mc[] = {
- 63,
- 0x0903, 0x0903,
- 0x093e, 0x0940,
- 0x0949, 0x094c,
- 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,
- 0x102c, 0x102c,
- 0x1031, 0x1031,
- 0x1038, 0x1038,
- 0x1056, 0x1057,
- 0x17b6, 0x17b6,
- 0x17be, 0x17c5,
- 0x17c7, 0x17c8,
- 0x1923, 0x1926,
- 0x1929, 0x192b,
- 0x1930, 0x1931,
- 0x1933, 0x1938,
- 0x19b0, 0x19c0,
- 0x19c8, 0x19c9,
- 0x1a19, 0x1a1b,
- 0xa802, 0xa802,
- 0xa823, 0xa824,
- 0xa827, 0xa827,
- 0x1d165, 0x1d166,
- 0x1d16d, 0x1d172
-}; /* CR_Mc */
-
-/* 'Me': General Category */
-static const OnigCodePoint CR_Me[] = {
- 4,
- 0x0488, 0x0489,
- 0x06de, 0x06de,
- 0x20dd, 0x20e0,
- 0x20e2, 0x20e4
-}; /* CR_Me */
-
-/* 'Mn': General Category */
-static const OnigCodePoint CR_Mn[] = {
- 124,
- 0x0300, 0x036f,
- 0x0483, 0x0486,
- 0x0591, 0x05b9,
- 0x05bb, 0x05bd,
- 0x05bf, 0x05bf,
- 0x05c1, 0x05c2,
- 0x05c4, 0x05c5,
- 0x05c7, 0x05c7,
- 0x0610, 0x0615,
- 0x064b, 0x065e,
- 0x0670, 0x0670,
- 0x06d6, 0x06dc,
- 0x06df, 0x06e4,
- 0x06e7, 0x06e8,
- 0x06ea, 0x06ed,
- 0x0711, 0x0711,
- 0x0730, 0x074a,
- 0x07a6, 0x07b0,
- 0x0901, 0x0902,
- 0x093c, 0x093c,
- 0x0941, 0x0948,
- 0x094d, 0x094d,
- 0x0951, 0x0954,
- 0x0962, 0x0963,
- 0x0981, 0x0981,
- 0x09bc, 0x09bc,
- 0x09c1, 0x09c4,
- 0x09cd, 0x09cd,
- 0x09e2, 0x09e3,
- 0x0a01, 0x0a02,
- 0x0a3c, 0x0a3c,
- 0x0a41, 0x0a42,
- 0x0a47, 0x0a48,
- 0x0a4b, 0x0a4d,
- 0x0a70, 0x0a71,
- 0x0a81, 0x0a82,
- 0x0abc, 0x0abc,
- 0x0ac1, 0x0ac5,
- 0x0ac7, 0x0ac8,
- 0x0acd, 0x0acd,
- 0x0ae2, 0x0ae3,
- 0x0b01, 0x0b01,
- 0x0b3c, 0x0b3c,
- 0x0b3f, 0x0b3f,
- 0x0b41, 0x0b43,
- 0x0b4d, 0x0b4d,
- 0x0b56, 0x0b56,
- 0x0b82, 0x0b82,
- 0x0bc0, 0x0bc0,
- 0x0bcd, 0x0bcd,
- 0x0c3e, 0x0c40,
- 0x0c46, 0x0c48,
- 0x0c4a, 0x0c4d,
- 0x0c55, 0x0c56,
- 0x0cbc, 0x0cbc,
- 0x0cbf, 0x0cbf,
- 0x0cc6, 0x0cc6,
- 0x0ccc, 0x0ccd,
- 0x0d41, 0x0d43,
- 0x0d4d, 0x0d4d,
- 0x0dca, 0x0dca,
- 0x0dd2, 0x0dd4,
- 0x0dd6, 0x0dd6,
- 0x0e31, 0x0e31,
- 0x0e34, 0x0e3a,
- 0x0e47, 0x0e4e,
- 0x0eb1, 0x0eb1,
- 0x0eb4, 0x0eb9,
- 0x0ebb, 0x0ebc,
- 0x0ec8, 0x0ecd,
- 0x0f18, 0x0f19,
- 0x0f35, 0x0f35,
- 0x0f37, 0x0f37,
- 0x0f39, 0x0f39,
- 0x0f71, 0x0f7e,
- 0x0f80, 0x0f84,
- 0x0f86, 0x0f87,
- 0x0f90, 0x0f97,
- 0x0f99, 0x0fbc,
- 0x0fc6, 0x0fc6,
- 0x102d, 0x1030,
- 0x1032, 0x1032,
- 0x1036, 0x1037,
- 0x1039, 0x1039,
- 0x1058, 0x1059,
- 0x135f, 0x135f,
- 0x1712, 0x1714,
- 0x1732, 0x1734,
- 0x1752, 0x1753,
- 0x1772, 0x1773,
- 0x17b7, 0x17bd,
- 0x17c6, 0x17c6,
- 0x17c9, 0x17d3,
- 0x17dd, 0x17dd,
- 0x180b, 0x180d,
- 0x18a9, 0x18a9,
- 0x1920, 0x1922,
- 0x1927, 0x1928,
- 0x1932, 0x1932,
- 0x1939, 0x193b,
- 0x1a17, 0x1a18,
- 0x1dc0, 0x1dc3,
- 0x20d0, 0x20dc,
- 0x20e1, 0x20e1,
- 0x20e5, 0x20eb,
- 0x302a, 0x302f,
- 0x3099, 0x309a,
- 0xa806, 0xa806,
- 0xa80b, 0xa80b,
- 0xa825, 0xa826,
- 0xfb1e, 0xfb1e,
- 0xfe00, 0xfe0f,
- 0xfe20, 0xfe23,
- 0x10a01, 0x10a03,
- 0x10a05, 0x10a06,
- 0x10a0c, 0x10a0f,
- 0x10a38, 0x10a3a,
- 0x10a3f, 0x10a3f,
- 0x1d167, 0x1d169,
- 0x1d17b, 0x1d182,
- 0x1d185, 0x1d18b,
- 0x1d1aa, 0x1d1ad,
- 0x1d242, 0x1d244,
- 0xe0100, 0xe01ef
-}; /* CR_Mn */
-
-/* 'N': Major Category */
-static const OnigCodePoint CR_N[] = {
- 53,
- 0x0030, 0x0039,
- 0x00b2, 0x00b3,
- 0x00b9, 0x00b9,
- 0x00bc, 0x00be,
- 0x0660, 0x0669,
- 0x06f0, 0x06f9,
- 0x0966, 0x096f,
- 0x09e6, 0x09ef,
- 0x09f4, 0x09f9,
- 0x0a66, 0x0a6f,
- 0x0ae6, 0x0aef,
- 0x0b66, 0x0b6f,
- 0x0be6, 0x0bf2,
- 0x0c66, 0x0c6f,
- 0x0ce6, 0x0cef,
- 0x0d66, 0x0d6f,
- 0x0e50, 0x0e59,
- 0x0ed0, 0x0ed9,
- 0x0f20, 0x0f33,
- 0x1040, 0x1049,
- 0x1369, 0x137c,
- 0x16ee, 0x16f0,
- 0x17e0, 0x17e9,
- 0x17f0, 0x17f9,
- 0x1810, 0x1819,
- 0x1946, 0x194f,
- 0x19d0, 0x19d9,
- 0x2070, 0x2070,
- 0x2074, 0x2079,
- 0x2080, 0x2089,
- 0x2153, 0x2183,
- 0x2460, 0x249b,
- 0x24ea, 0x24ff,
- 0x2776, 0x2793,
- 0x2cfd, 0x2cfd,
- 0x3007, 0x3007,
- 0x3021, 0x3029,
- 0x3038, 0x303a,
- 0x3192, 0x3195,
- 0x3220, 0x3229,
- 0x3251, 0x325f,
- 0x3280, 0x3289,
- 0x32b1, 0x32bf,
- 0xff10, 0xff19,
- 0x10107, 0x10133,
- 0x10140, 0x10178,
- 0x1018a, 0x1018a,
- 0x10320, 0x10323,
- 0x1034a, 0x1034a,
- 0x103d1, 0x103d5,
- 0x104a0, 0x104a9,
- 0x10a40, 0x10a47,
- 0x1d7ce, 0x1d7ff
-}; /* CR_N */
-
-/* 'Nd': General Category */
-static const OnigCodePoint CR_Nd[] = {
- 23,
- 0x0030, 0x0039,
- 0x0660, 0x0669,
- 0x06f0, 0x06f9,
- 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,
- 0x17e0, 0x17e9,
- 0x1810, 0x1819,
- 0x1946, 0x194f,
- 0x19d0, 0x19d9,
- 0xff10, 0xff19,
- 0x104a0, 0x104a9,
- 0x1d7ce, 0x1d7ff
-}; /* CR_Nd */
-
-/* 'Nl': General Category */
-static const OnigCodePoint CR_Nl[] = {
- 8,
- 0x16ee, 0x16f0,
- 0x2160, 0x2183,
- 0x3007, 0x3007,
- 0x3021, 0x3029,
- 0x3038, 0x303a,
- 0x10140, 0x10174,
- 0x1034a, 0x1034a,
- 0x103d1, 0x103d5
-}; /* CR_Nl */
-
-/* 'No': General Category */
-static const OnigCodePoint CR_No[] = {
- 26,
- 0x00b2, 0x00b3,
- 0x00b9, 0x00b9,
- 0x00bc, 0x00be,
- 0x09f4, 0x09f9,
- 0x0bf0, 0x0bf2,
- 0x0f2a, 0x0f33,
- 0x1369, 0x137c,
- 0x17f0, 0x17f9,
- 0x2070, 0x2070,
- 0x2074, 0x2079,
- 0x2080, 0x2089,
- 0x2153, 0x215f,
- 0x2460, 0x249b,
- 0x24ea, 0x24ff,
- 0x2776, 0x2793,
- 0x2cfd, 0x2cfd,
- 0x3192, 0x3195,
- 0x3220, 0x3229,
- 0x3251, 0x325f,
- 0x3280, 0x3289,
- 0x32b1, 0x32bf,
- 0x10107, 0x10133,
- 0x10175, 0x10178,
- 0x1018a, 0x1018a,
- 0x10320, 0x10323,
- 0x10a40, 0x10a47
-}; /* CR_No */
-
-/* 'P': Major Category */
-static const OnigCodePoint CR_P[] = {
- 96,
- 0x0021, 0x0023,
- 0x0025, 0x002a,
- 0x002c, 0x002f,
- 0x003a, 0x003b,
- 0x003f, 0x0040,
- 0x005b, 0x005d,
- 0x005f, 0x005f,
- 0x007b, 0x007b,
- 0x007d, 0x007d,
- 0x00a1, 0x00a1,
- 0x00ab, 0x00ab,
- 0x00b7, 0x00b7,
- 0x00bb, 0x00bb,
- 0x00bf, 0x00bf,
- 0x037e, 0x037e,
- 0x0387, 0x0387,
- 0x055a, 0x055f,
- 0x0589, 0x058a,
- 0x05be, 0x05be,
- 0x05c0, 0x05c0,
- 0x05c3, 0x05c3,
- 0x05c6, 0x05c6,
- 0x05f3, 0x05f4,
- 0x060c, 0x060d,
- 0x061b, 0x061b,
- 0x061e, 0x061f,
- 0x066a, 0x066d,
- 0x06d4, 0x06d4,
- 0x0700, 0x070d,
- 0x0964, 0x0965,
- 0x0970, 0x0970,
- 0x0df4, 0x0df4,
- 0x0e4f, 0x0e4f,
- 0x0e5a, 0x0e5b,
- 0x0f04, 0x0f12,
- 0x0f3a, 0x0f3d,
- 0x0f85, 0x0f85,
- 0x0fd0, 0x0fd1,
- 0x104a, 0x104f,
- 0x10fb, 0x10fb,
- 0x1361, 0x1368,
- 0x166d, 0x166e,
- 0x169b, 0x169c,
- 0x16eb, 0x16ed,
- 0x1735, 0x1736,
- 0x17d4, 0x17d6,
- 0x17d8, 0x17da,
- 0x1800, 0x180a,
- 0x1944, 0x1945,
- 0x19de, 0x19df,
- 0x1a1e, 0x1a1f,
- 0x2010, 0x2027,
- 0x2030, 0x2043,
- 0x2045, 0x2051,
- 0x2053, 0x205e,
- 0x207d, 0x207e,
- 0x208d, 0x208e,
- 0x2329, 0x232a,
- 0x23b4, 0x23b6,
- 0x2768, 0x2775,
- 0x27c5, 0x27c6,
- 0x27e6, 0x27eb,
- 0x2983, 0x2998,
- 0x29d8, 0x29db,
- 0x29fc, 0x29fd,
- 0x2cf9, 0x2cfc,
- 0x2cfe, 0x2cff,
- 0x2e00, 0x2e17,
- 0x2e1c, 0x2e1d,
- 0x3001, 0x3003,
- 0x3008, 0x3011,
- 0x3014, 0x301f,
- 0x3030, 0x3030,
- 0x303d, 0x303d,
- 0x30a0, 0x30a0,
- 0x30fb, 0x30fb,
- 0xfd3e, 0xfd3f,
- 0xfe10, 0xfe19,
- 0xfe30, 0xfe52,
- 0xfe54, 0xfe61,
- 0xfe63, 0xfe63,
- 0xfe68, 0xfe68,
- 0xfe6a, 0xfe6b,
- 0xff01, 0xff03,
- 0xff05, 0xff0a,
- 0xff0c, 0xff0f,
- 0xff1a, 0xff1b,
- 0xff1f, 0xff20,
- 0xff3b, 0xff3d,
- 0xff3f, 0xff3f,
- 0xff5b, 0xff5b,
- 0xff5d, 0xff5d,
- 0xff5f, 0xff65,
- 0x10100, 0x10101,
- 0x1039f, 0x1039f,
- 0x10a50, 0x10a58
-}; /* CR_P */
-
-/* '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[] = {
- 12,
- 0x002d, 0x002d,
- 0x058a, 0x058a,
- 0x1806, 0x1806,
- 0x2010, 0x2015,
- 0x2e17, 0x2e17,
- 0x301c, 0x301c,
- 0x3030, 0x3030,
- 0x30a0, 0x30a0,
- 0xfe31, 0xfe32,
- 0xfe58, 0xfe58,
- 0xfe63, 0xfe63,
- 0xff0d, 0xff0d
-}; /* CR_Pd */
-
-/* 'Pe': General Category */
-static const OnigCodePoint CR_Pe[] = {
- 65,
- 0x0029, 0x0029,
- 0x005d, 0x005d,
- 0x007d, 0x007d,
- 0x0f3b, 0x0f3b,
- 0x0f3d, 0x0f3d,
- 0x169c, 0x169c,
- 0x2046, 0x2046,
- 0x207e, 0x207e,
- 0x208e, 0x208e,
- 0x232a, 0x232a,
- 0x23b5, 0x23b5,
- 0x2769, 0x2769,
- 0x276b, 0x276b,
- 0x276d, 0x276d,
- 0x276f, 0x276f,
- 0x2771, 0x2771,
- 0x2773, 0x2773,
- 0x2775, 0x2775,
- 0x27c6, 0x27c6,
- 0x27e7, 0x27e7,
- 0x27e9, 0x27e9,
- 0x27eb, 0x27eb,
- 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,
- 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[] = {
- 9,
- 0x00bb, 0x00bb,
- 0x2019, 0x2019,
- 0x201d, 0x201d,
- 0x203a, 0x203a,
- 0x2e03, 0x2e03,
- 0x2e05, 0x2e05,
- 0x2e0a, 0x2e0a,
- 0x2e0d, 0x2e0d,
- 0x2e1d, 0x2e1d
-}; /* CR_Pf */
-
-/* 'Pi': General Category */
-static const OnigCodePoint CR_Pi[] = {
- 10,
- 0x00ab, 0x00ab,
- 0x2018, 0x2018,
- 0x201b, 0x201c,
- 0x201f, 0x201f,
- 0x2039, 0x2039,
- 0x2e02, 0x2e02,
- 0x2e04, 0x2e04,
- 0x2e09, 0x2e09,
- 0x2e0c, 0x2e0c,
- 0x2e1c, 0x2e1c
-}; /* CR_Pi */
-
-/* 'Po': General Category */
-static const OnigCodePoint CR_Po[] = {
- 88,
- 0x0021, 0x0023,
- 0x0025, 0x0027,
- 0x002a, 0x002a,
- 0x002c, 0x002c,
- 0x002e, 0x002f,
- 0x003a, 0x003b,
- 0x003f, 0x0040,
- 0x005c, 0x005c,
- 0x00a1, 0x00a1,
- 0x00b7, 0x00b7,
- 0x00bf, 0x00bf,
- 0x037e, 0x037e,
- 0x0387, 0x0387,
- 0x055a, 0x055f,
- 0x0589, 0x0589,
- 0x05be, 0x05be,
- 0x05c0, 0x05c0,
- 0x05c3, 0x05c3,
- 0x05c6, 0x05c6,
- 0x05f3, 0x05f4,
- 0x060c, 0x060d,
- 0x061b, 0x061b,
- 0x061e, 0x061f,
- 0x066a, 0x066d,
- 0x06d4, 0x06d4,
- 0x0700, 0x070d,
- 0x0964, 0x0965,
- 0x0970, 0x0970,
- 0x0df4, 0x0df4,
- 0x0e4f, 0x0e4f,
- 0x0e5a, 0x0e5b,
- 0x0f04, 0x0f12,
- 0x0f85, 0x0f85,
- 0x0fd0, 0x0fd1,
- 0x104a, 0x104f,
- 0x10fb, 0x10fb,
- 0x1361, 0x1368,
- 0x166d, 0x166e,
- 0x16eb, 0x16ed,
- 0x1735, 0x1736,
- 0x17d4, 0x17d6,
- 0x17d8, 0x17da,
- 0x1800, 0x1805,
- 0x1807, 0x180a,
- 0x1944, 0x1945,
- 0x19de, 0x19df,
- 0x1a1e, 0x1a1f,
- 0x2016, 0x2017,
- 0x2020, 0x2027,
- 0x2030, 0x2038,
- 0x203b, 0x203e,
- 0x2041, 0x2043,
- 0x2047, 0x2051,
- 0x2053, 0x2053,
- 0x2055, 0x205e,
- 0x23b6, 0x23b6,
- 0x2cf9, 0x2cfc,
- 0x2cfe, 0x2cff,
- 0x2e00, 0x2e01,
- 0x2e06, 0x2e08,
- 0x2e0b, 0x2e0b,
- 0x2e0e, 0x2e16,
- 0x3001, 0x3003,
- 0x303d, 0x303d,
- 0x30fb, 0x30fb,
- 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, 0x10101,
- 0x1039f, 0x1039f,
- 0x10a50, 0x10a58
-}; /* CR_Po */
-
-/* 'Ps': General Category */
-static const OnigCodePoint CR_Ps[] = {
- 67,
- 0x0028, 0x0028,
- 0x005b, 0x005b,
- 0x007b, 0x007b,
- 0x0f3a, 0x0f3a,
- 0x0f3c, 0x0f3c,
- 0x169b, 0x169b,
- 0x201a, 0x201a,
- 0x201e, 0x201e,
- 0x2045, 0x2045,
- 0x207d, 0x207d,
- 0x208d, 0x208d,
- 0x2329, 0x2329,
- 0x23b4, 0x23b4,
- 0x2768, 0x2768,
- 0x276a, 0x276a,
- 0x276c, 0x276c,
- 0x276e, 0x276e,
- 0x2770, 0x2770,
- 0x2772, 0x2772,
- 0x2774, 0x2774,
- 0x27c5, 0x27c5,
- 0x27e6, 0x27e6,
- 0x27e8, 0x27e8,
- 0x27ea, 0x27ea,
- 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,
- 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[] = {
- 162,
- 0x0024, 0x0024,
- 0x002b, 0x002b,
- 0x003c, 0x003e,
- 0x005e, 0x005e,
- 0x0060, 0x0060,
- 0x007c, 0x007c,
- 0x007e, 0x007e,
- 0x00a2, 0x00a9,
- 0x00ac, 0x00ac,
- 0x00ae, 0x00b1,
- 0x00b4, 0x00b4,
- 0x00b6, 0x00b6,
- 0x00b8, 0x00b8,
- 0x00d7, 0x00d7,
- 0x00f7, 0x00f7,
- 0x02c2, 0x02c5,
- 0x02d2, 0x02df,
- 0x02e5, 0x02ed,
- 0x02ef, 0x02ff,
- 0x0374, 0x0375,
- 0x0384, 0x0385,
- 0x03f6, 0x03f6,
- 0x0482, 0x0482,
- 0x060b, 0x060b,
- 0x060e, 0x060f,
- 0x06e9, 0x06e9,
- 0x06fd, 0x06fe,
- 0x09f2, 0x09f3,
- 0x09fa, 0x09fa,
- 0x0af1, 0x0af1,
- 0x0b70, 0x0b70,
- 0x0bf3, 0x0bfa,
- 0x0e3f, 0x0e3f,
- 0x0f01, 0x0f03,
- 0x0f13, 0x0f17,
- 0x0f1a, 0x0f1f,
- 0x0f34, 0x0f34,
- 0x0f36, 0x0f36,
- 0x0f38, 0x0f38,
- 0x0fbe, 0x0fc5,
- 0x0fc7, 0x0fcc,
- 0x0fcf, 0x0fcf,
- 0x1360, 0x1360,
- 0x1390, 0x1399,
- 0x17db, 0x17db,
- 0x1940, 0x1940,
- 0x19e0, 0x19ff,
- 0x1fbd, 0x1fbd,
- 0x1fbf, 0x1fc1,
- 0x1fcd, 0x1fcf,
- 0x1fdd, 0x1fdf,
- 0x1fed, 0x1fef,
- 0x1ffd, 0x1ffe,
- 0x2044, 0x2044,
- 0x2052, 0x2052,
- 0x207a, 0x207c,
- 0x208a, 0x208c,
- 0x20a0, 0x20b5,
- 0x2100, 0x2101,
- 0x2103, 0x2106,
- 0x2108, 0x2109,
- 0x2114, 0x2114,
- 0x2116, 0x2118,
- 0x211e, 0x2123,
- 0x2125, 0x2125,
- 0x2127, 0x2127,
- 0x2129, 0x2129,
- 0x212e, 0x212e,
- 0x2132, 0x2132,
- 0x213a, 0x213b,
- 0x2140, 0x2144,
- 0x214a, 0x214c,
- 0x2190, 0x2328,
- 0x232b, 0x23b3,
- 0x23b7, 0x23db,
- 0x2400, 0x2426,
- 0x2440, 0x244a,
- 0x249c, 0x24e9,
- 0x2500, 0x269c,
- 0x26a0, 0x26b1,
- 0x2701, 0x2704,
- 0x2706, 0x2709,
- 0x270c, 0x2727,
- 0x2729, 0x274b,
- 0x274d, 0x274d,
- 0x274f, 0x2752,
- 0x2756, 0x2756,
- 0x2758, 0x275e,
- 0x2761, 0x2767,
- 0x2794, 0x2794,
- 0x2798, 0x27af,
- 0x27b1, 0x27be,
- 0x27c0, 0x27c4,
- 0x27d0, 0x27e5,
- 0x27f0, 0x2982,
- 0x2999, 0x29d7,
- 0x29dc, 0x29fb,
- 0x29fe, 0x2b13,
- 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, 0x31cf,
- 0x3200, 0x321e,
- 0x322a, 0x3243,
- 0x3250, 0x3250,
- 0x3260, 0x327f,
- 0x328a, 0x32b0,
- 0x32c0, 0x32fe,
- 0x3300, 0x33ff,
- 0x4dc0, 0x4dff,
- 0xa490, 0xa4c6,
- 0xa700, 0xa716,
- 0xa828, 0xa82b,
- 0xfb29, 0xfb29,
- 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,
- 0x10102, 0x10102,
- 0x10137, 0x1013f,
- 0x10179, 0x10189,
- 0x103d0, 0x103d0,
- 0x1d000, 0x1d0f5,
- 0x1d100, 0x1d126,
- 0x1d12a, 0x1d164,
- 0x1d16a, 0x1d16c,
- 0x1d183, 0x1d184,
- 0x1d18c, 0x1d1a9,
- 0x1d1ae, 0x1d1dd,
- 0x1d200, 0x1d241,
- 0x1d245, 0x1d245,
- 0x1d300, 0x1d356,
- 0x1d6c1, 0x1d6c1,
- 0x1d6db, 0x1d6db,
- 0x1d6fb, 0x1d6fb,
- 0x1d715, 0x1d715,
- 0x1d735, 0x1d735,
- 0x1d74f, 0x1d74f,
- 0x1d76f, 0x1d76f,
- 0x1d789, 0x1d789,
- 0x1d7a9, 0x1d7a9,
- 0x1d7c3, 0x1d7c3
-}; /* CR_S */
-
-/* 'Sc': General Category */
-static const OnigCodePoint CR_Sc[] = {
- 14,
- 0x0024, 0x0024,
- 0x00a2, 0x00a5,
- 0x060b, 0x060b,
- 0x09f2, 0x09f3,
- 0x0af1, 0x0af1,
- 0x0bf9, 0x0bf9,
- 0x0e3f, 0x0e3f,
- 0x17db, 0x17db,
- 0x20a0, 0x20b5,
- 0xfdfc, 0xfdfc,
- 0xfe69, 0xfe69,
- 0xff04, 0xff04,
- 0xffe0, 0xffe1,
- 0xffe5, 0xffe6
-}; /* CR_Sc */
-
-/* 'Sk': General Category */
-static const OnigCodePoint CR_Sk[] = {
- 23,
- 0x005e, 0x005e,
- 0x0060, 0x0060,
- 0x00a8, 0x00a8,
- 0x00af, 0x00af,
- 0x00b4, 0x00b4,
- 0x00b8, 0x00b8,
- 0x02c2, 0x02c5,
- 0x02d2, 0x02df,
- 0x02e5, 0x02ed,
- 0x02ef, 0x02ff,
- 0x0374, 0x0375,
- 0x0384, 0x0385,
- 0x1fbd, 0x1fbd,
- 0x1fbf, 0x1fc1,
- 0x1fcd, 0x1fcf,
- 0x1fdd, 0x1fdf,
- 0x1fed, 0x1fef,
- 0x1ffd, 0x1ffe,
- 0x309b, 0x309c,
- 0xa700, 0xa716,
- 0xff3e, 0xff3e,
- 0xff40, 0xff40,
- 0xffe3, 0xffe3
-}; /* CR_Sk */
-
-/* 'Sm': General Category */
-static const OnigCodePoint CR_Sm[] = {
- 59,
- 0x002b, 0x002b,
- 0x003c, 0x003e,
- 0x007c, 0x007c,
- 0x007e, 0x007e,
- 0x00ac, 0x00ac,
- 0x00b1, 0x00b1,
- 0x00d7, 0x00d7,
- 0x00f7, 0x00f7,
- 0x03f6, 0x03f6,
- 0x2044, 0x2044,
- 0x2052, 0x2052,
- 0x207a, 0x207c,
- 0x208a, 0x208c,
- 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,
- 0x25b7, 0x25b7,
- 0x25c1, 0x25c1,
- 0x25f8, 0x25ff,
- 0x266f, 0x266f,
- 0x27c0, 0x27c4,
- 0x27d0, 0x27e5,
- 0x27f0, 0x27ff,
- 0x2900, 0x2982,
- 0x2999, 0x29d7,
- 0x29dc, 0x29fb,
- 0x29fe, 0x2aff,
- 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
-}; /* CR_Sm */
-
-/* 'So': General Category */
-static const OnigCodePoint CR_So[] = {
- 120,
- 0x00a6, 0x00a7,
- 0x00a9, 0x00a9,
- 0x00ae, 0x00ae,
- 0x00b0, 0x00b0,
- 0x00b6, 0x00b6,
- 0x0482, 0x0482,
- 0x060e, 0x060f,
- 0x06e9, 0x06e9,
- 0x06fd, 0x06fe,
- 0x09fa, 0x09fa,
- 0x0b70, 0x0b70,
- 0x0bf3, 0x0bf8,
- 0x0bfa, 0x0bfa,
- 0x0f01, 0x0f03,
- 0x0f13, 0x0f17,
- 0x0f1a, 0x0f1f,
- 0x0f34, 0x0f34,
- 0x0f36, 0x0f36,
- 0x0f38, 0x0f38,
- 0x0fbe, 0x0fc5,
- 0x0fc7, 0x0fcc,
- 0x0fcf, 0x0fcf,
- 0x1360, 0x1360,
- 0x1390, 0x1399,
- 0x1940, 0x1940,
- 0x19e0, 0x19ff,
- 0x2100, 0x2101,
- 0x2103, 0x2106,
- 0x2108, 0x2109,
- 0x2114, 0x2114,
- 0x2116, 0x2118,
- 0x211e, 0x2123,
- 0x2125, 0x2125,
- 0x2127, 0x2127,
- 0x2129, 0x2129,
- 0x212e, 0x212e,
- 0x2132, 0x2132,
- 0x213a, 0x213b,
- 0x214a, 0x214a,
- 0x214c, 0x214c,
- 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,
- 0x23b7, 0x23db,
- 0x2400, 0x2426,
- 0x2440, 0x244a,
- 0x249c, 0x24e9,
- 0x2500, 0x25b6,
- 0x25b8, 0x25c0,
- 0x25c2, 0x25f7,
- 0x2600, 0x266e,
- 0x2670, 0x269c,
- 0x26a0, 0x26b1,
- 0x2701, 0x2704,
- 0x2706, 0x2709,
- 0x270c, 0x2727,
- 0x2729, 0x274b,
- 0x274d, 0x274d,
- 0x274f, 0x2752,
- 0x2756, 0x2756,
- 0x2758, 0x275e,
- 0x2761, 0x2767,
- 0x2794, 0x2794,
- 0x2798, 0x27af,
- 0x27b1, 0x27be,
- 0x2800, 0x28ff,
- 0x2b00, 0x2b13,
- 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, 0x31cf,
- 0x3200, 0x321e,
- 0x322a, 0x3243,
- 0x3250, 0x3250,
- 0x3260, 0x327f,
- 0x328a, 0x32b0,
- 0x32c0, 0x32fe,
- 0x3300, 0x33ff,
- 0x4dc0, 0x4dff,
- 0xa490, 0xa4c6,
- 0xa828, 0xa82b,
- 0xfdfd, 0xfdfd,
- 0xffe4, 0xffe4,
- 0xffe8, 0xffe8,
- 0xffed, 0xffee,
- 0xfffc, 0xfffd,
- 0x10102, 0x10102,
- 0x10137, 0x1013f,
- 0x10179, 0x10189,
- 0x103d0, 0x103d0,
- 0x1d000, 0x1d0f5,
- 0x1d100, 0x1d126,
- 0x1d12a, 0x1d164,
- 0x1d16a, 0x1d16c,
- 0x1d183, 0x1d184,
- 0x1d18c, 0x1d1a9,
- 0x1d1ae, 0x1d1dd,
- 0x1d200, 0x1d241,
- 0x1d245, 0x1d245,
- 0x1d300, 0x1d356
-}; /* 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 */
-
-/* 'Arabic': Script */
-static const OnigCodePoint CR_Arabic[] = {
- 17,
- 0x060b, 0x060b,
- 0x060d, 0x0615,
- 0x061e, 0x061e,
- 0x0621, 0x063a,
- 0x0641, 0x064a,
- 0x0656, 0x065e,
- 0x066a, 0x066f,
- 0x0671, 0x06dc,
- 0x06de, 0x06ff,
- 0x0750, 0x076d,
- 0xfb50, 0xfbb1,
- 0xfbd3, 0xfd3d,
- 0xfd50, 0xfd8f,
- 0xfd92, 0xfdc7,
- 0xfdf0, 0xfdfc,
- 0xfe70, 0xfe74,
- 0xfe76, 0xfefc
-}; /* CR_Arabic */
-
-/* 'Armenian': Script */
-static const OnigCodePoint CR_Armenian[] = {
- 5,
- 0x0531, 0x0556,
- 0x0559, 0x055f,
- 0x0561, 0x0587,
- 0x058a, 0x058a,
- 0xfb13, 0xfb17
-}; /* CR_Armenian */
-
-/* '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, 0x09fa
-}; /* CR_Bengali */
-
-/* 'Bopomofo': Script */
-static const OnigCodePoint CR_Bopomofo[] = {
- 2,
- 0x3105, 0x312c,
- 0x31a0, 0x31b7
-}; /* CR_Bopomofo */
-
-/* '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 */
-
-/* 'Buhid': Script */
-static const OnigCodePoint CR_Buhid[] = {
- 1,
- 0x1740, 0x1753
-}; /* CR_Buhid */
-
-/* 'Canadian_Aboriginal': Script */
-static const OnigCodePoint CR_Canadian_Aboriginal[] = {
- 1,
- 0x1401, 0x1676
-}; /* CR_Canadian_Aboriginal */
-
-/* 'Cherokee': Script */
-static const OnigCodePoint CR_Cherokee[] = {
- 1,
- 0x13a0, 0x13f4
-}; /* CR_Cherokee */
-
-/* 'Common': Script */
-static const OnigCodePoint CR_Common[] = {
- 126,
- 0x0000, 0x0040,
- 0x005b, 0x0060,
- 0x007b, 0x00a9,
- 0x00ab, 0x00b9,
- 0x00bb, 0x00bf,
- 0x00d7, 0x00d7,
- 0x00f7, 0x00f7,
- 0x02b9, 0x02df,
- 0x02e5, 0x02ff,
- 0x037e, 0x037e,
- 0x0387, 0x0387,
- 0x0589, 0x0589,
- 0x0600, 0x0603,
- 0x060c, 0x060c,
- 0x061b, 0x061b,
- 0x061f, 0x061f,
- 0x0640, 0x0640,
- 0x0660, 0x0669,
- 0x06dd, 0x06dd,
- 0x0964, 0x0965,
- 0x0970, 0x0970,
- 0x0e3f, 0x0e3f,
- 0x10fb, 0x10fb,
- 0x16eb, 0x16ed,
- 0x1735, 0x1736,
- 0x2000, 0x200b,
- 0x200e, 0x2063,
- 0x206a, 0x2070,
- 0x2074, 0x207e,
- 0x2080, 0x208e,
- 0x20a0, 0x20b5,
- 0x2100, 0x2125,
- 0x2127, 0x2129,
- 0x212c, 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, 0x27ff,
- 0x2900, 0x2b13,
- 0x2e00, 0x2e17,
- 0x2e1c, 0x2e1d,
- 0x2ff0, 0x2ffb,
- 0x3000, 0x3004,
- 0x3006, 0x3006,
- 0x3008, 0x3020,
- 0x3030, 0x3037,
- 0x303c, 0x303f,
- 0x309b, 0x309c,
- 0x30a0, 0x30a0,
- 0x30fb, 0x30fc,
- 0x3190, 0x319f,
- 0x31c0, 0x31cf,
- 0x3220, 0x3243,
- 0x3250, 0x325f,
- 0x327e, 0x32fe,
- 0x3300, 0x33ff,
- 0x4dc0, 0x4dff,
- 0xa700, 0xa716,
- 0xe000, 0xf8ff,
- 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,
- 0x1d000, 0x1d0f5,
- 0x1d100, 0x1d126,
- 0x1d12a, 0x1d166,
- 0x1d16a, 0x1d17a,
- 0x1d183, 0x1d184,
- 0x1d18c, 0x1d1a9,
- 0x1d1ae, 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, 0x1d6a5,
- 0x1d6a8, 0x1d7c9,
- 0x1d7ce, 0x1d7ff,
- 0xe0001, 0xe0001,
- 0xe0020, 0xe007f,
- 0xf0000, 0xffffd,
- 0x100000, 0x10fffd
-}; /* CR_Common */
-
-/* 'Coptic': Script */
-static const OnigCodePoint CR_Coptic[] = {
- 3,
- 0x03e2, 0x03ef,
- 0x2c80, 0x2cea,
- 0x2cf9, 0x2cff
-}; /* CR_Coptic */
-
-/* 'Cypriot': Script */
-static const OnigCodePoint CR_Cypriot[] = {
- 6,
- 0x10800, 0x10805,
- 0x10808, 0x10808,
- 0x1080a, 0x10835,
- 0x10837, 0x10838,
- 0x1083c, 0x1083c,
- 0x1083f, 0x1083f
-}; /* CR_Cypriot */
-
-/* 'Cyrillic': Script */
-static const OnigCodePoint CR_Cyrillic[] = {
- 6,
- 0x0400, 0x0486,
- 0x0488, 0x04ce,
- 0x04d0, 0x04f9,
- 0x0500, 0x050f,
- 0x1d2b, 0x1d2b,
- 0x1d78, 0x1d78
-}; /* CR_Cyrillic */
-
-/* 'Deseret': Script */
-static const OnigCodePoint CR_Deseret[] = {
- 1,
- 0x10400, 0x1044f
-}; /* CR_Deseret */
-
-/* 'Devanagari': Script */
-static const OnigCodePoint CR_Devanagari[] = {
- 6,
- 0x0901, 0x0939,
- 0x093c, 0x094d,
- 0x0950, 0x0954,
- 0x0958, 0x0963,
- 0x0966, 0x096f,
- 0x097d, 0x097d
-}; /* CR_Devanagari */
-
-/* 'Ethiopic': Script */
-static const OnigCodePoint CR_Ethiopic[] = {
- 27,
- 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,
- 0x2d80, 0x2d96,
- 0x2da0, 0x2da6,
- 0x2da8, 0x2dae,
- 0x2db0, 0x2db6,
- 0x2db8, 0x2dbe,
- 0x2dc0, 0x2dc6,
- 0x2dc8, 0x2dce,
- 0x2dd0, 0x2dd6,
- 0x2dd8, 0x2dde
-}; /* CR_Ethiopic */
-
-/* 'Georgian': Script */
-static const OnigCodePoint CR_Georgian[] = {
- 4,
- 0x10a0, 0x10c5,
- 0x10d0, 0x10fa,
- 0x10fc, 0x10fc,
- 0x2d00, 0x2d25
-}; /* CR_Georgian */
-
-/* 'Glagolitic': Script */
-static const OnigCodePoint CR_Glagolitic[] = {
- 2,
- 0x2c00, 0x2c2e,
- 0x2c30, 0x2c5e
-}; /* CR_Glagolitic */
-
-/* 'Gothic': Script */
-static const OnigCodePoint CR_Gothic[] = {
- 1,
- 0x10330, 0x1034a
-}; /* CR_Gothic */
-
-/* 'Greek': Script */
-static const OnigCodePoint CR_Greek[] = {
- 31,
- 0x0374, 0x0375,
- 0x037a, 0x037a,
- 0x0384, 0x0386,
- 0x0388, 0x038a,
- 0x038c, 0x038c,
- 0x038e, 0x03a1,
- 0x03a3, 0x03ce,
- 0x03d0, 0x03e1,
- 0x03f0, 0x03ff,
- 0x1d26, 0x1d2a,
- 0x1d5d, 0x1d61,
- 0x1d66, 0x1d6a,
- 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 */
-
-/* '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, 0x0aef,
- 0x0af1, 0x0af1
-}; /* CR_Gujarati */
-
-/* 'Gurmukhi': Script */
-static const OnigCodePoint CR_Gurmukhi[] = {
- 15,
- 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
-}; /* CR_Gurmukhi */
-
-/* 'Han': Script */
-static const OnigCodePoint CR_Han[] = {
- 14,
- 0x2e80, 0x2e99,
- 0x2e9b, 0x2ef3,
- 0x2f00, 0x2fd5,
- 0x3005, 0x3005,
- 0x3007, 0x3007,
- 0x3021, 0x3029,
- 0x3038, 0x303b,
- 0x3400, 0x4db5,
- 0x4e00, 0x9fbb,
- 0xf900, 0xfa2d,
- 0xfa30, 0xfa6a,
- 0xfa70, 0xfad9,
- 0x20000, 0x2a6d6,
- 0x2f800, 0x2fa1d
-}; /* CR_Han */
-
-/* 'Hangul': Script */
-static const OnigCodePoint CR_Hangul[] = {
- 12,
- 0x1100, 0x1159,
- 0x115f, 0x11a2,
- 0x11a8, 0x11f9,
- 0x3131, 0x318e,
- 0x3200, 0x321e,
- 0x3260, 0x327d,
- 0xac00, 0xd7a3,
- 0xffa0, 0xffbe,
- 0xffc2, 0xffc7,
- 0xffca, 0xffcf,
- 0xffd2, 0xffd7,
- 0xffda, 0xffdc
-}; /* CR_Hangul */
-
-/* 'Hanunoo': Script */
-static const OnigCodePoint CR_Hanunoo[] = {
- 1,
- 0x1720, 0x1734
-}; /* CR_Hanunoo */
-
-/* 'Hebrew': Script */
-static const OnigCodePoint CR_Hebrew[] = {
- 10,
- 0x0591, 0x05b9,
- 0x05bb, 0x05c7,
- 0x05d0, 0x05ea,
- 0x05f0, 0x05f4,
- 0xfb1d, 0xfb36,
- 0xfb38, 0xfb3c,
- 0xfb3e, 0xfb3e,
- 0xfb40, 0xfb41,
- 0xfb43, 0xfb44,
- 0xfb46, 0xfb4f
-}; /* CR_Hebrew */
-
-/* 'Hiragana': Script */
-static const OnigCodePoint CR_Hiragana[] = {
- 2,
- 0x3041, 0x3096,
- 0x309d, 0x309f
-}; /* CR_Hiragana */
-
-/* 'Inherited': Script */
-static const OnigCodePoint CR_Inherited[] = {
- 15,
- 0x0300, 0x036f,
- 0x064b, 0x0655,
- 0x0670, 0x0670,
- 0x1dc0, 0x1dc3,
- 0x200c, 0x200d,
- 0x20d0, 0x20eb,
- 0x302a, 0x302f,
- 0x3099, 0x309a,
- 0xfe00, 0xfe0f,
- 0xfe20, 0xfe23,
- 0x1d167, 0x1d169,
- 0x1d17b, 0x1d182,
- 0x1d185, 0x1d18b,
- 0x1d1aa, 0x1d1ad,
- 0xe0100, 0xe01ef
-}; /* CR_Inherited */
-
-/* 'Kannada': Script */
-static const OnigCodePoint CR_Kannada[] = {
- 13,
- 0x0c82, 0x0c83,
- 0x0c85, 0x0c8c,
- 0x0c8e, 0x0c90,
- 0x0c92, 0x0ca8,
- 0x0caa, 0x0cb3,
- 0x0cb5, 0x0cb9,
- 0x0cbc, 0x0cc4,
- 0x0cc6, 0x0cc8,
- 0x0cca, 0x0ccd,
- 0x0cd5, 0x0cd6,
- 0x0cde, 0x0cde,
- 0x0ce0, 0x0ce1,
- 0x0ce6, 0x0cef
-}; /* CR_Kannada */
-
-/* 'Katakana': Script */
-static const OnigCodePoint CR_Katakana[] = {
- 5,
- 0x30a1, 0x30fa,
- 0x30fd, 0x30ff,
- 0x31f0, 0x31ff,
- 0xff66, 0xff6f,
- 0xff71, 0xff9d
-}; /* CR_Katakana */
-
-/* '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 */
-
-/* 'Khmer': Script */
-static const OnigCodePoint CR_Khmer[] = {
- 4,
- 0x1780, 0x17dd,
- 0x17e0, 0x17e9,
- 0x17f0, 0x17f9,
- 0x19e0, 0x19ff
-}; /* CR_Khmer */
-
-/* '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, 0x0edd
-}; /* CR_Lao */
-
-/* 'Latin': Script */
-static const OnigCodePoint CR_Latin[] = {
- 23,
- 0x0041, 0x005a,
- 0x0061, 0x007a,
- 0x00aa, 0x00aa,
- 0x00ba, 0x00ba,
- 0x00c0, 0x00d6,
- 0x00d8, 0x00f6,
- 0x00f8, 0x0241,
- 0x0250, 0x02b8,
- 0x02e0, 0x02e4,
- 0x1d00, 0x1d25,
- 0x1d2c, 0x1d5c,
- 0x1d62, 0x1d65,
- 0x1d6b, 0x1d77,
- 0x1d79, 0x1dbf,
- 0x1e00, 0x1e9b,
- 0x1ea0, 0x1ef9,
- 0x2071, 0x2071,
- 0x207f, 0x207f,
- 0x2090, 0x2094,
- 0x212a, 0x212b,
- 0xfb00, 0xfb06,
- 0xff21, 0xff3a,
- 0xff41, 0xff5a
-}; /* CR_Latin */
-
-/* 'Limbu': Script */
-static const OnigCodePoint CR_Limbu[] = {
- 5,
- 0x1900, 0x191c,
- 0x1920, 0x192b,
- 0x1930, 0x193b,
- 0x1940, 0x1940,
- 0x1944, 0x194f
-}; /* CR_Limbu */
-
-/* '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 */
-
-/* 'Malayalam': Script */
-static const OnigCodePoint CR_Malayalam[] = {
- 11,
- 0x0d02, 0x0d03,
- 0x0d05, 0x0d0c,
- 0x0d0e, 0x0d10,
- 0x0d12, 0x0d28,
- 0x0d2a, 0x0d39,
- 0x0d3e, 0x0d43,
- 0x0d46, 0x0d48,
- 0x0d4a, 0x0d4d,
- 0x0d57, 0x0d57,
- 0x0d60, 0x0d61,
- 0x0d66, 0x0d6f
-}; /* CR_Malayalam */
-
-/* 'Mongolian': Script */
-static const OnigCodePoint CR_Mongolian[] = {
- 4,
- 0x1800, 0x180e,
- 0x1810, 0x1819,
- 0x1820, 0x1877,
- 0x1880, 0x18a9
-}; /* CR_Mongolian */
-
-/* 'Myanmar': Script */
-static const OnigCodePoint CR_Myanmar[] = {
- 6,
- 0x1000, 0x1021,
- 0x1023, 0x1027,
- 0x1029, 0x102a,
- 0x102c, 0x1032,
- 0x1036, 0x1039,
- 0x1040, 0x1059
-}; /* CR_Myanmar */
-
-/* 'New_Tai_Lue': Script */
-static const OnigCodePoint CR_New_Tai_Lue[] = {
- 4,
- 0x1980, 0x19a9,
- 0x19b0, 0x19c9,
- 0x19d0, 0x19d9,
- 0x19de, 0x19df
-}; /* CR_New_Tai_Lue */
-
-/* 'Ogham': Script */
-static const OnigCodePoint CR_Ogham[] = {
- 1,
- 0x1680, 0x169c
-}; /* CR_Ogham */
-
-/* 'Old_Italic': Script */
-static const OnigCodePoint CR_Old_Italic[] = {
- 2,
- 0x10300, 0x1031e,
- 0x10320, 0x10323
-}; /* CR_Old_Italic */
-
-/* 'Old_Persian': Script */
-static const OnigCodePoint CR_Old_Persian[] = {
- 2,
- 0x103a0, 0x103c3,
- 0x103c8, 0x103d5
-}; /* CR_Old_Persian */
-
-/* 'Oriya': Script */
-static const OnigCodePoint CR_Oriya[] = {
- 14,
- 0x0b01, 0x0b03,
- 0x0b05, 0x0b0c,
- 0x0b0f, 0x0b10,
- 0x0b13, 0x0b28,
- 0x0b2a, 0x0b30,
- 0x0b32, 0x0b33,
- 0x0b35, 0x0b39,
- 0x0b3c, 0x0b43,
- 0x0b47, 0x0b48,
- 0x0b4b, 0x0b4d,
- 0x0b56, 0x0b57,
- 0x0b5c, 0x0b5d,
- 0x0b5f, 0x0b61,
- 0x0b66, 0x0b71
-}; /* CR_Oriya */
-
-/* 'Osmanya': Script */
-static const OnigCodePoint CR_Osmanya[] = {
- 2,
- 0x10480, 0x1049d,
- 0x104a0, 0x104a9
-}; /* CR_Osmanya */
-
-/* 'Runic': Script */
-static const OnigCodePoint CR_Runic[] = {
- 2,
- 0x16a0, 0x16ea,
- 0x16ee, 0x16f0
-}; /* CR_Runic */
-
-/* 'Shavian': Script */
-static const OnigCodePoint CR_Shavian[] = {
- 1,
- 0x10450, 0x1047f
-}; /* CR_Shavian */
-
-/* '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 */
-
-/* 'Syloti_Nagri': Script */
-static const OnigCodePoint CR_Syloti_Nagri[] = {
- 1,
- 0xa800, 0xa82b
-}; /* CR_Syloti_Nagri */
-
-/* 'Syriac': Script */
-static const OnigCodePoint CR_Syriac[] = {
- 3,
- 0x0700, 0x070d,
- 0x070f, 0x074a,
- 0x074d, 0x074f
-}; /* CR_Syriac */
-
-/* 'Tagalog': Script */
-static const OnigCodePoint CR_Tagalog[] = {
- 2,
- 0x1700, 0x170c,
- 0x170e, 0x1714
-}; /* CR_Tagalog */
-
-/* 'Tagbanwa': Script */
-static const OnigCodePoint CR_Tagbanwa[] = {
- 3,
- 0x1760, 0x176c,
- 0x176e, 0x1770,
- 0x1772, 0x1773
-}; /* CR_Tagbanwa */
-
-/* 'Tai_Le': Script */
-static const OnigCodePoint CR_Tai_Le[] = {
- 2,
- 0x1950, 0x196d,
- 0x1970, 0x1974
-}; /* CR_Tai_Le */
-
-/* 'Tamil': Script */
-static const OnigCodePoint CR_Tamil[] = {
- 15,
- 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,
- 0x0bd7, 0x0bd7,
- 0x0be6, 0x0bfa
-}; /* CR_Tamil */
-
-/* 'Telugu': Script */
-static const OnigCodePoint CR_Telugu[] = {
- 12,
- 0x0c01, 0x0c03,
- 0x0c05, 0x0c0c,
- 0x0c0e, 0x0c10,
- 0x0c12, 0x0c28,
- 0x0c2a, 0x0c33,
- 0x0c35, 0x0c39,
- 0x0c3e, 0x0c44,
- 0x0c46, 0x0c48,
- 0x0c4a, 0x0c4d,
- 0x0c55, 0x0c56,
- 0x0c60, 0x0c61,
- 0x0c66, 0x0c6f
-}; /* CR_Telugu */
-
-/* 'Thaana': Script */
-static const OnigCodePoint CR_Thaana[] = {
- 1,
- 0x0780, 0x07b1
-}; /* CR_Thaana */
-
-/* 'Thai': Script */
-static const OnigCodePoint CR_Thai[] = {
- 2,
- 0x0e01, 0x0e3a,
- 0x0e40, 0x0e5b
-}; /* CR_Thai */
-
-/* 'Tibetan': Script */
-static const OnigCodePoint CR_Tibetan[] = {
- 7,
- 0x0f00, 0x0f47,
- 0x0f49, 0x0f6a,
- 0x0f71, 0x0f8b,
- 0x0f90, 0x0f97,
- 0x0f99, 0x0fbc,
- 0x0fbe, 0x0fcc,
- 0x0fcf, 0x0fd1
-}; /* CR_Tibetan */
-
-/* 'Tifinagh': Script */
-static const OnigCodePoint CR_Tifinagh[] = {
- 2,
- 0x2d30, 0x2d65,
- 0x2d6f, 0x2d6f
-}; /* CR_Tifinagh */
-
-/* 'Ugaritic': Script */
-static const OnigCodePoint CR_Ugaritic[] = {
- 2,
- 0x10380, 0x1039d,
- 0x1039f, 0x1039f
-}; /* CR_Ugaritic */
-
-/* 'Yi': Script */
-static const OnigCodePoint CR_Yi[] = {
- 2,
- 0xa000, 0xa48c,
- 0xa490, 0xa4c6
-}; /* CR_Yi */
-
-
-#endif /* USE_UNICODE_PROPERTIES */
-
-
-typedef struct {
- int n;
- OnigCodePoint code[3];
-} CodePointList3;
-
-typedef struct {
- OnigCodePoint from;
- CodePointList3 to;
-} CaseFold_11_Type;
-
-typedef struct {
- OnigCodePoint from;
- CodePointList3 to;
-} CaseUnfold_11_Type;
-
-typedef struct {
- int n;
- OnigCodePoint code[2];
-} CodePointList2;
-
-typedef struct {
- OnigCodePoint from[2];
- CodePointList2 to;
-} CaseUnfold_12_Type;
-
-typedef struct {
- OnigCodePoint from[3];
- CodePointList2 to;
-} CaseUnfold_13_Type;
-
-static const CaseFold_11_Type CaseFold[] = {
- { 0x0041, {1, {0x0061}}},
- { 0x0042, {1, {0x0062}}},
- { 0x0043, {1, {0x0063}}},
- { 0x0044, {1, {0x0064}}},
- { 0x0045, {1, {0x0065}}},
- { 0x0046, {1, {0x0066}}},
- { 0x0047, {1, {0x0067}}},
- { 0x0048, {1, {0x0068}}},
- { 0x004a, {1, {0x006a}}},
- { 0x004b, {1, {0x006b}}},
- { 0x004c, {1, {0x006c}}},
- { 0x004d, {1, {0x006d}}},
- { 0x004e, {1, {0x006e}}},
- { 0x004f, {1, {0x006f}}},
- { 0x0050, {1, {0x0070}}},
- { 0x0051, {1, {0x0071}}},
- { 0x0052, {1, {0x0072}}},
- { 0x0053, {1, {0x0073}}},
- { 0x0054, {1, {0x0074}}},
- { 0x0055, {1, {0x0075}}},
- { 0x0056, {1, {0x0076}}},
- { 0x0057, {1, {0x0077}}},
- { 0x0058, {1, {0x0078}}},
- { 0x0059, {1, {0x0079}}},
- { 0x005a, {1, {0x007a}}},
- { 0x00b5, {1, {0x03bc}}},
- { 0x00c0, {1, {0x00e0}}},
- { 0x00c1, {1, {0x00e1}}},
- { 0x00c2, {1, {0x00e2}}},
- { 0x00c3, {1, {0x00e3}}},
- { 0x00c4, {1, {0x00e4}}},
- { 0x00c5, {1, {0x00e5}}},
- { 0x00c6, {1, {0x00e6}}},
- { 0x00c7, {1, {0x00e7}}},
- { 0x00c8, {1, {0x00e8}}},
- { 0x00c9, {1, {0x00e9}}},
- { 0x00ca, {1, {0x00ea}}},
- { 0x00cb, {1, {0x00eb}}},
- { 0x00cc, {1, {0x00ec}}},
- { 0x00cd, {1, {0x00ed}}},
- { 0x00ce, {1, {0x00ee}}},
- { 0x00cf, {1, {0x00ef}}},
- { 0x00d0, {1, {0x00f0}}},
- { 0x00d1, {1, {0x00f1}}},
- { 0x00d2, {1, {0x00f2}}},
- { 0x00d3, {1, {0x00f3}}},
- { 0x00d4, {1, {0x00f4}}},
- { 0x00d5, {1, {0x00f5}}},
- { 0x00d6, {1, {0x00f6}}},
- { 0x00d8, {1, {0x00f8}}},
- { 0x00d9, {1, {0x00f9}}},
- { 0x00da, {1, {0x00fa}}},
- { 0x00db, {1, {0x00fb}}},
- { 0x00dc, {1, {0x00fc}}},
- { 0x00dd, {1, {0x00fd}}},
- { 0x00de, {1, {0x00fe}}},
- { 0x00df, {2, {0x0073, 0x0073}}},
- { 0x0100, {1, {0x0101}}},
- { 0x0102, {1, {0x0103}}},
- { 0x0104, {1, {0x0105}}},
- { 0x0106, {1, {0x0107}}},
- { 0x0108, {1, {0x0109}}},
- { 0x010a, {1, {0x010b}}},
- { 0x010c, {1, {0x010d}}},
- { 0x010e, {1, {0x010f}}},
- { 0x0110, {1, {0x0111}}},
- { 0x0112, {1, {0x0113}}},
- { 0x0114, {1, {0x0115}}},
- { 0x0116, {1, {0x0117}}},
- { 0x0118, {1, {0x0119}}},
- { 0x011a, {1, {0x011b}}},
- { 0x011c, {1, {0x011d}}},
- { 0x011e, {1, {0x011f}}},
- { 0x0120, {1, {0x0121}}},
- { 0x0122, {1, {0x0123}}},
- { 0x0124, {1, {0x0125}}},
- { 0x0126, {1, {0x0127}}},
- { 0x0128, {1, {0x0129}}},
- { 0x012a, {1, {0x012b}}},
- { 0x012c, {1, {0x012d}}},
- { 0x012e, {1, {0x012f}}},
- { 0x0132, {1, {0x0133}}},
- { 0x0134, {1, {0x0135}}},
- { 0x0136, {1, {0x0137}}},
- { 0x0139, {1, {0x013a}}},
- { 0x013b, {1, {0x013c}}},
- { 0x013d, {1, {0x013e}}},
- { 0x013f, {1, {0x0140}}},
- { 0x0141, {1, {0x0142}}},
- { 0x0143, {1, {0x0144}}},
- { 0x0145, {1, {0x0146}}},
- { 0x0147, {1, {0x0148}}},
- { 0x0149, {2, {0x02bc, 0x006e}}},
- { 0x014a, {1, {0x014b}}},
- { 0x014c, {1, {0x014d}}},
- { 0x014e, {1, {0x014f}}},
- { 0x0150, {1, {0x0151}}},
- { 0x0152, {1, {0x0153}}},
- { 0x0154, {1, {0x0155}}},
- { 0x0156, {1, {0x0157}}},
- { 0x0158, {1, {0x0159}}},
- { 0x015a, {1, {0x015b}}},
- { 0x015c, {1, {0x015d}}},
- { 0x015e, {1, {0x015f}}},
- { 0x0160, {1, {0x0161}}},
- { 0x0162, {1, {0x0163}}},
- { 0x0164, {1, {0x0165}}},
- { 0x0166, {1, {0x0167}}},
- { 0x0168, {1, {0x0169}}},
- { 0x016a, {1, {0x016b}}},
- { 0x016c, {1, {0x016d}}},
- { 0x016e, {1, {0x016f}}},
- { 0x0170, {1, {0x0171}}},
- { 0x0172, {1, {0x0173}}},
- { 0x0174, {1, {0x0175}}},
- { 0x0176, {1, {0x0177}}},
- { 0x0178, {1, {0x00ff}}},
- { 0x0179, {1, {0x017a}}},
- { 0x017b, {1, {0x017c}}},
- { 0x017d, {1, {0x017e}}},
- { 0x017f, {1, {0x0073}}},
- { 0x0181, {1, {0x0253}}},
- { 0x0182, {1, {0x0183}}},
- { 0x0184, {1, {0x0185}}},
- { 0x0186, {1, {0x0254}}},
- { 0x0187, {1, {0x0188}}},
- { 0x0189, {1, {0x0256}}},
- { 0x018a, {1, {0x0257}}},
- { 0x018b, {1, {0x018c}}},
- { 0x018e, {1, {0x01dd}}},
- { 0x018f, {1, {0x0259}}},
- { 0x0190, {1, {0x025b}}},
- { 0x0191, {1, {0x0192}}},
- { 0x0193, {1, {0x0260}}},
- { 0x0194, {1, {0x0263}}},
- { 0x0196, {1, {0x0269}}},
- { 0x0197, {1, {0x0268}}},
- { 0x0198, {1, {0x0199}}},
- { 0x019c, {1, {0x026f}}},
- { 0x019d, {1, {0x0272}}},
- { 0x019f, {1, {0x0275}}},
- { 0x01a0, {1, {0x01a1}}},
- { 0x01a2, {1, {0x01a3}}},
- { 0x01a4, {1, {0x01a5}}},
- { 0x01a6, {1, {0x0280}}},
- { 0x01a7, {1, {0x01a8}}},
- { 0x01a9, {1, {0x0283}}},
- { 0x01ac, {1, {0x01ad}}},
- { 0x01ae, {1, {0x0288}}},
- { 0x01af, {1, {0x01b0}}},
- { 0x01b1, {1, {0x028a}}},
- { 0x01b2, {1, {0x028b}}},
- { 0x01b3, {1, {0x01b4}}},
- { 0x01b5, {1, {0x01b6}}},
- { 0x01b7, {1, {0x0292}}},
- { 0x01b8, {1, {0x01b9}}},
- { 0x01bc, {1, {0x01bd}}},
- { 0x01c4, {1, {0x01c6}}},
- { 0x01c5, {1, {0x01c6}}},
- { 0x01c7, {1, {0x01c9}}},
- { 0x01c8, {1, {0x01c9}}},
- { 0x01ca, {1, {0x01cc}}},
- { 0x01cb, {1, {0x01cc}}},
- { 0x01cd, {1, {0x01ce}}},
- { 0x01cf, {1, {0x01d0}}},
- { 0x01d1, {1, {0x01d2}}},
- { 0x01d3, {1, {0x01d4}}},
- { 0x01d5, {1, {0x01d6}}},
- { 0x01d7, {1, {0x01d8}}},
- { 0x01d9, {1, {0x01da}}},
- { 0x01db, {1, {0x01dc}}},
- { 0x01de, {1, {0x01df}}},
- { 0x01e0, {1, {0x01e1}}},
- { 0x01e2, {1, {0x01e3}}},
- { 0x01e4, {1, {0x01e5}}},
- { 0x01e6, {1, {0x01e7}}},
- { 0x01e8, {1, {0x01e9}}},
- { 0x01ea, {1, {0x01eb}}},
- { 0x01ec, {1, {0x01ed}}},
- { 0x01ee, {1, {0x01ef}}},
- { 0x01f0, {2, {0x006a, 0x030c}}},
- { 0x01f1, {1, {0x01f3}}},
- { 0x01f2, {1, {0x01f3}}},
- { 0x01f4, {1, {0x01f5}}},
- { 0x01f6, {1, {0x0195}}},
- { 0x01f7, {1, {0x01bf}}},
- { 0x01f8, {1, {0x01f9}}},
- { 0x01fa, {1, {0x01fb}}},
- { 0x01fc, {1, {0x01fd}}},
- { 0x01fe, {1, {0x01ff}}},
- { 0x0200, {1, {0x0201}}},
- { 0x0202, {1, {0x0203}}},
- { 0x0204, {1, {0x0205}}},
- { 0x0206, {1, {0x0207}}},
- { 0x0208, {1, {0x0209}}},
- { 0x020a, {1, {0x020b}}},
- { 0x020c, {1, {0x020d}}},
- { 0x020e, {1, {0x020f}}},
- { 0x0210, {1, {0x0211}}},
- { 0x0212, {1, {0x0213}}},
- { 0x0214, {1, {0x0215}}},
- { 0x0216, {1, {0x0217}}},
- { 0x0218, {1, {0x0219}}},
- { 0x021a, {1, {0x021b}}},
- { 0x021c, {1, {0x021d}}},
- { 0x021e, {1, {0x021f}}},
- { 0x0220, {1, {0x019e}}},
- { 0x0222, {1, {0x0223}}},
- { 0x0224, {1, {0x0225}}},
- { 0x0226, {1, {0x0227}}},
- { 0x0228, {1, {0x0229}}},
- { 0x022a, {1, {0x022b}}},
- { 0x022c, {1, {0x022d}}},
- { 0x022e, {1, {0x022f}}},
- { 0x0230, {1, {0x0231}}},
- { 0x0232, {1, {0x0233}}},
- { 0x023b, {1, {0x023c}}},
- { 0x023d, {1, {0x019a}}},
- { 0x0241, {1, {0x0294}}},
- { 0x0345, {1, {0x03b9}}},
- { 0x0386, {1, {0x03ac}}},
- { 0x0388, {1, {0x03ad}}},
- { 0x0389, {1, {0x03ae}}},
- { 0x038a, {1, {0x03af}}},
- { 0x038c, {1, {0x03cc}}},
- { 0x038e, {1, {0x03cd}}},
- { 0x038f, {1, {0x03ce}}},
- { 0x0390, {3, {0x03b9, 0x0308, 0x0301}}},
- { 0x0391, {1, {0x03b1}}},
- { 0x0392, {1, {0x03b2}}},
- { 0x0393, {1, {0x03b3}}},
- { 0x0394, {1, {0x03b4}}},
- { 0x0395, {1, {0x03b5}}},
- { 0x0396, {1, {0x03b6}}},
- { 0x0397, {1, {0x03b7}}},
- { 0x0398, {1, {0x03b8}}},
- { 0x0399, {1, {0x03b9}}},
- { 0x039a, {1, {0x03ba}}},
- { 0x039b, {1, {0x03bb}}},
- { 0x039c, {1, {0x03bc}}},
- { 0x039d, {1, {0x03bd}}},
- { 0x039e, {1, {0x03be}}},
- { 0x039f, {1, {0x03bf}}},
- { 0x03a0, {1, {0x03c0}}},
- { 0x03a1, {1, {0x03c1}}},
- { 0x03a3, {1, {0x03c3}}},
- { 0x03a4, {1, {0x03c4}}},
- { 0x03a5, {1, {0x03c5}}},
- { 0x03a6, {1, {0x03c6}}},
- { 0x03a7, {1, {0x03c7}}},
- { 0x03a8, {1, {0x03c8}}},
- { 0x03a9, {1, {0x03c9}}},
- { 0x03aa, {1, {0x03ca}}},
- { 0x03ab, {1, {0x03cb}}},
- { 0x03b0, {3, {0x03c5, 0x0308, 0x0301}}},
- { 0x03c2, {1, {0x03c3}}},
- { 0x03d0, {1, {0x03b2}}},
- { 0x03d1, {1, {0x03b8}}},
- { 0x03d5, {1, {0x03c6}}},
- { 0x03d6, {1, {0x03c0}}},
- { 0x03d8, {1, {0x03d9}}},
- { 0x03da, {1, {0x03db}}},
- { 0x03dc, {1, {0x03dd}}},
- { 0x03de, {1, {0x03df}}},
- { 0x03e0, {1, {0x03e1}}},
- { 0x03e2, {1, {0x03e3}}},
- { 0x03e4, {1, {0x03e5}}},
- { 0x03e6, {1, {0x03e7}}},
- { 0x03e8, {1, {0x03e9}}},
- { 0x03ea, {1, {0x03eb}}},
- { 0x03ec, {1, {0x03ed}}},
- { 0x03ee, {1, {0x03ef}}},
- { 0x03f0, {1, {0x03ba}}},
- { 0x03f1, {1, {0x03c1}}},
- { 0x03f4, {1, {0x03b8}}},
- { 0x03f5, {1, {0x03b5}}},
- { 0x03f7, {1, {0x03f8}}},
- { 0x03f9, {1, {0x03f2}}},
- { 0x03fa, {1, {0x03fb}}},
- { 0x0400, {1, {0x0450}}},
- { 0x0401, {1, {0x0451}}},
- { 0x0402, {1, {0x0452}}},
- { 0x0403, {1, {0x0453}}},
- { 0x0404, {1, {0x0454}}},
- { 0x0405, {1, {0x0455}}},
- { 0x0406, {1, {0x0456}}},
- { 0x0407, {1, {0x0457}}},
- { 0x0408, {1, {0x0458}}},
- { 0x0409, {1, {0x0459}}},
- { 0x040a, {1, {0x045a}}},
- { 0x040b, {1, {0x045b}}},
- { 0x040c, {1, {0x045c}}},
- { 0x040d, {1, {0x045d}}},
- { 0x040e, {1, {0x045e}}},
- { 0x040f, {1, {0x045f}}},
- { 0x0410, {1, {0x0430}}},
- { 0x0411, {1, {0x0431}}},
- { 0x0412, {1, {0x0432}}},
- { 0x0413, {1, {0x0433}}},
- { 0x0414, {1, {0x0434}}},
- { 0x0415, {1, {0x0435}}},
- { 0x0416, {1, {0x0436}}},
- { 0x0417, {1, {0x0437}}},
- { 0x0418, {1, {0x0438}}},
- { 0x0419, {1, {0x0439}}},
- { 0x041a, {1, {0x043a}}},
- { 0x041b, {1, {0x043b}}},
- { 0x041c, {1, {0x043c}}},
- { 0x041d, {1, {0x043d}}},
- { 0x041e, {1, {0x043e}}},
- { 0x041f, {1, {0x043f}}},
- { 0x0420, {1, {0x0440}}},
- { 0x0421, {1, {0x0441}}},
- { 0x0422, {1, {0x0442}}},
- { 0x0423, {1, {0x0443}}},
- { 0x0424, {1, {0x0444}}},
- { 0x0425, {1, {0x0445}}},
- { 0x0426, {1, {0x0446}}},
- { 0x0427, {1, {0x0447}}},
- { 0x0428, {1, {0x0448}}},
- { 0x0429, {1, {0x0449}}},
- { 0x042a, {1, {0x044a}}},
- { 0x042b, {1, {0x044b}}},
- { 0x042c, {1, {0x044c}}},
- { 0x042d, {1, {0x044d}}},
- { 0x042e, {1, {0x044e}}},
- { 0x042f, {1, {0x044f}}},
- { 0x0460, {1, {0x0461}}},
- { 0x0462, {1, {0x0463}}},
- { 0x0464, {1, {0x0465}}},
- { 0x0466, {1, {0x0467}}},
- { 0x0468, {1, {0x0469}}},
- { 0x046a, {1, {0x046b}}},
- { 0x046c, {1, {0x046d}}},
- { 0x046e, {1, {0x046f}}},
- { 0x0470, {1, {0x0471}}},
- { 0x0472, {1, {0x0473}}},
- { 0x0474, {1, {0x0475}}},
- { 0x0476, {1, {0x0477}}},
- { 0x0478, {1, {0x0479}}},
- { 0x047a, {1, {0x047b}}},
- { 0x047c, {1, {0x047d}}},
- { 0x047e, {1, {0x047f}}},
- { 0x0480, {1, {0x0481}}},
- { 0x048a, {1, {0x048b}}},
- { 0x048c, {1, {0x048d}}},
- { 0x048e, {1, {0x048f}}},
- { 0x0490, {1, {0x0491}}},
- { 0x0492, {1, {0x0493}}},
- { 0x0494, {1, {0x0495}}},
- { 0x0496, {1, {0x0497}}},
- { 0x0498, {1, {0x0499}}},
- { 0x049a, {1, {0x049b}}},
- { 0x049c, {1, {0x049d}}},
- { 0x049e, {1, {0x049f}}},
- { 0x04a0, {1, {0x04a1}}},
- { 0x04a2, {1, {0x04a3}}},
- { 0x04a4, {1, {0x04a5}}},
- { 0x04a6, {1, {0x04a7}}},
- { 0x04a8, {1, {0x04a9}}},
- { 0x04aa, {1, {0x04ab}}},
- { 0x04ac, {1, {0x04ad}}},
- { 0x04ae, {1, {0x04af}}},
- { 0x04b0, {1, {0x04b1}}},
- { 0x04b2, {1, {0x04b3}}},
- { 0x04b4, {1, {0x04b5}}},
- { 0x04b6, {1, {0x04b7}}},
- { 0x04b8, {1, {0x04b9}}},
- { 0x04ba, {1, {0x04bb}}},
- { 0x04bc, {1, {0x04bd}}},
- { 0x04be, {1, {0x04bf}}},
- { 0x04c1, {1, {0x04c2}}},
- { 0x04c3, {1, {0x04c4}}},
- { 0x04c5, {1, {0x04c6}}},
- { 0x04c7, {1, {0x04c8}}},
- { 0x04c9, {1, {0x04ca}}},
- { 0x04cb, {1, {0x04cc}}},
- { 0x04cd, {1, {0x04ce}}},
- { 0x04d0, {1, {0x04d1}}},
- { 0x04d2, {1, {0x04d3}}},
- { 0x04d4, {1, {0x04d5}}},
- { 0x04d6, {1, {0x04d7}}},
- { 0x04d8, {1, {0x04d9}}},
- { 0x04da, {1, {0x04db}}},
- { 0x04dc, {1, {0x04dd}}},
- { 0x04de, {1, {0x04df}}},
- { 0x04e0, {1, {0x04e1}}},
- { 0x04e2, {1, {0x04e3}}},
- { 0x04e4, {1, {0x04e5}}},
- { 0x04e6, {1, {0x04e7}}},
- { 0x04e8, {1, {0x04e9}}},
- { 0x04ea, {1, {0x04eb}}},
- { 0x04ec, {1, {0x04ed}}},
- { 0x04ee, {1, {0x04ef}}},
- { 0x04f0, {1, {0x04f1}}},
- { 0x04f2, {1, {0x04f3}}},
- { 0x04f4, {1, {0x04f5}}},
- { 0x04f6, {1, {0x04f7}}},
- { 0x04f8, {1, {0x04f9}}},
- { 0x0500, {1, {0x0501}}},
- { 0x0502, {1, {0x0503}}},
- { 0x0504, {1, {0x0505}}},
- { 0x0506, {1, {0x0507}}},
- { 0x0508, {1, {0x0509}}},
- { 0x050a, {1, {0x050b}}},
- { 0x050c, {1, {0x050d}}},
- { 0x050e, {1, {0x050f}}},
- { 0x0531, {1, {0x0561}}},
- { 0x0532, {1, {0x0562}}},
- { 0x0533, {1, {0x0563}}},
- { 0x0534, {1, {0x0564}}},
- { 0x0535, {1, {0x0565}}},
- { 0x0536, {1, {0x0566}}},
- { 0x0537, {1, {0x0567}}},
- { 0x0538, {1, {0x0568}}},
- { 0x0539, {1, {0x0569}}},
- { 0x053a, {1, {0x056a}}},
- { 0x053b, {1, {0x056b}}},
- { 0x053c, {1, {0x056c}}},
- { 0x053d, {1, {0x056d}}},
- { 0x053e, {1, {0x056e}}},
- { 0x053f, {1, {0x056f}}},
- { 0x0540, {1, {0x0570}}},
- { 0x0541, {1, {0x0571}}},
- { 0x0542, {1, {0x0572}}},
- { 0x0543, {1, {0x0573}}},
- { 0x0544, {1, {0x0574}}},
- { 0x0545, {1, {0x0575}}},
- { 0x0546, {1, {0x0576}}},
- { 0x0547, {1, {0x0577}}},
- { 0x0548, {1, {0x0578}}},
- { 0x0549, {1, {0x0579}}},
- { 0x054a, {1, {0x057a}}},
- { 0x054b, {1, {0x057b}}},
- { 0x054c, {1, {0x057c}}},
- { 0x054d, {1, {0x057d}}},
- { 0x054e, {1, {0x057e}}},
- { 0x054f, {1, {0x057f}}},
- { 0x0550, {1, {0x0580}}},
- { 0x0551, {1, {0x0581}}},
- { 0x0552, {1, {0x0582}}},
- { 0x0553, {1, {0x0583}}},
- { 0x0554, {1, {0x0584}}},
- { 0x0555, {1, {0x0585}}},
- { 0x0556, {1, {0x0586}}},
- { 0x0587, {2, {0x0565, 0x0582}}},
- { 0x10a0, {1, {0x2d00}}},
- { 0x10a1, {1, {0x2d01}}},
- { 0x10a2, {1, {0x2d02}}},
- { 0x10a3, {1, {0x2d03}}},
- { 0x10a4, {1, {0x2d04}}},
- { 0x10a5, {1, {0x2d05}}},
- { 0x10a6, {1, {0x2d06}}},
- { 0x10a7, {1, {0x2d07}}},
- { 0x10a8, {1, {0x2d08}}},
- { 0x10a9, {1, {0x2d09}}},
- { 0x10aa, {1, {0x2d0a}}},
- { 0x10ab, {1, {0x2d0b}}},
- { 0x10ac, {1, {0x2d0c}}},
- { 0x10ad, {1, {0x2d0d}}},
- { 0x10ae, {1, {0x2d0e}}},
- { 0x10af, {1, {0x2d0f}}},
- { 0x10b0, {1, {0x2d10}}},
- { 0x10b1, {1, {0x2d11}}},
- { 0x10b2, {1, {0x2d12}}},
- { 0x10b3, {1, {0x2d13}}},
- { 0x10b4, {1, {0x2d14}}},
- { 0x10b5, {1, {0x2d15}}},
- { 0x10b6, {1, {0x2d16}}},
- { 0x10b7, {1, {0x2d17}}},
- { 0x10b8, {1, {0x2d18}}},
- { 0x10b9, {1, {0x2d19}}},
- { 0x10ba, {1, {0x2d1a}}},
- { 0x10bb, {1, {0x2d1b}}},
- { 0x10bc, {1, {0x2d1c}}},
- { 0x10bd, {1, {0x2d1d}}},
- { 0x10be, {1, {0x2d1e}}},
- { 0x10bf, {1, {0x2d1f}}},
- { 0x10c0, {1, {0x2d20}}},
- { 0x10c1, {1, {0x2d21}}},
- { 0x10c2, {1, {0x2d22}}},
- { 0x10c3, {1, {0x2d23}}},
- { 0x10c4, {1, {0x2d24}}},
- { 0x10c5, {1, {0x2d25}}},
- { 0x1e00, {1, {0x1e01}}},
- { 0x1e02, {1, {0x1e03}}},
- { 0x1e04, {1, {0x1e05}}},
- { 0x1e06, {1, {0x1e07}}},
- { 0x1e08, {1, {0x1e09}}},
- { 0x1e0a, {1, {0x1e0b}}},
- { 0x1e0c, {1, {0x1e0d}}},
- { 0x1e0e, {1, {0x1e0f}}},
- { 0x1e10, {1, {0x1e11}}},
- { 0x1e12, {1, {0x1e13}}},
- { 0x1e14, {1, {0x1e15}}},
- { 0x1e16, {1, {0x1e17}}},
- { 0x1e18, {1, {0x1e19}}},
- { 0x1e1a, {1, {0x1e1b}}},
- { 0x1e1c, {1, {0x1e1d}}},
- { 0x1e1e, {1, {0x1e1f}}},
- { 0x1e20, {1, {0x1e21}}},
- { 0x1e22, {1, {0x1e23}}},
- { 0x1e24, {1, {0x1e25}}},
- { 0x1e26, {1, {0x1e27}}},
- { 0x1e28, {1, {0x1e29}}},
- { 0x1e2a, {1, {0x1e2b}}},
- { 0x1e2c, {1, {0x1e2d}}},
- { 0x1e2e, {1, {0x1e2f}}},
- { 0x1e30, {1, {0x1e31}}},
- { 0x1e32, {1, {0x1e33}}},
- { 0x1e34, {1, {0x1e35}}},
- { 0x1e36, {1, {0x1e37}}},
- { 0x1e38, {1, {0x1e39}}},
- { 0x1e3a, {1, {0x1e3b}}},
- { 0x1e3c, {1, {0x1e3d}}},
- { 0x1e3e, {1, {0x1e3f}}},
- { 0x1e40, {1, {0x1e41}}},
- { 0x1e42, {1, {0x1e43}}},
- { 0x1e44, {1, {0x1e45}}},
- { 0x1e46, {1, {0x1e47}}},
- { 0x1e48, {1, {0x1e49}}},
- { 0x1e4a, {1, {0x1e4b}}},
- { 0x1e4c, {1, {0x1e4d}}},
- { 0x1e4e, {1, {0x1e4f}}},
- { 0x1e50, {1, {0x1e51}}},
- { 0x1e52, {1, {0x1e53}}},
- { 0x1e54, {1, {0x1e55}}},
- { 0x1e56, {1, {0x1e57}}},
- { 0x1e58, {1, {0x1e59}}},
- { 0x1e5a, {1, {0x1e5b}}},
- { 0x1e5c, {1, {0x1e5d}}},
- { 0x1e5e, {1, {0x1e5f}}},
- { 0x1e60, {1, {0x1e61}}},
- { 0x1e62, {1, {0x1e63}}},
- { 0x1e64, {1, {0x1e65}}},
- { 0x1e66, {1, {0x1e67}}},
- { 0x1e68, {1, {0x1e69}}},
- { 0x1e6a, {1, {0x1e6b}}},
- { 0x1e6c, {1, {0x1e6d}}},
- { 0x1e6e, {1, {0x1e6f}}},
- { 0x1e70, {1, {0x1e71}}},
- { 0x1e72, {1, {0x1e73}}},
- { 0x1e74, {1, {0x1e75}}},
- { 0x1e76, {1, {0x1e77}}},
- { 0x1e78, {1, {0x1e79}}},
- { 0x1e7a, {1, {0x1e7b}}},
- { 0x1e7c, {1, {0x1e7d}}},
- { 0x1e7e, {1, {0x1e7f}}},
- { 0x1e80, {1, {0x1e81}}},
- { 0x1e82, {1, {0x1e83}}},
- { 0x1e84, {1, {0x1e85}}},
- { 0x1e86, {1, {0x1e87}}},
- { 0x1e88, {1, {0x1e89}}},
- { 0x1e8a, {1, {0x1e8b}}},
- { 0x1e8c, {1, {0x1e8d}}},
- { 0x1e8e, {1, {0x1e8f}}},
- { 0x1e90, {1, {0x1e91}}},
- { 0x1e92, {1, {0x1e93}}},
- { 0x1e94, {1, {0x1e95}}},
- { 0x1e96, {2, {0x0068, 0x0331}}},
- { 0x1e97, {2, {0x0074, 0x0308}}},
- { 0x1e98, {2, {0x0077, 0x030a}}},
- { 0x1e99, {2, {0x0079, 0x030a}}},
- { 0x1e9a, {2, {0x0061, 0x02be}}},
- { 0x1e9b, {1, {0x1e61}}},
- { 0x1ea0, {1, {0x1ea1}}},
- { 0x1ea2, {1, {0x1ea3}}},
- { 0x1ea4, {1, {0x1ea5}}},
- { 0x1ea6, {1, {0x1ea7}}},
- { 0x1ea8, {1, {0x1ea9}}},
- { 0x1eaa, {1, {0x1eab}}},
- { 0x1eac, {1, {0x1ead}}},
- { 0x1eae, {1, {0x1eaf}}},
- { 0x1eb0, {1, {0x1eb1}}},
- { 0x1eb2, {1, {0x1eb3}}},
- { 0x1eb4, {1, {0x1eb5}}},
- { 0x1eb6, {1, {0x1eb7}}},
- { 0x1eb8, {1, {0x1eb9}}},
- { 0x1eba, {1, {0x1ebb}}},
- { 0x1ebc, {1, {0x1ebd}}},
- { 0x1ebe, {1, {0x1ebf}}},
- { 0x1ec0, {1, {0x1ec1}}},
- { 0x1ec2, {1, {0x1ec3}}},
- { 0x1ec4, {1, {0x1ec5}}},
- { 0x1ec6, {1, {0x1ec7}}},
- { 0x1ec8, {1, {0x1ec9}}},
- { 0x1eca, {1, {0x1ecb}}},
- { 0x1ecc, {1, {0x1ecd}}},
- { 0x1ece, {1, {0x1ecf}}},
- { 0x1ed0, {1, {0x1ed1}}},
- { 0x1ed2, {1, {0x1ed3}}},
- { 0x1ed4, {1, {0x1ed5}}},
- { 0x1ed6, {1, {0x1ed7}}},
- { 0x1ed8, {1, {0x1ed9}}},
- { 0x1eda, {1, {0x1edb}}},
- { 0x1edc, {1, {0x1edd}}},
- { 0x1ede, {1, {0x1edf}}},
- { 0x1ee0, {1, {0x1ee1}}},
- { 0x1ee2, {1, {0x1ee3}}},
- { 0x1ee4, {1, {0x1ee5}}},
- { 0x1ee6, {1, {0x1ee7}}},
- { 0x1ee8, {1, {0x1ee9}}},
- { 0x1eea, {1, {0x1eeb}}},
- { 0x1eec, {1, {0x1eed}}},
- { 0x1eee, {1, {0x1eef}}},
- { 0x1ef0, {1, {0x1ef1}}},
- { 0x1ef2, {1, {0x1ef3}}},
- { 0x1ef4, {1, {0x1ef5}}},
- { 0x1ef6, {1, {0x1ef7}}},
- { 0x1ef8, {1, {0x1ef9}}},
- { 0x1f08, {1, {0x1f00}}},
- { 0x1f09, {1, {0x1f01}}},
- { 0x1f0a, {1, {0x1f02}}},
- { 0x1f0b, {1, {0x1f03}}},
- { 0x1f0c, {1, {0x1f04}}},
- { 0x1f0d, {1, {0x1f05}}},
- { 0x1f0e, {1, {0x1f06}}},
- { 0x1f0f, {1, {0x1f07}}},
- { 0x1f18, {1, {0x1f10}}},
- { 0x1f19, {1, {0x1f11}}},
- { 0x1f1a, {1, {0x1f12}}},
- { 0x1f1b, {1, {0x1f13}}},
- { 0x1f1c, {1, {0x1f14}}},
- { 0x1f1d, {1, {0x1f15}}},
- { 0x1f28, {1, {0x1f20}}},
- { 0x1f29, {1, {0x1f21}}},
- { 0x1f2a, {1, {0x1f22}}},
- { 0x1f2b, {1, {0x1f23}}},
- { 0x1f2c, {1, {0x1f24}}},
- { 0x1f2d, {1, {0x1f25}}},
- { 0x1f2e, {1, {0x1f26}}},
- { 0x1f2f, {1, {0x1f27}}},
- { 0x1f38, {1, {0x1f30}}},
- { 0x1f39, {1, {0x1f31}}},
- { 0x1f3a, {1, {0x1f32}}},
- { 0x1f3b, {1, {0x1f33}}},
- { 0x1f3c, {1, {0x1f34}}},
- { 0x1f3d, {1, {0x1f35}}},
- { 0x1f3e, {1, {0x1f36}}},
- { 0x1f3f, {1, {0x1f37}}},
- { 0x1f48, {1, {0x1f40}}},
- { 0x1f49, {1, {0x1f41}}},
- { 0x1f4a, {1, {0x1f42}}},
- { 0x1f4b, {1, {0x1f43}}},
- { 0x1f4c, {1, {0x1f44}}},
- { 0x1f4d, {1, {0x1f45}}},
- { 0x1f50, {2, {0x03c5, 0x0313}}},
- { 0x1f52, {3, {0x03c5, 0x0313, 0x0300}}},
- { 0x1f54, {3, {0x03c5, 0x0313, 0x0301}}},
- { 0x1f56, {3, {0x03c5, 0x0313, 0x0342}}},
- { 0x1f59, {1, {0x1f51}}},
- { 0x1f5b, {1, {0x1f53}}},
- { 0x1f5d, {1, {0x1f55}}},
- { 0x1f5f, {1, {0x1f57}}},
- { 0x1f68, {1, {0x1f60}}},
- { 0x1f69, {1, {0x1f61}}},
- { 0x1f6a, {1, {0x1f62}}},
- { 0x1f6b, {1, {0x1f63}}},
- { 0x1f6c, {1, {0x1f64}}},
- { 0x1f6d, {1, {0x1f65}}},
- { 0x1f6e, {1, {0x1f66}}},
- { 0x1f6f, {1, {0x1f67}}},
- { 0x1f80, {2, {0x1f00, 0x03b9}}},
- { 0x1f81, {2, {0x1f01, 0x03b9}}},
- { 0x1f82, {2, {0x1f02, 0x03b9}}},
- { 0x1f83, {2, {0x1f03, 0x03b9}}},
- { 0x1f84, {2, {0x1f04, 0x03b9}}},
- { 0x1f85, {2, {0x1f05, 0x03b9}}},
- { 0x1f86, {2, {0x1f06, 0x03b9}}},
- { 0x1f87, {2, {0x1f07, 0x03b9}}},
- { 0x1f88, {2, {0x1f00, 0x03b9}}},
- { 0x1f89, {2, {0x1f01, 0x03b9}}},
- { 0x1f8a, {2, {0x1f02, 0x03b9}}},
- { 0x1f8b, {2, {0x1f03, 0x03b9}}},
- { 0x1f8c, {2, {0x1f04, 0x03b9}}},
- { 0x1f8d, {2, {0x1f05, 0x03b9}}},
- { 0x1f8e, {2, {0x1f06, 0x03b9}}},
- { 0x1f8f, {2, {0x1f07, 0x03b9}}},
- { 0x1f90, {2, {0x1f20, 0x03b9}}},
- { 0x1f91, {2, {0x1f21, 0x03b9}}},
- { 0x1f92, {2, {0x1f22, 0x03b9}}},
- { 0x1f93, {2, {0x1f23, 0x03b9}}},
- { 0x1f94, {2, {0x1f24, 0x03b9}}},
- { 0x1f95, {2, {0x1f25, 0x03b9}}},
- { 0x1f96, {2, {0x1f26, 0x03b9}}},
- { 0x1f97, {2, {0x1f27, 0x03b9}}},
- { 0x1f98, {2, {0x1f20, 0x03b9}}},
- { 0x1f99, {2, {0x1f21, 0x03b9}}},
- { 0x1f9a, {2, {0x1f22, 0x03b9}}},
- { 0x1f9b, {2, {0x1f23, 0x03b9}}},
- { 0x1f9c, {2, {0x1f24, 0x03b9}}},
- { 0x1f9d, {2, {0x1f25, 0x03b9}}},
- { 0x1f9e, {2, {0x1f26, 0x03b9}}},
- { 0x1f9f, {2, {0x1f27, 0x03b9}}},
- { 0x1fa0, {2, {0x1f60, 0x03b9}}},
- { 0x1fa1, {2, {0x1f61, 0x03b9}}},
- { 0x1fa2, {2, {0x1f62, 0x03b9}}},
- { 0x1fa3, {2, {0x1f63, 0x03b9}}},
- { 0x1fa4, {2, {0x1f64, 0x03b9}}},
- { 0x1fa5, {2, {0x1f65, 0x03b9}}},
- { 0x1fa6, {2, {0x1f66, 0x03b9}}},
- { 0x1fa7, {2, {0x1f67, 0x03b9}}},
- { 0x1fa8, {2, {0x1f60, 0x03b9}}},
- { 0x1fa9, {2, {0x1f61, 0x03b9}}},
- { 0x1faa, {2, {0x1f62, 0x03b9}}},
- { 0x1fab, {2, {0x1f63, 0x03b9}}},
- { 0x1fac, {2, {0x1f64, 0x03b9}}},
- { 0x1fad, {2, {0x1f65, 0x03b9}}},
- { 0x1fae, {2, {0x1f66, 0x03b9}}},
- { 0x1faf, {2, {0x1f67, 0x03b9}}},
- { 0x1fb2, {2, {0x1f70, 0x03b9}}},
- { 0x1fb3, {2, {0x03b1, 0x03b9}}},
- { 0x1fb4, {2, {0x03ac, 0x03b9}}},
- { 0x1fb6, {2, {0x03b1, 0x0342}}},
- { 0x1fb7, {3, {0x03b1, 0x0342, 0x03b9}}},
- { 0x1fb8, {1, {0x1fb0}}},
- { 0x1fb9, {1, {0x1fb1}}},
- { 0x1fba, {1, {0x1f70}}},
- { 0x1fbb, {1, {0x1f71}}},
- { 0x1fbc, {2, {0x03b1, 0x03b9}}},
- { 0x1fbe, {1, {0x03b9}}},
- { 0x1fc2, {2, {0x1f74, 0x03b9}}},
- { 0x1fc3, {2, {0x03b7, 0x03b9}}},
- { 0x1fc4, {2, {0x03ae, 0x03b9}}},
- { 0x1fc6, {2, {0x03b7, 0x0342}}},
- { 0x1fc7, {3, {0x03b7, 0x0342, 0x03b9}}},
- { 0x1fc8, {1, {0x1f72}}},
- { 0x1fc9, {1, {0x1f73}}},
- { 0x1fca, {1, {0x1f74}}},
- { 0x1fcb, {1, {0x1f75}}},
- { 0x1fcc, {2, {0x03b7, 0x03b9}}},
- { 0x1fd2, {3, {0x03b9, 0x0308, 0x0300}}},
- { 0x1fd3, {3, {0x03b9, 0x0308, 0x0301}}},
- { 0x1fd6, {2, {0x03b9, 0x0342}}},
- { 0x1fd7, {3, {0x03b9, 0x0308, 0x0342}}},
- { 0x1fd8, {1, {0x1fd0}}},
- { 0x1fd9, {1, {0x1fd1}}},
- { 0x1fda, {1, {0x1f76}}},
- { 0x1fdb, {1, {0x1f77}}},
- { 0x1fe2, {3, {0x03c5, 0x0308, 0x0300}}},
- { 0x1fe3, {3, {0x03c5, 0x0308, 0x0301}}},
- { 0x1fe4, {2, {0x03c1, 0x0313}}},
- { 0x1fe6, {2, {0x03c5, 0x0342}}},
- { 0x1fe7, {3, {0x03c5, 0x0308, 0x0342}}},
- { 0x1fe8, {1, {0x1fe0}}},
- { 0x1fe9, {1, {0x1fe1}}},
- { 0x1fea, {1, {0x1f7a}}},
- { 0x1feb, {1, {0x1f7b}}},
- { 0x1fec, {1, {0x1fe5}}},
- { 0x1ff2, {2, {0x1f7c, 0x03b9}}},
- { 0x1ff3, {2, {0x03c9, 0x03b9}}},
- { 0x1ff4, {2, {0x03ce, 0x03b9}}},
- { 0x1ff6, {2, {0x03c9, 0x0342}}},
- { 0x1ff7, {3, {0x03c9, 0x0342, 0x03b9}}},
- { 0x1ff8, {1, {0x1f78}}},
- { 0x1ff9, {1, {0x1f79}}},
- { 0x1ffa, {1, {0x1f7c}}},
- { 0x1ffb, {1, {0x1f7d}}},
- { 0x1ffc, {2, {0x03c9, 0x03b9}}},
- { 0x2126, {1, {0x03c9}}},
- { 0x212a, {1, {0x006b}}},
- { 0x212b, {1, {0x00e5}}},
- { 0x2160, {1, {0x2170}}},
- { 0x2161, {1, {0x2171}}},
- { 0x2162, {1, {0x2172}}},
- { 0x2163, {1, {0x2173}}},
- { 0x2164, {1, {0x2174}}},
- { 0x2165, {1, {0x2175}}},
- { 0x2166, {1, {0x2176}}},
- { 0x2167, {1, {0x2177}}},
- { 0x2168, {1, {0x2178}}},
- { 0x2169, {1, {0x2179}}},
- { 0x216a, {1, {0x217a}}},
- { 0x216b, {1, {0x217b}}},
- { 0x216c, {1, {0x217c}}},
- { 0x216d, {1, {0x217d}}},
- { 0x216e, {1, {0x217e}}},
- { 0x216f, {1, {0x217f}}},
- { 0x24b6, {1, {0x24d0}}},
- { 0x24b7, {1, {0x24d1}}},
- { 0x24b8, {1, {0x24d2}}},
- { 0x24b9, {1, {0x24d3}}},
- { 0x24ba, {1, {0x24d4}}},
- { 0x24bb, {1, {0x24d5}}},
- { 0x24bc, {1, {0x24d6}}},
- { 0x24bd, {1, {0x24d7}}},
- { 0x24be, {1, {0x24d8}}},
- { 0x24bf, {1, {0x24d9}}},
- { 0x24c0, {1, {0x24da}}},
- { 0x24c1, {1, {0x24db}}},
- { 0x24c2, {1, {0x24dc}}},
- { 0x24c3, {1, {0x24dd}}},
- { 0x24c4, {1, {0x24de}}},
- { 0x24c5, {1, {0x24df}}},
- { 0x24c6, {1, {0x24e0}}},
- { 0x24c7, {1, {0x24e1}}},
- { 0x24c8, {1, {0x24e2}}},
- { 0x24c9, {1, {0x24e3}}},
- { 0x24ca, {1, {0x24e4}}},
- { 0x24cb, {1, {0x24e5}}},
- { 0x24cc, {1, {0x24e6}}},
- { 0x24cd, {1, {0x24e7}}},
- { 0x24ce, {1, {0x24e8}}},
- { 0x24cf, {1, {0x24e9}}},
- { 0x2c00, {1, {0x2c30}}},
- { 0x2c01, {1, {0x2c31}}},
- { 0x2c02, {1, {0x2c32}}},
- { 0x2c03, {1, {0x2c33}}},
- { 0x2c04, {1, {0x2c34}}},
- { 0x2c05, {1, {0x2c35}}},
- { 0x2c06, {1, {0x2c36}}},
- { 0x2c07, {1, {0x2c37}}},
- { 0x2c08, {1, {0x2c38}}},
- { 0x2c09, {1, {0x2c39}}},
- { 0x2c0a, {1, {0x2c3a}}},
- { 0x2c0b, {1, {0x2c3b}}},
- { 0x2c0c, {1, {0x2c3c}}},
- { 0x2c0d, {1, {0x2c3d}}},
- { 0x2c0e, {1, {0x2c3e}}},
- { 0x2c0f, {1, {0x2c3f}}},
- { 0x2c10, {1, {0x2c40}}},
- { 0x2c11, {1, {0x2c41}}},
- { 0x2c12, {1, {0x2c42}}},
- { 0x2c13, {1, {0x2c43}}},
- { 0x2c14, {1, {0x2c44}}},
- { 0x2c15, {1, {0x2c45}}},
- { 0x2c16, {1, {0x2c46}}},
- { 0x2c17, {1, {0x2c47}}},
- { 0x2c18, {1, {0x2c48}}},
- { 0x2c19, {1, {0x2c49}}},
- { 0x2c1a, {1, {0x2c4a}}},
- { 0x2c1b, {1, {0x2c4b}}},
- { 0x2c1c, {1, {0x2c4c}}},
- { 0x2c1d, {1, {0x2c4d}}},
- { 0x2c1e, {1, {0x2c4e}}},
- { 0x2c1f, {1, {0x2c4f}}},
- { 0x2c20, {1, {0x2c50}}},
- { 0x2c21, {1, {0x2c51}}},
- { 0x2c22, {1, {0x2c52}}},
- { 0x2c23, {1, {0x2c53}}},
- { 0x2c24, {1, {0x2c54}}},
- { 0x2c25, {1, {0x2c55}}},
- { 0x2c26, {1, {0x2c56}}},
- { 0x2c27, {1, {0x2c57}}},
- { 0x2c28, {1, {0x2c58}}},
- { 0x2c29, {1, {0x2c59}}},
- { 0x2c2a, {1, {0x2c5a}}},
- { 0x2c2b, {1, {0x2c5b}}},
- { 0x2c2c, {1, {0x2c5c}}},
- { 0x2c2d, {1, {0x2c5d}}},
- { 0x2c2e, {1, {0x2c5e}}},
- { 0x2c80, {1, {0x2c81}}},
- { 0x2c82, {1, {0x2c83}}},
- { 0x2c84, {1, {0x2c85}}},
- { 0x2c86, {1, {0x2c87}}},
- { 0x2c88, {1, {0x2c89}}},
- { 0x2c8a, {1, {0x2c8b}}},
- { 0x2c8c, {1, {0x2c8d}}},
- { 0x2c8e, {1, {0x2c8f}}},
- { 0x2c90, {1, {0x2c91}}},
- { 0x2c92, {1, {0x2c93}}},
- { 0x2c94, {1, {0x2c95}}},
- { 0x2c96, {1, {0x2c97}}},
- { 0x2c98, {1, {0x2c99}}},
- { 0x2c9a, {1, {0x2c9b}}},
- { 0x2c9c, {1, {0x2c9d}}},
- { 0x2c9e, {1, {0x2c9f}}},
- { 0x2ca0, {1, {0x2ca1}}},
- { 0x2ca2, {1, {0x2ca3}}},
- { 0x2ca4, {1, {0x2ca5}}},
- { 0x2ca6, {1, {0x2ca7}}},
- { 0x2ca8, {1, {0x2ca9}}},
- { 0x2caa, {1, {0x2cab}}},
- { 0x2cac, {1, {0x2cad}}},
- { 0x2cae, {1, {0x2caf}}},
- { 0x2cb0, {1, {0x2cb1}}},
- { 0x2cb2, {1, {0x2cb3}}},
- { 0x2cb4, {1, {0x2cb5}}},
- { 0x2cb6, {1, {0x2cb7}}},
- { 0x2cb8, {1, {0x2cb9}}},
- { 0x2cba, {1, {0x2cbb}}},
- { 0x2cbc, {1, {0x2cbd}}},
- { 0x2cbe, {1, {0x2cbf}}},
- { 0x2cc0, {1, {0x2cc1}}},
- { 0x2cc2, {1, {0x2cc3}}},
- { 0x2cc4, {1, {0x2cc5}}},
- { 0x2cc6, {1, {0x2cc7}}},
- { 0x2cc8, {1, {0x2cc9}}},
- { 0x2cca, {1, {0x2ccb}}},
- { 0x2ccc, {1, {0x2ccd}}},
- { 0x2cce, {1, {0x2ccf}}},
- { 0x2cd0, {1, {0x2cd1}}},
- { 0x2cd2, {1, {0x2cd3}}},
- { 0x2cd4, {1, {0x2cd5}}},
- { 0x2cd6, {1, {0x2cd7}}},
- { 0x2cd8, {1, {0x2cd9}}},
- { 0x2cda, {1, {0x2cdb}}},
- { 0x2cdc, {1, {0x2cdd}}},
- { 0x2cde, {1, {0x2cdf}}},
- { 0x2ce0, {1, {0x2ce1}}},
- { 0x2ce2, {1, {0x2ce3}}},
- { 0xfb00, {2, {0x0066, 0x0066}}},
- { 0xfb01, {2, {0x0066, 0x0069}}},
- { 0xfb02, {2, {0x0066, 0x006c}}},
- { 0xfb03, {3, {0x0066, 0x0066, 0x0069}}},
- { 0xfb04, {3, {0x0066, 0x0066, 0x006c}}},
- { 0xfb05, {2, {0x0073, 0x0074}}},
- { 0xfb06, {2, {0x0073, 0x0074}}},
- { 0xfb13, {2, {0x0574, 0x0576}}},
- { 0xfb14, {2, {0x0574, 0x0565}}},
- { 0xfb15, {2, {0x0574, 0x056b}}},
- { 0xfb16, {2, {0x057e, 0x0576}}},
- { 0xfb17, {2, {0x0574, 0x056d}}},
- { 0xff21, {1, {0xff41}}},
- { 0xff22, {1, {0xff42}}},
- { 0xff23, {1, {0xff43}}},
- { 0xff24, {1, {0xff44}}},
- { 0xff25, {1, {0xff45}}},
- { 0xff26, {1, {0xff46}}},
- { 0xff27, {1, {0xff47}}},
- { 0xff28, {1, {0xff48}}},
- { 0xff29, {1, {0xff49}}},
- { 0xff2a, {1, {0xff4a}}},
- { 0xff2b, {1, {0xff4b}}},
- { 0xff2c, {1, {0xff4c}}},
- { 0xff2d, {1, {0xff4d}}},
- { 0xff2e, {1, {0xff4e}}},
- { 0xff2f, {1, {0xff4f}}},
- { 0xff30, {1, {0xff50}}},
- { 0xff31, {1, {0xff51}}},
- { 0xff32, {1, {0xff52}}},
- { 0xff33, {1, {0xff53}}},
- { 0xff34, {1, {0xff54}}},
- { 0xff35, {1, {0xff55}}},
- { 0xff36, {1, {0xff56}}},
- { 0xff37, {1, {0xff57}}},
- { 0xff38, {1, {0xff58}}},
- { 0xff39, {1, {0xff59}}},
- { 0xff3a, {1, {0xff5a}}},
- { 0x10400, {1, {0x10428}}},
- { 0x10401, {1, {0x10429}}},
- { 0x10402, {1, {0x1042a}}},
- { 0x10403, {1, {0x1042b}}},
- { 0x10404, {1, {0x1042c}}},
- { 0x10405, {1, {0x1042d}}},
- { 0x10406, {1, {0x1042e}}},
- { 0x10407, {1, {0x1042f}}},
- { 0x10408, {1, {0x10430}}},
- { 0x10409, {1, {0x10431}}},
- { 0x1040a, {1, {0x10432}}},
- { 0x1040b, {1, {0x10433}}},
- { 0x1040c, {1, {0x10434}}},
- { 0x1040d, {1, {0x10435}}},
- { 0x1040e, {1, {0x10436}}},
- { 0x1040f, {1, {0x10437}}},
- { 0x10410, {1, {0x10438}}},
- { 0x10411, {1, {0x10439}}},
- { 0x10412, {1, {0x1043a}}},
- { 0x10413, {1, {0x1043b}}},
- { 0x10414, {1, {0x1043c}}},
- { 0x10415, {1, {0x1043d}}},
- { 0x10416, {1, {0x1043e}}},
- { 0x10417, {1, {0x1043f}}},
- { 0x10418, {1, {0x10440}}},
- { 0x10419, {1, {0x10441}}},
- { 0x1041a, {1, {0x10442}}},
- { 0x1041b, {1, {0x10443}}},
- { 0x1041c, {1, {0x10444}}},
- { 0x1041d, {1, {0x10445}}},
- { 0x1041e, {1, {0x10446}}},
- { 0x1041f, {1, {0x10447}}},
- { 0x10420, {1, {0x10448}}},
- { 0x10421, {1, {0x10449}}},
- { 0x10422, {1, {0x1044a}}},
- { 0x10423, {1, {0x1044b}}},
- { 0x10424, {1, {0x1044c}}},
- { 0x10425, {1, {0x1044d}}},
- { 0x10426, {1, {0x1044e}}},
- { 0x10427, {1, {0x1044f}}}
-};
-
-static const CaseFold_11_Type CaseFold_Locale[] = {
- { 0x0049, {1, {0x0069}}},
- { 0x0130, {2, {0x0069, 0x0307}}}
-};
-
-static const CaseUnfold_11_Type CaseUnfold_11[] = {
- { 0x0061, {1, {0x0041 }}},
- { 0x0062, {1, {0x0042 }}},
- { 0x0063, {1, {0x0043 }}},
- { 0x0064, {1, {0x0044 }}},
- { 0x0065, {1, {0x0045 }}},
- { 0x0066, {1, {0x0046 }}},
- { 0x0067, {1, {0x0047 }}},
- { 0x0068, {1, {0x0048 }}},
- { 0x006a, {1, {0x004a }}},
- { 0x006b, {2, {0x212a, 0x004b }}},
- { 0x006c, {1, {0x004c }}},
- { 0x006d, {1, {0x004d }}},
- { 0x006e, {1, {0x004e }}},
- { 0x006f, {1, {0x004f }}},
- { 0x0070, {1, {0x0050 }}},
- { 0x0071, {1, {0x0051 }}},
- { 0x0072, {1, {0x0052 }}},
- { 0x0073, {2, {0x0053, 0x017f }}},
- { 0x0074, {1, {0x0054 }}},
- { 0x0075, {1, {0x0055 }}},
- { 0x0076, {1, {0x0056 }}},
- { 0x0077, {1, {0x0057 }}},
- { 0x0078, {1, {0x0058 }}},
- { 0x0079, {1, {0x0059 }}},
- { 0x007a, {1, {0x005a }}},
- { 0x00e0, {1, {0x00c0 }}},
- { 0x00e1, {1, {0x00c1 }}},
- { 0x00e2, {1, {0x00c2 }}},
- { 0x00e3, {1, {0x00c3 }}},
- { 0x00e4, {1, {0x00c4 }}},
- { 0x00e5, {2, {0x212b, 0x00c5 }}},
- { 0x00e6, {1, {0x00c6 }}},
- { 0x00e7, {1, {0x00c7 }}},
- { 0x00e8, {1, {0x00c8 }}},
- { 0x00e9, {1, {0x00c9 }}},
- { 0x00ea, {1, {0x00ca }}},
- { 0x00eb, {1, {0x00cb }}},
- { 0x00ec, {1, {0x00cc }}},
- { 0x00ed, {1, {0x00cd }}},
- { 0x00ee, {1, {0x00ce }}},
- { 0x00ef, {1, {0x00cf }}},
- { 0x00f0, {1, {0x00d0 }}},
- { 0x00f1, {1, {0x00d1 }}},
- { 0x00f2, {1, {0x00d2 }}},
- { 0x00f3, {1, {0x00d3 }}},
- { 0x00f4, {1, {0x00d4 }}},
- { 0x00f5, {1, {0x00d5 }}},
- { 0x00f6, {1, {0x00d6 }}},
- { 0x00f8, {1, {0x00d8 }}},
- { 0x00f9, {1, {0x00d9 }}},
- { 0x00fa, {1, {0x00da }}},
- { 0x00fb, {1, {0x00db }}},
- { 0x00fc, {1, {0x00dc }}},
- { 0x00fd, {1, {0x00dd }}},
- { 0x00fe, {1, {0x00de }}},
- { 0x00ff, {1, {0x0178 }}},
- { 0x0101, {1, {0x0100 }}},
- { 0x0103, {1, {0x0102 }}},
- { 0x0105, {1, {0x0104 }}},
- { 0x0107, {1, {0x0106 }}},
- { 0x0109, {1, {0x0108 }}},
- { 0x010b, {1, {0x010a }}},
- { 0x010d, {1, {0x010c }}},
- { 0x010f, {1, {0x010e }}},
- { 0x0111, {1, {0x0110 }}},
- { 0x0113, {1, {0x0112 }}},
- { 0x0115, {1, {0x0114 }}},
- { 0x0117, {1, {0x0116 }}},
- { 0x0119, {1, {0x0118 }}},
- { 0x011b, {1, {0x011a }}},
- { 0x011d, {1, {0x011c }}},
- { 0x011f, {1, {0x011e }}},
- { 0x0121, {1, {0x0120 }}},
- { 0x0123, {1, {0x0122 }}},
- { 0x0125, {1, {0x0124 }}},
- { 0x0127, {1, {0x0126 }}},
- { 0x0129, {1, {0x0128 }}},
- { 0x012b, {1, {0x012a }}},
- { 0x012d, {1, {0x012c }}},
- { 0x012f, {1, {0x012e }}},
- { 0x0133, {1, {0x0132 }}},
- { 0x0135, {1, {0x0134 }}},
- { 0x0137, {1, {0x0136 }}},
- { 0x013a, {1, {0x0139 }}},
- { 0x013c, {1, {0x013b }}},
- { 0x013e, {1, {0x013d }}},
- { 0x0140, {1, {0x013f }}},
- { 0x0142, {1, {0x0141 }}},
- { 0x0144, {1, {0x0143 }}},
- { 0x0146, {1, {0x0145 }}},
- { 0x0148, {1, {0x0147 }}},
- { 0x014b, {1, {0x014a }}},
- { 0x014d, {1, {0x014c }}},
- { 0x014f, {1, {0x014e }}},
- { 0x0151, {1, {0x0150 }}},
- { 0x0153, {1, {0x0152 }}},
- { 0x0155, {1, {0x0154 }}},
- { 0x0157, {1, {0x0156 }}},
- { 0x0159, {1, {0x0158 }}},
- { 0x015b, {1, {0x015a }}},
- { 0x015d, {1, {0x015c }}},
- { 0x015f, {1, {0x015e }}},
- { 0x0161, {1, {0x0160 }}},
- { 0x0163, {1, {0x0162 }}},
- { 0x0165, {1, {0x0164 }}},
- { 0x0167, {1, {0x0166 }}},
- { 0x0169, {1, {0x0168 }}},
- { 0x016b, {1, {0x016a }}},
- { 0x016d, {1, {0x016c }}},
- { 0x016f, {1, {0x016e }}},
- { 0x0171, {1, {0x0170 }}},
- { 0x0173, {1, {0x0172 }}},
- { 0x0175, {1, {0x0174 }}},
- { 0x0177, {1, {0x0176 }}},
- { 0x017a, {1, {0x0179 }}},
- { 0x017c, {1, {0x017b }}},
- { 0x017e, {1, {0x017d }}},
- { 0x0183, {1, {0x0182 }}},
- { 0x0185, {1, {0x0184 }}},
- { 0x0188, {1, {0x0187 }}},
- { 0x018c, {1, {0x018b }}},
- { 0x0192, {1, {0x0191 }}},
- { 0x0195, {1, {0x01f6 }}},
- { 0x0199, {1, {0x0198 }}},
- { 0x019a, {1, {0x023d }}},
- { 0x019e, {1, {0x0220 }}},
- { 0x01a1, {1, {0x01a0 }}},
- { 0x01a3, {1, {0x01a2 }}},
- { 0x01a5, {1, {0x01a4 }}},
- { 0x01a8, {1, {0x01a7 }}},
- { 0x01ad, {1, {0x01ac }}},
- { 0x01b0, {1, {0x01af }}},
- { 0x01b4, {1, {0x01b3 }}},
- { 0x01b6, {1, {0x01b5 }}},
- { 0x01b9, {1, {0x01b8 }}},
- { 0x01bd, {1, {0x01bc }}},
- { 0x01bf, {1, {0x01f7 }}},
- { 0x01c6, {2, {0x01c4, 0x01c5 }}},
- { 0x01c9, {2, {0x01c7, 0x01c8 }}},
- { 0x01cc, {2, {0x01ca, 0x01cb }}},
- { 0x01ce, {1, {0x01cd }}},
- { 0x01d0, {1, {0x01cf }}},
- { 0x01d2, {1, {0x01d1 }}},
- { 0x01d4, {1, {0x01d3 }}},
- { 0x01d6, {1, {0x01d5 }}},
- { 0x01d8, {1, {0x01d7 }}},
- { 0x01da, {1, {0x01d9 }}},
- { 0x01dc, {1, {0x01db }}},
- { 0x01dd, {1, {0x018e }}},
- { 0x01df, {1, {0x01de }}},
- { 0x01e1, {1, {0x01e0 }}},
- { 0x01e3, {1, {0x01e2 }}},
- { 0x01e5, {1, {0x01e4 }}},
- { 0x01e7, {1, {0x01e6 }}},
- { 0x01e9, {1, {0x01e8 }}},
- { 0x01eb, {1, {0x01ea }}},
- { 0x01ed, {1, {0x01ec }}},
- { 0x01ef, {1, {0x01ee }}},
- { 0x01f3, {2, {0x01f1, 0x01f2 }}},
- { 0x01f5, {1, {0x01f4 }}},
- { 0x01f9, {1, {0x01f8 }}},
- { 0x01fb, {1, {0x01fa }}},
- { 0x01fd, {1, {0x01fc }}},
- { 0x01ff, {1, {0x01fe }}},
- { 0x0201, {1, {0x0200 }}},
- { 0x0203, {1, {0x0202 }}},
- { 0x0205, {1, {0x0204 }}},
- { 0x0207, {1, {0x0206 }}},
- { 0x0209, {1, {0x0208 }}},
- { 0x020b, {1, {0x020a }}},
- { 0x020d, {1, {0x020c }}},
- { 0x020f, {1, {0x020e }}},
- { 0x0211, {1, {0x0210 }}},
- { 0x0213, {1, {0x0212 }}},
- { 0x0215, {1, {0x0214 }}},
- { 0x0217, {1, {0x0216 }}},
- { 0x0219, {1, {0x0218 }}},
- { 0x021b, {1, {0x021a }}},
- { 0x021d, {1, {0x021c }}},
- { 0x021f, {1, {0x021e }}},
- { 0x0223, {1, {0x0222 }}},
- { 0x0225, {1, {0x0224 }}},
- { 0x0227, {1, {0x0226 }}},
- { 0x0229, {1, {0x0228 }}},
- { 0x022b, {1, {0x022a }}},
- { 0x022d, {1, {0x022c }}},
- { 0x022f, {1, {0x022e }}},
- { 0x0231, {1, {0x0230 }}},
- { 0x0233, {1, {0x0232 }}},
- { 0x023c, {1, {0x023b }}},
- { 0x0253, {1, {0x0181 }}},
- { 0x0254, {1, {0x0186 }}},
- { 0x0256, {1, {0x0189 }}},
- { 0x0257, {1, {0x018a }}},
- { 0x0259, {1, {0x018f }}},
- { 0x025b, {1, {0x0190 }}},
- { 0x0260, {1, {0x0193 }}},
- { 0x0263, {1, {0x0194 }}},
- { 0x0268, {1, {0x0197 }}},
- { 0x0269, {1, {0x0196 }}},
- { 0x026f, {1, {0x019c }}},
- { 0x0272, {1, {0x019d }}},
- { 0x0275, {1, {0x019f }}},
- { 0x0280, {1, {0x01a6 }}},
- { 0x0283, {1, {0x01a9 }}},
- { 0x0288, {1, {0x01ae }}},
- { 0x028a, {1, {0x01b1 }}},
- { 0x028b, {1, {0x01b2 }}},
- { 0x0292, {1, {0x01b7 }}},
- { 0x0294, {1, {0x0241 }}},
- { 0x03ac, {1, {0x0386 }}},
- { 0x03ad, {1, {0x0388 }}},
- { 0x03ae, {1, {0x0389 }}},
- { 0x03af, {1, {0x038a }}},
- { 0x03b1, {1, {0x0391 }}},
- { 0x03b2, {2, {0x0392, 0x03d0 }}},
- { 0x03b3, {1, {0x0393 }}},
- { 0x03b4, {1, {0x0394 }}},
- { 0x03b5, {2, {0x03f5, 0x0395 }}},
- { 0x03b6, {1, {0x0396 }}},
- { 0x03b7, {1, {0x0397 }}},
- { 0x03b8, {3, {0x03f4, 0x0398, 0x03d1 }}},
- { 0x03b9, {3, {0x1fbe, 0x0399, 0x0345 }}},
- { 0x03ba, {2, {0x03f0, 0x039a }}},
- { 0x03bb, {1, {0x039b }}},
- { 0x03bc, {2, {0x00b5, 0x039c }}},
- { 0x03bd, {1, {0x039d }}},
- { 0x03be, {1, {0x039e }}},
- { 0x03bf, {1, {0x039f }}},
- { 0x03c0, {2, {0x03a0, 0x03d6 }}},
- { 0x03c1, {2, {0x03f1, 0x03a1 }}},
- { 0x03c3, {2, {0x03a3, 0x03c2 }}},
- { 0x03c4, {1, {0x03a4 }}},
- { 0x03c5, {1, {0x03a5 }}},
- { 0x03c6, {2, {0x03a6, 0x03d5 }}},
- { 0x03c7, {1, {0x03a7 }}},
- { 0x03c8, {1, {0x03a8 }}},
- { 0x03c9, {2, {0x03a9, 0x2126 }}},
- { 0x03ca, {1, {0x03aa }}},
- { 0x03cb, {1, {0x03ab }}},
- { 0x03cc, {1, {0x038c }}},
- { 0x03cd, {1, {0x038e }}},
- { 0x03ce, {1, {0x038f }}},
- { 0x03d9, {1, {0x03d8 }}},
- { 0x03db, {1, {0x03da }}},
- { 0x03dd, {1, {0x03dc }}},
- { 0x03df, {1, {0x03de }}},
- { 0x03e1, {1, {0x03e0 }}},
- { 0x03e3, {1, {0x03e2 }}},
- { 0x03e5, {1, {0x03e4 }}},
- { 0x03e7, {1, {0x03e6 }}},
- { 0x03e9, {1, {0x03e8 }}},
- { 0x03eb, {1, {0x03ea }}},
- { 0x03ed, {1, {0x03ec }}},
- { 0x03ef, {1, {0x03ee }}},
- { 0x03f2, {1, {0x03f9 }}},
- { 0x03f8, {1, {0x03f7 }}},
- { 0x03fb, {1, {0x03fa }}},
- { 0x0430, {1, {0x0410 }}},
- { 0x0431, {1, {0x0411 }}},
- { 0x0432, {1, {0x0412 }}},
- { 0x0433, {1, {0x0413 }}},
- { 0x0434, {1, {0x0414 }}},
- { 0x0435, {1, {0x0415 }}},
- { 0x0436, {1, {0x0416 }}},
- { 0x0437, {1, {0x0417 }}},
- { 0x0438, {1, {0x0418 }}},
- { 0x0439, {1, {0x0419 }}},
- { 0x043a, {1, {0x041a }}},
- { 0x043b, {1, {0x041b }}},
- { 0x043c, {1, {0x041c }}},
- { 0x043d, {1, {0x041d }}},
- { 0x043e, {1, {0x041e }}},
- { 0x043f, {1, {0x041f }}},
- { 0x0440, {1, {0x0420 }}},
- { 0x0441, {1, {0x0421 }}},
- { 0x0442, {1, {0x0422 }}},
- { 0x0443, {1, {0x0423 }}},
- { 0x0444, {1, {0x0424 }}},
- { 0x0445, {1, {0x0425 }}},
- { 0x0446, {1, {0x0426 }}},
- { 0x0447, {1, {0x0427 }}},
- { 0x0448, {1, {0x0428 }}},
- { 0x0449, {1, {0x0429 }}},
- { 0x044a, {1, {0x042a }}},
- { 0x044b, {1, {0x042b }}},
- { 0x044c, {1, {0x042c }}},
- { 0x044d, {1, {0x042d }}},
- { 0x044e, {1, {0x042e }}},
- { 0x044f, {1, {0x042f }}},
- { 0x0450, {1, {0x0400 }}},
- { 0x0451, {1, {0x0401 }}},
- { 0x0452, {1, {0x0402 }}},
- { 0x0453, {1, {0x0403 }}},
- { 0x0454, {1, {0x0404 }}},
- { 0x0455, {1, {0x0405 }}},
- { 0x0456, {1, {0x0406 }}},
- { 0x0457, {1, {0x0407 }}},
- { 0x0458, {1, {0x0408 }}},
- { 0x0459, {1, {0x0409 }}},
- { 0x045a, {1, {0x040a }}},
- { 0x045b, {1, {0x040b }}},
- { 0x045c, {1, {0x040c }}},
- { 0x045d, {1, {0x040d }}},
- { 0x045e, {1, {0x040e }}},
- { 0x045f, {1, {0x040f }}},
- { 0x0461, {1, {0x0460 }}},
- { 0x0463, {1, {0x0462 }}},
- { 0x0465, {1, {0x0464 }}},
- { 0x0467, {1, {0x0466 }}},
- { 0x0469, {1, {0x0468 }}},
- { 0x046b, {1, {0x046a }}},
- { 0x046d, {1, {0x046c }}},
- { 0x046f, {1, {0x046e }}},
- { 0x0471, {1, {0x0470 }}},
- { 0x0473, {1, {0x0472 }}},
- { 0x0475, {1, {0x0474 }}},
- { 0x0477, {1, {0x0476 }}},
- { 0x0479, {1, {0x0478 }}},
- { 0x047b, {1, {0x047a }}},
- { 0x047d, {1, {0x047c }}},
- { 0x047f, {1, {0x047e }}},
- { 0x0481, {1, {0x0480 }}},
- { 0x048b, {1, {0x048a }}},
- { 0x048d, {1, {0x048c }}},
- { 0x048f, {1, {0x048e }}},
- { 0x0491, {1, {0x0490 }}},
- { 0x0493, {1, {0x0492 }}},
- { 0x0495, {1, {0x0494 }}},
- { 0x0497, {1, {0x0496 }}},
- { 0x0499, {1, {0x0498 }}},
- { 0x049b, {1, {0x049a }}},
- { 0x049d, {1, {0x049c }}},
- { 0x049f, {1, {0x049e }}},
- { 0x04a1, {1, {0x04a0 }}},
- { 0x04a3, {1, {0x04a2 }}},
- { 0x04a5, {1, {0x04a4 }}},
- { 0x04a7, {1, {0x04a6 }}},
- { 0x04a9, {1, {0x04a8 }}},
- { 0x04ab, {1, {0x04aa }}},
- { 0x04ad, {1, {0x04ac }}},
- { 0x04af, {1, {0x04ae }}},
- { 0x04b1, {1, {0x04b0 }}},
- { 0x04b3, {1, {0x04b2 }}},
- { 0x04b5, {1, {0x04b4 }}},
- { 0x04b7, {1, {0x04b6 }}},
- { 0x04b9, {1, {0x04b8 }}},
- { 0x04bb, {1, {0x04ba }}},
- { 0x04bd, {1, {0x04bc }}},
- { 0x04bf, {1, {0x04be }}},
- { 0x04c2, {1, {0x04c1 }}},
- { 0x04c4, {1, {0x04c3 }}},
- { 0x04c6, {1, {0x04c5 }}},
- { 0x04c8, {1, {0x04c7 }}},
- { 0x04ca, {1, {0x04c9 }}},
- { 0x04cc, {1, {0x04cb }}},
- { 0x04ce, {1, {0x04cd }}},
- { 0x04d1, {1, {0x04d0 }}},
- { 0x04d3, {1, {0x04d2 }}},
- { 0x04d5, {1, {0x04d4 }}},
- { 0x04d7, {1, {0x04d6 }}},
- { 0x04d9, {1, {0x04d8 }}},
- { 0x04db, {1, {0x04da }}},
- { 0x04dd, {1, {0x04dc }}},
- { 0x04df, {1, {0x04de }}},
- { 0x04e1, {1, {0x04e0 }}},
- { 0x04e3, {1, {0x04e2 }}},
- { 0x04e5, {1, {0x04e4 }}},
- { 0x04e7, {1, {0x04e6 }}},
- { 0x04e9, {1, {0x04e8 }}},
- { 0x04eb, {1, {0x04ea }}},
- { 0x04ed, {1, {0x04ec }}},
- { 0x04ef, {1, {0x04ee }}},
- { 0x04f1, {1, {0x04f0 }}},
- { 0x04f3, {1, {0x04f2 }}},
- { 0x04f5, {1, {0x04f4 }}},
- { 0x04f7, {1, {0x04f6 }}},
- { 0x04f9, {1, {0x04f8 }}},
- { 0x0501, {1, {0x0500 }}},
- { 0x0503, {1, {0x0502 }}},
- { 0x0505, {1, {0x0504 }}},
- { 0x0507, {1, {0x0506 }}},
- { 0x0509, {1, {0x0508 }}},
- { 0x050b, {1, {0x050a }}},
- { 0x050d, {1, {0x050c }}},
- { 0x050f, {1, {0x050e }}},
- { 0x0561, {1, {0x0531 }}},
- { 0x0562, {1, {0x0532 }}},
- { 0x0563, {1, {0x0533 }}},
- { 0x0564, {1, {0x0534 }}},
- { 0x0565, {1, {0x0535 }}},
- { 0x0566, {1, {0x0536 }}},
- { 0x0567, {1, {0x0537 }}},
- { 0x0568, {1, {0x0538 }}},
- { 0x0569, {1, {0x0539 }}},
- { 0x056a, {1, {0x053a }}},
- { 0x056b, {1, {0x053b }}},
- { 0x056c, {1, {0x053c }}},
- { 0x056d, {1, {0x053d }}},
- { 0x056e, {1, {0x053e }}},
- { 0x056f, {1, {0x053f }}},
- { 0x0570, {1, {0x0540 }}},
- { 0x0571, {1, {0x0541 }}},
- { 0x0572, {1, {0x0542 }}},
- { 0x0573, {1, {0x0543 }}},
- { 0x0574, {1, {0x0544 }}},
- { 0x0575, {1, {0x0545 }}},
- { 0x0576, {1, {0x0546 }}},
- { 0x0577, {1, {0x0547 }}},
- { 0x0578, {1, {0x0548 }}},
- { 0x0579, {1, {0x0549 }}},
- { 0x057a, {1, {0x054a }}},
- { 0x057b, {1, {0x054b }}},
- { 0x057c, {1, {0x054c }}},
- { 0x057d, {1, {0x054d }}},
- { 0x057e, {1, {0x054e }}},
- { 0x057f, {1, {0x054f }}},
- { 0x0580, {1, {0x0550 }}},
- { 0x0581, {1, {0x0551 }}},
- { 0x0582, {1, {0x0552 }}},
- { 0x0583, {1, {0x0553 }}},
- { 0x0584, {1, {0x0554 }}},
- { 0x0585, {1, {0x0555 }}},
- { 0x0586, {1, {0x0556 }}},
- { 0x1e01, {1, {0x1e00 }}},
- { 0x1e03, {1, {0x1e02 }}},
- { 0x1e05, {1, {0x1e04 }}},
- { 0x1e07, {1, {0x1e06 }}},
- { 0x1e09, {1, {0x1e08 }}},
- { 0x1e0b, {1, {0x1e0a }}},
- { 0x1e0d, {1, {0x1e0c }}},
- { 0x1e0f, {1, {0x1e0e }}},
- { 0x1e11, {1, {0x1e10 }}},
- { 0x1e13, {1, {0x1e12 }}},
- { 0x1e15, {1, {0x1e14 }}},
- { 0x1e17, {1, {0x1e16 }}},
- { 0x1e19, {1, {0x1e18 }}},
- { 0x1e1b, {1, {0x1e1a }}},
- { 0x1e1d, {1, {0x1e1c }}},
- { 0x1e1f, {1, {0x1e1e }}},
- { 0x1e21, {1, {0x1e20 }}},
- { 0x1e23, {1, {0x1e22 }}},
- { 0x1e25, {1, {0x1e24 }}},
- { 0x1e27, {1, {0x1e26 }}},
- { 0x1e29, {1, {0x1e28 }}},
- { 0x1e2b, {1, {0x1e2a }}},
- { 0x1e2d, {1, {0x1e2c }}},
- { 0x1e2f, {1, {0x1e2e }}},
- { 0x1e31, {1, {0x1e30 }}},
- { 0x1e33, {1, {0x1e32 }}},
- { 0x1e35, {1, {0x1e34 }}},
- { 0x1e37, {1, {0x1e36 }}},
- { 0x1e39, {1, {0x1e38 }}},
- { 0x1e3b, {1, {0x1e3a }}},
- { 0x1e3d, {1, {0x1e3c }}},
- { 0x1e3f, {1, {0x1e3e }}},
- { 0x1e41, {1, {0x1e40 }}},
- { 0x1e43, {1, {0x1e42 }}},
- { 0x1e45, {1, {0x1e44 }}},
- { 0x1e47, {1, {0x1e46 }}},
- { 0x1e49, {1, {0x1e48 }}},
- { 0x1e4b, {1, {0x1e4a }}},
- { 0x1e4d, {1, {0x1e4c }}},
- { 0x1e4f, {1, {0x1e4e }}},
- { 0x1e51, {1, {0x1e50 }}},
- { 0x1e53, {1, {0x1e52 }}},
- { 0x1e55, {1, {0x1e54 }}},
- { 0x1e57, {1, {0x1e56 }}},
- { 0x1e59, {1, {0x1e58 }}},
- { 0x1e5b, {1, {0x1e5a }}},
- { 0x1e5d, {1, {0x1e5c }}},
- { 0x1e5f, {1, {0x1e5e }}},
- { 0x1e61, {2, {0x1e9b, 0x1e60 }}},
- { 0x1e63, {1, {0x1e62 }}},
- { 0x1e65, {1, {0x1e64 }}},
- { 0x1e67, {1, {0x1e66 }}},
- { 0x1e69, {1, {0x1e68 }}},
- { 0x1e6b, {1, {0x1e6a }}},
- { 0x1e6d, {1, {0x1e6c }}},
- { 0x1e6f, {1, {0x1e6e }}},
- { 0x1e71, {1, {0x1e70 }}},
- { 0x1e73, {1, {0x1e72 }}},
- { 0x1e75, {1, {0x1e74 }}},
- { 0x1e77, {1, {0x1e76 }}},
- { 0x1e79, {1, {0x1e78 }}},
- { 0x1e7b, {1, {0x1e7a }}},
- { 0x1e7d, {1, {0x1e7c }}},
- { 0x1e7f, {1, {0x1e7e }}},
- { 0x1e81, {1, {0x1e80 }}},
- { 0x1e83, {1, {0x1e82 }}},
- { 0x1e85, {1, {0x1e84 }}},
- { 0x1e87, {1, {0x1e86 }}},
- { 0x1e89, {1, {0x1e88 }}},
- { 0x1e8b, {1, {0x1e8a }}},
- { 0x1e8d, {1, {0x1e8c }}},
- { 0x1e8f, {1, {0x1e8e }}},
- { 0x1e91, {1, {0x1e90 }}},
- { 0x1e93, {1, {0x1e92 }}},
- { 0x1e95, {1, {0x1e94 }}},
- { 0x1ea1, {1, {0x1ea0 }}},
- { 0x1ea3, {1, {0x1ea2 }}},
- { 0x1ea5, {1, {0x1ea4 }}},
- { 0x1ea7, {1, {0x1ea6 }}},
- { 0x1ea9, {1, {0x1ea8 }}},
- { 0x1eab, {1, {0x1eaa }}},
- { 0x1ead, {1, {0x1eac }}},
- { 0x1eaf, {1, {0x1eae }}},
- { 0x1eb1, {1, {0x1eb0 }}},
- { 0x1eb3, {1, {0x1eb2 }}},
- { 0x1eb5, {1, {0x1eb4 }}},
- { 0x1eb7, {1, {0x1eb6 }}},
- { 0x1eb9, {1, {0x1eb8 }}},
- { 0x1ebb, {1, {0x1eba }}},
- { 0x1ebd, {1, {0x1ebc }}},
- { 0x1ebf, {1, {0x1ebe }}},
- { 0x1ec1, {1, {0x1ec0 }}},
- { 0x1ec3, {1, {0x1ec2 }}},
- { 0x1ec5, {1, {0x1ec4 }}},
- { 0x1ec7, {1, {0x1ec6 }}},
- { 0x1ec9, {1, {0x1ec8 }}},
- { 0x1ecb, {1, {0x1eca }}},
- { 0x1ecd, {1, {0x1ecc }}},
- { 0x1ecf, {1, {0x1ece }}},
- { 0x1ed1, {1, {0x1ed0 }}},
- { 0x1ed3, {1, {0x1ed2 }}},
- { 0x1ed5, {1, {0x1ed4 }}},
- { 0x1ed7, {1, {0x1ed6 }}},
- { 0x1ed9, {1, {0x1ed8 }}},
- { 0x1edb, {1, {0x1eda }}},
- { 0x1edd, {1, {0x1edc }}},
- { 0x1edf, {1, {0x1ede }}},
- { 0x1ee1, {1, {0x1ee0 }}},
- { 0x1ee3, {1, {0x1ee2 }}},
- { 0x1ee5, {1, {0x1ee4 }}},
- { 0x1ee7, {1, {0x1ee6 }}},
- { 0x1ee9, {1, {0x1ee8 }}},
- { 0x1eeb, {1, {0x1eea }}},
- { 0x1eed, {1, {0x1eec }}},
- { 0x1eef, {1, {0x1eee }}},
- { 0x1ef1, {1, {0x1ef0 }}},
- { 0x1ef3, {1, {0x1ef2 }}},
- { 0x1ef5, {1, {0x1ef4 }}},
- { 0x1ef7, {1, {0x1ef6 }}},
- { 0x1ef9, {1, {0x1ef8 }}},
- { 0x1f00, {1, {0x1f08 }}},
- { 0x1f01, {1, {0x1f09 }}},
- { 0x1f02, {1, {0x1f0a }}},
- { 0x1f03, {1, {0x1f0b }}},
- { 0x1f04, {1, {0x1f0c }}},
- { 0x1f05, {1, {0x1f0d }}},
- { 0x1f06, {1, {0x1f0e }}},
- { 0x1f07, {1, {0x1f0f }}},
- { 0x1f10, {1, {0x1f18 }}},
- { 0x1f11, {1, {0x1f19 }}},
- { 0x1f12, {1, {0x1f1a }}},
- { 0x1f13, {1, {0x1f1b }}},
- { 0x1f14, {1, {0x1f1c }}},
- { 0x1f15, {1, {0x1f1d }}},
- { 0x1f20, {1, {0x1f28 }}},
- { 0x1f21, {1, {0x1f29 }}},
- { 0x1f22, {1, {0x1f2a }}},
- { 0x1f23, {1, {0x1f2b }}},
- { 0x1f24, {1, {0x1f2c }}},
- { 0x1f25, {1, {0x1f2d }}},
- { 0x1f26, {1, {0x1f2e }}},
- { 0x1f27, {1, {0x1f2f }}},
- { 0x1f30, {1, {0x1f38 }}},
- { 0x1f31, {1, {0x1f39 }}},
- { 0x1f32, {1, {0x1f3a }}},
- { 0x1f33, {1, {0x1f3b }}},
- { 0x1f34, {1, {0x1f3c }}},
- { 0x1f35, {1, {0x1f3d }}},
- { 0x1f36, {1, {0x1f3e }}},
- { 0x1f37, {1, {0x1f3f }}},
- { 0x1f40, {1, {0x1f48 }}},
- { 0x1f41, {1, {0x1f49 }}},
- { 0x1f42, {1, {0x1f4a }}},
- { 0x1f43, {1, {0x1f4b }}},
- { 0x1f44, {1, {0x1f4c }}},
- { 0x1f45, {1, {0x1f4d }}},
- { 0x1f51, {1, {0x1f59 }}},
- { 0x1f53, {1, {0x1f5b }}},
- { 0x1f55, {1, {0x1f5d }}},
- { 0x1f57, {1, {0x1f5f }}},
- { 0x1f60, {1, {0x1f68 }}},
- { 0x1f61, {1, {0x1f69 }}},
- { 0x1f62, {1, {0x1f6a }}},
- { 0x1f63, {1, {0x1f6b }}},
- { 0x1f64, {1, {0x1f6c }}},
- { 0x1f65, {1, {0x1f6d }}},
- { 0x1f66, {1, {0x1f6e }}},
- { 0x1f67, {1, {0x1f6f }}},
- { 0x1f70, {1, {0x1fba }}},
- { 0x1f71, {1, {0x1fbb }}},
- { 0x1f72, {1, {0x1fc8 }}},
- { 0x1f73, {1, {0x1fc9 }}},
- { 0x1f74, {1, {0x1fca }}},
- { 0x1f75, {1, {0x1fcb }}},
- { 0x1f76, {1, {0x1fda }}},
- { 0x1f77, {1, {0x1fdb }}},
- { 0x1f78, {1, {0x1ff8 }}},
- { 0x1f79, {1, {0x1ff9 }}},
- { 0x1f7a, {1, {0x1fea }}},
- { 0x1f7b, {1, {0x1feb }}},
- { 0x1f7c, {1, {0x1ffa }}},
- { 0x1f7d, {1, {0x1ffb }}},
- { 0x1fb0, {1, {0x1fb8 }}},
- { 0x1fb1, {1, {0x1fb9 }}},
- { 0x1fd0, {1, {0x1fd8 }}},
- { 0x1fd1, {1, {0x1fd9 }}},
- { 0x1fe0, {1, {0x1fe8 }}},
- { 0x1fe1, {1, {0x1fe9 }}},
- { 0x1fe5, {1, {0x1fec }}},
- { 0x2170, {1, {0x2160 }}},
- { 0x2171, {1, {0x2161 }}},
- { 0x2172, {1, {0x2162 }}},
- { 0x2173, {1, {0x2163 }}},
- { 0x2174, {1, {0x2164 }}},
- { 0x2175, {1, {0x2165 }}},
- { 0x2176, {1, {0x2166 }}},
- { 0x2177, {1, {0x2167 }}},
- { 0x2178, {1, {0x2168 }}},
- { 0x2179, {1, {0x2169 }}},
- { 0x217a, {1, {0x216a }}},
- { 0x217b, {1, {0x216b }}},
- { 0x217c, {1, {0x216c }}},
- { 0x217d, {1, {0x216d }}},
- { 0x217e, {1, {0x216e }}},
- { 0x217f, {1, {0x216f }}},
- { 0x24d0, {1, {0x24b6 }}},
- { 0x24d1, {1, {0x24b7 }}},
- { 0x24d2, {1, {0x24b8 }}},
- { 0x24d3, {1, {0x24b9 }}},
- { 0x24d4, {1, {0x24ba }}},
- { 0x24d5, {1, {0x24bb }}},
- { 0x24d6, {1, {0x24bc }}},
- { 0x24d7, {1, {0x24bd }}},
- { 0x24d8, {1, {0x24be }}},
- { 0x24d9, {1, {0x24bf }}},
- { 0x24da, {1, {0x24c0 }}},
- { 0x24db, {1, {0x24c1 }}},
- { 0x24dc, {1, {0x24c2 }}},
- { 0x24dd, {1, {0x24c3 }}},
- { 0x24de, {1, {0x24c4 }}},
- { 0x24df, {1, {0x24c5 }}},
- { 0x24e0, {1, {0x24c6 }}},
- { 0x24e1, {1, {0x24c7 }}},
- { 0x24e2, {1, {0x24c8 }}},
- { 0x24e3, {1, {0x24c9 }}},
- { 0x24e4, {1, {0x24ca }}},
- { 0x24e5, {1, {0x24cb }}},
- { 0x24e6, {1, {0x24cc }}},
- { 0x24e7, {1, {0x24cd }}},
- { 0x24e8, {1, {0x24ce }}},
- { 0x24e9, {1, {0x24cf }}},
- { 0x2c30, {1, {0x2c00 }}},
- { 0x2c31, {1, {0x2c01 }}},
- { 0x2c32, {1, {0x2c02 }}},
- { 0x2c33, {1, {0x2c03 }}},
- { 0x2c34, {1, {0x2c04 }}},
- { 0x2c35, {1, {0x2c05 }}},
- { 0x2c36, {1, {0x2c06 }}},
- { 0x2c37, {1, {0x2c07 }}},
- { 0x2c38, {1, {0x2c08 }}},
- { 0x2c39, {1, {0x2c09 }}},
- { 0x2c3a, {1, {0x2c0a }}},
- { 0x2c3b, {1, {0x2c0b }}},
- { 0x2c3c, {1, {0x2c0c }}},
- { 0x2c3d, {1, {0x2c0d }}},
- { 0x2c3e, {1, {0x2c0e }}},
- { 0x2c3f, {1, {0x2c0f }}},
- { 0x2c40, {1, {0x2c10 }}},
- { 0x2c41, {1, {0x2c11 }}},
- { 0x2c42, {1, {0x2c12 }}},
- { 0x2c43, {1, {0x2c13 }}},
- { 0x2c44, {1, {0x2c14 }}},
- { 0x2c45, {1, {0x2c15 }}},
- { 0x2c46, {1, {0x2c16 }}},
- { 0x2c47, {1, {0x2c17 }}},
- { 0x2c48, {1, {0x2c18 }}},
- { 0x2c49, {1, {0x2c19 }}},
- { 0x2c4a, {1, {0x2c1a }}},
- { 0x2c4b, {1, {0x2c1b }}},
- { 0x2c4c, {1, {0x2c1c }}},
- { 0x2c4d, {1, {0x2c1d }}},
- { 0x2c4e, {1, {0x2c1e }}},
- { 0x2c4f, {1, {0x2c1f }}},
- { 0x2c50, {1, {0x2c20 }}},
- { 0x2c51, {1, {0x2c21 }}},
- { 0x2c52, {1, {0x2c22 }}},
- { 0x2c53, {1, {0x2c23 }}},
- { 0x2c54, {1, {0x2c24 }}},
- { 0x2c55, {1, {0x2c25 }}},
- { 0x2c56, {1, {0x2c26 }}},
- { 0x2c57, {1, {0x2c27 }}},
- { 0x2c58, {1, {0x2c28 }}},
- { 0x2c59, {1, {0x2c29 }}},
- { 0x2c5a, {1, {0x2c2a }}},
- { 0x2c5b, {1, {0x2c2b }}},
- { 0x2c5c, {1, {0x2c2c }}},
- { 0x2c5d, {1, {0x2c2d }}},
- { 0x2c5e, {1, {0x2c2e }}},
- { 0x2c81, {1, {0x2c80 }}},
- { 0x2c83, {1, {0x2c82 }}},
- { 0x2c85, {1, {0x2c84 }}},
- { 0x2c87, {1, {0x2c86 }}},
- { 0x2c89, {1, {0x2c88 }}},
- { 0x2c8b, {1, {0x2c8a }}},
- { 0x2c8d, {1, {0x2c8c }}},
- { 0x2c8f, {1, {0x2c8e }}},
- { 0x2c91, {1, {0x2c90 }}},
- { 0x2c93, {1, {0x2c92 }}},
- { 0x2c95, {1, {0x2c94 }}},
- { 0x2c97, {1, {0x2c96 }}},
- { 0x2c99, {1, {0x2c98 }}},
- { 0x2c9b, {1, {0x2c9a }}},
- { 0x2c9d, {1, {0x2c9c }}},
- { 0x2c9f, {1, {0x2c9e }}},
- { 0x2ca1, {1, {0x2ca0 }}},
- { 0x2ca3, {1, {0x2ca2 }}},
- { 0x2ca5, {1, {0x2ca4 }}},
- { 0x2ca7, {1, {0x2ca6 }}},
- { 0x2ca9, {1, {0x2ca8 }}},
- { 0x2cab, {1, {0x2caa }}},
- { 0x2cad, {1, {0x2cac }}},
- { 0x2caf, {1, {0x2cae }}},
- { 0x2cb1, {1, {0x2cb0 }}},
- { 0x2cb3, {1, {0x2cb2 }}},
- { 0x2cb5, {1, {0x2cb4 }}},
- { 0x2cb7, {1, {0x2cb6 }}},
- { 0x2cb9, {1, {0x2cb8 }}},
- { 0x2cbb, {1, {0x2cba }}},
- { 0x2cbd, {1, {0x2cbc }}},
- { 0x2cbf, {1, {0x2cbe }}},
- { 0x2cc1, {1, {0x2cc0 }}},
- { 0x2cc3, {1, {0x2cc2 }}},
- { 0x2cc5, {1, {0x2cc4 }}},
- { 0x2cc7, {1, {0x2cc6 }}},
- { 0x2cc9, {1, {0x2cc8 }}},
- { 0x2ccb, {1, {0x2cca }}},
- { 0x2ccd, {1, {0x2ccc }}},
- { 0x2ccf, {1, {0x2cce }}},
- { 0x2cd1, {1, {0x2cd0 }}},
- { 0x2cd3, {1, {0x2cd2 }}},
- { 0x2cd5, {1, {0x2cd4 }}},
- { 0x2cd7, {1, {0x2cd6 }}},
- { 0x2cd9, {1, {0x2cd8 }}},
- { 0x2cdb, {1, {0x2cda }}},
- { 0x2cdd, {1, {0x2cdc }}},
- { 0x2cdf, {1, {0x2cde }}},
- { 0x2ce1, {1, {0x2ce0 }}},
- { 0x2ce3, {1, {0x2ce2 }}},
- { 0x2d00, {1, {0x10a0 }}},
- { 0x2d01, {1, {0x10a1 }}},
- { 0x2d02, {1, {0x10a2 }}},
- { 0x2d03, {1, {0x10a3 }}},
- { 0x2d04, {1, {0x10a4 }}},
- { 0x2d05, {1, {0x10a5 }}},
- { 0x2d06, {1, {0x10a6 }}},
- { 0x2d07, {1, {0x10a7 }}},
- { 0x2d08, {1, {0x10a8 }}},
- { 0x2d09, {1, {0x10a9 }}},
- { 0x2d0a, {1, {0x10aa }}},
- { 0x2d0b, {1, {0x10ab }}},
- { 0x2d0c, {1, {0x10ac }}},
- { 0x2d0d, {1, {0x10ad }}},
- { 0x2d0e, {1, {0x10ae }}},
- { 0x2d0f, {1, {0x10af }}},
- { 0x2d10, {1, {0x10b0 }}},
- { 0x2d11, {1, {0x10b1 }}},
- { 0x2d12, {1, {0x10b2 }}},
- { 0x2d13, {1, {0x10b3 }}},
- { 0x2d14, {1, {0x10b4 }}},
- { 0x2d15, {1, {0x10b5 }}},
- { 0x2d16, {1, {0x10b6 }}},
- { 0x2d17, {1, {0x10b7 }}},
- { 0x2d18, {1, {0x10b8 }}},
- { 0x2d19, {1, {0x10b9 }}},
- { 0x2d1a, {1, {0x10ba }}},
- { 0x2d1b, {1, {0x10bb }}},
- { 0x2d1c, {1, {0x10bc }}},
- { 0x2d1d, {1, {0x10bd }}},
- { 0x2d1e, {1, {0x10be }}},
- { 0x2d1f, {1, {0x10bf }}},
- { 0x2d20, {1, {0x10c0 }}},
- { 0x2d21, {1, {0x10c1 }}},
- { 0x2d22, {1, {0x10c2 }}},
- { 0x2d23, {1, {0x10c3 }}},
- { 0x2d24, {1, {0x10c4 }}},
- { 0x2d25, {1, {0x10c5 }}},
- { 0xff41, {1, {0xff21 }}},
- { 0xff42, {1, {0xff22 }}},
- { 0xff43, {1, {0xff23 }}},
- { 0xff44, {1, {0xff24 }}},
- { 0xff45, {1, {0xff25 }}},
- { 0xff46, {1, {0xff26 }}},
- { 0xff47, {1, {0xff27 }}},
- { 0xff48, {1, {0xff28 }}},
- { 0xff49, {1, {0xff29 }}},
- { 0xff4a, {1, {0xff2a }}},
- { 0xff4b, {1, {0xff2b }}},
- { 0xff4c, {1, {0xff2c }}},
- { 0xff4d, {1, {0xff2d }}},
- { 0xff4e, {1, {0xff2e }}},
- { 0xff4f, {1, {0xff2f }}},
- { 0xff50, {1, {0xff30 }}},
- { 0xff51, {1, {0xff31 }}},
- { 0xff52, {1, {0xff32 }}},
- { 0xff53, {1, {0xff33 }}},
- { 0xff54, {1, {0xff34 }}},
- { 0xff55, {1, {0xff35 }}},
- { 0xff56, {1, {0xff36 }}},
- { 0xff57, {1, {0xff37 }}},
- { 0xff58, {1, {0xff38 }}},
- { 0xff59, {1, {0xff39 }}},
- { 0xff5a, {1, {0xff3a }}},
- { 0x10428, {1, {0x10400 }}},
- { 0x10429, {1, {0x10401 }}},
- { 0x1042a, {1, {0x10402 }}},
- { 0x1042b, {1, {0x10403 }}},
- { 0x1042c, {1, {0x10404 }}},
- { 0x1042d, {1, {0x10405 }}},
- { 0x1042e, {1, {0x10406 }}},
- { 0x1042f, {1, {0x10407 }}},
- { 0x10430, {1, {0x10408 }}},
- { 0x10431, {1, {0x10409 }}},
- { 0x10432, {1, {0x1040a }}},
- { 0x10433, {1, {0x1040b }}},
- { 0x10434, {1, {0x1040c }}},
- { 0x10435, {1, {0x1040d }}},
- { 0x10436, {1, {0x1040e }}},
- { 0x10437, {1, {0x1040f }}},
- { 0x10438, {1, {0x10410 }}},
- { 0x10439, {1, {0x10411 }}},
- { 0x1043a, {1, {0x10412 }}},
- { 0x1043b, {1, {0x10413 }}},
- { 0x1043c, {1, {0x10414 }}},
- { 0x1043d, {1, {0x10415 }}},
- { 0x1043e, {1, {0x10416 }}},
- { 0x1043f, {1, {0x10417 }}},
- { 0x10440, {1, {0x10418 }}},
- { 0x10441, {1, {0x10419 }}},
- { 0x10442, {1, {0x1041a }}},
- { 0x10443, {1, {0x1041b }}},
- { 0x10444, {1, {0x1041c }}},
- { 0x10445, {1, {0x1041d }}},
- { 0x10446, {1, {0x1041e }}},
- { 0x10447, {1, {0x1041f }}},
- { 0x10448, {1, {0x10420 }}},
- { 0x10449, {1, {0x10421 }}},
- { 0x1044a, {1, {0x10422 }}},
- { 0x1044b, {1, {0x10423 }}},
- { 0x1044c, {1, {0x10424 }}},
- { 0x1044d, {1, {0x10425 }}},
- { 0x1044e, {1, {0x10426 }}},
- { 0x1044f, {1, {0x10427 }}}
-};
-
-static const CaseUnfold_11_Type CaseUnfold_11_Locale[] = {
- { 0x0069, {1, {0x0049 }}}
-};
-
-static const CaseUnfold_12_Type CaseUnfold_12[] = {
- { {0x0061, 0x02be}, {1, {0x1e9a }}},
- { {0x0066, 0x0066}, {1, {0xfb00 }}},
- { {0x0066, 0x0069}, {1, {0xfb01 }}},
- { {0x0066, 0x006c}, {1, {0xfb02 }}},
- { {0x0068, 0x0331}, {1, {0x1e96 }}},
- { {0x006a, 0x030c}, {1, {0x01f0 }}},
- { {0x0073, 0x0073}, {1, {0x00df }}},
- { {0x0073, 0x0074}, {2, {0xfb05, 0xfb06 }}},
- { {0x0074, 0x0308}, {1, {0x1e97 }}},
- { {0x0077, 0x030a}, {1, {0x1e98 }}},
- { {0x0079, 0x030a}, {1, {0x1e99 }}},
- { {0x02bc, 0x006e}, {1, {0x0149 }}},
- { {0x03ac, 0x03b9}, {1, {0x1fb4 }}},
- { {0x03ae, 0x03b9}, {1, {0x1fc4 }}},
- { {0x03b1, 0x0342}, {1, {0x1fb6 }}},
- { {0x03b1, 0x03b9}, {2, {0x1fb3, 0x1fbc }}},
- { {0x03b7, 0x0342}, {1, {0x1fc6 }}},
- { {0x03b7, 0x03b9}, {2, {0x1fc3, 0x1fcc }}},
- { {0x03b9, 0x0342}, {1, {0x1fd6 }}},
- { {0x03c1, 0x0313}, {1, {0x1fe4 }}},
- { {0x03c5, 0x0313}, {1, {0x1f50 }}},
- { {0x03c5, 0x0342}, {1, {0x1fe6 }}},
- { {0x03c9, 0x0342}, {1, {0x1ff6 }}},
- { {0x03c9, 0x03b9}, {2, {0x1ff3, 0x1ffc }}},
- { {0x03ce, 0x03b9}, {1, {0x1ff4 }}},
- { {0x0565, 0x0582}, {1, {0x0587 }}},
- { {0x0574, 0x0565}, {1, {0xfb14 }}},
- { {0x0574, 0x056b}, {1, {0xfb15 }}},
- { {0x0574, 0x056d}, {1, {0xfb17 }}},
- { {0x0574, 0x0576}, {1, {0xfb13 }}},
- { {0x057e, 0x0576}, {1, {0xfb16 }}},
- { {0x1f00, 0x03b9}, {2, {0x1f88, 0x1f80 }}},
- { {0x1f01, 0x03b9}, {2, {0x1f81, 0x1f89 }}},
- { {0x1f02, 0x03b9}, {2, {0x1f82, 0x1f8a }}},
- { {0x1f03, 0x03b9}, {2, {0x1f83, 0x1f8b }}},
- { {0x1f04, 0x03b9}, {2, {0x1f84, 0x1f8c }}},
- { {0x1f05, 0x03b9}, {2, {0x1f85, 0x1f8d }}},
- { {0x1f06, 0x03b9}, {2, {0x1f86, 0x1f8e }}},
- { {0x1f07, 0x03b9}, {2, {0x1f87, 0x1f8f }}},
- { {0x1f20, 0x03b9}, {2, {0x1f90, 0x1f98 }}},
- { {0x1f21, 0x03b9}, {2, {0x1f91, 0x1f99 }}},
- { {0x1f22, 0x03b9}, {2, {0x1f92, 0x1f9a }}},
- { {0x1f23, 0x03b9}, {2, {0x1f93, 0x1f9b }}},
- { {0x1f24, 0x03b9}, {2, {0x1f94, 0x1f9c }}},
- { {0x1f25, 0x03b9}, {2, {0x1f95, 0x1f9d }}},
- { {0x1f26, 0x03b9}, {2, {0x1f96, 0x1f9e }}},
- { {0x1f27, 0x03b9}, {2, {0x1f97, 0x1f9f }}},
- { {0x1f60, 0x03b9}, {2, {0x1fa0, 0x1fa8 }}},
- { {0x1f61, 0x03b9}, {2, {0x1fa1, 0x1fa9 }}},
- { {0x1f62, 0x03b9}, {2, {0x1fa2, 0x1faa }}},
- { {0x1f63, 0x03b9}, {2, {0x1fa3, 0x1fab }}},
- { {0x1f64, 0x03b9}, {2, {0x1fa4, 0x1fac }}},
- { {0x1f65, 0x03b9}, {2, {0x1fa5, 0x1fad }}},
- { {0x1f66, 0x03b9}, {2, {0x1fa6, 0x1fae }}},
- { {0x1f67, 0x03b9}, {2, {0x1fa7, 0x1faf }}},
- { {0x1f70, 0x03b9}, {1, {0x1fb2 }}},
- { {0x1f74, 0x03b9}, {1, {0x1fc2 }}},
- { {0x1f7c, 0x03b9}, {1, {0x1ff2 }}}
-};
-
-static const CaseUnfold_12_Type CaseUnfold_12_Locale[] = {
- { {0x0069, 0x0307}, {1, {0x0130 }}}
-};
-
-static const CaseUnfold_13_Type CaseUnfold_13[] = {
- { {0x0066, 0x0066, 0x0069}, {1, {0xfb03 }}},
- { {0x0066, 0x0066, 0x006c}, {1, {0xfb04 }}},
- { {0x03b1, 0x0342, 0x03b9}, {1, {0x1fb7 }}},
- { {0x03b7, 0x0342, 0x03b9}, {1, {0x1fc7 }}},
- { {0x03b9, 0x0308, 0x0300}, {1, {0x1fd2 }}},
- { {0x03b9, 0x0308, 0x0301}, {2, {0x0390, 0x1fd3 }}},
- { {0x03b9, 0x0308, 0x0342}, {1, {0x1fd7 }}},
- { {0x03c5, 0x0308, 0x0300}, {1, {0x1fe2 }}},
- { {0x03c5, 0x0308, 0x0301}, {2, {0x03b0, 0x1fe3 }}},
- { {0x03c5, 0x0308, 0x0342}, {1, {0x1fe7 }}},
- { {0x03c5, 0x0313, 0x0300}, {1, {0x1f52 }}},
- { {0x03c5, 0x0313, 0x0301}, {1, {0x1f54 }}},
- { {0x03c5, 0x0313, 0x0342}, {1, {0x1f56 }}},
- { {0x03c9, 0x0342, 0x03b9}, {1, {0x1ff7 }}}
-};
-
-
-static PosixBracketEntryType HashEntryData[] = {
- { (UChar* )"NEWLINE", 0, 7 },
- { (UChar* )"Alpha", 1, 5 },
- { (UChar* )"Blank", 2, 5 },
- { (UChar* )"Cntrl", 3, 5 },
- { (UChar* )"Digit", 4, 5 },
- { (UChar* )"Graph", 5, 5 },
- { (UChar* )"Lower", 6, 5 },
- { (UChar* )"Print", 7, 5 },
- { (UChar* )"Punct", 8, 5 },
- { (UChar* )"Space", 9, 5 },
- { (UChar* )"Upper", 10, 5 },
- { (UChar* )"XDigit", 11, 6 },
- { (UChar* )"Word", 12, 4 },
- { (UChar* )"Alnum", 13, 5 },
- { (UChar* )"ASCII", 14, 5 },
-
-#ifdef USE_UNICODE_PROPERTIES
- { (UChar* )"Any", 15, 3 },
- { (UChar* )"Assigned", 16, 8 },
- { (UChar* )"C", 17, 1 },
- { (UChar* )"Cc", 18, 2 },
- { (UChar* )"Cf", 19, 2 },
- { (UChar* )"Cn", 20, 2 },
- { (UChar* )"Co", 21, 2 },
- { (UChar* )"Cs", 22, 2 },
- { (UChar* )"L", 23, 1 },
- { (UChar* )"Ll", 24, 2 },
- { (UChar* )"Lm", 25, 2 },
- { (UChar* )"Lo", 26, 2 },
- { (UChar* )"Lt", 27, 2 },
- { (UChar* )"Lu", 28, 2 },
- { (UChar* )"M", 29, 1 },
- { (UChar* )"Mc", 30, 2 },
- { (UChar* )"Me", 31, 2 },
- { (UChar* )"Mn", 32, 2 },
- { (UChar* )"N", 33, 1 },
- { (UChar* )"Nd", 34, 2 },
- { (UChar* )"Nl", 35, 2 },
- { (UChar* )"No", 36, 2 },
- { (UChar* )"P", 37, 1 },
- { (UChar* )"Pc", 38, 2 },
- { (UChar* )"Pd", 39, 2 },
- { (UChar* )"Pe", 40, 2 },
- { (UChar* )"Pf", 41, 2 },
- { (UChar* )"Pi", 42, 2 },
- { (UChar* )"Po", 43, 2 },
- { (UChar* )"Ps", 44, 2 },
- { (UChar* )"S", 45, 1 },
- { (UChar* )"Sc", 46, 2 },
- { (UChar* )"Sk", 47, 2 },
- { (UChar* )"Sm", 48, 2 },
- { (UChar* )"So", 49, 2 },
- { (UChar* )"Z", 50, 1 },
- { (UChar* )"Zl", 51, 2 },
- { (UChar* )"Zp", 52, 2 },
- { (UChar* )"Zs", 53, 2 },
- { (UChar* )"Arabic", 54, 6 },
- { (UChar* )"Armenian", 55, 8 },
- { (UChar* )"Bengali", 56, 7 },
- { (UChar* )"Bopomofo", 57, 8 },
- { (UChar* )"Braille", 58, 7 },
- { (UChar* )"Buginese", 59, 8 },
- { (UChar* )"Buhid", 60, 5 },
- { (UChar* )"Canadian_Aboriginal", 61, 19 },
- { (UChar* )"Cherokee", 62, 8 },
- { (UChar* )"Common", 63, 6 },
- { (UChar* )"Coptic", 64, 6 },
- { (UChar* )"Cypriot", 65, 7 },
- { (UChar* )"Cyrillic", 66, 8 },
- { (UChar* )"Deseret", 67, 7 },
- { (UChar* )"Devanagari", 68, 10 },
- { (UChar* )"Ethiopic", 69, 8 },
- { (UChar* )"Georgian", 70, 8 },
- { (UChar* )"Glagolitic", 71, 10 },
- { (UChar* )"Gothic", 72, 6 },
- { (UChar* )"Greek", 73, 5 },
- { (UChar* )"Gujarati", 74, 8 },
- { (UChar* )"Gurmukhi", 75, 8 },
- { (UChar* )"Han", 76, 3 },
- { (UChar* )"Hangul", 77, 6 },
- { (UChar* )"Hanunoo", 78, 7 },
- { (UChar* )"Hebrew", 79, 6 },
- { (UChar* )"Hiragana", 80, 8 },
- { (UChar* )"Inherited", 81, 9 },
- { (UChar* )"Kannada", 82, 7 },
- { (UChar* )"Katakana", 83, 8 },
- { (UChar* )"Kharoshthi", 84, 10 },
- { (UChar* )"Khmer", 85, 5 },
- { (UChar* )"Lao", 86, 3 },
- { (UChar* )"Latin", 87, 5 },
- { (UChar* )"Limbu", 88, 5 },
- { (UChar* )"Linear_B", 89, 8 },
- { (UChar* )"Malayalam", 90, 9 },
- { (UChar* )"Mongolian", 91, 9 },
- { (UChar* )"Myanmar", 92, 7 },
- { (UChar* )"New_Tai_Lue", 93, 11 },
- { (UChar* )"Ogham", 94, 5 },
- { (UChar* )"Old_Italic", 95, 10 },
- { (UChar* )"Old_Persian", 96, 11 },
- { (UChar* )"Oriya", 97, 5 },
- { (UChar* )"Osmanya", 98, 7 },
- { (UChar* )"Runic", 99, 5 },
- { (UChar* )"Shavian", 100, 7 },
- { (UChar* )"Sinhala", 101, 7 },
- { (UChar* )"Syloti_Nagri", 102, 12 },
- { (UChar* )"Syriac", 103, 6 },
- { (UChar* )"Tagalog", 104, 7 },
- { (UChar* )"Tagbanwa", 105, 8 },
- { (UChar* )"Tai_Le", 106, 6 },
- { (UChar* )"Tamil", 107, 5 },
- { (UChar* )"Telugu", 108, 6 },
- { (UChar* )"Thaana", 109, 6 },
- { (UChar* )"Thai", 110, 4 },
- { (UChar* )"Tibetan", 111, 7 },
- { (UChar* )"Tifinagh", 112, 8 },
- { (UChar* )"Ugaritic", 113, 8 },
- { (UChar* )"Yi", 114, 2 },
-#endif /* USE_UNICODE_PROPERTIES */
- { (UChar* )NULL, -1, 0 }
-};
-
-#ifdef USE_UNICODE_PROPERTIES
-#define CODE_RANGES_NUM 115
-#else
-#define CODE_RANGES_NUM 15
-#endif
-
-static const OnigCodePoint* CodeRanges[CODE_RANGES_NUM];
-static int CodeRangeTableInited = 0;
-
-static void init_code_range_array(void) {
- THREAD_ATOMIC_START;
-
- CodeRanges[0] = CR_NEWLINE;
- CodeRanges[1] = CR_Alpha;
- CodeRanges[2] = CR_Blank;
- CodeRanges[3] = CR_Cntrl;
- CodeRanges[4] = CR_Digit;
- CodeRanges[5] = CR_Graph;
- CodeRanges[6] = CR_Lower;
- CodeRanges[7] = CR_Print;
- CodeRanges[8] = CR_Punct;
- CodeRanges[9] = CR_Space;
- CodeRanges[10] = CR_Upper;
- CodeRanges[11] = CR_XDigit;
- CodeRanges[12] = CR_Word;
- CodeRanges[13] = CR_Alnum;
- CodeRanges[14] = CR_ASCII;
-
-#ifdef USE_UNICODE_PROPERTIES
- CodeRanges[15] = CR_Any;
- CodeRanges[16] = CR_Assigned;
- CodeRanges[17] = CR_C;
- CodeRanges[18] = CR_Cc;
- CodeRanges[19] = CR_Cf;
- CodeRanges[20] = CR_Cn;
- CodeRanges[21] = CR_Co;
- CodeRanges[22] = CR_Cs;
- CodeRanges[23] = CR_L;
- CodeRanges[24] = CR_Ll;
- CodeRanges[25] = CR_Lm;
- CodeRanges[26] = CR_Lo;
- CodeRanges[27] = CR_Lt;
- CodeRanges[28] = CR_Lu;
- CodeRanges[29] = CR_M;
- CodeRanges[30] = CR_Mc;
- CodeRanges[31] = CR_Me;
- CodeRanges[32] = CR_Mn;
- CodeRanges[33] = CR_N;
- CodeRanges[34] = CR_Nd;
- CodeRanges[35] = CR_Nl;
- CodeRanges[36] = CR_No;
- CodeRanges[37] = CR_P;
- CodeRanges[38] = CR_Pc;
- CodeRanges[39] = CR_Pd;
- CodeRanges[40] = CR_Pe;
- CodeRanges[41] = CR_Pf;
- CodeRanges[42] = CR_Pi;
- CodeRanges[43] = CR_Po;
- CodeRanges[44] = CR_Ps;
- CodeRanges[45] = CR_S;
- CodeRanges[46] = CR_Sc;
- CodeRanges[47] = CR_Sk;
- CodeRanges[48] = CR_Sm;
- CodeRanges[49] = CR_So;
- CodeRanges[50] = CR_Z;
- CodeRanges[51] = CR_Zl;
- CodeRanges[52] = CR_Zp;
- CodeRanges[53] = CR_Zs;
- CodeRanges[54] = CR_Arabic;
- CodeRanges[55] = CR_Armenian;
- CodeRanges[56] = CR_Bengali;
- CodeRanges[57] = CR_Bopomofo;
- CodeRanges[58] = CR_Braille;
- CodeRanges[59] = CR_Buginese;
- CodeRanges[60] = CR_Buhid;
- CodeRanges[61] = CR_Canadian_Aboriginal;
- CodeRanges[62] = CR_Cherokee;
- CodeRanges[63] = CR_Common;
- CodeRanges[64] = CR_Coptic;
- CodeRanges[65] = CR_Cypriot;
- CodeRanges[66] = CR_Cyrillic;
- CodeRanges[67] = CR_Deseret;
- CodeRanges[68] = CR_Devanagari;
- CodeRanges[69] = CR_Ethiopic;
- CodeRanges[70] = CR_Georgian;
- CodeRanges[71] = CR_Glagolitic;
- CodeRanges[72] = CR_Gothic;
- CodeRanges[73] = CR_Greek;
- CodeRanges[74] = CR_Gujarati;
- CodeRanges[75] = CR_Gurmukhi;
- CodeRanges[76] = CR_Han;
- CodeRanges[77] = CR_Hangul;
- CodeRanges[78] = CR_Hanunoo;
- CodeRanges[79] = CR_Hebrew;
- CodeRanges[80] = CR_Hiragana;
- CodeRanges[81] = CR_Inherited;
- CodeRanges[82] = CR_Kannada;
- CodeRanges[83] = CR_Katakana;
- CodeRanges[84] = CR_Kharoshthi;
- CodeRanges[85] = CR_Khmer;
- CodeRanges[86] = CR_Lao;
- CodeRanges[87] = CR_Latin;
- CodeRanges[88] = CR_Limbu;
- CodeRanges[89] = CR_Linear_B;
- CodeRanges[90] = CR_Malayalam;
- CodeRanges[91] = CR_Mongolian;
- CodeRanges[92] = CR_Myanmar;
- CodeRanges[93] = CR_New_Tai_Lue;
- CodeRanges[94] = CR_Ogham;
- CodeRanges[95] = CR_Old_Italic;
- CodeRanges[96] = CR_Old_Persian;
- CodeRanges[97] = CR_Oriya;
- CodeRanges[98] = CR_Osmanya;
- CodeRanges[99] = CR_Runic;
- CodeRanges[100] = CR_Shavian;
- CodeRanges[101] = CR_Sinhala;
- CodeRanges[102] = CR_Syloti_Nagri;
- CodeRanges[103] = CR_Syriac;
- CodeRanges[104] = CR_Tagalog;
- CodeRanges[105] = CR_Tagbanwa;
- CodeRanges[106] = CR_Tai_Le;
- CodeRanges[107] = CR_Tamil;
- CodeRanges[108] = CR_Telugu;
- CodeRanges[109] = CR_Thaana;
- CodeRanges[110] = CR_Thai;
- CodeRanges[111] = CR_Tibetan;
- CodeRanges[112] = CR_Tifinagh;
- CodeRanges[113] = CR_Ugaritic;
- CodeRanges[114] = CR_Yi;
-#endif /* USE_UNICODE_PROPERTIES */
-
- CodeRangeTableInited = 1;
- THREAD_ATOMIC_END;
-}
-
-extern int
-onigenc_unicode_is_code_ctype(OnigCodePoint code, unsigned int ctype, OnigEncoding enc ARG_UNUSED)
-{
- if (
-#ifdef USE_UNICODE_PROPERTIES
- ctype <= ONIGENC_MAX_STD_CTYPE &&
-#endif
- code < 256) {
- return ONIGENC_IS_UNICODE_ISO_8859_1_CTYPE(code, ctype);
- }
-
- if (ctype >= CODE_RANGES_NUM) {
- return ONIGERR_TYPE_BUG;
- }
-
- if (CodeRangeTableInited == 0) init_code_range_array();
-
- return onig_is_in_code_range((UChar* )CodeRanges[ctype], code);
-}
-
-
-extern int
-onigenc_unicode_ctype_code_range(int ctype, const OnigCodePoint* ranges[])
-{
- if (ctype >= CODE_RANGES_NUM) {
- return ONIGERR_TYPE_BUG;
- }
-
- if (CodeRangeTableInited == 0) init_code_range_array();
-
- *ranges = CodeRanges[ctype];
-
- return 0;
-}
-
-extern int
-onigenc_utf16_32_get_ctype_code_range(OnigCtype ctype, OnigCodePoint* sb_out,
- const OnigCodePoint* ranges[],
- struct OnigEncodingTypeST* enc ARG_UNUSED)
-{
- *sb_out = 0x00;
- return onigenc_unicode_ctype_code_range(ctype, ranges);
-}
-
-#include "ruby/st.h"
-
-#define PROPERTY_NAME_MAX_SIZE 20
-
-static st_table* NameCtypeTable;
-static int NameTableInited = 0;
-
-static int init_name_ctype_table(void)
-{
- PosixBracketEntryType *pb;
-
- THREAD_ATOMIC_START;
-
- NameCtypeTable = onig_st_init_strend_table_with_size(100);
- if (ONIG_IS_NULL(NameCtypeTable)) return ONIGERR_MEMORY;
-
- for (pb = HashEntryData; ONIG_IS_NOT_NULL(pb->name); pb++) {
- onig_st_insert_strend(NameCtypeTable, pb->name, pb->name + pb->len,
- (st_data_t )pb->ctype);
- }
-
- NameTableInited = 1;
- THREAD_ATOMIC_END;
- return 0;
-}
-
-extern int
-onigenc_unicode_property_name_to_ctype(OnigEncoding enc, UChar* name, UChar* end)
-{
- int len;
- st_data_t ctype;
- UChar buf[PROPERTY_NAME_MAX_SIZE];
- UChar *p;
- OnigCodePoint code;
-
- p = name;
- len = 0;
- while (p < end) {
- code = ONIGENC_MBC_TO_CODE(enc, p, end);
- if (code >= 0x80)
- return ONIGERR_INVALID_CHAR_PROPERTY_NAME;
-
- buf[len++] = (UChar )code;
- if (len >= PROPERTY_NAME_MAX_SIZE)
- return ONIGERR_INVALID_CHAR_PROPERTY_NAME;
-
- p += enclen(enc, p, end);
- }
-
- buf[len] = 0;
-
- if (NameTableInited == 0) init_name_ctype_table();
-
- if (onig_st_lookup_strend(NameCtypeTable, buf, buf + len,
- &ctype) == 0) {
- return ONIGERR_INVALID_CHAR_PROPERTY_NAME;
- }
-
- return ctype;
-}
-
-
-static int
-code2_cmp(OnigCodePoint* x, OnigCodePoint* y)
-{
- if (x[0] == y[0] && x[1] == y[1]) return 0;
- return 1;
-}
-
-static int
-code2_hash(OnigCodePoint* x)
-{
- return (int )(x[0] + x[1]);
-}
-
-static const struct st_hash_type type_code2_hash = {
- code2_cmp,
- code2_hash,
-};
-
-static int
-code3_cmp(OnigCodePoint* x, OnigCodePoint* y)
-{
- if (x[0] == y[0] && x[1] == y[1] && x[2] == y[2]) return 0;
- return 1;
-}
-
-static int
-code3_hash(OnigCodePoint* x)
-{
- return (int )(x[0] + x[1] + x[2]);
-}
-
-static const struct st_hash_type type_code3_hash = {
- code3_cmp,
- code3_hash,
-};
-
-
-static st_table* FoldTable; /* fold-1, fold-2, fold-3 */
-static st_table* Unfold1Table;
-static st_table* Unfold2Table;
-static st_table* Unfold3Table;
-static int CaseFoldInited = 0;
-
-static int init_case_fold_table(void)
-{
- const CaseFold_11_Type *p;
- const CaseUnfold_11_Type *p1;
- const CaseUnfold_12_Type *p2;
- const CaseUnfold_13_Type *p3;
- int i;
-
- THREAD_ATOMIC_START;
-
- FoldTable = st_init_numtable_with_size(1200);
- if (ONIG_IS_NULL(FoldTable)) return ONIGERR_MEMORY;
- for (i = 0; i < (int )(sizeof(CaseFold)/sizeof(CaseFold_11_Type)); i++) {
- p = &CaseFold[i];
- st_add_direct(FoldTable, (st_data_t )p->from, (st_data_t )&(p->to));
- }
- for (i = 0; i < (int )(sizeof(CaseFold_Locale)/sizeof(CaseFold_11_Type));
- i++) {
- p = &CaseFold_Locale[i];
- st_add_direct(FoldTable, (st_data_t )p->from, (st_data_t )&(p->to));
- }
-
- Unfold1Table = st_init_numtable_with_size(1000);
- if (ONIG_IS_NULL(Unfold1Table)) return ONIGERR_MEMORY;
-
- for (i = 0; i < (int )(sizeof(CaseUnfold_11)/sizeof(CaseUnfold_11_Type));
- i++) {
- p1 = &CaseUnfold_11[i];
- st_add_direct(Unfold1Table, (st_data_t )p1->from, (st_data_t )&(p1->to));
- }
- for (i = 0;
- i < (int )(sizeof(CaseUnfold_11_Locale)/sizeof(CaseUnfold_11_Type));
- i++) {
- p1 = &CaseUnfold_11_Locale[i];
- st_add_direct(Unfold1Table, (st_data_t )p1->from, (st_data_t )&(p1->to));
- }
-
- Unfold2Table = st_init_table_with_size(&type_code2_hash, 200);
- if (ONIG_IS_NULL(Unfold2Table)) return ONIGERR_MEMORY;
-
- for (i = 0; i < (int )(sizeof(CaseUnfold_12)/sizeof(CaseUnfold_12_Type));
- i++) {
- p2 = &CaseUnfold_12[i];
- st_add_direct(Unfold2Table, (st_data_t )p2->from, (st_data_t )(&p2->to));
- }
- for (i = 0;
- i < (int )(sizeof(CaseUnfold_12_Locale)/sizeof(CaseUnfold_12_Type));
- i++) {
- p2 = &CaseUnfold_12_Locale[i];
- st_add_direct(Unfold2Table, (st_data_t )p2->from, (st_data_t )(&p2->to));
- }
-
- Unfold3Table = st_init_table_with_size(&type_code3_hash, 30);
- if (ONIG_IS_NULL(Unfold3Table)) return ONIGERR_MEMORY;
-
- for (i = 0; i < (int )(sizeof(CaseUnfold_13)/sizeof(CaseUnfold_13_Type));
- i++) {
- p3 = &CaseUnfold_13[i];
- st_add_direct(Unfold3Table, (st_data_t )p3->from, (st_data_t )(&p3->to));
- }
-
- CaseFoldInited = 1;
- THREAD_ATOMIC_END;
- return 0;
-}
-
-extern int
-onigenc_unicode_mbc_case_fold(OnigEncoding enc,
- OnigCaseFoldType flag ARG_UNUSED, const UChar** pp, const UChar* end,
- UChar* fold)
-{
- CodePointList3 *to;
- OnigCodePoint code;
- int i, len, rlen;
- const UChar *p = *pp;
-
- if (CaseFoldInited == 0) init_case_fold_table();
-
- code = ONIGENC_MBC_TO_CODE(enc, p, end);
- len = enclen(enc, p, end);
- *pp += len;
-
-#ifdef USE_UNICODE_CASE_FOLD_TURKISH_AZERI
- if ((flag & ONIGENC_CASE_FOLD_TURKISH_AZERI) != 0) {
- if (code == 0x0049) {
- return ONIGENC_CODE_TO_MBC(enc, 0x0131, fold);
- }
- else if (code == 0x0130) {
- return ONIGENC_CODE_TO_MBC(enc, 0x0069, fold);
- }
- }
-#endif
-
- if (onig_st_lookup(FoldTable, (st_data_t )code, (void* )&to) != 0) {
- if (to->n == 1) {
- return ONIGENC_CODE_TO_MBC(enc, to->code[0], fold);
- }
-#if 0
- /* NO NEEDS TO CHECK */
- else if ((flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {
-#else
- else {
-#endif
- rlen = 0;
- for (i = 0; i < to->n; i++) {
- len = ONIGENC_CODE_TO_MBC(enc, to->code[i], fold);
- fold += len;
- rlen += len;
- }
- return rlen;
- }
- }
-
- for (i = 0; i < len; i++) {
- *fold++ = *p++;
- }
- return len;
-}
-
-extern int
-onigenc_unicode_apply_all_case_fold(OnigCaseFoldType flag,
- OnigApplyAllCaseFoldFunc f, void* arg,
- OnigEncoding enc ARG_UNUSED)
-{
- const CaseUnfold_11_Type* p11;
- OnigCodePoint code;
- int i, j, k, r;
-
- /* if (CaseFoldInited == 0) init_case_fold_table(); */
-
- for (i = 0; i < (int )(sizeof(CaseUnfold_11)/sizeof(CaseUnfold_11_Type));
- i++) {
- p11 = &CaseUnfold_11[i];
- 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;
-
- code = p11->to.code[j];
- r = (*f)(p11->from, &code, 1, arg);
- if (r != 0) return r;
-
- for (k = 0; k < j; k++) {
- r = (*f)(p11->to.code[j], (OnigCodePoint* )(&p11->to.code[k]), 1, arg);
- if (r != 0) return r;
-
- r = (*f)(p11->to.code[k], (OnigCodePoint* )(&p11->to.code[j]), 1, arg);
- if (r != 0) return r;
- }
- }
- }
-
-#ifdef USE_UNICODE_CASE_FOLD_TURKISH_AZERI
- if ((flag & ONIGENC_CASE_FOLD_TURKISH_AZERI) != 0) {
- code = 0x0131;
- r = (*f)(0x0049, &code, 1, arg);
- if (r != 0) return r;
- code = 0x0049;
- r = (*f)(0x0131, &code, 1, arg);
- if (r != 0) return r;
-
- code = 0x0130;
- r = (*f)(0x0069, &code, 1, arg);
- if (r != 0) return r;
- code = 0x0069;
- r = (*f)(0x0130, &code, 1, arg);
- if (r != 0) return r;
- }
- else {
-#endif
- for (i = 0;
- i < (int )(sizeof(CaseUnfold_11_Locale)/sizeof(CaseUnfold_11_Type));
- i++) {
- p11 = &CaseUnfold_11_Locale[i];
- 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;
-
- code = p11->to.code[j];
- r = (*f)(p11->from, &code, 1, arg);
- if (r != 0) return r;
-
- for (k = 0; k < j; k++) {
- r = (*f)(p11->to.code[j], (OnigCodePoint* )(&p11->to.code[k]),
- 1, arg);
- if (r != 0) return r;
-
- r = (*f)(p11->to.code[k], (OnigCodePoint* )(&p11->to.code[j]),
- 1, arg);
- if (r != 0) return r;
- }
- }
- }
-#ifdef USE_UNICODE_CASE_FOLD_TURKISH_AZERI
- }
-#endif
-
- if ((flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {
- for (i = 0; i < (int )(sizeof(CaseUnfold_12)/sizeof(CaseUnfold_12_Type));
- i++) {
- 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 < CaseUnfold_12[i].to.n; k++) {
- if (k == j) continue;
-
- r = (*f)(CaseUnfold_12[i].to.code[j],
- (OnigCodePoint* )(&CaseUnfold_12[i].to.code[k]), 1, arg);
- if (r != 0) return r;
- }
- }
- }
-
-#ifdef USE_UNICODE_CASE_FOLD_TURKISH_AZERI
- if ((flag & ONIGENC_CASE_FOLD_TURKISH_AZERI) == 0) {
-#endif
- for (i = 0;
- i < (int )(sizeof(CaseUnfold_12_Locale)/sizeof(CaseUnfold_12_Type));
- i++) {
- 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 < CaseUnfold_12_Locale[i].to.n; k++) {
- if (k == j) continue;
-
- r = (*f)(CaseUnfold_12_Locale[i].to.code[j],
- (OnigCodePoint* )(&CaseUnfold_12_Locale[i].to.code[k]),
- 1, arg);
- if (r != 0) return r;
- }
- }
- }
-#ifdef USE_UNICODE_CASE_FOLD_TURKISH_AZERI
- }
-#endif
-
- for (i = 0; i < (int )(sizeof(CaseUnfold_13)/sizeof(CaseUnfold_13_Type));
- i++) {
- 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 < CaseUnfold_13[i].to.n; k++) {
- if (k == j) continue;
-
- r = (*f)(CaseUnfold_13[i].to.code[j],
- (OnigCodePoint* )(&CaseUnfold_13[i].to.code[k]), 1, arg);
- if (r != 0) return r;
- }
- }
- }
- }
-
- return 0;
-}
-
-extern int
-onigenc_unicode_get_case_fold_codes_by_str(OnigEncoding enc,
- OnigCaseFoldType flag, const OnigUChar* p, const OnigUChar* end,
- OnigCaseFoldCodeItem items[])
-{
- int n, i, j, k, len;
- OnigCodePoint code, codes[3];
- CodePointList3 *to, *z3;
- CodePointList2 *z2;
-
- if (CaseFoldInited == 0) init_case_fold_table();
-
- n = 0;
-
- code = ONIGENC_MBC_TO_CODE(enc, p, end);
- len = enclen(enc, p, end);
-
-#ifdef USE_UNICODE_CASE_FOLD_TURKISH_AZERI
- if ((flag & ONIGENC_CASE_FOLD_TURKISH_AZERI) != 0) {
- if (code == 0x0049) {
- items[0].byte_len = len;
- items[0].code_len = 1;
- items[0].code[0] = 0x0131;
- return 1;
- }
- else if (code == 0x0130) {
- items[0].byte_len = len;
- items[0].code_len = 1;
- items[0].code[0] = 0x0069;
- return 1;
- }
- else if (code == 0x0131) {
- items[0].byte_len = len;
- items[0].code_len = 1;
- items[0].code[0] = 0x0049;
- return 1;
- }
- else if (code == 0x0069) {
- items[0].byte_len = len;
- items[0].code_len = 1;
- items[0].code[0] = 0x0130;
- return 1;
- }
- }
-#endif
-
- if (onig_st_lookup(FoldTable, (st_data_t )code, (void* )&to) != 0) {
- if (to->n == 1) {
- OnigCodePoint orig_code = code;
-
- items[0].byte_len = len;
- items[0].code_len = 1;
- items[0].code[0] = to->code[0];
- n++;
-
- code = to->code[0];
- if (onig_st_lookup(Unfold1Table, (st_data_t )code, (void* )&to) != 0) {
- for (i = 0; i < to->n; i++) {
- if (to->code[i] != orig_code) {
- items[n].byte_len = len;
- items[n].code_len = 1;
- items[n].code[0] = to->code[i];
- n++;
- }
- }
- }
- }
- else if ((flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {
- OnigCodePoint cs[3][4];
- int fn, ncs[3];
-
- for (fn = 0; fn < to->n; fn++) {
- cs[fn][0] = to->code[fn];
- if (onig_st_lookup(Unfold1Table, (st_data_t )cs[fn][0],
- (void* )&z3) != 0) {
- for (i = 0; i < z3->n; i++) {
- cs[fn][i+1] = z3->code[i];
- }
- ncs[fn] = z3->n + 1;
- }
- else
- ncs[fn] = 1;
- }
-
- if (fn == 2) {
- for (i = 0; i < ncs[0]; i++) {
- for (j = 0; j < ncs[1]; j++) {
- items[n].byte_len = len;
- items[n].code_len = 2;
- items[n].code[0] = cs[0][i];
- items[n].code[1] = cs[1][j];
- n++;
- }
- }
-
- if (onig_st_lookup(Unfold2Table, (st_data_t )to->code,
- (void* )&z2) != 0) {
- for (i = 0; i < z2->n; i++) {
- if (z2->code[i] == code) continue;
-
- items[n].byte_len = len;
- items[n].code_len = 1;
- items[n].code[0] = z2->code[i];
- n++;
- }
- }
- }
- else {
- for (i = 0; i < ncs[0]; i++) {
- for (j = 0; j < ncs[1]; j++) {
- for (k = 0; k < ncs[2]; k++) {
- items[n].byte_len = len;
- items[n].code_len = 3;
- items[n].code[0] = cs[0][i];
- items[n].code[1] = cs[1][j];
- items[n].code[2] = cs[2][k];
- n++;
- }
- }
- }
-
- if (onig_st_lookup(Unfold3Table, (st_data_t )to->code,
- (void* )&z2) != 0) {
- for (i = 0; i < z2->n; i++) {
- if (z2->code[i] == code) continue;
-
- items[n].byte_len = len;
- items[n].code_len = 1;
- items[n].code[0] = z2->code[i];
- n++;
- }
- }
- }
-
- /* multi char folded code is not head of another folded multi char */
- flag = 0; /* DISABLE_CASE_FOLD_MULTI_CHAR(flag); */
- }
- }
- else {
- if (onig_st_lookup(Unfold1Table, (st_data_t )code, (void* )&to) != 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];
- n++;
- }
- }
- }
-
-
- if ((flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {
- p += len;
- if (p < end) {
- int clen;
-
- codes[0] = code;
- code = ONIGENC_MBC_TO_CODE(enc, p, end);
- if (onig_st_lookup(FoldTable, (st_data_t )code, (void* )&to) != 0
- && to->n == 1) {
- codes[1] = to->code[0];
- }
- else
- codes[1] = code;
-
- clen = enclen(enc, p, end);
- len += clen;
- if (onig_st_lookup(Unfold2Table, (st_data_t )codes, (void* )&z2) != 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];
- n++;
- }
- }
-
- p += clen;
- if (p < end) {
- code = ONIGENC_MBC_TO_CODE(enc, p, end);
- if (onig_st_lookup(FoldTable, (st_data_t )code, (void* )&to) != 0
- && to->n == 1) {
- codes[2] = to->code[0];
- }
- else
- codes[2] = code;
-
- clen = enclen(enc, p, end);
- len += clen;
- if (onig_st_lookup(Unfold3Table, (st_data_t )codes,
- (void* )&z2) != 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];
- n++;
- }
- }
- }
- }
- }
-
- return n;
-}
diff --git a/enc/us_ascii.c b/enc/us_ascii.c
deleted file mode 100644
index 2e96dd3846..0000000000
--- a/enc/us_ascii.c
+++ /dev/null
@@ -1,31 +0,0 @@
-#include "regenc.h"
-
-static int
-us_ascii_mbc_enc_len(const UChar* p, const UChar* e, OnigEncoding enc)
-{
- if (*p & 0x80)
- return ONIGENC_CONSTRUCT_MBCLEN_INVALID();
- return ONIGENC_CONSTRUCT_MBCLEN_CHARFOUND(1);
-}
-
-OnigEncodingDefine(us_ascii, US_ASCII) = {
- us_ascii_mbc_enc_len,
- "US-ASCII",/* name */
- 1, /* max byte length */
- 1, /* min byte length */
- onigenc_is_mbc_newline_0x0a,
- onigenc_single_byte_mbc_to_code,
- onigenc_single_byte_code_to_mbclen,
- onigenc_single_byte_code_to_mbc,
- onigenc_ascii_mbc_case_fold,
- onigenc_ascii_apply_all_case_fold,
- onigenc_ascii_get_case_fold_codes_by_str,
- onigenc_minimum_property_name_to_ctype,
- onigenc_ascii_is_code_ctype,
- onigenc_not_support_get_ctype_code_range,
- onigenc_single_byte_left_adjust_char_head,
- onigenc_always_true_is_allowed_reverse_match
-};
-ENC_ALIAS("ASCII", "US-ASCII")
-ENC_ALIAS("ANSI_X3.4-1968", "US-ASCII")
-ENC_ALIAS("646", "US-ASCII")
diff --git a/enc/utf_16be.c b/enc/utf_16be.c
deleted file mode 100644
index 8d7c8e9b11..0000000000
--- a/enc/utf_16be.c
+++ /dev/null
@@ -1,258 +0,0 @@
-/**********************************************************************
- utf_16be.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"
-
-#define UTF16_IS_SURROGATE_FIRST(c) (((c) & 0xfc) == 0xd8)
-#define UTF16_IS_SURROGATE_SECOND(c) (((c) & 0xfc) == 0xdc)
-#define UTF16_IS_SURROGATE(c) (((c) & 0xf8) == 0xd8)
-
-static const int EncLen_UTF16[] = {
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 4, 4, 4, 4, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2
-};
-
-static int
-utf16be_mbc_enc_len(const UChar* p, const OnigUChar* e ARG_UNUSED,
- OnigEncoding enc ARG_UNUSED)
-{
- int byte = p[0];
- if (!UTF16_IS_SURROGATE(byte)) {
- if (2 <= e-p)
- return ONIGENC_CONSTRUCT_MBCLEN_CHARFOUND(2);
- else
- return ONIGENC_CONSTRUCT_MBCLEN_NEEDMORE(1);
- }
- if (UTF16_IS_SURROGATE_FIRST(byte)) {
- switch (e-p) {
- case 1: return ONIGENC_CONSTRUCT_MBCLEN_NEEDMORE(3);
- case 2: return ONIGENC_CONSTRUCT_MBCLEN_NEEDMORE(2);
- case 3:
- if (UTF16_IS_SURROGATE_SECOND(p[2]))
- return ONIGENC_CONSTRUCT_MBCLEN_NEEDMORE(1);
- break;
- default:
- if (UTF16_IS_SURROGATE_SECOND(p[2]))
- return ONIGENC_CONSTRUCT_MBCLEN_CHARFOUND(4);
- break;
- }
- }
- return ONIGENC_CONSTRUCT_MBCLEN_INVALID();
-}
-
-static int
-utf16be_is_mbc_newline(const UChar* p, const UChar* end,
- OnigEncoding enc)
-{
- if (p + 1 < end) {
- if (*(p+1) == 0x0a && *p == 0x00)
- return 1;
-#ifdef USE_UNICODE_ALL_LINE_TERMINATORS
- if ((
-#ifndef USE_CRNL_AS_LINE_TERMINATOR
- *(p+1) == 0x0d ||
-#endif
- *(p+1) == 0x85) && *p == 0x00)
- return 1;
- if (*p == 0x20 && (*(p+1) == 0x29 || *(p+1) == 0x28))
- return 1;
-#endif
- }
- return 0;
-}
-
-static OnigCodePoint
-utf16be_mbc_to_code(const UChar* p, const UChar* end ARG_UNUSED,
- OnigEncoding enc)
-{
- OnigCodePoint code;
-
- if (UTF16_IS_SURROGATE_FIRST(*p)) {
- code = ((((p[0] - 0xd8) << 2) + ((p[1] & 0xc0) >> 6) + 1) << 16)
- + ((((p[1] & 0x3f) << 2) + (p[2] - 0xdc)) << 8)
- + p[3];
- }
- else {
- code = p[0] * 256 + p[1];
- }
- return code;
-}
-
-static int
-utf16be_code_to_mbclen(OnigCodePoint code,
- OnigEncoding enc)
-{
- return (code > 0xffff ? 4 : 2);
-}
-
-static int
-utf16be_code_to_mbc(OnigCodePoint code, UChar *buf,
- OnigEncoding enc)
-{
- UChar* p = buf;
-
- if (code > 0xffff) {
- unsigned int high = (code >> 10) + 0xD7C0;
- unsigned int low = (code & 0x3FF) + 0xDC00;
- *p++ = (high >> 8) & 0xFF;
- *p++ = high & 0xFF;
- *p++ = (low >> 8) & 0xFF;
- *p++ = low & 0xFF;
- return 4;
- }
- else {
- *p++ = (UChar )((code & 0xff00) >> 8);
- *p++ = (UChar )(code & 0xff);
- return 2;
- }
-}
-
-static int
-utf16be_mbc_case_fold(OnigCaseFoldType flag,
- const UChar** pp, const UChar* end, UChar* fold,
- OnigEncoding enc)
-{
- const UChar* p = *pp;
-
- if (ONIGENC_IS_ASCII_CODE(*(p+1)) && *p == 0) {
- p++;
-#ifdef USE_UNICODE_CASE_FOLD_TURKISH_AZERI
- if ((flag & ONIGENC_CASE_FOLD_TURKISH_AZERI) != 0) {
- if (*p == 0x49) {
- *fold++ = 0x01;
- *fold = 0x31;
- (*pp) += 2;
- return 2;
- }
- }
-#endif
-
- *fold++ = 0;
- *fold = ONIGENC_ASCII_CODE_TO_LOWER_CASE(*p);
- *pp += 2;
- return 2;
- }
- else
- return onigenc_unicode_mbc_case_fold(enc, flag,
- pp, end, fold);
-}
-
-#if 0
-static int
-utf16be_is_mbc_ambiguous(OnigCaseFoldType flag, const UChar** pp, const UChar* end)
-{
- const UChar* p = *pp;
-
- (*pp) += EncLen_UTF16[*p];
-
- if (*p == 0) {
- int c, v;
-
- p++;
- if (*p == 0xdf && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {
- return TRUE;
- }
-
- c = *p;
- v = ONIGENC_IS_UNICODE_ISO_8859_1_BIT_CTYPE(c,
- (BIT_CTYPE_UPPER | BIT_CTYPE_LOWER));
-
- if ((v | BIT_CTYPE_LOWER) != 0) {
- /* 0xaa, 0xb5, 0xba are lower case letter, but can't convert. */
- if (c >= 0xaa && c <= 0xba)
- return FALSE;
- else
- return TRUE;
- }
- return (v != 0 ? TRUE : FALSE);
- }
-
- return FALSE;
-}
-#endif
-
-static UChar*
-utf16be_left_adjust_char_head(const UChar* start, const UChar* s, const UChar* end,
- OnigEncoding enc ARG_UNUSED)
-{
- if (s <= start) return (UChar* )s;
-
- if ((s - start) % 2 == 1) {
- s--;
- }
-
- if (UTF16_IS_SURROGATE_SECOND(*s) && s > start + 1)
- s -= 2;
-
- return (UChar* )s;
-}
-
-static int
-utf16be_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(utf_16be, UTF_16BE) = {
- utf16be_mbc_enc_len,
- "UTF-16BE", /* name */
- 4, /* max byte length */
- 2, /* min byte length */
- utf16be_is_mbc_newline,
- utf16be_mbc_to_code,
- utf16be_code_to_mbclen,
- utf16be_code_to_mbc,
- utf16be_mbc_case_fold,
- onigenc_unicode_apply_all_case_fold,
- utf16be_get_case_fold_codes_by_str,
- onigenc_unicode_property_name_to_ctype,
- onigenc_unicode_is_code_ctype,
- onigenc_utf16_32_get_ctype_code_range,
- utf16be_left_adjust_char_head,
- onigenc_always_false_is_allowed_reverse_match
-};
-ENC_ALIAS("UCS-2BE", "UTF-16BE")
diff --git a/enc/utf_16le.c b/enc/utf_16le.c
deleted file mode 100644
index c8a1e7a10a..0000000000
--- a/enc/utf_16le.c
+++ /dev/null
@@ -1,249 +0,0 @@
-/**********************************************************************
- utf_16le.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"
-
-#define UTF16_IS_SURROGATE_FIRST(c) (((c) & 0xfc) == 0xd8)
-#define UTF16_IS_SURROGATE_SECOND(c) (((c) & 0xfc) == 0xdc)
-#define UTF16_IS_SURROGATE(c) (((c) & 0xf8) == 0xd8)
-
-static const int EncLen_UTF16[] = {
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 4, 4, 4, 4, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2
-};
-
-static int
-utf16le_mbc_enc_len(const UChar* p, const OnigUChar* e,
- OnigEncoding enc ARG_UNUSED)
-{
- int len = e-p, byte;
- if (len < 2)
- return ONIGENC_CONSTRUCT_MBCLEN_NEEDMORE(1);
- byte = p[1];
- if (!UTF16_IS_SURROGATE(byte)) {
- return ONIGENC_CONSTRUCT_MBCLEN_CHARFOUND(2);
- }
- if (UTF16_IS_SURROGATE_FIRST(byte)) {
- if (len < 4)
- return ONIGENC_CONSTRUCT_MBCLEN_NEEDMORE(4-len);
- if (UTF16_IS_SURROGATE_SECOND(p[3]))
- return ONIGENC_CONSTRUCT_MBCLEN_CHARFOUND(4);
- }
- return ONIGENC_CONSTRUCT_MBCLEN_INVALID();
-}
-
-static int
-utf16le_is_mbc_newline(const UChar* p, const UChar* end,
- OnigEncoding enc ARG_UNUSED)
-{
- if (p + 1 < end) {
- if (*p == 0x0a && *(p+1) == 0x00)
- return 1;
-#ifdef USE_UNICODE_ALL_LINE_TERMINATORS
- if ((
-#ifndef USE_CRNL_AS_LINE_TERMINATOR
- *p == 0x0d ||
-#endif
- *p == 0x85) && *(p+1) == 0x00)
- return 1;
- if (*(p+1) == 0x20 && (*p == 0x29 || *p == 0x28))
- return 1;
-#endif
- }
- return 0;
-}
-
-static OnigCodePoint
-utf16le_mbc_to_code(const UChar* p, const UChar* end ARG_UNUSED,
- OnigEncoding enc ARG_UNUSED)
-{
- OnigCodePoint code;
- UChar c0 = *p;
- UChar c1 = *(p+1);
-
- if (UTF16_IS_SURROGATE_FIRST(c1)) {
- code = ((((c1 - 0xd8) << 2) + ((c0 & 0xc0) >> 6) + 1) << 16)
- + ((((c0 & 0x3f) << 2) + (p[3] - 0xdc)) << 8)
- + p[2];
- }
- else {
- code = c1 * 256 + p[0];
- }
- return code;
-}
-
-static int
-utf16le_code_to_mbclen(OnigCodePoint code,
- OnigEncoding enc ARG_UNUSED)
-{
- return (code > 0xffff ? 4 : 2);
-}
-
-static int
-utf16le_code_to_mbc(OnigCodePoint code, UChar *buf,
- OnigEncoding enc ARG_UNUSED)
-{
- UChar* p = buf;
-
- if (code > 0xffff) {
- unsigned int high = (code >> 10) + 0xD7C0;
- unsigned int low = (code & 0x3FF) + 0xDC00;
- *p++ = high & 0xFF;
- *p++ = (high >> 8) & 0xFF;
- *p++ = low & 0xFF;
- *p++ = (low >> 8) & 0xFF;
- return 4;
- }
- else {
- *p++ = (UChar )(code & 0xff);
- *p++ = (UChar )((code & 0xff00) >> 8);
- return 2;
- }
-}
-
-static int
-utf16le_mbc_case_fold(OnigCaseFoldType flag,
- const UChar** pp, const UChar* end, UChar* fold,
- OnigEncoding enc)
-{
- const UChar* p = *pp;
-
- if (ONIGENC_IS_ASCII_CODE(*p) && *(p+1) == 0) {
-#ifdef USE_UNICODE_CASE_FOLD_TURKISH_AZERI
- if ((flag & ONIGENC_CASE_FOLD_TURKISH_AZERI) != 0) {
- if (*p == 0x49) {
- *fold++ = 0x31;
- *fold = 0x01;
- (*pp) += 2;
- return 2;
- }
- }
-#endif
-
- *fold++ = ONIGENC_ASCII_CODE_TO_LOWER_CASE(*p);
- *fold = 0;
- *pp += 2;
- return 2;
- }
- else
- return onigenc_unicode_mbc_case_fold(enc, flag, pp,
- end, fold);
-}
-
-#if 0
-static int
-utf16le_is_mbc_ambiguous(OnigCaseFoldType flag, const UChar** pp,
- const UChar* end)
-{
- const UChar* p = *pp;
-
- (*pp) += EncLen_UTF16[*(p+1)];
-
- if (*(p+1) == 0) {
- int c, v;
-
- if (*p == 0xdf && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {
- return TRUE;
- }
-
- c = *p;
- v = ONIGENC_IS_UNICODE_ISO_8859_1_BIT_CTYPE(c,
- (BIT_CTYPE_UPPER | BIT_CTYPE_LOWER));
- if ((v | BIT_CTYPE_LOWER) != 0) {
- /* 0xaa, 0xb5, 0xba are lower case letter, but can't convert. */
- if (c >= 0xaa && c <= 0xba)
- return FALSE;
- else
- return TRUE;
- }
- return (v != 0 ? TRUE : FALSE);
- }
-
- return FALSE;
-}
-#endif
-
-static UChar*
-utf16le_left_adjust_char_head(const UChar* start, const UChar* s, const UChar* end,
- OnigEncoding enc ARG_UNUSED)
-{
- if (s <= start) return (UChar* )s;
-
- if ((s - start) % 2 == 1) {
- s--;
- }
-
- if (UTF16_IS_SURROGATE_SECOND(*(s+1)) && s > start + 1)
- s -= 2;
-
- return (UChar* )s;
-}
-
-static int
-utf16le_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(utf_16le, UTF_16LE) = {
- utf16le_mbc_enc_len,
- "UTF-16LE", /* name */
- 4, /* max byte length */
- 2, /* min byte length */
- utf16le_is_mbc_newline,
- utf16le_mbc_to_code,
- utf16le_code_to_mbclen,
- utf16le_code_to_mbc,
- utf16le_mbc_case_fold,
- onigenc_unicode_apply_all_case_fold,
- utf16le_get_case_fold_codes_by_str,
- onigenc_unicode_property_name_to_ctype,
- onigenc_unicode_is_code_ctype,
- onigenc_utf16_32_get_ctype_code_range,
- utf16le_left_adjust_char_head,
- onigenc_always_false_is_allowed_reverse_match
-};
diff --git a/enc/utf_32be.c b/enc/utf_32be.c
deleted file mode 100644
index 61e7d0f1b5..0000000000
--- a/enc/utf_32be.c
+++ /dev/null
@@ -1,195 +0,0 @@
-/**********************************************************************
- utf_32be.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"
-
-static int
-utf32be_mbc_enc_len(const UChar* p ARG_UNUSED, const OnigUChar* e ARG_UNUSED,
- OnigEncoding enc ARG_UNUSED)
-{
- return 4;
-}
-
-static int
-utf32be_is_mbc_newline(const UChar* p, const UChar* end,
- OnigEncoding enc ARG_UNUSED)
-{
- if (p + 3 < end) {
- if (*(p+3) == 0x0a && *(p+2) == 0 && *(p+1) == 0 && *p == 0)
- return 1;
-#ifdef USE_UNICODE_ALL_LINE_TERMINATORS
- if ((
-#ifndef USE_CRNL_AS_LINE_TERMINATOR
- *(p+3) == 0x0d ||
-#endif
- *(p+3) == 0x85)
- && *(p+2) == 0 && *(p+1) == 0 && *p == 0x00)
- return 1;
- if (*(p+2) == 0x20 && (*(p+3) == 0x29 || *(p+3) == 0x28)
- && *(p+1) == 0 && *p == 0)
- return 1;
-#endif
- }
- return 0;
-}
-
-static OnigCodePoint
-utf32be_mbc_to_code(const UChar* p, const UChar* end ARG_UNUSED,
- OnigEncoding enc ARG_UNUSED)
-{
- return (OnigCodePoint )(((p[0] * 256 + p[1]) * 256 + p[2]) * 256 + p[3]);
-}
-
-static int
-utf32be_code_to_mbclen(OnigCodePoint code ARG_UNUSED,
- OnigEncoding enc ARG_UNUSED)
-{
- return 4;
-}
-
-static int
-utf32be_code_to_mbc(OnigCodePoint code, UChar *buf,
- OnigEncoding enc ARG_UNUSED)
-{
- UChar* p = buf;
-
- *p++ = (UChar )((code & 0xff000000) >>24);
- *p++ = (UChar )((code & 0xff0000) >>16);
- *p++ = (UChar )((code & 0xff00) >> 8);
- *p++ = (UChar ) (code & 0xff);
- return 4;
-}
-
-static int
-utf32be_mbc_case_fold(OnigCaseFoldType flag,
- const UChar** pp, const UChar* end, UChar* fold,
- OnigEncoding enc)
-{
- const UChar* p = *pp;
-
- if (ONIGENC_IS_ASCII_CODE(*(p+3)) && *(p+2) == 0 && *(p+1) == 0 && *p == 0) {
- *fold++ = 0;
- *fold++ = 0;
-
-#ifdef USE_UNICODE_CASE_FOLD_TURKISH_AZERI
- if ((flag & ONIGENC_CASE_FOLD_TURKISH_AZERI) != 0) {
- if (*(p+3) == 0x49) {
- *fold++ = 0x01;
- *fold = 0x31;
- (*pp) += 4;
- return 4;
- }
- }
-#endif
-
- *fold++ = 0;
- *fold = ONIGENC_ASCII_CODE_TO_LOWER_CASE(*(p+3));
- *pp += 4;
- return 4;
- }
- else
- return onigenc_unicode_mbc_case_fold(enc, flag, pp,
- end, fold);
-}
-
-#if 0
-static int
-utf32be_is_mbc_ambiguous(OnigCaseFoldType flag, const UChar** pp, const UChar* end)
-{
- const UChar* p = *pp;
-
- (*pp) += 4;
-
- if (*(p+2) == 0 && *(p+1) == 0 && *p == 0) {
- int c, v;
-
- p += 3;
- if (*p == 0xdf && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {
- return TRUE;
- }
-
- c = *p;
- v = ONIGENC_IS_UNICODE_ISO_8859_1_BIT_CTYPE(c,
- (BIT_CTYPE_UPPER | BIT_CTYPE_LOWER));
- if ((v | BIT_CTYPE_LOWER) != 0) {
- /* 0xaa, 0xb5, 0xba are lower case letter, but can't convert. */
- if (c >= 0xaa && c <= 0xba)
- return FALSE;
- else
- return TRUE;
- }
- return (v != 0 ? TRUE : FALSE);
- }
-
- return FALSE;
-}
-#endif
-
-static UChar*
-utf32be_left_adjust_char_head(const UChar* start, const UChar* s, const UChar* end,
- OnigEncoding enc ARG_UNUSED)
-{
- int rem;
-
- if (s <= start) return (UChar* )s;
-
- rem = (s - start) % 4;
- return (UChar* )(s - rem);
-}
-
-static int
-utf32be_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(utf_32be, UTF_32BE) = {
- utf32be_mbc_enc_len,
- "UTF-32BE", /* name */
- 4, /* max byte length */
- 4, /* min byte length */
- utf32be_is_mbc_newline,
- utf32be_mbc_to_code,
- utf32be_code_to_mbclen,
- utf32be_code_to_mbc,
- utf32be_mbc_case_fold,
- onigenc_unicode_apply_all_case_fold,
- utf32be_get_case_fold_codes_by_str,
- onigenc_unicode_property_name_to_ctype,
- onigenc_unicode_is_code_ctype,
- onigenc_utf16_32_get_ctype_code_range,
- utf32be_left_adjust_char_head,
- onigenc_always_false_is_allowed_reverse_match
-};
-ENC_ALIAS("UCS-4BE", "UTF-32BE")
-
diff --git a/enc/utf_32le.c b/enc/utf_32le.c
deleted file mode 100644
index 3a0a41bba7..0000000000
--- a/enc/utf_32le.c
+++ /dev/null
@@ -1,194 +0,0 @@
-/**********************************************************************
- utf_32le.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"
-
-static int
-utf32le_mbc_enc_len(const UChar* p ARG_UNUSED, const OnigUChar* e ARG_UNUSED,
- OnigEncoding enc ARG_UNUSED)
-{
- return 4;
-}
-
-static int
-utf32le_is_mbc_newline(const UChar* p, const UChar* end,
- OnigEncoding enc ARG_UNUSED)
-{
- if (p + 3 < end) {
- if (*p == 0x0a && *(p+1) == 0 && *(p+2) == 0 && *(p+3) == 0)
- return 1;
-#ifdef USE_UNICODE_ALL_LINE_TERMINATORS
- if ((
-#ifndef USE_CRNL_AS_LINE_TERMINATOR
- *p == 0x0d ||
-#endif
- *p == 0x85)
- && *(p+1) == 0x00 && (p+2) == 0x00 && *(p+3) == 0x00)
- return 1;
- if (*(p+1) == 0x20 && (*p == 0x29 || *p == 0x28)
- && *(p+2) == 0x00 && *(p+3) == 0x00)
- return 1;
-#endif
- }
- return 0;
-}
-
-static OnigCodePoint
-utf32le_mbc_to_code(const UChar* p, const UChar* end ARG_UNUSED,
- OnigEncoding enc ARG_UNUSED)
-{
- return (OnigCodePoint )(((p[3] * 256 + p[2]) * 256 + p[1]) * 256 + p[0]);
-}
-
-static int
-utf32le_code_to_mbclen(OnigCodePoint code ARG_UNUSED,
- OnigEncoding enc ARG_UNUSED)
-{
- return 4;
-}
-
-static int
-utf32le_code_to_mbc(OnigCodePoint code, UChar *buf,
- OnigEncoding enc ARG_UNUSED)
-{
- UChar* p = buf;
-
- *p++ = (UChar ) (code & 0xff);
- *p++ = (UChar )((code & 0xff00) >> 8);
- *p++ = (UChar )((code & 0xff0000) >>16);
- *p++ = (UChar )((code & 0xff000000) >>24);
- return 4;
-}
-
-static int
-utf32le_mbc_case_fold(OnigCaseFoldType flag,
- const UChar** pp, const UChar* end, UChar* fold,
- OnigEncoding enc)
-{
- const UChar* p = *pp;
-
- if (ONIGENC_IS_ASCII_CODE(*p) && *(p+1) == 0 && *(p+2) == 0 && *(p+3) == 0) {
-#ifdef USE_UNICODE_CASE_FOLD_TURKISH_AZERI
- if ((flag & ONIGENC_CASE_FOLD_TURKISH_AZERI) != 0) {
- if (*p == 0x49) {
- *fold++ = 0x31;
- *fold++ = 0x01;
- }
- }
- else {
-#endif
- *fold++ = ONIGENC_ASCII_CODE_TO_LOWER_CASE(*p);
- *fold++ = 0;
-#ifdef USE_UNICODE_CASE_FOLD_TURKISH_AZERI
- }
-#endif
-
- *fold++ = 0;
- *fold = 0;
- *pp += 4;
- return 4;
- }
- else
- return onigenc_unicode_mbc_case_fold(enc, flag, pp,
- end, fold);
-}
-
-#if 0
-static int
-utf32le_is_mbc_ambiguous(OnigCaseFoldType flag, const UChar** pp, const UChar* end)
-{
- const UChar* p = *pp;
-
- (*pp) += 4;
-
- if (*(p+1) == 0 && *(p+2) == 0 && *(p+3) == 0) {
- int c, v;
-
- if (*p == 0xdf && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {
- return TRUE;
- }
-
- c = *p;
- v = ONIGENC_IS_UNICODE_ISO_8859_1_BIT_CTYPE(c,
- (BIT_CTYPE_UPPER | BIT_CTYPE_LOWER));
- if ((v | BIT_CTYPE_LOWER) != 0) {
- /* 0xaa, 0xb5, 0xba are lower case letter, but can't convert. */
- if (c >= 0xaa && c <= 0xba)
- return FALSE;
- else
- return TRUE;
- }
- return (v != 0 ? TRUE : FALSE);
- }
-
- return FALSE;
-}
-#endif
-
-static UChar*
-utf32le_left_adjust_char_head(const UChar* start, const UChar* s, const UChar* end,
- OnigEncoding enc ARG_UNUSED)
-{
- int rem;
-
- if (s <= start) return (UChar* )s;
-
- rem = (s - start) % 4;
- return (UChar* )(s - rem);
-}
-
-static int
-utf32le_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(utf_32le, UTF_32LE) = {
- utf32le_mbc_enc_len,
- "UTF-32LE", /* name */
- 4, /* max byte length */
- 4, /* min byte length */
- utf32le_is_mbc_newline,
- utf32le_mbc_to_code,
- utf32le_code_to_mbclen,
- utf32le_code_to_mbc,
- utf32le_mbc_case_fold,
- onigenc_unicode_apply_all_case_fold,
- utf32le_get_case_fold_codes_by_str,
- onigenc_unicode_property_name_to_ctype,
- onigenc_unicode_is_code_ctype,
- onigenc_utf16_32_get_ctype_code_range,
- utf32le_left_adjust_char_head,
- onigenc_always_false_is_allowed_reverse_match
-};
-ENC_ALIAS("UCS-4LE", "UTF-32LE")
diff --git a/enc/utf_7.h b/enc/utf_7.h
deleted file mode 100644
index fa9f06b1b3..0000000000
--- a/enc/utf_7.h
+++ /dev/null
@@ -1,5 +0,0 @@
-#include "regenc.h"
-/* 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
deleted file mode 100644
index 3b9387c613..0000000000
--- a/enc/utf_8.c
+++ /dev/null
@@ -1,455 +0,0 @@
-/**********************************************************************
- utf_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"
-
-#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 VALID_CODE_LIMIT 0x7fffffff
-#endif
-
-#define utf8_islead(c) ((UChar )((c) & 0xc0) != 0x80)
-
-static const int EncLen_UTF8[] = {
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 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,
- 4, 4, 4, 4, 4, 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 */ 5, 6, 6, 6, 7, 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 */ 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, 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 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
- /* 9 */ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- /* a */ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- /* b */ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- /* 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 */ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- /* 9 */ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- /* a */ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- /* b */ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- /* 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
- },
- { /* 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 */ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- /* 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, 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_UTF8[firstbyte]-1);
- s = trans[s][*p++];
- if (s < 0) return s == ACCEPT ? ONIGENC_CONSTRUCT_MBCLEN_CHARFOUND(2) :
- ONIGENC_CONSTRUCT_MBCLEN_INVALID();
-
- if (p == e) return ONIGENC_CONSTRUCT_MBCLEN_NEEDMORE(EncLen_UTF8[firstbyte]-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(EncLen_UTF8[firstbyte]-3);
- s = trans[s][*p++];
- return s == ACCEPT ? ONIGENC_CONSTRUCT_MBCLEN_CHARFOUND(4) :
- 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
-#ifndef USE_CRNL_AS_LINE_TERMINATOR
- if (*p == 0x0d) return 1;
-#endif
- 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 c, len;
- OnigCodePoint n;
-
- len = enclen(enc, p, end);
- c = *p++;
- if (len > 1) {
- len--;
- n = c & ((1 << (6 - len)) - 1);
- while (len--) {
- c = *p++;
- n = (n << 6) | (c & ((1 << 6) - 1));
- }
- return n;
- }
- else {
-#ifdef USE_INVALID_CODE_SCHEME
- if (c > 0xfd) {
- return ((c == 0xfe) ? INVALID_CODE_FE : INVALID_CODE_FF);
- }
-#endif
- return (OnigCodePoint )c;
- }
-}
-
-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 & 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;
-#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 & 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;
- 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 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(utf_8, UTF_8) = {
- mbc_enc_len,
- "UTF-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
-};
-ENC_ALIAS("CP65001", "UTF-8")
-
-/*
- * Name: UTF8-MAC
- * Link: http://developer.apple.com/documentation/MacOSX/Conceptual/BPFileSystem/BPFileSystem.html
- * Link: http://developer.apple.com/qa/qa2001/qa1235.html
- * Link: http://developer.apple.com/jp/qa/qa2001/qa1235.html
- */
-ENC_REPLICATE("UTF8-MAC", "UTF-8")
-ENC_ALIAS("UTF-8-MAC", "UTF8-MAC")
-
diff --git a/enc/windows_1251.c b/enc/windows_1251.c
deleted file mode 100644
index 1cb4da4960..0000000000
--- a/enc/windows_1251.c
+++ /dev/null
@@ -1,208 +0,0 @@
-/**********************************************************************
- cp1251.c - Oniguruma (regular expression library)
-**********************************************************************/
-/*-
- * Copyright (c) 2006-2007 Byte <byte AT mail DOT kna DOT ru>
- * K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "regenc.h"
-
-#define ENC_CP1251_TO_LOWER_CASE(c) EncCP1251_ToLowerCaseTable[c]
-#define ENC_IS_CP1251_CTYPE(code,ctype) \
- ((EncCP1251_CtypeTable[code] & CTYPE_TO_BIT(ctype)) != 0)
-
-static const UChar EncCP1251_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',
- '\220', '\203', '\202', '\203', '\204', '\205', '\206', '\207',
- '\210', '\211', '\232', '\213', '\234', '\235', '\236', '\237',
- '\220', '\221', '\222', '\223', '\224', '\225', '\226', '\227',
- '\230', '\231', '\232', '\233', '\234', '\235', '\236', '\237',
- '\240', '\242', '\242', '\274', '\244', '\264', '\246', '\247',
- '\270', '\251', '\272', '\253', '\254', '\255', '\256', '\277',
- '\260', '\261', '\263', '\263', '\264', '\265', '\266', '\267',
- '\270', '\271', '\272', '\273', '\274', '\276', '\276', '\277',
- '\340', '\341', '\342', '\343', '\344', '\345', '\346', '\347',
- '\350', '\351', '\352', '\353', '\354', '\355', '\356', '\357',
- '\360', '\361', '\362', '\363', '\364', '\365', '\366', '\367',
- '\370', '\371', '\372', '\373', '\374', '\375', '\376', '\377',
- '\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 EncCP1251_CtypeTable[256] = {
- 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008,
- 0x4008, 0x428c, 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,
- 0x34a2, 0x34a2, 0x01a0, 0x30e2, 0x01a0, 0x01a0, 0x01a0, 0x01a0,
- 0x0000, 0x01a0, 0x34a2, 0x01a0, 0x34a2, 0x34a2, 0x34a2, 0x34a2,
- 0x30e2, 0x01a0, 0x01a0, 0x01a0, 0x01a0, 0x01a0, 0x01a0, 0x01a0,
- 0x0008, 0x0000, 0x30e2, 0x01a0, 0x30e2, 0x30e2, 0x30e2, 0x30e2,
- 0x0280, 0x34a2, 0x30e2, 0x34a2, 0x01a0, 0x34a2, 0x01a0, 0x01a0,
- 0x34a2, 0x01a0, 0x34a2, 0x01a0, 0x01a0, 0x01a0, 0x01a0, 0x34a2,
- 0x01a0, 0x01a0, 0x34a2, 0x30e2, 0x30e2, 0x31e2, 0x01a0, 0x01a0,
- 0x30e2, 0x0000, 0x30e2, 0x01a0, 0x30e2, 0x34a2, 0x30e2, 0x30e2,
- 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2,
- 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2,
- 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 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
-};
-
-static int
-cp1251_mbc_case_fold(OnigCaseFoldType flag ARG_UNUSED,
- const UChar** pp, const UChar* end ARG_UNUSED, UChar* lower, OnigEncoding enc ARG_UNUSED)
-{
- const UChar* p = *pp;
-
- *lower = ENC_CP1251_TO_LOWER_CASE(*p);
- (*pp)++;
- return 1;
-}
-
-static int
-cp1251_is_code_ctype(OnigCodePoint code, unsigned int ctype, OnigEncoding enc ARG_UNUSED)
-{
- if (code < 256)
- return ENC_IS_CP1251_CTYPE(code, ctype);
- else
- return FALSE;
-}
-
-static const OnigPairCaseFoldCodes CaseFoldMap[] = {
- { 0xb8, 0xa8 },
-
- { 0xe0, 0xc0 },
- { 0xe1, 0xc1 },
- { 0xe2, 0xc2 },
- { 0xe3, 0xc3 },
- { 0xe4, 0xc4 },
- { 0xe5, 0xc5 },
- { 0xe6, 0xc6 },
- { 0xe7, 0xc7 },
- { 0xe8, 0xc8 },
- { 0xe9, 0xc9 },
- { 0xea, 0xca },
- { 0xeb, 0xcb },
- { 0xec, 0xcc },
- { 0xed, 0xcd },
- { 0xee, 0xce },
- { 0xef, 0xcf },
-
- { 0xf0, 0xd0 },
- { 0xf1, 0xd1 },
- { 0xf2, 0xd2 },
- { 0xf3, 0xd3 },
- { 0xf4, 0xd4 },
- { 0xf5, 0xd5 },
- { 0xf6, 0xd6 },
- { 0xf7, 0xd7 },
- { 0xf8, 0xd8 },
- { 0xf9, 0xd9 },
- { 0xfa, 0xda },
- { 0xfb, 0xdb },
- { 0xfc, 0xdc },
- { 0xfd, 0xdd },
- { 0xfe, 0xde },
- { 0xff, 0xdf }
-};
-
-static int
-cp1251_apply_all_case_fold(OnigCaseFoldType flag,
- OnigApplyAllCaseFoldFunc f, void* arg, OnigEncoding enc ARG_UNUSED)
-{
- return onigenc_apply_all_case_fold_with_map(
- sizeof(CaseFoldMap)/sizeof(OnigPairCaseFoldCodes), CaseFoldMap, 0,
- flag, f, arg);
-}
-
-static int
-cp1251_get_case_fold_codes_by_str(OnigCaseFoldType flag,
- const OnigUChar* p, const OnigUChar* end, OnigCaseFoldCodeItem items[], OnigEncoding enc ARG_UNUSED)
-{
- return onigenc_get_case_fold_codes_by_str_with_map(
- sizeof(CaseFoldMap)/sizeof(OnigPairCaseFoldCodes), CaseFoldMap, 0,
- flag, p, end, items);
-}
-
-OnigEncodingDefine(windows_1251, Windows_1251) = {
- onigenc_single_byte_mbc_enc_len,
- "Windows-1251", /* 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,
- cp1251_mbc_case_fold,
- cp1251_apply_all_case_fold,
- cp1251_get_case_fold_codes_by_str,
- onigenc_minimum_property_name_to_ctype,
- cp1251_is_code_ctype,
- onigenc_not_support_get_ctype_code_range,
- onigenc_single_byte_left_adjust_char_head,
- onigenc_always_true_is_allowed_reverse_match
-};
-/*
- * Name: windows-1251
- * MIBenum: 2251
- * Link: http://www.iana.org/assignments/character-sets
- * Link: http://www.microsoft.com/globaldev/reference/sbcs/1251.mspx
- * Link: http://en.wikipedia.org/wiki/Windows-1251
- */
-ENC_ALIAS("CP1251", "Windows-1251")
diff --git a/encoding.c b/encoding.c
deleted file mode 100644
index 2f0b9797db..0000000000
--- a/encoding.c
+++ /dev/null
@@ -1,1449 +0,0 @@
-/**********************************************************************
-
- encoding.c -
-
- $Author$
- created at: Thu May 24 17:23:27 JST 2007
-
- Copyright (C) 2007 Yukihiro Matsumoto
-
-**********************************************************************/
-
-#include "ruby/ruby.h"
-#include "ruby/encoding.h"
-#include "regenc.h"
-#include <ctype.h>
-#ifndef NO_LOCALE_CHARMAP
-#ifdef __CYGWIN__
-#include <windows.h>
-#endif
-#ifdef HAVE_LANGINFO_H
-#include <langinfo.h>
-#endif
-#endif
-#include "ruby/util.h"
-
-static ID id_encoding;
-VALUE rb_cEncoding;
-static VALUE rb_encoding_list;
-
-struct rb_encoding_entry {
- const char *name;
- rb_encoding *enc;
- rb_encoding *base;
-};
-
-static struct {
- struct rb_encoding_entry *list;
- int count;
- int size;
- st_table *names;
-} enc_table;
-
-void rb_enc_init(void);
-
-#define ENCODING_COUNT ENCINDEX_BUILTIN_MAX
-#define UNSPECIFIED_ENCODING INT_MAX
-
-#define enc_autoload_p(enc) (!rb_enc_mbmaxlen(enc))
-
-static int load_encoding(const char *name);
-
-static void
-enc_mark(void *ptr)
-{
-}
-
-static VALUE
-enc_new(rb_encoding *encoding)
-{
- return Data_Wrap_Struct(rb_cEncoding, enc_mark, 0, encoding);
-}
-
-VALUE
-rb_enc_from_encoding(rb_encoding *encoding)
-{
- VALUE list, enc;
- int idx;
-
- if (!encoding) return Qnil;
- idx = ENC_TO_ENCINDEX(encoding);
- if (!(list = rb_encoding_list)) {
- rb_bug("rb_enc_from_encoding(%d\"%s\"): no rb_encoding_list",
- idx, rb_enc_name(encoding));
- }
- enc = rb_ary_entry(list, idx);
- if (NIL_P(enc)) {
- rb_bug("rb_enc_from_encoding(%d\"%s\"): not created yet",
- idx, rb_enc_name(encoding));
- }
- return enc;
-}
-
-static int enc_autoload(rb_encoding *);
-
-static int
-check_encoding(rb_encoding *enc)
-{
- int index = rb_enc_to_index(enc);
- if (rb_enc_from_index(index) != enc)
- return -1;
- if (enc_autoload_p(enc)) {
- index = enc_autoload(enc);
- }
- return index;
-}
-
-static int
-enc_check_encoding(VALUE obj)
-{
- if (SPECIAL_CONST_P(obj) || BUILTIN_TYPE(obj) != T_DATA ||
- RDATA(obj)->dmark != enc_mark) {
- return -1;
- }
- return check_encoding(RDATA(obj)->data);
-}
-
-static int
-must_encoding(VALUE enc)
-{
- int index = enc_check_encoding(enc);
- if (index < 0) {
- rb_raise(rb_eTypeError, "wrong argument type %s (expected Encoding)",
- rb_obj_classname(enc));
- }
- return index;
-}
-
-int
-rb_to_encoding_index(VALUE enc)
-{
- int idx;
-
- idx = enc_check_encoding(enc);
- if (idx >= 0) {
- return idx;
- }
- else if (NIL_P(enc = rb_check_string_type(enc))) {
- return -1;
- }
- if (!rb_enc_asciicompat(rb_enc_get(enc))) {
- return -1;
- }
- return rb_enc_find_index(StringValueCStr(enc));
-}
-
-static rb_encoding *
-to_encoding(VALUE enc)
-{
- int idx;
-
- StringValue(enc);
- if (!rb_enc_asciicompat(rb_enc_get(enc))) {
- rb_raise(rb_eArgError, "invalid name encoding (non ASCII)");
- }
- idx = rb_enc_find_index(StringValueCStr(enc));
- if (idx < 0) {
- rb_raise(rb_eArgError, "unknown encoding name - %s", RSTRING_PTR(enc));
- }
- return rb_enc_from_index(idx);
-}
-
-rb_encoding *
-rb_to_encoding(VALUE enc)
-{
- if (enc_check_encoding(enc) >= 0) return RDATA(enc)->data;
- return to_encoding(enc);
-}
-
-void
-rb_gc_mark_encodings(void)
-{
-}
-
-static int
-enc_table_expand(int newsize)
-{
- struct rb_encoding_entry *ent;
- int count = newsize;
-
- if (enc_table.size >= newsize) return newsize;
- newsize = (newsize + 7) / 8 * 8;
- 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;
- return count;
-}
-
-static int
-enc_register_at(int index, const char *name, rb_encoding *encoding)
-{
- struct rb_encoding_entry *ent = &enc_table.list[index];
- VALUE list;
-
- if (!ent->name) {
- ent->name = name = strdup(name);
- }
- else if (STRCASECMP(name, ent->name)) {
- return -1;
- }
- if (!ent->enc) {
- ent->enc = xmalloc(sizeof(rb_encoding));
- }
- if (encoding) {
- *ent->enc = *encoding;
- }
- else {
- memset(ent->enc, 0, sizeof(*ent->enc));
- }
- encoding = ent->enc;
- encoding->name = name;
- encoding->ruby_encoding_index = index;
- st_insert(enc_table.names, (st_data_t)name, (st_data_t)index);
- list = rb_encoding_list;
- if (list && NIL_P(rb_ary_entry(list, index))) {
- /* initialize encoding data */
- rb_ary_store(list, index, enc_new(encoding));
- }
- return index;
-}
-
-static int
-enc_register(const char *name, rb_encoding *encoding)
-{
- int index = enc_table.count;
-
- if ((index = enc_table_expand(index + 1)) < 0) return -1;
- enc_table.count = index;
- return enc_register_at(index - 1, name, encoding);
-}
-
-static void set_encoding_const(const char *, rb_encoding *);
-int rb_enc_registered(const char *name);
-
-int
-rb_enc_register(const char *name, rb_encoding *encoding)
-{
- int index = rb_enc_registered(name);
-
- if (index >= 0) {
- rb_encoding *oldenc = rb_enc_from_index(index);
- if (STRCASECMP(name, rb_enc_name(oldenc))) {
- index = enc_register(name, encoding);
- }
- else if (enc_autoload_p(oldenc) || !ENC_DUMMY_P(oldenc)) {
- enc_register_at(index, name, encoding);
- }
- else {
- rb_raise(rb_eArgError, "encoding %s is already registered", name);
- }
- }
- else {
- index = enc_register(name, encoding);
- set_encoding_const(name, rb_enc_from_index(index));
- }
- return index;
-}
-
-void
-rb_encdb_declare(const char *name)
-{
- int idx = rb_enc_registered(name);
- if (idx < 0) {
- idx = enc_register(name, 0);
- }
- set_encoding_const(name, rb_enc_from_index(idx));
-}
-
-static void
-enc_check_duplication(const char *name)
-{
- if (rb_enc_registered(name) >= 0) {
- rb_raise(rb_eArgError, "encoding %s is already registered", name);
- }
-}
-
-static rb_encoding*
-set_base_encoding(int index, rb_encoding *base)
-{
- rb_encoding *enc = enc_table.list[index].enc;
-
- enc_table.list[index].base = base;
- if (rb_enc_dummy_p(base)) ENC_SET_DUMMY(enc);
- return enc;
-}
-
-int
-rb_enc_replicate(const char *name, rb_encoding *encoding)
-{
- int idx;
-
- enc_check_duplication(name);
- idx = enc_register(name, encoding);
- set_base_encoding(idx, encoding);
- set_encoding_const(name, rb_enc_from_index(idx));
- return idx;
-}
-
-static int
-enc_replicate(int idx, const char *name, rb_encoding *origenc)
-{
- if (idx < 0) {
- idx = enc_register(name, origenc);
- }
- else {
- idx = enc_register_at(idx, name, origenc);
- }
- if (idx >= 0) {
- set_base_encoding(idx, origenc);
- set_encoding_const(name, rb_enc_from_index(idx));
- }
- return idx;
-}
-
-int
-rb_encdb_replicate(const char *name, const char *orig)
-{
- int origidx = rb_enc_registered(orig);
- int idx = rb_enc_registered(name);
-
- if (origidx < 0) {
- origidx = enc_register(orig, 0);
- }
- return enc_replicate(idx, name, rb_enc_from_index(origidx));
-}
-
-int
-rb_define_dummy_encoding(const char *name)
-{
- int index = rb_enc_replicate(name, rb_ascii8bit_encoding());
- rb_encoding *enc = enc_table.list[index].enc;
-
- ENC_SET_DUMMY(enc);
- return index;
-}
-
-int
-rb_encdb_dummy(const char *name)
-{
- int index = enc_replicate(rb_enc_registered(name), name,
- rb_ascii8bit_encoding());
- rb_encoding *enc = enc_table.list[index].enc;
-
- ENC_SET_DUMMY(enc);
- return index;
-}
-
-/*
- * call-seq:
- * enc.dummy? => true or false
- *
- * Returns true for dummy encodings.
- * A dummy encoding is an encoding for which character handling is not properly
- * implemented.
- * It is used for stateful encodings.
- *
- * Encoding::ISO_2022_JP.dummy? #=> true
- * Encoding::UTF_8.dummy? #=> false
- *
- */
-static VALUE
-enc_dummy_p(VALUE enc)
-{
- return ENC_DUMMY_P(enc_table.list[must_encoding(enc)].enc) ? Qtrue : Qfalse;
-}
-
-static const char *
-enc_alias_internal(const char *alias, int idx)
-{
- alias = strdup(alias);
- st_insert(enc_table.names, (st_data_t)alias, (st_data_t)idx);
- return alias;
-}
-
-static int
-enc_alias(const char *alias, int idx)
-{
- alias = enc_alias_internal(alias, idx);
- set_encoding_const(alias, rb_enc_from_index(idx));
- return idx;
-}
-
-int
-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;
- }
- return enc_alias(alias, idx);
-}
-
-int
-rb_encdb_alias(const char *alias, const char *orig)
-{
- int idx = rb_enc_registered(orig);
-
- if (idx < 0) {
- idx = enc_register(orig, 0);
- }
- return enc_alias(alias, idx);
-}
-
-enum {
- ENCINDEX_ASCII,
- ENCINDEX_UTF_8,
- ENCINDEX_US_ASCII,
- ENCINDEX_BUILTIN_MAX
-};
-
-extern rb_encoding OnigEncodingUTF_8;
-extern rb_encoding OnigEncodingUS_ASCII;
-
-void
-rb_enc_init(void)
-{
- enc_table_expand(ENCODING_COUNT + 1);
- if (!enc_table.names) {
- enc_table.names = st_init_strcasetable();
- }
-#define ENC_REGISTER(enc) enc_register_at(ENCINDEX_##enc, rb_enc_name(&OnigEncoding##enc), &OnigEncoding##enc)
- ENC_REGISTER(ASCII);
- ENC_REGISTER(UTF_8);
- ENC_REGISTER(US_ASCII);
-#undef ENC_REGISTER
- enc_table.count = ENCINDEX_BUILTIN_MAX;
-}
-
-rb_encoding *
-rb_enc_from_index(int index)
-{
- if (!enc_table.list) {
- rb_enc_init();
- }
- if (index < 0 || enc_table.count <= index) {
- return 0;
- }
- return enc_table.list[index].enc;
-}
-
-int
-rb_enc_registered(const char *name)
-{
- st_data_t idx = 0;
-
- if (!name) return -1;
- if (!enc_table.list) return -1;
- if (st_lookup(enc_table.names, (st_data_t)name, &idx)) {
- return (int)idx;
- }
- return -1;
-}
-
-static VALUE
-require_enc(VALUE enclib)
-{
- return rb_require_safe(enclib, rb_safe_level());
-}
-
-static int
-load_encoding(const char *name)
-{
- VALUE enclib = rb_sprintf("enc/%s.so", name);
- VALUE verbose = ruby_verbose;
- VALUE debug = ruby_debug;
- VALUE loaded;
- char *s = RSTRING_PTR(enclib) + 4, *e = RSTRING_END(enclib) - 3;
- int idx;
-
- while (s < e) {
- if (!ISALNUM(*s)) *s = '_';
- else if (ISUPPER(*s)) *s = TOLOWER(*s);
- ++s;
- }
- OBJ_FREEZE(enclib);
- ruby_verbose = Qfalse;
- ruby_debug = Qfalse;
- loaded = rb_protect(require_enc, enclib, 0);
- ruby_verbose = verbose;
- ruby_debug = debug;
- rb_set_errinfo(Qnil);
- if (NIL_P(loaded)) return -1;
- if ((idx = rb_enc_registered(name)) < 0) return -1;
- if (enc_autoload_p(enc_table.list[idx].enc)) return -1;
- return idx;
-}
-
-static int
-enc_autoload(rb_encoding *enc)
-{
- int i;
- rb_encoding *base = enc_table.list[ENC_TO_ENCINDEX(enc)].base;
-
- if (base) {
- i = 0;
- do {
- if (i >= enc_table.count) return -1;
- } while (enc_table.list[i].enc != base && (++i, 1));
- if (enc_autoload_p(base)) {
- if (enc_autoload(base) < 0) return -1;
- }
- i = ENC_TO_ENCINDEX(enc);
- enc_register_at(i, rb_enc_name(enc), base);
- }
- else {
- i = load_encoding(rb_enc_name(enc));
- }
- return i;
-}
-
-int
-rb_enc_find_index(const char *name)
-{
- int i = rb_enc_registered(name);
- rb_encoding *enc;
-
- if (i < 0) {
- i = load_encoding(name);
- }
- else if (!(enc = rb_enc_from_index(i))) {
- if (i != UNSPECIFIED_ENCODING) {
- rb_raise(rb_eArgError, "encoding %s is not registered", name);
- }
- }
- else if (enc_autoload_p(enc)) {
- if (enc_autoload(enc) < 0) {
- rb_warn("failed to load encoding (%s); use ASCII-8BIT instead",
- name);
- return 0;
- }
- }
- return i;
-}
-
-rb_encoding *
-rb_enc_find(const char *name)
-{
- int idx = rb_enc_find_index(name);
- if (idx < 0) idx = 0;
- return rb_enc_from_index(idx);
-}
-
-static inline int
-enc_capable(VALUE obj)
-{
- if (SPECIAL_CONST_P(obj)) return Qfalse;
- switch (BUILTIN_TYPE(obj)) {
- case T_STRING:
- case T_REGEXP:
- case T_FILE:
- return Qtrue;
- case T_DATA:
- if (RDATA(obj)->dmark == enc_mark) return Qtrue;
- default:
- return Qfalse;
- }
-}
-
-ID
-rb_id_encoding(void)
-{
- CONST_ID(id_encoding, "encoding");
- return id_encoding;
-}
-
-int
-rb_enc_get_index(VALUE obj)
-{
- int i = -1;
- VALUE tmp;
-
- switch (BUILTIN_TYPE(obj)) {
-as_default:
- default:
- case T_STRING:
- case T_REGEXP:
- i = ENCODING_GET_INLINED(obj);
- if (i == ENCODING_INLINE_MAX) {
- VALUE iv;
-
- iv = rb_ivar_get(obj, rb_id_encoding());
- i = NUM2INT(iv);
- }
- 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 (RDATA(obj)->dmark == enc_mark) {
- i = enc_check_encoding(obj);
- }
- else {
- goto as_default;
- }
- break;
- }
- return i;
-}
-
-void
-rb_enc_set_index(VALUE obj, int idx)
-{
- if (idx < ENCODING_INLINE_MAX) {
- ENCODING_SET_INLINED(obj, idx);
- return;
- }
- ENCODING_SET_INLINED(obj, ENCODING_INLINE_MAX);
- rb_ivar_set(obj, rb_id_encoding(), INT2NUM(idx));
- return;
-}
-
-VALUE
-rb_enc_associate_index(VALUE obj, int idx)
-{
-/* enc_check_capable(obj);*/
- if (rb_enc_get_index(obj) == idx)
- return obj;
- if (!ENC_CODERANGE_ASCIIONLY(obj) ||
- !rb_enc_asciicompat(rb_enc_from_index(idx))) {
- ENC_CODERANGE_CLEAR(obj);
- }
- rb_enc_set_index(obj, idx);
- return obj;
-}
-
-VALUE
-rb_enc_associate(VALUE obj, rb_encoding *enc)
-{
- return rb_enc_associate_index(obj, rb_enc_to_index(enc));
-}
-
-rb_encoding*
-rb_enc_get(VALUE obj)
-{
- return rb_enc_from_index(rb_enc_get_index(obj));
-}
-
-rb_encoding*
-rb_enc_check(VALUE str1, VALUE str2)
-{
- rb_encoding *enc = rb_enc_compatible(str1, 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_compatible(VALUE str1, VALUE str2)
-{
- int idx1, idx2;
- rb_encoding *enc1, *enc2;
-
- 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);
-
- if (TYPE(str2) == T_STRING && RSTRING_LEN(str2) == 0)
- return enc1;
- if (TYPE(str1) == T_STRING && RSTRING_LEN(str1) == 0)
- return enc2;
- if (!rb_enc_asciicompat(enc1) || !rb_enc_asciicompat(enc2)) {
- return 0;
- }
-
- /* objects whose encoding is the same of contents */
- if (BUILTIN_TYPE(str2) != T_STRING && idx2 == ENCINDEX_US_ASCII)
- return enc1;
- if (BUILTIN_TYPE(str1) != T_STRING && idx1 == ENCINDEX_US_ASCII)
- return enc2;
-
- if (BUILTIN_TYPE(str1) != T_STRING) {
- VALUE tmp = str1;
- int idx0 = idx1;
- str1 = str2;
- str2 = tmp;
- idx1 = idx2;
- idx2 = idx0;
- }
- if (BUILTIN_TYPE(str1) == T_STRING) {
- int cr1, cr2;
-
- cr1 = rb_enc_str_coderange(str1);
- if (BUILTIN_TYPE(str2) == T_STRING) {
- cr2 = rb_enc_str_coderange(str2);
- if (cr1 != cr2) {
- /* may need to handle ENC_CODERANGE_BROKEN */
- if (cr1 == ENC_CODERANGE_7BIT) return enc2;
- if (cr2 == ENC_CODERANGE_7BIT) return enc1;
- }
- if (cr2 == ENC_CODERANGE_7BIT) {
- if (idx1 == ENCINDEX_ASCII) return enc2;
- return enc1;
- }
- }
- if (cr1 == ENC_CODERANGE_7BIT)
- return enc2;
- }
- return 0;
-}
-
-void
-rb_enc_copy(VALUE obj1, VALUE obj2)
-{
- rb_enc_associate_index(obj1, rb_enc_get_index(obj2));
-}
-
-
-/*
- * call-seq:
- * obj.encoding => encoding
- *
- * Returns the Encoding object that represents the encoding of obj.
- */
-
-VALUE
-rb_obj_encoding(VALUE obj)
-{
- rb_encoding *enc = rb_enc_get(obj);
- if (!enc) {
- rb_raise(rb_eTypeError, "unknown encoding");
- }
- return rb_enc_from_encoding(enc);
-}
-
-int
-rb_enc_fast_mbclen(const char *p, const char *e, rb_encoding *enc)
-{
- return ONIGENC_MBC_ENC_LEN(enc, (UChar*)p, (UChar*)e);
-}
-
-int
-rb_enc_mbclen(const char *p, const char *e, rb_encoding *enc)
-{
- int n = ONIGENC_PRECISE_MBC_ENC_LEN(enc, (UChar*)p, (UChar*)e);
- if (MBCLEN_CHARFOUND_P(n) && MBCLEN_CHARFOUND_LEN(n) <= e-p)
- return MBCLEN_CHARFOUND_LEN(n);
- else {
- int min = rb_enc_mbminlen(enc);
- return min <= e-p ? min : e-p;
- }
-}
-
-int
-rb_enc_precise_mbclen(const char *p, const char *e, rb_encoding *enc)
-{
- int n;
- if (e <= p)
- return ONIGENC_CONSTRUCT_MBCLEN_NEEDMORE(1);
- n = ONIGENC_PRECISE_MBC_ENC_LEN(enc, (UChar*)p, (UChar*)e);
- if (e-p < n)
- return ONIGENC_CONSTRUCT_MBCLEN_NEEDMORE(n-(e-p));
- return n;
-}
-
-int
-rb_enc_ascget(const char *p, const char *e, int *len, rb_encoding *enc)
-{
- unsigned int c, l;
- if (e <= p)
- return -1;
- if (rb_enc_asciicompat(enc)) {
- c = (unsigned char)*p;
- if (!ISASCII(c))
- return -1;
- if (len) *len = 1;
- return c;
- }
- l = rb_enc_precise_mbclen(p, e, enc);
- if (!MBCLEN_CHARFOUND_P(l))
- return -1;
- c = rb_enc_mbc_to_codepoint(p, e, enc);
- if (!rb_enc_isascii(c, enc))
- return -1;
- if (len) *len = l;
- return c;
-}
-
-unsigned int
-rb_enc_codepoint_len(const char *p, const char *e, int *len_p, rb_encoding *enc)
-{
- int r;
- if (e <= p)
- rb_raise(rb_eArgError, "empty string");
- r = rb_enc_precise_mbclen(p, e, enc);
- if (MBCLEN_CHARFOUND_P(r)) {
- if (len_p) *len_p = MBCLEN_CHARFOUND_LEN(r);
- return rb_enc_mbc_to_codepoint(p, e, enc);
- }
- else
- rb_raise(rb_eArgError, "invalid byte sequence in %s", rb_enc_name(enc));
-}
-
-#undef rb_enc_codepoint
-unsigned int
-rb_enc_codepoint(const char *p, const char *e, rb_encoding *enc)
-{
- return rb_enc_codepoint_len(p, e, 0, enc);
-}
-
-int
-rb_enc_codelen(int c, rb_encoding *enc)
-{
- int n = ONIGENC_CODE_TO_MBCLEN(enc,c);
- if (n == 0) {
- rb_raise(rb_eArgError, "invalid codepoint 0x%x in %s", c, rb_enc_name(enc));
- }
- return n;
-}
-
-int
-rb_enc_toupper(int c, rb_encoding *enc)
-{
- return (ONIGENC_IS_ASCII_CODE(c)?ONIGENC_ASCII_CODE_TO_UPPER_CASE(c):(c));
-}
-
-int
-rb_enc_tolower(int c, rb_encoding *enc)
-{
- return (ONIGENC_IS_ASCII_CODE(c)?ONIGENC_ASCII_CODE_TO_LOWER_CASE(c):(c));
-}
-
-/*
- * call-seq:
- * enc.inspect => string
- *
- * Returns a string which represents the encoding for programmers.
- *
- * Encoding::UTF_8.inspect #=> "#<Encoding:UTF-8>"
- * Encoding::ISO_2022_JP.inspect #=> "#<Encoding:ISO-2022-JP (dummy)>"
- */
-static VALUE
-enc_inspect(VALUE self)
-{
- VALUE str = rb_sprintf("#<%s:%s%s>", rb_obj_classname(self),
- rb_enc_name((rb_encoding*)DATA_PTR(self)),
- (enc_dummy_p(self) ? " (dummy)" : ""));
- ENCODING_CODERANGE_SET(str, rb_usascii_encindex(), ENC_CODERANGE_7BIT);
- return str;
-}
-
-/*
- * call-seq:
- * enc.name => string
- *
- * Returns the name of the encoding.
- *
- * Encoding::UTF_8.name => "UTF-8"
- */
-static VALUE
-enc_name(VALUE self)
-{
- return rb_usascii_str_new2(rb_enc_name((rb_encoding*)DATA_PTR(self)));
-}
-
-static int
-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_usascii_str_new2((char *)name);
- OBJ_FREEZE(str);
- rb_ary_push(arg[1], str);
- }
- return ST_CONTINUE;
-}
-
-/*
- * call-seq:
- * enc.names => array
- *
- * Returns the list of name and aliases of the encoding.
- *
- * Encoding::WINDOWS_31J.names => ["Windows-31J", "CP932", "csWindows31J"]
- */
-static VALUE
-enc_names(VALUE self)
-{
- VALUE args[2];
-
- args[0] = (VALUE)rb_to_encoding_index(self);
- args[1] = rb_ary_new2(0);
- st_foreach(enc_table.names, enc_names_i, (st_data_t)args);
- return args[1];
-}
-
-/*
- * call-seq:
- * Encoding.list => [enc1, enc2, ...]
- *
- * Returns the list of loaded encodings.
- *
- * Encoding.list
- * => [#<Encoding:ASCII-8BIT>, #<Encoding:UTF-8>,
- * #<Encoding:ISO-2022-JP (dummy)>]
- *
- * Encoding.find("US-ASCII")
- * => #<Encoding:US-ASCII>
- *
- * Encoding.list
- * => [#<Encoding:ASCII-8BIT>, #<Encoding:UTF-8>,
- * #<Encoding:US-ASCII>, #<Encoding:ISO-2022-JP (dummy)>]
- *
- */
-static VALUE
-enc_list(VALUE klass)
-{
- VALUE ary = rb_ary_new2(0);
- rb_ary_replace(ary, rb_encoding_list);
- return ary;
-}
-
-/*
- * call-seq:
- * Encoding.find(string) => enc
- * Encoding.find(symbol) => enc
- *
- * Search the encoding with specified <i>name</i>.
- * <i>name</i> should be a string or symbol.
- *
- * Encoding.find("US-ASCII") => #<Encoding:US-ASCII>
- * Encoding.find(:Shift_JIS) => #<Encoding:Shift_JIS>
- *
- * An ArgumentError is raised when no encoding with <i>name</i>.
- * Only +Encoding.find("internal")+ however returns nil when no encoding named "internal",
- * in other words, when Ruby has no default internal encoding.
- */
-static VALUE
-enc_find(VALUE klass, VALUE enc)
-{
- return rb_enc_from_encoding(to_encoding(enc));
-}
-
-/*
- * call-seq:
- * Encoding.compatible?(str1, str2) => enc or nil
- *
- * Checks the compatibility of two strings.
- * If they are compatible, means concatenatable,
- * returns an encoding which the concatinated string will be.
- * If they are not compatible, nil is returned.
- *
- * Encoding.compatible?("\xa1".force_encoding("iso-8859-1"), "b")
- * => #<Encoding:ISO-8859-1>
- *
- * Encoding.compatible?(
- * "\xa1".force_encoding("iso-8859-1"),
- * "\xa1\xa1".force_encoding("euc-jp"))
- * => nil
- *
- */
-static VALUE
-enc_compatible_p(VALUE klass, VALUE str1, VALUE str2)
-{
- rb_encoding *enc;
-
- if (!enc_capable(str1)) return Qnil;
- if (!enc_capable(str2)) return Qnil;
- enc = rb_enc_compatible(str1, str2);
- if (!enc) return Qnil;
- return rb_enc_from_encoding(enc);
-}
-
-/* :nodoc: */
-static VALUE
-enc_dump(int argc, VALUE *argv, VALUE self)
-{
- rb_scan_args(argc, argv, "01", 0);
- return enc_name(self);
-}
-
-/* :nodoc: */
-static VALUE
-enc_load(VALUE klass, VALUE str)
-{
- return enc_find(klass, str);
-}
-
-rb_encoding *
-rb_ascii8bit_encoding(void)
-{
- if (!enc_table.list) {
- rb_enc_init();
- }
- return enc_table.list[ENCINDEX_ASCII].enc;
-}
-
-int
-rb_ascii8bit_encindex(void)
-{
- return ENCINDEX_ASCII;
-}
-
-rb_encoding *
-rb_utf8_encoding(void)
-{
- if (!enc_table.list) {
- rb_enc_init();
- }
- return enc_table.list[ENCINDEX_UTF_8].enc;
-}
-
-int
-rb_utf8_encindex(void)
-{
- return ENCINDEX_UTF_8;
-}
-
-rb_encoding *
-rb_usascii_encoding(void)
-{
- if (!enc_table.list) {
- rb_enc_init();
- }
- return enc_table.list[ENCINDEX_US_ASCII].enc;
-}
-
-int
-rb_usascii_encindex(void)
-{
- return ENCINDEX_US_ASCII;
-}
-
-rb_encoding *
-rb_locale_encoding(void)
-{
- VALUE charmap = rb_locale_charmap(rb_cEncoding);
- int idx;
-
- if (NIL_P(charmap))
- idx = rb_usascii_encindex();
- else if ((idx = rb_enc_find_index(StringValueCStr(charmap))) < 0)
- idx = rb_ascii8bit_encindex();
-
- if (rb_enc_registered("locale") < 0) enc_alias_internal("locale", idx);
-
- return rb_enc_from_index(idx);
-}
-
-rb_encoding *
-rb_filesystem_encoding(void)
-{
- rb_encoding *enc;
-#if defined NO_LOCALE_CHARMAP
- enc = rb_default_external_encoding();
-#elif defined _WIN32 || defined __CYGWIN__
- char cp[sizeof(int) * 8 / 3 + 4];
- snprintf(cp, sizeof cp, "CP%d", AreFileApisANSI() ? GetACP() : GetOEMCP());
- enc = rb_enc_find(cp);
-#elif defined __APPLE__
- enc = rb_enc_find("UTF-8");
-#else
- enc = rb_default_external_encoding();
-#endif
- return enc;
-}
-
-struct default_encoding {
- int index; /* -2 => not yet set, -1 => nil */
- rb_encoding *enc;
-};
-
-static int
-enc_set_default_encoding(struct default_encoding *def, VALUE encoding, const char *name)
-{
- int overridden = Qfalse;
- if (def->index != -2)
- /* Already set */
- overridden = Qtrue;
-
- if (NIL_P(encoding)) {
- def->index = -1;
- def->enc = 0;
- st_insert(enc_table.names, (st_data_t)strdup(name),
- (st_data_t)UNSPECIFIED_ENCODING);
- }
- else {
- def->index = rb_enc_to_index(rb_to_encoding(encoding));
- def->enc = 0;
- enc_alias_internal(name, def->index);
- }
-
- return overridden;
-}
-
-static struct default_encoding default_external = {0};
-
-rb_encoding *
-rb_default_external_encoding(void)
-{
- if (default_external.enc) return default_external.enc;
-
- if (default_external.index >= 0) {
- default_external.enc = rb_enc_from_index(default_external.index);
- return default_external.enc;
- }
- else {
- return rb_locale_encoding();
- }
-}
-
-VALUE
-rb_enc_default_external(void)
-{
- return rb_enc_from_encoding(rb_default_external_encoding());
-}
-
-/*
- * call-seq:
- * Encoding.default_external => enc
- *
- * Returns default external encoding.
- *
- * It is initialized by the locale or -E option.
- */
-static VALUE
-get_default_external(VALUE klass)
-{
- return rb_enc_default_external();
-}
-
-void
-rb_enc_set_default_external(VALUE encoding)
-{
- if (NIL_P(encoding)) {
- rb_raise(rb_eArgError, "default external can not be nil");
- }
- enc_set_default_encoding(&default_external, encoding,
- "external");
-}
-
-/*
- * call-seq:
- * Encoding.default_external = enc
- *
- * Sets default external encoding.
- */
-static VALUE
-set_default_external(VALUE klass, VALUE encoding)
-{
- rb_warning("setting Encoding.default_external");
- rb_enc_set_default_external(encoding);
- return encoding;
-}
-
-static struct default_encoding default_internal = {-2};
-
-rb_encoding *
-rb_default_internal_encoding(void)
-{
- if (!default_internal.enc && default_internal.index >= 0) {
- default_internal.enc = rb_enc_from_index(default_internal.index);
- }
- return default_internal.enc; /* can be NULL */
-}
-
-VALUE
-rb_enc_default_internal(void)
-{
- /* Note: These functions cope with default_internal not being set */
- return rb_enc_from_encoding(rb_default_internal_encoding());
-}
-
-/*
- * call-seq:
- * Encoding.default_internal => enc
- *
- * Returns default internal encoding.
- *
- * It is initialized by the source internal_encoding or -E option.
- */
-static VALUE
-get_default_internal(VALUE klass)
-{
- return rb_enc_default_internal();
-}
-
-void
-rb_enc_set_default_internal(VALUE encoding)
-{
- enc_set_default_encoding(&default_internal, encoding,
- "internal");
-}
-
-/*
- * call-seq:
- * Encoding.default_internal = enc or nil
- *
- * Sets default internal encoding.
- * Or removes default internal encoding when passed nil.
- */
-static VALUE
-set_default_internal(VALUE klass, VALUE encoding)
-{
- rb_warning("setting Encoding.default_internal");
- rb_enc_set_default_internal(encoding);
- return encoding;
-}
-
-/*
- * call-seq:
- * Encoding.locale_charmap => string
- *
- * Returns the locale charmap name.
- *
- * 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 higly platform dependent.
- * So Encoding.find(Encoding.locale_charmap) may cause an error.
- * If you need some encoding object even for unknown locale,
- * Encoding.find("locale") can be used.
- *
- */
-VALUE
-rb_locale_charmap(VALUE klass)
-{
-#if defined NO_LOCALE_CHARMAP
- return rb_usascii_str_new2("ASCII-8BIT");
-#elif defined _WIN32 || defined __CYGWIN__
- const char *nl_langinfo_codeset(void);
- const char *codeset = nl_langinfo_codeset();
- char cp[sizeof(int) * 3 + 4];
- if (!codeset) {
- snprintf(cp, sizeof(cp), "CP%d", GetConsoleCP());
- codeset = cp;
- }
- return rb_usascii_str_new2(codeset);
-#elif defined HAVE_LANGINFO_H
- char *codeset;
- codeset = nl_langinfo(CODESET);
- return rb_usascii_str_new2(codeset);
-#else
- return Qnil;
-#endif
-}
-
-static void
-set_encoding_const(const char *name, rb_encoding *enc)
-{
- VALUE encoding = rb_enc_from_encoding(enc);
- char *s = (char *)name;
- int haslower = 0, hasupper = 0, valid = 0;
-
- if (ISDIGIT(*s)) return;
- if (ISUPPER(*s)) {
- hasupper = 1;
- while (*++s && (ISALNUM(*s) || *s == '_')) {
- if (ISLOWER(*s)) haslower = 1;
- }
- }
- if (!*s) {
- valid = 1;
- rb_define_const(rb_cEncoding, name, encoding);
- }
- if (!valid || haslower) {
- int len = strlen(name) + 1;
- if (!haslower || !hasupper) {
- do {
- if (ISLOWER(*s)) haslower = 1;
- if (ISUPPER(*s)) hasupper = 1;
- } while (*++s && (!haslower || !hasupper));
- }
- MEMCPY(s = ALLOCA_N(char, len), name, char, len);
- name = s;
- if (!valid) {
- if (ISLOWER(*s)) *s = ONIGENC_ASCII_CODE_TO_UPPER_CASE((int)*s);
- for (; *s; ++s) {
- if (!ISALNUM(*s)) *s = '_';
- }
- if (hasupper) {
- rb_define_const(rb_cEncoding, name, encoding);
- }
- }
- if (haslower) {
- for (s = (char *)name; *s; ++s) {
- if (ISLOWER(*s)) *s = ONIGENC_ASCII_CODE_TO_UPPER_CASE((int)*s);
- }
- rb_define_const(rb_cEncoding, name, encoding);
- }
- }
-}
-
-static int
-rb_enc_name_list_i(st_data_t name, st_data_t idx, st_data_t arg)
-{
- VALUE ary = (VALUE)arg;
- VALUE str = rb_usascii_str_new2((char *)name);
- OBJ_FREEZE(str);
- rb_ary_push(ary, str);
- return ST_CONTINUE;
-}
-
-/*
- * call-seq:
- * Encoding.name_list => ["enc1", "enc2", ...]
- *
- * Returns the list of available encoding names.
- *
- * Encoding.name_list
- * => ["US-ASCII", "ASCII-8BIT", "UTF-8",
- * "ISO-8859-1", "Shift_JIS", "EUC-JP",
- * "Windows-31J",
- * "BINARY", "CP932", "eucJP"]
- *
- */
-
-static VALUE
-rb_enc_name_list(VALUE klass)
-{
- VALUE ary = rb_ary_new2(enc_table.names->num_entries);
- st_foreach(enc_table.names, rb_enc_name_list_i, (st_data_t)ary);
- return ary;
-}
-
-static int
-rb_enc_aliases_enc_i(st_data_t name, st_data_t orig, st_data_t arg)
-{
- VALUE *p = (VALUE *)arg;
- VALUE aliases = p[0], ary = p[1];
- int idx = (int)orig;
- VALUE key, str = rb_ary_entry(ary, idx);
-
- if (NIL_P(str)) {
- rb_encoding *enc = rb_enc_from_index(idx);
-
- if (!enc) return ST_CONTINUE;
- if (STRCASECMP((char*)name, rb_enc_name(enc)) == 0) {
- return ST_CONTINUE;
- }
- str = rb_usascii_str_new2(rb_enc_name(enc));
- OBJ_FREEZE(str);
- rb_ary_store(ary, idx, str);
- }
- key = rb_usascii_str_new2((char *)name);
- OBJ_FREEZE(key);
- rb_hash_aset(aliases, key, str);
- return ST_CONTINUE;
-}
-
-/*
- * call-seq:
- * Encoding.aliases => {"alias1" => "orig1", "alias2" => "orig2", ...}
- *
- * Returns the hash of available encoding alias and original encoding name.
- *
- * Encoding.aliases
- * => {"BINARY"=>"ASCII-8BIT", "ASCII"=>"US-ASCII", "ANSI_X3.4-1986"=>"US-ASCII",
- * "SJIS"=>"Shift_JIS", "eucJP"=>"EUC-JP", "CP932"=>"Windows-31J"}
- *
- */
-
-static VALUE
-rb_enc_aliases(VALUE klass)
-{
- VALUE aliases[2];
- aliases[0] = rb_hash_new();
- aliases[1] = rb_ary_new();
- st_foreach(enc_table.names, rb_enc_aliases_enc_i, (st_data_t)aliases);
- return aliases[0];
-}
-
-void
-Init_Encoding(void)
-{
-#undef rb_intern
-#define rb_intern(str) rb_intern_const(str)
- VALUE list;
- int i;
-
- rb_cEncoding = rb_define_class("Encoding", rb_cObject);
- rb_undef_alloc_func(rb_cEncoding);
- rb_define_method(rb_cEncoding, "to_s", enc_name, 0);
- rb_define_method(rb_cEncoding, "inspect", enc_inspect, 0);
- rb_define_method(rb_cEncoding, "name", enc_name, 0);
- rb_define_method(rb_cEncoding, "names", enc_names, 0);
- rb_define_method(rb_cEncoding, "dummy?", enc_dummy_p, 0);
- rb_define_singleton_method(rb_cEncoding, "list", enc_list, 0);
- rb_define_singleton_method(rb_cEncoding, "name_list", rb_enc_name_list, 0);
- rb_define_singleton_method(rb_cEncoding, "aliases", rb_enc_aliases, 0);
- rb_define_singleton_method(rb_cEncoding, "find", enc_find, 1);
- rb_define_singleton_method(rb_cEncoding, "compatible?", enc_compatible_p, 2);
-
- rb_define_method(rb_cEncoding, "_dump", enc_dump, -1);
- rb_define_singleton_method(rb_cEncoding, "_load", enc_load, 1);
-
- rb_define_singleton_method(rb_cEncoding, "default_external", get_default_external, 0);
- 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);
-
- list = rb_ary_new2(enc_table.count);
- RBASIC(list)->klass = 0;
- rb_encoding_list = list;
- rb_gc_register_mark_object(list);
-
- for (i = 0; i < enc_table.count; ++i) {
- rb_ary_push(list, enc_new(enc_table.list[i].enc));
- }
-}
-
-/* locale insensitive functions */
-
-#define ctype_test(c, ctype) \
- (rb_isascii(c) && ONIGENC_IS_ASCII_CODE_CTYPE((c), ctype))
-
-int rb_isalnum(int c) { return ctype_test(c, ONIGENC_CTYPE_ALNUM); }
-int rb_isalpha(int c) { return ctype_test(c, ONIGENC_CTYPE_ALPHA); }
-int rb_isblank(int c) { return ctype_test(c, ONIGENC_CTYPE_BLANK); }
-int rb_iscntrl(int c) { return ctype_test(c, ONIGENC_CTYPE_CNTRL); }
-int rb_isdigit(int c) { return ctype_test(c, ONIGENC_CTYPE_DIGIT); }
-int rb_isgraph(int c) { return ctype_test(c, ONIGENC_CTYPE_GRAPH); }
-int rb_islower(int c) { return ctype_test(c, ONIGENC_CTYPE_LOWER); }
-int rb_isprint(int c) { return ctype_test(c, ONIGENC_CTYPE_PRINT); }
-int rb_ispunct(int c) { return ctype_test(c, ONIGENC_CTYPE_PUNCT); }
-int rb_isspace(int c) { return ctype_test(c, ONIGENC_CTYPE_SPACE); }
-int rb_isupper(int c) { return ctype_test(c, ONIGENC_CTYPE_UPPER); }
-int rb_isxdigit(int c) { return ctype_test(c, ONIGENC_CTYPE_XDIGIT); }
-
-int
-rb_tolower(int c)
-{
- return rb_isascii(c) ? ONIGENC_ASCII_CODE_TO_LOWER_CASE(c) : c;
-}
-
-int
-rb_toupper(int c)
-{
- return rb_isascii(c) ? ONIGENC_ASCII_CODE_TO_UPPER_CASE(c) : c;
-}
-
diff --git a/enum.c b/enum.c
index 3379cf2c75..df35c2fe03 100644
--- a/enum.c
+++ b/enum.c
@@ -3,39 +3,67 @@
enum.c -
$Author$
+ $Date$
created at: Fri Oct 1 15:15:19 JST 1993
- Copyright (C) 1993-2007 Yukihiro Matsumoto
+ Copyright (C) 1993-2003 Yukihiro Matsumoto
**********************************************************************/
-#include "ruby/ruby.h"
-#include "ruby/util.h"
+#include "ruby.h"
#include "node.h"
+#include "util.h"
VALUE rb_mEnumerable;
-static ID id_each, id_eqq, id_cmp, id_next, id_size;
+static ID id_each, id_eqq, id_cmp, id_size;
+struct iter_method_arg {
+ VALUE obj;
+ ID mid;
+ int argc;
+ VALUE *argv;
+};
+
+static VALUE iterate_method _((VALUE obj));
static VALUE
-enum_values_pack(int argc, VALUE *argv)
+iterate_method(obj)
+ VALUE obj;
{
- if (argc == 0) return Qnil;
- if (argc == 1) return argv[0];
- return rb_ary_new4(argc, argv);
+ struct iter_method_arg *arg;
+
+ arg = (struct iter_method_arg *)obj;
+ return rb_funcall2(arg->obj, arg->mid, arg->argc, arg->argv);
}
-#define ENUM_WANT_SVALUE() do { \
- i = enum_values_pack(argc, argv); \
-} while (0)
+VALUE
+rb_block_call(obj, mid, argc, argv, bl_proc, data2)
+ VALUE obj;
+ ID mid;
+ int argc;
+ VALUE *argv;
+ VALUE (*bl_proc) (ANYARGS);
+ VALUE data2;
+{
+ struct iter_method_arg arg;
-#define enum_yield rb_yield_values2
+ arg.obj = obj;
+ arg.mid = mid;
+ arg.argc = argc;
+ arg.argv = argv;
+ return rb_iterate(iterate_method, (VALUE)&arg, bl_proc, data2);
+}
-static VALUE
-grep_i(VALUE i, VALUE args, int argc, VALUE *argv)
+VALUE
+rb_each(obj)
+ VALUE obj;
{
- VALUE *arg = (VALUE *)args;
- ENUM_WANT_SVALUE();
+ return rb_funcall(obj, id_each, 0, 0);
+}
+static VALUE
+grep_i(i, arg)
+ VALUE i, *arg;
+{
if (RTEST(rb_funcall(arg[0], id_eqq, 1, i))) {
rb_ary_push(arg[1], i);
}
@@ -43,11 +71,9 @@ grep_i(VALUE i, VALUE args, int argc, VALUE *argv)
}
static VALUE
-grep_iter_i(VALUE i, VALUE args, int argc, VALUE *argv)
+grep_iter_i(i, arg)
+ VALUE i, *arg;
{
- VALUE *arg = (VALUE *)args;
- ENUM_WANT_SVALUE();
-
if (RTEST(rb_funcall(arg[0], id_eqq, 1, i))) {
rb_ary_push(arg[1], rb_yield(i));
}
@@ -66,14 +92,15 @@ grep_iter_i(VALUE i, VALUE args, int argc, VALUE *argv)
*
* (1..100).grep 38..44 #=> [38, 39, 40, 41, 42, 43, 44]
* c = IO.constants
- * c.grep(/SEEK/) #=> [:SEEK_SET, :SEEK_CUR, :SEEK_END]
+ * c.grep(/SEEK/) #=> ["SEEK_END", "SEEK_SET", "SEEK_CUR"]
* res = c.grep(/SEEK/) {|v| IO.const_get(v) }
- * res #=> [0, 1, 2]
+ * res #=> [2, 0, 1]
*
*/
static VALUE
-enum_grep(VALUE obj, VALUE pat)
+enum_grep(obj, pat)
+ VALUE obj, pat;
{
VALUE ary = rb_ary_new();
VALUE arg[2];
@@ -81,37 +108,41 @@ enum_grep(VALUE obj, VALUE pat)
arg[0] = pat;
arg[1] = ary;
- rb_block_call(obj, id_each, 0, 0, rb_block_given_p() ? grep_iter_i : grep_i, (VALUE)arg);
+ rb_iterate(rb_each, obj, rb_block_given_p() ? grep_iter_i : grep_i, (VALUE)arg);
return ary;
}
+static VALUE count_i _((VALUE, VALUE));
static VALUE
-count_i(VALUE i, VALUE memop, int argc, VALUE *argv)
+count_i(i, memop)
+ VALUE i, memop;
{
VALUE *memo = (VALUE*)memop;
- ENUM_WANT_SVALUE();
-
if (rb_equal(i, memo[1])) {
memo[0]++;
}
return Qnil;
}
+static VALUE count_iter_i _((VALUE, VALUE));
static VALUE
-count_iter_i(VALUE i, VALUE memop, int argc, VALUE *argv)
+count_iter_i(i, memop)
+ VALUE i, memop;
{
VALUE *memo = (VALUE*)memop;
- if (RTEST(enum_yield(argc, argv))) {
+ if (RTEST(rb_yield(i))) {
memo[0]++;
}
return Qnil;
}
+static VALUE count_all_i _((VALUE, VALUE));
static VALUE
-count_all_i(VALUE i, VALUE memop, int argc, VALUE *argv)
+count_all_i(i, memop)
+ VALUE i, memop;
{
VALUE *memo = (VALUE*)memop;
@@ -139,7 +170,10 @@ count_all_i(VALUE i, VALUE memop, int argc, VALUE *argv)
*/
static VALUE
-enum_count(int argc, VALUE *argv, VALUE obj)
+enum_count(argc, argv, obj)
+ int argc;
+ VALUE *argv;
+ VALUE obj;
{
VALUE memo[2]; /* [count, condition value] */
rb_block_call_func *func;
@@ -169,10 +203,10 @@ enum_count(int argc, VALUE *argv, VALUE obj)
}
static VALUE
-find_i(VALUE i, VALUE *memo, int argc, VALUE *argv)
+find_i(i, memo)
+ VALUE i;
+ VALUE *memo;
{
- ENUM_WANT_SVALUE();
-
if (RTEST(rb_yield(i))) {
*memo = i;
rb_iter_break();
@@ -196,14 +230,17 @@ find_i(VALUE i, VALUE *memo, int argc, VALUE *argv)
*/
static VALUE
-enum_find(int argc, VALUE *argv, VALUE obj)
+enum_find(argc, argv, obj)
+ int argc;
+ VALUE* argv;
+ VALUE obj;
{
VALUE memo = Qundef;
VALUE if_none;
rb_scan_args(argc, argv, "01", &if_none);
RETURN_ENUMERATOR(obj, argc, argv);
- rb_block_call(obj, id_each, 0, 0, find_i, (VALUE)&memo);
+ rb_iterate(rb_each, obj, find_i, (VALUE)&memo);
if (memo != Qundef) {
return memo;
}
@@ -213,13 +250,14 @@ enum_find(int argc, VALUE *argv, VALUE obj)
return Qnil;
}
+static VALUE find_index_i _((VALUE, VALUE));
static VALUE
-find_index_i(VALUE i, VALUE memop, int argc, VALUE *argv)
+find_index_i(i, memop)
+ VALUE i;
+ VALUE memop;
{
VALUE *memo = (VALUE*)memop;
- ENUM_WANT_SVALUE();
-
if (rb_equal(i, memo[2])) {
memo[0] = UINT2NUM(memo[1]);
rb_iter_break();
@@ -228,12 +266,15 @@ find_index_i(VALUE i, VALUE memop, int argc, VALUE *argv)
return Qnil;
}
+static VALUE find_index_iter_i _((VALUE, VALUE));
static VALUE
-find_index_iter_i(VALUE i, VALUE memop, int argc, VALUE *argv)
+find_index_iter_i(i, memop)
+ VALUE i;
+ VALUE memop;
{
VALUE *memo = (VALUE*)memop;
- if (RTEST(enum_yield(argc, argv))) {
+ if (RTEST(rb_yield(i))) {
memo[0] = UINT2NUM(memo[1]);
rb_iter_break();
}
@@ -258,7 +299,10 @@ find_index_iter_i(VALUE i, VALUE memop, int argc, VALUE *argv)
*/
static VALUE
-enum_find_index(int argc, VALUE *argv, VALUE obj)
+enum_find_index(argc, argv, obj)
+ int argc;
+ VALUE *argv;
+ VALUE obj;
{
VALUE memo[3]; /* [return value, current index, condition value] */
rb_block_call_func *func;
@@ -282,10 +326,9 @@ enum_find_index(int argc, VALUE *argv, VALUE obj)
}
static VALUE
-find_all_i(VALUE i, VALUE ary, int argc, VALUE *argv)
+find_all_i(i, ary)
+ VALUE i, ary;
{
- ENUM_WANT_SVALUE();
-
if (RTEST(rb_yield(i))) {
rb_ary_push(ary, i);
}
@@ -306,23 +349,21 @@ find_all_i(VALUE i, VALUE ary, int argc, VALUE *argv)
*/
static VALUE
-enum_find_all(VALUE obj)
+enum_find_all(obj)
+ VALUE obj;
{
- VALUE ary;
+ VALUE ary = rb_ary_new();
RETURN_ENUMERATOR(obj, 0, 0);
-
- ary = rb_ary_new();
- rb_block_call(obj, id_each, 0, 0, find_all_i, ary);
+ rb_iterate(rb_each, obj, find_all_i, ary);
return ary;
}
static VALUE
-reject_i(VALUE i, VALUE ary, int argc, VALUE *argv)
+reject_i(i, ary)
+ VALUE i, ary;
{
- ENUM_WANT_SVALUE();
-
if (!RTEST(rb_yield(i))) {
rb_ary_push(ary, i);
}
@@ -341,31 +382,31 @@ reject_i(VALUE i, VALUE ary, int argc, VALUE *argv)
*/
static VALUE
-enum_reject(VALUE obj)
+enum_reject(obj)
+ VALUE obj;
{
- VALUE ary;
+ VALUE ary = rb_ary_new();
RETURN_ENUMERATOR(obj, 0, 0);
-
- ary = rb_ary_new();
- rb_block_call(obj, id_each, 0, 0, reject_i, ary);
+ rb_iterate(rb_each, obj, reject_i, ary);
return ary;
}
static VALUE
-collect_i(VALUE i, VALUE ary, int argc, VALUE *argv)
+collect_i(i, ary)
+ VALUE i, ary;
{
- rb_ary_push(ary, enum_yield(argc, argv));
+ rb_ary_push(ary, rb_yield(i));
return Qnil;
}
static VALUE
-collect_all(VALUE i, VALUE ary, int argc, VALUE *argv)
+collect_all(i, ary)
+ VALUE i, ary;
{
- rb_thread_check_ints();
- rb_ary_push(ary, enum_values_pack(argc, argv));
+ rb_ary_push(ary, i);
return Qnil;
}
@@ -384,14 +425,12 @@ collect_all(VALUE i, VALUE ary, int argc, VALUE *argv)
*/
static VALUE
-enum_collect(VALUE obj)
+enum_collect(obj)
+ VALUE obj;
{
- VALUE ary;
+ VALUE ary = rb_ary_new();
- RETURN_ENUMERATOR(obj, 0, 0);
-
- ary = rb_ary_new();
- rb_block_call(obj, id_each, 0, 0, collect_i, ary);
+ rb_iterate(rb_each, obj, rb_block_given_p() ? collect_i : collect_all, ary);
return ary;
}
@@ -407,23 +446,25 @@ enum_collect(VALUE obj)
* { 'a'=>1, 'b'=>2, 'c'=>3 }.to_a #=> [["a", 1], ["b", 2], ["c", 3]]
*/
static VALUE
-enum_to_a(int argc, VALUE *argv, VALUE obj)
+enum_to_a(argc, argv, obj)
+ 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 inject_i _((VALUE, VALUE));
static VALUE
-inject_i(VALUE i, VALUE p, int argc, VALUE *argv)
+inject_i(i, p)
+ VALUE i;
+ VALUE p;
{
VALUE *memo = (VALUE *)p;
-
- ENUM_WANT_SVALUE();
-
if (memo[0] == Qundef) {
memo[0] = i;
}
@@ -433,13 +474,14 @@ inject_i(VALUE i, VALUE p, int argc, VALUE *argv)
return Qnil;
}
+static VALUE inject_op_i _((VALUE, VALUE));
static VALUE
-inject_op_i(VALUE i, VALUE p, int argc, VALUE *argv)
+inject_op_i(i, p)
+ VALUE i;
+ VALUE p;
{
VALUE *memo = (VALUE *)p;
- ENUM_WANT_SVALUE();
-
if (memo[0] == Qundef) {
memo[0] = i;
}
@@ -495,10 +537,13 @@ inject_op_i(VALUE i, VALUE p, int argc, VALUE *argv)
*
*/
static VALUE
-enum_inject(int argc, VALUE *argv, VALUE obj)
+enum_inject(argc, argv, obj)
+ int argc;
+ VALUE *argv;
+ VALUE obj;
{
VALUE memo[2];
- VALUE (*iter)(VALUE, VALUE, int, VALUE*) = inject_i;
+ rb_block_call_func *iter = inject_i;
switch (rb_scan_args(argc, argv, "02", &memo[0], &memo[1])) {
case 0:
@@ -526,10 +571,9 @@ enum_inject(int argc, VALUE *argv, VALUE obj)
}
static VALUE
-partition_i(VALUE i, VALUE *ary, int argc, VALUE *argv)
+partition_i(i, ary)
+ VALUE i, *ary;
{
- ENUM_WANT_SVALUE();
-
if (RTEST(rb_yield(i))) {
rb_ary_push(ary[0], i);
}
@@ -552,7 +596,8 @@ partition_i(VALUE i, VALUE *ary, int argc, VALUE *argv)
*/
static VALUE
-enum_partition(VALUE obj)
+enum_partition(obj)
+ VALUE obj;
{
VALUE ary[2];
@@ -560,20 +605,19 @@ enum_partition(VALUE obj)
ary[0] = rb_ary_new();
ary[1] = rb_ary_new();
- rb_block_call(obj, id_each, 0, 0, partition_i, (VALUE)ary);
+ rb_iterate(rb_each, obj, partition_i, (VALUE)ary);
return rb_assoc_new(ary[0], ary[1]);
}
static VALUE
-group_by_i(VALUE i, VALUE hash, int argc, VALUE *argv)
+group_by_i(i, hash)
+ VALUE i;
+ VALUE hash;
{
- VALUE group;
+ VALUE group = rb_yield(i);
VALUE values;
- ENUM_WANT_SVALUE();
-
- group = rb_yield(i);
values = rb_hash_aref(hash, group);
if (NIL_P(values)) {
values = rb_ary_new3(1, i);
@@ -598,7 +642,8 @@ group_by_i(VALUE i, VALUE hash, int argc, VALUE *argv)
*/
static VALUE
-enum_group_by(VALUE obj)
+enum_group_by(obj)
+ VALUE obj;
{
VALUE hash;
@@ -606,29 +651,28 @@ enum_group_by(VALUE obj)
hash = rb_hash_new();
rb_block_call(obj, id_each, 0, 0, group_by_i, hash);
- OBJ_INFECT(hash, obj);
return hash;
}
static VALUE
-first_i(VALUE i, VALUE *params, int argc, VALUE *argv)
+first_i(i, ary)
+ VALUE i;
+ VALUE *ary;
{
- ENUM_WANT_SVALUE();
-
- if (NIL_P(params[1])) {
- params[1] = i;
+ if (NIL_P(ary[0])) {
+ ary[1] = i;
rb_iter_break();
}
else {
- long n = params[0];
+ long n = NUM2LONG(ary[0]);
- rb_ary_push(params[1], i);
- n--;
if (n <= 0) {
rb_iter_break();
}
- params[0] = n;
+ rb_ary_push(ary[1], i);
+ n--;
+ ary[0] = INT2NUM(n);
}
return Qnil;
}
@@ -645,28 +689,24 @@ first_i(VALUE i, VALUE *params, int argc, VALUE *argv)
*/
static VALUE
-enum_first(int argc, VALUE *argv, VALUE obj)
+enum_first(argc, argv, obj)
+ int argc;
+ VALUE *argv;
+ VALUE obj;
{
- VALUE n, params[2];
+ VALUE n, ary[2];
if (argc == 0) {
- params[0] = params[1] = Qnil;
+ ary[0] = ary[1] = Qnil;
}
else {
- long len;
-
rb_scan_args(argc, argv, "01", &n);
- len = NUM2LONG(n);
- if (len == 0) return rb_ary_new2(0);
- if (len < 0) {
- rb_raise(rb_eArgError, "negative length");
- }
- params[0] = len;
- params[1] = rb_ary_new2(len);
+ ary[0] = n;
+ ary[1] = rb_ary_new2(NUM2LONG(n));
}
- rb_block_call(obj, id_each, 0, 0, first_i, (VALUE)params);
+ rb_block_call(obj, id_each, 0, 0, first_i, (VALUE)ary);
- return params[1];
+ return ary[1];
}
@@ -688,32 +728,35 @@ enum_first(int argc, VALUE *argv, VALUE obj)
*/
static VALUE
-enum_sort(VALUE obj)
+enum_sort(obj)
+ VALUE obj;
{
return rb_ary_sort(enum_to_a(0, 0, obj));
}
static VALUE
-sort_by_i(VALUE i, VALUE ary, int argc, VALUE *argv)
+sort_by_i(i, ary)
+ VALUE i, ary;
{
+ VALUE v;
NODE *memo;
- ENUM_WANT_SVALUE();
-
+ v = rb_yield(i);
if (RBASIC(ary)->klass) {
rb_raise(rb_eRuntimeError, "sort_by reentered");
}
- /* use NODE_DOT2 as memo(v, v, -) */
- memo = rb_node_newnode(NODE_DOT2, rb_yield(i), i, 0);
+ memo = rb_node_newnode(NODE_MEMO, v, i, 0);
rb_ary_push(ary, (VALUE)memo);
return Qnil;
}
static int
-sort_by_cmp(const void *ap, const void *bp, void *data)
+sort_by_cmp(aa, bb, data)
+ NODE **aa, **bb;
+ void *data;
{
- VALUE a = (*(NODE *const *)ap)->u1.value;
- VALUE b = (*(NODE *const *)bp)->u1.value;
+ VALUE a = aa[0]->u1.value;
+ VALUE b = bb[0]->u1.value;
VALUE ary = (VALUE)data;
if (RBASIC(ary)->klass) {
@@ -730,7 +773,7 @@ sort_by_cmp(const void *ap, const void *bp, void *data)
* values in <i>enum</i> through the given block.
*
* %w{ apple pear fig }.sort_by {|word| word.length}
- * #=> ["fig", "pear", "apple"]
+ #=> ["fig", "pear", "apple"]
*
* The current implementation of <code>sort_by</code> generates an
* array of tuples containing the original collection element and the
@@ -792,7 +835,8 @@ sort_by_cmp(const void *ap, const void *bp, void *data)
*/
static VALUE
-enum_sort_by(VALUE obj)
+enum_sort_by(obj)
+ VALUE obj;
{
VALUE ary;
long i;
@@ -800,58 +844,47 @@ enum_sort_by(VALUE obj)
RETURN_ENUMERATOR(obj, 0, 0);
if (TYPE(obj) == T_ARRAY) {
- ary = rb_ary_new2(RARRAY_LEN(obj));
+ ary = rb_ary_new2(RARRAY(obj)->len);
}
else {
ary = rb_ary_new();
}
RBASIC(ary)->klass = 0;
- rb_block_call(obj, id_each, 0, 0, sort_by_i, ary);
- if (RARRAY_LEN(ary) > 1) {
- ruby_qsort(RARRAY_PTR(ary), RARRAY_LEN(ary), sizeof(VALUE),
- sort_by_cmp, (void *)ary);
+ rb_iterate(rb_each, obj, sort_by_i, ary);
+ if (RARRAY(ary)->len > 1) {
+ qsort(RARRAY(ary)->ptr, RARRAY(ary)->len, sizeof(VALUE),
+ sort_by_cmp, (void *)ary);
}
if (RBASIC(ary)->klass) {
rb_raise(rb_eRuntimeError, "sort_by reentered");
}
- for (i=0; i<RARRAY_LEN(ary); i++) {
- RARRAY_PTR(ary)[i] = RNODE(RARRAY_PTR(ary)[i])->u2.value;
+ for (i=0; i<RARRAY(ary)->len; i++) {
+ RARRAY(ary)->ptr[i] = RNODE(RARRAY(ary)->ptr[i])->u2.value;
}
RBASIC(ary)->klass = rb_cArray;
- OBJ_INFECT(ary, obj);
-
return ary;
}
-#define ENUMFUNC(name) rb_block_given_p() ? name##_iter_i : name##_i
-
-#define DEFINE_ENUMFUNCS(name) \
-static VALUE enum_##name##_func(VALUE result, VALUE *memo); \
-\
-static VALUE \
-name##_i(VALUE i, VALUE *memo, int argc, VALUE *argv) \
-{ \
- return enum_##name##_func(enum_values_pack(argc, argv), memo); \
-} \
-\
-static VALUE \
-name##_iter_i(VALUE i, VALUE *memo, int argc, VALUE *argv) \
-{ \
- return enum_##name##_func(enum_yield(argc, argv), memo); \
-} \
-\
-static VALUE \
-enum_##name##_func(VALUE result, VALUE *memo)
-
-DEFINE_ENUMFUNCS(all)
-{
- if (!RTEST(result)) {
+static VALUE
+all_i(i, memo)
+ VALUE i;
+ VALUE *memo;
+{
+ if (!RTEST(i)) {
*memo = Qfalse;
rb_iter_break();
}
return Qnil;
}
+static VALUE
+all_iter_i(i, memo)
+ VALUE i;
+ VALUE *memo;
+{
+ return all_i(rb_yield(i), memo);
+}
+
/*
* call-seq:
* enum.all? [{|obj| block } ] => true or false
@@ -863,30 +896,42 @@ DEFINE_ENUMFUNCS(all)
* <code>all?</code> will return <code>true</code> only if none of the
* collection members are <code>false</code> or <code>nil</code>.)
*
- * %w{ant bear cat}.all? {|word| word.length >= 3} #=> true
- * %w{ant bear cat}.all? {|word| word.length >= 4} #=> false
- * [ nil, true, 99 ].all? #=> false
+ * %w{ ant bear cat}.all? {|word| word.length >= 3} #=> true
+ * %w{ ant bear cat}.all? {|word| word.length >= 4} #=> false
+ * [ nil, true, 99 ].all? #=> false
*
*/
static VALUE
-enum_all(VALUE obj)
+enum_all(obj)
+ VALUE obj;
{
VALUE result = Qtrue;
- rb_block_call(obj, id_each, 0, 0, ENUMFUNC(all), (VALUE)&result);
+ rb_iterate(rb_each, obj, rb_block_given_p() ? all_iter_i : all_i, (VALUE)&result);
return result;
}
-DEFINE_ENUMFUNCS(any)
+static VALUE
+any_i(i, memo)
+ VALUE i;
+ VALUE *memo;
{
- if (RTEST(result)) {
+ if (RTEST(i)) {
*memo = Qtrue;
rb_iter_break();
}
return Qnil;
}
+static VALUE
+any_iter_i(i, memo)
+ VALUE i;
+ VALUE *memo;
+{
+ return any_i(rb_yield(i), memo);
+}
+
/*
* call-seq:
* enum.any? [{|obj| block } ] => true or false
@@ -899,24 +944,28 @@ DEFINE_ENUMFUNCS(any)
* of the collection members is not <code>false</code> or
* <code>nil</code>.
*
- * %w{ant bear cat}.any? {|word| word.length >= 3} #=> true
- * %w{ant bear cat}.any? {|word| word.length >= 4} #=> true
- * [ nil, true, 99 ].any? #=> true
+ * %w{ ant bear cat}.any? {|word| word.length >= 3} #=> true
+ * %w{ ant bear cat}.any? {|word| word.length >= 4} #=> true
+ * [ nil, true, 99 ].any? #=> true
*
*/
static VALUE
-enum_any(VALUE obj)
+enum_any(obj)
+ VALUE obj;
{
VALUE result = Qfalse;
- rb_block_call(obj, id_each, 0, 0, ENUMFUNC(any), (VALUE)&result);
+ rb_iterate(rb_each, obj, rb_block_given_p() ? any_iter_i : any_i, (VALUE)&result);
return result;
}
-DEFINE_ENUMFUNCS(one)
+static VALUE
+one_i(i, memo)
+ VALUE i;
+ VALUE *memo;
{
- if (RTEST(result)) {
+ if (RTEST(i)) {
if (*memo == Qundef) {
*memo = Qtrue;
}
@@ -928,6 +977,14 @@ DEFINE_ENUMFUNCS(one)
return Qnil;
}
+static VALUE
+one_iter_i(i, memo)
+ VALUE i;
+ VALUE *memo;
+{
+ return one_i(rb_yield(i), memo);
+}
+
/*
* call-seq:
* enum.one? [{|obj| block }] => true or false
@@ -947,24 +1004,36 @@ DEFINE_ENUMFUNCS(one)
*/
static VALUE
-enum_one(VALUE obj)
+enum_one(obj)
+ VALUE obj;
{
VALUE result = Qundef;
- rb_block_call(obj, id_each, 0, 0, ENUMFUNC(one), (VALUE)&result);
+ rb_block_call(obj, id_each, 0, 0, rb_block_given_p() ? one_iter_i : one_i, (VALUE)&result);
if (result == Qundef) return Qfalse;
return result;
}
-DEFINE_ENUMFUNCS(none)
+static VALUE
+none_i(i, memo)
+ VALUE i;
+ VALUE *memo;
{
- if (RTEST(result)) {
+ if (RTEST(i)) {
*memo = Qfalse;
rb_iter_break();
}
return Qnil;
}
+static VALUE
+none_iter_i(i, memo)
+ VALUE i;
+ VALUE *memo;
+{
+ return none_i(rb_yield(i), memo);
+}
+
/*
* call-seq:
* enum.none? [{|obj| block }] => true or false
@@ -981,21 +1050,22 @@ DEFINE_ENUMFUNCS(none)
* [nil,false].none? #=> true
*/
static VALUE
-enum_none(VALUE obj)
+enum_none(obj)
+ VALUE obj;
{
VALUE result = Qtrue;
- rb_block_call(obj, id_each, 0, 0, ENUMFUNC(none), (VALUE)&result);
+ rb_block_call(obj, id_each, 0, 0, rb_block_given_p() ? none_iter_i : none_i, (VALUE)&result);
return result;
}
static VALUE
-min_i(VALUE i, VALUE *memo, int argc, VALUE *argv)
+min_i(i, memo)
+ VALUE i;
+ VALUE *memo;
{
VALUE cmp;
- ENUM_WANT_SVALUE();
-
if (*memo == Qundef) {
*memo = i;
}
@@ -1009,20 +1079,17 @@ min_i(VALUE i, VALUE *memo, int argc, VALUE *argv)
}
static VALUE
-min_ii(VALUE i, VALUE *memo, int argc, VALUE *argv)
+min_ii(i, memo)
+ VALUE i;
+ VALUE *memo;
{
VALUE cmp;
- ENUM_WANT_SVALUE();
-
if (*memo == Qundef) {
*memo = i;
}
else {
- VALUE ary = memo[1];
- RARRAY_PTR(ary)[0] = i;
- RARRAY_PTR(ary)[1] = *memo;
- cmp = rb_yield(ary);
+ cmp = rb_yield_values(2, i, *memo);
if (rb_cmpint(cmp, i, *memo) < 0) {
*memo = i;
}
@@ -1046,29 +1113,37 @@ min_ii(VALUE i, VALUE *memo, int argc, VALUE *argv)
*/
static VALUE
-enum_min(VALUE obj)
+enum_min(obj)
+ VALUE obj;
{
- VALUE result[2];
+ VALUE result = Qundef;
- result[0] = Qundef;
- if (rb_block_given_p()) {
- result[1] = rb_ary_new3(2, Qnil, Qnil);
- rb_block_call(obj, id_each, 0, 0, min_ii, (VALUE)result);
- }
- else {
- rb_block_call(obj, id_each, 0, 0, min_i, (VALUE)result);
- }
- if (result[0] == Qundef) return Qnil;
- return result[0];
+ rb_iterate(rb_each, obj, rb_block_given_p() ? min_ii : min_i, (VALUE)&result);
+ if (result == Qundef) return Qnil;
+ return result;
}
+/*
+ * call-seq:
+ * enum.max => obj
+ * enum.max {| a,b | block } => obj
+ *
+ * Returns the object in <i>enum</i> with the maximum value. The
+ * first form assumes all objects implement <code>Comparable</code>;
+ * the second uses the block to return <em>a <=> b</em>.
+ *
+ * a = %w(albatross dog horse)
+ * a.max #=> "horse"
+ * a.max {|a,b| a.length <=> b.length } #=> "albatross"
+ */
+
static VALUE
-max_i(VALUE i, VALUE *memo, int argc, VALUE *argv)
+max_i(i, memo)
+ VALUE i;
+ VALUE *memo;
{
VALUE cmp;
- ENUM_WANT_SVALUE();
-
if (*memo == Qundef) {
*memo = i;
}
@@ -1082,20 +1157,17 @@ max_i(VALUE i, VALUE *memo, int argc, VALUE *argv)
}
static VALUE
-max_ii(VALUE i, VALUE *memo, int argc, VALUE *argv)
+max_ii(i, memo)
+ VALUE i;
+ VALUE *memo;
{
VALUE cmp;
- ENUM_WANT_SVALUE();
-
if (*memo == Qundef) {
*memo = i;
}
else {
- VALUE ary = memo[1];
- RARRAY_PTR(ary)[0] = i;
- RARRAY_PTR(ary)[1] = *memo;
- cmp = rb_yield(ary);
+ cmp = rb_yield_values(2, i, *memo);
if (rb_cmpint(cmp, i, *memo) > 0) {
*memo = i;
}
@@ -1118,29 +1190,23 @@ max_ii(VALUE i, VALUE *memo, int argc, VALUE *argv)
*/
static VALUE
-enum_max(VALUE obj)
+enum_max(obj)
+ VALUE obj;
{
- VALUE result[2];
+ VALUE result = Qundef;
- result[0] = Qundef;
- if (rb_block_given_p()) {
- result[1] = rb_ary_new3(2, Qnil, Qnil);
- rb_block_call(obj, id_each, 0, 0, max_ii, (VALUE)result);
- }
- else {
- rb_block_call(obj, id_each, 0, 0, max_i, (VALUE)result);
- }
- if (result[0] == Qundef) return Qnil;
- return result[0];
+ rb_iterate(rb_each, obj, rb_block_given_p() ? max_ii : max_i, (VALUE)&result);
+ if (result == Qundef) return Qnil;
+ return result;
}
static VALUE
-minmax_i(VALUE i, VALUE *memo, int argc, VALUE *argv)
+minmax_i(i, memo)
+ VALUE i;
+ VALUE *memo;
{
int n;
- ENUM_WANT_SVALUE();
-
if (memo[0] == Qundef) {
memo[0] = i;
memo[1] = i;
@@ -1159,12 +1225,12 @@ minmax_i(VALUE i, VALUE *memo, int argc, VALUE *argv)
}
static VALUE
-minmax_ii(VALUE i, VALUE *memo, int argc, VALUE *argv)
+minmax_ii(i, memo)
+ VALUE i;
+ VALUE *memo;
{
int n;
- ENUM_WANT_SVALUE();
-
if (memo[0] == Qundef) {
memo[0] = i;
memo[1] = i;
@@ -1172,14 +1238,14 @@ minmax_ii(VALUE i, VALUE *memo, int argc, VALUE *argv)
else {
VALUE ary = memo[2];
- RARRAY_PTR(ary)[0] = i;
- RARRAY_PTR(ary)[1] = memo[0];
+ RARRAY(ary)->ptr[0] = i;
+ RARRAY(ary)->ptr[1] = memo[0];
n = rb_cmpint(rb_yield(ary), i, memo[0]);
if (n < 0) {
memo[0] = i;
}
- RARRAY_PTR(ary)[0] = i;
- RARRAY_PTR(ary)[1] = memo[1];
+ RARRAY(ary)->ptr[0] = i;
+ RARRAY(ary)->ptr[1] = memo[1];
n = rb_cmpint(rb_yield(ary), i, memo[1]);
if (n > 0) {
memo[1] = i;
@@ -1204,7 +1270,8 @@ minmax_ii(VALUE i, VALUE *memo, int argc, VALUE *argv)
*/
static VALUE
-enum_minmax(VALUE obj)
+enum_minmax(obj)
+ VALUE obj;
{
VALUE result[3];
VALUE ary = rb_ary_new3(2, Qnil, Qnil);
@@ -1218,19 +1285,19 @@ enum_minmax(VALUE obj)
rb_block_call(obj, id_each, 0, 0, minmax_i, (VALUE)result);
}
if (result[0] != Qundef) {
- RARRAY_PTR(ary)[0] = result[0];
- RARRAY_PTR(ary)[1] = result[1];
+ RARRAY(ary)->ptr[0] = result[0];
+ RARRAY(ary)->ptr[1] = result[1];
}
return ary;
}
static VALUE
-min_by_i(VALUE i, VALUE *memo, int argc, VALUE *argv)
+min_by_i(i, memo)
+ VALUE i;
+ VALUE *memo;
{
VALUE v;
- ENUM_WANT_SVALUE();
-
v = rb_yield(i);
if (memo[0] == Qundef) {
memo[0] = v;
@@ -1255,7 +1322,8 @@ min_by_i(VALUE i, VALUE *memo, int argc, VALUE *argv)
*/
static VALUE
-enum_min_by(VALUE obj)
+enum_min_by(obj)
+ VALUE obj;
{
VALUE memo[2];
@@ -1268,12 +1336,12 @@ enum_min_by(VALUE obj)
}
static VALUE
-max_by_i(VALUE i, VALUE *memo, int argc, VALUE *argv)
+max_by_i(i, memo)
+ VALUE i;
+ VALUE *memo;
{
VALUE v;
- ENUM_WANT_SVALUE();
-
v = rb_yield(i);
if (memo[0] == Qundef) {
memo[0] = v;
@@ -1298,7 +1366,8 @@ max_by_i(VALUE i, VALUE *memo, int argc, VALUE *argv)
*/
static VALUE
-enum_max_by(VALUE obj)
+enum_max_by(obj)
+ VALUE obj;
{
VALUE memo[2];
@@ -1311,12 +1380,12 @@ enum_max_by(VALUE obj)
}
static VALUE
-minmax_by_i(VALUE i, VALUE *memo, int argc, VALUE *argv)
+minmax_by_i(i, memo)
+ VALUE i;
+ VALUE *memo;
{
VALUE v;
- ENUM_WANT_SVALUE();
-
v = rb_yield(i);
if (memo[0] == Qundef) {
memo[0] = v;
@@ -1350,7 +1419,8 @@ minmax_by_i(VALUE i, VALUE *memo, int argc, VALUE *argv)
*/
static VALUE
-enum_minmax_by(VALUE obj)
+enum_minmax_by(obj)
+ VALUE obj;
{
VALUE memo[4];
@@ -1365,9 +1435,11 @@ enum_minmax_by(VALUE obj)
}
static VALUE
-member_i(VALUE iter, VALUE *memo, int argc, VALUE *argv)
+member_i(item, memo)
+ VALUE item;
+ VALUE *memo;
{
- if (rb_equal(enum_values_pack(argc, argv), memo[0])) {
+ if (rb_equal(item, memo[0])) {
memo[1] = Qtrue;
rb_iter_break();
}
@@ -1382,63 +1454,65 @@ member_i(VALUE iter, VALUE *memo, int argc, VALUE *argv)
* Returns <code>true</code> if any member of <i>enum</i> equals
* <i>obj</i>. Equality is tested using <code>==</code>.
*
- * IO.constants.include? :SEEK_SET #=> true
- * IO.constants.include? :SEEK_NO_FURTHER #=> false
+ * IO.constants.include? "SEEK_SET" #=> true
+ * IO.constants.include? "SEEK_NO_FURTHER" #=> false
*
*/
static VALUE
-enum_member(VALUE obj, VALUE val)
+enum_member(obj, val)
+ VALUE obj, val;
{
VALUE memo[2];
memo[0] = val;
memo[1] = Qfalse;
- rb_block_call(obj, id_each, 0, 0, member_i, (VALUE)memo);
+ rb_iterate(rb_each, obj, member_i, (VALUE)memo);
return memo[1];
}
static VALUE
-each_with_index_i(VALUE i, VALUE memo, int argc, VALUE *argv)
+each_with_index_i(val, memo)
+ VALUE val;
+ VALUE *memo;
{
- long n = (*(VALUE *)memo)++;
-
- return rb_yield_values(2, enum_values_pack(argc, argv), INT2NUM(n));
+ rb_yield_values(2, val, INT2FIX(*memo));
+ ++*memo;
+ return Qnil;
}
/*
* call-seq:
* enum.each_with_index {|obj, i| block } -> enum
*
- * Calls <em>block</em> with two arguments, the item and its index,
- * for each item in <i>enum</i>. Given arguments are passed through
- * to #each().
+ * Calls <em>block</em> with two arguments, the item and its index, for
+ * each item in <i>enum</i>.
*
* hash = Hash.new
* %w(cat dog wombat).each_with_index {|item, index|
* hash[item] = index
* }
- * hash #=> {"cat"=>0, "dog"=>1, "wombat"=>2}
+ * hash #=> {"cat"=>0, "wombat"=>2, "dog"=>1}
*
*/
static VALUE
-enum_each_with_index(int argc, VALUE *argv, VALUE obj)
+enum_each_with_index(obj)
+ VALUE obj;
{
- long memo;
+ VALUE memo;
- RETURN_ENUMERATOR(obj, argc, argv);
+ RETURN_ENUMERATOR(obj, 0, 0);
memo = 0;
- rb_block_call(obj, id_each, argc, argv, each_with_index_i, (VALUE)&memo);
+ rb_iterate(rb_each, obj, each_with_index_i, (VALUE)&memo);
return obj;
}
-
/*
* call-seq:
- * enum.reverse_each {|item| block }
- *
+ * enum.reverse_each {|item| block }
+ *
* Traverses <i>enum</i> in reverse order.
*/
@@ -1461,74 +1535,22 @@ enum_reverse_each(int argc, VALUE *argv, VALUE obj)
static VALUE
-zip_ary(VALUE val, NODE *memo, int argc, VALUE *argv)
-{
- volatile VALUE result = memo->u1.value;
- volatile VALUE args = memo->u2.value;
- long n = memo->u3.cnt++;
- volatile VALUE tmp;
- int i;
-
- tmp = rb_ary_new2(RARRAY_LEN(args) + 1);
- rb_ary_store(tmp, 0, enum_values_pack(argc, argv));
- for (i=0; i<RARRAY_LEN(args); i++) {
- VALUE e = RARRAY_PTR(args)[i];
-
- if (RARRAY_LEN(e) <= n) {
- rb_ary_push(tmp, Qnil);
- }
- else {
- rb_ary_push(tmp, RARRAY_PTR(e)[n]);
- }
- }
- if (NIL_P(result)) {
- rb_yield(tmp);
- }
- else {
- rb_ary_push(result, tmp);
- }
- return Qnil;
-}
-
-static VALUE
-call_next(VALUE *v)
-{
- return v[0] = rb_funcall(v[1], id_next, 0, 0);
-}
-
-static VALUE
-call_stop(VALUE *v)
-{
- return v[0] = Qundef;
-}
-
-static VALUE
-zip_i(VALUE val, NODE *memo, int argc, VALUE *argv)
+zip_i(val, memo)
+ VALUE val;
+ VALUE *memo;
{
- volatile VALUE result = memo->u1.value;
- volatile VALUE args = memo->u2.value;
- volatile VALUE tmp;
+ VALUE result = memo[0];
+ VALUE args = memo[1];
+ int idx = memo[2]++;
+ VALUE tmp;
int i;
- tmp = rb_ary_new2(RARRAY_LEN(args) + 1);
- rb_ary_store(tmp, 0, enum_values_pack(argc, argv));
- for (i=0; i<RARRAY_LEN(args); i++) {
- if (NIL_P(RARRAY_PTR(args)[i])) {
- rb_ary_push(tmp, Qnil);
- }
- else {
- VALUE v[2];
-
- v[1] = RARRAY_PTR(args)[i];
- rb_rescue2(call_next, (VALUE)v, call_stop, (VALUE)v, rb_eStopIteration, 0);
- if (v[0] == Qundef) {
- RARRAY_PTR(args)[i] = Qnil;
- v[0] = Qnil;
- }
- rb_ary_push(tmp, v[0]);
- }
+ tmp = rb_ary_new2(RARRAY(args)->len + 1);
+ rb_ary_store(tmp, 0, val);
+ for (i=0; i<RARRAY(args)->len; i++) {
+ rb_ary_push(tmp, rb_ary_entry(RARRAY(args)->ptr[i], idx));
}
- if (NIL_P(result)) {
+ if (rb_block_given_p()) {
rb_yield(tmp);
}
else {
@@ -1539,67 +1561,56 @@ zip_i(VALUE val, NODE *memo, int argc, VALUE *argv)
/*
* call-seq:
- * enum.zip(arg, ...) => enumerator
+ * enum.zip(arg, ...) => array
* enum.zip(arg, ...) {|arr| block } => nil
*
- * Takes one element from <i>enum</i> and merges corresponding
- * elements from each <i>args</i>. This generates a sequence of
- * <em>n</em>-element arrays, where <em>n</em> is one more than the
- * count of arguments. The length of the resulting sequence will be
- * <code>enum#size</code. If the size of any argument is less than
- * <code>enum#size</code>, <code>nil</code> values are supplied. If
- * a block is given, it is invoked for each output array, otherwise
- * an array of arrays is returned.
+ * Converts any arguments to arrays, then merges elements of
+ * <i>enum</i> with corresponding elements from each argument. This
+ * generates a sequence of <code>enum#size</code> <em>n</em>-element
+ * arrays, where <em>n</em> is one more that the count of arguments. If
+ * the size of any argument is less than <code>enum#size</code>,
+ * <code>nil</code> values are supplied. If a block given, it is
+ * invoked for each output array, otherwise an array of arrays is
+ * returned.
*
* a = [ 4, 5, 6 ]
* b = [ 7, 8, 9 ]
*
- * [1,2,3].zip(a, b) #=> [[1, 4, 7], [2, 5, 8], [3, 6, 9]]
- * [1,2].zip(a,b) #=> [[1, 4, 7], [2, 5, 8]]
- * a.zip([1,2],[8]) #=> [[4, 1, 8], [5, 2, nil], [6, nil, nil]]
+ * (1..3).zip(a, b) #=> [[1, 4, 7], [2, 5, 8], [3, 6, 9]]
+ * "cat\ndog".zip([1]) #=> [["cat\n", 1], ["dog", nil]]
+ * (1..3).zip #=> [[1], [2], [3]]
*
*/
static VALUE
-enum_zip(int argc, VALUE *argv, VALUE obj)
+enum_zip(argc, argv, obj)
+ int argc;
+ VALUE *argv;
+ VALUE obj;
{
int i;
- ID conv;
- NODE *memo;
- VALUE result = Qnil;
- VALUE args = rb_ary_new4(argc, argv);
- int allary = Qtrue;
+ VALUE result;
+ VALUE memo[3];
- argv = RARRAY_PTR(args);
for (i=0; i<argc; i++) {
- VALUE ary = rb_check_array_type(argv[i]);
- if (NIL_P(ary)) {
- allary = Qfalse;
- break;
- }
- argv[i] = ary;
+ argv[i] = rb_convert_type(argv[i], T_ARRAY, "Array", "to_a");
}
- if (!allary) {
- CONST_ID(conv, "to_enum");
- for (i=0; i<argc; i++) {
- argv[i] = rb_funcall(argv[i], conv, 1, ID2SYM(id_each));
- }
- }
- if (!rb_block_given_p()) {
- result = rb_ary_new();
- }
- /* use NODE_DOT2 as memo(v, v, -) */
- memo = rb_node_newnode(NODE_DOT2, result, args, 0);
- rb_block_call(obj, id_each, 0, 0, allary ? zip_ary : zip_i, (VALUE)memo);
+ result = rb_block_given_p() ? Qnil : rb_ary_new();
+ memo[0] = result;
+ memo[1] = rb_ary_new4(argc, argv);
+ memo[2] = 0;
+ rb_iterate(rb_each, obj, zip_i, (VALUE)memo);
return result;
}
static VALUE
-take_i(VALUE i, VALUE *arg, int argc, VALUE *argv)
+take_i(i, arg)
+ VALUE i;
+ VALUE *arg;
{
- rb_ary_push(arg[0], enum_values_pack(argc, argv));
- if (--arg[1] == 0) rb_iter_break();
+ if (arg[1]-- == 0) rb_iter_break();
+ rb_ary_push(arg[0], i);
return Qnil;
}
@@ -1615,7 +1626,9 @@ take_i(VALUE i, VALUE *arg, int argc, VALUE *argv)
*/
static VALUE
-enum_take(VALUE obj, VALUE n)
+enum_take(obj, n)
+ VALUE obj;
+ VALUE n;
{
VALUE args[2];
long len = NUM2LONG(n);
@@ -1624,19 +1637,20 @@ enum_take(VALUE obj, VALUE n)
rb_raise(rb_eArgError, "attempt to take negative size");
}
- if (len == 0) return rb_ary_new2(0);
- args[0] = rb_ary_new();
args[1] = len;
+ args[0] = rb_ary_new();
rb_block_call(obj, id_each, 0, 0, take_i, (VALUE)args);
return args[0];
}
static VALUE
-take_while_i(VALUE i, VALUE *ary, int argc, VALUE *argv)
+take_while_i(i, ary)
+ VALUE i;
+ VALUE *ary;
{
- if (!RTEST(enum_yield(argc, argv))) rb_iter_break();
- rb_ary_push(*ary, enum_values_pack(argc, argv));
+ if (!RTEST(rb_yield(i))) rb_iter_break();
+ rb_ary_push(*ary, i);
return Qnil;
}
@@ -1653,7 +1667,8 @@ take_while_i(VALUE i, VALUE *ary, int argc, VALUE *argv)
*/
static VALUE
-enum_take_while(VALUE obj)
+enum_take_while(obj)
+ VALUE obj;
{
VALUE ary;
@@ -1664,10 +1679,12 @@ enum_take_while(VALUE obj)
}
static VALUE
-drop_i(VALUE i, VALUE *arg, int argc, VALUE *argv)
+drop_i(i, arg)
+ VALUE i;
+ VALUE *arg;
{
if (arg[1] == 0) {
- rb_ary_push(arg[0], enum_values_pack(argc, argv));
+ rb_ary_push(arg[0], i);
}
else {
arg[1]--;
@@ -1688,7 +1705,9 @@ drop_i(VALUE i, VALUE *arg, int argc, VALUE *argv)
*/
static VALUE
-enum_drop(VALUE obj, VALUE n)
+enum_drop(obj, n)
+ VALUE obj;
+ VALUE n;
{
VALUE args[2];
long len = NUM2LONG(n);
@@ -1705,10 +1724,10 @@ enum_drop(VALUE obj, VALUE n)
static VALUE
-drop_while_i(VALUE i, VALUE *args, int argc, VALUE *argv)
+drop_while_i(i, args)
+ VALUE i;
+ VALUE *args;
{
- ENUM_WANT_SVALUE();
-
if (!args[1] && !RTEST(rb_yield(i))) {
args[1] = Qtrue;
}
@@ -1732,7 +1751,8 @@ drop_while_i(VALUE i, VALUE *args, int argc, VALUE *argv)
*/
static VALUE
-enum_drop_while(VALUE obj)
+enum_drop_while(obj)
+ VALUE obj;
{
VALUE args[2];
@@ -1744,10 +1764,10 @@ enum_drop_while(VALUE obj)
}
static VALUE
-cycle_i(VALUE i, VALUE ary, int argc, VALUE *argv)
+cycle_i(i, ary)
+ VALUE i;
+ VALUE ary;
{
- ENUM_WANT_SVALUE();
-
rb_ary_push(ary, i);
rb_yield(i);
return Qnil;
@@ -1773,7 +1793,10 @@ cycle_i(VALUE i, VALUE ary, int argc, VALUE *argv)
*/
static VALUE
-enum_cycle(int argc, VALUE *argv, VALUE obj)
+enum_cycle(argc, argv, obj)
+ int argc;
+ VALUE *argv;
+ VALUE obj;
{
VALUE ary;
VALUE nv = Qnil;
@@ -1792,36 +1815,17 @@ enum_cycle(int argc, VALUE *argv, VALUE obj)
ary = rb_ary_new();
RBASIC(ary)->klass = 0;
rb_block_call(obj, id_each, 0, 0, cycle_i, ary);
- len = RARRAY_LEN(ary);
+ len = RARRAY(ary)->len;
if (len == 0) return Qnil;
while (n < 0 || 0 < --n) {
for (i=0; i<len; i++) {
- rb_yield(RARRAY_PTR(ary)[i]);
+ rb_yield(RARRAY(ary)->ptr[i]);
}
}
return Qnil; /* not reached */
}
/*
- * call-seq:
- * enum.join(sep=$,) -> str
- *
- * Returns a string created by converting each element of the
- * <i>enum</i> to a string, separated by <i>sep</i>.
- */
-
-static VALUE
-enum_join(int argc, VALUE *argv, VALUE obj)
-{
- VALUE sep;
-
- rb_scan_args(argc, argv, "01", &sep);
- if (NIL_P(sep)) sep = rb_output_fs;
-
- return rb_ary_join(enum_to_a(0, 0, obj), sep);
-}
-
-/*
* 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
@@ -1833,11 +1837,8 @@ enum_join(int argc, VALUE *argv, VALUE obj)
*/
void
-Init_Enumerable(void)
+Init_Enumerable()
{
-#undef rb_intern
-#define rb_intern(str) rb_intern_const(str)
-
rb_mEnumerable = rb_define_module("Enumerable");
rb_define_method(rb_mEnumerable, "to_a", enum_to_a, -1);
@@ -1872,7 +1873,8 @@ Init_Enumerable(void)
rb_define_method(rb_mEnumerable, "minmax_by", enum_minmax_by, 0);
rb_define_method(rb_mEnumerable, "member?", enum_member, 1);
rb_define_method(rb_mEnumerable, "include?", enum_member, 1);
- rb_define_method(rb_mEnumerable, "each_with_index", enum_each_with_index, -1);
+ rb_define_method(rb_mEnumerable, "each_with_index", enum_each_with_index, 0);
+ rb_define_method(rb_mEnumerable, "enum_with_index", enum_each_with_index, 0);
rb_define_method(rb_mEnumerable, "reverse_each", enum_reverse_each, -1);
rb_define_method(rb_mEnumerable, "zip", enum_zip, -1);
rb_define_method(rb_mEnumerable, "take", enum_take, 1);
@@ -1880,12 +1882,10 @@ 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, "join", enum_join, -1);
id_eqq = rb_intern("===");
id_each = rb_intern("each");
id_cmp = rb_intern("<=>");
- id_next = rb_intern("next");
id_size = rb_intern("size");
}
diff --git a/enumerator.c b/enumerator.c
index 355a8f3948..f95d931b62 100644
--- a/enumerator.c
+++ b/enumerator.c
@@ -12,16 +12,15 @@
************************************************/
-#include "ruby/ruby.h"
+#include "ruby.h"
/*
- * Document-class: Enumerator
+ * Document-class: Enumerable::Enumerator
*
* A class which provides a method `each' to be used as an Enumerable
* object.
*/
VALUE rb_cEnumerator;
-static ID id_rewind, id_each;
static VALUE sym_each;
VALUE rb_eStopIteration;
@@ -29,48 +28,32 @@ VALUE rb_eStopIteration;
struct enumerator {
VALUE obj;
ID meth;
- VALUE args;
- VALUE fib;
- VALUE dst;
- VALUE no_next;
-};
-
-static VALUE rb_cGenerator, rb_cYielder;
-
-struct generator {
- VALUE proc;
-};
-
-struct yielder {
VALUE proc;
+ VALUE args;
+ rb_block_call_func *iter;
};
-static VALUE generator_allocate(VALUE klass);
-static VALUE generator_init(VALUE obj, VALUE proc);
-
-/*
- * Enumerator
- */
+static void enumerator_mark _((void *));
static void
-enumerator_mark(void *p)
+enumerator_mark(p)
+ void *p;
{
struct enumerator *ptr = p;
rb_gc_mark(ptr->obj);
rb_gc_mark(ptr->args);
- rb_gc_mark(ptr->fib);
- rb_gc_mark(ptr->dst);
}
static struct enumerator *
-enumerator_ptr(VALUE obj)
+enumerator_ptr(obj)
+ VALUE obj;
{
struct enumerator *ptr;
Data_Get_Struct(obj, struct enumerator, ptr);
if (RDATA(obj)->dmark != enumerator_mark) {
rb_raise(rb_eTypeError,
- "wrong argument type %s (expected %s)",
- rb_obj_classname(obj), rb_class2name(rb_cEnumerator));
+ "wrong argument type %s (expected Enumerable::Enumerator)",
+ rb_obj_classname(obj));
}
if (!ptr || ptr->obj == Qundef) {
rb_raise(rb_eArgError, "uninitialized enumerator");
@@ -83,7 +66,7 @@ enumerator_ptr(VALUE obj)
* obj.to_enum(method = :each, *args)
* obj.enum_for(method = :each, *args)
*
- * Returns Enumerator.new(self, method, *args).
+ * Returns Enumerable::Enumerator.new(self, method, *args).
*
* e.g.:
*
@@ -98,7 +81,10 @@ enumerator_ptr(VALUE obj)
*
*/
static VALUE
-obj_to_enum(int argc, VALUE *argv, VALUE obj)
+obj_to_enum(argc, argv, obj)
+ int argc;
+ VALUE *argv;
+ VALUE obj;
{
VALUE meth = sym_each;
@@ -110,7 +96,9 @@ obj_to_enum(int argc, VALUE *argv, VALUE obj)
}
static VALUE
-each_slice_i(VALUE val, VALUE *memo)
+each_slice_i(val, memo)
+ VALUE val;
+ VALUE *memo;
{
VALUE ary = memo[0];
VALUE v = Qnil;
@@ -144,7 +132,8 @@ each_slice_i(VALUE val, VALUE *memo)
*
*/
static VALUE
-enum_each_slice(VALUE obj, VALUE n)
+enum_each_slice(obj, n)
+ VALUE obj, n;
{
long size = NUM2LONG(n);
VALUE args[2], ary;
@@ -154,7 +143,7 @@ enum_each_slice(VALUE obj, VALUE n)
args[0] = rb_ary_new2(size);
args[1] = (VALUE)size;
- rb_block_call(obj, id_each, 0, 0, each_slice_i, (VALUE)args);
+ rb_block_call(obj, SYM2ID(sym_each), 0, 0, each_slice_i, (VALUE)args);
ary = args[0];
if (RARRAY_LEN(ary) > 0) rb_yield(ary);
@@ -163,7 +152,9 @@ enum_each_slice(VALUE obj, VALUE n)
}
static VALUE
-each_cons_i(VALUE val, VALUE *memo)
+each_cons_i(val, memo)
+ VALUE val;
+ VALUE *memo;
{
VALUE ary = memo[0];
VALUE v = Qnil;
@@ -185,7 +176,7 @@ each_cons_i(VALUE val, VALUE *memo)
* each_cons(n)
*
* Iterates the given block for each array of consecutive <n>
- * elements. If no block is given, returns an enumerator.
+ * elements. If no block is given, returns an enumerator.a
*
* e.g.:
* (1..10).each_cons(3) {|a| p a}
@@ -201,7 +192,8 @@ each_cons_i(VALUE val, VALUE *memo)
*
*/
static VALUE
-enum_each_cons(VALUE obj, VALUE n)
+enum_each_cons(obj, n)
+ VALUE obj, n;
{
long size = NUM2LONG(n);
VALUE args[2];
@@ -211,62 +203,42 @@ enum_each_cons(VALUE obj, VALUE n)
args[0] = rb_ary_new2(size);
args[1] = (VALUE)size;
- rb_block_call(obj, id_each, 0, 0, each_cons_i, (VALUE)args);
+ rb_block_call(obj, SYM2ID(sym_each), 0, 0, each_cons_i, (VALUE)args);
return Qnil;
}
+static VALUE enumerator_allocate _((VALUE));
static VALUE
-each_with_object_i(VALUE val, VALUE memo)
-{
- return rb_yield_values(2, val, memo);
-}
-
-/*
- * call-seq:
- * each_with_object(obj) {|(*args), memo_obj| ... }
- * each_with_object(obj)
- *
- * Iterates the given block for each element with an arbitrary
- * object given, and returns the initially given object.
- *
- * If no block is given, returns an enumerator.
- *
- * e.g.:
- * evens = (1..10).each_with_object([]) {|i, a| a << i*2 }
- * # => [2, 4, 6, 8, 10, 12, 14, 16, 18, 20]
- *
- */
-static VALUE
-enum_each_with_object(VALUE obj, VALUE memo)
-{
- RETURN_ENUMERATOR(obj, 1, &memo);
-
- rb_block_call(obj, id_each, 0, 0, each_with_object_i, memo);
-
- return memo;
-}
-
-static VALUE
-enumerator_allocate(VALUE klass)
+enumerator_allocate(klass)
+ VALUE klass;
{
struct enumerator *ptr;
VALUE enum_obj;
- enum_obj = Data_Make_Struct(klass, struct enumerator, enumerator_mark, -1, ptr);
+ enum_obj = Data_Make_Struct(klass, struct enumerator,
+ enumerator_mark, -1, ptr);
ptr->obj = Qundef;
return enum_obj;
}
+static VALUE enumerator_each_i _((VALUE, VALUE));
static VALUE
-enumerator_each_i(VALUE v, VALUE enum_obj, int argc, VALUE *argv)
+enumerator_each_i(v, enum_obj)
+ VALUE v;
+ VALUE enum_obj;
{
- return rb_yield_values2(argc, argv);
+ return rb_yield(v);
}
static VALUE
-enumerator_init(VALUE enum_obj, VALUE obj, VALUE meth, int argc, VALUE *argv)
+enumerator_init(enum_obj, obj, meth, argc, argv)
+ VALUE enum_obj;
+ VALUE obj;
+ VALUE meth;
+ int argc;
+ VALUE *argv;
{
struct enumerator *ptr;
@@ -278,78 +250,49 @@ enumerator_init(VALUE enum_obj, VALUE obj, VALUE meth, int argc, VALUE *argv)
ptr->obj = obj;
ptr->meth = rb_to_id(meth);
+ ptr->iter = enumerator_each_i;
if (argc) ptr->args = rb_ary_new4(argc, argv);
- ptr->fib = 0;
- ptr->dst = Qnil;
- ptr->no_next = Qfalse;
return enum_obj;
}
/*
* call-seq:
- * Enumerator.new(obj, method = :each, *args)
- * Enumerator.new { |y| ... }
+ * Enumerable::Enumerator.new(obj, method = :each, *args)
*
- * Creates a new Enumerator object, which is to be used as an
- * Enumerable object iterating in a given way.
+ * Creates a new Enumerable::Enumerator object, which is to be
+ * used as an Enumerable object using the given object's given
+ * method with the given arguments.
*
- * In the first 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 Kernel#enum_for(), alias
- * 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
- *
- * In the second 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, alias +<<+.
- *
- * fib = Enumerator.new { |y|
- * a = b = 1
- * loop {
- * y << a
- * a, b = b, a + b
- * }
- * }
- *
- * p fib.take(10) #=> [1, 1, 2, 3, 5, 8, 13, 21, 34, 55]
+ * Use of this method is discouraged. Use Kernel#enum_for() instead.
*/
static VALUE
-enumerator_initialize(int argc, VALUE *argv, VALUE obj)
+enumerator_initialize(argc, argv, obj)
+ int argc;
+ VALUE *argv;
+ VALUE obj;
{
VALUE recv, meth = sym_each;
- if (argc == 0) {
- if (!rb_block_given_p())
- rb_raise(rb_eArgError, "wrong number of argument (0 for 1+)");
-
- recv = generator_init(generator_allocate(rb_cGenerator), rb_block_proc());
- } else {
- recv = *argv++;
- if (--argc) {
- meth = *argv++;
- --argc;
- }
+ if (argc == 0)
+ rb_raise(rb_eArgError, "wrong number of argument (0 for 1)");
+ recv = *argv++;
+ if (--argc) {
+ meth = *argv++;
+ --argc;
}
-
return enumerator_init(obj, recv, meth, argc, argv);
}
/* :nodoc: */
static VALUE
-enumerator_init_copy(VALUE obj, VALUE orig)
+enumerator_init_copy(obj, orig)
+ VALUE obj;
+ VALUE orig;
{
struct enumerator *ptr0, *ptr1;
ptr0 = enumerator_ptr(orig);
- if (ptr0->fib) {
- /* Fibers cannot be copied */
- rb_raise(rb_eTypeError, "can't copy execution context");
- }
Data_Get_Struct(obj, struct enumerator, ptr1);
@@ -359,14 +302,18 @@ enumerator_init_copy(VALUE obj, VALUE orig)
ptr1->obj = ptr0->obj;
ptr1->meth = ptr0->meth;
+ ptr1->iter = ptr0->iter;
ptr1->args = ptr0->args;
- ptr1->fib = 0;
return obj;
}
VALUE
-rb_enumeratorize(VALUE obj, VALUE meth, int argc, VALUE *argv)
+rb_enumeratorize(obj, meth, argc, argv)
+ VALUE obj;
+ VALUE meth;
+ int argc;
+ VALUE *argv;
{
return enumerator_init(enumerator_allocate(rb_cEnumerator), obj, meth, argc, argv);
}
@@ -380,7 +327,8 @@ rb_enumeratorize(VALUE obj, VALUE meth, int argc, VALUE *argv)
*
*/
static VALUE
-enumerator_each(VALUE obj)
+enumerator_each(obj)
+ VALUE obj;
{
struct enumerator *e;
int argc = 0;
@@ -392,133 +340,44 @@ enumerator_each(VALUE obj)
argc = RARRAY_LEN(e->args);
argv = RARRAY_PTR(e->args);
}
- return rb_block_call(e->obj, e->meth, argc, argv,
- enumerator_each_i, (VALUE)e);
+ return rb_block_call(e->obj, e->meth, argc, argv, e->iter, (VALUE)e);
}
static VALUE
-enumerator_with_index_i(VALUE val, VALUE *memo, int argc, VALUE *argv)
+enumerator_with_index_i(val, memo)
+ VALUE val;
+ VALUE *memo;
{
- VALUE idx;
-
- idx = INT2FIX(*memo);
+ val = rb_yield_values(2, val, INT2FIX(*memo));
++*memo;
-
- if (argc <= 1)
- return rb_yield_values(2, val, idx);
-
- return rb_yield_values(2, rb_ary_new4(argc, argv), idx);
-}
-
-/*
- * call-seq:
- * e.with_index(offset = 0) {|(*args), idx| ... }
- * e.with_index(offset = 0)
- *
- * Iterates the given block for each element with an index, which
- * starts from +offset+. If no block is given, returns an enumerator.
- *
- */
-static VALUE
-enumerator_with_index(int argc, VALUE *argv, VALUE obj)
-{
- struct enumerator *e;
- VALUE memo;
-
- rb_scan_args(argc, argv, "01", &memo);
- RETURN_ENUMERATOR(obj, argc, argv);
- memo = NIL_P(memo) ? 0 : (VALUE)NUM2LONG(memo);
- e = enumerator_ptr(obj);
- if (e->args) {
- argc = RARRAY_LEN(e->args);
- argv = RARRAY_PTR(e->args);
- }
- else {
- argc = 0;
- argv = NULL;
- }
- return rb_block_call(e->obj, e->meth, argc, argv,
- enumerator_with_index_i, (VALUE)&memo);
+ return val;
}
/*
* call-seq:
- * e.each_with_index {|(*args), idx| ... }
- * e.each_with_index
- *
- * Same as Enumeartor#with_index, except each_with_index does not
- * receive an offset argument.
- *
- */
-static VALUE
-enumerator_each_with_index(VALUE obj)
-{
- return enumerator_with_index(0, NULL, obj);
-}
-
-static VALUE
-enumerator_with_object_i(VALUE val, VALUE memo, int argc, VALUE *argv)
-{
- if (argc <= 1)
- return rb_yield_values(2, val, memo);
-
- return rb_yield_values(2, rb_ary_new4(argc, argv), memo);
-}
-
-/*
- * call-seq:
- * e.with_object(obj) {|(*args), memo_obj| ... }
- * e.with_object(obj)
- *
- * Iterates the given block for each element with an arbitrary
- * object given, and returns the initially given object.
+ * e.with_index {|(*args), idx| ... }
+ * e.with_index
*
- * If no block is given, returns an enumerator.
+ * Iterates the given block for each elements with an index, which
+ * start from 0. If no block is given, returns an enumerator.
*
*/
static VALUE
-enumerator_with_object(VALUE obj, VALUE memo)
+enumerator_with_index(obj)
+ VALUE obj;
{
- struct enumerator *e;
+ struct enumerator *e = enumerator_ptr(obj);
+ VALUE memo = 0;
int argc = 0;
VALUE *argv = 0;
- RETURN_ENUMERATOR(obj, 1, &memo);
- e = enumerator_ptr(obj);
+ RETURN_ENUMERATOR(obj, 0, 0);
if (e->args) {
argc = RARRAY_LEN(e->args);
argv = RARRAY_PTR(e->args);
}
- rb_block_call(e->obj, e->meth, argc, argv,
- enumerator_with_object_i, memo);
-
- return memo;
-}
-
-static VALUE
-next_ii(VALUE i, VALUE obj, int argc, VALUE *argv)
-{
- rb_fiber_yield(argc, argv);
- return Qnil;
-}
-
-static VALUE
-next_i(VALUE curr, VALUE obj)
-{
- struct enumerator *e = enumerator_ptr(obj);
- VALUE nil = Qnil;
-
- rb_block_call(obj, id_each, 0, 0, next_ii, obj);
- e->no_next = Qtrue;
- return rb_fiber_yield(1, &nil);
-}
-
-static void
-next_init(VALUE obj, struct enumerator *e)
-{
- VALUE curr = rb_fiber_current();
- e->dst = curr;
- e->fib = rb_fiber_new(next_i, obj);
+ return rb_block_call(e->obj, e->meth, argc, argv,
+ enumerator_with_index_i, (VALUE)&memo);
}
/*
@@ -527,33 +386,22 @@ next_init(VALUE obj, struct enumerator *e)
*
* Returns the next object in the enumerator, and move the internal
* position forward. When the position reached at the end, internal
- * position is rewound then StopIteration is raised.
+ * position is rewinded then StopIteration is raised.
*
* Note that enumeration sequence by next method does not affect other
* non-external enumeration methods, unless underlying iteration
* methods itself has side-effect, e.g. IO#each_line.
*
+ * Caution: Calling this method causes the "generator" library to be
+ * loaded.
*/
static VALUE
-enumerator_next(VALUE obj)
+enumerator_next(obj)
+ VALUE obj;
{
- struct enumerator *e = enumerator_ptr(obj);
- VALUE curr, v;
- curr = rb_fiber_current();
-
- if (!e->fib || !rb_fiber_alive_p(e->fib)) {
- next_init(obj, e);
- }
-
- v = rb_fiber_resume(e->fib, 1, &curr);
- if (e->no_next) {
- e->fib = 0;
- e->dst = Qnil;
- e->no_next = Qfalse;
- rb_raise(rb_eStopIteration, "iteration reached at end");
- }
- return v;
+ rb_require("generator");
+ return rb_funcall(obj, rb_intern("next"), 0, 0);
}
/*
@@ -561,336 +409,42 @@ enumerator_next(VALUE obj)
* e.rewind => e
*
* Rewinds the enumeration sequence by the next method.
- *
- * If the enclosed object responds to a "rewind" method, it is called.
- */
-
-static VALUE
-enumerator_rewind(VALUE obj)
-{
- struct enumerator *e = enumerator_ptr(obj);
-
- if (rb_respond_to(e->obj, id_rewind))
- rb_funcall(e->obj, id_rewind, 0);
-
- e->fib = 0;
- e->dst = Qnil;
- e->no_next = Qfalse;
- return obj;
-}
-
-static VALUE
-inspect_enumerator(VALUE obj, VALUE dummy, int recur)
-{
- struct enumerator *e = enumerator_ptr(obj);
- const char *cname = rb_obj_classname(obj);
- VALUE eobj, str;
- int tainted, untrusted;
-
- if (recur) {
- str = rb_sprintf("#<%s: ...>", cname);
- OBJ_TAINT(str);
- return str;
- }
-
- eobj = e->obj;
-
- tainted = OBJ_TAINTED(eobj);
- untrusted = OBJ_UNTRUSTED(eobj);
-
- /* (1..100).each_cons(2) => "#<Enumerator: 1..100:each_cons(2)>" */
- str = rb_sprintf("#<%s: ", cname);
- rb_str_concat(str, rb_inspect(eobj));
- rb_str_buf_cat2(str, ":");
- rb_str_buf_cat2(str, rb_id2name(e->meth));
-
- if (e->args) {
- long argc = RARRAY_LEN(e->args);
- VALUE *argv = RARRAY_PTR(e->args);
-
- rb_str_buf_cat2(str, "(");
-
- while (argc--) {
- VALUE arg = *argv++;
-
- rb_str_concat(str, rb_inspect(arg));
- rb_str_buf_cat2(str, argc > 0 ? ", " : ")");
-
- if (OBJ_TAINTED(arg)) tainted = Qtrue;
- if (OBJ_UNTRUSTED(arg)) untrusted = Qtrue;
- }
- }
-
- rb_str_buf_cat2(str, ">");
-
- if (tainted) OBJ_TAINT(str);
- if (untrusted) OBJ_UNTRUST(str);
- return str;
-}
-
-/*
- * call-seq:
- * e.inspect => string
- *
- * Create a printable version of <i>e</i>.
- */
-
-static VALUE
-enumerator_inspect(VALUE obj)
-{
- return rb_exec_recursive(inspect_enumerator, obj, 0);
-}
-
-/*
- * Yielder
- */
-static void
-yielder_mark(void *p)
-{
- struct yielder *ptr = p;
- rb_gc_mark(ptr->proc);
-}
-
-static struct yielder *
-yielder_ptr(VALUE obj)
-{
- struct yielder *ptr;
-
- Data_Get_Struct(obj, struct yielder, ptr);
- if (RDATA(obj)->dmark != yielder_mark) {
- rb_raise(rb_eTypeError,
- "wrong argument type %s (expected %s)",
- rb_obj_classname(obj), rb_class2name(rb_cYielder));
- }
- if (!ptr || ptr->proc == Qundef) {
- rb_raise(rb_eArgError, "uninitialized yielder");
- }
- return ptr;
-}
-
-/* :nodoc: */
-static VALUE
-yielder_allocate(VALUE klass)
-{
- struct yielder *ptr;
- VALUE obj;
-
- obj = Data_Make_Struct(klass, struct yielder, yielder_mark, -1, ptr);
- ptr->proc = Qundef;
-
- return obj;
-}
-
-static VALUE
-yielder_init(VALUE obj, VALUE proc)
-{
- struct yielder *ptr;
-
- Data_Get_Struct(obj, struct yielder, ptr);
-
- if (!ptr) {
- rb_raise(rb_eArgError, "unallocated yielder");
- }
-
- ptr->proc = proc;
-
- return obj;
-}
-
-/* :nodoc: */
-static VALUE
-yielder_initialize(VALUE obj)
-{
- rb_need_block();
-
- return yielder_init(obj, rb_block_proc());
-}
-
-/* :nodoc: */
-static VALUE
-yielder_yield(VALUE obj, VALUE args)
-{
- struct yielder *ptr = yielder_ptr(obj);
-
- rb_proc_call(ptr->proc, args);
-
- return obj;
-}
-
-static VALUE
-yielder_yield_i(VALUE obj, VALUE memo, int argc, VALUE *argv)
-{
- return rb_yield_values2(argc, argv);
-}
-
-static VALUE
-yielder_new(void)
-{
- return yielder_init(yielder_allocate(rb_cYielder), rb_proc_new(yielder_yield_i, 0));
-}
-
-/*
- * Generator
*/
-static void
-generator_mark(void *p)
-{
- struct generator *ptr = p;
- rb_gc_mark(ptr->proc);
-}
-static struct generator *
-generator_ptr(VALUE obj)
-{
- struct generator *ptr;
-
- Data_Get_Struct(obj, struct generator, ptr);
- if (RDATA(obj)->dmark != generator_mark) {
- rb_raise(rb_eTypeError,
- "wrong argument type %s (expected %s)",
- rb_obj_classname(obj), rb_class2name(rb_cGenerator));
- }
- if (!ptr || ptr->proc == Qundef) {
- rb_raise(rb_eArgError, "uninitialized generator");
- }
- return ptr;
-}
-
-/* :nodoc: */
static VALUE
-generator_allocate(VALUE klass)
-{
- struct generator *ptr;
+enumerator_rewind(obj)
VALUE obj;
-
- obj = Data_Make_Struct(klass, struct generator, generator_mark, -1, ptr);
- ptr->proc = Qundef;
-
- return obj;
-}
-
-static VALUE
-generator_init(VALUE obj, VALUE proc)
-{
- struct generator *ptr;
-
- Data_Get_Struct(obj, struct generator, ptr);
-
- if (!ptr) {
- rb_raise(rb_eArgError, "unallocated generator");
- }
-
- ptr->proc = proc;
-
- return obj;
-}
-
-VALUE rb_obj_is_proc(VALUE proc);
-
-/* :nodoc: */
-static VALUE
-generator_initialize(int argc, VALUE *argv, VALUE obj)
-{
- VALUE proc;
-
- if (argc == 0) {
- rb_need_block();
-
- proc = rb_block_proc();
- } else {
- rb_scan_args(argc, argv, "1", &proc);
-
- if (!rb_obj_is_proc(proc))
- rb_raise(rb_eTypeError,
- "wrong argument type %s (expected Proc)",
- rb_obj_classname(proc));
-
- if (rb_block_given_p()) {
- rb_warn("given block not used");
- }
- }
-
- return generator_init(obj, proc);
-}
-
-/* :nodoc: */
-static VALUE
-generator_init_copy(VALUE obj, VALUE orig)
-{
- struct generator *ptr0, *ptr1;
-
- ptr0 = generator_ptr(orig);
-
- Data_Get_Struct(obj, struct generator, ptr1);
-
- if (!ptr1) {
- rb_raise(rb_eArgError, "unallocated generator");
- }
-
- ptr1->proc = ptr0->proc;
-
- return obj;
-}
-
-/* :nodoc: */
-static VALUE
-generator_each(VALUE obj)
{
- struct generator *ptr = generator_ptr(obj);
- VALUE yielder;
-
- yielder = yielder_new();
-
- rb_proc_call(ptr->proc, rb_ary_new3(1, yielder));
-
- return obj;
+ rb_require("generator");
+ return rb_funcall(obj, rb_intern("rewind"), 0, 0);
}
void
-Init_Enumerator(void)
+Init_Enumerator()
{
rb_define_method(rb_mKernel, "to_enum", obj_to_enum, -1);
rb_define_method(rb_mKernel, "enum_for", obj_to_enum, -1);
rb_define_method(rb_mEnumerable, "each_slice", enum_each_slice, 1);
+ rb_define_method(rb_mEnumerable, "enum_slice", enum_each_slice, 1);
rb_define_method(rb_mEnumerable, "each_cons", enum_each_cons, 1);
- rb_define_method(rb_mEnumerable, "each_with_object", enum_each_with_object, 1);
+ rb_define_method(rb_mEnumerable, "enum_cons", enum_each_cons, 1);
- rb_cEnumerator = rb_define_class("Enumerator", rb_cObject);
+ rb_cEnumerator = rb_define_class_under(rb_mEnumerable, "Enumerator", rb_cObject);
rb_include_module(rb_cEnumerator, rb_mEnumerable);
rb_define_alloc_func(rb_cEnumerator, enumerator_allocate);
rb_define_method(rb_cEnumerator, "initialize", enumerator_initialize, -1);
rb_define_method(rb_cEnumerator, "initialize_copy", enumerator_init_copy, 1);
rb_define_method(rb_cEnumerator, "each", enumerator_each, 0);
- rb_define_method(rb_cEnumerator, "each_with_index", enumerator_each_with_index, 0);
- rb_define_method(rb_cEnumerator, "each_with_object", enumerator_with_object, 1);
- rb_define_method(rb_cEnumerator, "with_index", enumerator_with_index, -1);
- rb_define_method(rb_cEnumerator, "with_object", enumerator_with_object, 1);
+ rb_define_method(rb_cEnumerator, "each_with_index", enumerator_with_index, 0);
+ rb_define_method(rb_cEnumerator, "with_index", enumerator_with_index, 0);
rb_define_method(rb_cEnumerator, "next", enumerator_next, 0);
rb_define_method(rb_cEnumerator, "rewind", enumerator_rewind, 0);
- rb_define_method(rb_cEnumerator, "inspect", enumerator_inspect, 0);
-
- rb_eStopIteration = rb_define_class("StopIteration", rb_eIndexError);
-
- /* Generator */
- rb_cGenerator = rb_define_class_under(rb_cEnumerator, "Generator", rb_cObject);
- rb_include_module(rb_cGenerator, rb_mEnumerable);
- rb_define_alloc_func(rb_cGenerator, generator_allocate);
- rb_define_method(rb_cGenerator, "initialize", generator_initialize, -1);
- rb_define_method(rb_cGenerator, "initialize_copy", generator_init_copy, 1);
- rb_define_method(rb_cGenerator, "each", generator_each, 0);
-
- /* Yielder */
- rb_cYielder = rb_define_class_under(rb_cEnumerator, "Yielder", rb_cObject);
- 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, -2);
-
- id_rewind = rb_intern("rewind");
- id_each = rb_intern("each");
- sym_each = ID2SYM(id_each);
+
+ rb_eStopIteration = rb_define_class("StopIteration", rb_eIndexError);
+
+ sym_each = ID2SYM(rb_intern("each"));
rb_provide("enumerator.so"); /* for backward compatibility */
}
diff --git a/env.h b/env.h
new file mode 100644
index 0000000000..c50103f71e
--- /dev/null
+++ b/env.h
@@ -0,0 +1,60 @@
+/**********************************************************************
+
+ env.h -
+
+ $Author$
+ $Date$
+ created at: Mon Jul 11 11:53:03 JST 1994
+
+ Copyright (C) 1993-2003 Yukihiro Matsumoto
+
+**********************************************************************/
+
+#ifndef ENV_H
+#define ENV_H
+
+extern struct FRAME {
+ VALUE self;
+ int argc;
+ ID last_func;
+ ID orig_func;
+ VALUE last_class;
+ struct FRAME *prev;
+ struct FRAME *tmp;
+ struct RNode *node;
+ int iter;
+ int flags;
+ unsigned long uniq;
+} *ruby_frame;
+
+void rb_gc_mark_frame _((struct FRAME *));
+
+#define FRAME_DMETH 1
+#define FRAME_FUNC 2
+
+extern struct SCOPE {
+ struct RBasic super;
+ ID *local_tbl;
+ VALUE *local_vars;
+ int flags;
+} *ruby_scope;
+
+#define SCOPE_ALLOCA 0
+#define SCOPE_MALLOC 1
+#define SCOPE_NOSTACK 2
+#define SCOPE_DONT_RECYCLE 4
+#define SCOPE_CLONE 8
+
+extern int ruby_in_eval;
+
+extern VALUE ruby_class;
+
+struct RVarmap {
+ struct RBasic super;
+ ID id;
+ VALUE val;
+ struct RVarmap *next;
+};
+extern struct RVarmap *ruby_dyna_vars;
+
+#endif /* ENV_H */
diff --git a/error.c b/error.c
index aab3d66483..a991f55e57 100644
--- a/error.c
+++ b/error.c
@@ -3,18 +3,25 @@
error.c -
$Author$
+ $Date$
created at: Mon Aug 9 16:11:34 JST 1993
- Copyright (C) 1993-2007 Yukihiro Matsumoto
+ Copyright (C) 1993-2003 Yukihiro Matsumoto
**********************************************************************/
-#include "ruby/ruby.h"
-#include "ruby/st.h"
-#include "vm_core.h"
+#include "ruby.h"
+#include "env.h"
+#include "st.h"
#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
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
@@ -22,30 +29,33 @@
#define EXIT_SUCCESS 0
#endif
-extern const char ruby_description[];
+extern const char *ruby_description;
+
+int ruby_nerrs;
static int
-err_position_0(char *buf, long len, const char *file, int line)
+err_position(buf, len)
+ char *buf;
+ long len;
{
- if (!file) {
+ ruby_set_current_source();
+ if (!ruby_sourcefile) {
return 0;
}
- else if (line == 0) {
- return snprintf(buf, len, "%s: ", file);
+ else if (ruby_sourceline == 0) {
+ return snprintf(buf, len, "%s: ", ruby_sourcefile);
}
else {
- return snprintf(buf, len, "%s:%d: ", file, line);
+ return snprintf(buf, len, "%s:%d: ", ruby_sourcefile, ruby_sourceline);
}
}
-static int
-err_position(char *buf, long len)
-{
- return err_position_0(buf, len, rb_sourcefile(), rb_sourceline());
-}
-
static void
-err_snprintf(char *buf, long len, const char *fmt, va_list args)
+err_snprintf(buf, len, fmt, args)
+ char *buf;
+ long len;
+ const char *fmt;
+ va_list args;
{
long n;
@@ -55,100 +65,75 @@ err_snprintf(char *buf, long len, const char *fmt, va_list args)
}
}
+static void err_append _((const char*));
static void
-compile_snprintf(char *buf, long len, const char *file, int line, const char *fmt, va_list args)
+err_print(fmt, args)
+ const char *fmt;
+ va_list args;
{
- long n;
+ char buf[BUFSIZ];
- n = err_position_0(buf, len, file, line);
- if (len > n) {
- vsnprintf((char*)buf+n, len-n, fmt, args);
- }
+ err_snprintf(buf, BUFSIZ, fmt, args);
+ err_append(buf);
}
-static void err_append(const char*);
-
void
-rb_compile_error(const char *file, int line, const char *fmt, ...)
+#ifdef HAVE_STDARG_PROTOTYPES
+rb_compile_error(const char *fmt, ...)
+#else
+rb_compile_error(fmt, va_alist)
+ const char *fmt;
+ va_dcl
+#endif
{
va_list args;
- char buf[BUFSIZ];
- va_start(args, fmt);
- compile_snprintf(buf, BUFSIZ, file, line, fmt, args);
+ va_init_list(args, fmt);
+ err_print(fmt, args);
va_end(args);
- err_append(buf);
+ ruby_nerrs++;
}
void
+#ifdef HAVE_STDARG_PROTOTYPES
rb_compile_error_append(const char *fmt, ...)
+#else
+rb_compile_error_append(fmt, va_alist)
+ const char *fmt;
+ va_dcl
+#endif
{
va_list args;
char buf[BUFSIZ];
- va_start(args, fmt);
+ va_init_list(args, fmt);
vsnprintf(buf, BUFSIZ, fmt, args);
va_end(args);
err_append(buf);
}
static void
-compile_warn_print(const char *file, int line, const char *fmt, va_list args)
-{
- char buf[BUFSIZ];
- int len;
-
- compile_snprintf(buf, BUFSIZ, file, line, fmt, args);
- len = (int)strlen(buf);
- buf[len++] = '\n';
- rb_write_error2(buf, len);
-}
-
-void
-rb_compile_warn(const char *file, int line, const char *fmt, ...)
-{
- char buf[BUFSIZ];
+warn_print(fmt, args)
+ const char *fmt;
va_list args;
-
- if (NIL_P(ruby_verbose)) return;
-
- snprintf(buf, BUFSIZ, "warning: %s", fmt);
-
- va_start(args, fmt);
- compile_warn_print(file, line, buf, args);
- va_end(args);
-}
-
-/* rb_compile_warning() reports only in verbose mode */
-void
-rb_compile_warning(const char *file, int line, const char *fmt, ...)
-{
- char buf[BUFSIZ];
- va_list args;
-
- if (!RTEST(ruby_verbose)) return;
-
- snprintf(buf, BUFSIZ, "warning: %s", fmt);
-
- va_start(args, fmt);
- compile_warn_print(file, line, buf, args);
- va_end(args);
-}
-
-static void
-warn_print(const char *fmt, va_list args)
{
char buf[BUFSIZ];
int len;
err_snprintf(buf, BUFSIZ, fmt, args);
- len = (int)strlen(buf);
+ len = strlen(buf);
buf[len++] = '\n';
rb_write_error2(buf, len);
}
void
+#ifdef HAVE_STDARG_PROTOTYPES
rb_warn(const char *fmt, ...)
+#else
+rb_warn(fmt, va_alist)
+ const char *fmt;
+ va_dcl
+#endif
{
char buf[BUFSIZ];
va_list args;
@@ -157,14 +142,20 @@ rb_warn(const char *fmt, ...)
snprintf(buf, BUFSIZ, "warning: %s", fmt);
- va_start(args, fmt);
+ va_init_list(args, fmt);
warn_print(buf, args);
va_end(args);
}
/* rb_warning() reports only in verbose mode */
void
+#ifdef HAVE_STDARG_PROTOTYPES
rb_warning(const char *fmt, ...)
+#else
+rb_warning(fmt, va_alist)
+ const char *fmt;
+ va_dcl
+#endif
{
char buf[BUFSIZ];
va_list args;
@@ -173,7 +164,7 @@ rb_warning(const char *fmt, ...)
snprintf(buf, BUFSIZ, "warning: %s", fmt);
- va_start(args, fmt);
+ va_init_list(args, fmt);
warn_print(buf, args);
va_end(args);
}
@@ -187,7 +178,8 @@ rb_warning(const char *fmt, ...)
*/
static VALUE
-rb_warn_m(VALUE self, VALUE mesg)
+rb_warn_m(self, mesg)
+ VALUE self, mesg;
{
if (!NIL_P(ruby_verbose)) {
rb_io_write(rb_stderr, mesg);
@@ -196,58 +188,32 @@ rb_warn_m(VALUE self, VALUE mesg)
return Qnil;
}
-void rb_vm_bugreport(void);
-
-static void
-report_bug(const char *file, int line, const char *fmt, va_list args)
+void
+#ifdef HAVE_STDARG_PROTOTYPES
+rb_bug(const char *fmt, ...)
+#else
+rb_bug(fmt, va_alist)
+ const char *fmt;
+ va_dcl
+#endif
{
char buf[BUFSIZ];
+ va_list args;
FILE *out = stderr;
- int len = err_position_0(buf, BUFSIZ, file, line);
-
- if ((ssize_t)fwrite(buf, 1, len, out) == (ssize_t)len ||
- (ssize_t)fwrite(buf, 1, len, (out = stdout)) == (ssize_t)len) {
+ int len = err_position(buf, BUFSIZ);
+ if (fwrite(buf, 1, len, out) == len ||
+ fwrite(buf, 1, len, (out = stdout)) == len) {
fputs("[BUG] ", out);
+ va_init_list(args, fmt);
vfprintf(out, fmt, args);
+ va_end(args);
fprintf(out, "\n%s\n\n", ruby_description);
-
- rb_vm_bugreport();
-
- fprintf(out,
- "[NOTE]\n"
- "You may have encountered a bug in the Ruby interpreter"
- " or extension libraries.\n"
- "Bug reports are welcome.\n"
- "For details: http://www.ruby-lang.org/bugreport.html\n\n");
}
-}
-
-void
-rb_bug(const char *fmt, ...)
-{
- va_list args;
-
- va_start(args, fmt);
- report_bug(rb_sourcefile(), rb_sourceline(), fmt, args);
- va_end(args);
-
- abort();
-}
-
-void
-rb_compile_bug(const char *file, int line, const char *fmt, ...)
-{
- va_list args;
-
- va_start(args, fmt);
- report_bug(file, line, fmt, args);
- va_end(args);
-
abort();
}
-static const struct types {
+static struct types {
int type;
const char *name;
} builtin_types[] = {
@@ -265,32 +231,31 @@ static const struct types {
{T_STRUCT, "Struct"},
{T_BIGNUM, "Bignum"},
{T_FILE, "File"},
- {T_RATIONAL,"Rational"},
- {T_COMPLEX, "Complex"},
{T_TRUE, "true"},
{T_FALSE, "false"},
{T_SYMBOL, "Symbol"}, /* :symbol */
{T_DATA, "Data"}, /* internal use: wrapped C pointers */
{T_MATCH, "MatchData"}, /* data of $~ */
+ {T_VARMAP, "Varmap"}, /* internal use: dynamic variables */
+ {T_SCOPE, "Scope"}, /* internal use: variable scope */
{T_NODE, "Node"}, /* internal use: syntax tree node */
{T_UNDEF, "undef"}, /* internal use: #undef; should not happen */
+ {-1, 0}
};
void
-rb_check_type(VALUE x, int t)
+rb_check_type(x, t)
+ VALUE x;
+ int t;
{
- const struct types *type = builtin_types;
- const struct types *const typeend = builtin_types +
- sizeof(builtin_types) / sizeof(builtin_types[0]);
- int xt;
+ struct types *type = builtin_types;
if (x == Qundef) {
rb_bug("undef leaked to the Ruby space");
}
- xt = TYPE(x);
- if (xt != t || (xt == T_DATA && RTYPEDDATA_P(x))) {
- while (type < typeend) {
+ if (TYPE(x) != t) {
+ while (type->type >= 0) {
if (type->type == t) {
const char *etype;
@@ -304,7 +269,7 @@ rb_check_type(VALUE x, int t)
etype = "Symbol";
}
else if (rb_special_const_p(x)) {
- etype = RSTRING_PTR(rb_obj_as_string(x));
+ etype = RSTRING(rb_obj_as_string(x))->ptr;
}
else {
etype = rb_obj_classname(x);
@@ -314,38 +279,8 @@ rb_check_type(VALUE x, int t)
}
type++;
}
- rb_bug("unknown type 0x%x (0x%x given)", t, TYPE(x));
- }
-}
-
-int
-rb_typeddata_is_kind_of(VALUE obj, const rb_data_type_t *data_type)
-{
- if (SPECIAL_CONST_P(obj) || BUILTIN_TYPE(obj) != T_DATA ||
- !RTYPEDDATA_P(obj) || RTYPEDDATA_TYPE(obj) != data_type) {
- return 0;
- }
- return 1;
-}
-
-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 (SPECIAL_CONST_P(obj) || BUILTIN_TYPE(obj) != T_DATA) {
- Check_Type(obj, T_DATA);
- }
- if (!RTYPEDDATA_P(obj)) {
- etype = rb_obj_classname(obj);
- rb_raise(rb_eTypeError, mesg, etype, data_type->wrap_struct_name);
+ rb_bug("unknown type 0x%x", t);
}
- else if (RTYPEDDATA_TYPE(obj) != data_type) {
- etype = RTYPEDDATA_TYPE(obj)->wrap_struct_name;
- rb_raise(rb_eTypeError, mesg, etype, data_type->wrap_struct_name);
- }
- return DATA_PTR(obj);
}
/* exception classes */
@@ -361,11 +296,8 @@ VALUE rb_eRuntimeError;
VALUE rb_eTypeError;
VALUE rb_eArgError;
VALUE rb_eIndexError;
-VALUE rb_eKeyError;
VALUE rb_eRangeError;
VALUE rb_eNameError;
-VALUE rb_eEncodingError;
-VALUE rb_eEncCompatError;
VALUE rb_eNoMethodError;
VALUE rb_eSecurityError;
VALUE rb_eNotImpError;
@@ -378,24 +310,27 @@ VALUE rb_eLoadError;
VALUE rb_eSystemCallError;
VALUE rb_mErrno;
-static VALUE rb_eNOERROR;
-
-#undef rb_exc_new2
VALUE
-rb_exc_new(VALUE etype, const char *ptr, long len)
+rb_exc_new(etype, ptr, len)
+ VALUE etype;
+ const char *ptr;
+ long len;
{
return rb_funcall(etype, rb_intern("new"), 1, rb_str_new(ptr, len));
}
VALUE
-rb_exc_new2(VALUE etype, const char *s)
+rb_exc_new2(etype, s)
+ VALUE etype;
+ const char *s;
{
return rb_exc_new(etype, s, strlen(s));
}
VALUE
-rb_exc_new3(VALUE etype, VALUE str)
+rb_exc_new3(etype, str)
+ VALUE etype, str;
{
StringValue(str);
return rb_funcall(etype, rb_intern("new"), 1, str);
@@ -405,12 +340,15 @@ rb_exc_new3(VALUE etype, VALUE str)
* call-seq:
* Exception.new(msg = nil) => exception
*
- * Construct a new Exception object, optionally passing in
+ * Construct a new Exception object, optionally passing in
* a message.
*/
static VALUE
-exc_initialize(int argc, VALUE *argv, VALUE exc)
+exc_initialize(argc, argv, exc)
+ int argc;
+ VALUE *argv;
+ VALUE exc;
{
VALUE arg;
@@ -426,16 +364,19 @@ exc_initialize(int argc, VALUE *argv, VALUE exc)
*
* call-seq:
* exc.exception(string) -> an_exception or exc
- *
+ *
* With no argument, or if the argument is the same as the receiver,
* return the receiver. Otherwise, create a new
* exception object of the same class as the receiver, but with a
* message equal to <code>string.to_str</code>.
- *
+ *
*/
static VALUE
-exc_exception(int argc, VALUE *argv, VALUE self)
+exc_exception(argc, argv, self)
+ int argc;
+ VALUE *argv;
+ VALUE self;
{
VALUE exc;
@@ -456,7 +397,8 @@ exc_exception(int argc, VALUE *argv, VALUE self)
*/
static VALUE
-exc_to_s(VALUE exc)
+exc_to_s(exc)
+ VALUE exc;
{
VALUE mesg = rb_attr_get(exc, rb_intern("mesg"));
@@ -468,6 +410,7 @@ exc_to_s(VALUE exc)
/*
* call-seq:
* exception.message => string
+ * exception.to_str => string
*
* Returns the result of invoking <code>exception.to_s</code>.
* Normally this returns the exception's message or name. By
@@ -476,7 +419,8 @@ exc_to_s(VALUE exc)
*/
static VALUE
-exc_message(VALUE exc)
+exc_to_str(exc)
+ VALUE exc;
{
return rb_funcall(exc, rb_intern("to_s"), 0, 0);
}
@@ -489,13 +433,14 @@ exc_message(VALUE exc)
*/
static VALUE
-exc_inspect(VALUE exc)
+exc_inspect(exc)
+ VALUE exc;
{
VALUE str, klass;
klass = CLASS_OF(exc);
exc = rb_obj_as_string(exc);
- if (RSTRING_LEN(exc) == 0) {
+ if (RSTRING(exc)->len == 0) {
return rb_str_dup(rb_class_name(klass));
}
@@ -512,43 +457,45 @@ exc_inspect(VALUE exc)
/*
* call-seq:
* exception.backtrace => array
- *
+ *
* Returns any backtrace associated with the exception. The backtrace
* is an array of strings, each containing either ``filename:lineNo: in
* `method''' or ``filename:lineNo.''
- *
+ *
* def a
* raise "boom"
* end
- *
+ *
* def b
* a()
* end
- *
+ *
* begin
* b()
* rescue => detail
* print detail.backtrace.join("\n")
* end
- *
+ *
* <em>produces:</em>
- *
+ *
* prog.rb:2:in `a'
* prog.rb:6:in `b'
* prog.rb:10
*/
static VALUE
-exc_backtrace(VALUE exc)
+exc_backtrace(exc)
+ VALUE exc;
{
- ID bt;
+ static ID bt;
- CONST_ID(bt, "bt");
+ if (!bt) bt = rb_intern("bt");
return rb_attr_get(exc, bt);
}
VALUE
-rb_check_backtrace(VALUE bt)
+rb_check_backtrace(bt)
+ VALUE bt;
{
long i;
static const char err[] = "backtrace must be Array of String";
@@ -560,8 +507,8 @@ rb_check_backtrace(VALUE bt)
if (t != T_ARRAY) {
rb_raise(rb_eTypeError, err);
}
- for (i=0;i<RARRAY_LEN(bt);i++) {
- if (TYPE(RARRAY_PTR(bt)[i]) != T_STRING) {
+ for (i=0;i<RARRAY(bt)->len;i++) {
+ if (TYPE(RARRAY(bt)->ptr[i]) != T_STRING) {
rb_raise(rb_eTypeError, err);
}
}
@@ -572,63 +519,22 @@ rb_check_backtrace(VALUE bt)
/*
* call-seq:
* exc.set_backtrace(array) => array
- *
+ *
* Sets the backtrace information associated with <i>exc</i>. The
* argument must be an array of <code>String</code> objects in the
* format described in <code>Exception#backtrace</code>.
- *
+ *
*/
static VALUE
-exc_set_backtrace(VALUE exc, VALUE bt)
+exc_set_backtrace(exc, bt)
+ VALUE exc;
+ VALUE bt;
{
return rb_iv_set(exc, "bt", rb_check_backtrace(bt));
}
/*
- * call-seq:
- * exc == obj => true or false
- *
- * 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.
- */
-
-static VALUE
-exc_equal(VALUE exc, VALUE obj)
-{
- VALUE mesg, backtrace;
- ID id_mesg;
-
- if (exc == obj) return Qtrue;
- CONST_ID(id_mesg, "mesg");
-
- if (rb_obj_class(exc) != rb_obj_class(obj)) {
- ID id_message, id_backtrace;
- CONST_ID(id_message, "message");
- CONST_ID(id_backtrace, "backtrace");
-
- if (rb_respond_to(obj, id_message) && rb_respond_to(obj, id_backtrace)) {
- mesg = rb_funcall(obj, id_message, 0, 0);
- backtrace = rb_funcall(obj, id_backtrace, 0, 0);
- }
- else {
- return Qfalse;
- }
- }
- else {
- mesg = rb_attr_get(obj, id_mesg);
- backtrace = exc_backtrace(obj);
- }
-
- if (!rb_equal(rb_attr_get(exc, id_mesg), mesg))
- return Qfalse;
- if (!rb_equal(exc_backtrace(exc), backtrace))
- return Qfalse;
- return Qtrue;
-}
-
-/*
* call-seq:
* SystemExit.new(status=0) => system_exit
*
@@ -636,7 +542,10 @@ exc_equal(VALUE exc, VALUE obj)
*/
static VALUE
-exit_initialize(int argc, VALUE *argv, VALUE exc)
+exit_initialize(argc, argv, exc)
+ int argc;
+ VALUE *argv;
+ VALUE exc;
{
VALUE status = INT2FIX(EXIT_SUCCESS);
if (argc > 0 && FIXNUM_P(argv[0])) {
@@ -657,7 +566,8 @@ exit_initialize(int argc, VALUE *argv, VALUE exc)
*/
static VALUE
-exit_status(VALUE exc)
+exit_status(exc)
+ VALUE exc;
{
return rb_attr_get(exc, rb_intern("status"));
}
@@ -671,7 +581,8 @@ exit_status(VALUE exc)
*/
static VALUE
-exit_success_p(VALUE exc)
+exit_success_p(exc)
+ VALUE exc;
{
VALUE status = rb_attr_get(exc, rb_intern("status"));
if (NIL_P(status)) return Qtrue;
@@ -680,15 +591,24 @@ exit_success_p(VALUE exc)
}
void
+#ifdef HAVE_STDARG_PROTOTYPES
rb_name_error(ID id, const char *fmt, ...)
+#else
+rb_name_error(id, fmt, va_alist)
+ ID id;
+ const char *fmt;
+ va_dcl
+#endif
{
VALUE exc, argv[2];
va_list args;
+ char buf[BUFSIZ];
- va_start(args, fmt);
- argv[0] = rb_vsprintf(fmt, args);
+ va_init_list(args, fmt);
+ vsnprintf(buf, BUFSIZ, fmt, args);
va_end(args);
+ argv[0] = rb_str_new2(buf);
argv[1] = ID2SYM(id);
exc = rb_class_new_instance(2, argv, rb_eNameError);
rb_exc_raise(exc);
@@ -704,7 +624,10 @@ rb_name_error(ID id, const char *fmt, ...)
*/
static VALUE
-name_err_initialize(int argc, VALUE *argv, VALUE self)
+name_err_initialize(argc, argv, self)
+ int argc;
+ VALUE *argv;
+ VALUE self;
{
VALUE name;
@@ -722,7 +645,8 @@ name_err_initialize(int argc, VALUE *argv, VALUE self)
*/
static VALUE
-name_err_name(VALUE self)
+name_err_name(self)
+ VALUE self;
{
return rb_attr_get(self, rb_intern("name"));
}
@@ -731,14 +655,14 @@ name_err_name(VALUE self)
* call-seq:
* name_error.to_s => string
*
- * Produce a nicely-formatted string representing the +NameError+.
+ * Produce a nicely-formated string representing the +NameError+.
*/
static VALUE
-name_err_to_s(VALUE exc)
+name_err_to_s(exc)
+ VALUE exc;
{
- VALUE mesg = rb_attr_get(exc, rb_intern("mesg"));
- VALUE str = mesg;
+ VALUE mesg = rb_attr_get(exc, rb_intern("mesg")), str = mesg;
if (NIL_P(mesg)) return rb_class_name(CLASS_OF(exc));
StringValue(str);
@@ -760,7 +684,10 @@ name_err_to_s(VALUE exc)
*/
static VALUE
-nometh_err_initialize(int argc, VALUE *argv, VALUE self)
+nometh_err_initialize(argc, argv, self)
+ int argc;
+ VALUE *argv;
+ VALUE self;
{
VALUE args = (argc > 2) ? argv[--argc] : Qnil;
name_err_initialize(argc, argv, self);
@@ -770,14 +697,16 @@ nometh_err_initialize(int argc, VALUE *argv, VALUE self)
/* :nodoc: */
static void
-name_err_mesg_mark(VALUE *ptr)
+name_err_mesg_mark(ptr)
+ VALUE *ptr;
{
rb_gc_mark_locations(ptr, ptr+3);
}
/* :nodoc: */
static VALUE
-name_err_mesg_new(VALUE obj, VALUE mesg, VALUE recv, VALUE method)
+name_err_mesg_new(obj, mesg, recv, method)
+ VALUE obj, mesg, recv, method;
{
VALUE *ptr = ALLOC_N(VALUE, 3);
@@ -789,27 +718,8 @@ name_err_mesg_new(VALUE obj, VALUE mesg, VALUE recv, VALUE method)
/* :nodoc: */
static VALUE
-name_err_mesg_equal(VALUE obj1, VALUE obj2)
-{
- VALUE *ptr1, *ptr2;
- int i;
-
- if (obj1 == obj2) return Qtrue;
- if (rb_obj_class(obj2) != rb_cNameErrorMesg)
- return Qfalse;
-
- Data_Get_Struct(obj1, VALUE, ptr1);
- Data_Get_Struct(obj2, VALUE, ptr2);
- for (i=0; i<3; i++) {
- if (!rb_equal(ptr1[i], ptr2[i]))
- return Qfalse;
- }
- return Qtrue;
-}
-
-/* :nodoc: */
-static VALUE
-name_err_mesg_to_str(VALUE obj)
+name_err_mesg_to_str(obj)
+ VALUE obj;
{
VALUE *ptr, mesg;
Data_Get_Struct(obj, VALUE, ptr);
@@ -833,10 +743,10 @@ name_err_mesg_to_str(VALUE obj)
break;
default:
d = rb_protect(rb_inspect, obj, 0);
- if (NIL_P(d) || RSTRING_LEN(d) > 65) {
+ if (NIL_P(d) || RSTRING(d)->len > 65) {
d = rb_any_to_s(obj);
}
- desc = RSTRING_PTR(d);
+ desc = RSTRING(d)->ptr;
break;
}
if (desc && desc[0] != '#') {
@@ -855,7 +765,8 @@ name_err_mesg_to_str(VALUE obj)
/* :nodoc: */
static VALUE
-name_err_mesg_load(VALUE klass, VALUE str)
+name_err_mesg_load(klass, str)
+ VALUE klass, str;
{
return str;
}
@@ -869,20 +780,22 @@ name_err_mesg_load(VALUE klass, VALUE str)
*/
static VALUE
-nometh_err_args(VALUE self)
+nometh_err_args(self)
+ VALUE self;
{
return rb_attr_get(self, rb_intern("args"));
}
void
-rb_invalid_str(const char *str, const char *type)
+rb_invalid_str(str, type)
+ const char *str, *type;
{
VALUE s = rb_str_inspect(rb_str_new2(str));
- rb_raise(rb_eArgError, "invalid value for %s: %s", type, RSTRING_PTR(s));
+ rb_raise(rb_eArgError, "invalid value for %s: %s", type, RSTRING(s)->ptr);
}
-/*
+/*
* Document-module: Errno
*
* Ruby exception objects are subclasses of <code>Exception</code>.
@@ -892,31 +805,33 @@ rb_invalid_str(const char *str, const char *type)
* 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 <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
* <code>Errno::</code><em>error</em><code>::Errno</code>.
- *
+ *
* Errno::EACCES::Errno #=> 13
* Errno::EAGAIN::Errno #=> 11
* Errno::EINTR::Errno #=> 4
- *
+ *
* The full list of operating system errors on your particular platform
* are available as the constants of <code>Errno</code>.
*
- * Errno.constants #=> :E2BIG, :EACCES, :EADDRINUSE, :EADDRNOTAVAIL, ...
+ * Errno.constants #=> E2BIG, EACCES, EADDRINUSE, EADDRNOTAVAIL, ...
*/
static st_table *syserr_tbl;
static VALUE
-set_syserr(int n, const char *name)
+set_syserr(n, name)
+ int n;
+ const char *name;
{
VALUE error;
@@ -932,7 +847,8 @@ set_syserr(int n, const char *name)
}
static VALUE
-get_syserr(int n)
+get_syserr(n)
+ int n;
{
VALUE error;
@@ -957,9 +873,12 @@ get_syserr(int n)
*/
static VALUE
-syserr_initialize(int argc, VALUE *argv, VALUE self)
+syserr_initialize(argc, argv, self)
+ int argc;
+ VALUE *argv;
+ VALUE self;
{
-#if !defined(_WIN32)
+#if !defined(_WIN32) && !defined(__VMS)
char *strerror();
#endif
const char *err;
@@ -983,14 +902,18 @@ syserr_initialize(int argc, VALUE *argv, VALUE self)
rb_scan_args(argc, argv, "01", &mesg);
error = rb_const_get(klass, rb_intern("Errno"));
}
- if (!NIL_P(error)) err = strerror(NUM2INT(error));
+ if (!NIL_P(error)) err = strerror(NUM2LONG(error));
else err = "unknown error";
if (!NIL_P(mesg)) {
VALUE str = mesg;
+ size_t len;
StringValue(str);
- mesg = rb_sprintf("%s - %.*s", err,
- (int)RSTRING_LEN(str), RSTRING_PTR(str));
+ len = strlen(err)+RSTRING(str)->len+3;
+ mesg = rb_str_new(0, len);
+ snprintf(RSTRING(mesg)->ptr, len+1, "%s - %.*s", err,
+ (int)RSTRING(str)->len, RSTRING(str)->ptr);
+ rb_str_resize(mesg, strlen(RSTRING(mesg)->ptr));
}
else {
mesg = rb_str_new2(err);
@@ -1008,7 +931,8 @@ syserr_initialize(int argc, VALUE *argv, VALUE self)
*/
static VALUE
-syserr_errno(VALUE self)
+syserr_errno(self)
+ VALUE self;
{
return rb_attr_get(self, rb_intern("errno"));
}
@@ -1021,20 +945,20 @@ syserr_errno(VALUE self)
* if the error numbers _self_ and _other_ are the same.
*/
+
static VALUE
-syserr_eqq(VALUE self, VALUE exc)
+syserr_eqq(self, exc)
+ VALUE self, exc;
{
VALUE num, e;
- ID en;
-
- CONST_ID(en, "errno");
+ ID en = rb_intern("errno");
if (!rb_obj_is_kind_of(exc, rb_eSystemCallError)) {
if (!rb_respond_to(exc, en)) return Qfalse;
}
else if (self == rb_eSystemCallError) return Qtrue;
- num = rb_attr_get(exc, rb_intern("errno"));
+ num = rb_attr_get(exc, en);
if (NIL_P(num)) {
num = rb_funcall(exc, en, 0, 0);
}
@@ -1045,25 +969,25 @@ syserr_eqq(VALUE self, VALUE exc)
}
/*
- * Descendants of class <code>Exception</code> are used to communicate
+ * Descendents of class <code>Exception</code> are used to communicate
* between <code>raise</code> methods and <code>rescue</code>
* statements in <code>begin/end</code> blocks. <code>Exception</code>
* objects carry information about the exception---its type (the
* exception's class name), an optional descriptive string, and
- * optional traceback information. Programs may subclass
+ * optional traceback information. Programs may subclass
* <code>Exception</code> to add additional information.
*/
void
-Init_Exception(void)
+Init_Exception()
{
rb_eException = rb_define_class("Exception", rb_cObject);
rb_define_singleton_method(rb_eException, "exception", rb_class_new_instance, -1);
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, "to_str", exc_to_str, 0);
+ rb_define_method(rb_eException, "message", exc_to_str, 0);
rb_define_method(rb_eException, "inspect", exc_inspect, 0);
rb_define_method(rb_eException, "backtrace", exc_backtrace, 0);
rb_define_method(rb_eException, "set_backtrace", exc_set_backtrace, 1);
@@ -1081,21 +1005,13 @@ Init_Exception(void)
rb_eTypeError = rb_define_class("TypeError", rb_eStandardError);
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_eRangeError = rb_define_class("RangeError", rb_eStandardError);
-
- rb_eScriptError = rb_define_class("ScriptError", rb_eException);
- rb_eSyntaxError = rb_define_class("SyntaxError", rb_eScriptError);
- rb_eLoadError = rb_define_class("LoadError", rb_eScriptError);
- rb_eNotImpError = rb_define_class("NotImplementedError", rb_eScriptError);
-
rb_eNameError = rb_define_class("NameError", rb_eStandardError);
rb_define_method(rb_eNameError, "initialize", name_err_initialize, -1);
rb_define_method(rb_eNameError, "name", name_err_name, 0);
rb_define_method(rb_eNameError, "to_s", name_err_to_s, 0);
rb_cNameErrorMesg = rb_define_class_under(rb_eNameError, "message", rb_cData);
rb_define_singleton_method(rb_cNameErrorMesg, "!", name_err_mesg_new, 3);
- 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_to_str, 1);
rb_define_singleton_method(rb_cNameErrorMesg, "_load", name_err_mesg_load, 1);
@@ -1103,11 +1019,14 @@ Init_Exception(void)
rb_define_method(rb_eNoMethodError, "initialize", nometh_err_initialize, -1);
rb_define_method(rb_eNoMethodError, "args", nometh_err_args, 0);
+ rb_eScriptError = rb_define_class("ScriptError", rb_eException);
+ rb_eSyntaxError = rb_define_class("SyntaxError", rb_eScriptError);
+ rb_eLoadError = rb_define_class("LoadError", rb_eScriptError);
+ rb_eNotImpError = rb_define_class("NotImplementedError", rb_eScriptError);
+
rb_eRuntimeError = rb_define_class("RuntimeError", rb_eStandardError);
- rb_eSecurityError = rb_define_class("SecurityError", rb_eException);
+ rb_eSecurityError = rb_define_class("SecurityError", rb_eStandardError);
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);
syserr_tbl = st_init_numtable();
rb_eSystemCallError = rb_define_class("SystemCallError", rb_eStandardError);
@@ -1121,52 +1040,73 @@ Init_Exception(void)
}
void
+#ifdef HAVE_STDARG_PROTOTYPES
rb_raise(VALUE exc, const char *fmt, ...)
+#else
+rb_raise(exc, fmt, va_alist)
+ VALUE exc;
+ const char *fmt;
+ va_dcl
+#endif
{
va_list args;
- VALUE mesg;
+ char buf[BUFSIZ];
- va_start(args, fmt);
- mesg = rb_vsprintf(fmt, args);
+ va_init_list(args,fmt);
+ vsnprintf(buf, BUFSIZ, fmt, args);
va_end(args);
- rb_exc_raise(rb_exc_new3(exc, mesg));
+ rb_exc_raise(rb_exc_new2(exc, buf));
}
void
+#ifdef HAVE_STDARG_PROTOTYPES
rb_loaderror(const char *fmt, ...)
+#else
+rb_loaderror(fmt, va_alist)
+ const char *fmt;
+ va_dcl
+#endif
{
va_list args;
- VALUE mesg;
+ char buf[BUFSIZ];
- va_start(args, fmt);
- mesg = rb_vsprintf(fmt, args);
+ va_init_list(args, fmt);
+ vsnprintf(buf, BUFSIZ, fmt, args);
va_end(args);
- rb_exc_raise(rb_exc_new3(rb_eLoadError, mesg));
+ rb_exc_raise(rb_exc_new2(rb_eLoadError, buf));
}
void
-rb_notimplement(void)
+rb_notimplement()
{
rb_raise(rb_eNotImpError,
"%s() function is unimplemented on this machine",
- rb_id2name(rb_frame_this_func()));
+ rb_id2name(ruby_frame->last_func));
}
void
+#ifdef HAVE_STDARG_PROTOTYPES
rb_fatal(const char *fmt, ...)
+#else
+rb_fatal(fmt, va_alist)
+ const char *fmt;
+ va_dcl
+#endif
{
va_list args;
- VALUE mesg;
+ char buf[BUFSIZ];
- va_start(args, fmt);
- mesg = rb_vsprintf(fmt, args);
+ va_init_list(args, fmt);
+ vsnprintf(buf, BUFSIZ, fmt, args);
va_end(args);
- rb_exc_fatal(rb_exc_new3(rb_eFatal, mesg));
+ ruby_in_eval = 0;
+ rb_exc_fatal(rb_exc_new2(rb_eFatal, buf));
}
-static VALUE
-make_errno_exc(const char *mesg)
+void
+rb_sys_fail(mesg)
+ const char *mesg;
{
int n = errno;
VALUE arg;
@@ -1177,91 +1117,446 @@ make_errno_exc(const char *mesg)
}
arg = mesg ? rb_str_new2(mesg) : Qnil;
- return rb_class_new_instance(1, &arg, get_syserr(n));
-}
-
-void
-rb_sys_fail(const char *mesg)
-{
- rb_exc_raise(make_errno_exc(mesg));
-}
-
-void
-rb_mod_sys_fail(VALUE mod, const char *mesg)
-{
- VALUE exc = make_errno_exc(mesg);
- rb_extend_object(exc, mod);
- rb_exc_raise(exc);
+ rb_exc_raise(rb_class_new_instance(1, &arg, get_syserr(n)));
}
void
+#ifdef HAVE_STDARG_PROTOTYPES
rb_sys_warning(const char *fmt, ...)
+#else
+rb_sys_warning(fmt, va_alist)
+ const char *fmt;
+ va_dcl
+#endif
{
- char buf[BUFSIZ];
- va_list args;
- int errno_save;
-
- errno_save = errno;
-
- if (!RTEST(ruby_verbose)) return;
+ char buf[BUFSIZ];
+ va_list args;
+ int errno_save;
+
+ errno_save = errno;
- snprintf(buf, BUFSIZ, "warning: %s", fmt);
- snprintf(buf+strlen(buf), BUFSIZ-strlen(buf), ": %s", strerror(errno_save));
+ if (!RTEST(ruby_verbose)) return;
- va_start(args, fmt);
- warn_print(buf, args);
- va_end(args);
- errno = errno_save;
+ snprintf(buf, BUFSIZ, "warning: %s", fmt);
+ snprintf(buf+strlen(buf), BUFSIZ-strlen(buf), ": %s", strerror(errno_save));
+
+ va_init_list(args, fmt);
+ warn_print(buf, args);
+ va_end(args);
+ errno = errno_save;
}
void
-rb_load_fail(const char *path)
+rb_load_fail(path)
+ const char *path;
{
rb_loaderror("%s -- %s", strerror(errno), path);
}
void
-rb_error_frozen(const char *what)
+rb_error_frozen(what)
+ const char *what;
{
- rb_raise(rb_eRuntimeError, "can't modify frozen %s", what);
+ rb_raise(rb_eTypeError, "can't modify frozen %s", what);
}
void
-rb_check_frozen(VALUE obj)
+rb_check_frozen(obj)
+ VALUE obj;
{
if (OBJ_FROZEN(obj)) rb_error_frozen(rb_obj_classname(obj));
}
-void Init_syserr(void)
+void
+Init_syserr()
{
- rb_eNOERROR = set_syserr(0, "NOERROR");
-#include "known_errors.inc"
+#ifdef EPERM
+ set_syserr(EPERM, "EPERM");
+#endif
+#ifdef ENOENT
+ set_syserr(ENOENT, "ENOENT");
+#endif
+#ifdef ESRCH
+ set_syserr(ESRCH, "ESRCH");
+#endif
+#ifdef EINTR
+ set_syserr(EINTR, "EINTR");
+#endif
+#ifdef EIO
+ set_syserr(EIO, "EIO");
+#endif
+#ifdef ENXIO
+ set_syserr(ENXIO, "ENXIO");
+#endif
+#ifdef E2BIG
+ set_syserr(E2BIG, "E2BIG");
+#endif
+#ifdef ENOEXEC
+ set_syserr(ENOEXEC, "ENOEXEC");
+#endif
+#ifdef EBADF
+ set_syserr(EBADF, "EBADF");
+#endif
+#ifdef ECHILD
+ set_syserr(ECHILD, "ECHILD");
+#endif
+#ifdef EAGAIN
+ set_syserr(EAGAIN, "EAGAIN");
+#endif
+#ifdef ENOMEM
+ set_syserr(ENOMEM, "ENOMEM");
+#endif
+#ifdef EACCES
+ set_syserr(EACCES, "EACCES");
+#endif
+#ifdef EFAULT
+ set_syserr(EFAULT, "EFAULT");
+#endif
+#ifdef ENOTBLK
+ set_syserr(ENOTBLK, "ENOTBLK");
+#endif
+#ifdef EBUSY
+ set_syserr(EBUSY, "EBUSY");
+#endif
+#ifdef EEXIST
+ set_syserr(EEXIST, "EEXIST");
+#endif
+#ifdef EXDEV
+ set_syserr(EXDEV, "EXDEV");
+#endif
+#ifdef ENODEV
+ set_syserr(ENODEV, "ENODEV");
+#endif
+#ifdef ENOTDIR
+ set_syserr(ENOTDIR, "ENOTDIR");
+#endif
+#ifdef EISDIR
+ set_syserr(EISDIR, "EISDIR");
+#endif
+#ifdef EINVAL
+ set_syserr(EINVAL, "EINVAL");
+#endif
+#ifdef ENFILE
+ set_syserr(ENFILE, "ENFILE");
+#endif
+#ifdef EMFILE
+ set_syserr(EMFILE, "EMFILE");
+#endif
+#ifdef ENOTTY
+ set_syserr(ENOTTY, "ENOTTY");
+#endif
+#ifdef ETXTBSY
+ set_syserr(ETXTBSY, "ETXTBSY");
+#endif
+#ifdef EFBIG
+ set_syserr(EFBIG, "EFBIG");
+#endif
+#ifdef ENOSPC
+ set_syserr(ENOSPC, "ENOSPC");
+#endif
+#ifdef ESPIPE
+ set_syserr(ESPIPE, "ESPIPE");
+#endif
+#ifdef EROFS
+ set_syserr(EROFS, "EROFS");
+#endif
+#ifdef EMLINK
+ set_syserr(EMLINK, "EMLINK");
+#endif
+#ifdef EPIPE
+ set_syserr(EPIPE, "EPIPE");
+#endif
+#ifdef EDOM
+ set_syserr(EDOM, "EDOM");
+#endif
+#ifdef ERANGE
+ set_syserr(ERANGE, "ERANGE");
+#endif
+#ifdef EDEADLK
+ set_syserr(EDEADLK, "EDEADLK");
+#endif
+#ifdef ENAMETOOLONG
+ set_syserr(ENAMETOOLONG, "ENAMETOOLONG");
+#endif
+#ifdef ENOLCK
+ set_syserr(ENOLCK, "ENOLCK");
+#endif
+#ifdef ENOSYS
+ set_syserr(ENOSYS, "ENOSYS");
+#endif
+#ifdef ENOTEMPTY
+ set_syserr(ENOTEMPTY, "ENOTEMPTY");
+#endif
+#ifdef ELOOP
+ set_syserr(ELOOP, "ELOOP");
+#endif
+#ifdef EWOULDBLOCK
+ set_syserr(EWOULDBLOCK, "EWOULDBLOCK");
+#endif
+#ifdef ENOMSG
+ set_syserr(ENOMSG, "ENOMSG");
+#endif
+#ifdef EIDRM
+ set_syserr(EIDRM, "EIDRM");
+#endif
+#ifdef ECHRNG
+ set_syserr(ECHRNG, "ECHRNG");
+#endif
+#ifdef EL2NSYNC
+ set_syserr(EL2NSYNC, "EL2NSYNC");
+#endif
+#ifdef EL3HLT
+ set_syserr(EL3HLT, "EL3HLT");
+#endif
+#ifdef EL3RST
+ set_syserr(EL3RST, "EL3RST");
+#endif
+#ifdef ELNRNG
+ set_syserr(ELNRNG, "ELNRNG");
+#endif
+#ifdef EUNATCH
+ set_syserr(EUNATCH, "EUNATCH");
+#endif
+#ifdef ENOCSI
+ set_syserr(ENOCSI, "ENOCSI");
+#endif
+#ifdef EL2HLT
+ set_syserr(EL2HLT, "EL2HLT");
+#endif
+#ifdef EBADE
+ set_syserr(EBADE, "EBADE");
+#endif
+#ifdef EBADR
+ set_syserr(EBADR, "EBADR");
+#endif
+#ifdef EXFULL
+ set_syserr(EXFULL, "EXFULL");
+#endif
+#ifdef ENOANO
+ set_syserr(ENOANO, "ENOANO");
+#endif
+#ifdef EBADRQC
+ set_syserr(EBADRQC, "EBADRQC");
+#endif
+#ifdef EBADSLT
+ set_syserr(EBADSLT, "EBADSLT");
+#endif
+#ifdef EDEADLOCK
+ set_syserr(EDEADLOCK, "EDEADLOCK");
+#endif
+#ifdef EBFONT
+ set_syserr(EBFONT, "EBFONT");
+#endif
+#ifdef ENOSTR
+ set_syserr(ENOSTR, "ENOSTR");
+#endif
+#ifdef ENODATA
+ set_syserr(ENODATA, "ENODATA");
+#endif
+#ifdef ETIME
+ set_syserr(ETIME, "ETIME");
+#endif
+#ifdef ENOSR
+ set_syserr(ENOSR, "ENOSR");
+#endif
+#ifdef ENONET
+ set_syserr(ENONET, "ENONET");
+#endif
+#ifdef ENOPKG
+ set_syserr(ENOPKG, "ENOPKG");
+#endif
+#ifdef EREMOTE
+ set_syserr(EREMOTE, "EREMOTE");
+#endif
+#ifdef ENOLINK
+ set_syserr(ENOLINK, "ENOLINK");
+#endif
+#ifdef EADV
+ set_syserr(EADV, "EADV");
+#endif
+#ifdef ESRMNT
+ set_syserr(ESRMNT, "ESRMNT");
+#endif
+#ifdef ECOMM
+ set_syserr(ECOMM, "ECOMM");
+#endif
+#ifdef EPROTO
+ set_syserr(EPROTO, "EPROTO");
+#endif
+#ifdef EMULTIHOP
+ set_syserr(EMULTIHOP, "EMULTIHOP");
+#endif
+#ifdef EDOTDOT
+ set_syserr(EDOTDOT, "EDOTDOT");
+#endif
+#ifdef EBADMSG
+ set_syserr(EBADMSG, "EBADMSG");
+#endif
+#ifdef EOVERFLOW
+ set_syserr(EOVERFLOW, "EOVERFLOW");
+#endif
+#ifdef ENOTUNIQ
+ set_syserr(ENOTUNIQ, "ENOTUNIQ");
+#endif
+#ifdef EBADFD
+ set_syserr(EBADFD, "EBADFD");
+#endif
+#ifdef EREMCHG
+ set_syserr(EREMCHG, "EREMCHG");
+#endif
+#ifdef ELIBACC
+ set_syserr(ELIBACC, "ELIBACC");
+#endif
+#ifdef ELIBBAD
+ set_syserr(ELIBBAD, "ELIBBAD");
+#endif
+#ifdef ELIBSCN
+ set_syserr(ELIBSCN, "ELIBSCN");
+#endif
+#ifdef ELIBMAX
+ set_syserr(ELIBMAX, "ELIBMAX");
+#endif
+#ifdef ELIBEXEC
+ set_syserr(ELIBEXEC, "ELIBEXEC");
+#endif
+#ifdef EILSEQ
+ set_syserr(EILSEQ, "EILSEQ");
+#endif
+#ifdef ERESTART
+ set_syserr(ERESTART, "ERESTART");
+#endif
+#ifdef ESTRPIPE
+ set_syserr(ESTRPIPE, "ESTRPIPE");
+#endif
+#ifdef EUSERS
+ set_syserr(EUSERS, "EUSERS");
+#endif
+#ifdef ENOTSOCK
+ set_syserr(ENOTSOCK, "ENOTSOCK");
+#endif
+#ifdef EDESTADDRREQ
+ set_syserr(EDESTADDRREQ, "EDESTADDRREQ");
+#endif
+#ifdef EMSGSIZE
+ set_syserr(EMSGSIZE, "EMSGSIZE");
+#endif
+#ifdef EPROTOTYPE
+ set_syserr(EPROTOTYPE, "EPROTOTYPE");
+#endif
+#ifdef ENOPROTOOPT
+ set_syserr(ENOPROTOOPT, "ENOPROTOOPT");
+#endif
+#ifdef EPROTONOSUPPORT
+ set_syserr(EPROTONOSUPPORT, "EPROTONOSUPPORT");
+#endif
+#ifdef ESOCKTNOSUPPORT
+ set_syserr(ESOCKTNOSUPPORT, "ESOCKTNOSUPPORT");
+#endif
+#ifdef EOPNOTSUPP
+ set_syserr(EOPNOTSUPP, "EOPNOTSUPP");
+#endif
+#ifdef EPFNOSUPPORT
+ set_syserr(EPFNOSUPPORT, "EPFNOSUPPORT");
+#endif
+#ifdef EAFNOSUPPORT
+ set_syserr(EAFNOSUPPORT, "EAFNOSUPPORT");
+#endif
+#ifdef EADDRINUSE
+ set_syserr(EADDRINUSE, "EADDRINUSE");
+#endif
+#ifdef EADDRNOTAVAIL
+ set_syserr(EADDRNOTAVAIL, "EADDRNOTAVAIL");
+#endif
+#ifdef ENETDOWN
+ set_syserr(ENETDOWN, "ENETDOWN");
+#endif
+#ifdef ENETUNREACH
+ set_syserr(ENETUNREACH, "ENETUNREACH");
+#endif
+#ifdef ENETRESET
+ set_syserr(ENETRESET, "ENETRESET");
+#endif
+#ifdef ECONNABORTED
+ set_syserr(ECONNABORTED, "ECONNABORTED");
+#endif
+#ifdef ECONNRESET
+ set_syserr(ECONNRESET, "ECONNRESET");
+#endif
+#ifdef ENOBUFS
+ set_syserr(ENOBUFS, "ENOBUFS");
+#endif
+#ifdef EISCONN
+ set_syserr(EISCONN, "EISCONN");
+#endif
+#ifdef ENOTCONN
+ set_syserr(ENOTCONN, "ENOTCONN");
+#endif
+#ifdef ESHUTDOWN
+ set_syserr(ESHUTDOWN, "ESHUTDOWN");
+#endif
+#ifdef ETOOMANYREFS
+ set_syserr(ETOOMANYREFS, "ETOOMANYREFS");
+#endif
+#ifdef ETIMEDOUT
+ set_syserr(ETIMEDOUT, "ETIMEDOUT");
+#endif
+#ifdef ECONNREFUSED
+ set_syserr(ECONNREFUSED, "ECONNREFUSED");
+#endif
+#ifdef EHOSTDOWN
+ set_syserr(EHOSTDOWN, "EHOSTDOWN");
+#endif
+#ifdef EHOSTUNREACH
+ set_syserr(EHOSTUNREACH, "EHOSTUNREACH");
+#endif
+#ifdef EALREADY
+ set_syserr(EALREADY, "EALREADY");
+#endif
+#ifdef EINPROGRESS
+ set_syserr(EINPROGRESS, "EINPROGRESS");
+#endif
+#ifdef ESTALE
+ set_syserr(ESTALE, "ESTALE");
+#endif
+#ifdef EUCLEAN
+ set_syserr(EUCLEAN, "EUCLEAN");
+#endif
+#ifdef ENOTNAM
+ set_syserr(ENOTNAM, "ENOTNAM");
+#endif
+#ifdef ENAVAIL
+ set_syserr(ENAVAIL, "ENAVAIL");
+#endif
+#ifdef EISNAM
+ set_syserr(EISNAM, "EISNAM");
+#endif
+#ifdef EREMOTEIO
+ set_syserr(EREMOTEIO, "EREMOTEIO");
+#endif
+#ifdef EDQUOT
+ set_syserr(EDQUOT, "EDQUOT");
+#endif
}
static void
-err_append(const char *s)
+err_append(s)
+ const char *s;
{
- rb_thread_t *th = GET_THREAD();
- VALUE err = th->errinfo;
+ extern VALUE ruby_errinfo;
- if (th->mild_compile_error) {
- if (!RTEST(err)) {
- err = rb_exc_new2(rb_eSyntaxError, s);
- th->errinfo = err;
+ if (ruby_in_eval) {
+ if (NIL_P(ruby_errinfo)) {
+ ruby_errinfo = rb_exc_new2(rb_eSyntaxError, s);
}
else {
- VALUE str = rb_obj_as_string(err);
+ VALUE str = rb_obj_as_string(ruby_errinfo);
rb_str_cat2(str, "\n");
rb_str_cat2(str, s);
- th->errinfo = rb_exc_new3(rb_eSyntaxError, str);
+ ruby_errinfo = rb_exc_new3(rb_eSyntaxError, str);
}
}
else {
- if (!RTEST(err)) {
- err = rb_exc_new2(rb_eSyntaxError, "compile error");
- th->errinfo = err;
- }
rb_write_error(s);
rb_write_error("\n");
}
diff --git a/eval.c b/eval.c
index 6d6b6acd00..e9c196d71f 100644
--- a/eval.c
+++ b/eval.c
@@ -3,168 +3,1609 @@
eval.c -
$Author$
+ $Date$
created at: Thu Jun 10 14:22:17 JST 1993
- Copyright (C) 1993-2007 Yukihiro Matsumoto
+ Copyright (C) 1993-2003 Yukihiro Matsumoto
Copyright (C) 2000 Network Applied Communication Laboratory, Inc.
Copyright (C) 2000 Information-technology Promotion Agency, Japan
**********************************************************************/
-#include "eval_intern.h"
-#include "iseq.h"
-#include "gc.h"
+#include "ruby.h"
+#include "node.h"
+#include "env.h"
+#include "util.h"
+#include "rubysig.h"
-VALUE proc_invoke(VALUE, VALUE, VALUE, VALUE);
-VALUE rb_binding_new(void);
-NORETURN(void rb_raise_jump(VALUE));
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#ifndef EXIT_SUCCESS
+#define EXIT_SUCCESS 0
+#endif
+#ifndef EXIT_FAILURE
+#define EXIT_FAILURE 1
+#endif
+
+#include <stdio.h>
+
+#include "st.h"
+#include "dln.h"
+
+#ifdef __APPLE__
+#include <crt_externs.h>
+#endif
+
+/* Make alloca work the best possible way. */
+#ifdef __GNUC__
+# ifndef atarist
+# ifndef alloca
+# define alloca __builtin_alloca
+# endif
+# endif /* atarist */
+#else
+# ifdef HAVE_ALLOCA_H
+# include <alloca.h>
+# else
+# ifndef _AIX
+# ifndef alloca /* predefined by HP cc +Olibcalls */
+void *alloca ();
+# endif
+# endif /* AIX */
+# endif /* HAVE_ALLOCA_H */
+#endif /* __GNUC__ */
+
+#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
+
+#ifndef HAVE_STRING_H
+char *strrchr _((const char*,const char));
+#endif
+
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+#include <time.h>
+
+#ifdef __BEOS__
+#include <net/socket.h>
+#endif
+
+#ifdef __MACOS__
+#include "macruby_private.h"
+#endif
+
+#ifdef __VMS
+#include "vmsruby_private.h"
+#endif
+
+#ifdef USE_CONTEXT
+
+NORETURN(static void rb_jump_context(rb_jmpbuf_t, int));
+static inline void
+rb_jump_context(env, val)
+ rb_jmpbuf_t env;
+ int val;
+{
+ env->status = val;
+ setcontext(&env->context);
+ abort(); /* ensure noreturn */
+}
+/*
+ * PRE_GETCONTEXT and POST_GETCONTEXT is a magic for getcontext, gcc,
+ * IA64 register stack and SPARC register window combination problem.
+ *
+ * Assume following code sequence.
+ *
+ * 1. set a register in the register stack/window such as r32/l0.
+ * 2. call getcontext.
+ * 3. use the register.
+ * 4. update the register for other use.
+ * 5. call setcontext indirectly (or directly).
+ *
+ * This code should be run as 1->2->3->4->5->3->4.
+ * But after second getcontext return (second 3),
+ * the register is broken (updated).
+ * It's because getcontext/setcontext doesn't preserve the content of the
+ * register stack/window.
+ *
+ * setjmp also doesn't preserve the content of the register stack/window.
+ * But it has not the problem because gcc knows setjmp may return twice.
+ * gcc detects setjmp and generates setjmp safe code.
+ *
+ * So setjmp calls before and after the getcontext call makes the code
+ * somewhat safe.
+ * It fix the problem on IA64.
+ * It is not required that setjmp is called at run time, since the problem is
+ * register usage.
+ *
+ * Since the magic setjmp is not enough for SPARC,
+ * inline asm is used to prohibit registers in register windows.
+ *
+ * Since the problem is fixed at gcc 4.0.3, the magic is applied only for
+ * prior versions of gcc.
+ * http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21957
+ * http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22127
+ */
+# define GCC_VERSION_BEFORE(major, minor, patchlevel) \
+ (defined(__GNUC__) && !defined(__INTEL_COMPILER) && \
+ ((__GNUC__ < (major)) || \
+ (__GNUC__ == (major) && __GNUC_MINOR__ < (minor)) || \
+ (__GNUC__ == (major) && __GNUC_MINOR__ == (minor) && __GNUC_PATCHLEVEL__ < (patchlevel))))
+# if GCC_VERSION_BEFORE(4,0,3) && (defined(sparc) || defined(__sparc__))
+# ifdef __pic__
+/*
+ * %l7 is excluded for PIC because it is PIC register.
+ * http://lists.freebsd.org/pipermail/freebsd-sparc64/2006-January/003739.html
+ */
+# define PRE_GETCONTEXT \
+ ({ __asm__ volatile ("" : : : \
+ "%o0", "%o1", "%o2", "%o3", "%o4", "%o5", "%o7", \
+ "%l0", "%l1", "%l2", "%l3", "%l4", "%l5", "%l6", \
+ "%i0", "%i1", "%i2", "%i3", "%i4", "%i5", "%i7"); })
+# else
+# define PRE_GETCONTEXT \
+ ({ __asm__ volatile ("" : : : \
+ "%o0", "%o1", "%o2", "%o3", "%o4", "%o5", "%o7", \
+ "%l0", "%l1", "%l2", "%l3", "%l4", "%l5", "%l6", "%l7", \
+ "%i0", "%i1", "%i2", "%i3", "%i4", "%i5", "%i7"); })
+# endif
+# define POST_GETCONTEXT PRE_GETCONTEXT
+# elif GCC_VERSION_BEFORE(4,0,3) && defined(__ia64)
+static jmp_buf function_call_may_return_twice_jmp_buf;
+int function_call_may_return_twice_false_1 = 0;
+int function_call_may_return_twice_false_2 = 0;
+# define PRE_GETCONTEXT \
+ (function_call_may_return_twice_false_1 ? \
+ setjmp(function_call_may_return_twice_jmp_buf) : \
+ 0)
+# define POST_GETCONTEXT \
+ (function_call_may_return_twice_false_2 ? \
+ setjmp(function_call_may_return_twice_jmp_buf) : \
+ 0)
+# elif defined(__FreeBSD__) && __FreeBSD__ < 7
+/*
+ * workaround for FreeBSD/i386 getcontext/setcontext bug.
+ * clear the carry flag by (0 ? ... : ...).
+ * FreeBSD PR 92110 http://www.freebsd.org/cgi/query-pr.cgi?pr=92110
+ * [ruby-dev:28263]
+ */
+static int volatile freebsd_clear_carry_flag = 0;
+# define PRE_GETCONTEXT \
+ (freebsd_clear_carry_flag ? (freebsd_clear_carry_flag = 0) : 0)
+# endif
+# ifndef PRE_GETCONTEXT
+# define PRE_GETCONTEXT 0
+# endif
+# ifndef POST_GETCONTEXT
+# define POST_GETCONTEXT 0
+# endif
+# define ruby_longjmp(env, val) rb_jump_context(env, val)
+# define ruby_setjmp(just_before_setjmp, j) ((j)->status = 0, \
+ (just_before_setjmp), \
+ PRE_GETCONTEXT, \
+ getcontext(&(j)->context), \
+ POST_GETCONTEXT, \
+ (j)->status)
+#else
+# define ruby_setjmp(just_before_setjmp, env) \
+ ((just_before_setjmp), RUBY_SETJMP(env))
+# define ruby_longjmp(env,val) RUBY_LONGJMP(env,val)
+# ifdef __CYGWIN__
+int _setjmp(), _longjmp();
+# endif
+#endif
+
+#include <sys/types.h>
+#include <signal.h>
+#include <errno.h>
+
+#if defined(__VMS)
+#pragma nostandard
+#endif
+
+#ifdef HAVE_SYS_SELECT_H
+#include <sys/select.h>
+#endif
+
+#include <sys/stat.h>
+
+VALUE rb_cProc;
+VALUE rb_cBinding;
+static VALUE proc_invoke _((VALUE,VALUE,VALUE,VALUE));
+static VALUE rb_f_binding _((VALUE));
+static void rb_f_END _((void));
+static VALUE rb_f_block_given_p _((void));
+static VALUE block_pass _((VALUE,NODE*));
+
+VALUE rb_cMethod;
+static VALUE method_call _((int, VALUE*, VALUE));
+VALUE rb_cUnboundMethod;
+static VALUE umethod_bind _((VALUE, VALUE));
+static VALUE rb_mod_define_method _((int, VALUE*, VALUE));
+NORETURN(static void rb_raise_jump _((VALUE)));
+static VALUE rb_make_exception _((int argc, VALUE *argv));
+
+static int scope_vmode;
+#define SCOPE_PUBLIC 0
+#define SCOPE_PRIVATE 1
+#define SCOPE_PROTECTED 2
+#define SCOPE_MODFUNC 5
+#define SCOPE_MASK 7
+#define SCOPE_SET(f) (scope_vmode=(f))
+#define SCOPE_TEST(f) (scope_vmode&(f))
+
+VALUE (*ruby_sandbox_save)_((rb_thread_t));
+VALUE (*ruby_sandbox_restore)_((rb_thread_t));
+NODE* ruby_current_node;
+int ruby_safe_level = 0;
+/* safe-level:
+ 0 - strings from streams/environment/ARGV are tainted (default)
+ 1 - no dangerous operation by tainted value
+ 2 - process/file operations prohibited
+ 3 - all generated objects are tainted
+ 4 - no global (non-tainted) variable modification/no direct output
+*/
+
+static VALUE safe_getter _((void));
+static void safe_setter _((VALUE val));
+
+void
+rb_secure(level)
+ int level;
+{
+ if (level <= ruby_safe_level) {
+ if (ruby_frame->last_func) {
+ rb_raise(rb_eSecurityError, "Insecure operation `%s' at level %d",
+ rb_id2name(ruby_frame->last_func), ruby_safe_level);
+ }
+ else {
+ rb_raise(rb_eSecurityError, "Insecure operation at level %d", ruby_safe_level);
+ }
+ }
+}
+
+void
+rb_secure_update(obj)
+ VALUE obj;
+{
+ if (!OBJ_TAINTED(obj)) rb_secure(4);
+}
+
+void
+rb_check_safe_obj(x)
+ VALUE x;
+{
+ if (ruby_safe_level > 0 && OBJ_TAINTED(x)){
+ if (ruby_frame->last_func) {
+ rb_raise(rb_eSecurityError, "Insecure operation - %s",
+ rb_id2name(ruby_frame->last_func));
+ }
+ else {
+ rb_raise(rb_eSecurityError, "Insecure operation: -r");
+ }
+ }
+ rb_secure(4);
+}
+
+void
+rb_check_safe_str(x)
+ VALUE x;
+{
+ rb_check_safe_obj(x);
+ if (TYPE(x)!= T_STRING) {
+ rb_raise(rb_eTypeError, "wrong argument type %s (expected String)",
+ rb_obj_classname(x));
+ }
+}
+
+NORETURN(static void print_undef _((VALUE, ID)));
+static void
+print_undef(klass, id)
+ VALUE klass;
+ ID id;
+{
+ rb_name_error(id, "undefined method `%s' for %s `%s'",
+ rb_id2name(id),
+ (TYPE(klass) == T_MODULE) ? "module" : "class",
+ rb_class2name(klass));
+}
+
+static ID removed, singleton_removed, undefined, singleton_undefined;
+
+#define CACHE_SIZE 0x800
+#define CACHE_MASK 0x7ff
+#define EXPR1(c,m) ((((c)>>3)^(m))&CACHE_MASK)
+
+struct cache_entry { /* method hash table. */
+ ID mid; /* method's id */
+ ID mid0; /* method's original id */
+ VALUE klass; /* receiver's class */
+ VALUE origin; /* where method defined */
+ NODE *method;
+ int noex;
+};
+
+static struct cache_entry cache[CACHE_SIZE];
+static int ruby_running = 0;
+
+void
+rb_clear_cache()
+{
+ struct cache_entry *ent, *end;
+
+ if (!ruby_running) return;
+ ent = cache; end = ent + CACHE_SIZE;
+ while (ent < end) {
+ ent->mid = 0;
+ ent++;
+ }
+}
+
+static void
+rb_clear_cache_for_undef(klass, id)
+ VALUE klass;
+ ID id;
+{
+ struct cache_entry *ent, *end;
+
+ if (!ruby_running) return;
+ ent = cache; end = ent + CACHE_SIZE;
+ while (ent < end) {
+ if (ent->mid == id &&
+ RCLASS(ent->origin)->m_tbl == RCLASS(klass)->m_tbl) {
+ ent->mid = 0;
+ }
+ ent++;
+ }
+}
+
+static void
+rb_clear_cache_by_id(id)
+ ID id;
+{
+ struct cache_entry *ent, *end;
+
+ if (!ruby_running) return;
+ ent = cache; end = ent + CACHE_SIZE;
+ while (ent < end) {
+ if (ent->mid == id) {
+ ent->mid = 0;
+ }
+ ent++;
+ }
+}
+
+void
+rb_clear_cache_by_class(klass)
+ VALUE klass;
+{
+ struct cache_entry *ent, *end;
+
+ if (!ruby_running) return;
+ ent = cache; end = ent + CACHE_SIZE;
+ while (ent < end) {
+ if (ent->klass == klass || ent->origin == klass) {
+ ent->mid = 0;
+ }
+ ent++;
+ }
+}
+
+static ID init, eqq, each, aref, aset, match, missing;
+static ID added, singleton_added;
+static ID __id__, __send__, respond_to;
+
+#define NOEX_TAINTED 8
+#define NOEX_SAFE(n) ((n) >> 4)
+#define NOEX_WITH(n, v) ((n) | (v) << 4)
+#define NOEX_WITH_SAFE(n) NOEX_WITH(n, ruby_safe_level)
+
+void
+rb_add_method(klass, mid, node, noex)
+ VALUE klass;
+ ID mid;
+ NODE *node;
+ int noex;
+{
+ NODE *body;
+
+ if (NIL_P(klass)) klass = rb_cObject;
+ if (ruby_safe_level >= 4 && (klass == rb_cObject || !OBJ_TAINTED(klass))) {
+ rb_raise(rb_eSecurityError, "Insecure: can't define method");
+ }
+ if (!FL_TEST(klass, FL_SINGLETON) &&
+ node && nd_type(node) != NODE_ZSUPER &&
+ (mid == rb_intern("initialize" )|| mid == rb_intern("initialize_copy"))) {
+ noex = NOEX_PRIVATE | noex;
+ }
+ else if (FL_TEST(klass, FL_SINGLETON) && node && nd_type(node) == NODE_CFUNC &&
+ mid == rb_intern("allocate")) {
+ rb_warn("defining %s.allocate is deprecated; use rb_define_alloc_func()",
+ rb_class2name(rb_iv_get(klass, "__attached__")));
+ mid = ID_ALLOCATOR;
+ }
+ if (OBJ_FROZEN(klass)) rb_error_frozen("class/module");
+ rb_clear_cache_by_id(mid);
+ body = NEW_METHOD(node, NOEX_WITH_SAFE(noex));
+ st_insert(RCLASS(klass)->m_tbl, mid, (st_data_t)body);
+ if (node && mid != ID_ALLOCATOR && ruby_running) {
+ if (FL_TEST(klass, FL_SINGLETON)) {
+ rb_funcall(rb_iv_get(klass, "__attached__"), singleton_added, 1, ID2SYM(mid));
+ }
+ else {
+ rb_funcall(klass, added, 1, ID2SYM(mid));
+ }
+ }
+}
+
+void
+rb_define_alloc_func(klass, func)
+ VALUE klass;
+ VALUE (*func) _((VALUE));
+{
+ Check_Type(klass, T_CLASS);
+ rb_add_method(rb_singleton_class(klass), ID_ALLOCATOR, NEW_CFUNC(func, 0),
+ NOEX_PRIVATE);
+}
+
+void
+rb_undef_alloc_func(klass)
+ VALUE klass;
+{
+ Check_Type(klass, T_CLASS);
+ rb_add_method(rb_singleton_class(klass), ID_ALLOCATOR, 0, NOEX_UNDEF);
+}
+
+static NODE*
+search_method(klass, id, origin)
+ VALUE klass, *origin;
+ ID id;
+{
+ st_data_t body;
+
+ if (!klass) return 0;
+ while (!st_lookup(RCLASS(klass)->m_tbl, id, &body)) {
+ klass = RCLASS(klass)->super;
+ if (!klass) return 0;
+ }
+
+ if (origin) *origin = klass;
+ return (NODE *)body;
+}
+
+static NODE*
+rb_get_method_body(klassp, idp, noexp)
+ VALUE *klassp;
+ ID *idp;
+ int *noexp;
+{
+ ID id = *idp;
+ VALUE klass = *klassp;
+ VALUE origin = 0;
+ NODE * volatile body;
+ struct cache_entry *ent;
+
+ if ((body = search_method(klass, id, &origin)) == 0 || !body->nd_body) {
+ /* store empty info in cache */
+ ent = cache + EXPR1(klass, id);
+ ent->klass = klass;
+ ent->origin = klass;
+ ent->mid = ent->mid0 = id;
+ ent->noex = 0;
+ ent->method = 0;
+
+ return 0;
+ }
+
+ if (ruby_running) {
+ /* store in cache */
+ ent = cache + EXPR1(klass, id);
+ ent->klass = klass;
+ ent->noex = body->nd_noex;
+ if (noexp) *noexp = body->nd_noex;
+ body = body->nd_body;
+ if (nd_type(body) == NODE_FBODY) {
+ ent->mid = id;
+ *klassp = body->nd_orig;
+ ent->origin = body->nd_orig;
+ *idp = ent->mid0 = body->nd_mid;
+ body = ent->method = body->nd_head;
+ }
+ else {
+ *klassp = origin;
+ ent->origin = origin;
+ ent->mid = ent->mid0 = id;
+ ent->method = body;
+ }
+ }
+ else {
+ if (noexp) *noexp = body->nd_noex;
+ body = body->nd_body;
+ if (nd_type(body) == NODE_FBODY) {
+ *klassp = body->nd_orig;
+ *idp = body->nd_mid;
+ body = body->nd_head;
+ }
+ else {
+ *klassp = origin;
+ }
+ }
+
+ return body;
+}
+
+NODE*
+rb_method_node(klass, id)
+ VALUE klass;
+ ID id;
+{
+ int noex;
+
+ return rb_get_method_body(&klass, &id, &noex);
+}
+
+static void
+remove_method(klass, mid)
+ VALUE klass;
+ ID mid;
+{
+ st_data_t data;
+ NODE *body = 0;
+
+ if (klass == rb_cObject) {
+ rb_secure(4);
+ }
+ if (ruby_safe_level >= 4 && !OBJ_TAINTED(klass)) {
+ rb_raise(rb_eSecurityError, "Insecure: can't remove method");
+ }
+ if (OBJ_FROZEN(klass)) rb_error_frozen("class/module");
+ if (mid == __id__ || mid == __send__ || mid == init) {
+ rb_warn("removing `%s' may cause serious problem", rb_id2name(mid));
+ }
+ if (st_lookup(RCLASS(klass)->m_tbl, mid, &data)) {
+ body = (NODE *)data;
+ if (!body || !body->nd_body) body = 0;
+ else {
+ st_delete(RCLASS(klass)->m_tbl, &mid, &data);
+ }
+ }
+ if (!body) {
+ rb_name_error(mid, "method `%s' not defined in %s",
+ rb_id2name(mid), rb_class2name(klass));
+ }
+ rb_clear_cache_for_undef(klass, mid);
+ if (FL_TEST(klass, FL_SINGLETON)) {
+ rb_funcall(rb_iv_get(klass, "__attached__"), singleton_removed, 1, ID2SYM(mid));
+ }
+ else {
+ rb_funcall(klass, removed, 1, ID2SYM(mid));
+ }
+}
+
+void
+rb_remove_method(klass, name)
+ VALUE klass;
+ const char *name;
+{
+ remove_method(klass, rb_intern(name));
+}
+
+/*
+ * call-seq:
+ * remove_method(symbol) => self
+ *
+ * Removes the method identified by _symbol_ from the current
+ * class. For an example, see <code>Module.undef_method</code>.
+ */
+
+static VALUE
+rb_mod_remove_method(argc, argv, mod)
+ int argc;
+ VALUE *argv;
+ VALUE mod;
+{
+ int i;
+
+ for (i=0; i<argc; i++) {
+ remove_method(mod, rb_to_id(argv[i]));
+ }
+ return mod;
+}
+
+#undef rb_disable_super
+#undef rb_enable_super
+
+void
+rb_disable_super(klass, name)
+ VALUE klass;
+ const char *name;
+{
+ /* obsolete - no use */
+}
+
+void
+rb_enable_super(klass, name)
+ VALUE klass;
+ const char *name;
+{
+ rb_warn("rb_enable_super() is obsolete");
+}
+
+static void
+rb_export_method(klass, name, noex)
+ VALUE klass;
+ ID name;
+ ID noex;
+{
+ NODE *body;
+ VALUE origin;
+
+ if (klass == rb_cObject) {
+ rb_secure(4);
+ }
+ body = search_method(klass, name, &origin);
+ if (!body && TYPE(klass) == T_MODULE) {
+ body = search_method(rb_cObject, name, &origin);
+ }
+ if (!body || !body->nd_body) {
+ print_undef(klass, name);
+ }
+ if (body->nd_noex != noex) {
+ if (klass == origin) {
+ body->nd_noex = noex;
+ }
+ else {
+ rb_add_method(klass, name, NEW_ZSUPER(), noex);
+ }
+ }
+}
+
+int
+rb_method_boundp(klass, id, ex)
+ VALUE klass;
+ ID id;
+ int ex;
+{
+ struct cache_entry *ent;
+ int noex;
+
+ /* is it in the method cache? */
+ ent = cache + EXPR1(klass, id);
+ if (ent->mid == id && ent->klass == klass) {
+ if (ex && (ent->noex & NOEX_PRIVATE))
+ return Qfalse;
+ if (!ent->method) return Qfalse;
+ return Qtrue;
+ }
+ if (rb_get_method_body(&klass, &id, &noex)) {
+ if (ex && (noex & NOEX_PRIVATE))
+ return Qfalse;
+ return Qtrue;
+ }
+ return Qfalse;
+}
+
+void
+rb_attr(klass, id, read, write, ex)
+ VALUE klass;
+ ID id;
+ int read, write, ex;
+{
+ const char *name;
+ char *buf;
+ ID attriv;
+ int noex;
+ size_t len;
+
+ if (!ex) noex = NOEX_PUBLIC;
+ else {
+ if (SCOPE_TEST(SCOPE_PRIVATE)) {
+ noex = NOEX_PRIVATE;
+ rb_warning((scope_vmode == SCOPE_MODFUNC) ?
+ "attribute accessor as module_function" :
+ "private attribute?");
+ }
+ else if (SCOPE_TEST(SCOPE_PROTECTED)) {
+ noex = NOEX_PROTECTED;
+ }
+ else {
+ noex = NOEX_PUBLIC;
+ }
+ }
+
+ if (!rb_is_local_id(id) && !rb_is_const_id(id)) {
+ rb_name_error(id, "invalid attribute name `%s'", rb_id2name(id));
+ }
+ name = rb_id2name(id);
+ if (!name) {
+ rb_raise(rb_eArgError, "argument needs to be symbol or string");
+ }
+ len = strlen(name)+2;
+ buf = ALLOCA_N(char,len);
+ snprintf(buf, len, "@%s", name);
+ attriv = rb_intern(buf);
+ if (read) {
+ rb_add_method(klass, id, NEW_IVAR(attriv), noex);
+ }
+ if (write) {
+ rb_add_method(klass, rb_id_attrset(id), NEW_ATTRSET(attriv), noex);
+ }
+}
+
+extern int ruby_in_compile;
+
+VALUE ruby_errinfo = Qnil;
+extern NODE *ruby_eval_tree_begin;
+extern NODE *ruby_eval_tree;
+extern int ruby_nerrs;
-ID rb_frame_callee(void);
VALUE rb_eLocalJumpError;
VALUE rb_eSysStackError;
-#define exception_error GET_VM()->special_exceptions[ruby_error_reenter]
+extern VALUE ruby_top_self;
+
+struct FRAME *ruby_frame;
+struct SCOPE *ruby_scope;
+static struct FRAME *top_frame;
+static struct SCOPE *top_scope;
+
+static unsigned long frame_unique = 0;
+
+#define PUSH_FRAME() do { \
+ volatile struct FRAME _frame; \
+ _frame.prev = ruby_frame; \
+ _frame.tmp = 0; \
+ _frame.node = ruby_current_node; \
+ _frame.iter = ruby_iter->iter; \
+ _frame.argc = 0; \
+ _frame.flags = 0; \
+ _frame.uniq = frame_unique++; \
+ ruby_frame = &_frame
+
+#define POP_FRAME() \
+ ruby_current_node = _frame.node; \
+ ruby_frame = _frame.prev; \
+} while (0)
+
+struct BLOCK {
+ NODE *var;
+ NODE *body;
+ VALUE self;
+ struct FRAME frame;
+ struct SCOPE *scope;
+ VALUE klass;
+ NODE *cref;
+ int iter;
+ int vmode;
+ int flags;
+ int uniq;
+ struct RVarmap *dyna_vars;
+ VALUE orig_thread;
+ VALUE wrapper;
+ VALUE block_obj;
+ struct BLOCK *outer;
+ struct BLOCK *prev;
+};
+
+#define BLOCK_D_SCOPE 1
+#define BLOCK_LAMBDA 2
+
+static struct BLOCK *ruby_block;
+static unsigned long block_unique = 1;
+
+#define PUSH_BLOCK(v,b) do { \
+ struct BLOCK _block; \
+ _block.var = (v); \
+ _block.body = (b); \
+ _block.self = self; \
+ _block.frame = *ruby_frame; \
+ _block.klass = ruby_class; \
+ _block.cref = ruby_cref; \
+ _block.frame.node = ruby_current_node;\
+ _block.scope = ruby_scope; \
+ _block.prev = ruby_block; \
+ _block.outer = ruby_block; \
+ _block.iter = ruby_iter->iter; \
+ _block.vmode = scope_vmode; \
+ _block.flags = BLOCK_D_SCOPE; \
+ _block.dyna_vars = ruby_dyna_vars; \
+ _block.wrapper = ruby_wrapper; \
+ _block.block_obj = 0; \
+ _block.uniq = (b)?block_unique++:0; \
+ if (b) { \
+ prot_tag->blkid = _block.uniq; \
+ } \
+ ruby_block = &_block
+
+#define POP_BLOCK() \
+ ruby_block = _block.prev; \
+} while (0)
+
+struct RVarmap *ruby_dyna_vars;
+#define PUSH_VARS() do { \
+ struct RVarmap * volatile _old; \
+ _old = ruby_dyna_vars; \
+ ruby_dyna_vars = 0
+
+#define POP_VARS() \
+ if (_old && (ruby_scope->flags & SCOPE_DONT_RECYCLE)) {\
+ if (RBASIC(_old)->flags) /* unless it's already recycled */ \
+ FL_SET(_old, DVAR_DONT_RECYCLE); \
+ }\
+ ruby_dyna_vars = _old; \
+} while (0)
+
+#define DVAR_DONT_RECYCLE FL_USER2
+
+#define DMETHOD_P() (ruby_frame->flags & FRAME_DMETH)
+
+static struct RVarmap*
+new_dvar(id, value, prev)
+ ID id;
+ VALUE value;
+ struct RVarmap *prev;
+{
+ NEWOBJ(vars, struct RVarmap);
+ OBJSETUP(vars, 0, T_VARMAP);
+ vars->id = id;
+ vars->val = value;
+ vars->next = prev;
+
+ return vars;
+}
+
+VALUE
+rb_dvar_defined(id)
+ ID id;
+{
+ struct RVarmap *vars = ruby_dyna_vars;
+
+ while (vars) {
+ if (vars->id == id) return Qtrue;
+ vars = vars->next;
+ }
+ return Qfalse;
+}
+
+VALUE
+rb_dvar_curr(id)
+ ID id;
+{
+ struct RVarmap *vars = ruby_dyna_vars;
+
+ while (vars) {
+ if (vars->id == 0) break;
+ if (vars->id == id) return Qtrue;
+ vars = vars->next;
+ }
+ return Qfalse;
+}
+
+VALUE
+rb_dvar_ref(id)
+ ID id;
+{
+ struct RVarmap *vars = ruby_dyna_vars;
+
+ while (vars) {
+ if (vars->id == id) {
+ return vars->val;
+ }
+ vars = vars->next;
+ }
+ return Qnil;
+}
+
+void
+rb_dvar_push(id, value)
+ ID id;
+ VALUE value;
+{
+ ruby_dyna_vars = new_dvar(id, value, ruby_dyna_vars);
+}
+
+static void
+dvar_asgn_internal(id, value, curr)
+ ID id;
+ VALUE value;
+ int curr;
+{
+ int n = 0;
+ struct RVarmap *vars = ruby_dyna_vars;
+
+ while (vars) {
+ if (curr && vars->id == 0) {
+ /* first null is a dvar header */
+ n++;
+ if (n == 2) break;
+ }
+ if (vars->id == id) {
+ vars->val = value;
+ return;
+ }
+ vars = vars->next;
+ }
+ if (!ruby_dyna_vars) {
+ ruby_dyna_vars = new_dvar(id, value, 0);
+ }
+ else {
+ vars = new_dvar(id, value, ruby_dyna_vars->next);
+ ruby_dyna_vars->next = vars;
+ }
+}
+
+static inline void
+dvar_asgn(id, value)
+ ID id;
+ VALUE value;
+{
+ dvar_asgn_internal(id, value, 0);
+}
+
+static inline void
+dvar_asgn_curr(id, value)
+ ID id;
+ VALUE value;
+{
+ dvar_asgn_internal(id, value, 1);
+}
+
+VALUE *
+rb_svar(cnt)
+ int cnt;
+{
+ struct RVarmap *vars = ruby_dyna_vars;
+ ID id;
+
+ if (!ruby_scope->local_tbl) return NULL;
+ if (cnt >= ruby_scope->local_tbl[0]) return NULL;
+ id = ruby_scope->local_tbl[cnt+1];
+ while (vars) {
+ if (vars->id == id) return &vars->val;
+ vars = vars->next;
+ }
+ if (ruby_scope->local_vars == 0) return NULL;
+ return &ruby_scope->local_vars[cnt];
+}
+
+struct iter {
+ int iter;
+ struct iter *prev;
+};
+static struct iter *ruby_iter;
+
+#define ITER_NOT 0
+#define ITER_PRE 1
+#define ITER_CUR 2
+#define ITER_PAS 3
+
+#define PUSH_ITER(i) do { \
+ struct iter _iter; \
+ _iter.prev = ruby_iter; \
+ _iter.iter = (i); \
+ ruby_iter = &_iter
+
+#define POP_ITER() \
+ ruby_iter = _iter.prev; \
+} while (0)
+
+struct tag {
+ rb_jmpbuf_t buf;
+ struct FRAME *frame;
+ struct iter *iter;
+ VALUE tag;
+ VALUE retval;
+ struct SCOPE *scope;
+ VALUE dst;
+ struct tag *prev;
+ int blkid;
+};
+static struct tag *prot_tag;
+
+#define PUSH_TAG(ptag) do { \
+ struct tag _tag; \
+ _tag.retval = Qnil; \
+ _tag.frame = ruby_frame; \
+ _tag.iter = ruby_iter; \
+ _tag.prev = prot_tag; \
+ _tag.scope = ruby_scope; \
+ _tag.tag = ptag; \
+ _tag.dst = 0; \
+ _tag.blkid = 0; \
+ prot_tag = &_tag
+
+#define PROT_NONE Qfalse /* 0 */
+#define PROT_THREAD Qtrue /* 2 */
+#define PROT_FUNC INT2FIX(0) /* 1 */
+#define PROT_LOOP INT2FIX(1) /* 3 */
+#define PROT_LAMBDA INT2FIX(2) /* 5 */
+#define PROT_YIELD INT2FIX(3) /* 7 */
+
+#define EXEC_TAG() ruby_setjmp(((void)0), prot_tag->buf)
+
+#define JUMP_TAG(st) do { \
+ ruby_frame = prot_tag->frame; \
+ ruby_iter = prot_tag->iter; \
+ ruby_longjmp(prot_tag->buf,(st)); \
+} while (0)
+
+#define POP_TAG() \
+ prot_tag = _tag.prev; \
+} while (0)
+
+#define TAG_DST() (_tag.dst == (VALUE)ruby_frame->uniq)
+
+#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
+#define TAG_MASK 0xf
+
+VALUE ruby_class;
+static VALUE ruby_wrapper; /* security wrapper */
+
+#define PUSH_CLASS(c) do { \
+ volatile VALUE _class = ruby_class; \
+ ruby_class = (c)
+
+#define POP_CLASS() ruby_class = _class; \
+} while (0)
+
+NODE *ruby_cref = 0;
+NODE *ruby_top_cref;
+#define PUSH_CREF(c) ruby_cref = NEW_CREF(c,ruby_cref)
+#define POP_CREF() ruby_cref = ruby_cref->nd_next
+
+#define PUSH_SCOPE() do { \
+ volatile int _vmode = scope_vmode; \
+ struct SCOPE * volatile _old; \
+ NEWOBJ(_scope, struct SCOPE); \
+ OBJSETUP(_scope, 0, T_SCOPE); \
+ _scope->local_tbl = 0; \
+ _scope->local_vars = 0; \
+ _scope->flags = 0; \
+ _old = ruby_scope; \
+ ruby_scope = _scope; \
+ scope_vmode = SCOPE_PUBLIC
+
+rb_thread_t rb_curr_thread;
+rb_thread_t rb_main_thread;
+#define main_thread rb_main_thread
+#define curr_thread rb_curr_thread
+
+static void scope_dup _((struct SCOPE *));
+
+#define POP_SCOPE() \
+ if (ruby_scope->flags & SCOPE_DONT_RECYCLE) {\
+ if (_old) scope_dup(_old); \
+ } \
+ if (!(ruby_scope->flags & SCOPE_MALLOC)) {\
+ ruby_scope->local_vars = 0; \
+ ruby_scope->local_tbl = 0; \
+ if (!(ruby_scope->flags & SCOPE_DONT_RECYCLE) && \
+ ruby_scope != top_scope) { \
+ rb_gc_force_recycle((VALUE)ruby_scope);\
+ } \
+ } \
+ ruby_scope->flags |= SCOPE_NOSTACK; \
+ ruby_scope = _old; \
+ scope_vmode = _vmode; \
+} while (0)
+
+static VALUE rb_eval _((VALUE,NODE*));
+static VALUE eval _((VALUE,VALUE,VALUE,const char*,int));
+static NODE *compile _((VALUE, const char*, int));
+
+static VALUE rb_yield_0 _((VALUE, VALUE, VALUE, int, int));
+
+#define YIELD_LAMBDA_CALL 1
+#define YIELD_PROC_CALL 2
+#define YIELD_PUBLIC_DEF 4
+#define YIELD_FUNC_AVALUE 1
+#define YIELD_FUNC_SVALUE 2
+#define YIELD_FUNC_LAMBDA 3
+
+static VALUE rb_call _((VALUE,VALUE,ID,int,const VALUE*,int,VALUE));
+static VALUE module_setup _((VALUE,NODE*));
+
+static VALUE massign _((VALUE,NODE*,VALUE,int));
+static void assign _((VALUE,NODE*,VALUE,int));
+
+typedef struct event_hook {
+ rb_event_hook_func_t func;
+ rb_event_t events;
+ struct event_hook *next;
+} rb_event_hook_t;
+
+static rb_event_hook_t *event_hooks;
+
+#define EXEC_EVENT_HOOK(event, node, self, id, klass) \
+ do { \
+ rb_event_hook_t *hook = event_hooks; \
+ rb_event_hook_func_t hook_func; \
+ rb_event_t events; \
+ \
+ while (hook) { \
+ hook_func = hook->func; \
+ events = hook->events; \
+ hook = hook->next; \
+ if (events & event) \
+ (*hook_func)(event, node, self, id, klass); \
+ } \
+ } while (0)
+
+static VALUE trace_func = 0;
+static int tracing = 0;
+static void call_trace_func _((rb_event_t,NODE*,VALUE,ID,VALUE));
+
+#if 0
+#define SET_CURRENT_SOURCE() (ruby_sourcefile = ruby_current_node->nd_file, \
+ ruby_sourceline = nd_line(ruby_current_node))
+#else
+#define SET_CURRENT_SOURCE() ((void)0)
+#endif
+
+void
+ruby_set_current_source()
+{
+ if (ruby_current_node) {
+ ruby_sourcefile = ruby_current_node->nd_file;
+ ruby_sourceline = nd_line(ruby_current_node);
+ }
+}
+
+static void
+#ifdef HAVE_STDARG_PROTOTYPES
+warn_printf(const char *fmt, ...)
+#else
+warn_printf(fmt, va_alist)
+ const char *fmt;
+ va_dcl
+#endif
+{
+ char buf[BUFSIZ];
+ va_list args;
+
+ va_init_list(args, fmt);
+ vsnprintf(buf, BUFSIZ, fmt, args);
+ va_end(args);
+ rb_write_error(buf);
+}
+
+#define warn_print(x) rb_write_error(x)
+#define warn_print2(x,l) rb_write_error2(x,l)
+
+static void
+error_pos()
+{
+ ruby_set_current_source();
+ if (ruby_sourcefile) {
+ if (ruby_frame->last_func) {
+ warn_printf("%s:%d:in `%s'", ruby_sourcefile, ruby_sourceline,
+ rb_id2name(ruby_frame->orig_func));
+ }
+ else if (ruby_sourceline == 0) {
+ warn_printf("%s", ruby_sourcefile);
+ }
+ else {
+ warn_printf("%s:%d", ruby_sourcefile, ruby_sourceline);
+ }
+ }
+}
+
+VALUE rb_check_backtrace(VALUE);
+
+static VALUE
+get_backtrace(info)
+ VALUE info;
+{
+ if (NIL_P(info)) return Qnil;
+ info = rb_funcall(info, rb_intern("backtrace"), 0);
+ if (NIL_P(info)) return Qnil;
+ return rb_check_backtrace(info);
+}
+
+static void
+set_backtrace(info, bt)
+ VALUE info, bt;
+{
+ rb_funcall(info, rb_intern("set_backtrace"), 1, bt);
+}
+
+static void
+error_print()
+{
+ VALUE errat = Qnil; /* OK */
+ volatile VALUE eclass, e;
+ const char *einfo;
+ long elen;
+
+ if (NIL_P(ruby_errinfo)) return;
+
+ PUSH_TAG(PROT_NONE);
+ if (EXEC_TAG() == 0) {
+ errat = get_backtrace(ruby_errinfo);
+ }
+ else {
+ errat = Qnil;
+ }
+ if (EXEC_TAG()) goto error;
+ if (NIL_P(errat)){
+ ruby_set_current_source();
+ if (ruby_sourcefile)
+ warn_printf("%s:%d", ruby_sourcefile, ruby_sourceline);
+ else
+ warn_printf("%d", ruby_sourceline);
+ }
+ else if (RARRAY(errat)->len == 0) {
+ error_pos();
+ }
+ else {
+ VALUE mesg = RARRAY(errat)->ptr[0];
+
+ if (NIL_P(mesg)) error_pos();
+ else {
+ warn_print2(RSTRING(mesg)->ptr, RSTRING(mesg)->len);
+ }
+ }
+
+ eclass = CLASS_OF(ruby_errinfo);
+ if (EXEC_TAG() == 0) {
+ e = rb_funcall(ruby_errinfo, rb_intern("message"), 0, 0);
+ StringValue(e);
+ einfo = RSTRING(e)->ptr;
+ elen = RSTRING(e)->len;
+ }
+ else {
+ einfo = "";
+ elen = 0;
+ }
+ if (EXEC_TAG()) goto error;
+ if (eclass == rb_eRuntimeError && elen == 0) {
+ warn_print(": unhandled exception\n");
+ }
+ else {
+ VALUE epath;
+
+ epath = rb_class_name(eclass);
+ if (elen == 0) {
+ warn_print(": ");
+ warn_print2(RSTRING(epath)->ptr, RSTRING(epath)->len);
+ warn_print("\n");
+ }
+ else {
+ char *tail = 0;
+ long len = elen;
+
+ if (RSTRING(epath)->ptr[0] == '#') epath = 0;
+ if ((tail = memchr(einfo, '\n', elen)) != 0) {
+ len = tail - einfo;
+ tail++; /* skip newline */
+ }
+ warn_print(": ");
+ warn_print2(einfo, len);
+ if (epath) {
+ warn_print(" (");
+ warn_print2(RSTRING(epath)->ptr, RSTRING(epath)->len);
+ warn_print(")\n");
+ }
+ if (tail && elen>len+1) {
+ warn_print2(tail, elen-len-1);
+ if (einfo[elen-1] != '\n') warn_print2("\n", 1);
+ }
+ }
+ }
+
+ if (!NIL_P(errat)) {
+ long i;
+ struct RArray *ep = RARRAY(errat);
+ int truncate = eclass == rb_eSysStackError;
-#include "eval_error.c"
-#include "eval_jump.c"
+#define TRACE_MAX (TRACE_HEAD+TRACE_TAIL+5)
+#define TRACE_HEAD 8
+#define TRACE_TAIL 5
-/* initialize ruby */
+ ep = RARRAY(errat);
+ for (i=1; i<ep->len; i++) {
+ if (TYPE(ep->ptr[i]) == T_STRING) {
+ warn_printf("\tfrom %s\n", RSTRING(ep->ptr[i])->ptr);
+ }
+ if (truncate && i == TRACE_HEAD && ep->len > TRACE_MAX) {
+ warn_printf("\t ... %ld levels...\n",
+ ep->len - TRACE_HEAD - TRACE_TAIL);
+ i = ep->len - TRACE_TAIL;
+ }
+ }
+ }
+ error:
+ POP_TAG();
+}
#if defined(__APPLE__)
#define environ (*_NSGetEnviron())
-#elif !defined(_WIN32)
+#elif !defined(_WIN32) && !defined(__MACOS__) || defined(_WIN32_WCE)
extern char **environ;
#endif
char **rb_origenviron;
-void rb_clear_trace_func(void);
-void rb_thread_stop_timer_thread(void);
+void rb_call_inits _((void));
+void Init_stack _((VALUE*));
+void Init_heap _((void));
+void Init_ext _((void));
+
+#ifdef HAVE_NATIVETHREAD
+static rb_nativethread_t ruby_thid;
+int
+is_ruby_native_thread() {
+ return NATIVETHREAD_EQUAL(ruby_thid, NATIVETHREAD_CURRENT());
+}
-void rb_call_inits(void);
-void Init_heap(void);
-void Init_BareVM(void);
+# ifdef HAVE_NATIVETHREAD_KILL
+void
+ruby_native_thread_kill(sig)
+ int sig;
+{
+ NATIVETHREAD_KILL(ruby_thid, sig);
+}
+# endif
+#endif
void
-ruby_init(void)
+ruby_init()
{
static int initialized = 0;
+ static struct FRAME frame;
+ static struct iter iter;
int state;
if (initialized)
return;
initialized = 1;
+#ifdef HAVE_NATIVETHREAD
+ ruby_thid = NATIVETHREAD_CURRENT();
+#endif
+ ruby_frame = top_frame = &frame;
+ ruby_iter = &iter;
+
+#ifdef __MACOS__
+ rb_origenviron = 0;
+#else
rb_origenviron = environ;
+#endif
- ruby_init_stack((void *)&state);
- Init_BareVM();
+ Init_stack((void*)&state);
Init_heap();
-
- PUSH_TAG();
+ PUSH_SCOPE();
+ ruby_scope->local_vars = 0;
+ ruby_scope->local_tbl = 0;
+ top_scope = ruby_scope;
+ /* default visibility is private at toplevel */
+ SCOPE_SET(SCOPE_PRIVATE);
+
+ PUSH_TAG(PROT_NONE);
if ((state = EXEC_TAG()) == 0) {
rb_call_inits();
+ ruby_class = rb_cObject;
+ ruby_frame->self = ruby_top_self;
+ ruby_top_cref = rb_node_newnode(NODE_CREF,rb_cObject,0,0);
+ ruby_cref = ruby_top_cref;
+ rb_define_global_const("TOPLEVEL_BINDING", rb_f_binding(ruby_top_self));
+#ifdef __MACOS__
+ _macruby_init();
+#elif defined(__VMS)
+ _vmsruby_init();
+#endif
ruby_prog_init();
+ ALLOW_INTS;
}
POP_TAG();
-
if (state) {
error_print();
exit(EXIT_FAILURE);
}
- GET_VM()->running = 1;
+ POP_SCOPE();
+ ruby_scope = top_scope;
+ top_scope->flags &= ~SCOPE_NOSTACK;
+ ruby_running = 1;
}
-extern void rb_clear_trace_func(void);
+static VALUE
+eval_node(self, node)
+ VALUE self;
+ NODE *node;
+{
+ NODE *beg_tree = ruby_eval_tree_begin;
+
+ ruby_eval_tree_begin = 0;
+ if (beg_tree) {
+ rb_eval(self, beg_tree);
+ }
+
+ if (!node) return Qnil;
+ return rb_eval(self, node);
+}
+
+int ruby_in_eval;
+
+static int rb_thread_join _((rb_thread_t, double));
+
+static void rb_thread_cleanup _((void));
+static void rb_thread_wait_other_threads _((void));
+
+static int thread_no_ensure _((void));
+
+static VALUE exception_error;
+static VALUE sysstack_error;
+
+static int
+sysexit_status(err)
+ VALUE err;
+{
+ VALUE st = rb_iv_get(err, "status");
+ return NUM2INT(st);
+}
+
+static int
+error_handle(ex)
+ int ex;
+{
+ int status = EXIT_FAILURE;
+ rb_thread_t th = curr_thread;
+
+ if (rb_thread_set_raised(th))
+ return EXIT_FAILURE;
+ switch (ex & TAG_MASK) {
+ case 0:
+ status = EXIT_SUCCESS;
+ break;
+
+ case TAG_RETURN:
+ error_pos();
+ warn_print(": unexpected return\n");
+ break;
+ case TAG_NEXT:
+ error_pos();
+ warn_print(": unexpected next\n");
+ break;
+ case TAG_BREAK:
+ error_pos();
+ warn_print(": unexpected break\n");
+ break;
+ case TAG_REDO:
+ error_pos();
+ warn_print(": unexpected redo\n");
+ break;
+ case TAG_RETRY:
+ error_pos();
+ warn_print(": retry outside of rescue clause\n");
+ break;
+ case TAG_THROW:
+ if (prot_tag && prot_tag->frame && prot_tag->frame->node) {
+ NODE *tag = prot_tag->frame->node;
+ warn_printf("%s:%d: uncaught throw\n",
+ tag->nd_file, nd_line(tag));
+ }
+ else {
+ error_pos();
+ warn_printf(": unexpected throw\n");
+ }
+ break;
+ case TAG_RAISE:
+ case TAG_FATAL:
+ if (rb_obj_is_kind_of(ruby_errinfo, rb_eSystemExit)) {
+ status = sysexit_status(ruby_errinfo);
+ }
+ else if (rb_obj_is_instance_of(ruby_errinfo, rb_eSignal)) {
+ /* no message when exiting by signal */
+ }
+ else {
+ error_print();
+ }
+ break;
+ default:
+ rb_bug("Unknown longjmp status %d", ex);
+ break;
+ }
+ rb_thread_reset_raised(th);
+ return status;
+}
-void *
-ruby_options(int argc, char **argv)
+void
+ruby_options(argc, argv)
+ int argc;
+ char **argv;
{
int state;
- void *volatile iseq = 0;
- ruby_init_stack((void *)&iseq);
- PUSH_TAG();
+ Init_stack((void*)&state);
+ PUSH_TAG(PROT_NONE);
if ((state = EXEC_TAG()) == 0) {
- SAVE_ROOT_JMPBUF(GET_THREAD(), iseq = ruby_process_options(argc, argv));
+ ruby_process_options(argc, argv);
}
else {
- rb_clear_trace_func();
- state = error_handle(state);
- iseq = (void *)INT2FIX(state);
+ trace_func = 0;
+ tracing = 0;
+ exit(error_handle(state));
}
POP_TAG();
- return iseq;
}
+void rb_exec_end_proc _((void));
+
static void
-ruby_finalize_0(void)
+ruby_finalize_0()
{
- PUSH_TAG();
+ PUSH_TAG(PROT_NONE);
if (EXEC_TAG() == 0) {
rb_trap_exit();
}
POP_TAG();
rb_exec_end_proc();
- rb_clear_trace_func();
}
static void
-ruby_finalize_1(void)
+ruby_finalize_1()
{
- ruby_sig_finalize();
- GET_THREAD()->errinfo = Qnil;
+ signal(SIGINT, SIG_DFL);
+ ruby_errinfo = 0;
rb_gc_call_finalizer_at_exit();
+ trace_func = 0;
+ tracing = 0;
}
void
-ruby_finalize(void)
+ruby_finalize()
{
ruby_finalize_0();
ruby_finalize_1();
}
-void rb_thread_stop_timer_thread(void);
-
int
-ruby_cleanup(volatile int ex)
+ruby_cleanup(ex)
+ int ex;
{
int state;
volatile VALUE errs[2];
- rb_thread_t *th = GET_THREAD();
int nerr;
- errs[1] = th->errinfo;
- th->safe_level = 0;
- ruby_init_stack(&errs[STACK_UPPER(errs, 0, 1)]);
-
- PUSH_TAG();
- if ((state = EXEC_TAG()) == 0) {
- SAVE_ROOT_JMPBUF(th, ruby_finalize_0());
- }
- POP_TAG();
-
- errs[0] = th->errinfo;
- PUSH_TAG();
+ errs[1] = ruby_errinfo;
+ ruby_safe_level = 0;
+ Init_stack((void *)&state);
+ ruby_finalize_0();
+ errs[0] = ruby_errinfo;
+ PUSH_TAG(PROT_NONE);
+ PUSH_ITER(ITER_NOT);
if ((state = EXEC_TAG()) == 0) {
- SAVE_ROOT_JMPBUF(th, rb_thread_terminate_all());
+ rb_thread_cleanup();
+ rb_thread_wait_other_threads();
}
else if (ex == 0) {
ex = state;
}
- th->errinfo = errs[1];
+ POP_ITER();
+ ruby_errinfo = errs[1];
ex = error_handle(ex);
ruby_finalize_1();
POP_TAG();
- rb_thread_stop_timer_thread();
for (nerr = 0; nerr < sizeof(errs) / sizeof(errs[0]); ++nerr) {
VALUE err = errs[nerr];
if (!RTEST(err)) continue;
- /* th->errinfo contains a NODE while break'ing */
- if (TYPE(err) == T_NODE) continue;
-
if (rb_obj_is_kind_of(err, rb_eSystemExit)) {
return sysexit_status(err);
}
@@ -191,54 +1632,347 @@ ruby_cleanup(volatile int ex)
return ex;
}
-int
-ruby_exec_node(void *n, const char *file)
+static int
+ruby_exec_internal()
{
- volatile int state;
- VALUE iseq = (VALUE)n;
- rb_thread_t *th = GET_THREAD();
-
- if (!n) return 0;
+ int state;
- PUSH_TAG();
+ PUSH_TAG(PROT_NONE);
+ PUSH_ITER(ITER_NOT);
+ /* default visibility is private at toplevel */
+ SCOPE_SET(SCOPE_PRIVATE);
if ((state = EXEC_TAG()) == 0) {
- SAVE_ROOT_JMPBUF(th, {
- th->base_block = 0;
- rb_iseq_eval_main(iseq);
- });
+ eval_node(ruby_top_self, ruby_eval_tree);
}
+ POP_ITER();
POP_TAG();
return state;
}
void
-ruby_stop(int ex)
+ruby_stop(ex)
+ int ex;
{
exit(ruby_cleanup(ex));
}
int
-ruby_run_node(void *n)
+ruby_exec()
{
- VALUE v = (VALUE)n;
+ volatile NODE *tmp;
+
+ Init_stack((void*)&tmp);
+ return ruby_exec_internal();
+}
- switch (v) {
- case Qtrue: return EXIT_SUCCESS;
- case Qfalse: return EXIT_FAILURE;
+void
+ruby_run()
+{
+ int state;
+ static int ex;
+
+ if (ruby_nerrs > 0) exit(EXIT_FAILURE);
+ state = ruby_exec();
+ if (state && !ex) ex = state;
+ ruby_stop(ex);
+}
+
+static void
+compile_error(at)
+ const char *at;
+{
+ VALUE str;
+
+ ruby_nerrs = 0;
+ str = rb_str_buf_new2("compile error");
+ if (at) {
+ rb_str_buf_cat2(str, " in ");
+ rb_str_buf_cat2(str, at);
}
- if (FIXNUM_P(v)) {
- return FIX2INT(v);
+ rb_str_buf_cat(str, "\n", 1);
+ if (!NIL_P(ruby_errinfo)) {
+ rb_str_append(str, rb_obj_as_string(ruby_errinfo));
}
- ruby_init_stack((void *)&n);
- return ruby_cleanup(ruby_exec_node(n, 0));
+ rb_exc_raise(rb_exc_new3(rb_eSyntaxError, str));
+}
+
+VALUE
+rb_eval_string(str)
+ const char *str;
+{
+ VALUE v;
+ NODE *oldsrc = ruby_current_node;
+
+ ruby_current_node = 0;
+ ruby_sourcefile = rb_source_filename("(eval)");
+ v = eval(ruby_top_self, rb_str_new2(str), Qnil, 0, 0);
+ ruby_current_node = oldsrc;
+
+ return v;
+}
+
+VALUE
+rb_eval_string_protect(str, state)
+ const char *str;
+ int *state;
+{
+ return rb_protect((VALUE (*)_((VALUE)))rb_eval_string, (VALUE)str, state);
+}
+
+VALUE
+rb_eval_string_wrap(str, state)
+ const char *str;
+ int *state;
+{
+ int status;
+ VALUE self = ruby_top_self;
+ VALUE wrapper = ruby_wrapper;
+ VALUE val;
+
+ PUSH_CLASS(ruby_wrapper = rb_module_new());
+ ruby_top_self = rb_obj_clone(ruby_top_self);
+ rb_extend_object(ruby_top_self, ruby_wrapper);
+ PUSH_FRAME();
+ ruby_frame->last_func = 0;
+ ruby_frame->last_class = 0;
+ ruby_frame->self = self;
+ PUSH_CREF(ruby_wrapper);
+ PUSH_SCOPE();
+
+ val = rb_eval_string_protect(str, &status);
+ ruby_top_self = self;
+
+ POP_SCOPE();
+ POP_FRAME();
+ POP_CLASS();
+ ruby_wrapper = wrapper;
+ if (state) {
+ *state = status;
+ }
+ else if (status) {
+ JUMP_TAG(status);
+ }
+ return val;
+}
+
+NORETURN(static void localjump_error(const char*, VALUE, int));
+static void
+localjump_error(mesg, value, reason)
+ const char *mesg;
+ VALUE value;
+ int reason;
+{
+ VALUE exc = rb_exc_new2(rb_eLocalJumpError, mesg);
+ ID id;
+
+ rb_iv_set(exc, "@exit_value", value);
+ switch (reason) {
+ case TAG_BREAK:
+ id = rb_intern("break"); break;
+ case TAG_REDO:
+ id = rb_intern("redo"); break;
+ case TAG_RETRY:
+ id = rb_intern("retry"); break;
+ case TAG_NEXT:
+ id = rb_intern("next"); break;
+ case TAG_RETURN:
+ id = rb_intern("return"); break;
+ default:
+ id = rb_intern("noreason"); break;
+ }
+ rb_iv_set(exc, "@reason", ID2SYM(id));
+ rb_exc_raise(exc);
+}
+
+/*
+ * call_seq:
+ * local_jump_error.exit_value => obj
+ *
+ * Returns the exit value associated with this +LocalJumpError+.
+ */
+static VALUE
+localjump_xvalue(exc)
+ VALUE exc;
+{
+ return rb_iv_get(exc, "@exit_value");
+}
+
+/*
+ * call-seq:
+ * local_jump_error.reason => symbol
+ *
+ * The reason this block was terminated:
+ * :break, :redo, :retry, :next, :return, or :noreason.
+ */
+
+static VALUE
+localjump_reason(exc)
+ VALUE exc;
+{
+ return rb_iv_get(exc, "@reason");
+}
+
+NORETURN(static void jump_tag_but_local_jump _((int,VALUE)));
+static void
+jump_tag_but_local_jump(state, val)
+ int state;
+ VALUE val;
+{
+
+ if (val == Qundef) val = prot_tag->retval;
+ switch (state) {
+ case 0:
+ break;
+ case TAG_RETURN:
+ localjump_error("unexpected return", val, state);
+ break;
+ case TAG_BREAK:
+ localjump_error("unexpected break", val, state);
+ break;
+ case TAG_NEXT:
+ localjump_error("unexpected next", val, state);
+ break;
+ case TAG_REDO:
+ localjump_error("unexpected redo", Qnil, state);
+ break;
+ case TAG_RETRY:
+ localjump_error("retry outside of rescue clause", Qnil, state);
+ break;
+ default:
+ break;
+ }
+ JUMP_TAG(state);
+}
+
+VALUE
+rb_eval_cmd(cmd, arg, level)
+ VALUE cmd, arg;
+ int level;
+{
+ int state;
+ VALUE val = Qnil; /* OK */
+ struct SCOPE *saved_scope;
+ volatile int safe = ruby_safe_level;
+
+ if (OBJ_TAINTED(cmd)) {
+ level = 4;
+ }
+ if (TYPE(cmd) != T_STRING) {
+ PUSH_ITER(ITER_NOT);
+ PUSH_TAG(PROT_NONE);
+ ruby_safe_level = level;
+ if ((state = EXEC_TAG()) == 0) {
+ val = rb_funcall2(cmd, rb_intern("call"), RARRAY(arg)->len, RARRAY(arg)->ptr);
+ }
+ ruby_safe_level = safe;
+ POP_TAG();
+ POP_ITER();
+ if (state) JUMP_TAG(state);
+ return val;
+ }
+
+ saved_scope = ruby_scope;
+ ruby_scope = top_scope;
+ PUSH_FRAME();
+ ruby_frame->last_func = 0;
+ ruby_frame->last_class = 0;
+ ruby_frame->self = ruby_top_self;
+ PUSH_CREF(ruby_wrapper ? ruby_wrapper : rb_cObject);
+
+ ruby_safe_level = level;
+
+ PUSH_TAG(PROT_NONE);
+ if ((state = EXEC_TAG()) == 0) {
+ val = eval(ruby_top_self, cmd, Qnil, 0, 0);
+ }
+ if (ruby_scope->flags & SCOPE_DONT_RECYCLE)
+ scope_dup(saved_scope);
+ ruby_scope = saved_scope;
+ ruby_safe_level = safe;
+ POP_TAG();
+ POP_FRAME();
+
+ if (state) jump_tag_but_local_jump(state, val);
+ return val;
+}
+
+#define ruby_cbase (ruby_cref->nd_clss)
+
+static VALUE
+ev_const_defined(cref, id, self)
+ NODE *cref;
+ ID id;
+ VALUE self;
+{
+ NODE *cbase = cref;
+ VALUE result;
+
+ while (cbase && cbase->nd_next) {
+ struct RClass *klass = RCLASS(cbase->nd_clss);
+
+ if (!NIL_P(klass)) {
+ if (klass->iv_tbl && st_lookup(klass->iv_tbl, id, &result)) {
+ if (result == Qundef && NIL_P(rb_autoload_p((VALUE)klass, id))) {
+ return Qfalse;
+ }
+ return Qtrue;
+ }
+ }
+ cbase = cbase->nd_next;
+ }
+ return rb_const_defined(cref->nd_clss, id);
+}
+
+static VALUE
+ev_const_get(cref, id, self)
+ NODE *cref;
+ ID id;
+ VALUE self;
+{
+ NODE *cbase = cref;
+ VALUE result;
+
+ while (cbase && cbase->nd_next) {
+ VALUE klass = cbase->nd_clss;
+
+ if (!NIL_P(klass)) {
+ while (RCLASS(klass)->iv_tbl &&
+ st_lookup(RCLASS(klass)->iv_tbl, id, &result)) {
+ if (result == Qundef) {
+ if (!RTEST(rb_autoload_load(klass, id))) break;
+ continue;
+ }
+ return result;
+ }
+ }
+ cbase = cbase->nd_next;
+ }
+ return rb_const_get(NIL_P(cref->nd_clss) ? CLASS_OF(self): cref->nd_clss, id);
+}
+
+static VALUE
+cvar_cbase()
+{
+ NODE *cref = ruby_cref;
+
+ while (cref && cref->nd_next && (NIL_P(cref->nd_clss) || FL_TEST(cref->nd_clss, FL_SINGLETON))) {
+ cref = cref->nd_next;
+ if (!cref->nd_next) {
+ rb_warn("class variable access from toplevel singleton method");
+ }
+ }
+ if (NIL_P(cref->nd_clss)) {
+ rb_raise(rb_eTypeError, "no class variables available");
+ }
+ return cref->nd_clss;
}
/*
* call-seq:
* Module.nesting => array
- *
+ *
* Returns the list of +Modules+ nested at the point of call.
- *
+ *
* module M1
* module M2
* $a = Module.nesting
@@ -249,17 +1983,17 @@ ruby_run_node(void *n)
*/
static VALUE
-rb_mod_nesting(void)
+rb_mod_nesting()
{
+ NODE *cbase = ruby_cref;
VALUE ary = rb_ary_new();
- const NODE *cref = rb_vm_cref();
- while (cref && cref->nd_next) {
- VALUE klass = cref->nd_clss;
- if (!NIL_P(klass)) {
- rb_ary_push(ary, klass);
- }
- cref = cref->nd_next;
+ while (cbase && cbase->nd_next) {
+ if (!NIL_P(cbase->nd_clss)) rb_ary_push(ary, cbase->nd_clss);
+ cbase = cbase->nd_next;
+ }
+ if (ruby_wrapper && RARRAY(ary)->len == 0) {
+ rb_ary_push(ary, ruby_wrapper);
}
return ary;
}
@@ -267,48 +2001,39 @@ rb_mod_nesting(void)
/*
* call-seq:
* Module.constants => array
- *
+ *
* Returns an array of the names of all constants defined in the
* system. This list includes the names of all modules and classes.
- *
+ *
* p Module.constants.sort[1..5]
- *
+ *
* <em>produces:</em>
- *
+ *
* ["ARGV", "ArgumentError", "Array", "Bignum", "Binding"]
*/
static VALUE
-rb_mod_s_constants(int argc, VALUE *argv, VALUE mod)
+rb_mod_s_constants()
{
- const NODE *cref = rb_vm_cref();
- VALUE klass;
- VALUE cbase = 0;
+ NODE *cbase = ruby_cref;
void *data = 0;
- if (argc > 0) {
- return rb_mod_constants(argc, argv, rb_cModule);
- }
-
- while (cref) {
- klass = cref->nd_clss;
- if (!NIL_P(klass)) {
- data = rb_mod_const_at(cref->nd_clss, data);
- if (!cbase) {
- cbase = klass;
- }
+ while (cbase) {
+ if (!NIL_P(cbase->nd_clss)) {
+ data = rb_mod_const_at(cbase->nd_clss, data);
}
- cref = cref->nd_next;
+ cbase = cbase->nd_next;
}
- if (cbase) {
- data = rb_mod_const_of(cbase, data);
+ if (!NIL_P(ruby_cbase)) {
+ data = rb_mod_const_of(ruby_cbase, data);
}
return rb_const_list(data);
}
void
-rb_frozen_class_p(VALUE klass)
+rb_frozen_class_p(klass)
+ VALUE klass;
{
const char *desc = "something(?!)";
@@ -319,45 +2044,2553 @@ rb_frozen_class_p(VALUE klass)
switch (TYPE(klass)) {
case T_MODULE:
case T_ICLASS:
- desc = "module";
+ desc = "module"; break;
+ case T_CLASS:
+ desc = "class"; break;
+ }
+ }
+ rb_error_frozen(desc);
+ }
+}
+
+void
+rb_undef(klass, id)
+ VALUE klass;
+ ID id;
+{
+ VALUE origin;
+ NODE *body;
+
+ if (ruby_cbase == rb_cObject && klass == rb_cObject) {
+ rb_secure(4);
+ }
+ if (ruby_safe_level >= 4 && !OBJ_TAINTED(klass)) {
+ rb_raise(rb_eSecurityError, "Insecure: can't undef `%s'", rb_id2name(id));
+ }
+ rb_frozen_class_p(klass);
+ if (id == __id__ || id == __send__ || id == init) {
+ rb_warn("undefining `%s' may cause serious problem", rb_id2name(id));
+ }
+ body = search_method(klass, id, &origin);
+ if (!body || !body->nd_body) {
+ const char *s0 = " class";
+ VALUE c = klass;
+
+ if (FL_TEST(c, FL_SINGLETON)) {
+ VALUE obj = rb_iv_get(klass, "__attached__");
+
+ switch (TYPE(obj)) {
+ case T_MODULE:
+ case T_CLASS:
+ c = obj;
+ s0 = "";
+ }
+ }
+ else if (TYPE(c) == T_MODULE) {
+ s0 = " module";
+ }
+ rb_name_error(id, "undefined method `%s' for%s `%s'",
+ rb_id2name(id),s0,rb_class2name(c));
+ }
+ rb_add_method(klass, id, 0, NOEX_PUBLIC);
+ if (FL_TEST(klass, FL_SINGLETON)) {
+ rb_funcall(rb_iv_get(klass, "__attached__"),
+ singleton_undefined, 1, ID2SYM(id));
+ }
+ else {
+ rb_funcall(klass, undefined, 1, ID2SYM(id));
+ }
+}
+
+/*
+ * call-seq:
+ * undef_method(symbol) => self
+ *
+ * Prevents the current class from responding to calls to the named
+ * method. Contrast this with <code>remove_method</code>, which deletes
+ * the method from the particular class; Ruby will still search
+ * superclasses and mixed-in modules for a possible receiver.
+ *
+ * class Parent
+ * def hello
+ * puts "In parent"
+ * end
+ * end
+ * class Child < Parent
+ * def hello
+ * puts "In child"
+ * end
+ * end
+ *
+ *
+ * c = Child.new
+ * c.hello
+ *
+ *
+ * class Child
+ * remove_method :hello # remove from child, still in parent
+ * end
+ * c.hello
+ *
+ *
+ * class Child
+ * undef_method :hello # prevent any calls to 'hello'
+ * end
+ * c.hello
+ *
+ * <em>produces:</em>
+ *
+ * In child
+ * In parent
+ * prog.rb:23: undefined method `hello' for #<Child:0x401b3bb4> (NoMethodError)
+ */
+
+static VALUE
+rb_mod_undef_method(argc, argv, mod)
+ int argc;
+ VALUE *argv;
+ VALUE mod;
+{
+ int i;
+
+ for (i=0; i<argc; i++) {
+ rb_undef(mod, rb_to_id(argv[i]));
+ }
+ return mod;
+}
+
+void
+rb_alias(klass, name, def)
+ VALUE klass;
+ ID name, def;
+{
+ VALUE origin = 0;
+ NODE *orig, *body, *node;
+ VALUE singleton = 0;
+ st_data_t data;
+
+ rb_frozen_class_p(klass);
+ if (name == def) return;
+ if (klass == rb_cObject) {
+ rb_secure(4);
+ }
+ orig = search_method(klass, def, &origin);
+ if (!orig || !orig->nd_body) {
+ if (TYPE(klass) == T_MODULE) {
+ orig = search_method(rb_cObject, def, &origin);
+ }
+ }
+ if (!orig || !orig->nd_body) {
+ print_undef(klass, def);
+ }
+ if (FL_TEST(klass, FL_SINGLETON)) {
+ singleton = rb_iv_get(klass, "__attached__");
+ }
+ body = orig->nd_body;
+ orig->nd_cnt++;
+ if (nd_type(body) == NODE_FBODY) { /* was alias */
+ def = body->nd_mid;
+ origin = body->nd_orig;
+ body = body->nd_head;
+ }
+
+ rb_clear_cache_by_id(name);
+ if (RTEST(ruby_verbose) && st_lookup(RCLASS(klass)->m_tbl, name, &data)) {
+ node = (NODE *)data;
+ if (node->nd_cnt == 0 && node->nd_body) {
+ rb_warning("discarding old %s", rb_id2name(name));
+ }
+ }
+ st_insert(RCLASS(klass)->m_tbl, name,
+ (st_data_t)NEW_METHOD(NEW_FBODY(body, def, origin),
+ NOEX_WITH_SAFE(orig->nd_noex)));
+
+ if (!ruby_running) return;
+
+ if (singleton) {
+ rb_funcall(singleton, singleton_added, 1, ID2SYM(name));
+ }
+ else {
+ rb_funcall(klass, added, 1, ID2SYM(name));
+ }
+}
+
+/*
+ * call-seq:
+ * alias_method(new_name, old_name) => self
+ *
+ * Makes <i>new_name</i> a new copy of the method <i>old_name</i>. This can
+ * be used to retain access to methods that are overridden.
+ *
+ * module Mod
+ * alias_method :orig_exit, :exit
+ * def exit(code=0)
+ * puts "Exiting with code #{code}"
+ * orig_exit(code)
+ * end
+ * end
+ * include Mod
+ * exit(99)
+ *
+ * <em>produces:</em>
+ *
+ * Exiting with code 99
+ */
+
+static VALUE
+rb_mod_alias_method(mod, newname, oldname)
+ VALUE mod, newname, oldname;
+{
+ rb_alias(mod, rb_to_id(newname), rb_to_id(oldname));
+ return mod;
+}
+
+NODE *
+rb_copy_node_scope(node, rval)
+ NODE *node;
+ NODE *rval;
+{
+ NODE *copy = NEW_NODE(NODE_SCOPE,0,rval,node->nd_next);
+
+ if (node->nd_tbl) {
+ copy->nd_tbl = ALLOC_N(ID, node->nd_tbl[0]+1);
+ MEMCPY(copy->nd_tbl, node->nd_tbl, ID, node->nd_tbl[0]+1);
+ }
+ else {
+ copy->nd_tbl = 0;
+ }
+ return copy;
+}
+
+#ifdef C_ALLOCA
+# define TMP_PROTECT NODE * volatile tmp__protect_tmp=0
+# define TMP_ALLOC(n) \
+ (tmp__protect_tmp = NEW_NODE(NODE_ALLOCA, \
+ ALLOC_N(VALUE,n),tmp__protect_tmp,n), \
+ (void*)tmp__protect_tmp->nd_head)
+#else
+# define TMP_PROTECT typedef int foobazzz
+# define TMP_ALLOC(n) ALLOCA_N(VALUE,n)
+#endif
+
+#define SETUP_ARGS0(anode,extra) do {\
+ NODE *n = anode;\
+ if (!n) {\
+ argc = 0;\
+ argv = 0;\
+ }\
+ else if (nd_type(n) == NODE_ARRAY) {\
+ argc=anode->nd_alen;\
+ if (argc > 0) {\
+ int i;\
+ n = anode;\
+ argv = TMP_ALLOC(argc+extra);\
+ for (i=0;i<argc;i++) {\
+ argv[i] = rb_eval(self,n->nd_head);\
+ n=n->nd_next;\
+ }\
+ }\
+ else {\
+ argc = 0;\
+ argv = 0;\
+ }\
+ }\
+ else {\
+ VALUE args = rb_eval(self,n);\
+ if (TYPE(args) != T_ARRAY)\
+ args = rb_ary_to_ary(args);\
+ argc = RARRAY(args)->len;\
+ argv = TMP_ALLOC(argc+extra);\
+ MEMCPY(argv, RARRAY(args)->ptr, VALUE, argc);\
+ }\
+} while (0)
+
+#define SETUP_ARGS(anode) SETUP_ARGS0(anode,0)
+
+#define BEGIN_CALLARGS do {\
+ struct BLOCK *tmp_block = ruby_block;\
+ int tmp_iter = ruby_iter->iter;\
+ switch (tmp_iter) {\
+ case ITER_PRE:\
+ if (ruby_block) ruby_block = ruby_block->outer;\
+ case ITER_PAS:\
+ tmp_iter = ITER_NOT;\
+ }\
+ PUSH_ITER(tmp_iter)
+
+#define END_CALLARGS \
+ ruby_block = tmp_block;\
+ POP_ITER();\
+} while (0)
+
+#define MATCH_DATA *rb_svar(node->nd_cnt)
+
+static const char* is_defined _((VALUE, NODE*, char*));
+
+static const char*
+arg_defined(self, node, buf, type)
+ VALUE self;
+ NODE *node;
+ char *buf;
+ char *type;
+{
+ int argc;
+ int i;
+
+ if (!node) return type; /* no args */
+ if (nd_type(node) == NODE_ARRAY) {
+ argc=node->nd_alen;
+ if (argc > 0) {
+ for (i=0;i<argc;i++) {
+ if (!is_defined(self, node->nd_head, buf))
+ return 0;
+ node = node->nd_next;
+ }
+ }
+ }
+ else if (!is_defined(self, node, buf)) {
+ return 0;
+ }
+ return type;
+}
+
+static const char*
+is_defined(self, node, buf)
+ VALUE self;
+ NODE *node; /* OK */
+ char *buf;
+{
+ VALUE val; /* OK */
+ int state;
+
+ again:
+ if (!node) return "expression";
+ switch (nd_type(node)) {
+ case NODE_SUPER:
+ case NODE_ZSUPER:
+ if (ruby_frame->last_func == 0) return 0;
+ else if (ruby_frame->last_class == 0) return 0;
+ val = ruby_frame->last_class;
+ if (rb_method_boundp(RCLASS(val)->super, ruby_frame->orig_func, 0)) {
+ if (nd_type(node) == NODE_SUPER) {
+ return arg_defined(self, node->nd_args, buf, "super");
+ }
+ return "super";
+ }
+ break;
+
+ case NODE_VCALL:
+ case NODE_FCALL:
+ val = self;
+ goto check_bound;
+
+ case NODE_ATTRASGN:
+ val = self;
+ if (node->nd_recv == (NODE *)1) goto check_bound;
+ case NODE_CALL:
+ PUSH_TAG(PROT_NONE);
+ if ((state = EXEC_TAG()) == 0) {
+ val = rb_eval(self, node->nd_recv);
+ }
+ POP_TAG();
+ if (state) {
+ ruby_errinfo = Qnil;
+ return 0;
+ }
+ check_bound:
+ {
+ int call = nd_type(node)==NODE_CALL;
+
+ val = CLASS_OF(val);
+ if (call) {
+ int noex;
+ ID id = node->nd_mid;
+
+ if (!rb_get_method_body(&val, &id, &noex))
+ break;
+ if ((noex & NOEX_PRIVATE))
+ break;
+ if ((noex & NOEX_PROTECTED) &&
+ !rb_obj_is_kind_of(self, rb_class_real(val)))
+ break;
+ }
+ else if (!rb_method_boundp(val, node->nd_mid, call))
break;
+ return arg_defined(self, node->nd_args, buf,
+ nd_type(node) == NODE_ATTRASGN ?
+ "assignment" : "method");
+ }
+ break;
+
+ case NODE_MATCH2:
+ case NODE_MATCH3:
+ return "method";
+
+ case NODE_YIELD:
+ if (rb_block_given_p()) {
+ return "yield";
+ }
+ break;
+
+ case NODE_SELF:
+ return "self";
+
+ case NODE_NIL:
+ return "nil";
+
+ case NODE_TRUE:
+ return "true";
+
+ case NODE_FALSE:
+ return "false";
+
+ case NODE_ATTRSET:
+ case NODE_OP_ASGN1:
+ case NODE_OP_ASGN2:
+ case NODE_OP_ASGN_OR:
+ case NODE_OP_ASGN_AND:
+ case NODE_MASGN:
+ case NODE_LASGN:
+ case NODE_DASGN:
+ case NODE_DASGN_CURR:
+ case NODE_GASGN:
+ case NODE_IASGN:
+ case NODE_CDECL:
+ case NODE_CVDECL:
+ case NODE_CVASGN:
+ return "assignment";
+
+ case NODE_LVAR:
+ return "local-variable";
+ case NODE_DVAR:
+ return "local-variable(in-block)";
+
+ case NODE_GVAR:
+ if (rb_gvar_defined(node->nd_entry)) {
+ return "global-variable";
+ }
+ break;
+
+ case NODE_IVAR:
+ if (rb_ivar_defined(self, node->nd_vid)) {
+ return "instance-variable";
+ }
+ break;
+
+ case NODE_CONST:
+ if (ev_const_defined(ruby_cref, node->nd_vid, self)) {
+ return "constant";
+ }
+ break;
+
+ case NODE_CVAR:
+ if (rb_cvar_defined(cvar_cbase(), node->nd_vid)) {
+ return "class variable";
+ }
+ break;
+
+ case NODE_COLON2:
+ PUSH_TAG(PROT_NONE);
+ if ((state = EXEC_TAG()) == 0) {
+ val = rb_eval(self, node->nd_head);
+ }
+ POP_TAG();
+ if (state) {
+ ruby_errinfo = Qnil;
+ return 0;
+ }
+ else {
+ switch (TYPE(val)) {
case T_CLASS:
- desc = "class";
+ case T_MODULE:
+ if (rb_const_defined_from(val, node->nd_mid))
+ return "constant";
break;
+ default:
+ if (rb_method_boundp(CLASS_OF(val), node->nd_mid, 1)) {
+ return "method";
+ }
}
}
- rb_error_frozen(desc);
+ break;
+
+ case NODE_COLON3:
+ if (rb_const_defined_from(rb_cObject, node->nd_mid)) {
+ return "constant";
+ }
+ break;
+
+ case NODE_NTH_REF:
+ if (RTEST(rb_reg_nth_defined(node->nd_nth, MATCH_DATA))) {
+ sprintf(buf, "$%d", (int)node->nd_nth);
+ return buf;
+ }
+ break;
+
+ case NODE_BACK_REF:
+ if (RTEST(rb_reg_nth_defined(0, MATCH_DATA))) {
+ sprintf(buf, "$%c", (char)node->nd_nth);
+ return buf;
+ }
+ break;
+
+ case NODE_NEWLINE:
+ node = node->nd_next;
+ goto again;
+
+ default:
+ PUSH_TAG(PROT_NONE);
+ if ((state = EXEC_TAG()) == 0) {
+ rb_eval(self, node);
+ }
+ POP_TAG();
+ if (!state) {
+ return "expression";
+ }
+ ruby_errinfo = Qnil;
+ break;
+ }
+ return 0;
+}
+
+static int handle_rescue _((VALUE,NODE*));
+
+static void blk_free();
+
+static VALUE
+rb_obj_is_proc(proc)
+ VALUE proc;
+{
+ if (TYPE(proc) == T_DATA && RDATA(proc)->dfree == (RUBY_DATA_FUNC)blk_free) {
+ return Qtrue;
+ }
+ return Qfalse;
+}
+
+void
+rb_add_event_hook(func, events)
+ rb_event_hook_func_t func;
+ rb_event_t events;
+{
+ rb_event_hook_t *hook;
+
+ hook = ALLOC(rb_event_hook_t);
+ hook->func = func;
+ hook->events = events;
+ hook->next = event_hooks;
+ event_hooks = hook;
+}
+
+int
+rb_remove_event_hook(func)
+ rb_event_hook_func_t func;
+{
+ rb_event_hook_t *prev, *hook;
+
+ prev = NULL;
+ hook = event_hooks;
+ while (hook) {
+ if (hook->func == func) {
+ if (prev) {
+ prev->next = hook->next;
+ }
+ else {
+ event_hooks = hook->next;
+ }
+ xfree(hook);
+ return 0;
+ }
+ prev = hook;
+ hook = hook->next;
+ }
+ return -1;
+}
+
+/*
+ * call-seq:
+ * set_trace_func(proc) => proc
+ * set_trace_func(nil) => nil
+ *
+ * Establishes _proc_ as the handler for tracing, or disables
+ * tracing if the parameter is +nil+. _proc_ takes up
+ * to six parameters: an event name, a filename, a line number, an
+ * object id, a binding, and the name of a class. _proc_ is
+ * invoked whenever an event occurs. Events are: <code>c-call</code>
+ * (call a C-language routine), <code>c-return</code> (return from a
+ * C-language routine), <code>call</code> (call a Ruby method),
+ * <code>class</code> (start a class or module definition),
+ * <code>end</code> (finish a class or module definition),
+ * <code>line</code> (execute code on a new line), <code>raise</code>
+ * (raise an exception), and <code>return</code> (return from a Ruby
+ * method). Tracing is disabled within the context of _proc_.
+ *
+ * class Test
+ * def test
+ * a = 1
+ * b = 2
+ * end
+ * end
+ *
+ * set_trace_func proc { |event, file, line, id, binding, classname|
+ * printf "%8s %s:%-2d %10s %8s\n", event, file, line, id, classname
+ * }
+ * t = Test.new
+ * t.test
+ *
+ * line prog.rb:11 false
+ * c-call prog.rb:11 new Class
+ * c-call prog.rb:11 initialize Object
+ * c-return prog.rb:11 initialize Object
+ * c-return prog.rb:11 new Class
+ * line prog.rb:12 false
+ * call prog.rb:2 test Test
+ * line prog.rb:3 test Test
+ * line prog.rb:4 test Test
+ * return prog.rb:4 test Test
+ */
+
+
+static VALUE
+set_trace_func(obj, trace)
+ VALUE obj, trace;
+{
+ rb_event_hook_t *hook;
+
+ rb_secure(4);
+ if (NIL_P(trace)) {
+ trace_func = 0;
+ rb_remove_event_hook(call_trace_func);
+ return Qnil;
+ }
+ if (!rb_obj_is_proc(trace)) {
+ rb_raise(rb_eTypeError, "trace_func needs to be Proc");
+ }
+ trace_func = trace;
+ for (hook = event_hooks; hook; hook = hook->next) {
+ if (hook->func == call_trace_func)
+ return trace;
+ }
+ rb_add_event_hook(call_trace_func, RUBY_EVENT_ALL);
+ return trace;
+}
+
+static const char *
+get_event_name(rb_event_t event)
+{
+ switch (event) {
+ case RUBY_EVENT_LINE:
+ return "line";
+ case RUBY_EVENT_CLASS:
+ return "class";
+ case RUBY_EVENT_END:
+ return "end";
+ case RUBY_EVENT_CALL:
+ return "call";
+ case RUBY_EVENT_RETURN:
+ return "return";
+ case RUBY_EVENT_C_CALL:
+ return "c-call";
+ case RUBY_EVENT_C_RETURN:
+ return "c-return";
+ case RUBY_EVENT_RAISE:
+ return "raise";
+ default:
+ return "unknown";
+ }
+}
+
+static void
+call_trace_func(event, node, self, id, klass)
+ rb_event_t event;
+ NODE *node;
+ VALUE self;
+ ID id;
+ VALUE klass; /* OK */
+{
+ int state, raised;
+ struct FRAME *prev;
+ NODE *node_save;
+ VALUE srcfile;
+ const char *event_name;
+ rb_thread_t th = curr_thread;
+
+ if (!trace_func) return;
+ if (tracing) return;
+ if (ruby_in_compile) return;
+ if (id == ID_ALLOCATOR) return;
+
+ if (!(node_save = ruby_current_node)) {
+ node_save = NEW_NEWLINE(0);
+ }
+ tracing = 1;
+ prev = ruby_frame;
+ PUSH_FRAME();
+ *ruby_frame = *prev;
+ ruby_frame->prev = prev;
+ ruby_frame->iter = 0; /* blocks not available anyway */
+
+ if (node) {
+ ruby_current_node = node;
+ ruby_frame->node = node;
+ ruby_sourcefile = node->nd_file;
+ ruby_sourceline = nd_line(node);
+ }
+ if (klass) {
+ if (TYPE(klass) == T_ICLASS) {
+ klass = RBASIC(klass)->klass;
+ }
+ else if (FL_TEST(klass, FL_SINGLETON)) {
+ klass = rb_iv_get(klass, "__attached__");
+ }
+ }
+ PUSH_TAG(PROT_NONE);
+ raised = rb_thread_reset_raised(th);
+ if ((state = EXEC_TAG()) == 0) {
+ srcfile = rb_str_new2(ruby_sourcefile?ruby_sourcefile:"(ruby)");
+ event_name = get_event_name(event);
+ proc_invoke(trace_func, rb_ary_new3(6, rb_str_new2(event_name),
+ srcfile,
+ INT2FIX(ruby_sourceline),
+ id?ID2SYM(id):Qnil,
+ self?rb_f_binding(self):Qnil,
+ klass),
+ Qundef, 0);
+ }
+ if (raised) rb_thread_set_raised(th);
+ POP_TAG();
+ POP_FRAME();
+
+ tracing = 0;
+ ruby_current_node = node_save;
+ SET_CURRENT_SOURCE();
+ if (state) JUMP_TAG(state);
+}
+
+static VALUE
+avalue_to_svalue(v)
+ VALUE v;
+{
+ VALUE tmp, top;
+
+ tmp = rb_check_array_type(v);
+ if (NIL_P(tmp)) {
+ return v;
+ }
+ if (RARRAY(tmp)->len == 0) {
+ return Qundef;
+ }
+ if (RARRAY(tmp)->len == 1) {
+ top = rb_check_array_type(RARRAY(tmp)->ptr[0]);
+ if (NIL_P(top)) {
+ return RARRAY(tmp)->ptr[0];
+ }
+ if (RARRAY(top)->len > 1) {
+ return v;
+ }
+ return top;
+ }
+ return tmp;
+}
+
+static VALUE
+svalue_to_avalue(v)
+ VALUE v;
+{
+ VALUE tmp, top;
+
+ if (v == Qundef) return rb_ary_new2(0);
+ tmp = rb_check_array_type(v);
+ if (NIL_P(tmp)) {
+ return rb_ary_new3(1, v);
+ }
+ if (RARRAY(tmp)->len == 1) {
+ top = rb_check_array_type(RARRAY(tmp)->ptr[0]);
+ if (!NIL_P(top) && RARRAY(top)->len > 1) {
+ return tmp;
+ }
+ return rb_ary_new3(1, v);
+ }
+ return tmp;
+}
+
+static VALUE
+svalue_to_mrhs(v, lhs)
+ VALUE v;
+ NODE *lhs;
+{
+ VALUE tmp;
+
+ if (v == Qundef) return rb_ary_new2(0);
+ tmp = rb_check_array_type(v);
+ if (NIL_P(tmp)) {
+ return rb_ary_new3(1, v);
+ }
+ /* no lhs means splat lhs only */
+ if (!lhs) {
+ return rb_ary_new3(1, v);
+ }
+ return tmp;
+}
+
+static VALUE
+avalue_splat(v)
+ VALUE v;
+{
+ if (RARRAY(v)->len == 0) {
+ return Qundef;
+ }
+ if (RARRAY(v)->len == 1) {
+ return RARRAY(v)->ptr[0];
+ }
+ return v;
+}
+
+#if 1
+VALUE
+rb_Array(val)
+ VALUE val;
+{
+ VALUE tmp = rb_check_array_type(val);
+
+ if (NIL_P(tmp)) {
+ /* hack to avoid invoke Object#to_a */
+ VALUE origin;
+ ID id = rb_intern("to_a");
+
+ if (search_method(CLASS_OF(val), id, &origin) &&
+ RCLASS(origin)->m_tbl != RCLASS(rb_mKernel)->m_tbl) { /* exclude Kernel#to_a */
+ val = rb_funcall(val, id, 0);
+ if (TYPE(val) != T_ARRAY) {
+ rb_raise(rb_eTypeError, "`to_a' did not return Array");
+ }
+ return val;
+ }
+ else {
+ return rb_ary_new3(1, val);
+ }
+ }
+ return tmp;
+}
+#endif
+
+static VALUE
+splat_value(v)
+ VALUE v;
+{
+ if (NIL_P(v)) return rb_ary_new3(1, Qnil);
+ return rb_Array(v);
+}
+
+static VALUE
+class_prefix(self, cpath)
+ VALUE self;
+ NODE *cpath;
+{
+ if (!cpath) {
+ rb_bug("class path missing");
+ }
+ if (cpath->nd_head) {
+ VALUE c = rb_eval(self, cpath->nd_head);
+ switch (TYPE(c)) {
+ case T_CLASS:
+ case T_MODULE:
+ break;
+ default:
+ rb_raise(rb_eTypeError, "%s is not a class/module",
+ RSTRING(rb_obj_as_string(c))->ptr);
+ }
+ return c;
+ }
+ else if (nd_type(cpath) == NODE_COLON2) {
+ return ruby_cbase;
+ }
+ else if (ruby_wrapper) {
+ return ruby_wrapper;
+ }
+ else {
+ return rb_cObject;
+ }
+}
+
+#define return_value(v) do {\
+ if ((prot_tag->retval = (v)) == Qundef) {\
+ prot_tag->retval = Qnil;\
+ }\
+} while (0)
+
+NORETURN(static void return_jump _((VALUE)));
+NORETURN(static void break_jump _((VALUE)));
+NORETURN(static void next_jump _((VALUE)));
+NORETURN(static void unknown_node _((NODE * volatile)));
+
+static void
+unknown_node(node)
+ NODE *volatile node;
+{
+ ruby_current_node = 0;
+ if (node->flags == 0) {
+ rb_bug("terminated node (0x%lx)", node);
+ }
+ else if (BUILTIN_TYPE(node) != T_NODE) {
+ rb_bug("not a node 0x%02lx (0x%lx)", BUILTIN_TYPE(node), node);
+ }
+ else {
+ rb_bug("unknown node type %d (0x%lx)", nd_type(node), node);
+ }
+}
+
+static VALUE
+rb_eval(self, n)
+ VALUE self;
+ NODE *n;
+{
+ NODE * volatile contnode = 0;
+ NODE * volatile node = n;
+ int state;
+ volatile VALUE result = Qnil;
+ st_data_t data;
+
+#define RETURN(v) do { \
+ result = (v); \
+ goto finish; \
+} while (0)
+
+ again:
+ if (!node) RETURN(Qnil);
+
+ ruby_current_node = node;
+ switch (nd_type(node)) {
+ case NODE_BLOCK:
+ if (contnode) {
+ result = rb_eval(self, node);
+ break;
+ }
+ contnode = node->nd_next;
+ node = node->nd_head;
+ goto again;
+
+ case NODE_POSTEXE:
+ rb_f_END();
+ nd_set_type(node, NODE_NIL); /* exec just once */
+ result = Qnil;
+ break;
+
+ /* begin .. end without clauses */
+ case NODE_BEGIN:
+ node = node->nd_body;
+ goto again;
+
+ /* nodes for speed-up(default match) */
+ case NODE_MATCH:
+ result = rb_reg_match2(node->nd_lit);
+ break;
+
+ /* nodes for speed-up(literal match) */
+ case NODE_MATCH2:
+ {
+ VALUE l = rb_eval(self,node->nd_recv);
+ VALUE r = rb_eval(self,node->nd_value);
+ result = rb_reg_match(l, r);
+ }
+ break;
+
+ /* nodes for speed-up(literal match) */
+ case NODE_MATCH3:
+ {
+ VALUE r = rb_eval(self,node->nd_recv);
+ VALUE l = rb_eval(self,node->nd_value);
+ if (TYPE(l) == T_STRING) {
+ result = rb_reg_match(r, l);
+ }
+ else {
+ result = rb_funcall(l, match, 1, r);
+ }
+ }
+ break;
+
+ /* node for speed-up(top-level loop for -n/-p) */
+ case NODE_OPT_N:
+ PUSH_TAG(PROT_LOOP);
+ switch (state = EXEC_TAG()) {
+ case 0:
+ opt_n_next:
+ while (!NIL_P(rb_gets())) {
+ opt_n_redo:
+ rb_eval(self, node->nd_body);
+ }
+ break;
+
+ case TAG_REDO:
+ state = 0;
+ goto opt_n_redo;
+ case TAG_NEXT:
+ state = 0;
+ goto opt_n_next;
+ case TAG_BREAK:
+ state = 0;
+ default:
+ break;
+ }
+ POP_TAG();
+ if (state) JUMP_TAG(state);
+ RETURN(Qnil);
+
+ case NODE_SELF:
+ RETURN(self);
+
+ case NODE_NIL:
+ RETURN(Qnil);
+
+ case NODE_TRUE:
+ RETURN(Qtrue);
+
+ case NODE_FALSE:
+ RETURN(Qfalse);
+
+ case NODE_IF:
+ if (RTEST(rb_eval(self, node->nd_cond))) {
+ EXEC_EVENT_HOOK(RUBY_EVENT_LINE, node, self,
+ ruby_frame->last_func,
+ ruby_frame->last_class);
+ node = node->nd_body;
+ }
+ else {
+ EXEC_EVENT_HOOK(RUBY_EVENT_LINE, node, self,
+ ruby_frame->last_func,
+ ruby_frame->last_class);
+ node = node->nd_else;
+ }
+ goto again;
+
+ case NODE_WHEN:
+ while (node) {
+ NODE *tag;
+
+ if (nd_type(node) != NODE_WHEN) goto again;
+ tag = node->nd_head;
+ while (tag) {
+ EXEC_EVENT_HOOK(RUBY_EVENT_LINE, tag, self,
+ ruby_frame->last_func,
+ ruby_frame->last_class);
+ if (tag->nd_head && nd_type(tag->nd_head) == NODE_WHEN) {
+ VALUE v = rb_eval(self, tag->nd_head->nd_head);
+ long i;
+
+ if (TYPE(v) != T_ARRAY) v = rb_ary_to_ary(v);
+ for (i=0; i<RARRAY(v)->len; i++) {
+ if (RTEST(RARRAY(v)->ptr[i])) {
+ node = node->nd_body;
+ goto again;
+ }
+ }
+ tag = tag->nd_next;
+ continue;
+ }
+ if (RTEST(rb_eval(self, tag->nd_head))) {
+ node = node->nd_body;
+ goto again;
+ }
+ tag = tag->nd_next;
+ }
+ node = node->nd_next;
+ }
+ RETURN(Qnil);
+
+ case NODE_CASE:
+ {
+ VALUE val;
+
+ val = rb_eval(self, node->nd_head);
+ node = node->nd_body;
+ while (node) {
+ NODE *tag;
+
+ if (nd_type(node) != NODE_WHEN) {
+ goto again;
+ }
+ tag = node->nd_head;
+ while (tag) {
+ EXEC_EVENT_HOOK(RUBY_EVENT_LINE, tag, self,
+ ruby_frame->last_func,
+ ruby_frame->last_class);
+ if (tag->nd_head && nd_type(tag->nd_head) == NODE_WHEN) {
+ VALUE v = rb_eval(self, tag->nd_head->nd_head);
+ long i;
+
+ if (TYPE(v) != T_ARRAY) v = rb_ary_to_ary(v);
+ for (i=0; i<RARRAY(v)->len; i++) {
+ if (RTEST(rb_funcall2(RARRAY(v)->ptr[i], eqq, 1, &val))){
+ node = node->nd_body;
+ goto again;
+ }
+ }
+ tag = tag->nd_next;
+ continue;
+ }
+ if (RTEST(rb_funcall2(rb_eval(self, tag->nd_head), eqq, 1, &val))) {
+ node = node->nd_body;
+ goto again;
+ }
+ tag = tag->nd_next;
+ }
+ node = node->nd_next;
+ }
+ }
+ RETURN(Qnil);
+
+ case NODE_WHILE:
+ PUSH_TAG(PROT_LOOP);
+ result = Qnil;
+ switch (state = EXEC_TAG()) {
+ case 0:
+ if (node->nd_state && !RTEST(rb_eval(self, node->nd_cond)))
+ goto while_out;
+ do {
+ while_redo:
+ rb_eval(self, node->nd_body);
+ while_next:
+ ;
+ } while (RTEST(rb_eval(self, node->nd_cond)));
+ break;
+
+ case TAG_REDO:
+ state = 0;
+ goto while_redo;
+ case TAG_NEXT:
+ state = 0;
+ goto while_next;
+ case TAG_BREAK:
+ if (TAG_DST()) {
+ state = 0;
+ result = prot_tag->retval;
+ }
+ /* fall through */
+ default:
+ break;
+ }
+ while_out:
+ POP_TAG();
+ if (state) JUMP_TAG(state);
+ RETURN(result);
+
+ case NODE_UNTIL:
+ PUSH_TAG(PROT_LOOP);
+ result = Qnil;
+ switch (state = EXEC_TAG()) {
+ case 0:
+ if (node->nd_state && RTEST(rb_eval(self, node->nd_cond)))
+ goto until_out;
+ do {
+ until_redo:
+ rb_eval(self, node->nd_body);
+ until_next:
+ ;
+ } while (!RTEST(rb_eval(self, node->nd_cond)));
+ break;
+
+ case TAG_REDO:
+ state = 0;
+ goto until_redo;
+ case TAG_NEXT:
+ state = 0;
+ goto until_next;
+ case TAG_BREAK:
+ if (TAG_DST()) {
+ state = 0;
+ result = prot_tag->retval;
+ }
+ /* fall through */
+ default:
+ break;
+ }
+ until_out:
+ POP_TAG();
+ if (state) JUMP_TAG(state);
+ RETURN(result);
+
+ case NODE_BLOCK_PASS:
+ result = block_pass(self, node);
+ break;
+
+ case NODE_ITER:
+ case NODE_FOR:
+ {
+ PUSH_TAG(PROT_LOOP);
+ PUSH_BLOCK(node->nd_var, node->nd_body);
+
+ state = EXEC_TAG();
+ if (state == 0) {
+ iter_retry:
+ PUSH_ITER(ITER_PRE);
+ if (nd_type(node) == NODE_ITER) {
+ result = rb_eval(self, node->nd_iter);
+ }
+ else {
+ VALUE recv;
+
+ _block.flags &= ~BLOCK_D_SCOPE;
+ BEGIN_CALLARGS;
+ recv = rb_eval(self, node->nd_iter);
+ END_CALLARGS;
+ ruby_current_node = node;
+ SET_CURRENT_SOURCE();
+ result = rb_call(CLASS_OF(recv),recv,each,0,0,0,self);
+ }
+ POP_ITER();
+ }
+ else if (state == TAG_BREAK && TAG_DST()) {
+ result = prot_tag->retval;
+ state = 0;
+ }
+ else if (state == TAG_RETRY) {
+ state = 0;
+ goto iter_retry;
+ }
+ POP_BLOCK();
+ POP_TAG();
+ switch (state) {
+ case 0:
+ break;
+ default:
+ JUMP_TAG(state);
+ }
+ }
+ break;
+
+ case NODE_BREAK:
+ break_jump(rb_eval(self, node->nd_stts));
+ break;
+
+ case NODE_NEXT:
+ CHECK_INTS;
+ next_jump(rb_eval(self, node->nd_stts));
+ break;
+
+ case NODE_REDO:
+ CHECK_INTS;
+ JUMP_TAG(TAG_REDO);
+ break;
+
+ case NODE_RETRY:
+ CHECK_INTS;
+ JUMP_TAG(TAG_RETRY);
+ break;
+
+ case NODE_SPLAT:
+ result = splat_value(rb_eval(self, node->nd_head));
+ break;
+
+ case NODE_TO_ARY:
+ result = rb_ary_to_ary(rb_eval(self, node->nd_head));
+ break;
+
+ case NODE_SVALUE:
+ result = avalue_splat(rb_eval(self, node->nd_head));
+ if (result == Qundef) result = Qnil;
+ break;
+
+ case NODE_YIELD:
+ if (node->nd_head) {
+ result = rb_eval(self, node->nd_head);
+ ruby_current_node = node;
+ }
+ else {
+ result = Qundef; /* no arg */
+ }
+ SET_CURRENT_SOURCE();
+ result = rb_yield_0(result, 0, 0, 0, node->nd_state);
+ break;
+
+ case NODE_RESCUE:
+ {
+ volatile VALUE e_info = ruby_errinfo;
+ volatile int rescuing = 0;
+
+ PUSH_TAG(PROT_NONE);
+ if ((state = EXEC_TAG()) == 0) {
+ retry_entry:
+ result = rb_eval(self, node->nd_head);
+ }
+ else if (rescuing) {
+ if (rescuing < 0) {
+ /* in rescue argument, just reraise */
+ }
+ else if (state == TAG_RETRY) {
+ rescuing = state = 0;
+ ruby_errinfo = e_info;
+ goto retry_entry;
+ }
+ else if (state != TAG_RAISE) {
+ result = prot_tag->retval;
+ }
+ }
+ else if (state == TAG_RAISE) {
+ NODE *resq = node->nd_resq;
+
+ rescuing = -1;
+ while (resq) {
+ ruby_current_node = resq;
+ if (handle_rescue(self, resq)) {
+ state = 0;
+ rescuing = 1;
+ result = rb_eval(self, resq->nd_body);
+ break;
+ }
+ resq = resq->nd_head; /* next rescue */
+ }
+ }
+ else {
+ result = prot_tag->retval;
+ }
+ POP_TAG();
+ if (state != TAG_RAISE) ruby_errinfo = e_info;
+ if (state) {
+ JUMP_TAG(state);
+ }
+ /* no exception raised */
+ if (!rescuing && (node = node->nd_else)) { /* else clause given */
+ goto again;
+ }
+ }
+ break;
+
+ case NODE_ENSURE:
+ PUSH_TAG(PROT_NONE);
+ if ((state = EXEC_TAG()) == 0) {
+ result = rb_eval(self, node->nd_head);
+ }
+ POP_TAG();
+ if (node->nd_ensr && !thread_no_ensure()) {
+ VALUE retval = prot_tag->retval; /* save retval */
+ VALUE errinfo = ruby_errinfo;
+
+ rb_eval(self, node->nd_ensr);
+ return_value(retval);
+ ruby_errinfo = errinfo;
+ }
+ if (state) JUMP_TAG(state);
+ break;
+
+ case NODE_AND:
+ result = rb_eval(self, node->nd_1st);
+ if (!RTEST(result)) break;
+ node = node->nd_2nd;
+ goto again;
+
+ case NODE_OR:
+ result = rb_eval(self, node->nd_1st);
+ if (RTEST(result)) break;
+ node = node->nd_2nd;
+ goto again;
+
+ case NODE_NOT:
+ if (RTEST(rb_eval(self, node->nd_body))) result = Qfalse;
+ else result = Qtrue;
+ break;
+
+ case NODE_DOT2:
+ case NODE_DOT3:
+ {
+ VALUE beg = rb_eval(self, node->nd_beg);
+ VALUE end = rb_eval(self, node->nd_end);
+ result = rb_range_new(beg, end, nd_type(node) == NODE_DOT3);
+ }
+ break;
+
+ case NODE_FLIP2: /* like AWK */
+ {
+ VALUE *flip = rb_svar(node->nd_cnt);
+ if (!flip) rb_bug("unexpected local variable");
+ if (!RTEST(*flip)) {
+ if (RTEST(rb_eval(self, node->nd_beg))) {
+ *flip = RTEST(rb_eval(self, node->nd_end))?Qfalse:Qtrue;
+ result = Qtrue;
+ }
+ else {
+ result = Qfalse;
+ }
+ }
+ else {
+ if (RTEST(rb_eval(self, node->nd_end))) {
+ *flip = Qfalse;
+ }
+ result = Qtrue;
+ }
+ }
+ break;
+
+ case NODE_FLIP3: /* like SED */
+ {
+ VALUE *flip = rb_svar(node->nd_cnt);
+ if (!flip) rb_bug("unexpected local variable");
+ if (!RTEST(*flip)) {
+ result = RTEST(rb_eval(self, node->nd_beg)) ? Qtrue : Qfalse;
+ *flip = result;
+ }
+ else {
+ if (RTEST(rb_eval(self, node->nd_end))) {
+ *flip = Qfalse;
+ }
+ result = Qtrue;
+ }
+ }
+ break;
+
+ case NODE_RETURN:
+ return_jump(rb_eval(self, node->nd_stts));
+ break;
+
+ case NODE_ARGSCAT:
+ {
+ VALUE args = rb_eval(self, node->nd_head);
+ result = rb_ary_concat(args, splat_value(rb_eval(self, node->nd_body)));
+ }
+ break;
+
+ case NODE_ARGSPUSH:
+ {
+ VALUE args = rb_ary_dup(rb_eval(self, node->nd_head));
+ result = rb_ary_push(args, rb_eval(self, node->nd_body));
+ }
+ break;
+
+ case NODE_ATTRASGN:
+ {
+ VALUE recv;
+ int argc; VALUE *argv; /* used in SETUP_ARGS */
+ int scope;
+ TMP_PROTECT;
+
+ BEGIN_CALLARGS;
+ if (node->nd_recv == (NODE *)1) {
+ recv = self;
+ scope = 1;
+ }
+ else {
+ recv = rb_eval(self, node->nd_recv);
+ scope = 0;
+ }
+ SETUP_ARGS(node->nd_args);
+ END_CALLARGS;
+
+ ruby_current_node = node;
+ SET_CURRENT_SOURCE();
+ rb_call(CLASS_OF(recv),recv,node->nd_mid,argc,argv,scope,self);
+ result = argv[argc-1];
+ }
+ break;
+
+ case NODE_CALL:
+ {
+ VALUE recv;
+ int argc; VALUE *argv; /* used in SETUP_ARGS */
+ TMP_PROTECT;
+
+ BEGIN_CALLARGS;
+ recv = rb_eval(self, node->nd_recv);
+ SETUP_ARGS(node->nd_args);
+ END_CALLARGS;
+
+ ruby_current_node = node;
+ SET_CURRENT_SOURCE();
+ result = rb_call(CLASS_OF(recv),recv,node->nd_mid,argc,argv,0,self);
+ }
+ break;
+
+ case NODE_FCALL:
+ {
+ int argc; VALUE *argv; /* used in SETUP_ARGS */
+ TMP_PROTECT;
+
+ BEGIN_CALLARGS;
+ SETUP_ARGS(node->nd_args);
+ END_CALLARGS;
+
+ ruby_current_node = node;
+ SET_CURRENT_SOURCE();
+ result = rb_call(CLASS_OF(self),self,node->nd_mid,argc,argv,1,self);
+ }
+ break;
+
+ case NODE_VCALL:
+ SET_CURRENT_SOURCE();
+ result = rb_call(CLASS_OF(self),self,node->nd_mid,0,0,2,self);
+ break;
+
+ case NODE_SUPER:
+ case NODE_ZSUPER:
+ {
+ int argc; VALUE *argv; /* used in SETUP_ARGS */
+ TMP_PROTECT;
+
+ if (ruby_frame->last_class == 0) {
+ if (ruby_frame->last_func) {
+ rb_name_error(ruby_frame->last_func,
+ "superclass method `%s' disabled",
+ rb_id2name(ruby_frame->orig_func));
+ }
+ else {
+ rb_raise(rb_eNoMethodError, "super called outside of method");
+ }
+ }
+ if (nd_type(node) == NODE_ZSUPER) {
+ argc = ruby_frame->argc;
+ if (argc && DMETHOD_P()) {
+ if (TYPE(RBASIC(ruby_scope)->klass) != T_ARRAY ||
+ RARRAY(RBASIC(ruby_scope)->klass)->len != argc) {
+ rb_raise(rb_eRuntimeError,
+ "super: specify arguments explicitly");
+ }
+ argv = RARRAY(RBASIC(ruby_scope)->klass)->ptr;
+ }
+ else if (!ruby_scope->local_vars) {
+ argc = 0;
+ argv = 0;
+ }
+ else {
+ argv = ruby_scope->local_vars + 2;
+ }
+ }
+ else {
+ BEGIN_CALLARGS;
+ SETUP_ARGS(node->nd_args);
+ END_CALLARGS;
+ ruby_current_node = node;
+ }
+
+ SET_CURRENT_SOURCE();
+ result = rb_call_super(argc, argv);
+ }
+ break;
+
+ case NODE_SCOPE:
+ {
+ struct FRAME frame;
+ NODE *saved_cref = 0;
+
+ frame = *ruby_frame;
+ frame.tmp = ruby_frame;
+ ruby_frame = &frame;
+
+ PUSH_SCOPE();
+ PUSH_TAG(PROT_NONE);
+ if (node->nd_rval) {
+ saved_cref = ruby_cref;
+ ruby_cref = (NODE*)node->nd_rval;
+ }
+ if (node->nd_tbl) {
+ VALUE *vars = ALLOCA_N(VALUE, node->nd_tbl[0]+1);
+ *vars++ = (VALUE)node;
+ ruby_scope->local_vars = vars;
+ rb_mem_clear(ruby_scope->local_vars, node->nd_tbl[0]);
+ ruby_scope->local_tbl = node->nd_tbl;
+ }
+ else {
+ ruby_scope->local_vars = 0;
+ ruby_scope->local_tbl = 0;
+ }
+ if ((state = EXEC_TAG()) == 0) {
+ result = rb_eval(self, node->nd_next);
+ }
+ POP_TAG();
+ POP_SCOPE();
+ ruby_frame = frame.tmp;
+ if (saved_cref)
+ ruby_cref = saved_cref;
+ if (state) JUMP_TAG(state);
+ }
+ break;
+
+ case NODE_OP_ASGN1:
+ {
+ int argc; VALUE *argv; /* used in SETUP_ARGS */
+ VALUE recv, val, tmp;
+ NODE *rval;
+ TMP_PROTECT;
+
+ recv = rb_eval(self, node->nd_recv);
+ rval = node->nd_args->nd_head;
+ SETUP_ARGS0(node->nd_args->nd_body, 1);
+ val = rb_funcall3(recv, aref, argc, argv);
+ switch (node->nd_mid) {
+ case 0: /* OR */
+ if (RTEST(val)) RETURN(val);
+ val = rb_eval(self, rval);
+ break;
+ case 1: /* AND */
+ if (!RTEST(val)) RETURN(val);
+ val = rb_eval(self, rval);
+ break;
+ default:
+ tmp = rb_eval(self, rval);
+ val = rb_funcall3(val, node->nd_mid, 1, &tmp);
+ }
+ argv[argc] = val;
+ rb_funcall2(recv, aset, argc+1, argv);
+ result = val;
+ }
+ break;
+
+ case NODE_OP_ASGN2:
+ {
+ ID id = node->nd_next->nd_vid;
+ VALUE recv, val, tmp;
+
+ recv = rb_eval(self, node->nd_recv);
+ val = rb_funcall3(recv, id, 0, 0);
+ switch (node->nd_next->nd_mid) {
+ case 0: /* OR */
+ if (RTEST(val)) RETURN(val);
+ val = rb_eval(self, node->nd_value);
+ break;
+ case 1: /* AND */
+ if (!RTEST(val)) RETURN(val);
+ val = rb_eval(self, node->nd_value);
+ break;
+ default:
+ tmp = rb_eval(self, node->nd_value);
+ val = rb_funcall3(val, node->nd_next->nd_mid, 1, &tmp);
+ }
+
+ rb_funcall2(recv, node->nd_next->nd_aid, 1, &val);
+ result = val;
+ }
+ break;
+
+ case NODE_OP_ASGN_AND:
+ result = rb_eval(self, node->nd_head);
+ if (!RTEST(result)) break;
+ node = node->nd_value;
+ goto again;
+
+ case NODE_OP_ASGN_OR:
+ if ((node->nd_aid && !is_defined(self, node->nd_head, 0)) ||
+ !RTEST(result = rb_eval(self, node->nd_head))) {
+ node = node->nd_value;
+ goto again;
+ }
+ break;
+
+ case NODE_MASGN:
+ result = massign(self, node, rb_eval(self, node->nd_value), 0);
+ break;
+
+ case NODE_LASGN:
+ if (ruby_scope->local_vars == 0)
+ rb_bug("unexpected local variable assignment");
+ result = rb_eval(self, node->nd_value);
+ ruby_scope->local_vars[node->nd_cnt] = result;
+ break;
+
+ case NODE_DASGN:
+ result = rb_eval(self, node->nd_value);
+ dvar_asgn(node->nd_vid, result);
+ break;
+
+ case NODE_DASGN_CURR:
+ result = rb_eval(self, node->nd_value);
+ dvar_asgn_curr(node->nd_vid, result);
+ break;
+
+ case NODE_GASGN:
+ result = rb_eval(self, node->nd_value);
+ rb_gvar_set(node->nd_entry, result);
+ break;
+
+ case NODE_IASGN:
+ result = rb_eval(self, node->nd_value);
+ rb_ivar_set(self, node->nd_vid, result);
+ break;
+
+ case NODE_CDECL:
+ result = rb_eval(self, node->nd_value);
+ if (node->nd_vid == 0) {
+ rb_const_set(class_prefix(self, node->nd_else), node->nd_else->nd_mid, result);
+ }
+ else {
+ rb_const_set(ruby_cbase, node->nd_vid, result);
+ }
+ break;
+
+ case NODE_CVDECL:
+ if (NIL_P(ruby_cbase)) {
+ rb_raise(rb_eTypeError, "no class/module to define class variable");
+ }
+ result = rb_eval(self, node->nd_value);
+ rb_cvar_set(cvar_cbase(), node->nd_vid, result, Qtrue);
+ break;
+
+ case NODE_CVASGN:
+ result = rb_eval(self, node->nd_value);
+ rb_cvar_set(cvar_cbase(), node->nd_vid, result, Qfalse);
+ break;
+
+ case NODE_LVAR:
+ if (ruby_scope->local_vars == 0) {
+ rb_bug("unexpected local variable");
+ }
+ result = ruby_scope->local_vars[node->nd_cnt];
+ break;
+
+ case NODE_DVAR:
+ result = rb_dvar_ref(node->nd_vid);
+ break;
+
+ case NODE_GVAR:
+ result = rb_gvar_get(node->nd_entry);
+ break;
+
+ case NODE_IVAR:
+ result = rb_ivar_get(self, node->nd_vid);
+ break;
+
+ case NODE_CONST:
+ result = ev_const_get(ruby_cref, node->nd_vid, self);
+ break;
+
+ case NODE_CVAR:
+ result = rb_cvar_get(cvar_cbase(), node->nd_vid);
+ break;
+
+ case NODE_BLOCK_ARG:
+ if (ruby_scope->local_vars == 0)
+ rb_bug("unexpected block argument");
+ if (rb_block_given_p()) {
+ result = rb_block_proc();
+ ruby_scope->local_vars[node->nd_cnt] = result;
+ }
+ else {
+ result = Qnil;
+ }
+ break;
+
+ case NODE_COLON2:
+ {
+ VALUE klass;
+
+ klass = rb_eval(self, node->nd_head);
+ if (rb_is_const_id(node->nd_mid)) {
+ switch (TYPE(klass)) {
+ case T_CLASS:
+ case T_MODULE:
+ result = rb_const_get_from(klass, node->nd_mid);
+ break;
+ default:
+ rb_raise(rb_eTypeError, "%s is not a class/module",
+ RSTRING(rb_obj_as_string(klass))->ptr);
+ break;
+ }
+ }
+ else {
+ result = rb_funcall(klass, node->nd_mid, 0, 0);
+ }
+ }
+ break;
+
+ case NODE_COLON3:
+ result = rb_const_get_from(rb_cObject, node->nd_mid);
+ break;
+
+ case NODE_NTH_REF:
+ result = rb_reg_nth_match(node->nd_nth, MATCH_DATA);
+ break;
+
+ case NODE_BACK_REF:
+ switch (node->nd_nth) {
+ case '&':
+ result = rb_reg_last_match(MATCH_DATA);
+ break;
+ case '`':
+ result = rb_reg_match_pre(MATCH_DATA);
+ break;
+ case '\'':
+ result = rb_reg_match_post(MATCH_DATA);
+ break;
+ case '+':
+ result = rb_reg_match_last(MATCH_DATA);
+ break;
+ default:
+ rb_bug("unexpected back-ref");
+ }
+ break;
+
+ case NODE_HASH:
+ {
+ NODE *list;
+ VALUE hash = rb_hash_new();
+ VALUE key, val;
+
+ list = node->nd_head;
+ while (list) {
+ key = rb_eval(self, list->nd_head);
+ list = list->nd_next;
+ if (list == 0)
+ rb_bug("odd number list for Hash");
+ val = rb_eval(self, list->nd_head);
+ list = list->nd_next;
+ rb_hash_aset(hash, key, val);
+ }
+ result = hash;
+ }
+ break;
+
+ case NODE_ZARRAY: /* zero length list */
+ result = rb_ary_new();
+ break;
+
+ case NODE_ARRAY:
+ {
+ VALUE ary;
+ long i;
+
+ i = node->nd_alen;
+ ary = rb_ary_new2(i);
+ for (i=0;node;node=node->nd_next) {
+ RARRAY(ary)->ptr[i++] = rb_eval(self, node->nd_head);
+ RARRAY(ary)->len = i;
+ }
+
+ result = ary;
+ }
+ break;
+
+ case NODE_STR:
+ result = rb_str_new3(node->nd_lit);
+ break;
+
+ case NODE_EVSTR:
+ result = rb_obj_as_string(rb_eval(self, node->nd_body));
+ break;
+
+ case NODE_DSTR:
+ case NODE_DXSTR:
+ case NODE_DREGX:
+ case NODE_DREGX_ONCE:
+ case NODE_DSYM:
+ {
+ VALUE str, str2;
+ NODE *list = node->nd_next;
+
+ str = rb_str_new3(node->nd_lit);
+ while (list) {
+ if (list->nd_head) {
+ switch (nd_type(list->nd_head)) {
+ case NODE_STR:
+ str2 = list->nd_head->nd_lit;
+ break;
+ default:
+ str2 = rb_eval(self, list->nd_head);
+ break;
+ }
+ rb_str_append(str, str2);
+ OBJ_INFECT(str, str2);
+ }
+ list = list->nd_next;
+ }
+ switch (nd_type(node)) {
+ case NODE_DREGX:
+ result = rb_reg_new(RSTRING(str)->ptr, RSTRING(str)->len,
+ node->nd_cflag);
+ break;
+ case NODE_DREGX_ONCE: /* regexp expand once */
+ result = rb_reg_new(RSTRING(str)->ptr, RSTRING(str)->len,
+ node->nd_cflag);
+ nd_set_type(node, NODE_LIT);
+ node->nd_lit = result;
+ break;
+ case NODE_LIT:
+ /* other thread may replace NODE_DREGX_ONCE to NODE_LIT */
+ goto again;
+ case NODE_DXSTR:
+ result = rb_funcall(self, '`', 1, str);
+ break;
+ case NODE_DSYM:
+ result = rb_str_intern(str);
+ break;
+ default:
+ result = str;
+ break;
+ }
+ }
+ break;
+
+ case NODE_XSTR:
+ result = rb_funcall(self, '`', 1, rb_str_new3(node->nd_lit));
+ break;
+
+ case NODE_LIT:
+ result = node->nd_lit;
+ break;
+
+ case NODE_DEFN:
+ if (node->nd_defn) {
+ NODE *body, *defn;
+ VALUE origin = 0;
+ int noex;
+
+ if (NIL_P(ruby_class)) {
+ rb_raise(rb_eTypeError, "no class/module to add method");
+ }
+ if (ruby_class == rb_cObject && node->nd_mid == init) {
+ rb_warn("redefining Object#initialize may cause infinite loop");
+ }
+ if (node->nd_mid == __id__ || node->nd_mid == __send__) {
+ rb_warn("redefining `%s' may cause serious problem",
+ rb_id2name(node->nd_mid));
+ }
+ rb_frozen_class_p(ruby_class);
+ body = search_method(ruby_class, node->nd_mid, &origin);
+ if (body){
+ if (RTEST(ruby_verbose) && ruby_class == origin && body->nd_cnt == 0 && body->nd_body) {
+ rb_warning("method redefined; discarding old %s", rb_id2name(node->nd_mid));
+ }
+ }
+
+ if (SCOPE_TEST(SCOPE_PRIVATE) || node->nd_mid == init) {
+ noex = NOEX_PRIVATE;
+ }
+ else if (SCOPE_TEST(SCOPE_PROTECTED)) {
+ noex = NOEX_PROTECTED;
+ }
+ else {
+ noex = NOEX_PUBLIC;
+ }
+ if (body && origin == ruby_class && body->nd_body == 0) {
+ noex |= NOEX_NOSUPER;
+ }
+
+ defn = rb_copy_node_scope(node->nd_defn, ruby_cref);
+ rb_add_method(ruby_class, node->nd_mid, defn, noex);
+ if (scope_vmode == SCOPE_MODFUNC) {
+ rb_add_method(rb_singleton_class(ruby_class),
+ node->nd_mid, defn, NOEX_PUBLIC);
+ }
+ result = Qnil;
+ }
+ break;
+
+ case NODE_DEFS:
+ if (node->nd_defn) {
+ VALUE recv = rb_eval(self, node->nd_recv);
+ VALUE klass;
+ NODE *body = 0, *defn;
+
+ if (ruby_safe_level >= 4 && !OBJ_TAINTED(recv)) {
+ rb_raise(rb_eSecurityError, "Insecure: can't define singleton method");
+ }
+ if (FIXNUM_P(recv) || SYMBOL_P(recv)) {
+ rb_raise(rb_eTypeError,
+ "can't define singleton method \"%s\" for %s",
+ rb_id2name(node->nd_mid),
+ rb_obj_classname(recv));
+ }
+
+ if (OBJ_FROZEN(recv)) rb_error_frozen("object");
+ klass = rb_singleton_class(recv);
+ if (st_lookup(RCLASS(klass)->m_tbl, node->nd_mid, &data)) {
+ body = (NODE *)data;
+ if (ruby_safe_level >= 4) {
+ rb_raise(rb_eSecurityError, "redefining method prohibited");
+ }
+ if (RTEST(ruby_verbose)) {
+ rb_warning("redefine %s", rb_id2name(node->nd_mid));
+ }
+ }
+ defn = rb_copy_node_scope(node->nd_defn, ruby_cref);
+ rb_add_method(klass, node->nd_mid, defn,
+ NOEX_PUBLIC|(body?body->nd_noex&NOEX_UNDEF:0));
+ result = Qnil;
+ }
+ break;
+
+ case NODE_UNDEF:
+ if (NIL_P(ruby_class)) {
+ rb_raise(rb_eTypeError, "no class to undef method");
+ }
+ rb_undef(ruby_class, rb_to_id(rb_eval(self, node->u2.node)));
+ result = Qnil;
+ break;
+
+ case NODE_ALIAS:
+ if (NIL_P(ruby_class)) {
+ rb_raise(rb_eTypeError, "no class to make alias");
+ }
+ rb_alias(ruby_class, rb_to_id(rb_eval(self, node->u1.node)),
+ rb_to_id(rb_eval(self, node->u2.node)));
+ result = Qnil;
+ break;
+
+ case NODE_VALIAS:
+ rb_alias_variable(node->u1.id, node->u2.id);
+ result = Qnil;
+ break;
+
+ case NODE_CLASS:
+ {
+ VALUE super, klass, tmp, cbase;
+ ID cname;
+ int gen = Qfalse;
+
+ cbase = class_prefix(self, node->nd_cpath);
+ cname = node->nd_cpath->nd_mid;
+
+ if (NIL_P(ruby_cbase)) {
+ rb_raise(rb_eTypeError, "no outer class/module");
+ }
+ if (node->nd_super) {
+ super = rb_eval(self, node->nd_super);
+ rb_check_inheritable(super);
+ }
+ else {
+ super = 0;
+ }
+
+ if (rb_const_defined_at(cbase, cname)) {
+ klass = rb_const_get_at(cbase, cname);
+ if (TYPE(klass) != T_CLASS) {
+ rb_raise(rb_eTypeError, "%s is not a class",
+ rb_id2name(cname));
+ }
+ if (super) {
+ tmp = rb_class_real(RCLASS(klass)->super);
+ if (tmp != super) {
+ rb_raise(rb_eTypeError, "superclass mismatch for class %s",
+ rb_id2name(cname));
+ }
+ super = 0;
+ }
+ if (ruby_safe_level >= 4) {
+ rb_raise(rb_eSecurityError, "extending class prohibited");
+ }
+ }
+ else {
+ if (!super) super = rb_cObject;
+ klass = rb_define_class_id(cname, super);
+ rb_set_class_path(klass, cbase, rb_id2name(cname));
+ rb_const_set(cbase, cname, klass);
+ gen = Qtrue;
+ }
+ if (ruby_wrapper) {
+ rb_extend_object(klass, ruby_wrapper);
+ rb_include_module(klass, ruby_wrapper);
+ }
+ if (super && gen) {
+ rb_class_inherited(super, klass);
+ }
+ result = module_setup(klass, node);
+ }
+ break;
+
+ case NODE_MODULE:
+ {
+ VALUE module, cbase;
+ ID cname;
+
+ if (NIL_P(ruby_cbase)) {
+ rb_raise(rb_eTypeError, "no outer class/module");
+ }
+ cbase = class_prefix(self, node->nd_cpath);
+ cname = node->nd_cpath->nd_mid;
+ if (rb_const_defined_at(cbase, cname)) {
+ module = rb_const_get_at(cbase, cname);
+ if (TYPE(module) != T_MODULE) {
+ rb_raise(rb_eTypeError, "%s is not a module",
+ rb_id2name(cname));
+ }
+ if (ruby_safe_level >= 4) {
+ rb_raise(rb_eSecurityError, "extending module prohibited");
+ }
+ }
+ else {
+ module = rb_define_module_id(cname);
+ rb_set_class_path(module, cbase, rb_id2name(cname));
+ rb_const_set(cbase, cname, module);
+ }
+ if (ruby_wrapper) {
+ rb_extend_object(module, ruby_wrapper);
+ rb_include_module(module, ruby_wrapper);
+ }
+
+ result = module_setup(module, node);
+ }
+ break;
+
+ case NODE_SCLASS:
+ {
+ VALUE klass;
+
+ result = rb_eval(self, node->nd_recv);
+ if (FIXNUM_P(result) || SYMBOL_P(result)) {
+ rb_raise(rb_eTypeError, "no virtual class for %s",
+ rb_obj_classname(result));
+ }
+ if (ruby_safe_level >= 4 && !OBJ_TAINTED(result))
+ rb_raise(rb_eSecurityError, "Insecure: can't extend object");
+ klass = rb_singleton_class(result);
+
+ if (ruby_wrapper) {
+ rb_extend_object(klass, ruby_wrapper);
+ rb_include_module(klass, ruby_wrapper);
+ }
+
+ result = module_setup(klass, node);
+ }
+ break;
+
+ case NODE_DEFINED:
+ {
+ char buf[20];
+ const char *desc = is_defined(self, node->nd_head, buf);
+
+ if (desc) result = rb_str_new2(desc);
+ else result = Qnil;
+ }
+ break;
+
+ case NODE_NEWLINE:
+ EXEC_EVENT_HOOK(RUBY_EVENT_LINE, node, self,
+ ruby_frame->last_func,
+ ruby_frame->last_class);
+ node = node->nd_next;
+ goto again;
+
+ default:
+ unknown_node(node);
+ }
+ finish:
+ CHECK_INTS;
+ if (contnode) {
+ node = contnode;
+ contnode = 0;
+ goto again;
+ }
+ return result;
+}
+
+static VALUE
+module_setup(module, n)
+ VALUE module;
+ NODE *n;
+{
+ NODE * volatile node = n->nd_body;
+ int state;
+ struct FRAME frame;
+ VALUE result = Qnil; /* OK */
+ TMP_PROTECT;
+
+ frame = *ruby_frame;
+ frame.tmp = ruby_frame;
+ ruby_frame = &frame;
+
+ PUSH_CLASS(module);
+ PUSH_SCOPE();
+ PUSH_VARS();
+
+ if (node->nd_tbl) {
+ VALUE *vars = TMP_ALLOC(node->nd_tbl[0]+1);
+ *vars++ = (VALUE)node;
+ ruby_scope->local_vars = vars;
+ rb_mem_clear(ruby_scope->local_vars, node->nd_tbl[0]);
+ ruby_scope->local_tbl = node->nd_tbl;
+ }
+ else {
+ ruby_scope->local_vars = 0;
+ ruby_scope->local_tbl = 0;
+ }
+
+ PUSH_CREF(module);
+ PUSH_TAG(PROT_NONE);
+ if ((state = EXEC_TAG()) == 0) {
+ EXEC_EVENT_HOOK(RUBY_EVENT_CLASS, n, ruby_cbase,
+ ruby_frame->last_func, ruby_frame->last_class);
+ result = rb_eval(ruby_cbase, node->nd_next);
+ }
+ POP_TAG();
+ POP_CREF();
+ POP_VARS();
+ POP_SCOPE();
+ POP_CLASS();
+
+ ruby_frame = frame.tmp;
+ EXEC_EVENT_HOOK(RUBY_EVENT_END, n, 0,
+ ruby_frame->last_func, ruby_frame->last_class);
+ if (state) JUMP_TAG(state);
+
+ return result;
+}
+
+static NODE *basic_respond_to = 0;
+
+int
+rb_obj_respond_to(obj, id, priv)
+ VALUE obj;
+ ID id;
+ int priv;
+{
+ VALUE klass = CLASS_OF(obj);
+
+ if (rb_method_node(klass, respond_to) == basic_respond_to) {
+ return rb_method_boundp(klass, id, !priv);
+ }
+ else {
+ VALUE args[2];
+ int n = 0;
+ args[n++] = ID2SYM(id);
+ if (priv) args[n++] = Qtrue;
+ return RTEST(rb_funcall2(obj, respond_to, n, args));
+ }
+}
+
+int
+rb_respond_to(obj, id)
+ VALUE obj;
+ ID id;
+{
+ return rb_obj_respond_to(obj, id, Qfalse);
+}
+
+/*
+ * call-seq:
+ * obj.respond_to?(symbol, include_private=false) => true or false
+ *
+ * Returns +true+> if _obj_ responds to the given
+ * method. Private methods are included in the search only if the
+ * optional second parameter evaluates to +true+.
+ */
+
+static VALUE
+obj_respond_to(argc, argv, obj)
+ int argc;
+ VALUE *argv;
+ VALUE obj;
+{
+ VALUE mid, priv;
+ ID id;
+
+ rb_scan_args(argc, argv, "11", &mid, &priv);
+ id = rb_to_id(mid);
+ if (rb_method_boundp(CLASS_OF(obj), id, !RTEST(priv))) {
+ return Qtrue;
+ }
+ return Qfalse;
+}
+
+/*
+ * call-seq:
+ * mod.method_defined?(symbol) => true or false
+ *
+ * Returns +true+ if the named method is defined by
+ * _mod_ (or its included modules and, if _mod_ is a class,
+ * its ancestors). Public and protected methods are matched.
+ *
+ * module A
+ * def method1() end
+ * end
+ * class B
+ * def method2() end
+ * end
+ * class C < B
+ * include A
+ * def method3() end
+ * end
+ *
+ * A.method_defined? :method1 #=> true
+ * C.method_defined? "method1" #=> true
+ * C.method_defined? "method2" #=> true
+ * C.method_defined? "method3" #=> true
+ * C.method_defined? "method4" #=> false
+ */
+
+static VALUE
+rb_mod_method_defined(mod, mid)
+ VALUE mod, mid;
+{
+ return rb_method_boundp(mod, rb_to_id(mid), 1);
+}
+
+#define VISI_CHECK(x,f) (((x)&NOEX_MASK) == (f))
+
+/*
+ * call-seq:
+ * mod.public_method_defined?(symbol) => true or false
+ *
+ * Returns +true+ if the named public method is defined by
+ * _mod_ (or its included modules and, if _mod_ is a class,
+ * its ancestors).
+ *
+ * module A
+ * def method1() end
+ * end
+ * class B
+ * protected
+ * def method2() end
+ * end
+ * class C < B
+ * include A
+ * def method3() end
+ * end
+ *
+ * A.method_defined? :method1 #=> true
+ * C.public_method_defined? "method1" #=> true
+ * C.public_method_defined? "method2" #=> false
+ * C.method_defined? "method2" #=> true
+ */
+
+static VALUE
+rb_mod_public_method_defined(mod, mid)
+ VALUE mod, mid;
+{
+ ID id = rb_to_id(mid);
+ int noex;
+
+ if (rb_get_method_body(&mod, &id, &noex)) {
+ if (VISI_CHECK(noex, NOEX_PUBLIC))
+ return Qtrue;
+ }
+ return Qfalse;
+}
+
+/*
+ * call-seq:
+ * mod.private_method_defined?(symbol) => true or false
+ *
+ * Returns +true+ if the named private method is defined by
+ * _ mod_ (or its included modules and, if _mod_ is a class,
+ * its ancestors).
+ *
+ * module A
+ * def method1() end
+ * end
+ * class B
+ * private
+ * def method2() end
+ * end
+ * class C < B
+ * include A
+ * def method3() end
+ * end
+ *
+ * A.method_defined? :method1 #=> true
+ * C.private_method_defined? "method1" #=> false
+ * C.private_method_defined? "method2" #=> true
+ * C.method_defined? "method2" #=> false
+ */
+
+static VALUE
+rb_mod_private_method_defined(mod, mid)
+ VALUE mod, mid;
+{
+ ID id = rb_to_id(mid);
+ int noex;
+
+ if (rb_get_method_body(&mod, &id, &noex)) {
+ if (VISI_CHECK(noex, NOEX_PRIVATE))
+ return Qtrue;
+ }
+ return Qfalse;
+}
+
+/*
+ * call-seq:
+ * mod.protected_method_defined?(symbol) => true or false
+ *
+ * Returns +true+ if the named protected method is defined
+ * by _mod_ (or its included modules and, if _mod_ is a
+ * class, its ancestors).
+ *
+ * module A
+ * def method1() end
+ * end
+ * class B
+ * protected
+ * def method2() end
+ * end
+ * class C < B
+ * include A
+ * def method3() end
+ * end
+ *
+ * A.method_defined? :method1 #=> true
+ * C.protected_method_defined? "method1" #=> false
+ * C.protected_method_defined? "method2" #=> true
+ * C.method_defined? "method2" #=> true
+ */
+
+static VALUE
+rb_mod_protected_method_defined(mod, mid)
+ VALUE mod, mid;
+{
+ ID id = rb_to_id(mid);
+ int noex;
+
+ if (rb_get_method_body(&mod, &id, &noex)) {
+ if (VISI_CHECK(noex, NOEX_PROTECTED))
+ return Qtrue;
+ }
+ return Qfalse;
+}
+
+NORETURN(static VALUE terminate_process _((int, VALUE)));
+static VALUE
+terminate_process(status, mesg)
+ int status;
+ VALUE mesg;
+{
+ VALUE args[2];
+ args[0] = INT2NUM(status);
+ args[1] = mesg;
+
+ rb_exc_raise(rb_class_new_instance(2, args, rb_eSystemExit));
+}
+
+void
+rb_exit(status)
+ int status;
+{
+ if (prot_tag) {
+ terminate_process(status, rb_str_new("exit", 4));
+ }
+ ruby_finalize();
+ exit(status);
+}
+
+
+/*
+ * call-seq:
+ * exit(integer=0)
+ * Kernel::exit(integer=0)
+ * Process::exit(integer=0)
+ *
+ * Initiates the termination of the Ruby script by raising the
+ * <code>SystemExit</code> exception. This exception may be caught. The
+ * optional parameter is used to return a status code to the invoking
+ * environment.
+ *
+ * begin
+ * exit
+ * puts "never get here"
+ * rescue SystemExit
+ * puts "rescued a SystemExit exception"
+ * end
+ * puts "after begin block"
+ *
+ * <em>produces:</em>
+ *
+ * rescued a SystemExit exception
+ * after begin block
+ *
+ * Just prior to termination, Ruby executes any <code>at_exit</code> functions
+ * (see Kernel::at_exit) and runs any object finalizers (see
+ * ObjectSpace::define_finalizer).
+ *
+ * at_exit { puts "at_exit function" }
+ * ObjectSpace.define_finalizer("string", proc { puts "in finalizer" })
+ * exit
+ *
+ * <em>produces:</em>
+ *
+ * at_exit function
+ * in finalizer
+ */
+
+VALUE
+rb_f_exit(argc, argv)
+ int argc;
+ VALUE *argv;
+{
+ VALUE status;
+ int istatus;
+
+ rb_secure(4);
+ if (rb_scan_args(argc, argv, "01", &status) == 1) {
+ switch (status) {
+ case Qtrue:
+ istatus = EXIT_SUCCESS;
+ break;
+ case Qfalse:
+ istatus = EXIT_FAILURE;
+ break;
+ default:
+ istatus = NUM2INT(status);
+#if EXIT_SUCCESS != 0
+ if (istatus == 0) istatus = EXIT_SUCCESS;
+#endif
+ break;
+ }
+ }
+ else {
+ istatus = EXIT_SUCCESS;
+ }
+ rb_exit(istatus);
+ return Qnil; /* not reached */
+}
+
+
+/*
+ * call-seq:
+ * abort
+ * Kernel::abort
+ * Process::abort
+ *
+ * Terminate execution immediately, effectively by calling
+ * <code>Kernel.exit(1)</code>. If _msg_ is given, it is written
+ * to STDERR prior to terminating.
+ */
+
+VALUE
+rb_f_abort(argc, argv)
+ int argc;
+ VALUE *argv;
+{
+ rb_secure(4);
+ if (argc == 0) {
+ if (!NIL_P(ruby_errinfo)) {
+ error_print();
+ }
+ rb_exit(EXIT_FAILURE);
+ }
+ else {
+ VALUE mesg;
+
+ rb_scan_args(argc, argv, "1", &mesg);
+ StringValue(mesg);
+ rb_io_puts(1, &mesg, rb_stderr);
+ terminate_process(EXIT_FAILURE, mesg);
}
+ return Qnil; /* not reached */
}
-NORETURN(static void rb_longjmp(int, volatile VALUE));
+void
+rb_iter_break()
+{
+ break_jump(Qnil);
+}
+
+NORETURN(static void rb_longjmp _((int, VALUE)));
+static VALUE make_backtrace _((void));
static void
-rb_longjmp(int tag, volatile VALUE mesg)
+rb_longjmp(tag, mesg)
+ int tag;
+ VALUE mesg;
{
VALUE at;
- VALUE e;
- rb_thread_t *th = GET_THREAD();
- const char *file;
- volatile int line = 0;
+ rb_thread_t th = curr_thread;
- if (rb_threadptr_set_raised(th)) {
- th->errinfo = exception_error;
+ if (rb_thread_set_raised(th)) {
+ ruby_errinfo = exception_error;
JUMP_TAG(TAG_FATAL);
}
-
- if (NIL_P(mesg))
- mesg = th->errinfo;
+ if (NIL_P(mesg)) mesg = ruby_errinfo;
if (NIL_P(mesg)) {
mesg = rb_exc_new(rb_eRuntimeError, 0, 0);
}
- file = rb_sourcefile();
- if (file) line = rb_sourceline();
- if (file && !NIL_P(mesg)) {
+ ruby_set_current_source();
+ if (ruby_sourcefile && !NIL_P(mesg)) {
at = get_backtrace(mesg);
if (NIL_P(at)) {
- at = rb_make_backtrace();
+ at = make_backtrace();
if (OBJ_FROZEN(mesg)) {
mesg = rb_obj_dup(mesg);
}
@@ -365,68 +4598,76 @@ rb_longjmp(int tag, volatile VALUE mesg)
}
}
if (!NIL_P(mesg)) {
- th->errinfo = mesg;
+ ruby_errinfo = mesg;
}
- if (RTEST(ruby_debug) && !NIL_P(e = th->errinfo) &&
- !rb_obj_is_kind_of(e, rb_eSystemExit)) {
+ if (RTEST(ruby_debug) && !NIL_P(ruby_errinfo)
+ && !rb_obj_is_kind_of(ruby_errinfo, rb_eSystemExit)) {
+ VALUE e = ruby_errinfo;
int status;
- PUSH_TAG();
+ PUSH_TAG(PROT_NONE);
if ((status = EXEC_TAG()) == 0) {
- RB_GC_GUARD(e) = rb_obj_as_string(e);
- if (file) {
- warn_printf("Exception `%s' at %s:%d - %s\n",
- rb_obj_classname(th->errinfo),
- file, line, RSTRING_PTR(e));
- }
- else {
- warn_printf("Exception `%s' - %s\n",
- rb_obj_classname(th->errinfo),
- RSTRING_PTR(e));
- }
+ StringValue(e);
+ warn_printf("Exception `%s' at %s:%d - %s\n",
+ rb_obj_classname(ruby_errinfo),
+ ruby_sourcefile, ruby_sourceline,
+ RSTRING(e)->ptr);
}
POP_TAG();
- if (status == TAG_FATAL && th->errinfo == exception_error) {
- th->errinfo = mesg;
+ if (status == TAG_FATAL && ruby_errinfo == exception_error) {
+ ruby_errinfo = mesg;
}
else if (status) {
- rb_threadptr_reset_raised(th);
+ rb_thread_reset_raised(th);
JUMP_TAG(status);
}
}
rb_trap_restore_mask();
-
if (tag != TAG_FATAL) {
- EXEC_EVENT_HOOK(th, RUBY_EVENT_RAISE, th->cfp->self,
- 0 /* TODO: id */, 0 /* TODO: klass */);
+ EXEC_EVENT_HOOK(RUBY_EVENT_RAISE, ruby_current_node,
+ ruby_frame->self,
+ ruby_frame->last_func,
+ ruby_frame->last_class);
+ }
+ if (!prot_tag) {
+ error_print();
}
-
rb_thread_raised_clear(th);
JUMP_TAG(tag);
}
void
-rb_exc_raise(VALUE mesg)
+rb_exc_jump(mesg)
+ VALUE mesg;
+{
+ rb_thread_raised_clear(rb_curr_thread);
+ ruby_errinfo = mesg;
+ JUMP_TAG(TAG_RAISE);
+}
+
+void
+rb_exc_raise(mesg)
+ VALUE mesg;
{
rb_longjmp(TAG_RAISE, mesg);
}
void
-rb_exc_fatal(VALUE mesg)
+rb_exc_fatal(mesg)
+ VALUE mesg;
{
rb_longjmp(TAG_FATAL, mesg);
}
void
-rb_interrupt(void)
+rb_interrupt()
{
- rb_raise(rb_eInterrupt, "%s", "");
+ static const char fmt[1] = {'\0'};
+ rb_raise(rb_eInterrupt, fmt);
}
-static VALUE get_errinfo(void);
-
/*
* call-seq:
* raise
@@ -435,7 +4676,7 @@ static VALUE get_errinfo(void);
* fail
* fail(string)
* fail(exception [, string [, array]])
- *
+ *
* With no arguments, raises the exception in <code>$!</code> or raises
* a <code>RuntimeError</code> if <code>$!</code> is +nil+.
* With a single +String+ argument, raises a
@@ -446,28 +4687,24 @@ static VALUE get_errinfo(void);
* 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
-rb_f_raise(int argc, VALUE *argv)
+rb_f_raise(argc, argv)
+ int argc;
+ VALUE *argv;
{
- VALUE err;
- if (argc == 0) {
- err = get_errinfo();
- if (!NIL_P(err)) {
- argc = 1;
- argv = &err;
- }
- }
rb_raise_jump(rb_make_exception(argc, argv));
return Qnil; /* not reached */
}
-VALUE
-rb_make_exception(int argc, VALUE *argv)
+static VALUE
+rb_make_exception(argc, argv)
+ int argc;
+ VALUE *argv;
{
VALUE mesg;
ID exception;
@@ -476,13 +4713,12 @@ rb_make_exception(int argc, VALUE *argv)
mesg = Qnil;
switch (argc) {
case 0:
+ mesg = Qnil;
break;
case 1:
- if (NIL_P(argv[0]))
- break;
- mesg = rb_check_string_type(argv[0]);
- if (!NIL_P(mesg)) {
- mesg = rb_exc_new3(rb_eRuntimeError, mesg);
+ if (NIL_P(argv[0])) break;
+ if (TYPE(argv[0]) == T_STRING) {
+ mesg = rb_exc_new3(rb_eRuntimeError, argv[0]);
break;
}
n = 0;
@@ -492,7 +4728,7 @@ rb_make_exception(int argc, VALUE *argv)
case 3:
n = 1;
exception_call:
- CONST_ID(exception, "exception");
+ exception = rb_intern("exception");
if (!rb_respond_to(argv[0], exception)) {
rb_raise(rb_eTypeError, "exception class/object expected");
}
@@ -505,155 +4741,800 @@ rb_make_exception(int argc, VALUE *argv)
if (argc > 0) {
if (!rb_obj_is_kind_of(mesg, rb_eException))
rb_raise(rb_eTypeError, "exception object expected");
- if (argc > 2)
+ if (argc>2)
set_backtrace(mesg, argv[2]);
}
return mesg;
}
-void
-rb_raise_jump(VALUE mesg)
+static void
+rb_raise_jump(mesg)
+ VALUE mesg;
{
- rb_thread_t *th = GET_THREAD();
- th->cfp = RUBY_VM_PREVIOUS_CONTROL_FRAME(th->cfp);
- /* TODO: fix me */
+ if (ruby_frame != top_frame) {
+ PUSH_FRAME(); /* fake frame */
+ *ruby_frame = *_frame.prev->prev;
+ rb_longjmp(TAG_RAISE, mesg);
+ POP_FRAME();
+ }
rb_longjmp(TAG_RAISE, mesg);
}
void
-rb_jump_tag(int tag)
+rb_jump_tag(tag)
+ int tag;
{
JUMP_TAG(tag);
}
int
-rb_block_given_p(void)
+rb_block_given_p()
{
- rb_thread_t *th = GET_THREAD();
-
- if ((th->cfp->lfp[0] & 0x02) == 0 &&
- GC_GUARDED_PTR_REF(th->cfp->lfp[0])) {
+ if (ruby_frame->iter == ITER_CUR && ruby_block)
return Qtrue;
- }
- else {
- return Qfalse;
- }
+ return Qfalse;
}
int
-rb_iterator_p(void)
+rb_iterator_p()
{
return rb_block_given_p();
}
+/*
+ * call-seq:
+ * block_given? => true or false
+ * iterator? => true or false
+ *
+ * Returns <code>true</code> if <code>yield</code> would execute a
+ * block in the current context. The <code>iterator?</code> form
+ * is mildly deprecated.
+ *
+ * def try
+ * if block_given?
+ * yield
+ * else
+ * "no block"
+ * end
+ * end
+ * try #=> "no block"
+ * try { "hello" } #=> "hello"
+ * try do "hello" end #=> "hello"
+ */
+
+
+static VALUE
+rb_f_block_given_p()
+{
+ if (ruby_frame->prev && ruby_frame->prev->iter == ITER_CUR && ruby_block)
+ return Qtrue;
+ return Qfalse;
+}
+
VALUE rb_eThreadError;
+NORETURN(static void proc_jump_error(int, VALUE));
+static void
+proc_jump_error(state, result)
+ int state;
+ VALUE result;
+{
+ char mesg[32];
+ const char *statement;
+
+ switch (state) {
+ case TAG_BREAK:
+ statement = "break"; break;
+ case TAG_RETURN:
+ statement = "return"; break;
+ case TAG_RETRY:
+ statement = "retry"; break;
+ default:
+ statement = "local-jump"; break; /* should not happen */
+ }
+ snprintf(mesg, sizeof mesg, "%s from proc-closure", statement);
+ localjump_error(mesg, result, state);
+}
+
+static void
+return_jump(retval)
+ VALUE retval;
+{
+ struct tag *tt = prot_tag;
+ int yield = Qfalse;
+
+ if (retval == Qundef) retval = Qnil;
+ while (tt) {
+ if (tt->tag == PROT_YIELD) {
+ yield = Qtrue;
+ tt = tt->prev;
+ }
+ if (tt->tag == PROT_FUNC && tt->frame->uniq == ruby_frame->uniq) {
+ tt->dst = (VALUE)ruby_frame->uniq;
+ tt->retval = retval;
+ JUMP_TAG(TAG_RETURN);
+ }
+ if (tt->tag == PROT_LAMBDA && !yield) {
+ tt->dst = (VALUE)tt->frame->uniq;
+ tt->retval = retval;
+ JUMP_TAG(TAG_RETURN);
+ }
+ if (tt->tag == PROT_THREAD) {
+ rb_raise(rb_eThreadError, "return can't jump across threads");
+ }
+ tt = tt->prev;
+ }
+ localjump_error("unexpected return", retval, TAG_RETURN);
+}
+
+static void
+break_jump(retval)
+ VALUE retval;
+{
+ struct tag *tt = prot_tag;
+
+ if (retval == Qundef) retval = Qnil;
+ while (tt) {
+ switch (tt->tag) {
+ case PROT_THREAD:
+ case PROT_YIELD:
+ case PROT_LOOP:
+ case PROT_LAMBDA:
+ tt->dst = (VALUE)tt->frame->uniq;
+ tt->retval = retval;
+ JUMP_TAG(TAG_BREAK);
+ break;
+ case PROT_FUNC:
+ tt = 0;
+ continue;
+ default:
+ break;
+ }
+ tt = tt->prev;
+ }
+ localjump_error("unexpected break", retval, TAG_BREAK);
+}
+
+static void
+next_jump(retval)
+ VALUE retval;
+{
+ struct tag *tt = prot_tag;
+
+ if (retval == Qundef) retval = Qnil;
+ while (tt) {
+ switch (tt->tag) {
+ case PROT_THREAD:
+ case PROT_YIELD:
+ case PROT_LOOP:
+ case PROT_LAMBDA:
+ case PROT_FUNC:
+ tt->dst = (VALUE)tt->frame->uniq;
+ tt->retval = retval;
+ JUMP_TAG(TAG_NEXT);
+ break;
+ default:
+ break;
+ }
+ tt = tt->prev;
+ }
+ localjump_error("unexpected next", retval, TAG_NEXT);
+}
+
void
-rb_need_block(void)
+rb_need_block()
{
if (!rb_block_given_p()) {
- rb_vm_localjump_error("no block given", Qnil, 0);
+ localjump_error("no block given", Qnil, 0);
}
}
-VALUE
-rb_rescue2(VALUE (* b_proc) (ANYARGS), VALUE data1,
- VALUE (* r_proc) (ANYARGS), VALUE data2, ...)
+static VALUE
+rb_yield_0(val, self, klass, flags, avalue)
+ VALUE val, self, klass; /* OK */
+ int flags, avalue;
{
+ NODE *node, *var;
+ volatile VALUE result = Qnil;
+ volatile VALUE old_cref;
+ volatile VALUE old_wrapper;
+ struct BLOCK * volatile block;
+ struct SCOPE * volatile old_scope;
+ int old_vmode;
+ struct FRAME frame;
+ NODE *cnode = ruby_current_node;
+ int lambda = flags & YIELD_LAMBDA_CALL;
int state;
- rb_thread_t *th = GET_THREAD();
- rb_control_frame_t *cfp = th->cfp;
- volatile VALUE result;
- volatile VALUE e_info = th->errinfo;
- va_list args;
- PUSH_TAG();
- if ((state = EXEC_TAG()) == 0) {
- retry_entry:
- result = (*b_proc) (data1);
+ rb_need_block();
+
+ PUSH_VARS();
+ block = ruby_block;
+ frame = block->frame;
+ frame.prev = ruby_frame;
+ frame.node = cnode;
+ ruby_frame = &(frame);
+ old_cref = (VALUE)ruby_cref;
+ ruby_cref = block->cref;
+ old_wrapper = ruby_wrapper;
+ ruby_wrapper = block->wrapper;
+ old_scope = ruby_scope;
+ ruby_scope = block->scope;
+ old_vmode = scope_vmode;
+ scope_vmode = (flags & YIELD_PUBLIC_DEF) ? SCOPE_PUBLIC : block->vmode;
+ ruby_block = block->prev;
+ if (block->flags & BLOCK_D_SCOPE) {
+ /* put place holder for dynamic (in-block) local variables */
+ ruby_dyna_vars = new_dvar(0, 0, block->dyna_vars);
}
else {
- th->cfp = cfp; /* restore */
-
- if (state == TAG_RAISE) {
- int handle = Qfalse;
- VALUE eclass;
-
- va_init_list(args, data2);
- while ((eclass = va_arg(args, VALUE)) != 0) {
- if (rb_obj_is_kind_of(th->errinfo, eclass)) {
- handle = Qtrue;
- break;
+ /* FOR does not introduce new scope */
+ ruby_dyna_vars = block->dyna_vars;
+ }
+ PUSH_CLASS(klass ? klass : block->klass);
+ if (!klass) {
+ self = block->self;
+ }
+ node = block->body;
+ var = block->var;
+
+ if (var) {
+ PUSH_TAG(PROT_NONE);
+ if ((state = EXEC_TAG()) == 0) {
+ NODE *bvar = NULL;
+ block_var:
+ if (var == (NODE*)1) { /* no parameter || */
+ if (lambda && RARRAY(val)->len != 0) {
+ rb_raise(rb_eArgError, "wrong number of arguments (%ld for 0)",
+ RARRAY(val)->len);
}
}
- va_end(args);
-
- if (handle) {
- if (r_proc) {
- PUSH_TAG();
- if ((state = EXEC_TAG()) == 0) {
- result = (*r_proc) (data2, th->errinfo);
+ else if (var == (NODE*)2) {
+ if (TYPE(val) == T_ARRAY && RARRAY(val)->len != 0) {
+ rb_raise(rb_eArgError, "wrong number of arguments (%ld for 0)",
+ RARRAY(val)->len);
+ }
+ }
+ else if (!bvar && nd_type(var) == NODE_BLOCK_PASS) {
+ bvar = var->nd_body;
+ var = var->nd_args;
+ goto block_var;
+ }
+ else if (nd_type(var) == NODE_MASGN) {
+ if (!avalue) {
+ val = svalue_to_mrhs(val, var->nd_head);
+ }
+ massign(self, var, val, lambda);
+ }
+ else {
+ int len = 0;
+ if (avalue) {
+ len = RARRAY(val)->len;
+ if (len == 0) {
+ goto zero_arg;
}
- POP_TAG();
- if (state == TAG_RETRY) {
- state = 0;
- th->errinfo = Qnil;
- goto retry_entry;
+ if (len == 1) {
+ val = RARRAY(val)->ptr[0];
+ }
+ else {
+ goto multi_values;
}
}
- else {
- result = Qnil;
- state = 0;
+ else if (val == Qundef) {
+ zero_arg:
+ val = Qnil;
+ multi_values:
+ {
+ ruby_current_node = var;
+ rb_warn("multiple values for a block parameter (%d for 1)\n\tfrom %s:%d",
+ len, cnode->nd_file, nd_line(cnode));
+ ruby_current_node = cnode;
+ }
}
- if (state == 0) {
- th->errinfo = e_info;
+ assign(self, var, val, lambda);
+ }
+ if (bvar) {
+ VALUE blk;
+ if (flags & YIELD_PROC_CALL)
+ blk = block->block_obj;
+ else
+ blk = rb_block_proc();
+ assign(self, bvar, blk, 0);
+ }
+ }
+ POP_TAG();
+ if (state) goto pop_state;
+ }
+ if (!node) {
+ state = 0;
+ goto pop_state;
+ }
+ ruby_current_node = node;
+
+ PUSH_ITER(block->iter);
+ PUSH_TAG(lambda ? PROT_NONE : PROT_YIELD);
+ if ((state = EXEC_TAG()) == 0) {
+ redo:
+ if (nd_type(node) == NODE_CFUNC || nd_type(node) == NODE_IFUNC) {
+ switch (node->nd_state) {
+ case YIELD_FUNC_LAMBDA:
+ if (!avalue) {
+ val = (val == Qundef) ? rb_ary_new2(0) : rb_ary_new3(1, val);
+ }
+ break;
+ case YIELD_FUNC_AVALUE:
+ if (!avalue) {
+ val = svalue_to_avalue(val);
+ }
+ break;
+ default:
+ if (avalue) {
+ val = avalue_to_svalue(val);
}
+ if (val == Qundef && node->nd_state != YIELD_FUNC_SVALUE)
+ val = Qnil;
}
+ result = (*node->nd_cfnc)(val, node->nd_tval, self);
+ }
+ else {
+ result = rb_eval(self, node);
+ }
+ }
+ else {
+ switch (state) {
+ case TAG_REDO:
+ state = 0;
+ CHECK_INTS;
+ goto redo;
+ case TAG_NEXT:
+ if (!lambda) {
+ state = 0;
+ result = prot_tag->retval;
+ }
+ break;
+ case TAG_BREAK:
+ if (TAG_DST()) {
+ result = prot_tag->retval;
+ }
+ else {
+ lambda = Qtrue; /* just pass TAG_BREAK */
+ }
+ break;
+ default:
+ break;
}
}
POP_TAG();
- if (state)
+ POP_ITER();
+ pop_state:
+ POP_CLASS();
+ if (ruby_dyna_vars && (block->flags & BLOCK_D_SCOPE) &&
+ !FL_TEST(ruby_dyna_vars, DVAR_DONT_RECYCLE)) {
+ struct RVarmap *vars = ruby_dyna_vars;
+
+ if (ruby_dyna_vars->id == 0) {
+ vars = ruby_dyna_vars->next;
+ rb_gc_force_recycle((VALUE)ruby_dyna_vars);
+ while (vars && vars->id != 0 && vars != block->dyna_vars) {
+ struct RVarmap *tmp = vars->next;
+ rb_gc_force_recycle((VALUE)vars);
+ vars = tmp;
+ }
+ }
+ }
+ POP_VARS();
+ ruby_block = block;
+ ruby_frame = ruby_frame->prev;
+ ruby_cref = (NODE*)old_cref;
+ ruby_wrapper = old_wrapper;
+ if (ruby_scope->flags & SCOPE_DONT_RECYCLE)
+ scope_dup(old_scope);
+ ruby_scope = old_scope;
+ scope_vmode = old_vmode;
+ switch (state) {
+ case 0:
+ break;
+ case TAG_BREAK:
+ if (!lambda) {
+ struct tag *tt = prot_tag;
+
+ while (tt) {
+ if (tt->tag == PROT_LOOP && tt->blkid == ruby_block->uniq) {
+ tt->dst = (VALUE)tt->frame->uniq;
+ tt->retval = result;
+ JUMP_TAG(TAG_BREAK);
+ }
+ tt = tt->prev;
+ }
+ proc_jump_error(TAG_BREAK, result);
+ }
+ /* fall through */
+ default:
JUMP_TAG(state);
+ break;
+ }
+ ruby_current_node = cnode;
+ return result;
+}
+
+VALUE
+rb_yield(val)
+ VALUE val;
+{
+ return rb_yield_0(val, 0, 0, 0, Qfalse);
+}
+
+VALUE
+#ifdef HAVE_STDARG_PROTOTYPES
+rb_yield_values(int n, ...)
+#else
+rb_yield_values(n, va_alist)
+ int n;
+ va_dcl
+#endif
+{
+ va_list args;
+ VALUE ary;
+
+ if (n == 0) {
+ return rb_yield_0(Qundef, 0, 0, 0, Qfalse);
+ }
+ ary = rb_ary_new2(n);
+ va_init_list(args, n);
+ while (n--) {
+ rb_ary_push(ary, va_arg(args, VALUE));
+ }
+ va_end(args);
+ return rb_yield_0(ary, 0, 0, 0, Qtrue);
+}
+
+VALUE
+rb_yield_splat(values)
+ VALUE values;
+{
+ int avalue = Qfalse;
+
+ if (TYPE(values) == T_ARRAY) {
+ if (RARRAY(values)->len == 0) {
+ values = Qundef;
+ }
+ else {
+ avalue = Qtrue;
+ }
+ }
+ return rb_yield_0(values, 0, 0, 0, avalue);
+}
+
+static VALUE
+loop_i()
+{
+ for (;;) {
+ rb_yield_0(Qundef, 0, 0, 0, Qfalse);
+ CHECK_INTS;
+ }
+ return Qnil;
+}
+
+/*
+ * call-seq:
+ * loop {|| block }
+ *
+ * Repeatedly executes the block.
+ *
+ * loop do
+ * print "Input: "
+ * line = gets
+ * break if !line or line =~ /^qQ/
+ * # ...
+ * end
+ *
+ * StopIteration raised in the block breaks the loop.
+ */
+
+static VALUE
+rb_f_loop()
+{
+ rb_rescue2(loop_i, (VALUE)0, 0, 0, rb_eStopIteration, (VALUE)0);
+ return Qnil; /* dummy */
+}
+
+static VALUE
+massign(self, node, val, pcall)
+ VALUE self;
+ NODE *node;
+ VALUE val;
+ int pcall;
+{
+ NODE *list;
+ long i = 0, len;
+
+ len = RARRAY(val)->len;
+ list = node->nd_head;
+ for (; list && i<len; i++) {
+ assign(self, list->nd_head, RARRAY(val)->ptr[i], pcall);
+ list = list->nd_next;
+ }
+ if (pcall && list) goto arg_error;
+ if (node->nd_args) {
+ if ((long)(node->nd_args) == -1) {
+ /* no check for mere `*' */
+ }
+ else if (!list && i<len) {
+ assign(self, node->nd_args, rb_ary_new4(len-i, RARRAY(val)->ptr+i), pcall);
+ }
+ else {
+ assign(self, node->nd_args, rb_ary_new2(0), pcall);
+ }
+ }
+ else if (pcall && i < len) {
+ goto arg_error;
+ }
+
+ while (list) {
+ i++;
+ assign(self, list->nd_head, Qnil, pcall);
+ list = list->nd_next;
+ }
+ return val;
+
+ arg_error:
+ while (list) {
+ i++;
+ list = list->nd_next;
+ }
+ rb_raise(rb_eArgError, "wrong number of arguments (%ld for %ld)", len, i);
+}
+
+static void
+assign(self, lhs, val, pcall)
+ VALUE self;
+ NODE *lhs;
+ VALUE val;
+ int pcall;
+{
+ ruby_current_node = lhs;
+ if (val == Qundef) {
+ rb_warning("assigning void value");
+ val = Qnil;
+ }
+ switch (nd_type(lhs)) {
+ case NODE_GASGN:
+ rb_gvar_set(lhs->nd_entry, val);
+ break;
+
+ case NODE_IASGN:
+ rb_ivar_set(self, lhs->nd_vid, val);
+ break;
+
+ case NODE_LASGN:
+ if (ruby_scope->local_vars == 0)
+ rb_bug("unexpected local variable assignment");
+ ruby_scope->local_vars[lhs->nd_cnt] = val;
+ break;
+
+ case NODE_DASGN:
+ dvar_asgn(lhs->nd_vid, val);
+ break;
+
+ case NODE_DASGN_CURR:
+ dvar_asgn_curr(lhs->nd_vid, val);
+ break;
+
+ case NODE_CDECL:
+ if (lhs->nd_vid == 0) {
+ rb_const_set(class_prefix(self, lhs->nd_else), lhs->nd_else->nd_mid, val);
+ }
+ else {
+ rb_const_set(ruby_cbase, lhs->nd_vid, val);
+ }
+ break;
+
+ case NODE_CVDECL:
+ if (RTEST(ruby_verbose) && FL_TEST(ruby_cbase, FL_SINGLETON)) {
+ rb_warn("declaring singleton class variable");
+ }
+ rb_cvar_set(cvar_cbase(), lhs->nd_vid, val, Qtrue);
+ break;
+
+ case NODE_CVASGN:
+ rb_cvar_set(cvar_cbase(), lhs->nd_vid, val, Qfalse);
+ break;
+
+ case NODE_MASGN:
+ massign(self, lhs, svalue_to_mrhs(val, lhs->nd_head), pcall);
+ break;
+
+ case NODE_CALL:
+ case NODE_ATTRASGN:
+ {
+ VALUE recv;
+ int scope;
+ if (lhs->nd_recv == (NODE *)1) {
+ recv = self;
+ scope = 1;
+ }
+ else {
+ recv = rb_eval(self, lhs->nd_recv);
+ scope = 0;
+ }
+ if (!lhs->nd_args) {
+ /* attr set */
+ ruby_current_node = lhs;
+ SET_CURRENT_SOURCE();
+ rb_call(CLASS_OF(recv), recv, lhs->nd_mid, 1, &val, scope, self);
+ }
+ else {
+ /* array set */
+ VALUE args;
+
+ args = rb_eval(self, lhs->nd_args);
+ rb_ary_push(args, val);
+ ruby_current_node = lhs;
+ SET_CURRENT_SOURCE();
+ rb_call(CLASS_OF(recv), recv, lhs->nd_mid,
+ RARRAY(args)->len, RARRAY(args)->ptr, scope, self);
+ }
+ }
+ break;
+
+ default:
+ rb_bug("bug in variable assignment");
+ break;
+ }
+}
+
+VALUE
+rb_iterate(it_proc, data1, bl_proc, data2)
+ VALUE (*it_proc) _((VALUE)), (*bl_proc)(ANYARGS);
+ VALUE data1, data2;
+{
+ int state;
+ volatile VALUE retval = Qnil;
+ NODE *node = NEW_IFUNC(bl_proc, data2);
+ VALUE self = ruby_top_self;
+
+ PUSH_TAG(PROT_LOOP);
+ PUSH_BLOCK(0, node);
+ PUSH_ITER(ITER_PRE);
+ state = EXEC_TAG();
+ if (state == 0) {
+ iter_retry:
+ retval = (*it_proc)(data1);
+ }
+ else if (state == TAG_BREAK && TAG_DST()) {
+ retval = prot_tag->retval;
+ state = 0;
+ }
+ else if (state == TAG_RETRY) {
+ state = 0;
+ goto iter_retry;
+ }
+ POP_ITER();
+ POP_BLOCK();
+ POP_TAG();
+
+ switch (state) {
+ case 0:
+ break;
+ default:
+ JUMP_TAG(state);
+ }
+ return retval;
+}
+
+static int
+handle_rescue(self, node)
+ VALUE self;
+ NODE *node;
+{
+ int argc; VALUE *argv; /* used in SETUP_ARGS */
+ TMP_PROTECT;
+
+ if (!node->nd_args) {
+ return rb_obj_is_kind_of(ruby_errinfo, rb_eStandardError);
+ }
+
+ BEGIN_CALLARGS;
+ SETUP_ARGS(node->nd_args);
+ END_CALLARGS;
+
+ while (argc--) {
+ if (!rb_obj_is_kind_of(argv[0], rb_cModule)) {
+ rb_raise(rb_eTypeError, "class or module required for rescue clause");
+ }
+ if (RTEST(rb_funcall(*argv, eqq, 1, ruby_errinfo))) return 1;
+ argv++;
+ }
+ return 0;
+}
+
+VALUE
+#ifdef HAVE_STDARG_PROTOTYPES
+rb_rescue2(VALUE (*b_proc)(ANYARGS), VALUE data1, VALUE (*r_proc)(ANYARGS), VALUE data2, ...)
+#else
+rb_rescue2(b_proc, data1, r_proc, data2, va_alist)
+ VALUE (*b_proc)(ANYARGS), (*r_proc)(ANYARGS);
+ VALUE data1, data2;
+ va_dcl
+#endif
+{
+ int state;
+ volatile VALUE result;
+ volatile VALUE e_info = ruby_errinfo;
+ volatile int handle = Qfalse;
+ VALUE eclass;
+ va_list args;
+
+ PUSH_TAG(PROT_NONE);
+ switch (state = EXEC_TAG()) {
+ case TAG_RETRY:
+ if (!handle) break;
+ handle = Qfalse;
+ state = 0;
+ ruby_errinfo = Qnil;
+ case 0:
+ result = (*b_proc)(data1);
+ break;
+ case TAG_RAISE:
+ if (handle) break;
+ handle = Qfalse;
+ va_init_list(args, data2);
+ while ((eclass = va_arg(args, VALUE)) != 0) {
+ if (rb_obj_is_kind_of(ruby_errinfo, eclass)) {
+ handle = Qtrue;
+ break;
+ }
+ }
+ va_end(args);
+
+ if (handle) {
+ state = 0;
+ if (r_proc) {
+ result = (*r_proc)(data2, ruby_errinfo);
+ }
+ else {
+ result = Qnil;
+ }
+ ruby_errinfo = e_info;
+ }
+ }
+ POP_TAG();
+ if (state) JUMP_TAG(state);
return result;
}
VALUE
-rb_rescue(VALUE (* b_proc)(ANYARGS), VALUE data1,
- VALUE (* r_proc)(ANYARGS), VALUE data2)
+rb_rescue(b_proc, data1, r_proc, data2)
+ VALUE (*b_proc)(), (*r_proc)();
+ VALUE data1, data2;
{
- return rb_rescue2(b_proc, data1, r_proc, data2, rb_eStandardError,
- (VALUE)0);
+ return rb_rescue2(b_proc, data1, r_proc, data2, rb_eStandardError, (VALUE)0);
}
+static VALUE cont_protect;
+
VALUE
-rb_protect(VALUE (* proc) (VALUE), VALUE data, int * state)
+rb_protect(proc, data, state)
+ VALUE (*proc) _((VALUE));
+ VALUE data;
+ int *state;
{
- volatile VALUE result = Qnil;
+ VALUE result = Qnil; /* OK */
int status;
- rb_thread_t *th = GET_THREAD();
- rb_control_frame_t *cfp = th->cfp;
- struct rb_vm_trap_tag trap_tag;
- rb_jmpbuf_t org_jmpbuf;
-
- trap_tag.prev = th->trap_tag;
- PUSH_TAG();
- th->trap_tag = &trap_tag;
- MEMCPY(&org_jmpbuf, &(th)->root_jmpbuf, rb_jmpbuf_t, 1);
+ PUSH_TAG(PROT_NONE);
+ cont_protect = (VALUE)rb_node_newnode(NODE_MEMO, cont_protect, 0, 0);
if ((status = EXEC_TAG()) == 0) {
- SAVE_ROOT_JMPBUF(th, result = (*proc) (data));
+ result = (*proc)(data);
}
- MEMCPY(&(th)->root_jmpbuf, &org_jmpbuf, rb_jmpbuf_t, 1);
- th->trap_tag = trap_tag.prev;
+ cont_protect = ((NODE *)cont_protect)->u1.value;
POP_TAG();
-
if (state) {
*state = status;
}
if (status != 0) {
- th->cfp = cfp;
return Qnil;
}
@@ -661,81 +5542,2197 @@ rb_protect(VALUE (* proc) (VALUE), VALUE data, int * state)
}
VALUE
-rb_ensure(VALUE (*b_proc)(ANYARGS), VALUE data1, VALUE (*e_proc)(ANYARGS), VALUE data2)
+rb_ensure(b_proc, data1, e_proc, data2)
+ VALUE (*b_proc)();
+ VALUE data1;
+ VALUE (*e_proc)();
+ VALUE data2;
{
int state;
volatile VALUE result = Qnil;
+ VALUE retval;
- PUSH_TAG();
+ PUSH_TAG(PROT_NONE);
if ((state = EXEC_TAG()) == 0) {
- result = (*b_proc) (data1);
+ result = (*b_proc)(data1);
}
POP_TAG();
- /* TODO: fix me */
- /* retval = prot_tag ? prot_tag->retval : Qnil; */ /* save retval */
- (*e_proc) (data2);
- if (state)
- JUMP_TAG(state);
+ retval = prot_tag ? prot_tag->retval : Qnil; /* save retval */
+ if (!thread_no_ensure()) {
+ (*e_proc)(data2);
+ }
+ if (prot_tag) return_value(retval);
+ if (state) JUMP_TAG(state);
+ return result;
+}
+
+VALUE
+rb_with_disable_interrupt(proc, data)
+ VALUE (*proc)();
+ VALUE data;
+{
+ VALUE result = Qnil; /* OK */
+ int status;
+
+ DEFER_INTS;
+ {
+ int thr_critical = rb_thread_critical;
+
+ rb_thread_critical = Qtrue;
+ PUSH_TAG(PROT_NONE);
+ if ((status = EXEC_TAG()) == 0) {
+ result = (*proc)(data);
+ }
+ POP_TAG();
+ rb_thread_critical = thr_critical;
+ }
+ ENABLE_INTS;
+ if (status) JUMP_TAG(status);
+
+ return result;
+}
+
+static void
+stack_check()
+{
+ rb_thread_t th = rb_curr_thread;
+
+ if (!rb_thread_raised_p(th, RAISED_STACKOVERFLOW) && ruby_stack_check()) {
+ rb_thread_raised_set(th, RAISED_STACKOVERFLOW);
+ rb_exc_raise(sysstack_error);
+ }
+}
+
+static int last_call_status;
+
+#define CSTAT_PRIV 1
+#define CSTAT_PROT 2
+#define CSTAT_VCALL 4
+#define CSTAT_SUPER 8
+
+/*
+ * call-seq:
+ * obj.method_missing(symbol [, *args] ) => result
+ *
+ * Invoked by Ruby when <i>obj</i> is sent a message it cannot handle.
+ * <i>symbol</i> is the symbol for the method called, and <i>args</i>
+ * are any arguments that were passed to it. By default, the interpreter
+ * raises an error when this method is called. However, it is possible
+ * to override the method to provide more dynamic behavior.
+ * The example below creates
+ * a class <code>Roman</code>, which responds to methods with names
+ * consisting of roman numerals, returning the corresponding integer
+ * values.
+ *
+ * class Roman
+ * def romanToInt(str)
+ * # ...
+ * end
+ * def method_missing(methId)
+ * str = methId.id2name
+ * romanToInt(str)
+ * end
+ * end
+ *
+ * r = Roman.new
+ * r.iv #=> 4
+ * r.xxiii #=> 23
+ * r.mm #=> 2000
+ */
+
+static VALUE
+rb_method_missing(argc, argv, obj)
+ int argc;
+ VALUE *argv;
+ VALUE obj;
+{
+ ID id;
+ VALUE exc = rb_eNoMethodError;
+ const char *format = 0;
+ NODE *cnode = ruby_current_node;
+
+ if (argc == 0 || !SYMBOL_P(argv[0])) {
+ rb_raise(rb_eArgError, "no id given");
+ }
+
+ stack_check();
+
+ id = SYM2ID(argv[0]);
+
+ if (last_call_status & CSTAT_PRIV) {
+ format = "private method `%s' called for %s";
+ }
+ else if (last_call_status & CSTAT_PROT) {
+ format = "protected method `%s' called for %s";
+ }
+ else if (last_call_status & CSTAT_VCALL) {
+ format = "undefined local variable or method `%s' for %s";
+ exc = rb_eNameError;
+ }
+ else if (last_call_status & CSTAT_SUPER) {
+ format = "super: no superclass method `%s'";
+ }
+ if (!format) {
+ format = "undefined method `%s' for %s";
+ }
+
+ ruby_current_node = cnode;
+ {
+ int n = 0;
+ VALUE args[3];
+
+ args[n++] = rb_funcall(rb_const_get(exc, rb_intern("message")), '!',
+ 3, rb_str_new2(format), obj, argv[0]);
+ args[n++] = argv[0];
+ if (exc == rb_eNoMethodError) {
+ args[n++] = rb_ary_new4(argc-1, argv+1);
+ }
+ exc = rb_class_new_instance(n, args, exc);
+ ruby_frame = ruby_frame->prev; /* pop frame for "method_missing" */
+ rb_exc_raise(exc);
+ }
+
+ return Qnil; /* not reached */
+}
+
+static VALUE
+method_missing(obj, id, argc, argv, call_status)
+ VALUE obj;
+ ID id;
+ int argc;
+ const VALUE *argv;
+ int call_status;
+{
+ VALUE *nargv;
+
+ last_call_status = call_status;
+
+ if (id == missing) {
+ PUSH_FRAME();
+ rb_method_missing(argc, argv, obj);
+ POP_FRAME();
+ }
+ else if (id == ID_ALLOCATOR) {
+ rb_raise(rb_eTypeError, "allocator undefined for %s", rb_class2name(obj));
+ }
+ if (argc < 0) {
+ VALUE tmp;
+
+ argc = -argc-1;
+ tmp = splat_value(argv[argc]);
+ nargv = ALLOCA_N(VALUE, argc + RARRAY(tmp)->len + 1);
+ MEMCPY(nargv+1, argv, VALUE, argc);
+ MEMCPY(nargv+1+argc, RARRAY(tmp)->ptr, VALUE, RARRAY(tmp)->len);
+ argc += RARRAY(tmp)->len;
+ }
+ else {
+ nargv = ALLOCA_N(VALUE, argc+1);
+ MEMCPY(nargv+1, argv, VALUE, argc);
+ }
+ nargv[0] = ID2SYM(id);
+ return rb_funcall2(obj, missing, argc+1, nargv);
+}
+
+static inline VALUE
+call_cfunc(func, recv, len, argc, argv)
+ VALUE (*func)();
+ VALUE recv;
+ int len, argc;
+ VALUE *argv;
+{
+ if (len >= 0 && argc != len) {
+ rb_raise(rb_eArgError, "wrong number of arguments (%d for %d)",
+ argc, len);
+ }
+
+ switch (len) {
+ case -2:
+ return (*func)(recv, rb_ary_new4(argc, argv));
+ break;
+ case -1:
+ return (*func)(argc, argv, recv);
+ break;
+ case 0:
+ return (*func)(recv);
+ break;
+ case 1:
+ return (*func)(recv, argv[0]);
+ break;
+ case 2:
+ return (*func)(recv, argv[0], argv[1]);
+ break;
+ case 3:
+ return (*func)(recv, argv[0], argv[1], argv[2]);
+ break;
+ case 4:
+ return (*func)(recv, argv[0], argv[1], argv[2], argv[3]);
+ break;
+ case 5:
+ return (*func)(recv, argv[0], argv[1], argv[2], argv[3], argv[4]);
+ break;
+ case 6:
+ return (*func)(recv, argv[0], argv[1], argv[2], argv[3], argv[4],
+ argv[5]);
+ break;
+ case 7:
+ return (*func)(recv, argv[0], argv[1], argv[2], argv[3], argv[4],
+ argv[5], argv[6]);
+ break;
+ case 8:
+ return (*func)(recv, argv[0], argv[1], argv[2], argv[3], argv[4],
+ argv[5], argv[6], argv[7]);
+ break;
+ case 9:
+ return (*func)(recv, argv[0], argv[1], argv[2], argv[3], argv[4],
+ argv[5], argv[6], argv[7], argv[8]);
+ break;
+ case 10:
+ return (*func)(recv, argv[0], argv[1], argv[2], argv[3], argv[4],
+ argv[5], argv[6], argv[7], argv[8], argv[9]);
+ break;
+ case 11:
+ return (*func)(recv, argv[0], argv[1], argv[2], argv[3], argv[4],
+ argv[5], argv[6], argv[7], argv[8], argv[9], argv[10]);
+ break;
+ case 12:
+ return (*func)(recv, argv[0], argv[1], argv[2], argv[3], argv[4],
+ argv[5], argv[6], argv[7], argv[8], argv[9],
+ argv[10], argv[11]);
+ break;
+ case 13:
+ return (*func)(recv, argv[0], argv[1], argv[2], argv[3], argv[4],
+ argv[5], argv[6], argv[7], argv[8], argv[9], argv[10],
+ argv[11], argv[12]);
+ break;
+ case 14:
+ return (*func)(recv, argv[0], argv[1], argv[2], argv[3], argv[4],
+ argv[5], argv[6], argv[7], argv[8], argv[9], argv[10],
+ argv[11], argv[12], argv[13]);
+ break;
+ case 15:
+ return (*func)(recv, argv[0], argv[1], argv[2], argv[3], argv[4],
+ argv[5], argv[6], argv[7], argv[8], argv[9], argv[10],
+ argv[11], argv[12], argv[13], argv[14]);
+ break;
+ default:
+ rb_raise(rb_eArgError, "too many arguments (%d)", len);
+ break;
+ }
+ return Qnil; /* not reached */
+}
+
+static VALUE
+rb_call0(klass, recv, id, oid, argc, argv, body, flags)
+ VALUE klass, recv;
+ ID id;
+ ID oid;
+ int argc; /* OK */
+ VALUE *argv; /* OK */
+ NODE * volatile body;
+ int flags;
+{
+ NODE *b2; /* OK */
+ volatile VALUE result = Qnil;
+ int itr;
+ static int tick;
+ TMP_PROTECT;
+ volatile int safe = -1;
+
+ if (NOEX_SAFE(flags) > ruby_safe_level && NOEX_SAFE(flags) > 2) {
+ rb_raise(rb_eSecurityError, "calling insecure method: %s",
+ rb_id2name(id));
+ }
+ switch (ruby_iter->iter) {
+ case ITER_PRE:
+ case ITER_PAS:
+ itr = ITER_CUR;
+ break;
+ case ITER_CUR:
+ default:
+ itr = ITER_NOT;
+ break;
+ }
+
+ if ((++tick & 0xff) == 0) {
+ CHECK_INTS; /* better than nothing */
+ stack_check();
+ rb_gc_finalize_deferred();
+ }
+ if (argc < 0) {
+ VALUE tmp;
+ VALUE *nargv;
+
+ argc = -argc-1;
+ tmp = splat_value(argv[argc]);
+ nargv = TMP_ALLOC(argc + RARRAY(tmp)->len);
+ MEMCPY(nargv, argv, VALUE, argc);
+ MEMCPY(nargv+argc, RARRAY(tmp)->ptr, VALUE, RARRAY(tmp)->len);
+ argc += RARRAY(tmp)->len;
+ argv = nargv;
+ }
+ PUSH_ITER(itr);
+ PUSH_FRAME();
+
+ ruby_frame->last_func = id;
+ ruby_frame->orig_func = oid;
+ ruby_frame->last_class = (flags & NOEX_NOSUPER)?0:klass;
+ ruby_frame->self = recv;
+ ruby_frame->argc = argc;
+ ruby_frame->flags = 0;
+
+ switch (nd_type(body)) {
+ case NODE_CFUNC:
+ {
+ int len = body->nd_argc;
+
+ if (len < -2) {
+ rb_bug("bad argc (%d) specified for `%s(%s)'",
+ len, rb_class2name(klass), rb_id2name(id));
+ }
+ if (event_hooks) {
+ int state;
+
+ EXEC_EVENT_HOOK(RUBY_EVENT_C_CALL, ruby_current_node,
+ recv, id, klass);
+ PUSH_TAG(PROT_FUNC);
+ if ((state = EXEC_TAG()) == 0) {
+ result = call_cfunc(body->nd_cfnc, recv, len, argc, argv);
+ }
+ POP_TAG();
+ ruby_current_node = ruby_frame->node;
+ EXEC_EVENT_HOOK(RUBY_EVENT_C_RETURN, ruby_current_node,
+ recv, id, klass);
+ if (state) JUMP_TAG(state);
+ }
+ else {
+ result = call_cfunc(body->nd_cfnc, recv, len, argc, argv);
+ }
+ }
+ break;
+
+ /* for attr get/set */
+ case NODE_IVAR:
+ if (argc != 0) {
+ rb_raise(rb_eArgError, "wrong number of arguments (%d for 0)", argc);
+ }
+ result = rb_attr_get(recv, body->nd_vid);
+ break;
+
+ case NODE_ATTRSET:
+ if (argc != 1)
+ rb_raise(rb_eArgError, "wrong number of arguments (%d for 1)", argc);
+ result = rb_ivar_set(recv, body->nd_vid, argv[0]);
+ break;
+
+ case NODE_ZSUPER:
+ result = rb_call_super(argc, argv);
+ break;
+
+ case NODE_DMETHOD:
+ result = method_call(argc, argv, umethod_bind(body->nd_cval, recv));
+ break;
+
+ case NODE_BMETHOD:
+ ruby_frame->flags |= FRAME_DMETH;
+ if (event_hooks) {
+ struct BLOCK *data;
+ Data_Get_Struct(body->nd_cval, struct BLOCK, data);
+ EXEC_EVENT_HOOK(RUBY_EVENT_CALL, data->body, recv, id, klass);
+ }
+ result = proc_invoke(body->nd_cval, rb_ary_new4(argc, argv), recv, klass);
+ if (event_hooks) {
+ EXEC_EVENT_HOOK(RUBY_EVENT_RETURN, ruby_current_node, recv, id, klass);
+ }
+ break;
+
+ case NODE_SCOPE:
+ {
+ int state;
+ VALUE *local_vars; /* OK */
+ NODE *saved_cref = 0;
+
+ PUSH_SCOPE();
+ if (body->nd_rval) {
+ saved_cref = ruby_cref;
+ ruby_cref = (NODE*)body->nd_rval;
+ }
+ PUSH_CLASS(ruby_cbase);
+ if (body->nd_tbl) {
+ local_vars = TMP_ALLOC(body->nd_tbl[0]+1);
+ *local_vars++ = (VALUE)body;
+ rb_mem_clear(local_vars, body->nd_tbl[0]);
+ ruby_scope->local_tbl = body->nd_tbl;
+ ruby_scope->local_vars = local_vars;
+ }
+ else {
+ local_vars = ruby_scope->local_vars = 0;
+ ruby_scope->local_tbl = 0;
+ }
+ b2 = body = body->nd_next;
+
+ if (NOEX_SAFE(flags) > ruby_safe_level) {
+ safe = ruby_safe_level;
+ ruby_safe_level = NOEX_SAFE(flags);
+ }
+ PUSH_VARS();
+ PUSH_TAG(PROT_FUNC);
+ if ((state = EXEC_TAG()) == 0) {
+ NODE *node = 0;
+ int i, nopt = 0;
+
+ if (nd_type(body) == NODE_ARGS) {
+ node = body;
+ body = 0;
+ }
+ else if (nd_type(body) == NODE_BLOCK) {
+ node = body->nd_head;
+ body = body->nd_next;
+ }
+ if (node) {
+ if (nd_type(node) != NODE_ARGS) {
+ rb_bug("no argument-node");
+ }
+
+ i = node->nd_cnt;
+ if (i > argc) {
+ rb_raise(rb_eArgError, "wrong number of arguments (%d for %d)",
+ argc, i);
+ }
+ if (!node->nd_rest) {
+ NODE *optnode = node->nd_opt;
+
+ nopt = i;
+ while (optnode) {
+ nopt++;
+ optnode = optnode->nd_next;
+ }
+ if (nopt < argc) {
+ rb_raise(rb_eArgError,
+ "wrong number of arguments (%d for %d)",
+ argc, nopt);
+ }
+ }
+ if (local_vars) {
+ if (i > 0) {
+ /* +2 for $_ and $~ */
+ MEMCPY(local_vars+2, argv, VALUE, i);
+ }
+ }
+ argv += i; argc -= i;
+ if (node->nd_opt) {
+ NODE *opt = node->nd_opt;
+
+ while (opt && argc) {
+ assign(recv, opt->nd_head, *argv, 1);
+ argv++; argc--;
+ ++i;
+ opt = opt->nd_next;
+ }
+ if (opt) {
+ rb_eval(recv, opt);
+ while (opt) {
+ opt = opt->nd_next;
+ ++i;
+ }
+ }
+ }
+ if (!node->nd_rest) {
+ i = nopt;
+ }
+ else {
+ VALUE v;
+
+ if (argc > 0) {
+ v = rb_ary_new4(argc,argv);
+ i = -i - 1;
+ }
+ else {
+ v = rb_ary_new2(0);
+ }
+ assign(recv, node->nd_rest, v, 1);
+ }
+ ruby_frame->argc = i;
+ }
+ if (event_hooks) {
+ EXEC_EVENT_HOOK(RUBY_EVENT_CALL, b2, recv, id, klass);
+ }
+ result = rb_eval(recv, body);
+ }
+ else if (state == TAG_RETURN && TAG_DST()) {
+ result = prot_tag->retval;
+ state = 0;
+ }
+ POP_TAG();
+ if (event_hooks) {
+ EXEC_EVENT_HOOK(RUBY_EVENT_RETURN, ruby_current_node, recv, id, klass);
+ }
+ POP_VARS();
+ POP_CLASS();
+ POP_SCOPE();
+ ruby_cref = saved_cref;
+ if (safe >= 0) ruby_safe_level = safe;
+ switch (state) {
+ case 0:
+ break;
+
+ case TAG_BREAK:
+ case TAG_RETURN:
+ JUMP_TAG(state);
+ break;
+
+ case TAG_RETRY:
+ if (rb_block_given_p()) JUMP_TAG(state);
+ /* fall through */
+ default:
+ jump_tag_but_local_jump(state, result);
+ break;
+ }
+ }
+ break;
+
+ default:
+ unknown_node(body);
+ break;
+ }
+ POP_FRAME();
+ POP_ITER();
return result;
}
-static ID
-frame_func_id(rb_control_frame_t *cfp)
+static VALUE
+rb_call(klass, recv, mid, argc, argv, scope, self)
+ VALUE klass, recv;
+ ID mid;
+ int argc; /* OK */
+ const VALUE *argv; /* OK */
+ int scope;
+ VALUE self;
{
- rb_iseq_t *iseq = cfp->iseq;
- if (!iseq) {
- return cfp->me->original_id;
+ NODE *body; /* OK */
+ int noex;
+ ID id = mid;
+ struct cache_entry *ent;
+
+ if (!klass) {
+ rb_raise(rb_eNotImpError, "method `%s' called on terminated object (0x%lx)",
+ rb_id2name(mid), recv);
+ }
+ /* is it in the method cache? */
+ ent = cache + EXPR1(klass, mid);
+ if (ent->mid == mid && ent->klass == klass) {
+ if (!ent->method)
+ return method_missing(recv, mid, argc, argv, scope==2?CSTAT_VCALL:0);
+ klass = ent->origin;
+ id = ent->mid0;
+ noex = ent->noex;
+ body = ent->method;
}
- while (iseq) {
- if (RUBY_VM_IFUNC_P(iseq)) {
- return rb_intern("<ifunc>");
+ else if ((body = rb_get_method_body(&klass, &id, &noex)) == 0) {
+ if (scope == 3) {
+ return method_missing(recv, mid, argc, argv, CSTAT_SUPER);
}
- if (iseq->defined_method_id) {
- return iseq->defined_method_id;
+ return method_missing(recv, mid, argc, argv, scope==2?CSTAT_VCALL:0);
+ }
+
+ if (mid != missing && scope == 0) {
+ /* receiver specified form for private method */
+ if (noex & NOEX_PRIVATE)
+ return method_missing(recv, mid, argc, argv, CSTAT_PRIV);
+
+ /* self must be kind of a specified form for protected method */
+ if (noex & NOEX_PROTECTED) {
+ VALUE defined_class = klass;
+
+ if (self == Qundef) self = ruby_frame->self;
+ if (TYPE(defined_class) == T_ICLASS) {
+ defined_class = RBASIC(defined_class)->klass;
+ }
+ if (!rb_obj_is_kind_of(self, rb_class_real(defined_class)))
+ return method_missing(recv, mid, argc, argv, CSTAT_PROT);
}
- if (iseq->local_iseq == iseq) {
- break;
+ }
+
+ return rb_call0(klass, recv, mid, id, argc, argv, body, noex);
+}
+
+VALUE
+rb_apply(recv, mid, args)
+ VALUE recv;
+ ID mid;
+ VALUE args;
+{
+ int argc;
+ VALUE *argv;
+
+ argc = RARRAY(args)->len; /* Assigns LONG, but argc is INT */
+ argv = ALLOCA_N(VALUE, argc);
+ MEMCPY(argv, RARRAY(args)->ptr, VALUE, argc);
+ return rb_call(CLASS_OF(recv), recv, mid, argc, argv, 1, Qundef);
+}
+
+/*
+ * call-seq:
+ * obj.send(symbol [, args...]) => obj
+ * obj.__send__(symbol [, args...]) => obj
+ *
+ * Invokes the method identified by _symbol_, passing it any
+ * arguments specified. You can use <code>\_\_send__</code> if the name
+ * +send+ clashes with an existing method in _obj_.
+ *
+ * class Klass
+ * def hello(*args)
+ * "Hello " + args.join(' ')
+ * end
+ * end
+ * k = Klass.new
+ * k.send :hello, "gentle", "readers" #=> "Hello gentle readers"
+ */
+
+static VALUE
+rb_f_send(argc, argv, recv)
+ int argc;
+ VALUE *argv;
+ VALUE recv;
+{
+ VALUE vid;
+
+ if (argc == 0) rb_raise(rb_eArgError, "no method name given");
+
+ vid = *argv++; argc--;
+ PUSH_ITER(rb_block_given_p()?ITER_PRE:ITER_NOT);
+ vid = rb_call(CLASS_OF(recv), recv, rb_to_id(vid), argc, argv, 1, Qundef);
+ POP_ITER();
+
+ return vid;
+}
+
+static VALUE
+vafuncall(recv, mid, n, ar)
+ VALUE recv;
+ ID mid;
+ int n;
+ va_list *ar;
+{
+ VALUE *argv;
+
+ if (n > 0) {
+ long i;
+
+ argv = ALLOCA_N(VALUE, n);
+
+ for (i=0;i<n;i++) {
+ argv[i] = va_arg(*ar, VALUE);
}
- iseq = iseq->parent_iseq;
+ va_end(*ar);
}
- return 0;
+ else {
+ argv = 0;
+ }
+
+ return rb_call(CLASS_OF(recv), recv, mid, n, argv, 1, Qundef);
+}
+
+VALUE
+#ifdef HAVE_STDARG_PROTOTYPES
+rb_funcall(VALUE recv, ID mid, int n, ...)
+#else
+rb_funcall(recv, mid, n, va_alist)
+ VALUE recv;
+ ID mid;
+ int n;
+ va_dcl
+#endif
+{
+ va_list ar;
+ va_init_list(ar, n);
+
+ return vafuncall(recv, mid, n, &ar);
+}
+
+VALUE
+#ifdef HAVE_STDARG_PROTOTYPES
+rb_funcall_rescue(VALUE recv, ID mid, int n, ...)
+#else
+rb_funcall_rescue(recv, mid, n, va_alist)
+ VALUE recv;
+ ID mid;
+ int n;
+ va_dcl
+#endif
+{
+ VALUE result = Qnil; /* OK */
+ int status;
+ va_list ar;
+
+ va_init_list(ar, n);
+
+ PUSH_TAG(PROT_NONE);
+ if ((status = EXEC_TAG()) == 0) {
+ result = vafuncall(recv, mid, n, &ar);
+ }
+ POP_TAG();
+ switch (status) {
+ case 0:
+ return result;
+ case TAG_RAISE:
+ return Qundef;
+ default:
+ JUMP_TAG(status);
+ }
+}
+
+VALUE
+rb_funcall2(recv, mid, argc, argv)
+ VALUE recv;
+ ID mid;
+ int argc;
+ const VALUE *argv;
+{
+ return rb_call(CLASS_OF(recv), recv, mid, argc, argv, 1, Qundef);
+}
+
+VALUE
+rb_funcall3(recv, mid, argc, argv)
+ VALUE recv;
+ ID mid;
+ int argc;
+ const VALUE *argv;
+{
+ return rb_call(CLASS_OF(recv), recv, mid, argc, argv, 0, Qundef);
+}
+
+VALUE
+rb_call_super(argc, argv)
+ int argc;
+ const VALUE *argv;
+{
+ VALUE result, self, klass;
+
+ if (ruby_frame->last_class == 0) {
+ rb_name_error(ruby_frame->last_func, "calling `super' from `%s' is prohibited",
+ rb_id2name(ruby_frame->orig_func));
+ }
+
+ self = ruby_frame->self;
+ klass = ruby_frame->last_class;
+ if (RCLASS(klass)->super == 0) {
+ return method_missing(self, ruby_frame->orig_func, argc, argv, CSTAT_SUPER);
+ }
+
+ PUSH_ITER(ruby_iter->iter ? ITER_PRE : ITER_NOT);
+ result = rb_call(RCLASS(klass)->super, self, ruby_frame->orig_func, argc, argv, 3, Qundef);
+ POP_ITER();
+
+ return result;
+}
+
+static VALUE
+backtrace(lev)
+ int lev;
+{
+ struct FRAME *frame = ruby_frame;
+ char buf[BUFSIZ];
+ VALUE ary;
+ NODE *n;
+
+ ary = rb_ary_new();
+ if (frame->last_func == ID_ALLOCATOR) {
+ frame = frame->prev;
+ }
+ if (lev < 0) {
+ ruby_set_current_source();
+ if (frame->last_func) {
+ snprintf(buf, BUFSIZ, "%s:%d:in `%s'",
+ ruby_sourcefile, ruby_sourceline,
+ rb_id2name(frame->last_func));
+ }
+ else if (ruby_sourceline == 0) {
+ snprintf(buf, BUFSIZ, "%s", ruby_sourcefile);
+ }
+ else {
+ snprintf(buf, BUFSIZ, "%s:%d", ruby_sourcefile, ruby_sourceline);
+ }
+ rb_ary_push(ary, rb_str_new2(buf));
+ if (lev < -1) return ary;
+ }
+ else {
+ while (lev-- > 0) {
+ frame = frame->prev;
+ if (!frame) {
+ ary = Qnil;
+ break;
+ }
+ }
+ }
+ for (; frame && (n = frame->node); frame = frame->prev) {
+ if (frame->prev && frame->prev->last_func) {
+ if (frame->prev->node == n) {
+ if (frame->prev->last_func == frame->last_func) continue;
+ }
+ snprintf(buf, BUFSIZ, "%s:%d:in `%s'",
+ n->nd_file, nd_line(n),
+ rb_id2name(frame->prev->last_func));
+ }
+ else {
+ snprintf(buf, BUFSIZ, "%s:%d", n->nd_file, nd_line(n));
+ }
+ rb_ary_push(ary, rb_str_new2(buf));
+ }
+
+ return ary;
+}
+
+/*
+ * call-seq:
+ * caller(start=1) => array
+ *
+ * Returns the current execution stack---an array containing strings in
+ * the form ``<em>file:line</em>'' or ``<em>file:line: in
+ * `method'</em>''. The optional _start_ parameter
+ * determines the number of initial stack entries to omit from the
+ * result.
+ *
+ * def a(skip)
+ * caller(skip)
+ * end
+ * def b(skip)
+ * a(skip)
+ * end
+ * def c(skip)
+ * b(skip)
+ * end
+ * c(0) #=> ["prog:2:in `a'", "prog:5:in `b'", "prog:8:in `c'", "prog:10"]
+ * c(1) #=> ["prog:5:in `b'", "prog:8:in `c'", "prog:11"]
+ * c(2) #=> ["prog:8:in `c'", "prog:12"]
+ * c(3) #=> ["prog:13"]
+ */
+
+static VALUE
+rb_f_caller(argc, argv)
+ int argc;
+ VALUE *argv;
+{
+ VALUE level;
+ int lev;
+
+ rb_scan_args(argc, argv, "01", &level);
+
+ if (NIL_P(level)) lev = 1;
+ else lev = NUM2INT(level);
+ if (lev < 0) rb_raise(rb_eArgError, "negative level (%d)", lev);
+
+ return backtrace(lev);
+}
+
+void
+rb_backtrace()
+{
+ long i;
+ VALUE ary;
+
+ ary = backtrace(-1);
+ for (i=0; i<RARRAY(ary)->len; i++) {
+ printf("\tfrom %s\n", RSTRING(RARRAY(ary)->ptr[i])->ptr);
+ }
+}
+
+static VALUE
+make_backtrace()
+{
+ return backtrace(-1);
}
ID
-rb_frame_this_func(void)
+rb_frame_last_func()
{
- return frame_func_id(GET_THREAD()->cfp);
+ return ruby_frame->last_func;
}
ID
-rb_frame_callee(void)
+rb_frame_this_func()
+{
+ return ruby_frame->orig_func;
+}
+
+static NODE*
+compile(src, file, line)
+ VALUE src;
+ const char *file;
+ int line;
+{
+ NODE *node;
+ int critical;
+
+ ruby_nerrs = 0;
+ StringValue(src);
+ critical = rb_thread_critical;
+ rb_thread_critical = Qtrue;
+ node = rb_compile_string(file, src, line);
+ rb_thread_critical = critical;
+
+ if (ruby_nerrs == 0) return node;
+ return 0;
+}
+
+static VALUE
+eval(self, src, scope, file, line)
+ VALUE self, src, scope;
+ const char *file;
+ int line;
+{
+ struct BLOCK *data = NULL;
+ volatile VALUE result = Qnil;
+ struct SCOPE * volatile old_scope;
+ struct BLOCK * volatile old_block;
+ struct RVarmap * volatile old_dyna_vars;
+ VALUE volatile old_cref;
+ int volatile old_vmode;
+ volatile VALUE old_wrapper;
+ struct FRAME frame;
+ NODE *nodesave = ruby_current_node;
+ volatile int iter = ruby_frame->iter;
+ volatile int safe = ruby_safe_level;
+ int state;
+
+ if (!NIL_P(scope)) {
+ if (!rb_obj_is_proc(scope)) {
+ rb_raise(rb_eTypeError, "wrong argument type %s (expected Proc/Binding)",
+ rb_obj_classname(scope));
+ }
+
+ Data_Get_Struct(scope, struct BLOCK, data);
+ /* PUSH BLOCK from data */
+ frame = data->frame;
+ frame.tmp = ruby_frame; /* gc protection */
+ ruby_frame = &(frame);
+ old_scope = ruby_scope;
+ ruby_scope = data->scope;
+ old_block = ruby_block;
+ ruby_block = data->prev;
+ old_dyna_vars = ruby_dyna_vars;
+ ruby_dyna_vars = data->dyna_vars;
+ old_vmode = scope_vmode;
+ scope_vmode = data->vmode;
+ old_cref = (VALUE)ruby_cref;
+ ruby_cref = data->cref;
+ old_wrapper = ruby_wrapper;
+ ruby_wrapper = data->wrapper;
+ if ((file == 0 || (line == 1 && strcmp(file, "(eval)") == 0)) && data->frame.node) {
+ file = data->frame.node->nd_file;
+ if (!file) file = "__builtin__";
+ line = nd_line(data->frame.node);
+ }
+
+ self = data->self;
+ ruby_frame->iter = data->iter;
+ }
+ else {
+ if (ruby_frame->prev) {
+ ruby_frame->iter = ruby_frame->prev->iter;
+ }
+ }
+ if (file == 0) {
+ ruby_set_current_source();
+ file = ruby_sourcefile;
+ line = ruby_sourceline;
+ }
+ PUSH_CLASS(data ? data->klass : ruby_class);
+ ruby_in_eval++;
+ if (TYPE(ruby_class) == T_ICLASS) {
+ ruby_class = RBASIC(ruby_class)->klass;
+ }
+ PUSH_TAG(PROT_NONE);
+ if ((state = EXEC_TAG()) == 0) {
+ NODE *node;
+
+ ruby_safe_level = 0;
+ result = ruby_errinfo;
+ ruby_errinfo = Qnil;
+ node = compile(src, file, line);
+ ruby_safe_level = safe;
+ if (ruby_nerrs > 0) {
+ compile_error(0);
+ }
+ if (!NIL_P(result)) ruby_errinfo = result;
+ result = eval_node(self, node);
+ }
+ POP_TAG();
+ POP_CLASS();
+ ruby_in_eval--;
+ if (!NIL_P(scope)) {
+ int dont_recycle = ruby_scope->flags & SCOPE_DONT_RECYCLE;
+
+ ruby_wrapper = old_wrapper;
+ ruby_cref = (NODE*)old_cref;
+ ruby_frame = frame.tmp;
+ ruby_scope = old_scope;
+ ruby_block = old_block;
+ ruby_dyna_vars = old_dyna_vars;
+ data->vmode = scope_vmode; /* write back visibility mode */
+ scope_vmode = old_vmode;
+ if (dont_recycle) {
+ struct tag *tag;
+ struct RVarmap *vars;
+
+ scope_dup(ruby_scope);
+ for (tag=prot_tag; tag; tag=tag->prev) {
+ scope_dup(tag->scope);
+ }
+ for (vars = ruby_dyna_vars; vars; vars = vars->next) {
+ FL_SET(vars, DVAR_DONT_RECYCLE);
+ }
+ }
+ }
+ else {
+ ruby_frame->iter = iter;
+ }
+ ruby_current_node = nodesave;
+ ruby_set_current_source();
+ if (state) {
+ if (state == TAG_RAISE) {
+ if (strcmp(file, "(eval)") == 0) {
+ VALUE mesg, errat, bt2;
+
+ errat = get_backtrace(ruby_errinfo);
+ mesg = rb_attr_get(ruby_errinfo, rb_intern("mesg"));
+ if (!NIL_P(errat) && TYPE(errat) == T_ARRAY &&
+ (bt2 = backtrace(-2), RARRAY_LEN(bt2) > 0)) {
+ if (!NIL_P(mesg) && TYPE(mesg) == T_STRING) {
+ rb_str_update(mesg, 0, 0, rb_str_new2(": "));
+ rb_str_update(mesg, 0, 0, RARRAY_PTR(errat)[0]);
+ }
+ RARRAY_PTR(errat)[0] = RARRAY_PTR(bt2)[0];
+ }
+ }
+ rb_exc_raise(ruby_errinfo);
+ }
+ JUMP_TAG(state);
+ }
+
+ return result;
+}
+
+/*
+ * call-seq:
+ * eval(string [, binding [, filename [,lineno]]]) => obj
+ *
+ * Evaluates the Ruby expression(s) in <em>string</em>. If
+ * <em>binding</em> is given, the evaluation is performed in its
+ * context. The binding may be a <code>Binding</code> object or a
+ * <code>Proc</code> object. If the optional <em>filename</em> and
+ * <em>lineno</em> parameters are present, they will be used when
+ * reporting syntax errors.
+ *
+ * def getBinding(str)
+ * return binding
+ * end
+ * str = "hello"
+ * eval "str + ' Fred'" #=> "hello Fred"
+ * eval "str + ' Fred'", getBinding("bye") #=> "bye Fred"
+ */
+
+static VALUE
+rb_f_eval(argc, argv, self)
+ int argc;
+ VALUE *argv;
+ VALUE self;
+{
+ VALUE src, scope, vfile, vline;
+ const char *file = "(eval)";
+ int line = 1;
+
+ rb_scan_args(argc, argv, "13", &src, &scope, &vfile, &vline);
+ if (ruby_safe_level >= 4) {
+ StringValue(src);
+ if (!NIL_P(scope) && !OBJ_TAINTED(scope)) {
+ rb_raise(rb_eSecurityError, "Insecure: can't modify trusted binding");
+ }
+ }
+ else {
+ SafeStringValue(src);
+ }
+ if (argc >= 3) {
+ StringValue(vfile);
+ }
+ if (argc >= 4) {
+ line = NUM2INT(vline);
+ }
+
+ if (!NIL_P(vfile)) file = RSTRING(vfile)->ptr;
+ if (NIL_P(scope) && ruby_frame->prev) {
+ struct FRAME *prev;
+ VALUE val;
+
+ prev = ruby_frame;
+ PUSH_FRAME();
+ *ruby_frame = *prev->prev;
+ ruby_frame->prev = prev;
+ val = eval(self, src, scope, file, line);
+ POP_FRAME();
+
+ return val;
+ }
+ return eval(self, src, scope, file, line);
+}
+
+/* function to call func under the specified class/module context */
+static VALUE
+exec_under(func, under, cbase, args)
+ VALUE (*func)();
+ VALUE under, cbase;
+ void *args;
+{
+ VALUE val = Qnil; /* OK */
+ int state;
+ int mode;
+ struct FRAME *f = ruby_frame;
+
+ PUSH_CLASS(under);
+ PUSH_FRAME();
+ ruby_frame->self = f->self;
+ ruby_frame->last_func = f->last_func;
+ ruby_frame->orig_func = f->orig_func;
+ ruby_frame->last_class = f->last_class;
+ ruby_frame->argc = f->argc;
+ if (cbase) {
+ PUSH_CREF(cbase);
+ }
+
+ mode = scope_vmode;
+ SCOPE_SET(SCOPE_PUBLIC);
+ PUSH_TAG(PROT_NONE);
+ if ((state = EXEC_TAG()) == 0) {
+ val = (*func)(args);
+ }
+ POP_TAG();
+ if (cbase) POP_CREF();
+ SCOPE_SET(mode);
+ POP_FRAME();
+ POP_CLASS();
+ if (state) JUMP_TAG(state);
+
+ return val;
+}
+
+static VALUE
+eval_under_i(args)
+ VALUE *args;
+{
+ struct FRAME *f = ruby_frame;
+
+ if (f && (f = f->prev) && (f = f->prev)) {
+ ruby_frame = f;
+ }
+ return eval(args[0], args[1], Qnil, (char*)args[2], (int)args[3]);
+}
+
+/* string eval under the class/module context */
+static VALUE
+eval_under(under, self, src, file, line)
+ VALUE under, self, src;
+ const char *file;
+ int line;
+{
+ VALUE args[4];
+
+ if (ruby_safe_level >= 4) {
+ StringValue(src);
+ }
+ else {
+ SafeStringValue(src);
+ }
+ args[0] = self;
+ args[1] = src;
+ args[2] = (VALUE)file;
+ args[3] = (VALUE)line;
+ return exec_under(eval_under_i, under, under, args);
+}
+
+static VALUE
+yield_under_i(self)
+ VALUE self;
+{
+ return rb_yield_0(self, self, ruby_class, YIELD_PUBLIC_DEF, Qfalse);
+}
+
+static VALUE
+yield_args_under_i(vinfo)
+ VALUE vinfo;
+{
+ VALUE *info = (VALUE *)vinfo;
+
+ return rb_yield_0(info[0], info[1], ruby_class, YIELD_PUBLIC_DEF, Qtrue);
+}
+
+/* block eval under the class/module context */
+static VALUE
+yield_under(under, self, args)
+ VALUE under, self, args;
+{
+ if (args == Qundef) {
+ return exec_under(yield_under_i, under, 0, self);
+ }
+ else {
+ VALUE info[2] = { args, self };
+
+ return exec_under(yield_args_under_i, under, 0, (VALUE)info);
+ }
+}
+
+static VALUE
+specific_eval(argc, argv, klass, self)
+ int argc;
+ VALUE *argv;
+ VALUE klass, self;
+{
+ if (rb_block_given_p()) {
+ if (argc > 0) {
+ rb_raise(rb_eArgError, "wrong number of arguments (%d for 0)", argc);
+ }
+ return yield_under(klass, self, Qundef);
+ }
+ else {
+ const char *file = "(eval)";
+ int line = 1;
+
+ if (argc == 0) {
+ rb_raise(rb_eArgError, "block not supplied");
+ }
+ else {
+ if (ruby_safe_level >= 4) {
+ StringValue(argv[0]);
+ }
+ else {
+ SafeStringValue(argv[0]);
+ }
+ if (argc > 3) {
+ rb_raise(rb_eArgError, "wrong number of arguments: %s(src) or %s{..}",
+ rb_id2name(ruby_frame->last_func),
+ rb_id2name(ruby_frame->last_func));
+ }
+ if (argc > 2) line = NUM2INT(argv[2]);
+ if (argc > 1) {
+ file = StringValuePtr(argv[1]);
+ }
+ }
+ return eval_under(klass, self, argv[0], file, line);
+ }
+}
+
+/*
+ * call-seq:
+ * obj.instance_eval(string [, filename [, lineno]] ) => obj
+ * obj.instance_eval {| | block } => obj
+ *
+ * Evaluates a string containing Ruby source code, or the given block,
+ * within the context of the receiver (_obj_). In order to set the
+ * context, the variable +self+ is set to _obj_ while
+ * the code is executing, giving the code access to _obj_'s
+ * instance variables. In the version of <code>instance_eval</code>
+ * that takes a +String+, the optional second and third
+ * parameters supply a filename and starting line number that are used
+ * when reporting compilation errors.
+ *
+ * class Klass
+ * def initialize
+ * @secret = 99
+ * end
+ * end
+ * k = Klass.new
+ * k.instance_eval { @secret } #=> 99
+ */
+
+VALUE
+rb_obj_instance_eval(argc, argv, self)
+ int argc;
+ VALUE *argv;
+ VALUE self;
+{
+ VALUE klass;
+
+ if (SPECIAL_CONST_P(self)) {
+ klass = Qnil;
+ }
+ else {
+ klass = rb_singleton_class(self);
+ }
+ return specific_eval(argc, argv, klass, self);
+}
+
+/*
+ * call-seq:
+ * obj.instance_exec(arg...) {|var...| block } => obj
+ *
+ * Executes the given block within the context of the receiver
+ * (_obj_). In order to set the context, the variable +self+ is set
+ * to _obj_ while the code is executing, giving the code access to
+ * _obj_'s instance variables. Arguments are passed as block parameters.
+ *
+ * class KlassWithSecret
+ * def initialize
+ * @secret = 99
+ * end
+ * end
+ * k = KlassWithSecret.new
+ * k.instance_exec(5) {|x| @secret+x } #=> 104
+ */
+
+VALUE
+rb_obj_instance_exec(argc, argv, self)
+ int argc;
+ VALUE *argv;
+ VALUE self;
+{
+ VALUE klass;
+
+ if (SPECIAL_CONST_P(self)) {
+ klass = Qnil;
+ }
+ else {
+ klass = rb_singleton_class(self);
+ }
+ return yield_under(klass, self, rb_ary_new4(argc, argv));
+}
+
+/*
+ * call-seq:
+ * mod.class_eval(string [, filename [, lineno]]) => obj
+ * mod.module_eval {|| block } => obj
+ *
+ * Evaluates the string or block in the context of _mod_. This can
+ * be used to add methods to a class. <code>module_eval</code> returns
+ * the result of evaluating its argument. The optional _filename_
+ * and _lineno_ parameters set the text for error messages.
+ *
+ * class Thing
+ * end
+ * a = %q{def hello() "Hello there!" end}
+ * Thing.module_eval(a)
+ * puts Thing.new.hello()
+ * Thing.module_eval("invalid code", "dummy", 123)
+ *
+ * <em>produces:</em>
+ *
+ * Hello there!
+ * dummy:123:in `module_eval': undefined local variable
+ * or method `code' for Thing:Class
+ */
+
+VALUE
+rb_mod_module_eval(argc, argv, mod)
+ int argc;
+ VALUE *argv;
+ VALUE mod;
+{
+ return specific_eval(argc, argv, mod, mod);
+}
+
+/*
+ * call-seq:
+ * mod.module_exec(arg...) {|var...| block } => obj
+ * mod.class_exec(arg...) {|var...| block } => obj
+ *
+ * Evaluates the given block in the context of the class/module.
+ * The method defined in the block will belong to the receiver.
+ *
+ * class Thing
+ * end
+ * Thing.class_exec{
+ * def hello() "Hello there!" end
+ * }
+ * puts Thing.new.hello()
+ *
+ * <em>produces:</em>
+ *
+ * Hello there!
+ */
+
+VALUE
+rb_mod_module_exec(argc, argv, mod)
+ int argc;
+ VALUE *argv;
+ VALUE mod;
+{
+ return yield_under(mod, mod, rb_ary_new4(argc, argv));
+}
+
+VALUE rb_load_path;
+
+NORETURN(static void load_failed _((VALUE)));
+
+void
+rb_load(fname, wrap)
+ VALUE fname;
+ int wrap;
+{
+ VALUE tmp;
+ int state;
+ volatile int prohibit_int = rb_prohibit_interrupt;
+ volatile ID last_func;
+ volatile VALUE wrapper = ruby_wrapper;
+ volatile VALUE self = ruby_top_self;
+ NODE *volatile last_node;
+ NODE *saved_cref = ruby_cref;
+
+ if (wrap && ruby_safe_level >= 4) {
+ StringValue(fname);
+ }
+ else {
+ SafeStringValue(fname);
+ }
+ fname = rb_str_new4(fname);
+ tmp = rb_find_file(fname);
+ if (!tmp) {
+ load_failed(fname);
+ }
+ fname = tmp;
+
+ ruby_errinfo = Qnil; /* ensure */
+ PUSH_VARS();
+ PUSH_CLASS(ruby_wrapper);
+ ruby_cref = ruby_top_cref;
+ if (!wrap) {
+ rb_secure(4); /* should alter global state */
+ ruby_class = rb_cObject;
+ ruby_wrapper = 0;
+ }
+ else {
+ /* load in anonymous module as toplevel */
+ ruby_class = ruby_wrapper = rb_module_new();
+ self = rb_obj_clone(ruby_top_self);
+ rb_extend_object(self, ruby_wrapper);
+ PUSH_CREF(ruby_wrapper);
+ }
+ PUSH_ITER(ITER_NOT);
+ PUSH_FRAME();
+ ruby_frame->last_func = 0;
+ ruby_frame->last_class = 0;
+ ruby_frame->self = self;
+ PUSH_SCOPE();
+ /* default visibility is private at loading toplevel */
+ SCOPE_SET(SCOPE_PRIVATE);
+ PUSH_TAG(PROT_NONE);
+ state = EXEC_TAG();
+ last_func = ruby_frame->last_func;
+ last_node = ruby_current_node;
+ if (!ruby_current_node && ruby_sourcefile) {
+ last_node = NEW_NEWLINE(0);
+ }
+ ruby_current_node = 0;
+ if (state == 0) {
+ NODE *node;
+ volatile int critical;
+
+ DEFER_INTS;
+ ruby_in_eval++;
+ critical = rb_thread_critical;
+ rb_thread_critical = Qtrue;
+ rb_load_file(RSTRING(fname)->ptr);
+ ruby_in_eval--;
+ node = ruby_eval_tree;
+ rb_thread_critical = critical;
+ ALLOW_INTS;
+ if (ruby_nerrs == 0) {
+ eval_node(self, node);
+ }
+ }
+ ruby_frame->last_func = last_func;
+ ruby_current_node = last_node;
+ ruby_sourcefile = 0;
+ ruby_set_current_source();
+ if (ruby_scope->flags == SCOPE_ALLOCA && ruby_class == rb_cObject) {
+ if (ruby_scope->local_tbl) /* toplevel was empty */
+ free(ruby_scope->local_tbl);
+ }
+ POP_TAG();
+ rb_prohibit_interrupt = prohibit_int;
+ ruby_cref = saved_cref;
+ POP_SCOPE();
+ POP_FRAME();
+ POP_ITER();
+ POP_CLASS();
+ POP_VARS();
+ ruby_wrapper = wrapper;
+ if (ruby_nerrs > 0) {
+ ruby_nerrs = 0;
+ rb_exc_raise(ruby_errinfo);
+ }
+ if (state) jump_tag_but_local_jump(state, Qundef);
+ if (!NIL_P(ruby_errinfo)) /* exception during load */
+ rb_exc_raise(ruby_errinfo);
+}
+
+void
+rb_load_protect(fname, wrap, state)
+ VALUE fname;
+ int wrap;
+ int *state;
+{
+ int status;
+
+ PUSH_TAG(PROT_NONE);
+ if ((status = EXEC_TAG()) == 0) {
+ rb_load(fname, wrap);
+ }
+ POP_TAG();
+ if (state) *state = status;
+}
+
+/*
+ * call-seq:
+ * load(filename, wrap=false) => true
+ *
+ * Loads and executes the Ruby
+ * program in the file _filename_. If the filename does not
+ * resolve to an absolute path, the file is searched for in the library
+ * directories listed in <code>$:</code>. If the optional _wrap_
+ * parameter is +true+, the loaded script will be executed
+ * under an anonymous module, protecting the calling program's global
+ * namespace. In no circumstance will any local variables in the loaded
+ * file be propagated to the loading environment.
+ */
+
+
+static VALUE
+rb_f_load(argc, argv)
+ int argc;
+ VALUE *argv;
+{
+ VALUE fname, wrap;
+
+ rb_scan_args(argc, argv, "11", &fname, &wrap);
+ rb_load(fname, RTEST(wrap));
+ return Qtrue;
+}
+
+VALUE ruby_dln_librefs;
+static VALUE rb_features;
+static st_table *loading_tbl;
+
+#define IS_SOEXT(e) (strcmp(e, ".so") == 0 || strcmp(e, ".o") == 0)
+#ifdef DLEXT2
+#define IS_DLEXT(e) (strcmp(e, DLEXT) == 0 || strcmp(e, DLEXT2) == 0)
+#else
+#define IS_DLEXT(e) (strcmp(e, DLEXT) == 0)
+#endif
+
+
+static const char *const loadable_ext[] = {
+ ".rb", DLEXT,
+#ifdef DLEXT2
+ DLEXT2,
+#endif
+ 0
+};
+
+static int rb_feature_p _((const char **, const char *, int));
+static int search_required _((VALUE, VALUE *, VALUE *));
+
+static int
+rb_feature_p(ftptr, ext, rb)
+ const char **ftptr, *ext;
+ int rb;
+{
+ VALUE v;
+ const char *f, *e, *feature = *ftptr;
+ long i, len, elen;
+
+ if (ext) {
+ len = ext - feature;
+ elen = strlen(ext);
+ }
+ else {
+ len = strlen(feature);
+ elen = 0;
+ }
+ for (i = 0; i < RARRAY_LEN(rb_features); ++i) {
+ v = RARRAY_PTR(rb_features)[i];
+ f = StringValuePtr(v);
+ if (RSTRING_LEN(v) < len || strncmp(f, feature, len) != 0)
+ continue;
+ if (!*(e = f + len)) {
+ if (ext) continue;
+ *ftptr = 0;
+ return 'u';
+ }
+ if (*e != '.') continue;
+ if ((!rb || !ext) && (IS_SOEXT(e) || IS_DLEXT(e))) {
+ *ftptr = 0;
+ return 's';
+ }
+ if ((rb || !ext) && (strcmp(e, ".rb") == 0)) {
+ *ftptr = 0;
+ return 'r';
+ }
+ }
+ if (loading_tbl) {
+ if (st_lookup(loading_tbl, (st_data_t)feature, (st_data_t *)ftptr)) {
+ if (!ext) return 'u';
+ return strcmp(ext, ".rb") ? 's' : 'r';
+ }
+ else {
+ char *buf;
+
+ if (ext && *ext) return 0;
+ buf = ALLOCA_N(char, len + DLEXT_MAXLEN + 1);
+ MEMCPY(buf, feature, char, len);
+ for (i = 0; (e = loadable_ext[i]) != 0; i++) {
+ strncpy(buf + len, e, DLEXT_MAXLEN + 1);
+ if (st_lookup(loading_tbl, (st_data_t)buf, (st_data_t *)ftptr)) {
+ return i ? 's' : 'r';
+ }
+ }
+ }
+ }
+ return 0;
+}
+#define rb_feature_p(feature, ext, rb) rb_feature_p(&feature, ext, rb)
+
+int
+rb_provided(feature)
+ const char *feature;
+{
+ const char *ext = strrchr(feature, '.');
+
+ if (ext && !strchr(ext, '/')) {
+ if (strcmp(".rb", ext) == 0) {
+ if (rb_feature_p(feature, ext, Qtrue)) return Qtrue;
+ return Qfalse;
+ }
+ else if (IS_SOEXT(ext) || IS_DLEXT(ext)) {
+ if (rb_feature_p(feature, ext, Qfalse)) return Qtrue;
+ return Qfalse;
+ }
+ }
+ if (rb_feature_p(feature, feature + strlen(feature), Qtrue))
+ return Qtrue;
+
+ return Qfalse;
+}
+
+static void
+rb_provide_feature(feature)
+ VALUE feature;
{
- return frame_func_id(GET_THREAD()->cfp);
+ rb_ary_push(rb_features, feature);
}
-static ID
-rb_frame_caller(void)
+void
+rb_provide(feature)
+ const char *feature;
{
- rb_thread_t *th = GET_THREAD();
- rb_control_frame_t *prev_cfp = RUBY_VM_PREVIOUS_CONTROL_FRAME(th->cfp);
- /* check if prev_cfp can be accessible */
- if ((void *)(th->stack + th->stack_size) == (void *)(prev_cfp)) {
- return 0;
+ rb_provide_feature(rb_str_new2(feature));
+}
+
+static char *
+load_lock(ftptr)
+ const char *ftptr;
+{
+ st_data_t th;
+
+ if (!loading_tbl ||
+ !st_lookup(loading_tbl, (st_data_t)ftptr, &th))
+ {
+ /* loading ruby library should be serialized. */
+ if (!loading_tbl) {
+ loading_tbl = st_init_strtable();
+ }
+ /* partial state */
+ ftptr = ruby_strdup(ftptr);
+ st_insert(loading_tbl, (st_data_t)ftptr, (st_data_t)curr_thread);
+ return (char *)ftptr;
}
- return frame_func_id(prev_cfp);
+ do {
+ rb_thread_t owner = (rb_thread_t)th;
+ if (owner == curr_thread) return 0;
+ rb_thread_join(owner->thread, -1.0);
+ } while (st_lookup(loading_tbl, (st_data_t)ftptr, &th));
+ return 0;
+}
+
+static void
+load_unlock(const char *ftptr)
+{
+ if (ftptr) {
+ st_data_t key = (st_data_t)ftptr;
+
+ if (st_delete(loading_tbl, &key, 0)) {
+ free((char *)key);
+ }
+ }
+}
+
+/*
+ * call-seq:
+ * require(string) => true or false
+ *
+ * Ruby tries to load the library named _string_, returning
+ * +true+ if successful. If the filename does not resolve to
+ * an absolute path, it will be searched for in the directories listed
+ * in <code>$:</code>. If the file has the extension ``.rb'', it is
+ * loaded as a source file; if the extension is ``.so'', ``.o'', or
+ * ``.dll'', or whatever the default shared library extension is on
+ * the current platform, Ruby loads the shared library as a Ruby
+ * extension. Otherwise, Ruby tries adding ``.rb'', ``.so'', and so on
+ * to the name. The name of the loaded feature is added to the array in
+ * <code>$"</code>. A feature will not be loaded if it's name already
+ * appears in <code>$"</code>. However, the file name is not converted
+ * to an absolute path, so that ``<code>require 'a';require
+ * './a'</code>'' will load <code>a.rb</code> twice.
+ *
+ * require "my-library.rb"
+ * require "db-driver"
+ */
+
+VALUE
+rb_f_require(obj, fname)
+ VALUE obj, fname;
+{
+ return rb_require_safe(fname, ruby_safe_level);
+}
+
+static int
+search_required(fname, featurep, path)
+ VALUE fname, *featurep, *path;
+{
+ VALUE tmp;
+ const char *ext, *ftptr;
+ int type;
+
+ *featurep = fname;
+ *path = 0;
+ ext = strrchr(ftptr = RSTRING_PTR(fname), '.');
+ if (ext && !strchr(ext, '/')) {
+ if (strcmp(".rb", ext) == 0) {
+ if (rb_feature_p(ftptr, ext, Qtrue)) {
+ if (ftptr) *path = rb_str_new2(ftptr);
+ return 'r';
+ }
+ if ((*path = rb_find_file(fname)) != 0) return 'r';
+ return 0;
+ }
+ else if (IS_SOEXT(ext)) {
+ if (rb_feature_p(ftptr, ext, Qfalse)) {
+ if (ftptr) *path = rb_str_new2(ftptr);
+ return 's';
+ }
+ tmp = rb_str_new(RSTRING_PTR(fname), ext-RSTRING_PTR(fname));
+ *featurep = tmp;
+#ifdef DLEXT2
+ OBJ_FREEZE(tmp);
+ if (rb_find_file_ext(&tmp, loadable_ext+1)) {
+ *featurep = tmp;
+ *path = rb_find_file(tmp);
+ return 's';
+ }
+#else
+ rb_str_cat2(tmp, DLEXT);
+ OBJ_FREEZE(tmp);
+ if ((*path = rb_find_file(tmp)) != 0) {
+ return 's';
+ }
+#endif
+ }
+ else if (IS_DLEXT(ext)) {
+ if (rb_feature_p(ftptr, ext, Qfalse)) {
+ if (ftptr) *path = rb_str_new2(ftptr);
+ return 's';
+ }
+ if ((*path = rb_find_file(fname)) != 0) return 's';
+ }
+ }
+ tmp = fname;
+ type = rb_find_file_ext(&tmp, loadable_ext);
+ *featurep = tmp;
+ switch (type) {
+ case 0:
+ type = rb_feature_p(ftptr, 0, Qfalse);
+ if (type && ftptr) *path = rb_str_new2(ftptr);
+ return type;
+
+ default:
+ ext = strrchr(ftptr = RSTRING(tmp)->ptr, '.');
+ if (!rb_feature_p(ftptr, ext, !--type))
+ *path = rb_find_file(tmp);
+ else if (ftptr)
+ *path = rb_str_new2(ftptr);
+ }
+ return type ? 's' : 'r';
+}
+
+static void
+load_failed(fname)
+ VALUE fname;
+{
+ rb_raise(rb_eLoadError, "no such file to load -- %s", RSTRING(fname)->ptr);
+}
+
+VALUE
+rb_require_safe(fname, safe)
+ VALUE fname;
+ int safe;
+{
+ VALUE result = Qnil;
+ volatile VALUE errinfo = ruby_errinfo;
+ int state;
+ struct {
+ NODE *node;
+ ID func;
+ int vmode, safe;
+ } volatile saved;
+ char *volatile ftptr = 0;
+
+ if (OBJ_TAINTED(fname)) {
+ rb_check_safe_obj(fname);
+ }
+ StringValue(fname);
+ fname = rb_str_new4(fname);
+ saved.vmode = scope_vmode;
+ saved.node = ruby_current_node;
+ saved.func = ruby_frame->last_func;
+ saved.safe = ruby_safe_level;
+ PUSH_TAG(PROT_NONE);
+ if ((state = EXEC_TAG()) == 0) {
+ VALUE feature, path;
+ long handle;
+ int found;
+
+ ruby_safe_level = safe;
+ found = search_required(fname, &feature, &path);
+ if (found) {
+ if (!path || !(ftptr = load_lock(RSTRING_PTR(feature)))) {
+ result = Qfalse;
+ }
+ else {
+ ruby_safe_level = 0;
+ switch (found) {
+ case 'r':
+ rb_load(path, 0);
+ break;
+
+ case 's':
+ ruby_current_node = 0;
+ ruby_sourcefile = rb_source_filename(RSTRING(path)->ptr);
+ ruby_sourceline = 0;
+ ruby_frame->last_func = 0;
+ SCOPE_SET(SCOPE_PUBLIC);
+ handle = (long)dln_load(RSTRING(path)->ptr);
+ rb_ary_push(ruby_dln_librefs, LONG2NUM(handle));
+ break;
+ }
+ rb_provide_feature(feature);
+ result = Qtrue;
+ }
+ }
+ }
+ POP_TAG();
+ ruby_current_node = saved.node;
+ ruby_set_current_source();
+ ruby_frame->last_func = saved.func;
+ SCOPE_SET(saved.vmode);
+ ruby_safe_level = saved.safe;
+ load_unlock(ftptr);
+ if (state) JUMP_TAG(state);
+ if (NIL_P(result)) {
+ load_failed(fname);
+ }
+ ruby_errinfo = errinfo;
+
+ return result;
+}
+
+VALUE
+rb_require(fname)
+ const char *fname;
+{
+ VALUE fn = rb_str_new2(fname);
+ OBJ_FREEZE(fn);
+ return rb_require_safe(fn, ruby_safe_level);
}
void
-rb_frame_pop(void)
+ruby_init_ext(name, init)
+ const char *name;
+ void (*init) _((void));
{
- rb_thread_t *th = GET_THREAD();
- th->cfp = RUBY_VM_PREVIOUS_CONTROL_FRAME(th->cfp);
+ ruby_current_node = 0;
+ ruby_sourcefile = rb_source_filename(name);
+ ruby_sourceline = 0;
+ ruby_frame->last_func = 0;
+ ruby_frame->orig_func = 0;
+ SCOPE_SET(SCOPE_PUBLIC);
+ if (load_lock(name)) {
+ (*init)();
+ rb_provide(name);
+ load_unlock(name);
+ }
+}
+
+static void
+secure_visibility(self)
+ VALUE self;
+{
+ if (ruby_safe_level >= 4 && !OBJ_TAINTED(self)) {
+ rb_raise(rb_eSecurityError, "Insecure: can't change method visibility");
+ }
+}
+
+static void
+set_method_visibility(self, argc, argv, ex)
+ VALUE self;
+ int argc;
+ VALUE *argv;
+ ID ex;
+{
+ int i;
+
+ secure_visibility(self);
+ for (i=0; i<argc; i++) {
+ rb_export_method(self, rb_to_id(argv[i]), ex);
+ }
+ rb_clear_cache_by_class(self);
+}
+
+/*
+ * call-seq:
+ * public => self
+ * public(symbol, ...) => self
+ *
+ * With no arguments, sets the default visibility for subsequently
+ * defined methods to public. With arguments, sets the named methods to
+ * have public visibility.
+ */
+
+static VALUE
+rb_mod_public(argc, argv, module)
+ int argc;
+ VALUE *argv;
+ VALUE module;
+{
+ secure_visibility(module);
+ if (argc == 0) {
+ SCOPE_SET(SCOPE_PUBLIC);
+ }
+ else {
+ set_method_visibility(module, argc, argv, NOEX_PUBLIC);
+ }
+ return module;
+}
+
+/*
+ * call-seq:
+ * protected => self
+ * protected(symbol, ...) => self
+ *
+ * With no arguments, sets the default visibility for subsequently
+ * defined methods to protected. With arguments, sets the named methods
+ * to have protected visibility.
+ */
+
+static VALUE
+rb_mod_protected(argc, argv, module)
+ int argc;
+ VALUE *argv;
+ VALUE module;
+{
+ secure_visibility(module);
+ if (argc == 0) {
+ SCOPE_SET(SCOPE_PROTECTED);
+ }
+ else {
+ set_method_visibility(module, argc, argv, NOEX_PROTECTED);
+ }
+ return module;
+}
+
+/*
+ * call-seq:
+ * private => self
+ * private(symbol, ...) => self
+ *
+ * With no arguments, sets the default visibility for subsequently
+ * defined methods to private. With arguments, sets the named methods
+ * to have private visibility.
+ *
+ * module Mod
+ * def a() end
+ * def b() end
+ * private
+ * def c() end
+ * private :a
+ * end
+ * Mod.private_instance_methods #=> ["a", "c"]
+ */
+
+static VALUE
+rb_mod_private(argc, argv, module)
+ int argc;
+ VALUE *argv;
+ VALUE module;
+{
+ secure_visibility(module);
+ if (argc == 0) {
+ SCOPE_SET(SCOPE_PRIVATE);
+ }
+ else {
+ set_method_visibility(module, argc, argv, NOEX_PRIVATE);
+ }
+ return module;
+}
+
+/*
+ * call-seq:
+ * mod.public_class_method(symbol, ...) => mod
+ *
+ * Makes a list of existing class methods public.
+ */
+
+static VALUE
+rb_mod_public_method(argc, argv, obj)
+ int argc;
+ VALUE *argv;
+ VALUE obj;
+{
+ set_method_visibility(CLASS_OF(obj), argc, argv, NOEX_PUBLIC);
+ return obj;
+}
+
+/*
+ * call-seq:
+ * mod.private_class_method(symbol, ...) => mod
+ *
+ * Makes existing class methods private. Often used to hide the default
+ * constructor <code>new</code>.
+ *
+ * class SimpleSingleton # Not thread safe
+ * private_class_method :new
+ * def SimpleSingleton.create(*args, &block)
+ * @me = new(*args, &block) if ! @me
+ * @me
+ * end
+ * end
+ */
+
+static VALUE
+rb_mod_private_method(argc, argv, obj)
+ int argc;
+ VALUE *argv;
+ VALUE obj;
+{
+ set_method_visibility(CLASS_OF(obj), argc, argv, NOEX_PRIVATE);
+ return obj;
+}
+
+/*
+ * call-seq:
+ * public
+ * public(symbol, ...)
+ *
+ * With no arguments, sets the default visibility for subsequently
+ * defined methods to public. With arguments, sets the named methods to
+ * have public visibility.
+ */
+
+static VALUE
+top_public(argc, argv)
+ int argc;
+ VALUE *argv;
+{
+ return rb_mod_public(argc, argv, rb_cObject);
+}
+
+static VALUE
+top_private(argc, argv)
+ int argc;
+ VALUE *argv;
+{
+ return rb_mod_private(argc, argv, rb_cObject);
+}
+
+/*
+ * call-seq:
+ * module_function(symbol, ...) => self
+ *
+ * Creates module functions for the named methods. These functions may
+ * be called with the module as a receiver, and also become available
+ * as instance methods to classes that mix in the module. Module
+ * functions are copies of the original, and so may be changed
+ * independently. The instance-method versions are made private. If
+ * used with no arguments, subsequently defined methods become module
+ * functions.
+ *
+ * module Mod
+ * def one
+ * "This is one"
+ * end
+ * module_function :one
+ * end
+ * class Cls
+ * include Mod
+ * def callOne
+ * one
+ * end
+ * end
+ * Mod.one #=> "This is one"
+ * c = Cls.new
+ * c.callOne #=> "This is one"
+ * module Mod
+ * def one
+ * "This is the new one"
+ * end
+ * end
+ * Mod.one #=> "This is one"
+ * c.callOne #=> "This is the new one"
+ */
+
+static VALUE
+rb_mod_modfunc(argc, argv, module)
+ int argc;
+ VALUE *argv;
+ VALUE module;
+{
+ int i;
+ ID id;
+ NODE *body;
+
+ if (TYPE(module) != T_MODULE) {
+ rb_raise(rb_eTypeError, "module_function must be called for modules");
+ }
+
+ secure_visibility(module);
+ if (argc == 0) {
+ SCOPE_SET(SCOPE_MODFUNC);
+ return module;
+ }
+
+ set_method_visibility(module, argc, argv, NOEX_PRIVATE);
+ for (i=0; i<argc; i++) {
+ VALUE m = module;
+
+ id = rb_to_id(argv[i]);
+ for (;;) {
+ body = search_method(m, id, &m);
+ if (body == 0) {
+ body = search_method(rb_cObject, id, &m);
+ }
+ if (body == 0 || body->nd_body == 0) {
+ print_undef(module, id);
+ }
+ if (nd_type(body->nd_body) != NODE_ZSUPER) {
+ break; /* normal case: need not to follow 'super' link */
+ }
+ m = RCLASS(m)->super;
+ if (!m) break;
+ }
+ rb_add_method(rb_singleton_class(module), id, body->nd_body, NOEX_PUBLIC);
+ }
+ return module;
}
/*
* call-seq:
* append_features(mod) => mod
- *
+ *
* When this module is included in another, Ruby calls
* <code>append_features</code> in this module, passing it the
* receiving module in _mod_. Ruby's default implementation is
@@ -745,7 +7742,8 @@ rb_frame_pop(void)
*/
static VALUE
-rb_mod_append_features(VALUE module, VALUE include)
+rb_mod_append_features(module, include)
+ VALUE module, include;
{
switch (TYPE(include)) {
case T_CLASS:
@@ -763,17 +7761,19 @@ rb_mod_append_features(VALUE module, VALUE include)
/*
* call-seq:
* include(module, ...) => self
- *
+ *
* Invokes <code>Module.append_features</code> on each parameter in turn.
*/
static VALUE
-rb_mod_include(int argc, VALUE *argv, VALUE module)
+rb_mod_include(argc, argv, module)
+ int argc;
+ VALUE *argv;
+ VALUE module;
{
int i;
- for (i = 0; i < argc; i++)
- Check_Type(argv[i], T_MODULE);
+ for (i=0; i<argc; i++) Check_Type(argv[i], T_MODULE);
while (argc--) {
rb_funcall(argv[argc], rb_intern("append_features"), 1, module);
rb_funcall(argv[argc], rb_intern("included"), 1, module);
@@ -782,14 +7782,19 @@ rb_mod_include(int argc, VALUE *argv, VALUE module)
}
void
-rb_obj_call_init(VALUE obj, int argc, VALUE *argv)
+rb_obj_call_init(obj, argc, argv)
+ VALUE obj;
+ int argc;
+ VALUE *argv;
{
- PASS_PASSED_BLOCK();
- rb_funcall2(obj, idInitialize, argc, argv);
+ PUSH_ITER(rb_block_given_p()?ITER_PRE:ITER_NOT);
+ rb_funcall2(obj, init, argc, argv);
+ POP_ITER();
}
void
-rb_extend_object(VALUE obj, VALUE module)
+rb_extend_object(obj, module)
+ VALUE obj, module;
{
rb_include_module(rb_singleton_class(obj), module);
}
@@ -797,11 +7802,11 @@ rb_extend_object(VALUE obj, VALUE module)
/*
* call-seq:
* extend_object(obj) => obj
- *
+ *
* 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 <code>Object#extend</code>.
- *
+ *
* module Picky
* def Picky.extend_object(o)
* if String === o
@@ -814,15 +7819,16 @@ rb_extend_object(VALUE obj, VALUE module)
* end
* (s = Array.new).extend Picky # Call Object.extend
* (s = "quick brown fox").extend Picky
- *
+ *
* <em>produces:</em>
- *
+ *
* Picky added to Array
* Can't add Picky to a String
*/
static VALUE
-rb_mod_extend_object(VALUE mod, VALUE obj)
+rb_mod_extend_object(mod, obj)
+ VALUE mod, obj;
{
rb_extend_object(obj, mod);
return obj;
@@ -831,22 +7837,22 @@ rb_mod_extend_object(VALUE mod, VALUE obj)
/*
* call-seq:
* obj.extend(module, ...) => obj
- *
+ *
* Adds to _obj_ the instance methods from each module given as a
* parameter.
- *
+ *
* module Mod
* def hello
* "Hello from Mod.\n"
* end
* end
- *
+ *
* class Klass
* def hello
* "Hello from Klass.\n"
* end
* end
- *
+ *
* k = Klass.new
* k.hello #=> "Hello from Klass.\n"
* k.extend(Mod) #=> #<Klass:0x401b3bc8>
@@ -854,15 +7860,17 @@ rb_mod_extend_object(VALUE mod, VALUE obj)
*/
static VALUE
-rb_obj_extend(int argc, VALUE *argv, VALUE obj)
+rb_obj_extend(argc, argv, obj)
+ int argc;
+ VALUE *argv;
+ VALUE obj;
{
int i;
if (argc == 0) {
rb_raise(rb_eArgError, "wrong number of arguments (0 for 1)");
}
- for (i = 0; i < argc; i++)
- Check_Type(argv[i], T_MODULE);
+ for (i=0; i<argc; i++) Check_Type(argv[i], T_MODULE);
while (argc--) {
rb_funcall(argv[argc], rb_intern("extend_object"), 1, obj);
rb_funcall(argv[argc], rb_intern("extended"), 1, obj);
@@ -873,22 +7881,22 @@ rb_obj_extend(int argc, VALUE *argv, VALUE obj)
/*
* call-seq:
* include(module, ...) => self
- *
+ *
* 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
-top_include(int argc, VALUE *argv, VALUE self)
+top_include(argc, argv, self)
+ int argc;
+ VALUE *argv;
+ VALUE self;
{
- rb_thread_t *th = GET_THREAD();
-
rb_secure(4);
- if (th->top_wrapper) {
- rb_warning
- ("main#include in the wrapped load is effective only in wrapper module");
- return rb_mod_include(argc, argv, th->top_wrapper);
+ if (ruby_wrapper) {
+ rb_warning("main#include in the wrapped load is effective only in wrapper module");
+ return rb_mod_include(argc, argv, ruby_wrapper);
}
return rb_mod_include(argc, argv, rb_cObject);
}
@@ -896,173 +7904,5793 @@ top_include(int argc, VALUE *argv, VALUE self)
VALUE rb_f_trace_var();
VALUE rb_f_untrace_var();
-static VALUE *
-errinfo_place(void)
+static void
+errinfo_setter(val, id, var)
+ 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 $!");
+ }
+ *var = val;
+}
+
+static VALUE
+errat_getter(id)
+ ID id;
+{
+ return get_backtrace(ruby_errinfo);
+}
+
+static void
+errat_setter(val, id, var)
+ VALUE val;
+ ID id;
+ VALUE *var;
+{
+ if (NIL_P(ruby_errinfo)) {
+ rb_raise(rb_eArgError, "$! not set");
+ }
+ set_backtrace(ruby_errinfo, val);
+}
+
+/*
+ * call-seq:
+ * local_variables => array
+ *
+ * Returns the names of the current local variables.
+ *
+ * fred = 1
+ * for i in 1..10
+ * # ...
+ * end
+ * local_variables #=> ["fred", "i"]
+ */
+
+static VALUE
+rb_f_local_variables()
+{
+ ID *tbl;
+ int n, i;
+ VALUE ary = rb_ary_new();
+ struct RVarmap *vars;
+
+ tbl = ruby_scope->local_tbl;
+ if (tbl) {
+ n = *tbl++;
+ for (i=2; i<n; i++) { /* skip first 2 ($_ and $~) */
+ if (!rb_is_local_id(tbl[i])) continue; /* skip flip states */
+ rb_ary_push(ary, rb_str_new2(rb_id2name(tbl[i])));
+ }
+ }
+
+ vars = ruby_dyna_vars;
+ while (vars) {
+ if (vars->id && rb_is_local_id(vars->id)) { /* skip $_, $~ and flip states */
+ rb_ary_push(ary, rb_str_new2(rb_id2name(vars->id)));
+ }
+ vars = vars->next;
+ }
+
+ return ary;
+}
+
+static VALUE rb_f_catch _((VALUE,VALUE));
+NORETURN(static VALUE rb_f_throw _((int,VALUE*)));
+
+struct end_proc_data {
+ void (*func)();
+ VALUE data;
+ int safe;
+ struct end_proc_data *next;
+};
+
+static struct end_proc_data *end_procs, *ephemeral_end_procs, *tmp_end_procs;
+
+void
+rb_set_end_proc(func, data)
+ void (*func) _((VALUE));
+ VALUE data;
{
- rb_thread_t *th = GET_THREAD();
- rb_control_frame_t *cfp = th->cfp;
- rb_control_frame_t *end_cfp = RUBY_VM_END_CONTROL_FRAME(th);
+ struct end_proc_data *link = ALLOC(struct end_proc_data);
+ struct end_proc_data **list;
+
+ if (ruby_wrapper) list = &ephemeral_end_procs;
+ else list = &end_procs;
+ link->next = *list;
+ link->func = func;
+ link->data = data;
+ link->safe = ruby_safe_level;
+ *list = link;
+}
- while (RUBY_VM_VALID_CONTROL_FRAME_P(cfp, end_cfp)) {
- if (RUBY_VM_NORMAL_ISEQ_P(cfp->iseq)) {
- if (cfp->iseq->type == ISEQ_TYPE_RESCUE) {
- return &cfp->dfp[-2];
+void
+rb_mark_end_proc()
+{
+ struct end_proc_data *link;
+
+ link = end_procs;
+ while (link) {
+ rb_gc_mark(link->data);
+ link = link->next;
+ }
+ link = ephemeral_end_procs;
+ while (link) {
+ rb_gc_mark(link->data);
+ link = link->next;
+ }
+ link = tmp_end_procs;
+ while (link) {
+ rb_gc_mark(link->data);
+ link = link->next;
+ }
+}
+
+static void call_end_proc _((VALUE data));
+
+static void
+call_end_proc(data)
+ VALUE data;
+{
+ PUSH_ITER(ITER_NOT);
+ PUSH_FRAME();
+ ruby_frame->self = ruby_frame->prev->self;
+ ruby_frame->node = 0;
+ ruby_frame->last_func = 0;
+ ruby_frame->last_class = 0;
+ proc_invoke(data, rb_ary_new2(0), Qundef, 0);
+ POP_FRAME();
+ POP_ITER();
+}
+
+static void
+rb_f_END()
+{
+ PUSH_FRAME();
+ ruby_frame->argc = 0;
+ ruby_frame->iter = ITER_CUR;
+ rb_set_end_proc(call_end_proc, rb_block_proc());
+ POP_FRAME();
+}
+
+/*
+ * call-seq:
+ * at_exit { block } -> proc
+ *
+ * Converts _block_ to a +Proc+ object (and therefore
+ * binds it at the point of call) and registers it for execution when
+ * the program exits. If multiple handlers are registered, they are
+ * executed in reverse order of registration.
+ *
+ * def do_at_exit(str1)
+ * at_exit { print str1 }
+ * end
+ * at_exit { puts "cruel world" }
+ * do_at_exit("goodbye ")
+ * exit
+ *
+ * <em>produces:</em>
+ *
+ * goodbye cruel world
+ */
+
+static VALUE
+rb_f_at_exit()
+{
+ VALUE proc;
+
+ if (!rb_block_given_p()) {
+ rb_raise(rb_eArgError, "called without a block");
+ }
+ proc = rb_block_proc();
+ rb_set_end_proc(call_end_proc, proc);
+ return proc;
+}
+
+void
+rb_exec_end_proc()
+{
+ struct end_proc_data *link, *tmp;
+ int status;
+ volatile int safe = ruby_safe_level;
+
+ while (ephemeral_end_procs) {
+ tmp_end_procs = link = ephemeral_end_procs;
+ ephemeral_end_procs = 0;
+ while (link) {
+ PUSH_TAG(PROT_NONE);
+ if ((status = EXEC_TAG()) == 0) {
+ ruby_safe_level = link->safe;
+ (*link->func)(link->data);
}
- else if (cfp->iseq->type == ISEQ_TYPE_ENSURE &&
- TYPE(cfp->dfp[-2]) != T_NODE &&
- !FIXNUM_P(cfp->dfp[-2])) {
- return &cfp->dfp[-2];
+ POP_TAG();
+ if (status) {
+ error_handle(status);
}
+ tmp = link;
+ tmp_end_procs = link = link->next;
+ free(tmp);
}
- cfp = RUBY_VM_PREVIOUS_CONTROL_FRAME(cfp);
}
- return 0;
+ while (end_procs) {
+ tmp_end_procs = link = end_procs;
+ end_procs = 0;
+ while (link) {
+ PUSH_TAG(PROT_NONE);
+ if ((status = EXEC_TAG()) == 0) {
+ ruby_safe_level = link->safe;
+ (*link->func)(link->data);
+ }
+ POP_TAG();
+ if (status) {
+ error_handle(status);
+ }
+ tmp = link;
+ tmp_end_procs = link = link->next;
+ free(tmp);
+ }
+ }
+ ruby_safe_level = safe;
}
+/*
+ * call-seq:
+ * __method__ => symbol
+ *
+ * Returns the name of the current method as a Symbol.
+ * If called from inside of an aliased method it will return the original
+ * nonaliased name.
+ * If called outside of a method, it returns <code>nil</code>.
+ *
+ * def foo
+ * __method__
+ * end
+ * alias bar foo
+ *
+ * foo # => :foo
+ * bar # => :foo
+ *
+ */
+
static VALUE
-get_errinfo(void)
+rb_f_method_name()
{
- VALUE *ptr = errinfo_place();
- if (ptr) {
- return *ptr;
+ struct FRAME* prev = ruby_frame->prev;
+ if (prev && prev->orig_func) {
+ return ID2SYM(prev->orig_func);
}
else {
- rb_thread_t *th = GET_THREAD();
- return th->errinfo;
+ return Qnil;
}
}
+void
+Init_eval()
+{
+ init = rb_intern("initialize");
+ eqq = rb_intern("===");
+ each = rb_intern("each");
+
+ aref = rb_intern("[]");
+ aset = rb_intern("[]=");
+ match = rb_intern("=~");
+ missing = rb_intern("method_missing");
+ added = rb_intern("method_added");
+ singleton_added = rb_intern("singleton_method_added");
+ removed = rb_intern("method_removed");
+ singleton_removed = rb_intern("singleton_method_removed");
+ undefined = rb_intern("method_undefined");
+ singleton_undefined = rb_intern("singleton_method_undefined");
+
+ __id__ = rb_intern("__id__");
+ __send__ = rb_intern("__send__");
+
+ rb_global_variable((void *)&top_scope);
+ rb_global_variable((void *)&ruby_eval_tree_begin);
+
+ rb_global_variable((void *)&ruby_eval_tree);
+ rb_global_variable((void *)&ruby_dyna_vars);
+
+ rb_define_virtual_variable("$@", errat_getter, errat_setter);
+ rb_define_hooked_variable("$!", &ruby_errinfo, 0, errinfo_setter);
+
+ rb_define_global_function("eval", rb_f_eval, -1);
+ rb_define_global_function("iterator?", rb_f_block_given_p, 0);
+ rb_define_global_function("block_given?", rb_f_block_given_p, 0);
+ rb_define_global_function("method_missing", rb_method_missing, -1);
+ rb_define_global_function("loop", rb_f_loop, 0);
+
+ rb_define_method(rb_mKernel, "respond_to?", obj_respond_to, -1);
+ respond_to = rb_intern("respond_to?");
+ rb_global_variable((void *)&basic_respond_to);
+ basic_respond_to = rb_method_node(rb_cObject, respond_to);
+
+ rb_define_global_function("raise", rb_f_raise, -1);
+ rb_define_global_function("fail", rb_f_raise, -1);
+
+ rb_define_global_function("caller", rb_f_caller, -1);
+
+ rb_define_global_function("exit", rb_f_exit, -1);
+ rb_define_global_function("abort", rb_f_abort, -1);
+
+ rb_define_global_function("at_exit", rb_f_at_exit, 0);
+
+ rb_define_global_function("catch", rb_f_catch, 1);
+ rb_define_global_function("throw", rb_f_throw, -1);
+ rb_define_global_function("global_variables", rb_f_global_variables, 0); /* in variable.c */
+ rb_define_global_function("local_variables", rb_f_local_variables, 0);
+
+ rb_define_global_function("__method__", rb_f_method_name, 0);
+
+ rb_define_method(rb_mKernel, "send", rb_f_send, -1);
+ rb_define_method(rb_mKernel, "__send__", rb_f_send, -1);
+ rb_define_method(rb_mKernel, "instance_eval", rb_obj_instance_eval, -1);
+ rb_define_method(rb_mKernel, "instance_exec", rb_obj_instance_exec, -1);
+
+ rb_define_private_method(rb_cModule, "append_features", rb_mod_append_features, 1);
+ rb_define_private_method(rb_cModule, "extend_object", rb_mod_extend_object, 1);
+ rb_define_private_method(rb_cModule, "include", rb_mod_include, -1);
+ rb_define_private_method(rb_cModule, "public", rb_mod_public, -1);
+ rb_define_private_method(rb_cModule, "protected", rb_mod_protected, -1);
+ rb_define_private_method(rb_cModule, "private", rb_mod_private, -1);
+ rb_define_private_method(rb_cModule, "module_function", rb_mod_modfunc, -1);
+ rb_define_method(rb_cModule, "method_defined?", rb_mod_method_defined, 1);
+ rb_define_method(rb_cModule, "public_method_defined?", rb_mod_public_method_defined, 1);
+ rb_define_method(rb_cModule, "private_method_defined?", rb_mod_private_method_defined, 1);
+ rb_define_method(rb_cModule, "protected_method_defined?", rb_mod_protected_method_defined, 1);
+ rb_define_method(rb_cModule, "public_class_method", rb_mod_public_method, -1);
+ rb_define_method(rb_cModule, "private_class_method", rb_mod_private_method, -1);
+ rb_define_method(rb_cModule, "module_eval", rb_mod_module_eval, -1);
+ rb_define_method(rb_cModule, "module_exec", rb_mod_module_exec, -1);
+ rb_define_method(rb_cModule, "class_eval", rb_mod_module_eval, -1);
+ rb_define_method(rb_cModule, "class_exec", rb_mod_module_exec, -1);
+
+ rb_undef_method(rb_cClass, "module_function");
+
+ rb_define_private_method(rb_cModule, "remove_method", rb_mod_remove_method, -1);
+ rb_define_private_method(rb_cModule, "undef_method", rb_mod_undef_method, -1);
+ rb_define_private_method(rb_cModule, "alias_method", rb_mod_alias_method, 2);
+ rb_define_private_method(rb_cModule, "define_method", rb_mod_define_method, -1);
+
+ rb_define_singleton_method(rb_cModule, "nesting", rb_mod_nesting, 0);
+ rb_define_singleton_method(rb_cModule, "constants", rb_mod_s_constants, 0);
+
+ rb_define_singleton_method(ruby_top_self, "include", top_include, -1);
+ rb_define_singleton_method(ruby_top_self, "public", top_public, -1);
+ rb_define_singleton_method(ruby_top_self, "private", top_private, -1);
+
+ rb_define_method(rb_mKernel, "extend", rb_obj_extend, -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_define_global_function("set_trace_func", set_trace_func, 1);
+ rb_global_variable(&trace_func);
+
+ rb_define_virtual_variable("$SAFE", safe_getter, safe_setter);
+}
+
+/*
+ * call-seq:
+ * mod.autoload(name, filename) => nil
+ *
+ * Registers _filename_ to be loaded (using <code>Kernel::require</code>)
+ * the first time that _name_ (which may be a <code>String</code> or
+ * a symbol) is accessed in the namespace of _mod_.
+ *
+ * module A
+ * end
+ * A.autoload(:B, "b")
+ * A::B.doit # autoloads "b"
+ */
+
static VALUE
-errinfo_getter(ID id)
+rb_mod_autoload(mod, sym, file)
+ VALUE mod;
+ VALUE sym;
+ VALUE file;
{
- return get_errinfo();
+ ID id = rb_to_id(sym);
+
+ Check_SafeStr(file);
+ rb_autoload(mod, id, RSTRING(file)->ptr);
+ return Qnil;
+}
+
+/*
+ * call-seq:
+ * mod.autoload?(name) => String or nil
+ *
+ * Returns _filename_ to be loaded if _name_ is registered as
+ * +autoload+ in the namespace of _mod_.
+ *
+ * module A
+ * end
+ * A.autoload(:B, "b")
+ * A.autoload?(:B) # => "b"
+ */
+
+static VALUE
+rb_mod_autoload_p(mod, sym)
+ VALUE mod, sym;
+{
+ return rb_autoload_p(mod, rb_to_id(sym));
+}
+
+/*
+ * call-seq:
+ * autoload(module, filename) => nil
+ *
+ * Registers _filename_ to be loaded (using <code>Kernel::require</code>)
+ * the first time that _module_ (which may be a <code>String</code> or
+ * a symbol) is accessed.
+ *
+ * autoload(:MyModule, "/usr/local/lib/modules/my_module.rb")
+ */
+
+static VALUE
+rb_f_autoload(obj, sym, file)
+ VALUE obj;
+ VALUE sym;
+ VALUE file;
+{
+ if (NIL_P(ruby_cbase)) {
+ rb_raise(rb_eTypeError, "no class/module for autoload target");
+ }
+ return rb_mod_autoload(ruby_cbase, sym, file);
+}
+
+/*
+ * call-seq:
+ * autoload(module, filename) => nil
+ *
+ * Registers _filename_ to be loaded (using <code>Kernel::require</code>)
+ * the first time that _module_ (which may be a <code>String</code> or
+ * a symbol) is accessed.
+ *
+ * autoload(:MyModule, "/usr/local/lib/modules/my_module.rb")
+ */
+
+static VALUE
+rb_f_autoload_p(obj, sym)
+ VALUE obj;
+ VALUE sym;
+{
+ /* use ruby_cbase as same as rb_f_autoload. */
+ if (NIL_P(ruby_cbase)) {
+ return Qfalse;
+ }
+ return rb_mod_autoload_p(ruby_cbase, sym);
+}
+
+void
+Init_load()
+{
+ rb_define_readonly_variable("$:", &rb_load_path);
+ rb_define_readonly_variable("$-I", &rb_load_path);
+ rb_define_readonly_variable("$LOAD_PATH", &rb_load_path);
+ rb_load_path = rb_ary_new();
+
+ rb_define_readonly_variable("$\"", &rb_features);
+ rb_define_readonly_variable("$LOADED_FEATURES", &rb_features);
+ rb_features = rb_ary_new();
+
+ rb_define_global_function("load", rb_f_load, -1);
+ rb_define_global_function("require", rb_f_require, 1);
+ rb_define_method(rb_cModule, "autoload", rb_mod_autoload, 2);
+ rb_define_method(rb_cModule, "autoload?", rb_mod_autoload_p, 1);
+ rb_define_global_function("autoload", rb_f_autoload, 2);
+ rb_define_global_function("autoload?", rb_f_autoload_p, 1);
+ rb_global_variable(&ruby_wrapper);
+
+ rb_global_variable(&ruby_dln_librefs);
+ ruby_dln_librefs = rb_ary_new();
}
-#if 0
static void
-errinfo_setter(VALUE val, ID id, VALUE *var)
+scope_dup(scope)
+ struct SCOPE *scope;
{
- if (!NIL_P(val) && !rb_obj_is_kind_of(val, rb_eException)) {
- rb_raise(rb_eTypeError, "assigning non-exception to $!");
+ ID *tbl;
+ VALUE *vars;
+
+ scope->flags |= SCOPE_DONT_RECYCLE;
+ if (scope->flags & SCOPE_MALLOC) return;
+
+ if (scope->local_tbl) {
+ tbl = scope->local_tbl;
+ vars = ALLOC_N(VALUE, tbl[0]+1);
+ *vars++ = scope->local_vars[-1];
+ MEMCPY(vars, scope->local_vars, VALUE, tbl[0]);
+ scope->local_vars = vars;
+ scope->flags |= SCOPE_MALLOC;
+ }
+}
+
+static void
+blk_mark(data)
+ struct BLOCK *data;
+{
+ while (data) {
+ rb_gc_mark_frame(&data->frame);
+ rb_gc_mark((VALUE)data->scope);
+ rb_gc_mark((VALUE)data->var);
+ rb_gc_mark((VALUE)data->body);
+ rb_gc_mark((VALUE)data->self);
+ rb_gc_mark((VALUE)data->dyna_vars);
+ rb_gc_mark((VALUE)data->cref);
+ rb_gc_mark(data->wrapper);
+ rb_gc_mark(data->block_obj);
+ data = data->prev;
+ }
+}
+
+static void
+frame_free(frame)
+ struct FRAME *frame;
+{
+ struct FRAME *tmp;
+
+ frame = frame->prev;
+ while (frame) {
+ tmp = frame;
+ frame = frame->prev;
+ free(tmp);
+ }
+}
+
+static void
+blk_free(data)
+ struct BLOCK *data;
+{
+ void *tmp;
+
+ while (data) {
+ frame_free(&data->frame);
+ tmp = data;
+ data = data->prev;
+ free(tmp);
+ }
+}
+
+static void
+frame_dup(frame)
+ struct FRAME *frame;
+{
+ struct FRAME *tmp;
+
+ for (;;) {
+ frame->tmp = 0; /* should not preserve tmp */
+ if (!frame->prev) break;
+ tmp = ALLOC(struct FRAME);
+ *tmp = *frame->prev;
+ frame->prev = tmp;
+ frame = tmp;
+ }
+}
+
+
+static void
+blk_copy_prev(block)
+ struct BLOCK *block;
+{
+ struct BLOCK *tmp;
+ struct RVarmap* vars;
+
+ while (block->prev) {
+ tmp = ALLOC_N(struct BLOCK, 1);
+ MEMCPY(tmp, block->prev, struct BLOCK, 1);
+ scope_dup(tmp->scope);
+ frame_dup(&tmp->frame);
+
+ for (vars = tmp->dyna_vars; vars; vars = vars->next) {
+ if (FL_TEST(vars, DVAR_DONT_RECYCLE)) break;
+ FL_SET(vars, DVAR_DONT_RECYCLE);
+ }
+
+ block->prev = tmp;
+ block = tmp;
+ }
+}
+
+
+static void
+blk_dup(dup, orig)
+ struct BLOCK *dup, *orig;
+{
+ MEMCPY(dup, orig, struct BLOCK, 1);
+ frame_dup(&dup->frame);
+
+ if (dup->iter) {
+ blk_copy_prev(dup);
+ }
+ else {
+ dup->prev = 0;
+ }
+}
+
+/*
+ * MISSING: documentation
+ */
+
+static VALUE
+proc_clone(self)
+ VALUE self;
+{
+ struct BLOCK *orig, *data;
+ VALUE bind;
+
+ Data_Get_Struct(self, struct BLOCK, orig);
+ bind = Data_Make_Struct(rb_obj_class(self),struct BLOCK,blk_mark,blk_free,data);
+ CLONESETUP(bind, self);
+ blk_dup(data, orig);
+
+ return bind;
+}
+
+/*
+ * MISSING: documentation
+ */
+
+#define PROC_TSHIFT (FL_USHIFT+1)
+#define PROC_TMASK (FL_USER1|FL_USER2|FL_USER3)
+#define PROC_TMAX (PROC_TMASK >> PROC_TSHIFT)
+
+static int proc_get_safe_level(VALUE);
+
+static VALUE
+proc_dup(self)
+ VALUE self;
+{
+ struct BLOCK *orig, *data;
+ VALUE bind;
+ int safe = proc_get_safe_level(self);
+
+ Data_Get_Struct(self, struct BLOCK, orig);
+ bind = Data_Make_Struct(rb_obj_class(self),struct BLOCK,blk_mark,blk_free,data);
+ blk_dup(data, orig);
+ if (safe > PROC_TMAX) safe = PROC_TMAX;
+ FL_SET(bind, (safe << PROC_TSHIFT) & PROC_TMASK);
+
+ return bind;
+}
+
+VALUE
+rb_block_dup(self, klass, cref)
+ VALUE self, klass, cref;
+{
+ struct BLOCK *block;
+ VALUE obj = proc_dup(self);
+ Data_Get_Struct(obj, struct BLOCK, block);
+ block->klass = klass;
+ block->cref = NEW_NODE(nd_type(block->cref), cref, block->cref->u2.node,
+ block->cref->u3.node);
+ return obj;
+}
+
+/*
+ * call-seq:
+ * binding -> a_binding
+ *
+ * Returns a +Binding+ object, describing the variable and
+ * method bindings at the point of call. This object can be used when
+ * calling +eval+ to execute the evaluated command in this
+ * environment. Also see the description of class +Binding+.
+ *
+ * def getBinding(param)
+ * return binding
+ * end
+ * b = getBinding("hello")
+ * eval("param", b) #=> "hello"
+ */
+
+static VALUE
+rb_f_binding(self)
+ VALUE self;
+{
+ struct BLOCK *data, *p;
+ struct RVarmap *vars;
+ VALUE bind;
+
+ PUSH_BLOCK(0,0);
+ bind = Data_Make_Struct(rb_cBinding,struct BLOCK,blk_mark,blk_free,data);
+ *data = *ruby_block;
+
+ data->orig_thread = rb_thread_current();
+ data->wrapper = ruby_wrapper;
+ data->iter = rb_f_block_given_p();
+ frame_dup(&data->frame);
+ if (ruby_frame->prev) {
+ data->frame.last_func = ruby_frame->prev->last_func;
+ data->frame.last_class = ruby_frame->prev->last_class;
+ data->frame.orig_func = ruby_frame->prev->orig_func;
+ }
+
+ if (data->iter) {
+ blk_copy_prev(data);
}
else {
- VALUE *ptr = errinfo_place();
- if (ptr) {
- *ptr = val;
+ data->prev = 0;
+ }
+
+ for (p = data; p; p = p->prev) {
+ for (vars = p->dyna_vars; vars; vars = vars->next) {
+ if (FL_TEST(vars, DVAR_DONT_RECYCLE)) break;
+ FL_SET(vars, DVAR_DONT_RECYCLE);
}
- else {
- rb_raise(rb_eRuntimeError, "errinfo_setter: not in rescue clause.");
+ }
+ scope_dup(data->scope);
+ POP_BLOCK();
+
+ return bind;
+}
+
+/*
+ * call-seq:
+ * binding.eval(string [, filename [,lineno]]) => obj
+ *
+ * Evaluates the Ruby expression(s) in <em>string</em>, in the
+ * <em>binding</em>'s context. If the optional <em>filename</em> and
+ * <em>lineno</em> parameters are present, they will be used when
+ * reporting syntax errors.
+ *
+ * def getBinding(param)
+ * return binding
+ * end
+ * b = getBinding("hello")
+ * b.eval("param") #=> "hello"
+ */
+
+static VALUE
+bind_eval(argc, argv, bindval)
+ int argc;
+ VALUE *argv;
+ VALUE bindval;
+{
+ VALUE args[4];
+
+ rb_scan_args(argc, argv, "12", &args[0], &args[2], &args[3]);
+ args[1] = bindval;
+ return rb_f_eval(argc+1, args, Qnil /* self will be searched in eval */);
+}
+
+#define SAFE_LEVEL_MAX PROC_TMASK
+
+static void
+proc_save_safe_level(data)
+ VALUE data;
+{
+ int safe = ruby_safe_level;
+ if (safe > PROC_TMAX) safe = PROC_TMAX;
+ FL_SET(data, (safe << PROC_TSHIFT) & PROC_TMASK);
+}
+
+static int
+proc_get_safe_level(data)
+ VALUE data;
+{
+ return (RBASIC(data)->flags & PROC_TMASK) >> PROC_TSHIFT;
+}
+
+static void
+proc_set_safe_level(data)
+ VALUE data;
+{
+ ruby_safe_level = proc_get_safe_level(data);
+}
+
+static VALUE
+proc_alloc(klass, proc)
+ VALUE klass;
+ int proc;
+{
+ volatile VALUE block;
+ struct BLOCK *data, *p;
+ struct RVarmap *vars;
+
+ if (!rb_block_given_p() && !rb_f_block_given_p()) {
+ rb_raise(rb_eArgError, "tried to create Proc object without a block");
+ }
+ if (proc && !rb_block_given_p()) {
+ rb_warn("tried to create Proc object without a block");
+ }
+
+ if (!proc && ruby_block->block_obj && CLASS_OF(ruby_block->block_obj) == klass) {
+ return ruby_block->block_obj;
+ }
+ block = Data_Make_Struct(klass, struct BLOCK, blk_mark, blk_free, data);
+ *data = *ruby_block;
+
+ data->orig_thread = rb_thread_current();
+ data->wrapper = ruby_wrapper;
+ data->iter = data->prev?Qtrue:Qfalse;
+ data->block_obj = block;
+ frame_dup(&data->frame);
+ if (data->iter) {
+ blk_copy_prev(data);
+ }
+ else {
+ data->prev = 0;
+ }
+
+ for (p = data; p; p = p->prev) {
+ for (vars = p->dyna_vars; vars; vars = vars->next) {
+ if (FL_TEST(vars, DVAR_DONT_RECYCLE)) break;
+ FL_SET(vars, DVAR_DONT_RECYCLE);
}
}
+ scope_dup(data->scope);
+ proc_save_safe_level(block);
+ if (proc) {
+ data->flags |= BLOCK_LAMBDA;
+ }
+ else {
+ ruby_block->block_obj = block;
+ }
+
+ return block;
+}
+
+/*
+ * call-seq:
+ * Proc.new {|...| block } => a_proc
+ * Proc.new => a_proc
+ *
+ * Creates a new <code>Proc</code> object, bound to the current
+ * context. <code>Proc::new</code> may be called without a block only
+ * within a method with an attached block, in which case that block is
+ * converted to the <code>Proc</code> object.
+ *
+ * def proc_from
+ * Proc.new
+ * end
+ * proc = proc_from { "hello" }
+ * proc.call #=> "hello"
+ */
+
+static VALUE
+proc_s_new(argc, argv, klass)
+ int argc;
+ VALUE *argv;
+ VALUE klass;
+{
+ VALUE block = proc_alloc(klass, Qfalse);
+
+ rb_obj_call_init(block, argc, argv);
+ return block;
}
-#endif
VALUE
-rb_errinfo(void)
+rb_block_proc()
{
- rb_thread_t *th = GET_THREAD();
- return th->errinfo;
+ return proc_alloc(rb_cProc, Qfalse);
}
-void
-rb_set_errinfo(VALUE err)
+VALUE
+rb_f_lambda()
{
- if (!NIL_P(err) && !rb_obj_is_kind_of(err, rb_eException)) {
- rb_raise(rb_eTypeError, "assigning non-exception to $!");
+ rb_warn("rb_f_lambda() is deprecated; use rb_block_proc() instead");
+ return proc_alloc(rb_cProc, Qtrue);
+}
+
+/*
+ * call-seq:
+ * proc { |...| block } => a_proc
+ * lambda { |...| block } => a_proc
+ *
+ * Equivalent to <code>Proc.new</code>, except the resulting Proc objects
+ * check the number of parameters passed when called.
+ */
+
+static VALUE
+proc_lambda()
+{
+ return proc_alloc(rb_cProc, Qtrue);
+}
+
+static int
+block_orphan(data)
+ struct BLOCK *data;
+{
+ if (data->scope->flags & SCOPE_NOSTACK) {
+ return 1;
+ }
+ if (data->orig_thread != rb_thread_current()) {
+ return 1;
}
- GET_THREAD()->errinfo = err;
+ return 0;
}
+static VALUE
+proc_invoke(proc, args, self, klass)
+ VALUE proc, args; /* OK */
+ VALUE self, klass;
+{
+ struct BLOCK * volatile old_block;
+ struct BLOCK _block;
+ struct BLOCK *data;
+ volatile VALUE result = Qundef;
+ int state;
+ volatile int safe = ruby_safe_level;
+ volatile VALUE old_wrapper = ruby_wrapper;
+ volatile int pcall, avalue = Qtrue;
+ volatile VALUE tmp = args;
+ VALUE bvar = Qnil;
+
+ if (rb_block_given_p() && ruby_frame->last_func) {
+ if (klass != ruby_frame->last_class)
+ klass = rb_obj_class(proc);
+ bvar = rb_block_proc();
+ }
+
+ Data_Get_Struct(proc, struct BLOCK, data);
+ pcall = (data->flags & BLOCK_LAMBDA) ? YIELD_LAMBDA_CALL : 0;
+ if (!pcall && RARRAY(args)->len == 1) {
+ avalue = Qfalse;
+ args = RARRAY(args)->ptr[0];
+ }
+
+ PUSH_VARS();
+ ruby_wrapper = data->wrapper;
+ ruby_dyna_vars = data->dyna_vars;
+ /* PUSH BLOCK from data */
+ old_block = ruby_block;
+ _block = *data;
+ _block.block_obj = bvar;
+ if (self != Qundef) _block.frame.self = self;
+ if (klass) _block.frame.last_class = klass;
+ _block.frame.argc = RARRAY(tmp)->len;
+ _block.frame.flags = ruby_frame->flags;
+ if (_block.frame.argc && DMETHOD_P()) {
+ NEWOBJ(scope, struct SCOPE);
+ OBJSETUP(scope, tmp, T_SCOPE);
+ scope->local_tbl = _block.scope->local_tbl;
+ scope->local_vars = _block.scope->local_vars;
+ scope->flags |= SCOPE_CLONE;
+ _block.scope = scope;
+ }
+ /* modify current frame */
+ ruby_block = &_block;
+ PUSH_ITER(ITER_CUR);
+ ruby_frame->iter = ITER_CUR;
+ PUSH_TAG(pcall ? PROT_LAMBDA : PROT_NONE);
+ state = EXEC_TAG();
+ if (state == 0) {
+ proc_set_safe_level(proc);
+ result = rb_yield_0(args, self, (self!=Qundef)?CLASS_OF(self):0,
+ pcall | YIELD_PROC_CALL, avalue);
+ }
+ else if (TAG_DST()) {
+ result = prot_tag->retval;
+ }
+ POP_TAG();
+ POP_ITER();
+ ruby_block = old_block;
+ ruby_wrapper = old_wrapper;
+ POP_VARS();
+ ruby_safe_level = safe;
+
+ switch (state) {
+ case 0:
+ break;
+ case TAG_RETRY:
+ proc_jump_error(TAG_RETRY, Qnil); /* xxx */
+ JUMP_TAG(state);
+ break;
+ case TAG_NEXT:
+ case TAG_BREAK:
+ if (!pcall && result != Qundef) {
+ proc_jump_error(state, result);
+ }
+ case TAG_RETURN:
+ if (result != Qundef) {
+ if (pcall) break;
+ return_jump(result);
+ }
+ default:
+ JUMP_TAG(state);
+ }
+ return result;
+}
+
+/* CHECKME: are the argument checking semantics correct? */
+
+/*
+ * call-seq:
+ * prc.call(params,...) => obj
+ * prc[params,...] => obj
+ *
+ * Invokes the block, setting the block's parameters to the values in
+ * <i>params</i> using something close to method calling semantics.
+ * Generates a warning if multiple values are passed to a proc that
+ * expects just one (previously this silently converted the parameters
+ * to an array).
+ *
+ * For procs created using <code>Kernel.proc</code>, generates an
+ * error if the wrong number of parameters
+ * are passed to a proc with multiple parameters. For procs created using
+ * <code>Proc.new</code>, extra parameters are silently discarded.
+ *
+ * Returns the value of the last expression evaluated in the block. See
+ * also <code>Proc#yield</code>.
+ *
+ * a_proc = Proc.new {|a, *b| b.collect {|i| i*a }}
+ * a_proc.call(9, 1, 2, 3) #=> [9, 18, 27]
+ * a_proc[9, 1, 2, 3] #=> [9, 18, 27]
+ * a_proc = Proc.new {|a,b| a}
+ * a_proc.call(1,2,3)
+ *
+ * <em>produces:</em>
+ *
+ * prog.rb:5: wrong number of arguments (3 for 2) (ArgumentError)
+ * from prog.rb:4:in `call'
+ * from prog.rb:5
+ */
+
VALUE
-rb_rubylevel_errinfo(void)
+rb_proc_call(proc, args)
+ VALUE proc, args; /* OK */
{
- return get_errinfo();
+ return proc_invoke(proc, args, Qundef, 0);
}
+static VALUE bmcall _((VALUE, VALUE));
+static VALUE method_arity _((VALUE));
+
+/*
+ * call-seq:
+ * prc.arity -> fixnum
+ *
+ * Returns the number of arguments that would not be ignored. If the block
+ * is declared to take no arguments, returns 0. If the block is known
+ * to take exactly n arguments, returns n. If the block has optional
+ * arguments, return -n-1, where n is the number of mandatory
+ * arguments. A <code>proc</code> with no argument declarations
+ * is the same a block declaring <code>||</code> as its arguments.
+ *
+ * Proc.new {}.arity #=> 0
+ * Proc.new {||}.arity #=> 0
+ * Proc.new {|a|}.arity #=> 1
+ * Proc.new {|a,b|}.arity #=> 2
+ * Proc.new {|a,b,c|}.arity #=> 3
+ * Proc.new {|*a|}.arity #=> -1
+ * Proc.new {|a,*b|}.arity #=> -2
+ */
+
static VALUE
-errat_getter(ID id)
+proc_arity(proc)
+ VALUE proc;
{
- VALUE err = get_errinfo();
- if (!NIL_P(err)) {
- return get_backtrace(err);
+ struct BLOCK *data;
+ NODE *var, *list;
+ int n;
+
+ Data_Get_Struct(proc, struct BLOCK, data);
+ var = data->var;
+ if (var == 0) {
+ if (data->body && nd_type(data->body) == NODE_IFUNC &&
+ data->body->nd_cfnc == bmcall) {
+ return method_arity(data->body->nd_tval);
+ }
+ return INT2FIX(-1);
+ }
+ if (var == (NODE*)1) return INT2FIX(0);
+ if (var == (NODE*)2) return INT2FIX(0);
+ if (nd_type(var) == NODE_BLOCK_ARG) {
+ var = var->nd_args;
+ if (var == (NODE*)1) return INT2FIX(0);
+ if (var == (NODE*)2) return INT2FIX(0);
+ }
+ switch (nd_type(var)) {
+ default:
+ return INT2FIX(1);
+ case NODE_MASGN:
+ list = var->nd_head;
+ n = 0;
+ while (list) {
+ n++;
+ list = list->nd_next;
+ }
+ if (var->nd_args) return INT2FIX(-n-1);
+ return INT2FIX(n);
+ }
+}
+
+/*
+ * call-seq:
+ * prc == other_proc => true or false
+ *
+ * Return <code>true</code> if <i>prc</i> is the same object as
+ * <i>other_proc</i>, or if they are both procs with the same body.
+ */
+
+static VALUE
+proc_eq(self, other)
+ VALUE self, other;
+{
+ struct BLOCK *data, *data2;
+
+ if (self == other) return Qtrue;
+ if (TYPE(other) != T_DATA) return Qfalse;
+ if (RDATA(other)->dmark != (RUBY_DATA_FUNC)blk_mark) return Qfalse;
+ if (CLASS_OF(self) != CLASS_OF(other)) return Qfalse;
+ Data_Get_Struct(self, struct BLOCK, data);
+ Data_Get_Struct(other, struct BLOCK, data2);
+ if (data->body != data2->body) return Qfalse;
+ if (data->var != data2->var) return Qfalse;
+ if (data->scope != data2->scope) return Qfalse;
+ if (data->dyna_vars != data2->dyna_vars) return Qfalse;
+ if (data->flags != data2->flags) return Qfalse;
+
+ return Qtrue;
+}
+
+/*
+ * call-seq:
+ * prc.to_s => string
+ *
+ * Shows the unique identifier for this proc, along with
+ * an indication of where the proc was defined.
+ */
+
+static VALUE
+proc_to_s(self)
+ VALUE self;
+{
+ struct BLOCK *data;
+ NODE *node;
+ const char *cname = rb_obj_classname(self);
+ const int w = (sizeof(VALUE) * CHAR_BIT) / 4;
+ long len = strlen(cname)+6+w; /* 6:tags 16:addr */
+ VALUE str;
+
+ Data_Get_Struct(self, struct BLOCK, data);
+ if ((node = data->frame.node) || (node = data->body)) {
+ len += strlen(node->nd_file) + 2 + (SIZEOF_LONG*CHAR_BIT-NODE_LSHIFT)/3;
+ str = rb_str_new(0, len);
+ snprintf(RSTRING(str)->ptr, len+1,
+ "#<%s:0x%.*lx@%s:%d>", cname, w, (VALUE)data->body,
+ node->nd_file, nd_line(node));
}
else {
- return Qnil;
+ str = rb_str_new(0, len);
+ snprintf(RSTRING(str)->ptr, len+1,
+ "#<%s:0x%.*lx>", cname, w, (VALUE)data->body);
+ }
+ RSTRING(str)->len = strlen(RSTRING(str)->ptr);
+ if (OBJ_TAINTED(self)) OBJ_TAINT(str);
+
+ return str;
+}
+
+/*
+ * call-seq:
+ * prc.to_proc -> prc
+ *
+ * Part of the protocol for converting objects to <code>Proc</code>
+ * objects. Instances of class <code>Proc</code> simply return
+ * themselves.
+ */
+
+static VALUE
+proc_to_self(self)
+ VALUE self;
+{
+ return self;
+}
+
+/*
+ * call-seq:
+ * prc.binding => binding
+ *
+ * Returns the binding associated with <i>prc</i>. Note that
+ * <code>Kernel#eval</code> accepts either a <code>Proc</code> or a
+ * <code>Binding</code> object as its second parameter.
+ *
+ * def fred(param)
+ * proc {}
+ * end
+ *
+ * b = fred(99)
+ * eval("param", b.binding) #=> 99
+ * eval("param", b) #=> 99
+ */
+
+static VALUE
+proc_binding(proc)
+ VALUE proc;
+{
+ struct BLOCK *orig, *data;
+ VALUE bind;
+
+ Data_Get_Struct(proc, struct BLOCK, orig);
+ bind = Data_Make_Struct(rb_cBinding,struct BLOCK,blk_mark,blk_free,data);
+ MEMCPY(data, orig, struct BLOCK, 1);
+ frame_dup(&data->frame);
+
+ if (data->iter) {
+ blk_copy_prev(data);
+ }
+ else {
+ data->prev = 0;
+ }
+
+ return bind;
+}
+
+static VALUE
+block_pass(self, node)
+ VALUE self;
+ NODE *node;
+{
+ VALUE proc = rb_eval(self, node->nd_body); /* OK */
+ VALUE b;
+ struct BLOCK * volatile old_block;
+ struct BLOCK _block;
+ struct BLOCK *data;
+ volatile VALUE result = Qnil;
+ int state;
+ volatile int orphan;
+ volatile int safe = ruby_safe_level;
+
+ if (NIL_P(proc)) {
+ PUSH_ITER(ITER_NOT);
+ result = rb_eval(self, node->nd_iter);
+ POP_ITER();
+ return result;
}
+ if (!rb_obj_is_proc(proc)) {
+ b = rb_check_convert_type(proc, T_DATA, "Proc", "to_proc");
+ if (!rb_obj_is_proc(b)) {
+ rb_raise(rb_eTypeError, "wrong argument type %s (expected Proc)",
+ rb_obj_classname(proc));
+ }
+ proc = b;
+ }
+
+ if (ruby_safe_level >= 1 && OBJ_TAINTED(proc) &&
+ ruby_safe_level > proc_get_safe_level(proc)) {
+ rb_raise(rb_eSecurityError, "Insecure: tainted block value");
+ }
+
+ if (ruby_block && ruby_block->block_obj == proc) {
+ PUSH_ITER(ITER_PAS);
+ result = rb_eval(self, node->nd_iter);
+ POP_ITER();
+ return result;
+ }
+
+ Data_Get_Struct(proc, struct BLOCK, data);
+ orphan = block_orphan(data);
+
+ /* PUSH BLOCK from data */
+ old_block = ruby_block;
+ _block = *data;
+ _block.outer = ruby_block;
+ if (orphan) _block.uniq = block_unique++;
+ ruby_block = &_block;
+ PUSH_ITER(ITER_PRE);
+ if (ruby_frame->iter == ITER_NOT)
+ ruby_frame->iter = ITER_PRE;
+
+ PUSH_TAG(PROT_LOOP);
+ state = EXEC_TAG();
+ if (state == 0) {
+ retry:
+ proc_set_safe_level(proc);
+ if (safe > ruby_safe_level)
+ ruby_safe_level = safe;
+ result = rb_eval(self, node->nd_iter);
+ }
+ else if (state == TAG_BREAK && TAG_DST()) {
+ result = prot_tag->retval;
+ state = 0;
+ }
+ else if (state == TAG_RETRY) {
+ state = 0;
+ goto retry;
+ }
+ POP_TAG();
+ POP_ITER();
+ ruby_block = old_block;
+ ruby_safe_level = safe;
+
+ switch (state) {/* escape from orphan block */
+ case 0:
+ break;
+ case TAG_RETURN:
+ if (orphan) {
+ proc_jump_error(state, prot_tag->retval);
+ }
+ default:
+ JUMP_TAG(state);
+ }
+
+ return result;
}
+struct METHOD {
+ VALUE klass, rklass;
+ VALUE recv;
+ ID id, oid;
+ int safe_level;
+ NODE *body;
+};
+
static void
-errat_setter(VALUE val, ID id, VALUE *var)
+bm_mark(data)
+ struct METHOD *data;
{
- VALUE err = get_errinfo();
- if (NIL_P(err)) {
- rb_raise(rb_eArgError, "$! not set");
+ rb_gc_mark(data->rklass);
+ rb_gc_mark(data->klass);
+ rb_gc_mark(data->recv);
+ rb_gc_mark((VALUE)data->body);
+}
+
+static VALUE
+mnew(klass, obj, id, mklass)
+ VALUE klass, obj, mklass;
+ ID id;
+{
+ VALUE method;
+ NODE *body;
+ int noex;
+ struct METHOD *data;
+ VALUE rklass = klass;
+ ID oid = id;
+
+ again:
+ if ((body = rb_get_method_body(&klass, &id, &noex)) == 0) {
+ print_undef(rklass, oid);
}
- set_backtrace(err, val);
+
+ if (nd_type(body) == NODE_ZSUPER) {
+ klass = RCLASS(klass)->super;
+ goto again;
+ }
+
+ while (rklass != klass &&
+ (FL_TEST(rklass, FL_SINGLETON) || TYPE(rklass) == T_ICLASS)) {
+ rklass = RCLASS(rklass)->super;
+ }
+ if (TYPE(klass) == T_ICLASS) klass = RBASIC(klass)->klass;
+ method = Data_Make_Struct(mklass, struct METHOD, bm_mark, free, data);
+ data->klass = klass;
+ data->recv = obj;
+ data->id = id;
+ data->body = body;
+ data->rklass = rklass;
+ data->oid = oid;
+ data->safe_level = NOEX_WITH_SAFE(noex);
+ OBJ_INFECT(method, klass);
+
+ return method;
+}
+
+
+/**********************************************************************
+ *
+ * Document-class : Method
+ *
+ * Method objects are created by <code>Object#method</code>, and are
+ * associated with a particular object (not just with a class). They
+ * may be used to invoke the method within the object, and as a block
+ * associated with an iterator. They may also be unbound from one
+ * object (creating an <code>UnboundMethod</code>) and bound to
+ * another.
+ *
+ * class Thing
+ * def square(n)
+ * n*n
+ * end
+ * end
+ * thing = Thing.new
+ * meth = thing.method(:square)
+ *
+ * meth.call(9) #=> 81
+ * [ 1, 2, 3 ].collect(&meth) #=> [1, 4, 9]
+ *
+ */
+
+/*
+ * call-seq:
+ * meth == other_meth => true or false
+ *
+ * Two method objects are equal if that are bound to the same
+ * object and contain the same body.
+ */
+
+
+static VALUE
+method_eq(method, other)
+ VALUE method, other;
+{
+ struct METHOD *m1, *m2;
+
+ if (TYPE(other) != T_DATA || RDATA(other)->dmark != (RUBY_DATA_FUNC)bm_mark)
+ return Qfalse;
+ if (CLASS_OF(method) != CLASS_OF(other))
+ return Qfalse;
+
+ Data_Get_Struct(method, struct METHOD, m1);
+ Data_Get_Struct(other, struct METHOD, m2);
+
+ if (m1->klass != m2->klass || m1->rklass != m2->rklass ||
+ m1->recv != m2->recv || m1->body != m2->body)
+ return Qfalse;
+
+ return Qtrue;
}
/*
* call-seq:
- * __method__ => symbol
- * __callee__ => symbol
+ * meth.unbind => unbound_method
+ *
+ * Dissociates <i>meth</i> from it's current receiver. The resulting
+ * <code>UnboundMethod</code> can subsequently be bound to a new object
+ * of the same class (see <code>UnboundMethod</code>).
+ */
+
+static VALUE
+method_unbind(obj)
+ VALUE obj;
+{
+ VALUE method;
+ struct METHOD *orig, *data;
+
+ Data_Get_Struct(obj, struct METHOD, orig);
+ method = Data_Make_Struct(rb_cUnboundMethod, struct METHOD, bm_mark, free, data);
+ data->klass = orig->klass;
+ data->recv = Qundef;
+ data->id = orig->id;
+ data->body = orig->body;
+ data->rklass = orig->rklass;
+ data->oid = orig->oid;
+ OBJ_INFECT(method, obj);
+
+ return method;
+}
+
+/*
+ * call-seq:
+ * meth.receiver => object
*
- * Returns the name of the current method as a Symbol.
- * If called outside of a method, it returns <code>nil</code>.
+ * Returns the bound receiver of the method object.
+ */
+
+static VALUE
+method_receiver(obj)
+ VALUE obj;
+{
+ struct METHOD *data;
+
+ Data_Get_Struct(obj, struct METHOD, data);
+ return data->recv;
+}
+
+/*
+ * call-seq:
+ * meth.name => string
+ *
+ * Returns the name of the method.
+ */
+
+static VALUE
+method_name(obj)
+ VALUE obj;
+{
+ struct METHOD *data;
+
+ Data_Get_Struct(obj, struct METHOD, data);
+ return rb_str_new2(rb_id2name(data->oid));
+}
+
+/*
+ * call-seq:
+ * meth.owner => class_or_module
*
+ * Returns the class or module that defines the method.
*/
static VALUE
-rb_f_method_name(void)
+method_owner(obj)
+ VALUE obj;
{
- ID fname = rb_frame_caller(); /* need *caller* ID */
+ struct METHOD *data;
- if (fname) {
- return ID2SYM(fname);
+ Data_Get_Struct(obj, struct METHOD, data);
+ return data->klass;
+}
+
+/*
+ * call-seq:
+ * obj.method(sym) => method
+ *
+ * Looks up the named method as a receiver in <i>obj</i>, returning a
+ * <code>Method</code> object (or raising <code>NameError</code>). The
+ * <code>Method</code> object acts as a closure in <i>obj</i>'s object
+ * instance, so instance variables and the value of <code>self</code>
+ * remain available.
+ *
+ * class Demo
+ * def initialize(n)
+ * @iv = n
+ * end
+ * def hello()
+ * "Hello, @iv = #{@iv}"
+ * end
+ * end
+ *
+ * k = Demo.new(99)
+ * m = k.method(:hello)
+ * m.call #=> "Hello, @iv = 99"
+ *
+ * l = Demo.new('Fred')
+ * m = l.method("hello")
+ * m.call #=> "Hello, @iv = Fred"
+ */
+
+VALUE
+rb_obj_method(obj, vid)
+ VALUE obj;
+ VALUE vid;
+{
+ return mnew(CLASS_OF(obj), obj, rb_to_id(vid), rb_cMethod);
+}
+
+/*
+ * call-seq:
+ * mod.instance_method(symbol) => unbound_method
+ *
+ * Returns an +UnboundMethod+ representing the given
+ * instance method in _mod_.
+ *
+ * class Interpreter
+ * def do_a() print "there, "; end
+ * def do_d() print "Hello "; end
+ * def do_e() print "!\n"; end
+ * def do_v() print "Dave"; end
+ * Dispatcher = {
+ * ?a => instance_method(:do_a),
+ * ?d => instance_method(:do_d),
+ * ?e => instance_method(:do_e),
+ * ?v => instance_method(:do_v)
+ * }
+ * def interpret(string)
+ * string.each_byte {|b| Dispatcher[b].bind(self).call }
+ * end
+ * end
+ *
+ *
+ * interpreter = Interpreter.new
+ * interpreter.interpret('dave')
+ *
+ * <em>produces:</em>
+ *
+ * Hello there, Dave!
+ */
+
+static VALUE
+rb_mod_method(mod, vid)
+ VALUE mod;
+ VALUE vid;
+{
+ return mnew(mod, Qundef, rb_to_id(vid), rb_cUnboundMethod);
+}
+
+/*
+ * MISSING: documentation
+ */
+
+static VALUE
+method_clone(self)
+ VALUE self;
+{
+ VALUE clone;
+ struct METHOD *orig, *data;
+
+ Data_Get_Struct(self, struct METHOD, orig);
+ clone = Data_Make_Struct(CLASS_OF(self),struct METHOD, bm_mark, free, data);
+ CLONESETUP(clone, self);
+ *data = *orig;
+
+ return clone;
+}
+
+VALUE
+rb_method_dup(self, klass, cref)
+ VALUE self;
+ VALUE klass;
+ VALUE cref;
+{
+ VALUE clone;
+ struct METHOD *orig, *data;
+
+ Data_Get_Struct(self, struct METHOD, orig);
+ clone = Data_Make_Struct(CLASS_OF(self),struct METHOD, bm_mark, free, data);
+ *data = *orig;
+ data->rklass = klass;
+ if (data->body->nd_rval) {
+ NODE *tmp = NEW_NODE(nd_type(data->body->u2.node), cref,
+ data->body->u2.node->u2.node,
+ data->body->u2.node->u3.node);
+ data->body = NEW_NODE(nd_type(data->body), data->body->u1.node, tmp,
+ data->body->u3.node);
+ }
+ return clone;
+}
+
+/*
+ * call-seq:
+ * meth.call(args, ...) => obj
+ * meth[args, ...] => obj
+ *
+ * Invokes the <i>meth</i> with the specified arguments, returning the
+ * method's return value.
+ *
+ * m = 12.method("+")
+ * m.call(3) #=> 15
+ * m.call(20) #=> 32
+ */
+
+static VALUE
+method_call(argc, argv, method)
+ int argc;
+ VALUE *argv;
+ VALUE method;
+{
+ VALUE result = Qnil; /* OK */
+ struct METHOD *data;
+ int safe;
+
+ Data_Get_Struct(method, struct METHOD, data);
+ if (data->recv == Qundef) {
+ rb_raise(rb_eTypeError, "can't call unbound method; bind first");
+ }
+ if (OBJ_TAINTED(method)) {
+ safe = NOEX_WITH(data->safe_level, 4)|NOEX_TAINTED;
}
else {
- return Qnil;
+ safe = data->safe_level;
}
+ PUSH_ITER(rb_block_given_p()?ITER_PRE:ITER_NOT);
+ result = rb_call0(data->klass,data->recv,data->id,data->oid,argc,argv,data->body,safe);
+ POP_ITER();
+ return result;
}
-void
-Init_eval(void)
+/**********************************************************************
+ *
+ * Document-class: UnboundMethod
+ *
+ * Ruby supports two forms of objectified methods. Class
+ * <code>Method</code> is used to represent methods that are associated
+ * with a particular object: these method objects are bound to that
+ * object. Bound method objects for an object can be created using
+ * <code>Object#method</code>.
+ *
+ * Ruby also supports unbound methods; methods objects that are not
+ * associated with a particular object. These can be created either by
+ * calling <code>Module#instance_method</code> or by calling
+ * <code>unbind</code> on a bound method object. The result of both of
+ * these is an <code>UnboundMethod</code> object.
+ *
+ * Unbound methods can only be called after they are bound to an
+ * object. That object must be be a kind_of? the method's original
+ * class.
+ *
+ * class Square
+ * def area
+ * @side * @side
+ * end
+ * def initialize(side)
+ * @side = side
+ * end
+ * end
+ *
+ * area_un = Square.instance_method(:area)
+ *
+ * s = Square.new(12)
+ * area = area_un.bind(s)
+ * area.call #=> 144
+ *
+ * Unbound methods are a reference to the method at the time it was
+ * objectified: subsequent changes to the underlying class will not
+ * affect the unbound method.
+ *
+ * class Test
+ * def test
+ * :original
+ * end
+ * end
+ * um = Test.instance_method(:test)
+ * class Test
+ * def test
+ * :modified
+ * end
+ * end
+ * t = Test.new
+ * t.test #=> :modified
+ * um.bind(t).call #=> :original
+ *
+ */
+
+/*
+ * call-seq:
+ * umeth.bind(obj) -> method
+ *
+ * Bind <i>umeth</i> to <i>obj</i>. If <code>Klass</code> was the class
+ * from which <i>umeth</i> was obtained,
+ * <code>obj.kind_of?(Klass)</code> must be true.
+ *
+ * class A
+ * def test
+ * puts "In test, class = #{self.class}"
+ * end
+ * end
+ * class B < A
+ * end
+ * class C < B
+ * end
+ *
+ *
+ * um = B.instance_method(:test)
+ * bm = um.bind(C.new)
+ * bm.call
+ * bm = um.bind(B.new)
+ * bm.call
+ * bm = um.bind(A.new)
+ * bm.call
+ *
+ * <em>produces:</em>
+ *
+ * In test, class = C
+ * In test, class = B
+ * prog.rb:16:in `bind': bind argument must be an instance of B (TypeError)
+ * from prog.rb:16
+ */
+
+static VALUE
+umethod_bind(method, recv)
+ VALUE method, recv;
{
- rb_define_virtual_variable("$@", errat_getter, errat_setter);
- rb_define_virtual_variable("$!", errinfo_getter, 0);
+ struct METHOD *data, *bound;
+ VALUE rklass = CLASS_OF(recv);
- rb_define_global_function("raise", rb_f_raise, -1);
- rb_define_global_function("fail", rb_f_raise, -1);
+ Data_Get_Struct(method, struct METHOD, data);
+ if (data->rklass != rklass) {
+ if (FL_TEST(data->rklass, FL_SINGLETON)) {
+ rb_raise(rb_eTypeError, "singleton method bound for a different object");
+ }
+ if (TYPE(data->rklass) == T_MODULE) {
+ st_table *m_tbl = RCLASS(data->rklass)->m_tbl;
+ while (RCLASS(rklass)->m_tbl != m_tbl) {
+ rklass = RCLASS(rklass)->super;
+ if (!rklass) goto not_instace;
+ }
+ }
+ else if (!rb_obj_is_kind_of(recv, data->rklass)) {
+ not_instace:
+ rb_raise(rb_eTypeError, "bind argument must be an instance of %s",
+ rb_class2name(data->rklass));
+ }
+ }
- rb_define_global_function("global_variables", rb_f_global_variables, 0); /* in variable.c */
+ method = Data_Make_Struct(rb_cMethod,struct METHOD,bm_mark,free,bound);
+ *bound = *data;
+ bound->recv = recv;
+ bound->rklass = rklass;
- rb_define_global_function("__method__", rb_f_method_name, 0);
- rb_define_global_function("__callee__", rb_f_method_name, 0);
+ return method;
+}
- rb_define_private_method(rb_cModule, "append_features", rb_mod_append_features, 1);
- rb_define_private_method(rb_cModule, "extend_object", rb_mod_extend_object, 1);
- rb_define_private_method(rb_cModule, "include", rb_mod_include, -1);
+/*
+ * call-seq:
+ * meth.arity => fixnum
+ *
+ * Returns an indication of the number of arguments accepted by a
+ * method. Returns a nonnegative integer for methods that take a fixed
+ * number of arguments. For Ruby methods that take a variable number of
+ * arguments, returns -n-1, where n is the number of required
+ * arguments. For methods written in C, returns -1 if the call takes a
+ * variable number of arguments.
+ *
+ * class C
+ * def one; end
+ * def two(a); end
+ * def three(*a); end
+ * def four(a, b); end
+ * def five(a, b, *c); end
+ * def six(a, b, *c, &d); end
+ * end
+ * c = C.new
+ * c.method(:one).arity #=> 0
+ * c.method(:two).arity #=> 1
+ * c.method(:three).arity #=> -1
+ * c.method(:four).arity #=> 2
+ * c.method(:five).arity #=> -3
+ * c.method(:six).arity #=> -3
+ *
+ * "cat".method(:size).arity #=> 0
+ * "cat".method(:replace).arity #=> 1
+ * "cat".method(:squeeze).arity #=> -1
+ * "cat".method(:count).arity #=> -1
+ */
- rb_undef_method(rb_cClass, "module_function");
+static VALUE
+method_arity(method)
+ VALUE method;
+{
+ struct METHOD *data;
+ NODE *body;
+ int n;
- {
- extern void Init_vm_eval(void);
- extern void Init_eval_method(void);
- Init_vm_eval();
- Init_eval_method();
+ Data_Get_Struct(method, struct METHOD, data);
+
+ body = data->body;
+ switch (nd_type(body)) {
+ case NODE_CFUNC:
+ if (body->nd_argc < 0) return INT2FIX(-1);
+ return INT2FIX(body->nd_argc);
+ case NODE_ZSUPER:
+ return INT2FIX(-1);
+ case NODE_ATTRSET:
+ return INT2FIX(1);
+ case NODE_IVAR:
+ return INT2FIX(0);
+ case NODE_BMETHOD:
+ return proc_arity(body->nd_cval);
+ case NODE_DMETHOD:
+ return method_arity(body->nd_cval);
+ case NODE_SCOPE:
+ body = body->nd_next; /* skip NODE_SCOPE */
+ if (nd_type(body) == NODE_BLOCK)
+ body = body->nd_head;
+ if (!body) return INT2FIX(0);
+ n = body->nd_cnt;
+ if (body->nd_opt || body->nd_rest)
+ n = -n-1;
+ return INT2FIX(n);
+ default:
+ rb_raise(rb_eArgError, "invalid node 0x%x", nd_type(body));
+ }
+}
+
+/*
+ * call-seq:
+ * meth.to_s => string
+ * meth.inspect => string
+ *
+ * Show the name of the underlying method.
+ *
+ * "cat".method(:count).inspect #=> "#<Method: String#count>"
+ */
+
+static VALUE
+method_inspect(method)
+ VALUE method;
+{
+ struct METHOD *data;
+ VALUE str;
+ const char *s;
+ const char *sharp = "#";
+
+ Data_Get_Struct(method, struct METHOD, data);
+ str = rb_str_buf_new2("#<");
+ s = rb_obj_classname(method);
+ rb_str_buf_cat2(str, s);
+ rb_str_buf_cat2(str, ": ");
+
+ if (FL_TEST(data->klass, FL_SINGLETON)) {
+ VALUE v = rb_iv_get(data->klass, "__attached__");
+
+ if (data->recv == Qundef) {
+ rb_str_buf_append(str, rb_inspect(data->klass));
+ }
+ else if (data->recv == v) {
+ rb_str_buf_append(str, rb_inspect(v));
+ sharp = ".";
+ }
+ else {
+ rb_str_buf_append(str, rb_inspect(data->recv));
+ rb_str_buf_cat2(str, "(");
+ rb_str_buf_append(str, rb_inspect(v));
+ rb_str_buf_cat2(str, ")");
+ sharp = ".";
+ }
}
+ else {
+ rb_str_buf_cat2(str, rb_class2name(data->rklass));
+ if (data->rklass != data->klass) {
+ rb_str_buf_cat2(str, "(");
+ rb_str_buf_cat2(str, rb_class2name(data->klass));
+ rb_str_buf_cat2(str, ")");
+ }
+ }
+ rb_str_buf_cat2(str, sharp);
+ rb_str_buf_cat2(str, rb_id2name(data->oid));
+ rb_str_buf_cat2(str, ">");
- rb_define_singleton_method(rb_cModule, "nesting", rb_mod_nesting, 0);
- rb_define_singleton_method(rb_cModule, "constants", rb_mod_s_constants, -1);
+ return str;
+}
- rb_define_singleton_method(rb_vm_top_self(), "include", top_include, -1);
+static VALUE
+mproc(method)
+ VALUE method;
+{
+ VALUE proc;
- rb_define_method(rb_mKernel, "extend", rb_obj_extend, -1);
+ /* emulate ruby's method call */
+ PUSH_ITER(ITER_CUR);
+ PUSH_FRAME();
+ proc = rb_block_proc();
+ POP_FRAME();
+ POP_ITER();
- 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 */
+ return proc;
+}
+
+static VALUE
+bmcall(args, method)
+ VALUE args, method;
+{
+ volatile VALUE a;
+ VALUE ret;
+
+ a = svalue_to_avalue(args);
+ ret = method_call(RARRAY(a)->len, RARRAY(a)->ptr, method);
+ a = Qnil; /* prevent tail call */
+ return ret;
+}
+
+VALUE
+rb_proc_new(func, val)
+ VALUE (*func)(ANYARGS); /* VALUE yieldarg[, VALUE procarg] */
+ VALUE val;
+{
+ struct BLOCK *data;
+ VALUE proc = rb_iterate((VALUE(*)_((VALUE)))mproc, 0, func, val);
+
+ Data_Get_Struct(proc, struct BLOCK, data);
+ data->body->nd_state = YIELD_FUNC_LAMBDA;
+ data->flags |= BLOCK_LAMBDA;
+ return proc;
+}
+
+/*
+ * call-seq:
+ * meth.to_proc => prc
+ *
+ * Returns a <code>Proc</code> object corresponding to this method.
+ */
+
+static VALUE
+method_proc(method)
+ VALUE method;
+{
+ VALUE proc;
+ struct METHOD *mdata;
+ struct BLOCK *bdata;
+
+ proc = rb_iterate((VALUE(*)_((VALUE)))mproc, 0, bmcall, method);
+ Data_Get_Struct(method, struct METHOD, mdata);
+ Data_Get_Struct(proc, struct BLOCK, bdata);
+ bdata->body->nd_file = mdata->body->nd_file;
+ nd_set_line(bdata->body, nd_line(mdata->body));
+ bdata->body->nd_state = YIELD_FUNC_SVALUE;
+
+ return proc;
+}
+
+static VALUE
+rb_obj_is_method(m)
+ VALUE m;
+{
+ if (TYPE(m) == T_DATA && RDATA(m)->dmark == (RUBY_DATA_FUNC)bm_mark) {
+ return Qtrue;
+ }
+ return Qfalse;
+}
+
+/*
+ * call-seq:
+ * define_method(symbol, method) => new_method
+ * define_method(symbol) { block } => proc
+ *
+ * Defines an instance method in the receiver. The _method_
+ * parameter can be a +Proc+ or +Method+ object.
+ * If a block is specified, it is used as the method body. This block
+ * is evaluated using <code>instance_eval</code>, a point that is
+ * tricky to demonstrate because <code>define_method</code> is private.
+ * (This is why we resort to the +send+ hack in this example.)
+ *
+ * class A
+ * def fred
+ * puts "In Fred"
+ * end
+ * def create_method(name, &block)
+ * self.class.send(:define_method, name, &block)
+ * end
+ * define_method(:wilma) { puts "Charge it!" }
+ * end
+ * class B < A
+ * define_method(:barney, instance_method(:fred))
+ * end
+ * a = B.new
+ * a.barney
+ * a.wilma
+ * a.create_method(:betty) { p self }
+ * a.betty
+ *
+ * <em>produces:</em>
+ *
+ * In Fred
+ * Charge it!
+ * #<B:0x401b39e8>
+ */
+static VALUE
+rb_mod_define_method(argc, argv, mod)
+ int argc;
+ VALUE *argv;
+ VALUE mod;
+{
+ ID id;
+ VALUE body;
+ NODE *node;
+ int noex;
+
+ if (argc == 1) {
+ id = rb_to_id(argv[0]);
+ body = proc_lambda();
+ }
+ else if (argc == 2) {
+ id = rb_to_id(argv[0]);
+ body = argv[1];
+ if (!rb_obj_is_method(body) && !rb_obj_is_proc(body)) {
+ rb_raise(rb_eTypeError, "wrong argument type %s (expected Proc/Method)",
+ rb_obj_classname(body));
+ }
+ }
+ else {
+ rb_raise(rb_eArgError, "wrong number of arguments (%d for 1)", argc);
+ }
+ if (RDATA(body)->dmark == (RUBY_DATA_FUNC)bm_mark) {
+ node = NEW_DMETHOD(method_unbind(body));
+ }
+ else if (RDATA(body)->dmark == (RUBY_DATA_FUNC)blk_mark) {
+ struct BLOCK *block;
+
+ body = proc_clone(body);
+ Data_Get_Struct(body, struct BLOCK, block);
+ block->frame.last_func = id;
+ block->frame.orig_func = id;
+ block->frame.last_class = mod;
+ node = NEW_BMETHOD(body);
+ }
+ else {
+ /* type error */
+ rb_raise(rb_eTypeError, "wrong argument type (expected Proc/Method)");
+ }
+
+ noex = NOEX_PUBLIC;
+ if (ruby_cbase == mod) {
+ if (SCOPE_TEST(SCOPE_PRIVATE)) {
+ noex = NOEX_PRIVATE;
+ }
+ else if (SCOPE_TEST(SCOPE_PROTECTED)) {
+ noex = NOEX_PROTECTED;
+ }
+ }
+ rb_add_method(mod, id, node, noex);
+ return body;
+}
+
+/*
+ * <code>Proc</code> objects are blocks of code that have been bound to
+ * a set of local variables. Once bound, the code may be called in
+ * different contexts and still access those variables.
+ *
+ * def gen_times(factor)
+ * return Proc.new {|n| n*factor }
+ * end
+ *
+ * times3 = gen_times(3)
+ * times5 = gen_times(5)
+ *
+ * times3.call(12) #=> 36
+ * times5.call(5) #=> 25
+ * times3.call(times5.call(4)) #=> 60
+ *
+ */
+
+void
+Init_Proc()
+{
+ rb_eLocalJumpError = rb_define_class("LocalJumpError", rb_eStandardError);
+ rb_define_method(rb_eLocalJumpError, "exit_value", localjump_xvalue, 0);
+ rb_define_method(rb_eLocalJumpError, "reason", localjump_reason, 0);
+
+ rb_global_variable(&exception_error);
exception_error = rb_exc_new3(rb_eFatal,
rb_obj_freeze(rb_str_new2("exception reentered")));
OBJ_TAINT(exception_error);
OBJ_FREEZE(exception_error);
+
+ rb_eSysStackError = rb_define_class("SystemStackError", rb_eStandardError);
+ rb_global_variable(&sysstack_error);
+ sysstack_error = rb_exc_new3(rb_eSysStackError,
+ rb_obj_freeze(rb_str_new2("stack level too deep")));
+ OBJ_TAINT(sysstack_error);
+ OBJ_FREEZE(sysstack_error);
+
+ rb_cProc = rb_define_class("Proc", rb_cObject);
+ rb_undef_alloc_func(rb_cProc);
+ rb_define_singleton_method(rb_cProc, "new", proc_s_new, -1);
+
+ rb_define_method(rb_cProc, "clone", proc_clone, 0);
+ rb_define_method(rb_cProc, "dup", proc_dup, 0);
+ rb_define_method(rb_cProc, "call", rb_proc_call, -2);
+ rb_define_method(rb_cProc, "arity", proc_arity, 0);
+ rb_define_method(rb_cProc, "[]", rb_proc_call, -2);
+ rb_define_method(rb_cProc, "==", proc_eq, 1);
+ rb_define_method(rb_cProc, "to_s", proc_to_s, 0);
+ rb_define_method(rb_cProc, "to_proc", proc_to_self, 0);
+ rb_define_method(rb_cProc, "binding", proc_binding, 0);
+
+ rb_define_global_function("proc", proc_lambda, 0);
+ rb_define_global_function("lambda", proc_lambda, 0);
+
+ rb_cMethod = rb_define_class("Method", rb_cObject);
+ rb_undef_alloc_func(rb_cMethod);
+ rb_undef_method(CLASS_OF(rb_cMethod), "new");
+ rb_define_method(rb_cMethod, "==", method_eq, 1);
+ rb_define_method(rb_cMethod, "clone", method_clone, 0);
+ rb_define_method(rb_cMethod, "call", method_call, -1);
+ rb_define_method(rb_cMethod, "[]", method_call, -1);
+ rb_define_method(rb_cMethod, "arity", method_arity, 0);
+ rb_define_method(rb_cMethod, "inspect", method_inspect, 0);
+ rb_define_method(rb_cMethod, "to_s", method_inspect, 0);
+ rb_define_method(rb_cMethod, "to_proc", method_proc, 0);
+ rb_define_method(rb_cMethod, "receiver", method_receiver, 0);
+ rb_define_method(rb_cMethod, "name", method_name, 0);
+ rb_define_method(rb_cMethod, "owner", method_owner, 0);
+ rb_define_method(rb_cMethod, "unbind", method_unbind, 0);
+ rb_define_method(rb_mKernel, "method", rb_obj_method, 1);
+
+ rb_cUnboundMethod = rb_define_class("UnboundMethod", rb_cObject);
+ rb_undef_alloc_func(rb_cUnboundMethod);
+ rb_undef_method(CLASS_OF(rb_cUnboundMethod), "new");
+ rb_define_method(rb_cUnboundMethod, "==", method_eq, 1);
+ rb_define_method(rb_cUnboundMethod, "clone", method_clone, 0);
+ rb_define_method(rb_cUnboundMethod, "arity", method_arity, 0);
+ rb_define_method(rb_cUnboundMethod, "inspect", method_inspect, 0);
+ rb_define_method(rb_cUnboundMethod, "to_s", method_inspect, 0);
+ rb_define_method(rb_cUnboundMethod, "name", method_name, 0);
+ rb_define_method(rb_cUnboundMethod, "owner", method_owner, 0);
+ rb_define_method(rb_cUnboundMethod, "bind", umethod_bind, 1);
+ rb_define_method(rb_cModule, "instance_method", rb_mod_method, 1);
+}
+
+/*
+ * Objects of class <code>Binding</code> encapsulate the execution
+ * context at some particular place in the code and retain this context
+ * for future use. The variables, methods, value of <code>self</code>,
+ * and possibly an iterator block that can be accessed in this context
+ * are all retained. Binding objects can be created using
+ * <code>Kernel#binding</code>, and are made available to the callback
+ * of <code>Kernel#set_trace_func</code>.
+ *
+ * These binding objects can be passed as the second argument of the
+ * <code>Kernel#eval</code> method, establishing an environment for the
+ * evaluation.
+ *
+ * class Demo
+ * def initialize(n)
+ * @secret = n
+ * end
+ * def getBinding
+ * return binding()
+ * end
+ * end
+ *
+ * k1 = Demo.new(99)
+ * b1 = k1.getBinding
+ * k2 = Demo.new(-3)
+ * b2 = k2.getBinding
+ *
+ * eval("@secret", b1) #=> 99
+ * eval("@secret", b2) #=> -3
+ * eval("@secret") #=> nil
+ *
+ * Binding objects have no class-specific methods.
+ *
+ */
+
+void
+Init_Binding()
+{
+ rb_cBinding = rb_define_class("Binding", rb_cObject);
+ rb_undef_alloc_func(rb_cBinding);
+ rb_undef_method(CLASS_OF(rb_cBinding), "new");
+ rb_define_method(rb_cBinding, "clone", proc_clone, 0);
+ rb_define_method(rb_cBinding, "dup", proc_dup, 0);
+ rb_define_method(rb_cBinding, "eval", bind_eval, -1);
+ rb_define_global_function("binding", rb_f_binding, 0);
+}
+
+/* Windows SEH refers data on the stack. */
+#undef SAVE_WIN32_EXCEPTION_LIST
+#if defined _WIN32 || defined __CYGWIN__
+#if defined __CYGWIN__
+typedef unsigned long DWORD;
+#endif
+
+static inline DWORD
+win32_get_exception_list()
+{
+ DWORD p;
+# if defined _MSC_VER
+# ifdef _M_IX86
+# define SAVE_WIN32_EXCEPTION_LIST
+# if _MSC_VER >= 1310
+ /* warning: unsafe assignment to fs:0 ... this is ok */
+# pragma warning(disable: 4733)
+# endif
+ __asm mov eax, fs:[0];
+ __asm mov p, eax;
+# endif
+# elif defined __GNUC__
+# ifdef __i386__
+# define SAVE_WIN32_EXCEPTION_LIST
+ __asm__("movl %%fs:0,%0" : "=r"(p));
+# endif
+# elif defined __BORLANDC__
+# define SAVE_WIN32_EXCEPTION_LIST
+ __emit__(0x64, 0xA1, 0, 0, 0, 0); /* mov eax, fs:[0] */
+ p = _EAX;
+# endif
+ return p;
+}
+
+static inline void
+win32_set_exception_list(p)
+ DWORD p;
+{
+# if defined _MSC_VER
+# ifdef _M_IX86
+ __asm mov eax, p;
+ __asm mov fs:[0], eax;
+# endif
+# elif defined __GNUC__
+# ifdef __i386__
+ __asm__("movl %0,%%fs:0" :: "r"(p));
+# endif
+# elif defined __BORLANDC__
+ _EAX = p;
+ __emit__(0x64, 0xA3, 0, 0, 0, 0); /* mov fs:[0], eax */
+# endif
+}
+
+#if !defined SAVE_WIN32_EXCEPTION_LIST && !defined _WIN32_WCE
+# error unsupported platform
+#endif
+#endif
+
+int rb_thread_pending = 0;
+
+VALUE rb_cThread;
+
+extern VALUE rb_last_status;
+
+#define WAIT_FD (1<<0)
+#define WAIT_SELECT (1<<1)
+#define WAIT_TIME (1<<2)
+#define WAIT_JOIN (1<<3)
+#define WAIT_PID (1<<4)
+
+/* +infty, for this purpose */
+#define DELAY_INFTY 1E30
+
+#if !defined HAVE_PAUSE
+# if defined _WIN32 && !defined __CYGWIN__
+# define pause() Sleep(INFINITE)
+# else
+# define pause() sleep(0x7fffffff)
+# endif
+#endif
+
+#define THREAD_TERMINATING 0x400 /* persistent flag */
+#define THREAD_NO_ENSURE 0x800 /* persistent flag */
+#define THREAD_FLAGS_MASK 0xfc00 /* mask for persistent flags */
+
+#define FOREACH_THREAD_FROM(f,x) x = f; do { x = x->next;
+#define END_FOREACH_FROM(f,x) } while (x != f)
+
+#define FOREACH_THREAD(x) FOREACH_THREAD_FROM(curr_thread,x)
+#define END_FOREACH(x) END_FOREACH_FROM(curr_thread,x)
+
+struct thread_status_t {
+ NODE *node;
+
+ int tracing;
+ VALUE errinfo;
+ VALUE last_status;
+ VALUE last_line;
+ VALUE last_match;
+
+ int safe;
+
+ enum rb_thread_status status;
+ int wait_for;
+ int fd;
+ fd_set readfds;
+ fd_set writefds;
+ fd_set exceptfds;
+ int select_value;
+ double delay;
+ rb_thread_t join;
+};
+
+#define THREAD_COPY_STATUS(src, dst) (void)( \
+ (dst)->node = (src)->node, \
+ \
+ (dst)->tracing = (src)->tracing, \
+ (dst)->errinfo = (src)->errinfo, \
+ (dst)->last_status = (src)->last_status, \
+ (dst)->last_line = (src)->last_line, \
+ (dst)->last_match = (src)->last_match, \
+ \
+ (dst)->safe = (src)->safe, \
+ \
+ (dst)->status = (src)->status, \
+ (dst)->wait_for = (src)->wait_for, \
+ (dst)->fd = (src)->fd, \
+ (dst)->readfds = (src)->readfds, \
+ (dst)->writefds = (src)->writefds, \
+ (dst)->exceptfds = (src)->exceptfds, \
+ (dst)->select_value = (src)->select_value, \
+ (dst)->delay = (src)->delay, \
+ (dst)->join = (src)->join, \
+ 0)
+
+int
+rb_thread_set_raised(th)
+ rb_thread_t th;
+{
+ if (th->flags & RAISED_EXCEPTION) {
+ return 1;
+ }
+ th->flags |= RAISED_EXCEPTION;
+ return 0;
+}
+
+int
+rb_thread_reset_raised(th)
+ rb_thread_t th;
+{
+ if (!(th->flags & RAISED_EXCEPTION)) {
+ return 0;
+ }
+ th->flags &= ~RAISED_EXCEPTION;
+ return 1;
+}
+
+static int
+thread_no_ensure()
+{
+ return ((curr_thread->flags & THREAD_NO_ENSURE) == THREAD_NO_ENSURE);
+}
+
+static void rb_thread_ready _((rb_thread_t));
+
+static VALUE run_trap_eval _((VALUE));
+static VALUE
+run_trap_eval(arg)
+ VALUE arg;
+{
+ VALUE *p = (VALUE *)arg;
+ return rb_eval_cmd(p[0], p[1], (int)p[2]);
+}
+
+static VALUE
+rb_trap_eval(cmd, sig, safe)
+ VALUE cmd;
+ int sig, safe;
+{
+ int state;
+ VALUE val = Qnil; /* OK */
+ volatile struct thread_status_t save;
+ VALUE arg[3];
+
+ arg[0] = cmd;
+ arg[1] = rb_ary_new3(1, INT2FIX(sig));
+ arg[2] = (VALUE)safe;
+ THREAD_COPY_STATUS(curr_thread, &save);
+ rb_thread_ready(curr_thread);
+ PUSH_ITER(ITER_NOT);
+ val = rb_protect(run_trap_eval, (VALUE)&arg, &state);
+ POP_ITER();
+ THREAD_COPY_STATUS(&save, curr_thread);
+
+ if (state) {
+ rb_trap_immediate = 0;
+ rb_thread_ready(curr_thread);
+ JUMP_TAG(state);
+ }
+
+ if (curr_thread->status == THREAD_STOPPED) {
+ rb_thread_schedule();
+ }
+ errno = EINTR;
+
+ return val;
+}
+
+static const char *
+thread_status_name(status)
+ enum rb_thread_status status;
+{
+ switch (status) {
+ case THREAD_RUNNABLE:
+ return "run";
+ case THREAD_STOPPED:
+ return "sleep";
+ case THREAD_TO_KILL:
+ return "aborting";
+ case THREAD_KILLED:
+ return "dead";
+ default:
+ return "unknown";
+ }
+}
+
+/* $SAFE accessor */
+void
+rb_set_safe_level(level)
+ int level;
+{
+ if (level > ruby_safe_level) {
+ if (level > SAFE_LEVEL_MAX) level = SAFE_LEVEL_MAX;
+ ruby_safe_level = level;
+ curr_thread->safe = level;
+ }
+}
+
+static VALUE
+safe_getter()
+{
+ return INT2NUM(ruby_safe_level);
+}
+
+static void
+safe_setter(val)
+ VALUE val;
+{
+ int level = NUM2INT(val);
+
+ if (level < ruby_safe_level) {
+ rb_raise(rb_eSecurityError, "tried to downgrade safe level from %d to %d",
+ ruby_safe_level, level);
+ }
+ if (level > SAFE_LEVEL_MAX) level = SAFE_LEVEL_MAX;
+ ruby_safe_level = level;
+ curr_thread->safe = level;
+}
+
+/* Return the current time as a floating-point number */
+static double
+timeofday()
+{
+ struct timeval tv;
+#ifdef CLOCK_MONOTONIC
+ struct timespec tp;
+
+ if (clock_gettime(CLOCK_MONOTONIC, &tp) == 0) {
+ return (double)tp.tv_sec + (double)tp.tv_nsec * 1e-9;
+ }
+#endif
+ gettimeofday(&tv, NULL);
+ return (double)tv.tv_sec + (double)tv.tv_usec * 1e-6;
+}
+
+#define STACK(addr) (th->stk_pos<(VALUE*)(addr) && (VALUE*)(addr)<th->stk_pos+th->stk_len)
+#define ADJ(addr) (void*)(STACK(addr)?(((VALUE*)(addr)-th->stk_pos)+th->stk_ptr):(VALUE*)(addr))
+static void
+thread_mark(th)
+ rb_thread_t th;
+{
+ struct FRAME *frame;
+ struct BLOCK *block;
+
+ rb_gc_mark(th->result);
+ rb_gc_mark(th->thread);
+ if (th->join) rb_gc_mark(th->join->thread);
+
+ rb_gc_mark(th->klass);
+ rb_gc_mark(th->wrapper);
+ rb_gc_mark((VALUE)th->cref);
+
+ rb_gc_mark((VALUE)th->scope);
+ rb_gc_mark((VALUE)th->dyna_vars);
+ rb_gc_mark(th->errinfo);
+ rb_gc_mark(th->last_status);
+ rb_gc_mark(th->last_line);
+ rb_gc_mark(th->last_match);
+ rb_mark_tbl(th->locals);
+ rb_gc_mark(th->thgroup);
+ rb_gc_mark_maybe(th->sandbox);
+
+ /* mark data in copied stack */
+ if (th == curr_thread) return;
+ if (th->status == THREAD_KILLED) return;
+ if (th->stk_len == 0) return; /* stack not active, no need to mark. */
+ if (th->stk_ptr) {
+ rb_gc_mark_locations(th->stk_ptr, th->stk_ptr+th->stk_len);
+#if defined(THINK_C) || defined(__human68k__)
+ rb_gc_mark_locations(th->stk_ptr+2, th->stk_ptr+th->stk_len+2);
+#endif
+#ifdef __ia64
+ if (th->bstr_ptr) {
+ rb_gc_mark_locations(th->bstr_ptr, th->bstr_ptr+th->bstr_len);
+ }
+#endif
+ }
+ frame = th->frame;
+ while (frame && frame != top_frame) {
+ frame = ADJ(frame);
+ rb_gc_mark_frame(frame);
+ if (frame->tmp) {
+ struct FRAME *tmp = frame->tmp;
+
+ while (tmp && tmp != top_frame) {
+ tmp = ADJ(tmp);
+ rb_gc_mark_frame(tmp);
+ tmp = tmp->prev;
+ }
+ }
+ frame = frame->prev;
+ }
+ block = th->block;
+ while (block) {
+ block = ADJ(block);
+ rb_gc_mark_frame(&block->frame);
+ block = block->prev;
+ }
+}
+
+static int
+mark_loading_thread(key, value, lev)
+ ID key;
+ VALUE value;
+ int lev;
+{
+ rb_gc_mark(((rb_thread_t)value)->thread);
+ return ST_CONTINUE;
+}
+
+void
+rb_gc_mark_threads()
+{
+ rb_thread_t th;
+
+ /* static global mark */
+ rb_gc_mark((VALUE)ruby_cref);
+
+ if (!curr_thread) return;
+ rb_gc_mark(main_thread->thread);
+ rb_gc_mark(curr_thread->thread);
+ FOREACH_THREAD_FROM(main_thread, th) {
+ switch (th->status) {
+ case THREAD_TO_KILL:
+ case THREAD_RUNNABLE:
+ break;
+ case THREAD_STOPPED:
+ if (th->wait_for) break;
+ default:
+ continue;
+ }
+ rb_gc_mark(th->thread);
+ } END_FOREACH_FROM(main_thread, th);
+ if (loading_tbl) st_foreach(loading_tbl, mark_loading_thread, 0);
+}
+
+void
+rb_gc_abort_threads()
+{
+ rb_thread_t th;
+
+ if (!main_thread)
+ return;
+
+ FOREACH_THREAD_FROM(main_thread, th) {
+ if (FL_TEST(th->thread, FL_MARK)) continue;
+ if (th->status == THREAD_STOPPED) {
+ th->status = THREAD_TO_KILL;
+ rb_gc_mark(th->thread);
+ }
+ } END_FOREACH_FROM(main_thread, th);
+}
+
+static inline void
+stack_free(th)
+ rb_thread_t th;
+{
+ if (th->stk_ptr) free(th->stk_ptr);
+ th->stk_ptr = 0;
+#ifdef __ia64
+ if (th->bstr_ptr) free(th->bstr_ptr);
+ th->bstr_ptr = 0;
+#endif
+}
+
+static void
+thread_free(th)
+ rb_thread_t th;
+{
+ stack_free(th);
+ if (th->locals) st_free_table(th->locals);
+ if (th->status != THREAD_KILLED) {
+ if (th->prev) th->prev->next = th->next;
+ if (th->next) th->next->prev = th->prev;
+ }
+ if (th != main_thread) free(th);
+}
+
+static rb_thread_t
+rb_thread_check(data)
+ VALUE data;
+{
+ if (TYPE(data) != T_DATA || RDATA(data)->dmark != (RUBY_DATA_FUNC)thread_mark) {
+ rb_raise(rb_eTypeError, "wrong argument type %s (expected Thread)",
+ rb_obj_classname(data));
+ }
+ return (rb_thread_t)RDATA(data)->data;
+}
+
+static VALUE rb_thread_raise _((int, VALUE*, rb_thread_t));
+
+static VALUE th_raise_exception;
+static NODE *th_raise_node;
+static VALUE th_cmd;
+static int th_sig, th_safe;
+
+#define RESTORE_NORMAL 1
+#define RESTORE_FATAL 2
+#define RESTORE_INTERRUPT 3
+#define RESTORE_TRAP 4
+#define RESTORE_RAISE 5
+#define RESTORE_SIGNAL 6
+#define RESTORE_EXIT 7
+
+extern VALUE *rb_gc_stack_start;
+#ifdef __ia64
+extern VALUE *rb_gc_register_stack_start;
+#endif
+
+static void
+rb_thread_save_context(th)
+ rb_thread_t th;
+{
+ VALUE *pos;
+ size_t len;
+ static VALUE tval;
+
+ len = ruby_stack_length(&pos);
+ th->stk_len = 0;
+ th->stk_pos = pos;
+ if (len > th->stk_max) {
+ VALUE *ptr = realloc(th->stk_ptr, sizeof(VALUE) * len);
+ if (!ptr) rb_memerror();
+ th->stk_ptr = ptr;
+ th->stk_max = len;
+ }
+ th->stk_len = len;
+ FLUSH_REGISTER_WINDOWS;
+ MEMCPY(th->stk_ptr, th->stk_pos, VALUE, th->stk_len);
+#ifdef __ia64
+ th->bstr_pos = rb_gc_register_stack_start;
+ len = (VALUE*)rb_ia64_bsp() - th->bstr_pos;
+ th->bstr_len = 0;
+ if (len > th->bstr_max) {
+ VALUE *ptr = realloc(th->bstr_ptr, sizeof(VALUE) * len);
+ if (!ptr) rb_memerror();
+ th->bstr_ptr = ptr;
+ th->bstr_max = len;
+ }
+ th->bstr_len = len;
+ rb_ia64_flushrs();
+ MEMCPY(th->bstr_ptr, th->bstr_pos, VALUE, th->bstr_len);
+#endif
+#ifdef SAVE_WIN32_EXCEPTION_LIST
+ th->win32_exception_list = win32_get_exception_list();
+#endif
+
+ th->frame = ruby_frame;
+ th->scope = ruby_scope;
+ ruby_scope->flags |= SCOPE_DONT_RECYCLE;
+ th->klass = ruby_class;
+ th->wrapper = ruby_wrapper;
+ th->cref = ruby_cref;
+ th->dyna_vars = ruby_dyna_vars;
+ th->block = ruby_block;
+ th->flags &= THREAD_FLAGS_MASK;
+ th->flags |= (rb_trap_immediate<<8) | scope_vmode;
+ th->iter = ruby_iter;
+ th->tag = prot_tag;
+ th->tracing = tracing;
+ th->errinfo = ruby_errinfo;
+ th->last_status = rb_last_status;
+ tval = rb_lastline_get();
+ rb_lastline_set(th->last_line);
+ th->last_line = tval;
+ tval = rb_backref_get();
+ rb_backref_set(th->last_match);
+ th->last_match = tval;
+ th->safe = ruby_safe_level;
+
+ th->node = ruby_current_node;
+ if (ruby_sandbox_save != NULL) {
+ ruby_sandbox_save(th);
+ }
+}
+
+static int
+rb_thread_switch(n)
+ int n;
+{
+ rb_trap_immediate = (curr_thread->flags&0x100)?1:0;
+ switch (n) {
+ case 0:
+ return 0;
+ case RESTORE_FATAL:
+ JUMP_TAG(TAG_FATAL);
+ break;
+ case RESTORE_INTERRUPT:
+ rb_interrupt();
+ break;
+ case RESTORE_TRAP:
+ rb_trap_eval(th_cmd, th_sig, th_safe);
+ break;
+ case RESTORE_RAISE:
+ ruby_frame->last_func = 0;
+ ruby_current_node = th_raise_node;
+ rb_raise_jump(th_raise_exception);
+ break;
+ case RESTORE_SIGNAL:
+ rb_thread_signal_raise(th_sig);
+ break;
+ case RESTORE_EXIT:
+ ruby_errinfo = th_raise_exception;
+ ruby_current_node = th_raise_node;
+ if (!rb_obj_is_kind_of(ruby_errinfo, rb_eSystemExit)) {
+ terminate_process(EXIT_FAILURE, ruby_errinfo);
+ }
+ rb_exc_raise(th_raise_exception);
+ break;
+ case RESTORE_NORMAL:
+ default:
+ break;
+ }
+ return 1;
+}
+
+#define THREAD_SAVE_CONTEXT(th) \
+ (rb_thread_switch(ruby_setjmp(rb_thread_save_context(th), (th)->context)))
+
+NORETURN(static void rb_thread_restore_context _((rb_thread_t,int)));
+NORETURN(NOINLINE(static void rb_thread_restore_context_0(rb_thread_t,int)));
+NORETURN(NOINLINE(static void stack_extend(rb_thread_t, int)));
+
+static void
+rb_thread_restore_context_0(rb_thread_t th, int exit)
+{
+ static rb_thread_t tmp;
+ static int ex;
+ static VALUE tval;
+
+ rb_trap_immediate = 0; /* inhibit interrupts from here */
+ if (ruby_sandbox_restore != NULL) {
+ ruby_sandbox_restore(th);
+ }
+ ruby_frame = th->frame;
+ ruby_scope = th->scope;
+ ruby_class = th->klass;
+ ruby_wrapper = th->wrapper;
+ ruby_cref = th->cref;
+ ruby_dyna_vars = th->dyna_vars;
+ ruby_block = th->block;
+ scope_vmode = th->flags&SCOPE_MASK;
+ ruby_iter = th->iter;
+ prot_tag = th->tag;
+ tracing = th->tracing;
+ ruby_errinfo = th->errinfo;
+ rb_last_status = th->last_status;
+ ruby_safe_level = th->safe;
+
+ ruby_current_node = th->node;
+
+#ifdef SAVE_WIN32_EXCEPTION_LIST
+ win32_set_exception_list(th->win32_exception_list);
+#endif
+ tmp = th;
+ ex = exit;
+ FLUSH_REGISTER_WINDOWS;
+ MEMCPY(tmp->stk_pos, tmp->stk_ptr, VALUE, tmp->stk_len);
+#ifdef __ia64
+ MEMCPY(tmp->bstr_pos, tmp->bstr_ptr, VALUE, tmp->bstr_len);
+#endif
+
+ tval = rb_lastline_get();
+ rb_lastline_set(tmp->last_line);
+ tmp->last_line = tval;
+ tval = rb_backref_get();
+ rb_backref_set(tmp->last_match);
+ tmp->last_match = tval;
+
+ ruby_longjmp(tmp->context, ex);
+}
+
+#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);
+int rb_dummy_false = 0;
+NORETURN(NOINLINE(static void register_stack_extend(rb_thread_t, int, VALUE *)));
+static void
+register_stack_extend(rb_thread_t th, int exit, 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 < th->bstr_pos+th->bstr_len) {
+ register_stack_extend(th, exit, (VALUE*)rb_ia64_bsp());
+ }
+ stack_extend(th, exit);
+}
+#undef C
+#undef E
+#endif
+
+static void
+stack_extend(rb_thread_t th, int exit)
+{
+#define STACK_PAD_SIZE 1024
+ volatile VALUE space[STACK_PAD_SIZE], *sp = space;
+
+#if !STACK_GROW_DIRECTION
+ if (space < rb_gc_stack_start) {
+ /* Stack grows downward */
+#endif
+#if STACK_GROW_DIRECTION <= 0
+ if (space > th->stk_pos) {
+# ifdef HAVE_ALLOCA
+ sp = ALLOCA_N(VALUE, &space[0] - th->stk_pos);
+# else
+ stack_extend(th, exit);
+# endif
+ }
+#endif
+#if !STACK_GROW_DIRECTION
+ }
+ else {
+ /* Stack grows upward */
+#endif
+#if STACK_GROW_DIRECTION >= 0
+ if (&space[STACK_PAD_SIZE] < th->stk_pos + th->stk_len) {
+# ifdef HAVE_ALLOCA
+ sp = ALLOCA_N(VALUE, th->stk_pos + th->stk_len - &space[STACK_PAD_SIZE]);
+# else
+ stack_extend(th, exit);
+# endif
+ }
+#endif
+#if !STACK_GROW_DIRECTION
+ }
+#endif
+ rb_thread_restore_context_0(th, exit);
+}
+#ifdef __ia64
+#define stack_extend(th, exit) register_stack_extend(th, exit, (VALUE*)rb_ia64_bsp())
+#endif
+
+static void
+rb_thread_restore_context(th, exit)
+ rb_thread_t th;
+ int exit;
+{
+ if (!th->stk_ptr) rb_bug("unsaved context");
+ stack_extend(th, exit);
+}
+
+static void
+rb_thread_ready(th)
+ rb_thread_t th;
+{
+ th->wait_for = 0;
+ if (th->status != THREAD_TO_KILL) {
+ th->status = THREAD_RUNNABLE;
+ }
+}
+
+static void
+rb_thread_die(th)
+ rb_thread_t th;
+{
+ th->thgroup = 0;
+ th->status = THREAD_KILLED;
+ stack_free(th);
+}
+
+static void
+rb_thread_remove(th)
+ rb_thread_t th;
+{
+ if (th->status == THREAD_KILLED) return;
+
+ rb_thread_ready(th);
+ rb_thread_die(th);
+ th->prev->next = th->next;
+ th->next->prev = th->prev;
+}
+
+static int
+rb_thread_dead(th)
+ rb_thread_t th;
+{
+ return th->status == THREAD_KILLED;
+}
+
+void
+rb_thread_fd_close(fd)
+ int fd;
+{
+ rb_thread_t th;
+
+ FOREACH_THREAD(th) {
+ if (((th->wait_for & WAIT_FD) && fd == th->fd) ||
+ ((th->wait_for & WAIT_SELECT) && (fd < th->fd) &&
+ (FD_ISSET(fd, &th->readfds) ||
+ FD_ISSET(fd, &th->writefds) ||
+ FD_ISSET(fd, &th->exceptfds)))) {
+ VALUE exc = rb_exc_new2(rb_eIOError, "stream closed");
+ rb_thread_raise(1, &exc, th);
+ }
+ }
+ END_FOREACH(th);
+}
+
+NORETURN(static void rb_thread_main_jump _((VALUE, int)));
+static void
+rb_thread_main_jump(err, tag)
+ VALUE err;
+ int tag;
+{
+ curr_thread = main_thread;
+ th_raise_exception = err;
+ th_raise_node = ruby_current_node;
+ rb_thread_restore_context(main_thread, tag);
+}
+
+NORETURN(static void rb_thread_deadlock _((void)));
+static void
+rb_thread_deadlock()
+{
+ char msg[21+SIZEOF_LONG*2];
+ VALUE e;
+
+ sprintf(msg, "Thread(0x%lx): deadlock", curr_thread->thread);
+ e = rb_exc_new2(rb_eFatal, msg);
+ if (curr_thread == main_thread) {
+ rb_exc_raise(e);
+ }
+ rb_thread_main_jump(e, RESTORE_RAISE);
+}
+
+static void
+copy_fds(dst, src, max)
+ fd_set *dst, *src;
+ int max;
+{
+ int n = 0;
+ int i;
+
+ for (i=0; i<=max; i++) {
+ if (FD_ISSET(i, src)) {
+ n = i;
+ FD_SET(i, dst);
+ }
+ }
+}
+
+static int
+match_fds(dst, src, max)
+ fd_set *dst, *src;
+ int max;
+{
+ int i;
+
+ for (i=0; i<=max; i++) {
+ if (FD_ISSET(i, src) && FD_ISSET(i, dst)) {
+ return Qtrue;
+ }
+ }
+ return Qfalse;
+}
+
+static int
+intersect_fds(src, dst, max)
+ fd_set *src, *dst;
+ int max;
+{
+ int i, n = 0;
+
+ for (i=0; i<=max; i++) {
+ if (FD_ISSET(i, dst)) {
+ if (FD_ISSET(i, src)) {
+ /* Wake up only one thread per fd. */
+ FD_CLR(i, src);
+ n++;
+ }
+ else {
+ FD_CLR(i, dst);
+ }
+ }
+ }
+ return n;
+}
+
+static int
+find_bad_fds(dst, src, max)
+ fd_set *dst, *src;
+ int max;
+{
+ int i, test = Qfalse;
+
+ for (i=0; i<=max; i++) {
+ if (FD_ISSET(i, src) && !FD_ISSET(i, dst)) {
+ FD_CLR(i, src);
+ test = Qtrue;
+ }
+ }
+ return test;
+}
+
+void
+rb_thread_schedule()
+{
+ rb_thread_t next; /* OK */
+ rb_thread_t th;
+ rb_thread_t curr;
+ rb_thread_t th_found = 0;
+ int found = 0;
+
+ fd_set readfds;
+ fd_set writefds;
+ fd_set exceptfds;
+ struct timeval delay_tv, *delay_ptr;
+ double delay, now; /* OK */
+ int n, max;
+ int need_select = 0;
+ int select_timeout = 0;
+
+#ifdef HAVE_NATIVETHREAD
+ if (!is_ruby_native_thread()) {
+ rb_bug("cross-thread violation on rb_thread_schedule()");
+ }
+#endif
+ rb_thread_pending = 0;
+ rb_gc_finalize_deferred();
+ if (curr_thread == curr_thread->next
+ && curr_thread->status == THREAD_RUNNABLE)
+ return;
+
+ next = 0;
+ curr = curr_thread; /* starting thread */
+
+ while (curr->status == THREAD_KILLED) {
+ curr = curr->prev;
+ }
+
+ again:
+ max = -1;
+ FD_ZERO(&readfds);
+ FD_ZERO(&writefds);
+ FD_ZERO(&exceptfds);
+ delay = DELAY_INFTY;
+ now = -1.0;
+
+ FOREACH_THREAD_FROM(curr, th) {
+ if (!found && th->status <= THREAD_RUNNABLE) {
+ found = 1;
+ }
+ if (th->status != THREAD_STOPPED) continue;
+ if (th->wait_for & WAIT_JOIN) {
+ if (rb_thread_dead(th->join)) {
+ th->status = THREAD_RUNNABLE;
+ found = 1;
+ }
+ }
+ if (th->wait_for & WAIT_FD) {
+ FD_SET(th->fd, &readfds);
+ if (max < th->fd) max = th->fd;
+ need_select = 1;
+ }
+ if (th->wait_for & WAIT_SELECT) {
+ copy_fds(&readfds, &th->readfds, th->fd);
+ copy_fds(&writefds, &th->writefds, th->fd);
+ copy_fds(&exceptfds, &th->exceptfds, th->fd);
+ if (max < th->fd) max = th->fd;
+ need_select = 1;
+ if (th->wait_for & WAIT_TIME) {
+ select_timeout = 1;
+ }
+ th->select_value = 0;
+ }
+ if (th->wait_for & WAIT_TIME) {
+ double th_delay;
+
+ if (now < 0.0) now = timeofday();
+ th_delay = th->delay - now;
+ if (th_delay <= 0.0) {
+ th->status = THREAD_RUNNABLE;
+ found = 1;
+ }
+ else if (th_delay < delay) {
+ delay = th_delay;
+ need_select = 1;
+ }
+ else if (th->delay == DELAY_INFTY) {
+ need_select = 1;
+ }
+ }
+ }
+ END_FOREACH_FROM(curr, th);
+
+ /* Do the select if needed */
+ if (need_select) {
+ /* Convert delay to a timeval */
+ /* If a thread is runnable, just poll */
+ if (found) {
+ delay_tv.tv_sec = 0;
+ delay_tv.tv_usec = 0;
+ delay_ptr = &delay_tv;
+ }
+ else if (delay == DELAY_INFTY) {
+ delay_ptr = 0;
+ }
+ else {
+ delay_tv.tv_sec = delay;
+ delay_tv.tv_usec = (delay - (double)delay_tv.tv_sec)*1e6;
+ delay_ptr = &delay_tv;
+ }
+
+ n = select(max+1, &readfds, &writefds, &exceptfds, delay_ptr);
+ if (n < 0) {
+ int e = errno;
+
+ if (rb_trap_pending) rb_trap_exec();
+ if (e == EINTR) goto again;
+#ifdef ERESTART
+ if (e == ERESTART) goto again;
+#endif
+ FOREACH_THREAD_FROM(curr, th) {
+ if (th->wait_for & WAIT_SELECT) {
+ int v = 0;
+
+ v |= find_bad_fds(&readfds, &th->readfds, th->fd);
+ v |= find_bad_fds(&writefds, &th->writefds, th->fd);
+ v |= find_bad_fds(&exceptfds, &th->exceptfds, th->fd);
+ if (v) {
+ th->select_value = n;
+ n = max;
+ }
+ }
+ }
+ END_FOREACH_FROM(curr, th);
+ }
+ if (select_timeout && n == 0) {
+ if (now < 0.0) now = timeofday();
+ FOREACH_THREAD_FROM(curr, th) {
+ if (((th->wait_for&(WAIT_SELECT|WAIT_TIME)) == (WAIT_SELECT|WAIT_TIME)) &&
+ th->delay <= now) {
+ th->status = THREAD_RUNNABLE;
+ th->wait_for = 0;
+ th->select_value = 0;
+ found = 1;
+ intersect_fds(&readfds, &th->readfds, max);
+ intersect_fds(&writefds, &th->writefds, max);
+ intersect_fds(&exceptfds, &th->exceptfds, max);
+ }
+ }
+ END_FOREACH_FROM(curr, th);
+ }
+ if (n > 0) {
+ now = -1.0;
+ /* Some descriptors are ready.
+ * Choose a thread which may run next.
+ * Don't change the status of threads which don't run next.
+ */
+ FOREACH_THREAD_FROM(curr, th) {
+ if ((th->wait_for&WAIT_FD) && FD_ISSET(th->fd, &readfds)) {
+ th_found = th;
+ found = 1;
+ break;
+ }
+ if ((th->wait_for&WAIT_SELECT) &&
+ (match_fds(&readfds, &th->readfds, max) ||
+ match_fds(&writefds, &th->writefds, max) ||
+ match_fds(&exceptfds, &th->exceptfds, max))) {
+ th_found = th;
+ found = 1;
+ break;
+ }
+ }
+ END_FOREACH_FROM(curr, th);
+ }
+ /* The delays for some of the threads should have expired.
+ Go through the loop once more, to check the delays. */
+ if (!found && delay != DELAY_INFTY)
+ goto again;
+ }
+
+ FOREACH_THREAD_FROM(curr, th) {
+ if (th->status == THREAD_TO_KILL) {
+ next = th;
+ break;
+ }
+ if ((th->status == THREAD_RUNNABLE || th == th_found) && th->stk_ptr) {
+ if (!next || next->priority < th->priority) {
+ if (th == th_found) {
+ th_found->status = THREAD_RUNNABLE;
+ th_found->wait_for = 0;
+ if (th->wait_for&WAIT_FD) {
+ th_found->fd = 0;
+ }
+ else { /* th->wait_for&WAIT_SELECT */
+ n = intersect_fds(&readfds, &th_found->readfds, max) +
+ intersect_fds(&writefds, &th_found->writefds, max) +
+ intersect_fds(&exceptfds, &th_found->exceptfds, max);
+ th_found->select_value = n;
+ }
+ }
+ next = th;
+ }
+ }
+ }
+ END_FOREACH_FROM(curr, th);
+
+ if (!next) {
+ /* raise fatal error to main thread */
+ curr_thread->node = ruby_current_node;
+ if (curr->next == curr) {
+ TRAP_BEG;
+ pause();
+ TRAP_END;
+ }
+ FOREACH_THREAD_FROM(curr, th) {
+ warn_printf("deadlock 0x%lx: %s:",
+ th->thread, thread_status_name(th->status));
+ if (th->wait_for & WAIT_FD) warn_printf("F(%d)", th->fd);
+ if (th->wait_for & WAIT_SELECT) warn_printf("S");
+ if (th->wait_for & WAIT_TIME) warn_printf("T(%f)", th->delay);
+ if (th->wait_for & WAIT_JOIN)
+ warn_printf("J(0x%lx)", th->join ? th->join->thread : 0);
+ if (th->wait_for & WAIT_PID) warn_printf("P");
+ if (!th->wait_for) warn_printf("-");
+ warn_printf(" %s - %s:%d\n",
+ th==main_thread ? "(main)" : "",
+ th->node->nd_file, nd_line(th->node));
+ }
+ END_FOREACH_FROM(curr, th);
+ next = main_thread;
+ rb_thread_ready(next);
+ next->status = THREAD_TO_KILL;
+ if (!rb_thread_dead(curr_thread)) {
+ rb_thread_save_context(curr_thread);
+ }
+ rb_thread_deadlock();
+ }
+ next->wait_for = 0;
+ if (next->status == THREAD_RUNNABLE && next == curr_thread) {
+ return;
+ }
+
+ /* context switch */
+ if (curr == curr_thread) {
+ if (THREAD_SAVE_CONTEXT(curr)) {
+ return;
+ }
+ }
+
+ curr_thread = next;
+ if (next->status == THREAD_TO_KILL) {
+ if (!(next->flags & THREAD_TERMINATING)) {
+ next->flags |= THREAD_TERMINATING;
+ /* terminate; execute ensure-clause if any */
+ rb_thread_restore_context(next, RESTORE_FATAL);
+ }
+ }
+ rb_thread_restore_context(next, RESTORE_NORMAL);
+}
+
+void
+rb_thread_wait_fd(fd)
+ int fd;
+{
+ if (rb_thread_critical) return;
+ if (ruby_in_compile) return;
+ if (curr_thread == curr_thread->next) return;
+ if (curr_thread->status == THREAD_TO_KILL) return;
+
+ curr_thread->status = THREAD_STOPPED;
+ curr_thread->fd = fd;
+ curr_thread->wait_for = WAIT_FD;
+ rb_thread_schedule();
+}
+
+int
+rb_thread_fd_writable(fd)
+ int fd;
+{
+ if (rb_thread_critical) return Qtrue;
+ if (curr_thread == curr_thread->next) return Qtrue;
+ if (curr_thread->status == THREAD_TO_KILL) return Qtrue;
+ if (curr_thread->status == THREAD_KILLED) return Qtrue;
+
+ curr_thread->status = THREAD_STOPPED;
+ FD_ZERO(&curr_thread->readfds);
+ FD_ZERO(&curr_thread->writefds);
+ FD_SET(fd, &curr_thread->writefds);
+ FD_ZERO(&curr_thread->exceptfds);
+ curr_thread->fd = fd+1;
+ curr_thread->wait_for = WAIT_SELECT;
+ rb_thread_schedule();
+ return Qfalse;
+}
+
+void
+rb_thread_wait_for(time)
+ struct timeval time;
+{
+ double date;
+
+ if (rb_thread_critical ||
+ curr_thread == curr_thread->next ||
+ curr_thread->status == THREAD_TO_KILL) {
+ int n;
+ int thr_critical = rb_thread_critical;
+#ifndef linux
+ double d, limit;
+ limit = timeofday()+(double)time.tv_sec+(double)time.tv_usec*1e-6;
+#endif
+ for (;;) {
+ rb_thread_critical = Qtrue;
+ TRAP_BEG;
+ n = select(0, 0, 0, 0, &time);
+ rb_thread_critical = thr_critical;
+ TRAP_END;
+ if (n == 0) return;
+ if (n < 0) {
+ switch (errno) {
+ case EINTR:
+#ifdef ERESTART
+ case ERESTART:
+#endif
+ break;
+ default:
+ rb_sys_fail("sleep");
+ }
+ }
+#ifndef linux
+ d = limit - timeofday();
+
+ time.tv_sec = (int)d;
+ time.tv_usec = (int)((d - (int)d)*1e6);
+ if (time.tv_usec < 0) {
+ time.tv_usec += (long)1e6;
+ time.tv_sec -= 1;
+ }
+ if (time.tv_sec < 0) return;
+#endif
+ }
+ }
+
+ date = timeofday() + (double)time.tv_sec + (double)time.tv_usec*1e-6;
+ curr_thread->status = THREAD_STOPPED;
+ curr_thread->delay = date;
+ curr_thread->wait_for = WAIT_TIME;
+ rb_thread_schedule();
+}
+
+void rb_thread_sleep_forever _((void));
+
+int
+rb_thread_alone()
+{
+ return curr_thread == curr_thread->next;
+}
+
+int
+rb_thread_select(max, read, write, except, timeout)
+ int max;
+ fd_set *read, *write, *except;
+ struct timeval *timeout;
+{
+#ifndef linux
+ double limit;
+#endif
+ int n;
+
+ if (!read && !write && !except) {
+ if (!timeout) {
+ rb_thread_sleep_forever();
+ return 0;
+ }
+ rb_thread_wait_for(*timeout);
+ return 0;
+ }
+
+#ifndef linux
+ if (timeout) {
+ limit = timeofday()+
+ (double)timeout->tv_sec+(double)timeout->tv_usec*1e-6;
+ }
+#endif
+
+ if (rb_thread_critical ||
+ curr_thread == curr_thread->next ||
+ curr_thread->status == THREAD_TO_KILL) {
+#ifndef linux
+ struct timeval tv, *tvp = timeout;
+
+ if (timeout) {
+ tv = *timeout;
+ tvp = &tv;
+ }
+#else
+ struct timeval *const tvp = timeout;
+#endif
+ for (;;) {
+ TRAP_BEG;
+ n = select(max, read, write, except, tvp);
+ TRAP_END;
+ if (n < 0) {
+ switch (errno) {
+ case EINTR:
+#ifdef ERESTART
+ case ERESTART:
+#endif
+#ifndef linux
+ if (timeout) {
+ double d = limit - timeofday();
+
+ tv.tv_sec = (unsigned int)d;
+ tv.tv_usec = (long)((d-(double)tv.tv_sec)*1e6);
+ if (tv.tv_sec < 0) tv.tv_sec = 0;
+ if (tv.tv_usec < 0) tv.tv_usec = 0;
+ }
+#endif
+ continue;
+ default:
+ break;
+ }
+ }
+ return n;
+ }
+ }
+
+ curr_thread->status = THREAD_STOPPED;
+ if (read) curr_thread->readfds = *read;
+ else FD_ZERO(&curr_thread->readfds);
+ if (write) curr_thread->writefds = *write;
+ else FD_ZERO(&curr_thread->writefds);
+ if (except) curr_thread->exceptfds = *except;
+ else FD_ZERO(&curr_thread->exceptfds);
+ curr_thread->fd = max;
+ curr_thread->wait_for = WAIT_SELECT;
+ if (timeout) {
+ curr_thread->delay = timeofday() +
+ (double)timeout->tv_sec + (double)timeout->tv_usec*1e-6;
+ curr_thread->wait_for |= WAIT_TIME;
+ }
+ rb_thread_schedule();
+ if (read) *read = curr_thread->readfds;
+ if (write) *write = curr_thread->writefds;
+ if (except) *except = curr_thread->exceptfds;
+ return curr_thread->select_value;
+}
+
+static int
+rb_thread_join(th, limit)
+ rb_thread_t th;
+ double limit;
+{
+ enum rb_thread_status last_status = THREAD_RUNNABLE;
+
+ if (rb_thread_critical) rb_thread_deadlock();
+ if (!rb_thread_dead(th)) {
+ if (th == curr_thread)
+ rb_raise(rb_eThreadError, "thread 0x%lx tried to join itself",
+ th->thread);
+ if ((th->wait_for & WAIT_JOIN) && th->join == curr_thread)
+ rb_raise(rb_eThreadError, "Thread#join: deadlock 0x%lx - mutual join(0x%lx)",
+ curr_thread->thread, th->thread);
+ if (curr_thread->status == THREAD_TO_KILL)
+ last_status = THREAD_TO_KILL;
+ if (limit == 0) return Qfalse;
+ curr_thread->status = THREAD_STOPPED;
+ curr_thread->join = th;
+ curr_thread->wait_for = WAIT_JOIN;
+ curr_thread->delay = timeofday() + limit;
+ if (limit < DELAY_INFTY) curr_thread->wait_for |= WAIT_TIME;
+ rb_thread_schedule();
+ curr_thread->status = last_status;
+ if (!rb_thread_dead(th)) return Qfalse;
+ }
+
+ if (!NIL_P(th->errinfo) && (th->flags & RAISED_EXCEPTION)) {
+ VALUE oldbt = get_backtrace(th->errinfo);
+ VALUE errat = make_backtrace();
+ VALUE errinfo = rb_obj_dup(th->errinfo);
+
+ if (TYPE(oldbt) == T_ARRAY && RARRAY(oldbt)->len > 0) {
+ rb_ary_unshift(errat, rb_ary_entry(oldbt, 0));
+ }
+ set_backtrace(errinfo, errat);
+ rb_exc_raise(errinfo);
+ }
+
+ return Qtrue;
+}
+
+
+/*
+ * call-seq:
+ * thr.join => thr
+ * thr.join(limit) => thr
+ *
+ * The calling thread will suspend execution and run <i>thr</i>. Does not
+ * return until <i>thr</i> exits or until <i>limit</i> seconds have passed. If
+ * the time limit expires, <code>nil</code> will be returned, otherwise
+ * <i>thr</i> is returned.
+ *
+ * Any threads not joined will be killed when the main program exits. If
+ * <i>thr</i> had previously raised an exception and the
+ * <code>abort_on_exception</code> and <code>$DEBUG</code> flags are not set
+ * (so the exception has not yet been processed) it will be processed at this
+ * time.
+ *
+ * a = Thread.new { print "a"; sleep(10); print "b"; print "c" }
+ * x = Thread.new { print "x"; Thread.pass; print "y"; print "z" }
+ * x.join # Let x thread finish, a will be killed on exit.
+ *
+ * <em>produces:</em>
+ *
+ * axyz
+ *
+ * The following example illustrates the <i>limit</i> parameter.
+ *
+ * y = Thread.new { 4.times { sleep 0.1; puts 'tick... ' }}
+ * puts "Waiting" until y.join(0.15)
+ *
+ * <em>produces:</em>
+ *
+ * tick...
+ * Waiting
+ * tick...
+ * Waitingtick...
+ *
+ *
+ * tick...
+ */
+
+static VALUE
+rb_thread_join_m(argc, argv, thread)
+ int argc;
+ VALUE *argv;
+ VALUE thread;
+{
+ VALUE limit;
+ double delay = DELAY_INFTY;
+ rb_thread_t th = rb_thread_check(thread);
+
+ rb_scan_args(argc, argv, "01", &limit);
+ if (!NIL_P(limit)) delay = rb_num2dbl(limit);
+ if (!rb_thread_join(th, delay))
+ return Qnil;
+ return thread;
+}
+
+
+/*
+ * call-seq:
+ * Thread.current => thread
+ *
+ * Returns the currently executing thread.
+ *
+ * Thread.current #=> #<Thread:0x401bdf4c run>
+ */
+
+VALUE
+rb_thread_current()
+{
+ return curr_thread->thread;
+}
+
+
+/*
+ * call-seq:
+ * Thread.main => thread
+ *
+ * Returns the main thread for the process.
+ *
+ * Thread.main #=> #<Thread:0x401bdf4c run>
+ */
+
+VALUE
+rb_thread_main()
+{
+ return main_thread->thread;
+}
+
+
+/*
+ * call-seq:
+ * Thread.list => array
+ *
+ * Returns an array of <code>Thread</code> objects for all threads that are
+ * either runnable or stopped.
+ *
+ * Thread.new { sleep(200) }
+ * Thread.new { 1000000.times {|i| i*i } }
+ * Thread.new { Thread.stop }
+ * Thread.list.each {|t| p t}
+ *
+ * <em>produces:</em>
+ *
+ * #<Thread:0x401b3e84 sleep>
+ * #<Thread:0x401b3f38 run>
+ * #<Thread:0x401b3fb0 sleep>
+ * #<Thread:0x401bdf4c run>
+ */
+
+VALUE
+rb_thread_list()
+{
+ rb_thread_t th;
+ VALUE ary = rb_ary_new();
+
+ FOREACH_THREAD(th) {
+ switch (th->status) {
+ case THREAD_RUNNABLE:
+ case THREAD_STOPPED:
+ case THREAD_TO_KILL:
+ rb_ary_push(ary, th->thread);
+ default:
+ break;
+ }
+ }
+ END_FOREACH(th);
+
+ return ary;
+}
+
+
+/*
+ * call-seq:
+ * thr.wakeup => thr
+ *
+ * Marks <i>thr</i> as eligible for scheduling (it may still remain blocked on
+ * I/O, however). Does not invoke the scheduler (see <code>Thread#run</code>).
+ *
+ * c = Thread.new { Thread.stop; puts "hey!" }
+ * c.wakeup
+ *
+ * <em>produces:</em>
+ *
+ * hey!
+ */
+
+VALUE
+rb_thread_wakeup(thread)
+ VALUE thread;
+{
+ if (!RTEST(rb_thread_wakeup_alive(thread)))
+ rb_raise(rb_eThreadError, "killed thread");
+ return thread;
+}
+
+VALUE
+rb_thread_wakeup_alive(thread)
+ VALUE thread;
+{
+ rb_thread_t th = rb_thread_check(thread);
+
+ if (th->status == THREAD_KILLED)
+ return Qnil;
+ rb_thread_ready(th);
+
+ return thread;
+}
+
+
+/*
+ * call-seq:
+ * thr.run => thr
+ *
+ * Wakes up <i>thr</i>, making it eligible for scheduling. If not in a critical
+ * section, then invokes the scheduler.
+ *
+ * a = Thread.new { puts "a"; Thread.stop; puts "c" }
+ * Thread.pass
+ * puts "Got here"
+ * a.run
+ * a.join
+ *
+ * <em>produces:</em>
+ *
+ * a
+ * Got here
+ * c
+ */
+
+VALUE
+rb_thread_run(thread)
+ VALUE thread;
+{
+ rb_thread_wakeup(thread);
+ if (!rb_thread_critical) rb_thread_schedule();
+
+ return thread;
+}
+
+
+static void
+rb_kill_thread(th, flags)
+ rb_thread_t th;
+ int flags;
+{
+ if (th != curr_thread && th->safe < 4) {
+ rb_secure(4);
+ }
+ if (th->status == THREAD_TO_KILL || th->status == THREAD_KILLED)
+ return;
+ if (th == th->next || th == main_thread) rb_exit(EXIT_SUCCESS);
+
+ rb_thread_ready(th);
+ th->flags |= flags;
+ th->status = THREAD_TO_KILL;
+ if (!rb_thread_critical) rb_thread_schedule();
+}
+
+
+/*
+ * call-seq:
+ * thr.exit => thr
+ * thr.kill => thr
+ * thr.terminate => thr
+ *
+ * Terminates <i>thr</i> and schedules another thread to be run, returning
+ * the terminated <code>Thread</code>. If this is the main thread, or the
+ * last thread, exits the process.
+ */
+
+VALUE
+rb_thread_kill(thread)
+ VALUE thread;
+{
+ rb_thread_t th = rb_thread_check(thread);
+
+ rb_kill_thread(th, 0);
+ return thread;
+}
+
+
+/*
+ * call-seq:
+ * thr.exit! => thr
+ * thr.kill! => thr
+ * thr.terminate! => thr
+ *
+ * Terminates <i>thr</i> without calling ensure clauses and schedules
+ * another thread to be run, returning the terminated <code>Thread</code>.
+ * If this is the main thread, or the last thread, exits the process.
+ *
+ * See <code>Thread#exit</code> for the safer version.
+ */
+
+static VALUE
+rb_thread_kill_bang(thread)
+ VALUE thread;
+{
+ rb_thread_t th = rb_thread_check(thread);
+ rb_kill_thread(th, THREAD_NO_ENSURE);
+ return thread;
+}
+
+/*
+ * call-seq:
+ * Thread.kill(thread) => thread
+ *
+ * Causes the given <em>thread</em> to exit (see <code>Thread::exit</code>).
+ *
+ * count = 0
+ * a = Thread.new { loop { count += 1 } }
+ * sleep(0.1) #=> 0
+ * Thread.kill(a) #=> #<Thread:0x401b3d30 dead>
+ * count #=> 93947
+ * a.alive? #=> false
+ */
+
+static VALUE
+rb_thread_s_kill(obj, th)
+ VALUE obj, th;
+{
+ return rb_thread_kill(th);
+}
+
+
+/*
+ * call-seq:
+ * Thread.exit => thread
+ *
+ * Terminates the currently running thread and schedules another thread to be
+ * run. If this thread is already marked to be killed, <code>exit</code>
+ * returns the <code>Thread</code>. If this is the main thread, or the last
+ * thread, exit the process.
+ */
+
+static VALUE
+rb_thread_exit()
+{
+ return rb_thread_kill(curr_thread->thread);
+}
+
+
+/*
+ * call-seq:
+ * Thread.pass => nil
+ *
+ * Invokes the thread scheduler to pass execution to another thread.
+ *
+ * a = Thread.new { print "a"; Thread.pass;
+ * print "b"; Thread.pass;
+ * print "c" }
+ * b = Thread.new { print "x"; Thread.pass;
+ * print "y"; Thread.pass;
+ * print "z" }
+ * a.join
+ * b.join
+ *
+ * <em>produces:</em>
+ *
+ * axbycz
+ */
+
+static VALUE
+rb_thread_pass()
+{
+ rb_thread_schedule();
+ return Qnil;
+}
+
+
+/*
+ * call-seq:
+ * Thread.stop => nil
+ *
+ * Stops execution of the current thread, putting it into a ``sleep'' state,
+ * and schedules execution of another thread. Resets the ``critical'' condition
+ * to <code>false</code>.
+ *
+ * a = Thread.new { print "a"; Thread.stop; print "c" }
+ * Thread.pass
+ * print "b"
+ * a.run
+ * a.join
+ *
+ * <em>produces:</em>
+ *
+ * abc
+ */
+
+VALUE
+rb_thread_stop()
+{
+ enum rb_thread_status last_status = THREAD_RUNNABLE;
+
+ rb_thread_critical = 0;
+ if (curr_thread == curr_thread->next) {
+ rb_raise(rb_eThreadError, "stopping only thread\n\tnote: use sleep to stop forever");
+ }
+ if (curr_thread->status == THREAD_TO_KILL)
+ last_status = THREAD_TO_KILL;
+ curr_thread->status = THREAD_STOPPED;
+ rb_thread_schedule();
+ curr_thread->status = last_status;
+
+ return Qnil;
+}
+
+struct timeval rb_time_timeval();
+
+void
+rb_thread_polling()
+{
+ if (curr_thread != curr_thread->next) {
+ curr_thread->status = THREAD_STOPPED;
+ curr_thread->delay = timeofday() + (double)0.06;
+ curr_thread->wait_for = WAIT_TIME;
+ rb_thread_schedule();
+ }
+}
+
+void
+rb_thread_sleep(sec)
+ int sec;
+{
+ if (curr_thread == curr_thread->next) {
+ TRAP_BEG;
+ sleep(sec);
+ TRAP_END;
+ return;
+ }
+ rb_thread_wait_for(rb_time_timeval(INT2FIX(sec)));
+}
+
+void
+rb_thread_sleep_forever()
+{
+ int thr_critical = rb_thread_critical;
+ if (curr_thread == curr_thread->next ||
+ curr_thread->status == THREAD_TO_KILL) {
+ rb_thread_critical = Qtrue;
+ TRAP_BEG;
+ pause();
+ rb_thread_critical = thr_critical;
+ TRAP_END;
+ return;
+ }
+
+ curr_thread->delay = DELAY_INFTY;
+ curr_thread->wait_for = WAIT_TIME;
+ curr_thread->status = THREAD_STOPPED;
+ rb_thread_schedule();
+}
+
+
+/*
+ * call-seq:
+ * thr.priority => integer
+ *
+ * Returns the priority of <i>thr</i>. Default is inherited from the
+ * current thread which creating the new thread, or zero for the
+ * initial main thread; higher-priority threads will run before
+ * lower-priority threads.
+ *
+ * Thread.current.priority #=> 0
+ */
+
+static VALUE
+rb_thread_priority(thread)
+ VALUE thread;
+{
+ return INT2NUM(rb_thread_check(thread)->priority);
+}
+
+
+/*
+ * call-seq:
+ * thr.priority= integer => thr
+ *
+ * Sets the priority of <i>thr</i> to <i>integer</i>. Higher-priority threads
+ * will run before lower-priority threads.
+ *
+ * count1 = count2 = 0
+ * a = Thread.new do
+ * loop { count1 += 1 }
+ * end
+ * a.priority = -1
+ *
+ * b = Thread.new do
+ * loop { count2 += 1 }
+ * end
+ * b.priority = -2
+ * sleep 1 #=> 1
+ * Thread.critical = 1
+ * count1 #=> 622504
+ * count2 #=> 5832
+ */
+
+static VALUE
+rb_thread_priority_set(thread, prio)
+ VALUE thread, prio;
+{
+ rb_thread_t th;
+
+ rb_secure(4);
+ th = rb_thread_check(thread);
+
+ th->priority = NUM2INT(prio);
+ rb_thread_schedule();
+ return prio;
+}
+
+
+/*
+ * call-seq:
+ * thr.safe_level => integer
+ *
+ * Returns the safe level in effect for <i>thr</i>. Setting thread-local safe
+ * levels can help when implementing sandboxes which run insecure code.
+ *
+ * thr = Thread.new { $SAFE = 3; sleep }
+ * Thread.current.safe_level #=> 0
+ * thr.safe_level #=> 3
+ */
+
+static VALUE
+rb_thread_safe_level(thread)
+ VALUE thread;
+{
+ rb_thread_t th;
+
+ th = rb_thread_check(thread);
+ if (th == curr_thread) {
+ return INT2NUM(ruby_safe_level);
+ }
+ return INT2NUM(th->safe);
+}
+
+static int ruby_thread_abort;
+static VALUE thgroup_default;
+
+
+/*
+ * call-seq:
+ * Thread.abort_on_exception => true or false
+ *
+ * Returns the status of the global ``abort on exception'' condition. The
+ * default is <code>false</code>. When set to <code>true</code>, or if the
+ * global <code>$DEBUG</code> flag is <code>true</code> (perhaps because the
+ * command line option <code>-d</code> was specified) all threads will abort
+ * (the process will <code>exit(0)</code>) if an exception is raised in any
+ * thread. See also <code>Thread::abort_on_exception=</code>.
+ */
+
+static VALUE
+rb_thread_s_abort_exc()
+{
+ return ruby_thread_abort?Qtrue:Qfalse;
+}
+
+
+/*
+ * call-seq:
+ * Thread.abort_on_exception= boolean => true or false
+ *
+ * When set to <code>true</code>, all threads will abort if an exception is
+ * raised. Returns the new state.
+ *
+ * Thread.abort_on_exception = true
+ * t1 = Thread.new do
+ * puts "In new thread"
+ * raise "Exception from thread"
+ * end
+ * sleep(1)
+ * puts "not reached"
+ *
+ * <em>produces:</em>
+ *
+ * In new thread
+ * prog.rb:4: Exception from thread (RuntimeError)
+ * from prog.rb:2:in `initialize'
+ * from prog.rb:2:in `new'
+ * from prog.rb:2
+ */
+
+static VALUE
+rb_thread_s_abort_exc_set(self, val)
+ VALUE self, val;
+{
+ rb_secure(4);
+ ruby_thread_abort = RTEST(val);
+ return val;
+}
+
+
+/*
+ * call-seq:
+ * thr.abort_on_exception => true or false
+ *
+ * Returns the status of the thread-local ``abort on exception'' condition for
+ * <i>thr</i>. The default is <code>false</code>. See also
+ * <code>Thread::abort_on_exception=</code>.
+ */
+
+static VALUE
+rb_thread_abort_exc(thread)
+ VALUE thread;
+{
+ return rb_thread_check(thread)->abort?Qtrue:Qfalse;
+}
+
+
+/*
+ * call-seq:
+ * thr.abort_on_exception= boolean => true or false
+ *
+ * When set to <code>true</code>, causes all threads (including the main
+ * program) to abort if an exception is raised in <i>thr</i>. The process will
+ * effectively <code>exit(0)</code>.
+ */
+
+static VALUE
+rb_thread_abort_exc_set(thread, val)
+ VALUE thread, val;
+{
+ rb_secure(4);
+ rb_thread_check(thread)->abort = RTEST(val);
+ return val;
+}
+
+
+/*
+ * call-seq:
+ * thr.group => thgrp or nil
+ *
+ * Returns the <code>ThreadGroup</code> which contains <i>thr</i>, or nil if
+ * the thread is not a member of any group.
+ *
+ * Thread.main.group #=> #<ThreadGroup:0x4029d914>
+ */
+
+VALUE
+rb_thread_group(thread)
+ VALUE thread;
+{
+ VALUE group = rb_thread_check(thread)->thgroup;
+ if (!group) {
+ group = Qnil;
+ }
+ return group;
+}
+
+#ifdef __ia64
+# define IA64_INIT(x) x
+#else
+# define IA64_INIT(x)
+#endif
+
+#define THREAD_ALLOC(th) do {\
+ th = ALLOC(struct rb_thread);\
+\
+ th->next = 0;\
+ th->prev = 0;\
+\
+ th->status = THREAD_RUNNABLE;\
+ th->result = 0;\
+ th->flags = 0;\
+\
+ th->stk_ptr = 0;\
+ th->stk_len = 0;\
+ th->stk_max = 0;\
+ th->wait_for = 0;\
+ IA64_INIT(th->bstr_ptr = 0);\
+ IA64_INIT(th->bstr_len = 0);\
+ IA64_INIT(th->bstr_max = 0);\
+ FD_ZERO(&th->readfds);\
+ FD_ZERO(&th->writefds);\
+ FD_ZERO(&th->exceptfds);\
+ th->delay = 0.0;\
+ th->join = 0;\
+\
+ th->frame = 0;\
+ th->scope = 0;\
+ th->klass = 0;\
+ th->wrapper = 0;\
+ th->cref = ruby_cref;\
+ th->dyna_vars = ruby_dyna_vars;\
+ th->block = 0;\
+ th->iter = 0;\
+ th->tag = 0;\
+ th->tracing = 0;\
+ th->errinfo = Qnil;\
+ th->last_status = 0;\
+ th->last_line = 0;\
+ th->last_match = Qnil;\
+ th->abort = 0;\
+ th->priority = 0;\
+ th->thgroup = thgroup_default;\
+ th->locals = 0;\
+ th->thread = 0;\
+ if (curr_thread == 0) {\
+ th->sandbox = Qnil;\
+ } else {\
+ th->sandbox = curr_thread->sandbox;\
+ }\
+} while (0)
+
+static rb_thread_t
+rb_thread_alloc(klass)
+ VALUE klass;
+{
+ rb_thread_t th;
+ struct RVarmap *vars;
+
+ THREAD_ALLOC(th);
+ th->thread = Data_Wrap_Struct(klass, thread_mark, thread_free, th);
+
+ for (vars = th->dyna_vars; vars; vars = vars->next) {
+ if (FL_TEST(vars, DVAR_DONT_RECYCLE)) break;
+ FL_SET(vars, DVAR_DONT_RECYCLE);
+ }
+ return th;
+}
+
+static int thread_init;
+
+#if defined(_THREAD_SAFE)
+static void
+catch_timer(sig)
+ int sig;
+{
+#if !defined(POSIX_SIGNAL) && !defined(BSD_SIGNAL)
+ signal(sig, catch_timer);
+#endif
+ /* cause EINTR */
+}
+
+static pthread_t time_thread;
+
+static void*
+thread_timer(dummy)
+ void *dummy;
+{
+ sigset_t all_signals;
+
+ sigfillset(&all_signals);
+ pthread_sigmask(SIG_BLOCK, &all_signals, 0);
+
+ for (;;) {
+#ifdef HAVE_NANOSLEEP
+ struct timespec req, rem;
+
+ req.tv_sec = 0;
+ req.tv_nsec = 10000000;
+ nanosleep(&req, &rem);
+#else
+ struct timeval tv;
+ tv.tv_sec = 0;
+ tv.tv_usec = 10000;
+ select(0, NULL, NULL, NULL, &tv);
+#endif
+ if (!rb_thread_critical) {
+ rb_thread_pending = 1;
+ if (rb_trap_immediate) {
+ pthread_kill(ruby_thid, SIGVTALRM);
+ }
+ }
+ }
+}
+
+void
+rb_thread_start_timer()
+{
+}
+
+void
+rb_thread_stop_timer()
+{
+}
+#elif defined(HAVE_SETITIMER)
+static void
+catch_timer(sig)
+ int sig;
+{
+#if !defined(POSIX_SIGNAL) && !defined(BSD_SIGNAL)
+ signal(sig, catch_timer);
+#endif
+ if (!rb_thread_critical) {
+ rb_thread_pending = 1;
+ }
+ /* cause EINTR */
+}
+
+void
+rb_thread_start_timer()
+{
+ struct itimerval tval;
+
+ if (!thread_init) return;
+ tval.it_interval.tv_sec = 0;
+ tval.it_interval.tv_usec = 10000;
+ tval.it_value = tval.it_interval;
+ setitimer(ITIMER_VIRTUAL, &tval, NULL);
+}
+
+void
+rb_thread_stop_timer()
+{
+ struct itimerval tval;
+
+ if (!thread_init) return;
+ tval.it_interval.tv_sec = 0;
+ tval.it_interval.tv_usec = 0;
+ tval.it_value = tval.it_interval;
+ setitimer(ITIMER_VIRTUAL, &tval, NULL);
+}
+#else /* !(_THREAD_SAFE || HAVE_SETITIMER) */
+int rb_thread_tick = THREAD_TICK;
+#endif
+
+static VALUE
+rb_thread_start_0(fn, arg, th)
+ VALUE (*fn)();
+ void *arg;
+ rb_thread_t th;
+{
+ volatile rb_thread_t th_save = th;
+ volatile VALUE thread = th->thread;
+ struct BLOCK *volatile saved_block = 0;
+ enum rb_thread_status status;
+ int state;
+
+ if (OBJ_FROZEN(curr_thread->thgroup)) {
+ rb_raise(rb_eThreadError,
+ "can't start a new thread (frozen ThreadGroup)");
+ }
+
+ if (!thread_init) {
+ thread_init = 1;
+#if defined(HAVE_SETITIMER) || defined(_THREAD_SAFE)
+#if defined(POSIX_SIGNAL)
+ posix_signal(SIGVTALRM, catch_timer);
+#else
+ signal(SIGVTALRM, catch_timer);
+#endif
+
+#ifdef _THREAD_SAFE
+ pthread_create(&time_thread, 0, thread_timer, 0);
+#else
+ rb_thread_start_timer();
+#endif
+#endif
+ }
+
+ if (THREAD_SAVE_CONTEXT(curr_thread)) {
+ return thread;
+ }
+
+ if (ruby_block) { /* should nail down higher blocks */
+ struct BLOCK dummy;
+
+ dummy.prev = ruby_block;
+ blk_copy_prev(&dummy);
+ saved_block = ruby_block = dummy.prev;
+ }
+ scope_dup(ruby_scope);
+
+ if (!th->next) {
+ /* merge in thread list */
+ th->prev = curr_thread;
+ curr_thread->next->prev = th;
+ th->next = curr_thread->next;
+ curr_thread->next = th;
+ th->priority = curr_thread->priority;
+ th->thgroup = curr_thread->thgroup;
+ }
+
+ PUSH_TAG(PROT_THREAD);
+ if ((state = EXEC_TAG()) == 0) {
+ if (THREAD_SAVE_CONTEXT(th) == 0) {
+ curr_thread = th;
+ th->result = (*fn)(arg, th);
+ }
+ th = th_save;
+ }
+ else if (TAG_DST()) {
+ th = th_save;
+ th->result = prot_tag->retval;
+ }
+ POP_TAG();
+ status = th->status;
+
+ if (th == main_thread) ruby_stop(state);
+ rb_thread_remove(th);
+
+ if (saved_block) {
+ blk_free(saved_block);
+ }
+
+ if (state && status != THREAD_TO_KILL && !NIL_P(ruby_errinfo)) {
+ th->flags |= RAISED_EXCEPTION;
+ if (state == TAG_FATAL) {
+ /* fatal error within this thread, need to stop whole script */
+ main_thread->errinfo = ruby_errinfo;
+ rb_thread_cleanup();
+ }
+ else if (rb_obj_is_kind_of(ruby_errinfo, rb_eSystemExit)) {
+ if (th->safe >= 4) {
+ char buf[32];
+
+ sprintf(buf, "Insecure exit at level %d", th->safe);
+ th->errinfo = rb_exc_new2(rb_eSecurityError, buf);
+ }
+ else {
+ /* delegate exception to main_thread */
+ rb_thread_main_jump(ruby_errinfo, RESTORE_RAISE);
+ }
+ }
+ else if (th->safe < 4 && (ruby_thread_abort || th->abort || RTEST(ruby_debug))) {
+ /* exit on main_thread */
+ error_print();
+ rb_thread_main_jump(ruby_errinfo, RESTORE_EXIT);
+ }
+ else {
+ th->errinfo = ruby_errinfo;
+ }
+ }
+ rb_thread_schedule();
+ ruby_stop(0); /* last thread termination */
+ return 0; /* not reached */
+}
+
+VALUE
+rb_thread_create(fn, arg)
+ VALUE (*fn)();
+ void *arg;
+{
+ Init_stack((void *)&arg);
+ return rb_thread_start_0(fn, arg, rb_thread_alloc(rb_cThread));
+}
+
+static VALUE
+rb_thread_yield(arg, th)
+ VALUE arg;
+ rb_thread_t th;
+{
+ const ID *tbl;
+
+ scope_dup(ruby_block->scope);
+
+ tbl = ruby_scope->local_tbl;
+ if (tbl) {
+ int n = *tbl++;
+ for (tbl += 2, n -= 2; n > 0; --n) { /* skip first 2 ($_ and $~) */
+ ID id = *tbl++;
+ if (id != 0 && !rb_is_local_id(id)) /* push flip states */
+ rb_dvar_push(id, Qfalse);
+ }
+ }
+ rb_dvar_push('_', Qnil);
+ rb_dvar_push('~', Qnil);
+ ruby_block->dyna_vars = ruby_dyna_vars;
+
+ return rb_yield_0(arg, 0, 0, YIELD_LAMBDA_CALL, Qtrue);
+}
+
+/*
+ * call-seq:
+ * Thread.new([arg]*) {|args| block } => thread
+ *
+ * Creates and runs a new thread to execute the instructions given in
+ * <i>block</i>. Any arguments passed to <code>Thread::new</code> are passed
+ * into the block.
+ *
+ * x = Thread.new { sleep 0.1; print "x"; print "y"; print "z" }
+ * a = Thread.new { print "a"; print "b"; sleep 0.2; print "c" }
+ * x.join # Let the threads finish before
+ * a.join # main thread exits...
+ *
+ * <em>produces:</em>
+ *
+ * abxyzc
+ */
+
+static VALUE
+rb_thread_s_new(argc, argv, klass)
+ int argc;
+ VALUE *argv;
+ VALUE klass;
+{
+ rb_thread_t th = rb_thread_alloc(klass);
+ volatile VALUE *pos;
+
+ pos = th->stk_pos;
+ rb_obj_call_init(th->thread, argc, argv);
+ if (th->stk_pos == 0) {
+ rb_raise(rb_eThreadError, "uninitialized thread - check `%s#initialize'",
+ rb_class2name(klass));
+ }
+
+ return th->thread;
+}
+
+
+/*
+ * call-seq:
+ * Thread.new([arg]*) {|args| block } => thread
+ *
+ * Creates and runs a new thread to execute the instructions given in
+ * <i>block</i>. Any arguments passed to <code>Thread::new</code> are passed
+ * into the block.
+ *
+ * x = Thread.new { sleep 0.1; print "x"; print "y"; print "z" }
+ * a = Thread.new { print "a"; print "b"; sleep 0.2; print "c" }
+ * x.join # Let the threads finish before
+ * a.join # main thread exits...
+ *
+ * <em>produces:</em>
+ *
+ * abxyzc
+ */
+
+static VALUE
+rb_thread_initialize(thread, args)
+ VALUE thread, args;
+{
+ rb_thread_t th;
+
+ if (!rb_block_given_p()) {
+ rb_raise(rb_eThreadError, "must be called with a block");
+ }
+ th = rb_thread_check(thread);
+ if (th->stk_max) {
+ NODE *node = th->node;
+ if (!node) {
+ rb_raise(rb_eThreadError, "already initialized thread");
+ }
+ rb_raise(rb_eThreadError, "already initialized thread - %s:%d",
+ node->nd_file, nd_line(node));
+ }
+ return rb_thread_start_0(rb_thread_yield, args, th);
+}
+
+
+/*
+ * call-seq:
+ * Thread.start([args]*) {|args| block } => thread
+ * Thread.fork([args]*) {|args| block } => thread
+ *
+ * Basically the same as <code>Thread::new</code>. However, if class
+ * <code>Thread</code> is subclassed, then calling <code>start</code> in that
+ * subclass will not invoke the subclass's <code>initialize</code> method.
+ */
+
+static VALUE
+rb_thread_start(klass, args)
+ VALUE klass, args;
+{
+ if (!rb_block_given_p()) {
+ rb_raise(rb_eThreadError, "must be called with a block");
+ }
+ return rb_thread_start_0(rb_thread_yield, args, rb_thread_alloc(klass));
+}
+
+
+/*
+ * call-seq:
+ * thr.value => obj
+ *
+ * Waits for <i>thr</i> to complete (via <code>Thread#join</code>) and returns
+ * its value.
+ *
+ * a = Thread.new { 2 + 2 }
+ * a.value #=> 4
+ */
+
+static VALUE
+rb_thread_value(thread)
+ VALUE thread;
+{
+ rb_thread_t th = rb_thread_check(thread);
+
+ while (!rb_thread_join(th, DELAY_INFTY));
+
+ return th->result;
+}
+
+
+/*
+ * call-seq:
+ * thr.status => string, false or nil
+ *
+ * Returns the status of <i>thr</i>: ``<code>sleep</code>'' if <i>thr</i> is
+ * sleeping or waiting on I/O, ``<code>run</code>'' if <i>thr</i> is executing,
+ * ``<code>aborting</code>'' if <i>thr</i> is aborting, <code>false</code> if
+ * <i>thr</i> terminated normally, and <code>nil</code> if <i>thr</i>
+ * terminated with an exception.
+ *
+ * a = Thread.new { raise("die now") }
+ * b = Thread.new { Thread.stop }
+ * c = Thread.new { Thread.exit }
+ * d = Thread.new { sleep }
+ * Thread.critical = true
+ * d.kill #=> #<Thread:0x401b3678 aborting>
+ * a.status #=> nil
+ * b.status #=> "sleep"
+ * c.status #=> false
+ * d.status #=> "aborting"
+ * Thread.current.status #=> "run"
+ */
+
+static VALUE
+rb_thread_status(thread)
+ VALUE thread;
+{
+ rb_thread_t th = rb_thread_check(thread);
+
+ if (rb_thread_dead(th)) {
+ if (!NIL_P(th->errinfo) && (th->flags & RAISED_EXCEPTION))
+ return Qnil;
+ return Qfalse;
+ }
+
+ return rb_str_new2(thread_status_name(th->status));
+}
+
+
+/*
+ * call-seq:
+ * thr.alive? => true or false
+ *
+ * Returns <code>true</code> if <i>thr</i> is running or sleeping.
+ *
+ * thr = Thread.new { }
+ * thr.join #=> #<Thread:0x401b3fb0 dead>
+ * Thread.current.alive? #=> true
+ * thr.alive? #=> false
+ */
+
+VALUE
+rb_thread_alive_p(thread)
+ VALUE thread;
+{
+ rb_thread_t th = rb_thread_check(thread);
+
+ if (rb_thread_dead(th)) return Qfalse;
+ return Qtrue;
+}
+
+
+/*
+ * call-seq:
+ * thr.stop? => true or false
+ *
+ * Returns <code>true</code> if <i>thr</i> is dead or sleeping.
+ *
+ * a = Thread.new { Thread.stop }
+ * b = Thread.current
+ * a.stop? #=> true
+ * b.stop? #=> false
+ */
+
+static VALUE
+rb_thread_stop_p(thread)
+ VALUE thread;
+{
+ rb_thread_t th = rb_thread_check(thread);
+
+ if (rb_thread_dead(th)) return Qtrue;
+ if (th->status == THREAD_STOPPED) return Qtrue;
+ return Qfalse;
+}
+
+static void
+rb_thread_wait_other_threads()
+{
+ rb_thread_t th;
+ int found;
+
+ /* wait other threads to terminate */
+ while (curr_thread != curr_thread->next) {
+ found = 0;
+ FOREACH_THREAD(th) {
+ if (th != curr_thread && th->status != THREAD_STOPPED) {
+ found = 1;
+ break;
+ }
+ }
+ END_FOREACH(th);
+ if (!found) return;
+ rb_thread_schedule();
+ }
+}
+
+static void
+rb_thread_cleanup()
+{
+ rb_thread_t curr, th;
+
+ curr = curr_thread;
+ while (curr->status == THREAD_KILLED) {
+ curr = curr->prev;
+ }
+
+ FOREACH_THREAD_FROM(curr, th) {
+ if (th->status != THREAD_KILLED) {
+ rb_thread_ready(th);
+ if (th != main_thread) {
+ th->thgroup = 0;
+ th->priority = 0;
+ th->status = THREAD_TO_KILL;
+ RDATA(th->thread)->dfree = NULL;
+ }
+ }
+ }
+ END_FOREACH_FROM(curr, th);
+}
+
+int rb_thread_critical;
+
+
+/*
+ * call-seq:
+ * Thread.critical => true or false
+ *
+ * Returns the status of the global ``thread critical'' condition.
+ */
+
+static VALUE
+rb_thread_critical_get()
+{
+ return rb_thread_critical?Qtrue:Qfalse;
+}
+
+
+/*
+ * call-seq:
+ * Thread.critical= boolean => true or false
+ *
+ * Sets the status of the global ``thread critical'' condition and returns
+ * it. When set to <code>true</code>, prohibits scheduling of any existing
+ * thread. Does not block new threads from being created and run. Certain
+ * thread operations (such as stopping or killing a thread, sleeping in the
+ * current thread, and raising an exception) may cause a thread to be scheduled
+ * even when in a critical section. <code>Thread::critical</code> is not
+ * intended for daily use: it is primarily there to support folks writing
+ * threading libraries.
+ */
+
+static VALUE
+rb_thread_critical_set(obj, val)
+ VALUE obj, val;
+{
+ rb_thread_critical = RTEST(val);
+ return val;
+}
+
+void
+rb_thread_interrupt()
+{
+ rb_thread_critical = 0;
+ rb_thread_ready(main_thread);
+ if (curr_thread == main_thread) {
+ rb_interrupt();
+ }
+ if (!rb_thread_dead(curr_thread)) {
+ if (THREAD_SAVE_CONTEXT(curr_thread)) {
+ return;
+ }
+ }
+ curr_thread = main_thread;
+ rb_thread_restore_context(curr_thread, RESTORE_INTERRUPT);
+}
+
+void
+rb_thread_signal_raise(sig)
+ int sig;
+{
+ rb_thread_critical = 0;
+ if (curr_thread == main_thread) {
+ VALUE argv[1];
+
+ rb_thread_ready(curr_thread);
+ argv[0] = INT2FIX(sig);
+ rb_exc_raise(rb_class_new_instance(1, argv, rb_eSignal));
+ }
+ rb_thread_ready(main_thread);
+ if (!rb_thread_dead(curr_thread)) {
+ if (THREAD_SAVE_CONTEXT(curr_thread)) {
+ return;
+ }
+ }
+ th_sig = sig;
+ curr_thread = main_thread;
+ rb_thread_restore_context(curr_thread, RESTORE_SIGNAL);
+}
+
+void
+rb_thread_trap_eval(cmd, sig, safe)
+ VALUE cmd;
+ int sig, safe;
+{
+ rb_thread_critical = 0;
+ if (curr_thread == main_thread) {
+ rb_trap_eval(cmd, sig, safe);
+ return;
+ }
+ if (!rb_thread_dead(curr_thread)) {
+ if (THREAD_SAVE_CONTEXT(curr_thread)) {
+ return;
+ }
+ }
+ th_cmd = cmd;
+ th_sig = sig;
+ th_safe = safe;
+ curr_thread = main_thread;
+ rb_thread_restore_context(curr_thread, RESTORE_TRAP);
+}
+
+void
+rb_thread_signal_exit()
+{
+ VALUE args[2];
+
+ rb_thread_critical = 0;
+ if (curr_thread == main_thread) {
+ rb_thread_ready(curr_thread);
+ rb_exit(EXIT_SUCCESS);
+ }
+ args[0] = INT2NUM(EXIT_SUCCESS);
+ args[1] = rb_str_new2("exit");
+ rb_thread_ready(main_thread);
+ if (!rb_thread_dead(curr_thread)) {
+ if (THREAD_SAVE_CONTEXT(curr_thread)) {
+ return;
+ }
+ }
+ rb_thread_main_jump(rb_class_new_instance(2, args, rb_eSystemExit),
+ RESTORE_EXIT);
+}
+
+static VALUE
+rb_thread_raise(argc, argv, th)
+ int argc;
+ VALUE *argv;
+ rb_thread_t th;
+{
+ volatile rb_thread_t th_save = th;
+ VALUE exc;
+
+ if (!th->next) {
+ rb_raise(rb_eArgError, "unstarted thread");
+ }
+ if (rb_thread_dead(th)) return Qnil;
+ exc = rb_make_exception(argc, argv);
+ if (curr_thread == th) {
+ rb_raise_jump(exc);
+ }
+
+ if (!rb_thread_dead(curr_thread)) {
+ if (THREAD_SAVE_CONTEXT(curr_thread)) {
+ return th_save->thread;
+ }
+ }
+
+ rb_thread_ready(th);
+ curr_thread = th;
+
+ th_raise_exception = exc;
+ th_raise_node = ruby_current_node;
+ rb_thread_restore_context(curr_thread, RESTORE_RAISE);
+ return Qnil; /* not reached */
+}
+
+
+/*
+ * call-seq:
+ * thr.raise(exception)
+ *
+ * Raises an exception (see <code>Kernel::raise</code>) from <i>thr</i>. The
+ * caller does not have to be <i>thr</i>.
+ *
+ * Thread.abort_on_exception = true
+ * a = Thread.new { sleep(200) }
+ * a.raise("Gotcha")
+ *
+ * <em>produces:</em>
+ *
+ * prog.rb:3: Gotcha (RuntimeError)
+ * from prog.rb:2:in `initialize'
+ * from prog.rb:2:in `new'
+ * from prog.rb:2
+ */
+
+static VALUE
+rb_thread_raise_m(argc, argv, thread)
+ int argc;
+ VALUE *argv;
+ VALUE thread;
+{
+ rb_thread_t th = rb_thread_check(thread);
+
+ if (ruby_safe_level > th->safe) {
+ rb_secure(4);
+ }
+ rb_thread_raise(argc, argv, th);
+ return Qnil; /* not reached */
+}
+
+VALUE
+rb_thread_local_aref(thread, id)
+ VALUE thread;
+ ID id;
+{
+ rb_thread_t th;
+ VALUE val;
+
+ th = rb_thread_check(thread);
+ if (ruby_safe_level >= 4 && th != curr_thread) {
+ rb_raise(rb_eSecurityError, "Insecure: thread locals");
+ }
+ if (!th->locals) return Qnil;
+ if (st_lookup(th->locals, id, &val)) {
+ return val;
+ }
+ return Qnil;
+}
+
+
+/*
+ * call-seq:
+ * thr[sym] => obj or nil
+ *
+ * Attribute Reference---Returns the value of a thread-local variable, using
+ * either a symbol or a string name. If the specified variable does not exist,
+ * returns <code>nil</code>.
+ *
+ * a = Thread.new { Thread.current["name"] = "A"; Thread.stop }
+ * b = Thread.new { Thread.current[:name] = "B"; Thread.stop }
+ * c = Thread.new { Thread.current["name"] = "C"; Thread.stop }
+ * Thread.list.each {|x| puts "#{x.inspect}: #{x[:name]}" }
+ *
+ * <em>produces:</em>
+ *
+ * #<Thread:0x401b3b3c sleep>: C
+ * #<Thread:0x401b3bc8 sleep>: B
+ * #<Thread:0x401b3c68 sleep>: A
+ * #<Thread:0x401bdf4c run>:
+ */
+
+static VALUE
+rb_thread_aref(thread, id)
+ VALUE thread, id;
+{
+ return rb_thread_local_aref(thread, rb_to_id(id));
+}
+
+VALUE
+rb_thread_local_aset(thread, id, val)
+ VALUE thread;
+ ID id;
+ VALUE val;
+{
+ rb_thread_t th = rb_thread_check(thread);
+
+ if (ruby_safe_level >= 4 && th != curr_thread) {
+ rb_raise(rb_eSecurityError, "Insecure: can't modify thread locals");
+ }
+ if (OBJ_FROZEN(thread)) rb_error_frozen("thread locals");
+
+ if (!th->locals) {
+ th->locals = st_init_numtable();
+ }
+ if (NIL_P(val)) {
+ st_delete(th->locals, (st_data_t*)&id, 0);
+ return Qnil;
+ }
+ st_insert(th->locals, id, val);
+
+ return val;
+}
+
+
+/*
+ * call-seq:
+ * thr[sym] = obj => obj
+ *
+ * Attribute Assignment---Sets or creates the value of a thread-local variable,
+ * using either a symbol or a string. See also <code>Thread#[]</code>.
+ */
+
+static VALUE
+rb_thread_aset(thread, id, val)
+ VALUE thread, id, val;
+{
+ return rb_thread_local_aset(thread, rb_to_id(id), val);
+}
+
+
+/*
+ * call-seq:
+ * thr.key?(sym) => true or false
+ *
+ * Returns <code>true</code> if the given string (or symbol) exists as a
+ * thread-local variable.
+ *
+ * me = Thread.current
+ * me[:oliver] = "a"
+ * me.key?(:oliver) #=> true
+ * me.key?(:stanley) #=> false
+ */
+
+static VALUE
+rb_thread_key_p(thread, id)
+ VALUE thread, id;
+{
+ rb_thread_t th = rb_thread_check(thread);
+
+ if (!th->locals) return Qfalse;
+ if (st_lookup(th->locals, rb_to_id(id), 0))
+ return Qtrue;
+ return Qfalse;
+}
+
+static int
+thread_keys_i(key, value, ary)
+ ID key;
+ VALUE value, ary;
+{
+ rb_ary_push(ary, ID2SYM(key));
+ return ST_CONTINUE;
+}
+
+
+/*
+ * call-seq:
+ * thr.keys => array
+ *
+ * Returns an an array of the names of the thread-local variables (as Symbols).
+ *
+ * thr = Thread.new do
+ * Thread.current[:cat] = 'meow'
+ * Thread.current["dog"] = 'woof'
+ * end
+ * thr.join #=> #<Thread:0x401b3f10 dead>
+ * thr.keys #=> [:dog, :cat]
+ */
+
+static VALUE
+rb_thread_keys(thread)
+ VALUE thread;
+{
+ rb_thread_t th = rb_thread_check(thread);
+ VALUE ary = rb_ary_new();
+
+ if (th->locals) {
+ st_foreach(th->locals, thread_keys_i, ary);
+ }
+ return ary;
+}
+
+/*
+ * call-seq:
+ * thr.inspect => string
+ *
+ * Dump the name, id, and status of _thr_ to a string.
+ */
+
+static VALUE
+rb_thread_inspect(thread)
+ VALUE thread;
+{
+ const char *cname = rb_obj_classname(thread);
+ rb_thread_t th = rb_thread_check(thread);
+ const char *status = thread_status_name(th->status);
+ VALUE str;
+ size_t len = strlen(cname)+7+16+9+1;
+
+ str = rb_str_new(0, len); /* 7:tags 16:addr 9:status 1:nul */
+ snprintf(RSTRING(str)->ptr, len, "#<%s:0x%lx %s>", cname, thread, status);
+ RSTRING(str)->len = strlen(RSTRING(str)->ptr);
+ OBJ_INFECT(str, thread);
+
+ return str;
+}
+
+void
+rb_thread_atfork()
+{
+ rb_thread_t th;
+
+ if (rb_thread_alone()) return;
+ FOREACH_THREAD(th) {
+ if (th != curr_thread) {
+ rb_thread_die(th);
+ }
+ }
+ END_FOREACH(th);
+ main_thread = curr_thread;
+ curr_thread->next = curr_thread;
+ curr_thread->prev = curr_thread;
+}
+
+
+static void
+cc_purge(cc)
+ rb_thread_t cc;
+{
+ /* free continuation's stack if it has just died */
+ if (NIL_P(cc->thread)) return;
+ if (rb_thread_check(cc->thread)->status == THREAD_KILLED) {
+ cc->thread = Qnil;
+ rb_thread_die(cc); /* can't possibly activate this stack */
+ }
+}
+
+static void
+cc_mark(cc)
+ rb_thread_t cc;
+{
+ /* mark this continuation's stack only if its parent thread is still alive */
+ cc_purge(cc);
+ thread_mark(cc);
+}
+
+static rb_thread_t
+rb_cont_check(data)
+ VALUE data;
+{
+ if (TYPE(data) != T_DATA || RDATA(data)->dmark != (RUBY_DATA_FUNC)cc_mark) {
+ rb_raise(rb_eTypeError, "wrong argument type %s (expected Continuation)",
+ rb_obj_classname(data));
+ }
+ return (rb_thread_t)RDATA(data)->data;
+}
+
+/*
+ * Document-class: Continuation
+ *
+ * Continuation objects are generated by
+ * <code>Kernel#callcc</code>. They hold a return address and execution
+ * context, allowing a nonlocal return to the end of the
+ * <code>callcc</code> block from anywhere within a program.
+ * Continuations are somewhat analogous to a structured version of C's
+ * <code>setjmp/longjmp</code> (although they contain more state, so
+ * you might consider them closer to threads).
+ *
+ * For instance:
+ *
+ * arr = [ "Freddie", "Herbie", "Ron", "Max", "Ringo" ]
+ * callcc{|$cc|}
+ * puts(message = arr.shift)
+ * $cc.call unless message =~ /Max/
+ *
+ * <em>produces:</em>
+ *
+ * Freddie
+ * Herbie
+ * Ron
+ * Max
+ *
+ * This (somewhat contrived) example allows the inner loop to abandon
+ * processing early:
+ *
+ * callcc {|cont|
+ * for i in 0..4
+ * print "\n#{i}: "
+ * for j in i*5...(i+1)*5
+ * cont.call() if j == 17
+ * printf "%3d", j
+ * end
+ * end
+ * }
+ * print "\n"
+ *
+ * <em>produces:</em>
+ *
+ * 0: 0 1 2 3 4
+ * 1: 5 6 7 8 9
+ * 2: 10 11 12 13 14
+ * 3: 15 16
+ */
+
+VALUE rb_cCont;
+
+/*
+ * call-seq:
+ * callcc {|cont| block } => obj
+ *
+ * Generates a <code>Continuation</code> object, which it passes to the
+ * associated block. Performing a <em>cont</em><code>.call</code> will
+ * cause the <code>callcc</code> to return (as will falling through the
+ * end of the block). The value returned by the <code>callcc</code> is
+ * the value of the block, or the value passed to
+ * <em>cont</em><code>.call</code>. See class <code>Continuation</code>
+ * for more details. Also see <code>Kernel::throw</code> for
+ * an alternative mechanism for unwinding a call stack.
+ */
+
+static VALUE
+rb_callcc(self)
+ VALUE self;
+{
+ volatile VALUE cont;
+ rb_thread_t th;
+ volatile rb_thread_t th_save;
+ struct tag *tag;
+ struct RVarmap *vars;
+
+ THREAD_ALLOC(th);
+ /* must finish th initialization before any possible gc.
+ * brent@mbari.org */
+ th->thread = curr_thread->thread;
+ th->thgroup = cont_protect;
+ cont = Data_Wrap_Struct(rb_cCont, cc_mark, thread_free, th);
+
+ scope_dup(ruby_scope);
+ for (tag=prot_tag; tag; tag=tag->prev) {
+ scope_dup(tag->scope);
+ }
+
+ for (vars = ruby_dyna_vars; vars; vars = vars->next) {
+ if (FL_TEST(vars, DVAR_DONT_RECYCLE)) break;
+ FL_SET(vars, DVAR_DONT_RECYCLE);
+ }
+ th_save = th;
+ if (THREAD_SAVE_CONTEXT(th)) {
+ return th_save->result;
+ }
+ else {
+ return rb_yield(cont);
+ }
+}
+
+/*
+ * call-seq:
+ * cont.call(args, ...)
+ * cont[args, ...]
+ *
+ * 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
+ * callcc {|cont| cont.call 1, 2, 3 } #=> [1, 2, 3]
+ */
+
+static VALUE
+rb_cont_call(argc, argv, cont)
+ int argc;
+ VALUE *argv;
+ VALUE cont;
+{
+ rb_thread_t th = rb_cont_check(cont);
+
+ if (th->thread != curr_thread->thread) {
+ rb_raise(rb_eRuntimeError, "continuation called across threads");
+ }
+ if (th->thgroup != cont_protect) {
+ rb_raise(rb_eRuntimeError, "continuation called across trap");
+ }
+ switch (argc) {
+ case 0:
+ th->result = Qnil;
+ break;
+ case 1:
+ th->result = argv[0];
+ break;
+ default:
+ th->result = rb_ary_new4(argc, argv);
+ break;
+ }
+
+ rb_thread_restore_context(th, RESTORE_NORMAL);
+ return Qnil;
+}
+
+struct thgroup {
+ int enclosed;
+ VALUE group;
+};
+
+
+/*
+ * Document-class: ThreadGroup
+ *
+ * <code>ThreadGroup</code> provides a means of keeping track of a number of
+ * threads as a group. A <code>Thread</code> can belong to only one
+ * <code>ThreadGroup</code> at a time; adding a thread to a new group will
+ * remove it from any previous group.
+ *
+ * Newly created threads belong to the same group as the thread from which they
+ * were created.
+ */
+
+static VALUE thgroup_s_alloc _((VALUE));
+static VALUE
+thgroup_s_alloc(klass)
+ VALUE klass;
+{
+ VALUE group;
+ struct thgroup *data;
+
+ group = Data_Make_Struct(klass, struct thgroup, 0, free, data);
+ data->enclosed = 0;
+ data->group = group;
+
+ return group;
+}
+
+
+/*
+ * call-seq:
+ * thgrp.list => array
+ *
+ * Returns an array of all existing <code>Thread</code> objects that belong to
+ * this group.
+ *
+ * ThreadGroup::Default.list #=> [#<Thread:0x401bdf4c run>]
+ */
+
+static VALUE
+thgroup_list(group)
+ VALUE group;
+{
+ struct thgroup *data;
+ rb_thread_t th;
+ VALUE ary;
+
+ Data_Get_Struct(group, struct thgroup, data);
+ ary = rb_ary_new();
+
+ FOREACH_THREAD(th) {
+ if (th->thgroup == data->group) {
+ rb_ary_push(ary, th->thread);
+ }
+ }
+ END_FOREACH(th);
+
+ return ary;
+}
+
+
+/*
+ * call-seq:
+ * thgrp.enclose => thgrp
+ *
+ * Prevents threads from being added to or removed from the receiving
+ * <code>ThreadGroup</code>. New threads can still be started in an enclosed
+ * <code>ThreadGroup</code>.
+ *
+ * ThreadGroup::Default.enclose #=> #<ThreadGroup:0x4029d914>
+ * thr = Thread::new { Thread.stop } #=> #<Thread:0x402a7210 sleep>
+ * tg = ThreadGroup::new #=> #<ThreadGroup:0x402752d4>
+ * tg.add thr
+ *
+ * <em>produces:</em>
+ *
+ * ThreadError: can't move from the enclosed thread group
+ */
+
+static VALUE
+thgroup_enclose(group)
+ VALUE group;
+{
+ struct thgroup *data;
+
+ Data_Get_Struct(group, struct thgroup, data);
+ data->enclosed = 1;
+
+ return group;
+}
+
+
+/*
+ * call-seq:
+ * thgrp.enclosed? => true or false
+ *
+ * Returns <code>true</code> if <em>thgrp</em> is enclosed. See also
+ * ThreadGroup#enclose.
+ */
+
+static VALUE
+thgroup_enclosed_p(group)
+ VALUE group;
+{
+ struct thgroup *data;
+
+ Data_Get_Struct(group, struct thgroup, data);
+ if (data->enclosed) return Qtrue;
+ return Qfalse;
+}
+
+
+/*
+ * call-seq:
+ * thgrp.add(thread) => thgrp
+ *
+ * Adds the given <em>thread</em> to this group, removing it from any other
+ * group to which it may have previously belonged.
+ *
+ * puts "Initial group is #{ThreadGroup::Default.list}"
+ * tg = ThreadGroup.new
+ * t1 = Thread.new { sleep }
+ * t2 = Thread.new { sleep }
+ * puts "t1 is #{t1}"
+ * puts "t2 is #{t2}"
+ * tg.add(t1)
+ * puts "Initial group now #{ThreadGroup::Default.list}"
+ * puts "tg group now #{tg.list}"
+ *
+ * <em>produces:</em>
+ *
+ * Initial group is #<Thread:0x401bdf4c>
+ * t1 is #<Thread:0x401b3c90>
+ * t2 is #<Thread:0x401b3c18>
+ * Initial group now #<Thread:0x401b3c18>#<Thread:0x401bdf4c>
+ * tg group now #<Thread:0x401b3c90>
+ */
+
+static VALUE
+thgroup_add(group, thread)
+ VALUE group, thread;
+{
+ rb_thread_t th;
+ struct thgroup *data;
+
+ rb_secure(4);
+ th = rb_thread_check(thread);
+
+ if (OBJ_FROZEN(group)) {
+ rb_raise(rb_eThreadError, "can't move to the frozen thread group");
+ }
+ Data_Get_Struct(group, struct thgroup, data);
+ if (data->enclosed) {
+ rb_raise(rb_eThreadError, "can't move to the enclosed thread group");
+ }
+
+ if (!th->thgroup) {
+ return Qnil;
+ }
+ if (OBJ_FROZEN(th->thgroup)) {
+ rb_raise(rb_eThreadError, "can't move from the frozen thread group");
+ }
+ Data_Get_Struct(th->thgroup, struct thgroup, data);
+ if (data->enclosed) {
+ rb_raise(rb_eThreadError, "can't move from the enclosed thread group");
+ }
+
+ th->thgroup = group;
+ return group;
+}
+
+
+/* variables for recursive traversals */
+static ID recursive_key;
+
+static VALUE
+recursive_check(hash, obj)
+ VALUE hash;
+ VALUE obj;
+{
+ if (NIL_P(hash) || TYPE(hash) != T_HASH) {
+ return Qfalse;
+ }
+ else {
+ VALUE list = rb_hash_aref(hash, ID2SYM(rb_frame_last_func()));
+
+ if (NIL_P(list) || TYPE(list) != T_HASH)
+ return Qfalse;
+ if (NIL_P(rb_hash_lookup(list, obj)))
+ return Qfalse;
+ return Qtrue;
+ }
+}
+
+static VALUE
+recursive_push(hash, obj)
+ VALUE hash;
+ VALUE obj;
+{
+ VALUE list, sym;
+
+ sym = ID2SYM(rb_frame_last_func());
+ if (NIL_P(hash) || TYPE(hash) != T_HASH) {
+ hash = rb_hash_new();
+ rb_thread_local_aset(rb_thread_current(), recursive_key, hash);
+ list = Qnil;
+ }
+ else {
+ list = rb_hash_aref(hash, sym);
+ }
+ if (NIL_P(list) || TYPE(list) != T_HASH) {
+ list = rb_hash_new();
+ rb_hash_aset(hash, sym, list);
+ }
+ rb_hash_aset(list, obj, Qtrue);
+ return hash;
+}
+
+static void
+recursive_pop(hash, obj)
+ VALUE hash;
+ VALUE obj;
+{
+ VALUE list, sym;
+
+ sym = ID2SYM(rb_frame_last_func());
+ if (NIL_P(hash) || TYPE(hash) != T_HASH) {
+ VALUE symname;
+ VALUE thrname;
+ symname = rb_inspect(sym);
+ thrname = rb_inspect(rb_thread_current());
+
+ rb_raise(rb_eTypeError, "invalid inspect_tbl hash for %s in %s",
+ StringValuePtr(symname), StringValuePtr(thrname));
+ }
+ list = rb_hash_aref(hash, sym);
+ if (NIL_P(list) || TYPE(list) != T_HASH) {
+ VALUE symname = rb_inspect(sym);
+ VALUE thrname = rb_inspect(rb_thread_current());
+ rb_raise(rb_eTypeError, "invalid inspect_tbl list for %s in %s",
+ StringValuePtr(symname), StringValuePtr(thrname));
+ }
+ rb_hash_delete(list, obj);
+}
+
+VALUE
+rb_exec_recursive(func, obj, arg)
+ VALUE (*func) _((VALUE, VALUE, int));
+ VALUE obj;
+ VALUE arg;
+{
+ VALUE hash = rb_thread_local_aref(rb_thread_current(), recursive_key);
+ VALUE objid = rb_obj_id(obj);
+
+ if (recursive_check(hash, objid)) {
+ return (*func) (obj, arg, Qtrue);
+ }
+ else {
+ VALUE result = Qundef;
+ int state;
+
+ hash = recursive_push(hash, objid);
+ PUSH_TAG(PROT_NONE);
+ if ((state = EXEC_TAG()) == 0) {
+ result = (*func) (obj, arg, Qfalse);
+ }
+ POP_TAG();
+ recursive_pop(hash, objid);
+ if (state)
+ JUMP_TAG(state);
+ return result;
+ }
+}
+
+
+/*
+ * +Thread+ encapsulates the behavior of a thread of
+ * execution, including the main thread of the Ruby script.
+ *
+ * In the descriptions of the methods in this class, the parameter _sym_
+ * refers to a symbol, which is either a quoted string or a
+ * +Symbol+ (such as <code>:name</code>).
+ */
+
+void
+Init_Thread()
+{
+ VALUE cThGroup;
+
+ recursive_key = rb_intern("__recursive_key__");
+ rb_eThreadError = rb_define_class("ThreadError", rb_eStandardError);
+ rb_cThread = rb_define_class("Thread", rb_cObject);
+ rb_undef_alloc_func(rb_cThread);
+
+ rb_define_singleton_method(rb_cThread, "new", rb_thread_s_new, -1);
+ rb_define_method(rb_cThread, "initialize", rb_thread_initialize, -2);
+ rb_define_singleton_method(rb_cThread, "start", rb_thread_start, -2);
+ rb_define_singleton_method(rb_cThread, "fork", rb_thread_start, -2);
+
+ rb_define_singleton_method(rb_cThread, "stop", rb_thread_stop, 0);
+ rb_define_singleton_method(rb_cThread, "kill", rb_thread_s_kill, 1);
+ rb_define_singleton_method(rb_cThread, "exit", rb_thread_exit, 0);
+ rb_define_singleton_method(rb_cThread, "pass", rb_thread_pass, 0);
+ rb_define_singleton_method(rb_cThread, "current", rb_thread_current, 0);
+ rb_define_singleton_method(rb_cThread, "main", rb_thread_main, 0);
+ rb_define_singleton_method(rb_cThread, "list", rb_thread_list, 0);
+
+ rb_define_singleton_method(rb_cThread, "critical", rb_thread_critical_get, 0);
+ rb_define_singleton_method(rb_cThread, "critical=", rb_thread_critical_set, 1);
+
+ rb_define_singleton_method(rb_cThread, "abort_on_exception", rb_thread_s_abort_exc, 0);
+ rb_define_singleton_method(rb_cThread, "abort_on_exception=", rb_thread_s_abort_exc_set, 1);
+
+ rb_define_method(rb_cThread, "run", rb_thread_run, 0);
+ rb_define_method(rb_cThread, "wakeup", rb_thread_wakeup, 0);
+ rb_define_method(rb_cThread, "kill", rb_thread_kill, 0);
+ rb_define_method(rb_cThread, "terminate", rb_thread_kill, 0);
+ rb_define_method(rb_cThread, "exit", rb_thread_kill, 0);
+ rb_define_method(rb_cThread, "kill!", rb_thread_kill_bang, 0);
+ rb_define_method(rb_cThread, "terminate!", rb_thread_kill_bang, 0);
+ rb_define_method(rb_cThread, "exit!", rb_thread_kill_bang, 0);
+ rb_define_method(rb_cThread, "value", rb_thread_value, 0);
+ rb_define_method(rb_cThread, "status", rb_thread_status, 0);
+ rb_define_method(rb_cThread, "join", rb_thread_join_m, -1);
+ rb_define_method(rb_cThread, "alive?", rb_thread_alive_p, 0);
+ rb_define_method(rb_cThread, "stop?", rb_thread_stop_p, 0);
+ rb_define_method(rb_cThread, "raise", rb_thread_raise_m, -1);
+
+ rb_define_method(rb_cThread, "abort_on_exception", rb_thread_abort_exc, 0);
+ rb_define_method(rb_cThread, "abort_on_exception=", rb_thread_abort_exc_set, 1);
+
+ rb_define_method(rb_cThread, "priority", rb_thread_priority, 0);
+ rb_define_method(rb_cThread, "priority=", rb_thread_priority_set, 1);
+ rb_define_method(rb_cThread, "safe_level", rb_thread_safe_level, 0);
+ rb_define_method(rb_cThread, "group", rb_thread_group, 0);
+
+ rb_define_method(rb_cThread, "[]", rb_thread_aref, 1);
+ rb_define_method(rb_cThread, "[]=", rb_thread_aset, 2);
+ rb_define_method(rb_cThread, "key?", rb_thread_key_p, 1);
+ rb_define_method(rb_cThread, "keys", rb_thread_keys, 0);
+
+ rb_define_method(rb_cThread, "inspect", rb_thread_inspect, 0);
+
+ rb_cCont = rb_define_class("Continuation", rb_cObject);
+ rb_undef_alloc_func(rb_cCont);
+ rb_undef_method(CLASS_OF(rb_cCont), "new");
+ rb_define_method(rb_cCont, "call", rb_cont_call, -1);
+ rb_define_method(rb_cCont, "[]", rb_cont_call, -1);
+ rb_define_global_function("callcc", rb_callcc, 0);
+ rb_global_variable(&cont_protect);
+
+ cThGroup = rb_define_class("ThreadGroup", rb_cObject);
+ rb_define_alloc_func(cThGroup, thgroup_s_alloc);
+ rb_define_method(cThGroup, "list", thgroup_list, 0);
+ rb_define_method(cThGroup, "enclose", thgroup_enclose, 0);
+ rb_define_method(cThGroup, "enclosed?", thgroup_enclosed_p, 0);
+ rb_define_method(cThGroup, "add", thgroup_add, 1);
+ rb_global_variable(&thgroup_default);
+ thgroup_default = rb_obj_alloc(cThGroup);
+ rb_define_const(cThGroup, "Default", thgroup_default);
+
+ /* allocate main thread */
+ main_thread = rb_thread_alloc(rb_cThread);
+ curr_thread = main_thread->prev = main_thread->next = main_thread;
+}
+
+/*
+ * call-seq:
+ * catch(symbol) {| | block } > obj
+ *
+ * +catch+ executes its block. If a +throw+ is
+ * executed, Ruby searches up its stack for a +catch+ block
+ * with a tag corresponding to the +throw+'s
+ * _symbol_. If found, that block is terminated, and
+ * +catch+ returns the value given to +throw+. If
+ * +throw+ is not called, the block terminates normally, and
+ * the value of +catch+ is the value of the last expression
+ * evaluated. +catch+ expressions may be nested, and the
+ * +throw+ call need not be in lexical scope.
+ *
+ * def routine(n)
+ * puts n
+ * throw :done if n <= 0
+ * routine(n-1)
+ * end
+ *
+ *
+ * catch(:done) { routine(3) }
+ *
+ * <em>produces:</em>
+ *
+ * 3
+ * 2
+ * 1
+ * 0
+ */
+
+static VALUE
+rb_f_catch(dmy, tag)
+ VALUE dmy, tag;
+{
+ int state;
+ VALUE val = Qnil; /* OK */
+
+ tag = ID2SYM(rb_to_id(tag));
+ PUSH_TAG(tag);
+ if ((state = EXEC_TAG()) == 0) {
+ val = rb_yield_0(tag, 0, 0, 0, Qfalse);
+ }
+ else if (state == TAG_THROW && tag == prot_tag->dst) {
+ val = prot_tag->retval;
+ state = 0;
+ }
+ POP_TAG();
+ if (state) JUMP_TAG(state);
+
+ return val;
+}
+
+static VALUE
+catch_i(tag)
+ VALUE tag;
+{
+ return rb_funcall(Qnil, rb_intern("catch"), 1, tag);
+}
+
+VALUE
+rb_catch(tag, func, data)
+ const char *tag;
+ VALUE (*func)();
+ VALUE data;
+{
+ return rb_iterate((VALUE(*)_((VALUE)))catch_i, ID2SYM(rb_intern(tag)), func, data);
+}
+
+/*
+ * call-seq:
+ * throw(symbol [, obj])
+ *
+ * Transfers control to the end of the active +catch+ block
+ * waiting for _symbol_. Raises +NameError+ if there
+ * is no +catch+ block for the symbol. The optional second
+ * parameter supplies a return value for the +catch+ block,
+ * which otherwise defaults to +nil+. For examples, see
+ * <code>Kernel::catch</code>.
+ */
+
+static VALUE
+rb_f_throw(argc, argv)
+ int argc;
+ VALUE *argv;
+{
+ VALUE tag, value;
+ struct tag *tt = prot_tag;
+
+ rb_scan_args(argc, argv, "11", &tag, &value);
+ tag = ID2SYM(rb_to_id(tag));
+
+ while (tt) {
+ if (tt->tag == tag) {
+ tt->dst = tag;
+ tt->retval = value;
+ break;
+ }
+ if (tt->tag == PROT_THREAD) {
+ rb_raise(rb_eThreadError, "uncaught throw `%s' in thread 0x%lx",
+ rb_id2name(SYM2ID(tag)),
+ curr_thread);
+ }
+ tt = tt->prev;
+ }
+ if (!tt) {
+ rb_name_error(SYM2ID(tag), "uncaught throw `%s'", rb_id2name(SYM2ID(tag)));
+ }
+ rb_trap_restore_mask();
+ JUMP_TAG(TAG_THROW);
+#ifndef __GNUC__
+ return Qnil; /* not reached */
+#endif
+}
+
+void
+rb_throw(tag, val)
+ const char *tag;
+ VALUE val;
+{
+ VALUE argv[2];
+
+ argv[0] = ID2SYM(rb_intern(tag));
+ argv[1] = val;
+ rb_f_throw(2, argv);
}
diff --git a/eval_error.c b/eval_error.c
deleted file mode 100644
index 85e55ad3c8..0000000000
--- a/eval_error.c
+++ /dev/null
@@ -1,272 +0,0 @@
-/* -*-c-*- */
-/*
- * included by eval.c
- */
-
-static void
-warn_printf(const char *fmt, ...)
-{
- char buf[BUFSIZ];
- va_list args;
-
- va_init_list(args, fmt);
- vsnprintf(buf, BUFSIZ, fmt, args);
- va_end(args);
- rb_write_error(buf);
-}
-
-#define warn_print(x) rb_write_error(x)
-#define warn_print2(x,l) rb_write_error2(x,l)
-
-static void
-error_pos(void)
-{
- const char *sourcefile = rb_sourcefile();
- int sourceline = rb_sourceline();
-
- if (sourcefile) {
- if (sourceline == 0) {
- warn_printf("%s", sourcefile);
- }
- else if (rb_frame_callee()) {
- warn_printf("%s:%d:in `%s'", sourcefile, sourceline,
- rb_id2name(rb_frame_callee()));
- }
- else {
- warn_printf("%s:%d", sourcefile, sourceline);
- }
- }
-}
-
-VALUE rb_check_backtrace(VALUE);
-
-static VALUE
-get_backtrace(VALUE info)
-{
- if (NIL_P(info))
- return Qnil;
- info = rb_funcall(info, rb_intern("backtrace"), 0);
- if (NIL_P(info))
- return Qnil;
- return rb_check_backtrace(info);
-}
-
-VALUE
-rb_get_backtrace(VALUE info)
-{
- return get_backtrace(info);
-}
-
-static void
-set_backtrace(VALUE info, VALUE bt)
-{
- rb_funcall(info, rb_intern("set_backtrace"), 1, bt);
-}
-
-static void
-error_print(void)
-{
- volatile VALUE errat = Qnil; /* OK */
- VALUE errinfo = GET_THREAD()->errinfo;
- volatile VALUE eclass, e;
- const char *volatile einfo;
- volatile long elen;
-
- if (NIL_P(errinfo))
- return;
-
- PUSH_TAG();
- if (EXEC_TAG() == 0) {
- errat = get_backtrace(errinfo);
- }
- else {
- errat = Qnil;
- }
- if (EXEC_TAG())
- goto error;
- if (NIL_P(errat)) {
- const char *file = rb_sourcefile();
- int line = rb_sourceline();
- if (file)
- warn_printf("%s:%d", file, line);
- else
- warn_printf("%d", line);
- }
- else if (RARRAY_LEN(errat) == 0) {
- error_pos();
- }
- else {
- VALUE mesg = RARRAY_PTR(errat)[0];
-
- if (NIL_P(mesg))
- error_pos();
- else {
- warn_print2(RSTRING_PTR(mesg), RSTRING_LEN(mesg));
- }
- }
-
- eclass = CLASS_OF(errinfo);
- if (EXEC_TAG() == 0) {
- e = rb_funcall(errinfo, rb_intern("message"), 0, 0);
- StringValue(e);
- einfo = RSTRING_PTR(e);
- elen = RSTRING_LEN(e);
- }
- else {
- einfo = "";
- elen = 0;
- }
- if (EXEC_TAG())
- goto error;
- if (eclass == rb_eRuntimeError && elen == 0) {
- warn_print(": unhandled exception\n");
- }
- else {
- VALUE epath;
-
- epath = rb_class_name(eclass);
- if (elen == 0) {
- warn_print(": ");
- warn_print2(RSTRING_PTR(epath), RSTRING_LEN(epath));
- warn_print("\n");
- }
- else {
- char *tail = 0;
- long len = elen;
-
- if (RSTRING_PTR(epath)[0] == '#')
- epath = 0;
- if ((tail = memchr(einfo, '\n', elen)) != 0) {
- len = tail - einfo;
- tail++; /* skip newline */
- }
- warn_print(": ");
- warn_print2(einfo, len);
- if (epath) {
- warn_print(" (");
- warn_print2(RSTRING_PTR(epath), RSTRING_LEN(epath));
- warn_print(")\n");
- }
- if (tail) {
- warn_print2(tail, elen - len - 1);
- if (einfo[elen-1] != '\n') warn_print2("\n", 1);
- }
- }
- }
-
- if (!NIL_P(errat)) {
- long i;
- long len = RARRAY_LEN(errat);
- VALUE *ptr = RARRAY_PTR(errat);
- int skip = eclass == rb_eSysStackError;
-
-#define TRACE_MAX (TRACE_HEAD+TRACE_TAIL+5)
-#define TRACE_HEAD 8
-#define TRACE_TAIL 5
-
- for (i = 1; i < len; i++) {
- if (TYPE(ptr[i]) == T_STRING) {
- warn_printf("\tfrom %s\n", RSTRING_PTR(ptr[i]));
- }
- if (skip && i == TRACE_HEAD && len > TRACE_MAX) {
- warn_printf("\t ... %ld levels...\n",
- len - TRACE_HEAD - TRACE_TAIL);
- i = len - TRACE_TAIL;
- }
- }
- }
- error:
- POP_TAG();
-}
-
-void
-ruby_error_print(void)
-{
- error_print();
-}
-
-void
-rb_print_undef(VALUE klass, ID id, int scope)
-{
- const char *v;
-
- switch (scope) {
- default:
- case NOEX_PUBLIC: v = ""; break;
- case NOEX_PRIVATE: v = " private"; break;
- case NOEX_PROTECTED: v = " protected"; break;
- }
- rb_name_error(id, "undefined%s method `%s' for %s `%s'", v,
- rb_id2name(id),
- (TYPE(klass) == T_MODULE) ? "module" : "class",
- rb_class2name(klass));
-}
-
-static int
-sysexit_status(VALUE err)
-{
- VALUE st = rb_iv_get(err, "status");
- return NUM2INT(st);
-}
-
-static int
-error_handle(int ex)
-{
- int status = EXIT_FAILURE;
- rb_thread_t *th = GET_THREAD();
-
- if (rb_threadptr_set_raised(th))
- return EXIT_FAILURE;
- switch (ex & TAG_MASK) {
- case 0:
- status = EXIT_SUCCESS;
- break;
-
- case TAG_RETURN:
- error_pos();
- warn_print(": unexpected return\n");
- break;
- case TAG_NEXT:
- error_pos();
- warn_print(": unexpected next\n");
- break;
- case TAG_BREAK:
- error_pos();
- warn_print(": unexpected break\n");
- break;
- case TAG_REDO:
- error_pos();
- warn_print(": unexpected redo\n");
- break;
- case TAG_RETRY:
- error_pos();
- warn_print(": retry outside of rescue clause\n");
- break;
- case TAG_THROW:
- /* TODO: fix me */
- error_pos();
- warn_printf(": unexpected throw\n");
- break;
- case TAG_RAISE: {
- 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)) {
- /* no message when exiting by signal */
- }
- else {
- error_print();
- }
- break;
- }
- case TAG_FATAL:
- error_print();
- break;
- default:
- rb_bug("Unknown longjmp status %d", ex);
- break;
- }
- rb_threadptr_reset_raised(th);
- return status;
-}
diff --git a/eval_intern.h b/eval_intern.h
deleted file mode 100644
index 573f49751b..0000000000
--- a/eval_intern.h
+++ /dev/null
@@ -1,232 +0,0 @@
-#ifndef RUBY_EVAL_INTERN_H
-#define RUBY_EVAL_INTERN_H
-
-#include "ruby/ruby.h"
-#include "vm_core.h"
-
-#define PASS_PASSED_BLOCK_TH(th) do { \
- (th)->passed_block = GC_GUARDED_PTR_REF((rb_block_t *)(th)->cfp->lfp[0]); \
- (th)->cfp->flag |= VM_FRAME_FLAG_PASSED; \
-} while (0)
-
-#define PASS_PASSED_BLOCK() do { \
- rb_thread_t * const __th__ = GET_THREAD(); \
- PASS_PASSED_BLOCK_TH(__th__); \
-} while (0)
-
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-#ifndef EXIT_SUCCESS
-#define EXIT_SUCCESS 0
-#endif
-#ifndef EXIT_FAILURE
-#define EXIT_FAILURE 1
-#endif
-
-#include <stdio.h>
-#include <setjmp.h>
-
-#ifdef __APPLE__
-#include <crt_externs.h>
-#endif
-
-/* Make alloca work the best possible way. */
-#ifdef __GNUC__
-# ifndef atarist
-# ifndef alloca
-# define alloca __builtin_alloca
-# endif
-# endif /* atarist */
-#else
-# ifdef HAVE_ALLOCA_H
-# include <alloca.h>
-# else
-# ifdef _AIX
-#pragma alloca
-# else
-# ifndef alloca /* predefined by HP cc +Olibcalls */
-void *alloca();
-# endif
-# endif /* AIX */
-# endif /* HAVE_ALLOCA_H */
-#endif /* __GNUC__ */
-
-#ifndef HAVE_STRING_H
-char *strrchr(const char *, const char);
-#endif
-
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-
-#ifdef HAVE_NET_SOCKET_H
-#include <net/socket.h>
-#endif
-
-#define ruby_setjmp(env) RUBY_SETJMP(env)
-#define ruby_longjmp(env,val) RUBY_LONGJMP(env,val)
-#ifdef __CYGWIN__
-# ifndef _setjmp
-int _setjmp(jmp_buf);
-# endif
-# ifndef _longjmp
-NORETURN(void _longjmp(jmp_buf, int));
-# endif
-#endif
-
-#include <sys/types.h>
-#include <signal.h>
-#include <errno.h>
-
-#ifdef HAVE_SYS_SELECT_H
-#include <sys/select.h>
-#endif
-
-/*
- Solaris sys/select.h switches select to select_large_fdset to support larger
- file descriptors if FD_SETSIZE is larger than 1024 on 32bit environment.
- But Ruby doesn't change FD_SETSIZE because fd_set is allocated dynamically.
- So following definition is required to use select_large_fdset.
-*/
-#ifdef HAVE_SELECT_LARGE_FDSET
-#define select(n, r, w, e, t) select_large_fdset(n, r, w, e, t)
-#endif
-
-#ifdef HAVE_SYS_PARAM_H
-#include <sys/param.h>
-#endif
-
-#include <sys/stat.h>
-
-#define SAVE_ROOT_JMPBUF(th, stmt) do \
- if (ruby_setjmp((th)->root_jmpbuf) == 0) { \
- stmt; \
- } \
- else { \
- rb_fiber_start(); \
- } while (0)
-
-#define TH_PUSH_TAG(th) do { \
- rb_thread_t * const _th = th; \
- struct rb_vm_tag _tag; \
- _tag.tag = 0; \
- _tag.prev = _th->tag; \
- _th->tag = &_tag;
-
-#define TH_POP_TAG() \
- _th->tag = _tag.prev; \
-} while (0)
-
-#define TH_POP_TAG2() \
- _th->tag = _tag.prev
-
-#define PUSH_TAG() TH_PUSH_TAG(GET_THREAD())
-#define POP_TAG() TH_POP_TAG()
-
-#define TH_EXEC_TAG() ruby_setjmp(_th->tag->buf)
-
-#define EXEC_TAG() \
- TH_EXEC_TAG()
-
-#define TH_JUMP_TAG(th, st) do { \
- ruby_longjmp(th->tag->buf,(st)); \
-} while (0)
-
-#define JUMP_TAG(st) TH_JUMP_TAG(GET_THREAD(), st)
-
-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)NEW_NODE(NODE_LIT, (val), (pt), (st)))
-#define SET_THROWOBJ_CATCH_POINT(obj, val) \
- (RNODE((obj))->u2.value = (val))
-#define SET_THROWOBJ_STATE(obj, val) \
- (RNODE((obj))->u3.value = (val))
-
-#define GET_THROWOBJ_VAL(obj) ((VALUE)RNODE((obj))->u1.value)
-#define GET_THROWOBJ_CATCH_POINT(obj) ((VALUE*)RNODE((obj))->u2.value)
-#define GET_THROWOBJ_STATE(obj) ((int)RNODE((obj))->u3.value)
-
-#define SCOPE_TEST(f) (rb_vm_cref()->nd_visi & (f))
-#define SCOPE_CHECK(f) (rb_vm_cref()->nd_visi == (f))
-#define SCOPE_SET(f) (rb_vm_cref()->nd_visi = (f))
-
-#define CHECK_STACK_OVERFLOW(cfp, margin) do \
- if (((VALUE *)(cfp)->sp) + (margin) + sizeof(rb_control_frame_t) >= ((VALUE *)cfp)) { \
- rb_exc_raise(sysstack_error); \
- } \
-while (0)
-
-void rb_thread_cleanup(void);
-void rb_thread_wait_other_threads(void);
-
-enum {
- RAISED_EXCEPTION = 1,
- RAISED_STACKOVERFLOW = 2,
- RAISED_NOMEMORY = 4
-};
-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, VALUE *argv, VALUE self);
-VALUE rb_make_exception(int argc, VALUE *argv);
-
-NORETURN(void rb_fiber_start(void));
-
-NORETURN(void rb_print_undef(VALUE, ID, int));
-NORETURN(void rb_vm_localjump_error(const char *,VALUE, int));
-NORETURN(void rb_vm_jump_tag_but_local_jump(int, VALUE));
-NORETURN(void rb_raise_method_missing(rb_thread_t *th, int argc, VALUE *argv,
- VALUE obj, int call_status));
-
-VALUE rb_vm_make_jump_tag_but_local_jump(int state, VALUE val);
-NODE *rb_vm_cref(void);
-VALUE rb_obj_is_proc(VALUE);
-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);
-void rb_trap_restore_mask(void);
-
-#ifndef CharNext /* defined as CharNext[AW] on Windows. */
-#define CharNext(p) ((p) + mblen(p, RUBY_MBCHAR_MAXSIZE))
-#endif
-
-#if defined DOSISH || defined __CYGWIN__
-static inline void
-translit_char(char *p, int from, int to)
-{
- while (*p) {
- if ((unsigned char)*p == from)
- *p = to;
- p = CharNext(p);
- }
-}
-#endif
-
-#endif /* RUBY_EVAL_INTERN_H */
diff --git a/eval_jump.c b/eval_jump.c
deleted file mode 100644
index 18b6835c9c..0000000000
--- a/eval_jump.c
+++ /dev/null
@@ -1,152 +0,0 @@
-/* -*-c-*- */
-/*
- * from eval.c
- */
-
-#include "eval_intern.h"
-
-/* exit */
-
-void
-rb_call_end_proc(VALUE data)
-{
- rb_proc_call(data, rb_ary_new());
-}
-
-/*
- * call-seq:
- * at_exit { block } -> proc
- *
- * Converts _block_ to a +Proc+ object (and therefore
- * binds it at the point of call) and registers it for execution when
- * the program exits. If multiple handlers are registered, they are
- * executed in reverse order of registration.
- *
- * def do_at_exit(str1)
- * at_exit { print str1 }
- * end
- * at_exit { puts "cruel world" }
- * do_at_exit("goodbye ")
- * exit
- *
- * <em>produces:</em>
- *
- * goodbye cruel world
- */
-
-static VALUE
-rb_f_at_exit(void)
-{
- VALUE proc;
-
- if (!rb_block_given_p()) {
- rb_raise(rb_eArgError, "called without a block");
- }
- proc = rb_block_proc();
- rb_set_end_proc(rb_call_end_proc, proc);
- return proc;
-}
-
-struct end_proc_data {
- void (*func) ();
- VALUE data;
- int safe;
- struct end_proc_data *next;
-};
-
-static struct end_proc_data *end_procs, *ephemeral_end_procs, *tmp_end_procs;
-
-void
-rb_set_end_proc(void (*func)(VALUE), VALUE data)
-{
- struct end_proc_data *link = ALLOC(struct end_proc_data);
- struct end_proc_data **list;
- rb_thread_t *th = GET_THREAD();
-
- if (th->top_wrapper) {
- list = &ephemeral_end_procs;
- }
- else {
- list = &end_procs;
- }
- link->next = *list;
- link->func = func;
- link->data = data;
- link->safe = rb_safe_level();
- *list = link;
-}
-
-void
-rb_mark_end_proc(void)
-{
- struct end_proc_data *link;
-
- link = end_procs;
- while (link) {
- rb_gc_mark(link->data);
- link = link->next;
- }
- link = ephemeral_end_procs;
- while (link) {
- rb_gc_mark(link->data);
- link = link->next;
- }
- link = tmp_end_procs;
- while (link) {
- rb_gc_mark(link->data);
- link = link->next;
- }
-}
-
-void
-rb_exec_end_proc(void)
-{
- struct end_proc_data *volatile link;
- struct end_proc_data *tmp;
- int status;
- volatile int safe = rb_safe_level();
-
- while (ephemeral_end_procs) {
- tmp_end_procs = link = ephemeral_end_procs;
- ephemeral_end_procs = 0;
- while (link) {
- PUSH_TAG();
- if ((status = EXEC_TAG()) == 0) {
- rb_set_safe_level_force(link->safe);
- (*link->func) (link->data);
- }
- POP_TAG();
- if (status) {
- error_handle(status);
- }
- tmp = link;
- tmp_end_procs = link = link->next;
- xfree(tmp);
- }
- }
- while (end_procs) {
- tmp_end_procs = link = end_procs;
- end_procs = 0;
- while (link) {
- PUSH_TAG();
- if ((status = EXEC_TAG()) == 0) {
- rb_set_safe_level_force(link->safe);
- (*link->func) (link->data);
- }
- POP_TAG();
- if (status) {
- error_handle(status);
- }
- tmp = link;
- tmp_end_procs = link = link->next;
- xfree(tmp);
- }
- }
- rb_set_safe_level_force(safe);
-}
-
-void
-Init_jump(void)
-{
- rb_define_global_function("at_exit", rb_f_at_exit, 0);
-}
diff --git a/ext/.document b/ext/.document
index b4ef7886a6..ba8182593e 100644
--- a/ext/.document
+++ b/ext/.document
@@ -1,73 +1,10 @@
# Add files to this as they become documented
-bigdecimal/bigdecimal.c
-bigdecimal/lib
-coverage/coverage.c
-digest/digest.c
-etc/etc.c
-fcntl/fcntl.c
-gdbm/gdbm.c
+enumerator/enumerator.c
iconv/iconv.c
-io/wait/wait.c
-io/wait/lib
-json/ext/generator/generator.c
-json/ext/parser/parser.c
-json/lib
nkf/lib/kconv.rb
nkf/nkf.c
-objspace/objspace.c
-openssl/ossl.c
-openssl/ossl_asn1.c
-openssl/ossl_bn.c
-openssl/ossl_cipher.c
-openssl/ossl_config.c
-openssl/ossl_digest.c
-openssl/ossl_engine.c
-openssl/ossl_hmac.c
-openssl/ossl_ns_spki.c
-openssl/ossl_ocsp.c
-openssl/ossl_pkcs5.c
-openssl/ossl_pkcs7.c
-openssl/ossl_pkcs12.c
-openssl/ossl_pkey.c
-openssl/ossl_pkey_dh.c
-openssl/ossl_pkey_dsa.c
-openssl/ossl_pkey_ec.c
-openssl/ossl_pkey_rsa.c
-openssl/ossl_rand.c
-openssl/ossl_ssl.c
-openssl/ossl_ssl_session.c
-openssl/ossl_x509.c
-openssl/ossl_x509attr.c
-openssl/ossl_x509cert.c
-openssl/ossl_x509crl.c
-openssl/ossl_x509ext.c
-openssl/ossl_x509name.c
-openssl/ossl_x509req.c
-openssl/ossl_x509revoked.c
-openssl/ossl_x509store.c
-openssl/lib/openssl/buffering.rb
-pty/pty.c
-pty/lib
-readline/readline.c
-ripper/ripper.c
-ripper/lib
-socket/init.c
-socket/raddrinfo.c
-socket/basicsocket.c
-socket/ipsocket.c
-socket/tcpsocket.c
-socket/tcpserver.c
-socket/sockssocket.c
-socket/udpsocket.c
-socket/unixsocket.c
-socket/unixserver.c
socket/socket.c
-socket/option.c
-socket/ancdata.c
-socket/constants.c
-socket/constdefs.c
-socket/lib/socket.rb
stringio/stringio.c
strscan/strscan.c
win32ole
diff --git a/ext/Setup b/ext/Setup
index b0f29b9f7b..d0d6317a5e 100644
--- a/ext/Setup
+++ b/ext/Setup
@@ -10,23 +10,25 @@
#digest/sha1
#digest/sha2
#dl
+#enumerator
#etc
#fcntl
#gdbm
#iconv
#io/wait
#nkf
-#openssl
#pty
+#openssl
#racc/cparse
#readline
-#ripper
#sdbm
#socket
#stringio
#strscan
#syck
#syslog
+#tcltklib
+#thread
#tk
#win32ole
#zlib
diff --git a/ext/Setup.atheos b/ext/Setup.atheos
index 6e0b8ae5a6..6bda3a4cfb 100644
--- a/ext/Setup.atheos
+++ b/ext/Setup.atheos
@@ -17,17 +17,18 @@ gdbm
iconv
io/wait
nkf
-#openssl
pty
+#openssl
racc/parse
readline
-ripper
sdbm
socket
stringio
strscan
syck
syslog
+#tcltklib
+thread
#tk
#win32ole
zlib
diff --git a/ext/Setup.dj b/ext/Setup.dj
new file mode 100644
index 0000000000..4f94788886
--- /dev/null
+++ b/ext/Setup.dj
@@ -0,0 +1,34 @@
+option nodynamic
+
+#Win32API
+bigdecimal
+curses
+dbm
+digest
+digest/md5
+digest/rmd160
+digest/sha1
+digest/sha2
+#dl
+etc
+enumerator
+fcntl
+gdbm
+#iconv
+#io/wait
+nkf
+#pty
+#openssl
+racc/cparse
+readline
+sdbm
+#socket
+stringio
+strscan
+syck
+#syslog
+#tcltklib
+thread
+#tk
+#win32ole
+zlib
diff --git a/ext/Setup.emx b/ext/Setup.emx
index fade917e92..afc5923577 100644
--- a/ext/Setup.emx
+++ b/ext/Setup.emx
@@ -17,17 +17,18 @@ fcntl
#iconv
#io/wait
nkf
-#openssl
#pty
+#openssl
racc/cparse
#readline
-#ripper
#sdbm
socket
stringio
strscan
#syck
#syslog
+#tcltklib
+thread
#tk
#win32ole
#zlib
diff --git a/ext/Setup.nt b/ext/Setup.nt
index c8574ba70a..9f8abf9b8d 100644
--- a/ext/Setup.nt
+++ b/ext/Setup.nt
@@ -17,17 +17,18 @@ fcntl
#iconv
#io/wait
nkf
-#openssl
#pty
+#openssl
racc/cparse
#readline
-#ripper
sdbm
socket
stringio
strscan
syck
#syslog
+#tcltklib
+thread
#tk
win32ole
#zlib
diff --git a/ext/Setup.x68 b/ext/Setup.x68
new file mode 100644
index 0000000000..0966e737e9
--- /dev/null
+++ b/ext/Setup.x68
@@ -0,0 +1,34 @@
+option nodynamic
+
+#Win32API
+bigdecimal
+#curses
+dbm
+digest
+digest/md5
+digest/rmd160
+digest/sha1
+digest/sha2
+#dl
+#etc
+enumerator
+fcntl
+#gdbm
+#iconv
+#io/wait
+nkf
+#pty
+#openssl
+racc/cparse
+#readline
+#sdbm
+#socket
+stringio
+strscan
+#syck
+#syslog
+#tcltklib
+thread
+#tk
+#win32ole
+#zlib
diff --git a/ext/Win32API/.cvsignore b/ext/Win32API/.cvsignore
new file mode 100644
index 0000000000..90c83ed9b1
--- /dev/null
+++ b/ext/Win32API/.cvsignore
@@ -0,0 +1,3 @@
+Makefile
+*.log
+*.def
diff --git a/ext/Win32API/Win32API.c b/ext/Win32API/Win32API.c
new file mode 100644
index 0000000000..a4fd0396f0
--- /dev/null
+++ b/ext/Win32API/Win32API.c
@@ -0,0 +1,215 @@
+/*
+ Win32API - Ruby Win32 API Import Facility
+*/
+
+#if !defined _MSC_VER && !defined _WIN32
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#include <stdio.h>
+#endif
+
+#define _T_VOID 0
+#define _T_NUMBER 1
+#define _T_POINTER 2
+#define _T_INTEGER 3
+
+#include "ruby.h"
+
+typedef struct {
+ HANDLE dll;
+ HANDLE proc;
+ VALUE dllname;
+ VALUE import;
+ VALUE export;
+} Win32API;
+
+static void
+Win32API_FreeLibrary(hdll)
+ HINSTANCE hdll;
+{
+ FreeLibrary(hdll);
+}
+
+static VALUE
+Win32API_initialize(self, dllname, proc, import, export)
+ VALUE self;
+ VALUE dllname;
+ VALUE proc;
+ VALUE import;
+ VALUE export;
+{
+ HANDLE hproc;
+ HINSTANCE hdll;
+ VALUE str;
+ VALUE a_import;
+ VALUE *ptr;
+ char *s;
+ int i;
+ int len;
+ int ex = _T_VOID;
+
+ SafeStringValue(dllname);
+ SafeStringValue(proc);
+ hdll = LoadLibrary(RSTRING(dllname)->ptr);
+ if (!hdll)
+ rb_raise(rb_eRuntimeError, "LoadLibrary: %s\n", RSTRING(dllname)->ptr);
+ rb_iv_set(self, "__hdll__", Data_Wrap_Struct(rb_cData, 0, Win32API_FreeLibrary, (void*)hdll));
+ hproc = (HANDLE)GetProcAddress(hdll, RSTRING(proc)->ptr);
+ if (!hproc) {
+ str = rb_str_new3(proc);
+ str = rb_str_cat(str, "A", 1);
+ hproc = (HANDLE)GetProcAddress(hdll, RSTRING(str)->ptr);
+ if (!hproc)
+ rb_raise(rb_eRuntimeError, "GetProcAddress: %s or %s\n",
+ RSTRING(proc)->ptr, RSTRING(str)->ptr);
+ }
+ rb_iv_set(self, "__dll__", UINT2NUM((unsigned long)hdll));
+ rb_iv_set(self, "__dllname__", dllname);
+ rb_iv_set(self, "__proc__", UINT2NUM((unsigned long)hproc));
+
+ a_import = rb_ary_new();
+ switch (TYPE(import)) {
+ case T_NIL:
+ break;
+ case T_ARRAY:
+ ptr = RARRAY(import)->ptr;
+ for (i = 0, len = RARRAY(import)->len; i < len; i++) {
+ SafeStringValue(ptr[i]);
+ switch (*(char *)RSTRING(ptr[i])->ptr) {
+ case 'N': case 'n': case 'L': case 'l':
+ rb_ary_push(a_import, INT2FIX(_T_NUMBER));
+ break;
+ case 'P': case 'p':
+ rb_ary_push(a_import, INT2FIX(_T_POINTER));
+ break;
+ case 'I': case 'i':
+ rb_ary_push(a_import, INT2FIX(_T_INTEGER));
+ break;
+ }
+ }
+ break;
+ default:
+ SafeStringValue(import);
+ s = RSTRING(import)->ptr;
+ for (i = 0, len = RSTRING(import)->len; i < len; i++) {
+ switch (*s++) {
+ case 'N': case 'n': case 'L': case 'l':
+ rb_ary_push(a_import, INT2FIX(_T_NUMBER));
+ break;
+ case 'P': case 'p':
+ rb_ary_push(a_import, INT2FIX(_T_POINTER));
+ break;
+ case 'I': case 'i':
+ rb_ary_push(a_import, INT2FIX(_T_INTEGER));
+ break;
+ }
+ }
+ break;
+ }
+
+ if (16 < RARRAY(a_import)->len) {
+ rb_raise(rb_eRuntimeError, "too many parameters: %ld\n", RARRAY(a_import)->len);
+ }
+
+ rb_iv_set(self, "__import__", a_import);
+
+ if (NIL_P(export)) {
+ ex = _T_VOID;
+ } else {
+ SafeStringValue(export);
+ switch (*RSTRING(export)->ptr) {
+ case 'V': case 'v':
+ ex = _T_VOID;
+ break;
+ case 'N': case 'n': case 'L': case 'l':
+ ex = _T_NUMBER;
+ break;
+ case 'P': case 'p':
+ ex = _T_POINTER;
+ break;
+ case 'I': case 'i':
+ ex = _T_INTEGER;
+ break;
+ }
+ }
+ rb_iv_set(self, "__export__", INT2FIX(ex));
+
+ return Qnil;
+}
+
+#ifdef _MSC_VER
+#pragma optimize("g", off)
+#endif
+static VALUE
+Win32API_Call(argc, argv, obj)
+ int argc;
+ VALUE *argv;
+ VALUE obj;
+{
+ VALUE args;
+ unsigned long ret;
+ int i;
+ struct {
+ unsigned long params[16];
+ } param;
+#define params param.params
+
+ VALUE obj_proc = rb_iv_get(obj, "__proc__");
+ VALUE obj_import = rb_iv_get(obj, "__import__");
+ VALUE obj_export = rb_iv_get(obj, "__export__");
+ FARPROC ApiFunction = (FARPROC)NUM2ULONG(obj_proc);
+ int items = rb_scan_args(argc, argv, "0*", &args);
+ int nimport = RARRAY(obj_import)->len;
+
+
+ if (items != nimport)
+ rb_raise(rb_eRuntimeError, "wrong number of parameters: expected %d, got %d",
+ nimport, items);
+
+ for (i = 0; i < nimport; i++) {
+ unsigned long lParam = 0;
+ switch (FIX2INT(rb_ary_entry(obj_import, i))) {
+ VALUE str;
+ case _T_NUMBER:
+ case _T_INTEGER:
+ default:
+ lParam = NUM2ULONG(rb_ary_entry(args, i));
+ break;
+ case _T_POINTER:
+ str = rb_ary_entry(args, i);
+ if (NIL_P(str)) {
+ lParam = 0;
+ } else if (FIXNUM_P(str)) {
+ lParam = NUM2ULONG(str);
+ } else {
+ StringValue(str);
+ rb_str_modify(str);
+ lParam = (unsigned long)StringValuePtr(str);
+ }
+ break;
+ }
+ params[i] = lParam;
+ }
+
+ ret = ApiFunction(param);
+
+ switch (FIX2INT(obj_export)) {
+ case _T_NUMBER:
+ case _T_INTEGER:
+ return INT2NUM(ret);
+ case _T_POINTER:
+ return rb_str_new2((char *)ret);
+ case _T_VOID:
+ default:
+ return INT2NUM(0);
+ }
+}
+
+void
+Init_Win32API()
+{
+ VALUE cWin32API = rb_define_class("Win32API", rb_cObject);
+ rb_define_method(cWin32API, "initialize", Win32API_initialize, 4);
+ rb_define_method(cWin32API, "call", Win32API_Call, -1);
+ rb_define_alias(cWin32API, "Call", "call");
+}
diff --git a/ext/Win32API/depend b/ext/Win32API/depend
new file mode 100644
index 0000000000..b224bb66c9
--- /dev/null
+++ b/ext/Win32API/depend
@@ -0,0 +1 @@
+Win32API.o : Win32API.c $(hdrdir)/ruby.h $(topdir)/config.h $(hdrdir)/defines.h
diff --git a/ext/Win32API/extconf.rb b/ext/Win32API/extconf.rb
new file mode 100644
index 0000000000..865788556f
--- /dev/null
+++ b/ext/Win32API/extconf.rb
@@ -0,0 +1,6 @@
+require 'mkmf'
+
+dir_config("win32")
+if have_header("windows.h") and have_library("kernel32")
+ create_makefile("Win32API")
+end
diff --git a/ext/Win32API/getch.rb b/ext/Win32API/getch.rb
new file mode 100644
index 0000000000..c015bbe9bc
--- /dev/null
+++ b/ext/Win32API/getch.rb
@@ -0,0 +1,5 @@
+require 'Win32API'
+
+getch = Win32API.new("crtdll", "_getch", [], 'L')
+
+puts getch.Call.chr
diff --git a/ext/Win32API/lib/win32/registry.rb b/ext/Win32API/lib/win32/registry.rb
new file mode 100644
index 0000000000..9a2f3827b7
--- /dev/null
+++ b/ext/Win32API/lib/win32/registry.rb
@@ -0,0 +1,831 @@
+=begin
+= Win32 Registry I/F
+win32/registry is registry accessor library for Win32 platform.
+It uses Win32API to call Win32 Registry APIs.
+
+== example
+ Win32::Registry::HKEY_CURRENT_USER.open('SOFTWARE\foo') do |reg|
+ value = reg['foo'] # read a value
+ value = reg['foo', Win32::Registry::REG_SZ] # read a value with type
+ type, value = reg.read('foo') # read a value
+ reg['foo'] = 'bar' # write a value
+ reg['foo', Win32::Registry::REG_SZ] = 'bar' # write a value with type
+ reg.write('foo', Win32::Registry::REG_SZ, 'bar') # write a value
+
+ reg.each_value { |name, type, data| ... } # Enumerate values
+ reg.each_key { |key, wtime| ... } # Enumerate subkeys
+
+ reg.delete_value(name) # Delete a value
+ reg.delete_key(name) # Delete a subkey
+ reg.delete_key(name, true) # Delete a subkey recursively
+ end
+
+= Reference
+
+== Win32::Registry class
+
+=== including modules
+
+* Enumerable
+* Registry::Constants
+
+=== class methods
+--- Registry.open(key, subkey, desired = KEY_READ, opt = REG_OPTION_RESERVED)
+--- Registry.open(key, subkey, desired = KEY_READ, opt = REG_OPTION_RESERVED) { |reg| ... }
+ Open the registry key ((|subkey|)) under ((|key|)).
+ ((|key|)) is Win32::Registry object of parent key.
+ You can use predefined key HKEY_* (see ((<constants>)))
+
+ ((|desired|)) and ((|opt|)) is access mask and key option.
+ For detail, see ((<MSDN Library|URL:http://msdn.microsoft.com/library/en-us/sysinfo/base/regopenkeyex.asp>)).
+
+ If block is given, the key is closed automatically.
+
+--- Registry.create(key, subkey, desired = KEY_ALL_ACCESS, opt = REG_OPTION_RESERVED)
+--- Registry.create(key, subkey, desired = KEY_ALL_ACCESS, opt = REG_OPTION_RESERVED) { |reg| ... }
+ Create or open the registry key ((|subkey|)) under ((|key|)).
+ You can use predefined key HKEY_* (see ((<constants>)))
+
+ If subkey is already exists, key is opened and Registry#((<created?>))
+ method will return false.
+
+ If block is given, the key is closed automatically.
+
+--- Registry.expand_environ(str)
+ Replace (({%\w+%})) into the environment value of ((|str|)).
+ This method is used for REG_EXPAND_SZ.
+
+ For detail, see ((<ExpandEnvironmentStrings|URL:http://msdn.microsoft.com/library/en-us/sysinfo/base/expandenvironmentstrings.asp>)) Win32 API.
+
+--- Registry.type2name(type)
+ Convert registry type value to readable string.
+
+--- Registry.wtime2time(wtime)
+ Convert 64-bit FILETIME integer into Time object.
+
+--- Registry.time2wtime(time)
+ Convert Time object or Integer object into 64-bit FILETIME.
+
+=== instance methods
+--- open(subkey, desired = KEY_READ, opt = REG_OPTION_RESERVED)
+ Same as (({Win32::((<Registry.open>))(self, subkey, desired, opt)}))
+
+--- create(subkey, desired = KEY_ALL_ACCESS, opt = REG_OPTION_RESERVED)
+ Same as (({Win32::((<Registry.create>))(self, subkey, desired, opt)}))
+
+--- close
+ Close key.
+
+ After closed, most method raises error.
+
+--- read(name, *rtype)
+ Read a registry value named ((|name|)) and return array of
+ [ ((|type|)), ((|data|)) ].
+ When name is nil, the `default' value is read.
+
+ ((|type|)) is value type. (see ((<Win32::Registry::Constants module>)))
+ ((|data|)) is value data, its class is:
+ :REG_SZ, REG_EXPAND_SZ
+ String
+ :REG_MULTI_SZ
+ Array of String
+ :REG_DWORD, REG_DWORD_BIG_ENDIAN, REG_QWORD
+ Integer
+ :REG_BINARY
+ String (contains binary data)
+
+ When ((|rtype|)) is specified, the value type must be included by
+ ((|rtype|)) array, or TypeError is raised.
+
+--- self[name, *rtype]
+ Read a registry value named ((|name|)) and return its value data.
+ The class of value is same as ((<read>)) method returns.
+
+ If the value type is REG_EXPAND_SZ, returns value data whose environment
+ variables are replaced.
+ If the value type is neither REG_SZ, REG_MULTI_SZ, REG_DWORD,
+ REG_DWORD_BIG_ENDIAN, nor REG_QWORD, TypeError is raised.
+
+ The meaning of ((|rtype|)) is same as ((<read>)) method.
+
+--- read_s(name)
+--- read_i(name)
+--- read_bin(name)
+ Read a REG_SZ(read_s), REG_DWORD(read_i), or REG_BINARY(read_bin)
+ registry value named ((|name|)).
+
+ If the values type does not match, TypeError is raised.
+
+--- read_s_expand(name)
+ Read a REG_SZ or REG_EXPAND_SZ registry value named ((|name|)).
+
+ If the value type is REG_EXPAND_SZ, environment variables are replaced.
+ Unless the value type is REG_SZ or REG_EXPAND_SZ, TypeError is raised.
+
+--- write(name, type, data)
+ Write ((|data|)) to a registry value named ((|name|)).
+ When name is nil, write to the `default' value.
+
+ ((|type|)) is type value. (see ((<Registry::Constants module>)))
+ Class of ((|data|)) must be same as which ((<read>))
+ method returns.
+
+--- self[name, wtype = nil] = value
+ Write ((|value|)) to a registry value named ((|name|)).
+
+ If ((|wtype|)) is specified, the value type is it.
+ Otherwise, the value type is depend on class of ((|value|)):
+ :Integer
+ REG_DWORD
+ :String
+ REG_SZ
+ :Array
+ REG_MULTI_SZ
+
+--- write_s(name, value)
+--- write_i(name, value)
+--- write_bin(name, value)
+ Write ((|value|)) to a registry value named ((|name|)).
+
+ The value type is REG_SZ(write_s), REG_DWORD(write_i), or
+ REG_BINARY(write_bin).
+
+--- each { |name, type, value| ... }
+--- each_value { |name, type, value| ... }
+ Enumerate values.
+
+--- each_key { |subkey, wtime| ... }
+ Enumerate subkeys.
+
+ ((|subkey|)) is String which contains name of subkey.
+ ((|wtime|)) is last write time as FILETIME (64-bit integer).
+ (see ((<Registry.wtime2time>)))
+
+--- delete(name)
+--- delete_value(name)
+ Delete a registry value named ((|name|)).
+ We can not delete the `default' value.
+
+--- delete_key(name, recursive = false)
+ Delete a subkey named ((|name|)) and all its values.
+
+ If ((|recursive|)) is false, the subkey must not have subkeys.
+ Otherwise, this method deletes all subkeys and values recursively.
+
+--- flush
+ Write all the attributes into the registry file.
+
+--- created?
+ Returns if key is created ((*newly*)).
+ (see ((<Registry.create>)))
+
+--- open?
+ Returns if key is not closed.
+
+--- hkey
+ Returns key handle value.
+
+--- parent
+ Win32::Registry object of parent key, or nil if predefeined key.
+
+--- keyname
+ Same as ((|subkey|)) value of ((<Registry.open>)) or
+ ((<Registry.create>)) method.
+
+--- disposition
+ Disposition value (REG_CREATED_NEW_KEY or REG_OPENED_EXISTING_KEY).
+
+--- name
+--- to_s
+ Full path of key such as (({'HKEY_CURRENT_USER\SOFTWARE\foo\bar'})).
+
+--- info
+ Returns key information as Array of:
+ :num_keys
+ The number of subkeys.
+ :max_key_length
+ Maximum length of name of subkeys.
+ :num_values
+ The number of values.
+ :max_value_name_length
+ Maximum length of name of values.
+ :max_value_length
+ Maximum length of value of values.
+ :descriptor_length
+ Length of security descriptor.
+ :wtime
+ Last write time as FILETIME(64-bit integer)
+
+ For detail, see ((<RegQueryInfoKey|URL:http://msdn.microsoft.com/library/en-us/sysinfo/base/regqueryinfokey.asp>)) Win32 API.
+
+--- num_keys
+--- max_key_length
+--- num_values
+--- max_value_name_length
+--- max_value_length
+--- descriptor_length
+--- wtime
+ Returns an item of key information.
+
+=== constants
+--- HKEY_CLASSES_ROOT
+--- HKEY_CURRENT_USER
+--- HKEY_LOCAL_MACHINE
+--- HKEY_PERFORMANCE_DATA
+--- HKEY_CURRENT_CONFIG
+--- HKEY_DYN_DATA
+ Win32::Registry object whose key is predefined key.
+ For detail, see ((<MSDN Library|URL:http://msdn.microsoft.com/library/en-us/sysinfo/base/predefined_keys.asp>)).
+
+== Win32::Registry::Constants module
+
+For detail, see ((<MSDN Library|URL:http://msdn.microsoft.com/library/en-us/sysinfo/base/registry.asp>)).
+
+--- HKEY_*
+ Predefined key ((*handle*)).
+ These are Integer, not Win32::Registry.
+
+--- REG_*
+ Registry value type.
+
+--- KEY_*
+ Security access mask.
+
+--- KEY_OPTIONS_*
+ Key options.
+
+--- REG_CREATED_NEW_KEY
+--- REG_OPENED_EXISTING_KEY
+ If the key is created newly or opened existing key.
+ See also Registry#((<disposition>)) method.
+
+=end
+
+require 'Win32API'
+
+module Win32
+ class Registry
+ module Constants
+ HKEY_CLASSES_ROOT = 0x80000000
+ HKEY_CURRENT_USER = 0x80000001
+ HKEY_LOCAL_MACHINE = 0x80000002
+ HKEY_USERS = 0x80000003
+ HKEY_PERFORMANCE_DATA = 0x80000004
+ HKEY_PERFORMANCE_TEXT = 0x80000050
+ HKEY_PERFORMANCE_NLSTEXT = 0x80000060
+ HKEY_CURRENT_CONFIG = 0x80000005
+ HKEY_DYN_DATA = 0x80000006
+
+ REG_NONE = 0
+ REG_SZ = 1
+ REG_EXPAND_SZ = 2
+ REG_BINARY = 3
+ REG_DWORD = 4
+ REG_DWORD_LITTLE_ENDIAN = 4
+ REG_DWORD_BIG_ENDIAN = 5
+ REG_LINK = 6
+ REG_MULTI_SZ = 7
+ REG_RESOURCE_LIST = 8
+ REG_FULL_RESOURCE_DESCRIPTOR = 9
+ REG_RESOURCE_REQUIREMENTS_LIST = 10
+ REG_QWORD = 11
+ REG_QWORD_LITTLE_ENDIAN = 11
+
+ STANDARD_RIGHTS_READ = 0x00020000
+ STANDARD_RIGHTS_WRITE = 0x00020000
+ KEY_QUERY_VALUE = 0x0001
+ KEY_SET_VALUE = 0x0002
+ KEY_CREATE_SUB_KEY = 0x0004
+ KEY_ENUMERATE_SUB_KEYS = 0x0008
+ KEY_NOTIFY = 0x0010
+ KEY_CREATE_LINK = 0x0020
+ KEY_READ = STANDARD_RIGHTS_READ |
+ KEY_QUERY_VALUE | KEY_ENUMERATE_SUB_KEYS | KEY_NOTIFY
+ KEY_WRITE = STANDARD_RIGHTS_WRITE |
+ KEY_SET_VALUE | KEY_CREATE_SUB_KEY
+ KEY_EXECUTE = KEY_READ
+ KEY_ALL_ACCESS = KEY_READ | KEY_WRITE | KEY_CREATE_LINK
+
+ REG_OPTION_RESERVED = 0x0000
+ REG_OPTION_NON_VOLATILE = 0x0000
+ REG_OPTION_VOLATILE = 0x0001
+ REG_OPTION_CREATE_LINK = 0x0002
+ REG_OPTION_BACKUP_RESTORE = 0x0004
+ REG_OPTION_OPEN_LINK = 0x0008
+ REG_LEGAL_OPTION = REG_OPTION_RESERVED |
+ REG_OPTION_NON_VOLATILE | REG_OPTION_CREATE_LINK |
+ REG_OPTION_BACKUP_RESTORE | REG_OPTION_OPEN_LINK
+
+ REG_CREATED_NEW_KEY = 1
+ REG_OPENED_EXISTING_KEY = 2
+
+ REG_WHOLE_HIVE_VOLATILE = 0x0001
+ REG_REFRESH_HIVE = 0x0002
+ REG_NO_LAZY_FLUSH = 0x0004
+ REG_FORCE_RESTORE = 0x0008
+
+ MAX_KEY_LENGTH = 514
+ MAX_VALUE_LENGTH = 32768
+ end
+ include Constants
+ include Enumerable
+
+ #
+ # Error
+ #
+ class Error < ::StandardError
+ FormatMessageA = Win32API.new('kernel32.dll', 'FormatMessageA', 'LPLLPLP', 'L')
+ def initialize(code)
+ @code = code
+ msg = "\0" * 1024
+ len = FormatMessageA.call(0x1200, 0, code, 0, msg, 1024, 0)
+ super msg[0, len].tr("\r", '').chomp
+ end
+ attr_reader :code
+ end
+
+ #
+ # Predefined Keys
+ #
+ class PredefinedKey < Registry
+ def initialize(hkey, keyname)
+ @hkey = hkey
+ @parent = nil
+ @keyname = keyname
+ @disposition = REG_OPENED_EXISTING_KEY
+ end
+
+ # Predefined keys cannot be closed
+ def close
+ raise Error.new(5) ## ERROR_ACCESS_DENIED
+ end
+
+ # Fake class for Registry#open, Registry#create
+ def class
+ Registry
+ end
+
+ # Make all
+ Constants.constants.grep(/^HKEY_/) do |c|
+ Registry.const_set c, new(Constants.const_get(c), c)
+ end
+ end
+
+ #
+ # Win32 APIs
+ #
+ module API
+ [
+ %w/RegOpenKeyExA LPLLP L/,
+ %w/RegCreateKeyExA LPLLLLPPP L/,
+ %w/RegEnumValueA LLPPPPPP L/,
+ %w/RegEnumKeyExA LLPPLLLP L/,
+ %w/RegQueryValueExA LPLPPP L/,
+ %w/RegSetValueExA LPLLPL L/,
+ %w/RegDeleteValue LP L/,
+ %w/RegDeleteKey LP L/,
+ %w/RegFlushKey L L/,
+ %w/RegCloseKey L L/,
+ %w/RegQueryInfoKey LPPPPPPPPPPP L/,
+ ].each do |fn|
+ const_set fn[0].intern, Win32API.new('advapi32.dll', *fn)
+ end
+
+ module_function
+
+ def check(result)
+ raise Error, result, caller(2) if result != 0
+ end
+
+ def packdw(dw)
+ [dw].pack('V')
+ end
+
+ def unpackdw(dw)
+ dw += [0].pack('V')
+ dw.unpack('V')[0]
+ end
+
+ def packqw(qw)
+ [ qw & 0xFFFFFFFF, qw >> 32 ].pack('VV')
+ end
+
+ def unpackqw(qw)
+ qw = qw.unpack('VV')
+ (qw[1] << 32) | qw[0]
+ end
+
+ def OpenKey(hkey, name, opt, desired)
+ result = packdw(0)
+ check RegOpenKeyExA.call(hkey, name, opt, desired, result)
+ unpackdw(result)
+ end
+
+ def CreateKey(hkey, name, opt, desired)
+ result = packdw(0)
+ disp = packdw(0)
+ check RegCreateKeyExA.call(hkey, name, 0, 0, opt, desired,
+ 0, result, disp)
+ [ unpackdw(result), unpackdw(disp) ]
+ end
+
+ def EnumValue(hkey, index)
+ name = ' ' * Constants::MAX_KEY_LENGTH
+ size = packdw(Constants::MAX_KEY_LENGTH)
+ check RegEnumValueA.call(hkey, index, name, size, 0, 0, 0, 0)
+ name[0, unpackdw(size)]
+ end
+
+ def EnumKey(hkey, index)
+ name = ' ' * Constants::MAX_KEY_LENGTH
+ size = packdw(Constants::MAX_KEY_LENGTH)
+ wtime = ' ' * 8
+ check RegEnumKeyExA.call(hkey, index, name, size, 0, 0, 0, wtime)
+ [ name[0, unpackdw(size)], unpackqw(wtime) ]
+ end
+
+ def QueryValue(hkey, name)
+ type = packdw(0)
+ size = packdw(0)
+ check RegQueryValueExA.call(hkey, name, 0, type, 0, size)
+ data = ' ' * unpackdw(size)
+ check RegQueryValueExA.call(hkey, name, 0, type, data, size)
+ [ unpackdw(type), data[0, unpackdw(size)] ]
+ end
+
+ def SetValue(hkey, name, type, data, size)
+ check RegSetValueExA.call(hkey, name, 0, type, data, size)
+ end
+
+ def DeleteValue(hkey, name)
+ check RegDeleteValue.call(hkey, name)
+ end
+
+ def DeleteKey(hkey, name)
+ check RegDeleteKey.call(hkey, name)
+ end
+
+ def FlushKey(hkey)
+ check RegFlushKey.call(hkey)
+ end
+
+ def CloseKey(hkey)
+ check RegCloseKey.call(hkey)
+ end
+
+ def QueryInfoKey(hkey)
+ subkeys = packdw(0)
+ maxsubkeylen = packdw(0)
+ values = packdw(0)
+ maxvaluenamelen = packdw(0)
+ maxvaluelen = packdw(0)
+ secdescs = packdw(0)
+ wtime = ' ' * 8
+ check RegQueryInfoKey.call(hkey, 0, 0, 0, subkeys, maxsubkeylen, 0,
+ values, maxvaluenamelen, maxvaluelen, secdescs, wtime)
+ [ unpackdw(subkeys), unpackdw(maxsubkeylen), unpackdw(values),
+ unpackdw(maxvaluenamelen), unpackdw(maxvaluelen),
+ unpackdw(secdescs), unpackqw(wtime) ]
+ end
+ end
+
+ #
+ # utility functions
+ #
+ def self.expand_environ(str)
+ str.gsub(/%([^%]+)%/) { ENV[$1] || ENV[$1.upcase] || $& }
+ end
+
+ @@type2name = { }
+ %w[
+ REG_NONE REG_SZ REG_EXPAND_SZ REG_BINARY REG_DWORD
+ REG_DWORD_BIG_ENDIAN REG_LINK REG_MULTI_SZ
+ REG_RESOURCE_LIST REG_FULL_RESOURCE_DESCRIPTOR
+ REG_RESOURCE_REQUIREMENTS_LIST REG_QWORD
+ ].each do |type|
+ @@type2name[Constants.const_get(type)] = type
+ end
+
+ def self.type2name(type)
+ @@type2name[type] || type.to_s
+ end
+
+ def self.wtime2time(wtime)
+ Time.at((wtime - 116444736000000000) / 10000000)
+ end
+
+ def self.time2wtime(time)
+ time.to_i * 10000000 + 116444736000000000
+ end
+
+ #
+ # constructors
+ #
+ private_class_method :new
+
+ def self.open(hkey, subkey, desired = KEY_READ, opt = REG_OPTION_RESERVED)
+ subkey = subkey.chomp('\\')
+ newkey = API.OpenKey(hkey.hkey, subkey, opt, desired)
+ obj = new(newkey, hkey, subkey, REG_OPENED_EXISTING_KEY)
+ if block_given?
+ begin
+ yield obj
+ ensure
+ obj.close
+ end
+ else
+ obj
+ end
+ end
+
+ def self.create(hkey, subkey, desired = KEY_ALL_ACCESS, opt = REG_OPTION_RESERVED)
+ newkey, disp = API.CreateKey(hkey.hkey, subkey, opt, desired)
+ obj = new(newkey, hkey, subkey, disp)
+ if block_given?
+ begin
+ yield obj
+ ensure
+ obj.close
+ end
+ else
+ obj
+ end
+ end
+
+ #
+ # finalizer
+ #
+ @@final = proc { |hkey| proc { API.CloseKey(hkey[0]) if hkey[0] } }
+
+ #
+ # initialize
+ #
+ def initialize(hkey, parent, keyname, disposition)
+ @hkey = hkey
+ @parent = parent
+ @keyname = keyname
+ @disposition = disposition
+ @hkeyfinal = [ hkey ]
+ ObjectSpace.define_finalizer self, @@final.call(@hkeyfinal)
+ end
+ attr_reader :hkey, :parent, :keyname, :disposition
+
+ #
+ # attributes
+ #
+ def created?
+ @disposition == REG_CREATED_NEW_KEY
+ end
+
+ def open?
+ !@hkey.nil?
+ end
+
+ def name
+ parent = self
+ name = @keyname
+ while parent = parent.parent
+ name = parent.keyname + '\\' + name
+ end
+ name
+ end
+
+ def inspect
+ "\#<Win32::Registry key=#{name.inspect}>"
+ end
+
+ #
+ # marshalling
+ #
+ def _dump(depth)
+ raise TypeError, "can't dump Win32::Registry"
+ end
+
+ #
+ # open/close
+ #
+ def open(subkey, desired = KEY_READ, opt = REG_OPTION_RESERVED, &blk)
+ self.class.open(self, subkey, desired, opt, &blk)
+ end
+
+ def create(subkey, desired = KEY_ALL_ACCESS, opt = REG_OPTION_RESERVED, &blk)
+ self.class.create(self, subkey, desired, opt, &blk)
+ end
+
+ def close
+ API.CloseKey(@hkey)
+ @hkey = @parent = @keyname = nil
+ @hkeyfinal[0] = nil
+ end
+
+ #
+ # iterator
+ #
+ def each_value
+ index = 0
+ while true
+ begin
+ subkey = API.EnumValue(@hkey, index)
+ rescue Error
+ break
+ end
+ begin
+ type, data = read(subkey)
+ rescue Error
+ next
+ end
+ yield subkey, type, data
+ index += 1
+ end
+ index
+ end
+ alias each each_value
+
+ def each_key
+ index = 0
+ while true
+ begin
+ subkey, wtime = API.EnumKey(@hkey, index)
+ rescue Error
+ break
+ end
+ yield subkey, wtime
+ index += 1
+ end
+ index
+ end
+
+ def keys
+ keys_ary = []
+ each_key { |key,| keys_ary << key }
+ keys_ary
+ end
+
+ #
+ # reader
+ #
+ def read(name, *rtype)
+ type, data = API.QueryValue(@hkey, name)
+ unless rtype.empty? or rtype.include?(type)
+ raise TypeError, "Type mismatch (expect #{rtype.inspect} but #{type} present)"
+ end
+ case type
+ when REG_SZ, REG_EXPAND_SZ
+ [ type, data.chop ]
+ when REG_MULTI_SZ
+ [ type, data.split(/\0/) ]
+ when REG_BINARY
+ [ type, data ]
+ when REG_DWORD
+ [ type, API.unpackdw(data) ]
+ when REG_DWORD_BIG_ENDIAN
+ [ type, data.unpack('N')[0] ]
+ when REG_QWORD
+ [ type, API.unpackqw(data) ]
+ else
+ raise TypeError, "Type #{type} is not supported."
+ end
+ end
+
+ def [](name, *rtype)
+ type, data = read(name, *rtype)
+ case type
+ when REG_SZ, REG_DWORD, REG_QWORD, REG_MULTI_SZ
+ data
+ when REG_EXPAND_SZ
+ Registry.expand_environ(data)
+ else
+ raise TypeError, "Type #{type} is not supported."
+ end
+ end
+
+ def read_s(name)
+ read(name, REG_SZ)[1]
+ end
+
+ def read_s_expand(name)
+ type, data = read(name, REG_SZ, REG_EXPAND_SZ)
+ if type == REG_EXPAND_SZ
+ Registry.expand_environ(data)
+ else
+ data
+ end
+ end
+
+ def read_i(name)
+ read(name, REG_DWORD, REG_DWORD_BIG_ENDIAN, REG_QWORD)[1]
+ end
+
+ def read_bin(name)
+ read(name, REG_BINARY)[1]
+ end
+
+ #
+ # writer
+ #
+ def write(name, type, data)
+ case type
+ when REG_SZ, REG_EXPAND_SZ
+ data = data.to_s + "\0"
+ when REG_MULTI_SZ
+ data = data.to_a.join("\0") + "\0\0"
+ when REG_BINARY
+ data = data.to_s
+ when REG_DWORD
+ data = API.packdw(data.to_i)
+ when REG_DWORD_BIG_ENDIAN
+ data = [data.to_i].pack('N')
+ when REG_QWORD
+ data = API.packqw(data.to_i)
+ else
+ raise TypeError, "Unsupported type #{type}"
+ end
+ API.SetValue(@hkey, name, type, data, data.length)
+ end
+
+ def []=(name, rtype, value = nil)
+ if value
+ write name, rtype, value
+ else
+ case value = rtype
+ when Integer
+ write name, REG_DWORD, value
+ when String
+ write name, REG_SZ, value
+ when Array
+ write name, REG_MULTI_SZ, value
+ else
+ raise TypeError, "Unexpected type #{value.class}"
+ end
+ end
+ value
+ end
+
+ def write_s(name, value)
+ write name, REG_SZ, value.to_s
+ end
+
+ def write_i(name, value)
+ write name, REG_DWORD, value.to_i
+ end
+
+ def write_bin(name, value)
+ write name, REG_BINARY, value.to_s
+ end
+
+ #
+ # delete
+ #
+ def delete_value(name)
+ API.DeleteValue(@hkey, name)
+ end
+ alias delete delete_value
+
+ def delete_key(name, recursive = false)
+ if recursive
+ open(name, KEY_ALL_ACCESS) do |reg|
+ reg.keys.each do |key|
+ begin
+ reg.delete_key(key, true)
+ rescue Error
+ #
+ end
+ end
+ end
+ API.DeleteKey(@hkey, name)
+ else
+ begin
+ API.EnumKey @hkey, 0
+ rescue Error
+ return API.DeleteKey(@hkey, name)
+ end
+ raise Error.new(5) ## ERROR_ACCESS_DENIED
+ end
+ end
+
+ #
+ # flush
+ #
+ def flush
+ API.FlushKey @hkey
+ end
+
+ #
+ # key information
+ #
+ def info
+ API.QueryInfoKey(@hkey)
+ end
+ %w[
+ num_keys max_key_length
+ num_values max_value_name_length max_value_length
+ descriptor_length wtime
+ ].each_with_index do |s, i|
+ eval <<-__END__
+ def #{s}
+ info[#{i}]
+ end
+ __END__
+ end
+ end
+end
diff --git a/ext/Win32API/lib/win32/resolv.rb b/ext/Win32API/lib/win32/resolv.rb
new file mode 100644
index 0000000000..92336fac28
--- /dev/null
+++ b/ext/Win32API/lib/win32/resolv.rb
@@ -0,0 +1,366 @@
+=begin
+= Win32 DNS and DHCP I/F
+
+=end
+
+require 'win32/registry'
+
+module Win32
+ module Resolv
+ API = Registry::API
+
+ def self.get_hosts_path
+ path = get_hosts_dir
+ path = File.expand_path('hosts', path)
+ File.exist?(path) ? path : nil
+ end
+
+ def self.get_resolv_info
+ search, nameserver = get_info
+ if search.empty?
+ search = nil
+ else
+ search.delete("")
+ search.uniq!
+ end
+ if nameserver.empty?
+ nameserver = nil
+ else
+ nameserver.delete("")
+ nameserver.delete("0.0.0.0")
+ nameserver.uniq!
+ end
+ [ search, nameserver ]
+ end
+
+getv = Win32API.new('kernel32.dll', 'GetVersionExA', 'P', 'L')
+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_eval <<-'__EOS__', __FILE__, __LINE__+1
+ TCPIP_NT = 'SYSTEM\CurrentControlSet\Services\Tcpip\Parameters'
+
+ class << self
+ private
+ def get_hosts_dir
+ Registry::HKEY_LOCAL_MACHINE.open(TCPIP_NT) do |reg|
+ reg.read_s_expand('DataBasePath')
+ end
+ end
+
+ def get_info
+ search = nil
+ nameserver = []
+ Registry::HKEY_LOCAL_MACHINE.open(TCPIP_NT) do |reg|
+ begin
+ slist = reg.read_s('SearchList')
+ search = slist.split(/,\s*/) unless slist.empty?
+ rescue Registry::Error
+ end
+
+ if add_search = search.nil?
+ search = []
+ begin
+ nvdom = reg.read_s('NV Domain')
+ unless nvdom.empty?
+ @search = [ nvdom ]
+ if reg.read_i('UseDomainNameDevolution') != 0
+ if /^[\w\d]+\./ =~ nvdom
+ devo = $'
+ end
+ end
+ end
+ rescue Registry::Error
+ end
+ end
+
+ reg.open('Interfaces') do |reg|
+ reg.each_key do |iface,|
+ reg.open(iface) do |regif|
+ begin
+ [ 'NameServer', 'DhcpNameServer' ].each do |key|
+ ns = regif.read_s(key)
+ unless ns.empty?
+ nameserver.concat(ns.split(/[,\s]\s*/))
+ break
+ end
+ end
+ rescue Registry::Error
+ end
+
+ if add_search
+ begin
+ [ 'Domain', 'DhcpDomain' ].each do |key|
+ dom = regif.read_s(key)
+ unless dom.empty?
+ search.concat(dom.split(/,\s*/))
+ break
+ end
+ end
+ rescue Registry::Error
+ end
+ end
+ end
+ end
+ end
+ search << devo if add_search and devo
+ end
+ [ 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
+ WsControl = Win32API.new('wsock32.dll', 'WsControl', 'LLPPPP', 'L')
+ WSAGetLastError = Win32API.new('wsock32.dll', 'WSAGetLastError', 'V', 'L')
+
+ 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/Win32API/point.rb b/ext/Win32API/point.rb
new file mode 100644
index 0000000000..60e265f3ee
--- /dev/null
+++ b/ext/Win32API/point.rb
@@ -0,0 +1,18 @@
+require 'Win32API'
+
+getCursorPos = Win32API.new("user32", "GetCursorPos", ['P'], 'V')
+
+lpPoint = " " * 8 # store two LONGs
+getCursorPos.Call(lpPoint)
+x, y = lpPoint.unpack("LL") # get the actual values
+
+print "x: ", x, "\n"
+print "y: ", y, "\n"
+
+ods = Win32API.new("kernel32", "OutputDebugString", ['P'], 'V')
+ods.Call("Hello, World\n");
+
+GetDesktopWindow = Win32API.new("user32", "GetDesktopWindow", [], 'L')
+GetActiveWindow = Win32API.new("user32", "GetActiveWindow", [], 'L')
+SendMessage = Win32API.new("user32", "SendMessage", ['L'] * 4, 'L')
+SendMessage.Call GetDesktopWindow.Call, 274, 0xf140, 0
diff --git a/ext/bigdecimal/.cvsignore b/ext/bigdecimal/.cvsignore
index 814345ece8..4088712231 100644
--- a/ext/bigdecimal/.cvsignore
+++ b/ext/bigdecimal/.cvsignore
@@ -1,4 +1,3 @@
Makefile
mkmf.log
*.def
-extconf.h
diff --git a/ext/bigdecimal/bigdecimal.c b/ext/bigdecimal/bigdecimal.c
index 0b2ac34b15..7400b313a4 100644
--- a/ext/bigdecimal/bigdecimal.c
+++ b/ext/bigdecimal/bigdecimal.c
@@ -13,7 +13,7 @@
*
*/
-#include "ruby/ruby.h"
+#include "ruby.h"
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
@@ -22,10 +22,7 @@
#include <float.h>
#include <math.h>
#include "math.h"
-
-#ifdef HAVE_IEEEFP_H
-#include <ieeefp.h>
-#endif
+#include "version.h"
/* #define ENABLE_NUMERIC_STRING */
@@ -42,7 +39,7 @@ VALUE rb_cBigDecimal;
/*
* ================== Ruby Interface part ==========================
*/
-#define DoSomeOne(x,y,f) rb_num_coerce_bin(x,y,f)
+#define DoSomeOne(x,y) rb_num_coerce_bin(x,y)
#if 0
/* BigDecimal provides arbitrary-precision floating point decimal arithmetic.
@@ -309,19 +306,17 @@ static VALUE
BigDecimal_dump(int argc, VALUE *argv, VALUE self)
{
ENTER(5);
+ char sz[50];
Real *vp;
char *psz;
VALUE dummy;
- volatile VALUE dump;
-
rb_scan_args(argc, argv, "01", &dummy);
GUARD_OBJ(vp,GetVpValue(self,1));
- dump = rb_str_new(0,VpNumOfChars(vp,"E")+50);
- psz = RSTRING_PTR(dump);
- sprintf(psz,"%lu:",VpMaxPrec(vp)*VpBaseFig());
+ sprintf(sz,"%lu:",VpMaxPrec(vp)*VpBaseFig());
+ psz = ALLOCA_N(char,(unsigned int)VpNumOfChars(vp,"E")+strlen(sz));
+ sprintf(psz,"%s",sz);
VpToString(vp, psz+strlen(psz), 0, 0);
- rb_str_resize(dump, strlen(psz));
- return dump;
+ return rb_str_new2(psz);
}
/*
@@ -414,22 +409,11 @@ BigDecimal_mode(int argc, VALUE *argv, VALUE self)
VpSetException((unsigned short)((val==Qtrue)?(fo|VP_EXCEPTION_INFINITY):
(fo&(~VP_EXCEPTION_INFINITY))));
}
- fo = VpGetException();
if(f&VP_EXCEPTION_NaN) {
VpSetException((unsigned short)((val==Qtrue)?(fo|VP_EXCEPTION_NaN):
(fo&(~VP_EXCEPTION_NaN))));
}
fo = VpGetException();
- if(f&VP_EXCEPTION_UNDERFLOW) {
- VpSetException((unsigned short)((val==Qtrue)?(fo|VP_EXCEPTION_UNDERFLOW):
- (fo&(~VP_EXCEPTION_UNDERFLOW))));
- }
- fo = VpGetException();
- if(f&VP_EXCEPTION_ZERODIVIDE) {
- VpSetException((unsigned short)((val==Qtrue)?(fo|VP_EXCEPTION_ZERODIVIDE):
- (fo&(~VP_EXCEPTION_ZERODIVIDE))));
- }
- fo = VpGetException();
return INT2FIX(fo);
}
if(VP_ROUND_MODE==f) {
@@ -526,18 +510,6 @@ BigDecimal_IsFinite(VALUE self)
return Qtrue;
}
-static void
-BigDecimal_check_num(Real *p)
-{
- if(VpIsNaN(p)) {
- VpException(VP_EXCEPTION_NaN,"Computation results to 'NaN'(Not a Number)",1);
- } else if(VpIsPosInf(p)) {
- VpException(VP_EXCEPTION_INFINITY,"Computation results to 'Infinity'",1);
- } else if(VpIsNegInf(p)) {
- VpException(VP_EXCEPTION_INFINITY,"Computation results to '-Infinity'",1);
- }
-}
-
/* Returns the value as an integer (Fixnum or Bignum).
*
* If the BigNumber is infinity or NaN, returns nil.
@@ -548,12 +520,22 @@ BigDecimal_to_i(VALUE self)
ENTER(5);
int e,n,i,nf;
U_LONG v,b,j;
- volatile VALUE str;
char *psz,*pch;
Real *p;
GUARD_OBJ(p,GetVpValue(self,1));
- BigDecimal_check_num(p);
+
+ /* Infinity or NaN not converted. */
+ if(VpIsNaN(p)) {
+ VpException(VP_EXCEPTION_NaN,"Computation results to 'NaN'(Not a Number)",0);
+ return Qnil;
+ } else if(VpIsPosInf(p)) {
+ VpException(VP_EXCEPTION_INFINITY,"Computation results to 'Infinity'",0);
+ return Qnil;
+ } else if(VpIsNegInf(p)) {
+ VpException(VP_EXCEPTION_INFINITY,"Computation results to '-Infinity'",0);
+ return Qnil;
+ }
e = VpExponent10(p);
if(e<=0) return INT2FIX(0);
@@ -562,8 +544,7 @@ BigDecimal_to_i(VALUE self)
e = VpGetSign(p)*p->frac[0];
return INT2FIX(e);
}
- str = rb_str_new(0, e+nf+2);
- psz = RSTRING_PTR(str);
+ psz = ALLOCA_N(char,(unsigned int)(e+nf+2));
n = (e+nf-1)/nf;
pch = psz;
@@ -589,6 +570,13 @@ BigDecimal_to_i(VALUE self)
return rb_cstr2inum(psz,10);
}
+static VALUE
+BigDecimal_induced_from(VALUE self, VALUE x)
+{
+ Real *p = GetVpValue(x,1);
+ return p->obj;
+}
+
/* Returns a new Float object having approximately the same value as the
* BigDecimal number. Normal accuracy limits and built-in errors of binary
* Float arithmetic apply.
@@ -601,62 +589,21 @@ BigDecimal_to_f(VALUE self)
double d;
S_LONG e;
char *buf;
- volatile VALUE str;
GUARD_OBJ(p,GetVpValue(self,1));
- if (VpVtoD(&d, &e, p)!=1) return rb_float_new(d);
- if (e > DBL_MAX_10_EXP+BASE_FIG) goto erange;
- str = rb_str_new(0, VpNumOfChars(p,"E"));
- buf = RSTRING_PTR(str);
+ if(VpVtoD(&d, &e, p)!=1) return rb_float_new(d);
+ buf = ALLOCA_N(char,(unsigned int)VpNumOfChars(p,"E"));
VpToString(p, buf, 0, 0);
errno = 0;
d = strtod(buf, 0);
if(errno == ERANGE) {
- erange:
VpException(VP_EXCEPTION_OVERFLOW,"BigDecimal to Float conversion",0);
- if(d>0.0) d = VpGetDoublePosInf();
- else d = VpGetDoubleNegInf();
+ if(d>0.0) return rb_float_new(DBL_MAX);
+ else return rb_float_new(-DBL_MAX);
}
return rb_float_new(d);
}
-
-static VALUE BigDecimal_split(VALUE self);
-
-/* Converts a BigDecimal to a Rational.
- */
-static VALUE
-BigDecimal_to_r(VALUE self)
-{
- Real *p;
- S_LONG sign, power, denomi_power;
- VALUE a, digits, numerator;
-
- p = GetVpValue(self,1);
- BigDecimal_check_num(p);
-
- sign = VpGetSign(p);
- power = VpExponent10(p);
- a = BigDecimal_split(self);
- digits = RARRAY_PTR(a)[1];
- denomi_power = power - RSTRING_LEN(digits);
- numerator = rb_funcall(digits, rb_intern("to_i"), 0);
-
- if (sign < 0) {
- numerator = rb_funcall(numerator, '*', 1, INT2FIX(-1));
- }
- if (denomi_power < 0) {
- return rb_Rational(numerator,
- rb_funcall(INT2FIX(10), rb_intern("**"), 1,
- INT2FIX(-denomi_power)));
- }
- else {
- return rb_Rational1(rb_funcall(numerator, '*', 1,
- rb_funcall(INT2FIX(10), rb_intern("**"), 1,
- INT2FIX(denomi_power))));
- }
-}
-
/* The coerce method provides support for Ruby type coercion. It is not
* enabled by default.
*
@@ -677,16 +624,11 @@ BigDecimal_coerce(VALUE self, VALUE other)
ENTER(2);
VALUE obj;
Real *b;
- switch (TYPE(other)) {
- case T_FLOAT:
- obj = rb_assoc_new(other, BigDecimal_to_f(self));
- break;
- case T_RATIONAL:
- obj = rb_assoc_new(other, BigDecimal_to_r(self));
- break;
- default:
- GUARD_OBJ(b,GetVpValue(other,1));
- obj = rb_assoc_new(b->obj, self);
+ if(TYPE(other) == T_FLOAT) {
+ obj = rb_assoc_new(other, BigDecimal_to_f(self));
+ } else {
+ GUARD_OBJ(b,GetVpValue(other,1));
+ obj = rb_assoc_new(b->obj, self);
}
return obj;
}
@@ -716,7 +658,7 @@ BigDecimal_add(VALUE self, VALUE r)
U_LONG mx;
GUARD_OBJ(a,GetVpValue(self,1));
b = GetVpValue(r,0);
- if(!b) return DoSomeOne(self,r,'+');
+ if(!b) return DoSomeOne(self,r);
SAVE(b);
if(VpIsNaN(b)) return b->obj;
if(VpIsNaN(a)) return a->obj;
@@ -755,7 +697,7 @@ BigDecimal_sub(VALUE self, VALUE r)
GUARD_OBJ(a,GetVpValue(self,1));
b = GetVpValue(r,0);
- if(!b) return DoSomeOne(self,r,'-');
+ if(!b) return DoSomeOne(self,r);
SAVE(b);
if(VpIsNaN(b)) return b->obj;
@@ -784,20 +726,7 @@ BigDecimalCmp(VALUE self, VALUE r,char op)
Real *a, *b;
GUARD_OBJ(a,GetVpValue(self,1));
b = GetVpValue(r,0);
- if(!b) {
- ID f = 0;
-
- switch(op)
- {
- case '*': f = rb_intern("<=>");break;
- case '=': f = rb_intern("=="); break;
- case '!': f = rb_intern("!="); break;
- case 'G': f = rb_intern(">="); break;
- case 'L': f = rb_intern("<="); break;
- case '>': case '<': f = (ID)op; break;
- }
- return rb_num_coerce_cmp(self,r,f);
- }
+ if(!b) return rb_num_coerce_cmp(self,r);
SAVE(b);
e = VpComp(a, b);
if(e==999) return Qnil;
@@ -934,7 +863,7 @@ BigDecimal_mult(VALUE self, VALUE r)
GUARD_OBJ(a,GetVpValue(self,1));
b = GetVpValue(r,0);
- if(!b) return DoSomeOne(self,r,'*');
+ if(!b) return DoSomeOne(self,r);
SAVE(b);
mx = a->Prec + b->Prec;
@@ -953,7 +882,7 @@ BigDecimal_divide(Real **c, Real **res, Real **div, VALUE self, VALUE r)
GUARD_OBJ(a,GetVpValue(self,1));
b = GetVpValue(r,0);
- if(!b) return DoSomeOne(self,r,'/');
+ if(!b) return DoSomeOne(self,r);
SAVE(b);
*div = b;
mx =(a->MaxPrec + b->MaxPrec + 1) * VpBaseFig();
@@ -1014,14 +943,12 @@ BigDecimal_DoDivmod(VALUE self, VALUE r, Real **div, Real **mod)
GUARD_OBJ(a,GetVpValue(self,1));
b = GetVpValue(r,0);
- if(!b) return DoSomeOne(self,r,rb_intern("divmod"));
+ if(!b) return DoSomeOne(self,r);
SAVE(b);
if(VpIsNaN(a) || VpIsNaN(b)) goto NaN;
if(VpIsInf(a) || VpIsInf(b)) goto NaN;
- if(VpIsZero(b)) {
- rb_raise(rb_eZeroDivError, "divided by 0");
- }
+ if(VpIsZero(b)) goto NaN;
if(VpIsZero(a)) {
GUARD_OBJ(c,VpCreateRbObject(1, "0"));
GUARD_OBJ(d,VpCreateRbObject(1, "0"));
@@ -1089,7 +1016,7 @@ BigDecimal_divremain(VALUE self, VALUE r, Real **dv, Real **rv)
GUARD_OBJ(a,GetVpValue(self,1));
b = GetVpValue(r,0);
- if(!b) return DoSomeOne(self,r,rb_intern("remainder"));
+ if(!b) return DoSomeOne(self,r);
SAVE(b);
mx =(a->MaxPrec + b->MaxPrec) *VpBaseFig();
@@ -1162,7 +1089,7 @@ BigDecimal_divmod(VALUE self, VALUE r)
obj = BigDecimal_DoDivmod(self,r,&div,&mod);
if(obj!=(VALUE)0) return obj;
SAVE(div);SAVE(mod);
- obj = rb_assoc_new(BigDecimal_to_i(ToValue(div)), ToValue(mod));
+ obj = rb_assoc_new(ToValue(div), ToValue(mod));
return obj;
}
@@ -1178,7 +1105,7 @@ BigDecimal_div2(int argc, VALUE *argv, VALUE self)
Real *mod;
obj = BigDecimal_DoDivmod(self,b,&div,&mod);
if(obj!=(VALUE)0) return obj;
- return BigDecimal_to_i(ToValue(div));
+ return ToValue(div);
} else { /* div in BigDecimal sense */
U_LONG ix = (U_LONG)GetPositiveInt(n);
if(ix==0) return BigDecimal_div(self,b);
@@ -1376,9 +1303,6 @@ BigDecimal_round(int argc, VALUE *argv, VALUE self)
GUARD_OBJ(c,VpCreateRbObject(mx, "0"));
VpSetPrecLimit(pl);
VpActiveRound(c,a,sw,iLoc);
- if (argc == 0) {
- return BigDecimal_to_i(ToValue(c));
- }
return ToValue(c);
}
@@ -1423,9 +1347,6 @@ BigDecimal_truncate(int argc, VALUE *argv, VALUE self)
GUARD_OBJ(c,VpCreateRbObject(mx, "0"));
VpSetPrecLimit(pl);
VpActiveRound(c,a,VP_ROUND_DOWN,iLoc); /* 0: truncate */
- if (argc == 0) {
- return BigDecimal_to_i(ToValue(c));
- }
return ToValue(c);
}
@@ -1486,9 +1407,6 @@ BigDecimal_floor(int argc, VALUE *argv, VALUE self)
GUARD_OBJ(c,VpCreateRbObject(mx, "0"));
VpSetPrecLimit(pl);
VpActiveRound(c,a,VP_ROUND_FLOOR,iLoc);
- if (argc == 0) {
- return BigDecimal_to_i(ToValue(c));
- }
return ToValue(c);
}
@@ -1533,9 +1451,6 @@ BigDecimal_ceil(int argc, VALUE *argv, VALUE self)
GUARD_OBJ(c,VpCreateRbObject(mx, "0"));
VpSetPrecLimit(pl);
VpActiveRound(c,a,VP_ROUND_CEIL,iLoc);
- if (argc == 0) {
- return BigDecimal_to_i(ToValue(c));
- }
return ToValue(c);
}
@@ -1576,7 +1491,6 @@ BigDecimal_to_s(int argc, VALUE *argv, VALUE self)
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;
U_LONG nc;
@@ -1613,16 +1527,14 @@ BigDecimal_to_s(int argc, VALUE *argv, VALUE self)
}
if(mc>0) nc += (nc + mc - 1) / mc + 1;
- str = rb_str_new(0, nc);
- psz = RSTRING_PTR(str);
+ psz = ALLOCA_N(char,(unsigned int)nc);
if(fmt) {
VpToFString(vp, psz, mc, fPlus);
} else {
VpToString (vp, psz, mc, fPlus);
}
- rb_str_resize(str, strlen(psz));
- return str;
+ return rb_str_new2(psz);
}
/* Splits a BigDecimal number into four parts, returned as an array of values.
@@ -1654,29 +1566,24 @@ BigDecimal_split(VALUE self)
{
ENTER(5);
Real *vp;
- VALUE obj,str;
+ VALUE obj,obj1;
S_LONG e;
S_LONG s;
char *psz1;
GUARD_OBJ(vp,GetVpValue(self,1));
- str = rb_str_new(0, VpNumOfChars(vp,"E"));
- psz1 = RSTRING_PTR(str);
+ psz1 = ALLOCA_N(char,(unsigned int)VpNumOfChars(vp,"E"));
VpSzMantissa(vp,psz1);
s = 1;
if(psz1[0]=='-') {
- int len = strlen(psz1+1);
-
- memmove(psz1, psz1+1, len);
- psz1[len] = '\0';
- s = -1;
+ s = -1; ++psz1;
}
if(psz1[0]=='N') s=0; /* NaN */
e = VpExponent10(vp);
+ obj1 = rb_str_new2(psz1);
obj = rb_ary_new2(4);
rb_ary_push(obj, INT2FIX(s));
- rb_ary_push(obj, str);
- rb_str_resize(str, strlen(psz1));
+ rb_ary_push(obj, obj1);
rb_ary_push(obj, INT2FIX(10));
rb_ary_push(obj, INT2NUM(e));
return obj;
@@ -1709,22 +1616,20 @@ BigDecimal_inspect(VALUE self)
{
ENTER(5);
Real *vp;
- volatile VALUE obj;
+ VALUE obj;
unsigned int nc;
- char *psz, *tmp;
+ char *psz1;
+ char *pszAll;
GUARD_OBJ(vp,GetVpValue(self,1));
nc = VpNumOfChars(vp,"E");
nc +=(nc + 9) / 10;
- obj = rb_str_new(0, nc+256);
- psz = RSTRING_PTR(obj);
- sprintf(psz,"#<BigDecimal:%lx,'",self);
- tmp = psz + strlen(psz);
- VpToString(vp, tmp, 10, 0);
- tmp += strlen(tmp);
- sprintf(tmp,"',%lu(%lu)>",VpPrec(vp)*VpBaseFig(),VpMaxPrec(vp)*VpBaseFig());
- rb_str_resize(obj, strlen(psz));
+ psz1 = ALLOCA_N(char,nc);
+ pszAll = ALLOCA_N(char,nc+256);
+ VpToString(vp, psz1, 10, 0);
+ sprintf(pszAll,"#<BigDecimal:%lx,'%s',%lu(%lu)>",self,psz1,VpPrec(vp)*VpBaseFig(),VpMaxPrec(vp)*VpBaseFig());
+ obj = rb_str_new2(pszAll);
return obj;
}
@@ -1818,7 +1723,7 @@ BigDecimal_new(int argc, VALUE *argv, VALUE self)
*
* A limit of 0, the default, means no upper limit.
*
- * The limit specified by this method takes less priority over any limit
+ * The limit specified by this method takes priority over any limit
* specified to instance methods such as ceil, floor, truncate, or round.
*/
static VALUE
@@ -1880,6 +1785,7 @@ Init_bigdecimal(void)
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, "induced_from",BigDecimal_induced_from, 1);
rb_define_singleton_method(rb_cBigDecimal, "_load", BigDecimal_load, 1);
rb_define_singleton_method(rb_cBigDecimal, "ver", BigDecimal_version, 0);
@@ -1922,7 +1828,7 @@ Init_bigdecimal(void)
/*
* 0x01: Determines what happens when the result of a computation is an
- * overflow (a result too large to be represented). See BigDecimal.mode.
+ * underflow (a result too large to be represented). See BigDecimal.mode.
*/
rb_define_const(rb_cBigDecimal, "EXCEPTION_OVERFLOW",INT2FIX(VP_EXCEPTION_OVERFLOW));
@@ -1993,12 +1899,11 @@ Init_bigdecimal(void)
rb_define_method(rb_cBigDecimal, "add", BigDecimal_add2, 2);
rb_define_method(rb_cBigDecimal, "sub", BigDecimal_sub2, 2);
rb_define_method(rb_cBigDecimal, "mult", BigDecimal_mult2, 2);
- rb_define_method(rb_cBigDecimal, "div", BigDecimal_div2, -1);
+ rb_define_method(rb_cBigDecimal, "div",BigDecimal_div2, -1);
rb_define_method(rb_cBigDecimal, "hash", BigDecimal_hash, 0);
rb_define_method(rb_cBigDecimal, "to_s", BigDecimal_to_s, -1);
rb_define_method(rb_cBigDecimal, "to_i", BigDecimal_to_i, 0);
rb_define_method(rb_cBigDecimal, "to_int", BigDecimal_to_i, 0);
- rb_define_method(rb_cBigDecimal, "to_r", BigDecimal_to_r, 0);
rb_define_method(rb_cBigDecimal, "split", BigDecimal_split, 0);
rb_define_method(rb_cBigDecimal, "+", BigDecimal_add, 1);
rb_define_method(rb_cBigDecimal, "-", BigDecimal_sub, 1);
@@ -2053,10 +1958,8 @@ Init_bigdecimal(void)
*
*/
#ifdef _DEBUG
-static int gfDebug = 1; /* Debug switch */
-#if 0
+/*static int gfDebug = 1;*/ /* Debug switch */
static int gfCheckVal = 1; /* Value checking flag in VpNmlz() */
-#endif
#endif /* _DEBUG */
static U_LONG gnPrecLimit = 0; /* Global upper limit of the precision newly allocated */
@@ -2176,9 +2079,9 @@ VpGetRoundMode(void)
VP_EXPORT int
VpIsRoundMode(unsigned long n)
{
- if(n==VP_ROUND_UP || n==VP_ROUND_DOWN ||
- n==VP_ROUND_HALF_UP || n==VP_ROUND_HALF_DOWN ||
- n==VP_ROUND_CEIL || n==VP_ROUND_FLOOR ||
+ if(n==VP_ROUND_UP || n!=VP_ROUND_DOWN ||
+ n==VP_ROUND_HALF_UP || n!=VP_ROUND_HALF_DOWN ||
+ n==VP_ROUND_CEIL || n!=VP_ROUND_FLOOR ||
n==VP_ROUND_HALF_EVEN
) return 1;
return 0;
@@ -2277,14 +2180,12 @@ VpGetDoubleNegZero(void) /* Returns the value of -0 */
return nzero;
}
-#if 0 /* unused */
VP_EXPORT int
VpIsNegDoubleZero(double v)
{
double z = VpGetDoubleNegZero();
return MemCmp(&v,&z,sizeof(v))==0;
}
-#endif
VP_EXPORT int
VpException(unsigned short f, const char *str,int always)
@@ -2298,12 +2199,18 @@ VpException(unsigned short f, const char *str,int always)
switch(f)
{
/*
+ case VP_EXCEPTION_ZERODIVIDE:
case VP_EXCEPTION_OVERFLOW:
*/
- case VP_EXCEPTION_ZERODIVIDE:
case VP_EXCEPTION_INFINITY:
+ exc = rb_eFloatDomainError;
+ goto raise;
case VP_EXCEPTION_NaN:
+ exc = rb_eFloatDomainError;
+ goto raise;
case VP_EXCEPTION_UNDERFLOW:
+ exc = rb_eFloatDomainError;
+ goto raise;
case VP_EXCEPTION_OP:
exc = rb_eFloatDomainError;
goto raise;
@@ -2509,8 +2416,8 @@ VpInit(U_LONG BaseVal)
printf(" BASE = %lu\n", BASE);
printf(" HALF_BASE = %lu\n", HALF_BASE);
printf(" BASE1 = %lu\n", BASE1);
- printf(" BASE_FIG = %d\n", BASE_FIG);
- printf(" DBLE_FIG = %d\n", DBLE_FIG);
+ printf(" BASE_FIG = %lu\n", BASE_FIG);
+ printf(" DBLE_FIG = %lu\n", DBLE_FIG);
}
#endif /* _DEBUG */
@@ -2575,7 +2482,6 @@ VpAlloc(U_LONG mx, const char *szVal)
int sign=1;
Real *vp = NULL;
U_LONG mf = VpGetPrecLimit();
- volatile VALUE buf;
mx = (mx + BASE_FIG - 1) / BASE_FIG + 1; /* Determine allocation unit. */
if(szVal) {
@@ -2603,8 +2509,7 @@ VpAlloc(U_LONG mx, const char *szVal)
/* Skip all '_' after digit: 2006-6-30 */
ni = 0;
- buf = rb_str_new(0,strlen(szVal)+1);
- psz = RSTRING_PTR(buf);
+ psz = ALLOCA_N(char,strlen(szVal)+1);
i = 0;
ipn = 0;
while((psz[i]=szVal[ipn])!=0) {
@@ -3241,10 +3146,7 @@ VpMult(Real *c, Real *a, Real *b)
/* set LHSV c info */
c->exponent = a->exponent; /* set exponent */
- if(!AddExponent(c,b->exponent)) {
- if(w) VpFree(c);
- return 0;
- }
+ if(!AddExponent(c,b->exponent)) return 0;
VpSetSign(c,VpGetSign(a)*VpGetSign(b)); /* set sign */
Carry = 0;
nc = ind_c = MxIndAB;
@@ -3660,7 +3562,7 @@ Exit:
* a ... VP variable to be printed
*/
VP_EXPORT int
-VPrint(FILE *fp, const char *cntl_chr, Real *a)
+VPrint(FILE *fp, char *cntl_chr, Real *a)
{
U_LONG i, j, nc, nd, ZeroSup;
U_LONG n, m, e, nn;
@@ -3699,12 +3601,12 @@ VPrint(FILE *fp, const char *cntl_chr, Real *a)
nc += fprintf(fp, "0.");
n = a->Prec;
for(i=0;i < n;++i) {
- m = BASE1;
+ m = BASE1;
e = a->frac[i];
while(m) {
nn = e / m;
if((!ZeroSup) || nn) {
- nc += fprintf(fp, "%lu", nn); /* The leading zero(s) */
+ nc += fprintf(fp, "%lu", nn); /* The reading zero(s) */
/* as 0.00xx will not */
/* be printed. */
++nd;
@@ -3826,7 +3728,7 @@ VpSzMantissa(Real *a,char *psz)
while(m) {
nn = e / m;
if((!ZeroSup) || nn) {
- sprintf(psz, "%lu", nn); /* The leading zero(s) */
+ sprintf(psz, "%lu", nn); /* The reading zero(s) */
psz += strlen(psz);
/* as 0.00xx will be ignored. */
ZeroSup = 0; /* Set to print succeeding zeros */
@@ -4015,12 +3917,7 @@ VpCtoV(Real *a, const char *int_chr, U_LONG ni, const char *frac, U_LONG nf, con
es = e*((S_INT)BASE_FIG);
e = e * 10 + exp_chr[i] - '0';
if(es>e*((S_INT)BASE_FIG)) {
- VpException(VP_EXCEPTION_INFINITY,"exponent overflow",0);
- sign = 1;
- if(int_chr[0] == '-') sign = -1;
- if(signe > 0) VpSetInf(a, sign);
- else VpSetZero(a, sign);
- return 1;
+ return VpException(VP_EXCEPTION_INFINITY,"exponent overflow",0);
}
++i;
}
@@ -4181,7 +4078,7 @@ Exit:
if(gfDebug) {
VPrint(stdout, " VpVtoD: m=%\n", m);
printf(" d=%e * 10 **%ld\n", *d, *e);
- printf(" DBLE_FIG = %d\n", DBLE_FIG);
+ printf(" DBLE_FIG = %ld\n", DBLE_FIG);
}
#endif /*_DEBUG */
return f;
@@ -4260,7 +4157,6 @@ Exit:
/*
* m <- ival
*/
-#if 0 /* unused */
VP_EXPORT void
VpItoV(Real *m, S_INT ival)
{
@@ -4318,7 +4214,6 @@ Exit:
#endif /* _DEBUG */
return;
}
-#endif
/*
* y = SQRT(x), y*y - x =>0
@@ -4429,6 +4324,7 @@ Exit:
/*
*
+ * f = 0: Round off/Truncate, 1: round up, 2:ceil, 3: floor, 4: Banker's rounding
* nf: digit position for operation.
*
*/
@@ -4457,14 +4353,12 @@ VpMidRound(Real *y, int f, int nf)
exptoadd = -nf;
nf = 0;
}
-
/* ix: x->fraq[ix] contains round position */
ix = nf/(int)BASE_FIG;
- if(((U_LONG)ix)>=y->Prec) return 0; /* rounding position too right(small). */
+ if(((U_LONG)ix)>=y->Prec) return 0; /* Unable to round */
ioffset = nf - ix*((int)BASE_FIG);
v = y->frac[ix];
-
/* drop digits after pointed digit */
n = BASE_FIG - ioffset - 1;
for(shifter=1,i=0;i<n;++i) shifter *= 10;
@@ -4709,20 +4603,8 @@ VpPower(Real *y, Real *x, S_INT n)
}
goto Exit;
}
- if(VpIsNaN(x)) {
- VpSetNaN(y);
- goto Exit;
- }
- if(VpIsInf(x)) {
- if(n==0) {
- VpSetOne(y);
- goto Exit;
- }
- if(n>0) {
- VpSetInf(y, (n%2==0 || VpIsPosInf(x)) ? 1 : -1);
- goto Exit;
- }
- VpSetZero(y, (n%2==0 || VpIsPosInf(x)) ? 1 : -1);
+ if(!VpIsDef(x)) {
+ VpSetNaN(y); /* Not sure !!! */
goto Exit;
}
diff --git a/ext/bigdecimal/bigdecimal.h b/ext/bigdecimal/bigdecimal.h
index c8a1feb30e..4f77feab00 100644
--- a/ext/bigdecimal/bigdecimal.h
+++ b/ext/bigdecimal/bigdecimal.h
@@ -45,7 +45,7 @@ extern "C" {
#define VP_EXCEPTION_NaN ((unsigned short)0x0002)
#define VP_EXCEPTION_UNDERFLOW ((unsigned short)0x0004)
#define VP_EXCEPTION_OVERFLOW ((unsigned short)0x0001) /* 0x0008) */
-#define VP_EXCEPTION_ZERODIVIDE ((unsigned short)0x0010)
+#define VP_EXCEPTION_ZERODIVIDE ((unsigned short)0x0001) /* 0x0010) */
/* Following 2 exceptions cann't controlled by user */
#define VP_EXCEPTION_OP ((unsigned short)0x0020)
@@ -127,9 +127,7 @@ VP_EXPORT unsigned long VpGetRoundMode(void);
VP_EXPORT unsigned long VpSetRoundMode(unsigned long n);
VP_EXPORT int VpException(unsigned short f,const char *str,int always);
-#if 0 /* unused */
VP_EXPORT int VpIsNegDoubleZero(double v);
-#endif
VP_EXPORT U_LONG VpNumOfChars(Real *vp,const char *pszFmt);
VP_EXPORT U_LONG VpInit(U_LONG BaseVal);
VP_EXPORT void *VpMemAlloc(U_LONG mb);
@@ -148,9 +146,7 @@ VP_EXPORT void VpToFString(Real *a,char *psz,int fFmt,int fPlus);
VP_EXPORT int VpCtoV(Real *a,const char *int_chr,U_LONG ni,const char *frac,U_LONG nf,const char *exp_chr,U_LONG ne);
VP_EXPORT int VpVtoD(double *d,S_LONG *e,Real *m);
VP_EXPORT void VpDtoV(Real *m,double d);
-#if 0 /* unused */
VP_EXPORT void VpItoV(Real *m,S_INT ival);
-#endif
VP_EXPORT int VpSqrt(Real *y,Real *x);
VP_EXPORT int VpActiveRound(Real *y,Real *x,int f,int il);
VP_EXPORT int VpMidRound(Real *y, int f, int nf);
@@ -211,7 +207,7 @@ VP_EXPORT Real *VpOne(void);
#define VpExponent(a) (a->exponent)
#ifdef _DEBUG
int VpVarCheck(Real * v);
-VP_EXPORT int VPrint(FILE *fp,const char *cntl_chr,Real *a);
+VP_EXPORT int VPrint(FILE *fp,char *cntl_chr,Real *a);
#endif /* _DEBUG */
#if defined(__cplusplus)
diff --git a/ext/bigdecimal/lib/bigdecimal/jacobian.rb b/ext/bigdecimal/lib/bigdecimal/jacobian.rb
index 8c36ad14fc..d80eeab901 100644
--- a/ext/bigdecimal/lib/bigdecimal/jacobian.rb
+++ b/ext/bigdecimal/lib/bigdecimal/jacobian.rb
@@ -52,7 +52,7 @@ module Jacobian
s = f.zero
deriv = []
if(nRetry>100) then
- raise "Singular Jacobian matrix. No change at x[" + i.to_s + "]"
+ raize "Singular Jacobian matrix. No change at x[" + i.to_s + "]"
end
dx = dx*f.two
x[i] += dx
diff --git a/ext/bigdecimal/lib/bigdecimal/ludcmp.rb b/ext/bigdecimal/lib/bigdecimal/ludcmp.rb
index 176ed84caf..8f4888725e 100644
--- a/ext/bigdecimal/lib/bigdecimal/ludcmp.rb
+++ b/ext/bigdecimal/lib/bigdecimal/ludcmp.rb
@@ -17,7 +17,7 @@ module LUSolve
end
if nrmrow>zero then
scales <<= one.div(nrmrow,prec)
- else
+ else
raise "Singular matrix"
end
end
diff --git a/ext/bigdecimal/lib/bigdecimal/math.rb b/ext/bigdecimal/lib/bigdecimal/math.rb
index 24e928b901..f3248a3c5c 100644
--- a/ext/bigdecimal/lib/bigdecimal/math.rb
+++ b/ext/bigdecimal/lib/bigdecimal/math.rb
@@ -30,10 +30,10 @@
#
module BigMath
- # Computes the square root of x to the specified number of digits of
+ # Computes the square root of x to the specified number of digits of
# precision.
#
- # BigDecimal.new('2').sqrt(16).to_s
+ # BigDecimal.new('2').sqrt(16).to_s
# -> "0.14142135623730950488016887242096975E1"
#
def sqrt(x,prec)
@@ -120,7 +120,7 @@ module BigMath
y
end
- # Computes the value of e (the base of natural logarithms) raised to the
+ # Computes the value of e (the base of natural logarithms) raised to the
# power of x, to the specified number of digits of precision.
#
# If x is infinite or NaN, returns NaN.
@@ -148,7 +148,7 @@ module BigMath
y
end
- # Computes the natural logarithm of x to the specified number of digits
+ # Computes the natural logarithm of x to the specified number of digits
# of precision.
#
# Returns x if x is infinite or NaN.
diff --git a/ext/bigdecimal/lib/bigdecimal/newton.rb b/ext/bigdecimal/lib/bigdecimal/newton.rb
index d78c3d7647..59ac0f7f04 100644
--- a/ext/bigdecimal/lib/bigdecimal/newton.rb
+++ b/ext/bigdecimal/lib/bigdecimal/newton.rb
@@ -1,5 +1,5 @@
#
-# newton.rb
+# newton.rb
#
# Solves the nonlinear algebraic equation system f = 0 by Newton's method.
# This program is not dependent on BigDecimal.
@@ -28,7 +28,7 @@ require "bigdecimal/jacobian"
module Newton
include LUSolve
include Jacobian
-
+
def norm(fv,zero=0.0)
s = zero
n = fv.size
diff --git a/ext/bigdecimal/lib/bigdecimal/util.rb b/ext/bigdecimal/lib/bigdecimal/util.rb
index 257781f035..09e926acd5 100644
--- a/ext/bigdecimal/lib/bigdecimal/util.rb
+++ b/ext/bigdecimal/lib/bigdecimal/util.rb
@@ -39,6 +39,18 @@ class BigDecimal < Numeric
i + "." + ("0"*(-z)) + f
end
end
+
+ # Converts a BigDecimal to a Rational.
+ def to_r
+ sign,digits,base,power = self.split
+ numerator = sign*digits.to_i
+ denomi_power = power - digits.size # base is always 10
+ if denomi_power < 0
+ Rational(numerator,base ** (-denomi_power))
+ else
+ Rational(numerator * (base ** denomi_power),1)
+ end
+ end
end
class Rational < Numeric
diff --git a/ext/continuation/continuation.c b/ext/continuation/continuation.c
deleted file mode 100644
index ae69b66cd8..0000000000
--- a/ext/continuation/continuation.c
+++ /dev/null
@@ -1,8 +0,0 @@
-
-void ruby_Init_Continuation_body(void);
-
-void
-Init_continuation(void)
-{
- ruby_Init_Continuation_body();
-}
diff --git a/ext/continuation/extconf.rb b/ext/continuation/extconf.rb
deleted file mode 100644
index 17e2d056db..0000000000
--- a/ext/continuation/extconf.rb
+++ /dev/null
@@ -1,3 +0,0 @@
-require 'mkmf'
-create_makefile('continuation')
-
diff --git a/ext/coverage/coverage.c b/ext/coverage/coverage.c
deleted file mode 100644
index 145be1834d..0000000000
--- a/ext/coverage/coverage.c
+++ /dev/null
@@ -1,101 +0,0 @@
-/************************************************
-
- coverage.c -
-
- $Author: $
-
- Copyright (c) 2008 Yusuke Endoh
-
-************************************************/
-
-#include "ruby.h"
-
-extern VALUE rb_get_coverages(void);
-extern void rb_set_coverages(VALUE);
-extern void rb_reset_coverages(void);
-
-/*
- * call-seq:
- * Coverage.start => nil
- *
- * Enables coverage measurement.
- */
-static VALUE
-rb_coverage_start(VALUE klass)
-{
- if (!RTEST(rb_get_coverages())) {
- VALUE coverages = rb_hash_new();
- RBASIC(coverages)->klass = 0;
- rb_set_coverages(coverages);
- }
- return Qnil;
-}
-
-static int
-coverage_result_i(st_data_t key, st_data_t val, st_data_t dummy)
-{
- VALUE coverage = (VALUE)val;
- RBASIC(coverage)->klass = rb_cArray;
- rb_ary_freeze(coverage);
- return ST_CONTINUE;
-}
-
-/*
- * call-seq:
- * Coverage.result => hash
- *
- * Returns a hash that contains filename as key and coverage array as value
- * and disables coverage measurement.
- */
-static VALUE
-rb_coverage_result(VALUE klass)
-{
- VALUE coverages = rb_get_coverages();
- if (!RTEST(coverages)) {
- rb_raise(rb_eRuntimeError, "coverage measurement is not enabled");
- }
- RBASIC(coverages)->klass = rb_cHash;
- st_foreach(RHASH_TBL(coverages), coverage_result_i, 0);
- rb_hash_freeze(coverages);
- rb_reset_coverages();
- return coverages;
-}
-
-/* Coverage provides coverage measurement feature for Ruby.
- * This feature is experimental, so these APIs may be changed in future.
- *
- * = Usage
- *
- * (1) require "coverage.so"
- * (2) do Coverage.start
- * (3) require or load Ruby source file
- * (4) Coverage.result will return a hash that contains filename as key and
- * coverage array as value.
- *
- * = Example
- *
- * [foo.rb]
- * s = 0
- * 10.times do |x|
- * s += x
- * end
- *
- * if s == 45
- * p :ok
- * else
- * p :ng
- * end
- * [EOF]
- *
- * require "coverage.so"
- * Coverage.start
- * require "foo.rb"
- * p Coverage.result #=> {"foo.rb"=>[1, 1, 10, nil, nil, 1, 1, nil, 0, nil]}
- */
-void
-Init_coverage(void)
-{
- VALUE rb_mCoverage = rb_define_module("Coverage");
- rb_define_module_function(rb_mCoverage, "start", rb_coverage_start, 0);
- rb_define_module_function(rb_mCoverage, "result", rb_coverage_result, 0);
-}
diff --git a/ext/coverage/extconf.rb b/ext/coverage/extconf.rb
deleted file mode 100644
index 3ebced54a6..0000000000
--- a/ext/coverage/extconf.rb
+++ /dev/null
@@ -1,2 +0,0 @@
-require 'mkmf'
-create_makefile('coverage')
diff --git a/ext/curses/.cvsignore b/ext/curses/.cvsignore
index 814345ece8..4088712231 100644
--- a/ext/curses/.cvsignore
+++ b/ext/curses/.cvsignore
@@ -1,4 +1,3 @@
Makefile
mkmf.log
*.def
-extconf.h
diff --git a/ext/curses/curses.c b/ext/curses/curses.c
index 94da77f826..9c51a2127f 100644
--- a/ext/curses/curses.c
+++ b/ext/curses/curses.c
@@ -2,7 +2,7 @@
* $Id$
*
* ext/curses/curses.c
- *
+ *
* by MAEDA Shugo (ender@pic-internet.or.jp)
* modified by Yukihiro Matsumoto (matz@netlab.co.jp),
* Toki Yoshinori,
@@ -14,7 +14,7 @@
*/
#include "ruby.h"
-#include "ruby/io.h"
+#include "rubyio.h"
#if defined(HAVE_NCURSES_H)
# include <ncurses.h>
@@ -54,8 +54,8 @@
# define USE_MOUSE 1
#endif
-#define NUM2CH NUM2CHR
-#define CH2FIX CHR2FIX
+#define NUM2CH NUM2LONG
+#define CH2FIX LONG2FIX
static VALUE mCurses;
static VALUE mKey;
@@ -72,12 +72,12 @@ struct windata {
#define CHECK(c) c
-static VALUE window_attroff(VALUE obj, VALUE attrs);
-static VALUE window_attron(VALUE obj, VALUE attrs);
-static VALUE window_attrset(VALUE obj, VALUE attrs);
+static VALUE window_attroff();
+static VALUE window_attron();
+static VALUE window_attrset();
static void
-no_window(void)
+no_window()
{
rb_raise(rb_eRuntimeError, "already closed window");
}
@@ -90,15 +90,18 @@ no_window(void)
} while (0)
static void
-free_window(struct windata *winp)
+free_window(winp)
+ struct windata *winp;
{
if (winp->window && winp->window != stdscr) delwin(winp->window);
winp->window = 0;
- xfree(winp);
+ free(winp);
}
static VALUE
-prep_window(VALUE class, WINDOW *window)
+prep_window(class, window)
+ VALUE class;
+ WINDOW *window;
{
VALUE obj;
struct windata *winp;
@@ -110,15 +113,15 @@ prep_window(VALUE class, WINDOW *window)
obj = rb_obj_alloc(class);
Data_Get_Struct(obj, struct windata, winp);
winp->window = window;
-
- return obj;
+
+ return obj;
}
/*-------------------------- module Curses --------------------------*/
/* def init_screen */
static VALUE
-curses_init_screen(void)
+curses_init_screen()
{
rb_secure(4);
if (rb_stdscr) return rb_stdscr;
@@ -136,7 +139,7 @@ curses_init_screen(void)
/* def close_screen */
static VALUE
-curses_close_screen(void)
+curses_close_screen()
{
#ifdef HAVE_ISENDWIN
if (!isendwin())
@@ -159,23 +162,24 @@ curses_finalize(VALUE dummy)
rb_gc_unregister_address(&rb_stdscr);
}
-#ifdef HAVE_ISENDWIN
/* def closed? */
static VALUE
-curses_closed(void)
+curses_closed()
{
+#ifdef HAVE_ISENDWIN
if (isendwin()) {
return Qtrue;
}
return Qfalse;
-}
#else
-#define curses_closed rb_f_notimplement
+ rb_notimplement();
#endif
+}
/* def clear */
static VALUE
-curses_clear(VALUE obj)
+curses_clear(obj)
+ VALUE obj;
{
curses_stdscr();
wclear(stdscr);
@@ -184,7 +188,7 @@ curses_clear(VALUE obj)
/* def clrtoeol */
static VALUE
-curses_clrtoeol(void)
+curses_clrtoeol()
{
curses_stdscr();
clrtoeol();
@@ -193,7 +197,8 @@ curses_clrtoeol(void)
/* def refresh */
static VALUE
-curses_refresh(VALUE obj)
+curses_refresh(obj)
+ VALUE obj;
{
curses_stdscr();
refresh();
@@ -202,7 +207,8 @@ curses_refresh(VALUE obj)
/* def doupdate */
static VALUE
-curses_doupdate(VALUE obj)
+curses_doupdate(obj)
+ VALUE obj;
{
curses_stdscr();
#ifdef HAVE_DOUPDATE
@@ -215,7 +221,8 @@ curses_doupdate(VALUE obj)
/* def echo */
static VALUE
-curses_echo(VALUE obj)
+curses_echo(obj)
+ VALUE obj;
{
curses_stdscr();
echo();
@@ -224,7 +231,8 @@ curses_echo(VALUE obj)
/* def noecho */
static VALUE
-curses_noecho(VALUE obj)
+curses_noecho(obj)
+ VALUE obj;
{
curses_stdscr();
noecho();
@@ -233,7 +241,8 @@ curses_noecho(VALUE obj)
/* def raw */
static VALUE
-curses_raw(VALUE obj)
+curses_raw(obj)
+ VALUE obj;
{
curses_stdscr();
raw();
@@ -242,7 +251,8 @@ curses_raw(VALUE obj)
/* def noraw */
static VALUE
-curses_noraw(VALUE obj)
+curses_noraw(obj)
+ VALUE obj;
{
curses_stdscr();
noraw();
@@ -251,7 +261,8 @@ curses_noraw(VALUE obj)
/* def cbreak */
static VALUE
-curses_cbreak(VALUE obj)
+curses_cbreak(obj)
+ VALUE obj;
{
curses_stdscr();
cbreak();
@@ -260,7 +271,8 @@ curses_cbreak(VALUE obj)
/* def nocbreak */
static VALUE
-curses_nocbreak(VALUE obj)
+curses_nocbreak(obj)
+ VALUE obj;
{
curses_stdscr();
nocbreak();
@@ -269,7 +281,8 @@ curses_nocbreak(VALUE obj)
/* def nl */
static VALUE
-curses_nl(VALUE obj)
+curses_nl(obj)
+ VALUE obj;
{
curses_stdscr();
nl();
@@ -278,7 +291,8 @@ curses_nl(VALUE obj)
/* def nonl */
static VALUE
-curses_nonl(VALUE obj)
+curses_nonl(obj)
+ VALUE obj;
{
curses_stdscr();
nonl();
@@ -287,7 +301,8 @@ curses_nonl(VALUE obj)
/* def beep */
static VALUE
-curses_beep(VALUE obj)
+curses_beep(obj)
+ VALUE obj;
{
#ifdef HAVE_BEEP
curses_stdscr();
@@ -298,7 +313,8 @@ curses_beep(VALUE obj)
/* def flash */
static VALUE
-curses_flash(VALUE obj)
+curses_flash(obj)
+ VALUE obj;
{
#ifdef HAVE_FLASH
curses_stdscr();
@@ -307,44 +323,27 @@ curses_flash(VALUE obj)
return Qnil;
}
-static int
-curses_char(VALUE c)
-{
- if (FIXNUM_P(c)) {
- return NUM2INT(c);
- }
- else {
- int cc;
-
- StringValue(c);
- if (RSTRING_LEN(c) == 0 || RSTRING_LEN(c) > 1) {
- rb_raise(rb_eArgError, "string not corresponding a character");
- }
- cc = RSTRING_PTR(c)[0];
- if (cc > 0x7f) {
- rb_raise(rb_eArgError, "no multibyte string supported (yet)");
- }
- return cc;
- }
-}
-
-#ifdef HAVE_UNGETCH
/* def ungetch */
static VALUE
-curses_ungetch(VALUE obj, VALUE ch)
+curses_ungetch(obj, ch)
+ VALUE obj;
+ VALUE ch;
{
- int c = curses_char(ch);
+#ifdef HAVE_UNGETCH
curses_stdscr();
- ungetch(c);
- return Qnil;
-}
+ ungetch(NUM2INT(ch));
#else
-#define curses_ungetch rb_f_notimplement
+ rb_notimplement();
#endif
+ return Qnil;
+}
/* def setpos(y, x) */
static VALUE
-curses_setpos(VALUE obj, VALUE y, VALUE x)
+curses_setpos(obj, y, x)
+ VALUE obj;
+ VALUE y;
+ VALUE x;
{
curses_stdscr();
move(NUM2INT(y), NUM2INT(x));
@@ -353,7 +352,8 @@ curses_setpos(VALUE obj, VALUE y, VALUE x)
/* def standout */
static VALUE
-curses_standout(VALUE obj)
+curses_standout(obj)
+ VALUE obj;
{
standout();
return Qnil;
@@ -361,7 +361,8 @@ curses_standout(VALUE obj)
/* def standend */
static VALUE
-curses_standend(VALUE obj)
+curses_standend(obj)
+ VALUE obj;
{
standend();
return Qnil;
@@ -369,7 +370,8 @@ curses_standend(VALUE obj)
/* def inch */
static VALUE
-curses_inch(VALUE obj)
+curses_inch(obj)
+ VALUE obj;
{
curses_stdscr();
return CH2FIX(inch());
@@ -377,7 +379,9 @@ curses_inch(VALUE obj)
/* def addch(ch) */
static VALUE
-curses_addch(VALUE obj, VALUE ch)
+curses_addch(obj, ch)
+ VALUE obj;
+ VALUE ch;
{
curses_stdscr();
addch(NUM2CH(ch));
@@ -386,7 +390,9 @@ curses_addch(VALUE obj, VALUE ch)
/* def insch(ch) */
static VALUE
-curses_insch(VALUE obj, VALUE ch)
+curses_insch(obj, ch)
+ VALUE obj;
+ VALUE ch;
{
curses_stdscr();
insch(NUM2CH(ch));
@@ -395,38 +401,31 @@ curses_insch(VALUE obj, VALUE ch)
/* def addstr(str) */
static VALUE
-curses_addstr(VALUE obj, VALUE str)
+curses_addstr(obj, str)
+ VALUE obj;
+ VALUE str;
{
- StringValue(str);
- str = rb_str_export_locale(str);
curses_stdscr();
if (!NIL_P(str)) {
- addstr(StringValueCStr(str));
+ addstr(STR2CSTR(str));
}
return Qnil;
}
/* def getch */
static VALUE
-curses_getch(VALUE obj)
+curses_getch(obj)
+ VALUE obj;
{
- int c;
-
rb_read_check(stdin);
curses_stdscr();
- c = getch();
- if (c == EOF) return Qnil;
- if (rb_isprint(c)) {
- char ch = (char)c;
-
- return rb_locale_str_new(&ch, 1);
- }
- return UINT2NUM(c);
+ return UINT2NUM(getch());
}
/* def getstr */
static VALUE
-curses_getstr(VALUE obj)
+curses_getstr(obj)
+ VALUE obj;
{
char rtn[1024]; /* This should be big enough.. I hope */
@@ -436,12 +435,13 @@ curses_getstr(VALUE obj)
#else
getstr(rtn);
#endif
- return rb_locale_str_new_cstr(rtn);
+ return rb_tainted_str_new2(rtn);
}
/* def delch */
static VALUE
-curses_delch(VALUE obj)
+curses_delch(obj)
+ VALUE obj;
{
delch();
return Qnil;
@@ -449,7 +449,8 @@ curses_delch(VALUE obj)
/* def delelteln */
static VALUE
-curses_deleteln(VALUE obj)
+curses_deleteln(obj)
+ VALUE obj;
{
#if defined(HAVE_DELETELN) || defined(deleteln)
deleteln();
@@ -459,7 +460,8 @@ curses_deleteln(VALUE obj)
/* def insertln */
static VALUE
-curses_insertln(VALUE obj)
+curses_insertln(obj)
+ VALUE obj;
{
#if defined(HAVE_INSERTLN) || defined(insertln)
insertln();
@@ -469,175 +471,116 @@ curses_insertln(VALUE obj)
/* def keyname */
static VALUE
-curses_keyname(VALUE obj, VALUE c)
+curses_keyname(obj, c)
+ VALUE obj;
+ VALUE c;
{
#ifdef HAVE_KEYNAME
- int cc = curses_char(c);
- const char *name;
+ const char *name;
- name = keyname(cc);
- if (name) {
- return rb_str_new_cstr(name);
- }
- else {
- return Qnil;
- }
-#else
+ name = keyname(NUM2INT(c));
+ if (name) {
+ return rb_str_new2(name);
+ } else {
return Qnil;
+ }
+#else
+ return Qnil;
#endif
}
static VALUE
-curses_lines(void)
+curses_lines()
{
return INT2FIX(LINES);
}
static VALUE
-curses_cols(void)
+curses_cols()
{
return INT2FIX(COLS);
}
-/**
- * Sets Cursor Visibility.
- * 0: invisible
- * 1: visible
- * 2: very visible
- */
static VALUE
curses_curs_set(VALUE obj, VALUE visibility)
{
#ifdef HAVE_CURS_SET
- int n;
- return (n = curs_set(NUM2INT(visibility)) != ERR) ? INT2FIX(n) : Qnil;
+ int n;
+ return (n = curs_set(NUM2INT(visibility)) != ERR) ? INT2FIX(n) : Qnil;
#else
- return Qnil;
+ return Qnil;
#endif
}
static VALUE
curses_scrl(VALUE obj, VALUE n)
{
- /* may have to raise exception on ERR */
+ /* may have to raise exception on ERR */
#ifdef HAVE_SCRL
- return (scrl(NUM2INT(n)) == OK) ? Qtrue : Qfalse;
+ return (scrl(NUM2INT(n)) == OK) ? Qtrue : Qfalse;
#else
- return Qfalse;
+ return Qfalse;
#endif
}
static VALUE
curses_setscrreg(VALUE obj, VALUE top, VALUE bottom)
{
- /* may have to raise exception on ERR */
+ /* may have to raise exception on ERR */
#ifdef HAVE_SETSCRREG
- return (setscrreg(NUM2INT(top), NUM2INT(bottom)) == OK) ? Qtrue : Qfalse;
+ return (setscrreg(NUM2INT(top), NUM2INT(bottom)) == OK) ? Qtrue : Qfalse;
#else
- return Qfalse;
+ return Qfalse;
#endif
}
static VALUE
curses_attroff(VALUE obj, VALUE attrs)
{
- return window_attroff(rb_stdscr,attrs);
- /* return INT2FIX(attroff(NUM2INT(attrs))); */
+ return window_attroff(rb_stdscr,attrs);
+ /* return INT2FIX(attroff(NUM2INT(attrs))); */
}
static VALUE
curses_attron(VALUE obj, VALUE attrs)
{
- return window_attron(rb_stdscr,attrs);
- /* return INT2FIX(attroff(NUM2INT(attrs))); */
+ return window_attron(rb_stdscr,attrs);
+ /* return INT2FIX(attroff(NUM2INT(attrs))); */
}
static VALUE
curses_attrset(VALUE obj, VALUE attrs)
{
- return window_attrset(rb_stdscr,attrs);
- /* return INT2FIX(attroff(NUM2INT(attrs))); */
+ return window_attrset(rb_stdscr,attrs);
+ /* return INT2FIX(attroff(NUM2INT(attrs))); */
}
static VALUE
curses_bkgdset(VALUE obj, VALUE ch)
{
#ifdef HAVE_BKGDSET
- bkgdset(NUM2CH(ch));
+ bkgdset(NUM2CH(ch));
#endif
- return Qnil;
+ return Qnil;
}
static VALUE
curses_bkgd(VALUE obj, VALUE ch)
{
#ifdef HAVE_BKGD
- return (bkgd(NUM2CH(ch)) == OK) ? Qtrue : Qfalse;
-#else
- return Qfalse;
-#endif
-}
-
-#if defined(HAVE_USE_DEFAULT_COLORS)
-static VALUE
-curses_use_default_colors(VALUE obj)
-{
- use_default_colors();
- return Qnil;
-}
-#else
-#define curses_use_default_colors rb_f_notimplement
-#endif
-
-#if defined(HAVE_TABSIZE)
-static VALUE
-curses_tabsize_set(VALUE obj, VALUE val)
-{
- TABSIZE = NUM2INT(val);
- return INT2NUM(TABSIZE);
-}
+ return (bkgd(NUM2CH(ch)) == OK) ? Qtrue : Qfalse;
#else
-#define curses_tabsize_set rb_f_notimplement
+ return Qfalse;
#endif
-
-#if defined(HAVE_TABSIZE)
-static VALUE
-curses_tabsize_get(VALUE ojb)
-{
- return INT2NUM(TABSIZE);
}
-#else
-#define curses_tabsize_get rb_f_notimplement
-#endif
-
-#if defined(HAVE_ESCDELAY)
-static VALUE
-curses_escdelay_set(VALUE obj, VALUE val)
-{
- ESCDELAY = NUM2INT(val);
- return INT2NUM(ESCDELAY);
-}
-#else
-#define curses_escdelay_set rb_f_notimplement
-#endif
-
-#if defined(HAVE_ESCDELAY)
-static VALUE
-curses_escdelay_get(VALUE obj)
-{
- return INT2NUM(ESCDELAY);
-}
-#else
-#define curses_escdelay_get rb_f_notimplement
-#endif
static VALUE
curses_resizeterm(VALUE obj, VALUE lin, VALUE col)
{
#if defined(HAVE_RESIZETERM)
- return (resizeterm(NUM2INT(lin),NUM2INT(col)) == OK) ? Qtrue : Qfalse;
+ return (resizeterm(NUM2INT(lin),NUM2INT(col)) == OK) ? Qtrue : Qfalse;
#else
- return Qnil;
+ return Qnil;
#endif
}
@@ -645,98 +588,77 @@ curses_resizeterm(VALUE obj, VALUE lin, VALUE col)
static VALUE
curses_start_color(VALUE obj)
{
- /* may have to raise exception on ERR */
- return (start_color() == OK) ? Qtrue : Qfalse;
+ /* may have to raise exception on ERR */
+ return (start_color() == OK) ? Qtrue : Qfalse;
}
static VALUE
curses_init_pair(VALUE obj, VALUE pair, VALUE f, VALUE b)
{
- /* may have to raise exception on ERR */
- return (init_pair(NUM2INT(pair),NUM2INT(f),NUM2INT(b)) == OK) ? Qtrue : Qfalse;
+ /* may have to raise exception on ERR */
+ return (init_pair(NUM2INT(pair),NUM2INT(f),NUM2INT(b)) == OK) ? Qtrue : Qfalse;
}
static VALUE
curses_init_color(VALUE obj, VALUE color, VALUE r, VALUE g, VALUE b)
{
- /* may have to raise exception on ERR */
- return (init_color(NUM2INT(color),NUM2INT(r),
- NUM2INT(g),NUM2INT(b)) == OK) ? Qtrue : Qfalse;
+ /* may have to raise exception on ERR */
+ return (init_color(NUM2INT(color),NUM2INT(r),
+ NUM2INT(g),NUM2INT(b)) == OK) ? Qtrue : Qfalse;
}
static VALUE
curses_has_colors(VALUE obj)
{
- return has_colors() ? Qtrue : Qfalse;
+ return has_colors() ? Qtrue : Qfalse;
}
static VALUE
curses_can_change_color(VALUE obj)
{
- return can_change_color() ? Qtrue : Qfalse;
+ return can_change_color() ? Qtrue : Qfalse;
}
-#if defined(HAVE_COLORS)
-static VALUE
-curses_colors(VALUE obj)
-{
- return INT2FIX(COLORS);
-}
-#else
-#define curses_colors rb_f_notimplement
-#endif
-
static VALUE
curses_color_content(VALUE obj, VALUE color)
{
- short r,g,b;
+ short r,g,b;
- color_content(NUM2INT(color),&r,&g,&b);
- return rb_ary_new3(3,INT2FIX(r),INT2FIX(g),INT2FIX(b));
+ color_content(NUM2INT(color),&r,&g,&b);
+ return rb_ary_new3(3,INT2FIX(r),INT2FIX(g),INT2FIX(b));
}
-
-#if defined(HAVE_COLOR_PAIRS)
-static VALUE
-curses_color_pairs(VALUE obj)
-{
- return INT2FIX(COLOR_PAIRS);
-}
-#else
-#define curses_color_pairs rb_f_notimplement
-#endif
-
static VALUE
curses_pair_content(VALUE obj, VALUE pair)
{
- short f,b;
+ short f,b;
- pair_content(NUM2INT(pair),&f,&b);
- return rb_ary_new3(2,INT2FIX(f),INT2FIX(b));
+ pair_content(NUM2INT(pair),&f,&b);
+ return rb_ary_new3(2,INT2FIX(f),INT2FIX(b));
}
static VALUE
curses_color_pair(VALUE obj, VALUE attrs)
{
- return INT2FIX(COLOR_PAIR(NUM2INT(attrs)));
+ return INT2FIX(COLOR_PAIR(NUM2INT(attrs)));
}
static VALUE
curses_pair_number(VALUE obj, VALUE attrs)
{
- return INT2FIX(PAIR_NUMBER(NUM2INT(attrs)));
+ return INT2FIX(PAIR_NUMBER(NUM2INT(attrs)));
}
#endif /* USE_COLOR */
#ifdef USE_MOUSE
struct mousedata {
- MEVENT *mevent;
+ MEVENT *mevent;
};
static void
-no_mevent(void)
+no_mevent()
{
- rb_raise(rb_eRuntimeError, "no such mouse event");
+ rb_raise(rb_eRuntimeError, "no such mouse event");
}
#define GetMOUSE(obj, data) do {\
@@ -749,49 +671,49 @@ no_mevent(void)
static void
curses_mousedata_free(struct mousedata *mdata)
{
- if (mdata->mevent)
- xfree(mdata->mevent);
+ if (mdata->mevent)
+ free(mdata->mevent);
}
static VALUE
curses_getmouse(VALUE obj)
{
- struct mousedata *mdata;
- VALUE val;
+ struct mousedata *mdata;
+ VALUE val;
- val = Data_Make_Struct(cMouseEvent,struct mousedata,
- 0,curses_mousedata_free,mdata);
- mdata->mevent = (MEVENT*)xmalloc(sizeof(MEVENT));
- return (getmouse(mdata->mevent) == OK) ? val : Qnil;
+ val = Data_Make_Struct(cMouseEvent,struct mousedata,
+ 0,curses_mousedata_free,mdata);
+ mdata->mevent = (MEVENT*)xmalloc(sizeof(MEVENT));
+ return (getmouse(mdata->mevent) == OK) ? val : Qnil;
}
static VALUE
curses_ungetmouse(VALUE obj, VALUE mevent)
{
- struct mousedata *mdata;
+ struct mousedata *mdata;
- GetMOUSE(mevent,mdata);
- return (ungetmouse(mdata->mevent) == OK) ? Qtrue : Qfalse;
+ GetMOUSE(mevent,mdata);
+ return (ungetmouse(mdata->mevent) == OK) ? Qtrue : Qfalse;
}
static VALUE
curses_mouseinterval(VALUE obj, VALUE interval)
{
- return mouseinterval(NUM2INT(interval)) ? Qtrue : Qfalse;
+ return mouseinterval(NUM2INT(interval)) ? Qtrue : Qfalse;
}
static VALUE
curses_mousemask(VALUE obj, VALUE mask)
{
- return INT2NUM(mousemask(NUM2UINT(mask),NULL));
+ return INT2NUM(mousemask(NUM2UINT(mask),NULL));
}
#define DEFINE_MOUSE_GET_MEMBER(func_name,mem) \
static VALUE func_name (VALUE mouse) \
{ \
- struct mousedata *mdata; \
- GetMOUSE(mouse, mdata); \
- return (UINT2NUM(mdata->mevent -> mem)); \
+ struct mousedata *mdata; \
+ GetMOUSE(mouse, mdata); \
+ return (UINT2NUM(mdata->mevent -> mem)); \
}
DEFINE_MOUSE_GET_MEMBER(curs_mouse_id, id)
@@ -802,36 +724,36 @@ DEFINE_MOUSE_GET_MEMBER(curs_mouse_bstate, bstate)
#undef define_curs_mouse_member
#endif /* USE_MOUSE */
-#ifdef HAVE_TIMEOUT
static VALUE
curses_timeout(VALUE obj, VALUE delay)
{
- timeout(NUM2INT(delay));
- return Qnil;
-}
+#ifdef HAVE_TIMEOUT
+ timeout(NUM2INT(delay));
+ return Qnil;
#else
-#define curses_timeout rb_f_notimplement
+ rb_notimplement();
#endif
+}
-#ifdef HAVE_DEF_PROG_MODE
static VALUE
curses_def_prog_mode(VALUE obj)
{
- return def_prog_mode() == OK ? Qtrue : Qfalse;
-}
+#ifdef HAVE_DEF_PROG_MODE
+ return def_prog_mode() == OK ? Qtrue : Qfalse;
#else
-#define curses_def_prog_mode rb_f_notimplement
+ rb_notimplement();
#endif
+}
-#ifdef HAVE_RESET_PROG_MODE
static VALUE
curses_reset_prog_mode(VALUE obj)
{
- return reset_prog_mode() == OK ? Qtrue : Qfalse;
-}
+#ifdef HAVE_RESET_PROG_MODE
+ return reset_prog_mode() == OK ? Qtrue : Qfalse;
#else
-#define curses_reset_prog_mode rb_f_notimplement
+ rb_notimplement();
#endif
+}
/*-------------------------- class Window --------------------------*/
@@ -846,7 +768,12 @@ window_s_allocate(VALUE class)
/* def initialize(h, w, top, left) */
static VALUE
-window_initialize(VALUE obj, VALUE h, VALUE w, VALUE top, VALUE left)
+window_initialize(obj, h, w, top, left)
+ VALUE obj;
+ VALUE h;
+ VALUE w;
+ VALUE top;
+ VALUE left;
{
struct windata *winp;
WINDOW *window;
@@ -864,7 +791,12 @@ window_initialize(VALUE obj, VALUE h, VALUE w, VALUE top, VALUE left)
/* def subwin(height, width, top, left) */
static VALUE
-window_subwin(VALUE obj, VALUE height, VALUE width, VALUE top, VALUE left)
+window_subwin(obj, height, width, top, left)
+ VALUE obj;
+ VALUE height;
+ VALUE width;
+ VALUE top;
+ VALUE left;
{
struct windata *winp;
WINDOW *window;
@@ -884,10 +816,11 @@ window_subwin(VALUE obj, VALUE height, VALUE width, VALUE top, VALUE left)
/* def close */
static VALUE
-window_close(VALUE obj)
+window_close(obj)
+ VALUE obj;
{
struct windata *winp;
-
+
GetWINDOW(obj, winp);
delwin(winp->window);
winp->window = 0;
@@ -897,43 +830,47 @@ window_close(VALUE obj)
/* def clear */
static VALUE
-window_clear(VALUE obj)
+window_clear(obj)
+ VALUE obj;
{
struct windata *winp;
-
+
GetWINDOW(obj, winp);
wclear(winp->window);
-
+
return Qnil;
}
/* def clrtoeol */
static VALUE
-window_clrtoeol(VALUE obj)
+window_clrtoeol(obj)
+ VALUE obj;
{
struct windata *winp;
-
+
GetWINDOW(obj, winp);
wclrtoeol(winp->window);
-
+
return Qnil;
}
/* def refresh */
static VALUE
-window_refresh(VALUE obj)
+window_refresh(obj)
+ VALUE obj;
{
struct windata *winp;
-
+
GetWINDOW(obj, winp);
wrefresh(winp->window);
-
+
return Qnil;
}
/* def noutrefresh */
static VALUE
-window_noutrefresh(VALUE obj)
+window_noutrefresh(obj)
+ VALUE obj;
{
struct windata *winp;
@@ -949,10 +886,13 @@ window_noutrefresh(VALUE obj)
/* def move(y, x) */
static VALUE
-window_move(VALUE obj, VALUE y, VALUE x)
+window_move(obj, y, x)
+ VALUE obj;
+ VALUE y;
+ VALUE x;
{
struct windata *winp;
-
+
GetWINDOW(obj, winp);
mvwin(winp->window, NUM2INT(y), NUM2INT(x));
@@ -961,10 +901,13 @@ window_move(VALUE obj, VALUE y, VALUE x)
/* def setpos(y, x) */
static VALUE
-window_setpos(VALUE obj, VALUE y, VALUE x)
+window_setpos(obj, y, x)
+ VALUE obj;
+ VALUE y;
+ VALUE x;
{
struct windata *winp;
-
+
GetWINDOW(obj, winp);
wmove(winp->window, NUM2INT(y), NUM2INT(x));
return Qnil;
@@ -972,7 +915,8 @@ window_setpos(VALUE obj, VALUE y, VALUE x)
/* def cury */
static VALUE
-window_cury(VALUE obj)
+window_cury(obj)
+ VALUE obj;
{
struct windata *winp;
int x, y;
@@ -984,7 +928,8 @@ window_cury(VALUE obj)
/* def curx */
static VALUE
-window_curx(VALUE obj)
+window_curx(obj)
+ VALUE obj;
{
struct windata *winp;
int x, y;
@@ -996,7 +941,8 @@ window_curx(VALUE obj)
/* def maxy */
static VALUE
-window_maxy(VALUE obj)
+window_maxy(obj)
+ VALUE obj;
{
struct windata *winp;
@@ -1016,7 +962,8 @@ window_maxy(VALUE obj)
/* def maxx */
static VALUE
-window_maxx(VALUE obj)
+window_maxx(obj)
+ VALUE obj;
{
struct windata *winp;
@@ -1036,7 +983,8 @@ window_maxx(VALUE obj)
/* def begy */
static VALUE
-window_begy(VALUE obj)
+window_begy(obj)
+ VALUE obj;
{
struct windata *winp;
int x, y;
@@ -1052,7 +1000,8 @@ window_begy(VALUE obj)
/* def begx */
static VALUE
-window_begx(VALUE obj)
+window_begx(obj)
+ VALUE obj;
{
struct windata *winp;
int x, y;
@@ -1068,9 +1017,11 @@ window_begx(VALUE obj)
/* def box(vert, hor) */
static VALUE
-window_box(int argc, VALUE *argv, VALUE self)
+window_box(argc, argv, self)
+ int argc;
+ VALUE argv[], self;
{
- struct windata *winp;
+ struct windata *winp;
VALUE vert, hor, corn;
rb_scan_args(argc, argv, "21", &vert, &hor, &corn);
@@ -1079,33 +1030,34 @@ window_box(int argc, VALUE *argv, VALUE self)
box(winp->window, NUM2CH(vert), NUM2CH(hor));
if (!NIL_P(corn)) {
- int cur_x, cur_y, x, y;
- chtype c;
-
- c = NUM2CH(corn);
- getyx(winp->window, cur_y, cur_x);
- x = NUM2INT(window_maxx(self)) - 1;
- y = NUM2INT(window_maxy(self)) - 1;
- wmove(winp->window, 0, 0);
- waddch(winp->window, c);
- wmove(winp->window, y, 0);
- waddch(winp->window, c);
- wmove(winp->window, y, x);
- waddch(winp->window, c);
- wmove(winp->window, 0, x);
- waddch(winp->window, c);
- wmove(winp->window, cur_y, cur_x);
+ int cur_x, cur_y, x, y;
+ chtype c;
+
+ c = NUM2CH(corn);
+ getyx(winp->window, cur_y, cur_x);
+ x = NUM2INT(window_maxx(self)) - 1;
+ y = NUM2INT(window_maxy(self)) - 1;
+ wmove(winp->window, 0, 0);
+ waddch(winp->window, c);
+ wmove(winp->window, y, 0);
+ waddch(winp->window, c);
+ wmove(winp->window, y, x);
+ waddch(winp->window, c);
+ wmove(winp->window, 0, x);
+ waddch(winp->window, c);
+ wmove(winp->window, cur_y, cur_x);
}
-
+
return Qnil;
}
/* def standout */
static VALUE
-window_standout(VALUE obj)
+window_standout(obj)
+ VALUE obj;
{
struct windata *winp;
-
+
GetWINDOW(obj, winp);
wstandout(winp->window);
return Qnil;
@@ -1113,10 +1065,11 @@ window_standout(VALUE obj)
/* def standend */
static VALUE
-window_standend(VALUE obj)
+window_standend(obj)
+ VALUE obj;
{
struct windata *winp;
-
+
GetWINDOW(obj, winp);
wstandend(winp->window);
return Qnil;
@@ -1124,56 +1077,63 @@ window_standend(VALUE obj)
/* def inch */
static VALUE
-window_inch(VALUE obj)
+window_inch(obj)
+ VALUE obj;
{
struct windata *winp;
-
+
GetWINDOW(obj, winp);
return CH2FIX(winch(winp->window));
}
/* def addch(ch) */
static VALUE
-window_addch(VALUE obj, VALUE ch)
+window_addch(obj, ch)
+ VALUE obj;
+ VALUE ch;
{
struct windata *winp;
-
+
GetWINDOW(obj, winp);
waddch(winp->window, NUM2CH(ch));
-
+
return Qnil;
}
/* def insch(ch) */
static VALUE
-window_insch(VALUE obj, VALUE ch)
+window_insch(obj, ch)
+ VALUE obj;
+ VALUE ch;
{
struct windata *winp;
-
+
GetWINDOW(obj, winp);
winsch(winp->window, NUM2CH(ch));
-
+
return Qnil;
}
/* def addstr(str) */
static VALUE
-window_addstr(VALUE obj, VALUE str)
+window_addstr(obj, str)
+ VALUE obj;
+ VALUE str;
{
if (!NIL_P(str)) {
struct windata *winp;
- StringValue(str);
- str = rb_str_export_locale(str);
GetWINDOW(obj, winp);
- waddstr(winp->window, StringValueCStr(str));
+ waddstr(winp->window, STR2CSTR(str));
}
return Qnil;
}
/* def <<(str) */
static VALUE
-window_addstr2(VALUE obj, VALUE str)
+window_addstr2(obj, str)
+ VALUE obj;
+ VALUE str;
{
window_addstr(obj, str);
return obj;
@@ -1181,30 +1141,24 @@ window_addstr2(VALUE obj, VALUE str)
/* def getch */
static VALUE
-window_getch(VALUE obj)
+window_getch(obj)
+ VALUE obj;
{
struct windata *winp;
- int c;
-
+
rb_read_check(stdin);
GetWINDOW(obj, winp);
- c = wgetch(winp->window);
- if (c == EOF) return Qnil;
- if (rb_isprint(c)) {
- char ch = (char)c;
-
- return rb_locale_str_new(&ch, 1);
- }
- return UINT2NUM(c);
+ return UINT2NUM(wgetch(winp->window));
}
/* def getstr */
static VALUE
-window_getstr(VALUE obj)
+window_getstr(obj)
+ VALUE obj;
{
struct windata *winp;
char rtn[1024]; /* This should be big enough.. I hope */
-
+
GetWINDOW(obj, winp);
rb_read_check(stdin);
#if defined(HAVE_WGETNSTR)
@@ -1212,15 +1166,16 @@ window_getstr(VALUE obj)
#else
wgetstr(winp->window, rtn);
#endif
- return rb_locale_str_new_cstr(rtn);
+ return rb_tainted_str_new2(rtn);
}
/* def delch */
static VALUE
-window_delch(VALUE obj)
+window_delch(obj)
+ VALUE obj;
{
struct windata *winp;
-
+
GetWINDOW(obj, winp);
wdelch(winp->window);
return Qnil;
@@ -1228,11 +1183,12 @@ window_delch(VALUE obj)
/* def delelteln */
static VALUE
-window_deleteln(VALUE obj)
+window_deleteln(obj)
+ VALUE obj;
{
#if defined(HAVE_WDELETELN) || defined(wdeleteln)
struct windata *winp;
-
+
GetWINDOW(obj, winp);
wdeleteln(winp->window);
#endif
@@ -1241,11 +1197,12 @@ window_deleteln(VALUE obj)
/* def insertln */
static VALUE
-window_insertln(VALUE obj)
+window_insertln(obj)
+ VALUE obj;
{
#if defined(HAVE_WINSERTLN) || defined(winsertln)
struct windata *winp;
-
+
GetWINDOW(obj, winp);
winsertln(winp->window);
#endif
@@ -1255,73 +1212,73 @@ window_insertln(VALUE obj)
static VALUE
window_scrollok(VALUE obj, VALUE bf)
{
- struct windata *winp;
+ struct windata *winp;
- GetWINDOW(obj, winp);
- scrollok(winp->window, RTEST(bf) ? TRUE : FALSE);
- return Qnil;
+ GetWINDOW(obj, winp);
+ scrollok(winp->window, RTEST(bf) ? TRUE : FALSE);
+ return Qnil;
}
static VALUE
window_idlok(VALUE obj, VALUE bf)
{
- struct windata *winp;
+ struct windata *winp;
- GetWINDOW(obj, winp);
- idlok(winp->window, RTEST(bf) ? TRUE : FALSE);
- return Qnil;
+ GetWINDOW(obj, winp);
+ idlok(winp->window, RTEST(bf) ? TRUE : FALSE);
+ return Qnil;
}
static VALUE
window_setscrreg(VALUE obj, VALUE top, VALUE bottom)
{
#ifdef HAVE_WSETSCRREG
- struct windata *winp;
- int res;
+ struct windata *winp;
+ int res;
- GetWINDOW(obj, winp);
- res = wsetscrreg(winp->window, NUM2INT(top), NUM2INT(bottom));
- /* may have to raise exception on ERR */
- return (res == OK) ? Qtrue : Qfalse;
+ GetWINDOW(obj, winp);
+ res = wsetscrreg(winp->window, NUM2INT(top), NUM2INT(bottom));
+ /* may have to raise exception on ERR */
+ return (res == OK) ? Qtrue : Qfalse;
#else
- return Qfalse;
+ return Qfalse;
#endif
}
#if defined(USE_COLOR) && defined(HAVE_WCOLOR_SET)
static VALUE
-window_color_set(VALUE obj, VALUE col)
+window_color_set(VALUE obj, VALUE col)
{
- struct windata *winp;
- int res;
+ struct windata *winp;
+ int res;
- GetWINDOW(obj, winp);
- res = wcolor_set(winp->window, NUM2INT(col), NULL);
- return (res == OK) ? Qtrue : Qfalse;
+ GetWINDOW(obj, winp);
+ res = wcolor_set(winp->window, NUM2INT(col), NULL);
+ return (res == OK) ? Qtrue : Qfalse;
}
-#endif /* defined(USE_COLOR) && defined(HAVE_WCOLOR_SET) */
+#endif /* USE_COLOR */
static VALUE
window_scroll(VALUE obj)
{
- struct windata *winp;
+ struct windata *winp;
- GetWINDOW(obj, winp);
- /* may have to raise exception on ERR */
- return (scroll(winp->window) == OK) ? Qtrue : Qfalse;
+ GetWINDOW(obj, winp);
+ /* may have to raise exception on ERR */
+ return (scroll(winp->window) == OK) ? Qtrue : Qfalse;
}
static VALUE
window_scrl(VALUE obj, VALUE n)
{
#ifdef HAVE_WSCRL
- struct windata *winp;
+ struct windata *winp;
- GetWINDOW(obj, winp);
- /* may have to raise exception on ERR */
- return (wscrl(winp->window,NUM2INT(n)) == OK) ? Qtrue : Qfalse;
+ GetWINDOW(obj, winp);
+ /* may have to raise exception on ERR */
+ return (wscrl(winp->window,NUM2INT(n)) == OK) ? Qtrue : Qfalse;
#else
- return Qfalse;
+ return Qfalse;
#endif
}
@@ -1329,12 +1286,12 @@ static VALUE
window_attroff(VALUE obj, VALUE attrs)
{
#ifdef HAVE_WATTROFF
- struct windata *winp;
+ struct windata *winp;
- GetWINDOW(obj,winp);
- return INT2FIX(wattroff(winp->window,NUM2INT(attrs)));
+ GetWINDOW(obj,winp);
+ return INT2FIX(wattroff(winp->window,NUM2INT(attrs)));
#else
- return Qtrue;
+ return Qtrue;
#endif
}
@@ -1342,21 +1299,21 @@ static VALUE
window_attron(VALUE obj, VALUE attrs)
{
#ifdef HAVE_WATTRON
- struct windata *winp;
- VALUE val;
-
- GetWINDOW(obj,winp);
- val = INT2FIX(wattron(winp->window,NUM2INT(attrs)));
- if (rb_block_given_p()) {
- rb_yield(val);
- wattroff(winp->window,NUM2INT(attrs));
- return val;
- }
- else{
- return val;
- }
+ struct windata *winp;
+ VALUE val;
+
+ GetWINDOW(obj,winp);
+ val = INT2FIX(wattron(winp->window,NUM2INT(attrs)));
+ if( rb_block_given_p() ){
+ rb_yield(val);
+ wattroff(winp->window,NUM2INT(attrs));
+ return val;
+ }
+ else{
+ return val;
+ }
#else
- return Qtrue;
+ return Qtrue;
#endif
}
@@ -1364,12 +1321,12 @@ static VALUE
window_attrset(VALUE obj, VALUE attrs)
{
#ifdef HAVE_WATTRSET
- struct windata *winp;
+ struct windata *winp;
- GetWINDOW(obj,winp);
- return INT2FIX(wattrset(winp->window,NUM2INT(attrs)));
+ GetWINDOW(obj,winp);
+ return INT2FIX(wattrset(winp->window,NUM2INT(attrs)));
#else
- return Qtrue;
+ return Qtrue;
#endif
}
@@ -1377,24 +1334,24 @@ static VALUE
window_bkgdset(VALUE obj, VALUE ch)
{
#ifdef HAVE_WBKGDSET
- struct windata *winp;
+ struct windata *winp;
- GetWINDOW(obj,winp);
- wbkgdset(winp->window, NUM2CH(ch));
+ GetWINDOW(obj,winp);
+ wbkgdset(winp->window, NUM2CH(ch));
#endif
- return Qnil;
+ return Qnil;
}
static VALUE
window_bkgd(VALUE obj, VALUE ch)
{
#ifdef HAVE_WBKGD
- struct windata *winp;
+ struct windata *winp;
- GetWINDOW(obj,winp);
- return (wbkgd(winp->window, NUM2CH(ch)) == OK) ? Qtrue : Qfalse;
+ GetWINDOW(obj,winp);
+ return (wbkgd(winp->window, NUM2CH(ch)) == OK) ? Qtrue : Qfalse;
#else
- return Qfalse;
+ return Qfalse;
#endif
}
@@ -1402,13 +1359,13 @@ static VALUE
window_getbkgd(VALUE obj)
{
#ifdef HAVE_WGETBKGD
- chtype c;
- struct windata *winp;
+ chtype c;
+ struct windata *winp;
- GetWINDOW(obj,winp);
- return (c = getbkgd(winp->window) != ERR) ? CH2FIX(c) : Qnil;
+ GetWINDOW(obj,winp);
+ return (c = getbkgd(winp->window) != ERR) ? CH2FIX(c) : Qnil;
#else
- return Qnil;
+ return Qnil;
#endif
}
@@ -1416,73 +1373,73 @@ static VALUE
window_resize(VALUE obj, VALUE lin, VALUE col)
{
#if defined(HAVE_WRESIZE)
- struct windata *winp;
+ struct windata *winp;
- GetWINDOW(obj,winp);
- return wresize(winp->window, NUM2INT(lin), NUM2INT(col)) == OK ? Qtrue : Qfalse;
+ GetWINDOW(obj,winp);
+ return wresize(winp->window, NUM2INT(lin), NUM2INT(col)) == OK ? Qtrue : Qfalse;
#else
- return Qnil;
+ return Qnil;
#endif
}
-#ifdef HAVE_KEYPAD
static VALUE
window_keypad(VALUE obj, VALUE val)
{
- struct windata *winp;
+#ifdef HAVE_KEYPAD
+ struct windata *winp;
- GetWINDOW(obj,winp);
- /* keypad() of NetBSD's libcurses returns no value */
+ GetWINDOW(obj,winp);
+ /* keypad() of NetBSD's libcurses returns no value */
#if defined(__NetBSD__) && !defined(NCURSES_VERSION)
- keypad(winp->window,(RTEST(val) ? TRUE : FALSE));
- return Qnil;
+ keypad(winp->window,(RTEST(val) ? TRUE : FALSE));
+ return Qnil;
#else
- /* may have to raise exception on ERR */
- return (keypad(winp->window,RTEST(val) ? TRUE : FALSE)) == OK ?
- Qtrue : Qfalse;
+ /* may have to raise exception on ERR */
+ return (keypad(winp->window,RTEST(val) ? TRUE : FALSE)) == OK ?
+ Qtrue : Qfalse;
#endif
-}
#else
-#define window_keypad rb_f_notimplement
-#endif
+ rb_notimplement();
+#endif /* HAVE_KEYPAD */
+}
-#ifdef HAVE_NODELAY
static VALUE
window_nodelay(VALUE obj, VALUE val)
{
- struct windata *winp;
- GetWINDOW(obj,winp);
+#ifdef HAVE_NODELAY
+ struct windata *winp;
+ GetWINDOW(obj,winp);
- /* nodelay() of NetBSD's libcurses returns no value */
+ /* nodelay() of NetBSD's libcurses returns no value */
#if defined(__NetBSD__) && !defined(NCURSES_VERSION)
- nodelay(winp->window, RTEST(val) ? TRUE : FALSE);
- return Qnil;
+ nodelay(winp->window, RTEST(val) ? TRUE : FALSE);
+ return Qnil;
#else
- return nodelay(winp->window,RTEST(val) ? TRUE : FALSE) == OK ? Qtrue : Qfalse;
+ return nodelay(winp->window,RTEST(val) ? TRUE : FALSE) == OK ? Qtrue : Qfalse;
#endif
-}
#else
-#define window_nodelay rb_f_notimplement
+ rb_notimplement();
#endif
+}
-#ifdef HAVE_WTIMEOUT
static VALUE
window_timeout(VALUE obj, VALUE delay)
{
- struct windata *winp;
- GetWINDOW(obj,winp);
+#ifdef HAVE_WTIMEOUT
+ struct windata *winp;
+ GetWINDOW(obj,winp);
- wtimeout(winp->window,NUM2INT(delay));
- return Qnil;
-}
+ wtimeout(winp->window,NUM2INT(delay));
+ return Qnil;
#else
-#define window_timeout rb_f_notimplement
+ rb_notimplement();
#endif
+}
/*------------------------- Initialization -------------------------*/
void
-Init_curses(void)
+Init_curses()
{
mCurses = rb_define_module("Curses");
mKey = rb_define_module_under(mCurses, "Key");
@@ -1499,12 +1456,6 @@ Init_curses(void)
rb_define_method(cMouseEvent, "bstate", curs_mouse_bstate, 0);
#endif /* USE_MOUSE */
- rb_define_module_function(mCurses, "ESCDELAY=", curses_escdelay_set, 1);
- rb_define_module_function(mCurses, "ESCDELAY", curses_escdelay_get, 0);
- rb_define_module_function(mCurses, "TABSIZE", curses_tabsize_get, 0);
- rb_define_module_function(mCurses, "TABSIZE=", curses_tabsize_set, 1);
-
- rb_define_module_function(mCurses, "use_default_colors", curses_use_default_colors, 0);
rb_define_module_function(mCurses, "init_screen", curses_init_screen, 0);
rb_define_module_function(mCurses, "close_screen", curses_close_screen, 0);
rb_define_module_function(mCurses, "closed?", curses_closed, 0);
@@ -1519,8 +1470,8 @@ Init_curses(void)
rb_define_module_function(mCurses, "noraw", curses_noraw, 0);
rb_define_module_function(mCurses, "cbreak", curses_cbreak, 0);
rb_define_module_function(mCurses, "nocbreak", curses_nocbreak, 0);
- rb_define_module_function(mCurses, "crmode", curses_nocbreak, 0);
- rb_define_module_function(mCurses, "nocrmode", curses_nocbreak, 0);
+ rb_define_alias(mCurses, "crmode", "cbreak");
+ rb_define_alias(mCurses, "nocrmode", "nocbreak");
rb_define_module_function(mCurses, "nl", curses_nl, 0);
rb_define_module_function(mCurses, "nonl", curses_nonl, 0);
rb_define_module_function(mCurses, "beep", curses_beep, 0);
@@ -1558,9 +1509,7 @@ Init_curses(void)
rb_define_module_function(mCurses, "has_colors?", curses_has_colors, 0);
rb_define_module_function(mCurses, "can_change_color?",
curses_can_change_color, 0);
- rb_define_module_function(mCurses, "colors", curses_colors, 0);
rb_define_module_function(mCurses, "color_content", curses_color_content, 1);
- rb_define_module_function(mCurses, "color_pairs", curses_color_pairs, 0);
rb_define_module_function(mCurses, "pair_content", curses_pair_content, 1);
rb_define_module_function(mCurses, "color_pair", curses_color_pair, 1);
rb_define_module_function(mCurses, "pair_number", curses_pair_number, 1);
@@ -1796,14 +1745,14 @@ Init_curses(void)
#ifdef KEY_F
/* KEY_F(n) : 0 <= n <= 63 */
{
- int i;
- char c[8];
- for (i=0; i<64; i++) {
- sprintf(c, "KEY_F%d", i);
- rb_define_const(mCurses, c, INT2NUM(KEY_F(i)));
- sprintf(c, "F%d", i);
- rb_define_const(mKey, c, INT2NUM(KEY_F(i)));
- }
+ int i;
+ char c[8];
+ for( i=0; i<64; i++ ){
+ sprintf(c, "KEY_F%d", i);
+ rb_define_const(mCurses, c, INT2NUM(KEY_F(i)));
+ sprintf(c, "F%d", i);
+ rb_define_const(mKey, c, INT2NUM(KEY_F(i)));
+ }
}
#endif
#ifdef KEY_DL
@@ -2139,12 +2088,12 @@ Init_curses(void)
rb_define_const(mKey, "MAX", INT2NUM(KEY_MAX));
#endif
{
- int c;
- char name[] = "KEY_CTRL_x";
- for (c = 'A'; c <= 'Z'; c++) {
- name[sizeof(name) - 2] = c;
- rb_define_const(mCurses, name, INT2FIX(c - 'A' + 1));
- }
+ int c;
+ char name[] = "KEY_CTRL_x";
+ for( c = 'A'; c <= 'Z'; c++ ){
+ sprintf(name, "KEY_CTRL_%c", c);
+ rb_define_const(mCurses, name, INT2FIX(c - 'A' + 1));
+ }
}
#undef rb_curses_define_const
diff --git a/ext/curses/extconf.rb b/ext/curses/extconf.rb
index 4172c8a6b6..0124bbbf4a 100644
--- a/ext/curses/extconf.rb
+++ b/ext/curses/extconf.rb
@@ -5,11 +5,9 @@ dir_config('ncurses')
dir_config('termcap')
make=false
-headers = []
-
have_library("mytinfo", "tgetent") if /bow/ =~ RUBY_PLATFORM
have_library("tinfo", "tgetent") or have_library("termcap", "tgetent")
-if have_header(*curses=%w"ncurses.h") and (have_library("ncursesw", "initscr") or have_library("ncurses", "initscr"))
+if have_header(*curses=%w"ncurses.h") and have_library("ncurses", "initscr")
make=true
elsif have_header(*curses=%w"ncurses/curses.h") and have_library("ncurses", "initscr")
make=true
@@ -21,16 +19,13 @@ elsif have_header(*curses=%w"curses.h") and have_library("curses", "initscr")
end
if make
- for f in %w(beep bkgd bkgdset curs_set deleteln doupdate flash getbkgd getnstr init isendwin keyname keypad resizeterm scrl set setscrreg ungetch wattroff wattron wattrset wbkgd wbkgdset wdeleteln wgetnstr wresize wscrl wsetscrreg def_prog_mode reset_prog_mode timeout wtimeout nodelay init_color wcolor_set use_default_colors)
+ for f in %w(beep bkgd bkgdset curs_set deleteln doupdate flash getbkgd getnstr init isendwin keyname keypad resizeterm scrl set setscrreg ungetch wattroff wattron wattrset wbkgd wbkgdset wdeleteln wgetnstr wresize wscrl wsetscrreg def_prog_mode reset_prog_mode timeout wtimeout nodelay init_color wcolor_set)
have_func(f) || (have_macro(f, curses) && $defs.push(format("-DHAVE_%s", f.upcase)))
end
flag = "-D_XOPEN_SOURCE_EXTENDED"
- if try_static_assert("sizeof(char*)>sizeof(int)", %w[stdio.h stdlib.h]+curses , flag)
+ src = "int test_var[(sizeof(char*)>sizeof(int))*2-1];"
+ if try_compile(cpp_include(%w[stdio.h stdlib.h]+curses)+src , flag)
$defs << flag
end
- have_var("ESCDELAY", curses)
- have_var("TABSIZE", curses)
- have_var("COLORS", curses)
- have_var("COLOR_PAIRS", curses)
create_makefile("curses")
end
diff --git a/ext/curses/view.rb b/ext/curses/view.rb
index e033fd8ae2..d9a82a57db 100644
--- a/ext/curses/view.rb
+++ b/ext/curses/view.rb
@@ -48,7 +48,7 @@ while TRUE
explicit = FALSE
n = 0
while TRUE
- c = getch
+ c = getch.chr
if c =~ /[0-9]/
n = 10 * n + c.to_i
else
@@ -67,10 +67,10 @@ while TRUE
else
break
end
- i += 1
+ i += 1
end
#wscrl(i)
-
+
when "p" #when KEY_UP
i = 0
while i < n
@@ -79,8 +79,8 @@ while TRUE
else
break
end
- i += 1
- end
+ i += 1
+ end
#wscrl(-i)
when "q"
diff --git a/ext/dbm/.cvsignore b/ext/dbm/.cvsignore
index 814345ece8..4088712231 100644
--- a/ext/dbm/.cvsignore
+++ b/ext/dbm/.cvsignore
@@ -1,4 +1,3 @@
Makefile
mkmf.log
*.def
-extconf.h
diff --git a/ext/dbm/dbm.c b/ext/dbm/dbm.c
index 84d331ae53..0247387fdc 100644
--- a/ext/dbm/dbm.c
+++ b/ext/dbm/dbm.c
@@ -3,6 +3,7 @@
dbm.c -
$Author$
+ $Date$
created at: Mon Jan 24 15:59:52 JST 1994
Copyright (C) 1995-2001 Yukihiro Matsumoto
@@ -31,7 +32,7 @@ struct dbmdata {
};
static void
-closed_dbm(void)
+closed_dbm()
{
rb_raise(rb_eDBMError, "closed DBM file");
}
@@ -48,16 +49,18 @@ closed_dbm(void)
}
static void
-free_dbm(struct dbmdata *dbmp)
+free_dbm(dbmp)
+ struct dbmdata *dbmp;
{
if (dbmp) {
if (dbmp->di_dbm) dbm_close(dbmp->di_dbm);
- xfree(dbmp);
+ free(dbmp);
}
}
static VALUE
-fdbm_close(VALUE obj)
+fdbm_close(obj)
+ VALUE obj;
{
struct dbmdata *dbmp;
@@ -69,7 +72,8 @@ fdbm_close(VALUE obj)
}
static VALUE
-fdbm_closed(VALUE obj)
+fdbm_closed(obj)
+ VALUE obj;
{
struct dbmdata *dbmp;
@@ -82,17 +86,21 @@ fdbm_closed(VALUE obj)
return Qfalse;
}
+static VALUE fdbm_alloc _((VALUE));
static VALUE
-fdbm_alloc(VALUE klass)
+fdbm_alloc(klass)
+ VALUE klass;
{
return Data_Wrap_Struct(klass, 0, free_dbm, 0);
}
static VALUE
-fdbm_initialize(int argc, VALUE *argv, VALUE obj)
+fdbm_initialize(argc, argv, obj)
+ int argc;
+ VALUE *argv;
+ VALUE obj;
{
- volatile VALUE file;
- VALUE vmode, vflags;
+ VALUE file, vmode, vflags;
DBM *dbm;
struct dbmdata *dbmp;
int mode, flags = 0;
@@ -110,28 +118,28 @@ fdbm_initialize(int argc, VALUE *argv, VALUE obj)
if (!NIL_P(vflags))
flags = NUM2INT(vflags);
- FilePathValue(file);
+ SafeStringValue(file);
if (flags & RUBY_DBM_RW_BIT) {
flags &= ~RUBY_DBM_RW_BIT;
- dbm = dbm_open(RSTRING_PTR(file), flags, mode);
+ dbm = dbm_open(RSTRING(file)->ptr, flags, mode);
}
else {
dbm = 0;
if (mode >= 0) {
- dbm = dbm_open(RSTRING_PTR(file), O_RDWR|O_CREAT, mode);
+ dbm = dbm_open(RSTRING(file)->ptr, O_RDWR|O_CREAT, mode);
}
if (!dbm) {
- dbm = dbm_open(RSTRING_PTR(file), O_RDWR, 0);
+ dbm = dbm_open(RSTRING(file)->ptr, O_RDWR, 0);
}
if (!dbm) {
- dbm = dbm_open(RSTRING_PTR(file), O_RDONLY, 0);
+ dbm = dbm_open(RSTRING(file)->ptr, O_RDONLY, 0);
}
}
if (!dbm) {
if (mode == -1) return Qnil;
- rb_sys_fail(RSTRING_PTR(file));
+ rb_sys_fail(RSTRING(file)->ptr);
}
dbmp = ALLOC(struct dbmdata);
@@ -143,7 +151,10 @@ fdbm_initialize(int argc, VALUE *argv, VALUE obj)
}
static VALUE
-fdbm_s_open(int argc, VALUE *argv, VALUE klass)
+fdbm_s_open(argc, argv, klass)
+ int argc;
+ VALUE *argv;
+ VALUE klass;
{
VALUE obj = Data_Wrap_Struct(klass, 0, free_dbm, 0);
@@ -159,15 +170,16 @@ fdbm_s_open(int argc, VALUE *argv, VALUE klass)
}
static VALUE
-fdbm_fetch(VALUE obj, VALUE keystr, VALUE ifnone)
+fdbm_fetch(obj, keystr, ifnone)
+ VALUE obj, keystr, ifnone;
{
datum key, value;
struct dbmdata *dbmp;
DBM *dbm;
- ExportStringValue(keystr);
- key.dptr = RSTRING_PTR(keystr);
- key.dsize = RSTRING_LEN(keystr);
+ StringValue(keystr);
+ key.dptr = RSTRING(keystr)->ptr;
+ key.dsize = RSTRING(keystr)->len;
GetDBM2(obj, dbmp, dbm);
value = dbm_fetch(dbm, key);
@@ -180,13 +192,17 @@ fdbm_fetch(VALUE obj, VALUE keystr, VALUE ifnone)
}
static VALUE
-fdbm_aref(VALUE obj, VALUE keystr)
+fdbm_aref(obj, keystr)
+ VALUE obj, keystr;
{
return fdbm_fetch(obj, keystr, Qnil);
}
static VALUE
-fdbm_fetch_m(int argc, VALUE *argv, VALUE obj)
+fdbm_fetch_m(argc, argv, obj)
+ int argc;
+ VALUE *argv;
+ VALUE obj;
{
VALUE keystr, valstr, ifnone;
@@ -199,21 +215,22 @@ fdbm_fetch_m(int argc, VALUE *argv, VALUE obj)
}
static VALUE
-fdbm_key(VALUE obj, VALUE valstr)
+fdbm_index(obj, valstr)
+ VALUE obj, valstr;
{
datum key, val;
struct dbmdata *dbmp;
DBM *dbm;
- ExportStringValue(valstr);
- val.dptr = RSTRING_PTR(valstr);
- val.dsize = RSTRING_LEN(valstr);
+ StringValue(valstr);
+ val.dptr = RSTRING(valstr)->ptr;
+ val.dsize = RSTRING(valstr)->len;
GetDBM2(obj, dbmp, dbm);
for (key = dbm_firstkey(dbm); key.dptr; key = dbm_nextkey(dbm)) {
val = dbm_fetch(dbm, key);
- if (val.dsize == RSTRING_LEN(valstr) &&
- memcmp(val.dptr, RSTRING_PTR(valstr), val.dsize) == 0) {
+ if (val.dsize == RSTRING(valstr)->len &&
+ memcmp(val.dptr, RSTRING(valstr)->ptr, val.dsize) == 0) {
return rb_tainted_str_new(key.dptr, key.dsize);
}
}
@@ -221,38 +238,68 @@ fdbm_key(VALUE obj, VALUE valstr)
}
static VALUE
-fdbm_index(VALUE hash, VALUE value)
+fdbm_indexes(argc, argv, obj)
+ int argc;
+ VALUE *argv;
+ VALUE obj;
{
- rb_warn("DBM#index is deprecated; use DBM#key");
- return fdbm_key(hash, value);
+ VALUE new;
+ int i;
+
+ new = rb_ary_new2(argc);
+ for (i=0; i<argc; i++) {
+ rb_ary_push(new, fdbm_fetch(obj, argv[i], Qnil));
+ }
+
+ return new;
}
static VALUE
-fdbm_select(VALUE obj)
+fdbm_select(argc, argv, obj)
+ int argc;
+ VALUE *argv;
+ VALUE obj;
{
- VALUE new = rb_ary_new();
- datum key, val;
- DBM *dbm;
- struct dbmdata *dbmp;
+ VALUE new = rb_ary_new2(argc);
+ int i;
- GetDBM2(obj, dbmp, dbm);
- for (key = dbm_firstkey(dbm); key.dptr; key = dbm_nextkey(dbm)) {
- VALUE assoc, v;
- val = dbm_fetch(dbm, key);
- 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);
+ if (rb_block_given_p()) {
+ datum key, val;
+ DBM *dbm;
+ struct dbmdata *dbmp;
+
+ if (argc > 0) {
+ rb_raise(rb_eArgError, "wrong number arguments(%d for 0)", argc);
}
- GetDBM2(obj, dbmp, dbm);
+ GetDBM2(obj, dbmp, dbm);
+ for (key = dbm_firstkey(dbm); key.dptr; key = dbm_nextkey(dbm)) {
+ VALUE assoc, v;
+ val = dbm_fetch(dbm, key);
+ 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);
+ }
+ GetDBM2(obj, dbmp, dbm);
+ }
+ }
+ else {
+ rb_warn("DBM#select(index..) is deprecated; use DBM#values_at");
+
+ for (i=0; i<argc; i++) {
+ rb_ary_push(new, fdbm_fetch(obj, argv[i], Qnil));
+ }
}
return new;
}
static VALUE
-fdbm_values_at(int argc, VALUE *argv, VALUE obj)
+fdbm_values_at(argc, argv, obj)
+ int argc;
+ VALUE *argv;
+ VALUE obj;
{
VALUE new = rb_ary_new2(argc);
int i;
@@ -265,14 +312,16 @@ fdbm_values_at(int argc, VALUE *argv, VALUE obj)
}
static void
-fdbm_modify(VALUE obj)
+fdbm_modify(obj)
+ VALUE obj;
{
rb_secure(4);
if (OBJ_FROZEN(obj)) rb_error_frozen("DBM");
}
static VALUE
-fdbm_delete(VALUE obj, VALUE keystr)
+fdbm_delete(obj, keystr)
+ VALUE obj, keystr;
{
datum key, value;
struct dbmdata *dbmp;
@@ -280,12 +329,11 @@ fdbm_delete(VALUE obj, VALUE keystr)
VALUE valstr;
fdbm_modify(obj);
- ExportStringValue(keystr);
- key.dptr = RSTRING_PTR(keystr);
- key.dsize = RSTRING_LEN(keystr);
+ StringValue(keystr);
+ key.dptr = RSTRING(keystr)->ptr;
+ key.dsize = RSTRING(keystr)->len;
GetDBM2(obj, dbmp, dbm);
-
value = dbm_fetch(dbm, key);
if (value.dptr == 0) {
if (rb_block_given_p()) return rb_yield(keystr);
@@ -306,7 +354,8 @@ fdbm_delete(VALUE obj, VALUE keystr)
}
static VALUE
-fdbm_shift(VALUE obj)
+fdbm_shift(obj)
+ VALUE obj;
{
datum key, val;
struct dbmdata *dbmp;
@@ -328,7 +377,8 @@ fdbm_shift(VALUE obj)
}
static VALUE
-fdbm_delete_if(VALUE obj)
+fdbm_delete_if(obj)
+ VALUE obj;
{
datum key, val;
struct dbmdata *dbmp;
@@ -352,23 +402,24 @@ fdbm_delete_if(VALUE obj)
GetDBM2(obj, dbmp, dbm);
}
- for (i = 0; i < RARRAY_LEN(ary); i++) {
- keystr = RARRAY_PTR(ary)[i];
- ExportStringValue(keystr);
- key.dptr = RSTRING_PTR(keystr);
- key.dsize = RSTRING_LEN(keystr);
+ for (i = 0; i < RARRAY(ary)->len; i++) {
+ keystr = RARRAY(ary)->ptr[i];
+ StringValue(keystr);
+ key.dptr = RSTRING(keystr)->ptr;
+ key.dsize = RSTRING(keystr)->len;
if (dbm_delete(dbm, key)) {
rb_raise(rb_eDBMError, "dbm_delete failed");
}
}
if (status) rb_jump_tag(status);
- if (n > 0) dbmp->di_size = n - RARRAY_LEN(ary);
+ if (n > 0) dbmp->di_size = n - RARRAY(ary)->len;
return obj;
}
static VALUE
-fdbm_clear(VALUE obj)
+fdbm_clear(obj)
+ VALUE obj;
{
datum key;
struct dbmdata *dbmp;
@@ -388,7 +439,8 @@ fdbm_clear(VALUE obj)
}
static VALUE
-fdbm_invert(VALUE obj)
+fdbm_invert(obj)
+ VALUE obj;
{
datum key, val;
struct dbmdata *dbmp;
@@ -406,36 +458,49 @@ fdbm_invert(VALUE obj)
return hash;
}
-static VALUE fdbm_store(VALUE,VALUE,VALUE);
+static VALUE each_pair _((VALUE));
static VALUE
-update_i(VALUE pair, VALUE dbm)
+each_pair(obj)
+ VALUE obj;
+{
+ return rb_funcall(obj, rb_intern("each_pair"), 0, 0);
+}
+
+static VALUE fdbm_store _((VALUE,VALUE,VALUE));
+
+static VALUE
+update_i(pair, dbm)
+ VALUE pair, dbm;
{
Check_Type(pair, T_ARRAY);
- if (RARRAY_LEN(pair) < 2) {
+ if (RARRAY(pair)->len < 2) {
rb_raise(rb_eArgError, "pair must be [key, value]");
}
- fdbm_store(dbm, RARRAY_PTR(pair)[0], RARRAY_PTR(pair)[1]);
+ fdbm_store(dbm, RARRAY(pair)->ptr[0], RARRAY(pair)->ptr[1]);
return Qnil;
}
static VALUE
-fdbm_update(VALUE obj, VALUE other)
+fdbm_update(obj, other)
+ VALUE obj, other;
{
- rb_block_call(other, rb_intern("each_pair"), 0, 0, update_i, obj);
+ rb_iterate(each_pair, other, update_i, obj);
return obj;
}
static VALUE
-fdbm_replace(VALUE obj, VALUE other)
+fdbm_replace(obj, other)
+ VALUE obj, other;
{
fdbm_clear(obj);
- rb_block_call(other, rb_intern("each_pair"), 0, 0, update_i, obj);
+ rb_iterate(each_pair, other, update_i, obj);
return obj;
}
static VALUE
-fdbm_store(VALUE obj, VALUE keystr, VALUE valstr)
+fdbm_store(obj, keystr, valstr)
+ VALUE obj, keystr, valstr;
{
datum key, val;
struct dbmdata *dbmp;
@@ -445,11 +510,11 @@ fdbm_store(VALUE obj, VALUE keystr, VALUE valstr)
keystr = rb_obj_as_string(keystr);
valstr = rb_obj_as_string(valstr);
- key.dptr = RSTRING_PTR(keystr);
- key.dsize = RSTRING_LEN(keystr);
+ key.dptr = RSTRING(keystr)->ptr;
+ key.dsize = RSTRING(keystr)->len;
- val.dptr = RSTRING_PTR(valstr);
- val.dsize = RSTRING_LEN(valstr);
+ val.dptr = RSTRING(valstr)->ptr;
+ val.dsize = RSTRING(valstr)->len;
GetDBM2(obj, dbmp, dbm);
dbmp->di_size = -1;
@@ -465,7 +530,8 @@ fdbm_store(VALUE obj, VALUE keystr, VALUE valstr)
}
static VALUE
-fdbm_length(VALUE obj)
+fdbm_length(obj)
+ VALUE obj;
{
datum key;
struct dbmdata *dbmp;
@@ -484,7 +550,8 @@ fdbm_length(VALUE obj)
}
static VALUE
-fdbm_empty_p(VALUE obj)
+fdbm_empty_p(obj)
+ VALUE obj;
{
datum key;
struct dbmdata *dbmp;
@@ -507,14 +574,13 @@ fdbm_empty_p(VALUE obj)
}
static VALUE
-fdbm_each_value(VALUE obj)
+fdbm_each_value(obj)
+ VALUE obj;
{
datum key, val;
struct dbmdata *dbmp;
DBM *dbm;
- RETURN_ENUMERATOR(obj, 0, 0);
-
GetDBM2(obj, dbmp, dbm);
for (key = dbm_firstkey(dbm); key.dptr; key = dbm_nextkey(dbm)) {
val = dbm_fetch(dbm, key);
@@ -525,14 +591,13 @@ fdbm_each_value(VALUE obj)
}
static VALUE
-fdbm_each_key(VALUE obj)
+fdbm_each_key(obj)
+ VALUE obj;
{
datum key;
struct dbmdata *dbmp;
DBM *dbm;
- RETURN_ENUMERATOR(obj, 0, 0);
-
GetDBM2(obj, dbmp, dbm);
for (key = dbm_firstkey(dbm); key.dptr; key = dbm_nextkey(dbm)) {
rb_yield(rb_tainted_str_new(key.dptr, key.dsize));
@@ -542,15 +607,14 @@ fdbm_each_key(VALUE obj)
}
static VALUE
-fdbm_each_pair(VALUE obj)
+fdbm_each_pair(obj)
+ VALUE obj;
{
datum key, val;
DBM *dbm;
struct dbmdata *dbmp;
VALUE keystr, valstr;
- RETURN_ENUMERATOR(obj, 0, 0);
-
GetDBM2(obj, dbmp, dbm);
for (key = dbm_firstkey(dbm); key.dptr; key = dbm_nextkey(dbm)) {
@@ -565,7 +629,8 @@ fdbm_each_pair(VALUE obj)
}
static VALUE
-fdbm_keys(VALUE obj)
+fdbm_keys(obj)
+ VALUE obj;
{
datum key;
struct dbmdata *dbmp;
@@ -583,7 +648,8 @@ fdbm_keys(VALUE obj)
}
static VALUE
-fdbm_values(VALUE obj)
+fdbm_values(obj)
+ VALUE obj;
{
datum key, val;
struct dbmdata *dbmp;
@@ -601,15 +667,16 @@ fdbm_values(VALUE obj)
}
static VALUE
-fdbm_has_key(VALUE obj, VALUE keystr)
+fdbm_has_key(obj, keystr)
+ VALUE obj, keystr;
{
datum key, val;
struct dbmdata *dbmp;
DBM *dbm;
- ExportStringValue(keystr);
- key.dptr = RSTRING_PTR(keystr);
- key.dsize = RSTRING_LEN(keystr);
+ StringValue(keystr);
+ key.dptr = RSTRING(keystr)->ptr;
+ key.dsize = RSTRING(keystr)->len;
GetDBM2(obj, dbmp, dbm);
val = dbm_fetch(dbm, key);
@@ -618,28 +685,30 @@ fdbm_has_key(VALUE obj, VALUE keystr)
}
static VALUE
-fdbm_has_value(VALUE obj, VALUE valstr)
+fdbm_has_value(obj, valstr)
+ VALUE obj, valstr;
{
datum key, val;
struct dbmdata *dbmp;
DBM *dbm;
- ExportStringValue(valstr);
- val.dptr = RSTRING_PTR(valstr);
- val.dsize = RSTRING_LEN(valstr);
+ StringValue(valstr);
+ val.dptr = RSTRING(valstr)->ptr;
+ val.dsize = RSTRING(valstr)->len;
GetDBM2(obj, dbmp, dbm);
for (key = dbm_firstkey(dbm); key.dptr; key = dbm_nextkey(dbm)) {
val = dbm_fetch(dbm, key);
- if (val.dsize == RSTRING_LEN(valstr) &&
- memcmp(val.dptr, RSTRING_PTR(valstr), val.dsize) == 0)
+ if (val.dsize == RSTRING(valstr)->len &&
+ memcmp(val.dptr, RSTRING(valstr)->ptr, val.dsize) == 0)
return Qtrue;
}
return Qfalse;
}
static VALUE
-fdbm_to_a(VALUE obj)
+fdbm_to_a(obj)
+ VALUE obj;
{
datum key, val;
struct dbmdata *dbmp;
@@ -658,7 +727,8 @@ fdbm_to_a(VALUE obj)
}
static VALUE
-fdbm_to_hash(VALUE obj)
+fdbm_to_hash(obj)
+ VALUE obj;
{
datum key, val;
struct dbmdata *dbmp;
@@ -677,13 +747,14 @@ fdbm_to_hash(VALUE obj)
}
static VALUE
-fdbm_reject(VALUE obj)
+fdbm_reject(obj)
+ VALUE obj;
{
return rb_hash_delete_if(fdbm_to_hash(obj));
}
void
-Init_dbm(void)
+Init_dbm()
{
rb_cDBM = rb_define_class("DBM", rb_cObject);
rb_eDBMError = rb_define_class("DBMError", rb_eStandardError);
@@ -700,8 +771,9 @@ Init_dbm(void)
rb_define_method(rb_cDBM, "[]=", fdbm_store, 2);
rb_define_method(rb_cDBM, "store", fdbm_store, 2);
rb_define_method(rb_cDBM, "index", fdbm_index, 1);
- rb_define_method(rb_cDBM, "key", fdbm_key, 1);
- rb_define_method(rb_cDBM, "select", fdbm_select, 0);
+ rb_define_method(rb_cDBM, "indexes", fdbm_indexes, -1);
+ rb_define_method(rb_cDBM, "indices", fdbm_indexes, -1);
+ rb_define_method(rb_cDBM, "select", fdbm_select, -1);
rb_define_method(rb_cDBM, "values_at", fdbm_values_at, -1);
rb_define_method(rb_cDBM, "length", fdbm_length, 0);
rb_define_method(rb_cDBM, "size", fdbm_length, 0);
diff --git a/ext/dbm/extconf.rb b/ext/dbm/extconf.rb
index 4d12264063..0074ab605b 100644
--- a/ext/dbm/extconf.rb
+++ b/ext/dbm/extconf.rb
@@ -36,7 +36,7 @@ def headers.db_check(db)
db_prefix ||= ""
if (have_library(db, db_prefix+"dbm_open") || have_func(db_prefix+"dbm_open")) and
- hdr = self.fetch(db, ["ndbm.h"]).find {|h| have_type("DBM", h, hsearch)}
+ hdr = self.fetch(db, ["ndbm.h"]).find {|hdr| have_type("DBM", hdr, hsearch)}
have_func(db_prefix+"dbm_clearerr") unless have_gdbm
$defs << hsearch if hsearch
$defs << '-DDBM_HDR="<'+hdr+'>"'
diff --git a/ext/digest/.cvsignore b/ext/digest/.cvsignore
index 814345ece8..4088712231 100644
--- a/ext/digest/.cvsignore
+++ b/ext/digest/.cvsignore
@@ -1,4 +1,3 @@
Makefile
mkmf.log
*.def
-extconf.h
diff --git a/ext/digest/bubblebabble/.cvsignore b/ext/digest/bubblebabble/.cvsignore
index 814345ece8..4088712231 100644
--- a/ext/digest/bubblebabble/.cvsignore
+++ b/ext/digest/bubblebabble/.cvsignore
@@ -1,4 +1,3 @@
Makefile
mkmf.log
*.def
-extconf.h
diff --git a/ext/digest/defs.h b/ext/digest/defs.h
index 77a134f364..b9a3470e65 100644
--- a/ext/digest/defs.h
+++ b/ext/digest/defs.h
@@ -16,4 +16,18 @@
# define __END_DECLS
#endif
+#if defined(HAVE_INTTYPES_H)
+# include <inttypes.h>
+#elif !defined __CYGWIN__ || !defined __uint8_t_defined
+ typedef unsigned char uint8_t;
+ typedef unsigned int uint32_t;
+# if SIZEOF_LONG == 8
+ typedef unsigned long uint64_t;
+# elif SIZEOF_LONG_LONG == 8
+ typedef unsigned LONG_LONG uint64_t;
+# else
+# define NO_UINT64_T
+# endif
+#endif
+
#endif /* DEFS_H */
diff --git a/ext/digest/digest.c b/ext/digest/digest.c
index c3e9546ab4..0b910e8c47 100644
--- a/ext/digest/digest.c
+++ b/ext/digest/digest.c
@@ -266,7 +266,7 @@ rb_digest_instance_inspect(VALUE self)
{
VALUE str;
size_t digest_len = 32; /* about this size at least */
- const char *cname;
+ char *cname;
cname = rb_obj_classname(self);
@@ -426,7 +426,7 @@ get_digest_base_metadata(VALUE klass)
VALUE obj;
rb_digest_metadata_t *algo;
- for (p = klass; p; p = RCLASS_SUPER(p)) {
+ for (p = klass; p; p = RCLASS(p)->super) {
if (rb_ivar_defined(p, id_metadata)) {
obj = rb_ivar_get(p, id_metadata);
break;
@@ -469,7 +469,7 @@ rb_digest_base_alloc(VALUE klass)
pctx = xmalloc(algo->ctx_size);
algo->init_func(pctx);
- obj = Data_Wrap_Struct(klass, 0, xfree, pctx);
+ obj = Data_Wrap_Struct(klass, 0, free, pctx);
return obj;
}
diff --git a/ext/digest/extconf.rb b/ext/digest/extconf.rb
index a20ca8d68f..cf9127ecc0 100644
--- a/ext/digest/extconf.rb
+++ b/ext/digest/extconf.rb
@@ -4,7 +4,7 @@
require "mkmf"
$INSTALLFILES = {
- "digest.h" => "$(HDRDIR)"
+ "digest.h" => "$(RUBYARCHDIR)"
}
create_makefile("digest")
diff --git a/ext/digest/lib/digest.rb b/ext/digest/lib/digest.rb
index e42f984f95..0c4ee3c2cc 100644
--- a/ext/digest/lib/digest.rb
+++ b/ext/digest/lib/digest.rb
@@ -22,7 +22,7 @@ module Digest
class ::Digest::Class
# creates a digest object and reads a given file, _name_.
- #
+ #
# p Digest::SHA256.file("X11R6.8.2-src.tar.bz2").hexdigest
# # => "f02e3c85572dc9ad7cb77c2a638e3be24cc1b5bea9fdbb0b0299c9668475c534"
def self.file(name)
diff --git a/ext/digest/lib/digest/hmac.rb b/ext/digest/lib/digest/hmac.rb
deleted file mode 100644
index f50fef2948..0000000000
--- a/ext/digest/lib/digest/hmac.rb
+++ /dev/null
@@ -1,274 +0,0 @@
-# = digest/hmac.rb
-#
-# An implementation of HMAC keyed-hashing algorithm
-#
-# == Overview
-#
-# This library adds a method named hmac() to Digest classes, which
-# creates a Digest class for calculating HMAC digests.
-#
-# == Examples
-#
-# require 'digest/hmac'
-#
-# # one-liner example
-# puts Digest::HMAC.hexdigest("data", "hash key", Digest::SHA1)
-#
-# # rather longer one
-# hmac = Digest::HMAC.new("foo", Digest::RMD160)
-#
-# buf = ""
-# while stream.read(16384, buf)
-# hmac.update(buf)
-# end
-#
-# puts hmac.bubblebabble
-#
-# == License
-#
-# Copyright (c) 2006 Akinori MUSHA <knu@iDaemons.org>
-#
-# Documentation by Akinori MUSHA
-#
-# All rights reserved. You can redistribute and/or modify it under
-# the same terms as Ruby.
-#
-# $Id$
-#
-
-require 'digest'
-
-module Digest
- class HMAC < Digest::Class
- def initialize(key, digester)
- @md = digester.new
-
- block_len = @md.block_length
-
- if key.bytesize > block_len
- key = @md.digest(key)
- end
-
- ipad = Array.new(block_len).fill(0x36)
- opad = Array.new(block_len).fill(0x5c)
-
- key.bytes.each_with_index { |c, i|
- ipad[i] ^= c
- opad[i] ^= c
- }
-
- @key = key.freeze
- @ipad = ipad.inject('') { |s, c| s << c.chr }.freeze
- @opad = opad.inject('') { |s, c| s << c.chr }.freeze
- @md.update(@ipad)
- end
-
- def initialize_copy(other)
- @md = other.instance_eval { @md.clone }
- end
-
- def update(text)
- @md.update(text)
- self
- end
- alias << update
-
- def reset
- @md.reset
- @md.update(@ipad)
- self
- end
-
- def finish
- d = @md.digest!
- @md.update(@opad)
- @md.update(d)
- @md.digest!
- end
- private :finish
-
- def digest_length
- @md.digest_length
- end
-
- def block_length
- @md.block_length
- end
-
- def inspect
- sprintf('#<%s: key=%s, digest=%s>', self.class.name, @key.inspect, @md.inspect.sub(/^\#<(.*)>$/) { $1 });
- end
- end
-end
-
-if $0 == __FILE__
- eval DATA.read, nil, $0, __LINE__+4
-end
-
-__END__
-
-require 'test/unit'
-
-module TM_HMAC
- def test_s_hexdigest
- cases.each { |h|
- digesters.each { |d|
- assert_equal(h[:hexdigest], Digest::HMAC.hexdigest(h[:data], h[:key], d))
- }
- }
- end
-
- def test_hexdigest
- cases.each { |h|
- digesters.each { |d|
- hmac = Digest::HMAC.new(h[:key], d)
-
- hmac.update(h[:data])
-
- assert_equal(h[:hexdigest], hmac.hexdigest)
- }
- }
- end
-
- def test_reset
- cases.each { |h|
- digesters.each { |d|
- hmac = Digest::HMAC.new(h[:key], d)
- hmac.update("test")
- hmac.reset
- hmac.update(h[:data])
-
- assert_equal(h[:hexdigest], hmac.hexdigest)
- }
- }
- end
-end
-
-class TC_HMAC_MD5 < Test::Unit::TestCase
- include TM_HMAC
-
- def digesters
- [Digest::MD5, Digest::MD5.new]
- end
-
- # Taken from RFC 2202: Test Cases for HMAC-MD5 and HMAC-SHA-1
- def cases
- [
- {
- :key => "\x0b" * 16,
- :data => "Hi There",
- :hexdigest => "9294727a3638bb1c13f48ef8158bfc9d",
- }, {
- :key => "Jefe",
- :data => "what do ya want for nothing?",
- :hexdigest => "750c783e6ab0b503eaa86e310a5db738",
- }, {
- :key => "\xaa" * 16,
- :data => "\xdd" * 50,
- :hexdigest => "56be34521d144c88dbb8c733f0e8b3f6",
- }, {
- :key => "\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19",
- :data => "\xcd" * 50,
- :hexdigest => "697eaf0aca3a3aea3a75164746ffaa79",
- }, {
- :key => "\x0c" * 16,
- :data => "Test With Truncation",
- :hexdigest => "56461ef2342edc00f9bab995690efd4c",
- }, {
- :key => "\xaa" * 80,
- :data => "Test Using Larger Than Block-Size Key - Hash Key First",
- :hexdigest => "6b1ab7fe4bd7bf8f0b62e6ce61b9d0cd",
- }, {
- :key => "\xaa" * 80,
- :data => "Test Using Larger Than Block-Size Key and Larger Than One Block-Size Data",
- :hexdigest => "6f630fad67cda0ee1fb1f562db3aa53e",
- }
- ]
- end
-end
-
-class TC_HMAC_SHA1 < Test::Unit::TestCase
- include TM_HMAC
-
- def digesters
- [Digest::SHA1, Digest::SHA1.new]
- end
-
- # Taken from RFC 2202: Test Cases for HMAC-MD5 and HMAC-SHA-1
- def cases
- [
- {
- :key => "\x0b" * 20,
- :data => "Hi There",
- :hexdigest => "b617318655057264e28bc0b6fb378c8ef146be00",
- }, {
- :key => "Jefe",
- :data => "what do ya want for nothing?",
- :hexdigest => "effcdf6ae5eb2fa2d27416d5f184df9c259a7c79",
- }, {
- :key => "\xaa" * 20,
- :data => "\xdd" * 50,
- :hexdigest => "125d7342b9ac11cd91a39af48aa17b4f63f175d3",
- }, {
- :key => "\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19",
- :data => "\xcd" * 50,
- :hexdigest => "4c9007f4026250c6bc8414f9bf50c86c2d7235da",
- }, {
- :key => "\x0c" * 20,
- :data => "Test With Truncation",
- :hexdigest => "4c1a03424b55e07fe7f27be1d58bb9324a9a5a04",
- }, {
- :key => "\xaa" * 80,
- :data => "Test Using Larger Than Block-Size Key - Hash Key First",
- :hexdigest => "aa4ae5e15272d00e95705637ce8a3b55ed402112",
- }, {
- :key => "\xaa" * 80,
- :data => "Test Using Larger Than Block-Size Key and Larger Than One Block-Size Data",
- :hexdigest => "e8e99d0f45237d786d6bbaa7965c7808bbff1a91",
- }
- ]
- end
-end
-
-class TC_HMAC_RMD160 < Test::Unit::TestCase
- include TM_HMAC
-
- def digesters
- [Digest::RMD160, Digest::RMD160.new]
- end
-
- # Taken from RFC 2286: Test Cases for HMAC-RIPEMD160 and HMAC-RIPEMD128
- def cases
- [
- {
- :key => "\x0b" * 20,
- :data => "Hi There",
- :hexdigest => "24cb4bd67d20fc1a5d2ed7732dcc39377f0a5668",
- }, {
- :key => "Jefe",
- :data => "what do ya want for nothing?",
- :hexdigest => "dda6c0213a485a9e24f4742064a7f033b43c4069",
- }, {
- :key => "\xaa" * 20,
- :data => "\xdd" * 50,
- :hexdigest => "b0b105360de759960ab4f35298e116e295d8e7c1",
- }, {
- :key => "\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19",
- :data => "\xcd" * 50,
- :hexdigest => "d5ca862f4d21d5e610e18b4cf1beb97a4365ecf4",
- }, {
- :key => "\x0c" * 20,
- :data => "Test With Truncation",
- :hexdigest => "7619693978f91d90539ae786500ff3d8e0518e39",
- }, {
- :key => "\xaa" * 80,
- :data => "Test Using Larger Than Block-Size Key - Hash Key First",
- :hexdigest => "6466ca07ac5eac29e1bd523e5ada7605b791fd8b",
- }, {
- :key => "\xaa" * 80,
- :data => "Test Using Larger Than Block-Size Key and Larger Than One Block-Size Data",
- :hexdigest => "69ea60798d71616cce5fd0871e23754cd75d5a0a",
- }
- ]
- end
-end
diff --git a/ext/digest/lib/md5.rb b/ext/digest/lib/md5.rb
new file mode 100644
index 0000000000..c399f2de1d
--- /dev/null
+++ b/ext/digest/lib/md5.rb
@@ -0,0 +1,23 @@
+# just for compatibility; requiring "md5" is obsoleted
+#
+# $RoughId: md5.rb,v 1.4 2001/07/13 15:38:27 knu Exp $
+# $Id$
+
+require 'digest/md5'
+
+class MD5 < Digest::MD5
+ class << self
+ alias orig_new new
+ def new(str = nil)
+ if str
+ orig_new.update(str)
+ else
+ orig_new
+ end
+ end
+
+ def md5(*args)
+ new(*args)
+ end
+ end
+end
diff --git a/ext/digest/lib/sha1.rb b/ext/digest/lib/sha1.rb
new file mode 100644
index 0000000000..4446e12e8d
--- /dev/null
+++ b/ext/digest/lib/sha1.rb
@@ -0,0 +1,23 @@
+# just for compatibility; requiring "sha1" is obsoleted
+#
+# $RoughId: sha1.rb,v 1.4 2001/07/13 15:38:27 knu Exp $
+# $Id$
+
+require 'digest/sha1'
+
+class SHA1 < Digest::SHA1
+ class << self
+ alias orig_new new
+ def new(str = nil)
+ if str
+ orig_new.update(str)
+ else
+ orig_new
+ end
+ end
+
+ def sha1(*args)
+ new(*args)
+ end
+ end
+end
diff --git a/ext/digest/md5/.cvsignore b/ext/digest/md5/.cvsignore
index 814345ece8..4088712231 100644
--- a/ext/digest/md5/.cvsignore
+++ b/ext/digest/md5/.cvsignore
@@ -1,4 +1,3 @@
Makefile
mkmf.log
*.def
-extconf.h
diff --git a/ext/digest/md5/md5.c b/ext/digest/md5/md5.c
index 518f8239ed..993bc47a06 100644
--- a/ext/digest/md5/md5.c
+++ b/ext/digest/md5/md5.c
@@ -60,7 +60,6 @@
* A.5 of RFC 1321, reproduced below.
*/
#include <string.h>
-int
main()
{
static const char *const test[7*2] = {
@@ -101,7 +100,6 @@ main()
*/
#ifdef COMPUTE_T_VALUES
#include <math.h>
-int
main()
{
int i;
diff --git a/ext/digest/md5/md5init.c b/ext/digest/md5/md5init.c
index d1229b5c6e..17658f4fce 100644
--- a/ext/digest/md5/md5init.c
+++ b/ext/digest/md5/md5init.c
@@ -8,7 +8,7 @@
#include "md5.h"
#endif
-static const rb_digest_metadata_t md5 = {
+static rb_digest_metadata_t md5 = {
RUBY_DIGEST_API_VERSION,
MD5_DIGEST_LENGTH,
MD5_BLOCK_LENGTH,
@@ -36,5 +36,5 @@ Init_md5()
cDigest_MD5 = rb_define_class_under(mDigest, "MD5", cDigest_Base);
rb_ivar_set(cDigest_MD5, rb_intern("metadata"),
- Data_Wrap_Struct(rb_cObject, 0, 0, (void *)&md5));
+ Data_Wrap_Struct(rb_cObject, 0, 0, &md5));
}
diff --git a/ext/digest/rmd160/.cvsignore b/ext/digest/rmd160/.cvsignore
index 814345ece8..4088712231 100644
--- a/ext/digest/rmd160/.cvsignore
+++ b/ext/digest/rmd160/.cvsignore
@@ -1,4 +1,3 @@
Makefile
mkmf.log
*.def
-extconf.h
diff --git a/ext/digest/rmd160/rmd160init.c b/ext/digest/rmd160/rmd160init.c
index 0839f1b820..763867df86 100644
--- a/ext/digest/rmd160/rmd160init.c
+++ b/ext/digest/rmd160/rmd160init.c
@@ -8,7 +8,7 @@
#include "rmd160.h"
#endif
-static const rb_digest_metadata_t rmd160 = {
+static rb_digest_metadata_t rmd160 = {
RUBY_DIGEST_API_VERSION,
RMD160_DIGEST_LENGTH,
RMD160_BLOCK_LENGTH,
@@ -36,5 +36,5 @@ Init_rmd160()
cDigest_RMD160 = rb_define_class_under(mDigest, "RMD160", cDigest_Base);
rb_ivar_set(cDigest_RMD160, rb_intern("metadata"),
- Data_Wrap_Struct(rb_cObject, 0, 0, (void *)&rmd160));
+ Data_Wrap_Struct(rb_cObject, 0, 0, &rmd160));
}
diff --git a/ext/digest/sha1/.cvsignore b/ext/digest/sha1/.cvsignore
index 814345ece8..4088712231 100644
--- a/ext/digest/sha1/.cvsignore
+++ b/ext/digest/sha1/.cvsignore
@@ -1,4 +1,3 @@
Makefile
mkmf.log
*.def
-extconf.h
diff --git a/ext/digest/sha1/sha1init.c b/ext/digest/sha1/sha1init.c
index d46a1cd67d..b2146f05a9 100644
--- a/ext/digest/sha1/sha1init.c
+++ b/ext/digest/sha1/sha1init.c
@@ -8,7 +8,7 @@
#include "sha1.h"
#endif
-static const rb_digest_metadata_t sha1 = {
+static rb_digest_metadata_t sha1 = {
RUBY_DIGEST_API_VERSION,
SHA1_DIGEST_LENGTH,
SHA1_BLOCK_LENGTH,
@@ -36,5 +36,5 @@ Init_sha1()
cDigest_SHA1 = rb_define_class_under(mDigest, "SHA1", cDigest_Base);
rb_ivar_set(cDigest_SHA1, rb_intern("metadata"),
- Data_Wrap_Struct(rb_cObject, 0, 0, (void *)&sha1));
+ Data_Wrap_Struct(rb_cObject, 0, 0, &sha1));
}
diff --git a/ext/digest/sha2/.cvsignore b/ext/digest/sha2/.cvsignore
index 814345ece8..4088712231 100644
--- a/ext/digest/sha2/.cvsignore
+++ b/ext/digest/sha2/.cvsignore
@@ -1,4 +1,3 @@
Makefile
mkmf.log
*.def
-extconf.h
diff --git a/ext/digest/sha2/sha2init.c b/ext/digest/sha2/sha2init.c
index 8b79e950a6..c83a29316a 100644
--- a/ext/digest/sha2/sha2init.c
+++ b/ext/digest/sha2/sha2init.c
@@ -7,7 +7,7 @@
#define FOREACH_BITLEN(func) func(256) func(384) func(512)
#define DEFINE_ALGO_METADATA(bitlen) \
-static const rb_digest_metadata_t sha##bitlen = { \
+static rb_digest_metadata_t sha##bitlen = { \
RUBY_DIGEST_API_VERSION, \
SHA##bitlen##_DIGEST_LENGTH, \
SHA##bitlen##_BLOCK_LENGTH, \
@@ -46,7 +46,7 @@ Init_sha2()
cDigest_SHA##bitlen = rb_define_class_under(mDigest, "SHA" #bitlen, cDigest_Base); \
\
rb_ivar_set(cDigest_SHA##bitlen, id_metadata, \
- Data_Wrap_Struct(rb_cObject, 0, 0, (void *)&sha##bitlen));
+ Data_Wrap_Struct(rb_cObject, 0, 0, &sha##bitlen));
FOREACH_BITLEN(DEFINE_ALGO_CLASS)
}
diff --git a/ext/dl/.cvsignore b/ext/dl/.cvsignore
index 6c0b25a1c5..6d884b6cec 100644
--- a/ext/dl/.cvsignore
+++ b/ext/dl/.cvsignore
@@ -2,9 +2,7 @@ Makefile
mkmf.log
dlconfig.h
dlconfig.rb
-callback.h
*.func
*.o
*~
*.def
-extconf.h
diff --git a/ext/dl/callback/depend b/ext/dl/callback/depend
deleted file mode 100644
index 7a1dc1ee62..0000000000
--- a/ext/dl/callback/depend
+++ /dev/null
@@ -1,15 +0,0 @@
-src: callback.c \
- callback-0.c callback-1.c callback-2.c \
- callback-3.c callback-4.c callback-5.c \
- callback-6.c callback-7.c callback-8.c
-
-$(OBJS): $(hdrdir)/ruby.h
-
-callback-0.c callback-1.c callback-2.c \
-callback-3.c callback-4.c callback-5.c \
-callback-6.c callback-7.c callback-8.c \
- : callback.c
-
-callback.c: $(srcdir)/mkcallback.rb $(srcdir)/../dl.h
- @echo "generating callback.c"
- @$(RUBY) $(srcdir)/mkcallback.rb -output=callback $(srcdir)/../dl.h
diff --git a/ext/dl/callback/extconf.rb b/ext/dl/callback/extconf.rb
deleted file mode 100644
index 6c3387670d..0000000000
--- a/ext/dl/callback/extconf.rb
+++ /dev/null
@@ -1,14 +0,0 @@
-require 'mkmf'
-
-if compiled?("dl")
- callbacks = (0..8).map{|i| "callback-#{i}"}.unshift("callback")
- callback_srcs = callbacks.map{|basename| "#{basename}.c"}
- callback_objs = callbacks.map{|basename| "#{basename}.o"}
-
- $distcleanfiles << '$(SRCS)'
- $srcs = callback_srcs
- $objs = callback_objs
- $INCFLAGS << " -I$(srcdir)/.."
-
- create_makefile("dl/callback")
-end
diff --git a/ext/dl/callback/mkcallback.rb b/ext/dl/callback/mkcallback.rb
deleted file mode 100644
index d2f9e3f2e1..0000000000
--- a/ext/dl/callback/mkcallback.rb
+++ /dev/null
@@ -1,238 +0,0 @@
-#!ruby -s
-$output ||= "callback"
-$out = open("#{$output}.c", "w")
-
-$dl_h = ARGV[0] || "dl.h"
-
-# import DLSTACK_SIZE, DLSTACK_ARGS and so on
-File.open($dl_h){|f|
- pre = ""
- f.each{|line|
- line.chop!
- if( line[-1] == ?\\ )
- line.chop!
- line.concat(" ")
- pre += line
- next
- end
- if( pre.size > 0 )
- line = pre + line
- pre = ""
- end
- case line
- when /#define\s+DLSTACK_SIZE\s+\(?(\d+)\)?/
- DLSTACK_SIZE = $1.to_i
- when /#define\s+DLSTACK_ARGS\s+(.+)/
- DLSTACK_ARGS = $1.to_i
- when /#define\s+DLTYPE_([A-Z_]+)\s+\(?(\d+)\)?/
- eval("#{$1} = #{$2}")
- when /#define\s+MAX_DLTYPE\s+\(?(\d+)\)?/
- MAX_DLTYPE = $1.to_i
- when /#define\s+MAX_CALLBACK\s+\(?(\d+)\)?/
- MAX_CALLBACK = $1.to_i
- end
- }
-}
-
-CDECL = "cdecl"
-STDCALL = "stdcall"
-
-CALLTYPES = [CDECL, STDCALL]
-
-DLTYPE = {
- VOID => {
- :name => 'void',
- :type => 'void',
- :conv => nil,
- },
- CHAR => {
- :name => 'char',
- :type => 'char',
- :conv => 'NUM2CHR(%s)'
- },
- SHORT => {
- :name => 'short',
- :type => 'short',
- :conv => 'NUM2INT(%s)',
- },
- INT => {
- :name => 'int',
- :type => 'int',
- :conv => 'NUM2INT(%s)',
- },
- LONG => {
- :name => 'long',
- :type => 'long',
- :conv => 'NUM2LONG(%s)',
- },
- LONG_LONG => {
- :name => 'long_long',
- :type => 'LONG_LONG',
- :conv => 'NUM2LL(%s)',
- },
- FLOAT => {
- :name => 'float',
- :type => 'float',
- :conv => '(float)RFLOAT_VALUE(%s)',
- },
- DOUBLE => {
- :name => 'double',
- :type => 'double',
- :conv => 'RFLOAT_VALUE(%s)',
- },
- VOIDP => {
- :name => 'ptr',
- :type => 'void *',
- :conv => 'NUM2PTR(%s)',
- },
-}
-
-
-def func_name(ty, argc, n, calltype)
- "rb_dl_callback_#{DLTYPE[ty][:name]}_#{argc}_#{n}_#{calltype}"
-end
-
-$out << (<<EOS)
-#include "ruby.h"
-
-VALUE rb_DLCdeclCallbackAddrs, rb_DLCdeclCallbackProcs;
-#ifdef FUNC_STDCALL
-VALUE rb_DLStdcallCallbackAddrs, rb_DLStdcallCallbackProcs;
-#endif
-/*static void *cdecl_callbacks[MAX_DLTYPE][MAX_CALLBACK];*/
-#ifdef FUNC_STDCALL
-/*static void *stdcall_callbacks[MAX_DLTYPE][MAX_CALLBACK];*/
-#endif
-ID rb_dl_cb_call;
-EOS
-
-def foreach_proc_entry
- for calltype in CALLTYPES
- case calltype
- when CDECL
- proc_entry = "rb_DLCdeclCallbackProcs"
- when STDCALL
- proc_entry = "rb_DLStdcallCallbackProcs"
- else
- raise "unknown calltype: #{calltype}"
- end
- yield calltype, proc_entry
- end
-end
-
-def gencallback(ty, calltype, proc_entry, argc, n)
- <<-EOS
-#{calltype == STDCALL ? "\n#ifdef FUNC_STDCALL" : ""}
-static #{DLTYPE[ty][:type]}
-FUNC_#{calltype.upcase}(#{func_name(ty,argc,n,calltype)})(#{(0...argc).collect{|i| "DLSTACK_TYPE stack" + i.to_s}.join(", ")})
-{
- VALUE ret, cb#{argc > 0 ? ", args[#{argc}]" : ""};
-#{
- (0...argc).collect{|i|
- " args[%d] = LONG2NUM(stack%d);" % [i,i]
- }.join("\n")
-}
- cb = rb_ary_entry(rb_ary_entry(#{proc_entry}, #{ty}), #{(n * DLSTACK_SIZE) + argc});
- ret = rb_funcall2(cb, rb_dl_cb_call, #{argc}, #{argc > 0 ? 'args' : 'NULL'});
- return #{DLTYPE[ty][:conv] ? DLTYPE[ty][:conv] % "ret" : ""};
-}
-#{calltype == STDCALL ? "#endif\n" : ""}
- EOS
-end
-
-def gen_push_proc_ary(ty, aryname)
- sprintf(" rb_ary_push(#{aryname}, rb_ary_new3(%d,%s));",
- MAX_CALLBACK * DLSTACK_SIZE,
- (0...MAX_CALLBACK).collect{
- (0...DLSTACK_SIZE).collect{ "Qnil" }.join(",")
- }.join(","))
-end
-
-def gen_push_addr_ary(ty, aryname, calltype)
- sprintf(" rb_ary_push(#{aryname}, rb_ary_new3(%d,%s));",
- MAX_CALLBACK * DLSTACK_SIZE,
- (0...MAX_CALLBACK).collect{|i|
- (0...DLSTACK_SIZE).collect{|argc|
- "PTR2NUM(%s)" % func_name(ty,argc,i,calltype)
- }.join(",")
- }.join(","))
-end
-
-def gen_callback_file(ty)
- filename = "#{$output}-#{ty}.c"
- initname = "rb_dl_init_callbacks_#{ty}"
- body = <<-EOS
-#include "dl.h"
-
-extern VALUE rb_DLCdeclCallbackAddrs, rb_DLCdeclCallbackProcs;
-#ifdef FUNC_STDCALL
-extern VALUE rb_DLStdcallCallbackAddrs, rb_DLStdcallCallbackProcs;
-#endif
-extern ID rb_dl_cb_call;
- EOS
- yield body
- body << <<-EOS
-void
-#{initname}()
-{
-#{gen_push_proc_ary(ty, "rb_DLCdeclCallbackProcs")}
-#{gen_push_addr_ary(ty, "rb_DLCdeclCallbackAddrs", CDECL)}
-#ifdef FUNC_STDCALL
-#{gen_push_proc_ary(ty, "rb_DLStdcallCallbackProcs")}
-#{gen_push_addr_ary(ty, "rb_DLStdcallCallbackAddrs", STDCALL)}
-#endif
-}
- EOS
- [filename, initname, body]
-end
-
-callbacks = []
-for ty in 0...MAX_DLTYPE
- filename, initname, body = gen_callback_file(ty) {|f|
- foreach_proc_entry do |calltype, proc_entry|
- for argc in 0...DLSTACK_SIZE
- for n in 0...MAX_CALLBACK
- f << gencallback(ty, calltype, proc_entry, argc, n)
- end
- end
- end
- }
- $out << "void #{initname}();\n"
- callbacks << [filename, body]
-end
-
-$out << (<<EOS)
-void
-Init_callback(void)
-{
- VALUE tmp;
- VALUE rb_mDL = rb_path2class("DL");
-
- rb_dl_cb_call = rb_intern("call");
-
- tmp = rb_DLCdeclCallbackProcs = rb_ary_new();
- rb_define_const(rb_mDL, "CdeclCallbackProcs", tmp);
-
- tmp = rb_DLCdeclCallbackAddrs = rb_ary_new();
- rb_define_const(rb_mDL, "CdeclCallbackAddrs", tmp);
-
-#ifdef FUNC_STDCALL
- tmp = rb_DLStdcallCallbackProcs = rb_ary_new();
- rb_define_const(rb_mDL, "StdcallCallbackProcs", tmp);
-
- tmp = rb_DLStdcallCallbackAddrs = rb_ary_new();
- rb_define_const(rb_mDL, "StdcallCallbackAddrs", tmp);
-#endif
-
-#{
- (0...MAX_DLTYPE).collect{|ty|
- " rb_dl_init_callbacks_#{ty}();"
- }.join("\n")
-}
-}
-EOS
-$out.close
-
-for filename, body in callbacks
- open(filename, "wb") {|f| f.puts body}
-end
diff --git a/ext/dl/cfunc.c b/ext/dl/cfunc.c
deleted file mode 100644
index 6110e14f55..0000000000
--- a/ext/dl/cfunc.c
+++ /dev/null
@@ -1,532 +0,0 @@
-/* -*- C -*-
- * $Id$
- */
-
-#include <ruby.h>
-#include <errno.h>
-#include "dl.h"
-
-VALUE rb_cDLCFunc;
-
-static ID id_last_error;
-
-static VALUE
-rb_dl_get_last_error(VALUE self)
-{
- return rb_thread_local_aref(rb_thread_current(), id_last_error);
-}
-
-static VALUE
-rb_dl_set_last_error(VALUE self, VALUE val)
-{
- rb_thread_local_aset(rb_thread_current(), id_last_error, val);
- return Qnil;
-}
-
-#if defined(HAVE_WINDOWS_H)
-#include <windows.h>
-static ID id_win32_last_error;
-
-static VALUE
-rb_dl_get_win32_last_error(VALUE self)
-{
- return rb_thread_local_aref(rb_thread_current(), id_win32_last_error);
-}
-
-static VALUE
-rb_dl_set_win32_last_error(VALUE self, VALUE val)
-{
- rb_thread_local_aset(rb_thread_current(), id_win32_last_error, val);
- return Qnil;
-}
-#endif
-
-
-void
-dlcfunc_free(void *ptr)
-{
- struct cfunc_data *data = ptr;
- if( data->name ){
- xfree(data->name);
- }
- xfree(data);
-}
-
-VALUE
-rb_dlcfunc_new(void (*func)(), int type, const char *name, ID calltype)
-{
- VALUE val;
- struct cfunc_data *data;
-
- rb_secure(4);
- if( func ){
- val = Data_Make_Struct(rb_cDLCFunc, struct cfunc_data, 0, dlcfunc_free, data);
- data->ptr = func;
- data->name = name ? strdup(name) : NULL;
- data->type = type;
- data->calltype = calltype;
- }
- else{
- val = Qnil;
- }
-
- return val;
-}
-
-void *
-rb_dlcfunc2ptr(VALUE val)
-{
- struct cfunc_data *data;
- void * func;
-
- if( rb_obj_is_kind_of(val, rb_cDLCFunc) ){
- Data_Get_Struct(val, struct cfunc_data, data);
- func = data->ptr;
- }
- else if( val == Qnil ){
- func = NULL;
- }
- else{
- rb_raise(rb_eTypeError, "DL::CFunc was expected");
- }
-
- return func;
-}
-
-VALUE
-rb_dlcfunc_s_allocate(VALUE klass)
-{
- VALUE obj;
- struct cfunc_data *data;
-
- obj = Data_Make_Struct(klass, struct cfunc_data, 0, dlcfunc_free, data);
- data->ptr = 0;
- data->name = 0;
- data->type = 0;
- data->calltype = CFUNC_CDECL;
-
- return obj;
-}
-
-int
-rb_dlcfunc_kind_p(VALUE func)
-{
- if (TYPE(func) == T_DATA) return 0;
- return RDATA(func)->dfree == dlcfunc_free;
-}
-
-VALUE
-rb_dlcfunc_initialize(int argc, VALUE argv[], VALUE self)
-{
- VALUE addr, name, type, calltype;
- struct cfunc_data *data;
- void *saddr;
- const char *sname;
-
- rb_scan_args(argc, argv, "13", &addr, &type, &name, &calltype);
-
- saddr = (void*)(NUM2PTR(rb_Integer(addr)));
- sname = NIL_P(name) ? NULL : StringValuePtr(name);
-
- Data_Get_Struct(self, struct cfunc_data, data);
- if( data->name ) xfree(data->name);
- data->ptr = saddr;
- data->name = sname ? strdup(sname) : 0;
- data->type = (type == Qnil) ? DLTYPE_VOID : NUM2INT(type);
- data->calltype = (calltype == Qnil) ? CFUNC_CDECL : SYM2ID(calltype);
-
- return Qnil;
-}
-
-VALUE
-rb_dlcfunc_name(VALUE self)
-{
- struct cfunc_data *cfunc;
-
- Data_Get_Struct(self, struct cfunc_data, cfunc);
- return cfunc->name ? rb_tainted_str_new2(cfunc->name) : Qnil;
-}
-
-VALUE
-rb_dlcfunc_ctype(VALUE self)
-{
- struct cfunc_data *cfunc;
-
- Data_Get_Struct(self, struct cfunc_data, cfunc);
- return INT2NUM(cfunc->type);
-}
-
-VALUE
-rb_dlcfunc_set_ctype(VALUE self, VALUE ctype)
-{
- struct cfunc_data *cfunc;
-
- Data_Get_Struct(self, struct cfunc_data, cfunc);
- cfunc->type = NUM2INT(ctype);
- return ctype;
-}
-
-VALUE
-rb_dlcfunc_calltype(VALUE self)
-{
- struct cfunc_data *cfunc;
-
- Data_Get_Struct(self, struct cfunc_data, cfunc);
- return ID2SYM(cfunc->calltype);
-}
-
-VALUE
-rb_dlcfunc_set_calltype(VALUE self, VALUE sym)
-{
- struct cfunc_data *cfunc;
-
- Data_Get_Struct(self, struct cfunc_data, cfunc);
- cfunc->calltype = SYM2ID(sym);
- return sym;
-}
-
-
-VALUE
-rb_dlcfunc_ptr(VALUE self)
-{
- struct cfunc_data *cfunc;
-
- Data_Get_Struct(self, struct cfunc_data, cfunc);
- return PTR2NUM(cfunc->ptr);
-}
-
-VALUE
-rb_dlcfunc_set_ptr(VALUE self, VALUE addr)
-{
- struct cfunc_data *cfunc;
-
- Data_Get_Struct(self, struct cfunc_data, cfunc);
- cfunc->ptr = NUM2PTR(addr);
-
- return Qnil;
-}
-
-VALUE
-rb_dlcfunc_inspect(VALUE self)
-{
- VALUE val;
- char *str;
- int str_size;
- struct cfunc_data *cfunc;
-
- Data_Get_Struct(self, struct cfunc_data, cfunc);
-
- str_size = (cfunc->name ? strlen(cfunc->name) : 0) + 100;
- str = ruby_xmalloc(str_size);
- snprintf(str, str_size - 1,
- "#<DL::CFunc:%p ptr=%p type=%d name='%s'>",
- cfunc,
- cfunc->ptr,
- cfunc->type,
- cfunc->name ? cfunc->name : "");
- val = rb_tainted_str_new2(str);
- ruby_xfree(str);
-
- return val;
-}
-
-
-# define DECL_FUNC_CDECL(f,ret,args) ret (FUNC_CDECL(*f))(args)
-#ifdef FUNC_STDCALL
-# define DECL_FUNC_STDCALL(f,ret,args) ret (FUNC_STDCALL(*f))(args)
-#endif
-
-#define CALL_CASE switch( RARRAY_LEN(ary) ){ \
- CASE(0); break; \
- CASE(1); break; CASE(2); break; CASE(3); break; CASE(4); break; CASE(5); break; \
- CASE(6); break; CASE(7); break; CASE(8); break; CASE(9); break; CASE(10);break; \
- CASE(11);break; CASE(12);break; CASE(13);break; CASE(14);break; CASE(15);break; \
- CASE(16);break; CASE(17);break; CASE(18);break; CASE(19);break; CASE(20);break; \
- default: rb_raise(rb_eArgError, "too many arguments"); \
-}
-
-
-VALUE
-rb_dlcfunc_call(VALUE self, VALUE ary)
-{
- struct cfunc_data *cfunc;
- int i;
- DLSTACK_TYPE stack[DLSTACK_SIZE];
- VALUE result = Qnil;
-
- rb_secure_update(self);
-
- memset(stack, 0, sizeof(DLSTACK_TYPE) * DLSTACK_SIZE);
- Check_Type(ary, T_ARRAY);
-
- Data_Get_Struct(self, struct cfunc_data, cfunc);
-
- if( cfunc->ptr == 0 ){
- rb_raise(rb_eDLError, "can't call null-function");
- return Qnil;
- }
-
- for( i = 0; i < RARRAY_LEN(ary); i++ ){
- if( i >= DLSTACK_SIZE ){
- rb_raise(rb_eDLError, "too many arguments (stack overflow)");
- }
- rb_check_safe_obj(RARRAY_PTR(ary)[i]);
- stack[i] = NUM2LONG(RARRAY_PTR(ary)[i]);
- }
-
- /* calltype == CFUNC_CDECL */
- if( cfunc->calltype == CFUNC_CDECL
-#ifndef FUNC_STDCALL
- || cfunc->calltype == CFUNC_STDCALL
-#endif
- ){
- switch( cfunc->type ){
- case DLTYPE_VOID:
-#define CASE(n) case n: { \
- DECL_FUNC_CDECL(f,void,DLSTACK_PROTO##n) = cfunc->ptr; \
- f(DLSTACK_ARGS##n(stack)); \
- result = Qnil; \
-}
- CALL_CASE;
-#undef CASE
- break;
- case DLTYPE_VOIDP:
-#define CASE(n) case n: { \
- DECL_FUNC_CDECL(f,void*,DLSTACK_PROTO##n) = cfunc->ptr; \
- void * ret; \
- ret = f(DLSTACK_ARGS##n(stack)); \
- result = PTR2NUM(ret); \
-}
- CALL_CASE;
-#undef CASE
- break;
- case DLTYPE_CHAR:
-#define CASE(n) case n: { \
- DECL_FUNC_CDECL(f,char,DLSTACK_PROTO##n) = cfunc->ptr; \
- char ret; \
- ret = f(DLSTACK_ARGS##n(stack)); \
- result = CHR2FIX(ret); \
-}
- CALL_CASE;
-#undef CASE
- break;
- case DLTYPE_SHORT:
-#define CASE(n) case n: { \
- DECL_FUNC_CDECL(f,short,DLSTACK_PROTO##n) = cfunc->ptr; \
- short ret; \
- ret = f(DLSTACK_ARGS##n(stack)); \
- result = INT2NUM((int)ret); \
-}
- CALL_CASE;
-#undef CASE
- break;
- case DLTYPE_INT:
-#define CASE(n) case n: { \
- DECL_FUNC_CDECL(f,int,DLSTACK_PROTO##n) = cfunc->ptr; \
- int ret; \
- ret = f(DLSTACK_ARGS##n(stack)); \
- result = INT2NUM(ret); \
-}
- CALL_CASE;
-#undef CASE
- break;
- case DLTYPE_LONG:
-#define CASE(n) case n: { \
- DECL_FUNC_CDECL(f,long,DLSTACK_PROTO##n) = cfunc->ptr; \
- long ret; \
- ret = f(DLSTACK_ARGS##n(stack)); \
- result = LONG2NUM(ret); \
-}
- CALL_CASE;
-#undef CASE
- break;
-#if HAVE_LONG_LONG /* used in ruby.h */
- case DLTYPE_LONG_LONG:
-#define CASE(n) case n: { \
- DECL_FUNC_CDECL(f,LONG_LONG,DLSTACK_PROTO##n) = cfunc->ptr; \
- LONG_LONG ret; \
- ret = f(DLSTACK_ARGS##n(stack)); \
- result = LL2NUM(ret); \
-}
- CALL_CASE;
-#undef CASE
- break;
-#endif
- case DLTYPE_FLOAT:
-#define CASE(n) case n: { \
- DECL_FUNC_CDECL(f,float,DLSTACK_PROTO##n) = cfunc->ptr; \
- float ret; \
- ret = f(DLSTACK_ARGS##n(stack)); \
- result = rb_float_new(ret); \
-}
- CALL_CASE;
-#undef CASE
- break;
- case DLTYPE_DOUBLE:
-#define CASE(n) case n: { \
- DECL_FUNC_CDECL(f,double,DLSTACK_PROTO##n) = cfunc->ptr; \
- double ret; \
- ret = f(DLSTACK_ARGS##n(stack)); \
- result = rb_float_new(ret); \
-}
- CALL_CASE;
-#undef CASE
- break;
- default:
- rb_raise(rb_eDLTypeError, "unknown type %d", cfunc->type);
- }
- }
-#ifdef FUNC_STDCALL
- else if( cfunc->calltype == CFUNC_STDCALL ){
- /* calltype == CFUNC_STDCALL */
- switch( cfunc->type ){
- case DLTYPE_VOID:
-#define CASE(n) case n: { \
- DECL_FUNC_STDCALL(f,void,DLSTACK_PROTO##n##_) = cfunc->ptr; \
- f(DLSTACK_ARGS##n(stack)); \
- result = Qnil; \
-}
- CALL_CASE;
-#undef CASE
- break;
- case DLTYPE_VOIDP:
-#define CASE(n) case n: { \
- DECL_FUNC_STDCALL(f,void*,DLSTACK_PROTO##n##_) = cfunc->ptr; \
- void * ret; \
- ret = f(DLSTACK_ARGS##n(stack)); \
- result = PTR2NUM(ret); \
-}
- CALL_CASE;
-#undef CASE
- break;
- case DLTYPE_CHAR:
-#define CASE(n) case n: { \
- DECL_FUNC_STDCALL(f,char,DLSTACK_PROTO##n##_) = cfunc->ptr; \
- char ret; \
- ret = f(DLSTACK_ARGS##n(stack)); \
- result = CHR2FIX(ret); \
-}
- CALL_CASE;
-#undef CASE
- break;
- case DLTYPE_SHORT:
-#define CASE(n) case n: { \
- DECL_FUNC_STDCALL(f,short,DLSTACK_PROTO##n##_) = cfunc->ptr; \
- short ret; \
- ret = f(DLSTACK_ARGS##n(stack)); \
- result = INT2NUM((int)ret); \
-}
- CALL_CASE;
-#undef CASE
- break;
- case DLTYPE_INT:
-#define CASE(n) case n: { \
- DECL_FUNC_STDCALL(f,int,DLSTACK_PROTO##n##_) = cfunc->ptr; \
- int ret; \
- ret = f(DLSTACK_ARGS##n(stack)); \
- result = INT2NUM(ret); \
-}
- CALL_CASE;
-#undef CASE
- break;
- case DLTYPE_LONG:
-#define CASE(n) case n: { \
- DECL_FUNC_STDCALL(f,long,DLSTACK_PROTO##n##_) = cfunc->ptr; \
- long ret; \
- ret = f(DLSTACK_ARGS##n(stack)); \
- result = LONG2NUM(ret); \
-}
- CALL_CASE;
-#undef CASE
- break;
-#if HAVE_LONG_LONG /* used in ruby.h */
- case DLTYPE_LONG_LONG:
-#define CASE(n) case n: { \
- DECL_FUNC_STDCALL(f,LONG_LONG,DLSTACK_PROTO##n##_) = cfunc->ptr; \
- LONG_LONG ret; \
- ret = f(DLSTACK_ARGS##n(stack)); \
- result = LL2NUM(ret); \
-}
- CALL_CASE;
-#undef CASE
- break;
-#endif
- case DLTYPE_FLOAT:
-#define CASE(n) case n: { \
- DECL_FUNC_STDCALL(f,float,DLSTACK_PROTO##n##_) = cfunc->ptr; \
- float ret; \
- ret = f(DLSTACK_ARGS##n(stack)); \
- result = rb_float_new(ret); \
-}
- CALL_CASE;
-#undef CASE
- break;
- case DLTYPE_DOUBLE:
-#define CASE(n) case n: { \
- DECL_FUNC_STDCALL(f,double,DLSTACK_PROTO##n##_) = cfunc->ptr; \
- double ret; \
- ret = f(DLSTACK_ARGS##n(stack)); \
- result = rb_float_new(ret); \
-}
- CALL_CASE;
-#undef CASE
- break;
- default:
- rb_raise(rb_eDLTypeError, "unknown type %d", cfunc->type);
- }
- }
-#endif
- else{
- rb_raise(rb_eDLError,
-#ifndef LONG_LONG_VALUE
- "unsupported call type: %lx",
-#else
- "unsupported call type: %llx",
-#endif
- cfunc->calltype);
- }
-
- rb_dl_set_last_error(self, INT2NUM(errno));
-#if defined(HAVE_WINDOWS_H)
- rb_dl_set_win32_last_error(self, INT2NUM(GetLastError()));
-#endif
-
- return result;
-}
-
-VALUE
-rb_dlcfunc_to_i(VALUE self)
-{
- struct cfunc_data *cfunc;
-
- Data_Get_Struct(self, struct cfunc_data, cfunc);
- return PTR2NUM(cfunc->ptr);
-}
-
-void
-Init_dlcfunc(void)
-{
- id_last_error = rb_intern("__DL2_LAST_ERROR__");
-#if defined(HAVE_WINDOWS_H)
- id_win32_last_error = rb_intern("__DL2_WIN32_LAST_ERROR__");
-#endif
- rb_cDLCFunc = rb_define_class_under(rb_mDL, "CFunc", rb_cObject);
- rb_define_alloc_func(rb_cDLCFunc, rb_dlcfunc_s_allocate);
- rb_define_module_function(rb_cDLCFunc, "last_error", rb_dl_get_last_error, 0);
-#if defined(HAVE_WINDOWS_H)
- rb_define_module_function(rb_cDLCFunc, "win32_last_error", rb_dl_get_win32_last_error, 0);
-#endif
- rb_define_method(rb_cDLCFunc, "initialize", rb_dlcfunc_initialize, -1);
- rb_define_method(rb_cDLCFunc, "call", rb_dlcfunc_call, 1);
- rb_define_method(rb_cDLCFunc, "[]", rb_dlcfunc_call, 1);
- rb_define_method(rb_cDLCFunc, "name", rb_dlcfunc_name, 0);
- rb_define_method(rb_cDLCFunc, "ctype", rb_dlcfunc_ctype, 0);
- rb_define_method(rb_cDLCFunc, "ctype=", rb_dlcfunc_set_ctype, 1);
- rb_define_method(rb_cDLCFunc, "calltype", rb_dlcfunc_calltype, 0);
- rb_define_method(rb_cDLCFunc, "calltype=", rb_dlcfunc_set_calltype, 1);
- rb_define_method(rb_cDLCFunc, "ptr", rb_dlcfunc_ptr, 0);
- rb_define_method(rb_cDLCFunc, "ptr=", rb_dlcfunc_set_ptr, 1);
- rb_define_method(rb_cDLCFunc, "inspect", rb_dlcfunc_inspect, 0);
- rb_define_method(rb_cDLCFunc, "to_s", rb_dlcfunc_inspect, 0);
- rb_define_method(rb_cDLCFunc, "to_i", rb_dlcfunc_to_i, 0);
-}
diff --git a/ext/dl/cptr.c b/ext/dl/cptr.c
deleted file mode 100644
index b7c27e9f9e..0000000000
--- a/ext/dl/cptr.c
+++ /dev/null
@@ -1,491 +0,0 @@
-/* -*- C -*-
- * $Id$
- */
-
-#include <ruby/ruby.h>
-#include <ruby/io.h>
-#include <ctype.h>
-#include "dl.h"
-
-VALUE rb_cDLCPtr;
-
-static inline freefunc_t
-get_freefunc(VALUE func)
-{
- if (NIL_P(func)) {
- return NULL;
- }
- if (rb_dlcfunc_kind_p(func)) {
- return RCFUNC_DATA(func)->ptr;
- }
- return NUM2PTR(rb_Integer(func));
-}
-
-static ID id_to_ptr;
-
-static void
-dlptr_free(struct ptr_data *data)
-{
- if (data->ptr) {
- if (data->free) {
- (*(data->free))(data->ptr);
- }
- }
-}
-
-static void
-dlptr_mark(struct ptr_data *data)
-{
-}
-
-void
-dlptr_init(VALUE val)
-{
- struct ptr_data *data;
-
- Data_Get_Struct(val, struct ptr_data, data);
- OBJ_TAINT(val);
-}
-
-VALUE
-rb_dlptr_new2(VALUE klass, void *ptr, long size, freefunc_t func)
-{
- struct ptr_data *data;
- VALUE val;
-
- rb_secure(4);
- val = Data_Make_Struct(klass, struct ptr_data,
- 0, dlptr_free, data);
- data->ptr = ptr;
- data->free = func;
- data->size = size;
- dlptr_init(val);
-
- return val;
-}
-
-VALUE
-rb_dlptr_new(void *ptr, long size, freefunc_t func)
-{
- return rb_dlptr_new2(rb_cDLCPtr, ptr, size, func);
-}
-
-VALUE
-rb_dlptr_malloc(long size, freefunc_t func)
-{
- void *ptr;
-
- rb_secure(4);
- ptr = ruby_xmalloc((size_t)size);
- memset(ptr,0,(size_t)size);
- return rb_dlptr_new(ptr, size, func);
-}
-
-void *
-rb_dlptr2cptr(VALUE val)
-{
- struct ptr_data *data;
- void *ptr;
-
- if (rb_obj_is_kind_of(val, rb_cDLCPtr)) {
- Data_Get_Struct(val, struct ptr_data, data);
- ptr = data->ptr;
- }
- else if (val == Qnil) {
- ptr = NULL;
- }
- else{
- rb_raise(rb_eTypeError, "DL::PtrData was expected");
- }
-
- return ptr;
-}
-
-static VALUE
-rb_dlptr_s_allocate(VALUE klass)
-{
- VALUE obj;
- struct ptr_data *data;
-
- rb_secure(4);
- obj = Data_Make_Struct(klass, struct ptr_data, dlptr_mark, dlptr_free, data);
- data->ptr = 0;
- data->size = 0;
- data->free = 0;
-
- return obj;
-}
-
-static VALUE
-rb_dlptr_initialize(int argc, VALUE argv[], VALUE self)
-{
- VALUE ptr, sym, size;
- struct ptr_data *data;
- void *p = NULL;
- freefunc_t f = NULL;
- long s = 0;
-
- switch (rb_scan_args(argc, argv, "12", &ptr, &size, &sym)) {
- case 1:
- p = (void*)(NUM2PTR(rb_Integer(ptr)));
- break;
- case 2:
- p = (void*)(NUM2PTR(rb_Integer(ptr)));
- s = NUM2LONG(size);
- break;
- case 3:
- p = (void*)(NUM2PTR(rb_Integer(ptr)));
- s = NUM2LONG(size);
- f = get_freefunc(sym);
- break;
- default:
- rb_bug("rb_dlptr_initialize");
- }
-
- if (p) {
- Data_Get_Struct(self, struct ptr_data, data);
- if (data->ptr && data->free) {
- /* Free previous memory. Use of inappropriate initialize may cause SEGV. */
- (*(data->free))(data->ptr);
- }
- data->ptr = p;
- data->size = s;
- data->free = f;
- }
-
- return Qnil;
-}
-
-static VALUE
-rb_dlptr_s_malloc(int argc, VALUE argv[], VALUE klass)
-{
- VALUE size, sym, obj;
- int s;
- freefunc_t f;
-
- switch (rb_scan_args(argc, argv, "11", &size, &sym)) {
- case 1:
- s = NUM2LONG(size);
- f = NULL;
- break;
- case 2:
- s = NUM2LONG(size);
- f = get_freefunc(sym);
- break;
- default:
- rb_bug("rb_dlptr_s_malloc");
- }
-
- obj = rb_dlptr_malloc(s,f);
-
- return obj;
-}
-
-VALUE
-rb_dlptr_to_i(VALUE self)
-{
- struct ptr_data *data;
-
- Data_Get_Struct(self, struct ptr_data, data);
- return PTR2NUM(data->ptr);
-}
-
-VALUE
-rb_dlptr_to_value(VALUE self)
-{
- struct ptr_data *data;
- Data_Get_Struct(self, struct ptr_data, data);
- return (VALUE)(data->ptr);
-}
-
-VALUE
-rb_dlptr_ptr(VALUE self)
-{
- struct ptr_data *data;
-
- Data_Get_Struct(self, struct ptr_data, data);
- return rb_dlptr_new(*((void**)(data->ptr)),0,0);
-}
-
-VALUE
-rb_dlptr_ref(VALUE self)
-{
- struct ptr_data *data;
-
- Data_Get_Struct(self, struct ptr_data, data);
- return rb_dlptr_new(&(data->ptr),0,0);
-}
-
-VALUE
-rb_dlptr_null_p(VALUE self)
-{
- struct ptr_data *data;
-
- Data_Get_Struct(self, struct ptr_data, data);
- return data->ptr ? Qfalse : Qtrue;
-}
-
-VALUE
-rb_dlptr_free_set(VALUE self, VALUE val)
-{
- struct ptr_data *data;
-
- Data_Get_Struct(self, struct ptr_data, data);
- data->free = get_freefunc(val);
-
- return Qnil;
-}
-
-VALUE
-rb_dlptr_free_get(VALUE self)
-{
- struct ptr_data *pdata;
-
- Data_Get_Struct(self, struct ptr_data, pdata);
-
- return rb_dlcfunc_new(pdata->free, DLTYPE_VOID, "free<anonymous>", CFUNC_CDECL);
-}
-
-VALUE
-rb_dlptr_to_s(int argc, VALUE argv[], VALUE self)
-{
- struct ptr_data *data;
- VALUE arg1, val;
- int len;
-
- Data_Get_Struct(self, struct ptr_data, data);
- switch (rb_scan_args(argc, argv, "01", &arg1)) {
- case 0:
- val = rb_tainted_str_new2((char*)(data->ptr));
- break;
- case 1:
- len = NUM2INT(arg1);
- val = rb_tainted_str_new((char*)(data->ptr), len);
- break;
- default:
- rb_bug("rb_dlptr_to_s");
- }
-
- return val;
-}
-
-VALUE
-rb_dlptr_to_str(int argc, VALUE argv[], VALUE self)
-{
- struct ptr_data *data;
- VALUE arg1, val;
- int len;
-
- Data_Get_Struct(self, struct ptr_data, data);
- switch (rb_scan_args(argc, argv, "01", &arg1)) {
- case 0:
- val = rb_tainted_str_new((char*)(data->ptr),data->size);
- break;
- case 1:
- len = NUM2INT(arg1);
- val = rb_tainted_str_new((char*)(data->ptr), len);
- break;
- default:
- rb_bug("rb_dlptr_to_str");
- }
-
- return val;
-}
-
-VALUE
-rb_dlptr_inspect(VALUE self)
-{
- struct ptr_data *data;
- char str[1024];
-
- Data_Get_Struct(self, struct ptr_data, data);
- snprintf(str, 1023, "#<%s:%p ptr=%p size=%ld free=%p>",
- rb_class2name(CLASS_OF(self)), data, data->ptr, data->size, data->free);
- return rb_str_new2(str);
-}
-
-VALUE
-rb_dlptr_eql(VALUE self, VALUE other)
-{
- void *ptr1, *ptr2;
- ptr1 = rb_dlptr2cptr(self);
- ptr2 = rb_dlptr2cptr(other);
-
- return ptr1 == ptr2 ? Qtrue : Qfalse;
-}
-
-VALUE
-rb_dlptr_cmp(VALUE self, VALUE other)
-{
- void *ptr1, *ptr2;
- SIGNED_VALUE diff;
- ptr1 = rb_dlptr2cptr(self);
- ptr2 = rb_dlptr2cptr(other);
- diff = (SIGNED_VALUE)ptr1 - (SIGNED_VALUE)ptr2;
- if (!diff) return INT2FIX(0);
- return diff > 0 ? INT2NUM(1) : INT2NUM(-1);
-}
-
-VALUE
-rb_dlptr_plus(VALUE self, VALUE other)
-{
- void *ptr;
- long num, size;
-
- ptr = rb_dlptr2cptr(self);
- size = RPTR_DATA(self)->size;
- num = NUM2LONG(other);
- return rb_dlptr_new((char *)ptr + num, size - num, 0);
-}
-
-VALUE
-rb_dlptr_minus(VALUE self, VALUE other)
-{
- void *ptr;
- long num, size;
-
- ptr = rb_dlptr2cptr(self);
- size = RPTR_DATA(self)->size;
- num = NUM2LONG(other);
- return rb_dlptr_new((char *)ptr - num, size + num, 0);
-}
-
-VALUE
-rb_dlptr_aref(int argc, VALUE argv[], VALUE self)
-{
- VALUE arg0, arg1;
- VALUE retval = Qnil;
- size_t offset, len;
-
- switch( rb_scan_args(argc, argv, "11", &arg0, &arg1) ){
- case 1:
- offset = NUM2ULONG(arg0);
- retval = INT2NUM(*((char*)RPTR_DATA(self)->ptr + offset));
- break;
- case 2:
- offset = NUM2ULONG(arg0);
- len = NUM2ULONG(arg1);
- retval = rb_tainted_str_new((char *)RPTR_DATA(self)->ptr + offset, len);
- break;
- default:
- rb_bug("rb_dlptr_aref()");
- }
- return retval;
-}
-
-VALUE
-rb_dlptr_aset(int argc, VALUE argv[], VALUE self)
-{
- VALUE arg0, arg1, arg2;
- VALUE retval = Qnil;
- size_t offset, len;
- void *mem;
-
- switch( rb_scan_args(argc, argv, "21", &arg0, &arg1, &arg2) ){
- case 2:
- offset = NUM2ULONG(arg0);
- ((char*)RPTR_DATA(self)->ptr)[offset] = NUM2UINT(arg1);
- retval = arg1;
- break;
- case 3:
- offset = NUM2ULONG(arg0);
- len = NUM2ULONG(arg1);
- if( TYPE(arg2) == T_STRING ){
- mem = StringValuePtr(arg2);
- }
- else if( rb_obj_is_kind_of(arg2, rb_cDLCPtr) ){
- mem = rb_dlptr2cptr(arg2);
- }
- else{
- mem = NUM2PTR(arg2);
- }
- memcpy((char *)RPTR_DATA(self)->ptr + offset, mem, len);
- retval = arg2;
- break;
- default:
- rb_bug("rb_dlptr_aset()");
- }
- return retval;
-}
-
-VALUE
-rb_dlptr_size(int argc, VALUE argv[], VALUE self)
-{
- VALUE size;
-
- if (rb_scan_args(argc, argv, "01", &size) == 0){
- return LONG2NUM(RPTR_DATA(self)->size);
- }
- else{
- RPTR_DATA(self)->size = NUM2LONG(size);
- return size;
- }
-}
-
-VALUE
-rb_dlptr_s_to_ptr(VALUE self, VALUE val)
-{
- VALUE ptr;
-
- if (rb_obj_is_kind_of(val, rb_cIO) == Qtrue){
- rb_io_t *fptr;
- FILE *fp;
- GetOpenFile(val, fptr);
- fp = rb_io_stdio_file(fptr);
- ptr = rb_dlptr_new(fp, 0, NULL);
- }
- else if (rb_obj_is_kind_of(val, rb_cString) == Qtrue){
- char *str = StringValuePtr(val);
- ptr = rb_dlptr_new(str, RSTRING_LEN(val), NULL);
- }
- else if (rb_respond_to(val, id_to_ptr)){
- VALUE vptr = rb_funcall(val, id_to_ptr, 0);
- if (rb_obj_is_kind_of(vptr, rb_cDLCPtr)){
- ptr = vptr;
- }
- else{
- rb_raise(rb_eDLError, "to_ptr should return a CPtr object");
- }
- }
- else{
- ptr = rb_dlptr_new(NUM2PTR(rb_Integer(val)), 0, NULL);
- }
- OBJ_INFECT(ptr, val);
- return ptr;
-}
-
-void
-Init_dlptr(void)
-{
- id_to_ptr = rb_intern("to_ptr");
-
- rb_cDLCPtr = rb_define_class_under(rb_mDL, "CPtr", rb_cObject);
- rb_define_alloc_func(rb_cDLCPtr, rb_dlptr_s_allocate);
- rb_define_singleton_method(rb_cDLCPtr, "malloc", rb_dlptr_s_malloc, -1);
- rb_define_singleton_method(rb_cDLCPtr, "to_ptr", rb_dlptr_s_to_ptr, 1);
- rb_define_singleton_method(rb_cDLCPtr, "[]", rb_dlptr_s_to_ptr, 1);
- rb_define_method(rb_cDLCPtr, "initialize", rb_dlptr_initialize, -1);
- rb_define_method(rb_cDLCPtr, "free=", rb_dlptr_free_set, 1);
- rb_define_method(rb_cDLCPtr, "free", rb_dlptr_free_get, 0);
- rb_define_method(rb_cDLCPtr, "to_i", rb_dlptr_to_i, 0);
- rb_define_method(rb_cDLCPtr, "to_value", rb_dlptr_to_value, 0);
- rb_define_method(rb_cDLCPtr, "ptr", rb_dlptr_ptr, 0);
- rb_define_method(rb_cDLCPtr, "+@", rb_dlptr_ptr, 0);
- rb_define_method(rb_cDLCPtr, "ref", rb_dlptr_ref, 0);
- rb_define_method(rb_cDLCPtr, "-@", rb_dlptr_ref, 0);
- rb_define_method(rb_cDLCPtr, "null?", rb_dlptr_null_p, 0);
- rb_define_method(rb_cDLCPtr, "to_s", rb_dlptr_to_s, -1);
- rb_define_method(rb_cDLCPtr, "to_str", rb_dlptr_to_str, -1);
- rb_define_method(rb_cDLCPtr, "inspect", rb_dlptr_inspect, 0);
- rb_define_method(rb_cDLCPtr, "<=>", rb_dlptr_cmp, 1);
- rb_define_method(rb_cDLCPtr, "==", rb_dlptr_eql, 1);
- rb_define_method(rb_cDLCPtr, "eql?", rb_dlptr_eql, 1);
- rb_define_method(rb_cDLCPtr, "+", rb_dlptr_plus, 1);
- rb_define_method(rb_cDLCPtr, "-", rb_dlptr_minus, 1);
- rb_define_method(rb_cDLCPtr, "[]", rb_dlptr_aref, -1);
- rb_define_method(rb_cDLCPtr, "[]=", rb_dlptr_aset, -1);
- rb_define_method(rb_cDLCPtr, "size", rb_dlptr_size, -1);
- rb_define_method(rb_cDLCPtr, "size=", rb_dlptr_size, -1);
-
- rb_define_const(rb_mDL, "NULL", rb_dlptr_new(0, 0, 0));
-}
diff --git a/ext/dl/depend b/ext/dl/depend
index 992c17c1b8..fba3df7a3d 100644
--- a/ext/dl/depend
+++ b/ext/dl/depend
@@ -1,7 +1,46 @@
-cfunc.o: cfunc.c dl.h $(hdrdir)/ruby.h
+LDSHARED_TEST = $(LDSHARED) $(LDFLAGS) test/test.o -o test/libtest.so $(LOCAL_LIBS)
-cptr.o: cptr.c dl.h $(hdrdir)/ruby.h $(hdrdir)/io.h
+libtest.so: test/libtest.so
-handle.o: handle.c dl.h $(hdrdir)/ruby.h
+test/libtest.so: test/test.o $(srcdir)/test/libtest.def
+ $(RUBY) -rftools -e 'ARGV.each do|d|File.mkpath(File.dirname(d))end' $@
+ $(LDSHARED_TEST:dl.def=test/libtest.def)
-dl.o: dl.c dl.h $(hdrdir)/ruby.h $(hdrdir)/io.h
+test/test.o: $(srcdir)/test/test.c
+ @$(RUBY) -rftools -e 'File.mkpath(*ARGV)' test
+ $(CC) $(CFLAGS) $(CPPFLAGS) -c $(srcdir)/test/test.c -o $@
+
+test:: dl.so libtest.so force
+ $(RUBY) -I. -I$(srcdir)/lib $(srcdir)/test/test.rb
+
+force:
+
+.PHONY: force test
+
+allclean: distclean
+ @rm -f $(CLEANFILES) $(DISTCLEANFILES)
+
+$(OBJS): ./dlconfig.h
+
+sym.o: dl.h call.func
+
+dl.o: dl.h callback.func cbtable.func
+
+ptr.o: dl.h
+
+handle.o: dl.h
+
+call.func: $(srcdir)/mkcall.rb ./dlconfig.rb
+ @echo "Generating call.func"
+ @$(RUBY) $(srcdir)/mkcall.rb > $@
+
+callback.func: $(srcdir)/mkcallback.rb ./dlconfig.rb
+ @echo "Generating callback.func"
+ @$(RUBY) $(srcdir)/mkcallback.rb > $@
+
+cbtable.func: $(srcdir)/mkcbtable.rb ./dlconfig.rb
+ @echo "Generating cbtable.func"
+ @$(RUBY) $(srcdir)/mkcbtable.rb > $@
+
+debug:
+ $(MAKE) CPPFLAGS="$(CPPFLAGS) -DDEBUG"
diff --git a/ext/dl/dl.c b/ext/dl/dl.c
index 00762c5be1..f65247be86 100644
--- a/ext/dl/dl.c
+++ b/ext/dl/dl.c
@@ -1,5 +1,9 @@
-#include <ruby/ruby.h>
-#include <ruby/io.h>
+/*
+ * $Id$
+ */
+
+#include <ruby.h>
+#include <rubyio.h>
#include <ctype.h>
#include "dl.h"
@@ -7,142 +11,726 @@ VALUE rb_mDL;
VALUE rb_eDLError;
VALUE rb_eDLTypeError;
-ID rbdl_id_cdecl;
-ID rbdl_id_stdcall;
+static VALUE DLFuncTable;
+static void *rb_dl_callback_table[CALLBACK_TYPES][MAX_CALLBACK];
+static ID id_call;
-VALUE
-rb_dl_dlopen(int argc, VALUE argv[], VALUE self)
+static int
+rb_dl_scan_callback_args(long stack[], const char *proto,
+ int *argc, VALUE argv[])
{
- rb_secure(2);
- return rb_class_new_instance(argc, argv, rb_cDLHandle);
+ int i;
+ long *sp;
+ VALUE val;
+
+ sp = stack;
+ for (i=1; proto[i]; i++) {
+ switch (proto[i]) {
+ case 'C':
+ {
+ char v;
+ v = (char)(*sp);
+ sp++;
+ val = INT2NUM(v);
+ }
+ break;
+ case 'H':
+ {
+ short v;
+ v = (short)(*sp);
+ sp++;
+ val = INT2NUM(v);
+ }
+ break;
+ case 'I':
+ {
+ int v;
+ v = (int)(*sp);
+ sp++;
+ val = INT2NUM(v);
+ }
+ break;
+ case 'L':
+ {
+ long v;
+ v = (long)(*sp);
+ sp++;
+ val = INT2NUM(v);
+ }
+ break;
+ case 'F':
+ {
+ float v;
+ memcpy(&v, sp, sizeof(float));
+ sp += sizeof(float)/sizeof(long);
+ val = rb_float_new(v);
+ }
+ break;
+ case 'D':
+ {
+ double v;
+ memcpy(&v, sp, sizeof(double));
+ sp += sizeof(double)/sizeof(long);
+ val = rb_float_new(v);
+ }
+ break;
+ case 'P':
+ {
+ void *v;
+ memcpy(&v, sp, sizeof(void*));
+ sp++;
+ val = rb_dlptr_new(v, 0, 0);
+ }
+ break;
+ case 'S':
+ {
+ char *v;
+ memcpy(&v, sp, sizeof(void*));
+ sp++;
+ val = rb_tainted_str_new2(v);
+ }
+ break;
+ default:
+ rb_raise(rb_eDLTypeError, "unsupported type `%c'", proto[i]);
+ break;
+ }
+ argv[i-1] = val;
+ }
+ *argc = (i - 1);
+
+ return (*argc);
}
-VALUE
-rb_dl_malloc(VALUE self, VALUE size)
+#include "callback.func"
+
+static void
+init_dl_func_table(){
+#include "cbtable.func"
+}
+
+void *
+dlmalloc(size_t size)
{
+ DEBUG_CODE2({
void *ptr;
- rb_secure(4);
- ptr = (void*)ruby_xmalloc(NUM2INT(size));
- return PTR2NUM(ptr);
+ printf("dlmalloc(%d)",size);
+ ptr = xmalloc(size);
+ printf(":0x%x\n",ptr);
+ return ptr;
+ },
+ {
+ return xmalloc(size);
+ });
+}
+
+void *
+dlrealloc(void *ptr, size_t size)
+{
+ DEBUG_CODE({
+ printf("dlrealloc(0x%x,%d)\n",ptr,size);
+ });
+ return xrealloc(ptr, size);
+}
+
+void
+dlfree(void *ptr)
+{
+ DEBUG_CODE({
+ printf("dlfree(0x%x)\n",ptr);
+ });
+ xfree(ptr);
+}
+
+char*
+dlstrdup(const char *str)
+{
+ char *newstr;
+
+ newstr = (char*)dlmalloc(strlen(str)+1);
+ strcpy(newstr,str);
+
+ return newstr;
+}
+
+size_t
+dlsizeof(const char *cstr)
+{
+ size_t size;
+ int i, len, n, dlen;
+ char *d;
+
+ len = strlen(cstr);
+ size = 0;
+ for (i=0; i<len; i++) {
+ n = 1;
+ if (isdigit(cstr[i+1])) {
+ dlen = 1;
+ while (isdigit(cstr[i+dlen])) { dlen ++; };
+ dlen --;
+ d = ALLOCA_N(char, dlen + 1);
+ strncpy(d, cstr + i + 1, dlen);
+ d[dlen] = '\0';
+ n = atoi(d);
+ }
+ else{
+ dlen = 0;
+ }
+
+ switch (cstr[i]) {
+ case 'I':
+ DLALIGN(0,size,INT_ALIGN);
+ case 'i':
+ size += sizeof(int) * n;
+ break;
+ case 'L':
+ DLALIGN(0,size,LONG_ALIGN);
+ case 'l':
+ size += sizeof(long) * n;
+ break;
+ case 'F':
+ DLALIGN(0,size,FLOAT_ALIGN);
+ case 'f':
+ size += sizeof(float) * n;
+ break;
+ case 'D':
+ DLALIGN(0,size,DOUBLE_ALIGN);
+ case 'd':
+ size += sizeof(double) * n;
+ break;
+ case 'C':
+ case 'c':
+ size += sizeof(char) * n;
+ break;
+ case 'H':
+ DLALIGN(0,size,SHORT_ALIGN);
+ case 'h':
+ size += sizeof(short) * n;
+ break;
+ case 'P':
+ case 'S':
+ DLALIGN(0,size,VOIDP_ALIGN);
+ case 'p':
+ case 's':
+ size += sizeof(void*) * n;
+ break;
+ default:
+ rb_raise(rb_eDLTypeError, "unexpected type '%c'", cstr[i]);
+ break;
+ }
+ i += dlen;
+ }
+
+ return size;
+}
+
+static float *
+c_farray(VALUE v, long *size)
+{
+ int i, len;
+ float *ary;
+ VALUE e;
+
+ len = RARRAY(v)->len;
+ *size = sizeof(float) * len;
+ ary = dlmalloc(*size);
+ for (i=0; i < len; i++) {
+ e = rb_ary_entry(v, i);
+ switch (TYPE(e)) {
+ case T_FLOAT:
+ ary[i] = (float)(RFLOAT(e)->value);
+ break;
+ case T_NIL:
+ ary[i] = 0.0;
+ break;
+ default:
+ rb_raise(rb_eDLTypeError, "unexpected type of the element #%d", i);
+ break;
+ }
+ }
+
+ return ary;
+}
+
+static double *
+c_darray(VALUE v, long *size)
+{
+ int i, len;
+ double *ary;
+ VALUE e;
+
+ len = RARRAY(v)->len;
+ *size = sizeof(double) * len;
+ ary = dlmalloc(*size);
+ for (i=0; i < len; i++) {
+ e = rb_ary_entry(v, i);
+ switch (TYPE(e)) {
+ case T_FLOAT:
+ ary[i] = (double)(RFLOAT(e)->value);
+ break;
+ case T_NIL:
+ ary[i] = 0.0;
+ break;
+ default:
+ rb_raise(rb_eDLTypeError, "unexpected type of the element #%d", i);
+ break;
+ }
+ }
+
+ return ary;
+}
+
+static long *
+c_larray(VALUE v, long *size)
+{
+ int i, len;
+ long *ary;
+ VALUE e;
+
+ len = RARRAY(v)->len;
+ *size = sizeof(long) * len;
+ ary = dlmalloc(*size);
+ for (i=0; i < len; i++) {
+ e = rb_ary_entry(v, i);
+ switch (TYPE(e)) {
+ case T_FIXNUM:
+ case T_BIGNUM:
+ ary[i] = (long)(NUM2INT(e));
+ break;
+ case T_NIL:
+ ary[i] = 0;
+ break;
+ default:
+ rb_raise(rb_eDLTypeError, "unexpected type of the element #%d", i);
+ break;
+ }
+ }
+
+ return ary;
+}
+
+static int *
+c_iarray(VALUE v, long *size)
+{
+ int i, len;
+ int *ary;
+ VALUE e;
+
+ len = RARRAY(v)->len;
+ *size = sizeof(int) * len;
+ ary = dlmalloc(*size);
+ for (i=0; i < len; i++) {
+ e = rb_ary_entry(v, i);
+ switch (TYPE(e)) {
+ case T_FIXNUM:
+ case T_BIGNUM:
+ ary[i] = (int)(NUM2INT(e));
+ break;
+ case T_NIL:
+ ary[i] = 0;
+ break;
+ default:
+ rb_raise(rb_eDLTypeError, "unexpected type of the element #%d", i);
+ break;
+ }
+ }
+
+ return ary;
+}
+
+static short *
+c_harray(VALUE v, long *size)
+{
+ int i, len;
+ short *ary;
+ VALUE e;
+
+ len = RARRAY(v)->len;
+ *size = sizeof(short) * len;
+ ary = dlmalloc(*size);
+ for (i=0; i < len; i++) {
+ e = rb_ary_entry(v, i);
+ switch (TYPE(e)) {
+ case T_FIXNUM:
+ case T_BIGNUM:
+ ary[i] = (short)(NUM2INT(e));
+ break;
+ case T_NIL:
+ ary[i] = 0;
+ break;
+ default:
+ rb_raise(rb_eDLTypeError, "unexpected type of the element #%d", i);
+ break;
+ }
+ }
+
+ return ary;
+}
+
+static char *
+c_carray(VALUE v, long *size)
+{
+ int i, len;
+ char *ary;
+ VALUE e;
+
+ len = RARRAY(v)->len;
+ *size = sizeof(char) * len;
+ ary = dlmalloc(*size);
+ for (i=0; i < len; i++) {
+ e = rb_ary_entry(v, i);
+ switch (TYPE(e)) {
+ case T_FIXNUM:
+ case T_BIGNUM:
+ ary[i] = (char)(NUM2INT(e));
+ break;
+ case T_NIL:
+ ary[i] = 0;
+ break;
+ default:
+ rb_raise(rb_eDLTypeError, "unexpected type of the element #%d", i);
+ break;
+ }
+ }
+
+ return ary;
+}
+
+static void *
+c_parray(VALUE v, long *size)
+{
+ int i, len;
+ void **ary;
+ VALUE e, tmp;
+
+ len = RARRAY(v)->len;
+ *size = sizeof(void*) * len;
+ ary = dlmalloc(*size);
+ for (i=0; i < len; i++) {
+ e = rb_ary_entry(v, i);
+ switch (TYPE(e)) {
+ default:
+ tmp = rb_check_string_type(e);
+ if (NIL_P(tmp)) {
+ rb_raise(rb_eDLTypeError, "unexpected type of the element #%d", i);
+ }
+ e = tmp;
+ /* fall through */
+ case T_STRING:
+ rb_check_safe_str(e);
+ {
+ char *str, *src;
+ src = RSTRING(e)->ptr;
+ str = dlstrdup(src);
+ ary[i] = (void*)str;
+ }
+ break;
+ case T_NIL:
+ ary[i] = NULL;
+ break;
+ case T_DATA:
+ if (rb_obj_is_kind_of(e, rb_cDLPtrData)) {
+ struct ptr_data *pdata;
+ Data_Get_Struct(e, struct ptr_data, pdata);
+ ary[i] = (void*)(pdata->ptr);
+ }
+ else{
+ e = rb_funcall(e, rb_intern("to_ptr"), 0);
+ if (rb_obj_is_kind_of(e, rb_cDLPtrData)) {
+ struct ptr_data *pdata;
+ Data_Get_Struct(e, struct ptr_data, pdata);
+ ary[i] = (void*)(pdata->ptr);
+ }
+ else{
+ rb_raise(rb_eDLTypeError, "unexpected type of the element #%d", i);
+ }
+ }
+ break;
+ }
+ }
+
+ return ary;
+}
+
+void *
+rb_ary2cary(char t, VALUE v, long *size)
+{
+ int len;
+ VALUE val0;
+
+ val0 = rb_check_array_type(v);
+ if(NIL_P(val0)) {
+ rb_raise(rb_eDLTypeError, "an array is expected.");
+ }
+ v = val0;
+
+ len = RARRAY(v)->len;
+ if (len == 0) {
+ return NULL;
+ }
+
+ if (!size) {
+ size = ALLOCA_N(long,1);
+ }
+
+ val0 = rb_ary_entry(v,0);
+ switch (TYPE(val0)) {
+ case T_FIXNUM:
+ case T_BIGNUM:
+ switch (t) {
+ case 'C': case 'c':
+ return (void*)c_carray(v,size);
+ case 'H': case 'h':
+ return (void*)c_harray(v,size);
+ case 'I': case 'i':
+ return (void*)c_iarray(v,size);
+ case 'L': case 'l': case 0:
+ return (void*)c_larray(v,size);
+ default:
+ rb_raise(rb_eDLTypeError, "type mismatch");
+ }
+ case T_STRING:
+ return (void*)c_parray(v,size);
+ case T_FLOAT:
+ switch (t) {
+ case 'F': case 'f':
+ return (void*)c_farray(v,size);
+ case 'D': case 'd': case 0:
+ return (void*)c_darray(v,size);
+ }
+ rb_raise(rb_eDLTypeError, "type mismatch");
+ case T_DATA:
+ if (rb_obj_is_kind_of(val0, rb_cDLPtrData)) {
+ return (void*)c_parray(v,size);
+ }
+ else{
+ val0 = rb_funcall(val0, rb_intern("to_ptr"), 0);
+ if (rb_obj_is_kind_of(val0, rb_cDLPtrData)) {
+ return (void*)c_parray(v,size);
+ }
+ }
+ rb_raise(rb_eDLTypeError, "type mismatch");
+ case T_NIL:
+ return (void*)c_parray(v, size);
+ default:
+ rb_raise(rb_eDLTypeError, "unsupported type");
+ }
}
VALUE
-rb_dl_realloc(VALUE self, VALUE addr, VALUE size)
+rb_str_to_ptr(VALUE self)
{
- void *ptr = NUM2PTR(addr);
+ char *ptr;
+ int len;
+ VALUE p;
- rb_secure(4);
- ptr = (void*)ruby_xrealloc(ptr, NUM2INT(size));
- return PTR2NUM(ptr);
+ len = RSTRING(self)->len;
+ ptr = (char*)dlmalloc(len + 1);
+ memcpy(ptr, RSTRING(self)->ptr, len);
+ ptr[len] = '\0';
+ p = rb_dlptr_new((void*)ptr,len,dlfree);
+ OBJ_INFECT(p, self);
+ return p;
}
VALUE
-rb_dl_free(VALUE self, VALUE addr)
+rb_ary_to_ptr(int argc, VALUE argv[], VALUE self)
{
- void *ptr = NUM2PTR(addr);
+ void *ptr;
+ VALUE t;
+ long size;
- rb_secure(4);
- ruby_xfree(ptr);
- return Qnil;
+ switch (rb_scan_args(argc, argv, "01", &t)) {
+ case 1:
+ ptr = rb_ary2cary(StringValuePtr(t)[0], self, &size);
+ break;
+ case 0:
+ ptr = rb_ary2cary(0, self, &size);
+ break;
+ }
+ if (ptr) {
+ VALUE p = rb_dlptr_new(ptr, size, dlfree);
+ OBJ_INFECT(p, self);
+ return p;
+ }
+ return Qnil;
}
VALUE
-rb_dl_ptr2value(VALUE self, VALUE addr)
+rb_io_to_ptr(VALUE self)
{
- rb_secure(4);
- return (VALUE)NUM2PTR(addr);
+ rb_io_t *fptr;
+ FILE *fp;
+
+ GetOpenFile(self, fptr);
+ fp = fptr->f;
+
+ return fp ? rb_dlptr_new(fp, 0, 0) : Qnil;
}
VALUE
-rb_dl_value2ptr(VALUE self, VALUE val)
+rb_dl_dlopen(int argc, VALUE argv[], VALUE self)
{
- return PTR2NUM((void*)val);
+ rb_secure(2);
+ return rb_class_new_instance(argc, argv, rb_cDLHandle);
}
-static void
-rb_dl_init_callbacks(VALUE dl)
+VALUE
+rb_dl_malloc(VALUE self, VALUE size)
{
- static const char cb[] = "dl/callback.so";
+ rb_secure(4);
+ return rb_dlptr_malloc(DLNUM2LONG(size), dlfree);
+}
- rb_autoload(dl, rb_intern_const("CdeclCallbackAddrs"), cb);
- rb_autoload(dl, rb_intern_const("CdeclCallbackProcs"), cb);
-#ifdef FUNC_STDCALL
- rb_autoload(dl, rb_intern_const("StdcallCallbackAddrs"), cb);
- rb_autoload(dl, rb_intern_const("StdcallCallbackProcs"), cb);
-#endif
+VALUE
+rb_dl_strdup(VALUE self, VALUE str)
+{
+ SafeStringValue(str);
+ return rb_dlptr_new(strdup(RSTRING(str)->ptr), RSTRING(str)->len, dlfree);
+}
+
+static VALUE
+rb_dl_sizeof(VALUE self, VALUE str)
+{
+ return INT2NUM(dlsizeof(StringValuePtr(str)));
+}
+
+static VALUE
+rb_dl_callback(int argc, VALUE argv[], VALUE self)
+{
+ VALUE type, proc;
+ int rettype, entry, i;
+ char fname[127];
+
+ rb_secure(4);
+ proc = Qnil;
+ switch (rb_scan_args(argc, argv, "11", &type, &proc)) {
+ case 1:
+ if (rb_block_given_p()) {
+ proc = rb_block_proc();
+ }
+ else{
+ proc = Qnil;
+ }
+ default:
+ break;
+ }
+
+ StringValue(type);
+ switch (RSTRING(type)->ptr[0]) {
+ case '0':
+ rettype = 0x00;
+ break;
+ case 'C':
+ rettype = 0x01;
+ break;
+ case 'H':
+ rettype = 0x02;
+ break;
+ case 'I':
+ rettype = 0x03;
+ break;
+ case 'L':
+ rettype = 0x04;
+ break;
+ case 'F':
+ rettype = 0x05;
+ break;
+ case 'D':
+ rettype = 0x06;
+ break;
+ case 'P':
+ rettype = 0x07;
+ break;
+ default:
+ rb_raise(rb_eDLTypeError, "unsupported type `%c'", RSTRING(type)->ptr[0]);
+ }
+
+ entry = -1;
+ for (i=0; i < MAX_CALLBACK; i++) {
+ if (rb_hash_aref(DLFuncTable, rb_assoc_new(INT2NUM(rettype), INT2NUM(i))) == Qnil) {
+ entry = i;
+ break;
+ }
+ }
+ if (entry < 0) {
+ rb_raise(rb_eDLError, "too many callbacks are defined.");
+ }
+
+ rb_hash_aset(DLFuncTable,
+ rb_assoc_new(INT2NUM(rettype),INT2NUM(entry)),
+ rb_assoc_new(type,proc));
+ sprintf(fname, "rb_dl_callback_func_%d_%d", rettype, entry);
+ return rb_dlsym_new((void (*)())rb_dl_callback_table[rettype][entry],
+ fname, RSTRING(type)->ptr);
+}
+
+static VALUE
+rb_dl_remove_callback(VALUE mod, VALUE sym)
+{
+ freefunc_t f;
+ int i, j;
+
+ rb_secure(4);
+ f = rb_dlsym2csym(sym);
+ for (i=0; i < CALLBACK_TYPES; i++) {
+ for (j=0; j < MAX_CALLBACK; j++) {
+ if (rb_dl_callback_table[i][j] == f) {
+ rb_hash_aset(DLFuncTable, rb_assoc_new(INT2NUM(i),INT2NUM(j)),Qnil);
+ break;
+ }
+ }
+ }
+ return Qnil;
}
void
-Init_dl(void)
-{
- void Init_dlhandle(void);
- void Init_dlcfunc(void);
- void Init_dlptr(void);
-
- rbdl_id_cdecl = rb_intern_const("cdecl");
- rbdl_id_stdcall = rb_intern_const("stdcall");
-
- rb_mDL = rb_define_module("DL");
- rb_eDLError = rb_define_class_under(rb_mDL, "DLError", rb_eStandardError);
- rb_eDLTypeError = rb_define_class_under(rb_mDL, "DLTypeError", rb_eDLError);
-
- rb_define_const(rb_mDL, "MAX_CALLBACK", INT2NUM(MAX_CALLBACK));
- rb_define_const(rb_mDL, "DLSTACK_SIZE", INT2NUM(DLSTACK_SIZE));
-
- rb_dl_init_callbacks(rb_mDL);
-
- rb_define_const(rb_mDL, "RTLD_GLOBAL", INT2NUM(RTLD_GLOBAL));
- rb_define_const(rb_mDL, "RTLD_LAZY", INT2NUM(RTLD_LAZY));
- rb_define_const(rb_mDL, "RTLD_NOW", INT2NUM(RTLD_NOW));
-
- rb_define_const(rb_mDL, "TYPE_VOID", INT2NUM(DLTYPE_VOID));
- rb_define_const(rb_mDL, "TYPE_VOIDP", INT2NUM(DLTYPE_VOIDP));
- rb_define_const(rb_mDL, "TYPE_CHAR", INT2NUM(DLTYPE_CHAR));
- rb_define_const(rb_mDL, "TYPE_SHORT", INT2NUM(DLTYPE_SHORT));
- rb_define_const(rb_mDL, "TYPE_INT", INT2NUM(DLTYPE_INT));
- rb_define_const(rb_mDL, "TYPE_LONG", INT2NUM(DLTYPE_LONG));
-#if HAVE_LONG_LONG
- rb_define_const(rb_mDL, "TYPE_LONG_LONG", INT2NUM(DLTYPE_LONG_LONG));
-#endif
- rb_define_const(rb_mDL, "TYPE_FLOAT", INT2NUM(DLTYPE_FLOAT));
- rb_define_const(rb_mDL, "TYPE_DOUBLE", INT2NUM(DLTYPE_DOUBLE));
-
- rb_define_const(rb_mDL, "ALIGN_VOIDP", INT2NUM(ALIGN_VOIDP));
- rb_define_const(rb_mDL, "ALIGN_CHAR", INT2NUM(ALIGN_CHAR));
- rb_define_const(rb_mDL, "ALIGN_SHORT", INT2NUM(ALIGN_SHORT));
- rb_define_const(rb_mDL, "ALIGN_INT", INT2NUM(ALIGN_INT));
- rb_define_const(rb_mDL, "ALIGN_LONG", INT2NUM(ALIGN_LONG));
-#if HAVE_LONG_LONG
- rb_define_const(rb_mDL, "ALIGN_LONG_LONG", INT2NUM(ALIGN_LONG_LONG));
-#endif
- rb_define_const(rb_mDL, "ALIGN_FLOAT", INT2NUM(ALIGN_FLOAT));
- rb_define_const(rb_mDL, "ALIGN_DOUBLE",INT2NUM(ALIGN_DOUBLE));
-
- rb_define_const(rb_mDL, "SIZEOF_VOIDP", INT2NUM(sizeof(void*)));
- rb_define_const(rb_mDL, "SIZEOF_CHAR", INT2NUM(sizeof(char)));
- rb_define_const(rb_mDL, "SIZEOF_SHORT", INT2NUM(sizeof(short)));
- rb_define_const(rb_mDL, "SIZEOF_INT", INT2NUM(sizeof(int)));
- rb_define_const(rb_mDL, "SIZEOF_LONG", INT2NUM(sizeof(long)));
-#if HAVE_LONG_LONG
- rb_define_const(rb_mDL, "SIZEOF_LONG_LONG", INT2NUM(sizeof(LONG_LONG)));
-#endif
- rb_define_const(rb_mDL, "SIZEOF_FLOAT", INT2NUM(sizeof(float)));
- rb_define_const(rb_mDL, "SIZEOF_DOUBLE",INT2NUM(sizeof(double)));
-
- rb_define_module_function(rb_mDL, "dlwrap", rb_dl_value2ptr, 1);
- rb_define_module_function(rb_mDL, "dlunwrap", rb_dl_ptr2value, 1);
-
- rb_define_module_function(rb_mDL, "dlopen", rb_dl_dlopen, -1);
- rb_define_module_function(rb_mDL, "malloc", rb_dl_malloc, 1);
- rb_define_module_function(rb_mDL, "realloc", rb_dl_realloc, 2);
- rb_define_module_function(rb_mDL, "free", rb_dl_free, 1);
-
- rb_define_const(rb_mDL, "RUBY_FREE", PTR2NUM(ruby_xfree));
- rb_define_const(rb_mDL, "BUILD_RUBY_PLATFORM", rb_str_new2(RUBY_PLATFORM));
- rb_define_const(rb_mDL, "BUILD_RUBY_VERSION", rb_str_new2(RUBY_VERSION));
-
- Init_dlhandle();
- Init_dlcfunc();
- Init_dlptr();
+Init_dl()
+{
+ void Init_dlptr();
+ void Init_dlsym();
+ void Init_dlhandle();
+
+ id_call = rb_intern("call");
+
+ rb_mDL = rb_define_module("DL");
+
+ rb_eDLError = rb_define_class_under(rb_mDL, "DLError", rb_eStandardError);
+ rb_eDLTypeError = rb_define_class_under(rb_mDL, "DLTypeError", rb_eDLError);
+
+ DLFuncTable = rb_hash_new();
+ init_dl_func_table();
+ rb_define_const(rb_mDL, "FuncTable", DLFuncTable);
+
+ rb_define_const(rb_mDL, "RTLD_GLOBAL", INT2NUM(RTLD_GLOBAL));
+ rb_define_const(rb_mDL, "RTLD_LAZY", INT2NUM(RTLD_LAZY));
+ rb_define_const(rb_mDL, "RTLD_NOW", INT2NUM(RTLD_NOW));
+
+ rb_define_const(rb_mDL, "ALIGN_INT", INT2NUM(ALIGN_INT));
+ rb_define_const(rb_mDL, "ALIGN_LONG", INT2NUM(ALIGN_LONG));
+ rb_define_const(rb_mDL, "ALIGN_FLOAT", INT2NUM(ALIGN_FLOAT));
+ rb_define_const(rb_mDL, "ALIGN_SHORT", INT2NUM(ALIGN_SHORT));
+ rb_define_const(rb_mDL, "ALIGN_DOUBLE",INT2NUM(ALIGN_DOUBLE));
+ rb_define_const(rb_mDL, "ALIGN_VOIDP", INT2NUM(ALIGN_VOIDP));
+
+ rb_define_const(rb_mDL, "MAX_ARG", INT2NUM(MAX_ARG));
+ rb_define_const(rb_mDL, "DLSTACK", rb_tainted_str_new2(DLSTACK_METHOD));
+
+ rb_define_module_function(rb_mDL, "dlopen", rb_dl_dlopen, -1);
+ rb_define_module_function(rb_mDL, "callback", rb_dl_callback, -1);
+ rb_define_module_function(rb_mDL, "define_callback", rb_dl_callback, -1);
+ rb_define_module_function(rb_mDL, "remove_callback", rb_dl_remove_callback, 1);
+ rb_define_module_function(rb_mDL, "malloc", rb_dl_malloc, 1);
+ rb_define_module_function(rb_mDL, "strdup", rb_dl_strdup, 1);
+ rb_define_module_function(rb_mDL, "sizeof", rb_dl_sizeof, 1);
+
+ Init_dlptr();
+ Init_dlsym();
+ Init_dlhandle();
+
+ rb_define_const(rb_mDL, "FREE", rb_dlsym_new(dlfree, "free", "0P"));
+
+ rb_define_method(rb_cString, "to_ptr", rb_str_to_ptr, 0);
+ rb_define_method(rb_cArray, "to_ptr", rb_ary_to_ptr, -1);
+ rb_define_method(rb_cIO, "to_ptr", rb_io_to_ptr, 0);
}
diff --git a/ext/dl/dl.def b/ext/dl/dl.def
new file mode 100644
index 0000000000..cdab4af90d
--- /dev/null
+++ b/ext/dl/dl.def
@@ -0,0 +1,59 @@
+EXPORTS
+Init_dl
+dlfree
+dlmalloc
+dlrealloc
+dlstrdup
+rb_ary_to_ptr
+rb_dl_dlopen
+rb_dl_malloc
+rb_dl_strdup
+rb_eDLError
+rb_eDLTypeError
+rb_io_to_ptr
+rb_mDL
+rb_str_to_ptr
+Init_dlhandle
+rb_cDLHandle
+rb_dlhandle_close
+rb_dlhandle_disable_close
+rb_dlhandle_enable_close
+rb_dlhandle_sym
+Init_dlptr
+rb_cDLPtrData
+rb_dlmem_each
+rb_dlptr2cptr
+rb_dlptr_malloc
+rb_dlptr_aref
+rb_dlptr_aset
+rb_dlptr_cmp
+rb_dlptr_define_data_type
+rb_dlptr_define_struct
+rb_dlptr_define_union
+rb_dlptr_eql
+rb_dlptr_free_get
+rb_dlptr_free_set
+rb_dlptr_get_data_type
+rb_dlptr_inspect
+rb_dlptr_minus
+rb_dlptr_new
+rb_dlptr_new2
+rb_dlptr_null_p
+rb_dlptr_plus
+rb_dlptr_ptr
+rb_dlptr_ref
+rb_dlptr_to_array
+rb_dlptr_to_i
+rb_dlptr_to_s
+rb_dlptr_to_str
+rb_mDLMemorySpace
+Init_dlsym
+rb_cDLSymbol
+rb_dlsym2csym
+rb_dlsym_call
+rb_dlsym_cproto
+rb_dlsym_inspect
+rb_dlsym_name
+rb_dlsym_new
+rb_dlsym_proto
+rb_dlsym_to_ptr
diff --git a/ext/dl/dl.h b/ext/dl/dl.h
index d06cad4e6b..1faa316cf1 100644
--- a/ext/dl/dl.h
+++ b/ext/dl/dl.h
@@ -1,11 +1,12 @@
+/* -*- C -*-
+ * $Id$
+ */
+
#ifndef RUBY_DL_H
#define RUBY_DL_H
#include <ruby.h>
-
-#if !defined(FUNC_CDECL)
-# define FUNC_CDECL(x) x
-#endif
+#include <dlconfig.h>
#if defined(HAVE_DLFCN_H)
# include <dlfcn.h>
@@ -22,8 +23,9 @@
#else
# if defined(HAVE_WINDOWS_H)
# include <windows.h>
+# define dlclose(ptr) FreeLibrary((HINSTANCE)ptr)
# define dlopen(name,flag) ((void*)LoadLibrary(name))
-# define dlerror() strerror(rb_w32_map_errno(GetLastError()))
+# define dlerror() "unknown error"
# define dlsym(handle,name) ((void*)GetProcAddress(handle,name))
# define RTLD_LAZY -1
# define RTLD_NOW -1
@@ -31,194 +33,281 @@
# endif
#endif
-#define MAX_CALLBACK 5
-#define DLSTACK_TYPE long
-#define DLSTACK_SIZE (20)
-#define DLSTACK_PROTO \
- DLSTACK_TYPE,DLSTACK_TYPE,DLSTACK_TYPE,DLSTACK_TYPE,DLSTACK_TYPE,\
- DLSTACK_TYPE,DLSTACK_TYPE,DLSTACK_TYPE,DLSTACK_TYPE,DLSTACK_TYPE,\
- DLSTACK_TYPE,DLSTACK_TYPE,DLSTACK_TYPE,DLSTACK_TYPE,DLSTACK_TYPE,\
- DLSTACK_TYPE,DLSTACK_TYPE,DLSTACK_TYPE,DLSTACK_TYPE,DLSTACK_TYPE
-#define DLSTACK_ARGS(stack) \
- stack[0],stack[1],stack[2],stack[3],stack[4],\
- stack[5],stack[6],stack[7],stack[8],stack[9],\
- stack[10],stack[11],stack[12],stack[13],stack[14],\
- stack[15],stack[16],stack[17],stack[18],stack[19]
-
-#define DLSTACK_PROTO0_ void
-#define DLSTACK_PROTO1_ DLSTACK_TYPE
-#define DLSTACK_PROTO2_ DLSTACK_PROTO1_, DLSTACK_TYPE
-#define DLSTACK_PROTO3_ DLSTACK_PROTO2_, DLSTACK_TYPE
-#define DLSTACK_PROTO4_ DLSTACK_PROTO3_, DLSTACK_TYPE
-#define DLSTACK_PROTO4_ DLSTACK_PROTO3_, DLSTACK_TYPE
-#define DLSTACK_PROTO5_ DLSTACK_PROTO4_, DLSTACK_TYPE
-#define DLSTACK_PROTO6_ DLSTACK_PROTO5_, DLSTACK_TYPE
-#define DLSTACK_PROTO7_ DLSTACK_PROTO6_, DLSTACK_TYPE
-#define DLSTACK_PROTO8_ DLSTACK_PROTO7_, DLSTACK_TYPE
-#define DLSTACK_PROTO9_ DLSTACK_PROTO8_, DLSTACK_TYPE
-#define DLSTACK_PROTO10_ DLSTACK_PROTO9_, DLSTACK_TYPE
-#define DLSTACK_PROTO11_ DLSTACK_PROTO10_, DLSTACK_TYPE
-#define DLSTACK_PROTO12_ DLSTACK_PROTO11_, DLSTACK_TYPE
-#define DLSTACK_PROTO13_ DLSTACK_PROTO12_, DLSTACK_TYPE
-#define DLSTACK_PROTO14_ DLSTACK_PROTO13_, DLSTACK_TYPE
-#define DLSTACK_PROTO14_ DLSTACK_PROTO13_, DLSTACK_TYPE
-#define DLSTACK_PROTO15_ DLSTACK_PROTO14_, DLSTACK_TYPE
-#define DLSTACK_PROTO16_ DLSTACK_PROTO15_, DLSTACK_TYPE
-#define DLSTACK_PROTO17_ DLSTACK_PROTO16_, DLSTACK_TYPE
-#define DLSTACK_PROTO18_ DLSTACK_PROTO17_, DLSTACK_TYPE
-#define DLSTACK_PROTO19_ DLSTACK_PROTO18_, DLSTACK_TYPE
-#define DLSTACK_PROTO20_ DLSTACK_PROTO19_, DLSTACK_TYPE
+#if !defined(StringValue)
+# define StringValue(v) if(TYPE(v) != T_STRING) v = rb_str_to_str(v)
+#endif
+#if !defined(StringValuePtr)
+# define StringValuePtr(v) RSTRING((TYPE(v) == T_STRING) ? (v) : rb_str_to_str(v))->ptr
+#endif
-/*
- * Add ",..." as the last argument.
- * This is required for variable argument functions such
- * as fprintf() on x86_64-linux.
- *
- * http://refspecs.linuxfoundation.org/elf/x86_64-abi-0.95.pdf
- * page 19:
- *
- * For calls that may call functions that use varargs or stdargs
- * (prototype-less calls or calls to functions containing ellipsis
- * (...) in the declaration) %al is used as hidden argument to
- * specify the number of SSE registers used.
- */
-#define DLSTACK_PROTO0 void
-#define DLSTACK_PROTO1 DLSTACK_PROTO1_, ...
-#define DLSTACK_PROTO2 DLSTACK_PROTO2_, ...
-#define DLSTACK_PROTO3 DLSTACK_PROTO3_, ...
-#define DLSTACK_PROTO4 DLSTACK_PROTO4_, ...
-#define DLSTACK_PROTO4 DLSTACK_PROTO4_, ...
-#define DLSTACK_PROTO5 DLSTACK_PROTO5_, ...
-#define DLSTACK_PROTO6 DLSTACK_PROTO6_, ...
-#define DLSTACK_PROTO7 DLSTACK_PROTO7_, ...
-#define DLSTACK_PROTO8 DLSTACK_PROTO8_, ...
-#define DLSTACK_PROTO9 DLSTACK_PROTO9_, ...
-#define DLSTACK_PROTO10 DLSTACK_PROTO10_, ...
-#define DLSTACK_PROTO11 DLSTACK_PROTO11_, ...
-#define DLSTACK_PROTO12 DLSTACK_PROTO12_, ...
-#define DLSTACK_PROTO13 DLSTACK_PROTO13_, ...
-#define DLSTACK_PROTO14 DLSTACK_PROTO14_, ...
-#define DLSTACK_PROTO14 DLSTACK_PROTO14_, ...
-#define DLSTACK_PROTO15 DLSTACK_PROTO15_, ...
-#define DLSTACK_PROTO16 DLSTACK_PROTO16_, ...
-#define DLSTACK_PROTO17 DLSTACK_PROTO17_, ...
-#define DLSTACK_PROTO18 DLSTACK_PROTO18_, ...
-#define DLSTACK_PROTO19 DLSTACK_PROTO19_, ...
-#define DLSTACK_PROTO20 DLSTACK_PROTO20_, ...
-
-#define DLSTACK_ARGS0(stack)
-#define DLSTACK_ARGS1(stack) stack[0]
-#define DLSTACK_ARGS2(stack) DLSTACK_ARGS1(stack), stack[1]
-#define DLSTACK_ARGS3(stack) DLSTACK_ARGS2(stack), stack[2]
-#define DLSTACK_ARGS4(stack) DLSTACK_ARGS3(stack), stack[3]
-#define DLSTACK_ARGS5(stack) DLSTACK_ARGS4(stack), stack[4]
-#define DLSTACK_ARGS6(stack) DLSTACK_ARGS5(stack), stack[5]
-#define DLSTACK_ARGS7(stack) DLSTACK_ARGS6(stack), stack[6]
-#define DLSTACK_ARGS8(stack) DLSTACK_ARGS7(stack), stack[7]
-#define DLSTACK_ARGS9(stack) DLSTACK_ARGS8(stack), stack[8]
-#define DLSTACK_ARGS10(stack) DLSTACK_ARGS9(stack), stack[9]
-#define DLSTACK_ARGS11(stack) DLSTACK_ARGS10(stack), stack[10]
-#define DLSTACK_ARGS12(stack) DLSTACK_ARGS11(stack), stack[11]
-#define DLSTACK_ARGS13(stack) DLSTACK_ARGS12(stack), stack[12]
-#define DLSTACK_ARGS14(stack) DLSTACK_ARGS13(stack), stack[13]
-#define DLSTACK_ARGS15(stack) DLSTACK_ARGS14(stack), stack[14]
-#define DLSTACK_ARGS16(stack) DLSTACK_ARGS15(stack), stack[15]
-#define DLSTACK_ARGS17(stack) DLSTACK_ARGS16(stack), stack[16]
-#define DLSTACK_ARGS18(stack) DLSTACK_ARGS17(stack), stack[17]
-#define DLSTACK_ARGS19(stack) DLSTACK_ARGS18(stack), stack[18]
-#define DLSTACK_ARGS20(stack) DLSTACK_ARGS19(stack), stack[19]
+#ifdef DEBUG
+#define DEBUG_CODE(b) {printf("DEBUG:%d\n",__LINE__);b;}
+#define DEBUG_CODE2(b1,b2) {printf("DEBUG:%d\n",__LINE__);b1;}
+#else
+#define DEBUG_CODE(b)
+#define DEBUG_CODE2(b1,b2) b2
+#endif
+
+#define VOID_DLTYPE 0x00
+#define CHAR_DLTYPE 0x01
+#define SHORT_DLTYPE 0x02
+#define INT_DLTYPE 0x03
+#define LONG_DLTYPE 0x04
+#define FLOAT_DLTYPE 0x05
+#define DOUBLE_DLTYPE 0x06
+#define VOIDP_DLTYPE 0x07
+
+#define ARG_TYPE(x,i) (((x) & (0x07 << ((i)*3))) >> ((i)*3))
+#define PUSH_ARG(x,t) do{x <<= 3; x |= t;}while(0)
+#define PUSH_0(x) PUSH_ARG(x,VOID_DLTYPE)
+
+#if SIZEOF_INT == SIZEOF_LONG
+# define PUSH_I(x) PUSH_ARG(x,LONG_DLTYPE)
+# define ANY2I(x) x.l
+# define DLINT(x) (long)x
+#else
+# define PUSH_I(x) PUSH_ARG(x,INT_DLTYPE)
+# define ANY2I(x) x.i
+# define DLINT(x) (int)x
+#endif
+#define PUSH_L(x) PUSH_ARG(x,LONG_DLTYPE)
+#define ANY2L(x) x.l
+#define DLLONG(x) (long)x
+
+#if defined(WITH_TYPE_FLOAT)
+# if SIZEOF_FLOAT == SIZEOF_DOUBLE
+# define PUSH_F(x) PUSH_ARG(x,DOUBLE_DLTYPE)
+# define ANY2F(x) (x.d)
+# define DLFLOAT(x) ((double)x)
+# else
+# define PUSH_F(x) PUSH_ARG(x,FLOAT_DLTYPE)
+# define ANY2F(x) (x.f)
+# define DLFLOAT(x) ((float)x)
+# endif
+#else
+# define PUSH_F(x) PUSH_ARG(x,DOUBLE_DLTYPE)
+# define ANY2F(x) (x.d)
+# define DLFLOAT(x) ((double)x)
+#endif
+#define PUSH_D(x) PUSH_ARG(x,DOUBLE_DLTYPE)
+#define ANY2D(x) (x.d)
+#define DLDOUBLE(x) ((double)x)
+
+#if SIZEOF_INT == SIZEOF_VOIDP && SIZEOF_INT != SIZEOF_LONG
+# define PUSH_P(x) PUSH_ARG(x,INT_DLTYPE)
+# define ANY2P(x) (x.i)
+# define DLVOIDP(x) ((int)x)
+#elif SIZEOF_LONG == SIZEOF_VOIDP
+# define PUSH_P(x) PUSH_ARG(x,LONG_DLTYPE)
+# define ANY2P(x) (x.l)
+# define DLVOIDP(x) ((long)x)
+#else
+# define PUSH_P(x) PUSH_ARG(x,VOIDP_DLTYPE)
+# define ANY2P(x) (x.p)
+# define DLVOIDP(x) ((void*)p)
+#endif
+
+#if defined(WITH_TYPE_CHAR)
+# define PUSH_C(x) PUSH_ARG(x,CHAR_DLTYPE)
+# define ANY2C(x) (x.c)
+# define DLCHAR(x) ((char)x)
+#else
+# define PUSH_C(x) PUSH_I(x)
+# define ANY2C(x) ANY2I(x)
+# define DLCHAR(x) DLINT(x)
+#endif
+
+#if defined(WITH_TYPE_SHORT)
+# define PUSH_H(x) PUSH_ARG(x,SHORT_DLTYPE)
+# define ANY2H(x) (x.h)
+# define DLSHORT(x) ((short)x)
+#else
+# define PUSH_H(x) PUSH_I(x)
+# define ANY2H(x) ANY2I(x)
+# define DLSHORT(x) DLINT(x)
+#endif
+
+#define PUSH_S(x) PUSH_P(x)
+#define ANY2S(x) ANY2P(x)
+#define DLSTR(x) DLVOIDP(x)
+
+#define CBPUSH_0(x) PUSH_0(x)
+#define CBPUSH_C(x) PUSH_C(x)
+#define CBPUSH_H(x) PUSH_H(x)
+#define CBPUSH_I(x) PUSH_I(x)
+#define CBPUSH_L(x) PUSH_L(x)
+#define CBPUSH_F(x) PUSH_F(x)
+#define CBPUSH_D(x) PUSH_D(x)
+#if defined(WITH_CBTYPE_VOIDP)
+# define CBPUSH_P(x) PUSH_ARG(x,VOIDP_DLTYPE)
+#else
+# define CBPUSH_P(x) PUSH_P(x)
+#endif
+
+
+#if defined(USE_INLINE_ASM)
+# if defined(__i386__) && defined(__GNUC__)
+# define DLSTACK
+# define DLSTACK_METHOD "asm"
+# define DLSTACK_REVERSE
+# define DLSTACK_PROTO
+# define DLSTACK_ARGS
+# define DLSTACK_START(sym)
+# define DLSTACK_END(sym)
+# define DLSTACK_PUSH_C(x) asm volatile ("pushl %0" :: "g" (x));
+# define DLSTACK_PUSH_H(x) asm volatile ("pushl %0" :: "g" (x));
+# define DLSTACK_PUSH_I(x) asm volatile ("pushl %0" :: "g" (x));
+# define DLSTACK_PUSH_L(x) asm volatile ("pushl %0" :: "g" (x));
+# define DLSTACK_PUSH_P(x) asm volatile ("pushl %0" :: "g" (x));
+# define DLSTACK_PUSH_F(x) asm volatile ("flds %0"::"g"(x));\
+ asm volatile ("subl $4,%esp");\
+ asm volatile ("fstps (%esp)");
+# define DLSTACK_PUSH_D(x) asm volatile ("fldl %0"::"g"(x));\
+ asm volatile ("subl $8,%esp");\
+ asm volatile ("fstpl (%esp)")
+# else
+# error --with-asm is not supported on this machine
+# endif
+#elif defined(USE_DLSTACK)
+# define DLSTACK
+# define DLSTACK_GUARD
+# define DLSTACK_METHOD "dl"
+# define DLSTACK_PROTO long,long,long,long,long,\
+ long,long,long,long,long,\
+ long,long,long,long,long
+# define DLSTACK_ARGS stack[0],stack[1],stack[2],stack[3],stack[4],\
+ stack[5],stack[6],stack[7],stack[8],stack[9],\
+ stack[10],stack[11],stack[12],stack[13],stack[14]
+# define DLSTACK_SIZE (sizeof(long)*15)
+# define DLSTACK_START(sym)
+# define DLSTACK_END(sym)
+# define DLSTACK_PUSH_C(x) {long v=(long)x; memcpy(sp,&v,sizeof(long)); sp++;}
+# define DLSTACK_PUSH_H(x) {long v=(long)x; memcpy(sp,&v,sizeof(long)); sp++;}
+# define DLSTACK_PUSH_I(x) {long v=(long)x; memcpy(sp,&v,sizeof(long)); sp++;}
+# define DLSTACK_PUSH_L(x) memcpy(sp,&x,sizeof(long)); sp++;
+# define DLSTACK_PUSH_P(x) memcpy(sp,&x,sizeof(void*)); sp++;
+# define DLSTACK_PUSH_F(x) memcpy(sp,&x,sizeof(float)); sp+=sizeof(float)/sizeof(long);
+# define DLSTACK_PUSH_D(x) memcpy(sp,&x,sizeof(double)); sp+=sizeof(double)/sizeof(long);
+#else
+# define DLSTACK_METHOD "none"
+#endif
extern VALUE rb_mDL;
+extern VALUE rb_mDLMemorySpace;
extern VALUE rb_cDLHandle;
extern VALUE rb_cDLSymbol;
+extern VALUE rb_cDLPtrData;
+extern VALUE rb_cDLStructData;
+
extern VALUE rb_eDLError;
extern VALUE rb_eDLTypeError;
+#if defined(LONG2NUM) && (SIZEOF_LONG == SIZEOF_VOIDP)
+# define DLLONG2NUM(x) LONG2NUM((long)x)
+# define DLNUM2LONG(x) (long)(NUM2LONG(x))
+#else
+# define DLLONG2NUM(x) INT2NUM((long)x)
+# define DLNUM2LONG(x) (long)(NUM2INT(x))
+#endif
+
typedef struct { char c; void *x; } s_voidp;
typedef struct { char c; short x; } s_short;
typedef struct { char c; int x; } s_int;
typedef struct { char c; long x; } s_long;
typedef struct { char c; float x; } s_float;
typedef struct { char c; double x; } s_double;
-#if HAVE_LONG_LONG
-typedef struct { char c; LONG_LONG x; } s_long_long;
-#endif
#define ALIGN_VOIDP (sizeof(s_voidp) - sizeof(void *))
#define ALIGN_SHORT (sizeof(s_short) - sizeof(short))
-#define ALIGN_CHAR (1)
#define ALIGN_INT (sizeof(s_int) - sizeof(int))
#define ALIGN_LONG (sizeof(s_long) - sizeof(long))
-#if HAVE_LONG_LONG
-#define ALIGN_LONG_LONG (sizeof(s_long_long) - sizeof(LONG_LONG))
-#endif
#define ALIGN_FLOAT (sizeof(s_float) - sizeof(float))
#define ALIGN_DOUBLE (sizeof(s_double) - sizeof(double))
+/* for compatibility */
+#define VOIDP_ALIGN ALIGN_VOIDP
+#define SHORT_ALIGN ALIGN_SHORT
+#define INT_ALIGN ALIGN_INT
+#define LONG_ALIGN ALIGN_LONG
+#define FLOAT_ALIGN ALIGN_FLOAT
+#define DOUBLE_ALIGN ALIGN_DOUBLE
+
#define DLALIGN(ptr,offset,align) {\
while( (((unsigned long)((char *)ptr + offset)) % align) != 0 ) offset++;\
}
+typedef void (*freefunc_t)(void *);
+#define DLFREEFUNC(func) ((freefunc_t)(func))
-#define DLTYPE_VOID 0
-#define DLTYPE_VOIDP 1
-#define DLTYPE_CHAR 2
-#define DLTYPE_SHORT 3
-#define DLTYPE_INT 4
-#define DLTYPE_LONG 5
-#if HAVE_LONG_LONG
-#define DLTYPE_LONG_LONG 6
-#endif
-#define DLTYPE_FLOAT 7
-#define DLTYPE_DOUBLE 8
-#define MAX_DLTYPE 9
-
-#if SIZEOF_VOIDP == SIZEOF_LONG
-# define PTR2NUM(x) (ULONG2NUM((unsigned long)(x)))
-# define NUM2PTR(x) ((void*)(NUM2ULONG(x)))
-#else
-/* # error --->> Ruby/DL2 requires sizeof(void*) == sizeof(long) to be compiled. <<--- */
-# define PTR2NUM(x) (ULL2NUM((unsigned long long)(x)))
-# define NUM2PTR(x) ((void*)(NUM2ULL(x)))
-#endif
-
-#define BOOL2INT(x) ((x == Qtrue)?1:0)
-#define INT2BOOL(x) (x?Qtrue:Qfalse)
-
-typedef void (*freefunc_t)(void*);
+typedef union {
+ void* p;
+ char c;
+ short h;
+ int i;
+ long l;
+ float f;
+ double d;
+ char *s;
+} ANY_TYPE;
struct dl_handle {
- void *ptr;
- int open;
- int enable_close;
+ void *ptr;
+ int open;
+ int enable_close;
};
+struct sym_data {
+ void *func;
+ char *name;
+ char *type;
+ int len;
+};
-struct cfunc_data {
- void *ptr;
- char *name;
- int type;
- ID calltype;
+enum DLPTR_CTYPE {
+ DLPTR_CTYPE_UNKNOWN,
+ DLPTR_CTYPE_STRUCT,
+ DLPTR_CTYPE_UNION
};
-extern ID rbdl_id_cdecl;
-extern ID rbdl_id_stdcall;
-#define CFUNC_CDECL (rbdl_id_cdecl)
-#define CFUNC_STDCALL (rbdl_id_stdcall)
struct ptr_data {
- void *ptr;
- long size;
- freefunc_t free;
+ void *ptr; /* a pointer to the data */
+ freefunc_t free; /* free() */
+ char *stype; /* array of type specifiers */
+ int *ssize; /* size[i] = sizeof(type[i]) > 0 */
+ int slen; /* the number of type specifiers */
+ ID *ids;
+ int ids_num;
+ int ctype; /* DLPTR_CTYPE_UNKNOWN, DLPTR_CTYPE_STRUCT, DLPTR_CTYPE_UNION */
+ long size;
};
-#define RDL_HANDLE(obj) ((struct dl_handle *)(DATA_PTR(obj)))
-#define RCFUNC_DATA(obj) ((struct cfunc_data *)(DATA_PTR(obj)))
-#define RPTR_DATA(obj) ((struct ptr_data *)(DATA_PTR(obj)))
+#define RDLPTR(obj) ((struct ptr_data *)(DATA_PTR(obj)))
+#define RDLSYM(obj) ((struct sym_data *)(DATA_PTR(obj)))
+
+void dlfree(void*);
+void *dlmalloc(size_t);
+void *dlrealloc(void*,size_t);
+char *dlstrdup(const char *);
+size_t dlsizeof(const char *);
+
+void *rb_ary2cary(char t, VALUE ary, long *size);
+
+/*
+void rb_dlmem_delete(void *ptr);
+void rb_dlmem_aset(void *ptr, VALUE obj);
+VALUE rb_dlmem_aref(void *ptr);
+*/
+
+void dlptr_free(struct ptr_data *data);
+void dlptr_init(VALUE val);
-VALUE rb_dlcfunc_new(void (*func)(), int dltype, const char * name, ID calltype);
-int rb_dlcfunc_kind_p(VALUE func);
VALUE rb_dlptr_new(void *ptr, long size, freefunc_t func);
VALUE rb_dlptr_new2(VALUE klass, void *ptr, long size, freefunc_t func);
VALUE rb_dlptr_malloc(long size, freefunc_t func);
+void *rb_dlptr2cptr(VALUE val);
-#endif
+VALUE rb_dlsym_new(void (*func)(), const char *name, const char *type);
+freefunc_t rb_dlsym2csym(VALUE val);
+
+
+#endif /* RUBY_DL_H */
diff --git a/ext/dl/doc/dl.txt b/ext/dl/doc/dl.txt
new file mode 100644
index 0000000000..893bd21d79
--- /dev/null
+++ b/ext/dl/doc/dl.txt
@@ -0,0 +1,266 @@
+=begin
+
+= Ruby/DL
+
+Ruby/DL provides an interface to the dynamic linker such as dlopen() on UNIX
+and LoadLibrary() on Windows.
+
+= Building and Installing
+
+ $ ruby extconf.rb # to create the Makefile
+ $ make # to build the library 'dl.so'
+ $ make libtest.so # to build the C library 'libtest.so' for the test script
+ $ make test # to run the test script
+ $ make install # to install the library
+ $ make clean # to remove the created files without Makefile
+ $ make distclean # to remove the all created files
+
+= Using Ruby/DL
+
+We should usually use DL::Importable module provided by "dl/import.rb".
+It has high-level functions to access library functions. We use
+DL::Importable module to extend a module as follows:
+
+ require "dl/import"
+ module LIBC
+ extend DL::Importable
+ end
+
+Now we can use methods dlload and extern in this module. We load the
+libraries using dlload, and define wrapper methods to library functions
+using extern respectively as follows:
+
+ module LIBC
+ extend DL::Importable
+ dlload "libc.so.6","libm.so.6"
+ extern "int strlen(char*)"
+ end
+ # Note that we should not include the module LIBC from some reason.
+
+We can call the library function strlen() using LIBC.strlen. If the first
+character of given function name is an uppercase, the first character of the
+defined method name becomes lowercase.
+We can also construct memory images of structures and unions using functions
+struct and union which are defined in "dl/struct.rb" as follows:
+
+ require "dl/import"
+ require "dl/struct"
+ module LIBC
+ extend DL::Importable
+ Timeval = struct [ # define timeval structure.
+ "long tv_sec",
+ "long tv_uses",
+ ]
+ end
+ val = LIBC::Timeval.malloc # allocate memory.
+
+Notice that the above example takes LIBC::Timeval.malloc to allocate memory,
+rather than LIBC::Timeval.new. It is because DL::Timeval.new is for wrapping
+an object, PtrData, which has already been created.
+
+We can define a callback using the module function "callback" as follows:
+
+ module Foo
+ extend DL::Importable
+ def my_comp(str1,str2)
+ str1 <=> str2
+ end
+ COMPARE = callback "int my_comp(char*,char*)"
+ end
+
+where Foo::COMPARE is a Symbol object which invokes the method "my_comp".
+
+DL::Importable module is very useful. However, we sometimes encounter a case
+that we must directly use low-level functions such as dlsym(). In such case,
+we would use DL module functions. They are described in next section.
+
+= DL module
+
+Module DL consists of three classes, a few module functions and constants.
+The class Symbol represents the symbol we can call. The class PtrData
+indicates a memory block such as a pointer in C. An object instantiated from
+the class Handle keeps a handle to opened library.
+
+== Constants
+
+* VERSION
+* MAJOR_VERSION
+* MINOR_VERSION
+* PATCH_VERSION
+* RTLD_GLOBAL
+* RTLD_LAZY
+* RTLD_NOW
+* MAX_ARG
+* MAX_CBARG
+* MAX_CBENT
+
+== Functions
+
+* handle = dlopen(lib){|handle| ... }
+ * is quite equal to `Handle.new(lib)'
+
+* sym = set_callback(cbtype, entry){|args| ... }
+* sym = set_callback(cbtype, entry, proc)
+ * makes entry-th pre-defined function to call the proc or given block. the
+ entry-th pre-defined function is specified by cbtype and entry. cbtype is a
+ prototype of the callback. see also the section `Type specifiers' about
+ cbtype.
+
+* sym = get_callback(cbtype, entry)
+ * returns the Proc object which is given by the above function
+ `set_callback'.
+
+* ptr = malloc(size, [free = nil])
+ * allocates the size bytes, and returns the pointer as a PtrData object ptr.
+
+* ptr = strdup(str)
+ * returns a PtrData object ptr which represents the pointer to a new string
+ which is a duplicate of the string str.
+
+* size = sizeof(type)
+ * returns the size of type. `sizeof("C") + sizeof("L")' is not equal to
+ `sizeof("CL")'. the latter is assumed to returns the enough size of the
+ structure `struct foo { char c; long l; }', but the size may not equal to
+ `sizeof(foo)' of C.
+
+== Handle class
+
+* handle = Handle.new(lib){|handle| ... }
+ * opens a library lib and returns a Handle object handle. if a block is
+ given, the handle is automatically closed as the block ends.
+
+* Handle#close
+ * closes the handle opened by the above Handle.new(lib).
+
+* sym = Handle#sym(func, prototype = "0"),
+ sym = Handle#[func, prototype = nil]
+
+ * obtains the pointer to a function called func and returns a Symbol object
+ or a DataPtr object. prototype is a string which consists of type
+ specifiers, it indicates the function's prototype. see also the section
+ `Type specifiers'.
+
+== Symbol class
+
+* sym = Symbol.new(addr, type = nil, name = nil)
+ * creates the Symbol object sym with the type type if type is not nil. addr
+ is the address where the function is allocated. If type is nil, it returns
+ a DataPtr object.
+
+* Symbol::char2type(char)
+ * takes a character char that represents a type and returns the type
+ specifier of the C language.
+
+* str = Symbol#proto()
+ * returns the function prototype.
+
+* str = Symbol#name()
+ * Returns the function name.
+
+* str = Symbol#cproto(),
+ str = Symbol#to_s()
+ * returns the prototype of the C language.
+
+* str = Symbol#inspect()
+ * returns the inspectable string.
+
+* r,rs = Symbol#call(arg1,arg2,...,argN),
+ r,rs = Symbol#[](arg1,arg2,...,argN)
+ * calls the function with parameters arg1, arg2, ..., argN. and the result
+ consists of the return value r and parameters rs. rs is an array.
+
+* ptr = Symbol#to_ptr
+ * returns the corresponding PtrData object ptr.
+
+== PtrData class
+
+* ptr = PtrData.new(addr, [size = 0, free = nil])
+ * returns the PtrData object representing the pointer which indicates the
+ address addr. GC frees the memory using the free function.
+
+* PtrData#free=(sym)
+ * If you specify a symbol object sym, GC frees the memory using the function
+ represented by sym.
+
+* sym = PtrData#free
+ * returns a symbol object sym which is used when GC frees the memory. it
+ usually configured by `PtrData#free=' or `PtrData.new'.
+
+* size = PtrData#size, PtrData#size=(size)
+ * gets and sets allocated size of the memory.
+
+* ary = PtrData#to_a(type, [size])
+ * returns an array of the type which specified with type. type must be one of
+ 'S','P','I','L','D' and 'F'.
+
+* str = PtrData#to_s([len])
+ * returns a string which length is len. if len is omitted, the end of the
+ string is '\0'.
+
+* ptr = PtrData#ptr,+@
+ * returns the pointed value as a PtrData object ptr.
+
+* ptr = PtrData#ref,-@
+ * returns the reference as a PtrData object ptr.
+
+* ptr = PtrData#+
+ * returns the PtrData object
+
+* ptr = PtrData#-
+ * returns the PtrData object
+
+* PtrData#struct!(type, *members)
+ * defines the data type to get access to a structure member with a symbol.
+ (see also PtrData#[])
+
+* PtrData#union!(type, *members)
+ * defines the data type to get access to a union member with a symbol. (see
+ also PtrData#[])
+
+* val = PtrData#[key], PtrData#[key, num = 0]
+ * if the key is a string or symbol, this method returns the value of the
+ structure/union member which has the type defined by PtrData#
+ {struct!,union!}. if the key is a integer value and this object represents
+ the pointer ptr, it returns the value of `(ptr + key).to_s(num)'
+
+* PtrData#[key,num]=val, PtrData#[key]=val
+ * if the key is a string or symbol, this method substitute the value of the
+ structure/union member with val. if the key is a integer value and val is a
+ string, this method copies num bytes of val to the memory area ptr using
+ memcpy(3).
+
+== Type specifiers
+
+the prototype consists of the following type specifiers, first element of
+prototype represents the type of return value, and remaining elements represent
+the type of each argument.
+
+ C : char
+ c : char *
+ H : short
+ h : short *
+ I : int
+ i : int *
+ L : long
+ l : long *
+ F : float
+ f : float *
+ D : double
+ d : double *
+ S : const char *
+ s : char *
+ A : const type[]
+ a : type[] (allocates new memory space)
+ P : void * (same as 'p')
+ p : void * (same as 'P')
+ 0 : void function (this must be a first character of the prototype)
+
+the cbtype consists of type specifiers 0, C, I, H, L, F, D, S and P.
+for example:
+
+ DL.callback('IPP'){|ptr1,ptr2|
+ str1 = ptr1.ptr.to_s
+ str2 = ptr2.ptr.to_s
+ str1 <=> str2
+ }
+=end
diff --git a/ext/dl/extconf.rb b/ext/dl/extconf.rb
index 36babf4143..beb15ab04c 100644
--- a/ext/dl/extconf.rb
+++ b/ext/dl/extconf.rb
@@ -1,29 +1,193 @@
require 'mkmf'
-if( RbConfig::CONFIG['CC'] =~ /gcc/ )
+begin # for the exception SystemExit
+
+$:.unshift File.dirname(__FILE__)
+require 'type'
+
+if( ARGV.include?("--help") )
+ print <<EOF
+ --help print this messages
+ --with-type-char strictly use type 'char'
+ --with-type-short strictly use type 'short'
+ --with-type-float strictly use type 'float'
+ --with-args=<max_arg>
+ --with-callback=<max_callback>
+ --enable-asm use the embedded assembler for passing arguments.
+ (this option is available for i386 machine now.)
+ --enable-dlstack use a stack emulation for constructing function call.
+EOF
+ exit(0)
+end
+
+($CPPFLAGS || $CFLAGS) << " -I."
+
+if (Config::CONFIG['CC'] =~ /gcc/) # from Win32API
$CFLAGS << " -fno-defer-pop -fno-omit-frame-pointer"
end
-$INSTALLFILES = [
- ["dl.h", "$(HDRDIR)"],
-]
+$with_dlstack ||= true
+$with_asm = ! $with_dlstack
+
+$with_type_int = try_cpp(<<EOF)
+#include "config.h"
+#if SIZEOF_INT == SIZEOF_LONG
+#error int not needed
+#endif
+EOF
+
+$with_type_float = try_cpp(<<EOF)
+#include "config.h"
+#if SIZEOF_FLOAT == SIZEOF_DOUBLE
+#error float not needed
+#endif
+EOF
+
+$with_type_voidp = try_cpp(<<EOF)
+#include "config.h"
+#if SIZEOF_VOIDP == SIZEOF_INT || SIZEOF_VOIDP == SIZEOF_LONG
+#error void* not needed
+#endif
+EOF
+
+$with_type_char = DLTYPE[CHAR][:sym]
+$with_type_short = DLTYPE[SHORT][:sym]
+$with_type_long = DLTYPE[LONG][:sym]
+$with_type_double= DLTYPE[DOUBLE][:sym]
+$with_type_int &= DLTYPE[INT][:sym]
+$with_type_float &= DLTYPE[FLOAT][:sym]
+$with_type_voidp &= DLTYPE[VOIDP][:sym]
+
+$with_type_char = enable_config("type-char", $with_type_char)
+$with_type_short = enable_config("type-short", $with_type_short)
+$with_type_float = enable_config("type-float", $with_type_float)
+
+$with_asm = enable_config("asm", $with_asm)
+$with_dlstack = enable_config("dlstack", $with_dlstack)
+
+args = with_config("args")
+max_arg = nil
+if( $with_asm || $with_dlstack )
+ $with_type_char = true
+ $with_type_short = true
+ $with_type_float = true
+ max_arg = 0
+end
+if( args )
+ max_arg = args.to_i
+ if( !max_arg )
+ print("--with-args=<max_arg>\n")
+ exit(1)
+ end
+end
+max_arg ||= 6
+
+max_callback = with_config("callback","10").to_i
+callback_types = DLTYPE.keys.length
+
+
+$dlconfig_h = <<EOF
+#define MAX_ARG #{max_arg}
+EOF
+
+def dlc_define(const)
+ $dlconfig_h << "#if !defined(#{const})\n" +
+ "# define #{const}\n" +
+ "#endif\n"
+end
+
+$dlconfig_h << "#define MAX_CALLBACK #{max_callback}\n"
+$dlconfig_h << "#define CALLBACK_TYPES #{callback_types}\n"
+if( $with_dlstack )
+ $dlconfig_h << "#define USE_DLSTACK\n"
+else
+ if( $with_asm )
+ $dlconfig_h << "#define USE_INLINE_ASM\n"
+ end
+end
+if( $with_type_char )
+ $dlconfig_h << "#define WITH_TYPE_CHAR\n"
+end
+if( $with_type_short )
+ $dlconfig_h << "#define WITH_TYPE_SHORT\n"
+end
+if( $with_type_long )
+ $dlconfig_h << "#define WITH_TYPE_LONG\n"
+end
+if( $with_type_double )
+ $dlconfig_h << "#define WITH_TYPE_DOUBLE\n"
+end
+if( $with_type_float )
+ $dlconfig_h << "#define WITH_TYPE_FLOAT\n"
+end
+if( $with_type_int )
+ $dlconfig_h << "#define WITH_TYPE_INT\n"
+end
+if( $with_type_voidp )
+ $dlconfig_h << "#define WITH_TYPE_VOIDP\n"
+end
+
+if( have_header("windows.h") )
+ have_library("kernel32")
+ have_func("GetLastError", "windows.h")
+ dlc_define("HAVE_WINDOWS_H")
+ have_windows_h = true
+end
-check = true
if( have_header("dlfcn.h") )
+ dlc_define("HAVE_DLFCN_H")
have_library("dl")
- check &&= have_func("dlopen")
- check &&= have_func("dlclose")
- check &&= have_func("dlsym")
- have_func("dlerror")
-elsif( have_header("windows.h") )
- check &&= have_func("LoadLibrary")
- check &&= have_func("FreeLibrary")
- check &&= have_func("GetProcAddress")
+ have_func("dlopen")
+ have_func("dlclose")
+ have_func("dlsym")
+ if( have_func("dlerror") )
+ dlc_define("HAVE_DLERROR")
+ end
+elsif ( have_windows_h )
+ have_func("LoadLibrary")
+ have_func("FreeLibrary")
+ have_func("GetProcAddress")
else
- check = false
+ exit(0)
+end
+
+def File.update(file, str)
+ begin
+ open(file){|f|f.read} == str
+ rescue Errno::ENOENT
+ false
+ end or open(file, "w"){|f|f.print(str)}
end
-if check
- $defs << %[-DRUBY_VERSION=\\"#{RUBY_VERSION}\\"]
- create_makefile("dl")
+File.update("dlconfig.h", <<EOF)
+#ifndef DLCONFIG_H
+#define DLCONFIG_H
+#{$dlconfig_h}
+#endif /* DLCONFIG_H */
+EOF
+
+File.update("dlconfig.rb", <<EOF)
+MAX_ARG = #{max_arg}
+MAX_CALLBACK = #{max_callback}
+CALLBACK_TYPES = #{callback_types}
+DLTYPE[CHAR][:sym] = #{$with_type_char}
+DLTYPE[SHORT][:sym] = #{$with_type_short}
+DLTYPE[INT][:sym] = #{$with_type_int}
+DLTYPE[LONG][:sym] = #{$with_type_long}
+DLTYPE[FLOAT][:sym] = #{$with_type_float}
+DLTYPE[DOUBLE][:sym]= #{$with_type_double}
+DLTYPE[VOIDP][:sym] = #{$with_type_voidp}
+EOF
+
+$INSTALLFILES = [
+ ["./dlconfig.h", "$(archdir)$(target_prefix)", "."],
+ ["dl.h", "$(archdir)$(target_prefix)", ""],
+]
+$cleanfiles = %w[test/test.o]
+$distcleanfiles = %w[call.func callback.func cbtable.func dlconfig.rb
+./dlconfig.h test/libtest.so test/*~ *~ mkmf.log]
+
+create_makefile('dl')
+rescue SystemExit
+ # do nothing
end
diff --git a/ext/dl/h2rb b/ext/dl/h2rb
new file mode 100644
index 0000000000..00fbd60c82
--- /dev/null
+++ b/ext/dl/h2rb
@@ -0,0 +1,500 @@
+#!/usr/bin/env ruby
+# -*- ruby -*-
+# $Id$
+
+require 'mkmf'
+require 'ftools'
+
+$recursive = false
+$force = false
+$conly = true
+$inc_path = []
+$infilename= nil
+$insert_require = true
+
+def valid_ruby_code?(code)
+ begin
+ eval("BEGIN {return true}; #{code}")
+ rescue SyntaxError
+ return false
+ end
+ return false
+end
+
+def print_usage
+ print <<EOF
+h2rb [-r] [-I <path>] [-d] [<filename>]
+EOF
+end
+
+while( ARGV[0] )
+ case( ARGV[0] )
+ when "-r"
+ ARGV.shift
+ $recursive = true
+ when "-R"
+ ARGV.shift
+ $recursive = false
+ when "-l"
+ ARGV.shift
+ $insert_require = true
+ when "-L"
+ ARGV.shift
+ $insert_require = false
+ when "-c"
+ ARGV.shift
+ $conly = true
+ when "-C"
+ ARGV.shift
+ $conly = false
+ when "-f"
+ ARGV.shift
+ $force = true
+ when "-F"
+ ARGV.shift
+ $force = false
+ when "-I"
+ ARGV.shift
+ $inc_path << ARGV.shift
+ when "-d"
+ ARGV.shift
+ $DEBUG = true
+ when "-h","--help"
+ print_usage()
+ exit 0
+ when /-.*/
+ $stderr.print("unknown option '#{ARGV[0]}'.\n")
+ print_usage()
+ exit 0
+ else
+ $infilename = ARGV.shift
+ end
+end
+
+$inc_dir = File.join(CONFIG["prefix"], "lib", "ruby",
+ CONFIG["MAJOR"] + "." + CONFIG["MINOR"],
+ "dl")
+
+class H2RBError < StandardError; end
+
+
+class H2RB
+ def initialize(inc_dir = nil, inc_path = nil, insert_require = nil)
+ @inc_path = inc_path || []
+ @inc_dir = inc_dir || '.'
+ @indent = 0
+ @parsed_files = []
+ @insert_require = insert_require || false
+ end
+
+ def find_path(file)
+ if( ! file )
+ return nil
+ end
+ if( File.exist?(file) )
+ if( file[0] == ?/ )
+ return file
+ else
+ return file
+ end
+ end
+ @inc_path.each{|path|
+ full = File.join(path, file)
+ if( File.exist?(full) )
+ return full
+ end
+ }
+ return nil
+ end
+
+ def strip_comment(line)
+ if( @commented )
+ if( e = line.index("*/") )
+ line[0..(e+1)] = ""
+ @commented = false
+ else
+ line = ""
+ end
+ else
+ if( s = line.index("/*") )
+ if( e = line.index("*/") )
+ line[s..(e+1)] = ""
+ else
+ line[s..-1] = ""
+ @commented = true
+ end
+ elsif( s = line.index("//") )
+ line[s..(-1)] = ""
+ end
+ end
+
+ line.gsub!(/\s+$/,"")
+ return line
+ end
+
+ def up_indent
+ @indent += 1
+ end
+
+ def down_indent
+ @indent -= 1
+ if( @indent < 0 )
+ raise
+ end
+ end
+
+ def indent
+ " " * @indent
+ end
+
+ def rescue_begin
+ line = "#{indent}begin"
+ up_indent
+ return line
+ end
+
+ def rescue_nameerror
+ down_indent
+ line = [
+ "#{indent}rescue NameError => e",
+ "#{indent} raise e if( $DEBUG )",
+ "#{indent}end"].join($/)
+ return line
+ end
+
+ def parse_enum(line)
+ if( line =~ /enum\s+(\S+\s+)?\{(.+)\}/ )
+ enum_name = $1
+ enum_block = $2
+ if( enum_name )
+ line = "#{indent}# -- enum #{enum_name}\n"
+ else
+ line = "#{indent}# -- enum\n"
+ end
+ enums = enum_block.split(/,/).collect{|e| e.strip}
+ i = 0
+ enums.each{|elem|
+ var,val = elem.split(/=/).collect{|e| e.strip}
+ if( val )
+ i = val.to_i
+ end
+ line += "#{indent}#{var} = #{i.to_s}\n"
+ i += 1
+ }
+ line += "#{indent}# -- end of enum"
+ return line
+ else
+ return nil
+ end
+ end
+
+ def parse_define(line)
+ case line
+ when /^#\s*define\s+(\S+)\(\)/
+ line = nil
+ when /^#\s*define\s+(\S+)\((.+)\)\s+(.+)$/
+ if( @conly )
+ line = nil
+ else
+ defname = $1
+ defargs = $2
+ defval = $3
+ if( !valid_ruby_code?(defval) )
+ defval = "nil # #{defval}"
+ end
+ if( defname[0,1] =~ /^[A-Z]$/ )
+ line = "#{indent}#{defname} = proc{|#{defargs}| #{defval}}"
+ else
+ line = [
+ "#{indent}def #{defname}(#{defargs})",
+ "#{indent} #{defval}",
+ "#{indent}end"
+ ].join("\n")
+ end
+ end
+ when /^#\s*define\s+(\S+)\((.+)\)$/
+ if( @conly )
+ line = nil
+ else
+ defname = $1
+ defargs = $2
+ defval = nil
+ if( !valid_ruby_code?(defval) )
+ defval = "nil # #{defval}"
+ end
+ if( defname[0,1] =~ /^[A-Z]$/ )
+ line = "#{indent}#{defname} = proc{|#{defargs}| #{defval}}"
+ else
+ line = [
+ "#{indent}def #{defname}(#{defargs})",
+ "#{indent} #{defval}",
+ "#{indent}end"
+ ].join("\n")
+ end
+ end
+ when /^#\s*define\s+(\S+)\s+(.+)$/
+ defname = $1
+ defval = $2
+ if( !valid_ruby_code?(defval) )
+ defval = "nil # #{defval}"
+ end
+ line = [rescue_begin, "#{indent}#{defname} = #{defval}", rescue_nameerror].join($/)
+ when /^#\s*define\s+(\S+)$/
+ defname = $1
+ line = "#{indent}#{defname} = nil"
+ else
+ line = nil
+ end
+ return line
+ end
+
+ def parse_undef(line)
+ case line
+ when /^#\s*undef\s+([A-Z]\S+)$/
+ defname = $1
+ line = "#{indent}remove_const(:#{defname})"
+ when /^#\s*undef\s+(\S+)$/
+ defname = $1
+ line = "#{indent}#{defname} = nil"
+ else
+ line = nil
+ end
+ return line
+ end
+
+ def parse_ifdef(line)
+ case line
+ when /^#\s*ifdef\s+(\S+)$/
+ defname = $1
+ line = [
+ rescue_begin,
+ "#{indent}if( defined?(#{defname}) && ! #{defname}.nil? )"].join($/)
+ else
+ line = nil
+ end
+ return line
+ end
+
+ def parse_ifndef(line)
+ case line
+ when /^#\s*ifndef\s+(\S+)$/
+ defname = $1
+ line = [
+ rescue_begin,
+ "#{indent}if( ! defined?(#{defname}) || #{defname}.nil? )"].join($/)
+ else
+ line = nil
+ end
+ return line
+ end
+
+ def parse_if(line)
+ case line
+ when /^#\s*if\s+(.+)$/
+ cond = $1
+ cond.gsub!(/defined(.+)/){ "defined?(#{$1}) && ! #{$1}.nil?" }
+ if( valid_ruby_code?(cond) )
+ line = "#{indent}if( #{cond} )"
+ else
+ line = "#{indent}if( false ) # #{cond}"
+ end
+ line = [rescue_begin, line].join($/)
+ else
+ line = nil
+ end
+ return line
+ end
+
+ def parse_elif(line)
+ case line
+ when /^#\s*elif\s+(.+)$/
+ cond = $1
+ cond.gsub!("defined","defined?")
+ line = "#{indent}elsif( #{cond} )"
+ else
+ line = nil
+ end
+ return line
+ end
+
+ def parse_else(line)
+ case line
+ when /^#\s*else\s*/
+ line = "#{indent}else"
+ else
+ line = nil
+ end
+ return line
+ end
+
+ def parse_endif(line)
+ case line
+ when /^#\s*endif\s*$/
+ line = ["#{indent}end", rescue_nameerror].join($/)
+ else
+ line = nil
+ end
+ return line
+ end
+
+ def parse_include(line)
+ if( ! @insert_require )
+ return nil
+ end
+
+ file = nil
+ case line
+ when /^#\s*include "(.+)"$/
+ file = $1
+ line = "#{indent}require '#{file}'"
+ when /^#\s*include \<(.+)\>$/
+ file = $1
+ line = "#{indent}require '#{file}'"
+ else
+ line = nil
+ end
+ if( @recursive && file && (!@parsed_files.include?(file)) )
+ parse(file, @recursive, @force, @conly)
+ end
+ return line
+ end
+
+
+ def open_files(infilename)
+ if( ! infilename )
+ return [$stdin, $stdout]
+ end
+
+ old_infilename = infilename
+ infilename = find_path(infilename)
+ if( ! infilename )
+ $stderr.print("'#{old_infilename}' was not found.\n")
+ return [nil,nil]
+ end
+
+ if( infilename )
+ if( infilename[0,1] == '/' )
+ outfilename = File.join(@inc_dir, infilename[1..-1] + ".rb")
+ else
+ outfilename = infilename + ".rb"
+ end
+ File.mkpath(File.dirname(outfilename))
+ else
+ outfilename = nil
+ end
+
+ if( infilename )
+ fin = File.open(infilename,"r")
+ else
+ fin = $stdin
+ end
+ if( outfilename )
+ if( File.exist?(outfilename) && (!@force) )
+ $stderr.print("'#{outfilename}' have already existed.\n")
+ return [fin, nil]
+ end
+ fout = File.open(outfilename,"w")
+ else
+ fout = $stdout
+ end
+
+ $stderr.print("#{infilename} -> #{outfilename}\n")
+ if( fout )
+ dir = File.dirname(outfilename)
+ if( dir[0,1] != "." && dir != "" )
+ fout.print("if( ! $LOAD_PATH.include?('#{dir}') )\n",
+ " $LOAD_PATH.push('#{dir}')\n",
+ "end\n")
+ end
+ end
+ return [fin,fout]
+ end
+
+ def parse(infilename = nil, recursive = false, force = false, conly = false)
+ @commented = false
+ @recursive = recursive
+ @force = force
+ @conly = conly
+ @parsed_files << infilename
+
+ fin,fout = open_files(infilename)
+ if( !fin )
+ return
+ end
+
+ begin
+ line_number = 0
+ pre_line = nil
+ fin.each_line{|line|
+ line_number += 1
+ line.chop!
+ if( $DEBUG )
+ $stderr.print("#{line_number}:(#{@indent}):", line, "\n")
+ end
+
+ if( pre_line )
+ line = pre_line + line
+ pre_line = nil
+ end
+
+ if( line[-1,1] == "\\" )
+ pre_line = line[0..-2]
+ next
+ end
+
+ if( eidx = line.index("enum ") )
+ pre_line = line[eidx .. -1]
+ if( i = line.index("{") && j = line.index("}") )
+ line = line[0..j]
+ pre_line = nil
+ else
+ next
+ end
+ end
+
+ line = strip_comment(line)
+ case line
+ when /^enum\s/
+ line = parse_enum(line)
+ when /^#\s*define\s/
+ line = parse_define(line)
+ when /^#\s*undef\s/
+ line = parse_undef(line)
+ when /^#\s*ifdef\s/
+ line = parse_ifdef(line)
+ up_indent
+ when /^#\s*ifndef\s/
+ line = parse_ifndef(line)
+ up_indent
+ when /^#\s*if\s/
+ line = parse_if(line)
+ up_indent
+ when /^#\s*elif\s/
+ down_indent
+ line = parse_elif(line)
+ up_indent
+ when /^#\s*else/
+ down_indent
+ line = parse_else(line)
+ up_indent
+ when /^#\s*endif/
+ down_indent
+ line = parse_endif(line)
+ when /^#\s*include\s/
+ line = parse_include(line)
+ else
+ line = nil
+ end
+ if( line && fout )
+ fout.print(line, " # #{line_number}",$/)
+ end
+ }
+ ensure
+ fin.close if fin
+ fout.close if fout
+ end
+ end
+end
+
+h2rb = H2RB.new($inc_dir, $inc_path, $insert_require)
+h2rb.parse($infilename, $recursive, $force, $conly)
diff --git a/ext/dl/handle.c b/ext/dl/handle.c
index 14a5299223..69d47caac0 100644
--- a/ext/dl/handle.c
+++ b/ext/dl/handle.c
@@ -7,284 +7,209 @@
VALUE rb_cDLHandle;
-#ifdef HAVE_WINDOWS_H
-# ifndef _WIN32_WCE
-static void *
-w32_coredll(void)
-{
- MEMORY_BASIC_INFORMATION m;
- memset(&m, 0, sizeof(m));
- if( !VirtualQuery(_errno, &m, sizeof(m)) ) return NULL;
- return m.AllocationBase;
-}
-# endif
-
-static int
-w32_dlclose(void *ptr)
-{
-# ifndef _WIN32_WCE
- if( ptr == w32_coredll() ) return 0;
-# endif
- if( FreeLibrary((HMODULE)ptr) ) return 0;
- return errno = rb_w32_map_errno(GetLastError());
-}
-#define dlclose(ptr) w32_dlclose(ptr)
-#endif
-
void
dlhandle_free(struct dl_handle *dlhandle)
{
- if( dlhandle->ptr && dlhandle->open && dlhandle->enable_close ){
- dlclose(dlhandle->ptr);
- }
+ if (dlhandle->ptr && dlhandle->open && dlhandle->enable_close) {
+ dlclose(dlhandle->ptr);
+ }
}
VALUE
rb_dlhandle_close(VALUE self)
{
- struct dl_handle *dlhandle;
+ struct dl_handle *dlhandle;
- Data_Get_Struct(self, struct dl_handle, dlhandle);
- dlhandle->open = 0;
- return INT2NUM(dlclose(dlhandle->ptr));
+ Data_Get_Struct(self, struct dl_handle, dlhandle);
+ dlhandle->open = 0;
+ return INT2NUM(dlclose(dlhandle->ptr));
}
VALUE
rb_dlhandle_s_allocate(VALUE klass)
{
- VALUE obj;
- struct dl_handle *dlhandle;
-
- obj = Data_Make_Struct(rb_cDLHandle, struct dl_handle, 0,
- dlhandle_free, dlhandle);
- dlhandle->ptr = 0;
- dlhandle->open = 0;
- dlhandle->enable_close = 0;
-
- return obj;
-}
+ VALUE obj;
+ struct dl_handle *dlhandle;
-static VALUE
-predefined_dlhandle(void *handle)
-{
- VALUE obj = rb_dlhandle_s_allocate(rb_cDLHandle);
- struct dl_handle *dlhandle = DATA_PTR(obj);
+ obj = Data_Make_Struct(rb_cDLHandle, struct dl_handle, 0,
+ dlhandle_free, dlhandle);
+ dlhandle->ptr = 0;
+ dlhandle->open = 0;
+ dlhandle->enable_close = 0;
- dlhandle->ptr = handle;
- dlhandle->open = 1;
- OBJ_FREEZE(obj);
- return obj;
+ return obj;
}
VALUE
rb_dlhandle_initialize(int argc, VALUE argv[], VALUE self)
{
- void *ptr;
- struct dl_handle *dlhandle;
- VALUE lib, flag;
- char *clib;
- int cflag;
- const char *err;
-
- switch( rb_scan_args(argc, argv, "02", &lib, &flag) ){
- case 0:
- clib = NULL;
- cflag = RTLD_LAZY | RTLD_GLOBAL;
- break;
- case 1:
- clib = NIL_P(lib) ? NULL : StringValuePtr(lib);
- cflag = RTLD_LAZY | RTLD_GLOBAL;
- break;
- case 2:
- clib = NIL_P(lib) ? NULL : StringValuePtr(lib);
- cflag = NUM2INT(flag);
- break;
- default:
- rb_bug("rb_dlhandle_new");
- }
-
-#if defined(HAVE_WINDOWS_H)
- if( !clib ){
- HANDLE rb_libruby_handle(void);
- ptr = rb_libruby_handle();
- }
- else if( STRCASECMP(clib, "libc") == 0
-# ifdef RUBY_COREDLL
- || STRCASECMP(clib, RUBY_COREDLL) == 0
- || STRCASECMP(clib, RUBY_COREDLL".dll") == 0
-# endif
- ){
-# ifdef _WIN32_WCE
- ptr = dlopen("coredll.dll", cflag);
-# else
- ptr = w32_coredll();
-# endif
- }
- else
-#endif
- ptr = dlopen(clib, cflag);
+ void *ptr;
+ struct dl_handle *dlhandle;
+ VALUE lib, flag;
+ char *clib;
+ int cflag;
+ const char *err;
+
+ switch (rb_scan_args(argc, argv, "11", &lib, &flag)) {
+ case 1:
+ clib = NIL_P(lib) ? NULL : StringValuePtr(lib);
+ cflag = RTLD_LAZY | RTLD_GLOBAL;
+ break;
+ case 2:
+ clib = NIL_P(lib) ? NULL : StringValuePtr(lib);
+ cflag = NUM2INT(flag);
+ break;
+ default:
+ rb_bug("rb_dlhandle_new");
+ }
+
+ ptr = dlopen(clib, cflag);
#if defined(HAVE_DLERROR)
- if( !ptr && (err = dlerror()) ){
- rb_raise(rb_eDLError, "%s", err);
- }
+ if (!ptr && (err = dlerror())) {
+ rb_raise(rb_eRuntimeError, "%s", err);
+ }
#else
- if( !ptr ){
- err = dlerror();
- rb_raise(rb_eDLError, "%s", err);
- }
+ if (!ptr) {
+ err = dlerror();
+ rb_raise(rb_eRuntimeError, "%s", err);
+ }
#endif
- Data_Get_Struct(self, struct dl_handle, dlhandle);
- if( dlhandle->ptr && dlhandle->open && dlhandle->enable_close ){
- dlclose(dlhandle->ptr);
- }
- dlhandle->ptr = ptr;
- dlhandle->open = 1;
- dlhandle->enable_close = 0;
-
- if( rb_block_given_p() ){
- rb_ensure(rb_yield, self, rb_dlhandle_close, self);
- }
-
- return Qnil;
+ Data_Get_Struct(self, struct dl_handle, dlhandle);
+ if (dlhandle->ptr && dlhandle->open && dlhandle->enable_close) {
+ dlclose(dlhandle->ptr);
+ }
+ dlhandle->ptr = ptr;
+ dlhandle->open = 1;
+ dlhandle->enable_close = 0;
+
+ if (rb_block_given_p()) {
+ rb_ensure(rb_yield, self, rb_dlhandle_close, self);
+ }
+
+ return Qnil;
}
VALUE
rb_dlhandle_enable_close(VALUE self)
{
- struct dl_handle *dlhandle;
+ struct dl_handle *dlhandle;
- Data_Get_Struct(self, struct dl_handle, dlhandle);
- dlhandle->enable_close = 1;
- return Qnil;
+ Data_Get_Struct(self, struct dl_handle, dlhandle);
+ dlhandle->enable_close = 1;
+ return Qnil;
}
VALUE
rb_dlhandle_disable_close(VALUE self)
{
- struct dl_handle *dlhandle;
+ struct dl_handle *dlhandle;
- Data_Get_Struct(self, struct dl_handle, dlhandle);
- dlhandle->enable_close = 0;
- return Qnil;
+ Data_Get_Struct(self, struct dl_handle, dlhandle);
+ dlhandle->enable_close = 0;
+ return Qnil;
}
VALUE
rb_dlhandle_to_i(VALUE self)
{
- struct dl_handle *dlhandle;
+ struct dl_handle *dlhandle;
- Data_Get_Struct(self, struct dl_handle, dlhandle);
- return PTR2NUM(dlhandle);
+ Data_Get_Struct(self, struct dl_handle, dlhandle);
+ return DLLONG2NUM(dlhandle);
}
-static VALUE dlhandle_sym(void *handle, const char *symbol);
-
VALUE
-rb_dlhandle_sym(VALUE self, VALUE sym)
+rb_dlhandle_to_ptr(VALUE self)
{
- struct dl_handle *dlhandle;
- const char *name;
-
- rb_secure(2);
-
- name = StringValuePtr(sym);
+ struct dl_handle *dlhandle;
- Data_Get_Struct(self, struct dl_handle, dlhandle);
- if( ! dlhandle->open ){
- rb_raise(rb_eDLError, "closed handle");
- }
-
- return dlhandle_sym(dlhandle->ptr, StringValueCStr(sym));
+ Data_Get_Struct(self, struct dl_handle, dlhandle);
+ return rb_dlptr_new(dlhandle, sizeof(dlhandle), 0);
}
-#ifndef RTLD_NEXT
-#define RTLD_NEXT NULL
-#endif
-#ifndef RTLD_DEFAULT
-#define RTLD_DEFAULT NULL
-#endif
-
VALUE
-rb_dlhandle_s_sym(VALUE self, VALUE sym)
+rb_dlhandle_sym(int argc, VALUE argv[], VALUE self)
{
- rb_secure(2);
- return dlhandle_sym(RTLD_NEXT, StringValueCStr(sym));
-}
+ VALUE sym, type;
+ void (*func)();
+ VALUE val;
+ struct dl_handle *dlhandle;
+ void *handle;
+ const char *name, *stype;
+ const char *err;
+
+ rb_secure(2);
+ if (rb_scan_args(argc, argv, "11", &sym, &type) == 2) {
+ SafeStringValue(type);
+ stype = StringValuePtr(type);
+ }
+ else{
+ stype = NULL;
+ }
+
+ if (sym == Qnil) {
+#if defined(RTLD_NEXT)
+ name = RTLD_NEXT;
+#else
+ name = NULL;
+#endif
+ }
+ else{
+ SafeStringValue(sym);
+ name = StringValuePtr(sym);
+ }
-static VALUE
-dlhandle_sym(void *handle, const char *name)
-{
+ Data_Get_Struct(self, struct dl_handle, dlhandle);
+ if (!dlhandle->open) {
+ rb_raise(rb_eRuntimeError, "closed handle");
+ }
+ handle = dlhandle->ptr;
+
+ func = dlsym(handle, name);
#if defined(HAVE_DLERROR)
- const char *err;
-# define CHECK_DLERROR if( err = dlerror() ){ func = 0; }
+ if (!func && (err = dlerror()))
#else
-# define CHECK_DLERROR
+ if (!func)
#endif
- void (*func)() = dlsym(handle, name);
-
- CHECK_DLERROR;
-#if defined(FUNC_STDCALL)
- if( !func ){
- int i;
- int len = strlen(name);
- char *name_n;
-#if defined(__CYGWIN__) || defined(_WIN32) || defined(__MINGW32__)
- {
- char *name_a = (char*)xmalloc(len+2);
- strcpy(name_a, name);
- name_n = name_a;
- name_a[len] = 'A';
- name_a[len+1] = '\0';
- func = dlsym(handle, name_a);
- CHECK_DLERROR;
- if( func ) goto found;
- name_n = xrealloc(name_a, len+6);
- }
+ {
+#if defined(__CYGWIN__) || defined(WIN32) || defined(__MINGW32__)
+ {
+ int len = strlen(name);
+ char *name_a = (char*)dlmalloc(len+2);
+ strcpy(name_a, name);
+ name_a[len] = 'A';
+ name_a[len+1] = '\0';
+ func = dlsym(handle, name_a);
+ dlfree(name_a);
+#if defined(HAVE_DLERROR)
+ if (!func && (err = dlerror()))
#else
- name_n = (char*)xmalloc(len+6);
+ if (!func)
#endif
- memcpy(name_n, name, len);
- name_n[len++] = '@';
- for( i = 0; i < 256; i += 4 ){
- sprintf(name_n + len, "%d", i);
- func = dlsym(handle, name_n);
- CHECK_DLERROR;
- if( func ) break;
- }
- if( func ) goto found;
- name_n[len-1] = 'A';
- name_n[len++] = '@';
- for( i = 0; i < 256; i += 4 ){
- sprintf(name_n + len, "%d", i);
- func = dlsym(handle, name_n);
- CHECK_DLERROR;
- if( func ) break;
- }
- found:
- xfree(name_n);
+ {
+ rb_raise(rb_eRuntimeError, "unknown symbol \"%sA\"", name);
+ }
}
+#else
+ rb_raise(rb_eRuntimeError, "unknown symbol \"%s\"", name);
#endif
- if( !func ){
- rb_raise(rb_eDLError, "unknown symbol \"%s\"", name);
- }
+ }
+ val = rb_dlsym_new(func, name, stype);
- return PTR2NUM(func);
+ return val;
}
void
-Init_dlhandle(void)
+Init_dlhandle()
{
- rb_cDLHandle = rb_define_class_under(rb_mDL, "Handle", rb_cObject);
- rb_define_alloc_func(rb_cDLHandle, rb_dlhandle_s_allocate);
- rb_define_singleton_method(rb_cDLHandle, "sym", rb_dlhandle_s_sym, 1);
- rb_define_singleton_method(rb_cDLHandle, "[]", rb_dlhandle_s_sym, 1);
- rb_define_const(rb_cDLHandle, "NEXT", predefined_dlhandle(RTLD_NEXT));
- rb_define_const(rb_cDLHandle, "DEFAULT", predefined_dlhandle(RTLD_DEFAULT));
- rb_define_method(rb_cDLHandle, "initialize", rb_dlhandle_initialize, -1);
- rb_define_method(rb_cDLHandle, "to_i", rb_dlhandle_to_i, 0);
- rb_define_method(rb_cDLHandle, "close", rb_dlhandle_close, 0);
- rb_define_method(rb_cDLHandle, "sym", rb_dlhandle_sym, 1);
- rb_define_method(rb_cDLHandle, "[]", rb_dlhandle_sym, 1);
- rb_define_method(rb_cDLHandle, "disable_close", rb_dlhandle_disable_close, 0);
- rb_define_method(rb_cDLHandle, "enable_close", rb_dlhandle_enable_close, 0);
+ rb_cDLHandle = rb_define_class_under(rb_mDL, "Handle", rb_cObject);
+ rb_define_alloc_func(rb_cDLHandle, rb_dlhandle_s_allocate);
+ rb_define_method(rb_cDLHandle, "initialize", rb_dlhandle_initialize, -1);
+ rb_define_method(rb_cDLHandle, "to_i", rb_dlhandle_to_i, 0);
+ rb_define_method(rb_cDLHandle, "to_ptr", rb_dlhandle_to_ptr, 0);
+ rb_define_method(rb_cDLHandle, "close", rb_dlhandle_close, 0);
+ rb_define_method(rb_cDLHandle, "sym", rb_dlhandle_sym, -1);
+ rb_define_method(rb_cDLHandle, "[]", rb_dlhandle_sym, -1);
+ rb_define_method(rb_cDLHandle, "disable_close", rb_dlhandle_disable_close, 0);
+ rb_define_method(rb_cDLHandle, "enable_close", rb_dlhandle_enable_close, 0);
}
diff --git a/ext/dl/install.rb b/ext/dl/install.rb
new file mode 100644
index 0000000000..69b1834301
--- /dev/null
+++ b/ext/dl/install.rb
@@ -0,0 +1,49 @@
+require 'mkmf'
+require 'ftools'
+
+SO_LIBS = ["dl.so"]
+
+$ruby_version = CONFIG['MAJOR'] + "." + CONFIG['MINOR']
+$prefix = CONFIG['prefix']
+$libdir = File.join($prefix,'lib')
+$rubylibdir = File.join($libdir, 'ruby', $ruby_version)
+$arch = CONFIG['arch']
+$archdir = File.join($rubylibdir, $arch)
+
+def find(dir, match = /./)
+ Dir.chdir(dir)
+ files = []
+ Dir.new(".").each{|file|
+ if( file != "." && file != ".." )
+ case File.ftype(file)
+ when "file"
+ if( file =~ match )
+ files.push(File.join(dir,file))
+ end
+ when "directory"
+ files += find(file, match).collect{|f| File.join(dir,f)}
+ end
+ end
+ }
+ Dir.chdir("..")
+ return files
+end
+
+def install()
+ rb_files = find(File.join(".","lib"), /.rb$/)
+
+ SO_LIBS.each{|f|
+ File.makedirs($rubylibdir, "#{$archdir}")
+ File.install(f, File.join($archdir,f), 0555, true)
+ }
+
+ rb_files.each{|f|
+ origfile = f
+ instfile = File.join($rubylibdir, origfile.sub("./lib/",""))
+ instdir = File.dirname(instfile)
+ File.makedirs(instdir)
+ File.install(origfile, instfile, 0644, true)
+ }
+end
+
+install()
diff --git a/ext/dl/lib/dl/callback.rb b/ext/dl/lib/dl/callback.rb
deleted file mode 100644
index c8daaf6322..0000000000
--- a/ext/dl/lib/dl/callback.rb
+++ /dev/null
@@ -1,69 +0,0 @@
-require 'dl'
-require 'thread'
-
-module DL
- SEM = Mutex.new
-
- def set_callback_internal(proc_entry, addr_entry, argc, ty, &cbp)
- if( argc < 0 )
- raise(ArgumentError, "arity should not be less than 0.")
- end
- addr = nil
- SEM.synchronize{
- ary = proc_entry[ty]
- (0...MAX_CALLBACK).each{|n|
- idx = (n * DLSTACK_SIZE) + argc
- if( ary[idx].nil? )
- ary[idx] = cbp
- addr = addr_entry[ty][idx]
- break
- end
- }
- }
- addr
- end
-
- def set_cdecl_callback(ty, argc, &cbp)
- set_callback_internal(CdeclCallbackProcs, CdeclCallbackAddrs, argc, ty, &cbp)
- end
-
- def set_stdcall_callback(ty, argc, &cbp)
- set_callback_internal(StdcallCallbackProcs, StdcallCallbackAddrs, argc, ty, &cbp)
- end
-
- def remove_callback_internal(proc_entry, addr_entry, addr, ctype = nil)
- index = nil
- if( ctype )
- addr_entry[ctype].each_with_index{|xaddr, idx|
- if( xaddr == addr )
- index = idx
- end
- }
- else
- addr_entry.each{|ty,entry|
- entry.each_with_index{|xaddr, idx|
- if( xaddr == addr )
- index = idx
- end
- }
- }
- end
- if( index and proc_entry[ctype][index] )
- proc_entry[ctype][index] = nil
- return true
- else
- return false
- end
- end
-
- def remove_cdecl_callback(addr, ctype = nil)
- remove_callback_internal(CdeclCallbackProcs, CdeclCallbackAddrs, addr, ctype)
- end
-
- def remove_stdcall_callback(addr, ctype = nil)
- remove_callback_internal(StdcallCallbackProcs, StdcallCallbackAddrs, addr, ctype)
- end
-
- alias set_callback set_cdecl_callback
- alias remove_callback remove_cdecl_callback
-end
diff --git a/ext/dl/lib/dl/cparser.rb b/ext/dl/lib/dl/cparser.rb
deleted file mode 100644
index 2e78da5ad6..0000000000
--- a/ext/dl/lib/dl/cparser.rb
+++ /dev/null
@@ -1,109 +0,0 @@
-module DL
- module CParser
- def parse_struct_signature(signature, tymap=nil)
- if( signature.is_a?(String) )
- signature = signature.split(/\s*,\s*/)
- end
- mems = []
- tys = []
- signature.each{|msig|
- tks = msig.split(/\s+(\*)?/)
- ty = tks[0..-2].join(" ")
- member = tks[-1]
-
- case ty
- when /\[(\d+)\]/
- n = $1.to_i
- ty.gsub!(/\s*\[\d+\]/,"")
- ty = [ty, n]
- when /\[\]/
- ty.gsub!(/\s*\[\]/, "*")
- end
-
- case member
- when /\[(\d+)\]/
- ty = [ty, $1.to_i]
- member.gsub!(/\s*\[\d+\]/,"")
- when /\[\]/
- ty = ty + "*"
- member.gsub!(/\s*\[\]/, "")
- end
-
- mems.push(member)
- tys.push(parse_ctype(ty,tymap))
- }
- return tys, mems
- end
-
- def parse_signature(signature, tymap=nil)
- tymap ||= {}
- signature = signature.gsub(/\s+/, " ").strip
- case signature
- when /^([\d\w@\*_\s]+)\(([\d\w\*_\s\,\[\]]*)\)$/
- ret = $1
- (args = $2).strip!
- ret = ret.split(/\s+/)
- args = args.split(/\s*,\s*/)
- func = ret.pop
- if( func =~ /^\*/ )
- func.gsub!(/^\*+/,"")
- ret.push("*")
- end
- ret = ret.join(" ")
- return [func, parse_ctype(ret, tymap), args.collect{|arg| parse_ctype(arg, tymap)}]
- else
- raise(RuntimeError,"can't parse the function prototype: #{signature}")
- end
- end
-
- def parse_ctype(ty, tymap=nil)
- tymap ||= {}
- case ty
- when Array
- return [parse_ctype(ty[0], tymap), ty[1]]
- when "void"
- return TYPE_VOID
- when "char"
- return TYPE_CHAR
- when "unsigned char"
- return -TYPE_CHAR
- when "short"
- return TYPE_SHORT
- when "unsigned short"
- return -TYPE_SHORT
- when "int"
- return TYPE_INT
- when "unsigned int"
- return -TYPE_INT
- when "long"
- return TYPE_LONG
- when "unsigned long"
- return -TYPE_LONG
- when "long long"
- if( defined?(TYPE_LONG_LONG) )
- return TYPE_LONG_LONG
- else
- raise(RuntimeError, "unsupported type: #{ty}")
- end
- when "unsigned long long"
- if( defined?(TYPE_LONG_LONG) )
- return -TYPE_LONG_LONG
- else
- raise(RuntimeError, "unsupported type: #{ty}")
- end
- when "float"
- return TYPE_FLOAT
- when "double"
- return TYPE_DOUBLE
- when /\*/, /\[\s*\]/
- return TYPE_VOIDP
- else
- if( tymap[ty] )
- return parse_ctype(tymap[ty], tymap)
- else
- raise(DLError, "unknown type: #{ty}")
- end
- end
- end
- end
-end
diff --git a/ext/dl/lib/dl/func.rb b/ext/dl/lib/dl/func.rb
deleted file mode 100644
index 7a8b62e325..0000000000
--- a/ext/dl/lib/dl/func.rb
+++ /dev/null
@@ -1,151 +0,0 @@
-require 'dl'
-require 'dl/callback'
-require 'dl/stack'
-require 'dl/value'
-require 'thread'
-
-module DL
- class Function
- include DL
- include ValueUtil
-
- def initialize(cfunc, argtypes, &proc)
- @cfunc = cfunc
- @stack = Stack.new(argtypes.collect{|ty| ty.abs})
- if( @cfunc.ctype < 0 )
- @cfunc.ctype = @cfunc.ctype.abs
- @unsigned = true
- else
- @unsigned = false
- end
- if( proc )
- bind(&proc)
- end
- end
-
- def to_i()
- @cfunc.to_i
- end
-
- def name
- @cfunc.name
- end
-
- def call(*args, &block)
- funcs = []
- args = wrap_args(args, @stack.types, funcs, &block)
- r = @cfunc.call(@stack.pack(args))
- funcs.each{|f| f.unbind_at_call()}
- return wrap_result(r)
- end
-
- def wrap_result(r)
- case @cfunc.ctype
- when TYPE_VOIDP
- r = CPtr.new(r)
- else
- if( @unsigned )
- r = unsigned_value(r, @cfunc.ctype)
- end
- end
- r
- end
-
- def bind(&block)
- if( !block )
- raise(RuntimeError, "block must be given.")
- end
- if( @cfunc.ptr == 0 )
- cb = Proc.new{|*args|
- ary = @stack.unpack(args)
- @stack.types.each_with_index{|ty, idx|
- case ty
- when TYPE_VOIDP
- ary[idx] = CPtr.new(ary[idx])
- end
- }
- r = block.call(*ary)
- wrap_arg(r, @cfunc.ctype, [])
- }
- case @cfunc.calltype
- when :cdecl
- @cfunc.ptr = set_cdecl_callback(@cfunc.ctype, @stack.size, &cb)
- when :stdcall
- @cfunc.ptr = set_stdcall_callback(@cfunc.ctype, @stack.size, &cb)
- else
- raise(RuntimeError, "unsupported calltype: #{@cfunc.calltype}")
- end
- if( @cfunc.ptr == 0 )
- raise(RuntimeException, "can't bind C function.")
- end
- end
- end
-
- def unbind()
- if( @cfunc.ptr != 0 )
- case @cfunc.calltype
- when :cdecl
- remove_cdecl_callback(@cfunc.ptr, @cfunc.ctype)
- when :stdcall
- remove_stdcall_callback(@cfunc.ptr, @cfunc.ctype)
- else
- raise(RuntimeError, "unsupported calltype: #{@cfunc.calltype}")
- end
- @cfunc.ptr = 0
- end
- end
-
- def bound?()
- @cfunc.ptr != 0
- end
-
- def bind_at_call(&block)
- bind(&block)
- end
-
- def unbind_at_call()
- end
- end
-
- class TempFunction < Function
- def bind_at_call(&block)
- bind(&block)
- end
-
- def unbind_at_call()
- unbind()
- end
- end
-
- class CarriedFunction < Function
- def initialize(cfunc, argtypes, n)
- super(cfunc, argtypes)
- @carrier = []
- @index = n
- @mutex = Mutex.new
- end
-
- def create_carrier(data)
- ary = []
- userdata = [ary, data]
- @mutex.lock()
- @carrier.push(userdata)
- return dlwrap(userdata)
- end
-
- def bind_at_call(&block)
- userdata = @carrier[-1]
- userdata[0].push(block)
- bind{|*args|
- ptr = args[@index]
- if( !ptr )
- raise(RuntimeError, "The index of userdata should be lower than #{args.size}.")
- end
- userdata = dlunwrap(Integer(ptr))
- args[@index] = userdata[1]
- userdata[0][0].call(*args)
- }
- @mutex.unlock()
- end
- end
-end
diff --git a/ext/dl/lib/dl/import.rb b/ext/dl/lib/dl/import.rb
index 199354c18e..01ee2490e8 100644
--- a/ext/dl/lib/dl/import.rb
+++ b/ext/dl/lib/dl/import.rb
@@ -1,227 +1,225 @@
+# -*- ruby -*-
+
require 'dl'
-require 'dl/func.rb'
-require 'dl/struct.rb'
-require 'dl/cparser.rb'
+require 'dl/types'
module DL
- class CompositeHandler
- def initialize(handlers)
- @handlers = handlers
- end
-
- def handlers()
- @handlers
- end
-
- def sym(symbol)
- @handlers.each{|handle|
- if( handle )
- begin
- addr = handle.sym(symbol)
- return addr
- rescue DLError
- end
- end
- }
- return nil
- end
-
- def [](symbol)
- sym(symbol)
- end
- end
-
- module Importer
- include DL
- include CParser
- extend Importer
-
- def dlload(*libs)
- handles = libs.collect{|lib|
- case lib
- when nil
- nil
- when Handle
- lib
- when Importer
- lib.handlers
- else
- begin
- DL.dlopen(lib)
- rescue DLError
- raise(DLError, "can't load #{lib}")
- end
- end
- }.flatten()
- @handler = CompositeHandler.new(handles)
- @func_map = {}
- @type_alias = {}
- end
-
- def typealias(alias_type, orig_type)
- @type_alias[alias_type] = orig_type
- end
-
- def sizeof(ty)
- case ty
- when String
- ty = parse_ctype(ty, @type_alias).abs()
- case ty
- when TYPE_CHAR
- return SIZEOF_CHAR
- when TYPE_SHORT
- return SIZEOF_SHORT
- when TYPE_INT
- return SIZEOF_INT
- when TYPE_LONG
- return SIZEOF_LONG
- when TYPE_LONG_LONG
- return SIZEOF_LONG_LON
- when TYPE_FLOAT
- return SIZEOF_FLOAT
- when TYPE_DOUBLE
- return SIZEOF_DOUBLE
- when TYPE_VOIDP
- return SIZEOF_VOIDP
- else
- raise(DLError, "unknown type: #{ty}")
- end
- when Class
- if( ty.instance_methods().include?(:to_ptr) )
- return ty.size()
- end
+ module Importable
+ LIB_MAP = {}
+
+ module Internal
+ def init_types()
+ @types ||= ::DL::Types.new
end
- return CPtr[ty].size()
- end
-
- def parse_bind_options(opts)
- h = {}
- prekey = nil
- while( opt = opts.shift() )
- case opt
- when :stdcall, :cdecl
- h[:call_type] = opt
- when :carried, :temp, :temporal, :bind
- h[:callback_type] = opt
- h[:carrier] = opts.shift()
- else
- h[opt] = true
- end
+
+ def init_sym()
+ @SYM ||= {}
+ end
+
+ def [](name)
+ return @SYM[name.to_s][0]
+ end
+
+ def dlload(*libnames)
+ if( !defined?(@LIBS) )
+ @LIBS = []
+ end
+ libnames.each{|libname|
+ if( !LIB_MAP[libname] )
+ LIB_MAP[libname] = DL.dlopen(libname)
+ end
+ @LIBS.push(LIB_MAP[libname])
+ }
end
- h
- end
- private :parse_bind_options
-
- def extern(signature, *opts)
- symname, ctype, argtype = parse_signature(signature, @type_alias)
- opt = parse_bind_options(opts)
- f = import_function(symname, ctype, argtype, opt[:call_type])
- name = symname.gsub(/@.+/,'')
- @func_map[name] = f
- # define_method(name){|*args,&block| f.call(*args,&block)}
- begin
- /^(.+?):(\d+)/ =~ caller.first
- file, line = $1, $2.to_i
- rescue
- file, line = __FILE__, __LINE__+3
+ alias dllink :dlload
+
+ def parse_cproto(proto)
+ proto = proto.gsub(/\s+/, " ").strip
+ case proto
+ when /^([\d\w\*_\s]+)\(([\d\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, ret, args]
+ else
+ raise(RuntimeError,"can't parse the function prototype: #{proto}")
+ end
end
- module_eval(<<-EOS, file, line)
- def #{name}(*args, &block)
- @func_map['#{name}'].call(*args,&block)
+
+ # example:
+ # extern "int strlen(char*)"
+ #
+ def extern(proto)
+ func,ret,args = parse_cproto(proto)
+ return import(func, ret, args)
+ end
+
+ # example:
+ # callback "int method_name(int, char*)"
+ #
+ def callback(proto)
+ func,ret,args = parse_cproto(proto)
+
+ init_types()
+ init_sym()
+
+ rty,renc,rdec = @types.encode_return_type(ret)
+ if( !rty )
+ raise(TypeError, "unsupported type: #{ret}")
end
- EOS
- module_function(name)
- f
- end
-
- def bind(signature, *opts, &blk)
- name, ctype, argtype = parse_signature(signature, @type_alias)
- h = parse_bind_options(opts)
- case h[:callback_type]
- when :bind, nil
- f = bind_function(name, ctype, argtype, h[:call_type], &blk)
- when :temp, :temporal
- f = create_temp_function(name, ctype, argtype, h[:call_type])
- when :carried
- f = create_carried_function(name, ctype, argtype, h[:call_type], h[:carrier])
- else
- raise(RuntimeError, "unknown callback type: #{h[:callback_type]}")
+ ty,enc,dec = encode_argument_types(args)
+ symty = rty + ty
+
+ module_eval("module_function :#{func}")
+ sym = module_eval([
+ "DL::callback(\"#{symty}\"){|*args|",
+ " sym,rdec,enc,dec = @SYM['#{func}']",
+ " args = enc.call(args) if enc",
+ " r,rs = #{func}(*args)",
+ " r = renc.call(r) if rdec",
+ " rs = dec.call(rs) if (dec && rs)",
+ " @retval = r",
+ " @args = rs",
+ " r",
+ "}",
+ ].join("\n"))
+
+ @SYM[func] = [sym,rdec,enc,dec]
+
+ return sym
+ end
+
+ # example:
+ # typealias("uint", "unsigned int")
+ #
+ def typealias(alias_type, ty1, enc1=nil, dec1=nil, ty2=nil, enc2=nil, dec2=nil)
+ init_types()
+ @types.typealias(alias_type, ty1, enc1, dec1,
+ ty2||ty1, enc2, dec2)
end
- @func_map[name] = f
- #define_method(name){|*args,&block| f.call(*args,&block)}
- begin
- /^(.+?):(\d+)/ =~ caller.first
- file, line = $1, $2.to_i
- rescue
- file, line = __FILE__, __LINE__+3
+
+ # example:
+ # symbol "foo_value"
+ # symbol "foo_func", "IIP"
+ #
+ def symbol(name, ty = nil)
+ sym = nil
+ @LIBS.each{|lib|
+ begin
+ if( ty )
+ sym = lib[name, ty]
+ else
+ sym = lib[name]
+ end
+ rescue
+ next
+ end
+ }
+ if( !sym )
+ raise(RuntimeError, "can't find the symbol `#{name}'")
+ end
+ return sym
end
- module_eval(<<-EOS, file, line)
- def #{name}(*args,&block)
- @func_map['#{name}'].call(*args,&block)
+
+ # example:
+ # import("get_length", "int", ["void*", "int"])
+ #
+ def import(name, rettype, argtypes = nil)
+ init_types()
+ init_sym()
+
+ rty,_,rdec = @types.encode_return_type(rettype)
+ if( !rty )
+ raise(TypeError, "unsupported type: #{rettype}")
end
- EOS
- module_function(name)
- f
- end
-
- def struct(signature)
- tys, mems = parse_struct_signature(signature, @type_alias)
- DL::CStructBuilder.create(CStruct, tys, mems)
- end
-
- def union(signature)
- tys, mems = parse_struct_signature(signature, @type_alias)
- DL::CStructBuilder.create(CUnion, tys, mems)
- end
-
- def [](name)
- @func_map[name]
- end
-
- def create_value(ty, val=nil)
- s = struct([ty + " value"])
- ptr = s.malloc()
- if( val )
- ptr.value = val
+ ty,enc,dec = encode_argument_types(argtypes)
+ symty = rty + ty
+
+ sym = symbol(name, symty)
+
+ mname = name.dup
+ if( ?A <= mname[0] && mname[0] <= ?Z )
+ mname[0,1] = mname[0,1].downcase
+ end
+ @SYM[mname] = [sym,rdec,enc,dec]
+
+ module_eval [
+ "def #{mname}(*args)",
+ " sym,rdec,enc,dec = @SYM['#{mname}']",
+ " args = enc.call(args) if enc",
+ if( $DEBUG )
+ " p \"[DL] call #{mname} with \#{args.inspect}\""
+ else
+ ""
+ end,
+ " r,rs = sym.call(*args)",
+ if( $DEBUG )
+ " p \"[DL] retval=\#{r.inspect} args=\#{rs.inspect}\""
+ else
+ ""
+ end,
+ " r = rdec.call(r) if rdec",
+ " rs = dec.call(rs) if dec",
+ " @retval = r",
+ " @args = rs",
+ " return r",
+ "end",
+ "module_function :#{mname}",
+ ].join("\n")
+
+ return sym
end
- return ptr
- end
- alias value create_value
-
- def import_value(ty, addr)
- s = struct([ty + " value"])
- ptr = s.new(addr)
- return ptr
- end
-
- def import_symbol(name)
- addr = @handler.sym(name)
- if( !addr )
- raise(DLError, "cannot find the symbol: #{name}")
+
+ def _args_
+ return @args
end
- CPtr.new(addr)
- end
- def import_function(name, ctype, argtype, call_type = nil)
- addr = @handler.sym(name)
- if( !addr )
- raise(DLError, "cannot find the function: #{name}()")
+ def _retval_
+ return @retval
+ end
+
+ def encode_argument_types(tys)
+ init_types()
+ encty = []
+ enc = nil
+ dec = nil
+ tys.each_with_index{|ty,idx|
+ ty,c1,c2 = @types.encode_argument_type(ty)
+ if( !ty )
+ raise(TypeError, "unsupported type: #{ty}")
+ end
+ encty.push(ty)
+ if( enc )
+ if( c1 )
+ conv1 = enc
+ enc = proc{|v| v = conv1.call(v); v[idx] = c1.call(v[idx]); v}
+ end
+ else
+ if( c1 )
+ enc = proc{|v| v[idx] = c1.call(v[idx]); v}
+ end
+ end
+ if( dec )
+ if( c2 )
+ conv2 = dec
+ dec = proc{|v| v = conv2.call(v); v[idx] = c2.call(v[idx]); v}
+ end
+ else
+ if( c2 )
+ dec = proc{|v| v[idx] = c2.call(v[idx]); v}
+ end
+ end
+ }
+ return [encty.join, enc, dec]
end
- Function.new(CFunc.new(addr, ctype, name, call_type || :cdecl), argtype)
- end
-
- def bind_function(name, ctype, argtype, call_type = nil, &block)
- f = Function.new(CFunc.new(0, ctype, name, call_type || :cdecl), argtype)
- f.bind(&block)
- f
- end
-
- def create_temp_function(name, ctype, argtype, call_type = nil)
- TempFunction.new(CFunc.new(0, ctype, name, call_type || :cdecl), argtype)
- end
-
- def create_carried_function(name, ctype, argtype, call_type = nil, n = 0)
- CarriedFunction.new(CFunc.new(0, ctype, name, call_type || :cdecl), argtype, n)
- end
- end
+ end # end of Internal
+ include Internal
+ end # end of Importable
end
diff --git a/ext/dl/lib/dl/pack.rb b/ext/dl/lib/dl/pack.rb
deleted file mode 100644
index d760edaab5..0000000000
--- a/ext/dl/lib/dl/pack.rb
+++ /dev/null
@@ -1,128 +0,0 @@
-require 'dl'
-
-module DL
- module PackInfo
- ALIGN_MAP = {
- TYPE_VOIDP => ALIGN_VOIDP,
- TYPE_CHAR => ALIGN_CHAR,
- TYPE_SHORT => ALIGN_SHORT,
- TYPE_INT => ALIGN_INT,
- TYPE_LONG => ALIGN_LONG,
- TYPE_FLOAT => ALIGN_FLOAT,
- TYPE_DOUBLE => ALIGN_DOUBLE,
- -TYPE_CHAR => ALIGN_CHAR,
- -TYPE_SHORT => ALIGN_SHORT,
- -TYPE_INT => ALIGN_INT,
- -TYPE_LONG => ALIGN_LONG,
- }
-
- PACK_MAP = {
- TYPE_VOIDP => ((SIZEOF_VOIDP == SIZEOF_LONG_LONG) ? "q" : "l!"),
- TYPE_CHAR => "c",
- TYPE_SHORT => "s!",
- TYPE_INT => "i!",
- TYPE_LONG => "l!",
- TYPE_FLOAT => "f",
- TYPE_DOUBLE => "d",
- -TYPE_CHAR => "c",
- -TYPE_SHORT => "s!",
- -TYPE_INT => "i!",
- -TYPE_LONG => "l!",
- }
-
- SIZE_MAP = {
- TYPE_VOIDP => SIZEOF_VOIDP,
- TYPE_CHAR => SIZEOF_CHAR,
- TYPE_SHORT => SIZEOF_SHORT,
- TYPE_INT => SIZEOF_INT,
- TYPE_LONG => SIZEOF_LONG,
- TYPE_FLOAT => SIZEOF_FLOAT,
- TYPE_DOUBLE => SIZEOF_DOUBLE,
- -TYPE_CHAR => SIZEOF_CHAR,
- -TYPE_SHORT => SIZEOF_SHORT,
- -TYPE_INT => SIZEOF_INT,
- -TYPE_LONG => SIZEOF_LONG,
- }
- if defined?(TYPE_LONG_LONG)
- ALIGN_MAP[TYPE_LONG_LONG] = ALIGN_MAP[-TYPE_LONG_LONG] = ALIGN_LONG_LONG
- PACK_MAP[TYPE_LONG_LONG] = PACK_MAP[-TYPE_LONG_LONG] = "q"
- SIZE_MAP[TYPE_LONG_LONG] = SIZE_MAP[-TYPE_LONG_LONG] = SIZEOF_LONG_LONG
- end
-
- def align(addr, align)
- d = addr % align
- if( d == 0 )
- addr
- else
- addr + (align - d)
- end
- end
- module_function :align
- end
-
- class Packer
- include PackInfo
-
- def self.[](*types)
- new(types)
- end
-
- def initialize(types)
- parse_types(types)
- end
-
- def size()
- @size
- end
-
- def pack(ary)
- case SIZEOF_VOIDP
- when SIZEOF_LONG
- ary.pack(@template)
- when SIZEOF_LONG
- ary.pack(@template)
- else
- raise(RuntimeError, "sizeof(void*)?")
- end
- end
-
- def unpack(ary)
- case SIZEOF_VOIDP
- when SIZEOF_LONG
- ary.join().unpack(@template)
- when SIZEOF_LONG_LONG
- ary.join().unpack(@template)
- else
- raise(RuntimeError, "sizeof(void*)?")
- end
- end
-
- private
-
- def parse_types(types)
- @template = ""
- addr = 0
- types.each{|t|
- orig_addr = addr
- if( t.is_a?(Array) )
- addr = align(orig_addr, ALIGN_MAP[TYPE_VOIDP])
- else
- addr = align(orig_addr, ALIGN_MAP[t])
- end
- d = addr - orig_addr
- if( d > 0 )
- @template << "x#{d}"
- end
- if( t.is_a?(Array) )
- @template << (PACK_MAP[t[0]] * t[1])
- addr += (SIZE_MAP[t[0]] * t[1])
- else
- @template << PACK_MAP[t]
- addr += SIZE_MAP[t]
- end
- }
- addr = align(addr, ALIGN_MAP[TYPE_VOIDP])
- @size = addr
- end
- end
-end
diff --git a/ext/dl/lib/dl/stack.rb b/ext/dl/lib/dl/stack.rb
deleted file mode 100644
index dc22378fcb..0000000000
--- a/ext/dl/lib/dl/stack.rb
+++ /dev/null
@@ -1,116 +0,0 @@
-require 'dl'
-
-module DL
- class Stack
- def self.[](*types)
- new(types)
- end
-
- def initialize(types)
- parse_types(types)
- end
-
- def size()
- @size
- end
-
- def types()
- @types
- end
-
- def pack(ary)
- case SIZEOF_VOIDP
- when SIZEOF_LONG
- ary.pack(@template).unpack('l!*')
- when SIZEOF_LONG_LONG
- ary.pack(@template).unpack('q*')
- else
- raise(RuntimeError, "sizeof(void*)?")
- end
- end
-
- def unpack(ary)
- case SIZEOF_VOIDP
- when SIZEOF_LONG
- ary.pack('l!*').unpack(@template)
- when SIZEOF_LONG_LONG
- ary.pack('q*').unpack(@template)
- else
- raise(RuntimeError, "sizeof(void*)?")
- end
- end
-
- private
-
- def align(addr, align)
- d = addr % align
- if( d == 0 )
- addr
- else
- addr + (align - d)
- end
- end
-
- ALIGN_MAP = {
- TYPE_VOIDP => ALIGN_VOIDP,
- TYPE_CHAR => ALIGN_VOIDP,
- TYPE_SHORT => ALIGN_VOIDP,
- TYPE_INT => ALIGN_VOIDP,
- TYPE_LONG => ALIGN_VOIDP,
- TYPE_FLOAT => ALIGN_FLOAT,
- TYPE_DOUBLE => ALIGN_DOUBLE,
- }
-
- PACK_MAP = {
- TYPE_VOIDP => ((SIZEOF_VOIDP == SIZEOF_LONG_LONG)? "q" : "l!"),
- TYPE_CHAR => "c",
- TYPE_SHORT => "s!",
- TYPE_INT => "i!",
- TYPE_LONG => "l!",
- TYPE_FLOAT => "f",
- TYPE_DOUBLE => "d",
- }
-
- SIZE_MAP = {
- TYPE_VOIDP => SIZEOF_VOIDP,
- TYPE_CHAR => SIZEOF_CHAR,
- TYPE_SHORT => SIZEOF_SHORT,
- TYPE_INT => SIZEOF_INT,
- TYPE_LONG => SIZEOF_LONG,
- TYPE_FLOAT => SIZEOF_FLOAT,
- TYPE_DOUBLE => SIZEOF_DOUBLE,
- }
- if defined?(TYPE_LONG_LONG)
- ALIGN_MAP[TYPE_LONG_LONG] = ALIGN_LONG_LONG
- PACK_MAP[TYPE_LONG_LONG] = "q"
- SIZE_MAP[TYPE_LONG_LONG] = SIZEOF_LONG_LONG
- end
-
- def parse_types(types)
- @types = types
- @template = ""
- addr = 0
- types.each{|t|
- addr = add_padding(addr, ALIGN_MAP[t])
- @template << PACK_MAP[t]
- addr += SIZE_MAP[t]
- }
- addr = add_padding(addr, ALIGN_MAP[SIZEOF_VOIDP])
- if( addr % SIZEOF_VOIDP == 0 )
- @size = addr / SIZEOF_VOIDP
- else
- @size = (addr / SIZEOF_VOIDP) + 1
- end
- end
-
- def add_padding(addr, align)
- orig_addr = addr
- addr = align(orig_addr, align)
- d = addr - orig_addr
- if( d > 0 )
- @template << "x#{d}"
- end
- addr
- end
- end
-end
diff --git a/ext/dl/lib/dl/struct.rb b/ext/dl/lib/dl/struct.rb
index dc116f3be5..33f303fe22 100644
--- a/ext/dl/lib/dl/struct.rb
+++ b/ext/dl/lib/dl/struct.rb
@@ -1,213 +1,149 @@
+# -*- ruby -*-
+
require 'dl'
-require 'dl/pack.rb'
+require 'dl/import'
module DL
- class CStruct
- def CStruct.entity_class()
- CStructEntity
- end
- end
-
- class CUnion
- def CUnion.entity_class()
- CUnionEntity
- end
- end
-
- module CStructBuilder
- def create(klass, types, members)
- new_class = Class.new(klass){
- define_method(:initialize){|addr|
- @entity = klass.entity_class.new(addr, types)
- @entity.assign_names(members)
- }
- define_method(:to_ptr){ @entity }
- define_method(:to_i){ @entity.to_i }
- members.each{|name|
- define_method(name){ @entity[name] }
- define_method(name + "="){|val| @entity[name] = val }
- }
- }
- size = klass.entity_class.size(types)
- new_class.module_eval(<<-EOS, __FILE__, __LINE__+1)
- def new_class.size()
- #{size}
- end
- def new_class.malloc()
- addr = DL.malloc(#{size})
- new(addr)
- end
- EOS
- return new_class
- end
- module_function :create
- end
-
- class CStructEntity < CPtr
- include PackInfo
- include ValueUtil
-
- def CStructEntity.malloc(types, func = nil)
- addr = DL.malloc(CStructEntity.size(types))
- CStructEntity.new(addr, types, func)
- end
-
- def CStructEntity.size(types)
- offset = 0
- max_align = 0
- types.each_with_index{|t,i|
- orig_offset = offset
- if( t.is_a?(Array) )
- align = PackInfo::ALIGN_MAP[t[0]]
- offset = PackInfo.align(orig_offset, align)
- size = offset - orig_offset
- offset += (PackInfo::SIZE_MAP[t[0]] * t[1])
- else
- align = PackInfo::ALIGN_MAP[t]
- offset = PackInfo.align(orig_offset, align)
- size = offset - orig_offset
- offset += PackInfo::SIZE_MAP[t]
- end
- if (max_align < align)
- max_align = align
- end
- }
- offset = PackInfo.align(offset, max_align)
- offset
- end
-
- def initialize(addr, types, func = nil)
- set_ctypes(types)
- super(addr, @size, func)
- end
-
- def assign_names(members)
- @members = members
- end
-
- def set_ctypes(types)
- @ctypes = types
- @offset = []
- offset = 0
- max_align = 0
- types.each_with_index{|t,i|
- orig_offset = offset
- if( t.is_a?(Array) )
- align = ALIGN_MAP[t[0]]
- else
- align = ALIGN_MAP[t]
- end
- offset = PackInfo.align(orig_offset, align)
- size = offset - orig_offset
- @offset[i] = offset
- if( t.is_a?(Array) )
- offset += (SIZE_MAP[t[0]] * t[1])
- else
- offset += SIZE_MAP[t]
- end
- if (max_align < align)
- max_align = align
- end
- }
- offset = PackInfo.align(offset, max_align)
- @size = offset
- end
-
- def [](name)
- idx = @members.index(name)
- if( idx.nil? )
- raise(ArgumentError, "no such member: #{name}")
+ module Importable
+ module Internal
+ def define_struct(contents)
+ init_types()
+ Struct.new(@types, contents)
end
- ty = @ctypes[idx]
- if( ty.is_a?(Array) )
- r = super(@offset[idx], SIZE_MAP[ty[0]] * ty[1])
- else
- r = super(@offset[idx], SIZE_MAP[ty.abs])
- end
- packer = Packer.new([ty])
- val = packer.unpack([r])
- case ty
- when Array
- case ty[0]
- when TYPE_VOIDP
- val = val.collect{|v| CPtr.new(v)}
- end
- when TYPE_VOIDP
- val = CPtr.new(val[0])
- else
- val = val[0]
- end
- if( ty.is_a?(Integer) && (ty < 0) )
- return unsigned_value(val, ty)
- elsif( ty.is_a?(Array) && (ty[0] < 0) )
- return val.collect{|v| unsigned_value(v,ty[0])}
- else
- return val
- end
- end
+ alias struct define_struct
- def []=(name, val)
- idx = @members.index(name)
- if( idx.nil? )
- raise(ArgumentError, "no such member: #{name}")
+ def define_union(contents)
+ init_types()
+ Union.new(@types, contents)
end
- ty = @ctypes[idx]
- packer = Packer.new([ty])
- val = wrap_arg(val, ty, [])
- buff = packer.pack([val].flatten())
- super(@offset[idx], buff.size, buff)
- if( ty.is_a?(Integer) && (ty < 0) )
- return unsigned_value(val, ty)
- elsif( ty.is_a?(Array) && (ty[0] < 0) )
- return val.collect{|v| unsigned_value(v,ty[0])}
- else
- return val
+ alias union define_union
+
+ class Memory
+ def initialize(ptr, names, ty, len, enc, dec)
+ @ptr = ptr
+ @names = names
+ @ty = ty
+ @len = len
+ @enc = enc
+ @dec = dec
+
+ # define methods
+ @names.each{|name|
+ instance_eval [
+ "def #{name}",
+ " v = @ptr[\"#{name}\"]",
+ " if( @len[\"#{name}\"] )",
+ " v = v.collect{|x| @dec[\"#{name}\"] ? @dec[\"#{name}\"].call(x) : x }",
+ " else",
+ " v = @dec[\"#{name}\"].call(v) if @dec[\"#{name}\"]",
+ " end",
+ " return v",
+ "end",
+ "def #{name}=(v)",
+ " if( @len[\"#{name}\"] )",
+ " v = v.collect{|x| @enc[\"#{name}\"] ? @enc[\"#{name}\"].call(x) : x }",
+ " else",
+ " v = @enc[\"#{name}\"].call(v) if @enc[\"#{name}\"]",
+ " end",
+ " @ptr[\"#{name}\"] = v",
+ " return v",
+ "end",
+ ].join("\n")
+ }
+ end
+
+ def to_ptr
+ return @ptr
+ end
+
+ def size
+ return @ptr.size
+ end
end
- end
-
- def to_s()
- super(@size)
- end
- end
-
- class CUnionEntity < CStructEntity
- include PackInfo
-
- def CUnionEntity.malloc(types, func=nil)
- addr = DL.malloc(CUnionEntity.size(types))
- CUnionEntity.new(addr, types, func)
- end
-
- def CUnionEntity.size(types)
- size = 0
- types.each_with_index{|t,i|
- if( t.is_a?(Array) )
- tsize = PackInfo::SIZE_MAP[t[0]] * t[1]
- else
- tsize = PackInfo::SIZE_MAP[t]
- end
- if( tsize > size )
- size = tsize
- end
- }
- end
-
- def set_ctypes(types)
- @ctypes = types
- @offset = []
- @size = 0
- types.each_with_index{|t,i|
- @offset[i] = 0
- if( t.is_a?(Array) )
- size = SIZE_MAP[t[0]] * t[1]
- else
- size = SIZE_MAP[t]
- end
- if( size > @size )
- @size = size
- end
- }
- end
- end
-end
+ class Struct
+ def initialize(types, contents)
+ @names = []
+ @ty = {}
+ @len = {}
+ @enc = {}
+ @dec = {}
+ @size = 0
+ @tys = ""
+ @types = types
+ parse(contents)
+ end
+
+ def size
+ return @size
+ end
+
+ def members
+ return @names
+ end
+
+ # ptr must be a PtrData object.
+ def new(ptr)
+ ptr.struct!(@tys, *@names)
+ mem = Memory.new(ptr, @names, @ty, @len, @enc, @dec)
+ return mem
+ end
+
+ def malloc(size = nil)
+ if( !size )
+ size = @size
+ end
+ ptr = DL::malloc(size)
+ return new(ptr)
+ end
+
+ def parse(contents)
+ contents.each{|elem|
+ name,ty,num,enc,dec = parse_elem(elem)
+ @names.push(name)
+ @ty[name] = ty
+ @len[name] = num
+ @enc[name] = enc
+ @dec[name] = dec
+ if( num )
+ @tys += "#{ty}#{num}"
+ else
+ @tys += ty
+ end
+ }
+ @size = DL.sizeof(@tys)
+ end
+
+ def parse_elem(elem)
+ elem.strip!
+ case elem
+ when /^([\w\d_\*]+)([\*\s]+)([\w\d_]+)$/
+ ty = ($1 + $2).strip
+ name = $3
+ num = nil;
+ when /^([\w\d_\*]+)([\*\s]+)([\w\d_]+)\[(\d+)\]$/
+ ty = ($1 + $2).strip
+ name = $3
+ num = $4.to_i
+ else
+ raise(RuntimeError, "invalid element: #{elem}")
+ end
+ ty,enc,dec = @types.encode_struct_type(ty)
+ if( !ty )
+ raise(TypeError, "unsupported type: #{ty}")
+ end
+ return [name,ty,num,enc,dec]
+ end
+ end # class Struct
+
+ class Union < Struct
+ def new
+ ptr = DL::malloc(@size)
+ ptr.union!(@tys, *@names)
+ mem = Memory.new(ptr, @names, @ty, @len, @enc, @dec)
+ return mem
+ end
+ end
+ end # module Internal
+ end # module Importable
+end # module DL
diff --git a/ext/dl/lib/dl/types.rb b/ext/dl/lib/dl/types.rb
index b85ac890cd..1144917dae 100644
--- a/ext/dl/lib/dl/types.rb
+++ b/ext/dl/lib/dl/types.rb
@@ -1,40 +1,245 @@
+# -*- ruby -*-
+
+require 'dl'
+
module DL
- module Win32Types
- def included(m)
- m.module_eval{
- typealias "DWORD", "unsigned long"
- typealias "PDWORD", "unsigned long *"
- typealias "WORD", "unsigned short"
- typealias "PWORD", "unsigned short *"
- typealias "BOOL", "int"
- typealias "ATOM", "int"
- typealias "BYTE", "unsigned char"
- typealias "PBYTE", "unsigned char *"
- typealias "UINT", "unsigned int"
- typealias "ULONG", "unsigned long"
- typealias "UCHAR", "unsigned char"
- typealias "HANDLE", "unsigned long"
- typealias "PHANDLE", "void*"
- typealias "PVOID", "void*"
- typealias "LPCSTR", "char*"
- typealias "LPSTR", "char*"
- typealias "HINSTANCE", "unsigned int"
- typealias "HDC", "unsigned int"
- typealias "HWND", "unsigned int"
+ class Types
+ TYPES = [
+ # FORMAT:
+ # ["alias name",
+ # "type name", encoding_method, decoding_method, for function prototypes
+ # "type name", encoding_method, decoding_method] for structures (not implemented)
+
+ # for Windows
+ ["DWORD", "unsigned long", nil, nil,
+ "unsigned long", nil, nil],
+ ["PDWORD", "unsigned long *", nil, nil,
+ "unsigned long *", nil, nil],
+ ["WORD", "unsigned short", nil, nil,
+ "unsigned short", nil, nil],
+ ["PWORD", "unsigned int *", nil, nil,
+ "unsigned int *", nil, nil],
+ ["BYTE", "unsigned char", nil, nil,
+ "unsigned char", nil, nil],
+ ["PBYTE", "unsigned char *", nil, nil,
+ "unsigned char *", nil, nil],
+ ["BOOL", "ibool", nil, nil,
+ "ibool", nil, nil],
+ ["ATOM", "int", nil, nil,
+ "int", nil, nil],
+ ["BYTE", "unsigned char", nil, nil,
+ "unsigned char", nil, nil],
+ ["PBYTE", "unsigned char *", nil, nil,
+ "unsigned char *", nil, nil],
+ ["UINT", "unsigned int", nil, nil,
+ "unsigned int", nil, nil],
+ ["ULONG", "unsigned long", nil, nil,
+ "unsigned long", nil, nil],
+ ["UCHAR", "unsigned char", nil, nil,
+ "unsigned char", nil, nil],
+ ["HANDLE", "unsigned long", nil, nil,
+ "unsigned long", nil, nil],
+ ["PHANDLE","void*", nil, nil,
+ "void*", nil, nil],
+ ["PVOID", "void*", nil, nil,
+ "void*", nil, nil],
+ ["LPCSTR", "char*", nil, nil,
+ "char*", nil, nil],
+ ["HDC", "unsigned int", nil, nil,
+ "unsigned int", nil, nil],
+ ["HWND", "unsigned int", nil, nil,
+ "unsigned int", nil, nil],
+
+ # Others
+ ["uint", "unsigned int", nil, nil,
+ "unsigned int", nil, nil],
+ ["u_int", "unsigned int", nil, nil,
+ "unsigned int", nil, nil],
+ ["ulong", "unsigned long", nil, nil,
+ "unsigned long", nil, nil],
+ ["u_long", "unsigned long", nil, nil,
+ "unsigned long", nil, nil],
+
+ # DL::Importable primitive types
+ ["ibool",
+ "I",
+ proc{|v| v ? 1 : 0},
+ proc{|v| (v != 0) ? true : false},
+ "I",
+ proc{|v| v ? 1 : 0 },
+ proc{|v| (v != 0) ? true : false} ],
+ ["cbool",
+ "C",
+ proc{|v| v ? 1 : 0},
+ proc{|v| (v != 0) ? true : false},
+ "C",
+ proc{|v,len| v ? 1 : 0},
+ proc{|v,len| (v != 0) ? true : false}],
+ ["lbool",
+ "L",
+ proc{|v| v ? 1 : 0},
+ proc{|v| (v != 0) ? true : false},
+ "L",
+ proc{|v,len| v ? 1 : 0},
+ proc{|v,len| (v != 0) ? true : false}],
+ ["unsigned char",
+ "C",
+ proc{|v| [v].pack("C").unpack("c")[0]},
+ proc{|v| [v].pack("c").unpack("C")[0]},
+ "C",
+ proc{|v| [v].pack("C").unpack("c")[0]},
+ proc{|v| [v].pack("c").unpack("C")[0]}],
+ ["unsigned short",
+ "H",
+ proc{|v| [v].pack("S").unpack("s")[0]},
+ proc{|v| [v].pack("s").unpack("S")[0]},
+ "H",
+ proc{|v| [v].pack("S").unpack("s")[0]},
+ proc{|v| [v].pack("s").unpack("S")[0]}],
+ ["unsigned int",
+ "I",
+ proc{|v| [v].pack("I").unpack("i")[0]},
+ proc{|v| [v].pack("i").unpack("I")[0]},
+ "I",
+ proc{|v| [v].pack("I").unpack("i")[0]},
+ proc{|v| [v].pack("i").unpack("I")[0]}],
+ ["unsigned long",
+ "L",
+ proc{|v| [v].pack("L").unpack("l")[0]},
+ proc{|v| [v].pack("l").unpack("L")[0]},
+ "L",
+ proc{|v| [v].pack("L").unpack("l")[0]},
+ proc{|v| [v].pack("l").unpack("L")[0]}],
+ ["unsigned char ref",
+ "c",
+ proc{|v| [v].pack("C").unpack("c")[0]},
+ proc{|v| [v].pack("c").unpack("C")[0]},
+ nil, nil, nil],
+ ["unsigned int ref",
+ "i",
+ proc{|v| [v].pack("I").unpack("i")[0]},
+ proc{|v| [v].pack("i").unpack("I")[0]},
+ nil, nil, nil],
+ ["unsigned long ref",
+ "l",
+ proc{|v| [v].pack("L").unpack("l")[0]},
+ proc{|v| [v].pack("l").unpack("L")[0]},
+ nil, nil, nil],
+ ["char ref", "c", nil, nil,
+ nil, nil, nil],
+ ["short ref", "h", nil, nil,
+ nil, nil, nil],
+ ["int ref", "i", nil, nil,
+ nil, nil, nil],
+ ["long ref", "l", nil, nil,
+ nil, nil, nil],
+ ["float ref", "f", nil, nil,
+ nil, nil, nil],
+ ["double ref","d", nil, nil,
+ nil, nil, nil],
+ ["char", "C", nil, nil,
+ "C", nil, nil],
+ ["short", "H", nil, nil,
+ "H", nil, nil],
+ ["int", "I", nil, nil,
+ "I", nil, nil],
+ ["long", "L", nil, nil,
+ "L", nil, nil],
+ ["float", "F", nil, nil,
+ "F", nil, nil],
+ ["double", "D", nil, nil,
+ "D", nil, nil],
+ [/^char\s*\*$/,"s",nil, nil,
+ "S",nil, nil],
+ [/^const char\s*\*$/,"S",nil, nil,
+ "S",nil, nil],
+ [/^.+\*$/, "P", nil, nil,
+ "P", nil, nil],
+ [/^.+\[\]$/, "a", nil, nil,
+ "a", nil, nil],
+ ["void", "0", nil, nil,
+ nil, nil, nil],
+ ]
+
+ def initialize
+ init_types()
+ end
+
+ def typealias(ty1, ty2, enc=nil, dec=nil, ty3=nil, senc=nil, sdec=nil)
+ @TYDEFS.unshift([ty1, ty2, enc, dec, ty3, senc, sdec])
+ end
+
+ def init_types
+ @TYDEFS = TYPES.dup
+ end
+
+ def encode_argument_type(alias_type)
+ proc_encode = nil
+ proc_decode = nil
+ @TYDEFS.each{|aty,ty,enc,dec,_,_,_|
+ if( (aty.is_a?(Regexp) && (aty =~ alias_type)) || (aty == alias_type) )
+ alias_type = alias_type.gsub(aty,ty) if ty
+ alias_type.strip! if alias_type
+ if( proc_encode )
+ if( enc )
+ conv1 = proc_encode
+ proc_encode = proc{|v| enc.call(conv1.call(v))}
+ end
+ else
+ if( enc )
+ proc_encode = enc
+ end
+ end
+ if( proc_decode )
+ if( dec )
+ conv2 = proc_decode
+ proc_decode = proc{|v| dec.call(conv2.call(v))}
+ end
+ else
+ if( dec )
+ proc_decode = dec
+ end
+ end
+ end
}
+ return [alias_type, proc_encode, proc_decode]
end
- module_function :included
- end
-
- module BasicTypes
- def included(m)
- m.module_eval{
- typealias "uint", "unsigned int"
- typealias "u_int", "unsigned int"
- typealias "ulong", "unsigned long"
- typealias "u_long", "unsigned long"
+
+ def encode_return_type(ty)
+ ty, enc, dec = encode_argument_type(ty)
+ return [ty, enc, dec]
+ end
+
+ def encode_struct_type(alias_type)
+ proc_encode = nil
+ proc_decode = nil
+ @TYDEFS.each{|aty,_,_,_,ty,enc,dec|
+ if( (aty.is_a?(Regexp) && (aty =~ alias_type)) || (aty == alias_type) )
+ alias_type = alias_type.gsub(aty,ty) if ty
+ alias_type.strip! if alias_type
+ if( proc_encode )
+ if( enc )
+ conv1 = proc_encode
+ proc_encode = proc{|v| enc.call(conv1.call(v))}
+ end
+ else
+ if( enc )
+ proc_encode = enc
+ end
+ end
+ if( proc_decode )
+ if( dec )
+ conv2 = proc_decode
+ proc_decode = proc{|v| dec.call(conv2.call(v))}
+ end
+ else
+ if( dec )
+ proc_decode = dec
+ end
+ end
+ end
}
+ return [alias_type, proc_encode, proc_decode]
end
- module_function :included
- end
+ end # end of Types
end
diff --git a/ext/dl/lib/dl/value.rb b/ext/dl/lib/dl/value.rb
deleted file mode 100644
index 56dfcefa32..0000000000
--- a/ext/dl/lib/dl/value.rb
+++ /dev/null
@@ -1,112 +0,0 @@
-require 'dl'
-
-module DL
- module ValueUtil
- def unsigned_value(val, ty)
- case ty.abs
- when TYPE_CHAR
- [val].pack("c").unpack("C")[0]
- when TYPE_SHORT
- [val].pack("s!").unpack("S!")[0]
- when TYPE_INT
- [val].pack("i!").unpack("I!")[0]
- when TYPE_LONG
- [val].pack("l!").unpack("L!")[0]
- when TYPE_LONG_LONG
- [val].pack("q!").unpack("Q!")[0]
- else
- val
- end
- end
-
- def signed_value(val, ty)
- case ty.abs
- when TYPE_CHAR
- [val].pack("C").unpack("c")[0]
- when TYPE_SHORT
- [val].pack("S!").unpack("s!")[0]
- when TYPE_INT
- [val].pack("I!").unpack("i!")[0]
- when TYPE_LONG
- [val].pack("L!").unpack("l!")[0]
- when TYPE_LONG_LONG
- [val].pack("Q!").unpack("q!")[0]
- else
- val
- end
- end
-
- def wrap_args(args, tys, funcs, &block)
- result = []
- tys ||= []
- args.each_with_index{|arg, idx|
- result.push(wrap_arg(arg, tys[idx], funcs, &block))
- }
- result
- end
-
- def wrap_arg(arg, ty, funcs, &block)
- funcs ||= []
- case arg
- when nil
- return 0
- when CPtr
- return arg.to_i
- when IO
- case ty
- when TYPE_VOIDP
- return CPtr[arg].to_i
- else
- return arg.to_i
- end
- when Function
- if( block )
- arg.bind_at_call(&block)
- funcs.push(arg)
- elsif !arg.bound?
- raise(RuntimeError, "block must be given.")
- end
- return arg.to_i
- when String
- if( ty.is_a?(Array) )
- return arg.unpack('C*')
- else
- case SIZEOF_VOIDP
- when SIZEOF_LONG
- return [arg].pack("p").unpack("l!")[0]
- when SIZEOF_LONG_LONG
- return [arg].pack("p").unpack("q")[0]
- else
- raise(RuntimeError, "sizeof(void*)?")
- end
- end
- when Float, Integer
- return arg
- when Array
- if( ty.is_a?(Array) ) # used only by struct
- case ty[0]
- when TYPE_VOIDP
- return arg.collect{|v| Integer(v)}
- when TYPE_CHAR
- if( arg.is_a?(String) )
- return val.unpack('C*')
- end
- end
- return arg
- else
- return arg
- end
- else
- if( arg.respond_to?(:to_ptr) )
- return arg.to_ptr.to_i
- else
- begin
- return Integer(arg)
- rescue
- raise(ArgumentError, "unknown argument type: #{arg.class}")
- end
- end
- end
- end
- end
-end
diff --git a/ext/dl/lib/dl/win32.rb b/ext/dl/lib/dl/win32.rb
new file mode 100644
index 0000000000..0fed47c324
--- /dev/null
+++ b/ext/dl/lib/dl/win32.rb
@@ -0,0 +1,25 @@
+# -*- ruby -*-
+
+require 'dl'
+
+class Win32API
+ DLL = {}
+
+ def initialize(dllname, func, import, export = "0")
+ prototype = (export + import.to_s).tr("VPpNnLlIi", "0SSI").sub(/^(.)0*$/, '\1')
+ handle = DLL[dllname] ||= DL::Handle.new(dllname)
+ @sym = handle.sym(func, prototype)
+ end
+
+ def call(*args)
+ import = @sym.proto.split("", 2)[1]
+ args.each_with_index do |x, i|
+ args[i] = nil if x == 0 and import[i] == ?S
+ args[i], = [x].pack("I").unpack("i") if import[i] == ?I
+ end
+ ret, = @sym.call(*args)
+ return ret || 0
+ end
+
+ alias Call call
+end
diff --git a/ext/dl/mkcall.rb b/ext/dl/mkcall.rb
new file mode 100644
index 0000000000..6a85570152
--- /dev/null
+++ b/ext/dl/mkcall.rb
@@ -0,0 +1,62 @@
+# -*- ruby -*-
+
+require 'mkmf'
+$:.unshift File.dirname(__FILE__)
+require 'type'
+require 'dlconfig'
+
+def output_arg(x,i)
+ "args[#{i}].#{DLTYPE[x][:stmem]}"
+end
+
+def output_args(types)
+ t = []
+ types[1..-1].each_with_index{|x,i| t.push(output_arg(x,i))}
+ t.join(",")
+end
+
+def output_callfunc(types)
+ t = types[0]
+ stmem = DLTYPE[t][:stmem]
+ ctypes = types2ctypes(types)
+ if( t == VOID )
+ callstm = "(*f)(#{output_args(types)})"
+ else
+ callstm = "ret.#{stmem} = (*f)(#{output_args(types)})"
+ end
+ [ "{",
+ "#{ctypes[0]} (*f)(#{ctypes[1..-1].join(',')}) = func;",
+ "#{callstm};",
+ "}"].join(" ")
+end
+
+def output_case(types)
+ num = types2num(types)
+ callfunc_stm = output_callfunc(types)
+<<EOF
+ case #{num}:
+#ifdef DEBUG
+ printf("#{callfunc_stm}\\n");
+#endif
+ #{callfunc_stm};
+ break;
+EOF
+end
+
+def rec_output(types = [VOID])
+ print output_case(types)
+ if( types.length <= MAX_ARG )
+ DLTYPE.keys.sort.each{|t|
+ if( t != VOID && DLTYPE[t][:sym] )
+ rec_output(types + [t])
+ end
+ }
+ end
+end
+
+DLTYPE.keys.sort.each{|t|
+ if( DLTYPE[t][:sym] )
+ $stderr.printf(" #{DLTYPE[t][:ctype]}\n")
+ rec_output([t])
+ end
+}
diff --git a/ext/dl/mkcallback.rb b/ext/dl/mkcallback.rb
new file mode 100644
index 0000000000..c9f92e4a0d
--- /dev/null
+++ b/ext/dl/mkcallback.rb
@@ -0,0 +1,56 @@
+# -*- ruby -*-
+
+require 'mkmf'
+$:.unshift File.dirname(__FILE__)
+require 'type'
+require 'dlconfig'
+
+def mkfunc(rettype, fnum, argc)
+ args = (0..(argc-1)).collect{|i| "long arg#{i}"}.join(", ")
+
+ subst_code = (0..(argc-1)).collect{|i|
+ " buff[#{i.to_s}] = arg#{i.to_s};"
+ }.join("\n")
+
+ ret_code =
+ if( DLTYPE[rettype][:c2rb] )
+ " return #{DLTYPE[rettype][:rb2c]['retval']};"
+ else
+ " /* no return value */"
+ end
+
+ code = [
+ "static #{DLTYPE[rettype][:ctype]}",
+ "rb_dl_callback_func_#{rettype.to_s}_#{fnum.to_s}(#{args})",
+ "{",
+ " VALUE retval, proto, proc, obj;",
+ " VALUE argv[#{argc.to_s}];",
+ " int argc;",
+ " long buff[#{argc.to_s}];",
+ "",
+ subst_code,
+ "",
+ " obj = rb_hash_aref(DLFuncTable, rb_assoc_new(INT2NUM(#{rettype.to_s}),INT2NUM(#{fnum.to_s})));",
+ " if(NIL_P(obj))",
+ " rb_raise(rb_eDLError, \"callback function does not exist in DL::FuncTable\");",
+ " Check_Type(obj, T_ARRAY);",
+ " proto = rb_ary_entry(obj, 0);",
+ " proc = rb_ary_entry(obj, 1);",
+ " Check_Type(proto, T_STRING);",
+ " if( RSTRING(proto)->len >= #{argc.to_s} )",
+ " rb_raise(rb_eArgError, \"too many arguments\");",
+ " rb_dl_scan_callback_args(buff, RSTRING(proto)->ptr, &argc, argv);",
+ " retval = rb_funcall2(proc, id_call, argc, argv);",
+ "",
+ ret_code,
+ "}",
+ ].join("\n")
+
+ return code
+end
+
+DLTYPE.keys.sort.each{|t|
+ for n in 0..(MAX_CALLBACK - 1)
+ print(mkfunc(t, n, 15), "\n\n")
+ end
+}
diff --git a/ext/dl/mkcbtable.rb b/ext/dl/mkcbtable.rb
new file mode 100644
index 0000000000..165c4bdc88
--- /dev/null
+++ b/ext/dl/mkcbtable.rb
@@ -0,0 +1,18 @@
+# -*- ruby -*-
+
+require 'mkmf'
+$:.unshift File.dirname(__FILE__)
+require 'type'
+require 'dlconfig'
+
+def mktable(rettype, fnum, argc)
+ code =
+ "rb_dl_callback_table[#{rettype}][#{fnum}] = &rb_dl_callback_func_#{rettype.to_s}_#{fnum};"
+ return code
+end
+
+DLTYPE.keys.sort.each{|t|
+ for n in 0..(MAX_CALLBACK - 1)
+ print(mktable(t, n, 15), "\n")
+ end
+}
diff --git a/ext/dl/ptr.c b/ext/dl/ptr.c
new file mode 100644
index 0000000000..01eb31da20
--- /dev/null
+++ b/ext/dl/ptr.c
@@ -0,0 +1,1058 @@
+/* -*- C -*-
+ * $Id$
+ */
+
+#include <ruby.h>
+#include <ctype.h>
+#include "st.h"
+#include "dl.h"
+
+VALUE rb_cDLPtrData;
+VALUE rb_mDLMemorySpace;
+static st_table* st_memory_table;
+
+#ifndef T_SYMBOL
+# define T_SYMBOL T_FIXNUM
+#endif
+
+static void
+rb_dlmem_delete(void *ptr)
+{
+ rb_secure(4);
+ st_delete(st_memory_table, (st_data_t*)&ptr, NULL);
+}
+
+static void
+rb_dlmem_aset(void *ptr, VALUE obj)
+{
+ if (obj == Qnil) {
+ rb_dlmem_delete(ptr);
+ }
+ else{
+ st_insert(st_memory_table, (st_data_t)ptr, (st_data_t)obj);
+ }
+}
+
+static VALUE
+rb_dlmem_aref(void *ptr)
+{
+ VALUE val;
+
+ if(!st_lookup(st_memory_table, (st_data_t)ptr, &val)) return Qnil;
+ return val == Qundef ? Qnil : val;
+}
+
+void
+dlptr_free(struct ptr_data *data)
+{
+ if (data->ptr) {
+ DEBUG_CODE({
+ printf("dlptr_free(): removing the pointer `0x%x' from the MemorySpace\n",
+ data->ptr);
+ });
+ rb_dlmem_delete(data->ptr);
+ if (data->free) {
+ DEBUG_CODE({
+ printf("dlptr_free(): 0x%x(data->ptr:0x%x)\n",data->free,data->ptr);
+ });
+ (*(data->free))(data->ptr);
+ }
+ }
+ if (data->stype) dlfree(data->stype);
+ if (data->ssize) dlfree(data->ssize);
+ if (data->ids) dlfree(data->ids);
+}
+
+void
+dlptr_init(VALUE val)
+{
+ struct ptr_data *data;
+
+ Data_Get_Struct(val, struct ptr_data, data);
+ DEBUG_CODE({
+ printf("dlptr_init(): add the pointer `0x%x' to the MemorySpace\n",
+ data->ptr);
+ });
+ rb_dlmem_aset(data->ptr, val);
+ OBJ_TAINT(val);
+}
+
+VALUE
+rb_dlptr_new2(VALUE klass, void *ptr, long size, freefunc_t func)
+{
+ struct ptr_data *data;
+ VALUE val;
+
+ rb_secure(4);
+ if (ptr) {
+ val = rb_dlmem_aref(ptr);
+ if (val == Qnil) {
+ val = Data_Make_Struct(klass, struct ptr_data,
+ 0, dlptr_free, data);
+ data->ptr = ptr;
+ data->free = func;
+ data->ctype = DLPTR_CTYPE_UNKNOWN;
+ data->stype = NULL;
+ data->ssize = NULL;
+ data->slen = 0;
+ data->size = size;
+ data->ids = NULL;
+ data->ids_num = 0;
+ dlptr_init(val);
+ }
+ else{
+ if (func) {
+ Data_Get_Struct(val, struct ptr_data, data);
+ data->free = func;
+ }
+ }
+ }
+ else{
+ val = Qnil;
+ }
+
+ return val;
+}
+
+VALUE
+rb_dlptr_new(void *ptr, long size, freefunc_t func)
+{
+ return rb_dlptr_new2(rb_cDLPtrData, ptr, size, func);
+}
+
+VALUE
+rb_dlptr_malloc(long size, freefunc_t func)
+{
+ void *ptr;
+
+ rb_secure(4);
+ ptr = dlmalloc((size_t)size);
+ memset(ptr,0,(size_t)size);
+ return rb_dlptr_new(ptr, size, func);
+}
+
+void *
+rb_dlptr2cptr(VALUE val)
+{
+ struct ptr_data *data;
+ void *ptr;
+
+ if (rb_obj_is_kind_of(val, rb_cDLPtrData)) {
+ Data_Get_Struct(val, struct ptr_data, data);
+ ptr = data->ptr;
+ }
+ else if (val == Qnil) {
+ ptr = NULL;
+ }
+ else{
+ rb_raise(rb_eTypeError, "DL::PtrData was expected");
+ }
+
+ return ptr;
+}
+
+static VALUE
+rb_dlptr_s_allocate(VALUE klass)
+{
+ VALUE obj;
+ struct ptr_data *data;
+
+ rb_secure(4);
+ obj = Data_Make_Struct(klass, struct ptr_data, 0, dlptr_free, data);
+ data->ptr = 0;
+ data->free = 0;
+ data->ctype = DLPTR_CTYPE_UNKNOWN;
+ data->stype = NULL;
+ data->ssize = NULL;
+ data->slen = 0;
+ data->size = 0;
+ data->ids = NULL;
+ data->ids_num = 0;
+
+ return obj;
+}
+
+static VALUE
+rb_dlptr_initialize(int argc, VALUE argv[], VALUE self)
+{
+ VALUE ptr, sym, size;
+ struct ptr_data *data;
+ void *p = NULL;
+ freefunc_t f = NULL;
+ long s = 0;
+
+ switch (rb_scan_args(argc, argv, "12", &ptr, &size, &sym)) {
+ case 1:
+ p = (void*)(DLNUM2LONG(rb_Integer(ptr)));
+ break;
+ case 2:
+ p = (void*)(DLNUM2LONG(rb_Integer(ptr)));
+ s = DLNUM2LONG(size);
+ break;
+ case 3:
+ p = (void*)(DLNUM2LONG(rb_Integer(ptr)));
+ s = DLNUM2LONG(size);
+ f = rb_dlsym2csym(sym);
+ break;
+ default:
+ rb_bug("rb_dlptr_initialize");
+ }
+
+ if (p) {
+ Data_Get_Struct(self, struct ptr_data, data);
+ if (data->ptr && data->free) {
+ /* Free previous memory. Use of inappropriate initialize may cause SEGV. */
+ (*(data->free))(data->ptr);
+ }
+ data->ptr = p;
+ data->size = s;
+ data->free = f;
+ }
+
+ return Qnil;
+}
+
+static VALUE
+rb_dlptr_s_malloc(int argc, VALUE argv[], VALUE klass)
+{
+ VALUE size, sym, obj;
+ int s;
+ freefunc_t f = NULL;
+
+ switch (rb_scan_args(argc, argv, "11", &size, &sym)) {
+ case 1:
+ s = NUM2INT(size);
+ break;
+ case 2:
+ s = NUM2INT(size);
+ f = rb_dlsym2csym(sym);
+ break;
+ default:
+ rb_bug("rb_dlptr_s_malloc");
+ }
+
+ obj = rb_dlptr_malloc(s,f);
+
+ return obj;
+}
+
+VALUE
+rb_dlptr_to_i(VALUE self)
+{
+ struct ptr_data *data;
+
+ Data_Get_Struct(self, struct ptr_data, data);
+ return DLLONG2NUM(data->ptr);
+}
+
+VALUE
+rb_dlptr_ptr(VALUE self)
+{
+ struct ptr_data *data;
+
+ Data_Get_Struct(self, struct ptr_data, data);
+ return rb_dlptr_new(*((void**)(data->ptr)),0,0);
+}
+
+VALUE
+rb_dlptr_ref(VALUE self)
+{
+ struct ptr_data *data;
+
+ Data_Get_Struct(self, struct ptr_data, data);
+ return rb_dlptr_new(&(data->ptr),0,0);
+}
+
+VALUE
+rb_dlptr_null_p(VALUE self)
+{
+ struct ptr_data *data;
+
+ Data_Get_Struct(self, struct ptr_data, data);
+ return data->ptr ? Qfalse : Qtrue;
+}
+
+VALUE
+rb_dlptr_free_set(VALUE self, VALUE val)
+{
+ struct ptr_data *data;
+
+ Data_Get_Struct(self, struct ptr_data, data);
+
+ data->free = DLFREEFUNC(rb_dlsym2csym(val));
+
+ return Qnil;
+}
+
+VALUE
+rb_dlptr_free_get(VALUE self)
+{
+ struct ptr_data *pdata;
+
+ Data_Get_Struct(self, struct ptr_data, pdata);
+
+ return rb_dlsym_new(pdata->free,"(free)","0P");
+}
+
+VALUE
+rb_dlptr_to_array(int argc, VALUE argv[], VALUE self)
+{
+ struct ptr_data *data;
+ int n;
+ int i;
+ int t;
+ VALUE ary;
+ VALUE type, size;
+
+ Data_Get_Struct(self, struct ptr_data, data);
+
+ switch (rb_scan_args(argc, argv, "11", &type, &size)) {
+ case 2:
+ t = StringValuePtr(type)[0];
+ n = NUM2INT(size);
+ break;
+ case 1:
+ t = StringValuePtr(type)[0];
+ switch (t) {
+ case 'C':
+ n = data->size;
+ break;
+ case 'H':
+ n = data->size / sizeof(short);
+ break;
+ case 'I':
+ n = data->size / sizeof(int);
+ break;
+ case 'L':
+ n = data->size / sizeof(long);
+ break;
+ case 'F':
+ n = data->size / sizeof(float);
+ break;
+ case 'D':
+ n = data->size / sizeof(double);
+ break;
+ case 'P': case 'p':
+ n = data->size / sizeof(void*);
+ break;
+ case 'S': case 's':
+ n = data->size / sizeof(char*);
+ break;
+ default:
+ n = 0;
+ }
+ break;
+ default:
+ rb_bug("rb_dlptr_to_array");
+ }
+
+ ary = rb_ary_new();
+
+ for (i=0; i < n; i++) {
+ switch (t) {
+ case 'C':
+ rb_ary_push(ary, INT2NUM(((char*)(data->ptr))[i]));
+ break;
+ case 'H':
+ rb_ary_push(ary, INT2NUM(((short*)(data->ptr))[i]));
+ break;
+ case 'I':
+ rb_ary_push(ary, INT2NUM(((int*)(data->ptr))[i]));
+ break;
+ case 'L':
+ rb_ary_push(ary, DLLONG2NUM(((long*)(data->ptr))[i]));
+ break;
+ case 'D':
+ rb_ary_push(ary, rb_float_new(((double*)(data->ptr))[i]));
+ break;
+ case 'F':
+ rb_ary_push(ary, rb_float_new(((float*)(data->ptr))[i]));
+ break;
+ case 'S':
+ {
+ char *str = ((char**)(data->ptr))[i];
+ if (str) {
+ rb_ary_push(ary, rb_tainted_str_new2(str));
+ }
+ else{
+ rb_ary_push(ary, Qnil);
+ }
+ }
+ break;
+ case 's':
+ {
+ char *str = ((char**)(data->ptr))[i];
+ if (str) {
+ rb_ary_push(ary, rb_tainted_str_new2(str));
+ xfree(str);
+ }
+ else{
+ rb_ary_push(ary, Qnil);
+ }
+ }
+ break;
+ case 'P':
+ rb_ary_push(ary, rb_dlptr_new(((void**)(data->ptr))[i],0,0));
+ break;
+ case 'p':
+ rb_ary_push(ary,
+ rb_dlptr_new(((void**)(data->ptr))[i],0,dlfree));
+ break;
+ }
+ }
+
+ return ary;
+}
+
+
+VALUE
+rb_dlptr_to_s(int argc, VALUE argv[], VALUE self)
+{
+ struct ptr_data *data;
+ VALUE arg1, val;
+ int len;
+
+ Data_Get_Struct(self, struct ptr_data, data);
+ switch (rb_scan_args(argc, argv, "01", &arg1)) {
+ case 0:
+ val = rb_tainted_str_new2((char*)(data->ptr));
+ break;
+ case 1:
+ len = NUM2INT(arg1);
+ val = rb_tainted_str_new((char*)(data->ptr), len);
+ break;
+ default:
+ rb_bug("rb_dlptr_to_s");
+ }
+
+ return val;
+}
+
+VALUE
+rb_dlptr_to_str(int argc, VALUE argv[], VALUE self)
+{
+ struct ptr_data *data;
+ VALUE arg1, val;
+ int len;
+
+ Data_Get_Struct(self, struct ptr_data, data);
+ switch (rb_scan_args(argc, argv, "01", &arg1)) {
+ case 0:
+ val = rb_tainted_str_new((char*)(data->ptr),data->size);
+ break;
+ case 1:
+ len = NUM2INT(arg1);
+ val = rb_tainted_str_new((char*)(data->ptr), len);
+ break;
+ default:
+ rb_bug("rb_dlptr_to_str");
+ }
+
+ return val;
+}
+
+VALUE
+rb_dlptr_inspect(VALUE self)
+{
+ struct ptr_data *data;
+ char str[1024];
+
+ Data_Get_Struct(self, struct ptr_data, data);
+ snprintf(str, 1023, "#<%s:0x%lx ptr=0x%lx size=%ld free=0x%lx>",
+ rb_class2name(CLASS_OF(self)), data, data->ptr, data->size,
+ (long)data->free);
+ return rb_str_new2(str);
+}
+
+VALUE
+rb_dlptr_eql(VALUE self, VALUE other)
+{
+ void *ptr1, *ptr2;
+ ptr1 = rb_dlptr2cptr(self);
+ ptr2 = rb_dlptr2cptr(other);
+
+ return ptr1 == ptr2 ? Qtrue : Qfalse;
+}
+
+VALUE
+rb_dlptr_cmp(VALUE self, VALUE other)
+{
+ void *ptr1, *ptr2;
+ ptr1 = rb_dlptr2cptr(self);
+ ptr2 = rb_dlptr2cptr(other);
+ return DLLONG2NUM((long)ptr1 - (long)ptr2);
+}
+
+VALUE
+rb_dlptr_plus(VALUE self, VALUE other)
+{
+ void *ptr;
+ long num, size;
+
+ ptr = rb_dlptr2cptr(self);
+ size = RDLPTR(self)->size;
+ num = DLNUM2LONG(other);
+ return rb_dlptr_new((char *)ptr + num, size - num, 0);
+}
+
+VALUE
+rb_dlptr_minus(VALUE self, VALUE other)
+{
+ void *ptr;
+ long num, size;
+
+ ptr = rb_dlptr2cptr(self);
+ size = RDLPTR(self)->size;
+ num = DLNUM2LONG(other);
+ return rb_dlptr_new((char *)ptr - num, size + num, 0);
+}
+
+VALUE
+rb_dlptr_define_data_type(int argc, VALUE argv[], VALUE self)
+{
+ VALUE data_type, type, rest, vid;
+ struct ptr_data *data;
+ int i, t, num;
+ char *ctype;
+
+ rb_scan_args(argc, argv, "11*", &data_type, &type, &rest);
+ Data_Get_Struct(self, struct ptr_data, data);
+
+ if (argc == 1 || (argc == 2 && type == Qnil)) {
+ if (NUM2INT(data_type) == DLPTR_CTYPE_UNKNOWN) {
+ data->ctype = DLPTR_CTYPE_UNKNOWN;
+ data->slen = 0;
+ data->ids_num = 0;
+ if (data->stype) {
+ dlfree(data->stype);
+ data->stype = NULL;
+ }
+ if (data->ids) {
+ dlfree(data->ids);
+ data->ids = NULL;
+ }
+ return Qnil;
+ }
+ else{
+ rb_raise(rb_eArgError, "wrong arguments");
+ }
+ }
+
+ t = NUM2INT(data_type);
+ StringValue(type);
+ Check_Type(rest, T_ARRAY);
+ num = RARRAY(rest)->len;
+ for (i=0; i<num; i++) {
+ rb_to_id(rb_ary_entry(rest,i));
+ }
+
+ data->ctype = t;
+ data->slen = num;
+ data->ids_num = num;
+ if (data->stype) dlfree(data->stype);
+ data->stype = (char*)dlmalloc(sizeof(char) * num);
+ if (data->ssize) dlfree(data->ssize);
+ data->ssize = (int*)dlmalloc(sizeof(int) * num);
+ if (data->ids) dlfree(data->ids);
+ data->ids = (ID*)dlmalloc(sizeof(ID) * data->ids_num);
+
+ ctype = StringValuePtr(type);
+ for (i=0; i<num; i++) {
+ vid = rb_ary_entry(rest,i);
+ data->ids[i] = rb_to_id(vid);
+ data->stype[i] = *ctype;
+ ctype ++;
+ if (isdigit(*ctype)) {
+ char *p, *d;
+ for (p=ctype; isdigit(*p); p++) ;
+ d = ALLOCA_N(char, p - ctype + 1);
+ strncpy(d, ctype, p - ctype);
+ d[p - ctype] = '\0';
+ data->ssize[i] = atoi(d);
+ ctype = p;
+ }
+ else{
+ data->ssize[i] = 1;
+ }
+ }
+
+ if (*ctype) {
+ rb_raise(rb_eArgError, "too few/many arguments");
+ }
+
+ if (!data->size)
+ data->size = dlsizeof(RSTRING(type)->ptr);
+
+ return Qnil;
+}
+
+VALUE
+rb_dlptr_define_struct(int argc, VALUE argv[], VALUE self)
+{
+ VALUE *pass_argv;
+ int pass_argc, i;
+
+ pass_argc = argc + 1;
+ pass_argv = ALLOCA_N(VALUE, pass_argc);
+ pass_argv[0] = INT2FIX(DLPTR_CTYPE_STRUCT);
+ for (i=1; i<pass_argc; i++) {
+ pass_argv[i] = argv[i-1];
+ }
+ return rb_dlptr_define_data_type(pass_argc, pass_argv, self);
+}
+
+VALUE
+rb_dlptr_define_union(int argc, VALUE argv[], VALUE self)
+{
+ VALUE *pass_argv;
+ int pass_argc, i;
+
+ pass_argc = argc + 1;
+ pass_argv = ALLOCA_N(VALUE, pass_argc);
+ pass_argv[0] = INT2FIX(DLPTR_CTYPE_UNION);
+ for (i=1; i<pass_argc; i++) {
+ pass_argv[i] = argv[i-1];
+ }
+ return rb_dlptr_define_data_type(pass_argc, pass_argv, self);
+}
+
+VALUE
+rb_dlptr_get_data_type(VALUE self)
+{
+ struct ptr_data *data;
+
+ Data_Get_Struct(self, struct ptr_data, data);
+ if (data->stype)
+ return rb_assoc_new(INT2FIX(data->ctype),
+ rb_tainted_str_new(data->stype, data->slen));
+ else
+ return rb_assoc_new(INT2FIX(data->ctype), Qnil);
+}
+
+static VALUE
+cary2ary(void *ptr, char t, int len)
+{
+ VALUE ary;
+ VALUE elem;
+ int i;
+
+ if (len < 1)
+ return Qnil;
+
+ if (len == 1) {
+ switch (t) {
+ case 'I':
+ elem = INT2NUM(*((int*)ptr));
+ ptr = (char *)ptr + sizeof(int);
+ break;
+ case 'L':
+ elem = DLLONG2NUM(*((long*)ptr));
+ ptr = (char *)ptr + sizeof(long);
+ break;
+ case 'P':
+ case 'S':
+ elem = rb_dlptr_new(*((void**)ptr),0, 0);
+ ptr = (char *)ptr + sizeof(void*);
+ break;
+ case 'F':
+ elem = rb_float_new(*((float*)ptr));
+ ptr = (char *)ptr + sizeof(float);
+ break;
+ case 'D':
+ elem = rb_float_new(*((double*)ptr));
+ ptr = (char *)ptr + sizeof(double);
+ break;
+ case 'C':
+ elem = INT2NUM(*((char*)ptr));
+ ptr = (char *)ptr + sizeof(char);
+ break;
+ case 'H':
+ elem = INT2NUM(*((short*)ptr));
+ ptr = (char *)ptr + sizeof(short);
+ break;
+ default:
+ rb_raise(rb_eDLTypeError, "unsupported type '%c'", t);
+ }
+ return elem;
+ }
+
+ ary = rb_ary_new();
+ for (i=0; i < len; i++) {
+ switch (t) {
+ case 'I':
+ elem = INT2NUM(*((int*)ptr));
+ ptr = (char *)ptr + sizeof(int);
+ break;
+ case 'L':
+ elem = DLLONG2NUM(*((long*)ptr));
+ ptr = (char *)ptr + sizeof(long);
+ break;
+ case 'P':
+ case 'S':
+ elem = rb_dlptr_new(*((void**)ptr), 0, 0);
+ ptr = (char *)ptr + sizeof(void*);
+ break;
+ case 'F':
+ elem = rb_float_new(*((float*)ptr));
+ ptr = (char *)ptr + sizeof(float);
+ break;
+ case 'D':
+ elem = rb_float_new(*((float*)ptr));
+ ptr = (char *)ptr + sizeof(double);
+ break;
+ case 'C':
+ elem = INT2NUM(*((char*)ptr));
+ ptr = (char *)ptr + sizeof(char);
+ break;
+ case 'H':
+ elem = INT2NUM(*((short*)ptr));
+ ptr = (char *)ptr + sizeof(short);
+ break;
+ default:
+ rb_raise(rb_eDLTypeError, "unsupported type '%c'", t);
+ }
+ rb_ary_push(ary, elem);
+ }
+
+ return ary;
+}
+
+VALUE
+rb_dlptr_aref(int argc, VALUE argv[], VALUE self)
+{
+ VALUE key = Qnil, num = Qnil;
+ ID id;
+ struct ptr_data *data;
+ int i;
+ int offset;
+
+ if (rb_scan_args(argc, argv, "11", &key, &num) == 1) {
+ num = INT2NUM(0);
+ }
+
+ if (TYPE(key) == T_FIXNUM || TYPE(key) == T_BIGNUM) {
+ VALUE pass[1];
+ pass[0] = num;
+ return rb_dlptr_to_str(1, pass, rb_dlptr_plus(self, key));
+ }
+ rb_to_id(key);
+ if (! (TYPE(key) == T_STRING || TYPE(key) == T_SYMBOL)) {
+ rb_raise(rb_eTypeError, "the key must be a string or symbol");
+ }
+
+ id = rb_to_id(key);
+ Data_Get_Struct(self, struct ptr_data, data);
+ offset = 0;
+ switch (data->ctype) {
+ case DLPTR_CTYPE_STRUCT:
+ for (i=0; i < data->ids_num; i++) {
+ switch (data->stype[i]) {
+ case 'I':
+ DLALIGN(data->ptr,offset,INT_ALIGN);
+ break;
+ case 'L':
+ DLALIGN(data->ptr,offset,LONG_ALIGN);
+ break;
+ case 'P':
+ case 'S':
+ DLALIGN(data->ptr,offset,VOIDP_ALIGN);
+ break;
+ case 'F':
+ DLALIGN(data->ptr,offset,FLOAT_ALIGN);
+ break;
+ case 'D':
+ DLALIGN(data->ptr,offset,DOUBLE_ALIGN);
+ break;
+ case 'C':
+ break;
+ case 'H':
+ DLALIGN(data->ptr,offset,SHORT_ALIGN);
+ break;
+ default:
+ rb_raise(rb_eDLTypeError, "unsupported type '%c'", data->stype[i]);
+ }
+ if (data->ids[i] == id) {
+ return cary2ary((char *)data->ptr + offset, data->stype[i], data->ssize[i]);
+ }
+ switch (data->stype[i]) {
+ case 'I':
+ offset += sizeof(int) * data->ssize[i];
+ break;
+ case 'L':
+ offset += sizeof(long) * data->ssize[i];
+ break;
+ case 'P':
+ case 'S':
+ offset += sizeof(void*) * data->ssize[i];
+ break;
+ case 'F':
+ offset += sizeof(float) * data->ssize[i];
+ break;
+ case 'D':
+ offset += sizeof(double) * data->ssize[i];
+ break;
+ case 'C':
+ offset += sizeof(char) * data->ssize[i];
+ break;
+ case 'H':
+ offset += sizeof(short) * data->ssize[i];
+ break;
+ default:
+ rb_raise(rb_eDLTypeError, "unsupported type '%c'", data->stype[i]);
+ }
+ }
+ break;
+ case DLPTR_CTYPE_UNION:
+ for (i=0; i < data->ids_num; i++) {
+ if (data->ids[i] == id) {
+ return cary2ary((char *)data->ptr + offset, data->stype[i], data->ssize[i]);
+ }
+ }
+ break;
+ } /* end of switch */
+
+ rb_raise(rb_eNameError, "undefined key `%s' for %s",
+ rb_id2name(id), rb_class2name(CLASS_OF(self)));
+
+ return Qnil;
+}
+
+static void *
+ary2cary(char t, VALUE val, long *size)
+{
+ void *ptr;
+
+ if (TYPE(val) == T_ARRAY) {
+ ptr = rb_ary2cary(t, val, size);
+ }
+ else{
+ ptr = rb_ary2cary(t, rb_ary_new3(1, val), size);
+ }
+ return ptr;
+}
+
+VALUE
+rb_dlptr_aset(int argc, VALUE argv[], VALUE self)
+{
+ VALUE key = Qnil, num = Qnil, val = Qnil;
+ ID id;
+ struct ptr_data *data;
+ int i;
+ int offset;
+ long memsize;
+ void *memimg;
+
+ rb_secure(4);
+ switch (rb_scan_args(argc, argv, "21", &key, &num, &val)) {
+ case 2:
+ val = num;
+ num = Qnil;
+ break;
+ }
+
+ if (TYPE(key) == T_FIXNUM || TYPE(key) == T_BIGNUM) {
+ void *dst, *src;
+ long len;
+
+ StringValue(val);
+ Data_Get_Struct(self, struct ptr_data, data);
+ dst = (void*)((long)(data->ptr) + DLNUM2LONG(key));
+ src = RSTRING(val)->ptr;
+ len = RSTRING(val)->len;
+ if (num == Qnil) {
+ memcpy(dst, src, len);
+ }
+ else{
+ long n = NUM2INT(num);
+ memcpy(dst, src, n < len ? n : len);
+ if (n > len) MEMZERO((char*)dst + len, char, n - len);
+ }
+ return val;
+ }
+
+ id = rb_to_id(key);
+ Data_Get_Struct(self, struct ptr_data, data);
+ switch (data->ctype) {
+ case DLPTR_CTYPE_STRUCT:
+ offset = 0;
+ for (i=0; i < data->ids_num; i++) {
+ switch (data->stype[i]) {
+ case 'I':
+ DLALIGN(data->ptr,offset,INT_ALIGN);
+ break;
+ case 'L':
+ DLALIGN(data->ptr,offset,LONG_ALIGN);
+ break;
+ case 'P':
+ case 'S':
+ DLALIGN(data->ptr,offset,VOIDP_ALIGN);
+ break;
+ case 'D':
+ DLALIGN(data->ptr,offset,DOUBLE_ALIGN);
+ break;
+ case 'F':
+ DLALIGN(data->ptr,offset,FLOAT_ALIGN);
+ break;
+ case 'C':
+ break;
+ case 'H':
+ DLALIGN(data->ptr,offset,SHORT_ALIGN);
+ break;
+ default:
+ rb_raise(rb_eDLTypeError, "unsupported type '%c'", data->stype[i]);
+ }
+ if (data->ids[i] == id) {
+ memimg = ary2cary(data->stype[i], val, &memsize);
+ memcpy((char *)data->ptr + offset, memimg, memsize);
+ dlfree(memimg);
+ return val;
+ }
+ switch (data->stype[i]) {
+ case 'I':
+ case 'i':
+ offset += sizeof(int) * data->ssize[i];
+ break;
+ case 'L':
+ case 'l':
+ offset += sizeof(long) * data->ssize[i];
+ break;
+ case 'P':
+ case 'p':
+ case 'S':
+ case 's':
+ offset += sizeof(void*) * data->ssize[i];
+ break;
+ case 'D':
+ case 'd':
+ offset += sizeof(double) * data->ssize[i];
+ break;
+ case 'F':
+ case 'f':
+ offset += sizeof(float) * data->ssize[i];
+ break;
+ case 'C':
+ case 'c':
+ offset += sizeof(char) * data->ssize[i];
+ break;
+ case 'H':
+ case 'h':
+ offset += sizeof(short) * data->ssize[i];
+ break;
+ default:
+ rb_raise(rb_eDLTypeError, "unsupported type '%c'", data->stype[i]);
+ }
+ }
+ return val;
+ /* break; */
+ case DLPTR_CTYPE_UNION:
+ for (i=0; i < data->ids_num; i++) {
+ if (data->ids[i] == id) {
+ switch (data->stype[i]) {
+ case 'I': case 'i':
+ memsize = sizeof(int) * data->ssize[i];
+ break;
+ case 'L': case 'l':
+ memsize = sizeof(long) * data->ssize[i];
+ break;
+ case 'P': case 'p':
+ case 'S': case 's':
+ memsize = sizeof(void*) * data->ssize[i];
+ break;
+ case 'F': case 'f':
+ memsize = sizeof(float) * data->ssize[i];
+ break;
+ case 'D': case 'd':
+ memsize = sizeof(double) * data->ssize[i];
+ break;
+ case 'C': case 'c':
+ memsize = sizeof(char) * data->ssize[i];
+ break;
+ case 'H': case 'h':
+ memsize = sizeof(short) * data->ssize[i];
+ break;
+ default:
+ rb_raise(rb_eDLTypeError, "unsupported type '%c'", data->stype[i]);
+ }
+ memimg = ary2cary(data->stype[i], val, NULL);
+ memcpy(data->ptr, memimg, memsize);
+ dlfree(memimg);
+ }
+ }
+ return val;
+ /* break; */
+ }
+
+ rb_raise(rb_eNameError, "undefined key `%s' for %s",
+ rb_id2name(id), rb_class2name(CLASS_OF(self)));
+
+ return Qnil;
+}
+
+VALUE
+rb_dlptr_size(int argc, VALUE argv[], VALUE self)
+{
+ VALUE size;
+
+ if (rb_scan_args(argc, argv, "01", &size) == 0){
+ return DLLONG2NUM(RDLPTR(self)->size);
+ }
+ else{
+ RDLPTR(self)->size = DLNUM2LONG(size);
+ return size;
+ }
+}
+
+static int
+dlmem_each_i(void* key, VALUE value, void* arg)
+{
+ VALUE vkey = DLLONG2NUM(key);
+ rb_yield(rb_assoc_new(vkey, value));
+ return Qnil;
+}
+
+VALUE
+rb_dlmem_each(VALUE self)
+{
+ st_foreach(st_memory_table, dlmem_each_i, 0);
+ return Qnil;
+}
+
+void
+Init_dlptr()
+{
+ rb_cDLPtrData = rb_define_class_under(rb_mDL, "PtrData", rb_cObject);
+ rb_define_alloc_func(rb_cDLPtrData, rb_dlptr_s_allocate);
+ rb_define_singleton_method(rb_cDLPtrData, "malloc", rb_dlptr_s_malloc, -1);
+ rb_define_method(rb_cDLPtrData, "initialize", rb_dlptr_initialize, -1);
+ rb_define_method(rb_cDLPtrData, "free=", rb_dlptr_free_set, 1);
+ rb_define_method(rb_cDLPtrData, "free", rb_dlptr_free_get, 0);
+ rb_define_method(rb_cDLPtrData, "to_i", rb_dlptr_to_i, 0);
+ rb_define_method(rb_cDLPtrData, "ptr", rb_dlptr_ptr, 0);
+ rb_define_method(rb_cDLPtrData, "+@", rb_dlptr_ptr, 0);
+ rb_define_method(rb_cDLPtrData, "ref", rb_dlptr_ref, 0);
+ rb_define_method(rb_cDLPtrData, "-@", rb_dlptr_ref, 0);
+ rb_define_method(rb_cDLPtrData, "null?", rb_dlptr_null_p, 0);
+ rb_define_method(rb_cDLPtrData, "to_a", rb_dlptr_to_array, -1);
+ rb_define_method(rb_cDLPtrData, "to_s", rb_dlptr_to_s, -1);
+ rb_define_method(rb_cDLPtrData, "to_str", rb_dlptr_to_str, -1);
+ rb_define_method(rb_cDLPtrData, "inspect", rb_dlptr_inspect, 0);
+ rb_define_method(rb_cDLPtrData, "<=>", rb_dlptr_cmp, 1);
+ rb_define_method(rb_cDLPtrData, "==", rb_dlptr_eql, 1);
+ rb_define_method(rb_cDLPtrData, "eql?", rb_dlptr_eql, 1);
+ rb_define_method(rb_cDLPtrData, "+", rb_dlptr_plus, 1);
+ rb_define_method(rb_cDLPtrData, "-", rb_dlptr_minus, 1);
+ rb_define_method(rb_cDLPtrData, "define_data_type",
+ rb_dlptr_define_data_type, -1);
+ rb_define_method(rb_cDLPtrData, "struct!", rb_dlptr_define_struct, -1);
+ rb_define_method(rb_cDLPtrData, "union!", rb_dlptr_define_union, -1);
+ rb_define_method(rb_cDLPtrData, "data_type", rb_dlptr_get_data_type, 0);
+ rb_define_method(rb_cDLPtrData, "[]", rb_dlptr_aref, -1);
+ rb_define_method(rb_cDLPtrData, "[]=", rb_dlptr_aset, -1);
+ rb_define_method(rb_cDLPtrData, "size", rb_dlptr_size, -1);
+ rb_define_method(rb_cDLPtrData, "size=", rb_dlptr_size, -1);
+
+ rb_mDLMemorySpace = rb_define_module_under(rb_mDL, "MemorySpace");
+ st_memory_table = st_init_numtable();
+ rb_define_const(rb_mDLMemorySpace, "MemoryTable", Qnil); /* historical */
+ rb_define_module_function(rb_mDLMemorySpace, "each", rb_dlmem_each, 0);
+}
diff --git a/ext/dl/sample/c++sample.C b/ext/dl/sample/c++sample.C
new file mode 100644
index 0000000000..d083d337a7
--- /dev/null
+++ b/ext/dl/sample/c++sample.C
@@ -0,0 +1,35 @@
+#include <stdio.h>
+
+class Person {
+private:
+ const char *name;
+ int age;
+
+public:
+ Person(const char *name, int age);
+ const char * get_name();
+ int get_age();
+ void set_age(int i);
+};
+
+Person::Person(const char *name, int age)
+ : name(name), age(age)
+{
+ /* empty */
+}
+
+const char *
+Person::get_name()
+{
+ return name;
+}
+
+int
+Person::get_age(){
+ return age;
+}
+
+void
+Person::set_age(int i){
+ age = i;
+}
diff --git a/ext/dl/sample/c++sample.rb b/ext/dl/sample/c++sample.rb
new file mode 100644
index 0000000000..29887df845
--- /dev/null
+++ b/ext/dl/sample/c++sample.rb
@@ -0,0 +1,60 @@
+=begin
+ This script shows how to deal with C++ classes using Ruby/DL.
+ You must build a dynamic loadable library using "c++sample.C"
+ to run this script as follows:
+ $ g++ -o libsample.so -shared c++sample.C
+=end
+
+require 'dl'
+require 'dl/import'
+require 'dl/struct'
+
+# Give a name of dynamic loadable library
+LIBNAME = ARGV[0] || "libsample.so"
+
+class Person
+ module Core
+ extend DL::Importable
+
+ dlload LIBNAME
+
+ # mangled symbol names
+ extern "void __6PersonPCci(void *, const char *, int)"
+ extern "const char *get_name__6Person(void *)"
+ extern "int get_age__6Person(void *)"
+ extern "void set_age__6Personi(void *, int)"
+
+ Data = struct [
+ "char *name",
+ "int age",
+ ]
+ end
+
+ def initialize(name, age)
+ @ptr = Core::Data.alloc
+ Core::__6PersonPCci(@ptr, name, age)
+ end
+
+ def get_name()
+ str = Core::get_name__6Person(@ptr)
+ if( str )
+ str.to_s
+ else
+ nil
+ end
+ end
+
+ def get_age()
+ Core::get_age__6Person(@ptr)
+ end
+
+ def set_age(age)
+ Core::set_age__6Personi(@ptr, age)
+ end
+end
+
+obj = Person.new("ttate", 1)
+p obj.get_name()
+p obj.get_age()
+obj.set_age(10)
+p obj.get_age()
diff --git a/ext/dl/sample/drives.rb b/ext/dl/sample/drives.rb
new file mode 100644
index 0000000000..8a590404b1
--- /dev/null
+++ b/ext/dl/sample/drives.rb
@@ -0,0 +1,70 @@
+# -*- ruby -*-
+# drives.rb -- find existing drives and show the drive type.
+
+require 'dl'
+require 'dl/import'
+
+module Kernel32
+ extend DL::Importable
+
+ dlload "kernel32"
+
+ extern "long GetLogicalDrives()"
+ extern "int GetDriveType(char*)"
+ extern "long GetDiskFreeSpace(char*, long ref, long ref, long ref, long ref)"
+end
+
+include Kernel32
+
+buff = Kernel32.getLogicalDrives()
+
+i = 0
+ds = []
+while( i < 26 )
+ mask = (1 << i)
+ if( buff & mask > 0 )
+ ds.push((65+i).chr)
+ end
+ i += 1
+end
+
+=begin
+From the cygwin's /usr/include/w32api/winbase.h:
+#define DRIVE_UNKNOWN 0
+#define DRIVE_NO_ROOT_DIR 1
+#define DRIVE_REMOVABLE 2
+#define DRIVE_FIXED 3
+#define DRIVE_REMOTE 4
+#define DRIVE_CDROM 5
+#define DRIVE_RAMDISK 6
+=end
+
+types = [
+ "unknown",
+ "no root dir",
+ "Removable",
+ "Fixed",
+ "Remote",
+ "CDROM",
+ "RAM",
+]
+print("Drive : Type (Free Space/Available Space)\n")
+ds.each{|d|
+ t = Kernel32.getDriveType(d + ":\\")
+ Kernel32.getDiskFreeSpace(d + ":\\", 0, 0, 0, 0)
+ _,sec_per_clus,byte_per_sec,free_clus,total_clus = Kernel32._args_
+ fbytes = sec_per_clus * byte_per_sec * free_clus
+ tbytes = sec_per_clus * byte_per_sec * total_clus
+ unit = "B"
+ if( fbytes > 1024 && tbytes > 1024 )
+ fbytes = fbytes / 1024
+ tbytes = tbytes / 1024
+ unit = "K"
+ end
+ if( fbytes > 1024 && tbytes > 1024 )
+ fbytes = fbytes / 1024
+ tbytes = tbytes / 1024
+ unit = "M"
+ end
+ print("#{d} : #{types[t]} (#{fbytes} #{unit}/#{tbytes} #{unit})\n")
+}
diff --git a/ext/dl/sample/getch.rb b/ext/dl/sample/getch.rb
new file mode 100644
index 0000000000..3f7261c979
--- /dev/null
+++ b/ext/dl/sample/getch.rb
@@ -0,0 +1,5 @@
+require 'dl'
+
+crtdll = DL::dlopen("crtdll")
+getch = crtdll['_getch', 'L']
+print(getch.call, "\n")
diff --git a/ext/dl/sample/libc.rb b/ext/dl/sample/libc.rb
new file mode 100644
index 0000000000..a1f6fbe543
--- /dev/null
+++ b/ext/dl/sample/libc.rb
@@ -0,0 +1,69 @@
+require "dl/import"
+require "dl/struct"
+
+module LIBC
+ extend DL::Importable
+
+ begin
+ dlload "libc.so.6"
+ rescue
+ dlload "libc.so.5"
+ end
+
+ extern "int atoi(char*)"
+ extern "ibool isdigit(int)"
+ extern "int gettimeofday(struct timeval *, struct timezone *)"
+ extern "char* strcat(char*, char*)"
+ extern "FILE* fopen(char*, char*)"
+ extern "int fclose(FILE*)"
+ extern "int fgetc(FILE*)"
+ extern "int strlen(char*)"
+ extern "void qsort(void*, int, int, void*)"
+
+ def str_qsort(ary, comp)
+ len = ary.length
+ r,rs = qsort(ary, len, DL.sizeof('P'), comp)
+ return rs[0].to_a('S', len)
+ end
+
+ Timeval = struct [
+ "long tv_sec",
+ "long tv_usec",
+ ]
+
+ Timezone = struct [
+ "int tz_minuteswest",
+ "int tz_dsttime",
+ ]
+
+ def my_compare(ptr1, ptr2)
+ ptr1.ptr.to_s <=> ptr2.ptr.to_s
+ end
+ COMPARE = callback("int my_compare(char**, char**)")
+end
+
+
+$cb1 = DL.callback('IPP'){|ptr1, ptr2|
+ str1 = ptr1.ptr.to_s
+ str2 = ptr2.ptr.to_s
+ str1 <=> str2
+}
+
+p LIBC.atoi("10")
+
+p LIBC.isdigit(?1)
+
+p LIBC.isdigit(?a)
+
+p LIBC.strcat("a", "b")
+
+ary = ["a","c","b"]
+ptr = ary.to_ptr
+LIBC.qsort(ptr, ary.length, DL.sizeof('P'), LIBC::COMPARE)
+p ptr.to_a('S', ary.length)
+
+tv = LIBC::Timeval.malloc
+tz = LIBC::Timezone.malloc
+LIBC.gettimeofday(tv, tz)
+
+p Time.at(tv.tv_sec)
diff --git a/ext/dl/sample/msgbox.rb b/ext/dl/sample/msgbox.rb
new file mode 100644
index 0000000000..091e646091
--- /dev/null
+++ b/ext/dl/sample/msgbox.rb
@@ -0,0 +1,19 @@
+# This script works on Windows.
+
+require 'dl'
+
+User32 = DL.dlopen("user32")
+Kernel32 = DL.dlopen("kernel32")
+
+MB_OK = 0
+MB_OKCANCEL = 1
+
+message_box = User32['MessageBoxA', 'ILSSI']
+r,rs = message_box.call(0, 'ok?', 'error', MB_OKCANCEL)
+
+case r
+when 1
+ print("OK!\n")
+when 2
+ print("Cancel!\n")
+end
diff --git a/ext/dl/sample/msgbox2.rb b/ext/dl/sample/msgbox2.rb
new file mode 100644
index 0000000000..e49846cc5e
--- /dev/null
+++ b/ext/dl/sample/msgbox2.rb
@@ -0,0 +1,18 @@
+# This script works on Windows.
+
+require 'dl/win32'
+
+MB_OK = 0
+MB_OKCANCEL = 1
+
+message_box = Win32API.new("user32",'MessageBoxA', 'ISSI', 'I')
+r = message_box.call(0, 'ok?', 'error', MB_OKCANCEL)
+
+case r
+when 1
+ print("OK!\n")
+when 2
+ print("Cancel!\n")
+else
+ p r
+end
diff --git a/ext/dl/sample/stream.rb b/ext/dl/sample/stream.rb
new file mode 100644
index 0000000000..179836999d
--- /dev/null
+++ b/ext/dl/sample/stream.rb
@@ -0,0 +1,87 @@
+# -*- ruby -*-
+# Display a file name and stream names of a file with those size.
+
+require 'dl'
+require 'dl/import'
+
+module NTFS
+ extend DL::Importable
+
+ dlload "kernel32.dll"
+
+ OPEN_EXISTING = 3
+ GENERIC_READ = 0x80000000
+ BACKUP_DATA = 0x00000001
+ BACKUP_ALTERNATE_DATA = 0x00000004
+ FILE_SHARE_READ = 0x00000001
+ FILE_FLAG_BACKUP_SEMANTICS = 0x02000000
+
+ typealias "LPSECURITY_ATTRIBUTES", "void*"
+
+ extern "BOOL BackupRead(HANDLE, PBYTE, DWORD, PDWORD, BOOL, BOOL, PVOID)"
+ extern "BOOL BackupSeek(HANDLE, DWORD, DWORD, PDWORD, PDWORD, PVOID)"
+ extern "BOOL CloseHandle(HANDLE)"
+ extern "HANDLE CreateFile(LPCSTR, DWORD, DWORD, LPSECURITY_ATTRIBUTES,
+ DWORD, DWORD, HANDLE)"
+
+ module_function
+
+ def streams(filename)
+ status = []
+ h = createFile(filename,GENERIC_READ,FILE_SHARE_READ,nil,
+ OPEN_EXISTING,FILE_FLAG_BACKUP_SEMANTICS,0)
+ if( h != 0 )
+ begin
+ # allocate the memory for backup data used in backupRead().
+ data = DL.malloc(DL.sizeof("L5"))
+ data.struct!("LLLLL", :id, :attrs, :size_low, :size_high, :name_size)
+
+ # allocate memories for references to long values used in backupRead().
+ context = DL.malloc(DL.sizeof("L"))
+ lval = DL.malloc(DL.sizeof("L"))
+
+ while( backupRead(h, data, data.size, lval, false, false, context) )
+ size = data[:size_low] + (data[:size_high] << (DL.sizeof("I") * 8))
+ case data[:id]
+ when BACKUP_ALTERNATE_DATA
+ stream_name = DL.malloc(data[:name_size])
+ backupRead(h, stream_name, stream_name.size,
+ lval, false, false, context)
+ name = stream_name[0, stream_name.size]
+ name.tr!("\000","")
+ if( name =~ /^:(.*?):.*$/ )
+ status.push([$1,size])
+ end
+ when BACKUP_DATA
+ status.push([nil,size])
+ else
+ raise(RuntimeError, "unknown data type #{data[:id]}.")
+ end
+ l1 = DL.malloc(DL.sizeof("L"))
+ l2 = DL.malloc(DL.sizeof("L"))
+ if( !backupSeek(h, data[:size_low], data[:size_high], l1, l2, context) )
+ break
+ end
+ end
+ ensure
+ backupRead(h, nil, 0, lval, true, false, context)
+ closeHandle(h)
+ end
+ return status
+ else
+ raise(RuntimeError, "can't open #{filename}.\n")
+ end
+ end
+end
+
+ARGV.each{|filename|
+ if( File.exist?(filename) )
+ NTFS.streams(filename).each{|name,size|
+ if( name )
+ print("#{filename}:#{name}\t#{size}bytes\n")
+ else
+ print("#{filename}\t#{size}bytes\n")
+ end
+ }
+ end
+}
diff --git a/ext/dl/sym.c b/ext/dl/sym.c
new file mode 100644
index 0000000000..933fb7f4f0
--- /dev/null
+++ b/ext/dl/sym.c
@@ -0,0 +1,993 @@
+/* -*- C -*-
+ * $Id$
+ */
+
+#include <ruby.h>
+#include <errno.h>
+#include "dl.h"
+
+VALUE rb_cDLSymbol;
+
+static const char *
+char2type(int ch)
+{
+ switch (ch) {
+ case '0':
+ return "void";
+ case 'P':
+ return "void *";
+ case 'p':
+ return "void *";
+ case 'C':
+ return "char";
+ case 'c':
+ return "char *";
+ case 'H':
+ return "short";
+ case 'h':
+ return "short *";
+ case 'I':
+ return "int";
+ case 'i':
+ return "int *";
+ case 'L':
+ return "long";
+ case 'l':
+ return "long *";
+ case 'F':
+ return "double";
+ case 'f':
+ return "double *";
+ case 'D':
+ return "double";
+ case 'd':
+ return "double *";
+ case 'S':
+ return "const char *";
+ case 's':
+ return "char *";
+ case 'A':
+ return "[]";
+ case 'a':
+ return "[]"; /* ?? */
+ }
+ return NULL;
+}
+
+void
+dlsym_free(struct sym_data *data)
+{
+ if( data->name ){
+ DEBUG_CODE({
+ printf("dlsym_free(): free(data->name:%s)\n",data->name);
+ });
+ free(data->name);
+ }
+ if( data->type ){
+ DEBUG_CODE({
+ printf("dlsym_free(): free(data->type:%s)\n",data->type);
+ });
+ free(data->type);
+ }
+}
+
+VALUE
+rb_dlsym_new(void (*func)(), const char *name, const char *type)
+{
+ VALUE val;
+ struct sym_data *data;
+ const char *ptype;
+
+ rb_secure(4);
+ if( !type || !type[0] ){
+ return rb_dlptr_new((void*)func, 0, 0);
+ }
+
+ for( ptype = type; *ptype; ptype ++ ){
+ if( ! char2type(*ptype) ){
+ rb_raise(rb_eDLTypeError, "unknown type specifier '%c'", *ptype);
+ }
+ }
+
+ if( func ){
+ val = Data_Make_Struct(rb_cDLSymbol, struct sym_data, 0, dlsym_free, data);
+ data->func = func;
+ data->name = name ? strdup(name) : NULL;
+ data->type = type ? strdup(type) : NULL;
+ data->len = type ? strlen(type) : 0;
+#if !(defined(DLSTACK))
+ if( data->len - 1 > MAX_ARG ){
+ rb_raise(rb_eDLError, "maximum number of arguments is %d.", MAX_ARG);
+ }
+#endif
+ }
+ else{
+ val = Qnil;
+ }
+
+ return val;
+}
+
+freefunc_t
+rb_dlsym2csym(VALUE val)
+{
+ struct sym_data *data;
+ freefunc_t func;
+
+ if( rb_obj_is_kind_of(val, rb_cDLSymbol) ){
+ Data_Get_Struct(val, struct sym_data, data);
+ func = data->func;
+ }
+ else if( val == Qnil ){
+ func = NULL;
+ }
+ else{
+ rb_raise(rb_eTypeError, "DL::Symbol was expected");
+ }
+
+ return func;
+}
+
+VALUE
+rb_dlsym_s_allocate(VALUE klass)
+{
+ VALUE obj;
+ struct sym_data *data;
+
+ obj = Data_Make_Struct(klass, struct sym_data, 0, dlsym_free, data);
+ data->func = 0;
+ data->name = 0;
+ data->type = 0;
+ data->len = 0;
+
+ return obj;
+}
+
+VALUE
+rb_dlsym_initialize(int argc, VALUE argv[], VALUE self)
+{
+ VALUE addr, name, type;
+ struct sym_data *data;
+ void *saddr;
+ const char *sname, *stype;
+
+ rb_scan_args(argc, argv, "12", &addr, &name, &type);
+
+ saddr = (void*)(DLNUM2LONG(rb_Integer(addr)));
+ if (!NIL_P(name)) StringValue(name);
+ stype = NIL_P(type) ? NULL : StringValuePtr(type);
+ sname = NIL_P(name) ? NULL : RSTRING(name)->ptr;
+
+ if( saddr ){
+ Data_Get_Struct(self, struct sym_data, data);
+ if( data->name ) free(data->name);
+ if( data->type ) free(data->type);
+ data->func = saddr;
+ data->name = sname ? strdup(sname) : 0;
+ data->type = stype ? strdup(stype) : 0;
+ data->len = stype ? strlen(stype) : 0;
+ }
+
+ return Qnil;
+}
+
+VALUE
+rb_s_dlsym_char2type(VALUE self, VALUE ch)
+{
+ const char *type;
+
+ type = char2type(StringValuePtr(ch)[0]);
+
+ if (type == NULL)
+ return Qnil;
+ else
+ return rb_str_new2(type);
+}
+
+VALUE
+rb_dlsym_name(VALUE self)
+{
+ struct sym_data *sym;
+
+ Data_Get_Struct(self, struct sym_data, sym);
+ return sym->name ? rb_tainted_str_new2(sym->name) : Qnil;
+}
+
+VALUE
+rb_dlsym_proto(VALUE self)
+{
+ struct sym_data *sym;
+
+ Data_Get_Struct(self, struct sym_data, sym);
+ return sym->type ? rb_tainted_str_new2(sym->type) : Qnil;
+}
+
+VALUE
+rb_dlsym_cproto(VALUE self)
+{
+ struct sym_data *sym;
+ const char *ptype, *typestr;
+ size_t len;
+ VALUE val;
+
+ Data_Get_Struct(self, struct sym_data, sym);
+
+ ptype = sym->type;
+
+ if( ptype ){
+ typestr = char2type(*ptype++);
+ len = strlen(typestr);
+
+ val = rb_tainted_str_new(typestr, len);
+ if (typestr[len - 1] != '*')
+ rb_str_cat(val, " ", 1);
+
+ if( sym->name ){
+ rb_str_cat2(val, sym->name);
+ }
+ else{
+ rb_str_cat2(val, "(null)");
+ }
+ rb_str_cat(val, "(", 1);
+
+ while (*ptype) {
+ const char *ty = char2type(*ptype++);
+ rb_str_cat2(val, ty);
+ if (*ptype)
+ rb_str_cat(val, ", ", 2);
+ }
+
+ rb_str_cat(val, ");", 2);
+ }
+ else{
+ val = rb_tainted_str_new2("void (");
+ if( sym->name ){
+ rb_str_cat2(val, sym->name);
+ }
+ else{
+ rb_str_cat2(val, "(null)");
+ }
+ rb_str_cat2(val, ")()");
+ }
+
+ return val;
+}
+
+VALUE
+rb_dlsym_inspect(VALUE self)
+{
+ VALUE proto;
+ VALUE val;
+ char *str;
+ int str_size;
+ struct sym_data *sym;
+
+ Data_Get_Struct(self, struct sym_data, sym);
+ proto = rb_dlsym_cproto(self);
+
+ str_size = RSTRING(proto)->len + 100;
+ str = dlmalloc(str_size);
+ snprintf(str, str_size - 1,
+ "#<DL::Symbol:0x%lx func=0x%lx '%s'>",
+ sym, sym->func, RSTRING(proto)->ptr);
+ val = rb_tainted_str_new2(str);
+ dlfree(str);
+
+ return val;
+}
+
+static int
+stack_size(struct sym_data *sym)
+{
+ int i;
+ int size;
+
+ size = 0;
+ for( i=1; i < sym->len; i++ ){
+ switch(sym->type[i]){
+ case 'C':
+ case 'H':
+ case 'I':
+ case 'L':
+ size += sizeof(long);
+ break;
+ case 'F':
+ size += sizeof(float);
+ break;
+ case 'D':
+ size += sizeof(double);
+ break;
+ case 'c':
+ case 'h':
+ case 'i':
+ case 'l':
+ case 'f':
+ case 'd':
+ case 'p':
+ case 'P':
+ case 's':
+ case 'S':
+ case 'a':
+ case 'A':
+ size += sizeof(void*);
+ break;
+ default:
+ return -(sym->type[i]);
+ }
+ }
+ return size;
+}
+
+static ID rb_dl_id_DLErrno;
+
+static VALUE
+rb_dl_get_last_error(VALUE self)
+{
+ return rb_thread_local_aref(rb_thread_current(), rb_dl_id_DLErrno);
+}
+
+static VALUE
+rb_dl_set_last_error(VALUE self, VALUE val)
+{
+ errno = NUM2INT(val);
+ rb_thread_local_aset(rb_thread_current(), rb_dl_id_DLErrno, val);
+ return Qnil;
+}
+
+#ifdef HAVE_WINDOWS_H
+#include <windows.h>
+static ID rb_dl_id_DLW32Error;
+
+static VALUE
+rb_dl_win32_get_last_error(VALUE self)
+{
+ return rb_thread_local_aref(rb_thread_current(), rb_dl_id_DLW32Error);
+}
+
+static VALUE
+rb_dl_win32_set_last_error(VALUE self, VALUE val)
+{
+ SetLastError(NUM2INT(val));
+ rb_thread_local_aset(rb_thread_current(), rb_dl_id_DLW32Error, val);
+ return Qnil;
+}
+#endif
+
+#ifdef DLSTACK_GUARD
+# ifdef __MSVC_RUNTIME_CHECKS
+# pragma runtime_checks("s", off)
+# endif
+# if _MSC_VER >= 1300
+__declspec(noinline)
+# endif
+static int
+rb_dlsym_guardcall(char type, ANY_TYPE *ret, long *stack, void *func)
+{
+ char *volatile guard = ALLOCA_N(char, 1); /* guard stack pointer */
+ switch(type){
+ case '0':
+ {
+ void (*f)(DLSTACK_PROTO) = func;
+ f(DLSTACK_ARGS);
+ }
+ break;
+ case 'P':
+ case 'p':
+ {
+ void * (*f)(DLSTACK_PROTO) = func;
+ ret->p = f(DLSTACK_ARGS);
+ }
+ break;
+ case 'C':
+ case 'c':
+ {
+ char (*f)(DLSTACK_PROTO) = func;
+ ret->c = f(DLSTACK_ARGS);
+ }
+ break;
+ case 'H':
+ case 'h':
+ {
+ short (*f)(DLSTACK_PROTO) = func;
+ ret->h = f(DLSTACK_ARGS);
+ }
+ break;
+ case 'I':
+ case 'i':
+ {
+ int (*f)(DLSTACK_PROTO) = func;
+ ret->i = f(DLSTACK_ARGS);
+ }
+ break;
+ case 'L':
+ case 'l':
+ {
+ long (*f)(DLSTACK_PROTO) = func;
+ ret->l = f(DLSTACK_ARGS);
+ }
+ break;
+ case 'F':
+ case 'f':
+ {
+ float (*f)(DLSTACK_PROTO) = func;
+ ret->f = f(DLSTACK_ARGS);
+ }
+ break;
+ case 'D':
+ case 'd':
+ {
+ double (*f)(DLSTACK_PROTO) = func;
+ ret->d = f(DLSTACK_ARGS);
+ }
+ break;
+ case 'S':
+ case 's':
+ {
+ char * (*f)(DLSTACK_PROTO) = func;
+ ret->s = f(DLSTACK_ARGS);
+ }
+ break;
+ default:
+ return 0;
+ }
+ return 1;
+}
+# ifdef __MSVC_RUNTIME_CHECKS
+# pragma runtime_checks("s", restore)
+# endif
+#endif /* defined(DLSTACK_GUARD) */
+
+VALUE
+rb_dlsym_call(int argc, VALUE argv[], VALUE self)
+{
+ struct sym_data *sym;
+ ANY_TYPE *args;
+ ANY_TYPE *dargs;
+ ANY_TYPE ret;
+ int *dtypes;
+ VALUE val;
+ VALUE dvals;
+ int i;
+ long ftype;
+ void *func;
+
+ rb_secure_update(self);
+ Data_Get_Struct(self, struct sym_data, sym);
+ DEBUG_CODE({
+ printf("rb_dlsym_call(): type = '%s', func = 0x%x\n", sym->type, sym->func);
+ });
+ if( (sym->len - 1) != argc ){
+ rb_raise(rb_eArgError, "%d arguments are needed", sym->len - 1);
+ }
+
+ ftype = 0;
+ dvals = Qnil;
+
+ args = ALLOC_N(ANY_TYPE, sym->len - 1);
+ dargs = ALLOC_N(ANY_TYPE, sym->len - 1);
+ dtypes = ALLOC_N(int, sym->len - 1);
+#define FREE_ARGS {xfree(args); xfree(dargs); xfree(dtypes);}
+
+ for( i = sym->len - 2; i >= 0; i-- ){
+ dtypes[i] = 0;
+
+ switch( sym->type[i+1] ){
+ case 'p':
+ dtypes[i] = 'p';
+ case 'P':
+ {
+ struct ptr_data *data;
+ VALUE pval;
+
+ if( argv[i] == Qnil ){
+ ANY2P(args[i]) = DLVOIDP(0);
+ }
+ else{
+ if( rb_obj_is_kind_of(argv[i], rb_cDLPtrData) ){
+ pval = argv[i];
+ }
+ else{
+ pval = rb_funcall(argv[i], rb_intern("to_ptr"), 0);
+ if( !rb_obj_is_kind_of(pval, rb_cDLPtrData) ){
+ rb_raise(rb_eDLTypeError, "unexpected type of argument #%d", i);
+ }
+ }
+ rb_check_safe_obj(pval);
+ Data_Get_Struct(pval, struct ptr_data, data);
+ ANY2P(args[i]) = DLVOIDP(data->ptr);
+ }
+ }
+ PUSH_P(ftype);
+ break;
+ case 'a':
+ dtypes[i] = 'a';
+ case 'A':
+ if( argv[i] == Qnil ){
+ ANY2P(args[i]) = DLVOIDP(0);
+ }
+ else{
+ ANY2P(args[i]) = DLVOIDP(rb_ary2cary(0, argv[i], NULL));
+ }
+ PUSH_P(ftype);
+ break;
+ case 'C':
+ ANY2C(args[i]) = DLCHAR(NUM2CHR(argv[i]));
+ PUSH_C(ftype);
+ break;
+ case 'c':
+ ANY2C(dargs[i]) = DLCHAR(NUM2CHR(argv[i]));
+ ANY2P(args[i]) = DLVOIDP(&(ANY2C(dargs[i])));
+ dtypes[i] = 'c';
+ PUSH_P(ftype);
+ break;
+ case 'H':
+ ANY2H(args[i]) = DLSHORT(NUM2INT(argv[i]));
+ PUSH_C(ftype);
+ break;
+ case 'h':
+ ANY2H(dargs[i]) = DLSHORT(NUM2INT(argv[i]));
+ ANY2P(args[i]) = DLVOIDP(&(ANY2H(dargs[i])));
+ dtypes[i] = 'h';
+ PUSH_P(ftype);
+ break;
+ case 'I':
+ ANY2I(args[i]) = DLINT(NUM2INT(argv[i]));
+ PUSH_I(ftype);
+ break;
+ case 'i':
+ ANY2I(dargs[i]) = DLINT(NUM2INT(argv[i]));
+ ANY2P(args[i]) = DLVOIDP(&(ANY2I(dargs[i])));
+ dtypes[i] = 'i';
+ PUSH_P(ftype);
+ break;
+ case 'L':
+ ANY2L(args[i]) = DLNUM2LONG(argv[i]);
+ PUSH_L(ftype);
+ break;
+ case 'l':
+ ANY2L(dargs[i]) = DLNUM2LONG(argv[i]);
+ ANY2P(args[i]) = DLVOIDP(&(ANY2L(dargs[i])));
+ dtypes[i] = 'l';
+ PUSH_P(ftype);
+ break;
+ case 'F':
+ Check_Type(argv[i], T_FLOAT);
+ ANY2F(args[i]) = DLFLOAT(RFLOAT(argv[i])->value);
+ PUSH_F(ftype);
+ break;
+ case 'f':
+ Check_Type(argv[i], T_FLOAT);
+ ANY2F(dargs[i]) = DLFLOAT(RFLOAT(argv[i])->value);
+ ANY2P(args[i]) = DLVOIDP(&(ANY2F(dargs[i])));
+ dtypes[i] = 'f';
+ PUSH_P(ftype);
+ break;
+ case 'D':
+ Check_Type(argv[i], T_FLOAT);
+ ANY2D(args[i]) = RFLOAT(argv[i])->value;
+ PUSH_D(ftype);
+ break;
+ case 'd':
+ Check_Type(argv[i], T_FLOAT);
+ ANY2D(dargs[i]) = RFLOAT(argv[i])->value;
+ ANY2P(args[i]) = DLVOIDP(&(ANY2D(dargs[i])));
+ dtypes[i] = 'd';
+ PUSH_P(ftype);
+ break;
+ case 'S':
+ if( argv[i] == Qnil ){
+ ANY2S(args[i]) = DLSTR(0);
+ }
+ else{
+ VALUE str = argv[i];
+ SafeStringValue(str);
+ ANY2S(args[i]) = DLSTR(RSTRING(str)->ptr);
+ }
+ PUSH_P(ftype);
+ break;
+ case 's':
+ {
+ VALUE str = argv[i];
+ SafeStringValue(str);
+ ANY2S(args[i]) = DLSTR(dlmalloc(RSTRING(str)->len + 1));
+ memcpy((char*)(ANY2S(args[i])), RSTRING(str)->ptr, RSTRING(str)->len + 1);
+ dtypes[i] = 's';
+ }
+ PUSH_P(ftype);
+ break;
+ default:
+ FREE_ARGS;
+ rb_raise(rb_eDLTypeError,
+ "unknown type '%c' of the return value.",
+ sym->type[i+1]);
+ }
+ }
+
+ switch( sym->type[0] ){
+ case '0':
+ PUSH_0(ftype);
+ break;
+ case 'P':
+ case 'p':
+ case 'S':
+ case 's':
+ case 'A':
+ case 'a':
+ PUSH_P(ftype);
+ break;
+ case 'C':
+ case 'c':
+ PUSH_C(ftype);
+ break;
+ case 'H':
+ case 'h':
+ PUSH_H(ftype);
+ break;
+ case 'I':
+ case 'i':
+ PUSH_I(ftype);
+ break;
+ case 'L':
+ case 'l':
+ PUSH_L(ftype);
+ break;
+ case 'F':
+ case 'f':
+ PUSH_F(ftype);
+ break;
+ case 'D':
+ case 'd':
+ PUSH_D(ftype);
+ break;
+ default:
+ FREE_ARGS;
+ rb_raise(rb_eDLTypeError,
+ "unknown type `%c' of the return value.",
+ sym->type[0]);
+ }
+
+ func = sym->func;
+
+#if defined(DLSTACK)
+ {
+#if defined(DLSTACK_SIZE)
+ int stk_size;
+ long stack[DLSTACK_SIZE];
+ long *sp;
+
+ sp = stack;
+ stk_size = stack_size(sym);
+ if( stk_size < 0 ){
+ FREE_ARGS;
+ rb_raise(rb_eDLTypeError, "unknown type '%c'.", -stk_size);
+ }
+ else if( stk_size > (int)(DLSTACK_SIZE) ){
+ FREE_ARGS;
+ rb_raise(rb_eArgError, "too many arguments.");
+ }
+#endif
+
+ DLSTACK_START(sym);
+
+#if defined(DLSTACK_REVERSE)
+ for( i = sym->len - 2; i >= 0; i-- )
+#else
+ for( i = 0; i <= sym->len -2; i++ )
+#endif
+ {
+ switch( sym->type[i+1] ){
+ case 'p':
+ case 'P':
+ DLSTACK_PUSH_P(ANY2P(args[i]));
+ break;
+ case 'a':
+ case 'A':
+ DLSTACK_PUSH_P(ANY2P(args[i]));
+ break;
+ case 'C':
+ DLSTACK_PUSH_C(ANY2C(args[i]));
+ break;
+ case 'c':
+ DLSTACK_PUSH_P(ANY2P(args[i]));
+ break;
+ case 'H':
+ DLSTACK_PUSH_H(ANY2H(args[i]));
+ break;
+ case 'h':
+ DLSTACK_PUSH_P(ANY2P(args[i]));
+ break;
+ case 'I':
+ DLSTACK_PUSH_I(ANY2I(args[i]));
+ break;
+ case 'i':
+ DLSTACK_PUSH_P(ANY2P(args[i]));
+ break;
+ case 'L':
+ DLSTACK_PUSH_L(ANY2L(args[i]));
+ break;
+ case 'l':
+ DLSTACK_PUSH_P(ANY2P(args[i]));
+ break;
+ case 'F':
+ DLSTACK_PUSH_F(ANY2F(args[i]));
+ break;
+ case 'f':
+ DLSTACK_PUSH_P(ANY2P(args[i]));
+ break;
+ case 'D':
+ DLSTACK_PUSH_D(ANY2D(args[i]));
+ break;
+ case 'd':
+ DLSTACK_PUSH_P(ANY2P(args[i]));
+ break;
+ case 'S':
+ case 's':
+ DLSTACK_PUSH_P(ANY2S(args[i]));
+ break;
+ }
+ }
+ DLSTACK_END(sym->type);
+
+#ifdef DLSTACK_GUARD
+ if(!rb_dlsym_guardcall(sym->type[0], &ret, stack, func)) {
+ FREE_ARGS;
+ rb_raise(rb_eDLTypeError, "unknown type `%c'", sym->type[0]);
+ }
+#else /* defined(DLSTACK_GUARD) */
+ {
+ switch( sym->type[0] ){
+ case '0':
+ {
+ void (*f)(DLSTACK_PROTO) = func;
+ f(DLSTACK_ARGS);
+ }
+ break;
+ case 'P':
+ case 'p':
+ {
+ void * (*f)(DLSTACK_PROTO) = func;
+ ret.p = f(DLSTACK_ARGS);
+ }
+ break;
+ case 'C':
+ case 'c':
+ {
+ char (*f)(DLSTACK_PROTO) = func;
+ ret.c = f(DLSTACK_ARGS);
+ }
+ break;
+ case 'H':
+ case 'h':
+ {
+ short (*f)(DLSTACK_PROTO) = func;
+ ret.h = f(DLSTACK_ARGS);
+ }
+ break;
+ case 'I':
+ case 'i':
+ {
+ int (*f)(DLSTACK_PROTO) = func;
+ ret.i = f(DLSTACK_ARGS);
+ }
+ break;
+ case 'L':
+ case 'l':
+ {
+ long (*f)(DLSTACK_PROTO) = func;
+ ret.l = f(DLSTACK_ARGS);
+ }
+ break;
+ case 'F':
+ case 'f':
+ {
+ float (*f)(DLSTACK_PROTO) = func;
+ ret.f = f(DLSTACK_ARGS);
+ }
+ break;
+ case 'D':
+ case 'd':
+ {
+ double (*f)(DLSTACK_PROTO) = func;
+ ret.d = f(DLSTACK_ARGS);
+ }
+ break;
+ case 'S':
+ case 's':
+ {
+ char * (*f)(DLSTACK_PROTO) = func;
+ ret.s = f(DLSTACK_ARGS);
+ }
+ break;
+ default:
+ FREE_ARGS;
+ rb_raise(rb_eDLTypeError, "unknown type `%c'", sym->type[0]);
+ }
+ }
+#endif /* defubed(DLSTACK_GUARD) */
+
+ {
+ /*
+ * We should get the value of errno/GetLastError() before calling another functions.
+ */
+ int last_errno = errno;
+#ifdef _WIN32
+ DWORD win32_last_err = GetLastError();
+#endif
+
+ rb_thread_local_aset(rb_thread_current(), rb_dl_id_DLErrno, INT2NUM(last_errno));
+#ifdef _WIN32
+ rb_thread_local_aset(rb_thread_current(), rb_dl_id_DLW32Error, INT2NUM(win32_last_err));
+#endif
+ }
+
+ }
+#else /* defined(DLSTACK) */
+ switch(ftype){
+#include "call.func"
+ default:
+ FREE_ARGS;
+ rb_raise(rb_eDLTypeError, "unsupported function type `%s'", sym->type);
+ }
+#endif /* defined(DLSTACK) */
+
+ switch( sym->type[0] ){
+ case '0':
+ val = Qnil;
+ break;
+ case 'P':
+ val = rb_dlptr_new((void*)(ANY2P(ret)), 0, 0);
+ break;
+ case 'p':
+ val = rb_dlptr_new((void*)(ANY2P(ret)), 0, dlfree);
+ break;
+ case 'C':
+ case 'c':
+ val = CHR2FIX((char)(ANY2C(ret)));
+ break;
+ case 'H':
+ case 'h':
+ val = INT2NUM((short)(ANY2H(ret)));
+ break;
+ case 'I':
+ case 'i':
+ val = INT2NUM((int)(ANY2I(ret)));
+ break;
+ case 'L':
+ case 'l':
+ val = DLLONG2NUM((long)(ANY2L(ret)));
+ break;
+ case 'F':
+ case 'f':
+ val = rb_float_new((double)(ANY2F(ret)));
+ break;
+ case 'D':
+ case 'd':
+ val = rb_float_new((double)(ANY2D(ret)));
+ break;
+ case 'S':
+ if( ANY2S(ret) ){
+ val = rb_tainted_str_new2((char*)(ANY2S(ret)));
+ }
+ else{
+ val = Qnil;
+ }
+ break;
+ case 's':
+ if( ANY2S(ret) ){
+ val = rb_tainted_str_new2((char*)(ANY2S(ret)));
+ DEBUG_CODE({
+ printf("dlfree(%s)\n",(char*)(ANY2S(ret)));
+ });
+ dlfree((void*)(ANY2S(ret)));
+ }
+ else{
+ val = Qnil;
+ }
+ break;
+ default:
+ FREE_ARGS;
+ rb_raise(rb_eDLTypeError, "unknown type `%c'", sym->type[0]);
+ }
+
+ dvals = rb_ary_new();
+ for( i = 0; i <= sym->len - 2; i++ ){
+ if( dtypes[i] ){
+ switch( dtypes[i] ){
+ case 'c':
+ rb_ary_push(dvals, CHR2FIX(*((char*)(ANY2P(args[i])))));
+ break;
+ case 'h':
+ rb_ary_push(dvals, INT2NUM(*((short*)(ANY2P(args[i])))));
+ break;
+ case 'i':
+ rb_ary_push(dvals, INT2NUM(*((int*)(ANY2P(args[i])))));
+ break;
+ case 'l':
+ rb_ary_push(dvals, DLLONG2NUM(*((long*)(ANY2P(args[i])))));
+ break;
+ case 'f':
+ rb_ary_push(dvals, rb_float_new(*((float*)(ANY2P(args[i])))));
+ break;
+ case 'd':
+ rb_ary_push(dvals, rb_float_new(*((double*)(ANY2P(args[i])))));
+ break;
+ case 'p':
+ rb_ary_push(dvals, rb_dlptr_new((void*)(ANY2P(args[i])), 0, 0));
+ break;
+ case 'a':
+ rb_ary_push(dvals, rb_dlptr_new((void*)ANY2P(args[i]), 0, 0));
+ break;
+ case 's':
+ rb_ary_push(dvals, rb_tainted_str_new2((char*)ANY2S(args[i])));
+ DEBUG_CODE({
+ printf("dlfree(%s)\n",(char*)ANY2S(args[i]));
+ });
+ dlfree((void*)ANY2S(args[i]));
+ break;
+ default:
+ {
+ char c = dtypes[i];
+ FREE_ARGS;
+ rb_raise(rb_eRuntimeError, "unknown argument type '%c'", i, c);
+ }
+ }
+ }
+ else{
+ switch( sym->type[i+1] ){
+ case 'A':
+ dlfree((void*)ANY2P(args[i]));
+ break;
+ }
+ rb_ary_push(dvals, argv[i]);
+ }
+ }
+
+ FREE_ARGS;
+#undef FREE_ARGS
+ return rb_assoc_new(val,dvals);
+}
+
+VALUE
+rb_dlsym_to_i(VALUE self)
+{
+ struct sym_data *sym;
+
+ Data_Get_Struct(self, struct sym_data, sym);
+ return DLLONG2NUM(sym);
+}
+
+VALUE
+rb_dlsym_to_ptr(VALUE self)
+{
+ struct sym_data *sym;
+
+ Data_Get_Struct(self, struct sym_data, sym);
+ return rb_dlptr_new(sym->func, sizeof(freefunc_t), 0);
+}
+
+void
+Init_dlsym()
+{
+ rb_cDLSymbol = rb_define_class_under(rb_mDL, "Symbol", rb_cObject);
+ rb_define_alloc_func(rb_cDLSymbol, rb_dlsym_s_allocate);
+ rb_define_singleton_method(rb_cDLSymbol, "char2type", rb_s_dlsym_char2type, 1);
+ rb_define_method(rb_cDLSymbol, "initialize", rb_dlsym_initialize, -1);
+ rb_define_method(rb_cDLSymbol, "call", rb_dlsym_call, -1);
+ rb_define_method(rb_cDLSymbol, "[]", rb_dlsym_call, -1);
+ rb_define_method(rb_cDLSymbol, "name", rb_dlsym_name, 0);
+ rb_define_method(rb_cDLSymbol, "proto", rb_dlsym_proto, 0);
+ rb_define_method(rb_cDLSymbol, "cproto", rb_dlsym_cproto, 0);
+ rb_define_method(rb_cDLSymbol, "inspect", rb_dlsym_inspect, 0);
+ rb_define_method(rb_cDLSymbol, "to_s", rb_dlsym_cproto, 0);
+ rb_define_method(rb_cDLSymbol, "to_ptr", rb_dlsym_to_ptr, 0);
+ rb_define_method(rb_cDLSymbol, "to_i", rb_dlsym_to_i, 0);
+
+ rb_dl_id_DLErrno = rb_intern("DLErrno");
+ rb_define_singleton_method(rb_mDL, "last_error", rb_dl_get_last_error, 0);
+ rb_define_singleton_method(rb_mDL, "last_error=", rb_dl_set_last_error, 1);
+#ifdef _WIN32
+ rb_dl_id_DLW32Error = rb_intern("DLW32Error");
+ rb_define_singleton_method(rb_mDL, "win32_last_error", rb_dl_win32_get_last_error, 0);
+ rb_define_singleton_method(rb_mDL, "win32_last_error=", rb_dl_win32_set_last_error, 1);
+#endif
+}
diff --git a/ext/dl/test/libtest.def b/ext/dl/test/libtest.def
new file mode 100644
index 0000000000..8ecefc917b
--- /dev/null
+++ b/ext/dl/test/libtest.def
@@ -0,0 +1,28 @@
+EXPORTS
+test_alloc_test_struct
+test_append
+test_arylen
+test_c2i
+test_call_func1
+test_callback1
+test_close
+test_d2f
+test_f2d
+test_fill_test_struct
+test_fill_test_union
+test_gets
+test_i2c
+test_init
+test_isucc
+test_lcc
+test_lsucc
+test_open
+test_strcat
+test_strlen
+test_succ
+test_data_init
+test_data_add
+test_data_aref
+test_set_long_value
+test_get_long_value
+internal_long_value
diff --git a/ext/dl/test/test.c b/ext/dl/test/test.c
new file mode 100644
index 0000000000..7321379390
--- /dev/null
+++ b/ext/dl/test/test.c
@@ -0,0 +1,247 @@
+#include <stdio.h>
+#include <string.h>
+
+static char internal_string[] = "internal_string";
+long internal_long_value = 100;
+
+struct test_struct {
+ char c;
+ long l;
+};
+
+union test_union {
+ char c;
+ int i;
+ long l;
+ void *p;
+};
+
+struct test_data {
+ char name[1024];
+ struct test_data *next;
+};
+
+long
+test_get_long_value()
+{
+ return internal_long_value;
+};
+
+void
+test_set_long_value(long l)
+{
+ internal_long_value = l;
+};
+
+void
+test_fill_test_struct(struct test_struct *ptr, char c, long l)
+{
+ ptr->c = c;
+ ptr->l = l;
+};
+
+void
+test_fill_test_union(union test_union *ptr, long l)
+{
+ ptr->l = l;
+};
+
+struct test_struct *
+test_alloc_test_struct(char c, long l)
+{
+ struct test_struct *data;
+
+ data = (struct test_struct *)malloc(sizeof(struct test_struct));
+ data->c = c;
+ data->l = l;
+
+ return data;
+};
+
+int
+test_c2i(char c)
+{
+ return (int)c;
+};
+
+char
+test_i2c(int i)
+{
+ return (char)i;
+};
+
+long
+test_lcc(char c1, char c2)
+{
+ return (long)(c1 + c2);
+};
+
+double
+test_f2d(float f)
+{
+ double d;
+ d = f;
+ return d;
+};
+
+float
+test_d2f(double d)
+{
+ float f;
+ f = d;
+ return f;
+};
+
+int
+test_strlen(const char *str)
+{
+ return strlen(str);
+};
+
+int
+test_isucc(int i)
+{
+ return (i+1);
+};
+
+long
+test_lsucc(long l)
+{
+ return (l+1);
+};
+
+void
+test_succ(long *l)
+{
+ (*l)++;
+};
+
+char *
+test_strcat(char *str1, const char *str2)
+{
+ return strcat(str1, str2);
+};
+
+int
+test_arylen(char *ary[])
+{
+ int i;
+ for( i=0; ary[i]; i++ ){};
+ return i;
+};
+
+void
+test_append(char *ary[], int len, char *astr)
+{
+ int i;
+ int size1,size2;
+ char *str;
+
+ size2 = strlen(astr);
+
+ for( i=0; i <= len - 1; i++ ){
+ size1 = strlen(ary[i]);
+ str = (char*)malloc(size1 + size2 + 1);
+ strcpy(str, ary[i]);
+ strcat(str, astr);
+ ary[i] = str;
+ };
+};
+
+int
+test_init(int *argc, char **argv[])
+{
+ int i;
+ char s[256];
+
+ for( i=0; i < (*argc); i++ ){
+ sprintf(s, "arg%d", i);
+ if( strcmp((*argv)[i], s) != 0 ){
+ return 1;
+ }
+ }
+ return 0;
+}
+
+FILE *
+test_open(const char *filename, const char *mode)
+{
+ FILE *file;
+ file = fopen(filename,mode);
+ return file;
+};
+
+void
+test_close(FILE *file)
+{
+ fclose(file);
+};
+
+char *
+test_gets(char *s, int size, FILE *f)
+{
+ return fgets(s,size,f);
+};
+
+typedef int callback1_t(int, char *);
+#define CALLBACK_MSG "callback message"
+
+int
+test_callback1(int err, const char *msg)
+{
+ if( strcmp(msg, CALLBACK_MSG) == 0 ){
+ return 1;
+ }
+ else{
+ return 0;
+ }
+}
+
+int
+test_call_func1(callback1_t *func)
+{
+ if( func ){
+ return (*func)(0, CALLBACK_MSG);
+ }
+ else{
+ return 0;
+ }
+}
+
+struct test_data *
+test_data_init()
+{
+ struct test_data *data;
+
+ data = (struct test_data *)malloc(sizeof(struct test_data));
+ data->next = NULL;
+ memset(data->name, 0, 1024);
+
+ return data;
+};
+
+void
+test_data_add(struct test_data *list, const char *name)
+{
+ struct test_data *data;
+
+ data = (struct test_data *)malloc(sizeof(struct test_data));
+ memset(data->name, 0, 1024);
+ strncpy(data->name, name, 1024);
+ data->next = list->next;
+ list->next = data;
+};
+
+struct test_data *
+test_data_aref(struct test_data *list, int i)
+{
+ struct test_data *data;
+ int j;
+
+ for( data = list->next, j=0; data; data = data->next, j++ ){
+ if( i == j ){
+ return data;
+ };
+ };
+ return NULL;
+};
diff --git a/ext/dl/test/test.rb b/ext/dl/test/test.rb
new file mode 100644
index 0000000000..bf8dfc18e3
--- /dev/null
+++ b/ext/dl/test/test.rb
@@ -0,0 +1,306 @@
+# -*- ruby -*-
+
+require 'dl'
+require 'dl/import'
+
+$FAIL = 0
+$TOTAL = 0
+
+def assert(label, ty, *conds)
+ $TOTAL += 1
+ cond = !conds.include?(false)
+ if( cond )
+ printf("succeed in `#{label}'\n")
+ else
+ $FAIL += 1
+ case ty
+ when :may
+ printf("fail in `#{label}' ... expected\n")
+ when :must
+ printf("fail in `#{label}' ... unexpected\n")
+ when :raise
+ raise(RuntimeError, "fail in `#{label}'")
+ end
+ end
+end
+
+def debug(*xs)
+ if( $DEBUG )
+ xs.each{|x|
+ p x
+ }
+ end
+end
+
+print("DLSTACK = #{DL::DLSTACK}\n")
+print("MAX_ARG = #{DL::MAX_ARG}\n")
+print("\n")
+print("DL::FREE = #{DL::FREE.inspect}\n")
+print("\n")
+
+$LIB = nil
+if( !$LIB && File.exist?("libtest.so") )
+ $LIB = "./libtest.so"
+end
+if( !$LIB && File.exist?("test/libtest.so") )
+ $LIB = "./test/libtest.so"
+end
+
+module LIBTest
+ extend DL::Importable
+
+ dlload($LIB)
+ extern "int test_c2i(char)"
+ extern "char test_i2c(int)"
+ extern "long test_lcc(char, char)"
+ extern "double test_f2d(float)"
+ extern "float test_d2f(double)"
+ extern "int test_strlen(char*)"
+ extern "int test_isucc(int)"
+ extern "long test_lsucc(long)"
+ extern "void test_succ(long *)"
+ extern "int test_arylen(int [])"
+ extern "void test_append(char*[], int, char *)"
+end
+
+DL.dlopen($LIB){|h|
+ c2i = h["test_c2i","IC"]
+ debug c2i
+ r,rs = c2i[?a]
+ debug r,rs
+ assert("c2i", :may, r == ?a)
+ assert("extern c2i", :must, r == LIBTest.test_c2i(?a))
+
+ i2c = h["test_i2c","CI"]
+ debug i2c
+ r,rs = i2c[?a]
+ debug r,rs
+ assert("i2c", :may, r == ?a)
+ assert("exern i2c", :must, r == LIBTest.test_i2c(?a))
+
+ lcc = h["test_lcc","LCC"]
+ debug lcc
+ r,rs = lcc[1,2]
+ assert("lcc", :may, r == 3)
+ assert("extern lcc", :must, r == LIBTest.test_lcc(1,2))
+
+ f2d = h["test_f2d","DF"]
+ debug f2d
+ r,rs = f2d[20.001]
+ debug r,rs
+ assert("f2d", :may, r.to_i == 20)
+ assert("extern f2d", :must, r = LIBTest.test_f2d(20.001))
+
+ d2f = h["test_d2f","FD"]
+ debug d2f
+ r,rs = d2f[20.001]
+ debug r,rs
+ assert("d2f", :may, r.to_i == 20)
+ assert("extern d2f", :must, r == LIBTest.test_d2f(20.001))
+
+ strlen = h["test_strlen","IS"]
+ debug strlen
+ r,rs = strlen["0123456789"]
+ debug r,rs
+ assert("strlen", :must, r == 10)
+ assert("extern strlen", :must, r == LIBTest.test_strlen("0123456789"))
+
+ isucc = h["test_isucc","II"]
+ debug isucc
+ r,rs = isucc[2]
+ debug r,rs
+ assert("isucc", :must, r == 3)
+ assert("extern isucc", :must, r == LIBTest.test_isucc(2))
+
+ lsucc = h["test_lsucc","LL"]
+ debug lsucc
+ r,rs = lsucc[10000000]
+ debug r,rs
+ assert("lsucc", :must, r == 10000001)
+ assert("extern lsucc", :must, r == LIBTest.test_lsucc(10000000))
+
+ succ = h["test_succ","0l"]
+ debug succ
+ r,rs = succ[0]
+ debug r,rs
+ assert("succ", :must, rs[0] == 1)
+ l = DL.malloc(DL.sizeof("L"))
+ l.struct!("L",:lval)
+ LIBTest.test_succ(l)
+ assert("extern succ", :must, rs[0] == l[:lval])
+
+ arylen = h["test_arylen","IA"]
+ debug arylen
+ r,rs = arylen[["a","b","c","d",nil]]
+ debug r,rs
+ assert("arylen", :must, r == 4)
+
+ arylen = h["test_arylen","IP"]
+ debug arylen
+ r,rs = arylen[["a","b","c","d",nil]]
+ debug r,rs
+ assert("arylen", :must, r == 4)
+ assert("extern arylen", :must, r == LIBTest.test_arylen(["a","b","c","d",nil]))
+
+ append = h["test_append","0aIS"]
+ debug append
+ r,rs = append[["a","b","c"],3,"x"]
+ debug r,rs
+ assert("append", :must, rs[0].to_a('S',3) == ["ax","bx","cx"])
+
+ LIBTest.test_append(["a","b","c"],3,"x")
+ assert("extern append", :must, rs[0].to_a('S',3) == LIBTest._args_[0].to_a('S',3))
+
+ strcat = h["test_strcat","SsS"]
+ debug strcat
+ r,rs = strcat["abc\0","x"]
+ debug r,rs
+ assert("strcat", :must, rs[0].to_s == "abcx")
+
+ init = h["test_init","IiP"]
+ debug init
+ argc = 3
+ argv = ["arg0","arg1","arg2"].to_ptr
+ r,rs = init[argc, argv.ref]
+ assert("init", :must, r == 0)
+}
+
+
+h = DL.dlopen($LIB)
+
+sym_open = h["test_open", "PSS"]
+sym_gets = h["test_gets", "SsIP"]
+sym_close = h["test_close", "0P"]
+debug sym_open,sym_gets,sym_close
+
+line = "Hello world!\n"
+File.open("tmp.txt", "w"){|f|
+ f.print(line)
+}
+
+fp,rs = sym_open["tmp.txt", "r"]
+if( fp )
+ fp.free = sym_close
+ r,rs = sym_gets[" " * 256, 256, fp]
+ debug r,rs
+ assert("open,gets", :must, rs[0] == line)
+ ObjectSpace.define_finalizer(fp) {File.unlink("tmp.txt")}
+ fp = nil
+else
+ assert("open,gets", :must, line == nil)
+ File.unlink("tmp.txt")
+end
+
+
+callback1 = h["test_callback1"]
+debug callback1
+r,rs = h["test_call_func1", "IP"][callback1]
+debug r,rs
+assert("callback1", :must, r == 1)
+
+
+callback2 = DL.callback("LLP"){|num,ptr|
+ msg = ptr.to_s
+ if( msg == "callback message" )
+ 2
+ else
+ 0
+ end
+}
+debug callback2
+r,rs = h["test_call_func1", "IP"][callback2]
+debug r,rs
+assert("callback2", :must, r == 2)
+DL.remove_callback(callback2)
+
+ptr = DL.malloc(DL.sizeof('CL'))
+ptr.struct!("CL", :c, :l)
+ptr["c"] = 0
+ptr["l"] = 0
+r,rs = h["test_fill_test_struct","0PIL"][ptr,100,1000]
+debug r,rs
+assert("fill_test_struct", :must, ptr["c"] == 100, ptr["l"] == 1000)
+assert("fill_test_struct", :must, ptr[:c] == 100, ptr[:l] == 1000) unless (Fixnum === :-)
+
+
+r,rs = h["test_alloc_test_struct", "PIL"][100,200]
+r.free = DL::FREE
+r.struct!("CL", :c, :l)
+assert("alloc_test_struct", :must, r["c"] == 100, r["l"] == 200)
+assert("alloc_test_struct", :must, r[:c] == 100, r[:l] == 200) unless (Fixnum === :-)
+
+ptr = h["test_strlen"]
+sym1 = DL::Symbol.new(ptr,"foo","0")
+sym2 = h["test_strlen","LS"]
+assert("Symbol.new", :must, ptr == sym1.to_ptr, sym1.to_ptr == sym2.to_ptr)
+
+set_val = h["test_set_long_value","0"]
+get_val = h["test_get_long_value","L"]
+lval = get_val[][0]
+ptr = h["internal_long_value"]
+ptr.struct!("L", :l)
+assert("get value", :must, ptr["l"] == lval)
+assert("get value", :must, ptr[:l] == lval) unless (Fixnum === :-)
+ptr["l"] = 200
+lval = get_val[][0]
+assert("set value", :must, ptr["l"] == lval)
+assert("set value", :must, ptr[:l] == lval) unless (Fixnum === :-)
+
+
+data_init = h["test_data_init", "P"]
+data_add = h["test_data_add", "0PS"]
+data_aref = h["test_data_aref", "PPI"]
+r,rs = data_init[]
+ptr = r
+data_add[ptr, "name1"]
+data_add[ptr, "name2"]
+data_add[ptr, "name3"]
+
+r,rs = data_aref[ptr, 1]
+ptr = r
+ptr.struct!("C1024P", :name, :next)
+assert("data_aref", :must,
+ ptr["name"].collect{|c| c.chr}.join.split("\0")[0] == "name2")
+assert("data_aref", :must,
+ ptr["name"].collect{|c| c.chr}.join.split("\0")[0] == "name2") unless (Fixnum === :-)
+
+ptr = ptr["next"]
+ptr.struct!("C1024P", :name, :next)
+assert("data_aref", :must,
+ ptr["name"].collect{|c| c.chr}.join.split("\0")[0] == "name1")
+assert("data_aref", :must,
+ ptr["name"].collect{|c| c.chr}.join.split("\0")[0] == "name1") unless (Fixnum === :-)
+
+GC.start
+
+ptr = DL::malloc(32)
+ptr.struct!("CHIL", "c", "h", "i", "l")
+ptr["c"] = 1
+ptr["h"] = 2
+ptr["i"] = 3
+ptr["l"] = 4
+assert("struct!", :must,
+ ptr["c"] == 1 &&
+ ptr["h"] == 2 &&
+ ptr["i"] == 3 &&
+ ptr["l"] == 4)
+
+ptr = DL::malloc(DL::sizeof("IP"))
+ptr.struct!("IP", "n", "ptr")
+ptr["n"] = 10
+ptr["ptr"] = nil
+assert("struct!", :must, ptr["n"] == 10 && ptr["ptr"] == nil)
+
+ptr = DL::malloc(16)
+ptr.struct!("CICI", "c1", "i1", "c2", "i2")
+ptr["c1"] = 0xf1
+ptr["c2"] = 0xf2
+c1 = [ptr["c1"]].pack("c").unpack("C")[0]
+c2 = [ptr["c2"]].pack("c").unpack("C")[0]
+assert("struct!", :must,
+ c1 == 0xf1 &&
+ c2 == 0xf2)
+
+
+GC.start
+printf("fail/total = #{$FAIL}/#{$TOTAL}\n")
diff --git a/ext/dl/type.rb b/ext/dl/type.rb
new file mode 100644
index 0000000000..804420c395
--- /dev/null
+++ b/ext/dl/type.rb
@@ -0,0 +1,115 @@
+# example:
+# DLTYPE[INT][:rb2c]["arg0"] => "NUM2INT(arg0)"
+# DLTYPE[DOUBLE][:c2rb]["r"] => "rb_float_new(r)"
+
+DLTYPE = {
+ VOID = 0x00 => {
+ :name => 'VOID',
+ :rb2c => nil,
+ :c2rb => nil,
+ :ctype => "void",
+ :stmem => "v",
+ :sym => true,
+ :cb => true,
+ },
+ CHAR = 0x01 => {
+ :name => 'CHAR',
+ :rb2c => proc{|x| "NUM2CHR(#{x})"},
+ :c2rb => proc{|x| "CHR2FIX(#{x})"},
+ :ctype => "char",
+ :stmem => "c",
+ :sym => false,
+ :cb => false,
+ },
+ SHORT = 0x02 => {
+ :name => 'SHORT',
+ :rb2c => proc{|x| "FIX2INT(#{x})"},
+ :c2rb => proc{|x| "INT2FIX(#{x})"},
+ :ctype => "short",
+ :stmem => "h",
+ :sym => false,
+ :cb => false,
+ },
+ INT = 0x03 => {
+ :name => 'INT',
+ :rb2c => proc{|x| "NUM2INT(#{x})"},
+ :c2rb => proc{|x| "INT2NUM(#{x})"},
+ :ctype => "int",
+ :stmem => "i",
+ :sym => true,
+ :cb => false,
+ },
+ LONG = 0x04 => {
+ :name => 'LONG',
+ :rb2c => proc{|x| "NUM2INT(#{x})"},
+ :c2rb => proc{|x| "INT2NUM(#{x})"},
+ :ctype => "long",
+ :stmem => "l",
+ :sym => true,
+ :cb => true,
+ },
+ FLOAT = 0x05 => {
+ :name => 'FLOAT',
+ :rb2c => proc{|x| "(float)(RFLOAT(#{x})->value)"},
+ :c2rb => proc{|x| "rb_float_new((double)#{x})"},
+ :ctype => "float",
+ :stmem => "f",
+ :sym => false,
+ :cb => false,
+ },
+ DOUBLE = 0x06 => {
+ :name => 'DOUBLE',
+ :rb2c => proc{|x| "RFLOAT(#{x})->value"},
+ :c2rb => proc{|x| "rb_float_new(#{x})"},
+ :ctype => "double",
+ :stmem => "d",
+ :sym => true,
+ :cb => true,
+ },
+ VOIDP = 0x07 => {
+ :name => 'VOIDP',
+ :rb2c => proc{|x| "rb_dlptr2cptr(#{x})"},
+ :c2rb => proc{|x| "rb_dlptr_new(#{x},sizeof(void*),0)"},
+ :ctype => "void *",
+ :stmem => "p",
+ :sym => true,
+ :cb => true,
+ },
+}
+
+def tpush(t, x)
+ (t << 3)|x
+end
+
+def tget(t, i)
+ (t & (0x07 << (i * 3))) >> (i * 3)
+end
+
+def types2num(types)
+ res = 0x00
+ r = types.reverse
+ r.each{|t|
+ res = tpush(res,t)
+ }
+ res
+end
+
+def num2types(num)
+ ts = []
+ i = 0
+ t = tget(num,i)
+ while( (t != VOID && i > 0) || (i == 0) )
+ ts.push(DLTYPE[t][:ctype])
+ i += 1
+ t = tget(num,i)
+ end
+ ts
+end
+
+def types2ctypes(types)
+ res = []
+ types.each{|t|
+ res.push(DLTYPE[t][:ctype])
+ }
+ res
+end
diff --git a/ext/dl/win32/extconf.rb b/ext/dl/win32/extconf.rb
deleted file mode 100644
index a72ca49c06..0000000000
--- a/ext/dl/win32/extconf.rb
+++ /dev/null
@@ -1,3 +0,0 @@
-if compiled?('dl') and $mswin||$bccwin||$mingw||$cygwin
- create_makefile('win32')
-end
diff --git a/ext/dl/win32/lib/Win32API.rb b/ext/dl/win32/lib/Win32API.rb
deleted file mode 100644
index f18cec5749..0000000000
--- a/ext/dl/win32/lib/Win32API.rb
+++ /dev/null
@@ -1,30 +0,0 @@
-# -*- ruby -*-
-# for backward compatibility
-warn "Warning:#{caller[0].sub(/:in `.*'\z/, '')}: Win32API is deprecated after Ruby 1.9.1; use dl directly instead" if $VERBOSE
-
-require 'dl'
-
-class Win32API
- DLL = {}
- TYPEMAP = {"0" => DL::TYPE_VOID, "S" => DL::TYPE_VOIDP, "I" => DL::TYPE_LONG}
-
- def initialize(dllname, func, import, export = "0", calltype = :stdcall)
- @proto = [import].join.tr("VPpNnLlIi", "0SSI").sub(/^(.)0*$/, '\1')
- handle = DLL[dllname] ||= DL.dlopen(dllname)
- @func = DL::CFunc.new(handle[func], TYPEMAP[export.tr("VPpNnLlIi", "0SSI")], func, calltype)
- rescue DL::DLError => e
- raise LoadError, e.message, e.backtrace
- end
-
- def call(*args)
- import = @proto.split("")
- args.each_with_index do |x, i|
- args[i], = [x == 0 ? nil : x].pack("p").unpack("l!*") if import[i] == "S"
- args[i], = [x].pack("I").unpack("i") if import[i] == "I"
- end
- ret, = @func.call(args)
- return ret || 0
- end
-
- alias Call call
-end
diff --git a/ext/dl/win32/lib/win32/registry.rb b/ext/dl/win32/lib/win32/registry.rb
deleted file mode 100644
index a2b69a08fe..0000000000
--- a/ext/dl/win32/lib/win32/registry.rb
+++ /dev/null
@@ -1,839 +0,0 @@
-=begin
-= Win32 Registry I/F
-win32/registry is registry accessor library for Win32 platform.
-It uses dl/import to call Win32 Registry APIs.
-
-== example
- Win32::Registry::HKEY_CURRENT_USER.open('SOFTWARE\foo') do |reg|
- value = reg['foo'] # read a value
- value = reg['foo', Win32::Registry::REG_SZ] # read a value with type
- type, value = reg.read('foo') # read a value
- reg['foo'] = 'bar' # write a value
- reg['foo', Win32::Registry::REG_SZ] = 'bar' # write a value with type
- reg.write('foo', Win32::Registry::REG_SZ, 'bar') # write a value
-
- reg.each_value { |name, type, data| ... } # Enumerate values
- reg.each_key { |key, wtime| ... } # Enumerate subkeys
-
- reg.delete_value(name) # Delete a value
- reg.delete_key(name) # Delete a subkey
- reg.delete_key(name, true) # Delete a subkey recursively
- end
-
-= Reference
-
-== Win32::Registry class
-
-=== including modules
-
-* Enumerable
-* Registry::Constants
-
-=== class methods
---- Registry.open(key, subkey, desired = KEY_READ, opt = REG_OPTION_RESERVED)
---- Registry.open(key, subkey, desired = KEY_READ, opt = REG_OPTION_RESERVED) { |reg| ... }
- Open the registry key ((|subkey|)) under ((|key|)).
- ((|key|)) is Win32::Registry object of parent key.
- You can use predefined key HKEY_* (see ((<constants>)))
-
- ((|desired|)) and ((|opt|)) is access mask and key option.
- For detail, see ((<MSDN Library|URL:http://msdn.microsoft.com/library/en-us/sysinfo/base/regopenkeyex.asp>)).
-
- If block is given, the key is closed automatically.
-
---- Registry.create(key, subkey, desired = KEY_ALL_ACCESS, opt = REG_OPTION_RESERVED)
---- Registry.create(key, subkey, desired = KEY_ALL_ACCESS, opt = REG_OPTION_RESERVED) { |reg| ... }
- Create or open the registry key ((|subkey|)) under ((|key|)).
- You can use predefined key HKEY_* (see ((<constants>)))
-
- If subkey is already exists, key is opened and Registry#((<created?>))
- method will return false.
-
- If block is given, the key is closed automatically.
-
---- Registry.expand_environ(str)
- Replace (({%\w+%})) into the environment value of ((|str|)).
- This method is used for REG_EXPAND_SZ.
-
- For detail, see ((<ExpandEnvironmentStrings|URL:http://msdn.microsoft.com/library/en-us/sysinfo/base/expandenvironmentstrings.asp>)) Win32 API.
-
---- Registry.type2name(type)
- Convert registry type value to readable string.
-
---- Registry.wtime2time(wtime)
- Convert 64-bit FILETIME integer into Time object.
-
---- Registry.time2wtime(time)
- Convert Time object or Integer object into 64-bit FILETIME.
-
-=== instance methods
---- open(subkey, desired = KEY_READ, opt = REG_OPTION_RESERVED)
- Same as (({Win32::((<Registry.open>))(self, subkey, desired, opt)}))
-
---- create(subkey, desired = KEY_ALL_ACCESS, opt = REG_OPTION_RESERVED)
- Same as (({Win32::((<Registry.create>))(self, subkey, desired, opt)}))
-
---- close
- Close key.
-
- After closed, most method raises error.
-
---- read(name, *rtype)
- Read a registry value named ((|name|)) and return array of
- [ ((|type|)), ((|data|)) ].
- When name is nil, the `default' value is read.
-
- ((|type|)) is value type. (see ((<Win32::Registry::Constants module>)))
- ((|data|)) is value data, its class is:
- :REG_SZ, REG_EXPAND_SZ
- String
- :REG_MULTI_SZ
- Array of String
- :REG_DWORD, REG_DWORD_BIG_ENDIAN, REG_QWORD
- Integer
- :REG_BINARY
- String (contains binary data)
-
- When ((|rtype|)) is specified, the value type must be included by
- ((|rtype|)) array, or TypeError is raised.
-
---- self[name, *rtype]
- Read a registry value named ((|name|)) and return its value data.
- The class of value is same as ((<read>)) method returns.
-
- If the value type is REG_EXPAND_SZ, returns value data whose environment
- variables are replaced.
- If the value type is neither REG_SZ, REG_MULTI_SZ, REG_DWORD,
- REG_DWORD_BIG_ENDIAN, nor REG_QWORD, TypeError is raised.
-
- The meaning of ((|rtype|)) is same as ((<read>)) method.
-
---- read_s(name)
---- read_i(name)
---- read_bin(name)
- Read a REG_SZ(read_s), REG_DWORD(read_i), or REG_BINARY(read_bin)
- registry value named ((|name|)).
-
- If the values type does not match, TypeError is raised.
-
---- read_s_expand(name)
- Read a REG_SZ or REG_EXPAND_SZ registry value named ((|name|)).
-
- If the value type is REG_EXPAND_SZ, environment variables are replaced.
- Unless the value type is REG_SZ or REG_EXPAND_SZ, TypeError is raised.
-
---- write(name, type, data)
- Write ((|data|)) to a registry value named ((|name|)).
- When name is nil, write to the `default' value.
-
- ((|type|)) is type value. (see ((<Registry::Constants module>)))
- Class of ((|data|)) must be same as which ((<read>))
- method returns.
-
---- self[name, wtype = nil] = value
- Write ((|value|)) to a registry value named ((|name|)).
-
- If ((|wtype|)) is specified, the value type is it.
- Otherwise, the value type is depend on class of ((|value|)):
- :Integer
- REG_DWORD
- :String
- REG_SZ
- :Array
- REG_MULTI_SZ
-
---- write_s(name, value)
---- write_i(name, value)
---- write_bin(name, value)
- Write ((|value|)) to a registry value named ((|name|)).
-
- The value type is REG_SZ(write_s), REG_DWORD(write_i), or
- REG_BINARY(write_bin).
-
---- each { |name, type, value| ... }
---- each_value { |name, type, value| ... }
- Enumerate values.
-
---- each_key { |subkey, wtime| ... }
- Enumerate subkeys.
-
- ((|subkey|)) is String which contains name of subkey.
- ((|wtime|)) is last write time as FILETIME (64-bit integer).
- (see ((<Registry.wtime2time>)))
-
---- delete(name)
---- delete_value(name)
- Delete a registry value named ((|name|)).
- We can not delete the `default' value.
-
---- delete_key(name, recursive = false)
- Delete a subkey named ((|name|)) and all its values.
-
- If ((|recursive|)) is false, the subkey must not have subkeys.
- Otherwise, this method deletes all subkeys and values recursively.
-
---- flush
- Write all the attributes into the registry file.
-
---- created?
- Returns if key is created ((*newly*)).
- (see ((<Registry.create>)))
-
---- open?
- Returns if key is not closed.
-
---- hkey
- Returns key handle value.
-
---- parent
- Win32::Registry object of parent key, or nil if predefeined key.
-
---- keyname
- Same as ((|subkey|)) value of ((<Registry.open>)) or
- ((<Registry.create>)) method.
-
---- disposition
- Disposition value (REG_CREATED_NEW_KEY or REG_OPENED_EXISTING_KEY).
-
---- name
---- to_s
- Full path of key such as (({'HKEY_CURRENT_USER\SOFTWARE\foo\bar'})).
-
---- info
- Returns key information as Array of:
- :num_keys
- The number of subkeys.
- :max_key_length
- Maximum length of name of subkeys.
- :num_values
- The number of values.
- :max_value_name_length
- Maximum length of name of values.
- :max_value_length
- Maximum length of value of values.
- :descriptor_length
- Length of security descriptor.
- :wtime
- Last write time as FILETIME(64-bit integer)
-
- For detail, see ((<RegQueryInfoKey|URL:http://msdn.microsoft.com/library/en-us/sysinfo/base/regqueryinfokey.asp>)) Win32 API.
-
---- num_keys
---- max_key_length
---- num_values
---- max_value_name_length
---- max_value_length
---- descriptor_length
---- wtime
- Returns an item of key information.
-
-=== constants
---- HKEY_CLASSES_ROOT
---- HKEY_CURRENT_USER
---- HKEY_LOCAL_MACHINE
---- HKEY_PERFORMANCE_DATA
---- HKEY_CURRENT_CONFIG
---- HKEY_DYN_DATA
- Win32::Registry object whose key is predefined key.
- For detail, see ((<MSDN Library|URL:http://msdn.microsoft.com/library/en-us/sysinfo/base/predefined_keys.asp>)).
-
-== Win32::Registry::Constants module
-
-For detail, see ((<MSDN Library|URL:http://msdn.microsoft.com/library/en-us/sysinfo/base/registry.asp>)).
-
---- HKEY_*
- Predefined key ((*handle*)).
- These are Integer, not Win32::Registry.
-
---- REG_*
- Registry value type.
-
---- KEY_*
- Security access mask.
-
---- KEY_OPTIONS_*
- Key options.
-
---- REG_CREATED_NEW_KEY
---- REG_OPENED_EXISTING_KEY
- If the key is created newly or opened existing key.
- See also Registry#((<disposition>)) method.
-
-=end
-
-require 'dl/import'
-
-module Win32
- class Registry
- module Constants
- HKEY_CLASSES_ROOT = 0x80000000
- HKEY_CURRENT_USER = 0x80000001
- HKEY_LOCAL_MACHINE = 0x80000002
- HKEY_USERS = 0x80000003
- HKEY_PERFORMANCE_DATA = 0x80000004
- HKEY_PERFORMANCE_TEXT = 0x80000050
- HKEY_PERFORMANCE_NLSTEXT = 0x80000060
- HKEY_CURRENT_CONFIG = 0x80000005
- HKEY_DYN_DATA = 0x80000006
-
- REG_NONE = 0
- REG_SZ = 1
- REG_EXPAND_SZ = 2
- REG_BINARY = 3
- REG_DWORD = 4
- REG_DWORD_LITTLE_ENDIAN = 4
- REG_DWORD_BIG_ENDIAN = 5
- REG_LINK = 6
- REG_MULTI_SZ = 7
- REG_RESOURCE_LIST = 8
- REG_FULL_RESOURCE_DESCRIPTOR = 9
- REG_RESOURCE_REQUIREMENTS_LIST = 10
- REG_QWORD = 11
- REG_QWORD_LITTLE_ENDIAN = 11
-
- STANDARD_RIGHTS_READ = 0x00020000
- STANDARD_RIGHTS_WRITE = 0x00020000
- KEY_QUERY_VALUE = 0x0001
- KEY_SET_VALUE = 0x0002
- KEY_CREATE_SUB_KEY = 0x0004
- KEY_ENUMERATE_SUB_KEYS = 0x0008
- KEY_NOTIFY = 0x0010
- KEY_CREATE_LINK = 0x0020
- KEY_READ = STANDARD_RIGHTS_READ |
- KEY_QUERY_VALUE | KEY_ENUMERATE_SUB_KEYS | KEY_NOTIFY
- KEY_WRITE = STANDARD_RIGHTS_WRITE |
- KEY_SET_VALUE | KEY_CREATE_SUB_KEY
- KEY_EXECUTE = KEY_READ
- KEY_ALL_ACCESS = KEY_READ | KEY_WRITE | KEY_CREATE_LINK
-
- REG_OPTION_RESERVED = 0x0000
- REG_OPTION_NON_VOLATILE = 0x0000
- REG_OPTION_VOLATILE = 0x0001
- REG_OPTION_CREATE_LINK = 0x0002
- REG_OPTION_BACKUP_RESTORE = 0x0004
- REG_OPTION_OPEN_LINK = 0x0008
- REG_LEGAL_OPTION = REG_OPTION_RESERVED |
- REG_OPTION_NON_VOLATILE | REG_OPTION_CREATE_LINK |
- REG_OPTION_BACKUP_RESTORE | REG_OPTION_OPEN_LINK
-
- REG_CREATED_NEW_KEY = 1
- REG_OPENED_EXISTING_KEY = 2
-
- REG_WHOLE_HIVE_VOLATILE = 0x0001
- REG_REFRESH_HIVE = 0x0002
- REG_NO_LAZY_FLUSH = 0x0004
- REG_FORCE_RESTORE = 0x0008
-
- MAX_KEY_LENGTH = 514
- MAX_VALUE_LENGTH = 32768
- end
- include Constants
- include Enumerable
-
- #
- # Error
- #
- class Error < ::StandardError
- module Kernel32
- extend DL::Importer
- dlload "kernel32.dll"
- end
- FormatMessageA = Kernel32.extern "int FormatMessageA(int, void *, int, int, void *, int, void *)", :stdcall
- def initialize(code)
- @code = code
- msg = "\0".force_encoding(Encoding::ASCII_8BIT) * 1024
- len = FormatMessageA.call(0x1200, 0, code, 0, msg, 1024, 0)
- msg = msg[0, len].force_encoding(Encoding.find(Encoding.locale_charmap))
- super msg.tr("\r", '').chomp
- end
- attr_reader :code
- end
-
- #
- # Predefined Keys
- #
- class PredefinedKey < Registry
- def initialize(hkey, keyname)
- @hkey = hkey
- @parent = nil
- @keyname = keyname
- @disposition = REG_OPENED_EXISTING_KEY
- end
-
- # Predefined keys cannot be closed
- def close
- raise Error.new(5) ## ERROR_ACCESS_DENIED
- end
-
- # Fake class for Registry#open, Registry#create
- def class
- Registry
- end
-
- # Make all
- Constants.constants.grep(/^HKEY_/) do |c|
- Registry.const_set c, new(Constants.const_get(c), c)
- end
- end
-
- #
- # Win32 APIs
- #
- module API
- extend DL::Importer
- dlload "advapi32.dll"
- [
- "long RegOpenKeyExA(void *, void *, long, long, void *)",
- "long RegCreateKeyExA(void *, void *, long, long, long, long, void *, void *)",
- "long RegEnumValueA(void *, long, void *, void *, void *, void *, void *, void *)",
- "long RegEnumKeyExA(void *, long, void *, void *, void *, void *, void *, void *)",
- "long RegQueryValueExA(void *, void *, void *, void *, void *, void *)",
- "long RegSetValueExA(void *, void *, long, long, void *, long)",
- "long RegDeleteValue(void *, void *)",
- "long RegDeleteKey(void *, void *)",
- "long RegFlushKey(void *)",
- "long RegCloseKey(void *)",
- "long RegQueryInfoKey(void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *)",
- ].each do |fn|
- cfunc = extern fn, :stdcall
- const_set cfunc.name.intern, cfunc
- end
-
- module_function
-
- def check(result)
- raise Error, result, caller(2) if result != 0
- end
-
- def packdw(dw)
- [dw].pack('V')
- end
-
- def unpackdw(dw)
- dw += [0].pack('V')
- dw.unpack('V')[0]
- end
-
- def packqw(qw)
- [ qw & 0xFFFFFFFF, qw >> 32 ].pack('VV')
- end
-
- def unpackqw(qw)
- qw = qw.unpack('VV')
- (qw[1] << 32) | qw[0]
- end
-
- def OpenKey(hkey, name, opt, desired)
- result = packdw(0)
- check RegOpenKeyExA.call(hkey, name, opt, desired, result)
- unpackdw(result)
- end
-
- def CreateKey(hkey, name, opt, desired)
- result = packdw(0)
- disp = packdw(0)
- check RegCreateKeyExA.call(hkey, name, 0, 0, opt, desired,
- 0, result, disp)
- [ unpackdw(result), unpackdw(disp) ]
- end
-
- def EnumValue(hkey, index)
- name = ' ' * Constants::MAX_KEY_LENGTH
- size = packdw(Constants::MAX_KEY_LENGTH)
- check RegEnumValueA.call(hkey, index, name, size, 0, 0, 0, 0)
- name[0, unpackdw(size)]
- end
-
- def EnumKey(hkey, index)
- name = ' ' * Constants::MAX_KEY_LENGTH
- size = packdw(Constants::MAX_KEY_LENGTH)
- wtime = ' ' * 8
- check RegEnumKeyExA.call(hkey, index, name, size, 0, 0, 0, wtime)
- [ name[0, unpackdw(size)], unpackqw(wtime) ]
- end
-
- def QueryValue(hkey, name)
- type = packdw(0)
- size = packdw(0)
- check RegQueryValueExA.call(hkey, name, 0, type, 0, size)
- data = ' ' * unpackdw(size)
- check RegQueryValueExA.call(hkey, name, 0, type, data, size)
- [ unpackdw(type), data[0, unpackdw(size)] ]
- end
-
- def SetValue(hkey, name, type, data, size)
- check RegSetValueExA.call(hkey, name, 0, type, data, size)
- end
-
- def DeleteValue(hkey, name)
- check RegDeleteValue.call(hkey, name)
- end
-
- def DeleteKey(hkey, name)
- check RegDeleteKey.call(hkey, name)
- end
-
- def FlushKey(hkey)
- check RegFlushKey.call(hkey)
- end
-
- def CloseKey(hkey)
- check RegCloseKey.call(hkey)
- end
-
- def QueryInfoKey(hkey)
- subkeys = packdw(0)
- maxsubkeylen = packdw(0)
- values = packdw(0)
- maxvaluenamelen = packdw(0)
- maxvaluelen = packdw(0)
- secdescs = packdw(0)
- wtime = ' ' * 8
- check RegQueryInfoKey.call(hkey, 0, 0, 0, subkeys, maxsubkeylen, 0,
- values, maxvaluenamelen, maxvaluelen, secdescs, wtime)
- [ unpackdw(subkeys), unpackdw(maxsubkeylen), unpackdw(values),
- unpackdw(maxvaluenamelen), unpackdw(maxvaluelen),
- unpackdw(secdescs), unpackqw(wtime) ]
- end
- end
-
- #
- # utility functions
- #
- def self.expand_environ(str)
- str.gsub(/%([^%]+)%/) { ENV[$1] || ENV[$1.upcase] || $& }
- end
-
- @@type2name = { }
- %w[
- REG_NONE REG_SZ REG_EXPAND_SZ REG_BINARY REG_DWORD
- REG_DWORD_BIG_ENDIAN REG_LINK REG_MULTI_SZ
- REG_RESOURCE_LIST REG_FULL_RESOURCE_DESCRIPTOR
- REG_RESOURCE_REQUIREMENTS_LIST REG_QWORD
- ].each do |type|
- @@type2name[Constants.const_get(type)] = type
- end
-
- def self.type2name(type)
- @@type2name[type] || type.to_s
- end
-
- def self.wtime2time(wtime)
- Time.at((wtime - 116444736000000000) / 10000000)
- end
-
- def self.time2wtime(time)
- time.to_i * 10000000 + 116444736000000000
- end
-
- #
- # constructors
- #
- private_class_method :new
-
- def self.open(hkey, subkey, desired = KEY_READ, opt = REG_OPTION_RESERVED)
- subkey = subkey.chomp('\\')
- newkey = API.OpenKey(hkey.hkey, subkey, opt, desired)
- obj = new(newkey, hkey, subkey, REG_OPENED_EXISTING_KEY)
- if block_given?
- begin
- yield obj
- ensure
- obj.close
- end
- else
- obj
- end
- end
-
- def self.create(hkey, subkey, desired = KEY_ALL_ACCESS, opt = REG_OPTION_RESERVED)
- newkey, disp = API.CreateKey(hkey.hkey, subkey, opt, desired)
- obj = new(newkey, hkey, subkey, disp)
- if block_given?
- begin
- yield obj
- ensure
- obj.close
- end
- else
- obj
- end
- end
-
- #
- # finalizer
- #
- @@final = proc { |hkey| proc { API.CloseKey(hkey[0]) if hkey[0] } }
-
- #
- # initialize
- #
- def initialize(hkey, parent, keyname, disposition)
- @hkey = hkey
- @parent = parent
- @keyname = keyname
- @disposition = disposition
- @hkeyfinal = [ hkey ]
- ObjectSpace.define_finalizer self, @@final.call(@hkeyfinal)
- end
- attr_reader :hkey, :parent, :keyname, :disposition
-
- #
- # attributes
- #
- def created?
- @disposition == REG_CREATED_NEW_KEY
- end
-
- def open?
- !@hkey.nil?
- end
-
- def name
- parent = self
- name = @keyname
- while parent = parent.parent
- name = parent.keyname + '\\' + name
- end
- name
- end
-
- def inspect
- "\#<Win32::Registry key=#{name.inspect}>"
- end
-
- #
- # marshalling
- #
- def _dump(depth)
- raise TypeError, "can't dump Win32::Registry"
- end
-
- #
- # open/close
- #
- def open(subkey, desired = KEY_READ, opt = REG_OPTION_RESERVED, &blk)
- self.class.open(self, subkey, desired, opt, &blk)
- end
-
- def create(subkey, desired = KEY_ALL_ACCESS, opt = REG_OPTION_RESERVED, &blk)
- self.class.create(self, subkey, desired, opt, &blk)
- end
-
- def close
- API.CloseKey(@hkey)
- @hkey = @parent = @keyname = nil
- @hkeyfinal[0] = nil
- end
-
- #
- # iterator
- #
- def each_value
- index = 0
- while true
- begin
- subkey = API.EnumValue(@hkey, index)
- rescue Error
- break
- end
- begin
- type, data = read(subkey)
- rescue Error
- next
- end
- yield subkey, type, data
- index += 1
- end
- index
- end
- alias each each_value
-
- def each_key
- index = 0
- while true
- begin
- subkey, wtime = API.EnumKey(@hkey, index)
- rescue Error
- break
- end
- yield subkey, wtime
- index += 1
- end
- index
- end
-
- def keys
- keys_ary = []
- each_key { |key,| keys_ary << key }
- keys_ary
- end
-
- #
- # reader
- #
- def read(name, *rtype)
- type, data = API.QueryValue(@hkey, name)
- unless rtype.empty? or rtype.include?(type)
- raise TypeError, "Type mismatch (expect #{rtype.inspect} but #{type} present)"
- end
- case type
- when REG_SZ, REG_EXPAND_SZ
- [ type, data.chop ]
- when REG_MULTI_SZ
- [ type, data.split(/\0/) ]
- when REG_BINARY
- [ type, data ]
- when REG_DWORD
- [ type, API.unpackdw(data) ]
- when REG_DWORD_BIG_ENDIAN
- [ type, data.unpack('N')[0] ]
- when REG_QWORD
- [ type, API.unpackqw(data) ]
- else
- raise TypeError, "Type #{type} is not supported."
- end
- end
-
- def [](name, *rtype)
- type, data = read(name, *rtype)
- case type
- when REG_SZ, REG_DWORD, REG_QWORD, REG_MULTI_SZ
- data
- when REG_EXPAND_SZ
- Registry.expand_environ(data)
- else
- raise TypeError, "Type #{type} is not supported."
- end
- end
-
- def read_s(name)
- read(name, REG_SZ)[1]
- end
-
- def read_s_expand(name)
- type, data = read(name, REG_SZ, REG_EXPAND_SZ)
- if type == REG_EXPAND_SZ
- Registry.expand_environ(data)
- else
- data
- end
- end
-
- def read_i(name)
- read(name, REG_DWORD, REG_DWORD_BIG_ENDIAN, REG_QWORD)[1]
- end
-
- def read_bin(name)
- read(name, REG_BINARY)[1]
- end
-
- #
- # writer
- #
- def write(name, type, data)
- case type
- when REG_SZ, REG_EXPAND_SZ
- data = data.to_s + "\0"
- when REG_MULTI_SZ
- data = data.to_a.join("\0") + "\0\0"
- when REG_BINARY
- data = data.to_s
- when REG_DWORD
- data = API.packdw(data.to_i)
- when REG_DWORD_BIG_ENDIAN
- data = [data.to_i].pack('N')
- when REG_QWORD
- data = API.packqw(data.to_i)
- else
- raise TypeError, "Unsupported type #{type}"
- end
- API.SetValue(@hkey, name, type, data, data.length)
- end
-
- def []=(name, rtype, value = nil)
- if value
- write name, rtype, value
- else
- case value = rtype
- when Integer
- write name, REG_DWORD, value
- when String
- write name, REG_SZ, value
- when Array
- write name, REG_MULTI_SZ, value
- else
- raise TypeError, "Unexpected type #{value.class}"
- end
- end
- value
- end
-
- def write_s(name, value)
- write name, REG_SZ, value.to_s
- end
-
- def write_i(name, value)
- write name, REG_DWORD, value.to_i
- end
-
- def write_bin(name, value)
- write name, REG_BINARY, value.to_s
- end
-
- #
- # delete
- #
- def delete_value(name)
- API.DeleteValue(@hkey, name)
- end
- alias delete delete_value
-
- def delete_key(name, recursive = false)
- if recursive
- open(name, KEY_ALL_ACCESS) do |reg|
- reg.keys.each do |key|
- begin
- reg.delete_key(key, true)
- rescue Error
- #
- end
- end
- end
- API.DeleteKey(@hkey, name)
- else
- begin
- API.EnumKey @hkey, 0
- rescue Error
- return API.DeleteKey(@hkey, name)
- end
- raise Error.new(5) ## ERROR_ACCESS_DENIED
- end
- end
-
- #
- # flush
- #
- def flush
- API.FlushKey @hkey
- end
-
- #
- # key information
- #
- def info
- API.QueryInfoKey(@hkey)
- end
- %w[
- num_keys max_key_length
- num_values max_value_name_length max_value_length
- descriptor_length wtime
- ].each_with_index do |s, i|
- eval <<-__END__
- def #{s}
- info[#{i}]
- end
- __END__
- end
- end
-end
diff --git a/ext/dl/win32/lib/win32/resolv.rb b/ext/dl/win32/lib/win32/resolv.rb
deleted file mode 100644
index a164fd54d2..0000000000
--- a/ext/dl/win32/lib/win32/resolv.rb
+++ /dev/null
@@ -1,379 +0,0 @@
-=begin
-= Win32 DNS and DHCP I/F
-
-=end
-
-require "dl/import"
-require 'win32/registry'
-
-module Win32
- module Resolv
- API = Registry::API
-
- def self.get_hosts_path
- path = get_hosts_dir
- path = File.expand_path('hosts', path)
- File.exist?(path) ? path : nil
- end
-
- def self.get_resolv_info
- search, nameserver = get_info
- if search.empty?
- search = nil
- else
- search.delete("")
- search.uniq!
- end
- if nameserver.empty?
- nameserver = nil
- else
- nameserver.delete("")
- nameserver.delete("0.0.0.0")
- nameserver.uniq!
- end
- [ search, nameserver ]
- end
-
-module Kernel32
- extend DL::Importer
- dlload "kernel32"
-end
-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_eval <<-'__EOS__', __FILE__, __LINE__+1
- TCPIP_NT = 'SYSTEM\CurrentControlSet\Services\Tcpip\Parameters'
-
- class << self
- private
- def get_hosts_dir
- Registry::HKEY_LOCAL_MACHINE.open(TCPIP_NT) do |reg|
- reg.read_s_expand('DataBasePath')
- end
- end
-
- def get_info
- search = nil
- nameserver = []
- Registry::HKEY_LOCAL_MACHINE.open(TCPIP_NT) do |reg|
- begin
- slist = reg.read_s('SearchList')
- search = slist.split(/,\s*/) unless slist.empty?
- rescue Registry::Error
- end
-
- if add_search = search.nil?
- search = []
- begin
- nvdom = reg.read_s('NV Domain')
- unless nvdom.empty?
- @search = [ nvdom ]
- if reg.read_i('UseDomainNameDevolution') != 0
- if /^[\w\d]+\./ =~ nvdom
- devo = $'
- end
- end
- end
- rescue Registry::Error
- end
- end
-
- reg.open('Interfaces') do |h|
- h.each_key do |iface,|
- h.open(iface) do |regif|
- 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
-
- if add_search
- begin
- [ 'Domain', 'DhcpDomain' ].each do |key|
- dom = regif.read_s(key)
- unless dom.empty?
- search.concat(dom.split(/,\s*/))
- break
- end
- end
- rescue Registry::Error
- end
- end
- end
- end
- end
- search << devo if add_search and devo
- end
- [ 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 DL::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/dl/win32/lib/win32/sspi.rb b/ext/dl/win32/lib/win32/sspi.rb
deleted file mode 100644
index 6022df96c3..0000000000
--- a/ext/dl/win32/lib/win32/sspi.rb
+++ /dev/null
@@ -1,330 +0,0 @@
-#
-# = win32/sspi.rb
-#
-# Copyright (c) 2006-2007 Justin Bailey
-#
-# Written and maintained by Justin Bailey <jgbailey@gmail.com>.
-#
-# This program is free software. You can re-distribute and/or
-# modify this program under the same terms of ruby itself ---
-# Ruby Distribution License or GNU General Public License.
-#
-
-require 'Win32API'
-
-# Implements bindings to Win32 SSPI functions, focused on authentication to a proxy server over HTTP.
-module Win32
- module SSPI
- # Specifies how credential structure requested will be used. Only SECPKG_CRED_OUTBOUND is used
- # here.
- SECPKG_CRED_INBOUND = 0x00000001
- SECPKG_CRED_OUTBOUND = 0x00000002
- SECPKG_CRED_BOTH = 0x00000003
-
- # Format of token. NETWORK format is used here.
- SECURITY_NATIVE_DREP = 0x00000010
- SECURITY_NETWORK_DREP = 0x00000000
-
- # InitializeSecurityContext Requirement flags
- ISC_REQ_REPLAY_DETECT = 0x00000004
- ISC_REQ_SEQUENCE_DETECT = 0x00000008
- ISC_REQ_CONFIDENTIALITY = 0x00000010
- ISC_REQ_USE_SESSION_KEY = 0x00000020
- ISC_REQ_PROMPT_FOR_CREDS = 0x00000040
- ISC_REQ_CONNECTION = 0x00000800
-
- # Win32 API Functions. Uses Win32API to bind methods to constants contained in class.
- module API
- # Can be called with AcquireCredentialsHandle.call()
- AcquireCredentialsHandle = Win32API.new("secur32", "AcquireCredentialsHandle", 'ppLpppppp', 'L')
- # Can be called with InitializeSecurityContext.call()
- InitializeSecurityContext = Win32API.new("secur32", "InitializeSecurityContext", 'pppLLLpLpppp', 'L')
- # Can be called with DeleteSecurityContext.call()
- DeleteSecurityContext = Win32API.new("secur32", "DeleteSecurityContext", 'P', 'L')
- # Can be called with FreeCredentialsHandle.call()
- FreeCredentialsHandle = Win32API.new("secur32", "FreeCredentialsHandle", 'P', 'L')
- end
-
- # SecHandle struct
- class SecurityHandle
- def upper
- @struct.unpack("LL")[1]
- end
-
- def lower
- @struct.unpack("LL")[0]
- end
-
- def to_p
- @struct ||= "\0" * 8
- end
- end
-
- # Some familiar aliases for the SecHandle structure
- CredHandle = CtxtHandle = SecurityHandle
-
- # TimeStamp struct
- class TimeStamp
- attr_reader :struct
-
- def to_p
- @struct ||= "\0" * 8
- end
- end
-
- # Creates binary representaiton of a SecBufferDesc structure,
- # including the SecBuffer contained inside.
- class SecurityBuffer
-
- SECBUFFER_TOKEN = 2 # Security token
-
- TOKENBUFSIZE = 12288
- SECBUFFER_VERSION = 0
-
- def initialize(buffer = nil)
- @buffer = buffer || "\0" * TOKENBUFSIZE
- @bufferSize = @buffer.length
- @type = SECBUFFER_TOKEN
- end
-
- def bufferSize
- unpack
- @bufferSize
- end
-
- def bufferType
- unpack
- @type
- end
-
- def token
- unpack
- @buffer
- end
-
- def to_p
- # Assumption is that when to_p is called we are going to get a packed structure. Therefore,
- # set @unpacked back to nil so we know to unpack when accessors are next accessed.
- @unpacked = nil
- # Assignment of inner structure to variable is very important here. Without it,
- # will not be able to unpack changes to the structure. Alternative, nested unpacks,
- # does not work (i.e. @struct.unpack("LLP12")[2].unpack("LLP12") results in "no associated pointer")
- @sec_buffer ||= [@bufferSize, @type, @buffer].pack("LLP")
- @struct ||= [SECBUFFER_VERSION, 1, @sec_buffer].pack("LLP")
- end
-
- private
-
- # Unpacks the SecurityBufferDesc structure into member variables. We
- # only want to do this once per struct, so the struct is deleted
- # after unpacking.
- def unpack
- if ! @unpacked && @sec_buffer && @struct
- @bufferSize, @type = @sec_buffer.unpack("LL")
- @buffer = @sec_buffer.unpack("LLP#{@bufferSize}")[2]
- @struct = nil
- @sec_buffer = nil
- @unpacked = true
- end
- end
- end
-
- # SEC_WINNT_AUTH_IDENTITY structure
- class Identity
- SEC_WINNT_AUTH_IDENTITY_ANSI = 0x1
-
- attr_accessor :user, :domain, :password
-
- def initialize(user = nil, domain = nil, password = nil)
- @user = user
- @domain = domain
- @password = password
- @flags = SEC_WINNT_AUTH_IDENTITY_ANSI
- end
-
- def to_p
- [@user, @user ? @user.length : 0,
- @domain, @domain ? @domain.length : 0,
- @password, @password ? @password.length : 0,
- @flags].pack("PLPLPLL")
- end
- end
-
- # Takes a return result from an SSPI function and interprets the value.
- class SSPIResult
- # Good results
- SEC_E_OK = 0x00000000
- SEC_I_CONTINUE_NEEDED = 0x00090312
-
- # These are generally returned by InitializeSecurityContext
- SEC_E_INSUFFICIENT_MEMORY = 0x80090300
- SEC_E_INTERNAL_ERROR = 0x80090304
- SEC_E_INVALID_HANDLE = 0x80090301
- SEC_E_INVALID_TOKEN = 0x80090308
- SEC_E_LOGON_DENIED = 0x8009030C
- SEC_E_NO_AUTHENTICATING_AUTHORITY = 0x80090311
- SEC_E_NO_CREDENTIALS = 0x8009030E
- SEC_E_TARGET_UNKNOWN = 0x80090303
- SEC_E_UNSUPPORTED_FUNCTION = 0x80090302
- SEC_E_WRONG_PRINCIPAL = 0x80090322
-
- # These are generally returned by AcquireCredentialsHandle
- SEC_E_NOT_OWNER = 0x80090306
- SEC_E_SECPKG_NOT_FOUND = 0x80090305
- SEC_E_UNKNOWN_CREDENTIALS = 0x8009030D
-
- @@map = {}
- constants.each { |v| @@map[self.const_get(v.to_s)] = v }
-
- attr_reader :value
-
- def initialize(value)
- # convert to unsigned long
- value = [value].pack("L").unpack("L").first
- raise "#{value.to_s(16)} is not a recognized result" unless @@map.has_key? value
- @value = value
- end
-
- def to_s
- @@map[@value].to_s
- end
-
- def ok?
- @value == SEC_I_CONTINUE_NEEDED || @value == SEC_E_OK
- end
-
- def ==(other)
- if other.is_a?(SSPIResult)
- @value == other.value
- elsif other.is_a?(Fixnum)
- @value == @@map[other]
- else
- false
- end
- end
- end
-
- # Handles "Negotiate" type authentication. Geared towards authenticating with a proxy server over HTTP
- class NegotiateAuth
- attr_accessor :credentials, :context, :contextAttributes, :user, :domain
-
- # Default request flags for SSPI functions
- REQUEST_FLAGS = ISC_REQ_CONFIDENTIALITY | ISC_REQ_REPLAY_DETECT | ISC_REQ_CONNECTION
-
- # NTLM tokens start with this header always. Encoding alone adds "==" and newline, so remove those
- B64_TOKEN_PREFIX = ["NTLMSSP"].pack("m").delete("=\n")
-
- # Given a connection and a request path, performs authentication as the current user and returns
- # the response from a GET request. The connnection should be a Net::HTTP object, and it should
- # have been constructed using the Net::HTTP.Proxy method, but anything that responds to "get" will work.
- # If a user and domain are given, will authenticate as the given user.
- # Returns the response received from the get method (usually Net::HTTPResponse)
- def NegotiateAuth.proxy_auth_get(http, path, user = nil, domain = nil)
- raise "http must respond to :get" unless http.respond_to?(:get)
- nego_auth = self.new user, domain
-
- resp = http.get path, { "Proxy-Authorization" => "Negotiate " + nego_auth.get_initial_token }
- if resp["Proxy-Authenticate"]
- resp = http.get path, { "Proxy-Authorization" => "Negotiate " + nego_auth.complete_authentication(resp["Proxy-Authenticate"].split(" ").last.strip) }
- end
-
- resp
- end
-
- # Creates a new instance ready for authentication as the given user in the given domain.
- # Defaults to current user and domain as defined by ENV["USERDOMAIN"] and ENV["USERNAME"] if
- # no arguments are supplied.
- def initialize(user = nil, domain = nil)
- if user.nil? && domain.nil? && ENV["USERNAME"].nil? && ENV["USERDOMAIN"].nil?
- raise "A username or domain must be supplied since they cannot be retrieved from the environment"
- end
-
- @user = user || ENV["USERNAME"]
- @domain = domain || ENV["USERDOMAIN"]
- end
-
- # Gets the initial Negotiate token. Returns it as a base64 encoded string suitable for use in HTTP. Can
- # be easily decoded, however.
- def get_initial_token
- raise "This object is no longer usable because its resources have been freed." if @cleaned_up
- get_credentials
-
- outputBuffer = SecurityBuffer.new
- @context = CtxtHandle.new
- @contextAttributes = "\0" * 4
-
- result = SSPIResult.new(API::InitializeSecurityContext.call(@credentials.to_p, nil, nil,
- REQUEST_FLAGS,0, SECURITY_NETWORK_DREP, nil, 0, @context.to_p, outputBuffer.to_p, @contextAttributes, TimeStamp.new.to_p))
-
- if result.ok? then
- return encode_token(outputBuffer.token)
- else
- raise "Error: #{result.to_s}"
- end
- end
-
- # Takes a token and gets the next token in the Negotiate authentication chain. Token can be Base64 encoded or not.
- # The token can include the "Negotiate" header and it will be stripped.
- # Does not indicate if SEC_I_CONTINUE or SEC_E_OK was returned.
- # Token returned is Base64 encoded w/ all new lines removed.
- def complete_authentication(token)
- raise "This object is no longer usable because its resources have been freed." if @cleaned_up
-
- # Nil token OK, just set it to empty string
- token = "" if token.nil?
-
- if token.include? "Negotiate"
- # If the Negotiate prefix is passed in, assume we are seeing "Negotiate <token>" and get the token.
- token = token.split(" ").last
- end
-
- if token.include? B64_TOKEN_PREFIX
- # indicates base64 encoded token
- token = token.strip.unpack("m")[0]
- end
-
- outputBuffer = SecurityBuffer.new
- result = SSPIResult.new(API::InitializeSecurityContext.call(@credentials.to_p, @context.to_p, nil,
- REQUEST_FLAGS, 0, SECURITY_NETWORK_DREP, SecurityBuffer.new(token).to_p, 0,
- @context.to_p,
- outputBuffer.to_p, @contextAttributes, TimeStamp.new.to_p))
-
- if result.ok? then
- return encode_token(outputBuffer.token)
- else
- raise "Error: #{result.to_s}"
- end
- ensure
- # need to make sure we don't clean up if we've already cleaned up.
- clean_up unless @cleaned_up
- end
-
- private
-
- def clean_up
- # free structures allocated
- @cleaned_up = true
- API::FreeCredentialsHandle.call(@credentials.to_p)
- API::DeleteSecurityContext.call(@context.to_p)
- @context = nil
- @credentials = nil
- @contextAttributes = nil
- end
-
- # Gets credentials based on user, domain or both. If both are nil, an error occurs
- def get_credentials
- @credentials = CredHandle.new
- ts = TimeStamp.new
- @identity = Identity.new @user, @domain
- result = SSPIResult.new(API::AcquireCredentialsHandle.call(nil, "Negotiate", SECPKG_CRED_OUTBOUND, nil, @identity.to_p,
- nil, nil, @credentials.to_p, ts.to_p))
- raise "Error acquire credentials: #{result}" unless result.ok?
- end
-
- def encode_token(t)
- # encode64 will add newlines every 60 characters so we need to remove those.
- [t].pack("m").delete("\n")
- end
- end
- end
-end \ No newline at end of file
diff --git a/ext/etc/etc.c b/ext/etc/etc.c
index c8e52dabc2..ecb9e16411 100644
--- a/ext/etc/etc.c
+++ b/ext/etc/etc.c
@@ -3,6 +3,7 @@
etc.c -
$Author$
+ $Date$
created at: Tue Mar 22 18:39:19 JST 1994
************************************************/
@@ -22,11 +23,12 @@
#include <grp.h>
#endif
-static VALUE sPasswd;
-#ifdef HAVE_GETGRENT
-static VALUE sGroup;
+#ifndef HAVE_TYPE_UID_T
+#define uid_t int
#endif
+static VALUE sPasswd, sGroup;
+
#ifndef _WIN32
char *getenv();
#endif
@@ -40,7 +42,8 @@ char *getlogin();
* Etc.getlogin -> 'guest'
*/
static VALUE
-etc_getlogin(VALUE obj)
+etc_getlogin(obj)
+ VALUE obj;
{
char *login;
@@ -59,7 +62,8 @@ etc_getlogin(VALUE obj)
#if defined(HAVE_GETPWENT) || defined(HAVE_GETGRENT)
static VALUE
-safe_setup_str(const char *str)
+safe_setup_str(str)
+ const char *str;
{
if (str == 0) str = "";
return rb_tainted_str_new2(str);
@@ -68,7 +72,8 @@ safe_setup_str(const char *str)
#ifdef HAVE_GETPWENT
static VALUE
-setup_passwd(struct passwd *pwd)
+setup_passwd(pwd)
+ struct passwd *pwd;
{
if (pwd == 0) rb_sys_fail("/etc/passwd");
return rb_struct_new(sPasswd,
@@ -76,8 +81,8 @@ setup_passwd(struct passwd *pwd)
#ifdef HAVE_ST_PW_PASSWD
safe_setup_str(pwd->pw_passwd),
#endif
- UIDT2NUM(pwd->pw_uid),
- GIDT2NUM(pwd->pw_gid),
+ PW_UID2VAL(pwd->pw_uid),
+ PW_GID2VAL(pwd->pw_gid),
#ifdef HAVE_ST_PW_GECOS
safe_setup_str(pwd->pw_gecos),
#endif
@@ -116,22 +121,25 @@ setup_passwd(struct passwd *pwd)
* passwd="x", uid=0, gid=0, gecos="root",dir="/root", shell="/bin/bash">
*/
static VALUE
-etc_getpwuid(int argc, VALUE *argv, VALUE obj)
+etc_getpwuid(argc, argv, obj)
+ int argc;
+ VALUE *argv;
+ VALUE obj;
{
#if defined(HAVE_GETPWENT)
VALUE id;
- rb_uid_t uid;
+ uid_t uid;
struct passwd *pwd;
rb_secure(4);
if (rb_scan_args(argc, argv, "01", &id) == 1) {
- uid = NUM2UIDT(id);
+ uid = PW_VAL2UID(id);
}
else {
uid = getuid();
}
pwd = getpwuid(uid);
- if (pwd == 0) rb_raise(rb_eArgError, "can't find user for %d", (int)uid);
+ if (pwd == 0) rb_raise(rb_eArgError, "can't find user for %d", uid);
return setup_passwd(pwd);
#else
return Qnil;
@@ -147,14 +155,15 @@ etc_getpwuid(int argc, VALUE *argv, VALUE obj)
* passwd="x", uid=0, gid=0, gecos="root",dir="/root", shell="/bin/bash">
*/
static VALUE
-etc_getpwnam(VALUE obj, VALUE nam)
+etc_getpwnam(obj, nam)
+ VALUE obj, nam;
{
#ifdef HAVE_GETPWENT
struct passwd *pwd;
SafeStringValue(nam);
- pwd = getpwnam(RSTRING_PTR(nam));
- if (pwd == 0) rb_raise(rb_eArgError, "can't find user for %s", RSTRING_PTR(nam));
+ pwd = getpwnam(RSTRING(nam)->ptr);
+ if (pwd == 0) rb_raise(rb_eArgError, "can't find user for %s", RSTRING(nam)->ptr);
return setup_passwd(pwd);
#else
return Qnil;
@@ -164,14 +173,14 @@ etc_getpwnam(VALUE obj, VALUE nam)
#ifdef HAVE_GETPWENT
static int passwd_blocking = 0;
static VALUE
-passwd_ensure(void)
+passwd_ensure()
{
passwd_blocking = Qfalse;
return Qnil;
}
static VALUE
-passwd_iterate(void)
+passwd_iterate()
{
struct passwd *pw;
@@ -182,22 +191,12 @@ passwd_iterate(void)
endpwent();
return Qnil;
}
-
-static void
-each_passwd(void)
-{
- if (passwd_blocking) {
- rb_raise(rb_eRuntimeError, "parallel passwd iteration");
- }
- passwd_blocking = Qtrue;
- rb_ensure(passwd_iterate, 0, passwd_ensure, 0);
-}
#endif
/* Provides a convenient Ruby iterator which executes a block for each entry
* in the /etc/passwd file.
*
- * The code block is passed an Struct::Passwd struct; see getpwent above for
+ * The code block is passed an Etc::Passwd struct; see getpwent above for
* details.
*
* Example:
@@ -210,55 +209,33 @@ each_passwd(void)
*
*/
static VALUE
-etc_passwd(VALUE obj)
+etc_passwd(obj)
+ VALUE obj;
{
#ifdef HAVE_GETPWENT
struct passwd *pw;
rb_secure(4);
if (rb_block_given_p()) {
- each_passwd();
+ if (passwd_blocking) {
+ rb_raise(rb_eRuntimeError, "parallel passwd iteration");
+ }
+ passwd_blocking = Qtrue;
+ rb_ensure(passwd_iterate, 0, passwd_ensure, 0);
}
- else if (pw = getpwent()) {
+ if (pw = getpwent()) {
return setup_passwd(pw);
}
#endif
return Qnil;
}
-/* Iterates for each entry in the /etc/passwd file if a block is given.
- * If no block is given, returns the enumerator.
- *
- * The code block is passed an Struct::Passwd struct; see getpwent above for
- * details.
- *
- * Example:
- *
- * require 'etc'
- *
- * Etc::Passwd.each {|u|
- * puts u.name + " = " + u.gecos
- * }
- *
- * Etc::Passwd.collect {|u| u.gecos}
- * Etc::Passwd.collect {|u| u.gecos}
- *
- */
-static VALUE
-etc_each_passwd(VALUE obj)
-{
-#ifdef HAVE_GETPWENT
- RETURN_ENUMERATOR(obj, 0, 0);
- each_passwd();
-#endif
- return obj;
-}
-
/* Resets the process of reading the /etc/passwd file, so that the next call
* to getpwent will return the first entry again.
*/
static VALUE
-etc_setpwent(VALUE obj)
+etc_setpwent(obj)
+ VALUE obj;
{
#ifdef HAVE_GETPWENT
setpwent();
@@ -270,7 +247,8 @@ etc_setpwent(VALUE obj)
* getpwent, and closes the file.
*/
static VALUE
-etc_endpwent(VALUE obj)
+etc_endpwent(obj)
+ VALUE obj;
{
#ifdef HAVE_GETPWENT
endpwent();
@@ -305,7 +283,8 @@ etc_endpwent(VALUE obj)
* - Passwd#shell contains the path to the login shell of the user as a String.
*/
static VALUE
-etc_getpwent(VALUE obj)
+etc_getpwent(obj)
+ VALUE obj;
{
#ifdef HAVE_GETPWENT
struct passwd *pw;
@@ -319,7 +298,8 @@ etc_getpwent(VALUE obj)
#ifdef HAVE_GETGRENT
static VALUE
-setup_group(struct group *grp)
+setup_group(grp)
+ struct group *grp;
{
VALUE mem;
char **tbl;
@@ -335,7 +315,7 @@ setup_group(struct group *grp)
#ifdef HAVE_ST_GR_PASSWD
safe_setup_str(grp->gr_passwd),
#endif
- GIDT2NUM(grp->gr_gid),
+ PW_GID2VAL(grp->gr_gid),
mem);
}
#endif
@@ -351,22 +331,17 @@ setup_group(struct group *grp)
*
*/
static VALUE
-etc_getgrgid(int argc, VALUE *argv, VALUE obj)
+etc_getgrgid(obj, id)
+ VALUE obj, id;
{
#ifdef HAVE_GETGRENT
- VALUE id;
gid_t gid;
struct group *grp;
rb_secure(4);
- if (rb_scan_args(argc, argv, "01", &id) == 1) {
- gid = NUM2GIDT(id);
- }
- else {
- gid = getgid();
- }
+ gid = PW_VAL2GID(id);
grp = getgrgid(gid);
- if (grp == 0) rb_raise(rb_eArgError, "can't find group for %d", (int)gid);
+ if (grp == 0) rb_raise(rb_eArgError, "can't find group for %d", gid);
return setup_group(grp);
#else
return Qnil;
@@ -384,15 +359,16 @@ etc_getgrgid(int argc, VALUE *argv, VALUE obj)
*
*/
static VALUE
-etc_getgrnam(VALUE obj, VALUE nam)
+etc_getgrnam(obj, nam)
+ VALUE obj, nam;
{
#ifdef HAVE_GETGRENT
struct group *grp;
rb_secure(4);
SafeStringValue(nam);
- grp = getgrnam(RSTRING_PTR(nam));
- if (grp == 0) rb_raise(rb_eArgError, "can't find group for %s", RSTRING_PTR(nam));
+ grp = getgrnam(RSTRING(nam)->ptr);
+ if (grp == 0) rb_raise(rb_eArgError, "can't find group for %s", RSTRING(nam)->ptr);
return setup_group(grp);
#else
return Qnil;
@@ -402,14 +378,14 @@ etc_getgrnam(VALUE obj, VALUE nam)
#ifdef HAVE_GETGRENT
static int group_blocking = 0;
static VALUE
-group_ensure(void)
+group_ensure()
{
group_blocking = Qfalse;
return Qnil;
}
static VALUE
-group_iterate(void)
+group_iterate()
{
struct group *pw;
@@ -420,22 +396,12 @@ group_iterate(void)
endgrent();
return Qnil;
}
-
-static void
-each_group(void)
-{
- if (group_blocking) {
- rb_raise(rb_eRuntimeError, "parallel group iteration");
- }
- group_blocking = Qtrue;
- rb_ensure(group_iterate, 0, group_ensure, 0);
-}
#endif
/* Provides a convenient Ruby iterator which executes a block for each entry
* in the /etc/group file.
*
- * The code block is passed an Struct::Group struct; see getgrent above for
+ * The code block is passed an Etc::Group struct; see getgrent above for
* details.
*
* Example:
@@ -448,55 +414,33 @@ each_group(void)
*
*/
static VALUE
-etc_group(VALUE obj)
+etc_group(obj)
+ VALUE obj;
{
#ifdef HAVE_GETGRENT
struct group *grp;
rb_secure(4);
if (rb_block_given_p()) {
- each_group();
+ if (group_blocking) {
+ rb_raise(rb_eRuntimeError, "parallel group iteration");
+ }
+ group_blocking = Qtrue;
+ rb_ensure(group_iterate, 0, group_ensure, 0);
}
- else if (grp = getgrent()) {
+ if (grp = getgrent()) {
return setup_group(grp);
}
#endif
return Qnil;
}
-#ifdef HAVE_GETPWENT
-/* Iterates for each entry in the /etc/group file if a block is given.
- * If no block is given, returns the enumerator.
- *
- * The code block is passed an Struct::Group struct; see getpwent above for
- * details.
- *
- * Example:
- *
- * require 'etc'
- *
- * Etc::Group.each {|g|
- * puts g.name + ": " + g.mem.join(', ')
- * }
- *
- * Etc::Group.collect {|g| g.name}
- * Etc::Group.select {|g| !g.mem.empty?}
- *
- */
-static VALUE
-etc_each_group(VALUE obj)
-{
- RETURN_ENUMERATOR(obj, 0, 0);
- each_group();
- return obj;
-}
-#endif
-
/* Resets the process of reading the /etc/group file, so that the next call
* to getgrent will return the first entry again.
*/
static VALUE
-etc_setgrent(VALUE obj)
+etc_setgrent(obj)
+ VALUE obj;
{
#ifdef HAVE_GETGRENT
setgrent();
@@ -508,7 +452,8 @@ etc_setgrent(VALUE obj)
* getgrent, and closes the file.
*/
static VALUE
-etc_endgrent(VALUE obj)
+etc_endgrent(obj)
+ VALUE obj;
{
#ifdef HAVE_GETGRENT
endgrent();
@@ -537,7 +482,8 @@ etc_endgrent(VALUE obj)
* members of the group.
*/
static VALUE
-etc_getgrent(VALUE obj)
+etc_getgrent(obj)
+ VALUE obj;
{
#ifdef HAVE_GETGRENT
struct group *gr;
@@ -549,17 +495,18 @@ etc_getgrent(VALUE obj)
return Qnil;
}
+static VALUE mEtc;
+
/* The etc module provides access to information from the /etc/passwd and
* /etc/group files on Linux and Unix systems.
*
* Documented by mathew <meta@pobox.com>.
*/
void
-Init_etc(void)
+Init_etc()
{
- VALUE mEtc;
-
mEtc = rb_define_module("Etc");
+
rb_define_module_function(mEtc, "getlogin", etc_getlogin, 0);
rb_define_module_function(mEtc, "getpwuid", etc_getpwuid, -1);
@@ -569,13 +516,14 @@ Init_etc(void)
rb_define_module_function(mEtc, "getpwent", etc_getpwent, 0);
rb_define_module_function(mEtc, "passwd", etc_passwd, 0);
- rb_define_module_function(mEtc, "getgrgid", etc_getgrgid, -1);
+ rb_define_module_function(mEtc, "getgrgid", etc_getgrgid, 1);
rb_define_module_function(mEtc, "getgrnam", etc_getgrnam, 1);
rb_define_module_function(mEtc, "group", etc_group, 0);
rb_define_module_function(mEtc, "setgrent", etc_setgrent, 0);
rb_define_module_function(mEtc, "endgrent", etc_endgrent, 0);
rb_define_module_function(mEtc, "getgrent", etc_getgrent, 0);
+ rb_global_variable(&sPasswd);
sPasswd = rb_struct_define("Passwd",
"name", "passwd", "uid", "gid",
#ifdef HAVE_ST_PW_GECOS
@@ -601,19 +549,13 @@ Init_etc(void)
"expire",
#endif
NULL);
- rb_define_const(mEtc, "Passwd", sPasswd);
- rb_extend_object(sPasswd, rb_mEnumerable);
- rb_define_singleton_method(sPasswd, "each", etc_each_passwd, 0);
#ifdef HAVE_GETGRENT
+ rb_global_variable(&sGroup);
sGroup = rb_struct_define("Group", "name",
#ifdef HAVE_ST_GR_PASSWD
"passwd",
#endif
"gid", "mem", NULL);
-
- rb_define_const(mEtc, "Group", sGroup);
- rb_extend_object(sGroup, rb_mEnumerable);
- rb_define_singleton_method(sGroup, "each", etc_each_group, 0);
#endif
}
diff --git a/ext/etc/extconf.rb b/ext/etc/extconf.rb
index 2914bfb196..dbd0672545 100644
--- a/ext/etc/extconf.rb
+++ b/ext/etc/extconf.rb
@@ -24,5 +24,20 @@ if a or b or c
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')
+ [%w"uid_t pwd.h", %w"gid_t grp.h"].each do |t, *h|
+ h.unshift("sys/types.h")
+ f = "INT2NUM"
+ if have_type(t, h)
+ if try_static_assert("sizeof(#{t}) > sizeof(long)", h)
+ f = "LL2NUM"
+ end
+ if try_static_assert("(#{t})-1 > 0", h)
+ f = "U#{f}"
+ end
+ end
+ t = t.chomp('_t').upcase
+ $defs.push("-DPW_#{t}2VAL=#{f}")
+ $defs.push("-DPW_VAL2#{t}=#{f.sub(/([A-Z]+)2(NUM)/, '\22\1')}")
+ end
create_makefile("etc")
end
diff --git a/ext/extmk.rb b/ext/extmk.rb
index 30de287cd8..2527645ad8 100644
--- a/ext/extmk.rb
+++ b/ext/extmk.rb
@@ -16,7 +16,6 @@ $extlibs = nil
$extpath = nil
$ignore = nil
$message = nil
-$command_output = nil
$progname = $0
alias $PROGRAM_NAME $0
@@ -25,25 +24,33 @@ alias $0 $progname
$extlist = []
$compiled = {}
-srcdir = File.dirname(File.dirname(__FILE__))
-unless defined?(CROSS_COMPILING) and CROSS_COMPILING
- $:.replace([File.expand_path("lib", srcdir), Dir.pwd])
-end
-$:.unshift(srcdir)
+$:.replace([Dir.pwd])
require 'rbconfig'
+srcdir = File.dirname(File.dirname(__FILE__))
+
+$:.unshift(srcdir, File.expand_path("lib", srcdir))
+
$topdir = "."
$top_srcdir = srcdir
-$" << "mkmf.rb"
-load File.expand_path("lib/mkmf.rb", srcdir)
+require 'mkmf'
require 'optparse/shellwords'
def sysquote(x)
- @quote ||= /os2/ =~ (CROSS_COMPILING || RUBY_PLATFORM)
+ @quote ||= /human|os2|macos/ =~ (CROSS_COMPILING || RUBY_PLATFORM)
@quote ? x.quote : x
end
+def relative_from(path, base)
+ dir = File.join(path, "")
+ if File.expand_path(dir) == File.expand_path(dir, base)
+ path
+ else
+ File.join(base, path)
+ end
+end
+
def extract_makefile(makefile, keep = true)
m = File.read(makefile)
if !(target = m[/^TARGET[ \t]*=[ \t]*(\S*)/, 1])
@@ -62,7 +69,7 @@ def extract_makefile(makefile, keep = true)
unless installrb.empty?
config = CONFIG.dup
install_dirs(target_prefix).each {|var, val| config[var] = val}
- FileUtils.rm_f(installrb.values.collect {|f| RbConfig.expand(f, config)}, :verbose => true)
+ FileUtils.rm_f(installrb.values.collect {|f| Config.expand(f, config)}, :verbose => true)
end
end
return false
@@ -80,7 +87,6 @@ def extract_makefile(makefile, keep = true)
end
$objs = (m[/^OBJS[ \t]*=[ \t](.*)/, 1] || "").split
$srcs = (m[/^SRCS[ \t]*=[ \t](.*)/, 1] || "").split
- $distcleanfiles = (m[/^DISTCLEANFILES[ \t]*=[ \t](.*)/, 1] || "").split
$LOCAL_LIBS = m[/^LOCAL_LIBS[ \t]*=[ \t]*(.*)/, 1] || ""
$LIBPATH = Shellwords.shellwords(m[/^libpath[ \t]*=[ \t]*(.*)/, 1] || "") - %w[$(libdir) $(topdir)]
true
@@ -89,6 +95,15 @@ end
def extmake(target)
print "#{$message} #{target}\n"
$stdout.flush
+ if $force_static or $static_ext[target]
+ $static = target
+ else
+ $static = false
+ end
+
+ unless $ignore
+ return true if $nodynamic and not $static
+ end
FileUtils.mkpath target unless File.directory?(target)
begin
@@ -106,13 +121,13 @@ def extmake(target)
$mdir = target
$srcdir = File.join($top_srcdir, "ext", $mdir)
$preload = nil
- $objs = []
- $srcs = []
+ $objs = ""
+ $srcs = ""
$compiled[target] = false
makefile = "./Makefile"
ok = File.exist?(makefile)
unless $ignore
- rbconfig0 = RbConfig::CONFIG
+ rbconfig0 = Config::CONFIG
mkconfig0 = CONFIG
rbconfig = {
"hdrdir" => $hdrdir,
@@ -120,13 +135,13 @@ def extmake(target)
"topdir" => $topdir,
}
mkconfig = {
- "hdrdir" => ($hdrdir == top_srcdir) ? top_srcdir : "$(top_srcdir)/include",
+ "hdrdir" => "$(top_srcdir)",
"srcdir" => "$(top_srcdir)/ext/#{$mdir}",
"topdir" => $topdir,
}
rbconfig0.each_pair {|key, val| rbconfig[key] ||= val.dup}
mkconfig0.each_pair {|key, val| mkconfig[key] ||= val.dup}
- RbConfig.module_eval {
+ Config.module_eval {
remove_const(:CONFIG)
const_set(:CONFIG, rbconfig)
remove_const(:MAKEFILE_CONFIG)
@@ -139,8 +154,6 @@ def extmake(target)
begin
$extconf_h = nil
ok &&= extract_makefile(makefile)
- old_objs = $objs
- old_cleanfiles = $distcleanfiles
conf = ["#{$srcdir}/makefile.rb", "#{$srcdir}/extconf.rb"].find {|f| File.exist?(f)}
if (($extconf_h && !File.exist?($extconf_h)) ||
!(t = modified?(makefile, MTIMES)) ||
@@ -169,7 +182,7 @@ def extmake(target)
ok = yield(ok) if block_given?
unless ok
open(makefile, "w") do |f|
- f.print(*dummy_makefile(CONFIG["srcdir"]))
+ f.print dummy_makefile(CONFIG["srcdir"])
end
return true
end
@@ -181,8 +194,6 @@ def extmake(target)
args += ["static"] unless $clean
$extlist.push [$static, $target, File.basename($target), $preload]
end
- FileUtils.rm_f(old_cleanfiles - $distcleanfiles)
- FileUtils.rm_f(old_objs - $objs)
unless system($make, *args)
$ignore or $continue or return false
end
@@ -192,6 +203,7 @@ def extmake(target)
if $clean != true
FileUtils.rm_f([makefile, $extconf_h || "extconf.h"])
end
+ File.unlink(makefile) rescue nil
end
if $static
$extflags ||= ""
@@ -205,7 +217,7 @@ def extmake(target)
end
ensure
unless $ignore
- RbConfig.module_eval {
+ Config.module_eval {
remove_const(:CONFIG)
const_set(:CONFIG, rbconfig0)
remove_const(:MAKEFILE_CONFIG)
@@ -236,8 +248,8 @@ end
def parse_args()
$mflags = []
- $makeflags = []
+ opts = nil
$optparser ||= OptionParser.new do |opts|
opts.on('-n') {$dryrun = true}
opts.on('--[no-]extension [EXTS]', Array) do |v|
@@ -265,22 +277,18 @@ def parse_args()
if arg = v.first
arg.insert(0, '-') if /\A[^-][^=]*\Z/ =~ arg
end
- $makeflags.concat(v.reject {|arg| /\AMINIRUBY=/ =~ arg}.quote)
$mflags.concat(v)
end
opts.on('--message [MESSAGE]', String) do |v|
$message = v
end
- opts.on('--command-output=FILE', String) do |v|
- $command_output = v
- end
end
begin
$optparser.parse!(ARGV)
rescue OptionParser::InvalidOption => e
retry if /^--/ =~ e.args[0]
$optparser.warn(e)
- abort $optparser.to_s
+ abort opts.to_s
end
$destdir ||= ''
@@ -306,7 +314,7 @@ def parse_args()
$continue = $mflags.set?(?k)
if $extout
$extout = '$(topdir)/'+$extout
- RbConfig::CONFIG["extout"] = CONFIG["extout"] = $extout
+ Config::CONFIG["extout"] = CONFIG["extout"] = $extout
$extout_prefix = $extout ? "$(extout)$(target_prefix)/" : ""
$mflags << "extout=#$extout" << "extout_prefix=#$extout_prefix"
end
@@ -339,7 +347,7 @@ end
EXEEXT = CONFIG['EXEEXT']
if CROSS_COMPILING
- $ruby = $mflags.defined?("MINIRUBY") || CONFIG['MINIRUBY']
+ $ruby = CONFIG['MINIRUBY']
elsif sep = config_string('BUILD_FILE_SEPARATOR')
$ruby = "$(topdir:/=#{sep})#{sep}miniruby" + EXEEXT
else
@@ -351,8 +359,9 @@ unless CROSS_COMPILING
$ruby << " -I'$(extout)/$(arch)' -I'$(extout)/common'" if $extout
$ruby << " -I./- -I'$(top_srcdir)/ext' -rpurelib.rb"
ENV["RUBYLIB"] = "-"
- ENV["RUBYOPT"] = "-r#{File.expand_path('ext/purelib.rb', $top_srcdir)}"
+ ENV["RUBYOPT"] = "-rpurelib.rb"
end
+$config_h = '$(topdir)/config.h'
$mflags << "ruby=#$ruby"
MTIMES = [__FILE__, 'rbconfig.rb', srcdir+'/lib/mkmf.rb'].collect {|f| File.mtime(f)}
@@ -360,9 +369,8 @@ MTIMES = [__FILE__, 'rbconfig.rb', srcdir+'/lib/mkmf.rb'].collect {|f| File.mtim
# get static-link modules
$static_ext = {}
if $extstatic
- $extstatic.each do |t|
- target = t
- target = target.downcase if File::FNM_SYSCASE.nonzero?
+ $extstatic.each do |target|
+ target = target.downcase if /mswin32|bccwin32/ =~ RUBY_PLATFORM
$static_ext[target] = $static_ext.size
end
end
@@ -382,7 +390,7 @@ for dir in ["ext", File::join($top_srcdir, "ext")]
end
next
end
- target = target.downcase if File::FNM_SYSCASE.nonzero?
+ target = target.downcase if /mswin32|bccwin32/ =~ RUBY_PLATFORM
$static_ext[target] = $static_ext.size
end
MTIMES << f.mtime
@@ -398,22 +406,16 @@ if $extension
exts |= $extension.select {|d| File.directory?("#{ext_prefix}/#{d}")}
else
withes, withouts = %w[--with --without].collect {|w|
- if not (w = %w[-extensions -ext].collect {|o|arg_config(w+o)}).any?
- nil
+ if not (w = %w[-extensions -ext].collect {|opt|arg_config(w+opt)}).any?
+ proc {false}
elsif (w = w.grep(String)).empty?
proc {true}
else
- proc {|c1| w.collect {|o| o.split(/,/)}.flatten.any?(&c1)}
+ proc {|c1| w.collect {|opt| opt.split(/,/)}.flatten.any?(&c1)}
end
}
- if withes
- withouts ||= proc {true}
- else
- withes = proc {false}
- withouts ||= withes
- end
- cond = proc {|ext, *|
- cond1 = proc {|n| File.fnmatch(n, ext)}
+ cond = proc {|ext|
+ cond1 = proc {|n| File.fnmatch(n, ext, File::FNM_PATHNAME)}
withes.call(cond1) or !withouts.call(cond1)
}
exts |= Dir.glob("#{ext_prefix}/*/**/extconf.rb").collect {|d|
@@ -426,7 +428,7 @@ else
end
if $extout
- extout = RbConfig.expand("#{$extout}", RbConfig::CONFIG.merge("topdir"=>$topdir))
+ extout = Config.expand("#{$extout}", Config::CONFIG.merge("topdir"=>$topdir))
unless $ignore
FileUtils.mkpath(extout)
end
@@ -437,13 +439,9 @@ FileUtils::makedirs('ext')
Dir::chdir('ext')
hdrdir = $hdrdir
-$hdrdir = ($top_srcdir = relative_from(srcdir, $topdir = "..")) + "/include"
+$hdrdir = $top_srcdir = relative_from(srcdir, $topdir = "..")
exts.each do |d|
- $static = $force_static ? $static_ext[target] : false
-
- if $ignore or !$nodynamic or $static
- extmake(d) or abort
- end
+ extmake(d) or abort
end
$top_srcdir = srcdir
$topdir = "."
@@ -502,21 +500,18 @@ unless $extlist.empty?
src = %{\
#include "ruby.h"
-#define init(func, name) { \\
- extern void func _((void)); \\
- ruby_init_ext(name, func); \\
-}
+#define init(func, name) {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}
+ open(extinit.c, "w") {|f| f.print src}
end
$extobjs = "ext/#{extinit.o} #{$extobjs}"
- if RUBY_PLATFORM =~ /beos/
+ if RUBY_PLATFORM =~ /m68k-human|beos/
$extflags.delete("-L/usr/local/lib")
end
$extpath.delete("$(topdir)")
@@ -529,18 +524,17 @@ void Init_ext _((void))\n{\n#$extinit}
].map {|n, v|
"#{n}=#{v}" if v and !(v = v.strip).empty?
}.compact
- puts(*conf)
+ puts conf
$stdout.flush
$mflags.concat(conf)
- $makeflags.concat(conf)
else
FileUtils.rm_f(extinit.to_a)
end
rubies = []
-%w[RUBY RUBYW STATIC_RUBY].each {|n|
- r = n
+%w[RUBY RUBYW STATIC_RUBY].each {|r|
+ n = r
if r = arg_config("--"+r.downcase) || config_string(r+"_INSTALL_NAME")
- rubies << RbConfig.expand(r+=EXEEXT)
+ rubies << Config.expand(r+=EXEEXT)
$mflags << "#{n}=#{r}"
end
}
@@ -549,10 +543,9 @@ Dir.chdir ".."
unless $destdir.to_s.empty?
$mflags.defined?("DESTDIR") or $mflags << "DESTDIR=#{$destdir}"
end
-message = "making #{rubies.join(', ')}"
+puts "making #{rubies.join(', ')}"
+$stdout.flush
$mflags.concat(rubies)
-$makeflags.uniq!
-$makeflags.concat(rubies)
if $nmake == ?b
unless (vars = $mflags.grep(/\A\w+=/n)).empty?
@@ -566,29 +559,7 @@ if $nmake == ?b
vars.each {|flag| flag.sub!(/\A/, "-D")}
end
end
-$mflags.unshift("topdir=#$topdir")
-ENV.delete("RUBYOPT")
-if $command_output
- message = "echo #{message}"
- cmd = $makeflags.quote.join(' ')
- open($command_output, 'wb') do |f|
- case $command_output
- when /\.sh\z/
- f.puts message, "rm -f $0; exec \"$@\" #{cmd}"
- when /\.bat\z/
- ["@echo off", message, "%* #{cmd}", "del %0 & exit %ERRORLEVEL%"].each do |s|
- f.print s, "\r\n"
- end
- else
- f.puts cmd
- end
- f.chmod(0755)
- end
-else
- puts message
- $stdout.flush
- system($make, *sysquote($mflags)) or exit($?.exitstatus)
-end
+system($make, *sysquote($mflags)) or exit($?.exitstatus)
#Local variables:
# mode: ruby
diff --git a/ext/fcntl/.cvsignore b/ext/fcntl/.cvsignore
index 814345ece8..4088712231 100644
--- a/ext/fcntl/.cvsignore
+++ b/ext/fcntl/.cvsignore
@@ -1,4 +1,3 @@
Makefile
mkmf.log
*.def
-extconf.h
diff --git a/ext/fiber/extconf.rb b/ext/fiber/extconf.rb
deleted file mode 100644
index 904ab94a9c..0000000000
--- a/ext/fiber/extconf.rb
+++ /dev/null
@@ -1,3 +0,0 @@
-require 'mkmf'
-create_makefile('fiber')
-
diff --git a/ext/fiber/fiber.c b/ext/fiber/fiber.c
deleted file mode 100644
index 12fcaad73b..0000000000
--- a/ext/fiber/fiber.c
+++ /dev/null
@@ -1,8 +0,0 @@
-
-void ruby_Init_Fiber_as_Coroutine(void);
-
-void
-Init_fiber(void)
-{
- ruby_Init_Fiber_as_Coroutine();
-}
diff --git a/ext/gdbm/.cvsignore b/ext/gdbm/.cvsignore
index 814345ece8..4088712231 100644
--- a/ext/gdbm/.cvsignore
+++ b/ext/gdbm/.cvsignore
@@ -1,4 +1,3 @@
Makefile
mkmf.log
*.def
-extconf.h
diff --git a/ext/gdbm/gdbm.c b/ext/gdbm/gdbm.c
index 71a159171e..2057101206 100644
--- a/ext/gdbm/gdbm.c
+++ b/ext/gdbm/gdbm.c
@@ -3,6 +3,7 @@
gdbm.c -
$Author$
+ $Date$
modified at: Mon Jan 24 15:59:52 JST 1994
Documentation by Peter Adolphs < futzilogik at users dot sourceforge dot net >
@@ -78,7 +79,8 @@ static VALUE rb_cGDBM, rb_eGDBMError, rb_eGDBMFatalError;
#define MY_BLOCK_SIZE (2048)
#define MY_FATAL_FUNC rb_gdbm_fatal
static void
-rb_gdbm_fatal(char *msg)
+rb_gdbm_fatal(msg)
+ char *msg;
{
rb_raise(rb_eGDBMFatalError, "%s", msg);
}
@@ -89,7 +91,7 @@ struct dbmdata {
};
static void
-closed_dbm(void)
+closed_dbm()
{
rb_raise(rb_eRuntimeError, "closed GDBM file");
}
@@ -106,11 +108,12 @@ closed_dbm(void)
}
static void
-free_dbm(struct dbmdata *dbmp)
+free_dbm(dbmp)
+ struct dbmdata *dbmp;
{
if (dbmp) {
if (dbmp->di_dbm) gdbm_close(dbmp->di_dbm);
- xfree(dbmp);
+ free(dbmp);
}
}
@@ -121,7 +124,8 @@ free_dbm(struct dbmdata *dbmp)
* Closes the associated database file.
*/
static VALUE
-fgdbm_close(VALUE obj)
+fgdbm_close(obj)
+ VALUE obj;
{
struct dbmdata *dbmp;
@@ -139,7 +143,8 @@ fgdbm_close(VALUE obj)
* Returns true if the associated database file has been closed.
*/
static VALUE
-fgdbm_closed(VALUE obj)
+fgdbm_closed(obj)
+ VALUE obj;
{
struct dbmdata *dbmp;
@@ -152,8 +157,11 @@ fgdbm_closed(VALUE obj)
return Qfalse;
}
+static VALUE fgdbm_s_alloc _((VALUE));
+
static VALUE
-fgdbm_s_alloc(VALUE klass)
+fgdbm_s_alloc(klass)
+ VALUE klass;
{
return Data_Wrap_Struct(klass, 0, free_dbm, 0);
}
@@ -182,7 +190,10 @@ fgdbm_s_alloc(VALUE klass)
* database file as a reader (cf. flag <tt>READER</tt>).
*/
static VALUE
-fgdbm_initialize(int argc, VALUE *argv, VALUE obj)
+fgdbm_initialize(argc, argv, obj)
+ int argc;
+ VALUE *argv;
+ VALUE obj;
{
VALUE file, vmode, vflags;
GDBM_FILE dbm;
@@ -206,31 +217,31 @@ fgdbm_initialize(int argc, VALUE *argv, VALUE obj)
if (flags & RUBY_GDBM_RW_BIT) {
flags &= ~RUBY_GDBM_RW_BIT;
- dbm = gdbm_open(RSTRING_PTR(file), MY_BLOCK_SIZE,
- flags, mode, MY_FATAL_FUNC);
+ dbm = gdbm_open(RSTRING(file)->ptr, MY_BLOCK_SIZE,
+ flags, mode, MY_FATAL_FUNC);
}
else {
dbm = 0;
if (mode >= 0)
- dbm = gdbm_open(RSTRING_PTR(file), MY_BLOCK_SIZE,
+ dbm = gdbm_open(RSTRING(file)->ptr, MY_BLOCK_SIZE,
GDBM_WRCREAT|flags, mode, MY_FATAL_FUNC);
if (!dbm)
- dbm = gdbm_open(RSTRING_PTR(file), MY_BLOCK_SIZE,
+ dbm = gdbm_open(RSTRING(file)->ptr, MY_BLOCK_SIZE,
GDBM_WRITER|flags, 0, MY_FATAL_FUNC);
if (!dbm)
- dbm = gdbm_open(RSTRING_PTR(file), MY_BLOCK_SIZE,
+ dbm = gdbm_open(RSTRING(file)->ptr, MY_BLOCK_SIZE,
GDBM_READER|flags, 0, MY_FATAL_FUNC);
}
if (!dbm) {
- if (mode == -1) return Qnil;
-
- if (gdbm_errno == GDBM_FILE_OPEN_ERROR ||
- gdbm_errno == GDBM_CANT_BE_READER ||
- gdbm_errno == GDBM_CANT_BE_WRITER)
- rb_sys_fail(RSTRING_PTR(file));
- else
- rb_raise(rb_eGDBMError, "%s", gdbm_strerror(gdbm_errno));
+ if (mode == -1) return Qnil;
+
+ if (gdbm_errno == GDBM_FILE_OPEN_ERROR ||
+ gdbm_errno == GDBM_CANT_BE_READER ||
+ gdbm_errno == GDBM_CANT_BE_WRITER)
+ rb_sys_fail(RSTRING(file)->ptr);
+ else
+ rb_raise(rb_eGDBMError, "%s", gdbm_strerror(gdbm_errno));
}
dbmp = ALLOC(struct dbmdata);
@@ -262,12 +273,15 @@ fgdbm_initialize(int argc, VALUE *argv, VALUE obj)
* end
*/
static VALUE
-fgdbm_s_open(int argc, VALUE *argv, VALUE klass)
+fgdbm_s_open(argc, argv, klass)
+ int argc;
+ VALUE *argv;
+ VALUE klass;
{
VALUE obj = Data_Wrap_Struct(klass, 0, free_dbm, 0);
if (NIL_P(fgdbm_initialize(argc, argv, obj))) {
- return Qnil;
+ return Qnil;
}
if (rb_block_given_p()) {
@@ -278,7 +292,9 @@ fgdbm_s_open(int argc, VALUE *argv, VALUE klass)
}
static VALUE
-rb_gdbm_fetch(GDBM_FILE dbm, datum key)
+rb_gdbm_fetch(dbm, key)
+ GDBM_FILE dbm;
+ datum key;
{
datum val;
VALUE str;
@@ -294,19 +310,22 @@ rb_gdbm_fetch(GDBM_FILE dbm, datum key)
}
static VALUE
-rb_gdbm_fetch2(GDBM_FILE dbm, VALUE keystr)
+rb_gdbm_fetch2(dbm, keystr)
+ GDBM_FILE dbm;
+ VALUE keystr;
{
datum key;
StringValue(keystr);
- key.dptr = RSTRING_PTR(keystr);
- key.dsize = RSTRING_LEN(keystr);
+ key.dptr = RSTRING(keystr)->ptr;
+ key.dsize = RSTRING(keystr)->len;
return rb_gdbm_fetch(dbm, key);
}
static VALUE
-rb_gdbm_fetch3(VALUE obj, VALUE keystr)
+rb_gdbm_fetch3(obj, keystr)
+ VALUE obj, keystr;
{
struct dbmdata *dbmp;
GDBM_FILE dbm;
@@ -316,7 +335,8 @@ rb_gdbm_fetch3(VALUE obj, VALUE keystr)
}
static VALUE
-rb_gdbm_firstkey(GDBM_FILE dbm)
+rb_gdbm_firstkey(dbm)
+ GDBM_FILE dbm;
{
datum key;
VALUE str;
@@ -332,13 +352,15 @@ rb_gdbm_firstkey(GDBM_FILE dbm)
}
static VALUE
-rb_gdbm_nextkey(GDBM_FILE dbm, VALUE keystr)
+rb_gdbm_nextkey(dbm, keystr)
+ GDBM_FILE dbm;
+ VALUE keystr;
{
datum key, key2;
VALUE str;
- key.dptr = RSTRING_PTR(keystr);
- key.dsize = RSTRING_LEN(keystr);
+ key.dptr = RSTRING(keystr)->ptr;
+ key.dsize = RSTRING(keystr)->len;
key2 = gdbm_nextkey(dbm, key);
if (key2.dptr == 0)
return Qnil;
@@ -350,15 +372,16 @@ rb_gdbm_nextkey(GDBM_FILE dbm, VALUE keystr)
}
static VALUE
-fgdbm_fetch(VALUE obj, VALUE keystr, VALUE ifnone)
+fgdbm_fetch(obj, keystr, ifnone)
+ VALUE obj, keystr, ifnone;
{
VALUE valstr;
valstr = rb_gdbm_fetch3(obj, keystr);
if (NIL_P(valstr)) {
- if (ifnone == Qnil && rb_block_given_p())
- return rb_yield(keystr);
- return ifnone;
+ if (ifnone == Qnil && rb_block_given_p())
+ return rb_yield(keystr);
+ return ifnone;
}
return valstr;
}
@@ -370,7 +393,8 @@ fgdbm_fetch(VALUE obj, VALUE keystr, VALUE ifnone)
* Retrieves the _value_ corresponding to _key_.
*/
static VALUE
-fgdbm_aref(VALUE obj, VALUE keystr)
+fgdbm_aref(obj, keystr)
+ VALUE obj, keystr;
{
return rb_gdbm_fetch3(obj, keystr);
}
@@ -383,7 +407,10 @@ fgdbm_aref(VALUE obj, VALUE keystr)
* associated with _key_, _default_ will be returned instead.
*/
static VALUE
-fgdbm_fetch_m(int argc, VALUE *argv, VALUE obj)
+fgdbm_fetch_m(argc, argv, obj)
+ int argc;
+ VALUE *argv;
+ VALUE obj;
{
VALUE keystr, valstr, ifnone;
@@ -397,13 +424,14 @@ fgdbm_fetch_m(int argc, VALUE *argv, VALUE obj)
/*
* call-seq:
- * gdbm.key(value) -> key
+ * gdbm.index(value) -> key
*
* Returns the _key_ for a given _value_. If several keys may map to the
* same value, the key that is found first will be returned.
*/
static VALUE
-fgdbm_key(VALUE obj, VALUE valstr)
+fgdbm_index(obj, valstr)
+ VALUE obj, valstr;
{
struct dbmdata *dbmp;
GDBM_FILE dbm;
@@ -414,23 +442,32 @@ fgdbm_key(VALUE obj, VALUE valstr)
for (keystr = rb_gdbm_firstkey(dbm); RTEST(keystr);
keystr = rb_gdbm_nextkey(dbm, keystr)) {
- valstr2 = rb_gdbm_fetch2(dbm, keystr);
+ valstr2 = rb_gdbm_fetch2(dbm, keystr);
if (!NIL_P(valstr2) &&
- RSTRING_LEN(valstr) == RSTRING_LEN(valstr2) &&
- memcmp(RSTRING_PTR(valstr), RSTRING_PTR(valstr2),
- RSTRING_LEN(valstr)) == 0) {
- return keystr;
+ RSTRING(valstr)->len == RSTRING(valstr2)->len &&
+ memcmp(RSTRING(valstr)->ptr, RSTRING(valstr2)->ptr,
+ RSTRING(valstr)->len) == 0) {
+ return keystr;
}
}
return Qnil;
}
-/* :nodoc: */
static VALUE
-fgdbm_index(VALUE obj, VALUE value)
+fgdbm_indexes(argc, argv, obj)
+ int argc;
+ VALUE *argv;
+ VALUE obj;
{
- rb_warn("GDBM#index is deprecated; use GDBM#key");
- return fgdbm_key(obj, value);
+ VALUE new;
+ int i;
+
+ new = rb_ary_new2(argc);
+ for (i=0; i<argc; i++) {
+ rb_ary_push(new, rb_gdbm_fetch3(obj, argv[i]));
+ }
+
+ return new;
}
/*
@@ -441,23 +478,40 @@ fgdbm_index(VALUE obj, VALUE value)
* evaluates to true.
*/
static VALUE
-fgdbm_select(VALUE obj)
+fgdbm_select(argc, argv, obj)
+ int argc;
+ VALUE *argv;
+ VALUE obj;
{
- VALUE new = rb_ary_new();
- GDBM_FILE dbm;
- struct dbmdata *dbmp;
- VALUE keystr;
+ VALUE new = rb_ary_new2(argc);
+ int i;
- GetDBM2(obj, dbmp, dbm);
- for (keystr = rb_gdbm_firstkey(dbm); RTEST(keystr);
- keystr = rb_gdbm_nextkey(dbm, keystr)) {
- VALUE assoc = rb_assoc_new(keystr, rb_gdbm_fetch2(dbm, keystr));
- VALUE v = rb_yield(assoc);
+ if (rb_block_given_p()) {
+ GDBM_FILE dbm;
+ struct dbmdata *dbmp;
+ VALUE keystr;
- if (RTEST(v)) {
- rb_ary_push(new, assoc);
- }
+ if (argc > 0) {
+ rb_raise(rb_eArgError, "wrong number arguments(%d for 0)", argc);
+ }
GetDBM2(obj, dbmp, dbm);
+ for (keystr = rb_gdbm_firstkey(dbm); RTEST(keystr);
+ keystr = rb_gdbm_nextkey(dbm, keystr)) {
+ VALUE assoc = rb_assoc_new(keystr, rb_gdbm_fetch2(dbm, keystr));
+ VALUE v = rb_yield(assoc);
+
+ if (RTEST(v)) {
+ rb_ary_push(new, assoc);
+ }
+ GetDBM2(obj, dbmp, dbm);
+ }
+ }
+ else {
+ rb_warn("GDBM#select(index..) is deprecated; use GDBM#values_at");
+
+ for (i=0; i<argc; i++) {
+ rb_ary_push(new, rb_gdbm_fetch3(obj, argv[i]));
+ }
}
return new;
@@ -470,7 +524,10 @@ fgdbm_select(VALUE obj)
* Returns an array of the values associated with each specified _key_.
*/
static VALUE
-fgdbm_values_at(int argc, VALUE *argv, VALUE obj)
+fgdbm_values_at(argc, argv, obj)
+ int argc;
+ VALUE *argv;
+ VALUE obj;
{
VALUE new = rb_ary_new2(argc);
int i;
@@ -483,14 +540,16 @@ fgdbm_values_at(int argc, VALUE *argv, VALUE obj)
}
static void
-rb_gdbm_modify(VALUE obj)
+rb_gdbm_modify(obj)
+ VALUE obj;
{
rb_secure(4);
if (OBJ_FROZEN(obj)) rb_error_frozen("GDBM");
}
static VALUE
-rb_gdbm_delete(VALUE obj, VALUE keystr)
+rb_gdbm_delete(obj, keystr)
+ VALUE obj, keystr;
{
datum key;
struct dbmdata *dbmp;
@@ -498,8 +557,8 @@ rb_gdbm_delete(VALUE obj, VALUE keystr)
rb_gdbm_modify(obj);
StringValue(keystr);
- key.dptr = RSTRING_PTR(keystr);
- key.dsize = RSTRING_LEN(keystr);
+ key.dptr = RSTRING(keystr)->ptr;
+ key.dsize = RSTRING(keystr)->len;
GetDBM2(obj, dbmp, dbm);
if (!gdbm_exists(dbm, key)) {
@@ -524,7 +583,8 @@ rb_gdbm_delete(VALUE obj, VALUE keystr)
* returns the corresponding _value_. Returns nil if the database is empty.
*/
static VALUE
-fgdbm_delete(VALUE obj, VALUE keystr)
+fgdbm_delete(obj, keystr)
+ VALUE obj, keystr;
{
VALUE valstr;
@@ -541,7 +601,8 @@ fgdbm_delete(VALUE obj, VALUE keystr)
* two-item array [ _key_, _value_ ]. Returns nil if the database is empty.
*/
static VALUE
-fgdbm_shift(VALUE obj)
+fgdbm_shift(obj)
+ VALUE obj;
{
struct dbmdata *dbmp;
GDBM_FILE dbm;
@@ -565,7 +626,8 @@ fgdbm_shift(VALUE obj)
* Deletes every key-value pair from _gdbm_ for which _block_ evaluates to true.
*/
static VALUE
-fgdbm_delete_if(VALUE obj)
+fgdbm_delete_if(obj)
+ VALUE obj;
{
struct dbmdata *dbmp;
GDBM_FILE dbm;
@@ -588,10 +650,10 @@ fgdbm_delete_if(VALUE obj)
GetDBM2(obj, dbmp, dbm);
}
- for (i = 0; i < RARRAY_LEN(ary); i++)
- rb_gdbm_delete(obj, RARRAY_PTR(ary)[i]);
+ for (i = 0; i < RARRAY(ary)->len; i++)
+ rb_gdbm_delete(obj, RARRAY(ary)->ptr[i]);
if (status) rb_jump_tag(status);
- if (n > 0) dbmp->di_size = n - RARRAY_LEN(ary);
+ if (n > 0) dbmp->di_size = n - RARRAY(ary)->len;
return obj;
}
@@ -603,7 +665,8 @@ fgdbm_delete_if(VALUE obj)
* Removes all the key-value pairs within _gdbm_.
*/
static VALUE
-fgdbm_clear(VALUE obj)
+fgdbm_clear(obj)
+ VALUE obj;
{
datum key, nextkey;
struct dbmdata *dbmp;
@@ -647,7 +710,8 @@ fgdbm_clear(VALUE obj)
* as values.
*/
static VALUE
-fgdbm_invert(VALUE obj)
+fgdbm_invert(obj)
+ VALUE obj;
{
struct dbmdata *dbmp;
GDBM_FILE dbm;
@@ -657,55 +721,33 @@ fgdbm_invert(VALUE obj)
GetDBM2(obj, dbmp, dbm);
for (keystr = rb_gdbm_firstkey(dbm); RTEST(keystr);
keystr = rb_gdbm_nextkey(dbm, keystr)) {
- valstr = rb_gdbm_fetch2(dbm, keystr);
+ valstr = rb_gdbm_fetch2(dbm, keystr);
- rb_hash_aset(hash, valstr, keystr);
+ rb_hash_aset(hash, valstr, keystr);
}
return hash;
}
-/*
- * call-seq:
- * gdbm[key]= value -> value
- * gdbm.store(key, value) -> value
- *
- * Associates the value _value_ with the specified _key_.
- */
+static VALUE each_pair _((VALUE));
+
static VALUE
-fgdbm_store(VALUE obj, VALUE keystr, VALUE valstr)
+each_pair(obj)
+ VALUE obj;
{
- datum key, val;
- struct dbmdata *dbmp;
- GDBM_FILE dbm;
-
- rb_gdbm_modify(obj);
- StringValue(keystr);
- StringValue(valstr);
-
- key.dptr = RSTRING_PTR(keystr);
- key.dsize = RSTRING_LEN(keystr);
-
- val.dptr = RSTRING_PTR(valstr);
- val.dsize = RSTRING_LEN(valstr);
-
- GetDBM2(obj, dbmp, dbm);
- dbmp->di_size = -1;
- if (gdbm_store(dbm, key, val, GDBM_REPLACE)) {
- if (errno == EPERM) rb_sys_fail(0);
- rb_raise(rb_eGDBMError, "%s", gdbm_strerror(gdbm_errno));
- }
-
- return valstr;
+ return rb_funcall(obj, rb_intern("each_pair"), 0, 0);
}
+static VALUE fgdbm_store _((VALUE,VALUE,VALUE));
+
static VALUE
-update_i(VALUE pair, VALUE dbm)
+update_i(pair, dbm)
+ VALUE pair, dbm;
{
Check_Type(pair, T_ARRAY);
- if (RARRAY_LEN(pair) < 2) {
- rb_raise(rb_eArgError, "pair must be [key, value]");
+ if (RARRAY(pair)->len < 2) {
+ rb_raise(rb_eArgError, "pair must be [key, value]");
}
- fgdbm_store(dbm, RARRAY_PTR(pair)[0], RARRAY_PTR(pair)[1]);
+ fgdbm_store(dbm, RARRAY(pair)->ptr[0], RARRAY(pair)->ptr[1]);
return Qnil;
}
@@ -718,9 +760,10 @@ update_i(VALUE pair, VALUE dbm)
* method.
*/
static VALUE
-fgdbm_update(VALUE obj, VALUE other)
+fgdbm_update(obj, other)
+ VALUE obj, other;
{
- rb_block_call(other, rb_intern("each_pair"), 0, 0, update_i, obj);
+ rb_iterate(each_pair, other, update_i, obj);
return obj;
}
@@ -732,22 +775,59 @@ fgdbm_update(VALUE obj, VALUE other)
* _other_ must have an each_pair method.
*/
static VALUE
-fgdbm_replace(VALUE obj, VALUE other)
+fgdbm_replace(obj, other)
+ VALUE obj, other;
{
fgdbm_clear(obj);
- rb_block_call(other, rb_intern("each_pair"), 0, 0, update_i, obj);
+ rb_iterate(each_pair, other, update_i, obj);
return obj;
}
/*
* call-seq:
+ * gdbm[key]= value -> value
+ * gdbm.store(key, value) -> value
+ *
+ * Associates the value _value_ with the specified _key_.
+ */
+static VALUE
+fgdbm_store(obj, keystr, valstr)
+ VALUE obj, keystr, valstr;
+{
+ datum key, val;
+ struct dbmdata *dbmp;
+ GDBM_FILE dbm;
+
+ rb_gdbm_modify(obj);
+ StringValue(keystr);
+ StringValue(valstr);
+
+ key.dptr = RSTRING(keystr)->ptr;
+ key.dsize = RSTRING(keystr)->len;
+
+ val.dptr = RSTRING(valstr)->ptr;
+ val.dsize = RSTRING(valstr)->len;
+
+ GetDBM2(obj, dbmp, dbm);
+ dbmp->di_size = -1;
+ if (gdbm_store(dbm, key, val, GDBM_REPLACE)) {
+ if (errno == EPERM) rb_sys_fail(0);
+ rb_raise(rb_eGDBMError, "%s", gdbm_strerror(gdbm_errno));
+ }
+
+ return valstr;
+}
+
+/*
+ * call-seq:
* gdbm.length -> fixnum
* gdbm.size -> fixnum
*
* Returns the number of key-value pairs in this database.
*/
static VALUE
-fgdbm_length(VALUE obj)
+fgdbm_length(obj)
+ VALUE obj;
{
datum key, nextkey;
struct dbmdata *dbmp;
@@ -760,7 +840,7 @@ fgdbm_length(VALUE obj)
for (key = gdbm_firstkey(dbm); key.dptr; key = nextkey) {
nextkey = gdbm_nextkey(dbm, key);
free(key.dptr);
- i++;
+ i++;
}
dbmp->di_size = i;
@@ -774,7 +854,8 @@ fgdbm_length(VALUE obj)
* Returns true if the database is empty.
*/
static VALUE
-fgdbm_empty_p(VALUE obj)
+fgdbm_empty_p(obj)
+ VALUE obj;
{
datum key;
struct dbmdata *dbmp;
@@ -782,13 +863,13 @@ fgdbm_empty_p(VALUE obj)
GetDBM(obj, dbmp);
if (dbmp->di_size < 0) {
- dbm = dbmp->di_dbm;
+ dbm = dbmp->di_dbm;
- key = gdbm_firstkey(dbm);
+ key = gdbm_firstkey(dbm);
if (key.dptr) {
free(key.dptr);
return Qfalse;
- }
+ }
return Qtrue;
}
@@ -804,20 +885,19 @@ fgdbm_empty_p(VALUE obj)
* _value_ as a parameter.
*/
static VALUE
-fgdbm_each_value(VALUE obj)
+fgdbm_each_value(obj)
+ VALUE obj;
{
struct dbmdata *dbmp;
GDBM_FILE dbm;
VALUE keystr;
- RETURN_ENUMERATOR(obj, 0, 0);
-
GetDBM2(obj, dbmp, dbm);
for (keystr = rb_gdbm_firstkey(dbm); RTEST(keystr);
keystr = rb_gdbm_nextkey(dbm, keystr)) {
rb_yield(rb_gdbm_fetch2(dbm, keystr));
- GetDBM2(obj, dbmp, dbm);
+ GetDBM2(obj, dbmp, dbm);
}
return obj;
}
@@ -830,20 +910,19 @@ fgdbm_each_value(VALUE obj)
* _key_ as a parameter.
*/
static VALUE
-fgdbm_each_key(VALUE obj)
+fgdbm_each_key(obj)
+ VALUE obj;
{
struct dbmdata *dbmp;
GDBM_FILE dbm;
VALUE keystr;
- RETURN_ENUMERATOR(obj, 0, 0);
-
GetDBM2(obj, dbmp, dbm);
for (keystr = rb_gdbm_firstkey(dbm); RTEST(keystr);
keystr = rb_gdbm_nextkey(dbm, keystr)) {
rb_yield(keystr);
- GetDBM2(obj, dbmp, dbm);
+ GetDBM2(obj, dbmp, dbm);
}
return obj;
}
@@ -856,14 +935,13 @@ fgdbm_each_key(VALUE obj)
* correspoding _value_ as a parameter.
*/
static VALUE
-fgdbm_each_pair(VALUE obj)
+fgdbm_each_pair(obj)
+ VALUE obj;
{
GDBM_FILE dbm;
struct dbmdata *dbmp;
VALUE keystr;
- RETURN_ENUMERATOR(obj, 0, 0);
-
GetDBM2(obj, dbmp, dbm);
for (keystr = rb_gdbm_firstkey(dbm); RTEST(keystr);
keystr = rb_gdbm_nextkey(dbm, keystr)) {
@@ -882,7 +960,8 @@ fgdbm_each_pair(VALUE obj)
* Returns an array of all keys of this database.
*/
static VALUE
-fgdbm_keys(VALUE obj)
+fgdbm_keys(obj)
+ VALUE obj;
{
struct dbmdata *dbmp;
GDBM_FILE dbm;
@@ -906,7 +985,8 @@ fgdbm_keys(VALUE obj)
* Returns an array of all values of this database.
*/
static VALUE
-fgdbm_values(VALUE obj)
+fgdbm_values(obj)
+ VALUE obj;
{
datum key, nextkey;
struct dbmdata *dbmp;
@@ -934,15 +1014,16 @@ fgdbm_values(VALUE obj)
* Returns false otherwise.
*/
static VALUE
-fgdbm_has_key(VALUE obj, VALUE keystr)
+fgdbm_has_key(obj, keystr)
+ VALUE obj, keystr;
{
datum key;
struct dbmdata *dbmp;
GDBM_FILE dbm;
StringValue(keystr);
- key.dptr = RSTRING_PTR(keystr);
- key.dsize = RSTRING_LEN(keystr);
+ key.dptr = RSTRING(keystr)->ptr;
+ key.dsize = RSTRING(keystr)->len;
GetDBM2(obj, dbmp, dbm);
if (gdbm_exists(dbm, key))
@@ -959,7 +1040,8 @@ fgdbm_has_key(VALUE obj, VALUE keystr)
* Returns false otherwise.
*/
static VALUE
-fgdbm_has_value(VALUE obj, VALUE valstr)
+fgdbm_has_value(obj, valstr)
+ VALUE obj, valstr;
{
struct dbmdata *dbmp;
GDBM_FILE dbm;
@@ -970,13 +1052,13 @@ fgdbm_has_value(VALUE obj, VALUE valstr)
for (keystr = rb_gdbm_firstkey(dbm); RTEST(keystr);
keystr = rb_gdbm_nextkey(dbm, keystr)) {
- valstr2 = rb_gdbm_fetch2(dbm, keystr);
+ valstr2 = rb_gdbm_fetch2(dbm, keystr);
if (!NIL_P(valstr2) &&
- RSTRING_LEN(valstr) == RSTRING_LEN(valstr2) &&
- memcmp(RSTRING_PTR(valstr), RSTRING_PTR(valstr2),
- RSTRING_LEN(valstr)) == 0) {
- return Qtrue;
+ RSTRING(valstr)->len == RSTRING(valstr2)->len &&
+ memcmp(RSTRING(valstr)->ptr, RSTRING(valstr2)->ptr,
+ RSTRING(valstr)->len) == 0) {
+ return Qtrue;
}
}
return Qfalse;
@@ -989,7 +1071,8 @@ fgdbm_has_value(VALUE obj, VALUE valstr)
* Returns an array of all key-value pairs contained in the database.
*/
static VALUE
-fgdbm_to_a(VALUE obj)
+fgdbm_to_a(obj)
+ VALUE obj;
{
struct dbmdata *dbmp;
GDBM_FILE dbm;
@@ -1015,7 +1098,8 @@ fgdbm_to_a(VALUE obj)
* deletions in the database.
*/
static VALUE
-fgdbm_reorganize(VALUE obj)
+fgdbm_reorganize(obj)
+ VALUE obj;
{
struct dbmdata *dbmp;
GDBM_FILE dbm;
@@ -1037,7 +1121,8 @@ fgdbm_reorganize(VALUE obj)
* to the disk have been finished.
*/
static VALUE
-fgdbm_sync(VALUE obj)
+fgdbm_sync(obj)
+ VALUE obj;
{
struct dbmdata *dbmp;
GDBM_FILE dbm;
@@ -1055,7 +1140,8 @@ fgdbm_sync(VALUE obj)
* Sets the size of the internal bucket cache to _size_.
*/
static VALUE
-fgdbm_set_cachesize(VALUE obj, VALUE val)
+fgdbm_set_cachesize(obj, val)
+ VALUE obj, val;
{
struct dbmdata *dbmp;
GDBM_FILE dbm;
@@ -1080,7 +1166,8 @@ fgdbm_set_cachesize(VALUE obj, VALUE val)
* default. See also: #syncmode=
*/
static VALUE
-fgdbm_set_fastmode(VALUE obj, VALUE val)
+fgdbm_set_fastmode(obj, val)
+ VALUE obj, val;
{
struct dbmdata *dbmp;
GDBM_FILE dbm;
@@ -1111,7 +1198,8 @@ fgdbm_set_fastmode(VALUE obj, VALUE val)
* by default. See also: #fastmode=
*/
static VALUE
-fgdbm_set_syncmode(VALUE obj, VALUE val)
+fgdbm_set_syncmode(obj, val)
+ VALUE obj, val;
{
#if !defined(GDBM_SYNCMODE)
fgdbm_set_fastmode(obj, RTEST(val) ? Qfalse : Qtrue);
@@ -1140,7 +1228,8 @@ fgdbm_set_syncmode(VALUE obj, VALUE val)
* Returns a hash of all key-value pairs contained in the database.
*/
static VALUE
-fgdbm_to_hash(VALUE obj)
+fgdbm_to_hash(obj)
+ VALUE obj;
{
struct dbmdata *dbmp;
GDBM_FILE dbm;
@@ -1165,13 +1254,14 @@ fgdbm_to_hash(VALUE obj)
* which _block_ evaluates to true are removed. See also: #delete_if
*/
static VALUE
-fgdbm_reject(VALUE obj)
+fgdbm_reject(obj)
+ VALUE obj;
{
return rb_hash_delete_if(fgdbm_to_hash(obj));
}
void
-Init_gdbm(void)
+Init_gdbm()
{
rb_cGDBM = rb_define_class("GDBM", rb_cObject);
rb_eGDBMError = rb_define_class("GDBMError", rb_eStandardError);
@@ -1189,8 +1279,9 @@ Init_gdbm(void)
rb_define_method(rb_cGDBM, "[]=", fgdbm_store, 2);
rb_define_method(rb_cGDBM, "store", fgdbm_store, 2);
rb_define_method(rb_cGDBM, "index", fgdbm_index, 1);
- rb_define_method(rb_cGDBM, "key", fgdbm_key, 1);
- rb_define_method(rb_cGDBM, "select", fgdbm_select, 0);
+ rb_define_method(rb_cGDBM, "indexes", fgdbm_indexes, -1);
+ rb_define_method(rb_cGDBM, "indices", fgdbm_indexes, -1);
+ rb_define_method(rb_cGDBM, "select", fgdbm_select, -1);
rb_define_method(rb_cGDBM, "values_at", fgdbm_values_at, -1);
rb_define_method(rb_cGDBM, "length", fgdbm_length, 0);
rb_define_method(rb_cGDBM, "size", fgdbm_length, 0);
diff --git a/ext/iconv/.cvsignore b/ext/iconv/.cvsignore
index 66c8f5297a..394787fced 100644
--- a/ext/iconv/.cvsignore
+++ b/ext/iconv/.cvsignore
@@ -3,4 +3,3 @@ mkmf.log
*.def
iconv.rb
config.charset
-extconf.h
diff --git a/ext/iconv/charset_alias.rb b/ext/iconv/charset_alias.rb
index d4ed9139c8..aed4644290 100644
--- a/ext/iconv/charset_alias.rb
+++ b/ext/iconv/charset_alias.rb
@@ -6,8 +6,8 @@ require 'optparse'
# http://www.ctan.org/tex-archive/macros/texinfo/texinfo/intl/config.charset
# Fri, 30 May 2003 00:09:00 GMT'
-OS = RbConfig::CONFIG["target_os"]
-SHELL = RbConfig::CONFIG['SHELL']
+OS = Config::CONFIG["target_os"]
+SHELL = Config::CONFIG['SHELL']
class Hash::Ordered < Hash
def [](key)
diff --git a/ext/iconv/depend b/ext/iconv/depend
index ac555596ce..688ddd97b7 100644
--- a/ext/iconv/depend
+++ b/ext/iconv/depend
@@ -1,2 +1,2 @@
iconv.o: iconv.c $(hdrdir)/ruby.h $(topdir)/config.h $(hdrdir)/defines.h \
- $(hdrdir)/st.h $(hdrdir)/intern.h $(hdrdir)/encoding.h
+ $(hdrdir)/intern.h
diff --git a/ext/iconv/extconf.rb b/ext/iconv/extconf.rb
index 9632bf4db9..a9d0cfb5e6 100644
--- a/ext/iconv/extconf.rb
+++ b/ext/iconv/extconf.rb
@@ -23,8 +23,6 @@ if have_func("iconv", "iconv.h") or
end
$defs.push('-DICONV_INPTR_CONST')
end
- have_func("iconvlist", "iconv.h")
- have_func("__iconv_free_list", "iconv.h")
if conf
prefix = '$(srcdir)'
prefix = $nmake ? "{#{prefix}}" : "#{prefix}/"
diff --git a/ext/iconv/iconv.c b/ext/iconv/iconv.c
index 35e5c34634..d989b97df2 100644
--- a/ext/iconv/iconv.c
+++ b/ext/iconv/iconv.c
@@ -4,6 +4,7 @@
iconv.c -
$Author$
+ $Date$
created at: Wed Dec 1 20:28:09 JST 1999
All the files in this distribution are covered under the Ruby's
@@ -13,12 +14,12 @@
**********************************************************************/
-#include "ruby/ruby.h"
+#include "ruby.h"
#include <errno.h>
#include <iconv.h>
#include <assert.h>
-#include "ruby/st.h"
-#include "ruby/encoding.h"
+#include "st.h"
+#include "intern.h"
/*
* Document-class: Iconv
@@ -66,12 +67,6 @@
* 4. Shorthand for (3).
*
* Iconv.iconv(to, from, *input.to_a)
- *
- * == Attentions
- *
- * Even if some extentions of implementation dependent are useful,
- * DON'T USE those extentions in libraries and scripts to widely distribute.
- * If you want to use those feature, use String#encode.
*/
/* Invalid value for iconv_t is -1 but 0 for VALUE, I hope VALUE is
@@ -85,18 +80,9 @@ struct iconv_env_t
int argc;
VALUE *argv;
VALUE ret;
- int toidx;
VALUE (*append)_((VALUE, VALUE));
};
-struct rb_iconv_opt_t
-{
- VALUE transliterate;
- VALUE discard_ilseq;
-};
-
-static ID id_transliterate, id_discard_ilseq;
-
static VALUE rb_eIconvInvalidEncoding;
static VALUE rb_eIconvFailure;
static VALUE rb_eIconvIllegalSeq;
@@ -110,22 +96,20 @@ static VALUE iconv_failure_initialize _((VALUE error, VALUE mesg, VALUE success,
static VALUE iconv_failure_success _((VALUE self));
static VALUE iconv_failure_failed _((VALUE self));
-static iconv_t iconv_create _((VALUE to, VALUE from, struct rb_iconv_opt_t *opt, int *idx));
+static iconv_t iconv_create _((VALUE to, VALUE from));
static void iconv_dfree _((void *cd));
static VALUE iconv_free _((VALUE cd));
static VALUE iconv_try _((iconv_t cd, const char **inptr, size_t *inlen, char **outptr, size_t *outlen));
static VALUE rb_str_derive _((VALUE str, const char* ptr, int len));
-static VALUE iconv_convert _((iconv_t cd, VALUE str, long start, long length, int toidx,
- struct iconv_env_t* env));
+static VALUE iconv_convert _((iconv_t cd, VALUE str, long start, long length, struct iconv_env_t* env));
static VALUE iconv_s_allocate _((VALUE klass));
-static VALUE iconv_initialize _((int argc, VALUE *argv, VALUE self));
-static VALUE iconv_s_open _((int argc, VALUE *argv, VALUE self));
+static VALUE iconv_initialize _((VALUE self, VALUE to, VALUE from));
+static VALUE iconv_s_open _((VALUE self, VALUE to, VALUE from));
static VALUE iconv_s_convert _((struct iconv_env_t* env));
static VALUE iconv_s_iconv _((int argc, VALUE *argv, VALUE self));
static VALUE iconv_init_state _((VALUE cd));
static VALUE iconv_finish _((VALUE self));
static VALUE iconv_iconv _((int argc, VALUE *argv, VALUE self));
-static VALUE iconv_conv _((int argc, VALUE *argv, VALUE self));
static VALUE charset_map;
@@ -135,37 +119,26 @@ static VALUE charset_map;
*
* Returns the map from canonical name to system dependent name.
*/
-static VALUE
-charset_map_get(void)
+static VALUE charset_map_get _((void))
{
return charset_map;
}
-static VALUE
-strip_glibc_option(VALUE *code)
-{
- VALUE val = StringValue(*code);
- const char *ptr = RSTRING_PTR(val), *pend = RSTRING_END(val);
- const char *slash = memchr(ptr, '/', pend - ptr);
-
- if (slash && slash < pend - 1 && slash[1] == '/') {
- VALUE opt = rb_str_subseq(val, slash - ptr, pend - slash);
- val = rb_str_subseq(val, 0, slash - ptr);
- *code = val;
- return opt;
- }
- return 0;
-}
-
static char *
-map_charset(VALUE *code)
+map_charset
+#ifdef HAVE_PROTOTYPES
+ (VALUE *code)
+#else /* HAVE_PROTOTYPES */
+ (code)
+ VALUE *code;
+#endif /* HAVE_PROTOTYPES */
{
- VALUE val = StringValue(*code);
+ VALUE val = *code;
- if (RHASH_SIZE(charset_map)) {
+ if (RHASH(charset_map)->tbl && RHASH(charset_map)->tbl->num_entries) {
VALUE key = rb_funcall2(val, rb_intern("downcase"), 0, 0);
StringValuePtr(key);
- if (st_lookup(RHASH_TBL(charset_map), key, &val)) {
+ if (st_lookup(RHASH(charset_map)->tbl, key, &val)) {
*code = val;
}
}
@@ -173,107 +146,55 @@ map_charset(VALUE *code)
}
static iconv_t
-iconv_create(VALUE to, VALUE from, struct rb_iconv_opt_t *opt, int *idx)
+iconv_create
+#ifdef HAVE_PROTOTYPES
+ (VALUE to, VALUE from)
+#else /* HAVE_PROTOTYPES */
+ (to, from)
+ VALUE to;
+ VALUE from;
+#endif /* HAVE_PROTOTYPES */
{
- VALUE toopt = strip_glibc_option(&to);
- VALUE fromopt = strip_glibc_option(&from);
- VALUE toenc = 0, fromenc = 0;
const char* tocode = map_charset(&to);
const char* fromcode = map_charset(&from);
- iconv_t cd;
- int retry = 0;
- *idx = rb_enc_find_index(tocode);
+ iconv_t cd = iconv_open(tocode, fromcode);
- if (toopt) {
- toenc = rb_str_plus(to, toopt);
- tocode = RSTRING_PTR(toenc);
- }
- if (fromopt) {
- fromenc = rb_str_plus(from, fromopt);
- fromcode = RSTRING_PTR(fromenc);
- }
- while ((cd = iconv_open(tocode, fromcode)) == (iconv_t)-1) {
- int inval = 0;
+ if (cd == (iconv_t)-1) {
switch (errno) {
case EMFILE:
case ENFILE:
case ENOMEM:
- if (!retry++) {
- rb_gc();
- continue;
- }
- break;
- case EINVAL:
- retry = 0;
- inval = 1;
- if (toenc) {
- tocode = RSTRING_PTR(to);
- rb_str_resize(toenc, 0);
- toenc = 0;
- continue;
- }
- if (fromenc) {
- fromcode = RSTRING_PTR(from);
- rb_str_resize(fromenc, 0);
- fromenc = 0;
- continue;
- }
- break;
+ rb_gc();
+ cd = iconv_open(tocode, fromcode);
}
- {
+ if (cd == (iconv_t)-1) {
+ int inval = errno == EINVAL;
const char *s = inval ? "invalid encoding " : "iconv";
- volatile VALUE msg = rb_str_new(0, strlen(s) + RSTRING_LEN(to) +
- RSTRING_LEN(from) + 8);
+ volatile VALUE msg = rb_str_new(0, strlen(s) + RSTRING(to)->len +
+ RSTRING(from)->len + 8);
- sprintf(RSTRING_PTR(msg), "%s(\"%s\", \"%s\")",
- s, RSTRING_PTR(to), RSTRING_PTR(from));
- s = RSTRING_PTR(msg);
- rb_str_set_len(msg, strlen(s));
+ sprintf(RSTRING(msg)->ptr, "%s(\"%s\", \"%s\")",
+ s, RSTRING(to)->ptr, RSTRING(from)->ptr);
+ s = RSTRING(msg)->ptr;
+ RSTRING(msg)->len = strlen(s);
if (!inval) rb_sys_fail(s);
iconv_fail(rb_eIconvInvalidEncoding,
Qnil, rb_ary_new3(2, to, from), NULL, s);
}
}
- if (toopt || fromopt) {
- if (toopt && fromopt && RTEST(rb_str_equal(toopt, fromopt))) {
- fromopt = 0;
- }
- if (toopt && fromopt) {
- rb_warning("encoding option isn't portable: %s, %s",
- RSTRING_PTR(toopt) + 2, RSTRING_PTR(fromopt) + 2);
- }
- else {
- rb_warning("encoding option isn't portable: %s",
- (toopt ? RSTRING_PTR(toopt) : RSTRING_PTR(fromopt)) + 2);
- }
- }
-
- if (opt) {
-#ifdef ICONV_SET_TRANSLITERATE
- if (opt->transliterate != Qundef) {
- int flag = RTEST(opt->transliterate);
- rb_warning("encoding option isn't portable: transliterate");
- if (iconvctl(cd, ICONV_SET_TRANSLITERATE, (void *)&flag))
- rb_sys_fail("ICONV_SET_TRANSLITERATE");
- }
-#endif
-#ifdef ICONV_SET_DISCARD_ILSEQ
- if (opt->discard_ilseq != Qundef) {
- int flag = RTEST(opt->discard_ilseq);
- rb_warning("encoding option isn't portable: discard_ilseq");
- if (iconvctl(cd, ICONV_SET_DISCARD_ILSEQ, (void *)&flag))
- rb_sys_fail("ICONV_SET_DISCARD_ILSEQ");
- }
-#endif
- }
-
return cd;
}
static void
-iconv_dfree(void *cd)
+iconv_dfree
+#ifdef HAVE_PROTOTYPES
+ (void *cd)
+#else /* HAVE_PROTOTYPES */
+ (cd)
+ void *cd;
+#endif /* HAVE_PROTOTYPES */
{
iconv_close(VALUE2ICONV(cd));
}
@@ -281,7 +202,13 @@ iconv_dfree(void *cd)
#define ICONV_FREE iconv_dfree
static VALUE
-iconv_free(VALUE cd)
+iconv_free
+#ifdef HAVE_PROTOTYPES
+ (VALUE cd)
+#else /* HAVE_PROTOTYPES */
+ (cd)
+ VALUE cd;
+#endif /* HAVE_PROTOTYPES */
{
if (cd && iconv_close(VALUE2ICONV(cd)) == -1)
rb_sys_fail("iconv_close");
@@ -289,7 +216,13 @@ iconv_free(VALUE cd)
}
static VALUE
-check_iconv(VALUE obj)
+check_iconv
+#ifdef HAVE_PROTOTYPES
+ (VALUE obj)
+#else /* HAVE_PROTOTYPES */
+ (obj)
+ VALUE obj;
+#endif /* HAVE_PROTOTYPES */
{
Check_Type(obj, T_DATA);
if (RDATA(obj)->dfree != ICONV_FREE) {
@@ -299,7 +232,17 @@ check_iconv(VALUE obj)
}
static VALUE
-iconv_try(iconv_t cd, const char **inptr, size_t *inlen, char **outptr, size_t *outlen)
+iconv_try
+#ifdef HAVE_PROTOTYPES
+ (iconv_t cd, const char **inptr, size_t *inlen, char **outptr, size_t *outlen)
+#else /* HAVE_PROTOTYPES */
+ (cd, inptr, inlen, outptr, outlen)
+ iconv_t cd;
+ const char **inptr;
+ size_t *inlen;
+ char **outptr;
+ size_t *outlen;
+#endif /* HAVE_PROTOTYPES */
{
#ifdef ICONV_INPTR_CONST
#define ICONV_INPTR_CAST
@@ -339,8 +282,13 @@ iconv_try(iconv_t cd, const char **inptr, size_t *inlen, char **outptr, size_t *
#define FAILED_MAXLEN 16
-static VALUE
-iconv_failure_initialize(VALUE error, VALUE mesg, VALUE success, VALUE failed)
+static VALUE iconv_failure_initialize
+#ifdef HAVE_PROTOTYPES
+ (VALUE error, VALUE mesg, VALUE success, VALUE failed)
+#else /* HAVE_PROTOTYPES */
+ (error, mesg, success, failed)
+ VALUE error, mesg, success, failed;
+#endif /* HAVE_PROTOTYPES */
{
rb_call_super(1, &mesg);
rb_ivar_set(error, rb_success, success);
@@ -349,14 +297,22 @@ iconv_failure_initialize(VALUE error, VALUE mesg, VALUE success, VALUE failed)
}
static VALUE
-iconv_fail(VALUE error, VALUE success, VALUE failed, struct iconv_env_t* env, const char *mesg)
+iconv_fail
+#ifdef HAVE_PROTOTYPES
+ (VALUE error, VALUE success, VALUE failed, struct iconv_env_t* env, const char *mesg)
+#else /* HAVE_PROTOTYPES */
+ (error, success, failed, env, mesg)
+ VALUE error, success, failed;
+ struct iconv_env_t *env;
+ const char *mesg;
+#endif /* HAVE_PROTOTYPES */
{
VALUE args[3];
if (mesg && *mesg) {
args[0] = rb_str_new2(mesg);
}
- else if (TYPE(failed) != T_STRING || RSTRING_LEN(failed) < FAILED_MAXLEN) {
+ else if (TYPE(failed) != T_STRING || RSTRING(failed)->len < FAILED_MAXLEN) {
args[0] = rb_inspect(failed);
}
else {
@@ -374,19 +330,29 @@ iconv_fail(VALUE error, VALUE success, VALUE failed, struct iconv_env_t* env, co
}
error = rb_class_new_instance(3, args, error);
if (!rb_block_given_p()) rb_exc_raise(error);
- rb_set_errinfo(error);
+ ruby_errinfo = error;
return rb_yield(failed);
}
static VALUE
-rb_str_derive(VALUE str, const char* ptr, int len)
+rb_str_derive
+#ifdef HAVE_PROTOTYPES
+ (VALUE str, const char* ptr, int len)
+#else /* HAVE_PROTOTYPES */
+ (str, ptr, len)
+ VALUE str;
+ const char *ptr;
+ int len;
+#endif /* HAVE_PROTOTYPES */
{
VALUE ret;
if (NIL_P(str))
return rb_str_new(ptr, len);
- if (RSTRING_PTR(str) + RSTRING_LEN(str) == ptr + len)
- ret = rb_str_subseq(str, ptr - RSTRING_PTR(str), len);
+ if (RSTRING(str)->ptr == ptr && RSTRING(str)->len == len)
+ return str;
+ if (RSTRING(str)->ptr + RSTRING(str)->len == ptr + len)
+ ret = rb_str_substr(str, ptr - RSTRING(str)->ptr, len);
else
ret = rb_str_new(ptr, len);
OBJ_INFECT(ret, str);
@@ -394,7 +360,17 @@ rb_str_derive(VALUE str, const char* ptr, int len)
}
static VALUE
-iconv_convert(iconv_t cd, VALUE str, long start, long length, int toidx, struct iconv_env_t* env)
+iconv_convert
+#ifdef HAVE_PROTOTYPES
+ (iconv_t cd, VALUE str, long start, long length, struct iconv_env_t* env)
+#else /* HAVE_PROTOTYPES */
+ (cd, str, start, length, env)
+ iconv_t cd;
+ VALUE str;
+ long start;
+ long length;
+ struct iconv_env_t *env;
+#endif /* HAVE_PROTOTYPES */
{
VALUE ret = Qfalse;
VALUE error = Qfalse;
@@ -420,7 +396,7 @@ iconv_convert(iconv_t cd, VALUE str, long start, long length, int toidx, struct
unsigned int i;
rescue = iconv_fail(error, Qnil, Qnil, env, 0);
if (TYPE(rescue) == T_ARRAY) {
- str = RARRAY_LEN(rescue) > 0 ? RARRAY_PTR(rescue)[0] : Qnil;
+ str = RARRAY(rescue)->len > 0 ? RARRAY(rescue)->ptr[0] : Qnil;
}
if (FIXNUM_P(str) && (i = FIX2INT(str)) <= 0xff) {
char c = i;
@@ -438,8 +414,8 @@ iconv_convert(iconv_t cd, VALUE str, long start, long length, int toidx, struct
int slen;
StringValue(str);
- slen = RSTRING_LEN(str);
- inptr = RSTRING_PTR(str);
+ slen = RSTRING(str)->len;
+ inptr = RSTRING(str)->ptr;
inptr += start;
if (length < 0 || length > start + slen)
@@ -466,7 +442,6 @@ iconv_convert(iconv_t cd, VALUE str, long start, long length, int toidx, struct
{
if (NIL_P(str)) {
ret = rb_str_new(buffer, outlen);
- if (toidx >= 0) rb_enc_associate_index(ret, toidx);
}
else {
if (ret) {
@@ -474,7 +449,6 @@ iconv_convert(iconv_t cd, VALUE str, long start, long length, int toidx, struct
}
else {
ret = rb_str_new(instart, tmpstart - instart);
- if (toidx >= 0) rb_enc_associate_index(ret, toidx);
OBJ_INFECT(ret, str);
}
ret = rb_str_buf_cat(ret, buffer, outlen);
@@ -494,22 +468,19 @@ iconv_convert(iconv_t cd, VALUE str, long start, long length, int toidx, struct
if (RTEST(error)) {
long len = 0;
- if (!ret) {
+ if (!ret)
ret = rb_str_derive(str, instart, inptr - instart);
- if (toidx >= 0) rb_enc_associate_index(ret, toidx);
- }
- else if (inptr > instart) {
+ else if (inptr > instart)
rb_str_cat(ret, instart, inptr - instart);
- }
str = rb_str_derive(str, inptr, inlen);
rescue = iconv_fail(error, ret, str, env, errmsg);
if (TYPE(rescue) == T_ARRAY) {
- if ((len = RARRAY_LEN(rescue)) > 0)
- rb_str_concat(ret, RARRAY_PTR(rescue)[0]);
- if (len > 1 && !NIL_P(str = RARRAY_PTR(rescue)[1])) {
+ if ((len = RARRAY(rescue)->len) > 0)
+ rb_str_concat(ret, RARRAY(rescue)->ptr[0]);
+ if (len > 1 && !NIL_P(str = RARRAY(rescue)->ptr[1])) {
StringValue(str);
- inlen = length = RSTRING_LEN(str);
- instart = inptr = RSTRING_PTR(str);
+ inlen = length = RSTRING(str)->len;
+ instart = inptr = RSTRING(str)->ptr;
continue;
}
}
@@ -520,94 +491,28 @@ iconv_convert(iconv_t cd, VALUE str, long start, long length, int toidx, struct
}
} while (inlen > 0);
- if (!ret) {
+ if (!ret)
ret = rb_str_derive(str, instart, inptr - instart);
- if (toidx >= 0) rb_enc_associate_index(ret, toidx);
- }
- else if (inptr > instart) {
+ else if (inptr > instart)
rb_str_cat(ret, instart, inptr - instart);
- }
return ret;
}
static VALUE
-iconv_s_allocate(VALUE klass)
+iconv_s_allocate
+#ifdef HAVE_PROTOTYPES
+ (VALUE klass)
+#else /* HAVE_PROTOTYPES */
+ (klass)
+ VALUE klass;
+#endif /* HAVE_PROTOTYPES */
{
return Data_Wrap_Struct(klass, 0, ICONV_FREE, 0);
}
-static VALUE
-get_iconv_opt_i(VALUE i, VALUE arg)
-{
- struct rb_iconv_opt_t *opt = (struct rb_iconv_opt_t *)arg;
- VALUE name, val;
-
- (void)opt;
- i = rb_Array(i);
- name = rb_ary_entry(i, 0);
- val = rb_ary_entry(i, 1);
- do {
- if (SYMBOL_P(name)) {
- ID id = SYM2ID(name);
- if (id == id_transliterate) {
-#ifdef ICONV_SET_TRANSLITERATE
- opt->transliterate = val;
-#else
- rb_notimplement();
-#endif
- break;
- }
- if (id == id_discard_ilseq) {
-#ifdef ICONV_SET_DISCARD_ILSEQ
- opt->discard_ilseq = val;
-#else
- rb_notimplement();
-#endif
- break;
- }
- }
- else {
- const char *s = StringValueCStr(name);
- if (strcmp(s, "transliterate") == 0) {
-#ifdef ICONV_SET_TRANSLITERATE
- opt->transliterate = val;
-#else
- rb_notimplement();
-#endif
- break;
- }
- if (strcmp(s, "discard_ilseq") == 0) {
-#ifdef ICONV_SET_DISCARD_ILSEQ
- opt->discard_ilseq = val;
-#else
- rb_notimplement();
-#endif
- break;
- }
- }
- name = rb_inspect(name);
- rb_raise(rb_eArgError, "unknown option - %s", StringValueCStr(name));
- } while (0);
- return Qnil;
-}
-
-static void
-get_iconv_opt(struct rb_iconv_opt_t *opt, VALUE options)
-{
- opt->transliterate = Qundef;
- opt->discard_ilseq = Qundef;
- if (!NIL_P(options)) {
- rb_block_call(options, rb_intern("each"), 0, 0, get_iconv_opt_i, (VALUE)opt);
- }
-}
-
-#define iconv_ctl(self, func, val) (\
- iconvctl(VALUE2ICONV(check_iconv(self)), func, (void *)&(val)) ? \
- rb_sys_fail(#func) : (void)0)
-
/*
* Document-method: new
- * call-seq: Iconv.new(to, from, [options])
+ * call-seq: Iconv.new(to, from)
*
* Creates new code converter from a coding-system designated with +from+
* to another one designated with +to+.
@@ -616,7 +521,6 @@ get_iconv_opt(struct rb_iconv_opt_t *opt, VALUE options)
*
* +to+:: encoding name for destination
* +from+:: encoding name for source
- * +options+:: options for converter
*
* === Exceptions
*
@@ -625,18 +529,19 @@ get_iconv_opt(struct rb_iconv_opt_t *opt, VALUE options)
* SystemCallError:: if <tt>iconv_open(3)</tt> fails
*/
static VALUE
-iconv_initialize(int argc, VALUE *argv, VALUE self)
+iconv_initialize
+#ifdef HAVE_PROTOTYPES
+ (VALUE self, VALUE to, VALUE from)
+#else /* HAVE_PROTOTYPES */
+ (self, to, from)
+ VALUE self;
+ VALUE to;
+ VALUE from;
+#endif /* HAVE_PROTOTYPES */
{
- VALUE to, from, options;
- struct rb_iconv_opt_t opt;
- int idx;
-
- rb_scan_args(argc, argv, "21", &to, &from, &options);
- get_iconv_opt(&opt, options);
iconv_free(check_iconv(self));
DATA_PTR(self) = NULL;
- DATA_PTR(self) = (void *)ICONV2VALUE(iconv_create(to, from, &opt, &idx));
- if (idx >= 0) ENCODING_SET(self, idx);
+ DATA_PTR(self) = (void *)ICONV2VALUE(iconv_create(to, from));
return self;
}
@@ -649,19 +554,19 @@ iconv_initialize(int argc, VALUE *argv, VALUE self)
* returned from the block.
*/
static VALUE
-iconv_s_open(int argc, VALUE *argv, VALUE self)
-{
- VALUE to, from, options, cd;
- struct rb_iconv_opt_t opt;
- int idx;
-
- rb_scan_args(argc, argv, "21", &to, &from, &options);
- get_iconv_opt(&opt, options);
- cd = ICONV2VALUE(iconv_create(to, from, &opt, &idx));
+iconv_s_open
+#ifdef HAVE_PROTOTYPES
+ (VALUE self, VALUE to, VALUE from)
+#else /* HAVE_PROTOTYPES */
+ (self, to, from)
+ VALUE self;
+ VALUE to;
+ VALUE from;
+#endif /* HAVE_PROTOTYPES */
+{
+ VALUE cd = ICONV2VALUE(iconv_create(to, from));
self = Data_Wrap_Struct(self, NULL, ICONV_FREE, (void *)cd);
- if (idx >= 0) ENCODING_SET(self, idx);
-
if (rb_block_given_p()) {
return rb_ensure(rb_yield, self, (VALUE(*)())iconv_finish, self);
}
@@ -671,19 +576,24 @@ iconv_s_open(int argc, VALUE *argv, VALUE self)
}
static VALUE
-iconv_s_convert(struct iconv_env_t* env)
+iconv_s_convert
+#ifdef HAVE_PROTOTYPES
+ (struct iconv_env_t* env)
+#else /* HAVE_PROTOTYPES */
+ (env)
+ struct iconv_env_t *env;
+#endif /* HAVE_PROTOTYPES */
{
VALUE last = 0;
for (; env->argc > 0; --env->argc, ++env->argv) {
- VALUE s = iconv_convert(env->cd, last = *(env->argv),
- 0, -1, env->toidx, env);
+ VALUE s = iconv_convert(env->cd, last = *(env->argv), 0, -1, env);
env->append(env->ret, s);
}
if (!NIL_P(last)) {
- VALUE s = iconv_convert(env->cd, Qnil, 0, 0, env->toidx, env);
- if (RSTRING_LEN(s))
+ VALUE s = iconv_convert(env->cd, Qnil, 0, 0, env);
+ if (RSTRING(s)->len)
env->append(env->ret, s);
}
@@ -709,7 +619,15 @@ iconv_s_convert(struct iconv_env_t* env)
* Exceptions thrown by Iconv.new, Iconv.open and Iconv#iconv.
*/
static VALUE
-iconv_s_iconv(int argc, VALUE *argv, VALUE self)
+iconv_s_iconv
+#ifdef HAVE_PROTOTYPES
+ (int argc, VALUE *argv, VALUE self)
+#else /* HAVE_PROTOTYPES */
+ (argc, argv, self)
+ int argc;
+ VALUE *argv;
+ VALUE self;
+#endif /* HAVE_PROTOTYPES */
{
struct iconv_env_t arg;
@@ -720,7 +638,7 @@ iconv_s_iconv(int argc, VALUE *argv, VALUE self)
arg.argv = argv + 2;
arg.append = rb_ary_push;
arg.ret = rb_ary_new2(argc);
- arg.cd = iconv_create(argv[0], argv[1], NULL, &arg.toidx);
+ arg.cd = iconv_create(argv[0], argv[1]);
return rb_ensure(iconv_s_convert, (VALUE)&arg, iconv_free, ICONV2VALUE(arg.cd));
}
@@ -733,7 +651,13 @@ iconv_s_iconv(int argc, VALUE *argv, VALUE self)
* See Iconv.iconv.
*/
static VALUE
-iconv_s_conv(VALUE self, VALUE to, VALUE from, VALUE str)
+iconv_s_conv
+#ifdef HAVE_PROTOTYPES
+ (VALUE self, VALUE to, VALUE from, VALUE str)
+#else /* HAVE_PROTOTYPES */
+ (self, to, from, str)
+ VALUE self, to, from, str;
+#endif /* HAVE_PROTOTYPES */
{
struct iconv_env_t arg;
@@ -741,95 +665,11 @@ iconv_s_conv(VALUE self, VALUE to, VALUE from, VALUE str)
arg.argv = &str;
arg.append = rb_str_append;
arg.ret = rb_str_new(0, 0);
- arg.cd = iconv_create(to, from, NULL, &arg.toidx);
+ arg.cd = iconv_create(to, from);
return rb_ensure(iconv_s_convert, (VALUE)&arg, iconv_free, ICONV2VALUE(arg.cd));
}
/*
- * Document-method: list
- * call-seq: Iconv.list {|*aliases| ... }
- *
- * Iterates each alias sets.
- */
-
-#ifdef HAVE_ICONVLIST
-struct iconv_name_list
-{
- unsigned int namescount;
- const char *const *names;
- VALUE array;
-};
-
-static VALUE
-list_iconv_i(VALUE ptr)
-{
- struct iconv_name_list *p = (struct iconv_name_list *)ptr;
- unsigned int i, namescount = p->namescount;
- const char *const *names = p->names;
- VALUE ary = rb_ary_new2(namescount);
-
- for (i = 0; i < namescount; i++) {
- rb_ary_push(ary, rb_str_new2(names[i]));
- }
- if (p->array) {
- return rb_ary_push(p->array, ary);
- }
- return rb_yield(ary);
-}
-
-static int
-list_iconv(unsigned int namescount, const char *const *names, void *data)
-{
- int *state = data;
- struct iconv_name_list list;
-
- list.namescount = namescount;
- list.names = names;
- list.array = ((VALUE *)data)[1];
- rb_protect(list_iconv_i, (VALUE)&list, state);
- return *state;
-}
-#endif
-
-#if defined(HAVE_ICONVLIST) || defined(HAVE___ICONV_FREE_LIST)
-static VALUE
-iconv_s_list(void)
-{
-#ifdef HAVE_ICONVLIST
- int state;
- VALUE args[2];
-
- args[1] = rb_block_given_p() ? 0 : rb_ary_new();
- iconvlist(list_iconv, args);
- state = *(int *)args;
- if (state) rb_jump_tag(state);
- if (args[1]) return args[1];
-#elif defined(HAVE___ICONV_FREE_LIST)
- char **list;
- size_t sz, i;
- VALUE ary;
-
- if (__iconv_get_list(&list, &sz)) return Qnil;
-
- ary = rb_ary_new2(sz);
- for (i = 0; i < sz; i++) {
- rb_ary_push(ary, rb_str_new2(list[i]));
- }
- __iconv_free_list(list, sz);
-
- if (!rb_block_given_p())
- return ary;
- for (i = 0; i < RARRAY_LEN(ary); i++) {
- rb_yield(RARRAY_PTR(ary)[i]);
- }
-#endif
- return Qnil;
-}
-#else
-#define iconv_s_list rb_f_notimplement
-#endif
-
-/*
* Document-method: close
*
* Finishes conversion.
@@ -841,20 +681,32 @@ iconv_s_list(void)
* its initial shift state.
*/
static VALUE
-iconv_init_state(VALUE self)
+iconv_init_state
+#ifdef HAVE_PROTOTYPES
+ (VALUE cd)
+#else /* HAVE_PROTOTYPES */
+ (cd)
+ VALUE cd;
+#endif /* HAVE_PROTOTYPES */
{
- iconv_t cd = VALUE2ICONV((VALUE)DATA_PTR(self));
- DATA_PTR(self) = NULL;
- return iconv_convert(cd, Qnil, 0, 0, ENCODING_GET(self), NULL);
+ return iconv_convert(VALUE2ICONV(cd), Qnil, 0, 0, NULL);
}
static VALUE
-iconv_finish(VALUE self)
+iconv_finish
+#ifdef HAVE_PROTOTYPES
+ (VALUE self)
+#else /* HAVE_PROTOTYPES */
+ (self)
+ VALUE self;
+#endif /* HAVE_PROTOTYPES */
{
VALUE cd = check_iconv(self);
if (!cd) return Qnil;
- return rb_ensure(iconv_init_state, self, iconv_free, cd);
+ DATA_PTR(self) = NULL;
+
+ return rb_ensure(iconv_init_state, cd, iconv_free, cd);
}
/*
@@ -885,186 +737,34 @@ iconv_finish(VALUE self)
* See the Iconv documentation.
*/
static VALUE
-iconv_iconv(int argc, VALUE *argv, VALUE self)
+iconv_iconv
+#ifdef HAVE_PROTOTYPES
+ (int argc, VALUE *argv, VALUE self)
+#else /* HAVE_PROTOTYPES */
+ (argc, argv, self)
+ int argc;
+ VALUE *argv;
+ VALUE self;
+#endif /* HAVE_PROTOTYPES */
{
VALUE str, n1, n2;
VALUE cd = check_iconv(self);
long start = 0, length = 0, slen = 0;
rb_scan_args(argc, argv, "12", &str, &n1, &n2);
- if (!NIL_P(str)) {
- VALUE n = rb_str_length(StringValue(str));
- slen = NUM2LONG(n);
- }
+ if (!NIL_P(str)) slen = RSTRING_LEN(StringValue(str));
if (argc != 2 || !RTEST(rb_range_beg_len(n1, &start, &length, slen, 0))) {
if (NIL_P(n1) || ((start = NUM2LONG(n1)) < 0 ? (start += slen) >= 0 : start < slen)) {
- length = NIL_P(n2) ? -1 : NUM2LONG(n2);
- }
- }
- if (start > 0 || length > 0) {
- rb_encoding *enc = rb_enc_get(str);
- const char *s = RSTRING_PTR(str), *e = s + RSTRING_LEN(str);
- const char *ps = s;
- if (start > 0) {
- start = (ps = rb_enc_nth(s, e, start, enc)) - s;
- }
- if (length > 0) {
- length = rb_enc_nth(ps, e, length, enc) - ps;
+ if (NIL_P(n2)) {
+ length = -1;
+ }
+ else if ((length = NUM2LONG(n2)) >= slen - start) {
+ length = slen - start;
+ }
}
}
- return iconv_convert(VALUE2ICONV(cd), str, start, length, ENCODING_GET(self), NULL);
-}
-
-/*
- * Document-method: conv
- * call-seq: conv(str...)
- *
- * Equivalent to
- *
- * iconv(nil, str..., nil).join
- */
-static VALUE
-iconv_conv(int argc, VALUE *argv, VALUE self)
-{
- iconv_t cd = VALUE2ICONV(check_iconv(self));
- VALUE str, s;
- int toidx = ENCODING_GET(self);
-
- str = iconv_convert(cd, Qnil, 0, 0, toidx, NULL);
- if (argc > 0) {
- do {
- s = iconv_convert(cd, *argv++, 0, -1, toidx, NULL);
- if (RSTRING_LEN(s))
- rb_str_buf_append(str, s);
- } while (--argc);
- s = iconv_convert(cd, Qnil, 0, 0, toidx, NULL);
- if (RSTRING_LEN(s))
- rb_str_buf_append(str, s);
- }
-
- return str;
-}
-
-#ifdef ICONV_TRIVIALP
-/*
- * Document-method: trivial?
- * call-seq: trivial?
- *
- * Returns trivial flag.
- */
-static VALUE
-iconv_trivialp(VALUE self)
-{
- int trivial = 0;
- iconv_ctl(self, ICONV_TRIVIALP, trivial);
- if (trivial) return Qtrue;
- return Qfalse;
-}
-#else
-#define iconv_trivialp rb_f_notimplement
-#endif
-
-#ifdef ICONV_GET_TRANSLITERATE
-/*
- * Document-method: transliterate?
- * call-seq: transliterate?
- *
- * Returns transliterate flag.
- */
-static VALUE
-iconv_get_transliterate(VALUE self)
-{
- int trans = 0;
- iconv_ctl(self, ICONV_GET_TRANSLITERATE, trans);
- if (trans) return Qtrue;
- return Qfalse;
-}
-#else
-#define iconv_get_transliterate rb_f_notimplement
-#endif
-
-#ifdef ICONV_SET_TRANSLITERATE
-/*
- * Document-method: transliterate=
- * call-seq: cd.transliterate = flag
- *
- * Sets transliterate flag.
- */
-static VALUE
-iconv_set_transliterate(VALUE self, VALUE transliterate)
-{
- int trans = RTEST(transliterate);
- iconv_ctl(self, ICONV_SET_TRANSLITERATE, trans);
- return self;
-}
-#else
-#define iconv_set_transliterate rb_f_notimplement
-#endif
-
-#ifdef ICONV_GET_DISCARD_ILSEQ
-/*
- * Document-method: discard_ilseq?
- * call-seq: discard_ilseq?
- *
- * Returns discard_ilseq flag.
- */
-static VALUE
-iconv_get_discard_ilseq(VALUE self)
-{
- int dis = 0;
- iconv_ctl(self, ICONV_GET_DISCARD_ILSEQ, dis);
- if (dis) return Qtrue;
- return Qfalse;
-}
-#else
-#define iconv_get_discard_ilseq rb_f_notimplement
-#endif
-
-#ifdef ICONV_SET_DISCARD_ILSEQ
-/*
- * Document-method: discard_ilseq=
- * call-seq: cd.discard_ilseq = flag
- *
- * Sets discard_ilseq flag.
- */
-static VALUE
-iconv_set_discard_ilseq(VALUE self, VALUE discard_ilseq)
-{
- int dis = RTEST(discard_ilseq);
- iconv_ctl(self, ICONV_SET_DISCARD_ILSEQ, dis);
- return self;
-}
-#else
-#define iconv_set_discard_ilseq rb_f_notimplement
-#endif
-
-/*
- * Document-method: ctlmethods
- * call-seq: Iconv.ctlmethods => array
- *
- * Returns available iconvctl() method list.
- */
-static VALUE
-iconv_s_ctlmethods(VALUE klass)
-{
- VALUE ary = rb_ary_new();
-#ifdef ICONV_TRIVIALP
- rb_ary_push(ary, ID2SYM(rb_intern("trivial?")));
-#endif
-#ifdef ICONV_GET_TRANSLITERATE
- rb_ary_push(ary, ID2SYM(rb_intern("transliterate?")));
-#endif
-#ifdef ICONV_SET_TRANSLITERATE
- rb_ary_push(ary, ID2SYM(rb_intern("transliterate=")));
-#endif
-#ifdef ICONV_GET_DISCARD_ILSEQ
- rb_ary_push(ary, ID2SYM(rb_intern("discard_ilseq?")));
-#endif
-#ifdef ICONV_SET_DISCARD_ILSEQ
- rb_ary_push(ary, ID2SYM(rb_intern("discard_ilseq=")));
-#endif
- return ary;
+ return iconv_convert(VALUE2ICONV(cd), str, start, length, NULL);
}
/*
@@ -1083,7 +783,13 @@ iconv_s_ctlmethods(VALUE klass)
* failure and the last element is string on the way.
*/
static VALUE
-iconv_failure_success(VALUE self)
+iconv_failure_success
+#ifdef HAVE_PROTOTYPES
+(VALUE self)
+#else /* HAVE_PROTOTYPES */
+ (self)
+ VALUE self;
+#endif /* HAVE_PROTOTYPES */
{
return rb_attr_get(self, rb_success);
}
@@ -1096,7 +802,13 @@ iconv_failure_success(VALUE self)
* character caused the exception.
*/
static VALUE
-iconv_failure_failed(VALUE self)
+iconv_failure_failed
+#ifdef HAVE_PROTOTYPES
+(VALUE self)
+#else /* HAVE_PROTOTYPES */
+ (self)
+ VALUE self;
+#endif /* HAVE_PROTOTYPES */
{
return rb_attr_get(self, rb_failed);
}
@@ -1108,7 +820,13 @@ iconv_failure_failed(VALUE self)
* Returns inspected string like as: #<_class_: _success_, _failed_>
*/
static VALUE
-iconv_failure_inspect(VALUE self)
+iconv_failure_inspect
+#ifdef HAVE_PROTOTYPES
+ (VALUE self)
+#else /* HAVE_PROTOTYPES */
+ (self)
+ VALUE self;
+#endif /* HAVE_PROTOTYPES */
{
const char *cname = rb_class2name(CLASS_OF(self));
VALUE success = rb_attr_get(self, rb_success);
@@ -1156,25 +874,17 @@ iconv_failure_inspect(VALUE self)
*/
void
-Init_iconv(void)
+Init_iconv _((void))
{
VALUE rb_cIconv = rb_define_class("Iconv", rb_cData);
rb_define_alloc_func(rb_cIconv, iconv_s_allocate);
- rb_define_singleton_method(rb_cIconv, "open", iconv_s_open, -1);
+ rb_define_singleton_method(rb_cIconv, "open", iconv_s_open, 2);
rb_define_singleton_method(rb_cIconv, "iconv", iconv_s_iconv, -1);
rb_define_singleton_method(rb_cIconv, "conv", iconv_s_conv, 3);
- rb_define_singleton_method(rb_cIconv, "list", iconv_s_list, 0);
- rb_define_singleton_method(rb_cIconv, "ctlmethods", iconv_s_ctlmethods, 0);
- rb_define_method(rb_cIconv, "initialize", iconv_initialize, -1);
+ rb_define_method(rb_cIconv, "initialize", iconv_initialize, 2);
rb_define_method(rb_cIconv, "close", iconv_finish, 0);
rb_define_method(rb_cIconv, "iconv", iconv_iconv, -1);
- rb_define_method(rb_cIconv, "conv", iconv_conv, -1);
- rb_define_method(rb_cIconv, "trivial?", iconv_trivialp, 0);
- rb_define_method(rb_cIconv, "transliterate?", iconv_get_transliterate, 0);
- rb_define_method(rb_cIconv, "transliterate=", iconv_set_transliterate, 1);
- rb_define_method(rb_cIconv, "discard_ilseq?", iconv_get_discard_ilseq, 0);
- rb_define_method(rb_cIconv, "discard_ilseq=", iconv_set_discard_ilseq, 1);
rb_eIconvFailure = rb_define_module_under(rb_cIconv, "Failure");
rb_define_method(rb_eIconvFailure, "initialize", iconv_failure_initialize, 3);
@@ -1195,8 +905,6 @@ Init_iconv(void)
rb_success = rb_intern("success");
rb_failed = rb_intern("failed");
- id_transliterate = rb_intern("transliterate");
- id_discard_ilseq = rb_intern("discard_ilseq");
rb_gc_register_address(&charset_map);
charset_map = rb_hash_new();
diff --git a/ext/iconv/mkwrapper.rb b/ext/iconv/mkwrapper.rb
deleted file mode 100644
index 34718507d6..0000000000
--- a/ext/iconv/mkwrapper.rb
+++ /dev/null
@@ -1,53 +0,0 @@
-#! /usr/bin/ruby
-require 'rbconfig'
-require 'optparse'
-
-# http://www.ctan.org/tex-archive/macros/texinfo/texinfo/intl/config.charset
-# Fri, 30 May 2003 00:09:00 GMT'
-
-HEADER = <<SRC
-require 'iconv.so'
-
-class Iconv
- case RUBY_PLATFORM
-SRC
-
-def charset_alias(config_charset, mapfile = nil)
- found = nil
- src = [HEADER]
- open(config_charset) do |input|
- input.find {|line| /^case "\$os" in/ =~ line} or return
- input.each do |line|
- case line
- when /^\s*([-\w\*]+(?:\s*\|\s*[-\w\*]+)*)(?=\))/
- (s = " when ") << $&.split('|').collect {|targ|
- targ.strip!
- tail = targ.chomp!("*") ? '' : '\z'
- head = targ.slice!(/\A\*/) ? '' : '\A'
- targ.gsub!(/\*/, '.*')
- "/#{head}#{targ}#{tail}/"
- }.join(", ")
- src << s
- found = {}
- when /^\s*echo "(?:\$\w+\.)?([-\w*]+)\s+([-\w]+)"/
- sys, can = $1, $2
- can.downcase!
- unless found[can] or (/\Aen_(?!US\z)/ =~ sys && /\ACP437\z/i =~ can)
- found[can] = true
- src << " charset_map['#{can}'] = '#{sys}'.freeze"
- end
- when /^\s*;;/
- found = nil
- end
- end
- end
- src << " end" << "end"
- if mapfile
- open(mapfile, "wb") {|f| f.puts *src}
- else
- puts *src
- end
-end
-
-(1..2) === ARGV.size or abort "usage: #{$0} config_charset [mapfile]"
-charset_alias(*ARGV)
diff --git a/ext/io/nonblock/extconf.rb b/ext/io/nonblock/extconf.rb
deleted file mode 100644
index aecdc16cea..0000000000
--- a/ext/io/nonblock/extconf.rb
+++ /dev/null
@@ -1,8 +0,0 @@
-require 'mkmf'
-target = "io/nonblock"
-
-hdr = %w"fcntl.h"
-if have_macro("O_NONBLOCK", hdr) and
- (have_macro("F_GETFL", hdr) or have_macro("F_SETFL", hdr))
- create_makefile(target)
-end
diff --git a/ext/io/nonblock/nonblock.c b/ext/io/nonblock/nonblock.c
deleted file mode 100644
index d7e1ac8e01..0000000000
--- a/ext/io/nonblock/nonblock.c
+++ /dev/null
@@ -1,108 +0,0 @@
-/**********************************************************************
-
- io/wait.c -
-
- $Author$
- created at: Tue Jul 14 21:53:18 2009
-
- All the files in this distribution are covered under the Ruby's
- license (see the file COPYING).
-
-**********************************************************************/
-
-#include "ruby.h"
-#include "ruby/io.h"
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-#include <fcntl.h>
-
-#ifdef F_GETFL
-static int
-io_nonblock_mode(int fd)
-{
- int f = fcntl(fd, F_GETFL);
- if (f == -1) rb_sys_fail(0);
- return f;
-}
-#else
-#define io_nonblock_mode(fd) ((void)(fd), 0)
-#endif
-
-#ifdef F_GETFL
-static VALUE
-rb_io_nonblock_p(VALUE io)
-{
- rb_io_t *fptr;
- GetOpenFile(io, fptr);
- if (io_nonblock_mode(fptr->fd) & O_NONBLOCK)
- return Qtrue;
- return Qfalse;
-}
-#else
-#define rb_io_nonblock_p rb_f_notimplement
-#endif
-
-#ifdef F_SETFL
-static void
-io_nonblock_set(int fd, int f, int nb)
-{
- if (nb)
- f |= O_NONBLOCK;
- else
- f &= ~O_NONBLOCK;
- if (fcntl(fd, F_SETFL, f) == -1)
- rb_sys_fail(0);
-}
-
-static VALUE
-rb_io_nonblock_set(VALUE io, VALUE nb)
-{
- rb_io_t *fptr;
- GetOpenFile(io, fptr);
- io_nonblock_set(fptr->fd, io_nonblock_mode(fptr->fd), RTEST(nb));
- return io;
-}
-
-static VALUE
-io_nonblock_restore(VALUE arg)
-{
- int *restore = (int *)arg;
- if (fcntl(restore[0], F_SETFL, restore[1]) == -1)
- rb_sys_fail(0);
- return Qnil;
-}
-
-static VALUE
-rb_io_nonblock_block(int argc, VALUE *argv, VALUE io)
-{
- int nb = 1;
- rb_io_t *fptr;
- int f, restore[2];
-
- GetOpenFile(io, fptr);
- if (argc > 0) {
- VALUE v;
- rb_scan_args(argc, argv, "01", &v);
- nb = RTEST(v);
- }
- f = io_nonblock_mode(fptr->fd);
- restore[0] = fptr->fd;
- restore[1] = f;
- io_nonblock_set(fptr->fd, f, nb);
- return rb_ensure(rb_yield, io, io_nonblock_restore, (VALUE)restore);
-}
-#else
-#define rb_io_nonblock_set rb_f_notimplement
-#define rb_io_nonblock_block rb_f_notimplement
-#endif
-
-void
-Init_nonblock(void)
-{
- VALUE io = rb_cIO;
-
- rb_define_method(io, "nonblock?", rb_io_nonblock_p, 0);
- rb_define_method(io, "nonblock=", rb_io_nonblock_set, 1);
- rb_define_method(io, "nonblock", rb_io_nonblock_block, -1);
-}
diff --git a/ext/io/wait/.cvsignore b/ext/io/wait/.cvsignore
index 8767482975..fc802ff1c2 100644
--- a/ext/io/wait/.cvsignore
+++ b/ext/io/wait/.cvsignore
@@ -1,3 +1,2 @@
Makefile
mkmf.log
-extconf.h
diff --git a/ext/io/wait/extconf.rb b/ext/io/wait/extconf.rb
index eed3543124..e8181d25f5 100644
--- a/ext/io/wait/extconf.rb
+++ b/ext/io/wait/extconf.rb
@@ -2,9 +2,8 @@ require 'mkmf'
target = "io/wait"
unless macro_defined?("DOSISH", "#include <ruby.h>")
- have_header(ioctl_h = "sys/ioctl.h") or ioctl_h = nil
- fionread = %w[sys/ioctl.h sys/filio.h sys/socket.h].find do |h|
- have_macro("FIONREAD", [h, ioctl_h].compact)
+ fionread = %w[sys/ioctl.h sys/filio.h].find do |h|
+ have_macro("FIONREAD", h)
end
if fionread
$defs << "-DFIONREAD_HEADER=\"<#{fionread}>\""
diff --git a/ext/io/wait/lib/nonblock.rb b/ext/io/wait/lib/nonblock.rb
new file mode 100644
index 0000000000..2103fdf25b
--- /dev/null
+++ b/ext/io/wait/lib/nonblock.rb
@@ -0,0 +1,23 @@
+require "fcntl"
+class IO
+ def nonblock?
+ (fcntl(Fcntl::F_GETFL) & File::NONBLOCK) != 0
+ end
+
+ def nonblock=(nb)
+ f = fcntl(Fcntl::F_GETFL)
+ if nb
+ f |= File::NONBLOCK
+ else
+ f &= ~File::NONBLOCK
+ end
+ fcntl(Fcntl::F_SETFL, f)
+ end
+
+ def nonblock(nb = true)
+ nb, self.nonblock = nonblock?, nb
+ yield
+ ensure
+ self.nonblock = nb
+ end
+end if defined?(Fcntl::F_GETFL)
diff --git a/ext/io/wait/wait.c b/ext/io/wait/wait.c
index b73c9af1ce..02cb54a014 100644
--- a/ext/io/wait/wait.c
+++ b/ext/io/wait/wait.c
@@ -3,6 +3,7 @@
io/wait.c -
$Author$
+ $Date$
created at: Tue Aug 28 09:08:06 JST 2001
All the files in this distribution are covered under the Ruby's
@@ -11,12 +12,9 @@
**********************************************************************/
#include "ruby.h"
-#include "ruby/io.h"
+#include "rubyio.h"
#include <sys/types.h>
-#if defined(HAVE_SYS_IOCTL_H)
-#include <sys/ioctl.h>
-#endif
#if defined(FIONREAD_HEADER)
#include FIONREAD_HEADER
#endif
@@ -33,7 +31,7 @@
#ifdef HAVE_RB_W32_IS_SOCKET
#define FIONREAD_POSSIBLE_P(fd) rb_w32_is_socket(fd)
#else
-#define FIONREAD_POSSIBLE_P(fd) ((void)(fd),Qtrue)
+#define FIONREAD_POSSIBLE_P(fd) ((fd),Qtrue)
#endif
static VALUE io_ready_p _((VALUE io));
@@ -43,126 +41,86 @@ void Init_wait _((void));
EXTERN struct timeval rb_time_interval _((VALUE time));
/*
- * call-seq:
- * io.nread -> int
- *
- * Returns number of bytes that can be read without blocking.
- * Returns zero if no information available.
+=begin
+= IO wait methods.
+=end
*/
-static VALUE
-io_nread(VALUE io)
-{
- rb_io_t *fptr;
- int len;
- ioctl_arg n;
-
- GetOpenFile(io, fptr);
- rb_io_check_readable(fptr);
- len = rb_io_read_pending(fptr);
- if (len > 0) return len;
- if (!FIONREAD_POSSIBLE_P(fptr->fd)) return INT2FIX(0);
- if (ioctl(fptr->fd, FIONREAD, &n)) return INT2FIX(0);
- if (n > 0) return ioctl_arg2num(n);
- return INT2FIX(0);
-}
-
/*
- * call-seq:
- * io.ready? -> true, false or nil
- *
- * Returns true if input available without blocking, or false.
- * Returns nil if no information available.
- */
-
+=begin
+--- IO#ready?
+ returns non-nil if input available without blocking, or nil.
+=end
+*/
static VALUE
-io_ready_p(VALUE io)
+io_ready_p(io)
+ VALUE io;
{
rb_io_t *fptr;
+ FILE *fp;
ioctl_arg n;
GetOpenFile(io, fptr);
rb_io_check_readable(fptr);
- if (rb_io_read_pending(fptr)) return Qtrue;
- if (!FIONREAD_POSSIBLE_P(fptr->fd)) return Qnil;
- if (ioctl(fptr->fd, FIONREAD, &n)) return Qnil;
- if (n > 0) return Qtrue;
- return Qfalse;
-}
-
-struct wait_readable_arg {
- rb_fdset_t fds;
- struct timeval *timeout;
-};
-
-#ifdef HAVE_RB_FD_INIT
-static VALUE
-wait_readable(VALUE p)
-{
- struct wait_readable_arg *arg = (struct wait_readable_arg *)p;
- rb_fdset_t *fds = &arg->fds;
-
- return (VALUE)rb_thread_select(rb_fd_max(fds), rb_fd_ptr(fds), NULL, NULL, arg->timeout);
+ if (!FIONREAD_POSSIBLE_P(fileno(fptr->f))) return Qfalse;
+ fp = fptr->f;
+ if (feof(fp)) return Qfalse;
+ if (rb_read_pending(fp)) return Qtrue;
+ if (ioctl(fileno(fp), FIONREAD, &n)) rb_sys_fail(0);
+ if (n > 0) return ioctl_arg2num(n);
+ return Qnil;
}
-#endif
/*
- * call-seq:
- * io.wait -> IO, true, false or nil
- * io.wait(timeout) -> IO, true, false or nil
- *
- * Waits until input is available or times out and returns self or nil when
- * EOF is reached.
- */
-
+=begin
+--- IO#wait([timeout])
+ waits until input available or timed out and returns self, or nil
+ when EOF reached.
+=end
+*/
static VALUE
-io_wait(int argc, VALUE *argv, VALUE io)
+io_wait(argc, argv, io)
+ int argc;
+ VALUE *argv;
+ VALUE io;
{
rb_io_t *fptr;
- struct wait_readable_arg arg;
- int fd, i;
+ fd_set rd;
+ FILE *fp;
+ int fd;
ioctl_arg n;
VALUE timeout;
- struct timeval timerec;
+ struct timeval *tp, timerec;
GetOpenFile(io, fptr);
rb_io_check_readable(fptr);
rb_scan_args(argc, argv, "01", &timeout);
if (NIL_P(timeout)) {
- arg.timeout = 0;
+ tp = 0;
}
else {
timerec = rb_time_interval(timeout);
- arg.timeout = &timerec;
+ tp = &timerec;
}
- if (rb_io_read_pending(fptr)) return Qtrue;
- if (!FIONREAD_POSSIBLE_P(fptr->fd)) return Qfalse;
- fd = fptr->fd;
- rb_fd_init(&arg.fds);
- rb_fd_set(fd, &arg.fds);
-#ifdef HAVE_RB_FD_INIT
- i = (int)rb_ensure(wait_readable, (VALUE)&arg,
- (VALUE (*)_((VALUE)))rb_fd_term, (VALUE)&arg.fds);
-#else
- i = rb_thread_select(fd + 1, rb_fd_ptr(&arg.fds), NULL, NULL, arg.timeout);
-#endif
- if (i < 0)
+ fp = fptr->f;
+ if (feof(fp)) return Qfalse;
+ if (rb_read_pending(fp)) return Qtrue;
+ fd = fileno(fp);
+ FD_ZERO(&rd);
+ FD_SET(fd, &rd);
+ if (rb_thread_select(fd + 1, &rd, NULL, NULL, tp) < 0)
rb_sys_fail(0);
rb_io_check_closed(fptr);
- if (ioctl(fptr->fd, FIONREAD, &n)) rb_sys_fail(0);
+ if (!FIONREAD_POSSIBLE_P(fileno(fptr->f))) return Qfalse;
+ if (ioctl(fileno(fp), FIONREAD, &n)) rb_sys_fail(0);
if (n > 0) return io;
return Qnil;
}
-/*
- * IO wait methods
- */
-
void
Init_wait()
{
- rb_define_method(rb_cIO, "nread", io_nread, 0);
rb_define_method(rb_cIO, "ready?", io_ready_p, 0);
rb_define_method(rb_cIO, "wait", io_wait, -1);
}
diff --git a/ext/json/ext/generator/extconf.rb b/ext/json/ext/generator/extconf.rb
deleted file mode 100644
index 55741516f4..0000000000
--- a/ext/json/ext/generator/extconf.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-require 'mkmf'
-require 'rbconfig'
-
-if CONFIG['CC'] =~ /gcc/
- $CFLAGS += ' -Wall'
- #$CFLAGS += ' -O0 -ggdb'
-end
-
-create_makefile 'json/ext/generator'
diff --git a/ext/json/ext/generator/generator.c b/ext/json/ext/generator/generator.c
deleted file mode 100644
index 108e80fd65..0000000000
--- a/ext/json/ext/generator/generator.c
+++ /dev/null
@@ -1,919 +0,0 @@
-#include <string.h>
-#include "ruby.h"
-#if HAVE_RUBY_ST_H
-#include "ruby/st.h"
-#endif
-#if HAVE_ST_H
-#include "st.h"
-#endif
-#include "unicode.h"
-#include <math.h>
-
-#ifndef RHASH_TBL
-#define RHASH_TBL(hsh) (RHASH(hsh)->tbl)
-#endif
-
-#ifndef RHASH_SIZE
-#define RHASH_SIZE(hsh) (RHASH(hsh)->tbl->num_entries)
-#endif
-
-#ifndef RFLOAT_VALUE
-#define RFLOAT_VALUE(val) (RFLOAT(val)->value)
-#endif
-
-#ifdef HAVE_RUBY_ENCODING_H
-#include "ruby/encoding.h"
-#define FORCE_UTF8(obj) rb_enc_associate((obj), rb_utf8_encoding())
-#else
-#define FORCE_UTF8(obj)
-#endif
-
-#define check_max_nesting(state, depth) do { \
- long current_nesting = 1 + depth; \
- if (state->max_nesting != 0 && current_nesting > state->max_nesting) \
- rb_raise(eNestingError, "nesting of %ld is too deep", current_nesting); \
-} while (0);
-
-static VALUE mJSON, mExt, mGenerator, cState, mGeneratorMethods, mObject,
- mHash, mArray, mInteger, mFloat, mString, mString_Extend,
- mTrueClass, mFalseClass, mNilClass, eGeneratorError,
- eCircularDatastructure, eNestingError;
-
-static ID i_to_s, i_to_json, i_new, i_indent, i_space, i_space_before,
- i_object_nl, i_array_nl, i_check_circular, i_max_nesting,
- i_allow_nan, i_pack, i_unpack, i_create_id, i_extend;
-
-typedef struct JSON_Generator_StateStruct {
- VALUE indent;
- VALUE space;
- VALUE space_before;
- VALUE object_nl;
- VALUE array_nl;
- int check_circular;
- VALUE seen;
- VALUE memo;
- VALUE depth;
- long max_nesting;
- int flag;
- int allow_nan;
-} JSON_Generator_State;
-
-#define GET_STATE(self) \
- JSON_Generator_State *state; \
- Data_Get_Struct(self, JSON_Generator_State, state);
-
-/*
- * Document-module: JSON::Ext::Generator
- *
- * This is the JSON generator implemented as a C extension. It can be
- * configured to be used by setting
- *
- * JSON.generator = JSON::Ext::Generator
- *
- * with the method generator= in JSON.
- *
- */
-
-static int hash_to_json_state_i(VALUE key, VALUE value, VALUE Vstate)
-{
- VALUE json, buf, Vdepth;
- GET_STATE(Vstate);
- buf = state->memo;
- Vdepth = state->depth;
-
- if (key == Qundef) return ST_CONTINUE;
- if (state->flag) {
- state->flag = 0;
- rb_str_buf_cat2(buf, ",");
- if (RSTRING_LEN(state->object_nl)) rb_str_buf_append(buf, state->object_nl);
- }
- if (RSTRING_LEN(state->object_nl)) {
- rb_str_buf_append(buf, rb_str_times(state->indent, Vdepth));
- }
- json = rb_funcall(rb_funcall(key, i_to_s, 0), i_to_json, 2, Vstate, Vdepth);
- Check_Type(json, T_STRING);
- rb_str_buf_append(buf, json);
- OBJ_INFECT(buf, json);
- if (RSTRING_LEN(state->space_before)) {
- rb_str_buf_append(buf, state->space_before);
- }
- rb_str_buf_cat2(buf, ":");
- if (RSTRING_LEN(state->space)) rb_str_buf_append(buf, state->space);
- json = rb_funcall(value, i_to_json, 2, Vstate, Vdepth);
- Check_Type(json, T_STRING);
- state->flag = 1;
- rb_str_buf_append(buf, json);
- OBJ_INFECT(buf, json);
- state->depth = Vdepth;
- state->memo = buf;
- return ST_CONTINUE;
-}
-
-inline static VALUE mHash_json_transfrom(VALUE self, VALUE Vstate, VALUE Vdepth) {
- long depth, len = RHASH_SIZE(self);
- VALUE result;
- GET_STATE(Vstate);
-
- depth = 1 + FIX2LONG(Vdepth);
- result = rb_str_buf_new(len);
- state->memo = result;
- state->depth = LONG2FIX(depth);
- state->flag = 0;
- rb_str_buf_cat2(result, "{");
- if (RSTRING_LEN(state->object_nl)) rb_str_buf_append(result, state->object_nl);
- rb_hash_foreach(self, hash_to_json_state_i, Vstate);
- if (RSTRING_LEN(state->object_nl)) rb_str_buf_append(result, state->object_nl);
- if (RSTRING_LEN(state->object_nl)) {
- rb_str_buf_append(result, rb_str_times(state->indent, Vdepth));
- }
- rb_str_buf_cat2(result, "}");
- return result;
-}
-
-static int hash_to_json_i(VALUE key, VALUE value, VALUE buf)
-{
- VALUE tmp;
-
- if (key == Qundef) return ST_CONTINUE;
- if (RSTRING_LEN(buf) > 1) rb_str_buf_cat2(buf, ",");
- tmp = rb_funcall(rb_funcall(key, i_to_s, 0), i_to_json, 0);
- Check_Type(tmp, T_STRING);
- rb_str_buf_append(buf, tmp);
- OBJ_INFECT(buf, tmp);
- rb_str_buf_cat2(buf, ":");
- tmp = rb_funcall(value, i_to_json, 0);
- Check_Type(tmp, T_STRING);
- rb_str_buf_append(buf, tmp);
- OBJ_INFECT(buf, tmp);
-
- return ST_CONTINUE;
-}
-
-/*
- * call-seq: to_json(state = nil, depth = 0)
- *
- * Returns a JSON string containing a JSON object, that is unparsed from
- * this Hash instance.
- * _state_ is a JSON::State object, that can also be used to configure the
- * produced JSON string output further.
- * _depth_ is used to find out nesting depth, to indent accordingly.
- */
-static VALUE mHash_to_json(int argc, VALUE *argv, VALUE self)
-{
- VALUE Vstate, Vdepth, result;
- long depth;
-
- rb_scan_args(argc, argv, "02", &Vstate, &Vdepth);
- depth = NIL_P(Vdepth) ? 0 : FIX2LONG(Vdepth);
- if (NIL_P(Vstate)) {
- long len = RHASH_SIZE(self);
- result = rb_str_buf_new(len);
- rb_str_buf_cat2(result, "{");
- rb_hash_foreach(self, hash_to_json_i, result);
- rb_str_buf_cat2(result, "}");
- } else {
- GET_STATE(Vstate);
- check_max_nesting(state, depth);
- if (state->check_circular) {
- VALUE self_id = rb_obj_id(self);
- if (RTEST(rb_hash_aref(state->seen, self_id))) {
- rb_raise(eCircularDatastructure,
- "circular data structures not supported!");
- }
- rb_hash_aset(state->seen, self_id, Qtrue);
- result = mHash_json_transfrom(self, Vstate, LONG2FIX(depth));
- rb_hash_delete(state->seen, self_id);
- } else {
- result = mHash_json_transfrom(self, Vstate, LONG2FIX(depth));
- }
- }
- OBJ_INFECT(result, self);
- FORCE_UTF8(result);
- return result;
-}
-
-inline static VALUE mArray_json_transfrom(VALUE self, VALUE Vstate, VALUE Vdepth) {
- long i, len = RARRAY_LEN(self);
- VALUE shift, result;
- long depth = NIL_P(Vdepth) ? 0 : FIX2LONG(Vdepth);
- VALUE delim = rb_str_new2(",");
- GET_STATE(Vstate);
-
- check_max_nesting(state, depth);
- if (state->check_circular) {
- VALUE self_id = rb_obj_id(self);
- rb_hash_aset(state->seen, self_id, Qtrue);
- result = rb_str_buf_new(len);
- if (RSTRING_LEN(state->array_nl)) rb_str_append(delim, state->array_nl);
- shift = rb_str_times(state->indent, LONG2FIX(depth + 1));
-
- rb_str_buf_cat2(result, "[");
- OBJ_INFECT(result, self);
- rb_str_buf_append(result, state->array_nl);
- for (i = 0; i < len; i++) {
- VALUE element = RARRAY_PTR(self)[i];
- if (RTEST(rb_hash_aref(state->seen, rb_obj_id(element)))) {
- rb_raise(eCircularDatastructure,
- "circular data structures not supported!");
- }
- OBJ_INFECT(result, element);
- if (i > 0) rb_str_buf_append(result, delim);
- rb_str_buf_append(result, shift);
- element = rb_funcall(element, i_to_json, 2, Vstate, LONG2FIX(depth + 1));
- Check_Type(element, T_STRING);
- rb_str_buf_append(result, element);
- }
- if (RSTRING_LEN(state->array_nl)) {
- rb_str_buf_append(result, state->array_nl);
- rb_str_buf_append(result, rb_str_times(state->indent, LONG2FIX(depth)));
- }
- rb_str_buf_cat2(result, "]");
- rb_hash_delete(state->seen, self_id);
- } else {
- result = rb_str_buf_new(len);
- OBJ_INFECT(result, self);
- if (RSTRING_LEN(state->array_nl)) rb_str_append(delim, state->array_nl);
- shift = rb_str_times(state->indent, LONG2FIX(depth + 1));
-
- rb_str_buf_cat2(result, "[");
- rb_str_buf_append(result, state->array_nl);
- for (i = 0; i < len; i++) {
- VALUE element = RARRAY_PTR(self)[i];
- OBJ_INFECT(result, element);
- if (i > 0) rb_str_buf_append(result, delim);
- rb_str_buf_append(result, shift);
- element = rb_funcall(element, i_to_json, 2, Vstate, LONG2FIX(depth + 1));
- Check_Type(element, T_STRING);
- rb_str_buf_append(result, element);
- }
- rb_str_buf_append(result, state->array_nl);
- if (RSTRING_LEN(state->array_nl)) {
- rb_str_buf_append(result, rb_str_times(state->indent, LONG2FIX(depth)));
- }
- rb_str_buf_cat2(result, "]");
- }
- return result;
-}
-
-/*
- * call-seq: to_json(state = nil, depth = 0)
- *
- * Returns a JSON string containing a JSON array, that is unparsed from
- * this Array instance.
- * _state_ is a JSON::State object, that can also be used to configure the
- * produced JSON string output further.
- * _depth_ is used to find out nesting depth, to indent accordingly.
- */
-static VALUE mArray_to_json(int argc, VALUE *argv, VALUE self) {
- VALUE Vstate, Vdepth, result;
-
- rb_scan_args(argc, argv, "02", &Vstate, &Vdepth);
- if (NIL_P(Vstate)) {
- long i, len = RARRAY_LEN(self);
- result = rb_str_buf_new(2 + 2 * len);
- rb_str_buf_cat2(result, "[");
- OBJ_INFECT(result, self);
- for (i = 0; i < len; i++) {
- VALUE element = RARRAY_PTR(self)[i];
- OBJ_INFECT(result, element);
- if (i > 0) rb_str_buf_cat2(result, ",");
- element = rb_funcall(element, i_to_json, 0);
- Check_Type(element, T_STRING);
- rb_str_buf_append(result, element);
- }
- rb_str_buf_cat2(result, "]");
- } else {
- result = mArray_json_transfrom(self, Vstate, Vdepth);
- }
- OBJ_INFECT(result, self);
- FORCE_UTF8(result);
- return result;
-}
-
-/*
- * call-seq: to_json(*)
- *
- * Returns a JSON string representation for this Integer number.
- */
-static VALUE mInteger_to_json(int argc, VALUE *argv, VALUE self)
-{
- VALUE result = rb_funcall(self, i_to_s, 0);
- FORCE_UTF8(result);
- return result;
-}
-
-/*
- * call-seq: to_json(*)
- *
- * Returns a JSON string representation for this Float number.
- */
-static VALUE mFloat_to_json(int argc, VALUE *argv, VALUE self)
-{
- JSON_Generator_State *state = NULL;
- VALUE Vstate, rest, tmp, result;
- double value = RFLOAT_VALUE(self);
- rb_scan_args(argc, argv, "01*", &Vstate, &rest);
- if (!NIL_P(Vstate)) Data_Get_Struct(Vstate, JSON_Generator_State, state);
- if (isinf(value)) {
- if (!state || state->allow_nan) {
- result = rb_funcall(self, i_to_s, 0);
- } else {
- tmp = rb_funcall(self, i_to_s, 0);
- rb_raise(eGeneratorError, "%u: %s not allowed in JSON", __LINE__, StringValueCStr(tmp));
- }
- } else if (isnan(value)) {
- if (!state || state->allow_nan) {
- result = rb_funcall(self, i_to_s, 0);
- } else {
- tmp = rb_funcall(self, i_to_s, 0);
- rb_raise(eGeneratorError, "%u: %s not allowed in JSON", __LINE__, StringValueCStr(tmp));
- }
- } else {
- result = rb_funcall(self, i_to_s, 0);
- }
- FORCE_UTF8(result);
- return result;
-}
-
-/*
- * call-seq: String.included(modul)
- *
- * Extends _modul_ with the String::Extend module.
- */
-static VALUE mString_included_s(VALUE self, VALUE modul) {
- VALUE result = rb_funcall(modul, i_extend, 1, mString_Extend);
- FORCE_UTF8(result);
- return result;
-}
-
-/*
- * call-seq: to_json(*)
- *
- * This string should be encoded with UTF-8 A call to this method
- * returns a JSON string encoded with UTF16 big endian characters as
- * \u????.
- */
-static VALUE mString_to_json(int argc, VALUE *argv, VALUE self)
-{
- VALUE result = rb_str_buf_new(RSTRING_LEN(self));
- rb_str_buf_cat2(result, "\"");
- JSON_convert_UTF8_to_JSON(result, self, strictConversion);
- rb_str_buf_cat2(result, "\"");
- FORCE_UTF8(result);
- return result;
-}
-
-/*
- * call-seq: to_json_raw_object()
- *
- * This method creates a raw object hash, that can be nested into
- * other data structures and will be unparsed as a raw string. This
- * method should be used, if you want to convert raw strings to JSON
- * instead of UTF-8 strings, e. g. binary data.
- */
-static VALUE mString_to_json_raw_object(VALUE self) {
- VALUE ary;
- VALUE result = rb_hash_new();
- rb_hash_aset(result, rb_funcall(mJSON, i_create_id, 0), rb_class_name(rb_obj_class(self)));
- ary = rb_funcall(self, i_unpack, 1, rb_str_new2("C*"));
- rb_hash_aset(result, rb_str_new2("raw"), ary);
- FORCE_UTF8(result);
- return result;
-}
-
-/*
- * call-seq: to_json_raw(*args)
- *
- * This method creates a JSON text from the result of a call to
- * to_json_raw_object of this String.
- */
-static VALUE mString_to_json_raw(int argc, VALUE *argv, VALUE self) {
- VALUE result, obj = mString_to_json_raw_object(self);
- Check_Type(obj, T_HASH);
- result = mHash_to_json(argc, argv, obj);
- FORCE_UTF8(result);
- return result;
-}
-
-/*
- * call-seq: json_create(o)
- *
- * Raw Strings are JSON Objects (the raw bytes are stored in an array for the
- * key "raw"). The Ruby String can be created by this module method.
- */
-static VALUE mString_Extend_json_create(VALUE self, VALUE o) {
- VALUE ary;
- Check_Type(o, T_HASH);
- ary = rb_hash_aref(o, rb_str_new2("raw"));
- return rb_funcall(ary, i_pack, 1, rb_str_new2("C*"));
-}
-
-/*
- * call-seq: to_json(state = nil, depth = 0)
- *
- * Returns a JSON string for true: 'true'.
- */
-static VALUE mTrueClass_to_json(int argc, VALUE *argv, VALUE self)
-{
- VALUE result = rb_str_new2("true");
- FORCE_UTF8(result);
- return result;
-}
-
-/*
- * call-seq: to_json(state = nil, depth = 0)
- *
- * Returns a JSON string for false: 'false'.
- */
-static VALUE mFalseClass_to_json(int argc, VALUE *argv, VALUE self)
-{
- VALUE result = rb_str_new2("false");
- FORCE_UTF8(result);
- return result;
-}
-
-/*
- * call-seq: to_json(state = nil, depth = 0)
- *
- */
-static VALUE mNilClass_to_json(int argc, VALUE *argv, VALUE self)
-{
- VALUE result = rb_str_new2("null");
- FORCE_UTF8(result);
- return result;
-}
-
-/*
- * call-seq: to_json(*)
- *
- * Converts this object to a string (calling #to_s), converts
- * it to a JSON string, and returns the result. This is a fallback, if no
- * special method #to_json was defined for some object.
- */
-static VALUE mObject_to_json(int argc, VALUE *argv, VALUE self)
-{
- VALUE result, string = rb_funcall(self, i_to_s, 0);
- Check_Type(string, T_STRING);
- result = mString_to_json(argc, argv, string);
- FORCE_UTF8(result);
- return result;
-}
-
-/*
- * Document-class: JSON::Ext::Generator::State
- *
- * This class is used to create State instances, that are use to hold data
- * while generating a JSON text from a a Ruby data structure.
- */
-
-static void State_mark(JSON_Generator_State *state)
-{
- rb_gc_mark_maybe(state->indent);
- rb_gc_mark_maybe(state->space);
- rb_gc_mark_maybe(state->space_before);
- rb_gc_mark_maybe(state->object_nl);
- rb_gc_mark_maybe(state->array_nl);
- rb_gc_mark_maybe(state->seen);
- rb_gc_mark_maybe(state->memo);
- rb_gc_mark_maybe(state->depth);
-}
-
-static JSON_Generator_State *State_allocate()
-{
- JSON_Generator_State *state = ALLOC(JSON_Generator_State);
- return state;
-}
-
-static VALUE cState_s_allocate(VALUE klass)
-{
- JSON_Generator_State *state = State_allocate();
- return Data_Wrap_Struct(klass, State_mark, -1, state);
-}
-
-/*
- * call-seq: configure(opts)
- *
- * Configure this State instance with the Hash _opts_, and return
- * itself.
- */
-static inline VALUE cState_configure(VALUE self, VALUE opts)
-{
- VALUE tmp;
- GET_STATE(self);
- tmp = rb_convert_type(opts, T_HASH, "Hash", "to_hash");
- if (NIL_P(tmp)) tmp = rb_convert_type(opts, T_HASH, "Hash", "to_h");
- if (NIL_P(tmp)) {
- rb_raise(rb_eArgError, "opts has to be hash like or convertable into a hash");
- }
- opts = tmp;
- tmp = rb_hash_aref(opts, ID2SYM(i_indent));
- if (RTEST(tmp)) {
- Check_Type(tmp, T_STRING);
- state->indent = tmp;
- }
- tmp = rb_hash_aref(opts, ID2SYM(i_space));
- if (RTEST(tmp)) {
- Check_Type(tmp, T_STRING);
- state->space = tmp;
- }
- tmp = rb_hash_aref(opts, ID2SYM(i_space_before));
- if (RTEST(tmp)) {
- Check_Type(tmp, T_STRING);
- state->space_before = tmp;
- }
- tmp = rb_hash_aref(opts, ID2SYM(i_array_nl));
- if (RTEST(tmp)) {
- Check_Type(tmp, T_STRING);
- state->array_nl = tmp;
- }
- tmp = rb_hash_aref(opts, ID2SYM(i_object_nl));
- if (RTEST(tmp)) {
- Check_Type(tmp, T_STRING);
- state->object_nl = tmp;
- }
- tmp = ID2SYM(i_check_circular);
- if (st_lookup(RHASH_TBL(opts), tmp, 0)) {
- tmp = rb_hash_aref(opts, ID2SYM(i_check_circular));
- state->check_circular = RTEST(tmp);
- } else {
- state->check_circular = 1;
- }
- tmp = ID2SYM(i_max_nesting);
- state->max_nesting = 19;
- if (st_lookup(RHASH_TBL(opts), tmp, 0)) {
- VALUE max_nesting = rb_hash_aref(opts, tmp);
- if (RTEST(max_nesting)) {
- Check_Type(max_nesting, T_FIXNUM);
- state->max_nesting = FIX2LONG(max_nesting);
- } else {
- state->max_nesting = 0;
- }
- }
- tmp = rb_hash_aref(opts, ID2SYM(i_allow_nan));
- state->allow_nan = RTEST(tmp);
- return self;
-}
-
-/*
- * call-seq: to_h
- *
- * Returns the configuration instance variables as a hash, that can be
- * passed to the configure method.
- */
-static VALUE cState_to_h(VALUE self)
-{
- VALUE result = rb_hash_new();
- GET_STATE(self);
- rb_hash_aset(result, ID2SYM(i_indent), state->indent);
- rb_hash_aset(result, ID2SYM(i_space), state->space);
- rb_hash_aset(result, ID2SYM(i_space_before), state->space_before);
- rb_hash_aset(result, ID2SYM(i_object_nl), state->object_nl);
- rb_hash_aset(result, ID2SYM(i_array_nl), state->array_nl);
- rb_hash_aset(result, ID2SYM(i_check_circular), state->check_circular ? Qtrue : Qfalse);
- rb_hash_aset(result, ID2SYM(i_allow_nan), state->allow_nan ? Qtrue : Qfalse);
- rb_hash_aset(result, ID2SYM(i_max_nesting), LONG2FIX(state->max_nesting));
- return result;
-}
-
-
-/*
- * call-seq: new(opts = {})
- *
- * Instantiates a new State object, configured by _opts_.
- *
- * _opts_ can have the following keys:
- *
- * * *indent*: a string used to indent levels (default: ''),
- * * *space*: a string that is put after, a : or , delimiter (default: ''),
- * * *space_before*: a string that is put before a : pair delimiter (default: ''),
- * * *object_nl*: a string that is put at the end of a JSON object (default: ''),
- * * *array_nl*: a string that is put at the end of a JSON array (default: ''),
- * * *check_circular*: true if checking for circular data structures
- * should be done, false (the default) otherwise.
- * * *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.
- */
-static VALUE cState_initialize(int argc, VALUE *argv, VALUE self)
-{
- VALUE opts;
- GET_STATE(self);
-
- rb_scan_args(argc, argv, "01", &opts);
- state->indent = rb_str_new2("");
- state->space = rb_str_new2("");
- state->space_before = rb_str_new2("");
- state->array_nl = rb_str_new2("");
- state->object_nl = rb_str_new2("");
- if (NIL_P(opts)) {
- state->check_circular = 1;
- state->allow_nan = 0;
- state->max_nesting = 19;
- } else {
- cState_configure(self, opts);
- }
- state->seen = rb_hash_new();
- state->memo = Qnil;
- state->depth = INT2FIX(0);
- return self;
-}
-
-/*
- * call-seq: from_state(opts)
- *
- * Creates a State object from _opts_, which ought to be Hash to create a
- * new State instance configured by _opts_, something else to create an
- * unconfigured instance. If _opts_ is a State object, it is just returned.
- */
-static VALUE cState_from_state_s(VALUE self, VALUE opts)
-{
- if (rb_obj_is_kind_of(opts, self)) {
- return opts;
- } else if (rb_obj_is_kind_of(opts, rb_cHash)) {
- return rb_funcall(self, i_new, 1, opts);
- } else {
- return rb_funcall(self, i_new, 0);
- }
-}
-
-/*
- * call-seq: indent()
- *
- * This string is used to indent levels in the JSON text.
- */
-static VALUE cState_indent(VALUE self)
-{
- GET_STATE(self);
- return state->indent;
-}
-
-/*
- * call-seq: indent=(indent)
- *
- * This string is used to indent levels in the JSON text.
- */
-static VALUE cState_indent_set(VALUE self, VALUE indent)
-{
- GET_STATE(self);
- Check_Type(indent, T_STRING);
- return state->indent = indent;
-}
-
-/*
- * call-seq: space()
- *
- * This string is used to insert a space between the tokens in a JSON
- * string.
- */
-static VALUE cState_space(VALUE self)
-{
- GET_STATE(self);
- return state->space;
-}
-
-/*
- * call-seq: space=(space)
- *
- * This string is used to insert a space between the tokens in a JSON
- * string.
- */
-static VALUE cState_space_set(VALUE self, VALUE space)
-{
- GET_STATE(self);
- Check_Type(space, T_STRING);
- return state->space = space;
-}
-
-/*
- * call-seq: space_before()
- *
- * This string is used to insert a space before the ':' in JSON objects.
- */
-static VALUE cState_space_before(VALUE self)
-{
- GET_STATE(self);
- return state->space_before;
-}
-
-/*
- * call-seq: space_before=(space_before)
- *
- * This string is used to insert a space before the ':' in JSON objects.
- */
-static VALUE cState_space_before_set(VALUE self, VALUE space_before)
-{
- GET_STATE(self);
- Check_Type(space_before, T_STRING);
- return state->space_before = space_before;
-}
-
-/*
- * call-seq: object_nl()
- *
- * This string is put at the end of a line that holds a JSON object (or
- * Hash).
- */
-static VALUE cState_object_nl(VALUE self)
-{
- GET_STATE(self);
- return state->object_nl;
-}
-
-/*
- * call-seq: object_nl=(object_nl)
- *
- * This string is put at the end of a line that holds a JSON object (or
- * Hash).
- */
-static VALUE cState_object_nl_set(VALUE self, VALUE object_nl)
-{
- GET_STATE(self);
- Check_Type(object_nl, T_STRING);
- return state->object_nl = object_nl;
-}
-
-/*
- * call-seq: array_nl()
- *
- * This string is put at the end of a line that holds a JSON array.
- */
-static VALUE cState_array_nl(VALUE self)
-{
- GET_STATE(self);
- return state->array_nl;
-}
-
-/*
- * call-seq: array_nl=(array_nl)
- *
- * This string is put at the end of a line that holds a JSON array.
- */
-static VALUE cState_array_nl_set(VALUE self, VALUE array_nl)
-{
- GET_STATE(self);
- Check_Type(array_nl, T_STRING);
- return state->array_nl = array_nl;
-}
-
-/*
- * call-seq: check_circular?
- *
- * Returns true, if circular data structures should be checked,
- * otherwise returns false.
- */
-static VALUE cState_check_circular_p(VALUE self)
-{
- GET_STATE(self);
- return state->check_circular ? Qtrue : Qfalse;
-}
-
-/*
- * call-seq: max_nesting
- *
- * This integer returns the maximum level of data structure nesting in
- * the generated JSON, max_nesting = 0 if no maximum is checked.
- */
-static VALUE cState_max_nesting(VALUE self)
-{
- GET_STATE(self);
- return LONG2FIX(state->max_nesting);
-}
-
-/*
- * call-seq: max_nesting=(depth)
- *
- * This sets the maximum level of data structure nesting in the generated JSON
- * to the integer depth, max_nesting = 0 if no maximum should be checked.
- */
-static VALUE cState_max_nesting_set(VALUE self, VALUE depth)
-{
- GET_STATE(self);
- Check_Type(depth, T_FIXNUM);
- state->max_nesting = FIX2LONG(depth);
- return Qnil;
-}
-
-/*
- * call-seq: allow_nan?
- *
- * Returns true, if NaN, Infinity, and -Infinity should be generated, otherwise
- * returns false.
- */
-static VALUE cState_allow_nan_p(VALUE self)
-{
- GET_STATE(self);
- return state->allow_nan ? Qtrue : Qfalse;
-}
-
-/*
- * call-seq: seen?(object)
- *
- * Returns _true_, if _object_ was already seen during this generating run.
- */
-static VALUE cState_seen_p(VALUE self, VALUE object)
-{
- GET_STATE(self);
- return rb_hash_aref(state->seen, rb_obj_id(object));
-}
-
-/*
- * call-seq: remember(object)
- *
- * Remember _object_, to find out if it was already encountered (if a cyclic
- * data structure is rendered).
- */
-static VALUE cState_remember(VALUE self, VALUE object)
-{
- GET_STATE(self);
- return rb_hash_aset(state->seen, rb_obj_id(object), Qtrue);
-}
-
-/*
- * call-seq: forget(object)
- *
- * Forget _object_ for this generating run.
- */
-static VALUE cState_forget(VALUE self, VALUE object)
-{
- GET_STATE(self);
- return rb_hash_delete(state->seen, rb_obj_id(object));
-}
-
-/*
- *
- */
-void Init_generator()
-{
- rb_require("json/common");
- mJSON = rb_define_module("JSON");
- mExt = rb_define_module_under(mJSON, "Ext");
- mGenerator = rb_define_module_under(mExt, "Generator");
- eGeneratorError = rb_path2class("JSON::GeneratorError");
- eCircularDatastructure = rb_path2class("JSON::CircularDatastructure");
- eNestingError = rb_path2class("JSON::NestingError");
- cState = rb_define_class_under(mGenerator, "State", rb_cObject);
- rb_define_alloc_func(cState, cState_s_allocate);
- rb_define_singleton_method(cState, "from_state", cState_from_state_s, 1);
- rb_define_method(cState, "initialize", cState_initialize, -1);
-
- rb_define_method(cState, "indent", cState_indent, 0);
- rb_define_method(cState, "indent=", cState_indent_set, 1);
- rb_define_method(cState, "space", cState_space, 0);
- rb_define_method(cState, "space=", cState_space_set, 1);
- rb_define_method(cState, "space_before", cState_space_before, 0);
- rb_define_method(cState, "space_before=", cState_space_before_set, 1);
- rb_define_method(cState, "object_nl", cState_object_nl, 0);
- rb_define_method(cState, "object_nl=", cState_object_nl_set, 1);
- rb_define_method(cState, "array_nl", cState_array_nl, 0);
- rb_define_method(cState, "array_nl=", cState_array_nl_set, 1);
- rb_define_method(cState, "check_circular?", cState_check_circular_p, 0);
- rb_define_method(cState, "max_nesting", cState_max_nesting, 0);
- rb_define_method(cState, "max_nesting=", cState_max_nesting_set, 1);
- rb_define_method(cState, "allow_nan?", cState_allow_nan_p, 0);
- rb_define_method(cState, "seen?", cState_seen_p, 1);
- rb_define_method(cState, "remember", cState_remember, 1);
- rb_define_method(cState, "forget", cState_forget, 1);
- rb_define_method(cState, "configure", cState_configure, 1);
- rb_define_method(cState, "to_h", cState_to_h, 0);
-
- mGeneratorMethods = rb_define_module_under(mGenerator, "GeneratorMethods");
- mObject = rb_define_module_under(mGeneratorMethods, "Object");
- rb_define_method(mObject, "to_json", mObject_to_json, -1);
- mHash = rb_define_module_under(mGeneratorMethods, "Hash");
- 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);
- mInteger = rb_define_module_under(mGeneratorMethods, "Integer");
- rb_define_method(mInteger, "to_json", mInteger_to_json, -1);
- mFloat = rb_define_module_under(mGeneratorMethods, "Float");
- rb_define_method(mFloat, "to_json", mFloat_to_json, -1);
- mString = rb_define_module_under(mGeneratorMethods, "String");
- rb_define_singleton_method(mString, "included", mString_included_s, 1);
- rb_define_method(mString, "to_json", mString_to_json, -1);
- rb_define_method(mString, "to_json_raw", mString_to_json_raw, -1);
- rb_define_method(mString, "to_json_raw_object", mString_to_json_raw_object, 0);
- mString_Extend = rb_define_module_under(mString, "Extend");
- rb_define_method(mString_Extend, "json_create", mString_Extend_json_create, 1);
- mTrueClass = rb_define_module_under(mGeneratorMethods, "TrueClass");
- rb_define_method(mTrueClass, "to_json", mTrueClass_to_json, -1);
- mFalseClass = rb_define_module_under(mGeneratorMethods, "FalseClass");
- rb_define_method(mFalseClass, "to_json", mFalseClass_to_json, -1);
- mNilClass = rb_define_module_under(mGeneratorMethods, "NilClass");
- rb_define_method(mNilClass, "to_json", mNilClass_to_json, -1);
-
- i_to_s = rb_intern("to_s");
- i_to_json = rb_intern("to_json");
- i_new = rb_intern("new");
- i_indent = rb_intern("indent");
- i_space = rb_intern("space");
- i_space_before = rb_intern("space_before");
- i_object_nl = rb_intern("object_nl");
- i_array_nl = rb_intern("array_nl");
- i_check_circular = rb_intern("check_circular");
- i_max_nesting = rb_intern("max_nesting");
- i_allow_nan = rb_intern("allow_nan");
- i_pack = rb_intern("pack");
- i_unpack = rb_intern("unpack");
- i_create_id = rb_intern("create_id");
- i_extend = rb_intern("extend");
-}
diff --git a/ext/json/ext/generator/unicode.c b/ext/json/ext/generator/unicode.c
deleted file mode 100644
index 76834eadc5..0000000000
--- a/ext/json/ext/generator/unicode.c
+++ /dev/null
@@ -1,182 +0,0 @@
-#include "unicode.h"
-
-#define unicode_escape(buffer, character) \
- snprintf(buf, 7, "\\u%04x", (unsigned int) (character)); \
- rb_str_buf_cat(buffer, buf, 6);
-
-/*
- * 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.
- */
-
-/*
- * Index into the table below with the first byte of a UTF-8 sequence to
- * get the number of trailing bytes that are supposed to follow it.
- * Note that *legal* UTF-8 values can't have 4 or 5-bytes. The table is
- * left as-is for anyone who may want to do such conversion, which was
- * allowed in earlier algorithms.
- */
-static const char trailingBytesForUTF8[256] = {
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
- 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, 3,3,3,3,3,3,3,3,4,4,4,4,5,5,5,5
-};
-
-/*
- * Magic values subtracted from a buffer value during UTF8 conversion.
- * This table contains as many values as there might be trailing bytes
- * in a UTF-8 sequence.
- */
-static const UTF32 offsetsFromUTF8[6] = { 0x00000000UL, 0x00003080UL, 0x000E2080UL,
- 0x03C82080UL, 0xFA082080UL, 0x82082080UL };
-
-/*
- * Once the bits are split out into bytes of UTF-8, this is a mask OR-ed
- * into the first byte, depending on how many bytes follow. There are
- * as many entries in this table as there are UTF-8 sequence types.
- * (I.e., one byte sequence, two byte... etc.). Remember that sequencs
- * for *legal* UTF-8 will be 4 or fewer bytes total.
- */
-static const UTF8 firstByteMark[7] = { 0x00, 0x00, 0xC0, 0xE0, 0xF0, 0xF8, 0xFC };
-
-/*
- * Utility routine to tell whether a sequence of bytes is legal UTF-8.
- * This must be called with the length pre-determined by the first byte.
- * If not calling this from ConvertUTF8to*, then the length can be set by:
- * length = trailingBytesForUTF8[*source]+1;
- * and the sequence is illegal right away if there aren't that many bytes
- * available.
- * If presented with a length > 4, this returns 0. The Unicode
- * definition of UTF-8 goes up to 4-byte sequences.
- */
-
-inline static unsigned char isLegalUTF8(const UTF8 *source, int length)
-{
- UTF8 a;
- const UTF8 *srcptr = source+length;
- switch (length) {
- default: return 0;
- /* Everything else falls through when "1"... */
- case 4: if ((a = (*--srcptr)) < 0x80 || a > 0xBF) return 0;
- case 3: if ((a = (*--srcptr)) < 0x80 || a > 0xBF) return 0;
- case 2: if ((a = (*--srcptr)) > 0xBF) return 0;
-
- switch (*source) {
- /* no fall-through in this inner switch */
- case 0xE0: if (a < 0xA0) return 0; break;
- case 0xED: if (a > 0x9F) return 0; break;
- case 0xF0: if (a < 0x90) return 0; break;
- case 0xF4: if (a > 0x8F) return 0; break;
- default: if (a < 0x80) return 0;
- }
-
- case 1: if (*source >= 0x80 && *source < 0xC2) return 0;
- }
- if (*source > 0xF4) return 0;
- return 1;
-}
-
-void JSON_convert_UTF8_to_JSON(VALUE buffer, VALUE string, ConversionFlags flags)
-{
- char buf[7];
- const UTF8* source = (UTF8 *) RSTRING_PTR(string);
- const UTF8* sourceEnd = source + RSTRING_LEN(string);
-
- while (source < sourceEnd) {
- UTF32 ch = 0;
- unsigned short extraBytesToRead = trailingBytesForUTF8[*source];
- if (source + extraBytesToRead >= sourceEnd) {
- rb_raise(rb_path2class("JSON::GeneratorError"),
- "partial character in source, but hit end");
- }
- if (!isLegalUTF8(source, extraBytesToRead+1)) {
- rb_raise(rb_path2class("JSON::GeneratorError"),
- "source sequence is illegal/malformed");
- }
- /*
- * The cases all fall through. See "Note A" below.
- */
- switch (extraBytesToRead) {
- case 5: ch += *source++; ch <<= 6; /* remember, illegal UTF-8 */
- case 4: ch += *source++; ch <<= 6; /* remember, illegal UTF-8 */
- case 3: ch += *source++; ch <<= 6;
- case 2: ch += *source++; ch <<= 6;
- case 1: ch += *source++; ch <<= 6;
- case 0: ch += *source++;
- }
- ch -= offsetsFromUTF8[extraBytesToRead];
-
- if (ch <= UNI_MAX_BMP) { /* Target is a character <= 0xFFFF */
- /* UTF-16 surrogate values are illegal in UTF-32 */
- if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_LOW_END) {
- if (flags == strictConversion) {
- source -= (extraBytesToRead+1); /* return to the illegal value itself */
- rb_raise(rb_path2class("JSON::GeneratorError"),
- "source sequence is illegal/malformed");
- } else {
- unicode_escape(buffer, UNI_REPLACEMENT_CHAR);
- }
- } else {
- /* normal case */
- if (ch == '"') {
- rb_str_buf_cat2(buffer, "\\\"");
- } else if (ch == '\\') {
- rb_str_buf_cat2(buffer, "\\\\");
- } else if (ch == '/') {
- rb_str_buf_cat2(buffer, "\\/");
- } else if (ch >= 0x20 && ch <= 0x7f) {
- rb_str_buf_cat(buffer, (char *) source - 1, 1);
- } else if (ch == '\n') {
- rb_str_buf_cat2(buffer, "\\n");
- } else if (ch == '\r') {
- rb_str_buf_cat2(buffer, "\\r");
- } else if (ch == '\t') {
- rb_str_buf_cat2(buffer, "\\t");
- } else if (ch == '\f') {
- rb_str_buf_cat2(buffer, "\\f");
- } else if (ch == '\b') {
- rb_str_buf_cat2(buffer, "\\b");
- } else if (ch < 0x20) {
- unicode_escape(buffer, (UTF16) ch);
- } else {
- unicode_escape(buffer, (UTF16) ch);
- }
- }
- } else if (ch > UNI_MAX_UTF16) {
- if (flags == strictConversion) {
- source -= (extraBytesToRead+1); /* return to the start */
- rb_raise(rb_path2class("JSON::GeneratorError"),
- "source sequence is illegal/malformed");
- } else {
- unicode_escape(buffer, UNI_REPLACEMENT_CHAR);
- }
- } else {
- /* target is a character in range 0xFFFF - 0x10FFFF. */
- ch -= halfBase;
- unicode_escape(buffer, (UTF16)((ch >> halfShift) + UNI_SUR_HIGH_START));
- unicode_escape(buffer, (UTF16)((ch & halfMask) + UNI_SUR_LOW_START));
- }
- }
-}
diff --git a/ext/json/ext/generator/unicode.h b/ext/json/ext/generator/unicode.h
deleted file mode 100644
index 841474bcea..0000000000
--- a/ext/json/ext/generator/unicode.h
+++ /dev/null
@@ -1,53 +0,0 @@
-#include "ruby.h"
-
-#ifndef _GENERATOR_UNICODE_H_
-#define _GENERATOR_UNICODE_H_
-
-typedef enum {
- conversionOK = 0, /* conversion successful */
- sourceExhausted, /* partial character in source, but hit end */
- targetExhausted, /* insuff. room in target for conversion */
- sourceIllegal /* source sequence is illegal/malformed */
-} ConversionResult;
-
-typedef enum {
- strictConversion = 0,
- lenientConversion
-} ConversionFlags;
-
-typedef unsigned long UTF32; /* at least 32 bits */
-typedef unsigned short UTF16; /* at least 16 bits */
-typedef unsigned char UTF8; /* typically 8 bits */
-
-#define UNI_REPLACEMENT_CHAR (UTF32)0x0000FFFD
-#define UNI_MAX_BMP (UTF32)0x0000FFFF
-#define UNI_MAX_UTF16 (UTF32)0x0010FFFF
-#define UNI_MAX_UTF32 (UTF32)0x7FFFFFFF
-#define UNI_MAX_LEGAL_UTF32 (UTF32)0x0010FFFF
-
-#define UNI_SUR_HIGH_START (UTF32)0xD800
-#define UNI_SUR_HIGH_END (UTF32)0xDBFF
-#define UNI_SUR_LOW_START (UTF32)0xDC00
-#define UNI_SUR_LOW_END (UTF32)0xDFFF
-
-static const int halfShift = 10; /* used for shifting by 10 bits */
-
-static const UTF32 halfBase = 0x0010000UL;
-static const UTF32 halfMask = 0x3FFUL;
-
-void JSON_convert_UTF8_to_JSON(VALUE buffer, VALUE string, ConversionFlags flags);
-
-#ifndef RARRAY_PTR
-#define RARRAY_PTR(ARRAY) RARRAY(ARRAY)->ptr
-#endif
-#ifndef RARRAY_LEN
-#define RARRAY_LEN(ARRAY) RARRAY(ARRAY)->len
-#endif
-#ifndef RSTRING_PTR
-#define RSTRING_PTR(string) RSTRING(string)->ptr
-#endif
-#ifndef RSTRING_LEN
-#define RSTRING_LEN(string) RSTRING(string)->len
-#endif
-
-#endif
diff --git a/ext/json/ext/parser/extconf.rb b/ext/json/ext/parser/extconf.rb
deleted file mode 100644
index b56c4e66d7..0000000000
--- a/ext/json/ext/parser/extconf.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-require 'mkmf'
-require 'rbconfig'
-
-if CONFIG['CC'] =~ /gcc/
- $CFLAGS += ' -Wall'
- #$CFLAGS += ' -O0 -ggdb'
-end
-
-create_makefile 'json/ext/parser'
diff --git a/ext/json/ext/parser/parser.c b/ext/json/ext/parser/parser.c
deleted file mode 100644
index 6928eda9e5..0000000000
--- a/ext/json/ext/parser/parser.c
+++ /dev/null
@@ -1,1805 +0,0 @@
-
-#line 1 "parser.rl"
-#include "ruby.h"
-#include "unicode.h"
-#if HAVE_RE_H
-#include "re.h"
-#endif
-#if HAVE_RUBY_ST_H
-#include "ruby/st.h"
-#endif
-#if HAVE_ST_H
-#include "st.h"
-#endif
-
-#define EVIL 0x666
-
-#ifndef RHASH_TBL
-#define RHASH_TBL(hsh) (RHASH(hsh)->tbl)
-#endif
-
-#ifdef HAVE_RUBY_ENCODING_H
-#include "ruby/encoding.h"
-#define FORCE_UTF8(obj) rb_enc_associate((obj), rb_utf8_encoding())
-#else
-#define FORCE_UTF8(obj)
-#endif
-
-static VALUE mJSON, mExt, cParser, eParserError, eNestingError;
-static VALUE CNaN, CInfinity, CMinusInfinity;
-
-static ID i_json_creatable_p, i_json_create, i_create_id, i_create_additions,
- i_chr, i_max_nesting, i_allow_nan;
-
-#define MinusInfinity "-Infinity"
-
-typedef struct JSON_ParserStruct {
- VALUE Vsource;
- char *source;
- long len;
- char *memo;
- VALUE create_id;
- int max_nesting;
- int current_nesting;
- int allow_nan;
-} JSON_Parser;
-
-static char *JSON_parse_object(JSON_Parser *json, char *p, char *pe, VALUE *result);
-static char *JSON_parse_array(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_string(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);
-
-#define GET_STRUCT \
- JSON_Parser *json; \
- Data_Get_Struct(self, JSON_Parser, json);
-
-
-#line 82 "parser.rl"
-
-
-
-#line 64 "parser.c"
-static const int JSON_object_start = 1;
-static const int JSON_object_first_final = 27;
-static const int JSON_object_error = 0;
-
-static const int JSON_object_en_main = 1;
-
-
-#line 115 "parser.rl"
-
-
-static char *JSON_parse_object(JSON_Parser *json, char *p, char *pe, VALUE *result)
-{
- int cs = EVIL;
- VALUE last_name = Qnil;
-
- if (json->max_nesting && json->current_nesting > json->max_nesting) {
- rb_raise(eNestingError, "nesting of %d is to deep", json->current_nesting);
- }
-
- *result = rb_hash_new();
-
-
-#line 87 "parser.c"
- {
- cs = JSON_object_start;
- }
-
-#line 129 "parser.rl"
-
-#line 94 "parser.c"
- {
- if ( p == pe )
- goto _test_eof;
- switch ( cs )
- {
-case 1:
- if ( (*p) == 123 )
- goto st2;
- goto st0;
-st0:
-cs = 0;
- goto _out;
-st2:
- if ( ++p == pe )
- goto _test_eof2;
-case 2:
- switch( (*p) ) {
- case 13: goto st2;
- case 32: goto st2;
- case 34: goto tr2;
- case 47: goto st23;
- case 125: goto tr4;
- }
- if ( 9 <= (*p) && (*p) <= 10 )
- goto st2;
- goto st0;
-tr2:
-#line 101 "parser.rl"
- {
- char *np = JSON_parse_string(json, p, pe, &last_name);
- if (np == NULL) { p--; {p++; cs = 3; goto _out;} } else {p = (( np))-1;}
- }
- goto st3;
-st3:
- if ( ++p == pe )
- goto _test_eof3;
-case 3:
-#line 132 "parser.c"
- switch( (*p) ) {
- case 13: goto st3;
- case 32: goto st3;
- case 47: goto st4;
- case 58: goto st8;
- }
- if ( 9 <= (*p) && (*p) <= 10 )
- goto st3;
- goto st0;
-st4:
- if ( ++p == pe )
- goto _test_eof4;
-case 4:
- switch( (*p) ) {
- case 42: goto st5;
- case 47: goto st7;
- }
- goto st0;
-st5:
- if ( ++p == pe )
- goto _test_eof5;
-case 5:
- if ( (*p) == 42 )
- goto st6;
- goto st5;
-st6:
- if ( ++p == pe )
- goto _test_eof6;
-case 6:
- switch( (*p) ) {
- case 42: goto st6;
- case 47: goto st3;
- }
- goto st5;
-st7:
- if ( ++p == pe )
- goto _test_eof7;
-case 7:
- if ( (*p) == 10 )
- goto st3;
- goto st7;
-st8:
- if ( ++p == pe )
- goto _test_eof8;
-case 8:
- switch( (*p) ) {
- case 13: goto st8;
- case 32: goto st8;
- case 34: goto tr11;
- case 45: goto tr11;
- case 47: goto st19;
- case 73: goto tr11;
- case 78: goto tr11;
- case 91: goto tr11;
- case 102: goto tr11;
- case 110: goto tr11;
- case 116: goto tr11;
- case 123: goto tr11;
- }
- if ( (*p) > 10 ) {
- if ( 48 <= (*p) && (*p) <= 57 )
- goto tr11;
- } else if ( (*p) >= 9 )
- goto st8;
- goto st0;
-tr11:
-#line 90 "parser.rl"
- {
- VALUE v = Qnil;
- char *np = JSON_parse_value(json, p, pe, &v);
- if (np == NULL) {
- p--; {p++; cs = 9; goto _out;}
- } else {
- rb_hash_aset(*result, last_name, v);
- {p = (( np))-1;}
- }
- }
- goto st9;
-st9:
- if ( ++p == pe )
- goto _test_eof9;
-case 9:
-#line 215 "parser.c"
- switch( (*p) ) {
- case 13: goto st9;
- case 32: goto st9;
- case 44: goto st10;
- case 47: goto st15;
- case 125: goto tr4;
- }
- if ( 9 <= (*p) && (*p) <= 10 )
- goto st9;
- goto st0;
-st10:
- if ( ++p == pe )
- goto _test_eof10;
-case 10:
- switch( (*p) ) {
- case 13: goto st10;
- case 32: goto st10;
- case 34: goto tr2;
- case 47: goto st11;
- }
- if ( 9 <= (*p) && (*p) <= 10 )
- goto st10;
- goto st0;
-st11:
- if ( ++p == pe )
- goto _test_eof11;
-case 11:
- switch( (*p) ) {
- case 42: goto st12;
- case 47: goto st14;
- }
- goto st0;
-st12:
- if ( ++p == pe )
- goto _test_eof12;
-case 12:
- if ( (*p) == 42 )
- goto st13;
- goto st12;
-st13:
- if ( ++p == pe )
- goto _test_eof13;
-case 13:
- switch( (*p) ) {
- case 42: goto st13;
- case 47: goto st10;
- }
- goto st12;
-st14:
- if ( ++p == pe )
- goto _test_eof14;
-case 14:
- if ( (*p) == 10 )
- goto st10;
- goto st14;
-st15:
- if ( ++p == pe )
- goto _test_eof15;
-case 15:
- switch( (*p) ) {
- case 42: goto st16;
- case 47: goto st18;
- }
- goto st0;
-st16:
- if ( ++p == pe )
- goto _test_eof16;
-case 16:
- if ( (*p) == 42 )
- goto st17;
- goto st16;
-st17:
- if ( ++p == pe )
- goto _test_eof17;
-case 17:
- switch( (*p) ) {
- case 42: goto st17;
- case 47: goto st9;
- }
- goto st16;
-st18:
- if ( ++p == pe )
- goto _test_eof18;
-case 18:
- if ( (*p) == 10 )
- goto st9;
- goto st18;
-tr4:
-#line 106 "parser.rl"
- { p--; {p++; cs = 27; goto _out;} }
- goto st27;
-st27:
- if ( ++p == pe )
- goto _test_eof27;
-case 27:
-#line 311 "parser.c"
- goto st0;
-st19:
- if ( ++p == pe )
- goto _test_eof19;
-case 19:
- switch( (*p) ) {
- case 42: goto st20;
- case 47: goto st22;
- }
- goto st0;
-st20:
- if ( ++p == pe )
- goto _test_eof20;
-case 20:
- if ( (*p) == 42 )
- goto st21;
- goto st20;
-st21:
- if ( ++p == pe )
- goto _test_eof21;
-case 21:
- switch( (*p) ) {
- case 42: goto st21;
- case 47: goto st8;
- }
- goto st20;
-st22:
- if ( ++p == pe )
- goto _test_eof22;
-case 22:
- if ( (*p) == 10 )
- goto st8;
- goto st22;
-st23:
- if ( ++p == pe )
- goto _test_eof23;
-case 23:
- switch( (*p) ) {
- case 42: goto st24;
- case 47: goto st26;
- }
- goto st0;
-st24:
- if ( ++p == pe )
- goto _test_eof24;
-case 24:
- if ( (*p) == 42 )
- goto st25;
- goto st24;
-st25:
- if ( ++p == pe )
- goto _test_eof25;
-case 25:
- switch( (*p) ) {
- case 42: goto st25;
- case 47: goto st2;
- }
- goto st24;
-st26:
- if ( ++p == pe )
- goto _test_eof26;
-case 26:
- if ( (*p) == 10 )
- goto st2;
- goto st26;
- }
- _test_eof2: cs = 2; goto _test_eof;
- _test_eof3: cs = 3; goto _test_eof;
- _test_eof4: cs = 4; goto _test_eof;
- _test_eof5: cs = 5; goto _test_eof;
- _test_eof6: cs = 6; goto _test_eof;
- _test_eof7: cs = 7; goto _test_eof;
- _test_eof8: cs = 8; goto _test_eof;
- _test_eof9: cs = 9; goto _test_eof;
- _test_eof10: cs = 10; goto _test_eof;
- _test_eof11: cs = 11; goto _test_eof;
- _test_eof12: cs = 12; goto _test_eof;
- _test_eof13: cs = 13; goto _test_eof;
- _test_eof14: cs = 14; goto _test_eof;
- _test_eof15: cs = 15; goto _test_eof;
- _test_eof16: cs = 16; goto _test_eof;
- _test_eof17: cs = 17; goto _test_eof;
- _test_eof18: cs = 18; goto _test_eof;
- _test_eof27: cs = 27; 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_eof: {}
- _out: {}
- }
-
-#line 130 "parser.rl"
-
- if (cs >= JSON_object_first_final) {
- if (RTEST(json->create_id)) {
- VALUE klassname = rb_hash_aref(*result, json->create_id);
- if (!NIL_P(klassname)) {
- VALUE klass = rb_path2class(StringValueCStr(klassname));
- if RTEST(rb_funcall(klass, i_json_creatable_p, 0)) {
- *result = rb_funcall(klass, i_json_create, 1, *result);
- }
- }
- }
- return p + 1;
- } else {
- return NULL;
- }
-}
-
-
-#line 428 "parser.c"
-static const int JSON_value_start = 1;
-static const int JSON_value_first_final = 21;
-static const int JSON_value_error = 0;
-
-static const int JSON_value_en_main = 1;
-
-
-#line 228 "parser.rl"
-
-
-static char *JSON_parse_value(JSON_Parser *json, char *p, char *pe, VALUE *result)
-{
- int cs = EVIL;
-
-
-#line 444 "parser.c"
- {
- cs = JSON_value_start;
- }
-
-#line 235 "parser.rl"
-
-#line 451 "parser.c"
- {
- if ( p == pe )
- goto _test_eof;
- switch ( cs )
- {
-case 1:
- switch( (*p) ) {
- 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 ( 48 <= (*p) && (*p) <= 57 )
- goto tr2;
- goto st0;
-st0:
-cs = 0;
- goto _out;
-tr0:
-#line 176 "parser.rl"
- {
- char *np = JSON_parse_string(json, p, pe, result);
- if (np == NULL) { p--; {p++; cs = 21; goto _out;} } else {p = (( np))-1;}
- }
- goto st21;
-tr2:
-#line 181 "parser.rl"
- {
- char *np;
- if(pe > p + 9 && !strncmp(MinusInfinity, p, 9)) {
- if (json->allow_nan) {
- *result = CMinusInfinity;
- {p = (( p + 10))-1;}
- p--; {p++; cs = 21; goto _out;}
- } else {
- rb_raise(eParserError, "%u: unexpected token at '%s'", __LINE__, p);
- }
- }
- np = JSON_parse_float(json, p, pe, result);
- if (np != NULL) {p = (( np))-1;}
- np = JSON_parse_integer(json, p, pe, result);
- if (np != NULL) {p = (( np))-1;}
- p--; {p++; cs = 21; goto _out;}
- }
- goto st21;
-tr5:
-#line 199 "parser.rl"
- {
- char *np;
- 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 st21;
-tr9:
-#line 207 "parser.rl"
- {
- char *np;
- 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 st21;
-tr16:
-#line 169 "parser.rl"
- {
- if (json->allow_nan) {
- *result = CInfinity;
- } else {
- rb_raise(eParserError, "%u: unexpected token at '%s'", __LINE__, p - 8);
- }
- }
- goto st21;
-tr18:
-#line 162 "parser.rl"
- {
- if (json->allow_nan) {
- *result = CNaN;
- } else {
- rb_raise(eParserError, "%u: unexpected token at '%s'", __LINE__, p - 2);
- }
- }
- goto st21;
-tr22:
-#line 156 "parser.rl"
- {
- *result = Qfalse;
- }
- goto st21;
-tr25:
-#line 153 "parser.rl"
- {
- *result = Qnil;
- }
- goto st21;
-tr28:
-#line 159 "parser.rl"
- {
- *result = Qtrue;
- }
- goto st21;
-st21:
- if ( ++p == pe )
- goto _test_eof21;
-case 21:
-#line 215 "parser.rl"
- { p--; {p++; cs = 21; goto _out;} }
-#line 566 "parser.c"
- goto st0;
-st2:
- if ( ++p == pe )
- goto _test_eof2;
-case 2:
- if ( (*p) == 110 )
- goto st3;
- goto st0;
-st3:
- if ( ++p == pe )
- goto _test_eof3;
-case 3:
- if ( (*p) == 102 )
- goto st4;
- goto st0;
-st4:
- if ( ++p == pe )
- goto _test_eof4;
-case 4:
- if ( (*p) == 105 )
- goto st5;
- goto st0;
-st5:
- if ( ++p == pe )
- goto _test_eof5;
-case 5:
- if ( (*p) == 110 )
- goto st6;
- goto st0;
-st6:
- if ( ++p == pe )
- goto _test_eof6;
-case 6:
- if ( (*p) == 105 )
- goto st7;
- goto st0;
-st7:
- if ( ++p == pe )
- goto _test_eof7;
-case 7:
- if ( (*p) == 116 )
- goto st8;
- goto st0;
-st8:
- if ( ++p == pe )
- goto _test_eof8;
-case 8:
- if ( (*p) == 121 )
- goto tr16;
- goto st0;
-st9:
- if ( ++p == pe )
- goto _test_eof9;
-case 9:
- if ( (*p) == 97 )
- goto st10;
- goto st0;
-st10:
- if ( ++p == pe )
- goto _test_eof10;
-case 10:
- if ( (*p) == 78 )
- goto tr18;
- goto st0;
-st11:
- if ( ++p == pe )
- goto _test_eof11;
-case 11:
- if ( (*p) == 97 )
- goto st12;
- goto st0;
-st12:
- if ( ++p == pe )
- goto _test_eof12;
-case 12:
- if ( (*p) == 108 )
- goto st13;
- goto st0;
-st13:
- if ( ++p == pe )
- goto _test_eof13;
-case 13:
- if ( (*p) == 115 )
- goto st14;
- goto st0;
-st14:
- if ( ++p == pe )
- goto _test_eof14;
-case 14:
- if ( (*p) == 101 )
- goto tr22;
- goto st0;
-st15:
- if ( ++p == pe )
- goto _test_eof15;
-case 15:
- if ( (*p) == 117 )
- goto st16;
- goto st0;
-st16:
- if ( ++p == pe )
- goto _test_eof16;
-case 16:
- if ( (*p) == 108 )
- goto st17;
- goto st0;
-st17:
- if ( ++p == pe )
- goto _test_eof17;
-case 17:
- if ( (*p) == 108 )
- goto tr25;
- goto st0;
-st18:
- if ( ++p == pe )
- goto _test_eof18;
-case 18:
- if ( (*p) == 114 )
- goto st19;
- goto st0;
-st19:
- if ( ++p == pe )
- goto _test_eof19;
-case 19:
- if ( (*p) == 117 )
- goto st20;
- goto st0;
-st20:
- if ( ++p == pe )
- goto _test_eof20;
-case 20:
- if ( (*p) == 101 )
- goto tr28;
- goto st0;
- }
- _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;
- _test_eof5: cs = 5; goto _test_eof;
- _test_eof6: cs = 6; goto _test_eof;
- _test_eof7: cs = 7; goto _test_eof;
- _test_eof8: cs = 8; goto _test_eof;
- _test_eof9: cs = 9; goto _test_eof;
- _test_eof10: cs = 10; goto _test_eof;
- _test_eof11: cs = 11; goto _test_eof;
- _test_eof12: cs = 12; goto _test_eof;
- _test_eof13: cs = 13; goto _test_eof;
- _test_eof14: cs = 14; goto _test_eof;
- _test_eof15: cs = 15; goto _test_eof;
- _test_eof16: cs = 16; goto _test_eof;
- _test_eof17: cs = 17; goto _test_eof;
- _test_eof18: cs = 18; goto _test_eof;
- _test_eof19: cs = 19; goto _test_eof;
- _test_eof20: cs = 20; goto _test_eof;
-
- _test_eof: {}
- _out: {}
- }
-
-#line 236 "parser.rl"
-
- if (cs >= JSON_value_first_final) {
- return p;
- } else {
- return NULL;
- }
-}
-
-
-#line 737 "parser.c"
-static const int JSON_integer_start = 1;
-static const int JSON_integer_first_final = 5;
-static const int JSON_integer_error = 0;
-
-static const int JSON_integer_en_main = 1;
-
-
-#line 252 "parser.rl"
-
-
-static char *JSON_parse_integer(JSON_Parser *json, char *p, char *pe, VALUE *result)
-{
- int cs = EVIL;
-
-
-#line 753 "parser.c"
- {
- cs = JSON_integer_start;
- }
-
-#line 259 "parser.rl"
- json->memo = p;
-
-#line 761 "parser.c"
- {
- if ( p == pe )
- goto _test_eof;
- switch ( cs )
- {
-case 1:
- switch( (*p) ) {
- case 45: goto st2;
- case 48: goto st3;
- }
- if ( 49 <= (*p) && (*p) <= 57 )
- goto st4;
- goto st0;
-st0:
-cs = 0;
- goto _out;
-st2:
- if ( ++p == pe )
- goto _test_eof2;
-case 2:
- if ( (*p) == 48 )
- goto st3;
- if ( 49 <= (*p) && (*p) <= 57 )
- goto st4;
- goto st0;
-st3:
- if ( ++p == pe )
- goto _test_eof3;
-case 3:
- if ( 48 <= (*p) && (*p) <= 57 )
- goto st0;
- goto tr4;
-tr4:
-#line 249 "parser.rl"
- { p--; {p++; cs = 5; goto _out;} }
- goto st5;
-st5:
- if ( ++p == pe )
- goto _test_eof5;
-case 5:
-#line 802 "parser.c"
- goto st0;
-st4:
- if ( ++p == pe )
- goto _test_eof4;
-case 4:
- if ( 48 <= (*p) && (*p) <= 57 )
- goto st4;
- goto tr4;
- }
- _test_eof2: cs = 2; goto _test_eof;
- _test_eof3: cs = 3; goto _test_eof;
- _test_eof5: cs = 5; goto _test_eof;
- _test_eof4: cs = 4; goto _test_eof;
-
- _test_eof: {}
- _out: {}
- }
-
-#line 261 "parser.rl"
-
- if (cs >= JSON_integer_first_final) {
- long len = p - json->memo;
- *result = rb_Integer(rb_str_new(json->memo, len));
- return p + 1;
- } else {
- return NULL;
- }
-}
-
-
-#line 833 "parser.c"
-static const int JSON_float_start = 1;
-static const int JSON_float_first_final = 10;
-static const int JSON_float_error = 0;
-
-static const int JSON_float_en_main = 1;
-
-
-#line 283 "parser.rl"
-
-
-static char *JSON_parse_float(JSON_Parser *json, char *p, char *pe, VALUE *result)
-{
- int cs = EVIL;
-
-
-#line 849 "parser.c"
- {
- cs = JSON_float_start;
- }
-
-#line 290 "parser.rl"
- json->memo = p;
-
-#line 857 "parser.c"
- {
- if ( p == pe )
- goto _test_eof;
- switch ( cs )
- {
-case 1:
- switch( (*p) ) {
- case 45: goto st2;
- case 48: goto st3;
- }
- if ( 49 <= (*p) && (*p) <= 57 )
- goto st9;
- goto st0;
-st0:
-cs = 0;
- goto _out;
-st2:
- if ( ++p == pe )
- goto _test_eof2;
-case 2:
- if ( (*p) == 48 )
- goto st3;
- if ( 49 <= (*p) && (*p) <= 57 )
- goto st9;
- goto st0;
-st3:
- if ( ++p == pe )
- goto _test_eof3;
-case 3:
- switch( (*p) ) {
- case 46: goto st4;
- case 69: goto st6;
- case 101: goto st6;
- }
- goto st0;
-st4:
- if ( ++p == pe )
- goto _test_eof4;
-case 4:
- if ( 48 <= (*p) && (*p) <= 57 )
- goto st5;
- goto st0;
-st5:
- if ( ++p == pe )
- goto _test_eof5;
-case 5:
- switch( (*p) ) {
- case 69: goto st6;
- case 101: goto st6;
- }
- if ( (*p) > 46 ) {
- if ( 48 <= (*p) && (*p) <= 57 )
- goto st5;
- } else if ( (*p) >= 45 )
- goto st0;
- goto tr7;
-tr7:
-#line 277 "parser.rl"
- { p--; {p++; cs = 10; goto _out;} }
- goto st10;
-st10:
- if ( ++p == pe )
- goto _test_eof10;
-case 10:
-#line 922 "parser.c"
- goto st0;
-st6:
- if ( ++p == pe )
- goto _test_eof6;
-case 6:
- switch( (*p) ) {
- case 43: goto st7;
- case 45: goto st7;
- }
- if ( 48 <= (*p) && (*p) <= 57 )
- goto st8;
- goto st0;
-st7:
- if ( ++p == pe )
- goto _test_eof7;
-case 7:
- if ( 48 <= (*p) && (*p) <= 57 )
- goto st8;
- goto st0;
-st8:
- if ( ++p == pe )
- goto _test_eof8;
-case 8:
- switch( (*p) ) {
- case 69: goto st0;
- case 101: goto st0;
- }
- if ( (*p) > 46 ) {
- if ( 48 <= (*p) && (*p) <= 57 )
- goto st8;
- } else if ( (*p) >= 45 )
- goto st0;
- goto tr7;
-st9:
- if ( ++p == pe )
- goto _test_eof9;
-case 9:
- switch( (*p) ) {
- case 46: goto st4;
- case 69: goto st6;
- case 101: goto st6;
- }
- if ( 48 <= (*p) && (*p) <= 57 )
- goto st9;
- goto st0;
- }
- _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 292 "parser.rl"
-
- if (cs >= JSON_float_first_final) {
- long len = p - json->memo;
- *result = rb_Float(rb_str_new(json->memo, len));
- return p + 1;
- } else {
- return NULL;
- }
-}
-
-
-
-#line 996 "parser.c"
-static const int JSON_array_start = 1;
-static const int JSON_array_first_final = 17;
-static const int JSON_array_error = 0;
-
-static const int JSON_array_en_main = 1;
-
-
-#line 328 "parser.rl"
-
-
-static char *JSON_parse_array(JSON_Parser *json, char *p, char *pe, VALUE *result)
-{
- int cs = EVIL;
-
- if (json->max_nesting && json->current_nesting > json->max_nesting) {
- rb_raise(eNestingError, "nesting of %d is to deep", json->current_nesting);
- }
- *result = rb_ary_new();
-
-
-#line 1017 "parser.c"
- {
- cs = JSON_array_start;
- }
-
-#line 340 "parser.rl"
-
-#line 1024 "parser.c"
- {
- if ( p == pe )
- goto _test_eof;
- switch ( cs )
- {
-case 1:
- if ( (*p) == 91 )
- goto st2;
- goto st0;
-st0:
-cs = 0;
- goto _out;
-st2:
- if ( ++p == pe )
- goto _test_eof2;
-case 2:
- switch( (*p) ) {
- case 13: goto st2;
- case 32: goto st2;
- case 34: goto tr2;
- case 45: goto tr2;
- case 47: goto st13;
- case 73: goto tr2;
- case 78: goto tr2;
- case 91: goto tr2;
- case 93: goto tr4;
- case 102: goto tr2;
- case 110: goto tr2;
- case 116: goto tr2;
- case 123: goto tr2;
- }
- if ( (*p) > 10 ) {
- if ( 48 <= (*p) && (*p) <= 57 )
- goto tr2;
- } else if ( (*p) >= 9 )
- goto st2;
- goto st0;
-tr2:
-#line 309 "parser.rl"
- {
- VALUE v = Qnil;
- char *np = JSON_parse_value(json, p, pe, &v);
- if (np == NULL) {
- p--; {p++; cs = 3; goto _out;}
- } else {
- rb_ary_push(*result, v);
- {p = (( np))-1;}
- }
- }
- goto st3;
-st3:
- if ( ++p == pe )
- goto _test_eof3;
-case 3:
-#line 1079 "parser.c"
- switch( (*p) ) {
- case 13: goto st3;
- case 32: goto st3;
- case 44: goto st4;
- case 47: goto st9;
- case 93: goto tr4;
- }
- if ( 9 <= (*p) && (*p) <= 10 )
- goto st3;
- goto st0;
-st4:
- if ( ++p == pe )
- goto _test_eof4;
-case 4:
- switch( (*p) ) {
- case 13: goto st4;
- case 32: goto st4;
- case 34: goto tr2;
- case 45: goto tr2;
- case 47: goto st5;
- case 73: goto tr2;
- case 78: goto tr2;
- case 91: goto tr2;
- case 102: goto tr2;
- case 110: goto tr2;
- case 116: goto tr2;
- case 123: goto tr2;
- }
- if ( (*p) > 10 ) {
- if ( 48 <= (*p) && (*p) <= 57 )
- goto tr2;
- } else if ( (*p) >= 9 )
- goto st4;
- goto st0;
-st5:
- if ( ++p == pe )
- goto _test_eof5;
-case 5:
- switch( (*p) ) {
- case 42: goto st6;
- case 47: goto st8;
- }
- goto st0;
-st6:
- if ( ++p == pe )
- goto _test_eof6;
-case 6:
- if ( (*p) == 42 )
- goto st7;
- goto st6;
-st7:
- if ( ++p == pe )
- goto _test_eof7;
-case 7:
- switch( (*p) ) {
- case 42: goto st7;
- case 47: goto st4;
- }
- goto st6;
-st8:
- if ( ++p == pe )
- goto _test_eof8;
-case 8:
- if ( (*p) == 10 )
- goto st4;
- goto st8;
-st9:
- if ( ++p == pe )
- goto _test_eof9;
-case 9:
- switch( (*p) ) {
- case 42: goto st10;
- case 47: goto st12;
- }
- goto st0;
-st10:
- if ( ++p == pe )
- goto _test_eof10;
-case 10:
- if ( (*p) == 42 )
- goto st11;
- goto st10;
-st11:
- if ( ++p == pe )
- goto _test_eof11;
-case 11:
- switch( (*p) ) {
- case 42: goto st11;
- case 47: goto st3;
- }
- goto st10;
-st12:
- if ( ++p == pe )
- goto _test_eof12;
-case 12:
- if ( (*p) == 10 )
- goto st3;
- goto st12;
-tr4:
-#line 320 "parser.rl"
- { p--; {p++; cs = 17; goto _out;} }
- goto st17;
-st17:
- if ( ++p == pe )
- goto _test_eof17;
-case 17:
-#line 1186 "parser.c"
- goto st0;
-st13:
- if ( ++p == pe )
- goto _test_eof13;
-case 13:
- switch( (*p) ) {
- case 42: goto st14;
- case 47: goto st16;
- }
- goto st0;
-st14:
- if ( ++p == pe )
- goto _test_eof14;
-case 14:
- if ( (*p) == 42 )
- goto st15;
- goto st14;
-st15:
- if ( ++p == pe )
- goto _test_eof15;
-case 15:
- switch( (*p) ) {
- case 42: goto st15;
- case 47: goto st2;
- }
- goto st14;
-st16:
- if ( ++p == pe )
- goto _test_eof16;
-case 16:
- if ( (*p) == 10 )
- goto st2;
- goto st16;
- }
- _test_eof2: cs = 2; goto _test_eof;
- _test_eof3: cs = 3; goto _test_eof;
- _test_eof4: cs = 4; goto _test_eof;
- _test_eof5: cs = 5; goto _test_eof;
- _test_eof6: cs = 6; goto _test_eof;
- _test_eof7: cs = 7; goto _test_eof;
- _test_eof8: cs = 8; goto _test_eof;
- _test_eof9: cs = 9; goto _test_eof;
- _test_eof10: cs = 10; goto _test_eof;
- _test_eof11: cs = 11; goto _test_eof;
- _test_eof12: cs = 12; goto _test_eof;
- _test_eof17: cs = 17; goto _test_eof;
- _test_eof13: cs = 13; goto _test_eof;
- _test_eof14: cs = 14; goto _test_eof;
- _test_eof15: cs = 15; goto _test_eof;
- _test_eof16: cs = 16; goto _test_eof;
-
- _test_eof: {}
- _out: {}
- }
-
-#line 341 "parser.rl"
-
- if(cs >= JSON_array_first_final) {
- return p + 1;
- } else {
- rb_raise(eParserError, "%u: unexpected token at '%s'", __LINE__, p);
- }
-}
-
-static VALUE json_string_unescape(char *p, char *pe)
-{
- VALUE result = rb_str_buf_new(pe - p + 1);
-
- while (p < pe) {
- if (*p == '\\') {
- p++;
- if (p >= pe) return Qnil; /* raise an exception later, \ at end */
- switch (*p) {
- case '"':
- case '\\':
- rb_str_buf_cat(result, p, 1);
- p++;
- break;
- case 'b':
- rb_str_buf_cat2(result, "\b");
- p++;
- break;
- case 'f':
- rb_str_buf_cat2(result, "\f");
- p++;
- break;
- case 'n':
- rb_str_buf_cat2(result, "\n");
- p++;
- break;
- case 'r':
- rb_str_buf_cat2(result, "\r");
- p++;
- break;
- case 't':
- rb_str_buf_cat2(result, "\t");
- p++;
- break;
- case 'u':
- if (p > pe - 4) {
- return Qnil;
- } else {
- p = JSON_convert_UTF16_to_UTF8(result, p, pe, strictConversion);
- }
- break;
- default:
- rb_str_buf_cat(result, p, 1);
- p++;
- break;
- }
- } else {
- char *q = p;
- while (*q != '\\' && q < pe) q++;
- rb_str_buf_cat(result, p, q - p);
- p = q;
- }
- }
- return result;
-}
-
-
-#line 1308 "parser.c"
-static const int JSON_string_start = 1;
-static const int JSON_string_first_final = 8;
-static const int JSON_string_error = 0;
-
-static const int JSON_string_en_main = 1;
-
-
-#line 425 "parser.rl"
-
-
-static char *JSON_parse_string(JSON_Parser *json, char *p, char *pe, VALUE *result)
-{
- int cs = EVIL;
-
- *result = rb_str_new("", 0);
-
-#line 1325 "parser.c"
- {
- cs = JSON_string_start;
- }
-
-#line 433 "parser.rl"
- json->memo = p;
-
-#line 1333 "parser.c"
- {
- if ( p == pe )
- goto _test_eof;
- switch ( cs )
- {
-case 1:
- if ( (*p) == 34 )
- goto st2;
- goto st0;
-st0:
-cs = 0;
- goto _out;
-st2:
- if ( ++p == pe )
- goto _test_eof2;
-case 2:
- switch( (*p) ) {
- case 34: goto tr2;
- case 92: goto st3;
- }
- if ( 0 <= (*p) && (*p) <= 31 )
- goto st0;
- goto st2;
-tr2:
-#line 411 "parser.rl"
- {
- *result = json_string_unescape(json->memo + 1, p);
- if (NIL_P(*result)) {
- p--;
- {p++; cs = 8; goto _out;}
- } else {
- FORCE_UTF8(*result);
- {p = (( p + 1))-1;}
- }
- }
-#line 422 "parser.rl"
- { p--; {p++; cs = 8; goto _out;} }
- goto st8;
-st8:
- if ( ++p == pe )
- goto _test_eof8;
-case 8:
-#line 1376 "parser.c"
- goto st0;
-st3:
- if ( ++p == pe )
- goto _test_eof3;
-case 3:
- if ( (*p) == 117 )
- goto st4;
- if ( 0 <= (*p) && (*p) <= 31 )
- goto st0;
- goto st2;
-st4:
- if ( ++p == pe )
- goto _test_eof4;
-case 4:
- if ( (*p) < 65 ) {
- if ( 48 <= (*p) && (*p) <= 57 )
- goto st5;
- } else if ( (*p) > 70 ) {
- if ( 97 <= (*p) && (*p) <= 102 )
- goto st5;
- } else
- goto st5;
- goto st0;
-st5:
- if ( ++p == pe )
- goto _test_eof5;
-case 5:
- if ( (*p) < 65 ) {
- if ( 48 <= (*p) && (*p) <= 57 )
- goto st6;
- } else if ( (*p) > 70 ) {
- if ( 97 <= (*p) && (*p) <= 102 )
- goto st6;
- } else
- goto st6;
- goto st0;
-st6:
- if ( ++p == pe )
- goto _test_eof6;
-case 6:
- if ( (*p) < 65 ) {
- if ( 48 <= (*p) && (*p) <= 57 )
- goto st7;
- } else if ( (*p) > 70 ) {
- if ( 97 <= (*p) && (*p) <= 102 )
- goto st7;
- } else
- goto st7;
- goto st0;
-st7:
- if ( ++p == pe )
- goto _test_eof7;
-case 7:
- if ( (*p) < 65 ) {
- if ( 48 <= (*p) && (*p) <= 57 )
- goto st2;
- } else if ( (*p) > 70 ) {
- if ( 97 <= (*p) && (*p) <= 102 )
- goto st2;
- } else
- goto st2;
- goto st0;
- }
- _test_eof2: cs = 2; goto _test_eof;
- _test_eof8: cs = 8; goto _test_eof;
- _test_eof3: cs = 3; goto _test_eof;
- _test_eof4: cs = 4; goto _test_eof;
- _test_eof5: cs = 5; goto _test_eof;
- _test_eof6: cs = 6; goto _test_eof;
- _test_eof7: cs = 7; goto _test_eof;
-
- _test_eof: {}
- _out: {}
- }
-
-#line 435 "parser.rl"
-
- if (cs >= JSON_string_first_final) {
- return p + 1;
- } else {
- return NULL;
- }
-}
-
-
-
-#line 1463 "parser.c"
-static const int JSON_start = 1;
-static const int JSON_first_final = 10;
-static const int JSON_error = 0;
-
-static const int JSON_en_main = 1;
-
-
-#line 469 "parser.rl"
-
-
-/*
- * Document-class: JSON::Ext::Parser
- *
- * This is the JSON parser implemented as a C extension. It can be configured
- * to be used by setting
- *
- * JSON.parser = JSON::Ext::Parser
- *
- * with the method parser= in JSON.
- *
- */
-
-/*
- * call-seq: new(source, opts => {})
- *
- * Creates a new JSON::Ext::Parser instance for the string _source_.
- *
- * Creates a new JSON::Ext::Parser instance for the string _source_.
- *
- * It will be configured by the _opts_ hash. _opts_ can have the following
- * keys:
- *
- * _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|nil|0, it
- * defaults to 19.
- * * *allow_nan*: If set to true, allow NaN, Infinity and -Infinity in
- * defiance of RFC 4627 to be parsed by the Parser. This option defaults to
- * false.
- * * *create_additions*: If set to false, the Parser doesn't create
- * additions even if a matchin class and create_id was found. This option
- * defaults to true.
- */
-static VALUE cParser_initialize(int argc, VALUE *argv, VALUE self)
-{
- char *ptr;
- long len;
- VALUE source, opts;
- GET_STRUCT;
- rb_scan_args(argc, argv, "11", &source, &opts);
- source = StringValue(source);
- ptr = RSTRING_PTR(source);
- len = RSTRING_LEN(source);
- if (len < 2) {
- rb_raise(eParserError, "A JSON text must at least contain two octets!");
- }
- if (!NIL_P(opts)) {
- 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 {
- VALUE tmp = ID2SYM(i_max_nesting);
- if (st_lookup(RHASH_TBL(opts), tmp, 0)) {
- VALUE max_nesting = rb_hash_aref(opts, tmp);
- if (RTEST(max_nesting)) {
- Check_Type(max_nesting, T_FIXNUM);
- json->max_nesting = FIX2INT(max_nesting);
- } else {
- json->max_nesting = 0;
- }
- } else {
- json->max_nesting = 19;
- }
- tmp = ID2SYM(i_allow_nan);
- if (st_lookup(RHASH_TBL(opts), tmp, 0)) {
- VALUE allow_nan = rb_hash_aref(opts, tmp);
- json->allow_nan = RTEST(allow_nan) ? 1 : 0;
- } else {
- json->allow_nan = 0;
- }
- tmp = ID2SYM(i_create_additions);
- if (st_lookup(RHASH_TBL(opts), tmp, 0)) {
- VALUE create_additions = rb_hash_aref(opts, tmp);
- if (RTEST(create_additions)) {
- json->create_id = rb_funcall(mJSON, i_create_id, 0);
- } else {
- json->create_id = Qnil;
- }
- } else {
- json->create_id = rb_funcall(mJSON, i_create_id, 0);
- }
- }
- } else {
- json->max_nesting = 19;
- json->allow_nan = 0;
- json->create_id = rb_funcall(mJSON, i_create_id, 0);
- }
- json->current_nesting = 0;
- /*
- Convert these?
- if (len >= 4 && ptr[0] == 0 && ptr[1] == 0 && ptr[2] == 0) {
- rb_raise(eParserError, "Only UTF8 octet streams are supported atm!");
- } else if (len >= 4 && ptr[0] == 0 && ptr[2] == 0) {
- rb_raise(eParserError, "Only UTF8 octet streams are supported atm!");
- } else if (len >= 4 && ptr[1] == 0 && ptr[2] == 0 && ptr[3] == 0) {
- rb_raise(eParserError, "Only UTF8 octet streams are supported atm!");
- } else if (len >= 4 && ptr[1] == 0 && ptr[3] == 0) {
- rb_raise(eParserError, "Only UTF8 octet streams are supported atm!");
- }
- */
- json->len = len;
- json->source = ptr;
- json->Vsource = source;
- return self;
-}
-
-/*
- * call-seq: parse()
- *
- * Parses the current JSON text _source_ and returns the complete data
- * structure as a result.
- */
-static VALUE cParser_parse(VALUE self)
-{
- char *p, *pe;
- int cs = EVIL;
- VALUE result = Qnil;
- GET_STRUCT;
-
-
-#line 1594 "parser.c"
- {
- cs = JSON_start;
- }
-
-#line 591 "parser.rl"
- p = json->source;
- pe = p + json->len;
-
-#line 1603 "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 458 "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 451 "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 1680 "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 594 "parser.rl"
-
- if (cs >= JSON_first_final && p == pe) {
- return result;
- } else {
- rb_raise(eParserError, "%u: unexpected token at '%s'", __LINE__, p);
- }
-}
-
-inline static JSON_Parser *JSON_allocate()
-{
- JSON_Parser *json = ALLOC(JSON_Parser);
- MEMZERO(json, JSON_Parser, 1);
- return json;
-}
-
-static void JSON_mark(JSON_Parser *json)
-{
- rb_gc_mark_maybe(json->Vsource);
- rb_gc_mark_maybe(json->create_id);
-}
-
-static void JSON_free(JSON_Parser *json)
-{
- ruby_xfree(json);
-}
-
-static VALUE cJSON_parser_s_allocate(VALUE klass)
-{
- JSON_Parser *json = JSON_allocate();
- return Data_Wrap_Struct(klass, JSON_mark, JSON_free, json);
-}
-
-/*
- * call-seq: source()
- *
- * Returns a copy of the current _source_ string, that was used to construct
- * this Parser.
- */
-static VALUE cParser_source(VALUE self)
-{
- GET_STRUCT;
- return rb_str_dup(json->Vsource);
-}
-
-void Init_parser()
-{
- 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_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);
-
- CNaN = rb_const_get(mJSON, rb_intern("NaN"));
- CInfinity = rb_const_get(mJSON, rb_intern("Infinity"));
- CMinusInfinity = rb_const_get(mJSON, rb_intern("MinusInfinity"));
-
- i_json_creatable_p = rb_intern("json_creatable?");
- i_json_create = rb_intern("json_create");
- i_create_id = rb_intern("create_id");
- i_create_additions = rb_intern("create_additions");
- i_chr = rb_intern("chr");
- i_max_nesting = rb_intern("max_nesting");
- i_allow_nan = rb_intern("allow_nan");
-}
diff --git a/ext/json/ext/parser/parser.rl b/ext/json/ext/parser/parser.rl
deleted file mode 100644
index ca1876a7fc..0000000000
--- a/ext/json/ext/parser/parser.rl
+++ /dev/null
@@ -1,662 +0,0 @@
-#include "ruby.h"
-#include "unicode.h"
-#if HAVE_RE_H
-#include "re.h"
-#endif
-#if HAVE_RUBY_ST_H
-#include "ruby/st.h"
-#endif
-#if HAVE_ST_H
-#include "st.h"
-#endif
-
-#define EVIL 0x666
-
-#ifndef RHASH_TBL
-#define RHASH_TBL(hsh) (RHASH(hsh)->tbl)
-#endif
-
-#ifdef HAVE_RUBY_ENCODING_H
-#include "ruby/encoding.h"
-#define FORCE_UTF8(obj) rb_enc_associate((obj), rb_utf8_encoding())
-#else
-#define FORCE_UTF8(obj)
-#endif
-
-static VALUE mJSON, mExt, cParser, eParserError, eNestingError;
-static VALUE CNaN, CInfinity, CMinusInfinity;
-
-static ID i_json_creatable_p, i_json_create, i_create_id, i_create_additions,
- i_chr, i_max_nesting, i_allow_nan;
-
-#define MinusInfinity "-Infinity"
-
-typedef struct JSON_ParserStruct {
- VALUE Vsource;
- char *source;
- long len;
- char *memo;
- VALUE create_id;
- int max_nesting;
- int current_nesting;
- int allow_nan;
-} JSON_Parser;
-
-static char *JSON_parse_object(JSON_Parser *json, char *p, char *pe, VALUE *result);
-static char *JSON_parse_array(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_string(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);
-
-#define GET_STRUCT \
- JSON_Parser *json; \
- Data_Get_Struct(self, JSON_Parser, json);
-
-%%{
- machine JSON_common;
-
- cr = '\n';
- cr_neg = [^\n];
- ws = [ \t\r\n];
- c_comment = '/*' ( any* - (any* '*/' any* ) ) '*/';
- cpp_comment = '//' cr_neg* cr;
- comment = c_comment | cpp_comment;
- ignore = ws | comment;
- name_separator = ':';
- value_separator = ',';
- Vnull = 'null';
- Vfalse = 'false';
- Vtrue = 'true';
- VNaN = 'NaN';
- VInfinity = 'Infinity';
- VMinusInfinity = '-Infinity';
- begin_value = [nft"\-[{NI] | digit;
- begin_object = '{';
- end_object = '}';
- begin_array = '[';
- end_array = ']';
- begin_string = '"';
- begin_name = begin_string;
- begin_number = digit | '-';
-}%%
-
-%%{
- machine JSON_object;
- include JSON_common;
-
- write data;
-
- action parse_value {
- VALUE v = Qnil;
- char *np = JSON_parse_value(json, fpc, pe, &v);
- if (np == NULL) {
- fhold; fbreak;
- } else {
- rb_hash_aset(*result, last_name, v);
- fexec np;
- }
- }
-
- action parse_name {
- char *np = JSON_parse_string(json, fpc, pe, &last_name);
- if (np == NULL) { fhold; fbreak; } else fexec np;
- }
-
- action exit { fhold; fbreak; }
-
- a_pair = ignore* begin_name >parse_name
- ignore* name_separator ignore*
- begin_value >parse_value;
-
- main := begin_object
- (a_pair (ignore* value_separator a_pair)*)?
- ignore* end_object @exit;
-}%%
-
-static char *JSON_parse_object(JSON_Parser *json, char *p, char *pe, VALUE *result)
-{
- int cs = EVIL;
- VALUE last_name = Qnil;
-
- if (json->max_nesting && json->current_nesting > json->max_nesting) {
- rb_raise(eNestingError, "nesting of %d is to deep", json->current_nesting);
- }
-
- *result = rb_hash_new();
-
- %% write init;
- %% write exec;
-
- if (cs >= JSON_object_first_final) {
- if (RTEST(json->create_id)) {
- VALUE klassname = rb_hash_aref(*result, json->create_id);
- if (!NIL_P(klassname)) {
- VALUE klass = rb_path2class(StringValueCStr(klassname));
- if RTEST(rb_funcall(klass, i_json_creatable_p, 0)) {
- *result = rb_funcall(klass, i_json_create, 1, *result);
- }
- }
- }
- return p + 1;
- } else {
- return NULL;
- }
-}
-
-%%{
- machine JSON_value;
- include JSON_common;
-
- write data;
-
- action parse_null {
- *result = Qnil;
- }
- action parse_false {
- *result = Qfalse;
- }
- action parse_true {
- *result = Qtrue;
- }
- action parse_nan {
- if (json->allow_nan) {
- *result = CNaN;
- } else {
- rb_raise(eParserError, "%u: unexpected token at '%s'", __LINE__, p - 2);
- }
- }
- action parse_infinity {
- if (json->allow_nan) {
- *result = CInfinity;
- } else {
- rb_raise(eParserError, "%u: unexpected token at '%s'", __LINE__, p - 8);
- }
- }
- action parse_string {
- char *np = JSON_parse_string(json, fpc, pe, result);
- if (np == NULL) { fhold; fbreak; } else fexec np;
- }
-
- action parse_number {
- char *np;
- if(pe > fpc + 9 && !strncmp(MinusInfinity, fpc, 9)) {
- if (json->allow_nan) {
- *result = CMinusInfinity;
- fexec p + 10;
- fhold; fbreak;
- } else {
- rb_raise(eParserError, "%u: unexpected token at '%s'", __LINE__, p);
- }
- }
- np = JSON_parse_float(json, fpc, pe, result);
- if (np != NULL) fexec np;
- np = JSON_parse_integer(json, fpc, pe, result);
- if (np != NULL) fexec np;
- fhold; fbreak;
- }
-
- action parse_array {
- char *np;
- 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;
- 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 := (
- Vnull @parse_null |
- Vfalse @parse_false |
- Vtrue @parse_true |
- VNaN @parse_nan |
- VInfinity @parse_infinity |
- begin_number >parse_number |
- begin_string >parse_string |
- begin_array >parse_array |
- begin_object >parse_object
- ) %*exit;
-}%%
-
-static char *JSON_parse_value(JSON_Parser *json, char *p, char *pe, VALUE *result)
-{
- int cs = EVIL;
-
- %% write init;
- %% write exec;
-
- if (cs >= JSON_value_first_final) {
- return p;
- } else {
- return NULL;
- }
-}
-
-%%{
- machine JSON_integer;
-
- write data;
-
- action exit { fhold; fbreak; }
-
- main := '-'? ('0' | [1-9][0-9]*) (^[0-9] @exit);
-}%%
-
-static char *JSON_parse_integer(JSON_Parser *json, char *p, char *pe, VALUE *result)
-{
- int cs = EVIL;
-
- %% write init;
- json->memo = p;
- %% write exec;
-
- if (cs >= JSON_integer_first_final) {
- long len = p - json->memo;
- *result = rb_Integer(rb_str_new(json->memo, len));
- return p + 1;
- } else {
- return NULL;
- }
-}
-
-%%{
- machine JSON_float;
- include JSON_common;
-
- write data;
-
- action exit { fhold; fbreak; }
-
- main := '-'? (
- (('0' | [1-9][0-9]*) '.' [0-9]+ ([Ee] [+\-]?[0-9]+)?)
- | (('0' | [1-9][0-9]*) ([Ee] [+\-]?[0-9]+))
- ) (^[0-9Ee.\-] @exit );
-}%%
-
-static char *JSON_parse_float(JSON_Parser *json, char *p, char *pe, VALUE *result)
-{
- int cs = EVIL;
-
- %% write init;
- json->memo = p;
- %% write exec;
-
- if (cs >= JSON_float_first_final) {
- long len = p - json->memo;
- *result = rb_Float(rb_str_new(json->memo, len));
- return p + 1;
- } else {
- return NULL;
- }
-}
-
-
-%%{
- machine JSON_array;
- include JSON_common;
-
- write data;
-
- action parse_value {
- VALUE v = Qnil;
- char *np = JSON_parse_value(json, fpc, pe, &v);
- if (np == NULL) {
- fhold; fbreak;
- } else {
- rb_ary_push(*result, v);
- fexec np;
- }
- }
-
- action exit { fhold; fbreak; }
-
- next_element = value_separator ignore* begin_value >parse_value;
-
- main := begin_array ignore*
- ((begin_value >parse_value ignore*)
- (ignore* next_element ignore*)*)?
- end_array @exit;
-}%%
-
-static char *JSON_parse_array(JSON_Parser *json, char *p, char *pe, VALUE *result)
-{
- int cs = EVIL;
-
- if (json->max_nesting && json->current_nesting > json->max_nesting) {
- rb_raise(eNestingError, "nesting of %d is to deep", json->current_nesting);
- }
- *result = rb_ary_new();
-
- %% write init;
- %% write exec;
-
- if(cs >= JSON_array_first_final) {
- return p + 1;
- } else {
- rb_raise(eParserError, "%u: unexpected token at '%s'", __LINE__, p);
- }
-}
-
-static VALUE json_string_unescape(char *p, char *pe)
-{
- VALUE result = rb_str_buf_new(pe - p + 1);
-
- while (p < pe) {
- if (*p == '\\') {
- p++;
- if (p >= pe) return Qnil; /* raise an exception later, \ at end */
- switch (*p) {
- case '"':
- case '\\':
- rb_str_buf_cat(result, p, 1);
- p++;
- break;
- case 'b':
- rb_str_buf_cat2(result, "\b");
- p++;
- break;
- case 'f':
- rb_str_buf_cat2(result, "\f");
- p++;
- break;
- case 'n':
- rb_str_buf_cat2(result, "\n");
- p++;
- break;
- case 'r':
- rb_str_buf_cat2(result, "\r");
- p++;
- break;
- case 't':
- rb_str_buf_cat2(result, "\t");
- p++;
- break;
- case 'u':
- if (p > pe - 4) {
- return Qnil;
- } else {
- p = JSON_convert_UTF16_to_UTF8(result, p, pe, strictConversion);
- }
- break;
- default:
- rb_str_buf_cat(result, p, 1);
- p++;
- break;
- }
- } else {
- char *q = p;
- while (*q != '\\' && q < pe) q++;
- rb_str_buf_cat(result, p, q - p);
- p = q;
- }
- }
- return result;
-}
-
-%%{
- machine JSON_string;
- include JSON_common;
-
- write data;
-
- action parse_string {
- *result = json_string_unescape(json->memo + 1, p);
- if (NIL_P(*result)) {
- fhold;
- fbreak;
- } else {
- FORCE_UTF8(*result);
- fexec p + 1;
- }
- }
-
- action exit { fhold; fbreak; }
-
- main := '"' ((^(["\\] | 0..0x1f) | '\\'["\\/bfnrt] | '\\u'[0-9a-fA-F]{4} | '\\'^(["\\/bfnrtu]|0..0x1f))* %parse_string) '"' @exit;
-}%%
-
-static char *JSON_parse_string(JSON_Parser *json, char *p, char *pe, VALUE *result)
-{
- int cs = EVIL;
-
- *result = rb_str_new("", 0);
- %% write init;
- json->memo = p;
- %% write exec;
-
- if (cs >= JSON_string_first_final) {
- return p + 1;
- } else {
- return NULL;
- }
-}
-
-
-%%{
- machine JSON;
-
- write data;
-
- include JSON_common;
-
- action parse_object {
- char *np;
- json->current_nesting = 1;
- np = JSON_parse_object(json, fpc, pe, &result);
- if (np == NULL) { fhold; fbreak; } else fexec np;
- }
-
- action parse_array {
- char *np;
- json->current_nesting = 1;
- np = JSON_parse_array(json, fpc, pe, &result);
- if (np == NULL) { fhold; fbreak; } else fexec np;
- }
-
- main := ignore* (
- begin_object >parse_object |
- begin_array >parse_array
- ) ignore*;
-}%%
-
-/*
- * Document-class: JSON::Ext::Parser
- *
- * This is the JSON parser implemented as a C extension. It can be configured
- * to be used by setting
- *
- * JSON.parser = JSON::Ext::Parser
- *
- * with the method parser= in JSON.
- *
- */
-
-/*
- * call-seq: new(source, opts => {})
- *
- * Creates a new JSON::Ext::Parser instance for the string _source_.
- *
- * Creates a new JSON::Ext::Parser instance for the string _source_.
- *
- * It will be configured by the _opts_ hash. _opts_ can have the following
- * keys:
- *
- * _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|nil|0, it
- * defaults to 19.
- * * *allow_nan*: If set to true, allow NaN, Infinity and -Infinity in
- * defiance of RFC 4627 to be parsed by the Parser. This option defaults to
- * false.
- * * *create_additions*: If set to false, the Parser doesn't create
- * additions even if a matchin class and create_id was found. This option
- * defaults to true.
- */
-static VALUE cParser_initialize(int argc, VALUE *argv, VALUE self)
-{
- char *ptr;
- long len;
- VALUE source, opts;
- GET_STRUCT;
- rb_scan_args(argc, argv, "11", &source, &opts);
- source = StringValue(source);
- ptr = RSTRING_PTR(source);
- len = RSTRING_LEN(source);
- if (len < 2) {
- rb_raise(eParserError, "A JSON text must at least contain two octets!");
- }
- if (!NIL_P(opts)) {
- 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 {
- VALUE tmp = ID2SYM(i_max_nesting);
- if (st_lookup(RHASH_TBL(opts), tmp, 0)) {
- VALUE max_nesting = rb_hash_aref(opts, tmp);
- if (RTEST(max_nesting)) {
- Check_Type(max_nesting, T_FIXNUM);
- json->max_nesting = FIX2INT(max_nesting);
- } else {
- json->max_nesting = 0;
- }
- } else {
- json->max_nesting = 19;
- }
- tmp = ID2SYM(i_allow_nan);
- if (st_lookup(RHASH_TBL(opts), tmp, 0)) {
- VALUE allow_nan = rb_hash_aref(opts, tmp);
- json->allow_nan = RTEST(allow_nan) ? 1 : 0;
- } else {
- json->allow_nan = 0;
- }
- tmp = ID2SYM(i_create_additions);
- if (st_lookup(RHASH_TBL(opts), tmp, 0)) {
- VALUE create_additions = rb_hash_aref(opts, tmp);
- if (RTEST(create_additions)) {
- json->create_id = rb_funcall(mJSON, i_create_id, 0);
- } else {
- json->create_id = Qnil;
- }
- } else {
- json->create_id = rb_funcall(mJSON, i_create_id, 0);
- }
- }
- } else {
- json->max_nesting = 19;
- json->allow_nan = 0;
- json->create_id = rb_funcall(mJSON, i_create_id, 0);
- }
- json->current_nesting = 0;
- /*
- Convert these?
- if (len >= 4 && ptr[0] == 0 && ptr[1] == 0 && ptr[2] == 0) {
- rb_raise(eParserError, "Only UTF8 octet streams are supported atm!");
- } else if (len >= 4 && ptr[0] == 0 && ptr[2] == 0) {
- rb_raise(eParserError, "Only UTF8 octet streams are supported atm!");
- } else if (len >= 4 && ptr[1] == 0 && ptr[2] == 0 && ptr[3] == 0) {
- rb_raise(eParserError, "Only UTF8 octet streams are supported atm!");
- } else if (len >= 4 && ptr[1] == 0 && ptr[3] == 0) {
- rb_raise(eParserError, "Only UTF8 octet streams are supported atm!");
- }
- */
- json->len = len;
- json->source = ptr;
- json->Vsource = source;
- return self;
-}
-
-/*
- * call-seq: parse()
- *
- * Parses the current JSON text _source_ and returns the complete data
- * structure as a result.
- */
-static VALUE cParser_parse(VALUE self)
-{
- char *p, *pe;
- int cs = EVIL;
- VALUE result = Qnil;
- GET_STRUCT;
-
- %% write init;
- p = json->source;
- pe = p + json->len;
- %% write exec;
-
- if (cs >= JSON_first_final && p == pe) {
- return result;
- } else {
- rb_raise(eParserError, "%u: unexpected token at '%s'", __LINE__, p);
- }
-}
-
-inline static JSON_Parser *JSON_allocate()
-{
- JSON_Parser *json = ALLOC(JSON_Parser);
- MEMZERO(json, JSON_Parser, 1);
- return json;
-}
-
-static void JSON_mark(JSON_Parser *json)
-{
- rb_gc_mark_maybe(json->Vsource);
- rb_gc_mark_maybe(json->create_id);
-}
-
-static void JSON_free(JSON_Parser *json)
-{
- ruby_xfree(json);
-}
-
-static VALUE cJSON_parser_s_allocate(VALUE klass)
-{
- JSON_Parser *json = JSON_allocate();
- return Data_Wrap_Struct(klass, JSON_mark, JSON_free, json);
-}
-
-/*
- * call-seq: source()
- *
- * Returns a copy of the current _source_ string, that was used to construct
- * this Parser.
- */
-static VALUE cParser_source(VALUE self)
-{
- GET_STRUCT;
- return rb_str_dup(json->Vsource);
-}
-
-void Init_parser()
-{
- 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_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);
-
- CNaN = rb_const_get(mJSON, rb_intern("NaN"));
- CInfinity = rb_const_get(mJSON, rb_intern("Infinity"));
- CMinusInfinity = rb_const_get(mJSON, rb_intern("MinusInfinity"));
-
- i_json_creatable_p = rb_intern("json_creatable?");
- i_json_create = rb_intern("json_create");
- i_create_id = rb_intern("create_id");
- i_create_additions = rb_intern("create_additions");
- i_chr = rb_intern("chr");
- i_max_nesting = rb_intern("max_nesting");
- i_allow_nan = rb_intern("allow_nan");
-}
diff --git a/ext/json/ext/parser/unicode.c b/ext/json/ext/parser/unicode.c
deleted file mode 100644
index b2f1e58676..0000000000
--- a/ext/json/ext/parser/unicode.c
+++ /dev/null
@@ -1,154 +0,0 @@
-#include "unicode.h"
-
-/*
- * 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.
- */
-
-/*
- * Index into the table below with the first byte of a UTF-8 sequence to
- * get the number of trailing bytes that are supposed to follow it.
- * Note that *legal* UTF-8 values can't have 4 or 5-bytes. The table is
- * left as-is for anyone who may want to do such conversion, which was
- * allowed in earlier algorithms.
- */
-static const char trailingBytesForUTF8[256] = {
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
- 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, 3,3,3,3,3,3,3,3,4,4,4,4,5,5,5,5
-};
-
-/*
- * Magic values subtracted from a buffer value during UTF8 conversion.
- * This table contains as many values as there might be trailing bytes
- * in a UTF-8 sequence.
- */
-static const UTF32 offsetsFromUTF8[6] = { 0x00000000UL, 0x00003080UL, 0x000E2080UL,
- 0x03C82080UL, 0xFA082080UL, 0x82082080UL };
-
-/*
- * Once the bits are split out into bytes of UTF-8, this is a mask OR-ed
- * into the first byte, depending on how many bytes follow. There are
- * as many entries in this table as there are UTF-8 sequence types.
- * (I.e., one byte sequence, two byte... etc.). Remember that sequencs
- * for *legal* UTF-8 will be 4 or fewer bytes total.
- */
-static const UTF8 firstByteMark[7] = { 0x00, 0x00, 0xC0, 0xE0, 0xF0, 0xF8, 0xFC };
-
-char *JSON_convert_UTF16_to_UTF8 (
- VALUE buffer,
- char *source,
- char *sourceEnd,
- ConversionFlags flags)
-{
- UTF16 *tmp, *tmpPtr, *tmpEnd;
- char buf[5];
- long n = 0, i;
- char *p = source - 1;
-
- while (p < sourceEnd && p[0] == '\\' && p[1] == 'u') {
- p += 6;
- n++;
- }
- p = source + 1;
- buf[4] = 0;
- tmpPtr = tmp = ALLOC_N(UTF16, n);
- tmpEnd = tmp + n;
- for (i = 0; i < n; i++) {
- buf[0] = *p++;
- buf[1] = *p++;
- buf[2] = *p++;
- buf[3] = *p++;
- tmpPtr[i] = strtol(buf, NULL, 16);
- p += 2;
- }
-
- while (tmpPtr < tmpEnd) {
- UTF32 ch;
- unsigned short bytesToWrite = 0;
- const UTF32 byteMask = 0xBF;
- const UTF32 byteMark = 0x80;
- ch = *tmpPtr++;
- /* If we have a surrogate pair, convert to UTF32 first. */
- if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_HIGH_END) {
- /* If the 16 bits following the high surrogate are in the source
- * buffer... */
- if (tmpPtr < tmpEnd) {
- UTF32 ch2 = *tmpPtr;
- /* If it's a low surrogate, convert to UTF32. */
- if (ch2 >= UNI_SUR_LOW_START && ch2 <= UNI_SUR_LOW_END) {
- ch = ((ch - UNI_SUR_HIGH_START) << halfShift)
- + (ch2 - UNI_SUR_LOW_START) + halfBase;
- ++tmpPtr;
- } else if (flags == strictConversion) { /* it's an unpaired high surrogate */
- ruby_xfree(tmp);
- rb_raise(rb_path2class("JSON::ParserError"),
- "source sequence is illegal/malformed near %s", source);
- }
- } else { /* We don't have the 16 bits following the high surrogate. */
- ruby_xfree(tmp);
- rb_raise(rb_path2class("JSON::ParserError"),
- "partial character in source, but hit end near %s", source);
- break;
- }
- } else if (flags == strictConversion) {
- /* UTF-16 surrogate values are illegal in UTF-32 */
- if (ch >= UNI_SUR_LOW_START && ch <= UNI_SUR_LOW_END) {
- ruby_xfree(tmp);
- rb_raise(rb_path2class("JSON::ParserError"),
- "source sequence is illegal/malformed near %s", source);
- }
- }
- /* Figure out how many bytes the result will require */
- if (ch < (UTF32) 0x80) {
- bytesToWrite = 1;
- } else if (ch < (UTF32) 0x800) {
- bytesToWrite = 2;
- } else if (ch < (UTF32) 0x10000) {
- bytesToWrite = 3;
- } else if (ch < (UTF32) 0x110000) {
- bytesToWrite = 4;
- } else {
- bytesToWrite = 3;
- ch = UNI_REPLACEMENT_CHAR;
- }
-
- buf[0] = 0;
- buf[1] = 0;
- buf[2] = 0;
- buf[3] = 0;
- p = buf + bytesToWrite;
- switch (bytesToWrite) { /* note: everything falls through. */
- case 4: *--p = (UTF8) ((ch | byteMark) & byteMask); ch >>= 6;
- case 3: *--p = (UTF8) ((ch | byteMark) & byteMask); ch >>= 6;
- case 2: *--p = (UTF8) ((ch | byteMark) & byteMask); ch >>= 6;
- case 1: *--p = (UTF8) (ch | firstByteMark[bytesToWrite]);
- }
- rb_str_buf_cat(buffer, p, bytesToWrite);
- }
- ruby_xfree(tmp);
- source += 5 + (n - 1) * 6;
- return source;
-}
diff --git a/ext/json/ext/parser/unicode.h b/ext/json/ext/parser/unicode.h
deleted file mode 100644
index 155da0ceee..0000000000
--- a/ext/json/ext/parser/unicode.h
+++ /dev/null
@@ -1,58 +0,0 @@
-
-#ifndef _PARSER_UNICODE_H_
-#define _PARSER_UNICODE_H_
-
-#include "ruby.h"
-
-typedef unsigned long UTF32; /* at least 32 bits */
-typedef unsigned short UTF16; /* at least 16 bits */
-typedef unsigned char UTF8; /* typically 8 bits */
-
-#define UNI_REPLACEMENT_CHAR (UTF32)0x0000FFFD
-#define UNI_MAX_BMP (UTF32)0x0000FFFF
-#define UNI_MAX_UTF16 (UTF32)0x0010FFFF
-#define UNI_MAX_UTF32 (UTF32)0x7FFFFFFF
-#define UNI_MAX_LEGAL_UTF32 (UTF32)0x0010FFFF
-
-#define UNI_SUR_HIGH_START (UTF32)0xD800
-#define UNI_SUR_HIGH_END (UTF32)0xDBFF
-#define UNI_SUR_LOW_START (UTF32)0xDC00
-#define UNI_SUR_LOW_END (UTF32)0xDFFF
-
-static const int halfShift = 10; /* used for shifting by 10 bits */
-
-static const UTF32 halfBase = 0x0010000UL;
-static const UTF32 halfMask = 0x3FFUL;
-
-typedef enum {
- conversionOK = 0, /* conversion successful */
- sourceExhausted, /* partial character in source, but hit end */
- targetExhausted, /* insuff. room in target for conversion */
- sourceIllegal /* source sequence is illegal/malformed */
-} ConversionResult;
-
-typedef enum {
- strictConversion = 0,
- lenientConversion
-} ConversionFlags;
-
-char *JSON_convert_UTF16_to_UTF8 (
- VALUE buffer,
- char *source,
- char *sourceEnd,
- ConversionFlags flags);
-
-#ifndef RARRAY_PTR
-#define RARRAY_PTR(ARRAY) RARRAY(ARRAY)->ptr
-#endif
-#ifndef RARRAY_LEN
-#define RARRAY_LEN(ARRAY) RARRAY(ARRAY)->len
-#endif
-#ifndef RSTRING_PTR
-#define RSTRING_PTR(string) RSTRING(string)->ptr
-#endif
-#ifndef RSTRING_LEN
-#define RSTRING_LEN(string) RSTRING(string)->len
-#endif
-
-#endif
diff --git a/ext/json/extconf.rb b/ext/json/extconf.rb
deleted file mode 100644
index 850798c643..0000000000
--- a/ext/json/extconf.rb
+++ /dev/null
@@ -1,3 +0,0 @@
-require 'mkmf'
-create_makefile('json')
-
diff --git a/ext/json/lib/json.rb b/ext/json/lib/json.rb
deleted file mode 100755
index 35fab1e11d..0000000000
--- a/ext/json/lib/json.rb
+++ /dev/null
@@ -1,297 +0,0 @@
-require 'json/common'
-# = json - JSON for Ruby
-#
-# == Description
-#
-# This is a implementation of the JSON specification according to RFC 4627
-# (http://www.ietf.org/rfc/rfc4627.txt). Starting from version 1.0.0 on there
-# will be two variants available:
-#
-# * A pure ruby variant, that relies on the iconv and the stringscan
-# extensions, which are both part of the ruby standard library.
-# * The quite a bit faster C extension variant, which is in parts implemented
-# in C and comes with its own unicode conversion functions and a parser
-# generated by the ragel state machine compiler
-# (http://www.cs.queensu.ca/~thurston/ragel).
-#
-# Both variants of the JSON generator escape all non-ASCII an control
-# characters with \uXXXX escape sequences, and support UTF-16 surrogate pairs
-# in order to be able to generate the whole range of unicode code points. This
-# means that generated JSON text is encoded as UTF-8 (because ASCII is a subset
-# of UTF-8) and at the same time avoids decoding problems for receiving
-# endpoints, that don't expect UTF-8 encoded texts. On the negative side this
-# may lead to a bit longer strings than necessarry.
-#
-# All strings, that are to be encoded as JSON strings, should be UTF-8 byte
-# sequences on the Ruby side. To encode raw binary strings, that aren't UTF-8
-# encoded, please use the to_json_raw_object method of String (which produces
-# an object, that contains a byte array) and decode the result on the receiving
-# endpoint.
-#
-# == Author
-#
-# Florian Frank <mailto:flori@ping.de>
-#
-# == License
-#
-# This software is distributed under the same license as Ruby itself, see
-# http://www.ruby-lang.org/en/LICENSE.txt.
-#
-# == Download
-#
-# The latest version of this library can be downloaded at
-#
-# * http://rubyforge.org/frs?group_id=953
-#
-# Online Documentation should be located at
-#
-# * http://json.rubyforge.org
-#
-# == Usage
-#
-# To use JSON you can
-# require 'json'
-# to load the installed variant (either the extension 'json' or the pure
-# variant 'json_pure'). If you have installed the extension variant, you can
-# pick either the extension variant or the pure variant by typing
-# require 'json/ext'
-# or
-# require 'json/pure'
-#
-# You can choose to load a set of common additions to ruby core's objects if
-# you
-# require 'json/add/core'
-#
-# After requiring this you can, e. g., serialise/deserialise Ruby ranges:
-#
-# JSON JSON(1..10) # => 1..10
-#
-# To find out how to add JSON support to other or your own classes, read the
-# Examples section below.
-#
-# To get the best compatibility to rails' JSON implementation, you can
-# require 'json/add/rails'
-#
-# Both of the additions attempt to require 'json' (like above) first, if it has
-# not been required yet.
-#
-# == Speed Comparisons
-#
-# I have created some benchmark results (see the benchmarks/data-p4-3Ghz
-# subdir of the package) for the JSON-parser to estimate the speed up in the C
-# extension:
-#
-# Comparing times (call_time_mean):
-# 1 ParserBenchmarkExt#parser 900 repeats:
-# 553.922304770 ( real) -> 21.500x
-# 0.001805307
-# 2 ParserBenchmarkYAML#parser 1000 repeats:
-# 224.513358139 ( real) -> 8.714x
-# 0.004454078
-# 3 ParserBenchmarkPure#parser 1000 repeats:
-# 26.755020642 ( real) -> 1.038x
-# 0.037376163
-# 4 ParserBenchmarkRails#parser 1000 repeats:
-# 25.763381731 ( real) -> 1.000x
-# 0.038814780
-# calls/sec ( time) -> speed covers
-# secs/call
-#
-# In the table above 1 is JSON::Ext::Parser, 2 is YAML.load with YAML
-# compatbile JSON document, 3 is is JSON::Pure::Parser, and 4 is
-# ActiveSupport::JSON.decode. The ActiveSupport JSON-decoder converts the
-# input first to YAML and then uses the YAML-parser, the conversion seems to
-# slow it down so much that it is only as fast as the JSON::Pure::Parser!
-#
-# If you look at the benchmark data you can see that this is mostly caused by
-# the frequent high outliers - the median of the Rails-parser runs is still
-# overall smaller than the median of the JSON::Pure::Parser runs:
-#
-# Comparing times (call_time_median):
-# 1 ParserBenchmarkExt#parser 900 repeats:
-# 800.592479481 ( real) -> 26.936x
-# 0.001249075
-# 2 ParserBenchmarkYAML#parser 1000 repeats:
-# 271.002390644 ( real) -> 9.118x
-# 0.003690004
-# 3 ParserBenchmarkRails#parser 1000 repeats:
-# 30.227910865 ( real) -> 1.017x
-# 0.033082008
-# 4 ParserBenchmarkPure#parser 1000 repeats:
-# 29.722384421 ( real) -> 1.000x
-# 0.033644676
-# calls/sec ( time) -> speed covers
-# secs/call
-#
-# I have benchmarked the JSON-Generator as well. This generated a few more
-# values, because there are different modes that also influence the achieved
-# speed:
-#
-# Comparing times (call_time_mean):
-# 1 GeneratorBenchmarkExt#generator_fast 1000 repeats:
-# 547.354332608 ( real) -> 15.090x
-# 0.001826970
-# 2 GeneratorBenchmarkExt#generator_safe 1000 repeats:
-# 443.968212317 ( real) -> 12.240x
-# 0.002252414
-# 3 GeneratorBenchmarkExt#generator_pretty 900 repeats:
-# 375.104545883 ( real) -> 10.341x
-# 0.002665923
-# 4 GeneratorBenchmarkPure#generator_fast 1000 repeats:
-# 49.978706968 ( real) -> 1.378x
-# 0.020008521
-# 5 GeneratorBenchmarkRails#generator 1000 repeats:
-# 38.531868759 ( real) -> 1.062x
-# 0.025952543
-# 6 GeneratorBenchmarkPure#generator_safe 1000 repeats:
-# 36.927649925 ( real) -> 1.018x 7 (>=3859)
-# 0.027079979
-# 7 GeneratorBenchmarkPure#generator_pretty 1000 repeats:
-# 36.272134441 ( real) -> 1.000x 6 (>=3859)
-# 0.027569373
-# calls/sec ( time) -> speed covers
-# secs/call
-#
-# In the table above 1-3 are JSON::Ext::Generator methods. 4, 6, and 7 are
-# JSON::Pure::Generator methods and 5 is the Rails JSON generator. It is now a
-# bit faster than the generator_safe and generator_pretty methods of the pure
-# variant but slower than the others.
-#
-# To achieve the fastest JSON text output, you can use the fast_generate
-# method. Beware, that this will disable the checking for circular Ruby data
-# structures, which may cause JSON to go into an infinite loop.
-#
-# Here are the median comparisons for completeness' sake:
-#
-# Comparing times (call_time_median):
-# 1 GeneratorBenchmarkExt#generator_fast 1000 repeats:
-# 708.258020939 ( real) -> 16.547x
-# 0.001411915
-# 2 GeneratorBenchmarkExt#generator_safe 1000 repeats:
-# 569.105020353 ( real) -> 13.296x
-# 0.001757145
-# 3 GeneratorBenchmarkExt#generator_pretty 900 repeats:
-# 482.825371244 ( real) -> 11.280x
-# 0.002071142
-# 4 GeneratorBenchmarkPure#generator_fast 1000 repeats:
-# 62.717626652 ( real) -> 1.465x
-# 0.015944481
-# 5 GeneratorBenchmarkRails#generator 1000 repeats:
-# 43.965681162 ( real) -> 1.027x
-# 0.022745013
-# 6 GeneratorBenchmarkPure#generator_safe 1000 repeats:
-# 43.929073409 ( real) -> 1.026x 7 (>=3859)
-# 0.022763968
-# 7 GeneratorBenchmarkPure#generator_pretty 1000 repeats:
-# 42.802514491 ( real) -> 1.000x 6 (>=3859)
-# 0.023363113
-# calls/sec ( time) -> speed covers
-# secs/call
-#
-# == Examples
-#
-# To create a JSON text from a ruby data structure, you can call JSON.generate
-# like that:
-#
-# json = JSON.generate [1, 2, {"a"=>3.141}, false, true, nil, 4..10]
-# # => "[1,2,{\"a\":3.141},false,true,null,\"4..10\"]"
-#
-# To create a valid JSON text you have to make sure, that the output is
-# embedded in either a JSON array [] or a JSON object {}. The easiest way to do
-# this, is by putting your values in a Ruby Array or Hash instance.
-#
-# To get back a ruby data structure from a JSON text, you have to call
-# JSON.parse on it:
-#
-# JSON.parse json
-# # => [1, 2, {"a"=>3.141}, false, true, nil, "4..10"]
-#
-# Note, that the range from the original data structure is a simple
-# string now. The reason for this is, that JSON doesn't support ranges
-# or arbitrary classes. In this case the json library falls back to call
-# Object#to_json, which is the same as #to_s.to_json.
-#
-# It's possible to add JSON support serialization to arbitrary classes by
-# simply implementing a more specialized version of the #to_json method, that
-# should return a JSON object (a hash converted to JSON with #to_json) like
-# this (don't forget the *a for all the arguments):
-#
-# class Range
-# def to_json(*a)
-# {
-# 'json_class' => self.class.name, # = 'Range'
-# 'data' => [ first, last, exclude_end? ]
-# }.to_json(*a)
-# end
-# end
-#
-# The hash key 'json_class' is the class, that will be asked to deserialise the
-# JSON representation later. In this case it's 'Range', but any namespace of
-# the form 'A::B' or '::A::B' will do. All other keys are arbitrary and can be
-# used to store the necessary data to configure the object to be deserialised.
-#
-# If a the key 'json_class' is found in a JSON object, the JSON parser checks
-# if the given class responds to the json_create class method. If so, it is
-# called with the JSON object converted to a Ruby hash. So a range can
-# be deserialised by implementing Range.json_create like this:
-#
-# class Range
-# def self.json_create(o)
-# new(*o['data'])
-# end
-# end
-#
-# Now it possible to serialise/deserialise ranges as well:
-#
-# json = JSON.generate [1, 2, {"a"=>3.141}, false, true, nil, 4..10]
-# # => "[1,2,{\"a\":3.141},false,true,null,{\"json_class\":\"Range\",\"data\":[4,10,false]}]"
-# JSON.parse json
-# # => [1, 2, {"a"=>3.141}, false, true, nil, 4..10]
-#
-# JSON.generate always creates the shortest possible string representation of a
-# ruby data structure in one line. This good for data storage or network
-# protocols, but not so good for humans to read. Fortunately there's also
-# JSON.pretty_generate (or JSON.pretty_generate) that creates a more
-# readable output:
-#
-# puts JSON.pretty_generate([1, 2, {"a"=>3.141}, false, true, nil, 4..10])
-# [
-# 1,
-# 2,
-# {
-# "a": 3.141
-# },
-# false,
-# true,
-# null,
-# {
-# "json_class": "Range",
-# "data": [
-# 4,
-# 10,
-# false
-# ]
-# }
-# ]
-#
-# There are also the methods Kernel#j for generate, and Kernel#jj for
-# pretty_generate output to the console, that work analogous to Core Ruby's p
-# and the pp library's pp methods.
-#
-# The script tools/server.rb contains a small example if you want to test, how
-# receiving a JSON object from a webrick server in your browser with the
-# javasript prototype library (http://www.prototypejs.org) works.
-#
-module JSON
- require 'json/version'
-
- if VARIANT_BINARY
- require 'json/ext'
- else
- begin
- require 'json/ext'
- rescue LoadError
- require 'json/pure'
- end
- end
-end
diff --git a/ext/json/lib/json/Array.xpm b/ext/json/lib/json/Array.xpm
deleted file mode 100644
index 27c48011f9..0000000000
--- a/ext/json/lib/json/Array.xpm
+++ /dev/null
@@ -1,21 +0,0 @@
-/* XPM */
-static char * Array_xpm[] = {
-"16 16 2 1",
-" c None",
-". c #000000",
-" ",
-" ",
-" ",
-" .......... ",
-" . . ",
-" . . ",
-" . . ",
-" . . ",
-" . . ",
-" . . ",
-" . . ",
-" . . ",
-" .......... ",
-" ",
-" ",
-" "};
diff --git a/ext/json/lib/json/FalseClass.xpm b/ext/json/lib/json/FalseClass.xpm
deleted file mode 100644
index 25ce60832d..0000000000
--- a/ext/json/lib/json/FalseClass.xpm
+++ /dev/null
@@ -1,21 +0,0 @@
-/* XPM */
-static char * False_xpm[] = {
-"16 16 2 1",
-" c None",
-". c #FF0000",
-" ",
-" ",
-" ",
-" ...... ",
-" . ",
-" . ",
-" . ",
-" ...... ",
-" . ",
-" . ",
-" . ",
-" . ",
-" . ",
-" ",
-" ",
-" "};
diff --git a/ext/json/lib/json/Hash.xpm b/ext/json/lib/json/Hash.xpm
deleted file mode 100644
index cd8f6f7b53..0000000000
--- a/ext/json/lib/json/Hash.xpm
+++ /dev/null
@@ -1,21 +0,0 @@
-/* XPM */
-static char * Hash_xpm[] = {
-"16 16 2 1",
-" c None",
-". c #000000",
-" ",
-" ",
-" ",
-" . . ",
-" . . ",
-" . . ",
-" ......... ",
-" . . ",
-" . . ",
-" ......... ",
-" . . ",
-" . . ",
-" . . ",
-" ",
-" ",
-" "};
diff --git a/ext/json/lib/json/Key.xpm b/ext/json/lib/json/Key.xpm
deleted file mode 100644
index 9fd7281388..0000000000
--- a/ext/json/lib/json/Key.xpm
+++ /dev/null
@@ -1,73 +0,0 @@
-/* XPM */
-static char * Key_xpm[] = {
-"16 16 54 1",
-" c None",
-". c #110007",
-"+ c #0E0900",
-"@ c #000013",
-"# c #070600",
-"$ c #F6F006",
-"% c #ECE711",
-"& c #E5EE00",
-"* c #16021E",
-"= c #120900",
-"- c #EDF12B",
-"; c #000033",
-"> c #0F0000",
-", c #FFFE03",
-"' c #E6E500",
-") c #16021B",
-"! c #F7F502",
-"~ c #000E00",
-"{ c #130000",
-"] c #FFF000",
-"^ c #FFE711",
-"/ c #140005",
-"( c #190025",
-"_ c #E9DD27",
-": c #E7DC04",
-"< c #FFEC09",
-"[ c #FFE707",
-"} c #FFDE10",
-"| c #150021",
-"1 c #160700",
-"2 c #FAF60E",
-"3 c #EFE301",
-"4 c #FEF300",
-"5 c #E7E000",
-"6 c #FFFF08",
-"7 c #0E0206",
-"8 c #040000",
-"9 c #03052E",
-"0 c #041212",
-"a c #070300",
-"b c #F2E713",
-"c c #F9DE13",
-"d c #36091E",
-"e c #00001C",
-"f c #1F0010",
-"g c #FFF500",
-"h c #DEDE00",
-"i c #050A00",
-"j c #FAF14A",
-"k c #F5F200",
-"l c #040404",
-"m c #1A0D00",
-"n c #EDE43D",
-"o c #ECE007",
-" ",
-" ",
-" .+@ ",
-" #$%&* ",
-" =-;>,') ",
-" >!~{]^/ ",
-" (_:<[}| ",
-" 1234567 ",
-" 890abcd ",
-" efghi ",
-" >jkl ",
-" mnol ",
-" >kl ",
-" ll ",
-" ",
-" "};
diff --git a/ext/json/lib/json/NilClass.xpm b/ext/json/lib/json/NilClass.xpm
deleted file mode 100644
index 3509f06c99..0000000000
--- a/ext/json/lib/json/NilClass.xpm
+++ /dev/null
@@ -1,21 +0,0 @@
-/* XPM */
-static char * False_xpm[] = {
-"16 16 2 1",
-" c None",
-". c #000000",
-" ",
-" ",
-" ",
-" ... ",
-" . . ",
-" . . ",
-" . . ",
-" . . ",
-" . . ",
-" . . ",
-" . . ",
-" . . ",
-" ... ",
-" ",
-" ",
-" "};
diff --git a/ext/json/lib/json/Numeric.xpm b/ext/json/lib/json/Numeric.xpm
deleted file mode 100644
index e071e2ee9c..0000000000
--- a/ext/json/lib/json/Numeric.xpm
+++ /dev/null
@@ -1,28 +0,0 @@
-/* XPM */
-static char * Numeric_xpm[] = {
-"16 16 9 1",
-" c None",
-". c #FF0000",
-"+ c #0000FF",
-"@ c #0023DB",
-"# c #00EA14",
-"$ c #00FF00",
-"% c #004FAF",
-"& c #0028D6",
-"* c #00F20C",
-" ",
-" ",
-" ",
-" ... +++@#$$$$ ",
-" .+ %& $$ ",
-" . + $ ",
-" . + $$ ",
-" . ++$$$$ ",
-" . + $$ ",
-" . + $ ",
-" . + $ ",
-" . + $ $$ ",
-" .....++++*$$ ",
-" ",
-" ",
-" "};
diff --git a/ext/json/lib/json/String.xpm b/ext/json/lib/json/String.xpm
deleted file mode 100644
index f79a89cdc1..0000000000
--- a/ext/json/lib/json/String.xpm
+++ /dev/null
@@ -1,96 +0,0 @@
-/* XPM */
-static char * String_xpm[] = {
-"16 16 77 1",
-" c None",
-". c #000000",
-"+ c #040404",
-"@ c #080806",
-"# c #090606",
-"$ c #EEEAE1",
-"% c #E7E3DA",
-"& c #E0DBD1",
-"* c #D4B46F",
-"= c #0C0906",
-"- c #E3C072",
-"; c #E4C072",
-"> c #060505",
-", c #0B0A08",
-"' c #D5B264",
-") c #D3AF5A",
-"! c #080602",
-"~ c #E1B863",
-"{ c #DDB151",
-"] c #DBAE4A",
-"^ c #DDB152",
-"/ c #DDB252",
-"( c #070705",
-"_ c #0C0A07",
-": c #D3A33B",
-"< c #020201",
-"[ c #DAAA41",
-"} c #040302",
-"| c #E4D9BF",
-"1 c #0B0907",
-"2 c #030201",
-"3 c #020200",
-"4 c #C99115",
-"5 c #080704",
-"6 c #DBC8A2",
-"7 c #E7D7B4",
-"8 c #E0CD9E",
-"9 c #080601",
-"0 c #040400",
-"a c #010100",
-"b c #0B0B08",
-"c c #DCBF83",
-"d c #DCBC75",
-"e c #DEB559",
-"f c #040301",
-"g c #BC8815",
-"h c #120E07",
-"i c #060402",
-"j c #0A0804",
-"k c #D4A747",
-"l c #D6A12F",
-"m c #0E0C05",
-"n c #C8C1B0",
-"o c #1D1B15",
-"p c #D7AD51",
-"q c #070502",
-"r c #080804",
-"s c #BC953B",
-"t c #C4BDAD",
-"u c #0B0807",
-"v c #DBAC47",
-"w c #1B150A",
-"x c #B78A2C",
-"y c #D8A83C",
-"z c #D4A338",
-"A c #0F0B03",
-"B c #181105",
-"C c #C59325",
-"D c #C18E1F",
-"E c #060600",
-"F c #CC992D",
-"G c #B98B25",
-"H c #B3831F",
-"I c #C08C1C",
-"J c #060500",
-"K c #0E0C03",
-"L c #0D0A00",
-" ",
-" .+@# ",
-" .$%&*= ",
-" .-;>,')! ",
-" .~. .{]. ",
-" .^/. (_:< ",
-" .[.}|$12 ",
-" 345678}90 ",
-" a2bcdefgh ",
-" ijkl.mno ",
-" <pq. rstu ",
-" .]v. wx= ",
-" .yzABCDE ",
-" .FGHIJ ",
-" 0KL0 ",
-" "};
diff --git a/ext/json/lib/json/TrueClass.xpm b/ext/json/lib/json/TrueClass.xpm
deleted file mode 100644
index 143eef49bb..0000000000
--- a/ext/json/lib/json/TrueClass.xpm
+++ /dev/null
@@ -1,21 +0,0 @@
-/* XPM */
-static char * TrueClass_xpm[] = {
-"16 16 2 1",
-" c None",
-". c #0BF311",
-" ",
-" ",
-" ",
-" ......... ",
-" . ",
-" . ",
-" . ",
-" . ",
-" . ",
-" . ",
-" . ",
-" . ",
-" . ",
-" ",
-" ",
-" "};
diff --git a/ext/json/lib/json/add/core.rb b/ext/json/lib/json/add/core.rb
deleted file mode 100644
index 4423e7ad75..0000000000
--- a/ext/json/lib/json/add/core.rb
+++ /dev/null
@@ -1,135 +0,0 @@
-# This file contains implementations of ruby core's custom objects for
-# serialisation/deserialisation.
-
-unless Object.const_defined?(:JSON) and ::JSON.const_defined?(:JSON_LOADED) and
- ::JSON::JSON_LOADED
- require 'json'
-end
-require 'date'
-
-class Time
- def self.json_create(object)
- if usec = object.delete('u') # used to be tv_usec -> tv_nsec
- object['n'] = usec * 1000
- end
- if respond_to?(:tv_nsec)
- at(*object.values_at('s', 'n'))
- else
- at(object['s'], object['n'] / 1000)
- end
- end
-
- def to_json(*args)
- {
- 'json_class' => self.class.name,
- 's' => tv_sec,
- 'n' => respond_to?(:tv_nsec) ? tv_nsec : tv_usec * 1000
- }.to_json(*args)
- end
-end
-
-class Date
- def self.json_create(object)
- civil(*object.values_at('y', 'm', 'd', 'sg'))
- end
-
- alias start sg unless method_defined?(:start)
-
- def to_json(*args)
- {
- 'json_class' => self.class.name,
- 'y' => year,
- 'm' => month,
- 'd' => day,
- 'sg' => start,
- }.to_json(*args)
- end
-end
-
-class DateTime
- def self.json_create(object)
- args = object.values_at('y', 'm', 'd', 'H', 'M', 'S')
- of_a, of_b = object['of'].split('/')
- if of_b and of_b != '0'
- args << Rational(of_a.to_i, of_b.to_i)
- else
- args << of_a
- end
- args << object['sg']
- civil(*args)
- end
-
- alias start sg unless method_defined?(:start)
-
- def to_json(*args)
- {
- 'json_class' => self.class.name,
- 'y' => year,
- 'm' => month,
- 'd' => day,
- 'H' => hour,
- 'M' => min,
- 'S' => sec,
- 'of' => offset.to_s,
- 'sg' => start,
- }.to_json(*args)
- end
-end
-
-class Range
- def self.json_create(object)
- new(*object['a'])
- end
-
- def to_json(*args)
- {
- 'json_class' => self.class.name,
- 'a' => [ first, last, exclude_end? ]
- }.to_json(*args)
- end
-end
-
-class Struct
- def self.json_create(object)
- new(*object['v'])
- end
-
- def to_json(*args)
- klass = self.class.name
- klass.to_s.empty? and raise JSON::JSONError, "Only named structs are supported!"
- {
- 'json_class' => klass,
- 'v' => values,
- }.to_json(*args)
- end
-end
-
-class Exception
- def self.json_create(object)
- result = new(object['m'])
- result.set_backtrace object['b']
- result
- end
-
- def to_json(*args)
- {
- 'json_class' => self.class.name,
- 'm' => message,
- 'b' => backtrace,
- }.to_json(*args)
- end
-end
-
-class Regexp
- def self.json_create(object)
- new(object['s'], object['o'])
- end
-
- def to_json(*)
- {
- 'json_class' => self.class.name,
- 'o' => options,
- 's' => source,
- }.to_json
- end
-end
diff --git a/ext/json/lib/json/add/rails.rb b/ext/json/lib/json/add/rails.rb
deleted file mode 100644
index e86ed1aab9..0000000000
--- a/ext/json/lib/json/add/rails.rb
+++ /dev/null
@@ -1,58 +0,0 @@
-# This file contains implementations of rails custom objects for
-# serialisation/deserialisation.
-
-unless Object.const_defined?(:JSON) and ::JSON.const_defined?(:JSON_LOADED) and
- ::JSON::JSON_LOADED
- require 'json'
-end
-
-class Object
- def self.json_create(object)
- obj = new
- for key, value in object
- next if key == 'json_class'
- instance_variable_set "@#{key}", value
- end
- obj
- end
-
- def to_json(*a)
- result = {
- 'json_class' => self.class.name
- }
- instance_variables.inject(result) do |r, name|
- r[name[1..-1]] = instance_variable_get name
- r
- end
- result.to_json(*a)
- end
-end
-
-class Symbol
- def to_json(*a)
- to_s.to_json(*a)
- end
-end
-
-module Enumerable
- def to_json(*a)
- to_a.to_json(*a)
- end
-end
-
-# class Regexp
-# def to_json(*)
-# inspect
-# end
-# end
-#
-# The above rails definition has some problems:
-#
-# 1. { 'foo' => /bar/ }.to_json # => "{foo: /bar/}"
-# This isn't valid JSON, because the regular expression syntax is not
-# defined in RFC 4627. (And unquoted strings are disallowed there, too.)
-# Though it is valid Javascript.
-#
-# 2. { 'foo' => /bar/mix }.to_json # => "{foo: /bar/mix}"
-# This isn't even valid Javascript.
-
diff --git a/ext/json/lib/json/common.rb b/ext/json/lib/json/common.rb
deleted file mode 100755
index 1bd0ad5fbd..0000000000
--- a/ext/json/lib/json/common.rb
+++ /dev/null
@@ -1,354 +0,0 @@
-require 'json/version'
-
-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.
- #
- # 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 => {})
- else
- JSON.generate(object, opts => {})
- end
- end
-
- # Returns the JSON parser class, that is used by JSON. This might be either
- # JSON::Ext::Parser or JSON::Pure::Parser.
- attr_reader :parser
-
- # Set the JSON parser class _parser_ to be used by JSON.
- def parser=(parser) # :nodoc:
- @parser = parser
- remove_const :Parser if const_defined? :Parser
- const_set :Parser, parser
- end
-
- # Return the constant located at _path_. The format of _path_ has to be
- # either ::A::B::C or A::B::C. In any case A has to be located at the top
- # level (absolute namespace path?). If there doesn't exist a constant at
- # the given path, an ArgumentError is raised.
- def deep_const_get(path) # :nodoc:
- path = path.to_s
- path.split(/::/).inject(Object) do |p, c|
- case
- when c.empty? then p
- when p.const_defined?(c) then p.const_get(c)
- else raise ArgumentError, "can't find const #{path}"
- end
- end
- end
-
- # Set the module _generator_ to be used by JSON.
- def generator=(generator) # :nodoc:
- @generator = generator
- generator_methods = generator::GeneratorMethods
- for const in generator_methods.constants
- klass = deep_const_get(const)
- modul = generator_methods.const_get(const)
- klass.class_eval do
- instance_methods(false).each do |m|
- m.to_s == 'to_json' and remove_method m
- end
- include modul
- end
- end
- self.state = generator::State
- const_set :State, self.state
- end
-
- # Returns the JSON generator modul, that is used by JSON. This might be
- # either JSON::Ext::Generator or JSON::Pure::Generator.
- attr_reader :generator
-
- # Returns the JSON generator state class, that is used by JSON. This might
- # be either JSON::Ext::Generator::State or JSON::Pure::Generator::State.
- attr_accessor :state
-
- # This is create identifier, that is used to decide, if the _json_create_
- # hook of a class should be called. It defaults to 'json_class'.
- attr_accessor :create_id
- end
- self.create_id = 'json_class'
-
- NaN = (-1.0) ** 0.5
-
- Infinity = 1.0/0
-
- MinusInfinity = -Infinity
-
- # The base exception for JSON errors.
- class JSONError < StandardError; end
-
- # This exception is raised, if a parser error occurs.
- class ParserError < JSONError; end
-
- # This exception is raised, if the nesting of parsed datastructures is too
- # deep.
- class NestingError < ParserError; end
-
- # This exception is raised, if a generator or unparser error occurs.
- class GeneratorError < JSONError; end
- # For backwards compatibility
- UnparserError = GeneratorError
-
- # If a circular data structure is encountered while unparsing
- # this exception is raised.
- class CircularDatastructure < GeneratorError; end
-
- # This exception is raised, if the required unicode support is missing on the
- # system. Usually this means, that the iconv library is not installed.
- class MissingUnicodeSupport < JSONError; end
-
- module_function
-
- # Parse the JSON string _source_ into a Ruby data structure and return it.
- #
- # _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 19.
- # * *allow_nan*: If set to true, allow NaN, Infinity and -Infinity in
- # defiance of RFC 4627 to be parsed by the Parser. This option defaults
- # to false.
- # * *create_additions*: If set to false, the Parser doesn't create
- # additions even if a matchin class and create_id was found. This option
- # defaults to true.
- def parse(source, opts = {})
- JSON.parser.new(source, opts).parse
- end
-
- # Parse the JSON string _source_ into a Ruby data structure and return it.
- # The bang version of the parse method, defaults to the more dangerous values
- # for the _opts_ hash, so be sure only to parse trusted _source_ strings.
- #
- # _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.
- # * *allow_nan*: If set to true, allow NaN, Infinity, and -Infinity in
- # defiance of RFC 4627 to be parsed by the Parser. This option defaults
- # to true.
- # * *create_additions*: If set to false, the Parser doesn't create
- # additions even if a matchin class and create_id was found. This option
- # defaults to true.
- def parse!(source, opts = {})
- opts = {
- :max_nesting => false,
- :allow_nan => true
- }.update(opts)
- JSON.parser.new(source, opts).parse
- end
-
- # Unparse the Ruby data structure _obj_ into a single line JSON string and
- # return it. _state_ is
- # * a JSON::State object,
- # * or a Hash like object (responding to to_hash),
- # * an object convertible into a hash by a to_h method,
- # that is used as or to configure a State object.
- #
- # It defaults to a state object, that creates the shortest possible JSON text
- # in one line, checks for circular data structures and doesn't allow NaN,
- # Infinity, and -Infinity.
- #
- # A _state_ hash can have the following keys:
- # * *indent*: a string used to indent levels (default: ''),
- # * *space*: a string that is put after, a : or , delimiter (default: ''),
- # * *space_before*: a string that is put before a : pair delimiter (default: ''),
- # * *object_nl*: a string that is put at the end of a JSON object (default: ''),
- # * *array_nl*: a string that is put at the end of a JSON array (default: ''),
- # * *check_circular*: true if checking for circular data structures
- # should be done (the default), false otherwise.
- # * *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.
- # * *max_nesting*: The maximum depth of nesting allowed in the data
- # structures from which JSON is to be generated. Disable depth checking
- # with :max_nesting => false, it defaults to 19.
- #
- # See also the fast_generate for the fastest creation method with the least
- # amount of sanity checks, and the pretty_generate method for some
- # defaults for a pretty output.
- def generate(obj, state = nil)
- if state
- state = State.from_state(state)
- else
- state = State.new
- end
- obj.to_json(state)
- end
-
- # :stopdoc:
- # I want to deprecate these later, so I'll first be silent about them, and
- # later delete them.
- alias unparse generate
- module_function :unparse
- # :startdoc:
-
- # Unparse the Ruby data structure _obj_ into a single line JSON string and
- # return it. This method disables the checks for circles in Ruby objects, and
- # also generates NaN, Infinity, and, -Infinity float values.
- #
- # *WARNING*: Be careful not to pass any Ruby data structures with circles as
- # _obj_ argument, because this will cause JSON to go into an infinite loop.
- def fast_generate(obj)
- obj.to_json(nil)
- end
-
- # :stopdoc:
- # I want to deprecate these later, so I'll first be silent about them, and later delete them.
- alias fast_unparse fast_generate
- module_function :fast_unparse
- # :startdoc:
-
- # Unparse the Ruby data structure _obj_ into a JSON string and return it. The
- # returned string is a prettier form of the string returned by #unparse.
- #
- # The _opts_ argument can be used to configure the generator, see the
- # generate method for a more detailed explanation.
- def pretty_generate(obj, opts = nil)
- state = JSON.state.new(
- :indent => ' ',
- :space => ' ',
- :object_nl => "\n",
- :array_nl => "\n",
- :check_circular => true
- )
- if opts
- if opts.respond_to? :to_hash
- opts = opts.to_hash
- elsif opts.respond_to? :to_h
- opts = opts.to_h
- else
- raise TypeError, "can't convert #{opts.class} into Hash"
- end
- state.configure(opts)
- end
- obj.to_json(state)
- end
-
- # :stopdoc:
- # I want to deprecate these later, so I'll first be silent about them, and later delete them.
- alias pretty_unparse pretty_generate
- module_function :pretty_unparse
- # :startdoc:
-
- # Load a ruby data structure from a JSON _source_ and return it. A source can
- # either be a string-like object, an IO like object, or an object responding
- # to the read method. If _proc_ was given, it will be called with any nested
- # Ruby object as an argument recursively in depth first order.
- #
- # This method is part of the implementation of the load/dump interface of
- # Marshal and YAML.
- def load(source, proc = nil)
- if source.respond_to? :to_str
- source = source.to_str
- elsif source.respond_to? :to_io
- source = source.to_io.read
- else
- source = source.read
- end
- result = parse(source, :max_nesting => false, :allow_nan => true)
- recurse_proc(result, &proc) if proc
- result
- end
-
- def recurse_proc(result, &proc)
- case result
- when Array
- result.each { |x| recurse_proc x, &proc }
- proc.call result
- when Hash
- result.each { |x, y| recurse_proc x, &proc; recurse_proc y, &proc }
- proc.call result
- else
- proc.call result
- end
- end
- private :recurse_proc
- module_function :recurse_proc
-
- alias restore load
- module_function :restore
-
- # Dumps _obj_ as a JSON string, i.e. calls generate on the object and returns
- # the result.
- #
- # If anIO (an IO like object or an object that responds to the write method)
- # was given, the resulting JSON is written to it.
- #
- # If the number of nested arrays or objects exceeds _limit_ an ArgumentError
- # exception is raised. This argument is similar (but not exactly the
- # same!) to the _limit_ argument in Marshal.dump.
- #
- # This method is part of the implementation of the load/dump interface of
- # Marshal and YAML.
- def dump(obj, anIO = nil, limit = nil)
- if anIO and limit.nil?
- anIO = anIO.to_io if anIO.respond_to?(:to_io)
- unless anIO.respond_to?(:write)
- limit = anIO
- anIO = nil
- end
- end
- limit ||= 0
- result = generate(obj, :allow_nan => true, :max_nesting => limit)
- if anIO
- anIO.write result
- anIO
- else
- result
- end
- rescue JSON::NestingError
- raise ArgumentError, "exceed depth limit"
- end
-end
-
-module ::Kernel
- # Outputs _objs_ to STDOUT as JSON strings in the shortest form, that is in
- # one line.
- def j(*objs)
- objs.each do |obj|
- puts JSON::generate(obj, :allow_nan => true, :max_nesting => false)
- end
- nil
- end
-
- # Ouputs _objs_ to STDOUT as JSON strings in a pretty format, with
- # indentation and over many lines.
- def jj(*objs)
- objs.each do |obj|
- puts JSON::pretty_generate(obj, :allow_nan => true, :max_nesting => false)
- end
- nil
- end
-
- # If _object_ is string-like parse the string and return the parsed result as
- # a Ruby data structure. Otherwise generate a JSON text from the Ruby data
- # structure object and return it.
- #
- # The _opts_ argument is passed through to generate/parse respectively, see
- # generate and parse for their documentation.
- def JSON(object, opts = {})
- if object.respond_to? :to_str
- JSON.parse(object.to_str, opts)
- else
- JSON.generate(object, opts)
- end
- end
-end
-
-class ::Class
- # Returns true, if this class can be used to create an instance
- # from a serialised JSON string. The class has to implement a class
- # method _json_create_ that expects a hash as first parameter, which includes
- # the required data.
- def json_creatable?
- respond_to?(:json_create)
- end
-end
diff --git a/ext/json/lib/json/editor.rb b/ext/json/lib/json/editor.rb
deleted file mode 100755
index 9e05f44b5b..0000000000
--- a/ext/json/lib/json/editor.rb
+++ /dev/null
@@ -1,1371 +0,0 @@
-# To use the GUI JSON editor, start the edit_json.rb executable script. It
-# requires ruby-gtk to be installed.
-
-require 'gtk2'
-require 'iconv'
-require 'json'
-require 'rbconfig'
-require 'open-uri'
-
-module JSON
- module Editor
- include Gtk
-
- # Beginning of the editor window title
- TITLE = 'JSON Editor'.freeze
-
- # Columns constants
- ICON_COL, TYPE_COL, CONTENT_COL = 0, 1, 2
-
- # JSON primitive types (Containers)
- CONTAINER_TYPES = %w[Array Hash].sort
- # All JSON primitive types
- ALL_TYPES = (%w[TrueClass FalseClass Numeric String NilClass] +
- CONTAINER_TYPES).sort
-
- # The Nodes necessary for the tree representation of a JSON document
- ALL_NODES = (ALL_TYPES + %w[Key]).sort
-
- DEFAULT_DIALOG_KEY_PRESS_HANDLER = lambda do |dialog, event|
- case event.keyval
- when Gdk::Keyval::GDK_Return
- dialog.response Dialog::RESPONSE_ACCEPT
- when Gdk::Keyval::GDK_Escape
- dialog.response Dialog::RESPONSE_REJECT
- end
- end
-
- # Returns the Gdk::Pixbuf of the icon named _name_ from the icon cache.
- def Editor.fetch_icon(name)
- @icon_cache ||= {}
- unless @icon_cache.key?(name)
- path = File.dirname(__FILE__)
- @icon_cache[name] = Gdk::Pixbuf.new(File.join(path, name + '.xpm'))
- end
- @icon_cache[name]
- end
-
- # Opens an error dialog on top of _window_ showing the error message
- # _text_.
- def Editor.error_dialog(window, text)
- dialog = MessageDialog.new(window, Dialog::MODAL,
- MessageDialog::ERROR,
- MessageDialog::BUTTONS_CLOSE, text)
- dialog.show_all
- dialog.run
- rescue TypeError
- dialog = MessageDialog.new(Editor.window, Dialog::MODAL,
- MessageDialog::ERROR,
- MessageDialog::BUTTONS_CLOSE, text)
- dialog.show_all
- dialog.run
- ensure
- dialog.destroy if dialog
- end
-
- # Opens a yes/no question dialog on top of _window_ showing the error
- # message _text_. If yes was answered _true_ is returned, otherwise
- # _false_.
- def Editor.question_dialog(window, text)
- dialog = MessageDialog.new(window, Dialog::MODAL,
- MessageDialog::QUESTION,
- MessageDialog::BUTTONS_YES_NO, text)
- dialog.show_all
- dialog.run do |response|
- return Gtk::Dialog::RESPONSE_YES === response
- end
- ensure
- dialog.destroy if dialog
- end
-
- # Convert the tree model starting from Gtk::TreeIter _iter_ into a Ruby
- # data structure and return it.
- def Editor.model2data(iter)
- return nil if iter.nil?
- case iter.type
- when 'Hash'
- hash = {}
- iter.each { |c| hash[c.content] = Editor.model2data(c.first_child) }
- hash
- when 'Array'
- array = Array.new(iter.n_children)
- iter.each_with_index { |c, i| array[i] = Editor.model2data(c) }
- array
- when 'Key'
- iter.content
- when 'String'
- iter.content
- when 'Numeric'
- content = iter.content
- if /\./.match(content)
- content.to_f
- else
- content.to_i
- end
- when 'TrueClass'
- true
- when 'FalseClass'
- false
- when 'NilClass'
- nil
- else
- fail "Unknown type found in model: #{iter.type}"
- end
- end
-
- # Convert the Ruby data structure _data_ into tree model data for Gtk and
- # returns the whole model. If the parameter _model_ wasn't given a new
- # Gtk::TreeStore is created as the model. The _parent_ parameter specifies
- # the parent node (iter, Gtk:TreeIter instance) to which the data is
- # appended, alternativeley the result of the yielded block is used as iter.
- def Editor.data2model(data, model = nil, parent = nil)
- model ||= TreeStore.new(Gdk::Pixbuf, String, String)
- iter = if block_given?
- yield model
- else
- model.append(parent)
- end
- case data
- when Hash
- iter.type = 'Hash'
- data.sort.each do |key, value|
- pair_iter = model.append(iter)
- pair_iter.type = 'Key'
- pair_iter.content = key.to_s
- Editor.data2model(value, model, pair_iter)
- end
- when Array
- iter.type = 'Array'
- data.each do |value|
- Editor.data2model(value, model, iter)
- end
- when Numeric
- iter.type = 'Numeric'
- iter.content = data.to_s
- when String, true, false, nil
- iter.type = data.class.name
- iter.content = data.nil? ? 'null' : data.to_s
- else
- iter.type = 'String'
- iter.content = data.to_s
- end
- model
- end
-
- # The Gtk::TreeIter class is reopened and some auxiliary methods are added.
- class Gtk::TreeIter
- include Enumerable
-
- # Traverse each of this Gtk::TreeIter instance's children
- # and yield to them.
- def each
- n_children.times { |i| yield nth_child(i) }
- end
-
- # Recursively traverse all nodes of this Gtk::TreeIter's subtree
- # (including self) and yield to them.
- def recursive_each(&block)
- yield self
- each do |i|
- i.recursive_each(&block)
- end
- end
-
- # Remove the subtree of this Gtk::TreeIter instance from the
- # model _model_.
- def remove_subtree(model)
- while current = first_child
- model.remove(current)
- end
- end
-
- # Returns the type of this node.
- def type
- self[TYPE_COL]
- end
-
- # Sets the type of this node to _value_. This implies setting
- # the respective icon accordingly.
- def type=(value)
- self[TYPE_COL] = value
- self[ICON_COL] = Editor.fetch_icon(value)
- end
-
- # Returns the content of this node.
- def content
- self[CONTENT_COL]
- end
-
- # Sets the content of this node to _value_.
- def content=(value)
- self[CONTENT_COL] = value
- end
- end
-
- # This module bundles some method, that can be used to create a menu. It
- # should be included into the class in question.
- module MenuExtension
- include Gtk
-
- # Creates a Menu, that includes MenuExtension. _treeview_ is the
- # Gtk::TreeView, on which it operates.
- def initialize(treeview)
- @treeview = treeview
- @menu = Menu.new
- end
-
- # Returns the Gtk::TreeView of this menu.
- attr_reader :treeview
-
- # Returns the menu.
- attr_reader :menu
-
- # Adds a Gtk::SeparatorMenuItem to this instance's #menu.
- def add_separator
- menu.append SeparatorMenuItem.new
- end
-
- # Adds a Gtk::MenuItem to this instance's #menu. _label_ is the label
- # string, _klass_ is the item type, and _callback_ is the procedure, that
- # is called if the _item_ is activated.
- def add_item(label, keyval = nil, klass = MenuItem, &callback)
- label = "#{label} (C-#{keyval.chr})" if keyval
- item = klass.new(label)
- item.signal_connect(:activate, &callback)
- if keyval
- self.signal_connect(:'key-press-event') do |item, event|
- if event.state & Gdk::Window::ModifierType::CONTROL_MASK != 0 and
- event.keyval == keyval
- callback.call item
- end
- end
- end
- menu.append item
- item
- end
-
- # This method should be implemented in subclasses to create the #menu of
- # this instance. It has to be called after an instance of this class is
- # created, to build the menu.
- def create
- raise NotImplementedError
- end
-
- def method_missing(*a, &b)
- treeview.__send__(*a, &b)
- end
- end
-
- # This class creates the popup menu, that opens when clicking onto the
- # treeview.
- class PopUpMenu
- include MenuExtension
-
- # Change the type or content of the selected node.
- def change_node(item)
- if current = selection.selected
- parent = current.parent
- old_type, old_content = current.type, current.content
- if ALL_TYPES.include?(old_type)
- @clipboard_data = Editor.model2data(current)
- type, content = ask_for_element(parent, current.type,
- current.content)
- if type
- current.type, current.content = type, content
- current.remove_subtree(model)
- toplevel.display_status("Changed a node in tree.")
- window.change
- end
- else
- toplevel.display_status(
- "Cannot change node of type #{old_type} in tree!")
- end
- end
- end
-
- # Cut the selected node and its subtree, and save it into the
- # clipboard.
- def cut_node(item)
- if current = selection.selected
- if current and current.type == 'Key'
- @clipboard_data = {
- current.content => Editor.model2data(current.first_child)
- }
- else
- @clipboard_data = Editor.model2data(current)
- end
- model.remove(current)
- window.change
- toplevel.display_status("Cut a node from tree.")
- end
- end
-
- # Copy the selected node and its subtree, and save it into the
- # clipboard.
- def copy_node(item)
- if current = selection.selected
- if current and current.type == 'Key'
- @clipboard_data = {
- current.content => Editor.model2data(current.first_child)
- }
- else
- @clipboard_data = Editor.model2data(current)
- end
- window.change
- toplevel.display_status("Copied a node from tree.")
- end
- end
-
- # Paste the data in the clipboard into the selected Array or Hash by
- # appending it.
- def paste_node_appending(item)
- if current = selection.selected
- if @clipboard_data
- case current.type
- when 'Array'
- Editor.data2model(@clipboard_data, model, current)
- expand_collapse(current)
- when 'Hash'
- if @clipboard_data.is_a? Hash
- parent = current.parent
- hash = Editor.model2data(current)
- model.remove(current)
- hash.update(@clipboard_data)
- Editor.data2model(hash, model, parent)
- if parent
- expand_collapse(parent)
- elsif @expanded
- expand_all
- end
- window.change
- else
- toplevel.display_status(
- "Cannot paste non-#{current.type} data into '#{current.type}'!")
- end
- else
- toplevel.display_status(
- "Cannot paste node below '#{current.type}'!")
- end
- else
- toplevel.display_status("Nothing to paste in clipboard!")
- end
- else
- toplevel.display_status("Append a node into the root first!")
- end
- end
-
- # Paste the data in the clipboard into the selected Array inserting it
- # before the selected element.
- def paste_node_inserting_before(item)
- if current = selection.selected
- if @clipboard_data
- parent = current.parent or return
- parent_type = parent.type
- if parent_type == 'Array'
- selected_index = parent.each_with_index do |c, i|
- break i if c == current
- end
- Editor.data2model(@clipboard_data, model, parent) do |m|
- m.insert_before(parent, current)
- end
- expand_collapse(current)
- toplevel.display_status("Inserted an element to " +
- "'#{parent_type}' before index #{selected_index}.")
- window.change
- else
- toplevel.display_status(
- "Cannot insert node below '#{parent_type}'!")
- end
- else
- toplevel.display_status("Nothing to paste in clipboard!")
- end
- else
- toplevel.display_status("Append a node into the root first!")
- end
- end
-
- # Append a new node to the selected Hash or Array.
- def append_new_node(item)
- if parent = selection.selected
- parent_type = parent.type
- case parent_type
- when 'Hash'
- key, type, content = ask_for_hash_pair(parent)
- key or return
- iter = create_node(parent, 'Key', key)
- iter = create_node(iter, type, content)
- toplevel.display_status(
- "Added a (key, value)-pair to '#{parent_type}'.")
- window.change
- when 'Array'
- type, content = ask_for_element(parent)
- type or return
- iter = create_node(parent, type, content)
- window.change
- toplevel.display_status("Appendend an element to '#{parent_type}'.")
- else
- toplevel.display_status("Cannot append to '#{parent_type}'!")
- end
- else
- type, content = ask_for_element
- type or return
- iter = create_node(nil, type, content)
- window.change
- end
- end
-
- # Insert a new node into an Array before the selected element.
- def insert_new_node(item)
- if current = selection.selected
- parent = current.parent or return
- parent_parent = parent.parent
- parent_type = parent.type
- if parent_type == 'Array'
- selected_index = parent.each_with_index do |c, i|
- break i if c == current
- end
- type, content = ask_for_element(parent)
- type or return
- iter = model.insert_before(parent, current)
- iter.type, iter.content = type, content
- toplevel.display_status("Inserted an element to " +
- "'#{parent_type}' before index #{selected_index}.")
- window.change
- else
- toplevel.display_status(
- "Cannot insert node below '#{parent_type}'!")
- end
- else
- toplevel.display_status("Append a node into the root first!")
- end
- end
-
- # Recursively collapse/expand a subtree starting from the selected node.
- def collapse_expand(item)
- if current = selection.selected
- if row_expanded?(current.path)
- collapse_row(current.path)
- else
- expand_row(current.path, true)
- end
- else
- toplevel.display_status("Append a node into the root first!")
- end
- end
-
- # Create the menu.
- def create
- add_item("Change node", ?n, &method(:change_node))
- add_separator
- add_item("Cut node", ?X, &method(:cut_node))
- add_item("Copy node", ?C, &method(:copy_node))
- add_item("Paste node (appending)", ?A, &method(:paste_node_appending))
- add_item("Paste node (inserting before)", ?I,
- &method(:paste_node_inserting_before))
- add_separator
- add_item("Append new node", ?a, &method(:append_new_node))
- add_item("Insert new node before", ?i, &method(:insert_new_node))
- add_separator
- add_item("Collapse/Expand node (recursively)", ?e,
- &method(:collapse_expand))
-
- menu.show_all
- signal_connect(:button_press_event) do |widget, event|
- if event.kind_of? Gdk::EventButton and event.button == 3
- menu.popup(nil, nil, event.button, event.time)
- end
- end
- signal_connect(:popup_menu) do
- menu.popup(nil, nil, 0, Gdk::Event::CURRENT_TIME)
- end
- end
- end
-
- # This class creates the File pulldown menu.
- class FileMenu
- include MenuExtension
-
- # Clear the model and filename, but ask to save the JSON document, if
- # unsaved changes have occured.
- def new(item)
- window.clear
- end
-
- # Open a file and load it into the editor. Ask to save the JSON document
- # first, if unsaved changes have occured.
- def open(item)
- window.file_open
- end
-
- def open_location(item)
- window.location_open
- end
-
- # Revert the current JSON document in the editor to the saved version.
- def revert(item)
- window.instance_eval do
- @filename and file_open(@filename)
- end
- end
-
- # Save the current JSON document.
- def save(item)
- window.file_save
- end
-
- # Save the current JSON document under the given filename.
- def save_as(item)
- window.file_save_as
- end
-
- # Quit the editor, after asking to save any unsaved changes first.
- def quit(item)
- window.quit
- end
-
- # Create the menu.
- def create
- title = MenuItem.new('File')
- title.submenu = menu
- add_item('New', &method(:new))
- add_item('Open', ?o, &method(:open))
- add_item('Open location', ?l, &method(:open_location))
- add_item('Revert', &method(:revert))
- add_separator
- add_item('Save', ?s, &method(:save))
- add_item('Save As', ?S, &method(:save_as))
- add_separator
- add_item('Quit', ?q, &method(:quit))
- title
- end
- end
-
- # This class creates the Edit pulldown menu.
- class EditMenu
- include MenuExtension
-
- # Copy data from model into primary clipboard.
- def copy(item)
- data = Editor.model2data(model.iter_first)
- json = JSON.pretty_generate(data, :max_nesting => false)
- c = Gtk::Clipboard.get(Gdk::Selection::PRIMARY)
- c.text = json
- end
-
- # Copy json text from primary clipboard into model.
- def paste(item)
- c = Gtk::Clipboard.get(Gdk::Selection::PRIMARY)
- if json = c.wait_for_text
- window.ask_save if @changed
- begin
- window.edit json
- rescue JSON::ParserError
- window.clear
- end
- end
- end
-
- # Find a string in all nodes' contents and select the found node in the
- # treeview.
- def find(item)
- @search = ask_for_find_term(@search) or return
- iter = model.get_iter('0') or return
- iter.recursive_each do |i|
- if @iter
- if @iter != i
- next
- else
- @iter = nil
- next
- end
- elsif @search.match(i[CONTENT_COL])
- set_cursor(i.path, nil, false)
- @iter = i
- break
- end
- end
- end
-
- # Repeat the last search given by #find.
- def find_again(item)
- @search or return
- iter = model.get_iter('0')
- iter.recursive_each do |i|
- if @iter
- if @iter != i
- next
- else
- @iter = nil
- next
- end
- elsif @search.match(i[CONTENT_COL])
- set_cursor(i.path, nil, false)
- @iter = i
- break
- end
- end
- end
-
- # Sort (Reverse sort) all elements of the selected array by the given
- # expression. _x_ is the element in question.
- def sort(item)
- if current = selection.selected
- if current.type == 'Array'
- parent = current.parent
- ary = Editor.model2data(current)
- order, reverse = ask_for_order
- order or return
- begin
- block = eval "lambda { |x| #{order} }"
- if reverse
- ary.sort! { |a,b| block[b] <=> block[a] }
- else
- ary.sort! { |a,b| block[a] <=> block[b] }
- end
- rescue => e
- Editor.error_dialog(self, "Failed to sort Array with #{order}: #{e}!")
- else
- Editor.data2model(ary, model, parent) do |m|
- m.insert_before(parent, current)
- end
- model.remove(current)
- expand_collapse(parent)
- window.change
- toplevel.display_status("Array has been sorted.")
- end
- else
- toplevel.display_status("Only Array nodes can be sorted!")
- end
- else
- toplevel.display_status("Select an Array to sort first!")
- end
- end
-
- # Create the menu.
- def create
- title = MenuItem.new('Edit')
- title.submenu = menu
- add_item('Copy', ?c, &method(:copy))
- add_item('Paste', ?v, &method(:paste))
- add_separator
- add_item('Find', ?f, &method(:find))
- add_item('Find Again', ?g, &method(:find_again))
- add_separator
- add_item('Sort', ?S, &method(:sort))
- title
- end
- end
-
- class OptionsMenu
- include MenuExtension
-
- # Collapse/Expand all nodes by default.
- def collapsed_nodes(item)
- if expanded
- self.expanded = false
- collapse_all
- else
- self.expanded = true
- expand_all
- end
- end
-
- # Toggle pretty saving mode on/off.
- def pretty_saving(item)
- @pretty_item.toggled
- window.change
- end
-
- attr_reader :pretty_item
-
- # Create the menu.
- def create
- title = MenuItem.new('Options')
- title.submenu = menu
- add_item('Collapsed nodes', nil, CheckMenuItem, &method(:collapsed_nodes))
- @pretty_item = add_item('Pretty saving', nil, CheckMenuItem,
- &method(:pretty_saving))
- @pretty_item.active = true
- window.unchange
- title
- end
- end
-
- # This class inherits from Gtk::TreeView, to configure it and to add a lot
- # of behaviour to it.
- class JSONTreeView < Gtk::TreeView
- include Gtk
-
- # Creates a JSONTreeView instance, the parameter _window_ is
- # a MainWindow instance and used for self delegation.
- def initialize(window)
- @window = window
- super(TreeStore.new(Gdk::Pixbuf, String, String))
- self.selection.mode = SELECTION_BROWSE
-
- @expanded = false
- self.headers_visible = false
- add_columns
- add_popup_menu
- end
-
- # Returns the MainWindow instance of this JSONTreeView.
- attr_reader :window
-
- # Returns true, if nodes are autoexpanding, false otherwise.
- attr_accessor :expanded
-
- private
-
- def add_columns
- cell = CellRendererPixbuf.new
- column = TreeViewColumn.new('Icon', cell,
- 'pixbuf' => ICON_COL
- )
- append_column(column)
-
- cell = CellRendererText.new
- column = TreeViewColumn.new('Type', cell,
- 'text' => TYPE_COL
- )
- append_column(column)
-
- cell = CellRendererText.new
- cell.editable = true
- column = TreeViewColumn.new('Content', cell,
- 'text' => CONTENT_COL
- )
- cell.signal_connect(:edited, &method(:cell_edited))
- append_column(column)
- end
-
- def unify_key(iter, key)
- return unless iter.type == 'Key'
- parent = iter.parent
- if parent.any? { |c| c != iter and c.content == key }
- old_key = key
- i = 0
- begin
- key = sprintf("%s.%d", old_key, i += 1)
- end while parent.any? { |c| c != iter and c.content == key }
- end
- iter.content = key
- end
-
- def cell_edited(cell, path, value)
- iter = model.get_iter(path)
- case iter.type
- when 'Key'
- unify_key(iter, value)
- toplevel.display_status('Key has been changed.')
- when 'FalseClass'
- value.downcase!
- if value == 'true'
- iter.type, iter.content = 'TrueClass', 'true'
- end
- when 'TrueClass'
- value.downcase!
- if value == 'false'
- iter.type, iter.content = 'FalseClass', 'false'
- end
- when 'Numeric'
- iter.content =
- if value == 'Infinity'
- value
- else
- (Integer(value) rescue Float(value) rescue 0).to_s
- end
- when 'String'
- iter.content = value
- when 'Hash', 'Array'
- return
- else
- fail "Unknown type found in model: #{iter.type}"
- end
- window.change
- end
-
- def configure_value(value, type)
- value.editable = false
- case type
- when 'Array', 'Hash'
- value.text = ''
- when 'TrueClass'
- value.text = 'true'
- when 'FalseClass'
- value.text = 'false'
- when 'NilClass'
- value.text = 'null'
- when 'Numeric', 'String'
- value.text ||= ''
- value.editable = true
- else
- raise ArgumentError, "unknown type '#{type}' encountered"
- end
- end
-
- def add_popup_menu
- menu = PopUpMenu.new(self)
- menu.create
- end
-
- public
-
- # Create a _type_ node with content _content_, and add it to _parent_
- # in the model. If _parent_ is nil, create a new model and put it into
- # the editor treeview.
- def create_node(parent, type, content)
- iter = if parent
- model.append(parent)
- else
- new_model = Editor.data2model(nil)
- toplevel.view_new_model(new_model)
- new_model.iter_first
- end
- iter.type, iter.content = type, content
- expand_collapse(parent) if parent
- iter
- end
-
- # Ask for a hash key, value pair to be added to the Hash node _parent_.
- def ask_for_hash_pair(parent)
- key_input = type_input = value_input = nil
-
- dialog = Dialog.new("New (key, value) pair for Hash", nil, nil,
- [ Stock::OK, Dialog::RESPONSE_ACCEPT ],
- [ Stock::CANCEL, Dialog::RESPONSE_REJECT ]
- )
- dialog.width_request = 640
-
- hbox = HBox.new(false, 5)
- hbox.pack_start(Label.new("Key:"), false)
- hbox.pack_start(key_input = Entry.new)
- key_input.text = @key || ''
- dialog.vbox.pack_start(hbox, false)
- key_input.signal_connect(:activate) do
- if parent.any? { |c| c.content == key_input.text }
- toplevel.display_status('Key already exists in Hash!')
- key_input.text = ''
- else
- toplevel.display_status('Key has been changed.')
- end
- end
-
- hbox = HBox.new(false, 5)
- hbox.pack_start(Label.new("Type:"), false)
- hbox.pack_start(type_input = ComboBox.new(true))
- ALL_TYPES.each { |t| type_input.append_text(t) }
- type_input.active = @type || 0
- dialog.vbox.pack_start(hbox, false)
-
- type_input.signal_connect(:changed) do
- value_input.editable = false
- case ALL_TYPES[type_input.active]
- when 'Array', 'Hash'
- value_input.text = ''
- when 'TrueClass'
- value_input.text = 'true'
- when 'FalseClass'
- value_input.text = 'false'
- when 'NilClass'
- value_input.text = 'null'
- else
- value_input.text = ''
- value_input.editable = true
- end
- end
-
- hbox = HBox.new(false, 5)
- hbox.pack_start(Label.new("Value:"), false)
- hbox.pack_start(value_input = Entry.new)
- value_input.width_chars = 60
- value_input.text = @value || ''
- dialog.vbox.pack_start(hbox, false)
-
- dialog.signal_connect(:'key-press-event', &DEFAULT_DIALOG_KEY_PRESS_HANDLER)
- dialog.show_all
- self.focus = dialog
- dialog.run do |response|
- if response == Dialog::RESPONSE_ACCEPT
- @key = key_input.text
- type = ALL_TYPES[@type = type_input.active]
- content = value_input.text
- return @key, type, content
- end
- end
- return
- ensure
- dialog.destroy
- end
-
- # Ask for an element to be appended _parent_.
- def ask_for_element(parent = nil, default_type = nil, value_text = @content)
- type_input = value_input = nil
-
- dialog = Dialog.new(
- "New element into #{parent ? parent.type : 'root'}",
- nil, nil,
- [ Stock::OK, Dialog::RESPONSE_ACCEPT ],
- [ Stock::CANCEL, Dialog::RESPONSE_REJECT ]
- )
- hbox = HBox.new(false, 5)
- hbox.pack_start(Label.new("Type:"), false)
- hbox.pack_start(type_input = ComboBox.new(true))
- default_active = 0
- types = parent ? ALL_TYPES : CONTAINER_TYPES
- types.each_with_index do |t, i|
- type_input.append_text(t)
- if t == default_type
- default_active = i
- end
- end
- type_input.active = default_active
- dialog.vbox.pack_start(hbox, false)
- type_input.signal_connect(:changed) do
- configure_value(value_input, types[type_input.active])
- end
-
- hbox = HBox.new(false, 5)
- hbox.pack_start(Label.new("Value:"), false)
- hbox.pack_start(value_input = Entry.new)
- value_input.width_chars = 60
- value_input.text = value_text if value_text
- configure_value(value_input, types[type_input.active])
-
- dialog.vbox.pack_start(hbox, false)
-
- dialog.signal_connect(:'key-press-event', &DEFAULT_DIALOG_KEY_PRESS_HANDLER)
- dialog.show_all
- self.focus = dialog
- dialog.run do |response|
- if response == Dialog::RESPONSE_ACCEPT
- type = types[type_input.active]
- @content = case type
- when 'Numeric'
- if (t = value_input.text) == 'Infinity'
- 1 / 0.0
- else
- Integer(t) rescue Float(t) rescue 0
- end
- else
- value_input.text
- end.to_s
- return type, @content
- end
- end
- return
- ensure
- dialog.destroy if dialog
- end
-
- # Ask for an order criteria for sorting, using _x_ for the element in
- # question. Returns the order criterium, and true/false for reverse
- # sorting.
- def ask_for_order
- dialog = Dialog.new(
- "Give an order criterium for 'x'.",
- nil, nil,
- [ Stock::OK, Dialog::RESPONSE_ACCEPT ],
- [ Stock::CANCEL, Dialog::RESPONSE_REJECT ]
- )
- hbox = HBox.new(false, 5)
-
- hbox.pack_start(Label.new("Order:"), false)
- hbox.pack_start(order_input = Entry.new)
- order_input.text = @order || 'x'
- order_input.width_chars = 60
-
- hbox.pack_start(reverse_checkbox = CheckButton.new('Reverse'), false)
-
- dialog.vbox.pack_start(hbox, false)
-
- dialog.signal_connect(:'key-press-event', &DEFAULT_DIALOG_KEY_PRESS_HANDLER)
- dialog.show_all
- self.focus = dialog
- dialog.run do |response|
- if response == Dialog::RESPONSE_ACCEPT
- return @order = order_input.text, reverse_checkbox.active?
- end
- end
- return
- ensure
- dialog.destroy if dialog
- end
-
- # Ask for a find term to search for in the tree. Returns the term as a
- # string.
- def ask_for_find_term(search = nil)
- dialog = Dialog.new(
- "Find a node matching regex in tree.",
- nil, nil,
- [ Stock::OK, Dialog::RESPONSE_ACCEPT ],
- [ Stock::CANCEL, Dialog::RESPONSE_REJECT ]
- )
- hbox = HBox.new(false, 5)
-
- hbox.pack_start(Label.new("Regex:"), false)
- hbox.pack_start(regex_input = Entry.new)
- hbox.pack_start(icase_checkbox = CheckButton.new('Icase'), false)
- regex_input.width_chars = 60
- if search
- regex_input.text = search.source
- icase_checkbox.active = search.casefold?
- end
-
- dialog.vbox.pack_start(hbox, false)
-
- dialog.signal_connect(:'key-press-event', &DEFAULT_DIALOG_KEY_PRESS_HANDLER)
- dialog.show_all
- self.focus = dialog
- dialog.run do |response|
- if response == Dialog::RESPONSE_ACCEPT
- begin
- return Regexp.new(regex_input.text, icase_checkbox.active? ? Regexp::IGNORECASE : 0)
- rescue => e
- Editor.error_dialog(self, "Evaluation of regex /#{regex_input.text}/ failed: #{e}!")
- return
- end
- end
- end
- return
- ensure
- dialog.destroy if dialog
- end
-
- # Expand or collapse row pointed to by _iter_ according
- # to the #expanded attribute.
- def expand_collapse(iter)
- if expanded
- expand_row(iter.path, true)
- else
- collapse_row(iter.path)
- end
- end
- end
-
- # The editor main window
- class MainWindow < Gtk::Window
- include Gtk
-
- def initialize(encoding)
- @changed = false
- @encoding = encoding
- super(TOPLEVEL)
- display_title
- set_default_size(800, 600)
- signal_connect(:delete_event) { quit }
-
- vbox = VBox.new(false, 0)
- add(vbox)
- #vbox.border_width = 0
-
- @treeview = JSONTreeView.new(self)
- @treeview.signal_connect(:'cursor-changed') do
- display_status('')
- end
-
- menu_bar = create_menu_bar
- vbox.pack_start(menu_bar, false, false, 0)
-
- sw = ScrolledWindow.new(nil, nil)
- sw.shadow_type = SHADOW_ETCHED_IN
- sw.set_policy(POLICY_AUTOMATIC, POLICY_AUTOMATIC)
- vbox.pack_start(sw, true, true, 0)
- sw.add(@treeview)
-
- @status_bar = Statusbar.new
- vbox.pack_start(@status_bar, false, false, 0)
-
- @filename ||= nil
- if @filename
- data = read_data(@filename)
- view_new_model Editor.data2model(data)
- end
-
- signal_connect(:button_release_event) do |_,event|
- if event.button == 2
- c = Gtk::Clipboard.get(Gdk::Selection::PRIMARY)
- if url = c.wait_for_text
- location_open url
- end
- false
- else
- true
- end
- end
- end
-
- # Creates the menu bar with the pulldown menus and returns it.
- def create_menu_bar
- menu_bar = MenuBar.new
- @file_menu = FileMenu.new(@treeview)
- menu_bar.append @file_menu.create
- @edit_menu = EditMenu.new(@treeview)
- menu_bar.append @edit_menu.create
- @options_menu = OptionsMenu.new(@treeview)
- menu_bar.append @options_menu.create
- menu_bar
- end
-
- # Sets editor status to changed, to indicate that the edited data
- # containts unsaved changes.
- def change
- @changed = true
- display_title
- end
-
- # Sets editor status to unchanged, to indicate that the edited data
- # doesn't containt unsaved changes.
- def unchange
- @changed = false
- display_title
- end
-
- # Puts a new model _model_ into the Gtk::TreeView to be edited.
- def view_new_model(model)
- @treeview.model = model
- @treeview.expanded = true
- @treeview.expand_all
- unchange
- end
-
- # Displays _text_ in the status bar.
- def display_status(text)
- @cid ||= nil
- @status_bar.pop(@cid) if @cid
- @cid = @status_bar.get_context_id('dummy')
- @status_bar.push(@cid, text)
- end
-
- # Opens a dialog, asking, if changes should be saved to a file.
- def ask_save
- if Editor.question_dialog(self,
- "Unsaved changes to JSON model. Save?")
- if @filename
- file_save
- else
- file_save_as
- end
- end
- end
-
- # Quit this editor, that is, leave this editor's main loop.
- def quit
- ask_save if @changed
- if Gtk.main_level > 0
- destroy
- Gtk.main_quit
- end
- nil
- end
-
- # Display the new title according to the editor's current state.
- def display_title
- title = TITLE.dup
- title << ": #@filename" if @filename
- title << " *" if @changed
- self.title = title
- end
-
- # Clear the current model, after asking to save all unsaved changes.
- def clear
- ask_save if @changed
- @filename = nil
- self.view_new_model nil
- end
-
- def check_pretty_printed(json)
- pretty = !!((nl_index = json.index("\n")) && nl_index != json.size - 1)
- @options_menu.pretty_item.active = pretty
- end
- private :check_pretty_printed
-
- # Open the data at the location _uri_, if given. Otherwise open a dialog
- # to ask for the _uri_.
- def location_open(uri = nil)
- uri = ask_for_location unless uri
- uri or return
- ask_save if @changed
- data = load_location(uri) or return
- view_new_model Editor.data2model(data)
- end
-
- # Open the file _filename_ or call the #select_file method to ask for a
- # filename.
- def file_open(filename = nil)
- filename = select_file('Open as a JSON file') unless filename
- data = load_file(filename) or return
- view_new_model Editor.data2model(data)
- end
-
- # Edit the string _json_ in the editor.
- def edit(json)
- if json.respond_to? :read
- json = json.read
- end
- data = parse_json json
- view_new_model Editor.data2model(data)
- end
-
- # Save the current file.
- def file_save
- if @filename
- store_file(@filename)
- else
- file_save_as
- end
- end
-
- # Save the current file as the filename
- def file_save_as
- filename = select_file('Save as a JSON file')
- store_file(filename)
- end
-
- # Store the current JSON document to _path_.
- def store_file(path)
- if path
- data = Editor.model2data(@treeview.model.iter_first)
- File.open(path + '.tmp', 'wb') do |output|
- data or break
- if @options_menu.pretty_item.active?
- output.puts JSON.pretty_generate(data, :max_nesting => false)
- else
- output.write JSON.generate(data, :max_nesting => false)
- end
- end
- File.rename path + '.tmp', path
- @filename = path
- toplevel.display_status("Saved data to '#@filename'.")
- unchange
- end
- rescue SystemCallError => e
- Editor.error_dialog(self, "Failed to store JSON file: #{e}!")
- end
-
- # Load the file named _filename_ into the editor as a JSON document.
- def load_file(filename)
- if filename
- if File.directory?(filename)
- Editor.error_dialog(self, "Try to select a JSON file!")
- nil
- else
- @filename = filename
- if data = read_data(filename)
- toplevel.display_status("Loaded data from '#@filename'.")
- end
- display_title
- data
- end
- end
- end
-
- # Load the data at location _uri_ into the editor as a JSON document.
- def load_location(uri)
- data = read_data(uri) or return
- @filename = nil
- toplevel.display_status("Loaded data from '#{uri}'.")
- display_title
- data
- end
-
- def parse_json(json)
- check_pretty_printed(json)
- if @encoding && !/^utf8$/i.match(@encoding)
- iconverter = Iconv.new('utf8', @encoding)
- json = iconverter.iconv(json)
- end
- JSON::parse(json, :max_nesting => false, :create_additions => false)
- end
- private :parse_json
-
- # Read a JSON document from the file named _filename_, parse it into a
- # ruby data structure, and return the data.
- def read_data(filename)
- open(filename) do |f|
- json = f.read
- return parse_json(json)
- end
- rescue => e
- Editor.error_dialog(self, "Failed to parse JSON file: #{e}!")
- return
- end
-
- # Open a file selecton dialog, displaying _message_, and return the
- # selected filename or nil, if no file was selected.
- def select_file(message)
- filename = nil
- fs = FileSelection.new(message)
- fs.set_modal(true)
- @default_dir = File.join(Dir.pwd, '') unless @default_dir
- fs.set_filename(@default_dir)
- fs.set_transient_for(self)
- fs.signal_connect(:destroy) { Gtk.main_quit }
- fs.ok_button.signal_connect(:clicked) do
- filename = fs.filename
- @default_dir = File.join(File.dirname(filename), '')
- fs.destroy
- Gtk.main_quit
- end
- fs.cancel_button.signal_connect(:clicked) do
- fs.destroy
- Gtk.main_quit
- end
- fs.show_all
- Gtk.main
- filename
- end
-
- # Ask for location URI a to load data from. Returns the URI as a string.
- def ask_for_location
- dialog = Dialog.new(
- "Load data from location...",
- nil, nil,
- [ Stock::OK, Dialog::RESPONSE_ACCEPT ],
- [ Stock::CANCEL, Dialog::RESPONSE_REJECT ]
- )
- hbox = HBox.new(false, 5)
-
- hbox.pack_start(Label.new("Location:"), false)
- hbox.pack_start(location_input = Entry.new)
- location_input.width_chars = 60
- location_input.text = @location || ''
-
- dialog.vbox.pack_start(hbox, false)
-
- dialog.signal_connect(:'key-press-event', &DEFAULT_DIALOG_KEY_PRESS_HANDLER)
- dialog.show_all
- dialog.run do |response|
- if response == Dialog::RESPONSE_ACCEPT
- return @location = location_input.text
- end
- end
- return
- ensure
- dialog.destroy if dialog
- end
- end
-
- class << self
- # Starts a JSON Editor. If a block was given, it yields
- # to the JSON::Editor::MainWindow instance.
- def start(encoding = 'utf8') # :yield: window
- Gtk.init
- @window = Editor::MainWindow.new(encoding)
- @window.icon_list = [ Editor.fetch_icon('json') ]
- yield @window if block_given?
- @window.show_all
- Gtk.main
- end
-
- # Edit the string _json_ with encoding _encoding_ in the editor.
- def edit(json, encoding = 'utf8')
- start(encoding) do |window|
- window.edit json
- end
- end
-
- attr_reader :window
- end
- end
-end
diff --git a/ext/json/lib/json/ext.rb b/ext/json/lib/json/ext.rb
deleted file mode 100644
index 719e56025c..0000000000
--- a/ext/json/lib/json/ext.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-require 'json/common'
-
-module JSON
- # This module holds all the modules/classes that implement JSON's
- # functionality as C extensions.
- module Ext
- require 'json/ext/parser'
- require 'json/ext/generator'
- $DEBUG and warn "Using c extension for JSON."
- JSON.parser = Parser
- JSON.generator = Generator
- end
-
- JSON_LOADED = true
-end
diff --git a/ext/json/lib/json/json.xpm b/ext/json/lib/json/json.xpm
deleted file mode 100644
index 2cb626bb05..0000000000
--- a/ext/json/lib/json/json.xpm
+++ /dev/null
@@ -1,1499 +0,0 @@
-/* XPM */
-static char * json_xpm[] = {
-"64 64 1432 2",
-" c None",
-". c #641839",
-"+ c #CF163C",
-"@ c #D31C3B",
-"# c #E11A38",
-"$ c #5F242D",
-"% c #320C22",
-"& c #9B532D",
-"* c #F32E34",
-"= c #820F33",
-"- c #4B0F34",
-"; c #8E1237",
-"> c #944029",
-", c #961325",
-"' c #A00C24",
-") c #872C23",
-"! c #694021",
-"~ c #590D1F",
-"{ c #420528",
-"] c #D85A2D",
-"^ c #7E092B",
-"/ c #0E0925",
-"( c #0D081F",
-"_ c #0F081E",
-": c #12071F",
-"< c #360620",
-"[ c #682A21",
-"} c #673F21",
-"| c #780E21",
-"1 c #A82320",
-"2 c #8D1D1F",
-"3 c #970127",
-"4 c #0D0123",
-"5 c #0D0324",
-"6 c #3B1E28",
-"7 c #C28429",
-"8 c #0C0523",
-"9 c #0C041E",
-"0 c #0E031A",
-"a c #11031A",
-"b c #13031B",
-"c c #13031C",
-"d c #11031D",
-"e c #19051E",
-"f c #390E20",
-"g c #9C0C20",
-"h c #C00721",
-"i c #980320",
-"j c #14031E",
-"k c #CD9F32",
-"l c #C29F2E",
-"m c #0F0325",
-"n c #0D0321",
-"o c #0E0324",
-"p c #D08329",
-"q c #9D1B27",
-"r c #1C0320",
-"s c #0D011A",
-"t c #120117",
-"u c #130017",
-"v c #150018",
-"w c #160119",
-"x c #17021A",
-"y c #15021B",
-"z c #11021E",
-"A c #0F021F",
-"B c #8C1821",
-"C c #CF4522",
-"D c #831821",
-"E c #BA7033",
-"F c #EDB339",
-"G c #C89733",
-"H c #280727",
-"I c #0F051F",
-"J c #0E0420",
-"K c #591F27",
-"L c #E47129",
-"M c #612224",
-"N c #0C021D",
-"O c #120018",
-"P c #140017",
-"Q c #170017",
-"R c #190018",
-"S c #1B0019",
-"T c #1B011A",
-"U c #18011B",
-"V c #15011C",
-"W c #12031E",
-"X c #460A21",
-"Y c #A13823",
-"Z c #784323",
-"` c #5A0C21",
-" . c #BC4530",
-".. c #EB5B38",
-"+. c #CE4E3B",
-"@. c #DD9334",
-"#. c #751A27",
-"$. c #11071E",
-"%. c #0F041C",
-"&. c #1E0824",
-"*. c #955A28",
-"=. c #9A5027",
-"-. c #1E0321",
-";. c #11011A",
-">. c #140018",
-",. c #180018",
-"'. c #1F001A",
-"). c #20001B",
-"!. c #1E001A",
-"~. c #1B001A",
-"{. c #16021B",
-"]. c #16041E",
-"^. c #220622",
-"/. c #5F3525",
-"(. c #DE5724",
-"_. c #611021",
-":. c #0F0925",
-"<. c #D1892E",
-"[. c #F27036",
-"}. c #EC633B",
-"|. c #DA293C",
-"1. c #E64833",
-"2. c #912226",
-"3. c #11081C",
-"4. c #110419",
-"5. c #0F041E",
-"6. c #451425",
-"7. c #BF6F28",
-"8. c #332225",
-"9. c #0E021E",
-"0. c #13001B",
-"a. c #17001A",
-"b. c #1C001B",
-"c. c #21001C",
-"d. c #23001C",
-"e. c #21001B",
-"f. c #19021A",
-"g. c #17041E",
-"h. c #150721",
-"i. c #602424",
-"j. c #D51223",
-"k. c #540820",
-"l. c #D04D2D",
-"m. c #EA8933",
-"n. c #875637",
-"o. c #88543A",
-"p. c #E5923A",
-"q. c #891931",
-"r. c #130B25",
-"s. c #10051B",
-"t. c #110217",
-"u. c #12021A",
-"v. c #761826",
-"w. c #E2A728",
-"x. c #300224",
-"y. c #10011E",
-"z. c #16001B",
-"A. c #1B001B",
-"B. c #21001A",
-"C. c #1E0019",
-"D. c #1D0019",
-"E. c #1A011A",
-"F. c #17031C",
-"G. c #120720",
-"H. c #4E0822",
-"I. c #670721",
-"J. c #C07630",
-"K. c #F59734",
-"L. c #BE1B35",
-"M. c #0E1435",
-"N. c #522037",
-"O. c #DB8039",
-"P. c #D45933",
-"Q. c #420927",
-"R. c #0F041D",
-"S. c #140118",
-"T. c #13021D",
-"U. c #100423",
-"V. c #7B6227",
-"W. c #C04326",
-"X. c #0E0020",
-"Y. c #13001D",
-"Z. c #18001B",
-"`. c #1E001B",
-" + c #22001C",
-".+ c #22001B",
-"++ c #1B011B",
-"@+ c #16041D",
-"#+ c #130520",
-"$+ c #860521",
-"%+ c #710520",
-"&+ c #670A2A",
-"*+ c #A66431",
-"=+ c #E97536",
-"-+ c #F8833A",
-";+ c #F77A3A",
-">+ c #C45337",
-",+ c #0A1C35",
-"'+ c #993638",
-")+ c #F7863B",
-"!+ c #F49736",
-"~+ c #94462B",
-"{+ c #0E031F",
-"]+ c #130119",
-"^+ c #160018",
-"/+ c #16011B",
-"(+ c #15021F",
-"_+ c #120123",
-":+ c #A65C28",
-"<+ c #5C4D23",
-"[+ c #0F001F",
-"}+ c #14001D",
-"|+ c #1A001B",
-"1+ c #1F001B",
-"2+ c #24001D",
-"3+ c #25001D",
-"4+ c #24001C",
-"5+ c #1F001C",
-"6+ c #1A011C",
-"7+ c #16021E",
-"8+ c #3F0421",
-"9+ c #BC0522",
-"0+ c #1C041E",
-"a+ c #7F5531",
-"b+ c #E68A38",
-"c+ c #F8933E",
-"d+ c #FA7942",
-"e+ c #FB7543",
-"f+ c #FA6F41",
-"g+ c #F1793D",
-"h+ c #7D3B3A",
-"i+ c #28263B",
-"j+ c #D45441",
-"k+ c #F8A238",
-"l+ c #996B2D",
-"m+ c #0E0421",
-"n+ c #12011A",
-"o+ c #180019",
-"p+ c #17001C",
-"q+ c #12001F",
-"r+ c #4C2B2A",
-"s+ c #DB8130",
-"t+ c #540023",
-"u+ c #0F0120",
-"v+ c #16011C",
-"w+ c #22001D",
-"x+ c #25001F",
-"y+ c #26001F",
-"z+ c #25001E",
-"A+ c #24001E",
-"B+ c #1D001C",
-"C+ c #18011D",
-"D+ c #16031F",
-"E+ c #3C0522",
-"F+ c #9B0821",
-"G+ c #13041E",
-"H+ c #F6462E",
-"I+ c #E6AB37",
-"J+ c #E7A03E",
-"K+ c #FA9F44",
-"L+ c #FB8A48",
-"M+ c #FD7A4A",
-"N+ c #FD794A",
-"O+ c #FD7748",
-"P+ c #FD7E45",
-"Q+ c #FD8343",
-"R+ c #FB5D42",
-"S+ c #6E3A40",
-"T+ c #EE8A37",
-"U+ c #7E252B",
-"V+ c #100520",
-"W+ c #13011A",
-"X+ c #170019",
-"Y+ c #15001C",
-"Z+ c #0F0020",
-"`+ c #564427",
-" @ c #E0BA29",
-".@ c #5E2B25",
-"+@ c #10011F",
-"@@ c #17011C",
-"#@ c #1E001D",
-"$@ c #23001F",
-"%@ c #250020",
-"&@ c #24001F",
-"*@ c #23001E",
-"=@ c #21001E",
-"-@ c #1B001C",
-";@ c #17021D",
-">@ c #14041E",
-",@ c #AC0B25",
-"'@ c #5E1420",
-")@ c #F28635",
-"!@ c #C2733E",
-"~@ c #984C44",
-"{@ c #EA9148",
-"]@ c #FB844B",
-"^@ c #FD7E4C",
-"/@ c #FE7E4C",
-"(@ c #FE7E4B",
-"_@ c #FE7749",
-":@ c #FD7148",
-"<@ c #FB7D46",
-"[@ c #F89641",
-"}@ c #B95634",
-"|@ c #0D0927",
-"1@ c #11041D",
-"2@ c #150119",
-"3@ c #180017",
-"4@ c #16001A",
-"5@ c #13001E",
-"6@ c #110023",
-"7@ c #944C29",
-"8@ c #EE6229",
-"9@ c #3D0324",
-"0@ c #12021F",
-"a@ c #19011D",
-"b@ c #21001F",
-"c@ c #22001F",
-"d@ c #20001E",
-"e@ c #1F001D",
-"f@ c #1C001C",
-"g@ c #19011C",
-"h@ c #3D1621",
-"i@ c #B53622",
-"j@ c #31061F",
-"k@ c #841D34",
-"l@ c #F2703F",
-"m@ c #C14445",
-"n@ c #E67349",
-"o@ c #FB8E4B",
-"p@ c #FD834C",
-"q@ c #FE834D",
-"r@ c #FE834C",
-"s@ c #FE804C",
-"t@ c #FD814B",
-"u@ c #FB7D49",
-"v@ c #F79B43",
-"w@ c #AF1234",
-"x@ c #0D0625",
-"y@ c #13021C",
-"z@ c #1A0019",
-"A@ c #190019",
-"B@ c #410225",
-"C@ c #D39729",
-"D@ c #AA5927",
-"E@ c #0E0422",
-"F@ c #15021E",
-"G@ c #1A011D",
-"H@ c #1D001D",
-"I@ c #15031D",
-"J@ c #240820",
-"K@ c #A01023",
-"L@ c #670B21",
-"M@ c #3D0D33",
-"N@ c #E63C3E",
-"O@ c #EF7C45",
-"P@ c #F59048",
-"Q@ c #FB944A",
-"R@ c #FD904A",
-"S@ c #FE8E4B",
-"T@ c #FE854A",
-"U@ c #FE854B",
-"V@ c #FE884C",
-"W@ c #FC954B",
-"X@ c #F8AB45",
-"Y@ c #C37A35",
-"Z@ c #0D0425",
-"`@ c #13011B",
-" # c #170018",
-".# c #1A0018",
-"+# c #1C0019",
-"@# c #15001B",
-"## c #100120",
-"$# c #311F25",
-"%# c #E68E28",
-"&# c #7A1425",
-"*# c #130321",
-"=# c #17011E",
-"-# c #1A001D",
-";# c #19001B",
-"># c #16021C",
-",# c #130521",
-"'# c #6F3123",
-")# c #6D3022",
-"!# c #C89433",
-"~# c #EA7E3E",
-"{# c #DB2943",
-"]# c #EF7745",
-"^# c #FB8544",
-"/# c #FD9A43",
-"(# c #FE9941",
-"_# c #FE9D43",
-":# c #FEA548",
-"<# c #FEAE49",
-"[# c #FCB944",
-"}# c #CA9F35",
-"|# c #0E0225",
-"1# c #11001B",
-"2# c #160019",
-"3# c #12011B",
-"4# c #0F0220",
-"5# c #351D26",
-"6# c #D85B28",
-"7# c #6C0F26",
-"8# c #190121",
-"9# c #1B001E",
-"0# c #1A001C",
-"a# c #1D001B",
-"b# c #130220",
-"c# c #703A23",
-"d# c #713A23",
-"e# c #140327",
-"f# c #411B36",
-"g# c #C8713E",
-"h# c #7A3A3F",
-"i# c #CE2C3C",
-"j# c #E77338",
-"k# c #9C6535",
-"l# c #9C6233",
-"m# c #9C6332",
-"n# c #9C6A35",
-"o# c #C37D3C",
-"p# c #FEAC41",
-"q# c #FEC23E",
-"r# c #826330",
-"s# c #100122",
-"t# c #120019",
-"u# c #150017",
-"v# c #190017",
-"w# c #1B0018",
-"x# c #12001A",
-"y# c #10021F",
-"z# c #1A0326",
-"A# c #5F292A",
-"B# c #7B4E29",
-"C# c #3C0E25",
-"D# c #1A0020",
-"E# c #14021F",
-"F# c #723B23",
-"G# c #14001A",
-"H# c #58042A",
-"I# c #A28337",
-"J# c #C8813B",
-"K# c #B14B38",
-"L# c #761231",
-"M# c #5A132A",
-"N# c #0D0726",
-"O# c #0C0623",
-"P# c #0B0723",
-"Q# c #0B0A26",
-"R# c #321C2D",
-"S# c #C45B33",
-"T# c #FEBB33",
-"U# c #13052A",
-"V# c #13011F",
-"W# c #160017",
-"X# c #15001A",
-"Y# c #12001D",
-"Z# c #94062A",
-"`# c #630D2C",
-" $ c #85292B",
-".$ c #AA5E29",
-"+$ c #1F0123",
-"@$ c #19011F",
-"#$ c #1E001C",
-"$$ c #15031F",
-"%$ c #712122",
-"&$ c #712223",
-"*$ c #14011B",
-"=$ c #110321",
-"-$ c #AF0C2B",
-";$ c #E7D534",
-">$ c #EAC934",
-",$ c #84582D",
-"'$ c #1B0824",
-")$ c #11041E",
-"!$ c #10021B",
-"~$ c #100119",
-"{$ c #100218",
-"]$ c #0F041A",
-"^$ c #0E0720",
-"/$ c #2C1026",
-"($ c #D8A328",
-"_$ c #140322",
-":$ c #160016",
-"<$ c #14001F",
-"[$ c #120024",
-"}$ c #100128",
-"|$ c #3C032F",
-"1$ c #2C062E",
-"2$ c #29022B",
-"3$ c #A31D29",
-"4$ c #976A25",
-"5$ c #1A0321",
-"6$ c #17031E",
-"7$ c #1B021D",
-"8$ c #20001C",
-"9$ c #14041F",
-"0$ c #703422",
-"a$ c #6F3522",
-"b$ c #8D0328",
-"c$ c #920329",
-"d$ c #0F0326",
-"e$ c #100321",
-"f$ c #11021B",
-"g$ c #130117",
-"h$ c #140016",
-"i$ c #150015",
-"j$ c #140015",
-"k$ c #130116",
-"l$ c #120219",
-"m$ c #11031C",
-"n$ c #12031D",
-"o$ c #170016",
-"p$ c #160020",
-"q$ c #250029",
-"r$ c #670033",
-"s$ c #DCA238",
-"t$ c #F5C736",
-"u$ c #9A732E",
-"v$ c #110227",
-"w$ c #110324",
-"x$ c #811924",
-"y$ c #A04323",
-"z$ c #250721",
-"A$ c #1A041F",
-"B$ c #1E011D",
-"C$ c #1C011C",
-"D$ c #18031D",
-"E$ c #130721",
-"F$ c #6F3623",
-"G$ c #6B3622",
-"H$ c #1A001A",
-"I$ c #14011F",
-"J$ c #12011E",
-"K$ c #11011C",
-"L$ c #140117",
-"M$ c #170015",
-"N$ c #150016",
-"O$ c #120119",
-"P$ c #11011B",
-"Q$ c #11001A",
-"R$ c #130018",
-"S$ c #170118",
-"T$ c #170119",
-"U$ c #18021E",
-"V$ c #1A0126",
-"W$ c #6F2332",
-"X$ c #E5563B",
-"Y$ c #F1B83F",
-"Z$ c #F6CC38",
-"`$ c #9D7A2D",
-" % c #130123",
-".% c #130320",
-"+% c #2A0721",
-"@% c #B00E24",
-"#% c #7D0B23",
-"$% c #1F0522",
-"%% c #1E0220",
-"&% c #1D011E",
-"*% c #1A031E",
-"=% c #15051F",
-"-% c #241322",
-";% c #A32F23",
-">% c #670E21",
-",% c #1C001A",
-"'% c #19001A",
-")% c #180016",
-"!% c #160118",
-"~% c #140219",
-"{% c #11021C",
-"]% c #10021E",
-"^% c #0F011D",
-"/% c #170117",
-"(% c #160219",
-"_% c #17041D",
-":% c #190523",
-"<% c #8C042E",
-"[% c #B65838",
-"}% c #E9D73F",
-"|% c #EED43E",
-"1% c #D85538",
-"2% c #493129",
-"3% c #130120",
-"4% c #15021D",
-"5% c #330822",
-"6% c #8A0825",
-"7% c #3C0424",
-"8% c #1E0322",
-"9% c #1C0321",
-"0% c #180421",
-"a% c #130822",
-"b% c #AF2D24",
-"c% c #BC5623",
-"d% c #2F071F",
-"e% c #1A041C",
-"f% c #1C031C",
-"g% c #1D011C",
-"h% c #160117",
-"i% c #150419",
-"j% c #12081D",
-"k% c #0F0923",
-"l% c #A77027",
-"m% c #A60525",
-"n% c #11021A",
-"o% c #130218",
-"p% c #150319",
-"q% c #16061D",
-"r% c #180923",
-"s% c #9C1D2B",
-"t% c #A32636",
-"u% c #A66E3B",
-"v% c #4B2E3C",
-"w% c #412C36",
-"x% c #36012D",
-"y% c #140123",
-"z% c #17001E",
-"A% c #19011B",
-"B% c #1A0421",
-"C% c #340425",
-"D% c #9E0326",
-"E% c #1F0424",
-"F% c #1C0524",
-"G% c #180724",
-"H% c #A91024",
-"I% c #D55D24",
-"J% c #90071E",
-"K% c #3C051D",
-"L% c #1C021C",
-"M% c #1C011A",
-"N% c #1D001A",
-"O% c #160116",
-"P% c #150216",
-"Q% c #140217",
-"R% c #140618",
-"S% c #120D1D",
-"T% c #231925",
-"U% c #B16A2E",
-"V% c #FDAC34",
-"W% c #D58631",
-"X% c #280E2A",
-"Y% c #0D0A23",
-"Z% c #0F0920",
-"`% c #120C21",
-" & c #1F1026",
-".& c #A3352E",
-"+& c #EE9F36",
-"@& c #5D2A3C",
-"#& c #960D3C",
-"$& c #970638",
-"%& c #A00330",
-"&& c #4D0126",
-"*& c #1C001F",
-"=& c #280120",
-"-& c #290223",
-";& c #1F0425",
-">& c #260726",
-",& c #340A26",
-"'& c #850925",
-")& c #3A0823",
-"!& c #82071D",
-"~& c #5E071D",
-"{& c #18051C",
-"]& c #18021A",
-"^& c #190118",
-"/& c #160217",
-"(& c #150418",
-"_& c #130618",
-":& c #110718",
-"<& c #10081A",
-"[& c #110D1D",
-"}& c #291C24",
-"|& c #A73B2D",
-"1& c #FD6B36",
-"2& c #FD853C",
-"3& c #FD863B",
-"4& c #C24A35",
-"5& c #6B442F",
-"6& c #6D302D",
-"7& c #6E252E",
-"8& c #8E3B32",
-"9& c #DE7739",
-"0& c #F48E3F",
-"a& c #DD8D41",
-"b& c #854F3D",
-"c& c #7E2D35",
-"d& c #33082B",
-"e& c #1C0222",
-"f& c #20001F",
-"g& c #1F0222",
-"h& c #1A0524",
-"i& c #440C27",
-"j& c #BC1427",
-"k& c #20041B",
-"l& c #53061C",
-"m& c #25071B",
-"n& c #11061A",
-"o& c #130418",
-"p& c #140317",
-"q& c #150217",
-"r& c #160318",
-"s& c #12051B",
-"t& c #100C1D",
-"u& c #0E101E",
-"v& c #0C121F",
-"w& c #0C1321",
-"x& c #781725",
-"y& c #B25D2C",
-"z& c #FA6335",
-"A& c #FD633C",
-"B& c #FE6D42",
-"C& c #FE7C42",
-"D& c #FE813F",
-"E& c #FE873C",
-"F& c #FD743B",
-"G& c #FB683B",
-"H& c #FA7A3E",
-"I& c #F98242",
-"J& c #F97844",
-"K& c #F98943",
-"L& c #F79C3D",
-"M& c #A25133",
-"N& c #280B28",
-"O& c #1D021F",
-"P& c #1F011C",
-"Q& c #280321",
-"R& c #1C0724",
-"S& c #3F1C27",
-"T& c #D33C27",
-"U& c #0E061B",
-"V& c #0C091C",
-"W& c #0C0A1B",
-"X& c #0E091A",
-"Y& c #11081B",
-"Z& c #100A20",
-"`& c #0E0D23",
-" * c #551227",
-".* c #B21829",
-"+* c #C42329",
-"@* c #C62C29",
-"#* c #C55429",
-"$* c #E76F2B",
-"%* c #F14232",
-"&* c #F95E3A",
-"** c #FC6740",
-"=* c #FE6E45",
-"-* c #FE7246",
-";* c #FE7545",
-">* c #FE7744",
-",* c #FD7745",
-"'* c #FD7845",
-")* c #FD7847",
-"!* c #FD7948",
-"~* c #FD7B44",
-"{* c #FC7C3B",
-"]* c #6F3130",
-"^* c #140B24",
-"/* c #19031D",
-"(* c #1C011B",
-"_* c #5A011F",
-":* c #B70421",
-"<* c #380824",
-"[* c #3E2626",
-"}* c #9F5626",
-"|* c #13051E",
-"1* c #360A21",
-"2* c #361223",
-"3* c #371724",
-"4* c #381824",
-"5* c #3B1524",
-"6* c #3E1E26",
-"7* c #471A29",
-"8* c #DB252E",
-"9* c #ED2733",
-"0* c #EE5436",
-"a* c #F04237",
-"b* c #F33934",
-"c* c #F53D2F",
-"d* c #D7312B",
-"e* c #AF212B",
-"f* c #3A2C31",
-"g* c #F65F39",
-"h* c #FB6F41",
-"i* c #FD6D45",
-"j* c #FE7047",
-"k* c #FE7647",
-"l* c #FE7847",
-"m* c #FE7848",
-"n* c #FE7748",
-"o* c #FE7948",
-"p* c #FE7C48",
-"q* c #FE7C47",
-"r* c #FE7642",
-"s* c #FE7439",
-"t* c #6D332C",
-"u* c #100B21",
-"v* c #16031B",
-"w* c #2B001B",
-"x* c #22011F",
-"y* c #220521",
-"z* c #1B0A23",
-"A* c #421425",
-"B* c #951924",
-"C* c #381023",
-"D* c #E94028",
-"E* c #E7302B",
-"F* c #EF432D",
-"G* c #F4302E",
-"H* c #F32C30",
-"I* c #CB4432",
-"J* c #DD3235",
-"K* c #EF4B3A",
-"L* c #F0333E",
-"M* c #CC3D3F",
-"N* c #E4313C",
-"O* c #F34834",
-"P* c #D13E2C",
-"Q* c #431825",
-"R* c #0E1424",
-"S* c #3C202C",
-"T* c #F15537",
-"U* c #F97140",
-"V* c #FC6E45",
-"W* c #FE7547",
-"X* c #FE7947",
-"Y* c #FE7B48",
-"Z* c #FE7D48",
-"`* c #FE8047",
-" = c #FE7A42",
-".= c #FE7A38",
-"+= c #6D442B",
-"@= c #0F0B21",
-"#= c #15031A",
-"$= c #49001B",
-"%= c #2F001C",
-"&= c #21021E",
-"*= c #220620",
-"== c #1B0D23",
-"-= c #641625",
-";= c #951823",
-">= c #390F25",
-",= c #AC3A2A",
-"'= c #B6492E",
-")= c #ED7531",
-"!= c #F45A34",
-"~= c #F54C36",
-"{= c #C72D39",
-"]= c #DE283C",
-"^= c #F33B40",
-"/= c #F34142",
-"(= c #D0393F",
-"_= c #E72E39",
-":= c #DB3C2E",
-"<= c #461724",
-"[= c #0F0D1E",
-"}= c #140B1E",
-"|= c #341427",
-"1= c #CB4834",
-"2= c #F7743F",
-"3= c #FB7145",
-"4= c #FE7747",
-"5= c #FE7A47",
-"6= c #FF7B48",
-"7= c #FF7C48",
-"8= c #FE7F47",
-"9= c #FE8247",
-"0= c #FE8642",
-"a= c #FE8439",
-"b= c #6D442D",
-"c= c #0F0A21",
-"d= c #14031A",
-"e= c #20031D",
-"f= c #210821",
-"g= c #191024",
-"h= c #CC1C25",
-"i= c #961423",
-"j= c #2C162C",
-"k= c #BD242E",
-"l= c #EF2C31",
-"m= c #F54C34",
-"n= c #F34037",
-"o= c #F5353A",
-"p= c #F7413D",
-"q= c #F8423D",
-"r= c #F93A39",
-"s= c #F95731",
-"t= c #341425",
-"u= c #110A1D",
-"v= c #140619",
-"w= c #18051B",
-"x= c #200F26",
-"y= c #864833",
-"z= c #F8773F",
-"A= c #FC7445",
-"B= c #FF7E48",
-"C= c #FF7E49",
-"D= c #FF7D49",
-"E= c #FF7D48",
-"F= c #FE8347",
-"G= c #FE8743",
-"H= c #FE893B",
-"I= c #6E452F",
-"J= c #100E23",
-"K= c #14041A",
-"L= c #55041D",
-"M= c #540921",
-"N= c #161124",
-"O= c #CE6A25",
-"P= c #3F1129",
-"Q= c #170A29",
-"R= c #0F0F29",
-"S= c #15132B",
-"T= c #1E182D",
-"U= c #A82B3D",
-"V= c #CB6633",
-"W= c #CC6932",
-"X= c #CC3D2D",
-"Y= c #331225",
-"Z= c #0F091C",
-"`= c #120417",
-" - c #160216",
-".- c #190419",
-"+- c #210F26",
-"@- c #8C4934",
-"#- c #F97A40",
-"$- c #FC7545",
-"%- c #FF7B49",
-"&- c #FE7D46",
-"*- c #FE7E43",
-"=- c #FD7B3E",
-"-- c #FA6934",
-";- c #532328",
-">- c #130B1D",
-",- c #150519",
-"'- c #14041C",
-")- c #120920",
-"!- c #C43624",
-"~- c #A21E23",
-"{- c #F87C30",
-"]- c #C9302D",
-"^- c #300F2A",
-"/- c #591129",
-"(- c #171328",
-"_- c #171628",
-":- c #141829",
-"<- c #101A2B",
-"[- c #0F172B",
-"}- c #0F1226",
-"|- c #0E0C20",
-"1- c #100619",
-"2- c #140316",
-"3- c #19051B",
-"4- c #3C1428",
-"5- c #E04B36",
-"6- c #FA7B41",
-"7- c #FD7346",
-"8- c #FE7548",
-"9- c #FF7849",
-"0- c #FF7749",
-"a- c #FE7B47",
-"b- c #FE7945",
-"c- c #FC7740",
-"d- c #FA7E39",
-"e- c #C1432F",
-"f- c #131523",
-"g- c #130A1C",
-"h- c #420621",
-"i- c #D08423",
-"j- c #F87739",
-"k- c #C03D37",
-"l- c #962B34",
-"m- c #A14332",
-"n- c #E54B30",
-"o- c #9E3E2F",
-"p- c #7F262E",
-"q- c #922D2E",
-"r- c #9C4B2E",
-"s- c #65212C",
-"t- c #101628",
-"u- c #101022",
-"v- c #11091C",
-"w- c #130619",
-"x- c #160A1E",
-"y- c #43252C",
-"z- c #F66439",
-"A- c #FA6942",
-"B- c #FD6C47",
-"C- c #FE6E48",
-"D- c #FE6F48",
-"E- c #FE7049",
-"F- c #FE714A",
-"G- c #FE744A",
-"H- c #FE7846",
-"I- c #FD7243",
-"J- c #FC703E",
-"K- c #FA6C37",
-"L- c #81312B",
-"M- c #121123",
-"N- c #15071D",
-"O- c #16031A",
-"P- c #17021B",
-"Q- c #8F3D22",
-"R- c #F8393E",
-"S- c #E42A3D",
-"T- c #E7473B",
-"U- c #FB503B",
-"V- c #FB4F3A",
-"W- c #F95439",
-"X- c #ED4C38",
-"Y- c #F45938",
-"Z- c #FB6537",
-"`- c #EA5236",
-" ; c #CE6232",
-".; c #CD392C",
-"+; c #181425",
-"@; c #120F21",
-"#; c #130D20",
-"$; c #151225",
-"%; c #903431",
-"&; c #F8703D",
-"*; c #FB6344",
-"=; c #FD6748",
-"-; c #FE6849",
-";; c #FE6949",
-">; c #FE6A49",
-",; c #FE6C4A",
-"'; c #FE704A",
-"); c #FE734A",
-"!; c #FE7449",
-"~; c #FE7347",
-"{; c #FE7145",
-"]; c #FD6C42",
-"^; c #FD753D",
-"/; c #F36E35",
-"(; c #CB452C",
-"_; c #600D24",
-":; c #1C061F",
-"<; c #1E031F",
-"[; c #5B3821",
-"}; c #CE9822",
-"|; c #FA4341",
-"1; c #FB4341",
-"2; c #FC4541",
-"3; c #FC4542",
-"4; c #FC4143",
-"5; c #FC4D42",
-"6; c #FB5042",
-"7; c #FB5342",
-"8; c #FC5242",
-"9; c #FD4F40",
-"0; c #FD503E",
-"a; c #FB6339",
-"b; c #F45E33",
-"c; c #A12A2E",
-"d; c #401E2C",
-"e; c #452D2F",
-"f; c #F74F38",
-"g; c #FA5940",
-"h; c #FC6245",
-"i; c #FE6447",
-"j; c #FE6449",
-"k; c #FE6549",
-"l; c #FE6749",
-"m; c #FE6B49",
-"n; c #FE6D49",
-"o; c #FE6D48",
-"p; c #FE6D47",
-"q; c #FE6D45",
-"r; c #FE6C44",
-"s; c #FE6A42",
-"t; c #FE663C",
-"u; c #FC6233",
-"v; c #752129",
-"w; c #1F0922",
-"x; c #750520",
-"y; c #81061F",
-"z; c #FA3D42",
-"A; c #FB4142",
-"B; c #FD4543",
-"C; c #FD4844",
-"D; c #FD4A45",
-"E; c #FD4D45",
-"F; c #FD5045",
-"G; c #FD5345",
-"H; c #FE5346",
-"I; c #FE5445",
-"J; c #FD5444",
-"K; c #FC4F41",
-"L; c #FA513D",
-"M; c #F95339",
-"N; c #F63736",
-"O; c #F75737",
-"P; c #F95F3B",
-"Q; c #FB5840",
-"R; c #FD5F43",
-"S; c #FE6345",
-"T; c #FE6547",
-"U; c #FE6548",
-"V; c #FE6448",
-"W; c #FE6248",
-"X; c #FE6348",
-"Y; c #FE6748",
-"Z; c #FE6848",
-"`; c #FE6846",
-" > c #FE6A45",
-".> c #FE6D43",
-"+> c #FE703F",
-"@> c #FC6F36",
-"#> c #6F302B",
-"$> c #140A22",
-"%> c #FA3B42",
-"&> c #FC4243",
-"*> c #FD4744",
-"=> c #FE4A45",
-"-> c #FE4C47",
-";> c #FE4D47",
-">> c #FE5047",
-",> c #FE5347",
-"'> c #FE5447",
-")> c #FD5246",
-"!> c #FB503F",
-"~> c #FA543D",
-"{> c #9B3D3B",
-"]> c #A3433B",
-"^> c #F9683D",
-"/> c #FC6940",
-"(> c #FE6342",
-"_> c #FE6645",
-":> c #FE6646",
-"<> c #FE6147",
-"[> c #FE6048",
-"}> c #FE6148",
-"|> c #FE6746",
-"1> c #FE6A46",
-"2> c #FE6F45",
-"3> c #FE7441",
-"4> c #FC7D39",
-"5> c #6C422E",
-"6> c #0F0F23",
-"7> c #FA4142",
-"8> c #FC4643",
-"9> c #FE4D46",
-"0> c #FE4E47",
-"a> c #FE4F48",
-"b> c #FE5148",
-"c> c #FE5348",
-"d> c #FE5548",
-"e> c #FE5247",
-"f> c #FD5445",
-"g> c #FC5544",
-"h> c #F96041",
-"i> c #D33F3D",
-"j> c #392D39",
-"k> c #973C38",
-"l> c #F94E3A",
-"m> c #FD693E",
-"n> c #FE6C43",
-"o> c #FE6047",
-"p> c #FE5D47",
-"q> c #FE5E48",
-"r> c #FE6948",
-"s> c #FE6947",
-"t> c #FE6B47",
-"u> c #FE6E46",
-"v> c #FD6D43",
-"w> c #FB723D",
-"x> c #D54A33",
-"y> c #301C29",
-"z> c #FB4A42",
-"A> c #FD4B44",
-"B> c #FE4F47",
-"C> c #FE5048",
-"D> c #FE5648",
-"E> c #FE5848",
-"F> c #FE5747",
-"G> c #FE5547",
-"H> c #FC5945",
-"I> c #F95742",
-"J> c #F3543D",
-"K> c #A33336",
-"L> c #302032",
-"M> c #152433",
-"N> c #CD3E38",
-"O> c #FD5A3F",
-"P> c #FE6343",
-"Q> c #FE6446",
-"R> c #FE6247",
-"S> c #FE6A47",
-"T> c #FC6542",
-"U> c #FB6A3B",
-"V> c #FA6D34",
-"W> c #D73C2D",
-"X> c #442428",
-"Y> c #281323",
-"Z> c #FD4E42",
-"`> c #FD4D43",
-" , c #FE4D45",
-"., c #FE5248",
-"+, c #FE5947",
-"@, c #FE5C47",
-"#, c #FE5B47",
-"$, c #FE5A47",
-"%, c #FE5847",
-"&, c #FC5C45",
-"*, c #F95B43",
-"=, c #F3613F",
-"-, c #E74F37",
-";, c #8C2431",
-">, c #161E2F",
-",, c #CD4E33",
-"', c #FD503A",
-"), c #FE5D40",
-"!, c #FE6445",
-"~, c #FE6946",
-"{, c #FE6847",
-"], c #FE6747",
-"^, c #FD6644",
-"/, c #FD6241",
-"(, c #FD5B3D",
-"_, c #FE6739",
-":, c #FE6135",
-"<, c #AB4830",
-"[, c #733E2A",
-"}, c #161224",
-"|, c #FC4E42",
-"1, c #FE4D44",
-"2, c #FE4E46",
-"3, c #FE5147",
-"4, c #FE5E47",
-"5, c #FD5C46",
-"6, c #FA5B44",
-"7, c #F45441",
-"8, c #EB393A",
-"9, c #CC3433",
-"0, c #47212F",
-"a, c #59242F",
-"b, c #FC6734",
-"c, c #FC6F3A",
-"d, c #FC723E",
-"e, c #FD6540",
-"f, c #FE6442",
-"g, c #FE6643",
-"h, c #FE6944",
-"i, c #FE6546",
-"j, c #FE6444",
-"k, c #FE6143",
-"l, c #FE5E41",
-"m, c #FE613F",
-"n, c #FE683C",
-"o, c #FE7937",
-"p, c #A25030",
-"q, c #692629",
-"r, c #151122",
-"s, c #FA573F",
-"t, c #FB4D40",
-"u, c #FC4F43",
-"v, c #FE5246",
-"w, c #FF6347",
-"x, c #FE5F48",
-"y, c #F65942",
-"z, c #F0493D",
-"A, c #ED3736",
-"B, c #73262F",
-"C, c #10152C",
-"D, c #3B292F",
-"E, c #363034",
-"F, c #AC3938",
-"G, c #FC6B3B",
-"H, c #FD763C",
-"I, c #FE6D3F",
-"J, c #FE6341",
-"K, c #FE6642",
-"L, c #FE6745",
-"M, c #FE6245",
-"N, c #FE6244",
-"O, c #FE6841",
-"P, c #FF683B",
-"Q, c #EC7035",
-"R, c #D0412D",
-"S, c #3A1627",
-"T, c #CF3938",
-"U, c #F6543C",
-"V, c #FB5040",
-"W, c #FD5544",
-"X, c #FE5A48",
-"Y, c #FE5D48",
-"Z, c #FE5F47",
-"`, c #FF6147",
-" ' c #FD5C45",
-".' c #FB5B43",
-"+' c #FA5A42",
-"@' c #F76040",
-"#' c #F4623D",
-"$' c #F26D38",
-"%' c #EC4130",
-"&' c #380E2B",
-"*' c #13122C",
-"=' c #362D31",
-"-' c #353435",
-";' c #352E37",
-">' c #2D3337",
-",' c #CC5838",
-"'' c #CD6F3A",
-")' c #CE6E3D",
-"!' c #FE793F",
-"~' c #FD7541",
-"{' c #FD6243",
-"]' c #FE6545",
-"^' c #FF6543",
-"/' c #FF6240",
-"(' c #FE723B",
-"_' c #FE8034",
-":' c #442D2C",
-"<' c #311725",
-"[' c #222830",
-"}' c #B73B36",
-"|' c #F94C3D",
-"1' c #FD5543",
-"2' c #FE5B48",
-"3' c #FF5E47",
-"4' c #FE5C48",
-"5' c #FC5B44",
-"6' c #F95640",
-"7' c #C34E3D",
-"8' c #A45A3A",
-"9' c #F37438",
-"0' c #F28935",
-"a' c #AF422F",
-"b' c #240D2B",
-"c' c #88292F",
-"d' c #FA8E34",
-"e' c #FC7E38",
-"f' c #FC5939",
-"g' c #694A37",
-"h' c #693437",
-"i' c #382638",
-"j' c #142439",
-"k' c #9F483A",
-"l' c #C45E3C",
-"m' c #FD7240",
-"n' c #FF6645",
-"o' c #FF6245",
-"p' c #FF6045",
-"q' c #FF6146",
-"r' c #FF6246",
-"s' c #FF6446",
-"t' c #FF6545",
-"u' c #FE763F",
-"v' c #FE7237",
-"w' c #C65331",
-"x' c #3D272A",
-"y' c #0D1E2B",
-"z' c #683032",
-"A' c #F9453A",
-"B' c #FD5341",
-"C' c #FE5A46",
-"D' c #FF5A48",
-"E' c #FE5948",
-"F' c #FD5A47",
-"G' c #FC5D43",
-"H' c #F95B3D",
-"I' c #713F37",
-"J' c #1E2D32",
-"K' c #C44531",
-"L' c #EF7A2F",
-"M' c #6B2E2C",
-"N' c #0F0E2C",
-"O' c #F56633",
-"P' c #FA803A",
-"Q' c #FC673E",
-"R' c #FD673E",
-"S' c #FC6F3C",
-"T' c #FA6E3B",
-"U' c #C6633A",
-"V' c #A06739",
-"W' c #835638",
-"X' c #381F38",
-"Y' c #713B38",
-"Z' c #7B503C",
-"`' c #FE7741",
-" ) c #FE7344",
-".) c #FE6D46",
-"+) c #FF6946",
-"@) c #FF5E46",
-"#) c #FF5D46",
-"$) c #FF5D47",
-"%) c #FF5F48",
-"&) c #FF6248",
-"*) c #FE6941",
-"=) c #FC783C",
-"-) c #C46B35",
-";) c #892730",
-">) c #111629",
-",) c #1F2630",
-"') c #AD3939",
-")) c #FC5D41",
-"!) c #FE5946",
-"~) c #FF5848",
-"{) c #FE5549",
-"]) c #FC5E42",
-"^) c #FA673B",
-"/) c #DB7033",
-"() c #392E2B",
-"_) c #311A28",
-":) c #3C2127",
-"<) c #1D1027",
-"[) c #92102C",
-"}) c #F58336",
-"|) c #FA673E",
-"1) c #FD6642",
-"2) c #FD5A41",
-"3) c #FC6D41",
-"4) c #FC6D3F",
-"5) c #FD683E",
-"6) c #F38C39",
-"7) c #CE6535",
-"8) c #612E34",
-"9) c #1D2637",
-"0) c #71513E",
-"a) c #FF6847",
-"b) c #FF5F47",
-"c) c #FF5A46",
-"d) c #FF5847",
-"e) c #FF5748",
-"f) c #FF594A",
-"g) c #FF5E4B",
-"h) c #FE654C",
-"i) c #FE694B",
-"j) c #FE6B48",
-"k) c #FC6A43",
-"l) c #F7683E",
-"m) c #EC6E39",
-" ",
-" ",
-" ",
-" ",
-" ",
-" ",
-" ",
-" ",
-" . + @ # $ % ",
-" & * = - ; > , ' ) ! ~ ",
-" { ] ^ / ( _ : < [ } | 1 2 ",
-" 3 4 5 6 7 8 9 0 a b c d e f g h i j ",
-" k l m n o p q r s t u v w x y z A B C D ",
-" E F G H I J K L M N O P Q R S T U V W X Y Z ` ",
-" ...+.@.#.$.%.&.*.=.-.;.>.,.S '.).!.~.{.].^./.(._. ",
-" :.<.[.}.|.1.2.3.4.5.6.7.8.9.0.a.b.c.d.e.!.S f.g.h.i.j.k. ",
-" l.m.n.o.p.q.r.s.t.u.J v.w.x.y.z.A.c.d.d.B.C.D.E.F.G.H.I. ",
-" J.K.L.M.N.O.P.Q.R.t S.T.U.V.W.X.Y.Z.`. +d.d..+B.'.++@+#+$+%+ ",
-" &+*+=+-+;+>+,+'+)+!+~+{+]+^+/+(+_+:+<+[+}+|+1+d.2+3+4+d.5+6+7+8+9+0+ ",
-" a+b+c+d+e+f+g+h+i+j+k+l+m+n+^+o+p+q+r+s+t+u+v+b.w+x+y+z+A+w+B+C+D+E+F+G+ ",
-" H+I+J+K+L+M+N+O+P+Q+R+S+T+U+V+W+Q ,.X+Y+Z+`+ @.@+@@@#@$@%@&@*@=@#@-@;@>@,@'@ ",
-" )@!@~@{@]@^@/@(@_@:@<@[@}@|@1@2@3@R ,.4@5@6@7@8@9@0@a@#@b@c@=@d@e@f@g@>@h@i@j@ ",
-" k@l@m@n@o@p@q@r@s@t@u@v@w@x@y@^+R S z@A@z.q+B@C@D@E@F@G@H@#@e@#@#@f@g@I@J@K@L@ ",
-" M@N@O@P@Q@R@S@T@U@V@W@X@Y@Z@`@ #.#+#+#S A@@###$#%#&#*#=#-#f@B+B+B+f@;#>#,#'#)# ",
-" !#~#{#]#^#/#(#(#_#:#<#[#}#|#1#^+.#S +#+#z@2#3#4#5#6#7#8#9#0#A.B+B+a#A.@@b#c#d# ",
-" e#f#g#h#i#j#k#l#m#n#o#p#q#r#s#t#u#v#.#w#S R ^+x#y#z#A#B#C#D#-#A.a#`.`.b.g@E#d#F# ",
-" G#0@H#I#J#K#L#M#N#O#P#Q#R#S#T#U#V#>.W#3@v#R R X+X#Y#s#Z#`# $.$+$@$g@f@5+5+#$6+$$%$&$ ",
-" *$=$-$;$>$,$'$)$!$~${$]$^$/$($_$*$u#:$Q 3@,.X+z.<$[$}$|$1$2$3$4$5$6$7$e@8$#$G@9$0$a$ ",
-" ,.4@E#b$c$d$e$f$g$h$i$j$k$l$m$n$`@>.:$o$3@,. #a.p$q$r$s$t$u$v$w$x$y$z$A$B$#@C$D$E$F$G$ ",
-" R S H$v+I$J$K$n+L$:$o$o$M$N$L$O$P$Q$R$N$o$3@S$T$U$V$W$X$Y$Z$`$ %.%+%@%#%$%%%&%*%=%-%;%>% ",
-" E.,%~.'%Z.4@v W#o$)%)%)%Q !%~%{%]%^%Q$u u#/%(%_%:%<%[%}%|%1%2%3%4%=%5%6%7%8%9%0%a%b%c%d% ",
-" e%f%g%a#,%,%z@R 3@3@3@)%Q h%i%j%k%l%m%{+n%o%p%q%r%s%t%u%v%w%x%y%z%A%*%B%C%D%E%F%G%H%I% ",
-" J%K%L%M%N%D.S v#)%)%O%P%Q%R%S%T%U%V%W%X%Y%Z%`% &.&+&@&#&$&%&&&*&f@a##@=&-&;&>&,&'&)& ",
-" !&~&{&]&^&.#w#^&/%/&(&_&:&<&[&}&|&1&2&3&4&5&6&7&8&9&0&a&b&c&d&e&e@1+5+e@f&g&h&i&j& ",
-" k&l&m&n&o&p&q&r&i%s&3.t&u&v&w&x&y&z&A&B&C&D&E&F&G&H&I&J&K&L&M&N&O&P&1+`.e@f&Q&R&S&T& ",
-" 0 U&V&W&X&<&Y&j%Z&`& *.*+*@*#*$*%*&***=*-*;*>*>*,*'*)*!*~*{*]*^*/*(*a#B+#@_*:*<*[*}* ",
-" |*1*2*3*4*5*6*7*8*9*0*a*b*c*d*e*f*g*h*i*j*k*l*m*n*o*p*q*r*s*t*u*v*E.w*d.e@x*y*z*A*B* ",
-" C*D*E*F*G*H*I*J*K*L*M*N*O*P*Q*R*S*T*U*V*W*l*X*o*o*Y*Z*`* =.=+=@=#='%$=%=e@&=*===-=;= ",
-" >=,='=)=!=~={=]=^=/=(=_=:=<=[=}=|=1=2=3=4=5=p*6=6=7=8=9=0=a=b=c=d=A@~.b.B+e=f=g=h=i= ",
-" j=k=l=m=n=o=p=q=r=s=t=u=v=w=x=y=z=A=5=Z*B=C=D=E=8=F=G=H=I=J=K=S$R z@'%L=M=N=O= ",
-" P=Q=R=S=T=U=V=W=X=Y=Z=`= -.-+-@-#-$-5=p*E=D=%-%-q*&-*-=---;->-,-/%3@^+'-)-!-~- ",
-" {-]-^-/-(-_-:-<-[-}-|-1-2- -3-4-5-6-7-8-n*m*9-0-9-o*a-b-c-d-e-f-g-(&h%w c h-i- ",
-" j-k-l-m-n-o-p-q-r-s-t-u-v-w-,-x-y-z-A-B-C-D-E-E-F-G-_@m*H-I-J-K-L-M-N-O-P-(+Q- ",
-" R-S-T-U-V-W-X-Y-Z-`- ;.;+;@;#;$;%;&;*;=;-;-;;;>;,;';);!;~;{;];^;/;(;_;:;<;[;}; ",
-" |;1;2;3;4;5;6;7;8;9;0;a;b;c;d;e;f;g;h;i;j;j;k;k;l;m;n;o;p;q;r;s;t;u;v;w;x;y; ",
-" z;A;B;C;D;E;F;G;H;I;J;K;L;M;N;O;P;Q;R;S;T;U;V;W;X;k;Y;Z;`; >r;.>+>@>#>$> ",
-" %>&>*>=>->;>>>,>'>,>)>F;8;!>~>{>]>^>/>(>_>:>i;<>[>X;}>i;|>1>q;2>3>4>5>6> ",
-" 7>8>=>9>0>a>b>c>d>,>e>e>f>g>h>i>j>k>l>m>n>:>i;o>p>q>W;r>s>t>p;u>v>w>x>y> ",
-" z>A>9>0>B>C>c>D>E>F>G>G>F>H>I>J>K>L>M>N>O>P>Q>R>o>R>T;s>S>S>S>t>1>T>U>V>W>X>Y> ",
-" Z>`> ,9>B>.,D>+,@,#,$,%,$,&,*,=,-,;,>,,,',),P>!,!,_>~,t>s>{,],{,],^,/,(,_,:,<,[,}, ",
-" |,`>1,2,3,G>+,4,o>o>4,@,@,5,6,7,8,9,0,a,b,c,d,e,f,g,h, >~,|>T;T;T;i,j,k,l,m,n,o,p,q,r, ",
-" s,t,u,v,G>%,@,o>w,R>x,p>@,5,6,y,z,A,B,C,D,E,F,G,H,I,J,K,L,L,i,i;i;i;Q>S;M,N,P>O,P,Q,R,S, ",
-" T,U,V,W,%,X,Y,Z,`,[>q>@, '.'+'@'#'$'%'&'*'='-';'>',''')'!'~'{'N,i,:>_>]'M,M,Q>_>^'/'('_':'<' ",
-" ['}'|'1'$,X,2'p>3'4'2'@,5'6'7'8'9'0'a'b'c'd'e'f'g'h'i'j'k'l'd,m'g, > >n'o'p'q'r's't'.>u'v'w'x' ",
-" y'z'A'B'C'X,X,2'D'E'E'F'G'H'I'J'K'L'M'N'O'P'Q'R'S'T'U'V'W'X'Y'Z'`' ).)+)r'@)#)$)%)&)l;1>*)=)-);) ",
-" >),)')))!)X,E'X,~){)d>!)])^)/)()_):)<)[)})|)1)f,2)3)4)5)6)7)8)9)0)*--*a)b)c)d)e)f)g)h)i)j)k)l)m) ",
-" ",
-" ",
-" ",
-" ",
-" ",
-" ",
-" ",
-" "};
diff --git a/ext/json/lib/json/version.rb b/ext/json/lib/json/version.rb
deleted file mode 100644
index e2764b0c6e..0000000000
--- a/ext/json/lib/json/version.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-module JSON
- # JSON version
- VERSION = '1.1.4'
- VERSION_ARRAY = VERSION.split(/\./).map { |x| x.to_i } # :nodoc:
- VERSION_MAJOR = VERSION_ARRAY[0] # :nodoc:
- VERSION_MINOR = VERSION_ARRAY[1] # :nodoc:
- VERSION_BUILD = VERSION_ARRAY[2] # :nodoc:
- VARIANT_BINARY = false
-end
diff --git a/ext/mathn/complex/complex.c b/ext/mathn/complex/complex.c
deleted file mode 100644
index dce494959f..0000000000
--- a/ext/mathn/complex/complex.c
+++ /dev/null
@@ -1,7 +0,0 @@
-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
deleted file mode 100644
index d4d14ffcb8..0000000000
--- a/ext/mathn/complex/extconf.rb
+++ /dev/null
@@ -1,3 +0,0 @@
-require "mkmf"
-
-create_makefile "mathn/complex"
diff --git a/ext/mathn/rational/extconf.rb b/ext/mathn/rational/extconf.rb
deleted file mode 100644
index ba76306b7b..0000000000
--- a/ext/mathn/rational/extconf.rb
+++ /dev/null
@@ -1,3 +0,0 @@
-require "mkmf"
-
-create_makefile "mathn/rational"
diff --git a/ext/mathn/rational/rational.c b/ext/mathn/rational/rational.c
deleted file mode 100644
index 2ac5999946..0000000000
--- a/ext/mathn/rational/rational.c
+++ /dev/null
@@ -1,7 +0,0 @@
-extern void nurat_canonicalization(int);
-
-void
-Init_rational(void)
-{
- nurat_canonicalization(1);
-}
diff --git a/ext/nkf/.cvsignore b/ext/nkf/.cvsignore
index 814345ece8..4088712231 100644
--- a/ext/nkf/.cvsignore
+++ b/ext/nkf/.cvsignore
@@ -1,4 +1,3 @@
Makefile
mkmf.log
*.def
-extconf.h
diff --git a/ext/nkf/lib/kconv.rb b/ext/nkf/lib/kconv.rb
index 6230996876..4ffe8d984e 100644
--- a/ext/nkf/lib/kconv.rb
+++ b/ext/nkf/lib/kconv.rb
@@ -18,9 +18,9 @@ module Kconv
#
# Public Constants
#
-
+
#Constant of Encoding
-
+
# Auto-Detect
AUTO = NKF::AUTO
# ISO-2022-JP
@@ -45,18 +45,84 @@ module Kconv
UNKNOWN = NKF::UNKNOWN
#
+ # Private Constants
+ #
+
+ # Revision of kconv.rb
+ REVISION = %q$Revision$
+
+ #Regexp of Encoding
+
+ # Regexp of Shift_JIS string (private constant)
+ RegexpShiftjis = /\A(?:
+ [\x00-\x7f\xa1-\xdf] |
+ [\x81-\x9f\xe0-\xfc][\x40-\x7e\x80-\xfc]
+ )*\z/nx
+
+ # Regexp of EUC-JP string (private constant)
+ RegexpEucjp = /\A(?:
+ [\x00-\x7f] |
+ \x8e [\xa1-\xdf] |
+ \x8f [\xa1-\xfe] [\xa1-\xfe] |
+ [\xa1-\xfe] [\xa1-\xfe]
+ )*\z/nx
+
+ # Regexp of UTF-8 string (private constant)
+ RegexpUtf8 = /\A(?:
+ [\x00-\x7f] |
+ [\xc2-\xdf] [\x80-\xbf] |
+ \xe0 [\xa0-\xbf] [\x80-\xbf] |
+ [\xe1-\xef] [\x80-\xbf] [\x80-\xbf] |
+ \xf0 [\x90-\xbf] [\x80-\xbf] [\x80-\xbf] |
+ [\xf1-\xf3] [\x80-\xbf] [\x80-\xbf] [\x80-\xbf] |
+ \xf4 [\x80-\x8f] [\x80-\xbf] [\x80-\xbf]
+ )*\z/nx
+
+ #
# Public Methods
#
-
+
# call-seq:
- # Kconv.kconv(str, to_enc, from_enc=nil)
+ # Kconv.kconv(str, out_code, in_code = Kconv::AUTO)
#
# Convert <code>str</code> to out_code.
# <code>out_code</code> and <code>in_code</code> are given as constants of Kconv.
- def kconv(str, to_enc, from_enc=nil)
- opt = ''
- opt += ' --ic=' + from_enc.to_s if from_enc
- opt += ' --oc=' + to_enc.to_s if to_enc
+ #
+ # *Note*
+ # This method decode MIME encoded string and
+ # convert halfwidth katakana to fullwidth katakana.
+ # If you don't want to decode them, use NKF.nkf.
+ def kconv(str, out_code, in_code = AUTO)
+ opt = '-'
+ case in_code
+ when ::NKF::JIS
+ opt << 'J'
+ when ::NKF::EUC
+ opt << 'E'
+ when ::NKF::SJIS
+ opt << 'S'
+ when ::NKF::UTF8
+ opt << 'W'
+ when ::NKF::UTF16
+ opt << 'W16'
+ end
+
+ case out_code
+ when ::NKF::JIS
+ opt << 'j'
+ when ::NKF::EUC
+ opt << 'e'
+ when ::NKF::SJIS
+ opt << 's'
+ when ::NKF::UTF8
+ opt << 'w'
+ when ::NKF::UTF16
+ opt << 'w16'
+ when ::NKF::NOCONV
+ return str
+ end
+
+ opt = '' if opt == '-'
::NKF::nkf(opt, str)
end
@@ -67,216 +133,235 @@ module Kconv
#
# call-seq:
- # Kconv.tojis(str) => string
+ # Kconv.tojis(str) -> string
#
# Convert <code>str</code> to ISO-2022-JP
+ #
+ # *Note*
+ # This method decode MIME encoded string and
+ # convert halfwidth katakana to fullwidth katakana.
+ # If you don't want it, use NKF.nkf('-jxm0', str).
def tojis(str)
- kconv(str, JIS)
+ ::NKF::nkf('-jm', str)
end
module_function :tojis
# call-seq:
- # Kconv.toeuc(str) => string
+ # Kconv.toeuc(str) -> string
#
# Convert <code>str</code> to EUC-JP
+ #
+ # *Note*
+ # This method decode MIME encoded string and
+ # convert halfwidth katakana to fullwidth katakana.
+ # If you don't want it, use NKF.nkf('-exm0', str).
def toeuc(str)
- kconv(str, EUC)
+ ::NKF::nkf('-em', str)
end
module_function :toeuc
# call-seq:
- # Kconv.tosjis(str) => string
+ # Kconv.tosjis(str) -> string
#
# Convert <code>str</code> to Shift_JIS
+ #
+ # *Note*
+ # This method decode MIME encoded string and
+ # convert halfwidth katakana to fullwidth katakana.
+ # If you don't want it, use NKF.nkf('-sxm0', str).
def tosjis(str)
- kconv(str, SJIS)
+ ::NKF::nkf('-sm', str)
end
module_function :tosjis
# call-seq:
- # Kconv.toutf8(str) => string
+ # Kconv.toutf8(str) -> string
#
# Convert <code>str</code> to UTF-8
+ #
+ # *Note*
+ # This method decode MIME encoded string and
+ # convert halfwidth katakana to fullwidth katakana.
+ # If you don't want it, use NKF.nkf('-wxm0', str).
def toutf8(str)
- kconv(str, UTF8)
+ ::NKF::nkf('-wm', str)
end
module_function :toutf8
# call-seq:
- # Kconv.toutf16(str) => string
+ # Kconv.toutf16(str) -> string
#
# Convert <code>str</code> to UTF-16
+ #
+ # *Note*
+ # This method decode MIME encoded string and
+ # convert halfwidth katakana to fullwidth katakana.
+ # If you don't want it, use NKF.nkf('-w16xm0', str).
def toutf16(str)
- kconv(str, UTF16)
+ ::NKF::nkf('-w16m', str)
end
module_function :toutf16
- # call-seq:
- # Kconv.toutf32(str) => string
- #
- # Convert <code>str</code> to UTF-32
- def toutf32(str)
- kconv(str, UTF32)
- end
- module_function :toutf32
-
- # call-seq:
- # Kconv.tolocale => string
- #
- # Convert <code>self</code> to locale encoding
- def tolocale(str)
- kconv(str, Encoding.locale_charmap)
- end
- module_function :tolocale
-
#
# guess
#
# call-seq:
- # Kconv.guess(str) => encoding
+ # Kconv.guess(str) -> integer
#
- # Guess input encoding by NKF.guess
+ # Guess input encoding by NKF.guess2
def guess(str)
::NKF::guess(str)
end
module_function :guess
+ # call-seq:
+ # Kconv.guess_old(str) -> integer
+ #
+ # Guess input encoding by NKF.guess1
+ def guess_old(str)
+ ::NKF::guess1(str)
+ end
+ module_function :guess_old
+
#
# isEncoding
#
# call-seq:
- # Kconv.iseuc(str) => true or false
+ # Kconv.iseuc(str) -> obj or nil
#
# Returns whether input encoding is EUC-JP or not.
#
# *Note* don't expect this return value is MatchData.
def iseuc(str)
- str.dup.force_encoding(EUC).valid_encoding?
+ RegexpEucjp.match( str )
end
module_function :iseuc
# call-seq:
- # Kconv.issjis(str) => true or false
+ # Kconv.issjis(str) -> obj or nil
#
# Returns whether input encoding is Shift_JIS or not.
+ #
+ # *Note* don't expect this return value is MatchData.
def issjis(str)
- str.dup.force_encoding(SJIS).valid_encoding?
+ RegexpShiftjis.match( str )
end
module_function :issjis
# call-seq:
- # Kconv.isjis(str) => true or false
- #
- # Returns whether input encoding is ISO-2022-JP or not.
- def isjis(str)
- /\A [\t\n\r\x20-\x7E]*
- (?:
- (?:\x1b \x28 I [\x21-\x7E]*
- |\x1b \x28 J [\x21-\x7E]*
- |\x1b \x24 @ (?:[\x21-\x7E]{2})*
- |\x1b \x24 B (?:[\x21-\x7E]{2})*
- |\x1b \x24 \x28 D (?:[\x21-\x7E]{2})*
- )*
- \x1b \x28 B [\t\n\r\x20-\x7E]*
- )*
- \z/nox =~ str.dup.force_encoding('BINARY') ? true : false
- end
- module_function :isjis
-
- # call-seq:
- # Kconv.isutf8(str) => true or false
+ # Kconv.isutf8(str) -> obj or nil
#
# Returns whether input encoding is UTF-8 or not.
+ #
+ # *Note* don't expect this return value is MatchData.
def isutf8(str)
- str.dup.force_encoding(UTF8).valid_encoding?
+ RegexpUtf8.match( str )
end
module_function :isutf8
+
end
class String
# call-seq:
- # String#kconv(to_enc, from_enc)
+ # String#kconv(out_code, in_code = Kconv::AUTO)
#
# Convert <code>self</code> to out_code.
# <code>out_code</code> and <code>in_code</code> are given as constants of Kconv.
- def kconv(to_enc, from_enc=nil)
- form_enc = self.encoding if !from_enc && self.encoding != Encoding.list[0]
- Kconv::kconv(self, to_enc, from_enc)
+ #
+ # *Note*
+ # This method decode MIME encoded string and
+ # convert halfwidth katakana to fullwidth katakana.
+ # If you don't want to decode them, use NKF.nkf.
+ def kconv(out_code, in_code=Kconv::AUTO)
+ Kconv::kconv(self, out_code, in_code)
end
-
+
#
# to Encoding
#
-
+
# call-seq:
- # String#tojis => string
+ # String#tojis -> string
#
# Convert <code>self</code> to ISO-2022-JP
+ #
+ # *Note*
+ # This method decode MIME encoded string and
+ # convert halfwidth katakana to fullwidth katakana.
+ # If you don't want it, use NKF.nkf('-jxm0', str).
def tojis; Kconv.tojis(self) end
# call-seq:
- # String#toeuc => string
+ # String#toeuc -> string
#
# Convert <code>self</code> to EUC-JP
+ #
+ # *Note*
+ # This method decode MIME encoded string and
+ # convert halfwidth katakana to fullwidth katakana.
+ # If you don't want it, use NKF.nkf('-exm0', str).
def toeuc; Kconv.toeuc(self) end
# call-seq:
- # String#tosjis => string
+ # String#tosjis -> string
#
# Convert <code>self</code> to Shift_JIS
+ #
+ # *Note*
+ # This method decode MIME encoded string and
+ # convert halfwidth katakana to fullwidth katakana.
+ # If you don't want it, use NKF.nkf('-sxm0', str).
def tosjis; Kconv.tosjis(self) end
# call-seq:
- # String#toutf8 => string
+ # String#toutf8 -> string
#
# Convert <code>self</code> to UTF-8
+ #
+ # *Note*
+ # This method decode MIME encoded string and
+ # convert halfwidth katakana to fullwidth katakana.
+ # If you don't want it, use NKF.nkf('-wxm0', str).
def toutf8; Kconv.toutf8(self) end
# call-seq:
- # String#toutf16 => string
+ # String#toutf16 -> string
#
# Convert <code>self</code> to UTF-16
- def toutf16; Kconv.toutf16(self) end
-
- # call-seq:
- # String#toutf32 => string
#
- # Convert <code>self</code> to UTF-32
- def toutf32; Kconv.toutf32(self) end
-
- # call-seq:
- # String#tolocale => string
- #
- # Convert <code>self</code> to locale encoding
- def tolocale; Kconv.tolocale(self) end
+ # *Note*
+ # This method decode MIME encoded string and
+ # convert halfwidth katakana to fullwidth katakana.
+ # If you don't want it, use NKF.nkf('-w16xm0', str).
+ def toutf16; Kconv.toutf16(self) end
#
# is Encoding
#
# call-seq:
- # String#iseuc => true or false
+ # String#iseuc -> obj or nil
#
# Returns whether <code>self</code>'s encoding is EUC-JP or not.
+ #
+ # *Note* don't expect this return value is MatchData.
def iseuc; Kconv.iseuc(self) end
# call-seq:
- # String#issjis => true or false
+ # String#issjis -> obj or nil
#
# Returns whether <code>self</code>'s encoding is Shift_JIS or not.
- def issjis; Kconv.issjis(self) end
-
- # call-seq:
- # String#isjis => true or false
#
- # Returns whether <code>self</code>'s encoding is ISO-2022-JP or not.
- def isjis; Kconv.isjis(self) end
+ # *Note* don't expect this return value is MatchData.
+ def issjis; Kconv.issjis(self) end
# call-seq:
- # String#isutf8 => true or false
+ # String#isutf8 -> obj or nil
#
# Returns whether <code>self</code>'s encoding is UTF-8 or not.
+ #
+ # *Note* don't expect this return value is MatchData.
def isutf8; Kconv.isutf8(self) end
end
diff --git a/ext/nkf/nkf-utf8/config.h b/ext/nkf/nkf-utf8/config.h
index 752ed38d59..9da82c6aee 100644
--- a/ext/nkf/nkf-utf8/config.h
+++ b/ext/nkf/nkf-utf8/config.h
@@ -1,51 +1,88 @@
#ifndef _CONFIG_H_
#define _CONFIG_H_
-/* UTF8 input and output */
+/* UTF8 $BF~=PNO(B */
#define UTF8_INPUT_ENABLE
#define UTF8_OUTPUT_ENABLE
-/* invert characters invalid in Shift_JIS to CP932 */
+/* Shift_JIS $BHO0O30$NJ8;z$r!"(BCP932 $B$GF1CM$JJ8;z$KFI$_49$($k(B */
#define SHIFTJIS_CP932
-/* fix input encoding when given by option */
+/* $B%*%W%7%g%s$GF~NO$r;XDj$7$?;~$K!"J8;z%3!<%I$r8GDj$9$k(B */
#define INPUT_CODE_FIX
-/* --overwrite option */
+/* --overwrite $B%*%W%7%g%s(B */
/* by Satoru Takabayashi <ccsatoru@vega.aichi-u.ac.jp> */
#define OVERWRITE
-/* --cap-input, --url-input option */
+/* --cap-input, --url-input $B%*%W%7%g%s(B */
#define INPUT_OPTION
-/* --numchar-input option */
+/* --numchar-input $B%*%W%7%g%s(B */
#define NUMCHAR_OPTION
-/* --debug, --no-output option */
+/* --debug, --no-output $B%*%W%7%g%s(B */
#define CHECK_OPTION
/* JIS X0212 */
#define X0212_ENABLE
-/* --exec-in, --exec-out option
- * require pipe, fork, execvp and so on.
- * please undef this on MS-DOS, MinGW
- * this is still buggy arround child process
+/* --exec-in, --exec-out $B%*%W%7%g%s(B
+ * pipe, fork, execvp $B$"$?$j$,L5$$$HF0$-$^$;$s!#(B
+ * MS-DOS, MinGW $B$J$I$G$O(B undef $B$K$7$F$/$@$5$$(B
+ * child process $B=*N;;~$N=hM}$,$$$$$+$2$s$J$N$G!"(B
+ * $B%G%U%)%k%H$GL58z$K$7$F$$$^$9!#(B
*/
/* #define EXEC_IO */
+/* SunOS $B$N(B cc $B$r;H$&$H$-$O(B undef $B$K$7$F$/$@$5$$(B */
+#define ANSI_C_PROTOTYPE
+
+/* int $B$,(B 32bit $BL$K~$N4D6-$G(B NUMCHAR_OPTION $B$r;H$&$K$O!"(B
+ * $B%3%a%s%H$r30$7$F$/$@$5$$!#(B
+ */
+/* #define INT_IS_SHORT */
+
+
+#if defined(INT_IS_SHORT)
+typedef long nkf_char;
+typedef unsigned char nkf_nfchar;
+#else
+typedef int nkf_char;
+typedef int nkf_nfchar;
+#endif
+
/* Unicode Normalization */
#define UNICODE_NORMALIZATION
-/*
- * Select Default Output Encoding
- *
- */
+#ifndef WIN32DLL
+/******************************/
+/* $B%G%U%)%k%H$N=PNO%3!<%IA*Br(B */
+/* Select DEFAULT_CODE */
+#define DEFAULT_CODE_JIS
+/* #define DEFAULT_CODE_SJIS */
+/* #define DEFAULT_CODE_EUC */
+/* #define DEFAULT_CODE_UTF8 */
+/******************************/
+#else
+#define DEFAULT_CODE_SJIS
+#endif
+
+#if defined(NUMCHAR_OPTION) && !defined(UTF8_INPUT_ENABLE)
+#define UTF8_INPUT_ENABLE
+#endif
-/* #define DEFAULT_CODE_JIS */
-/* #define DEFAULT_CODE_SJIS */
-/* #define DEFAULT_CODE_WINDOWS_31J */
-/* #define DEFAULT_CODE_EUC */
-/* #define DEFAULT_CODE_UTF8 */
+#ifdef UNICODE_NORMALIZATION
+#ifndef UTF8_INPUT_ENABLE
+#define UTF8_INPUT_ENABLE
+#endif
+#define NORMALIZATION_TABLE_LENGTH 942
+#define NORMALIZATION_TABLE_NFC_LENGTH 3
+#define NORMALIZATION_TABLE_NFD_LENGTH 9
+struct normalization_pair{
+ const nkf_nfchar nfc[NORMALIZATION_TABLE_NFC_LENGTH];
+ const nkf_nfchar nfd[NORMALIZATION_TABLE_NFD_LENGTH];
+};
+#endif
#endif /* _CONFIG_H_ */
diff --git a/ext/nkf/nkf-utf8/nkf.c b/ext/nkf/nkf-utf8/nkf.c
index da1c766b4a..9a31c9d879 100644
--- a/ext/nkf/nkf-utf8/nkf.c
+++ b/ext/nkf/nkf-utf8/nkf.c
@@ -1,301 +1,290 @@
-/*
- * Copyright (c) 1987, Fujitsu LTD. (Itaru ICHIKAWA).
- * Copyright (c) 1996-2009, 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
- * arising from the use of this software.
- *
- * Permission is granted to anyone to use this software for any purpose,
- * including commercial applications, and to alter it and redistribute it
- * freely, subject to the following restrictions:
- *
- * 1. The origin of this software must not be misrepresented; you must not
- * claim that you wrote the original software. If you use this software
- * in a product, an acknowledgment in the product documentation would be
- * appreciated but is not required.
- *
- * 2. Altered source versions must be plainly marked as such, and must not be
- * misrepresented as being the original software.
- *
- * 3. This notice may not be removed or altered from any source distribution.
- */
-#define NKF_VERSION "2.0.9"
-#define NKF_RELEASE_DATE "2009-01-20"
-#define COPY_RIGHT \
- "Copyright (C) 1987, FUJITSU LTD. (I.Ichikawa).\n" \
- "Copyright (C) 1996-2009, The nkf Project."
-
+/** Network Kanji Filter. (PDS Version)
+************************************************************************
+** Copyright (C) 1987, Fujitsu LTD. (Itaru ICHIKAWA)
+** $BO"Mm@h!'(B $B!J3t!KIY;NDL8&5f=j!!%=%U%H#38&!!;T@n!!;j(B
+** $B!J(BE-Mail Address: ichikawa@flab.fujitsu.co.jp$B!K(B
+** Copyright (C) 1996,1998
+** Copyright (C) 2002
+** $BO"Mm@h!'(B $BN05eBg3X>pJs9)3X2J(B $B2OLn(B $B??<#(B mime/X0208 support
+** $B!J(BE-Mail Address: kono@ie.u-ryukyu.ac.jp$B!K(B
+** $BO"Mm@h!'(B COW for DOS & Win16 & Win32 & OS/2
+** $B!J(BE-Mail Address: GHG00637@niftyserve.or.p$B!K(B
+**
+** $B$3$N%=!<%9$N$$$+$J$kJ#<L!$2~JQ!$=$@5$b5vBz$7$^$9!#$?$@$7!"(B
+** $B$=$N:]$K$O!"C/$,9W8%$7$?$r<($9$3$NItJ,$r;D$9$3$H!#(B
+** $B:FG[I[$d;(;o$NIUO?$J$I$NLd$$9g$o$;$bI,MW$"$j$^$;$s!#(B
+** $B1DMxMxMQ$b>e5-$KH?$7$J$$HO0O$G5v2D$7$^$9!#(B
+** $B%P%$%J%j$NG[I[$N:]$K$O(Bversion message$B$rJ]B8$9$k$3$H$r>r7o$H$7$^$9!#(B
+** $B$3$N%W%m%0%i%`$K$D$$$F$OFC$K2?$NJ]>Z$b$7$J$$!"0-$7$+$i$:!#(B
+**
+** 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.
+***********************************************************************/
+
+/***********************************************************************
+** UTF-8 $B%5%]!<%H$K$D$$$F(B
+** $B=>Mh$N(B nkf $B$HF~$l$+$($F$=$N$^$^;H$($k$h$&$K$J$C$F$$$^$9(B
+** nkf -e $B$J$I$H$7$F5/F0$9$k$H!"<+F0H=JL$G(B UTF-8 $B$HH=Dj$5$l$l$P!"(B
+** $B$=$N$^$^(B euc-jp $B$KJQ49$5$l$^$9(B
+**
+** $B$^$@%P%0$,$"$k2DG=@-$,9b$$$G$9!#(B
+** ($BFC$K<+F0H=JL!"%3!<%I:.:_!"%(%i!<=hM}7O(B)
+**
+** $B2?$+LdBj$r8+$D$1$?$i!"(B
+** E-Mail: furukawa@tcp-ip.or.jp
+** $B$^$G8fO"Mm$r$*4j$$$7$^$9!#(B
+***********************************************************************/
+/* $Id$ */
+#define NKF_VERSION "2.0.8"
+#define NKF_RELEASE_DATE "2008-11-08"
#include "config.h"
-#include "nkf.h"
#include "utf8tbl.h"
-#ifdef __WIN32__
+
+#define COPY_RIGHT \
+ "Copyright (C) 1987, FUJITSU LTD. (I.Ichikawa),2000 S. Kono, COW\n" \
+ "Copyright (C) 2002-2008 Kono, Furukawa, Naruse, mastodon"
+
+
+/*
+**
+**
+**
+** USAGE: nkf [flags] [file]
+**
+** Flags:
+** b Output is buffered (DEFAULT)
+** u Output is unbuffered
+**
+** t no operation
+**
+** j Output code is JIS 7 bit (DEFAULT SELECT)
+** s Output code is MS Kanji (DEFAULT SELECT)
+** e Output code is AT&T JIS (DEFAULT SELECT)
+** w Output code is AT&T JIS (DEFAULT SELECT)
+** l Output code is JIS 7bit and ISO8859-1 Latin-1
+**
+** m MIME conversion for ISO-2022-JP
+** I Convert non ISO-2022-JP charactor to GETA by Pekoe <pekoe@lair.net>
+** i_ Output sequence to designate JIS-kanji (DEFAULT_J)
+** o_ Output sequence to designate single-byte roman characters (DEFAULT_R)
+** M MIME output conversion
+**
+** r {de/en}crypt ROT13/47
+**
+** v display Version
+**
+** T Text mode output (for MS-DOS)
+**
+** x Do not convert X0201 kana into X0208
+** Z Convert X0208 alphabet to ASCII
+**
+** f60 fold option
+**
+** m MIME decode
+** B try to fix broken JIS, missing Escape
+** B[1-9] broken level
+**
+** O Output to 'nkf.out' file or last file name
+** d Delete \r in line feed
+** c Add \r in line feed
+** -- other long option
+** -- ignore following option (don't use with -O )
+**
+**/
+
+#if (defined(__TURBOC__) || defined(_MSC_VER) || defined(LSI_C) || defined(__MINGW32__) || defined(__EMX__) || defined(__MSDOS__) || defined(__WINDOWS__) || defined(__DOS__) || defined(__OS2__)) && !defined(MSDOS)
+#define MSDOS
+#if (defined(__Win32__) || defined(_WIN32)) && !defined(__WIN32__)
+#define __WIN32__
+#endif
+#endif
+
+#ifdef PERL_XS
+#undef OVERWRITE
+#endif
+
+#ifndef PERL_XS
+#include <stdio.h>
+#endif
+
+#include <stdlib.h>
+#include <string.h>
+
+#if defined(MSDOS) || defined(__OS2__)
+#include <fcntl.h>
+#include <io.h>
+#if defined(_MSC_VER) || defined(__WATCOMC__)
+#define mktemp _mktemp
+#endif
+#endif
+
+#ifdef MSDOS
+#ifdef LSI_C
+#define setbinmode(fp) fsetbin(fp)
+#elif defined(__DJGPP__)
+#include <libc/dosio.h>
+#define setbinmode(fp) djgpp_setbinmode(fp)
+#else /* Microsoft C, Turbo C */
+#define setbinmode(fp) setmode(fileno(fp), O_BINARY)
+#endif
+#else /* UNIX */
+#define setbinmode(fp)
+#endif
+
+#if defined(__DJGPP__)
+void djgpp_setbinmode(FILE *fp)
+{
+ /* we do not use libc's setmode(), which changes COOKED/RAW mode in device. */
+ int fd, m;
+ fd = fileno(fp);
+ m = (__file_handle_modes[fd] & (~O_TEXT)) | O_BINARY;
+ __file_handle_set(fd, m);
+}
+#endif
+
+#ifdef _IOFBF /* SysV and MSDOS, Windows */
+#define setvbuffer(fp, buf, size) setvbuf(fp, buf, _IOFBF, size)
+#else /* BSD */
+#define setvbuffer(fp, buf, size) setbuffer(fp, buf, size)
+#endif
+
+/*Borland C++ 4.5 EasyWin*/
+#if defined(__TURBOC__) && defined(_Windows) && !defined(__WIN32__) /*Easy Win */
+#define EASYWIN
+#ifndef __WIN16__
+#define __WIN16__
+#endif
#include <windows.h>
-#include <locale.h>
#endif
-#if defined(__OS2__)
-# define INCL_DOS
-# define INCL_DOSERRORS
-# include <os2.h>
+
+#ifdef OVERWRITE
+/* added by satoru@isoternet.org */
+#if defined(__EMX__)
+#include <sys/types.h>
+#endif
+#include <sys/stat.h>
+#if !defined(MSDOS) || defined(__DJGPP__) /* UNIX, djgpp */
+#include <unistd.h>
+#if defined(__WATCOMC__)
+#include <sys/utime.h>
+#else
+#include <utime.h>
+#endif
+#else /* defined(MSDOS) */
+#ifdef __WIN32__
+#ifdef __BORLANDC__ /* BCC32 */
+#include <utime.h>
+#else /* !defined(__BORLANDC__) */
+#include <sys/utime.h>
+#endif /* (__BORLANDC__) */
+#else /* !defined(__WIN32__) */
+#if defined(_MSC_VER) || defined(__MINGW32__) || defined(__WATCOMC__) || defined(__OS2__) || defined(__EMX__) || defined(__IBMC__) || defined(__IBMCPP__) /* VC++, MinGW, Watcom, emx+gcc, IBM VAC++ */
+#include <sys/utime.h>
+#elif defined(__TURBOC__) /* BCC */
+#include <utime.h>
+#elif defined(LSI_C) /* LSI C */
+#endif /* (__WIN32__) */
+#endif
+#endif
#endif
-#include <assert.h>
+#define FALSE 0
+#define TRUE 1
-/* state of output_mode and input_mode
+/* state of output_mode and input_mode
c2 0 means ASCII
- JIS_X_0201_1976_K
- ISO_8859_1
- JIS_X_0208
- EOF all termination
+ X0201
+ ISO8859_1
+ X0208
+ EOF all termination
c1 32bit data
*/
-/* MIME ENCODE */
-
+#define ASCII 0
+#define X0208 1
+#define X0201 2
+#define ISO8859_1 8
+#define NO_X0201 3
+#define X0212 0x2844
+#define X0213_1 0x284F
+#define X0213_2 0x2850
+
+/* Input Assumption */
+
+#define JIS_INPUT 4
+#define EUC_INPUT 16
+#define SJIS_INPUT 5
+#define LATIN1_INPUT 6
#define FIXED_MIME 7
#define STRICT_MIME 8
+/* MIME ENCODE */
+
+#define ISO2022JP 9
+#define JAPANESE_EUC 10
+#define SHIFT_JIS 11
+
+#define UTF8 12
+#define UTF8_INPUT 13
+#define UTF16_INPUT 1015
+#define UTF32_INPUT 1017
+
/* byte order */
-enum byte_order {
- ENDIAN_BIG = 1,
- ENDIAN_LITTLE = 2,
- ENDIAN_2143 = 3,
- ENDIAN_3412 = 4
-};
+
+#define ENDIAN_BIG 1234
+#define ENDIAN_LITTLE 4321
+#define ENDIAN_2143 2143
+#define ENDIAN_3412 3412
+
+#define WISH_TRUE 15
/* ASCII CODE */
#define BS 0x08
#define TAB 0x09
-#define LF 0x0a
+#define NL 0x0a
#define CR 0x0d
#define ESC 0x1b
-#define SP 0x20
+#define SPACE 0x20
+#define AT 0x40
+#define SSP 0xa0
#define DEL 0x7f
#define SI 0x0f
#define SO 0x0e
-#define SS2 0x8e
+#define SSO 0x8e
#define SS3 0x8f
-#define CRLF 0x0D0A
-
-
-/* encodings */
-
-enum nkf_encodings {
- ASCII,
- ISO_8859_1,
- ISO_2022_JP,
- CP50220,
- CP50221,
- CP50222,
- ISO_2022_JP_1,
- ISO_2022_JP_3,
- ISO_2022_JP_2004,
- SHIFT_JIS,
- WINDOWS_31J,
- CP10001,
- EUC_JP,
- EUCJP_NKF,
- CP51932,
- EUCJP_MS,
- EUCJP_ASCII,
- SHIFT_JISX0213,
- SHIFT_JIS_2004,
- EUC_JISX0213,
- EUC_JIS_2004,
- UTF_8,
- UTF_8N,
- UTF_8_BOM,
- UTF8_MAC,
- UTF_16,
- UTF_16BE,
- UTF_16BE_BOM,
- UTF_16LE,
- UTF_16LE_BOM,
- UTF_32,
- UTF_32BE,
- UTF_32BE_BOM,
- UTF_32LE,
- UTF_32LE_BOM,
- BINARY,
- NKF_ENCODING_TABLE_SIZE,
- JIS_X_0201_1976_K = 0x1013, /* I */ /* JIS C 6220-1969 */
- /* JIS_X_0201_1976_R = 0x1014, */ /* J */ /* JIS C 6220-1969 */
- /* JIS_X_0208_1978 = 0x1040, */ /* @ */ /* JIS C 6226-1978 */
- /* JIS_X_0208_1983 = 0x1087, */ /* B */ /* JIS C 6226-1983 */
- JIS_X_0208 = 0x1168, /* @B */
- JIS_X_0212 = 0x1159, /* D */
- /* JIS_X_0213_2000_1 = 0x1228, */ /* O */
- JIS_X_0213_2 = 0x1229, /* P */
- JIS_X_0213_1 = 0x1233 /* Q */
-};
-
-static nkf_char s_iconv(nkf_char c2, nkf_char c1, nkf_char c0);
-static nkf_char e_iconv(nkf_char c2, nkf_char c1, nkf_char c0);
-static nkf_char w_iconv(nkf_char c2, nkf_char c1, nkf_char c0);
-static nkf_char w_iconv16(nkf_char c2, nkf_char c1, nkf_char c0);
-static nkf_char w_iconv32(nkf_char c2, nkf_char c1, nkf_char c0);
-static void j_oconv(nkf_char c2, nkf_char c1);
-static void s_oconv(nkf_char c2, nkf_char c1);
-static void e_oconv(nkf_char c2, nkf_char c1);
-static void w_oconv(nkf_char c2, nkf_char c1);
-static void w_oconv16(nkf_char c2, nkf_char c1);
-static void w_oconv32(nkf_char c2, nkf_char c1);
-
-typedef struct {
- const char *name;
- nkf_char (*iconv)(nkf_char c2, nkf_char c1, nkf_char c0);
- void (*oconv)(nkf_char c2, nkf_char c1);
-} nkf_native_encoding;
-
-nkf_native_encoding NkfEncodingASCII = { "ASCII", e_iconv, e_oconv };
-nkf_native_encoding NkfEncodingISO_2022_JP = { "ISO-2022-JP", e_iconv, j_oconv };
-nkf_native_encoding NkfEncodingShift_JIS = { "Shift_JIS", s_iconv, s_oconv };
-nkf_native_encoding NkfEncodingEUC_JP = { "EUC-JP", e_iconv, e_oconv };
-nkf_native_encoding NkfEncodingUTF_8 = { "UTF-8", w_iconv, w_oconv };
-nkf_native_encoding NkfEncodingUTF_16 = { "UTF-16", w_iconv16, w_oconv16 };
-nkf_native_encoding NkfEncodingUTF_32 = { "UTF-32", w_iconv32, w_oconv32 };
-
-typedef struct {
- const int id;
- const char *name;
- const nkf_native_encoding *base_encoding;
-} nkf_encoding;
-
-nkf_encoding nkf_encoding_table[] = {
- {ASCII, "US-ASCII", &NkfEncodingASCII},
- {ISO_8859_1, "ISO-8859-1", &NkfEncodingASCII},
- {ISO_2022_JP, "ISO-2022-JP", &NkfEncodingISO_2022_JP},
- {CP50220, "CP50220", &NkfEncodingISO_2022_JP},
- {CP50221, "CP50221", &NkfEncodingISO_2022_JP},
- {CP50222, "CP50222", &NkfEncodingISO_2022_JP},
- {ISO_2022_JP_1, "ISO-2022-JP-1", &NkfEncodingISO_2022_JP},
- {ISO_2022_JP_3, "ISO-2022-JP-3", &NkfEncodingISO_2022_JP},
- {ISO_2022_JP_2004, "ISO-2022-JP-2004", &NkfEncodingISO_2022_JP},
- {SHIFT_JIS, "Shift_JIS", &NkfEncodingShift_JIS},
- {WINDOWS_31J, "Windows-31J", &NkfEncodingShift_JIS},
- {CP10001, "CP10001", &NkfEncodingShift_JIS},
- {EUC_JP, "EUC-JP", &NkfEncodingEUC_JP},
- {EUCJP_NKF, "eucJP-nkf", &NkfEncodingEUC_JP},
- {CP51932, "CP51932", &NkfEncodingEUC_JP},
- {EUCJP_MS, "eucJP-MS", &NkfEncodingEUC_JP},
- {EUCJP_ASCII, "eucJP-ASCII", &NkfEncodingEUC_JP},
- {SHIFT_JISX0213, "Shift_JISX0213", &NkfEncodingShift_JIS},
- {SHIFT_JIS_2004, "Shift_JIS-2004", &NkfEncodingShift_JIS},
- {EUC_JISX0213, "EUC-JISX0213", &NkfEncodingEUC_JP},
- {EUC_JIS_2004, "EUC-JIS-2004", &NkfEncodingEUC_JP},
- {UTF_8, "UTF-8", &NkfEncodingUTF_8},
- {UTF_8N, "UTF-8N", &NkfEncodingUTF_8},
- {UTF_8_BOM, "UTF-8-BOM", &NkfEncodingUTF_8},
- {UTF8_MAC, "UTF8-MAC", &NkfEncodingUTF_8},
- {UTF_16, "UTF-16", &NkfEncodingUTF_16},
- {UTF_16BE, "UTF-16BE", &NkfEncodingUTF_16},
- {UTF_16BE_BOM, "UTF-16BE-BOM", &NkfEncodingUTF_16},
- {UTF_16LE, "UTF-16LE", &NkfEncodingUTF_16},
- {UTF_16LE_BOM, "UTF-16LE-BOM", &NkfEncodingUTF_16},
- {UTF_32, "UTF-32", &NkfEncodingUTF_32},
- {UTF_32BE, "UTF-32BE", &NkfEncodingUTF_32},
- {UTF_32BE_BOM, "UTF-32BE-BOM", &NkfEncodingUTF_32},
- {UTF_32LE, "UTF-32LE", &NkfEncodingUTF_32},
- {UTF_32LE_BOM, "UTF-32LE-BOM", &NkfEncodingUTF_32},
- {BINARY, "BINARY", &NkfEncodingASCII},
- {-1, NULL, NULL}
-};
-
-struct {
- const char *name;
- const int id;
-} encoding_name_to_id_table[] = {
- {"US-ASCII", ASCII},
- {"ASCII", ASCII},
- {"ISO-2022-JP", ISO_2022_JP},
- {"ISO2022JP-CP932", CP50220},
- {"CP50220", CP50220},
- {"CP50221", CP50221},
- {"CSISO2022JP", CP50221},
- {"CP50222", CP50222},
- {"ISO-2022-JP-1", ISO_2022_JP_1},
- {"ISO-2022-JP-3", ISO_2022_JP_3},
- {"ISO-2022-JP-2004", ISO_2022_JP_2004},
- {"SHIFT_JIS", SHIFT_JIS},
- {"SJIS", SHIFT_JIS},
- {"WINDOWS-31J", WINDOWS_31J},
- {"CSWINDOWS31J", WINDOWS_31J},
- {"CP932", WINDOWS_31J},
- {"MS932", WINDOWS_31J},
- {"CP10001", CP10001},
- {"EUCJP", EUC_JP},
- {"EUC-JP", EUC_JP},
- {"EUCJP-NKF", EUCJP_NKF},
- {"CP51932", CP51932},
- {"EUC-JP-MS", EUCJP_MS},
- {"EUCJP-MS", EUCJP_MS},
- {"EUCJPMS", EUCJP_MS},
- {"EUC-JP-ASCII", EUCJP_ASCII},
- {"EUCJP-ASCII", EUCJP_ASCII},
- {"SHIFT_JISX0213", SHIFT_JISX0213},
- {"SHIFT_JIS-2004", SHIFT_JIS_2004},
- {"EUC-JISX0213", EUC_JISX0213},
- {"EUC-JIS-2004", EUC_JIS_2004},
- {"UTF-8", UTF_8},
- {"UTF-8N", UTF_8N},
- {"UTF-8-BOM", UTF_8_BOM},
- {"UTF8-MAC", UTF8_MAC},
- {"UTF-8-MAC", UTF8_MAC},
- {"UTF-16", UTF_16},
- {"UTF-16BE", UTF_16BE},
- {"UTF-16BE-BOM", UTF_16BE_BOM},
- {"UTF-16LE", UTF_16LE},
- {"UTF-16LE-BOM", UTF_16LE_BOM},
- {"UTF-32", UTF_32},
- {"UTF-32BE", UTF_32BE},
- {"UTF-32BE-BOM", UTF_32BE_BOM},
- {"UTF-32LE", UTF_32LE},
- {"UTF-32LE-BOM", UTF_32LE_BOM},
- {"BINARY", BINARY},
- {NULL, -1}
-};
-
-#if defined(DEFAULT_CODE_JIS)
-#define DEFAULT_ENCIDX ISO_2022_JP
-#elif defined(DEFAULT_CODE_SJIS)
-#define DEFAULT_ENCIDX SHIFT_JIS
-#elif defined(DEFAULT_CODE_WINDOWS_31J)
-#define DEFAULT_ENCIDX WINDOWS_31J
-#elif defined(DEFAULT_CODE_EUC)
-#define DEFAULT_ENCIDX EUC_JP
-#elif defined(DEFAULT_CODE_UTF8)
-#define DEFAULT_ENCIDX UTF_8
-#endif
-
#define is_alnum(c) \
- (('a'<=c && c<='z')||('A'<= c && c<='Z')||('0'<=c && c<='9'))
+ (('a'<=c && c<='z')||('A'<= c && c<='Z')||('0'<=c && c<='9'))
/* I don't trust portablity of toupper */
#define nkf_toupper(c) (('a'<=c && c<='z')?(c-('a'-'A')):c)
#define nkf_isoctal(c) ('0'<=c && c<='7')
#define nkf_isdigit(c) ('0'<=c && c<='9')
#define nkf_isxdigit(c) (nkf_isdigit(c) || ('a'<=c && c<='f') || ('A'<=c && c <= 'F'))
-#define nkf_isblank(c) (c == SP || c == TAB)
-#define nkf_isspace(c) (nkf_isblank(c) || c == CR || c == LF)
+#define nkf_isblank(c) (c == SPACE || c == TAB)
+#define nkf_isspace(c) (nkf_isblank(c) || c == CR || c == NL)
#define nkf_isalpha(c) (('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z'))
#define nkf_isalnum(c) (nkf_isdigit(c) || nkf_isalpha(c))
-#define nkf_isprint(c) (SP<=c && c<='~')
+#define nkf_isprint(c) (' '<=c && c<='~')
#define nkf_isgraph(c) ('!'<=c && c<='~')
#define hex2bin(c) (('0'<=c&&c<='9') ? (c-'0') : \
- ('A'<=c&&c<='F') ? (c-'A'+10) : \
- ('a'<=c&&c<='f') ? (c-'a'+10) : 0)
-#define bin2hex(c) ("0123456789ABCDEF"[c&15])
+ ('A'<=c&&c<='F') ? (c-'A'+10) : \
+ ('a'<=c&&c<='f') ? (c-'a'+10) : 0 )
#define is_eucg3(c2) (((unsigned short)c2 >> 8) == SS3)
-#define nkf_noescape_mime(c) ((c == CR) || (c == LF) || \
- ((c > SP) && (c < DEL) && (c != '?') && (c != '=') && (c != '_') \
- && (c != '(') && (c != ')') && (c != '.') && (c != 0x22)))
+#define CP932_TABLE_BEGIN 0xFA
+#define CP932_TABLE_END 0xFC
+#define CP932INV_TABLE_BEGIN 0xED
+#define CP932INV_TABLE_END 0xEE
#define is_ibmext_in_sjis(c2) (CP932_TABLE_BEGIN <= c2 && c2 <= CP932_TABLE_END)
-#define nkf_byte_jisx0201_katakana_p(c) (SP <= c && c < (0xE0&0x7F))
#define HOLD_SIZE 1024
#if defined(INT_IS_SHORT)
@@ -307,11 +296,23 @@ struct {
#define DEFAULT_J 'B'
#define DEFAULT_R 'B'
+#define SJ0162 0x00e1 /* 01 - 62 ku offset */
+#define SJ6394 0x0161 /* 63 - 94 ku offset */
+#define RANGE_NUM_MAX 18
#define GETA1 0x22
#define GETA2 0x2e
+#if defined(UTF8_OUTPUT_ENABLE) || defined(UTF8_INPUT_ENABLE)
+#define sizeof_euc_to_utf8_1byte 94
+#define sizeof_euc_to_utf8_2bytes 94
+#define sizeof_utf8_to_euc_C2 64
+#define sizeof_utf8_to_euc_E5B8 64
+#define sizeof_utf8_to_euc_2bytes 112
+#define sizeof_utf8_to_euc_3bytes 16
+#endif
+
/* MIME preprocessor */
#ifdef EASYWIN /*Easy Win */
@@ -319,7 +320,7 @@ extern POINT _BufferSize;
#endif
struct input_code{
- const char *name;
+ char *name;
nkf_char stat;
nkf_char score;
nkf_char index;
@@ -329,21 +330,31 @@ struct input_code{
int _file_stat;
};
-static const char *input_codename = NULL; /* NULL: unestablished, "": BINARY */
-static nkf_encoding *input_encoding = NULL;
-static nkf_encoding *output_encoding = NULL;
+static char *input_codename = "";
+#ifndef PERL_XS
+static const char *CopyRight = COPY_RIGHT;
+#endif
+#if !defined(PERL_XS) && !defined(WIN32DLL)
+static nkf_char noconvert(FILE *f);
+#endif
+static void module_connection(void);
+static nkf_char kanji_convert(FILE *f);
+static nkf_char h_conv(FILE *f,nkf_char c2,nkf_char c1);
+static nkf_char push_hold_buf(nkf_char c2);
+static void set_iconv(nkf_char f, nkf_char (*iconv_func)(nkf_char c2,nkf_char c1,nkf_char c0));
+static nkf_char s_iconv(nkf_char c2,nkf_char c1,nkf_char c0);
+static nkf_char s2e_conv(nkf_char c2, nkf_char c1, nkf_char *p2, nkf_char *p1);
+static nkf_char e_iconv(nkf_char c2,nkf_char c1,nkf_char c0);
#if defined(UTF8_INPUT_ENABLE) || defined(UTF8_OUTPUT_ENABLE)
/* UCS Mapping
* 0: Shift_JIS, eucJP-ascii
* 1: eucJP-ms
* 2: CP932, CP51932
- * 3: CP10001
*/
-#define UCS_MAP_ASCII 0
-#define UCS_MAP_MS 1
-#define UCS_MAP_CP932 2
-#define UCS_MAP_CP10001 3
+#define UCS_MAP_ASCII 0
+#define UCS_MAP_MS 1
+#define UCS_MAP_CP932 2
static int ms_ucs_map_f = UCS_MAP_ASCII;
#endif
#ifdef UTF8_INPUT_ENABLE
@@ -353,13 +364,48 @@ static int no_cp932ext_f = FALSE;
static int no_best_fit_chars_f = FALSE;
static int input_endian = ENDIAN_BIG;
static nkf_char unicode_subchar = '?'; /* the regular substitution character */
+static void nkf_each_char_to_hex(void (*f)(nkf_char c2,nkf_char c1), nkf_char c);
+static void encode_fallback_html(nkf_char c);
+static void encode_fallback_xml(nkf_char c);
+static void encode_fallback_java(nkf_char c);
+static void encode_fallback_perl(nkf_char c);
+static void encode_fallback_subchar(nkf_char c);
static void (*encode_fallback)(nkf_char c) = NULL;
+static nkf_char w2e_conv(nkf_char c2,nkf_char c1,nkf_char c0,nkf_char *p2,nkf_char *p1);
+static nkf_char w_iconv(nkf_char c2,nkf_char c1,nkf_char c0);
+static nkf_char w_iconv16(nkf_char c2,nkf_char c1,nkf_char c0);
+static nkf_char w_iconv32(nkf_char c2,nkf_char c1,nkf_char c0);
+static nkf_char unicode_to_jis_common(nkf_char c2,nkf_char c1,nkf_char c0,nkf_char *p2,nkf_char *p1);
+static nkf_char w_iconv_common(nkf_char c1,nkf_char c0,const unsigned short *const *pp,nkf_char psize,nkf_char *p2,nkf_char *p1);
+static void w16w_conv(nkf_char val, nkf_char *p2, nkf_char *p1, nkf_char *p0);
+static nkf_char ww16_conv(nkf_char c2, nkf_char c1, nkf_char c0);
+static nkf_char w16e_conv(nkf_char val,nkf_char *p2,nkf_char *p1);
static void w_status(struct input_code *, nkf_char);
#endif
#ifdef UTF8_OUTPUT_ENABLE
static int output_bom_f = FALSE;
static int output_endian = ENDIAN_BIG;
-#endif
+static nkf_char e2w_conv(nkf_char c2,nkf_char c1);
+static void w_oconv(nkf_char c2,nkf_char c1);
+static void w_oconv16(nkf_char c2,nkf_char c1);
+static void w_oconv32(nkf_char c2,nkf_char c1);
+#endif
+static void e_oconv(nkf_char c2,nkf_char c1);
+static nkf_char e2s_conv(nkf_char c2, nkf_char c1, nkf_char *p2, nkf_char *p1);
+static void s_oconv(nkf_char c2,nkf_char c1);
+static void j_oconv(nkf_char c2,nkf_char c1);
+static void fold_conv(nkf_char c2,nkf_char c1);
+static void cr_conv(nkf_char c2,nkf_char c1);
+static void z_conv(nkf_char c2,nkf_char c1);
+static void rot_conv(nkf_char c2,nkf_char c1);
+static void hira_conv(nkf_char c2,nkf_char c1);
+static void base64_conv(nkf_char c2,nkf_char c1);
+static void iso2022jp_check_conv(nkf_char c2,nkf_char c1);
+static void no_connection(nkf_char c2,nkf_char c1);
+static nkf_char no_connection2(nkf_char c2,nkf_char c1,nkf_char c0);
+
+static void code_score(struct input_code *ptr);
+static void code_status(nkf_char c);
static void std_putc(nkf_char c);
static nkf_char std_getc(FILE *f);
@@ -368,9 +414,32 @@ static nkf_char std_ungetc(nkf_char c,FILE *f);
static nkf_char broken_getc(FILE *f);
static nkf_char broken_ungetc(nkf_char c,FILE *f);
+static nkf_char mime_begin(FILE *f);
static nkf_char mime_getc(FILE *f);
-
-static void mime_putc(nkf_char c);
+static nkf_char mime_ungetc(nkf_char c,FILE *f);
+
+static void switch_mime_getc(void);
+static void unswitch_mime_getc(void);
+static nkf_char mime_begin_strict(FILE *f);
+static nkf_char mime_getc_buf(FILE *f);
+static nkf_char mime_ungetc_buf(nkf_char c,FILE *f);
+static nkf_char mime_integrity(FILE *f,const unsigned char *p);
+
+static nkf_char base64decode(nkf_char c);
+static void mime_prechar(nkf_char c2, nkf_char c1);
+static void mime_putc(nkf_char c);
+static void open_mime(nkf_char c);
+static void close_mime(void);
+static void eof_mime(void);
+static void mimeout_addchar(nkf_char c);
+#ifndef PERL_XS
+static void usage(void);
+static void version(void);
+#endif
+static void options(unsigned char *c);
+#if defined(PERL_XS) || defined(WIN32DLL)
+static void reinit(void);
+#endif
/* buffers */
@@ -378,6 +447,19 @@ static void mime_putc(nkf_char c);
static unsigned char stdibuf[IOBUF_SIZE];
static unsigned char stdobuf[IOBUF_SIZE];
#endif
+static unsigned char hold_buf[HOLD_SIZE*2];
+static int hold_count = 0;
+
+/* MIME preprocessor fifo */
+
+#define MIME_BUF_SIZE (1024) /* 2^n ring buffer */
+#define MIME_BUF_MASK (MIME_BUF_SIZE-1)
+#define Fifo(n) mime_buf[(n)&MIME_BUF_MASK]
+static unsigned char mime_buf[MIME_BUF_SIZE];
+static unsigned int mime_top = 0;
+static unsigned int mime_last = 0; /* decoded */
+static unsigned int mime_input = 0; /* undecoded */
+static nkf_char (*mime_iconv_back)(nkf_char c2,nkf_char c1,nkf_char c0) = NULL;
/* flags */
static int unbuf_f = FALSE;
@@ -386,60 +468,79 @@ static int nop_f = FALSE;
static int binmode_f = TRUE; /* binary mode */
static int rot_f = FALSE; /* rot14/43 mode */
static int hira_f = FALSE; /* hira/kata henkan */
+static int input_f = FALSE; /* non fixed input code */
static int alpha_f = FALSE; /* convert JIx0208 alphbet to ASCII */
-static int mime_f = MIME_DECODE_DEFAULT; /* convert MIME B base64 or Q */
+static int mime_f = STRICT_MIME; /* convert MIME B base64 or Q */
static int mime_decode_f = FALSE; /* mime decode is explicitly on */
static int mimebuf_f = FALSE; /* MIME buffered input */
static int broken_f = FALSE; /* convert ESC-less broken JIS */
static int iso8859_f = FALSE; /* ISO8859 through */
static int mimeout_f = FALSE; /* base64 mode */
-static int x0201_f = X0201_DEFAULT; /* convert JIS X 0201 */
-static int iso2022jp_f = FALSE; /* replace non ISO-2022-JP with GETA */
+#if defined(MSDOS) || defined(__OS2__)
+static int x0201_f = TRUE; /* Assume JISX0201 kana */
+#else
+static int x0201_f = NO_X0201; /* Assume NO JISX0201 */
+#endif
+static int iso2022jp_f = FALSE; /* convert ISO-2022-JP */
#ifdef UNICODE_NORMALIZATION
static int nfc_f = FALSE;
static nkf_char (*i_nfc_getc)(FILE *) = std_getc; /* input of ugetc */
static nkf_char (*i_nfc_ungetc)(nkf_char c ,FILE *f) = std_ungetc;
+static nkf_char nfc_getc(FILE *f);
+static nkf_char nfc_ungetc(nkf_char c,FILE *f);
#endif
#ifdef INPUT_OPTION
static int cap_f = FALSE;
static nkf_char (*i_cgetc)(FILE *) = std_getc; /* input of cgetc */
static nkf_char (*i_cungetc)(nkf_char c ,FILE *f) = std_ungetc;
+static nkf_char cap_getc(FILE *f);
+static nkf_char cap_ungetc(nkf_char c,FILE *f);
static int url_f = FALSE;
static nkf_char (*i_ugetc)(FILE *) = std_getc; /* input of ugetc */
static nkf_char (*i_uungetc)(nkf_char c ,FILE *f) = std_ungetc;
+static nkf_char url_getc(FILE *f);
+static nkf_char url_ungetc(nkf_char c,FILE *f);
#endif
-#define PREFIX_EUCG3 NKF_INT32_C(0x8F00)
-#define CLASS_MASK NKF_INT32_C(0xFF000000)
-#define CLASS_UNICODE NKF_INT32_C(0x01000000)
-#define VALUE_MASK NKF_INT32_C(0x00FFFFFF)
-#define UNICODE_BMP_MAX NKF_INT32_C(0x0000FFFF)
-#define UNICODE_MAX NKF_INT32_C(0x0010FFFF)
-#define nkf_char_euc3_new(c) ((c) | PREFIX_EUCG3)
-#define nkf_char_unicode_new(c) ((c) | CLASS_UNICODE)
-#define nkf_char_unicode_p(c) ((c & CLASS_MASK) == CLASS_UNICODE)
-#define nkf_char_unicode_bmp_p(c) ((c & VALUE_MASK) <= UNICODE_BMP_MAX)
-#define nkf_char_unicode_value_p(c) ((c & VALUE_MASK) <= UNICODE_MAX)
+#if defined(INT_IS_SHORT)
+#define NKF_INT32_C(n) (n##L)
+#else
+#define NKF_INT32_C(n) (n)
+#endif
+#define PREFIX_EUCG3 NKF_INT32_C(0x8F00)
+#define CLASS_MASK NKF_INT32_C(0xFF000000)
+#define CLASS_UNICODE NKF_INT32_C(0x01000000)
+#define VALUE_MASK NKF_INT32_C(0x00FFFFFF)
+#define UNICODE_MAX NKF_INT32_C(0x0010FFFF)
+#define is_unicode_capsule(c) ((c & CLASS_MASK) == CLASS_UNICODE)
+#define is_unicode_bmp(c) ((c & VALUE_MASK) <= NKF_INT32_C(0xFFFF))
#ifdef NUMCHAR_OPTION
static int numchar_f = FALSE;
static nkf_char (*i_ngetc)(FILE *) = std_getc; /* input of ugetc */
static nkf_char (*i_nungetc)(nkf_char c ,FILE *f) = std_ungetc;
+static nkf_char numchar_getc(FILE *f);
+static nkf_char numchar_ungetc(nkf_char c,FILE *f);
#endif
#ifdef CHECK_OPTION
static int noout_f = FALSE;
static void no_putc(nkf_char c);
-static int debug_f = FALSE;
+static nkf_char debug_f = FALSE;
static void debug(const char *str);
static nkf_char (*iconv_for_check)(nkf_char c2,nkf_char c1,nkf_char c0) = 0;
#endif
-static int guess_f = 0; /* 0: OFF, 1: ON, 2: VERBOSE */
-static void set_input_codename(const char *codename);
+static int guess_f = FALSE;
+#if !defined PERL_XS
+static void print_guessed_code(char *filename);
+#endif
+static void set_input_codename(char *codename);
+static int is_inputcode_mixed = FALSE;
+static int is_inputcode_set = FALSE;
#ifdef EXEC_IO
static int exec_f = 0;
@@ -455,11 +556,23 @@ static int cp932inv_f = TRUE;
/* static nkf_char cp932_conv(nkf_char c2, nkf_char c1); */
#endif /* SHIFTJIS_CP932 */
+#ifdef X0212_ENABLE
static int x0212_f = FALSE;
+static nkf_char x0212_shift(nkf_char c);
+static nkf_char x0212_unshift(nkf_char c);
+#endif
static int x0213_f = FALSE;
static unsigned char prefix_table[256];
+static void set_code_score(struct input_code *ptr, nkf_char score);
+static void clr_code_score(struct input_code *ptr, nkf_char score);
+static void status_disable(struct input_code *ptr);
+static void status_push_ch(struct input_code *ptr, nkf_char c);
+static void status_clear(struct input_code *ptr);
+static void status_reset(struct input_code *ptr);
+static void status_reinit(struct input_code *ptr);
+static void status_check(struct input_code *ptr, nkf_char c);
static void e_status(struct input_code *, nkf_char);
static void s_status(struct input_code *, nkf_char);
@@ -468,11 +581,13 @@ struct input_code input_code_list[] = {
{"Shift_JIS", 0, 0, 0, {0, 0, 0}, s_status, s_iconv, 0},
#ifdef UTF8_INPUT_ENABLE
{"UTF-8", 0, 0, 0, {0, 0, 0}, w_status, w_iconv, 0},
+ {"UTF-16", 0, 0, 0, {0, 0, 0}, NULL, w_iconv16, 0},
+ {"UTF-32", 0, 0, 0, {0, 0, 0}, NULL, w_iconv32, 0},
#endif
{0}
};
-static int mimeout_mode = 0; /* 0, -1, 'Q', 'B', 1, 2 */
+static int mimeout_mode = 0;
static int base64_count = 0;
/* X0208 -> ASCII converter */
@@ -495,28 +610,31 @@ static unsigned char ascii_intro = DEFAULT_R;
static int fold_margin = FOLD_MARGIN;
-/* process default */
+/* converters */
-static nkf_char
-no_connection2(nkf_char c2, nkf_char c1, nkf_char c0)
-{
- fprintf(stderr,"nkf internal module connection failure.\n");
- exit(EXIT_FAILURE);
- return 0; /* LINT */
-}
+#ifdef DEFAULT_CODE_JIS
+# define DEFAULT_CONV j_oconv
+#endif
+#ifdef DEFAULT_CODE_SJIS
+# define DEFAULT_CONV s_oconv
+#endif
+#ifdef DEFAULT_CODE_EUC
+# define DEFAULT_CONV e_oconv
+#endif
+#ifdef DEFAULT_CODE_UTF8
+# define DEFAULT_CONV w_oconv
+#endif
-static void
-no_connection(nkf_char c2, nkf_char c1)
-{
- no_connection2(c2,c1,0);
-}
+/* process default */
+static void (*output_conv)(nkf_char c2,nkf_char c1) = DEFAULT_CONV;
-static nkf_char (*iconv)(nkf_char c2,nkf_char c1,nkf_char c0) = no_connection2;
static void (*oconv)(nkf_char c2,nkf_char c1) = no_connection;
+/* s_iconv or oconv */
+static nkf_char (*iconv)(nkf_char c2,nkf_char c1,nkf_char c0) = no_connection2;
static void (*o_zconv)(nkf_char c2,nkf_char c1) = no_connection;
static void (*o_fconv)(nkf_char c2,nkf_char c1) = no_connection;
-static void (*o_eol_conv)(nkf_char c2,nkf_char c1) = no_connection;
+static void (*o_crconv)(nkf_char c2,nkf_char c1) = no_connection;
static void (*o_rot_conv)(nkf_char c2,nkf_char c1) = no_connection;
static void (*o_hira_conv)(nkf_char c2,nkf_char c1) = no_connection;
static void (*o_base64conv)(nkf_char c2,nkf_char c1) = no_connection;
@@ -542,15 +660,17 @@ static nkf_char (*i_mgetc_buf)(FILE *) = std_getc; /* input of mgetc_buf */
static nkf_char (*i_mungetc_buf)(nkf_char c,FILE *f) = std_ungetc;
/* Global states */
-static int output_mode = ASCII; /* output kanji mode */
-static int input_mode = ASCII; /* input kanji mode */
+static int output_mode = ASCII, /* output kanji mode */
+ input_mode = ASCII, /* input kanji mode */
+ shift_mode = FALSE; /* TRUE shift out, or X0201 */
static int mime_decode_mode = FALSE; /* MIME mode B base64, Q hex */
/* X0201 / X0208 conversion tables */
/* X0201 kana conversion table */
/* 90-9F A0-DF */
-static const unsigned char cv[]= {
+static const
+unsigned char cv[]= {
0x21,0x21,0x21,0x23,0x21,0x56,0x21,0x57,
0x21,0x22,0x21,0x26,0x25,0x72,0x25,0x21,
0x25,0x23,0x25,0x25,0x25,0x27,0x25,0x29,
@@ -572,7 +692,8 @@ static const unsigned char cv[]= {
/* X0201 kana conversion table for daguten */
/* 90-9F A0-DF */
-static const unsigned char dv[]= {
+static const
+unsigned char dv[]= {
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
@@ -593,7 +714,8 @@ static const unsigned char dv[]= {
/* X0201 kana conversion table for han-daguten */
/* 90-9F A0-DF */
-static const unsigned char ev[]= {
+static const
+unsigned char ev[]= {
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
@@ -615,7 +737,8 @@ static const unsigned char ev[]= {
/* X0208 kigou conversion table */
/* 0x8140 - 0x819e */
-static const unsigned char fv[] = {
+static const
+unsigned char fv[] = {
0x00,0x00,0x00,0x00,0x2c,0x2e,0x00,0x3a,
0x3b,0x3f,0x21,0x00,0x00,0x27,0x60,0x00,
@@ -632,359 +755,283 @@ static const unsigned char fv[] = {
} ;
+#define CRLF 1
-static int option_mode = 0;
static int file_out_f = FALSE;
#ifdef OVERWRITE
static int overwrite_f = FALSE;
static int preserve_time_f = FALSE;
static int backup_f = FALSE;
static char *backup_suffix = "";
+static char *get_backup_filename(const char *suffix, const char *filename);
#endif
-static int eolmode_f = 0; /* CR, LF, CRLF */
-static int input_eol = 0; /* 0: unestablished, EOF: MIXED */
-static nkf_char prev_cr = 0; /* CR or 0 */
+static int crmode_f = 0; /* CR, NL, CRLF */
#ifdef EASYWIN /*Easy Win */
static int end_check;
#endif /*Easy Win */
-static void *
-nkf_xmalloc(size_t size)
-{
- void *ptr;
-
- if (size == 0) size = 1;
-
- ptr = malloc(size);
- if (ptr == NULL) {
- perror("can't malloc");
- exit(EXIT_FAILURE);
- }
-
- return ptr;
-}
-
-static void *
-nkf_xrealloc(void *ptr, size_t size)
-{
- if (size == 0) size = 1;
-
- ptr = realloc(ptr, size);
- if (ptr == NULL) {
- perror("can't realloc");
- exit(EXIT_FAILURE);
- }
-
- return ptr;
-}
-
-#define nkf_xfree(ptr) free(ptr)
-
-static int
-nkf_str_caseeql(const char *src, const char *target)
-{
- int i;
- for (i = 0; src[i] && target[i]; i++) {
- if (nkf_toupper(src[i]) != nkf_toupper(target[i])) return FALSE;
- }
- if (src[i] || target[i]) return FALSE;
- else return TRUE;
-}
-
-static nkf_encoding*
-nkf_enc_from_index(int idx)
-{
- if (idx < 0 || NKF_ENCODING_TABLE_SIZE <= idx) {
- return 0;
- }
- return &nkf_encoding_table[idx];
-}
-
-static int
-nkf_enc_find_index(const char *name)
-{
- int i;
- if (name[0] == 'X' && *(name+1) == '-') name += 2;
- for (i = 0; encoding_name_to_id_table[i].id >= 0; i++) {
- if (nkf_str_caseeql(encoding_name_to_id_table[i].name, name)) {
- return encoding_name_to_id_table[i].id;
- }
- }
- return -1;
-}
-
-static nkf_encoding*
-nkf_enc_find(const char *name)
-{
- int idx = -1;
- idx = nkf_enc_find_index(name);
- if (idx < 0) return 0;
- return nkf_enc_from_index(idx);
-}
-
-#define nkf_enc_name(enc) (enc)->name
-#define nkf_enc_to_index(enc) (enc)->id
-#define nkf_enc_to_base_encoding(enc) (enc)->base_encoding
-#define nkf_enc_to_iconv(enc) nkf_enc_to_base_encoding(enc)->iconv
-#define nkf_enc_to_oconv(enc) nkf_enc_to_base_encoding(enc)->oconv
-#define nkf_enc_asciicompat(enc) (\
- nkf_enc_to_base_encoding(enc) == &NkfEncodingASCII ||\
- nkf_enc_to_base_encoding(enc) == &NkfEncodingISO_2022_JP)
-#define nkf_enc_unicode_p(enc) (\
- nkf_enc_to_base_encoding(enc) == &NkfEncodingUTF_8 ||\
- nkf_enc_to_base_encoding(enc) == &NkfEncodingUTF_16 ||\
- nkf_enc_to_base_encoding(enc) == &NkfEncodingUTF_32)
-#define nkf_enc_cp5022x_p(enc) (\
- nkf_enc_to_index(enc) == CP50220 ||\
- nkf_enc_to_index(enc) == CP50221 ||\
- nkf_enc_to_index(enc) == CP50222)
-
-#ifdef DEFAULT_CODE_LOCALE
-static const char*
-nkf_locale_charmap()
-{
-#ifdef HAVE_LANGINFO_H
- return nl_langinfo(CODESET);
-#elif defined(__WIN32__)
- static char buf[16];
- sprintf(buf, "CP%d", GetACP());
- return buf;
-#elif defined(__OS2__)
-# if defined(INT_IS_SHORT)
- /* OS/2 1.x */
- return NULL;
-# else
- /* OS/2 32bit */
- static char buf[16];
- ULONG ulCP[1], ulncp;
- DosQueryCp(sizeof(ulCP), ulCP, &ulncp);
- if (ulCP[0] == 932 || ulCP[0] == 943)
- strcpy(buf, "Shift_JIS");
- else
- sprintf(buf, "CP%lu", ulCP[0]);
- return buf;
-# endif
-#endif
- return NULL;
-}
-
-static nkf_encoding*
-nkf_locale_encoding()
-{
- nkf_encoding *enc = 0;
- const char *encname = nkf_locale_charmap();
- if (encname)
- enc = nkf_enc_find(encname);
- return enc;
-}
-#endif /* DEFAULT_CODE_LOCALE */
-
-static nkf_encoding*
-nkf_utf8_encoding()
-{
- return &nkf_encoding_table[UTF_8];
-}
+#define STD_GC_BUFSIZE (256)
+nkf_char std_gc_buf[STD_GC_BUFSIZE];
+nkf_char std_gc_ndx;
-static nkf_encoding*
-nkf_default_encoding()
+#ifdef WIN32DLL
+#include "nkf32dll.c"
+#elif defined(PERL_XS)
+#else /* WIN32DLL */
+int main(int argc, char **argv)
{
- nkf_encoding *enc = 0;
-#ifdef DEFAULT_CODE_LOCALE
- enc = nkf_locale_encoding();
-#elif defined(DEFAULT_ENCIDX)
- enc = nkf_enc_from_index(DEFAULT_ENCIDX);
-#endif
- if (!enc) enc = nkf_utf8_encoding();
- return enc;
-}
-
-typedef struct {
- long capa;
- long len;
- nkf_char *ptr;
-} nkf_buf_t;
+ FILE *fin;
+ unsigned char *cp;
-static nkf_buf_t *
-nkf_buf_new(int length)
-{
- nkf_buf_t *buf = nkf_xmalloc(sizeof(nkf_buf_t));
- buf->ptr = nkf_xmalloc(length);
- buf->capa = length;
- buf->len = 0;
- return buf;
-}
+ char *outfname = NULL;
+ char *origfname;
-#if 0
-static void
-nkf_buf_dispose(nkf_buf_t *buf)
-{
- nkf_xfree(buf->ptr);
- nkf_xfree(buf);
-}
+#ifdef EASYWIN /*Easy Win */
+ _BufferSize.y = 400;/*Set Scroll Buffer Size*/
#endif
-#define nkf_buf_length(buf) ((buf)->len)
-#define nkf_buf_empty_p(buf) ((buf)->len == 0)
-
-static unsigned char
-nkf_buf_at(nkf_buf_t *buf, int index)
-{
- assert(index <= buf->len);
- return buf->ptr[index];
-}
-
-static void
-nkf_buf_clear(nkf_buf_t *buf)
-{
- buf->len = 0;
-}
-
-static void
-nkf_buf_push(nkf_buf_t *buf, nkf_char c)
-{
- if (buf->capa <= buf->len) {
- exit(EXIT_FAILURE);
- }
- buf->ptr[buf->len++] = c;
-}
-
-static unsigned char
-nkf_buf_pop(nkf_buf_t *buf)
-{
- assert(!nkf_buf_empty_p(buf));
- return buf->ptr[--buf->len];
-}
+ for (argc--,argv++; (argc > 0) && **argv == '-'; argc--, argv++) {
+ cp = (unsigned char *)*argv;
+ options(cp);
+#ifdef EXEC_IO
+ if (exec_f){
+ int fds[2], pid;
+ if (pipe(fds) < 0 || (pid = fork()) < 0){
+ abort();
+ }
+ if (pid == 0){
+ if (exec_f > 0){
+ close(fds[0]);
+ dup2(fds[1], 1);
+ }else{
+ close(fds[1]);
+ dup2(fds[0], 0);
+ }
+ execvp(argv[1], &argv[1]);
+ }
+ if (exec_f > 0){
+ close(fds[1]);
+ dup2(fds[0], 0);
+ }else{
+ close(fds[0]);
+ dup2(fds[1], 1);
+ }
+ argc = 0;
+ break;
+ }
+#endif
+ }
+ if(x0201_f == WISH_TRUE)
+ x0201_f = ((!iso2022jp_f)? TRUE : NO_X0201);
-/* Normalization Form C */
-#ifndef PERL_XS
-#ifdef WIN32DLL
-#define fprintf dllprintf
+ if (binmode_f == TRUE)
+#if defined(__OS2__) && (defined(__IBMC__) || defined(__IBMCPP__))
+ if (freopen("","wb",stdout) == NULL)
+ return (-1);
+#else
+ setbinmode(stdout);
#endif
-static void
-version(void)
-{
- fprintf(HELP_OUTPUT,"Network Kanji Filter Version " NKF_VERSION " (" NKF_RELEASE_DATE ") \n" COPY_RIGHT "\n");
-}
+ if (unbuf_f)
+ setbuf(stdout, (char *) NULL);
+ else
+ setvbuffer(stdout, (char *) stdobuf, IOBUF_SIZE);
-static void
-usage(void)
-{
- fprintf(HELP_OUTPUT,
- "Usage: nkf -[flags] [--] [in file] .. [out file for -O flag]\n"
-#ifdef UTF8_OUTPUT_ENABLE
- " j/s/e/w Specify output encoding ISO-2022-JP, Shift_JIS, EUC-JP\n"
- " UTF options is -w[8[0],{16,32}[{B,L}[0]]]\n"
-#else
-#endif
-#ifdef UTF8_INPUT_ENABLE
- " J/S/E/W Specify input encoding ISO-2022-JP, Shift_JIS, EUC-JP\n"
- " UTF option is -W[8,[16,32][B,L]]\n"
+ if (argc == 0) {
+ if (binmode_f == TRUE)
+#if defined(__OS2__) && (defined(__IBMC__) || defined(__IBMCPP__))
+ if (freopen("","rb",stdin) == NULL) return (-1);
#else
- " J/S/E Specify output encoding ISO-2022-JP, Shift_JIS, EUC-JP\n"
-#endif
- );
- fprintf(HELP_OUTPUT,
- " m[BQSN0] MIME decode [B:base64,Q:quoted,S:strict,N:nonstrict,0:no decode]\n"
- " M[BQ] MIME encode [B:base64 Q:quoted]\n"
- " f/F Folding: -f60 or -f or -f60-10 (fold margin 10) F preserve nl\n"
- );
- fprintf(HELP_OUTPUT,
- " Z[0-4] Default/0: Convert JISX0208 Alphabet to ASCII\n"
- " 1: Kankaku to one space 2: to two spaces 3: HTML Entity\n"
- " 4: JISX0208 Katakana to JISX0201 Katakana\n"
- " X,x Assume X0201 kana in MS-Kanji, -x preserves X0201\n"
- );
- fprintf(HELP_OUTPUT,
- " O Output to File (DEFAULT 'nkf.out')\n"
- " L[uwm] Line mode u:LF w:CRLF m:CR (DEFAULT noconversion)\n"
- );
- fprintf(HELP_OUTPUT,
- " --ic=<encoding> Specify the input encoding\n"
- " --oc=<encoding> Specify the output encoding\n"
- " --hiragana --katakana Hiragana/Katakana Conversion\n"
- " --katakana-hiragana Converts each other\n"
- );
- fprintf(HELP_OUTPUT,
-#ifdef INPUT_OPTION
- " --{cap, url}-input Convert hex after ':' or '%%'\n"
-#endif
-#ifdef NUMCHAR_OPTION
- " --numchar-input Convert Unicode Character Reference\n"
-#endif
-#ifdef UTF8_INPUT_ENABLE
- " --fb-{skip, html, xml, perl, java, subchar}\n"
- " Specify unassigned character's replacement\n"
+ setbinmode(stdin);
+#endif
+ setvbuffer(stdin, (char *) stdibuf, IOBUF_SIZE);
+ if (nop_f)
+ noconvert(stdin);
+ else {
+ kanji_convert(stdin);
+ if (guess_f) print_guessed_code(NULL);
+ }
+ } else {
+ int nfiles = argc;
+ int is_argument_error = FALSE;
+ while (argc--) {
+ is_inputcode_mixed = FALSE;
+ is_inputcode_set = FALSE;
+ input_codename = "";
+#ifdef CHECK_OPTION
+ iconv_for_check = 0;
#endif
- );
- fprintf(HELP_OUTPUT,
+ if ((fin = fopen((origfname = *argv++), "r")) == NULL) {
+ perror(*--argv);
+ *argv++;
+ is_argument_error = TRUE;
+ continue;
+ } else {
#ifdef OVERWRITE
- " --in-place[=SUF] Overwrite original files\n"
- " --overwrite[=SUF] Preserve timestamp of original files\n"
+ int fd = 0;
+ int fd_backup = 0;
#endif
- " -g --guess Guess the input code\n"
- " -v --version Print the version\n"
- " --help/-V Print this help / configuration\n"
- );
- version();
-}
-static void
-show_configuration(void)
-{
- fprintf(HELP_OUTPUT,
- "Summary of my nkf " NKF_VERSION " (" NKF_RELEASE_DATE ") configuration:\n"
- " Compile-time options:\n"
- " Compiled at: " __DATE__ " " __TIME__ "\n"
- );
- fprintf(HELP_OUTPUT,
- " Default output encoding: "
-#ifdef DEFAULT_CODE_LOCALE
- "LOCALE (%s)\n", nkf_enc_name(nkf_default_encoding())
-#elif defined(DEFAULT_ENCIDX)
- "CONFIG (%s)\n", nkf_enc_name(nkf_default_encoding())
+/* reopen file for stdout */
+ if (file_out_f == TRUE) {
+#ifdef OVERWRITE
+ if (overwrite_f){
+ outfname = malloc(strlen(origfname)
+ + strlen(".nkftmpXXXXXX")
+ + 1);
+ if (!outfname){
+ perror(origfname);
+ return -1;
+ }
+ strcpy(outfname, origfname);
+#ifdef MSDOS
+ {
+ int i;
+ for (i = strlen(outfname); i; --i){
+ if (outfname[i - 1] == '/'
+ || outfname[i - 1] == '\\'){
+ break;
+ }
+ }
+ outfname[i] = '\0';
+ }
+ strcat(outfname, "ntXXXXXX");
+ mktemp(outfname);
+ fd = open(outfname, O_WRONLY | O_CREAT | O_TRUNC | O_EXCL,
+ S_IREAD | S_IWRITE);
#else
- "NONE\n"
-#endif
- );
- fprintf(HELP_OUTPUT,
- " Default output end of line: "
-#if DEFAULT_NEWLINE == CR
- "CR"
-#elif DEFAULT_NEWLINE == CRLF
- "CRLF"
+ strcat(outfname, ".nkftmpXXXXXX");
+ fd = mkstemp(outfname);
+#endif
+ if (fd < 0
+ || (fd_backup = dup(fileno(stdout))) < 0
+ || dup2(fd, fileno(stdout)) < 0
+ ){
+ perror(origfname);
+ return -1;
+ }
+ }else
+#endif
+ if(argc == 1 ) {
+ outfname = *argv++;
+ argc--;
+ } else {
+ outfname = "nkf.out";
+ }
+
+ if(freopen(outfname, "w", stdout) == NULL) {
+ perror (outfname);
+ return (-1);
+ }
+ if (binmode_f == TRUE) {
+#if defined(__OS2__) && (defined(__IBMC__) || defined(__IBMCPP__))
+ if (freopen("","wb",stdout) == NULL)
+ return (-1);
#else
- "LF"
+ setbinmode(stdout);
#endif
- "\n"
- " Decode MIME encoded string: "
-#if MIME_DECODE_DEFAULT
- "ON"
+ }
+ }
+ if (binmode_f == TRUE)
+#if defined(__OS2__) && (defined(__IBMC__) || defined(__IBMCPP__))
+ if (freopen("","rb",fin) == NULL)
+ return (-1);
#else
- "OFF"
-#endif
- "\n"
- " Convert JIS X 0201 Katakana: "
-#if X0201_DEFAULT
- "ON"
+ setbinmode(fin);
+#endif
+ setvbuffer(fin, (char *) stdibuf, IOBUF_SIZE);
+ if (nop_f)
+ noconvert(fin);
+ else {
+ char *filename = NULL;
+ kanji_convert(fin);
+ if (nfiles > 1) filename = origfname;
+ if (guess_f) print_guessed_code(filename);
+ }
+ fclose(fin);
+#ifdef OVERWRITE
+ if (overwrite_f) {
+ struct stat sb;
+#if defined(MSDOS) && !defined(__MINGW32__) && !defined(__WIN32__) && !defined(__WATCOMC__) && !defined(__EMX__) && !defined(__OS2__) && !defined(__DJGPP__)
+ time_t tb[2];
#else
- "OFF"
-#endif
- "\n"
- " --help, --version output: "
-#if HELP_OUTPUT_HELP_OUTPUT
- "HELP_OUTPUT"
+ struct utimbuf tb;
+#endif
+
+ fflush(stdout);
+ close(fd);
+ if (dup2(fd_backup, fileno(stdout)) < 0){
+ perror("dup2");
+ }
+ if (stat(origfname, &sb)) {
+ fprintf(stderr, "Can't stat %s\n", origfname);
+ }
+ /* $B%Q!<%_%C%7%g%s$rI|85(B */
+ if (chmod(outfname, sb.st_mode)) {
+ fprintf(stderr, "Can't set permission %s\n", outfname);
+ }
+
+ /* $B%?%$%`%9%?%s%W$rI|85(B */
+ if(preserve_time_f){
+#if defined(MSDOS) && !defined(__MINGW32__) && !defined(__WIN32__) && !defined(__WATCOMC__) && !defined(__EMX__) && !defined(__OS2__) && !defined(__DJGPP__)
+ tb[0] = tb[1] = sb.st_mtime;
+ if (utime(outfname, tb)) {
+ fprintf(stderr, "Can't set timestamp %s\n", outfname);
+ }
#else
- "STDOUT"
+ tb.actime = sb.st_atime;
+ tb.modtime = sb.st_mtime;
+ if (utime(outfname, &tb)) {
+ fprintf(stderr, "Can't set timestamp %s\n", outfname);
+ }
+#endif
+ }
+ if(backup_f){
+ char *backup_filename = get_backup_filename(backup_suffix, origfname);
+#ifdef MSDOS
+ unlink(backup_filename);
+#endif
+ if (rename(origfname, backup_filename)) {
+ perror(backup_filename);
+ fprintf(stderr, "Can't rename %s to %s\n",
+ origfname, backup_filename);
+ }
+ }else{
+#ifdef MSDOS
+ if (unlink(origfname)){
+ perror(origfname);
+ }
#endif
- "\n");
+ }
+ if (rename(outfname, origfname)) {
+ perror(origfname);
+ fprintf(stderr, "Can't rename %s to %s\n",
+ outfname, origfname);
+ }
+ free(outfname);
+ }
+#endif
+ }
+ }
+ if (is_argument_error)
+ return(-1);
+ }
+#ifdef EASYWIN /*Easy Win */
+ if (file_out_f == FALSE)
+ scanf("%d",&end_check);
+ else
+ fclose(stdout);
+#else /* for Other OS */
+ if (file_out_f == TRUE)
+ fclose(stdout);
+#endif /*Easy Win */
+ return (0);
}
-#endif /*PERL_XS*/
+#endif /* WIN32DLL */
#ifdef OVERWRITE
-static char*
-get_backup_filename(const char *suffix, const char *filename)
+char *get_backup_filename(const char *suffix, const char *filename)
{
char *backup_filename;
int asterisk_count = 0;
@@ -996,7 +1043,12 @@ get_backup_filename(const char *suffix, const char *filename)
}
if(asterisk_count){
- backup_filename = nkf_xmalloc(strlen(suffix) + (asterisk_count * (filename_length - 1)) + 1);
+ backup_filename = malloc(strlen(suffix) + (asterisk_count * (filename_length - 1)) + 1);
+ if (!backup_filename){
+ perror("Can't malloc backup filename.");
+ return NULL;
+ }
+
for(i = 0, j = 0; suffix[i];){
if(suffix[i] == '*'){
backup_filename[j] = '\0';
@@ -1009,8 +1061,8 @@ get_backup_filename(const char *suffix, const char *filename)
}
backup_filename[j] = '\0';
}else{
- j = filename_length + strlen(suffix);
- backup_filename = nkf_xmalloc(j + 1);
+ j = strlen(suffix) + filename_length;
+ backup_filename = malloc( + 1);
strcpy(backup_filename, filename);
strcat(backup_filename, suffix);
backup_filename[j] = '\0';
@@ -1019,102 +1071,8 @@ get_backup_filename(const char *suffix, const char *filename)
}
#endif
-#ifdef UTF8_INPUT_ENABLE
-static void
-nkf_each_char_to_hex(void (*f)(nkf_char c2,nkf_char c1), nkf_char c)
-{
- int shift = 20;
- c &= VALUE_MASK;
- while(shift >= 0){
- if(c >= 1<<shift){
- while(shift >= 0){
- (*f)(0, bin2hex(c>>shift));
- shift -= 4;
- }
- }else{
- shift -= 4;
- }
- }
- return;
-}
-
-static void
-encode_fallback_html(nkf_char c)
-{
- (*oconv)(0, '&');
- (*oconv)(0, '#');
- c &= VALUE_MASK;
- if(c >= NKF_INT32_C(1000000))
- (*oconv)(0, 0x30+(c/NKF_INT32_C(1000000))%10);
- if(c >= NKF_INT32_C(100000))
- (*oconv)(0, 0x30+(c/NKF_INT32_C(100000) )%10);
- if(c >= 10000)
- (*oconv)(0, 0x30+(c/10000 )%10);
- if(c >= 1000)
- (*oconv)(0, 0x30+(c/1000 )%10);
- if(c >= 100)
- (*oconv)(0, 0x30+(c/100 )%10);
- if(c >= 10)
- (*oconv)(0, 0x30+(c/10 )%10);
- if(c >= 0)
- (*oconv)(0, 0x30+ c %10);
- (*oconv)(0, ';');
- return;
-}
-
-static void
-encode_fallback_xml(nkf_char c)
-{
- (*oconv)(0, '&');
- (*oconv)(0, '#');
- (*oconv)(0, 'x');
- nkf_each_char_to_hex(oconv, c);
- (*oconv)(0, ';');
- return;
-}
-
-static void
-encode_fallback_java(nkf_char c)
-{
- (*oconv)(0, '\\');
- c &= VALUE_MASK;
- if(!nkf_char_unicode_bmp_p(c)){
- (*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 ));
- return;
-}
-
-static void
-encode_fallback_perl(nkf_char c)
-{
- (*oconv)(0, '\\');
- (*oconv)(0, 'x');
- (*oconv)(0, '{');
- nkf_each_char_to_hex(oconv, c);
- (*oconv)(0, '}');
- return;
-}
-
-static void
-encode_fallback_subchar(nkf_char c)
-{
- c = unicode_subchar;
- (*oconv)((c>>8)&0xFF, c&0xFF);
- return;
-}
-#endif
-
-static const struct {
+static const
+struct {
const char *name;
const char *alias;
} long_option[] = {
@@ -1124,7 +1082,7 @@ static const struct {
{"euc","e"},
{"euc-input","E"},
{"fj","jm"},
- {"help",""},
+ {"help","v"},
{"jis","j"},
{"jis-input","J"},
{"mac","sLm"},
@@ -1134,13 +1092,12 @@ static const struct {
{"sjis","s"},
{"sjis-input","S"},
{"unix","eLu"},
- {"version","v"},
+ {"version","V"},
{"windows","sLw"},
{"hiragana","h1"},
{"katakana","h2"},
{"katakana-hiragana","h3"},
- {"guess=", ""},
- {"guess", "g2"},
+ {"guess", "g"},
{"cp932", ""},
{"no-cp932", ""},
#ifdef X0212_ENABLE
@@ -1194,412 +1151,2019 @@ static const struct {
{"prefix=", ""},
};
-static void
-set_input_encoding(nkf_encoding *enc)
+static int option_mode = 0;
+
+void options(unsigned char *cp)
{
- switch (nkf_enc_to_index(enc)) {
- case ISO_8859_1:
- iso8859_f = TRUE;
- break;
- case CP50220:
- case CP50221:
- case CP50222:
+ nkf_char i, j;
+ unsigned char *p;
+ unsigned char *cp_back = NULL;
+ char codeset[32];
+
+ if (option_mode==1)
+ return;
+ while(*cp && *cp++!='-');
+ while (*cp || cp_back) {
+ if(!*cp){
+ cp = cp_back;
+ cp_back = NULL;
+ continue;
+ }
+ p = 0;
+ switch (*cp++) {
+ case '-': /* literal options */
+ if (!*cp || *cp == SPACE) { /* ignore the rest of arguments */
+ option_mode = 1;
+ return;
+ }
+ for (i=0;i<sizeof(long_option)/sizeof(long_option[0]);i++) {
+ p = (unsigned char *)long_option[i].name;
+ for (j=0;*p && *p != '=' && *p == cp[j];p++, j++);
+ if (*p == cp[j] || cp[j] == ' '){
+ p = &cp[j] + 1;
+ break;
+ }
+ p = 0;
+ }
+ if (p == 0) return;
+ while(*cp && *cp != SPACE && cp++);
+ if (long_option[i].alias[0]){
+ cp_back = cp;
+ cp = (unsigned char *)long_option[i].alias;
+ }else{
+ if (strcmp(long_option[i].name, "ic=") == 0){
+ for (i=0; i < 16 && SPACE < p[i] && p[i] < DEL; i++){
+ codeset[i] = nkf_toupper(p[i]);
+ }
+ codeset[i] = 0;
+ if(strcmp(codeset, "ISO-2022-JP") == 0){
+ input_f = JIS_INPUT;
+ }else if(strcmp(codeset, "X-ISO2022JP-CP932") == 0 ||
+ strcmp(codeset, "CP50220") == 0 ||
+ strcmp(codeset, "CP50221") == 0 ||
+ strcmp(codeset, "CP50222") == 0){
+ input_f = JIS_INPUT;
#ifdef SHIFTJIS_CP932
- cp51932_f = TRUE;
+ cp51932_f = TRUE;
#endif
#ifdef UTF8_OUTPUT_ENABLE
- ms_ucs_map_f = UCS_MAP_CP932;
+ ms_ucs_map_f = UCS_MAP_CP932;
#endif
- break;
- case ISO_2022_JP_1:
- x0212_f = TRUE;
- break;
- case ISO_2022_JP_3:
- x0212_f = TRUE;
- x0213_f = TRUE;
- break;
- case ISO_2022_JP_2004:
- x0212_f = TRUE;
- x0213_f = TRUE;
- break;
- case SHIFT_JIS:
- break;
- case WINDOWS_31J:
-#ifdef SHIFTJIS_CP932
- cp51932_f = TRUE;
-#endif
-#ifdef UTF8_OUTPUT_ENABLE
- ms_ucs_map_f = UCS_MAP_CP932;
+ }else if(strcmp(codeset, "ISO-2022-JP-1") == 0){
+ input_f = JIS_INPUT;
+#ifdef X0212_ENABLE
+ x0212_f = TRUE;
#endif
- break;
- break;
- case CP10001:
+ }else if(strcmp(codeset, "ISO-2022-JP-3") == 0){
+ input_f = JIS_INPUT;
+#ifdef X0212_ENABLE
+ x0212_f = TRUE;
+#endif
+ x0213_f = TRUE;
+ }else if(strcmp(codeset, "SHIFT_JIS") == 0){
+ input_f = SJIS_INPUT;
+ }else if(strcmp(codeset, "WINDOWS-31J") == 0 ||
+ strcmp(codeset, "CSWINDOWS31J") == 0 ||
+ strcmp(codeset, "CP932") == 0 ||
+ strcmp(codeset, "MS932") == 0){
+ input_f = SJIS_INPUT;
#ifdef SHIFTJIS_CP932
- cp51932_f = TRUE;
+ cp51932_f = TRUE;
#endif
#ifdef UTF8_OUTPUT_ENABLE
- ms_ucs_map_f = UCS_MAP_CP10001;
+ ms_ucs_map_f = UCS_MAP_CP932;
#endif
- break;
- case EUC_JP:
- break;
- case EUCJP_NKF:
- break;
- case CP51932:
+ }else if(strcmp(codeset, "EUCJP") == 0 ||
+ strcmp(codeset, "EUC-JP") == 0){
+ input_f = EUC_INPUT;
+ }else if(strcmp(codeset, "CP51932") == 0){
+ input_f = EUC_INPUT;
#ifdef SHIFTJIS_CP932
- cp51932_f = TRUE;
+ cp51932_f = TRUE;
#endif
#ifdef UTF8_OUTPUT_ENABLE
- ms_ucs_map_f = UCS_MAP_CP932;
+ ms_ucs_map_f = UCS_MAP_CP932;
#endif
- break;
- case EUCJP_MS:
+ }else if(strcmp(codeset, "EUC-JP-MS") == 0 ||
+ strcmp(codeset, "EUCJP-MS") == 0 ||
+ strcmp(codeset, "EUCJPMS") == 0){
+ input_f = EUC_INPUT;
#ifdef SHIFTJIS_CP932
- cp51932_f = FALSE;
+ cp51932_f = FALSE;
#endif
#ifdef UTF8_OUTPUT_ENABLE
- ms_ucs_map_f = UCS_MAP_MS;
+ ms_ucs_map_f = UCS_MAP_MS;
#endif
- break;
- case EUCJP_ASCII:
+ }else if(strcmp(codeset, "EUC-JP-ASCII") == 0 ||
+ strcmp(codeset, "EUCJP-ASCII") == 0){
+ input_f = EUC_INPUT;
#ifdef SHIFTJIS_CP932
- cp51932_f = FALSE;
+ cp51932_f = FALSE;
#endif
#ifdef UTF8_OUTPUT_ENABLE
- ms_ucs_map_f = UCS_MAP_ASCII;
+ ms_ucs_map_f = UCS_MAP_ASCII;
#endif
- break;
- case SHIFT_JISX0213:
- case SHIFT_JIS_2004:
- x0213_f = TRUE;
+ }else if(strcmp(codeset, "SHIFT_JISX0213") == 0 ||
+ strcmp(codeset, "SHIFT_JIS-2004") == 0){
+ input_f = SJIS_INPUT;
+ x0213_f = TRUE;
#ifdef SHIFTJIS_CP932
- cp51932_f = FALSE;
+ cp51932_f = FALSE;
#endif
- break;
- case EUC_JISX0213:
- case EUC_JIS_2004:
- x0213_f = TRUE;
+ }else if(strcmp(codeset, "EUC-JISX0213") == 0 ||
+ strcmp(codeset, "EUC-JIS-2004") == 0){
+ input_f = EUC_INPUT;
+ x0213_f = TRUE;
#ifdef SHIFTJIS_CP932
- cp51932_f = FALSE;
+ cp51932_f = FALSE;
#endif
- break;
#ifdef UTF8_INPUT_ENABLE
+ }else if(strcmp(codeset, "UTF-8") == 0 ||
+ strcmp(codeset, "UTF-8N") == 0 ||
+ strcmp(codeset, "UTF-8-BOM") == 0){
+ input_f = UTF8_INPUT;
#ifdef UNICODE_NORMALIZATION
- case UTF8_MAC:
- nfc_f = TRUE;
- break;
+ }else if(strcmp(codeset, "UTF8-MAC") == 0 ||
+ strcmp(codeset, "UTF-8-MAC") == 0){
+ input_f = UTF8_INPUT;
+ nfc_f = TRUE;
+#endif
+ }else if(strcmp(codeset, "UTF-16") == 0 ||
+ strcmp(codeset, "UTF-16BE") == 0 ||
+ strcmp(codeset, "UTF-16BE-BOM") == 0){
+ input_f = UTF16_INPUT;
+ input_endian = ENDIAN_BIG;
+ }else if(strcmp(codeset, "UTF-16LE") == 0 ||
+ strcmp(codeset, "UTF-16LE-BOM") == 0){
+ input_f = UTF16_INPUT;
+ input_endian = ENDIAN_LITTLE;
+ }else if(strcmp(codeset, "UTF-32") == 0 ||
+ strcmp(codeset, "UTF-32BE") == 0 ||
+ strcmp(codeset, "UTF-32BE-BOM") == 0){
+ input_f = UTF32_INPUT;
+ input_endian = ENDIAN_BIG;
+ }else if(strcmp(codeset, "UTF-32LE") == 0 ||
+ strcmp(codeset, "UTF-32LE-BOM") == 0){
+ input_f = UTF32_INPUT;
+ input_endian = ENDIAN_LITTLE;
#endif
- case UTF_16:
- case UTF_16BE:
- case UTF_16BE_BOM:
- input_endian = ENDIAN_BIG;
- break;
- case UTF_16LE:
- case UTF_16LE_BOM:
- input_endian = ENDIAN_LITTLE;
- break;
- case UTF_32:
- case UTF_32BE:
- case UTF_32BE_BOM:
- input_endian = ENDIAN_BIG;
- break;
- case UTF_32LE:
- case UTF_32LE_BOM:
- input_endian = ENDIAN_LITTLE;
- break;
+ }
+ continue;
+ }
+ if (strcmp(long_option[i].name, "oc=") == 0){
+ x0201_f = FALSE;
+ for (i=0; i < 16 && SPACE < p[i] && p[i] < DEL; i++){
+ codeset[i] = nkf_toupper(p[i]);
+ }
+ codeset[i] = 0;
+ if(strcmp(codeset, "ISO-2022-JP") == 0){
+ output_conv = j_oconv;
+ }else if(strcmp(codeset, "X-ISO2022JP-CP932") == 0){
+ output_conv = j_oconv;
+ no_cp932ext_f = TRUE;
+#ifdef SHIFTJIS_CP932
+ cp932inv_f = FALSE;
#endif
- }
-}
-
-static void
-set_output_encoding(nkf_encoding *enc)
-{
- switch (nkf_enc_to_index(enc)) {
- case CP50220:
- x0201_f = TRUE;
+#ifdef UTF8_OUTPUT_ENABLE
+ ms_ucs_map_f = UCS_MAP_CP932;
+#endif
+ }else if(strcmp(codeset, "CP50220") == 0){
+ output_conv = j_oconv;
+ x0201_f = TRUE;
#ifdef SHIFTJIS_CP932
- if (cp932inv_f == TRUE) cp932inv_f = FALSE;
+ cp932inv_f = FALSE;
#endif
#ifdef UTF8_OUTPUT_ENABLE
- ms_ucs_map_f = UCS_MAP_CP932;
+ ms_ucs_map_f = UCS_MAP_CP932;
#endif
- break;
- case CP50221:
+ }else if(strcmp(codeset, "CP50221") == 0){
+ output_conv = j_oconv;
#ifdef SHIFTJIS_CP932
- if (cp932inv_f == TRUE) cp932inv_f = FALSE;
+ cp932inv_f = FALSE;
#endif
#ifdef UTF8_OUTPUT_ENABLE
- ms_ucs_map_f = UCS_MAP_CP932;
+ ms_ucs_map_f = UCS_MAP_CP932;
+#endif
+ }else if(strcmp(codeset, "ISO-2022-JP-1") == 0){
+ output_conv = j_oconv;
+#ifdef X0212_ENABLE
+ x0212_f = TRUE;
#endif
- break;
- case ISO_2022_JP_1:
- x0212_f = TRUE;
#ifdef SHIFTJIS_CP932
- if (cp932inv_f == TRUE) cp932inv_f = FALSE;
+ cp932inv_f = FALSE;
#endif
- break;
- case ISO_2022_JP_3:
- x0212_f = TRUE;
- x0213_f = TRUE;
+ }else if(strcmp(codeset, "ISO-2022-JP-3") == 0){
+ output_conv = j_oconv;
+#ifdef X0212_ENABLE
+ x0212_f = TRUE;
+#endif
+ x0213_f = TRUE;
+#ifdef SHIFTJIS_CP932
+ cp932inv_f = FALSE;
+#endif
+ }else if(strcmp(codeset, "SHIFT_JIS") == 0){
+ output_conv = s_oconv;
+ }else if(strcmp(codeset, "WINDOWS-31J") == 0 ||
+ strcmp(codeset, "CSWINDOWS31J") == 0 ||
+ strcmp(codeset, "CP932") == 0 ||
+ strcmp(codeset, "MS932") == 0){
+ output_conv = s_oconv;
+#ifdef UTF8_OUTPUT_ENABLE
+ ms_ucs_map_f = UCS_MAP_CP932;
+#endif
+ }else if(strcmp(codeset, "EUCJP") == 0 ||
+ strcmp(codeset, "EUC-JP") == 0){
+ output_conv = e_oconv;
+ }else if(strcmp(codeset, "CP51932") == 0){
+ output_conv = e_oconv;
#ifdef SHIFTJIS_CP932
- if (cp932inv_f == TRUE) cp932inv_f = FALSE;
+ cp932inv_f = FALSE;
#endif
- break;
- case SHIFT_JIS:
- break;
- case WINDOWS_31J:
#ifdef UTF8_OUTPUT_ENABLE
- ms_ucs_map_f = UCS_MAP_CP932;
+ ms_ucs_map_f = UCS_MAP_CP932;
+#endif
+ }else if(strcmp(codeset, "EUC-JP-MS") == 0 ||
+ strcmp(codeset, "EUCJP-MS") == 0 ||
+ strcmp(codeset, "EUCJPMS") == 0){
+ output_conv = e_oconv;
+#ifdef X0212_ENABLE
+ x0212_f = TRUE;
#endif
- break;
- case CP10001:
#ifdef UTF8_OUTPUT_ENABLE
- ms_ucs_map_f = UCS_MAP_CP10001;
+ ms_ucs_map_f = UCS_MAP_MS;
#endif
- break;
- case EUC_JP:
- x0212_f = TRUE;
-#ifdef SHIFTJIS_CP932
- if (cp932inv_f == TRUE) cp932inv_f = FALSE;
+ }else if(strcmp(codeset, "EUC-JP-ASCII") == 0 ||
+ strcmp(codeset, "EUCJP-ASCII") == 0){
+ output_conv = e_oconv;
+#ifdef X0212_ENABLE
+ x0212_f = TRUE;
#endif
#ifdef UTF8_OUTPUT_ENABLE
- ms_ucs_map_f = UCS_MAP_ASCII;
+ ms_ucs_map_f = UCS_MAP_ASCII;
#endif
- break;
- case EUCJP_NKF:
- x0212_f = FALSE;
+ }else if(strcmp(codeset, "SHIFT_JISX0213") == 0 ||
+ strcmp(codeset, "SHIFT_JIS-2004") == 0){
+ output_conv = s_oconv;
+ x0213_f = TRUE;
#ifdef SHIFTJIS_CP932
- if (cp932inv_f == TRUE) cp932inv_f = FALSE;
+ cp932inv_f = FALSE;
#endif
-#ifdef UTF8_OUTPUT_ENABLE
- ms_ucs_map_f = UCS_MAP_ASCII;
+ }else if(strcmp(codeset, "EUC-JISX0213") == 0 ||
+ strcmp(codeset, "EUC-JIS-2004") == 0){
+ output_conv = e_oconv;
+#ifdef X0212_ENABLE
+ x0212_f = TRUE;
#endif
- break;
- case CP51932:
+ x0213_f = TRUE;
#ifdef SHIFTJIS_CP932
- if (cp932inv_f == TRUE) cp932inv_f = FALSE;
+ cp932inv_f = FALSE;
#endif
#ifdef UTF8_OUTPUT_ENABLE
- ms_ucs_map_f = UCS_MAP_CP932;
+ }else if(strcmp(codeset, "UTF-8") == 0){
+ output_conv = w_oconv;
+ }else if(strcmp(codeset, "UTF-8N") == 0){
+ output_conv = w_oconv;
+ }else if(strcmp(codeset, "UTF-8-BOM") == 0){
+ output_conv = w_oconv;
+ output_bom_f = TRUE;
+ }else if(strcmp(codeset, "UTF-16BE") == 0){
+ output_conv = w_oconv16;
+ }else if(strcmp(codeset, "UTF-16") == 0 ||
+ strcmp(codeset, "UTF-16BE-BOM") == 0){
+ output_conv = w_oconv16;
+ output_bom_f = TRUE;
+ }else if(strcmp(codeset, "UTF-16LE") == 0){
+ output_conv = w_oconv16;
+ output_endian = ENDIAN_LITTLE;
+ }else if(strcmp(codeset, "UTF-16LE-BOM") == 0){
+ output_conv = w_oconv16;
+ output_endian = ENDIAN_LITTLE;
+ output_bom_f = TRUE;
+ }else if(strcmp(codeset, "UTF-32") == 0 ||
+ strcmp(codeset, "UTF-32BE") == 0){
+ output_conv = w_oconv32;
+ }else if(strcmp(codeset, "UTF-32BE-BOM") == 0){
+ output_conv = w_oconv32;
+ output_bom_f = TRUE;
+ }else if(strcmp(codeset, "UTF-32LE") == 0){
+ output_conv = w_oconv32;
+ output_endian = ENDIAN_LITTLE;
+ }else if(strcmp(codeset, "UTF-32LE-BOM") == 0){
+ output_conv = w_oconv32;
+ output_endian = ENDIAN_LITTLE;
+ output_bom_f = TRUE;
#endif
- break;
- case EUCJP_MS:
- x0212_f = TRUE;
-#ifdef UTF8_OUTPUT_ENABLE
- ms_ucs_map_f = UCS_MAP_MS;
+ }
+ continue;
+ }
+#ifdef OVERWRITE
+ if (strcmp(long_option[i].name, "overwrite") == 0){
+ file_out_f = TRUE;
+ overwrite_f = TRUE;
+ preserve_time_f = TRUE;
+ continue;
+ }
+ if (strcmp(long_option[i].name, "overwrite=") == 0){
+ file_out_f = TRUE;
+ overwrite_f = TRUE;
+ preserve_time_f = TRUE;
+ backup_f = TRUE;
+ backup_suffix = malloc(strlen((char *) p) + 1);
+ strcpy(backup_suffix, (char *) p);
+ continue;
+ }
+ if (strcmp(long_option[i].name, "in-place") == 0){
+ file_out_f = TRUE;
+ overwrite_f = TRUE;
+ preserve_time_f = FALSE;
+ continue;
+ }
+ if (strcmp(long_option[i].name, "in-place=") == 0){
+ file_out_f = TRUE;
+ overwrite_f = TRUE;
+ preserve_time_f = FALSE;
+ backup_f = TRUE;
+ backup_suffix = malloc(strlen((char *) p) + 1);
+ strcpy(backup_suffix, (char *) p);
+ continue;
+ }
+#endif
+#ifdef INPUT_OPTION
+ if (strcmp(long_option[i].name, "cap-input") == 0){
+ cap_f = TRUE;
+ continue;
+ }
+ if (strcmp(long_option[i].name, "url-input") == 0){
+ url_f = TRUE;
+ continue;
+ }
+#endif
+#ifdef NUMCHAR_OPTION
+ if (strcmp(long_option[i].name, "numchar-input") == 0){
+ numchar_f = TRUE;
+ continue;
+ }
+#endif
+#ifdef CHECK_OPTION
+ if (strcmp(long_option[i].name, "no-output") == 0){
+ noout_f = TRUE;
+ continue;
+ }
+ if (strcmp(long_option[i].name, "debug") == 0){
+ debug_f = TRUE;
+ continue;
+ }
+#endif
+ if (strcmp(long_option[i].name, "cp932") == 0){
+#ifdef SHIFTJIS_CP932
+ cp51932_f = TRUE;
+ cp932inv_f = TRUE;
#endif
- break;
- case EUCJP_ASCII:
- x0212_f = TRUE;
#ifdef UTF8_OUTPUT_ENABLE
- ms_ucs_map_f = UCS_MAP_ASCII;
+ ms_ucs_map_f = UCS_MAP_CP932;
#endif
- break;
- case SHIFT_JISX0213:
- case SHIFT_JIS_2004:
- x0213_f = TRUE;
+ continue;
+ }
+ if (strcmp(long_option[i].name, "no-cp932") == 0){
#ifdef SHIFTJIS_CP932
- if (cp932inv_f == TRUE) cp932inv_f = FALSE;
+ cp51932_f = FALSE;
+ cp932inv_f = FALSE;
#endif
- break;
- case EUC_JISX0213:
- case EUC_JIS_2004:
- x0212_f = TRUE;
- x0213_f = TRUE;
+#ifdef UTF8_OUTPUT_ENABLE
+ ms_ucs_map_f = UCS_MAP_ASCII;
+#endif
+ continue;
+ }
#ifdef SHIFTJIS_CP932
- if (cp932inv_f == TRUE) cp932inv_f = FALSE;
+ if (strcmp(long_option[i].name, "cp932inv") == 0){
+ cp932inv_f = TRUE;
+ continue;
+ }
+#endif
+
+#ifdef X0212_ENABLE
+ if (strcmp(long_option[i].name, "x0212") == 0){
+ x0212_f = TRUE;
+ continue;
+ }
+#endif
+
+#ifdef EXEC_IO
+ if (strcmp(long_option[i].name, "exec-in") == 0){
+ exec_f = 1;
+ return;
+ }
+ if (strcmp(long_option[i].name, "exec-out") == 0){
+ exec_f = -1;
+ return;
+ }
+#endif
+#if defined(UTF8_OUTPUT_ENABLE) && defined(UTF8_INPUT_ENABLE)
+ if (strcmp(long_option[i].name, "no-cp932ext") == 0){
+ no_cp932ext_f = TRUE;
+ continue;
+ }
+ if (strcmp(long_option[i].name, "no-best-fit-chars") == 0){
+ no_best_fit_chars_f = TRUE;
+ continue;
+ }
+ if (strcmp(long_option[i].name, "fb-skip") == 0){
+ encode_fallback = NULL;
+ continue;
+ }
+ if (strcmp(long_option[i].name, "fb-html") == 0){
+ encode_fallback = encode_fallback_html;
+ continue;
+ }
+ if (strcmp(long_option[i].name, "fb-xml" ) == 0){
+ encode_fallback = encode_fallback_xml;
+ continue;
+ }
+ if (strcmp(long_option[i].name, "fb-java") == 0){
+ encode_fallback = encode_fallback_java;
+ continue;
+ }
+ if (strcmp(long_option[i].name, "fb-perl") == 0){
+ encode_fallback = encode_fallback_perl;
+ continue;
+ }
+ if (strcmp(long_option[i].name, "fb-subchar") == 0){
+ encode_fallback = encode_fallback_subchar;
+ continue;
+ }
+ if (strcmp(long_option[i].name, "fb-subchar=") == 0){
+ encode_fallback = encode_fallback_subchar;
+ unicode_subchar = 0;
+ if (p[0] != '0'){
+ /* decimal number */
+ for (i = 0; i < 7 && nkf_isdigit(p[i]); i++){
+ unicode_subchar *= 10;
+ unicode_subchar += hex2bin(p[i]);
+ }
+ }else if(p[1] == 'x' || p[1] == 'X'){
+ /* hexadecimal number */
+ for (i = 2; i < 8 && nkf_isxdigit(p[i]); i++){
+ unicode_subchar <<= 4;
+ unicode_subchar |= hex2bin(p[i]);
+ }
+ }else{
+ /* octal number */
+ for (i = 1; i < 8 && nkf_isoctal(p[i]); i++){
+ unicode_subchar *= 8;
+ unicode_subchar += hex2bin(p[i]);
+ }
+ }
+ w16e_conv(unicode_subchar, &i, &j);
+ unicode_subchar = i<<8 | j;
+ continue;
+ }
#endif
- break;
#ifdef UTF8_OUTPUT_ENABLE
- case UTF_8_BOM:
- output_bom_f = TRUE;
- break;
- case UTF_16:
- case UTF_16BE_BOM:
- output_bom_f = TRUE;
- break;
- case UTF_16LE:
- output_endian = ENDIAN_LITTLE;
- output_bom_f = FALSE;
- break;
- case UTF_16LE_BOM:
- output_endian = ENDIAN_LITTLE;
- output_bom_f = TRUE;
- break;
- case UTF_32BE_BOM:
- output_bom_f = TRUE;
- break;
- case UTF_32LE:
- output_endian = ENDIAN_LITTLE;
- output_bom_f = FALSE;
- break;
- case UTF_32LE_BOM:
- output_endian = ENDIAN_LITTLE;
- output_bom_f = TRUE;
- break;
+ if (strcmp(long_option[i].name, "ms-ucs-map") == 0){
+ ms_ucs_map_f = UCS_MAP_MS;
+ continue;
+ }
+#endif
+#ifdef UNICODE_NORMALIZATION
+ if (strcmp(long_option[i].name, "utf8mac-input") == 0){
+ input_f = UTF8_INPUT;
+ nfc_f = TRUE;
+ continue;
+ }
+#endif
+ if (strcmp(long_option[i].name, "prefix=") == 0){
+ if (nkf_isgraph(p[0])){
+ for (i = 1; nkf_isgraph(p[i]); i++){
+ prefix_table[p[i]] = p[0];
+ }
+ }
+ continue;
+ }
+ }
+ continue;
+ case 'b': /* buffered mode */
+ unbuf_f = FALSE;
+ continue;
+ case 'u': /* non bufferd mode */
+ unbuf_f = TRUE;
+ continue;
+ case 't': /* transparent mode */
+ if (*cp=='1') {
+ /* alias of -t */
+ nop_f = TRUE;
+ *cp++;
+ } else if (*cp=='2') {
+ /*
+ * -t with put/get
+ *
+ * nkf -t2MB hoge.bin | nkf -t2mB | diff -s - hoge.bin
+ *
+ */
+ nop_f = 2;
+ *cp++;
+ } else
+ nop_f = TRUE;
+ continue;
+ case 'j': /* JIS output */
+ case 'n':
+ output_conv = j_oconv;
+ continue;
+ case 'e': /* AT&T EUC output */
+ output_conv = e_oconv;
+ cp932inv_f = FALSE;
+ continue;
+ case 's': /* SJIS output */
+ output_conv = s_oconv;
+ continue;
+ case 'l': /* ISO8859 Latin-1 support, no conversion */
+ iso8859_f = TRUE; /* Only compatible with ISO-2022-JP */
+ input_f = LATIN1_INPUT;
+ continue;
+ case 'i': /* Kanji IN ESC-$-@/B */
+ if (*cp=='@'||*cp=='B')
+ kanji_intro = *cp++;
+ continue;
+ case 'o': /* ASCII IN ESC-(-J/B */
+ if (*cp=='J'||*cp=='B'||*cp=='H')
+ ascii_intro = *cp++;
+ continue;
+ case 'h':
+ /*
+ bit:1 katakana->hiragana
+ bit:2 hiragana->katakana
+ */
+ if ('9'>= *cp && *cp>='0')
+ hira_f |= (*cp++ -'0');
+ else
+ hira_f |= 1;
+ continue;
+ case 'r':
+ rot_f = TRUE;
+ continue;
+#if defined(MSDOS) || defined(__OS2__)
+ case 'T':
+ binmode_f = FALSE;
+ continue;
+#endif
+#ifndef PERL_XS
+ case 'V':
+ version();
+ exit(1);
+ break;
+ case 'v':
+ usage();
+ exit(1);
+ break;
+#endif
+#ifdef UTF8_OUTPUT_ENABLE
+ case 'w': /* UTF-8 output */
+ if (cp[0] == '8') {
+ output_conv = w_oconv; cp++;
+ if (cp[0] == '0'){
+ cp++;
+ } else {
+ output_bom_f = TRUE;
+ }
+ } else {
+ if ('1'== cp[0] && '6'==cp[1]) {
+ output_conv = w_oconv16; cp+=2;
+ } else if ('3'== cp[0] && '2'==cp[1]) {
+ output_conv = w_oconv32; cp+=2;
+ } else {
+ output_conv = w_oconv;
+ continue;
+ }
+ if (cp[0]=='L') {
+ cp++;
+ output_endian = ENDIAN_LITTLE;
+ } else if (cp[0] == 'B') {
+ cp++;
+ } else {
+ continue;
+ }
+ if (cp[0] == '0'){
+ cp++;
+ } else {
+ output_bom_f = TRUE;
+ }
+ }
+ continue;
+#endif
+#ifdef UTF8_INPUT_ENABLE
+ case 'W': /* UTF input */
+ if (cp[0] == '8') {
+ cp++;
+ input_f = UTF8_INPUT;
+ }else{
+ if ('1'== cp[0] && '6'==cp[1]) {
+ cp += 2;
+ input_f = UTF16_INPUT;
+ input_endian = ENDIAN_BIG;
+ } else if ('3'== cp[0] && '2'==cp[1]) {
+ cp += 2;
+ input_f = UTF32_INPUT;
+ input_endian = ENDIAN_BIG;
+ } else {
+ input_f = UTF8_INPUT;
+ continue;
+ }
+ if (cp[0]=='L') {
+ cp++;
+ input_endian = ENDIAN_LITTLE;
+ } else if (cp[0] == 'B') {
+ cp++;
+ }
+ }
+ continue;
+#endif
+ /* Input code assumption */
+ case 'J': /* JIS input */
+ input_f = JIS_INPUT;
+ continue;
+ case 'E': /* AT&T EUC input */
+ input_f = EUC_INPUT;
+ continue;
+ case 'S': /* MS Kanji input */
+ input_f = SJIS_INPUT;
+ if (x0201_f==NO_X0201) x0201_f=TRUE;
+ continue;
+ case 'Z': /* Convert X0208 alphabet to asii */
+ /* bit:0 Convert X0208
+ bit:1 Convert Kankaku to one space
+ bit:2 Convert Kankaku to two spaces
+ bit:3 Convert HTML Entity
+ */
+ if ('9'>= *cp && *cp>='0')
+ alpha_f |= 1<<(*cp++ -'0');
+ else
+ alpha_f |= TRUE;
+ continue;
+ case 'x': /* Convert X0201 kana to X0208 or X0201 Conversion */
+ x0201_f = FALSE; /* No X0201->X0208 conversion */
+ /* accept X0201
+ ESC-(-I in JIS, EUC, MS Kanji
+ SI/SO in JIS, EUC, MS Kanji
+ SSO in EUC, JIS, not in MS Kanji
+ MS Kanji (0xa0-0xdf)
+ output X0201
+ ESC-(-I in JIS (0x20-0x5f)
+ SSO in EUC (0xa0-0xdf)
+ 0xa0-0xd in MS Kanji (0xa0-0xdf)
+ */
+ continue;
+ case 'X': /* Assume X0201 kana */
+ /* Default value is NO_X0201 for EUC/MS-Kanji mix */
+ x0201_f = TRUE;
+ continue;
+ case 'F': /* prserve new lines */
+ fold_preserve_f = TRUE;
+ case 'f': /* folding -f60 or -f */
+ fold_f = TRUE;
+ fold_len = 0;
+ while('0'<= *cp && *cp <='9') { /* we don't use atoi here */
+ fold_len *= 10;
+ fold_len += *cp++ - '0';
+ }
+ if (!(0<fold_len && fold_len<BUFSIZ))
+ fold_len = DEFAULT_FOLD;
+ if (*cp=='-') {
+ fold_margin = 0;
+ cp++;
+ while('0'<= *cp && *cp <='9') { /* we don't use atoi here */
+ fold_margin *= 10;
+ fold_margin += *cp++ - '0';
+ }
+ }
+ continue;
+ case 'm': /* MIME support */
+ /* mime_decode_f = TRUE; */ /* this has too large side effects... */
+ if (*cp=='B'||*cp=='Q') {
+ mime_decode_mode = *cp++;
+ mimebuf_f = FIXED_MIME;
+ } else if (*cp=='N') {
+ mime_f = TRUE; cp++;
+ } else if (*cp=='S') {
+ mime_f = STRICT_MIME; cp++;
+ } else if (*cp=='0') {
+ mime_decode_f = FALSE;
+ mime_f = FALSE; cp++;
+ }
+ continue;
+ case 'M': /* MIME output */
+ if (*cp=='B') {
+ mimeout_mode = 'B';
+ mimeout_f = FIXED_MIME; cp++;
+ } else if (*cp=='Q') {
+ mimeout_mode = 'Q';
+ mimeout_f = FIXED_MIME; cp++;
+ } else {
+ mimeout_f = TRUE;
+ }
+ continue;
+ case 'B': /* Broken JIS support */
+ /* bit:0 no ESC JIS
+ bit:1 allow any x on ESC-(-x or ESC-$-x
+ bit:2 reset to ascii on NL
+ */
+ if ('9'>= *cp && *cp>='0')
+ broken_f |= 1<<(*cp++ -'0');
+ else
+ broken_f |= TRUE;
+ continue;
+#ifndef PERL_XS
+ case 'O':/* for Output file */
+ file_out_f = TRUE;
+ continue;
+#endif
+ case 'c':/* add cr code */
+ crmode_f = CRLF;
+ continue;
+ case 'd':/* delete cr code */
+ crmode_f = NL;
+ continue;
+ case 'I': /* ISO-2022-JP output */
+ iso2022jp_f = TRUE;
+ continue;
+ case 'L': /* line mode */
+ if (*cp=='u') { /* unix */
+ crmode_f = NL; cp++;
+ } else if (*cp=='m') { /* mac */
+ crmode_f = CR; cp++;
+ } else if (*cp=='w') { /* windows */
+ crmode_f = CRLF; cp++;
+ } else if (*cp=='0') { /* no conversion */
+ crmode_f = 0; cp++;
+ }
+ continue;
+ case 'g':
+#ifndef PERL_XS
+ guess_f = TRUE;
#endif
+ continue;
+ case ' ':
+ /* module muliple options in a string are allowed for Perl moudle */
+ while(*cp && *cp++!='-');
+ continue;
+ default:
+ /* bogus option but ignored */
+ continue;
+ }
}
}
-static struct input_code*
-find_inputcode_byfunc(nkf_char (*iconv_func)(nkf_char c2,nkf_char c1,nkf_char c0))
+struct input_code * find_inputcode_byfunc(nkf_char (*iconv_func)(nkf_char c2,nkf_char c1,nkf_char c0))
{
if (iconv_func){
- struct input_code *p = input_code_list;
- while (p->name){
- if (iconv_func == p->iconv_func){
- return p;
- }
- p++;
- }
+ struct input_code *p = input_code_list;
+ while (p->name){
+ if (iconv_func == p->iconv_func){
+ return p;
+ }
+ p++;
+ }
}
return 0;
}
-static void
-set_iconv(nkf_char f, nkf_char (*iconv_func)(nkf_char c2,nkf_char c1,nkf_char c0))
+void set_iconv(nkf_char f, nkf_char (*iconv_func)(nkf_char c2,nkf_char c1,nkf_char c0))
{
#ifdef INPUT_CODE_FIX
- if (f || !input_encoding)
+ if (f || !input_f)
#endif
- if (estab_f != f){
- estab_f = f;
- }
+ if (estab_f != f){
+ estab_f = f;
+ }
if (iconv_func
#ifdef INPUT_CODE_FIX
- && (f == -TRUE || !input_encoding) /* -TRUE means "FORCE" */
+ && (f == -TRUE || !input_f) /* -TRUE means "FORCE" */
#endif
- ){
- iconv = iconv_func;
+ ){
+ iconv = iconv_func;
}
#ifdef CHECK_OPTION
if (estab_f && iconv_for_check != iconv){
- struct input_code *p = find_inputcode_byfunc(iconv);
- if (p){
- set_input_codename(p->name);
- debug(p->name);
- }
- iconv_for_check = iconv;
+ struct input_code *p = find_inputcode_byfunc(iconv);
+ if (p){
+ set_input_codename(p->name);
+ debug(input_codename);
+ }
+ iconv_for_check = iconv;
}
#endif
}
-#ifdef X0212_ENABLE
-static nkf_char
-x0212_shift(nkf_char c)
+#define SCORE_L2 (1) /* $BBh(B2$B?e=`4A;z(B */
+#define SCORE_KANA (SCORE_L2 << 1) /* $B$$$o$f$kH>3Q%+%J(B */
+#define SCORE_DEPEND (SCORE_KANA << 1) /* $B5!<o0MB8J8;z(B */
+#ifdef SHIFTJIS_CP932
+#define SCORE_CP932 (SCORE_DEPEND << 1) /* CP932 $B$K$h$kFI$_49$((B */
+#define SCORE_NO_EXIST (SCORE_CP932 << 1) /* $BB8:_$7$J$$J8;z(B */
+#else
+#define SCORE_NO_EXIST (SCORE_DEPEND << 1) /* $BB8:_$7$J$$J8;z(B */
+#endif
+#define SCORE_iMIME (SCORE_NO_EXIST << 1) /* MIME $B$K$h$k;XDj(B */
+#define SCORE_ERROR (SCORE_iMIME << 1) /* $B%(%i!<(B */
+
+#define SCORE_INIT (SCORE_iMIME)
+
+const nkf_char score_table_A0[] = {
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, SCORE_DEPEND, SCORE_DEPEND, SCORE_DEPEND,
+ SCORE_DEPEND, SCORE_DEPEND, SCORE_DEPEND, SCORE_NO_EXIST,
+};
+
+const nkf_char score_table_F0[] = {
+ SCORE_L2, SCORE_L2, SCORE_L2, SCORE_L2,
+ SCORE_L2, SCORE_DEPEND, SCORE_NO_EXIST, SCORE_NO_EXIST,
+ SCORE_DEPEND, SCORE_DEPEND, SCORE_DEPEND, SCORE_DEPEND,
+ SCORE_DEPEND, SCORE_NO_EXIST, SCORE_NO_EXIST, SCORE_ERROR,
+};
+
+void set_code_score(struct input_code *ptr, nkf_char score)
{
- nkf_char ret = c;
- c &= 0x7f;
- if (is_eucg3(ret)){
- if (0x75 <= c && c <= 0x7f){
- ret = c + (0x109 - 0x75);
- }
- }else{
- if (0x75 <= c && c <= 0x7f){
- ret = c + (0x113 - 0x75);
- }
+ if (ptr){
+ ptr->score |= score;
}
- return ret;
}
+void clr_code_score(struct input_code *ptr, nkf_char score)
+{
+ if (ptr){
+ ptr->score &= ~score;
+ }
+}
-static nkf_char
-x0212_unshift(nkf_char c)
+void code_score(struct input_code *ptr)
{
- nkf_char ret = c;
- if (0x7f <= c && c <= 0x88){
- ret = c + (0x75 - 0x7f);
- }else if (0x89 <= c && c <= 0x92){
- ret = PREFIX_EUCG3 | 0x80 | (c + (0x75 - 0x89));
+ nkf_char c2 = ptr->buf[0];
+#ifdef UTF8_OUTPUT_ENABLE
+ nkf_char c1 = ptr->buf[1];
+#endif
+ if (c2 < 0){
+ set_code_score(ptr, SCORE_ERROR);
+ }else if (c2 == SSO){
+ set_code_score(ptr, SCORE_KANA);
+#ifdef UTF8_OUTPUT_ENABLE
+ }else if (!e2w_conv(c2, c1)){
+ set_code_score(ptr, SCORE_NO_EXIST);
+#endif
+ }else if ((c2 & 0x70) == 0x20){
+ set_code_score(ptr, score_table_A0[c2 & 0x0f]);
+ }else if ((c2 & 0x70) == 0x70){
+ set_code_score(ptr, score_table_F0[c2 & 0x0f]);
+ }else if ((c2 & 0x70) >= 0x50){
+ set_code_score(ptr, SCORE_L2);
+ }
+}
+
+void status_disable(struct input_code *ptr)
+{
+ ptr->stat = -1;
+ ptr->buf[0] = -1;
+ code_score(ptr);
+ if (iconv == ptr->iconv_func) set_iconv(FALSE, 0);
+}
+
+void status_push_ch(struct input_code *ptr, nkf_char c)
+{
+ ptr->buf[ptr->index++] = c;
+}
+
+void status_clear(struct input_code *ptr)
+{
+ ptr->stat = 0;
+ ptr->index = 0;
+}
+
+void status_reset(struct input_code *ptr)
+{
+ status_clear(ptr);
+ ptr->score = SCORE_INIT;
+}
+
+void status_reinit(struct input_code *ptr)
+{
+ status_reset(ptr);
+ ptr->_file_stat = 0;
+}
+
+void status_check(struct input_code *ptr, nkf_char c)
+{
+ if (c <= DEL && estab_f){
+ status_reset(ptr);
+ }
+}
+
+void s_status(struct input_code *ptr, nkf_char c)
+{
+ switch(ptr->stat){
+ case -1:
+ status_check(ptr, c);
+ break;
+ case 0:
+ if (c <= DEL){
+ break;
+#ifdef NUMCHAR_OPTION
+ }else if (is_unicode_capsule(c)){
+ break;
+#endif
+ }else if (0xa1 <= c && c <= 0xdf){
+ status_push_ch(ptr, SSO);
+ status_push_ch(ptr, c);
+ code_score(ptr);
+ status_clear(ptr);
+ }else if ((0x81 <= c && c < 0xa0) || (0xe0 <= c && c <= 0xef)){
+ ptr->stat = 1;
+ status_push_ch(ptr, c);
+#ifdef SHIFTJIS_CP932
+ }else if (cp51932_f
+ && is_ibmext_in_sjis(c)){
+ ptr->stat = 2;
+ status_push_ch(ptr, c);
+#endif /* SHIFTJIS_CP932 */
+#ifdef X0212_ENABLE
+ }else if (x0212_f && 0xf0 <= c && c <= 0xfc){
+ ptr->stat = 1;
+ status_push_ch(ptr, c);
+#endif /* X0212_ENABLE */
+ }else{
+ status_disable(ptr);
+ }
+ break;
+ case 1:
+ if ((0x40 <= c && c <= 0x7e) || (0x80 <= c && c <= 0xfc)){
+ status_push_ch(ptr, c);
+ s2e_conv(ptr->buf[0], ptr->buf[1], &ptr->buf[0], &ptr->buf[1]);
+ code_score(ptr);
+ status_clear(ptr);
+ }else{
+ status_disable(ptr);
+ }
+ break;
+ case 2:
+#ifdef SHIFTJIS_CP932
+ if ((0x40 <= c && c <= 0x7e) || (0x80 <= c && c <= 0xfc)){
+ status_push_ch(ptr, c);
+ if (s2e_conv(ptr->buf[0], ptr->buf[1], &ptr->buf[0], &ptr->buf[1]) == 0){
+ set_code_score(ptr, SCORE_CP932);
+ status_clear(ptr);
+ break;
+ }
+ }
+#endif /* SHIFTJIS_CP932 */
+#ifndef X0212_ENABLE
+ status_disable(ptr);
+#endif
+ break;
}
- return ret;
}
+
+void e_status(struct input_code *ptr, nkf_char c)
+{
+ switch (ptr->stat){
+ case -1:
+ status_check(ptr, c);
+ break;
+ case 0:
+ if (c <= DEL){
+ break;
+#ifdef NUMCHAR_OPTION
+ }else if (is_unicode_capsule(c)){
+ break;
+#endif
+ }else if (SSO == c || (0xa1 <= c && c <= 0xfe)){
+ ptr->stat = 1;
+ status_push_ch(ptr, c);
+#ifdef X0212_ENABLE
+ }else if (0x8f == c){
+ ptr->stat = 2;
+ status_push_ch(ptr, c);
+#endif /* X0212_ENABLE */
+ }else{
+ status_disable(ptr);
+ }
+ break;
+ case 1:
+ if (0xa1 <= c && c <= 0xfe){
+ status_push_ch(ptr, c);
+ code_score(ptr);
+ status_clear(ptr);
+ }else{
+ status_disable(ptr);
+ }
+ break;
+#ifdef X0212_ENABLE
+ case 2:
+ if (0xa1 <= c && c <= 0xfe){
+ ptr->stat = 1;
+ status_push_ch(ptr, c);
+ }else{
+ status_disable(ptr);
+ }
#endif /* X0212_ENABLE */
+ }
+}
-static nkf_char
-e2s_conv(nkf_char c2, nkf_char c1, nkf_char *p2, nkf_char *p1)
+#ifdef UTF8_INPUT_ENABLE
+void w_status(struct input_code *ptr, nkf_char c)
{
- nkf_char ndx;
- if (is_eucg3(c2)){
- ndx = c2 & 0x7f;
- if (x0213_f){
- if((0x21 <= ndx && ndx <= 0x2F)){
- if (p2) *p2 = ((ndx - 1) >> 1) + 0xec - ndx / 8 * 3;
- if (p1) *p1 = c1 + ((ndx & 1) ? ((c1 < 0x60) ? 0x1f : 0x20) : 0x7e);
- return 0;
- }else if(0x6E <= ndx && ndx <= 0x7E){
- if (p2) *p2 = ((ndx - 1) >> 1) + 0xbe;
- if (p1) *p1 = c1 + ((ndx & 1) ? ((c1 < 0x60) ? 0x1f : 0x20) : 0x7e);
- return 0;
+ switch (ptr->stat){
+ case -1:
+ status_check(ptr, c);
+ break;
+ case 0:
+ if (c <= DEL){
+ break;
+#ifdef NUMCHAR_OPTION
+ }else if (is_unicode_capsule(c)){
+ break;
+#endif
+ }else if (0xc0 <= c && c <= 0xdf){
+ ptr->stat = 1;
+ status_push_ch(ptr, c);
+ }else if (0xe0 <= c && c <= 0xef){
+ ptr->stat = 2;
+ status_push_ch(ptr, c);
+ }else if (0xf0 <= c && c <= 0xf4){
+ ptr->stat = 3;
+ status_push_ch(ptr, c);
+ }else{
+ status_disable(ptr);
+ }
+ break;
+ case 1:
+ case 2:
+ if (0x80 <= c && c <= 0xbf){
+ status_push_ch(ptr, c);
+ if (ptr->index > ptr->stat){
+ int bom = (ptr->buf[0] == 0xef && ptr->buf[1] == 0xbb
+ && ptr->buf[2] == 0xbf);
+ w2e_conv(ptr->buf[0], ptr->buf[1], ptr->buf[2],
+ &ptr->buf[0], &ptr->buf[1]);
+ if (!bom){
+ code_score(ptr);
+ }
+ status_clear(ptr);
+ }
+ }else{
+ status_disable(ptr);
+ }
+ break;
+ case 3:
+ if (0x80 <= c && c <= 0xbf){
+ if (ptr->index < ptr->stat){
+ status_push_ch(ptr, c);
+ } else {
+ status_clear(ptr);
}
- return 1;
+ }else{
+ status_disable(ptr);
+ }
+ break;
+ }
+}
+#endif
+
+void code_status(nkf_char c)
+{
+ int action_flag = 1;
+ struct input_code *result = 0;
+ struct input_code *p = input_code_list;
+ while (p->name){
+ if (!p->status_func) {
+ ++p;
+ continue;
}
+ if (!p->status_func)
+ continue;
+ (p->status_func)(p, c);
+ if (p->stat > 0){
+ action_flag = 0;
+ }else if(p->stat == 0){
+ if (result){
+ action_flag = 0;
+ }else{
+ result = p;
+ }
+ }
+ ++p;
+ }
+
+ if (action_flag){
+ if (result && !estab_f){
+ set_iconv(TRUE, result->iconv_func);
+ }else if (c <= DEL){
+ struct input_code *ptr = input_code_list;
+ while (ptr->name){
+ status_reset(ptr);
+ ++ptr;
+ }
+ }
+ }
+}
+
+#ifndef WIN32DLL
+nkf_char std_getc(FILE *f)
+{
+ if (std_gc_ndx){
+ return std_gc_buf[--std_gc_ndx];
+ }
+ return getc(f);
+}
+#endif /*WIN32DLL*/
+
+nkf_char std_ungetc(nkf_char c, FILE *f)
+{
+ if (std_gc_ndx == STD_GC_BUFSIZE){
+ return EOF;
+ }
+ std_gc_buf[std_gc_ndx++] = c;
+ return c;
+}
+
+#ifndef WIN32DLL
+void std_putc(nkf_char c)
+{
+ if(c!=EOF)
+ putchar(c);
+}
+#endif /*WIN32DLL*/
+
+#if !defined(PERL_XS) && !defined(WIN32DLL)
+nkf_char noconvert(FILE *f)
+{
+ nkf_char c;
+
+ if (nop_f == 2)
+ module_connection();
+ while ((c = (*i_getc)(f)) != EOF)
+ (*o_putc)(c);
+ (*o_putc)(EOF);
+ return 1;
+}
+#endif
+
+void module_connection(void)
+{
+ oconv = output_conv;
+ o_putc = std_putc;
+
+ /* replace continucation module, from output side */
+
+ /* output redicrection */
+#ifdef CHECK_OPTION
+ if (noout_f || guess_f){
+ o_putc = no_putc;
+ }
+#endif
+ if (mimeout_f) {
+ o_mputc = o_putc;
+ o_putc = mime_putc;
+ if (mimeout_f == TRUE) {
+ o_base64conv = oconv; oconv = base64_conv;
+ }
+ /* base64_count = 0; */
+ }
+
+ if (crmode_f) {
+ o_crconv = oconv; oconv = cr_conv;
+ }
+ if (rot_f) {
+ o_rot_conv = oconv; oconv = rot_conv;
+ }
+ if (iso2022jp_f) {
+ o_iso2022jp_check_conv = oconv; oconv = iso2022jp_check_conv;
+ }
+ if (hira_f) {
+ o_hira_conv = oconv; oconv = hira_conv;
+ }
+ if (fold_f) {
+ o_fconv = oconv; oconv = fold_conv;
+ f_line = 0;
+ }
+ if (alpha_f || x0201_f) {
+ o_zconv = oconv; oconv = z_conv;
+ }
+
+ i_getc = std_getc;
+ i_ungetc = std_ungetc;
+ /* input redicrection */
+#ifdef INPUT_OPTION
+ if (cap_f){
+ i_cgetc = i_getc; i_getc = cap_getc;
+ i_cungetc = i_ungetc; i_ungetc= cap_ungetc;
+ }
+ if (url_f){
+ i_ugetc = i_getc; i_getc = url_getc;
+ i_uungetc = i_ungetc; i_ungetc= url_ungetc;
+ }
+#endif
+#ifdef NUMCHAR_OPTION
+ if (numchar_f){
+ i_ngetc = i_getc; i_getc = numchar_getc;
+ i_nungetc = i_ungetc; i_ungetc= numchar_ungetc;
+ }
+#endif
+#ifdef UNICODE_NORMALIZATION
+ if (nfc_f && input_f == UTF8_INPUT){
+ i_nfc_getc = i_getc; i_getc = nfc_getc;
+ i_nfc_ungetc = i_ungetc; i_ungetc= nfc_ungetc;
+ }
+#endif
+ if (mime_f && mimebuf_f==FIXED_MIME) {
+ i_mgetc = i_getc; i_getc = mime_getc;
+ i_mungetc = i_ungetc; i_ungetc = mime_ungetc;
+ }
+ if (broken_f & 1) {
+ i_bgetc = i_getc; i_getc = broken_getc;
+ i_bungetc = i_ungetc; i_ungetc = broken_ungetc;
+ }
+ if (input_f == JIS_INPUT || input_f == EUC_INPUT || input_f == LATIN1_INPUT) {
+ set_iconv(-TRUE, e_iconv);
+ } else if (input_f == SJIS_INPUT) {
+ set_iconv(-TRUE, s_iconv);
+#ifdef UTF8_INPUT_ENABLE
+ } else if (input_f == UTF8_INPUT) {
+ set_iconv(-TRUE, w_iconv);
+ } else if (input_f == UTF16_INPUT) {
+ set_iconv(-TRUE, w_iconv16);
+ } else if (input_f == UTF32_INPUT) {
+ set_iconv(-TRUE, w_iconv32);
+#endif
+ } else {
+ set_iconv(FALSE, e_iconv);
+ }
+
+ {
+ struct input_code *p = input_code_list;
+ while (p->name){
+ status_reinit(p++);
+ }
+ }
+}
+
+/*
+ * Check and Ignore BOM
+ */
+void check_bom(FILE *f)
+{
+ int c2;
+ switch(c2 = (*i_getc)(f)){
+ case 0x00:
+ if((c2 = (*i_getc)(f)) == 0x00){
+ if((c2 = (*i_getc)(f)) == 0xFE){
+ if((c2 = (*i_getc)(f)) == 0xFF){
+ if(!input_f){
+ set_iconv(TRUE, w_iconv32);
+ }
+ if (iconv == w_iconv32) {
+ input_endian = ENDIAN_BIG;
+ return;
+ }
+ (*i_ungetc)(0xFF,f);
+ }else (*i_ungetc)(c2,f);
+ (*i_ungetc)(0xFE,f);
+ }else if(c2 == 0xFF){
+ if((c2 = (*i_getc)(f)) == 0xFE){
+ if(!input_f){
+ set_iconv(TRUE, w_iconv32);
+ }
+ if (iconv == w_iconv32) {
+ input_endian = ENDIAN_2143;
+ return;
+ }
+ (*i_ungetc)(0xFF,f);
+ }else (*i_ungetc)(c2,f);
+ (*i_ungetc)(0xFF,f);
+ }else (*i_ungetc)(c2,f);
+ (*i_ungetc)(0x00,f);
+ }else (*i_ungetc)(c2,f);
+ (*i_ungetc)(0x00,f);
+ break;
+ case 0xEF:
+ if((c2 = (*i_getc)(f)) == 0xBB){
+ if((c2 = (*i_getc)(f)) == 0xBF){
+ if(!input_f){
+ set_iconv(TRUE, w_iconv);
+ }
+ if (iconv == w_iconv) {
+ return;
+ }
+ (*i_ungetc)(0xBF,f);
+ }else (*i_ungetc)(c2,f);
+ (*i_ungetc)(0xBB,f);
+ }else (*i_ungetc)(c2,f);
+ (*i_ungetc)(0xEF,f);
+ break;
+ case 0xFE:
+ if((c2 = (*i_getc)(f)) == 0xFF){
+ if((c2 = (*i_getc)(f)) == 0x00){
+ if((c2 = (*i_getc)(f)) == 0x00){
+ if(!input_f){
+ set_iconv(TRUE, w_iconv32);
+ }
+ if (iconv == w_iconv32) {
+ input_endian = ENDIAN_3412;
+ return;
+ }
+ (*i_ungetc)(0x00,f);
+ }else (*i_ungetc)(c2,f);
+ (*i_ungetc)(0x00,f);
+ }else (*i_ungetc)(c2,f);
+ if(!input_f){
+ set_iconv(TRUE, w_iconv16);
+ }
+ if (iconv == w_iconv16) {
+ input_endian = ENDIAN_BIG;
+ return;
+ }
+ (*i_ungetc)(0xFF,f);
+ }else (*i_ungetc)(c2,f);
+ (*i_ungetc)(0xFE,f);
+ break;
+ case 0xFF:
+ if((c2 = (*i_getc)(f)) == 0xFE){
+ if((c2 = (*i_getc)(f)) == 0x00){
+ if((c2 = (*i_getc)(f)) == 0x00){
+ if(!input_f){
+ set_iconv(TRUE, w_iconv32);
+ }
+ if (iconv == w_iconv32) {
+ input_endian = ENDIAN_LITTLE;
+ return;
+ }
+ (*i_ungetc)(0x00,f);
+ }else (*i_ungetc)(c2,f);
+ (*i_ungetc)(0x00,f);
+ }else (*i_ungetc)(c2,f);
+ if(!input_f){
+ set_iconv(TRUE, w_iconv16);
+ }
+ if (iconv == w_iconv16) {
+ input_endian = ENDIAN_LITTLE;
+ return;
+ }
+ (*i_ungetc)(0xFE,f);
+ }else (*i_ungetc)(c2,f);
+ (*i_ungetc)(0xFF,f);
+ break;
+ default:
+ (*i_ungetc)(c2,f);
+ break;
+ }
+}
+
+/*
+ Conversion main loop. Code detection only.
+ */
+
+nkf_char kanji_convert(FILE *f)
+{
+ nkf_char c3, c2=0, c1, c0=0;
+ int is_8bit = FALSE;
+
+ if(input_f == SJIS_INPUT || input_f == EUC_INPUT
+#ifdef UTF8_INPUT_ENABLE
+ || input_f == UTF8_INPUT || input_f == UTF16_INPUT
+#endif
+ ){
+ is_8bit = TRUE;
+ }
+
+ input_mode = ASCII;
+ output_mode = ASCII;
+ shift_mode = FALSE;
+
+#define NEXT continue /* no output, get next */
+#define SEND ; /* output c1 and c2, get next */
+#define LAST break /* end of loop, go closing */
+
+ module_connection();
+ check_bom(f);
+
+ while ((c1 = (*i_getc)(f)) != EOF) {
+#ifdef INPUT_CODE_FIX
+ if (!input_f)
+#endif
+ code_status(c1);
+ if (c2) {
+ /* second byte */
+ if (c2 > ((input_f == JIS_INPUT && ms_ucs_map_f) ? 0x92 : DEL)) {
+ /* in case of 8th bit is on */
+ if (!estab_f&&!mime_decode_mode) {
+ /* in case of not established yet */
+ /* It is still ambiguious */
+ if (h_conv(f, c2, c1)==EOF)
+ LAST;
+ else
+ c2 = 0;
+ NEXT;
+ } else {
+ /* in case of already established */
+ if (c1 < AT) {
+ /* ignore bogus code and not CP5022x UCD */
+ c2 = 0;
+ NEXT;
+ } else {
+ SEND;
+ }
+ }
+ } else
+ /* second byte, 7 bit code */
+ /* it might be kanji shitfted */
+ if ((c1 == DEL) || (c1 <= SPACE)) {
+ /* ignore bogus first code */
+ c2 = 0;
+ NEXT;
+ } else
+ SEND;
+ } else {
+ /* first byte */
+#ifdef UTF8_INPUT_ENABLE
+ if (iconv == w_iconv16) {
+ if (input_endian == ENDIAN_BIG) {
+ c2 = c1;
+ if ((c1 = (*i_getc)(f)) != EOF) {
+ if (0xD8 <= c2 && c2 <= 0xDB) {
+ if ((c0 = (*i_getc)(f)) != EOF) {
+ c0 <<= 8;
+ if ((c3 = (*i_getc)(f)) != EOF) {
+ c0 |= c3;
+ } else c2 = EOF;
+ } else c2 = EOF;
+ }
+ } else c2 = EOF;
+ } else {
+ if ((c2 = (*i_getc)(f)) != EOF) {
+ if (0xD8 <= c2 && c2 <= 0xDB) {
+ if ((c3 = (*i_getc)(f)) != EOF) {
+ if ((c0 = (*i_getc)(f)) != EOF) {
+ c0 <<= 8;
+ c0 |= c3;
+ } else c2 = EOF;
+ } else c2 = EOF;
+ }
+ } else c2 = EOF;
+ }
+ SEND;
+ } else if(iconv == w_iconv32){
+ int c3 = c1;
+ if((c2 = (*i_getc)(f)) != EOF &&
+ (c1 = (*i_getc)(f)) != EOF &&
+ (c0 = (*i_getc)(f)) != EOF){
+ switch(input_endian){
+ case ENDIAN_BIG:
+ c1 = (c2&0xFF)<<16 | (c1&0xFF)<<8 | (c0&0xFF);
+ break;
+ case ENDIAN_LITTLE:
+ c1 = (c3&0xFF) | (c2&0xFF)<<8 | (c1&0xFF)<<16;
+ break;
+ case ENDIAN_2143:
+ c1 = (c3&0xFF)<<16 | (c1&0xFF) | (c0&0xFF)<<8;
+ break;
+ case ENDIAN_3412:
+ c1 = (c3&0xFF)<<8 | (c2&0xFF) | (c0&0xFF)<<16;
+ break;
+ }
+ c2 = 0;
+ }else{
+ c2 = EOF;
+ }
+ SEND;
+ } else
+#endif
+#ifdef NUMCHAR_OPTION
+ if (is_unicode_capsule(c1)){
+ SEND;
+ } else
+#endif
+ if (c1 > ((input_f == JIS_INPUT && ms_ucs_map_f) ? 0x92 : DEL)) {
+ /* 8 bit code */
+ if (!estab_f && !iso8859_f) {
+ /* not established yet */
+ c2 = c1;
+ NEXT;
+ } else { /* estab_f==TRUE */
+ if (iso8859_f) {
+ c2 = ISO8859_1;
+ c1 &= 0x7f;
+ SEND;
+ } else if (SSP<=c1 && c1<0xe0 && iconv == s_iconv) {
+ /* SJIS X0201 Case... */
+ if(iso2022jp_f && x0201_f==NO_X0201) {
+ (*oconv)(GETA1, GETA2);
+ NEXT;
+ } else {
+ c2 = X0201;
+ c1 &= 0x7f;
+ SEND;
+ }
+ } else if (c1==SSO && iconv != s_iconv) {
+ /* EUC X0201 Case */
+ c1 = (*i_getc)(f); /* skip SSO */
+ code_status(c1);
+ if (SSP<=c1 && c1<0xe0) {
+ if(iso2022jp_f && x0201_f==NO_X0201) {
+ (*oconv)(GETA1, GETA2);
+ NEXT;
+ } else {
+ c2 = X0201;
+ c1 &= 0x7f;
+ SEND;
+ }
+ } else { /* bogus code, skip SSO and one byte */
+ NEXT;
+ }
+ } else {
+ /* already established */
+ c2 = c1;
+ NEXT;
+ }
+ }
+ } else if ((c1 > SPACE) && (c1 != DEL)) {
+ /* in case of Roman characters */
+ if (shift_mode) {
+ /* output 1 shifted byte */
+ if (iso8859_f) {
+ c2 = ISO8859_1;
+ SEND;
+ } else if (SPACE<=c1 && c1<(0xe0&0x7f) ){
+ /* output 1 shifted byte */
+ if(iso2022jp_f && x0201_f==NO_X0201) {
+ (*oconv)(GETA1, GETA2);
+ NEXT;
+ } else {
+ c2 = X0201;
+ SEND;
+ }
+ } else {
+ /* look like bogus code */
+ NEXT;
+ }
+ } else if (input_mode == X0208 || input_mode == X0212 ||
+ input_mode == X0213_1 || input_mode == X0213_2) {
+ /* in case of Kanji shifted */
+ c2 = c1;
+ NEXT;
+ } else if (c1 == '=' && mime_f && !mime_decode_mode ) {
+ /* Check MIME code */
+ if ((c1 = (*i_getc)(f)) == EOF) {
+ (*oconv)(0, '=');
+ LAST;
+ } else if (c1 == '?') {
+ /* =? is mime conversion start sequence */
+ if(mime_f == STRICT_MIME) {
+ /* check in real detail */
+ if (mime_begin_strict(f) == EOF)
+ LAST;
+ else
+ NEXT;
+ } else if (mime_begin(f) == EOF)
+ LAST;
+ else
+ NEXT;
+ } else {
+ (*oconv)(0, '=');
+ (*i_ungetc)(c1,f);
+ NEXT;
+ }
+ } else {
+ /* normal ASCII code */
+ SEND;
+ }
+ } else if (c1 == SI && (!is_8bit || mime_decode_mode)) {
+ shift_mode = FALSE;
+ NEXT;
+ } else if (c1 == SO && (!is_8bit || mime_decode_mode)) {
+ shift_mode = TRUE;
+ NEXT;
+ } else if (c1 == ESC && (!is_8bit || mime_decode_mode)) {
+ if ((c1 = (*i_getc)(f)) == EOF) {
+ /* (*oconv)(0, ESC); don't send bogus code */
+ LAST;
+ } else if (c1 == '$') {
+ if ((c1 = (*i_getc)(f)) == EOF) {
+ /*
+ (*oconv)(0, ESC); don't send bogus code
+ (*oconv)(0, '$'); */
+ LAST;
+ } else if (c1 == '@'|| c1 == 'B') {
+ /* This is kanji introduction */
+ input_mode = X0208;
+ shift_mode = FALSE;
+ set_input_codename("ISO-2022-JP");
+#ifdef CHECK_OPTION
+ debug(input_codename);
+#endif
+ NEXT;
+ } else if (c1 == '(') {
+ if ((c1 = (*i_getc)(f)) == EOF) {
+ /* don't send bogus code
+ (*oconv)(0, ESC);
+ (*oconv)(0, '$');
+ (*oconv)(0, '(');
+ */
+ LAST;
+ } else if (c1 == '@'|| c1 == 'B') {
+ /* This is kanji introduction */
+ input_mode = X0208;
+ shift_mode = FALSE;
+ NEXT;
#ifdef X0212_ENABLE
- else if(nkf_isgraph(ndx)){
- nkf_char val = 0;
- const unsigned short *ptr;
- ptr = x0212_shiftjis[ndx - 0x21];
- if (ptr){
- val = ptr[(c1 & 0x7f) - 0x21];
+ } else if (c1 == 'D'){
+ input_mode = X0212;
+ shift_mode = FALSE;
+ NEXT;
+#endif /* X0212_ENABLE */
+ } else if (c1 == (X0213_1&0x7F)){
+ input_mode = X0213_1;
+ shift_mode = FALSE;
+ NEXT;
+ } else if (c1 == (X0213_2&0x7F)){
+ input_mode = X0213_2;
+ shift_mode = FALSE;
+ NEXT;
+ } else {
+ /* could be some special code */
+ (*oconv)(0, ESC);
+ (*oconv)(0, '$');
+ (*oconv)(0, '(');
+ (*oconv)(0, c1);
+ NEXT;
+ }
+ } else if (broken_f&0x2) {
+ /* accept any ESC-(-x as broken code ... */
+ input_mode = X0208;
+ shift_mode = FALSE;
+ NEXT;
+ } else {
+ (*oconv)(0, ESC);
+ (*oconv)(0, '$');
+ (*oconv)(0, c1);
+ NEXT;
+ }
+ } else if (c1 == '(') {
+ if ((c1 = (*i_getc)(f)) == EOF) {
+ /* don't send bogus code
+ (*oconv)(0, ESC);
+ (*oconv)(0, '('); */
+ LAST;
+ } else {
+ if (c1 == 'I') {
+ /* This is X0201 kana introduction */
+ input_mode = X0201; shift_mode = X0201;
+ NEXT;
+ } else if (c1 == 'B' || c1 == 'J' || c1 == 'H') {
+ /* This is X0208 kanji introduction */
+ input_mode = ASCII; shift_mode = FALSE;
+ NEXT;
+ } else if (broken_f&0x2) {
+ input_mode = ASCII; shift_mode = FALSE;
+ NEXT;
+ } else {
+ (*oconv)(0, ESC);
+ (*oconv)(0, '(');
+ /* maintain various input_mode here */
+ SEND;
+ }
+ }
+ } else if ( c1 == 'N' || c1 == 'n' ){
+ /* SS2 */
+ c3 = (*i_getc)(f); /* skip SS2 */
+ if ( (SPACE<=c3 && c3 < 0x60) || (0xa0<=c3 && c3 < 0xe0)){
+ c1 = c3;
+ c2 = X0201;
+ SEND;
+ }else{
+ (*i_ungetc)(c3, f);
+ /* lonely ESC */
+ (*oconv)(0, ESC);
+ SEND;
+ }
+ } else {
+ /* lonely ESC */
+ (*oconv)(0, ESC);
+ SEND;
+ }
+ } else if (c1 == ESC && iconv == s_iconv) {
+ /* ESC in Shift_JIS */
+ if ((c1 = (*i_getc)(f)) == EOF) {
+ /* (*oconv)(0, ESC); don't send bogus code */
+ LAST;
+ } else if (c1 == '$') {
+ /* J-PHONE emoji */
+ if ((c1 = (*i_getc)(f)) == EOF) {
+ /*
+ (*oconv)(0, ESC); don't send bogus code
+ (*oconv)(0, '$'); */
+ LAST;
+ } else {
+ if (('E' <= c1 && c1 <= 'G') ||
+ ('O' <= c1 && c1 <= 'Q')) {
+ /*
+ NUM : 0 1 2 3 4 5
+ BYTE: G E F O P Q
+ C%7 : 1 6 0 2 3 4
+ C%7 : 0 1 2 3 4 5 6
+ NUM : 2 0 3 4 5 X 1
+ */
+ static const int jphone_emoji_first_table[7] = {2, 0, 3, 4, 5, 0, 1};
+ c0 = (jphone_emoji_first_table[c1 % 7] << 8) - SPACE + 0xE000 + CLASS_UNICODE;
+ while ((c1 = (*i_getc)(f)) != EOF) {
+ if (SPACE <= c1 && c1 <= 'z') {
+ (*oconv)(0, c1 + c0);
+ } else break; /* c1 == SO */
+ }
+ }
+ }
+ if (c1 == EOF) LAST;
+ NEXT;
+ } else {
+ /* lonely ESC */
+ (*oconv)(0, ESC);
+ SEND;
+ }
+ } else if ((c1 == NL || c1 == CR) && broken_f&4) {
+ input_mode = ASCII; set_iconv(FALSE, 0);
+ SEND;
+ } else if (c1 == NL && mime_decode_f && !mime_decode_mode ) {
+ if ((c1=(*i_getc)(f))!=EOF && c1 == SPACE) {
+ i_ungetc(SPACE,f);
+ continue;
+ } else {
+ i_ungetc(c1,f);
+ }
+ c1 = NL;
+ SEND;
+ } else if (c1 == CR && mime_decode_f && !mime_decode_mode ) {
+ if ((c1=(*i_getc)(f))!=EOF) {
+ if (c1==SPACE) {
+ i_ungetc(SPACE,f);
+ continue;
+ } else if (c1 == NL && (c1=(*i_getc)(f))!=EOF && c1 == SPACE) {
+ i_ungetc(SPACE,f);
+ continue;
+ } else {
+ i_ungetc(c1,f);
+ }
+ i_ungetc(NL,f);
+ } else {
+ i_ungetc(c1,f);
+ }
+ c1 = CR;
+ SEND;
+ } else if (c1 == DEL && input_mode == X0208 ) {
+ /* CP5022x */
+ c2 = c1;
+ NEXT;
+ } else
+ SEND;
+ }
+ /* send: */
+ switch(input_mode){
+ case ASCII:
+ switch ((*iconv)(c2, c1, c0)) { /* can be EUC / SJIS / UTF-8 / UTF-16 */
+ case -2:
+ /* 4 bytes UTF-8 */
+ if ((c0 = (*i_getc)(f)) != EOF) {
+ code_status(c0);
+ c0 <<= 8;
+ if ((c3 = (*i_getc)(f)) != EOF) {
+ code_status(c3);
+ (*iconv)(c2, c1, c0|c3);
+ }
+ }
+ break;
+ case -1:
+ /* 3 bytes EUC or UTF-8 */
+ if ((c0 = (*i_getc)(f)) != EOF) {
+ code_status(c0);
+ (*iconv)(c2, c1, c0);
+ }
+ break;
}
- if (val){
- c2 = val >> 8;
- c1 = val & 0xff;
- if (p2) *p2 = c2;
- if (p1) *p1 = c1;
- return 0;
+ break;
+ case X0208:
+ case X0213_1:
+ if (ms_ucs_map_f &&
+ 0x7F <= c2 && c2 <= 0x92 &&
+ 0x21 <= c1 && c1 <= 0x7E) {
+ /* CP932 UDC */
+ if(c1 == 0x7F) return 0;
+ c1 = (c2 - 0x7F) * 94 + c1 - 0x21 + 0xE000 + CLASS_UNICODE;
+ c2 = 0;
}
- c2 = x0212_shift(c2);
- }
+ (*oconv)(c2, c1); /* this is JIS, not SJIS/EUC case */
+ break;
+#ifdef X0212_ENABLE
+ case X0212:
+ (*oconv)(PREFIX_EUCG3 | c2, c1);
+ break;
#endif /* X0212_ENABLE */
+ case X0213_2:
+ (*oconv)(PREFIX_EUCG3 | c2, c1);
+ break;
+ default:
+ (*oconv)(input_mode, c1); /* other special case */
+ }
+
+ c2 = 0;
+ c0 = 0;
+ continue;
+ /* goto next_word */
}
- if(0x7F < c2) return 1;
- if (p2) *p2 = ((c2 - 1) >> 1) + ((c2 <= 0x5e) ? 0x71 : 0xb1);
- if (p1) *p1 = c1 + ((c2 & 1) ? ((c1 < 0x60) ? 0x1f : 0x20) : 0x7e);
- return 0;
+
+ /* epilogue */
+ (*iconv)(EOF, 0, 0);
+ if (!is_inputcode_set)
+ {
+ if (is_8bit) {
+ struct input_code *p = input_code_list;
+ struct input_code *result = p;
+ while (p->name){
+ if (p->score < result->score) result = p;
+ ++p;
+ }
+ set_input_codename(result->name);
+ }
+ }
+ return 1;
+}
+
+nkf_char
+h_conv(FILE *f, nkf_char c2, nkf_char c1)
+{
+ nkf_char ret, c3, c0;
+ int hold_index;
+
+
+ /** it must NOT be in the kanji shifte sequence */
+ /** it must NOT be written in JIS7 */
+ /** and it must be after 2 byte 8bit code */
+
+ hold_count = 0;
+ push_hold_buf(c2);
+ push_hold_buf(c1);
+
+ while ((c1 = (*i_getc)(f)) != EOF) {
+ if (c1 == ESC){
+ (*i_ungetc)(c1,f);
+ break;
+ }
+ code_status(c1);
+ if (push_hold_buf(c1) == EOF || estab_f){
+ break;
+ }
+ }
+
+ if (!estab_f){
+ struct input_code *p = input_code_list;
+ struct input_code *result = p;
+ if (c1 == EOF){
+ code_status(c1);
+ }
+ while (p->name){
+ if (p->status_func && p->score < result->score){
+ result = p;
+ }
+ ++p;
+ }
+ set_iconv(TRUE, result->iconv_func);
+ }
+
+
+ /** now,
+ ** 1) EOF is detected, or
+ ** 2) Code is established, or
+ ** 3) Buffer is FULL (but last word is pushed)
+ **
+ ** in 1) and 3) cases, we continue to use
+ ** Kanji codes by oconv and leave estab_f unchanged.
+ **/
+
+ ret = c1;
+ hold_index = 0;
+ while (hold_index < hold_count){
+ c2 = hold_buf[hold_index++];
+ if (c2 <= DEL
+#ifdef NUMCHAR_OPTION
+ || is_unicode_capsule(c2)
+#endif
+ ){
+ (*iconv)(0, c2, 0);
+ continue;
+ }else if (iconv == s_iconv && 0xa1 <= c2 && c2 <= 0xdf){
+ (*iconv)(X0201, c2, 0);
+ continue;
+ }
+ if (hold_index < hold_count){
+ c1 = hold_buf[hold_index++];
+ }else{
+ c1 = (*i_getc)(f);
+ if (c1 == EOF){
+ c3 = EOF;
+ break;
+ }
+ code_status(c1);
+ }
+ c0 = 0;
+ switch ((*iconv)(c2, c1, 0)) { /* can be EUC/SJIS/UTF-8 */
+ case -2:
+ /* 4 bytes UTF-8 */
+ if (hold_index < hold_count){
+ c0 = hold_buf[hold_index++];
+ } else if ((c0 = (*i_getc)(f)) == EOF) {
+ ret = EOF;
+ break;
+ } else {
+ code_status(c0);
+ c0 <<= 8;
+ if (hold_index < hold_count){
+ c3 = hold_buf[hold_index++];
+ } else if ((c3 = (*i_getc)(f)) == EOF) {
+ c0 = ret = EOF;
+ break;
+ } else {
+ code_status(c3);
+ (*iconv)(c2, c1, c0|c3);
+ }
+ }
+ break;
+ case -1:
+ /* 3 bytes EUC or UTF-8 */
+ if (hold_index < hold_count){
+ c0 = hold_buf[hold_index++];
+ } else if ((c0 = (*i_getc)(f)) == EOF) {
+ ret = EOF;
+ break;
+ } else {
+ code_status(c0);
+ }
+ (*iconv)(c2, c1, c0);
+ break;
+ }
+ if (c0 == EOF) break;
+ }
+ return ret;
}
-static nkf_char
-s2e_conv(nkf_char c2, nkf_char c1, nkf_char *p2, nkf_char *p1)
+nkf_char push_hold_buf(nkf_char c2)
+{
+ if (hold_count >= HOLD_SIZE*2)
+ return (EOF);
+ hold_buf[hold_count++] = (unsigned char)c2;
+ return ((hold_count >= HOLD_SIZE*2) ? EOF : hold_count);
+}
+
+nkf_char s2e_conv(nkf_char c2, nkf_char c1, nkf_char *p2, nkf_char *p1)
{
#if defined(SHIFTJIS_CP932) || defined(X0212_ENABLE)
nkf_char val;
#endif
- static const char shift_jisx0213_s1a3_table[5][2] ={ { 1, 8}, { 3, 4}, { 5,12}, {13,14}, {15, 0} };
- if (0xFC < c1) return 1;
+ static const nkf_char shift_jisx0213_s1a3_table[5][2] ={ { 1, 8}, { 3, 4}, { 5,12}, {13,14}, {15, 0} };
#ifdef SHIFTJIS_CP932
if (!cp932inv_f && is_ibmext_in_sjis(c2)){
- val = shiftjis_cp932[c2 - CP932_TABLE_BEGIN][c1 - 0x40];
- if (val){
- c2 = val >> 8;
- c1 = val & 0xff;
- }
+#if 0
+ extern const unsigned short shiftjis_cp932[3][189];
+#endif
+ val = shiftjis_cp932[c2 - CP932_TABLE_BEGIN][c1 - 0x40];
+ if (val){
+ c2 = val >> 8;
+ c1 = val & 0xff;
+ }
}
if (cp932inv_f
- && CP932INV_TABLE_BEGIN <= c2 && c2 <= CP932INV_TABLE_END){
- val = cp932inv[c2 - CP932INV_TABLE_BEGIN][c1 - 0x40];
- if (val){
- c2 = val >> 8;
- c1 = val & 0xff;
- }
+ && CP932INV_TABLE_BEGIN <= c2 && c2 <= CP932INV_TABLE_END){
+#if 0
+ extern const unsigned short cp932inv[2][189];
+#endif
+ nkf_char c = cp932inv[c2 - CP932INV_TABLE_BEGIN][c1 - 0x40];
+ if (c){
+ c2 = c >> 8;
+ c1 = c & 0xff;
+ }
}
#endif /* SHIFTJIS_CP932 */
#ifdef X0212_ENABLE
if (!x0213_f && is_ibmext_in_sjis(c2)){
- val = shiftjis_x0212[c2 - 0xfa][c1 - 0x40];
- if (val){
- if (val > 0x7FFF){
- c2 = PREFIX_EUCG3 | ((val >> 8) & 0x7f);
- c1 = val & 0xff;
- }else{
- c2 = val >> 8;
- c1 = val & 0xff;
- }
- if (p2) *p2 = c2;
- if (p1) *p1 = c1;
- return 0;
- }
+#if 0
+ extern const unsigned short shiftjis_x0212[3][189];
+#endif
+ val = shiftjis_x0212[c2 - 0xfa][c1 - 0x40];
+ if (val){
+ if (val > 0x7FFF){
+ c2 = PREFIX_EUCG3 | ((val >> 8) & 0x7f);
+ c1 = val & 0xff;
+ }else{
+ c2 = val >> 8;
+ c1 = val & 0xff;
+ }
+ if (p2) *p2 = c2;
+ if (p1) *p1 = c1;
+ return 0;
+ }
}
#endif
if(c2 >= 0x80){
@@ -1611,13 +3175,11 @@ s2e_conv(nkf_char c2, nkf_char c1, nkf_char *p2, nkf_char *p1)
if (0x9E < c1) c2++;
}
}else{
-#define SJ0162 0x00e1 /* 01 - 62 ku offset */
-#define SJ6394 0x0161 /* 63 - 94 ku offset */
c2 = c2 + c2 - ((c2 <= 0x9F) ? SJ0162 : SJ6394);
if (0x9E < c1) c2++;
}
if (c1 < 0x9F)
- c1 = c1 - ((c1 > DEL) ? SP : 0x1F);
+ c1 = c1 - ((c1 > DEL) ? SPACE : 0x1F);
else {
c1 = c1 - 0x7E;
}
@@ -1631,135 +3193,320 @@ s2e_conv(nkf_char c2, nkf_char c1, nkf_char *p2, nkf_char *p1)
return 0;
}
+nkf_char s_iconv(nkf_char c2, nkf_char c1, nkf_char c0)
+{
+ if (c2 == X0201) {
+ c1 &= 0x7f;
+ } else if ((c2 == EOF) || (c2 == 0) || c2 < SPACE) {
+ /* NOP */
+ } else if (!x0213_f && 0xF0 <= c2 && c2 <= 0xF9 && 0x40 <= c1 && c1 <= 0xFC) {
+ /* CP932 UDC */
+ if(c1 == 0x7F) return 0;
+ c1 = (c2 - 0xF0) * 188 + (c1 - 0x40 - (0x7E < c1)) + 0xE000 + CLASS_UNICODE;
+ c2 = 0;
+ } else {
+ nkf_char ret = s2e_conv(c2, c1, &c2, &c1);
+ if (ret) return ret;
+ }
+ (*oconv)(c2, c1);
+ return 0;
+}
+
+nkf_char e_iconv(nkf_char c2, nkf_char c1, nkf_char c0)
+{
+ if (c2 == X0201) {
+ c1 &= 0x7f;
+#ifdef X0212_ENABLE
+ }else if (c2 == 0x8f){
+ if (c0 == 0){
+ return -1;
+ }
+ if (!cp51932_f && !x0213_f && 0xF5 <= c1 && c1 <= 0xFE && 0xA1 <= c0 && c0 <= 0xFE) {
+ /* encoding is eucJP-ms, so invert to Unicode Private User Area */
+ c1 = (c1 - 0xF5) * 94 + c0 - 0xA1 + 0xE3AC + CLASS_UNICODE;
+ c2 = 0;
+ } else {
+ c2 = (c2 << 8) | (c1 & 0x7f);
+ c1 = c0 & 0x7f;
+#ifdef SHIFTJIS_CP932
+ if (cp51932_f){
+ nkf_char s2, s1;
+ if (e2s_conv(c2, c1, &s2, &s1) == 0){
+ s2e_conv(s2, s1, &c2, &c1);
+ if (c2 < 0x100){
+ c1 &= 0x7f;
+ c2 &= 0x7f;
+ }
+ }
+ }
+#endif /* SHIFTJIS_CP932 */
+ }
+#endif /* X0212_ENABLE */
+ } else if (c2 == SSO){
+ c2 = X0201;
+ c1 &= 0x7f;
+ } else if ((c2 == EOF) || (c2 == 0) || c2 < SPACE) {
+ /* NOP */
+ } else {
+ if (!cp51932_f && ms_ucs_map_f && 0xF5 <= c2 && c2 <= 0xFE && 0xA1 <= c1 && c1 <= 0xFE) {
+ /* encoding is eucJP-ms, so invert to Unicode Private User Area */
+ c1 = (c2 - 0xF5) * 94 + c1 - 0xA1 + 0xE000 + CLASS_UNICODE;
+ c2 = 0;
+ } else {
+ c1 &= 0x7f;
+ c2 &= 0x7f;
+#ifdef SHIFTJIS_CP932
+ if (cp51932_f && 0x79 <= c2 && c2 <= 0x7c){
+ nkf_char s2, s1;
+ if (e2s_conv(c2, c1, &s2, &s1) == 0){
+ s2e_conv(s2, s1, &c2, &c1);
+ if (c2 < 0x100){
+ c1 &= 0x7f;
+ c2 &= 0x7f;
+ }
+ }
+ }
+#endif /* SHIFTJIS_CP932 */
+ }
+ }
+ (*oconv)(c2, c1);
+ return 0;
+}
+
+#ifdef UTF8_INPUT_ENABLE
+nkf_char w2e_conv(nkf_char c2, nkf_char c1, nkf_char c0, nkf_char *p2, nkf_char *p1)
+{
+ nkf_char ret = 0;
+
+ if (!c1){
+ *p2 = 0;
+ *p1 = c2;
+ }else if (0xc0 <= c2 && c2 <= 0xef) {
+ ret = unicode_to_jis_common(c2, c1, c0, p2, p1);
+#ifdef NUMCHAR_OPTION
+ if (ret > 0){
+ if (p2) *p2 = 0;
+ if (p1) *p1 = CLASS_UNICODE | ww16_conv(c2, c1, c0);
+ ret = 0;
+ }
+#endif
+ }
+ return ret;
+}
+
+nkf_char w_iconv(nkf_char c2, nkf_char c1, nkf_char c0)
+{
+ nkf_char ret = 0;
+ static const int w_iconv_utf8_1st_byte[] =
+ { /* 0xC0 - 0xFF */
+ 20, 20, 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,
+ 30, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 32, 33, 33,
+ 40, 41, 41, 41, 42, 43, 43, 43, 50, 50, 50, 50, 60, 60, 70, 70};
+
+ if (c2 < 0 || 0xff < c2) {
+ }else if (c2 == 0) { /* 0 : 1 byte*/
+ c0 = 0;
+ } else if ((c2 & 0xc0) == 0x80) { /* 0x80-0xbf : trail byte */
+ return 0;
+ } else{
+ switch (w_iconv_utf8_1st_byte[c2 - 0xC0]) {
+ case 21:
+ if (c1 < 0x80 || 0xBF < c1) return 0;
+ break;
+ case 30:
+ if (c0 == 0) return -1;
+ if (c1 < 0xA0 || 0xBF < c1 || (c0 & 0xc0) != 0x80)
+ return 0;
+ break;
+ case 31:
+ case 33:
+ if (c0 == 0) return -1;
+ if ((c1 & 0xc0) != 0x80 || (c0 & 0xc0) != 0x80)
+ return 0;
+ break;
+ case 32:
+ if (c0 == 0) return -1;
+ if (c1 < 0x80 || 0x9F < c1 || (c0 & 0xc0) != 0x80)
+ return 0;
+ break;
+ case 40:
+ if (c0 == 0) return -2;
+ if (c1 < 0x90 || 0xBF < c1 || (c0 & 0xc0c0) != 0x8080)
+ return 0;
+ break;
+ case 41:
+ if (c0 == 0) return -2;
+ if (c1 < 0x80 || 0xBF < c1 || (c0 & 0xc0c0) != 0x8080)
+ return 0;
+ break;
+ case 42:
+ if (c0 == 0) return -2;
+ if (c1 < 0x80 || 0x8F < c1 || (c0 & 0xc0c0) != 0x8080)
+ return 0;
+ break;
+ default:
+ return 0;
+ break;
+ }
+ }
+ if (c2 == 0 || c2 == EOF){
+ } else if ((c2 & 0xf8) == 0xf0) { /* 4 bytes */
+ c1 = CLASS_UNICODE | ww16_conv(c2, c1, c0);
+ c2 = 0;
+ } else {
+ ret = w2e_conv(c2, c1, c0, &c2, &c1);
+ }
+ if (ret == 0){
+ (*oconv)(c2, c1);
+ }
+ return ret;
+}
+#endif
+
#if defined(UTF8_INPUT_ENABLE) || defined(UTF8_OUTPUT_ENABLE)
-static void
-nkf_unicode_to_utf8(nkf_char val, nkf_char *p1, nkf_char *p2, nkf_char *p3, nkf_char *p4)
+void w16w_conv(nkf_char val, nkf_char *p2, nkf_char *p1, nkf_char *p0)
{
val &= VALUE_MASK;
if (val < 0x80){
- *p1 = val;
- *p2 = 0;
- *p3 = 0;
- *p4 = 0;
+ *p2 = val;
+ *p1 = 0;
+ *p0 = 0;
}else if (val < 0x800){
- *p1 = 0xc0 | (val >> 6);
- *p2 = 0x80 | (val & 0x3f);
- *p3 = 0;
- *p4 = 0;
- } else if (nkf_char_unicode_bmp_p(val)) {
- *p1 = 0xe0 | (val >> 12);
- *p2 = 0x80 | ((val >> 6) & 0x3f);
- *p3 = 0x80 | ( val & 0x3f);
- *p4 = 0;
- } else if (nkf_char_unicode_value_p(val)) {
- *p1 = 0xe0 | (val >> 16);
- *p2 = 0x80 | ((val >> 12) & 0x3f);
- *p3 = 0x80 | ((val >> 6) & 0x3f);
- *p4 = 0x80 | ( val & 0x3f);
+ *p2 = 0xc0 | (val >> 6);
+ *p1 = 0x80 | (val & 0x3f);
+ *p0 = 0;
+ } else if (val <= NKF_INT32_C(0xFFFF)) {
+ *p2 = 0xe0 | (val >> 12);
+ *p1 = 0x80 | ((val >> 6) & 0x3f);
+ *p0 = 0x80 | (val & 0x3f);
+ } else if (val <= NKF_INT32_C(0x10FFFF)) {
+ *p2 = 0xe0 | (val >> 16);
+ *p1 = 0x80 | ((val >> 12) & 0x3f);
+ *p0 = 0x8080 | ((val << 2) & 0x3f00)| (val & 0x3f);
} else {
- *p1 = 0;
- *p2 = 0;
- *p3 = 0;
- *p4 = 0;
+ *p2 = 0;
+ *p1 = 0;
+ *p0 = 0;
+ }
+}
+#endif
+
+#ifdef UTF8_INPUT_ENABLE
+nkf_char ww16_conv(nkf_char c2, nkf_char c1, nkf_char c0)
+{
+ nkf_char val;
+ if (c2 >= 0xf8) {
+ val = -1;
+ } else if (c2 >= 0xf0){
+ /* c2: 1st, c1: 2nd, c0: 3rd/4th */
+ val = (c2 & 0x0f) << 18;
+ val |= (c1 & 0x3f) << 12;
+ val |= (c0 & 0x3f00) >> 2;
+ val |= (c0 & 0x3f);
+ }else if (c2 >= 0xe0){
+ val = (c2 & 0x0f) << 12;
+ val |= (c1 & 0x3f) << 6;
+ val |= (c0 & 0x3f);
+ }else if (c2 >= 0xc0){
+ val = (c2 & 0x1f) << 6;
+ val |= (c1 & 0x3f);
+ }else{
+ val = c2;
}
+ return val;
}
-static nkf_char
-nkf_utf8_to_unicode(nkf_char c1, nkf_char c2, nkf_char c3, nkf_char c4)
+nkf_char w16e_conv(nkf_char val, nkf_char *p2, nkf_char *p1)
{
- nkf_char wc;
- if (c1 <= 0x7F) {
- /* single byte */
- wc = c1;
- }
- else if (c1 <= 0xC3) {
- /* trail byte or invalid */
- return -1;
- }
- else if (c1 <= 0xDF) {
- /* 2 bytes */
- wc = (c1 & 0x1F) << 6;
- wc |= (c2 & 0x3F);
- }
- else if (c1 <= 0xEF) {
- /* 3 bytes */
- wc = (c1 & 0x0F) << 12;
- wc |= (c2 & 0x3F) << 6;
- wc |= (c3 & 0x3F);
- }
- else if (c2 <= 0xF4) {
- /* 4 bytes */
- wc = (c1 & 0x0F) << 18;
- wc |= (c2 & 0x3F) << 12;
- wc |= (c3 & 0x3F) << 6;
- wc |= (c4 & 0x3F);
- }
- else {
- return -1;
- }
- return wc;
+ nkf_char c2, c1, c0;
+ nkf_char ret = 0;
+ val &= VALUE_MASK;
+ if (val < 0x80){
+ *p2 = 0;
+ *p1 = val;
+ }else{
+ w16w_conv(val, &c2, &c1, &c0);
+ ret = unicode_to_jis_common(c2, c1, c0, p2, p1);
+#ifdef NUMCHAR_OPTION
+ if (ret > 0){
+ *p2 = 0;
+ *p1 = CLASS_UNICODE | val;
+ ret = 0;
+ }
+#endif
+ }
+ return ret;
}
#endif
#ifdef UTF8_INPUT_ENABLE
-static int
-unicode_to_jis_common2(nkf_char c1, nkf_char c0,
- const unsigned short *const *pp, nkf_char psize,
- nkf_char *p2, nkf_char *p1)
+nkf_char w_iconv16(nkf_char c2, nkf_char c1, nkf_char c0)
{
- nkf_char c2;
- const unsigned short *p;
- unsigned short val;
-
- if (pp == 0) return 1;
-
- c1 -= 0x80;
- if (c1 < 0 || psize <= c1) return 1;
- p = pp[c1];
- if (p == 0) return 1;
+ nkf_char ret = 0;
+ if ((c2==0 && c1 < 0x80) || c2==EOF) {
+ (*oconv)(c2, c1);
+ return 0;
+ }else if (0xD8 <= c2 && c2 <= 0xDB) {
+ if (c0 < NKF_INT32_C(0xDC00) || NKF_INT32_C(0xDFFF) < c0)
+ return -2;
+ c1 = CLASS_UNICODE | ((c2 << 18) + (c1 << 10) + c0 - NKF_INT32_C(0x35FDC00));
+ c2 = 0;
+ }else if ((c2>>3) == 27) { /* unpaired surrogate */
+ /*
+ return 2;
+ */
+ return 1;
+ }else ret = w16e_conv(((c2 & 0xff)<<8) + c1, &c2, &c1);
+ if (ret) return ret;
+ (*oconv)(c2, c1);
+ return 0;
+}
- c0 -= 0x80;
- if (c0 < 0 || sizeof_utf8_to_euc_C2 <= c0) return 1;
- val = p[c0];
- if (val == 0) return 1;
- if (no_cp932ext_f && (
- (val>>8) == 0x2D || /* NEC special characters */
- val > NKF_INT32_C(0xF300) /* IBM extended characters */
- )) return 1;
+nkf_char w_iconv32(nkf_char c2, nkf_char c1, nkf_char c0)
+{
+ int ret = 0;
- c2 = val >> 8;
- if (val > 0x7FFF){
- c2 &= 0x7f;
- c2 |= PREFIX_EUCG3;
+ if ((c2 == 0 && c1 < 0x80) || c2==EOF) {
+ } else if (is_unicode_bmp(c1)) {
+ ret = w16e_conv(c1, &c2, &c1);
+ } else {
+ c2 = 0;
+ c1 = CLASS_UNICODE | c1;
}
- if (c2 == SO) c2 = JIS_X_0201_1976_K;
- c1 = val & 0xFF;
- if (p2) *p2 = c2;
- if (p1) *p1 = c1;
+ if (ret) return ret;
+ (*oconv)(c2, c1);
return 0;
}
-static int
-unicode_to_jis_common(nkf_char c2, nkf_char c1, nkf_char c0, nkf_char *p2, nkf_char *p1)
+nkf_char unicode_to_jis_common(nkf_char c2, nkf_char c1, nkf_char c0, nkf_char *p2, nkf_char *p1)
{
+#if 0
+ extern const unsigned short *const utf8_to_euc_2bytes[];
+ extern const unsigned short *const utf8_to_euc_2bytes_ms[];
+ extern const unsigned short *const utf8_to_euc_2bytes_932[];
+ extern const unsigned short *const *const utf8_to_euc_3bytes[];
+ extern const unsigned short *const *const utf8_to_euc_3bytes_ms[];
+ extern const unsigned short *const *const utf8_to_euc_3bytes_932[];
+#endif
const unsigned short *const *pp;
const unsigned short *const *const *ppp;
- static const char no_best_fit_chars_table_C2[] =
+ static const int no_best_fit_chars_table_C2[] =
{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1, 0, 0, 0, 0, 1, 1, 1, 2, 1, 1, 2,
0, 0, 1, 1, 0, 1, 0, 1, 2, 1, 1, 1, 1, 1, 1, 1};
- static const char no_best_fit_chars_table_C2_ms[] =
+ static const int no_best_fit_chars_table_C2_ms[] =
{1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0,
0, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 0};
- static const char no_best_fit_chars_table_932_C2[] =
+ static const int no_best_fit_chars_table_932_C2[] =
{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 0, 0, 1, 1, 1, 1, 1, 1, 1,
0, 0, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0};
- static const char no_best_fit_chars_table_932_C3[] =
+ static const int no_best_fit_chars_table_932_C3[] =
{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,
@@ -1791,29 +3538,13 @@ unicode_to_jis_common(nkf_char c2, nkf_char c1, nkf_char c0, nkf_char *p2, nkf_c
}
}else if(ms_ucs_map_f == UCS_MAP_MS){
if(c2 == 0xC2 && no_best_fit_chars_table_C2_ms[c1&0x3F]) return 1;
- }else if(ms_ucs_map_f == UCS_MAP_CP10001){
- switch(c2){
- case 0xC2:
- switch(c1){
- case 0xA2:
- case 0xA3:
- case 0xA5:
- case 0xA6:
- case 0xAC:
- case 0xAF:
- case 0xB8:
- return 1;
- }
- break;
- }
}
}
pp =
ms_ucs_map_f == UCS_MAP_CP932 ? utf8_to_euc_2bytes_932 :
ms_ucs_map_f == UCS_MAP_MS ? utf8_to_euc_2bytes_ms :
- ms_ucs_map_f == UCS_MAP_CP10001 ? utf8_to_euc_2bytes_mac :
utf8_to_euc_2bytes;
- ret = unicode_to_jis_common2(c2, c1, pp, sizeof_utf8_to_euc_2bytes, p2, p1);
+ ret = w_iconv_common(c2, c1, pp, sizeof_utf8_to_euc_2bytes, p2, p1);
}else if(c0 < 0xF0){
if(no_best_fit_chars_f){
if(ms_ucs_map_f == UCS_MAP_CP932){
@@ -1834,19 +3565,6 @@ unicode_to_jis_common(nkf_char c2, nkf_char c1, nkf_char c0, nkf_char *p2, nkf_c
if(c1 == 0x80 || c0 == 0x9C) return 1;
break;
}
- }else if(ms_ucs_map_f == UCS_MAP_CP10001){
- switch(c2){
- case 0xE3:
- switch(c1){
- case 0x82:
- if(c0 == 0x94) return 1;
- break;
- case 0x83:
- if(c0 == 0xBB) return 1;
- break;
- }
- break;
- }
}else{
switch(c2){
case 0xE2:
@@ -1878,9 +3596,8 @@ unicode_to_jis_common(nkf_char c2, nkf_char c1, nkf_char c0, nkf_char *p2, nkf_c
ppp =
ms_ucs_map_f == UCS_MAP_CP932 ? utf8_to_euc_3bytes_932 :
ms_ucs_map_f == UCS_MAP_MS ? utf8_to_euc_3bytes_ms :
- ms_ucs_map_f == UCS_MAP_CP10001 ? utf8_to_euc_3bytes_mac :
utf8_to_euc_3bytes;
- ret = unicode_to_jis_common2(c1, c0, ppp[c2 - 0xE0], sizeof_utf8_to_euc_C2, p2, p1);
+ ret = w_iconv_common(c1, c0, ppp[c2 - 0xE0], sizeof_utf8_to_euc_C2, p2, p1);
}else return -1;
#ifdef SHIFTJIS_CP932
if (!ret && !cp932inv_f && is_eucg3(*p2)) {
@@ -1895,476 +3612,341 @@ unicode_to_jis_common(nkf_char c2, nkf_char c1, nkf_char c0, nkf_char *p2, nkf_c
return ret;
}
-#ifdef UTF8_OUTPUT_ENABLE
-static nkf_char
-e2w_conv(nkf_char c2, nkf_char c1)
+nkf_char w_iconv_common(nkf_char c1, nkf_char c0, const unsigned short *const *pp, nkf_char psize, nkf_char *p2, nkf_char *p1)
{
+ nkf_char c2;
const unsigned short *p;
+ unsigned short val;
- if (c2 == JIS_X_0201_1976_K) {
- if (ms_ucs_map_f == UCS_MAP_CP10001) {
- switch (c1) {
- case 0x20:
- return 0xA0;
- case 0x7D:
- return 0xA9;
- }
- }
- p = euc_to_utf8_1byte;
-#ifdef X0212_ENABLE
- } else if (is_eucg3(c2)){
- if(ms_ucs_map_f == UCS_MAP_ASCII&& c2 == NKF_INT32_C(0x8F22) && c1 == 0x43){
- return 0xA6;
- }
- c2 = (c2&0x7f) - 0x21;
- if (0<=c2 && c2<sizeof_euc_to_utf8_2bytes)
- p = x0212_to_utf8_2bytes[c2];
- else
- return 0;
-#endif
- } else {
- c2 &= 0x7f;
- c2 = (c2&0x7f) - 0x21;
- if (0<=c2 && c2<sizeof_euc_to_utf8_2bytes)
- p =
- ms_ucs_map_f == UCS_MAP_ASCII ? euc_to_utf8_2bytes[c2] :
- ms_ucs_map_f == UCS_MAP_CP10001 ? euc_to_utf8_2bytes_mac[c2] :
- euc_to_utf8_2bytes_ms[c2];
- else
- return 0;
+ if (pp == 0) return 1;
+
+ c1 -= 0x80;
+ if (c1 < 0 || psize <= c1) return 1;
+ p = pp[c1];
+ if (p == 0) return 1;
+
+ c0 -= 0x80;
+ if (c0 < 0 || sizeof_utf8_to_euc_C2 <= c0) return 1;
+ val = p[c0];
+ if (val == 0) return 1;
+ if (no_cp932ext_f && (
+ (val>>8) == 0x2D || /* NEC special characters */
+ val > NKF_INT32_C(0xF300) /* IBM extended characters */
+ )) return 1;
+
+ c2 = val >> 8;
+ if (val > 0x7FFF){
+ c2 &= 0x7f;
+ c2 |= PREFIX_EUCG3;
}
- if (!p) return 0;
- c1 = (c1 & 0x7f) - 0x21;
- if (0<=c1 && c1<sizeof_euc_to_utf8_1byte)
- return p[c1];
+ if (c2 == SO) c2 = X0201;
+ c1 = val & 0x7f;
+ if (p2) *p2 = c2;
+ if (p1) *p1 = c1;
return 0;
}
-#endif
-static nkf_char
-w2e_conv(nkf_char c2, nkf_char c1, nkf_char c0, nkf_char *p2, nkf_char *p1)
+void nkf_each_char_to_hex(void (*f)(nkf_char c2,nkf_char c1), nkf_char c)
{
- nkf_char ret = 0;
-
- if (!c1){
- *p2 = 0;
- *p1 = c2;
- }else if (0xc0 <= c2 && c2 <= 0xef) {
- ret = unicode_to_jis_common(c2, c1, c0, p2, p1);
-#ifdef NUMCHAR_OPTION
- if (ret > 0){
- if (p2) *p2 = 0;
- if (p1) *p1 = nkf_char_unicode_new(nkf_utf8_to_unicode(c2, c1, c0, 0));
- ret = 0;
+ const char *hex = "0123456789ABCDEF";
+ int shift = 20;
+ c &= VALUE_MASK;
+ while(shift >= 0){
+ if(c >= 1<<shift){
+ while(shift >= 0){
+ (*f)(0, hex[(c>>shift)&0xF]);
+ shift -= 4;
+ }
+ }else{
+ shift -= 4;
}
-#endif
}
- return ret;
+ return;
}
-#ifdef UTF8_INPUT_ENABLE
-static nkf_char
-w16e_conv(nkf_char val, nkf_char *p2, nkf_char *p1)
+void encode_fallback_html(nkf_char c)
{
- nkf_char c1, c2, c3, c4;
- nkf_char ret = 0;
- val &= VALUE_MASK;
- if (val < 0x80) {
- *p2 = 0;
- *p1 = val;
- }
- else if (nkf_char_unicode_bmp_p(val)){
- nkf_unicode_to_utf8(val, &c1, &c2, &c3, &c4);
- ret = unicode_to_jis_common(c1, c2, c3, p2, p1);
- if (ret > 0){
- *p2 = 0;
- *p1 = nkf_char_unicode_new(val);
- ret = 0;
- }
- }
- else {
- *p2 = 0;
- *p1 = nkf_char_unicode_new(val);
- }
- return ret;
+ (*oconv)(0, '&');
+ (*oconv)(0, '#');
+ c &= VALUE_MASK;
+ if(c >= NKF_INT32_C(1000000))
+ (*oconv)(0, 0x30+(c/NKF_INT32_C(1000000))%10);
+ if(c >= NKF_INT32_C(100000))
+ (*oconv)(0, 0x30+(c/NKF_INT32_C(100000) )%10);
+ if(c >= 10000)
+ (*oconv)(0, 0x30+(c/10000 )%10);
+ if(c >= 1000)
+ (*oconv)(0, 0x30+(c/1000 )%10);
+ if(c >= 100)
+ (*oconv)(0, 0x30+(c/100 )%10);
+ if(c >= 10)
+ (*oconv)(0, 0x30+(c/10 )%10);
+ if(c >= 0)
+ (*oconv)(0, 0x30+ c %10);
+ (*oconv)(0, ';');
+ return;
}
-#endif
-static nkf_char
-e_iconv(nkf_char c2, nkf_char c1, nkf_char c0)
+void encode_fallback_xml(nkf_char c)
{
- if (c2 == JIS_X_0201_1976_K || c2 == SS2){
- if (iso2022jp_f && !x0201_f) {
- c2 = GETA1; c1 = GETA2;
- } else {
- c2 = JIS_X_0201_1976_K;
- c1 &= 0x7f;
- }
-#ifdef X0212_ENABLE
- }else if (c2 == 0x8f){
- if (c0 == 0){
- return -1;
- }
- if (!cp51932_f && !x0213_f && 0xF5 <= c1 && c1 <= 0xFE && 0xA1 <= c0 && c0 <= 0xFE) {
- /* encoding is eucJP-ms, so invert to Unicode Private User Area */
- c1 = nkf_char_unicode_new((c1 - 0xF5) * 94 + c0 - 0xA1 + 0xE3AC);
- c2 = 0;
- } else {
- c2 = (c2 << 8) | (c1 & 0x7f);
- c1 = c0 & 0x7f;
-#ifdef SHIFTJIS_CP932
- if (cp51932_f){
- nkf_char s2, s1;
- if (e2s_conv(c2, c1, &s2, &s1) == 0){
- s2e_conv(s2, s1, &c2, &c1);
- if (c2 < 0x100){
- c1 &= 0x7f;
- c2 &= 0x7f;
- }
- }
- }
-#endif /* SHIFTJIS_CP932 */
- }
-#endif /* X0212_ENABLE */
- } else if ((c2 == EOF) || (c2 == 0) || c2 < SP || c2 == ISO_8859_1) {
- /* NOP */
- } else {
- if (!cp51932_f && ms_ucs_map_f && 0xF5 <= c2 && c2 <= 0xFE && 0xA1 <= c1 && c1 <= 0xFE) {
- /* encoding is eucJP-ms, so invert to Unicode Private User Area */
- c1 = nkf_char_unicode_new((c2 - 0xF5) * 94 + c1 - 0xA1 + 0xE000);
- c2 = 0;
- } else {
- c1 &= 0x7f;
- c2 &= 0x7f;
-#ifdef SHIFTJIS_CP932
- if (cp51932_f && 0x79 <= c2 && c2 <= 0x7c){
- nkf_char s2, s1;
- if (e2s_conv(c2, c1, &s2, &s1) == 0){
- s2e_conv(s2, s1, &c2, &c1);
- if (c2 < 0x100){
- c1 &= 0x7f;
- c2 &= 0x7f;
- }
- }
- }
-#endif /* SHIFTJIS_CP932 */
- }
- }
- (*oconv)(c2, c1);
- return 0;
+ (*oconv)(0, '&');
+ (*oconv)(0, '#');
+ (*oconv)(0, 'x');
+ nkf_each_char_to_hex(oconv, c);
+ (*oconv)(0, ';');
+ return;
}
-static nkf_char
-s_iconv(nkf_char c2, nkf_char c1, nkf_char c0)
+void encode_fallback_java(nkf_char c)
{
- if (c2 == JIS_X_0201_1976_K || (0xA1 <= c2 && c2 <= 0xDF)) {
- if (iso2022jp_f && !x0201_f) {
- c2 = GETA1; c1 = GETA2;
- } else {
- c1 &= 0x7f;
- }
- } else if ((c2 == EOF) || (c2 == 0) || c2 < SP) {
- /* NOP */
- } else if (!x0213_f && 0xF0 <= c2 && c2 <= 0xF9 && 0x40 <= c1 && c1 <= 0xFC) {
- /* CP932 UDC */
- if(c1 == 0x7F) return 0;
- c1 = nkf_char_unicode_new((c2 - 0xF0) * 188 + (c1 - 0x40 - (0x7E < c1)) + 0xE000);
- c2 = 0;
- } else {
- nkf_char ret = s2e_conv(c2, c1, &c2, &c1);
- if (ret) return ret;
+ const char *hex = "0123456789ABCDEF";
+ (*oconv)(0, '\\');
+ c &= VALUE_MASK;
+ if(!is_unicode_bmp(c)){
+ (*oconv)(0, 'U');
+ (*oconv)(0, '0');
+ (*oconv)(0, '0');
+ (*oconv)(0, hex[(c>>20)&0xF]);
+ (*oconv)(0, hex[(c>>16)&0xF]);
+ }else{
+ (*oconv)(0, 'u');
}
- (*oconv)(c2, c1);
- return 0;
+ (*oconv)(0, hex[(c>>12)&0xF]);
+ (*oconv)(0, hex[(c>> 8)&0xF]);
+ (*oconv)(0, hex[(c>> 4)&0xF]);
+ (*oconv)(0, hex[ c &0xF]);
+ return;
}
-static nkf_char
-w_iconv(nkf_char c1, nkf_char c2, nkf_char c3)
+void encode_fallback_perl(nkf_char c)
{
- nkf_char ret = 0, c4 = 0;
- static const char w_iconv_utf8_1st_byte[] =
- { /* 0xC0 - 0xFF */
- 20, 20, 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,
- 30, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 32, 33, 33,
- 40, 41, 41, 41, 42, 43, 43, 43, 50, 50, 50, 50, 60, 60, 70, 70};
-
- if (c3 > 0xFF) {
- c4 = c3 & 0xFF;
- c3 >>= 8;
- }
+ (*oconv)(0, '\\');
+ (*oconv)(0, 'x');
+ (*oconv)(0, '{');
+ nkf_each_char_to_hex(oconv, c);
+ (*oconv)(0, '}');
+ return;
+}
- if (c1 < 0 || 0xff < c1) {
- }else if (c1 == 0) { /* 0 : 1 byte*/
- c3 = 0;
- } else if ((c1 & 0xC0) == 0x80) { /* 0x80-0xbf : trail byte */
- return 0;
- } else{
- switch (w_iconv_utf8_1st_byte[c1 - 0xC0]) {
- case 21:
- if (c2 < 0x80 || 0xBF < c2) return 0;
- break;
- case 30:
- if (c3 == 0) return -1;
- if (c2 < 0xA0 || 0xBF < c2 || (c3 & 0xC0) != 0x80)
- return 0;
- break;
- case 31:
- case 33:
- if (c3 == 0) return -1;
- if ((c2 & 0xC0) != 0x80 || (c3 & 0xC0) != 0x80)
- return 0;
- break;
- case 32:
- if (c3 == 0) return -1;
- if (c2 < 0x80 || 0x9F < c2 || (c3 & 0xC0) != 0x80)
- return 0;
- break;
- case 40:
- if (c3 == 0) return -2;
- if (c2 < 0x90 || 0xBF < c2 || (c3 & 0xC0) != 0x80 || (c4 & 0xC0) != 0x80)
- return 0;
- break;
- case 41:
- if (c3 == 0) return -2;
- if (c2 < 0x80 || 0xBF < c2 || (c3 & 0xC0) != 0x80 || (c4 & 0xC0) != 0x80)
- return 0;
- break;
- case 42:
- if (c3 == 0) return -2;
- if (c2 < 0x80 || 0x8F < c2 || (c3 & 0xC0) != 0x80 || (c4 & 0xC0) != 0x80)
- return 0;
- break;
- default:
- return 0;
- break;
- }
- }
- if (c1 == 0 || c1 == EOF){
- } else if ((c1 & 0xf8) == 0xf0) { /* 4 bytes */
- c2 = nkf_char_unicode_new(nkf_utf8_to_unicode(c1, c2, c3, c4));
- c1 = 0;
- } else {
- ret = w2e_conv(c1, c2, c3, &c1, &c2);
- }
- if (ret == 0){
- (*oconv)(c1, c2);
- }
- return ret;
+void encode_fallback_subchar(nkf_char c)
+{
+ c = unicode_subchar;
+ (*oconv)((c>>8)&0xFF, c&0xFF);
+ return;
}
+#endif
-#define NKF_ICONV_INVALID_CODE_RANGE -13
-static size_t
-unicode_iconv(nkf_char wc)
+#ifdef UTF8_OUTPUT_ENABLE
+nkf_char e2w_conv(nkf_char c2, nkf_char c1)
{
- nkf_char c1, c2;
- int ret = 0;
+#if 0
+ extern const unsigned short euc_to_utf8_1byte[];
+ extern const unsigned short *const euc_to_utf8_2bytes[];
+ extern const unsigned short *const euc_to_utf8_2bytes_ms[];
+ extern const unsigned short *const x0212_to_utf8_2bytes[];
+#endif
+ const unsigned short *p;
- if (wc < 0x80) {
- c2 = 0;
- c1 = wc;
- }else if ((wc>>11) == 27) {
- /* unpaired surrogate */
- return NKF_ICONV_INVALID_CODE_RANGE;
- }else if (wc < 0xFFFF) {
- ret = w16e_conv(wc, &c2, &c1);
- if (ret) return ret;
- }else if (wc < 0x10FFFF) {
- c2 = 0;
- c1 = nkf_char_unicode_new(wc);
+ if (c2 == X0201) {
+ p = euc_to_utf8_1byte;
+#ifdef X0212_ENABLE
+ } else if (is_eucg3(c2)){
+ if(ms_ucs_map_f == UCS_MAP_ASCII&& c2 == NKF_INT32_C(0x8F22) && c1 == 0x43){
+ return 0xA6;
+ }
+ c2 = (c2&0x7f) - 0x21;
+ if (0<=c2 && c2<sizeof_euc_to_utf8_2bytes)
+ p = x0212_to_utf8_2bytes[c2];
+ else
+ return 0;
+#endif
} else {
- return NKF_ICONV_INVALID_CODE_RANGE;
+ c2 &= 0x7f;
+ c2 = (c2&0x7f) - 0x21;
+ if (0<=c2 && c2<sizeof_euc_to_utf8_2bytes)
+ p = ms_ucs_map_f != UCS_MAP_ASCII ? euc_to_utf8_2bytes_ms[c2] : euc_to_utf8_2bytes[c2];
+ else
+ return 0;
}
- (*oconv)(c2, c1);
+ if (!p) return 0;
+ c1 = (c1 & 0x7f) - 0x21;
+ if (0<=c1 && c1<sizeof_euc_to_utf8_1byte)
+ return p[c1];
return 0;
}
-#define NKF_ICONV_NEED_ONE_MORE_BYTE -1
-#define NKF_ICONV_NEED_TWO_MORE_BYTES -2
-#define UTF16_TO_UTF32(lead, trail) (((lead) << 10) + (trail) - NKF_INT32_C(0x35FDC00))
-static size_t
-nkf_iconv_utf_16(nkf_char c1, nkf_char c2, nkf_char c3, nkf_char c4)
+void w_oconv(nkf_char c2, nkf_char c1)
{
- nkf_char wc;
+ nkf_char c0;
+ nkf_char val;
- if (c1 == EOF) {
- (*oconv)(EOF, 0);
- return 0;
+ if (output_bom_f) {
+ output_bom_f = FALSE;
+ (*o_putc)('\357');
+ (*o_putc)('\273');
+ (*o_putc)('\277');
}
- if (input_endian == ENDIAN_BIG) {
- if (0xD8 <= c1 && c1 <= 0xDB) {
- if (0xDC <= c3 && c3 <= 0xDF) {
- wc = UTF16_TO_UTF32(c1 << 8 | c2, c3 << 8 | c4);
- } else return NKF_ICONV_NEED_TWO_MORE_BYTES;
- } else {
- wc = c1 << 8 | c2;
- }
- } else {
- if (0xD8 <= c2 && c2 <= 0xDB) {
- if (0xDC <= c4 && c4 <= 0xDF) {
- wc = UTF16_TO_UTF32(c2 << 8 | c1, c4 << 8 | c3);
- } else return NKF_ICONV_NEED_TWO_MORE_BYTES;
- } else {
- wc = c2 << 8 | c1;
- }
+ if (c2 == EOF) {
+ (*o_putc)(EOF);
+ return;
}
- return (*unicode_iconv)(wc);
-}
-
-static nkf_char
-w_iconv16(nkf_char c2, nkf_char c1, nkf_char c0)
-{
- return 0;
-}
-
-static nkf_char
-w_iconv32(nkf_char c2, nkf_char c1, nkf_char c0)
-{
- return 0;
+#ifdef NUMCHAR_OPTION
+ if (c2 == 0 && is_unicode_capsule(c1)){
+ val = c1 & VALUE_MASK;
+ if (val < 0x80){
+ (*o_putc)(val);
+ }else if (val < 0x800){
+ (*o_putc)(0xC0 | (val >> 6));
+ (*o_putc)(0x80 | (val & 0x3f));
+ } else if (val <= NKF_INT32_C(0xFFFF)) {
+ (*o_putc)(0xE0 | (val >> 12));
+ (*o_putc)(0x80 | ((val >> 6) & 0x3f));
+ (*o_putc)(0x80 | (val & 0x3f));
+ } else if (val <= NKF_INT32_C(0x10FFFF)) {
+ (*o_putc)(0xF0 | ( val>>18));
+ (*o_putc)(0x80 | ((val>>12) & 0x3f));
+ (*o_putc)(0x80 | ((val>> 6) & 0x3f));
+ (*o_putc)(0x80 | ( val & 0x3f));
+ }
+ return;
+ }
+#endif
+
+ if (c2 == 0) {
+ output_mode = ASCII;
+ (*o_putc)(c1);
+ } else if (c2 == ISO8859_1) {
+ output_mode = ISO8859_1;
+ (*o_putc)(c1 | 0x080);
+ } else {
+ output_mode = UTF8;
+ val = e2w_conv(c2, c1);
+ if (val){
+ w16w_conv(val, &c2, &c1, &c0);
+ (*o_putc)(c2);
+ if (c1){
+ (*o_putc)(c1);
+ if (c0) (*o_putc)(c0);
+ }
+ }
+ }
}
-static size_t
-nkf_iconv_utf_32(nkf_char c1, nkf_char c2, nkf_char c3, nkf_char c4)
+void w_oconv16(nkf_char c2, nkf_char c1)
{
- nkf_char wc;
-
- if (c1 == EOF) {
- (*oconv)(EOF, 0);
- return 0;
+ if (output_bom_f) {
+ output_bom_f = FALSE;
+ if (output_endian == ENDIAN_LITTLE){
+ (*o_putc)((unsigned char)'\377');
+ (*o_putc)('\376');
+ }else{
+ (*o_putc)('\376');
+ (*o_putc)((unsigned char)'\377');
+ }
}
- switch(input_endian){
- case ENDIAN_BIG:
- wc = c2 << 16 | c3 << 8 | c4;
- break;
- case ENDIAN_LITTLE:
- wc = c3 << 16 | c2 << 8 | c1;
- break;
- case ENDIAN_2143:
- wc = c1 << 16 | c4 << 8 | c3;
- break;
- case ENDIAN_3412:
- wc = c4 << 16 | c1 << 8 | c2;
- break;
- default:
- return NKF_ICONV_INVALID_CODE_RANGE;
+ if (c2 == EOF) {
+ (*o_putc)(EOF);
+ return;
}
- return (*unicode_iconv)(wc);
-}
+ if (c2 == ISO8859_1) {
+ c2 = 0;
+ c1 |= 0x80;
+#ifdef NUMCHAR_OPTION
+ } else if (c2 == 0 && is_unicode_capsule(c1)) {
+ if (is_unicode_bmp(c1)) {
+ c2 = (c1 >> 8) & 0xff;
+ c1 &= 0xff;
+ } else {
+ c1 &= VALUE_MASK;
+ if (c1 <= UNICODE_MAX) {
+ c2 = (c1 >> 10) + NKF_INT32_C(0xD7C0); /* high surrogate */
+ c1 = (c1 & 0x3FF) + NKF_INT32_C(0xDC00); /* low surrogate */
+ if (output_endian == ENDIAN_LITTLE){
+ (*o_putc)(c2 & 0xff);
+ (*o_putc)((c2 >> 8) & 0xff);
+ (*o_putc)(c1 & 0xff);
+ (*o_putc)((c1 >> 8) & 0xff);
+ }else{
+ (*o_putc)((c2 >> 8) & 0xff);
+ (*o_putc)(c2 & 0xff);
+ (*o_putc)((c1 >> 8) & 0xff);
+ (*o_putc)(c1 & 0xff);
+ }
+ }
+ return;
+ }
#endif
-
-#define output_ascii_escape_sequence(mode) do { \
- if (output_mode != ASCII && output_mode != ISO_8859_1) { \
- (*o_putc)(ESC); \
- (*o_putc)('('); \
- (*o_putc)(ascii_intro); \
- output_mode = mode; \
- } \
- } while (0)
-
-static void
-output_escape_sequence(int mode)
-{
- if (output_mode == mode)
- return;
- switch(mode) {
- case ISO_8859_1:
- (*o_putc)(ESC);
- (*o_putc)('.');
- (*o_putc)('A');
- break;
- case JIS_X_0201_1976_K:
- (*o_putc)(ESC);
- (*o_putc)('(');
- (*o_putc)('I');
- break;
- case JIS_X_0208:
- (*o_putc)(ESC);
- (*o_putc)('$');
- (*o_putc)(kanji_intro);
- break;
- case JIS_X_0212:
- (*o_putc)(ESC);
- (*o_putc)('$');
- (*o_putc)('(');
- (*o_putc)('D');
- break;
- case JIS_X_0213_1:
- (*o_putc)(ESC);
- (*o_putc)('$');
- (*o_putc)('(');
- (*o_putc)('Q');
- break;
- case JIS_X_0213_2:
- (*o_putc)(ESC);
- (*o_putc)('$');
- (*o_putc)('(');
- (*o_putc)('P');
- break;
+ } else if (c2) {
+ nkf_char val = e2w_conv(c2, c1);
+ c2 = (val >> 8) & 0xff;
+ c1 = val & 0xff;
+ if (!val) return;
+ }
+ if (output_endian == ENDIAN_LITTLE){
+ (*o_putc)(c1);
+ (*o_putc)(c2);
+ }else{
+ (*o_putc)(c2);
+ (*o_putc)(c1);
}
- output_mode = mode;
}
-static void
-j_oconv(nkf_char c2, nkf_char c1)
+void w_oconv32(nkf_char c2, nkf_char c1)
{
-#ifdef NUMCHAR_OPTION
- if (c2 == 0 && nkf_char_unicode_p(c1)){
- w16e_conv(c1, &c2, &c1);
- if (c2 == 0 && nkf_char_unicode_p(c1)){
- c2 = c1 & VALUE_MASK;
- if (ms_ucs_map_f && 0xE000 <= c2 && c2 <= 0xE757) {
- /* CP5022x UDC */
- c1 &= 0xFFF;
- c2 = 0x7F + c1 / 94;
- c1 = 0x21 + c1 % 94;
- } else {
- if (encode_fallback) (*encode_fallback)(c1);
- return;
- }
- }
- }
-#endif
- if (c2 == 0) {
- output_ascii_escape_sequence(ASCII);
- (*o_putc)(c1);
- }
- else if (c2 == EOF) {
- output_ascii_escape_sequence(ASCII);
- (*o_putc)(EOF);
+ if (output_bom_f) {
+ output_bom_f = FALSE;
+ if (output_endian == ENDIAN_LITTLE){
+ (*o_putc)((unsigned char)'\377');
+ (*o_putc)('\376');
+ (*o_putc)('\000');
+ (*o_putc)('\000');
+ }else{
+ (*o_putc)('\000');
+ (*o_putc)('\000');
+ (*o_putc)('\376');
+ (*o_putc)((unsigned char)'\377');
+ }
}
- else if (c2 == ISO_8859_1) {
- output_ascii_escape_sequence(ISO_8859_1);
- (*o_putc)(c1|0x80);
+
+ if (c2 == EOF) {
+ (*o_putc)(EOF);
+ return;
}
- else if (c2 == JIS_X_0201_1976_K) {
- output_escape_sequence(JIS_X_0201_1976_K);
- (*o_putc)(c1);
-#ifdef X0212_ENABLE
- } else if (is_eucg3(c2)){
- output_escape_sequence(x0213_f ? JIS_X_0213_2 : JIS_X_0212);
- (*o_putc)(c2 & 0x7f);
- (*o_putc)(c1);
+
+ if (c2 == ISO8859_1) {
+ c1 |= 0x80;
+#ifdef NUMCHAR_OPTION
+ } else if (c2 == 0 && is_unicode_capsule(c1)) {
+ c1 &= VALUE_MASK;
#endif
- } else {
- if(ms_ucs_map_f
- ? c2<0x20 || 0x92<c2 || c1<0x20 || 0x7e<c1
- : c2<0x20 || 0x7e<c2 || c1<0x20 || 0x7e<c1) return;
- output_escape_sequence(x0213_f ? JIS_X_0213_1 : JIS_X_0208);
- (*o_putc)(c2);
- (*o_putc)(c1);
+ } else if (c2) {
+ c1 = e2w_conv(c2, c1);
+ if (!c1) return;
+ }
+ if (output_endian == ENDIAN_LITTLE){
+ (*o_putc)( c1 & NKF_INT32_C(0x000000FF));
+ (*o_putc)((c1 & NKF_INT32_C(0x0000FF00)) >> 8);
+ (*o_putc)((c1 & NKF_INT32_C(0x00FF0000)) >> 16);
+ (*o_putc)('\000');
+ }else{
+ (*o_putc)('\000');
+ (*o_putc)((c1 & NKF_INT32_C(0x00FF0000)) >> 16);
+ (*o_putc)((c1 & NKF_INT32_C(0x0000FF00)) >> 8);
+ (*o_putc)( c1 & NKF_INT32_C(0x000000FF));
}
}
+#endif
-static void
-e_oconv(nkf_char c2, nkf_char c1)
+void e_oconv(nkf_char c2, nkf_char c1)
{
- if (c2 == 0 && nkf_char_unicode_p(c1)){
- w16e_conv(c1, &c2, &c1);
- if (c2 == 0 && nkf_char_unicode_p(c1)){
+#ifdef NUMCHAR_OPTION
+ if (c2 == 0 && is_unicode_capsule(c1)){
+ w16e_conv(c1, &c2, &c1);
+ if (c2 == 0 && is_unicode_capsule(c1)){
c2 = c1 & VALUE_MASK;
if (x0212_f && 0xE000 <= c2 && c2 <= 0xE757) {
/* eucJP-ms UDC */
@@ -2385,68 +3967,143 @@ e_oconv(nkf_char c2, nkf_char c1)
if (encode_fallback) (*encode_fallback)(c1);
return;
}
- }
+ }
}
-
+#endif
if (c2 == EOF) {
- (*o_putc)(EOF);
- } else if (c2 == 0) {
+ (*o_putc)(EOF);
+ return;
+ } else if (c2 == 0) {
output_mode = ASCII;
- (*o_putc)(c1);
- } else if (c2 == JIS_X_0201_1976_K) {
- output_mode = EUC_JP;
- (*o_putc)(SS2); (*o_putc)(c1|0x80);
- } else if (c2 == ISO_8859_1) {
- output_mode = ISO_8859_1;
- (*o_putc)(c1 | 0x080);
+ (*o_putc)(c1);
+ } else if (c2 == X0201) {
+ output_mode = JAPANESE_EUC;
+ (*o_putc)(SSO); (*o_putc)(c1|0x80);
+ } else if (c2 == ISO8859_1) {
+ output_mode = ISO8859_1;
+ (*o_putc)(c1 | 0x080);
#ifdef X0212_ENABLE
} else if (is_eucg3(c2)){
- output_mode = EUC_JP;
+ output_mode = JAPANESE_EUC;
#ifdef SHIFTJIS_CP932
- if (!cp932inv_f){
- nkf_char s2, s1;
- if (e2s_conv(c2, c1, &s2, &s1) == 0){
- s2e_conv(s2, s1, &c2, &c1);
- }
- }
-#endif
- if (c2 == 0) {
+ if (!cp932inv_f){
+ nkf_char s2, s1;
+ if (e2s_conv(c2, c1, &s2, &s1) == 0){
+ s2e_conv(s2, s1, &c2, &c1);
+ }
+ }
+#endif
+ if (c2 == 0) {
output_mode = ASCII;
(*o_putc)(c1);
}else if (is_eucg3(c2)){
- if (x0212_f){
- (*o_putc)(0x8f);
- (*o_putc)((c2 & 0x7f) | 0x080);
- (*o_putc)(c1 | 0x080);
+ if (x0212_f){
+ (*o_putc)(0x8f);
+ (*o_putc)((c2 & 0x7f) | 0x080);
+ (*o_putc)(c1 | 0x080);
+ }
+ }else{
+ (*o_putc)((c2 & 0x7f) | 0x080);
+ (*o_putc)(c1 | 0x080);
+ }
+#endif
+ } else {
+ if (!nkf_isgraph(c1) || !nkf_isgraph(c2)) {
+ set_iconv(FALSE, 0);
+ return; /* too late to rescue this char */
+ }
+ output_mode = JAPANESE_EUC;
+ (*o_putc)(c2 | 0x080);
+ (*o_putc)(c1 | 0x080);
+ }
+}
+
+#ifdef X0212_ENABLE
+nkf_char x0212_shift(nkf_char c)
+{
+ nkf_char ret = c;
+ c &= 0x7f;
+ if (is_eucg3(ret)){
+ if (0x75 <= c && c <= 0x7f){
+ ret = c + (0x109 - 0x75);
+ }
+ }else{
+ if (0x75 <= c && c <= 0x7f){
+ ret = c + (0x113 - 0x75);
+ }
+ }
+ return ret;
+}
+
+
+nkf_char x0212_unshift(nkf_char c)
+{
+ nkf_char ret = c;
+ if (0x7f <= c && c <= 0x88){
+ ret = c + (0x75 - 0x7f);
+ }else if (0x89 <= c && c <= 0x92){
+ ret = PREFIX_EUCG3 | 0x80 | (c + (0x75 - 0x89));
+ }
+ return ret;
+}
+#endif /* X0212_ENABLE */
+
+nkf_char e2s_conv(nkf_char c2, nkf_char c1, nkf_char *p2, nkf_char *p1)
+{
+ nkf_char ndx;
+ if (is_eucg3(c2)){
+ ndx = c2 & 0x7f;
+ if (x0213_f){
+ if((0x21 <= ndx && ndx <= 0x2F)){
+ if (p2) *p2 = ((ndx - 1) >> 1) + 0xec - ndx / 8 * 3;
+ if (p1) *p1 = c1 + ((ndx & 1) ? ((c1 < 0x60) ? 0x1f : 0x20) : 0x7e);
+ return 0;
+ }else if(0x6E <= ndx && ndx <= 0x7E){
+ if (p2) *p2 = ((ndx - 1) >> 1) + 0xbe;
+ if (p1) *p1 = c1 + ((ndx & 1) ? ((c1 < 0x60) ? 0x1f : 0x20) : 0x7e);
+ return 0;
}
- }else{
- (*o_putc)((c2 & 0x7f) | 0x080);
- (*o_putc)(c1 | 0x080);
+ return 1;
}
+#ifdef X0212_ENABLE
+ else if(nkf_isgraph(ndx)){
+ nkf_char val = 0;
+ const unsigned short *ptr;
+#if 0
+ extern const unsigned short *const x0212_shiftjis[];
#endif
- } else {
- if (!nkf_isgraph(c1) || !nkf_isgraph(c2)) {
- set_iconv(FALSE, 0);
- return; /* too late to rescue this char */
+ ptr = x0212_shiftjis[ndx - 0x21];
+ if (ptr){
+ val = ptr[(c1 & 0x7f) - 0x21];
+ }
+ if (val){
+ c2 = val >> 8;
+ c1 = val & 0xff;
+ if (p2) *p2 = c2;
+ if (p1) *p1 = c1;
+ return 0;
+ }
+ c2 = x0212_shift(c2);
}
- output_mode = EUC_JP;
- (*o_putc)(c2 | 0x080);
- (*o_putc)(c1 | 0x080);
+#endif /* X0212_ENABLE */
}
+ if(0x7F < c2) return 1;
+ if (p2) *p2 = ((c2 - 1) >> 1) + ((c2 <= 0x5e) ? 0x71 : 0xb1);
+ if (p1) *p1 = c1 + ((c2 & 1) ? ((c1 < 0x60) ? 0x1f : 0x20) : 0x7e);
+ return 0;
}
-static void
-s_oconv(nkf_char c2, nkf_char c1)
+void s_oconv(nkf_char c2, nkf_char c1)
{
#ifdef NUMCHAR_OPTION
- if (c2 == 0 && nkf_char_unicode_p(c1)){
- w16e_conv(c1, &c2, &c1);
- if (c2 == 0 && nkf_char_unicode_p(c1)){
+ if (c2 == 0 && is_unicode_capsule(c1)){
+ w16e_conv(c1, &c2, &c1);
+ if (c2 == 0 && is_unicode_capsule(c1)){
c2 = c1 & VALUE_MASK;
if (!x0213_f && 0xE000 <= c2 && c2 <= 0xE757) {
/* CP932 UDC */
c1 &= 0xFFF;
- c2 = c1 / 188 + (cp932inv_f ? 0xF0 : 0xEB);
+ c2 = c1 / 188 + 0xF0;
c1 = c1 % 188;
c1 += 0x40 + (c1 > 0x3e);
(*o_putc)(c2);
@@ -2460,1250 +4117,515 @@ s_oconv(nkf_char c2, nkf_char c1)
}
#endif
if (c2 == EOF) {
- (*o_putc)(EOF);
- return;
+ (*o_putc)(EOF);
+ return;
} else if (c2 == 0) {
output_mode = ASCII;
- (*o_putc)(c1);
- } else if (c2 == JIS_X_0201_1976_K) {
+ (*o_putc)(c1);
+ } else if (c2 == X0201) {
output_mode = SHIFT_JIS;
- (*o_putc)(c1|0x80);
- } else if (c2 == ISO_8859_1) {
- output_mode = ISO_8859_1;
- (*o_putc)(c1 | 0x080);
+ (*o_putc)(c1|0x80);
+ } else if (c2 == ISO8859_1) {
+ output_mode = ISO8859_1;
+ (*o_putc)(c1 | 0x080);
#ifdef X0212_ENABLE
} else if (is_eucg3(c2)){
output_mode = SHIFT_JIS;
- if (e2s_conv(c2, c1, &c2, &c1) == 0){
- (*o_putc)(c2);
- (*o_putc)(c1);
- }
+ if (e2s_conv(c2, c1, &c2, &c1) == 0){
+ (*o_putc)(c2);
+ (*o_putc)(c1);
+ }
#endif
} else {
- if (!nkf_isprint(c1) || !nkf_isprint(c2)) {
- set_iconv(FALSE, 0);
- return; /* too late to rescue this char */
- }
+ if (!nkf_isprint(c1) || !nkf_isprint(c2)) {
+ set_iconv(FALSE, 0);
+ return; /* too late to rescue this char */
+ }
output_mode = SHIFT_JIS;
- e2s_conv(c2, c1, &c2, &c1);
+ e2s_conv(c2, c1, &c2, &c1);
#ifdef SHIFTJIS_CP932
- if (cp932inv_f
- && CP932INV_TABLE_BEGIN <= c2 && c2 <= CP932INV_TABLE_END){
- nkf_char c = cp932inv[c2 - CP932INV_TABLE_BEGIN][c1 - 0x40];
- if (c){
- c2 = c >> 8;
- c1 = c & 0xff;
- }
- }
+ if (cp932inv_f
+ && CP932INV_TABLE_BEGIN <= c2 && c2 <= CP932INV_TABLE_END){
+#if 0
+ extern const unsigned short cp932inv[2][189];
+#endif
+ nkf_char c = cp932inv[c2 - CP932INV_TABLE_BEGIN][c1 - 0x40];
+ if (c){
+ c2 = c >> 8;
+ c1 = c & 0xff;
+ }
+ }
#endif /* SHIFTJIS_CP932 */
- (*o_putc)(c2);
+ (*o_putc)(c2);
if (prefix_table[(unsigned char)c1]){
- (*o_putc)(prefix_table[(unsigned char)c1]);
- }
- (*o_putc)(c1);
- }
-}
-
-#ifdef UTF8_OUTPUT_ENABLE
-static void
-w_oconv(nkf_char c2, nkf_char c1)
-{
- nkf_char c3, c4;
- nkf_char val;
-
- if (output_bom_f) {
- output_bom_f = FALSE;
- (*o_putc)('\357');
- (*o_putc)('\273');
- (*o_putc)('\277');
- }
-
- if (c2 == EOF) {
- (*o_putc)(EOF);
- return;
- }
-
- if (c2 == 0 && nkf_char_unicode_p(c1)){
- val = c1 & VALUE_MASK;
- nkf_unicode_to_utf8(val, &c1, &c2, &c3, &c4);
- (*o_putc)(c1);
- if (c2) (*o_putc)(c2);
- if (c3) (*o_putc)(c3);
- if (c4) (*o_putc)(c4);
- return;
- }
-
- if (c2 == 0) {
- (*o_putc)(c1);
- } else {
- val = e2w_conv(c2, c1);
- if (val){
- nkf_unicode_to_utf8(val, &c1, &c2, &c3, &c4);
- (*o_putc)(c1);
- if (c2) (*o_putc)(c2);
- if (c3) (*o_putc)(c3);
- if (c4) (*o_putc)(c4);
+ (*o_putc)(prefix_table[(unsigned char)c1]);
}
+ (*o_putc)(c1);
}
}
-static void
-w_oconv16(nkf_char c2, nkf_char c1)
+void j_oconv(nkf_char c2, nkf_char c1)
{
- if (output_bom_f) {
- output_bom_f = FALSE;
- if (output_endian == ENDIAN_LITTLE){
- (*o_putc)(0xFF);
- (*o_putc)(0xFE);
- }else{
- (*o_putc)(0xFE);
- (*o_putc)(0xFF);
- }
- }
-
- if (c2 == EOF) {
- (*o_putc)(EOF);
- return;
- }
-
- if (c2 == 0 && nkf_char_unicode_p(c1)) {
- if (nkf_char_unicode_bmp_p(c1)) {
- c2 = (c1 >> 8) & 0xff;
- c1 &= 0xff;
- } else {
- c1 &= VALUE_MASK;
- if (c1 <= UNICODE_MAX) {
- c2 = (c1 >> 10) + NKF_INT32_C(0xD7C0); /* high surrogate */
- c1 = (c1 & 0x3FF) + NKF_INT32_C(0xDC00); /* low surrogate */
- if (output_endian == ENDIAN_LITTLE){
- (*o_putc)(c2 & 0xff);
- (*o_putc)((c2 >> 8) & 0xff);
- (*o_putc)(c1 & 0xff);
- (*o_putc)((c1 >> 8) & 0xff);
- }else{
- (*o_putc)((c2 >> 8) & 0xff);
- (*o_putc)(c2 & 0xff);
- (*o_putc)((c1 >> 8) & 0xff);
- (*o_putc)(c1 & 0xff);
- }
+#ifdef NUMCHAR_OPTION
+ if (c2 == 0 && is_unicode_capsule(c1)){
+ w16e_conv(c1, &c2, &c1);
+ if (c2 == 0 && is_unicode_capsule(c1)){
+ c2 = c1 & VALUE_MASK;
+ if (ms_ucs_map_f && 0xE000 <= c2 && c2 <= 0xE757) {
+ /* CP5022x UDC */
+ c1 &= 0xFFF;
+ c2 = 0x7F + c1 / 94;
+ c1 = 0x21 + c1 % 94;
+ } else {
+ if (encode_fallback) (*encode_fallback)(c1);
+ return;
}
- return;
- }
- } else if (c2) {
- nkf_char val = e2w_conv(c2, c1);
- c2 = (val >> 8) & 0xff;
- c1 = val & 0xff;
- if (!val) return;
- }
-
- if (output_endian == ENDIAN_LITTLE){
- (*o_putc)(c1);
- (*o_putc)(c2);
- }else{
- (*o_putc)(c2);
- (*o_putc)(c1);
- }
-}
-
-static void
-w_oconv32(nkf_char c2, nkf_char c1)
-{
- if (output_bom_f) {
- output_bom_f = FALSE;
- if (output_endian == ENDIAN_LITTLE){
- (*o_putc)(0xFF);
- (*o_putc)(0xFE);
- (*o_putc)(0);
- (*o_putc)(0);
- }else{
- (*o_putc)(0);
- (*o_putc)(0);
- (*o_putc)(0xFE);
- (*o_putc)(0xFF);
- }
- }
-
- if (c2 == EOF) {
- (*o_putc)(EOF);
- return;
- }
-
- if (c2 == ISO_8859_1) {
- c1 |= 0x80;
- } else if (c2 == 0 && nkf_char_unicode_p(c1)) {
- c1 &= VALUE_MASK;
- } else if (c2) {
- c1 = e2w_conv(c2, c1);
- if (!c1) return;
- }
- if (output_endian == ENDIAN_LITTLE){
- (*o_putc)( c1 & 0xFF);
- (*o_putc)((c1 >> 8) & 0xFF);
- (*o_putc)((c1 >> 16) & 0xFF);
- (*o_putc)(0);
- }else{
- (*o_putc)(0);
- (*o_putc)((c1 >> 16) & 0xFF);
- (*o_putc)((c1 >> 8) & 0xFF);
- (*o_putc)( c1 & 0xFF);
- }
-}
-#endif
-
-#define SCORE_L2 (1) /* Kanji Level 2 */
-#define SCORE_KANA (SCORE_L2 << 1) /* Halfwidth Katakana */
-#define SCORE_DEPEND (SCORE_KANA << 1) /* MD Characters */
-#define SCORE_CP932 (SCORE_DEPEND << 1) /* IBM extended characters */
-#define SCORE_X0212 (SCORE_CP932 << 1) /* JIS X 0212 */
-#define SCORE_NO_EXIST (SCORE_X0212 << 1) /* Undefined Characters */
-#define SCORE_iMIME (SCORE_NO_EXIST << 1) /* MIME selected */
-#define SCORE_ERROR (SCORE_iMIME << 1) /* Error */
-
-#define SCORE_INIT (SCORE_iMIME)
-
-static const nkf_char score_table_A0[] = {
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- 0, SCORE_DEPEND, SCORE_DEPEND, SCORE_DEPEND,
- SCORE_DEPEND, SCORE_DEPEND, SCORE_DEPEND, SCORE_NO_EXIST,
-};
-
-static const nkf_char score_table_F0[] = {
- SCORE_L2, SCORE_L2, SCORE_L2, SCORE_L2,
- SCORE_L2, SCORE_DEPEND, SCORE_NO_EXIST, SCORE_NO_EXIST,
- SCORE_DEPEND, SCORE_DEPEND, SCORE_CP932, SCORE_CP932,
- SCORE_CP932, SCORE_NO_EXIST, SCORE_NO_EXIST, SCORE_ERROR,
-};
-
-static void
-set_code_score(struct input_code *ptr, nkf_char score)
-{
- if (ptr){
- ptr->score |= score;
+ }
}
-}
-
-static void
-clr_code_score(struct input_code *ptr, nkf_char score)
-{
- if (ptr){
- ptr->score &= ~score;
- }
-}
-
-static void
-code_score(struct input_code *ptr)
-{
- nkf_char c2 = ptr->buf[0];
-#ifdef UTF8_OUTPUT_ENABLE
- nkf_char c1 = ptr->buf[1];
#endif
- if (c2 < 0){
- set_code_score(ptr, SCORE_ERROR);
- }else if (c2 == SS2){
- set_code_score(ptr, SCORE_KANA);
- }else if (c2 == 0x8f){
- set_code_score(ptr, SCORE_X0212);
-#ifdef UTF8_OUTPUT_ENABLE
- }else if (!e2w_conv(c2, c1)){
- set_code_score(ptr, SCORE_NO_EXIST);
-#endif
- }else if ((c2 & 0x70) == 0x20){
- set_code_score(ptr, score_table_A0[c2 & 0x0f]);
- }else if ((c2 & 0x70) == 0x70){
- set_code_score(ptr, score_table_F0[c2 & 0x0f]);
- }else if ((c2 & 0x70) >= 0x50){
- set_code_score(ptr, SCORE_L2);
- }
-}
-
-static void
-status_disable(struct input_code *ptr)
-{
- ptr->stat = -1;
- ptr->buf[0] = -1;
- code_score(ptr);
- if (iconv == ptr->iconv_func) set_iconv(FALSE, 0);
-}
-
-static void
-status_push_ch(struct input_code *ptr, nkf_char c)
-{
- ptr->buf[ptr->index++] = c;
-}
-
-static void
-status_clear(struct input_code *ptr)
-{
- ptr->stat = 0;
- ptr->index = 0;
-}
-
-static void
-status_reset(struct input_code *ptr)
-{
- status_clear(ptr);
- ptr->score = SCORE_INIT;
-}
-
-static void
-status_reinit(struct input_code *ptr)
-{
- status_reset(ptr);
- ptr->_file_stat = 0;
-}
-
-static void
-status_check(struct input_code *ptr, nkf_char c)
-{
- if (c <= DEL && estab_f){
- status_reset(ptr);
- }
-}
-
-static void
-s_status(struct input_code *ptr, nkf_char c)
-{
- switch(ptr->stat){
- case -1:
- status_check(ptr, c);
- break;
- case 0:
- if (c <= DEL){
- break;
- }else if (nkf_char_unicode_p(c)){
- break;
- }else if (0xa1 <= c && c <= 0xdf){
- status_push_ch(ptr, SS2);
- status_push_ch(ptr, c);
- code_score(ptr);
- status_clear(ptr);
- }else if ((0x81 <= c && c < 0xa0) || (0xe0 <= c && c <= 0xea)){
- ptr->stat = 1;
- status_push_ch(ptr, c);
- }else if (0xed <= c && c <= 0xee){
- ptr->stat = 3;
- status_push_ch(ptr, c);
-#ifdef SHIFTJIS_CP932
- }else if (is_ibmext_in_sjis(c)){
- ptr->stat = 2;
- status_push_ch(ptr, c);
-#endif /* SHIFTJIS_CP932 */
-#ifdef X0212_ENABLE
- }else if (0xf0 <= c && c <= 0xfc){
- ptr->stat = 1;
- status_push_ch(ptr, c);
-#endif /* X0212_ENABLE */
- }else{
- status_disable(ptr);
- }
- break;
- case 1:
- if ((0x40 <= c && c <= 0x7e) || (0x80 <= c && c <= 0xfc)){
- status_push_ch(ptr, c);
- s2e_conv(ptr->buf[0], ptr->buf[1], &ptr->buf[0], &ptr->buf[1]);
- code_score(ptr);
- status_clear(ptr);
- }else{
- status_disable(ptr);
- }
- break;
- case 2:
-#ifdef SHIFTJIS_CP932
- if ((0x40 <= c && c <= 0x7e) || (0x80 <= c && c <= 0xfc)) {
- status_push_ch(ptr, c);
- if (s2e_conv(ptr->buf[0], ptr->buf[1], &ptr->buf[0], &ptr->buf[1]) == 0) {
- set_code_score(ptr, SCORE_CP932);
- status_clear(ptr);
- break;
- }
- }
-#endif /* SHIFTJIS_CP932 */
- status_disable(ptr);
- break;
- case 3:
- if ((0x40 <= c && c <= 0x7e) || (0x80 <= c && c <= 0xfc)){
- status_push_ch(ptr, c);
- s2e_conv(ptr->buf[0], ptr->buf[1], &ptr->buf[0], &ptr->buf[1]);
- set_code_score(ptr, SCORE_CP932);
- status_clear(ptr);
- }else{
- status_disable(ptr);
- }
- break;
- }
-}
-
-static void
-e_status(struct input_code *ptr, nkf_char c)
-{
- switch (ptr->stat){
- case -1:
- status_check(ptr, c);
- break;
- case 0:
- if (c <= DEL){
- break;
- }else if (nkf_char_unicode_p(c)){
- break;
- }else if (SS2 == c || (0xa1 <= c && c <= 0xfe)){
- ptr->stat = 1;
- status_push_ch(ptr, c);
-#ifdef X0212_ENABLE
- }else if (0x8f == c){
- ptr->stat = 2;
- status_push_ch(ptr, c);
-#endif /* X0212_ENABLE */
- }else{
- status_disable(ptr);
- }
- break;
- case 1:
- if (0xa1 <= c && c <= 0xfe){
- status_push_ch(ptr, c);
- code_score(ptr);
- status_clear(ptr);
- }else{
- status_disable(ptr);
- }
- break;
+ if (c2 == EOF) {
+ if (output_mode !=ASCII && output_mode!=ISO8859_1) {
+ (*o_putc)(ESC);
+ (*o_putc)('(');
+ (*o_putc)(ascii_intro);
+ output_mode = ASCII;
+ }
+ (*o_putc)(EOF);
#ifdef X0212_ENABLE
- case 2:
- if (0xa1 <= c && c <= 0xfe){
- ptr->stat = 1;
- status_push_ch(ptr, c);
- }else{
- status_disable(ptr);
- }
-#endif /* X0212_ENABLE */
- }
-}
-
-#ifdef UTF8_INPUT_ENABLE
-static void
-w_status(struct input_code *ptr, nkf_char c)
-{
- switch (ptr->stat){
- case -1:
- status_check(ptr, c);
- break;
- case 0:
- if (c <= DEL){
- break;
- }else if (nkf_char_unicode_p(c)){
- break;
- }else if (0xc0 <= c && c <= 0xdf){
- ptr->stat = 1;
- status_push_ch(ptr, c);
- }else if (0xe0 <= c && c <= 0xef){
- ptr->stat = 2;
- status_push_ch(ptr, c);
- }else if (0xf0 <= c && c <= 0xf4){
- ptr->stat = 3;
- status_push_ch(ptr, c);
- }else{
- status_disable(ptr);
- }
- break;
- case 1:
- case 2:
- if (0x80 <= c && c <= 0xbf){
- status_push_ch(ptr, c);
- if (ptr->index > ptr->stat){
- int bom = (ptr->buf[0] == 0xef && ptr->buf[1] == 0xbb
- && ptr->buf[2] == 0xbf);
- w2e_conv(ptr->buf[0], ptr->buf[1], ptr->buf[2],
- &ptr->buf[0], &ptr->buf[1]);
- if (!bom){
- code_score(ptr);
- }
- status_clear(ptr);
+ } else if (is_eucg3(c2)){
+ if(x0213_f){
+ if(output_mode!=X0213_2){
+ output_mode = X0213_2;
+ (*o_putc)(ESC);
+ (*o_putc)('$');
+ (*o_putc)('(');
+ (*o_putc)(X0213_2&0x7F);
}
}else{
- status_disable(ptr);
- }
- break;
- case 3:
- if (0x80 <= c && c <= 0xbf){
- if (ptr->index < ptr->stat){
- status_push_ch(ptr, c);
- } else {
- status_clear(ptr);
+ if(output_mode!=X0212){
+ output_mode = X0212;
+ (*o_putc)(ESC);
+ (*o_putc)('$');
+ (*o_putc)('(');
+ (*o_putc)(X0212&0x7F);
}
- }else{
- status_disable(ptr);
- }
- break;
- }
-}
-#endif
-
-static void
-code_status(nkf_char c)
-{
- int action_flag = 1;
- struct input_code *result = 0;
- struct input_code *p = input_code_list;
- while (p->name){
- if (!p->status_func) {
- ++p;
- continue;
- }
- if (!p->status_func)
- continue;
- (p->status_func)(p, c);
- if (p->stat > 0){
- action_flag = 0;
- }else if(p->stat == 0){
- if (result){
- action_flag = 0;
- }else{
- result = p;
- }
- }
- ++p;
- }
-
- if (action_flag){
- if (result && !estab_f){
- set_iconv(TRUE, result->iconv_func);
- }else if (c <= DEL){
- struct input_code *ptr = input_code_list;
- while (ptr->name){
- status_reset(ptr);
- ++ptr;
+ }
+ (*o_putc)(c2 & 0x7f);
+ (*o_putc)(c1);
+#endif
+ } else if (c2==X0201) {
+ if (output_mode!=X0201) {
+ output_mode = X0201;
+ (*o_putc)(ESC);
+ (*o_putc)('(');
+ (*o_putc)('I');
+ }
+ (*o_putc)(c1);
+ } else if (c2==ISO8859_1) {
+ /* iso8859 introduction, or 8th bit on */
+ /* Can we convert in 7bit form using ESC-'-'-A ?
+ Is this popular? */
+ output_mode = ISO8859_1;
+ (*o_putc)(c1|0x80);
+ } else if (c2 == 0) {
+ if (output_mode !=ASCII && output_mode!=ISO8859_1) {
+ (*o_putc)(ESC);
+ (*o_putc)('(');
+ (*o_putc)(ascii_intro);
+ output_mode = ASCII;
+ }
+ (*o_putc)(c1);
+ } else {
+ if(ms_ucs_map_f
+ ? c2<0x20 || 0x92<c2 || c1<0x20 || 0x7e<c1
+ : c2<0x20 || 0x7e<c2 || c1<0x20 || 0x7e<c1) return;
+ if(x0213_f){
+ if (output_mode!=X0213_1) {
+ output_mode = X0213_1;
+ (*o_putc)(ESC);
+ (*o_putc)('$');
+ (*o_putc)('(');
+ (*o_putc)(X0213_1&0x7F);
}
- }
- }
-}
-
-typedef struct {
- nkf_buf_t *std_gc_buf;
- nkf_char broken_state;
- nkf_buf_t *broken_buf;
- nkf_char mimeout_state;
- nkf_buf_t *nfc_buf;
-} nkf_state_t;
-
-static nkf_state_t *nkf_state = NULL;
-
-#define STD_GC_BUFSIZE (256)
-
-static void
-nkf_state_init(void)
-{
- if (nkf_state) {
- nkf_buf_clear(nkf_state->std_gc_buf);
- nkf_buf_clear(nkf_state->broken_buf);
- nkf_buf_clear(nkf_state->nfc_buf);
- }
- else {
- nkf_state = nkf_xmalloc(sizeof(nkf_state_t));
- nkf_state->std_gc_buf = nkf_buf_new(STD_GC_BUFSIZE);
- nkf_state->broken_buf = nkf_buf_new(3);
- nkf_state->nfc_buf = nkf_buf_new(9);
- }
- nkf_state->broken_state = 0;
- nkf_state->mimeout_state = 0;
-}
-
-#ifndef WIN32DLL
-static nkf_char
-std_getc(FILE *f)
-{
- if (!nkf_buf_empty_p(nkf_state->std_gc_buf)){
- return nkf_buf_pop(nkf_state->std_gc_buf);
+ }else if (output_mode != X0208) {
+ output_mode = X0208;
+ (*o_putc)(ESC);
+ (*o_putc)('$');
+ (*o_putc)(kanji_intro);
+ }
+ (*o_putc)(c2);
+ (*o_putc)(c1);
}
- return getc(f);
-}
-#endif /*WIN32DLL*/
-
-static nkf_char
-std_ungetc(nkf_char c, FILE *f)
-{
- nkf_buf_push(nkf_state->std_gc_buf, c);
- return c;
-}
-
-#ifndef WIN32DLL
-static void
-std_putc(nkf_char c)
-{
- if(c!=EOF)
- putchar(c);
}
-#endif /*WIN32DLL*/
-static unsigned char hold_buf[HOLD_SIZE*2];
-static int hold_count = 0;
-static nkf_char
-push_hold_buf(nkf_char c2)
+void base64_conv(nkf_char c2, nkf_char c1)
{
- if (hold_count >= HOLD_SIZE*2)
- return (EOF);
- hold_buf[hold_count++] = (unsigned char)c2;
- return ((hold_count >= HOLD_SIZE*2) ? EOF : hold_count);
-}
-
-static int
-h_conv(FILE *f, int c1, int c2)
-{
- int ret, c4, c3;
- int hold_index;
-
-
- /** it must NOT be in the kanji shifte sequence */
- /** it must NOT be written in JIS7 */
- /** and it must be after 2 byte 8bit code */
-
- hold_count = 0;
- push_hold_buf(c1);
- push_hold_buf(c2);
-
- while ((c2 = (*i_getc)(f)) != EOF) {
- if (c2 == ESC){
- (*i_ungetc)(c2,f);
- break;
- }
- code_status(c2);
- if (push_hold_buf(c2) == EOF || estab_f) {
- break;
- }
- }
-
- if (!estab_f) {
- struct input_code *p = input_code_list;
- struct input_code *result = p;
- if (c2 == EOF) {
- code_status(c2);
- }
- while (p->name) {
- if (p->status_func && p->score < result->score) {
- result = p;
- }
- p++;
- }
- set_iconv(TRUE, result->iconv_func);
- }
-
-
- /** now,
- ** 1) EOF is detected, or
- ** 2) Code is established, or
- ** 3) Buffer is FULL (but last word is pushed)
- **
- ** in 1) and 3) cases, we continue to use
- ** Kanji codes by oconv and leave estab_f unchanged.
- **/
-
- ret = c2;
- hold_index = 0;
- while (hold_index < hold_count){
- c1 = hold_buf[hold_index++];
- if (c1 <= DEL){
- (*iconv)(0, c1, 0);
- continue;
- }else if (iconv == s_iconv && 0xa1 <= c1 && c1 <= 0xdf){
- (*iconv)(JIS_X_0201_1976_K, c1, 0);
- continue;
- }
- if (hold_index < hold_count){
- c2 = hold_buf[hold_index++];
- }else{
- c2 = (*i_getc)(f);
- if (c2 == EOF){
- c4 = EOF;
- break;
- }
- code_status(c2);
- }
- c3 = 0;
- switch ((*iconv)(c1, c2, 0)) { /* can be EUC/SJIS/UTF-8 */
- case -2:
- /* 4 bytes UTF-8 */
- if (hold_index < hold_count){
- c3 = hold_buf[hold_index++];
- } else if ((c3 = (*i_getc)(f)) == EOF) {
- ret = EOF;
- break;
- } else {
- code_status(c3);
- if (hold_index < hold_count){
- c4 = hold_buf[hold_index++];
- } else if ((c4 = (*i_getc)(f)) == EOF) {
- c3 = ret = EOF;
- break;
- } else {
- code_status(c4);
- (*iconv)(c1, c2, (c3<<8)|c4);
- }
- }
- break;
- case -1:
- /* 3 bytes EUC or UTF-8 */
- if (hold_index < hold_count){
- c3 = hold_buf[hold_index++];
- } else if ((c3 = (*i_getc)(f)) == EOF) {
- ret = EOF;
- break;
- } else {
- code_status(c3);
- }
- (*iconv)(c1, c2, c3);
- break;
- }
- if (c3 == EOF) break;
- }
- return ret;
+ mime_prechar(c2, c1);
+ (*o_base64conv)(c2,c1);
}
-/*
- * Check and Ignore BOM
- */
-static void
-check_bom(FILE *f)
-{
- int c2;
- switch(c2 = (*i_getc)(f)){
- case 0x00:
- if((c2 = (*i_getc)(f)) == 0x00){
- if((c2 = (*i_getc)(f)) == 0xFE){
- if((c2 = (*i_getc)(f)) == 0xFF){
- if(!input_encoding){
- set_iconv(TRUE, w_iconv32);
- }
- if (iconv == w_iconv32) {
- input_endian = ENDIAN_BIG;
- return;
- }
- (*i_ungetc)(0xFF,f);
- }else (*i_ungetc)(c2,f);
- (*i_ungetc)(0xFE,f);
- }else if(c2 == 0xFF){
- if((c2 = (*i_getc)(f)) == 0xFE){
- if(!input_encoding){
- set_iconv(TRUE, w_iconv32);
- }
- if (iconv == w_iconv32) {
- input_endian = ENDIAN_2143;
- return;
- }
- (*i_ungetc)(0xFF,f);
- }else (*i_ungetc)(c2,f);
- (*i_ungetc)(0xFF,f);
- }else (*i_ungetc)(c2,f);
- (*i_ungetc)(0x00,f);
- }else (*i_ungetc)(c2,f);
- (*i_ungetc)(0x00,f);
- break;
- case 0xEF:
- if((c2 = (*i_getc)(f)) == 0xBB){
- if((c2 = (*i_getc)(f)) == 0xBF){
- if(!input_encoding){
- set_iconv(TRUE, w_iconv);
- }
- if (iconv == w_iconv) {
- return;
- }
- (*i_ungetc)(0xBF,f);
- }else (*i_ungetc)(c2,f);
- (*i_ungetc)(0xBB,f);
- }else (*i_ungetc)(c2,f);
- (*i_ungetc)(0xEF,f);
- break;
- case 0xFE:
- if((c2 = (*i_getc)(f)) == 0xFF){
- if((c2 = (*i_getc)(f)) == 0x00){
- if((c2 = (*i_getc)(f)) == 0x00){
- if(!input_encoding){
- set_iconv(TRUE, w_iconv32);
- }
- if (iconv == w_iconv32) {
- input_endian = ENDIAN_3412;
- return;
- }
- (*i_ungetc)(0x00,f);
- }else (*i_ungetc)(c2,f);
- (*i_ungetc)(0x00,f);
- }else (*i_ungetc)(c2,f);
- if(!input_encoding){
- set_iconv(TRUE, w_iconv16);
- }
- if (iconv == w_iconv16) {
- input_endian = ENDIAN_BIG;
- return;
- }
- (*i_ungetc)(0xFF,f);
- }else (*i_ungetc)(c2,f);
- (*i_ungetc)(0xFE,f);
- break;
- case 0xFF:
- if((c2 = (*i_getc)(f)) == 0xFE){
- if((c2 = (*i_getc)(f)) == 0x00){
- if((c2 = (*i_getc)(f)) == 0x00){
- if(!input_encoding){
- set_iconv(TRUE, w_iconv32);
- }
- if (iconv == w_iconv32) {
- input_endian = ENDIAN_LITTLE;
- return;
- }
- (*i_ungetc)(0x00,f);
- }else (*i_ungetc)(c2,f);
- (*i_ungetc)(0x00,f);
- }else (*i_ungetc)(c2,f);
- if(!input_encoding){
- set_iconv(TRUE, w_iconv16);
- }
- if (iconv == w_iconv16) {
- input_endian = ENDIAN_LITTLE;
- return;
- }
- (*i_ungetc)(0xFE,f);
- }else (*i_ungetc)(c2,f);
- (*i_ungetc)(0xFF,f);
- break;
- default:
- (*i_ungetc)(c2,f);
- break;
- }
-}
-static nkf_char
-broken_getc(FILE *f)
+static nkf_char broken_buf[3];
+static int broken_counter = 0;
+static int broken_last = 0;
+nkf_char broken_getc(FILE *f)
{
- nkf_char c, c1;
+ nkf_char c,c1;
- if (!nkf_buf_empty_p(nkf_state->broken_buf)) {
- return nkf_buf_pop(nkf_state->broken_buf);
+ if (broken_counter>0) {
+ return broken_buf[--broken_counter];
}
- c = (*i_bgetc)(f);
- if (c=='$' && nkf_state->broken_state != ESC
- && (input_mode == ASCII || input_mode == JIS_X_0201_1976_K)) {
+ c= (*i_bgetc)(f);
+ if (c=='$' && broken_last != ESC
+ && (input_mode==ASCII || input_mode==X0201)) {
c1= (*i_bgetc)(f);
- nkf_state->broken_state = 0;
+ broken_last = 0;
if (c1=='@'|| c1=='B') {
- nkf_buf_push(nkf_state->broken_buf, c1);
- nkf_buf_push(nkf_state->broken_buf, c);
+ broken_buf[0]=c1; broken_buf[1]=c;
+ broken_counter=2;
return ESC;
} else {
(*i_bungetc)(c1,f);
return c;
}
- } else if (c=='(' && nkf_state->broken_state != ESC
- && (input_mode == JIS_X_0208 || input_mode == JIS_X_0201_1976_K)) {
+ } else if (c=='(' && broken_last != ESC
+ && (input_mode==X0208 || input_mode==X0201)) { /* ) */
c1= (*i_bgetc)(f);
- nkf_state->broken_state = 0;
+ broken_last = 0;
if (c1=='J'|| c1=='B') {
- nkf_buf_push(nkf_state->broken_buf, c1);
- nkf_buf_push(nkf_state->broken_buf, c);
+ broken_buf[0]=c1; broken_buf[1]=c;
+ broken_counter=2;
return ESC;
} else {
(*i_bungetc)(c1,f);
return c;
}
} else {
- nkf_state->broken_state = c;
+ broken_last = c;
return c;
}
}
-static nkf_char
-broken_ungetc(nkf_char c, FILE *f)
+nkf_char broken_ungetc(nkf_char c, FILE *f)
{
- if (nkf_buf_length(nkf_state->broken_buf) < 2)
- nkf_buf_push(nkf_state->broken_buf, c);
+ if (broken_counter<2)
+ broken_buf[broken_counter++]=c;
return c;
}
-static void
-eol_conv(nkf_char c2, nkf_char c1)
+static nkf_char prev_cr = 0;
+
+void cr_conv(nkf_char c2, nkf_char c1)
{
- if (guess_f && input_eol != EOF) {
- if (c2 == 0 && c1 == LF) {
- if (!input_eol) input_eol = prev_cr ? CRLF : LF;
- else if (input_eol != (prev_cr ? CRLF : LF)) input_eol = EOF;
- } else if (c2 == 0 && c1 == CR && input_eol == LF) input_eol = EOF;
- else if (!prev_cr);
- else if (!input_eol) input_eol = CR;
- else if (input_eol != CR) input_eol = EOF;
- }
- if (prev_cr || (c2 == 0 && c1 == LF)) {
+ if (prev_cr) {
prev_cr = 0;
- if (eolmode_f != LF) (*o_eol_conv)(0, CR);
- if (eolmode_f != CR) (*o_eol_conv)(0, LF);
+ if (! (c2==0&&c1==NL) ) {
+ cr_conv(0,'\n');
+ }
+ }
+ if (c2) {
+ (*o_crconv)(c2,c1);
+ } else if (c1=='\r') {
+ prev_cr = c1;
+ } else if (c1=='\n') {
+ if (crmode_f==CRLF) {
+ (*o_crconv)(0,'\r');
+ } else if (crmode_f==CR) {
+ (*o_crconv)(0,'\r');
+ return;
+ }
+ (*o_crconv)(0,NL);
+ } else if (c1!='\032' || crmode_f!=NL){
+ (*o_crconv)(c2,c1);
}
- if (c2 == 0 && c1 == CR) prev_cr = CR;
- else if (c2 != 0 || c1 != LF) (*o_eol_conv)(c2, c1);
}
-/*
- Return value of fold_conv()
+/*
+ Return value of fold_conv()
- LF add newline and output char
- CR add newline and output nothing
- SP space
- 0 skip
- 1 (or else) normal output
+ \n add newline and output char
+ \r add newline and output nothing
+ ' ' space
+ 0 skip
+ 1 (or else) normal output
- fold state in prev (previous character)
+ fold state in prev (previous character)
- >0x80 Japanese (X0208/X0201)
- <0x80 ASCII
- LF new line
- SP space
+ >0x80 Japanese (X0208/X0201)
+ <0x80 ASCII
+ \n new line
+ ' ' space
- This fold algorthm does not preserve heading space in a line.
- This is the main difference from fmt.
- */
+ This fold algorthm does not preserve heading space in a line.
+ This is the main difference from fmt.
+*/
#define char_size(c2,c1) (c2?2:1)
-static void
-fold_conv(nkf_char c2, nkf_char c1)
-{
+void fold_conv(nkf_char c2, nkf_char c1)
+{
nkf_char prev0;
nkf_char fold_state;
- if (c1== CR && !fold_preserve_f) {
- fold_state=0; /* ignore cr */
- }else if (c1== LF&&f_prev==CR && fold_preserve_f) {
- f_prev = LF;
- fold_state=0; /* ignore cr */
+ if (c1== '\r' && !fold_preserve_f) {
+ fold_state=0; /* ignore cr */
+ }else if (c1== '\n'&&f_prev=='\r' && fold_preserve_f) {
+ f_prev = '\n';
+ fold_state=0; /* ignore cr */
} else if (c1== BS) {
- if (f_line>0) f_line--;
- fold_state = 1;
+ if (f_line>0) f_line--;
+ fold_state = 1;
} else if (c2==EOF && f_line != 0) { /* close open last line */
- fold_state = LF;
- } else if ((c1==LF && !fold_preserve_f)
- || ((c1==CR||(c1==LF&&f_prev!=CR))
- && fold_preserve_f)) {
- /* new line */
- if (fold_preserve_f) {
- f_prev = c1;
- f_line = 0;
- fold_state = CR;
+ fold_state = '\n';
+ } else if ((c1=='\n' && !fold_preserve_f)
+ || ((c1=='\r'||(c1=='\n'&&f_prev!='\r'))
+ && fold_preserve_f)) {
+ /* new line */
+ if (fold_preserve_f) {
+ f_prev = c1;
+ f_line = 0;
+ fold_state = '\r';
} else if ((f_prev == c1 && !fold_preserve_f)
- || (f_prev == LF && fold_preserve_f)
- ) { /* duplicate newline */
- if (f_line) {
- f_line = 0;
- fold_state = LF; /* output two newline */
- } else {
- f_line = 0;
- fold_state = 1;
- }
- } else {
- if (f_prev&0x80) { /* Japanese? */
- f_prev = c1;
- fold_state = 0; /* ignore given single newline */
- } else if (f_prev==SP) {
- fold_state = 0;
- } else {
- f_prev = c1;
- if (++f_line<=fold_len)
- fold_state = SP;
- else {
- f_line = 0;
- fold_state = CR; /* fold and output nothing */
- }
- }
- }
+ || (f_prev == '\n' && fold_preserve_f)
+ ) { /* duplicate newline */
+ if (f_line) {
+ f_line = 0;
+ fold_state = '\n'; /* output two newline */
+ } else {
+ f_line = 0;
+ fold_state = 1;
+ }
+ } else {
+ if (f_prev&0x80) { /* Japanese? */
+ f_prev = c1;
+ fold_state = 0; /* ignore given single newline */
+ } else if (f_prev==' ') {
+ fold_state = 0;
+ } else {
+ f_prev = c1;
+ if (++f_line<=fold_len)
+ fold_state = ' ';
+ else {
+ f_line = 0;
+ fold_state = '\r'; /* fold and output nothing */
+ }
+ }
+ }
} else if (c1=='\f') {
- f_prev = LF;
- f_line = 0;
- fold_state = LF; /* output newline and clear */
- } else if ((c2==0 && nkf_isblank(c1)) || (c2 == '!' && c1 == '!')) {
- /* X0208 kankaku or ascii space */
- if (f_prev == SP) {
- fold_state = 0; /* remove duplicate spaces */
- } else {
- f_prev = SP;
- if (++f_line<=fold_len)
- fold_state = SP; /* output ASCII space only */
- else {
- f_prev = SP; f_line = 0;
- fold_state = CR; /* fold and output nothing */
- }
- }
+ f_prev = '\n';
+ f_line = 0;
+ fold_state = '\n'; /* output newline and clear */
+ } else if ( (c2==0 && c1==' ')||
+ (c2==0 && c1=='\t')||
+ (c2=='!'&& c1=='!')) {
+ /* X0208 kankaku or ascii space */
+ if (f_prev == ' ') {
+ fold_state = 0; /* remove duplicate spaces */
+ } else {
+ f_prev = ' ';
+ if (++f_line<=fold_len)
+ fold_state = ' '; /* output ASCII space only */
+ else {
+ f_prev = ' '; f_line = 0;
+ fold_state = '\r'; /* fold and output nothing */
+ }
+ }
} else {
- prev0 = f_prev; /* we still need this one... , but almost done */
- f_prev = c1;
- if (c2 || c2 == JIS_X_0201_1976_K)
- f_prev |= 0x80; /* this is Japanese */
- f_line += char_size(c2,c1);
- if (f_line<=fold_len) { /* normal case */
- fold_state = 1;
- } else {
- if (f_line>fold_len+fold_margin) { /* too many kinsoku suspension */
- f_line = char_size(c2,c1);
- fold_state = LF; /* We can't wait, do fold now */
- } else if (c2 == JIS_X_0201_1976_K) {
- /* simple kinsoku rules return 1 means no folding */
- if (c1==(0xde&0x7f)) fold_state = 1; /* $B!+(B*/
- else if (c1==(0xdf&0x7f)) fold_state = 1; /* $B!,(B*/
- else if (c1==(0xa4&0x7f)) fold_state = 1; /* $B!#(B*/
- else if (c1==(0xa3&0x7f)) fold_state = 1; /* $B!$(B*/
- else if (c1==(0xa1&0x7f)) fold_state = 1; /* $B!W(B*/
- else if (c1==(0xb0&0x7f)) fold_state = 1; /* - */
- else if (SP<=c1 && c1<=(0xdf&0x7f)) { /* X0201 */
+ prev0 = f_prev; /* we still need this one... , but almost done */
+ f_prev = c1;
+ if (c2 || c2==X0201)
+ f_prev |= 0x80; /* this is Japanese */
+ f_line += char_size(c2,c1);
+ if (f_line<=fold_len) { /* normal case */
+ fold_state = 1;
+ } else {
+ if (f_line>fold_len+fold_margin) { /* too many kinsoku suspension */
+ f_line = char_size(c2,c1);
+ fold_state = '\n'; /* We can't wait, do fold now */
+ } else if (c2==X0201) {
+ /* simple kinsoku rules return 1 means no folding */
+ if (c1==(0xde&0x7f)) fold_state = 1; /* $B!+(B*/
+ else if (c1==(0xdf&0x7f)) fold_state = 1; /* $B!,(B*/
+ else if (c1==(0xa4&0x7f)) fold_state = 1; /* $B!#(B*/
+ else if (c1==(0xa3&0x7f)) fold_state = 1; /* $B!$(B*/
+ else if (c1==(0xa1&0x7f)) fold_state = 1; /* $B!W(B*/
+ else if (c1==(0xb0&0x7f)) fold_state = 1; /* - */
+ else if (SPACE<=c1 && c1<=(0xdf&0x7f)) { /* X0201 */
f_line = 1;
- fold_state = LF;/* add one new f_line before this character */
+ fold_state = '\n';/* add one new f_line before this character */
} else {
f_line = 1;
- fold_state = LF;/* add one new f_line before this character */
+ fold_state = '\n';/* add one new f_line before this character */
}
- } else if (c2==0) {
- /* kinsoku point in ASCII */
+ } else if (c2==0) {
+ /* kinsoku point in ASCII */
if ( c1==')'|| /* { [ ( */
- c1==']'||
- c1=='}'||
- c1=='.'||
- c1==','||
- c1=='!'||
- c1=='?'||
- c1=='/'||
- c1==':'||
- c1==';') {
+ c1==']'||
+ c1=='}'||
+ c1=='.'||
+ c1==','||
+ c1=='!'||
+ c1=='?'||
+ c1=='/'||
+ c1==':'||
+ c1==';' ) {
fold_state = 1;
- /* just after special */
+ /* just after special */
} else if (!is_alnum(prev0)) {
f_line = char_size(c2,c1);
- fold_state = LF;
- } else if ((prev0==SP) || /* ignored new f_line */
- (prev0==LF)|| /* ignored new f_line */
- (prev0&0x80)) { /* X0208 - ASCII */
+ fold_state = '\n';
+ } else if ((prev0==' ') || /* ignored new f_line */
+ (prev0=='\n')|| /* ignored new f_line */
+ (prev0&0x80)) { /* X0208 - ASCII */
f_line = char_size(c2,c1);
- fold_state = LF;/* add one new f_line before this character */
- } else {
- fold_state = 1; /* default no fold in ASCII */
- }
- } else {
- if (c2=='!') {
- if (c1=='"') fold_state = 1; /* $B!"(B */
- else if (c1=='#') fold_state = 1; /* $B!#(B */
- else if (c1=='W') fold_state = 1; /* $B!W(B */
- else if (c1=='K') fold_state = 1; /* $B!K(B */
- else if (c1=='$') fold_state = 1; /* $B!$(B */
- else if (c1=='%') fold_state = 1; /* $B!%(B */
- else if (c1=='\'') fold_state = 1; /* $B!\(B */
- else if (c1=='(') fold_state = 1; /* $B!((B */
- else if (c1==')') fold_state = 1; /* $B!)(B */
- else if (c1=='*') fold_state = 1; /* $B!*(B */
- else if (c1=='+') fold_state = 1; /* $B!+(B */
- else if (c1==',') fold_state = 1; /* $B!,(B */
- /* default no fold in kinsoku */
- else {
- fold_state = LF;
+ fold_state = '\n';/* add one new f_line before this character */
+ } else {
+ fold_state = 1; /* default no fold in ASCII */
+ }
+ } else {
+ if (c2=='!') {
+ if (c1=='"') fold_state = 1; /* $B!"(B */
+ else if (c1=='#') fold_state = 1; /* $B!#(B */
+ else if (c1=='W') fold_state = 1; /* $B!W(B */
+ else if (c1=='K') fold_state = 1; /* $B!K(B */
+ else if (c1=='$') fold_state = 1; /* $B!$(B */
+ else if (c1=='%') fold_state = 1; /* $B!%(B */
+ else if (c1=='\'') fold_state = 1; /* $B!\(B */
+ else if (c1=='(') fold_state = 1; /* $B!((B */
+ else if (c1==')') fold_state = 1; /* $B!)(B */
+ else if (c1=='*') fold_state = 1; /* $B!*(B */
+ else if (c1=='+') fold_state = 1; /* $B!+(B */
+ else if (c1==',') fold_state = 1; /* $B!,(B */
+ /* default no fold in kinsoku */
+ else {
+ fold_state = '\n';
f_line = char_size(c2,c1);
/* add one new f_line before this character */
}
- } else {
+ } else {
f_line = char_size(c2,c1);
- fold_state = LF;
- /* add one new f_line before this character */
- }
- }
- }
+ fold_state = '\n';
+ /* add one new f_line before this character */
+ }
+ }
+ }
}
/* terminator process */
switch(fold_state) {
- case LF:
- OCONV_NEWLINE((*o_fconv));
- (*o_fconv)(c2,c1);
- break;
- case 0:
- return;
- case CR:
- OCONV_NEWLINE((*o_fconv));
- break;
- case TAB:
- case SP:
- (*o_fconv)(0,SP);
- break;
- default:
- (*o_fconv)(c2,c1);
+ case '\n':
+ (*o_fconv)(0,'\n');
+ (*o_fconv)(c2,c1);
+ break;
+ case 0:
+ return;
+ case '\r':
+ (*o_fconv)(0,'\n');
+ break;
+ case '\t':
+ case ' ':
+ (*o_fconv)(0,' ');
+ break;
+ default:
+ (*o_fconv)(c2,c1);
}
}
-static nkf_char z_prev2=0,z_prev1=0;
+nkf_char z_prev2=0,z_prev1=0;
-static void
-z_conv(nkf_char c2, nkf_char c1)
+void z_conv(nkf_char c2, nkf_char c1)
{
/* if (c2) c1 &= 0x7f; assertion */
- if (c2 == JIS_X_0201_1976_K && (c1 == 0x20 || c1 == 0x7D || c1 == 0x7E)) {
- (*o_zconv)(c2,c1);
- return;
- }
-
- if (x0201_f) {
- if (z_prev2 == JIS_X_0201_1976_K) {
- if (c2 == JIS_X_0201_1976_K) {
- if (c1 == (0xde&0x7f)) { /* $BByE@(B */
- z_prev2 = 0;
- (*o_zconv)(dv[(z_prev1-SP)*2], dv[(z_prev1-SP)*2+1]);
- return;
- } else if (c1 == (0xdf&0x7f) && ev[(z_prev1-SP)*2]) { /* $BH>ByE@(B */
- z_prev2 = 0;
- (*o_zconv)(ev[(z_prev1-SP)*2], ev[(z_prev1-SP)*2+1]);
- return;
- }
- }
- z_prev2 = 0;
- (*o_zconv)(cv[(z_prev1-SP)*2], cv[(z_prev1-SP)*2+1]);
- }
- if (c2 == JIS_X_0201_1976_K) {
- if (dv[(c1-SP)*2] || ev[(c1-SP)*2]) {
- /* wait for $BByE@(B or $BH>ByE@(B */
- z_prev1 = c1;
- z_prev2 = c2;
- return;
- } else {
- (*o_zconv)(cv[(c1-SP)*2], cv[(c1-SP)*2+1]);
- return;
- }
- }
- }
-
- if (c2 == EOF) {
- (*o_zconv)(c2, c1);
- return;
- }
-
- if (alpha_f&1 && c2 == 0x23) {
- /* JISX0208 Alphabet */
- c2 = 0;
- } else if (c2 == 0x21) {
- /* JISX0208 Kigou */
- if (0x21==c1) {
- if (alpha_f&2) {
- c2 = 0;
- c1 = SP;
- } else if (alpha_f&4) {
- (*o_zconv)(0, SP);
- (*o_zconv)(0, SP);
- return;
- }
- } else if (alpha_f&1 && 0x20<c1 && c1<0x7f && fv[c1-0x20]) {
- c2 = 0;
- c1 = fv[c1-0x20];
- }
- }
-
- if (alpha_f&8 && c2 == 0) {
- /* HTML Entity */
- const char *entity = 0;
- switch (c1){
- case '>': entity = "&gt;"; break;
- case '<': entity = "&lt;"; break;
- case '\"': entity = "&quot;"; break;
- case '&': entity = "&amp;"; break;
- }
- if (entity){
- while (*entity) (*o_zconv)(0, *entity++);
- return;
- }
- }
-
- if (alpha_f & 16) {
- /* JIS X 0208 Katakana to JIS X 0201 Katakana */
- if (c2 == 0x21) {
- nkf_char c = 0;
- switch (c1) {
- case 0x23:
- /* U+3002 (0x8142) Ideographic Full Stop -> U+FF61 (0xA1) Halfwidth Ideographic Full Stop */
- c = 0xA1;
- break;
- case 0x56:
- /* U+300C (0x8175) Left Corner Bracket -> U+FF62 (0xA2) Halfwidth Left Corner Bracket */
- c = 0xA2;
- break;
- case 0x57:
- /* U+300D (0x8176) Right Corner Bracket -> U+FF63 (0xA3) Halfwidth Right Corner Bracket */
- c = 0xA3;
- break;
- case 0x22:
- /* U+3001 (0x8141) Ideographic Comma -> U+FF64 (0xA4) Halfwidth Ideographic Comma */
- c = 0xA4;
- break;
- case 0x26:
- /* U+30FB (0x8145) Katakana Middle Dot -> U+FF65 (0xA5) Halfwidth Katakana Middle Dot */
- c = 0xA5;
- break;
- case 0x3C:
- /* U+30FC (0x815B) Katakana-Hiragana Prolonged Sound Mark -> U+FF70 (0xB0) Halfwidth Katakana-Hiragana Prolonged Sound Mark */
- c = 0xB0;
- break;
- case 0x2B:
- /* U+309B (0x814A) Katakana-Hiragana Voiced Sound Mark -> U+FF9E (0xDE) Halfwidth Katakana Voiced Sound Mark */
- c = 0xDE;
- break;
- case 0x2C:
- /* U+309C (0x814B) Katakana-Hiragana Semi-Voiced Sound Mark -> U+FF9F (0xDF) Halfwidth Katakana Semi-Voiced Sound Mark */
- c = 0xDF;
- break;
- }
- if (c) {
- (*o_zconv)(JIS_X_0201_1976_K, c);
- return;
- }
- } else if (c2 == 0x25) {
- /* JISX0208 Katakana */
- static const int fullwidth_to_halfwidth[] =
- {
- 0x0000, 0x2700, 0x3100, 0x2800, 0x3200, 0x2900, 0x3300, 0x2A00,
- 0x3400, 0x2B00, 0x3500, 0x3600, 0x365E, 0x3700, 0x375E, 0x3800,
- 0x385E, 0x3900, 0x395E, 0x3A00, 0x3A5E, 0x3B00, 0x3B5E, 0x3C00,
- 0x3C5E, 0x3D00, 0x3D5E, 0x3E00, 0x3E5E, 0x3F00, 0x3F5E, 0x4000,
- 0x405E, 0x4100, 0x415E, 0x2F00, 0x4200, 0x425E, 0x4300, 0x435E,
- 0x4400, 0x445E, 0x4500, 0x4600, 0x4700, 0x4800, 0x4900, 0x4A00,
- 0x4A5E, 0x4A5F, 0x4B00, 0x4B5E, 0x4B5F, 0x4C00, 0x4C5E, 0x4C5F,
- 0x4D00, 0x4D5E, 0x4D5F, 0x4E00, 0x4E5E, 0x4E5F, 0x4F00, 0x5000,
- 0x5100, 0x5200, 0x5300, 0x2C00, 0x5400, 0x2D00, 0x5500, 0x2E00,
- 0x5600, 0x5700, 0x5800, 0x5900, 0x5A00, 0x5B00, 0x0000, 0x5C00,
- 0x0000, 0x0000, 0x2600, 0x5D00, 0x335E, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000
- };
- if (fullwidth_to_halfwidth[c1-0x20]){
- c2 = fullwidth_to_halfwidth[c1-0x20];
- (*o_zconv)(JIS_X_0201_1976_K, c2>>8);
- if (c2 & 0xFF) {
- (*o_zconv)(JIS_X_0201_1976_K, c2&0xFF);
- }
- return;
- }
- }
+ if (x0201_f && z_prev2==X0201) { /* X0201 */
+ if (c1==(0xde&0x7f)) { /* $BByE@(B */
+ z_prev2=0;
+ (*o_zconv)(dv[(z_prev1-SPACE)*2],dv[(z_prev1-SPACE)*2+1]);
+ return;
+ } else if (c1==(0xdf&0x7f)&&ev[(z_prev1-SPACE)*2]) { /* $BH>ByE@(B */
+ z_prev2=0;
+ (*o_zconv)(ev[(z_prev1-SPACE)*2],ev[(z_prev1-SPACE)*2+1]);
+ return;
+ } else {
+ z_prev2=0;
+ (*o_zconv)(cv[(z_prev1-SPACE)*2],cv[(z_prev1-SPACE)*2+1]);
+ }
+ }
+
+ if (c2==EOF) {
+ (*o_zconv)(c2,c1);
+ return;
+ }
+
+ if (x0201_f && c2==X0201) {
+ if (dv[(c1-SPACE)*2]||ev[(c1-SPACE)*2]) {
+ /* wait for $BByE@(B or $BH>ByE@(B */
+ z_prev1 = c1; z_prev2 = c2;
+ return;
+ } else {
+ (*o_zconv)(cv[(c1-SPACE)*2],cv[(c1-SPACE)*2+1]);
+ return;
+ }
+ }
+
+ /* JISX0208 Alphabet */
+ if (alpha_f && c2 == 0x23 ) {
+ c2 = 0;
+ } else if (alpha_f && c2 == 0x21 ) {
+ /* JISX0208 Kigou */
+ if (0x21==c1) {
+ if (alpha_f&0x2) {
+ c1 = ' ';
+ c2 = 0;
+ } else if (alpha_f&0x4) {
+ (*o_zconv)(0,' ');
+ (*o_zconv)(0,' ');
+ return;
+ }
+ } else if (0x20<c1 && c1<0x7f && fv[c1-0x20]) {
+ c1 = fv[c1-0x20];
+ c2 = 0;
+ if (alpha_f&0x8) {
+ char *entity = 0;
+ switch (c1){
+ case '>': entity = "&gt;"; break;
+ case '<': entity = "&lt;"; break;
+ case '\"': entity = "&quot;"; break;
+ case '&': entity = "&amp;"; break;
+ }
+ if (entity){
+ while (*entity) (*o_zconv)(0, *entity++);
+ return;
+ }
+ }
+ }
}
(*o_zconv)(c2,c1);
}
#define rot13(c) ( \
- ( c < 'A') ? c: \
- (c <= 'M') ? (c + 13): \
- (c <= 'Z') ? (c - 13): \
- (c < 'a') ? (c): \
- (c <= 'm') ? (c + 13): \
- (c <= 'z') ? (c - 13): \
- (c) \
- )
+ ( c < 'A' ) ? c: \
+ (c <= 'M') ? (c + 13): \
+ (c <= 'Z') ? (c - 13): \
+ (c < 'a') ? (c): \
+ (c <= 'm') ? (c + 13): \
+ (c <= 'z') ? (c - 13): \
+ (c) \
+)
#define rot47(c) ( \
- ( c < '!') ? c: \
- ( c <= 'O') ? (c + 47) : \
- ( c <= '~') ? (c - 47) : \
- c \
- )
-
-static void
-rot_conv(nkf_char c2, nkf_char c1)
+ ( c < '!' ) ? c: \
+ ( c <= 'O' ) ? (c + 47) : \
+ ( c <= '~' ) ? (c - 47) : \
+ c \
+)
+
+void rot_conv(nkf_char c2, nkf_char c1)
{
- if (c2 == 0 || c2 == JIS_X_0201_1976_K || c2 == ISO_8859_1) {
+ if (c2==0 || c2==X0201 || c2==ISO8859_1) {
c1 = rot13(c1);
} else if (c2) {
c1 = rot47(c1);
@@ -3712,64 +4634,61 @@ rot_conv(nkf_char c2, nkf_char c1)
(*o_rot_conv)(c2,c1);
}
-static void
-hira_conv(nkf_char c2, nkf_char c1)
+void hira_conv(nkf_char c2, nkf_char c1)
{
if (hira_f & 1) {
- if (c2 == 0x25) {
- if (0x20 < c1 && c1 < 0x74) {
- c2 = 0x24;
- (*o_hira_conv)(c2,c1);
- return;
- } else if (c1 == 0x74 && nkf_enc_unicode_p(output_encoding)) {
- c2 = 0;
- c1 = nkf_char_unicode_new(0x3094);
- (*o_hira_conv)(c2,c1);
- return;
- }
- } else if (c2 == 0x21 && (c1 == 0x33 || c1 == 0x34)) {
- c1 += 2;
- (*o_hira_conv)(c2,c1);
- return;
- }
+ if (c2 == 0x25) {
+ if (0x20 < c1 && c1 < 0x74) {
+ c2 = 0x24;
+ (*o_hira_conv)(c2,c1);
+ return;
+ } else if (c1 == 0x74 && (output_conv == w_oconv || output_conv == w_oconv16)) {
+ c2 = 0;
+ c1 = CLASS_UNICODE | 0x3094;
+ (*o_hira_conv)(c2,c1);
+ return;
+ }
+ } else if (c2 == 0x21 && (c1 == 0x33 || c1 == 0x34)) {
+ c1 += 2;
+ (*o_hira_conv)(c2,c1);
+ return;
+ }
}
if (hira_f & 2) {
- if (c2 == 0 && c1 == nkf_char_unicode_new(0x3094)) {
- c2 = 0x25;
- c1 = 0x74;
- } else if (c2 == 0x24 && 0x20 < c1 && c1 < 0x74) {
- c2 = 0x25;
- } else if (c2 == 0x21 && (c1 == 0x35 || c1 == 0x36)) {
- c1 -= 2;
- }
+ if (c2 == 0 && c1 == (CLASS_UNICODE | 0x3094)) {
+ c2 = 0x25;
+ c1 = 0x74;
+ } else if (c2 == 0x24 && 0x20 < c1 && c1 < 0x74) {
+ c2 = 0x25;
+ } else if (c2 == 0x21 && (c1 == 0x35 || c1 == 0x36)) {
+ c1 -= 2;
+ }
}
(*o_hira_conv)(c2,c1);
}
-static void
-iso2022jp_check_conv(nkf_char c2, nkf_char c1)
+void iso2022jp_check_conv(nkf_char c2, nkf_char c1)
{
-#define RANGE_NUM_MAX 18
static const nkf_char range[RANGE_NUM_MAX][2] = {
- {0x222f, 0x2239,},
- {0x2242, 0x2249,},
- {0x2251, 0x225b,},
- {0x226b, 0x2271,},
- {0x227a, 0x227d,},
- {0x2321, 0x232f,},
- {0x233a, 0x2340,},
- {0x235b, 0x2360,},
- {0x237b, 0x237e,},
- {0x2474, 0x247e,},
- {0x2577, 0x257e,},
- {0x2639, 0x2640,},
- {0x2659, 0x267e,},
- {0x2742, 0x2750,},
- {0x2772, 0x277e,},
- {0x2841, 0x287e,},
- {0x4f54, 0x4f7e,},
- {0x7425, 0x747e},
+ {0x222f, 0x2239,},
+ {0x2242, 0x2249,},
+ {0x2251, 0x225b,},
+ {0x226b, 0x2271,},
+ {0x227a, 0x227d,},
+ {0x2321, 0x232f,},
+ {0x233a, 0x2340,},
+ {0x235b, 0x2360,},
+ {0x237b, 0x237e,},
+ {0x2474, 0x247e,},
+ {0x2577, 0x257e,},
+ {0x2639, 0x2640,},
+ {0x2659, 0x267e,},
+ {0x2742, 0x2750,},
+ {0x2772, 0x277e,},
+ {0x2841, 0x287e,},
+ {0x4f54, 0x4f7e,},
+ {0x7425, 0x747e},
};
nkf_char i;
nkf_char start, end, c;
@@ -3798,7 +4717,7 @@ iso2022jp_check_conv(nkf_char c2, nkf_char c1)
/* This converts =?ISO-2022-JP?B?HOGE HOGE?= */
-static const unsigned char *mime_pattern[] = {
+const unsigned char *mime_pattern[] = {
(const unsigned char *)"\075?EUC-JP?B?",
(const unsigned char *)"\075?SHIFT_JIS?B?",
(const unsigned char *)"\075?ISO-8859-1?Q?",
@@ -3823,16 +4742,16 @@ nkf_char (*mime_priority_func[])(nkf_char c2, nkf_char c1, nkf_char c0) = {
0,
};
-static const nkf_char mime_encode[] = {
- EUC_JP, SHIFT_JIS, ISO_8859_1, ISO_8859_1, JIS_X_0208, JIS_X_0201_1976_K,
+const nkf_char mime_encode[] = {
+ JAPANESE_EUC, SHIFT_JIS,ISO8859_1, ISO8859_1, X0208, X0201,
#if defined(UTF8_INPUT_ENABLE)
- UTF_8, UTF_8,
+ UTF8, UTF8,
#endif
ASCII,
0
};
-static const nkf_char mime_encode_method[] = {
+const nkf_char mime_encode_method[] = {
'B', 'B','Q', 'B', 'B', 'Q',
#if defined(UTF8_INPUT_ENABLE)
'B', 'Q',
@@ -3842,55 +4761,9 @@ static const nkf_char mime_encode_method[] = {
};
-/* MIME preprocessor fifo */
-
-#define MIME_BUF_SIZE (1024) /* 2^n ring buffer */
-#define MIME_BUF_MASK (MIME_BUF_SIZE-1)
-#define mime_input_buf(n) mime_input_state.buf[(n)&MIME_BUF_MASK]
-static struct {
- unsigned char buf[MIME_BUF_SIZE];
- unsigned int top;
- unsigned int last; /* decoded */
- unsigned int input; /* undecoded */
-} mime_input_state;
-static nkf_char (*mime_iconv_back)(nkf_char c2,nkf_char c1,nkf_char c0) = NULL;
-
#define MAXRECOVER 20
-static void
-mime_input_buf_unshift(nkf_char c)
-{
- mime_input_buf(--mime_input_state.top) = (unsigned char)c;
-}
-
-static nkf_char
-mime_ungetc(nkf_char c, FILE *f)
-{
- mime_input_buf_unshift(c);
- return c;
-}
-
-static nkf_char
-mime_ungetc_buf(nkf_char c, FILE *f)
-{
- if (mimebuf_f)
- (*i_mungetc_buf)(c,f);
- else
- mime_input_buf(--mime_input_state.input) = (unsigned char)c;
- return c;
-}
-
-static nkf_char
-mime_getc_buf(FILE *f)
-{
- /* we don't keep eof of mime_input_buf, becase it contains ?= as
- a terminator. It was checked in mime_integrity. */
- return ((mimebuf_f)?
- (*i_mgetc_buf)(f):mime_input_buf(mime_input_state.input++));
-}
-
-static void
-switch_mime_getc(void)
+void switch_mime_getc(void)
{
if (i_getc!=mime_getc) {
i_mgetc = i_getc; i_getc = mime_getc;
@@ -3902,8 +4775,7 @@ switch_mime_getc(void)
}
}
-static void
-unswitch_mime_getc(void)
+void unswitch_mime_getc(void)
{
if(mime_f==STRICT_MIME) {
i_mgetc = i_mgetc_buf;
@@ -3915,47 +4787,7 @@ unswitch_mime_getc(void)
mime_iconv_back = NULL;
}
-static nkf_char
-mime_integrity(FILE *f, const unsigned char *p)
-{
- nkf_char c,d;
- unsigned int q;
- /* In buffered mode, read until =? or NL or buffer full
- */
- mime_input_state.input = mime_input_state.top;
- mime_input_state.last = mime_input_state.top;
-
- while(*p) mime_input_buf(mime_input_state.input++) = *p++;
- d = 0;
- q = mime_input_state.input;
- while((c=(*i_getc)(f))!=EOF) {
- if (((mime_input_state.input-mime_input_state.top)&MIME_BUF_MASK)==0) {
- break; /* buffer full */
- }
- if (c=='=' && d=='?') {
- /* checked. skip header, start decode */
- mime_input_buf(mime_input_state.input++) = (unsigned char)c;
- /* mime_last_input = mime_input_state.input; */
- mime_input_state.input = q;
- switch_mime_getc();
- return 1;
- }
- if (!( (c=='+'||c=='/'|| c=='=' || c=='?' || is_alnum(c))))
- break;
- /* Should we check length mod 4? */
- mime_input_buf(mime_input_state.input++) = (unsigned char)c;
- d=c;
- }
- /* In case of Incomplete MIME, no MIME decode */
- mime_input_buf(mime_input_state.input++) = (unsigned char)c;
- mime_input_state.last = mime_input_state.input; /* point undecoded buffer */
- mime_decode_mode = 1; /* no decode on mime_input_buf last in mime_getc */
- switch_mime_getc(); /* anyway we need buffered getc */
- return 1;
-}
-
-static nkf_char
-mime_begin_strict(FILE *f)
+nkf_char mime_begin_strict(FILE *f)
{
nkf_char c1 = 0;
int i,j,k;
@@ -3968,25 +4800,25 @@ mime_begin_strict(FILE *f)
p = mime_pattern[j];
r[0]='='; r[1]='?';
- for(i=2;p[i]>SP;i++) { /* start at =? */
- if (((r[i] = c1 = (*i_getc)(f))==EOF) || nkf_toupper(c1) != p[i]) {
- /* pattern fails, try next one */
- q = p;
- while (mime_pattern[++j]) {
+ for(i=2;p[i]>' ';i++) { /* start at =? */
+ if ( ((r[i] = c1 = (*i_getc)(f))==EOF) || nkf_toupper(c1) != p[i] ) {
+ /* pattern fails, try next one */
+ q = p;
+ while (mime_pattern[++j]) {
p = mime_pattern[j];
- for(k=2;k<i;k++) /* assume length(p) > i */
- if (p[k]!=q[k]) break;
- if (k==i && nkf_toupper(c1)==p[k]) break;
- }
+ for(k=2;k<i;k++) /* assume length(p) > i */
+ if (p[k]!=q[k]) break;
+ if (k==i && nkf_toupper(c1)==p[k]) break;
+ }
p = mime_pattern[j];
- if (p) continue; /* found next one, continue */
- /* all fails, output from recovery buffer */
- (*i_ungetc)(c1,f);
- for(j=0;j<i;j++) {
- (*oconv)(0,r[j]);
- }
- return c1;
- }
+ if (p) continue; /* found next one, continue */
+ /* all fails, output from recovery buffer */
+ (*i_ungetc)(c1,f);
+ for(j=0;j<i;j++) {
+ (*oconv)(0,r[j]);
+ }
+ return c1;
+ }
}
mime_decode_mode = p[i-2];
@@ -3995,19 +4827,35 @@ mime_begin_strict(FILE *f)
clr_code_score(find_inputcode_byfunc(mime_priority_func[j]), SCORE_iMIME);
if (mime_decode_mode=='B') {
- mimebuf_f = unbuf_f;
- if (!unbuf_f) {
- /* do MIME integrity check */
- return mime_integrity(f,mime_pattern[j]);
- }
+ mimebuf_f = unbuf_f;
+ if (!unbuf_f) {
+ /* do MIME integrity check */
+ return mime_integrity(f,mime_pattern[j]);
+ }
}
switch_mime_getc();
mimebuf_f = TRUE;
return c1;
}
-static nkf_char
-mime_begin(FILE *f)
+nkf_char mime_getc_buf(FILE *f)
+{
+ /* we don't keep eof of Fifo, becase it contains ?= as
+ a terminator. It was checked in mime_integrity. */
+ return ((mimebuf_f)?
+ (*i_mgetc_buf)(f):Fifo(mime_input++));
+}
+
+nkf_char mime_ungetc_buf(nkf_char c, FILE *f)
+{
+ if (mimebuf_f)
+ (*i_mungetc_buf)(c,f);
+ else
+ Fifo(--mime_input) = (unsigned char)c;
+ return c;
+}
+
+nkf_char mime_begin(FILE *f)
{
nkf_char c1;
int i,k;
@@ -4016,236 +4864,195 @@ mime_begin(FILE *f)
/* re-read and convert again from mime_buffer. */
/* =? has been checked */
- k = mime_input_state.last;
- mime_input_buf(mime_input_state.last++)='='; mime_input_buf(mime_input_state.last++)='?';
+ k = mime_last;
+ Fifo(mime_last++)='='; Fifo(mime_last++)='?';
for(i=2;i<MAXRECOVER;i++) { /* start at =? */
- /* We accept any character type even if it is breaked by new lines */
- c1 = (*i_getc)(f); mime_input_buf(mime_input_state.last++) = (unsigned char)c1;
- if (c1==LF||c1==SP||c1==CR||
- c1=='-'||c1=='_'||is_alnum(c1)) continue;
- if (c1=='=') {
- /* Failed. But this could be another MIME preemble */
- (*i_ungetc)(c1,f);
- mime_input_state.last--;
- break;
- }
- if (c1!='?') break;
- else {
- /* c1=='?' */
- c1 = (*i_getc)(f); mime_input_buf(mime_input_state.last++) = (unsigned char)c1;
- if (!(++i<MAXRECOVER) || c1==EOF) break;
- if (c1=='b'||c1=='B') {
- mime_decode_mode = 'B';
- } else if (c1=='q'||c1=='Q') {
- mime_decode_mode = 'Q';
- } else {
- break;
- }
- c1 = (*i_getc)(f); mime_input_buf(mime_input_state.last++) = (unsigned char)c1;
- if (!(++i<MAXRECOVER) || c1==EOF) break;
- if (c1!='?') {
- mime_decode_mode = FALSE;
- }
- break;
- }
+ /* We accept any character type even if it is breaked by new lines */
+ c1 = (*i_getc)(f); Fifo(mime_last++) = (unsigned char)c1;
+ if (c1=='\n'||c1==' '||c1=='\r'||
+ c1=='-'||c1=='_'||is_alnum(c1) ) continue;
+ if (c1=='=') {
+ /* Failed. But this could be another MIME preemble */
+ (*i_ungetc)(c1,f);
+ mime_last--;
+ break;
+ }
+ if (c1!='?') break;
+ else {
+ /* c1=='?' */
+ c1 = (*i_getc)(f); Fifo(mime_last++) = (unsigned char)c1;
+ if (!(++i<MAXRECOVER) || c1==EOF) break;
+ if (c1=='b'||c1=='B') {
+ mime_decode_mode = 'B';
+ } else if (c1=='q'||c1=='Q') {
+ mime_decode_mode = 'Q';
+ } else {
+ break;
+ }
+ c1 = (*i_getc)(f); Fifo(mime_last++) = (unsigned char)c1;
+ if (!(++i<MAXRECOVER) || c1==EOF) break;
+ if (c1!='?') {
+ mime_decode_mode = FALSE;
+ }
+ break;
+ }
}
switch_mime_getc();
if (!mime_decode_mode) {
- /* false MIME premble, restart from mime_buffer */
- mime_decode_mode = 1; /* no decode, but read from the mime_buffer */
- /* Since we are in MIME mode until buffer becomes empty, */
- /* we never go into mime_begin again for a while. */
- return c1;
+ /* false MIME premble, restart from mime_buffer */
+ mime_decode_mode = 1; /* no decode, but read from the mime_buffer */
+ /* Since we are in MIME mode until buffer becomes empty, */
+ /* we never go into mime_begin again for a while. */
+ return c1;
}
/* discard mime preemble, and goto MIME mode */
- mime_input_state.last = k;
+ mime_last = k;
/* do no MIME integrity check */
return c1; /* used only for checking EOF */
}
#ifdef CHECK_OPTION
-static void
-no_putc(nkf_char c)
+void no_putc(nkf_char c)
{
;
}
-static void
-debug(const char *str)
+void debug(const char *str)
{
if (debug_f){
- fprintf(stderr, "%s\n", str ? str : "NULL");
+ fprintf(stderr, "%s\n", str);
}
}
#endif
-static void
-set_input_codename(const char *codename)
+void set_input_codename(char *codename)
{
- if (!input_codename) {
- input_codename = codename;
- } else if (strcmp(codename, input_codename) != 0) {
- input_codename = "";
- }
-}
-
-static const char*
-get_guessed_code(void)
-{
- if (input_codename && !*input_codename) {
- input_codename = "BINARY";
- } else {
- struct input_code *p = find_inputcode_byfunc(iconv);
- if (!input_codename) {
- input_codename = "ASCII";
- } else if (strcmp(input_codename, "Shift_JIS") == 0) {
- if (p->score & (SCORE_DEPEND|SCORE_CP932))
- input_codename = "CP932";
- } else if (strcmp(input_codename, "EUC-JP") == 0) {
- if (p->score & (SCORE_X0212))
- input_codename = "EUCJP-MS";
- else if (p->score & (SCORE_DEPEND|SCORE_CP932))
- input_codename = "CP51932";
- } else if (strcmp(input_codename, "ISO-2022-JP") == 0) {
- if (p->score & (SCORE_KANA))
- input_codename = "CP50221";
- else if (p->score & (SCORE_DEPEND|SCORE_CP932))
- input_codename = "CP50220";
- }
+ if (guess_f &&
+ is_inputcode_set &&
+ strcmp(codename, "") != 0 &&
+ strcmp(codename, input_codename) != 0)
+ {
+ is_inputcode_mixed = TRUE;
}
- return input_codename;
+ input_codename = codename;
+ is_inputcode_set = TRUE;
}
#if !defined(PERL_XS) && !defined(WIN32DLL)
-static void
-print_guessed_code(char *filename)
+void print_guessed_code(char *filename)
{
- if (filename != NULL) printf("%s: ", filename);
- if (input_codename && !*input_codename) {
- printf("BINARY\n");
- } else {
- input_codename = get_guessed_code();
- if (guess_f == 1) {
- printf("%s\n", input_codename);
- } else {
- printf("%s%s\n",
- input_codename,
- input_eol == CR ? " (CR)" :
- input_eol == LF ? " (LF)" :
- input_eol == CRLF ? " (CRLF)" :
- input_eol == EOF ? " (MIXED NL)" :
- "");
- }
- }
+ char *codename = "BINARY";
+ if (!is_inputcode_mixed) {
+ if (strcmp(input_codename, "") == 0) {
+ codename = "ASCII";
+ } else {
+ codename = input_codename;
+ }
+ }
+ if (filename != NULL) printf("%s:", filename);
+ printf("%s\n", codename);
}
#endif /*WIN32DLL*/
-#ifdef INPUT_OPTION
+#ifdef INPUT_OPTION
-static nkf_char
-hex_getc(nkf_char ch, FILE *f, nkf_char (*g)(FILE *f), nkf_char (*u)(nkf_char c, FILE *f))
+nkf_char hex_getc(nkf_char ch, FILE *f, nkf_char (*g)(FILE *f), nkf_char (*u)(nkf_char c, FILE *f))
{
nkf_char c1, c2, c3;
c1 = (*g)(f);
if (c1 != ch){
- return c1;
+ return c1;
}
c2 = (*g)(f);
if (!nkf_isxdigit(c2)){
- (*u)(c2, f);
- return c1;
+ (*u)(c2, f);
+ return c1;
}
c3 = (*g)(f);
if (!nkf_isxdigit(c3)){
- (*u)(c2, f);
- (*u)(c3, f);
- return c1;
+ (*u)(c2, f);
+ (*u)(c3, f);
+ return c1;
}
return (hex2bin(c2) << 4) | hex2bin(c3);
}
-static nkf_char
-cap_getc(FILE *f)
+nkf_char cap_getc(FILE *f)
{
return hex_getc(':', f, i_cgetc, i_cungetc);
}
-static nkf_char
-cap_ungetc(nkf_char c, FILE *f)
+nkf_char cap_ungetc(nkf_char c, FILE *f)
{
return (*i_cungetc)(c, f);
}
-static nkf_char
-url_getc(FILE *f)
+nkf_char url_getc(FILE *f)
{
return hex_getc('%', f, i_ugetc, i_uungetc);
}
-static nkf_char
-url_ungetc(nkf_char c, FILE *f)
+nkf_char url_ungetc(nkf_char c, FILE *f)
{
return (*i_uungetc)(c, f);
}
#endif
#ifdef NUMCHAR_OPTION
-static nkf_char
-numchar_getc(FILE *f)
+nkf_char numchar_getc(FILE *f)
{
nkf_char (*g)(FILE *) = i_ngetc;
nkf_char (*u)(nkf_char c ,FILE *f) = i_nungetc;
int i = 0, j;
- nkf_char buf[12];
+ nkf_char buf[8];
long c = -1;
buf[i] = (*g)(f);
if (buf[i] == '&'){
- buf[++i] = (*g)(f);
- if (buf[i] == '#'){
- c = 0;
- buf[++i] = (*g)(f);
- if (buf[i] == 'x' || buf[i] == 'X'){
- for (j = 0; j < 7; j++){
- buf[++i] = (*g)(f);
- if (!nkf_isxdigit(buf[i])){
- if (buf[i] != ';'){
- c = -1;
- }
- break;
- }
- c <<= 4;
- c |= hex2bin(buf[i]);
- }
- }else{
- for (j = 0; j < 8; j++){
- if (j){
- buf[++i] = (*g)(f);
- }
- if (!nkf_isdigit(buf[i])){
- if (buf[i] != ';'){
- c = -1;
- }
- break;
- }
- c *= 10;
- c += hex2bin(buf[i]);
- }
- }
- }
+ buf[++i] = (*g)(f);
+ if (buf[i] == '#'){
+ c = 0;
+ buf[++i] = (*g)(f);
+ if (buf[i] == 'x' || buf[i] == 'X'){
+ for (j = 0; j < 7; j++){
+ buf[++i] = (*g)(f);
+ if (!nkf_isxdigit(buf[i])){
+ if (buf[i] != ';'){
+ c = -1;
+ }
+ break;
+ }
+ c <<= 4;
+ c |= hex2bin(buf[i]);
+ }
+ }else{
+ for (j = 0; j < 8; j++){
+ if (j){
+ buf[++i] = (*g)(f);
+ }
+ if (!nkf_isdigit(buf[i])){
+ if (buf[i] != ';'){
+ c = -1;
+ }
+ break;
+ }
+ c *= 10;
+ c += hex2bin(buf[i]);
+ }
+ }
+ }
}
if (c != -1){
- return nkf_char_unicode_new(c);
+ return CLASS_UNICODE | c;
}
while (i > 0){
- (*u)(buf[i], f);
- --i;
+ (*u)(buf[i], f);
+ --i;
}
return buf[0];
}
-static nkf_char
-numchar_ungetc(nkf_char c, FILE *f)
+nkf_char numchar_ungetc(nkf_char c, FILE *f)
{
return (*i_nungetc)(c, f);
}
@@ -4253,89 +5060,54 @@ numchar_ungetc(nkf_char c, FILE *f)
#ifdef UNICODE_NORMALIZATION
-static nkf_char
-nfc_getc(FILE *f)
+/* Normalization Form C */
+nkf_char nfc_getc(FILE *f)
{
nkf_char (*g)(FILE *f) = i_nfc_getc;
nkf_char (*u)(nkf_char c ,FILE *f) = i_nfc_ungetc;
- nkf_buf_t *buf = nkf_state->nfc_buf;
- const unsigned char *array;
- int lower=0, upper=NORMALIZATION_TABLE_LENGTH-1;
- nkf_char c = (*g)(f);
-
- if (c == EOF || c > 0xFF || (c & 0xc0) == 0x80) return c;
-
- nkf_buf_push(buf, c);
- do {
- while (lower <= upper) {
- int mid = (lower+upper) / 2;
- int len;
- array = normalization_table[mid].nfd;
- for (len=0; len < NORMALIZATION_TABLE_NFD_LENGTH && array[len]; len++) {
- if (len >= nkf_buf_length(buf)) {
- c = (*g)(f);
- if (c == EOF) {
- len = 0;
- lower = 1, upper = 0;
- break;
- }
- nkf_buf_push(buf, c);
- }
- if (array[len] != nkf_buf_at(buf, len)) {
- if (array[len] < nkf_buf_at(buf, len)) lower = mid + 1;
- else upper = mid - 1;
- len = 0;
+ int i=0, j, k=1, lower, upper;
+ nkf_char buf[9];
+ const nkf_nfchar *array;
+#if 0
+ extern const struct normalization_pair normalization_table[];
+#endif
+
+ buf[i] = (*g)(f);
+ while (k > 0 && ((buf[i] & 0xc0) != 0x80)){
+ lower=0, upper=NORMALIZATION_TABLE_LENGTH-1;
+ while (upper >= lower) {
+ j = (lower+upper) / 2;
+ array = normalization_table[j].nfd;
+ for (k=0; k < NORMALIZATION_TABLE_NFD_LENGTH && array[k]; k++){
+ if (array[k] != buf[k]){
+ array[k] < buf[k] ? (lower = j + 1) : (upper = j - 1);
+ k = 0;
break;
- }
+ } else if (k >= i)
+ buf[++i] = (*g)(f);
}
- if (len > 0) {
- int i;
- array = normalization_table[mid].nfc;
- nkf_buf_clear(buf);
+ if (k > 0){
+ array = normalization_table[j].nfc;
for (i=0; i < NORMALIZATION_TABLE_NFC_LENGTH && array[i]; i++)
- nkf_buf_push(buf, array[i]);
+ buf[i] = (nkf_char)(array[i]);
+ i--;
break;
}
}
- } while (lower <= upper);
-
- while (nkf_buf_length(buf) > 1) (*u)(nkf_buf_pop(buf), f);
- c = nkf_buf_pop(buf);
-
- return c;
+ while (i > 0)
+ (*u)(buf[i--], f);
+ }
+ return buf[0];
}
-static nkf_char
-nfc_ungetc(nkf_char c, FILE *f)
+nkf_char nfc_ungetc(nkf_char c, FILE *f)
{
return (*i_nfc_ungetc)(c, f);
}
#endif /* UNICODE_NORMALIZATION */
-static nkf_char
-base64decode(nkf_char c)
-{
- int i;
- if (c > '@') {
- if (c < '[') {
- i = c - 'A'; /* A..Z 0-25 */
- } else if (c == '_') {
- i = '?' /* 63 */ ; /* _ 63 */
- } else {
- i = c - 'G' /* - 'a' + 26 */ ; /* a..z 26-51 */
- }
- } else if (c > '/') {
- i = c - '0' + '4' /* - '0' + 52 */ ; /* 0..9 52-61 */
- } else if (c == '+' || c == '-') {
- i = '>' /* 62 */ ; /* + and - 62 */
- } else {
- i = '?' /* 63 */ ; /* / 63 */
- }
- return (i);
-}
-
-static nkf_char
+nkf_char
mime_getc(FILE *f)
{
nkf_char c1, c2, c3, c4, cc;
@@ -4345,8 +5117,8 @@ mime_getc(FILE *f)
char *lwsp_buf_new;
nkf_char lwsp_size = 128;
- if (mime_input_state.top != mime_input_state.last) { /* Something is in FIFO */
- return mime_input_buf(mime_input_state.top++);
+ if (mime_top != mime_last) { /* Something is in FIFO */
+ return Fifo(mime_top++);
}
if (mime_decode_mode==1 ||mime_decode_mode==FALSE) {
mime_decode_mode=FALSE;
@@ -4355,193 +5127,211 @@ mime_getc(FILE *f)
}
if (mimebuf_f == FIXED_MIME)
- exit_mode = mime_decode_mode;
+ exit_mode = mime_decode_mode;
else
- exit_mode = FALSE;
+ exit_mode = FALSE;
if (mime_decode_mode == 'Q') {
- if ((c1 = (*i_mgetc)(f)) == EOF) return (EOF);
- restart_mime_q:
- if (c1=='_' && mimebuf_f != FIXED_MIME) return SP;
- if (c1<=SP || DEL<=c1) {
+ if ((c1 = (*i_mgetc)(f)) == EOF) return (EOF);
+restart_mime_q:
+ if (c1=='_' && mimebuf_f != FIXED_MIME) return ' ';
+ if (c1<=' ' || DEL<=c1) {
mime_decode_mode = exit_mode; /* prepare for quit */
return c1;
}
- if (c1!='=' && (c1!='?' || mimebuf_f == FIXED_MIME)) {
+ if (c1!='=' && (c1!='?' || mimebuf_f == FIXED_MIME)) {
return c1;
}
-
- mime_decode_mode = exit_mode; /* prepare for quit */
- if ((c2 = (*i_mgetc)(f)) == EOF) return (EOF);
- if (c1=='?'&&c2=='=' && mimebuf_f != FIXED_MIME) {
- /* end Q encoding */
- input_mode = exit_mode;
+
+ mime_decode_mode = exit_mode; /* prepare for quit */
+ if ((c2 = (*i_mgetc)(f)) == EOF) return (EOF);
+ if (c1=='?'&&c2=='=' && mimebuf_f != FIXED_MIME) {
+ /* end Q encoding */
+ input_mode = exit_mode;
lwsp_count = 0;
- lwsp_buf = nkf_xmalloc((lwsp_size+5)*sizeof(char));
+ lwsp_buf = malloc((lwsp_size+5)*sizeof(char));
+ if (lwsp_buf==NULL) {
+ perror("can't malloc");
+ return -1;
+ }
while ((c1=(*i_getc)(f))!=EOF) {
switch (c1) {
- case LF:
+ case NL:
case CR:
- if (c1==LF) {
- if ((c1=(*i_getc)(f))!=EOF && nkf_isblank(c1)) {
- i_ungetc(SP,f);
+ if (c1==NL) {
+ if ((c1=(*i_getc)(f))!=EOF && (c1==SPACE||c1==TAB)) {
+ i_ungetc(SPACE,f);
continue;
} else {
i_ungetc(c1,f);
}
- c1 = LF;
+ c1 = NL;
} else {
- if ((c1=(*i_getc)(f))!=EOF && c1 == LF) {
- if ((c1=(*i_getc)(f))!=EOF && nkf_isblank(c1)) {
- i_ungetc(SP,f);
+ if ((c1=(*i_getc)(f))!=EOF && c1 == NL) {
+ if ((c1=(*i_getc)(f))!=EOF && (c1==SPACE||c1==TAB)) {
+ i_ungetc(SPACE,f);
continue;
} else {
i_ungetc(c1,f);
}
- i_ungetc(LF,f);
+ i_ungetc(NL,f);
} else {
i_ungetc(c1,f);
}
c1 = CR;
}
break;
- case SP:
+ case SPACE:
case TAB:
lwsp_buf[lwsp_count] = (unsigned char)c1;
if (lwsp_count++>lwsp_size){
lwsp_size <<= 1;
- lwsp_buf_new = nkf_xrealloc(lwsp_buf, (lwsp_size+5)*sizeof(char));
+ lwsp_buf_new = realloc(lwsp_buf, (lwsp_size+5)*sizeof(char));
+ if (lwsp_buf_new==NULL) {
+ free(lwsp_buf);
+ perror("can't realloc");
+ return -1;
+ }
lwsp_buf = lwsp_buf_new;
}
continue;
}
break;
}
- if (lwsp_count > 0 && (c1 != '=' || (lwsp_buf[lwsp_count-1] != SP && lwsp_buf[lwsp_count-1] != TAB))) {
+ if (lwsp_count > 0 && (c1 != '=' || (lwsp_buf[lwsp_count-1] != SPACE && lwsp_buf[lwsp_count-1] != TAB))) {
i_ungetc(c1,f);
for(lwsp_count--;lwsp_count>0;lwsp_count--)
i_ungetc(lwsp_buf[lwsp_count],f);
c1 = lwsp_buf[0];
}
- nkf_xfree(lwsp_buf);
- return c1;
- }
- if (c1=='='&&c2<SP) { /* this is soft wrap */
- while((c1 = (*i_mgetc)(f)) <=SP) {
+ free(lwsp_buf);
+ return c1;
+ }
+ if (c1=='='&&c2<' ') { /* this is soft wrap */
+ while((c1 = (*i_mgetc)(f)) <=' ') {
if ((c1 = (*i_mgetc)(f)) == EOF) return (EOF);
}
- mime_decode_mode = 'Q'; /* still in MIME */
+ mime_decode_mode = 'Q'; /* still in MIME */
goto restart_mime_q;
}
- if (c1=='?') {
- mime_decode_mode = 'Q'; /* still in MIME */
- (*i_mungetc)(c2,f);
- return c1;
- }
- if ((c3 = (*i_mgetc)(f)) == EOF) return (EOF);
- if (c2<=SP) return c2;
- mime_decode_mode = 'Q'; /* still in MIME */
- return ((hex2bin(c2)<<4) + hex2bin(c3));
+ if (c1=='?') {
+ mime_decode_mode = 'Q'; /* still in MIME */
+ (*i_mungetc)(c2,f);
+ return c1;
+ }
+ if ((c3 = (*i_mgetc)(f)) == EOF) return (EOF);
+ if (c2<=' ') return c2;
+ mime_decode_mode = 'Q'; /* still in MIME */
+ return ((hex2bin(c2)<<4) + hex2bin(c3));
}
if (mime_decode_mode != 'B') {
- mime_decode_mode = FALSE;
- return (*i_mgetc)(f);
+ mime_decode_mode = FALSE;
+ return (*i_mgetc)(f);
}
/* Base64 encoding */
- /*
- MIME allows line break in the middle of
- Base64, but we are very pessimistic in decoding
- in unbuf mode because MIME encoded code may broken by
- less or editor's control sequence (such as ESC-[-K in unbuffered
- mode. ignore incomplete MIME.
- */
+ /*
+ MIME allows line break in the middle of
+ Base64, but we are very pessimistic in decoding
+ in unbuf mode because MIME encoded code may broken by
+ less or editor's control sequence (such as ESC-[-K in unbuffered
+ mode. ignore incomplete MIME.
+ */
mode = mime_decode_mode;
mime_decode_mode = exit_mode; /* prepare for quit */
- while ((c1 = (*i_mgetc)(f))<=SP) {
- if (c1==EOF)
- return (EOF);
+ while ((c1 = (*i_mgetc)(f))<=' ') {
+ if (c1==EOF)
+ return (EOF);
}
- mime_c2_retry:
- if ((c2 = (*i_mgetc)(f))<=SP) {
- if (c2==EOF)
- return (EOF);
+mime_c2_retry:
+ if ((c2 = (*i_mgetc)(f))<=' ') {
+ if (c2==EOF)
+ return (EOF);
if (mime_f != STRICT_MIME) goto mime_c2_retry;
- if (mimebuf_f!=FIXED_MIME) input_mode = ASCII;
- return c2;
+ if (mimebuf_f!=FIXED_MIME) input_mode = ASCII;
+ return c2;
}
if ((c1 == '?') && (c2 == '=')) {
- input_mode = ASCII;
+ input_mode = ASCII;
lwsp_count = 0;
- lwsp_buf = nkf_xmalloc((lwsp_size+5)*sizeof(char));
+ lwsp_buf = malloc((lwsp_size+5)*sizeof(char));
+ if (lwsp_buf==NULL) {
+ perror("can't malloc");
+ return -1;
+ }
while ((c1=(*i_getc)(f))!=EOF) {
switch (c1) {
- case LF:
+ case NL:
case CR:
- if (c1==LF) {
- if ((c1=(*i_getc)(f))!=EOF && nkf_isblank(c1)) {
- i_ungetc(SP,f);
+ if (c1==NL) {
+ if ((c1=(*i_getc)(f))!=EOF && (c1==SPACE||c1==TAB)) {
+ i_ungetc(SPACE,f);
continue;
} else {
i_ungetc(c1,f);
}
- c1 = LF;
+ c1 = NL;
} else {
if ((c1=(*i_getc)(f))!=EOF) {
- if (c1==SP) {
- i_ungetc(SP,f);
+ if (c1==SPACE) {
+ i_ungetc(SPACE,f);
continue;
- } else if ((c1=(*i_getc)(f))!=EOF && nkf_isblank(c1)) {
- i_ungetc(SP,f);
+ } else if ((c1=(*i_getc)(f))!=EOF && (c1==SPACE||c1==TAB)) {
+ i_ungetc(SPACE,f);
continue;
} else {
i_ungetc(c1,f);
}
- i_ungetc(LF,f);
+ i_ungetc(NL,f);
} else {
i_ungetc(c1,f);
}
c1 = CR;
}
break;
- case SP:
+ case SPACE:
case TAB:
lwsp_buf[lwsp_count] = (unsigned char)c1;
if (lwsp_count++>lwsp_size){
lwsp_size <<= 1;
- lwsp_buf_new = nkf_xrealloc(lwsp_buf, (lwsp_size+5)*sizeof(char));
+ lwsp_buf_new = realloc(lwsp_buf, (lwsp_size+5)*sizeof(char));
+ if (lwsp_buf_new==NULL) {
+ free(lwsp_buf);
+ perror("can't realloc");
+ return -1;
+ }
lwsp_buf = lwsp_buf_new;
}
continue;
}
break;
}
- if (lwsp_count > 0 && (c1 != '=' || (lwsp_buf[lwsp_count-1] != SP && lwsp_buf[lwsp_count-1] != TAB))) {
+ if (lwsp_count > 0 && (c1 != '=' || (lwsp_buf[lwsp_count-1] != SPACE && lwsp_buf[lwsp_count-1] != TAB))) {
i_ungetc(c1,f);
for(lwsp_count--;lwsp_count>0;lwsp_count--)
i_ungetc(lwsp_buf[lwsp_count],f);
c1 = lwsp_buf[0];
}
- nkf_xfree(lwsp_buf);
- return c1;
+ free(lwsp_buf);
+ return c1;
}
- mime_c3_retry:
- if ((c3 = (*i_mgetc)(f))<=SP) {
- if (c3==EOF)
- return (EOF);
+mime_c3_retry:
+ if ((c3 = (*i_mgetc)(f))<=' ') {
+ if (c3==EOF)
+ return (EOF);
if (mime_f != STRICT_MIME) goto mime_c3_retry;
- if (mimebuf_f!=FIXED_MIME) input_mode = ASCII;
- return c3;
+ if (mimebuf_f!=FIXED_MIME) input_mode = ASCII;
+ return c3;
}
- mime_c4_retry:
- if ((c4 = (*i_mgetc)(f))<=SP) {
- if (c4==EOF)
- return (EOF);
+mime_c4_retry:
+ if ((c4 = (*i_mgetc)(f))<=' ') {
+ if (c4==EOF)
+ return (EOF);
if (mime_f != STRICT_MIME) goto mime_c4_retry;
- if (mimebuf_f!=FIXED_MIME) input_mode = ASCII;
- return c4;
+ if (mimebuf_f!=FIXED_MIME) input_mode = ASCII;
+ return c4;
}
mime_decode_mode = mode; /* still in MIME sigh... */
@@ -4554,112 +5344,147 @@ mime_getc(FILE *f)
t4 = 0x3f & base64decode(c4);
cc = ((t1 << 2) & 0x0fc) | ((t2 >> 4) & 0x03);
if (c2 != '=') {
- mime_input_buf(mime_input_state.last++) = (unsigned char)cc;
- cc = ((t2 << 4) & 0x0f0) | ((t3 >> 2) & 0x0f);
- if (c3 != '=') {
- mime_input_buf(mime_input_state.last++) = (unsigned char)cc;
- cc = ((t3 << 6) & 0x0c0) | (t4 & 0x3f);
- if (c4 != '=')
- mime_input_buf(mime_input_state.last++) = (unsigned char)cc;
+ Fifo(mime_last++) = (unsigned char)cc;
+ cc = ((t2 << 4) & 0x0f0) | ((t3 >> 2) & 0x0f);
+ if (c3 != '=') {
+ Fifo(mime_last++) = (unsigned char)cc;
+ cc = ((t3 << 6) & 0x0c0) | (t4 & 0x3f);
+ if (c4 != '=')
+ Fifo(mime_last++) = (unsigned char)cc;
+ }
+ } else {
+ return c1;
+ }
+ return Fifo(mime_top++);
+}
+
+nkf_char mime_ungetc(nkf_char c, FILE *f)
+{
+ Fifo(--mime_top) = (unsigned char)c;
+ return c;
+}
+
+nkf_char mime_integrity(FILE *f, const unsigned char *p)
+{
+ nkf_char c,d;
+ unsigned int q;
+ /* In buffered mode, read until =? or NL or buffer full
+ */
+ mime_input = mime_top;
+ mime_last = mime_top;
+
+ while(*p) Fifo(mime_input++) = *p++;
+ d = 0;
+ q = mime_input;
+ while((c=(*i_getc)(f))!=EOF) {
+ if (((mime_input-mime_top)&MIME_BUF_MASK)==0) {
+ break; /* buffer full */
+ }
+ if (c=='=' && d=='?') {
+ /* checked. skip header, start decode */
+ Fifo(mime_input++) = (unsigned char)c;
+ /* mime_last_input = mime_input; */
+ mime_input = q;
+ switch_mime_getc();
+ return 1;
+ }
+ if (!( (c=='+'||c=='/'|| c=='=' || c=='?' || is_alnum(c))))
+ break;
+ /* Should we check length mod 4? */
+ Fifo(mime_input++) = (unsigned char)c;
+ d=c;
+ }
+ /* In case of Incomplete MIME, no MIME decode */
+ Fifo(mime_input++) = (unsigned char)c;
+ mime_last = mime_input; /* point undecoded buffer */
+ mime_decode_mode = 1; /* no decode on Fifo last in mime_getc */
+ switch_mime_getc(); /* anyway we need buffered getc */
+ return 1;
+}
+
+nkf_char base64decode(nkf_char c)
+{
+ int i;
+ if (c > '@') {
+ if (c < '[') {
+ i = c - 'A'; /* A..Z 0-25 */
+ } else {
+ i = c - 'G' /* - 'a' + 26 */ ; /* a..z 26-51 */
}
+ } else if (c > '/') {
+ i = c - '0' + '4' /* - '0' + 52 */ ; /* 0..9 52-61 */
+ } else if (c == '+') {
+ i = '>' /* 62 */ ; /* + 62 */
} else {
- return c1;
+ i = '?' /* 63 */ ; /* / 63 */
}
- return mime_input_buf(mime_input_state.top++);
+ return (i);
}
static const char basis_64[] =
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
-
-#define MIMEOUT_BUF_LENGTH 74
-static struct {
- char buf[MIMEOUT_BUF_LENGTH+1];
- int count;
-} mimeout_state;
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
-/*nkf_char mime_lastchar2, mime_lastchar1;*/
+static nkf_char b64c;
+#define MIMEOUT_BUF_LENGTH (60)
+char mimeout_buf[MIMEOUT_BUF_LENGTH+1];
+int mimeout_buf_count = 0;
+int mimeout_preserve_space = 0;
+#define itoh4(c) (c>=10?c+'A'-10:c+'0')
-static void
-open_mime(nkf_char mode)
+void open_mime(nkf_char mode)
{
const unsigned char *p;
int i;
int j;
p = mime_pattern[0];
- for(i=0;mime_pattern[i];i++) {
+ for(i=0;mime_encode[i];i++) {
if (mode == mime_encode[i]) {
p = mime_pattern[i];
break;
}
}
mimeout_mode = mime_encode_method[i];
+
i = 0;
if (base64_count>45) {
- if (mimeout_state.count>0 && nkf_isblank(mimeout_state.buf[i])){
- (*o_mputc)(mimeout_state.buf[i]);
+ if (mimeout_buf_count>0 && nkf_isblank(mimeout_buf[i])){
+ (*o_mputc)(mimeout_buf[i]);
i++;
}
- PUT_NEWLINE((*o_mputc));
- (*o_mputc)(SP);
+ (*o_mputc)(NL);
+ (*o_mputc)(SPACE);
base64_count = 1;
- if (mimeout_state.count>0 && nkf_isspace(mimeout_state.buf[i])) {
+ if (!mimeout_preserve_space && mimeout_buf_count>0
+ && (mimeout_buf[i]==SPACE || mimeout_buf[i]==TAB
+ || mimeout_buf[i]==CR || mimeout_buf[i]==NL )) {
i++;
}
}
- for (;i<mimeout_state.count;i++) {
- if (nkf_isspace(mimeout_state.buf[i])) {
- (*o_mputc)(mimeout_state.buf[i]);
- base64_count ++;
- } else {
- break;
+ if (!mimeout_preserve_space) {
+ for (;i<mimeout_buf_count;i++) {
+ if (mimeout_buf[i]==SPACE || mimeout_buf[i]==TAB
+ || mimeout_buf[i]==CR || mimeout_buf[i]==NL ) {
+ (*o_mputc)(mimeout_buf[i]);
+ base64_count ++;
+ } else {
+ break;
+ }
}
}
+ mimeout_preserve_space = FALSE;
+
while(*p) {
- (*o_mputc)(*p++);
- base64_count ++;
+ (*o_mputc)(*p++);
+ base64_count ++;
}
- j = mimeout_state.count;
- mimeout_state.count = 0;
+ j = mimeout_buf_count;
+ mimeout_buf_count = 0;
for (;i<j;i++) {
- mime_putc(mimeout_state.buf[i]);
+ mime_putc(mimeout_buf[i]);
}
}
-static void
-mime_prechar(nkf_char c2, nkf_char c1)
-{
- if (mimeout_mode > 0){
- if (c2 == EOF){
- if (base64_count + mimeout_state.count/3*4> 73){
- (*o_base64conv)(EOF,0);
- OCONV_NEWLINE((*o_base64conv));
- (*o_base64conv)(0,SP);
- base64_count = 1;
- }
- } else {
- if (base64_count + mimeout_state.count/3*4> 66) {
- (*o_base64conv)(EOF,0);
- OCONV_NEWLINE((*o_base64conv));
- (*o_base64conv)(0,SP);
- base64_count = 1;
- mimeout_mode = -1;
- }
- }
- } else if (c2) {
- if (c2 != EOF && base64_count + mimeout_state.count/3*4> 60) {
- mimeout_mode = (output_mode==ASCII ||output_mode == ISO_8859_1) ? 'Q' : 'B';
- open_mime(output_mode);
- (*o_base64conv)(EOF,0);
- OCONV_NEWLINE((*o_base64conv));
- (*o_base64conv)(0,SP);
- base64_count = 1;
- mimeout_mode = -1;
- }
- }
-}
-
-static void
-close_mime(void)
+void close_mime(void)
{
(*o_mputc)('?');
(*o_mputc)('=');
@@ -4667,340 +5492,290 @@ close_mime(void)
mimeout_mode = 0;
}
-static void
-eof_mime(void)
+void eof_mime(void)
{
switch(mimeout_mode) {
case 'Q':
case 'B':
break;
case 2:
- (*o_mputc)(basis_64[((nkf_state->mimeout_state & 0x3)<< 4)]);
+ (*o_mputc)(basis_64[((b64c & 0x3)<< 4)]);
(*o_mputc)('=');
(*o_mputc)('=');
base64_count += 3;
break;
case 1:
- (*o_mputc)(basis_64[((nkf_state->mimeout_state & 0xF) << 2)]);
+ (*o_mputc)(basis_64[((b64c & 0xF) << 2)]);
(*o_mputc)('=');
base64_count += 2;
break;
}
- if (mimeout_mode > 0) {
+ if (mimeout_mode) {
if (mimeout_f!=FIXED_MIME) {
- close_mime();
+ close_mime();
} else if (mimeout_mode != 'Q')
mimeout_mode = 'B';
}
}
-static void
-mimeout_addchar(nkf_char c)
+void mimeout_addchar(nkf_char c)
{
switch(mimeout_mode) {
case 'Q':
- if (c==CR||c==LF) {
+ if (c==CR||c==NL) {
(*o_mputc)(c);
base64_count = 0;
} else if(!nkf_isalnum(c)) {
(*o_mputc)('=');
- (*o_mputc)(bin2hex(((c>>4)&0xf)));
- (*o_mputc)(bin2hex((c&0xf)));
+ (*o_mputc)(itoh4(((c>>4)&0xf)));
+ (*o_mputc)(itoh4((c&0xf)));
base64_count += 3;
} else {
(*o_mputc)(c);
base64_count++;
}
- break;
+ break;
case 'B':
- nkf_state->mimeout_state=c;
- (*o_mputc)(basis_64[c>>2]);
- mimeout_mode=2;
- base64_count ++;
- break;
+ b64c=c;
+ (*o_mputc)(basis_64[c>>2]);
+ mimeout_mode=2;
+ base64_count ++;
+ break;
case 2:
- (*o_mputc)(basis_64[((nkf_state->mimeout_state & 0x3)<< 4) | ((c & 0xF0) >> 4)]);
- nkf_state->mimeout_state=c;
- mimeout_mode=1;
- base64_count ++;
- break;
+ (*o_mputc)(basis_64[((b64c & 0x3)<< 4) | ((c & 0xF0) >> 4)]);
+ b64c=c;
+ mimeout_mode=1;
+ base64_count ++;
+ break;
case 1:
- (*o_mputc)(basis_64[((nkf_state->mimeout_state & 0xF) << 2) | ((c & 0xC0) >>6)]);
- (*o_mputc)(basis_64[c & 0x3F]);
- mimeout_mode='B';
- base64_count += 2;
- break;
+ (*o_mputc)(basis_64[((b64c & 0xF) << 2) | ((c & 0xC0) >>6)]);
+ (*o_mputc)(basis_64[c & 0x3F]);
+ mimeout_mode='B';
+ base64_count += 2;
+ break;
default:
(*o_mputc)(c);
base64_count++;
- break;
+ break;
}
}
-static void
-mime_putc(nkf_char c)
+nkf_char mime_lastchar2, mime_lastchar1;
+
+void mime_prechar(nkf_char c2, nkf_char c1)
+{
+ if (mimeout_mode){
+ if (c2){
+ if (base64_count + mimeout_buf_count/3*4> 66){
+ (*o_base64conv)(EOF,0);
+ (*o_base64conv)(0,NL);
+ (*o_base64conv)(0,SPACE);
+ }
+ }/*else if (mime_lastchar2){
+ if (c1 <=DEL && !nkf_isspace(c1)){
+ (*o_base64conv)(0,SPACE);
+ }
+ }*/
+ }/*else{
+ if (c2 && mime_lastchar2 == 0
+ && mime_lastchar1 && !nkf_isspace(mime_lastchar1)){
+ (*o_base64conv)(0,SPACE);
+ }
+ }*/
+ mime_lastchar2 = c2;
+ mime_lastchar1 = c1;
+}
+
+void mime_putc(nkf_char c)
{
int i, j;
nkf_char lastchar;
if (mimeout_f == FIXED_MIME){
- if (mimeout_mode == 'Q'){
- if (base64_count > 71){
- if (c!=CR && c!=LF) {
- (*o_mputc)('=');
- PUT_NEWLINE((*o_mputc));
- }
- base64_count = 0;
- }
- }else{
- if (base64_count > 71){
- eof_mime();
- PUT_NEWLINE((*o_mputc));
- base64_count = 0;
- }
- if (c == EOF) { /* c==EOF */
- eof_mime();
- }
- }
- if (c != EOF) { /* c==EOF */
- mimeout_addchar(c);
- }
- return;
- }
-
+ if (mimeout_mode == 'Q'){
+ if (base64_count > 71){
+ if (c!=CR && c!=NL) {
+ (*o_mputc)('=');
+ (*o_mputc)(NL);
+ }
+ base64_count = 0;
+ }
+ }else{
+ if (base64_count > 71){
+ eof_mime();
+ (*o_mputc)(NL);
+ base64_count = 0;
+ }
+ if (c == EOF) { /* c==EOF */
+ eof_mime();
+ }
+ }
+ if (c != EOF) { /* c==EOF */
+ mimeout_addchar(c);
+ }
+ return;
+ }
+
/* mimeout_f != FIXED_MIME */
if (c == EOF) { /* c==EOF */
- if (mimeout_mode == -1 && mimeout_state.count > 1) open_mime(output_mode);
- j = mimeout_state.count;
- mimeout_state.count = 0;
+ j = mimeout_buf_count;
+ mimeout_buf_count = 0;
i = 0;
- if (mimeout_mode > 0) {
- if (!nkf_isblank(mimeout_state.buf[j-1])) {
- for (;i<j;i++) {
- if (nkf_isspace(mimeout_state.buf[i]) && base64_count < 71){
- break;
- }
- mimeout_addchar(mimeout_state.buf[i]);
- }
- eof_mime();
- for (;i<j;i++) {
- mimeout_addchar(mimeout_state.buf[i]);
- }
- } else {
- for (;i<j;i++) {
- mimeout_addchar(mimeout_state.buf[i]);
+ if (mimeout_mode) {
+ for (;i<j;i++) {
+ if (nkf_isspace(mimeout_buf[i]) && base64_count < 71){
+ break;
}
- eof_mime();
+ mimeout_addchar(mimeout_buf[i]);
+ }
+ eof_mime();
+ for (;i<j;i++) {
+ mimeout_addchar(mimeout_buf[i]);
}
} else {
for (;i<j;i++) {
- mimeout_addchar(mimeout_state.buf[i]);
+ mimeout_addchar(mimeout_buf[i]);
}
}
- return;
- }
-
- if (mimeout_state.count > 0){
- lastchar = mimeout_state.buf[mimeout_state.count - 1];
- }else{
- lastchar = -1;
+ return;
}
if (mimeout_mode=='Q') {
- if (c <= DEL && (output_mode==ASCII ||output_mode == ISO_8859_1)) {
- if (c == CR || c == LF) {
- close_mime();
- (*o_mputc)(c);
- base64_count = 0;
- return;
- } else if (c <= SP) {
- close_mime();
- if (base64_count > 70) {
- PUT_NEWLINE((*o_mputc));
- base64_count = 0;
- }
- if (!nkf_isblank(c)) {
- (*o_mputc)(SP);
- base64_count++;
- }
- } else {
- if (base64_count > 70) {
- close_mime();
- PUT_NEWLINE((*o_mputc));
- (*o_mputc)(SP);
- base64_count = 1;
- open_mime(output_mode);
- }
- if (!nkf_noescape_mime(c)) {
- mimeout_addchar(c);
- return;
- }
- }
- (*o_mputc)(c);
- base64_count++;
- }
- return;
- }
-
- if (mimeout_mode <= 0) {
- if (c <= DEL && (output_mode==ASCII ||output_mode == ISO_8859_1)) {
- if (nkf_isspace(c)) {
- int flag = 0;
- if (mimeout_mode == -1) {
- flag = 1;
- }
- if (c==CR || c==LF) {
- if (flag) {
- open_mime(output_mode);
- output_mode = 0;
- } else {
- base64_count = 0;
- }
- }
- for (i=0;i<mimeout_state.count;i++) {
- (*o_mputc)(mimeout_state.buf[i]);
- if (mimeout_state.buf[i] == CR || mimeout_state.buf[i] == LF){
- base64_count = 0;
- }else{
- base64_count++;
- }
- }
- if (flag) {
- eof_mime();
- base64_count = 0;
- mimeout_mode = 0;
- }
- mimeout_state.buf[0] = (char)c;
- mimeout_state.count = 1;
- }else{
- if (base64_count > 1
- && base64_count + mimeout_state.count > 76
- && mimeout_state.buf[0] != CR && mimeout_state.buf[0] != LF){
- static const char *str = "boundary=\"";
- static int len = 10;
- i = 0;
-
- for (; i < mimeout_state.count - len; ++i) {
- if (!strncmp(mimeout_state.buf+i, str, len)) {
- i += len - 2;
- break;
- }
- }
-
- if (i == 0 || i == mimeout_state.count - len) {
- PUT_NEWLINE((*o_mputc));
- base64_count = 0;
- if (!nkf_isspace(mimeout_state.buf[0])){
- (*o_mputc)(SP);
- base64_count++;
- }
- }
- else {
- int j;
- for (j = 0; j <= i; ++j) {
- (*o_mputc)(mimeout_state.buf[j]);
- }
- PUT_NEWLINE((*o_mputc));
- base64_count = 1;
- for (; j <= mimeout_state.count; ++j) {
- mimeout_state.buf[j - i] = mimeout_state.buf[j];
- }
- mimeout_state.count -= i;
- }
- }
- mimeout_state.buf[mimeout_state.count++] = (char)c;
- if (mimeout_state.count>MIMEOUT_BUF_LENGTH) {
- open_mime(output_mode);
- }
- }
- return;
- }else{
- if (lastchar==CR || lastchar == LF){
- for (i=0;i<mimeout_state.count;i++) {
- (*o_mputc)(mimeout_state.buf[i]);
- }
- base64_count = 0;
- mimeout_state.count = 0;
- }
- if (lastchar==SP) {
- for (i=0;i<mimeout_state.count-1;i++) {
- (*o_mputc)(mimeout_state.buf[i]);
- base64_count++;
- }
- mimeout_state.buf[0] = SP;
- mimeout_state.count = 1;
- }
- open_mime(output_mode);
- }
+ if (c <= DEL && (output_mode==ASCII ||output_mode == ISO8859_1 ) ) {
+ if (c <= SPACE) {
+ close_mime();
+ (*o_mputc)(SPACE);
+ base64_count++;
+ }
+ (*o_mputc)(c);
+ base64_count++;
+ }
+ return;
+ }
+
+ if (mimeout_buf_count > 0){
+ lastchar = mimeout_buf[mimeout_buf_count - 1];
}else{
- /* mimeout_mode == 'B', 1, 2 */
- if ( c<=DEL && (output_mode==ASCII ||output_mode == ISO_8859_1)) {
- if (lastchar == CR || lastchar == LF){
- if (nkf_isblank(c)) {
- for (i=0;i<mimeout_state.count;i++) {
- mimeout_addchar(mimeout_state.buf[i]);
- }
- mimeout_state.count = 0;
- } else if (SP<c && c<DEL) {
- eof_mime();
- for (i=0;i<mimeout_state.count;i++) {
- (*o_mputc)(mimeout_state.buf[i]);
- }
- base64_count = 0;
- mimeout_state.count = 0;
- }
- mimeout_state.buf[mimeout_state.count++] = (char)c;
- return;
- }
- if (nkf_isspace(c)) {
- for (i=0;i<mimeout_state.count;i++) {
- if (SP<mimeout_state.buf[i] && mimeout_state.buf[i]<DEL) {
- eof_mime();
- for (i=0;i<mimeout_state.count;i++) {
- (*o_mputc)(mimeout_state.buf[i]);
- base64_count++;
- }
- mimeout_state.count = 0;
- }
- }
- mimeout_state.buf[mimeout_state.count++] = (char)c;
- if (mimeout_state.count>MIMEOUT_BUF_LENGTH) {
- eof_mime();
- for (i=0;i<mimeout_state.count;i++) {
- (*o_mputc)(mimeout_state.buf[i]);
- base64_count++;
- }
- mimeout_state.count = 0;
- }
- return;
- }
- if (mimeout_state.count>0 && SP<c && c!='=') {
- mimeout_state.buf[mimeout_state.count++] = (char)c;
- if (mimeout_state.count>MIMEOUT_BUF_LENGTH) {
- j = mimeout_state.count;
- mimeout_state.count = 0;
- for (i=0;i<j;i++) {
- mimeout_addchar(mimeout_state.buf[i]);
- }
- }
- return;
- }
- }
- }
- if (mimeout_state.count>0) {
- j = mimeout_state.count;
- mimeout_state.count = 0;
+ lastchar = -1;
+ }
+
+ if (!mimeout_mode) {
+ if (c <= DEL && (output_mode==ASCII ||output_mode == ISO8859_1)) {
+ if (nkf_isspace(c)) {
+ if (c==CR || c==NL) {
+ base64_count=0;
+ }
+ for (i=0;i<mimeout_buf_count;i++) {
+ (*o_mputc)(mimeout_buf[i]);
+ if (mimeout_buf[i] == CR || mimeout_buf[i] == NL){
+ base64_count = 0;
+ }else{
+ base64_count++;
+ }
+ }
+ mimeout_buf[0] = (char)c;
+ mimeout_buf_count = 1;
+ }else{
+ if (base64_count > 1
+ && base64_count + mimeout_buf_count > 76){
+ (*o_mputc)(NL);
+ base64_count = 0;
+ if (!nkf_isspace(mimeout_buf[0])){
+ (*o_mputc)(SPACE);
+ base64_count++;
+ }
+ }
+ mimeout_buf[mimeout_buf_count++] = (char)c;
+ if (mimeout_buf_count>MIMEOUT_BUF_LENGTH) {
+ open_mime(output_mode);
+ }
+ }
+ return;
+ }else{
+ if (lastchar==CR || lastchar == NL){
+ for (i=0;i<mimeout_buf_count;i++) {
+ (*o_mputc)(mimeout_buf[i]);
+ }
+ base64_count = 0;
+ mimeout_buf_count = 0;
+ }
+ if (lastchar==SPACE) {
+ for (i=0;i<mimeout_buf_count-1;i++) {
+ (*o_mputc)(mimeout_buf[i]);
+ base64_count++;
+ }
+ mimeout_buf[0] = SPACE;
+ mimeout_buf_count = 1;
+ }
+ open_mime(output_mode);
+ }
+ }else{
+ /* mimeout_mode == 'B', 1, 2 */
+ if ( c<=DEL && (output_mode==ASCII ||output_mode == ISO8859_1 ) ) {
+ if (lastchar == CR || lastchar == NL){
+ if (nkf_isblank(c)) {
+ for (i=0;i<mimeout_buf_count;i++) {
+ mimeout_addchar(mimeout_buf[i]);
+ }
+ mimeout_buf_count = 0;
+ } else if (SPACE<c && c<DEL) {
+ eof_mime();
+ for (i=0;i<mimeout_buf_count;i++) {
+ (*o_mputc)(mimeout_buf[i]);
+ }
+ base64_count = 0;
+ mimeout_buf_count = 0;
+ }
+ }
+ if (c==SPACE || c==TAB || c==CR || c==NL) {
+ for (i=0;i<mimeout_buf_count;i++) {
+ if (SPACE<mimeout_buf[i] && mimeout_buf[i]<DEL) {
+ eof_mime();
+ for (i=0;i<mimeout_buf_count;i++) {
+ (*o_mputc)(mimeout_buf[i]);
+ base64_count++;
+ }
+ mimeout_buf_count = 0;
+ }
+ }
+ mimeout_buf[mimeout_buf_count++] = (char)c;
+ if (mimeout_buf_count>MIMEOUT_BUF_LENGTH) {
+ eof_mime();
+ for (i=0;i<mimeout_buf_count;i++) {
+ (*o_mputc)(mimeout_buf[i]);
+ base64_count++;
+ }
+ mimeout_buf_count = 0;
+ }
+ return;
+ }
+ if (mimeout_buf_count>0 && SPACE<c && c!='=') {
+ mimeout_buf[mimeout_buf_count++] = (char)c;
+ if (mimeout_buf_count>MIMEOUT_BUF_LENGTH) {
+ j = mimeout_buf_count;
+ mimeout_buf_count = 0;
+ for (i=0;i<j;i++) {
+ mimeout_addchar(mimeout_buf[i]);
+ }
+ }
+ return;
+ }
+ }
+ }
+ if (mimeout_buf_count>0) {
+ j = mimeout_buf_count;
+ mimeout_buf_count = 0;
for (i=0;i<j;i++) {
- if (mimeout_state.buf[i]==CR || mimeout_state.buf[i]==LF)
+ if (mimeout_buf[i]==CR || mimeout_buf[i]==NL)
break;
- mimeout_addchar(mimeout_state.buf[i]);
+ mimeout_addchar(mimeout_buf[i]);
}
if (i<j) {
eof_mime();
base64_count=0;
for (;i<j;i++) {
- (*o_mputc)(mimeout_state.buf[i]);
+ (*o_mputc)(mimeout_buf[i]);
}
open_mime(output_mode);
}
@@ -5008,112 +5783,15 @@ mime_putc(nkf_char c)
mimeout_addchar(c);
}
-static void
-base64_conv(nkf_char c2, nkf_char c1)
-{
- mime_prechar(c2, c1);
- (*o_base64conv)(c2,c1);
-}
-
-#ifdef HAVE_ICONV_H
-typedef struct nkf_iconv_t {
- iconv_t cd;
- char *input_buffer;
- size_t input_buffer_size;
- char *output_buffer;
- size_t output_buffer_size;
-}
-
-static nkf_iconv_t
-nkf_iconv_new(char *tocode, char *fromcode)
-{
- nkf_iconv_t converter;
-
- converter->input_buffer_size = IOBUF_SIZE;
- converter->input_buffer = nkf_xmalloc(converter->input_buffer_size);
- converter->output_buffer_size = IOBUF_SIZE * 2;
- converter->output_buffer = nkf_xmalloc(converter->output_buffer_size);
- converter->cd = iconv_open(tocode, fromcode);
- if (converter->cd == (iconv_t)-1)
- {
- switch (errno) {
- case EINVAL:
- perror(fprintf("iconv doesn't support %s to %s conversion.", fromcode, tocode));
- return -1;
- default:
- perror("can't iconv_open");
- }
- }
-}
-
-static size_t
-nkf_iconv_convert(nkf_iconv_t *converter, FILE *input)
-{
- size_t invalid = (size_t)0;
- char *input_buffer = converter->input_buffer;
- size_t input_length = (size_t)0;
- char *output_buffer = converter->output_buffer;
- size_t output_length = converter->output_buffer_size;
- int c;
-
- do {
- if (c != EOF) {
- while ((c = (*i_getc)(f)) != EOF) {
- input_buffer[input_length++] = c;
- if (input_length < converter->input_buffer_size) break;
- }
- }
-
- size_t ret = iconv(converter->cd, &input_buffer, &input_length, &output_buffer, &output_length);
- while (output_length-- > 0) {
- (*o_putc)(output_buffer[converter->output_buffer_size-output_length]);
- }
- if (ret == (size_t) - 1) {
- switch (errno) {
- case EINVAL:
- if (input_buffer != converter->input_buffer)
- memmove(converter->input_buffer, input_buffer, input_length);
- break;
- case E2BIG:
- converter->output_buffer_size *= 2;
- output_buffer = realloc(converter->outbuf, converter->output_buffer_size);
- if (output_buffer == NULL) {
- perror("can't realloc");
- return -1;
- }
- converter->output_buffer = output_buffer;
- break;
- default:
- perror("can't iconv");
- return -1;
- }
- } else {
- invalid += ret;
- }
- } while (1);
-
- return invalid;
-}
-
-
-static void
-nkf_iconv_close(nkf_iconv_t *convert)
-{
- nkf_xfree(converter->inbuf);
- nkf_xfree(converter->outbuf);
- iconv_close(converter->cd);
-}
-#endif
-
-static void
-reinit(void)
+#if defined(PERL_XS) || defined(WIN32DLL)
+void reinit(void)
{
{
- struct input_code *p = input_code_list;
- while (p->name){
- status_reinit(p++);
- }
+ struct input_code *p = input_code_list;
+ while (p->name){
+ status_reinit(p++);
+ }
}
unbuf_f = FALSE;
estab_f = FALSE;
@@ -5121,14 +5799,19 @@ reinit(void)
binmode_f = TRUE;
rot_f = FALSE;
hira_f = FALSE;
+ input_f = FALSE;
alpha_f = FALSE;
- mime_f = MIME_DECODE_DEFAULT;
+ mime_f = STRICT_MIME;
mime_decode_f = FALSE;
mimebuf_f = FALSE;
broken_f = FALSE;
iso8859_f = FALSE;
mimeout_f = FALSE;
- x0201_f = X0201_DEFAULT;
+#if defined(MSDOS) || defined(__OS2__)
+ x0201_f = TRUE;
+#else
+ x0201_f = NO_X0201;
+#endif
iso2022jp_f = FALSE;
#if defined(UTF8_INPUT_ENABLE) || defined(UTF8_OUTPUT_ENABLE)
ms_ucs_map_f = UCS_MAP_ASCII;
@@ -5156,7 +5839,9 @@ reinit(void)
noout_f = FALSE;
debug_f = FALSE;
#endif
- guess_f = 0;
+ guess_f = FALSE;
+ is_inputcode_mixed = FALSE;
+ is_inputcode_set = FALSE;
#ifdef EXEC_IO
exec_f = 0;
#endif
@@ -5169,13 +5854,13 @@ reinit(void)
x0213_f = FALSE;
#endif
{
- int i;
- for (i = 0; i < 256; i++){
- prefix_table[i] = 0;
- }
+ int i;
+ for (i = 0; i < 256; i++){
+ prefix_table[i] = 0;
+ }
}
hold_count = 0;
- mimeout_state.count = 0;
+ mimeout_buf_count = 0;
mimeout_mode = 0;
base64_count = 0;
f_line = 0;
@@ -5186,9 +5871,11 @@ reinit(void)
kanji_intro = DEFAULT_J;
ascii_intro = DEFAULT_R;
fold_margin = FOLD_MARGIN;
+ output_conv = DEFAULT_CONV;
+ oconv = DEFAULT_CONV;
o_zconv = no_connection;
o_fconv = no_connection;
- o_eol_conv = no_connection;
+ o_crconv = no_connection;
o_rot_conv = no_connection;
o_hira_conv = no_connection;
o_base64conv = no_connection;
@@ -5205,1435 +5892,149 @@ reinit(void)
i_mungetc_buf = std_ungetc;
output_mode = ASCII;
input_mode = ASCII;
+ shift_mode = FALSE;
mime_decode_mode = FALSE;
file_out_f = FALSE;
- eolmode_f = 0;
- input_eol = 0;
- prev_cr = 0;
+ crmode_f = 0;
option_mode = 0;
+ broken_counter = 0;
+ broken_last = 0;
z_prev2=0,z_prev1=0;
#ifdef CHECK_OPTION
iconv_for_check = 0;
#endif
- input_codename = NULL;
- input_encoding = NULL;
- output_encoding = NULL;
- nkf_state_init();
+ input_codename = "";
#ifdef WIN32DLL
reinitdll();
#endif /*WIN32DLL*/
}
-
-static int
-module_connection(void)
-{
- if (input_encoding) set_input_encoding(input_encoding);
- if (!output_encoding) {
- output_encoding = nkf_default_encoding();
- }
- if (!output_encoding) {
- if (noout_f || guess_f) output_encoding = nkf_enc_from_index(ISO_2022_JP);
- else return -1;
- }
- set_output_encoding(output_encoding);
- oconv = nkf_enc_to_oconv(output_encoding);
- o_putc = std_putc;
-
- /* replace continucation module, from output side */
-
- /* output redicrection */
-#ifdef CHECK_OPTION
- if (noout_f || guess_f){
- o_putc = no_putc;
- }
-#endif
- if (mimeout_f) {
- o_mputc = o_putc;
- o_putc = mime_putc;
- if (mimeout_f == TRUE) {
- o_base64conv = oconv; oconv = base64_conv;
- }
- /* base64_count = 0; */
- }
-
- if (eolmode_f || guess_f) {
- o_eol_conv = oconv; oconv = eol_conv;
- }
- if (rot_f) {
- o_rot_conv = oconv; oconv = rot_conv;
- }
- if (iso2022jp_f) {
- o_iso2022jp_check_conv = oconv; oconv = iso2022jp_check_conv;
- }
- if (hira_f) {
- o_hira_conv = oconv; oconv = hira_conv;
- }
- if (fold_f) {
- o_fconv = oconv; oconv = fold_conv;
- f_line = 0;
- }
- if (alpha_f || x0201_f) {
- o_zconv = oconv; oconv = z_conv;
- }
-
- i_getc = std_getc;
- i_ungetc = std_ungetc;
- /* input redicrection */
-#ifdef INPUT_OPTION
- if (cap_f){
- i_cgetc = i_getc; i_getc = cap_getc;
- i_cungetc = i_ungetc; i_ungetc= cap_ungetc;
- }
- if (url_f){
- i_ugetc = i_getc; i_getc = url_getc;
- i_uungetc = i_ungetc; i_ungetc= url_ungetc;
- }
#endif
-#ifdef NUMCHAR_OPTION
- if (numchar_f){
- i_ngetc = i_getc; i_getc = numchar_getc;
- i_nungetc = i_ungetc; i_ungetc= numchar_ungetc;
- }
-#endif
-#ifdef UNICODE_NORMALIZATION
- if (nfc_f){
- i_nfc_getc = i_getc; i_getc = nfc_getc;
- i_nfc_ungetc = i_ungetc; i_ungetc= nfc_ungetc;
- }
-#endif
- if (mime_f && mimebuf_f==FIXED_MIME) {
- i_mgetc = i_getc; i_getc = mime_getc;
- i_mungetc = i_ungetc; i_ungetc = mime_ungetc;
- }
- if (broken_f & 1) {
- i_bgetc = i_getc; i_getc = broken_getc;
- i_bungetc = i_ungetc; i_ungetc = broken_ungetc;
- }
- if (input_encoding) {
- set_iconv(-TRUE, nkf_enc_to_iconv(input_encoding));
- } else {
- set_iconv(FALSE, e_iconv);
- }
-
- {
- struct input_code *p = input_code_list;
- while (p->name){
- status_reinit(p++);
- }
- }
- return 0;
-}
-
-/*
- Conversion main loop. Code detection only.
- */
-#if !defined(PERL_XS) && !defined(WIN32DLL)
-static nkf_char
-noconvert(FILE *f)
+void no_connection(nkf_char c2, nkf_char c1)
{
- nkf_char c;
-
- if (nop_f == 2)
- module_connection();
- while ((c = (*i_getc)(f)) != EOF)
- (*o_putc)(c);
- (*o_putc)(EOF);
- return 1;
+ no_connection2(c2,c1,0);
}
-#endif
-#define NEXT continue /* no output, get next */
-#define SKIP c2=0;continue /* no output, get next */
-#define MORE c2=c1;continue /* need one more byte */
-#define SEND ; /* output c1 and c2, get next */
-#define LAST break /* end of loop, go closing */
-#define set_input_mode(mode) do { \
- input_mode = mode; \
- shift_mode = 0; \
- set_input_codename("ISO-2022-JP"); \
- debug("ISO-2022-JP"); \
-} while (0)
-
-static int
-kanji_convert(FILE *f)
+nkf_char no_connection2(nkf_char c2, nkf_char c1, nkf_char c0)
{
- nkf_char c1=0, c2=0, c3=0, c4=0;
- int shift_mode = 0; /* 0, 1, 2, 3 */
- int g2 = 0;
- int is_8bit = FALSE;
-
- if (input_encoding && !nkf_enc_asciicompat(input_encoding)) {
- is_8bit = TRUE;
- }
-
- input_mode = ASCII;
- output_mode = ASCII;
-
- if (module_connection() < 0) {
-#if !defined(PERL_XS) && !defined(WIN32DLL)
- fprintf(stderr, "no output encoding given\n");
-#endif
- return -1;
- }
- check_bom(f);
-
-#ifdef UTF8_INPUT_ENABLE
- if(iconv == w_iconv32){
- while ((c1 = (*i_getc)(f)) != EOF &&
- (c2 = (*i_getc)(f)) != EOF &&
- (c3 = (*i_getc)(f)) != EOF &&
- (c4 = (*i_getc)(f)) != EOF) {
- nkf_iconv_utf_32(c1, c2, c3, c4);
- }
- (*i_ungetc)(EOF, f);
- }
- else if (iconv == w_iconv16) {
- while ((c1 = (*i_getc)(f)) != EOF &&
- (c2 = (*i_getc)(f)) != EOF) {
- if (nkf_iconv_utf_16(c1, c2, 0, 0) == -2 &&
- (c3 = (*i_getc)(f)) != EOF &&
- (c4 = (*i_getc)(f)) != EOF) {
- nkf_iconv_utf_16(c1, c2, c3, c4);
- }
- }
- (*i_ungetc)(EOF, f);
- }
-#endif
-
- while ((c1 = (*i_getc)(f)) != EOF) {
-#ifdef INPUT_CODE_FIX
- if (!input_encoding)
-#endif
- code_status(c1);
- if (c2) {
- /* second byte */
- if (c2 > DEL) {
- /* in case of 8th bit is on */
- if (!estab_f&&!mime_decode_mode) {
- /* in case of not established yet */
- /* It is still ambiguious */
- if (h_conv(f, c2, c1)==EOF) {
- LAST;
- }
- else {
- SKIP;
- }
- }
- else {
- /* in case of already established */
- if (c1 < 0x40) {
- /* ignore bogus code */
- SKIP;
- } else {
- SEND;
- }
- }
- }
- else {
- /* 2nd byte of 7 bit code or SJIS */
- SEND;
- }
- }
- else if (nkf_char_unicode_p(c1)) {
- (*oconv)(0, c1);
- NEXT;
- }
- else {
- /* first byte */
- if (input_mode == JIS_X_0208 && DEL <= c1 && c1 < 0x92) {
- /* CP5022x */
- MORE;
- } else if (c1 > DEL) {
- /* 8 bit code */
- if (!estab_f && !iso8859_f) {
- /* not established yet */
- MORE;
- } else { /* estab_f==TRUE */
- if (iso8859_f) {
- c2 = ISO_8859_1;
- c1 &= 0x7f;
- SEND;
- }
- else if ((iconv == s_iconv && 0xA0 <= c1 && c1 <= 0xDF) ||
- (ms_ucs_map_f == UCS_MAP_CP10001 && (c1 == 0xFD || c1 == 0xFE))) {
- /* JIS X 0201 */
- c2 = JIS_X_0201_1976_K;
- c1 &= 0x7f;
- SEND;
- }
- else {
- /* already established */
- MORE;
- }
- }
- } else if (SP < c1 && c1 < DEL) {
- /* in case of Roman characters */
- if (shift_mode) {
- /* output 1 shifted byte */
- if (iso8859_f) {
- c2 = ISO_8859_1;
- SEND;
- } else if (nkf_byte_jisx0201_katakana_p(c1)){
- /* output 1 shifted byte */
- c2 = JIS_X_0201_1976_K;
- SEND;
- } else {
- /* look like bogus code */
- SKIP;
- }
- } else if (input_mode == JIS_X_0208 || input_mode == JIS_X_0212 ||
- input_mode == JIS_X_0213_1 || input_mode == JIS_X_0213_2) {
- /* in case of Kanji shifted */
- MORE;
- } else if (c1 == '=' && mime_f && !mime_decode_mode) {
- /* Check MIME code */
- if ((c1 = (*i_getc)(f)) == EOF) {
- (*oconv)(0, '=');
- LAST;
- } else if (c1 == '?') {
- /* =? is mime conversion start sequence */
- if(mime_f == STRICT_MIME) {
- /* check in real detail */
- if (mime_begin_strict(f) == EOF)
- LAST;
- SKIP;
- } else if (mime_begin(f) == EOF)
- LAST;
- SKIP;
- } else {
- (*oconv)(0, '=');
- (*i_ungetc)(c1,f);
- SKIP;
- }
- } else {
- /* normal ASCII code */
- SEND;
- }
- } else if (c1 == SI && (!is_8bit || mime_decode_mode)) {
- shift_mode = 0;
- SKIP;
- } else if (c1 == SO && (!is_8bit || mime_decode_mode)) {
- shift_mode = 1;
- SKIP;
- } else if (c1 == ESC && (!is_8bit || mime_decode_mode)) {
- if ((c1 = (*i_getc)(f)) == EOF) {
- /* (*oconv)(0, ESC); don't send bogus code */
- LAST;
- }
- else if (c1 == '&') {
- /* IRR */
- if ((c1 = (*i_getc)(f)) == EOF) {
- LAST;
- } else {
- SKIP;
- }
- }
- else if (c1 == '$') {
- /* GZDMx */
- if ((c1 = (*i_getc)(f)) == EOF) {
- /* don't send bogus code
- (*oconv)(0, ESC);
- (*oconv)(0, '$'); */
- LAST;
- } else if (c1 == '@' || c1 == 'B') {
- /* JIS X 0208 */
- set_input_mode(JIS_X_0208);
- SKIP;
- } else if (c1 == '(') {
- /* GZDM4 */
- if ((c1 = (*i_getc)(f)) == EOF) {
- /* don't send bogus code
- (*oconv)(0, ESC);
- (*oconv)(0, '$');
- (*oconv)(0, '(');
- */
- LAST;
- } else if (c1 == '@'|| c1 == 'B') {
- /* JIS X 0208 */
- set_input_mode(JIS_X_0208);
- SKIP;
-#ifdef X0212_ENABLE
- } else if (c1 == 'D'){
- set_input_mode(JIS_X_0212);
- SKIP;
-#endif /* X0212_ENABLE */
- } else if (c1 == 'O' || c1 == 'Q'){
- set_input_mode(JIS_X_0213_1);
- SKIP;
- } else if (c1 == 'P'){
- set_input_mode(JIS_X_0213_2);
- SKIP;
- } else {
- /* could be some special code */
- (*oconv)(0, ESC);
- (*oconv)(0, '$');
- (*oconv)(0, '(');
- (*oconv)(0, c1);
- SKIP;
- }
- } else if (broken_f&0x2) {
- /* accept any ESC-(-x as broken code ... */
- input_mode = JIS_X_0208;
- shift_mode = 0;
- SKIP;
- } else {
- (*oconv)(0, ESC);
- (*oconv)(0, '$');
- (*oconv)(0, c1);
- SKIP;
- }
- } else if (c1 == '(') {
- /* GZD4 */
- if ((c1 = (*i_getc)(f)) == EOF) {
- /* don't send bogus code
- (*oconv)(0, ESC);
- (*oconv)(0, '('); */
- LAST;
- }
- else if (c1 == 'I') {
- /* JIS X 0201 Katakana */
- set_input_mode(JIS_X_0201_1976_K);
- SKIP;
- }
- else if (c1 == 'B' || c1 == 'J' || c1 == 'H') {
- /* ISO-646IRV:1983 or JIS X 0201 Roman or JUNET */
- set_input_mode(ASCII);
- SKIP;
- }
- else if (broken_f&0x2) {
- set_input_mode(ASCII);
- SKIP;
- }
- else {
- (*oconv)(0, ESC);
- (*oconv)(0, '(');
- SEND;
- }
- }
- else if (c1 == '.') {
- /* G2D6 */
- if ((c1 = (*i_getc)(f)) == EOF) {
- LAST;
- }
- else if (c1 == 'A') {
- /* ISO-8859-1 */
- g2 = ISO_8859_1;
- SKIP;
- }
- else {
- (*oconv)(0, ESC);
- (*oconv)(0, '.');
- SEND;
- }
- }
- else if (c1 == 'N') {
- /* SS2 */
- c1 = (*i_getc)(f);
- if (g2 == ISO_8859_1) {
- c2 = ISO_8859_1;
- SEND;
- }else{
- (*i_ungetc)(c1, f);
- /* lonely ESC */
- (*oconv)(0, ESC);
- SEND;
- }
- }
- else {
- /* lonely ESC */
- (*oconv)(0, ESC);
- SEND;
- }
- } else if (c1 == ESC && iconv == s_iconv) {
- /* ESC in Shift_JIS */
- if ((c1 = (*i_getc)(f)) == EOF) {
- /* (*oconv)(0, ESC); don't send bogus code */
- LAST;
- } else if (c1 == '$') {
- /* J-PHONE emoji */
- if ((c1 = (*i_getc)(f)) == EOF) {
- LAST;
- } else if (('E' <= c1 && c1 <= 'G') ||
- ('O' <= c1 && c1 <= 'Q')) {
- /*
- NUM : 0 1 2 3 4 5
- BYTE: G E F O P Q
- C%7 : 1 6 0 2 3 4
- C%7 : 0 1 2 3 4 5 6
- NUM : 2 0 3 4 5 X 1
- */
- static const nkf_char jphone_emoji_first_table[7] =
- {0xE1E0, 0xDFE0, 0xE2E0, 0xE3E0, 0xE4E0, 0xDFE0, 0xE0E0};
- c3 = nkf_char_unicode_new(jphone_emoji_first_table[c1 % 7]);
- if ((c1 = (*i_getc)(f)) == EOF) LAST;
- while (SP <= c1 && c1 <= 'z') {
- (*oconv)(0, c1 + c3);
- if ((c1 = (*i_getc)(f)) == EOF) LAST;
- }
- SKIP;
- }
- else {
- (*oconv)(0, ESC);
- (*oconv)(0, '$');
- SEND;
- }
- }
- else {
- /* lonely ESC */
- (*oconv)(0, ESC);
- SEND;
- }
- } else if (c1 == LF || c1 == CR) {
- if (broken_f&4) {
- input_mode = ASCII; set_iconv(FALSE, 0);
- SEND;
- } else if (mime_decode_f && !mime_decode_mode){
- if (c1 == LF) {
- if ((c1=(*i_getc)(f))!=EOF && c1 == SP) {
- i_ungetc(SP,f);
- continue;
- } else {
- i_ungetc(c1,f);
- }
- c1 = LF;
- SEND;
- } else { /* if (c1 == CR)*/
- if ((c1=(*i_getc)(f))!=EOF) {
- if (c1==SP) {
- i_ungetc(SP,f);
- continue;
- } else if (c1 == LF && (c1=(*i_getc)(f))!=EOF && c1 == SP) {
- i_ungetc(SP,f);
- continue;
- } else {
- i_ungetc(c1,f);
- }
- i_ungetc(LF,f);
- } else {
- i_ungetc(c1,f);
- }
- c1 = CR;
- SEND;
- }
- }
- } else
- SEND;
- }
- /* send: */
- switch(input_mode){
- case ASCII:
- switch ((*iconv)(c2, c1, 0)) { /* can be EUC / SJIS / UTF-8 */
- case -2:
- /* 4 bytes UTF-8 */
- if ((c3 = (*i_getc)(f)) != EOF) {
- code_status(c3);
- c3 <<= 8;
- if ((c4 = (*i_getc)(f)) != EOF) {
- code_status(c4);
- (*iconv)(c2, c1, c3|c4);
- }
- }
- break;
- case -1:
- /* 3 bytes EUC or UTF-8 */
- if ((c3 = (*i_getc)(f)) != EOF) {
- code_status(c3);
- (*iconv)(c2, c1, c3);
- }
- break;
- }
- break;
- case JIS_X_0208:
- case JIS_X_0213_1:
- if (ms_ucs_map_f &&
- 0x7F <= c2 && c2 <= 0x92 &&
- 0x21 <= c1 && c1 <= 0x7E) {
- /* CP932 UDC */
- c1 = nkf_char_unicode_new((c2 - 0x7F) * 94 + c1 - 0x21 + 0xE000);
- c2 = 0;
- }
- (*oconv)(c2, c1); /* this is JIS, not SJIS/EUC case */
- break;
-#ifdef X0212_ENABLE
- case JIS_X_0212:
- (*oconv)(PREFIX_EUCG3 | c2, c1);
- break;
-#endif /* X0212_ENABLE */
- case JIS_X_0213_2:
- (*oconv)(PREFIX_EUCG3 | c2, c1);
- break;
- default:
- (*oconv)(input_mode, c1); /* other special case */
- }
-
- c2 = 0;
- c3 = 0;
- continue;
- /* goto next_word */
- }
-
- /* epilogue */
- (*iconv)(EOF, 0, 0);
- if (!input_codename)
- {
- if (is_8bit) {
- struct input_code *p = input_code_list;
- struct input_code *result = p;
- while (p->name){
- if (p->score < result->score) result = p;
- ++p;
- }
- set_input_codename(result->name);
-#ifdef CHECK_OPTION
- debug(result->name);
-#endif
- }
- }
- return 0;
+ fprintf(stderr,"nkf internal module connection failure.\n");
+ exit(1);
+ return 0; /* LINT */
}
-/*
- * int options(unsigned char *cp)
- *
- * return values:
- * 0: success
- * -1: ArgumentError
- */
-static int
-options(unsigned char *cp)
-{
- nkf_char i, j;
- unsigned char *p;
- unsigned char *cp_back = NULL;
- nkf_encoding *enc;
-
- if (option_mode==1)
- return 0;
- while(*cp && *cp++!='-');
- while (*cp || cp_back) {
- if(!*cp){
- cp = cp_back;
- cp_back = NULL;
- continue;
- }
- p = 0;
- switch (*cp++) {
- case '-': /* literal options */
- if (!*cp || *cp == SP) { /* ignore the rest of arguments */
- option_mode = 1;
- return 0;
- }
- for (i=0;i<sizeof(long_option)/sizeof(long_option[0]);i++) {
- p = (unsigned char *)long_option[i].name;
- for (j=0;*p && *p != '=' && *p == cp[j];p++, j++);
- if (*p == cp[j] || cp[j] == SP){
- p = &cp[j] + 1;
- break;
- }
- p = 0;
- }
- if (p == 0) {
-#if !defined(PERL_XS) && !defined(WIN32DLL)
- fprintf(stderr, "unknown long option: --%s\n", cp);
-#endif
- return -1;
- }
- while(*cp && *cp != SP && cp++);
- if (long_option[i].alias[0]){
- cp_back = cp;
- cp = (unsigned char *)long_option[i].alias;
- }else{
#ifndef PERL_XS
- if (strcmp(long_option[i].name, "help") == 0){
- usage();
- exit(EXIT_SUCCESS);
- }
-#endif
- if (strcmp(long_option[i].name, "ic=") == 0){
- enc = nkf_enc_find((char *)p);
- if (!enc) continue;
- input_encoding = enc;
- continue;
- }
- if (strcmp(long_option[i].name, "oc=") == 0){
- enc = nkf_enc_find((char *)p);
- /* if (enc <= 0) continue; */
- if (!enc) continue;
- output_encoding = enc;
- continue;
- }
- if (strcmp(long_option[i].name, "guess=") == 0){
- if (p[0] == '0' || p[0] == '1') {
- guess_f = 1;
- } else {
- guess_f = 2;
- }
- continue;
- }
-#ifdef OVERWRITE
- if (strcmp(long_option[i].name, "overwrite") == 0){
- file_out_f = TRUE;
- overwrite_f = TRUE;
- preserve_time_f = TRUE;
- continue;
- }
- if (strcmp(long_option[i].name, "overwrite=") == 0){
- file_out_f = TRUE;
- overwrite_f = TRUE;
- preserve_time_f = TRUE;
- backup_f = TRUE;
- backup_suffix = (char *)p;
- continue;
- }
- if (strcmp(long_option[i].name, "in-place") == 0){
- file_out_f = TRUE;
- overwrite_f = TRUE;
- preserve_time_f = FALSE;
- continue;
- }
- if (strcmp(long_option[i].name, "in-place=") == 0){
- file_out_f = TRUE;
- overwrite_f = TRUE;
- preserve_time_f = FALSE;
- backup_f = TRUE;
- backup_suffix = (char *)p;
- continue;
- }
-#endif
-#ifdef INPUT_OPTION
- if (strcmp(long_option[i].name, "cap-input") == 0){
- cap_f = TRUE;
- continue;
- }
- if (strcmp(long_option[i].name, "url-input") == 0){
- url_f = TRUE;
- continue;
- }
-#endif
-#ifdef NUMCHAR_OPTION
- if (strcmp(long_option[i].name, "numchar-input") == 0){
- numchar_f = TRUE;
- continue;
- }
-#endif
-#ifdef CHECK_OPTION
- if (strcmp(long_option[i].name, "no-output") == 0){
- noout_f = TRUE;
- continue;
- }
- if (strcmp(long_option[i].name, "debug") == 0){
- debug_f = TRUE;
- continue;
- }
-#endif
- if (strcmp(long_option[i].name, "cp932") == 0){
-#ifdef SHIFTJIS_CP932
- cp51932_f = TRUE;
- cp932inv_f = -TRUE;
-#endif
-#ifdef UTF8_OUTPUT_ENABLE
- ms_ucs_map_f = UCS_MAP_CP932;
-#endif
- continue;
- }
- if (strcmp(long_option[i].name, "no-cp932") == 0){
-#ifdef SHIFTJIS_CP932
- cp51932_f = FALSE;
- cp932inv_f = FALSE;
-#endif
-#ifdef UTF8_OUTPUT_ENABLE
- ms_ucs_map_f = UCS_MAP_ASCII;
-#endif
- continue;
- }
-#ifdef SHIFTJIS_CP932
- if (strcmp(long_option[i].name, "cp932inv") == 0){
- cp932inv_f = -TRUE;
- continue;
- }
-#endif
-
-#ifdef X0212_ENABLE
- if (strcmp(long_option[i].name, "x0212") == 0){
- x0212_f = TRUE;
- continue;
- }
-#endif
-
-#ifdef EXEC_IO
- if (strcmp(long_option[i].name, "exec-in") == 0){
- exec_f = 1;
- return 0;
- }
- if (strcmp(long_option[i].name, "exec-out") == 0){
- exec_f = -1;
- return 0;
- }
-#endif
-#if defined(UTF8_OUTPUT_ENABLE) && defined(UTF8_INPUT_ENABLE)
- if (strcmp(long_option[i].name, "no-cp932ext") == 0){
- no_cp932ext_f = TRUE;
- continue;
- }
- if (strcmp(long_option[i].name, "no-best-fit-chars") == 0){
- no_best_fit_chars_f = TRUE;
- continue;
- }
- if (strcmp(long_option[i].name, "fb-skip") == 0){
- encode_fallback = NULL;
- continue;
- }
- if (strcmp(long_option[i].name, "fb-html") == 0){
- encode_fallback = encode_fallback_html;
- continue;
- }
- if (strcmp(long_option[i].name, "fb-xml") == 0){
- encode_fallback = encode_fallback_xml;
- continue;
- }
- if (strcmp(long_option[i].name, "fb-java") == 0){
- encode_fallback = encode_fallback_java;
- continue;
- }
- if (strcmp(long_option[i].name, "fb-perl") == 0){
- encode_fallback = encode_fallback_perl;
- continue;
- }
- if (strcmp(long_option[i].name, "fb-subchar") == 0){
- encode_fallback = encode_fallback_subchar;
- continue;
- }
- if (strcmp(long_option[i].name, "fb-subchar=") == 0){
- encode_fallback = encode_fallback_subchar;
- unicode_subchar = 0;
- if (p[0] != '0'){
- /* decimal number */
- for (i = 0; i < 7 && nkf_isdigit(p[i]); i++){
- unicode_subchar *= 10;
- unicode_subchar += hex2bin(p[i]);
- }
- }else if(p[1] == 'x' || p[1] == 'X'){
- /* hexadecimal number */
- for (i = 2; i < 8 && nkf_isxdigit(p[i]); i++){
- unicode_subchar <<= 4;
- unicode_subchar |= hex2bin(p[i]);
- }
- }else{
- /* octal number */
- for (i = 1; i < 8 && nkf_isoctal(p[i]); i++){
- unicode_subchar *= 8;
- unicode_subchar += hex2bin(p[i]);
- }
- }
- w16e_conv(unicode_subchar, &i, &j);
- unicode_subchar = i<<8 | j;
- continue;
- }
+#ifdef WIN32DLL
+#define fprintf dllprintf
#endif
-#ifdef UTF8_OUTPUT_ENABLE
- if (strcmp(long_option[i].name, "ms-ucs-map") == 0){
- ms_ucs_map_f = UCS_MAP_MS;
- continue;
- }
+void usage(void)
+{
+ fprintf(stderr,"USAGE: nkf(nkf32,wnkf,nkf2) -[flags] [in file] .. [out file for -O flag]\n");
+ fprintf(stderr,"Flags:\n");
+ fprintf(stderr,"b,u Output is buffered (DEFAULT),Output is unbuffered\n");
+#ifdef DEFAULT_CODE_SJIS
+ fprintf(stderr,"j,s,e,w Output code is JIS 7 bit, Shift_JIS (DEFAULT), EUC-JP, UTF-8N\n");
#endif
-#ifdef UNICODE_NORMALIZATION
- if (strcmp(long_option[i].name, "utf8mac-input") == 0){
- nfc_f = TRUE;
- continue;
- }
+#ifdef DEFAULT_CODE_JIS
+ fprintf(stderr,"j,s,e,w Output code is JIS 7 bit (DEFAULT), Shift JIS, EUC-JP, UTF-8N\n");
#endif
- if (strcmp(long_option[i].name, "prefix=") == 0){
- if (nkf_isgraph(p[0])){
- for (i = 1; nkf_isgraph(p[i]); i++){
- prefix_table[p[i]] = p[0];
- }
- }
- continue;
- }
-#if !defined(PERL_XS) && !defined(WIN32DLL)
- fprintf(stderr, "unsupported long option: --%s\n", long_option[i].name);
+#ifdef DEFAULT_CODE_EUC
+ fprintf(stderr,"j,s,e,w Output code is JIS 7 bit, Shift JIS, EUC-JP (DEFAULT), UTF-8N\n");
#endif
- return -1;
- }
- continue;
- case 'b': /* buffered mode */
- unbuf_f = FALSE;
- continue;
- case 'u': /* non bufferd mode */
- unbuf_f = TRUE;
- continue;
- case 't': /* transparent mode */
- if (*cp=='1') {
- /* alias of -t */
- cp++;
- nop_f = TRUE;
- } else if (*cp=='2') {
- /*
- * -t with put/get
- *
- * nkf -t2MB hoge.bin | nkf -t2mB | diff -s - hoge.bin
- *
- */
- cp++;
- nop_f = 2;
- } else
- nop_f = TRUE;
- continue;
- case 'j': /* JIS output */
- case 'n':
- output_encoding = nkf_enc_from_index(ISO_2022_JP);
- continue;
- case 'e': /* AT&T EUC output */
- output_encoding = nkf_enc_from_index(EUCJP_NKF);
- continue;
- case 's': /* SJIS output */
- output_encoding = nkf_enc_from_index(SHIFT_JIS);
- continue;
- case 'l': /* ISO8859 Latin-1 support, no conversion */
- iso8859_f = TRUE; /* Only compatible with ISO-2022-JP */
- input_encoding = nkf_enc_from_index(ISO_8859_1);
- continue;
- case 'i': /* Kanji IN ESC-$-@/B */
- if (*cp=='@'||*cp=='B')
- kanji_intro = *cp++;
- continue;
- case 'o': /* ASCII IN ESC-(-J/B/H */
- /* ESC ( H was used in initial JUNET messages */
- if (*cp=='J'||*cp=='B'||*cp=='H')
- ascii_intro = *cp++;
- continue;
- case 'h':
- /*
- bit:1 katakana->hiragana
- bit:2 hiragana->katakana
- */
- if ('9'>= *cp && *cp>='0')
- hira_f |= (*cp++ -'0');
- else
- hira_f |= 1;
- continue;
- case 'r':
- rot_f = TRUE;
- continue;
-#if defined(MSDOS) || defined(__OS2__)
- case 'T':
- binmode_f = FALSE;
- continue;
-#endif
-#ifndef PERL_XS
- case 'V':
- show_configuration();
- exit(EXIT_SUCCESS);
- break;
- case 'v':
- version();
- exit(EXIT_SUCCESS);
- break;
+#ifdef DEFAULT_CODE_UTF8
+ fprintf(stderr,"j,s,e,w Output code is JIS 7 bit, Shift JIS, EUC-JP, UTF-8N (DEFAULT)\n");
#endif
#ifdef UTF8_OUTPUT_ENABLE
- case 'w': /* UTF-8 output */
- if (cp[0] == '8') {
- cp++;
- if (cp[0] == '0'){
- cp++;
- output_encoding = nkf_enc_from_index(UTF_8N);
- } else {
- output_bom_f = TRUE;
- output_encoding = nkf_enc_from_index(UTF_8_BOM);
- }
- } else {
- int enc_idx;
- if ('1'== cp[0] && '6'==cp[1]) {
- cp += 2;
- enc_idx = UTF_16;
- } else if ('3'== cp[0] && '2'==cp[1]) {
- cp += 2;
- enc_idx = UTF_32;
- } else {
- output_encoding = nkf_enc_from_index(UTF_8);
- continue;
- }
- if (cp[0]=='L') {
- cp++;
- output_endian = ENDIAN_LITTLE;
- } else if (cp[0] == 'B') {
- cp++;
- } else {
- output_encoding = nkf_enc_from_index(enc_idx);
- continue;
- }
- if (cp[0] == '0'){
- cp++;
- enc_idx = enc_idx == UTF_16
- ? (output_endian == ENDIAN_LITTLE ? UTF_16LE : UTF_16BE)
- : (output_endian == ENDIAN_LITTLE ? UTF_32LE : UTF_32BE);
- } else {
- output_bom_f = TRUE;
- enc_idx = enc_idx == UTF_16
- ? (output_endian == ENDIAN_LITTLE ? UTF_16LE_BOM : UTF_16BE_BOM)
- : (output_endian == ENDIAN_LITTLE ? UTF_32LE_BOM : UTF_32BE_BOM);
- }
- output_encoding = nkf_enc_from_index(enc_idx);
- }
- continue;
+ fprintf(stderr," After 'w' you can add more options. -w[ 8 [0], 16 [[BL] [0]] ]\n");
#endif
+ fprintf(stderr,"J,S,E,W Input assumption is JIS 7 bit , Shift JIS, EUC-JP, UTF-8\n");
#ifdef UTF8_INPUT_ENABLE
- case 'W': /* UTF input */
- if (cp[0] == '8') {
- cp++;
- input_encoding = nkf_enc_from_index(UTF_8);
- }else{
- int enc_idx;
- if ('1'== cp[0] && '6'==cp[1]) {
- cp += 2;
- input_endian = ENDIAN_BIG;
- enc_idx = UTF_16;
- } else if ('3'== cp[0] && '2'==cp[1]) {
- cp += 2;
- input_endian = ENDIAN_BIG;
- enc_idx = UTF_32;
- } else {
- input_encoding = nkf_enc_from_index(UTF_8);
- continue;
- }
- if (cp[0]=='L') {
- cp++;
- input_endian = ENDIAN_LITTLE;
- } else if (cp[0] == 'B') {
- cp++;
- input_endian = ENDIAN_BIG;
- }
- enc_idx = (enc_idx == UTF_16
- ? (input_endian == ENDIAN_LITTLE ? UTF_16LE : UTF_16BE)
- : (input_endian == ENDIAN_LITTLE ? UTF_32LE : UTF_32BE));
- input_encoding = nkf_enc_from_index(enc_idx);
- }
- continue;
-#endif
- /* Input code assumption */
- case 'J': /* ISO-2022-JP input */
- input_encoding = nkf_enc_from_index(ISO_2022_JP);
- continue;
- case 'E': /* EUC-JP input */
- input_encoding = nkf_enc_from_index(EUCJP_NKF);
- continue;
- case 'S': /* Shift_JIS input */
- input_encoding = nkf_enc_from_index(SHIFT_JIS);
- continue;
- case 'Z': /* Convert X0208 alphabet to asii */
- /* alpha_f
- bit:0 Convert JIS X 0208 Alphabet to ASCII
- bit:1 Convert Kankaku to one space
- bit:2 Convert Kankaku to two spaces
- bit:3 Convert HTML Entity
- bit:4 Convert JIS X 0208 Katakana to JIS X 0201 Katakana
- */
- while ('0'<= *cp && *cp <='9') {
- alpha_f |= 1 << (*cp++ - '0');
- }
- if (!alpha_f) alpha_f = 1;
- continue;
- case 'x': /* Convert X0201 kana to X0208 or X0201 Conversion */
- x0201_f = FALSE; /* No X0201->X0208 conversion */
- /* accept X0201
- ESC-(-I in JIS, EUC, MS Kanji
- SI/SO in JIS, EUC, MS Kanji
- SS2 in EUC, JIS, not in MS Kanji
- MS Kanji (0xa0-0xdf)
- output X0201
- ESC-(-I in JIS (0x20-0x5f)
- SS2 in EUC (0xa0-0xdf)
- 0xa0-0xd in MS Kanji (0xa0-0xdf)
- */
- continue;
- case 'X': /* Convert X0201 kana to X0208 */
- x0201_f = TRUE;
- continue;
- case 'F': /* prserve new lines */
- fold_preserve_f = TRUE;
- case 'f': /* folding -f60 or -f */
- fold_f = TRUE;
- fold_len = 0;
- while('0'<= *cp && *cp <='9') { /* we don't use atoi here */
- fold_len *= 10;
- fold_len += *cp++ - '0';
- }
- if (!(0<fold_len && fold_len<BUFSIZ))
- fold_len = DEFAULT_FOLD;
- if (*cp=='-') {
- fold_margin = 0;
- cp++;
- while('0'<= *cp && *cp <='9') { /* we don't use atoi here */
- fold_margin *= 10;
- fold_margin += *cp++ - '0';
- }
- }
- continue;
- case 'm': /* MIME support */
- /* mime_decode_f = TRUE; */ /* this has too large side effects... */
- if (*cp=='B'||*cp=='Q') {
- mime_decode_mode = *cp++;
- mimebuf_f = FIXED_MIME;
- } else if (*cp=='N') {
- mime_f = TRUE; cp++;
- } else if (*cp=='S') {
- mime_f = STRICT_MIME; cp++;
- } else if (*cp=='0') {
- mime_decode_f = FALSE;
- mime_f = FALSE; cp++;
- } else {
- mime_f = STRICT_MIME;
- }
- continue;
- case 'M': /* MIME output */
- if (*cp=='B') {
- mimeout_mode = 'B';
- mimeout_f = FIXED_MIME; cp++;
- } else if (*cp=='Q') {
- mimeout_mode = 'Q';
- mimeout_f = FIXED_MIME; cp++;
- } else {
- mimeout_f = TRUE;
- }
- continue;
- case 'B': /* Broken JIS support */
- /* bit:0 no ESC JIS
- bit:1 allow any x on ESC-(-x or ESC-$-x
- bit:2 reset to ascii on NL
- */
- if ('9'>= *cp && *cp>='0')
- broken_f |= 1<<(*cp++ -'0');
- else
- broken_f |= TRUE;
- continue;
-#ifndef PERL_XS
- case 'O':/* for Output file */
- file_out_f = TRUE;
- continue;
-#endif
- case 'c':/* add cr code */
- eolmode_f = CRLF;
- continue;
- case 'd':/* delete cr code */
- eolmode_f = LF;
- continue;
- case 'I': /* ISO-2022-JP output */
- iso2022jp_f = TRUE;
- continue;
- case 'L': /* line mode */
- if (*cp=='u') { /* unix */
- eolmode_f = LF; cp++;
- } else if (*cp=='m') { /* mac */
- eolmode_f = CR; cp++;
- } else if (*cp=='w') { /* windows */
- eolmode_f = CRLF; cp++;
- } else if (*cp=='0') { /* no conversion */
- eolmode_f = 0; cp++;
- }
- continue;
-#ifndef PERL_XS
- case 'g':
- if ('2' <= *cp && *cp <= '9') {
- guess_f = 2;
- cp++;
- } else if (*cp == '0' || *cp == '1') {
- guess_f = 1;
- cp++;
- } else {
- guess_f = 1;
- }
- continue;
-#endif
- case SP:
- /* module muliple options in a string are allowed for Perl moudle */
- while(*cp && *cp++!='-');
- continue;
- default:
-#if !defined(PERL_XS) && !defined(WIN32DLL)
- fprintf(stderr, "unknown option: -%c\n", *(cp-1));
-#endif
- /* bogus option but ignored */
- return -1;
- }
- }
- return 0;
-}
-
-#ifdef WIN32DLL
-#include "nkf32dll.c"
-#elif defined(PERL_XS)
-#else /* WIN32DLL */
-int
-main(int argc, char **argv)
-{
- FILE *fin;
- unsigned char *cp;
-
- char *outfname = NULL;
- char *origfname;
-
-#ifdef EASYWIN /*Easy Win */
- _BufferSize.y = 400;/*Set Scroll Buffer Size*/
-#endif
-#ifdef DEFAULT_CODE_LOCALE
- setlocale(LC_CTYPE, "");
-#endif
- nkf_state_init();
-
- for (argc--,argv++; (argc > 0) && **argv == '-'; argc--, argv++) {
- cp = (unsigned char *)*argv;
- options(cp);
-#ifdef EXEC_IO
- if (exec_f){
- int fds[2], pid;
- if (pipe(fds) < 0 || (pid = fork()) < 0){
- abort();
- }
- if (pid == 0){
- if (exec_f > 0){
- close(fds[0]);
- dup2(fds[1], 1);
- }else{
- close(fds[1]);
- dup2(fds[0], 0);
- }
- execvp(argv[1], &argv[1]);
- }
- if (exec_f > 0){
- close(fds[1]);
- dup2(fds[0], 0);
- }else{
- close(fds[0]);
- dup2(fds[1], 1);
- }
- argc = 0;
- break;
- }
-#endif
- }
-
- if (guess_f) {
-#ifdef CHECK_OPTION
- int debug_f_back = debug_f;
-#endif
-#ifdef EXEC_IO
- int exec_f_back = exec_f;
-#endif
-#ifdef X0212_ENABLE
- int x0212_f_back = x0212_f;
-#endif
- int x0213_f_back = x0213_f;
- int guess_f_back = guess_f;
- reinit();
- guess_f = guess_f_back;
- mime_f = FALSE;
-#ifdef CHECK_OPTION
- debug_f = debug_f_back;
-#endif
-#ifdef EXEC_IO
- exec_f = exec_f_back;
-#endif
- x0212_f = x0212_f_back;
- x0213_f = x0213_f_back;
- }
-
- if (binmode_f == TRUE)
-#if defined(__OS2__) && (defined(__IBMC__) || defined(__IBMCPP__))
- if (freopen("","wb",stdout) == NULL)
- return (-1);
-#else
- setbinmode(stdout);
-#endif
-
- if (unbuf_f)
- setbuf(stdout, (char *) NULL);
- else
- setvbuffer(stdout, (char *) stdobuf, IOBUF_SIZE);
-
- if (argc == 0) {
- if (binmode_f == TRUE)
-#if defined(__OS2__) && (defined(__IBMC__) || defined(__IBMCPP__))
- if (freopen("","rb",stdin) == NULL) return (-1);
-#else
- setbinmode(stdin);
-#endif
- setvbuffer(stdin, (char *) stdibuf, IOBUF_SIZE);
- if (nop_f)
- noconvert(stdin);
- else {
- kanji_convert(stdin);
- if (guess_f) print_guessed_code(NULL);
- }
- } else {
- int nfiles = argc;
- int is_argument_error = FALSE;
- while (argc--) {
- input_codename = NULL;
- input_eol = 0;
-#ifdef CHECK_OPTION
- iconv_for_check = 0;
-#endif
- if ((fin = fopen((origfname = *argv++), "r")) == NULL) {
- perror(*(argv-1));
- is_argument_error = TRUE;
- continue;
- } else {
-#ifdef OVERWRITE
- int fd = 0;
- int fd_backup = 0;
-#endif
-
- /* reopen file for stdout */
- if (file_out_f == TRUE) {
-#ifdef OVERWRITE
- if (overwrite_f){
- outfname = nkf_xmalloc(strlen(origfname)
- + strlen(".nkftmpXXXXXX")
- + 1);
- strcpy(outfname, origfname);
+ fprintf(stderr," After 'W' you can add more options. -W[ 8, 16 [BL] ] \n");
+#endif
+ fprintf(stderr,"t no conversion\n");
+ fprintf(stderr,"i[@B] Specify the Esc Seq for JIS X 0208-1978/83 (DEFAULT B)\n");
+ fprintf(stderr,"o[BJH] Specify the Esc Seq for ASCII/Roman (DEFAULT B)\n");
+ fprintf(stderr,"r {de/en}crypt ROT13/47\n");
+ fprintf(stderr,"h 1 katakana->hiragana, 2 hiragana->katakana, 3 both\n");
+ fprintf(stderr,"v Show this usage. V: show version\n");
+ fprintf(stderr,"m[BQN0] MIME decode [B:base64,Q:quoted,N:non-strict,0:no decode]\n");
+ fprintf(stderr,"M[BQ] MIME encode [B:base64 Q:quoted]\n");
+ fprintf(stderr,"l ISO8859-1 (Latin-1) support\n");
+ fprintf(stderr,"f/F Folding: -f60 or -f or -f60-10 (fold margin 10) F preserve nl\n");
+ fprintf(stderr,"Z[0-3] Convert X0208 alphabet to ASCII\n");
+ fprintf(stderr," 1: Kankaku to 1 space 2: to 2 spaces 3: Convert to HTML Entity\n");
+ fprintf(stderr,"X,x Assume X0201 kana in MS-Kanji, -x preserves X0201\n");
+ fprintf(stderr,"B[0-2] Broken input 0: missing ESC,1: any X on ESC-[($]-X,2: ASCII on NL\n");
#ifdef MSDOS
- {
- int i;
- for (i = strlen(outfname); i; --i){
- if (outfname[i - 1] == '/'
- || outfname[i - 1] == '\\'){
- break;
- }
- }
- outfname[i] = '\0';
- }
- strcat(outfname, "ntXXXXXX");
- mktemp(outfname);
- fd = open(outfname, O_WRONLY | O_CREAT | O_TRUNC | O_EXCL,
- S_IREAD | S_IWRITE);
-#else
- strcat(outfname, ".nkftmpXXXXXX");
- fd = mkstemp(outfname);
+ fprintf(stderr,"T Text mode output\n");
+#endif
+ fprintf(stderr,"O Output to File (DEFAULT 'nkf.out')\n");
+ fprintf(stderr,"I Convert non ISO-2022-JP charactor to GETA\n");
+ fprintf(stderr,"d,c Convert line breaks -d: LF -c: CRLF\n");
+ fprintf(stderr,"-L[uwm] line mode u:LF w:CRLF m:CR (DEFAULT noconversion)\n");
+ fprintf(stderr,"\n");
+ fprintf(stderr,"Long name options\n");
+ fprintf(stderr," --ic=<input codeset> --oc=<output codeset>\n");
+ fprintf(stderr," Specify the input or output codeset\n");
+ fprintf(stderr," --fj --unix --mac --windows\n");
+ fprintf(stderr," --jis --euc --sjis --utf8 --utf16 --mime --base64\n");
+ fprintf(stderr," Convert for the system or code\n");
+ fprintf(stderr," --hiragana --katakana --katakana-hiragana\n");
+ fprintf(stderr," To Hiragana/Katakana Conversion\n");
+ fprintf(stderr," --prefix= Insert escape before troublesome characters of Shift_JIS\n");
+#ifdef INPUT_OPTION
+ fprintf(stderr," --cap-input, --url-input Convert hex after ':' or '%%'\n");
#endif
- if (fd < 0
- || (fd_backup = dup(fileno(stdout))) < 0
- || dup2(fd, fileno(stdout)) < 0
- ){
- perror(origfname);
- return -1;
- }
- }else
+#ifdef NUMCHAR_OPTION
+ fprintf(stderr," --numchar-input Convert Unicode Character Reference\n");
#endif
- if(argc == 1) {
- outfname = *argv++;
- argc--;
- } else {
- outfname = "nkf.out";
- }
-
- if(freopen(outfname, "w", stdout) == NULL) {
- perror (outfname);
- return (-1);
- }
- if (binmode_f == TRUE) {
-#if defined(__OS2__) && (defined(__IBMC__) || defined(__IBMCPP__))
- if (freopen("","wb",stdout) == NULL)
- return (-1);
-#else
- setbinmode(stdout);
+#ifdef UTF8_INPUT_ENABLE
+ fprintf(stderr," --fb-{skip, html, xml, perl, java, subchar}\n");
+ fprintf(stderr," Specify how nkf handles unassigned characters\n");
#endif
- }
- }
- if (binmode_f == TRUE)
-#if defined(__OS2__) && (defined(__IBMC__) || defined(__IBMCPP__))
- if (freopen("","rb",fin) == NULL)
- return (-1);
-#else
- setbinmode(fin);
-#endif
- setvbuffer(fin, (char *) stdibuf, IOBUF_SIZE);
- if (nop_f)
- noconvert(fin);
- else {
- char *filename = NULL;
- kanji_convert(fin);
- if (nfiles > 1) filename = origfname;
- if (guess_f) print_guessed_code(filename);
- }
- fclose(fin);
#ifdef OVERWRITE
- if (overwrite_f) {
- struct stat sb;
-#if defined(MSDOS) && !defined(__MINGW32__) && !defined(__WIN32__) && !defined(__WATCOMC__) && !defined(__EMX__) && !defined(__OS2__) && !defined(__DJGPP__)
- time_t tb[2];
-#else
- struct utimbuf tb;
-#endif
-
- fflush(stdout);
- close(fd);
- if (dup2(fd_backup, fileno(stdout)) < 0){
- perror("dup2");
- }
- if (stat(origfname, &sb)) {
- fprintf(stderr, "Can't stat %s\n", origfname);
- }
- /* $B%Q!<%_%C%7%g%s$rI|85(B */
- if (chmod(outfname, sb.st_mode)) {
- fprintf(stderr, "Can't set permission %s\n", outfname);
- }
+ fprintf(stderr," --in-place[=SUFFIX] --overwrite[=SUFFIX]\n");
+ fprintf(stderr," Overwrite original listed files by filtered result\n");
+ fprintf(stderr," --overwrite preserves timestamp of original files\n");
+#endif
+ fprintf(stderr," -g --guess Guess the input code\n");
+ fprintf(stderr," --help --version Show this help/the version\n");
+ fprintf(stderr," For more information, see also man nkf\n");
+ fprintf(stderr,"\n");
+ version();
+}
- /* $B%?%$%`%9%?%s%W$rI|85(B */
- if(preserve_time_f){
-#if defined(MSDOS) && !defined(__MINGW32__) && !defined(__WIN32__) && !defined(__WATCOMC__) && !defined(__EMX__) && !defined(__OS2__) && !defined(__DJGPP__)
- tb[0] = tb[1] = sb.st_mtime;
- if (utime(outfname, tb)) {
- fprintf(stderr, "Can't set timestamp %s\n", outfname);
- }
-#else
- tb.actime = sb.st_atime;
- tb.modtime = sb.st_mtime;
- if (utime(outfname, &tb)) {
- fprintf(stderr, "Can't set timestamp %s\n", outfname);
- }
+void version(void)
+{
+ fprintf(stderr,"Network Kanji Filter Version %s (%s) "
+#if defined(MSDOS) && !defined(__WIN32__) && !defined(__WIN16__) && !defined(__OS2__)
+ "for DOS"
#endif
- }
- if(backup_f){
- char *backup_filename = get_backup_filename(backup_suffix, origfname);
-#ifdef MSDOS
- unlink(backup_filename);
+#if defined(MSDOS) && defined(__WIN16__)
+ "for Win16"
#endif
- if (rename(origfname, backup_filename)) {
- perror(backup_filename);
- fprintf(stderr, "Can't rename %s to %s\n",
- origfname, backup_filename);
- }
- nkf_xfree(backup_filename);
- }else{
-#ifdef MSDOS
- if (unlink(origfname)){
- perror(origfname);
- }
+#if defined(MSDOS) && defined(__WIN32__)
+ "for Win32"
#endif
- }
- if (rename(outfname, origfname)) {
- perror(origfname);
- fprintf(stderr, "Can't rename %s to %s\n",
- outfname, origfname);
- }
- nkf_xfree(outfname);
- }
+#ifdef __OS2__
+ "for OS/2"
#endif
- }
- }
- if (is_argument_error)
- return(-1);
- }
-#ifdef EASYWIN /*Easy Win */
- if (file_out_f == FALSE)
- scanf("%d",&end_check);
- else
- fclose(stdout);
-#else /* for Other OS */
- if (file_out_f == TRUE)
- fclose(stdout);
-#endif /*Easy Win */
- return (0);
+ ,NKF_VERSION,NKF_RELEASE_DATE);
+ fprintf(stderr,"\n%s\n",CopyRight);
}
-#endif /* WIN32DLL */
+#endif /*PERL_XS*/
+
+/**
+ ** $B%Q%C%A@):n<T(B
+ ** void@merope.pleiades.or.jp (Kusakabe Youichi)
+ ** NIDE Naoyuki <nide@ics.nara-wu.ac.jp>
+ ** ohta@src.ricoh.co.jp (Junn Ohta)
+ ** inouet@strl.nhk.or.jp (Tomoyuki Inoue)
+ ** kiri@pulser.win.or.jp (Tetsuaki Kiriyama)
+ ** Kimihiko Sato <sato@sail.t.u-tokyo.ac.jp>
+ ** a_kuroe@kuroe.aoba.yokohama.jp (Akihiko Kuroe)
+ ** kono@ie.u-ryukyu.ac.jp (Shinji Kono)
+ ** GHG00637@nifty-serve.or.jp (COW)
+ **
+ **/
+
+/* end */
diff --git a/ext/nkf/nkf-utf8/nkf.h b/ext/nkf/nkf-utf8/nkf.h
deleted file mode 100644
index 49f3b7ff34..0000000000
--- a/ext/nkf/nkf-utf8/nkf.h
+++ /dev/null
@@ -1,192 +0,0 @@
-/*
- *
- * nkf.h - Header file for nkf
- *
- * $Id$
- */
-
-#ifndef NKF_H
-
-/* Wrapper of configurations */
-
-#ifndef MIME_DECODE_DEFAULT
-#define MIME_DECODE_DEFAULT STRICT_MIME
-#endif
-#ifndef X0201_DEFAULT
-#define X0201_DEFAULT TRUE
-#endif
-
-#if DEFAULT_NEWLINE == 0x0D0A
-#define PUT_NEWLINE(func) do {\
- func(0x0D);\
- func(0x0A);\
-} while (0)
-#define OCONV_NEWLINE(func) do {\
- func(0, 0x0D);\
- func(0, 0x0A);\
-} while (0)
-#elif DEFAULT_NEWLINE == 0x0D
-#define PUT_NEWLINE(func) func(0x0D)
-#define OCONV_NEWLINE(func) func(0, 0x0D)
-#else
-#define DEFAULT_NEWLINE 0x0A
-#define PUT_NEWLINE(func) func(0x0A)
-#define OCONV_NEWLINE(func) func(0, 0x0A)
-#endif
-#ifdef HELP_OUTPUT_STDERR
-#define HELP_OUTPUT stderr
-#else
-#define HELP_OUTPUT stdout
-#endif
-
-
-/* Compatibility definitions */
-
-#ifdef nkf_char
-#elif defined(INT_IS_SHORT)
-typedef long nkf_char;
-#define NKF_INT32_C(n) (n##L)
-#else
-typedef int nkf_char;
-#define NKF_INT32_C(n) (n)
-#endif
-
-#if (defined(__TURBOC__) || defined(_MSC_VER) || defined(LSI_C) || (defined(__WATCOMC__) && defined(__386__) && !defined(__LINUX__)) || defined(__MINGW32__) || defined(__EMX__) || defined(__MSDOS__) || defined(__WINDOWS__) || defined(__DOS__) || defined(__OS2__)) && !defined(MSDOS)
-#define MSDOS
-#if (defined(__Win32__) || defined(_WIN32)) && !defined(__WIN32__)
-#define __WIN32__
-#endif
-#endif
-
-#ifdef PERL_XS
-#undef OVERWRITE
-#endif
-
-#ifndef PERL_XS
-#include <stdio.h>
-#endif
-
-#include <stdlib.h>
-#include <string.h>
-
-#if defined(MSDOS) || defined(__OS2__)
-#include <fcntl.h>
-#include <io.h>
-#if defined(_MSC_VER) || defined(__WATCOMC__)
-#define mktemp _mktemp
-#endif
-#endif
-
-#ifdef MSDOS
-#ifdef LSI_C
-#define setbinmode(fp) fsetbin(fp)
-#elif defined(__DJGPP__)
-#include <libc/dosio.h>
-void setbinmode(FILE *fp)
-{
- /* we do not use libc's setmode(), which changes COOKED/RAW mode in device. */
- int fd, m;
- fd = fileno(fp);
- m = (__file_handle_modes[fd] & (~O_TEXT)) | O_BINARY;
- __file_handle_set(fd, m);
-}
-#else /* Microsoft C, Turbo C */
-#define setbinmode(fp) setmode(fileno(fp), O_BINARY)
-#endif
-#else /* UNIX */
-#define setbinmode(fp)
-#endif
-
-#ifdef _IOFBF /* SysV and MSDOS, Windows */
-#define setvbuffer(fp, buf, size) setvbuf(fp, buf, _IOFBF, size)
-#else /* BSD */
-#define setvbuffer(fp, buf, size) setbuffer(fp, buf, size)
-#endif
-
-/*Borland C++ 4.5 EasyWin*/
-#if defined(__TURBOC__) && defined(_Windows) && !defined(__WIN32__) /*Easy Win */
-#define EASYWIN
-#ifndef __WIN16__
-#define __WIN16__
-#endif
-#include <windows.h>
-#endif
-
-#ifdef OVERWRITE
-/* added by satoru@isoternet.org */
-#if defined(__EMX__)
-#include <sys/types.h>
-#endif
-#include <sys/stat.h>
-#if !defined(MSDOS) || defined(__DJGPP__) /* UNIX, djgpp */
-#include <unistd.h>
-#if defined(__WATCOMC__)
-#include <sys/utime.h>
-#else
-#include <utime.h>
-#endif
-#else /* defined(MSDOS) */
-#ifdef __WIN32__
-#ifdef __BORLANDC__ /* BCC32 */
-#include <utime.h>
-#else /* !defined(__BORLANDC__) */
-#include <sys/utime.h>
-#endif /* (__BORLANDC__) */
-#else /* !defined(__WIN32__) */
-#if defined(_MSC_VER) || defined(__MINGW32__) || defined(__WATCOMC__) || defined(__OS2__) || defined(__EMX__) || defined(__IBMC__) || defined(__IBMCPP__) /* VC++, MinGW, Watcom, emx+gcc, IBM VAC++ */
-#include <sys/utime.h>
-#elif defined(__TURBOC__) /* BCC */
-#include <utime.h>
-#elif defined(LSI_C) /* LSI C */
-#endif /* (__WIN32__) */
-#endif
-#endif
-#endif
-
-#if !defined(DEFAULT_CODE_JIS) && !defined(DEFAULT_CODE_SJIS) && \
- !defined(DEFAULT_CODE_WINDOWS_31J) && !defined(DEFAULT_CODE_EUC) && \
- !defined(DEFAULT_CODE_UTF8) && !defined(DEFAULT_CODE_LOCALE)
-#define DEFAULT_CODE_LOCALE
-#endif
-
-#ifdef DEFAULT_CODE_LOCALE
-
-#if defined(__WIN32__) /* not win32 should be posix */
-# ifndef HAVE_LOCALE_H
-# define HAVE_LOCALE_H
-# endif
-#elif defined(__OS2__)
-# undef HAVE_LANGINFO_H /* We do not use kLIBC's langinfo. */
-# ifndef HAVE_LOCALE_H
-# define HAVE_LOCALE_H
-# endif
-#elif defined(MSDOS)
-# ifndef HAVE_LOCALE_H
-# define HAVE_LOCALE_H
-# endif
-#else
-# ifndef HAVE_LANGINFO_H
-# define HAVE_LANGINFO_H
-# endif
-# ifndef HAVE_LOCALE_H
-# define HAVE_LOCALE_H
-# endif
-#endif
-
-#ifdef HAVE_LANGINFO_H
-#include <langinfo.h>
-#endif
-#ifdef HAVE_LOCALE_H
-#include <locale.h>
-#endif
-
-#endif /* DEFAULT_CODE_LOCALE */
-
-#define FALSE 0
-#define TRUE 1
-
-#ifdef WIN32DLL
-#include "nkf32.h"
-#endif
-
-#endif /* NKF_H */
diff --git a/ext/nkf/nkf-utf8/utf8tbl.c b/ext/nkf/nkf-utf8/utf8tbl.c
index 10eec60c5d..e43ad553d6 100644
--- a/ext/nkf/nkf-utf8/utf8tbl.c
+++ b/ext/nkf/nkf-utf8/utf8tbl.c
@@ -1,14 +1,7 @@
-/*
- * utf8tbl.c - Convertion Table for nkf
- *
- * $Id$
- */
-
#include "config.h"
-#include "utf8tbl.h"
#ifdef UTF8_OUTPUT_ENABLE
-static const unsigned short euc_to_utf8_A1[] = {
+const unsigned short euc_to_utf8_A1[] = {
0x3000, 0x3001, 0x3002, 0xFF0C, 0xFF0E, 0x30FB, 0xFF1A,
0xFF1B, 0xFF1F, 0xFF01, 0x309B, 0x309C, 0x00B4, 0xFF40, 0x00A8,
0xFF3E, 0x203E, 0xFF3F, 0x30FD, 0x30FE, 0x309D, 0x309E, 0x3003,
@@ -24,7 +17,7 @@ static const unsigned short euc_to_utf8_A1[] = {
};
/* Microsoft UCS Mapping Compatible */
-static const unsigned short euc_to_utf8_A1_ms[] = {
+const unsigned short euc_to_utf8_A1_ms[] = {
0x3000, 0x3001, 0x3002, 0xFF0C, 0xFF0E, 0x30FB, 0xFF1A,
0xFF1B, 0xFF1F, 0xFF01, 0x309B, 0x309C, 0x00B4, 0xFF40, 0x00A8,
0xFF3E, 0xFFE3, 0xFF3F, 0x30FD, 0x30FE, 0x309D, 0x309E, 0x3003,
@@ -38,7 +31,7 @@ static const unsigned short euc_to_utf8_A1_ms[] = {
0xFF04, 0xFFE0, 0xFFE1, 0xFF05, 0xFF03, 0xFF06, 0xFF0A, 0xFF20,
0x00A7, 0x2606, 0x2605, 0x25CB, 0x25CF, 0x25CE, 0x25C7,
};
-static const unsigned short euc_to_utf8_A2[] = {
+const unsigned short euc_to_utf8_A2[] = {
0x25C6, 0x25A1, 0x25A0, 0x25B3, 0x25B2, 0x25BD, 0x25BC,
0x203B, 0x3012, 0x2192, 0x2190, 0x2191, 0x2193, 0x3013, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -54,7 +47,7 @@ static const unsigned short euc_to_utf8_A2[] = {
};
/* Microsoft UCS Mapping Compatible */
-static const unsigned short euc_to_utf8_A2_ms[] = {
+const unsigned short euc_to_utf8_A2_ms[] = {
0x25C6, 0x25A1, 0x25A0, 0x25B3, 0x25B2, 0x25BD, 0x25BC,
0x203B, 0x3012, 0x2192, 0x2190, 0x2191, 0x2193, 0x3013, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -68,7 +61,7 @@ static const unsigned short euc_to_utf8_A2_ms[] = {
0, 0, 0x212B, 0x2030, 0x266F, 0x266D, 0x266A, 0x2020,
0x2021, 0x00B6, 0, 0, 0, 0, 0x25EF,
};
-static const unsigned short euc_to_utf8_A3[] = {
+const unsigned short euc_to_utf8_A3[] = {
0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0xFF10, 0xFF11, 0xFF12, 0xFF13, 0xFF14, 0xFF15, 0xFF16, 0xFF17,
@@ -82,7 +75,7 @@ static const unsigned short euc_to_utf8_A3[] = {
0xFF50, 0xFF51, 0xFF52, 0xFF53, 0xFF54, 0xFF55, 0xFF56, 0xFF57,
0xFF58, 0xFF59, 0xFF5A, 0, 0, 0, 0,
};
-static const unsigned short euc_to_utf8_A4[] = {
+const unsigned short euc_to_utf8_A4[] = {
0x3041, 0x3042, 0x3043, 0x3044, 0x3045, 0x3046, 0x3047,
0x3048, 0x3049, 0x304A, 0x304B, 0x304C, 0x304D, 0x304E, 0x304F,
0x3050, 0x3051, 0x3052, 0x3053, 0x3054, 0x3055, 0x3056, 0x3057,
@@ -96,7 +89,7 @@ static const unsigned short euc_to_utf8_A4[] = {
0x3090, 0x3091, 0x3092, 0x3093, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0,
};
-static const unsigned short euc_to_utf8_A5[] = {
+const unsigned short euc_to_utf8_A5[] = {
0x30A1, 0x30A2, 0x30A3, 0x30A4, 0x30A5, 0x30A6, 0x30A7,
0x30A8, 0x30A9, 0x30AA, 0x30AB, 0x30AC, 0x30AD, 0x30AE, 0x30AF,
0x30B0, 0x30B1, 0x30B2, 0x30B3, 0x30B4, 0x30B5, 0x30B6, 0x30B7,
@@ -110,7 +103,7 @@ static const unsigned short euc_to_utf8_A5[] = {
0x30F0, 0x30F1, 0x30F2, 0x30F3, 0x30F4, 0x30F5, 0x30F6, 0,
0, 0, 0, 0, 0, 0, 0,
};
-static const unsigned short euc_to_utf8_A6[] = {
+const unsigned short euc_to_utf8_A6[] = {
0x0391, 0x0392, 0x0393, 0x0394, 0x0395, 0x0396, 0x0397,
0x0398, 0x0399, 0x039A, 0x039B, 0x039C, 0x039D, 0x039E, 0x039F,
0x03A0, 0x03A1, 0x03A3, 0x03A4, 0x03A5, 0x03A6, 0x03A7, 0x03A8,
@@ -124,7 +117,7 @@ static const unsigned short euc_to_utf8_A6[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0,
};
-static const unsigned short euc_to_utf8_A7[] = {
+const unsigned short euc_to_utf8_A7[] = {
0x0410, 0x0411, 0x0412, 0x0413, 0x0414, 0x0415, 0x0401,
0x0416, 0x0417, 0x0418, 0x0419, 0x041A, 0x041B, 0x041C, 0x041D,
0x041E, 0x041F, 0x0420, 0x0421, 0x0422, 0x0423, 0x0424, 0x0425,
@@ -138,7 +131,7 @@ static const unsigned short euc_to_utf8_A7[] = {
0x044E, 0x044F, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0,
};
-static const unsigned short euc_to_utf8_A8[] = {
+const unsigned short euc_to_utf8_A8[] = {
0x2500, 0x2502, 0x250C, 0x2510, 0x2518, 0x2514, 0x251C,
0x252C, 0x2524, 0x2534, 0x253C, 0x2501, 0x2503, 0x250F, 0x2513,
0x251B, 0x2517, 0x2523, 0x2533, 0x252B, 0x253B, 0x254B, 0x2520,
@@ -152,7 +145,7 @@ static const unsigned short euc_to_utf8_A8[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0,
};
-static const unsigned short euc_to_utf8_A9[] = {
+const unsigned short euc_to_utf8_A9[] = {
0x2460, 0x2461, 0x2462, 0x2463, 0x2464, 0x2465, 0x2466,
0x2467, 0x2468, 0x2469, 0x246A, 0x246B, 0x246C, 0x246D, 0x246E,
0x246F, 0x2470, 0x2471, 0x2472, 0x2473, 0, 0, 0,
@@ -166,7 +159,7 @@ static const unsigned short euc_to_utf8_A9[] = {
0, 0, 0x2488, 0x2489, 0x248A, 0x248B, 0x248C, 0x248D,
0x248E, 0x248F, 0x2490, 0, 0, 0, 0,
};
-static const unsigned short euc_to_utf8_AA[] = {
+const unsigned short euc_to_utf8_AA[] = {
0x2160, 0x2161, 0x2162, 0x2163, 0x2164, 0x2165, 0x2166,
0x2167, 0x2168, 0x2169, 0x216A, 0x216B, 0, 0, 0,
0, 0, 0, 0, 0, 0x2170, 0x2171, 0x2172,
@@ -180,7 +173,7 @@ static const unsigned short euc_to_utf8_AA[] = {
0x24AF, 0x24B0, 0x24B1, 0x24B2, 0x24B3, 0x24B4, 0x24B5, 0,
0, 0, 0, 0, 0, 0, 0,
};
-static const unsigned short euc_to_utf8_AB[] = {
+const unsigned short euc_to_utf8_AB[] = {
0x339C, 0x339F, 0x339D, 0x33A0, 0x33A4, 0, 0x33A1,
0x33A5, 0x339E, 0x33A2, 0x338E, 0, 0x338F, 0x33C4, 0x3396,
0x3397, 0x2113, 0x3398, 0x33B3, 0x33B2, 0x33B1, 0x33B0, 0x2109,
@@ -194,7 +187,7 @@ static const unsigned short euc_to_utf8_AB[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0x2116, 0x33CD, 0x2121, 0,
};
-static const unsigned short euc_to_utf8_AC[] = {
+const unsigned short euc_to_utf8_AC[] = {
0x2664, 0x2667, 0x2661, 0x2662, 0x2660, 0x2663, 0x2665,
0x2666, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0x3020, 0x260E, 0x3004,
@@ -208,21 +201,7 @@ static const unsigned short euc_to_utf8_AC[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0,
};
-static const unsigned short euc_to_utf8_AC_mac[] = {
- 0x2664, 0x2667, 0x2661, 0x2662, 0x2660, 0x2663, 0x2665,
- 0x2666, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0x3020, 0x260E, 0x3004,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0x261E, 0x261C, 0x261D, 0x261F, 0x21C6, 0x21C4, 0x21C5,
- 0, 0x21E8, 0x21E6, 0x21E7, 0x21E9, 0x2192, 0x2190, 0x2191,
- 0x2193, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 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 euc_to_utf8_AD[] = {
+const unsigned short euc_to_utf8_AD[] = {
0x2460, 0x2461, 0x2462, 0x2463, 0x2464, 0x2465, 0x2466,
0x2467, 0x2468, 0x2469, 0x246A, 0x246B, 0x246C, 0x246D, 0x246E,
0x246F, 0x2470, 0x2471, 0x2472, 0x2473, 0x2160, 0x2161, 0x2162,
@@ -236,21 +215,7 @@ static const unsigned short euc_to_utf8_AD[] = {
0x2252, 0x2261, 0x222B, 0x222E, 0x2211, 0x221A, 0x22A5, 0x2220,
0x221F, 0x22BF, 0x2235, 0x2229, 0x222A, 0, 0x3299,
};
-static const unsigned short euc_to_utf8_AD_mac[] = {
- 0x65E5, 0x6708, 0x706B, 0x6C34, 0x6728, 0x91D1, 0x571F,
- 0x796D, 0x795D, 0x81EA, 0x81F3, 0x3239, 0x547C, 0x3231, 0x8CC7,
- 0x540D, 0x3232, 0x5B66, 0x8CA1, 0x793E, 0x7279, 0x76E3, 0x4F01,
- 0x5354, 0x52B4, 0x2165, 0x2166, 0x2167, 0x2168, 0x2169, 0,
- 0x3349, 0x3314, 0x3322, 0x334D, 0x3318, 0x3327, 0x3303, 0x3336,
- 0x3351, 0x3357, 0x330D, 0x3326, 0x3323, 0x332B, 0x334A, 0x333B,
- 0x339C, 0x339D, 0x339E, 0x338E, 0x338F, 0x33C4, 0x33A1, 0,
- 0, 0, 0, 0, 0, 0, 0, 0x337B,
- 0x301D, 0x301F, 0x2116, 0x33CD, 0x2121, 0x32A4, 0x32A5, 0x32A6,
- 0x32A7, 0x32A8, 0x3231, 0x3232, 0x3239, 0x337E, 0x337D, 0x337C,
- 0x2252, 0x5927, 0x5C0F, 0x32A4, 0x32A5, 0x32A6, 0x32A7, 0x32A8,
- 0x533B, 0x8CA1, 0x512A, 0x52B4, 0x5370, 0x63A7, 0x79D8,
-};
-static const unsigned short euc_to_utf8_AE[] = {
+const unsigned short euc_to_utf8_AE[] = {
0x3349, 0x3322, 0x334D, 0x3314, 0x3316, 0x3305, 0x3333,
0x334E, 0x3303, 0x3336, 0x3318, 0x3315, 0x3327, 0x3351, 0x334A,
0x3339, 0x3357, 0x330D, 0x3342, 0x3323, 0x3326, 0x333B, 0x332B,
@@ -264,7 +229,7 @@ static const unsigned short euc_to_utf8_AE[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0x337F, 0, 0,
};
-static const unsigned short euc_to_utf8_AF[] = {
+const unsigned short euc_to_utf8_AF[] = {
0x222E, 0x221F, 0x22BF, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0x301D, 0x301F, 0,
@@ -278,7 +243,7 @@ static const unsigned short euc_to_utf8_AF[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0,
};
-static const unsigned short euc_to_utf8_B0[] = {
+const unsigned short euc_to_utf8_B0[] = {
0x4E9C, 0x5516, 0x5A03, 0x963F, 0x54C0, 0x611B, 0x6328,
0x59F6, 0x9022, 0x8475, 0x831C, 0x7A50, 0x60AA, 0x63E1, 0x6E25,
0x65ED, 0x8466, 0x82A6, 0x9BF5, 0x6893, 0x5727, 0x65A1, 0x6271,
@@ -292,7 +257,7 @@ static const unsigned short euc_to_utf8_B0[] = {
0x7A32, 0x8328, 0x828B, 0x9C2F, 0x5141, 0x5370, 0x54BD, 0x54E1,
0x56E0, 0x59FB, 0x5F15, 0x98F2, 0x6DEB, 0x80E4, 0x852D,
};
-static const unsigned short euc_to_utf8_B1[] = {
+const unsigned short euc_to_utf8_B1[] = {
0x9662, 0x9670, 0x96A0, 0x97FB, 0x540B, 0x53F3, 0x5B87,
0x70CF, 0x7FBD, 0x8FC2, 0x96E8, 0x536F, 0x9D5C, 0x7ABA, 0x4E11,
0x7893, 0x81FC, 0x6E26, 0x5618, 0x5504, 0x6B1D, 0x851A, 0x9C3B,
@@ -306,7 +271,7 @@ static const unsigned short euc_to_utf8_B1[] = {
0x8276, 0x82D1, 0x8597, 0x9060, 0x925B, 0x9D1B, 0x5869, 0x65BC,
0x6C5A, 0x7525, 0x51F9, 0x592E, 0x5965, 0x5F80, 0x5FDC,
};
-static const unsigned short euc_to_utf8_B2[] = {
+const unsigned short euc_to_utf8_B2[] = {
0x62BC, 0x65FA, 0x6A2A, 0x6B27, 0x6BB4, 0x738B, 0x7FC1,
0x8956, 0x9D2C, 0x9D0E, 0x9EC4, 0x5CA1, 0x6C96, 0x837B, 0x5104,
0x5C4B, 0x61B6, 0x81C6, 0x6876, 0x7261, 0x4E59, 0x4FFA, 0x5378,
@@ -320,7 +285,7 @@ static const unsigned short euc_to_utf8_B2[] = {
0x4ECB, 0x4F1A, 0x89E3, 0x56DE, 0x584A, 0x58CA, 0x5EFB, 0x5FEB,
0x602A, 0x6094, 0x6062, 0x61D0, 0x6212, 0x62D0, 0x6539,
};
-static const unsigned short euc_to_utf8_B3[] = {
+const unsigned short euc_to_utf8_B3[] = {
0x9B41, 0x6666, 0x68B0, 0x6D77, 0x7070, 0x754C, 0x7686,
0x7D75, 0x82A5, 0x87F9, 0x958B, 0x968E, 0x8C9D, 0x51F1, 0x52BE,
0x5916, 0x54B3, 0x5BB3, 0x5D16, 0x6168, 0x6982, 0x6DAF, 0x788D,
@@ -334,7 +299,7 @@ static const unsigned short euc_to_utf8_B3[] = {
0x53F6, 0x691B, 0x6A3A, 0x9784, 0x682A, 0x515C, 0x7AC3, 0x84B2,
0x91DC, 0x938C, 0x565B, 0x9D28, 0x6822, 0x8305, 0x8431,
};
-static const unsigned short euc_to_utf8_B4[] = {
+const unsigned short euc_to_utf8_B4[] = {
0x7CA5, 0x5208, 0x82C5, 0x74E6, 0x4E7E, 0x4F83, 0x51A0,
0x5BD2, 0x520A, 0x52D8, 0x52E7, 0x5DFB, 0x559A, 0x582A, 0x59E6,
0x5B8C, 0x5B98, 0x5BDB, 0x5E72, 0x5E79, 0x60A3, 0x611F, 0x6163,
@@ -348,7 +313,7 @@ static const unsigned short euc_to_utf8_B4[] = {
0x57FA, 0x5947, 0x5B09, 0x5BC4, 0x5C90, 0x5E0C, 0x5E7E, 0x5FCC,
0x63EE, 0x673A, 0x65D7, 0x65E2, 0x671F, 0x68CB, 0x68C4,
};
-static const unsigned short euc_to_utf8_B5[] = {
+const unsigned short euc_to_utf8_B5[] = {
0x6A5F, 0x5E30, 0x6BC5, 0x6C17, 0x6C7D, 0x757F, 0x7948,
0x5B63, 0x7A00, 0x7D00, 0x5FBD, 0x898F, 0x8A18, 0x8CB4, 0x8D77,
0x8ECC, 0x8F1D, 0x98E2, 0x9A0E, 0x9B3C, 0x4E80, 0x507D, 0x5100,
@@ -362,7 +327,7 @@ static const unsigned short euc_to_utf8_B5[] = {
0x5DE8, 0x62D2, 0x62E0, 0x6319, 0x6E20, 0x865A, 0x8A31, 0x8DDD,
0x92F8, 0x6F01, 0x79A6, 0x9B5A, 0x4EA8, 0x4EAB, 0x4EAC,
};
-static const unsigned short euc_to_utf8_B6[] = {
+const unsigned short euc_to_utf8_B6[] = {
0x4F9B, 0x4FA0, 0x50D1, 0x5147, 0x7AF6, 0x5171, 0x51F6,
0x5354, 0x5321, 0x537F, 0x53EB, 0x55AC, 0x5883, 0x5CE1, 0x5F37,
0x5F4A, 0x602F, 0x6050, 0x606D, 0x631F, 0x6559, 0x6A4B, 0x6CC1,
@@ -376,7 +341,7 @@ static const unsigned short euc_to_utf8_B6[] = {
0x99D2, 0x5177, 0x611A, 0x865E, 0x55B0, 0x7A7A, 0x5076, 0x5BD3,
0x9047, 0x9685, 0x4E32, 0x6ADB, 0x91E7, 0x5C51, 0x5C48,
};
-static const unsigned short euc_to_utf8_B7[] = {
+const unsigned short euc_to_utf8_B7[] = {
0x6398, 0x7A9F, 0x6C93, 0x9774, 0x8F61, 0x7AAA, 0x718A,
0x9688, 0x7C82, 0x6817, 0x7E70, 0x6851, 0x936C, 0x52F2, 0x541B,
0x85AB, 0x8A13, 0x7FA4, 0x8ECD, 0x90E1, 0x5366, 0x8888, 0x7941,
@@ -390,7 +355,7 @@ static const unsigned short euc_to_utf8_B7[] = {
0x5039, 0x5026, 0x5065, 0x517C, 0x5238, 0x5263, 0x55A7, 0x570F,
0x5805, 0x5ACC, 0x5EFA, 0x61B2, 0x61F8, 0x62F3, 0x6372,
};
-static const unsigned short euc_to_utf8_B8[] = {
+const unsigned short euc_to_utf8_B8[] = {
0x691C, 0x6A29, 0x727D, 0x72AC, 0x732E, 0x7814, 0x786F,
0x7D79, 0x770C, 0x80A9, 0x898B, 0x8B19, 0x8CE2, 0x8ED2, 0x9063,
0x9375, 0x967A, 0x9855, 0x9A13, 0x9E78, 0x5143, 0x539F, 0x53B3,
@@ -404,7 +369,7 @@ static const unsigned short euc_to_utf8_B8[] = {
0x4E5E, 0x9BC9, 0x4EA4, 0x4F7C, 0x4FAF, 0x5019, 0x5016, 0x5149,
0x516C, 0x529F, 0x52B9, 0x52FE, 0x539A, 0x53E3, 0x5411,
};
-static const unsigned short euc_to_utf8_B9[] = {
+const unsigned short euc_to_utf8_B9[] = {
0x540E, 0x5589, 0x5751, 0x57A2, 0x597D, 0x5B54, 0x5B5D,
0x5B8F, 0x5DE5, 0x5DE7, 0x5DF7, 0x5E78, 0x5E83, 0x5E9A, 0x5EB7,
0x5F18, 0x6052, 0x614C, 0x6297, 0x62D8, 0x63A7, 0x653B, 0x6602,
@@ -418,7 +383,7 @@ static const unsigned short euc_to_utf8_B9[] = {
0x544A, 0x56FD, 0x7A40, 0x9177, 0x9D60, 0x9ED2, 0x7344, 0x6F09,
0x8170, 0x7511, 0x5FFD, 0x60DA, 0x9AA8, 0x72DB, 0x8FBC,
};
-static const unsigned short euc_to_utf8_BA[] = {
+const unsigned short euc_to_utf8_BA[] = {
0x6B64, 0x9803, 0x4ECA, 0x56F0, 0x5764, 0x58BE, 0x5A5A,
0x6068, 0x61C7, 0x660F, 0x6606, 0x6839, 0x68B1, 0x6DF7, 0x75D5,
0x7D3A, 0x826E, 0x9B42, 0x4E9B, 0x4F50, 0x53C9, 0x5506, 0x5D6F,
@@ -432,7 +397,7 @@ static const unsigned short euc_to_utf8_BA[] = {
0x548B, 0x643E, 0x6628, 0x6714, 0x67F5, 0x7A84, 0x7B56, 0x7D22,
0x932F, 0x685C, 0x9BAD, 0x7B39, 0x5319, 0x518A, 0x5237,
};
-static const unsigned short euc_to_utf8_BB[] = {
+const unsigned short euc_to_utf8_BB[] = {
0x5BDF, 0x62F6, 0x64AE, 0x64E6, 0x672D, 0x6BBA, 0x85A9,
0x96D1, 0x7690, 0x9BD6, 0x634C, 0x9306, 0x9BAB, 0x76BF, 0x6652,
0x4E09, 0x5098, 0x53C2, 0x5C71, 0x60E8, 0x6492, 0x6563, 0x685F,
@@ -446,7 +411,7 @@ static const unsigned short euc_to_utf8_BB[] = {
0x8AEE, 0x8CC7, 0x8CDC, 0x96CC, 0x98FC, 0x6B6F, 0x4E8B, 0x4F3C,
0x4F8D, 0x5150, 0x5B57, 0x5BFA, 0x6148, 0x6301, 0x6642,
};
-static const unsigned short euc_to_utf8_BC[] = {
+const unsigned short euc_to_utf8_BC[] = {
0x6B21, 0x6ECB, 0x6CBB, 0x723E, 0x74BD, 0x75D4, 0x78C1,
0x793A, 0x800C, 0x8033, 0x81EA, 0x8494, 0x8F9E, 0x6C50, 0x9E7F,
0x5F0F, 0x8B58, 0x9D2B, 0x7AFA, 0x8EF8, 0x5B8D, 0x96EB, 0x4E03,
@@ -460,7 +425,7 @@ static const unsigned short euc_to_utf8_BC[] = {
0x816B, 0x8DA3, 0x9152, 0x9996, 0x5112, 0x53D7, 0x546A, 0x5BFF,
0x6388, 0x6A39, 0x7DAC, 0x9700, 0x56DA, 0x53CE, 0x5468,
};
-static const unsigned short euc_to_utf8_BD[] = {
+const unsigned short euc_to_utf8_BD[] = {
0x5B97, 0x5C31, 0x5DDE, 0x4FEE, 0x6101, 0x62FE, 0x6D32,
0x79C0, 0x79CB, 0x7D42, 0x7E4D, 0x7FD2, 0x81ED, 0x821F, 0x8490,
0x8846, 0x8972, 0x8B90, 0x8E74, 0x8F2F, 0x9031, 0x914B, 0x916C,
@@ -474,7 +439,7 @@ static const unsigned short euc_to_utf8_BD[] = {
0x7F72, 0x66F8, 0x85AF, 0x85F7, 0x8AF8, 0x52A9, 0x53D9, 0x5973,
0x5E8F, 0x5F90, 0x6055, 0x92E4, 0x9664, 0x50B7, 0x511F,
};
-static const unsigned short euc_to_utf8_BE[] = {
+const unsigned short euc_to_utf8_BE[] = {
0x52DD, 0x5320, 0x5347, 0x53EC, 0x54E8, 0x5546, 0x5531,
0x5617, 0x5968, 0x59BE, 0x5A3C, 0x5BB5, 0x5C06, 0x5C0F, 0x5C11,
0x5C1A, 0x5E84, 0x5E8A, 0x5EE0, 0x5F70, 0x627F, 0x6284, 0x62DB,
@@ -488,7 +453,7 @@ static const unsigned short euc_to_utf8_BE[] = {
0x60C5, 0x64FE, 0x6761, 0x6756, 0x6D44, 0x72B6, 0x7573, 0x7A63,
0x84B8, 0x8B72, 0x91B8, 0x9320, 0x5631, 0x57F4, 0x98FE,
};
-static const unsigned short euc_to_utf8_BF[] = {
+const unsigned short euc_to_utf8_BF[] = {
0x62ED, 0x690D, 0x6B96, 0x71ED, 0x7E54, 0x8077, 0x8272,
0x89E6, 0x98DF, 0x8755, 0x8FB1, 0x5C3B, 0x4F38, 0x4FE1, 0x4FB5,
0x5507, 0x5A20, 0x5BDD, 0x5BE9, 0x5FC3, 0x614E, 0x632F, 0x65B0,
@@ -502,7 +467,7 @@ static const unsigned short euc_to_utf8_BF[] = {
0x745E, 0x9AC4, 0x5D07, 0x5D69, 0x6570, 0x67A2, 0x8DA8, 0x96DB,
0x636E, 0x6749, 0x6919, 0x83C5, 0x9817, 0x96C0, 0x88FE,
};
-static const unsigned short euc_to_utf8_C0[] = {
+const unsigned short euc_to_utf8_C0[] = {
0x6F84, 0x647A, 0x5BF8, 0x4E16, 0x702C, 0x755D, 0x662F,
0x51C4, 0x5236, 0x52E2, 0x59D3, 0x5F81, 0x6027, 0x6210, 0x653F,
0x6574, 0x661F, 0x6674, 0x68F2, 0x6816, 0x6B63, 0x6E05, 0x7272,
@@ -516,7 +481,7 @@ static const unsigned short euc_to_utf8_C0[] = {
0x6247, 0x64B0, 0x6813, 0x6834, 0x6CC9, 0x6D45, 0x6D17, 0x67D3,
0x6F5C, 0x714E, 0x717D, 0x65CB, 0x7A7F, 0x7BAD, 0x7DDA,
};
-static const unsigned short euc_to_utf8_C1[] = {
+const unsigned short euc_to_utf8_C1[] = {
0x7E4A, 0x7FA8, 0x817A, 0x821B, 0x8239, 0x85A6, 0x8A6E,
0x8CCE, 0x8DF5, 0x9078, 0x9077, 0x92AD, 0x9291, 0x9583, 0x9BAE,
0x524D, 0x5584, 0x6F38, 0x7136, 0x5168, 0x7985, 0x7E55, 0x81B3,
@@ -530,7 +495,7 @@ static const unsigned short euc_to_utf8_C1[] = {
0x8349, 0x8358, 0x846C, 0x84BC, 0x85FB, 0x88C5, 0x8D70, 0x9001,
0x906D, 0x9397, 0x971C, 0x9A12, 0x50CF, 0x5897, 0x618E,
};
-static const unsigned short euc_to_utf8_C2[] = {
+const unsigned short euc_to_utf8_C2[] = {
0x81D3, 0x8535, 0x8D08, 0x9020, 0x4FC3, 0x5074, 0x5247,
0x5373, 0x606F, 0x6349, 0x675F, 0x6E2C, 0x8DB3, 0x901F, 0x4FD7,
0x5C5E, 0x8CCA, 0x65CF, 0x7D9A, 0x5352, 0x8896, 0x5176, 0x63C3,
@@ -544,7 +509,7 @@ static const unsigned short euc_to_utf8_C2[] = {
0x5B85, 0x6258, 0x629E, 0x62D3, 0x6CA2, 0x6FEF, 0x7422, 0x8A17,
0x9438, 0x6FC1, 0x8AFE, 0x8338, 0x51E7, 0x86F8, 0x53EA,
};
-static const unsigned short euc_to_utf8_C3[] = {
+const unsigned short euc_to_utf8_C3[] = {
0x53E9, 0x4F46, 0x9054, 0x8FB0, 0x596A, 0x8131, 0x5DFD,
0x7AEA, 0x8FBF, 0x68DA, 0x8C37, 0x72F8, 0x9C48, 0x6A3D, 0x8AB0,
0x4E39, 0x5358, 0x5606, 0x5766, 0x62C5, 0x63A2, 0x65E6, 0x6B4E,
@@ -558,7 +523,7 @@ static const unsigned short euc_to_utf8_C3[] = {
0x8A3B, 0x914E, 0x92F3, 0x99D0, 0x6A17, 0x7026, 0x732A, 0x82E7,
0x8457, 0x8CAF, 0x4E01, 0x5146, 0x51CB, 0x558B, 0x5BF5,
};
-static const unsigned short euc_to_utf8_C4[] = {
+const unsigned short euc_to_utf8_C4[] = {
0x5E16, 0x5E33, 0x5E81, 0x5F14, 0x5F35, 0x5F6B, 0x5FB4,
0x61F2, 0x6311, 0x66A2, 0x671D, 0x6F6E, 0x7252, 0x753A, 0x773A,
0x8074, 0x8139, 0x8178, 0x8776, 0x8ABF, 0x8ADC, 0x8D85, 0x8DF3,
@@ -572,7 +537,7 @@ static const unsigned short euc_to_utf8_C4[] = {
0x608C, 0x62B5, 0x633A, 0x63D0, 0x68AF, 0x6C40, 0x7887, 0x798E,
0x7A0B, 0x7DE0, 0x8247, 0x8A02, 0x8AE6, 0x8E44, 0x9013,
};
-static const unsigned short euc_to_utf8_C5[] = {
+const unsigned short euc_to_utf8_C5[] = {
0x90B8, 0x912D, 0x91D8, 0x9F0E, 0x6CE5, 0x6458, 0x64E2,
0x6575, 0x6EF4, 0x7684, 0x7B1B, 0x9069, 0x93D1, 0x6EBA, 0x54F2,
0x5FB9, 0x64A4, 0x8F4D, 0x8FED, 0x9244, 0x5178, 0x586B, 0x5929,
@@ -586,7 +551,7 @@ static const unsigned short euc_to_utf8_C5[] = {
0x76D7, 0x6DD8, 0x6E6F, 0x6D9B, 0x706F, 0x71C8, 0x5F53, 0x75D8,
0x7977, 0x7B49, 0x7B54, 0x7B52, 0x7CD6, 0x7D71, 0x5230,
};
-static const unsigned short euc_to_utf8_C6[] = {
+const unsigned short euc_to_utf8_C6[] = {
0x8463, 0x8569, 0x85E4, 0x8A0E, 0x8B04, 0x8C46, 0x8E0F,
0x9003, 0x900F, 0x9419, 0x9676, 0x982D, 0x9A30, 0x95D8, 0x50CD,
0x52D5, 0x540C, 0x5802, 0x5C0E, 0x61A7, 0x649E, 0x6D1E, 0x77B3,
@@ -600,7 +565,7 @@ static const unsigned short euc_to_utf8_C6[] = {
0x8EDF, 0x96E3, 0x6C5D, 0x4E8C, 0x5C3C, 0x5F10, 0x8FE9, 0x5302,
0x8CD1, 0x8089, 0x8679, 0x5EFF, 0x65E5, 0x4E73, 0x5165,
};
-static const unsigned short euc_to_utf8_C7[] = {
+const unsigned short euc_to_utf8_C7[] = {
0x5982, 0x5C3F, 0x97EE, 0x4EFB, 0x598A, 0x5FCD, 0x8A8D,
0x6FE1, 0x79B0, 0x7962, 0x5BE7, 0x8471, 0x732B, 0x71B1, 0x5E74,
0x5FF5, 0x637B, 0x649A, 0x71C3, 0x7C98, 0x4E43, 0x5EFC, 0x4E4B,
@@ -614,7 +579,7 @@ static const unsigned short euc_to_utf8_C7[] = {
0x67CF, 0x6CCA, 0x767D, 0x7B94, 0x7C95, 0x8236, 0x8584, 0x8FEB,
0x66DD, 0x6F20, 0x7206, 0x7E1B, 0x83AB, 0x99C1, 0x9EA6,
};
-static const unsigned short euc_to_utf8_C8[] = {
+const unsigned short euc_to_utf8_C8[] = {
0x51FD, 0x7BB1, 0x7872, 0x7BB8, 0x8087, 0x7B48, 0x6AE8,
0x5E61, 0x808C, 0x7551, 0x7560, 0x516B, 0x9262, 0x6E8C, 0x767A,
0x9197, 0x9AEA, 0x4F10, 0x7F70, 0x629C, 0x7B4F, 0x95A5, 0x9CE9,
@@ -628,7 +593,7 @@ static const unsigned short euc_to_utf8_C8[] = {
0x8AB9, 0x8CBB, 0x907F, 0x975E, 0x98DB, 0x6A0B, 0x7C38, 0x5099,
0x5C3E, 0x5FAE, 0x6787, 0x6BD8, 0x7435, 0x7709, 0x7F8E,
};
-static const unsigned short euc_to_utf8_C9[] = {
+const unsigned short euc_to_utf8_C9[] = {
0x9F3B, 0x67CA, 0x7A17, 0x5339, 0x758B, 0x9AED, 0x5F66,
0x819D, 0x83F1, 0x8098, 0x5F3C, 0x5FC5, 0x7562, 0x7B46, 0x903C,
0x6867, 0x59EB, 0x5A9B, 0x7D10, 0x767E, 0x8B2C, 0x4FF5, 0x5F6A,
@@ -642,7 +607,7 @@ static const unsigned short euc_to_utf8_C9[] = {
0x6B66, 0x821E, 0x8461, 0x856A, 0x90E8, 0x5C01, 0x6953, 0x98A8,
0x847A, 0x8557, 0x4F0F, 0x526F, 0x5FA9, 0x5E45, 0x670D,
};
-static const unsigned short euc_to_utf8_CA[] = {
+const unsigned short euc_to_utf8_CA[] = {
0x798F, 0x8179, 0x8907, 0x8986, 0x6DF5, 0x5F17, 0x6255,
0x6CB8, 0x4ECF, 0x7269, 0x9B92, 0x5206, 0x543B, 0x5674, 0x58B3,
0x61A4, 0x626E, 0x711A, 0x596E, 0x7C89, 0x7CDE, 0x7D1B, 0x96F0,
@@ -656,7 +621,7 @@ static const unsigned short euc_to_utf8_CA[] = {
0x4FF8, 0x5305, 0x5446, 0x5831, 0x5949, 0x5B9D, 0x5CF0, 0x5CEF,
0x5D29, 0x5E96, 0x62B1, 0x6367, 0x653E, 0x65B9, 0x670B,
};
-static const unsigned short euc_to_utf8_CB[] = {
+const unsigned short euc_to_utf8_CB[] = {
0x6CD5, 0x6CE1, 0x70F9, 0x7832, 0x7E2B, 0x80DE, 0x82B3,
0x840C, 0x84EC, 0x8702, 0x8912, 0x8A2A, 0x8C4A, 0x90A6, 0x92D2,
0x98FD, 0x9CF3, 0x9D6C, 0x4E4F, 0x4EA1, 0x508D, 0x5256, 0x574A,
@@ -670,7 +635,7 @@ static const unsigned short euc_to_utf8_CB[] = {
0x9C52, 0x685D, 0x4EA6, 0x4FE3, 0x53C8, 0x62B9, 0x672B, 0x6CAB,
0x8FC4, 0x4FAD, 0x7E6D, 0x9EBF, 0x4E07, 0x6162, 0x6E80,
};
-static const unsigned short euc_to_utf8_CC[] = {
+const unsigned short euc_to_utf8_CC[] = {
0x6F2B, 0x8513, 0x5473, 0x672A, 0x9B45, 0x5DF3, 0x7B95,
0x5CAC, 0x5BC6, 0x871C, 0x6E4A, 0x84D1, 0x7A14, 0x8108, 0x5999,
0x7C8D, 0x6C11, 0x7720, 0x52D9, 0x5922, 0x7121, 0x725F, 0x77DB,
@@ -684,7 +649,7 @@ static const unsigned short euc_to_utf8_CC[] = {
0x77E2, 0x5384, 0x5F79, 0x7D04, 0x85AC, 0x8A33, 0x8E8D, 0x9756,
0x67F3, 0x85AE, 0x9453, 0x6109, 0x6108, 0x6CB9, 0x7652,
};
-static const unsigned short euc_to_utf8_CD[] = {
+const unsigned short euc_to_utf8_CD[] = {
0x8AED, 0x8F38, 0x552F, 0x4F51, 0x512A, 0x52C7, 0x53CB,
0x5BA5, 0x5E7D, 0x60A0, 0x6182, 0x63D6, 0x6709, 0x67DA, 0x6E67,
0x6D8C, 0x7336, 0x7337, 0x7531, 0x7950, 0x88D5, 0x8A98, 0x904A,
@@ -698,7 +663,7 @@ static const unsigned short euc_to_utf8_CD[] = {
0x4E71, 0x5375, 0x5D50, 0x6B04, 0x6FEB, 0x85CD, 0x862D, 0x89A7,
0x5229, 0x540F, 0x5C65, 0x674E, 0x68A8, 0x7406, 0x7483,
};
-static const unsigned short euc_to_utf8_CE[] = {
+const unsigned short euc_to_utf8_CE[] = {
0x75E2, 0x88CF, 0x88E1, 0x91CC, 0x96E2, 0x9678, 0x5F8B,
0x7387, 0x7ACB, 0x844E, 0x63A0, 0x7565, 0x5289, 0x6D41, 0x6E9C,
0x7409, 0x7559, 0x786B, 0x7C92, 0x9686, 0x7ADC, 0x9F8D, 0x4FB6,
@@ -712,7 +677,7 @@ static const unsigned short euc_to_utf8_CE[] = {
0x9F62, 0x66A6, 0x6B74, 0x5217, 0x52A3, 0x70C8, 0x88C2, 0x5EC9,
0x604B, 0x6190, 0x6F23, 0x7149, 0x7C3E, 0x7DF4, 0x806F,
};
-static const unsigned short euc_to_utf8_CF[] = {
+const unsigned short euc_to_utf8_CF[] = {
0x84EE, 0x9023, 0x932C, 0x5442, 0x9B6F, 0x6AD3, 0x7089,
0x8CC2, 0x8DEF, 0x9732, 0x52B4, 0x5A41, 0x5ECA, 0x5F04, 0x6717,
0x697C, 0x6994, 0x6D6A, 0x6F0F, 0x7262, 0x72FC, 0x7BED, 0x8001,
@@ -726,7 +691,7 @@ static const unsigned short euc_to_utf8_CF[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0,
};
-static const unsigned short euc_to_utf8_D0[] = {
+const unsigned short euc_to_utf8_D0[] = {
0x5F0C, 0x4E10, 0x4E15, 0x4E2A, 0x4E31, 0x4E36, 0x4E3C,
0x4E3F, 0x4E42, 0x4E56, 0x4E58, 0x4E82, 0x4E85, 0x8C6B, 0x4E8A,
0x8212, 0x5F0D, 0x4E8E, 0x4E9E, 0x4E9F, 0x4EA0, 0x4EA2, 0x4EB0,
@@ -740,7 +705,7 @@ static const unsigned short euc_to_utf8_D0[] = {
0x5043, 0x5047, 0x6703, 0x5055, 0x5050, 0x5048, 0x505A, 0x5056,
0x506C, 0x5078, 0x5080, 0x509A, 0x5085, 0x50B4, 0x50B2,
};
-static const unsigned short euc_to_utf8_D1[] = {
+const unsigned short euc_to_utf8_D1[] = {
0x50C9, 0x50CA, 0x50B3, 0x50C2, 0x50D6, 0x50DE, 0x50E5,
0x50ED, 0x50E3, 0x50EE, 0x50F9, 0x50F5, 0x5109, 0x5101, 0x5102,
0x5116, 0x5115, 0x5114, 0x511A, 0x5121, 0x513A, 0x5137, 0x513C,
@@ -754,7 +719,7 @@ static const unsigned short euc_to_utf8_D1[] = {
0x525E, 0x5254, 0x526A, 0x5274, 0x5269, 0x5273, 0x527F, 0x527D,
0x528D, 0x5294, 0x5292, 0x5271, 0x5288, 0x5291, 0x8FA8,
};
-static const unsigned short euc_to_utf8_D2[] = {
+const unsigned short euc_to_utf8_D2[] = {
0x8FA7, 0x52AC, 0x52AD, 0x52BC, 0x52B5, 0x52C1, 0x52CD,
0x52D7, 0x52DE, 0x52E3, 0x52E6, 0x98ED, 0x52E0, 0x52F3, 0x52F5,
0x52F8, 0x52F9, 0x5306, 0x5308, 0x7538, 0x530D, 0x5310, 0x530F,
@@ -768,7 +733,7 @@ static const unsigned short euc_to_utf8_D2[] = {
0x5492, 0x547B, 0x5480, 0x5476, 0x5484, 0x5490, 0x5486, 0x54C7,
0x54A2, 0x54B8, 0x54A5, 0x54AC, 0x54C4, 0x54C8, 0x54A8,
};
-static const unsigned short euc_to_utf8_D3[] = {
+const unsigned short euc_to_utf8_D3[] = {
0x54AB, 0x54C2, 0x54A4, 0x54BE, 0x54BC, 0x54D8, 0x54E5,
0x54E6, 0x550F, 0x5514, 0x54FD, 0x54EE, 0x54ED, 0x54FA, 0x54E2,
0x5539, 0x5540, 0x5563, 0x554C, 0x552E, 0x555C, 0x5545, 0x5556,
@@ -782,7 +747,7 @@ static const unsigned short euc_to_utf8_D3[] = {
0x56BC, 0x56C1, 0x56C3, 0x56C0, 0x56C8, 0x56CE, 0x56D1, 0x56D3,
0x56D7, 0x56EE, 0x56F9, 0x5700, 0x56FF, 0x5704, 0x5709,
};
-static const unsigned short euc_to_utf8_D4[] = {
+const unsigned short euc_to_utf8_D4[] = {
0x5708, 0x570B, 0x570D, 0x5713, 0x5718, 0x5716, 0x55C7,
0x571C, 0x5726, 0x5737, 0x5738, 0x574E, 0x573B, 0x5740, 0x574F,
0x5769, 0x57C0, 0x5788, 0x5761, 0x577F, 0x5789, 0x5793, 0x57A0,
@@ -796,7 +761,7 @@ static const unsigned short euc_to_utf8_D4[] = {
0x592D, 0x5932, 0x5938, 0x593E, 0x7AD2, 0x5955, 0x5950, 0x594E,
0x595A, 0x5958, 0x5962, 0x5960, 0x5967, 0x596C, 0x5969,
};
-static const unsigned short euc_to_utf8_D5[] = {
+const unsigned short euc_to_utf8_D5[] = {
0x5978, 0x5981, 0x599D, 0x4F5E, 0x4FAB, 0x59A3, 0x59B2,
0x59C6, 0x59E8, 0x59DC, 0x598D, 0x59D9, 0x59DA, 0x5A25, 0x5A1F,
0x5A11, 0x5A1C, 0x5A09, 0x5A1A, 0x5A40, 0x5A6C, 0x5A49, 0x5A35,
@@ -810,7 +775,7 @@ static const unsigned short euc_to_utf8_D5[] = {
0x5BF3, 0x5C05, 0x5C07, 0x5C08, 0x5C0D, 0x5C13, 0x5C20, 0x5C22,
0x5C28, 0x5C38, 0x5C39, 0x5C41, 0x5C46, 0x5C4E, 0x5C53,
};
-static const unsigned short euc_to_utf8_D6[] = {
+const unsigned short euc_to_utf8_D6[] = {
0x5C50, 0x5C4F, 0x5B71, 0x5C6C, 0x5C6E, 0x4E62, 0x5C76,
0x5C79, 0x5C8C, 0x5C91, 0x5C94, 0x599B, 0x5CAB, 0x5CBB, 0x5CB6,
0x5CBC, 0x5CB7, 0x5CC5, 0x5CBE, 0x5CC7, 0x5CD9, 0x5CE9, 0x5CFD,
@@ -824,7 +789,7 @@ static const unsigned short euc_to_utf8_D6[] = {
0x5E5F, 0x5E62, 0x5E64, 0x5E47, 0x5E75, 0x5E76, 0x5E7A, 0x9EBC,
0x5E7F, 0x5EA0, 0x5EC1, 0x5EC2, 0x5EC8, 0x5ED0, 0x5ECF,
};
-static const unsigned short euc_to_utf8_D7[] = {
+const unsigned short euc_to_utf8_D7[] = {
0x5ED6, 0x5EE3, 0x5EDD, 0x5EDA, 0x5EDB, 0x5EE2, 0x5EE1,
0x5EE8, 0x5EE9, 0x5EEC, 0x5EF1, 0x5EF3, 0x5EF0, 0x5EF4, 0x5EF8,
0x5EFE, 0x5F03, 0x5F09, 0x5F5D, 0x5F5C, 0x5F0B, 0x5F11, 0x5F16,
@@ -838,7 +803,7 @@ static const unsigned short euc_to_utf8_D7[] = {
0x604A, 0x6046, 0x604D, 0x6063, 0x6043, 0x6064, 0x6042, 0x606C,
0x606B, 0x6059, 0x6081, 0x608D, 0x60E7, 0x6083, 0x609A,
};
-static const unsigned short euc_to_utf8_D8[] = {
+const unsigned short euc_to_utf8_D8[] = {
0x6084, 0x609B, 0x6096, 0x6097, 0x6092, 0x60A7, 0x608B,
0x60E1, 0x60B8, 0x60E0, 0x60D3, 0x60B4, 0x5FF0, 0x60BD, 0x60C6,
0x60B5, 0x60D8, 0x614D, 0x6115, 0x6106, 0x60F6, 0x60F7, 0x6100,
@@ -852,7 +817,7 @@ static const unsigned short euc_to_utf8_D8[] = {
0x61E3, 0x61F6, 0x61FA, 0x61F4, 0x61FF, 0x61FD, 0x61FC, 0x61FE,
0x6200, 0x6208, 0x6209, 0x620D, 0x620C, 0x6214, 0x621B,
};
-static const unsigned short euc_to_utf8_D9[] = {
+const unsigned short euc_to_utf8_D9[] = {
0x621E, 0x6221, 0x622A, 0x622E, 0x6230, 0x6232, 0x6233,
0x6241, 0x624E, 0x625E, 0x6263, 0x625B, 0x6260, 0x6268, 0x627C,
0x6282, 0x6289, 0x627E, 0x6292, 0x6293, 0x6296, 0x62D4, 0x6283,
@@ -866,7 +831,7 @@ static const unsigned short euc_to_utf8_D9[] = {
0x651D, 0x6417, 0x6428, 0x640F, 0x6467, 0x646F, 0x6476, 0x644E,
0x652A, 0x6495, 0x6493, 0x64A5, 0x64A9, 0x6488, 0x64BC,
};
-static const unsigned short euc_to_utf8_DA[] = {
+const unsigned short euc_to_utf8_DA[] = {
0x64DA, 0x64D2, 0x64C5, 0x64C7, 0x64BB, 0x64D8, 0x64C2,
0x64F1, 0x64E7, 0x8209, 0x64E0, 0x64E1, 0x62AC, 0x64E3, 0x64EF,
0x652C, 0x64F6, 0x64F4, 0x64F2, 0x64FA, 0x6500, 0x64FD, 0x6518,
@@ -880,7 +845,7 @@ static const unsigned short euc_to_utf8_DA[] = {
0x665F, 0x6662, 0x6670, 0x6683, 0x6688, 0x668E, 0x6689, 0x6684,
0x6698, 0x669D, 0x66C1, 0x66B9, 0x66C9, 0x66BE, 0x66BC,
};
-static const unsigned short euc_to_utf8_DB[] = {
+const unsigned short euc_to_utf8_DB[] = {
0x66C4, 0x66B8, 0x66D6, 0x66DA, 0x66E0, 0x663F, 0x66E6,
0x66E9, 0x66F0, 0x66F5, 0x66F7, 0x670F, 0x6716, 0x671E, 0x6726,
0x6727, 0x9738, 0x672E, 0x673F, 0x6736, 0x6741, 0x6738, 0x6737,
@@ -894,7 +859,7 @@ static const unsigned short euc_to_utf8_DB[] = {
0x68B5, 0x68A0, 0x68BA, 0x690F, 0x688D, 0x687E, 0x6901, 0x68CA,
0x6908, 0x68D8, 0x6922, 0x6926, 0x68E1, 0x690C, 0x68CD,
};
-static const unsigned short euc_to_utf8_DC[] = {
+const unsigned short euc_to_utf8_DC[] = {
0x68D4, 0x68E7, 0x68D5, 0x6936, 0x6912, 0x6904, 0x68D7,
0x68E3, 0x6925, 0x68F9, 0x68E0, 0x68EF, 0x6928, 0x692A, 0x691A,
0x6923, 0x6921, 0x68C6, 0x6979, 0x6977, 0x695C, 0x6978, 0x696B,
@@ -908,7 +873,7 @@ static const unsigned short euc_to_utf8_DC[] = {
0x6A36, 0x6A78, 0x6A47, 0x6A62, 0x6A59, 0x6A66, 0x6A48, 0x6A38,
0x6A22, 0x6A90, 0x6A8D, 0x6AA0, 0x6A84, 0x6AA2, 0x6AA3,
};
-static const unsigned short euc_to_utf8_DD[] = {
+const unsigned short euc_to_utf8_DD[] = {
0x6A97, 0x8617, 0x6ABB, 0x6AC3, 0x6AC2, 0x6AB8, 0x6AB3,
0x6AAC, 0x6ADE, 0x6AD1, 0x6ADF, 0x6AAA, 0x6ADA, 0x6AEA, 0x6AFB,
0x6B05, 0x8616, 0x6AFA, 0x6B12, 0x6B16, 0x9B31, 0x6B1F, 0x6B38,
@@ -922,7 +887,7 @@ static const unsigned short euc_to_utf8_DD[] = {
0x6C7E, 0x6C68, 0x6C73, 0x6C92, 0x6C90, 0x6CC4, 0x6CF1, 0x6CD3,
0x6CBD, 0x6CD7, 0x6CC5, 0x6CDD, 0x6CAE, 0x6CB1, 0x6CBE,
};
-static const unsigned short euc_to_utf8_DE[] = {
+const unsigned short euc_to_utf8_DE[] = {
0x6CBA, 0x6CDB, 0x6CEF, 0x6CD9, 0x6CEA, 0x6D1F, 0x884D,
0x6D36, 0x6D2B, 0x6D3D, 0x6D38, 0x6D19, 0x6D35, 0x6D33, 0x6D12,
0x6D0C, 0x6D63, 0x6D93, 0x6D64, 0x6D5A, 0x6D79, 0x6D59, 0x6D8E,
@@ -936,7 +901,7 @@ static const unsigned short euc_to_utf8_DE[] = {
0x6EA5, 0x6EC2, 0x6E9F, 0x6F41, 0x6F11, 0x704C, 0x6EEC, 0x6EF8,
0x6EFE, 0x6F3F, 0x6EF2, 0x6F31, 0x6EEF, 0x6F32, 0x6ECC,
};
-static const unsigned short euc_to_utf8_DF[] = {
+const unsigned short euc_to_utf8_DF[] = {
0x6F3E, 0x6F13, 0x6EF7, 0x6F86, 0x6F7A, 0x6F78, 0x6F81,
0x6F80, 0x6F6F, 0x6F5B, 0x6FF3, 0x6F6D, 0x6F82, 0x6F7C, 0x6F58,
0x6F8E, 0x6F91, 0x6FC2, 0x6F66, 0x6FB3, 0x6FA3, 0x6FA1, 0x6FA4,
@@ -950,7 +915,7 @@ static const unsigned short euc_to_utf8_DF[] = {
0x7195, 0x71A8, 0x71AC, 0x71D7, 0x71B9, 0x71BE, 0x71D2, 0x71C9,
0x71D4, 0x71CE, 0x71E0, 0x71EC, 0x71E7, 0x71F5, 0x71FC,
};
-static const unsigned short euc_to_utf8_E0[] = {
+const unsigned short euc_to_utf8_E0[] = {
0x71F9, 0x71FF, 0x720D, 0x7210, 0x721B, 0x7228, 0x722D,
0x722C, 0x7230, 0x7232, 0x723B, 0x723C, 0x723F, 0x7240, 0x7246,
0x724B, 0x7258, 0x7274, 0x727E, 0x7282, 0x7281, 0x7287, 0x7292,
@@ -964,7 +929,7 @@ static const unsigned short euc_to_utf8_E0[] = {
0x7441, 0x745C, 0x7469, 0x7470, 0x7463, 0x746A, 0x7476, 0x747E,
0x748B, 0x749E, 0x74A7, 0x74CA, 0x74CF, 0x74D4, 0x73F1,
};
-static const unsigned short euc_to_utf8_E1[] = {
+const unsigned short euc_to_utf8_E1[] = {
0x74E0, 0x74E3, 0x74E7, 0x74E9, 0x74EE, 0x74F2, 0x74F0,
0x74F1, 0x74F8, 0x74F7, 0x7504, 0x7503, 0x7505, 0x750C, 0x750E,
0x750D, 0x7515, 0x7513, 0x751E, 0x7526, 0x752C, 0x753C, 0x7544,
@@ -978,7 +943,7 @@ static const unsigned short euc_to_utf8_E1[] = {
0x7630, 0x763B, 0x7647, 0x7648, 0x7646, 0x765C, 0x7658, 0x7661,
0x7662, 0x7668, 0x7669, 0x766A, 0x7667, 0x766C, 0x7670,
};
-static const unsigned short euc_to_utf8_E2[] = {
+const unsigned short euc_to_utf8_E2[] = {
0x7672, 0x7676, 0x7678, 0x767C, 0x7680, 0x7683, 0x7688,
0x768B, 0x768E, 0x7696, 0x7693, 0x7699, 0x769A, 0x76B0, 0x76B4,
0x76B8, 0x76B9, 0x76BA, 0x76C2, 0x76CD, 0x76D6, 0x76D2, 0x76DE,
@@ -992,7 +957,7 @@ static const unsigned short euc_to_utf8_E2[] = {
0x789A, 0x788C, 0x78A3, 0x78B5, 0x78AA, 0x78AF, 0x78D1, 0x78C6,
0x78CB, 0x78D4, 0x78BE, 0x78BC, 0x78C5, 0x78CA, 0x78EC,
};
-static const unsigned short euc_to_utf8_E3[] = {
+const unsigned short euc_to_utf8_E3[] = {
0x78E7, 0x78DA, 0x78FD, 0x78F4, 0x7907, 0x7912, 0x7911,
0x7919, 0x792C, 0x792B, 0x7940, 0x7960, 0x7957, 0x795F, 0x795A,
0x7955, 0x7953, 0x797A, 0x797F, 0x798A, 0x799D, 0x79A7, 0x9F4B,
@@ -1006,7 +971,7 @@ static const unsigned short euc_to_utf8_E3[] = {
0x7AE6, 0x7AED, 0x7AF0, 0x7B02, 0x7B0F, 0x7B0A, 0x7B06, 0x7B33,
0x7B18, 0x7B19, 0x7B1E, 0x7B35, 0x7B28, 0x7B36, 0x7B50,
};
-static const unsigned short euc_to_utf8_E4[] = {
+const unsigned short euc_to_utf8_E4[] = {
0x7B7A, 0x7B04, 0x7B4D, 0x7B0B, 0x7B4C, 0x7B45, 0x7B75,
0x7B65, 0x7B74, 0x7B67, 0x7B70, 0x7B71, 0x7B6C, 0x7B6E, 0x7B9D,
0x7B98, 0x7B9F, 0x7B8D, 0x7B9C, 0x7B9A, 0x7B8B, 0x7B92, 0x7B8F,
@@ -1020,7 +985,7 @@ static const unsigned short euc_to_utf8_E4[] = {
0x7CBD, 0x7CC0, 0x7CC5, 0x7CC2, 0x7CD8, 0x7CD2, 0x7CDC, 0x7CE2,
0x9B3B, 0x7CEF, 0x7CF2, 0x7CF4, 0x7CF6, 0x7CFA, 0x7D06,
};
-static const unsigned short euc_to_utf8_E5[] = {
+const unsigned short euc_to_utf8_E5[] = {
0x7D02, 0x7D1C, 0x7D15, 0x7D0A, 0x7D45, 0x7D4B, 0x7D2E,
0x7D32, 0x7D3F, 0x7D35, 0x7D46, 0x7D73, 0x7D56, 0x7D4E, 0x7D72,
0x7D68, 0x7D6E, 0x7D4F, 0x7D63, 0x7D93, 0x7D89, 0x7D5B, 0x7D8F,
@@ -1034,7 +999,7 @@ static const unsigned short euc_to_utf8_E5[] = {
0x8FAE, 0x7E7F, 0x7E88, 0x7E89, 0x7E8C, 0x7E92, 0x7E90, 0x7E93,
0x7E94, 0x7E96, 0x7E8E, 0x7E9B, 0x7E9C, 0x7F38, 0x7F3A,
};
-static const unsigned short euc_to_utf8_E6[] = {
+const unsigned short euc_to_utf8_E6[] = {
0x7F45, 0x7F4C, 0x7F4D, 0x7F4E, 0x7F50, 0x7F51, 0x7F55,
0x7F54, 0x7F58, 0x7F5F, 0x7F60, 0x7F68, 0x7F69, 0x7F67, 0x7F78,
0x7F82, 0x7F86, 0x7F83, 0x7F88, 0x7F87, 0x7F8C, 0x7F94, 0x7F9E,
@@ -1048,7 +1013,7 @@ static const unsigned short euc_to_utf8_E6[] = {
0x80DB, 0x80E5, 0x80D9, 0x80DD, 0x80C4, 0x80DA, 0x80D6, 0x8109,
0x80EF, 0x80F1, 0x811B, 0x8129, 0x8123, 0x812F, 0x814B,
};
-static const unsigned short euc_to_utf8_E7[] = {
+const unsigned short euc_to_utf8_E7[] = {
0x968B, 0x8146, 0x813E, 0x8153, 0x8151, 0x80FC, 0x8171,
0x816E, 0x8165, 0x8166, 0x8174, 0x8183, 0x8188, 0x818A, 0x8180,
0x8182, 0x81A0, 0x8195, 0x81A4, 0x81A3, 0x815F, 0x8193, 0x81A9,
@@ -1062,7 +1027,7 @@ static const unsigned short euc_to_utf8_E7[] = {
0x82E3, 0x82DF, 0x82D2, 0x82F4, 0x82F3, 0x82FA, 0x8393, 0x8303,
0x82FB, 0x82F9, 0x82DE, 0x8306, 0x82DC, 0x8309, 0x82D9,
};
-static const unsigned short euc_to_utf8_E8[] = {
+const unsigned short euc_to_utf8_E8[] = {
0x8335, 0x8334, 0x8316, 0x8332, 0x8331, 0x8340, 0x8339,
0x8350, 0x8345, 0x832F, 0x832B, 0x8317, 0x8318, 0x8385, 0x839A,
0x83AA, 0x839F, 0x83A2, 0x8396, 0x8323, 0x838E, 0x8387, 0x838A,
@@ -1076,7 +1041,7 @@ static const unsigned short euc_to_utf8_E8[] = {
0x84A1, 0x8521, 0x84FF, 0x84F4, 0x8517, 0x8518, 0x852C, 0x851F,
0x8515, 0x8514, 0x84FC, 0x8540, 0x8563, 0x8558, 0x8548,
};
-static const unsigned short euc_to_utf8_E9[] = {
+const unsigned short euc_to_utf8_E9[] = {
0x8541, 0x8602, 0x854B, 0x8555, 0x8580, 0x85A4, 0x8588,
0x8591, 0x858A, 0x85A8, 0x856D, 0x8594, 0x859B, 0x85EA, 0x8587,
0x859C, 0x8577, 0x857E, 0x8590, 0x85C9, 0x85BA, 0x85CF, 0x85B9,
@@ -1090,7 +1055,7 @@ static const unsigned short euc_to_utf8_E9[] = {
0x8737, 0x873B, 0x8725, 0x8729, 0x871A, 0x8760, 0x875F, 0x8778,
0x874C, 0x874E, 0x8774, 0x8757, 0x8768, 0x876E, 0x8759,
};
-static const unsigned short euc_to_utf8_EA[] = {
+const unsigned short euc_to_utf8_EA[] = {
0x8753, 0x8763, 0x876A, 0x8805, 0x87A2, 0x879F, 0x8782,
0x87AF, 0x87CB, 0x87BD, 0x87C0, 0x87D0, 0x96D6, 0x87AB, 0x87C4,
0x87B3, 0x87C7, 0x87C6, 0x87BB, 0x87EF, 0x87F2, 0x87E0, 0x880F,
@@ -1104,7 +1069,7 @@ static const unsigned short euc_to_utf8_EA[] = {
0x8913, 0x8943, 0x891E, 0x8925, 0x892A, 0x892B, 0x8941, 0x8944,
0x893B, 0x8936, 0x8938, 0x894C, 0x891D, 0x8960, 0x895E,
};
-static const unsigned short euc_to_utf8_EB[] = {
+const unsigned short euc_to_utf8_EB[] = {
0x8966, 0x8964, 0x896D, 0x896A, 0x896F, 0x8974, 0x8977,
0x897E, 0x8983, 0x8988, 0x898A, 0x8993, 0x8998, 0x89A1, 0x89A9,
0x89A6, 0x89AC, 0x89AF, 0x89B2, 0x89BA, 0x89BD, 0x89BF, 0x89C0,
@@ -1118,7 +1083,7 @@ static const unsigned short euc_to_utf8_EB[] = {
0x8B33, 0x97AB, 0x8B26, 0x8B2B, 0x8B3E, 0x8B28, 0x8B41, 0x8B4C,
0x8B4F, 0x8B4E, 0x8B49, 0x8B56, 0x8B5B, 0x8B5A, 0x8B6B,
};
-static const unsigned short euc_to_utf8_EC[] = {
+const unsigned short euc_to_utf8_EC[] = {
0x8B5F, 0x8B6C, 0x8B6F, 0x8B74, 0x8B7D, 0x8B80, 0x8B8C,
0x8B8E, 0x8B92, 0x8B93, 0x8B96, 0x8B99, 0x8B9A, 0x8C3A, 0x8C41,
0x8C3F, 0x8C48, 0x8C4C, 0x8C4E, 0x8C50, 0x8C55, 0x8C62, 0x8C6C,
@@ -1132,7 +1097,7 @@ static const unsigned short euc_to_utf8_EC[] = {
0x8DDF, 0x8DE3, 0x8DFC, 0x8E08, 0x8E09, 0x8DFF, 0x8E1D, 0x8E1E,
0x8E10, 0x8E1F, 0x8E42, 0x8E35, 0x8E30, 0x8E34, 0x8E4A,
};
-static const unsigned short euc_to_utf8_ED[] = {
+const unsigned short euc_to_utf8_ED[] = {
0x8E47, 0x8E49, 0x8E4C, 0x8E50, 0x8E48, 0x8E59, 0x8E64,
0x8E60, 0x8E2A, 0x8E63, 0x8E55, 0x8E76, 0x8E72, 0x8E7C, 0x8E81,
0x8E87, 0x8E85, 0x8E84, 0x8E8B, 0x8E8A, 0x8E93, 0x8E91, 0x8E94,
@@ -1146,7 +1111,7 @@ static const unsigned short euc_to_utf8_ED[] = {
0x9005, 0x8FF9, 0x8FFA, 0x9011, 0x9015, 0x9021, 0x900D, 0x901E,
0x9016, 0x900B, 0x9027, 0x9036, 0x9035, 0x9039, 0x8FF8,
};
-static const unsigned short euc_to_utf8_EE[] = {
+const unsigned short euc_to_utf8_EE[] = {
0x904F, 0x9050, 0x9051, 0x9052, 0x900E, 0x9049, 0x903E,
0x9056, 0x9058, 0x905E, 0x9068, 0x906F, 0x9076, 0x96A8, 0x9072,
0x9082, 0x907D, 0x9081, 0x9080, 0x908A, 0x9089, 0x908F, 0x90A8,
@@ -1160,7 +1125,7 @@ static const unsigned short euc_to_utf8_EE[] = {
0x924B, 0x9250, 0x929C, 0x9296, 0x9293, 0x929B, 0x925A, 0x92CF,
0x92B9, 0x92B7, 0x92E9, 0x930F, 0x92FA, 0x9344, 0x932E,
};
-static const unsigned short euc_to_utf8_EF[] = {
+const unsigned short euc_to_utf8_EF[] = {
0x9319, 0x9322, 0x931A, 0x9323, 0x933A, 0x9335, 0x933B,
0x935C, 0x9360, 0x937C, 0x936E, 0x9356, 0x93B0, 0x93AC, 0x93AD,
0x9394, 0x93B9, 0x93D6, 0x93D7, 0x93E8, 0x93E5, 0x93D8, 0x93C3,
@@ -1174,7 +1139,7 @@ static const unsigned short euc_to_utf8_EF[] = {
0x95DC, 0x95E1, 0x95E5, 0x95E2, 0x9621, 0x9628, 0x962E, 0x962F,
0x9642, 0x964C, 0x964F, 0x964B, 0x9677, 0x965C, 0x965E,
};
-static const unsigned short euc_to_utf8_F0[] = {
+const unsigned short euc_to_utf8_F0[] = {
0x965D, 0x965F, 0x9666, 0x9672, 0x966C, 0x968D, 0x9698,
0x9695, 0x9697, 0x96AA, 0x96A7, 0x96B1, 0x96B2, 0x96B0, 0x96B4,
0x96B6, 0x96B8, 0x96B9, 0x96CE, 0x96CB, 0x96C9, 0x96CD, 0x894D,
@@ -1188,7 +1153,7 @@ static const unsigned short euc_to_utf8_F0[] = {
0x97F6, 0x97F5, 0x980F, 0x980C, 0x9838, 0x9824, 0x9821, 0x9837,
0x983D, 0x9846, 0x984F, 0x984B, 0x986B, 0x986F, 0x9870,
};
-static const unsigned short euc_to_utf8_F1[] = {
+const unsigned short euc_to_utf8_F1[] = {
0x9871, 0x9874, 0x9873, 0x98AA, 0x98AF, 0x98B1, 0x98B6,
0x98C4, 0x98C3, 0x98C6, 0x98E9, 0x98EB, 0x9903, 0x9909, 0x9912,
0x9914, 0x9918, 0x9921, 0x991D, 0x991E, 0x9924, 0x9920, 0x992C,
@@ -1202,7 +1167,7 @@ static const unsigned short euc_to_utf8_F1[] = {
0x9ACF, 0x9AD1, 0x9AD3, 0x9AD4, 0x9ADE, 0x9ADF, 0x9AE2, 0x9AE3,
0x9AE6, 0x9AEF, 0x9AEB, 0x9AEE, 0x9AF4, 0x9AF1, 0x9AF7,
};
-static const unsigned short euc_to_utf8_F2[] = {
+const unsigned short euc_to_utf8_F2[] = {
0x9AFB, 0x9B06, 0x9B18, 0x9B1A, 0x9B1F, 0x9B22, 0x9B23,
0x9B25, 0x9B27, 0x9B28, 0x9B29, 0x9B2A, 0x9B2E, 0x9B2F, 0x9B32,
0x9B44, 0x9B43, 0x9B4F, 0x9B4D, 0x9B4E, 0x9B51, 0x9B58, 0x9B74,
@@ -1216,7 +1181,7 @@ static const unsigned short euc_to_utf8_F2[] = {
0x9D03, 0x9D06, 0x9D2A, 0x9D26, 0x9DAF, 0x9D23, 0x9D1F, 0x9D44,
0x9D15, 0x9D12, 0x9D41, 0x9D3F, 0x9D3E, 0x9D46, 0x9D48,
};
-static const unsigned short euc_to_utf8_F3[] = {
+const unsigned short euc_to_utf8_F3[] = {
0x9D5D, 0x9D5E, 0x9D64, 0x9D51, 0x9D50, 0x9D59, 0x9D72,
0x9D89, 0x9D87, 0x9DAB, 0x9D6F, 0x9D7A, 0x9D9A, 0x9DA4, 0x9DA9,
0x9DB2, 0x9DC4, 0x9DC1, 0x9DBB, 0x9DB8, 0x9DBA, 0x9DC6, 0x9DCF,
@@ -1230,7 +1195,7 @@ static const unsigned short euc_to_utf8_F3[] = {
0x9F54, 0x9F63, 0x9F5F, 0x9F60, 0x9F61, 0x9F66, 0x9F67, 0x9F6C,
0x9F6A, 0x9F77, 0x9F72, 0x9F76, 0x9F95, 0x9F9C, 0x9FA0,
};
-static const unsigned short euc_to_utf8_F4[] = {
+const unsigned short euc_to_utf8_F4[] = {
0x582F, 0x69C7, 0x9059, 0x7464, 0x51DC, 0x7199, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -1244,7 +1209,7 @@ static const unsigned short euc_to_utf8_F4[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0,
};
-static const unsigned short euc_to_utf8_F5[] = {
+const unsigned short euc_to_utf8_F5[] = {
0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0xFE33, 0, 0, 0, 0, 0,
@@ -1258,7 +1223,7 @@ static const unsigned short euc_to_utf8_F5[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0,
};
-static const unsigned short euc_to_utf8_F9[] = {
+const unsigned short euc_to_utf8_F9[] = {
0x7E8A, 0x891C, 0x9348, 0x9288, 0x84DC, 0x4FC9, 0x70BB,
0x6631, 0x68C8, 0x92F9, 0x66FB, 0x5F45, 0x4E28, 0x4EE1, 0x4EFC,
0x4F00, 0x4F03, 0x4F39, 0x4F56, 0x4F92, 0x4F8A, 0x4F9A, 0x4F94,
@@ -1272,7 +1237,7 @@ static const unsigned short euc_to_utf8_F9[] = {
0x5CA6, 0x5CBA, 0x5CF5, 0x5D27, 0x5D53, 0xFA11, 0x5D42, 0x5D6D,
0x5DB8, 0x5DB9, 0x5DD0, 0x5F21, 0x5F34, 0x5F67, 0x5FB7,
};
-static const unsigned short euc_to_utf8_FA[] = {
+const unsigned short euc_to_utf8_FA[] = {
0x5FDE, 0x605D, 0x6085, 0x608A, 0x60DE, 0x60D5, 0x6120,
0x60F2, 0x6111, 0x6137, 0x6130, 0x6198, 0x6213, 0x62A6, 0x63F5,
0x6460, 0x649D, 0x64CE, 0x654E, 0x6600, 0x6615, 0x663B, 0x6609,
@@ -1286,7 +1251,7 @@ static const unsigned short euc_to_utf8_FA[] = {
0x6FF5, 0x7005, 0x7007, 0x7028, 0x7085, 0x70AB, 0x710F, 0x7104,
0x715C, 0x7146, 0x7147, 0xFA15, 0x71C1, 0x71FE, 0x72B1,
};
-static const unsigned short euc_to_utf8_FB[] = {
+const unsigned short euc_to_utf8_FB[] = {
0x72BE, 0x7324, 0xFA16, 0x7377, 0x73BD, 0x73C9, 0x73D6,
0x73E3, 0x73D2, 0x7407, 0x73F5, 0x7426, 0x742A, 0x7429, 0x742E,
0x7462, 0x7489, 0x749F, 0x7501, 0x756F, 0x7682, 0x769C, 0x769E,
@@ -1300,7 +1265,7 @@ static const unsigned short euc_to_utf8_FB[] = {
0x8B7F, 0x8CF0, 0x8CF4, 0x8D12, 0x8D76, 0xFA23, 0x8ECF, 0xFA24,
0xFA25, 0x9067, 0x90DE, 0xFA26, 0x9115, 0x9127, 0x91DA,
};
-static const unsigned short euc_to_utf8_FC[] = {
+const unsigned short euc_to_utf8_FC[] = {
0x91D7, 0x91DE, 0x91ED, 0x91EE, 0x91E4, 0x91E5, 0x9206,
0x9210, 0x920A, 0x923A, 0x9240, 0x923C, 0x924E, 0x9259, 0x9251,
0x9239, 0x9267, 0x92A7, 0x9277, 0x9278, 0x92E7, 0x92D7, 0x92D9,
@@ -1316,7 +1281,7 @@ static const unsigned short euc_to_utf8_FC[] = {
};
/* Microsoft UCS Mapping Compatible */
-static const unsigned short euc_to_utf8_FC_ms[] = {
+const unsigned short euc_to_utf8_FC_ms[] = {
0x91D7, 0x91DE, 0x91ED, 0x91EE, 0x91E4, 0x91E5, 0x9206,
0x9210, 0x920A, 0x923A, 0x9240, 0x923C, 0x924E, 0x9259, 0x9251,
0x9239, 0x9267, 0x92A7, 0x9277, 0x9278, 0x92E7, 0x92D7, 0x92D9,
@@ -1332,7 +1297,7 @@ static const unsigned short euc_to_utf8_FC_ms[] = {
};
#ifdef X0212_ENABLE
-static const unsigned short euc_to_utf8_8FA2[] = {
+const unsigned short euc_to_utf8_8FA2[] = {
0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0x02D8,
0x02C7, 0x00B8, 0x02D9, 0x02DD, 0x00AF, 0x02DB, 0x02DA, 0xFF5E,
@@ -1346,7 +1311,7 @@ static const unsigned short euc_to_utf8_8FA2[] = {
0x00A4, 0x2116, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0,
};
-static const unsigned short euc_to_utf8_8FA6[] = {
+const unsigned short euc_to_utf8_8FA6[] = {
0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -1360,7 +1325,7 @@ static const unsigned short euc_to_utf8_8FA6[] = {
0, 0x03AC, 0x03AD, 0x03AE, 0x03AF, 0x03CA, 0x0390, 0x03CC,
0x03C2, 0x03CD, 0x03CB, 0x03B0, 0x03CE, 0, 0,
};
-static const unsigned short euc_to_utf8_8FA7[] = {
+const unsigned short euc_to_utf8_8FA7[] = {
0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -1374,7 +1339,7 @@ static const unsigned short euc_to_utf8_8FA7[] = {
0, 0, 0x0452, 0x0453, 0x0454, 0x0455, 0x0456, 0x0457,
0x0458, 0x0459, 0x045A, 0x045B, 0x045C, 0x045E, 0x045F,
};
-static const unsigned short euc_to_utf8_8FA9[] = {
+const unsigned short euc_to_utf8_8FA9[] = {
0x00C6, 0x0110, 0, 0x0126, 0, 0x0132, 0,
0x0141, 0x013F, 0, 0x014A, 0x00D8, 0x0152, 0, 0x0166,
0x00DE, 0, 0, 0, 0, 0, 0, 0,
@@ -1388,7 +1353,7 @@ static const unsigned short euc_to_utf8_8FA9[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0,
};
-static const unsigned short euc_to_utf8_8FAA[] = {
+const unsigned short euc_to_utf8_8FAA[] = {
0x00C1, 0x00C0, 0x00C4, 0x00C2, 0x0102, 0x01CD, 0x0100,
0x0104, 0x00C5, 0x00C3, 0x0106, 0x0108, 0x010C, 0x00C7, 0x010A,
0x010E, 0x00C9, 0x00C8, 0x00CB, 0x00CA, 0x011A, 0x0116, 0x0112,
@@ -1402,7 +1367,7 @@ static const unsigned short euc_to_utf8_8FAA[] = {
0x01D5, 0x0174, 0x00DD, 0x0178, 0x0176, 0x0179, 0x017D, 0x017B,
0, 0, 0, 0, 0, 0, 0,
};
-static const unsigned short euc_to_utf8_8FAB[] = {
+const unsigned short euc_to_utf8_8FAB[] = {
0x00E1, 0x00E0, 0x00E4, 0x00E2, 0x0103, 0x01CE, 0x0101,
0x0105, 0x00E5, 0x00E3, 0x0107, 0x0109, 0x010D, 0x00E7, 0x010B,
0x010F, 0x00E9, 0x00E8, 0x00EB, 0x00EA, 0x011B, 0x0117, 0x0113,
@@ -1416,7 +1381,7 @@ static const unsigned short euc_to_utf8_8FAB[] = {
0x01D6, 0x0175, 0x00FD, 0x00FF, 0x0177, 0x017A, 0x017E, 0x017C,
0, 0, 0, 0, 0, 0, 0,
};
-static const unsigned short euc_to_utf8_8FB0[] = {
+const unsigned short euc_to_utf8_8FB0[] = {
0x4E02, 0x4E04, 0x4E05, 0x4E0C, 0x4E12, 0x4E1F, 0x4E23,
0x4E24, 0x4E28, 0x4E2B, 0x4E2E, 0x4E2F, 0x4E30, 0x4E35, 0x4E40,
0x4E41, 0x4E44, 0x4E47, 0x4E51, 0x4E5A, 0x4E5C, 0x4E63, 0x4E68,
@@ -1430,7 +1395,7 @@ static const unsigned short euc_to_utf8_8FB0[] = {
0x4F5F, 0x4F63, 0x4F6A, 0x4F6C, 0x4F6E, 0x4F71, 0x4F77, 0x4F78,
0x4F79, 0x4F7A, 0x4F7D, 0x4F7E, 0x4F81, 0x4F82, 0x4F84,
};
-static const unsigned short euc_to_utf8_8FB1[] = {
+const unsigned short euc_to_utf8_8FB1[] = {
0x4F85, 0x4F89, 0x4F8A, 0x4F8C, 0x4F8E, 0x4F90, 0x4F92,
0x4F93, 0x4F94, 0x4F97, 0x4F99, 0x4F9A, 0x4F9E, 0x4F9F, 0x4FB2,
0x4FB7, 0x4FB9, 0x4FBB, 0x4FBC, 0x4FBD, 0x4FBE, 0x4FC0, 0x4FC1,
@@ -1444,7 +1409,7 @@ static const unsigned short euc_to_utf8_8FB1[] = {
0x5066, 0x5067, 0x506A, 0x506D, 0x5070, 0x5071, 0x503B, 0x5081,
0x5083, 0x5084, 0x5086, 0x508A, 0x508E, 0x508F, 0x5090,
};
-static const unsigned short euc_to_utf8_8FB2[] = {
+const unsigned short euc_to_utf8_8FB2[] = {
0x5092, 0x5093, 0x5094, 0x5096, 0x509B, 0x509C, 0x509E,
0x509F, 0x50A0, 0x50A1, 0x50A2, 0x50AA, 0x50AF, 0x50B0, 0x50B9,
0x50BA, 0x50BD, 0x50C0, 0x50C3, 0x50C4, 0x50C7, 0x50CC, 0x50CE,
@@ -1458,7 +1423,7 @@ static const unsigned short euc_to_utf8_8FB2[] = {
0x5183, 0x5184, 0x518B, 0x518E, 0x5198, 0x519D, 0x51A1, 0x51A3,
0x51AD, 0x51B8, 0x51BA, 0x51BC, 0x51BE, 0x51BF, 0x51C2,
};
-static const unsigned short euc_to_utf8_8FB3[] = {
+const unsigned short euc_to_utf8_8FB3[] = {
0x51C8, 0x51CF, 0x51D1, 0x51D2, 0x51D3, 0x51D5, 0x51D8,
0x51DE, 0x51E2, 0x51E5, 0x51EE, 0x51F2, 0x51F3, 0x51F4, 0x51F7,
0x5201, 0x5202, 0x5205, 0x5212, 0x5213, 0x5215, 0x5216, 0x5218,
@@ -1472,7 +1437,7 @@ static const unsigned short euc_to_utf8_8FB3[] = {
0x52E1, 0x52E5, 0x52E8, 0x52E9, 0x52EA, 0x52EC, 0x52F0, 0x52F1,
0x52F4, 0x52F6, 0x52F7, 0x5300, 0x5303, 0x530A, 0x530B,
};
-static const unsigned short euc_to_utf8_8FB4[] = {
+const unsigned short euc_to_utf8_8FB4[] = {
0x530C, 0x5311, 0x5313, 0x5318, 0x531B, 0x531C, 0x531E,
0x531F, 0x5325, 0x5327, 0x5328, 0x5329, 0x532B, 0x532C, 0x532D,
0x5330, 0x5332, 0x5335, 0x533C, 0x533D, 0x533E, 0x5342, 0x534C,
@@ -1486,7 +1451,7 @@ static const unsigned short euc_to_utf8_8FB4[] = {
0x5444, 0x5447, 0x544D, 0x544F, 0x545E, 0x5462, 0x5464, 0x5466,
0x5467, 0x5469, 0x546B, 0x546D, 0x546E, 0x5474, 0x547F,
};
-static const unsigned short euc_to_utf8_8FB5[] = {
+const unsigned short euc_to_utf8_8FB5[] = {
0x5481, 0x5483, 0x5485, 0x5488, 0x5489, 0x548D, 0x5491,
0x5495, 0x5496, 0x549C, 0x549F, 0x54A1, 0x54A6, 0x54A7, 0x54A9,
0x54AA, 0x54AD, 0x54AE, 0x54B1, 0x54B7, 0x54B9, 0x54BA, 0x54BB,
@@ -1500,7 +1465,7 @@ static const unsigned short euc_to_utf8_8FB5[] = {
0x5597, 0x55A3, 0x55A4, 0x55AD, 0x55B2, 0x55BF, 0x55C1, 0x55C3,
0x55C6, 0x55C9, 0x55CB, 0x55CC, 0x55CE, 0x55D1, 0x55D2,
};
-static const unsigned short euc_to_utf8_8FB6[] = {
+const unsigned short euc_to_utf8_8FB6[] = {
0x55D3, 0x55D7, 0x55D8, 0x55DB, 0x55DE, 0x55E2, 0x55E9,
0x55F6, 0x55FF, 0x5605, 0x5608, 0x560A, 0x560D, 0x560E, 0x560F,
0x5610, 0x5611, 0x5612, 0x5619, 0x562C, 0x5630, 0x5633, 0x5635,
@@ -1514,7 +1479,7 @@ static const unsigned short euc_to_utf8_8FB6[] = {
0x56CC, 0x56CD, 0x56D9, 0x56DC, 0x56DD, 0x56DF, 0x56E1, 0x56E4,
0x56E5, 0x56E6, 0x56E7, 0x56E8, 0x56F1, 0x56EB, 0x56ED,
};
-static const unsigned short euc_to_utf8_8FB7[] = {
+const unsigned short euc_to_utf8_8FB7[] = {
0x56F6, 0x56F7, 0x5701, 0x5702, 0x5707, 0x570A, 0x570C,
0x5711, 0x5715, 0x571A, 0x571B, 0x571D, 0x5720, 0x5722, 0x5723,
0x5724, 0x5725, 0x5729, 0x572A, 0x572C, 0x572E, 0x572F, 0x5733,
@@ -1528,7 +1493,7 @@ static const unsigned short euc_to_utf8_8FB7[] = {
0x57E7, 0x57E9, 0x57ED, 0x57F0, 0x57F5, 0x57F6, 0x57F8, 0x57FD,
0x57FE, 0x57FF, 0x5803, 0x5804, 0x5808, 0x5809, 0x57E1,
};
-static const unsigned short euc_to_utf8_8FB8[] = {
+const unsigned short euc_to_utf8_8FB8[] = {
0x580C, 0x580D, 0x581B, 0x581E, 0x581F, 0x5820, 0x5826,
0x5827, 0x582D, 0x5832, 0x5839, 0x583F, 0x5849, 0x584C, 0x584D,
0x584F, 0x5850, 0x5855, 0x585F, 0x5861, 0x5864, 0x5867, 0x5868,
@@ -1542,7 +1507,7 @@ static const unsigned short euc_to_utf8_8FB8[] = {
0x5936, 0x593F, 0x5943, 0x5946, 0x5952, 0x5953, 0x5959, 0x595B,
0x595D, 0x595E, 0x595F, 0x5961, 0x5963, 0x596B, 0x596D,
};
-static const unsigned short euc_to_utf8_8FB9[] = {
+const unsigned short euc_to_utf8_8FB9[] = {
0x596F, 0x5972, 0x5975, 0x5976, 0x5979, 0x597B, 0x597C,
0x598B, 0x598C, 0x598E, 0x5992, 0x5995, 0x5997, 0x599F, 0x59A4,
0x59A7, 0x59AD, 0x59AE, 0x59AF, 0x59B0, 0x59B3, 0x59B7, 0x59BA,
@@ -1556,7 +1521,7 @@ static const unsigned short euc_to_utf8_8FB9[] = {
0x5A9C, 0x5A9E, 0x5A9F, 0x5AA0, 0x5AA2, 0x5AA7, 0x5AAC, 0x5AB1,
0x5AB2, 0x5AB3, 0x5AB5, 0x5AB8, 0x5ABA, 0x5ABB, 0x5ABF,
};
-static const unsigned short euc_to_utf8_8FBA[] = {
+const unsigned short euc_to_utf8_8FBA[] = {
0x5AC4, 0x5AC6, 0x5AC8, 0x5ACF, 0x5ADA, 0x5ADC, 0x5AE0,
0x5AE5, 0x5AEA, 0x5AEE, 0x5AF5, 0x5AF6, 0x5AFD, 0x5B00, 0x5B01,
0x5B08, 0x5B17, 0x5B34, 0x5B19, 0x5B1B, 0x5B1D, 0x5B21, 0x5B25,
@@ -1570,7 +1535,7 @@ static const unsigned short euc_to_utf8_8FBA[] = {
0x5C2B, 0x5C2C, 0x5C2E, 0x5C30, 0x5C32, 0x5C35, 0x5C36, 0x5C59,
0x5C5A, 0x5C5C, 0x5C62, 0x5C63, 0x5C67, 0x5C68, 0x5C69,
};
-static const unsigned short euc_to_utf8_8FBB[] = {
+const unsigned short euc_to_utf8_8FBB[] = {
0x5C6D, 0x5C70, 0x5C74, 0x5C75, 0x5C7A, 0x5C7B, 0x5C7C,
0x5C7D, 0x5C87, 0x5C88, 0x5C8A, 0x5C8F, 0x5C92, 0x5C9D, 0x5C9F,
0x5CA0, 0x5CA2, 0x5CA3, 0x5CA6, 0x5CAA, 0x5CB2, 0x5CB4, 0x5CB5,
@@ -1584,7 +1549,7 @@ static const unsigned short euc_to_utf8_8FBB[] = {
0x5DA7, 0x5DAB, 0x5DB0, 0x5DB4, 0x5DB8, 0x5DB9, 0x5DC3, 0x5DC7,
0x5DCB, 0x5DD0, 0x5DCE, 0x5DD8, 0x5DD9, 0x5DE0, 0x5DE4,
};
-static const unsigned short euc_to_utf8_8FBC[] = {
+const unsigned short euc_to_utf8_8FBC[] = {
0x5DE9, 0x5DF8, 0x5DF9, 0x5E00, 0x5E07, 0x5E0D, 0x5E12,
0x5E14, 0x5E15, 0x5E18, 0x5E1F, 0x5E20, 0x5E2E, 0x5E28, 0x5E32,
0x5E35, 0x5E3E, 0x5E4B, 0x5E50, 0x5E49, 0x5E51, 0x5E56, 0x5E58,
@@ -1598,7 +1563,7 @@ static const unsigned short euc_to_utf8_8FBC[] = {
0x5F3D, 0x5F3F, 0x5F40, 0x5F44, 0x5F45, 0x5F47, 0x5F4D, 0x5F50,
0x5F54, 0x5F58, 0x5F5B, 0x5F60, 0x5F63, 0x5F64, 0x5F67,
};
-static const unsigned short euc_to_utf8_8FBD[] = {
+const unsigned short euc_to_utf8_8FBD[] = {
0x5F6F, 0x5F72, 0x5F74, 0x5F75, 0x5F78, 0x5F7A, 0x5F7D,
0x5F7E, 0x5F89, 0x5F8D, 0x5F8F, 0x5F96, 0x5F9C, 0x5F9D, 0x5FA2,
0x5FA7, 0x5FAB, 0x5FA4, 0x5FAC, 0x5FAF, 0x5FB0, 0x5FB1, 0x5FB8,
@@ -1612,7 +1577,7 @@ static const unsigned short euc_to_utf8_8FBD[] = {
0x608A, 0x608E, 0x6091, 0x6093, 0x6095, 0x6098, 0x609D, 0x609E,
0x60A2, 0x60A4, 0x60A5, 0x60A8, 0x60B0, 0x60B1, 0x60B7,
};
-static const unsigned short euc_to_utf8_8FBE[] = {
+const unsigned short euc_to_utf8_8FBE[] = {
0x60BB, 0x60BE, 0x60C2, 0x60C4, 0x60C8, 0x60C9, 0x60CA,
0x60CB, 0x60CE, 0x60CF, 0x60D4, 0x60D5, 0x60D9, 0x60DB, 0x60DD,
0x60DE, 0x60E2, 0x60E5, 0x60F2, 0x60F5, 0x60F8, 0x60FC, 0x60FD,
@@ -1626,7 +1591,7 @@ static const unsigned short euc_to_utf8_8FBE[] = {
0x61C0, 0x61C1, 0x61C2, 0x61CE, 0x61CF, 0x61D5, 0x61DC, 0x61DD,
0x61DE, 0x61DF, 0x61E1, 0x61E2, 0x61E7, 0x61E9, 0x61E5,
};
-static const unsigned short euc_to_utf8_8FBF[] = {
+const unsigned short euc_to_utf8_8FBF[] = {
0x61EC, 0x61ED, 0x61EF, 0x6201, 0x6203, 0x6204, 0x6207,
0x6213, 0x6215, 0x621C, 0x6220, 0x6222, 0x6223, 0x6227, 0x6229,
0x622B, 0x6239, 0x623D, 0x6242, 0x6243, 0x6244, 0x6246, 0x624C,
@@ -1640,7 +1605,7 @@ static const unsigned short euc_to_utf8_8FBF[] = {
0x634A, 0x634B, 0x634E, 0x6352, 0x6353, 0x6354, 0x6358, 0x635B,
0x6365, 0x6366, 0x636C, 0x636D, 0x6371, 0x6374, 0x6375,
};
-static const unsigned short euc_to_utf8_8FC0[] = {
+const unsigned short euc_to_utf8_8FC0[] = {
0x6378, 0x637C, 0x637D, 0x637F, 0x6382, 0x6384, 0x6387,
0x638A, 0x6390, 0x6394, 0x6395, 0x6399, 0x639A, 0x639E, 0x63A4,
0x63A6, 0x63AD, 0x63AE, 0x63AF, 0x63BD, 0x63C1, 0x63C5, 0x63C8,
@@ -1654,7 +1619,7 @@ static const unsigned short euc_to_utf8_8FC0[] = {
0x6491, 0x6498, 0x6499, 0x649B, 0x649D, 0x649F, 0x64A1, 0x64A3,
0x64A6, 0x64A8, 0x64AC, 0x64B3, 0x64BD, 0x64BE, 0x64BF,
};
-static const unsigned short euc_to_utf8_8FC1[] = {
+const unsigned short euc_to_utf8_8FC1[] = {
0x64C4, 0x64C9, 0x64CA, 0x64CB, 0x64CC, 0x64CE, 0x64D0,
0x64D1, 0x64D5, 0x64D7, 0x64E4, 0x64E5, 0x64E9, 0x64EA, 0x64ED,
0x64F0, 0x64F5, 0x64F7, 0x64FB, 0x64FF, 0x6501, 0x6504, 0x6508,
@@ -1668,7 +1633,7 @@ static const unsigned short euc_to_utf8_8FC1[] = {
0x65F4, 0x65F5, 0x65F9, 0x65FE, 0x65FF, 0x6600, 0x6604, 0x6608,
0x6609, 0x660D, 0x6611, 0x6612, 0x6615, 0x6616, 0x661D,
};
-static const unsigned short euc_to_utf8_8FC2[] = {
+const unsigned short euc_to_utf8_8FC2[] = {
0x661E, 0x6621, 0x6622, 0x6623, 0x6624, 0x6626, 0x6629,
0x662A, 0x662B, 0x662C, 0x662E, 0x6630, 0x6631, 0x6633, 0x6639,
0x6637, 0x6640, 0x6645, 0x6646, 0x664A, 0x664C, 0x6651, 0x664E,
@@ -1682,7 +1647,7 @@ static const unsigned short euc_to_utf8_8FC2[] = {
0x670E, 0x6713, 0x6719, 0x671C, 0x6720, 0x6722, 0x6733, 0x673E,
0x6745, 0x6747, 0x6748, 0x674C, 0x6754, 0x6755, 0x675D,
};
-static const unsigned short euc_to_utf8_8FC3[] = {
+const unsigned short euc_to_utf8_8FC3[] = {
0x6766, 0x676C, 0x676E, 0x6774, 0x6776, 0x677B, 0x6781,
0x6784, 0x678E, 0x678F, 0x6791, 0x6793, 0x6796, 0x6798, 0x6799,
0x679B, 0x67B0, 0x67B1, 0x67B2, 0x67B5, 0x67BB, 0x67BC, 0x67BD,
@@ -1696,7 +1661,7 @@ static const unsigned short euc_to_utf8_8FC3[] = {
0x6898, 0x689A, 0x689C, 0x68A1, 0x68A3, 0x68A5, 0x68A9, 0x68AA,
0x68AE, 0x68B2, 0x68BB, 0x68C5, 0x68C8, 0x68CC, 0x68CF,
};
-static const unsigned short euc_to_utf8_8FC4[] = {
+const unsigned short euc_to_utf8_8FC4[] = {
0x68D0, 0x68D1, 0x68D3, 0x68D6, 0x68D9, 0x68DC, 0x68DD,
0x68E5, 0x68E8, 0x68EA, 0x68EB, 0x68EC, 0x68ED, 0x68F0, 0x68F1,
0x68F5, 0x68F6, 0x68FB, 0x68FC, 0x68FD, 0x6906, 0x6909, 0x690A,
@@ -1710,7 +1675,7 @@ static const unsigned short euc_to_utf8_8FC4[] = {
0x69F5, 0x69FE, 0x6A00, 0x6A01, 0x6A03, 0x6A0F, 0x6A11, 0x6A15,
0x6A1A, 0x6A1D, 0x6A20, 0x6A24, 0x6A28, 0x6A30, 0x6A32,
};
-static const unsigned short euc_to_utf8_8FC5[] = {
+const unsigned short euc_to_utf8_8FC5[] = {
0x6A34, 0x6A37, 0x6A3B, 0x6A3E, 0x6A3F, 0x6A45, 0x6A46,
0x6A49, 0x6A4A, 0x6A4E, 0x6A50, 0x6A51, 0x6A52, 0x6A55, 0x6A56,
0x6A5B, 0x6A64, 0x6A67, 0x6A6A, 0x6A71, 0x6A73, 0x6A7E, 0x6A81,
@@ -1724,7 +1689,7 @@ static const unsigned short euc_to_utf8_8FC5[] = {
0x6B3F, 0x6B46, 0x6B4A, 0x6B4D, 0x6B52, 0x6B56, 0x6B58, 0x6B5D,
0x6B60, 0x6B67, 0x6B6B, 0x6B6E, 0x6B70, 0x6B75, 0x6B7D,
};
-static const unsigned short euc_to_utf8_8FC6[] = {
+const unsigned short euc_to_utf8_8FC6[] = {
0x6B7E, 0x6B82, 0x6B85, 0x6B97, 0x6B9B, 0x6B9F, 0x6BA0,
0x6BA2, 0x6BA3, 0x6BA8, 0x6BA9, 0x6BAC, 0x6BAD, 0x6BAE, 0x6BB0,
0x6BB8, 0x6BB9, 0x6BBD, 0x6BBE, 0x6BC3, 0x6BC4, 0x6BC9, 0x6BCC,
@@ -1738,7 +1703,7 @@ static const unsigned short euc_to_utf8_8FC6[] = {
0x6C98, 0x6C9C, 0x6C9F, 0x6CB0, 0x6CB2, 0x6CB4, 0x6CC2, 0x6CC6,
0x6CCD, 0x6CCF, 0x6CD0, 0x6CD1, 0x6CD2, 0x6CD4, 0x6CD6,
};
-static const unsigned short euc_to_utf8_8FC7[] = {
+const unsigned short euc_to_utf8_8FC7[] = {
0x6CDA, 0x6CDC, 0x6CE0, 0x6CE7, 0x6CE9, 0x6CEB, 0x6CEC,
0x6CEE, 0x6CF2, 0x6CF4, 0x6D04, 0x6D07, 0x6D0A, 0x6D0E, 0x6D0F,
0x6D11, 0x6D13, 0x6D1A, 0x6D26, 0x6D27, 0x6D28, 0x6C67, 0x6D2E,
@@ -1752,7 +1717,7 @@ static const unsigned short euc_to_utf8_8FC7[] = {
0x6E3C, 0x6E44, 0x6E45, 0x6E48, 0x6E49, 0x6E4B, 0x6E4F, 0x6E51,
0x6E52, 0x6E53, 0x6E54, 0x6E57, 0x6E5C, 0x6E5D, 0x6E5E,
};
-static const unsigned short euc_to_utf8_8FC8[] = {
+const unsigned short euc_to_utf8_8FC8[] = {
0x6E62, 0x6E63, 0x6E68, 0x6E73, 0x6E7B, 0x6E7D, 0x6E8D,
0x6E93, 0x6E99, 0x6EA0, 0x6EA7, 0x6EAD, 0x6EAE, 0x6EB1, 0x6EB3,
0x6EBB, 0x6EBF, 0x6EC0, 0x6EC1, 0x6EC3, 0x6EC7, 0x6EC8, 0x6ECA,
@@ -1766,7 +1731,7 @@ static const unsigned short euc_to_utf8_8FC8[] = {
0x6FA0, 0x6FA5, 0x6FA6, 0x6FA7, 0x6FA8, 0x6FAE, 0x6FAF, 0x6FB0,
0x6FB5, 0x6FB6, 0x6FBC, 0x6FC5, 0x6FC7, 0x6FC8, 0x6FCA,
};
-static const unsigned short euc_to_utf8_8FC9[] = {
+const unsigned short euc_to_utf8_8FC9[] = {
0x6FDA, 0x6FDE, 0x6FE8, 0x6FE9, 0x6FF0, 0x6FF5, 0x6FF9,
0x6FFC, 0x6FFD, 0x7000, 0x7005, 0x7006, 0x7007, 0x700D, 0x7017,
0x7020, 0x7023, 0x702F, 0x7034, 0x7037, 0x7039, 0x703C, 0x7043,
@@ -1780,7 +1745,7 @@ static const unsigned short euc_to_utf8_8FC9[] = {
0x7131, 0x7138, 0x7141, 0x7145, 0x7146, 0x7147, 0x714A, 0x714B,
0x7150, 0x7152, 0x7157, 0x715A, 0x715C, 0x715E, 0x7160,
};
-static const unsigned short euc_to_utf8_8FCA[] = {
+const unsigned short euc_to_utf8_8FCA[] = {
0x7168, 0x7179, 0x7180, 0x7185, 0x7187, 0x718C, 0x7192,
0x719A, 0x719B, 0x71A0, 0x71A2, 0x71AF, 0x71B0, 0x71B2, 0x71B3,
0x71BA, 0x71BF, 0x71C0, 0x71C1, 0x71C4, 0x71CB, 0x71CC, 0x71D3,
@@ -1794,7 +1759,7 @@ static const unsigned short euc_to_utf8_8FCA[] = {
0x72B4, 0x72BE, 0x72C1, 0x72C7, 0x72C9, 0x72CC, 0x72D5, 0x72D6,
0x72D8, 0x72DF, 0x72E5, 0x72F3, 0x72F4, 0x72FA, 0x72FB,
};
-static const unsigned short euc_to_utf8_8FCB[] = {
+const unsigned short euc_to_utf8_8FCB[] = {
0x72FE, 0x7302, 0x7304, 0x7305, 0x7307, 0x730B, 0x730D,
0x7312, 0x7313, 0x7318, 0x7319, 0x731E, 0x7322, 0x7324, 0x7327,
0x7328, 0x732C, 0x7331, 0x7332, 0x7335, 0x733A, 0x733B, 0x733D,
@@ -1808,7 +1773,7 @@ static const unsigned short euc_to_utf8_8FCB[] = {
0x73D6, 0x73D9, 0x73DD, 0x73E1, 0x73E3, 0x73E6, 0x73E7, 0x73E9,
0x73F4, 0x73F5, 0x73F7, 0x73F9, 0x73FA, 0x73FB, 0x73FD,
};
-static const unsigned short euc_to_utf8_8FCC[] = {
+const unsigned short euc_to_utf8_8FCC[] = {
0x73FF, 0x7400, 0x7401, 0x7404, 0x7407, 0x740A, 0x7411,
0x741A, 0x741B, 0x7424, 0x7426, 0x7428, 0x7429, 0x742A, 0x742B,
0x742C, 0x742D, 0x742E, 0x742F, 0x7430, 0x7431, 0x7439, 0x7440,
@@ -1822,7 +1787,7 @@ static const unsigned short euc_to_utf8_8FCC[] = {
0x74DA, 0x74DB, 0x74DE, 0x74DF, 0x74E4, 0x74E8, 0x74EA, 0x74EB,
0x74EF, 0x74F4, 0x74FA, 0x74FB, 0x74FC, 0x74FF, 0x7506,
};
-static const unsigned short euc_to_utf8_8FCD[] = {
+const unsigned short euc_to_utf8_8FCD[] = {
0x7512, 0x7516, 0x7517, 0x7520, 0x7521, 0x7524, 0x7527,
0x7529, 0x752A, 0x752F, 0x7536, 0x7539, 0x753D, 0x753E, 0x753F,
0x7540, 0x7543, 0x7547, 0x7548, 0x754E, 0x7550, 0x7552, 0x7557,
@@ -1836,7 +1801,7 @@ static const unsigned short euc_to_utf8_8FCD[] = {
0x7619, 0x761B, 0x761C, 0x761D, 0x761E, 0x7623, 0x7625, 0x7626,
0x7629, 0x762D, 0x7632, 0x7633, 0x7635, 0x7638, 0x7639,
};
-static const unsigned short euc_to_utf8_8FCE[] = {
+const unsigned short euc_to_utf8_8FCE[] = {
0x763A, 0x763C, 0x764A, 0x7640, 0x7641, 0x7643, 0x7644,
0x7645, 0x7649, 0x764B, 0x7655, 0x7659, 0x765F, 0x7664, 0x7665,
0x766D, 0x766E, 0x766F, 0x7671, 0x7674, 0x7681, 0x7685, 0x768C,
@@ -1850,7 +1815,7 @@ static const unsigned short euc_to_utf8_8FCE[] = {
0x7742, 0x7745, 0x7746, 0x774A, 0x774D, 0x774E, 0x774F, 0x7752,
0x7756, 0x7757, 0x775C, 0x775E, 0x775F, 0x7760, 0x7762,
};
-static const unsigned short euc_to_utf8_8FCF[] = {
+const unsigned short euc_to_utf8_8FCF[] = {
0x7764, 0x7767, 0x776A, 0x776C, 0x7770, 0x7772, 0x7773,
0x7774, 0x777A, 0x777D, 0x7780, 0x7784, 0x778C, 0x778D, 0x7794,
0x7795, 0x7796, 0x779A, 0x779F, 0x77A2, 0x77A7, 0x77AA, 0x77AE,
@@ -1864,7 +1829,7 @@ static const unsigned short euc_to_utf8_8FCF[] = {
0x788F, 0x7894, 0x7898, 0x78A1, 0x789D, 0x789E, 0x789F, 0x78A4,
0x78A8, 0x78AC, 0x78AD, 0x78B0, 0x78B1, 0x78B2, 0x78B3,
};
-static const unsigned short euc_to_utf8_8FD0[] = {
+const unsigned short euc_to_utf8_8FD0[] = {
0x78BB, 0x78BD, 0x78BF, 0x78C7, 0x78C8, 0x78C9, 0x78CC,
0x78CE, 0x78D2, 0x78D3, 0x78D5, 0x78D6, 0x78E4, 0x78DB, 0x78DF,
0x78E0, 0x78E1, 0x78E6, 0x78EA, 0x78F2, 0x78F3, 0x7900, 0x78F6,
@@ -1878,7 +1843,7 @@ static const unsigned short euc_to_utf8_8FD0[] = {
0x79B1, 0x79B4, 0x79B8, 0x79BB, 0x79C2, 0x79C4, 0x79C7, 0x79C8,
0x79CA, 0x79CF, 0x79D4, 0x79D6, 0x79DA, 0x79DD, 0x79DE,
};
-static const unsigned short euc_to_utf8_8FD1[] = {
+const unsigned short euc_to_utf8_8FD1[] = {
0x79E0, 0x79E2, 0x79E5, 0x79EA, 0x79EB, 0x79ED, 0x79F1,
0x79F8, 0x79FC, 0x7A02, 0x7A03, 0x7A07, 0x7A09, 0x7A0A, 0x7A0C,
0x7A11, 0x7A15, 0x7A1B, 0x7A1E, 0x7A21, 0x7A27, 0x7A2B, 0x7A2D,
@@ -1892,7 +1857,7 @@ static const unsigned short euc_to_utf8_8FD1[] = {
0x7AFB, 0x7AFD, 0x7AFE, 0x7B07, 0x7B14, 0x7B1F, 0x7B23, 0x7B27,
0x7B29, 0x7B2A, 0x7B2B, 0x7B2D, 0x7B2E, 0x7B2F, 0x7B30,
};
-static const unsigned short euc_to_utf8_8FD2[] = {
+const unsigned short euc_to_utf8_8FD2[] = {
0x7B31, 0x7B34, 0x7B3D, 0x7B3F, 0x7B40, 0x7B41, 0x7B47,
0x7B4E, 0x7B55, 0x7B60, 0x7B64, 0x7B66, 0x7B69, 0x7B6A, 0x7B6D,
0x7B6F, 0x7B72, 0x7B73, 0x7B77, 0x7B84, 0x7B89, 0x7B8E, 0x7B90,
@@ -1906,7 +1871,7 @@ static const unsigned short euc_to_utf8_8FD2[] = {
0x7C36, 0x7C39, 0x7C3A, 0x7C46, 0x7C4A, 0x7C55, 0x7C51, 0x7C52,
0x7C53, 0x7C59, 0x7C5A, 0x7C5B, 0x7C5C, 0x7C5D, 0x7C5E,
};
-static const unsigned short euc_to_utf8_8FD3[] = {
+const unsigned short euc_to_utf8_8FD3[] = {
0x7C61, 0x7C63, 0x7C67, 0x7C69, 0x7C6D, 0x7C6E, 0x7C70,
0x7C72, 0x7C79, 0x7C7C, 0x7C7D, 0x7C86, 0x7C87, 0x7C8F, 0x7C94,
0x7C9E, 0x7CA0, 0x7CA6, 0x7CB0, 0x7CB6, 0x7CB7, 0x7CBA, 0x7CBB,
@@ -1920,7 +1885,7 @@ static const unsigned short euc_to_utf8_8FD3[] = {
0x7D7B, 0x7D7F, 0x7D81, 0x7D82, 0x7D83, 0x7D85, 0x7D86, 0x7D88,
0x7D8B, 0x7D8C, 0x7D8D, 0x7D91, 0x7D96, 0x7D97, 0x7D9D,
};
-static const unsigned short euc_to_utf8_8FD4[] = {
+const unsigned short euc_to_utf8_8FD4[] = {
0x7D9E, 0x7DA6, 0x7DA7, 0x7DAA, 0x7DB3, 0x7DB6, 0x7DB7,
0x7DB9, 0x7DC2, 0x7DC3, 0x7DC4, 0x7DC5, 0x7DC6, 0x7DCC, 0x7DCD,
0x7DCE, 0x7DD7, 0x7DD9, 0x7E00, 0x7DE2, 0x7DE5, 0x7DE6, 0x7DEA,
@@ -1934,7 +1899,7 @@ static const unsigned short euc_to_utf8_8FD4[] = {
0x7F43, 0x7F44, 0x7F47, 0x7F4F, 0x7F52, 0x7F53, 0x7F5B, 0x7F5C,
0x7F5D, 0x7F61, 0x7F63, 0x7F64, 0x7F65, 0x7F66, 0x7F6D,
};
-static const unsigned short euc_to_utf8_8FD5[] = {
+const unsigned short euc_to_utf8_8FD5[] = {
0x7F71, 0x7F7D, 0x7F7E, 0x7F7F, 0x7F80, 0x7F8B, 0x7F8D,
0x7F8F, 0x7F90, 0x7F91, 0x7F96, 0x7F97, 0x7F9C, 0x7FA1, 0x7FA2,
0x7FA6, 0x7FAA, 0x7FAD, 0x7FB4, 0x7FBC, 0x7FBF, 0x7FC0, 0x7FC3,
@@ -1948,7 +1913,7 @@ static const unsigned short euc_to_utf8_8FD5[] = {
0x80A7, 0x80AB, 0x80B8, 0x80B9, 0x80C8, 0x80CD, 0x80CF, 0x80D2,
0x80D4, 0x80D5, 0x80D7, 0x80D8, 0x80E0, 0x80ED, 0x80EE,
};
-static const unsigned short euc_to_utf8_8FD6[] = {
+const unsigned short euc_to_utf8_8FD6[] = {
0x80F0, 0x80F2, 0x80F3, 0x80F6, 0x80F9, 0x80FA, 0x80FE,
0x8103, 0x810B, 0x8116, 0x8117, 0x8118, 0x811C, 0x811E, 0x8120,
0x8124, 0x8127, 0x812C, 0x8130, 0x8135, 0x813A, 0x813C, 0x8145,
@@ -1962,7 +1927,7 @@ static const unsigned short euc_to_utf8_8FD6[] = {
0x8213, 0x8214, 0x8219, 0x821A, 0x821D, 0x8221, 0x8222, 0x8228,
0x8232, 0x8234, 0x823A, 0x8243, 0x8244, 0x8245, 0x8246,
};
-static const unsigned short euc_to_utf8_8FD7[] = {
+const unsigned short euc_to_utf8_8FD7[] = {
0x824B, 0x824E, 0x824F, 0x8251, 0x8256, 0x825C, 0x8260,
0x8263, 0x8267, 0x826D, 0x8274, 0x827B, 0x827D, 0x827F, 0x8280,
0x8281, 0x8283, 0x8284, 0x8287, 0x8289, 0x828A, 0x828E, 0x8291,
@@ -1976,7 +1941,7 @@ static const unsigned short euc_to_utf8_8FD7[] = {
0x833A, 0x833C, 0x833D, 0x8342, 0x8343, 0x8344, 0x8347, 0x834D,
0x834E, 0x8351, 0x8355, 0x8356, 0x8357, 0x8370, 0x8378,
};
-static const unsigned short euc_to_utf8_8FD8[] = {
+const unsigned short euc_to_utf8_8FD8[] = {
0x837D, 0x837F, 0x8380, 0x8382, 0x8384, 0x8386, 0x838D,
0x8392, 0x8394, 0x8395, 0x8398, 0x8399, 0x839B, 0x839C, 0x839D,
0x83A6, 0x83A7, 0x83A9, 0x83AC, 0x83BE, 0x83BF, 0x83C0, 0x83C7,
@@ -1990,7 +1955,7 @@ static const unsigned short euc_to_utf8_8FD8[] = {
0x84A9, 0x84AA, 0x84AF, 0x84B1, 0x84B4, 0x84BA, 0x84BD, 0x84BE,
0x84C0, 0x84C2, 0x84C7, 0x84C8, 0x84CC, 0x84CF, 0x84D3,
};
-static const unsigned short euc_to_utf8_8FD9[] = {
+const unsigned short euc_to_utf8_8FD9[] = {
0x84DC, 0x84E7, 0x84EA, 0x84EF, 0x84F0, 0x84F1, 0x84F2,
0x84F7, 0x8532, 0x84FA, 0x84FB, 0x84FD, 0x8502, 0x8503, 0x8507,
0x850C, 0x850E, 0x8510, 0x851C, 0x851E, 0x8522, 0x8523, 0x8524,
@@ -2004,7 +1969,7 @@ static const unsigned short euc_to_utf8_8FD9[] = {
0x85C7, 0x85CA, 0x85CB, 0x85CE, 0x85AD, 0x85D8, 0x85DA, 0x85DF,
0x85E0, 0x85E6, 0x85E8, 0x85ED, 0x85F3, 0x85F6, 0x85FC,
};
-static const unsigned short euc_to_utf8_8FDA[] = {
+const unsigned short euc_to_utf8_8FDA[] = {
0x85FF, 0x8600, 0x8604, 0x8605, 0x860D, 0x860E, 0x8610,
0x8611, 0x8612, 0x8618, 0x8619, 0x861B, 0x861E, 0x8621, 0x8627,
0x8629, 0x8636, 0x8638, 0x863A, 0x863C, 0x863D, 0x8640, 0x8642,
@@ -2018,7 +1983,7 @@ static const unsigned short euc_to_utf8_8FDA[] = {
0x86FD, 0x8704, 0x8705, 0x8707, 0x870B, 0x870E, 0x870F, 0x8710,
0x8713, 0x8714, 0x8719, 0x871E, 0x871F, 0x8721, 0x8723,
};
-static const unsigned short euc_to_utf8_8FDB[] = {
+const unsigned short euc_to_utf8_8FDB[] = {
0x8728, 0x872E, 0x872F, 0x8731, 0x8732, 0x8739, 0x873A,
0x873C, 0x873D, 0x873E, 0x8740, 0x8743, 0x8745, 0x874D, 0x8758,
0x875D, 0x8761, 0x8764, 0x8765, 0x876F, 0x8771, 0x8772, 0x877B,
@@ -2032,7 +1997,7 @@ static const unsigned short euc_to_utf8_8FDB[] = {
0x8812, 0x8813, 0x8814, 0x8818, 0x881A, 0x881B, 0x881C, 0x881E,
0x881F, 0x8828, 0x882D, 0x882E, 0x8830, 0x8832, 0x8835,
};
-static const unsigned short euc_to_utf8_8FDC[] = {
+const unsigned short euc_to_utf8_8FDC[] = {
0x883A, 0x883C, 0x8841, 0x8843, 0x8845, 0x8848, 0x8849,
0x884A, 0x884B, 0x884E, 0x8851, 0x8855, 0x8856, 0x8858, 0x885A,
0x885C, 0x885F, 0x8860, 0x8864, 0x8869, 0x8871, 0x8879, 0x887B,
@@ -2046,7 +2011,7 @@ static const unsigned short euc_to_utf8_8FDC[] = {
0x894F, 0x8952, 0x8957, 0x895A, 0x895B, 0x895C, 0x8961, 0x8962,
0x8963, 0x896B, 0x896E, 0x8970, 0x8973, 0x8975, 0x897A,
};
-static const unsigned short euc_to_utf8_8FDD[] = {
+const unsigned short euc_to_utf8_8FDD[] = {
0x897B, 0x897C, 0x897D, 0x8989, 0x898D, 0x8990, 0x8994,
0x8995, 0x899B, 0x899C, 0x899F, 0x89A0, 0x89A5, 0x89B0, 0x89B4,
0x89B5, 0x89B6, 0x89B7, 0x89BC, 0x89D4, 0x89D5, 0x89D6, 0x89D7,
@@ -2060,7 +2025,7 @@ static const unsigned short euc_to_utf8_8FDD[] = {
0x8A83, 0x8A86, 0x8A8B, 0x8A8F, 0x8A90, 0x8A92, 0x8A96, 0x8A97,
0x8A99, 0x8A9F, 0x8AA7, 0x8AA9, 0x8AAE, 0x8AAF, 0x8AB3,
};
-static const unsigned short euc_to_utf8_8FDE[] = {
+const unsigned short euc_to_utf8_8FDE[] = {
0x8AB6, 0x8AB7, 0x8ABB, 0x8ABE, 0x8AC3, 0x8AC6, 0x8AC8,
0x8AC9, 0x8ACA, 0x8AD1, 0x8AD3, 0x8AD4, 0x8AD5, 0x8AD7, 0x8ADD,
0x8ADF, 0x8AEC, 0x8AF0, 0x8AF4, 0x8AF5, 0x8AF6, 0x8AFC, 0x8AFF,
@@ -2074,7 +2039,7 @@ static const unsigned short euc_to_utf8_8FDE[] = {
0x8C5B, 0x8C5D, 0x8C59, 0x8C63, 0x8C64, 0x8C66, 0x8C68, 0x8C69,
0x8C6D, 0x8C73, 0x8C75, 0x8C76, 0x8C7B, 0x8C7E, 0x8C86,
};
-static const unsigned short euc_to_utf8_8FDF[] = {
+const unsigned short euc_to_utf8_8FDF[] = {
0x8C87, 0x8C8B, 0x8C90, 0x8C92, 0x8C93, 0x8C99, 0x8C9B,
0x8C9C, 0x8CA4, 0x8CB9, 0x8CBA, 0x8CC5, 0x8CC6, 0x8CC9, 0x8CCB,
0x8CCF, 0x8CD6, 0x8CD5, 0x8CD9, 0x8CDD, 0x8CE1, 0x8CE8, 0x8CEC,
@@ -2088,7 +2053,7 @@ static const unsigned short euc_to_utf8_8FDF[] = {
0x8DF1, 0x8DF2, 0x8DF4, 0x8DFD, 0x8E01, 0x8E04, 0x8E05, 0x8E06,
0x8E0B, 0x8E11, 0x8E14, 0x8E16, 0x8E20, 0x8E21, 0x8E22,
};
-static const unsigned short euc_to_utf8_8FE0[] = {
+const unsigned short euc_to_utf8_8FE0[] = {
0x8E23, 0x8E26, 0x8E27, 0x8E31, 0x8E33, 0x8E36, 0x8E37,
0x8E38, 0x8E39, 0x8E3D, 0x8E40, 0x8E41, 0x8E4B, 0x8E4D, 0x8E4E,
0x8E4F, 0x8E54, 0x8E5B, 0x8E5C, 0x8E5D, 0x8E5E, 0x8E61, 0x8E62,
@@ -2102,7 +2067,7 @@ static const unsigned short euc_to_utf8_8FE0[] = {
0x8F21, 0x8F23, 0x8F25, 0x8F27, 0x8F28, 0x8F2C, 0x8F2D, 0x8F2E,
0x8F34, 0x8F35, 0x8F36, 0x8F37, 0x8F3A, 0x8F40, 0x8F41,
};
-static const unsigned short euc_to_utf8_8FE1[] = {
+const unsigned short euc_to_utf8_8FE1[] = {
0x8F43, 0x8F47, 0x8F4F, 0x8F51, 0x8F52, 0x8F53, 0x8F54,
0x8F55, 0x8F58, 0x8F5D, 0x8F5E, 0x8F65, 0x8F9D, 0x8FA0, 0x8FA1,
0x8FA4, 0x8FA5, 0x8FA6, 0x8FB5, 0x8FB6, 0x8FB8, 0x8FBE, 0x8FC0,
@@ -2116,7 +2081,7 @@ static const unsigned short euc_to_utf8_8FE1[] = {
0x9099, 0x909B, 0x90A0, 0x90A1, 0x90A2, 0x90A5, 0x90B0, 0x90B2,
0x90B3, 0x90B4, 0x90B6, 0x90BD, 0x90CC, 0x90BE, 0x90C3,
};
-static const unsigned short euc_to_utf8_8FE2[] = {
+const unsigned short euc_to_utf8_8FE2[] = {
0x90C4, 0x90C5, 0x90C7, 0x90C8, 0x90D5, 0x90D7, 0x90D8,
0x90D9, 0x90DC, 0x90DD, 0x90DF, 0x90E5, 0x90D2, 0x90F6, 0x90EB,
0x90EF, 0x90F0, 0x90F4, 0x90FE, 0x90FF, 0x9100, 0x9104, 0x9105,
@@ -2130,7 +2095,7 @@ static const unsigned short euc_to_utf8_8FE2[] = {
0x91A1, 0x91A6, 0x91A8, 0x91AC, 0x91AD, 0x91AE, 0x91B0, 0x91B1,
0x91B2, 0x91B3, 0x91B6, 0x91BB, 0x91BC, 0x91BD, 0x91BF,
};
-static const unsigned short euc_to_utf8_8FE3[] = {
+const unsigned short euc_to_utf8_8FE3[] = {
0x91C2, 0x91C3, 0x91C5, 0x91D3, 0x91D4, 0x91D7, 0x91D9,
0x91DA, 0x91DE, 0x91E4, 0x91E5, 0x91E9, 0x91EA, 0x91EC, 0x91ED,
0x91EE, 0x91EF, 0x91F0, 0x91F1, 0x91F7, 0x91F9, 0x91FB, 0x91FD,
@@ -2144,7 +2109,7 @@ static const unsigned short euc_to_utf8_8FE3[] = {
0x9276, 0x9277, 0x9278, 0x9279, 0x927B, 0x927C, 0x927D, 0x927F,
0x9288, 0x9289, 0x928A, 0x928D, 0x928E, 0x9292, 0x9297,
};
-static const unsigned short euc_to_utf8_8FE4[] = {
+const unsigned short euc_to_utf8_8FE4[] = {
0x9299, 0x929F, 0x92A0, 0x92A4, 0x92A5, 0x92A7, 0x92A8,
0x92AB, 0x92AF, 0x92B2, 0x92B6, 0x92B8, 0x92BA, 0x92BB, 0x92BC,
0x92BD, 0x92BF, 0x92C0, 0x92C1, 0x92C2, 0x92C3, 0x92C5, 0x92C6,
@@ -2158,7 +2123,7 @@ static const unsigned short euc_to_utf8_8FE4[] = {
0x9358, 0x935A, 0x935E, 0x9364, 0x9365, 0x9367, 0x9369, 0x936A,
0x936D, 0x936F, 0x9370, 0x9371, 0x9373, 0x9374, 0x9376,
};
-static const unsigned short euc_to_utf8_8FE5[] = {
+const unsigned short euc_to_utf8_8FE5[] = {
0x937A, 0x937D, 0x937F, 0x9380, 0x9381, 0x9382, 0x9388,
0x938A, 0x938B, 0x938D, 0x938F, 0x9392, 0x9395, 0x9398, 0x939B,
0x939E, 0x93A1, 0x93A3, 0x93A4, 0x93A6, 0x93A8, 0x93AB, 0x93B4,
@@ -2172,7 +2137,7 @@ static const unsigned short euc_to_utf8_8FE5[] = {
0x945C, 0x945F, 0x9461, 0x9463, 0x9468, 0x946B, 0x946D, 0x946E,
0x946F, 0x9471, 0x9472, 0x9484, 0x9483, 0x9578, 0x9579,
};
-static const unsigned short euc_to_utf8_8FE6[] = {
+const unsigned short euc_to_utf8_8FE6[] = {
0x957E, 0x9584, 0x9588, 0x958C, 0x958D, 0x958E, 0x959D,
0x959E, 0x959F, 0x95A1, 0x95A6, 0x95A9, 0x95AB, 0x95AC, 0x95B4,
0x95B6, 0x95BA, 0x95BD, 0x95BF, 0x95C6, 0x95C8, 0x95C9, 0x95CB,
@@ -2186,7 +2151,7 @@ static const unsigned short euc_to_utf8_8FE6[] = {
0x96B3, 0x96BA, 0x96CA, 0x96D2, 0x5DB2, 0x96D8, 0x96DA, 0x96DD,
0x96DE, 0x96DF, 0x96E9, 0x96EF, 0x96F1, 0x96FA, 0x9702,
};
-static const unsigned short euc_to_utf8_8FE7[] = {
+const unsigned short euc_to_utf8_8FE7[] = {
0x9703, 0x9705, 0x9709, 0x971A, 0x971B, 0x971D, 0x9721,
0x9722, 0x9723, 0x9728, 0x9731, 0x9733, 0x9741, 0x9743, 0x974A,
0x974E, 0x974F, 0x9755, 0x9757, 0x9758, 0x975A, 0x975B, 0x9763,
@@ -2200,7 +2165,7 @@ static const unsigned short euc_to_utf8_8FE7[] = {
0x97F7, 0x97F8, 0x97FA, 0x9807, 0x980A, 0x9819, 0x980D, 0x980E,
0x9814, 0x9816, 0x981C, 0x981E, 0x9820, 0x9823, 0x9826,
};
-static const unsigned short euc_to_utf8_8FE8[] = {
+const unsigned short euc_to_utf8_8FE8[] = {
0x982B, 0x982E, 0x982F, 0x9830, 0x9832, 0x9833, 0x9835,
0x9825, 0x983E, 0x9844, 0x9847, 0x984A, 0x9851, 0x9852, 0x9853,
0x9856, 0x9857, 0x9859, 0x985A, 0x9862, 0x9863, 0x9865, 0x9866,
@@ -2214,7 +2179,7 @@ static const unsigned short euc_to_utf8_8FE8[] = {
0x9958, 0x9959, 0x995B, 0x995C, 0x995E, 0x995F, 0x9960, 0x999B,
0x999D, 0x999F, 0x99A6, 0x99B0, 0x99B1, 0x99B2, 0x99B5,
};
-static const unsigned short euc_to_utf8_8FE9[] = {
+const unsigned short euc_to_utf8_8FE9[] = {
0x99B9, 0x99BA, 0x99BD, 0x99BF, 0x99C3, 0x99C9, 0x99D3,
0x99D4, 0x99D9, 0x99DA, 0x99DC, 0x99DE, 0x99E7, 0x99EA, 0x99EB,
0x99EC, 0x99F0, 0x99F4, 0x99F5, 0x99F9, 0x99FD, 0x99FE, 0x9A02,
@@ -2228,7 +2193,7 @@ static const unsigned short euc_to_utf8_8FE9[] = {
0x9AE5, 0x9AE7, 0x9AE9, 0x9AEC, 0x9AF2, 0x9AF3, 0x9AF5, 0x9AF9,
0x9AFA, 0x9AFD, 0x9AFF, 0x9B00, 0x9B01, 0x9B02, 0x9B03,
};
-static const unsigned short euc_to_utf8_8FEA[] = {
+const unsigned short euc_to_utf8_8FEA[] = {
0x9B04, 0x9B05, 0x9B08, 0x9B09, 0x9B0B, 0x9B0C, 0x9B0D,
0x9B0E, 0x9B10, 0x9B12, 0x9B16, 0x9B19, 0x9B1B, 0x9B1C, 0x9B20,
0x9B26, 0x9B2B, 0x9B2D, 0x9B33, 0x9B34, 0x9B35, 0x9B37, 0x9B39,
@@ -2242,7 +2207,7 @@ static const unsigned short euc_to_utf8_8FEA[] = {
0x9BC8, 0x9BCE, 0x9BD0, 0x9BD7, 0x9BD8, 0x9BDD, 0x9BDF, 0x9BE5,
0x9BE7, 0x9BEA, 0x9BEB, 0x9BEF, 0x9BF3, 0x9BF7, 0x9BF8,
};
-static const unsigned short euc_to_utf8_8FEB[] = {
+const unsigned short euc_to_utf8_8FEB[] = {
0x9BF9, 0x9BFA, 0x9BFD, 0x9BFF, 0x9C00, 0x9C02, 0x9C0B,
0x9C0F, 0x9C11, 0x9C16, 0x9C18, 0x9C19, 0x9C1A, 0x9C1C, 0x9C1E,
0x9C22, 0x9C23, 0x9C26, 0x9C27, 0x9C28, 0x9C29, 0x9C2A, 0x9C31,
@@ -2256,7 +2221,7 @@ static const unsigned short euc_to_utf8_8FEB[] = {
0x9D47, 0x9D4A, 0x9D53, 0x9D54, 0x9D5F, 0x9D63, 0x9D62, 0x9D65,
0x9D69, 0x9D6A, 0x9D6B, 0x9D70, 0x9D76, 0x9D77, 0x9D7B,
};
-static const unsigned short euc_to_utf8_8FEC[] = {
+const unsigned short euc_to_utf8_8FEC[] = {
0x9D7C, 0x9D7E, 0x9D83, 0x9D84, 0x9D86, 0x9D8A, 0x9D8D,
0x9D8E, 0x9D92, 0x9D93, 0x9D95, 0x9D96, 0x9D97, 0x9D98, 0x9DA1,
0x9DAA, 0x9DAC, 0x9DAE, 0x9DB1, 0x9DB5, 0x9DB9, 0x9DBC, 0x9DBF,
@@ -2270,7 +2235,7 @@ static const unsigned short euc_to_utf8_8FEC[] = {
0x9EB5, 0x9EC6, 0x9EC8, 0x9ECB, 0x9ED5, 0x9EDF, 0x9EE4, 0x9EE7,
0x9EEC, 0x9EED, 0x9EEE, 0x9EF0, 0x9EF1, 0x9EF2, 0x9EF5,
};
-static const unsigned short euc_to_utf8_8FED[] = {
+const unsigned short euc_to_utf8_8FED[] = {
0x9EF8, 0x9EFF, 0x9F02, 0x9F03, 0x9F09, 0x9F0F, 0x9F10,
0x9F11, 0x9F12, 0x9F14, 0x9F16, 0x9F17, 0x9F19, 0x9F1A, 0x9F1B,
0x9F1F, 0x9F22, 0x9F26, 0x9F2A, 0x9F2B, 0x9F2F, 0x9F31, 0x9F32,
@@ -2284,7 +2249,7 @@ static const unsigned short euc_to_utf8_8FED[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0,
};
-static const unsigned short euc_to_utf8_8FF3[] = {
+const unsigned short euc_to_utf8_8FF3[] = {
0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -2298,7 +2263,7 @@ static const unsigned short euc_to_utf8_8FF3[] = {
0, 0, 0, 0x2170, 0x2171, 0x2172, 0x2173, 0x2174,
0x2175, 0x2176, 0x2177, 0x2178, 0x2179, 0x2160, 0x2161,
};
-static const unsigned short euc_to_utf8_8FF4[] = {
+const unsigned short euc_to_utf8_8FF4[] = {
0x2162, 0x2163, 0x2164, 0x2165, 0x2166, 0x2167, 0x2168,
0x2169, 0xff07, 0xff02, 0x3231, 0x2116, 0x2121, 0x70bb, 0x4efc,
0x50f4, 0x51ec, 0x5307, 0x5324, 0xfa0e, 0x548a, 0x5759, 0xfa0f,
@@ -2381,33 +2346,6 @@ const unsigned short *const euc_to_utf8_2bytes_ms[] = {
0, euc_to_utf8_F9, euc_to_utf8_FA, euc_to_utf8_FB,
euc_to_utf8_FC_ms, 0, 0,
};
-/* CP10001 */
-const unsigned short *const euc_to_utf8_2bytes_mac[] = {
- euc_to_utf8_A1_ms, euc_to_utf8_A2_ms, euc_to_utf8_A3,
- euc_to_utf8_A4, euc_to_utf8_A5, euc_to_utf8_A6, euc_to_utf8_A7,
- euc_to_utf8_A8, euc_to_utf8_A9, euc_to_utf8_AA, euc_to_utf8_AB,
- euc_to_utf8_AC_mac, euc_to_utf8_AD_mac, euc_to_utf8_AE, euc_to_utf8_AF,
- euc_to_utf8_B0, euc_to_utf8_B1, euc_to_utf8_B2, euc_to_utf8_B3,
- euc_to_utf8_B4, euc_to_utf8_B5, euc_to_utf8_B6, euc_to_utf8_B7,
- euc_to_utf8_B8, euc_to_utf8_B9, euc_to_utf8_BA, euc_to_utf8_BB,
- euc_to_utf8_BC, euc_to_utf8_BD, euc_to_utf8_BE, euc_to_utf8_BF,
- euc_to_utf8_C0, euc_to_utf8_C1, euc_to_utf8_C2, euc_to_utf8_C3,
- euc_to_utf8_C4, euc_to_utf8_C5, euc_to_utf8_C6, euc_to_utf8_C7,
- euc_to_utf8_C8, euc_to_utf8_C9, euc_to_utf8_CA, euc_to_utf8_CB,
- euc_to_utf8_CC, euc_to_utf8_CD, euc_to_utf8_CE, euc_to_utf8_CF,
- euc_to_utf8_D0, euc_to_utf8_D1, euc_to_utf8_D2, euc_to_utf8_D3,
- euc_to_utf8_D4, euc_to_utf8_D5, euc_to_utf8_D6, euc_to_utf8_D7,
- euc_to_utf8_D8, euc_to_utf8_D9, euc_to_utf8_DA, euc_to_utf8_DB,
- euc_to_utf8_DC, euc_to_utf8_DD, euc_to_utf8_DE, euc_to_utf8_DF,
- euc_to_utf8_E0, euc_to_utf8_E1, euc_to_utf8_E2, euc_to_utf8_E3,
- euc_to_utf8_E4, euc_to_utf8_E5, euc_to_utf8_E6, euc_to_utf8_E7,
- euc_to_utf8_E8, euc_to_utf8_E9, euc_to_utf8_EA, euc_to_utf8_EB,
- euc_to_utf8_EC, euc_to_utf8_ED, euc_to_utf8_EE, euc_to_utf8_EF,
- euc_to_utf8_F0, euc_to_utf8_F1, euc_to_utf8_F2, euc_to_utf8_F3,
- euc_to_utf8_F4, euc_to_utf8_F5, 0, 0,
- 0, euc_to_utf8_F9, euc_to_utf8_FA, euc_to_utf8_FB,
- euc_to_utf8_FC_ms, 0, 0,
-};
#ifdef X0212_ENABLE
const unsigned short *const x0212_to_utf8_2bytes[] = {
@@ -2439,7 +2377,7 @@ const unsigned short *const x0212_to_utf8_2bytes[] = {
#endif /* UTF8_OUTPUT_ENABLE */
#ifdef UTF8_INPUT_ENABLE
-static const unsigned short utf8_to_euc_C2[] = {
+const unsigned short utf8_to_euc_C2[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -2449,7 +2387,7 @@ static const unsigned short utf8_to_euc_C2[] = {
0x216B, 0x215E, 0, 0, 0x212D, 0, 0x2279, 0,
0xA231, 0, 0xA26B, 0, 0, 0, 0, 0xA244,
};
-static const unsigned short utf8_to_euc_C2_ms[] = {
+const unsigned short utf8_to_euc_C2_ms[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -2459,17 +2397,7 @@ static const unsigned short utf8_to_euc_C2_ms[] = {
0x216B, 0x215E, 0, 0, 0x212D, 0, 0x2279, 0,
0xA231, 0, 0xA26B, 0, 0, 0, 0, 0xA244,
};
-static const unsigned short utf8_to_euc_C2_mac[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0x00A0, 0xA242, 0x2171, 0x2172, 0xA270, 0x5C, 0xA243, 0x2178,
- 0x212F, 0x00FD, 0xA26C, 0, 0x224C, 0, 0xA26E, 0xA234,
- 0x216B, 0x215E, 0, 0, 0x212D, 0, 0x2279, 0,
- 0xA231, 0, 0xA26B, 0, 0, 0, 0, 0xA244,
-};
-static const unsigned short utf8_to_euc_C2_932[] = {
+const unsigned short utf8_to_euc_C2_932[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -2479,7 +2407,7 @@ static const unsigned short utf8_to_euc_C2_932[] = {
0x216B, 0x215E, 0x32, 0x33, 0x212D, 0x264C, 0x2279, 0x2126,
0x2124, 0x31, 0x6F, 0x2264, 0, 0, 0, 0,
};
-static const unsigned short utf8_to_euc_C3[] = {
+const unsigned short utf8_to_euc_C3[] = {
0xAA22, 0xAA21, 0xAA24, 0xAA2A, 0xAA23, 0xAA29, 0xA921, 0xAA2E,
0xAA32, 0xAA31, 0xAA34, 0xAA33, 0xAA40, 0xAA3F, 0xAA42, 0xAA41,
0, 0xAA50, 0xAA52, 0xAA51, 0xAA54, 0xAA58, 0xAA53, 0x215F,
@@ -2489,7 +2417,7 @@ static const unsigned short utf8_to_euc_C3[] = {
0xA943, 0xAB50, 0xAB52, 0xAB51, 0xAB54, 0xAB58, 0xAB53, 0x2160,
0xA94C, 0xAB63, 0xAB62, 0xAB65, 0xAB64, 0xAB72, 0xA950, 0xAB73,
};
-static const unsigned short utf8_to_euc_C3_932[] = {
+const unsigned short utf8_to_euc_C3_932[] = {
0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x43,
0x45, 0x45, 0x45, 0x45, 0x49, 0x49, 0x49, 0x49,
0x44, 0x4E, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x215F,
@@ -2499,7 +2427,7 @@ static const unsigned short utf8_to_euc_C3_932[] = {
0x64, 0x6E, 0x6F, 0x6F, 0x6F, 0x6F, 0x6F, 0x2160,
0x6F, 0x75, 0x75, 0x75, 0x75, 0x79, 0x74, 0x79,
};
-static const unsigned short utf8_to_euc_C4[] = {
+const unsigned short utf8_to_euc_C4[] = {
0xAA27, 0xAB27, 0xAA25, 0xAB25, 0xAA28, 0xAB28, 0xAA2B, 0xAB2B,
0xAA2C, 0xAB2C, 0xAA2F, 0xAB2F, 0xAA2D, 0xAB2D, 0xAA30, 0xAB30,
0xA922, 0xA942, 0xAA37, 0xAB37, 0, 0, 0xAA36, 0xAB36,
@@ -2509,7 +2437,7 @@ static const unsigned short utf8_to_euc_C4[] = {
0xAA44, 0xA945, 0xA926, 0xA946, 0xAA48, 0xAB48, 0xAA49, 0xAB49,
0xA947, 0xAA4A, 0xAB4A, 0xAA4C, 0xAB4C, 0xAA4B, 0xAB4B, 0xA929,
};
-static const unsigned short utf8_to_euc_C5[] = {
+const unsigned short utf8_to_euc_C5[] = {
0xA949, 0xA928, 0xA948, 0xAA4D, 0xAB4D, 0xAA4F, 0xAB4F, 0xAA4E,
0xAB4E, 0xA94A, 0xA92B, 0xA94B, 0xAA57, 0xAB57, 0, 0,
0xAA56, 0xAB56, 0xA92D, 0xA94D, 0xAA59, 0xAB59, 0xAA5B, 0xAB5B,
@@ -2519,7 +2447,7 @@ static const unsigned short utf8_to_euc_C5[] = {
0xAA68, 0xAB68, 0xAA6A, 0xAB6A, 0xAA71, 0xAB71, 0xAA74, 0xAB74,
0xAA73, 0xAA75, 0xAB75, 0xAA77, 0xAB77, 0xAA76, 0xAB76, 0,
};
-static const unsigned short utf8_to_euc_C7[] = {
+const unsigned short utf8_to_euc_C7[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0xAA26, 0xAB26, 0xAA43,
0xAB43, 0xAA55, 0xAB55, 0xAA67, 0xAB67, 0xAA70, 0xAB70, 0xAA6D,
@@ -2529,7 +2457,7 @@ static const unsigned short utf8_to_euc_C7[] = {
0, 0, 0, 0, 0, 0xAB39, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
};
-static const unsigned short utf8_to_euc_CB[] = {
+const unsigned short utf8_to_euc_CB[] = {
0, 0, 0, 0, 0, 0, 0, 0xA230,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -2539,7 +2467,7 @@ static const unsigned short utf8_to_euc_CB[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
};
-static const unsigned short utf8_to_euc_CE[] = {
+const unsigned short utf8_to_euc_CE[] = {
0, 0, 0, 0, 0xA238, 0xA239, 0xA661, 0,
0xA662, 0xA663, 0xA664, 0, 0xA667, 0, 0xA669, 0xA66C,
0xA676, 0x2621, 0x2622, 0x2623, 0x2624, 0x2625, 0x2626, 0x2627,
@@ -2549,7 +2477,7 @@ static const unsigned short utf8_to_euc_CE[] = {
0xA67B, 0x2641, 0x2642, 0x2643, 0x2644, 0x2645, 0x2646, 0x2647,
0x2648, 0x2649, 0x264A, 0x264B, 0x264C, 0x264D, 0x264E, 0x264F,
};
-static const unsigned short utf8_to_euc_CF[] = {
+const unsigned short utf8_to_euc_CF[] = {
0x2650, 0x2651, 0xA678, 0x2652, 0x2653, 0x2654, 0x2655, 0x2656,
0x2657, 0x2658, 0xA675, 0xA67A, 0xA677, 0xA679, 0xA67C, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -2559,7 +2487,7 @@ static const unsigned short utf8_to_euc_CF[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
};
-static const unsigned short utf8_to_euc_D0[] = {
+const unsigned short utf8_to_euc_D0[] = {
0, 0x2727, 0xA742, 0xA743, 0xA744, 0xA745, 0xA746, 0xA747,
0xA748, 0xA749, 0xA74A, 0xA74B, 0xA74C, 0, 0xA74D, 0xA74E,
0x2721, 0x2722, 0x2723, 0x2724, 0x2725, 0x2726, 0x2728, 0x2729,
@@ -2569,7 +2497,7 @@ static const unsigned short utf8_to_euc_D0[] = {
0x2751, 0x2752, 0x2753, 0x2754, 0x2755, 0x2756, 0x2758, 0x2759,
0x275A, 0x275B, 0x275C, 0x275D, 0x275E, 0x275F, 0x2760, 0x2761,
};
-static const unsigned short utf8_to_euc_D1[] = {
+const unsigned short utf8_to_euc_D1[] = {
0x2762, 0x2763, 0x2764, 0x2765, 0x2766, 0x2767, 0x2768, 0x2769,
0x276A, 0x276B, 0x276C, 0x276D, 0x276E, 0x276F, 0x2770, 0x2771,
0, 0x2757, 0xA772, 0xA773, 0xA774, 0xA775, 0xA776, 0xA777,
@@ -2579,7 +2507,7 @@ static const unsigned short utf8_to_euc_D1[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
};
-static const unsigned short utf8_to_euc_E280[] = {
+const unsigned short utf8_to_euc_E280[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0x213E, 0, 0, 0, 0x213D, 0x213D, 0x2142, 0,
@@ -2589,7 +2517,7 @@ static const unsigned short utf8_to_euc_E280[] = {
0x2273, 0, 0x216C, 0x216D, 0, 0, 0, 0,
0, 0, 0, 0x2228, 0, 0, 0x2131, 0,
};
-static const unsigned short utf8_to_euc_E280_ms[] = {
+const unsigned short utf8_to_euc_E280_ms[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0x213E, 0, 0, 0, 0x213D, 0x213D, 0x2142, 0,
@@ -2599,7 +2527,7 @@ static const unsigned short utf8_to_euc_E280_ms[] = {
0x2273, 0, 0x216C, 0x216D, 0, 0, 0, 0,
0, 0, 0, 0x2228, 0, 0, 0x7E, 0,
};
-static const unsigned short utf8_to_euc_E280_932[] = {
+const unsigned short utf8_to_euc_E280_932[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0x213E, 0, 0, 0, 0, 0x213D, 0, 0,
@@ -2609,7 +2537,7 @@ static const unsigned short utf8_to_euc_E280_932[] = {
0x2273, 0, 0x216C, 0x216D, 0, 0, 0, 0,
0, 0, 0, 0x2228, 0, 0, 0, 0,
};
-static const unsigned short utf8_to_euc_E284[] = {
+const unsigned short utf8_to_euc_E284[] = {
0, 0, 0, 0x216E, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0x2D62, 0,
@@ -2619,17 +2547,7 @@ static const unsigned short utf8_to_euc_E284[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
};
-static const unsigned short utf8_to_euc_E284_mac[] = {
- 0, 0, 0, 0x216E, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0x2B7B, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0x2B7D, 0x00FE, 0, 0, 0, 0, 0,
- 0, 0, 0, 0x2272, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-};
-static const unsigned short utf8_to_euc_E285[] = {
+const unsigned short utf8_to_euc_E285[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -2639,17 +2557,7 @@ static const unsigned short utf8_to_euc_E285[] = {
0xF373, 0xF374, 0xF375, 0xF376, 0xF377, 0xF378, 0xF379, 0xF37A,
0xF37B, 0xF37C, 0, 0, 0, 0, 0, 0,
};
-static const unsigned short utf8_to_euc_E285_mac[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0x2A21, 0x2A22, 0x2A23, 0x2A24, 0x2A25, 0x2A26, 0x2A27, 0x2A28,
- 0x2A29, 0x2A2A, 0, 0, 0, 0, 0, 0,
- 0x2A35, 0x2A36, 0x2A37, 0x2A38, 0x2A39, 0x2A3A, 0x2A3B, 0x2A3C,
- 0x2A3D, 0x2A3E, 0, 0, 0, 0, 0, 0,
-};
-static const unsigned short utf8_to_euc_E286[] = {
+const unsigned short utf8_to_euc_E286[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0x222B, 0x222C, 0x222A, 0x222D, 0, 0, 0, 0,
@@ -2659,7 +2567,7 @@ static const unsigned short utf8_to_euc_E286[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
};
-static const unsigned short utf8_to_euc_E287[] = {
+const unsigned short utf8_to_euc_E287[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0x224D, 0, 0x224E, 0, 0, 0,
@@ -2669,7 +2577,7 @@ static const unsigned short utf8_to_euc_E287[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
};
-static const unsigned short utf8_to_euc_E288[] = {
+const unsigned short utf8_to_euc_E288[] = {
0x224F, 0, 0x225F, 0x2250, 0, 0, 0, 0x2260,
0x223A, 0, 0, 0x223B, 0, 0, 0, 0,
0, 0x2D74, 0x215D, 0, 0, 0, 0, 0,
@@ -2679,7 +2587,7 @@ static const unsigned short utf8_to_euc_E288[] = {
0, 0, 0, 0, 0x2168, 0x2268, 0, 0,
0, 0, 0, 0, 0, 0x2266, 0, 0,
};
-static const unsigned short utf8_to_euc_E288_932[] = {
+const unsigned short utf8_to_euc_E288_932[] = {
0x224F, 0, 0x225F, 0x2250, 0, 0, 0, 0x2260,
0x223A, 0, 0, 0x223B, 0, 0, 0, 0,
0, 0x2D74, 0, 0, 0, 0, 0, 0,
@@ -2689,17 +2597,7 @@ static const unsigned short utf8_to_euc_E288_932[] = {
0, 0, 0, 0, 0x2168, 0x2268, 0, 0,
0, 0, 0, 0, 0, 0x2266, 0, 0,
};
-static const unsigned short utf8_to_euc_E288_mac[] = {
- 0x224F, 0, 0x225F, 0x2250, 0, 0, 0, 0x2260,
- 0x223A, 0, 0, 0x223B, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0x2265, 0, 0, 0x2267, 0x2167, 0x2F22,
- 0x225C, 0, 0, 0, 0, 0x2142, 0, 0x224A,
- 0x224B, 0x2241, 0x2240, 0x2269, 0x226A, 0, 0x2F21, 0,
- 0, 0, 0, 0, 0x2168, 0x2268, 0, 0,
- 0, 0, 0, 0, 0, 0x2266, 0, 0,
-};
-static const unsigned short utf8_to_euc_E289[] = {
+const unsigned short utf8_to_euc_E289[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0x2262, 0, 0, 0, 0, 0,
@@ -2709,7 +2607,7 @@ static const unsigned short utf8_to_euc_E289[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
};
-static const unsigned short utf8_to_euc_E28A[] = {
+const unsigned short utf8_to_euc_E28A[] = {
0, 0, 0x223E, 0x223F, 0, 0, 0x223C, 0x223D,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -2719,17 +2617,7 @@ static const unsigned short utf8_to_euc_E28A[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0x2D79,
};
-static const unsigned short utf8_to_euc_E28A_mac[] = {
- 0, 0, 0x223E, 0x223F, 0, 0, 0x223C, 0x223D,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0x225D, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0x2F23,
-};
-static const unsigned short utf8_to_euc_E28C[] = {
+const unsigned short utf8_to_euc_E28C[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0x225E, 0, 0, 0, 0, 0,
@@ -2739,7 +2627,7 @@ static const unsigned short utf8_to_euc_E28C[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
};
-static const unsigned short utf8_to_euc_E291[] = {
+const unsigned short utf8_to_euc_E291[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -2749,17 +2637,7 @@ static const unsigned short utf8_to_euc_E291[] = {
0x2D31, 0x2D32, 0x2D33, 0x2D34, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
};
-static const unsigned short utf8_to_euc_E291_mac[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0x2921, 0x2922, 0x2923, 0x2924, 0x2925, 0x2926, 0x2927, 0x2928,
- 0x2929, 0x292A, 0x292B, 0x292C, 0x292D, 0x292E, 0x292F, 0x2930,
- 0x2931, 0x2932, 0x2933, 0x2934, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-};
-static const unsigned short utf8_to_euc_E294[] = {
+const unsigned short utf8_to_euc_E294[] = {
0x2821, 0x282C, 0x2822, 0x282D, 0, 0, 0, 0,
0, 0, 0, 0, 0x2823, 0, 0, 0x282E,
0x2824, 0, 0, 0x282F, 0x2826, 0, 0, 0x2831,
@@ -2769,7 +2647,7 @@ static const unsigned short utf8_to_euc_E294[] = {
0x283D, 0, 0, 0x2833, 0x282A, 0, 0, 0x283A,
0x283F, 0, 0, 0x2835, 0x282B, 0, 0, 0x283B,
};
-static const unsigned short utf8_to_euc_E295[] = {
+const unsigned short utf8_to_euc_E295[] = {
0, 0, 0x2840, 0, 0, 0, 0, 0,
0, 0, 0, 0x2836, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -2779,7 +2657,7 @@ static const unsigned short utf8_to_euc_E295[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
};
-static const unsigned short utf8_to_euc_E296[] = {
+const unsigned short utf8_to_euc_E296[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -2789,7 +2667,7 @@ static const unsigned short utf8_to_euc_E296[] = {
0, 0, 0x2225, 0x2224, 0, 0, 0, 0,
0, 0, 0, 0, 0x2227, 0x2226, 0, 0,
};
-static const unsigned short utf8_to_euc_E297[] = {
+const unsigned short utf8_to_euc_E297[] = {
0, 0, 0, 0, 0, 0, 0x2221, 0x217E,
0, 0, 0, 0x217B, 0, 0, 0x217D, 0x217C,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -2799,7 +2677,7 @@ static const unsigned short utf8_to_euc_E297[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
};
-static const unsigned short utf8_to_euc_E298[] = {
+const unsigned short utf8_to_euc_E298[] = {
0, 0, 0, 0, 0, 0x217A, 0x2179, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -2809,7 +2687,7 @@ static const unsigned short utf8_to_euc_E298[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
};
-static const unsigned short utf8_to_euc_E299[] = {
+const unsigned short utf8_to_euc_E299[] = {
0x216A, 0, 0x2169, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -2819,7 +2697,7 @@ static const unsigned short utf8_to_euc_E299[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
};
-static const unsigned short utf8_to_euc_E380[] = {
+const unsigned short utf8_to_euc_E380[] = {
0x2121, 0x2122, 0x2123, 0x2137, 0, 0x2139, 0x213A, 0x213B,
0x2152, 0x2153, 0x2154, 0x2155, 0x2156, 0x2157, 0x2158, 0x2159,
0x215A, 0x215B, 0x2229, 0x222E, 0x214C, 0x214D, 0, 0,
@@ -2829,7 +2707,7 @@ static const unsigned short utf8_to_euc_E380[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
};
-static const unsigned short utf8_to_euc_E380_932[] = {
+const unsigned short utf8_to_euc_E380_932[] = {
0x2121, 0x2122, 0x2123, 0x2137, 0, 0x2139, 0x213A, 0x213B,
0x2152, 0x2153, 0x2154, 0x2155, 0x2156, 0x2157, 0x2158, 0x2159,
0x215A, 0x215B, 0x2229, 0x222E, 0x214C, 0x214D, 0, 0,
@@ -2839,7 +2717,7 @@ static const unsigned short utf8_to_euc_E380_932[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
};
-static const unsigned short utf8_to_euc_E381[] = {
+const unsigned short utf8_to_euc_E381[] = {
0, 0x2421, 0x2422, 0x2423, 0x2424, 0x2425, 0x2426, 0x2427,
0x2428, 0x2429, 0x242A, 0x242B, 0x242C, 0x242D, 0x242E, 0x242F,
0x2430, 0x2431, 0x2432, 0x2433, 0x2434, 0x2435, 0x2436, 0x2437,
@@ -2849,7 +2727,7 @@ static const unsigned short utf8_to_euc_E381[] = {
0x2450, 0x2451, 0x2452, 0x2453, 0x2454, 0x2455, 0x2456, 0x2457,
0x2458, 0x2459, 0x245A, 0x245B, 0x245C, 0x245D, 0x245E, 0x245F,
};
-static const unsigned short utf8_to_euc_E382[] = {
+const unsigned short utf8_to_euc_E382[] = {
0x2460, 0x2461, 0x2462, 0x2463, 0x2464, 0x2465, 0x2466, 0x2467,
0x2468, 0x2469, 0x246A, 0x246B, 0x246C, 0x246D, 0x246E, 0x246F,
0x2470, 0x2471, 0x2472, 0x2473, 0, 0, 0, 0,
@@ -2859,7 +2737,7 @@ static const unsigned short utf8_to_euc_E382[] = {
0x2530, 0x2531, 0x2532, 0x2533, 0x2534, 0x2535, 0x2536, 0x2537,
0x2538, 0x2539, 0x253A, 0x253B, 0x253C, 0x253D, 0x253E, 0x253F,
};
-static const unsigned short utf8_to_euc_E382_932[] = {
+const unsigned short utf8_to_euc_E382_932[] = {
0x2460, 0x2461, 0x2462, 0x2463, 0x2464, 0x2465, 0x2466, 0x2467,
0x2468, 0x2469, 0x246A, 0x246B, 0x246C, 0x246D, 0x246E, 0x246F,
0x2470, 0x2471, 0x2472, 0x2473, 0x2574, 0, 0, 0,
@@ -2869,7 +2747,7 @@ static const unsigned short utf8_to_euc_E382_932[] = {
0x2530, 0x2531, 0x2532, 0x2533, 0x2534, 0x2535, 0x2536, 0x2537,
0x2538, 0x2539, 0x253A, 0x253B, 0x253C, 0x253D, 0x253E, 0x253F,
};
-static const unsigned short utf8_to_euc_E383[] = {
+const unsigned short utf8_to_euc_E383[] = {
0x2540, 0x2541, 0x2542, 0x2543, 0x2544, 0x2545, 0x2546, 0x2547,
0x2548, 0x2549, 0x254A, 0x254B, 0x254C, 0x254D, 0x254E, 0x254F,
0x2550, 0x2551, 0x2552, 0x2553, 0x2554, 0x2555, 0x2556, 0x2557,
@@ -2879,7 +2757,7 @@ static const unsigned short utf8_to_euc_E383[] = {
0x2570, 0x2571, 0x2572, 0x2573, 0x2574, 0x2575, 0x2576, 0,
0, 0, 0, 0x2126, 0x213C, 0x2133, 0x2134, 0,
};
-static const unsigned short utf8_to_euc_E388[] = {
+const unsigned short utf8_to_euc_E388[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -2889,17 +2767,7 @@ static const unsigned short utf8_to_euc_E388[] = {
0, 0x2D6A, 0x2D6B, 0, 0, 0, 0, 0,
0, 0x2D6C, 0, 0, 0, 0, 0, 0,
};
-static const unsigned short utf8_to_euc_E388_mac[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0x2D2E, 0x2D31, 0, 0, 0, 0, 0,
- 0, 0x2D2C, 0, 0, 0, 0, 0, 0,
-};
-static const unsigned short utf8_to_euc_E38A[] = {
+const unsigned short utf8_to_euc_E38A[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -2909,17 +2777,7 @@ static const unsigned short utf8_to_euc_E38A[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
};
-static const unsigned short utf8_to_euc_E38A_mac[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0x2D73, 0x2D74, 0x2D75, 0x2D76,
- 0x2D77, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-};
-static const unsigned short utf8_to_euc_E38C[] = {
+const unsigned short utf8_to_euc_E38C[] = {
0, 0, 0, 0x2D46, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0x2D4A, 0, 0,
0, 0, 0, 0, 0x2D41, 0, 0, 0,
@@ -2929,17 +2787,7 @@ static const unsigned short utf8_to_euc_E38C[] = {
0, 0, 0, 0, 0, 0, 0x2D47, 0,
0, 0, 0, 0x2D4F, 0, 0, 0, 0,
};
-static const unsigned short utf8_to_euc_E38C_mac[] = {
- 0, 0, 0, 0x2E29, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0x2E32, 0, 0,
- 0, 0, 0, 0, 0x2E24, 0, 0, 0,
- 0x2E2B, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0x2E22, 0x2E34, 0, 0, 0x2E35, 0x2E2D,
- 0, 0, 0, 0x2E37, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0x2E2A, 0,
- 0, 0, 0, 0x2E36, 0, 0, 0, 0,
-};
-static const unsigned short utf8_to_euc_E38D[] = {
+const unsigned short utf8_to_euc_E38D[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0x2D40, 0x2D4E, 0, 0, 0x2D43, 0, 0,
0, 0x2D48, 0, 0, 0, 0, 0, 0x2D49,
@@ -2949,17 +2797,7 @@ static const unsigned short utf8_to_euc_E38D[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0x2D5F, 0x2D6F, 0x2D6E, 0x2D6D, 0,
};
-static const unsigned short utf8_to_euc_E38D_mac[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0x2E21, 0x2E2F, 0, 0, 0x2E23, 0, 0,
- 0, 0x2E2E, 0, 0, 0, 0, 0, 0x2E31,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0x2E6A, 0x2E69, 0x2E68, 0x2E67, 0,
-};
-static const unsigned short utf8_to_euc_E38E[] = {
+const unsigned short utf8_to_euc_E38E[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0x2D53, 0x2D54,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -2969,17 +2807,7 @@ static const unsigned short utf8_to_euc_E38E[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
};
-static const unsigned short utf8_to_euc_E38E_mac[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0x2B2B, 0x2B2D,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0x2B21, 0x2B23, 0x2B29, 0,
- 0, 0x2B27, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-};
-static const unsigned short utf8_to_euc_E38F[] = {
+const unsigned short utf8_to_euc_E38F[] = {
0, 0, 0, 0, 0x2D55, 0, 0, 0,
0, 0, 0, 0, 0, 0x2D63, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -2989,17 +2817,7 @@ static const unsigned short utf8_to_euc_E38F[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
};
-static const unsigned short utf8_to_euc_E38F_mac[] = {
- 0, 0, 0, 0, 0x2B2E, 0, 0, 0,
- 0, 0, 0, 0, 0, 0x2B7C, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-};
-static const unsigned short utf8_to_euc_E4B8[] = {
+const unsigned short utf8_to_euc_E4B8[] = {
0x306C, 0x437A, 0xB021, 0x3C37, 0xB022, 0xB023, 0, 0x4B7C,
0x3E66, 0x3B30, 0x3E65, 0x323C, 0xB024, 0x4954, 0x4D3F, 0,
0x5022, 0x312F, 0xB025, 0, 0x336E, 0x5023, 0x4024, 0x5242,
@@ -3009,7 +2827,7 @@ static const unsigned short utf8_to_euc_E4B8[] = {
0xB02D, 0x5025, 0x367A, 0, 0, 0xB02E, 0x5026, 0,
0x345D, 0x4330, 0, 0x3C67, 0x5027, 0, 0, 0x5028,
};
-static const unsigned short utf8_to_euc_E4B9[] = {
+const unsigned short utf8_to_euc_E4B9[] = {
0xB02F, 0xB030, 0x5029, 0x4735, 0xB031, 0x3557, 0, 0xB032,
0, 0, 0, 0x4737, 0, 0x4663, 0x3843, 0x4B33,
0, 0xB033, 0, 0, 0, 0x6949, 0x502A, 0x3E68,
@@ -3019,7 +2837,7 @@ static const unsigned short utf8_to_euc_E4B9[] = {
0, 0x4D70, 0, 0x467D, 0xB039, 0xB03A, 0, 0,
0, 0xB03B, 0, 0, 0, 0, 0x3425, 0xB03C,
};
-static const unsigned short utf8_to_euc_E4BA[] = {
+const unsigned short utf8_to_euc_E4BA[] = {
0x3535, 0, 0x502C, 0, 0, 0x502D, 0x4E3B, 0,
0x4D3D, 0x4168, 0x502F, 0x3B76, 0x4673, 0xB03D, 0x5032, 0,
0, 0x313E, 0x385F, 0, 0x385E, 0x3066, 0xB03E, 0xB03F,
@@ -3029,7 +2847,7 @@ static const unsigned short utf8_to_euc_E4BA[] = {
0x5037, 0, 0, 0x5038, 0, 0, 0x5039, 0,
0, 0xB042, 0x3F4D, 0, 0, 0, 0, 0,
};
-static const unsigned short utf8_to_euc_E4BB[] = {
+const unsigned short utf8_to_euc_E4BB[] = {
0x3D3A, 0x3F4E, 0x503E, 0xB043, 0x503C, 0, 0x503D, 0x3558,
0, 0, 0x3A23, 0x3270, 0, 0x503B, 0x503A, 0x4A29,
0xB044, 0, 0, 0, 0x3B46, 0x3B45, 0x423E, 0x503F,
@@ -3039,7 +2857,7 @@ static const unsigned short utf8_to_euc_E4BB[] = {
0x3644, 0xB04C, 0x4367, 0xB04D, 0, 0xB04E, 0x376F, 0x5043,
0, 0, 0, 0x4724, 0xF42F, 0xB04F, 0xB050, 0xB051,
};
-static const unsigned short utf8_to_euc_E4BC[] = {
+const unsigned short utf8_to_euc_E4BC[] = {
0xB052, 0x346B, 0xB053, 0xB054, 0, 0, 0, 0,
0xB055, 0x5044, 0x304B, 0xB056, 0xB057, 0x3860, 0x346C, 0x497A,
0x4832, 0x3559, 0xB058, 0, 0, 0xB059, 0xB05A, 0xB05B,
@@ -3049,7 +2867,7 @@ static const unsigned short utf8_to_euc_E4BC[] = {
0x5046, 0xB05E, 0, 0xB060, 0x483C, 0xB061, 0x4E62, 0xB062,
0x3F2D, 0xB063, 0x3B47, 0xB064, 0x3B77, 0x3240, 0xB065, 0,
};
-static const unsigned short utf8_to_euc_E4BD[] = {
+const unsigned short utf8_to_euc_E4BD[] = {
0xB066, 0, 0xB067, 0x4451, 0, 0, 0x4322, 0x504A,
0xB068, 0xB069, 0, 0xB06A, 0xB06B, 0x304C, 0x4463, 0x3D3B,
0x3A34, 0x4D24, 0xB06C, 0x424E, 0xB06D, 0x323F, 0xB06E, 0x5049,
@@ -3059,7 +2877,7 @@ static const unsigned short utf8_to_euc_E4BD[] = {
0x5051, 0xB075, 0, 0x3242, 0, 0x4A3B, 0x504B, 0xB076,
0xB077, 0xB078, 0xB079, 0x504F, 0x3873, 0xB07A, 0xB07B, 0x3B48,
};
-static const unsigned short utf8_to_euc_E4BE[] = {
+const unsigned short utf8_to_euc_E4BE[] = {
0, 0xB07C, 0xB07D, 0x3426, 0xB07E, 0xB121, 0x5054, 0,
0x504C, 0xB122, 0xB123, 0x4E63, 0xB124, 0x3B78, 0xB125, 0x504D,
0xB126, 0x5052, 0xB127, 0xB128, 0xB129, 0, 0x5055, 0xB12A,
@@ -3069,7 +2887,7 @@ static const unsigned short utf8_to_euc_E4BE[] = {
0, 0, 0xB12F, 0, 0, 0x3F2F, 0x4E37, 0xB130,
0, 0xB131, 0, 0xB132, 0xB133, 0xB134, 0xB135, 0x4A58,
};
-static const unsigned short utf8_to_euc_E4BF[] = {
+const unsigned short utf8_to_euc_E4BF[] = {
0xB136, 0xB137, 0x3738, 0x4225, 0x3264, 0xB138, 0xB139, 0,
0xB13A, 0xB13B, 0x3D53, 0xB13C, 0xB13D, 0xB13E, 0x5059, 0xB13F,
0x505E, 0x505C, 0xB140, 0, 0x5057, 0, 0, 0x422F,
@@ -3079,7 +2897,7 @@ static const unsigned short utf8_to_euc_E4BF[] = {
0xB144, 0, 0xB145, 0x4750, 0, 0x4936, 0x5068, 0,
0x4A70, 0, 0x3236, 0, 0xB146, 0xB147, 0x506C, 0xB148,
};
-static const unsigned short utf8_to_euc_E580[] = {
+const unsigned short utf8_to_euc_E580[] = {
0xB149, 0xB14A, 0, 0, 0xB14B, 0x5066, 0x506F, 0xB14C,
0, 0x4152, 0xB14D, 0x3844, 0xB14E, 0x475C, 0xB14F, 0x6047,
0xB150, 0x506E, 0x455D, 0xB151, 0x5063, 0, 0x3876, 0xB152,
@@ -3089,7 +2907,7 @@ static const unsigned short utf8_to_euc_E580[] = {
0xB15B, 0, 0xB15C, 0xB15D, 0, 0xB15E, 0x3666, 0,
0, 0x3770, 0, 0xB176, 0, 0, 0, 0,
};
-static const unsigned short utf8_to_euc_E581[] = {
+const unsigned short utf8_to_euc_E581[] = {
0xB15F, 0xB160, 0xB161, 0x5070, 0, 0xB162, 0xB163, 0x5071,
0x5075, 0x304E, 0xB164, 0, 0xB165, 0, 0xB166, 0x4A50,
0x5074, 0xB167, 0xB168, 0xB169, 0, 0x5073, 0x5077, 0xB16A,
@@ -3099,7 +2917,7 @@ static const unsigned short utf8_to_euc_E581[] = {
0xB174, 0xB175, 0x3C45, 0, 0x4226, 0x4465, 0x3676, 0,
0x5079, 0, 0, 0, 0, 0x3536, 0, 0,
};
-static const unsigned short utf8_to_euc_E582[] = {
+const unsigned short utf8_to_euc_E582[] = {
0x507A, 0xB177, 0, 0xB178, 0xB179, 0x507C, 0xB17A, 0,
0, 0, 0xB17B, 0, 0, 0x4B35, 0xB17C, 0xB17D,
0xB17E, 0x3766, 0xB221, 0xB222, 0xB223, 0, 0xB224, 0,
@@ -3109,7 +2927,7 @@ static const unsigned short utf8_to_euc_E582[] = {
0xB22E, 0, 0x507E, 0x5123, 0x507D, 0x3A44, 0, 0x3D7D,
0, 0xB22F, 0xB230, 0, 0, 0xB231, 0x3739, 0,
};
-static const unsigned short utf8_to_euc_E583[] = {
+const unsigned short utf8_to_euc_E583[] = {
0xB232, 0, 0x5124, 0xB233, 0xB234, 0x364F, 0, 0xB235,
0, 0x5121, 0x5122, 0, 0xB236, 0x462F, 0xB237, 0x417C,
0xB238, 0x3623, 0, 0xB239, 0xB23A, 0x4B4D, 0x5125, 0,
@@ -3119,7 +2937,7 @@ static const unsigned short utf8_to_euc_E583[] = {
0, 0xB245, 0xB251, 0, 0xF430, 0x512C, 0xB246, 0,
0, 0x512B, 0xB247, 0x4A48, 0, 0, 0xB248, 0,
};
-static const unsigned short utf8_to_euc_E584[] = {
+const unsigned short utf8_to_euc_E584[] = {
0x3537, 0x512E, 0x512F, 0xB249, 0x322F, 0, 0xB24A, 0xB24B,
0xB24C, 0x512D, 0, 0xB24D, 0xB24E, 0xB24F, 0xB250, 0,
0xB252, 0, 0x3C74, 0, 0x5132, 0x5131, 0x5130, 0xB253,
@@ -3129,7 +2947,7 @@ static const unsigned short utf8_to_euc_E584[] = {
0, 0xB25F, 0x4C59, 0xB260, 0xB261, 0xB262, 0, 0x5136,
0xB263, 0xB264, 0x5135, 0x5138, 0x5137, 0, 0, 0x5139,
};
-static const unsigned short utf8_to_euc_E585[] = {
+const unsigned short utf8_to_euc_E585[] = {
0x513A, 0x3074, 0xB265, 0x3835, 0x373B, 0x3D3C, 0x437B, 0x3624,
0x4068, 0x3877, 0xB266, 0x396E, 0x513C, 0x4C48, 0x4546, 0xB267,
0x3B79, 0, 0x513B, 0xB268, 0x513D, 0xB269, 0, 0xB26A,
@@ -3139,7 +2957,7 @@ static const unsigned short utf8_to_euc_E585[] = {
0, 0x3626, 0, 0, 0, 0x4A3C, 0x4236, 0x3671,
0x4535, 0, 0, 0, 0x3773, 0, 0xB26F, 0,
};
-static const unsigned short utf8_to_euc_E586[] = {
+const unsigned short utf8_to_euc_E586[] = {
0x5143, 0, 0x5144, 0xB270, 0xB271, 0x4662, 0x315F, 0,
0, 0x5147, 0x3A7D, 0xB272, 0x5146, 0x3A46, 0xB273, 0x5148,
0x666E, 0x5149, 0x4B41, 0x514A, 0, 0x514B, 0x514C, 0x3E69,
@@ -3149,7 +2967,7 @@ static const unsigned short utf8_to_euc_E586[] = {
0x5156, 0x5154, 0x5155, 0x5153, 0x3A63, 0x5157, 0x4C6A, 0x4E64,
0xB279, 0, 0xB27A, 0, 0xB27B, 0x5158, 0xB27C, 0xB27D,
};
-static const unsigned short utf8_to_euc_E587[] = {
+const unsigned short utf8_to_euc_E587[] = {
0, 0, 0xB27E, 0, 0x4028, 0x5159, 0x3D5A, 0,
0xB321, 0x515A, 0, 0x437C, 0x4E3F, 0x4560, 0, 0xB322,
0, 0xB323, 0xB324, 0xB325, 0, 0xB326, 0x5245, 0,
@@ -3159,7 +2977,7 @@ static const unsigned short utf8_to_euc_E587[] = {
0x5160, 0x332E, 0xB32C, 0xB32D, 0xB32E, 0x5161, 0x3627, 0xB32F,
0x464C, 0x317A, 0x3D50, 0, 0, 0x4821, 0x5162, 0,
};
-static const unsigned short utf8_to_euc_E588[] = {
+const unsigned short utf8_to_euc_E588[] = {
0x4561, 0xB330, 0xB331, 0x3F4F, 0x5163, 0xB332, 0x4A2C, 0x405A,
0x3422, 0, 0x3429, 0x5164, 0, 0, 0x5166, 0,
0, 0x373A, 0xB333, 0xB334, 0x5165, 0xB335, 0xB336, 0x4E73,
@@ -3169,7 +2987,7 @@ static const unsigned short utf8_to_euc_E588[] = {
0x457E, 0xB33A, 0xB33B, 0x516A, 0, 0xB33C, 0x4029, 0x3A7E,
0x3774, 0x516B, 0x3B49, 0x396F, 0xB33D, 0, 0, 0,
};
-static const unsigned short utf8_to_euc_E589[] = {
+const unsigned short utf8_to_euc_E589[] = {
0, 0, 0, 0x4466, 0x516D, 0xB33E, 0, 0x4227,
0, 0xB33F, 0x3A6F, 0x516E, 0x516F, 0x4130, 0, 0x516C,
0, 0, 0, 0, 0x5171, 0xB340, 0x4B36, 0xB341,
@@ -3179,7 +2997,7 @@ static const unsigned short utf8_to_euc_E589[] = {
0x3E6A, 0x517B, 0x3364, 0x5175, 0x5173, 0x414F, 0, 0xB34A,
0xB34B, 0xB34C, 0, 0, 0, 0x5177, 0, 0x5176,
};
-static const unsigned short utf8_to_euc_E58A[] = {
+const unsigned short utf8_to_euc_E58A[] = {
0xB34D, 0, 0xB34E, 0x3344, 0, 0xB34F, 0, 0x3760,
0x517C, 0x4E2D, 0xB350, 0, 0xB351, 0x5178, 0, 0,
0, 0x517D, 0x517A, 0xB352, 0x5179, 0xB353, 0xB354, 0xB355,
@@ -3189,7 +3007,7 @@ static const unsigned short utf8_to_euc_E58A[] = {
0xB35E, 0x4E65, 0, 0, 0x4F2B, 0x5225, 0xB35F, 0xB360,
0xB361, 0x387A, 0xB362, 0xB363, 0x5224, 0xB364, 0x332F, 0,
};
-static const unsigned short utf8_to_euc_E58B[] = {
+const unsigned short utf8_to_euc_E58B[] = {
0xB365, 0x5226, 0, 0x4B56, 0xB366, 0x443C, 0xB367, 0x4D26,
0xB368, 0x4A59, 0, 0, 0xB369, 0x5227, 0, 0xB36A,
0, 0xB36B, 0x7055, 0, 0xB36C, 0x4630, 0xB36D, 0x5228,
@@ -3199,7 +3017,7 @@ static const unsigned short utf8_to_euc_E58B[] = {
0xB376, 0xB377, 0x372E, 0x522E, 0xB378, 0x522F, 0xB379, 0xB37A,
0x5230, 0x5231, 0x3C5B, 0, 0, 0, 0x387B, 0x4C5E,
};
-static const unsigned short utf8_to_euc_E58C[] = {
+const unsigned short utf8_to_euc_E58C[] = {
0xB37B, 0x4C68, 0x4677, 0xB37C, 0, 0x4A71, 0x5232, 0xF432,
0x5233, 0, 0xB37D, 0xB37E, 0xB421, 0x5235, 0, 0x5237,
0x5236, 0xB422, 0, 0xB423, 0, 0x5238, 0x323D, 0x4B4C,
@@ -3209,7 +3027,7 @@ static const unsigned short utf8_to_euc_E58C[] = {
0xB430, 0x523C, 0xB431, 0x523D, 0, 0xB432, 0, 0,
0x523E, 0x4924, 0x3668, 0x3065, 0xB433, 0xB434, 0xB435, 0x463F,
};
-static const unsigned short utf8_to_euc_E58D[] = {
+const unsigned short utf8_to_euc_E58D[] = {
0x523F, 0x3D3D, 0xB436, 0x4069, 0, 0x5241, 0x5240, 0x3E23,
0x3861, 0x5243, 0x483E, 0xB438, 0xB437, 0x5244, 0, 0,
0, 0x485C, 0x4234, 0x426E, 0x3628, 0, 0, 0x466E,
@@ -3219,7 +3037,7 @@ static const unsigned short utf8_to_euc_E58D[] = {
0x3075, 0x346D, 0xB440, 0x4228, 0x3551, 0x4D71, 0, 0x524B,
0x3237, 0xB441, 0, 0x524A, 0, 0, 0xB442, 0x362A,
};
-static const unsigned short utf8_to_euc_E58E[] = {
+const unsigned short utf8_to_euc_E58E[] = {
0, 0, 0x524C, 0xB443, 0x4C71, 0, 0, 0xB444,
0xB445, 0, 0, 0, 0, 0, 0xB446, 0,
0, 0, 0, 0xB447, 0xB448, 0, 0x524D, 0,
@@ -3229,7 +3047,7 @@ static const unsigned short utf8_to_euc_E58E[] = {
0x5252, 0, 0xB450, 0x3837, 0xB451, 0xB452, 0x5253, 0xB453,
0xB454, 0, 0xB455, 0x356E, 0, 0xB456, 0, 0,
};
-static const unsigned short utf8_to_euc_E58F[] = {
+const unsigned short utf8_to_euc_E58F[] = {
0xB457, 0, 0x3B32, 0x5254, 0, 0xB458, 0, 0,
0x4B74, 0x3A35, 0x355A, 0x4D27, 0x4150, 0x483F, 0x3C7D, 0xB459,
0, 0, 0xB45A, 0xB45B, 0x3D47, 0xB45C, 0x3C68, 0x3C75,
@@ -3239,7 +3057,7 @@ static const unsigned short utf8_to_euc_E58F[] = {
0x4266, 0x3C38, 0x3B4B, 0x3126, 0, 0xB463, 0x3370, 0x3966,
0x3B4A, 0, 0x525D, 0, 0, 0, 0, 0,
};
-static const unsigned short utf8_to_euc_E590[] = {
+const unsigned short utf8_to_euc_E590[] = {
0, 0x525E, 0xB464, 0x3549, 0x3346, 0, 0, 0,
0x3967, 0x3548, 0x445F, 0x3125, 0x4631, 0x4C3E, 0x3921, 0x4D79,
0x4547, 0x387E, 0, 0xB465, 0, 0, 0, 0,
@@ -3249,7 +3067,7 @@ static const unsigned short utf8_to_euc_E590[] = {
0, 0xB46C, 0, 0, 0xB46D, 0xB46E, 0x5265, 0,
0x355B, 0x3F61, 0, 0x4A2D, 0x5263, 0x525F, 0x3863, 0,
};
-static const unsigned short utf8_to_euc_E591[] = {
+const unsigned short utf8_to_euc_E591[] = {
0x5260, 0, 0x4F24, 0xB46F, 0xB470, 0, 0x4A72, 0xB471,
0x4468, 0x3862, 0x3970, 0, 0, 0xB472, 0x5268, 0xB473,
0, 0x465D, 0, 0, 0, 0, 0, 0,
@@ -3259,7 +3077,7 @@ static const unsigned short utf8_to_euc_E591[] = {
0x526F, 0x526D, 0, 0x4C23, 0xB47D, 0x526A, 0x5273, 0x526E,
0, 0, 0, 0x5271, 0x3846, 0x4C3F, 0, 0xB47E,
};
-static const unsigned short utf8_to_euc_E592[] = {
+const unsigned short utf8_to_euc_E592[] = {
0x5272, 0xB521, 0, 0xB522, 0x5274, 0xB523, 0x5276, 0,
0xB524, 0xB525, 0xF435, 0x3A70, 0x4F42, 0xB526, 0x526B, 0x5269,
0x5275, 0xB527, 0x5270, 0, 0, 0xB528, 0xB529, 0,
@@ -3269,7 +3087,7 @@ static const unsigned short utf8_to_euc_E592[] = {
0, 0xB533, 0x3A69, 0x3331, 0, 0, 0, 0xB534,
0x5279, 0xB535, 0xB536, 0xB537, 0x5325, 0x3076, 0x5324, 0xB538,
};
-static const unsigned short utf8_to_euc_E593[] = {
+const unsigned short utf8_to_euc_E593[] = {
0x3025, 0x494A, 0x5322, 0, 0x527C, 0, 0xB539, 0x5277,
0x527D, 0x3A48, 0xB53A, 0, 0, 0xB53B, 0xB53C, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -3279,7 +3097,7 @@ static const unsigned short utf8_to_euc_E593[] = {
0, 0, 0x452F, 0, 0, 0, 0xB541, 0,
0, 0, 0x532E, 0, 0xB542, 0x532B, 0xB543, 0xB544,
};
-static const unsigned short utf8_to_euc_E594[] = {
+const unsigned short utf8_to_euc_E594[] = {
0xB545, 0xB546, 0, 0, 0x3134, 0xB547, 0x3A36, 0x3F30,
0xB548, 0xB549, 0, 0, 0xB54A, 0xB54B, 0xB54C, 0x5329,
0x4562, 0, 0, 0, 0x532A, 0xB54D, 0x3022, 0,
@@ -3289,7 +3107,7 @@ static const unsigned short utf8_to_euc_E594[] = {
0, 0x3E27, 0xB550, 0x533A, 0, 0xB551, 0xB552, 0,
0x5339, 0x5330, 0, 0xB553, 0xB554, 0xB555, 0x4243, 0,
};
-static const unsigned short utf8_to_euc_E595[] = {
+const unsigned short utf8_to_euc_E595[] = {
0x5331, 0xB556, 0, 0, 0x426F, 0x5336, 0x3E26, 0xB557,
0, 0xB558, 0xB559, 0, 0x5333, 0xB55A, 0, 0x4C64,
0xB55B, 0xB55C, 0, 0x373C, 0, 0, 0x5337, 0x5338,
@@ -3299,7 +3117,7 @@ static const unsigned short utf8_to_euc_E595[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0x5341, 0x5346, 0, 0x5342, 0xB565,
};
-static const unsigned short utf8_to_euc_E596[] = {
+const unsigned short utf8_to_euc_E596[] = {
0x533D, 0xB566, 0xB567, 0x5347, 0x4131, 0, 0xB568, 0x5349,
0xB569, 0x3922, 0x533F, 0x437D, 0, 0, 0xB56A, 0xB56B,
0, 0xB56C, 0xB56D, 0xB56E, 0xB56F, 0, 0, 0xB570,
@@ -3309,7 +3127,7 @@ static const unsigned short utf8_to_euc_E596[] = {
0x3674, 0, 0xB574, 0, 0, 0, 0x3144, 0,
0, 0, 0, 0, 0, 0, 0, 0xB575,
};
-static const unsigned short utf8_to_euc_E597[] = {
+const unsigned short utf8_to_euc_E597[] = {
0, 0xB576, 0, 0xB577, 0x534E, 0x534C, 0xB578, 0x5427,
0, 0xB579, 0, 0xB57A, 0xB57B, 0, 0xB57C, 0,
0, 0xB57D, 0xB57E, 0xB621, 0x5351, 0, 0, 0xB622,
@@ -3319,7 +3137,7 @@ static const unsigned short utf8_to_euc_E597[] = {
0, 0, 0, 0, 0, 0, 0xB628, 0x5353,
0, 0x5358, 0, 0, 0, 0x5356, 0x5355, 0xB629,
};
-static const unsigned short utf8_to_euc_E598[] = {
+const unsigned short utf8_to_euc_E598[] = {
0, 0, 0, 0, 0, 0xB62A, 0x4332, 0,
0xB62B, 0x3245, 0xB62C, 0, 0, 0xB62D, 0xB62E, 0xB62F,
0xB630, 0xB631, 0xB632, 0, 0x5352, 0, 0x5354, 0x3E28,
@@ -3329,7 +3147,7 @@ static const unsigned short utf8_to_euc_E598[] = {
0xB635, 0x3E7C, 0x535E, 0xB636, 0x535C, 0xB637, 0x535D, 0xB638,
0x535F, 0xB639, 0, 0xB63A, 0xB63B, 0xB63C, 0, 0xB63D,
};
-static const unsigned short utf8_to_euc_E599[] = {
+const unsigned short utf8_to_euc_E599[] = {
0xB63E, 0xB63F, 0x313D, 0xB640, 0xB641, 0, 0xB642, 0,
0, 0xB643, 0, 0xB644, 0x4139, 0xB645, 0x5359, 0xB646,
0x535A, 0, 0, 0, 0xB647, 0, 0, 0,
@@ -3339,7 +3157,7 @@ static const unsigned short utf8_to_euc_E599[] = {
0, 0xB651, 0xB652, 0, 0x4A2E, 0xB653, 0, 0,
0x4655, 0, 0x4838, 0, 0, 0, 0, 0,
};
-static const unsigned short utf8_to_euc_E59A[] = {
+const unsigned short utf8_to_euc_E59A[] = {
0x5366, 0, 0, 0, 0xB654, 0xB655, 0x5365, 0x3345,
0xB656, 0, 0x5367, 0xB657, 0xB658, 0, 0, 0x536A,
0, 0, 0, 0, 0x5369, 0xB659, 0, 0,
@@ -3349,7 +3167,7 @@ static const unsigned short utf8_to_euc_E59A[] = {
0, 0xB666, 0, 0xB667, 0x536E, 0, 0x536D, 0xB668,
0, 0, 0, 0, 0x5370, 0, 0xB669, 0,
};
-static const unsigned short utf8_to_euc_E59B[] = {
+const unsigned short utf8_to_euc_E59B[] = {
0x5373, 0x5371, 0x536F, 0x5372, 0, 0xB66A, 0, 0,
0x5374, 0xB66B, 0xB66C, 0xB66D, 0xB670, 0xB671, 0x5375, 0xB66E,
0xB66F, 0x5376, 0, 0x5377, 0, 0, 0, 0x5378,
@@ -3359,7 +3177,7 @@ static const unsigned short utf8_to_euc_E59B[] = {
0x3A24, 0xB67C, 0x304F, 0x3F5E, 0, 0, 0xB721, 0xB722,
0, 0x537A, 0x3847, 0, 0, 0x3971, 0, 0x537C,
};
-static const unsigned short utf8_to_euc_E59C[] = {
+const unsigned short utf8_to_euc_E59C[] = {
0x537B, 0xB723, 0xB724, 0x4A60, 0x537D, 0, 0, 0xB725,
0x5421, 0x537E, 0xB726, 0x5422, 0xB727, 0x5423, 0, 0x3777,
0, 0xB728, 0x3160, 0x5424, 0, 0xB729, 0x5426, 0,
@@ -3369,7 +3187,7 @@ static const unsigned short utf8_to_euc_E59C[] = {
0x434F, 0, 0, 0xB737, 0xB738, 0, 0, 0x542A,
0x542B, 0, 0, 0x542D, 0, 0xB739, 0xB73A, 0xB73B,
};
-static const unsigned short utf8_to_euc_E59D[] = {
+const unsigned short utf8_to_euc_E59D[] = {
0x542E, 0, 0x3A64, 0, 0, 0xB73C, 0xB73D, 0x3651,
0, 0, 0x4B37, 0, 0xB73E, 0xB73F, 0x542C, 0x542F,
0x3A41, 0x3923, 0xB740, 0, 0, 0, 0, 0,
@@ -3379,7 +3197,7 @@ static const unsigned short utf8_to_euc_E59D[] = {
0xB749, 0xB74A, 0, 0xB74B, 0xB74C, 0xB74D, 0, 0xB74E,
0, 0xB74F, 0xB750, 0xB751, 0xB752, 0, 0xB753, 0x5434,
};
-static const unsigned short utf8_to_euc_E59E[] = {
+const unsigned short utf8_to_euc_E59E[] = {
0, 0xB754, 0x3F62, 0xB755, 0, 0, 0, 0,
0x5432, 0x5435, 0, 0x373F, 0xB756, 0, 0, 0,
0, 0, 0, 0x5436, 0xB757, 0xB760, 0, 0xB758,
@@ -3389,7 +3207,7 @@ static const unsigned short utf8_to_euc_E59E[] = {
0x543B, 0, 0, 0x5438, 0, 0, 0, 0,
0xB765, 0, 0, 0, 0, 0xB766, 0, 0,
};
-static const unsigned short utf8_to_euc_E59F[] = {
+const unsigned short utf8_to_euc_E59F[] = {
0x5431, 0, 0, 0x543C, 0, 0, 0x543D, 0xB767,
0xB768, 0, 0, 0x4B64, 0xB769, 0, 0x3E6B, 0xB76A,
0, 0, 0x543F, 0x5440, 0x543E, 0xB76B, 0x5442, 0,
@@ -3399,7 +3217,7 @@ static const unsigned short utf8_to_euc_E59F[] = {
0xB773, 0, 0, 0, 0x3E7D, 0xB774, 0xB775, 0x3C39,
0xB776, 0x475D, 0x3470, 0, 0x3A6B, 0xB777, 0xB778, 0xB779,
};
-static const unsigned short utf8_to_euc_E5A0[] = {
+const unsigned short utf8_to_euc_E5A0[] = {
0x4B59, 0, 0x4632, 0xB77A, 0xB77B, 0x3778, 0x424F, 0,
0xB77C, 0xB77D, 0x5441, 0x5444, 0xB821, 0xB822, 0, 0,
0, 0, 0, 0, 0, 0x4244, 0, 0,
@@ -3409,7 +3227,7 @@ static const unsigned short utf8_to_euc_E5A0[] = {
0x3161, 0x4A73, 0xB82A, 0, 0x3E6C, 0x4548, 0, 0,
0, 0xB82B, 0x3A66, 0, 0, 0x544E, 0, 0xB82C,
};
-static const unsigned short utf8_to_euc_E5A1[] = {
+const unsigned short utf8_to_euc_E5A1[] = {
0x4A3D, 0x4E5D, 0, 0, 0, 0, 0, 0,
0, 0xB82D, 0x3274, 0x544A, 0xB82E, 0xB82F, 0, 0xB830,
0xB831, 0x413A, 0x544D, 0, 0x4563, 0xB832, 0, 0x4549,
@@ -3419,7 +3237,7 @@ static const unsigned short utf8_to_euc_E5A1[] = {
0x544B, 0, 0x5447, 0, 0, 0x3F50, 0, 0,
0xB838, 0x544F, 0, 0, 0xB839, 0, 0x3D4E, 0xB83A,
};
-static const unsigned short utf8_to_euc_E5A2[] = {
+const unsigned short utf8_to_euc_E5A2[] = {
0xB83B, 0xB83C, 0, 0x362D, 0, 0x5450, 0, 0xB83D,
0xB83E, 0xB83F, 0xB840, 0, 0xB841, 0xB842, 0, 0xB843,
0xB844, 0, 0, 0x4A68, 0xB845, 0, 0xB846, 0x417D,
@@ -3429,7 +3247,7 @@ static const unsigned short utf8_to_euc_E5A2[] = {
0, 0xB84D, 0xB84E, 0x4A2F, 0, 0, 0, 0,
0x5457, 0x5451, 0x5454, 0x5456, 0xB850, 0, 0x3A26, 0,
};
-static const unsigned short utf8_to_euc_E5A3[] = {
+const unsigned short utf8_to_euc_E5A3[] = {
0, 0x4A49, 0xB851, 0, 0xB84F, 0x5459, 0, 0x4345,
0xB852, 0, 0x3275, 0, 0x3E6D, 0xB853, 0xB854, 0,
0xB855, 0x545B, 0xB856, 0x545A, 0xB857, 0x3968, 0xB858, 0x545C,
@@ -3439,7 +3257,7 @@ static const unsigned short utf8_to_euc_E5A3[] = {
0x403C, 0x306D, 0x4764, 0xB85E, 0, 0, 0, 0x445B,
0, 0x5465, 0x5464, 0x5466, 0x5467, 0x5468, 0, 0,
};
-static const unsigned short utf8_to_euc_E5A4[] = {
+const unsigned short utf8_to_euc_E5A4[] = {
0, 0, 0x5469, 0, 0, 0xB85F, 0xB860, 0,
0, 0x4A51, 0x546A, 0xB861, 0xB862, 0, 0, 0x3246,
0x546B, 0, 0xB863, 0xB864, 0xB865, 0x4D3C, 0x3330, 0,
@@ -3449,7 +3267,7 @@ static const unsigned short utf8_to_euc_E5A4[] = {
0xB86D, 0x3C3A, 0x5471, 0xB86E, 0, 0xB86F, 0xB870, 0x3050,
0x5472, 0, 0, 0, 0, 0, 0x5473, 0xB871,
};
-static const unsigned short utf8_to_euc_E5A5[] = {
+const unsigned short utf8_to_euc_E5A5[] = {
0, 0, 0, 0xB872, 0x3162, 0, 0xB873, 0x3471,
0x4660, 0x4A74, 0, 0, 0, 0, 0x5477, 0x4155,
0x5476, 0x3740, 0xB874, 0xB875, 0x4B5B, 0x5475, 0, 0x4565,
@@ -3459,7 +3277,7 @@ static const unsigned short utf8_to_euc_E5A5[] = {
0, 0, 0xB922, 0x3D77, 0x455B, 0xB923, 0xB924, 0,
0x5521, 0xB925, 0, 0xB926, 0xB927, 0x3925, 0, 0,
};
-static const unsigned short utf8_to_euc_E5A6[] = {
+const unsigned short utf8_to_euc_E5A6[] = {
0, 0x5522, 0x4721, 0x485E, 0x4C51, 0, 0, 0,
0, 0, 0x4725, 0xB928, 0xB929, 0x552B, 0xB92A, 0,
0, 0, 0xB92B, 0x3538, 0, 0xB92C, 0x4D45, 0xB92D,
@@ -3469,7 +3287,7 @@ static const unsigned short utf8_to_euc_E5A6[] = {
0xB934, 0, 0x5527, 0xB935, 0, 0, 0, 0xB936,
0, 0x4B65, 0xB937, 0x3A4A, 0xB938, 0, 0x3E2A, 0,
};
-static const unsigned short utf8_to_euc_E5A7[] = {
+const unsigned short utf8_to_euc_E5A7[] = {
0, 0xB939, 0, 0xB93A, 0xB93B, 0, 0x5528, 0,
0xB93C, 0x3B50, 0xB93D, 0x3B4F, 0, 0xB93E, 0, 0,
0x3039, 0x3848, 0xB93F, 0x402B, 0x3051, 0, 0, 0,
@@ -3479,7 +3297,7 @@ static const unsigned short utf8_to_euc_E5A7[] = {
0, 0xB948, 0xB949, 0, 0xB94A, 0, 0x3028, 0xB94B,
0, 0, 0, 0x3079, 0, 0, 0, 0x3B51,
};
-static const unsigned short utf8_to_euc_E5A8[] = {
+const unsigned short utf8_to_euc_E5A8[] = {
0xB94C, 0x3052, 0, 0x3023, 0xB94D, 0, 0, 0,
0, 0x5532, 0, 0, 0xB94E, 0xB94F, 0xB950, 0,
0, 0x5530, 0xB951, 0xB952, 0, 0, 0, 0,
@@ -3489,7 +3307,7 @@ static const unsigned short utf8_to_euc_E5A8[] = {
0xB95A, 0, 0, 0, 0, 0x5537, 0x5538, 0,
0, 0, 0, 0, 0x3E2B, 0, 0, 0,
};
-static const unsigned short utf8_to_euc_E5A9[] = {
+const unsigned short utf8_to_euc_E5A9[] = {
0x5534, 0x4F2C, 0, 0, 0xB95B, 0xB95C, 0x474C, 0xB95D,
0xB95E, 0x5536, 0, 0, 0xB95F, 0, 0, 0,
0xB960, 0, 0, 0, 0, 0xB961, 0, 0,
@@ -3499,7 +3317,7 @@ static const unsigned short utf8_to_euc_E5A9[] = {
0, 0, 0, 0, 0, 0, 0, 0xB967,
0, 0, 0xB968, 0xB969, 0, 0, 0xB96A, 0x4C3B,
};
-static const unsigned short utf8_to_euc_E5AA[] = {
+const unsigned short utf8_to_euc_E5AA[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0xB96B, 0, 0, 0, 0,
0xB96C, 0, 0x475E, 0xB96D, 0, 0, 0xB96E, 0,
@@ -3509,7 +3327,7 @@ static const unsigned short utf8_to_euc_E5AA[] = {
0, 0xB977, 0xB978, 0xB979, 0, 0xB97A, 0, 0,
0xB97B, 0, 0xB97C, 0xB97D, 0x553C, 0x5540, 0x553D, 0xB97E,
};
-static const unsigned short utf8_to_euc_E5AB[] = {
+const unsigned short utf8_to_euc_E5AB[] = {
0, 0x3247, 0x553F, 0, 0xBA21, 0, 0xBA22, 0,
0xBA23, 0x3C3B, 0, 0x553E, 0x3779, 0, 0, 0xBA24,
0x554C, 0, 0, 0, 0, 0, 0x5545, 0x5542,
@@ -3519,7 +3337,7 @@ static const unsigned short utf8_to_euc_E5AB[] = {
0, 0, 0, 0, 0, 0xBA2B, 0xBA2C, 0,
0, 0, 0x5546, 0x5547, 0, 0xBA2D, 0, 0,
};
-static const unsigned short utf8_to_euc_E5AC[] = {
+const unsigned short utf8_to_euc_E5AC[] = {
0xBA2E, 0xBA2F, 0, 0, 0, 0, 0, 0,
0xBA30, 0x3472, 0, 0x5549, 0x5548, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0x554A, 0xBA31,
@@ -3529,7 +3347,7 @@ static const unsigned short utf8_to_euc_E5AC[] = {
0x3145, 0, 0x554B, 0, 0xBA32, 0, 0x554E, 0,
0xBA39, 0, 0, 0, 0, 0, 0x554F, 0,
};
-static const unsigned short utf8_to_euc_E5AD[] = {
+const unsigned short utf8_to_euc_E5AD[] = {
0x5552, 0xBA3A, 0, 0x5550, 0, 0x5551, 0, 0,
0, 0, 0, 0xBA3B, 0xBA3C, 0, 0, 0,
0x3B52, 0x5553, 0xBA3D, 0, 0x3926, 0x5554, 0xBA3E, 0x3B7A,
@@ -3539,7 +3357,7 @@ static const unsigned short utf8_to_euc_E5AD[] = {
0x5559, 0x5623, 0, 0x555A, 0, 0x555B, 0, 0,
0x555C, 0, 0x555E, 0, 0xBA43, 0xBA44, 0xBA45, 0xBA46,
};
-static const unsigned short utf8_to_euc_E5AE[] = {
+const unsigned short utf8_to_euc_E5AE[] = {
0x555F, 0xBA47, 0, 0x5560, 0xBA48, 0x4270, 0xBA49, 0x3127,
0x3C69, 0x3042, 0xBA4A, 0x4157, 0x3430, 0x3C35, 0xBA4B, 0x3928,
0xBA4C, 0xBA4D, 0, 0xBA4E, 0xBA4F, 0x4566, 0xBA50, 0x3D21,
@@ -3549,7 +3367,7 @@ static const unsigned short utf8_to_euc_E5AE[] = {
0x3A4B, 0xBA56, 0xBA57, 0x3332, 0x3163, 0x3E2C, 0x3248, 0xBA58,
0x5562, 0x4D46, 0xBA59, 0, 0xBA5A, 0, 0, 0x3D49,
};
-static const unsigned short utf8_to_euc_E5AF[] = {
+const unsigned short utf8_to_euc_E5AF[] = {
0xBA5B, 0xBA5C, 0x3C64, 0x5563, 0x3473, 0x4652, 0x4C29, 0x5564,
0, 0x5565, 0, 0, 0x4959, 0xBA5D, 0, 0xBA5E,
0x5567, 0, 0x3428, 0x3677, 0x5566, 0, 0xBA5F, 0xBA60,
@@ -3559,7 +3377,7 @@ static const unsigned short utf8_to_euc_E5AF[] = {
0x556E, 0xBA66, 0, 0x5570, 0xBA67, 0x437E, 0x556F, 0,
0x4023, 0, 0x3B7B, 0, 0, 0xBA68, 0x4250, 0x3C77,
};
-static const unsigned short utf8_to_euc_E5B0[] = {
+const unsigned short utf8_to_euc_E5B0[] = {
0, 0x4975, 0x406C, 0, 0x3C4D, 0x5571, 0x3E2D, 0x5572,
0x5573, 0x3053, 0x423A, 0x3F52, 0xBA69, 0x5574, 0x4633, 0x3E2E,
0, 0x3E2F, 0, 0x5575, 0, 0, 0x406D, 0xBA6A,
@@ -3569,7 +3387,7 @@ static const unsigned short utf8_to_euc_E5B0[] = {
0xBA73, 0x3D22, 0xBA74, 0, 0, 0xBA75, 0xBA76, 0,
0x5579, 0x557A, 0x3C5C, 0x3F2C, 0x4674, 0x3F54, 0x4878, 0x4722,
};
-static const unsigned short utf8_to_euc_E5B1[] = {
+const unsigned short utf8_to_euc_E5B1[] = {
0x3649, 0x557B, 0, 0, 0, 0x356F, 0x557C, 0,
0x367E, 0, 0x464F, 0x3230, 0, 0x3B53, 0x557D, 0x5622,
0x5621, 0x367D, 0, 0x557E, 0, 0x4538, 0, 0,
@@ -3579,7 +3397,7 @@ static const unsigned short utf8_to_euc_E5B1[] = {
0xBB22, 0x3B33, 0, 0, 0xBB23, 0xBB24, 0x5627, 0,
0, 0x5628, 0xBB25, 0xBB26, 0xBB27, 0xBB28, 0, 0,
};
-static const unsigned short utf8_to_euc_E5B2[] = {
+const unsigned short utf8_to_euc_E5B2[] = {
0, 0, 0, 0, 0, 0, 0, 0xBB29,
0xBB2A, 0, 0xBB2B, 0, 0x5629, 0, 0, 0xBB2C,
0x3474, 0x562A, 0xBB2D, 0, 0x562B, 0, 0, 0,
@@ -3589,7 +3407,7 @@ static const unsigned short utf8_to_euc_E5B2[] = {
0, 0x4252, 0xBB35, 0x3359, 0xBB36, 0xBB37, 0x562F, 0x5631,
0x345F, 0, 0xBB38, 0x562E, 0x5630, 0, 0x5633, 0,
};
-static const unsigned short utf8_to_euc_E5B3[] = {
+const unsigned short utf8_to_euc_E5B3[] = {
0, 0, 0, 0, 0, 0x5632, 0, 0x5634,
0, 0xBB39, 0, 0xBB3A, 0, 0, 0, 0,
0, 0, 0xBB3B, 0, 0, 0, 0, 0xBB3D,
@@ -3599,7 +3417,7 @@ static const unsigned short utf8_to_euc_E5B3[] = {
0x4A76, 0xBB3F, 0xBB40, 0, 0xBB41, 0xF43B, 0x4567, 0,
0, 0, 0x5638, 0x3D54, 0, 0x5637, 0, 0,
};
-static const unsigned short utf8_to_euc_E5B4[] = {
+const unsigned short utf8_to_euc_E5B4[] = {
0, 0xBB42, 0, 0, 0, 0, 0xBB43, 0x3F72,
0, 0, 0, 0x563C, 0, 0xBB44, 0x3A6A, 0,
0, 0x5642, 0xBB45, 0, 0x5643, 0x563D, 0x3333, 0x563E,
@@ -3609,7 +3427,7 @@ static const unsigned short utf8_to_euc_E5B4[] = {
0, 0xBB4B, 0, 0, 0xBB4C, 0, 0, 0,
0, 0xBB4D, 0, 0, 0, 0xBB4E, 0, 0xBB4F,
};
-static const unsigned short utf8_to_euc_E5B5[] = {
+const unsigned short utf8_to_euc_E5B5[] = {
0, 0, 0xBB50, 0xBB51, 0, 0, 0xBB52, 0,
0xBB53, 0, 0xBB57, 0x564B, 0x5648, 0, 0x564A, 0,
0x4D72, 0xBB55, 0x5649, 0xF43C, 0, 0xBB54, 0, 0,
@@ -3619,7 +3437,7 @@ static const unsigned short utf8_to_euc_E5B5[] = {
0xBB5F, 0, 0, 0x564D, 0, 0, 0x564E, 0,
0, 0xBB60, 0xBB61, 0, 0, 0, 0xBB62, 0xBB63,
};
-static const unsigned short utf8_to_euc_E5B6[] = {
+const unsigned short utf8_to_euc_E5B6[] = {
0, 0xBB64, 0x5651, 0xBB65, 0x5650, 0, 0, 0x564F,
0xBB66, 0, 0xBB67, 0x4568, 0x563A, 0, 0, 0,
0x5657, 0, 0xBB68, 0xBB69, 0xBB6A, 0xBB6B, 0, 0,
@@ -3629,7 +3447,7 @@ static const unsigned short utf8_to_euc_E5B6[] = {
0xBB72, 0, 0xE674, 0, 0xBB73, 0, 0, 0x5658,
0xBB74, 0xBB75, 0x4E66, 0, 0x5659, 0x5656, 0, 0,
};
-static const unsigned short utf8_to_euc_E5B7[] = {
+const unsigned short utf8_to_euc_E5B7[] = {
0, 0, 0, 0xBB76, 0, 0, 0, 0xBB77,
0, 0x565A, 0, 0xBB78, 0x3460, 0x565B, 0xBB7A, 0,
0xBB79, 0, 0x565D, 0x565C, 0, 0, 0x565E, 0,
@@ -3639,7 +3457,7 @@ static const unsigned short utf8_to_euc_E5B7[] = {
0, 0x384A, 0x5661, 0x4C26, 0x4743, 0x5662, 0, 0x392B,
0xBC22, 0xBC23, 0, 0x342C, 0, 0x4327, 0x3652, 0,
};
-static const unsigned short utf8_to_euc_E5B8[] = {
+const unsigned short utf8_to_euc_E5B8[] = {
0xBC24, 0, 0x3B54, 0x495B, 0, 0, 0x4841, 0xBC25,
0, 0, 0, 0x5663, 0x3475, 0xBC26, 0, 0,
0, 0x5666, 0xBC27, 0, 0xBC28, 0xBC29, 0x4421, 0,
@@ -3649,7 +3467,7 @@ static const unsigned short utf8_to_euc_E5B8[] = {
0x3522, 0, 0xBC2F, 0x4422, 0, 0xBC30, 0x5668, 0x5669,
0x3E6F, 0, 0, 0, 0, 0x4B39, 0xBC31, 0,
};
-static const unsigned short utf8_to_euc_E5B9[] = {
+const unsigned short utf8_to_euc_E5B9[] = {
0x566C, 0, 0, 0x566B, 0x566A, 0x497D, 0, 0x5673,
0, 0xBC34, 0, 0xBC32, 0x4B5A, 0, 0x566D, 0,
0xBC33, 0xBC35, 0, 0, 0x566F, 0x4B6B, 0xBC36, 0x566E,
@@ -3659,7 +3477,7 @@ static const unsigned short utf8_to_euc_E5B9[] = {
0xBC41, 0, 0x3433, 0x4A3F, 0x472F, 0x5674, 0x5675, 0,
0x392C, 0x3434, 0x5676, 0x3838, 0x4D44, 0x4D29, 0x3476, 0x5678,
};
-static const unsigned short utf8_to_euc_E5BA[] = {
+const unsigned short utf8_to_euc_E5BA[] = {
0xBC42, 0x4423, 0, 0x392D, 0x3E31, 0, 0, 0x485F,
0, 0, 0x3E32, 0xBC43, 0, 0, 0xBC44, 0x3D78,
0, 0, 0, 0, 0, 0x446C, 0x4A79, 0x4539,
@@ -3669,7 +3487,7 @@ static const unsigned short utf8_to_euc_E5BA[] = {
0, 0xBC4B, 0, 0xBC4C, 0, 0x3043, 0x3D6E, 0x392F,
0x4D47, 0, 0, 0, 0, 0xBC4D, 0xBC4E, 0xBC4F,
};
-static const unsigned short utf8_to_euc_E5BB[] = {
+const unsigned short utf8_to_euc_E5BB[] = {
0, 0x567A, 0x567B, 0x4751, 0, 0, 0xBC50, 0,
0x567C, 0x4E77, 0x4F2D, 0xBC52, 0xBC51, 0, 0xBC53, 0x567E,
0x567D, 0xBC54, 0xBC55, 0x3347, 0xBC56, 0xBC57, 0x5721, 0,
@@ -3679,7 +3497,7 @@ static const unsigned short utf8_to_euc_E5BB[] = {
0x572D, 0x572B, 0, 0x572C, 0x572E, 0, 0x3164, 0x446E,
0x572F, 0, 0x377A, 0x3276, 0x4736, 0, 0x5730, 0x467B,
};
-static const unsigned short utf8_to_euc_E5BC[] = {
+const unsigned short utf8_to_euc_E5BC[] = {
0, 0x4A5B, 0xBC5C, 0x5731, 0x4F2E, 0, 0xBC5D, 0xBC5E,
0xBC5F, 0x5732, 0x4A40, 0x5735, 0x5021, 0x5031, 0xBC60, 0x3C30,
0x4675, 0x5736, 0, 0x355D, 0x4424, 0x307A, 0x5737, 0x4A26,
@@ -3689,7 +3507,7 @@ static const unsigned short utf8_to_euc_E5BC[] = {
0xBC6C, 0x3C65, 0, 0, 0xBC6D, 0x4425, 0xBC6E, 0x362F,
0x573A, 0, 0, 0xBC6F, 0x492B, 0xBC70, 0x4346, 0xBC71,
};
-static const unsigned short utf8_to_euc_E5BD[] = {
+const unsigned short utf8_to_euc_E5BD[] = {
0xBC72, 0x573B, 0, 0, 0xBC73, 0xBC74, 0, 0xBC75,
0x573C, 0, 0x3630, 0, 0x573D, 0xBC76, 0x573E, 0,
0xBC77, 0x5740, 0, 0x4576, 0xBC78, 0, 0x5741, 0x5742,
@@ -3699,7 +3517,7 @@ static const unsigned short utf8_to_euc_E5BD[] = {
0x3E34, 0x3146, 0xBD22, 0x5746, 0xBD23, 0xBD24, 0, 0x5747,
0xBD25, 0x4C72, 0xBD26, 0, 0x4860, 0xBD27, 0xBD28, 0x574A,
};
-static const unsigned short utf8_to_euc_E5BE[] = {
+const unsigned short utf8_to_euc_E5BE[] = {
0x317D, 0x402C, 0x5749, 0x5748, 0x3742, 0x4254, 0, 0x574E,
0x574C, 0xBD29, 0x574B, 0x4E27, 0x3865, 0xBD2A, 0, 0xBD2B,
0x3D79, 0x574D, 0x454C, 0x3D3E, 0, 0, 0xBD2C, 0x4640,
@@ -3709,7 +3527,7 @@ static const unsigned short utf8_to_euc_E5BE[] = {
0xBD35, 0xBD36, 0, 0x4641, 0x4427, 0, 0, 0xF43E,
0xBD37, 0x4530, 0, 0, 0x5755, 0x352B, 0, 0,
};
-static const unsigned short utf8_to_euc_E5BF[] = {
+const unsigned short utf8_to_euc_E5BF[] = {
0, 0, 0, 0x3F34, 0xBD38, 0x492C, 0, 0xBD39,
0xBD3A, 0xBD3B, 0, 0xBD3C, 0x3477, 0x4726, 0, 0,
0xBD3D, 0xBD3E, 0xBD3F, 0xBD40, 0xBD41, 0, 0x5756, 0x3B56,
@@ -3719,7 +3537,7 @@ static const unsigned short utf8_to_euc_E5BF[] = {
0x582D, 0x575A, 0xBD4C, 0xBD4D, 0, 0x4730, 0xBD4E, 0,
0x5759, 0, 0xBD4F, 0x5757, 0xBD50, 0x397A, 0, 0x575D,
};
-static const unsigned short utf8_to_euc_E680[] = {
+const unsigned short utf8_to_euc_E680[] = {
0, 0, 0, 0, 0, 0, 0, 0xBD51,
0, 0, 0xBD52, 0, 0, 0xBD53, 0x5763, 0x5769,
0x5761, 0, 0x455C, 0xBD54, 0xBD55, 0x5766, 0x495D, 0xBD56,
@@ -3729,7 +3547,7 @@ static const unsigned short utf8_to_euc_E680[] = {
0, 0x5764, 0, 0xBD5C, 0, 0xBD5D, 0, 0,
0, 0, 0x576A, 0, 0, 0, 0, 0,
};
-static const unsigned short utf8_to_euc_E681[] = {
+const unsigned short utf8_to_euc_E681[] = {
0xBD5E, 0x576C, 0x5776, 0x5774, 0, 0, 0x5771, 0xBD5F,
0xBD60, 0xBD61, 0x5770, 0x4E78, 0xBD62, 0x5772, 0, 0,
0x3632, 0xBD63, 0x3931, 0, 0xBD64, 0x3D7A, 0xBD65, 0xBD66,
@@ -3739,7 +3557,7 @@ static const unsigned short utf8_to_euc_E681[] = {
0x3366, 0xBD6A, 0, 0, 0, 0x3743, 0, 0x576E,
0, 0, 0, 0, 0, 0, 0xBD6B, 0xBD6C,
};
-static const unsigned short utf8_to_euc_E682[] = {
+const unsigned short utf8_to_euc_E682[] = {
0, 0x577A, 0xBD6D, 0x577D, 0x5821, 0xF43F, 0xBD6E, 0,
0xBD6F, 0x3C3D, 0xBD70, 0x5827, 0x4470, 0x577B, 0xBD71, 0,
0, 0xBD72, 0x5825, 0xBD73, 0x3279, 0xBD74, 0x5823, 0x5824,
@@ -3749,7 +3567,7 @@ static const unsigned short utf8_to_euc_E682[] = {
0xBD7C, 0xBD7D, 0x4861, 0x575C, 0x582C, 0x5830, 0x4C65, 0xBD7E,
0x5829, 0, 0, 0xBE21, 0x4569, 0x582E, 0xBE22, 0,
};
-static const unsigned short utf8_to_euc_E683[] = {
+const unsigned short utf8_to_euc_E683[] = {
0, 0, 0xBE23, 0, 0xBE24, 0x3E70, 0x582F, 0x4657,
0xBE25, 0xBE26, 0xBE27, 0xBE28, 0, 0, 0xBE29, 0xBE2A,
0, 0x4F47, 0, 0x582B, 0xBE2B, 0xBE2C, 0, 0,
@@ -3759,7 +3577,7 @@ static const unsigned short utf8_to_euc_E683[] = {
0x4246, 0x583D, 0xBE33, 0x415B, 0x5838, 0xBE34, 0x5835, 0x5836,
0xBE35, 0x3C66, 0x5839, 0x583C, 0xBE36, 0xBE37, 0, 0,
};
-static const unsigned short utf8_to_euc_E684[] = {
+const unsigned short utf8_to_euc_E684[] = {
0x5837, 0x3D25, 0xBE38, 0x583A, 0, 0, 0x5834, 0xBE39,
0x4C7C, 0x4C7B, 0xBE3A, 0, 0xBE3B, 0x583E, 0x583F, 0x3055,
0xBE3C, 0xBE3D, 0xBE3E, 0xBE3F, 0xBE40, 0x5833, 0xBE41, 0xBE42,
@@ -3769,7 +3587,7 @@ static const unsigned short utf8_to_euc_E684[] = {
0xBE49, 0xBE4A, 0, 0, 0x5848, 0xBE4B, 0xBE4C, 0xBE4D,
0, 0xBE4E, 0, 0, 0x5846, 0x5849, 0x5841, 0x5845,
};
-static const unsigned short utf8_to_euc_E685[] = {
+const unsigned short utf8_to_euc_E685[] = {
0, 0xBE4F, 0x584A, 0, 0x584B, 0xBE50, 0xBE51, 0x5840,
0x3B7C, 0xBE52, 0x5844, 0x4256, 0x3932, 0x5832, 0x3F35, 0,
0, 0, 0, 0x5858, 0, 0x4A69, 0, 0,
@@ -3779,7 +3597,7 @@ static const unsigned short utf8_to_euc_E685[] = {
0x3056, 0x5855, 0xBE56, 0x584C, 0x5852, 0x5859, 0x3744, 0x584D,
0xBE57, 0, 0, 0xBE58, 0xBE59, 0, 0x4D5D, 0xBE5A,
};
-static const unsigned short utf8_to_euc_E686[] = {
+const unsigned short utf8_to_euc_E686[] = {
0xBE5B, 0xBE5C, 0x4D2B, 0xBE5D, 0xBE5E, 0, 0, 0x585C,
0, 0, 0x5860, 0xBE5F, 0, 0xBE60, 0x417E, 0,
0x4E79, 0x5861, 0xBE61, 0xBE62, 0x585E, 0, 0x585B, 0xBE63,
@@ -3789,7 +3607,7 @@ static const unsigned short utf8_to_euc_E686[] = {
0, 0, 0x377B, 0, 0, 0, 0x3231, 0,
0xBE6D, 0xBE6E, 0x586B, 0, 0xBE6F, 0, 0x3438, 0,
};
-static const unsigned short utf8_to_euc_E687[] = {
+const unsigned short utf8_to_euc_E687[] = {
0xBE70, 0xBE71, 0xBE72, 0x5869, 0, 0, 0x586A, 0x3A29,
0x5868, 0x5866, 0x5865, 0x586C, 0x5864, 0x586E, 0xBE73, 0xBE74,
0x327B, 0, 0, 0, 0, 0xBE75, 0, 0,
@@ -3799,7 +3617,7 @@ static const unsigned short utf8_to_euc_E687[] = {
0, 0, 0x4428, 0, 0x5873, 0, 0x5871, 0x5867,
0x377C, 0, 0x5872, 0, 0x5876, 0x5875, 0x5877, 0x5874,
};
-static const unsigned short utf8_to_euc_E688[] = {
+const unsigned short utf8_to_euc_E688[] = {
0x5878, 0xBF24, 0, 0xBF25, 0xBF26, 0, 0, 0xBF27,
0x5879, 0x587A, 0x4A6A, 0, 0x587C, 0x587B, 0x3D3F, 0,
0x402E, 0x3266, 0x327C, 0xBF28, 0x587D, 0xBF29, 0x303F, 0,
@@ -3809,7 +3627,7 @@ static const unsigned short utf8_to_euc_E688[] = {
0x5925, 0, 0x5926, 0x5927, 0x4257, 0, 0, 0,
0x384D, 0xBF31, 0, 0x4C61, 0, 0xBF32, 0, 0x4B3C,
};
-static const unsigned short utf8_to_euc_E689[] = {
+const unsigned short utf8_to_euc_E689[] = {
0x3D6A, 0x5928, 0xBF33, 0xBF34, 0xBF35, 0, 0xBF36, 0x4070,
0x6E3D, 0x4862, 0, 0x3C6A, 0xBF37, 0x3A4D, 0x5929, 0,
0xBF38, 0xBF39, 0xBF3A, 0x4247, 0xBF3B, 0x4A27, 0xBF3C, 0,
@@ -3819,7 +3637,7 @@ static const unsigned short utf8_to_euc_E689[] = {
0, 0x3037, 0, 0xBF42, 0, 0, 0x495E, 0,
0, 0x4863, 0xBF43, 0, 0x592F, 0xBF44, 0x5932, 0x3E35,
};
-static const unsigned short utf8_to_euc_E68A[] = {
+const unsigned short utf8_to_euc_E68A[] = {
0x353B, 0, 0x5930, 0x5937, 0x3E36, 0, 0, 0,
0, 0x5931, 0x4744, 0, 0, 0xBF45, 0xBF46, 0xBF47,
0xBF48, 0x4D5E, 0x5933, 0x5934, 0x5938, 0x456A, 0x5935, 0x3933,
@@ -3829,7 +3647,7 @@ static const unsigned short utf8_to_euc_E68A[] = {
0, 0x4A7A, 0, 0xBF4B, 0, 0x4471, 0xBF4C, 0xBF4D,
0, 0x4B75, 0xBF4E, 0x593B, 0x3221, 0x436A, 0xBF4F, 0xBF50,
};
-static const unsigned short utf8_to_euc_E68B[] = {
+const unsigned short utf8_to_euc_E68B[] = {
0, 0, 0x5944, 0, 0xBF51, 0x4334, 0x593E, 0x5945,
0x5940, 0x5947, 0x5943, 0, 0x5942, 0x476F, 0xBF52, 0x593C,
0x327D, 0x593A, 0x3571, 0x4273, 0x5936, 0xBF53, 0xBF54, 0x5939,
@@ -3839,7 +3657,7 @@ static const unsigned short utf8_to_euc_E68B[] = {
0, 0x594A, 0xBF57, 0x377D, 0xBF58, 0x594F, 0x3B22, 0x3969,
0, 0, 0, 0, 0xBF59, 0xBF5A, 0x3D26, 0x593D,
};
-static const unsigned short utf8_to_euc_E68C[] = {
+const unsigned short utf8_to_euc_E68C[] = {
0, 0x3B7D, 0x594C, 0xBF5B, 0xBF5C, 0, 0, 0x3B58,
0x594D, 0x3044, 0xBF5D, 0xBF5E, 0x5948, 0xBF5F, 0, 0,
0xBF60, 0x4429, 0, 0xBF61, 0, 0, 0xBF62, 0,
@@ -3849,7 +3667,7 @@ static const unsigned short utf8_to_euc_E68C[] = {
0, 0, 0, 0, 0, 0xBF67, 0xBF68, 0,
0, 0xBF69, 0x4472, 0, 0xBF6A, 0x4854, 0x5951, 0x415E,
};
-static const unsigned short utf8_to_euc_E68D[] = {
+const unsigned short utf8_to_euc_E68D[] = {
0, 0xBF6B, 0xBF6C, 0xBF6D, 0xBF6E, 0, 0xBF6F, 0,
0, 0x422A, 0xBF70, 0xBF71, 0x3B2B, 0x5952, 0xBF72, 0x5954,
0x5950, 0, 0xBF73, 0xBF74, 0xBF75, 0x4A61, 0, 0x443D,
@@ -3859,7 +3677,7 @@ static const unsigned short utf8_to_euc_E68D[] = {
0, 0xBF7C, 0x377E, 0, 0xBF7D, 0xBF7E, 0x5959, 0x3E39,
0xC021, 0, 0x4668, 0x4731, 0xC022, 0xC023, 0, 0xC024,
};
-static const unsigned short utf8_to_euc_E68E[] = {
+const unsigned short utf8_to_euc_E68E[] = {
0x5957, 0, 0xC025, 0x415D, 0xC026, 0, 0, 0xC027,
0x3C78, 0x595C, 0xC028, 0, 0x3E38, 0, 0x5956, 0x595B,
0xC029, 0, 0x4753, 0, 0xC02A, 0xC02B, 0x5955, 0,
@@ -3869,7 +3687,7 @@ static const unsigned short utf8_to_euc_E68E[] = {
0, 0, 0x3747, 0, 0x444F, 0x595E, 0, 0,
0, 0, 0, 0x415F, 0, 0xC034, 0x5961, 0,
};
-static const unsigned short utf8_to_euc_E68F[] = {
+const unsigned short utf8_to_euc_E68F[] = {
0x5963, 0xC035, 0, 0x4237, 0x5969, 0xC036, 0x5964, 0,
0xC037, 0x5966, 0, 0, 0, 0, 0xC038, 0x4941,
0x4473, 0xC039, 0x5967, 0xC03A, 0xC03B, 0xC03C, 0x4D2C, 0,
@@ -3879,7 +3697,7 @@ static const unsigned short utf8_to_euc_E68F[] = {
0, 0, 0xC042, 0xC043, 0x3167, 0xC044, 0x5968, 0,
0xC045, 0xC046, 0x4D49, 0, 0, 0, 0, 0,
};
-static const unsigned short utf8_to_euc_E690[] = {
+const unsigned short utf8_to_euc_E690[] = {
0, 0, 0, 0, 0, 0, 0x596C, 0,
0, 0xC047, 0xC048, 0, 0, 0x423B, 0, 0x5973,
0xC049, 0, 0xC04A, 0x596D, 0xC04B, 0, 0x596A, 0x5971,
@@ -3889,7 +3707,7 @@ static const unsigned short utf8_to_euc_E690[] = {
0xC055, 0, 0, 0, 0x596B, 0xC056, 0x596F, 0,
0, 0, 0x3748, 0, 0, 0xC057, 0x3A71, 0xC058,
};
-static const unsigned short utf8_to_euc_E691[] = {
+const unsigned short utf8_to_euc_E691[] = {
0, 0, 0x405D, 0, 0, 0, 0, 0,
0, 0, 0, 0xC059, 0, 0, 0x5977, 0xC05A,
0, 0xC05B, 0xC05C, 0xC05D, 0xC05E, 0, 0, 0,
@@ -3899,7 +3717,7 @@ static const unsigned short utf8_to_euc_E691[] = {
0, 0, 0, 0xC068, 0xC069, 0, 0x5976, 0,
0x4C4E, 0, 0x4022, 0xC06A, 0, 0xC06B, 0, 0,
};
-static const unsigned short utf8_to_euc_E692[] = {
+const unsigned short utf8_to_euc_E692[] = {
0, 0, 0, 0x3762, 0, 0xC06C, 0, 0xC06D,
0x597D, 0, 0, 0, 0, 0, 0, 0xC06E,
0xC06F, 0xC070, 0x3B35, 0x597A, 0, 0x5979, 0, 0,
@@ -3909,7 +3727,7 @@ static const unsigned short utf8_to_euc_E692[] = {
0x4071, 0, 0x4B50, 0xC07B, 0, 0, 0, 0,
0, 0x3349, 0, 0x5A25, 0x597E, 0xC07C, 0xC07D, 0xC07E,
};
-static const unsigned short utf8_to_euc_E693[] = {
+const unsigned short utf8_to_euc_E693[] = {
0, 0x4D4A, 0x5A27, 0, 0xC121, 0x5A23, 0, 0x5A24,
0, 0xC122, 0xC123, 0xC124, 0xC125, 0x4160, 0xC126, 0,
0xC127, 0xC128, 0x5A22, 0, 0x593F, 0xC129, 0, 0xC12A,
@@ -3919,7 +3737,7 @@ static const unsigned short utf8_to_euc_E693[] = {
0xC130, 0x5A28, 0x5A33, 0, 0x5A32, 0xC131, 0x5A31, 0xC132,
0, 0, 0x5A34, 0xC133, 0, 0x5A36, 0x3E71, 0xC134,
};
-static const unsigned short utf8_to_euc_E694[] = {
+const unsigned short utf8_to_euc_E694[] = {
0x5A35, 0xC135, 0, 0, 0xC136, 0x5A39, 0, 0,
0xC137, 0xC138, 0xC139, 0, 0, 0, 0, 0xC13A,
0, 0, 0, 0xC13B, 0xC13C, 0, 0xC13D, 0,
@@ -3929,7 +3747,7 @@ static const unsigned short utf8_to_euc_E694[] = {
0, 0xC146, 0, 0, 0x5A3D, 0x5A3E, 0x5A40, 0x5A3F,
0x5A41, 0x327E, 0xC147, 0x3936, 0xC148, 0xC149, 0x4A7C, 0x402F,
};
-static const unsigned short utf8_to_euc_E695[] = {
+const unsigned short utf8_to_euc_E695[] = {
0, 0, 0, 0xC14A, 0, 0x384E, 0, 0xC14B,
0x5A43, 0xC14C, 0, 0, 0, 0x5A46, 0xF441, 0x4952,
0xC14D, 0x355F, 0xC14E, 0, 0xC14F, 0x5A45, 0x5A44, 0x4754,
@@ -3939,7 +3757,7 @@ static const unsigned short utf8_to_euc_E695[] = {
0x3F74, 0, 0x5A4A, 0, 0x4030, 0x4528, 0, 0x495F,
0x5A4B, 0, 0xC154, 0, 0, 0xC155, 0, 0,
};
-static const unsigned short utf8_to_euc_E696[] = {
+const unsigned short utf8_to_euc_E696[] = {
0, 0xC156, 0x5A4C, 0x5A4D, 0, 0xC157, 0, 0x4A38,
0x555D, 0x4046, 0xC158, 0, 0x494C, 0, 0x3A58, 0,
0x4865, 0x4843, 0xC159, 0, 0, 0xC15A, 0, 0x454D,
@@ -3949,7 +3767,7 @@ static const unsigned short utf8_to_euc_E696[] = {
0x3F37, 0, 0xC161, 0xC162, 0xC163, 0, 0, 0x5A52,
0, 0x4A7D, 0, 0, 0x3177, 0x3B5C, 0, 0xC164,
};
-static const unsigned short utf8_to_euc_E697[] = {
+const unsigned short utf8_to_euc_E697[] = {
0, 0x5A55, 0xC165, 0x5A53, 0x5A56, 0x4E39, 0x5A54, 0,
0xC166, 0xC167, 0, 0x407B, 0x5A57, 0, 0xC168, 0x4232,
0xC169, 0, 0x5A58, 0, 0xC16A, 0, 0xC16B, 0x347A,
@@ -3959,7 +3777,7 @@ static const unsigned short utf8_to_euc_E697[] = {
0xC16E, 0x5A5D, 0xC16F, 0, 0xC170, 0xC171, 0, 0,
0, 0xC172, 0x3222, 0x5A61, 0, 0, 0xC173, 0xC174,
};
-static const unsigned short utf8_to_euc_E698[] = {
+const unsigned short utf8_to_euc_E698[] = {
0xC175, 0, 0x3937, 0x5A60, 0xC176, 0, 0x3A2B, 0x3E3A,
0xC177, 0xC178, 0x5A5F, 0, 0x3E3B, 0xC179, 0x4C40, 0x3A2A,
0, 0xC17A, 0xC17B, 0x3057, 0x404E, 0xC17C, 0xC17D, 0,
@@ -3969,7 +3787,7 @@ static const unsigned short utf8_to_euc_E698[] = {
0xC22C, 0xC22D, 0, 0xC22E, 0x5A65, 0x5A63, 0x5A64, 0xC230,
0, 0xC22F, 0, 0xF442, 0x436B, 0, 0, 0x5B26,
};
-static const unsigned short utf8_to_euc_E699[] = {
+const unsigned short utf8_to_euc_E699[] = {
0xC231, 0x5A6A, 0x3B7E, 0x3938, 0x5A68, 0xC232, 0xC233, 0,
0, 0x5A69, 0xC234, 0x3F38, 0xC235, 0, 0xC237, 0x5A67,
0, 0xC236, 0x3B2F, 0, 0, 0, 0, 0xC238,
@@ -3979,7 +3797,7 @@ static const unsigned short utf8_to_euc_E699[] = {
0x5A72, 0, 0, 0xC244, 0x4032, 0xC245, 0x3E3D, 0xC247,
0xC248, 0xC249, 0x4352, 0xC24A, 0xC24C, 0, 0xC243, 0xC246,
};
-static const unsigned short utf8_to_euc_E69A[] = {
+const unsigned short utf8_to_euc_E69A[] = {
0xC24B, 0x3647, 0, 0x5A73, 0x5A77, 0, 0, 0x324B,
0x5A74, 0x5A76, 0, 0xC24D, 0xC24E, 0xC24F, 0x5A75, 0,
0xC250, 0x3D6B, 0xC251, 0, 0, 0, 0x4348, 0x3045,
@@ -3989,7 +3807,7 @@ static const unsigned short utf8_to_euc_E69A[] = {
0, 0xC25A, 0xC25B, 0, 0x4B3D, 0xC25C, 0, 0,
0x5B22, 0x5A7B, 0, 0xC25D, 0x5A7E, 0, 0x5A7D, 0xC25E,
};
-static const unsigned short utf8_to_euc_E69B[] = {
+const unsigned short utf8_to_euc_E69B[] = {
0xC25F, 0x5A7A, 0xC260, 0xC261, 0x5B21, 0, 0, 0x465E,
0xC262, 0x5A7C, 0, 0, 0xC263, 0, 0xC264, 0xC265,
0, 0, 0, 0, 0xC266, 0, 0x5B23, 0,
@@ -3999,7 +3817,7 @@ static const unsigned short utf8_to_euc_E69B[] = {
0x5B29, 0, 0x364A, 0x3148, 0x3939, 0x5B2A, 0, 0x5B2B,
0x3D71, 0x4162, 0xC26D, 0xC23F, 0x5258, 0x413E, 0x413D, 0x4258,
};
-static const unsigned short utf8_to_euc_E69C[] = {
+const unsigned short utf8_to_euc_E69C[] = {
0x3A47, 0, 0, 0x5072, 0, 0xC26E, 0, 0xC26F,
0x376E, 0x4D2D, 0, 0x4A7E, 0, 0x497E, 0xC270, 0x5B2C,
0, 0, 0, 0xC271, 0x3A73, 0x443F, 0x5B2D, 0x4F2F,
@@ -4009,7 +3827,7 @@ static const unsigned short utf8_to_euc_E69C[] = {
0, 0x3C6B, 0, 0xC276, 0x4B51, 0, 0x5B34, 0x5B37,
0x5B36, 0, 0x3479, 0, 0, 0x3560, 0xC277, 0x5B33,
};
-static const unsigned short utf8_to_euc_E69D[] = {
+const unsigned short utf8_to_euc_E69D[] = {
0, 0x5B35, 0, 0, 0, 0xC278, 0x5B38, 0xC279,
0xC27A, 0x3F79, 0, 0, 0xC27B, 0, 0x4D7B, 0x3049,
0x3A60, 0x423C, 0, 0x3C5D, 0xC27C, 0xC27D, 0x3E73, 0,
@@ -4019,7 +3837,7 @@ static const unsigned short utf8_to_euc_E69D[] = {
0x5B3F, 0x456C, 0x5A5E, 0x5A62, 0xC324, 0x354F, 0xC325, 0x4747,
0, 0, 0, 0xC326, 0x5B41, 0, 0x3E3E, 0x4844,
};
-static const unsigned short utf8_to_euc_E69E[] = {
+const unsigned short utf8_to_euc_E69E[] = {
0, 0xC327, 0, 0, 0xC328, 0x5B47, 0, 0x487A,
0, 0x5B3E, 0, 0x5B44, 0x5B43, 0, 0xC329, 0xC32A,
0x404F, 0xC32B, 0, 0xC32C, 0, 0x4B6D, 0xC32D, 0x4E53,
@@ -4029,7 +3847,7 @@ static const unsigned short utf8_to_euc_E69E[] = {
0xC331, 0xC332, 0xC333, 0x5B4C, 0x5B4A, 0xC334, 0x324D, 0x5B48,
0x5B4E, 0x5B54, 0, 0xC335, 0xC336, 0xC337, 0, 0,
};
-static const unsigned short utf8_to_euc_E69F[] = {
+const unsigned short utf8_to_euc_E69F[] = {
0xC339, 0x4248, 0xC33A, 0xC33B, 0x4A41, 0xC33C, 0x5B56, 0,
0xC33D, 0xC33E, 0x4922, 0, 0, 0, 0x5B55, 0x4770,
0x4B3F, 0x343B, 0xC33F, 0x4077, 0x3D40, 0, 0, 0xC340,
@@ -4039,7 +3857,7 @@ static const unsigned short utf8_to_euc_E69F[] = {
0xC345, 0x436C, 0xC346, 0x4C78, 0x3C46, 0x3A74, 0xC347, 0xC348,
0, 0xC338, 0, 0x3A3A, 0, 0, 0x4B6F, 0x3341,
};
-static const unsigned short utf8_to_euc_E6A0[] = {
+const unsigned short utf8_to_euc_E6A0[] = {
0, 0xF446, 0x444E, 0x464A, 0x3149, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0x4072, 0xC34A, 0, 0x4034, 0x372A,
@@ -4049,7 +3867,7 @@ static const unsigned short utf8_to_euc_E6A0[] = {
0xC353, 0xC354, 0x5B5E, 0xC355, 0x4073, 0, 0, 0,
0x334B, 0x3A2C, 0, 0xC356, 0x334A, 0x3A4F, 0, 0xC357,
};
-static const unsigned short utf8_to_euc_E6A1[] = {
+const unsigned short utf8_to_euc_E6A1[] = {
0x5B5C, 0x3765, 0x374B, 0x456D, 0xC358, 0xC359, 0x5B5A, 0,
0x3046, 0, 0xC35A, 0, 0xC35B, 0x5B5D, 0x5B5F, 0,
0x364D, 0x372C, 0xC349, 0x343C, 0x354B, 0xC35C, 0, 0xC35D,
@@ -4059,7 +3877,7 @@ static const unsigned short utf8_to_euc_E6A1[] = {
0xC363, 0xC364, 0xC365, 0, 0x5B6F, 0xC366, 0x3233, 0x5B64,
0, 0xC367, 0xC368, 0xC369, 0xC36A, 0, 0x5B75, 0x5B65,
};
-static const unsigned short utf8_to_euc_E6A2[] = {
+const unsigned short utf8_to_euc_E6A2[] = {
0, 0x4E42, 0xC36B, 0x5B6C, 0xC36C, 0x475F, 0xC36D, 0,
0xC36E, 0, 0, 0, 0, 0x5B74, 0, 0x5B67,
0, 0, 0, 0x3034, 0x5B69, 0, 0xC36F, 0x393C,
@@ -4069,7 +3887,7 @@ static const unsigned short utf8_to_euc_E6A2[] = {
0x3323, 0x3A2D, 0xC379, 0x5B60, 0, 0x5B70, 0x3361, 0,
0, 0x5B6E, 0x5B72, 0xC37A, 0x456E, 0, 0, 0,
};
-static const unsigned short utf8_to_euc_E6A3[] = {
+const unsigned short utf8_to_euc_E6A3[] = {
0, 0, 0, 0, 0x347E, 0xC37B, 0x5C32, 0,
0xC37C, 0x4C49, 0x5B77, 0x347D, 0xC37D, 0x5B7E, 0, 0xC37E,
0xC421, 0xC422, 0x4B40, 0xC423, 0x5C21, 0x5C23, 0xC424, 0x5C27,
@@ -4079,7 +3897,7 @@ static const unsigned short utf8_to_euc_E6A3[] = {
0xC42E, 0xC42F, 0x4033, 0, 0, 0xC430, 0xC431, 0,
0, 0x5C2A, 0x343D, 0xC432, 0xC433, 0xC434, 0, 0,
};
-static const unsigned short utf8_to_euc_E6A4[] = {
+const unsigned short utf8_to_euc_E6A4[] = {
0x4F50, 0x5B76, 0, 0, 0x5C26, 0x3058, 0xC435, 0,
0x5B78, 0xC436, 0xC437, 0x4C3A, 0x5B7D, 0x3F22, 0x4447, 0x5B73,
0xC438, 0xC439, 0x5C25, 0xC43A, 0, 0, 0xC43B, 0xC43C,
@@ -4089,7 +3907,7 @@ static const unsigned short utf8_to_euc_E6A4[] = {
0x5C3F, 0xC43D, 0, 0xC43E, 0x464E, 0xC43F, 0x5C24, 0,
0xC440, 0x5C3B, 0, 0xC441, 0, 0x5C3D, 0, 0x4458,
};
-static const unsigned short utf8_to_euc_E6A5[] = {
+const unsigned short utf8_to_euc_E6A5[] = {
0, 0, 0xC442, 0, 0, 0xC443, 0, 0,
0, 0xC444, 0x4D4C, 0, 0, 0, 0xC445, 0,
0, 0, 0, 0x4976, 0x5C38, 0x424A, 0, 0xC446,
@@ -4099,7 +3917,7 @@ static const unsigned short utf8_to_euc_E6A5[] = {
0xC44F, 0xC450, 0xC451, 0x4760, 0x5C3C, 0x364B, 0, 0x5C34,
0x5C36, 0x5C33, 0xC452, 0xC453, 0x4F30, 0x335A, 0x5C39, 0xC454,
};
-static const unsigned short utf8_to_euc_E6A6[] = {
+const unsigned short utf8_to_euc_E6A6[] = {
0xC455, 0x5C43, 0x3335, 0, 0, 0, 0, 0,
0, 0, 0x3A67, 0, 0, 0xC456, 0x315D, 0,
0, 0x5C54, 0xC457, 0, 0x4F31, 0x5C57, 0xC458, 0,
@@ -4109,7 +3927,7 @@ static const unsigned short utf8_to_euc_E6A6[] = {
0, 0x5C63, 0x5C45, 0, 0x5C58, 0, 0, 0xC461,
0xC462, 0, 0xC463, 0x5C50, 0xC464, 0, 0x5C4B, 0x5C48,
};
-static const unsigned short utf8_to_euc_E6A7[] = {
+const unsigned short utf8_to_euc_E6A7[] = {
0, 0x5C49, 0, 0x5C51, 0, 0xC465, 0, 0x7422,
0xC466, 0, 0x5C4E, 0x393D, 0x4448, 0x4164, 0x5C4C, 0,
0x5C47, 0xC467, 0, 0x5C4A, 0, 0, 0xC468, 0xC469,
@@ -4119,7 +3937,7 @@ static const unsigned short utf8_to_euc_E6A7[] = {
0, 0xC46E, 0x5C60, 0xC46F, 0, 0xC470, 0, 0,
0, 0x5C5F, 0, 0x4450, 0, 0x4165, 0xC471, 0x5C5D,
};
-static const unsigned short utf8_to_euc_E6A8[] = {
+const unsigned short utf8_to_euc_E6A8[] = {
0xC472, 0xC473, 0x5C5B, 0xC474, 0, 0x5C62, 0, 0,
0, 0, 0x5C68, 0x4875, 0x5C6E, 0, 0, 0xC475,
0, 0xC476, 0x5C69, 0x5C6C, 0x5C66, 0xC477, 0, 0x4374,
@@ -4129,7 +3947,7 @@ static const unsigned short utf8_to_euc_E6A8[] = {
0xC47D, 0, 0xC47E, 0, 0xC521, 0x3E41, 0x5C70, 0xC522,
0x5C77, 0x3C79, 0x3372, 0xC523, 0, 0x432E, 0xC524, 0xC525,
};
-static const unsigned short utf8_to_euc_E6A9[] = {
+const unsigned short utf8_to_euc_E6A9[] = {
0, 0, 0, 0, 0x5C6D, 0xC526, 0xC527, 0x5C72,
0x5C76, 0xC528, 0xC529, 0x3636, 0, 0, 0xC52A, 0,
0xC52B, 0xC52C, 0xC52D, 0, 0, 0xC52E, 0xC52F, 0,
@@ -4139,7 +3957,7 @@ static const unsigned short utf8_to_euc_E6A9[] = {
0, 0xC534, 0x5C6F, 0xC535, 0, 0, 0, 0,
0x5C71, 0, 0, 0, 0, 0, 0xC536, 0x3360,
};
-static const unsigned short utf8_to_euc_E6AA[] = {
+const unsigned short utf8_to_euc_E6AA[] = {
0x4349, 0xC537, 0, 0xC538, 0x5C7C, 0, 0xC539, 0xC53A,
0, 0xC53B, 0, 0xC53C, 0, 0x5C7A, 0x3869, 0,
0x5C79, 0xC53D, 0, 0, 0, 0, 0, 0x5D21,
@@ -4149,7 +3967,7 @@ static const unsigned short utf8_to_euc_E6AA[] = {
0xC545, 0xC546, 0, 0x5D27, 0xC547, 0, 0, 0,
0x5D26, 0, 0, 0x5D23, 0, 0xC548, 0xC549, 0xC54A,
};
-static const unsigned short utf8_to_euc_E6AB[] = {
+const unsigned short utf8_to_euc_E6AB[] = {
0, 0x5C6A, 0x5D25, 0x5D24, 0, 0, 0xC54B, 0,
0xC54D, 0xC54C, 0, 0, 0xC54E, 0, 0, 0,
0xC54F, 0x5D2A, 0, 0x4F26, 0xC550, 0xC551, 0xC552, 0,
@@ -4159,7 +3977,7 @@ static const unsigned short utf8_to_euc_E6AB[] = {
0xC558, 0xC559, 0xC55A, 0, 0, 0, 0, 0,
0, 0, 0x5D32, 0x5D2F, 0xC55B, 0xC55C, 0, 0,
};
-static const unsigned short utf8_to_euc_E6AC[] = {
+const unsigned short utf8_to_euc_E6AC[] = {
0, 0, 0xC55D, 0xC55E, 0x4D73, 0x5D30, 0xC55F, 0xC560,
0, 0xC561, 0x5C5E, 0, 0, 0, 0, 0xC562,
0xC563, 0xC564, 0x5D33, 0, 0, 0, 0x5D34, 0xC565,
@@ -4169,7 +3987,7 @@ static const unsigned short utf8_to_euc_E6AC[] = {
0, 0, 0x4D5F, 0, 0, 0xC56D, 0xC56E, 0x5D38,
0x5D37, 0x5D3A, 0x353D, 0xC56F, 0, 0x3656, 0x343E, 0xC570,
};
-static const unsigned short utf8_to_euc_E6AD[] = {
+const unsigned short utf8_to_euc_E6AD[] = {
0, 0, 0, 0x5D3D, 0, 0, 0xC571, 0x5D3C,
0, 0x5D3E, 0xC572, 0, 0x324E, 0xC573, 0x4337, 0,
0x5D3F, 0, 0xC574, 0x343F, 0x5D41, 0, 0xC575, 0,
@@ -4179,7 +3997,7 @@ static const unsigned short utf8_to_euc_E6AD[] = {
0xC57C, 0, 0, 0x3A50, 0x4E72, 0xC57D, 0, 0,
0x5D45, 0x5D46, 0, 0x3B60, 0, 0xC57E, 0xC621, 0x5D47,
};
-static const unsigned short utf8_to_euc_E6AE[] = {
+const unsigned short utf8_to_euc_E6AE[] = {
0x5D48, 0, 0xC622, 0x5D4A, 0x5D49, 0xC623, 0x4B58, 0,
0, 0x3D5E, 0x3C6C, 0x3B44, 0, 0x5D4B, 0, 0,
0, 0, 0, 0, 0, 0x5D4D, 0x3F23, 0xC624,
@@ -4189,7 +4007,7 @@ static const unsigned short utf8_to_euc_E6AE[] = {
0xC62F, 0x5D54, 0x5D53, 0x5D55, 0x3225, 0x434A, 0, 0x5D56,
0xC630, 0xC631, 0x3B26, 0x334C, 0x5D57, 0xC632, 0xC633, 0x4542,
};
-static const unsigned short utf8_to_euc_E6AF[] = {
+const unsigned short utf8_to_euc_E6AF[] = {
0x544C, 0, 0, 0xC634, 0xC635, 0x3523, 0x5D58, 0,
0, 0xC636, 0, 0x5D59, 0xC637, 0x4A6C, 0x4B68, 0,
0, 0, 0x4647, 0x5D5A, 0x4866, 0, 0xC638, 0,
@@ -4199,7 +4017,7 @@ static const unsigned short utf8_to_euc_E6AF[] = {
0, 0xC63F, 0, 0x5D5E, 0, 0, 0, 0xC640,
0, 0xC641, 0, 0, 0, 0, 0, 0xC642,
};
-static const unsigned short utf8_to_euc_E6B0[] = {
+const unsigned short utf8_to_euc_E6B0[] = {
0, 0, 0xC643, 0, 0xC644, 0xC645, 0, 0,
0x5D61, 0xC646, 0, 0, 0, 0xC647, 0xC648, 0x3B61,
0xC649, 0x4C31, 0xC64A, 0x5D62, 0x5D63, 0, 0, 0x3524,
@@ -4209,7 +4027,7 @@ static const unsigned short utf8_to_euc_E6B0[] = {
0, 0, 0, 0xC652, 0x3F65, 0xC653, 0xC654, 0x4939,
0x314A, 0, 0xC655, 0xC656, 0, 0, 0x4845, 0xC657,
};
-static const unsigned short utf8_to_euc_E6B1[] = {
+const unsigned short utf8_to_euc_E6B1[] = {
0x4475, 0x3D41, 0x3561, 0, 0, 0, 0, 0,
0, 0, 0xC658, 0xC659, 0, 0xC65A, 0x4846, 0xC65B,
0x3C2E, 0, 0xC65C, 0, 0xC65D, 0x5D68, 0, 0x3440,
@@ -4219,7 +4037,7 @@ static const unsigned short utf8_to_euc_E6B1[] = {
0x4241, 0, 0x3562, 0x5D72, 0xC664, 0, 0xC665, 0,
0xC666, 0xC667, 0x3768, 0xC668, 0, 0x3525, 0x5D70, 0,
};
-static const unsigned short utf8_to_euc_E6B2[] = {
+const unsigned short utf8_to_euc_E6B2[] = {
0, 0x5D6E, 0x5D6B, 0x4D60, 0, 0xC669, 0xC66A, 0xC66B,
0x4440, 0xC66C, 0, 0, 0x4659, 0x5D6C, 0, 0,
0x5D74, 0, 0x5D73, 0x3723, 0xC66D, 0xC66E, 0x322D, 0xC66F,
@@ -4229,7 +4047,7 @@ static const unsigned short utf8_to_euc_E6B2[] = {
0xC673, 0x5D7D, 0xC674, 0x324F, 0xC675, 0, 0, 0,
0x4A28, 0x4C7D, 0x5E21, 0x3C23, 0x3E42, 0x5D78, 0x5D7E, 0x3168,
};
-static const unsigned short utf8_to_euc_E6B3[] = {
+const unsigned short utf8_to_euc_E6B3[] = {
0, 0x3637, 0xC676, 0, 0x5D75, 0x5D7A, 0xC677, 0,
0, 0x4074, 0x4771, 0, 0x4867, 0xC678, 0, 0xC679,
0xC67A, 0xC67B, 0xC67C, 0x5D77, 0xC67D, 0x4B21, 0xC67E, 0x5D79,
@@ -4239,7 +4057,7 @@ static const unsigned short utf8_to_euc_E6B3[] = {
0x4259, 0x5D76, 0xC729, 0x314B, 0xC72A, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
};
-static const unsigned short utf8_to_euc_E6B4[] = {
+const unsigned short utf8_to_euc_E6B4[] = {
0, 0, 0, 0, 0xC72B, 0, 0, 0xC72C,
0, 0, 0xC72D, 0x4D4E, 0x5E30, 0, 0xC72E, 0xC72F,
0, 0xC730, 0x5E2F, 0xC731, 0, 0, 0, 0x4076,
@@ -4249,7 +4067,7 @@ static const unsigned short utf8_to_euc_E6B4[] = {
0, 0xC739, 0x3D27, 0x5E2E, 0, 0x5E2D, 0x5E28, 0,
0x5E2B, 0xC73A, 0, 0x3368, 0xC73B, 0x5E2A, 0x4749, 0xC73C,
};
-static const unsigned short utf8_to_euc_E6B5[] = {
+const unsigned short utf8_to_euc_E6B5[] = {
0, 0x4E2E, 0, 0, 0x3E74, 0x4075, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0xC73D,
@@ -4259,7 +4077,7 @@ static const unsigned short utf8_to_euc_E6B5[] = {
0xC744, 0, 0, 0, 0x4D61, 0, 0, 0x3324,
0x3F3B, 0x5E35, 0, 0, 0xC745, 0, 0, 0,
};
-static const unsigned short utf8_to_euc_E6B6[] = {
+const unsigned short utf8_to_euc_E6B6[] = {
0, 0, 0xC746, 0, 0, 0x5E3A, 0, 0xC747,
0x3E43, 0, 0, 0, 0x4D30, 0, 0x5E37, 0,
0, 0xC748, 0xC749, 0x5E32, 0xC74A, 0x5E38, 0xC74B, 0xC74C,
@@ -4269,7 +4087,7 @@ static const unsigned short utf8_to_euc_E6B6[] = {
0, 0, 0x3155, 0, 0xC750, 0x5E3E, 0, 0xC751,
0x5E41, 0xC752, 0, 0, 0x4E43, 0xC753, 0, 0xC754,
};
-static const unsigned short utf8_to_euc_E6B7[] = {
+const unsigned short utf8_to_euc_E6B7[] = {
0x4D64, 0, 0, 0, 0xC755, 0x5E48, 0x5E42, 0x5E3F,
0xC756, 0, 0xC757, 0x4E54, 0x5E45, 0, 0xC758, 0xC759,
0, 0x3D4A, 0x5E47, 0, 0, 0x5E4C, 0xC75A, 0,
@@ -4279,7 +4097,7 @@ static const unsigned short utf8_to_euc_E6B7[] = {
0xC763, 0x3F3C, 0xF44C, 0x3D5F, 0xC764, 0x4A25, 0xC765, 0x3A2E,
0xF44B, 0x5E3B, 0x5E49, 0x453A, 0xC766, 0, 0, 0,
};
-static const unsigned short utf8_to_euc_E6B8[] = {
+const unsigned short utf8_to_euc_E6B8[] = {
0xC767, 0, 0, 0, 0xC768, 0x4036, 0, 0x3369,
0x3A51, 0x3E44, 0x5E3D, 0x3D42, 0, 0, 0, 0,
0, 0, 0, 0x374C, 0, 0x5E3C, 0, 0,
@@ -4289,7 +4107,7 @@ static const unsigned short utf8_to_euc_E6B8[] = {
0, 0, 0xC76C, 0, 0, 0, 0xC76D, 0,
0x5E62, 0xC76E, 0x5E5D, 0xC76F, 0xC770, 0, 0x5E55, 0,
};
-static const unsigned short utf8_to_euc_E6B9[] = {
+const unsigned short utf8_to_euc_E6B9[] = {
0, 0, 0, 0x5E5C, 0xC771, 0xC772, 0, 0,
0xC773, 0xC774, 0x4C2B, 0xC775, 0, 0x5E5A, 0x5E5E, 0xC776,
0, 0xC777, 0xC778, 0xC779, 0xC77A, 0, 0x3850, 0xC77B,
@@ -4299,7 +4117,7 @@ static const unsigned short utf8_to_euc_E6B9[] = {
0, 0, 0x5E53, 0xC824, 0, 0, 0x5E59, 0,
0, 0, 0, 0xC825, 0, 0xC826, 0x4F51, 0x3C3E,
};
-static const unsigned short utf8_to_euc_E6BA[] = {
+const unsigned short utf8_to_euc_E6BA[] = {
0x4B7E, 0, 0x5E63, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0x482E, 0xC827, 0, 0x5E6F,
0x383B, 0, 0, 0xC828, 0, 0, 0x3D60, 0,
@@ -4309,7 +4127,7 @@ static const unsigned short utf8_to_euc_E6BA[] = {
0, 0xC82E, 0x5E6C, 0xC82F, 0, 0, 0x4D4F, 0x5E67,
0, 0, 0x452E, 0xC830, 0, 0x5E69, 0, 0xC831,
};
-static const unsigned short utf8_to_euc_E6BB[] = {
+const unsigned short utf8_to_euc_E6BB[] = {
0xC832, 0xC833, 0x5E71, 0xC834, 0x5E6B, 0x4C47, 0, 0xC835,
0xC836, 0x5E66, 0xC837, 0x3C22, 0x5E7E, 0xC838, 0xC839, 0xC83A,
0, 0x336A, 0, 0x5E68, 0x5E6D, 0x5E6E, 0, 0,
@@ -4319,7 +4137,7 @@ static const unsigned short utf8_to_euc_E6BB[] = {
0, 0, 0x5E7A, 0, 0x4529, 0, 0, 0x5F23,
0x5E77, 0xC83E, 0, 0xC83F, 0, 0xC840, 0x5E78, 0x5E60,
};
-static const unsigned short utf8_to_euc_E6BC[] = {
+const unsigned short utf8_to_euc_E6BC[] = {
0, 0x3579, 0x493A, 0, 0xC841, 0, 0x3C3F, 0,
0xC842, 0x3977, 0xC843, 0, 0xC844, 0xC845, 0, 0x4F33,
0, 0x5E74, 0, 0x5F22, 0x3169, 0x4166, 0xC846, 0,
@@ -4329,7 +4147,7 @@ static const unsigned short utf8_to_euc_E6BC[] = {
0xC84E, 0x5E7B, 0x5E7D, 0xC84F, 0, 0, 0xC850, 0,
0x4132, 0, 0, 0xC851, 0xC852, 0, 0x5F21, 0x5E79,
};
-static const unsigned short utf8_to_euc_E6BD[] = {
+const unsigned short utf8_to_euc_E6BD[] = {
0, 0x5E73, 0, 0, 0, 0x3443, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0xC854,
0, 0xC855, 0xC856, 0xC857, 0x3769, 0, 0, 0xC858,
@@ -4339,7 +4157,7 @@ static const unsigned short utf8_to_euc_E6BD[] = {
0x4459, 0, 0, 0, 0x5F4C, 0, 0, 0,
0x5F26, 0, 0x5F25, 0, 0x5F2E, 0xC861, 0xC862, 0,
};
-static const unsigned short utf8_to_euc_E6BE[] = {
+const unsigned short utf8_to_euc_E6BE[] = {
0x5F28, 0x5F27, 0x5F2D, 0xC863, 0x4021, 0, 0x5F24, 0xC864,
0xC865, 0, 0, 0xC866, 0xC867, 0xC868, 0x5F30, 0,
0xC869, 0x5F31, 0xC86A, 0xC86B, 0xC86C, 0, 0xC86D, 0x3442,
@@ -4349,7 +4167,7 @@ static const unsigned short utf8_to_euc_E6BE[] = {
0xC877, 0x4543, 0, 0x5F34, 0, 0xC878, 0xC879, 0,
0, 0x5F38, 0, 0, 0xC87A, 0, 0, 0,
};
-static const unsigned short utf8_to_euc_E6BF[] = {
+const unsigned short utf8_to_euc_E6BF[] = {
0x3763, 0x4279, 0x5F32, 0x473B, 0, 0xC87B, 0x5F39, 0xC87C,
0xC87D, 0, 0xC87E, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0x5F3E, 0x5F3C, 0, 0,
@@ -4359,7 +4177,7 @@ static const unsigned short utf8_to_euc_E6BF[] = {
0xC925, 0x5F40, 0, 0x5F2B, 0, 0xC926, 0x6F69, 0,
0, 0xC927, 0x5F45, 0, 0xC928, 0xC929, 0x5F49, 0,
};
-static const unsigned short utf8_to_euc_E780[] = {
+const unsigned short utf8_to_euc_E780[] = {
0xC92A, 0x5F47, 0, 0, 0, 0xC92B, 0xC92C, 0xC92D,
0, 0x5F43, 0, 0x5F44, 0, 0xC92E, 0, 0x5F48,
0, 0x5F46, 0, 0, 0, 0x494E, 0, 0xC92F,
@@ -4369,7 +4187,7 @@ static const unsigned short utf8_to_euc_E780[] = {
0x5F50, 0, 0x5F52, 0, 0xC933, 0, 0, 0xC934,
0, 0xC935, 0, 0, 0xC936, 0, 0x5F51, 0,
};
-static const unsigned short utf8_to_euc_E781[] = {
+const unsigned short utf8_to_euc_E781[] = {
0, 0, 0, 0xC937, 0xC938, 0, 0, 0,
0xC939, 0xC93A, 0xC93B, 0xC93C, 0x5E75, 0, 0xC941, 0,
0, 0x5F53, 0, 0, 0xC93D, 0xC93E, 0, 0,
@@ -4379,7 +4197,7 @@ static const unsigned short utf8_to_euc_E781[] = {
0x3325, 0, 0, 0, 0, 0xC946, 0xC947, 0,
0x3564, 0, 0, 0, 0x3C5E, 0x3A52, 0xC948, 0,
};
-static const unsigned short utf8_to_euc_E782[] = {
+const unsigned short utf8_to_euc_E782[] = {
0, 0xC949, 0, 0, 0, 0xC94A, 0xC94B, 0,
0, 0x4F27, 0x3F66, 0, 0, 0, 0x316A, 0,
0, 0, 0x5F56, 0, 0xC94C, 0xC94D, 0xC94E, 0xC94F,
@@ -4389,7 +4207,7 @@ static const unsigned short utf8_to_euc_E782[] = {
0xC954, 0xC955, 0, 0x5F5B, 0xC956, 0, 0, 0xC957,
0x5F5A, 0x4540, 0x3059, 0xF42E, 0, 0, 0, 0,
};
-static const unsigned short utf8_to_euc_E783[] = {
+const unsigned short utf8_to_euc_E783[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0x4E75, 0, 0xC958, 0x5F5E, 0, 0, 0, 0x3128,
0, 0xC959, 0, 0xC95A, 0xC95B, 0xC95C, 0xC95D, 0,
@@ -4399,7 +4217,7 @@ static const unsigned short utf8_to_euc_E783[] = {
0, 0x5F58, 0, 0, 0, 0, 0, 0,
0, 0x4B23, 0xC961, 0, 0, 0x5F62, 0, 0,
};
-static const unsigned short utf8_to_euc_E784[] = {
+const unsigned short utf8_to_euc_E784[] = {
0, 0, 0, 0xC962, 0xC963, 0xC964, 0xC965, 0xC966,
0, 0x5F61, 0, 0xC967, 0xC968, 0, 0, 0xC969,
0, 0, 0, 0, 0x316B, 0, 0, 0,
@@ -4409,7 +4227,7 @@ static const unsigned short utf8_to_euc_E784[] = {
0xC96F, 0xC970, 0, 0, 0, 0, 0x4133, 0,
0xC971, 0, 0, 0, 0x3E46, 0, 0, 0,
};
-static const unsigned short utf8_to_euc_E785[] = {
+const unsigned short utf8_to_euc_E785[] = {
0, 0xC972, 0, 0, 0, 0xC973, 0xC974, 0xC975,
0, 0x4E7B, 0xC976, 0xC977, 0x5F6A, 0, 0x4079, 0,
0xC978, 0, 0xC979, 0, 0, 0x5F66, 0x5F6B, 0xC97A,
@@ -4419,7 +4237,7 @@ static const unsigned short utf8_to_euc_E785[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0xCA22, 0, 0, 0, 0x407A, 0, 0,
};
-static const unsigned short utf8_to_euc_E786[] = {
+const unsigned short utf8_to_euc_E786[] = {
0xCA23, 0, 0, 0, 0x5F6F, 0xCA24, 0, 0xCA25,
0x5F67, 0, 0x3727, 0, 0xCA26, 0, 0, 0x5F6D,
0, 0, 0xCA27, 0, 0x4D50, 0x5F70, 0, 0,
@@ -4429,7 +4247,7 @@ static const unsigned short utf8_to_euc_E786[] = {
0xCA2D, 0x472E, 0xCA2E, 0xCA2F, 0, 0, 0, 0,
0, 0x5F74, 0xCA30, 0, 0, 0, 0x5F75, 0xCA31,
};
-static const unsigned short utf8_to_euc_E787[] = {
+const unsigned short utf8_to_euc_E787[] = {
0xCA32, 0xCA33, 0, 0x4733, 0xCA34, 0, 0, 0,
0x4575, 0x5F77, 0, 0xCA35, 0xCA36, 0, 0x5F79, 0,
0x4E55, 0, 0x5F76, 0xCA37, 0x5F78, 0x316D, 0xCA38, 0x5F73,
@@ -4439,7 +4257,7 @@ static const unsigned short utf8_to_euc_E787[] = {
0, 0, 0, 0, 0, 0x5F7D, 0, 0,
0xCA3C, 0x6021, 0, 0x5F6E, 0x5F7E, 0, 0xCA3D, 0x6022,
};
-static const unsigned short utf8_to_euc_E788[] = {
+const unsigned short utf8_to_euc_E788[] = {
0xCA3E, 0, 0, 0, 0, 0, 0x477A, 0xCA3F,
0xCA40, 0xCA41, 0, 0, 0, 0x6023, 0, 0,
0x6024, 0, 0, 0xCA42, 0, 0, 0, 0xCA43,
@@ -4449,7 +4267,7 @@ static const unsigned short utf8_to_euc_E788[] = {
0x6029, 0, 0x602A, 0, 0xCA4A, 0x3C5F, 0x4963, 0,
0xCA4B, 0xCA4C, 0x4C6C, 0x602B, 0x602C, 0x4156, 0x3C24, 0x602D,
};
-static const unsigned short utf8_to_euc_E789[] = {
+const unsigned short utf8_to_euc_E789[] = {
0x602E, 0xCA4D, 0xCA4E, 0xCA4F, 0, 0xCA50, 0x602F, 0x4A52,
0x4847, 0, 0, 0x6030, 0x4757, 0, 0xCA51, 0xCA52,
0xCA53, 0, 0x442D, 0xCA54, 0, 0xCA55, 0xCA56, 0,
@@ -4459,7 +4277,7 @@ static const unsigned short utf8_to_euc_E789[] = {
0, 0xCA60, 0x4037, 0, 0x6032, 0, 0, 0xCA61,
0xCA62, 0x4643, 0, 0xCA63, 0xCA64, 0x3823, 0x6033, 0xCA65,
};
-static const unsigned short utf8_to_euc_E78A[] = {
+const unsigned short utf8_to_euc_E78A[] = {
0x3A54, 0x6035, 0x6034, 0, 0xCA66, 0, 0, 0x6036,
0, 0xCA67, 0, 0, 0, 0xCA68, 0xCA69, 0,
0, 0, 0x6037, 0xCA6A, 0, 0, 0x6038, 0,
@@ -4469,7 +4287,7 @@ static const unsigned short utf8_to_euc_E78A[] = {
0, 0xCA6F, 0x603C, 0, 0xCA70, 0, 0x3E75, 0,
0, 0x603B, 0, 0, 0, 0, 0xCA71, 0,
};
-static const unsigned short utf8_to_euc_E78B[] = {
+const unsigned short utf8_to_euc_E78B[] = {
0, 0xCA72, 0x3638, 0x603D, 0x603F, 0, 0x603E, 0xCA73,
0, 0xCA74, 0, 0, 0xCA75, 0, 0x6040, 0,
0x3851, 0, 0x6041, 0, 0, 0xCA76, 0xCA77, 0x3669,
@@ -4479,7 +4297,7 @@ static const unsigned short utf8_to_euc_E78B[] = {
0, 0, 0, 0xCA7B, 0xCA7C, 0, 0, 0x6046,
0x432C, 0x6045, 0xCA7D, 0xCA7E, 0x4F35, 0x4762, 0xCB21, 0,
};
-static const unsigned short utf8_to_euc_E78C[] = {
+const unsigned short utf8_to_euc_E78C[] = {
0, 0, 0xCB22, 0, 0xCB23, 0xCB24, 0, 0xCB25,
0, 0, 0x6049, 0xCB26, 0, 0xCB27, 0, 0,
0, 0, 0xCB28, 0xCB29, 0, 0, 0x604B, 0x6048,
@@ -4489,7 +4307,7 @@ static const unsigned short utf8_to_euc_E78C[] = {
0, 0xCB32, 0xCB33, 0, 0x604D, 0xCB34, 0x4D31, 0x4D32,
0, 0, 0xCB35, 0xCB36, 0, 0xCB37, 0x6051, 0x316E,
};
-static const unsigned short utf8_to_euc_E78D[] = {
+const unsigned short utf8_to_euc_E78D[] = {
0, 0, 0, 0xCB38, 0x3976, 0x3B62, 0, 0,
0, 0, 0, 0, 0, 0xCB39, 0x6052, 0x6053,
0xCB3A, 0, 0xCB3B, 0, 0, 0, 0xCB3C, 0x6055,
@@ -4499,7 +4317,7 @@ static const unsigned short utf8_to_euc_E78D[] = {
0x6058, 0xCB49, 0x334D, 0, 0, 0x605A, 0, 0xCB4A,
0x6059, 0xCB4B, 0x605C, 0x605B, 0xCB4C, 0, 0, 0,
};
-static const unsigned short utf8_to_euc_E78E[] = {
+const unsigned short utf8_to_euc_E78E[] = {
0xCB4D, 0xCB4E, 0, 0xCB4F, 0x383C, 0xCB50, 0xCB51, 0x4E28,
0, 0x364C, 0, 0x3226, 0, 0, 0xCB52, 0,
0xCB53, 0, 0, 0xCB54, 0, 0xCB55, 0x366A, 0xCB56,
@@ -4509,7 +4327,7 @@ static const unsigned short utf8_to_euc_E78E[] = {
0, 0, 0x4E68, 0x605E, 0, 0xCB62, 0, 0xCB63,
0, 0xCB64, 0, 0x6060, 0xCB65, 0xCB66, 0, 0xCB67,
};
-static const unsigned short utf8_to_euc_E78F[] = {
+const unsigned short utf8_to_euc_E78F[] = {
0x6061, 0, 0x3251, 0, 0, 0xCB68, 0xCB69, 0,
0x605D, 0xCB6A, 0x3B39, 0xCB6B, 0xCB6C, 0x4441, 0x605F, 0xCB6D,
0, 0, 0xCB6E, 0xCB6F, 0, 0, 0xCB70, 0,
@@ -4519,7 +4337,7 @@ static const unsigned short utf8_to_euc_E78F[] = {
0, 0x607E, 0, 0, 0xCB78, 0xCB79, 0, 0xCB7A,
0x6069, 0xCB7B, 0xCB7C, 0xCB7D, 0, 0xCB7E, 0x383D, 0xCC21,
};
-static const unsigned short utf8_to_euc_E790[] = {
+const unsigned short utf8_to_euc_E790[] = {
0xCC22, 0xCC23, 0, 0x3565, 0xCC24, 0x6066, 0x4D7D, 0xCC25,
0, 0x4E30, 0xCC26, 0, 0, 0, 0, 0,
0, 0xCC27, 0, 0, 0, 0, 0, 0,
@@ -4529,7 +4347,7 @@ static const unsigned short utf8_to_euc_E790[] = {
0xCC34, 0xCC35, 0x606A, 0x4E56, 0x3657, 0x487C, 0x474A, 0,
0, 0xCC36, 0x606B, 0, 0, 0, 0, 0x606D,
};
-static const unsigned short utf8_to_euc_E791[] = {
+const unsigned short utf8_to_euc_E791[] = {
0xCC37, 0x6070, 0, 0xCC38, 0xCC39, 0, 0xCC3A, 0xCC3B,
0, 0, 0, 0xCC3C, 0, 0xCC3D, 0, 0,
0, 0xCC3E, 0xCC3F, 0, 0, 0x606C, 0, 0xCC40,
@@ -4539,7 +4357,7 @@ static const unsigned short utf8_to_euc_E791[] = {
0x6073, 0xCC49, 0xCC4A, 0x3A3C, 0, 0, 0x6076, 0,
0, 0, 0, 0, 0, 0, 0x6077, 0,
};
-static const unsigned short utf8_to_euc_E792[] = {
+const unsigned short utf8_to_euc_E792[] = {
0xCC4B, 0xCC4C, 0, 0x4D7E, 0, 0xCC4D, 0xCC4E, 0xCC4F,
0, 0xCC50, 0, 0x6078, 0, 0, 0, 0xCC51,
0xCC52, 0xCC53, 0xCC54, 0, 0, 0, 0, 0,
@@ -4549,7 +4367,7 @@ static const unsigned short utf8_to_euc_E792[] = {
0x3444, 0xCC64, 0xCC65, 0, 0, 0xCC66, 0, 0,
0, 0xCC67, 0, 0xCC68, 0, 0x3C25, 0, 0xCC69,
};
-static const unsigned short utf8_to_euc_E793[] = {
+const unsigned short utf8_to_euc_E793[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0xCC6A, 0xCC6B, 0x607B, 0, 0xCC6C, 0, 0, 0x607C,
0xCC6D, 0, 0, 0xCC6E, 0x607D, 0, 0, 0,
@@ -4559,7 +4377,7 @@ static const unsigned short utf8_to_euc_E793[] = {
0x6127, 0x6128, 0x6126, 0, 0xCC79, 0, 0x4953, 0x612A,
0x6129, 0, 0xCC7A, 0xCC7B, 0xCC7C, 0, 0, 0xCC7D,
};
-static const unsigned short utf8_to_euc_E794[] = {
+const unsigned short utf8_to_euc_E794[] = {
0, 0xF450, 0, 0x612C, 0x612B, 0x612D, 0xCC7E, 0,
0, 0, 0, 0, 0x612E, 0x6130, 0x612F, 0,
0, 0x3979, 0xCD21, 0x6132, 0, 0x6131, 0xCD22, 0xCD23,
@@ -4569,7 +4387,7 @@ static const unsigned short utf8_to_euc_E794[] = {
0x4544, 0x4D33, 0x3943, 0x3F3D, 0, 0, 0xCD2B, 0x434B,
0x5234, 0xCD2C, 0x442E, 0x3268, 0x6136, 0xCD2D, 0xCD2E, 0xCD2F,
};
-static const unsigned short utf8_to_euc_E795[] = {
+const unsigned short utf8_to_euc_E795[] = {
0xCD30, 0, 0, 0xCD31, 0x6137, 0, 0x613C, 0xCD32,
0xCD33, 0x613A, 0x6139, 0x5A42, 0x3326, 0x6138, 0xCD34, 0x305A,
0xCD35, 0x482A, 0xCD36, 0, 0x484A, 0, 0, 0xCD37,
@@ -4579,7 +4397,7 @@ static const unsigned short utf8_to_euc_E795[] = {
0x305B, 0xCD3C, 0, 0x3E76, 0x6147, 0, 0x6144, 0x466D,
0x6143, 0xCD3D, 0xCD3E, 0xCD3F, 0xCD40, 0xCD41, 0xCD42, 0x3526,
};
-static const unsigned short utf8_to_euc_E796[] = {
+const unsigned short utf8_to_euc_E796[] = {
0, 0xCD43, 0x614A, 0, 0, 0xCD44, 0x6145, 0x6146,
0, 0x6149, 0x6148, 0x4925, 0, 0, 0x4142, 0x4141,
0xCD45, 0x353F, 0xCD46, 0xCD47, 0x614B, 0xCD48, 0, 0,
@@ -4589,7 +4407,7 @@ static const unsigned short utf8_to_euc_E796[] = {
0, 0x6157, 0x4868, 0x6151, 0xCD4D, 0x6153, 0, 0,
0x6155, 0x3F3E, 0xCD4E, 0, 0x6156, 0x6154, 0x3C40, 0xCD4F,
};
-static const unsigned short utf8_to_euc_E797[] = {
+const unsigned short utf8_to_euc_E797[] = {
0xCD50, 0xCD51, 0x6150, 0x6152, 0xCD52, 0x4942, 0xCD53, 0x3E49,
0, 0, 0x6159, 0, 0xCD54, 0x6158, 0xCD55, 0xCD56,
0, 0, 0x615A, 0, 0x3C26, 0x3A2F, 0, 0xCD57,
@@ -4599,7 +4417,7 @@ static const unsigned short utf8_to_euc_E797[] = {
0x6162, 0xCD61, 0x6164, 0x6165, 0x4354, 0, 0, 0,
0, 0xCD62, 0x6163, 0, 0x6160, 0, 0x615E, 0x615F,
};
-static const unsigned short utf8_to_euc_E798[] = {
+const unsigned short utf8_to_euc_E798[] = {
0xCD63, 0x6161, 0xCD64, 0xCD65, 0xCD66, 0, 0, 0xCD67,
0xCD68, 0x6168, 0xCD69, 0x6166, 0xCD6A, 0x6167, 0, 0xCD6B,
0, 0, 0xCD6C, 0xCD6D, 0, 0xCD6E, 0xCD6F, 0,
@@ -4609,7 +4427,7 @@ static const unsigned short utf8_to_euc_E798[] = {
0x6170, 0, 0xCD7A, 0xCD7B, 0x616F, 0xCD7C, 0, 0,
0xCD7D, 0xCD7E, 0xCE21, 0x6171, 0xCE22, 0, 0, 0,
};
-static const unsigned short utf8_to_euc_E799[] = {
+const unsigned short utf8_to_euc_E799[] = {
0xCE24, 0xCE25, 0x4E45, 0xCE26, 0xCE27, 0xCE28, 0x6174, 0x6172,
0x6173, 0xCE29, 0xCE23, 0xCE2A, 0x3462, 0, 0, 0,
0, 0, 0x4C7E, 0, 0, 0xCE2B, 0x4A4A, 0,
@@ -4619,7 +4437,7 @@ static const unsigned short utf8_to_euc_E799[] = {
0x617E, 0xCE33, 0x6221, 0, 0xCE34, 0, 0x6222, 0,
0x6223, 0, 0x482F, 0x4550, 0x6224, 0x4772, 0x4934, 0,
};
-static const unsigned short utf8_to_euc_E79A[] = {
+const unsigned short utf8_to_euc_E79A[] = {
0x6225, 0xCE35, 0xF451, 0x6226, 0x452A, 0xCE36, 0x3327, 0x3944,
0x6227, 0, 0, 0x6228, 0xCE37, 0xCE38, 0x6229, 0,
0x3B29, 0, 0, 0x622B, 0, 0xCE39, 0x622A, 0,
@@ -4629,7 +4447,7 @@ static const unsigned short utf8_to_euc_E79A[] = {
0x622E, 0, 0, 0, 0x622F, 0, 0, 0x7369,
0x6230, 0x6231, 0x6232, 0, 0, 0xCE48, 0, 0x3B2E,
};
-static const unsigned short utf8_to_euc_E79B[] = {
+const unsigned short utf8_to_euc_E79B[] = {
0, 0xCE49, 0x6233, 0x4756, 0, 0xCE4A, 0x4B5F, 0,
0x314E, 0xCE4B, 0x3157, 0xCE4C, 0xCE4D, 0x6234, 0xCE4E, 0,
0, 0, 0x6236, 0, 0xCE4F, 0, 0x6235, 0x4570,
@@ -4639,7 +4457,7 @@ static const unsigned short utf8_to_euc_E79B[] = {
0xCE55, 0xCE56, 0x4C55, 0, 0x443E, 0, 0xCE57, 0,
0x416A, 0xCE58, 0, 0x623D, 0xCE59, 0, 0x3D62, 0,
};
-static const unsigned short utf8_to_euc_E79C[] = {
+const unsigned short utf8_to_euc_E79C[] = {
0xCE5A, 0x3E4A, 0, 0, 0x6240, 0, 0xCE5B, 0x623F,
0x623E, 0x487D, 0xCE5C, 0x3447, 0x3829, 0, 0xCE5D, 0,
0, 0, 0xCE5E, 0, 0xCE5F, 0xCE60, 0, 0xCE61,
@@ -4649,7 +4467,7 @@ static const unsigned short utf8_to_euc_E79C[] = {
0, 0, 0, 0, 0xCE6A, 0xCE6B, 0xCE6C, 0x6247,
0x6248, 0xCE6D, 0x442F, 0, 0x3463, 0xCE6E, 0xCE6F, 0,
};
-static const unsigned short utf8_to_euc_E79D[] = {
+const unsigned short utf8_to_euc_E79D[] = {
0x4365, 0, 0xCE70, 0, 0, 0xCE71, 0xCE72, 0x6249,
0, 0, 0xCE73, 0, 0, 0xCE74, 0xCE75, 0xCE76,
0, 0, 0xCE77, 0, 0, 0, 0xCE78, 0xCE79,
@@ -4659,7 +4477,7 @@ static const unsigned short utf8_to_euc_E79D[] = {
0xCF25, 0, 0xCF26, 0xCF27, 0xCF28, 0, 0, 0,
0, 0x6251, 0xCF29, 0, 0, 0xCF2A, 0x6250, 0x624F,
};
-static const unsigned short utf8_to_euc_E79E[] = {
+const unsigned short utf8_to_euc_E79E[] = {
0xCF2B, 0, 0, 0, 0xCF2C, 0, 0, 0,
0, 0, 0, 0x6253, 0xCF2D, 0xCF2E, 0x6252, 0,
0, 0x6254, 0, 0, 0xCF2F, 0xCF30, 0xCF31, 0,
@@ -4669,7 +4487,7 @@ static const unsigned short utf8_to_euc_E79E[] = {
0x6257, 0xCF39, 0, 0x4637, 0, 0xCF3A, 0x6258, 0,
0, 0x6259, 0, 0x625D, 0x625B, 0x625C, 0xCF3B, 0x625A,
};
-static const unsigned short utf8_to_euc_E79F[] = {
+const unsigned short utf8_to_euc_E79F[] = {
0, 0, 0, 0xCF3C, 0, 0, 0, 0x625E,
0, 0xCF3D, 0, 0, 0, 0x625F, 0, 0,
0, 0xCF3E, 0xCF3F, 0, 0, 0xCF40, 0, 0x6260,
@@ -4679,7 +4497,7 @@ static const unsigned short utf8_to_euc_E79F[] = {
0xCF49, 0xCF4A, 0, 0x4050, 0xCF4B, 0, 0, 0,
0xCF4C, 0, 0, 0xCF4D, 0x6265, 0, 0, 0,
};
-static const unsigned short utf8_to_euc_E7A0[] = {
+const unsigned short utf8_to_euc_E7A0[] = {
0, 0, 0x3A3D, 0, 0, 0xCF4E, 0xCF4F, 0,
0, 0xCF50, 0, 0, 0x6266, 0xCF51, 0xCF52, 0,
0, 0xCF53, 0x6267, 0, 0x3826, 0x3A55, 0, 0,
@@ -4689,7 +4507,7 @@ static const unsigned short utf8_to_euc_E7A0[] = {
0xCF5A, 0, 0x4B24, 0, 0x474B, 0xCF5B, 0, 0xCF5C,
0, 0, 0x4557, 0, 0, 0, 0, 0x395C,
};
-static const unsigned short utf8_to_euc_E7A1[] = {
+const unsigned short utf8_to_euc_E7A1[] = {
0, 0, 0, 0xCF5D, 0xCF5E, 0x626B, 0, 0xCF5F,
0xCF60, 0, 0, 0, 0xCF61, 0, 0xCF62, 0,
0, 0, 0xCF63, 0, 0, 0, 0, 0,
@@ -4699,7 +4517,7 @@ static const unsigned short utf8_to_euc_E7A1[] = {
0, 0, 0x4823, 0, 0x626D, 0, 0, 0,
0, 0, 0xCF6D, 0, 0x626F, 0, 0xCF6E, 0,
};
-static const unsigned short utf8_to_euc_E7A2[] = {
+const unsigned short utf8_to_euc_E7A2[] = {
0, 0x386B, 0, 0, 0, 0, 0x626E, 0x4476,
0, 0, 0xCF6F, 0, 0x6271, 0x3337, 0x626C, 0xCF70,
0, 0x486A, 0, 0x3130, 0xCF71, 0x3A6C, 0, 0x4F52,
@@ -4709,7 +4527,7 @@ static const unsigned short utf8_to_euc_E7A2[] = {
0xCF7B, 0xCF7C, 0xCF7D, 0xCF7E, 0, 0x6273, 0, 0,
0, 0, 0x334E, 0xD021, 0x627B, 0xD022, 0x627A, 0xD023,
};
-static const unsigned short utf8_to_euc_E7A3[] = {
+const unsigned short utf8_to_euc_E7A3[] = {
0, 0x3C27, 0, 0, 0, 0x627C, 0x6277, 0xD024,
0xD025, 0xD026, 0x627D, 0x6278, 0xD027, 0, 0xD028, 0,
0x4858, 0x6276, 0xD029, 0xD02A, 0x6279, 0xD02B, 0xD02C, 0,
@@ -4719,7 +4537,7 @@ static const unsigned short utf8_to_euc_E7A3[] = {
0, 0, 0xD034, 0xD035, 0x6324, 0, 0xD037, 0xD038,
0, 0, 0xD039, 0xD03A, 0, 0x6323, 0, 0xD03B,
};
-static const unsigned short utf8_to_euc_E7A4[] = {
+const unsigned short utf8_to_euc_E7A4[] = {
0xD036, 0x3E4C, 0, 0, 0, 0, 0xD03C, 0x6325,
0, 0, 0, 0, 0xD03D, 0, 0x4143, 0,
0xD03E, 0x6327, 0x6326, 0, 0, 0, 0, 0,
@@ -4729,7 +4547,7 @@ static const unsigned short utf8_to_euc_E7A4[] = {
0xF454, 0xD048, 0, 0, 0xD049, 0xD04A, 0, 0,
0, 0, 0x3C28, 0xD04B, 0x4E69, 0xD04C, 0x3C52, 0xD04D,
};
-static const unsigned short utf8_to_euc_E7A5[] = {
+const unsigned short utf8_to_euc_E7A5[] = {
0x632B, 0x3737, 0, 0, 0xD04E, 0xD04F, 0xD050, 0x3540,
0x3527, 0x3B63, 0xD051, 0xD052, 0, 0, 0, 0xD053,
0x4D34, 0xD054, 0, 0x6331, 0xD055, 0x6330, 0x4144, 0x632D,
@@ -4739,7 +4557,7 @@ static const unsigned short utf8_to_euc_E7A5[] = {
0, 0, 0xD05C, 0, 0, 0, 0, 0x4578,
0, 0xD05D, 0x6332, 0xD05E, 0xD05F, 0, 0xD060, 0x6333,
};
-static const unsigned short utf8_to_euc_E7A6[] = {
+const unsigned short utf8_to_euc_E7A6[] = {
0x6349, 0x3658, 0, 0, 0x4F3D, 0x4135, 0, 0,
0, 0, 0x6334, 0xD061, 0xD062, 0x3252, 0x4477, 0x4A21,
0, 0xD063, 0, 0xD064, 0xD065, 0xD066, 0xD067, 0,
@@ -4749,7 +4567,7 @@ static const unsigned short utf8_to_euc_E7A6[] = {
0x4729, 0xD070, 0, 0x633A, 0xD071, 0, 0, 0,
0xD072, 0x633B, 0x633C, 0xD073, 0, 0x3659, 0x3253, 0x4645,
};
-static const unsigned short utf8_to_euc_E7A7[] = {
+const unsigned short utf8_to_euc_E7A7[] = {
0x3D28, 0x3B64, 0xD074, 0, 0xD075, 0, 0, 0xD076,
0xD077, 0x633D, 0xD078, 0x3D29, 0, 0, 0, 0xD079,
0, 0x324A, 0x4943, 0, 0xD07A, 0x633E, 0xD07B, 0,
@@ -4759,7 +4577,7 @@ static const unsigned short utf8_to_euc_E7A7[] = {
0x3E4E, 0xD127, 0, 0, 0, 0, 0, 0,
0xD128, 0, 0, 0x305C, 0xD129, 0, 0, 0,
};
-static const unsigned short utf8_to_euc_E7A8[] = {
+const unsigned short utf8_to_euc_E7A8[] = {
0x3529, 0, 0xD12A, 0xD12B, 0, 0, 0, 0xD12C,
0x6343, 0xD12D, 0xD12E, 0x4478, 0xD12F, 0x6344, 0x4047, 0,
0, 0xD130, 0, 0, 0x4C2D, 0xD131, 0, 0x4923,
@@ -4769,7 +4587,7 @@ static const unsigned short utf8_to_euc_E7A8[] = {
0xD139, 0x634A, 0x3070, 0, 0xD13A, 0xD13B, 0, 0x634D,
0xD13C, 0xD13D, 0xD13E, 0x634B, 0x3254, 0x374E, 0x634C, 0x3946,
};
-static const unsigned short utf8_to_euc_E7A9[] = {
+const unsigned short utf8_to_euc_E7A9[] = {
0x3972, 0, 0x4A66, 0x634E, 0xD13F, 0xD140, 0x4B54, 0xD141,
0xD142, 0x6350, 0, 0, 0xD143, 0x4051, 0x314F, 0x323A,
0x302C, 0, 0, 0, 0, 0xD144, 0xD145, 0x634F,
@@ -4779,7 +4597,7 @@ static const unsigned short utf8_to_euc_E7A9[] = {
0x6355, 0, 0, 0, 0x376A, 0xD14F, 0x3566, 0,
0xD150, 0x6356, 0x3675, 0, 0, 0x6357, 0xD151, 0x407C,
};
-static const unsigned short utf8_to_euc_E7AA[] = {
+const unsigned short utf8_to_euc_E7AA[] = {
0xD152, 0x464D, 0xD153, 0x4060, 0x3A75, 0xD154, 0xD155, 0,
0x6358, 0, 0xD156, 0xD157, 0, 0, 0, 0,
0xD158, 0xD159, 0x4362, 0x416B, 0xD15A, 0x635A, 0x635C, 0x6359,
@@ -4789,7 +4607,7 @@ static const unsigned short utf8_to_euc_E7AA[] = {
0x635F, 0, 0, 0xD15F, 0, 0xD160, 0x6360, 0,
0, 0xD161, 0x312E, 0xD162, 0xD163, 0, 0, 0x6363,
};
-static const unsigned short utf8_to_euc_E7AB[] = {
+const unsigned short utf8_to_euc_E7AB[] = {
0, 0, 0, 0x3376, 0x6362, 0x6361, 0xD164, 0x6365,
0x635E, 0xD165, 0x6366, 0x4E29, 0xD166, 0x6367, 0xD167, 0x6368,
0, 0xD168, 0x5474, 0x636A, 0, 0x6369, 0, 0,
@@ -4799,7 +4617,7 @@ static const unsigned short utf8_to_euc_E7AB[] = {
0x6372, 0xD16E, 0, 0, 0xD16F, 0, 0x3625, 0,
0x513F, 0x435D, 0x3C33, 0xD170, 0, 0xD171, 0xD172, 0x3448,
};
-static const unsigned short utf8_to_euc_E7AC[] = {
+const unsigned short utf8_to_euc_E7AC[] = {
0, 0, 0x6373, 0, 0x6422, 0, 0x6376, 0xD173,
0x3568, 0, 0x6375, 0x6424, 0, 0, 0, 0x6374,
0, 0x3E50, 0, 0, 0xD174, 0, 0, 0,
@@ -4809,7 +4627,7 @@ static const unsigned short utf8_to_euc_E7AC[] = {
0xD17E, 0xD221, 0, 0x6377, 0xD222, 0x637B, 0x637D, 0,
0, 0x3A7B, 0, 0, 0, 0xD223, 0, 0xD224,
};
-static const unsigned short utf8_to_euc_E7AD[] = {
+const unsigned short utf8_to_euc_E7AD[] = {
0xD225, 0xD226, 0, 0, 0, 0x6426, 0x492E, 0xD227,
0x4826, 0x4579, 0, 0x365A, 0x6425, 0x6423, 0xD228, 0x4835,
0x637E, 0x435E, 0x457B, 0, 0x457A, 0xD229, 0x3A76, 0,
@@ -4819,7 +4637,7 @@ static const unsigned short utf8_to_euc_E7AD[] = {
0x642B, 0x642C, 0xD231, 0xD232, 0x6429, 0x6427, 0, 0xD233,
0, 0, 0x6421, 0, 0, 0, 0, 0,
};
-static const unsigned short utf8_to_euc_E7AE[] = {
+const unsigned short utf8_to_euc_E7AE[] = {
0, 0, 0, 0, 0xD234, 0, 0x4A4F, 0x3255,
0, 0xD235, 0, 0x6435, 0, 0x6432, 0xD236, 0x6437,
0xD237, 0xD238, 0x6436, 0, 0x4773, 0x4C27, 0xD239, 0x3B3B,
@@ -4829,7 +4647,7 @@ static const unsigned short utf8_to_euc_E7AE[] = {
0xD240, 0x4822, 0xD241, 0, 0x643E, 0xD242, 0xD243, 0,
0x4824, 0, 0xD244, 0xD245, 0xD246, 0xD247, 0, 0,
};
-static const unsigned short utf8_to_euc_E7AF[] = {
+const unsigned short utf8_to_euc_E7AF[] = {
0x4061, 0x643B, 0xD248, 0, 0x484F, 0xD249, 0x643F, 0x4A53,
0xD24A, 0x435B, 0xD24B, 0x643A, 0x643C, 0, 0, 0x643D,
0, 0, 0, 0, 0xD24C, 0, 0xD24D, 0xD24E,
@@ -4839,7 +4657,7 @@ static const unsigned short utf8_to_euc_E7AF[] = {
0, 0, 0xD254, 0x644A, 0xD255, 0xD256, 0x644E, 0x644B,
0xD257, 0xD258, 0xD259, 0, 0xD25A, 0, 0xD25B, 0,
};
-static const unsigned short utf8_to_euc_E7B0[] = {
+const unsigned short utf8_to_euc_E7B0[] = {
0x6447, 0xD25C, 0xD25D, 0xD25E, 0xD25F, 0, 0xD260, 0x6448,
0, 0xD261, 0, 0xD262, 0xD263, 0x644D, 0xD264, 0xD265,
0, 0x6442, 0x5255, 0x6449, 0x6443, 0, 0, 0x644C,
@@ -4849,7 +4667,7 @@ static const unsigned short utf8_to_euc_E7B0[] = {
0, 0xD26D, 0, 0xD26E, 0xD26F, 0, 0xD270, 0x6453,
0x4876, 0xD271, 0xD272, 0, 0, 0x6455, 0x4E7C, 0x4A6D,
};
-static const unsigned short utf8_to_euc_E7B1[] = {
+const unsigned short utf8_to_euc_E7B1[] = {
0x645A, 0, 0, 0x6457, 0, 0, 0xD273, 0,
0, 0, 0xD274, 0, 0x6456, 0x4052, 0, 0x6459,
0x645B, 0xD276, 0xD277, 0xD278, 0x6458, 0xD275, 0x645F, 0,
@@ -4859,7 +4677,7 @@ static const unsigned short utf8_to_euc_E7B1[] = {
0xD327, 0, 0xD328, 0x4A46, 0, 0x6462, 0, 0,
0, 0xD329, 0, 0, 0xD32A, 0xD32B, 0x4C62, 0,
};
-static const unsigned short utf8_to_euc_E7B2[] = {
+const unsigned short utf8_to_euc_E7B2[] = {
0, 0x364E, 0x3729, 0x6463, 0, 0, 0xD32C, 0xD32D,
0, 0x4A34, 0, 0x3F68, 0, 0x4C30, 0, 0xD32E,
0x6464, 0, 0x4E33, 0, 0xD32F, 0x4774, 0, 0x4146,
@@ -4869,7 +4687,7 @@ static const unsigned short utf8_to_euc_E7B2[] = {
0xD333, 0x646D, 0x646C, 0x646B, 0, 0, 0xD334, 0xD335,
0, 0x646F, 0xD336, 0xD337, 0xD338, 0x6470, 0x403A, 0xD339,
};
-static const unsigned short utf8_to_euc_E7B3[] = {
+const unsigned short utf8_to_euc_E7B3[] = {
0x6471, 0, 0x6473, 0, 0xD33A, 0x6472, 0, 0xD33B,
0xD33C, 0xD33D, 0x3852, 0, 0, 0xD33E, 0x4138, 0xD33F,
0, 0, 0x6475, 0xD340, 0xD341, 0xD342, 0x457C, 0xD343,
@@ -4879,7 +4697,7 @@ static const unsigned short utf8_to_euc_E7B3[] = {
0, 0, 0x647A, 0, 0x647B, 0xD34A, 0x647C, 0,
0x3B65, 0, 0x647D, 0x374F, 0, 0, 0x356A, 0,
};
-static const unsigned short utf8_to_euc_E7B4[] = {
+const unsigned short utf8_to_euc_E7B4[] = {
0x352A, 0, 0x6521, 0xD34B, 0x4C73, 0x3948, 0x647E, 0xD34C,
0xD34D, 0xD34E, 0x6524, 0x4C66, 0, 0x473C, 0, 0xD34F,
0x4933, 0xD350, 0xD351, 0xD352, 0x3D63, 0x6523, 0xD353, 0x3C53,
@@ -4889,7 +4707,7 @@ static const unsigned short utf8_to_euc_E7B4[] = {
0x3A59, 0xD35A, 0x6528, 0x3F42, 0, 0x652A, 0, 0,
0, 0x3E52, 0x3A30, 0, 0xD35B, 0xD35C, 0xD35D, 0x6529,
};
-static const unsigned short utf8_to_euc_E7B5[] = {
+const unsigned short utf8_to_euc_E7B5[] = {
0xD35E, 0xD35F, 0x3D2A, 0x383E, 0x4148, 0x6525, 0x652B, 0xD360,
0xD361, 0, 0, 0x6526, 0x3750, 0xD362, 0x652E, 0x6532,
0x376B, 0xD363, 0, 0xD364, 0, 0, 0x652D, 0xD365,
@@ -4899,7 +4717,7 @@ static const unsigned short utf8_to_euc_E7B5[] = {
0xD36D, 0x457D, 0x652F, 0x652C, 0, 0x3328, 0x4064, 0,
0xD36E, 0x3828, 0xD36F, 0xD370, 0, 0x6538, 0, 0xD371,
};
-static const unsigned short utf8_to_euc_E7B6[] = {
+const unsigned short utf8_to_euc_E7B6[] = {
0, 0xD372, 0xD373, 0xD374, 0, 0xD375, 0xD376, 0,
0xD377, 0x6535, 0, 0xD378, 0xD379, 0xD37A, 0, 0x6537,
0, 0xD37B, 0, 0x6534, 0, 0, 0xD37C, 0xD37D,
@@ -4909,7 +4727,7 @@ static const unsigned short utf8_to_euc_E7B6[] = {
0x6547, 0x394B, 0x4C56, 0xD425, 0x4456, 0x653D, 0xD426, 0xD427,
0x6545, 0xD428, 0x653A, 0x433E, 0, 0x653F, 0x303D, 0x4C4A,
};
-static const unsigned short utf8_to_euc_E7B7[] = {
+const unsigned short utf8_to_euc_E7B7[] = {
0, 0, 0xD429, 0xD42A, 0xD42B, 0xD42C, 0xD42D, 0x653E,
0, 0, 0x365B, 0x486C, 0xD42E, 0xD42F, 0xD430, 0x416D,
0, 0x4E50, 0x3D6F, 0, 0, 0x656E, 0xF45D, 0xD431,
@@ -4919,7 +4737,7 @@ static const unsigned short utf8_to_euc_E7B7[] = {
0, 0xD43A, 0x654D, 0, 0x4E7D, 0xD43B, 0xD43C, 0,
0, 0xD43D, 0xD43E, 0x654C, 0, 0, 0, 0,
};
-static const unsigned short utf8_to_euc_E7B8[] = {
+const unsigned short utf8_to_euc_E7B8[] = {
0xD433, 0x316F, 0, 0, 0x466C, 0x654F, 0, 0,
0xD43F, 0x6556, 0x6550, 0x6557, 0, 0, 0, 0,
0xD440, 0xD441, 0x6553, 0, 0, 0xD442, 0, 0xD443,
@@ -4929,7 +4747,7 @@ static const unsigned short utf8_to_euc_E7B8[] = {
0, 0x6554, 0x6560, 0xD44C, 0, 0x655C, 0xD44D, 0x655F,
0, 0x655D, 0x6561, 0x655B, 0, 0x6541, 0x4053, 0xD44E,
};
-static const unsigned short utf8_to_euc_E7B9[] = {
+const unsigned short utf8_to_euc_E7B9[] = {
0, 0x484B, 0, 0x655E, 0xD44F, 0xD450, 0x6559, 0xD451,
0, 0, 0x4121, 0x3752, 0, 0x3D2B, 0xD452, 0,
0xD453, 0, 0xD454, 0, 0x3F25, 0x4136, 0x6564, 0,
@@ -4939,7 +4757,7 @@ static const unsigned short utf8_to_euc_E7B9[] = {
0x372B, 0, 0, 0xD45D, 0, 0, 0, 0,
0xD45E, 0x6568, 0, 0x656C, 0x656B, 0x656F, 0xD45F, 0x6571,
};
-static const unsigned short utf8_to_euc_E7BA[] = {
+const unsigned short utf8_to_euc_E7BA[] = {
0, 0xD460, 0x3B3C, 0x656D, 0, 0, 0xD461, 0xD462,
0x6572, 0x6573, 0xD463, 0, 0x6574, 0xD464, 0x657A, 0x453B,
0x6576, 0xD465, 0x6575, 0x6577, 0x6578, 0xD466, 0x6579, 0,
@@ -4949,7 +4767,7 @@ static const unsigned short utf8_to_euc_E7BA[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
};
-static const unsigned short utf8_to_euc_E7BC[] = {
+const unsigned short utf8_to_euc_E7BC[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -4959,7 +4777,7 @@ static const unsigned short utf8_to_euc_E7BC[] = {
0, 0, 0, 0, 0, 0, 0x344C, 0,
0x657D, 0, 0x657E, 0xD46C, 0xD46B, 0xD46D, 0xD46E, 0xD46F,
};
-static const unsigned short utf8_to_euc_E7BD[] = {
+const unsigned short utf8_to_euc_E7BD[] = {
0, 0, 0, 0xD470, 0xD471, 0x6621, 0, 0xD472,
0, 0, 0, 0, 0x6622, 0x6623, 0x6624, 0xD473,
0x6625, 0x6626, 0xD474, 0xD475, 0x6628, 0x6627, 0, 0,
@@ -4969,7 +4787,7 @@ static const unsigned short utf8_to_euc_E7BD[] = {
0x4833, 0xD521, 0x3D70, 0, 0, 0x474D, 0, 0x486D,
0x662F, 0x586D, 0, 0, 0, 0xD522, 0xD523, 0xD524,
};
-static const unsigned short utf8_to_euc_E7BE[] = {
+const unsigned short utf8_to_euc_E7BE[] = {
0xD525, 0, 0x6630, 0x6632, 0, 0x4D65, 0x6631, 0x6634,
0x6633, 0, 0x4D53, 0xD526, 0x6635, 0xD527, 0x487E, 0xD528,
0xD529, 0xD52A, 0, 0, 0x6636, 0, 0xD52B, 0xD52C,
@@ -4979,7 +4797,7 @@ static const unsigned short utf8_to_euc_E7BE[] = {
0, 0, 0x663C, 0, 0xD533, 0, 0x663F, 0,
0x6640, 0x663D, 0, 0, 0xD534, 0x3129, 0, 0xD535,
};
-static const unsigned short utf8_to_euc_E7BF[] = {
+const unsigned short utf8_to_euc_E7BF[] = {
0xD536, 0x3227, 0, 0xD537, 0, 0x6642, 0x6643, 0,
0xD538, 0, 0x6644, 0, 0x4D62, 0, 0xD539, 0xD53A,
0, 0, 0x3D2C, 0, 0x6646, 0x6645, 0, 0,
@@ -4989,7 +4807,7 @@ static const unsigned short utf8_to_euc_E7BF[] = {
0x344D, 0, 0xD543, 0x664A, 0, 0, 0, 0,
0, 0x664B, 0xD544, 0x4B5D, 0x4D63, 0xD545, 0xD546, 0xD547,
};
-static const unsigned short utf8_to_euc_E880[] = {
+const unsigned short utf8_to_euc_E880[] = {
0x4D54, 0x4F37, 0, 0x394D, 0x664E, 0x3C54, 0x664D, 0xD548,
0xD549, 0, 0xD54A, 0x664F, 0x3C29, 0xD54B, 0xD54C, 0xD54D,
0x4251, 0xD54E, 0x6650, 0xD54F, 0xD550, 0x394C, 0xD551, 0x4C57,
@@ -4999,7 +4817,7 @@ static const unsigned short utf8_to_euc_E880[] = {
0xD55A, 0, 0, 0x3C2A, 0xD55B, 0xD55C, 0x4C6D, 0xD55D,
0, 0xD55E, 0xD55F, 0x6657, 0xD560, 0x433F, 0xD561, 0x6656,
};
-static const unsigned short utf8_to_euc_E881[] = {
+const unsigned short utf8_to_euc_E881[] = {
0xD562, 0, 0, 0, 0xD563, 0, 0x6659, 0,
0, 0, 0x6658, 0, 0, 0, 0, 0,
0, 0, 0x665A, 0, 0, 0, 0x403B, 0,
@@ -5009,7 +4827,7 @@ static const unsigned short utf8_to_euc_E881[] = {
0x6662, 0xD568, 0x6661, 0x6660, 0x4430, 0xD569, 0x6663, 0x3F26,
0, 0x6664, 0, 0, 0, 0x6665, 0x4F38, 0x6666,
};
-static const unsigned short utf8_to_euc_E882[] = {
+const unsigned short utf8_to_euc_E882[] = {
0, 0xD56A, 0, 0, 0x6667, 0x6669, 0x6668, 0x4825,
0xD56B, 0x4679, 0, 0x4F3E, 0x4829, 0, 0xD56C, 0,
0, 0, 0, 0x666B, 0, 0, 0x3E53, 0,
@@ -5019,7 +4837,7 @@ static const unsigned short utf8_to_euc_E882[] = {
0, 0x394F, 0x3069, 0, 0x3A68, 0, 0, 0,
0xD572, 0xD573, 0x4759, 0, 0, 0, 0, 0,
};
-static const unsigned short utf8_to_euc_E883[] = {
+const unsigned short utf8_to_euc_E883[] = {
0, 0, 0, 0x305F, 0x6674, 0, 0x4340, 0,
0xD574, 0, 0, 0, 0x4758, 0xD575, 0x425B, 0xD576,
0, 0, 0xD577, 0, 0xD578, 0xD579, 0x6676, 0xD57A,
@@ -5029,7 +4847,7 @@ static const unsigned short utf8_to_euc_E883[] = {
0xD621, 0x6679, 0xD622, 0xD623, 0x4639, 0, 0xD624, 0,
0x363B, 0xD625, 0xD626, 0, 0x6726, 0x473D, 0xD627, 0,
};
-static const unsigned short utf8_to_euc_E884[] = {
+const unsigned short utf8_to_euc_E884[] = {
0, 0, 0x3B69, 0xD628, 0, 0x363C, 0x4048, 0x4F46,
0x4C2E, 0x6677, 0x4054, 0xD629, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0xD62A, 0xD62B,
@@ -5039,7 +4857,7 @@ static const unsigned short utf8_to_euc_E884[] = {
0xD633, 0x4326, 0, 0x473E, 0, 0xD634, 0, 0,
0, 0x4431, 0xD635, 0, 0xD636, 0, 0x6723, 0,
};
-static const unsigned short utf8_to_euc_E885[] = {
+const unsigned short utf8_to_euc_E885[] = {
0, 0, 0, 0, 0, 0xD637, 0x6722, 0xD638,
0, 0, 0xD639, 0x667E, 0xD63A, 0, 0x3F55, 0,
0x4965, 0x6725, 0xD63B, 0x6724, 0x3950, 0x4F53, 0, 0xD63C,
@@ -5049,7 +4867,7 @@ static const unsigned short utf8_to_euc_E885[] = {
0x3978, 0x6727, 0, 0, 0x672B, 0, 0, 0xD644,
0x4432, 0x4A22, 0x4123, 0, 0, 0, 0, 0x425C,
};
-static const unsigned short utf8_to_euc_E886[] = {
+const unsigned short utf8_to_euc_E886[] = {
0x672F, 0xD645, 0x6730, 0x672C, 0xD647, 0xD648, 0xD649, 0,
0x672D, 0, 0x672E, 0xD64A, 0, 0, 0xD64B, 0x3951,
0xD646, 0, 0, 0x6736, 0, 0x6732, 0xD64C, 0,
@@ -5059,7 +4877,7 @@ static const unsigned short utf8_to_euc_E886[] = {
0x6738, 0, 0xD652, 0x4137, 0xD653, 0x6739, 0, 0,
0x673B, 0, 0x673F, 0xD654, 0, 0x673C, 0x673A, 0x473F,
};
-static const unsigned short utf8_to_euc_E887[] = {
+const unsigned short utf8_to_euc_E887[] = {
0x673D, 0, 0x673E, 0xD656, 0, 0xD657, 0x3232, 0,
0x6745, 0x6740, 0xD658, 0xD655, 0, 0x6741, 0xD659, 0xD65A,
0, 0x6742, 0, 0x4221, 0, 0xD65B, 0, 0xD65C,
@@ -5069,7 +4887,7 @@ static const unsigned short utf8_to_euc_E887[] = {
0xD664, 0xD665, 0xD666, 0x3B6A, 0x4357, 0xD667, 0xD668, 0,
0xD669, 0xD66A, 0x674A, 0x674B, 0x3131, 0xD66B, 0x674C, 0xD66C,
};
-static const unsigned short utf8_to_euc_E888[] = {
+const unsigned short utf8_to_euc_E888[] = {
0xD66D, 0x674D, 0x674E, 0xD66E, 0, 0x674F, 0, 0x6750,
0x363D, 0x5A2A, 0x6751, 0, 0x4065, 0x6752, 0x3C4B, 0xD66F,
0x6753, 0, 0x5030, 0xD670, 0xD671, 0, 0x6754, 0x4A5E,
@@ -5079,7 +4897,7 @@ static const unsigned short utf8_to_euc_E888[] = {
0, 0, 0xD678, 0x6758, 0xD679, 0x4249, 0x4775, 0x383F,
0x6757, 0x4125, 0xD67A, 0, 0, 0, 0, 0,
};
-static const unsigned short utf8_to_euc_E889[] = {
+const unsigned short utf8_to_euc_E889[] = {
0x6759, 0, 0, 0xD67B, 0xD67C, 0xD67D, 0xD67E, 0x447A,
0, 0, 0, 0xD721, 0, 0, 0xD722, 0xD723,
0, 0xD724, 0, 0, 0, 0, 0xD725, 0,
@@ -5089,7 +4907,7 @@ static const unsigned short utf8_to_euc_E889[] = {
0, 0x6765, 0x3F27, 0, 0xD72B, 0, 0x3170, 0x6766,
0x6767, 0, 0, 0xD72C, 0, 0xD72D, 0x6768, 0xD72E,
};
-static const unsigned short utf8_to_euc_E88A[] = {
+const unsigned short utf8_to_euc_E88A[] = {
0xD72F, 0xD730, 0, 0xD731, 0xD732, 0, 0, 0xD733,
0, 0xD734, 0xD735, 0x3072, 0, 0x6769, 0xD736, 0,
0, 0xD737, 0x676A, 0, 0xD738, 0, 0xD739, 0,
@@ -5099,7 +4917,7 @@ static const unsigned short utf8_to_euc_E88A[] = {
0xD746, 0x3256, 0xD747, 0x4B27, 0xD748, 0, 0, 0xD749,
0x375D, 0x365C, 0xD74A, 0x676D, 0xD74B, 0x326A, 0xD74C, 0xD74D,
};
-static const unsigned short utf8_to_euc_E88B[] = {
+const unsigned short utf8_to_euc_E88B[] = {
0, 0, 0, 0, 0, 0x3423, 0xD74E, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0xD74F, 0x3171, 0x6772, 0x4E6A, 0x425D, 0xD750, 0, 0x4944,
@@ -5109,7 +4927,7 @@ static const unsigned short utf8_to_euc_E88B[] = {
0, 0x3151, 0, 0x6774, 0x6773, 0, 0xD759, 0xD75A,
0, 0x6779, 0x6775, 0x6778, 0, 0xD75B, 0xD75C, 0,
};
-static const unsigned short utf8_to_euc_E88C[] = {
+const unsigned short utf8_to_euc_E88C[] = {
0xD75D, 0xD75E, 0x4C50, 0x6777, 0x3258, 0x337D, 0x677B, 0xD75F,
0xD760, 0x677D, 0xD761, 0xD762, 0, 0, 0x3754, 0,
0, 0, 0, 0, 0, 0, 0x6823, 0x682C,
@@ -5119,7 +4937,7 @@ static const unsigned short utf8_to_euc_E88C[] = {
0xD76D, 0x6825, 0x6824, 0xD76E, 0x6822, 0x6821, 0x4363, 0xD76F,
0x427B, 0x6827, 0xD770, 0, 0xD771, 0xD772, 0, 0,
};
-static const unsigned short utf8_to_euc_E88D[] = {
+const unsigned short utf8_to_euc_E88D[] = {
0x6826, 0, 0xD773, 0xD774, 0xD775, 0x6829, 0, 0xD776,
0, 0x4170, 0x3755, 0, 0, 0xD777, 0xD778, 0x3141,
0x6828, 0xD779, 0x3953, 0xD83E, 0xD763, 0xD77A, 0xD77B, 0xD77C,
@@ -5129,7 +4947,7 @@ static const unsigned short utf8_to_euc_E88D[] = {
0xD77D, 0, 0, 0x683A, 0, 0x683B, 0, 0x3259,
0xD77E, 0, 0, 0x322E, 0x6838, 0xD821, 0, 0xD822,
};
-static const unsigned short utf8_to_euc_E88E[] = {
+const unsigned short utf8_to_euc_E88E[] = {
0xD823, 0, 0xD824, 0, 0xD825, 0x682E, 0xD826, 0x6836,
0, 0x683D, 0x6837, 0, 0, 0xD827, 0x6835, 0,
0, 0, 0xD828, 0x6776, 0xD829, 0xD82A, 0x6833, 0,
@@ -5139,7 +4957,7 @@ static const unsigned short utf8_to_euc_E88E[] = {
0, 0x4D69, 0, 0, 0, 0x6839, 0, 0,
0, 0, 0, 0, 0, 0x684F, 0xD834, 0xD835,
};
-static const unsigned short utf8_to_euc_E88F[] = {
+const unsigned short utf8_to_euc_E88F[] = {
0xD836, 0x6847, 0, 0, 0, 0x3F7B, 0, 0xD837,
0, 0xD838, 0x3546, 0, 0x365D, 0, 0x6842, 0xD839,
0xD83A, 0xD83B, 0, 0x325B, 0xD83C, 0, 0x3E54, 0,
@@ -5149,7 +4967,7 @@ static const unsigned short utf8_to_euc_E88F[] = {
0x3856, 0x4929, 0x684B, 0, 0x683F, 0, 0xD841, 0x6848,
0xD842, 0xD843, 0, 0x6852, 0xD844, 0x6843, 0, 0,
};
-static const unsigned short utf8_to_euc_E890[] = {
+const unsigned short utf8_to_euc_E890[] = {
0, 0xD845, 0, 0x6844, 0x463A, 0, 0xD846, 0x6849,
0, 0, 0xD847, 0x6846, 0x4B28, 0x684C, 0x3060, 0xD848,
0, 0xD849, 0, 0x6840, 0, 0xD84A, 0, 0,
@@ -5159,7 +4977,7 @@ static const unsigned short utf8_to_euc_E890[] = {
0, 0x337E, 0, 0, 0, 0x6862, 0, 0,
0x6850, 0xD84E, 0, 0, 0x6855, 0x4D6E, 0, 0,
};
-static const unsigned short utf8_to_euc_E891[] = {
+const unsigned short utf8_to_euc_E891[] = {
0, 0, 0, 0, 0, 0xD84F, 0x685E, 0xD850,
0xD851, 0x4D55, 0xD852, 0, 0, 0xD853, 0x4E2A, 0xD854,
0, 0xD855, 0xD856, 0, 0, 0, 0xD857, 0x4378,
@@ -5169,7 +4987,7 @@ static const unsigned short utf8_to_euc_E891[] = {
0xD861, 0x472C, 0, 0xD862, 0xD863, 0x302A, 0xD864, 0x6858,
0xD865, 0x6861, 0x4978, 0, 0xD866, 0xD867, 0, 0,
};
-static const unsigned short utf8_to_euc_E892[] = {
+const unsigned short utf8_to_euc_E892[] = {
0, 0xD868, 0x685C, 0, 0x6857, 0xD869, 0, 0,
0, 0, 0, 0x3E55, 0, 0, 0, 0,
0x3D2F, 0, 0xD86A, 0xD86B, 0x3C2C, 0xD86C, 0, 0,
@@ -5179,7 +4997,7 @@ static const unsigned short utf8_to_euc_E892[] = {
0, 0xD873, 0x3377, 0, 0xD874, 0, 0, 0,
0x3E78, 0x6865, 0xD875, 0x686A, 0x4173, 0xD876, 0xD877, 0x6866,
};
-static const unsigned short utf8_to_euc_E893[] = {
+const unsigned short utf8_to_euc_E893[] = {
0xD878, 0x686D, 0xD879, 0, 0x435F, 0, 0x686E, 0xD87A,
0xD87B, 0x4D56, 0x6863, 0x3338, 0xD87C, 0x6869, 0, 0xD87D,
0x686C, 0x4C2C, 0, 0xD87E, 0, 0, 0x686F, 0,
@@ -5189,7 +5007,7 @@ static const unsigned short utf8_to_euc_E893[] = {
0xD925, 0xD926, 0xD927, 0, 0x6873, 0, 0, 0xD928,
0, 0, 0xD92A, 0xD92B, 0x687A, 0xD92C, 0, 0x6872,
};
-static const unsigned short utf8_to_euc_E894[] = {
+const unsigned short utf8_to_euc_E894[] = {
0x3C43, 0, 0xD92D, 0xD92E, 0, 0, 0x6851, 0xD92F,
0, 0, 0, 0, 0xD930, 0, 0xD931, 0,
0xD932, 0x4A4E, 0, 0x4C22, 0x6879, 0x6878, 0, 0x6874,
@@ -5199,7 +5017,7 @@ static const unsigned short utf8_to_euc_E894[] = {
0, 0, 0xD929, 0xD93D, 0xD93E, 0x4222, 0xD93F, 0,
0, 0, 0, 0, 0, 0x4A43, 0, 0xD940,
};
-static const unsigned short utf8_to_euc_E895[] = {
+const unsigned short utf8_to_euc_E895[] = {
0x687B, 0x6921, 0, 0x4859, 0, 0, 0xD941, 0,
0x687E, 0x3E56, 0x3C49, 0x6923, 0, 0, 0x363E, 0xD942,
0xD943, 0xD944, 0xD945, 0xD946, 0, 0x6924, 0xD947, 0x4979,
@@ -5209,7 +5027,7 @@ static const unsigned short utf8_to_euc_E895[] = {
0, 0, 0, 0, 0, 0, 0, 0x6931,
0, 0xD953, 0xD954, 0xD955, 0, 0xD956, 0x6932, 0xD957,
};
-static const unsigned short utf8_to_euc_E896[] = {
+const unsigned short utf8_to_euc_E896[] = {
0x6925, 0xD958, 0, 0, 0x4776, 0xD959, 0xD95A, 0x692F,
0x6927, 0xD95B, 0x6929, 0xD95C, 0xD95D, 0, 0, 0xD95E,
0x6933, 0x6928, 0, 0xD95F, 0x692C, 0, 0, 0x3172,
@@ -5219,7 +5037,7 @@ static const unsigned short utf8_to_euc_E896[] = {
0xF461, 0, 0, 0, 0xD967, 0, 0xD968, 0xD969,
0xD96A, 0x6937, 0x6935, 0, 0xD96B, 0xD96C, 0xD96D, 0xD96E,
};
-static const unsigned short utf8_to_euc_E897[] = {
+const unsigned short utf8_to_euc_E897[] = {
0, 0x4F4E, 0xD96F, 0, 0, 0, 0, 0xD970,
0, 0x6934, 0xD971, 0xD972, 0, 0x4D75, 0xD973, 0x6936,
0x6938, 0, 0, 0, 0, 0x6939, 0, 0,
@@ -5229,7 +5047,7 @@ static const unsigned short utf8_to_euc_E897[] = {
0, 0, 0, 0xD97C, 0, 0, 0xD97D, 0x3D73,
0, 0x693D, 0x6942, 0x4174, 0xD97E, 0, 0x6941, 0xDA21,
};
-static const unsigned short utf8_to_euc_E898[] = {
+const unsigned short utf8_to_euc_E898[] = {
0xDA22, 0, 0x6922, 0, 0xDA23, 0xDA24, 0x6943, 0x4149,
0, 0, 0x693E, 0x6940, 0, 0xDA25, 0xDA26, 0,
0xDA27, 0xDA28, 0xDA29, 0x693F, 0, 0, 0x5D31, 0x5D22,
@@ -5239,7 +5057,7 @@ static const unsigned short utf8_to_euc_E898[] = {
0x6946, 0, 0, 0, 0, 0, 0xDA31, 0,
0xDA32, 0, 0xDA33, 0, 0xDA34, 0xDA35, 0, 0x6947,
};
-static const unsigned short utf8_to_euc_E899[] = {
+const unsigned short utf8_to_euc_E899[] = {
0xDA36, 0xB866, 0xDA37, 0, 0, 0, 0xDA38, 0,
0, 0, 0, 0, 0, 0x6948, 0x3857, 0,
0x3554, 0, 0xDA39, 0xDA3A, 0x694A, 0x515D, 0xDA3B, 0xDA3C,
@@ -5249,7 +5067,7 @@ static const unsigned short utf8_to_euc_E899[] = {
0, 0x694D, 0, 0, 0, 0xDA48, 0xDA49, 0xDA4A,
0, 0x467A, 0xDA4B, 0x303A, 0, 0, 0, 0,
};
-static const unsigned short utf8_to_euc_E89A[] = {
+const unsigned short utf8_to_euc_E89A[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0xDA6D, 0, 0x3263, 0x6952, 0x6953, 0xDA4C, 0, 0,
0, 0xDA4D, 0, 0x694E, 0, 0x3B3D, 0xDA4E, 0,
@@ -5259,7 +5077,7 @@ static const unsigned short utf8_to_euc_E89A[] = {
0x6958, 0xDA57, 0, 0xDA58, 0xDA59, 0xDA5A, 0x6954, 0xDA5B,
0xDA5C, 0xDA5D, 0, 0, 0, 0, 0, 0xDA5E,
};
-static const unsigned short utf8_to_euc_E89B[] = {
+const unsigned short utf8_to_euc_E89B[] = {
0xDA5F, 0xDA60, 0, 0xDA61, 0x6956, 0xDA62, 0x6957, 0x3C58,
0, 0x6959, 0, 0x4341, 0, 0x3756, 0x3342, 0,
0, 0xDA63, 0xDA64, 0, 0x695C, 0xDA65, 0, 0xDA66,
@@ -5269,7 +5087,7 @@ static const unsigned short utf8_to_euc_E89B[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0x427D, 0x696C, 0xDA6E, 0x6968, 0xDA6F, 0xDA70, 0x326B, 0,
};
-static const unsigned short utf8_to_euc_E89C[] = {
+const unsigned short utf8_to_euc_E89C[] = {
0x6966, 0, 0x4B2A, 0x6967, 0xDA71, 0xDA72, 0x6964, 0xDA73,
0x6965, 0x696A, 0x696D, 0xDA74, 0, 0x696B, 0xDA75, 0xDA76,
0xDA77, 0x6969, 0x6963, 0xDA78, 0xDA79, 0, 0, 0,
@@ -5279,7 +5097,7 @@ static const unsigned short utf8_to_euc_E89C[] = {
0, 0xDB24, 0xDB25, 0, 0x696E, 0, 0, 0x6970,
0, 0xDB26, 0xDB27, 0x6971, 0xDB28, 0xDB29, 0xDB2A, 0x696F,
};
-static const unsigned short utf8_to_euc_E89D[] = {
+const unsigned short utf8_to_euc_E89D[] = {
0xDB2B, 0, 0, 0xDB2C, 0, 0xDB2D, 0, 0,
0, 0x4066, 0, 0x4F39, 0x6978, 0xDB2E, 0x6979, 0,
0, 0, 0, 0x6A21, 0, 0x3F2A, 0, 0x697B,
@@ -5289,7 +5107,7 @@ static const unsigned short utf8_to_euc_E89D[] = {
0, 0xDB35, 0xDB36, 0, 0x697A, 0, 0x4433, 0,
0x6977, 0, 0, 0xDB37, 0, 0, 0, 0x4768,
};
-static const unsigned short utf8_to_euc_E89E[] = {
+const unsigned short utf8_to_euc_E89E[] = {
0, 0, 0x6A27, 0xDB38, 0xDB39, 0xDB3A, 0xDB3B, 0xDB3C,
0xDB3D, 0xDB3E, 0, 0xDB3F, 0xDB40, 0x4D3B, 0, 0,
0xDB41, 0, 0, 0xDB42, 0, 0xDB43, 0, 0xDB44,
@@ -5299,7 +5117,7 @@ static const unsigned short utf8_to_euc_E89E[] = {
0, 0xDB4E, 0, 0x6A30, 0, 0xDB4F, 0, 0,
0, 0, 0x4D66, 0x6A33, 0, 0x6A2A, 0xDB50, 0xDB51,
};
-static const unsigned short utf8_to_euc_E89F[] = {
+const unsigned short utf8_to_euc_E89F[] = {
0x6A2B, 0xDB52, 0, 0, 0x6A2F, 0, 0x6A32, 0x6A31,
0xDB53, 0xDB54, 0xDB55, 0x6A29, 0, 0, 0xDB56, 0,
0x6A2C, 0, 0x6A3D, 0, 0, 0xDB57, 0xDB58, 0,
@@ -5309,7 +5127,7 @@ static const unsigned short utf8_to_euc_E89F[] = {
0, 0xDB63, 0x6A35, 0xDB64, 0, 0, 0x6A3A, 0x6A3B,
0xDB65, 0x332A, 0xDB66, 0x3542, 0, 0, 0x6A39, 0xDB67,
};
-static const unsigned short utf8_to_euc_E8A0[] = {
+const unsigned short utf8_to_euc_E8A0[] = {
0, 0xDB68, 0, 0xDB69, 0, 0x6A24, 0xDB6A, 0xF464,
0, 0xDB6B, 0xDB6C, 0xDB6D, 0, 0x6A38, 0x6A3C, 0x6A37,
0xDB6E, 0x6A3E, 0xDB70, 0xDB71, 0xDB72, 0x6A40, 0x6A3F, 0,
@@ -5319,7 +5137,7 @@ static const unsigned short utf8_to_euc_E8A0[] = {
0xDB7C, 0x6A43, 0xDB7D, 0, 0, 0xDB7E, 0x6A44, 0,
0, 0x6A45, 0xDC21, 0x6A47, 0xDC22, 0, 0, 0,
};
-static const unsigned short utf8_to_euc_E8A1[] = {
+const unsigned short utf8_to_euc_E8A1[] = {
0x376C, 0xDC23, 0x6A49, 0xDC24, 0x6A48, 0xDC25, 0x3D30, 0,
0xDC26, 0xDC27, 0xDC28, 0xDC29, 0x3954, 0x5E27, 0xDC2A, 0,
0, 0xDC2B, 0x6A4A, 0x3D51, 0, 0xDC2C, 0xDC2D, 0x3339,
@@ -5329,7 +5147,7 @@ static const unsigned short utf8_to_euc_E8A1[] = {
0x3F6A, 0xDC35, 0x6A55, 0, 0, 0x6A52, 0, 0x436F,
0, 0xDC36, 0, 0xDC37, 0, 0x6A53, 0x6A50, 0x365E,
};
-static const unsigned short utf8_to_euc_E8A2[] = {
+const unsigned short utf8_to_euc_E8A2[] = {
0xDC38, 0x6A4F, 0x6A56, 0, 0, 0, 0, 0,
0x3736, 0, 0, 0x425E, 0, 0x6A5C, 0, 0,
0, 0, 0x6A58, 0, 0, 0, 0x4235, 0x6A57,
@@ -5339,7 +5157,7 @@ static const unsigned short utf8_to_euc_E8A2[] = {
0x6A5E, 0x6A60, 0, 0, 0x3853, 0x6A54, 0, 0x3041,
0, 0, 0xDC41, 0, 0, 0xDC42, 0xDC43, 0x6A5F,
};
-static const unsigned short utf8_to_euc_E8A3[] = {
+const unsigned short utf8_to_euc_E8A3[] = {
0xDC44, 0x3A5B, 0x4E76, 0x6A61, 0x6A62, 0x4175, 0, 0,
0, 0, 0xDC45, 0xDC46, 0xDC47, 0xDC48, 0xDC49, 0x4E22,
0, 0xDC4A, 0xDC4B, 0xDC4C, 0x6A63, 0x4D35, 0, 0,
@@ -5349,7 +5167,7 @@ static const unsigned short utf8_to_euc_E8A3[] = {
0xDC51, 0xDC52, 0x6A6C, 0x3E58, 0x6A6A, 0xDC53, 0, 0xDC54,
0x4D67, 0x6A67, 0, 0, 0x6A69, 0x403D, 0x3F7E, 0,
};
-static const unsigned short utf8_to_euc_E8A4[] = {
+const unsigned short utf8_to_euc_E8A4[] = {
0, 0xDC55, 0x6A68, 0, 0x6A6D, 0, 0xDC56, 0x4A23,
0, 0, 0x6A6F, 0, 0x6A6E, 0xDC57, 0xDC58, 0xDC59,
0x336C, 0, 0x4B2B, 0x6A70, 0, 0xDC5A, 0xDC5B, 0,
@@ -5359,7 +5177,7 @@ static const unsigned short utf8_to_euc_E8A4[] = {
0xDC64, 0xDC65, 0xDC66, 0, 0, 0xDC67, 0x6A79, 0,
0x6A7A, 0xDC68, 0xDC69, 0x6A78, 0, 0, 0xDC6A, 0,
};
-static const unsigned short utf8_to_euc_E8A5[] = {
+const unsigned short utf8_to_euc_E8A5[] = {
0xDC6B, 0x6A76, 0xDC6C, 0x6A71, 0x6A77, 0xDC6D, 0xDC6E, 0,
0, 0xDC6F, 0, 0, 0x6A7B, 0x7037, 0, 0xDC70,
0, 0, 0xDC71, 0, 0, 0, 0x3228, 0xDC72,
@@ -5369,7 +5187,7 @@ static const unsigned short utf8_to_euc_E8A5[] = {
0xDC7B, 0, 0x3D31, 0xDC7C, 0x6B26, 0xDC7D, 0, 0x6B27,
0, 0, 0xDC7E, 0xDD21, 0xDD22, 0xDD23, 0x6B28, 0x403E,
};
-static const unsigned short utf8_to_euc_E8A6[] = {
+const unsigned short utf8_to_euc_E8A6[] = {
0, 0x4D57, 0, 0x6B29, 0, 0, 0x4A24, 0x4746,
0x6B2A, 0xDD24, 0x6B2B, 0x382B, 0, 0xDD25, 0, 0x352C,
0xDD26, 0, 0, 0x6B2C, 0xDD27, 0xDD28, 0x3B6B, 0x4741,
@@ -5379,7 +5197,7 @@ static const unsigned short utf8_to_euc_E8A6[] = {
0xDD2E, 0, 0x6B33, 0x3451, 0xDD2F, 0xDD30, 0xDD31, 0xDD32,
0, 0, 0x6B34, 0, 0xDD33, 0x6B35, 0, 0x6B36,
};
-static const unsigned short utf8_to_euc_E8A7[] = {
+const unsigned short utf8_to_euc_E8A7[] = {
0x6B37, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0x3351, 0, 0xDD34, 0xDD35, 0xDD36, 0xDD37,
@@ -5389,7 +5207,7 @@ static const unsigned short utf8_to_euc_E8A7[] = {
0, 0xDD3D, 0, 0xDD3E, 0x6B3C, 0, 0xDD3F, 0,
0x6B3D, 0xDD40, 0, 0, 0, 0xDD41, 0, 0xDD42,
};
-static const unsigned short utf8_to_euc_E8A8[] = {
+const unsigned short utf8_to_euc_E8A8[] = {
0x3840, 0, 0x447B, 0x6B3E, 0xDD43, 0xDD44, 0, 0xDD45,
0x3757, 0, 0x3F56, 0, 0x6B41, 0, 0x4624, 0xDD46,
0x6B40, 0xDD47, 0xDD48, 0x3731, 0xDD49, 0xDD4A, 0x6B3F, 0x4277,
@@ -5399,7 +5217,7 @@ static const unsigned short utf8_to_euc_E8A8[] = {
0, 0x3576, 0, 0x4C75, 0x414A, 0xDD53, 0x6B45, 0xDD54,
0, 0, 0x3F47, 0x4370, 0x3E5A, 0xDD55, 0xDD56, 0,
};
-static const unsigned short utf8_to_euc_E8A9[] = {
+const unsigned short utf8_to_euc_E8A9[] = {
0xDD57, 0x6B46, 0, 0xDD58, 0, 0xDD59, 0x6B49, 0xDD5A,
0x6B4A, 0xDD5B, 0, 0, 0, 0xDD5C, 0xDD5D, 0,
0x3A3E, 0x4242, 0x6B48, 0xDD5E, 0x3E5B, 0x493E, 0xDD5F, 0xDD60,
@@ -5409,7 +5227,7 @@ static const unsigned short utf8_to_euc_E8A9[] = {
0x354D, 0x4F43, 0x333A, 0x3E5C, 0, 0xDD67, 0xDD68, 0xDD69,
0, 0xDD6A, 0xDD6B, 0xDD6C, 0x6B4B, 0, 0xDD6D, 0xDD6E,
};
-static const unsigned short utf8_to_euc_E8AA[] = {
+const unsigned short utf8_to_euc_E8AA[] = {
0xDD6F, 0, 0x6B50, 0xDD70, 0x6B51, 0x6B4F, 0xDD71, 0x3858,
0, 0x4D40, 0, 0xDD72, 0x3B6F, 0x4727, 0, 0xDD73,
0xDD74, 0x6B54, 0xDD75, 0x4040, 0, 0x4342, 0xDD76, 0xDD77,
@@ -5419,7 +5237,7 @@ static const unsigned short utf8_to_euc_E8AA[] = {
0x432F, 0, 0x325D, 0xDD7E, 0, 0, 0xDE21, 0xDE22,
0, 0x4870, 0, 0xDE23, 0x3543, 0, 0xDE24, 0x4434,
};
-static const unsigned short utf8_to_euc_E8AB[] = {
+const unsigned short utf8_to_euc_E8AB[] = {
0, 0, 0x6B5B, 0xDE25, 0x6B59, 0, 0xDE26, 0x434C,
0xDE27, 0xDE28, 0xDE29, 0x4041, 0x3452, 0x6B5A, 0, 0x3F5B,
0, 0xDE2A, 0x4E4A, 0xDE2B, 0xDE2C, 0xDE2D, 0x4F40, 0xDE2E,
@@ -5429,7 +5247,7 @@ static const unsigned short utf8_to_euc_E8AB[] = {
0xDE32, 0x6B61, 0, 0x6B5E, 0xDE33, 0xDE34, 0xDE35, 0x6B65,
0x3D74, 0, 0x3841, 0, 0xDE36, 0, 0x427A, 0xDE37,
};
-static const unsigned short utf8_to_euc_E8AC[] = {
+const unsigned short utf8_to_euc_E8AC[] = {
0x4B45, 0x315A, 0x3062, 0, 0x4625, 0xDE38, 0xDE39, 0x6B69,
0, 0, 0xDE3F, 0xDE3A, 0x6B68, 0, 0x4666, 0,
0x6B6D, 0xDE3B, 0, 0, 0x6B62, 0, 0x6B6C, 0x6B6E,
@@ -5439,7 +5257,7 @@ static const unsigned short utf8_to_euc_E8AC[] = {
0xDE41, 0, 0, 0x6B70, 0, 0, 0, 0xDE42,
0, 0x3660, 0, 0, 0xDE43, 0, 0x6B74, 0,
};
-static const unsigned short utf8_to_euc_E8AD[] = {
+const unsigned short utf8_to_euc_E8AD[] = {
0, 0x6B76, 0xDE44, 0xDE45, 0xDE46, 0xDE47, 0xDE48, 0,
0xDE49, 0x6B7A, 0, 0, 0x6B77, 0xDE4E, 0x6B79, 0x6B78,
0, 0, 0xDE4A, 0xDE4B, 0xDE4C, 0, 0x6B7B, 0,
@@ -5449,7 +5267,7 @@ static const unsigned short utf8_to_euc_E8AD[] = {
0x3544, 0x6641, 0x3E79, 0, 0x6C24, 0, 0xDE52, 0x386E,
0xDE53, 0xDE54, 0, 0, 0xDE55, 0x6C25, 0xDE56, 0xF466,
};
-static const unsigned short utf8_to_euc_E8AE[] = {
+const unsigned short utf8_to_euc_E8AE[] = {
0x6C26, 0xDE57, 0, 0x3B3E, 0xDE58, 0xDE59, 0, 0,
0, 0, 0x5A4E, 0xDE5A, 0x6C27, 0xDE5B, 0x6C28, 0xDE5C,
0x3D32, 0, 0x6C29, 0x6C2A, 0xDE5D, 0xDE5E, 0x6C2B, 0,
@@ -5459,7 +5277,7 @@ static const unsigned short utf8_to_euc_E8AE[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
};
-static const unsigned short utf8_to_euc_E8B0[] = {
+const unsigned short utf8_to_euc_E8B0[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -5469,7 +5287,7 @@ static const unsigned short utf8_to_euc_E8B0[] = {
0, 0, 0, 0, 0, 0, 0, 0x432B,
0xDE62, 0xDE63, 0x6C2E, 0, 0, 0xDE64, 0xDE65, 0x6C30,
};
-static const unsigned short utf8_to_euc_E8B1[] = {
+const unsigned short utf8_to_euc_E8B1[] = {
0, 0x6C2F, 0, 0, 0, 0xDE66, 0x4626, 0xDE67,
0x6C31, 0xDE68, 0x4B2D, 0xDE69, 0x6C32, 0, 0x6C33, 0xDE6A,
0x6C34, 0xDE6B, 0, 0xDE6C, 0xDE6D, 0x6C35, 0, 0xDE6E,
@@ -5479,7 +5297,7 @@ static const unsigned short utf8_to_euc_E8B1[] = {
0, 0, 0, 0xDE79, 0, 0xDE7A, 0xDE7B, 0,
0x6C38, 0x493F, 0x6C39, 0xDE7C, 0x6C41, 0, 0xDE7D, 0,
};
-static const unsigned short utf8_to_euc_E8B2[] = {
+const unsigned short utf8_to_euc_E8B2[] = {
0, 0, 0x6C3A, 0, 0, 0x6C3C, 0xDE7E, 0xDF21,
0, 0x6C3B, 0x6C3D, 0xDF22, 0x4B46, 0x6C3E, 0x6C3F, 0,
0xDF23, 0, 0xDF24, 0xDF25, 0x6C40, 0, 0, 0,
@@ -5489,7 +5307,7 @@ static const unsigned short utf8_to_euc_E8B2[] = {
0x4C63, 0, 0x6C47, 0x6C48, 0x352E, 0, 0x6C4A, 0x4763,
0x425F, 0xDF2A, 0xDF2B, 0x4871, 0x453D, 0x6C46, 0, 0x4B47,
};
-static const unsigned short utf8_to_euc_E8B3[] = {
+const unsigned short utf8_to_euc_E8B3[] = {
0x326C, 0x6C4C, 0x4F28, 0x4442, 0x4F45, 0xDF2C, 0xDF2D, 0x3B71,
0x6C4B, 0xDF2E, 0x4231, 0xDF2F, 0, 0x6C5C, 0x4128, 0xDF30,
0, 0x4678, 0, 0x4950, 0, 0xDF32, 0xDF31, 0,
@@ -5499,7 +5317,7 @@ static const unsigned short utf8_to_euc_E8B3[] = {
0xDF39, 0, 0xDF3A, 0, 0xF467, 0xDF3B, 0, 0xDF3C,
0xDF3D, 0, 0x6C51, 0x6C52, 0x3958, 0x6C50, 0xDF3E, 0xDF3F,
};
-static const unsigned short utf8_to_euc_E8B4[] = {
+const unsigned short utf8_to_euc_E8B4[] = {
0, 0xDF40, 0, 0xDF41, 0x6C53, 0x6C54, 0, 0x6C56,
0x4223, 0xDF42, 0x6C55, 0x3466, 0, 0x6C58, 0, 0x6C57,
0x6C59, 0, 0xDF43, 0x6C5B, 0x6C5D, 0, 0x6C5E, 0xDF44,
@@ -5509,7 +5327,7 @@ static const unsigned short utf8_to_euc_E8B4[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
};
-static const unsigned short utf8_to_euc_E8B5[] = {
+const unsigned short utf8_to_euc_E8B5[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -5519,7 +5337,7 @@ static const unsigned short utf8_to_euc_E8B5[] = {
0x4176, 0x6C61, 0, 0x6C62, 0x496B, 0, 0xF468, 0x352F,
0, 0, 0, 0, 0, 0, 0, 0xDF4A,
};
-static const unsigned short utf8_to_euc_E8B6[] = {
+const unsigned short utf8_to_euc_E8B6[] = {
0, 0x6C63, 0xDF4B, 0, 0xDF4C, 0x4436, 0, 0,
0xDF4D, 0, 0x315B, 0, 0, 0xDF4E, 0, 0,
0xDF4F, 0xDF50, 0, 0, 0, 0xDF51, 0, 0,
@@ -5529,7 +5347,7 @@ static const unsigned short utf8_to_euc_E8B6[] = {
0, 0, 0xDF59, 0x422D, 0, 0xDF5A, 0, 0xDF5B,
0, 0xDF5C, 0x6C67, 0xDF5D, 0xDF6F, 0, 0x6C66, 0,
};
-static const unsigned short utf8_to_euc_E8B7[] = {
+const unsigned short utf8_to_euc_E8B7[] = {
0xDF5E, 0, 0x6C65, 0, 0, 0xDF5F, 0xDF60, 0xDF61,
0xDF62, 0, 0xDF63, 0x6C6D, 0x6C6B, 0, 0xDF64, 0x6C68,
0, 0xDF65, 0, 0, 0xDF66, 0xDF67, 0x6C6A, 0xDF68,
@@ -5539,7 +5357,7 @@ static const unsigned short utf8_to_euc_E8B7[] = {
0xDF6E, 0xDF70, 0xDF71, 0x4437, 0xDF72, 0x4129, 0, 0,
0, 0, 0, 0, 0x6C72, 0xDF73, 0, 0x6C75,
};
-static const unsigned short utf8_to_euc_E8B8[] = {
+const unsigned short utf8_to_euc_E8B8[] = {
0, 0xDF74, 0, 0, 0xDF75, 0xDF76, 0xDF77, 0,
0x6C73, 0x6C74, 0x4D59, 0xDF78, 0, 0, 0, 0x4627,
0x6C78, 0xDF79, 0, 0, 0xDF7A, 0, 0xDF7B, 0,
@@ -5549,7 +5367,7 @@ static const unsigned short utf8_to_euc_E8B8[] = {
0x6C7C, 0xE024, 0, 0xE025, 0x6C7D, 0x6C7B, 0xE026, 0xE027,
0xE028, 0xE029, 0, 0, 0, 0xE02A, 0, 0,
};
-static const unsigned short utf8_to_euc_E8B9[] = {
+const unsigned short utf8_to_euc_E8B9[] = {
0xE02B, 0xE02C, 0x6C7A, 0, 0x447D, 0, 0, 0x6D21,
0x6D25, 0x6D22, 0x6C7E, 0xE02D, 0x6D23, 0xE02E, 0xE02F, 0xE030,
0x6D24, 0, 0, 0, 0xE031, 0x6D2B, 0, 0,
@@ -5559,7 +5377,7 @@ static const unsigned short utf8_to_euc_E8B9[] = {
0xE03C, 0xE03D, 0x6D2D, 0, 0x3D33, 0, 0x6D2C, 0,
0, 0xE03E, 0xE03F, 0xE040, 0x6D2E, 0, 0, 0,
};
-static const unsigned short utf8_to_euc_E8BA[] = {
+const unsigned short utf8_to_euc_E8BA[] = {
0, 0x6D2F, 0xE041, 0xE042, 0x6D32, 0x6D31, 0, 0x6D30,
0, 0xE043, 0x6D34, 0x6D33, 0, 0x4C76, 0, 0,
0xE044, 0x6D36, 0xE045, 0x6D35, 0x6D37, 0xE046, 0, 0,
@@ -5569,7 +5387,7 @@ static const unsigned short utf8_to_euc_E8BA[] = {
0x6D3C, 0x6D3E, 0, 0xE050, 0, 0xE051, 0, 0,
0, 0, 0xE052, 0xE053, 0, 0, 0x6D3F, 0,
};
-static const unsigned short utf8_to_euc_E8BB[] = {
+const unsigned short utf8_to_euc_E8BB[] = {
0xE054, 0xE055, 0, 0xE056, 0xE057, 0x6D40, 0x6D3D, 0xE058,
0x6D41, 0, 0x3C56, 0x6D42, 0x3530, 0x3733, 0, 0xE059,
0, 0xE05A, 0x382E, 0, 0xE05B, 0, 0, 0,
@@ -5579,7 +5397,7 @@ static const unsigned short utf8_to_euc_E8BB[] = {
0xE05F, 0xE060, 0, 0, 0, 0, 0, 0xE061,
0x3C34, 0xE062, 0xE063, 0x6D46, 0x6D45, 0x375A, 0x6D48, 0,
};
-static const unsigned short utf8_to_euc_E8BC[] = {
+const unsigned short utf8_to_euc_E8BC[] = {
0xE065, 0, 0xE066, 0x3353, 0, 0x6D4A, 0, 0xE067,
0xE068, 0x3A5C, 0x6D49, 0, 0x6D52, 0, 0, 0xE069,
0xE06A, 0, 0x6D4C, 0x6D4E, 0x4A65, 0x6D4B, 0xE06B, 0xE06C,
@@ -5589,7 +5407,7 @@ static const unsigned short utf8_to_euc_E8BC[] = {
0, 0, 0, 0x6D54, 0xE078, 0xE079, 0xE07A, 0xE07B,
0x4D22, 0x6D56, 0xE07C, 0x6D55, 0, 0, 0x6D59, 0x4D41,
};
-static const unsigned short utf8_to_euc_E8BD[] = {
+const unsigned short utf8_to_euc_E8BD[] = {
0xE07D, 0xE07E, 0x6D58, 0xE121, 0x336D, 0x6D57, 0x6D5C, 0xE122,
0, 0x6D5B, 0, 0, 0x6D5A, 0x4532, 0x6D5D, 0xE123,
0, 0xE124, 0xE125, 0xE126, 0xE127, 0xE128, 0, 0x6D5E,
@@ -5599,7 +5417,7 @@ static const unsigned short utf8_to_euc_E8BD[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
};
-static const unsigned short utf8_to_euc_E8BE[] = {
+const unsigned short utf8_to_euc_E8BE[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -5609,7 +5427,7 @@ static const unsigned short utf8_to_euc_E8BE[] = {
0x4324, 0x3F2B, 0x4740, 0, 0, 0xE133, 0xE134, 0x6D68,
0xE135, 0, 0x4A55, 0x4454, 0x397E, 0, 0xE136, 0x4329,
};
-static const unsigned short utf8_to_euc_E8BF[] = {
+const unsigned short utf8_to_euc_E8BF[] = {
0xE137, 0xE138, 0x312A, 0, 0x4B78, 0x3F57, 0xE139, 0,
0, 0, 0xE13A, 0xE13B, 0, 0xE13C, 0x375E, 0,
0xE13D, 0x3661, 0xE13E, 0xE13F, 0x4A56, 0xE140, 0, 0,
@@ -5619,7 +5437,7 @@ static const unsigned short utf8_to_euc_E8BF[] = {
0x3D52, 0xE146, 0, 0, 0x6D6F, 0xE147, 0xE148, 0x4C42,
0x6D7E, 0x6D71, 0x6D72, 0xE149, 0, 0x4449, 0xE14A, 0,
};
-static const unsigned short utf8_to_euc_E980[] = {
+const unsigned short utf8_to_euc_E980[] = {
0x4260, 0x4177, 0xE14B, 0x4628, 0xE14C, 0x6D70, 0x3555, 0,
0xE14D, 0, 0, 0x6D79, 0xE14E, 0x6D76, 0x6E25, 0x4629,
0x4360, 0x6D73, 0, 0x447E, 0x4553, 0x6D74, 0x6D78, 0x3F60,
@@ -5629,7 +5447,7 @@ static const unsigned short utf8_to_euc_E980[] = {
0, 0x3D35, 0x3F4A, 0xE157, 0xE158, 0x6D7C, 0x6D7B, 0xE159,
0x306F, 0x6D7D, 0, 0, 0x492F, 0, 0x6E27, 0xE15A,
};
-static const unsigned short utf8_to_euc_E981[] = {
+const unsigned short utf8_to_euc_E981[] = {
0, 0x465B, 0x3F6B, 0xE15B, 0xE15C, 0x4359, 0, 0x3678,
0, 0x6E26, 0x4D37, 0x313F, 0xE15D, 0x4A57, 0x3261, 0x6E21,
0x6E22, 0x6E23, 0x6E24, 0x463B, 0x4323, 0x3063, 0x6E28, 0,
@@ -5639,7 +5457,7 @@ static const unsigned short utf8_to_euc_E981[] = {
0xE164, 0, 0x6E2F, 0, 0xE165, 0x3D65, 0x6E2D, 0x412B,
0x412A, 0xE166, 0x3064, 0, 0x4E4B, 0x6E31, 0, 0x4872,
};
-static const unsigned short utf8_to_euc_E982[] = {
+const unsigned short utf8_to_euc_E982[] = {
0x6E33, 0x6E32, 0x6E30, 0x6364, 0x3454, 0xE167, 0, 0x6D6E,
0xE168, 0x6E35, 0x6E34, 0xE169, 0xE16A, 0, 0xE16B, 0x6E36,
0xE16C, 0x4D38, 0, 0, 0, 0xE16D, 0, 0xE16E,
@@ -5649,7 +5467,7 @@ static const unsigned short utf8_to_euc_E982[] = {
0xE176, 0x6E39, 0xE177, 0xE178, 0xE179, 0x6E3A, 0xE17A, 0,
0x4521, 0, 0, 0, 0, 0xE17B, 0xE17D, 0,
};
-static const unsigned short utf8_to_euc_E983[] = {
+const unsigned short utf8_to_euc_E983[] = {
0, 0x306A, 0, 0xE17E, 0xE221, 0xE222, 0, 0xE223,
0xE224, 0, 0x3959, 0, 0xE17C, 0, 0x4F3A, 0,
0, 0, 0xE22D, 0, 0, 0xE225, 0, 0xE226,
@@ -5659,7 +5477,7 @@ static const unsigned short utf8_to_euc_E983[] = {
0xE231, 0, 0, 0, 0xE232, 0x4D39, 0xE22E, 0x363F,
0, 0, 0, 0, 0, 0x4554, 0xE233, 0xE234,
};
-static const unsigned short utf8_to_euc_E984[] = {
+const unsigned short utf8_to_euc_E984[] = {
0xE235, 0, 0x6E3F, 0, 0xE236, 0xE237, 0xE238, 0,
0xE239, 0, 0, 0, 0, 0xE23A, 0, 0,
0xE23B, 0, 0x6E40, 0, 0xE23C, 0xF46E, 0xE23D, 0xE23E,
@@ -5669,7 +5487,7 @@ static const unsigned short utf8_to_euc_E984[] = {
0x6E43, 0xE24B, 0x6E42, 0, 0xE24C, 0, 0xE24D, 0xE24E,
0, 0xE24F, 0xE250, 0, 0xE251, 0xE252, 0, 0,
};
-static const unsigned short utf8_to_euc_E985[] = {
+const unsigned short utf8_to_euc_E985[] = {
0, 0, 0, 0xE253, 0, 0, 0, 0xE254,
0xE255, 0x4653, 0x6E44, 0x3D36, 0x3C60, 0x475B, 0x4371, 0xE256,
0, 0, 0x3C72, 0xE257, 0x3F6C, 0, 0x6E45, 0xE258,
@@ -5679,7 +5497,7 @@ static const unsigned short utf8_to_euc_E985[] = {
0, 0, 0x6E4B, 0x6E4A, 0xE260, 0x395A, 0, 0x3973,
0x3B40, 0xE261, 0xE262, 0xE263, 0, 0, 0, 0,
};
-static const unsigned short utf8_to_euc_E986[] = {
+const unsigned short utf8_to_euc_E986[] = {
0, 0xE264, 0x6E4E, 0xE265, 0, 0xE266, 0xE267, 0x3D66,
0, 0x6E4D, 0xE268, 0x6E4C, 0, 0x4269, 0xE269, 0,
0x386F, 0xE26A, 0x4043, 0xE26B, 0xE26C, 0xE26D, 0, 0x4830,
@@ -5689,7 +5507,7 @@ static const unsigned short utf8_to_euc_E986[] = {
0xE276, 0xE277, 0xE278, 0xE279, 0x6E54, 0x6E53, 0xE27A, 0,
0x3E7A, 0, 0x6E55, 0xE27B, 0xE27C, 0xE27D, 0, 0xE27E,
};
-static const unsigned short utf8_to_euc_E987[] = {
+const unsigned short utf8_to_euc_E987[] = {
0x6E56, 0x6E57, 0xE321, 0xE322, 0, 0xE323, 0x4850, 0x3A53,
0x3C61, 0x6E58, 0, 0x6E59, 0x4E24, 0x3D45, 0x4C6E, 0x4E4C,
0x6E5A, 0x3662, 0, 0xE324, 0xE325, 0, 0x6E5B, 0xE326,
@@ -5699,7 +5517,7 @@ static const unsigned short utf8_to_euc_E987[] = {
0xE332, 0xE333, 0, 0, 0, 0x6E60, 0x6E61, 0xE334,
0, 0xE335, 0, 0xE336, 0x6E5F, 0xE337, 0, 0x6E63,
};
-static const unsigned short utf8_to_euc_E988[] = {
+const unsigned short utf8_to_euc_E988[] = {
0xE338, 0xE339, 0, 0, 0xE33A, 0xE33B, 0xE33C, 0xE33D,
0, 0xE33E, 0xE33F, 0, 0xE340, 0x465F, 0x3343, 0,
0xE341, 0x6E67, 0xE342, 0xE343, 0x6E64, 0x6E66, 0xE344, 0,
@@ -5709,7 +5527,7 @@ static const unsigned short utf8_to_euc_E988[] = {
0xE34F, 0, 0, 0xE350, 0x4E6B, 0xE351, 0xE352, 0x385A,
0xE353, 0xE354, 0xE355, 0, 0xE356, 0, 0xE357, 0x6E6F,
};
-static const unsigned short utf8_to_euc_E989[] = {
+const unsigned short utf8_to_euc_E989[] = {
0xE358, 0, 0xE359, 0xE35A, 0x4534, 0x6E6A, 0xE35B, 0xE35C,
0x6E6D, 0x6E6B, 0xE35D, 0x6E70, 0, 0xE35E, 0xE35F, 0xE360,
0x6E71, 0xE361, 0, 0, 0, 0, 0, 0x6E69,
@@ -5719,7 +5537,7 @@ static const unsigned short utf8_to_euc_E989[] = {
0xE36E, 0x395B, 0, 0, 0, 0xE36F, 0xE370, 0xE371,
0xE372, 0xE373, 0, 0xE374, 0xE375, 0xE376, 0x4B48, 0xE377,
};
-static const unsigned short utf8_to_euc_E98A[] = {
+const unsigned short utf8_to_euc_E98A[] = {
0x3664, 0, 0, 0x3D46, 0, 0x463C, 0, 0,
0xE378, 0xE379, 0xE37A, 0, 0, 0xE37B, 0xE37C, 0,
0, 0x412D, 0xE37D, 0x6E74, 0, 0x6E6E, 0x6E73, 0xE37E,
@@ -5729,7 +5547,7 @@ static const unsigned short utf8_to_euc_E98A[] = {
0, 0, 0xE42A, 0, 0, 0, 0xE42B, 0x6E79,
0xE42C, 0x6E78, 0xE42D, 0xE42E, 0xE42F, 0xE430, 0, 0xE431,
};
-static const unsigned short utf8_to_euc_E98B[] = {
+const unsigned short utf8_to_euc_E98B[] = {
0xE432, 0xE433, 0xE434, 0xE435, 0, 0xE436, 0xE437, 0xE438,
0xE439, 0, 0, 0xE43A, 0xE43B, 0xE43C, 0xE43D, 0x6E77,
0xE43E, 0, 0x4B2F, 0xE43F, 0, 0xE440, 0, 0xE441,
@@ -5739,7 +5557,7 @@ static const unsigned short utf8_to_euc_E98B[] = {
0xE44F, 0, 0x4946, 0x4372, 0, 0, 0, 0,
0x3578, 0xE450, 0x6E7C, 0xE451, 0x395D, 0, 0, 0xE452,
};
-static const unsigned short utf8_to_euc_E98C[] = {
+const unsigned short utf8_to_euc_E98C[] = {
0xE453, 0, 0xE454, 0, 0, 0, 0x3B2C, 0,
0xE455, 0, 0, 0, 0, 0xE456, 0, 0x6E7B,
0x3F6D, 0xE457, 0, 0, 0xE458, 0xE459, 0, 0,
@@ -5749,7 +5567,7 @@ static const unsigned short utf8_to_euc_E98C[] = {
0, 0, 0x4F3F, 0xE464, 0xE465, 0x6F26, 0xE466, 0xE467,
0, 0, 0x6F25, 0x6F27, 0, 0, 0, 0,
};
-static const unsigned short utf8_to_euc_E98D[] = {
+const unsigned short utf8_to_euc_E98D[] = {
0, 0, 0, 0, 0x6E7D, 0, 0, 0xE468,
0xE469, 0xE46A, 0, 0x4669, 0, 0x4555, 0, 0,
0xE46B, 0xE46C, 0xE46D, 0, 0x4457, 0xE46E, 0x6F2C, 0xE46F,
@@ -5759,7 +5577,7 @@ static const unsigned short utf8_to_euc_E98D[] = {
0xE47A, 0xE47B, 0, 0xE47C, 0xE47D, 0x3830, 0xE47E, 0,
0, 0, 0xE521, 0, 0x6F2A, 0xE522, 0x3E61, 0xE523,
};
-static const unsigned short utf8_to_euc_E98E[] = {
+const unsigned short utf8_to_euc_E98E[] = {
0xE524, 0xE525, 0xE526, 0, 0, 0, 0, 0,
0xE527, 0, 0xE528, 0xE529, 0x3379, 0xE52A, 0, 0xE52B,
0, 0, 0xE52C, 0, 0x6F30, 0xE52D, 0x3A3F, 0x4179,
@@ -5769,7 +5587,7 @@ static const unsigned short utf8_to_euc_E98E[] = {
0x6F2D, 0, 0, 0, 0xE537, 0xE538, 0xE539, 0,
0, 0x6F31, 0xE53A, 0, 0, 0, 0, 0,
};
-static const unsigned short utf8_to_euc_E98F[] = {
+const unsigned short utf8_to_euc_E98F[] = {
0, 0xE53C, 0, 0x6F37, 0xE53D, 0xE53E, 0xE53F, 0xE540,
0x6F3A, 0xE541, 0xE542, 0xE543, 0xE544, 0xE545, 0, 0,
0x6F39, 0x452D, 0, 0xE546, 0, 0, 0x6F32, 0x6F33,
@@ -5779,7 +5597,7 @@ static const unsigned short utf8_to_euc_E98F[] = {
0, 0, 0, 0, 0, 0, 0, 0xE54F,
0xE550, 0xE54E, 0xE551, 0xE552, 0, 0xE553, 0, 0,
};
-static const unsigned short utf8_to_euc_E990[] = {
+const unsigned short utf8_to_euc_E990[] = {
0, 0xE554, 0xE555, 0x6F3F, 0xE556, 0, 0, 0x6F40,
0xE557, 0xE558, 0, 0, 0, 0xE559, 0xE55A, 0xE55B,
0x6F41, 0, 0, 0x6F3E, 0x6F3D, 0xE55C, 0xE55D, 0xE55E,
@@ -5789,7 +5607,7 @@ static const unsigned short utf8_to_euc_E990[] = {
0, 0xE562, 0xE563, 0xE564, 0xE565, 0x6F44, 0x6F42, 0,
0x4278, 0, 0x6F46, 0xE566, 0, 0xE568, 0, 0xE567,
};
-static const unsigned short utf8_to_euc_E991[] = {
+const unsigned short utf8_to_euc_E991[] = {
0, 0x6F47, 0, 0xE569, 0x6F49, 0xE56A, 0, 0,
0xE56B, 0, 0xE56C, 0, 0xE56D, 0, 0, 0,
0, 0x3455, 0x6F48, 0x4C7A, 0, 0xE56E, 0, 0,
@@ -5799,7 +5617,7 @@ static const unsigned short utf8_to_euc_E991[] = {
0x6F50, 0xE579, 0xE57A, 0, 0, 0x6F51, 0, 0x6F52,
0, 0, 0, 0, 0x6F55, 0x6F53, 0x6F56, 0x6F58,
};
-static const unsigned short utf8_to_euc_E992[] = {
+const unsigned short utf8_to_euc_E992[] = {
0, 0x6F57, 0, 0xE57C, 0xE57B, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -5809,7 +5627,7 @@ static const unsigned short utf8_to_euc_E992[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
};
-static const unsigned short utf8_to_euc_E995[] = {
+const unsigned short utf8_to_euc_E995[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -5819,7 +5637,7 @@ static const unsigned short utf8_to_euc_E995[] = {
0, 0, 0, 0, 0, 0, 0, 0x4439,
0xE57D, 0xE57E, 0, 0, 0, 0, 0xE621, 0,
};
-static const unsigned short utf8_to_euc_E996[] = {
+const unsigned short utf8_to_euc_E996[] = {
0x4C67, 0, 0x6F59, 0x412E, 0xE622, 0, 0, 0x6F5A,
0xE623, 0x4A44, 0x6F5B, 0x332B, 0xE624, 0xE625, 0xE626, 0x313C,
0, 0x3457, 0xF471, 0x3456, 0x6F5C, 0, 0x6F5D, 0,
@@ -5829,7 +5647,7 @@ static const unsigned short utf8_to_euc_E996[] = {
0, 0, 0x315C, 0, 0xE62F, 0, 0xE630, 0,
0, 0x6F66, 0xE631, 0x6F65, 0x6F64, 0xE632, 0x6F67, 0xE633,
};
-static const unsigned short utf8_to_euc_E997[] = {
+const unsigned short utf8_to_euc_E997[] = {
0, 0, 0, 0x6F6A, 0, 0, 0xE634, 0x3047,
0xE635, 0xE636, 0x6F68, 0xE637, 0x6F6C, 0x6F6B, 0, 0,
0xE638, 0xE639, 0xE63A, 0xE63B, 0x6F6E, 0x6F6D, 0x6F6F, 0,
@@ -5839,7 +5657,7 @@ static const unsigned short utf8_to_euc_E997[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
};
-static const unsigned short utf8_to_euc_E998[] = {
+const unsigned short utf8_to_euc_E998[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -5849,7 +5667,7 @@ static const unsigned short utf8_to_euc_E998[] = {
0, 0xE64B, 0x4B49, 0xE64C, 0, 0, 0, 0xE64D,
0xE64E, 0xE64F, 0xE650, 0x414B, 0xE651, 0xE652, 0, 0x3024,
};
-static const unsigned short utf8_to_euc_E999[] = {
+const unsigned short utf8_to_euc_E999[] = {
0x424B, 0xE653, 0x6F78, 0, 0x496D, 0, 0, 0,
0, 0, 0, 0x6F7B, 0x6F79, 0x395F, 0, 0x6F7A,
0x3842, 0, 0xE654, 0, 0xE655, 0, 0xE656, 0xE657,
@@ -5859,7 +5677,7 @@ static const unsigned short utf8_to_euc_E999[] = {
0x3122, 0, 0x7024, 0x4444, 0xE65B, 0x4E4D, 0x462B, 0x6F7C,
0x4E26, 0, 0x3831, 0xE65C, 0xE65D, 0x4D5B, 0xE65E, 0xE65F,
};
-static const unsigned short utf8_to_euc_E99A[] = {
+const unsigned short utf8_to_euc_E99A[] = {
0, 0xE660, 0xE661, 0xE662, 0xE663, 0x3679, 0x4E34, 0,
0x3728, 0xE664, 0x4262, 0x6721, 0, 0x7026, 0x332C, 0x3F6F,
0, 0xE665, 0, 0, 0x3356, 0x7028, 0xE666, 0x7029,
@@ -5869,7 +5687,7 @@ static const unsigned short utf8_to_euc_E99A[] = {
0x702E, 0x702C, 0x702D, 0xE670, 0x702F, 0, 0x7030, 0x4E6C,
0x7031, 0x7032, 0xE671, 0x4049, 0x483B, 0, 0, 0,
};
-static const unsigned short utf8_to_euc_E99B[] = {
+const unsigned short utf8_to_euc_E99B[] = {
0x3F7D, 0x3467, 0, 0, 0x4D3A, 0x326D, 0x3D38, 0x385B,
0, 0x7035, 0xE672, 0x7034, 0x3B73, 0x7036, 0x7033, 0,
0, 0x3B28, 0xE673, 0, 0, 0x703A, 0x6A2D, 0,
@@ -5879,7 +5697,7 @@ static const unsigned short utf8_to_euc_E99B[] = {
0x4A37, 0xE67C, 0x3140, 0, 0, 0, 0x4E6D, 0x4D6B,
0, 0x703B, 0xE67D, 0x4545, 0, 0, 0, 0,
};
-static const unsigned short utf8_to_euc_E99C[] = {
+const unsigned short utf8_to_euc_E99C[] = {
0x3C7B, 0, 0xE67E, 0xE721, 0x703C, 0xE722, 0x703D, 0x3F4C,
0x703E, 0xE723, 0x4E6E, 0, 0, 0x7039, 0x7040, 0x7042,
0, 0x7041, 0, 0x703F, 0, 0, 0x7043, 0,
@@ -5889,7 +5707,7 @@ static const unsigned short utf8_to_euc_E99C[] = {
0x7047, 0xE72B, 0x4F2A, 0xE72C, 0, 0, 0, 0,
0x5B31, 0x7048, 0, 0xF474, 0, 0x7049, 0x704A, 0,
};
-static const unsigned short utf8_to_euc_E99D[] = {
+const unsigned short utf8_to_euc_E99D[] = {
0, 0xE72D, 0x704E, 0xE72E, 0x704B, 0, 0x704C, 0,
0x704D, 0x704F, 0xE72F, 0, 0, 0xF475, 0xE730, 0xE731,
0, 0xF476, 0x4044, 0, 0, 0xE732, 0x4C77, 0xE733,
@@ -5899,7 +5717,7 @@ static const unsigned short utf8_to_euc_E99D[] = {
0, 0x7057, 0, 0xE73B, 0x3724, 0, 0xE73C, 0xE73D,
0xE73E, 0x7058, 0x705C, 0xE73F, 0x705A, 0xE740, 0, 0xE741,
};
-static const unsigned short utf8_to_euc_E99E[] = {
+const unsigned short utf8_to_euc_E99E[] = {
0xE742, 0x705B, 0, 0, 0x3373, 0x7059, 0x705D, 0,
0, 0xE743, 0, 0x705E, 0, 0x3048, 0, 0x705F,
0x7060, 0, 0, 0, 0, 0xE744, 0xE745, 0xE746,
@@ -5909,7 +5727,7 @@ static const unsigned short utf8_to_euc_E99E[] = {
0, 0xE74E, 0xE74F, 0x7065, 0x7066, 0xE750, 0xE751, 0,
0xE752, 0xE753, 0xE754, 0, 0xE755, 0, 0xE756, 0xE757,
};
-static const unsigned short utf8_to_euc_E99F[] = {
+const unsigned short utf8_to_euc_E99F[] = {
0, 0xE758, 0, 0x7067, 0xE759, 0xE75A, 0x7068, 0xE75B,
0x7069, 0xE75C, 0xE75D, 0x706A, 0xE75E, 0xE75F, 0xE760, 0,
0xE761, 0xE762, 0, 0x345A, 0xE763, 0, 0, 0xE764,
@@ -5919,7 +5737,7 @@ static const unsigned short utf8_to_euc_E99F[] = {
0, 0xE76E, 0x706E, 0x323B, 0xE76F, 0x7071, 0x7070, 0xE770,
0xE771, 0, 0xE772, 0x3124, 0, 0, 0, 0x3641,
};
-static const unsigned short utf8_to_euc_E9A0[] = {
+const unsigned short utf8_to_euc_E9A0[] = {
0, 0x4A47, 0x443A, 0x3A22, 0, 0x3960, 0x3D67, 0xE773,
0x3F5C, 0, 0xE774, 0, 0x7073, 0xE776, 0xE777, 0x7072,
0x4D42, 0x3468, 0x4852, 0x465C, 0xE778, 0, 0xE779, 0x3F7C,
@@ -5929,7 +5747,7 @@ static const unsigned short utf8_to_euc_E9A0[] = {
0xE824, 0, 0xE825, 0xE826, 0x3150, 0xE827, 0, 0x7077,
0x7074, 0, 0, 0x4951, 0x4D6A, 0x7078, 0xE829, 0,
};
-static const unsigned short utf8_to_euc_E9A1[] = {
+const unsigned short utf8_to_euc_E9A1[] = {
0, 0, 0, 0, 0xE82A, 0, 0x7079, 0xE82B,
0, 0, 0xE82C, 0x707B, 0x426A, 0x335B, 0x335C, 0x707A,
0, 0xE82D, 0xE82E, 0xE82F, 0x3469, 0x3832, 0xE830, 0xE831,
@@ -5939,7 +5757,7 @@ static const unsigned short utf8_to_euc_E9A1[] = {
0x707E, 0x7121, 0, 0x7123, 0x7122, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
};
-static const unsigned short utf8_to_euc_E9A2[] = {
+const unsigned short utf8_to_euc_E9A2[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -5949,7 +5767,7 @@ static const unsigned short utf8_to_euc_E9A2[] = {
0xE83D, 0x7126, 0, 0, 0xE83E, 0, 0x7127, 0xE83F,
0xE840, 0, 0xE841, 0xE842, 0, 0, 0, 0xE843,
};
-static const unsigned short utf8_to_euc_E9A3[] = {
+const unsigned short utf8_to_euc_E9A3[] = {
0, 0, 0xE844, 0x7129, 0x7128, 0xE845, 0x712A, 0,
0xE846, 0, 0, 0, 0xE847, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -5959,7 +5777,7 @@ static const unsigned short utf8_to_euc_E9A3[] = {
0, 0, 0x307B, 0xE84E, 0x303B, 0, 0xE84F, 0,
0, 0, 0, 0, 0x3B74, 0x4B30, 0x3E7E, 0,
};
-static const unsigned short utf8_to_euc_E9A4[] = {
+const unsigned short utf8_to_euc_E9A4[] = {
0, 0, 0xE850, 0x712D, 0, 0x4C5F, 0, 0xE851,
0xE852, 0x712E, 0x4D5C, 0, 0x3142, 0, 0, 0,
0x3B41, 0xE853, 0x712F, 0x326E, 0x7130, 0xE854, 0xE855, 0xE856,
@@ -5969,7 +5787,7 @@ static const unsigned short utf8_to_euc_E9A4[] = {
0, 0xE85F, 0xE860, 0xE861, 0xE862, 0xE863, 0, 0,
0, 0xE864, 0xE865, 0xE866, 0xE867, 0x7139, 0x713A, 0,
};
-static const unsigned short utf8_to_euc_E9A5[] = {
+const unsigned short utf8_to_euc_E9A5[] = {
0xE868, 0xE869, 0x713B, 0, 0, 0x713D, 0xE86A, 0xE86B,
0xE86C, 0x713C, 0, 0x713F, 0x7142, 0xE86D, 0xE86E, 0,
0x713E, 0x7140, 0x7141, 0, 0xE86F, 0x7143, 0, 0x3642,
@@ -5979,7 +5797,7 @@ static const unsigned short utf8_to_euc_E9A5[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
};
-static const unsigned short utf8_to_euc_E9A6[] = {
+const unsigned short utf8_to_euc_E9A6[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0x3C73, 0x7144,
@@ -5989,7 +5807,7 @@ static const unsigned short utf8_to_euc_E9A6[] = {
0xE87B, 0xE87C, 0xE87D, 0x435A, 0x466B, 0xE87E, 0, 0,
0, 0xE921, 0xE922, 0, 0x7149, 0xE923, 0, 0xE924,
};
-static const unsigned short utf8_to_euc_E9A7[] = {
+const unsigned short utf8_to_euc_E9A7[] = {
0, 0x477D, 0, 0xE925, 0x424C, 0x3158, 0x366E, 0,
0x366F, 0xE926, 0, 0, 0, 0, 0, 0,
0x4373, 0x714E, 0x3670, 0xE927, 0xE928, 0x326F, 0, 0,
@@ -5999,7 +5817,7 @@ static const unsigned short utf8_to_euc_E9A7[] = {
0xE931, 0x7151, 0x7152, 0, 0xE932, 0xE933, 0, 0,
0x7154, 0xE934, 0, 0x7153, 0, 0xE935, 0xE936, 0x3D59,
};
-static const unsigned short utf8_to_euc_E9A8[] = {
+const unsigned short utf8_to_euc_E9A8[] = {
0, 0x7155, 0xE937, 0xE938, 0xE939, 0x7157, 0, 0,
0, 0, 0, 0xE93A, 0xE93B, 0, 0x3533, 0x7156,
0xE93C, 0xE93D, 0x417B, 0x3833, 0, 0, 0xE93E, 0,
@@ -6009,7 +5827,7 @@ static const unsigned short utf8_to_euc_E9A8[] = {
0x462D, 0, 0, 0xE947, 0, 0xE948, 0xE949, 0x715B,
0xE94A, 0, 0, 0, 0, 0, 0x7160, 0,
};
-static const unsigned short utf8_to_euc_E9A9[] = {
+const unsigned short utf8_to_euc_E9A9[] = {
0x715E, 0xE94C, 0x715D, 0x715F, 0xE94D, 0x715C, 0, 0xE94B,
0, 0, 0xE94E, 0xE94F, 0xE950, 0x7162, 0xE951, 0,
0, 0xE952, 0, 0, 0xE953, 0x7161, 0xE954, 0x7164,
@@ -6019,7 +5837,7 @@ static const unsigned short utf8_to_euc_E9A9[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
};
-static const unsigned short utf8_to_euc_E9AA[] = {
+const unsigned short utf8_to_euc_E9AA[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -6029,7 +5847,7 @@ static const unsigned short utf8_to_euc_E9AA[] = {
0x716D, 0, 0xE95A, 0, 0xE95B, 0xE95C, 0xE95D, 0,
0x333C, 0xE95E, 0, 0xE95F, 0x716E, 0, 0xE960, 0xE961,
};
-static const unsigned short utf8_to_euc_E9AB[] = {
+const unsigned short utf8_to_euc_E9AB[] = {
0x716F, 0xE962, 0, 0xE963, 0x3F71, 0, 0xE964, 0,
0xE965, 0, 0, 0, 0, 0, 0xE966, 0x7170,
0xE967, 0x7171, 0xE968, 0x7172, 0x7173, 0xE969, 0xE96A, 0xE96B,
@@ -6039,7 +5857,7 @@ static const unsigned short utf8_to_euc_E9AB[] = {
0, 0x717D, 0xE974, 0xE975, 0x717C, 0xE976, 0, 0x717E,
0, 0xE977, 0xE978, 0x7221, 0, 0xE979, 0, 0xE97A,
};
-static const unsigned short utf8_to_euc_E9AC[] = {
+const unsigned short utf8_to_euc_E9AC[] = {
0xE97B, 0xE97C, 0xE97D, 0xE97E, 0xEA21, 0xEA22, 0x7222, 0,
0xEA23, 0xEA24, 0, 0xEA25, 0xEA26, 0xEA27, 0xEA28, 0,
0xEA29, 0, 0xEA2A, 0, 0, 0, 0xEA2B, 0,
@@ -6049,7 +5867,7 @@ static const unsigned short utf8_to_euc_E9AC[] = {
0, 0x5D35, 0x722F, 0xEA33, 0xEA34, 0xEA35, 0, 0xEA36,
0, 0xEA37, 0xEA38, 0x6478, 0x3534, 0xEA39, 0, 0,
};
-static const unsigned short utf8_to_euc_E9AD[] = {
+const unsigned short utf8_to_euc_E9AD[] = {
0, 0x3321, 0x3A32, 0x7231, 0x7230, 0x4C25, 0, 0,
0xEA3A, 0, 0, 0xEA3B, 0xEA3C, 0x7233, 0x7234, 0x7232,
0, 0x7235, 0, 0, 0x4B62, 0xEA3D, 0xEA3E, 0xEA3F,
@@ -6059,7 +5877,7 @@ static const unsigned short utf8_to_euc_E9AD[] = {
0, 0, 0xF47C, 0xEA4C, 0x7237, 0xEA4D, 0, 0xEA4E,
0xEA4F, 0xEA50, 0, 0, 0, 0, 0, 0xEA51,
};
-static const unsigned short utf8_to_euc_E9AE[] = {
+const unsigned short utf8_to_euc_E9AE[] = {
0xEA52, 0, 0, 0x7239, 0xEA53, 0xEA54, 0xEA55, 0xEA56,
0, 0xEA57, 0xEA58, 0xEA59, 0, 0xEA5A, 0x303E, 0xEA5B,
0xEA5C, 0x723A, 0x4A2B, 0x7238, 0xEA5D, 0, 0x723B, 0x723C,
@@ -6069,7 +5887,7 @@ static const unsigned short utf8_to_euc_E9AE[] = {
0xEA65, 0xEA66, 0xEA67, 0, 0x7240, 0, 0, 0xEA68,
0xEA69, 0x7243, 0, 0xEA6A, 0xEA6B, 0, 0xEA6C, 0xEA6D,
};
-static const unsigned short utf8_to_euc_E9AF[] = {
+const unsigned short utf8_to_euc_E9AF[] = {
0x7241, 0xEA6E, 0, 0, 0, 0, 0x7244, 0xEA6F,
0xEA70, 0x3871, 0x7242, 0, 0, 0, 0xEA71, 0x7245,
0xEA72, 0x7246, 0x7247, 0, 0x724B, 0, 0x3B2A, 0xEA73,
@@ -6079,7 +5897,7 @@ static const unsigned short utf8_to_euc_E9AF[] = {
0x7250, 0x724F, 0x724E, 0xEA7C, 0, 0x3033, 0, 0xEA7D,
0xEA7E, 0xEB21, 0xEB22, 0, 0, 0xEB23, 0, 0xEB24,
};
-static const unsigned short utf8_to_euc_E9B0[] = {
+const unsigned short utf8_to_euc_E9B0[] = {
0xEB25, 0, 0xEB26, 0, 0x725A, 0, 0x7256, 0,
0x7257, 0x7253, 0x7259, 0xEB27, 0x7255, 0x3362, 0, 0xEB28,
0x4F4C, 0xEB29, 0x7258, 0x7254, 0x7252, 0x7251, 0xEB2A, 0,
@@ -6089,7 +5907,7 @@ static const unsigned short utf8_to_euc_E9B0[] = {
0x7260, 0xEB37, 0x7262, 0, 0, 0xEB38, 0xEB39, 0xEB3A,
0, 0x336F, 0x724D, 0x3137, 0, 0xEB3B, 0x7264, 0,
};
-static const unsigned short utf8_to_euc_E9B1[] = {
+const unsigned short utf8_to_euc_E9B1[] = {
0, 0xEB3C, 0, 0xEB3D, 0xEB3E, 0xEB3F, 0x7263, 0x7261,
0x432D, 0xEB40, 0xEB41, 0, 0, 0, 0xEB42, 0xEB43,
0xEB44, 0, 0x4B70, 0xEB45, 0xEB46, 0, 0xEB47, 0x4E5A,
@@ -6099,7 +5917,7 @@ static const unsigned short utf8_to_euc_E9B1[] = {
0xEB54, 0, 0xEB55, 0, 0, 0xEB56, 0x7268, 0xEB57,
0x7269, 0, 0, 0xEB58, 0, 0, 0, 0,
};
-static const unsigned short utf8_to_euc_E9B3[] = {
+const unsigned short utf8_to_euc_E9B3[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -6109,7 +5927,7 @@ static const unsigned short utf8_to_euc_E9B3[] = {
0x726C, 0, 0xEB5A, 0x4B31, 0x4C44, 0, 0x4650, 0xEB5B,
0, 0xEB5C, 0, 0, 0, 0, 0, 0,
};
-static const unsigned short utf8_to_euc_E9B4[] = {
+const unsigned short utf8_to_euc_E9B4[] = {
0, 0, 0xEB5E, 0x7270, 0, 0, 0x7271, 0x463E,
0x726E, 0x726D, 0, 0xEB5D, 0, 0, 0x322A, 0,
0, 0xEB5F, 0x7279, 0, 0, 0x7278, 0, 0xEB60,
@@ -6119,7 +5937,7 @@ static const unsigned short utf8_to_euc_E9B4[] = {
0xEB66, 0, 0xEB67, 0xEB68, 0xEB69, 0, 0, 0,
0, 0, 0xEB6A, 0x3963, 0xEB6B, 0xEB6D, 0x727C, 0x727B,
};
-static const unsigned short utf8_to_euc_E9B5[] = {
+const unsigned short utf8_to_euc_E9B5[] = {
0, 0x727A, 0xEB6E, 0xEB6F, 0x7277, 0xEB6C, 0x727D, 0xEB70,
0x727E, 0, 0xEB71, 0, 0, 0, 0, 0,
0x7325, 0x7324, 0, 0xEB72, 0xEB73, 0, 0, 0,
@@ -6129,7 +5947,7 @@ static const unsigned short utf8_to_euc_E9B5[] = {
0xEB7B, 0, 0x7327, 0, 0, 0, 0xEB7C, 0xEB7D,
0, 0, 0x732C, 0xEB7E, 0xEC21, 0, 0xEC22, 0,
};
-static const unsigned short utf8_to_euc_E9B6[] = {
+const unsigned short utf8_to_euc_E9B6[] = {
0, 0, 0, 0xEC23, 0xEC24, 0, 0xEC25, 0x7329,
0, 0x7328, 0xEC26, 0, 0, 0xEC27, 0xEC28, 0x375C,
0, 0, 0xEC29, 0xEC2A, 0, 0xEC2B, 0xEC2C, 0xEC2D,
@@ -6139,7 +5957,7 @@ static const unsigned short utf8_to_euc_E9B6[] = {
0, 0xEC33, 0x7330, 0, 0x4461, 0xEC34, 0, 0,
0x7334, 0xEC35, 0x7335, 0x7333, 0xEC36, 0, 0, 0xEC37,
};
-static const unsigned short utf8_to_euc_E9B7[] = {
+const unsigned short utf8_to_euc_E9B7[] = {
0, 0x7332, 0x7338, 0xEC38, 0x7331, 0, 0x7336, 0xEC39,
0, 0xEC3A, 0xEC3B, 0, 0, 0, 0, 0x7337,
0, 0, 0, 0x733A, 0xEC3C, 0xEC3D, 0xEC3E, 0xEC3F,
@@ -6149,7 +5967,7 @@ static const unsigned short utf8_to_euc_E9B7[] = {
0xEC49, 0, 0x4F49, 0xEC4A, 0xEC4B, 0, 0, 0,
0x733B, 0x426B, 0x3A6D, 0, 0, 0x733F, 0xEC4C, 0,
};
-static const unsigned short utf8_to_euc_E9B8[] = {
+const unsigned short utf8_to_euc_E9B8[] = {
0, 0, 0xEC4E, 0, 0, 0, 0, 0xEC4F,
0, 0, 0xEC4D, 0, 0, 0, 0xEC50, 0,
0xEC51, 0xEC52, 0xEC53, 0, 0, 0xEC54, 0xEC55, 0,
@@ -6159,7 +5977,7 @@ static const unsigned short utf8_to_euc_E9B8[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
};
-static const unsigned short utf8_to_euc_E9B9[] = {
+const unsigned short utf8_to_euc_E9B9[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -6169,7 +5987,7 @@ static const unsigned short utf8_to_euc_E9B9[] = {
0, 0, 0, 0, 0, 0x7343, 0, 0,
0x3834, 0x7344, 0xEC59, 0xEC5A, 0xEC5B, 0x7345, 0, 0x3C2F,
};
-static const unsigned short utf8_to_euc_E9BA[] = {
+const unsigned short utf8_to_euc_E9BA[] = {
0xEC5C, 0x7346, 0xEC5D, 0xEC5E, 0xEC5F, 0xEC60, 0, 0xEC61,
0x7347, 0, 0, 0x7348, 0x7349, 0, 0xEC62, 0xEC63,
0, 0x734C, 0x734A, 0x4F3C, 0, 0x734B, 0xEC64, 0x4E6F,
@@ -6179,7 +5997,7 @@ static const unsigned short utf8_to_euc_E9BA[] = {
0xEC6D, 0, 0, 0xEC6E, 0xEC6F, 0xEC70, 0, 0,
0x7350, 0x396D, 0x4C4D, 0x4B63, 0x5677, 0, 0x5D60, 0x4B7B,
};
-static const unsigned short utf8_to_euc_E9BB[] = {
+const unsigned short utf8_to_euc_E9BB[] = {
0, 0, 0, 0, 0x322B, 0, 0xEC71, 0,
0xEC72, 0, 0, 0xEC73, 0x7354, 0x3550, 0x7355, 0x7356,
0x7357, 0xF47E, 0x3975, 0, 0x7358, 0xEC74, 0, 0,
@@ -6189,7 +6007,7 @@ static const unsigned short utf8_to_euc_E9BB[] = {
0xEC7B, 0xEC7C, 0xEC7D, 0, 0x7360, 0xEC7E, 0x7361, 0x7362,
0xED21, 0x7363, 0, 0x7364, 0x7365, 0x7366, 0, 0xED22,
};
-static const unsigned short utf8_to_euc_E9BC[] = {
+const unsigned short utf8_to_euc_E9BC[] = {
0, 0, 0xED23, 0xED24, 0, 0, 0, 0x7367,
0x7368, 0xED25, 0, 0, 0, 0, 0x4524, 0xED26,
0xED27, 0xED28, 0xED29, 0x385D, 0xED2A, 0x736A, 0xED2B, 0xED2C,
@@ -6199,7 +6017,7 @@ static const unsigned short utf8_to_euc_E9BC[] = {
0, 0xED36, 0xED37, 0, 0xED38, 0, 0, 0xED39,
0, 0xED3A, 0xED3B, 0x4921, 0xED3C, 0xED3D, 0x736D, 0xED3E,
};
-static const unsigned short utf8_to_euc_E9BD[] = {
+const unsigned short utf8_to_euc_E9BD[] = {
0, 0xED3F, 0, 0xED40, 0xED41, 0xED42, 0xED43, 0xED44,
0, 0, 0x736E, 0x6337, 0, 0, 0x6C5A, 0x706D,
0, 0, 0x736F, 0xED45, 0x7370, 0xED46, 0xED47, 0xED48,
@@ -6209,7 +6027,7 @@ static const unsigned short utf8_to_euc_E9BD[] = {
0xED52, 0xED53, 0x737A, 0xED54, 0, 0xED55, 0x737B, 0x7379,
0, 0, 0xED56, 0, 0, 0xED57, 0, 0,
};
-static const unsigned short utf8_to_euc_E9BE[] = {
+const unsigned short utf8_to_euc_E9BE[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0x4E36, 0, 0xED58,
0xED59, 0xED5A, 0xED5B, 0, 0xED5C, 0x737C, 0xED5D, 0xED5E,
@@ -6219,7 +6037,7 @@ static const unsigned short utf8_to_euc_E9BE[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
};
-static const unsigned short utf8_to_euc_EFA4[] = {
+const unsigned short utf8_to_euc_EFA4[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -6229,7 +6047,7 @@ static const unsigned short utf8_to_euc_EFA4[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
};
-static const unsigned short utf8_to_euc_EFA7[] = {
+const unsigned short utf8_to_euc_EFA7[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -6239,7 +6057,7 @@ static const unsigned short utf8_to_euc_EFA7[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
};
-static const unsigned short utf8_to_euc_EFA8[] = {
+const unsigned short utf8_to_euc_EFA8[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0xF434, 0xF437,
0xF438, 0xF43D, 0xF444, 0xF447, 0xF448, 0xF44E, 0xF44F, 0xF453,
@@ -6249,7 +6067,7 @@ static const unsigned short utf8_to_euc_EFA8[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
};
-static const unsigned short utf8_to_euc_EFBC[] = {
+const unsigned short utf8_to_euc_EFBC[] = {
0, 0x212A, 0xF42A, 0x2174, 0x2170, 0x2173, 0x2175, 0xF429,
0x214A, 0x214B, 0x2176, 0x215C, 0x2124, 0x215D, 0x2125, 0x213F,
0x2330, 0x2331, 0x2332, 0x2333, 0x2334, 0x2335, 0x2336, 0x2337,
@@ -6259,7 +6077,7 @@ static const unsigned short utf8_to_euc_EFBC[] = {
0x2350, 0x2351, 0x2352, 0x2353, 0x2354, 0x2355, 0x2356, 0x2357,
0x2358, 0x2359, 0x235A, 0x214E, 0x2140, 0x214F, 0x2130, 0x2132,
};
-static const unsigned short utf8_to_euc_EFBD[] = {
+const unsigned short utf8_to_euc_EFBD[] = {
0x212E, 0x2361, 0x2362, 0x2363, 0x2364, 0x2365, 0x2366, 0x2367,
0x2368, 0x2369, 0x236A, 0x236B, 0x236C, 0x236D, 0x236E, 0x236F,
0x2370, 0x2371, 0x2372, 0x2373, 0x2374, 0x2375, 0x2376, 0x2377,
@@ -6269,7 +6087,7 @@ static const unsigned short utf8_to_euc_EFBD[] = {
0x0E30, 0x0E31, 0x0E32, 0x0E33, 0x0E34, 0x0E35, 0x0E36, 0x0E37,
0x0E38, 0x0E39, 0x0E3A, 0x0E3B, 0x0E3C, 0x0E3D, 0x0E3E, 0x0E3F,
};
-static const unsigned short utf8_to_euc_EFBD_ms[] = {
+const unsigned short utf8_to_euc_EFBD_ms[] = {
0x212E, 0x2361, 0x2362, 0x2363, 0x2364, 0x2365, 0x2366, 0x2367,
0x2368, 0x2369, 0x236A, 0x236B, 0x236C, 0x236D, 0x236E, 0x236F,
0x2370, 0x2371, 0x2372, 0x2373, 0x2374, 0x2375, 0x2376, 0x2377,
@@ -6279,7 +6097,7 @@ static const unsigned short utf8_to_euc_EFBD_ms[] = {
0x0E30, 0x0E31, 0x0E32, 0x0E33, 0x0E34, 0x0E35, 0x0E36, 0x0E37,
0x0E38, 0x0E39, 0x0E3A, 0x0E3B, 0x0E3C, 0x0E3D, 0x0E3E, 0x0E3F,
};
-static const unsigned short utf8_to_euc_EFBE[] = {
+const unsigned short utf8_to_euc_EFBE[] = {
0x0E40, 0x0E41, 0x0E42, 0x0E43, 0x0E44, 0x0E45, 0x0E46, 0x0E47,
0x0E48, 0x0E49, 0x0E4A, 0x0E4B, 0x0E4C, 0x0E4D, 0x0E4E, 0x0E4F,
0x0E50, 0x0E51, 0x0E52, 0x0E53, 0x0E54, 0x0E55, 0x0E56, 0x0E57,
@@ -6289,7 +6107,7 @@ static const unsigned short utf8_to_euc_EFBE[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
};
-static const unsigned short utf8_to_euc_EFBF[] = {
+const unsigned short utf8_to_euc_EFBF[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -6299,7 +6117,7 @@ static const unsigned short utf8_to_euc_EFBF[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
};
-static const unsigned short *const utf8_to_euc_E2[] = {
+const unsigned short *const utf8_to_euc_E2[] = {
utf8_to_euc_E280, 0, 0, 0,
utf8_to_euc_E284, utf8_to_euc_E285, utf8_to_euc_E286, utf8_to_euc_E287,
utf8_to_euc_E288, utf8_to_euc_E289, utf8_to_euc_E28A, 0,
@@ -6317,7 +6135,7 @@ static const unsigned short *const utf8_to_euc_E2[] = {
0, 0, 0, 0,
0, 0, 0, 0,
};
-static const unsigned short *const utf8_to_euc_E2_ms[] = {
+const unsigned short *const utf8_to_euc_E2_ms[] = {
utf8_to_euc_E280_ms, 0, 0, 0,
utf8_to_euc_E284, utf8_to_euc_E285, utf8_to_euc_E286, utf8_to_euc_E287,
utf8_to_euc_E288, utf8_to_euc_E289, utf8_to_euc_E28A, 0,
@@ -6335,7 +6153,7 @@ static const unsigned short *const utf8_to_euc_E2_ms[] = {
0, 0, 0, 0,
0, 0, 0, 0,
};
-static const unsigned short *const utf8_to_euc_E2_932[] = {
+const unsigned short *const utf8_to_euc_E2_932[] = {
utf8_to_euc_E280_932, 0, 0, 0,
utf8_to_euc_E284, utf8_to_euc_E285, utf8_to_euc_E286, utf8_to_euc_E287,
utf8_to_euc_E288_932, utf8_to_euc_E289, utf8_to_euc_E28A, 0,
@@ -6353,25 +6171,7 @@ static const unsigned short *const utf8_to_euc_E2_932[] = {
0, 0, 0, 0,
0, 0, 0, 0,
};
-static const unsigned short *const utf8_to_euc_E2_mac[] = {
- utf8_to_euc_E280_932, 0, 0, 0,
- utf8_to_euc_E284_mac, utf8_to_euc_E285_mac, utf8_to_euc_E286, utf8_to_euc_E287,
- utf8_to_euc_E288_mac, utf8_to_euc_E289, utf8_to_euc_E28A_mac, 0,
- utf8_to_euc_E28C, 0, 0, 0,
- 0, utf8_to_euc_E291_mac, 0, 0,
- utf8_to_euc_E294, utf8_to_euc_E295, utf8_to_euc_E296, utf8_to_euc_E297,
- utf8_to_euc_E298, utf8_to_euc_E299, 0, 0,
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- 0, 0, 0, 0,
-};
-static const unsigned short *const utf8_to_euc_E3[] = {
+const unsigned short *const utf8_to_euc_E3[] = {
utf8_to_euc_E380, utf8_to_euc_E381, utf8_to_euc_E382, utf8_to_euc_E383,
0, 0, 0, 0,
utf8_to_euc_E388, 0, utf8_to_euc_E38A, 0,
@@ -6389,7 +6189,7 @@ static const unsigned short *const utf8_to_euc_E3[] = {
0, 0, 0, 0,
0, 0, 0, 0,
};
-static const unsigned short *const utf8_to_euc_E3_932[] = {
+const unsigned short *const utf8_to_euc_E3_932[] = {
utf8_to_euc_E380_932, utf8_to_euc_E381, utf8_to_euc_E382_932, utf8_to_euc_E383,
0, 0, 0, 0,
utf8_to_euc_E388, 0, utf8_to_euc_E38A, 0,
@@ -6407,25 +6207,7 @@ static const unsigned short *const utf8_to_euc_E3_932[] = {
0, 0, 0, 0,
0, 0, 0, 0,
};
-static const unsigned short *const utf8_to_euc_E3_mac[] = {
- utf8_to_euc_E380_932, utf8_to_euc_E381, utf8_to_euc_E382_932, utf8_to_euc_E383,
- 0, 0, 0, 0,
- utf8_to_euc_E388_mac, 0, utf8_to_euc_E38A_mac, 0,
- utf8_to_euc_E38C_mac, utf8_to_euc_E38D_mac, utf8_to_euc_E38E_mac, utf8_to_euc_E38F_mac,
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- 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_E4[] = {
+const unsigned short *const utf8_to_euc_E4[] = {
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
@@ -6443,7 +6225,7 @@ static const unsigned short *const utf8_to_euc_E4[] = {
utf8_to_euc_E4B8, utf8_to_euc_E4B9, utf8_to_euc_E4BA, utf8_to_euc_E4BB,
utf8_to_euc_E4BC, utf8_to_euc_E4BD, utf8_to_euc_E4BE, utf8_to_euc_E4BF,
};
-static const unsigned short *const utf8_to_euc_E5[] = {
+const unsigned short *const utf8_to_euc_E5[] = {
utf8_to_euc_E580, utf8_to_euc_E581, utf8_to_euc_E582, utf8_to_euc_E583,
utf8_to_euc_E584, utf8_to_euc_E585, utf8_to_euc_E586, utf8_to_euc_E587,
utf8_to_euc_E588, utf8_to_euc_E589, utf8_to_euc_E58A, utf8_to_euc_E58B,
@@ -6461,7 +6243,7 @@ static const unsigned short *const utf8_to_euc_E5[] = {
utf8_to_euc_E5B8, utf8_to_euc_E5B9, utf8_to_euc_E5BA, utf8_to_euc_E5BB,
utf8_to_euc_E5BC, utf8_to_euc_E5BD, utf8_to_euc_E5BE, utf8_to_euc_E5BF,
};
-static const unsigned short *const utf8_to_euc_E6[] = {
+const unsigned short *const utf8_to_euc_E6[] = {
utf8_to_euc_E680, utf8_to_euc_E681, utf8_to_euc_E682, utf8_to_euc_E683,
utf8_to_euc_E684, utf8_to_euc_E685, utf8_to_euc_E686, utf8_to_euc_E687,
utf8_to_euc_E688, utf8_to_euc_E689, utf8_to_euc_E68A, utf8_to_euc_E68B,
@@ -6479,7 +6261,7 @@ static const unsigned short *const utf8_to_euc_E6[] = {
utf8_to_euc_E6B8, utf8_to_euc_E6B9, utf8_to_euc_E6BA, utf8_to_euc_E6BB,
utf8_to_euc_E6BC, utf8_to_euc_E6BD, utf8_to_euc_E6BE, utf8_to_euc_E6BF,
};
-static const unsigned short *const utf8_to_euc_E7[] = {
+const unsigned short *const utf8_to_euc_E7[] = {
utf8_to_euc_E780, utf8_to_euc_E781, utf8_to_euc_E782, utf8_to_euc_E783,
utf8_to_euc_E784, utf8_to_euc_E785, utf8_to_euc_E786, utf8_to_euc_E787,
utf8_to_euc_E788, utf8_to_euc_E789, utf8_to_euc_E78A, utf8_to_euc_E78B,
@@ -6497,7 +6279,7 @@ static const unsigned short *const utf8_to_euc_E7[] = {
utf8_to_euc_E7B8, utf8_to_euc_E7B9, utf8_to_euc_E7BA, 0,
utf8_to_euc_E7BC, utf8_to_euc_E7BD, utf8_to_euc_E7BE, utf8_to_euc_E7BF,
};
-static const unsigned short *const utf8_to_euc_E8[] = {
+const unsigned short *const utf8_to_euc_E8[] = {
utf8_to_euc_E880, utf8_to_euc_E881, utf8_to_euc_E882, utf8_to_euc_E883,
utf8_to_euc_E884, utf8_to_euc_E885, utf8_to_euc_E886, utf8_to_euc_E887,
utf8_to_euc_E888, utf8_to_euc_E889, utf8_to_euc_E88A, utf8_to_euc_E88B,
@@ -6515,7 +6297,7 @@ static const unsigned short *const utf8_to_euc_E8[] = {
utf8_to_euc_E8B8, utf8_to_euc_E8B9, utf8_to_euc_E8BA, utf8_to_euc_E8BB,
utf8_to_euc_E8BC, utf8_to_euc_E8BD, utf8_to_euc_E8BE, utf8_to_euc_E8BF,
};
-static const unsigned short *const utf8_to_euc_E9[] = {
+const unsigned short *const utf8_to_euc_E9[] = {
utf8_to_euc_E980, utf8_to_euc_E981, utf8_to_euc_E982, utf8_to_euc_E983,
utf8_to_euc_E984, utf8_to_euc_E985, utf8_to_euc_E986, utf8_to_euc_E987,
utf8_to_euc_E988, utf8_to_euc_E989, utf8_to_euc_E98A, utf8_to_euc_E98B,
@@ -6533,7 +6315,7 @@ static const unsigned short *const utf8_to_euc_E9[] = {
utf8_to_euc_E9B8, utf8_to_euc_E9B9, utf8_to_euc_E9BA, utf8_to_euc_E9BB,
utf8_to_euc_E9BC, utf8_to_euc_E9BD, utf8_to_euc_E9BE, 0,
};
-static const unsigned short *const utf8_to_euc_EF[] = {
+const unsigned short *const utf8_to_euc_EF[] = {
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
@@ -6551,7 +6333,7 @@ static const unsigned short *const utf8_to_euc_EF[] = {
0, 0, 0, 0,
utf8_to_euc_EFBC, utf8_to_euc_EFBD, utf8_to_euc_EFBE, utf8_to_euc_EFBF,
};
-static const unsigned short *const utf8_to_euc_EF_ms[] = {
+const unsigned short *const utf8_to_euc_EF_ms[] = {
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
@@ -6659,36 +6441,6 @@ const unsigned short *const utf8_to_euc_2bytes_932[] = {
0, 0, 0, 0,
0, 0, 0, 0,
};
-const unsigned short *const utf8_to_euc_2bytes_mac[] = {
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- 0, 0, utf8_to_euc_C2_mac, utf8_to_euc_C3,
- utf8_to_euc_C4, utf8_to_euc_C5, 0, utf8_to_euc_C7,
- 0, 0, 0, utf8_to_euc_CB,
- 0, 0, utf8_to_euc_CE, utf8_to_euc_CF,
- utf8_to_euc_D0, utf8_to_euc_D1, 0, 0,
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- 0, 0, 0, 0,
-};
const unsigned short *const *const utf8_to_euc_3bytes[] = {
0, 0, utf8_to_euc_E2, utf8_to_euc_E3,
utf8_to_euc_E4, utf8_to_euc_E5, utf8_to_euc_E6, utf8_to_euc_E7,
@@ -6707,12 +6459,6 @@ const unsigned short *const *const utf8_to_euc_3bytes_932[] = {
utf8_to_euc_E8, utf8_to_euc_E9, 0, 0,
0, 0, 0, utf8_to_euc_EF_ms,
};
-const unsigned short *const *const utf8_to_euc_3bytes_mac[] = {
- 0, 0, utf8_to_euc_E2_mac, utf8_to_euc_E3_mac,
- utf8_to_euc_E4, utf8_to_euc_E5, utf8_to_euc_E6, utf8_to_euc_E7,
- utf8_to_euc_E8, utf8_to_euc_E9, 0, 0,
- 0, 0, 0, utf8_to_euc_EF_ms,
-};
#ifdef UNICODE_NORMALIZATION
@@ -7885,7 +7631,7 @@ const unsigned short shiftjis_x0212[3][189] = {
},
};
-static const unsigned short x0212_shiftjis_A2[] = {
+const unsigned short x0212_shiftjis_A2[] = {
0x819F, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0x8143, 0, 0, 0x8150, 0, 0, 0x8160,
@@ -7899,7 +7645,7 @@ static const unsigned short x0212_shiftjis_A2[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0,
};
-static const unsigned short x0212_shiftjis_B0[] = {
+const unsigned short x0212_shiftjis_B0[] = {
0, 0, 0, 0, 0, 0, 0,
0, 0xFA68, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -7913,7 +7659,7 @@ static const unsigned short x0212_shiftjis_B0[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0,
};
-static const unsigned short x0212_shiftjis_B1[] = {
+const unsigned short x0212_shiftjis_B1[] = {
0, 0, 0xFA70, 0, 0, 0, 0xFA6F,
0, 0xFA72, 0, 0, 0xFA71, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -7927,7 +7673,7 @@ static const unsigned short x0212_shiftjis_B1[] = {
0, 0, 0, 0, 0xFA79, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0,
};
-static const unsigned short x0212_shiftjis_B2[] = {
+const unsigned short x0212_shiftjis_B2[] = {
0, 0, 0xFA7B, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -7941,7 +7687,7 @@ static const unsigned short x0212_shiftjis_B2[] = {
0, 0, 0, 0, 0, 0xFA81, 0, 0,
0, 0, 0, 0, 0xFA82, 0, 0,
};
-static const unsigned short x0212_shiftjis_B3[] = {
+const unsigned short x0212_shiftjis_B3[] = {
0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0xFA84, 0, 0,
@@ -7955,7 +7701,7 @@ static const unsigned short x0212_shiftjis_B3[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0xFA89, 0, 0, 0,
};
-static const unsigned short x0212_shiftjis_B4[] = {
+const unsigned short x0212_shiftjis_B4[] = {
0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -7969,7 +7715,7 @@ static const unsigned short x0212_shiftjis_B4[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0,
};
-static const unsigned short x0212_shiftjis_B5[] = {
+const unsigned short x0212_shiftjis_B5[] = {
0, 0, 0, 0, 0, 0, 0,
0, 0, 0xFA91, 0, 0, 0, 0, 0xFA93,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -7983,7 +7729,7 @@ static const unsigned short x0212_shiftjis_B5[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0,
};
-static const unsigned short x0212_shiftjis_B7[] = {
+const unsigned short x0212_shiftjis_B7[] = {
0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -7997,7 +7743,7 @@ static const unsigned short x0212_shiftjis_B7[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0,
};
-static const unsigned short x0212_shiftjis_B8[] = {
+const unsigned short x0212_shiftjis_B8[] = {
0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -8011,7 +7757,7 @@ static const unsigned short x0212_shiftjis_B8[] = {
0, 0, 0, 0, 0, 0xFAA0, 0, 0xFAA1,
0xFAA2, 0, 0, 0, 0xFAA3, 0, 0,
};
-static const unsigned short x0212_shiftjis_B9[] = {
+const unsigned short x0212_shiftjis_B9[] = {
0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0xFAA4,
0, 0, 0, 0, 0, 0, 0, 0xFAA5,
@@ -8025,7 +7771,7 @@ static const unsigned short x0212_shiftjis_B9[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0,
};
-static const unsigned short x0212_shiftjis_BA[] = {
+const unsigned short x0212_shiftjis_BA[] = {
0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -8039,7 +7785,7 @@ static const unsigned short x0212_shiftjis_BA[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0,
};
-static const unsigned short x0212_shiftjis_BB[] = {
+const unsigned short x0212_shiftjis_BB[] = {
0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0xFAAC, 0, 0, 0, 0,
@@ -8053,7 +7799,7 @@ static const unsigned short x0212_shiftjis_BB[] = {
0, 0, 0, 0, 0xFAB4, 0xFAB5, 0, 0,
0, 0xFAB6, 0, 0, 0, 0, 0,
};
-static const unsigned short x0212_shiftjis_BC[] = {
+const unsigned short x0212_shiftjis_BC[] = {
0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -8067,7 +7813,7 @@ static const unsigned short x0212_shiftjis_BC[] = {
0, 0, 0, 0, 0xFA67, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0xFAB9,
};
-static const unsigned short x0212_shiftjis_BD[] = {
+const unsigned short x0212_shiftjis_BD[] = {
0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -8081,7 +7827,7 @@ static const unsigned short x0212_shiftjis_BD[] = {
0xFABE, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0,
};
-static const unsigned short x0212_shiftjis_BE[] = {
+const unsigned short x0212_shiftjis_BE[] = {
0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0xFAC0, 0, 0, 0,
0xFABF, 0, 0, 0xFAC2, 0, 0, 0, 0,
@@ -8095,7 +7841,7 @@ static const unsigned short x0212_shiftjis_BE[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0,
};
-static const unsigned short x0212_shiftjis_BF[] = {
+const unsigned short x0212_shiftjis_BF[] = {
0, 0, 0, 0, 0, 0, 0,
0xFAC7, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -8109,7 +7855,7 @@ static const unsigned short x0212_shiftjis_BF[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0,
};
-static const unsigned short x0212_shiftjis_C0[] = {
+const unsigned short x0212_shiftjis_C0[] = {
0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -8123,7 +7869,7 @@ static const unsigned short x0212_shiftjis_C0[] = {
0, 0, 0, 0, 0xFACB, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0,
};
-static const unsigned short x0212_shiftjis_C1[] = {
+const unsigned short x0212_shiftjis_C1[] = {
0, 0, 0, 0, 0, 0xFACC, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -8137,7 +7883,7 @@ static const unsigned short x0212_shiftjis_C1[] = {
0, 0, 0, 0, 0, 0xFACE, 0, 0,
0xFAD1, 0, 0, 0, 0xFACF, 0, 0,
};
-static const unsigned short x0212_shiftjis_C2[] = {
+const unsigned short x0212_shiftjis_C2[] = {
0xFAD3, 0, 0, 0, 0xFAD4, 0, 0,
0, 0, 0, 0xFAD2, 0, 0xFA63, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -8151,7 +7897,7 @@ static const unsigned short x0212_shiftjis_C2[] = {
0xFADF, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0,
};
-static const unsigned short x0212_shiftjis_C3[] = {
+const unsigned short x0212_shiftjis_C3[] = {
0xFAE1, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0xFAE2, 0, 0,
@@ -8165,7 +7911,7 @@ static const unsigned short x0212_shiftjis_C3[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0xFA64, 0, 0xFAE7,
};
-static const unsigned short x0212_shiftjis_C4[] = {
+const unsigned short x0212_shiftjis_C4[] = {
0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -8179,7 +7925,7 @@ static const unsigned short x0212_shiftjis_C4[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0xFAED, 0,
};
-static const unsigned short x0212_shiftjis_C5[] = {
+const unsigned short x0212_shiftjis_C5[] = {
0, 0, 0, 0, 0, 0, 0xFAEF,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0xFAF0, 0xFAF1, 0,
@@ -8193,7 +7939,7 @@ static const unsigned short x0212_shiftjis_C5[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0,
};
-static const unsigned short x0212_shiftjis_C6[] = {
+const unsigned short x0212_shiftjis_C6[] = {
0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -8207,7 +7953,7 @@ static const unsigned short x0212_shiftjis_C6[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0,
};
-static const unsigned short x0212_shiftjis_C7[] = {
+const unsigned short x0212_shiftjis_C7[] = {
0xFAF9, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0xFAFA, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -8221,7 +7967,7 @@ static const unsigned short x0212_shiftjis_C7[] = {
0xFB49, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0xFB47, 0, 0,
};
-static const unsigned short x0212_shiftjis_C8[] = {
+const unsigned short x0212_shiftjis_C8[] = {
0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0xFB4A, 0, 0, 0, 0, 0, 0,
@@ -8235,7 +7981,7 @@ static const unsigned short x0212_shiftjis_C8[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0xFB4C, 0, 0, 0, 0, 0, 0,
};
-static const unsigned short x0212_shiftjis_C9[] = {
+const unsigned short x0212_shiftjis_C9[] = {
0, 0, 0, 0, 0, 0xFB4D, 0,
0, 0, 0, 0xFB4E, 0, 0xFB4F, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -8249,7 +7995,7 @@ static const unsigned short x0212_shiftjis_C9[] = {
0, 0, 0, 0, 0xFB56, 0xFB57, 0, 0,
0, 0, 0, 0, 0xFB55, 0, 0,
};
-static const unsigned short x0212_shiftjis_CA[] = {
+const unsigned short x0212_shiftjis_CA[] = {
0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0xFB59, 0, 0, 0, 0,
@@ -8263,7 +8009,7 @@ static const unsigned short x0212_shiftjis_CA[] = {
0, 0xFB5C, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0,
};
-static const unsigned short x0212_shiftjis_CB[] = {
+const unsigned short x0212_shiftjis_CB[] = {
0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0xFB5D, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -8277,7 +8023,7 @@ static const unsigned short x0212_shiftjis_CB[] = {
0xFB62, 0, 0, 0, 0xFB63, 0, 0, 0,
0, 0xFB66, 0, 0, 0, 0, 0,
};
-static const unsigned short x0212_shiftjis_CC[] = {
+const unsigned short x0212_shiftjis_CC[] = {
0, 0, 0, 0, 0xFB65, 0, 0,
0, 0, 0, 0xFB67, 0, 0xFB69, 0xFB68, 0,
0, 0, 0xFB6A, 0, 0, 0, 0, 0,
@@ -8291,7 +8037,7 @@ static const unsigned short x0212_shiftjis_CC[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0,
};
-static const unsigned short x0212_shiftjis_CD[] = {
+const unsigned short x0212_shiftjis_CD[] = {
0, 0, 0, 0, 0, 0, 0,
0, 0, 0xFAA8, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -8305,7 +8051,7 @@ static const unsigned short x0212_shiftjis_CD[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0,
};
-static const unsigned short x0212_shiftjis_CE[] = {
+const unsigned short x0212_shiftjis_CE[] = {
0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -8319,7 +8065,7 @@ static const unsigned short x0212_shiftjis_CE[] = {
0, 0, 0xFB76, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0,
};
-static const unsigned short x0212_shiftjis_CF[] = {
+const unsigned short x0212_shiftjis_CF[] = {
0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -8333,7 +8079,7 @@ static const unsigned short x0212_shiftjis_CF[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0,
};
-static const unsigned short x0212_shiftjis_D0[] = {
+const unsigned short x0212_shiftjis_D0[] = {
0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -8347,7 +8093,7 @@ static const unsigned short x0212_shiftjis_D0[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0,
};
-static const unsigned short x0212_shiftjis_D1[] = {
+const unsigned short x0212_shiftjis_D1[] = {
0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -8361,7 +8107,7 @@ static const unsigned short x0212_shiftjis_D1[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0,
};
-static const unsigned short x0212_shiftjis_D2[] = {
+const unsigned short x0212_shiftjis_D2[] = {
0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -8375,7 +8121,7 @@ static const unsigned short x0212_shiftjis_D2[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0,
};
-static const unsigned short x0212_shiftjis_D3[] = {
+const unsigned short x0212_shiftjis_D3[] = {
0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -8389,7 +8135,7 @@ static const unsigned short x0212_shiftjis_D3[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0,
};
-static const unsigned short x0212_shiftjis_D4[] = {
+const unsigned short x0212_shiftjis_D4[] = {
0, 0, 0, 0, 0, 0, 0xFB8C,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -8403,7 +8149,7 @@ static const unsigned short x0212_shiftjis_D4[] = {
0, 0, 0xFB90, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0,
};
-static const unsigned short x0212_shiftjis_D5[] = {
+const unsigned short x0212_shiftjis_D5[] = {
0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0xFB91, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -8417,7 +8163,7 @@ static const unsigned short x0212_shiftjis_D5[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0,
};
-static const unsigned short x0212_shiftjis_D7[] = {
+const unsigned short x0212_shiftjis_D7[] = {
0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -8431,7 +8177,7 @@ static const unsigned short x0212_shiftjis_D7[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0,
};
-static const unsigned short x0212_shiftjis_D8[] = {
+const unsigned short x0212_shiftjis_D8[] = {
0, 0xFB95, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0xFB96,
@@ -8445,7 +8191,7 @@ static const unsigned short x0212_shiftjis_D8[] = {
0, 0, 0, 0, 0xFB99, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0,
};
-static const unsigned short x0212_shiftjis_D9[] = {
+const unsigned short x0212_shiftjis_D9[] = {
0xFA60, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -8459,7 +8205,7 @@ static const unsigned short x0212_shiftjis_D9[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0,
};
-static const unsigned short x0212_shiftjis_DC[] = {
+const unsigned short x0212_shiftjis_DC[] = {
0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -8473,7 +8219,7 @@ static const unsigned short x0212_shiftjis_DC[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0,
};
-static const unsigned short x0212_shiftjis_DD[] = {
+const unsigned short x0212_shiftjis_DD[] = {
0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -8487,7 +8233,7 @@ static const unsigned short x0212_shiftjis_DD[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0xFBA6, 0, 0, 0, 0,
};
-static const unsigned short x0212_shiftjis_DE[] = {
+const unsigned short x0212_shiftjis_DE[] = {
0, 0, 0, 0xFBA7, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0xFBA8, 0, 0, 0, 0, 0xFBAA, 0, 0,
@@ -8501,7 +8247,7 @@ static const unsigned short x0212_shiftjis_DE[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0,
};
-static const unsigned short x0212_shiftjis_DF[] = {
+const unsigned short x0212_shiftjis_DF[] = {
0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -8515,7 +8261,7 @@ static const unsigned short x0212_shiftjis_DF[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0,
};
-static const unsigned short x0212_shiftjis_E0[] = {
+const unsigned short x0212_shiftjis_E0[] = {
0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -8529,7 +8275,7 @@ static const unsigned short x0212_shiftjis_E0[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0,
};
-static const unsigned short x0212_shiftjis_E1[] = {
+const unsigned short x0212_shiftjis_E1[] = {
0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -8543,7 +8289,7 @@ static const unsigned short x0212_shiftjis_E1[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0,
};
-static const unsigned short x0212_shiftjis_E2[] = {
+const unsigned short x0212_shiftjis_E2[] = {
0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -8557,7 +8303,7 @@ static const unsigned short x0212_shiftjis_E2[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0,
};
-static const unsigned short x0212_shiftjis_E3[] = {
+const unsigned short x0212_shiftjis_E3[] = {
0, 0, 0, 0, 0, 0xFBBB, 0,
0xFBBA, 0xFBBC, 0xFBBF, 0xFBC0, 0, 0, 0, 0xFBBD,
0xFBBE, 0, 0, 0, 0, 0, 0, 0,
@@ -8571,7 +8317,7 @@ static const unsigned short x0212_shiftjis_E3[] = {
0, 0xFBCD, 0xFBCE, 0, 0, 0, 0, 0,
0xFA5F, 0, 0, 0, 0, 0, 0,
};
-static const unsigned short x0212_shiftjis_E4[] = {
+const unsigned short x0212_shiftjis_E4[] = {
0, 0, 0, 0, 0, 0xFBCC, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -8585,7 +8331,7 @@ static const unsigned short x0212_shiftjis_E4[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0xFBDF, 0, 0, 0, 0,
};
-static const unsigned short x0212_shiftjis_E5[] = {
+const unsigned short x0212_shiftjis_E5[] = {
0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0xFBE1, 0, 0, 0, 0,
@@ -8599,7 +8345,7 @@ static const unsigned short x0212_shiftjis_E5[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0,
};
-static const unsigned short x0212_shiftjis_E6[] = {
+const unsigned short x0212_shiftjis_E6[] = {
0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -8613,7 +8359,7 @@ static const unsigned short x0212_shiftjis_E6[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0,
};
-static const unsigned short x0212_shiftjis_E7[] = {
+const unsigned short x0212_shiftjis_E7[] = {
0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0xFBED, 0, 0xFBEF, 0,
0, 0xFBF1, 0xFBF3, 0, 0, 0, 0, 0,
@@ -8627,7 +8373,7 @@ static const unsigned short x0212_shiftjis_E7[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0,
};
-static const unsigned short x0212_shiftjis_E8[] = {
+const unsigned short x0212_shiftjis_E8[] = {
0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0xFBF4, 0, 0, 0, 0, 0xFBF5, 0,
@@ -8641,7 +8387,7 @@ static const unsigned short x0212_shiftjis_E8[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0,
};
-static const unsigned short x0212_shiftjis_E9[] = {
+const unsigned short x0212_shiftjis_E9[] = {
0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -8655,7 +8401,7 @@ static const unsigned short x0212_shiftjis_E9[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0,
};
-static const unsigned short x0212_shiftjis_EA[] = {
+const unsigned short x0212_shiftjis_EA[] = {
0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -8669,7 +8415,7 @@ static const unsigned short x0212_shiftjis_EA[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0,
};
-static const unsigned short x0212_shiftjis_EB[] = {
+const unsigned short x0212_shiftjis_EB[] = {
0, 0, 0, 0, 0xFC46, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -8683,7 +8429,7 @@ static const unsigned short x0212_shiftjis_EB[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0xFC48, 0xFC47, 0, 0, 0,
};
-static const unsigned short x0212_shiftjis_EC[] = {
+const unsigned short x0212_shiftjis_EC[] = {
0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -8697,7 +8443,7 @@ static const unsigned short x0212_shiftjis_EC[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0,
};
-static const unsigned short x0212_shiftjis_F3[] = {
+const unsigned short x0212_shiftjis_F3[] = {
0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -8711,7 +8457,7 @@ static const unsigned short x0212_shiftjis_F3[] = {
0, 0, 0, 0xFA40, 0xFA41, 0xFA42, 0xFA43, 0xFA44,
0xFA45, 0xFA46, 0xFA47, 0xFA48, 0xFA49, 0xFA4A, 0xFA4B,
};
-static const unsigned short x0212_shiftjis_F4[] = {
+const unsigned short x0212_shiftjis_F4[] = {
0xFA4C, 0xFA4D, 0xFA4E, 0xFA4F, 0xFA50, 0xFA51, 0xFA52,
0xFA53, 0xFA56, 0xFA57, 0xFA58, 0xFA59, 0xFA5A, 0xFA62, 0xFA6A,
0xFA7C, 0xFA83, 0xFA8A, 0xFA8B, 0xFA90, 0xFA92, 0xFA96, 0xFA9B,
diff --git a/ext/nkf/nkf-utf8/utf8tbl.h b/ext/nkf/nkf-utf8/utf8tbl.h
index c3d7709ef7..1f40f0b363 100644
--- a/ext/nkf/nkf-utf8/utf8tbl.h
+++ b/ext/nkf/nkf-utf8/utf8tbl.h
@@ -1,55 +1,28 @@
-/*
- * utf8tbl.h - Header file for Convertion Table
- *
- * $Id$
- */
-
#ifndef _UTF8TBL_H_
#define _UTF8TBL_H_
#ifdef UTF8_OUTPUT_ENABLE
-#define sizeof_euc_to_utf8_1byte 94
-#define sizeof_euc_to_utf8_2bytes 94
extern const unsigned short euc_to_utf8_1byte[];
extern const unsigned short *const euc_to_utf8_2bytes[];
extern const unsigned short *const euc_to_utf8_2bytes_ms[];
-extern const unsigned short *const euc_to_utf8_2bytes_mac[];
extern const unsigned short *const x0212_to_utf8_2bytes[];
#endif /* UTF8_OUTPUT_ENABLE */
#ifdef UTF8_INPUT_ENABLE
-#define sizeof_utf8_to_euc_C2 64
-#define sizeof_utf8_to_euc_E5B8 64
-#define sizeof_utf8_to_euc_2bytes 112
-#define sizeof_utf8_to_euc_3bytes 16
extern const unsigned short *const utf8_to_euc_2bytes[];
extern const unsigned short *const utf8_to_euc_2bytes_ms[];
extern const unsigned short *const utf8_to_euc_2bytes_932[];
-extern const unsigned short *const utf8_to_euc_2bytes_mac[];
extern const unsigned short *const *const utf8_to_euc_3bytes[];
extern const unsigned short *const *const utf8_to_euc_3bytes_ms[];
extern const unsigned short *const *const utf8_to_euc_3bytes_932[];
-extern const unsigned short *const *const utf8_to_euc_3bytes_mac[];
#endif /* UTF8_INPUT_ENABLE */
#ifdef UNICODE_NORMALIZATION
-
-#define NORMALIZATION_TABLE_LENGTH 942
-#define NORMALIZATION_TABLE_NFC_LENGTH 3
-#define NORMALIZATION_TABLE_NFD_LENGTH 9
-struct normalization_pair {
- const unsigned char nfc[NORMALIZATION_TABLE_NFC_LENGTH];
- const unsigned char nfd[NORMALIZATION_TABLE_NFD_LENGTH];
-};
extern const struct normalization_pair normalization_table[];
#endif
#ifdef SHIFTJIS_CP932
-#define CP932_TABLE_BEGIN 0xFA
-#define CP932_TABLE_END 0xFC
extern const unsigned short shiftjis_cp932[3][189];
-#define CP932INV_TABLE_BEGIN 0xED
-#define CP932INV_TABLE_END 0xEE
extern const unsigned short cp932inv[2][189];
#endif /* SHIFTJIS_CP932 */
diff --git a/ext/nkf/nkf.c b/ext/nkf/nkf.c
index 82327bf356..2bb0340a64 100644
--- a/ext/nkf/nkf.c
+++ b/ext/nkf/nkf.c
@@ -10,8 +10,24 @@
#define RUBY_NKF_REVISION "$Revision$"
#define RUBY_NKF_VERSION NKF_VERSION " (" NKF_RELEASE_DATE ")"
-#include "ruby/ruby.h"
-#include "ruby/encoding.h"
+#include "ruby.h"
+
+/* Encoding Constants */
+#define _AUTO 0
+#define _JIS 1
+#define _EUC 2
+#define _SJIS 3
+#define _BINARY 4
+#define _NOCONV 4
+#define _ASCII 5
+/* 0b011x is reserved for UTF-8 Family */
+#define _UTF8 6
+/* 0b10xx is reserved for UTF-16 Family */
+#define _UTF16 8
+/* 0b11xx is reserved for UTF-32 Family */
+#define _UTF32 12
+#define _OTHER 16
+#define _UNKNOWN _AUTO
/* Replace nkf's getchar/putchar for variable modification */
/* we never use getc, ungetc */
@@ -40,13 +56,14 @@ static int incsize;
static VALUE result;
static int
-rb_nkf_putchar(unsigned int c)
+rb_nkf_putchar(c)
+ unsigned int c;
{
if (output_ctr >= o_len) {
o_len += incsize;
rb_str_resize(result, o_len);
incsize *= 2;
- output = (unsigned char *)RSTRING_PTR(result);
+ output = (unsigned char *)RSTRING(result)->ptr;
}
output[output_ctr++] = c;
@@ -61,23 +78,11 @@ rb_nkf_putchar(unsigned int c)
#include "nkf-utf8/utf8tbl.c"
#include "nkf-utf8/nkf.c"
-rb_encoding* rb_nkf_enc_get(const char *name)
-{
- int idx = rb_enc_find_index(name);
- if (idx < 0) {
- nkf_encoding *nkf_enc = nkf_enc_find(name);
- idx = rb_enc_find_index(nkf_enc_name(nkf_enc_to_base_encoding(nkf_enc)));
- if (idx < 0) {
- idx = rb_define_dummy_encoding(name);
- }
- }
- return rb_enc_from_index(idx);
-}
-
-int nkf_split_options(const char *arg)
+int nkf_split_options(arg)
+ const char* arg;
{
int count = 0;
- unsigned char option[256];
+ char option[256];
int i = 0, j = 0;
int is_escaped = FALSE;
int is_single_quoted = FALSE;
@@ -123,82 +128,235 @@ int nkf_split_options(const char *arg)
/*
* call-seq:
- * NKF.nkf(opt, str) => string
+ * NKF.nkf(opt, str) -> string
*
* Convert _str_ and return converted result.
* Conversion details are specified by _opt_ as String.
*
* require 'nkf'
* output = NKF.nkf("-s", input)
+ *
+ * *Note*
+ * By default, nkf decodes MIME encoded string.
+ * If you want not to decode input, use NKF.nkf with <b>-m0</b> flag.
*/
static VALUE
-rb_nkf_convert(VALUE obj, VALUE opt, VALUE src)
+rb_nkf_kconv(obj, opt, src)
+ VALUE obj, opt, src;
{
- volatile VALUE tmp;
- reinit();
- 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)) {
- case UTF_8_BOM: output_encoding = nkf_enc_from_index(UTF_8); break;
- case UTF_16BE_BOM: output_encoding = nkf_enc_from_index(UTF_16BE); break;
- case UTF_16LE_BOM: output_encoding = nkf_enc_from_index(UTF_16LE); break;
- case UTF_32BE_BOM: output_encoding = nkf_enc_from_index(UTF_32BE); break;
- case UTF_32LE_BOM: output_encoding = nkf_enc_from_index(UTF_32LE); break;
- }
- output_bom_f = FALSE;
-
- incsize = INCSIZE;
-
- input_ctr = 0;
- StringValue(src);
- input = (unsigned char *)RSTRING_PTR(src);
- i_len = RSTRING_LEN(src);
- tmp = result = rb_str_new(0, i_len*3 + 10);
-
- output_ctr = 0;
- output = (unsigned char *)RSTRING_PTR(result);
- o_len = RSTRING_LEN(result);
- *output = '\0';
+ char *opt_ptr, *opt_end;
+ volatile VALUE v;
+
+ reinit();
+ StringValue(opt);
+ opt_ptr = RSTRING(opt)->ptr;
+ opt_end = opt_ptr + RSTRING(opt)->len;
+ nkf_split_options(opt_ptr);
+
+ incsize = INCSIZE;
+
+ input_ctr = 0;
+ StringValue(src);
+ input = (unsigned char *)RSTRING(src)->ptr;
+ i_len = RSTRING(src)->len;
+ result = rb_str_new(0, i_len*3 + 10);
+ v = result;
+
+ output_ctr = 0;
+ output = (unsigned char *)RSTRING(result)->ptr;
+ o_len = RSTRING(result)->len;
+ *output = '\0';
+
+ if(x0201_f == WISH_TRUE)
+ x0201_f = ((!iso2022jp_f)? TRUE : NO_X0201);
+
+ kanji_convert(NULL);
+ RSTRING(result)->ptr[output_ctr] = '\0';
+ RSTRING(result)->len = output_ctr;
+ OBJ_INFECT(result, src);
+
+ return result;
+}
- kanji_convert(NULL);
- rb_str_set_len(result, output_ctr);
- OBJ_INFECT(result, src);
- if (mimeout_f)
- rb_enc_associate(result, rb_usascii_encoding());
- else
- rb_enc_associate(result, rb_nkf_enc_get(nkf_enc_name(output_encoding)));
+/*
+ * call-seq:
+ * NKF.guess1(str) -> integer
+ *
+ * Returns guessed encoding of _str_ as integer.
+ *
+ * Algorithm described in:
+ * Ken Lunde. `Understanding Japanese Information Processing'
+ * Sebastopol, CA: O'Reilly & Associates.
+ *
+ * case NKF.guess1(input)
+ * when NKF::JIS
+ * "ISO-2022-JP"
+ * when NKF::SJIS
+ * "Shift_JIS"
+ * when NKF::EUC
+ * "EUC-JP"
+ * when NKF::UNKNOWN
+ * "UNKNOWN(ASCII)"
+ * when NKF::BINARY
+ * "BINARY"
+ * end
+ */
- return result;
+static VALUE
+rb_nkf_guess1(obj, src)
+ VALUE obj, src;
+{
+ unsigned char *p;
+ unsigned char *pend;
+ int sequence_counter = 0;
+
+ StringValue(src);
+ p = (unsigned char *)RSTRING(src)->ptr;
+ pend = p + RSTRING(src)->len;
+ if (p == pend) return INT2FIX(_UNKNOWN);
+
+#define INCR do {\
+ p++;\
+ if (p==pend) return INT2FIX(_UNKNOWN);\
+ sequence_counter++;\
+ if (sequence_counter % 2 == 1 && *p != 0xa4)\
+ sequence_counter = 0;\
+ if (6 <= sequence_counter) {\
+ sequence_counter = 0;\
+ return INT2FIX(_EUC);\
+ }\
+ } while (0)
+
+ if (*p == 0xa4)
+ sequence_counter = 1;
+
+ while (p<pend) {
+ if (*p == '\033') {
+ return INT2FIX(_JIS);
+ }
+ if (*p < '\006' || *p == 0x7f || *p == 0xff) {
+ return INT2FIX(_BINARY);
+ }
+ if (0x81 <= *p && *p <= 0x8d) {
+ return INT2FIX(_SJIS);
+ }
+ if (0x8f <= *p && *p <= 0x9f) {
+ return INT2FIX(_SJIS);
+ }
+ if (*p == 0x8e) { /* SS2 */
+ INCR;
+ if ((0x40 <= *p && *p <= 0x7e) ||
+ (0x80 <= *p && *p <= 0xa0) ||
+ (0xe0 <= *p && *p <= 0xfc))
+ return INT2FIX(_SJIS);
+ }
+ else if (0xa1 <= *p && *p <= 0xdf) {
+ INCR;
+ if (0xf0 <= *p && *p <= 0xfe)
+ return INT2FIX(_EUC);
+ if (0xe0 <= *p && *p <= 0xef) {
+ while (p < pend && *p >= 0x40) {
+ if (*p >= 0x81) {
+ if (*p <= 0x8d || (0x8f <= *p && *p <= 0x9f)) {
+ return INT2FIX(_SJIS);
+ }
+ else if (0xfd <= *p && *p <= 0xfe) {
+ return INT2FIX(_EUC);
+ }
+ }
+ INCR;
+ }
+ }
+ else if (*p <= 0x9f) {
+ return INT2FIX(_SJIS);
+ }
+ }
+ else if (0xf0 <= *p && *p <= 0xfe) {
+ return INT2FIX(_EUC);
+ }
+ else if (0xe0 <= *p && *p <= 0xef) {
+ INCR;
+ if ((0x40 <= *p && *p <= 0x7e) ||
+ (0x80 <= *p && *p <= 0xa0)) {
+ return INT2FIX(_SJIS);
+ }
+ if (0xfd <= *p && *p <= 0xfe) {
+ return INT2FIX(_EUC);
+ }
+ }
+ INCR;
+ }
+ return INT2FIX(_UNKNOWN);
}
/*
* call-seq:
- * NKF.guess(str) => encoding
- *
- * Returns guessed encoding of _str_ by nkf routine.
- *
+ * NKF.guess2(str) -> integer
+ *
+ * Returns guessed encoding of _str_ as integer by nkf routine.
+ *
+ * case NKF.guess(input)
+ * when NKF::ASCII
+ * "ASCII"
+ * when NKF::JIS
+ * "ISO-2022-JP"
+ * when NKF::SJIS
+ * "Shift_JIS"
+ * when NKF::EUC
+ * "EUC-JP"
+ * when NKF::UTF8
+ * "UTF-8"
+ * when NKF::UTF16
+ * "UTF-16"
+ * when NKF::UNKNOWN
+ * "UNKNOWN"
+ * when NKF::BINARY
+ * "BINARY"
+ * end
*/
static VALUE
-rb_nkf_guess(VALUE obj, VALUE src)
+rb_nkf_guess2(obj, src)
+ VALUE obj, src;
{
- reinit();
-
- input_ctr = 0;
- StringValue(src);
- input = (unsigned char *)RSTRING_PTR(src);
- i_len = RSTRING_LEN(src);
-
- guess_f = TRUE;
- kanji_convert( NULL );
- guess_f = FALSE;
+ int code = _BINARY;
+
+ reinit();
+
+ input_ctr = 0;
+ StringValue(src);
+ input = (unsigned char *)RSTRING(src)->ptr;
+ i_len = RSTRING(src)->len;
+
+ if(x0201_f == WISH_TRUE)
+ x0201_f = ((!iso2022jp_f)? TRUE : NO_X0201);
+
+ guess_f = TRUE;
+ kanji_convert( NULL );
+ guess_f = FALSE;
+
+ if (!is_inputcode_mixed) {
+ if (strcmp(input_codename, "") == 0) {
+ code = _ASCII;
+ } else if (strcmp(input_codename, "ISO-2022-JP") == 0) {
+ code = _JIS;
+ } else if (strcmp(input_codename, "EUC-JP") == 0) {
+ code = _EUC;
+ } else if (strcmp(input_codename, "Shift_JIS") == 0) {
+ code = _SJIS;
+ } else if (strcmp(input_codename, "UTF-8") == 0) {
+ code = _UTF8;
+ } else if (strcmp(input_codename, "UTF-16") == 0) {
+ code = _UTF16;
+ } else if (strlen(input_codename) > 0) {
+ code = _UNKNOWN;
+ }
+ }
- return rb_enc_from_encoding(rb_nkf_enc_get(get_guessed_code()));
+ return INT2FIX( code );
}
@@ -207,8 +365,8 @@ rb_nkf_guess(VALUE obj, VALUE src)
*
* == Description
*
- * This is a Ruby Extension version of nkf (Network Kanji Filter).
- * It converts the first argument and returns converted result. Conversion
+ * This is a Ruby Extension version of nkf (Netowrk Kanji Filter).
+ * It converts the first argument and return converted result. Conversion
* details are specified by flags as the first argument.
*
* *Nkf* is a yet another kanji code converter among networks, hosts and terminals.
@@ -230,16 +388,16 @@ rb_nkf_guess(VALUE obj, VALUE src)
*
* Output is buffered (DEFAULT), Output is unbuffered.
*
- * === -j -s -e -w -w16 -w32
+ * === -j -s -e -w -w16
*
* Output code is ISO-2022-JP (7bit JIS), Shift_JIS, EUC-JP,
- * UTF-8N, UTF-16BE, UTF-32BE.
+ * UTF-8N, UTF-16BE.
* Without this option and compile option, ISO-2022-JP is assumed.
*
- * === -J -S -E -W -W16 -W32
+ * === -J -S -E -W -W16
*
* Input assumption is JIS 7 bit, Shift_JIS, EUC-JP,
- * UTF-8, UTF-16, UTF-32.
+ * UTF-8, UTF-16LE.
*
* ==== -J
*
@@ -404,7 +562,7 @@ rb_nkf_guess(VALUE obj, VALUE src)
*
* [Shift_JIS] SJIS, MS-Kanji
*
- * [Windows-31J] a.k.a. CP932
+ * [CP932] a.k.a. Windows-31J
*
* [UTF-8] same as UTF-8N
*
@@ -422,16 +580,6 @@ rb_nkf_guess(VALUE obj, VALUE src)
*
* [UTF-16LE-BOM] UTF-16 Little Endian with BOM
*
- * [UTF-32] same as UTF-32BE
- *
- * [UTF-32BE] UTF-32 Big Endian without BOM
- *
- * [UTF-32BE-BOM] UTF-32 Big Endian with BOM
- *
- * [UTF-32LE] UTF-32 Little Endian without BOM
- *
- * [UTF-32LE-BOM] UTF-32 Little Endian with BOM
- *
* [UTF8-MAC] NKDed UTF-8, a.k.a. UTF8-NFD (input only)
*
* === --fb-{skip, html, xml, perl, java, subchar}
@@ -445,20 +593,10 @@ rb_nkf_guess(VALUE obj, VALUE src)
* nkf adds a specified escape character to specified 2nd byte of Shift_JIS characters.
* 1st byte of argument is the escape character and following bytes are target characters.
*
- * === --no-cp932ext
+ * === --disable-cp932ext
*
* Handle the characters extended in CP932 as unassigned characters.
*
- * == --no-best-fit-chars
- *
- * When Unicode to Encoded byte conversion,
- * don't convert characters which is not round trip safe.
- * When Unicode to Unicode conversion,
- * with this and -x option, nkf can be used as UTF converter.
- * (In other words, without this and -x option, nkf doesn't save some characters)
- *
- * When nkf convert string which related to path, you should use this opion.
- *
* === --cap-input
*
* Decode hex encoded characters.
@@ -475,28 +613,42 @@ rb_nkf_guess(VALUE obj, VALUE src)
void
Init_nkf()
{
- VALUE mNKF = rb_define_module("NKF");
-
- rb_define_module_function(mNKF, "nkf", rb_nkf_convert, 2);
- rb_define_module_function(mNKF, "guess", rb_nkf_guess, 1);
- rb_define_alias(rb_singleton_class(mNKF), "guess", "guess");
-
- rb_define_const(mNKF, "AUTO", Qnil);
- rb_define_const(mNKF, "NOCONV", Qnil);
- rb_define_const(mNKF, "UNKNOWN", Qnil);
- rb_define_const(mNKF, "BINARY", rb_enc_from_encoding(rb_nkf_enc_get("BINARY")));
- rb_define_const(mNKF, "ASCII", rb_enc_from_encoding(rb_nkf_enc_get("US-ASCII")));
- rb_define_const(mNKF, "JIS", rb_enc_from_encoding(rb_nkf_enc_get("ISO-2022-JP")));
- rb_define_const(mNKF, "EUC", rb_enc_from_encoding(rb_nkf_enc_get("EUC-JP")));
- rb_define_const(mNKF, "SJIS", rb_enc_from_encoding(rb_nkf_enc_get("Shift_JIS")));
- rb_define_const(mNKF, "UTF8", rb_enc_from_encoding(rb_utf8_encoding()));
- rb_define_const(mNKF, "UTF16", rb_enc_from_encoding(rb_nkf_enc_get("UTF-16BE")));
- rb_define_const(mNKF, "UTF32", rb_enc_from_encoding(rb_nkf_enc_get("UTF-32BE")));
-
+ /* hoge */
+ VALUE mKconv = rb_define_module("NKF");
+ /* hoge */
+
+ rb_define_module_function(mKconv, "nkf", rb_nkf_kconv, 2);
+ rb_define_module_function(mKconv, "guess1", rb_nkf_guess1, 1);
+ rb_define_module_function(mKconv, "guess2", rb_nkf_guess2, 1);
+ rb_define_alias(mKconv, "guess", "guess2");
+ rb_define_alias(rb_singleton_class(mKconv), "guess", "guess2");
+
+ /* Auto-Detect */
+ rb_define_const(mKconv, "AUTO", INT2FIX(_AUTO));
+ /* ISO-2022-JP */
+ rb_define_const(mKconv, "JIS", INT2FIX(_JIS));
+ /* EUC-JP */
+ rb_define_const(mKconv, "EUC", INT2FIX(_EUC));
+ /* Shift_JIS */
+ rb_define_const(mKconv, "SJIS", INT2FIX(_SJIS));
+ /* BINARY */
+ rb_define_const(mKconv, "BINARY", INT2FIX(_BINARY));
+ /* No conversion */
+ rb_define_const(mKconv, "NOCONV", INT2FIX(_NOCONV));
+ /* ASCII */
+ rb_define_const(mKconv, "ASCII", INT2FIX(_ASCII));
+ /* UTF-8 */
+ rb_define_const(mKconv, "UTF8", INT2FIX(_UTF8));
+ /* UTF-16 */
+ rb_define_const(mKconv, "UTF16", INT2FIX(_UTF16));
+ /* UTF-32 */
+ rb_define_const(mKconv, "UTF32", INT2FIX(_UTF32));
+ /* UNKNOWN */
+ rb_define_const(mKconv, "UNKNOWN", INT2FIX(_UNKNOWN));
/* Full version string of nkf */
- rb_define_const(mNKF, "VERSION", rb_str_new2(RUBY_NKF_VERSION));
+ rb_define_const(mKconv, "VERSION", rb_str_new2(RUBY_NKF_VERSION));
/* Version of nkf */
- rb_define_const(mNKF, "NKF_VERSION", rb_str_new2(NKF_VERSION));
+ rb_define_const(mKconv, "NKF_VERSION", rb_str_new2(NKF_VERSION));
/* Release date of nkf */
- rb_define_const(mNKF, "NKF_RELEASE_DATE", rb_str_new2(NKF_RELEASE_DATE));
+ rb_define_const(mKconv, "NKF_RELEASE_DATE", rb_str_new2(NKF_RELEASE_DATE));
}
diff --git a/ext/objspace/extconf.rb b/ext/objspace/extconf.rb
deleted file mode 100644
index a0cc3cecce..0000000000
--- a/ext/objspace/extconf.rb
+++ /dev/null
@@ -1,2 +0,0 @@
-
-create_makefile('objspace')
diff --git a/ext/objspace/objspace.c b/ext/objspace/objspace.c
deleted file mode 100644
index 68c6086fa0..0000000000
--- a/ext/objspace/objspace.c
+++ /dev/null
@@ -1,552 +0,0 @@
-/**********************************************************************
-
- objspace.c - ObjectSpace extender for MRI.
-
- $Author$
- created at: Wed Jun 17 07:39:17 2009
-
- NOTE: This extension library is not expected to exist except C Ruby.
-
- All the files in this distribution are covered under the Ruby's
- license (see the file COPYING).
-
-**********************************************************************/
-
-/* objspace library extends ObjectSpace module and add several
- * methods to get internal statistic information about
- * object/memory management.
- *
- * Generally, you *SHOULD NOT*use this library if you do not know
- * about the MRI implementation. Mainly, this library is for (memory)
- * profiler developers and MRI developers who need to know how MRI
- * memory usage.
- *
- */
-
-#include <ruby/ruby.h>
-#include <ruby/st.h>
-#include <ruby/io.h>
-#include <ruby/re.h>
-#include <../../node.h>
-
-size_t rb_str_memsize(VALUE);
-size_t rb_ary_memsize(VALUE);
-size_t st_memsize(st_table *);
-size_t rb_io_memsize(rb_io_t *);
-size_t onig_memsize(regex_t *);
-size_t rb_generic_ivar_memsize(VALUE);
-size_t rb_objspace_data_type_memsize(VALUE obj);
-
-void rb_objspace_each_objects(
- int (*callback)(void *start, void *end, size_t stride, void *data),
- void *data);
-
-static size_t
-memsize_of(VALUE obj)
-{
- size_t size = 0;
-
- if (SPECIAL_CONST_P(obj)) {
- return 0;
- }
-
- if (FL_TEST(obj, FL_EXIVAR)) {
- size += rb_generic_ivar_memsize(obj);
- }
-
- switch (BUILTIN_TYPE(obj)) {
- case T_OBJECT:
- if (!(RBASIC(obj)->flags & ROBJECT_EMBED) &&
- ROBJECT(obj)->as.heap.ivptr) {
- size += ROBJECT(obj)->as.heap.numiv * sizeof(VALUE);
- }
- break;
- case T_MODULE:
- case T_CLASS:
- size += st_memsize(RCLASS_M_TBL(obj));
- if (RCLASS_IV_TBL(obj)) {
- size += st_memsize(RCLASS_IV_TBL(obj));
- }
- if (RCLASS_IV_INDEX_TBL(obj)) {
- size += st_memsize(RCLASS_IV_INDEX_TBL(obj));
- }
- if (RCLASS(obj)->ptr->iv_tbl) {
- size += st_memsize(RCLASS(obj)->ptr->iv_tbl);
- }
- size += sizeof(rb_classext_t);
- break;
- case T_STRING:
- size += rb_str_memsize(obj);
- break;
- case T_ARRAY:
- size += rb_ary_memsize(obj);
- break;
- case T_HASH:
- if (RHASH(obj)->ntbl) {
- size += st_memsize(RHASH(obj)->ntbl);
- }
- break;
- case T_REGEXP:
- if (RREGEXP(obj)->ptr) {
- size += onig_memsize(RREGEXP(obj)->ptr);
- }
- break;
- case T_DATA:
- size += rb_objspace_data_type_memsize(obj);
- break;
- case T_MATCH:
- if (RMATCH(obj)->rmatch) {
- struct rmatch *rm = RMATCH(obj)->rmatch;
- size += sizeof(struct re_registers); /* TODO: onig_region_memsize(&rm->regs); */
- size += sizeof(struct rmatch_offset) * rm->char_offset_num_allocated;
- size += sizeof(struct rmatch);
- }
- break;
- case T_FILE:
- if (RFILE(obj)->fptr) {
- size += rb_io_memsize(RFILE(obj)->fptr);
- }
- break;
- case T_RATIONAL:
- case T_COMPLEX:
- break;
- case T_ICLASS:
- /* iClass shares table with the module */
- break;
-
- case T_FLOAT:
- break;
-
- case T_BIGNUM:
- if (!(RBASIC(obj)->flags & RBIGNUM_EMBED_FLAG) && RBIGNUM_DIGITS(obj)) {
- size += RBIGNUM_LEN(obj) * sizeof(BDIGIT);
- }
- break;
- case T_NODE:
- switch (nd_type(obj)) {
- case NODE_SCOPE:
- if (RNODE(obj)->u1.tbl) {
- /* TODO: xfree(RANY(obj)->as.node.u1.tbl); */
- }
- break;
- case NODE_ALLOCA:
- /* TODO: xfree(RANY(obj)->as.node.u1.node); */
- ;
- }
- break; /* no need to free iv_tbl */
-
- case T_STRUCT:
- if ((RBASIC(obj)->flags & RSTRUCT_EMBED_LEN_MASK) == 0 &&
- RSTRUCT(obj)->as.heap.ptr) {
- size += sizeof(VALUE) * RSTRUCT_LEN(obj);
- }
- break;
-
- default:
- rb_bug("objspace/memsize_of(): unknown data type 0x%x(%p)",
- BUILTIN_TYPE(obj), (void*)obj);
- }
-
- return size;
-}
-
-/*
- * call-seq:
- * ObjectSpace.memsize_of(obj) -> Integer
- *
- * Return consuming memory size of obj.
- *
- * Note that this information is incomplete. You need to deal with
- * this information as only a *HINT*. Especaially, the size of
- * T_DATA may not right size.
- *
- * This method is not expected to work except C Ruby.
- */
-
-static VALUE
-memsize_of_m(VALUE self, VALUE obj)
-{
- return SIZET2NUM(memsize_of(obj));
-}
-
-static int
-set_zero_i(st_data_t key, st_data_t val, st_data_t arg)
-{
- VALUE k = (VALUE)key;
- VALUE hash = (VALUE)arg;
- rb_hash_aset(hash, k, INT2FIX(0));
- return ST_CONTINUE;
-}
-
-static int
-cos_i(void *vstart, void *vend, size_t stride, void *data)
-{
- size_t *counts = (size_t *)data;
- VALUE v = (VALUE)vstart;
-
- for (;v != (VALUE)vend; v += stride) {
- if (RBASIC(v)->flags) {
- counts[BUILTIN_TYPE(v)] += memsize_of(v);
- }
- }
- return 0;
-}
-
-/*
- * call-seq:
- * ObjectSpace.count_objects_size([result_hash]) -> hash
- *
- * Counts objects size (in bytes) for each type.
- *
- * Note that this information is incomplete. You need to deal with
- * this information as only a *HINT*. Especaially, total size of
- * T_DATA may not right size.
- *
- * It returns a hash as:
- * {:TOTAL=>1461154, :T_CLASS=>158280, :T_MODULE=>20672, :T_STRING=>527249, ...}
- *
- * If the optional argument, result_hash, is given,
- * it is overwritten and returned.
- * This is intended to avoid probe effect.
- *
- * The contents of the returned hash is implementation defined.
- * It may be changed in future.
- *
- * This method is not expected to work except C Ruby.
- */
-
-static VALUE
-count_objects_size(int argc, VALUE *argv, VALUE os)
-{
- size_t counts[T_MASK+1];
- size_t total = 0;
- size_t i;
- VALUE hash;
-
- if (rb_scan_args(argc, argv, "01", &hash) == 1) {
- if (TYPE(hash) != T_HASH)
- rb_raise(rb_eTypeError, "non-hash given");
- }
-
- for (i = 0; i <= T_MASK; i++) {
- counts[i] = 0;
- }
-
- 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;
- 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;
- }
- total += counts[i];
- rb_hash_aset(hash, type, SIZET2NUM(counts[i]));
- }
- }
- rb_hash_aset(hash, ID2SYM(rb_intern("TOTAL")), SIZET2NUM(total));
- return hash;
-}
-
-static int
-cn_i(void *vstart, void *vend, size_t stride, void *n)
-{
- size_t *nodes = (size_t *)n;
- VALUE v = (VALUE)vstart;
-
- for (; v != (VALUE)vend; v += stride) {
- if (RBASIC(v)->flags && BUILTIN_TYPE(v) == T_NODE) {
- size_t s = nd_type((NODE *)v);
- nodes[s]++;
- }
- }
-
- return 0;
-}
-
-/*
- * call-seq:
- * ObjectSpace.count_nodes([result_hash]) -> hash
- *
- * Counts nodes for each node type.
- *
- * This method is not for ordinary Ruby programmers, but for MRI developers
- * who have interest in MRI performance and memory usage.
- *
- * It returns a hash as:
- * {:NODE_METHOD=>2027, :NODE_FBODY=>1927, :NODE_CFUNC=>1798, ...}
- *
- * If the optional argument, result_hash, is given,
- * it is overwritten and returned.
- * This is intended to avoid probe effect.
- *
- * The contents of the returned hash is implementation defined.
- * It may be changed in future.
- *
- * This method is not expected to work except C Ruby.
- */
-
-static VALUE
-count_nodes(int argc, VALUE *argv, VALUE os)
-{
- size_t nodes[NODE_LAST+1];
- size_t i;
- VALUE hash;
-
- if (rb_scan_args(argc, argv, "01", &hash) == 1) {
- if (TYPE(hash) != T_HASH)
- rb_raise(rb_eTypeError, "non-hash given");
- }
-
- for (i = 0; i <= NODE_LAST; i++) {
- nodes[i] = 0;
- }
-
- 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)); break;
- COUNT_NODE(NODE_SCOPE);
- COUNT_NODE(NODE_BLOCK);
- COUNT_NODE(NODE_IF);
- COUNT_NODE(NODE_CASE);
- COUNT_NODE(NODE_WHEN);
- COUNT_NODE(NODE_OPT_N);
- COUNT_NODE(NODE_WHILE);
- COUNT_NODE(NODE_UNTIL);
- COUNT_NODE(NODE_ITER);
- COUNT_NODE(NODE_FOR);
- COUNT_NODE(NODE_BREAK);
- COUNT_NODE(NODE_NEXT);
- COUNT_NODE(NODE_REDO);
- COUNT_NODE(NODE_RETRY);
- COUNT_NODE(NODE_BEGIN);
- COUNT_NODE(NODE_RESCUE);
- COUNT_NODE(NODE_RESBODY);
- COUNT_NODE(NODE_ENSURE);
- COUNT_NODE(NODE_AND);
- COUNT_NODE(NODE_OR);
- COUNT_NODE(NODE_MASGN);
- COUNT_NODE(NODE_LASGN);
- COUNT_NODE(NODE_DASGN);
- 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_CALL);
- COUNT_NODE(NODE_FCALL);
- COUNT_NODE(NODE_VCALL);
- COUNT_NODE(NODE_SUPER);
- COUNT_NODE(NODE_ZSUPER);
- COUNT_NODE(NODE_ARRAY);
- COUNT_NODE(NODE_ZARRAY);
- COUNT_NODE(NODE_VALUES);
- COUNT_NODE(NODE_HASH);
- COUNT_NODE(NODE_RETURN);
- COUNT_NODE(NODE_YIELD);
- COUNT_NODE(NODE_LVAR);
- COUNT_NODE(NODE_DVAR);
- COUNT_NODE(NODE_GVAR);
- COUNT_NODE(NODE_IVAR);
- COUNT_NODE(NODE_CONST);
- COUNT_NODE(NODE_CVAR);
- COUNT_NODE(NODE_NTH_REF);
- COUNT_NODE(NODE_BACK_REF);
- COUNT_NODE(NODE_MATCH);
- COUNT_NODE(NODE_MATCH2);
- COUNT_NODE(NODE_MATCH3);
- COUNT_NODE(NODE_LIT);
- COUNT_NODE(NODE_STR);
- COUNT_NODE(NODE_DSTR);
- COUNT_NODE(NODE_XSTR);
- COUNT_NODE(NODE_DXSTR);
- COUNT_NODE(NODE_EVSTR);
- COUNT_NODE(NODE_DREGX);
- COUNT_NODE(NODE_DREGX_ONCE);
- COUNT_NODE(NODE_ARGS);
- COUNT_NODE(NODE_ARGS_AUX);
- COUNT_NODE(NODE_OPT_ARG);
- COUNT_NODE(NODE_POSTARG);
- 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);
- COUNT_NODE(NODE_ALIAS);
- COUNT_NODE(NODE_VALIAS);
- COUNT_NODE(NODE_UNDEF);
- COUNT_NODE(NODE_CLASS);
- COUNT_NODE(NODE_MODULE);
- COUNT_NODE(NODE_SCLASS);
- COUNT_NODE(NODE_COLON2);
- COUNT_NODE(NODE_COLON3);
- COUNT_NODE(NODE_DOT2);
- COUNT_NODE(NODE_DOT3);
- COUNT_NODE(NODE_FLIP2);
- COUNT_NODE(NODE_FLIP3);
- COUNT_NODE(NODE_SELF);
- COUNT_NODE(NODE_NIL);
- COUNT_NODE(NODE_TRUE);
- COUNT_NODE(NODE_FALSE);
- 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_OPTBLOCK);
-#undef COUNT_NODE
- default: node = INT2FIX(nodes[i]);
- }
- rb_hash_aset(hash, node, SIZET2NUM(nodes[i]));
- }
- }
- return hash;
-}
-
-static int
-cto_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_DATA) {
- VALUE counter = rb_hash_aref(hash, RBASIC(v)->klass);
- if (NIL_P(counter)) {
- counter = INT2FIX(1);
- }
- else {
- counter = INT2FIX(FIX2INT(counter) + 1);
- }
- rb_hash_aset(hash, RBASIC(v)->klass, counter);
- }
- }
-
- return 0;
-}
-
-/*
- * call-seq:
- * ObjectSpace.count_tdata_objects([result_hash]) -> hash
- *
- * Counts nodes for each node type.
- *
- * This method is not for ordinary Ruby programmers, but for MRI developers
- * who interest on MRI performance.
- *
- * It returns a hash as:
- * {:NODE_METHOD=>2027, :NODE_FBODY=>1927, :NODE_CFUNC=>1798, ...}
- *
- * If the optional argument, result_hash, is given,
- * it is overwritten and returned.
- * This is intended to avoid probe effect.
- *
- * The contents of the returned hash is implementation defined.
- * It may be changed in future.
- *
- * This method is not expected to work except C Ruby.
- *
- */
-
-static VALUE
-count_tdata_objects(int argc, VALUE *argv, VALUE self)
-{
- VALUE hash;
-
- if (rb_scan_args(argc, argv, "01", &hash) == 1) {
- if (TYPE(hash) != T_HASH)
- 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);
- }
-
- rb_objspace_each_objects(cto_i, (void *)hash);
-
- return hash;
-}
-
-/* objspace library extends ObjectSpace module and add several
- * methods to get internal statistic information about
- * object/memory management.
- *
- * Generally, you *SHOULD NOT*use this library if you do not know
- * about the MRI implementation. Mainly, this library is for (memory)
- * profiler developers and MRI developers who need to know how MRI
- * memory usage.
- */
-
-void
-Init_objspace(void)
-{
- VALUE rb_mObjSpace = rb_const_get(rb_cObject, rb_intern("ObjectSpace"));
-
- rb_define_module_function(rb_mObjSpace, "count_objects_size", count_objects_size, -1);
- rb_define_module_function(rb_mObjSpace, "memsize_of", memsize_of_m, 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);
-}
diff --git a/ext/openssl/extconf.rb b/ext/openssl/extconf.rb
index 6b83489642..02e06b7149 100644
--- a/ext/openssl/extconf.rb
+++ b/ext/openssl/extconf.rb
@@ -96,10 +96,7 @@ have_func("X509_STORE_set_ex_data")
have_func("OBJ_NAME_do_all_sorted")
have_func("SSL_SESSION_get_id")
have_func("OPENSSL_cleanse")
-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 try_compile("#define FOO(...) foo(__VA_ARGS__)\n int x(){FOO(1);FOO(1,2);FOO(1,2,3);}\n")
+if try_compile("#define FOO(a, ...) foo(a, ##__VA_ARGS__)\n int x(){FOO(1);FOO(1,2);FOO(1,2,3);}\n")
$defs.push("-DHAVE_VA_ARGS_MACRO")
end
if have_header("openssl/engine.h")
diff --git a/ext/openssl/lib/net/ftptls.rb b/ext/openssl/lib/net/ftptls.rb
new file mode 100644
index 0000000000..a21c1f6c3c
--- /dev/null
+++ b/ext/openssl/lib/net/ftptls.rb
@@ -0,0 +1,53 @@
+=begin
+= $RCSfile$ -- SSL/TLS enhancement for Net::HTTP.
+
+= Info
+ 'OpenSSL for Ruby 2' project
+ Copyright (C) 2003 Blaz Grilc <farmer@gmx.co.uk>
+ All rights reserved.
+
+= Licence
+ This program is licenced under the same licence as Ruby.
+ (See the file 'LICENCE'.)
+
+= Requirements
+
+= Version
+ $Id$
+
+= Notes
+ Tested on FreeBSD 5-CURRENT and 4-STABLE
+ - ruby 1.6.8 (2003-01-17) [i386-freebsd5]
+ - OpenSSL 0.9.7a Feb 19 2003
+ - ruby-openssl-0.2.0.p0
+ tested on ftp server: glftpd 1.30
+=end
+
+require 'socket'
+require 'openssl'
+require 'net/ftp'
+
+module Net
+ class FTPTLS < FTP
+ def connect(host, port=FTP_PORT)
+ @hostname = host
+ super
+ end
+
+ def login(user = "anonymous", passwd = nil, acct = nil)
+ store = OpenSSL::X509::Store.new
+ store.set_default_paths
+ ctx = OpenSSL::SSL::SSLContext.new('SSLv23')
+ ctx.cert_store = store
+ ctx.verify_mode = OpenSSL::SSL::VERIFY_PEER
+ ctx.key = nil
+ ctx.cert = nil
+ voidcmd("AUTH TLS")
+ @sock = OpenSSL::SSL::SSLSocket.new(@sock, ctx)
+ @sock.connect
+ @sock.post_connection_check(@hostname)
+ super(user, passwd, acct)
+ voidcmd("PBSZ 0")
+ end
+ end
+end
diff --git a/ext/openssl/lib/net/telnets.rb b/ext/openssl/lib/net/telnets.rb
new file mode 100644
index 0000000000..2b69280432
--- /dev/null
+++ b/ext/openssl/lib/net/telnets.rb
@@ -0,0 +1,251 @@
+=begin
+= $RCSfile$ -- SSL/TLS enhancement for Net::Telnet.
+
+= Info
+ 'OpenSSL for Ruby 2' project
+ Copyright (C) 2001 GOTOU YUUZOU <gotoyuzo@notwork.org>
+ All rights reserved.
+
+= Licence
+ This program is licenced under the same licence as Ruby.
+ (See the file 'LICENCE'.)
+
+= Version
+ $Id$
+
+ 2001/11/06: Contiributed to Ruby/OpenSSL project.
+
+== class Net::Telnet
+
+This class will initiate SSL/TLS session automaticaly if the server
+sent OPT_STARTTLS. Some options are added for SSL/TLS.
+
+ host = Net::Telnet::new({
+ "Host" => "localhost",
+ "Port" => "telnets",
+ ## follows are new options.
+ 'CertFile' => "user.crt",
+ 'KeyFile' => "user.key",
+ 'CAFile' => "/some/where/certs/casert.pem",
+ 'CAPath' => "/some/where/caserts",
+ 'VerifyMode' => SSL::VERIFY_PEER,
+ 'VerifyCallback' => verify_proc
+ })
+
+Or, the new options ('Cert', 'Key' and 'CACert') are available from
+Michal Rokos's OpenSSL module.
+
+ cert_data = File.open("user.crt"){|io| io.read }
+ pkey_data = File.open("user.key"){|io| io.read }
+ cacert_data = File.open("your_ca.pem"){|io| io.read }
+ host = Net::Telnet::new({
+ "Host" => "localhost",
+ "Port" => "telnets",
+ 'Cert' => OpenSSL::X509::Certificate.new(cert_data)
+ 'Key' => OpenSSL::PKey::RSA.new(pkey_data)
+ 'CACert' => OpenSSL::X509::Certificate.new(cacert_data)
+ 'CAFile' => "/some/where/certs/casert.pem",
+ 'CAPath' => "/some/where/caserts",
+ 'VerifyMode' => SSL::VERIFY_PEER,
+ 'VerifyCallback' => verify_proc
+ })
+
+This class is expected to be a superset of usual Net::Telnet.
+=end
+
+require "net/telnet"
+require "openssl"
+
+module Net
+ class Telnet
+ attr_reader :ssl
+
+ OPT_STARTTLS = 46.chr # "\056" # "\x2e" # Start TLS
+ TLS_FOLLOWS = 1.chr # "\001" # "\x01" # FOLLOWS (for STARTTLS)
+
+ alias preprocess_orig preprocess
+
+ def ssl?; @ssl; end
+
+ 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"]
+
+ string.gsub(/#{IAC}(
+ [#{IAC}#{AO}#{AYT}#{DM}#{IP}#{NOP}]|
+ [#{DO}#{DONT}#{WILL}#{WONT}][#{OPT_BINARY}-#{OPT_EXOPL}]|
+ #{SB}[#{OPT_BINARY}-#{OPT_EXOPL}]
+ (#{IAC}#{IAC}|[^#{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)
+ elsif OPT_STARTTLS[0] == $1[1]
+ self.write(IAC + WILL + OPT_STARTTLS)
+ self.write(IAC + SB + OPT_STARTTLS + TLS_FOLLOWS + IAC + SE)
+ 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
+ ''
+ elsif SB[0] == $1[0] # respond to "IAC SB xxx IAC SE"
+ if OPT_STARTTLS[0] == $1[1] && TLS_FOLLOWS[0] == $2[0]
+ @sock = OpenSSL::SSL::SSLSocket.new(@sock)
+ @sock.cert = @options['Cert'] unless @sock.cert
+ @sock.key = @options['Key'] unless @sock.key
+ @sock.ca_cert = @options['CACert']
+ @sock.ca_file = @options['CAFile']
+ @sock.ca_path = @options['CAPath']
+ @sock.timeout = @options['Timeout']
+ @sock.verify_mode = @options['VerifyMode']
+ @sock.verify_callback = @options['VerifyCallback']
+ @sock.verify_depth = @options['VerifyDepth']
+ @sock.connect
+ if @options['VerifyMode'] != OpenSSL::SSL::VERIFY_NONE
+ @sock.post_connection_check(@options['Host'])
+ end
+ @ssl = true
+ end
+ ''
+ else
+ ''
+ end
+ end
+ end # preprocess
+
+ alias waitfor_org waitfor
+
+ def waitfor(options)
+ time_out = @options["Timeout"]
+ waittime = @options["Waittime"]
+
+ 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")
+ else
+ prompt = options
+ end
+
+ if time_out == false
+ time_out = nil
+ end
+
+ line = ''
+ buf = ''
+ @rest = '' unless @rest
+
+ until(prompt === line and not IO::select([@sock], nil, nil, waittime))
+ unless IO::select([@sock], nil, nil, time_out)
+ raise TimeoutError, "timed-out; wait for the next data"
+ end
+ begin
+ c = @rest + @sock.sysread(1024 * 1024)
+ @dumplog.log_dump('<', c) if @options.has_key?("Dump_log")
+ if @options["Telnetmode"]
+ pos = 0
+ catch(:next){
+ while true
+ case c[pos]
+ when IAC[0]
+ case c[pos+1]
+ when DO[0], DONT[0], WILL[0], WONT[0]
+ throw :next unless c[pos+2]
+ pos += 3
+ when SB[0]
+ ret = detect_sub_negotiation(c, pos)
+ throw :next unless ret
+ pos = ret
+ when nil
+ throw :next
+ else
+ pos += 2
+ end
+ when nil
+ throw :next
+ else
+ pos += 1
+ end
+ end
+ }
+
+ buf = preprocess(c[0...pos])
+ @rest = c[pos..-1]
+ end
+ @log.print(buf) if @options.has_key?("Output_log")
+ line.concat(buf)
+ yield buf if block_given?
+ rescue EOFError # End of file reached
+ if line == ''
+ line = nil
+ yield nil if block_given?
+ end
+ break
+ end
+ end
+ line
+ end
+
+ private
+
+ def detect_sub_negotiation(data, pos)
+ return nil if data.length < pos+6 # IAC SB x param IAC SE
+ pos += 3
+ while true
+ case data[pos]
+ when IAC[0]
+ if data[pos+1] == SE[0]
+ pos += 2
+ return pos
+ else
+ pos += 2
+ end
+ when nil
+ return nil
+ else
+ pos += 1
+ end
+ end
+ end
+
+ end
+end
diff --git a/ext/openssl/lib/openssl.rb b/ext/openssl/lib/openssl.rb
index 70fce196a5..f10985ed2c 100644
--- a/ext/openssl/lib/openssl.rb
+++ b/ext/openssl/lib/openssl.rb
@@ -19,6 +19,7 @@ require 'openssl.so'
require 'openssl/bn'
require 'openssl/cipher'
require 'openssl/digest'
-require 'openssl/ssl-internal'
-require 'openssl/x509-internal'
+require 'openssl/pkcs7'
+require 'openssl/ssl'
+require 'openssl/x509'
diff --git a/ext/openssl/lib/openssl/buffering.rb b/ext/openssl/lib/openssl/buffering.rb
index 3028fe5b52..761a017487 100644
--- a/ext/openssl/lib/openssl/buffering.rb
+++ b/ext/openssl/lib/openssl/buffering.rb
@@ -14,7 +14,6 @@
$Id$
=end
-module OpenSSL
module Buffering
include Enumerable
attr_accessor :sync
@@ -58,10 +57,10 @@ module Buffering
if size == 0
if buf
buf.clear
- return buf
else
- return ""
+ buf = ""
end
+ return @eof ? nil : buf
end
until @eof
break if size && size <= @rbuffer.size
@@ -79,10 +78,10 @@ module Buffering
if maxlen == 0
if buf
buf.clear
- return buf
else
- return ""
+ buf = ""
end
+ return @eof ? nil : buf
end
if @rbuffer.empty?
begin
@@ -100,60 +99,7 @@ module Buffering
ret
end
- # 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.
- #
- # IO::WaitReadable means SSL needs to read internally.
- # So read_nonblock should be called again after
- # underlying IO is readable.
- #
- # IO::WaitWritable means SSL needs to write internally.
- # So read_nonblock should be called again after
- # underlying IO is writable.
- #
- # So OpenSSL::Buffering#read_nonblock needs two rescue clause as follows.
- #
- # # emulates blocking read (readpartial).
- # begin
- # result = ssl.read_nonblock(maxlen)
- # rescue IO::WaitReadable
- # IO.select([io])
- # retry
- # rescue IO::WaitWritable
- # IO.select(nil, [io])
- # retry
- # end
- #
- # Note that one reason that read_nonblock write to a underlying IO
- # is the peer requests a new TLS/SSL handshake.
- # See openssl FAQ for more details.
- # http://www.openssl.org/support/faq.html
- #
- def read_nonblock(maxlen, buf=nil)
- if maxlen == 0
- if buf
- buf.clear
- return buf
- else
- return ""
- end
- end
- if @rbuffer.empty?
- return sysread_nonblock(maxlen, buf)
- end
- ret = consume_rbuff(maxlen)
- if buf
- buf.replace(ret)
- ret = buf
- end
- raise EOFError if ret.empty?
- ret
- end
-
- def gets(eol=$/, limit=nil)
+ def gets(eol=$/)
idx = @rbuffer.index(eol)
until @eof
break if idx
@@ -165,9 +111,6 @@ module Buffering
else
size = idx ? idx+eol.size : nil
end
- if limit and limit >= 0
- size = [size, limit].min
- end
consume_rbuff(size)
end
@@ -250,48 +193,6 @@ module Buffering
s.length
end
- # Writes _str_ in the non-blocking manner.
- #
- # If there are buffered data, it is flushed at first.
- # This may block.
- #
- # write_nonblock returns number of bytes written to the SSL connection.
- #
- # When no data can be written without blocking,
- # It raises OpenSSL::SSL::SSLError extended by
- # IO::WaitReadable or IO::WaitWritable.
- #
- # IO::WaitReadable means SSL needs to read internally.
- # So write_nonblock should be called again after
- # underlying IO is readable.
- #
- # IO::WaitWritable means SSL needs to write internally.
- # So write_nonblock should be called again after
- # underlying IO is writable.
- #
- # So OpenSSL::Buffering#write_nonblock needs two rescue clause as follows.
- #
- # # emulates blocking write.
- # begin
- # result = ssl.write_nonblock(str)
- # rescue IO::WaitReadable
- # IO.select([io])
- # retry
- # rescue IO::WaitWritable
- # IO.select(nil, [io])
- # retry
- # end
- #
- # Note that one reason that write_nonblock read from a underlying IO
- # is the peer requests a new TLS/SSL handshake.
- # See openssl FAQ for more details.
- # http://www.openssl.org/support/faq.html
- #
- def write_nonblock(s)
- flush
- syswrite_nonblock(s)
- end
-
def << (s)
do_write(s)
self
@@ -336,4 +237,3 @@ module Buffering
sysclose
end
end
-end
diff --git a/ext/openssl/lib/openssl/pkcs7.rb b/ext/openssl/lib/openssl/pkcs7.rb
new file mode 100644
index 0000000000..1f88c1de5e
--- /dev/null
+++ b/ext/openssl/lib/openssl/pkcs7.rb
@@ -0,0 +1,25 @@
+=begin
+= $RCSfile$ -- PKCS7
+
+= Licence
+ This program is licenced under the same licence as Ruby.
+ (See the file 'LICENCE'.)
+
+= Version
+ $Id: digest.rb 12148 2007-04-05 05:59:22Z technorama $
+=end
+
+module OpenSSL
+ class PKCS7
+ # This class is only provided for backwards compatibility. Use OpenSSL::PKCS7 in the future.
+ class PKCS7 < PKCS7
+ def initialize(*args)
+ super(*args)
+
+ warn("Warning: OpenSSL::PKCS7::PKCS7 is deprecated after Ruby 1.9; use OpenSSL::PKCS7 instead")
+ end
+ end
+
+ end # PKCS7
+end # OpenSSL
+
diff --git a/ext/openssl/lib/openssl/ssl-internal.rb b/ext/openssl/lib/openssl/ssl-internal.rb
deleted file mode 100644
index 04a9faa0b6..0000000000
--- a/ext/openssl/lib/openssl/ssl-internal.rb
+++ /dev/null
@@ -1,177 +0,0 @@
-=begin
-= $RCSfile$ -- Ruby-space definitions that completes C-space funcs for SSL
-
-= Info
- 'OpenSSL for Ruby 2' project
- Copyright (C) 2001 GOTOU YUUZOU <gotoyuzo@notwork.org>
- All rights reserved.
-
-= Licence
- This program is licenced under the same licence as Ruby.
- (See the file 'LICENCE'.)
-
-= Version
- $Id$
-=end
-
-require "openssl/buffering"
-require "fcntl"
-
-module OpenSSL
- module SSL
- class SSLContext
- DEFAULT_PARAMS = {
- :ssl_version => "SSLv23",
- :verify_mode => OpenSSL::SSL::VERIFY_PEER,
- :ciphers => "ALL:!ADH:!EXPORT:!SSLv2:RC4+RSA:+HIGH:+MEDIUM:+LOW",
- :options => OpenSSL::SSL::OP_ALL,
- }
-
- DEFAULT_CERT_STORE = OpenSSL::X509::Store.new
- DEFAULT_CERT_STORE.set_default_paths
- if defined?(OpenSSL::X509::V_FLAG_CRL_CHECK_ALL)
- DEFAULT_CERT_STORE.flags = OpenSSL::X509::V_FLAG_CRL_CHECK_ALL
- end
-
- def set_params(params={})
- params = DEFAULT_PARAMS.merge(params)
- params.each{|name, value| self.__send__("#{name}=", value) }
- if self.verify_mode != OpenSSL::SSL::VERIFY_NONE
- unless self.ca_file or self.ca_path or self.cert_store
- self.cert_store = DEFAULT_CERT_STORE
- end
- end
- return params
- end
- end
-
- module SocketForwarder
- def addr
- to_io.addr
- end
-
- def peeraddr
- to_io.peeraddr
- end
-
- def setsockopt(level, optname, optval)
- to_io.setsockopt(level, optname, optval)
- end
-
- def getsockopt(level, optname)
- to_io.getsockopt(level, optname)
- end
-
- def fcntl(*args)
- to_io.fcntl(*args)
- end
-
- def closed?
- to_io.closed?
- end
-
- def do_not_reverse_lookup=(flag)
- to_io.do_not_reverse_lookup = flag
- end
- end
-
- module Nonblock
- def initialize(*args)
- flag = File::NONBLOCK
- flag |= @io.fcntl(Fcntl::F_GETFL) if defined?(Fcntl::F_GETFL)
- @io.fcntl(Fcntl::F_SETFL, flag)
- super
- end
- end
-
- def verify_certificate_identity(cert, hostname)
- should_verify_common_name = true
- cert.extensions.each{|ext|
- next if ext.oid != "subjectAltName"
- ext.value.split(/,\s+/).each{|general_name|
- if /\ADNS:(.*)/ =~ general_name
- should_verify_common_name = false
- reg = Regexp.escape($1).gsub(/\\\*/, "[^.]+")
- return true if /\A#{reg}\z/i =~ hostname
- elsif /\AIP Address:(.*)/ =~ general_name
- should_verify_common_name = false
- return true if $1 == hostname
- end
- }
- }
- if should_verify_common_name
- cert.subject.to_a.each{|oid, value|
- if oid == "CN"
- reg = Regexp.escape(value).gsub(/\\\*/, "[^.]+")
- return true if /\A#{reg}\z/i =~ hostname
- end
- }
- end
- return false
- end
- module_function :verify_certificate_identity
-
- class SSLSocket
- include Buffering
- include SocketForwarder
- include Nonblock
-
- def post_connection_check(hostname)
- unless OpenSSL::SSL.verify_certificate_identity(peer_cert, hostname)
- raise SSLError, "hostname was not match with the server certificate"
- end
- return true
- end
-
- def session
- SSL::Session.new(self)
- rescue SSL::Session::SessionError
- nil
- end
- end
-
- class SSLServer
- include SocketForwarder
- attr_accessor :start_immediately
-
- def initialize(svr, ctx)
- @svr = svr
- @ctx = ctx
- unless ctx.session_id_context
- session_id = OpenSSL::Digest::MD5.hexdigest($0)
- @ctx.session_id_context = session_id
- end
- @start_immediately = true
- end
-
- def to_io
- @svr
- end
-
- def listen(backlog=5)
- @svr.listen(backlog)
- end
-
- def shutdown(how=Socket::SHUT_RDWR)
- @svr.shutdown(how)
- end
-
- def accept
- sock = @svr.accept
- begin
- ssl = OpenSSL::SSL::SSLSocket.new(sock, @ctx)
- ssl.sync_close = true
- ssl.accept if @start_immediately
- ssl
- rescue SSLError => ex
- sock.close
- raise ex
- end
- end
-
- def close
- @svr.close
- end
- end
- end
-end
diff --git a/ext/openssl/lib/openssl/ssl.rb b/ext/openssl/lib/openssl/ssl.rb
index 3f17f5aa29..f722cb0c45 100644
--- a/ext/openssl/lib/openssl/ssl.rb
+++ b/ext/openssl/lib/openssl/ssl.rb
@@ -1 +1,179 @@
-require 'openssl'
+=begin
+= $RCSfile$ -- Ruby-space definitions that completes C-space funcs for SSL
+
+= Info
+ 'OpenSSL for Ruby 2' project
+ Copyright (C) 2001 GOTOU YUUZOU <gotoyuzo@notwork.org>
+ All rights reserved.
+
+= Licence
+ This program is licenced under the same licence as Ruby.
+ (See the file 'LICENCE'.)
+
+= Version
+ $Id$
+=end
+
+require "openssl"
+require "openssl/buffering"
+require "fcntl"
+
+module OpenSSL
+ module SSL
+ class SSLContext
+ DEFAULT_PARAMS = {
+ :ssl_version => "SSLv23",
+ :verify_mode => OpenSSL::SSL::VERIFY_PEER,
+ :ciphers => "ALL:!ADH:!EXPORT:!SSLv2:RC4+RSA:+HIGH:+MEDIUM:+LOW",
+ :options => OpenSSL::SSL::OP_ALL,
+ }
+
+ DEFAULT_CERT_STORE = OpenSSL::X509::Store.new
+ DEFAULT_CERT_STORE.set_default_paths
+ if defined?(OpenSSL::X509::V_FLAG_CRL_CHECK_ALL)
+ DEFAULT_CERT_STORE.flags = OpenSSL::X509::V_FLAG_CRL_CHECK_ALL
+ end
+
+ def set_params(params={})
+ params = DEFAULT_PARAMS.merge(params)
+ self.ssl_version = params.delete(:ssl_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
+ self.cert_store = DEFAULT_CERT_STORE
+ end
+ end
+ return params
+ end
+ end
+
+ module SocketForwarder
+ def addr
+ to_io.addr
+ end
+
+ def peeraddr
+ to_io.peeraddr
+ end
+
+ def setsockopt(level, optname, optval)
+ to_io.setsockopt(level, optname, optval)
+ end
+
+ def getsockopt(level, optname)
+ to_io.getsockopt(level, optname)
+ end
+
+ def fcntl(*args)
+ to_io.fcntl(*args)
+ end
+
+ def closed?
+ to_io.closed?
+ end
+
+ def do_not_reverse_lookup=(flag)
+ to_io.do_not_reverse_lookup = flag
+ end
+ end
+
+ module Nonblock
+ def initialize(*args)
+ flag = File::NONBLOCK
+ flag |= @io.fcntl(Fcntl::F_GETFL) if defined?(Fcntl::F_GETFL)
+ @io.fcntl(Fcntl::F_SETFL, flag)
+ super
+ end
+ end
+
+ def verify_certificate_identity(cert, hostname)
+ should_verify_common_name = true
+ cert.extensions.each{|ext|
+ next if ext.oid != "subjectAltName"
+ ext.value.split(/,\s+/).each{|general_name|
+ if /\ADNS:(.*)/ =~ general_name
+ should_verify_common_name = false
+ reg = Regexp.escape($1).gsub(/\\\*/, "[^.]+")
+ return true if /\A#{reg}\z/i =~ hostname
+ elsif /\AIP Address:(.*)/ =~ general_name
+ should_verify_common_name = false
+ return true if $1 == hostname
+ end
+ }
+ }
+ if should_verify_common_name
+ cert.subject.to_a.each{|oid, value|
+ if oid == "CN"
+ reg = Regexp.escape(value).gsub(/\\\*/, "[^.]+")
+ return true if /\A#{reg}\z/i =~ hostname
+ end
+ }
+ end
+ return false
+ end
+ module_function :verify_certificate_identity
+
+ class SSLSocket
+ include Buffering
+ include SocketForwarder
+ include Nonblock
+
+ def post_connection_check(hostname)
+ unless OpenSSL::SSL.verify_certificate_identity(peer_cert, hostname)
+ raise SSLError, "hostname was not match with the server certificate"
+ end
+ return true
+ end
+
+ def session
+ SSL::Session.new(self)
+ rescue SSL::Session::SessionError
+ nil
+ end
+ end
+
+ class SSLServer
+ include SocketForwarder
+ attr_accessor :start_immediately
+
+ def initialize(svr, ctx)
+ @svr = svr
+ @ctx = ctx
+ unless ctx.session_id_context
+ session_id = OpenSSL::Digest::MD5.hexdigest($0)
+ @ctx.session_id_context = session_id
+ end
+ @start_immediately = true
+ end
+
+ def to_io
+ @svr
+ end
+
+ def listen(backlog=5)
+ @svr.listen(backlog)
+ end
+
+ def shutdown(how=Socket::SHUT_RDWR)
+ @svr.shutdown(how)
+ end
+
+ def accept
+ sock = @svr.accept
+ begin
+ ssl = OpenSSL::SSL::SSLSocket.new(sock, @ctx)
+ ssl.sync_close = true
+ ssl.accept if @start_immediately
+ ssl
+ rescue SSLError => ex
+ sock.close
+ raise ex
+ end
+ end
+
+ def close
+ @svr.close
+ end
+ end
+ end
+end
diff --git a/ext/openssl/lib/openssl/x509-internal.rb b/ext/openssl/lib/openssl/x509-internal.rb
deleted file mode 100644
index 6aff4ca10d..0000000000
--- a/ext/openssl/lib/openssl/x509-internal.rb
+++ /dev/null
@@ -1,153 +0,0 @@
-=begin
-= $RCSfile$ -- Ruby-space definitions that completes C-space funcs for X509 and subclasses
-
-= Info
- 'OpenSSL for Ruby 2' project
- Copyright (C) 2002 Michal Rokos <m.rokos@sh.cvut.cz>
- All rights reserved.
-
-= Licence
- This program is licenced under the same licence as Ruby.
- (See the file 'LICENCE'.)
-
-= Version
- $Id$
-=end
-
-module OpenSSL
- module X509
- class ExtensionFactory
- def create_extension(*arg)
- if arg.size > 1
- create_ext(*arg)
- else
- send("create_ext_from_"+arg[0].class.name.downcase, arg[0])
- end
- end
-
- def create_ext_from_array(ary)
- raise ExtensionError, "unexpected array form" if ary.size > 3
- create_ext(ary[0], ary[1], ary[2])
- end
-
- def create_ext_from_string(str) # "oid = critical, value"
- oid, value = str.split(/=/, 2)
- oid.strip!
- value.strip!
- create_ext(oid, value)
- end
-
- def create_ext_from_hash(hash)
- create_ext(hash["oid"], hash["value"], hash["critical"])
- end
- end
-
- class Extension
- def to_s # "oid = critical, value"
- str = self.oid
- str << " = "
- str << "critical, " if self.critical?
- str << self.value.gsub(/\n/, ", ")
- end
-
- def to_h # {"oid"=>sn|ln, "value"=>value, "critical"=>true|false}
- {"oid"=>self.oid,"value"=>self.value,"critical"=>self.critical?}
- end
-
- def to_a
- [ self.oid, self.value, self.critical? ]
- end
- end
-
- class Name
- module RFC2253DN
- Special = ',=+<>#;'
- HexChar = /[0-9a-fA-F]/
- HexPair = /#{HexChar}#{HexChar}/
- HexString = /#{HexPair}+/
- Pair = /\\(?:[#{Special}]|\\|"|#{HexPair})/
- StringChar = /[^#{Special}\\"]/
- QuoteChar = /[^\\"]/
- AttributeType = /[a-zA-Z][0-9a-zA-Z]*|[0-9]+(?:\.[0-9]+)*/
- AttributeValue = /
- (?!["#])((?:#{StringChar}|#{Pair})*)|
- \#(#{HexString})|
- "((?:#{QuoteChar}|#{Pair})*)"
- /x
- TypeAndValue = /\A(#{AttributeType})=#{AttributeValue}/
-
- module_function
-
- def expand_pair(str)
- return nil unless str
- return str.gsub(Pair){
- pair = $&
- case pair.size
- when 2 then pair[1,1]
- when 3 then Integer("0x#{pair[1,2]}").chr
- else raise OpenSSL::X509::NameError, "invalid pair: #{str}"
- end
- }
- end
-
- def expand_hexstring(str)
- return nil unless str
- der = str.gsub(HexPair){$&.to_i(16).chr }
- a1 = OpenSSL::ASN1.decode(der)
- return a1.value, a1.tag
- end
-
- def expand_value(str1, str2, str3)
- value = expand_pair(str1)
- value, tag = expand_hexstring(str2) unless value
- value = expand_pair(str3) unless value
- return value, tag
- end
-
- def scan(dn)
- str = dn
- ary = []
- while true
- if md = TypeAndValue.match(str)
- matched = md.to_s
- remain = md.post_match
- type = md[1]
- value, tag = expand_value(md[2], md[3], md[4]) rescue nil
- if value
- type_and_value = [type, value]
- type_and_value.push(tag) if tag
- ary.unshift(type_and_value)
- if remain.length > 2 && remain[0] == ?,
- str = remain[1..-1]
- next
- elsif remain.length > 2 && remain[0] == ?+
- raise OpenSSL::X509::NameError,
- "multi-valued RDN is not supported: #{dn}"
- elsif remain.empty?
- break
- end
- end
- end
- msg_dn = dn[0, dn.length - str.length] + " =>" + str
- raise OpenSSL::X509::NameError, "malformed RDN: #{msg_dn}"
- end
- return ary
- end
- end
-
- class <<self
- def parse_rfc2253(str, template=OBJECT_TYPE_TEMPLATE)
- ary = OpenSSL::X509::Name::RFC2253DN.scan(str)
- self.new(ary, template)
- end
-
- def parse_openssl(str, template=OBJECT_TYPE_TEMPLATE)
- ary = str.scan(/\s*([^\/,]+)\s*/).collect{|i| i[0].split("=", 2) }
- self.new(ary, template)
- end
-
- alias parse parse_openssl
- end
- end
- end
-end
diff --git a/ext/openssl/lib/openssl/x509.rb b/ext/openssl/lib/openssl/x509.rb
index 3f17f5aa29..e711bda39c 100644
--- a/ext/openssl/lib/openssl/x509.rb
+++ b/ext/openssl/lib/openssl/x509.rb
@@ -1 +1,154 @@
-require 'openssl'
+=begin
+= $RCSfile$ -- Ruby-space definitions that completes C-space funcs for X509 and subclasses
+
+= Info
+ 'OpenSSL for Ruby 2' project
+ Copyright (C) 2002 Michal Rokos <m.rokos@sh.cvut.cz>
+ All rights reserved.
+
+= Licence
+ This program is licenced under the same licence as Ruby.
+ (See the file 'LICENCE'.)
+
+= Version
+ $Id$
+=end
+
+require "openssl"
+
+module OpenSSL
+ module X509
+ class ExtensionFactory
+ def create_extension(*arg)
+ if arg.size > 1
+ create_ext(*arg)
+ else
+ send("create_ext_from_"+arg[0].class.name.downcase, arg[0])
+ end
+ end
+
+ def create_ext_from_array(ary)
+ raise ExtensionError, "unexpected array form" if ary.size > 3
+ create_ext(ary[0], ary[1], ary[2])
+ end
+
+ def create_ext_from_string(str) # "oid = critical, value"
+ oid, value = str.split(/=/, 2)
+ oid.strip!
+ value.strip!
+ create_ext(oid, value)
+ end
+
+ def create_ext_from_hash(hash)
+ create_ext(hash["oid"], hash["value"], hash["critical"])
+ end
+ end
+
+ class Extension
+ def to_s # "oid = critical, value"
+ str = self.oid
+ str << " = "
+ str << "critical, " if self.critical?
+ str << self.value.gsub(/\n/, ", ")
+ end
+
+ def to_h # {"oid"=>sn|ln, "value"=>value, "critical"=>true|false}
+ {"oid"=>self.oid,"value"=>self.value,"critical"=>self.critical?}
+ end
+
+ def to_a
+ [ self.oid, self.value, self.critical? ]
+ end
+ end
+
+ class Name
+ module RFC2253DN
+ Special = ',=+<>#;'
+ HexChar = /[0-9a-fA-F]/
+ HexPair = /#{HexChar}#{HexChar}/
+ HexString = /#{HexPair}+/
+ Pair = /\\(?:[#{Special}]|\\|"|#{HexPair})/
+ StringChar = /[^#{Special}\\"]/
+ QuoteChar = /[^\\"]/
+ AttributeType = /[a-zA-Z][0-9a-zA-Z]*|[0-9]+(?:\.[0-9]+)*/
+ AttributeValue = /
+ (?!["#])((?:#{StringChar}|#{Pair})*)|
+ \#(#{HexString})|
+ "((?:#{QuoteChar}|#{Pair})*)"
+ /x
+ TypeAndValue = /\A(#{AttributeType})=#{AttributeValue}/
+
+ module_function
+
+ def expand_pair(str)
+ return nil unless str
+ return str.gsub(Pair){|pair|
+ case pair.size
+ when 2 then pair[1,1]
+ when 3 then Integer("0x#{pair[1,2]}").chr
+ else raise OpenSSL::X509::NameError, "invalid pair: #{str}"
+ end
+ }
+ end
+
+ def expand_hexstring(str)
+ return nil unless str
+ der = str.gsub(HexPair){|hex| Integer("0x#{hex}").chr }
+ a1 = OpenSSL::ASN1.decode(der)
+ return a1.value, a1.tag
+ end
+
+ def expand_value(str1, str2, str3)
+ value = expand_pair(str1)
+ value, tag = expand_hexstring(str2) unless value
+ value = expand_pair(str3) unless value
+ return value, tag
+ end
+
+ def scan(dn)
+ str = dn
+ ary = []
+ while true
+ if md = TypeAndValue.match(str)
+ matched = md.to_s
+ remain = md.post_match
+ type = md[1]
+ value, tag = expand_value(md[2], md[3], md[4]) rescue nil
+ if value
+ type_and_value = [type, value]
+ type_and_value.push(tag) if tag
+ ary.unshift(type_and_value)
+ if remain.length > 2 && remain[0] == ?,
+ str = remain[1..-1]
+ next
+ elsif remain.length > 2 && remain[0] == ?+
+ raise OpenSSL::X509::NameError,
+ "multi-valued RDN is not supported: #{dn}"
+ elsif remain.empty?
+ break
+ end
+ end
+ end
+ msg_dn = dn[0, dn.length - str.length] + " =>" + str
+ raise OpenSSL::X509::NameError, "malformed RDN: #{msg_dn}"
+ end
+ return ary
+ end
+ end
+
+ class <<self
+ def parse_rfc2253(str, template=OBJECT_TYPE_TEMPLATE)
+ ary = OpenSSL::X509::Name::RFC2253DN.scan(str)
+ self.new(ary, template)
+ end
+
+ def parse_openssl(str, template=OBJECT_TYPE_TEMPLATE)
+ ary = str.scan(/\s*([^\/,]+)\s*/).collect{|i| i[0].split("=", 2) }
+ self.new(ary, template)
+ end
+
+ alias parse parse_openssl
+ end
+ end
+ end
+end
diff --git a/ext/openssl/openssl_missing.h b/ext/openssl/openssl_missing.h
index 619cf6fdb5..5a71f73c64 100644
--- a/ext/openssl/openssl_missing.h
+++ b/ext/openssl/openssl_missing.h
@@ -18,9 +18,6 @@ extern "C" {
#ifndef TYPEDEF_D2I_OF
typedef char *d2i_of_void();
#endif
-#ifndef TYPEDEF_I2D_OF
-typedef int i2d_of_void();
-#endif
/*
* These functions are not included in headers of OPENSSL <= 0.9.6b
@@ -28,39 +25,39 @@ typedef int i2d_of_void();
#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)
+ (char *(*)())d2i_DSAPublicKey,PEM_STRING_DSA_PUBLIC,bp,(char **)x,cb,u)
#endif
#if !defined(PEM_write_bio_DSAPublicKey)
# define PEM_write_bio_DSAPublicKey(bp,x) \
- PEM_ASN1_write_bio((i2d_of_void *)i2d_DSAPublicKey,\
+ PEM_ASN1_write_bio((int (*)())i2d_DSAPublicKey,\
PEM_STRING_DSA_PUBLIC,\
bp,(char *)x, NULL, NULL, 0, NULL, NULL)
#endif
#if !defined(DSAPrivateKey_dup)
-# define DSAPrivateKey_dup(dsa) (DSA *)ASN1_dup((i2d_of_void *)i2d_DSAPrivateKey, \
- (d2i_of_void *)d2i_DSAPrivateKey,(char *)dsa)
+# define DSAPrivateKey_dup(dsa) (DSA *)ASN1_dup((int (*)())i2d_DSAPrivateKey, \
+ (char *(*)())d2i_DSAPrivateKey,(char *)dsa)
#endif
#if !defined(DSAPublicKey_dup)
-# define DSAPublicKey_dup(dsa) (DSA *)ASN1_dup((i2d_of_void *)i2d_DSAPublicKey, \
- (d2i_of_void *)d2i_DSAPublicKey,(char *)dsa)
+# define DSAPublicKey_dup(dsa) (DSA *)ASN1_dup((int (*)())i2d_DSAPublicKey, \
+ (char *(*)())d2i_DSAPublicKey,(char *)dsa)
#endif
#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)
+# define X509_REVOKED_dup(rev) (X509_REVOKED *)ASN1_dup((int (*)())i2d_X509_REVOKED, \
+ (char *(*)())d2i_X509_REVOKED, (char *)rev)
#endif
#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)
+# define PKCS7_SIGNER_INFO_dup(si) (PKCS7_SIGNER_INFO *)ASN1_dup((int (*)())i2d_PKCS7_SIGNER_INFO, \
+ (char *(*)())d2i_PKCS7_SIGNER_INFO, (char *)si)
#endif
#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)
+# define PKCS7_RECIP_INFO_dup(ri) (PKCS7_RECIP_INFO *)ASN1_dup((int (*)())i2d_PKCS7_RECIP_INFO, \
+ (char *(*)())d2i_PKCS7_RECIP_INFO, (char *)ri)
#endif
#if !defined(HAVE_EVP_MD_CTX_INIT)
diff --git a/ext/openssl/ossl.c b/ext/openssl/ossl.c
index d4a2dc1276..53f476fd65 100644
--- a/ext/openssl/ossl.c
+++ b/ext/openssl/ossl.c
@@ -15,7 +15,7 @@
* String to HEXString conversion
*/
int
-string2hex(const unsigned char *buf, int buf_len, char **hexbuf, int *hexbuf_len)
+string2hex(char *buf, int buf_len, char **hexbuf, int *hexbuf_len)
{
static const char hex[]="0123456789abcdef";
int i, len = 2 * buf_len;
@@ -272,9 +272,10 @@ ossl_to_der_if_possible(VALUE obj)
/*
* Errors
*/
-static VALUE
-ossl_make_error(VALUE exc, const char *fmt, va_list args)
+void
+ossl_raise(VALUE exc, const char *fmt, ...)
{
+ va_list args;
char buf[BUFSIZ];
const char *msg;
long e;
@@ -286,14 +287,17 @@ ossl_make_error(VALUE exc, const char *fmt, va_list args)
e = ERR_peek_error();
#endif
if (fmt) {
+ va_start(args, fmt);
len = vsnprintf(buf, BUFSIZ, fmt, args);
+ va_end(args);
}
if (len < BUFSIZ && e) {
if (dOSSL == Qtrue) /* FULL INFO */
msg = ERR_error_string(e, NULL);
else
msg = ERR_reason_error_string(e);
- len += snprintf(buf+len, BUFSIZ-len, "%s%s", (len ? ": " : ""), msg);
+ fmt = len ? ": %s" : "%s";
+ len += snprintf(buf+len, BUFSIZ-len, fmt, msg);
}
if (dOSSL == Qtrue){ /* show all errors on the stack */
while ((e = ERR_get_error()) != 0){
@@ -303,29 +307,7 @@ ossl_make_error(VALUE exc, const char *fmt, va_list args)
ERR_clear_error();
if(len > BUFSIZ) len = strlen(buf);
- return rb_exc_new(exc, buf, len);
-}
-
-void
-ossl_raise(VALUE exc, const char *fmt, ...)
-{
- va_list args;
- VALUE err;
- va_start(args, fmt);
- err = ossl_make_error(exc, fmt, args);
- va_end(args);
- rb_exc_raise(err);
-}
-
-VALUE
-ossl_exc_new(VALUE exc, const char *fmt, ...)
-{
- va_list args;
- VALUE err;
- va_start(args, fmt);
- err = ossl_make_error(exc, fmt, args);
- va_end(args);
- return err;
+ rb_exc_raise(rb_exc_new(exc, buf, len));
}
/*
@@ -464,7 +446,7 @@ Init_openssl()
/*
* Verify callback Proc index for ext-data
*/
- if ((ossl_verify_cb_idx = X509_STORE_CTX_get_ex_new_index(0, (void *)"ossl_verify_cb_idx", 0, 0, 0)) < 0)
+ if ((ossl_verify_cb_idx = X509_STORE_CTX_get_ex_new_index(0, "ossl_verify_cb_idx", 0, 0, 0)) < 0)
ossl_raise(eOSSLError, "X509_STORE_CTX_get_ex_new_index");
/*
@@ -506,7 +488,7 @@ Init_openssl()
* Check if all symbols are OK with 'make LDSHARED=gcc all'
*/
int
-main(int argc, char *argv[])
+main(int argc, char *argv[], char *env[])
{
return 0;
}
diff --git a/ext/openssl/ossl.h b/ext/openssl/ossl.h
index 9ac1525085..3cc30ae2e8 100644
--- a/ext/openssl/ossl.h
+++ b/ext/openssl/ossl.h
@@ -29,7 +29,7 @@ extern "C" {
# undef RFILE
#endif
#include <ruby.h>
-#include <ruby/io.h>
+#include <rubyio.h>
/*
* Check the OpenSSL version
@@ -46,7 +46,11 @@ extern "C" {
#if defined(_WIN32)
# define OSSL_NO_CONF_API 1
-# include <winsock2.h>
+# ifdef USE_WINSOCK2
+# include <winsock2.h>
+# else
+# include <winsock.h>
+# endif
#endif
#include <errno.h>
#include <openssl/err.h>
@@ -106,7 +110,7 @@ extern VALUE eOSSLError;
/*
* String to HEXString conversion
*/
-int string2hex(const unsigned char *, int, char **, int *);
+int string2hex(char *, int, char **, int *);
/*
* Data Conversion
@@ -135,7 +139,6 @@ int ossl_pem_passwd_cb(char *, int, int, void *);
*/
#define OSSL_ErrMsg() ERR_reason_error_string(ERR_get_error())
NORETURN(void ossl_raise(VALUE, const char *, ...));
-VALUE ossl_exc_new(VALUE, const char *, ...);
/*
* Verify callback
@@ -164,10 +167,10 @@ VALUE ossl_to_der_if_possible(VALUE);
extern VALUE dOSSL;
#if defined(HAVE_VA_ARGS_MACRO)
-#define OSSL_Debug(...) do { \
+#define OSSL_Debug(fmt, ...) do { \
if (dOSSL == Qtrue) { \
fprintf(stderr, "OSSL_DEBUG: "); \
- fprintf(stderr, __VA_ARGS__); \
+ fprintf(stderr, fmt, ##__VA_ARGS__); \
fprintf(stderr, " [%s:%d]\n", __FILE__, __LINE__); \
} \
} while (0)
diff --git a/ext/openssl/ossl_asn1.c b/ext/openssl/ossl_asn1.c
index 6aff2b7e95..8ceea95021 100644
--- a/ext/openssl/ossl_asn1.c
+++ b/ext/openssl/ossl_asn1.c
@@ -33,7 +33,7 @@ asn1time_to_time(ASN1_TIME *time)
switch (time->type) {
case V_ASN1_UTCTIME:
- if (sscanf((const char *)time->data, "%2d%2d%2d%2d%2d%2dZ", &tm.tm_year, &tm.tm_mon,
+ if (sscanf(time->data, "%2d%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 UTCTIME format");
}
@@ -44,7 +44,7 @@ asn1time_to_time(ASN1_TIME *time)
}
break;
case V_ASN1_GENERALIZEDTIME:
- if (sscanf((const char *)time->data, "%4d%2d%2d%2d%2d%2dZ", &tm.tm_year, &tm.tm_mon,
+ if (sscanf(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" );
}
@@ -80,7 +80,7 @@ time_to_time_t(VALUE time)
VALUE
asn1str_to_str(ASN1_STRING *str)
{
- return rb_str_new((const char *)str->data, str->length);
+ return rb_str_new(str->data, str->length);
}
/*
@@ -214,7 +214,7 @@ obj_to_asn1bstr(VALUE obj, long unused_bits)
StringValue(obj);
if(!(bstr = ASN1_BIT_STRING_new()))
ossl_raise(eASN1Error, NULL);
- ASN1_BIT_STRING_set(bstr, (unsigned char *)RSTRING_PTR(obj), RSTRING_LEN(obj));
+ ASN1_BIT_STRING_set(bstr, RSTRING_PTR(obj), RSTRING_LEN(obj));
bstr->flags &= ~(ASN1_STRING_FLAG_BITS_LEFT|0x07); /* clear */
bstr->flags |= ASN1_STRING_FLAG_BITS_LEFT|(unused_bits&0x07);
@@ -306,21 +306,21 @@ obj_to_asn1derstr(VALUE obj)
static VALUE
decode_bool(unsigned char* der, int length)
{
- int val;
- const unsigned char *p;
+ int bool;
+ unsigned char *p;
p = der;
- if((val = d2i_ASN1_BOOLEAN(NULL, &p, length)) < 0)
+ if((bool = d2i_ASN1_BOOLEAN(NULL, &p, length)) < 0)
ossl_raise(eASN1Error, NULL);
- return val ? Qtrue : Qfalse;
+ return bool ? Qtrue : Qfalse;
}
static VALUE
decode_int(unsigned char* der, int length)
{
ASN1_INTEGER *ai;
- const unsigned char *p;
+ unsigned char *p;
VALUE ret;
int status = 0;
@@ -339,7 +339,7 @@ static VALUE
decode_bstr(unsigned char* der, int length, long *unused_bits)
{
ASN1_BIT_STRING *bstr;
- const unsigned char *p;
+ unsigned char *p, *buf;
long len;
VALUE ret;
@@ -347,11 +347,16 @@ decode_bstr(unsigned char* der, int length, long *unused_bits)
if(!(bstr = d2i_ASN1_BIT_STRING(NULL, &p, length)))
ossl_raise(eASN1Error, NULL);
len = bstr->length;
+ if(!(buf = OPENSSL_malloc(len))){
+ ASN1_BIT_STRING_free(bstr);
+ ossl_raise(eASN1Error, NULL);
+ }
*unused_bits = 0;
if(bstr->flags & ASN1_STRING_FLAG_BITS_LEFT)
*unused_bits = bstr->flags & 0x07;
- ret = rb_str_new((const char *)bstr->data, len);
+ memcpy(buf, bstr->data, len);
ASN1_BIT_STRING_free(bstr);
+ ret = ossl_buf2str(buf, len);
return ret;
}
@@ -360,7 +365,7 @@ static VALUE
decode_enum(unsigned char* der, int length)
{
ASN1_ENUMERATED *ai;
- const unsigned char *p;
+ unsigned char *p;
VALUE ret;
int status = 0;
@@ -379,7 +384,7 @@ static VALUE
decode_null(unsigned char* der, int length)
{
ASN1_NULL *null;
- const unsigned char *p;
+ unsigned char *p;
p = der;
if(!(null = d2i_ASN1_NULL(NULL, &p, length)))
@@ -393,7 +398,7 @@ static VALUE
decode_obj(unsigned char* der, int length)
{
ASN1_OBJECT *obj;
- const unsigned char *p;
+ unsigned char *p;
VALUE ret;
int nid;
BIO *bio;
@@ -422,7 +427,7 @@ static VALUE
decode_time(unsigned char* der, int length)
{
ASN1_TIME *time;
- const unsigned char *p;
+ unsigned char *p;
VALUE ret;
int status = 0;
@@ -495,7 +500,7 @@ ossl_asn1_get_asn1type(VALUE obj)
value = ossl_asn1_get_value(obj);
switch(tag){
case V_ASN1_BOOLEAN:
- ptr = (void*)(VALUE)obj_to_asn1bool(value);
+ ptr = (void*)obj_to_asn1bool(value);
free_func = NULL;
break;
case V_ASN1_INTEGER: /* FALLTHROUGH */
@@ -697,7 +702,7 @@ ossl_asn1data_to_der(VALUE self)
if((length = ASN1_object_size(1, RSTRING_LEN(value), tag)) <= 0)
ossl_raise(eASN1Error, NULL);
der = rb_str_new(0, length);
- p = (unsigned char *)RSTRING_PTR(der);
+ p = RSTRING_PTR(der);
ASN1_put_object(&p, is_cons, RSTRING_LEN(value), tag, tag_class);
memcpy(p, RSTRING_PTR(value), RSTRING_LEN(value));
p += RSTRING_LEN(value);
@@ -711,7 +716,6 @@ ossl_asn1_decode0(unsigned char **pp, long length, long *offset, long depth,
int once, int yield)
{
unsigned char *start, *p;
- const unsigned char *p0;
long len, off = *offset;
int hlen, tag, tc, j;
VALUE ary, asn1data, value, tag_class;
@@ -720,9 +724,7 @@ ossl_asn1_decode0(unsigned char **pp, long length, long *offset, long depth,
p = *pp;
while(length > 0){
start = p;
- p0 = p;
- j = ASN1_get_object(&p0, &len, &tag, &tc, length);
- p = (unsigned char *)p0;
+ j = ASN1_get_object(&p, &len, &tag, &tc, length);
if(j & 0x80) ossl_raise(eASN1Error, NULL);
hlen = p - start;
if(yield){
@@ -757,7 +759,7 @@ ossl_asn1_decode0(unsigned char **pp, long length, long *offset, long depth,
else value = ossl_asn1_decode0(&p, len, &off, depth+1, 0, yield);
}
else{
- value = rb_str_new((const char *)p, len);
+ value = rb_str_new(p, len);
p += len;
off += len;
}
@@ -822,7 +824,7 @@ ossl_asn1_traverse(VALUE self, VALUE obj)
obj = ossl_to_der_if_possible(obj);
tmp = rb_str_new4(StringValue(obj));
- p = (unsigned char *)RSTRING_PTR(tmp);
+ p = RSTRING_PTR(tmp);
ossl_asn1_decode0(&p, RSTRING_LEN(tmp), &offset, 0, 0, 1);
return Qnil;
@@ -838,7 +840,7 @@ ossl_asn1_decode(VALUE self, VALUE obj)
obj = ossl_to_der_if_possible(obj);
tmp = rb_str_new4(StringValue(obj));
- p = (unsigned char *)RSTRING_PTR(tmp);
+ p = RSTRING_PTR(tmp);
ary = ossl_asn1_decode0(&p, RSTRING_LEN(tmp), &offset, 0, 1, 0);
ret = rb_ary_entry(ary, 0);
@@ -855,7 +857,7 @@ ossl_asn1_decode_all(VALUE self, VALUE obj)
obj = ossl_to_der_if_possible(obj);
tmp = rb_str_new4(StringValue(obj));
- p = (unsigned char *)RSTRING_PTR(tmp);
+ p = RSTRING_PTR(tmp);
ret = ossl_asn1_decode0(&p, RSTRING_LEN(tmp), &offset, 0, 0, 0);
return ret;
@@ -923,7 +925,7 @@ ossl_asn1prim_to_der(VALUE self)
{
ASN1_TYPE *asn1;
int tn, tc, explicit;
- long len, reallen;
+ long length, reallen;
unsigned char *buf, *p;
VALUE str;
@@ -932,25 +934,27 @@ ossl_asn1prim_to_der(VALUE self)
explicit = ossl_asn1_is_explicit(self);
asn1 = ossl_asn1_get_asn1type(self);
- len = ASN1_object_size(1, ossl_i2d_ASN1_TYPE(asn1, NULL), tn);
- if(!(buf = OPENSSL_malloc(len))){
+ length = ASN1_object_size(1, ossl_i2d_ASN1_TYPE(asn1, NULL), tn);
+ if(!(buf = OPENSSL_malloc(length))){
ossl_ASN1_TYPE_free(asn1);
ossl_raise(eASN1Error, "cannot alloc buffer");
}
p = buf;
- if (tc == V_ASN1_UNIVERSAL) {
- ossl_i2d_ASN1_TYPE(asn1, &p);
- } else if (explicit) {
- 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);
+ if(tc == V_ASN1_UNIVERSAL) ossl_i2d_ASN1_TYPE(asn1, &p);
+ else{
+ if(explicit){
+ 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);
+ }
}
ossl_ASN1_TYPE_free(asn1);
reallen = p - buf;
- assert(reallen <= len);
- str = ossl_buf2str((char *)buf, reallen); /* buf will be free in ossl_buf2str */
+ assert(reallen <= length);
+ str = ossl_buf2str(buf, reallen); /* buf will be free in ossl_buf2str */
return str;
}
@@ -972,7 +976,7 @@ ossl_asn1cons_to_der(VALUE self)
seq_len = ASN1_object_size(1, RSTRING_LEN(value), tag);
length = ASN1_object_size(1, seq_len, tn);
str = rb_str_new(0, length);
- p = (unsigned char *)RSTRING_PTR(str);
+ p = RSTRING_PTR(str);
if(tc == V_ASN1_UNIVERSAL)
ASN1_put_object(&p, 1, RSTRING_LEN(value), tn, tc);
else{
diff --git a/ext/openssl/ossl_bn.c b/ext/openssl/ossl_bn.c
index 6db9670bb7..6856476261 100644
--- a/ext/openssl/ossl_bn.c
+++ b/ext/openssl/ossl_bn.c
@@ -131,12 +131,12 @@ ossl_bn_initialize(int argc, VALUE *argv, VALUE self)
switch (base) {
case 0:
- if (!BN_mpi2bn((unsigned char *)RSTRING_PTR(str), RSTRING_LEN(str), bn)) {
+ if (!BN_mpi2bn(RSTRING_PTR(str), RSTRING_LEN(str), bn)) {
ossl_raise(eBNError, NULL);
}
break;
case 2:
- if (!BN_bin2bn((unsigned char *)RSTRING_PTR(str), RSTRING_LEN(str), bn)) {
+ if (!BN_bin2bn(RSTRING_PTR(str), RSTRING_LEN(str), bn)) {
ossl_raise(eBNError, NULL);
}
break;
@@ -151,7 +151,7 @@ ossl_bn_initialize(int argc, VALUE *argv, VALUE self)
}
break;
default:
- ossl_raise(rb_eArgError, "invalid radix %d", base);
+ ossl_raise(rb_eArgError, "illegal radix %d", base);
}
return self;
}
@@ -185,13 +185,13 @@ ossl_bn_to_s(int argc, VALUE *argv, VALUE self)
case 0:
len = BN_bn2mpi(bn, NULL);
str = rb_str_new(0, len);
- if (BN_bn2mpi(bn, (unsigned char *)RSTRING_PTR(str)) != len)
+ if (BN_bn2mpi(bn, RSTRING_PTR(str)) != len)
ossl_raise(eBNError, NULL);
break;
case 2:
len = BN_num_bytes(bn);
str = rb_str_new(0, len);
- if (BN_bn2bin(bn, (unsigned char *)RSTRING_PTR(str)) != len)
+ if (BN_bn2bin(bn, RSTRING_PTR(str)) != len)
ossl_raise(eBNError, NULL);
break;
case 10:
@@ -203,7 +203,7 @@ ossl_bn_to_s(int argc, VALUE *argv, VALUE self)
str = ossl_buf2str(buf, strlen(buf));
break;
default:
- ossl_raise(rb_eArgError, "invalid radix %d", base);
+ ossl_raise(rb_eArgError, "illegal radix %d", base);
}
return str;
@@ -272,9 +272,9 @@ ossl_bn_coerce(VALUE self, VALUE other)
} \
return Qfalse; \
}
-BIGNUM_BOOL1(is_zero)
-BIGNUM_BOOL1(is_one)
-BIGNUM_BOOL1(is_odd)
+BIGNUM_BOOL1(is_zero);
+BIGNUM_BOOL1(is_one);
+BIGNUM_BOOL1(is_odd);
#define BIGNUM_1c(func) \
/* \
@@ -298,7 +298,7 @@ BIGNUM_BOOL1(is_odd)
WrapBN(CLASS_OF(self), obj, result); \
return obj; \
}
-BIGNUM_1c(sqr)
+BIGNUM_1c(sqr);
#define BIGNUM_2(func) \
/* \
@@ -322,8 +322,8 @@ BIGNUM_1c(sqr)
WrapBN(CLASS_OF(self), obj, result); \
return obj; \
}
-BIGNUM_2(add)
-BIGNUM_2(sub)
+BIGNUM_2(add);
+BIGNUM_2(sub);
#define BIGNUM_2c(func) \
/* \
@@ -347,12 +347,12 @@ BIGNUM_2(sub)
WrapBN(CLASS_OF(self), obj, result); \
return obj; \
}
-BIGNUM_2c(mul)
-BIGNUM_2c(mod)
-BIGNUM_2c(exp)
-BIGNUM_2c(gcd)
-BIGNUM_2c(mod_sqr)
-BIGNUM_2c(mod_inverse)
+BIGNUM_2c(mul);
+BIGNUM_2c(mod);
+BIGNUM_2c(exp);
+BIGNUM_2c(gcd);
+BIGNUM_2c(mod_sqr);
+BIGNUM_2c(mod_inverse);
/*
* call-seq:
@@ -407,10 +407,10 @@ ossl_bn_div(VALUE self, VALUE other)
WrapBN(CLASS_OF(self), obj, result); \
return obj; \
}
-BIGNUM_3c(mod_add)
-BIGNUM_3c(mod_sub)
-BIGNUM_3c(mod_mul)
-BIGNUM_3c(mod_exp)
+BIGNUM_3c(mod_add);
+BIGNUM_3c(mod_sub);
+BIGNUM_3c(mod_mul);
+BIGNUM_3c(mod_exp);
#define BIGNUM_BIT(func) \
/* \
@@ -428,9 +428,9 @@ BIGNUM_3c(mod_exp)
} \
return self; \
}
-BIGNUM_BIT(set_bit)
-BIGNUM_BIT(clear_bit)
-BIGNUM_BIT(mask_bits)
+BIGNUM_BIT(set_bit);
+BIGNUM_BIT(clear_bit);
+BIGNUM_BIT(mask_bits);
/*
* call-seq:
@@ -474,8 +474,8 @@ ossl_bn_is_bit_set(VALUE self, VALUE bit)
WrapBN(CLASS_OF(self), obj, result); \
return obj; \
}
-BIGNUM_SHIFT(lshift)
-BIGNUM_SHIFT(rshift)
+BIGNUM_SHIFT(lshift);
+BIGNUM_SHIFT(rshift);
#define BIGNUM_SELF_SHIFT(func) \
/* \
@@ -494,8 +494,8 @@ BIGNUM_SHIFT(rshift)
ossl_raise(eBNError, NULL); \
return self; \
}
-BIGNUM_SELF_SHIFT(lshift)
-BIGNUM_SELF_SHIFT(rshift)
+BIGNUM_SELF_SHIFT(lshift);
+BIGNUM_SELF_SHIFT(rshift);
#define BIGNUM_RAND(func) \
/* \
@@ -528,8 +528,8 @@ BIGNUM_SELF_SHIFT(rshift)
WrapBN(klass, obj, result); \
return obj; \
}
-BIGNUM_RAND(rand)
-BIGNUM_RAND(pseudo_rand)
+BIGNUM_RAND(rand);
+BIGNUM_RAND(pseudo_rand);
#define BIGNUM_RAND_RANGE(func) \
/* \
@@ -552,8 +552,8 @@ BIGNUM_RAND(pseudo_rand)
WrapBN(klass, obj, result); \
return obj; \
}
-BIGNUM_RAND_RANGE(rand)
-BIGNUM_RAND_RANGE(pseudo_rand)
+BIGNUM_RAND_RANGE(rand);
+BIGNUM_RAND_RANGE(pseudo_rand);
/*
* call-seq:
@@ -608,8 +608,8 @@ ossl_bn_s_generate_prime(int argc, VALUE *argv, VALUE klass)
GetBN(self, bn); \
return INT2FIX(BN_##func(bn)); \
}
-BIGNUM_NUM(num_bytes)
-BIGNUM_NUM(num_bits)
+BIGNUM_NUM(num_bytes);
+BIGNUM_NUM(num_bits);
static VALUE
ossl_bn_copy(VALUE self, VALUE other)
@@ -642,8 +642,8 @@ ossl_bn_copy(VALUE self, VALUE other)
GetBN(self, bn1); \
return INT2FIX(BN_##func(bn1, bn2)); \
}
-BIGNUM_CMP(cmp)
-BIGNUM_CMP(ucmp)
+BIGNUM_CMP(cmp);
+BIGNUM_CMP(ucmp);
static VALUE
ossl_bn_eql(VALUE self, VALUE other)
diff --git a/ext/openssl/ossl_cipher.c b/ext/openssl/ossl_cipher.c
index df7856b6f0..b680dc6e64 100644
--- a/ext/openssl/ossl_cipher.c
+++ b/ext/openssl/ossl_cipher.c
@@ -67,7 +67,7 @@ ossl_cipher_free(EVP_CIPHER_CTX *ctx)
{
if (ctx) {
EVP_CIPHER_CTX_cleanup(ctx);
- ruby_xfree(ctx);
+ free(ctx);
}
}
@@ -124,16 +124,13 @@ ossl_cipher_copy(VALUE self, VALUE other)
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:
* Cipher.ciphers -> array[string...]
@@ -143,6 +140,7 @@ add_cipher_name_to_ary(const OBJ_NAME *name, VALUE ary)
static VALUE
ossl_s_ciphers(VALUE self)
{
+#ifdef HAVE_OBJ_NAME_DO_ALL_SORTED
VALUE ary;
ary = rb_ary_new();
@@ -151,10 +149,10 @@ ossl_s_ciphers(VALUE self)
(void*)ary);
return ary;
-}
#else
-#define ossl_s_ciphers rb_f_notimplement
+ rb_notimplement();
#endif
+}
/*
* call-seq:
@@ -188,7 +186,7 @@ ossl_cipher_init(int argc, VALUE *argv, VALUE self, int mode)
* We deprecated the arguments for this method, but we decided
* keeping this behaviour for backward compatibility.
*/
- const char *cname = rb_class2name(rb_obj_class(self));
+ char *cname = rb_class2name(rb_obj_class(self));
rb_warn("argumtents for %s#encrypt and %s#decrypt were deprecated; "
"use %s#pkcs5_keyivgen to derive key and IV",
cname, cname, cname);
@@ -204,7 +202,7 @@ ossl_cipher_init(int argc, VALUE *argv, VALUE self, int mode)
else memcpy(iv, RSTRING_PTR(init_v), sizeof(iv));
}
EVP_BytesToKey(EVP_CIPHER_CTX_cipher(ctx), EVP_md5(), iv,
- (unsigned char *)RSTRING_PTR(pass), RSTRING_LEN(pass), 1, key, NULL);
+ RSTRING_PTR(pass), RSTRING_LEN(pass), 1, key, NULL);
p_key = key;
p_iv = iv;
}
@@ -281,13 +279,13 @@ ossl_cipher_pkcs5_keyivgen(int argc, VALUE *argv, VALUE self)
StringValue(vsalt);
if(RSTRING_LEN(vsalt) != PKCS5_SALT_LEN)
rb_raise(eCipherError, "salt must be an 8-octet string");
- salt = (unsigned char *)RSTRING_PTR(vsalt);
+ salt = RSTRING_PTR(vsalt);
}
iter = NIL_P(viter) ? 2048 : NUM2INT(viter);
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_LEN(vpass), iter, key, iv);
+ RSTRING_PTR(vpass), RSTRING_LEN(vpass), iter, key, iv);
if (EVP_CipherInit_ex(ctx, NULL, NULL, key, iv, -1) != 1)
ossl_raise(eCipherError, NULL);
OPENSSL_cleanse(key, sizeof key);
@@ -299,6 +297,26 @@ ossl_cipher_pkcs5_keyivgen(int argc, VALUE *argv, VALUE self)
/*
* call-seq:
+ * cipher << data -> string
+ *
+ * === Parameters
+ * +data+ is a nonempty string.
+ *
+ * This method is deprecated and not available in 1.9.x or later.
+ */
+static VALUE
+ossl_cipher_update_deprecated(VALUE self, VALUE data)
+{
+ char *cname;
+
+ cname = rb_class2name(rb_obj_class(self));
+ rb_warning("%s#<< is deprecated; use %s#update instead", cname, cname);
+ return rb_funcall(self, rb_intern("update"), 1, data);
+}
+
+
+/*
+ * call-seq:
* cipher.update(data [, buffer]) -> string or buffer
*
* === Parameters
@@ -309,14 +327,14 @@ static VALUE
ossl_cipher_update(int argc, VALUE *argv, VALUE self)
{
EVP_CIPHER_CTX *ctx;
- unsigned char *in;
+ char *in;
int in_len, out_len;
VALUE data, str;
rb_scan_args(argc, argv, "11", &data, &str);
StringValue(data);
- in = (unsigned char *)RSTRING_PTR(data);
+ in = RSTRING_PTR(data);
if ((in_len = RSTRING_LEN(data)) == 0)
rb_raise(rb_eArgError, "data must not be empty");
GetCipher(self, ctx);
@@ -329,7 +347,7 @@ ossl_cipher_update(int argc, VALUE *argv, VALUE self)
rb_str_resize(str, out_len);
}
- if (!EVP_CipherUpdate(ctx, (unsigned char *)RSTRING_PTR(str), &out_len, in, in_len))
+ if (!EVP_CipherUpdate(ctx, RSTRING_PTR(str), &out_len, in, in_len))
ossl_raise(eCipherError, NULL);
assert(out_len < RSTRING_LEN(str));
rb_str_set_len(str, out_len);
@@ -354,7 +372,7 @@ ossl_cipher_final(VALUE self)
GetCipher(self, ctx);
str = rb_str_new(0, EVP_CIPHER_CTX_block_size(ctx));
- if (!EVP_CipherFinal_ex(ctx, (unsigned char *)RSTRING_PTR(str), &out_len))
+ if (!EVP_CipherFinal_ex(ctx, RSTRING_PTR(str), &out_len))
ossl_raise(eCipherError, NULL);
assert(out_len <= RSTRING_LEN(str));
rb_str_set_len(str, out_len);
@@ -397,7 +415,7 @@ ossl_cipher_set_key(VALUE self, VALUE key)
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)
+ if (EVP_CipherInit_ex(ctx, NULL, NULL, RSTRING_PTR(key), NULL, -1) != 1)
ossl_raise(eCipherError, NULL);
return key;
@@ -422,7 +440,7 @@ ossl_cipher_set_iv(VALUE self, VALUE iv)
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)
+ if (EVP_CipherInit_ex(ctx, NULL, NULL, NULL, RSTRING_PTR(iv), -1) != 1)
ossl_raise(eCipherError, NULL);
return iv;
@@ -453,7 +471,6 @@ 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
@@ -467,17 +484,18 @@ ossl_cipher_set_key_length(VALUE self, VALUE key_length)
static VALUE
ossl_cipher_set_padding(VALUE self, VALUE padding)
{
+#if defined(HAVE_EVP_CIPHER_CTX_SET_PADDING)
EVP_CIPHER_CTX *ctx;
int pad = NUM2INT(padding);
GetCipher(self, ctx);
if (EVP_CIPHER_CTX_set_padding(ctx, pad) != 1)
ossl_raise(eCipherError, NULL);
- return padding;
-}
#else
-#define ossl_cipher_set_padding rb_f_notimplement
+ rb_notimplement();
#endif
+ return padding;
+}
#define CIPHER_0ARG_INT(func) \
static VALUE \
@@ -533,6 +551,9 @@ Init_ossl_cipher(void)
rb_define_method(cCipher, "decrypt", ossl_cipher_decrypt, -1);
rb_define_method(cCipher, "pkcs5_keyivgen", ossl_cipher_pkcs5_keyivgen, -1);
rb_define_method(cCipher, "update", ossl_cipher_update, -1);
+#if RUBY_VERSION_CODE < 190
+ rb_define_method(cCipher, "<<", ossl_cipher_update_deprecated, 1);
+#endif
rb_define_method(cCipher, "final", ossl_cipher_final, 0);
rb_define_method(cCipher, "name", ossl_cipher_name, 0);
rb_define_method(cCipher, "key=", ossl_cipher_set_key, 1);
diff --git a/ext/openssl/ossl_config.c b/ext/openssl/ossl_config.c
index bbd4975031..cc8e324029 100644
--- a/ext/openssl/ossl_config.c
+++ b/ext/openssl/ossl_config.c
@@ -192,16 +192,6 @@ ossl_config_add_value(VALUE self, VALUE section, VALUE name, VALUE value)
#endif
}
-#if !defined(OSSL_NO_CONF_API)
-static VALUE
-ossl_config_add_value_m(VALUE self, VALUE section, VALUE name, VALUE value)
-{
- return ossl_config_add_value(self, section, name, value);
-}
-#else
-#define ossl_config_add_value_m rb_f_notimplement
-#endif
-
static VALUE
ossl_config_get_value(VALUE self, VALUE section, VALUE name)
{
@@ -310,7 +300,7 @@ get_conf_section(CONF_VALUE *cv, VALUE ary)
rb_ary_push(ary, rb_str_new2(cv->section));
}
-static IMPLEMENT_LHASH_DOALL_ARG_FN(get_conf_section, CONF_VALUE*, VALUE)
+static IMPLEMENT_LHASH_DOALL_ARG_FN(get_conf_section, CONF_VALUE*, VALUE);
static VALUE
ossl_config_get_sections(VALUE self)
@@ -348,7 +338,7 @@ dump_conf_value(CONF_VALUE *cv, VALUE str)
rb_str_cat2(str, "\n");
}
-static IMPLEMENT_LHASH_DOALL_ARG_FN(dump_conf_value, CONF_VALUE*, VALUE)
+static IMPLEMENT_LHASH_DOALL_ARG_FN(dump_conf_value, CONF_VALUE*, VALUE);
static VALUE
dump_conf(CONF *conf)
@@ -392,15 +382,13 @@ each_conf_value(CONF_VALUE *cv, void* dummy)
}
}
-static IMPLEMENT_LHASH_DOALL_ARG_FN(each_conf_value, CONF_VALUE*, void*)
+static IMPLEMENT_LHASH_DOALL_ARG_FN(each_conf_value, CONF_VALUE*, void*);
static VALUE
ossl_config_each(VALUE self)
{
CONF *conf;
- RETURN_ENUMERATOR(self, 0, 0);
-
GetConfig(self, conf);
lh_doall_arg(conf->data, LHASH_DOALL_ARG_FN(each_conf_value), (void*)NULL);
@@ -433,7 +421,7 @@ static VALUE
ossl_config_inspect(VALUE self)
{
VALUE str, ary = ossl_config_get_sections(self);
- const char *cname = rb_class2name(rb_obj_class(self));
+ char *cname = rb_class2name(rb_obj_class(self));
str = rb_str_new2("#<");
rb_str_cat2(str, cname);
@@ -450,14 +438,11 @@ ossl_config_inspect(VALUE self)
void
Init_ossl_config()
{
- char *default_config_file;
eConfigError = rb_define_class_under(mOSSL, "ConfigError", eOSSLError);
cConfig = rb_define_class_under(mOSSL, "Config", rb_cObject);
- default_config_file = CONF_get1_default_config_file();
rb_define_const(cConfig, "DEFAULT_CONFIG_FILE",
- rb_str_new2(default_config_file));
- OPENSSL_free(default_config_file);
+ rb_str_new2(CONF_get1_default_config_file()));
rb_include_module(cConfig, rb_mEnumerable);
rb_define_singleton_method(cConfig, "parse", ossl_config_s_parse, 1);
rb_define_alias(CLASS_OF(cConfig), "load", "new");
@@ -466,7 +451,7 @@ Init_ossl_config()
rb_define_method(cConfig, "initialize", ossl_config_initialize, -1);
rb_define_method(cConfig, "get_value", ossl_config_get_value, 2);
rb_define_method(cConfig, "value", ossl_config_get_value_old, -1);
- rb_define_method(cConfig, "add_value", ossl_config_add_value_m, 3);
+ rb_define_method(cConfig, "add_value", ossl_config_add_value, 3);
rb_define_method(cConfig, "[]", ossl_config_get_section, 1);
rb_define_method(cConfig, "section", ossl_config_get_section_old, 1);
rb_define_method(cConfig, "[]=", ossl_config_set_section, 2);
diff --git a/ext/openssl/ossl_digest.c b/ext/openssl/ossl_digest.c
index 9b8ced5233..879d399fe7 100644
--- a/ext/openssl/ossl_digest.c
+++ b/ext/openssl/ossl_digest.c
@@ -38,7 +38,7 @@ GetDigestPtr(VALUE obj)
const EVP_MD *md;
if (TYPE(obj) == T_STRING) {
- const char *name = StringValueCStr(obj);
+ const char *name = STR2CSTR(obj);
md = EVP_get_digestbyname(name);
if (!md)
@@ -96,6 +96,7 @@ ossl_digest_initialize(int argc, VALUE *argv, VALUE self)
{
EVP_MD_CTX *ctx;
const EVP_MD *md;
+ char *name;
VALUE type, data;
rb_scan_args(argc, argv, "11", &type, &data);
@@ -181,7 +182,7 @@ ossl_digest_finish(int argc, VALUE *argv, VALUE self)
rb_str_resize(str, EVP_MD_CTX_size(ctx));
}
- EVP_DigestFinal_ex(ctx, (unsigned char *)RSTRING_PTR(str), NULL);
+ EVP_DigestFinal_ex(ctx, RSTRING_PTR(str), NULL);
return str;
}
@@ -233,6 +234,7 @@ ossl_digest_block_length(VALUE self)
void
Init_ossl_digest()
{
+ rb_require("openssl");
rb_require("digest");
#if 0 /* let rdoc know about mOSSL */
diff --git a/ext/openssl/ossl_engine.c b/ext/openssl/ossl_engine.c
index ec6f7fdf96..cd835d1237 100644
--- a/ext/openssl/ossl_engine.c
+++ b/ext/openssl/ossl_engine.c
@@ -119,7 +119,7 @@ ossl_engine_s_by_id(VALUE klass, VALUE id)
if(!ENGINE_init(e))
ossl_raise(eEngineError, NULL);
ENGINE_ctrl(e, ENGINE_CTRL_SET_PASSWORD_CALLBACK,
- 0, NULL, (void(*)(void))ossl_pem_passwd_cb);
+ 0, NULL, (void(*)())ossl_pem_passwd_cb);
ERR_clear_error();
return obj;
@@ -166,10 +166,10 @@ ossl_engine_finish(VALUE self)
return Qnil;
}
-#if defined(HAVE_ENGINE_GET_CIPHER)
static VALUE
ossl_engine_get_cipher(VALUE self, VALUE name)
{
+#if defined(HAVE_ENGINE_GET_CIPHER)
ENGINE *e;
const EVP_CIPHER *ciph, *tmp;
char *s;
@@ -184,15 +184,15 @@ ossl_engine_get_cipher(VALUE self, VALUE name)
if(!ciph) ossl_raise(eEngineError, NULL);
return ossl_cipher_new(ciph);
-}
#else
-#define ossl_engine_get_cipher rb_f_notimplement
+ rb_notimplement();
#endif
+}
-#if defined(HAVE_ENGINE_GET_DIGEST)
static VALUE
ossl_engine_get_digest(VALUE self, VALUE name)
{
+#if defined(HAVE_ENGINE_GET_DIGEST)
ENGINE *e;
const EVP_MD *md, *tmp;
char *s;
@@ -207,10 +207,10 @@ ossl_engine_get_digest(VALUE self, VALUE name)
if(!md) ossl_raise(eEngineError, NULL);
return ossl_digest_new(md);
-}
#else
-#define ossl_engine_get_digest rb_f_notimplement
+ rb_notimplement();
#endif
+}
static VALUE
ossl_engine_load_privkey(int argc, VALUE *argv, VALUE self)
@@ -326,7 +326,7 @@ static VALUE
ossl_engine_inspect(VALUE self)
{
VALUE str;
- const char *cname = rb_class2name(rb_obj_class(self));
+ char *cname = rb_class2name(rb_obj_class(self));
str = rb_str_new2("#<");
rb_str_cat2(str, cname);
diff --git a/ext/openssl/ossl_hmac.c b/ext/openssl/ossl_hmac.c
index aa7644aa5c..ef77d6c427 100644
--- a/ext/openssl/ossl_hmac.c
+++ b/ext/openssl/ossl_hmac.c
@@ -42,7 +42,7 @@ static void
ossl_hmac_free(HMAC_CTX *ctx)
{
HMAC_CTX_cleanup(ctx);
- ruby_xfree(ctx);
+ free(ctx);
}
static VALUE
@@ -103,13 +103,13 @@ ossl_hmac_update(VALUE self, VALUE data)
StringValue(data);
GetHMAC(self, ctx);
- HMAC_Update(ctx, (unsigned char *)RSTRING_PTR(data), RSTRING_LEN(data));
+ HMAC_Update(ctx, RSTRING_PTR(data), RSTRING_LEN(data));
return self;
}
static void
-hmac_final(HMAC_CTX *ctx, unsigned char **buf, unsigned int *buf_len)
+hmac_final(HMAC_CTX *ctx, char **buf, int *buf_len)
{
HMAC_CTX final;
@@ -132,13 +132,13 @@ static VALUE
ossl_hmac_digest(VALUE self)
{
HMAC_CTX *ctx;
- unsigned char *buf;
- unsigned int buf_len;
+ char *buf;
+ int buf_len;
VALUE digest;
GetHMAC(self, ctx);
hmac_final(ctx, &buf, &buf_len);
- digest = ossl_buf2str((char *)buf, buf_len);
+ digest = ossl_buf2str(buf, buf_len);
return digest;
}
@@ -152,9 +152,8 @@ static VALUE
ossl_hmac_hexdigest(VALUE self)
{
HMAC_CTX *ctx;
- unsigned char *buf;
- char *hexbuf;
- unsigned int buf_len;
+ char *buf, *hexbuf;
+ int buf_len;
VALUE hexdigest;
GetHMAC(self, ctx);
@@ -193,15 +192,15 @@ ossl_hmac_reset(VALUE self)
static VALUE
ossl_hmac_s_digest(VALUE klass, VALUE digest, VALUE key, VALUE data)
{
- unsigned char *buf;
- unsigned int buf_len;
+ char *buf;
+ int buf_len;
StringValue(key);
StringValue(data);
buf = HMAC(GetDigestPtr(digest), RSTRING_PTR(key), RSTRING_LEN(key),
- (unsigned char *)RSTRING_PTR(data), RSTRING_LEN(data), NULL, &buf_len);
+ RSTRING_PTR(data), RSTRING_LEN(data), NULL, &buf_len);
- return rb_str_new((const char *)buf, buf_len);
+ return rb_str_new(buf, buf_len);
}
/*
@@ -212,16 +211,15 @@ ossl_hmac_s_digest(VALUE klass, VALUE digest, VALUE key, VALUE data)
static VALUE
ossl_hmac_s_hexdigest(VALUE klass, VALUE digest, VALUE key, VALUE data)
{
- unsigned char *buf;
- char *hexbuf;
- unsigned int buf_len;
+ char *buf, *hexbuf;
+ int buf_len;
VALUE hexdigest;
StringValue(key);
StringValue(data);
buf = HMAC(GetDigestPtr(digest), RSTRING_PTR(key), RSTRING_LEN(key),
- (unsigned char *)RSTRING_PTR(data), RSTRING_LEN(data), NULL, &buf_len);
+ RSTRING_PTR(data), RSTRING_LEN(data), NULL, &buf_len);
if (string2hex(buf, buf_len, &hexbuf, NULL) != 2 * buf_len) {
ossl_raise(eHMACError, "Cannot convert buf to hexbuf");
}
diff --git a/ext/openssl/ossl_ns_spki.c b/ext/openssl/ossl_ns_spki.c
index 5ff58c3108..738a203d93 100644
--- a/ext/openssl/ossl_ns_spki.c
+++ b/ext/openssl/ossl_ns_spki.c
@@ -56,14 +56,14 @@ ossl_spki_initialize(int argc, VALUE *argv, VALUE self)
{
NETSCAPE_SPKI *spki;
VALUE buffer;
- const unsigned char *p;
+ unsigned char *p;
if (rb_scan_args(argc, argv, "01", &buffer) == 0) {
return self;
}
StringValue(buffer);
if (!(spki = NETSCAPE_SPKI_b64_decode(RSTRING_PTR(buffer), -1))) {
- p = (unsigned char *)RSTRING_PTR(buffer);
+ p = RSTRING_PTR(buffer);
if (!(spki = d2i_NETSCAPE_SPKI(NULL, &p, RSTRING_LEN(buffer)))) {
ossl_raise(eSPKIError, NULL);
}
@@ -87,7 +87,7 @@ ossl_spki_to_der(VALUE self)
if ((len = i2d_NETSCAPE_SPKI(spki, NULL)) <= 0)
ossl_raise(eX509CertError, NULL);
str = rb_str_new(0, len);
- p = (unsigned char *)RSTRING_PTR(str);
+ p = RSTRING_PTR(str);
if (i2d_NETSCAPE_SPKI(spki, &p) <= 0)
ossl_raise(eX509CertError, NULL);
ossl_str_adjust(str, p);
@@ -172,7 +172,7 @@ ossl_spki_get_challenge(VALUE self)
return rb_str_new(0, 0);
}
- return rb_str_new((const char *)spki->spkac->challenge->data,
+ return rb_str_new(spki->spkac->challenge->data,
spki->spkac->challenge->length);
}
diff --git a/ext/openssl/ossl_ocsp.c b/ext/openssl/ossl_ocsp.c
index a658c0180a..6365f08134 100644
--- a/ext/openssl/ossl_ocsp.c
+++ b/ext/openssl/ossl_ocsp.c
@@ -103,17 +103,15 @@ static VALUE
ossl_ocspreq_initialize(int argc, VALUE *argv, VALUE self)
{
VALUE arg;
- const unsigned char *p;
+ unsigned char *p;
rb_scan_args(argc, argv, "01", &arg);
if(!NIL_P(arg)){
- OCSP_REQUEST *req = DATA_PTR(self), *x;
arg = ossl_to_der_if_possible(arg);
StringValue(arg);
p = (unsigned char*)RSTRING_PTR(arg);
- x = d2i_OCSP_REQUEST(&req, &p, RSTRING_LEN(arg));
- DATA_PTR(self) = req;
- if(!x){
+ if(!d2i_OCSP_REQUEST((OCSP_REQUEST**)&DATA_PTR(self), &p,
+ RSTRING_LEN(arg))){
ossl_raise(eOCSPError, "cannot load DER encoded request");
}
}
@@ -136,7 +134,7 @@ ossl_ocspreq_add_nonce(int argc, VALUE *argv, VALUE self)
else{
StringValue(val);
GetOCSPReq(self, req);
- ret = OCSP_request_add1_nonce(req, (unsigned char *)RSTRING_PTR(val), RSTRING_LEN(val));
+ ret = OCSP_request_add1_nonce(req, RSTRING_PTR(val), RSTRING_LEN(val));
}
if(!ret) ossl_raise(eOCSPError, NULL);
@@ -267,7 +265,7 @@ ossl_ocspreq_to_der(VALUE self)
if((len = i2d_OCSP_REQUEST(req, NULL)) <= 0)
ossl_raise(eOCSPError, NULL);
str = rb_str_new(0, len);
- p = (unsigned char *)RSTRING_PTR(str);
+ p = RSTRING_PTR(str);
if(i2d_OCSP_REQUEST(req, &p) <= 0)
ossl_raise(eOCSPError, NULL);
ossl_str_adjust(str, p);
@@ -312,17 +310,15 @@ static VALUE
ossl_ocspres_initialize(int argc, VALUE *argv, VALUE self)
{
VALUE arg;
- const unsigned char *p;
+ unsigned char *p;
rb_scan_args(argc, argv, "01", &arg);
if(!NIL_P(arg)){
- OCSP_RESPONSE *res = DATA_PTR(self), *x;
arg = ossl_to_der_if_possible(arg);
StringValue(arg);
- p = (unsigned char *)RSTRING_PTR(arg);
- x = d2i_OCSP_RESPONSE(&res, &p, RSTRING_LEN(arg));
- DATA_PTR(self) = res;
- if(!x){
+ p = RSTRING_PTR(arg);
+ if(!d2i_OCSP_RESPONSE((OCSP_RESPONSE**)&DATA_PTR(self), &p,
+ RSTRING_LEN(arg))){
ossl_raise(eOCSPError, "cannot load DER encoded response");
}
}
@@ -381,7 +377,7 @@ ossl_ocspres_to_der(VALUE self)
if((len = i2d_OCSP_RESPONSE(res, NULL)) <= 0)
ossl_raise(eOCSPError, NULL);
str = rb_str_new(0, len);
- p = (unsigned char *)RSTRING_PTR(str);
+ p = RSTRING_PTR(str);
if(i2d_OCSP_RESPONSE(res, NULL) <= 0)
ossl_raise(eOCSPError, NULL);
ossl_str_adjust(str, p);
@@ -440,7 +436,7 @@ ossl_ocspbres_add_nonce(int argc, VALUE *argv, VALUE self)
else{
StringValue(val);
GetOCSPBasicRes(self, bs);
- ret = OCSP_basic_add1_nonce(bs, (unsigned char *)RSTRING_PTR(val), RSTRING_LEN(val));
+ ret = OCSP_basic_add1_nonce(bs, RSTRING_PTR(val), RSTRING_LEN(val));
}
if(!ret) ossl_raise(eOCSPError, NULL);
diff --git a/ext/openssl/ossl_pkcs12.c b/ext/openssl/ossl_pkcs12.c
index a58d5e05e8..2ec69ba8db 100644
--- a/ext/openssl/ossl_pkcs12.c
+++ b/ext/openssl/ossl_pkcs12.c
@@ -137,17 +137,15 @@ ossl_pkcs12_initialize(int argc, VALUE *argv, VALUE self)
X509 *x509;
STACK_OF(X509) *x509s = NULL;
int st = 0;
- PKCS12 *pkcs = DATA_PTR(self);
if(rb_scan_args(argc, argv, "02", &arg, &pass) == 0) return self;
passphrase = NIL_P(pass) ? NULL : StringValuePtr(pass);
in = ossl_obj2bio(arg);
- d2i_PKCS12_bio(in, &pkcs);
- DATA_PTR(self) = pkcs;
+ d2i_PKCS12_bio(in, (PKCS12 **)&DATA_PTR(self));
BIO_free(in);
pkey = cert = ca = Qnil;
- if(!PKCS12_parse(pkcs, passphrase, &key, &x509, &x509s))
+ if(!PKCS12_parse((PKCS12*)DATA_PTR(self), passphrase, &key, &x509, &x509s))
ossl_raise(ePKCS12Error, "PKCS12_parse");
pkey = rb_protect((VALUE(*)_((VALUE)))ossl_pkey_new, (VALUE)key,
&st); /* NO DUP */
@@ -183,7 +181,7 @@ ossl_pkcs12_to_der(VALUE self)
if((len = i2d_PKCS12(p12, NULL)) <= 0)
ossl_raise(ePKCS12Error, NULL);
str = rb_str_new(0, len);
- p = (unsigned char *)RSTRING_PTR(str);
+ p = RSTRING_PTR(str);
if(i2d_PKCS12(p12, &p) <= 0)
ossl_raise(ePKCS12Error, NULL);
ossl_str_adjust(str, p);
diff --git a/ext/openssl/ossl_pkcs5.c b/ext/openssl/ossl_pkcs5.c
index 18d166d1ca..007889fc94 100644
--- a/ext/openssl/ossl_pkcs5.c
+++ b/ext/openssl/ossl_pkcs5.c
@@ -7,7 +7,6 @@
VALUE mPKCS5;
VALUE ePKCS5;
-#ifdef HAVE_PKCS5_PBKDF2_HMAC
/*
* call-seq:
* PKCS5.pbkdf2_hmac(pass, salt, iter, keylen, digest) => string
@@ -26,6 +25,7 @@ VALUE ePKCS5;
static VALUE
ossl_pkcs5_pbkdf2_hmac(VALUE self, VALUE pass, VALUE salt, VALUE iter, VALUE keylen, VALUE digest)
{
+#ifdef HAVE_PKCS5_PBKDF2_HMAC
VALUE str;
const EVP_MD *md;
int len = NUM2INT(keylen);
@@ -40,13 +40,12 @@ ossl_pkcs5_pbkdf2_hmac(VALUE self, VALUE pass, VALUE salt, VALUE iter, VALUE key
ossl_raise(ePKCS5, "PKCS5_PBKDF2_HMAC");
return str;
-}
#else
-#define ossl_pkcs5_pbkdf2_hmac rb_f_notimplement
+ rb_notimplement();
#endif
+}
-#ifdef HAVE_PKCS5_PBKDF2_HMAC_SHA1
/*
* call-seq:
* PKCS5.pbkdf2_hmac_sha1(pass, salt, iter, keylen) => string
@@ -64,6 +63,7 @@ ossl_pkcs5_pbkdf2_hmac(VALUE self, VALUE pass, VALUE salt, VALUE iter, VALUE key
static VALUE
ossl_pkcs5_pbkdf2_hmac_sha1(VALUE self, VALUE pass, VALUE salt, VALUE iter, VALUE keylen)
{
+#ifdef HAVE_PKCS5_PBKDF2_HMAC_SHA1
VALUE str;
int len = NUM2INT(keylen);
@@ -72,16 +72,14 @@ ossl_pkcs5_pbkdf2_hmac_sha1(VALUE self, VALUE pass, VALUE salt, VALUE iter, VALU
str = rb_str_new(0, len);
- if (PKCS5_PBKDF2_HMAC_SHA1(RSTRING_PTR(pass), RSTRING_LEN(pass),
- (const unsigned char *)RSTRING_PTR(salt), RSTRING_LEN(salt), NUM2INT(iter),
- len, (unsigned char *)RSTRING_PTR(str)) != 1)
+ if (PKCS5_PBKDF2_HMAC_SHA1(RSTRING_PTR(pass), RSTRING_LEN(pass), RSTRING_PTR(salt), RSTRING_LEN(salt), NUM2INT(iter), len, RSTRING_PTR(str)) != 1)
ossl_raise(ePKCS5, "PKCS5_PBKDF2_HMAC_SHA1");
return str;
-}
#else
-#define ossl_pkcs5_pbkdf2_hmac_sha1 rb_f_notimplement
+ rb_notimplement();
#endif
+}
void
Init_ossl_pkcs5()
diff --git a/ext/openssl/ossl_pkcs7.c b/ext/openssl/ossl_pkcs7.c
index fe1ef7c5de..6918844779 100644
--- a/ext/openssl/ossl_pkcs7.c
+++ b/ext/openssl/ossl_pkcs7.c
@@ -309,7 +309,7 @@ ossl_pkcs7_alloc(VALUE klass)
static VALUE
ossl_pkcs7_initialize(int argc, VALUE *argv, VALUE self)
{
- PKCS7 *p7, *pkcs = DATA_PTR(self);
+ PKCS7 *p7;
BIO *in;
VALUE arg;
@@ -317,12 +317,10 @@ ossl_pkcs7_initialize(int argc, VALUE *argv, VALUE self)
return self;
arg = ossl_to_der_if_possible(arg);
in = ossl_obj2bio(arg);
- p7 = PEM_read_bio_PKCS7(in, &pkcs, NULL, NULL);
- DATA_PTR(self) = pkcs;
+ p7 = PEM_read_bio_PKCS7(in, (PKCS7 **)&DATA_PTR(self), NULL, NULL);
if (!p7) {
- (void)BIO_reset(in);
- p7 = d2i_PKCS7_bio(in, &pkcs);
- DATA_PTR(self) = pkcs;
+ BIO_reset(in);
+ p7 = d2i_PKCS7_bio(in, (PKCS7 **)&DATA_PTR(self));
}
BIO_free(in);
ossl_pkcs7_set_data(self, Qnil);
@@ -780,7 +778,7 @@ ossl_pkcs7_to_der(VALUE self)
if((len = i2d_PKCS7(pkcs7, NULL)) <= 0)
ossl_raise(ePKCS7Error, NULL);
str = rb_str_new(0, len);
- p = (unsigned char *)RSTRING_PTR(str);
+ p = RSTRING_PTR(str);
if(i2d_PKCS7(pkcs7, &p) <= 0)
ossl_raise(ePKCS7Error, NULL);
ossl_str_adjust(str, p);
diff --git a/ext/openssl/ossl_pkey.c b/ext/openssl/ossl_pkey.c
index 903a3bb1e5..b295cfc25e 100644
--- a/ext/openssl/ossl_pkey.c
+++ b/ext/openssl/ossl_pkey.c
@@ -164,7 +164,7 @@ ossl_pkey_sign(VALUE self, VALUE digest, VALUE data)
{
EVP_PKEY *pkey;
EVP_MD_CTX ctx;
- unsigned int buf_len;
+ int buf_len;
VALUE str;
if (rb_funcall(self, id_private_q, 0, NULL) != Qtrue) {
@@ -175,9 +175,9 @@ ossl_pkey_sign(VALUE self, VALUE digest, VALUE data)
StringValue(data);
EVP_SignUpdate(&ctx, RSTRING_PTR(data), RSTRING_LEN(data));
str = rb_str_new(0, EVP_PKEY_size(pkey)+16);
- if (!EVP_SignFinal(&ctx, (unsigned char *)RSTRING_PTR(str), &buf_len, pkey))
+ if (!EVP_SignFinal(&ctx, RSTRING_PTR(str), &buf_len, pkey))
ossl_raise(ePKeyError, NULL);
- assert((long)buf_len <= RSTRING_LEN(str));
+ assert(buf_len <= RSTRING_LEN(str));
rb_str_set_len(str, buf_len);
return str;
@@ -194,7 +194,7 @@ ossl_pkey_verify(VALUE self, VALUE digest, VALUE sig, VALUE data)
StringValue(sig);
StringValue(data);
EVP_VerifyUpdate(&ctx, RSTRING_PTR(data), RSTRING_LEN(data));
- switch (EVP_VerifyFinal(&ctx, (unsigned char *)RSTRING_PTR(sig), RSTRING_LEN(sig), pkey)) {
+ switch (EVP_VerifyFinal(&ctx, RSTRING_PTR(sig), RSTRING_LEN(sig), pkey)) {
case 0:
return Qfalse;
case 1:
diff --git a/ext/openssl/ossl_pkey_dh.c b/ext/openssl/ossl_pkey_dh.c
index 768cda86b7..02c3d99ed8 100644
--- a/ext/openssl/ossl_pkey_dh.c
+++ b/ext/openssl/ossl_pkey_dh.c
@@ -169,7 +169,7 @@ ossl_dh_initialize(int argc, VALUE *argv, VALUE self)
in = ossl_obj2bio(arg);
dh = PEM_read_bio_DHparams(in, NULL, NULL, NULL);
if (!dh){
- (void)BIO_reset(in);
+ BIO_reset(in);
dh = d2i_DHparams_bio(in, NULL);
}
BIO_free(in);
@@ -254,7 +254,7 @@ ossl_dh_to_der(VALUE self)
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);
+ p = RSTRING_PTR(str);
if(i2d_DHparams(pkey->pkey.dh, &p) < 0)
ossl_raise(eDHError, NULL);
ossl_str_adjust(str, p);
@@ -407,7 +407,7 @@ ossl_dh_compute_key(VALUE self, VALUE pub)
pub_key = GetBNPtr(pub);
len = DH_size(dh);
str = rb_str_new(0, len);
- if ((len = DH_compute_key((unsigned char *)RSTRING_PTR(str), pub_key, dh)) < 0) {
+ if ((len = DH_compute_key(RSTRING_PTR(str), pub_key, dh)) < 0) {
ossl_raise(eDHError, NULL);
}
rb_str_set_len(str, len);
@@ -415,10 +415,10 @@ 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)
+OSSL_PKEY_BN(dh, p);
+OSSL_PKEY_BN(dh, g);
+OSSL_PKEY_BN(dh, pub_key);
+OSSL_PKEY_BN(dh, priv_key);
/*
* -----BEGIN DH PARAMETERS-----
diff --git a/ext/openssl/ossl_pkey_dsa.c b/ext/openssl/ossl_pkey_dsa.c
index d39933b754..d9c7fcbe78 100644
--- a/ext/openssl/ossl_pkey_dsa.c
+++ b/ext/openssl/ossl_pkey_dsa.c
@@ -161,19 +161,19 @@ ossl_dsa_initialize(int argc, VALUE *argv, VALUE self)
in = ossl_obj2bio(arg);
dsa = PEM_read_bio_DSAPrivateKey(in, NULL, ossl_pem_passwd_cb, passwd);
if (!dsa) {
- (void)BIO_reset(in);
+ BIO_reset(in);
dsa = PEM_read_bio_DSAPublicKey(in, NULL, NULL, NULL);
}
if (!dsa) {
- (void)BIO_reset(in);
+ BIO_reset(in);
dsa = PEM_read_bio_DSA_PUBKEY(in, NULL, NULL, NULL);
}
if (!dsa) {
- (void)BIO_reset(in);
+ BIO_reset(in);
dsa = d2i_DSAPrivateKey_bio(in, NULL);
}
if (!dsa) {
- (void)BIO_reset(in);
+ BIO_reset(in);
dsa = d2i_DSA_PUBKEY_bio(in, NULL);
}
BIO_free(in);
@@ -289,7 +289,7 @@ ossl_dsa_to_der(VALUE self)
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);
+ p = RSTRING_PTR(str);
if(i2d_func(pkey->pkey.dsa, &p) < 0)
ossl_raise(eDSAError, NULL);
ossl_str_adjust(str, p);
@@ -387,7 +387,7 @@ static VALUE
ossl_dsa_sign(VALUE self, VALUE data)
{
EVP_PKEY *pkey;
- unsigned int buf_len;
+ int buf_len;
VALUE str;
GetPKeyDSA(self, pkey);
@@ -396,8 +396,7 @@ ossl_dsa_sign(VALUE self, VALUE data)
ossl_raise(eDSAError, "Private DSA key needed!");
}
str = rb_str_new(0, ossl_dsa_buf_size(pkey));
- if (!DSA_sign(0, (unsigned char *)RSTRING_PTR(data), RSTRING_LEN(data),
- (unsigned char *)RSTRING_PTR(str),
+ if (!DSA_sign(0, RSTRING_PTR(data), RSTRING_LEN(data), RSTRING_PTR(str),
&buf_len, pkey->pkey.dsa)) { /* type is ignored (0) */
ossl_raise(eDSAError, NULL);
}
@@ -421,8 +420,8 @@ ossl_dsa_verify(VALUE self, VALUE digest, VALUE sig)
StringValue(digest);
StringValue(sig);
/* type is ignored (0) */
- ret = DSA_verify(0, (unsigned char *)RSTRING_PTR(digest), RSTRING_LEN(digest),
- (unsigned char *)RSTRING_PTR(sig), RSTRING_LEN(sig), pkey->pkey.dsa);
+ ret = DSA_verify(0, RSTRING_PTR(digest), RSTRING_LEN(digest),
+ RSTRING_PTR(sig), RSTRING_LEN(sig), pkey->pkey.dsa);
if (ret < 0) {
ossl_raise(eDSAError, NULL);
}
@@ -433,11 +432,11 @@ ossl_dsa_verify(VALUE self, VALUE digest, VALUE sig)
return Qfalse;
}
-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)
+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
diff --git a/ext/openssl/ossl_pkey_ec.c b/ext/openssl/ossl_pkey_ec.c
index edb5695fb4..210054121d 100644
--- a/ext/openssl/ossl_pkey_ec.c
+++ b/ext/openssl/ossl_pkey_ec.c
@@ -186,22 +186,22 @@ static VALUE ossl_ec_key_initialize(int argc, VALUE *argv, VALUE self)
ec = PEM_read_bio_ECPrivateKey(in, NULL, NULL, NULL);
if (!ec) {
- (void)BIO_reset(in);
+ BIO_reset(in);
ec = PEM_read_bio_EC_PUBKEY(in, NULL, NULL, NULL);
}
if (!ec) {
- (void)BIO_reset(in);
+ BIO_reset(in);
ec = d2i_ECPrivateKey_bio(in, NULL);
}
if (!ec) {
- (void)BIO_reset(in);
+ BIO_reset(in);
ec = d2i_EC_PUBKEY_bio(in, NULL);
}
BIO_free(in);
if (ec == NULL) {
- const char *name = StringValueCStr(arg);
+ const char *name = STR2CSTR(arg);
int nid = OBJ_sn2nid(name);
if (nid == NID_undef)
@@ -463,10 +463,8 @@ static VALUE ossl_ec_key_to_string(VALUE self, int format)
BIO *out;
int i = -1;
int private = 0;
-#if 0 /* unused now */
EVP_CIPHER *cipher = NULL;
char *password = NULL;
-#endif
VALUE str;
Require_EC_KEY(self, ec);
@@ -486,18 +484,13 @@ static VALUE ossl_ec_key_to_string(VALUE self, int format)
switch(format) {
case EXPORT_PEM:
if (private) {
-#if 0 /* unused now */
if (cipher || password)
/* BUG: finish cipher/password key export */
rb_notimplement();
i = PEM_write_bio_ECPrivateKey(out, ec, cipher, NULL, 0, NULL, password);
-#endif
- i = PEM_write_bio_ECPrivateKey(out, ec, NULL, NULL, 0, NULL, NULL);
} else {
-#if 0 /* unused now */
if (cipher || password)
rb_raise(rb_eArgError, "encryption is not supported when exporting this key type");
-#endif
i = PEM_write_bio_EC_PUBKEY(out, ec);
}
@@ -505,17 +498,13 @@ static VALUE ossl_ec_key_to_string(VALUE self, int format)
break;
case EXPORT_DER:
if (private) {
-#if 0 /* unused now */
if (cipher || password)
rb_raise(rb_eArgError, "encryption is not supported when exporting this key type");
-#endif
i = i2d_ECPrivateKey_bio(out, ec);
} else {
-#if 0 /* unused now */
if (cipher || password)
rb_raise(rb_eArgError, "encryption is not supported when exporting this key type");
-#endif
i = i2d_EC_PUBKEY_bio(out, ec);
}
@@ -706,7 +695,7 @@ static void ossl_ec_group_free(ossl_ec_group *ec_group)
{
if (!ec_group->dont_free && ec_group->group)
EC_GROUP_clear_free(ec_group->group);
- ruby_xfree(ec_group);
+ free(ec_group);
}
static VALUE ossl_ec_group_alloc(VALUE klass)
@@ -778,14 +767,14 @@ static VALUE ossl_ec_group_initialize(int argc, VALUE *argv, VALUE self)
group = PEM_read_bio_ECPKParameters(in, NULL, NULL, NULL);
if (!group) {
- (void)BIO_reset(in);
+ BIO_reset(in);
group = d2i_ECPKParameters_bio(in, NULL);
}
BIO_free(in);
if (!group) {
- const char *name = StringValueCStr(arg1);
+ const char *name = STR2CSTR(arg1);
int nid = OBJ_sn2nid(name);
if (nid == NID_undef)
@@ -1092,7 +1081,7 @@ static VALUE ossl_ec_group_get_seed(VALUE self)
if (seed_len == 0)
return Qnil;
- return rb_str_new((const char *)EC_GROUP_get0_seed(group), seed_len);
+ return rb_str_new(EC_GROUP_get0_seed(group), seed_len);
}
/* call-seq:
@@ -1107,7 +1096,7 @@ static VALUE ossl_ec_group_set_seed(VALUE self, VALUE seed)
Require_EC_GROUP(self, group);
StringValue(seed);
- if (EC_GROUP_set_seed(group, (unsigned char *)RSTRING_PTR(seed), RSTRING_LEN(seed)) != RSTRING_LEN(seed))
+ if (EC_GROUP_set_seed(group, RSTRING_PTR(seed), RSTRING_LEN(seed)) != RSTRING_LEN(seed))
ossl_raise(eEC_GROUP, "EC_GROUP_set_seed");
return seed;
@@ -1212,7 +1201,7 @@ static void ossl_ec_point_free(ossl_ec_point *ec_point)
{
if (!ec_point->dont_free && ec_point->point)
EC_POINT_clear_free(ec_point->point);
- ruby_xfree(ec_point);
+ free(ec_point);
}
static VALUE ossl_ec_point_alloc(VALUE klass)
diff --git a/ext/openssl/ossl_pkey_rsa.c b/ext/openssl/ossl_pkey_rsa.c
index 80665cddbd..9ac69e7ded 100644
--- a/ext/openssl/ossl_pkey_rsa.c
+++ b/ext/openssl/ossl_pkey_rsa.c
@@ -151,23 +151,23 @@ ossl_rsa_initialize(int argc, VALUE *argv, VALUE self)
in = ossl_obj2bio(arg);
rsa = PEM_read_bio_RSAPrivateKey(in, NULL, ossl_pem_passwd_cb, passwd);
if (!rsa) {
- (void)BIO_reset(in);
+ BIO_reset(in);
rsa = PEM_read_bio_RSAPublicKey(in, NULL, NULL, NULL);
}
if (!rsa) {
- (void)BIO_reset(in);
+ BIO_reset(in);
rsa = PEM_read_bio_RSA_PUBKEY(in, NULL, NULL, NULL);
}
if (!rsa) {
- (void)BIO_reset(in);
+ BIO_reset(in);
rsa = d2i_RSAPrivateKey_bio(in, NULL);
}
if (!rsa) {
- (void)BIO_reset(in);
+ BIO_reset(in);
rsa = d2i_RSAPublicKey_bio(in, NULL);
}
if (!rsa) {
- (void)BIO_reset(in);
+ BIO_reset(in);
rsa = d2i_RSA_PUBKEY_bio(in, NULL);
}
BIO_free(in);
@@ -288,7 +288,7 @@ ossl_rsa_to_der(VALUE self)
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);
+ p = RSTRING_PTR(str);
if(i2d_func(pkey->pkey.rsa, &p) < 0)
ossl_raise(eRSAError, NULL);
ossl_str_adjust(str, p);
@@ -315,8 +315,8 @@ ossl_rsa_public_encrypt(int argc, VALUE *argv, VALUE self)
pad = (argc == 1) ? RSA_PKCS1_PADDING : NUM2INT(padding);
StringValue(buffer);
str = rb_str_new(0, ossl_rsa_buf_size(pkey));
- buf_len = RSA_public_encrypt(RSTRING_LEN(buffer), (unsigned char *)RSTRING_PTR(buffer),
- (unsigned char *)RSTRING_PTR(str), pkey->pkey.rsa,
+ buf_len = RSA_public_encrypt(RSTRING_LEN(buffer), RSTRING_PTR(buffer),
+ RSTRING_PTR(str), pkey->pkey.rsa,
pad);
if (buf_len < 0) ossl_raise(eRSAError, NULL);
rb_str_set_len(str, buf_len);
@@ -341,8 +341,8 @@ ossl_rsa_public_decrypt(int argc, VALUE *argv, VALUE self)
pad = (argc == 1) ? RSA_PKCS1_PADDING : NUM2INT(padding);
StringValue(buffer);
str = rb_str_new(0, ossl_rsa_buf_size(pkey));
- buf_len = RSA_public_decrypt(RSTRING_LEN(buffer), (unsigned char *)RSTRING_PTR(buffer),
- (unsigned char *)RSTRING_PTR(str), pkey->pkey.rsa,
+ buf_len = RSA_public_decrypt(RSTRING_LEN(buffer), RSTRING_PTR(buffer),
+ RSTRING_PTR(str), pkey->pkey.rsa,
pad);
if (buf_len < 0) ossl_raise(eRSAError, NULL);
rb_str_set_len(str, buf_len);
@@ -370,8 +370,8 @@ ossl_rsa_private_encrypt(int argc, VALUE *argv, VALUE self)
pad = (argc == 1) ? RSA_PKCS1_PADDING : NUM2INT(padding);
StringValue(buffer);
str = rb_str_new(0, ossl_rsa_buf_size(pkey));
- buf_len = RSA_private_encrypt(RSTRING_LEN(buffer), (unsigned char *)RSTRING_PTR(buffer),
- (unsigned char *)RSTRING_PTR(str), pkey->pkey.rsa,
+ buf_len = RSA_private_encrypt(RSTRING_LEN(buffer), RSTRING_PTR(buffer),
+ RSTRING_PTR(str), pkey->pkey.rsa,
pad);
if (buf_len < 0) ossl_raise(eRSAError, NULL);
rb_str_set_len(str, buf_len);
@@ -400,8 +400,8 @@ ossl_rsa_private_decrypt(int argc, VALUE *argv, VALUE self)
pad = (argc == 1) ? RSA_PKCS1_PADDING : NUM2INT(padding);
StringValue(buffer);
str = rb_str_new(0, ossl_rsa_buf_size(pkey));
- buf_len = RSA_private_decrypt(RSTRING_LEN(buffer), (unsigned char *)RSTRING_PTR(buffer),
- (unsigned char *)RSTRING_PTR(str), pkey->pkey.rsa,
+ buf_len = RSA_private_decrypt(RSTRING_LEN(buffer), RSTRING_PTR(buffer),
+ RSTRING_PTR(str), pkey->pkey.rsa,
pad);
if (buf_len < 0) ossl_raise(eRSAError, NULL);
rb_str_set_len(str, buf_len);
@@ -519,14 +519,14 @@ ossl_rsa_blinding_off(VALUE self)
}
*/
-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)
+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
diff --git a/ext/openssl/ossl_rand.c b/ext/openssl/ossl_rand.c
index af61fe33a0..ad830fbc98 100644
--- a/ext/openssl/ossl_rand.c
+++ b/ext/openssl/ossl_rand.c
@@ -99,7 +99,7 @@ ossl_rand_bytes(VALUE self, VALUE len)
int n = NUM2INT(len);
str = rb_str_new(0, n);
- if (!RAND_bytes((unsigned char *)RSTRING_PTR(str), n)) {
+ if (!RAND_bytes(RSTRING_PTR(str), n)) {
ossl_raise(eRandomError, NULL);
}
@@ -118,7 +118,7 @@ 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)) {
+ if (!RAND_pseudo_bytes(RSTRING_PTR(str), n)) {
ossl_raise(eRandomError, NULL);
}
diff --git a/ext/openssl/ossl_ssl.c b/ext/openssl/ossl_ssl.c
index 6a3e200ee7..01b86fec27 100644
--- a/ext/openssl/ossl_ssl.c
+++ b/ext/openssl/ossl_ssl.c
@@ -11,6 +11,8 @@
* (See the file 'LICENCE'.)
*/
#include "ossl.h"
+#include <rubysig.h>
+#include <rubyio.h>
#if defined(HAVE_UNISTD_H)
# include <unistd.h> /* for read(), and write() */
@@ -67,9 +69,6 @@ static const char *ossl_sslctx_attrs[] = {
"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
};
#define ossl_ssl_get_io(o) rb_iv_get((o),"@io")
@@ -87,12 +86,7 @@ static const char *ossl_sslctx_attrs[] = {
#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",
-};
+static const char *ossl_ssl_attrs[] = { "sync_close", };
ID ID_callback_state;
@@ -303,7 +297,7 @@ ossl_ssl_verify_callback(int preverify_ok, X509_STORE_CTX *ctx)
static VALUE
ossl_call_session_get_cb(VALUE ary)
{
- VALUE ssl_obj, sslctx_obj, cb;
+ VALUE ssl_obj, sslctx_obj, cb, ret;
Check_Type(ary, T_ARRAY);
ssl_obj = rb_ary_entry(ary, 0);
@@ -331,7 +325,7 @@ ossl_sslctx_session_get_cb(SSL *ssl, unsigned char *buf, int len, int *copy)
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));
+ rb_ary_push(ary, rb_str_new(buf, len));
ret_obj = rb_protect((VALUE(*)_((VALUE)))ossl_call_session_get_cb, ary, &state);
if (state) {
@@ -350,7 +344,7 @@ ossl_sslctx_session_get_cb(SSL *ssl, unsigned char *buf, int len, int *copy)
static VALUE
ossl_call_session_new_cb(VALUE ary)
{
- VALUE ssl_obj, sslctx_obj, cb;
+ VALUE ssl_obj, sslctx_obj, cb, ret;
Check_Type(ary, T_ARRAY);
ssl_obj = rb_ary_entry(ary, 0);
@@ -393,11 +387,10 @@ ossl_sslctx_session_new_cb(SSL *ssl, SSL_SESSION *sess)
return RTEST(ret_obj) ? 1 : 0;
}
-#if 0 /* unused */
static VALUE
ossl_call_session_remove_cb(VALUE ary)
{
- VALUE sslctx_obj, cb;
+ VALUE sslctx_obj, cb, ret;
Check_Type(ary, T_ARRAY);
sslctx_obj = rb_ary_entry(ary, 0);
@@ -407,7 +400,6 @@ ossl_call_session_remove_cb(VALUE ary)
return rb_funcall(cb, rb_intern("call"), 1, ary);
}
-#endif
static void
ossl_sslctx_session_remove_cb(SSL_CTX *ctx, SSL_SESSION *sess)
@@ -454,66 +446,6 @@ ossl_sslctx_add_extra_chain_cert_i(VALUE i, VALUE arg)
return i;
}
-static VALUE ossl_sslctx_setup(VALUE self);
-
-#ifdef HAVE_SSL_SET_TLSEXT_HOST_NAME
-static VALUE
-ossl_call_servername_cb(VALUE ary)
-{
- VALUE ssl_obj, sslctx_obj, cb, ret_obj;
-
- Check_Type(ary, T_ARRAY);
- ssl_obj = rb_ary_entry(ary, 0);
-
- sslctx_obj = rb_iv_get(ssl_obj, "@context");
- if (NIL_P(sslctx_obj)) return Qnil;
- cb = rb_iv_get(sslctx_obj, "@servername_cb");
- if (NIL_P(cb)) return Qnil;
-
- ret_obj = rb_funcall(cb, rb_intern("call"), 1, ary);
- if (rb_obj_is_kind_of(ret_obj, cSSLContext)) {
- SSL *ssl;
- SSL_CTX *ctx2;
-
- ossl_sslctx_setup(ret_obj);
- Data_Get_Struct(ssl_obj, SSL, ssl);
- Data_Get_Struct(ret_obj, SSL_CTX, ctx2);
- SSL_set_SSL_CTX(ssl, ctx2);
- } else if (!NIL_P(ret_obj)) {
- rb_raise(rb_eArgError, "servername_cb must return an OpenSSL::SSL::SSLContext object or nil");
- }
-
- return ret_obj;
-}
-
-static int
-ssl_servername_cb(SSL *ssl, int *ad, void *arg)
-{
- VALUE ary, ssl_obj, ret_obj;
- void *ptr;
- int state = 0;
- const char *servername = SSL_get_servername(ssl, TLSEXT_NAMETYPE_host_name);
-
- if (!servername)
- return SSL_TLSEXT_ERR_OK;
-
- 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));
-
- ret_obj = 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;
- }
-
- return SSL_TLSEXT_ERR_OK;
-}
-#endif
-
/*
* call-seq:
* ctx.setup => Qtrue # first time
@@ -631,7 +563,7 @@ ossl_sslctx_setup(VALUE self)
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),
+ if (!SSL_CTX_set_session_id_context(ctx, RSTRING_PTR(val),
RSTRING_LEN(val))){
ossl_raise(eSSLError, "SSL_CTX_set_session_id_context:");
}
@@ -649,15 +581,6 @@ ossl_sslctx_setup(VALUE self)
SSL_CTX_sess_set_remove_cb(ctx, ossl_sslctx_session_remove_cb);
OSSL_Debug("SSL SESSION remove callback added");
}
-
-#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;
}
@@ -892,6 +815,7 @@ ossl_sslctx_flush_sessions(int argc, VALUE *argv, VALUE self)
VALUE arg1;
SSL_CTX *ctx;
time_t tm = 0;
+ int cb_state;
rb_scan_args(argc, argv, "01", &arg1);
@@ -905,7 +829,7 @@ ossl_sslctx_flush_sessions(int argc, VALUE *argv, VALUE self)
rb_raise(rb_eArgError, "arg must be Time or nil");
}
- SSL_CTX_flush_sessions(ctx, (long)tm);
+ SSL_CTX_flush_sessions(ctx, tm);
return self;
}
@@ -978,10 +902,6 @@ ossl_ssl_setup(VALUE self)
Data_Get_Struct(self, SSL, ssl);
if(!ssl){
-#ifdef HAVE_SSL_SET_TLSEXT_HOST_NAME
- VALUE hostname = rb_iv_get(self, "@hostname");
-#endif
-
v_ctx = ossl_ssl_get_ctx(self);
Data_Get_Struct(v_ctx, SSL_CTX, ctx);
@@ -991,12 +911,6 @@ ossl_ssl_setup(VALUE self)
}
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);
@@ -1020,28 +934,8 @@ ossl_ssl_setup(VALUE self)
#define ssl_get_error(ssl, ret) SSL_get_error(ssl, ret)
#endif
-static void
-write_would_block(int nonblock)
-{
- if (nonblock) {
- VALUE exc = ossl_exc_new(eSSLError, "write would block");
- rb_extend_object(exc, rb_mWaitWritable);
- rb_exc_raise(exc);
- }
-}
-
-static void
-read_would_block(int nonblock)
-{
- if (nonblock) {
- VALUE exc = ossl_exc_new(eSSLError, "read would block");
- rb_extend_object(exc, rb_mWaitReadable);
- rb_exc_raise(exc);
- }
-}
-
static VALUE
-ossl_start_ssl(VALUE self, int (*func)(), const char *funcname, int nonblock)
+ossl_start_ssl(VALUE self, int (*func)(), const char *funcname)
{
SSL *ssl;
rb_io_t *fptr;
@@ -1053,22 +947,12 @@ ossl_start_ssl(VALUE self, int (*func)(), const char *funcname, int nonblock)
Data_Get_Struct(self, SSL, ssl);
GetOpenFile(ossl_ssl_get_io(self), fptr);
for(;;){
- ret = func(ssl);
-
- cb_state = rb_ivar_get(self, ID_callback_state);
- if (!NIL_P(cb_state))
- rb_jump_tag(NUM2INT(cb_state));
-
- if (ret > 0)
- break;
-
+ if((ret = func(ssl)) > 0) break;
switch((ret2 = ssl_get_error(ssl, ret))){
case SSL_ERROR_WANT_WRITE:
- write_would_block(nonblock);
rb_io_wait_writable(FPTR_TO_FD(fptr));
continue;
case SSL_ERROR_WANT_READ:
- read_would_block(nonblock);
rb_io_wait_readable(FPTR_TO_FD(fptr));
continue;
case SSL_ERROR_SYSCALL:
@@ -1079,6 +963,10 @@ ossl_start_ssl(VALUE self, int (*func)(), const char *funcname, int nonblock)
}
}
+ cb_state = rb_ivar_get(self, ID_callback_state);
+ if (!NIL_P(cb_state))
+ rb_jump_tag(NUM2INT(cb_state));
+
return self;
}
@@ -1090,32 +978,7 @@ static VALUE
ossl_ssl_connect(VALUE self)
{
ossl_ssl_setup(self);
- return ossl_start_ssl(self, SSL_connect, "SSL_connect", 0);
-}
-
-/*
- * call-seq:
- * ssl.connect_nonblock => self
- *
- * initiate the TLS/SSL handshake as a client in non-blocking manner.
- *
- * # emulates blocking connect
- * begin
- * ssl.connect_nonblock
- * rescue IO::WaitReadable
- * IO.select([s2])
- * retry
- * rescue IO::WaitWritable
- * IO.select(nil, [s2])
- * retry
- * end
- *
- */
-static VALUE
-ossl_ssl_connect_nonblock(VALUE self)
-{
- ossl_ssl_setup(self);
- return ossl_start_ssl(self, SSL_connect, "SSL_connect", 1);
+ return ossl_start_ssl(self, SSL_connect, "SSL_connect");
}
/*
@@ -1126,36 +989,20 @@ static VALUE
ossl_ssl_accept(VALUE self)
{
ossl_ssl_setup(self);
- return ossl_start_ssl(self, SSL_accept, "SSL_accept", 0);
+ return ossl_start_ssl(self, SSL_accept, "SSL_accept");
}
/*
* call-seq:
- * ssl.accept_nonblock => self
- *
- * initiate the TLS/SSL handshake as a server in non-blocking manner.
- *
- * # emulates blocking accept
- * begin
- * ssl.accept_nonblock
- * rescue IO::WaitReadable
- * IO.select([s2])
- * retry
- * rescue IO::WaitWritable
- * IO.select(nil, [s2])
- * retry
- * end
+ * ssl.sysread(length) => string
+ * ssl.sysread(length, buffer) => buffer
*
+ * === Parameters
+ * * +length+ is a positive integer.
+ * * +buffer+ is a string used to store the result.
*/
static VALUE
-ossl_ssl_accept_nonblock(VALUE self)
-{
- ossl_ssl_setup(self);
- return ossl_start_ssl(self, SSL_accept, "SSL_accept", 1);
-}
-
-static VALUE
-ossl_ssl_read_internal(int argc, VALUE *argv, VALUE self, int nonblock)
+ossl_ssl_read(int argc, VALUE *argv, VALUE self)
{
SSL *ssl;
int ilen, nread = 0;
@@ -1175,7 +1022,7 @@ ossl_ssl_read_internal(int argc, VALUE *argv, VALUE self, int nonblock)
Data_Get_Struct(self, SSL, ssl);
GetOpenFile(ossl_ssl_get_io(self), fptr);
if (ssl) {
- if(!nonblock && SSL_pending(ssl) <= 0)
+ if(SSL_pending(ssl) <= 0)
rb_thread_wait_fd(FPTR_TO_FD(fptr));
for (;;){
nread = SSL_read(ssl, RSTRING_PTR(str), RSTRING_LEN(str));
@@ -1185,11 +1032,9 @@ ossl_ssl_read_internal(int argc, VALUE *argv, VALUE self, int nonblock)
case SSL_ERROR_ZERO_RETURN:
rb_eof_error();
case SSL_ERROR_WANT_WRITE:
- write_would_block(nonblock);
rb_io_wait_writable(FPTR_TO_FD(fptr));
continue;
case SSL_ERROR_WANT_READ:
- read_would_block(nonblock);
rb_io_wait_readable(FPTR_TO_FD(fptr));
continue;
case SSL_ERROR_SYSCALL:
@@ -1201,9 +1046,9 @@ ossl_ssl_read_internal(int argc, VALUE *argv, VALUE self, int nonblock)
}
}
else {
- ID meth = nonblock ? rb_intern("read_nonblock") : rb_intern("sysread");
+ ID id_sysread = rb_intern("sysread");
rb_warning("SSL session is not started yet.");
- return rb_funcall(ossl_ssl_get_io(self), meth, 2, len, str);
+ return rb_funcall(ossl_ssl_get_io(self), id_sysread, 2, len, str);
}
end:
@@ -1213,39 +1058,12 @@ ossl_ssl_read_internal(int argc, VALUE *argv, VALUE self, int nonblock)
return str;
}
-
-/*
- * call-seq:
- * ssl.sysread(length) => string
- * ssl.sysread(length, buffer) => buffer
- *
- * === Parameters
- * * +length+ is a positive integer.
- * * +buffer+ is a string used to store the result.
- */
-static VALUE
-ossl_ssl_read(int argc, VALUE *argv, VALUE self)
-{
- return ossl_ssl_read_internal(argc, argv, self, 0);
-}
-
/*
* call-seq:
- * ssl.sysread_nonblock(length) => string
- * ssl.sysread_nonblock(length, buffer) => buffer
- *
- * === Parameters
- * * +length+ is a positive integer.
- * * +buffer+ is a string used to store the result.
+ * ssl.syswrite(string) => integer
*/
static VALUE
-ossl_ssl_read_nonblock(int argc, VALUE *argv, VALUE self)
-{
- return ossl_ssl_read_internal(argc, argv, self, 1);
-}
-
-static VALUE
-ossl_ssl_write_internal(VALUE self, VALUE str, int nonblock)
+ossl_ssl_write(VALUE self, VALUE str)
{
SSL *ssl;
int nwrite = 0;
@@ -1262,11 +1080,9 @@ ossl_ssl_write_internal(VALUE self, VALUE str, int nonblock)
case SSL_ERROR_NONE:
goto end;
case SSL_ERROR_WANT_WRITE:
- write_would_block(nonblock);
rb_io_wait_writable(FPTR_TO_FD(fptr));
continue;
case SSL_ERROR_WANT_READ:
- read_would_block(nonblock);
rb_io_wait_readable(FPTR_TO_FD(fptr));
continue;
case SSL_ERROR_SYSCALL:
@@ -1288,26 +1104,6 @@ ossl_ssl_write_internal(VALUE self, VALUE str, int nonblock)
/*
* call-seq:
- * ssl.syswrite(string) => integer
- */
-static VALUE
-ossl_ssl_write(VALUE self, VALUE str)
-{
- return ossl_ssl_write_internal(self, str, 0);
-}
-
-/*
- * call-seq:
- * ssl.syswrite_nonblock(string) => integer
- */
-static VALUE
-ossl_ssl_write_nonblock(VALUE self, VALUE str)
-{
- return ossl_ssl_write_internal(self, str, 1);
-}
-
-/*
- * call-seq:
* ssl.sysclose => nil
*/
static VALUE
@@ -1548,13 +1344,13 @@ Init_ossl_ssl()
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_vcb_idx = SSL_get_ex_new_index(0,"ossl_ssl_ex_vcb_idx",0,0,0);
+ ossl_ssl_ex_store_p = SSL_get_ex_new_index(0,"ossl_ssl_ex_store_p",0,0,0);
+ ossl_ssl_ex_ptr_idx = SSL_get_ex_new_index(0,"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);
+ SSL_get_ex_new_index(0,"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);
+ SSL_get_ex_new_index(0,"ossl_ssl_ex_tmp_dh_callback_idx",0,0,0);
mSSL = rb_define_module_under(mOSSL, "SSL");
eSSLError = rb_define_class_under(mSSL, "SSLError", eOSSLError);
@@ -1622,13 +1418,9 @@ Init_ossl_ssl()
rb_define_alias(cSSLSocket, "to_io", "io");
rb_define_method(cSSLSocket, "initialize", ossl_ssl_initialize, -1);
rb_define_method(cSSLSocket, "connect", ossl_ssl_connect, 0);
- rb_define_method(cSSLSocket, "connect_nonblock", ossl_ssl_connect_nonblock, 0);
rb_define_method(cSSLSocket, "accept", ossl_ssl_accept, 0);
- 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_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);
@@ -1640,7 +1432,7 @@ Init_ossl_ssl()
rb_define_method(cSSLSocket, "session=", ossl_ssl_set_session, 1);
rb_define_method(cSSLSocket, "verify_result", ossl_ssl_get_verify_result, 0);
-#define ossl_ssl_def_const(x) rb_define_const(mSSL, #x, INT2NUM(SSL_##x))
+#define ossl_ssl_def_const(x) rb_define_const(mSSL, #x, INT2FIX(SSL_##x))
ossl_ssl_def_const(VERIFY_NONE);
ossl_ssl_def_const(VERIFY_PEER);
diff --git a/ext/openssl/ossl_ssl_session.c b/ext/openssl/ossl_ssl_session.c
index d5fdba6aed..63c2bbb87a 100644
--- a/ext/openssl/ossl_ssl_session.c
+++ b/ext/openssl/ossl_ssl_session.c
@@ -36,6 +36,8 @@ static VALUE ossl_ssl_session_alloc(VALUE klass)
static VALUE ossl_ssl_session_initialize(VALUE self, VALUE arg1)
{
SSL_SESSION *ctx = NULL;
+ VALUE obj;
+ unsigned char *p;
if (RDATA(self)->data)
ossl_raise(eSSLSession, "SSL Session already initialized");
@@ -53,7 +55,7 @@ static VALUE ossl_ssl_session_initialize(VALUE self, VALUE arg1)
ctx = PEM_read_bio_SSL_SESSION(in, NULL, NULL, NULL);
if (!ctx) {
- (void)BIO_reset(in);
+ BIO_reset(in);
ctx = d2i_SSL_SESSION_bio(in, NULL);
}
@@ -107,7 +109,7 @@ static VALUE ossl_ssl_session_get_time(VALUE self)
if (t == 0)
return Qnil;
- return rb_funcall(rb_cTime, rb_intern("at"), 1, TIMET2NUM(t));
+ return rb_funcall(rb_cTime, rb_intern("at"), 1, LONG2NUM(t));
}
/*
@@ -126,14 +128,14 @@ static VALUE ossl_ssl_session_get_timeout(VALUE self)
t = SSL_SESSION_get_timeout(ctx);
- return TIMET2NUM(t);
+ return ULONG2NUM(t);
}
#define SSLSESSION_SET_TIME(func) \
static VALUE ossl_ssl_session_set_##func(VALUE self, VALUE time_v) \
{ \
SSL_SESSION *ctx; \
- unsigned long t; \
+ time_t t; \
\
GetSSLSession(self, ctx); \
\
diff --git a/ext/openssl/ossl_version.h b/ext/openssl/ossl_version.h
index 193ceab089..63878e0d8e 100644
--- a/ext/openssl/ossl_version.h
+++ b/ext/openssl/ossl_version.h
@@ -11,6 +11,6 @@
#if !defined(_OSSL_VERSION_H_)
#define _OSSL_VERSION_H_
-#define OSSL_VERSION "1.1.0"
+#define OSSL_VERSION "1.0.0"
#endif /* _OSSL_VERSION_H_ */
diff --git a/ext/openssl/ossl_x509attr.c b/ext/openssl/ossl_x509attr.c
index 1f817cdafe..ca1c59aba9 100644
--- a/ext/openssl/ossl_x509attr.c
+++ b/ext/openssl/ossl_x509attr.c
@@ -92,17 +92,16 @@ static VALUE
ossl_x509attr_initialize(int argc, VALUE *argv, VALUE self)
{
VALUE oid, value;
- X509_ATTRIBUTE *attr, *x;
- const unsigned char *p;
+ X509_ATTRIBUTE *attr;
+ unsigned char *p;
GetX509Attr(self, attr);
if(rb_scan_args(argc, argv, "11", &oid, &value) == 1){
oid = ossl_to_der_if_possible(oid);
StringValue(oid);
- p = (unsigned char *)RSTRING_PTR(oid);
- x = d2i_X509_ATTRIBUTE(&attr, &p, RSTRING_LEN(oid));
- DATA_PTR(self) = attr;
- if(!x){
+ p = RSTRING_PTR(oid);
+ if(!d2i_X509_ATTRIBUTE((X509_ATTRIBUTE**)&DATA_PTR(self),
+ &p, RSTRING_LEN(oid))){
ossl_raise(eX509AttrError, NULL);
}
return self;
@@ -213,7 +212,7 @@ ossl_x509attr_get_value(VALUE self)
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);
+ p = RSTRING_PTR(str);
i2d_ASN1_TYPE(attr->value.single, &p);
ossl_str_adjust(str, p);
}
@@ -221,7 +220,7 @@ ossl_x509attr_get_value(VALUE self)
length = i2d_ASN1_SET_OF_ASN1_TYPE(attr->value.set, NULL,
i2d_ASN1_TYPE, V_ASN1_SET, V_ASN1_UNIVERSAL, 0);
str = rb_str_new(0, length);
- p = (unsigned char *)RSTRING_PTR(str);
+ p = 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);
@@ -247,7 +246,7 @@ ossl_x509attr_to_der(VALUE self)
if((len = i2d_X509_ATTRIBUTE(attr, NULL)) <= 0)
ossl_raise(eX509AttrError, NULL);
str = rb_str_new(0, len);
- p = (unsigned char *)RSTRING_PTR(str);
+ p = RSTRING_PTR(str);
if(i2d_X509_ATTRIBUTE(attr, &p) <= 0)
ossl_raise(eX509AttrError, NULL);
rb_str_set_len(str, p - (unsigned char*)RSTRING_PTR(str));
diff --git a/ext/openssl/ossl_x509cert.c b/ext/openssl/ossl_x509cert.c
index fec2d8b1a3..b97f27ffa9 100644
--- a/ext/openssl/ossl_x509cert.c
+++ b/ext/openssl/ossl_x509cert.c
@@ -134,7 +134,7 @@ static VALUE
ossl_x509_initialize(int argc, VALUE *argv, VALUE self)
{
BIO *in;
- X509 *x509, *x = DATA_PTR(self);
+ X509 *x509;
VALUE arg;
if (rb_scan_args(argc, argv, "01", &arg) == 0) {
@@ -143,12 +143,10 @@ ossl_x509_initialize(int argc, VALUE *argv, VALUE self)
}
arg = ossl_to_der_if_possible(arg);
in = ossl_obj2bio(arg);
- x509 = PEM_read_bio_X509(in, &x, NULL, NULL);
- DATA_PTR(self) = x;
+ x509 = PEM_read_bio_X509(in, (X509 **)&DATA_PTR(self), NULL, NULL);
if (!x509) {
- (void)BIO_reset(in);
- x509 = d2i_X509_bio(in, &x);
- DATA_PTR(self) = x;
+ BIO_reset(in);
+ x509 = d2i_X509_bio(in, (X509 **)&DATA_PTR(self));
}
BIO_free(in);
if (!x509) ossl_raise(eX509CertError, NULL);
@@ -192,7 +190,7 @@ ossl_x509_to_der(VALUE self)
if ((len = i2d_X509(x509, NULL)) <= 0)
ossl_raise(eX509CertError, NULL);
str = rb_str_new(0, len);
- p = (unsigned char *)RSTRING_PTR(str);
+ p = RSTRING_PTR(str);
if (i2d_X509(x509, &p) <= 0)
ossl_raise(eX509CertError, NULL);
ossl_str_adjust(str, p);
@@ -692,7 +690,7 @@ static VALUE
ossl_x509_inspect(VALUE self)
{
VALUE str;
- const char *cname = rb_class2name(rb_obj_class(self));
+ char *cname = rb_class2name(rb_obj_class(self));
str = rb_str_new2("#<");
rb_str_cat2(str, cname);
diff --git a/ext/openssl/ossl_x509crl.c b/ext/openssl/ossl_x509crl.c
index 1be9640e6b..be9ddacf48 100644
--- a/ext/openssl/ossl_x509crl.c
+++ b/ext/openssl/ossl_x509crl.c
@@ -91,7 +91,7 @@ static VALUE
ossl_x509crl_initialize(int argc, VALUE *argv, VALUE self)
{
BIO *in;
- X509_CRL *crl, *x = DATA_PTR(self);
+ X509_CRL *crl;
VALUE arg;
if (rb_scan_args(argc, argv, "01", &arg) == 0) {
@@ -99,12 +99,10 @@ ossl_x509crl_initialize(int argc, VALUE *argv, VALUE self)
}
arg = ossl_to_der_if_possible(arg);
in = ossl_obj2bio(arg);
- crl = PEM_read_bio_X509_CRL(in, &x, NULL, NULL);
- DATA_PTR(self) = x;
+ crl = PEM_read_bio_X509_CRL(in, (X509_CRL **)&DATA_PTR(self), NULL, NULL);
if (!crl) {
- (void)BIO_reset(in);
- crl = d2i_X509_CRL_bio(in, &x);
- DATA_PTR(self) = x;
+ BIO_reset(in);
+ crl = d2i_X509_CRL_bio(in, (X509_CRL **)&DATA_PTR(self));
}
BIO_free(in);
if (!crl) ossl_raise(eX509CRLError, NULL);
diff --git a/ext/openssl/ossl_x509ext.c b/ext/openssl/ossl_x509ext.c
index d79615499b..aa9366f901 100644
--- a/ext/openssl/ossl_x509ext.c
+++ b/ext/openssl/ossl_x509ext.c
@@ -110,7 +110,6 @@ ossl_x509extfactory_alloc(VALUE klass)
VALUE obj;
MakeX509ExtFactory(klass, obj, ctx);
- rb_iv_set(obj, "@config", Qnil);
return obj;
}
@@ -163,10 +162,10 @@ 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)
{
+#ifdef HAVE_X509V3_SET_NCONF
X509V3_CTX *ctx;
CONF *conf;
@@ -176,10 +175,10 @@ ossl_x509extfactory_set_config(VALUE self, VALUE config)
X509V3_set_nconf(ctx, conf);
return config;
-}
#else
-#define rb_f_fork rb_f_notimplement
+ rb_notimplement();
#endif
+}
static VALUE
ossl_x509extfactory_initialize(int argc, VALUE *argv, VALUE self)
@@ -274,17 +273,16 @@ static VALUE
ossl_x509ext_initialize(int argc, VALUE *argv, VALUE self)
{
VALUE oid, value, critical;
- const unsigned char *p;
- X509_EXTENSION *ext, *x;
+ unsigned char *p;
+ X509_EXTENSION *ext;
GetX509Ext(self, ext);
if(rb_scan_args(argc, argv, "12", &oid, &value, &critical) == 1){
oid = ossl_to_der_if_possible(oid);
StringValue(oid);
- p = (unsigned char *)RSTRING_PTR(oid);
- x = d2i_X509_EXTENSION(&ext, &p, RSTRING_LEN(oid));
- DATA_PTR(self) = ext;
- if(!x)
+ p = RSTRING_PTR(oid);
+ if(!d2i_X509_EXTENSION((X509_EXTENSION**)&DATA_PTR(self),
+ &p, RSTRING_LEN(oid)))
ossl_raise(eX509ExtError, NULL);
return self;
}
@@ -325,15 +323,14 @@ ossl_x509ext_set_value(VALUE self, VALUE data)
ossl_raise(eX509ExtError, "malloc error");
memcpy(s, RSTRING_PTR(data), RSTRING_LEN(data));
if(!(asn1s = ASN1_OCTET_STRING_new())){
- OPENSSL_free(s);
+ free(s);
ossl_raise(eX509ExtError, NULL);
}
if(!M_ASN1_OCTET_STRING_set(asn1s, s, RSTRING_LEN(data))){
- OPENSSL_free(s);
+ free(s);
ASN1_OCTET_STRING_free(asn1s);
ossl_raise(eX509ExtError, NULL);
}
- OPENSSL_free(s);
GetX509Ext(self, ext);
X509_EXTENSION_set_data(ext, asn1s);
@@ -412,7 +409,7 @@ ossl_x509ext_to_der(VALUE obj)
if((len = i2d_X509_EXTENSION(ext, NULL)) <= 0)
ossl_raise(eX509ExtError, NULL);
str = rb_str_new(0, len);
- p = (unsigned char *)RSTRING_PTR(str);
+ p = RSTRING_PTR(str);
if(i2d_X509_EXTENSION(ext, &p) < 0)
ossl_raise(eX509ExtError, NULL);
ossl_str_adjust(str, p);
diff --git a/ext/openssl/ossl_x509name.c b/ext/openssl/ossl_x509name.c
index fd8e329a85..b4434d2a34 100644
--- a/ext/openssl/ossl_x509name.c
+++ b/ext/openssl/ossl_x509name.c
@@ -135,14 +135,11 @@ ossl_x509name_initialize(int argc, VALUE *argv, VALUE self)
rb_block_call(tmp, rb_intern("each"), 0, 0, ossl_x509name_init_i, args);
}
else{
- const unsigned char *p;
+ unsigned char *p;
VALUE str = ossl_to_der_if_possible(arg);
- X509_NAME *x;
StringValue(str);
- p = (unsigned char *)RSTRING_PTR(str);
- x = d2i_X509_NAME(&name, &p, RSTRING_LEN(str));
- DATA_PTR(self) = name;
- if(!x){
+ p = RSTRING_PTR(str);
+ if(!d2i_X509_NAME((X509_NAME**)&DATA_PTR(self), &p, RSTRING_LEN(str))){
ossl_raise(eX509NameError, NULL);
}
}
@@ -167,7 +164,7 @@ VALUE ossl_x509name_add_entry(int argc, VALUE *argv, VALUE self)
if(NIL_P(type)) type = rb_aref(OBJECT_TYPE_TEMPLATE, oid);
GetX509Name(self, name);
if (!X509_NAME_add_entry_by_txt(name, RSTRING_PTR(oid), NUM2INT(type),
- (const unsigned char *)RSTRING_PTR(value), RSTRING_LEN(value), -1, 0)) {
+ RSTRING_PTR(value), RSTRING_LEN(value), -1, 0)) {
ossl_raise(eX509NameError, NULL);
}
@@ -248,7 +245,7 @@ ossl_x509name_to_a(VALUE self)
}
short_name = OBJ_nid2sn(OBJ_ln2nid(long_name));
ary = rb_ary_new3(3, rb_str_new2(short_name),
- rb_str_new((const char *)entry->value->data, entry->value->length),
+ rb_str_new(entry->value->data, entry->value->length),
INT2FIX(entry->value->type));
rb_ary_push(ret, ary);
}
@@ -322,7 +319,7 @@ ossl_x509name_to_der(VALUE self)
if((len = i2d_X509_NAME(name, NULL)) <= 0)
ossl_raise(eX509NameError, NULL);
str = rb_str_new(0, len);
- p = (unsigned char *)RSTRING_PTR(str);
+ p = RSTRING_PTR(str);
if(i2d_X509_NAME(name, &p) <= 0)
ossl_raise(eX509NameError, NULL);
ossl_str_adjust(str, p);
diff --git a/ext/openssl/ossl_x509req.c b/ext/openssl/ossl_x509req.c
index 7c1b610159..13a42dddaf 100644
--- a/ext/openssl/ossl_x509req.c
+++ b/ext/openssl/ossl_x509req.c
@@ -99,7 +99,7 @@ static VALUE
ossl_x509req_initialize(int argc, VALUE *argv, VALUE self)
{
BIO *in;
- X509_REQ *req, *x = DATA_PTR(self);
+ X509_REQ *req;
VALUE arg;
if (rb_scan_args(argc, argv, "01", &arg) == 0) {
@@ -107,12 +107,10 @@ ossl_x509req_initialize(int argc, VALUE *argv, VALUE self)
}
arg = ossl_to_der_if_possible(arg);
in = ossl_obj2bio(arg);
- req = PEM_read_bio_X509_REQ(in, &x, NULL, NULL);
- DATA_PTR(self) = x;
+ req = PEM_read_bio_X509_REQ(in, (X509_REQ **)&DATA_PTR(self), NULL, NULL);
if (!req) {
- (void)BIO_reset(in);
- req = d2i_X509_REQ_bio(in, &x);
- DATA_PTR(self) = x;
+ BIO_reset(in);
+ req = d2i_X509_REQ_bio(in, (X509_REQ **)&DATA_PTR(self));
}
BIO_free(in);
if (!req) ossl_raise(eX509ReqError, NULL);
@@ -173,7 +171,7 @@ ossl_x509req_to_der(VALUE self)
if ((len = i2d_X509_REQ(req, NULL)) <= 0)
ossl_raise(eX509CertError, NULL);
str = rb_str_new(0, len);
- p = (unsigned char *)RSTRING_PTR(str);
+ p = RSTRING_PTR(str);
if (i2d_X509_REQ(req, &p) <= 0)
ossl_raise(eX509ReqError, NULL);
ossl_str_adjust(str, p);
diff --git a/ext/openssl/ossl_x509store.c b/ext/openssl/ossl_x509store.c
index 68fb372eaa..769ce8a91a 100644
--- a/ext/openssl/ossl_x509store.c
+++ b/ext/openssl/ossl_x509store.c
@@ -9,6 +9,7 @@
* (See the file 'LICENCE'.)
*/
#include "ossl.h"
+#include <rubysig.h>
#define WrapX509Store(klass, obj, st) do { \
if (!st) { \
diff --git a/ext/pty/.cvsignore b/ext/pty/.cvsignore
index 814345ece8..4088712231 100644
--- a/ext/pty/.cvsignore
+++ b/ext/pty/.cvsignore
@@ -1,4 +1,3 @@
Makefile
mkmf.log
*.def
-extconf.h
diff --git a/ext/pty/depend b/ext/pty/depend
index 2249eb8fcd..888be6c301 100644
--- a/ext/pty/depend
+++ b/ext/pty/depend
@@ -1 +1 @@
-pty.o: pty.c $(hdrdir)/ruby.h $(topdir)/config.h $(hdrdir)/defines.h $(hdrdir)/io.h
+pty.o: pty.c $(hdrdir)/ruby.h $(topdir)/config.h $(hdrdir)/defines.h
diff --git a/ext/pty/expect_sample.rb b/ext/pty/expect_sample.rb
index d3b072b83c..2a2e29f866 100644
--- a/ext/pty/expect_sample.rb
+++ b/ext/pty/expect_sample.rb
@@ -12,9 +12,9 @@ require 'expect'
fnames = []
PTY.spawn("ftp ftp.ruby-lang.org") do |r_f,w_f,pid|
w_f.sync = true
-
+
$expect_verbose = false
-
+
if !ENV['USER'].nil?
username = ENV['USER']
elsif !ENV['LOGNAME'].nil?
@@ -22,14 +22,14 @@ PTY.spawn("ftp ftp.ruby-lang.org") do |r_f,w_f,pid|
else
username = 'guest'
end
-
+
r_f.expect(/^(Name).*: |(word):|> /) do
w_f.puts($1 ? "ftp" : $2 ? "#{username}@" : "cd pub/ruby")
end
r_f.expect("> ") do
w_f.print "dir\n"
end
-
+
r_f.expect(/[^\-]> /) do |output|
for x in output[0].split("\n")
if x =~ /(ruby.*?\.tar\.gz)/ then
diff --git a/ext/pty/extconf.rb b/ext/pty/extconf.rb
index 3d6d0f1e46..5e126fe0cf 100644
--- a/ext/pty/extconf.rb
+++ b/ext/pty/extconf.rb
@@ -1,14 +1,12 @@
require 'mkmf'
-if /mswin|mingw|bccwin/ !~ RUBY_PLATFORM
+if /mswin32|mingw|bccwin32/ !~ 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_library("util", "openpty")
- if have_func("posix_openpt") or
- have_func("openpty") or
+ if have_func("openpty") or
have_func("_getpty") or
have_func("ptsname") or
have_func("ioctl")
diff --git a/ext/pty/pty.c b/ext/pty/pty.c
index b4394c207c..939335242f 100644
--- a/ext/pty/pty.c
+++ b/ext/pty/pty.c
@@ -1,8 +1,4 @@
-#include "ruby/config.h"
-#ifdef RUBY_EXTCONF_H
-#include RUBY_EXTCONF_H
-#endif
-#include <stdlib.h>
+#include "config.h"
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
@@ -16,9 +12,6 @@
#ifdef HAVE_LIBUTIL_H
#include <libutil.h>
#endif
-#ifdef HAVE_UTIL_H
-#include <util.h>
-#endif
#ifdef HAVE_PTY_H
#include <pty.h>
#endif
@@ -29,9 +22,9 @@
#endif
#include <ctype.h>
-#include "ruby/ruby.h"
-#include "ruby/io.h"
-#include "ruby/util.h"
+#include "ruby.h"
+#include "rubyio.h"
+#include "util.h"
#include <signal.h>
#ifdef HAVE_SYS_STROPTS_H
@@ -123,7 +116,8 @@ char MasterDevice[] = "/dev/pty%s",
static VALUE eChildExited;
static VALUE
-echild_status(VALUE self)
+echild_status(self)
+ VALUE self;
{
return rb_ivar_get(self, rb_intern("status"));
}
@@ -131,110 +125,86 @@ echild_status(VALUE self)
struct pty_info {
int fd;
rb_pid_t child_pid;
+ VALUE thread;
};
-static void getDevice(int*, int*, char [DEVICELEN], int);
+static void
+raise_from_wait(state, info)
+ struct pty_info *info;
+ char *state;
+{
+ extern VALUE rb_last_status;
+ char buf[1024];
+ VALUE exc;
-struct exec_info {
- int argc;
- VALUE *argv;
-};
+ snprintf(buf, sizeof(buf), "pty - %s: %ld", state, (long)info->child_pid);
+ exc = rb_exc_new2(eChildExited, buf);
+ rb_iv_set(exc, "status", rb_last_status);
+ rb_funcall(info->thread, rb_intern("raise"), 1, exc);
+}
static VALUE
-pty_exec(VALUE v)
+pty_syswait(info)
+ struct pty_info *info;
{
- struct exec_info *arg = (struct exec_info *)v;
- return rb_f_exec(arg->argc, arg->argv);
+ int cpid, status;
+
+ for (;;) {
+ cpid = rb_waitpid(info->child_pid, &status, WUNTRACED);
+ if (cpid == -1) return Qnil;
+
+#if defined(WIFSTOPPED)
+#elif defined(IF_STOPPED)
+#define WIFSTOPPED(status) IF_STOPPED(status)
+#else
+---->> Either IF_STOPPED or WIFSTOPPED is needed <<----
+#endif /* WIFSTOPPED | IF_STOPPED */
+ if (WIFSTOPPED(status)) { /* suspend */
+ raise_from_wait("stopped", info);
+ }
+ else if (kill(info->child_pid, 0) == 0) {
+ raise_from_wait("changed", info);
+ }
+ else {
+ raise_from_wait("exited", info);
+ return Qnil;
+ }
+ }
}
-struct child_info {
- int master, slave;
- char *slavename;
+static void getDevice _((int*, int*, char [DEVICELEN]));
+
+struct exec_info {
int argc;
VALUE *argv;
};
-static int
-chfunc(void *data)
-{
- struct child_info *carg = data;
- int master = carg->master;
- int slave = carg->slave;
- int argc = carg->argc;
- VALUE *argv = carg->argv;
-
- struct exec_info arg;
- int status;
-
- /*
- * Set free from process group and controlling terminal
- */
-#ifdef HAVE_SETSID
- (void) setsid();
-#else /* HAS_SETSID */
-# ifdef HAVE_SETPGRP
-# ifdef SETGRP_VOID
- if (setpgrp() == -1)
- perror("setpgrp()");
-# else /* SETGRP_VOID */
- if (setpgrp(0, getpid()) == -1)
- rb_sys_fail("setpgrp()");
- {
- int i = open("/dev/tty", O_RDONLY);
- if (i < 0) rb_sys_fail("/dev/tty");
- if (ioctl(i, TIOCNOTTY, (char *)0))
- perror("ioctl(TIOCNOTTY)");
- close(i);
- }
-# endif /* SETGRP_VOID */
-# endif /* HAVE_SETPGRP */
-#endif /* HAS_SETSID */
-
- /*
- * obtain new controlling terminal
- */
-#if defined(TIOCSCTTY)
- close(master);
- (void) ioctl(slave, TIOCSCTTY, (char *)0);
- /* errors ignored for sun */
-#else
- close(slave);
- slave = open(carg->slavename, O_RDWR);
- if (slave < 0) {
- perror("open: pty slave");
- _exit(1);
- }
- close(master);
-#endif
- write(slave, "", 1);
- dup2(slave,0);
- dup2(slave,1);
- dup2(slave,2);
- close(slave);
-#if defined(HAVE_SETEUID) || defined(HAVE_SETREUID) || defined(HAVE_SETRESUID)
- seteuid(getuid());
-#endif
+static VALUE pty_exec _((VALUE v));
- arg.argc = argc;
- arg.argv = argv;
- rb_protect(pty_exec, (VALUE)&arg, &status);
- sleep(1);
- _exit(1);
+static VALUE
+pty_exec(v)
+ VALUE v;
+{
+ struct exec_info *arg = (struct exec_info *)v;
+ return rb_f_exec(arg->argc, arg->argv);
}
static void
-establishShell(int argc, VALUE *argv, struct pty_info *info,
- char SlaveName[DEVICELEN])
+establishShell(argc, argv, info, SlaveName)
+ int argc;
+ VALUE *argv;
+ struct pty_info *info;
+ char SlaveName[DEVICELEN];
{
- int master,slave;
- rb_pid_t pid;
+ int i,master,slave;
char *p, tmp, *getenv();
struct passwd *pwent;
VALUE v;
- struct child_info carg;
+ struct exec_info arg;
+ int status;
if (argc == 0) {
- const char *shellname;
+ char *shellname;
if ((p = getenv("SHELL")) != NULL) {
shellname = p;
@@ -250,80 +220,95 @@ establishShell(int argc, VALUE *argv, struct pty_info *info,
argc = 1;
argv = &v;
}
+ getDevice(&master, &slave, SlaveName);
- getDevice(&master, &slave, SlaveName, 0);
+ info->thread = rb_thread_current();
+ if((i = fork()) < 0) {
+ close(master);
+ close(slave);
+ rb_sys_fail("fork failed");
+ }
- carg.master = master;
- carg.slave = slave;
- carg.slavename = SlaveName;
- carg.argc = argc;
- carg.argv = argv;
- pid = rb_fork(0, chfunc, &carg, Qnil);
+ if(i == 0) { /* child */
+ /*
+ * Set free from process group and controlling terminal
+ */
+#ifdef HAVE_SETSID
+ (void) setsid();
+#else /* HAS_SETSID */
+# ifdef HAVE_SETPGRP
+# ifdef SETGRP_VOID
+ if (setpgrp() == -1)
+ perror("setpgrp()");
+# else /* SETGRP_VOID */
+ if (setpgrp(0, getpid()) == -1)
+ rb_sys_fail("setpgrp()");
+ if ((i = open("/dev/tty", O_RDONLY)) < 0)
+ rb_sys_fail("/dev/tty");
+ else {
+ if (ioctl(i, TIOCNOTTY, (char *)0))
+ perror("ioctl(TIOCNOTTY)");
+ close(i);
+ }
+# endif /* SETGRP_VOID */
+# endif /* HAVE_SETPGRP */
+#endif /* HAS_SETSID */
- if (pid < 0) {
+ /*
+ * obtain new controlling terminal
+ */
+#if defined(TIOCSCTTY)
close(master);
+ (void) ioctl(slave, TIOCSCTTY, (char *)0);
+ /* errors ignored for sun */
+#else
close(slave);
- rb_sys_fail("fork failed");
+ slave = open(SlaveName, O_RDWR);
+ if (slave < 0) {
+ perror("open: pty slave");
+ _exit(1);
+ }
+ close(master);
+#endif
+ write(slave, "", 1);
+ dup2(slave,0);
+ dup2(slave,1);
+ dup2(slave,2);
+ close(slave);
+#if defined(HAVE_SETEUID) || defined(HAVE_SETREUID) || defined(HAVE_SETRESUID)
+ seteuid(getuid());
+#endif
+
+ arg.argc = argc;
+ arg.argv = argv;
+ rb_protect(pty_exec, (VALUE)&arg, &status);
+ sleep(1);
+ _exit(1);
}
read(master, &tmp, 1);
close(slave);
- info->child_pid = pid;
+ info->child_pid = i;
info->fd = master;
}
-static int
-no_mesg(char *slavedevice, int nomesg)
+static VALUE
+pty_finalize_syswait(info)
+ struct pty_info *info;
{
- if (nomesg)
- return chmod(slavedevice, 0600);
- else
- return 0;
+ rb_thread_kill(info->thread);
+ rb_funcall(info->thread, rb_intern("value"), 0);
+ rb_detach_process(info->child_pid);
+ return Qnil;
}
static int
-get_device_once(int *master, int *slave, char SlaveName[DEVICELEN], int nomesg, int fail)
+get_device_once(master, slave, SlaveName, fail)
+ int *master, *slave, fail;
+ char SlaveName[DEVICELEN];
{
-#if defined(HAVE_POSIX_OPENPT)
- 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 ((masterfd = posix_openpt(O_RDWR|O_NOCTTY)) == -1) goto error;
- if (sigaction(SIGCHLD, &dfl, &old) == -1) goto error;
- if (grantpt(masterfd) == -1) goto grantpt_error;
- if (sigaction(SIGCHLD, &old, NULL) == -1) goto error;
- if (unlockpt(masterfd) == -1) goto error;
- if ((slavedevice = ptsname(masterfd)) == NULL) goto error;
- if (no_mesg(slavedevice, nomesg) == -1) goto error;
- if ((slavefd = open(slavedevice, O_RDWR|O_NOCTTY, 0)) == -1) goto error;
-
-#if defined I_PUSH && !defined linux
- if (ioctl(slavefd, I_PUSH, "ptem") == -1) goto error;
- if (ioctl(slavefd, I_PUSH, "ldterm") == -1) goto error;
- if (ioctl(slavefd, I_PUSH, "ttcompat") == -1) goto error;
-#endif
-
- *master = masterfd;
- *slave = slavefd;
- strlcpy(SlaveName, slavedevice, DEVICELEN);
- return 0;
-
- grantpt_error:
- sigaction(SIGCHLD, &old, NULL);
- error:
- if (slavefd != -1) close(slavefd);
- if (masterfd != -1) close(masterfd);
- if (!fail) {
- rb_raise(rb_eRuntimeError, "can't get Master/Slave device");
- }
- return -1;
-#elif defined HAVE_OPENPTY
+#if defined HAVE_OPENPTY
/*
* Use openpty(3) of 4.3BSD Reno and later,
* or the same interface function.
@@ -333,210 +318,104 @@ get_device_once(int *master, int *slave, char SlaveName[DEVICELEN], int nomesg,
if (!fail) return -1;
rb_raise(rb_eRuntimeError, "openpty() failed");
}
- if (no_mesg(SlaveName, nomesg) == -1) {
- if (!fail) return -1;
- rb_raise(rb_eRuntimeError, "can't chmod slave pty");
- }
return 0;
-
#elif defined HAVE__GETPTY
char *name;
- mode_t mode = nomesg ? 0600 : 0622;
- if (!(name = _getpty(master, O_RDWR, mode, 0))) {
+ if (!(name = _getpty(master, O_RDWR, 0622, 0))) {
if (!fail) return -1;
rb_raise(rb_eRuntimeError, "_getpty() failed");
}
*slave = open(name, O_RDWR);
- strlcpy(SlaveName, name, DEVICELEN);
+ strncpy(SlaveName, name, sizeof SlaveName);
return 0;
-#elif defined(HAVE_PTSNAME)
- int masterfd = -1, slavefd = -1;
- char *slavedevice;
+#else /* HAVE__GETPTY */
+ int i,j;
+
+#ifdef HAVE_PTSNAME
+ char *pn;
void (*s)();
extern char *ptsname(int);
extern int unlockpt(int);
extern int grantpt(int);
- if((masterfd = open("/dev/ptmx", O_RDWR, 0)) == -1) goto error;
- s = signal(SIGCHLD, SIG_DFL);
- if(grantpt(masterfd) == -1) goto error;
- signal(SIGCHLD, s);
- if(unlockpt(masterfd) == -1) goto error;
- if((slavedevice = ptsname(masterfd)) == NULL) goto error;
- if (no_mesg(slavedevice, nomesg) == -1) goto error;
- if((slavefd = open(slavedevice, O_RDWR, 0)) == -1) goto error;
+ if((i = open("/dev/ptmx", O_RDWR, 0)) != -1) {
+ s = signal(SIGCHLD, SIG_DFL);
+ if(grantpt(i) != -1) {
+ signal(SIGCHLD, s);
+ if(unlockpt(i) != -1) {
+ if((pn = ptsname(i)) != NULL) {
+ if((j = open(pn, O_RDWR, 0)) != -1) {
#if defined I_PUSH && !defined linux
- if(ioctl(slavefd, I_PUSH, "ptem") == -1) goto error;
- if(ioctl(slavefd, I_PUSH, "ldterm") == -1) goto error;
- ioctl(slavefd, I_PUSH, "ttcompat");
+ if(ioctl(j, I_PUSH, "ptem") != -1) {
+ if(ioctl(j, I_PUSH, "ldterm") != -1) {
+ ioctl(j, I_PUSH, "ttcompat");
#endif
- *master = masterfd;
- *slave = slavefd;
- strlcpy(SlaveName, slavedevice, DEVICELEN);
- return 0;
-
- error:
- if (slavefd != -1) close(slavefd);
- if (masterfd != -1) close(masterfd);
+ *master = i;
+ *slave = j;
+ strncpy(SlaveName, pn, sizeof SlaveName);
+ return 0;
+#if defined I_PUSH && !defined linux
+ }
+ }
+#endif
+ }
+ }
+ }
+ }
+ close(i);
+ }
if (!fail) rb_raise(rb_eRuntimeError, "can't get Master/Slave device");
return -1;
#else
- int masterfd = -1, slavefd = -1;
- const char *const *p;
+ char **p;
char MasterName[DEVICELEN];
for (p = deviceNo; *p != NULL; p++) {
snprintf(MasterName, sizeof MasterName, MasterDevice, *p);
- if ((masterfd = open(MasterName,O_RDWR,0)) >= 0) {
- *master = masterfd;
- snprintf(SlaveName, DEVICELEN, SlaveDevice, *p);
- if ((slavefd = open(SlaveName,O_RDWR,0)) >= 0) {
- *slave = slavefd;
- if (chown(SlaveName, getuid(), getgid()) != 0) goto error;
- if (chmod(SlaveName, nomesg ? 0600 : 0622) != 0) goto error;
+ if ((i = open(MasterName,O_RDWR,0)) >= 0) {
+ *master = i;
+ snprintf(SlaveName, sizeof SlaveName, SlaveDevice, *p);
+ if ((j = open(SlaveName,O_RDWR,0)) >= 0) {
+ *slave = j;
+ chown(SlaveName, getuid(), getgid());
+ chmod(SlaveName, 0622);
return 0;
}
- close(masterfd);
+ close(i);
}
}
- error:
- if (slavefd != -1) close(slavefd);
- if (masterfd != -1) close(masterfd);
if (fail) rb_raise(rb_eRuntimeError, "can't get %s", SlaveName);
return -1;
#endif
+#endif
}
static void
-getDevice(int *master, int *slave, char SlaveName[DEVICELEN], int nomesg)
+getDevice(master, slave, slavename)
+ int *master, *slave;
+ char slavename[DEVICELEN];
{
- if (get_device_once(master, slave, SlaveName, nomesg, 0)) {
+ if (get_device_once(master, slave, slavename, 0)) {
rb_gc();
- get_device_once(master, slave, SlaveName, nomesg, 1);
+ get_device_once(master, slave, slavename, 1);
}
}
+/* ruby function: getpty */
static VALUE
-pty_close_pty(VALUE assoc)
-{
- VALUE io;
- int i;
-
- for (i = 0; i < 2; i++) {
- io = rb_ary_entry(assoc, i);
- if (TYPE(io) == T_FILE && 0 <= RFILE(io)->fptr->fd)
- rb_io_close(io);
- }
- return Qnil;
-}
-
-/*
- * call-seq:
- * PTY.open => [master_io, slave_file]
- * PTY.open {|master_io, slave_file| ... } => block value
- *
- * Allocates a pty (pseudo-terminal).
- *
- * It returns an array which contains an IO object and a File object.
- * The former is the master of the pty.
- * The latter is the slave of the pty.
- *
- * If a block is given, it yields the array instead of return.
- * The value of the block is returned.
- * master_io and slave_file is closed when return if they are not closed.
- *
- * The path name of the terminal device can be gotten by slave_file.path.
- *
- * PTY.open {|m, s|
- * p m #=> #<IO: pty /dev/pts/1>
- * p s #=> #<File:/dev/pts/1>
- * p s.path #=> "/dev/pts/1"
- * }
- *
- * # Change the buffering type in factor command,
- * # assuming that factor uses stdio for stdout buffering.
- * # If IO.pipe is used instead of PTY.open,
- * # this code deadlocks because factor's stdout is fully buffered.
- * m, s = PTY.open
- * system("stty raw", :in=>s) # disable newline conversion.
- * r, w = IO.pipe
- * pid = spawn("factor", :in=>r, :out=>s)
- * r.close
- * s.close
- * w.puts "42"
- * p m.gets #=> "42: 2 3 7\n"
- * w.puts "144"
- * p m.gets #=> "144: 2 2 2 2 3 3\n"
- *
- */
-static VALUE
-pty_open(VALUE klass)
-{
- int master_fd, slave_fd;
- char slavename[DEVICELEN];
- VALUE master_io, slave_file;
- rb_io_t *master_fptr, *slave_fptr;
- VALUE assoc;
-
- getDevice(&master_fd, &slave_fd, slavename, 1);
-
- master_io = rb_obj_alloc(rb_cIO);
- MakeOpenFile(master_io, master_fptr);
- master_fptr->mode = FMODE_READWRITE | FMODE_SYNC | FMODE_DUPLEX;
- master_fptr->fd = master_fd;
- master_fptr->pathv = rb_obj_freeze(rb_sprintf(" pty %s", slavename));
-
- slave_file = rb_obj_alloc(rb_cFile);
- MakeOpenFile(slave_file, slave_fptr);
- slave_fptr->mode = FMODE_READWRITE | FMODE_SYNC | FMODE_DUPLEX | FMODE_TTY;
- slave_fptr->fd = slave_fd;
- slave_fptr->pathv = rb_obj_freeze(rb_str_new_cstr(slavename));
-
- assoc = rb_assoc_new(master_io, slave_file);
- if (rb_block_given_p()) {
- return rb_ensure(rb_yield, assoc, pty_close_pty, assoc);
- }
- return assoc;
-}
-
-static VALUE
-pty_detach_process(struct pty_info *info)
-{
- rb_detach_process(info->child_pid);
- return Qnil;
-}
-
-/*
- * call-seq:
- * PTY.spawn(command...) {|r, w, pid| ... } => nil
- * PTY.spawn(command...) => r, w, pid
- * PTY.getpty(command...) {|r, w, pid| ... } => nil
- * PTY.getpty(command...) => r, w, pid
- *
- * spawns the specified command on a newly allocated pty.
- *
- * The command's controlling tty is set to the slave device of the pty.
- * Also its standard input/output/error is redirected to the slave device.
- *
- * PTY.spawn returns two IO objects and PID.
- * PID is the process ID of the command.
- * The two IO objects are connected to the master device of the pty.
- * The first IO object is opened as read mode and
- * The second is opened as write mode.
- *
- * If a block is given, two IO objects and PID is yielded.
- *
- */
-static VALUE
-pty_getpty(int argc, VALUE *argv, VALUE self)
+pty_getpty(argc, argv, self)
+ int argc;
+ VALUE *argv;
+ VALUE self;
{
VALUE res;
struct pty_info info;
+ struct pty_info thinfo;
rb_io_t *wfptr,*rfptr;
VALUE rport = rb_obj_alloc(rb_cFile);
VALUE wport = rb_obj_alloc(rb_cFile);
@@ -548,69 +427,46 @@ pty_getpty(int argc, VALUE *argv, VALUE self)
establishShell(argc, argv, &info, SlaveName);
rfptr->mode = rb_io_mode_flags("r");
- rfptr->fd = info.fd;
- rfptr->pathv = rb_obj_freeze(rb_str_new_cstr(SlaveName));
+ rfptr->f = fdopen(info.fd, "r");
+ rfptr->path = strdup(SlaveName);
wfptr->mode = rb_io_mode_flags("w") | FMODE_SYNC;
- wfptr->fd = dup(info.fd);
- if (wfptr->fd == -1)
- rb_sys_fail("dup()");
- wfptr->pathv = rfptr->pathv;
+ wfptr->f = fdopen(dup(info.fd), "w");
+ wfptr->path = strdup(SlaveName);
res = rb_ary_new2(3);
rb_ary_store(res,0,(VALUE)rport);
rb_ary_store(res,1,(VALUE)wport);
- rb_ary_store(res,2,PIDT2NUM(info.child_pid));
+ rb_ary_store(res,2,INT2FIX(info.child_pid));
+
+ thinfo.thread = rb_thread_create(pty_syswait, (void*)&info);
+ thinfo.child_pid = info.child_pid;
+ rb_thread_schedule();
if (rb_block_given_p()) {
- rb_ensure(rb_yield, res, pty_detach_process, (VALUE)&info);
+ rb_ensure(rb_yield, res, pty_finalize_syswait, (VALUE)&thinfo);
return Qnil;
}
return res;
}
-static void
-raise_from_check(pid_t pid, int status)
+/* ruby function: protect_signal - obsolete */
+static VALUE
+pty_protect(self)
+ VALUE self;
{
- const char *state;
- char buf[1024];
- VALUE exc;
-
-#if defined(WIFSTOPPED)
-#elif defined(IF_STOPPED)
-#define WIFSTOPPED(status) IF_STOPPED(status)
-#else
----->> Either IF_STOPPED or WIFSTOPPED is needed <<----
-#endif /* WIFSTOPPED | IF_STOPPED */
- if (WIFSTOPPED(status)) { /* suspend */
- state = "stopped";
- }
- else if (kill(pid, 0) == 0) {
- state = "changed";
- }
- else {
- state = "exited";
- }
- snprintf(buf, sizeof(buf), "pty - %s: %ld", state, (long)pid);
- exc = rb_exc_new2(eChildExited, buf);
- rb_iv_set(exc, "status", rb_last_status_get());
- rb_exc_raise(exc);
+ rb_warn("PTY::protect_signal is no longer needed");
+ rb_yield(Qnil);
+ return self;
}
+/* ruby function: reset_signal - obsolete */
static VALUE
-pty_check(int argc, VALUE *argv, VALUE self)
+pty_reset_signal(self)
+ VALUE self;
{
- VALUE pid, exc;
- pid_t cpid;
- int status;
-
- rb_scan_args(argc, argv, "11", &pid, &exc);
- cpid = rb_waitpid(NUM2PIDT(pid), &status, WUNTRACED);
- if (cpid == -1) return Qnil;
-
- if (!RTEST(exc)) return status;
- raise_from_check(pid, status);
- return Qnil; /* not reached */
+ rb_warn("PTY::reset_signal is no longer needed");
+ return self;
}
static VALUE cPTY;
@@ -621,8 +477,8 @@ Init_pty()
cPTY = rb_define_module("PTY");
rb_define_module_function(cPTY,"getpty",pty_getpty,-1);
rb_define_module_function(cPTY,"spawn",pty_getpty,-1);
- rb_define_singleton_method(cPTY,"check",pty_check,-1);
- rb_define_singleton_method(cPTY,"open",pty_open,0);
+ rb_define_module_function(cPTY,"protect_signal",pty_protect,0);
+ rb_define_module_function(cPTY,"reset_signal",pty_reset_signal,0);
eChildExited = rb_define_class_under(cPTY,"ChildExited",rb_eRuntimeError);
rb_define_method(eChildExited,"status",echild_status,0);
diff --git a/ext/pty/script.rb b/ext/pty/script.rb
index 903a6f75bd..dbb933171f 100644
--- a/ext/pty/script.rb
+++ b/ext/pty/script.rb
@@ -18,7 +18,7 @@ PTY.spawn("/bin/csh") do |r_pty,w_pty,pid|
w_pty.flush
end
end
-
+
begin
while true
c = r_pty.sysread(512)
diff --git a/ext/purelib.rb b/ext/purelib.rb
index 6418fd618d..dbe514c34a 100644
--- a/ext/purelib.rb
+++ b/ext/purelib.rb
@@ -6,12 +6,5 @@ $:.each_with_index {|path, index|
end
}
if nul
- removed, $:[nul..-1] = $:[nul..-1], ["."]
- if defined?(Gem::QuickLoader)
- removed.each do |path|
- # replaces a fake rubygems by gem_prelude.rb with an alternative path
- index = $".index(File.join(path, 'rubygems.rb'))
- $"[index] = Gem::QuickLoader.path_to_full_rubygems_library if index
- end
- end
+ $:[nul..-1] = ["."]
end
diff --git a/ext/racc/cparse/.cvsignore b/ext/racc/cparse/.cvsignore
index 814345ece8..4088712231 100644
--- a/ext/racc/cparse/.cvsignore
+++ b/ext/racc/cparse/.cvsignore
@@ -1,4 +1,3 @@
Makefile
mkmf.log
*.def
-extconf.h
diff --git a/ext/racc/cparse/README b/ext/racc/cparse/README
deleted file mode 100644
index 80b4dce311..0000000000
--- a/ext/racc/cparse/README
+++ /dev/null
@@ -1,10 +0,0 @@
-Racc Runtime README
-===================
-
-This directory contains a runtime library of
-Racc parser generator. If you want to generate
-your own parser, you must get Racc full package.
-Get it from:
-
- http://raa.ruby-lang.org/list.rhtml?name=racc
-
diff --git a/ext/racc/cparse/cparse.c b/ext/racc/cparse/cparse.c
index d085158f11..18a26f670f 100644
--- a/ext/racc/cparse/cparse.c
+++ b/ext/racc/cparse/cparse.c
@@ -11,7 +11,8 @@
*/
-#include "ruby/ruby.h"
+#include "ruby.h"
+#include "version.h"
/* -----------------------------------------------------------------------
Important Constants
@@ -64,6 +65,9 @@ static ID id_d_e_pop;
#ifndef LONG2NUM
# define LONG2NUM(i) INT2NUM(i)
#endif
+#if RUBY_VERSION_CODE >= 190
+# define HAVE_RB_BLOCK_CALL 1
+#endif
static ID value_to_id _((VALUE v));
static inline long num_to_long _((VALUE n));
@@ -84,7 +88,7 @@ num_to_long(VALUE n)
}
#define AREF(s, idx) \
- ((0 <= idx && idx < RARRAY_LEN(s)) ? RARRAY_PTR(s)[idx] : Qnil)
+ ((0 <= idx && idx < RARRAY(s)->len) ? RARRAY(s)->ptr[idx] : Qnil)
/* -----------------------------------------------------------------------
Parser Stack Interfaces
@@ -97,8 +101,8 @@ static VALUE
get_stack_tail(VALUE stack, long len)
{
if (len < 0) return Qnil; /* system error */
- if (len > RARRAY_LEN(stack)) len = RARRAY_LEN(stack);
- return rb_ary_new4(len, RARRAY_PTR(stack) + RARRAY_LEN(stack) - len);
+ if (len > RARRAY(stack)->len) len = RARRAY(stack)->len;
+ return rb_ary_new4(len, RARRAY(stack)->ptr + RARRAY(stack)->len - len);
}
static void
@@ -112,10 +116,10 @@ cut_stack_tail(VALUE stack, long len)
#define STACK_INIT_LEN 64
#define NEW_STACK() rb_ary_new2(STACK_INIT_LEN)
-#define PUSH(s, i) rb_ary_store(s, RARRAY_LEN(s), i)
+#define PUSH(s, i) rb_ary_store(s, RARRAY(s)->len, i)
#define POP(s) rb_ary_pop(s)
#define LAST_I(s) \
- ((RARRAY_LEN(s) > 0) ? RARRAY_PTR(s)[RARRAY_LEN(s) - 1] : Qnil)
+ ((RARRAY(s)->len > 0) ? RARRAY(s)->ptr[RARRAY(s)->len - 1] : Qnil)
#define GET_TAIL(s, len) get_stack_tail(s, len)
#define CUT_TAIL(s, len) cut_stack_tail(s, len)
@@ -325,23 +329,23 @@ initialize_params(VALUE vparams, VALUE parser, VALUE arg, VALUE lexer, VALUE lex
v->debug = RTEST(rb_ivar_get(parser, id_yydebug));
Check_Type(arg, T_ARRAY);
- if (!(13 <= RARRAY_LEN(arg) && RARRAY_LEN(arg) <= 14))
- rb_raise(RaccBug, "[Racc Bug] wrong arg.size %ld", RARRAY_LEN(arg));
- v->action_table = assert_array (RARRAY_PTR(arg)[ 0]);
- v->action_check = assert_array (RARRAY_PTR(arg)[ 1]);
- v->action_default = assert_array (RARRAY_PTR(arg)[ 2]);
- v->action_pointer = assert_array (RARRAY_PTR(arg)[ 3]);
- v->goto_table = assert_array (RARRAY_PTR(arg)[ 4]);
- v->goto_check = assert_array (RARRAY_PTR(arg)[ 5]);
- v->goto_default = assert_array (RARRAY_PTR(arg)[ 6]);
- v->goto_pointer = assert_array (RARRAY_PTR(arg)[ 7]);
- v->nt_base = assert_integer(RARRAY_PTR(arg)[ 8]);
- v->reduce_table = assert_array (RARRAY_PTR(arg)[ 9]);
- v->token_table = assert_hash (RARRAY_PTR(arg)[10]);
- v->shift_n = assert_integer(RARRAY_PTR(arg)[11]);
- v->reduce_n = assert_integer(RARRAY_PTR(arg)[12]);
- if (RARRAY_LEN(arg) > 13) {
- v->use_result_var = RTEST(RARRAY_PTR(arg)[13]);
+ if (!(13 <= RARRAY(arg)->len && RARRAY(arg)->len <= 14))
+ rb_raise(RaccBug, "[Racc Bug] wrong arg.size %ld", RARRAY(arg)->len);
+ v->action_table = assert_array (RARRAY(arg)->ptr[ 0]);
+ v->action_check = assert_array (RARRAY(arg)->ptr[ 1]);
+ v->action_default = assert_array (RARRAY(arg)->ptr[ 2]);
+ v->action_pointer = assert_array (RARRAY(arg)->ptr[ 3]);
+ v->goto_table = assert_array (RARRAY(arg)->ptr[ 4]);
+ v->goto_check = assert_array (RARRAY(arg)->ptr[ 5]);
+ v->goto_default = assert_array (RARRAY(arg)->ptr[ 6]);
+ v->goto_pointer = assert_array (RARRAY(arg)->ptr[ 7]);
+ v->nt_base = assert_integer(RARRAY(arg)->ptr[ 8]);
+ v->reduce_table = assert_array (RARRAY(arg)->ptr[ 9]);
+ v->token_table = assert_hash (RARRAY(arg)->ptr[10]);
+ v->shift_n = assert_integer(RARRAY(arg)->ptr[11]);
+ v->reduce_n = assert_integer(RARRAY(arg)->ptr[12]);
+ if (RARRAY(arg)->len > 13) {
+ v->use_result_var = RTEST(RARRAY(arg)->ptr[13]);
}
else {
v->use_result_var = Qtrue;
@@ -416,12 +420,12 @@ extract_user_token(struct cparse_params *v, VALUE block_args,
v->lex_is_iterator ? "yielded" : "returned",
rb_class2name(CLASS_OF(block_args)));
}
- if (RARRAY_LEN(block_args) != 2) {
+ if (RARRAY(block_args)->len != 2) {
rb_raise(rb_eArgError,
"%s() %s wrong size of array (%ld for 2)",
v->lex_is_iterator ? rb_id2name(v->lexmid) : "next_token",
v->lex_is_iterator ? "yielded" : "returned",
- RARRAY_LEN(block_args));
+ RARRAY(block_args)->len);
}
*tok = AREF(block_args, 0);
*val = AREF(block_args, 1);
@@ -557,7 +561,7 @@ parse_main(struct cparse_params *v, VALUE tok, VALUE val, int resume)
accept:
if (v->debug) rb_funcall(v->parser, id_d_accept, 0);
- v->retval = RARRAY_PTR(v->vstack)[0];
+ v->retval = RARRAY(v->vstack)->ptr[0];
v->fin = CP_FIN_ACCEPT;
return;
@@ -617,7 +621,7 @@ parse_main(struct cparse_params *v, VALUE tok, VALUE val, int resume)
error_pop:
D_puts("(err) act not found: can't handle error token; pop");
- if (RARRAY_LEN(v->state) <= 1) {
+ if (RARRAY(v->state)->len <= 1) {
v->retval = Qnil;
v->fin = CP_FIN_CANTPOP;
return;
@@ -686,9 +690,9 @@ reduce0(VALUE val, VALUE data, VALUE self)
VALUE goto_state;
Data_Get_Struct(data, struct cparse_params, v);
- reduce_len = RARRAY_PTR(v->reduce_table)[v->ruleno];
- reduce_to = RARRAY_PTR(v->reduce_table)[v->ruleno+1];
- method_id = RARRAY_PTR(v->reduce_table)[v->ruleno+2];
+ reduce_len = RARRAY(v->reduce_table)->ptr[v->ruleno];
+ reduce_to = RARRAY(v->reduce_table)->ptr[v->ruleno+1];
+ method_id = RARRAY(v->reduce_table)->ptr[v->ruleno+2];
len = NUM2LONG(reduce_len);
mid = value_to_id(method_id);
@@ -703,10 +707,10 @@ reduce0(VALUE val, VALUE data, VALUE self)
else {
if (mid != id_noreduce) {
tmp_v = GET_TAIL(v->vstack, len);
- tmp = RARRAY_PTR(tmp_v)[0];
+ tmp = RARRAY(tmp_v)->ptr[0];
}
else {
- tmp = RARRAY_PTR(v->vstack)[ RARRAY_LEN(v->vstack) - len ];
+ tmp = RARRAY(v->vstack)->ptr[ RARRAY(v->vstack)->len - len ];
}
CUT_TAIL(v->vstack, len);
if (v->debug) {
@@ -735,7 +739,7 @@ reduce0(VALUE val, VALUE data, VALUE self)
}
/* calculate transition state */
- if (RARRAY_LEN(v->state) == 0)
+ if (RARRAY(v->state)->len == 0)
rb_raise(RaccBug, "state stack unexpectedly empty");
k2 = num_to_long(LAST_I(v->state));
k1 = num_to_long(reduce_to) - v->nt_base;
diff --git a/ext/racc/cparse/extconf.rb b/ext/racc/cparse/extconf.rb
index 3710f6f7e7..dd953a7e15 100644
--- a/ext/racc/cparse/extconf.rb
+++ b/ext/racc/cparse/extconf.rb
@@ -1,5 +1,4 @@
# $Id$
require 'mkmf'
-have_func('rb_block_call', 'ruby/ruby.h')
create_makefile 'racc/cparse'
diff --git a/ext/readline/.cvsignore b/ext/readline/.cvsignore
index 814345ece8..4088712231 100644
--- a/ext/readline/.cvsignore
+++ b/ext/readline/.cvsignore
@@ -1,4 +1,3 @@
Makefile
mkmf.log
*.def
-extconf.h
diff --git a/ext/readline/README b/ext/readline/README
index 57c51b5f5d..9bbf325c99 100644
--- a/ext/readline/README
+++ b/ext/readline/README
@@ -1,10 +1,62 @@
-The Readline module provides interface for GNU Readline.
-This module defines a number of methods to facilitate completion
-and accesses input history from the Ruby interpreter.
-This module supported Edit Line(libedit) too.
-libedit is compatible with GNU Readline.
+Extension for GNU Readline Library
-GNU Readline:: http://www.gnu.org/directory/readline.html
-libedit:: http://www.thrysoee.dk/editline/
+Example:
-See RDoc for Readline module.
+ require "readline"
+ include Readline
+
+ line = readline("Prompt> ", true)
+
+[Readline]
+
+<module function>
+
+readline(prompt, add_history=nil)
+
+ Reads one line with line editing. The inputted line is added to the
+ history if add_history is true.
+
+<class methods>
+
+completion_proc = proc
+
+ Specifies a Proc object to determine completion behavior. It
+ should take input-string, and return an array of completion
+ candidates.
+
+completion_proc
+
+ Returns the completion Proc object.
+
+completion_case_fold = bool
+
+ Sets whether or not to ignore case on completion.
+
+completion_case_fold
+
+ Returns true if completion ignores case.
+
+completion_append_character = char
+
+ Specifies a character to be appended on completion.
+ Nothing will be appended if an empty string ("") or nil is
+ specified.
+
+completion_append_character
+
+ Returns a string containing a character to be appended on
+ completion. The default is a space (" ").
+
+vi_editing_mode
+
+ Specifies VI editing mode.
+
+emacs_editing_mode
+
+ Specifies Emacs editing mode.
+
+<class constants>
+
+HISTORY
+
+The history buffer. It behaves just like an array.
diff --git a/ext/readline/README.ja b/ext/readline/README.ja
index 5c8e0da508..beb951fbf0 100644
--- a/ext/readline/README.ja
+++ b/ext/readline/README.ja
@@ -1,437 +1,63 @@
-GNU Readline ˤ륳ޥɥ饤ϥ󥿥ե󶡤⥸塼
-ǤGNU Readline θߴ饤֥ΤҤȤĤǤ Edit Line(libedit)
-ݡȤƤޤ
+GNU Readline LibraryѤ뤿γĥ⥸塼Ǥ
-GNU Readline:: http://www.gnu.org/directory/readline.html
-libedit:: http://www.thrysoee.dk/editline/
+require "readline"
+include Readline
-Readline.readline Ѥƥ桼ϤǤޤΤȤ
-GNU Readline Τ褦Ϥ䴰Emacs Τ褦ʥʤɤǤޤ
+line = readline("Prompt> ", true)
- require "readline"
- while buf = Readline.readline("> ", true)
- p buf
- end
+Τ褦˻ѤƤ
-桼ϤƤ(ʲҥȥ)ȤƵϿ뤳ȤǤޤ
- Readline::HISTORY Ѥƥҥȥ˥Ǥޤ
+[Readline]
- require "readline"
- while buf = Readline.readline("> ", true)
- p Readline::HISTORY.to_a
- print("-> ", buf, "\n")
- end
+<⥸塼ؿ>
-Ѥ饤֥ˤꡢĤΥ᥽åɤ㳰 NotImplementedError
-ȯޤ
+readline(prompt, add_history=nil)
-$SAFE 4 ξ硢¿Υ᥽åɤ㳰 SecurityError ȯޤ
+ Ϥɤ߹ߤޤ
+ add_historytrueξ硢ҥȥɤ߹ʸɲäޤ
-== Readline ⥸塼
+<饹᥽å>
-=== ⥸塼ؿ
+completion_proc = proc
-readline([prompt, [add_hist]]) -> String | nil
+ 䴰ưꤹProc֥Ȥꤷޤ
+ procϰʸꡢʸ֤褦
+ Ƥ
- prompt Ϥ桼ΥϤԤޤ
- 󥿡βʤɤǥ桼ʸϤȡ
- Ϥʸ֤ޤ
- ΤȤadd_hist true ǤСϤʸҥȥɲäޤ
-
- ϤƤʤ֤ EOF(UNIX Ǥ ^D) Ϥʤɤǡ
- 桼Ϥʤ nil ֤ޤ
-
- ξ硢㳰 IOError ȯޤ
- 1. ɸϤ tty Ǥʤ
- 2. ɸϤ򥯥Ƥ롣(isatty(2) errno EBADF Ǥ롣)
-
- ܥ᥽åɤϥåɤбƤޤ
- Ԥ֤ΤȤϥåɥƥȤؤȯޤ
-
- ϻˤϹԽǽǡvi ⡼ɤ Emacs ⡼ɤѰդƤޤ
- ǥեȤ Emacs ⡼ɤǤ
-
- ܥ᥽åɤˤջबޤ
- Ԥξ֤ ^C ruby 󥿥ץ꥿λü֤ޤ
- 򤹤뤿3ĵ󤲤ޤ
-
- * ^CˤInterrupt㳰­ơü֤ޤ:
-
- require "readline"
-
- stty_save = `stty -g`.chomp
- begin
- while buf = Readline.readline
- p buf
- end
- rescue Interrupt
- system("stty", stty_save)
- exit
- end
- end
- end
-
- * INTʥ­ơü֤ޤ:
-
- require "readline"
-
- stty_save = `stty -g`.chomp
- trap("INT") { system "stty", stty_save; exit }
-
- while buf = Readline.readline
- p buf
- end
-
- * ñ ^C ̵뤹ˡ⤢ޤ:
-
- require "readline"
-
- trap("INT", "SIG_IGN")
-
- while buf = Readline.readline
- p buf
- end
-
- Readline::HISTORY ѤơԤľϤƱƤ
- ˻ĤʤȤȤǤޤ
-
- require "readline"
-
- while buf = Readline.readline("> ", true)
- # p Readline::HISTORY.to_a
- Readline::HISTORY.pop if /^\s*$/ =~ buf
-
- begin
- if Readline::HISTORY[Readline::HISTORY.length-2] == buf
- Readline::HISTORY.pop
- end
- rescue IndexError
- end
-
- # p Readline::HISTORY.to_a
- print "-> ", buf, "\n"
- end
-
- $SAFE 4 ξ硢㳰 SecurityError ȯޤ
+completion_proc
-=== 饹᥽å
+ 䴰ưꤹProc֥Ȥ֤ޤ
-Readline.input = input
+completion_case_fold = case_fold
- Readline.readline ᥽åɤǻѤѤ File ֥ input
- ꤷޤ
+ 䴰ʸʸ̤ʤ硢trueꤷޤ
- $SAFE 4 ξ硢㳰 SecurityError ȯޤ
+completion_case_fold
-Readline.output = output
+ 䴰ʸʸ̤ʤ硢true֤ޤ
- Readline.readline ᥽åɤǻѤѤ File ֥
- output ꤷޤ
+completion_append_character = char
- $SAFE 4 ξ硢㳰 SecurityError ȯޤ
+ 䴰ղäʸʸǻꤷޤƬΰʸ
+ ꤵ졢ʸ ("") ޤ nil ꤹȲղ
+ ʤʤޤ
-Readline.completion_proc = proc
+completion_append_character
- 桼Ϥ䴰θ Proc ֥ proc
- ꤷޤproc ϡΤΤꤷƤޤ
- 1. call ᥽åɤޤ
- call ᥽åɤʤ硢㳰 ArgumentError ȯޤ
- 2. ˥桼ʸ(1)ޤ
- 3. ʸ֤ޤ
+ 䴰ղäʸʸ֤ޤǥեȤ
+ (" ") Ǥ
- 1:/var/lib /vפθ䴰Ԥȡ
- ǥեȤǤ proc ΰˡ/vפϤޤ
- Τ褦ˡ桼Ϥʸ
- Readline.completer_word_break_characters ˴ޤޤʸǶڤä
- ΤñȤȡ뤬ñκǽʸ鸽ߤΥ
- ֤ޤǤʸ proc ΰϤޤ
+vi_editing_mode
- $SAFE 4 ξ硢㳰 SecurityError ȯޤ
+ VI⡼ɤˤʤޤ
-Readline.completion_proc -> proc
+emacs_editing_mode
- 桼Ϥ䴰θ Proc ֥ proc
- ޤ
+ Emacs⡼ɤˤʤޤ
- $SAFE 4 ξ硢㳰 SecurityError ȯޤ
-
-Readline.completion_case_fold = bool
-
- 桼Ϥ䴰ݡʸȾʸ̤롿ʤꤷޤ
- bool ʤж̤ޤbool ʤж̤ޤ
-
- $SAFE 4 ξ硢㳰 SecurityError ȯޤ
-
-Readline.completion_case_fold -> bool
-
- 桼Ϥ䴰ݡʸȾʸ̤롿ʤޤ
- bool ʤж̤ޤbool ʤж̤ޤ
-
- ʤReadline.completion_case_fold= ᥽åɤǻꤷ֥Ȥ
- Τޤ޼ΤǡΤ褦ư򤷤ޤ
-
- require "readline"
-
- Readline.completion_case_fold = "This is a String."
- p Readline.completion_case_fold # => "This is a String."
-
- $SAFE 4 ξ硢㳰 SecurityError ȯޤ
-
-Readline.line_buffer -> string
-
- ιΤ֤ޤcomplete_proc ǻѤ뤳Ȥꤷ
- ƤޤReadline.line_buffer Ĺ GNU Readline rl_end ѿ
- ͤȰפޤ
-
-Readline.point -> int
-
- ߤΥΰ֤֤ޤ
- Readline ⥸塼䴰оݤñγϰ֤ξ󶡤Ƥޤ
- ʤ顢 completion_proc Ϥñ text
- Readline.point Ѥ뤳Ȥdzϰ֤ƳȤǤޤ
-
- ϰ = ϤñĹ - Readline.point
-
-Readline.vi_editing_mode -> nil
-
- Խ⡼ɤ vi ⡼ɤˤޤ
- vi ⡼ɤξܺ٤ϡGNU Readline Υޥ˥奢򻲾ȤƤ
-
- ݡȤƤʤĶǤϡ㳰 NotImplementedError ȯޤ
-
- $SAFE 4 ξ硢㳰 SecurityError ȯޤ
-
-Readline.vi_editing_mode? -> bool
-
- Խ⡼ɤ vi ⡼ɤξ硢true ֤ޤǤʤ false
- ֤ޤ
-
- ݡȤƤʤĶǤϡ㳰 NotImplementedError ȯޤ
-
- $SAFE 4 ξ硢㳰 SecurityError ȯޤ
-
-Readline.emacs_editing_mode -> nil
-
- Խ⡼ɤ Emacs ⡼ɤˤޤ
- ǥեȤ Emacs ⡼ɤǤ
- Emacs ⡼ɤξܺ٤ϡGNU Readline Υޥ˥奢򻲾ȤƤ
-
- ݡȤƤʤĶǤϡ㳰 NotImplementedError ȯޤ
-
- $SAFE 4 ξ硢㳰 SecurityError ȯޤ
-
-Readline.emacs_editing_mode? -> bool
-
- Խ⡼ɤ Emacs ⡼ɤξ硢true ֤ޤǤʤ false
- ֤ޤ
-
- ݡȤƤʤĶǤϡ㳰 NotImplementedError ȯޤ
-
- $SAFE 4 ξ硢㳰 SecurityError ȯޤ
-
-Readline.completion_append_character = char
-
- 桼Ϥ䴰λˡǸղäʸ char ꤷ
- ޤȾѥڡ" "פʤɤñڤʸꤹСϢ³
- ϤݤǤ
-
- :
-
- require "readline"
-
- Readline.readline("> ", true)
- Readline.completion_append_character = " "
-
- ¹:
-
- >
- "/var/li" Ϥޤ
-
- > /var/li
- TAB Ϥޤ
-
- > /var/lib
- "b" 䴰졢Ǹ " " ɲäΤǡ"/usr" Ϣ³ϤǤޤ
-
- > /var/lib /usr
-
- ʤ1ʸꤹ뤳ȤϤǤޤ
- 㤨С"string"ꤷϺǽʸǤ"s"Ѥޤ
-
- require "readline"
-
- Readline.completion_append_character = "string"
- p Readline.completion_append_character # => "s"
-
- ݡȤƤʤĶǤϡ㳰 NotImplementedError ȯޤ
-
- $SAFE 4 ξ硢㳰 SecurityError ȯޤ
-
-Readline.completion_append_character -> char
-
- 桼Ϥ䴰λˡǸղäʸޤ
- ǥեȤ϶ (" ") Ǥ
-
- ݡȤƤʤĶǤϡ㳰 NotImplementedError ȯޤ
-
- $SAFE 4 ξ硢㳰 SecurityError ȯޤ
-
-Readline.basic_word_break_characters = string
-
- 桼Ϥ䴰Ԥݡñζڤ򼨤ʣʸǹ
- ʸ string ꤷޤ
-
- GNU Readline ΥǥեȤͤϡBash 䴰ǻѤƤʸ
- " \t\n\"\\'`@$><=;|&{(" (ڡޤ) ˤʤäƤޤ
-
- ݡȤƤʤĶǤϡ㳰 NotImplementedError ȯޤ
-
- $SAFE 4 ξ硢㳰 SecurityError ȯޤ
-
-Readline.basic_word_break_characters -> string
-
- 桼Ϥ䴰Ԥݡñζڤ򼨤ʣʸǹ
- ʸޤ
-
- ݡȤƤʤĶǤϡ㳰 NotImplementedError ȯޤ
-
- $SAFE 4 ξ硢㳰 SecurityError ȯޤ
-
-Readline.completer_word_break_characters = string
-
- 桼Ϥ䴰Ԥݡñζڤ򼨤ʣʸǹ
- ʸ string ꤷޤ
- Readline.basic_word_break_characters= Ȥΰ㤤ϡ
- GNU Readline rl_complete_internal ؿǻѤ뤳ȤǤ
-
- GNU Readline ΥǥեȤͤϡ
- Readline.basic_word_break_characters ƱǤ
-
- ݡȤƤʤĶǤϡ㳰 NotImplementedError ȯޤ
-
- $SAFE 4 ξ硢㳰 SecurityError ȯޤ
-
-Readline.completer_word_break_characters -> string
-
- 桼Ϥ䴰Ԥݡñζڤ򼨤ʣʸǹ줿
- ʸޤ
-
- ݡȤƤʤĶǤϡ㳰 NotImplementedError ȯޤ
-
- $SAFE 4 ξ硢㳰 SecurityError ȯޤ
-
-Readline.basic_quote_characters = string
-
- ڡʤɤñζڤ򥯥Ȥ뤿ʣʸǹ
- ʸ string ꤷޤ
-
- ݡȤƤʤĶǤϡ㳰 NotImplementedError ȯޤ
-
- $SAFE 4 ξ硢㳰 SecurityError ȯޤ
-
-Readline.basic_quote_characters -> string
-
- ڡʤɤñζڤ򥯥Ȥ뤿ʣʸǹ
- ʸޤ
-
- ݡȤƤʤĶǤϡ㳰 NotImplementedError ȯޤ
-
- $SAFE 4 ξ硢㳰 SecurityError ȯޤ
-
-Readline.completer_quote_characters = string
-
- 桼Ϥ䴰Ԥݡڡʤɤñζڤ
- Ȥ뤿ʣʸǹʸ string ꤷޤ
- ꤷʸδ֤ǤϡReadline.completer_word_break_characters=
- ǻꤷʸ˴ޤޤʸ⡢̤ʸȤưޤ
-
- ݡȤƤʤĶǤϡ㳰 NotImplementedError ȯޤ
-
- $SAFE 4 ξ硢㳰 SecurityError ȯޤ
-
-Readline.completer_quote_characters -> string
-
- 桼Ϥ䴰Ԥݡڡʤɤñζڤ
- Ȥ뤿ʣʸǹʸޤ
-
- ݡȤƤʤĶǤϡ㳰 NotImplementedError ȯޤ
-
- $SAFE 4 ξ硢㳰 SecurityError ȯޤ
-
-Readline.filename_quote_characters = string
-
- 桼ϻ˥ե̾䴰Ԥݡڡʤɤñζڤ
- Ȥ뤿ʣʸǹʸ string ꤷޤ
-
- GNU Readline Υǥեͤ nil Ǥ
-
- ݡȤƤʤĶǤϡ㳰 NotImplementedError ȯޤ
-
- $SAFE 4 ξ硢㳰 SecurityError ȯޤ
-
-Readline.filename_quote_characters -> string
-
- 桼ϻ˥ե̾䴰Ԥݡڡʤɤñζڤ
- Ȥ뤿ʣʸǹʸޤ
-
- ݡȤƤʤĶǤϡ㳰 NotImplementedError ȯޤ
-
- $SAFE 4 ξ硢㳰 SecurityError ȯޤ
-
-=== 饹
+<饹>
HISTORY
- HISTORY Ѥƥҥȥ˥Ǥޤ
- Enumerable ⥸塼 extend Ƥꡢ
- Τ褦˿񤦤ȤǤޤ
- 㤨СHISTORY[4] ˤ 5 ܤϤƤФȤǤޤ
-
- require "readline"
-
- Readline::HISTORY.push("a", "b", "c", "d", "e")
- p Readline::HISTORY[4] # => "e"
-
- Ƥ᥽åɤ򼡤˵󤲤ޤ
- * HISTORY.to_s -> "HISTORY"
- * HISTORY[index] -> string
- * HISTORY[index] = string
- * HISTORY.push(string[, string, ...]) -> self
- * HISTORY << string -> self
- * HISTORY.pop -> string
- * HISTORY.shift -> string
- * HISTORY.each -> Enumerator
- * HISTORY.each { |i| } -> [string]
- * HISTORY.length -> Integer
- * HISTORY.empty? -> true or false
- * HISTORY.delete_at(index) -> string
- * HISTORY.clear -> self
-
- ݡȤƤʤĶǤϡΥ᥽åɤ㳰 NotImplementedError
- ȯޤ
- * HISTORY[index] = string
- * HISTORY.pop -> string
- * HISTORY.shift -> string
- * HISTORY.delete_at(index) -> string
- * HISTORY.clear -> self
-
- $SAFE 4 ξ硢ҥȥ˥Ȥ㳰 SecurityError
- ȯޤ
-
-FILENAME_COMPLETION_PROC
-
- ե̾䴰Ԥ call ᥽åɤĥ֥ȤǤ
-
- Readline.completion_proc= ˤꡢ桼ϻ˥ե̾䴰
- Ԥ褦ꤹ뤿˻Ѥ뤳ȤꤷƤޤ
-
-USERNAME_COMPLETION_PROC
-
- 桼̾䴰Ԥ call ᥽åɤĥ֥ȤǤ
-
- Readline.completion_proc= ˤꡢ桼ϻ˥桼̾䴰
- 褦ꤹ뤿˻Ѥ뤳ȤꤷƤޤ
-
-VERSION
-
- ѤƤ GNU Readline ޤ libedit ΥСǤ
+ҥȥФϤ̤ƹԤäƤ
+Ʊ褦˰褦ˤʤäƤޤ
diff --git a/ext/readline/extconf.rb b/ext/readline/extconf.rb
index 14c2099b6d..b820c0b32f 100644
--- a/ext/readline/extconf.rb
+++ b/ext/readline/extconf.rb
@@ -15,10 +15,6 @@ def have_readline_var(var)
return have_var(var, $readline_headers)
end
-def have_readline_func(func)
- return have_func(func, $readline_headers)
-end
-
dir_config('curses')
dir_config('ncurses')
dir_config('termcap')
@@ -46,11 +42,9 @@ else
end
end
-have_readline_func("rl_getc_function")
-have_readline_func("rl_filename_completion_function")
-have_readline_func("rl_username_completion_function")
-have_readline_func("rl_completion_matches")
-have_readline_func("rl_refresh_line")
+have_func("rl_filename_completion_function")
+have_func("rl_username_completion_function")
+have_func("rl_completion_matches")
have_readline_var("rl_deprep_term_function")
have_readline_var("rl_completion_append_character")
have_readline_var("rl_basic_word_break_characters")
@@ -60,20 +54,11 @@ have_readline_var("rl_completer_quote_characters")
have_readline_var("rl_filename_quote_characters")
have_readline_var("rl_attempted_completion_over")
have_readline_var("rl_library_version")
-have_readline_var("rl_editing_mode")
-have_readline_var("rl_line_buffer")
-have_readline_var("rl_point")
-# workaround for native windows.
-/mswin|bccwin|mingw/ !~ RUBY_PLATFORM && have_readline_var("rl_event_hook")
-/mswin|bccwin|mingw/ !~ RUBY_PLATFORM && have_readline_var("rl_catch_sigwinch")
-/mswin|bccwin|mingw/ !~ RUBY_PLATFORM && have_readline_var("rl_catch_signals")
-have_readline_func("rl_cleanup_after_signal")
-have_readline_func("rl_clear_signals")
-have_readline_func("rl_set_screen_size")
-have_readline_func("rl_get_screen_size")
-have_readline_func("rl_vi_editing_mode")
-have_readline_func("rl_emacs_editing_mode")
-have_readline_func("replace_history_entry")
-have_readline_func("remove_history")
-have_readline_func("clear_history")
+have_readline_var("rl_event_hook")
+have_func("rl_cleanup_after_signal")
+have_func("rl_clear_signals")
+have_func("rl_vi_editing_mode")
+have_func("rl_emacs_editing_mode")
+have_func("replace_history_entry")
+have_func("remove_history")
create_makefile("readline")
diff --git a/ext/readline/readline.c b/ext/readline/readline.c
index 20630d30ec..c9acaadac9 100644
--- a/ext/readline/readline.c
+++ b/ext/readline/readline.c
@@ -1,27 +1,10 @@
-/************************************************
+/* readline.c -- GNU Readline module
+ Copyright (C) 1997-2001 Shugo Maeda */
- readline.c - GNU Readline module
-
- $Author$
- created at: Wed Jan 20 13:59:32 JST 1999
-
- Copyright (C) 1997-2008 Shugo Maeda
- Copyright (C) 2008-2009 TAKAO Kouji
-
- $Id$
-
- Contact:
- - TAKAO Kouji <kouji at takao7 dot net> (current maintainer)
-
-************************************************/
-
-#ifdef RUBY_EXTCONF_H
-#include RUBY_EXTCONF_H
-#endif
-
-#include "ruby/config.h"
+#include "config.h"
#include <errno.h>
#include <stdio.h>
+#include <ctype.h>
#include <string.h>
#ifdef HAVE_READLINE_READLINE_H
#include <readline/readline.h>
@@ -33,8 +16,9 @@
#include <editline/readline.h>
#endif
-#include "ruby/ruby.h"
-#include "ruby/io.h"
+#include "ruby.h"
+#include "rubyio.h"
+#include "rubysig.h"
#ifdef HAVE_UNISTD_H
#include <unistd.h>
@@ -42,7 +26,7 @@
static VALUE mReadline;
-#define EDIT_LINE_LIBRARY_VERSION "EditLine wrapper"
+#define TOLOWER(c) (isupper(c) ? tolower(c) : c)
#define COMPLETION_PROC "completion_proc"
#define COMPLETION_CASE_FOLD "completion_case_fold"
@@ -58,75 +42,19 @@ static ID completion_proc, completion_case_fold;
# define rl_completion_matches completion_matches
#endif
-static int (*history_get_offset_func)(int);
-
static char **readline_attempted_completion_function(const char *text,
int start, int end);
-#define OutputStringValue(str) do {\
- SafeStringValue(str);\
- str = rb_str_conv_enc(str, rb_enc_get(str), rb_locale_encoding());\
-} while (0)\
-
-
-/*
- * Document-class: Readline
- *
- * The Readline module provides interface for GNU Readline.
- * This module defines a number of methods to facilitate completion
- * and accesses input history from the Ruby interpreter.
- * This module supported Edit Line(libedit) too.
- * libedit is compatible with GNU Readline.
- *
- * GNU Readline:: http://www.gnu.org/directory/readline.html
- * libedit:: http://www.thrysoee.dk/editline/
- *
- * Reads one inputted line with line edit by Readline.readline method.
- * At this time, the facilitatation completion and the key
- * bind like Emacs can be operated like GNU Readline.
- *
- * require "readline"
- * while buf = Readline.readline("> ", true)
- * p buf
- * end
- *
- * The content that the user input can be recorded to the history.
- * The history can be accessed by Readline::HISTORY constant.
- *
- * require "readline"
- * while buf = Readline.readline("> ", true)
- * p Readline::HISTORY.to_a
- * print("-> ", buf, "\n")
- * end
- *
- * Most of methods raise SecurityError exception if $SAFE is 4.
- *
- * Documented by TAKAO Kouji <kouji at takao7 dot net>.
- */
-
-#if defined HAVE_RL_GETC_FUNCTION
-static VALUE readline_instream;
-static ID id_getbyte;
-
-static int readline_getc(FILE *);
-static int
-readline_getc(FILE *input)
-{
- rb_io_t *ifp = 0;
- VALUE c;
- if (!readline_instream) return rl_getc(input);
- GetOpenFile(readline_instream, ifp);
- if (rl_instream != ifp->stdio_file) return rl_getc(input);
- c = rb_funcall(readline_instream, id_getbyte, 0, 0);
- if (NIL_P(c)) return EOF;
- return NUM2CHR(c);
-}
-#elif defined HAVE_RL_EVENT_HOOK
+#ifdef HAVE_RL_EVENT_HOOK
+#ifdef DOSISH
+#define BUSY_WAIT 1
+#else
#define BUSY_WAIT 0
+#endif
static int readline_event(void);
static int
-readline_event(void)
+readline_event()
{
#if BUSY_WAIT
rb_thread_schedule();
@@ -142,118 +70,36 @@ readline_event(void)
#endif
static VALUE
-readline_get(VALUE prompt)
-{
- return (VALUE)readline((char *)prompt);
-}
-
-/*
- * call-seq:
- * Readline.readline(prompt = "", add_hist = false) -> string or nil
- *
- * Shows the +prompt+ and reads the inputted line with line editing.
- * The inputted line is added to the history if +add_hist+ is true.
- *
- * Returns nil when the inputted line is empty and user inputs EOF
- * (Presses ^D on UNIX).
- *
- * Raises IOError exception if below conditions are satisfied.
- * 1. stdin is not tty.
- * 2. stdin was closed. (errno is EBADF after called isatty(2).)
- *
- * This method supports thread. Switchs the thread context when waits
- * inputting line.
- *
- * Supports line edit when inputs line. Provides VI and Emacs editing mode.
- * Default is Emacs editing mode.
- *
- * NOTE: Terminates ruby interpreter and does not return the terminal
- * status after user pressed '^C' when wait inputting line.
- * Give 3 examples that avoid it.
- *
- * * Catches the Interrupt exception by pressed ^C after returns
- * terminal status:
- *
- * require "readline"
- *
- * stty_save = `stty -g`.chomp
- * begin
- * while buf = Readline.readline
- * p buf
- * end
- * rescue Interrupt
- * system("stty", stty_save)
- * exit
- * end
- * end
- * end
- *
- * * Catches the INT signal by pressed ^C after returns terminal
- * status:
- *
- * require "readline"
- *
- * stty_save = `stty -g`.chomp
- * trap("INT") { system "stty", stty_save; exit }
- *
- * while buf = Readline.readline
- * p buf
- * end
- *
- * * Ignores pressing ^C:
- *
- * require "readline"
- *
- * trap("INT", "SIG_IGN")
- *
- * while buf = Readline.readline
- * p buf
- * end
- *
- * Can make as follows with Readline::HISTORY constant.
- * It does not record to the history if the inputted line is empty or
- * the same it as last one.
- *
- * require "readline"
- *
- * while buf = Readline.readline("> ", true)
- * # p Readline::HISTORY.to_a
- * Readline::HISTORY.pop if /^\s*$/ =~ buf
- *
- * begin
- * if Readline::HISTORY[Readline::HISTORY.length-2] == buf
- * Readline::HISTORY.pop
- * end
- * rescue IndexError
- * end
- *
- * # p Readline::HISTORY.to_a
- * print "-> ", buf, "\n"
- * end
- *
- * Raises SecurityError exception if $SAFE is 4.
- */
-static VALUE
-readline_readline(int argc, VALUE *argv, VALUE self)
+readline_readline(argc, argv, self)
+ int argc;
+ VALUE *argv;
+ VALUE self;
{
VALUE tmp, add_hist, result;
char *prompt = NULL;
char *buff;
int status;
+ rb_io_t *ofp, *ifp;
rb_secure(4);
if (rb_scan_args(argc, argv, "02", &tmp, &add_hist) > 0) {
- OutputStringValue(tmp);
- prompt = RSTRING_PTR(tmp);
+ SafeStringValue(tmp);
+ prompt = RSTRING(tmp)->ptr;
}
- if (!isatty(0) && errno == EBADF) rb_raise(rb_eIOError, "closed stdin");
+ if (!isatty(0) && errno == EBADF) rb_raise(rb_eIOError, "stdin closed");
- buff = (char*)rb_protect(readline_get, (VALUE)prompt, &status);
+ Check_Type(rb_stdout, T_FILE);
+ GetOpenFile(rb_stdout, ofp);
+ rl_outstream = GetWriteFile(ofp);
+ Check_Type(rb_stdin, T_FILE);
+ GetOpenFile(rb_stdin, ifp);
+ rl_instream = GetReadFile(ifp);
+ buff = (char*)rb_protect((VALUE(*)_((VALUE)))readline, (VALUE)prompt,
+ &status);
if (status) {
#if defined HAVE_RL_CLEANUP_AFTER_SIGNAL
/* restore terminal mode and signal handler*/
- rl_free_line_state();
rl_cleanup_after_signal();
#elif defined HAVE_RL_DEPREP_TERM_FUNCTION
/* restore terminal mode */
@@ -269,191 +115,60 @@ readline_readline(int argc, VALUE *argv, VALUE self)
if (RTEST(add_hist) && buff) {
add_history(buff);
}
- if (buff) {
- result = rb_locale_str_new_cstr(buff);
- }
+ if (buff)
+ result = rb_tainted_str_new2(buff);
else
result = Qnil;
if (buff) free(buff);
return result;
}
-/*
- * call-seq:
- * Readline.input = input
- *
- * Specifies a File object +input+ that is input stream for
- * Readline.readline method.
- *
- * Raises SecurityError exception if $SAFE is 4.
- */
-static VALUE
-readline_s_set_input(VALUE self, VALUE input)
-{
- rb_io_t *ifp;
-
- rb_secure(4);
- Check_Type(input, T_FILE);
- GetOpenFile(input, ifp);
- rl_instream = rb_io_stdio_file(ifp);
-#ifdef HAVE_RL_GETC_FUNCTION
- readline_instream = input;
-#endif
- return input;
-}
-
-/*
- * call-seq:
- * Readline.output = output
- *
- * Specifies a File object +output+ that is output stream for
- * Readline.readline method.
- *
- * Raises SecurityError exception if $SAFE is 4.
- */
static VALUE
-readline_s_set_output(VALUE self, VALUE output)
+readline_s_set_completion_proc(self, proc)
+ VALUE self;
+ VALUE proc;
{
- rb_io_t *ofp;
-
rb_secure(4);
- Check_Type(output, T_FILE);
- GetOpenFile(output, ofp);
- rl_outstream = rb_io_stdio_file(ofp);
- return output;
-}
-
-/*
- * call-seq:
- * Readline.completion_proc = proc
- *
- * Specifies a Proc object +proc+ to determine completion behavior. It
- * should take input-string, and return an array of completion
- * candidates.
- *
- * Set default if +proc+ is nil.
- *
- * Raises ArgumentError exception if +proc+ does not respond to call method.
- *
- * Raises SecurityError exception if $SAFE is 4.
- */
-static VALUE
-readline_s_set_completion_proc(VALUE self, VALUE proc)
-{
- rb_secure(4);
- if (!NIL_P(proc) && !rb_respond_to(proc, rb_intern("call")))
+ if (!rb_respond_to(proc, rb_intern("call")))
rb_raise(rb_eArgError, "argument must respond to `call'");
return rb_ivar_set(mReadline, completion_proc, proc);
}
-/*
- * call-seq:
- * Readline.completion_proc -> proc
- *
- * Returns the completion Proc object.
- *
- * Raises SecurityError exception if $SAFE is 4.
- */
static VALUE
-readline_s_get_completion_proc(VALUE self)
+readline_s_get_completion_proc(self)
+ VALUE self;
{
rb_secure(4);
return rb_attr_get(mReadline, completion_proc);
}
-/*
- * call-seq:
- * Readline.completion_case_fold = bool
- *
- * Sets whether or not to ignore case on completion.
- *
- * Raises SecurityError exception if $SAFE is 4.
- */
static VALUE
-readline_s_set_completion_case_fold(VALUE self, VALUE val)
+readline_s_set_completion_case_fold(self, val)
+ VALUE self;
+ VALUE val;
{
rb_secure(4);
return rb_ivar_set(mReadline, completion_case_fold, val);
}
-/*
- * call-seq:
- * Readline.completion_case_fold -> bool
- *
- * Returns true if completion ignores case. If no, returns false.
- *
- * NOTE: Returns the same object that is specified by
- * Readline.completion_case_fold= method.
- *
- * require "readline"
- *
- * Readline.completion_case_fold = "This is a String."
- * p Readline.completion_case_fold # => "This is a String."
- *
- * Raises SecurityError exception if $SAFE is 4.
- */
static VALUE
-readline_s_get_completion_case_fold(VALUE self)
+readline_s_get_completion_case_fold(self)
+ VALUE self;
{
rb_secure(4);
return rb_attr_get(mReadline, completion_case_fold);
}
-#ifdef HAVE_RL_LINE_BUFFER
-/*
- * call-seq:
- * Readline.line_buffer -> string
- *
- * Returns the full line that is being edited. This is useful from
- * within the complete_proc for determining the context of the
- * completion request.
- *
- * The length of +Readline.line_buffer+ and GNU Readline's rl_end are
- * same.
- */
-static VALUE
-readline_s_get_line_buffer(VALUE self)
-{
- rb_secure(4);
- if (rl_line_buffer == NULL)
- return Qnil;
- return rb_tainted_str_new2(rl_line_buffer);
-}
-#else
-#define readline_s_get_line_buffer rb_f_notimplement
-#endif
-
-#ifdef HAVE_RL_POINT
-/*
- * call-seq:
- * Readline.point -> int
- *
- * Returns the index of the current cursor position in
- * +Readline.line_buffer+.
- *
- * The index in +Readline.line_buffer+ which matches the start of
- * input-string passed to completion_proc is computed by subtracting
- * the length of input-string from +Readline.point+.
- *
- * start = (the length of input-string) - Readline.point
- */
-static VALUE
-readline_s_get_point(VALUE self)
-{
- rb_secure(4);
- return INT2NUM(rl_point);
-}
-#else
-#define readline_s_get_point rb_f_notimplement
-#endif
-
static char **
-readline_attempted_completion_function(const char *text, int start, int end)
+readline_attempted_completion_function(text, start, end)
+ const char *text;
+ int start;
+ int end;
{
VALUE proc, ary, temp;
char **result;
int case_fold;
- long i, matches;
+ int i, matches;
proc = rb_attr_get(mReadline, completion_proc);
if (NIL_P(proc))
@@ -462,17 +177,17 @@ 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, rb_intern("call"), 1, rb_locale_str_new_cstr(text));
+ ary = rb_funcall(proc, rb_intern("call"), 1, rb_tainted_str_new2(text));
if (TYPE(ary) != T_ARRAY)
ary = rb_Array(ary);
- matches = RARRAY_LEN(ary);
+ matches = RARRAY(ary)->len;
if (matches == 0)
return NULL;
result = ALLOC_N(char *, matches + 2);
for (i = 0; i < matches; i++) {
- temp = rb_obj_as_string(RARRAY_PTR(ary)[i]);
- result[i + 1] = ALLOC_N(char, RSTRING_LEN(temp) + 1);
- strcpy(result[i + 1], RSTRING_PTR(temp));
+ temp = rb_obj_as_string(RARRAY(ary)->ptr[i]);
+ result[i + 1] = ALLOC_N(char, RSTRING(temp)->len + 1);
+ strcpy(result[i + 1], RSTRING(temp)->ptr);
}
result[matches + 1] = NULL;
@@ -511,581 +226,304 @@ readline_attempted_completion_function(const char *text, int start, int end)
return result;
}
-#ifdef HAVE_RL_SET_SCREEN_SIZE
-/*
- * call-seq:
- * Readline.set_screen_size(rows, columns) -> self
- *
- * Set terminal size to +rows+ and +columns+.
- *
- * See GNU Readline's rl_set_screen_size function.
- *
- * Raises NotImplementedError if the using readline library does not support.
- *
- * Raises SecurityError exception if $SAFE is 4.
- */
static VALUE
-readline_s_set_screen_size(VALUE self, VALUE rows, VALUE columns)
+readline_s_vi_editing_mode(self)
+ VALUE self;
{
- rb_secure(4);
- rl_set_screen_size(NUM2INT(rows), NUM2INT(columns));
- return self;
-}
-#else
-#define readline_s_set_screen_size rb_f_notimplement
-#endif
-
-#ifdef HAVE_RL_GET_SCREEN_SIZE
-/*
- * call-seq:
- * Readline.get_screen_size -> [rows, columns]
- *
- * Returns the terminal's rows and columns.
- *
- * See GNU Readline's rl_get_screen_size function.
- *
- * Raises NotImplementedError if the using readline library does not support.
- *
- * Raises SecurityError exception if $SAFE is 4.
- */
-static VALUE
-readline_s_get_screen_size(VALUE self)
-{
- int rows, columns;
- VALUE res;
-
- rb_secure(4);
- rl_get_screen_size(&rows, &columns);
- res = rb_ary_new();
- rb_ary_push(res, INT2NUM(rows));
- rb_ary_push(res, INT2NUM(columns));
- return res;
-}
-#else
-#define readline_s_get_screen_size rb_f_notimplement
-#endif
-
#ifdef HAVE_RL_VI_EDITING_MODE
-/*
- * call-seq:
- * Readline.vi_editing_mode -> nil
- *
- * Specifies VI editing mode. See the manual of GNU Readline for
- * details of VI editing mode.
- *
- * Raises NotImplementedError if the using readline library does not support.
- *
- * Raises SecurityError exception if $SAFE is 4.
- */
-static VALUE
-readline_s_vi_editing_mode(VALUE self)
-{
rb_secure(4);
rl_vi_editing_mode(1,0);
return Qnil;
-}
#else
-#define readline_s_vi_editing_mode rb_f_notimplement
-#endif
-
-#ifdef HAVE_RL_EDITING_MODE
-/*
- * call-seq:
- * Readline.vi_editing_mode? -> bool
- *
- * Returns true if vi mode is active. Returns false if not.
- *
- * Raises NotImplementedError if the using readline library does not support.
- *
- * Raises SecurityError exception if $SAFE is 4.
- */
-static VALUE
-readline_s_vi_editing_mode_p(VALUE self)
-{
- rb_secure(4);
- return rl_editing_mode == 0 ? Qtrue : Qfalse;
+ rb_notimplement();
+ return Qnil; /* not reached */
+#endif /* HAVE_RL_VI_EDITING_MODE */
}
-#else
-#define readline_s_vi_editing_mode_p rb_f_notimplement
-#endif
-#ifdef HAVE_RL_EMACS_EDITING_MODE
-/*
- * call-seq:
- * Readline.emacs_editing_mode -> nil
- *
- * Specifies Emacs editing mode. The default is this mode. See the
- * manual of GNU Readline for details of Emacs editing mode.
- *
- * Raises NotImplementedError if the using readline library does not support.
- *
- * Raises SecurityError exception if $SAFE is 4.
- */
static VALUE
-readline_s_emacs_editing_mode(VALUE self)
+readline_s_emacs_editing_mode(self)
+ VALUE self;
{
+#ifdef HAVE_RL_EMACS_EDITING_MODE
rb_secure(4);
rl_emacs_editing_mode(1,0);
return Qnil;
-}
#else
-#define readline_s_emacs_editing_mode rb_f_notimplement
-#endif
-
-#ifdef HAVE_RL_EDITING_MODE
-/*
- * call-seq:
- * Readline.emacs_editing_mode? -> bool
- *
- * Returns true if emacs mode is active. Returns false if not.
- *
- * Raises NotImplementedError if the using readline library does not support.
- *
- * Raises SecurityError exception if $SAFE is 4.
- */
-static VALUE
-readline_s_emacs_editing_mode_p(VALUE self)
-{
- rb_secure(4);
- return rl_editing_mode == 1 ? Qtrue : Qfalse;
+ rb_notimplement();
+ return Qnil; /* not reached */
+#endif /* HAVE_RL_EMACS_EDITING_MODE */
}
-#else
-#define readline_s_emacs_editing_mode_p rb_f_notimplement
-#endif
-#ifdef HAVE_RL_COMPLETION_APPEND_CHARACTER
-/*
- * call-seq:
- * Readline.completion_append_character = char
- *
- * Specifies a character to be appended on completion.
- * Nothing will be appended if an empty string ("") or nil is
- * specified.
- *
- * For example:
- * require "readline"
- *
- * Readline.readline("> ", true)
- * Readline.completion_append_character = " "
- *
- * Result:
- * >
- * Input "/var/li".
- *
- * > /var/li
- * Press TAB key.
- *
- * > /var/lib
- * Completes "b" and appends " ". So, you can continuously input "/usr".
- *
- * > /var/lib /usr
- *
- * NOTE: Only one character can be specified. When "string" is
- * specified, sets only "s" that is the first.
- *
- * require "readline"
- *
- * Readline.completion_append_character = "string"
- * p Readline.completion_append_character # => "s"
- *
- * Raises NotImplementedError if the using readline library does not support.
- *
- * Raises SecurityError exception if $SAFE is 4.
- */
static VALUE
-readline_s_set_completion_append_character(VALUE self, VALUE str)
+readline_s_set_completion_append_character(self, str)
+ VALUE self, str;
{
+#ifdef HAVE_RL_COMPLETION_APPEND_CHARACTER
rb_secure(4);
if (NIL_P(str)) {
rl_completion_append_character = '\0';
}
else {
- OutputStringValue(str);
- if (RSTRING_LEN(str) == 0) {
+ SafeStringValue(str);
+ if (RSTRING(str)->len == 0) {
rl_completion_append_character = '\0';
} else {
- rl_completion_append_character = RSTRING_PTR(str)[0];
+ rl_completion_append_character = RSTRING(str)->ptr[0];
}
}
return self;
-}
#else
-#define readline_s_set_completion_append_character rb_f_notimplement
-#endif
+ rb_notimplement();
+ return Qnil; /* not reached */
+#endif /* HAVE_RL_COMPLETION_APPEND_CHARACTER */
+}
-#ifdef HAVE_RL_COMPLETION_APPEND_CHARACTER
-/*
- * call-seq:
- * Readline.completion_append_character -> char
- *
- * Returns a string containing a character to be appended on
- * completion. The default is a space (" ").
- *
- * Raises NotImplementedError if the using readline library does not support.
- *
- * Raises SecurityError exception if $SAFE is 4.
- */
static VALUE
-readline_s_get_completion_append_character(VALUE self)
+readline_s_get_completion_append_character(self)
+ VALUE self;
{
- char buf[1];
+#ifdef HAVE_RL_COMPLETION_APPEND_CHARACTER
+ VALUE str;
rb_secure(4);
if (rl_completion_append_character == '\0')
return Qnil;
- buf[0] = (char) rl_completion_append_character;
- return rb_locale_str_new(buf, 1);
-}
+ str = rb_str_new("", 1);
+ RSTRING(str)->ptr[0] = rl_completion_append_character;
+ return str;
#else
-#define readline_s_get_completion_append_character rb_f_notimplement
-#endif
+ rb_notimplement();
+ return Qnil; /* not reached */
+#endif /* HAVE_RL_COMPLETION_APPEND_CHARACTER */
+}
-#ifdef HAVE_RL_BASIC_WORD_BREAK_CHARACTERS
-/*
- * call-seq:
- * Readline.basic_word_break_characters = string
- *
- * Sets the basic list of characters that signal a break between words
- * for the completer routine. The default is the characters which
- * break words for completion in Bash: "\t\n\"\\'`@$><=;|&{(".
- *
- * Raises NotImplementedError if the using readline library does not support.
- *
- * Raises SecurityError exception if $SAFE is 4.
- */
static VALUE
-readline_s_set_basic_word_break_characters(VALUE self, VALUE str)
+readline_s_set_basic_word_break_characters(self, str)
+ VALUE self, str;
{
+#ifdef HAVE_RL_BASIC_WORD_BREAK_CHARACTERS
static char *basic_word_break_characters = NULL;
rb_secure(4);
- OutputStringValue(str);
+ SafeStringValue(str);
if (basic_word_break_characters == NULL) {
basic_word_break_characters =
- ALLOC_N(char, RSTRING_LEN(str) + 1);
+ ALLOC_N(char, RSTRING(str)->len + 1);
}
else {
- REALLOC_N(basic_word_break_characters, char, RSTRING_LEN(str) + 1);
+ REALLOC_N(basic_word_break_characters, char, RSTRING(str)->len + 1);
}
strncpy(basic_word_break_characters,
- RSTRING_PTR(str), RSTRING_LEN(str));
- basic_word_break_characters[RSTRING_LEN(str)] = '\0';
+ RSTRING(str)->ptr, RSTRING(str)->len);
+ basic_word_break_characters[RSTRING(str)->len] = '\0';
rl_basic_word_break_characters = basic_word_break_characters;
return self;
-}
#else
-#define readline_s_set_basic_word_break_characters rb_f_notimplement
-#endif
+ rb_notimplement();
+ return Qnil; /* not reached */
+#endif /* HAVE_RL_BASIC_WORD_BREAK_CHARACTERS */
+}
-#ifdef HAVE_RL_BASIC_WORD_BREAK_CHARACTERS
-/*
- * call-seq:
- * Readline.basic_word_break_characters -> string
- *
- * Gets the basic list of characters that signal a break between words
- * for the completer routine.
- *
- * Raises NotImplementedError if the using readline library does not support.
- *
- * Raises SecurityError exception if $SAFE is 4.
- */
static VALUE
-readline_s_get_basic_word_break_characters(VALUE self, VALUE str)
+readline_s_get_basic_word_break_characters(self, str)
+ VALUE self, str;
{
+#ifdef HAVE_RL_BASIC_WORD_BREAK_CHARACTERS
rb_secure(4);
if (rl_basic_word_break_characters == NULL)
return Qnil;
- return rb_locale_str_new_cstr(rl_basic_word_break_characters);
-}
+ return rb_tainted_str_new2(rl_basic_word_break_characters);
#else
-#define readline_s_get_basic_word_break_characters rb_f_notimplement
-#endif
+ rb_notimplement();
+ return Qnil; /* not reached */
+#endif /* HAVE_RL_BASIC_WORD_BREAK_CHARACTERS */
+}
-#ifdef HAVE_RL_COMPLETER_WORD_BREAK_CHARACTERS
-/*
- * call-seq:
- * Readline.completer_word_break_characters = string
- *
- * Sets the basic list of characters that signal a break between words
- * for rl_complete_internal(). The default is the value of
- * Readline.basic_word_break_characters.
- *
- * Raises NotImplementedError if the using readline library does not support.
- *
- * Raises SecurityError exception if $SAFE is 4.
- */
static VALUE
-readline_s_set_completer_word_break_characters(VALUE self, VALUE str)
+readline_s_set_completer_word_break_characters(self, str)
+ VALUE self, str;
{
+#ifdef HAVE_RL_COMPLETER_WORD_BREAK_CHARACTERS
static char *completer_word_break_characters = NULL;
rb_secure(4);
- OutputStringValue(str);
+ SafeStringValue(str);
if (completer_word_break_characters == NULL) {
completer_word_break_characters =
- ALLOC_N(char, RSTRING_LEN(str) + 1);
+ ALLOC_N(char, RSTRING(str)->len + 1);
}
else {
- REALLOC_N(completer_word_break_characters, char, RSTRING_LEN(str) + 1);
+ REALLOC_N(completer_word_break_characters, char, RSTRING(str)->len + 1);
}
strncpy(completer_word_break_characters,
- RSTRING_PTR(str), RSTRING_LEN(str));
- completer_word_break_characters[RSTRING_LEN(str)] = '\0';
+ RSTRING(str)->ptr, RSTRING(str)->len);
+ completer_word_break_characters[RSTRING(str)->len] = '\0';
rl_completer_word_break_characters = completer_word_break_characters;
return self;
-}
#else
-#define readline_s_set_completer_word_break_characters rb_f_notimplement
-#endif
+ rb_notimplement();
+ return Qnil; /* not reached */
+#endif /* HAVE_RL_COMPLETER_WORD_BREAK_CHARACTERS */
+}
-#ifdef HAVE_RL_COMPLETER_WORD_BREAK_CHARACTERS
-/*
- * call-seq:
- * Readline.completer_word_break_characters -> string
- *
- * Gets the basic list of characters that signal a break between words
- * for rl_complete_internal().
- *
- * Raises NotImplementedError if the using readline library does not support.
- *
- * Raises SecurityError exception if $SAFE is 4.
- */
static VALUE
-readline_s_get_completer_word_break_characters(VALUE self, VALUE str)
+readline_s_get_completer_word_break_characters(self, str)
+ VALUE self, str;
{
+#ifdef HAVE_RL_COMPLETER_WORD_BREAK_CHARACTERS
rb_secure(4);
if (rl_completer_word_break_characters == NULL)
return Qnil;
- return rb_locale_str_new_cstr(rl_completer_word_break_characters);
-}
+ return rb_tainted_str_new2(rl_completer_word_break_characters);
#else
-#define readline_s_get_completer_word_break_characters rb_f_notimplement
-#endif
+ rb_notimplement();
+ return Qnil; /* not reached */
+#endif /* HAVE_RL_COMPLETER_WORD_BREAK_CHARACTERS */
+}
-#ifdef HAVE_RL_BASIC_QUOTE_CHARACTERS
-/*
- * call-seq:
- * Readline.basic_quote_characters = string
- *
- * Sets a list of quote characters which can cause a word break.
- *
- * Raises NotImplementedError if the using readline library does not support.
- *
- * Raises SecurityError exception if $SAFE is 4.
- */
static VALUE
-readline_s_set_basic_quote_characters(VALUE self, VALUE str)
+readline_s_set_basic_quote_characters(self, str)
+ VALUE self, str;
{
+#ifdef HAVE_RL_BASIC_QUOTE_CHARACTERS
static char *basic_quote_characters = NULL;
rb_secure(4);
- OutputStringValue(str);
+ SafeStringValue(str);
if (basic_quote_characters == NULL) {
basic_quote_characters =
- ALLOC_N(char, RSTRING_LEN(str) + 1);
+ ALLOC_N(char, RSTRING(str)->len + 1);
}
else {
- REALLOC_N(basic_quote_characters, char, RSTRING_LEN(str) + 1);
+ REALLOC_N(basic_quote_characters, char, RSTRING(str)->len + 1);
}
strncpy(basic_quote_characters,
- RSTRING_PTR(str), RSTRING_LEN(str));
- basic_quote_characters[RSTRING_LEN(str)] = '\0';
+ RSTRING(str)->ptr, RSTRING(str)->len);
+ basic_quote_characters[RSTRING(str)->len] = '\0';
rl_basic_quote_characters = basic_quote_characters;
return self;
-}
#else
-#define readline_s_set_basic_quote_characters rb_f_notimplement
-#endif
+ rb_notimplement();
+ return Qnil; /* not reached */
+#endif /* HAVE_RL_BASIC_QUOTE_CHARACTERS */
+}
-#ifdef HAVE_RL_BASIC_QUOTE_CHARACTERS
-/*
- * call-seq:
- * Readline.basic_quote_characters -> string
- *
- * Gets a list of quote characters which can cause a word break.
- *
- * Raises NotImplementedError if the using readline library does not support.
- *
- * Raises SecurityError exception if $SAFE is 4.
- */
static VALUE
-readline_s_get_basic_quote_characters(VALUE self, VALUE str)
+readline_s_get_basic_quote_characters(self, str)
+ VALUE self, str;
{
+#ifdef HAVE_RL_BASIC_QUOTE_CHARACTERS
rb_secure(4);
if (rl_basic_quote_characters == NULL)
return Qnil;
- return rb_locale_str_new_cstr(rl_basic_quote_characters);
-}
+ return rb_tainted_str_new2(rl_basic_quote_characters);
#else
-#define readline_s_get_basic_quote_characters rb_f_notimplement
-#endif
+ rb_notimplement();
+ return Qnil; /* not reached */
+#endif /* HAVE_RL_BASIC_QUOTE_CHARACTERS */
+}
-#ifdef HAVE_RL_COMPLETER_QUOTE_CHARACTERS
-/*
- * call-seq:
- * Readline.completer_quote_characters = string
- *
- * Sets a list of characters which can be used to quote a substring of
- * the line. Completion occurs on the entire substring, and within
- * the substring Readline.completer_word_break_characters are treated
- * as any other character, unless they also appear within this list.
- *
- * Raises NotImplementedError if the using readline library does not support.
- *
- * Raises SecurityError exception if $SAFE is 4.
- */
static VALUE
-readline_s_set_completer_quote_characters(VALUE self, VALUE str)
+readline_s_set_completer_quote_characters(self, str)
+ VALUE self, str;
{
+#ifdef HAVE_RL_COMPLETER_QUOTE_CHARACTERS
static char *completer_quote_characters = NULL;
rb_secure(4);
- OutputStringValue(str);
+ SafeStringValue(str);
if (completer_quote_characters == NULL) {
completer_quote_characters =
- ALLOC_N(char, RSTRING_LEN(str) + 1);
+ ALLOC_N(char, RSTRING(str)->len + 1);
}
else {
- REALLOC_N(completer_quote_characters, char, RSTRING_LEN(str) + 1);
+ REALLOC_N(completer_quote_characters, char, RSTRING(str)->len + 1);
}
- strncpy(completer_quote_characters, RSTRING_PTR(str), RSTRING_LEN(str));
- completer_quote_characters[RSTRING_LEN(str)] = '\0';
+ strncpy(completer_quote_characters,
+ RSTRING(str)->ptr, RSTRING(str)->len);
+ completer_quote_characters[RSTRING(str)->len] = '\0';
rl_completer_quote_characters = completer_quote_characters;
return self;
-}
#else
-#define readline_s_set_completer_quote_characters rb_f_notimplement
-#endif
+ rb_notimplement();
+ return Qnil; /* not reached */
+#endif /* HAVE_RL_COMPLETER_QUOTE_CHARACTERS */
+}
-#ifdef HAVE_RL_COMPLETER_QUOTE_CHARACTERS
-/*
- * call-seq:
- * Readline.completer_quote_characters -> string
- *
- * Gets a list of characters which can be used to quote a substring of
- * the line.
- *
- * Raises NotImplementedError if the using readline library does not support.
- *
- * Raises SecurityError exception if $SAFE is 4.
- */
static VALUE
-readline_s_get_completer_quote_characters(VALUE self, VALUE str)
+readline_s_get_completer_quote_characters(self, str)
+ VALUE self, str;
{
+#ifdef HAVE_RL_COMPLETER_QUOTE_CHARACTERS
rb_secure(4);
if (rl_completer_quote_characters == NULL)
return Qnil;
- return rb_locale_str_new_cstr(rl_completer_quote_characters);
-}
+ return rb_tainted_str_new2(rl_completer_quote_characters);
#else
-#define readline_s_get_completer_quote_characters rb_f_notimplement
-#endif
+ rb_notimplement();
+ return Qnil; /* not reached */
+#endif /* HAVE_RL_COMPLETER_QUOTE_CHARACTERS */
+}
-#ifdef HAVE_RL_FILENAME_QUOTE_CHARACTERS
-/*
- * call-seq:
- * Readline.filename_quote_characters = string
- *
- * Sets a list of characters that cause a filename to be quoted by the completer
- * when they appear in a completed filename. The default is nil.
- *
- * Raises NotImplementedError if the using readline library does not support.
- *
- * Raises SecurityError exception if $SAFE is 4.
- */
static VALUE
-readline_s_set_filename_quote_characters(VALUE self, VALUE str)
+readline_s_set_filename_quote_characters(self, str)
+ VALUE self, str;
{
+#ifdef HAVE_RL_FILENAME_QUOTE_CHARACTERS
static char *filename_quote_characters = NULL;
rb_secure(4);
- OutputStringValue(str);
+ SafeStringValue(str);
if (filename_quote_characters == NULL) {
filename_quote_characters =
- ALLOC_N(char, RSTRING_LEN(str) + 1);
+ ALLOC_N(char, RSTRING(str)->len + 1);
}
else {
- REALLOC_N(filename_quote_characters, char, RSTRING_LEN(str) + 1);
+ REALLOC_N(filename_quote_characters, char, RSTRING(str)->len + 1);
}
- strncpy(filename_quote_characters, RSTRING_PTR(str), RSTRING_LEN(str));
- filename_quote_characters[RSTRING_LEN(str)] = '\0';
+ strncpy(filename_quote_characters,
+ RSTRING(str)->ptr, RSTRING(str)->len);
+ filename_quote_characters[RSTRING(str)->len] = '\0';
rl_filename_quote_characters = filename_quote_characters;
return self;
-}
#else
-#define readline_s_set_filename_quote_characters rb_f_notimplement
-#endif
+ rb_notimplement();
+ return Qnil; /* not reached */
+#endif /* HAVE_RL_FILENAME_QUOTE_CHARACTERS */
+}
-#ifdef HAVE_RL_FILENAME_QUOTE_CHARACTERS
-/*
- * call-seq:
- * Readline.filename_quote_characters -> string
- *
- * Gets a list of characters that cause a filename to be quoted by the completer
- * when they appear in a completed filename.
- *
- * Raises NotImplementedError if the using readline library does not support.
- *
- * Raises SecurityError exception if $SAFE is 4.
- */
static VALUE
-readline_s_get_filename_quote_characters(VALUE self, VALUE str)
+readline_s_get_filename_quote_characters(self, str)
+ VALUE self, str;
{
+#ifdef HAVE_RL_FILENAME_QUOTE_CHARACTERS
rb_secure(4);
if (rl_filename_quote_characters == NULL)
return Qnil;
- return rb_locale_str_new_cstr(rl_filename_quote_characters);
-}
+ return rb_tainted_str_new2(rl_filename_quote_characters);
#else
-#define readline_s_get_filename_quote_characters rb_f_notimplement
-#endif
-
-#ifdef HAVE_RL_REFRESH_LINE
-/*
- * call-seq:
- * Readline.refresh_line -> nil
- *
- * Clear the current input line.
- *
- * Raises SecurityError exception if $SAFE is 4.
- */
-static VALUE
-readline_s_refresh_line(VALUE self)
-{
- rb_secure(4);
- rl_refresh_line(0, 0);
- return Qnil;
+ rb_notimplement();
+ return Qnil; /* not reached */
+#endif /* HAVE_RL_FILENAME_QUOTE_CHARACTERS */
}
-#else
-#define readline_s_refresh_line rb_f_notimplement
-#endif
static VALUE
-hist_to_s(VALUE self)
+hist_to_s(self)
+ VALUE self;
{
- return rb_str_new_cstr("HISTORY");
-}
-
-static int
-history_get_offset_history_base(int offset)
-{
- return history_base + offset;
-}
-
-static int
-history_get_offset_0(int offset)
-{
- return offset;
+ return rb_str_new2("HISTORY");
}
static VALUE
-hist_get(VALUE self, VALUE index)
+hist_get(self, index)
+ VALUE self;
+ VALUE index;
{
- HIST_ENTRY *entry = NULL;
+ HIST_ENTRY *entry;
int i;
rb_secure(4);
@@ -1093,65 +531,71 @@ hist_get(VALUE self, VALUE index)
if (i < 0) {
i += history_length;
}
- if (i >= 0) {
- entry = history_get(history_get_offset_func(i));
- }
+ entry = history_get(history_base + i);
if (entry == NULL) {
rb_raise(rb_eIndexError, "invalid index");
}
- return rb_locale_str_new_cstr(entry->line);
+ return rb_tainted_str_new2(entry->line);
}
-#ifdef HAVE_REPLACE_HISTORY_ENTRY
static VALUE
-hist_set(VALUE self, VALUE index, VALUE str)
+hist_set(self, index, str)
+ VALUE self;
+ VALUE index;
+ VALUE str;
{
- HIST_ENTRY *entry = NULL;
+#ifdef HAVE_REPLACE_HISTORY_ENTRY
+ HIST_ENTRY *entry;
int i;
rb_secure(4);
i = NUM2INT(index);
- OutputStringValue(str);
+ SafeStringValue(str);
if (i < 0) {
i += history_length;
}
- if (i >= 0) {
- entry = replace_history_entry(i, RSTRING_PTR(str), NULL);
- }
+ entry = replace_history_entry(i, RSTRING(str)->ptr, NULL);
if (entry == NULL) {
rb_raise(rb_eIndexError, "invalid index");
}
return str;
-}
#else
-#define hist_set rb_f_notimplement
+ rb_notimplement();
+ return Qnil; /* not reached */
#endif
+}
static VALUE
-hist_push(VALUE self, VALUE str)
+hist_push(self, str)
+ VALUE self;
+ VALUE str;
{
rb_secure(4);
- OutputStringValue(str);
- add_history(RSTRING_PTR(str));
+ SafeStringValue(str);
+ add_history(RSTRING(str)->ptr);
return self;
}
static VALUE
-hist_push_method(int argc, VALUE *argv, VALUE self)
+hist_push_method(argc, argv, self)
+ int argc;
+ VALUE *argv;
+ VALUE self;
{
VALUE str;
rb_secure(4);
while (argc--) {
str = *argv++;
- OutputStringValue(str);
- add_history(RSTRING_PTR(str));
+ SafeStringValue(str);
+ add_history(RSTRING(str)->ptr);
}
return self;
}
static VALUE
-rb_remove_history(int index)
+rb_remove_history(index)
+ int index;
{
#ifdef HAVE_REMOVE_HISTORY
HIST_ENTRY *entry;
@@ -1160,8 +604,8 @@ rb_remove_history(int index)
rb_secure(4);
entry = remove_history(index);
if (entry) {
- val = rb_locale_str_new_cstr(entry->line);
- free((void *) entry->line);
+ val = rb_tainted_str_new2(entry->line);
+ free(entry->line);
free(entry);
return val;
}
@@ -1173,7 +617,8 @@ rb_remove_history(int index)
}
static VALUE
-hist_pop(VALUE self)
+hist_pop(self)
+ VALUE self;
{
rb_secure(4);
if (history_length > 0) {
@@ -1184,7 +629,8 @@ hist_pop(VALUE self)
}
static VALUE
-hist_shift(VALUE self)
+hist_shift(self)
+ VALUE self;
{
rb_secure(4);
if (history_length > 0) {
@@ -1195,39 +641,42 @@ hist_shift(VALUE self)
}
static VALUE
-hist_each(VALUE self)
+hist_each(self)
+ VALUE self;
{
HIST_ENTRY *entry;
int i;
- RETURN_ENUMERATOR(self, 0, 0);
-
rb_secure(4);
for (i = 0; i < history_length; i++) {
- entry = history_get(history_get_offset_func(i));
+ entry = history_get(history_base + i);
if (entry == NULL)
break;
- rb_yield(rb_locale_str_new_cstr(entry->line));
+ rb_yield(rb_tainted_str_new2(entry->line));
}
return self;
}
static VALUE
-hist_length(VALUE self)
+hist_length(self)
+ VALUE self;
{
rb_secure(4);
return INT2NUM(history_length);
}
static VALUE
-hist_empty_p(VALUE self)
+hist_empty_p(self)
+ VALUE self;
{
rb_secure(4);
return history_length == 0 ? Qtrue : Qfalse;
}
static VALUE
-hist_delete_at(VALUE self, VALUE index)
+hist_delete_at(self, index)
+ VALUE self;
+ VALUE index;
{
int i;
@@ -1241,20 +690,10 @@ hist_delete_at(VALUE self, VALUE index)
return rb_remove_history(i);
}
-#ifdef HAVE_CLEAR_HISTORY
static VALUE
-hist_clear(VALUE self)
-{
- rb_secure(4);
- clear_history();
- return self;
-}
-#else
-#define hist_clear rb_f_notimplement
-#endif
-
-static VALUE
-filename_completion_proc_call(VALUE self, VALUE str)
+filename_completion_proc_call(self, str)
+ VALUE self;
+ VALUE str;
{
VALUE result;
char **matches;
@@ -1265,11 +704,11 @@ filename_completion_proc_call(VALUE self, VALUE str)
if (matches) {
result = rb_ary_new();
for (i = 0; matches[i]; i++) {
- rb_ary_push(result, rb_locale_str_new_cstr(matches[i]));
+ rb_ary_push(result, rb_tainted_str_new2(matches[i]));
free(matches[i]);
}
free(matches);
- if (RARRAY_LEN(result) >= 2)
+ if (RARRAY(result)->len >= 2)
rb_ary_shift(result);
}
else {
@@ -1279,7 +718,9 @@ filename_completion_proc_call(VALUE self, VALUE str)
}
static VALUE
-username_completion_proc_call(VALUE self, VALUE str)
+username_completion_proc_call(self, str)
+ VALUE self;
+ VALUE str;
{
VALUE result;
char **matches;
@@ -1290,11 +731,11 @@ username_completion_proc_call(VALUE self, VALUE str)
if (matches) {
result = rb_ary_new();
for (i = 0; matches[i]; i++) {
- rb_ary_push(result, rb_locale_str_new_cstr(matches[i]));
+ rb_ary_push(result, rb_tainted_str_new2(matches[i]));
free(matches[i]);
}
free(matches);
- if (RARRAY_LEN(result) >= 2)
+ if (RARRAY(result)->len >= 2)
rb_ary_shift(result);
}
else {
@@ -1306,10 +747,10 @@ username_completion_proc_call(VALUE self, VALUE str)
void
Init_readline()
{
- VALUE history, fcomp, ucomp, version;
+ VALUE history, fcomp, ucomp;
/* Allow conditional parsing of the ~/.inputrc file. */
- rl_readline_name = (char *)"Ruby";
+ rl_readline_name = "Ruby";
using_history();
@@ -1319,10 +760,6 @@ Init_readline()
mReadline = rb_define_module("Readline");
rb_define_module_function(mReadline, "readline",
readline_readline, -1);
- rb_define_singleton_method(mReadline, "input=",
- readline_s_set_input, 1);
- rb_define_singleton_method(mReadline, "output=",
- readline_s_set_output, 1);
rb_define_singleton_method(mReadline, "completion_proc=",
readline_s_set_completion_proc, 1);
rb_define_singleton_method(mReadline, "completion_proc",
@@ -1331,22 +768,10 @@ Init_readline()
readline_s_set_completion_case_fold, 1);
rb_define_singleton_method(mReadline, "completion_case_fold",
readline_s_get_completion_case_fold, 0);
- rb_define_singleton_method(mReadline, "line_buffer",
- readline_s_get_line_buffer, 0);
- rb_define_singleton_method(mReadline, "point",
- readline_s_get_point, 0);
- rb_define_singleton_method(mReadline, "set_screen_size",
- readline_s_set_screen_size, 2);
- rb_define_singleton_method(mReadline, "get_screen_size",
- readline_s_get_screen_size, 0);
rb_define_singleton_method(mReadline, "vi_editing_mode",
readline_s_vi_editing_mode, 0);
- rb_define_singleton_method(mReadline, "vi_editing_mode?",
- readline_s_vi_editing_mode_p, 0);
rb_define_singleton_method(mReadline, "emacs_editing_mode",
readline_s_emacs_editing_mode, 0);
- rb_define_singleton_method(mReadline, "emacs_editing_mode?",
- readline_s_emacs_editing_mode_p, 0);
rb_define_singleton_method(mReadline, "completion_append_character=",
readline_s_set_completion_append_character, 1);
rb_define_singleton_method(mReadline, "completion_append_character",
@@ -1371,8 +796,6 @@ Init_readline()
readline_s_set_filename_quote_characters, 1);
rb_define_singleton_method(mReadline, "filename_quote_characters",
readline_s_get_filename_quote_characters, 0);
- rb_define_singleton_method(mReadline, "refresh_line",
- readline_s_refresh_line, 0);
history = rb_obj_alloc(rb_cObject);
rb_extend_object(history, rb_mEnumerable);
@@ -1388,75 +811,28 @@ Init_readline()
rb_define_singleton_method(history,"size", hist_length, 0);
rb_define_singleton_method(history,"empty?", hist_empty_p, 0);
rb_define_singleton_method(history,"delete_at", hist_delete_at, 1);
- rb_define_singleton_method(history,"clear", hist_clear, 0);
-
- /*
- * The history buffer. It extends Enumerable module, so it behaves
- * just like an array.
- * For example, gets the fifth content that the user input by
- * HISTORY[4].
- */
rb_define_const(mReadline, "HISTORY", history);
fcomp = rb_obj_alloc(rb_cObject);
rb_define_singleton_method(fcomp, "call",
filename_completion_proc_call, 1);
- /*
- * The Object with the call method that is a completion for filename.
- * This is sets by Readline.completion_proc= method.
- */
rb_define_const(mReadline, "FILENAME_COMPLETION_PROC", fcomp);
ucomp = rb_obj_alloc(rb_cObject);
rb_define_singleton_method(ucomp, "call",
username_completion_proc_call, 1);
- /*
- * The Object with the call method that is a completion for usernames.
- * This is sets by Readline.completion_proc= method.
- */
rb_define_const(mReadline, "USERNAME_COMPLETION_PROC", ucomp);
- history_get_offset_func = history_get_offset_history_base;
#if defined HAVE_RL_LIBRARY_VERSION
- version = rb_str_new_cstr(rl_library_version);
-#if defined HAVE_CLEAR_HISTORY || defined HAVE_REMOVE_HISTORY
- if (strncmp(rl_library_version, EDIT_LINE_LIBRARY_VERSION,
- strlen(EDIT_LINE_LIBRARY_VERSION)) == 0) {
- add_history("1");
- if (history_get(history_get_offset_func(0)) == NULL) {
- history_get_offset_func = history_get_offset_0;
- }
-#if !defined HAVE_CLEAR_HISTORY
- clear_history();
+ rb_define_const(mReadline, "VERSION", rb_str_new2(rl_library_version));
#else
- {
- HIST_ENTRY *entry = remove_history(0);
- if (entry) {
- free((char *)entry->line);
- free(entry);
- }
- }
+ rb_define_const(mReadline, "VERSION",
+ rb_str_new2("2.0 or before version"));
#endif
- }
-#endif
-#else
- version = rb_str_new_cstr("2.0 or prior version");
-#endif
- /* Version string of GNU Readline or libedit. */
- rb_define_const(mReadline, "VERSION", version);
rl_attempted_completion_function = readline_attempted_completion_function;
-#if defined HAVE_RL_GETC_FUNCTION
- rl_getc_function = readline_getc;
- id_getbyte = rb_intern_const("getbyte");
-#elif defined HAVE_RL_EVENT_HOOK
+#ifdef HAVE_RL_EVENT_HOOK
rl_event_hook = readline_event;
#endif
-#ifdef HAVE_RL_CATCH_SIGNALS
- rl_catch_signals = 0;
-#endif
-#ifdef HAVE_RL_CATCH_SIGWINCH
- rl_catch_sigwinch = 0;
-#endif
#ifdef HAVE_RL_CLEAR_SIGNALS
rl_clear_signals();
#endif
diff --git a/ext/ripper/.cvsignore b/ext/ripper/.cvsignore
deleted file mode 100644
index c9adce0b1a..0000000000
--- a/ext/ripper/.cvsignore
+++ /dev/null
@@ -1,8 +0,0 @@
-Makefile
-mkmf.log
-eventids1.c
-eventids2table.c
-ripper.*
-ids1
-ids2
-extconf.h
diff --git a/ext/ripper/README b/ext/ripper/README
deleted file mode 100644
index 0825013ba9..0000000000
--- a/ext/ripper/README
+++ /dev/null
@@ -1,30 +0,0 @@
-Ripper README
-=============
-
- Ripper is a Ruby script parser. You can get information
- by event-based style from the parser.
-
- !! WARNING !!
-
- Ripper is still early-alpha version.
- I never assure any kind of backward compatibility.
-
-Requirements
-------------
-
- * ruby 1.9 (support CVS HEAD only)
- * bison 1.28 or later (Other yaccs do not work)
-
-Usage
------
-
- See test/ripper/* and sample/ripper/*.
-
-License
--------
-
- Ruby License.
-
- Minero Aoki
- aamine@loveruby.net
- http://i.loveruby.net
diff --git a/ext/ripper/depend b/ext/ripper/depend
deleted file mode 100644
index 306a75ca9e..0000000000
--- a/ext/ripper/depend
+++ /dev/null
@@ -1,41 +0,0 @@
-GEN = $(srcdir)/tools/generate.rb
-SRC1 = $(top_srcdir)/parse.y
-SRC2 = $(srcdir)/eventids2.c
-BISON = bison
-
-.SUFFIXES: .y
-
-src: ripper.c eventids1.c eventids2table.c
-
-ripper.o: ripper.c lex.c eventids1.c eventids2.c eventids2table.c \
- $(hdrdir)/ruby/ruby.h $(arch_hdrdir)/ruby/config.h \
- $(hdrdir)/ruby/defines.h $(hdrdir)/ruby/intern.h \
- $(hdrdir)/ruby/encoding.h $(hdrdir)/missing.h \
- $(hdrdir)/../node.h $(hdrdir)/oniguruma.h \
- $(hdrdir)/regex.h $(hdrdir)/st.h $(hdrdir)/util.h
-
-.y.c:
- $(BISON) -t -v -oy.tab.c $<
- 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 $(top_srcdir)/parse.y
- $(RUBY) $(srcdir)/tools/preproc.rb $(top_srcdir)/parse.y --output=$@
-
-check: $(GEN) $(SRC1) $(SRC2)
- $(RUBY) $(GEN) --mode=check --ids1src=$(SRC1) --ids2src=$(SRC2)
-
-eventids1.c: $(srcdir)/tools/generate.rb $(SRC1)
- $(RUBY) $(GEN) --mode=eventids1 --ids1src=$(SRC1) --output=$@
-
-eventids2table.c: $(srcdir)/tools/generate.rb $(SRC2)
- $(RUBY) $(GEN) --mode=eventids2table --ids2src=$(SRC2) --output=$@
-
-# Entries for Ripper maintainer
-
-preproc: ripper.E
-ripper.E: ripper.c
- $(CC) -E $(CPPFLAGS) ripper.c | $(RUBY) $(srcdir)/tools/strip.rb > $@
diff --git a/ext/ripper/eventids2.c b/ext/ripper/eventids2.c
deleted file mode 100644
index a557a41fa7..0000000000
--- a/ext/ripper/eventids2.c
+++ /dev/null
@@ -1,278 +0,0 @@
-#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)
-
-static ID ripper_id_backref;
-static ID ripper_id_backtick;
-static ID ripper_id_comma;
-static ID ripper_id_const;
-static ID ripper_id_cvar;
-static ID ripper_id_embexpr_beg;
-static ID ripper_id_embexpr_end;
-static ID ripper_id_embvar;
-static ID ripper_id_float;
-static ID ripper_id_gvar;
-static ID ripper_id_ident;
-static ID ripper_id_int;
-static ID ripper_id_ivar;
-static ID ripper_id_kw;
-static ID ripper_id_lbrace;
-static ID ripper_id_lbracket;
-static ID ripper_id_lparen;
-static ID ripper_id_nl;
-static ID ripper_id_op;
-static ID ripper_id_period;
-static ID ripper_id_rbrace;
-static ID ripper_id_rbracket;
-static ID ripper_id_rparen;
-static ID ripper_id_semicolon;
-static ID ripper_id_symbeg;
-static ID ripper_id_tstring_beg;
-static ID ripper_id_tstring_content;
-static ID ripper_id_tstring_end;
-static ID ripper_id_words_beg;
-static ID ripper_id_qwords_beg;
-static ID ripper_id_words_sep;
-static ID ripper_id_regexp_beg;
-static ID ripper_id_regexp_end;
-static ID ripper_id_label;
-static ID ripper_id_tlambda;
-static ID ripper_id_tlambeg;
-
-static ID ripper_id_ignored_nl;
-static ID ripper_id_comment;
-static ID ripper_id_embdoc_beg;
-static ID ripper_id_embdoc;
-static ID ripper_id_embdoc_end;
-static ID ripper_id_sp;
-static ID ripper_id_heredoc_beg;
-static ID ripper_id_heredoc_end;
-static ID ripper_id___end__;
-static ID ripper_id_CHAR;
-
-#include "eventids2table.c"
-
-static void
-ripper_init_eventids2(VALUE self)
-{
- ripper_id_backref = rb_intern_const("on_backref");
- ripper_id_backtick = rb_intern_const("on_backtick");
- ripper_id_comma = rb_intern_const("on_comma");
- ripper_id_const = rb_intern_const("on_const");
- ripper_id_cvar = rb_intern_const("on_cvar");
- ripper_id_embexpr_beg = rb_intern_const("on_embexpr_beg");
- ripper_id_embexpr_end = rb_intern_const("on_embexpr_end");
- ripper_id_embvar = rb_intern_const("on_embvar");
- ripper_id_float = rb_intern_const("on_float");
- ripper_id_gvar = rb_intern_const("on_gvar");
- ripper_id_ident = rb_intern_const("on_ident");
- ripper_id_int = rb_intern_const("on_int");
- ripper_id_ivar = rb_intern_const("on_ivar");
- ripper_id_kw = rb_intern_const("on_kw");
- ripper_id_lbrace = rb_intern_const("on_lbrace");
- ripper_id_lbracket = rb_intern_const("on_lbracket");
- ripper_id_lparen = rb_intern_const("on_lparen");
- ripper_id_nl = rb_intern_const("on_nl");
- ripper_id_op = rb_intern_const("on_op");
- ripper_id_period = rb_intern_const("on_period");
- ripper_id_rbrace = rb_intern_const("on_rbrace");
- ripper_id_rbracket = rb_intern_const("on_rbracket");
- ripper_id_rparen = rb_intern_const("on_rparen");
- ripper_id_semicolon = rb_intern_const("on_semicolon");
- ripper_id_symbeg = rb_intern_const("on_symbeg");
- ripper_id_tstring_beg = rb_intern_const("on_tstring_beg");
- ripper_id_tstring_content = rb_intern_const("on_tstring_content");
- ripper_id_tstring_end = rb_intern_const("on_tstring_end");
- ripper_id_words_beg = rb_intern_const("on_words_beg");
- ripper_id_qwords_beg = rb_intern_const("on_qwords_beg");
- ripper_id_words_sep = rb_intern_const("on_words_sep");
- ripper_id_regexp_beg = rb_intern_const("on_regexp_beg");
- ripper_id_regexp_end = rb_intern_const("on_regexp_end");
- ripper_id_label = rb_intern_const("on_label");
- ripper_id_tlambda = rb_intern_const("on_tlambda");
- ripper_id_tlambeg = rb_intern_const("on_tlambeg");
-
- ripper_id_ignored_nl = rb_intern_const("on_ignored_nl");
- ripper_id_comment = rb_intern_const("on_comment");
- ripper_id_embdoc_beg = rb_intern_const("on_embdoc_beg");
- ripper_id_embdoc = rb_intern_const("on_embdoc");
- ripper_id_embdoc_end = rb_intern_const("on_embdoc_end");
- ripper_id_sp = rb_intern_const("on_sp");
- ripper_id_heredoc_beg = rb_intern_const("on_heredoc_beg");
- ripper_id_heredoc_end = rb_intern_const("on_heredoc_end");
- ripper_id___end__ = rb_intern_const("on___end__");
- ripper_id_CHAR = rb_intern_const("on_CHAR");
-
- ripper_init_eventids2_table(self);
-}
-
-static const struct token_assoc {
- int token;
- ID *id;
-} token_to_eventid[] = {
- {' ', &ripper_id_words_sep},
- {'!', &ripper_id_op},
- {'%', &ripper_id_op},
- {'&', &ripper_id_op},
- {'*', &ripper_id_op},
- {'+', &ripper_id_op},
- {'-', &ripper_id_op},
- {'/', &ripper_id_op},
- {'<', &ripper_id_op},
- {'=', &ripper_id_op},
- {'>', &ripper_id_op},
- {'?', &ripper_id_op},
- {'^', &ripper_id_op},
- {'|', &ripper_id_op},
- {'~', &ripper_id_op},
- {':', &ripper_id_op},
- {',', &ripper_id_comma},
- {'.', &ripper_id_period},
- {';', &ripper_id_semicolon},
- {'`', &ripper_id_backtick},
- {'\n', &ripper_id_nl},
- {keyword_alias, &ripper_id_kw},
- {keyword_and, &ripper_id_kw},
- {keyword_begin, &ripper_id_kw},
- {keyword_break, &ripper_id_kw},
- {keyword_case, &ripper_id_kw},
- {keyword_class, &ripper_id_kw},
- {keyword_def, &ripper_id_kw},
- {keyword_defined, &ripper_id_kw},
- {keyword_do, &ripper_id_kw},
- {keyword_do_block, &ripper_id_kw},
- {keyword_do_cond, &ripper_id_kw},
- {keyword_else, &ripper_id_kw},
- {keyword_elsif, &ripper_id_kw},
- {keyword_end, &ripper_id_kw},
- {keyword_ensure, &ripper_id_kw},
- {keyword_false, &ripper_id_kw},
- {keyword_for, &ripper_id_kw},
- {keyword_if, &ripper_id_kw},
- {modifier_if, &ripper_id_kw},
- {keyword_in, &ripper_id_kw},
- {keyword_module, &ripper_id_kw},
- {keyword_next, &ripper_id_kw},
- {keyword_nil, &ripper_id_kw},
- {keyword_not, &ripper_id_kw},
- {keyword_or, &ripper_id_kw},
- {keyword_redo, &ripper_id_kw},
- {keyword_rescue, &ripper_id_kw},
- {modifier_rescue, &ripper_id_kw},
- {keyword_retry, &ripper_id_kw},
- {keyword_return, &ripper_id_kw},
- {keyword_self, &ripper_id_kw},
- {keyword_super, &ripper_id_kw},
- {keyword_then, &ripper_id_kw},
- {keyword_true, &ripper_id_kw},
- {keyword_undef, &ripper_id_kw},
- {keyword_unless, &ripper_id_kw},
- {modifier_unless, &ripper_id_kw},
- {keyword_until, &ripper_id_kw},
- {modifier_until, &ripper_id_kw},
- {keyword_when, &ripper_id_kw},
- {keyword_while, &ripper_id_kw},
- {modifier_while, &ripper_id_kw},
- {keyword_yield, &ripper_id_kw},
- {keyword__FILE__, &ripper_id_kw},
- {keyword__LINE__, &ripper_id_kw},
- {keyword__ENCODING__, &ripper_id_kw},
- {keyword_BEGIN, &ripper_id_kw},
- {keyword_END, &ripper_id_kw},
- {tAMPER, &ripper_id_op},
- {tANDOP, &ripper_id_op},
- {tAREF, &ripper_id_op},
- {tASET, &ripper_id_op},
- {tASSOC, &ripper_id_op},
- {tBACK_REF, &ripper_id_backref},
- {tCHAR, &ripper_id_CHAR},
- {tCMP, &ripper_id_op},
- {tCOLON2, &ripper_id_op},
- {tCOLON3, &ripper_id_op},
- {tCONSTANT, &ripper_id_const},
- {tCVAR, &ripper_id_cvar},
- {tDOT2, &ripper_id_op},
- {tDOT3, &ripper_id_op},
- {tEQ, &ripper_id_op},
- {tEQQ, &ripper_id_op},
- {tFID, &ripper_id_ident},
- {tFLOAT, &ripper_id_float},
- {tGEQ, &ripper_id_op},
- {tGVAR, &ripper_id_gvar},
- {tIDENTIFIER, &ripper_id_ident},
- {tINTEGER, &ripper_id_int},
- {tIVAR, &ripper_id_ivar},
- {tLBRACE, &ripper_id_lbrace},
- {tLBRACE_ARG, &ripper_id_lbrace},
- {'{', &ripper_id_lbrace},
- {'}', &ripper_id_rbrace},
- {tLBRACK, &ripper_id_lbracket},
- {'[', &ripper_id_lbracket},
- {']', &ripper_id_rbracket},
- {tLEQ, &ripper_id_op},
- {tLPAREN, &ripper_id_lparen},
- {tLPAREN_ARG, &ripper_id_lparen},
- {'(', &ripper_id_lparen},
- {')', &ripper_id_rparen},
- {tLSHFT, &ripper_id_op},
- {tMATCH, &ripper_id_op},
- {tNEQ, &ripper_id_op},
- {tNMATCH, &ripper_id_op},
- {tNTH_REF, &ripper_id_backref},
- {tOP_ASGN, &ripper_id_op},
- {tOROP, &ripper_id_op},
- {tPOW, &ripper_id_op},
- {tQWORDS_BEG, &ripper_id_qwords_beg},
- {tREGEXP_BEG, &ripper_id_regexp_beg},
- {tREGEXP_END, &ripper_id_regexp_end},
- {tRPAREN, &ripper_id_rparen},
- {tRSHFT, &ripper_id_op},
- {tSTAR, &ripper_id_op},
- {tSTRING_BEG, &ripper_id_tstring_beg},
- {tSTRING_CONTENT, &ripper_id_tstring_content},
- {tSTRING_DBEG, &ripper_id_embexpr_beg},
- {tSTRING_DVAR, &ripper_id_embvar},
- {tSTRING_END, &ripper_id_tstring_end},
- {tSYMBEG, &ripper_id_symbeg},
- {tUMINUS, &ripper_id_op},
- {tUMINUS_NUM, &ripper_id_op},
- {tUPLUS, &ripper_id_op},
- {tWORDS_BEG, &ripper_id_words_beg},
- {tXSTRING_BEG, &ripper_id_backtick},
- {tLABEL, &ripper_id_label},
- {tLAMBDA, &ripper_id_tlambda},
- {tLAMBEG, &ripper_id_tlambeg},
-
- /* ripper specific tokens */
- {tIGNORED_NL, &ripper_id_ignored_nl},
- {tCOMMENT, &ripper_id_comment},
- {tEMBDOC_BEG, &ripper_id_embdoc_beg},
- {tEMBDOC, &ripper_id_embdoc},
- {tEMBDOC_END, &ripper_id_embdoc_end},
- {tSP, &ripper_id_sp},
- {tHEREDOC_BEG, &ripper_id_heredoc_beg},
- {tHEREDOC_END, &ripper_id_heredoc_end},
- {k__END__, &ripper_id___end__},
- {0, NULL}
-};
-
-static ID
-ripper_token2eventid(int tok)
-{
- const struct token_assoc *a;
-
- for (a = token_to_eventid; a->id != NULL; a++) {
- if (a->token == tok)
- return *a->id;
- }
- if (tok < 256) {
- return ripper_id_CHAR;
- }
- rb_raise(rb_eRuntimeError, "[Ripper FATAL] unknown token %d", tok);
-}
diff --git a/ext/ripper/extconf.rb b/ext/ripper/extconf.rb
deleted file mode 100644
index 4914d70e78..0000000000
--- a/ext/ripper/extconf.rb
+++ /dev/null
@@ -1,22 +0,0 @@
-#!ruby -s
-
-require 'mkmf'
-require 'rbconfig'
-
-def main
- unless find_executable('bison')
- unless File.exist?('ripper.c') or File.exist?("#{$srcdir}/ripper.c")
- Logging.message 'missing bison; abort'
- return
- end
- end
- $objs = %w(ripper.o)
- $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'
-end
-
-main
diff --git a/ext/ripper/lib/ripper.rb b/ext/ripper/lib/ripper.rb
deleted file mode 100644
index cb19da334a..0000000000
--- a/ext/ripper/lib/ripper.rb
+++ /dev/null
@@ -1,4 +0,0 @@
-require 'ripper/core'
-require 'ripper/lexer'
-require 'ripper/filter'
-require 'ripper/sexp'
diff --git a/ext/ripper/lib/ripper/core.rb b/ext/ripper/lib/ripper/core.rb
deleted file mode 100644
index 35aa54d090..0000000000
--- a/ext/ripper/lib/ripper/core.rb
+++ /dev/null
@@ -1,70 +0,0 @@
-#
-# $Id$
-#
-# Copyright (c) 2003-2005 Minero Aoki
-#
-# This program is free software.
-# You can distribute and/or modify this program under the Ruby License.
-# For details of Ruby License, see ruby/COPYING.
-#
-
-require 'ripper.so'
-
-class Ripper
-
- # Parses Ruby program read from _src_.
- # _src_ must be a String or a IO or a object which has #gets method.
- def Ripper.parse(src, filename = '(ripper)', lineno = 1)
- new(src, filename, lineno).parse
- end
-
- # This array contains name of parser events.
- PARSER_EVENTS = PARSER_EVENT_TABLE.keys
-
- # This array contains name of scanner events.
- SCANNER_EVENTS = SCANNER_EVENT_TABLE.keys
-
- # This array contains name of all ripper events.
- EVENTS = PARSER_EVENTS + SCANNER_EVENTS
-
- private
-
- #
- # Parser Events
- #
-
- PARSER_EVENT_TABLE.each do |id, arity|
- module_eval(<<-End, __FILE__, __LINE__ + 1)
- def on_#{id}(#{ ('a'..'z').to_a[0, arity].join(', ') })
- #{arity == 0 ? 'nil' : 'a'}
- end
- End
- end
-
- # This method is called when weak warning is produced by the parser.
- # _fmt_ and _args_ is printf style.
- def warn(fmt, *args)
- end
-
- # This method is called when strong warning is produced by the parser.
- # _fmt_ and _args_ is printf style.
- def warning(fmt, *args)
- end
-
- # This method is called when the parser found syntax error.
- def compile_error(msg)
- end
-
- #
- # Scanner Events
- #
-
- SCANNER_EVENTS.each do |id|
- 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
deleted file mode 100644
index 898501b23c..0000000000
--- a/ext/ripper/lib/ripper/filter.rb
+++ /dev/null
@@ -1,70 +0,0 @@
-#
-# $Id$
-#
-# Copyright (c) 2004,2005 Minero Aoki
-#
-# This program is free software.
-# You can distribute and/or modify this program under the Ruby License.
-# For details of Ruby License, see ruby/COPYING.
-#
-
-require 'ripper/lexer'
-
-class Ripper
-
- # This class handles only scanner events,
- # and they are dispatched in the `right' order (same with input).
- class Filter
-
- def initialize(src, filename = '-', lineno = 1)
- @__lexer = Lexer.new(src, filename, lineno)
- @__line = nil
- @__col = nil
- end
-
- # The file name of the input.
- def filename
- @__lexer.filename
- end
-
- # The line number of the current token.
- # This value starts from 1.
- # This method is valid only in event handlers.
- def lineno
- @__line
- end
-
- # The column number of the current token.
- # This value starts from 0.
- # This method is valid only in event handlers.
- def column
- @__col
- end
-
- # Starts parsing. _init_ is a data accumulator.
- # It is passed to the next event handler (as of Enumerable#inject).
- def parse(init = nil)
- data = init
- @__lexer.lex.each do |pos, event, tok|
- @__line, @__col = *pos
- data = if respond_to?(event, true)
- then __send__(event, tok, data)
- else on_default(event, tok, data)
- end
- end
- data
- end
-
- private
-
- # This method is called when some event handler have not defined.
- # _event_ is :on_XXX, _token_ is scanned token, _data_ is a data
- # accumulator. The return value of this method is passed to the
- # next event handler (as of Enumerable#inject).
- def on_default(event, token, data)
- data
- end
-
- end
-
-end
diff --git a/ext/ripper/lib/ripper/lexer.rb b/ext/ripper/lib/ripper/lexer.rb
deleted file mode 100644
index 5bbee39e06..0000000000
--- a/ext/ripper/lib/ripper/lexer.rb
+++ /dev/null
@@ -1,179 +0,0 @@
-#
-# $Id$
-#
-# Copyright (c) 2004,2005 Minero Aoki
-#
-# This program is free software.
-# You can distribute and/or modify this program under the Ruby License.
-# For details of Ruby License, see ruby/COPYING.
-#
-
-require 'ripper/core'
-
-class Ripper
-
- # Tokenizes Ruby program and returns an Array of String.
- def Ripper.tokenize(src, filename = '-', lineno = 1)
- Lexer.new(src, filename, lineno).tokenize
- end
-
- # Tokenizes Ruby program and returns an Array of Array,
- # which is formatted like [[lineno, column], type, token].
- #
- # require 'ripper'
- # require 'pp'
- #
- # p Ripper.lex("def m(a) nil 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
- def tokenize
- lex().map {|pos, event, tok| tok }
- end
-
- def lex
- parse().sort_by {|pos, event, tok| pos }
- end
-
- def parse
- @buf = []
- super
- @buf
- end
-
- private
-
- SCANNER_EVENTS.each do |event|
- module_eval(<<-End, __FILE__+'/module_eval', __LINE__ + 1)
- def on_#{event}(tok)
- @buf.push [[lineno(), column()], :on_#{event}, tok]
- end
- End
- end
- end
-
- # [EXPERIMENTAL]
- # Parses +src+ and return a string which was matched to +pattern+.
- # +pattern+ should be described as Regexp.
- #
- # require 'ripper'
- #
- # p Ripper.slice('def m(a) nil end', 'ident') #=> "m"
- # p Ripper.slice('def m(a) nil end', '[ident lparen rparen]+') #=> "m(a)"
- # p Ripper.slice("<<EOS\nstring\nEOS",
- # 'heredoc_beg nl $(tstring_content*) heredoc_end', 1)
- # #=> "string\n"
- #
- def Ripper.slice(src, pattern, n = 0)
- if m = token_match(src, pattern)
- then m.string(n)
- else nil
- end
- end
-
- def Ripper.token_match(src, pattern) #:nodoc:
- TokenPattern.compile(pattern).match(src)
- end
-
- class TokenPattern #:nodoc:
-
- class Error < ::StandardError; end
- class CompileError < Error; end
- class MatchError < Error; end
-
- class << self
- alias compile new
- end
-
- def initialize(pattern)
- @source = pattern
- @re = compile(pattern)
- end
-
- def match(str)
- match_list(::Ripper.lex(str))
- end
-
- def match_list(tokens)
- if m = @re.match(map_tokens(tokens))
- then MatchData.new(tokens, m)
- else nil
- end
- end
-
- private
-
- def compile(pattern)
- if m = /[^\w\s$()\[\]{}?*+\.]/.match(pattern)
- raise CompileError, "invalid char in pattern: #{m[0].inspect}"
- end
- buf = ''
- pattern.scan(/(?:\w+|\$\(|[()\[\]\{\}?*+\.]+)/) do |tok|
- case tok
- when /\w/
- buf.concat map_token(tok)
- when '$('
- buf.concat '('
- when '('
- buf.concat '(?:'
- when /[?*\[\])\.]/
- buf.concat tok
- else
- raise 'must not happen'
- end
- end
- Regexp.compile(buf)
- rescue RegexpError => err
- raise CompileError, err.message
- end
-
- def map_tokens(tokens)
- 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.sub(/\Aon_/,'')] = seed.shift
- end
-
- def map_token(tok)
- MAP[tok] or raise CompileError, "unknown token: #{tok}"
- end
-
- class MatchData
- def initialize(tokens, match)
- @tokens = tokens
- @match = match
- end
-
- def string(n = 0)
- return nil unless @match
- match(n).join
- end
-
- private
-
- def match(n = 0)
- return [] unless @match
- @tokens[@match.begin(n)...@match.end(n)].map {|pos,type,str| str }
- end
- end
-
- end
-
-end
diff --git a/ext/ripper/lib/ripper/sexp.rb b/ext/ripper/lib/ripper/sexp.rb
deleted file mode 100644
index f2260fe8dd..0000000000
--- a/ext/ripper/lib/ripper/sexp.rb
+++ /dev/null
@@ -1,99 +0,0 @@
-#
-# $Id$
-#
-# Copyright (c) 2004,2005 Minero Aoki
-#
-# This program is free software.
-# You can distribute and/or modify this program under the Ruby License.
-# For details of Ruby License, see ruby/COPYING.
-#
-
-require 'ripper/core'
-
-class Ripper
-
- # [EXPERIMENTAL]
- # Parses +src+ and create S-exp tree.
- # This method is for mainly developper use.
- #
- # require 'ripper'
- # require 'pp
- #
- # pp Ripper.sexp("def m(a) nil end")
- # #=> [:program,
- # [:stmts_add,
- # [:stmts_new],
- # [:def,
- # [:@ident, "m", [1, 4]],
- # [:paren, [:params, [[:@ident, "a", [1, 6]]], nil, nil, nil]],
- # [:bodystmt,
- # [:stmts_add, [:stmts_new], [:var_ref, [:@kw, "nil", [1, 9]]]],
- # nil,
- # nil,
- # nil]]]]
- #
- def Ripper.sexp(src, filename = '-', lineno = 1)
- SexpBuilderPP.new(src, filename, lineno).parse
- end
-
- def Ripper.sexp_raw(src, filename = '-', lineno = 1)
- SexpBuilder.new(src, filename, lineno).parse
- end
-
- class SexpBuilderPP < ::Ripper #:nodoc:
- private
-
- PARSER_EVENT_TABLE.each do |event, arity|
- if /_new\z/ =~ event.to_s and arity == 0
- module_eval(<<-End, __FILE__, __LINE__ + 1)
- def on_#{event}
- []
- end
- End
- elsif /_add\z/ =~ event.to_s
- module_eval(<<-End, __FILE__, __LINE__ + 1)
- def on_#{event}(list, item)
- list.push item
- list
- end
- End
- else
- module_eval(<<-End, __FILE__, __LINE__ + 1)
- def on_#{event}(*args)
- [:#{event}, *args]
- end
- End
- end
- end
-
- SCANNER_EVENTS.each do |event|
- module_eval(<<-End, __FILE__, __LINE__ + 1)
- def on_#{event}(tok)
- [:@#{event}, tok, [lineno(), column()]]
- end
- End
- end
- end
-
- class SexpBuilder < ::Ripper #:nodoc:
- private
-
- PARSER_EVENTS.each do |event|
- module_eval(<<-End, __FILE__, __LINE__ + 1)
- def on_#{event}(*args)
- args.unshift :#{event}
- args
- end
- End
- end
-
- SCANNER_EVENTS.each do |event|
- module_eval(<<-End, __FILE__, __LINE__ + 1)
- def on_#{event}(tok)
- [:@#{event}, tok, [lineno(), column()]]
- end
- End
- end
- end
-
-end
diff --git a/ext/ripper/tools/generate-param-macros.rb b/ext/ripper/tools/generate-param-macros.rb
deleted file mode 100755
index b19f6e8d5c..0000000000
--- a/ext/ripper/tools/generate-param-macros.rb
+++ /dev/null
@@ -1,14 +0,0 @@
-off = true
-ARGF.each do |line|
- case line
- when /RIPPER_PARAMS_DECL_BEGIN/
- off = false
- when /RIPPER_PARAMS_DECL_END/
- exit
- when /ripper/
- next if off
- var = line.scan(/\w+/).last or next
- base = var.sub(/ripper_/, '')
- puts %"\#define #{base}\t\t(parser->ripper_#{base})"
- end
-end
diff --git a/ext/ripper/tools/generate.rb b/ext/ripper/tools/generate.rb
deleted file mode 100755
index 22c3ac0eb7..0000000000
--- a/ext/ripper/tools/generate.rb
+++ /dev/null
@@ -1,152 +0,0 @@
-# $Id$
-
-require 'optparse'
-
-def main
- mode = nil
- ids1src = nil
- ids2src = nil
- template = nil
- output = nil
-
- parser = @parser = OptionParser.new
- parser.banner = "Usage: #{File.basename($0)} --mode=MODE [--ids1src=PATH] [--ids2src=PATH] [--output=PATH]"
- parser.on('--mode=MODE', 'check, eventids1, or eventids2table.') {|m|
- mode = m
- }
- parser.on('--ids1src=PATH', 'A source file of event-IDs 1 (parse.y).') {|path|
- ids1src = path
- }
- parser.on('--ids2src=PATH', 'A source file of event-IDs 2 (eventids2.c).') {|path|
- ids2src = path
- }
- parser.on('--output=PATH', 'An output file.') {|path|
- output = path
- }
- parser.on('--help', 'Prints this message and quit.') {
- puts parser.help
- exit true
- }
- begin
- parser.parse!
- rescue OptionParser::ParseError => err
- usage err.message
- end
- usage 'no mode given' unless mode
- case mode
- when 'check'
- usage 'no --ids1src' unless ids1src
- usage 'no --ids2src' unless ids2src
- h = read_ids1_with_locations(ids1src)
- check_arity h
- ids2 = read_ids2(ids2src)
- common = h.keys & ids2
- unless common.empty?
- abort "event crash: #{common.join(' ')}"
- end
- exit 0
- when 'eventids1'
- usage 'no --ids1src' unless ids1src
- result = generate_eventids1(read_ids1(ids1src))
- when 'eventids2table'
- usage 'no --ids2src' unless ids2src
- result = generate_eventids2_table(read_ids2(ids2src))
- end
- if output
- File.open(output, 'w') {|f|
- f.write result
- }
- else
- puts result
- end
-end
-
-def usage(msg)
- $stderr.puts msg
- $stderr.puts @parser.help
- exit false
-end
-
-def generate_eventids1(ids)
- buf = ""
- ids.each do |id, arity|
- buf << %Q[static ID ripper_id_#{id};\n]
- end
- buf << %Q[\n]
- buf << %Q[static void\n]
- buf << %Q[ripper_init_eventids1(VALUE self)\n]
- buf << %Q[{\n]
- buf << %Q[ VALUE h;\n]
- buf << %Q[ ID id;\n]
- ids.each do |id, arity|
- buf << %Q[ ripper_id_#{id} = rb_intern_const("on_#{id}");\n]
- end
- buf << %Q[\n]
- buf << %Q[ h = rb_hash_new();\n]
- buf << %Q[ rb_define_const(self, "PARSER_EVENT_TABLE", h);\n]
- ids.each do |id, arity|
- buf << %Q[ id = rb_intern_const("#{id}");\n]
- buf << %Q[ rb_hash_aset(h, ID2SYM(id), INT2NUM(#{arity}));\n]
- end
- buf << %Q[}\n]
- buf
-end
-
-def generate_eventids2_table(ids)
- buf = ""
- buf << %Q[static void\n]
- buf << %Q[ripper_init_eventids2_table(VALUE self)\n]
- buf << %Q[{\n]
- buf << %Q[ VALUE h = rb_hash_new();\n]
- buf << %Q[ ID id;\n]
- buf << %Q[ rb_define_const(self, "SCANNER_EVENT_TABLE", h);\n]
- ids.each do |id|
- buf << %Q[ id = rb_intern_const("#{id}");\n]
- buf << %Q[ rb_hash_aset(h, ID2SYM(id), INT2NUM(1));\n]
- end
- buf << %Q[}\n]
- buf
-end
-
-def read_ids1(path)
- strip_locations(read_ids1_with_locations(path))
-end
-
-def strip_locations(h)
- h.map {|event, list| [event, list.first[1]] }\
- .sort_by {|event, arity| event.to_s }
-end
-
-def check_arity(h)
- invalid = false
- h.each do |event, list|
- unless list.map {|line, arity| arity }.uniq.size == 1
- invalid = true
- locations = list.map {|line, a| "#{line}:#{a}" }.join(', ')
- $stderr.puts "arity crash [event=#{event}]: #{locations}"
- end
- end
- abort if invalid
-end
-
-def read_ids1_with_locations(path)
- h = {}
- File.open(path) {|f|
- f.each do |line|
- next if /\A\#\s*define\s+s?dispatch/ =~ line
- next if /ripper_dispatch/ =~ line
- line.scan(/dispatch(\d)\((\w+)/) do |arity, event|
- (h[event] ||= []).push [f.lineno, arity.to_i]
- end
- end
- }
- h
-end
-
-def read_ids2(path)
- File.open(path) {|f|
- return f.read.scan(/ripper_id_(\w+)/).flatten.uniq.sort
- }
-end
-
-main
diff --git a/ext/ripper/tools/preproc.rb b/ext/ripper/tools/preproc.rb
deleted file mode 100755
index 06397cea05..0000000000
--- a/ext/ripper/tools/preproc.rb
+++ /dev/null
@@ -1,91 +0,0 @@
-# $Id$
-
-require 'optparse'
-
-def main
- output = nil
- parser = OptionParser.new
- parser.banner = "Usage: #{File.basename($0)} [--output=PATH] <parse.y>"
- parser.on('--output=PATH', 'An output file.') {|path|
- output = path
- }
- parser.on('--help', 'Prints this message and quit.') {
- puts parser.help
- exit true
- }
- begin
- parser.parse!
- rescue OptionParser::ParseError => err
- $stderr.puts err.message
- $stderr.puts parser.help
- exit false
- end
- unless ARGV.size == 1
- abort "wrong number of arguments (#{ARGV.size} for 1)"
- end
- out = ""
- File.open(ARGV[0]) {|f|
- prelude f, out
- grammar f, out
- usercode f, out
- }
- if output
- File.open(output, 'w') {|f|
- f.write out
- }
- else
- print out
- end
-end
-
-def prelude(f, out)
- while line = f.gets
- case line
- when %r</\*%%%\*/>
- out << '/*' << $/
- when %r</\*%>
- out << '*/' << $/
- when %r<%\*/>
- out << $/
- when /\A%%/
- out << '%%' << $/
- return
- when /\A%token/
- out << line.sub(/<\w+>/, '<val>')
- when /\A%type/
- out << line.sub(/<\w+>/, '<val>')
- else
- out << line
- end
- end
-end
-
-def grammar(f, out)
- while line = f.gets
- case line
- when %r</\*%%%\*/>
- out << '#if 0' << $/
- when %r</\*%c%\*/>
- out << '/*' << $/
- when %r</\*%c>
- out << '*/' << $/
- when %r</\*%>
- out << '#endif' << $/
- when %r<%\*/>
- out << $/
- when /\A%%/
- out << '%%' << $/
- return
- else
- out << line
- end
- end
-end
-
-def usercode(f, out)
- while line = f.gets
- out << line
- end
-end
-
-main
diff --git a/ext/ripper/tools/strip.rb b/ext/ripper/tools/strip.rb
deleted file mode 100755
index 99413c361d..0000000000
--- a/ext/ripper/tools/strip.rb
+++ /dev/null
@@ -1,12 +0,0 @@
-last_is_void = false
-ARGF.each do |line|
- if line.strip.empty?
- #puts() unless last_is_void
- last_is_void = true
- elsif /\A\#/ === line
- ;
- else
- print line
- last_is_void = false
- end
-end
diff --git a/ext/sdbm/.cvsignore b/ext/sdbm/.cvsignore
index 814345ece8..4088712231 100644
--- a/ext/sdbm/.cvsignore
+++ b/ext/sdbm/.cvsignore
@@ -1,4 +1,3 @@
Makefile
mkmf.log
*.def
-extconf.h
diff --git a/ext/sdbm/_sdbm.c b/ext/sdbm/_sdbm.c
index b3a598dbc6..5b34824afc 100644
--- a/ext/sdbm/_sdbm.c
+++ b/ext/sdbm/_sdbm.c
@@ -12,8 +12,7 @@
#endif
#include "sdbm.h"
-#include "ruby/config.h"
-#include "ruby/defines.h"
+#include "config.h"
/*
* sdbm - ndbm work-alike hashed database library
@@ -104,7 +103,7 @@ static int duppair proto((char *, datum));
/*
* externals
*/
-#if !defined sun && !defined _WIN32 && !defined __CYGWIN__ && !defined(errno)
+#if !defined sun && !defined MSDOS && !defined _WIN32 && !defined __CYGWIN__ && !defined(errno)
extern int errno;
#endif
@@ -144,7 +143,10 @@ static long masks[] = {
datum nullitem = {NULL, 0};
DBM *
-sdbm_open(register char *file, register int flags, register int mode)
+sdbm_open(file, flags, mode)
+register char *file;
+register int flags;
+register int mode;
{
register DBM *db;
register char *dirname;
@@ -173,7 +175,11 @@ sdbm_open(register char *file, register int flags, register int mode)
}
DBM *
-sdbm_prep(char *dirname, char *pagname, int flags, int mode)
+sdbm_prep(dirname, pagname, flags, mode)
+char *dirname;
+char *pagname;
+int flags;
+int mode;
{
register DBM *db;
struct stat dstat;
@@ -229,7 +235,8 @@ sdbm_prep(char *dirname, char *pagname, int flags, int mode)
}
void
-sdbm_close(register DBM *db)
+sdbm_close(db)
+register DBM *db;
{
if (db == NULL)
errno = EINVAL;
@@ -241,7 +248,9 @@ sdbm_close(register DBM *db)
}
datum
-sdbm_fetch(register DBM *db, datum key)
+sdbm_fetch(db, key)
+register DBM *db;
+datum key;
{
if (db == NULL || bad(key))
return errno = EINVAL, nullitem;
@@ -253,7 +262,9 @@ sdbm_fetch(register DBM *db, datum key)
}
int
-sdbm_delete(register DBM *db, datum key)
+sdbm_delete(db, key)
+register DBM *db;
+datum key;
{
if (db == NULL || bad(key))
return errno = EINVAL, -1;
@@ -277,7 +288,11 @@ sdbm_delete(register DBM *db, datum key)
}
int
-sdbm_store(register DBM *db, datum key, datum val, int flags)
+sdbm_store(db, key, val, flags)
+register DBM *db;
+datum key;
+datum val;
+int flags;
{
int need;
register long hash;
@@ -335,11 +350,14 @@ sdbm_store(register DBM *db, datum key, datum val, int flags)
* giving up.
*/
static int
-makroom(register DBM *db, long int hash, int need)
+makroom(db, hash, need)
+register DBM *db;
+long hash;
+int need;
{
long newp;
char twin[PBLKSIZ];
-#if defined _WIN32 && !defined __CYGWIN__
+#if defined MSDOS || (defined _WIN32 && !defined __CYGWIN__)
char zer[PBLKSIZ];
long oldtail;
#endif
@@ -366,7 +384,7 @@ makroom(register DBM *db, long int hash, int need)
* here, as sdbm_store will do so, after it inserts the incoming pair.
*/
-#if defined _WIN32 && !defined __CYGWIN__
+#if defined MSDOS || (defined _WIN32 && !defined __CYGWIN__)
/*
* Fill hole with 0 if made it.
* (hole is NOT read as 0)
@@ -432,7 +450,8 @@ makroom(register DBM *db, long int hash, int need)
* deletions aren't taken into account. (ndbm bug)
*/
datum
-sdbm_firstkey(register DBM *db)
+sdbm_firstkey(db)
+register DBM *db;
{
if (db == NULL)
return errno = EINVAL, nullitem;
@@ -451,7 +470,8 @@ sdbm_firstkey(register DBM *db)
}
datum
-sdbm_nextkey(register DBM *db)
+sdbm_nextkey(db)
+register DBM *db;
{
if (db == NULL)
return errno = EINVAL, nullitem;
@@ -462,7 +482,9 @@ sdbm_nextkey(register DBM *db)
* all important binary trie traversal
*/
static int
-getpage(register DBM *db, register long int hash)
+getpage(db, hash)
+register DBM *db;
+register long hash;
{
register int hbit;
register long dbit;
@@ -504,7 +526,9 @@ getpage(register DBM *db, register long int hash)
}
static int
-getdbit(register DBM *db, register long int dbit)
+getdbit(db, dbit)
+register DBM *db;
+register long dbit;
{
register long c;
register long dirb;
@@ -525,7 +549,9 @@ getdbit(register DBM *db, register long int dbit)
}
static int
-setdbit(register DBM *db, register long int dbit)
+setdbit(db, dbit)
+register DBM *db;
+register long dbit;
{
register long c;
register long dirb;
@@ -559,7 +585,8 @@ setdbit(register DBM *db, register long int dbit)
* the page, try the next page in sequence
*/
static datum
-getnext(register DBM *db)
+getnext(db)
+register DBM *db;
{
datum key;
@@ -634,7 +661,9 @@ static int seepair proto((char *, int, char *, int));
*/
static int
-fitpair(char *pag, int need)
+fitpair(pag, need)
+char *pag;
+int need;
{
register int n;
register int off;
@@ -651,7 +680,10 @@ fitpair(char *pag, int need)
}
static void
-putpair(char *pag, datum key, datum val)
+putpair(pag, key, val)
+char *pag;
+datum key;
+datum val;
{
register int n;
register int off;
@@ -679,7 +711,9 @@ putpair(char *pag, datum key, datum val)
}
static datum
-getpair(char *pag, datum key)
+getpair(pag, key)
+char *pag;
+datum key;
{
register int i;
register int n;
@@ -699,7 +733,9 @@ getpair(char *pag, datum key)
#ifdef SEEDUPS
static int
-duppair(char *pag, datum key)
+duppair(pag, key)
+char *pag;
+datum key;
{
register short *ino = (short *) pag;
return GET_SHORT(ino,0) > 0 &&
@@ -708,7 +744,9 @@ duppair(char *pag, datum key)
#endif
static datum
-getnkey(char *pag, int num)
+getnkey(pag, num)
+char *pag;
+int num;
{
datum key;
register int off;
@@ -727,7 +765,9 @@ getnkey(char *pag, int num)
}
static int
-delpair(char *pag, datum key)
+delpair(pag, key)
+char *pag;
+datum key;
{
register int n;
register int i;
@@ -797,7 +837,11 @@ delpair(char *pag, datum key)
* return 0 if not found.
*/
static int
-seepair(char *pag, register int n, register char *key, register int siz)
+seepair(pag, n, key, siz)
+char *pag;
+register int n;
+register char *key;
+register int siz;
{
register int i;
register int off = PBLKSIZ;
@@ -813,7 +857,10 @@ seepair(char *pag, register int n, register char *key, register int siz)
}
static void
-splpage(char *pag, char *new, long int sbit)
+splpage(pag, new, sbit)
+char *pag;
+char *new;
+long sbit;
{
datum key;
datum val;
@@ -854,7 +901,8 @@ splpage(char *pag, char *new, long int sbit)
* this could be made more rigorous.
*/
static int
-chkpage(char *pag)
+chkpage(pag)
+char *pag;
{
register int n;
register int off;
@@ -894,7 +942,9 @@ chkpage(char *pag)
* 65587 even better.
*/
long
-sdbm_hash(register char *str, register int len)
+sdbm_hash(str, len)
+register char *str;
+register int len;
{
register unsigned long n = 0;
diff --git a/ext/sdbm/init.c b/ext/sdbm/init.c
index f630dc3cc9..acadc9b26a 100644
--- a/ext/sdbm/init.c
+++ b/ext/sdbm/init.c
@@ -3,6 +3,7 @@
sdbminit.c -
$Author$
+ $Date$
created at: Fri May 7 08:34:24 JST 1999
Copyright (C) 1995-2001 Yukihiro Matsumoto
@@ -40,15 +41,17 @@ closed_sdbm()
}
static void
-free_sdbm(struct dbmdata *dbmp)
+free_sdbm(dbmp)
+ struct dbmdata *dbmp;
{
if (dbmp->di_dbm) sdbm_close(dbmp->di_dbm);
- ruby_xfree(dbmp);
+ free(dbmp);
}
static VALUE
-fsdbm_close(VALUE obj)
+fsdbm_close(obj)
+ VALUE obj;
{
struct dbmdata *dbmp;
@@ -60,7 +63,8 @@ fsdbm_close(VALUE obj)
}
static VALUE
-fsdbm_closed(VALUE obj)
+fsdbm_closed(obj)
+ VALUE obj;
{
struct dbmdata *dbmp;
@@ -73,17 +77,21 @@ fsdbm_closed(VALUE obj)
return Qfalse;
}
+static VALUE fsdbm_alloc _((VALUE));
static VALUE
-fsdbm_alloc(VALUE klass)
+fsdbm_alloc(klass)
+ VALUE klass;
{
return Data_Wrap_Struct(klass, 0, free_sdbm, 0);
}
static VALUE
-fsdbm_initialize(int argc, VALUE *argv, VALUE obj)
+fsdbm_initialize(argc, argv, obj)
+ int argc;
+ VALUE *argv;
+ VALUE obj;
{
- volatile VALUE file;
- VALUE vmode;
+ VALUE file, vmode;
DBM *dbm;
struct dbmdata *dbmp;
int mode;
@@ -97,19 +105,19 @@ fsdbm_initialize(int argc, VALUE *argv, VALUE obj)
else {
mode = NUM2INT(vmode);
}
- FilePathValue(file);
+ SafeStringValue(file);
dbm = 0;
if (mode >= 0)
- dbm = sdbm_open(RSTRING_PTR(file), O_RDWR|O_CREAT, mode);
+ dbm = sdbm_open(RSTRING(file)->ptr, O_RDWR|O_CREAT, mode);
if (!dbm)
- dbm = sdbm_open(RSTRING_PTR(file), O_RDWR, 0);
+ dbm = sdbm_open(RSTRING(file)->ptr, O_RDWR, 0);
if (!dbm)
- dbm = sdbm_open(RSTRING_PTR(file), O_RDONLY, 0);
+ dbm = sdbm_open(RSTRING(file)->ptr, O_RDONLY, 0);
if (!dbm) {
if (mode == -1) return Qnil;
- rb_sys_fail(RSTRING_PTR(file));
+ rb_sys_fail(RSTRING(file)->ptr);
}
dbmp = ALLOC(struct dbmdata);
@@ -121,7 +129,10 @@ fsdbm_initialize(int argc, VALUE *argv, VALUE obj)
}
static VALUE
-fsdbm_s_open(int argc, VALUE *argv, VALUE klass)
+fsdbm_s_open(argc, argv, klass)
+ int argc;
+ VALUE *argv;
+ VALUE klass;
{
VALUE obj = Data_Wrap_Struct(klass, 0, free_sdbm, 0);
@@ -137,34 +148,39 @@ fsdbm_s_open(int argc, VALUE *argv, VALUE klass)
}
static VALUE
-fsdbm_fetch(VALUE obj, VALUE keystr, VALUE ifnone)
+fsdbm_fetch(obj, keystr, ifnone)
+ VALUE obj, keystr, ifnone;
{
datum key, value;
struct dbmdata *dbmp;
DBM *dbm;
- ExportStringValue(keystr);
- key.dptr = RSTRING_PTR(keystr);
- key.dsize = RSTRING_LEN(keystr);
+ StringValue(keystr);
+ key.dptr = RSTRING(keystr)->ptr;
+ key.dsize = RSTRING(keystr)->len;
GetDBM2(obj, dbmp, dbm);
value = sdbm_fetch(dbm, key);
if (value.dptr == 0) {
if (ifnone == Qnil && rb_block_given_p())
- return rb_yield(rb_external_str_new(key.dptr, key.dsize));
+ return rb_yield(rb_tainted_str_new(key.dptr, key.dsize));
return ifnone;
}
- return rb_external_str_new(value.dptr, value.dsize);
+ return rb_tainted_str_new(value.dptr, value.dsize);
}
static VALUE
-fsdbm_aref(VALUE obj, VALUE keystr)
+fsdbm_aref(obj, keystr)
+ VALUE obj, keystr;
{
return fsdbm_fetch(obj, keystr, Qnil);
}
static VALUE
-fsdbm_fetch_m(int argc, VALUE *argv, VALUE obj)
+fsdbm_fetch_m(argc, argv, obj)
+ int argc;
+ VALUE *argv;
+ VALUE obj;
{
VALUE keystr, valstr, ifnone;
@@ -177,59 +193,90 @@ fsdbm_fetch_m(int argc, VALUE *argv, VALUE obj)
}
static VALUE
-fsdbm_key(VALUE obj, VALUE valstr)
+fsdbm_index(obj, valstr)
+ VALUE obj, valstr;
{
datum key, val;
struct dbmdata *dbmp;
DBM *dbm;
- ExportStringValue(valstr);
- val.dptr = RSTRING_PTR(valstr);
- val.dsize = RSTRING_LEN(valstr);
+ StringValue(valstr);
+ val.dptr = RSTRING(valstr)->ptr;
+ val.dsize = RSTRING(valstr)->len;
GetDBM2(obj, dbmp, dbm);
for (key = sdbm_firstkey(dbm); key.dptr; key = sdbm_nextkey(dbm)) {
val = sdbm_fetch(dbm, key);
- if (val.dsize == RSTRING_LEN(valstr) &&
- memcmp(val.dptr, RSTRING_PTR(valstr), val.dsize) == 0)
- return rb_external_str_new(key.dptr, key.dsize);
+ if (val.dsize == RSTRING(valstr)->len &&
+ memcmp(val.dptr, RSTRING(valstr)->ptr, val.dsize) == 0)
+ return rb_tainted_str_new(key.dptr, key.dsize);
}
return Qnil;
}
static VALUE
-fsdbm_index(VALUE hash, VALUE value)
+fsdbm_indexes(argc, argv, obj)
+ int argc;
+ VALUE *argv;
+ VALUE obj;
{
- rb_warn("SDBM#index is deprecated; use SDBM#key");
- return fsdbm_key(hash, value);
+ VALUE new;
+ int i;
+
+ new = rb_ary_new2(argc);
+ for (i=0; i<argc; i++) {
+ rb_ary_push(new, fsdbm_fetch(obj, argv[i], Qnil));
+ }
+
+ return new;
}
static VALUE
-fsdbm_select(VALUE obj)
+fsdbm_select(argc, argv, obj)
+ int argc;
+ VALUE *argv;
+ VALUE obj;
{
- VALUE new = rb_ary_new();
- datum key, val;
- DBM *dbm;
- struct dbmdata *dbmp;
+ VALUE new = rb_ary_new2(argc);
+ int i;
- GetDBM2(obj, dbmp, dbm);
- for (key = sdbm_firstkey(dbm); key.dptr; key = sdbm_nextkey(dbm)) {
- VALUE assoc, v;
- val = sdbm_fetch(dbm, key);
- assoc = rb_assoc_new(rb_external_str_new(key.dptr, key.dsize),
- rb_external_str_new(val.dptr, val.dsize));
- v = rb_yield(assoc);
- if (RTEST(v)) {
- rb_ary_push(new, assoc);
+ if (rb_block_given_p()) {
+ datum key, val;
+ DBM *dbm;
+ struct dbmdata *dbmp;
+
+ if (argc > 0) {
+ rb_raise(rb_eArgError, "wrong number of arguments (%d for 0)", argc);
}
- GetDBM2(obj, dbmp, dbm);
+ GetDBM2(obj, dbmp, dbm);
+ for (key = sdbm_firstkey(dbm); key.dptr; key = sdbm_nextkey(dbm)) {
+ VALUE assoc, v;
+ val = sdbm_fetch(dbm, key);
+ 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);
+ }
+ GetDBM2(obj, dbmp, dbm);
+ }
+ }
+ else {
+ rb_warn("SDBM#select(index..) is deprecated; use SDBM#values_at");
+
+ for (i=0; i<argc; i++) {
+ rb_ary_push(new, fsdbm_fetch(obj, argv[i], Qnil));
+ }
}
return new;
}
static VALUE
-fsdbm_values_at(int argc, VALUE *argv, VALUE obj)
+fsdbm_values_at(argc, argv, obj)
+ int argc;
+ VALUE *argv;
+ VALUE obj;
{
VALUE new = rb_ary_new2(argc);
int i;
@@ -242,14 +289,16 @@ fsdbm_values_at(int argc, VALUE *argv, VALUE obj)
}
static void
-fdbm_modify(VALUE obj)
+fdbm_modify(obj)
+ VALUE obj;
{
rb_secure(4);
if (OBJ_FROZEN(obj)) rb_error_frozen("SDBM");
}
static VALUE
-fsdbm_delete(VALUE obj, VALUE keystr)
+fsdbm_delete(obj, keystr)
+ VALUE obj, keystr;
{
datum key, value;
struct dbmdata *dbmp;
@@ -257,9 +306,9 @@ fsdbm_delete(VALUE obj, VALUE keystr)
VALUE valstr;
fdbm_modify(obj);
- ExportStringValue(keystr);
- key.dptr = RSTRING_PTR(keystr);
- key.dsize = RSTRING_LEN(keystr);
+ StringValue(keystr);
+ key.dptr = RSTRING(keystr)->ptr;
+ key.dsize = RSTRING(keystr)->len;
GetDBM2(obj, dbmp, dbm);
dbmp->di_size = -1;
@@ -271,7 +320,7 @@ fsdbm_delete(VALUE obj, VALUE keystr)
}
/* need to save value before sdbm_delete() */
- valstr = rb_external_str_new(value.dptr, value.dsize);
+ valstr = rb_tainted_str_new(value.dptr, value.dsize);
if (sdbm_delete(dbm, key)) {
dbmp->di_size = -1;
@@ -284,7 +333,8 @@ fsdbm_delete(VALUE obj, VALUE keystr)
}
static VALUE
-fsdbm_shift(VALUE obj)
+fsdbm_shift(obj)
+ VALUE obj;
{
datum key, val;
struct dbmdata *dbmp;
@@ -296,8 +346,8 @@ fsdbm_shift(VALUE obj)
key = sdbm_firstkey(dbm);
if (!key.dptr) return Qnil;
val = sdbm_fetch(dbm, key);
- keystr = rb_external_str_new(key.dptr, key.dsize);
- valstr = rb_external_str_new(val.dptr, val.dsize);
+ keystr = rb_tainted_str_new(key.dptr, key.dsize);
+ valstr = rb_tainted_str_new(val.dptr, val.dsize);
sdbm_delete(dbm, key);
if (dbmp->di_size >= 0) {
dbmp->di_size--;
@@ -307,7 +357,8 @@ fsdbm_shift(VALUE obj)
}
static VALUE
-fsdbm_delete_if(VALUE obj)
+fsdbm_delete_if(obj)
+ VALUE obj;
{
datum key, val;
struct dbmdata *dbmp;
@@ -322,31 +373,32 @@ fsdbm_delete_if(VALUE obj)
dbmp->di_size = -1;
for (key = sdbm_firstkey(dbm); key.dptr; key = sdbm_nextkey(dbm)) {
val = sdbm_fetch(dbm, key);
- keystr = rb_external_str_new(key.dptr, key.dsize);
- valstr = rb_external_str_new(val.dptr, val.dsize);
+ keystr = rb_tainted_str_new(key.dptr, key.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);
GetDBM2(obj, dbmp, dbm);
}
- for (i = 0; i < RARRAY_LEN(ary); i++) {
- keystr = RARRAY_PTR(ary)[i];
- ExportStringValue(keystr);
- key.dptr = RSTRING_PTR(keystr);
- key.dsize = RSTRING_LEN(keystr);
+ for (i = 0; i < RARRAY(ary)->len; i++) {
+ keystr = RARRAY(ary)->ptr[i];
+ StringValue(keystr);
+ key.dptr = RSTRING(keystr)->ptr;
+ key.dsize = RSTRING(keystr)->len;
if (sdbm_delete(dbm, key)) {
rb_raise(rb_eDBMError, "sdbm_delete failed");
}
}
if (status) rb_jump_tag(status);
- if (n > 0) dbmp->di_size = n - RARRAY_LEN(ary);
+ if (n > 0) dbmp->di_size = n - RARRAY(ary)->len;
return obj;
}
static VALUE
-fsdbm_clear(VALUE obj)
+fsdbm_clear(obj)
+ VALUE obj;
{
datum key;
struct dbmdata *dbmp;
@@ -366,7 +418,8 @@ fsdbm_clear(VALUE obj)
}
static VALUE
-fsdbm_invert(VALUE obj)
+fsdbm_invert(obj)
+ VALUE obj;
{
datum key, val;
struct dbmdata *dbmp;
@@ -377,15 +430,56 @@ fsdbm_invert(VALUE obj)
GetDBM2(obj, dbmp, dbm);
for (key = sdbm_firstkey(dbm); key.dptr; key = sdbm_nextkey(dbm)) {
val = sdbm_fetch(dbm, key);
- keystr = rb_external_str_new(key.dptr, key.dsize);
- valstr = rb_external_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;
}
+static VALUE each_pair _((VALUE));
+
+static VALUE
+each_pair(obj)
+ VALUE obj;
+{
+ return rb_funcall(obj, rb_intern("each_pair"), 0, 0);
+}
+
+static VALUE fsdbm_store _((VALUE,VALUE,VALUE));
+
+static VALUE
+update_i(pair, dbm)
+ VALUE pair, dbm;
+{
+ Check_Type(pair, T_ARRAY);
+ if (RARRAY(pair)->len < 2) {
+ rb_raise(rb_eArgError, "pair must be [key, value]");
+ }
+ fsdbm_store(dbm, RARRAY(pair)->ptr[0], RARRAY(pair)->ptr[1]);
+ return Qnil;
+}
+
static VALUE
-fsdbm_store(VALUE obj, VALUE keystr, VALUE valstr)
+fsdbm_update(obj, other)
+ VALUE obj, other;
+{
+ rb_iterate(each_pair, other, update_i, obj);
+ return obj;
+}
+
+static VALUE
+fsdbm_replace(obj, other)
+ VALUE obj, other;
+{
+ fsdbm_clear(obj);
+ rb_iterate(each_pair, other, update_i, obj);
+ return obj;
+}
+
+static VALUE
+fsdbm_store(obj, keystr, valstr)
+ VALUE obj, keystr, valstr;
{
datum key, val;
struct dbmdata *dbmp;
@@ -397,14 +491,14 @@ fsdbm_store(VALUE obj, VALUE keystr, VALUE valstr)
}
fdbm_modify(obj);
- ExportStringValue(keystr);
- ExportStringValue(valstr);
+ StringValue(keystr);
+ StringValue(valstr);
- key.dptr = RSTRING_PTR(keystr);
- key.dsize = RSTRING_LEN(keystr);
+ key.dptr = RSTRING(keystr)->ptr;
+ key.dsize = RSTRING(keystr)->len;
- val.dptr = RSTRING_PTR(valstr);
- val.dsize = RSTRING_LEN(valstr);
+ val.dptr = RSTRING(valstr)->ptr;
+ val.dsize = RSTRING(valstr)->len;
GetDBM2(obj, dbmp, dbm);
dbmp->di_size = -1;
@@ -420,33 +514,8 @@ fsdbm_store(VALUE obj, VALUE keystr, VALUE valstr)
}
static VALUE
-update_i(VALUE pair, VALUE dbm)
-{
- Check_Type(pair, T_ARRAY);
- if (RARRAY_LEN(pair) < 2) {
- rb_raise(rb_eArgError, "pair must be [key, value]");
- }
- fsdbm_store(dbm, RARRAY_PTR(pair)[0], RARRAY_PTR(pair)[1]);
- return Qnil;
-}
-
-static VALUE
-fsdbm_update(VALUE obj, VALUE other)
-{
- rb_block_call(other, rb_intern("each_pair"), 0, 0, update_i, obj);
- return obj;
-}
-
-static VALUE
-fsdbm_replace(VALUE obj, VALUE other)
-{
- fsdbm_clear(obj);
- rb_block_call(other, rb_intern("each_pair"), 0, 0, update_i, obj);
- return obj;
-}
-
-static VALUE
-fsdbm_length(VALUE obj)
+fsdbm_length(obj)
+ VALUE obj;
{
datum key;
struct dbmdata *dbmp;
@@ -465,7 +534,8 @@ fsdbm_length(VALUE obj)
}
static VALUE
-fsdbm_empty_p(VALUE obj)
+fsdbm_empty_p(obj)
+ VALUE obj;
{
datum key;
struct dbmdata *dbmp;
@@ -488,55 +558,52 @@ fsdbm_empty_p(VALUE obj)
}
static VALUE
-fsdbm_each_value(VALUE obj)
+fsdbm_each_value(obj)
+ VALUE obj;
{
datum key, val;
struct dbmdata *dbmp;
DBM *dbm;
- RETURN_ENUMERATOR(obj, 0, 0);
-
GetDBM2(obj, dbmp, dbm);
for (key = sdbm_firstkey(dbm); key.dptr; key = sdbm_nextkey(dbm)) {
val = sdbm_fetch(dbm, key);
- rb_yield(rb_external_str_new(val.dptr, val.dsize));
+ rb_yield(rb_tainted_str_new(val.dptr, val.dsize));
GetDBM2(obj, dbmp, dbm);
}
return obj;
}
static VALUE
-fsdbm_each_key(VALUE obj)
+fsdbm_each_key(obj)
+ VALUE obj;
{
datum key;
struct dbmdata *dbmp;
DBM *dbm;
- RETURN_ENUMERATOR(obj, 0, 0);
-
GetDBM2(obj, dbmp, dbm);
for (key = sdbm_firstkey(dbm); key.dptr; key = sdbm_nextkey(dbm)) {
- rb_yield(rb_external_str_new(key.dptr, key.dsize));
+ rb_yield(rb_tainted_str_new(key.dptr, key.dsize));
GetDBM2(obj, dbmp, dbm);
}
return obj;
}
static VALUE
-fsdbm_each_pair(VALUE obj)
+fsdbm_each_pair(obj)
+ VALUE obj;
{
datum key, val;
DBM *dbm;
struct dbmdata *dbmp;
VALUE keystr, valstr;
- RETURN_ENUMERATOR(obj, 0, 0);
-
GetDBM2(obj, dbmp, dbm);
for (key = sdbm_firstkey(dbm); key.dptr; key = sdbm_nextkey(dbm)) {
val = sdbm_fetch(dbm, key);
- keystr = rb_external_str_new(key.dptr, key.dsize);
- valstr = rb_external_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);
}
@@ -545,7 +612,8 @@ fsdbm_each_pair(VALUE obj)
}
static VALUE
-fsdbm_keys(VALUE obj)
+fsdbm_keys(obj)
+ VALUE obj;
{
datum key;
struct dbmdata *dbmp;
@@ -555,14 +623,15 @@ fsdbm_keys(VALUE obj)
GetDBM2(obj, dbmp, dbm);
ary = rb_ary_new();
for (key = sdbm_firstkey(dbm); key.dptr; key = sdbm_nextkey(dbm)) {
- rb_ary_push(ary, rb_external_str_new(key.dptr, key.dsize));
+ rb_ary_push(ary, rb_tainted_str_new(key.dptr, key.dsize));
}
return ary;
}
static VALUE
-fsdbm_values(VALUE obj)
+fsdbm_values(obj)
+ VALUE obj;
{
datum key, val;
struct dbmdata *dbmp;
@@ -573,22 +642,23 @@ fsdbm_values(VALUE obj)
ary = rb_ary_new();
for (key = sdbm_firstkey(dbm); key.dptr; key = sdbm_nextkey(dbm)) {
val = sdbm_fetch(dbm, key);
- rb_ary_push(ary, rb_external_str_new(val.dptr, val.dsize));
+ rb_ary_push(ary, rb_tainted_str_new(val.dptr, val.dsize));
}
return ary;
}
static VALUE
-fsdbm_has_key(VALUE obj, VALUE keystr)
+fsdbm_has_key(obj, keystr)
+ VALUE obj, keystr;
{
datum key, val;
struct dbmdata *dbmp;
DBM *dbm;
- ExportStringValue(keystr);
- key.dptr = RSTRING_PTR(keystr);
- key.dsize = RSTRING_LEN(keystr);
+ StringValue(keystr);
+ key.dptr = RSTRING(keystr)->ptr;
+ key.dsize = RSTRING(keystr)->len;
GetDBM2(obj, dbmp, dbm);
val = sdbm_fetch(dbm, key);
@@ -597,28 +667,30 @@ fsdbm_has_key(VALUE obj, VALUE keystr)
}
static VALUE
-fsdbm_has_value(VALUE obj, VALUE valstr)
+fsdbm_has_value(obj, valstr)
+ VALUE obj, valstr;
{
datum key, val;
struct dbmdata *dbmp;
DBM *dbm;
- ExportStringValue(valstr);
- val.dptr = RSTRING_PTR(valstr);
- val.dsize = RSTRING_LEN(valstr);
+ StringValue(valstr);
+ val.dptr = RSTRING(valstr)->ptr;
+ val.dsize = RSTRING(valstr)->len;
GetDBM2(obj, dbmp, dbm);
for (key = sdbm_firstkey(dbm); key.dptr; key = sdbm_nextkey(dbm)) {
val = sdbm_fetch(dbm, key);
- if (val.dsize == RSTRING_LEN(valstr) &&
- memcmp(val.dptr, RSTRING_PTR(valstr), val.dsize) == 0)
+ if (val.dsize == RSTRING(valstr)->len &&
+ memcmp(val.dptr, RSTRING(valstr)->ptr, val.dsize) == 0)
return Qtrue;
}
return Qfalse;
}
static VALUE
-fsdbm_to_a(VALUE obj)
+fsdbm_to_a(obj)
+ VALUE obj;
{
datum key, val;
struct dbmdata *dbmp;
@@ -629,15 +701,16 @@ fsdbm_to_a(VALUE obj)
ary = rb_ary_new();
for (key = sdbm_firstkey(dbm); key.dptr; key = sdbm_nextkey(dbm)) {
val = sdbm_fetch(dbm, key);
- rb_ary_push(ary, rb_assoc_new(rb_external_str_new(key.dptr, key.dsize),
- rb_external_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;
}
static VALUE
-fsdbm_to_hash(VALUE obj)
+fsdbm_to_hash(obj)
+ VALUE obj;
{
datum key, val;
struct dbmdata *dbmp;
@@ -648,15 +721,16 @@ fsdbm_to_hash(VALUE obj)
hash = rb_hash_new();
for (key = sdbm_firstkey(dbm); key.dptr; key = sdbm_nextkey(dbm)) {
val = sdbm_fetch(dbm, key);
- rb_hash_aset(hash, rb_external_str_new(key.dptr, key.dsize),
- rb_external_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;
}
static VALUE
-fsdbm_reject(VALUE obj)
+fsdbm_reject(obj)
+ VALUE obj;
{
return rb_hash_delete_if(fsdbm_to_hash(obj));
}
@@ -679,8 +753,9 @@ Init_sdbm()
rb_define_method(rb_cDBM, "[]=", fsdbm_store, 2);
rb_define_method(rb_cDBM, "store", fsdbm_store, 2);
rb_define_method(rb_cDBM, "index", fsdbm_index, 1);
- rb_define_method(rb_cDBM, "key", fsdbm_key, 1);
- rb_define_method(rb_cDBM, "select", fsdbm_select, 0);
+ rb_define_method(rb_cDBM, "indexes", fsdbm_indexes, -1);
+ rb_define_method(rb_cDBM, "indices", fsdbm_indexes, -1);
+ rb_define_method(rb_cDBM, "select", fsdbm_select, -1);
rb_define_method(rb_cDBM, "values_at", fsdbm_values_at, -1);
rb_define_method(rb_cDBM, "length", fsdbm_length, 0);
rb_define_method(rb_cDBM, "size", fsdbm_length, 0);
diff --git a/ext/sdbm/sdbm.h b/ext/sdbm/sdbm.h
index 0c7ed1ba9b..ce8f54c4d4 100644
--- a/ext/sdbm/sdbm.h
+++ b/ext/sdbm/sdbm.h
@@ -52,7 +52,7 @@ typedef struct {
extern datum nullitem;
-#if defined(__STDC__)
+#if defined(__STDC__) || defined(MSDOS)
#define proto(p) p
#else
#define proto(p) ()
diff --git a/ext/socket/.cvsignore b/ext/socket/.cvsignore
index ce98586d91..4088712231 100644
--- a/ext/socket/.cvsignore
+++ b/ext/socket/.cvsignore
@@ -1,5 +1,3 @@
Makefile
mkmf.log
*.def
-constants.h
-extconf.h
diff --git a/ext/socket/addrinfo.h b/ext/socket/addrinfo.h
index 171d3c2ce7..e93adafba6 100644
--- a/ext/socket/addrinfo.h
+++ b/ext/socket/addrinfo.h
@@ -50,7 +50,6 @@
#undef AI_PASSIVE
#undef AI_CANONNAME
#undef AI_NUMERICHOST
-#undef AI_NUMERICSERV
#undef AI_ALL
#undef AI_ADDRCONFIG
#undef AI_V4MAPPED
@@ -108,11 +107,8 @@
#define AI_PASSIVE 0x00000001 /* get address to use bind() */
#define AI_CANONNAME 0x00000002 /* fill ai_canonname */
#define AI_NUMERICHOST 0x00000004 /* prevent name resolution */
-#define AI_NUMERICSERV 0x00000008 /* prevent service name resolution */
/* valid flags for addrinfo */
-#ifndef __HAIKU__
-#define AI_MASK (AI_PASSIVE | AI_CANONNAME | AI_NUMERICHOST | AI_NUMERICSERV)
-#endif
+#define AI_MASK (AI_PASSIVE | AI_CANONNAME | AI_NUMERICHOST)
#define AI_ALL 0x00000100 /* IPv6 and IPv4-mapped (with AI_V4MAPPED) */
#define AI_V4MAPPED_CFG 0x00000200 /* accept IPv4-mapped if kernel supports */
@@ -168,9 +164,7 @@ extern void freeaddrinfo __P((struct addrinfo *));
#if defined __UCLIBC__
const
#endif
-#ifndef __HAIKU__
extern char *gai_strerror __P((int));
-#endif
/* In case there is no definition of offsetof() provided - though any proper
Standard C system should have one. */
diff --git a/ext/socket/ancdata.c b/ext/socket/ancdata.c
deleted file mode 100644
index e4b616767a..0000000000
--- a/ext/socket/ancdata.c
+++ /dev/null
@@ -1,1808 +0,0 @@
-#include "rubysocket.h"
-
-#include <time.h>
-
-#if defined(HAVE_ST_MSG_CONTROL)
-static VALUE rb_cAncillaryData;
-
-static VALUE
-constant_to_sym(int constant, ID (*intern_const)(int))
-{
- ID name = intern_const(constant);
- if (name) {
- return ID2SYM(name);
- }
-
- return INT2NUM(constant);
-}
-
-static VALUE
-ip_cmsg_type_to_sym(int level, int cmsg_type)
-{
- switch (level) {
- case SOL_SOCKET:
- return constant_to_sym(cmsg_type, rsock_intern_scm_optname);
- case IPPROTO_IP:
- return constant_to_sym(cmsg_type, rsock_intern_ip_optname);
-#ifdef IPPROTO_IPV6
- case IPPROTO_IPV6:
- return constant_to_sym(cmsg_type, rsock_intern_ipv6_optname);
-#endif
- case IPPROTO_TCP:
- return constant_to_sym(cmsg_type, rsock_intern_tcp_optname);
- case IPPROTO_UDP:
- return constant_to_sym(cmsg_type, rsock_intern_udp_optname);
- default:
- return INT2NUM(cmsg_type);
- }
-}
-
-/*
- * call-seq:
- * Socket::AncillaryData.new(family, cmsg_level, cmsg_type, cmsg_data) -> ancillarydata
- *
- * _family_ should be an integer, a string or a symbol.
- * - Socket::AF_INET, "AF_INET", "INET", :AF_INET, :INET
- * - Socket::AF_UNIX, "AF_UNIX", "UNIX", :AF_UNIX, :UNIX
- * - etc.
- *
- * _cmsg_level_ should be an integer, a string or a symbol.
- * - Socket::SOL_SOCKET, "SOL_SOCKET", "SOCKET", :SOL_SOCKET and :SOCKET
- * - Socket::IPPROTO_IP, "IP" and :IP
- * - Socket::IPPROTO_IPV6, "IPV6" and :IPV6
- * - Socket::IPPROTO_TCP, "TCP" and :TCP
- * - etc.
- *
- * _cmsg_type_ should be an integer, a string or a symbol.
- * If a string/symbol is specified, it is interepreted depend on _cmsg_level_.
- * - Socket::SCM_RIGHTS, "SCM_RIGHTS", "RIGHTS", :SCM_RIGHTS, :RIGHTS for SOL_SOCKET
- * - Socket::IP_RECVTTL, "RECVTTL" and :RECVTTL for IPPROTO_IP
- * - Socket::IPV6_PKTINFO, "PKTINFO" and :PKTINFO for IPPROTO_IPV6
- * - etc.
- *
- * _cmsg_data_ should be a string.
- *
- * p Socket::AncillaryData.new(:INET, :TCP, :NODELAY, "")
- * #=> #<Socket::AncillaryData: INET TCP NODELAY "">
- *
- * p Socket::AncillaryData.new(:INET6, :IPV6, :PKTINFO, "")
- * #=> #<Socket::AncillaryData: INET6 IPV6 PKTINFO "">
- *
- */
-static VALUE
-ancillary_initialize(VALUE self, VALUE vfamily, VALUE vlevel, VALUE vtype, VALUE data)
-{
- int family = rsock_family_arg(vfamily);
- int level = rsock_level_arg(family, vlevel);
- int type = rsock_cmsg_type_arg(family, level, vtype);
- StringValue(data);
- rb_ivar_set(self, rb_intern("family"), INT2NUM(family));
- rb_ivar_set(self, rb_intern("level"), INT2NUM(level));
- rb_ivar_set(self, rb_intern("type"), INT2NUM(type));
- rb_ivar_set(self, rb_intern("data"), data);
- return self;
-}
-
-static VALUE
-ancdata_new(int family, int level, int type, VALUE data)
-{
- NEWOBJ(obj, struct RObject);
- OBJSETUP(obj, rb_cAncillaryData, T_OBJECT);
- StringValue(data);
- ancillary_initialize((VALUE)obj, INT2NUM(family), INT2NUM(level), INT2NUM(type), data);
- return (VALUE)obj;
-}
-
-static int
-ancillary_family(VALUE self)
-{
- VALUE v = rb_attr_get(self, rb_intern("family"));
- return NUM2INT(v);
-}
-
-/*
- * call-seq:
- * ancillarydata.family => integer
- *
- * returns the socket family as an integer.
- *
- * p Socket::AncillaryData.new(:INET6, :IPV6, :PKTINFO, "").family
- * #=> 10
- */
-static VALUE
-ancillary_family_m(VALUE self)
-{
- return INT2NUM(ancillary_family(self));
-}
-
-static int
-ancillary_level(VALUE self)
-{
- VALUE v = rb_attr_get(self, rb_intern("level"));
- return NUM2INT(v);
-}
-
-/*
- * call-seq:
- * ancillarydata.level => integer
- *
- * returns the cmsg level as an integer.
- *
- * p Socket::AncillaryData.new(:INET6, :IPV6, :PKTINFO, "").level
- * #=> 41
- */
-static VALUE
-ancillary_level_m(VALUE self)
-{
- return INT2NUM(ancillary_level(self));
-}
-
-static int
-ancillary_type(VALUE self)
-{
- VALUE v = rb_attr_get(self, rb_intern("type"));
- return NUM2INT(v);
-}
-
-/*
- * call-seq:
- * ancillarydata.type => integer
- *
- * returns the cmsg type as an integer.
- *
- * p Socket::AncillaryData.new(:INET6, :IPV6, :PKTINFO, "").type
- * #=> 2
- */
-static VALUE
-ancillary_type_m(VALUE self)
-{
- return INT2NUM(ancillary_type(self));
-}
-
-/*
- * call-seq:
- * ancillarydata.data => string
- *
- * returns the cmsg data as a string.
- *
- * p Socket::AncillaryData.new(:INET6, :IPV6, :PKTINFO, "").data
- * #=> ""
- */
-static VALUE
-ancillary_data(VALUE self)
-{
- VALUE v = rb_attr_get(self, rb_intern("data"));
- StringValue(v);
- return v;
-}
-
-#ifdef SCM_RIGHTS
-/*
- * call-seq:
- * Socket::AncillaryData.unix_rights(io1, io2, ...) => ancillarydata
- *
- * Creates a new Socket::AncillaryData object which contains file descriptors as data.
- *
- * p Socket::AncillaryData.unix_rights(STDERR)
- * #=> #<Socket::AncillaryData: UNIX SOCKET RIGHTS 2>
- */
-static VALUE
-ancillary_s_unix_rights(int argc, VALUE *argv, VALUE klass)
-{
- VALUE result, str, ary;
- int i;
-
- ary = rb_ary_new();
-
- for (i = 0 ; i < argc; i++) {
- VALUE obj = argv[i];
- if (TYPE(obj) != T_FILE) {
- rb_raise(rb_eTypeError, "IO expected");
- }
- rb_ary_push(ary, obj);
- }
-
- str = rb_str_buf_new(sizeof(int) * argc);
-
- for (i = 0 ; i < argc; i++) {
- VALUE obj = RARRAY_PTR(ary)[i];
- rb_io_t *fptr;
- int fd;
- GetOpenFile(obj, fptr);
- fd = fptr->fd;
- rb_str_buf_cat(str, (char *)&fd, sizeof(int));
- }
-
- result = ancdata_new(AF_UNIX, SOL_SOCKET, SCM_RIGHTS, str);
- rb_ivar_set(result, rb_intern("unix_rights"), ary);
- return result;
-}
-#else
-#define ancillary_s_unix_rights rb_f_notimplement
-#endif
-
-#ifdef SCM_RIGHTS
-/*
- * call-seq:
- * ancillarydata.unix_rights => array-of-IOs or nil
- *
- * returns the array of IO objects for SCM_RIGHTS control message in UNIX domain socket.
- *
- * The class of the IO objects in the array is IO or Socket.
- *
- * The array is attached to _ancillarydata_ when it is instantiated.
- * For example, BasicSocket#recvmsg attach the array when
- * receives a SCM_RIGHTS control message and :scm_rights=>true option is given.
- *
- * # recvmsg needs :scm_rights=>true for unix_rights
- * s1, s2 = UNIXSocket.pair
- * p s1 #=> #<UNIXSocket:fd 3>
- * s1.sendmsg "stdin and a socket", 0, nil, [:SOCKET, :RIGHTS, [0,s1.fileno].pack("ii")]
- * _, _, _, ctl = s2.recvmsg(:scm_rights=>true)
- * p ctl.unix_rights #=> [#<IO:fd 6>, #<Socket:fd 7>]
- * p File.identical?(STDIN, ctl.unix_rights[0]) #=> true
- * p File.identical?(s1, ctl.unix_rights[1]) #=> true
- *
- * # If :scm_rights=>true is not given, unix_rights returns nil
- * s1, s2 = UNIXSocket.pair
- * s1.sendmsg "stdin and a socket", 0, nil, [:SOCKET, :RIGHTS, [0,s1.fileno].pack("ii")]
- * _, _, _, ctl = s2.recvmsg
- * p ctl #=> #<Socket::AncillaryData: UNIX SOCKET RIGHTS 6 7>
- * p ctl.unix_rights #=> nil
- *
- */
-static VALUE
-ancillary_unix_rights(VALUE self)
-{
- int level, type;
-
- level = ancillary_level(self);
- type = ancillary_type(self);
-
- if (level != SOL_SOCKET || type != SCM_RIGHTS)
- rb_raise(rb_eTypeError, "SCM_RIGHTS ancillary data expected");
-
- VALUE v = rb_attr_get(self, rb_intern("unix_rights"));
- return v;
-}
-#else
-#define ancillary_unix_rights rb_f_notimplement
-#endif
-
-#if defined(SCM_TIMESTAMP) || defined(SCM_TIMESTAMPNS) || defined(SCM_BINTIME)
-/*
- * call-seq:
- * ancillarydata.timestamp => time
- *
- * returns the timestamp as a time object.
- *
- * _ancillarydata_ should be one of following type:
- * - SOL_SOCKET/SCM_TIMESTAMP (micro second) GNU/Linux, FreeBSD, NetBSD, OpenBSD, Solaris, MacOS X
- * - SOL_SOCKET/SCM_TIMESTAMPNS (nano second) GNU/Linux
- * - SOL_SOCKET/SCM_BINTIME (2**(-64) second) FreeBSD
- *
- * Addrinfo.udp("127.0.0.1", 0).bind {|s1|
- * Addrinfo.udp("127.0.0.1", 0).bind {|s2|
- * s1.setsockopt(:SOCKET, :TIMESTAMP, true)
- * s2.send "a", 0, s1.local_address
- * ctl = s1.recvmsg.last
- * p ctl #=> #<Socket::AncillaryData: INET SOCKET TIMESTAMP 2009-02-24 17:35:46.775581>
- * t = ctl.timestamp
- * p t #=> 2009-02-24 17:35:46 +0900
- * p t.usec #=> 775581
- * p t.nsec #=> 775581000
- * }
- * }
- *
- */
-static VALUE
-ancillary_timestamp(VALUE self)
-{
- int level, type;
- VALUE data;
- VALUE result = Qnil;
-
- level = ancillary_level(self);
- type = ancillary_type(self);
- data = ancillary_data(self);
-
-# ifdef SCM_TIMESTAMP
- if (level == SOL_SOCKET && type == SCM_TIMESTAMP &&
- RSTRING_LEN(data) == sizeof(struct timeval)) {
- struct timeval tv;
- memcpy((char*)&tv, RSTRING_PTR(data), sizeof(tv));
- result = rb_time_new(tv.tv_sec, tv.tv_usec);
- }
-# endif
-
-# ifdef SCM_TIMESTAMPNS
- if (level == SOL_SOCKET && type == SCM_TIMESTAMPNS &&
- RSTRING_LEN(data) == sizeof(struct timespec)) {
- struct timespec ts;
- memcpy((char*)&ts, RSTRING_PTR(data), sizeof(ts));
- result = rb_time_nano_new(ts.tv_sec, ts.tv_nsec);
- }
-# endif
-
-#define add(x,y) (rb_funcall((x), '+', 1, (y)))
-#define mul(x,y) (rb_funcall((x), '*', 1, (y)))
-#define quo(x,y) (rb_funcall((x), rb_intern("quo"), 1, (y)))
-
-# ifdef SCM_BINTIME
- if (level == SOL_SOCKET && type == SCM_BINTIME &&
- RSTRING_LEN(data) == sizeof(struct bintime)) {
- struct bintime bt;
- VALUE d, timev;
- memcpy((char*)&bt, RSTRING_PTR(data), sizeof(bt));
- d = ULL2NUM(0x100000000UL);
- d = mul(d,d);
- timev = add(TIMET2NUM(bt.sec), quo(ULL2NUM(bt.frac), d));
- result = rb_time_num_new(timev, Qnil);
- }
-# endif
-
- if (result == Qnil)
- rb_raise(rb_eTypeError, "timestamp ancillary data expected");
-
- return result;
-}
-#else
-#define ancillary_timestamp rb_f_notimplement
-#endif
-
-/*
- * call-seq:
- * Socket::AncillaryData.int(family, cmsg_level, cmsg_type, integer) => ancillarydata
- *
- * Creates a new Socket::AncillaryData object which contains a int as data.
- *
- * The size and endian is dependent on the host.
- *
- * p Socket::AncillaryData.int(:UNIX, :SOCKET, :RIGHTS, STDERR.fileno)
- * #=> #<Socket::AncillaryData: UNIX SOCKET RIGHTS 2>
- */
-static VALUE
-ancillary_s_int(VALUE klass, VALUE vfamily, VALUE vlevel, VALUE vtype, VALUE integer)
-{
- int family = rsock_family_arg(vfamily);
- int level = rsock_level_arg(family, vlevel);
- int type = rsock_cmsg_type_arg(family, level, vtype);
- int i = NUM2INT(integer);
- return ancdata_new(family, level, type, rb_str_new((char*)&i, sizeof(i)));
-}
-
-/*
- * call-seq:
- * ancillarydata.int => integer
- *
- * Returns the data in _ancillarydata_ as an int.
- *
- * The size and endian is dependent on the host.
- *
- * ancdata = Socket::AncillaryData.int(:UNIX, :SOCKET, :RIGHTS, STDERR.fileno)
- * p ancdata.int #=> 2
- */
-static VALUE
-ancillary_int(VALUE self)
-{
- VALUE data;
- int i;
- data = ancillary_data(self);
- 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);
-}
-
-#if defined(IPPROTO_IP) && defined(IP_PKTINFO) && defined(HAVE_TYPE_STRUCT_IN_PKTINFO) && defined(HAVE_IPI_SPEC_DST) /* GNU/Linux */
-/*
- * call-seq:
- * Socket::AncillaryData.ip_pktinfo(addr, ifindex) => ancdata
- * Socket::AncillaryData.ip_pktinfo(addr, ifindex, spec_dst) => ancdata
- *
- * Returns new ancillary data for IP_PKTINFO.
- *
- * If spec_dst is not given, addr is used.
- *
- * IP_PKTINFO is not standard.
- *
- * Supported platform: GNU/Linux
- *
- * addr = Addrinfo.ip("127.0.0.1")
- * ifindex = 0
- * spec_dst = Addrinfo.ip("127.0.0.1")
- * p Socket::AncillaryData.ip_pktinfo(addr, ifindex, spec_dst)
- * #=> #<Socket::AncillaryData: INET IP PKTINFO 127.0.0.1 ifindex:0 spec_dst:127.0.0.1>
- *
- */
-static VALUE
-ancillary_s_ip_pktinfo(int argc, VALUE *argv, VALUE self)
-{
- VALUE v_addr, v_ifindex, v_spec_dst;
- unsigned int ifindex;
- struct sockaddr_in sa;
- struct in_pktinfo pktinfo;
-
- rb_scan_args(argc, argv, "21", &v_addr, &v_ifindex, &v_spec_dst);
-
- SockAddrStringValue(v_addr);
- ifindex = NUM2UINT(v_ifindex);
- if (NIL_P(v_spec_dst))
- v_spec_dst = v_addr;
- else
- SockAddrStringValue(v_spec_dst);
-
- memset(&pktinfo, 0, sizeof(pktinfo));
-
- memset(&sa, 0, sizeof(sa));
- if (RSTRING_LEN(v_addr) != sizeof(sa))
- rb_raise(rb_eArgError, "addr size different to AF_INET sockaddr");
- memcpy(&sa, RSTRING_PTR(v_addr), sizeof(sa));
- if (sa.sin_family != AF_INET)
- rb_raise(rb_eArgError, "addr is not AF_INET sockaddr");
- memcpy(&pktinfo.ipi_addr, &sa.sin_addr, sizeof(pktinfo.ipi_addr));
-
- pktinfo.ipi_ifindex = ifindex;
-
- memset(&sa, 0, sizeof(sa));
- if (RSTRING_LEN(v_spec_dst) != sizeof(sa))
- rb_raise(rb_eArgError, "spec_dat size different to AF_INET sockaddr");
- memcpy(&sa, RSTRING_PTR(v_spec_dst), sizeof(sa));
- if (sa.sin_family != AF_INET)
- rb_raise(rb_eArgError, "spec_dst is not AF_INET sockaddr");
- memcpy(&pktinfo.ipi_spec_dst, &sa.sin_addr, sizeof(pktinfo.ipi_spec_dst));
-
- return ancdata_new(AF_INET, IPPROTO_IP, IP_PKTINFO, rb_str_new((char *)&pktinfo, sizeof(pktinfo)));
-}
-#else
-#define ancillary_s_ip_pktinfo rb_f_notimplement
-#endif
-
-#if defined(IPPROTO_IP) && defined(IP_PKTINFO) && defined(HAVE_TYPE_STRUCT_IN_PKTINFO) && defined(HAVE_IPI_SPEC_DST) /* GNU/Linux */
-/*
- * call-seq:
- * ancdata.ip_pktinfo => [addr, ifindex, spec_dst]
- *
- * Extracts addr, ifindex and spec_dst from IP_PKTINFO ancillary data.
- *
- * IP_PKTINFO is not standard.
- *
- * Supported platform: GNU/Linux
- *
- * addr = Addrinfo.ip("127.0.0.1")
- * ifindex = 0
- * spec_dest = Addrinfo.ip("127.0.0.1")
- * ancdata = Socket::AncillaryData.ip_pktinfo(addr, ifindex, spec_dest)
- * p ancdata.ip_pktinfo
- * #=> [#<Addrinfo: 127.0.0.1>, 0, #<Addrinfo: 127.0.0.1>]
- *
- *
- */
-static VALUE
-ancillary_ip_pktinfo(VALUE self)
-{
- int level, type;
- VALUE data;
- struct in_pktinfo pktinfo;
- struct sockaddr_in sa;
- VALUE v_spec_dst, v_addr;
-
- level = ancillary_level(self);
- type = ancillary_type(self);
- data = ancillary_data(self);
-
- if (level != IPPROTO_IP || type != IP_PKTINFO ||
- RSTRING_LEN(data) != sizeof(struct in_pktinfo)) {
- rb_raise(rb_eTypeError, "IP_PKTINFO ancillary data expected");
- }
-
- memcpy(&pktinfo, RSTRING_PTR(data), sizeof(struct in_pktinfo));
- memset(&sa, 0, sizeof(sa));
-
- sa.sin_family = AF_INET;
- memcpy(&sa.sin_addr, &pktinfo.ipi_addr, sizeof(sa.sin_addr));
- v_addr = rsock_addrinfo_new((struct sockaddr *)&sa, sizeof(sa), PF_INET, 0, 0, Qnil, Qnil);
-
- sa.sin_family = AF_INET;
- memcpy(&sa.sin_addr, &pktinfo.ipi_spec_dst, sizeof(sa.sin_addr));
- v_spec_dst = rsock_addrinfo_new((struct sockaddr *)&sa, sizeof(sa), PF_INET, 0, 0, Qnil, Qnil);
-
- return rb_ary_new3(3, v_addr, UINT2NUM(pktinfo.ipi_ifindex), v_spec_dst);
-}
-#else
-#define ancillary_ip_pktinfo rb_f_notimplement
-#endif
-
-#if defined(IPPROTO_IPV6) && defined(IPV6_PKTINFO) /* IPv6 RFC3542 */
-/*
- * call-seq:
- * Socket::AncillaryData.ipv6_pktinfo(addr, ifindex) => ancdata
- *
- * Returns new ancillary data for IPV6_PKTINFO.
- *
- * IPV6_PKTINFO is defined by RFC 3542.
- *
- * addr = Addrinfo.ip("::1")
- * ifindex = 0
- * p Socket::AncillaryData.ipv6_pktinfo(addr, ifindex)
- * #=> #<Socket::AncillaryData: INET6 IPV6 PKTINFO ::1 ifindex:0>
- *
- */
-static VALUE
-ancillary_s_ipv6_pktinfo(VALUE self, VALUE v_addr, VALUE v_ifindex)
-{
- unsigned int ifindex;
- struct sockaddr_in6 sa;
- struct in6_pktinfo pktinfo;
-
- SockAddrStringValue(v_addr);
- ifindex = NUM2UINT(v_ifindex);
-
- memset(&pktinfo, 0, sizeof(pktinfo));
-
- memset(&sa, 0, sizeof(sa));
- if (RSTRING_LEN(v_addr) != sizeof(sa))
- rb_raise(rb_eArgError, "addr size different to AF_INET6 sockaddr");
- memcpy(&sa, RSTRING_PTR(v_addr), sizeof(sa));
- if (sa.sin6_family != AF_INET6)
- rb_raise(rb_eArgError, "addr is not AF_INET6 sockaddr");
- memcpy(&pktinfo.ipi6_addr, &sa.sin6_addr, sizeof(pktinfo.ipi6_addr));
-
- pktinfo.ipi6_ifindex = ifindex;
-
- return ancdata_new(AF_INET6, IPPROTO_IPV6, IPV6_PKTINFO, rb_str_new((char *)&pktinfo, sizeof(pktinfo)));
-}
-#else
-#define ancillary_s_ipv6_pktinfo rb_f_notimplement
-#endif
-
-#if defined(IPPROTO_IPV6) && defined(IPV6_PKTINFO) /* IPv6 RFC3542 */
-static void
-extract_ipv6_pktinfo(VALUE self, struct in6_pktinfo *pktinfo_ptr, struct sockaddr_in6 *sa_ptr)
-{
- int level, type;
- VALUE data;
-
- level = ancillary_level(self);
- type = ancillary_type(self);
- data = ancillary_data(self);
-
- if (level != IPPROTO_IPV6 || type != IPV6_PKTINFO ||
- RSTRING_LEN(data) != sizeof(struct in6_pktinfo)) {
- rb_raise(rb_eTypeError, "IPV6_PKTINFO ancillary data expected");
- }
-
- memcpy(pktinfo_ptr, RSTRING_PTR(data), sizeof(*pktinfo_ptr));
-
- memset(sa_ptr, 0, sizeof(*sa_ptr));
- SET_SA_LEN((struct sockaddr *)sa_ptr, sizeof(struct sockaddr_in6));
- sa_ptr->sin6_family = AF_INET6;
- memcpy(&sa_ptr->sin6_addr, &pktinfo_ptr->ipi6_addr, sizeof(sa_ptr->sin6_addr));
- if (IN6_IS_ADDR_LINKLOCAL(&sa_ptr->sin6_addr))
- sa_ptr->sin6_scope_id = pktinfo_ptr->ipi6_ifindex;
-}
-#endif
-
-#if defined(IPPROTO_IPV6) && defined(IPV6_PKTINFO) /* IPv6 RFC3542 */
-/*
- * call-seq:
- * ancdata.ipv6_pktinfo => [addr, ifindex]
- *
- * Extracts addr and ifindex from IPV6_PKTINFO ancillary data.
- *
- * IPV6_PKTINFO is defined by RFC 3542.
- *
- * addr = Addrinfo.ip("::1")
- * ifindex = 0
- * ancdata = Socket::AncillaryData.ipv6_pktinfo(addr, ifindex)
- * p ancdata.ipv6_pktinfo #=> [#<Addrinfo: ::1>, 0]
- *
- */
-static VALUE
-ancillary_ipv6_pktinfo(VALUE self)
-{
- struct in6_pktinfo pktinfo;
- struct sockaddr_in6 sa;
- VALUE v_addr;
-
- extract_ipv6_pktinfo(self, &pktinfo, &sa);
- v_addr = rsock_addrinfo_new((struct sockaddr *)&sa, sizeof(sa), PF_INET6, 0, 0, Qnil, Qnil);
- return rb_ary_new3(2, v_addr, UINT2NUM(pktinfo.ipi6_ifindex));
-}
-#else
-#define ancillary_ipv6_pktinfo rb_f_notimplement
-#endif
-
-#if defined(IPPROTO_IPV6) && defined(IPV6_PKTINFO) /* IPv6 RFC3542 */
-/*
- * call-seq:
- * ancdata.ipv6_pktinfo_addr => addr
- *
- * Extracts addr from IPV6_PKTINFO ancillary data.
- *
- * IPV6_PKTINFO is defined by RFC 3542.
- *
- * addr = Addrinfo.ip("::1")
- * ifindex = 0
- * ancdata = Socket::AncillaryData.ipv6_pktinfo(addr, ifindex)
- * p ancdata.ipv6_pktinfo_addr #=> #<Addrinfo: ::1>
- *
- */
-static VALUE
-ancillary_ipv6_pktinfo_addr(VALUE self)
-{
- struct in6_pktinfo pktinfo;
- struct sockaddr_in6 sa;
- extract_ipv6_pktinfo(self, &pktinfo, &sa);
- return rsock_addrinfo_new((struct sockaddr *)&sa, sizeof(sa), PF_INET6, 0, 0, Qnil, Qnil);
-}
-#else
-#define ancillary_ipv6_pktinfo_addr rb_f_notimplement
-#endif
-
-#if defined(IPPROTO_IPV6) && defined(IPV6_PKTINFO) /* IPv6 RFC3542 */
-/*
- * call-seq:
- * ancdata.ipv6_pktinfo_ifindex => addr
- *
- * Extracts ifindex from IPV6_PKTINFO ancillary data.
- *
- * IPV6_PKTINFO is defined by RFC 3542.
- *
- * addr = Addrinfo.ip("::1")
- * ifindex = 0
- * ancdata = Socket::AncillaryData.ipv6_pktinfo(addr, ifindex)
- * p ancdata.ipv6_pktinfo_ifindex #=> 0
- *
- */
-static VALUE
-ancillary_ipv6_pktinfo_ifindex(VALUE self)
-{
- struct in6_pktinfo pktinfo;
- struct sockaddr_in6 sa;
- extract_ipv6_pktinfo(self, &pktinfo, &sa);
- return UINT2NUM(pktinfo.ipi6_ifindex);
-}
-#else
-#define ancillary_ipv6_pktinfo_ifindex rb_f_notimplement
-#endif
-
-#if defined(SOL_SOCKET) && defined(SCM_RIGHTS) /* 4.4BSD */
-static int
-anc_inspect_socket_rights(int level, int type, VALUE data, VALUE ret)
-{
- if (level == SOL_SOCKET && type == SCM_RIGHTS &&
- 0 < RSTRING_LEN(data) && (RSTRING_LEN(data) % sizeof(int) == 0)) {
- long off;
- for (off = 0; off < RSTRING_LEN(data); off += sizeof(int)) {
- int fd;
- memcpy((char*)&fd, RSTRING_PTR(data)+off, sizeof(int));
- rb_str_catf(ret, " %d", fd);
- }
- return 1;
- }
- else {
- return 0;
- }
-}
-#endif
-
-#if defined(SCM_CREDENTIALS) /* GNU/Linux */
-static int
-anc_inspect_passcred_credentials(int level, int type, VALUE data, VALUE ret)
-{
- if (level == SOL_SOCKET && type == SCM_CREDENTIALS &&
- RSTRING_LEN(data) == sizeof(struct ucred)) {
- struct ucred cred;
- memcpy(&cred, RSTRING_PTR(data), sizeof(struct ucred));
- rb_str_catf(ret, " pid=%u uid=%u gid=%u", cred.pid, cred.uid, cred.gid);
- rb_str_cat2(ret, " (ucred)");
- return 1;
- }
- else {
- return 0;
- }
-}
-#endif
-
-#if defined(SCM_CREDS)
-#define INSPECT_SCM_CREDS
-static int
-anc_inspect_socket_creds(int level, int type, VALUE data, VALUE ret)
-{
- if (level != SOL_SOCKET && type != SCM_CREDS)
- return 0;
-
- /*
- * FreeBSD has struct cmsgcred and struct sockcred.
- * They use both SOL_SOCKET/SCM_CREDS in the ancillary message.
- * They are not ambiguous from the view of the caller
- * because struct sockcred is sent if and only if the caller sets LOCAL_CREDS socket option.
- * But inspect method doesn't know it.
- * So they are ambiguous from the view of inspect.
- * This function distinguish them by the size of the ancillary message.
- * This heuristics works well except when sc_ngroups == CMGROUP_MAX.
- */
-
-#if defined(HAVE_TYPE_STRUCT_CMSGCRED) /* FreeBSD */
- if (RSTRING_LEN(data) == sizeof(struct cmsgcred)) {
- struct cmsgcred cred;
- memcpy(&cred, RSTRING_PTR(data), sizeof(struct cmsgcred));
- rb_str_catf(ret, " pid=%u", cred.cmcred_pid);
- rb_str_catf(ret, " uid=%u", cred.cmcred_uid);
- rb_str_catf(ret, " euid=%u", cred.cmcred_euid);
- rb_str_catf(ret, " gid=%u", cred.cmcred_gid);
- if (cred.cmcred_ngroups) {
- int i;
- const char *sep = " groups=";
- for (i = 0; i < cred.cmcred_ngroups; i++) {
- rb_str_catf(ret, "%s%u", sep, cred.cmcred_groups[i]);
- sep = ",";
- }
- }
- rb_str_cat2(ret, " (cmsgcred)");
- return 1;
- }
-#endif
-#if defined(HAVE_TYPE_STRUCT_SOCKCRED) /* FreeBSD, NetBSD */
- if ((size_t)RSTRING_LEN(data) >= SOCKCREDSIZE(0)) {
- struct sockcred cred0, *cred;
- memcpy(&cred0, RSTRING_PTR(data), SOCKCREDSIZE(0));
- if ((size_t)RSTRING_LEN(data) == SOCKCREDSIZE(cred0.sc_ngroups)) {
- cred = (struct sockcred *)ALLOCA_N(char, SOCKCREDSIZE(cred0.sc_ngroups));
- memcpy(cred, RSTRING_PTR(data), SOCKCREDSIZE(cred0.sc_ngroups));
- rb_str_catf(ret, " uid=%u", cred->sc_uid);
- rb_str_catf(ret, " euid=%u", cred->sc_euid);
- rb_str_catf(ret, " gid=%u", cred->sc_gid);
- rb_str_catf(ret, " egid=%u", cred->sc_egid);
- if (cred0.sc_ngroups) {
- int i;
- const char *sep = " groups=";
- for (i = 0; i < cred0.sc_ngroups; i++) {
- rb_str_catf(ret, "%s%u", sep, cred->sc_groups[i]);
- sep = ",";
- }
- }
- rb_str_cat2(ret, " (sockcred)");
- return 1;
- }
- }
-#endif
- return 0;
-}
-#endif
-
-#if defined(IPPROTO_IP) && defined(IP_RECVDSTADDR) /* 4.4BSD */
-static int
-anc_inspect_ip_recvdstaddr(int level, int type, VALUE data, VALUE ret)
-{
- if (level == IPPROTO_IP && type == IP_RECVDSTADDR &&
- RSTRING_LEN(data) == sizeof(struct in_addr)) {
- struct in_addr addr;
- char addrbuf[INET_ADDRSTRLEN];
- memcpy(&addr, RSTRING_PTR(data), sizeof(addr));
- if (inet_ntop(AF_INET, &addr, addrbuf, sizeof(addrbuf)) == NULL)
- rb_str_cat2(ret, " invalid-address");
- else
- rb_str_catf(ret, " %s", addrbuf);
- return 1;
- }
- else {
- return 0;
- }
-}
-#endif
-
-#if defined(IPPROTO_IP) && defined(IP_PKTINFO) && defined(HAVE_TYPE_STRUCT_IN_PKTINFO) && defined(HAVE_IPI_SPEC_DST) /* GNU/Linux */
-static int
-anc_inspect_ip_pktinfo(int level, int type, VALUE data, VALUE ret)
-{
- if (level == IPPROTO_IP && type == IP_PKTINFO &&
- RSTRING_LEN(data) == sizeof(struct in_pktinfo)) {
- struct in_pktinfo pktinfo;
- char buf[INET_ADDRSTRLEN > IFNAMSIZ ? INET_ADDRSTRLEN : IFNAMSIZ];
- memcpy(&pktinfo, RSTRING_PTR(data), sizeof(pktinfo));
- if (inet_ntop(AF_INET, &pktinfo.ipi_addr, buf, sizeof(buf)) == NULL)
- rb_str_cat2(ret, " invalid-address");
- else
- rb_str_catf(ret, " %s", buf);
- if (if_indextoname(pktinfo.ipi_ifindex, buf) == NULL)
- rb_str_catf(ret, " ifindex:%d", pktinfo.ipi_ifindex);
- else
- rb_str_catf(ret, " %s", buf);
- if (inet_ntop(AF_INET, &pktinfo.ipi_spec_dst, buf, sizeof(buf)) == NULL)
- rb_str_cat2(ret, " spec_dst:invalid-address");
- else
- rb_str_catf(ret, " spec_dst:%s", buf);
- return 1;
- }
- else {
- return 0;
- }
-}
-#endif
-
-#if defined(IPPROTO_IPV6) && defined(IPV6_PKTINFO) && defined(HAVE_TYPE_STRUCT_IN6_PKTINFO) /* IPv6 RFC3542 */
-static int
-anc_inspect_ipv6_pktinfo(int level, int type, VALUE data, VALUE ret)
-{
- if (level == IPPROTO_IPV6 && type == IPV6_PKTINFO &&
- RSTRING_LEN(data) == sizeof(struct in6_pktinfo)) {
- struct in6_pktinfo *pktinfo = (struct in6_pktinfo *)RSTRING_PTR(data);
- struct in6_addr addr;
- unsigned int ifindex;
- char addrbuf[INET6_ADDRSTRLEN], ifbuf[IFNAMSIZ];
- memcpy(&addr, &pktinfo->ipi6_addr, sizeof(addr));
- memcpy(&ifindex, &pktinfo->ipi6_ifindex, sizeof(ifindex));
- if (inet_ntop(AF_INET6, &addr, addrbuf, sizeof(addrbuf)) == NULL)
- rb_str_cat2(ret, " invalid-address");
- else
- rb_str_catf(ret, " %s", addrbuf);
- if (if_indextoname(ifindex, ifbuf) == NULL)
- rb_str_catf(ret, " ifindex:%d", ifindex);
- else
- rb_str_catf(ret, " %s", ifbuf);
- return 1;
- }
- else {
- return 0;
- }
-}
-#endif
-
-#if defined(SCM_TIMESTAMP) /* GNU/Linux, FreeBSD, NetBSD, OpenBSD, MacOS X, Solaris */
-static int
-inspect_timeval_as_abstime(int level, int optname, VALUE data, VALUE ret)
-{
- if (RSTRING_LEN(data) == sizeof(struct timeval)) {
- struct timeval tv;
- time_t time;
- struct tm tm;
- char buf[32];
- memcpy((char*)&tv, RSTRING_PTR(data), sizeof(tv));
- time = tv.tv_sec;
- tm = *localtime(&time);
- strftime(buf, sizeof(buf), "%Y-%m-%d %H:%M:%S", &tm);
- rb_str_catf(ret, " %s.%06ld", buf, (long)tv.tv_usec);
- return 1;
- }
- else {
- return 0;
- }
-}
-#endif
-
-#if defined(SCM_TIMESTAMPNS) /* GNU/Linux */
-static int
-inspect_timespec_as_abstime(int level, int optname, VALUE data, VALUE ret)
-{
- if (RSTRING_LEN(data) == sizeof(struct timespec)) {
- struct timespec ts;
- struct tm tm;
- char buf[32];
- memcpy((char*)&ts, RSTRING_PTR(data), sizeof(ts));
- tm = *localtime(&ts.tv_sec);
- strftime(buf, sizeof(buf), "%Y-%m-%d %H:%M:%S", &tm);
- rb_str_catf(ret, " %s.%09ld", buf, (long)ts.tv_nsec);
- return 1;
- }
- else {
- return 0;
- }
-}
-#endif
-
-#if defined(SCM_BINTIME) /* FreeBSD */
-static int
-inspect_bintime_as_abstime(int level, int optname, VALUE data, VALUE ret)
-{
- if (RSTRING_LEN(data) == sizeof(struct bintime)) {
- struct bintime bt;
- struct tm tm;
- uint64_t frac_h, frac_l;
- uint64_t scale_h, scale_l;
- uint64_t tmp1, tmp2;
- uint64_t res_h, res_l;
- char buf[32];
- memcpy((char*)&bt, RSTRING_PTR(data), sizeof(bt));
- tm = *localtime(&bt.sec);
- strftime(buf, sizeof(buf), "%Y-%m-%d %H:%M:%S", &tm);
-
- /* res_h = frac * 10**19 / 2**64 */
-
- frac_h = bt.frac >> 32;
- frac_l = bt.frac & 0xffffffff;
-
- scale_h = 0x8ac72304; /* 0x8ac7230489e80000 == 10**19 */
- scale_l = 0x89e80000;
-
- res_h = frac_h * scale_h;
- res_l = frac_l * scale_l;
-
- tmp1 = frac_h * scale_l;
- res_h += tmp1 >> 32;
- tmp2 = res_l;
- res_l += tmp1 & 0xffffffff;
- if (res_l < tmp2) res_h++;
-
- tmp1 = frac_l * scale_h;
- res_h += tmp1 >> 32;
- tmp2 = res_l;
- res_l += tmp1 & 0xffffffff;
- if (res_l < tmp2) res_h++;
-
- rb_str_catf(ret, " %s.%019"PRIu64, buf, res_h);
- return 1;
- }
- else {
- return 0;
- }
-}
-#endif
-
-/*
- * call-seq:
- * ancillarydata.inspect => string
- *
- * returns a string which shows ancillarydata in human-readable form.
- *
- * p Socket::AncillaryData.new(:INET6, :IPV6, :PKTINFO, "").inspect
- * #=> "#<Socket::AncillaryData: INET6 IPV6 PKTINFO \"\">"
- */
-static VALUE
-ancillary_inspect(VALUE self)
-{
- VALUE ret;
- int family, level, type;
- VALUE data;
- ID family_id, level_id, type_id;
- VALUE vtype;
- int inspected;
-
- family = ancillary_family(self);
- level = ancillary_level(self);
- type = ancillary_type(self);
- data = ancillary_data(self);
-
- ret = rb_sprintf("#<%s:", rb_obj_classname(self));
-
- family_id = rsock_intern_family_noprefix(family);
- if (family_id)
- rb_str_catf(ret, " %s", rb_id2name(family_id));
- else
- rb_str_catf(ret, " family:%d", family);
-
- if (level == SOL_SOCKET) {
- rb_str_cat2(ret, " SOCKET");
-
- type_id = rsock_intern_scm_optname(type);
- if (type_id)
- rb_str_catf(ret, " %s", rb_id2name(type_id));
- else
- rb_str_catf(ret, " cmsg_type:%d", type);
- }
- else if (IS_IP_FAMILY(family)) {
- level_id = rsock_intern_iplevel(level);
- if (level_id)
- rb_str_catf(ret, " %s", rb_id2name(level_id));
- else
- rb_str_catf(ret, " cmsg_level:%d", level);
-
- vtype = ip_cmsg_type_to_sym(level, type);
- if (SYMBOL_P(vtype))
- rb_str_catf(ret, " %s", rb_id2name(SYM2ID(vtype)));
- else
- rb_str_catf(ret, " cmsg_type:%d", type);
- }
- else {
- rb_str_catf(ret, " cmsg_level:%d", level);
- rb_str_catf(ret, " cmsg_type:%d", type);
- }
-
- inspected = 0;
-
- if (level == SOL_SOCKET)
- family = AF_UNSPEC;
-
- switch (family) {
- case AF_UNSPEC:
- switch (level) {
-# if defined(SOL_SOCKET)
- case SOL_SOCKET:
- switch (type) {
-# if defined(SCM_TIMESTAMP) /* GNU/Linux, FreeBSD, NetBSD, OpenBSD, MacOS X, Solaris */
- case SCM_TIMESTAMP: inspected = inspect_timeval_as_abstime(level, type, data, ret); break;
-# endif
-# if defined(SCM_TIMESTAMPNS) /* GNU/Linux */
- case SCM_TIMESTAMPNS: inspected = inspect_timespec_as_abstime(level, type, data, ret); break;
-# endif
-# if defined(SCM_BINTIME) /* FreeBSD */
- case SCM_BINTIME: inspected = inspect_bintime_as_abstime(level, type, data, ret); break;
-# endif
-# if defined(SCM_RIGHTS) /* 4.4BSD */
- case SCM_RIGHTS: inspected = anc_inspect_socket_rights(level, type, data, ret); break;
-# endif
-# if defined(SCM_CREDENTIALS) /* GNU/Linux */
- case SCM_CREDENTIALS: inspected = anc_inspect_passcred_credentials(level, type, data, ret); break;
-# endif
-# if defined(INSPECT_SCM_CREDS) /* NetBSD */
- case SCM_CREDS: inspected = anc_inspect_socket_creds(level, type, data, ret); break;
-# endif
- }
- break;
-# endif
- }
- break;
-
- case AF_INET:
-#ifdef INET6
- case AF_INET6:
-#endif
- switch (level) {
-# if defined(IPPROTO_IP)
- case IPPROTO_IP:
- switch (type) {
-# if defined(IP_RECVDSTADDR) /* 4.4BSD */
- case IP_RECVDSTADDR: inspected = anc_inspect_ip_recvdstaddr(level, type, data, ret); break;
-# endif
-# if defined(IP_PKTINFO) && defined(HAVE_TYPE_STRUCT_IN_PKTINFO) && defined(HAVE_IPI_SPEC_DST) /* GNU/Linux */
- case IP_PKTINFO: inspected = anc_inspect_ip_pktinfo(level, type, data, ret); break;
-# endif
- }
- break;
-# endif
-
-# if defined(IPPROTO_IPV6)
- case IPPROTO_IPV6:
- switch (type) {
-# if defined(IPV6_PKTINFO) /* RFC 3542 */
- case IPV6_PKTINFO: inspected = anc_inspect_ipv6_pktinfo(level, type, data, ret); break;
-# endif
- }
- break;
-# endif
- }
- break;
- }
-
- if (!inspected) {
- data = rb_str_dump(data);
- rb_str_catf(ret, " %s", StringValueCStr(data));
- }
-
- rb_str_cat2(ret, ">");
-
- return ret;
-}
-
-/*
- * call-seq:
- * ancillarydata.cmsg_is?(level, type) => true or false
- *
- * tests the level and type of _ancillarydata_.
- *
- * ancdata = Socket::AncillaryData.new(:INET6, :IPV6, :PKTINFO, "")
- * ancdata.cmsg_is?(Socket::IPPROTO_IPV6, Socket::IPV6_PKTINFO) #=> true
- * ancdata.cmsg_is?(:IPV6, :PKTINFO) #=> true
- * ancdata.cmsg_is?(:IP, :PKTINFO) #=> false
- * ancdata.cmsg_is?(:SOCKET, :RIGHTS) #=> false
- */
-static VALUE
-ancillary_cmsg_is_p(VALUE self, VALUE vlevel, VALUE vtype)
-{
- int family = ancillary_family(self);
- int level = rsock_level_arg(family, vlevel);
- int type = rsock_cmsg_type_arg(family, level, vtype);
-
- if (ancillary_level(self) == level &&
- ancillary_type(self) == type)
- return Qtrue;
- else
- return Qfalse;
-}
-
-#endif
-
-#if defined(HAVE_SENDMSG)
-struct sendmsg_args_struct {
- int fd;
- const struct msghdr *msg;
- int flags;
-};
-
-static VALUE
-nogvl_sendmsg_func(void *ptr)
-{
- struct sendmsg_args_struct *args = ptr;
- return sendmsg(args->fd, args->msg, args->flags);
-}
-
-static ssize_t
-rb_sendmsg(int fd, const struct msghdr *msg, int flags)
-{
- struct sendmsg_args_struct args;
- args.fd = fd;
- args.msg = msg;
- args.flags = flags;
- return rb_thread_blocking_region(nogvl_sendmsg_func, &args, RUBY_UBF_IO, 0);
-}
-
-static VALUE
-bsock_sendmsg_internal(int argc, VALUE *argv, VALUE sock, int nonblock)
-{
- rb_io_t *fptr;
- VALUE data, vflags, dest_sockaddr;
- VALUE *controls_ptr;
- int controls_num;
- struct msghdr mh;
- struct iovec iov;
-#if defined(HAVE_ST_MSG_CONTROL)
- volatile VALUE controls_str = 0;
-#endif
- int flags;
- ssize_t ss;
- int family;
-
- rb_secure(4);
- GetOpenFile(sock, fptr);
- family = rsock_getfamily(fptr->fd);
-
- data = vflags = dest_sockaddr = Qnil;
- controls_ptr = NULL;
- controls_num = 0;
-
- 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];
- if (3 < argc) { controls_ptr = &argv[3]; controls_num = argc - 3; }
-
- StringValue(data);
-
- if (controls_num) {
-#if defined(HAVE_ST_MSG_CONTROL)
- int i;
- int last_pad = 0;
- int last_level = 0;
- int last_type = 0;
- controls_str = rb_str_tmp_new(0);
- for (i = 0; i < controls_num; i++) {
- VALUE elt = controls_ptr[i], v;
- VALUE vlevel, vtype;
- int level, type;
- VALUE cdata;
- long oldlen;
- struct cmsghdr cmh;
- char *cmsg;
- size_t cspace;
- v = rb_check_convert_type(elt, T_ARRAY, "Array", "to_ary");
- if (!NIL_P(v)) {
- elt = v;
- if (RARRAY_LEN(elt) != 3)
- rb_raise(rb_eArgError, "an element of controls should be 3-elements array");
- vlevel = rb_ary_entry(elt, 0);
- vtype = rb_ary_entry(elt, 1);
- cdata = rb_ary_entry(elt, 2);
- }
- else {
- vlevel = rb_funcall(elt, rb_intern("level"), 0);
- vtype = rb_funcall(elt, rb_intern("type"), 0);
- cdata = rb_funcall(elt, rb_intern("data"), 0);
- }
- level = rsock_level_arg(family, vlevel);
- type = rsock_cmsg_type_arg(family, level, vtype);
- StringValue(cdata);
- oldlen = RSTRING_LEN(controls_str);
- cspace = CMSG_SPACE(RSTRING_LEN(cdata));
- rb_str_resize(controls_str, oldlen + cspace);
- cmsg = RSTRING_PTR(controls_str)+oldlen;
- memset((char *)cmsg, 0, cspace);
- memset((char *)&cmh, 0, sizeof(cmh));
- cmh.cmsg_level = level;
- cmh.cmsg_type = type;
- cmh.cmsg_len = CMSG_LEN(RSTRING_LEN(cdata));
- MEMCPY(cmsg, &cmh, char, sizeof(cmh));
- MEMCPY(cmsg+((char*)CMSG_DATA(&cmh)-(char*)&cmh), RSTRING_PTR(cdata), char, RSTRING_LEN(cdata));
- last_level = cmh.cmsg_level;
- last_type = cmh.cmsg_type;
- last_pad = cspace - cmh.cmsg_len;
- }
- if (last_pad) {
- /*
- * This code removes the last padding from msg_controllen.
- *
- * 4.3BSD-Reno reject the padding for SCM_RIGHTS. (There was no 64bit environments in those days?)
- * RFC 2292 require the padding.
- * RFC 3542 relaxes the condition - implementation must accept both as valid.
- *
- * Actual problems:
- *
- * - NetBSD 4.0.1
- * SCM_RIGHTS with padding causes EINVAL
- * IPV6_PKTINFO without padding causes "page fault trap"
- *
- * - OpenBSD 4.4
- * IPV6_PKTINFO without padding causes EINVAL
- *
- * Basically, msg_controllen should contains the padding.
- * So the padding is removed only if a problem really exists.
- */
-#if defined(__NetBSD__)
- if (last_level == SOL_SOCKET && last_type == SCM_RIGHTS)
- rb_str_set_len(controls_str, RSTRING_LEN(controls_str)-last_pad);
-#endif
- }
-#else
- rb_raise(rb_eNotImpError, "control message for sendmsg is unimplemented");
-#endif
- }
-
- flags = NIL_P(vflags) ? 0 : NUM2INT(vflags);
-#ifdef MSG_DONTWAIT
- if (nonblock)
- flags |= MSG_DONTWAIT;
-#endif
-
- if (!NIL_P(dest_sockaddr))
- SockAddrStringValue(dest_sockaddr);
-
- rb_io_check_closed(fptr);
-
- retry:
- memset(&mh, 0, sizeof(mh));
- if (!NIL_P(dest_sockaddr)) {
- mh.msg_name = RSTRING_PTR(dest_sockaddr);
- mh.msg_namelen = RSTRING_LEN(dest_sockaddr);
- }
- mh.msg_iovlen = 1;
- mh.msg_iov = &iov;
- iov.iov_base = RSTRING_PTR(data);
- iov.iov_len = RSTRING_LEN(data);
-#if defined(HAVE_ST_MSG_CONTROL)
- if (controls_str) {
- mh.msg_control = RSTRING_PTR(controls_str);
- mh.msg_controllen = RSTRING_LEN(controls_str);
- }
- else {
- mh.msg_control = NULL;
- mh.msg_controllen = 0;
- }
-#endif
-
- rb_io_check_closed(fptr);
- if (nonblock)
- rb_io_set_nonblock(fptr);
-
- ss = rb_sendmsg(fptr->fd, &mh, flags);
-
- if (!nonblock && rb_io_wait_writable(fptr->fd)) {
- rb_io_check_closed(fptr);
- goto retry;
- }
-
- if (ss == -1) {
- if (nonblock && (errno == EWOULDBLOCK || errno == EAGAIN))
- rb_mod_sys_fail(rb_mWaitWritable, "sendmsg(2) would block");
- rb_sys_fail("sendmsg(2)");
- }
-
- 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)
- *
- */
-static VALUE
-bsock_sendmsg(int argc, VALUE *argv, VALUE sock)
-{
- return bsock_sendmsg_internal(argc, argv, sock, 0);
-}
-#else
-#define bsock_sendmsg rb_f_notimplement
-#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.
- *
- */
-static VALUE
-bsock_sendmsg_nonblock(int argc, VALUE *argv, VALUE sock)
-{
- return bsock_sendmsg_internal(argc, argv, sock, 1);
-}
-#else
-#define bsock_sendmsg_nonblock rb_f_notimplement
-#endif
-
-#if defined(HAVE_RECVMSG)
-struct recvmsg_args_struct {
- int fd;
- struct msghdr *msg;
- int flags;
-};
-
-static VALUE
-nogvl_recvmsg_func(void *ptr)
-{
- struct recvmsg_args_struct *args = ptr;
- return recvmsg(args->fd, args->msg, args->flags);
-}
-
-static ssize_t
-rb_recvmsg(int fd, struct msghdr *msg, int flags)
-{
- struct recvmsg_args_struct args;
- args.fd = fd;
- args.msg = msg;
- args.flags = flags;
- return rb_thread_blocking_region(nogvl_recvmsg_func, &args, RUBY_UBF_IO, 0);
-}
-
-#if defined(HAVE_ST_MSG_CONTROL)
-static void
-discard_cmsg(struct cmsghdr *cmh, char *msg_end)
-{
- if (cmh->cmsg_level == SOL_SOCKET && cmh->cmsg_type == SCM_RIGHTS) {
- int *fdp = (int *)CMSG_DATA(cmh);
- int *end = (int *)((char *)cmh + cmh->cmsg_len);
- while ((char *)fdp + sizeof(int) <= (char *)end &&
- (char *)fdp + sizeof(int) <= msg_end) {
- close(*fdp);
- fdp++;
- }
- }
-}
-#endif
-
-void
-rsock_discard_cmsg_resource(struct msghdr *mh)
-{
-#if defined(HAVE_ST_MSG_CONTROL)
- struct cmsghdr *cmh;
- char *msg_end;
-
- if (mh->msg_controllen == 0)
- return;
-
- msg_end = (char *)mh->msg_control + mh->msg_controllen;
-
- for (cmh = CMSG_FIRSTHDR(mh); cmh != NULL; cmh = CMSG_NXTHDR(mh, cmh)) {
- discard_cmsg(cmh, msg_end);
- }
-#endif
-}
-
-#if defined(HAVE_ST_MSG_CONTROL)
-static void
-make_io_for_unix_rights(VALUE ctl, struct cmsghdr *cmh, char *msg_end)
-{
- if (cmh->cmsg_level == SOL_SOCKET && cmh->cmsg_type == SCM_RIGHTS) {
- int *fdp, *end;
- VALUE ary = rb_ary_new();
- rb_ivar_set(ctl, rb_intern("unix_rights"), ary);
- fdp = (int *)CMSG_DATA(cmh);
- end = (int *)((char *)cmh + cmh->cmsg_len);
- while ((char *)fdp + sizeof(int) <= (char *)end &&
- (char *)fdp + sizeof(int) <= msg_end) {
- int fd = *fdp;
- struct stat stbuf;
- VALUE io;
- if (fstat(fd, &stbuf) == -1)
- rb_raise(rb_eSocket, "invalid fd in SCM_RIGHTS");
- if (S_ISSOCK(stbuf.st_mode))
- io = rsock_init_sock(rb_obj_alloc(rb_cSocket), fd);
- else
- io = rb_io_fdopen(fd, O_RDWR, NULL);
- ary = rb_attr_get(ctl, rb_intern("unix_rights"));
- rb_ary_push(ary, io);
- fdp++;
- }
- OBJ_FREEZE(ary);
- }
-}
-#endif
-
-static VALUE
-bsock_recvmsg_internal(int argc, VALUE *argv, VALUE sock, int nonblock)
-{
- rb_io_t *fptr;
- VALUE vmaxdatlen, vmaxctllen, vflags, vopts;
- int grow_buffer;
- size_t maxdatlen;
- int flags, orig_flags;
- int request_scm_rights;
- struct msghdr mh;
- struct iovec iov;
- struct sockaddr_storage namebuf;
- char datbuf0[4096], *datbuf;
- VALUE dat_str = Qnil;
- VALUE ret;
- ssize_t ss;
-#if defined(HAVE_ST_MSG_CONTROL)
- struct cmsghdr *cmh;
- size_t maxctllen;
- union {
- char bytes[4096];
- struct cmsghdr align;
- } ctlbuf0;
- char *ctlbuf;
- VALUE ctl_str = Qnil;
- int family;
- int gc_done = 0;
-#endif
-
- rb_secure(4);
-
- vopts = Qnil;
- if (0 < argc && TYPE(argv[argc-1]) == T_HASH)
- vopts = argv[--argc];
-
- rb_scan_args(argc, argv, "03", &vmaxdatlen, &vflags, &vmaxctllen);
-
- maxdatlen = NIL_P(vmaxdatlen) ? sizeof(datbuf0) : NUM2SIZET(vmaxdatlen);
-#if defined(HAVE_ST_MSG_CONTROL)
- maxctllen = NIL_P(vmaxctllen) ? sizeof(ctlbuf0) : NUM2SIZET(vmaxctllen);
-#else
- if (!NIL_P(vmaxctllen))
- rb_raise(rb_eArgError, "control message not supported");
-#endif
- flags = NIL_P(vflags) ? 0 : NUM2INT(vflags);
-#ifdef MSG_DONTWAIT
- if (nonblock)
- flags |= MSG_DONTWAIT;
-#endif
- orig_flags = flags;
-
- grow_buffer = NIL_P(vmaxdatlen) || NIL_P(vmaxctllen);
-
- request_scm_rights = 0;
- if (!NIL_P(vopts) && RTEST(rb_hash_aref(vopts, ID2SYM(rb_intern("scm_rights")))))
- request_scm_rights = 1;
-
- GetOpenFile(sock, fptr);
- if (rb_io_read_pending(fptr)) {
- rb_raise(rb_eIOError, "recvmsg for buffered IO");
- }
-
-#if !defined(HAVE_ST_MSG_CONTROL)
- if (grow_buffer) {
- int socktype, optlen = sizeof(socktype);
- if (getsockopt(fptr->fd, SOL_SOCKET, SO_TYPE, (void*)&socktype, &optlen) == -1) {
- rb_sys_fail("getsockopt(SO_TYPE)");
- }
- if (socktype == SOCK_STREAM)
- grow_buffer = 0;
- }
-#endif
-
- retry:
- if (maxdatlen <= sizeof(datbuf0))
- datbuf = datbuf0;
- else {
- if (NIL_P(dat_str))
- dat_str = rb_str_tmp_new(maxdatlen);
- else
- rb_str_resize(dat_str, maxdatlen);
- datbuf = RSTRING_PTR(dat_str);
- }
-
-#if defined(HAVE_ST_MSG_CONTROL)
- if (maxctllen <= sizeof(ctlbuf0))
- ctlbuf = ctlbuf0.bytes;
- else {
- if (NIL_P(ctl_str))
- ctl_str = rb_str_tmp_new(maxctllen);
- else
- rb_str_resize(ctl_str, maxctllen);
- ctlbuf = RSTRING_PTR(ctl_str);
- }
-#endif
-
- memset(&mh, 0, sizeof(mh));
-
- memset(&namebuf, 0, sizeof(namebuf));
- mh.msg_name = (struct sockaddr *)&namebuf;
- mh.msg_namelen = sizeof(namebuf);
-
- mh.msg_iov = &iov;
- mh.msg_iovlen = 1;
- iov.iov_base = datbuf;
- iov.iov_len = maxdatlen;
-
-#if defined(HAVE_ST_MSG_CONTROL)
- mh.msg_control = ctlbuf;
- mh.msg_controllen = maxctllen;
-#endif
-
- if (grow_buffer)
- flags |= MSG_PEEK;
-
- rb_io_check_closed(fptr);
- if (nonblock)
- rb_io_set_nonblock(fptr);
-
- ss = rb_recvmsg(fptr->fd, &mh, flags);
-
- if (!nonblock && rb_io_wait_readable(fptr->fd)) {
- rb_io_check_closed(fptr);
- goto retry;
- }
-
- if (ss == -1) {
- if (nonblock && (errno == EWOULDBLOCK || errno == EAGAIN))
- rb_mod_sys_fail(rb_mWaitReadable, "recvmsg(2) would block");
-#if defined(HAVE_ST_MSG_CONTROL)
- if (!gc_done && (errno == EMFILE || errno == EMSGSIZE)) {
- /*
- * When SCM_RIGHTS hit the file descriptors limit:
- * - Linux 2.6.18 causes success with MSG_CTRUNC
- * - MacOS X 10.4 causes EMSGSIZE (and lost file descriptors?)
- * - Solaris 11 causes EMFILE
- */
- gc_and_retry:
- rb_gc();
- gc_done = 1;
- goto retry;
- }
-#endif
- rb_sys_fail("recvmsg(2)");
- }
-
- if (grow_buffer) {
- int grown = 0;
-#if defined(HAVE_ST_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 (NIL_P(vmaxctllen) && (mh.msg_flags & MSG_CTRUNC)) {
-#define BIG_ENOUGH_SPACE 65536
- if (BIG_ENOUGH_SPACE < maxctllen &&
- mh.msg_controllen < maxctllen - BIG_ENOUGH_SPACE) {
- /* there are big space bug truncated.
- * file descriptors limit? */
- if (!gc_done) {
- rsock_discard_cmsg_resource(&mh);
- goto gc_and_retry;
- }
- }
- else {
- if (SIZE_MAX/2 < maxctllen)
- rb_raise(rb_eArgError, "max control message length too big");
- maxctllen *= 2;
- grown = 1;
- }
-#undef BIG_ENOUGH_SPACE
- }
-#else
- if (NIL_P(vmaxdatlen) && ss != -1 && ss == 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);
- goto retry;
- }
- else {
- grow_buffer = 0;
- if (flags != orig_flags) {
- flags = orig_flags;
- rsock_discard_cmsg_resource(&mh);
- goto retry;
- }
- }
- }
-
- if (NIL_P(dat_str))
- dat_str = rb_tainted_str_new(datbuf, ss);
- else {
- rb_str_resize(dat_str, ss);
- OBJ_TAINT(dat_str);
- RBASIC(dat_str)->klass = rb_cString;
- }
-
- ret = rb_ary_new3(3, dat_str,
- rsock_io_socket_addrinfo(sock, mh.msg_name, mh.msg_namelen),
-#if defined(HAVE_ST_MSG_CONTROL)
- INT2NUM(mh.msg_flags)
-#else
- Qnil
-#endif
- );
-
-#if defined(HAVE_ST_MSG_CONTROL)
- 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)) {
- VALUE ctl;
- char *ctl_end;
- size_t clen;
- if (cmh->cmsg_len == 0) {
- rb_raise(rb_eTypeError, "invalid control message (cmsg_len == 0)");
- }
- 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_tainted_str_new((char*)CMSG_DATA(cmh), clen));
- if (request_scm_rights)
- make_io_for_unix_rights(ctl, cmh, msg_end);
- else
- discard_cmsg(cmh, msg_end);
- rb_ary_push(ret, ctl);
- }
- }
-#endif
-
- return ret;
-}
-#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.
- *
- * _maxcontrolslen_ 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 neigher 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 _maxcontrolslen_ 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
- * }
- *
- */
-static VALUE
-bsock_recvmsg(int argc, VALUE *argv, VALUE sock)
-{
- return bsock_recvmsg_internal(argc, argv, sock, 0);
-}
-#else
-#define bsock_recvmsg rb_f_notimplement
-#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.
- *
- */
-static VALUE
-bsock_recvmsg_nonblock(int argc, VALUE *argv, VALUE sock)
-{
- return bsock_recvmsg_internal(argc, argv, sock, 1);
-}
-#else
-#define bsock_recvmsg_nonblock rb_f_notimplement
-#endif
-
-void
-Init_ancdata(void)
-{
- /* for rdoc */
- /* rb_cBasicSocket = rb_define_class("BasicSocket", rb_cIO); */
- /* rb_cSocket = rb_define_class("Socket", rb_cBasicSocket); */
-
- rb_define_method(rb_cBasicSocket, "sendmsg", bsock_sendmsg, -1);
- rb_define_method(rb_cBasicSocket, "sendmsg_nonblock", bsock_sendmsg_nonblock, -1);
- rb_define_method(rb_cBasicSocket, "recvmsg", bsock_recvmsg, -1);
- rb_define_method(rb_cBasicSocket, "recvmsg_nonblock", bsock_recvmsg_nonblock, -1);
-
-#if defined(HAVE_ST_MSG_CONTROL)
- rb_cAncillaryData = rb_define_class_under(rb_cSocket, "AncillaryData", rb_cObject);
- rb_define_method(rb_cAncillaryData, "initialize", ancillary_initialize, 4);
- rb_define_method(rb_cAncillaryData, "inspect", ancillary_inspect, 0);
- rb_define_method(rb_cAncillaryData, "family", ancillary_family_m, 0);
- rb_define_method(rb_cAncillaryData, "level", ancillary_level_m, 0);
- rb_define_method(rb_cAncillaryData, "type", ancillary_type_m, 0);
- rb_define_method(rb_cAncillaryData, "data", ancillary_data, 0);
-
- rb_define_method(rb_cAncillaryData, "cmsg_is?", ancillary_cmsg_is_p, 2);
-
- rb_define_singleton_method(rb_cAncillaryData, "int", ancillary_s_int, 4);
- rb_define_method(rb_cAncillaryData, "int", ancillary_int, 0);
-
- rb_define_singleton_method(rb_cAncillaryData, "unix_rights", ancillary_s_unix_rights, -1);
- rb_define_method(rb_cAncillaryData, "unix_rights", ancillary_unix_rights, 0);
-
- rb_define_method(rb_cAncillaryData, "timestamp", ancillary_timestamp, 0);
-
- rb_define_singleton_method(rb_cAncillaryData, "ip_pktinfo", ancillary_s_ip_pktinfo, -1);
- rb_define_method(rb_cAncillaryData, "ip_pktinfo", ancillary_ip_pktinfo, 0);
-
- rb_define_singleton_method(rb_cAncillaryData, "ipv6_pktinfo", ancillary_s_ipv6_pktinfo, 2);
- rb_define_method(rb_cAncillaryData, "ipv6_pktinfo", ancillary_ipv6_pktinfo, 0);
- 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
-}
diff --git a/ext/socket/basicsocket.c b/ext/socket/basicsocket.c
deleted file mode 100644
index 4ffbd497bf..0000000000
--- a/ext/socket/basicsocket.c
+++ /dev/null
@@ -1,723 +0,0 @@
-/************************************************
-
- basicsocket.c -
-
- created at: Thu Mar 31 12:21:29 JST 1994
-
- Copyright (C) 1993-2007 Yukihiro Matsumoto
-
-************************************************/
-
-#include "rubysocket.h"
-
-/*
- * call-seq:
- * BasicSocket.for_fd(fd) => basicsocket
- *
- * Returns a socket object which contains the file descriptor, _fd_.
- *
- * # If invoked by inetd, STDIN/STDOUT/STDERR is a socket.
- * STDIN_SOCK = Socket.for_fd(STDIN.fileno)
- * p STDIN_SOCK.remote_address
- *
- */
-static VALUE
-bsock_s_for_fd(VALUE klass, VALUE fd)
-{
- rb_io_t *fptr;
- VALUE sock = rsock_init_sock(rb_obj_alloc(klass), NUM2INT(fd));
-
- GetOpenFile(sock, fptr);
-
- return sock;
-}
-
-/*
- * call-seq:
- * basicsocket.shutdown([how]) => 0
- *
- * Calls shutdown(2) system call.
- *
- * s.shutdown(Socket::SHUT_RD) disallows further read.
- *
- * s.shutdown(Socket::SHUT_WR) disallows further write.
- *
- * s.shutdown(Socket::SHUT_RDWR) disallows further read and write.
- *
- * _how_ can be symbol or string:
- * - :RD, :SHUT_RD, "RD" and "SHUT_RD" are accepted as Socket::SHUT_RD.
- * - :WR, :SHUT_WR, "WR" and "SHUT_WR" are accepted as Socket::SHUT_WR.
- * - :RDWR, :SHUT_RDWR, "RDWR" and "SHUT_RDWR" are accepted as Socket::SHUT_RDWR.
- *
- * UNIXSocket.pair {|s1, s2|
- * s1.puts "ping"
- * s1.shutdown(:WR)
- * p s2.read #=> "ping\n"
- * s2.puts "pong"
- * s2.close
- * p s1.read #=> "pong\n"
- * }
- *
- */
-static VALUE
-bsock_shutdown(int argc, VALUE *argv, VALUE sock)
-{
- VALUE howto;
- int how;
- rb_io_t *fptr;
-
- if (rb_safe_level() >= 4 && !OBJ_TAINTED(sock)) {
- rb_raise(rb_eSecurityError, "Insecure: can't shutdown socket");
- }
- rb_scan_args(argc, argv, "01", &howto);
- if (howto == Qnil)
- how = SHUT_RDWR;
- else {
- how = rsock_shutdown_how_arg(howto);
- if (how != SHUT_WR && how != SHUT_RD && how != SHUT_RDWR) {
- rb_raise(rb_eArgError, "`how' should be either :SHUT_RD, :SHUT_WR, :SHUT_RDWR");
- }
- }
- GetOpenFile(sock, fptr);
- if (shutdown(fptr->fd, how) == -1)
- rb_sys_fail(0);
-
- return INT2FIX(0);
-}
-
-/*
- * call-seq:
- * basicsocket.close_read => nil
- *
- * Disallows further read.
- *
- * s1, s2 = UNIXSocket.pair
- * s1.close_read
- * s2.puts #=> Broken pipe (Errno::EPIPE)
- */
-static VALUE
-bsock_close_read(VALUE sock)
-{
- rb_io_t *fptr;
-
- if (rb_safe_level() >= 4 && !OBJ_TAINTED(sock)) {
- rb_raise(rb_eSecurityError, "Insecure: can't close socket");
- }
- GetOpenFile(sock, fptr);
- shutdown(fptr->fd, 0);
- if (!(fptr->mode & FMODE_WRITABLE)) {
- return rb_io_close(sock);
- }
- fptr->mode &= ~FMODE_READABLE;
-
- return Qnil;
-}
-
-/*
- * call-seq:
- * basicsocket.close_write => nil
- *
- * Disallows further write.
- *
- * UNIXSocket.pair {|s1, s2|
- * s1.print "ping"
- * s1.close_write
- * p s2.read #=> "ping"
- * s2.print "pong"
- * s2.close
- * p s1.read #=> "pong"
- * }
- */
-static VALUE
-bsock_close_write(VALUE sock)
-{
- rb_io_t *fptr;
-
- if (rb_safe_level() >= 4 && !OBJ_TAINTED(sock)) {
- rb_raise(rb_eSecurityError, "Insecure: can't close socket");
- }
- GetOpenFile(sock, fptr);
- if (!(fptr->mode & FMODE_READABLE)) {
- return rb_io_close(sock);
- }
- shutdown(fptr->fd, 1);
- fptr->mode &= ~FMODE_WRITABLE;
-
- return Qnil;
-}
-
-/*
- * Document-method: setsockopt
- * call-seq: setsockopt(level, optname, optval)
- *
- * Sets a socket option. These are protocol and system specific, see your
- * local sytem documentation for details.
- *
- * === Parameters
- * * +level+ is an integer, usually one of the SOL_ constants such as
- * Socket::SOL_SOCKET, or a protocol level.
- * * +optname+ is an integer, usually one of the SO_ constants, such
- * as Socket::SO_REUSEADDR.
- * * +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:
- * - 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 a Fixnum. Note that +false+ must be passed,
- * not +nil+.
- * - String: the string's data and length is passed to the socket.
- *
- * === Examples
- *
- * Some socket options are integers with boolean values, in this case
- * #setsockopt could be called like this:
- * sock.setsockopt(Socket::SOL_SOCKET,Socket::SO_REUSEADDR, true)
- *
- * Some socket options are integers with numeric values, in this case
- * #setsockopt could be called like this:
- * sock.setsockopt(Socket::IPPROTO_IP, Socket::IP_TTL, 255)
- *
- * Option values may be structs. Passing them can be complex as it involves
- * examining your system headers to determine the correct definition. An
- * example is an +ip_mreq+, which may be defined in your system headers as:
- * struct ip_mreq {
- * struct in_addr imr_multiaddr;
- * struct in_addr imr_interface;
- * };
- *
- * In this case #setsockopt could be called like this:
- * optval = IPAddr.new("224.0.0.251") + Socket::INADDR_ANY
- * sock.setsockopt(Socket::IPPROTO_IP, Socket::IP_ADD_MEMBERSHIP, optval)
- *
-*/
-static VALUE
-bsock_setsockopt(int argc, VALUE *argv, VALUE sock)
-{
- VALUE lev, optname, val;
- int family, level, option;
- rb_io_t *fptr;
- int i;
- char *v;
- int vlen;
-
- if (argc == 1) {
- lev = rb_funcall(argv[0], rb_intern("level"), 0);
- optname = rb_funcall(argv[0], rb_intern("optname"), 0);
- val = rb_funcall(argv[0], rb_intern("data"), 0);
- }
- else {
- rb_scan_args(argc, argv, "30", &lev, &optname, &val);
- }
-
- rb_secure(2);
- GetOpenFile(sock, fptr);
- family = rsock_getfamily(fptr->fd);
- level = rsock_level_arg(family, lev);
- option = rsock_optname_arg(family, level, optname);
-
- switch (TYPE(val)) {
- case T_FIXNUM:
- i = FIX2INT(val);
- goto numval;
- case T_FALSE:
- i = 0;
- goto numval;
- case T_TRUE:
- i = 1;
- numval:
- v = (char*)&i; vlen = sizeof(i);
- break;
- default:
- StringValue(val);
- v = RSTRING_PTR(val);
- vlen = RSTRING_LEN(val);
- break;
- }
-
-#define rb_sys_fail_path(path) rb_sys_fail(NIL_P(path) ? 0 : RSTRING_PTR(path))
-
- rb_io_check_closed(fptr);
- if (setsockopt(fptr->fd, level, option, v, vlen) < 0)
- rb_sys_fail_path(fptr->pathv);
-
- return INT2FIX(0);
-}
-
-#if !defined(__BEOS__)
-/*
- * Document-method: getsockopt
- * call-seq: getsockopt(level, optname)
- *
- * Gets a socket option. These are protocol and system specific, see your
- * local sytem documentation for details. The option is returned as
- * a String with the data being the binary value of the socket option.
- *
- * === Parameters
- * * +level+ is an integer, usually one of the SOL_ constants such as
- * Socket::SOL_SOCKET, or a protocol level.
- * * +optname+ is an integer, usually one of the SO_ constants, such
- * as Socket::SO_REUSEADDR.
- *
- * === Examples
- *
- * Some socket options are integers with boolean values, in this case
- * #getsockopt could be called like this:
- * optval = sock.getsockopt(Socket::SOL_SOCKET,Socket::SO_REUSEADDR)
- * optval = optval.unpack "i"
- * reuseaddr = optval[0] == 0 ? false : true
- *
- * Some socket options are integers with numeric values, in this case
- * #getsockopt could be called like this:
- * optval = sock.getsockopt(Socket::IPPROTO_IP, Socket::IP_TTL)
- * ipttl = optval.unpack("i")[0]
- *
- * Option values may be structs. Decoding them can be complex as it involves
- * examining your system headers to determine the correct definition. An
- * example is a +struct linger+, which may be defined in your system headers
- * as:
- * struct linger {
- * int l_onoff;
- * int l_linger;
- * };
- *
- * In this case #getsockopt could be called like this:
- * optval = sock.getsockopt(Socket::SOL_SOCKET, Socket::SO_LINGER)
- * onoff, linger = optval.unpack "ii"
-*/
-static VALUE
-bsock_getsockopt(VALUE sock, VALUE lev, VALUE optname)
-{
- int level, option;
- socklen_t len;
- char *buf;
- rb_io_t *fptr;
- int family;
-
- GetOpenFile(sock, fptr);
- family = rsock_getfamily(fptr->fd);
- level = rsock_level_arg(family, lev);
- option = rsock_optname_arg(family, level, optname);
- len = 256;
- buf = ALLOCA_N(char,len);
-
- rb_io_check_closed(fptr);
-
- if (getsockopt(fptr->fd, level, option, buf, &len) < 0)
- rb_sys_fail_path(fptr->pathv);
-
- return rsock_sockopt_new(family, level, option, rb_str_new(buf, len));
-}
-#else
-#define bsock_getsockopt rb_f_notimplement
-#endif
-
-/*
- * call-seq:
- * basicsocket.getsockname => sockaddr
- *
- * Returns the local address of the socket as a sockaddr string.
- *
- * TCPServer.open("127.0.0.1", 15120) {|serv|
- * p serv.getsockname #=> "\x02\x00;\x10\x7F\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00"
- * }
- */
-static VALUE
-bsock_getsockname(VALUE sock)
-{
- struct sockaddr_storage buf;
- socklen_t len = sizeof buf;
- rb_io_t *fptr;
-
- GetOpenFile(sock, fptr);
- if (getsockname(fptr->fd, (struct sockaddr*)&buf, &len) < 0)
- rb_sys_fail("getsockname(2)");
- return rb_str_new((char*)&buf, len);
-}
-
-/*
- * call-seq:
- * basicsocket.getpeername => sockaddr
- *
- * Returns the remote address of the socket as a sockaddr string.
- *
- * TCPServer.open("127.0.0.1", 1440) {|serv|
- * c = TCPSocket.new("127.0.0.1", 1440)
- * s = serv.accept
- * p s.getpeername #=> "\x02\x00\x82u\x7F\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00"
- * }
- *
- */
-static VALUE
-bsock_getpeername(VALUE sock)
-{
- struct sockaddr_storage buf;
- socklen_t len = sizeof buf;
- rb_io_t *fptr;
-
- GetOpenFile(sock, fptr);
- if (getpeername(fptr->fd, (struct sockaddr*)&buf, &len) < 0)
- rb_sys_fail("getpeername(2)");
- return rb_str_new((char*)&buf, len);
-}
-
-#if defined(HAVE_GETPEEREID) || defined(SO_PEERCRED) || defined(HAVE_GETPEERUCRED)
-/*
- * call-seq:
- * basicsocket.getpeereid => [euid, egid]
- *
- * Returns the user and group on the peer of the UNIX socket.
- * The result is a two element array which contains the effective uid and the effective gid.
- *
- * Socket.unix_server_loop("/tmp/sock") {|s|
- * begin
- * euid, egid = s.getpeereid
- *
- * # Check the connected client is myself or not.
- * next if euid != Process.uid
- *
- * # do something about my resource.
- *
- * ensure
- * s.close
- * end
- * }
- *
- */
-static VALUE
-bsock_getpeereid(VALUE self)
-{
-#if defined(HAVE_GETPEEREID)
- rb_io_t *fptr;
- uid_t euid;
- gid_t egid;
- GetOpenFile(self, fptr);
- if (getpeereid(fptr->fd, &euid, &egid) == -1)
- rb_sys_fail("getpeereid");
- return rb_assoc_new(UIDT2NUM(euid), GIDT2NUM(egid));
-#elif defined(SO_PEERCRED) /* GNU/Linux */
- rb_io_t *fptr;
- struct ucred cred;
- socklen_t len = sizeof(cred);
- GetOpenFile(self, fptr);
- if (getsockopt(fptr->fd, SOL_SOCKET, SO_PEERCRED, &cred, &len) == -1)
- rb_sys_fail("getsockopt(SO_PEERCRED)");
- return rb_assoc_new(UIDT2NUM(cred.uid), GIDT2NUM(cred.gid));
-#elif defined(HAVE_GETPEERUCRED) /* Solaris */
- rb_io_t *fptr;
- ucred_t *uc = NULL;
- VALUE ret;
- GetOpenFile(self, fptr);
- if (getpeerucred(fptr->fd, &uc) == -1)
- rb_sys_fail("getpeerucred");
- ret = rb_assoc_new(UIDT2NUM(ucred_geteuid(uc)), GIDT2NUM(ucred_getegid(uc)));
- ucred_free(uc);
- return ret;
-#endif
-}
-#else
-#define bsock_getpeereid rb_f_notimplement
-#endif
-
-/*
- * call-seq:
- * bsock.local_address => addrinfo
- *
- * Returns an Addrinfo object for local address obtained by getsockname.
- *
- * Note that addrinfo.protocol is filled by 0.
- *
- * TCPServer.open("127.0.0.1", 1512) {|serv|
- * p serv.local_address #=> #<Addrinfo: 127.0.0.1:1512 TCP>
- * }
- *
- */
-static VALUE
-bsock_local_address(VALUE sock)
-{
- struct sockaddr_storage buf;
- socklen_t len = sizeof buf;
- rb_io_t *fptr;
-
- GetOpenFile(sock, fptr);
- if (getsockname(fptr->fd, (struct sockaddr*)&buf, &len) < 0)
- rb_sys_fail("getsockname(2)");
- return rsock_fd_socket_addrinfo(fptr->fd, (struct sockaddr *)&buf, len);
-}
-
-/*
- * call-seq:
- * bsock.remote_address => addrinfo
- *
- * Returns an Addrinfo object for remote address obtained by getpeername.
- *
- * Note that addrinfo.protocol is filled by 0.
- *
- * TCPServer.open("127.0.0.1", 1728) {|serv|
- * c = TCPSocket.new("127.0.0.1", 1728)
- * s = serv.accept
- * p s.remote_address #=> #<Addrinfo: 127.0.0.1:36504 TCP>
- * }
- *
- */
-static VALUE
-bsock_remote_address(VALUE sock)
-{
- struct sockaddr_storage buf;
- socklen_t len = sizeof buf;
- rb_io_t *fptr;
-
- GetOpenFile(sock, fptr);
- if (getpeername(fptr->fd, (struct sockaddr*)&buf, &len) < 0)
- rb_sys_fail("getpeername(2)");
- return rsock_fd_socket_addrinfo(fptr->fd, (struct sockaddr *)&buf, len);
-}
-
-/*
- * call-seq:
- * basicsocket.send(mesg, flags [, sockaddr_to]) => numbytes_sent
- *
- * send _mesg_ via _basicsocket_.
- *
- * _mesg_ should be a string.
- *
- * _flags_ should be a bitwise OR of Socket::MSG_* constants.
- *
- * _sockaddr_to_ should be a packed sockaddr string or an addrinfo.
- *
- * TCPSocket.open("localhost", 80) {|s|
- * s.send "GET / HTTP/1.0\r\n\r\n", 0
- * p s.read
- * }
- */
-VALUE
-rsock_bsock_send(int argc, VALUE *argv, VALUE sock)
-{
- struct rsock_send_arg arg;
- VALUE flags, to;
- rb_io_t *fptr;
- int n;
- rb_blocking_function_t *func;
-
- rb_secure(4);
- rb_scan_args(argc, argv, "21", &arg.mesg, &flags, &to);
-
- StringValue(arg.mesg);
- if (!NIL_P(to)) {
- SockAddrStringValue(to);
- to = rb_str_new4(to);
- arg.to = (struct sockaddr *)RSTRING_PTR(to);
- arg.tolen = RSTRING_LEN(to);
- func = rsock_sendto_blocking;
- }
- else {
- func = rsock_send_blocking;
- }
- GetOpenFile(sock, fptr);
- arg.fd = fptr->fd;
- arg.flags = NUM2INT(flags);
- while (rb_thread_fd_writable(arg.fd),
- (n = (int)BLOCKING_REGION(func, &arg)) < 0) {
- if (rb_io_wait_writable(arg.fd)) {
- continue;
- }
- rb_sys_fail("send(2)");
- }
- return INT2FIX(n);
-}
-
-/*
- * call-seq:
- * basicsocket.do_not_reverse_lookup => true or false
- *
- * Gets the do_not_reverse_lookup flag of _basicsocket_.
- *
- * TCPSocket.open("www.ruby-lang.org", 80) {|sock|
- * p sock.do_not_reverse_lookup #=> false
- * p sock.peeraddr #=> ["AF_INET", 80, "carbon.ruby-lang.org", "221.186.184.68"]
- * sock.do_not_reverse_lookup = true
- * p sock.peeraddr #=> ["AF_INET", 80, "221.186.184.68", "221.186.184.68"]
- * }
- */
-static VALUE
-bsock_do_not_reverse_lookup(VALUE sock)
-{
- rb_io_t *fptr;
-
- GetOpenFile(sock, fptr);
- return (fptr->mode & FMODE_NOREVLOOKUP) ? Qtrue : Qfalse;
-}
-
-/*
- * call-seq:
- * basicsocket.do_not_reverse_lookup = bool
- *
- * Sets the do_not_reverse_lookup flag of _basicsocket_.
- *
- * BasicSocket.do_not_reverse_lookup = false
- * p TCPSocket.new("127.0.0.1", 80).do_not_reverse_lookup #=> false
- * BasicSocket.do_not_reverse_lookup = true
- * p TCPSocket.new("127.0.0.1", 80).do_not_reverse_lookup #=> true
- *
- */
-static VALUE
-bsock_do_not_reverse_lookup_set(VALUE sock, VALUE state)
-{
- rb_io_t *fptr;
-
- rb_secure(4);
- GetOpenFile(sock, fptr);
- if (RTEST(state)) {
- fptr->mode |= FMODE_NOREVLOOKUP;
- }
- else {
- fptr->mode &= ~FMODE_NOREVLOOKUP;
- }
- return sock;
-}
-
-/*
- * call-seq:
- * basicsocket.recv(maxlen) => mesg
- * basicsocket.recv(maxlen, flags) => mesg
- *
- * Receives a message.
- *
- * _maxlen_ is the maximum number of bytes to receive.
- *
- * _flags_ should be a bitwise OR of Socket::MSG_* constants.
- *
- * UNIXSocket.pair {|s1, s2|
- * s1.puts "Hello World"
- * p s2.recv(4) #=> "Hell"
- * p s2.recv(4, Socket::MSG_PEEK) #=> "o Wo"
- * p s2.recv(4) #=> "o Wo"
- * p s2.recv(10) #=> "rld\n"
- * }
- */
-static VALUE
-bsock_recv(int argc, VALUE *argv, VALUE sock)
-{
- return rsock_s_recvfrom(sock, argc, argv, RECV_RECV);
-}
-
-/*
- * call-seq:
- * basicsocket.recv_nonblock(maxlen) => mesg
- * basicsocket.recv_nonblock(maxlen, flags) => mesg
- *
- * Receives up to _maxlen_ bytes from +socket+ using recvfrom(2) after
- * O_NONBLOCK is set for the underlying file descriptor.
- * _flags_ is zero or more of the +MSG_+ options.
- * The result, _mesg_, is the data received.
- *
- * When recvfrom(2) returns 0, Socket#recv_nonblock returns
- * an empty string as data.
- * The meaning depends on the socket: EOF on TCP, empty packet on UDP, etc.
- *
- * === Parameters
- * * +maxlen+ - the number of bytes to receive from the socket
- * * +flags+ - zero or more of the +MSG_+ options
- *
- * === Example
- * serv = TCPServer.new("127.0.0.1", 0)
- * af, port, host, addr = serv.addr
- * c = TCPSocket.new(addr, port)
- * s = serv.accept
- * c.send "aaa", 0
- * begin # emulate blocking recv.
- * p s.recv_nonblock(10) #=> "aaa"
- * rescue IO::WaitReadable
- * IO.select([s])
- * retry
- * end
- *
- * Refer to Socket#recvfrom for the exceptions that may be thrown if the call
- * to _recv_nonblock_ fails.
- *
- * BasicSocket#recv_nonblock may raise any error corresponding to recvfrom(2) failure,
- * including Errno::EWOULDBLOCK.
- *
- * If the exception is Errno::EWOULDBLOCK or Errno::AGAIN,
- * it is extended by IO::WaitReadable.
- * So IO::WaitReadable can be used to rescue the exceptions for retrying recv_nonblock.
- *
- * === See
- * * Socket#recvfrom
- */
-
-static VALUE
-bsock_recv_nonblock(int argc, VALUE *argv, VALUE sock)
-{
- return rsock_s_recvfrom_nonblock(sock, argc, argv, RECV_RECV);
-}
-
-/*
- * call-seq:
- * BasicSocket.do_not_reverse_lookup => true or false
- *
- * Gets the global do_not_reverse_lookup flag.
- *
- * BasicSocket.do_not_reverse_lookup #=> false
- */
-static VALUE
-bsock_do_not_rev_lookup(void)
-{
- return rsock_do_not_reverse_lookup?Qtrue:Qfalse;
-}
-
-/*
- * call-seq:
- * BasicSocket.do_not_reverse_lookup = bool
- *
- * Sets the global do_not_reverse_lookup flag.
- *
- * The flag is used for initial value of do_not_reverse_lookup for each socket.
- *
- * s1 = TCPSocket.new("localhost", 80)
- * p s1.do_not_reverse_lookup #=> true
- * BasicSocket.do_not_reverse_lookup = false
- * s2 = TCPSocket.new("localhost", 80)
- * p s2.do_not_reverse_lookup #=> false
- * p s1.do_not_reverse_lookup #=> true
- *
- */
-static VALUE
-bsock_do_not_rev_lookup_set(VALUE self, VALUE val)
-{
- rb_secure(4);
- rsock_do_not_reverse_lookup = RTEST(val);
- return val;
-}
-
-/*
- * BasicSocket class
- */
-void
-Init_basicsocket(void)
-{
- rb_cBasicSocket = rb_define_class("BasicSocket", rb_cIO);
- rb_undef_method(rb_cBasicSocket, "initialize");
-
- rb_define_singleton_method(rb_cBasicSocket, "do_not_reverse_lookup",
- bsock_do_not_rev_lookup, 0);
- rb_define_singleton_method(rb_cBasicSocket, "do_not_reverse_lookup=",
- bsock_do_not_rev_lookup_set, 1);
- rb_define_singleton_method(rb_cBasicSocket, "for_fd", bsock_s_for_fd, 1);
-
- rb_define_method(rb_cBasicSocket, "close_read", bsock_close_read, 0);
- rb_define_method(rb_cBasicSocket, "close_write", bsock_close_write, 0);
- rb_define_method(rb_cBasicSocket, "shutdown", bsock_shutdown, -1);
- rb_define_method(rb_cBasicSocket, "setsockopt", bsock_setsockopt, -1);
- rb_define_method(rb_cBasicSocket, "getsockopt", bsock_getsockopt, 2);
- rb_define_method(rb_cBasicSocket, "getsockname", bsock_getsockname, 0);
- rb_define_method(rb_cBasicSocket, "getpeername", bsock_getpeername, 0);
- rb_define_method(rb_cBasicSocket, "getpeereid", bsock_getpeereid, 0);
- rb_define_method(rb_cBasicSocket, "local_address", bsock_local_address, 0);
- 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);
-}
diff --git a/ext/socket/constants.c b/ext/socket/constants.c
deleted file mode 100644
index 4350a127d5..0000000000
--- a/ext/socket/constants.c
+++ /dev/null
@@ -1,146 +0,0 @@
-/************************************************
-
- constants.c -
-
- created at: Thu Mar 31 12:21:29 JST 1994
-
- Copyright (C) 1993-2007 Yukihiro Matsumoto
-
-************************************************/
-
-#include "rubysocket.h"
-
-static VALUE rb_mSockConst;
-
-#include "constdefs.c"
-
-static int
-constant_arg(VALUE arg, int (*str_to_int)(const char*, int, int*), const char *errmsg)
-{
- VALUE tmp;
- char *ptr;
- int ret;
-
- if (SYMBOL_P(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);
- }
- else {
- ret = NUM2INT(arg);
- }
- return ret;
-}
-
-int
-rsock_family_arg(VALUE domain)
-{
- /* convert AF_INET, etc. */
- return constant_arg(domain, rsock_family_to_int, "unknown socket domain");
-}
-
-int
-rsock_socktype_arg(VALUE type)
-{
- /* convert SOCK_STREAM, etc. */
- return constant_arg(type, rsock_socktype_to_int, "unknown socket type");
-}
-
-int
-rsock_level_arg(int family, VALUE level)
-{
- /* convert SOL_SOCKET, IPPROTO_TCP, etc. */
- if (IS_IP_FAMILY(family)) {
- return constant_arg(level, rsock_ip_level_to_int, "unknown protocol level");
- }
- else {
- return constant_arg(level, rsock_unknown_level_to_int, "unknown protocol level");
- }
-}
-
-int
-rsock_optname_arg(int family, int level, VALUE optname)
-{
- if (IS_IP_FAMILY(family)) {
- switch (level) {
- case SOL_SOCKET:
- return constant_arg(optname, rsock_so_optname_to_int, "unknown socket level option name");
- case IPPROTO_IP:
- return constant_arg(optname, rsock_ip_optname_to_int, "unknown IP level option name");
-#ifdef IPPROTO_IPV6
- case IPPROTO_IPV6:
- return constant_arg(optname, rsock_ipv6_optname_to_int, "unknown IPv6 level option name");
-#endif
- case IPPROTO_TCP:
- return constant_arg(optname, rsock_tcp_optname_to_int, "unknown TCP level option name");
- case IPPROTO_UDP:
- return constant_arg(optname, rsock_udp_optname_to_int, "unknown UDP level option name");
- default:
- return NUM2INT(optname);
- }
- }
- else {
- switch (level) {
- case SOL_SOCKET:
- return constant_arg(optname, rsock_so_optname_to_int, "unknown socket level option name");
- default:
- return NUM2INT(optname);
- }
- }
-}
-
-int
-rsock_cmsg_type_arg(int family, int level, VALUE type)
-{
- if (IS_IP_FAMILY(family)) {
- switch (level) {
- case SOL_SOCKET:
- return constant_arg(type, rsock_scm_optname_to_int, "unknown UNIX control message");
- case IPPROTO_IP:
- return constant_arg(type, rsock_ip_optname_to_int, "unknown IP control message");
-#ifdef INET6
- case IPPROTO_IPV6:
- return constant_arg(type, rsock_ipv6_optname_to_int, "unknown IPv6 control message");
-#endif
- case IPPROTO_TCP:
- return constant_arg(type, rsock_tcp_optname_to_int, "unknown TCP control message");
- case IPPROTO_UDP:
- return constant_arg(type, rsock_udp_optname_to_int, "unknown UDP control message");
- default:
- return NUM2INT(type);
- }
- }
- else {
- switch (level) {
- case SOL_SOCKET:
- return constant_arg(type, rsock_scm_optname_to_int, "unknown UNIX control message");
- default:
- return NUM2INT(type);
- }
- }
-}
-
-int
-rsock_shutdown_how_arg(VALUE how)
-{
- /* convert SHUT_RD, SHUT_WR, SHUT_RDWR. */
- return constant_arg(how, rsock_shutdown_how_to_int, "unknown shutdown argument");
-}
-
-/*
- * Socket::Constants module
- */
-void
-Init_socket_constants(void)
-{
- /* constants */
- rb_mSockConst = rb_define_module_under(rb_cSocket, "Constants");
- init_constants();
-}
diff --git a/ext/socket/depend b/ext/socket/depend
index 000a013c5f..cca6d4e62a 100644
--- a/ext/socket/depend
+++ b/ext/socket/depend
@@ -1,25 +1,3 @@
-SOCK_HEADERS = $(srcdir)/rubysocket.h $(hdrdir)/ruby/ruby.h $(arch_hdrdir)/ruby/config.h \
- $(hdrdir)/ruby/defines.h $(hdrdir)/ruby/io.h \
- $(srcdir)/sockport.h constdefs.h
-
-init.o: init.c $(SOCK_HEADERS)
-constants.o: constants.c constdefs.c $(SOCK_HEADERS)
-basicsocket.o: basicsocket.c $(SOCK_HEADERS)
-socket.o: socket.c $(SOCK_HEADERS)
-ipsocket.o: ipsocket.c $(SOCK_HEADERS)
-tcpsocket.o: tcpsocket.c $(SOCK_HEADERS)
-tcpserver.o: tcpserver.c $(SOCK_HEADERS)
-sockssocket.o: sockssocket.c $(SOCK_HEADERS)
-udpsocket.o: udpsocket.c $(SOCK_HEADERS)
-unixsocket.o: unixsocket.c $(SOCK_HEADERS)
-unixserver.o: unixserver.c $(SOCK_HEADERS)
-option.o: option.c $(SOCK_HEADERS)
-ancdata.o: ancdata.c $(SOCK_HEADERS)
-raddrinfo.o: raddrinfo.c $(SOCK_HEADERS)
-
-getnameinfo.o: getnameinfo.c $(arch_hdrdir)/ruby/config.h addrinfo.h sockport.h
-getaddrinfo.o: getaddrinfo.c $(arch_hdrdir)/ruby/config.h addrinfo.h sockport.h
-
-constdefs.h constdefs.c : $(srcdir)/mkconstants.rb
- @echo "generating constant definitions"
- @$(RUBY) $(srcdir)/mkconstants.rb -H constdefs.h -o constdefs.c
+socket.o : socket.c $(hdrdir)/ruby.h $(topdir)/config.h $(hdrdir)/defines.h $(hdrdir)/rubyio.h $(hdrdir)/rubysig.h sockport.h
+getnameinfo.o: getnameinfo.c $(topdir)/config.h addrinfo.h sockport.h
+getaddrinfo.o: getaddrinfo.c $(topdir)/config.h addrinfo.h sockport.h
diff --git a/ext/socket/extconf.rb b/ext/socket/extconf.rb
index 79c9d30b36..ece615865f 100644
--- a/ext/socket/extconf.rb
+++ b/ext/socket/extconf.rb
@@ -1,17 +1,22 @@
require 'mkmf'
case RUBY_PLATFORM
-when /(ms|bcc)win32|mingw/
+when /bccwin32/
test_func = "WSACleanup"
have_library("ws2_32", "WSACleanup")
+when /mswin32|mingw/
+ test_func = "WSACleanup"
+ if with_config("winsock2")
+ have_library("ws2_32", "WSACleanup")
+ else
+ have_library("wsock32", "WSACleanup")
+ end
when /cygwin/
test_func = "socket"
when /beos/
test_func = "socket"
have_library("net", "socket")
-when /haiku/
- test_func = "socket"
- have_library("network", "socket")
+ have_func("closesocket")
when /i386-os2_emx/
test_func = "socket"
have_library("socket", "socket")
@@ -33,12 +38,11 @@ if have_header("arpa/inet.h")
end
ipv6 = false
-default_ipv6 = /cygwin|beos|haiku/ !~ RUBY_PLATFORM
+default_ipv6 = /cygwin/ !~ RUBY_PLATFORM
if enable_config("ipv6", default_ipv6)
if checking_for("ipv6") {try_link(<<EOF)}
#include <sys/types.h>
#include <sys/socket.h>
-int
main()
{
socket(AF_INET6, SOCK_STREAM, 0);
@@ -90,10 +94,17 @@ if have_struct_member("struct sockaddr_in", "sin_len", headers)
end
# doug's fix, NOW add -Dss_family... only if required!
-doug = proc {have_struct_member("struct sockaddr_storage", "ss_family", headers)}
-if (doug[] or
- with_cppflags($CPPFLAGS + " -Dss_family=__ss_family -Dss_len=__ss_len", &doug))
- $defs[-1] = "-DHAVE_SOCKADDR_STORAGE"
+[nil, " -Dss_family=__ss_family -Dss_len=__ss_len"].each do |flags|
+ if flags
+ cppflags = $CPPFLAGS
+ $CPPFLAGS += flags
+ end
+ if have_struct_member("struct sockaddr_storage", "ss_family", headers)
+ $defs[-1] = "-DHAVE_SOCKADDR_STORAGE"
+ break
+ elsif flags
+ $CPPFLAGS = cppflags
+ end
end
if have_struct_member("struct sockaddr", "sa_len", headers)
@@ -124,17 +135,11 @@ getaddr_info_ok = enable_config("wide-getaddrinfo") do
#define AF_LOCAL AF_UNIX
#endif
-int
main()
{
int passive, gaierr, inet4 = 0, inet6 = 0;
struct addrinfo hints, *ai, *aitop;
char straddr[INET6_ADDRSTRLEN], strport[16];
-#ifdef _WIN32
- WSADATA retdata;
-
- WSAStartup(MAKEWORD(2, 0), &retdata);
-#endif
for (passive = 0; passive <= 1; passive++) {
memset(&hints, 0, sizeof(hints));
@@ -242,31 +247,15 @@ Fatal: invalid value for --with-lookup-order-hack (expected INET, INET6 or UNSPE
EOS
end
-$objs = [
- "init.#{$OBJEXT}",
- "constants.#{$OBJEXT}",
- "basicsocket.#{$OBJEXT}",
- "socket.#{$OBJEXT}",
- "ipsocket.#{$OBJEXT}",
- "tcpsocket.#{$OBJEXT}",
- "tcpserver.#{$OBJEXT}",
- "sockssocket.#{$OBJEXT}",
- "udpsocket.#{$OBJEXT}",
- "unixsocket.#{$OBJEXT}",
- "unixserver.#{$OBJEXT}",
- "option.#{$OBJEXT}",
- "ancdata.#{$OBJEXT}",
- "raddrinfo.#{$OBJEXT}"
-]
+$objs = ["socket.#{$OBJEXT}"]
-unless getaddr_info_ok and have_func("getnameinfo", headers) and have_func("getaddrinfo", headers)
+unless getaddr_info_ok and have_func("getnameinfo", "netdb.h") and have_func("getaddrinfo", "netdb.h")
if have_struct_member("struct in6_addr", "s6_addr8", headers)
$defs[-1] = "-DHAVE_ADDR8"
end
$CPPFLAGS="-I. "+$CPPFLAGS
$objs += ["getaddrinfo.#{$OBJEXT}"]
$objs += ["getnameinfo.#{$OBJEXT}"]
- $defs << "-DGETADDRINFO_EMU"
have_func("inet_ntop") or have_func("inet_ntoa")
have_func("inet_pton") or have_func("inet_aton")
have_func("getservbyport")
@@ -287,42 +276,12 @@ EOF
have_header("resolv.h")
end
-have_header("ifaddrs.h")
-have_func("getifaddrs")
-have_header("sys/ioctl.h")
-have_header("sys/sockio.h")
-have_header("net/if.h", headers)
-
-have_header("sys/param.h", headers)
-have_header("sys/ucred.h", headers)
-
unless have_type("socklen_t", headers)
$defs << "-Dsocklen_t=int"
end
have_header("sys/un.h")
have_header("sys/uio.h")
-have_type("struct in_pktinfo", headers) {|src|
- src.sub(%r'^/\*top\*/', '\1'"\n#if defined(IPPROTO_IP) && defined(IP_PKTINFO)") <<
- "#else\n" << "#error\n" << ">>>>>> no in_pktinfo <<<<<<\n" << "#endif\n"
-}
-have_type("struct in6_pktinfo", headers) {|src|
- src.sub(%r'^/\*top\*/', '\1'"\n#if defined(IPPROTO_IPV6) && defined(IPV6_PKTINFO)") <<
- "#else\n" << "#error\n" << ">>>>>> no in6_pktinfo <<<<<<\n" << "#endif\n"
-}
-if have_struct_member("struct in_pktinfo", "ipi_spec_dst", headers)
- $defs[-1] = "-DHAVE_IPI_SPEC_DST"
-end
-
-have_type("struct sockcred", headers)
-have_type("struct cmsgcred", headers)
-
-have_func("getpeereid")
-
-have_header("ucred.h", headers)
-have_func("getpeerucred")
-
-$distcleanfiles << "constants.h" << "constdefs.*"
if have_func(test_func)
have_func("hsterror")
diff --git a/ext/socket/getaddrinfo.c b/ext/socket/getaddrinfo.c
index 53656b4c02..9b82296dba 100644
--- a/ext/socket/getaddrinfo.c
+++ b/ext/socket/getaddrinfo.c
@@ -38,14 +38,14 @@
* - PF_UNSPEC case would be handled in getipnodebyname() with the AI_ALL flag.
*/
-#include "ruby/config.h"
+#include "config.h"
#ifdef RUBY_EXTCONF_H
#include RUBY_EXTCONF_H
#endif
#include <sys/types.h>
-#ifndef _WIN32
+#if !defined(_WIN32) && !defined(__VMS)
#include <sys/param.h>
-#if defined(__BEOS__) && !defined(__HAIKU__) && !defined(BONE)
+#if defined(__BEOS__)
# include <net/socket.h>
#else
# include <sys/socket.h>
@@ -65,9 +65,13 @@
#include <resolv.h>
#endif
#include <unistd.h>
+#elif defined(__VMS )
+#include <socket.h>
+#include <inet.h>
+#include <in.h>
+#include <netdb.h>
#else
#include <winsock2.h>
-#include <ws2tcpip.h>
#include <io.h>
#endif
#include <string.h>
@@ -203,7 +207,8 @@ if (pai->ai_flags & AI_CANONNAME) {\
const
#endif
char *
-gai_strerror(int ecode)
+gai_strerror(ecode)
+ int ecode;
{
if (ecode < 0 || ecode > EAI_MAX)
ecode = EAI_MAX;
@@ -212,7 +217,8 @@ gai_strerror(int ecode)
#endif
void
-freeaddrinfo(struct addrinfo *ai)
+freeaddrinfo(ai)
+ struct addrinfo *ai;
{
struct addrinfo *next;
@@ -226,7 +232,8 @@ freeaddrinfo(struct addrinfo *ai)
}
static int
-str_isnumber(const char *p)
+str_isnumber(p)
+ const char *p;
{
char *q = (char *)p;
while (*q) {
@@ -240,7 +247,10 @@ str_isnumber(const char *p)
#ifndef HAVE_INET_PTON
static int
-inet_pton(int af, const char *hostname, void *pton)
+inet_pton(af, hostname, pton)
+ int af;
+ const char *hostname;
+ void *pton;
{
struct in_addr in;
@@ -268,7 +278,10 @@ inet_pton(int af, const char *hostname, void *pton)
#endif
int
-getaddrinfo(const char *hostname, const char *servname, const struct addrinfo *hints, struct addrinfo **res)
+getaddrinfo(hostname, servname, hints, res)
+ const char *hostname, *servname;
+ const struct addrinfo *hints;
+ struct addrinfo **res;
{
struct addrinfo sentinel;
struct addrinfo *top = NULL;
@@ -378,8 +391,6 @@ getaddrinfo(const char *hostname, const char *servname, const struct addrinfo *h
pai->ai_protocol = IPPROTO_UDP;
}
port = htons((unsigned short)atoi(servname));
- } else if (pai->ai_flags & AI_NUMERICSERV) {
- ERR(EAI_NONAME);
} else {
struct servent *sp;
const char *proto;
@@ -436,7 +447,7 @@ 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__)
+#if defined(HAVE_CLOSESOCKET)
closesocket(s);
#else
close(s);
@@ -537,7 +548,13 @@ getaddrinfo(const char *hostname, const char *servname, const struct addrinfo *h
}
static int
-get_name(const char *addr, const struct afd *afd, struct addrinfo **res, char *numaddr, struct addrinfo *pai, int port0)
+get_name(addr, afd, res, numaddr, pai, port0)
+ const char *addr;
+ const struct afd *afd;
+ struct addrinfo **res;
+ char *numaddr;
+ struct addrinfo *pai;
+ int port0;
{
u_short port = port0 & 0xffff;
struct hostent *hp;
@@ -577,7 +594,12 @@ get_name(const char *addr, const struct afd *afd, struct addrinfo **res, char *n
}
static int
-get_addr(const char *hostname, int af, struct addrinfo **res, struct addrinfo *pai, int port0)
+get_addr(hostname, af, res, pai, port0)
+ const char *hostname;
+ int af;
+ struct addrinfo **res;
+ struct addrinfo *pai;
+ int port0;
{
u_short port = port0 & 0xffff;
struct addrinfo sentinel;
diff --git a/ext/socket/getnameinfo.c b/ext/socket/getnameinfo.c
index 689b91c291..66f7e8818a 100644
--- a/ext/socket/getnameinfo.c
+++ b/ext/socket/getnameinfo.c
@@ -34,11 +34,11 @@
* but INRIA implementation returns EAI_xxx defined for getaddrinfo().
*/
-#include "ruby/config.h"
+#include "config.h"
#include <stdio.h>
#include <sys/types.h>
#ifndef _WIN32
-#if defined(__BEOS__) && !defined(__HAIKU__) && !defined(BONE)
+#if defined(__BEOS__)
# include <net/socket.h>
#else
# include <sys/socket.h>
@@ -57,7 +57,6 @@
#endif
#ifdef _WIN32
#include <winsock2.h>
-#include <ws2tcpip.h>
#define snprintf _snprintf
#endif
@@ -111,12 +110,13 @@ static struct afd {
#define ENI_FAMILY 5
#define ENI_SALEN 6
-#ifdef __HAIKU__
-#define HAVE_INET_NTOP
-#endif
#ifndef HAVE_INET_NTOP
static const char *
-inet_ntop(int af, const void *addr, char *numaddr, size_t numaddr_len)
+inet_ntop(af, addr, numaddr, numaddr_len)
+ int af;
+ const void *addr;
+ char *numaddr;
+ size_t numaddr_len;
{
#ifdef HAVE_INET_NTOA
struct in_addr in;
@@ -133,9 +133,17 @@ inet_ntop(int af, const void *addr, char *numaddr, size_t numaddr_len)
#endif
int
-getnameinfo(const struct sockaddr *sa, size_t salen, char *host, size_t hostlen, char *serv, size_t servlen, int flags)
+getnameinfo(sa, salen, host, hostlen, serv, servlen, flags)
+ const struct sockaddr *sa;
+ size_t salen;
+ char *host;
+ size_t hostlen;
+ char *serv;
+ size_t servlen;
+ int flags;
{
struct afd *afd;
+ struct servent *sp;
struct hostent *hp;
u_short port;
int family, len, i;
@@ -177,7 +185,7 @@ getnameinfo(const struct sockaddr *sa, size_t salen, char *host, size_t hostlen,
strcpy(serv, numserv);
} else {
#if defined(HAVE_GETSERVBYPORT)
- struct servent *sp = getservbyport(port, (flags & NI_DGRAM) ? "udp" : "tcp");
+ sp = getservbyport(port, (flags & NI_DGRAM) ? "udp" : "tcp");
if (sp) {
if (strlen(sp->s_name) + 1 > servlen)
return ENI_MEMORY;
diff --git a/ext/socket/init.c b/ext/socket/init.c
deleted file mode 100644
index ed85e0b503..0000000000
--- a/ext/socket/init.c
+++ /dev/null
@@ -1,558 +0,0 @@
-/************************************************
-
- init.c -
-
- created at: Thu Mar 31 12:21:29 JST 1994
-
- Copyright (C) 1993-2007 Yukihiro Matsumoto
-
-************************************************/
-
-#include "rubysocket.h"
-
-VALUE rb_cBasicSocket;
-VALUE rb_cIPSocket;
-VALUE rb_cTCPSocket;
-VALUE rb_cTCPServer;
-VALUE rb_cUDPSocket;
-#ifdef AF_UNIX
-VALUE rb_cUNIXSocket;
-VALUE rb_cUNIXServer;
-#endif
-VALUE rb_cSocket;
-VALUE rb_cAddrinfo;
-
-VALUE rb_eSocket;
-
-#ifdef SOCKS
-VALUE rb_cSOCKSSocket;
-#endif
-
-int rsock_do_not_reverse_lookup = 0;
-
-void
-rsock_raise_socket_error(const char *reason, int error)
-{
-#ifdef EAI_SYSTEM
- if (error == EAI_SYSTEM) rb_sys_fail(reason);
-#endif
- rb_raise(rb_eSocket, "%s: %s", reason, gai_strerror(error));
-}
-
-VALUE
-rsock_init_sock(VALUE sock, int fd)
-{
- rb_io_t *fp;
-
- MakeOpenFile(sock, fp);
- fp->fd = fd;
- fp->mode = FMODE_READWRITE|FMODE_DUPLEX;
- rb_io_ascii8bit_binmode(sock);
- if (rsock_do_not_reverse_lookup) {
- fp->mode |= FMODE_NOREVLOOKUP;
- }
- rb_io_synchronized(fp);
-
- return sock;
-}
-
-VALUE
-rsock_sendto_blocking(void *data)
-{
- struct rsock_send_arg *arg = data;
- VALUE mesg = arg->mesg;
- return (VALUE)sendto(arg->fd, RSTRING_PTR(mesg), RSTRING_LEN(mesg),
- arg->flags, arg->to, arg->tolen);
-}
-
-VALUE
-rsock_send_blocking(void *data)
-{
- struct rsock_send_arg *arg = data;
- VALUE mesg = arg->mesg;
- return (VALUE)send(arg->fd, RSTRING_PTR(mesg), RSTRING_LEN(mesg),
- arg->flags);
-}
-
-struct recvfrom_arg {
- int fd, flags;
- VALUE str;
- socklen_t alen;
- struct sockaddr_storage buf;
-};
-
-static VALUE
-recvfrom_blocking(void *data)
-{
- struct recvfrom_arg *arg = data;
- return (VALUE)recvfrom(arg->fd, RSTRING_PTR(arg->str), RSTRING_LEN(arg->str),
- arg->flags, (struct sockaddr*)&arg->buf, &arg->alen);
-}
-
-VALUE
-rsock_s_recvfrom(VALUE sock, int argc, VALUE *argv, enum sock_recv_type from)
-{
- rb_io_t *fptr;
- VALUE str, klass;
- struct recvfrom_arg arg;
- VALUE len, flg;
- long buflen;
- long slen;
-
- rb_scan_args(argc, argv, "11", &len, &flg);
-
- if (flg == Qnil) arg.flags = 0;
- else arg.flags = NUM2INT(flg);
- buflen = NUM2INT(len);
-
- GetOpenFile(sock, fptr);
- if (rb_io_read_pending(fptr)) {
- rb_raise(rb_eIOError, "recv for buffered IO");
- }
- arg.fd = fptr->fd;
- arg.alen = sizeof(arg.buf);
-
- arg.str = str = rb_tainted_str_new(0, buflen);
- klass = RBASIC(str)->klass;
- RBASIC(str)->klass = 0;
-
- while (rb_io_check_closed(fptr),
- rb_thread_wait_fd(arg.fd),
- (slen = BLOCKING_REGION(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");
- }
- }
-
- RBASIC(str)->klass = klass;
- if (slen < RSTRING_LEN(str)) {
- rb_str_set_len(str, slen);
- }
- rb_obj_taint(str);
- switch (from) {
- case RECV_RECV:
- return str;
- case RECV_IP:
-#if 0
- if (arg.alen != sizeof(struct sockaddr_in)) {
- rb_raise(rb_eTypeError, "sockaddr size differs - should not happen");
- }
-#endif
- if (arg.alen && arg.alen != sizeof(arg.buf)) /* OSX doesn't return a from result for connection-oriented sockets */
- return rb_assoc_new(str, rsock_ipaddr((struct sockaddr*)&arg.buf, fptr->mode & FMODE_NOREVLOOKUP));
- else
- return rb_assoc_new(str, Qnil);
-
-#ifdef HAVE_SYS_UN_H
- case RECV_UNIX:
- return rb_assoc_new(str, rsock_unixaddr((struct sockaddr_un*)&arg.buf, arg.alen));
-#endif
- case RECV_SOCKET:
- return rb_assoc_new(str, rsock_io_socket_addrinfo(sock, (struct sockaddr*)&arg.buf, arg.alen));
- default:
- rb_bug("rsock_s_recvfrom called with bad value");
- }
-}
-
-VALUE
-rsock_s_recvfrom_nonblock(VALUE sock, int argc, VALUE *argv, enum sock_recv_type from)
-{
- rb_io_t *fptr;
- VALUE str;
- struct sockaddr_storage buf;
- socklen_t alen = sizeof buf;
- VALUE len, flg;
- long buflen;
- long slen;
- int fd, flags;
- VALUE addr = Qnil;
-
- rb_scan_args(argc, argv, "11", &len, &flg);
-
- if (flg == Qnil) flags = 0;
- else flags = NUM2INT(flg);
- buflen = NUM2INT(len);
-
-#ifdef MSG_DONTWAIT
- /* MSG_DONTWAIT avoids the race condition between fcntl and recvfrom.
- It is not portable, though. */
- flags |= MSG_DONTWAIT;
-#endif
-
- GetOpenFile(sock, fptr);
- if (rb_io_read_pending(fptr)) {
- rb_raise(rb_eIOError, "recvfrom for buffered IO");
- }
- fd = fptr->fd;
-
- str = rb_tainted_str_new(0, buflen);
-
- rb_io_check_closed(fptr);
- rb_io_set_nonblock(fptr);
- slen = recvfrom(fd, RSTRING_PTR(str), buflen, flags, (struct sockaddr*)&buf, &alen);
-
- if (slen < 0) {
- switch (errno) {
- case EAGAIN:
-#if defined(EWOULDBLOCK) && EWOULDBLOCK != EAGAIN
- case EWOULDBLOCK:
-#endif
- rb_mod_sys_fail(rb_mWaitReadable, "recvfrom(2) would block");
- }
- rb_sys_fail("recvfrom(2)");
- }
- if (slen < RSTRING_LEN(str)) {
- rb_str_set_len(str, slen);
- }
- rb_obj_taint(str);
- switch (from) {
- case RECV_RECV:
- return str;
-
- case RECV_IP:
- if (alen && alen != sizeof(buf)) /* connection-oriented socket may not return a from result */
- addr = rsock_ipaddr((struct sockaddr*)&buf, fptr->mode & FMODE_NOREVLOOKUP);
- break;
-
- case RECV_SOCKET:
- addr = rsock_io_socket_addrinfo(sock, (struct sockaddr*)&buf, alen);
- break;
-
- default:
- rb_bug("rsock_s_recvfrom_nonblock called with bad value");
- }
- return rb_assoc_new(str, addr);
-}
-
-int
-rsock_socket(int domain, int type, int proto)
-{
- int fd;
-
- fd = socket(domain, type, proto);
- if (fd < 0) {
- if (errno == EMFILE || errno == ENFILE) {
- rb_gc();
- fd = socket(domain, type, proto);
- }
- }
- return fd;
-}
-
-static int
-wait_connectable0(int fd, rb_fdset_t *fds_w, rb_fdset_t *fds_e)
-{
- int sockerr;
- socklen_t sockerrlen;
-
- for (;;) {
- rb_fd_zero(fds_w);
- rb_fd_zero(fds_e);
-
- rb_fd_set(fd, fds_w);
- rb_fd_set(fd, fds_e);
-
- rb_thread_select(fd+1, 0, rb_fd_ptr(fds_w), rb_fd_ptr(fds_e), 0);
-
- if (rb_fd_isset(fd, fds_w)) {
- return 0;
- }
- else if (rb_fd_isset(fd, fds_e)) {
- sockerrlen = sizeof(sockerr);
- if (getsockopt(fd, SOL_SOCKET, SO_ERROR, (void *)&sockerr,
- &sockerrlen) == 0) {
- if (sockerr == 0)
- continue; /* workaround for winsock */
- errno = sockerr;
- }
- return -1;
- }
- }
-}
-
-struct wait_connectable_arg {
- int fd;
- rb_fdset_t fds_w;
- rb_fdset_t fds_e;
-};
-
-#ifdef HAVE_RB_FD_INIT
-static VALUE
-try_wait_connectable(VALUE arg)
-{
- struct wait_connectable_arg *p = (struct wait_connectable_arg *)arg;
- return (VALUE)wait_connectable0(p->fd, &p->fds_w, &p->fds_e);
-}
-
-static VALUE
-wait_connectable_ensure(VALUE arg)
-{
- struct wait_connectable_arg *p = (struct wait_connectable_arg *)arg;
- rb_fd_term(&p->fds_w);
- rb_fd_term(&p->fds_e);
- return Qnil;
-}
-#endif
-
-static int
-wait_connectable(int fd)
-{
- struct wait_connectable_arg arg;
-
- rb_fd_init(&arg.fds_w);
- rb_fd_init(&arg.fds_e);
-#ifdef HAVE_RB_FD_INIT
- arg.fd = fd;
- return (int)rb_ensure(try_wait_connectable, (VALUE)&arg,
- wait_connectable_ensure,(VALUE)&arg);
-#else
- return wait_connectable0(fd, &arg.fds_w, &arg.fds_e);
-#endif
-}
-
-#ifdef __CYGWIN__
-#define WAIT_IN_PROGRESS 10
-#endif
-#ifdef __APPLE__
-#define WAIT_IN_PROGRESS 10
-#endif
-#ifdef __linux__
-/* returns correct error */
-#define WAIT_IN_PROGRESS 0
-#endif
-#ifndef WAIT_IN_PROGRESS
-/* BSD origin code apparently has a problem */
-#define WAIT_IN_PROGRESS 1
-#endif
-
-struct connect_arg {
- int fd;
- const struct sockaddr *sockaddr;
- socklen_t len;
-};
-
-static VALUE
-connect_blocking(void *data)
-{
- struct connect_arg *arg = data;
- return (VALUE)connect(arg->fd, arg->sockaddr, arg->len);
-}
-
-#if defined(SOCKS) && !defined(SOCKS5)
-static VALUE
-socks_connect_blocking(void *data)
-{
- struct connect_arg *arg = data;
- return (VALUE)Rconnect(arg->fd, arg->sockaddr, arg->len);
-}
-#endif
-
-int
-rsock_connect(int fd, const struct sockaddr *sockaddr, int len, int socks)
-{
- int status;
- rb_blocking_function_t *func = connect_blocking;
- struct connect_arg arg;
-#if WAIT_IN_PROGRESS > 0
- int wait_in_progress = -1;
- int sockerr;
- socklen_t sockerrlen;
-#endif
-
- arg.fd = fd;
- arg.sockaddr = sockaddr;
- arg.len = len;
-#if defined(SOCKS) && !defined(SOCKS5)
- if (socks) func = socks_connect_blocking;
-#endif
- for (;;) {
- status = (int)BLOCKING_REGION(func, &arg);
- if (status < 0) {
- switch (errno) {
- case EAGAIN:
-#ifdef EINPROGRESS
- case EINPROGRESS:
-#endif
-#if WAIT_IN_PROGRESS > 0
- sockerrlen = sizeof(sockerr);
- status = getsockopt(fd, SOL_SOCKET, SO_ERROR, (void *)&sockerr, &sockerrlen);
- if (status) break;
- if (sockerr) {
- status = -1;
- errno = sockerr;
- break;
- }
-#endif
-#ifdef EALREADY
- case EALREADY:
-#endif
-#if WAIT_IN_PROGRESS > 0
- wait_in_progress = WAIT_IN_PROGRESS;
-#endif
- status = wait_connectable(fd);
- if (status) {
- break;
- }
- errno = 0;
- continue;
-
-#if WAIT_IN_PROGRESS > 0
- case EINVAL:
- if (wait_in_progress-- > 0) {
- /*
- * connect() after EINPROGRESS returns EINVAL on
- * some platforms, need to check true error
- * status.
- */
- sockerrlen = sizeof(sockerr);
- status = getsockopt(fd, SOL_SOCKET, SO_ERROR, (void *)&sockerr, &sockerrlen);
- if (!status && !sockerr) {
- struct timeval tv = {0, 100000};
- rb_thread_wait_for(tv);
- continue;
- }
- status = -1;
- errno = sockerr;
- }
- break;
-#endif
-
-#ifdef EISCONN
- case EISCONN:
- status = 0;
- errno = 0;
- break;
-#endif
- default:
- break;
- }
- }
- return status;
- }
-}
-
-static void
-make_fd_nonblock(int fd)
-{
- int flags;
-#ifdef F_GETFL
- flags = fcntl(fd, F_GETFL);
- if (flags == -1) {
- rb_sys_fail(0);
- }
-#else
- flags = 0;
-#endif
- flags |= O_NONBLOCK;
- if (fcntl(fd, F_SETFL, flags) == -1) {
- rb_sys_fail(0);
- }
-}
-
-VALUE
-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 = accept(fptr->fd, (struct sockaddr*)sockaddr, len);
- if (fd2 < 0) {
- switch (errno) {
- case EAGAIN:
-#if defined(EWOULDBLOCK) && EWOULDBLOCK != EAGAIN
- case EWOULDBLOCK:
-#endif
- case ECONNABORTED:
-#if defined EPROTO
- case EPROTO:
-#endif
- rb_mod_sys_fail(rb_mWaitReadable, "accept(2) would block");
- }
- rb_sys_fail("accept(2)");
- }
- make_fd_nonblock(fd2);
- return rsock_init_sock(rb_obj_alloc(klass), fd2);
-}
-
-struct accept_arg {
- int fd;
- struct sockaddr *sockaddr;
- socklen_t *len;
-};
-
-static VALUE
-accept_blocking(void *data)
-{
- struct accept_arg *arg = data;
- return (VALUE)accept(arg->fd, arg->sockaddr, arg->len);
-}
-
-VALUE
-rsock_s_accept(VALUE klass, int fd, struct sockaddr *sockaddr, socklen_t *len)
-{
- int fd2;
- int retry = 0;
- struct accept_arg arg;
-
- rb_secure(3);
- arg.fd = fd;
- arg.sockaddr = sockaddr;
- arg.len = len;
- retry:
- rb_thread_wait_fd(fd);
- fd2 = BLOCKING_REGION(accept_blocking, &arg);
- if (fd2 < 0) {
- switch (errno) {
- case EMFILE:
- case ENFILE:
- if (retry) break;
- rb_gc();
- retry = 1;
- goto retry;
- default:
- if (!rb_io_wait_readable(fd)) break;
- retry = 0;
- goto retry;
- }
- rb_sys_fail(0);
- }
- if (!klass) return INT2NUM(fd2);
- return rsock_init_sock(rb_obj_alloc(klass), fd2);
-}
-
-int
-rsock_getfamily(int sockfd)
-{
- struct sockaddr_storage ss;
- socklen_t sslen = sizeof(ss);
-
- ss.ss_family = AF_UNSPEC;
- if (getsockname(sockfd, (struct sockaddr*)&ss, &sslen) < 0)
- return AF_UNSPEC;
-
- return ss.ss_family;
-}
-
-/*
- * SocketError is the error class for socket.
- */
-void
-Init_socket_init()
-{
- rb_eSocket = rb_define_class("SocketError", rb_eStandardError);
- Init_ipsocket();
- Init_tcpsocket();
- Init_tcpserver();
- Init_sockssocket();
- Init_udpsocket();
- Init_unixsocket();
- Init_unixserver();
- Init_sockopt();
- Init_ancdata();
- Init_addrinfo();
- Init_socket_constants();
-}
diff --git a/ext/socket/ipsocket.c b/ext/socket/ipsocket.c
deleted file mode 100644
index 78c85766ee..0000000000
--- a/ext/socket/ipsocket.c
+++ /dev/null
@@ -1,248 +0,0 @@
-/************************************************
-
- ipsocket.c -
-
- created at: Thu Mar 31 12:21:29 JST 1994
-
- Copyright (C) 1993-2007 Yukihiro Matsumoto
-
-************************************************/
-
-#include "rubysocket.h"
-
-struct inetsock_arg
-{
- VALUE sock;
- struct {
- VALUE host, serv;
- struct addrinfo *res;
- } remote, local;
- int type;
- int fd;
-};
-
-static VALUE
-inetsock_cleanup(struct inetsock_arg *arg)
-{
- if (arg->remote.res) {
- freeaddrinfo(arg->remote.res);
- arg->remote.res = 0;
- }
- if (arg->local.res) {
- freeaddrinfo(arg->local.res);
- arg->local.res = 0;
- }
- if (arg->fd >= 0) {
- close(arg->fd);
- }
- return Qnil;
-}
-
-static VALUE
-init_inetsock_internal(struct inetsock_arg *arg)
-{
- int type = arg->type;
- struct addrinfo *res;
- int fd, status = 0;
- const char *syscall = 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, SOCK_STREAM, 0);
- }
-
- arg->fd = fd = -1;
- for (res = arg->remote.res; res; res = res->ai_next) {
- status = rsock_socket(res->ai_family,res->ai_socktype,res->ai_protocol);
- syscall = "socket(2)";
- fd = status;
- if (fd < 0) {
- continue;
- }
- arg->fd = fd;
- if (type == INET_SERVER) {
-#if !defined(_WIN32) && !defined(__CYGWIN__)
- status = 1;
- setsockopt(fd, SOL_SOCKET, SO_REUSEADDR,
- (char*)&status, sizeof(status));
-#endif
- status = bind(fd, res->ai_addr, res->ai_addrlen);
- syscall = "bind(2)";
- }
- else {
- if (arg->local.res) {
- status = bind(fd, arg->local.res->ai_addr, arg->local.res->ai_addrlen);
- syscall = "bind(2)";
- }
-
- if (status >= 0) {
- status = rsock_connect(fd, res->ai_addr, res->ai_addrlen,
- (type == INET_SOCKS));
- syscall = "connect(2)";
- }
- }
-
- if (status < 0) {
- close(fd);
- arg->fd = fd = -1;
- continue;
- } else
- break;
- }
- if (status < 0) {
- rb_sys_fail(syscall);
- }
-
- arg->fd = -1;
-
- if (type == INET_SERVER)
- listen(fd, 5);
-
- /* create new instance */
- return rsock_init_sock(arg->sock, fd);
-}
-
-VALUE
-rsock_init_inetsock(VALUE sock, VALUE remote_host, VALUE remote_serv,
- VALUE local_host, VALUE local_serv, int type)
-{
- struct inetsock_arg arg;
- arg.sock = sock;
- arg.remote.host = remote_host;
- arg.remote.serv = remote_serv;
- arg.remote.res = 0;
- arg.local.host = local_host;
- arg.local.serv = local_serv;
- arg.local.res = 0;
- arg.type = type;
- arg.fd = -1;
- return rb_ensure(init_inetsock_internal, (VALUE)&arg,
- inetsock_cleanup, (VALUE)&arg);
-}
-
-/*
- * call-seq:
- * ipsocket.addr => [address_family, port, hostname, numeric_address]
- *
- * Returns the local address as an array which contains
- * address_family, port, hostname and numeric_address.
- *
- * hostname is obtained from numeric_address using reverse lookup.
- * If ipsocket.do_not_reverse_lookup is true,
- * hostname is same as numeric_address.
- *
- * TCPSocket.open("www.ruby-lang.org", 80) {|sock|
- * p sock.addr #=> ["AF_INET", 49429, "hal", "192.168.0.128"]
- * }
- *
- */
-static VALUE
-ip_addr(VALUE sock)
-{
- rb_io_t *fptr;
- struct sockaddr_storage addr;
- socklen_t len = sizeof addr;
-
- GetOpenFile(sock, fptr);
-
- if (getsockname(fptr->fd, (struct sockaddr*)&addr, &len) < 0)
- rb_sys_fail("getsockname(2)");
- return rsock_ipaddr((struct sockaddr*)&addr, fptr->mode & FMODE_NOREVLOOKUP);
-}
-
-/*
- * call-seq:
- * ipsocket.peeraddr => [address_family, port, hostname, numeric_address]
- *
- * Returns the remote address as an array which contains
- * address_family, port, hostname and numeric_address.
- * It is defined for connection oritented socket such as TCPSocket.
- *
- * TCPSocket.open("www.ruby-lang.org", 80) {|sock|
- * p sock.peeraddr #=> ["AF_INET", 80, "carbon.ruby-lang.org", "221.186.184.68"]
- * }
- *
- */
-static VALUE
-ip_peeraddr(VALUE sock)
-{
- rb_io_t *fptr;
- struct sockaddr_storage addr;
- socklen_t len = sizeof addr;
-
- GetOpenFile(sock, fptr);
-
- if (getpeername(fptr->fd, (struct sockaddr*)&addr, &len) < 0)
- rb_sys_fail("getpeername(2)");
- return rsock_ipaddr((struct sockaddr*)&addr, fptr->mode & FMODE_NOREVLOOKUP);
-}
-
-/*
- * call-seq:
- * ipsocket.recvfrom(maxlen) => [mesg, ipaddr]
- * ipsocket.recvfrom(maxlen, flags) => [mesg, ipaddr]
- *
- * Receives a message and return the message as a string and
- * an address which the message come from.
- *
- * _maxlen_ is the maximum number of bytes to receive.
- *
- * _flags_ should be a bitwise OR of Socket::MSG_* constants.
- *
- * ipaddr is same as IPSocket#{peeraddr,addr}.
- *
- * u1 = UDPSocket.new
- * u1.bind("127.0.0.1", 4913)
- * u2 = UDPSocket.new
- * u2.send "uuuu", 0, "127.0.0.1", 4913
- * p u1.recvfrom(10) #=> ["uuuu", ["AF_INET", 33230, "localhost", "127.0.0.1"]]
- *
- */
-static VALUE
-ip_recvfrom(int argc, VALUE *argv, VALUE sock)
-{
- return rsock_s_recvfrom(sock, argc, argv, RECV_IP);
-}
-
-/*
- * call-seq:
- * IPSocket.getaddress(host) => ipaddress
- *
- * Lookups IP address of _host_.
- *
- * IPSocket.getaddress("localhost") #=> "127.0.0.1"
- * IPSocket.getaddress("ip6-localhost") #=> "::1"
- *
- */
-static VALUE
-ip_s_getaddress(VALUE obj, VALUE host)
-{
- struct sockaddr_storage addr;
- struct addrinfo *res = rsock_addrinfo(host, Qnil, SOCK_STREAM, 0);
-
- /* just take the first one */
- memcpy(&addr, res->ai_addr, res->ai_addrlen);
- freeaddrinfo(res);
-
- return rsock_make_ipaddr((struct sockaddr*)&addr);
-}
-
-/*
- * IPSocket class
- */
-void
-Init_ipsocket(void)
-{
- rb_cIPSocket = rb_define_class("IPSocket", rb_cBasicSocket);
- rb_define_method(rb_cIPSocket, "addr", ip_addr, 0);
- rb_define_method(rb_cIPSocket, "peeraddr", ip_peeraddr, 0);
- rb_define_method(rb_cIPSocket, "recvfrom", ip_recvfrom, -1);
- rb_define_singleton_method(rb_cIPSocket, "getaddress", ip_s_getaddress, 1);
- rb_undef_method(rb_cIPSocket, "getpeereid");
-
-}
diff --git a/ext/socket/lib/socket.rb b/ext/socket/lib/socket.rb
deleted file mode 100644
index 8d417487ec..0000000000
--- a/ext/socket/lib/socket.rb
+++ /dev/null
@@ -1,729 +0,0 @@
-require 'socket.so'
-
-class Addrinfo
- # creates an Addrinfo object from the arguments.
- #
- # The arguments are interpreted as similar to self.
- #
- # Addrinfo.tcp("0.0.0.0", 4649).family_addrinfo("www.ruby-lang.org", 80)
- # #=> #<Addrinfo: 221.186.184.68:80 TCP (www.ruby-lang.org:80)>
- #
- # Addrinfo.unix("/tmp/sock").family_addrinfo("/tmp/sock2")
- # #=> #<Addrinfo: /tmp/sock2 SOCK_STREAM>
- #
- def family_addrinfo(*args)
- if args.empty?
- raise ArgumentError, "no address specified"
- elsif Addrinfo === args.first
- raise ArgumentError, "too man argument" if args.length != 1
- elsif self.ip?
- raise ArgumentError, "IP address needs host and port but #{args.length} arguments given" if args.length != 2
- host, port = args
- Addrinfo.getaddrinfo(host, port, self.pfamily, self.socktype, self.protocol)[0]
- elsif self.unix?
- raise ArgumentError, "UNIX socket needs single path argument but #{args.length} arguments given" if args.length != 1
- path, = args
- Addrinfo.unix(path)
- else
- raise ArgumentError, "unexpected family"
- end
- end
-
- def connect_internal(local_addrinfo)
- sock = Socket.new(self.pfamily, self.socktype, self.protocol)
- begin
- sock.ipv6only! if self.ipv6?
- sock.bind local_addrinfo if local_addrinfo
- sock.connect(self)
- if block_given?
- yield sock
- else
- sock
- end
- ensure
- sock.close if !sock.closed? && (block_given? || $!)
- end
- end
- private :connect_internal
-
- # creates a socket connected to the address of self.
- #
- # If one or more arguments given as _local_addr_args_,
- # it is used as the local address of the socket.
- # _local_addr_args_ is given for family_addrinfo to obtain actual address.
- #
- # If no arguments given, the local address of the socket is not bound.
- #
- # If a block is given, it is called with the socket and the value of the block is returned.
- # The socket is returned otherwise.
- #
- # Addrinfo.tcp("www.ruby-lang.org", 80).connect_from("0.0.0.0", 4649) {|s|
- # s.print "GET / HTTP/1.0\r\n\r\n"
- # p s.read
- # }
- #
- # # Addrinfo object can be taken for the argument.
- # Addrinfo.tcp("www.ruby-lang.org", 80).connect_from(Addrinfo.tcp("0.0.0.0", 4649)) {|s|
- # s.print "GET / HTTP/1.0\r\n\r\n"
- # p s.read
- # }
- #
- def connect_from(*local_addr_args, &block)
- connect_internal(family_addrinfo(*local_addr_args), &block)
- end
-
- # creates a socket connected to the address of self.
- #
- # If a block is given, it is called with the socket and the value of the block is returned.
- # The socket is returned otherwise.
- #
- # Addrinfo.tcp("www.ruby-lang.org", 80).connect {|s|
- # s.print "GET / HTTP/1.0\r\n\r\n"
- # p s.read
- # }
- #
- def connect(&block)
- connect_internal(nil, &block)
- end
-
- # creates a socket connected to _remote_addr_args_ and bound to self.
- #
- # If a block is given, it is called with the socket and the value of the block is returned.
- # The socket is returned otherwise.
- #
- # Addrinfo.tcp("0.0.0.0", 4649).connect_to("www.ruby-lang.org", 80) {|s|
- # s.print "GET / HTTP/1.0\r\n\r\n"
- # p s.read
- # }
- #
- def connect_to(*remote_addr_args, &block)
- remote_addrinfo = family_addrinfo(*remote_addr_args)
- remote_addrinfo.send(:connect_internal, self, &block)
- end
-
- # creates a socket bound to self.
- #
- # If a block is given, it is called with the socket and the value of the block is returned.
- # The socket is returned otherwise.
- #
- # Addrinfo.udp("0.0.0.0", 9981).bind {|s|
- # s.local_address.connect {|s| s.send "hello", 0 }
- # p s.recv(10) #=> "hello"
- # }
- #
- def bind
- sock = Socket.new(self.pfamily, self.socktype, self.protocol)
- begin
- sock.ipv6only! if self.ipv6?
- sock.setsockopt(:SOCKET, :REUSEADDR, 1)
- sock.bind(self)
- if block_given?
- yield sock
- else
- sock
- end
- ensure
- sock.close if !sock.closed? && (block_given? || $!)
- end
- end
-
- # creates a listening socket bound to self.
- def listen(backlog=5)
- sock = Socket.new(self.pfamily, self.socktype, self.protocol)
- begin
- sock.ipv6only! if self.ipv6?
- sock.setsockopt(:SOCKET, :REUSEADDR, 1)
- sock.bind(self)
- sock.listen(backlog)
- if block_given?
- yield sock
- else
- sock
- end
- ensure
- sock.close if !sock.closed? && (block_given? || $!)
- end
- end
-
- # iterates over the list of Addrinfo objects obtained by Addrinfo.getaddrinfo.
- #
- # Addrinfo.foreach(nil, 80) {|x| p x }
- # #=> #<Addrinfo: 127.0.0.1:80 TCP (:80)>
- # # #<Addrinfo: 127.0.0.1:80 UDP (:80)>
- # # #<Addrinfo: [::1]:80 TCP (:80)>
- # # #<Addrinfo: [::1]:80 UDP (:80)>
- #
- 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
-
-class BasicSocket
- # Returns an address of the socket suitable for connect in the local machine.
- #
- # This method returns _self_.local_address, except following condition.
- #
- # - IPv4 unspecified address (0.0.0.0) is replaced by IPv4 loopback address (127.0.0.1).
- # - IPv6 unspecified address (::) is replaced by IPv6 loopback address (::1).
- #
- # If the local address is not suitable for connect, SocketError is raised.
- # IPv4 and IPv6 address which port is 0 is not suitable for connect.
- # Unix domain socket which has no path is not suitable for connect.
- #
- # Addrinfo.tcp("0.0.0.0", 0).listen {|serv|
- # p serv.connect_address #=> #<Addrinfo: 127.0.0.1:53660 TCP>
- # serv.connect_address.connect {|c|
- # s, _ = serv.accept
- # p [c, s] #=> [#<Socket:fd 4>, #<Socket:fd 6>]
- # }
- # }
- #
- def connect_address
- addr = local_address
- afamily = addr.afamily
- if afamily == Socket::AF_INET
- raise SocketError, "unbound IPv4 socket" if addr.ip_port == 0
- if addr.ip_address == "0.0.0.0"
- addr = Addrinfo.new(["AF_INET", addr.ip_port, nil, "127.0.0.1"], addr.pfamily, addr.socktype, addr.protocol)
- end
- elsif defined?(Socket::AF_INET6) && afamily == Socket::AF_INET6
- raise SocketError, "unbound IPv6 socket" if addr.ip_port == 0
- if addr.ip_address == "::"
- addr = Addrinfo.new(["AF_INET6", addr.ip_port, nil, "::1"], addr.pfamily, addr.socktype, addr.protocol)
- elsif addr.ip_address == "0.0.0.0" # MacOS X 10.4 returns "a.b.c.d" for IPv4-mapped IPv6 address.
- addr = Addrinfo.new(["AF_INET6", addr.ip_port, nil, "::1"], addr.pfamily, addr.socktype, addr.protocol)
- end
- elsif defined?(Socket::AF_UNIX) && afamily == Socket::AF_UNIX
- raise SocketError, "unbound Unix socket" if addr.unix_path == ""
- end
- addr
- end
-end
-
-class Socket
- # enable the socket option IPV6_V6ONLY if IPV6_V6ONLY is available.
- def ipv6only!
- if defined? Socket::IPV6_V6ONLY
- self.setsockopt(:IPV6, :V6ONLY, 1)
- end
- end
-
- # creates a new socket object connected to host:port using TCP/IP.
- #
- # If local_host:local_port is given,
- # the socket is bound to it.
- #
- # If a block is given, the block is called with the socket.
- # The value of the block is returned.
- # The socket is closed when this method returns.
- #
- # If no block is given, the socket is returned.
- #
- # Socket.tcp("www.ruby-lang.org", 80) {|sock|
- # sock.print "GET / HTTP/1.0\r\n\r\n"
- # sock.close_write
- # print sock.read
- # }
- #
- def self.tcp(host, port, local_host=nil, local_port=nil) # :yield: socket
- last_error = nil
- ret = nil
-
- 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) {|ai|
- if local_addr_list
- local_addr = local_addr_list.find {|local_ai| local_ai.afamily == ai.afamily }
- next if !local_addr
- else
- local_addr = nil
- end
- begin
- sock = local_addr ? ai.connect_from(local_addr) : ai.connect
- rescue SystemCallError
- last_error = $!
- next
- end
- ret = sock
- break
- }
- if !ret
- if last_error
- raise last_error
- else
- raise SocketError, "no appropriate local address"
- end
- end
- if block_given?
- begin
- yield ret
- ensure
- ret.close if !ret.closed?
- end
- else
- ret
- end
- end
-
- def self.ip_sockets_port0(ai_list, reuseaddr)
- begin
- sockets = []
- port = nil
- ai_list.each {|ai|
- begin
- s = Socket.new(ai.pfamily, ai.socktype, ai.protocol)
- rescue SystemCallError
- next
- end
- sockets << s
- s.ipv6only! if ai.ipv6?
- if reuseaddr
- s.setsockopt(:SOCKET, :REUSEADDR, 1)
- end
- if !port
- s.bind(ai)
- port = s.local_address.ip_port
- else
- s.bind(ai.family_addrinfo(ai.ip_address, port))
- end
- }
- rescue Errno::EADDRINUSE
- sockets.each {|s|
- s.close
- }
- retry
- end
- sockets
- ensure
- sockets.each {|s| s.close if !s.closed? } if $!
- end
- class << self
- private :ip_sockets_port0
- end
-
- def self.tcp_server_sockets_port0(host)
- ai_list = Addrinfo.getaddrinfo(host, 0, nil, :STREAM, nil, Socket::AI_PASSIVE)
- sockets = ip_sockets_port0(ai_list, true)
- sockets.each {|s|
- s.listen(5)
- }
- sockets
- ensure
- sockets.each {|s| s.close if !s.closed? } if $! && sockets
- end
- class << self
- private :tcp_server_sockets_port0
- end
-
- # creates TCP/IP server sockets for _host_ and _port_.
- # _host_ is optional.
- #
- # If no block given,
- # it returns an array of listening sockets.
- #
- # If a block is given, the block is called with the sockets.
- # The value of the block is returned.
- # The socket is closed when this method returns.
- #
- # If _port_ is 0, actual port number is choosen dynamically.
- # However all sockets in the result has same port number.
- #
- # # tcp_server_sockets returns two sockets.
- # sockets = Socket.tcp_server_sockets(1296)
- # p sockets #=> [#<Socket:fd 3>, #<Socket:fd 4>]
- #
- # # The sockets contains IPv6 and IPv4 sockets.
- # sockets.each {|s| p s.local_address }
- # #=> #<Addrinfo: [::]:1296 TCP>
- # # #<Addrinfo: 0.0.0.0:1296 TCP>
- #
- # # IPv6 and IPv4 socket has same port number, 53114, even if it is choosen dynamically.
- # sockets = Socket.tcp_server_sockets(0)
- # sockets.each {|s| p s.local_address }
- # #=> #<Addrinfo: [::]:53114 TCP>
- # # #<Addrinfo: 0.0.0.0:53114 TCP>
- #
- # # The block is called with the sockets.
- # Socket.tcp_server_sockets(0) {|sockets|
- # p sockets #=> [#<Socket:fd 3>, #<Socket:fd 4>]
- # }
- #
- def self.tcp_server_sockets(host=nil, port)
- if port == 0
- sockets = tcp_server_sockets_port0(host)
- else
- begin
- last_error = nil
- sockets = []
- Addrinfo.foreach(host, port, nil, :STREAM, nil, Socket::AI_PASSIVE) {|ai|
- begin
- s = ai.listen
- rescue SystemCallError
- last_error = $!
- next
- end
- sockets << s
- }
- if sockets.empty?
- raise last_error
- end
- ensure
- sockets.each {|s| s.close if !s.closed? } if $!
- end
- end
- if block_given?
- begin
- yield sockets
- ensure
- sockets.each {|s| s.close if !s.closed? }
- end
- else
- sockets
- end
- end
-
- # yield socket and client address for each a connection accepted via given sockets.
- #
- # The arguments are a list of sockets.
- # The individual argument should be a socket or an array of sockets.
- #
- # This method yields the block sequentially.
- # It means that the next connection is not accepted until the block returns.
- # So concurrent mechanism, thread for example, should be used to service multiple clients at a time.
- #
- def self.accept_loop(*sockets) # :yield: socket, client_addrinfo
- sockets.flatten!(1)
- if sockets.empty?
- raise ArgumentError, "no sockets"
- end
- loop {
- readable, _, _ = IO.select(sockets)
- readable.each {|r|
- begin
- sock, addr = r.accept_nonblock
- rescue Errno::EWOULDBLOCK
- next
- end
- yield sock, addr
- }
- }
- end
-
- # creates a TCP/IP server on _port_ and calls the block for each connection accepted.
- # The block is called with a socket and a client_address as an Addrinfo object.
- #
- # If _host_ is specified, it is used with _port_ to determine the server addresses.
- #
- # The socket is *not* closed when the block returns.
- # So application should close it explicitly.
- #
- # This method calls the block sequentially.
- # It means that the next connection is not accepted until the block returns.
- # So concurrent mechanism, thread for example, should be used to service multiple clients at a time.
- #
- # Note that Addrinfo.getaddrinfo is used to determine the server socket addresses.
- # When Addrinfo.getaddrinfo returns two or more addresses,
- # IPv4 and IPv6 address for example,
- # all of them are used.
- # Socket.tcp_server_loop succeeds if one socket can be used at least.
- #
- # # Sequential echo server.
- # # It services only one client at a time.
- # Socket.tcp_server_loop(16807) {|sock, client_addrinfo|
- # begin
- # IO.copy_stream(sock, sock)
- # ensure
- # sock.close
- # end
- # }
- #
- # # Threaded echo server
- # # It services multiple clients at a time.
- # # Note that it may accept connections too much.
- # Socket.tcp_server_loop(16807) {|sock, client_addrinfo|
- # Thread.new {
- # begin
- # IO.copy_stream(sock, sock)
- # ensure
- # sock.close
- # end
- # }
- # }
- #
- def self.tcp_server_loop(host=nil, port, &b) # :yield: socket, client_addrinfo
- tcp_server_sockets(host, port) {|sockets|
- accept_loop(sockets, &b)
- }
- end
-
- # :call-seq:
- # Socket.udp_server_sockets([host, ] port)
- #
- # Creates UDP/IP sockets for a UDP server.
- #
- # If no block given, it returns an array of sockets.
- #
- # If a block is given, the block is called with the sockets.
- # The value of the block is returned.
- # The sockets are closed when this method returns.
- #
- # If _port_ is zero, some port is choosen.
- # But the choosen port is used for the all sockets.
- #
- # # UDP/IP echo server
- # Socket.udp_server_sockets(0) {|sockets|
- # p sockets.first.local_address.ip_port #=> 32963
- # Socket.udp_server_loop_on(sockets) {|msg, msg_src|
- # msg_src.reply msg
- # }
- # }
- #
- def self.udp_server_sockets(host=nil, port)
- last_error = nil
- sockets = []
- addr_hash = {}
-
- ipv6_recvpktinfo = nil
- if defined? Socket::AncillaryData
- if defined? Socket::IPV6_RECVPKTINFO # RFC 3542
- ipv6_recvpktinfo = Socket::IPV6_RECVPKTINFO
- elsif defined? Socket::IPV6_PKTINFO # RFC 2292
- ipv6_recvpktinfo = Socket::IPV6_PKTINFO
- end
- end
-
- local_addrs = Socket.ip_address_list
-
- ip_list = []
- 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 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 if !a.ipv6?
- ip_list << Addrinfo.new(a.to_sockaddr, :INET6, :DGRAM, 0);
- }
- else
- ip_list << ai
- end
- }
-
- if port == 0
- sockets = ip_sockets_port0(ip_list, false)
- else
- ip_list.each {|ip|
- ai = Addrinfo.udp(ip.ip_address, port)
- begin
- s = ai.bind
- rescue SystemCallError
- last_error = $!
- next
- end
- sockets << s
- }
- if sockets.empty?
- raise last_error
- end
- end
-
- pktinfo_sockets = {}
- sockets.each {|s|
- ai = s.local_address
- if ipv6_recvpktinfo && ai.ipv6? && ai.ip_address == "::"
- s.setsockopt(:IPV6, ipv6_recvpktinfo, 1)
- pktinfo_sockets[s] = true
- end
- }
-
- if block_given?
- begin
- yield sockets
- ensure
- sockets.each {|s| s.close if !s.closed? } if sockets
- end
- else
- sockets
- end
- end
-
- # :call-seq:
- # Socket.udp_server_loop_on(sockets) {|msg, msg_src| ... }
- #
- # Run UDP/IP server loop on the given sockets.
- #
- # The return value of Socket.udp_server_sockets is appropriate for the argument.
- #
- # It calls the block for each message received.
- #
- def self.udp_server_loop_on(sockets) # :yield: msg, msg_src
- loop {
- readable, _, _ = IO.select(sockets)
- readable.each {|r|
- begin
- msg, sender_addrinfo, rflags, *controls = r.recvmsg_nonblock
- rescue Errno::EWOULDBLOCK
- 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)
- yield msg, UDPSource.new(sender_addrinfo, ai) {|reply_msg|
- r.sendmsg reply_msg, 0, sender_addrinfo, pktinfo
- }
- else
- yield msg, UDPSource.new(sender_addrinfo, ai) {|reply_msg|
- r.send reply_msg, 0, sender_addrinfo
- }
- end
- }
- }
- end
-
- # :call-seq:
- # Socket.udp_server_loop(port) {|msg, msg_src| ... }
- # Socket.udp_server_loop(host, port) {|msg, msg_src| ... }
- #
- # creates a UDP/IP server on _port_ and calls the block for each message arrived.
- # The block is called with the message and its source information.
- #
- # This method allocates sockets internally using _port_.
- # If _host_ is specified, it is used conjunction with _port_ to determine the server addresses.
- #
- # The _msg_ is a string.
- #
- # The _msg_src_ is a Socket::UDPSource object.
- # It is used for reply.
- #
- # # UDP/IP echo server.
- # Socket.udp_server_loop(9261) {|msg, msg_src|
- # msg_src.reply msg
- # }
- #
- def self.udp_server_loop(host=nil, port, &b) # :yield: message, message_source
- udp_server_sockets(host, port) {|sockets|
- udp_server_loop_on(sockets, &b)
- }
- end
-
- # UDP/IP address information used by Socket.udp_server_loop.
- class UDPSource
- def initialize(remote_address, local_address, &reply_proc)
- @remote_address = remote_address
- @local_address = local_address
- @reply_proc = reply_proc
- end
- attr_reader :remote_address, :local_address
-
- def inspect
- "\#<#{self.class}: #{@remote_address.inspect_sockaddr} to #{@local_address.inspect_sockaddr}>"
- end
-
- def reply(msg)
- @reply_proc.call msg
- end
- end
-
- # creates a new socket connected to path using UNIX socket socket.
- #
- # If a block is given, the block is called with the socket.
- # The value of the block is returned.
- # The socket is closed when this method returns.
- #
- # If no block is given, the socket is returned.
- #
- # # talk to /tmp/sock socket.
- # Socket.unix("/tmp/sock") {|sock|
- # t = Thread.new { IO.copy_stream(sock, STDOUT) }
- # IO.copy_stream(STDIN, sock)
- # t.join
- # }
- #
- def self.unix(path) # :yield: socket
- addr = Addrinfo.unix(path)
- sock = addr.connect
- if block_given?
- begin
- yield sock
- ensure
- sock.close if !sock.closed?
- end
- else
- sock
- end
- end
-
- # creates UNIX server sockets on _path_
- #
- # If no block given, it returns a listening socket.
- #
- # If a block is given, it is called with the socket and the block value is returned.
- # When the block exits, the socket is closed and the socket file is removed.
- #
- # socket = Socket.unix_server_socket("/tmp/s")
- # p socket #=> #<Socket:fd 3>
- # p socket.local_address #=> #<Addrinfo: /tmp/s SOCK_STREAM>
- #
- # Socket.unix_server_socket("/tmp/sock") {|s|
- # p s #=> #<Socket:fd 3>
- # p s.local_address #=> # #<Addrinfo: /tmp/sock SOCK_STREAM>
- # }
- #
- def self.unix_server_socket(path)
- begin
- st = File.lstat(path)
- rescue Errno::ENOENT
- end
- if st && st.socket? && st.owned?
- File.unlink path
- end
- s = Addrinfo.unix(path).listen
- if block_given?
- begin
- yield s
- ensure
- s.close if !s.closed?
- File.unlink path
- end
- else
- s
- end
- end
-
- # creates a UNIX socket server on _path_.
- # It calls the block for each socket accepted.
- #
- # If _host_ is specified, it is used with _port_ to determine the server ports.
- #
- # The socket is *not* closed when the block returns.
- # So application should close it.
- #
- # This method deletes the socket file pointed by _path_ at first if
- # the file is a socket file and it is owned by the user of the application.
- # This is safe only if the directory of _path_ is not changed by a malicious user.
- # So don't use /tmp/malicious-users-directory/socket.
- # Note that /tmp/socket and /tmp/your-private-directory/socket is safe assuming that /tmp has sticky bit.
- #
- # # Sequential echo server.
- # # It services only one client at a time.
- # Socket.unix_server_loop("/tmp/sock") {|sock, client_addrinfo|
- # begin
- # IO.copy_stream(sock, sock)
- # ensure
- # sock.close
- # end
- # }
- #
- def self.unix_server_loop(path, &b) # :yield: socket, client_addrinfo
- unix_server_socket(path) {|serv|
- accept_loop(serv, &b)
- }
- end
-
-end
-
diff --git a/ext/socket/mkconstants.rb b/ext/socket/mkconstants.rb
deleted file mode 100644
index 3074a8ff8d..0000000000
--- a/ext/socket/mkconstants.rb
+++ /dev/null
@@ -1,683 +0,0 @@
-require 'optparse'
-require 'erb'
-
-opt = OptionParser.new
-
-opt.def_option('-h', 'help') {
- puts opt
- exit 0
-}
-
-opt_o = nil
-opt.def_option('-o FILE', 'specify output file') {|filename|
- opt_o = filename
-}
-
-opt_H = nil
-opt.def_option('-H FILE', 'specify output header file') {|filename|
- opt_H = filename
-}
-
-C_ESC = {
- "\\" => "\\\\",
- '"' => '\"',
- "\n" => '\n',
-}
-
-0x00.upto(0x1f) {|ch| C_ESC[[ch].pack("C")] ||= "\\%03o" % ch }
-0x7f.upto(0xff) {|ch| C_ESC[[ch].pack("C")] = "\\%03o" % ch }
-C_ESC_PAT = Regexp.union(*C_ESC.keys)
-
-def c_str(str)
- '"' + str.gsub(C_ESC_PAT) {|s| C_ESC[s]} + '"'
-end
-
-opt.parse!
-
-
-
-h = {}
-DATA.each_line {|s|
- name, default_value = s.scan(/\S+/)
- next unless name && name[0] != ?#
- if h.has_key? name
- warn "#{$.}: warning: duplicate name: #{name}"
- next
- end
- h[name] = default_value
-}
-DEFS = h.to_a
-
-def each_const
- DEFS.each {|name, default_value|
- if name =~ /\AINADDR_/
- make_value = "UINT2NUM"
- else
- make_value = "INT2NUM"
- end
- guard = nil
- if /\A(AF_INET6|PF_INET6)\z/ =~ name
- # IPv6 is not supported although AF_INET6 is defined on bcc32/mingw
- guard = "defined(INET6)"
- end
- yield guard, make_value, name, default_value
- }
-end
-
-def each_name(pat)
- DEFS.each {|name, default_value|
- next if pat !~ name
- yield name
- }
-end
-
-ERB.new(<<'EOS', nil, '%').def_method(Object, "gen_const_decls")
-% each_const {|guard, make_value, name, default_value|
-% if default_value
-#ifndef <%=name%>
-# define <%=name%> <%=default_value%>
-#endif
-% end
-% }
-EOS
-
-ERB.new(<<'EOS', nil, '%').def_method(Object, "gen_const_defs_in_guard(make_value, name, default_value)")
-#if defined(<%=name%>)
- rb_define_const(rb_cSocket, <%=c_str name%>, <%=make_value%>(<%=name%>));
- rb_define_const(rb_mSockConst, <%=c_str name%>, <%=make_value%>(<%=name%>));
-#endif
-EOS
-
-ERB.new(<<'EOS', nil, '%').def_method(Object, "gen_const_defs")
-% each_const {|guard, make_value, name, default_value|
-% if guard
-#if <%=guard%>
-<%= gen_const_defs_in_guard(make_value, name, default_value).chomp %>
-#endif
-% else
-<%= gen_const_defs_in_guard(make_value, name, default_value).chomp %>
-% end
-% }
-EOS
-
-def reverse_each_name(pat)
- DEFS.reverse_each {|name, default_value|
- next if pat !~ name
- yield name
- }
-end
-
-def each_names_with_len(pat, prefix_optional=nil)
- h = {}
- DEFS.each {|name, default_value|
- next if pat !~ name
- (h[name.length] ||= []) << [name, name]
- }
- if prefix_optional
- if Regexp === prefix_optional
- prefix_pat = prefix_optional
- else
- prefix_pat = /\A#{Regexp.escape prefix_optional}/
- end
- DEFS.each {|const, default_value|
- next if pat !~ const
- next if prefix_pat !~ const
- name = $'
- (h[name.length] ||= []) << [name, const]
- }
- end
- hh = {}
- h.each {|len, pairs|
- pairs.each {|name, const|
- raise "name crash: #{name}" if hh[name]
- hh[name] = true
- }
- }
- h.keys.sort.each {|len|
- yield h[len], len
- }
-end
-
-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, int len, int *valp);
-#endif
-%else
-int <%=funcname%>(const char *str, int len, int *valp);
-%end
-EOS
-
-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, int len, int *valp)
-{
- switch (len) {
-% each_names_with_len(pat, prefix_optional) {|pairs, len|
- case <%=len%>:
-% pairs.each {|name, const|
-#ifdef <%=const%>
- if (memcmp(str, <%=c_str name%>, <%=len%>) == 0) { *valp = <%=const%>; return 0; }
-#endif
-% }
- return -1;
-
-% }
- default:
- return -1;
- }
-}
-EOS
-
-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)%>
-#endif
-%else
-<%=gen_name_to_int_func_in_guard(funcname, pat, prefix_optional, guard)%>
-%end
-EOS
-
-NAME_TO_INT_DEFS = []
-def def_name_to_int(funcname, pat, prefix_optional, guard=nil)
- decl = gen_name_to_int_decl(funcname, pat, prefix_optional, guard)
- func = gen_name_to_int_func(funcname, pat, prefix_optional, guard)
- NAME_TO_INT_DEFS << [decl, func]
-end
-
-def reverse_each_name_with_prefix_optional(pat, prefix_pat)
- reverse_each_name(pat) {|n|
- yield n, n
- }
- if prefix_pat
- reverse_each_name(pat) {|n|
- next if prefix_pat !~ n
- yield n, $'
- }
- end
-end
-
-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%>
- st_insert(<%=hash_var%>, (st_data_t)<%=n%>, (st_data_t)rb_intern2(<%=c_str s%>, <%=s.length%>));
-#endif
-% }
-EOS
-
-ERB.new(<<'EOS', nil, '%').def_method(Object, "gen_int_to_name_func(func_name, hash_var)")
-ID
-<%=func_name%>(int val)
-{
- st_data_t name;
- if (st_lookup(<%=hash_var%>, (st_data_t)val, &name))
- return (ID)name;
- return 0;
-}
-EOS
-
-ERB.new(<<'EOS', nil, '%').def_method(Object, "gen_int_to_name_decl(func_name, hash_var)")
-ID <%=func_name%>(int val);
-EOS
-
-INTERN_DEFS = []
-def def_intern(func_name, pat, prefix_optional=nil)
- prefix_pat = nil
- if prefix_optional
- if Regexp === prefix_optional
- prefix_pat = prefix_optional
- else
- prefix_pat = /\A#{Regexp.escape prefix_optional}/
- end
- end
- hash_var = "#{func_name}_hash"
- vardef = "static st_table *#{hash_var};"
- gen_hash = gen_int_to_name_hash(hash_var, pat, prefix_pat)
- decl = gen_int_to_name_decl(func_name, hash_var)
- func = gen_int_to_name_func(func_name, hash_var)
- INTERN_DEFS << [vardef, gen_hash, decl, func]
-end
-
-def_name_to_int("rsock_family_to_int", /\A(AF_|PF_)/, "AF_")
-def_name_to_int("rsock_socktype_to_int", /\ASOCK_/, "SOCK_")
-def_name_to_int("rsock_ipproto_to_int", /\AIPPROTO_/, "IPPROTO_")
-def_name_to_int("rsock_unknown_level_to_int", /\ASOL_SOCKET\z/, "SOL_")
-def_name_to_int("rsock_ip_level_to_int", /\A(SOL_SOCKET\z|IPPROTO_)/, /\A(SOL_|IPPROTO_)/)
-def_name_to_int("rsock_so_optname_to_int", /\ASO_/, "SO_")
-def_name_to_int("rsock_ip_optname_to_int", /\AIP_/, "IP_")
-def_name_to_int("rsock_ipv6_optname_to_int", /\AIPV6_/, "IPV6_", "IPPROTO_IPV6")
-def_name_to_int("rsock_tcp_optname_to_int", /\ATCP_/, "TCP_")
-def_name_to_int("rsock_udp_optname_to_int", /\AUDP_/, "UDP_")
-def_name_to_int("rsock_shutdown_how_to_int", /\ASHUT_/, "SHUT_")
-def_name_to_int("rsock_scm_optname_to_int", /\ASCM_/, "SCM_")
-
-def_intern('rsock_intern_family', /\AAF_/)
-def_intern('rsock_intern_family_noprefix', /\AAF_/, "AF_")
-def_intern('rsock_intern_protocol_family', /\APF_/)
-def_intern('rsock_intern_socktype', /\ASOCK_/)
-def_intern('rsock_intern_ipproto', /\AIPPROTO_/)
-def_intern('rsock_intern_iplevel', /\A(SOL_SOCKET\z|IPPROTO_)/, /\A(SOL_|IPPROTO_)/)
-def_intern('rsock_intern_so_optname', /\ASO_/, "SO_")
-def_intern('rsock_intern_ip_optname', /\AIP_/, "IP_")
-def_intern('rsock_intern_ipv6_optname', /\AIPV6_/, "IPV6_")
-def_intern('rsock_intern_tcp_optname', /\ATCP_/, "TCP_")
-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(<<'EOS', nil, '%').result(binding)
-/* autogenerated file */
-
-<%= INTERN_DEFS.map {|vardef, gen_hash, decl, func| vardef }.join("\n") %>
-
-static void
-init_constants(void)
-{
- /* for rdoc */
- /* rb_cSocket = rb_define_class("Socket", rb_cBasicSocket); */
- /* rb_mSockConst = rb_define_module_under(rb_cSocket, "Constants"); */
-
-<%= gen_const_defs %>
-<%= INTERN_DEFS.map {|vardef, gen_hash, decl, func| gen_hash }.join("\n") %>
-}
-
-<%= NAME_TO_INT_DEFS.map {|decl, func| func }.join("\n") %>
-
-<%= INTERN_DEFS.map {|vardef, gen_hash, decl, func| func }.join("\n") %>
-
-EOS
-
-header_result = ERB.new(<<'EOS', nil, '%').result(binding)
-/* autogenerated file */
-<%= gen_const_decls %>
-<%= NAME_TO_INT_DEFS.map {|decl, func| decl }.join("\n") %>
-<%= INTERN_DEFS.map {|vardef, gen_hash, decl, func| decl }.join("\n") %>
-EOS
-
-if opt_H
- File.open(opt_H, 'w') {|f|
- f << header_result
- }
-else
- result = header_result + result
-end
-
-if opt_o
- File.open(opt_o, 'w') {|f|
- f << result
- }
-else
- $stdout << result
-end
-
-__END__
-
-SOCK_STREAM
-SOCK_DGRAM
-SOCK_RAW
-SOCK_RDM
-SOCK_SEQPACKET
-SOCK_PACKET
-
-AF_UNSPEC
-PF_UNSPEC
-AF_INET
-PF_INET
-AF_INET6
-PF_INET6
-AF_UNIX
-PF_UNIX
-AF_AX25
-PF_AX25
-AF_IPX
-PF_IPX
-AF_APPLETALK
-PF_APPLETALK
-AF_LOCAL
-PF_LOCAL
-AF_IMPLINK
-PF_IMPLINK
-AF_PUP
-PF_PUP
-AF_CHAOS
-PF_CHAOS
-AF_NS
-PF_NS
-AF_ISO
-PF_ISO
-AF_OSI
-PF_OSI
-AF_ECMA
-PF_ECMA
-AF_DATAKIT
-PF_DATAKIT
-AF_CCITT
-PF_CCITT
-AF_SNA
-PF_SNA
-AF_DEC
-PF_DEC
-AF_DLI
-PF_DLI
-AF_LAT
-PF_LAT
-AF_HYLINK
-PF_HYLINK
-AF_ROUTE
-PF_ROUTE
-AF_LINK
-PF_LINK
-AF_COIP
-PF_COIP
-AF_CNT
-PF_CNT
-AF_SIP
-PF_SIP
-AF_NDRV
-PF_NDRV
-AF_ISDN
-PF_ISDN
-AF_NATM
-PF_NATM
-AF_SYSTEM
-PF_SYSTEM
-AF_NETBIOS
-PF_NETBIOS
-AF_PPP
-PF_PPP
-AF_ATM
-PF_ATM
-AF_NETGRAPH
-PF_NETGRAPH
-AF_MAX
-PF_MAX
-AF_PACKET
-PF_PACKET
-
-AF_E164
-PF_XTP
-PF_RTIP
-PF_PIP
-PF_KEY
-
-MSG_OOB
-MSG_PEEK
-MSG_DONTROUTE
-MSG_EOR
-MSG_TRUNC
-MSG_CTRUNC
-MSG_WAITALL
-MSG_DONTWAIT
-MSG_EOF
-MSG_FLUSH
-MSG_HOLD
-MSG_SEND
-MSG_HAVEMORE
-MSG_RCVMORE
-MSG_COMPAT
-MSG_PROXY
-MSG_FIN
-MSG_SYN
-MSG_CONFIRM
-MSG_RST
-MSG_ERRQUEUE
-MSG_NOSIGNAL
-MSG_MORE
-
-SOL_SOCKET
-SOL_IP
-SOL_IPX
-SOL_AX25
-SOL_ATALK
-SOL_TCP
-SOL_UDP
-
-IPPROTO_IP 0
-IPPROTO_ICMP 1
-IPPROTO_IGMP
-IPPROTO_GGP
-IPPROTO_TCP 6
-IPPROTO_EGP
-IPPROTO_PUP
-IPPROTO_UDP 17
-IPPROTO_IDP
-IPPROTO_HELLO
-IPPROTO_ND
-IPPROTO_TP
-IPPROTO_XTP
-IPPROTO_EON
-IPPROTO_BIP
-IPPROTO_AH
-IPPROTO_DSTOPTS
-IPPROTO_ESP
-IPPROTO_FRAGMENT
-IPPROTO_HOPOPTS
-IPPROTO_ICMPV6
-IPPROTO_IPV6
-IPPROTO_NONE
-IPPROTO_ROUTING
-
-IPPROTO_RAW 255
-IPPROTO_MAX
-
-# Some port configuration
-IPPORT_RESERVED 1024
-IPPORT_USERRESERVED 5000
-
-# Some reserved IP v.4 addresses
-INADDR_ANY 0x00000000
-INADDR_BROADCAST 0xffffffff
-INADDR_LOOPBACK 0x7F000001
-INADDR_UNSPEC_GROUP 0xe0000000
-INADDR_ALLHOSTS_GROUP 0xe0000001
-INADDR_MAX_LOCAL_GROUP 0xe00000ff
-INADDR_NONE 0xffffffff
-
-# IP [gs]etsockopt options
-IP_OPTIONS
-IP_HDRINCL
-IP_TOS
-IP_TTL
-IP_RECVOPTS
-IP_RECVRETOPTS
-IP_RECVDSTADDR
-IP_RETOPTS
-IP_MINTTL
-IP_DONTFRAG
-IP_SENDSRCADDR
-IP_ONESBCAST
-IP_RECVTTL
-IP_RECVIF
-IP_RECVSLLA
-IP_PORTRANGE
-IP_MULTICAST_IF
-IP_MULTICAST_TTL
-IP_MULTICAST_LOOP
-IP_ADD_MEMBERSHIP
-IP_DROP_MEMBERSHIP
-IP_DEFAULT_MULTICAST_TTL
-IP_DEFAULT_MULTICAST_LOOP
-IP_MAX_MEMBERSHIPS
-IP_ROUTER_ALERT
-IP_PKTINFO
-IP_PKTOPTIONS
-IP_MTU_DISCOVER
-IP_RECVERR
-IP_RECVTOS
-IP_MTU
-IP_FREEBIND
-IP_IPSEC_POLICY
-IP_XFRM_POLICY
-IP_PASSSEC
-IP_PMTUDISC_DONT
-IP_PMTUDISC_WANT
-IP_PMTUDISC_DO
-IP_UNBLOCK_SOURCE
-IP_BLOCK_SOURCE
-IP_ADD_SOURCE_MEMBERSHIP
-IP_DROP_SOURCE_MEMBERSHIP
-IP_MSFILTER
-
-MCAST_JOIN_GROUP
-MCAST_BLOCK_SOURCE
-MCAST_UNBLOCK_SOURCE
-MCAST_LEAVE_GROUP
-MCAST_JOIN_SOURCE_GROUP
-MCAST_LEAVE_SOURCE_GROUP
-MCAST_MSFILTER
-MCAST_EXCLUDE
-MCAST_INCLUDE
-
-SO_DEBUG
-SO_REUSEADDR
-SO_REUSEPORT
-SO_TYPE
-SO_ERROR
-SO_DONTROUTE
-SO_BROADCAST
-SO_SNDBUF
-SO_RCVBUF
-SO_KEEPALIVE
-SO_OOBINLINE
-SO_NO_CHECK
-SO_PRIORITY
-SO_LINGER
-SO_PASSCRED
-SO_PEERCRED
-SO_RCVLOWAT
-SO_SNDLOWAT
-SO_RCVTIMEO
-SO_SNDTIMEO
-SO_ACCEPTCONN
-SO_USELOOPBACK
-SO_ACCEPTFILTER
-SO_DONTTRUNC
-SO_WANTMORE
-SO_WANTOOBFLAG
-SO_NREAD
-SO_NKE
-SO_NOSIGPIPE
-SO_SECURITY_AUTHENTICATION
-SO_SECURITY_ENCRYPTION_TRANSPORT
-SO_SECURITY_ENCRYPTION_NETWORK
-SO_BINDTODEVICE
-SO_ATTACH_FILTER
-SO_DETACH_FILTER
-SO_PEERNAME
-SO_TIMESTAMP
-SO_TIMESTAMPNS
-SO_BINTIME
-SO_RECVUCRED
-SO_MAC_EXEMPT
-SO_ALLZONES
-
-SOPRI_INTERACTIVE
-SOPRI_NORMAL
-SOPRI_BACKGROUND
-
-IPX_TYPE
-
-TCP_NODELAY
-TCP_MAXSEG
-TCP_CORK
-TCP_DEFER_ACCEPT
-TCP_INFO
-TCP_KEEPCNT
-TCP_KEEPIDLE
-TCP_KEEPINTVL
-TCP_LINGER2
-TCP_MD5SIG
-TCP_NOOPT
-TCP_NOPUSH
-TCP_QUICKACK
-TCP_SYNCNT
-TCP_WINDOW_CLAMP
-
-UDP_CORK
-
-EAI_ADDRFAMILY
-EAI_AGAIN
-EAI_BADFLAGS
-EAI_FAIL
-EAI_FAMILY
-EAI_MEMORY
-EAI_NODATA
-EAI_NONAME
-EAI_OVERFLOW
-EAI_SERVICE
-EAI_SOCKTYPE
-EAI_SYSTEM
-EAI_BADHINTS
-EAI_PROTOCOL
-EAI_MAX
-
-AI_PASSIVE
-AI_CANONNAME
-AI_NUMERICHOST
-AI_NUMERICSERV
-AI_MASK
-AI_ALL
-AI_V4MAPPED_CFG
-AI_ADDRCONFIG
-AI_V4MAPPED
-AI_DEFAULT
-
-NI_MAXHOST
-NI_MAXSERV
-NI_NOFQDN
-NI_NUMERICHOST
-NI_NAMEREQD
-NI_NUMERICSERV
-NI_DGRAM
-
-SHUT_RD 0
-SHUT_WR 1
-SHUT_RDWR 2
-
-IPV6_JOIN_GROUP
-IPV6_LEAVE_GROUP
-IPV6_MULTICAST_HOPS
-IPV6_MULTICAST_IF
-IPV6_MULTICAST_LOOP
-IPV6_UNICAST_HOPS
-IPV6_V6ONLY
-IPV6_CHECKSUM
-IPV6_DONTFRAG
-IPV6_DSTOPTS
-IPV6_HOPLIMIT
-IPV6_HOPOPTS
-IPV6_NEXTHOP
-IPV6_PATHMTU
-IPV6_PKTINFO
-IPV6_RECVDSTOPTS
-IPV6_RECVHOPLIMIT
-IPV6_RECVHOPOPTS
-IPV6_RECVPKTINFO
-IPV6_RECVRTHDR
-IPV6_RECVTCLASS
-IPV6_RTHDR
-IPV6_RTHDRDSTOPTS
-IPV6_RTHDR_TYPE_0
-IPV6_RECVPATHMTU
-IPV6_TCLASS
-IPV6_USE_MIN_MTU
-
-INET_ADDRSTRLEN
-INET6_ADDRSTRLEN
-IFNAMSIZ
-
-SOMAXCONN
-
-SCM_RIGHTS
-SCM_TIMESTAMP
-SCM_TIMESTAMPNS
-SCM_BINTIME
-SCM_CREDENTIALS
-SCM_CREDS
-SCM_UCRED
-
-LOCAL_PEERCRED
-LOCAL_CREDS
-LOCAL_CONNWAIT
diff --git a/ext/socket/option.c b/ext/socket/option.c
deleted file mode 100644
index d1d557db14..0000000000
--- a/ext/socket/option.c
+++ /dev/null
@@ -1,688 +0,0 @@
-#include "rubysocket.h"
-
-VALUE rb_cSockOpt;
-
-static VALUE
-constant_to_sym(int constant, ID (*intern_const)(int))
-{
- ID name = intern_const(constant);
- if (name) {
- return ID2SYM(name);
- }
-
- return INT2NUM(constant);
-}
-
-static VALUE
-optname_to_sym(int level, int optname)
-{
- switch (level) {
- case SOL_SOCKET:
- return constant_to_sym(optname, rsock_intern_so_optname);
- case IPPROTO_IP:
- return constant_to_sym(optname, rsock_intern_ip_optname);
-#ifdef INET6
- case IPPROTO_IPV6:
- return constant_to_sym(optname, rsock_intern_ipv6_optname);
-#endif
- case IPPROTO_TCP:
- return constant_to_sym(optname, rsock_intern_tcp_optname);
- case IPPROTO_UDP:
- return constant_to_sym(optname, rsock_intern_udp_optname);
- default:
- return INT2NUM(optname);
- }
-}
-
-/*
- * call-seq:
- * Socket::Option.new(family, level, optname, data) => sockopt
- *
- * Returns a new Socket::Option object.
- *
- * sockopt = Socket::Option.new(:INET, :SOCKET, :KEEPALIVE, [1].pack("i"))
- * p sockopt #=> #<Socket::Option: INET SOCKET KEEPALIVE 1>
- *
- */
-static VALUE
-sockopt_initialize(VALUE self, VALUE vfamily, VALUE vlevel, VALUE voptname, VALUE data)
-{
- int family = rsock_family_arg(vfamily);
- int level = rsock_level_arg(family, vlevel);
- int optname = rsock_optname_arg(family, level, voptname);
- StringValue(data);
- rb_ivar_set(self, rb_intern("family"), INT2NUM(family));
- rb_ivar_set(self, rb_intern("level"), INT2NUM(level));
- rb_ivar_set(self, rb_intern("optname"), INT2NUM(optname));
- rb_ivar_set(self, rb_intern("data"), data);
- return self;
-}
-
-VALUE
-rsock_sockopt_new(int family, int level, int optname, VALUE data)
-{
- NEWOBJ(obj, struct RObject);
- OBJSETUP(obj, rb_cSockOpt, T_OBJECT);
- StringValue(data);
- sockopt_initialize((VALUE)obj, INT2NUM(family), INT2NUM(level), INT2NUM(optname), data);
- return (VALUE)obj;
-}
-
-/*
- * call-seq:
- * sockopt.family => integer
- *
- * returns the socket family as an integer.
- *
- * p Socket::Option.new(:INET6, :IPV6, :RECVPKTINFO, [1].pack("i!")).family
- * #=> 10
- */
-static VALUE
-sockopt_family_m(VALUE self)
-{
- return rb_attr_get(self, rb_intern("family"));
-}
-
-static int
-sockopt_level(VALUE self)
-{
- return NUM2INT(rb_attr_get(self, rb_intern("level")));
-}
-
-/*
- * call-seq:
- * sockopt.level => integer
- *
- * returns the socket level as an integer.
- *
- * p Socket::Option.new(:INET6, :IPV6, :RECVPKTINFO, [1].pack("i!")).level
- * #=> 41
- */
-static VALUE
-sockopt_level_m(VALUE self)
-{
- return INT2NUM(sockopt_level(self));
-}
-
-static int
-sockopt_optname(VALUE self)
-{
- return NUM2INT(rb_attr_get(self, rb_intern("optname")));
-}
-
-/*
- * call-seq:
- * sockopt.optname => integer
- *
- * returns the socket option name as an integer.
- *
- * p Socket::Option.new(:INET6, :IPV6, :RECVPKTINFO, [1].pack("i!")).optname
- * #=> 2
- */
-static VALUE
-sockopt_optname_m(VALUE self)
-{
- return INT2NUM(sockopt_optname(self));
-}
-
-/*
- * call-seq:
- * sockopt.data => string
- *
- * returns the socket option data as a string.
- *
- * p Socket::Option.new(:INET6, :IPV6, :RECVPKTINFO, [1].pack("i!")).data
- * #=> "\x01\x00\x00\x00"
- */
-static VALUE
-sockopt_data(VALUE self)
-{
- VALUE v = rb_attr_get(self, rb_intern("data"));
- StringValue(v);
- return v;
-}
-
-/*
- * call-seq:
- * Socket::Option.int(family, level, optname, integer) => sockopt
- *
- * Creates a new Socket::Option object which contains an int as data.
- *
- * The size and endian is dependent on the host.
- *
- * p Socket::Option.int(:INET, :SOCKET, :KEEPALIVE, 1)
- * #=> #<Socket::Option: INET SOCKET KEEPALIVE 1>
- */
-static VALUE
-sockopt_s_int(VALUE klass, VALUE vfamily, VALUE vlevel, VALUE voptname, VALUE vint)
-{
- int family = rsock_family_arg(vfamily);
- int level = rsock_level_arg(family, vlevel);
- int optname = rsock_optname_arg(family, level, voptname);
- int i = NUM2INT(vint);
- return rsock_sockopt_new(family, level, optname, rb_str_new((char*)&i, sizeof(i)));
-}
-
-/*
- * call-seq:
- * sockopt.int => integer
- *
- * Returns the data in _sockopt_ as an int.
- *
- * The size and endian is dependent on the host.
- *
- * sockopt = Socket::Option.int(:INET, :SOCKET, :KEEPALIVE, 1)
- * p sockopt.int => 1
- */
-static VALUE
-sockopt_int(VALUE self)
-{
- int i;
- VALUE data = sockopt_data(self);
- StringValue(data);
- if (RSTRING_LEN(data) != sizeof(int))
- rb_raise(rb_eTypeError, "size differ. expected as sizeof(int)=%d but %ld",
- (int)sizeof(int), (long)RSTRING_LEN(data));
- memcpy((char*)&i, RSTRING_PTR(data), sizeof(int));
- return INT2NUM(i);
-}
-
-/*
- * call-seq:
- * Socket::Option.bool(family, level, optname, bool) => sockopt
- *
- * Creates a new Socket::Option object which contains boolean as data.
- * Actually 0 or 1 as int is used.
- *
- * p Socket::Option.bool(:INET, :SOCKET, :KEEPALIVE, true)
- * #=> #<Socket::Option: INET SOCKET KEEPALIVE 1>
- *
- * p Socket::Option.bool(:INET, :SOCKET, :KEEPALIVE, false)
- * #=> #<Socket::Option: AF_INET SOCKET KEEPALIVE 0>
- *
- */
-static VALUE
-sockopt_s_bool(VALUE klass, VALUE vfamily, VALUE vlevel, VALUE voptname, VALUE vbool)
-{
- int family = rsock_family_arg(vfamily);
- int level = rsock_level_arg(family, vlevel);
- int optname = rsock_optname_arg(family, level, voptname);
- int i = RTEST(vbool) ? 1 : 0;
- return rsock_sockopt_new(family, level, optname, rb_str_new((char*)&i, sizeof(i)));
-}
-
-/*
- * call-seq:
- * sockopt.bool => true or false
- *
- * Returns the data in _sockopt_ as an boolean value.
- *
- * sockopt = Socket::Option.int(:INET, :SOCKET, :KEEPALIVE, 1)
- * p sockopt.bool => true
- */
-static VALUE
-sockopt_bool(VALUE self)
-{
- int i;
- VALUE data = sockopt_data(self);
- StringValue(data);
- if (RSTRING_LEN(data) != sizeof(int))
- rb_raise(rb_eTypeError, "size differ. expected as sizeof(int)=%d but %ld",
- (int)sizeof(int), (long)RSTRING_LEN(data));
- memcpy((char*)&i, RSTRING_PTR(data), sizeof(int));
- return i == 0 ? Qfalse : Qtrue;
-}
-
-/*
- * call-seq:
- * Socket::Option.linger(onoff, secs) => sockopt
- *
- * Creates a new Socket::Option object for SOL_SOCKET/SO_LINGER.
- *
- * _onoff_ should be an integer or a boolean.
- *
- * _secs_ should be the number of seconds.
- *
- * p Socket::Option.linger(true, 10)
- * #=> #<Socket::Option: UNSPEC SOCKET LINGER on 10sec>
- *
- */
-static VALUE
-sockopt_s_linger(VALUE klass, VALUE vonoff, VALUE vsecs)
-{
- VALUE tmp;
- struct linger l;
- memset(&l, 0, sizeof(l));
- if (!NIL_P(tmp = rb_check_to_integer(vonoff, "to_int")))
- l.l_onoff = NUM2INT(tmp);
- else
- l.l_onoff = RTEST(vonoff) ? 1 : 0;
- l.l_linger = NUM2INT(vsecs);
- return rsock_sockopt_new(AF_UNSPEC, SOL_SOCKET, SO_LINGER, rb_str_new((char*)&l, sizeof(l)));
-}
-
-/*
- * call-seq:
- * sockopt.linger => [bool, seconds]
- *
- * Returns the linger data in _sockopt_ as a pair of boolean and integer.
- *
- * sockopt = Socket::Option.linger(true, 10)
- * p sockopt.linger => [true, 10]
- */
-static VALUE
-sockopt_linger(VALUE self)
-{
- int level = sockopt_level(self);
- int optname = sockopt_optname(self);
- VALUE data = sockopt_data(self);
- struct linger l;
- VALUE vonoff, vsecs;
-
- if (level != SOL_SOCKET || optname != SO_LINGER)
- rb_raise(rb_eTypeError, "linger socket option expected");
- if (RSTRING_LEN(data) != sizeof(l))
- rb_raise(rb_eTypeError, "size differ. expected as sizeof(struct linger)=%d but %ld",
- (int)sizeof(struct linger), (long)RSTRING_LEN(data));
- memcpy((char*)&l, RSTRING_PTR(data), sizeof(struct linger));
- switch (l.l_onoff) {
- case 0: vonoff = Qfalse; break;
- case 1: vonoff = Qtrue; break;
- default: vonoff = INT2NUM(l.l_onoff); break;
- }
- vsecs = INT2NUM(l.l_linger);
- return rb_assoc_new(vonoff, vsecs);
-}
-
-static int
-inspect_int(int level, int optname, VALUE data, VALUE ret)
-{
- if (RSTRING_LEN(data) == sizeof(int)) {
- int i;
- memcpy((char*)&i, RSTRING_PTR(data), sizeof(int));
- rb_str_catf(ret, " %d", i);
- return 1;
- }
- else {
- return 0;
- }
-}
-
-static int
-inspect_errno(int level, int optname, VALUE data, VALUE ret)
-{
- if (RSTRING_LEN(data) == sizeof(int)) {
- int i;
- char *err;
- memcpy((char*)&i, RSTRING_PTR(data), sizeof(int));
- err = strerror(i);
- rb_str_catf(ret, " %s (%d)", err, i);
- return 1;
- }
- else {
- return 0;
- }
-}
-
-#if defined(IPV6_MULTICAST_IF) || defined(IPV6_MULTICAST_LOOP)
-static int
-inspect_uint(int level, int optname, VALUE data, VALUE ret)
-{
- if (RSTRING_LEN(data) == sizeof(int)) {
- unsigned int i;
- memcpy((char*)&i, RSTRING_PTR(data), sizeof(unsigned int));
- rb_str_catf(ret, " %u", i);
- return 1;
- }
- else {
- return 0;
- }
-}
-#endif
-
-#if defined(SOL_SOCKET) && defined(SO_LINGER) /* POSIX */
-static int
-inspect_linger(int level, int optname, VALUE data, VALUE ret)
-{
- if (RSTRING_LEN(data) == sizeof(struct linger)) {
- struct linger s;
- memcpy((char*)&s, RSTRING_PTR(data), sizeof(s));
- switch (s.l_onoff) {
- case 0: rb_str_cat2(ret, " off"); break;
- case 1: rb_str_cat2(ret, " on"); break;
- default: rb_str_catf(ret, " on(%d)", s.l_onoff); break;
- }
- rb_str_catf(ret, " %dsec", s.l_linger);
- return 1;
- }
- else {
- return 0;
- }
-}
-#endif
-
-#if defined(SOL_SOCKET) && defined(SO_TYPE) /* POSIX */
-static int
-inspect_socktype(int level, int optname, VALUE data, VALUE ret)
-{
- if (RSTRING_LEN(data) == sizeof(int)) {
- int i;
- ID id;
- memcpy((char*)&i, RSTRING_PTR(data), sizeof(int));
- id = rsock_intern_socktype(i);
- if (id)
- rb_str_catf(ret, " %s", rb_id2name(id));
- else
- rb_str_catf(ret, " %d", i);
- return 1;
- }
- else {
- return 0;
- }
-}
-#endif
-
-static int
-inspect_timeval_as_interval(int level, int optname, VALUE data, VALUE ret)
-{
- if (RSTRING_LEN(data) == sizeof(struct timeval)) {
- struct timeval s;
- memcpy((char*)&s, RSTRING_PTR(data), sizeof(s));
- rb_str_catf(ret, " %ld.%06ldsec", (long)s.tv_sec, (long)s.tv_usec);
- return 1;
- }
- else {
- return 0;
- }
-}
-
-#if defined(SOL_SOCKET) && defined(SO_PEERCRED) /* GNU/Linux */
-static int
-inspect_peercred(int level, int optname, VALUE data, VALUE ret)
-{
- if (RSTRING_LEN(data) == sizeof(struct ucred)) {
- struct ucred cred;
- memcpy(&cred, RSTRING_PTR(data), sizeof(struct ucred));
- rb_str_catf(ret, " pid=%u euid=%u egid=%u",
- (unsigned)cred.pid, (unsigned)cred.uid, (unsigned)cred.gid);
- rb_str_cat2(ret, " (ucred)");
- return 1;
- }
- else {
- return 0;
- }
-}
-#endif
-
-#if defined(LOCAL_PEERCRED) /* FreeBSD, MacOS X */
-static int
-inspect_local_peercred(int level, int optname, VALUE data, VALUE ret)
-{
- if (RSTRING_LEN(data) == sizeof(struct xucred)) {
- struct xucred cred;
- memcpy(&cred, RSTRING_PTR(data), sizeof(struct xucred));
- if (cred.cr_version != XUCRED_VERSION)
- return 0;
- rb_str_catf(ret, " version=%u", cred.cr_version);
- rb_str_catf(ret, " euid=%u", cred.cr_uid);
- if (cred.cr_ngroups) {
- int i;
- const char *sep = " groups=";
- for (i = 0; i < cred.cr_ngroups; i++) {
- rb_str_catf(ret, "%s%u", sep, cred.cr_groups[i]);
- sep = ",";
- }
- }
- rb_str_cat2(ret, " (xucred)");
- return 1;
- }
- else {
- return 0;
- }
-}
-#endif
-
-
-/*
- * call-seq:
- * sockopt.inspect => string
- *
- * Returns a string which shows sockopt in human-readable form.
- *
- * p Socket::Option.new(:INET, :SOCKET, :KEEPALIVE, [1].pack("i")).inspect
- * #=> "#<Socket::Option: INET SOCKET KEEPALIVE 1>"
- *
- */
-static VALUE
-sockopt_inspect(VALUE self)
-{
- int family = NUM2INT(sockopt_family_m(self));
- int level = NUM2INT(sockopt_level_m(self));
- int optname = NUM2INT(sockopt_optname_m(self));
- VALUE data = sockopt_data(self);
- VALUE v, ret;
- ID family_id, level_id, optname_id;
- int inspected;
-
- StringValue(data);
-
- ret = rb_sprintf("#<%s:", rb_obj_classname(self));
-
- family_id = rsock_intern_family_noprefix(family);
- if (family_id)
- rb_str_catf(ret, " %s", rb_id2name(family_id));
- else
- rb_str_catf(ret, " family:%d", family);
-
- if (level == SOL_SOCKET) {
- rb_str_cat2(ret, " SOCKET");
-
- optname_id = rsock_intern_so_optname(optname);
- if (optname_id)
- rb_str_catf(ret, " %s", rb_id2name(optname_id));
- else
- rb_str_catf(ret, " optname:%d", optname);
- }
-#ifdef HAVE_SYS_UN_H
- else if (family == AF_UNIX) {
- rb_str_catf(ret, " level:%d", level);
-
- optname_id = rsock_intern_local_optname(optname);
- if (optname_id)
- rb_str_catf(ret, " %s", rb_id2name(optname_id));
- else
- rb_str_catf(ret, " optname:%d", optname);
- }
-#endif
- else if (IS_IP_FAMILY(family)) {
- level_id = rsock_intern_iplevel(level);
- if (level_id)
- rb_str_catf(ret, " %s", rb_id2name(level_id));
- else
- rb_str_catf(ret, " level:%d", level);
-
- v = optname_to_sym(level, optname);
- if (SYMBOL_P(v))
- rb_str_catf(ret, " %s", rb_id2name(SYM2ID(v)));
- else
- rb_str_catf(ret, " optname:%d", optname);
- }
- else {
- rb_str_catf(ret, " level:%d", level);
- rb_str_catf(ret, " optname:%d", optname);
- }
-
- inspected = 0;
-
- if (level == SOL_SOCKET)
- family = AF_UNSPEC;
- switch (family) {
- case AF_UNSPEC:
- switch (level) {
- case SOL_SOCKET:
- switch (optname) {
-# if defined(SO_DEBUG) /* POSIX */
- case SO_DEBUG: inspected = inspect_int(level, optname, data, ret); break;
-# endif
-# if defined(SO_ERROR) /* POSIX */
- case SO_ERROR: inspected = inspect_errno(level, optname, data, ret); break;
-# endif
-# if defined(SO_TYPE) /* POSIX */
- case SO_TYPE: inspected = inspect_socktype(level, optname, data, ret); break;
-# endif
-# if defined(SO_ACCEPTCONN) /* POSIX */
- case SO_ACCEPTCONN: inspected = inspect_int(level, optname, data, ret); break;
-# endif
-# if defined(SO_BROADCAST) /* POSIX */
- case SO_BROADCAST: inspected = inspect_int(level, optname, data, ret); break;
-# endif
-# if defined(SO_REUSEADDR) /* POSIX */
- case SO_REUSEADDR: inspected = inspect_int(level, optname, data, ret); break;
-# endif
-# if defined(SO_KEEPALIVE) /* POSIX */
- case SO_KEEPALIVE: inspected = inspect_int(level, optname, data, ret); break;
-# endif
-# if defined(SO_OOBINLINE) /* POSIX */
- case SO_OOBINLINE: inspected = inspect_int(level, optname, data, ret); break;
-# endif
-# if defined(SO_SNDBUF) /* POSIX */
- case SO_SNDBUF: inspected = inspect_int(level, optname, data, ret); break;
-# endif
-# if defined(SO_RCVBUF) /* POSIX */
- case SO_RCVBUF: inspected = inspect_int(level, optname, data, ret); break;
-# endif
-# if defined(SO_DONTROUTE) /* POSIX */
- case SO_DONTROUTE: inspected = inspect_int(level, optname, data, ret); break;
-# endif
-# if defined(SO_RCVLOWAT) /* POSIX */
- case SO_RCVLOWAT: inspected = inspect_int(level, optname, data, ret); break;
-# endif
-# if defined(SO_SNDLOWAT) /* POSIX */
- case SO_SNDLOWAT: inspected = inspect_int(level, optname, data, ret); break;
-# endif
-# if defined(SO_LINGER) /* POSIX */
- case SO_LINGER: inspected = inspect_linger(level, optname, data, ret); break;
-# endif
-# if defined(SO_RCVTIMEO) /* POSIX */
- case SO_RCVTIMEO: inspected = inspect_timeval_as_interval(level, optname, data, ret); break;
-# endif
-# if defined(SO_SNDTIMEO) /* POSIX */
- case SO_SNDTIMEO: inspected = inspect_timeval_as_interval(level, optname, data, ret); break;
-# endif
-# if defined(SO_PEERCRED) /* GNU/Linux */
- case SO_PEERCRED: inspected = inspect_peercred(level, optname, data, ret); break;
-# endif
- }
- break;
- }
- break;
-
- case AF_INET:
-#ifdef INET6
- case AF_INET6:
-#endif
- switch (level) {
-# if defined(IPPROTO_IPV6)
- case IPPROTO_IPV6:
- switch (optname) {
- /* IPV6_JOIN_GROUP ipv6_mreq, IPV6_LEAVE_GROUP ipv6_mreq */
-# if defined(IPV6_MULTICAST_HOPS) /* POSIX */
- case IPV6_MULTICAST_HOPS: inspected = inspect_int(level, optname, data, ret); break;
-# endif
-# if defined(IPV6_MULTICAST_IF) /* POSIX */
- case IPV6_MULTICAST_IF: inspected = inspect_uint(level, optname, data, ret); break;
-# endif
-# if defined(IPV6_MULTICAST_LOOP) /* POSIX */
- case IPV6_MULTICAST_LOOP: inspected = inspect_uint(level, optname, data, ret); break;
-# endif
-# if defined(IPV6_UNICAST_HOPS) /* POSIX */
- case IPV6_UNICAST_HOPS: inspected = inspect_int(level, optname, data, ret); break;
-# endif
-# if defined(IPV6_V6ONLY) /* POSIX */
- case IPV6_V6ONLY: inspected = inspect_int(level, optname, data, ret); break;
-# endif
- }
- break;
-# endif
-
-# if defined(IPPROTO_TCP)
- case IPPROTO_TCP:
- switch (optname) {
-# if defined(TCP_NODELAY) /* POSIX */
- case TCP_NODELAY: inspected = inspect_int(level, optname, data, ret); break;
-# endif
- }
- break;
-# endif
- }
- break;
-
-#ifdef HAVE_SYS_UN_H
- case AF_UNIX:
- switch (level) {
- case 0:
- switch (optname) {
-# if defined(LOCAL_PEERCRED)
- case LOCAL_PEERCRED: inspected = inspect_local_peercred(level, optname, data, ret); break;
-# endif
- }
- break;
- }
- break;
-#endif
- }
-
- if (!inspected) {
- data = rb_str_dump(data);
- rb_str_catf(ret, " %s", StringValueCStr(data));
- }
-
- rb_str_cat2(ret, ">");
-
- return ret;
-}
-
-/*
- * call-seq:
- * sockopt.unpack(template) => array
- *
- * Calls String#unpack on sockopt.data.
- *
- * sockopt = Socket::Option.new(:INET, :SOCKET, :KEEPALIVE, [1].pack("i"))
- * p sockopt.unpack("i") #=> [1]
- * p sockopt.data.unpack("i") #=> [1]
- */
-static VALUE
-sockopt_unpack(VALUE self, VALUE template)
-{
- return rb_funcall(sockopt_data(self), rb_intern("unpack"), 1, template);
-}
-
-void
-Init_sockopt(void)
-{
- /* for rdoc */
- /* rb_cSocket = rb_define_class("Socket", rb_cBasicSocket); */
-
- rb_cSockOpt = rb_define_class_under(rb_cSocket, "Option", rb_cObject);
- rb_define_method(rb_cSockOpt, "initialize", sockopt_initialize, 4);
- rb_define_method(rb_cSockOpt, "family", sockopt_family_m, 0);
- rb_define_method(rb_cSockOpt, "level", sockopt_level_m, 0);
- rb_define_method(rb_cSockOpt, "optname", sockopt_optname_m, 0);
- rb_define_method(rb_cSockOpt, "data", sockopt_data, 0);
- rb_define_method(rb_cSockOpt, "inspect", sockopt_inspect, 0);
-
- rb_define_singleton_method(rb_cSockOpt, "int", sockopt_s_int, 4);
- rb_define_method(rb_cSockOpt, "int", sockopt_int, 0);
-
- rb_define_singleton_method(rb_cSockOpt, "bool", sockopt_s_bool, 4);
- rb_define_method(rb_cSockOpt, "bool", sockopt_bool, 0);
-
- rb_define_singleton_method(rb_cSockOpt, "linger", sockopt_s_linger, 2);
- rb_define_method(rb_cSockOpt, "linger", sockopt_linger, 0);
-
- rb_define_method(rb_cSockOpt, "unpack", sockopt_unpack, 1);
-
- 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
deleted file mode 100644
index 21cc953e1f..0000000000
--- a/ext/socket/raddrinfo.c
+++ /dev/null
@@ -1,2171 +0,0 @@
-/************************************************
-
- ainfo.c -
-
- created at: Thu Mar 31 12:21:29 JST 1994
-
- Copyright (C) 1993-2007 Yukihiro Matsumoto
-
-************************************************/
-
-#include "rubysocket.h"
-
-#if defined(INET6) && (defined(LOOKUP_ORDER_HACK_INET) || defined(LOOKUP_ORDER_HACK_INET6))
-#define LOOKUP_ORDERS (sizeof(lookup_order_table) / sizeof(lookup_order_table[0]))
-static const int lookup_order_table[] = {
-#if defined(LOOKUP_ORDER_HACK_INET)
- PF_INET, PF_INET6, PF_UNSPEC,
-#elif defined(LOOKUP_ORDER_HACK_INET6)
- PF_INET6, PF_INET, PF_UNSPEC,
-#else
- /* should not happen */
-#endif
-};
-
-static int
-ruby_getaddrinfo(const char *nodename, const char *servname,
- const struct addrinfo *hints, struct addrinfo **res)
-{
- struct addrinfo tmp_hints;
- int i, af, error;
-
- if (hints->ai_family != PF_UNSPEC) {
- return getaddrinfo(nodename, servname, hints, res);
- }
-
- for (i = 0; i < LOOKUP_ORDERS; i++) {
- af = lookup_order_table[i];
- MEMCPY(&tmp_hints, hints, struct addrinfo, 1);
- tmp_hints.ai_family = af;
- error = getaddrinfo(nodename, servname, &tmp_hints, res);
- if (error) {
- if (tmp_hints.ai_family == PF_UNSPEC) {
- break;
- }
- }
- else {
- break;
- }
- }
-
- return error;
-}
-#define getaddrinfo(node,serv,hints,res) ruby_getaddrinfo((node),(serv),(hints),(res))
-#endif
-
-#if defined(_AIX)
-static int
-ruby_getaddrinfo__aix(const char *nodename, const char *servname,
- struct addrinfo *hints, struct addrinfo **res)
-{
- int error = getaddrinfo(nodename, servname, hints, res);
- struct addrinfo *r;
- if (error)
- return error;
- for (r = *res; r != NULL; r = r->ai_next) {
- if (r->ai_addr->sa_family == 0)
- r->ai_addr->sa_family = r->ai_family;
- if (r->ai_addr->sa_len == 0)
- r->ai_addr->sa_len = r->ai_addrlen;
- }
- return 0;
-}
-#undef getaddrinfo
-#define getaddrinfo(node,serv,hints,res) ruby_getaddrinfo__aix((node),(serv),(hints),(res))
-static int
-ruby_getnameinfo__aix(const struct sockaddr *sa, size_t salen,
- char *host, size_t hostlen,
- char *serv, size_t servlen, int flags)
-{
- struct sockaddr_in6 *sa6;
- u_int32_t *a6;
-
- if (sa->sa_family == AF_INET6) {
- sa6 = (struct sockaddr_in6 *)sa;
- a6 = sa6->sin6_addr.u6_addr.u6_addr32;
-
- if (a6[0] == 0 && a6[1] == 0 && a6[2] == 0 && a6[3] == 0) {
- strncpy(host, "::", hostlen);
- snprintf(serv, servlen, "%d", sa6->sin6_port);
- return 0;
- }
- }
- return getnameinfo(sa, salen, host, hostlen, serv, servlen, flags);
-}
-#undef getnameinfo
-#define getnameinfo(sa, salen, host, hostlen, serv, servlen, flags) \
- ruby_getnameinfo__aix((sa), (salen), (host), (hostlen), (serv), (servlen), (flags))
-#endif
-
-#ifndef GETADDRINFO_EMU
-struct getaddrinfo_arg
-{
- const char *node;
- const char *service;
- const struct addrinfo *hints;
- struct addrinfo **res;
-};
-
-static VALUE
-nogvl_getaddrinfo(void *arg)
-{
- struct getaddrinfo_arg *ptr = arg;
- return getaddrinfo(ptr->node, ptr->service,
- ptr->hints, ptr->res);
-}
-#endif
-
-int
-rb_getaddrinfo(const char *node, const char *service,
- const struct addrinfo *hints,
- struct addrinfo **res)
-{
-#ifdef GETADDRINFO_EMU
- return getaddrinfo(node, service, hints, res);
-#else
- struct getaddrinfo_arg arg;
- int ret;
- arg.node = node;
- arg.service = service;
- arg.hints = hints;
- arg.res = res;
- ret = BLOCKING_REGION(nogvl_getaddrinfo, &arg);
- return ret;
-#endif
-}
-
-#ifndef GETADDRINFO_EMU
-struct getnameinfo_arg
-{
- const struct sockaddr *sa;
- socklen_t salen;
- char *host;
- size_t hostlen;
- char *serv;
- size_t servlen;
- int flags;
-};
-
-static VALUE
-nogvl_getnameinfo(void *arg)
-{
- struct getnameinfo_arg *ptr = arg;
- return getnameinfo(ptr->sa, ptr->salen,
- ptr->host, ptr->hostlen,
- ptr->serv, ptr->servlen,
- ptr->flags);
-}
-#endif
-
-int
-rb_getnameinfo(const struct sockaddr *sa, socklen_t salen,
- char *host, size_t hostlen,
- char *serv, size_t servlen, int flags)
-{
-#ifdef GETADDRINFO_EMU
- return getnameinfo(sa, salen, host, hostlen, serv, servlen, flags);
-#else
- struct getnameinfo_arg arg;
- int ret;
- arg.sa = sa;
- arg.salen = salen;
- arg.host = host;
- arg.hostlen = hostlen;
- arg.serv = serv;
- arg.servlen = servlen;
- arg.flags = flags;
- ret = BLOCKING_REGION(nogvl_getnameinfo, &arg);
- return ret;
-#endif
-}
-
-static void
-make_ipaddr0(struct sockaddr *addr, char *buf, size_t len)
-{
- int error;
-
- error = rb_getnameinfo(addr, SA_LEN(addr), buf, len, NULL, 0, NI_NUMERICHOST);
- if (error) {
- rsock_raise_socket_error("getnameinfo", error);
- }
-}
-
-VALUE
-rsock_make_ipaddr(struct sockaddr *addr)
-{
- char hbuf[1024];
-
- make_ipaddr0(addr, hbuf, sizeof(hbuf));
- return rb_str_new2(hbuf);
-}
-
-static void
-make_inetaddr(long host, char *buf, size_t len)
-{
- struct sockaddr_in sin;
-
- MEMZERO(&sin, struct sockaddr_in, 1);
- sin.sin_family = AF_INET;
- SET_SIN_LEN(&sin, sizeof(sin));
- sin.sin_addr.s_addr = host;
- make_ipaddr0((struct sockaddr*)&sin, buf, len);
-}
-
-static int
-str_isnumber(const char *p)
-{
- char *ep;
-
- if (!p || *p == '\0')
- return 0;
- ep = NULL;
- (void)STRTOUL(p, &ep, 10);
- if (ep && *ep == '\0')
- return 1;
- else
- return 0;
-}
-
-static char*
-host_str(VALUE host, char *hbuf, size_t len, int *flags_ptr)
-{
- if (NIL_P(host)) {
- return NULL;
- }
- else if (rb_obj_is_kind_of(host, rb_cInteger)) {
- unsigned long i = NUM2ULONG(host);
-
- make_inetaddr(htonl(i), hbuf, len);
- if (flags_ptr) *flags_ptr |= AI_NUMERICHOST;
- return hbuf;
- }
- else {
- char *name;
-
- SafeStringValue(host);
- name = RSTRING_PTR(host);
- if (!name || *name == 0 || (name[0] == '<' && strcmp(name, "<any>") == 0)) {
- make_inetaddr(INADDR_ANY, hbuf, len);
- if (flags_ptr) *flags_ptr |= AI_NUMERICHOST;
- }
- else if (name[0] == '<' && strcmp(name, "<broadcast>") == 0) {
- make_inetaddr(INADDR_BROADCAST, hbuf, len);
- if (flags_ptr) *flags_ptr |= AI_NUMERICHOST;
- }
- else if (strlen(name) >= len) {
- rb_raise(rb_eArgError, "hostname too long (%"PRIuSIZE")",
- strlen(name));
- }
- else {
- strcpy(hbuf, name);
- }
- return hbuf;
- }
-}
-
-static char*
-port_str(VALUE port, char *pbuf, size_t len, int *flags_ptr)
-{
- if (NIL_P(port)) {
- return 0;
- }
- else if (FIXNUM_P(port)) {
- snprintf(pbuf, len, "%ld", FIX2LONG(port));
-#ifdef AI_NUMERICSERV
- if (flags_ptr) *flags_ptr |= AI_NUMERICSERV;
-#endif
- return pbuf;
- }
- else {
- char *serv;
-
- SafeStringValue(port);
- serv = RSTRING_PTR(port);
- if (strlen(serv) >= len) {
- rb_raise(rb_eArgError, "service name too long (%"PRIuSIZE")",
- strlen(serv));
- }
- strcpy(pbuf, serv);
- return pbuf;
- }
-}
-
-struct addrinfo*
-rsock_getaddrinfo(VALUE host, VALUE port, struct addrinfo *hints, int socktype_hack)
-{
- struct 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_isnumber(portp)) {
- hints->ai_socktype = SOCK_DGRAM;
- }
- hints->ai_flags |= additional_flags;
-
- error = rb_getaddrinfo(hostp, portp, hints, &res);
- if (error) {
- if (hostp && hostp[strlen(hostp)-1] == '\n') {
- rb_raise(rb_eSocket, "newline at the end of hostname");
- }
- rsock_raise_socket_error("getaddrinfo", error);
- }
-
-#if defined(__APPLE__) && defined(__MACH__)
- {
- struct addrinfo *r;
- r = res;
- while (r) {
- if (! r->ai_socktype) r->ai_socktype = hints->ai_socktype;
- if (! r->ai_protocol) {
- if (r->ai_socktype == SOCK_DGRAM) {
- r->ai_protocol = IPPROTO_UDP;
- }
- else if (r->ai_socktype == SOCK_STREAM) {
- r->ai_protocol = IPPROTO_TCP;
- }
- }
- r = r->ai_next;
- }
- }
-#endif
- return res;
-}
-
-struct addrinfo*
-rsock_addrinfo(VALUE host, VALUE port, int socktype, int flags)
-{
- struct addrinfo hints;
-
- MEMZERO(&hints, struct addrinfo, 1);
- hints.ai_family = AF_UNSPEC;
- hints.ai_socktype = socktype;
- hints.ai_flags = flags;
- return rsock_getaddrinfo(host, port, &hints, 1);
-}
-
-VALUE
-rsock_ipaddr(struct sockaddr *sockaddr, int norevlookup)
-{
- VALUE family, port, addr1, addr2;
- VALUE ary;
- int error;
- char hbuf[1024], pbuf[1024];
- ID id;
-
- id = rsock_intern_family(sockaddr->sa_family);
- if (id) {
- family = rb_str_dup(rb_id2str(id));
- }
- else {
- sprintf(pbuf, "unknown:%d", sockaddr->sa_family);
- family = rb_str_new2(pbuf);
- }
-
- addr1 = Qnil;
- if (!norevlookup) {
- error = rb_getnameinfo(sockaddr, SA_LEN(sockaddr), hbuf, sizeof(hbuf),
- NULL, 0, 0);
- if (! error) {
- addr1 = rb_str_new2(hbuf);
- }
- }
- error = rb_getnameinfo(sockaddr, SA_LEN(sockaddr), hbuf, sizeof(hbuf),
- pbuf, sizeof(pbuf), NI_NUMERICHOST | NI_NUMERICSERV);
- if (error) {
- rsock_raise_socket_error("getnameinfo", error);
- }
- addr2 = rb_str_new2(hbuf);
- if (addr1 == Qnil) {
- addr1 = addr2;
- }
- port = INT2FIX(atoi(pbuf));
- ary = rb_ary_new3(4, family, port, addr1, addr2);
-
- return ary;
-}
-
-#ifdef HAVE_SYS_UN_H
-const char*
-rsock_unixpath(struct sockaddr_un *sockaddr, socklen_t len)
-{
- if (sockaddr->sun_path < (char*)sockaddr + len)
- return sockaddr->sun_path;
- else
- return "";
-}
-
-VALUE
-rsock_unixaddr(struct sockaddr_un *sockaddr, socklen_t len)
-{
- return rb_assoc_new(rb_str_new2("AF_UNIX"),
- rb_str_new2(rsock_unixpath(sockaddr, len)));
-}
-#endif
-
-struct hostent_arg {
- VALUE host;
- struct addrinfo* addr;
- VALUE (*ipaddr)(struct sockaddr*, size_t);
-};
-
-static VALUE
-make_hostent_internal(struct hostent_arg *arg)
-{
- VALUE host = arg->host;
- struct addrinfo* addr = arg->addr;
- VALUE (*ipaddr)(struct sockaddr*, size_t) = arg->ipaddr;
-
- struct addrinfo *ai;
- struct hostent *h;
- VALUE ary, names;
- char **pch;
- const char* hostp;
- char hbuf[NI_MAXHOST];
-
- ary = rb_ary_new();
- if (addr->ai_canonname) {
- hostp = addr->ai_canonname;
- }
- else {
- hostp = host_str(host, hbuf, sizeof(hbuf), NULL);
- }
- rb_ary_push(ary, rb_str_new2(hostp));
-
- if (addr->ai_canonname && (h = gethostbyname(addr->ai_canonname))) {
- names = rb_ary_new();
- if (h->h_aliases != NULL) {
- for (pch = h->h_aliases; *pch; pch++) {
- rb_ary_push(names, rb_str_new2(*pch));
- }
- }
- }
- else {
- names = rb_ary_new2(0);
- }
- rb_ary_push(ary, names);
- rb_ary_push(ary, INT2NUM(addr->ai_family));
- for (ai = addr; ai; ai = ai->ai_next) {
- rb_ary_push(ary, (*ipaddr)(ai->ai_addr, ai->ai_addrlen));
- }
-
- return ary;
-}
-
-VALUE
-rsock_make_hostent(VALUE host, struct addrinfo *addr, VALUE (*ipaddr)(struct sockaddr *, size_t))
-{
- struct hostent_arg arg;
-
- arg.host = host;
- arg.addr = addr;
- arg.ipaddr = ipaddr;
- return rb_ensure(make_hostent_internal, (VALUE)&arg,
- RUBY_METHOD_FUNC(freeaddrinfo), (VALUE)addr);
-}
-
-typedef struct {
- VALUE inspectname;
- VALUE canonname;
- int pfamily;
- int socktype;
- int protocol;
- size_t sockaddr_len;
- struct sockaddr_storage addr;
-} rb_addrinfo_t;
-
-static void
-addrinfo_mark(rb_addrinfo_t *rai)
-{
- if (rai) {
- rb_gc_mark(rai->inspectname);
- rb_gc_mark(rai->canonname);
- }
-}
-
-static void
-addrinfo_free(rb_addrinfo_t *rai)
-{
- xfree(rai);
-}
-
-static VALUE
-addrinfo_s_allocate(VALUE klass)
-{
- return Data_Wrap_Struct(klass, addrinfo_mark, addrinfo_free, 0);
-}
-
-#define IS_ADDRINFO(obj) (RDATA(obj)->dmark == (RUBY_DATA_FUNC)addrinfo_mark)
-static rb_addrinfo_t *
-check_addrinfo(VALUE self)
-{
- Check_Type(self, RUBY_T_DATA);
- if (!IS_ADDRINFO(self)) {
- rb_raise(rb_eTypeError, "wrong argument type %s (expected Addrinfo)",
- rb_class2name(CLASS_OF(self)));
- }
- return DATA_PTR(self);
-}
-
-static rb_addrinfo_t *
-get_addrinfo(VALUE self)
-{
- rb_addrinfo_t *rai = check_addrinfo(self);
-
- if (!rai) {
- rb_raise(rb_eTypeError, "uninitialized socket address");
- }
- return rai;
-}
-
-
-static rb_addrinfo_t *
-alloc_addrinfo()
-{
- rb_addrinfo_t *rai = ALLOC(rb_addrinfo_t);
- memset(rai, 0, sizeof(rb_addrinfo_t));
- rai->inspectname = Qnil;
- rai->canonname = Qnil;
- return rai;
-}
-
-static void
-init_addrinfo(rb_addrinfo_t *rai, struct sockaddr *sa, size_t len,
- int pfamily, int socktype, int protocol,
- VALUE canonname, VALUE inspectname)
-{
- if (sizeof(rai->addr) < len)
- rb_raise(rb_eArgError, "sockaddr string too big");
- memcpy((void *)&rai->addr, (void *)sa, len);
- rai->sockaddr_len = len;
-
- rai->pfamily = pfamily;
- rai->socktype = socktype;
- rai->protocol = protocol;
- rai->canonname = canonname;
- rai->inspectname = inspectname;
-}
-
-VALUE
-rsock_addrinfo_new(struct sockaddr *addr, socklen_t len,
- int family, int socktype, int protocol,
- VALUE canonname, VALUE inspectname)
-{
- VALUE a;
- rb_addrinfo_t *rai;
-
- a = addrinfo_s_allocate(rb_cAddrinfo);
- DATA_PTR(a) = rai = alloc_addrinfo();
- init_addrinfo(rai, addr, len, family, socktype, protocol, canonname, inspectname);
- return a;
-}
-
-static struct addrinfo *
-call_getaddrinfo(VALUE node, VALUE service,
- VALUE family, VALUE socktype, VALUE protocol, VALUE flags,
- int socktype_hack)
-{
- struct addrinfo hints, *res;
-
- MEMZERO(&hints, struct addrinfo, 1);
- hints.ai_family = NIL_P(family) ? PF_UNSPEC : rsock_family_arg(family);
-
- if (!NIL_P(socktype)) {
- hints.ai_socktype = rsock_socktype_arg(socktype);
- }
- if (!NIL_P(protocol)) {
- hints.ai_protocol = NUM2INT(protocol);
- }
- if (!NIL_P(flags)) {
- hints.ai_flags = NUM2INT(flags);
- }
- res = rsock_getaddrinfo(node, service, &hints, socktype_hack);
-
- if (res == NULL)
- rb_raise(rb_eSocket, "host not found");
- return res;
-}
-
-static VALUE make_inspectname(VALUE node, VALUE service, struct addrinfo *res);
-
-static void
-init_addrinfo_getaddrinfo(rb_addrinfo_t *rai, VALUE node, VALUE service,
- VALUE family, VALUE socktype, VALUE protocol, VALUE flags,
- VALUE inspectnode, VALUE inspectservice)
-{
- struct addrinfo *res = call_getaddrinfo(node, service, family, socktype, protocol, flags, 1);
- VALUE canonname;
- VALUE inspectname = rb_str_equal(node, inspectnode) ? Qnil : make_inspectname(inspectnode, inspectservice, res);
-
- canonname = Qnil;
- if (res->ai_canonname) {
- canonname = rb_tainted_str_new_cstr(res->ai_canonname);
- OBJ_FREEZE(canonname);
- }
-
- init_addrinfo(rai, res->ai_addr, res->ai_addrlen,
- NUM2INT(family), NUM2INT(socktype), NUM2INT(protocol),
- canonname, inspectname);
-
- freeaddrinfo(res);
-}
-
-static VALUE
-make_inspectname(VALUE node, VALUE service, struct addrinfo *res)
-{
- VALUE inspectname = Qnil;
-
- if (res) {
- char hbuf[NI_MAXHOST], pbuf[NI_MAXSERV];
- int ret;
- ret = rb_getnameinfo(res->ai_addr, res->ai_addrlen, hbuf,
- sizeof(hbuf), pbuf, sizeof(pbuf),
- NI_NUMERICHOST|NI_NUMERICSERV);
- if (ret == 0) {
- if (TYPE(node) == T_STRING && strcmp(hbuf, RSTRING_PTR(node)) == 0)
- node = Qnil;
- if (TYPE(service) == T_STRING && strcmp(pbuf, RSTRING_PTR(service)) == 0)
- service = Qnil;
- else if (TYPE(service) == T_FIXNUM && atoi(pbuf) == FIX2INT(service))
- service = Qnil;
- }
- }
-
- if (TYPE(node) == T_STRING) {
- inspectname = rb_str_dup(node);
- }
- if (TYPE(service) == T_STRING) {
- if (NIL_P(inspectname))
- inspectname = rb_sprintf(":%s", StringValueCStr(service));
- else
- rb_str_catf(inspectname, ":%s", StringValueCStr(service));
- }
- else if (TYPE(service) == T_FIXNUM && FIX2INT(service) != 0)
- {
- if (NIL_P(inspectname))
- inspectname = rb_sprintf(":%d", FIX2INT(service));
- else
- rb_str_catf(inspectname, ":%d", FIX2INT(service));
- }
- if (!NIL_P(inspectname)) {
- OBJ_INFECT(inspectname, node);
- OBJ_INFECT(inspectname, service);
- OBJ_FREEZE(inspectname);
- }
- return inspectname;
-}
-
-static VALUE
-addrinfo_firstonly_new(VALUE node, VALUE service, VALUE family, VALUE socktype, VALUE protocol, VALUE flags)
-{
- VALUE ret;
- VALUE canonname;
- VALUE inspectname;
-
- struct addrinfo *res = call_getaddrinfo(node, service, family, socktype, protocol, flags, 0);
-
- inspectname = make_inspectname(node, service, res);
-
- canonname = Qnil;
- if (res->ai_canonname) {
- canonname = rb_tainted_str_new_cstr(res->ai_canonname);
- OBJ_FREEZE(canonname);
- }
-
- ret = rsock_addrinfo_new(res->ai_addr, res->ai_addrlen,
- res->ai_family, res->ai_socktype, res->ai_protocol,
- canonname, inspectname);
-
- freeaddrinfo(res);
- return ret;
-}
-
-static VALUE
-addrinfo_list_new(VALUE node, VALUE service, VALUE family, VALUE socktype, VALUE protocol, VALUE flags)
-{
- VALUE ret;
- struct addrinfo *r;
- VALUE inspectname;
-
- struct addrinfo *res = call_getaddrinfo(node, service, family, socktype, protocol, flags, 0);
-
- inspectname = make_inspectname(node, service, res);
-
- ret = rb_ary_new();
- for (r = res; r; r = r->ai_next) {
- VALUE addr;
- VALUE canonname = Qnil;
-
- if (r->ai_canonname) {
- canonname = rb_tainted_str_new_cstr(r->ai_canonname);
- OBJ_FREEZE(canonname);
- }
-
- addr = rsock_addrinfo_new(r->ai_addr, r->ai_addrlen,
- r->ai_family, r->ai_socktype, r->ai_protocol,
- canonname, inspectname);
-
- rb_ary_push(ret, addr);
- }
-
- freeaddrinfo(res);
- return ret;
-}
-
-
-#ifdef HAVE_SYS_UN_H
-static void
-init_unix_addrinfo(rb_addrinfo_t *rai, VALUE path, int socktype)
-{
- struct sockaddr_un un;
-
- StringValue(path);
-
- if (sizeof(un.sun_path) <= (size_t)RSTRING_LEN(path))
- rb_raise(rb_eArgError, "too long unix socket path (max: %dbytes)",
- (int)sizeof(un.sun_path)-1);
-
- MEMZERO(&un, struct sockaddr_un, 1);
-
- un.sun_family = AF_UNIX;
- memcpy((void*)&un.sun_path, RSTRING_PTR(path), RSTRING_LEN(path));
-
- init_addrinfo(rai, (struct sockaddr *)&un, sizeof(un), PF_UNIX, socktype, 0, Qnil, Qnil);
-}
-#endif
-
-/*
- * call-seq:
- * Addrinfo.new(sockaddr) => addrinfo
- * Addrinfo.new(sockaddr, family) => addrinfo
- * Addrinfo.new(sockaddr, family, socktype) => addrinfo
- * Addrinfo.new(sockaddr, family, socktype, protocol) => addrinfo
- *
- * returns a new instance of Addrinfo.
- * The instnace contains sockaddr, family, socktype, protocol.
- * sockaddr means struct sockaddr which can be used for connect(2), etc.
- * family, socktype and protocol are integers which is used for arguments of socket(2).
- *
- * sockaddr is specified as an array or a string.
- * The array should be compatible to the value of IPSocket#addr or UNIXSocket#addr.
- * The string should be struct sockaddr as generated by
- * Socket.sockaddr_in or Socket.unpack_sockaddr_un.
- *
- * sockaddr examples:
- * - ["AF_INET", 46102, "localhost.localdomain", "127.0.0.1"]
- * - ["AF_INET6", 42304, "ip6-localhost", "::1"]
- * - ["AF_UNIX", "/tmp/sock"]
- * - Socket.sockaddr_in("smtp", "2001:DB8::1")
- * - Socket.sockaddr_in(80, "172.18.22.42")
- * - Socket.sockaddr_in(80, "www.ruby-lang.org")
- * - Socket.sockaddr_un("/tmp/sock")
- *
- * In an AF_INET/AF_INET6 sockaddr array, the 4th element,
- * numeric IP address, is used to construct socket address in the Addrinfo instance.
- * If the 3rd element, textual host name, is non-nil, it is also recorded but used only for Addrinfo#inspect.
- *
- * family is specified as an integer to specify the protocol family such as Socket::PF_INET.
- * It can be a symbol or a string which is the constant name
- * with or without PF_ prefix such as :INET, :INET6, :UNIX, "PF_INET", etc.
- * If ommitted, PF_UNSPEC is assumed.
- *
- * socktype is specified as an integer to specify the socket type such as Socket::SOCK_STREAM.
- * It can be a symbol or a string which is the constant name
- * with or without SOCK_ prefix such as :STREAM, :DGRAM, :RAW, "SOCK_STREAM", etc.
- * If ommitted, 0 is assumed.
- *
- * protocol is specified as an integer to specify the protocol such as Socket::IPPROTO_TCP.
- * It must be an integer, unlike family and socktype.
- * If ommitted, 0 is assumed.
- * Note that 0 is reasonable value for most protocols, except raw socket.
- *
- */
-static VALUE
-addrinfo_initialize(int argc, VALUE *argv, VALUE self)
-{
- rb_addrinfo_t *rai;
- VALUE sockaddr_arg, sockaddr_ary, pfamily, socktype, protocol;
- int i_pfamily, i_socktype, i_protocol;
- struct sockaddr *sockaddr_ptr;
- size_t sockaddr_len;
- VALUE canonname = Qnil, inspectname = Qnil;
-
- if (check_addrinfo(self))
- rb_raise(rb_eTypeError, "already initialized socket address");
- DATA_PTR(self) = rai = alloc_addrinfo();
-
- rb_scan_args(argc, argv, "13", &sockaddr_arg, &pfamily, &socktype, &protocol);
-
- i_pfamily = NIL_P(pfamily) ? PF_UNSPEC : rsock_family_arg(pfamily);
- i_socktype = NIL_P(socktype) ? 0 : rsock_socktype_arg(socktype);
- i_protocol = NIL_P(protocol) ? 0 : NUM2INT(protocol);
-
- sockaddr_ary = rb_check_array_type(sockaddr_arg);
- if (!NIL_P(sockaddr_ary)) {
- VALUE afamily = rb_ary_entry(sockaddr_ary, 0);
- int af;
- StringValue(afamily);
- if (rsock_family_to_int(RSTRING_PTR(afamily), RSTRING_LEN(afamily), &af) == -1)
- rb_raise(rb_eSocket, "unknown address family: %s", StringValueCStr(afamily));
- switch (af) {
- case AF_INET: /* ["AF_INET", 46102, "localhost.localdomain", "127.0.0.1"] */
-#ifdef INET6
- case AF_INET6: /* ["AF_INET6", 42304, "ip6-localhost", "::1"] */
-#endif
- {
- VALUE service = rb_ary_entry(sockaddr_ary, 1);
- VALUE nodename = rb_ary_entry(sockaddr_ary, 2);
- VALUE numericnode = rb_ary_entry(sockaddr_ary, 3);
- int flags;
-
- service = INT2NUM(NUM2INT(service));
- if (!NIL_P(nodename))
- StringValue(nodename);
- StringValue(numericnode);
- flags = AI_NUMERICHOST;
-#ifdef AI_NUMERICSERV
- flags |= AI_NUMERICSERV;
-#endif
-
- init_addrinfo_getaddrinfo(rai, numericnode, service,
- INT2NUM(i_pfamily ? i_pfamily : af), INT2NUM(i_socktype), INT2NUM(i_protocol),
- INT2NUM(flags),
- nodename, service);
- break;
- }
-
-#ifdef HAVE_SYS_UN_H
- case AF_UNIX: /* ["AF_UNIX", "/tmp/sock"] */
- {
- VALUE path = rb_ary_entry(sockaddr_ary, 1);
- StringValue(path);
- init_unix_addrinfo(rai, path, SOCK_STREAM);
- break;
- }
-#endif
-
- default:
- rb_raise(rb_eSocket, "unexpected address family");
- }
- }
- else {
- StringValue(sockaddr_arg);
- sockaddr_ptr = (struct sockaddr *)RSTRING_PTR(sockaddr_arg);
- sockaddr_len = RSTRING_LEN(sockaddr_arg);
- init_addrinfo(rai, sockaddr_ptr, sockaddr_len,
- i_pfamily, i_socktype, i_protocol,
- canonname, inspectname);
- }
-
- return self;
-}
-
-static int
-get_afamily(struct sockaddr *addr, socklen_t len)
-{
- if ((char*)&addr->sa_family + sizeof(addr->sa_family) - (char*)addr <= len)
- return addr->sa_family;
- else
- return AF_UNSPEC;
-}
-
-static int
-ai_get_afamily(rb_addrinfo_t *rai)
-{
- return get_afamily((struct sockaddr *)&rai->addr, rai->sockaddr_len);
-}
-
-static VALUE
-inspect_sockaddr(VALUE addrinfo, VALUE ret)
-{
- rb_addrinfo_t *rai = get_addrinfo(addrinfo);
-
- if (rai->sockaddr_len == 0) {
- rb_str_cat2(ret, "empty-sockaddr");
- }
- else if (rai->sockaddr_len < ((char*)&rai->addr.ss_family + sizeof(rai->addr.ss_family)) - (char*)&rai->addr)
- rb_str_cat2(ret, "too-short-sockaddr");
- else {
- switch (rai->addr.ss_family) {
- case AF_INET:
- {
- struct sockaddr_in *addr;
- int port;
- if (rai->sockaddr_len < sizeof(struct sockaddr_in)) {
- rb_str_cat2(ret, "too-short-AF_INET-sockaddr");
- }
- else {
- addr = (struct sockaddr_in *)&rai->addr;
- rb_str_catf(ret, "%d.%d.%d.%d",
- ((unsigned char*)&addr->sin_addr)[0],
- ((unsigned char*)&addr->sin_addr)[1],
- ((unsigned char*)&addr->sin_addr)[2],
- ((unsigned char*)&addr->sin_addr)[3]);
- port = ntohs(addr->sin_port);
- if (port)
- rb_str_catf(ret, ":%d", port);
- if (sizeof(struct sockaddr_in) < rai->sockaddr_len)
- rb_str_catf(ret, "(sockaddr %d bytes too long)", (int)(rai->sockaddr_len - sizeof(struct sockaddr_in)));
- }
- break;
- }
-
-#ifdef AF_INET6
- case AF_INET6:
- {
- struct sockaddr_in6 *addr;
- char hbuf[1024];
- int port;
- int error;
- if (rai->sockaddr_len < sizeof(struct sockaddr_in6)) {
- rb_str_cat2(ret, "too-short-AF_INET6-sockaddr");
- }
- else {
- addr = (struct sockaddr_in6 *)&rai->addr;
- /* use getnameinfo for scope_id.
- * RFC 4007: IPv6 Scoped Address Architecture
- * draft-ietf-ipv6-scope-api-00.txt: Scoped Address Extensions to the IPv6 Basic Socket API
- */
- error = getnameinfo((struct sockaddr *)&rai->addr, rai->sockaddr_len,
- hbuf, sizeof(hbuf), NULL, 0,
- NI_NUMERICHOST|NI_NUMERICSERV);
- if (error) {
- rsock_raise_socket_error("getnameinfo", error);
- }
- if (addr->sin6_port == 0) {
- rb_str_cat2(ret, hbuf);
- }
- else {
- port = ntohs(addr->sin6_port);
- rb_str_catf(ret, "[%s]:%d", hbuf, port);
- }
- if (sizeof(struct sockaddr_in6) < rai->sockaddr_len)
- rb_str_catf(ret, "(sockaddr %d bytes too long)", (int)(rai->sockaddr_len - sizeof(struct sockaddr_in6)));
- }
- break;
- }
-#endif
-
-#ifdef HAVE_SYS_UN_H
- case AF_UNIX:
- {
- struct sockaddr_un *addr = (struct sockaddr_un *)&rai->addr;
- char *p, *s, *t, *e;
- s = addr->sun_path;
- e = (char*)addr + rai->sockaddr_len;
- if (e < s)
- rb_str_cat2(ret, "too-short-AF_UNIX-sockaddr");
- else if (s == e)
- rb_str_cat2(ret, "empty-path-AF_UNIX-sockaddr");
- else {
- int printable_only = 1;
- p = s;
- while (p < e && *p != '\0') {
- printable_only = printable_only && ISPRINT(*p) && !ISSPACE(*p);
- p++;
- }
- t = p;
- while (p < e && *p == '\0')
- p++;
- if (printable_only && /* only printable, no space */
- t < e && /* NUL terminated */
- p == e) { /* no data after NUL */
- if (s == t)
- rb_str_cat2(ret, "empty-path-AF_UNIX-sockaddr");
- else if (s[0] == '/') /* absolute path */
- rb_str_cat2(ret, s);
- else
- rb_str_catf(ret, "AF_UNIX %s", s);
- }
- else {
- rb_str_cat2(ret, "AF_UNIX");
- e = (char *)addr->sun_path + sizeof(addr->sun_path);
- while (s < e && *(e-1) == '\0')
- e--;
- while (s < e)
- rb_str_catf(ret, ":%02x", (unsigned char)*s++);
- }
- if (addr->sun_path + sizeof(addr->sun_path) < (char*)&rai->addr + rai->sockaddr_len)
- rb_str_catf(ret, "(sockaddr %d bytes too long)",
- (int)(rai->sockaddr_len - (addr->sun_path + sizeof(addr->sun_path) - (char*)&rai->addr)));
- }
- break;
- }
-#endif
-
- default:
- {
- ID id = rsock_intern_family(rai->addr.ss_family);
- if (id == 0)
- rb_str_catf(ret, "unknown address family %d", rai->addr.ss_family);
- else
- rb_str_catf(ret, "%s address format unknown", rb_id2name(id));
- break;
- }
- }
- }
-
- return ret;
-}
-
-/*
- * call-seq:
- * addrinfo.inspect => string
- *
- * returns a string which shows addrinfo in human-readable form.
- *
- * Addrinfo.tcp("localhost", 80).inspect #=> "#<Addrinfo: 127.0.0.1:80 TCP (localhost:80)>"
- * Addrinfo.unix("/tmp/sock").inspect #=> "#<Addrinfo: /tmp/sock SOCK_STREAM>"
- *
- */
-static VALUE
-addrinfo_inspect(VALUE self)
-{
- rb_addrinfo_t *rai = get_addrinfo(self);
- int internet_p;
- VALUE ret;
-
- ret = rb_sprintf("#<%s: ", rb_obj_classname(self));
-
- inspect_sockaddr(self, ret);
-
- if (rai->pfamily && ai_get_afamily(rai) != rai->pfamily) {
- ID id = rsock_intern_protocol_family(rai->pfamily);
- if (id)
- rb_str_catf(ret, " %s", rb_id2name(id));
- else
- rb_str_catf(ret, " PF_\?\?\?(%d)", rai->pfamily);
- }
-
- internet_p = rai->pfamily == PF_INET;
-#ifdef INET6
- internet_p = internet_p || rai->pfamily == PF_INET6;
-#endif
- if (internet_p && rai->socktype == SOCK_STREAM &&
- (rai->protocol == 0 || rai->protocol == IPPROTO_TCP)) {
- rb_str_cat2(ret, " TCP");
- }
- else if (internet_p && rai->socktype == SOCK_DGRAM &&
- (rai->protocol == 0 || rai->protocol == IPPROTO_UDP)) {
- rb_str_cat2(ret, " UDP");
- }
- else {
- if (rai->socktype) {
- ID id = rsock_intern_socktype(rai->socktype);
- if (id)
- rb_str_catf(ret, " %s", rb_id2name(id));
- else
- rb_str_catf(ret, " SOCK_\?\?\?(%d)", rai->socktype);
- }
-
- if (rai->protocol) {
- if (internet_p) {
- ID id = rsock_intern_ipproto(rai->protocol);
- if (id)
- rb_str_catf(ret, " %s", rb_id2name(id));
- else
- goto unknown_protocol;
- }
- else {
- unknown_protocol:
- rb_str_catf(ret, " UNKNOWN_PROTOCOL(%d)", rai->protocol);
- }
- }
- }
-
- if (!NIL_P(rai->canonname)) {
- VALUE name = rai->canonname;
- rb_str_catf(ret, " %s", StringValueCStr(name));
- }
-
- if (!NIL_P(rai->inspectname)) {
- VALUE name = rai->inspectname;
- rb_str_catf(ret, " (%s)", StringValueCStr(name));
- }
-
- rb_str_buf_cat2(ret, ">");
- return ret;
-}
-
-/*
- * call-seq:
- * addrinfo.inspect_sockaddr => string
- *
- * returns a string which shows the sockaddr in _addrinfo_ with human-readable form.
- *
- * Addrinfo.tcp("localhost", 80).inspect_sockaddr #=> "127.0.0.1:80"
- * Addrinfo.tcp("ip6-localhost", 80).inspect_sockaddr #=> "[::1]:80"
- * Addrinfo.unix("/tmp/sock").inspect_sockaddr #=> "/tmp/sock"
- *
- */
-static VALUE
-addrinfo_inspect_sockaddr(VALUE self)
-{
- return inspect_sockaddr(self, rb_str_new("", 0));
-}
-
-/* :nodoc: */
-static VALUE
-addrinfo_mdump(VALUE self)
-{
- rb_addrinfo_t *rai = get_addrinfo(self);
- VALUE sockaddr, afamily, pfamily, socktype, protocol, canonname, inspectname;
- int afamily_int = ai_get_afamily(rai);
- ID id;
-
- id = rsock_intern_protocol_family(rai->pfamily);
- if (id == 0)
- rb_raise(rb_eSocket, "unknown protocol family: %d", rai->pfamily);
- pfamily = rb_id2str(id);
-
- if (rai->socktype == 0)
- socktype = INT2FIX(0);
- else {
- id = rsock_intern_socktype(rai->socktype);
- if (id == 0)
- rb_raise(rb_eSocket, "unknown socktype: %d", rai->socktype);
- socktype = rb_id2str(id);
- }
-
- if (rai->protocol == 0)
- protocol = INT2FIX(0);
- else if (IS_IP_FAMILY(afamily_int)) {
- id = rsock_intern_ipproto(rai->protocol);
- if (id == 0)
- rb_raise(rb_eSocket, "unknown IP protocol: %d", rai->protocol);
- protocol = rb_id2str(id);
- }
- else {
- rb_raise(rb_eSocket, "unknown protocol: %d", rai->protocol);
- }
-
- canonname = rai->canonname;
-
- inspectname = rai->inspectname;
-
- id = rsock_intern_family(afamily_int);
- if (id == 0)
- rb_raise(rb_eSocket, "unknown address family: %d", afamily_int);
- afamily = rb_id2str(id);
-
- switch(afamily_int) {
-#ifdef HAVE_SYS_UN_H
- case AF_UNIX:
- {
- struct sockaddr_un *su = (struct sockaddr_un *)&rai->addr;
- char *s, *e;
- s = su->sun_path;
- e = (char*)s + sizeof(su->sun_path);
- while (s < e && *(e-1) == '\0')
- e--;
- sockaddr = rb_str_new(s, e-s);
- break;
- }
-#endif
-
- default:
- {
- char hbuf[NI_MAXHOST], pbuf[NI_MAXSERV];
- int error;
- error = getnameinfo((struct sockaddr *)&rai->addr, rai->sockaddr_len,
- hbuf, sizeof(hbuf), pbuf, sizeof(pbuf),
- NI_NUMERICHOST|NI_NUMERICSERV);
- if (error) {
- rsock_raise_socket_error("getnameinfo", error);
- }
- sockaddr = rb_assoc_new(rb_str_new_cstr(hbuf), rb_str_new_cstr(pbuf));
- break;
- }
- }
-
- return rb_ary_new3(7, afamily, sockaddr, pfamily, socktype, protocol, canonname, inspectname);
-}
-
-/* :nodoc: */
-static VALUE
-addrinfo_mload(VALUE self, VALUE ary)
-{
- VALUE v;
- VALUE canonname, inspectname;
- int afamily, pfamily, socktype, protocol;
- struct sockaddr_storage ss;
- size_t len;
- rb_addrinfo_t *rai;
-
- if (check_addrinfo(self))
- rb_raise(rb_eTypeError, "already initialized socket address");
-
- ary = rb_convert_type(ary, T_ARRAY, "Array", "to_ary");
-
- v = rb_ary_entry(ary, 0);
- StringValue(v);
- if (rsock_family_to_int(RSTRING_PTR(v), RSTRING_LEN(v), &afamily) == -1)
- rb_raise(rb_eTypeError, "unexpected address family");
-
- v = rb_ary_entry(ary, 2);
- StringValue(v);
- if (rsock_family_to_int(RSTRING_PTR(v), RSTRING_LEN(v), &pfamily) == -1)
- rb_raise(rb_eTypeError, "unexpected protocol family");
-
- v = rb_ary_entry(ary, 3);
- if (v == INT2FIX(0))
- socktype = 0;
- else {
- StringValue(v);
- if (rsock_socktype_to_int(RSTRING_PTR(v), RSTRING_LEN(v), &socktype) == -1)
- rb_raise(rb_eTypeError, "unexpected socktype");
- }
-
- v = rb_ary_entry(ary, 4);
- if (v == INT2FIX(0))
- protocol = 0;
- else {
- StringValue(v);
- if (IS_IP_FAMILY(afamily)) {
- if (rsock_ipproto_to_int(RSTRING_PTR(v), RSTRING_LEN(v), &protocol) == -1)
- rb_raise(rb_eTypeError, "unexpected protocol");
- }
- else {
- rb_raise(rb_eTypeError, "unexpected protocol");
- }
- }
-
- v = rb_ary_entry(ary, 5);
- if (NIL_P(v))
- canonname = Qnil;
- else {
- StringValue(v);
- canonname = v;
- }
-
- v = rb_ary_entry(ary, 6);
- if (NIL_P(v))
- inspectname = Qnil;
- else {
- StringValue(v);
- inspectname = v;
- }
-
- v = rb_ary_entry(ary, 1);
- switch(afamily) {
-#ifdef HAVE_SYS_UN_H
- case AF_UNIX:
- {
- struct sockaddr_un uaddr;
- memset(&uaddr, 0, sizeof(uaddr));
- uaddr.sun_family = AF_UNIX;
-
- StringValue(v);
- if (sizeof(uaddr.sun_path) <= (size_t)RSTRING_LEN(v))
- rb_raise(rb_eSocket, "too long AF_UNIX path");
- memcpy(uaddr.sun_path, RSTRING_PTR(v), RSTRING_LEN(v));
- len = sizeof(uaddr);
- memcpy(&ss, &uaddr, len);
- break;
- }
-#endif
-
- default:
- {
- VALUE pair = rb_convert_type(v, T_ARRAY, "Array", "to_ary");
- struct addrinfo *res;
- int flags = AI_NUMERICHOST;
-#ifdef AI_NUMERICSERV
- flags |= AI_NUMERICSERV;
-#endif
- res = call_getaddrinfo(rb_ary_entry(pair, 0), rb_ary_entry(pair, 1),
- INT2NUM(pfamily), INT2NUM(socktype), INT2NUM(protocol),
- INT2NUM(flags), 1);
-
- len = res->ai_addrlen;
- memcpy(&ss, res->ai_addr, res->ai_addrlen);
- break;
- }
- }
-
- DATA_PTR(self) = rai = alloc_addrinfo();
- init_addrinfo(rai, (struct sockaddr *)&ss, len,
- pfamily, socktype, protocol,
- canonname, inspectname);
- return self;
-}
-
-/*
- * call-seq:
- * addrinfo.afamily => integer
- *
- * returns the address family as an integer.
- *
- * Addrinfo.tcp("localhost", 80).afamily == Socket::AF_INET #=> true
- *
- */
-static VALUE
-addrinfo_afamily(VALUE self)
-{
- rb_addrinfo_t *rai = get_addrinfo(self);
- return INT2NUM(ai_get_afamily(rai));
-}
-
-/*
- * call-seq:
- * addrinfo.pfamily => integer
- *
- * returns the protocol family as an integer.
- *
- * Addrinfo.tcp("localhost", 80).pfamily == Socket::PF_INET #=> true
- *
- */
-static VALUE
-addrinfo_pfamily(VALUE self)
-{
- rb_addrinfo_t *rai = get_addrinfo(self);
- return INT2NUM(rai->pfamily);
-}
-
-/*
- * call-seq:
- * addrinfo.socktype => integer
- *
- * returns the socket type as an integer.
- *
- * Addrinfo.tcp("localhost", 80).socktype == Socket::SOCK_STREAM #=> true
- *
- */
-static VALUE
-addrinfo_socktype(VALUE self)
-{
- rb_addrinfo_t *rai = get_addrinfo(self);
- return INT2NUM(rai->socktype);
-}
-
-/*
- * call-seq:
- * addrinfo.protocol => integer
- *
- * returns the socket type as an integer.
- *
- * Addrinfo.tcp("localhost", 80).protocol == Socket::IPPROTO_TCP #=> true
- *
- */
-static VALUE
-addrinfo_protocol(VALUE self)
-{
- rb_addrinfo_t *rai = get_addrinfo(self);
- return INT2NUM(rai->protocol);
-}
-
-/*
- * call-seq:
- * addrinfo.to_sockaddr => string
- *
- * returns the socket address as packed struct sockaddr string.
- *
- * Addrinfo.tcp("localhost", 80).to_sockaddr
- * #=> "\x02\x00\x00P\x7F\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00"
- *
- */
-static VALUE
-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;
-}
-
-/*
- * call-seq:
- * addrinfo.canonname => string or nil
- *
- * returns the canonical name as an string.
- *
- * nil is returned if no canonical name.
- *
- * The canonical name is set by Addrinfo.getaddrinfo when AI_CANONNAME is specified.
- *
- * list = Addrinfo.getaddrinfo("www.ruby-lang.org", 80, :INET, :STREAM, nil, Socket::AI_CANONNAME)
- * p list[0] #=> #<Addrinfo: 221.186.184.68:80 TCP carbon.ruby-lang.org (www.ruby-lang.org:80)>
- * p list[0].canonname #=> "carbon.ruby-lang.org"
- *
- */
-static VALUE
-addrinfo_canonname(VALUE self)
-{
- rb_addrinfo_t *rai = get_addrinfo(self);
- return rai->canonname;
-}
-
-/*
- * call-seq:
- * addrinfo.ip? => true or false
- *
- * returns true if addrinfo is internet (IPv4/IPv6) address.
- * returns false otherwise.
- *
- * Addrinfo.tcp("127.0.0.1", 80).ip? #=> true
- * Addrinfo.tcp("::1", 80).ip? #=> true
- * Addrinfo.unix("/tmp/sock").ip? #=> false
- *
- */
-static VALUE
-addrinfo_ip_p(VALUE self)
-{
- rb_addrinfo_t *rai = get_addrinfo(self);
- int family = ai_get_afamily(rai);
- return IS_IP_FAMILY(family) ? Qtrue : Qfalse;
-}
-
-/*
- * call-seq:
- * addrinfo.ipv4? => true or false
- *
- * returns true if addrinfo is IPv4 address.
- * returns false otherwise.
- *
- * Addrinfo.tcp("127.0.0.1", 80).ipv4? #=> true
- * Addrinfo.tcp("::1", 80).ipv4? #=> false
- * Addrinfo.unix("/tmp/sock").ipv4? #=> false
- *
- */
-static VALUE
-addrinfo_ipv4_p(VALUE self)
-{
- rb_addrinfo_t *rai = get_addrinfo(self);
- return ai_get_afamily(rai) == AF_INET ? Qtrue : Qfalse;
-}
-
-/*
- * call-seq:
- * addrinfo.ipv6? => true or false
- *
- * returns true if addrinfo is IPv6 address.
- * returns false otherwise.
- *
- * Addrinfo.tcp("127.0.0.1", 80).ipv6? #=> false
- * Addrinfo.tcp("::1", 80).ipv6? #=> true
- * Addrinfo.unix("/tmp/sock").ipv6? #=> false
- *
- */
-static VALUE
-addrinfo_ipv6_p(VALUE self)
-{
-#ifdef AF_INET6
- rb_addrinfo_t *rai = get_addrinfo(self);
- return ai_get_afamily(rai) == AF_INET6 ? Qtrue : Qfalse;
-#else
- return Qfalse;
-#endif
-}
-
-/*
- * call-seq:
- * addrinfo.unix? => true or false
- *
- * returns true if addrinfo is UNIX address.
- * returns false otherwise.
- *
- * Addrinfo.tcp("127.0.0.1", 80).unix? #=> false
- * Addrinfo.tcp("::1", 80).unix? #=> false
- * Addrinfo.unix("/tmp/sock").unix? #=> true
- *
- */
-static VALUE
-addrinfo_unix_p(VALUE self)
-{
- rb_addrinfo_t *rai = get_addrinfo(self);
-#ifdef AF_UNIX
- return ai_get_afamily(rai) == AF_UNIX ? Qtrue : Qfalse;
-#else
- return Qfalse;
-#endif
-}
-
-/*
- * call-seq:
- * addrinfo.getnameinfo => [nodename, service]
- * addrinfo.getnameinfo(flags) => [nodename, service]
- *
- * returns nodename and service as a pair of strings.
- * This converts struct sockaddr in addrinfo to textual representation.
- *
- * flags should be bitwise OR of Socket::NI_??? constants.
- *
- * Addrinfo.tcp("127.0.0.1", 80).getnameinfo #=> ["localhost", "www"]
- *
- * Addrinfo.tcp("127.0.0.1", 80).getnameinfo(Socket::NI_NUMERICSERV)
- * #=> ["localhost", "80"]
- */
-static VALUE
-addrinfo_getnameinfo(int argc, VALUE *argv, VALUE self)
-{
- rb_addrinfo_t *rai = get_addrinfo(self);
- VALUE vflags;
- char hbuf[1024], pbuf[1024];
- int flags, error;
-
- rb_scan_args(argc, argv, "01", &vflags);
-
- flags = NIL_P(vflags) ? 0 : NUM2INT(vflags);
-
- if (rai->socktype == SOCK_DGRAM)
- flags |= NI_DGRAM;
-
- error = getnameinfo((struct sockaddr *)&rai->addr, rai->sockaddr_len,
- hbuf, sizeof(hbuf), pbuf, sizeof(pbuf),
- flags);
- if (error) {
- rsock_raise_socket_error("getnameinfo", error);
- }
-
- return rb_assoc_new(rb_str_new2(hbuf), rb_str_new2(pbuf));
-}
-
-/*
- * call-seq:
- * addrinfo.ip_unpack => [addr, port]
- *
- * Returns the IP address and port number as 2-element array.
- *
- * Addrinfo.tcp("127.0.0.1", 80).ip_unpack #=> ["127.0.0.1", 80]
- * Addrinfo.tcp("::1", 80).ip_unpack #=> ["::1", 80]
- */
-static VALUE
-addrinfo_ip_unpack(VALUE self)
-{
- rb_addrinfo_t *rai = get_addrinfo(self);
- int family = ai_get_afamily(rai);
- VALUE vflags;
- VALUE ret, portstr;
-
- if (!IS_IP_FAMILY(family))
- rb_raise(rb_eSocket, "need IPv4 or IPv6 address");
-
- vflags = INT2NUM(NI_NUMERICHOST|NI_NUMERICSERV);
- ret = addrinfo_getnameinfo(1, &vflags, self);
- portstr = rb_ary_entry(ret, 1);
- rb_ary_store(ret, 1, INT2NUM(atoi(StringValueCStr(portstr))));
- return ret;
-}
-
-/*
- * call-seq:
- * addrinfo.ip_address => string
- *
- * Returns the IP address as a string.
- *
- * Addrinfo.tcp("127.0.0.1", 80).ip_address #=> "127.0.0.1"
- * Addrinfo.tcp("::1", 80).ip_address #=> "::1"
- */
-static VALUE
-addrinfo_ip_address(VALUE self)
-{
- rb_addrinfo_t *rai = get_addrinfo(self);
- int family = ai_get_afamily(rai);
- VALUE vflags;
- VALUE ret;
-
- if (!IS_IP_FAMILY(family))
- rb_raise(rb_eSocket, "need IPv4 or IPv6 address");
-
- vflags = INT2NUM(NI_NUMERICHOST|NI_NUMERICSERV);
- ret = addrinfo_getnameinfo(1, &vflags, self);
- return rb_ary_entry(ret, 0);
-}
-
-/*
- * call-seq:
- * addrinfo.ip_port => port
- *
- * Returns the port number as an integer.
- *
- * Addrinfo.tcp("127.0.0.1", 80).ip_port #=> 80
- * Addrinfo.tcp("::1", 80).ip_port #=> 80
- */
-static VALUE
-addrinfo_ip_port(VALUE self)
-{
- rb_addrinfo_t *rai = get_addrinfo(self);
- int family = ai_get_afamily(rai);
- int port;
-
- if (!IS_IP_FAMILY(family)) {
- bad_family:
-#ifdef AF_INET6
- rb_raise(rb_eSocket, "need IPv4 or IPv6 address");
-#else
- rb_raise(rb_eSocket, "need IPv4 address");
-#endif
- }
-
- switch (family) {
- case AF_INET:
- if (rai->sockaddr_len != sizeof(struct sockaddr_in))
- rb_raise(rb_eSocket, "unexpected sockaddr size for IPv4");
- port = ntohs(((struct sockaddr_in *)&rai->addr)->sin_port);
- break;
-
-#ifdef AF_INET6
- case AF_INET6:
- if (rai->sockaddr_len != sizeof(struct sockaddr_in6))
- rb_raise(rb_eSocket, "unexpected sockaddr size for IPv6");
- port = ntohs(((struct sockaddr_in6 *)&rai->addr)->sin6_port);
- break;
-#endif
-
- default:
- goto bad_family;
- }
-
- return INT2NUM(port);
-}
-
-static int
-extract_in_addr(VALUE self, uint32_t *addrp)
-{
- rb_addrinfo_t *rai = get_addrinfo(self);
- int family = ai_get_afamily(rai);
- if (family != AF_INET) return 0;
- *addrp = ntohl(((struct sockaddr_in *)&rai->addr)->sin_addr.s_addr);
- return 1;
-}
-
-/*
- * Returns true for IPv4 private address (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16).
- * It returns false otherwise.
- */
-static VALUE
-addrinfo_ipv4_private_p(VALUE self)
-{
- uint32_t a;
- if (!extract_in_addr(self, &a)) return Qfalse;
- if ((a & 0xff000000) == 0x0a000000 || /* 10.0.0.0/8 */
- (a & 0xfff00000) == 0xac100000 || /* 172.16.0.0/12 */
- (a & 0xffff0000) == 0xc0a80000) /* 192.168.0.0/16 */
- return Qtrue;
- return Qfalse;
-}
-
-/*
- * Returns true for IPv4 loopback address (127.0.0.0/8).
- * It returns false otherwise.
- */
-static VALUE
-addrinfo_ipv4_loopback_p(VALUE self)
-{
- uint32_t a;
- if (!extract_in_addr(self, &a)) return Qfalse;
- if ((a & 0xff000000) == 0x7f000000) /* 127.0.0.0/8 */
- return Qtrue;
- return Qfalse;
-}
-
-/*
- * Returns true for IPv4 multicast address (224.0.0.0/4).
- * It returns false otherwise.
- */
-static VALUE
-addrinfo_ipv4_multicast_p(VALUE self)
-{
- uint32_t a;
- if (!extract_in_addr(self, &a)) return Qfalse;
- if ((a & 0xf0000000) == 0xe0000000) /* 224.0.0.0/4 */
- return Qtrue;
- return Qfalse;
-}
-
-#ifdef INET6
-
-static struct in6_addr *
-extract_in6_addr(VALUE self)
-{
- rb_addrinfo_t *rai = get_addrinfo(self);
- int family = ai_get_afamily(rai);
- if (family != AF_INET6) return NULL;
- return &((struct sockaddr_in6 *)&rai->addr)->sin6_addr;
-}
-
-/*
- * Returns true for IPv6 unspecified address (::).
- * It returns false otherwise.
- */
-static VALUE
-addrinfo_ipv6_unspecified_p(VALUE self)
-{
- struct in6_addr *addr = extract_in6_addr(self);
- if (addr && IN6_IS_ADDR_UNSPECIFIED(addr)) return Qtrue;
- return Qfalse;
-}
-
-/*
- * Returns true for IPv6 loopback address (::1).
- * It returns false otherwise.
- */
-static VALUE
-addrinfo_ipv6_loopback_p(VALUE self)
-{
- struct in6_addr *addr = extract_in6_addr(self);
- if (addr && IN6_IS_ADDR_LOOPBACK(addr)) return Qtrue;
- return Qfalse;
-}
-
-/*
- * Returns true for IPv6 multicast address (ff00::/8).
- * It returns false otherwise.
- */
-static VALUE
-addrinfo_ipv6_multicast_p(VALUE self)
-{
- struct in6_addr *addr = extract_in6_addr(self);
- if (addr && IN6_IS_ADDR_MULTICAST(addr)) return Qtrue;
- return Qfalse;
-}
-
-/*
- * Returns true for IPv6 link local address (ff80::/10).
- * It returns false otherwise.
- */
-static VALUE
-addrinfo_ipv6_linklocal_p(VALUE self)
-{
- struct in6_addr *addr = extract_in6_addr(self);
- if (addr && IN6_IS_ADDR_LINKLOCAL(addr)) return Qtrue;
- return Qfalse;
-}
-
-/*
- * Returns true for IPv6 site local address (ffc0::/10).
- * It returns false otherwise.
- */
-static VALUE
-addrinfo_ipv6_sitelocal_p(VALUE self)
-{
- struct in6_addr *addr = extract_in6_addr(self);
- if (addr && IN6_IS_ADDR_SITELOCAL(addr)) return Qtrue;
- return Qfalse;
-}
-
-/*
- * Returns true for IPv4-mapped IPv6 address (::ffff:0:0/80).
- * It returns false otherwise.
- */
-static VALUE
-addrinfo_ipv6_v4mapped_p(VALUE self)
-{
- struct in6_addr *addr = extract_in6_addr(self);
- if (addr && IN6_IS_ADDR_V4MAPPED(addr)) return Qtrue;
- return Qfalse;
-}
-
-/*
- * Returns true for IPv4-compatible IPv6 address (::/80).
- * It returns false otherwise.
- */
-static VALUE
-addrinfo_ipv6_v4compat_p(VALUE self)
-{
- struct in6_addr *addr = extract_in6_addr(self);
- if (addr && IN6_IS_ADDR_V4COMPAT(addr)) return Qtrue;
- return Qfalse;
-}
-
-/*
- * Returns true for IPv6 multicast node-local scope address.
- * It returns false otherwise.
- */
-static VALUE
-addrinfo_ipv6_mc_nodelocal_p(VALUE self)
-{
- struct in6_addr *addr = extract_in6_addr(self);
- if (addr && IN6_IS_ADDR_MC_NODELOCAL(addr)) return Qtrue;
- return Qfalse;
-}
-
-/*
- * Returns true for IPv6 multicast link-local scope address.
- * It returns false otherwise.
- */
-static VALUE
-addrinfo_ipv6_mc_linklocal_p(VALUE self)
-{
- struct in6_addr *addr = extract_in6_addr(self);
- if (addr && IN6_IS_ADDR_MC_LINKLOCAL(addr)) return Qtrue;
- return Qfalse;
-}
-
-/*
- * Returns true for IPv6 multicast site-local scope address.
- * It returns false otherwise.
- */
-static VALUE
-addrinfo_ipv6_mc_sitelocal_p(VALUE self)
-{
- struct in6_addr *addr = extract_in6_addr(self);
- if (addr && IN6_IS_ADDR_MC_SITELOCAL(addr)) return Qtrue;
- return Qfalse;
-}
-
-/*
- * Returns true for IPv6 multicast organization-local scope address.
- * It returns false otherwise.
- */
-static VALUE
-addrinfo_ipv6_mc_orglocal_p(VALUE self)
-{
- struct in6_addr *addr = extract_in6_addr(self);
- if (addr && IN6_IS_ADDR_MC_ORGLOCAL(addr)) return Qtrue;
- return Qfalse;
-}
-
-/*
- * Returns true for IPv6 multicast global scope address.
- * It returns false otherwise.
- */
-static VALUE
-addrinfo_ipv6_mc_global_p(VALUE self)
-{
- struct in6_addr *addr = extract_in6_addr(self);
- if (addr && IN6_IS_ADDR_MC_GLOBAL(addr)) return Qtrue;
- return Qfalse;
-}
-
-/*
- * Returns IPv4 address of IPv4 mapped/compatible IPv6 address.
- * It returns nil if +self+ is not IPv4 mapped/compatible IPv6 address.
- *
- * Addrinfo.ip("::192.0.2.3").ipv6_to_ipv4 #=> #<Addrinfo: 192.0.2.3>
- * Addrinfo.ip("::ffff:192.0.2.3").ipv6_to_ipv4 #=> #<Addrinfo: 192.0.2.3>
- * Addrinfo.ip("::1").ipv6_to_ipv4 #=> nil
- * Addrinfo.ip("192.0.2.3").ipv6_to_ipv4 #=> nil
- * Addrinfo.unix("/tmp/sock").ipv6_to_ipv4 #=> nil
- */
-static VALUE
-addrinfo_ipv6_to_ipv4(VALUE self)
-{
- rb_addrinfo_t *rai = get_addrinfo(self);
- struct in6_addr *addr;
- int family = ai_get_afamily(rai);
- if (family != AF_INET6) return Qnil;
- addr = &((struct sockaddr_in6 *)&rai->addr)->sin6_addr;
- if (IN6_IS_ADDR_V4MAPPED(addr) || IN6_IS_ADDR_V4COMPAT(addr)) {
- struct sockaddr_in sin4;
- MEMZERO(&sin4, struct sockaddr_in, 1);
- sin4.sin_family = AF_INET;
- SET_SIN_LEN(&sin4, sizeof(sin4));
- memcpy(&sin4.sin_addr, (char*)addr + sizeof(*addr) - sizeof(sin4.sin_addr), sizeof(sin4.sin_addr));
- return rsock_addrinfo_new((struct sockaddr *)&sin4, sizeof(sin4),
- PF_INET, rai->socktype, rai->protocol,
- rai->canonname, rai->inspectname);
- }
- else {
- return Qnil;
- }
-}
-
-#endif
-
-#ifdef HAVE_SYS_UN_H
-/*
- * call-seq:
- * addrinfo.unix_path => path
- *
- * Returns the socket path as a string.
- *
- * Addrinfo.unix("/tmp/sock").unix_path #=> "/tmp/sock"
- */
-static VALUE
-addrinfo_unix_path(VALUE self)
-{
- rb_addrinfo_t *rai = get_addrinfo(self);
- int family = ai_get_afamily(rai);
- struct sockaddr_un *addr;
- char *s, *e;
-
- if (family != AF_UNIX)
- rb_raise(rb_eSocket, "need AF_UNIX address");
-
- addr = (struct sockaddr_un *)&rai->addr;
-
- s = addr->sun_path;
- e = (char*)addr + rai->sockaddr_len;
- if (e < s)
- rb_raise(rb_eSocket, "too short AF_UNIX address");
- if (addr->sun_path + sizeof(addr->sun_path) < e)
- rb_raise(rb_eSocket, "too long AF_UNIX address");
- while (s < e && *(e-1) == '\0')
- e--;
- return rb_str_new(s, e-s);
-}
-#endif
-
-/*
- * call-seq:
- * Addrinfo.getaddrinfo(nodename, service, family, socktype, protocol, flags) => [addrinfo, ...]
- * Addrinfo.getaddrinfo(nodename, service, family, socktype, protocol) => [addrinfo, ...]
- * Addrinfo.getaddrinfo(nodename, service, family, socktype) => [addrinfo, ...]
- * Addrinfo.getaddrinfo(nodename, service, family) => [addrinfo, ...]
- * Addrinfo.getaddrinfo(nodename, service) => [addrinfo, ...]
- *
- * returns a list of addrinfo objects as an array.
- *
- * This method converts nodename (hostname) and service (port) to addrinfo.
- * Since the conversion is not unique, the result is a list of addrinfo objects.
- *
- * nodename or service can be nil if no conversion intended.
- *
- * family, socktype and protocol are hint for prefered protocol.
- * If the result will be used for a socket with SOCK_STREAM,
- * SOCK_STREAM should be specified as socktype.
- * If so, Addrinfo.getaddrinfo returns addrinfo list appropriate for SOCK_STREAM.
- * If they are omitted or nil is given, the result is not restricted.
- *
- * Similary, PF_INET6 as family restricts for IPv6.
- *
- * flags should be bitwise OR of Socket::AI_??? constants.
- *
- * Note that socktype should be specified whenever application knows the usage of the address.
- * Some platform causes an error when socktype is ommitted and servname is specified as an integer
- * because some port numbers, 512 for example, are ambiguous without socktype.
- *
- * Addrinfo.getaddrinfo("www.kame.net", 80, nil, :STREAM)
- * #=> [#<Addrinfo: 203.178.141.194:80 TCP (www.kame.net:80)>,
- * # #<Addrinfo: [2001:200:0:8002:203:47ff:fea5:3085]:80 TCP (www.kame.net:80)>]
- *
- */
-static VALUE
-addrinfo_s_getaddrinfo(int argc, VALUE *argv, VALUE self)
-{
- VALUE node, service, family, socktype, protocol, flags;
-
- rb_scan_args(argc, argv, "24", &node, &service, &family, &socktype, &protocol, &flags);
- return addrinfo_list_new(node, service, family, socktype, protocol, flags);
-}
-
-/*
- * call-seq:
- * Addrinfo.ip(host) => addrinfo
- *
- * returns an addrinfo object for IP address.
- *
- * The port, socktype, protocol of the result is filled by zero.
- * So, it is not appropriate to create a socket.
- *
- * Addrinfo.ip("localhost") #=> #<Addrinfo: 127.0.0.1 (localhost)>
- */
-static VALUE
-addrinfo_s_ip(VALUE self, VALUE host)
-{
- VALUE ret;
- rb_addrinfo_t *rai;
- ret = addrinfo_firstonly_new(host, Qnil,
- INT2NUM(PF_UNSPEC), INT2FIX(0), INT2FIX(0), INT2FIX(0));
- rai = get_addrinfo(ret);
- rai->socktype = 0;
- rai->protocol = 0;
- return ret;
-}
-
-/*
- * call-seq:
- * Addrinfo.tcp(host, port) => addrinfo
- *
- * returns an addrinfo object for TCP address.
- *
- * Addrinfo.tcp("localhost", "smtp") #=> #<Addrinfo: 127.0.0.1:25 TCP (localhost:smtp)>
- */
-static VALUE
-addrinfo_s_tcp(VALUE self, VALUE host, VALUE port)
-{
- return addrinfo_firstonly_new(host, port,
- INT2NUM(PF_UNSPEC), INT2NUM(SOCK_STREAM), INT2NUM(IPPROTO_TCP), INT2FIX(0));
-}
-
-/*
- * call-seq:
- * Addrinfo.udp(host, port) => addrinfo
- *
- * returns an addrinfo object for UDP address.
- *
- * Addrinfo.udp("localhost", "daytime") #=> #<Addrinfo: 127.0.0.1:13 UDP (localhost:daytime)>
- */
-static VALUE
-addrinfo_s_udp(VALUE self, VALUE host, VALUE port)
-{
- return addrinfo_firstonly_new(host, port,
- INT2NUM(PF_UNSPEC), INT2NUM(SOCK_DGRAM), INT2NUM(IPPROTO_UDP), INT2FIX(0));
-}
-
-#ifdef HAVE_SYS_UN_H
-
-/*
- * call-seq:
- * Addrinfo.unix(path [, socktype]) => addrinfo
- *
- * returns an addrinfo object for UNIX socket address.
- *
- * _socktype_ specifies the socket type.
- * If it is omitted, :STREAM is used.
- *
- * Addrinfo.unix("/tmp/sock") #=> #<Addrinfo: /tmp/sock SOCK_STREAM>
- * Addrinfo.unix("/tmp/sock", :DGRAM) #=> #<Addrinfo: /tmp/sock SOCK_DGRAM>
- */
-static VALUE
-addrinfo_s_unix(int argc, VALUE *argv, VALUE self)
-{
- VALUE path, vsocktype, addr;
- int socktype;
- rb_addrinfo_t *rai;
-
- rb_scan_args(argc, argv, "11", &path, &vsocktype);
-
- if (NIL_P(vsocktype))
- socktype = SOCK_STREAM;
- else
- socktype = rsock_socktype_arg(vsocktype);
-
- addr = addrinfo_s_allocate(rb_cAddrinfo);
- DATA_PTR(addr) = rai = alloc_addrinfo();
- init_unix_addrinfo(rai, path, socktype);
- OBJ_INFECT(addr, path);
- return addr;
-}
-
-#endif
-
-VALUE
-rsock_sockaddr_string_value(volatile VALUE *v)
-{
- VALUE val = *v;
- if (TYPE(val) == RUBY_T_DATA && IS_ADDRINFO(val)) {
- *v = addrinfo_to_sockaddr(val);
- }
- StringValue(*v);
- return *v;
-}
-
-char *
-rsock_sockaddr_string_value_ptr(volatile VALUE *v)
-{
- rsock_sockaddr_string_value(v);
- return RSTRING_PTR(*v);
-}
-
-VALUE
-rb_check_sockaddr_string_type(VALUE val)
-{
- if (TYPE(val) == RUBY_T_DATA && IS_ADDRINFO(val))
- return addrinfo_to_sockaddr(val);
- return rb_check_string_type(val);
-}
-
-VALUE
-rsock_fd_socket_addrinfo(int fd, struct sockaddr *addr, socklen_t len)
-{
- int family;
- int socktype;
- int ret;
- socklen_t optlen = sizeof(socktype);
-
- /* assumes protocol family and address family are identical */
- family = get_afamily(addr, len);
-
- ret = getsockopt(fd, SOL_SOCKET, SO_TYPE, (void*)&socktype, &optlen);
- if (ret == -1) {
- rb_sys_fail("getsockopt(SO_TYPE)");
- }
-
- return rsock_addrinfo_new(addr, len, family, socktype, 0, Qnil, Qnil);
-}
-
-VALUE
-rsock_io_socket_addrinfo(VALUE io, struct sockaddr *addr, socklen_t len)
-{
- rb_io_t *fptr;
-
- switch (TYPE(io)) {
- case T_FIXNUM:
- return rsock_fd_socket_addrinfo(FIX2INT(io), addr, len);
-
- case T_BIGNUM:
- return rsock_fd_socket_addrinfo(NUM2INT(io), addr, len);
-
- case T_FILE:
- GetOpenFile(io, fptr);
- return rsock_fd_socket_addrinfo(fptr->fd, addr, len);
-
- default:
- rb_raise(rb_eTypeError, "neither IO nor file descriptor");
- }
-}
-
-/*
- * Addrinfo class
- */
-void
-Init_addrinfo(void)
-{
- 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);
- rb_define_method(rb_cAddrinfo, "inspect", addrinfo_inspect, 0);
- rb_define_method(rb_cAddrinfo, "inspect_sockaddr", addrinfo_inspect_sockaddr, 0);
- rb_define_singleton_method(rb_cAddrinfo, "getaddrinfo", addrinfo_s_getaddrinfo, -1);
- rb_define_singleton_method(rb_cAddrinfo, "ip", addrinfo_s_ip, 1);
- rb_define_singleton_method(rb_cAddrinfo, "tcp", addrinfo_s_tcp, 2);
- rb_define_singleton_method(rb_cAddrinfo, "udp", addrinfo_s_udp, 2);
-#ifdef HAVE_SYS_UN_H
- rb_define_singleton_method(rb_cAddrinfo, "unix", addrinfo_s_unix, -1);
-#endif
-
- rb_define_method(rb_cAddrinfo, "afamily", addrinfo_afamily, 0);
- rb_define_method(rb_cAddrinfo, "pfamily", addrinfo_pfamily, 0);
- rb_define_method(rb_cAddrinfo, "socktype", addrinfo_socktype, 0);
- rb_define_method(rb_cAddrinfo, "protocol", addrinfo_protocol, 0);
- rb_define_method(rb_cAddrinfo, "canonname", addrinfo_canonname, 0);
-
- rb_define_method(rb_cAddrinfo, "ipv4?", addrinfo_ipv4_p, 0);
- rb_define_method(rb_cAddrinfo, "ipv6?", addrinfo_ipv6_p, 0);
- rb_define_method(rb_cAddrinfo, "unix?", addrinfo_unix_p, 0);
-
- rb_define_method(rb_cAddrinfo, "ip?", addrinfo_ip_p, 0);
- rb_define_method(rb_cAddrinfo, "ip_unpack", addrinfo_ip_unpack, 0);
- rb_define_method(rb_cAddrinfo, "ip_address", addrinfo_ip_address, 0);
- rb_define_method(rb_cAddrinfo, "ip_port", addrinfo_ip_port, 0);
-
- rb_define_method(rb_cAddrinfo, "ipv4_private?", addrinfo_ipv4_private_p, 0);
- rb_define_method(rb_cAddrinfo, "ipv4_loopback?", addrinfo_ipv4_loopback_p, 0);
- rb_define_method(rb_cAddrinfo, "ipv4_multicast?", addrinfo_ipv4_multicast_p, 0);
-
-#ifdef INET6
- rb_define_method(rb_cAddrinfo, "ipv6_unspecified?", addrinfo_ipv6_unspecified_p, 0);
- rb_define_method(rb_cAddrinfo, "ipv6_loopback?", addrinfo_ipv6_loopback_p, 0);
- rb_define_method(rb_cAddrinfo, "ipv6_multicast?", addrinfo_ipv6_multicast_p, 0);
- rb_define_method(rb_cAddrinfo, "ipv6_linklocal?", addrinfo_ipv6_linklocal_p, 0);
- rb_define_method(rb_cAddrinfo, "ipv6_sitelocal?", addrinfo_ipv6_sitelocal_p, 0);
- rb_define_method(rb_cAddrinfo, "ipv6_v4mapped?", addrinfo_ipv6_v4mapped_p, 0);
- rb_define_method(rb_cAddrinfo, "ipv6_v4compat?", addrinfo_ipv6_v4compat_p, 0);
- rb_define_method(rb_cAddrinfo, "ipv6_mc_nodelocal?", addrinfo_ipv6_mc_nodelocal_p, 0);
- rb_define_method(rb_cAddrinfo, "ipv6_mc_linklocal?", addrinfo_ipv6_mc_linklocal_p, 0);
- rb_define_method(rb_cAddrinfo, "ipv6_mc_sitelocal?", addrinfo_ipv6_mc_sitelocal_p, 0);
- rb_define_method(rb_cAddrinfo, "ipv6_mc_orglocal?", addrinfo_ipv6_mc_orglocal_p, 0);
- rb_define_method(rb_cAddrinfo, "ipv6_mc_global?", addrinfo_ipv6_mc_global_p, 0);
-
- rb_define_method(rb_cAddrinfo, "ipv6_to_ipv4", addrinfo_ipv6_to_ipv4, 0);
-#endif
-
-#ifdef HAVE_SYS_UN_H
- rb_define_method(rb_cAddrinfo, "unix_path", addrinfo_unix_path, 0);
-#endif
-
- rb_define_method(rb_cAddrinfo, "to_sockaddr", addrinfo_to_sockaddr, 0);
- rb_define_method(rb_cAddrinfo, "to_s", addrinfo_to_sockaddr, 0); /* compatibility for ruby before 1.9.2 */
-
- rb_define_method(rb_cAddrinfo, "getnameinfo", addrinfo_getnameinfo, -1);
-
- rb_define_method(rb_cAddrinfo, "marshal_dump", addrinfo_mdump, 0);
- rb_define_method(rb_cAddrinfo, "marshal_load", addrinfo_mload, 1);
-}
diff --git a/ext/socket/rubysocket.h b/ext/socket/rubysocket.h
deleted file mode 100644
index 27980c3874..0000000000
--- a/ext/socket/rubysocket.h
+++ /dev/null
@@ -1,278 +0,0 @@
-#ifndef RUBY_SOCKET_H
-#define RUBY_SOCKET_H 1
-
-#include "ruby/ruby.h"
-#include "ruby/io.h"
-#include "ruby/util.h"
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-
-#ifdef HAVE_SYS_UIO_H
-#include <sys/uio.h>
-#endif
-
-#ifdef HAVE_XTI_H
-#include <xti.h>
-#endif
-
-#ifndef _WIN32
-#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>
-#endif
-#ifdef HAVE_NETINET_TCP_H
-# include <netinet/tcp.h>
-#endif
-#ifdef HAVE_NETINET_UDP_H
-# include <netinet/udp.h>
-#endif
-#ifdef HAVE_ARPA_INET_H
-# include <arpa/inet.h>
-#endif
-#include <netdb.h>
-#endif
-#include <errno.h>
-#ifdef HAVE_SYS_UN_H
-#include <sys/un.h>
-#endif
-
-#if defined(HAVE_FCNTL)
-#ifdef HAVE_SYS_SELECT_H
-#include <sys/select.h>
-#endif
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#ifdef HAVE_SYS_TIME_H
-#include <sys/time.h>
-#endif
-#ifdef HAVE_FCNTL_H
-#include <fcntl.h>
-#endif
-#endif
-
-#ifdef HAVE_IFADDRS_H
-#include <ifaddrs.h>
-#endif
-#ifdef HAVE_SYS_IOCTL_H
-#include <sys/ioctl.h>
-#endif
-#ifdef HAVE_SYS_SOCKIO_H
-#include <sys/sockio.h>
-#endif
-#ifdef HAVE_NET_IF_H
-#include <net/if.h>
-#endif
-
-#ifdef HAVE_SYS_PARAM_H
-#include <sys/param.h>
-#endif
-#ifdef HAVE_SYS_UCRED_H
-#include <sys/ucred.h>
-#endif
-#ifdef HAVE_UCRED_H
-#include <ucred.h>
-#endif
-
-#ifndef EWOULDBLOCK
-#define EWOULDBLOCK EAGAIN
-#endif
-
-/*
- * workaround for NetBSD, OpenBSD and etc.
- * The problem is since 4.4BSD-Lite.
- * FreeBSD fix the problem at FreeBSD 2.2.0.
- * NetBSD fix the problem at NetBSD 3.0 by kern/29624.
- * OpenBSD fix the problem at OpenBSD 3.8.
- */
-#define pseudo_AF_FTIP pseudo_AF_RTIP
-
-#ifndef HAVE_GETADDRINFO
-# include "addrinfo.h"
-#endif
-#include "sockport.h"
-
-#ifndef NI_MAXHOST
-# define NI_MAXHOST 1025
-#endif
-#ifndef NI_MAXSERV
-# define NI_MAXSERV 32
-#endif
-
-#ifdef AF_INET6
-# define IS_IP_FAMILY(af) ((af) == AF_INET || (af) == AF_INET6)
-#else
-# define IS_IP_FAMILY(af) ((af) == AF_INET)
-#endif
-
-#ifndef HAVE_SOCKADDR_STORAGE
-/*
- * RFC 2553: protocol-independent placeholder for socket addresses
- */
-#define _SS_MAXSIZE 128
-#define _SS_ALIGNSIZE (sizeof(double))
-#define _SS_PAD1SIZE (_SS_ALIGNSIZE - sizeof(unsigned char) * 2)
-#define _SS_PAD2SIZE (_SS_MAXSIZE - sizeof(unsigned char) * 2 - \
- _SS_PAD1SIZE - _SS_ALIGNSIZE)
-
-struct sockaddr_storage {
-#ifdef HAVE_SA_LEN
- unsigned char ss_len; /* address length */
- unsigned char ss_family; /* address family */
-#else
- unsigned short ss_family;
-#endif
- char __ss_pad1[_SS_PAD1SIZE];
- double __ss_align; /* force desired structure storage alignment */
- char __ss_pad2[_SS_PAD2SIZE];
-};
-#endif
-
-#if defined(_AIX)
-#ifndef CMSG_SPACE
-# define CMSG_SPACE(len) (_CMSG_ALIGN(sizeof(struct cmsghdr)) + _CMSG_ALIGN(len))
-#endif
-#ifndef CMSG_LEN
-# define CMSG_LEN(len) (_CMSG_ALIGN(sizeof(struct cmsghdr)) + (len))
-#endif
-#endif
-
-#ifdef __BEOS__
-#undef close
-#define close closesocket
-#endif
-
-#define INET_CLIENT 0
-#define INET_SERVER 1
-#define INET_SOCKS 2
-
-extern int rsock_do_not_reverse_lookup;
-#define FMODE_NOREVLOOKUP 0x100
-
-extern VALUE rb_cBasicSocket;
-extern VALUE rb_cIPSocket;
-extern VALUE rb_cTCPSocket;
-extern VALUE rb_cTCPServer;
-extern VALUE rb_cUDPSocket;
-#ifdef HAVE_SYS_UN_H
-extern VALUE rb_cUNIXSocket;
-extern VALUE rb_cUNIXServer;
-#endif
-extern VALUE rb_cSocket;
-extern VALUE rb_cAddrinfo;
-extern VALUE rb_cSockOpt;
-
-extern VALUE rb_eSocket;
-
-#ifdef SOCKS
-extern VALUE rb_cSOCKSSocket;
-#ifdef SOCKS5
-#include <socks.h>
-#else
-void SOCKSinit();
-int Rconnect();
-#endif
-#endif
-
-#include "constdefs.h"
-
-#define BLOCKING_REGION(func, arg) (long)rb_thread_blocking_region((func), (arg), RUBY_UBF_IO, 0)
-
-#define SockAddrStringValue(v) rsock_sockaddr_string_value(&(v))
-#define SockAddrStringValuePtr(v) rsock_sockaddr_string_value_ptr(&(v))
-VALUE rsock_sockaddr_string_value(volatile VALUE *);
-char *rsock_sockaddr_string_value_ptr(volatile VALUE *);
-VALUE rb_check_sockaddr_string_type(VALUE);
-
-NORETURN(void rsock_raise_socket_error(const char *, int));
-
-int rsock_family_arg(VALUE domain);
-int rsock_socktype_arg(VALUE type);
-int rsock_level_arg(int family, VALUE level);
-int rsock_optname_arg(int family, int level, VALUE optname);
-int rsock_cmsg_type_arg(int family, int level, VALUE type);
-int rsock_shutdown_how_arg(VALUE how);
-
-int rsock_getfamily(int sockfd);
-
-int rb_getaddrinfo(const char *node, const char *service, const struct addrinfo *hints, struct addrinfo **res);
-int rb_getnameinfo(const struct sockaddr *sa, socklen_t salen, char *host, size_t hostlen, char *serv, size_t servlen, int flags);
-struct addrinfo *rsock_addrinfo(VALUE host, VALUE port, int socktype, int flags);
-struct addrinfo *rsock_getaddrinfo(VALUE host, VALUE port, struct addrinfo *hints, int socktype_hack);
-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);
-
-VALUE rsock_addrinfo_new(struct sockaddr *addr, socklen_t len, int family, int socktype, int protocol, VALUE canonname, VALUE inspectname);
-
-VALUE rsock_make_ipaddr(struct sockaddr *addr);
-VALUE rsock_ipaddr(struct sockaddr *sockaddr, int norevlookup);
-VALUE rsock_make_hostent(VALUE host, struct addrinfo *addr, VALUE (*ipaddr)(struct sockaddr *, size_t));
-
-#ifdef HAVE_SYS_UN_H
-const char* rsock_unixpath(struct sockaddr_un *sockaddr, socklen_t len);
-VALUE rsock_unixaddr(struct sockaddr_un *sockaddr, socklen_t len);
-#endif
-
-int rsock_socket(int domain, int type, int proto);
-VALUE rsock_init_sock(VALUE sock, int fd);
-VALUE rsock_sock_s_socketpair(int argc, VALUE *argv, VALUE klass);
-VALUE rsock_init_inetsock(VALUE sock, VALUE remote_host, VALUE remote_serv, VALUE local_host, VALUE local_serv, int type);
-VALUE rsock_init_unixsock(VALUE sock, VALUE path, int server);
-
-struct rsock_send_arg {
- int fd, flags;
- VALUE mesg;
- struct sockaddr *to;
- socklen_t tolen;
-};
-
-VALUE rsock_sendto_blocking(void *data);
-VALUE rsock_send_blocking(void *data);
-VALUE rsock_bsock_send(int argc, VALUE *argv, VALUE sock);
-
-enum sock_recv_type {
- RECV_RECV, /* BasicSocket#recv(no from) */
- RECV_IP, /* IPSocket#recvfrom */
- RECV_UNIX, /* UNIXSocket#recvfrom */
- RECV_SOCKET /* Socket#recvfrom */
-};
-
-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, rb_io_t *fptr, struct sockaddr *sockaddr, socklen_t *len);
-
-VALUE rsock_sockopt_new(int family, int level, int optname, VALUE data);
-
-#ifdef HAVE_ST_MSG_CONTROL
-void rsock_discard_cmsg_resource(struct msghdr *mh);
-#endif
-
-void Init_basicsocket(void);
-void Init_ipsocket(void);
-void Init_tcpsocket(void);
-void Init_tcpserver(void);
-void Init_sockssocket(void);
-void Init_udpsocket(void);
-void Init_unixsocket(void);
-void Init_unixserver(void);
-void Init_socket_constants(void);
-void Init_ancdata(void);
-void Init_addrinfo(void);
-void Init_sockopt(void);
-void Init_socket_init(void);
-
-#endif
diff --git a/ext/socket/socket.c b/ext/socket/socket.c
index a2e14b32d2..491823ad44 100644
--- a/ext/socket/socket.c
+++ b/ext/socket/socket.c
@@ -2,112 +2,2376 @@
socket.c -
+ $Author$
+ $Date$
created at: Thu Mar 31 12:21:29 JST 1994
- Copyright (C) 1993-2007 Yukihiro Matsumoto
+ Copyright (C) 1993-2001 Yukihiro Matsumoto
************************************************/
-#include "rubysocket.h"
+#include "ruby.h"
+#include "rubyio.h"
+#include "rubysig.h"
+#include "util.h"
+#include <stdio.h>
+#include <sys/types.h>
-static void
-setup_domain_and_type(VALUE domain, int *dv, VALUE type, int *tv)
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+#ifdef HAVE_SYS_UIO_H
+#include <sys/uio.h>
+#endif
+
+#ifndef _WIN32
+#if defined(__BEOS__)
+# include <net/socket.h>
+#else
+# include <sys/socket.h>
+# define pseudo_AF_FTIP pseudo_AF_RTIP /* workaround for NetBSD and etc. */
+#endif
+#include <netinet/in.h>
+#ifdef HAVE_NETINET_IN_SYSTM_H
+# include <netinet/in_systm.h>
+#endif
+#ifdef HAVE_NETINET_TCP_H
+# include <netinet/tcp.h>
+#endif
+#ifdef HAVE_NETINET_UDP_H
+# include <netinet/udp.h>
+#endif
+#ifdef HAVE_ARPA_INET_H
+# include <arpa/inet.h>
+#endif
+#include <netdb.h>
+#endif
+#include <errno.h>
+#ifdef HAVE_SYS_UN_H
+#include <sys/un.h>
+#endif
+
+#if defined(HAVE_FCNTL)
+#ifdef HAVE_SYS_SELECT_H
+#include <sys/select.h>
+#endif
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+#ifdef HAVE_FCNTL_H
+#include <fcntl.h>
+#endif
+#endif
+#ifndef EWOULDBLOCK
+#define EWOULDBLOCK EAGAIN
+#endif
+#ifndef HAVE_GETADDRINFO
+# include "addrinfo.h"
+#endif
+#include "sockport.h"
+
+#if defined(__vms)
+#include <tcp.h>
+#endif
+
+static int do_not_reverse_lookup = 0;
+
+VALUE rb_cBasicSocket;
+VALUE rb_cIPSocket;
+VALUE rb_cTCPSocket;
+VALUE rb_cTCPServer;
+VALUE rb_cUDPSocket;
+#ifdef AF_UNIX
+VALUE rb_cUNIXSocket;
+VALUE rb_cUNIXServer;
+#endif
+VALUE rb_cSocket;
+
+static VALUE rb_eSocket;
+
+#ifdef SOCKS
+VALUE rb_cSOCKSSocket;
+#ifdef SOCKS5
+#include <socks.h>
+#else
+void SOCKSinit();
+int Rconnect();
+#endif
+#endif
+
+#define INET_CLIENT 0
+#define INET_SERVER 1
+#define INET_SOCKS 2
+
+#ifndef HAVE_SOCKADDR_STORAGE
+/*
+ * RFC 2553: protocol-independent placeholder for socket addresses
+ */
+#define _SS_MAXSIZE 128
+#define _SS_ALIGNSIZE (sizeof(double))
+#define _SS_PAD1SIZE (_SS_ALIGNSIZE - sizeof(unsigned char) * 2)
+#define _SS_PAD2SIZE (_SS_MAXSIZE - sizeof(unsigned char) * 2 - \
+ _SS_PAD1SIZE - _SS_ALIGNSIZE)
+
+struct sockaddr_storage {
+#ifdef HAVE_SA_LEN
+ unsigned char ss_len; /* address length */
+ unsigned char ss_family; /* address family */
+#else
+ unsigned short ss_family;
+#endif
+ char __ss_pad1[_SS_PAD1SIZE];
+ double __ss_align; /* force desired structure storage alignment */
+ char __ss_pad2[_SS_PAD2SIZE];
+};
+#endif
+
+#if defined(INET6) && (defined(LOOKUP_ORDER_HACK_INET) || defined(LOOKUP_ORDER_HACK_INET6))
+#define LOOKUP_ORDERS 3
+static int lookup_order_table[LOOKUP_ORDERS] = {
+#if defined(LOOKUP_ORDER_HACK_INET)
+ PF_INET, PF_INET6, PF_UNSPEC,
+#elif defined(LOOKUP_ORDER_HACK_INET6)
+ PF_INET6, PF_INET, PF_UNSPEC,
+#else
+ /* should not happen */
+#endif
+};
+
+static int
+ruby_getaddrinfo(nodename, servname, hints, res)
+ char *nodename;
+ char *servname;
+ struct addrinfo *hints;
+ struct addrinfo **res;
+{
+ struct addrinfo tmp_hints;
+ int i, af, error;
+
+ if (hints->ai_family != PF_UNSPEC) {
+ return getaddrinfo(nodename, servname, hints, res);
+ }
+
+ for (i = 0; i < LOOKUP_ORDERS; i++) {
+ af = lookup_order_table[i];
+ MEMCPY(&tmp_hints, hints, struct addrinfo, 1);
+ tmp_hints.ai_family = af;
+ error = getaddrinfo(nodename, servname, &tmp_hints, res);
+ if (error) {
+ if (tmp_hints.ai_family == PF_UNSPEC) {
+ break;
+ }
+ }
+ else {
+ break;
+ }
+ }
+
+ return error;
+}
+#define getaddrinfo(node,serv,hints,res) ruby_getaddrinfo((node),(serv),(hints),(res))
+#endif
+
+#if defined(_AIX)
+static int
+ruby_getaddrinfo__aix(nodename, servname, hints, res)
+ char *nodename;
+ char *servname;
+ struct addrinfo *hints;
+ struct addrinfo **res;
+{
+ int error = getaddrinfo(nodename, servname, hints, res);
+ struct addrinfo *r;
+ if (error)
+ return error;
+ for (r = *res; r != NULL; r = r->ai_next) {
+ if (r->ai_addr->sa_family == 0)
+ r->ai_addr->sa_family = r->ai_family;
+ if (r->ai_addr->sa_len == 0)
+ r->ai_addr->sa_len = r->ai_addrlen;
+ }
+ return 0;
+}
+#undef getaddrinfo
+#define getaddrinfo(node,serv,hints,res) ruby_getaddrinfo__aix((node),(serv),(hints),(res))
+static int
+ruby_getnameinfo__aix(sa, salen, host, hostlen, serv, servlen, flags)
+ const struct sockaddr *sa;
+ size_t salen;
+ char *host;
+ size_t hostlen;
+ char *serv;
+ size_t servlen;
+ int flags;
+{
+ struct sockaddr_in6 *sa6;
+ u_int32_t *a6;
+
+ if (sa->sa_family == AF_INET6) {
+ sa6 = (struct sockaddr_in6 *)sa;
+ a6 = sa6->sin6_addr.u6_addr.u6_addr32;
+
+ if (a6[0] == 0 && a6[1] == 0 && a6[2] == 0 && a6[3] == 0) {
+ strncpy(host, "::", hostlen);
+ snprintf(serv, servlen, "%d", sa6->sin6_port);
+ return 0;
+ }
+ }
+ return getnameinfo(sa, salen, host, hostlen, serv, servlen, flags);
+}
+#undef getnameinfo
+#define getnameinfo(sa, salen, host, hostlen, serv, servlen, flags) \
+ ruby_getnameinfo__aix((sa), (salen), (host), (hostlen), (serv), (servlen), (flags))
+#ifndef CMSG_SPACE
+# define CMSG_SPACE(len) (_CMSG_ALIGN(sizeof(struct cmsghdr)) + _CMSG_ALIGN(len))
+#endif
+#ifndef CMSG_LEN
+# define CMSG_LEN(len) (_CMSG_ALIGN(sizeof(struct cmsghdr)) + (len))
+#endif
+#endif
+
+#ifdef HAVE_CLOSESOCKET
+#undef close
+#define close closesocket
+#endif
+
+static VALUE
+init_sock(sock, fd)
+ VALUE sock;
+ int fd;
{
- *dv = rsock_family_arg(domain);
- *tv = rsock_socktype_arg(type);
+ rb_io_t *fp;
+
+ MakeOpenFile(sock, fp);
+ fp->f = rb_fdopen(fd, "r");
+ fp->f2 = rb_fdopen(fd, "w");
+ fp->mode = FMODE_READWRITE;
+ rb_io_synchronized(fp);
+
+ return sock;
+}
+
+static VALUE
+bsock_s_for_fd(klass, fd)
+ VALUE klass, fd;
+{
+ rb_io_t *fptr;
+ VALUE sock = init_sock(rb_obj_alloc(klass), NUM2INT(fd));
+
+ GetOpenFile(sock, fptr);
+
+ return sock;
+}
+
+static VALUE
+bsock_shutdown(argc, argv, sock)
+ int argc;
+ VALUE *argv;
+ VALUE sock;
+{
+ VALUE howto;
+ int how;
+ rb_io_t *fptr;
+
+ if (rb_safe_level() >= 4 && !OBJ_TAINTED(sock)) {
+ rb_raise(rb_eSecurityError, "Insecure: can't shutdown socket");
+ }
+ rb_scan_args(argc, argv, "01", &howto);
+ if (howto == Qnil)
+ how = 2;
+ else {
+ how = NUM2INT(howto);
+ if (how < 0 || 2 < how) {
+ rb_raise(rb_eArgError, "`how' should be either 0, 1, 2");
+ }
+ }
+ GetOpenFile(sock, fptr);
+ if (shutdown(fileno(fptr->f), how) == -1)
+ rb_sys_fail(0);
+
+ return INT2FIX(0);
+}
+
+static VALUE
+bsock_close_read(sock)
+ VALUE sock;
+{
+ rb_io_t *fptr;
+
+ if (rb_safe_level() >= 4 && !OBJ_TAINTED(sock)) {
+ rb_raise(rb_eSecurityError, "Insecure: can't close socket");
+ }
+ GetOpenFile(sock, fptr);
+ shutdown(fileno(fptr->f), 0);
+ if (!(fptr->mode & FMODE_WRITABLE)) {
+ return rb_io_close(sock);
+ }
+ fptr->mode &= ~FMODE_READABLE;
+
+ return Qnil;
+}
+
+static VALUE
+bsock_close_write(sock)
+ VALUE sock;
+{
+ rb_io_t *fptr;
+
+ if (rb_safe_level() >= 4 && !OBJ_TAINTED(sock)) {
+ rb_raise(rb_eSecurityError, "Insecure: can't close socket");
+ }
+ GetOpenFile(sock, fptr);
+ if (!(fptr->mode & FMODE_READABLE)) {
+ return rb_io_close(sock);
+ }
+ shutdown(fileno(fptr->f2), 1);
+ fptr->mode &= ~FMODE_WRITABLE;
+
+ return Qnil;
}
/*
- * call-seq:
- * Socket.new(domain, socktype [, protocol]) => socket
+ * Document-method: setsockopt
+ * call-seq: setsockopt(level, optname, optval)
+ *
+ * Sets a socket option. These are protocol and system specific, see your
+ * local sytem documentation for details.
+ *
+ * === Parameters
+ * * +level+ is an integer, usually one of the SOL_ constants such as
+ * Socket::SOL_SOCKET, or a protocol level.
+ * * +optname+ is an integer, usually one of the SO_ constants, such
+ * as Socket::SO_REUSEADDR.
+ * * +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:
+ * - 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 a Fixnum. Note that +false+ must be passed,
+ * not +nil+.
+ * - String: the string's data and length is passed to the socket.
+ *
+ * === Examples
*
- * Creates a new socket object.
+ * Some socket options are integers with boolean values, in this case
+ * #setsockopt could be called like this:
+ * sock.setsockopt(Socket::SOL_SOCKET,Socket::SO_REUSEADDR, true)
*
- * _domain_ should be a communications domain such as: :INET, :INET6, :UNIX, etc.
+ * Some socket options are integers with numeric values, in this case
+ * #setsockopt could be called like this:
+ * sock.setsockopt(Socket::IPPROTO_IP, Socket::IP_TTL, 255)
*
- * _socktype_ should be a socket type such as: :STREAM, :DGRAM, :RAW, etc.
+ * Option values may be structs. Passing them can be complex as it involves
+ * examining your system headers to determine the correct definition. An
+ * example is an +ip_mreq+, which may be defined in your system headers as:
+ * struct ip_mreq {
+ * struct in_addr imr_multiaddr;
+ * struct in_addr imr_interface;
+ * };
+ *
+ * In this case #setsockopt could be called like this:
+ * optval = IPAddr.new("224.0.0.251") + Socket::INADDR_ANY
+ * sock.setsockopt(Socket::IPPROTO_IP, Socket::IP_ADD_MEMBERSHIP, optval)
+ *
+*/
+static VALUE
+bsock_setsockopt(sock, lev, optname, val)
+ VALUE sock, lev, optname, val;
+{
+ int level, option;
+ rb_io_t *fptr;
+ int i;
+ char *v;
+ int vlen;
+
+ rb_secure(2);
+ level = NUM2INT(lev);
+ option = NUM2INT(optname);
+
+ switch (TYPE(val)) {
+ case T_FIXNUM:
+ i = FIX2INT(val);
+ goto numval;
+ case T_FALSE:
+ i = 0;
+ goto numval;
+ case T_TRUE:
+ i = 1;
+ numval:
+ v = (char*)&i; vlen = sizeof(i);
+ break;
+ default:
+ StringValue(val);
+ v = RSTRING(val)->ptr;
+ vlen = RSTRING(val)->len;
+ break;
+ }
+
+ GetOpenFile(sock, fptr);
+ if (setsockopt(fileno(fptr->f), level, option, v, vlen) < 0)
+ rb_sys_fail(fptr->path);
+
+ return INT2FIX(0);
+}
+
+/*
+ * Document-method: getsockopt
+ * call-seq: getsockopt(level, optname)
*
- * _protocol_ should be a protocol defined in the domain.
- * This is optional.
- * If it is not given, 0 is used internally.
+ * Gets a socket option. These are protocol and system specific, see your
+ * local sytem documentation for details. The option is returned as
+ * a String with the data being the binary value of the socket option.
*
- * Socket.new(:INET, :STREAM) # TCP socket
- * Socket.new(:INET, :DGRAM) # UDP socket
- * Socket.new(:UNIX, :STREAM) # UNIX stream socket
- * Socket.new(:UNIX, :DGRAM) # UNIX datagram socket
+ * === Parameters
+ * * +level+ is an integer, usually one of the SOL_ constants such as
+ * Socket::SOL_SOCKET, or a protocol level.
+ * * +optname+ is an integer, usually one of the SO_ constants, such
+ * as Socket::SO_REUSEADDR.
+ *
+ * === Examples
+ *
+ * Some socket options are integers with boolean values, in this case
+ * #getsockopt could be called like this:
+ * optval = sock.getsockopt(Socket::SOL_SOCKET,Socket::SO_REUSEADDR)
+ * optval = optval.unpack "i"
+ * reuseaddr = optval[0] == 0 ? false : true
+ *
+ * Some socket options are integers with numeric values, in this case
+ * #getsockopt could be called like this:
+ * optval = sock.getsockopt(Socket::IPPROTO_IP, Socket::IP_TTL)
+ * ipttl = optval.unpack("i")[0]
+ *
+ * Option values may be structs. Decoding them can be complex as it involves
+ * examining your system headers to determine the correct definition. An
+ * example is a +struct linger+, which may be defined in your system headers
+ * as:
+ * struct linger {
+ * int l_onoff;
+ * int l_linger;
+ * };
+ *
+ * In this case #getsockopt could be called like this:
+ * optval = sock.getsockopt(Socket::SOL_SOCKET, Socket::SO_LINGER)
+ * onoff, linger = optval.unpack "ii"
+*/
+static VALUE
+bsock_getsockopt(sock, lev, optname)
+ VALUE sock, lev, optname;
+{
+#if !defined(__BEOS__)
+ int level, option;
+ socklen_t len;
+ char *buf;
+ rb_io_t *fptr;
+
+ level = NUM2INT(lev);
+ option = NUM2INT(optname);
+ len = 256;
+ buf = ALLOCA_N(char,len);
+ GetOpenFile(sock, fptr);
+
+ GetOpenFile(sock, fptr);
+ if (getsockopt(fileno(fptr->f), level, option, buf, &len) < 0)
+ rb_sys_fail(fptr->path);
+
+ return rb_str_new(buf, len);
+#else
+ rb_notimplement();
+#endif
+}
+
+static VALUE
+bsock_getsockname(sock)
+ VALUE sock;
+{
+ char buf[1024];
+ socklen_t len = sizeof buf;
+ rb_io_t *fptr;
+
+ GetOpenFile(sock, fptr);
+ if (getsockname(fileno(fptr->f), (struct sockaddr*)buf, &len) < 0)
+ rb_sys_fail("getsockname(2)");
+ return rb_str_new(buf, len);
+}
+
+static VALUE
+bsock_getpeername(sock)
+ VALUE sock;
+{
+ char buf[1024];
+ socklen_t len = sizeof buf;
+ rb_io_t *fptr;
+
+ GetOpenFile(sock, fptr);
+ if (getpeername(fileno(fptr->f), (struct sockaddr*)buf, &len) < 0)
+ rb_sys_fail("getpeername(2)");
+ return rb_str_new(buf, len);
+}
+
+static VALUE
+bsock_send(argc, argv, sock)
+ int argc;
+ VALUE *argv;
+ VALUE sock;
+{
+ VALUE mesg, to;
+ VALUE flags;
+ rb_io_t *fptr;
+ FILE *f;
+ int fd, n;
+
+ rb_secure(4);
+ rb_scan_args(argc, argv, "21", &mesg, &flags, &to);
+
+ StringValue(mesg);
+ if (!NIL_P(to)) StringValue(to);
+ GetOpenFile(sock, fptr);
+ f = GetWriteFile(fptr);
+ fd = fileno(f);
+ rb_thread_fd_writable(fd);
+ retry:
+ if (!NIL_P(to)) {
+ TRAP_BEG;
+ n = sendto(fd, RSTRING(mesg)->ptr, RSTRING(mesg)->len, NUM2INT(flags),
+ (struct sockaddr*)RSTRING(to)->ptr, RSTRING(to)->len);
+ TRAP_END;
+ }
+ else {
+ TRAP_BEG;
+ n = send(fd, RSTRING(mesg)->ptr, RSTRING(mesg)->len, NUM2INT(flags));
+ TRAP_END;
+ }
+ if (n < 0) {
+ if (rb_io_wait_writable(fd)) {
+ goto retry;
+ }
+ rb_sys_fail("send(2)");
+ }
+ return INT2FIX(n);
+}
+
+static VALUE ipaddr _((struct sockaddr*));
+#ifdef HAVE_SYS_UN_H
+static VALUE unixaddr _((struct sockaddr_un*, socklen_t));
+#endif
+
+enum sock_recv_type {
+ RECV_RECV, /* BasicSocket#recv(no from) */
+ RECV_IP, /* IPSocket#recvfrom */
+ RECV_UNIX, /* UNIXSocket#recvfrom */
+ RECV_SOCKET /* Socket#recvfrom */
+};
+
+static VALUE
+s_recvfrom(sock, argc, argv, from)
+ VALUE sock;
+ int argc;
+ VALUE *argv;
+ enum sock_recv_type from;
+{
+ rb_io_t *fptr;
+ VALUE str;
+ char buf[1024];
+ socklen_t alen = sizeof buf;
+ VALUE len, flg;
+ long buflen;
+ long slen;
+ int fd, flags;
+
+ rb_scan_args(argc, argv, "11", &len, &flg);
+
+ if (flg == Qnil) flags = 0;
+ else flags = NUM2INT(flg);
+ buflen = NUM2INT(len);
+
+ GetOpenFile(sock, fptr);
+ if (rb_read_pending(fptr->f)) {
+ rb_raise(rb_eIOError, "recv for buffered IO");
+ }
+ fd = fileno(fptr->f);
+
+ str = rb_tainted_str_new(0, buflen);
+
+ retry:
+ rb_str_locktmp(str);
+ rb_thread_wait_fd(fd);
+ TRAP_BEG;
+ slen = recvfrom(fd, RSTRING(str)->ptr, buflen, flags, (struct sockaddr*)buf, &alen);
+ TRAP_END;
+ rb_str_unlocktmp(str);
+
+ if (slen < 0) {
+ if (rb_io_wait_readable(fd)) {
+ goto retry;
+ }
+ rb_sys_fail("recvfrom(2)");
+ }
+ if (slen < RSTRING(str)->len) {
+ RSTRING(str)->len = slen;
+ RSTRING(str)->ptr[slen] = '\0';
+ }
+ rb_obj_taint(str);
+ switch (from) {
+ case RECV_RECV:
+ return (VALUE)str;
+ case RECV_IP:
+#if 0
+ if (alen != sizeof(struct sockaddr_in)) {
+ rb_raise(rb_eTypeError, "sockaddr size differs - should not happen");
+ }
+#endif
+ if (alen && alen != sizeof(buf)) /* OSX doesn't return a 'from' result from recvfrom for connection-oriented sockets */
+ return rb_assoc_new(str, ipaddr((struct sockaddr*)buf));
+ else
+ return rb_assoc_new(str, Qnil);
+
+#ifdef HAVE_SYS_UN_H
+ case RECV_UNIX:
+ return rb_assoc_new(str, unixaddr((struct sockaddr_un*)buf, alen));
+#endif
+ case RECV_SOCKET:
+ return rb_assoc_new(str, rb_str_new(buf, alen));
+ default:
+ rb_bug("s_recvfrom called with bad value");
+ }
+}
+
+static VALUE
+s_recvfrom_nonblock(VALUE sock, int argc, VALUE *argv, enum sock_recv_type from)
+{
+ rb_io_t *fptr;
+ VALUE str;
+ char buf[1024];
+ socklen_t alen = sizeof buf;
+ VALUE len, flg;
+ long buflen;
+ long slen;
+ int fd, flags;
+ VALUE addr = Qnil;
+
+ rb_scan_args(argc, argv, "11", &len, &flg);
+
+ if (flg == Qnil) flags = 0;
+ else flags = NUM2INT(flg);
+ buflen = NUM2INT(len);
+
+#ifdef MSG_DONTWAIT
+ /* MSG_DONTWAIT avoids the race condition between fcntl and recvfrom.
+ It is not portable, though. */
+ flags |= MSG_DONTWAIT;
+#endif
+
+ GetOpenFile(sock, fptr);
+ if (rb_read_pending(fptr->f)) {
+ rb_raise(rb_eIOError, "recvfrom for buffered IO");
+ }
+ fd = fileno(fptr->f);
+
+ str = rb_tainted_str_new(0, buflen);
+
+ rb_io_check_closed(fptr);
+ rb_io_set_nonblock(fptr);
+ slen = recvfrom(fd, RSTRING(str)->ptr, buflen, flags, (struct sockaddr*)buf, &alen);
+
+ if (slen < 0) {
+ rb_sys_fail("recvfrom(2)");
+ }
+ if (slen < RSTRING(str)->len) {
+ RSTRING(str)->len = slen;
+ RSTRING(str)->ptr[slen] = '\0';
+ }
+ rb_obj_taint(str);
+ switch (from) {
+ case RECV_RECV:
+ return str;
+
+ case RECV_IP:
+ if (alen && alen != sizeof(buf)) /* connection-oriented socket may not return a from result */
+ addr = ipaddr((struct sockaddr*)buf);
+ break;
+
+ case RECV_SOCKET:
+ addr = rb_str_new(buf, alen);
+ break;
+
+ default:
+ rb_bug("s_recvfrom_nonblock called with bad value");
+ }
+ return rb_assoc_new(str, addr);
+}
+
+static VALUE
+bsock_recv(argc, argv, sock)
+ int argc;
+ VALUE *argv;
+ VALUE sock;
+{
+ return s_recvfrom(sock, argc, argv, RECV_RECV);
+}
+
+/*
+ * call-seq:
+ * basicsocket.recv_nonblock(maxlen) => mesg
+ * basicsocket.recv_nonblock(maxlen, flags) => mesg
+ *
+ * Receives up to _maxlen_ bytes from +socket+ using recvfrom(2) after
+ * O_NONBLOCK is set for the underlying file descriptor.
+ * _flags_ is zero or more of the +MSG_+ options.
+ * The result, _mesg_, is the data received.
+ *
+ * When recvfrom(2) returns 0, Socket#recv_nonblock returns
+ * an empty string as data.
+ * The meaning depends on the socket: EOF on TCP, empty packet on UDP, etc.
+ *
+ * === Parameters
+ * * +maxlen+ - the number of bytes to receive from the socket
+ * * +flags+ - zero or more of the +MSG_+ options
+ *
+ * === Example
+ * serv = TCPServer.new("127.0.0.1", 0)
+ * af, port, host, addr = serv.addr
+ * c = TCPSocket.new(addr, port)
+ * s = serv.accept
+ * c.send "aaa", 0
+ * IO.select([s])
+ * p s.recv_nonblock(10) #=> "aaa"
+ *
+ * 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::EAGAIN.
+ *
+ * === See
+ * * Socket#recvfrom
*/
+
static VALUE
-sock_initialize(int argc, VALUE *argv, VALUE sock)
+bsock_recv_nonblock(argc, argv, sock)
+ int argc;
+ VALUE *argv;
+ VALUE sock;
+{
+ return s_recvfrom_nonblock(sock, argc, argv, RECV_RECV);
+}
+
+static VALUE
+bsock_do_not_rev_lookup()
+{
+ return do_not_reverse_lookup?Qtrue:Qfalse;
+}
+
+static VALUE
+bsock_do_not_rev_lookup_set(self, val)
+ VALUE self, val;
+{
+ rb_secure(4);
+ do_not_reverse_lookup = RTEST(val);
+ return val;
+}
+
+static void
+make_ipaddr0(addr, buf, len)
+ struct sockaddr *addr;
+ char *buf;
+ size_t len;
+{
+ int error;
+
+ error = getnameinfo(addr, SA_LEN(addr), buf, len, NULL, 0, NI_NUMERICHOST);
+ if (error) {
+ rb_raise(rb_eSocket, "getnameinfo: %s", gai_strerror(error));
+ }
+}
+
+static VALUE
+make_ipaddr(addr)
+ struct sockaddr *addr;
+{
+ char buf[1024];
+
+ make_ipaddr0(addr, buf, sizeof(buf));
+ return rb_str_new2(buf);
+}
+
+static void
+make_inetaddr(host, buf, len)
+ long host;
+ char *buf;
+ size_t len;
+{
+ struct sockaddr_in sin;
+
+ MEMZERO(&sin, struct sockaddr_in, 1);
+ sin.sin_family = AF_INET;
+ SET_SIN_LEN(&sin, sizeof(sin));
+ sin.sin_addr.s_addr = host;
+ make_ipaddr0((struct sockaddr*)&sin, buf, len);
+}
+
+static int
+str_isnumber(p)
+ const char *p;
+{
+ char *ep;
+
+ if (!p || *p == '\0')
+ return 0;
+ ep = NULL;
+ (void)strtoul(p, &ep, 10);
+ if (ep && *ep == '\0')
+ return 1;
+ else
+ return 0;
+}
+
+static char *
+host_str(host, hbuf, len)
+ VALUE host;
+ char *hbuf;
+ size_t len;
+{
+ if (NIL_P(host)) {
+ return NULL;
+ }
+ else if (rb_obj_is_kind_of(host, rb_cInteger)) {
+ unsigned long i = NUM2ULONG(host);
+
+ make_inetaddr(htonl(i), hbuf, len);
+ return hbuf;
+ }
+ else {
+ char *name;
+
+ SafeStringValue(host);
+ name = RSTRING(host)->ptr;
+ if (!name || *name == 0 || (name[0] == '<' && strcmp(name, "<any>") == 0)) {
+ make_inetaddr(INADDR_ANY, hbuf, len);
+ }
+ else if (name[0] == '<' && strcmp(name, "<broadcast>") == 0) {
+ make_inetaddr(INADDR_BROADCAST, hbuf, len);
+ }
+ else if (strlen(name) >= len) {
+ rb_raise(rb_eArgError, "hostname too long (%d)", strlen(name));
+ }
+ else {
+ strcpy(hbuf, name);
+ }
+ return hbuf;
+ }
+}
+
+static char *
+port_str(port, pbuf, len)
+ VALUE port;
+ char *pbuf;
+ size_t len;
+{
+ if (NIL_P(port)) {
+ return 0;
+ }
+ else if (FIXNUM_P(port)) {
+ snprintf(pbuf, len, "%ld", FIX2LONG(port));
+ return pbuf;
+ }
+ else {
+ char *serv;
+
+ SafeStringValue(port);
+ serv = RSTRING(port)->ptr;
+ if (strlen(serv) >= len) {
+ rb_raise(rb_eArgError, "service name too long (%d)", strlen(serv));
+ }
+ strcpy(pbuf, serv);
+ return pbuf;
+ }
+}
+
+#ifndef NI_MAXHOST
+# define NI_MAXHOST 1025
+#endif
+#ifndef NI_MAXSERV
+# define NI_MAXSERV 32
+#endif
+
+static struct addrinfo*
+sock_addrinfo(host, port, socktype, flags)
+ VALUE host, port;
+ int socktype, flags;
+{
+ struct addrinfo hints;
+ struct addrinfo* res = NULL;
+ char *hostp, *portp;
+ int error;
+ char hbuf[NI_MAXHOST], pbuf[NI_MAXSERV];
+
+ hostp = host_str(host, hbuf, sizeof(hbuf));
+ portp = port_str(port, pbuf, sizeof(pbuf));
+
+ if (socktype == 0 && flags == 0 && str_isnumber(portp)) {
+ socktype = SOCK_DGRAM;
+ }
+
+ MEMZERO(&hints, struct addrinfo, 1);
+ hints.ai_family = AF_UNSPEC;
+ hints.ai_socktype = socktype;
+ hints.ai_flags = flags;
+ error = getaddrinfo(hostp, portp, &hints, &res);
+ if (error) {
+ if (hostp && hostp[strlen(hostp)-1] == '\n') {
+ rb_raise(rb_eSocket, "newline at the end of hostname");
+ }
+ rb_raise(rb_eSocket, "getaddrinfo: %s", gai_strerror(error));
+ }
+
+#if defined(__APPLE__) && defined(__MACH__)
+ {
+ struct addrinfo *r;
+ r = res;
+ while (r) {
+ if (! r->ai_socktype) r->ai_socktype = hints.ai_socktype;
+ if (! r->ai_protocol) {
+ if (r->ai_socktype == SOCK_DGRAM) {
+ r->ai_protocol = IPPROTO_UDP;
+ } else if (r->ai_socktype == SOCK_STREAM) {
+ r->ai_protocol = IPPROTO_TCP;
+ }
+ }
+ r = r->ai_next;
+ }
+ }
+#endif
+ return res;
+}
+
+static VALUE
+ipaddr(sockaddr)
+ struct sockaddr *sockaddr;
+{
+ VALUE family, port, addr1, addr2;
+ VALUE ary;
+ int error;
+ char hbuf[1024], pbuf[1024];
+
+ switch (sockaddr->sa_family) {
+ case AF_UNSPEC:
+ family = rb_str_new2("AF_UNSPEC");
+ break;
+ case AF_INET:
+ family = rb_str_new2("AF_INET");
+ break;
+#ifdef INET6
+ case AF_INET6:
+ family = rb_str_new2("AF_INET6");
+ break;
+#endif
+#ifdef AF_LOCAL
+ case AF_LOCAL:
+ family = rb_str_new2("AF_LOCAL");
+ break;
+#elif AF_UNIX
+ case AF_UNIX:
+ family = rb_str_new2("AF_UNIX");
+ break;
+#endif
+ default:
+ sprintf(pbuf, "unknown:%d", sockaddr->sa_family);
+ family = rb_str_new2(pbuf);
+ break;
+ }
+ addr1 = Qnil;
+ if (!do_not_reverse_lookup) {
+ error = getnameinfo(sockaddr, SA_LEN(sockaddr), hbuf, sizeof(hbuf),
+ NULL, 0, 0);
+ if (! error) {
+ addr1 = rb_str_new2(hbuf);
+ }
+ }
+ error = getnameinfo(sockaddr, SA_LEN(sockaddr), hbuf, sizeof(hbuf),
+ pbuf, sizeof(pbuf), NI_NUMERICHOST | NI_NUMERICSERV);
+ if (error) {
+ rb_raise(rb_eSocket, "getnameinfo: %s", gai_strerror(error));
+ }
+ addr2 = rb_str_new2(hbuf);
+ if (addr1 == Qnil) {
+ addr1 = addr2;
+ }
+ port = INT2FIX(atoi(pbuf));
+ ary = rb_ary_new3(4, family, port, addr1, addr2);
+
+ return ary;
+}
+
+static int
+ruby_socket(domain, type, proto)
+ int domain, type, proto;
{
- VALUE domain, type, protocol;
int fd;
- int d, t;
- rb_scan_args(argc, argv, "21", &domain, &type, &protocol);
- if (NIL_P(protocol))
- protocol = INT2FIX(0);
+ fd = socket(domain, type, proto);
+ if (fd < 0) {
+ if (errno == EMFILE || errno == ENFILE) {
+ rb_gc();
+ fd = socket(domain, type, proto);
+ }
+ }
+ return fd;
+}
- 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)");
+static int
+wait_connectable(fd)
+ int fd;
+{
+ int sockerr;
+ socklen_t sockerrlen;
+ fd_set fds_w;
+ fd_set fds_e;
+
+ for (;;) {
+ FD_ZERO(&fds_w);
+ FD_ZERO(&fds_e);
+
+ FD_SET(fd, &fds_w);
+ FD_SET(fd, &fds_e);
+
+ rb_thread_select(fd+1, 0, &fds_w, &fds_e, 0);
- return rsock_init_sock(sock, fd);
+ if (FD_ISSET(fd, &fds_w)) {
+ return 0;
+ }
+ else if (FD_ISSET(fd, &fds_e)) {
+ sockerrlen = sizeof(sockerr);
+ if (getsockopt(fd, SOL_SOCKET, SO_ERROR, (void *)&sockerr,
+ &sockerrlen) == 0) {
+ if (sockerr == 0)
+ continue; /* workaround for winsock */
+ errno = sockerr;
+ }
+ return -1;
+ }
+ }
+
+ return 0;
}
-#if defined HAVE_SOCKETPAIR
+#ifdef __CYGWIN__
+#define WAIT_IN_PROGRESS 10
+#endif
+#ifdef __APPLE__
+#define WAIT_IN_PROGRESS 10
+#endif
+#ifdef __linux__
+/* returns correct error */
+#define WAIT_IN_PROGRESS 0
+#endif
+#ifndef WAIT_IN_PROGRESS
+/* BSD origin code apparently has a problem */
+#define WAIT_IN_PROGRESS 1
+#endif
+
+static int
+ruby_connect(fd, sockaddr, len, socks)
+ int fd;
+ struct sockaddr *sockaddr;
+ int len;
+ int socks;
+{
+ int status;
+ int mode;
+#if WAIT_IN_PROGRESS > 0
+ int wait_in_progress = -1;
+ int sockerr;
+ socklen_t sockerrlen;
+#endif
+
+#if defined(HAVE_FCNTL)
+# if defined(F_GETFL)
+ mode = fcntl(fd, F_GETFL, 0);
+# else
+ mode = 0;
+# endif
+
+#ifdef O_NDELAY
+# define NONBLOCKING O_NDELAY
+#else
+#ifdef O_NBIO
+# define NONBLOCKING O_NBIO
+#else
+# define NONBLOCKING O_NONBLOCK
+#endif
+#endif
+#ifdef SOCKS5
+ if (!socks)
+#endif
+ fcntl(fd, F_SETFL, mode|NONBLOCKING);
+#endif /* HAVE_FCNTL */
+
+ for (;;) {
+#if defined(SOCKS) && !defined(SOCKS5)
+ if (socks) {
+ status = Rconnect(fd, sockaddr, len);
+ }
+ else
+#endif
+ {
+ status = connect(fd, sockaddr, len);
+ }
+ if (status < 0) {
+ switch (errno) {
+ case EAGAIN:
+#ifdef EINPROGRESS
+ case EINPROGRESS:
+#endif
+#if WAIT_IN_PROGRESS > 0
+ sockerrlen = sizeof(sockerr);
+ status = getsockopt(fd, SOL_SOCKET, SO_ERROR, (void *)&sockerr, &sockerrlen);
+ if (status) break;
+ if (sockerr) {
+ status = -1;
+ errno = sockerr;
+ break;
+ }
+#endif
+#ifdef EALREADY
+ case EALREADY:
+#endif
+#if WAIT_IN_PROGRESS > 0
+ wait_in_progress = WAIT_IN_PROGRESS;
+#endif
+ status = wait_connectable(fd);
+ if (status) {
+ break;
+ }
+ errno = 0;
+ continue;
+
+#if WAIT_IN_PROGRESS > 0
+ case EINVAL:
+ if (wait_in_progress-- > 0) {
+ /*
+ * connect() after EINPROGRESS returns EINVAL on
+ * some platforms, need to check true error
+ * status.
+ */
+ sockerrlen = sizeof(sockerr);
+ status = getsockopt(fd, SOL_SOCKET, SO_ERROR, (void *)&sockerr, &sockerrlen);
+ if (!status && !sockerr) {
+ struct timeval tv = {0, 100000};
+ rb_thread_wait_for(tv);
+ continue;
+ }
+ status = -1;
+ errno = sockerr;
+ }
+ break;
+#endif
+
+#ifdef EISCONN
+ case EISCONN:
+ status = 0;
+ errno = 0;
+ break;
+#endif
+ default:
+ break;
+ }
+ }
+#ifdef HAVE_FCNTL
+ fcntl(fd, F_SETFL, mode);
+#endif
+ return status;
+ }
+}
+
+struct inetsock_arg
+{
+ VALUE sock;
+ struct {
+ VALUE host, serv;
+ struct addrinfo *res;
+ } remote, local;
+ int type;
+ int fd;
+};
+
+static VALUE
+inetsock_cleanup(arg)
+ struct inetsock_arg *arg;
+{
+ if (arg->remote.res) {
+ freeaddrinfo(arg->remote.res);
+ arg->remote.res = 0;
+ }
+ if (arg->local.res) {
+ freeaddrinfo(arg->local.res);
+ arg->local.res = 0;
+ }
+ if (arg->fd >= 0) {
+ close(arg->fd);
+ }
+ return Qnil;
+}
+
+static VALUE
+init_inetsock_internal(arg)
+ struct inetsock_arg *arg;
+{
+ int type = arg->type;
+ struct addrinfo *res;
+ int fd, status = 0;
+ char *syscall;
+
+ arg->remote.res = sock_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 = sock_addrinfo(arg->local.host, arg->local.serv, SOCK_STREAM, 0);
+ }
+
+ arg->fd = fd = -1;
+ for (res = arg->remote.res; res; res = res->ai_next) {
+ status = ruby_socket(res->ai_family,res->ai_socktype,res->ai_protocol);
+ syscall = "socket(2)";
+ fd = status;
+ if (fd < 0) {
+ continue;
+ }
+ arg->fd = fd;
+ if (type == INET_SERVER) {
+#if !defined(_WIN32) && !defined(__CYGWIN__)
+ status = 1;
+ setsockopt(fd, SOL_SOCKET, SO_REUSEADDR,
+ (char*)&status, sizeof(status));
+#endif
+ status = bind(fd, res->ai_addr, res->ai_addrlen);
+ syscall = "bind(2)";
+ }
+ else {
+ if (arg->local.res) {
+ status = bind(fd, arg->local.res->ai_addr, arg->local.res->ai_addrlen);
+ syscall = "bind(2)";
+ }
+
+ if (status >= 0) {
+ status = ruby_connect(fd, res->ai_addr, res->ai_addrlen,
+ (type == INET_SOCKS));
+ syscall = "connect(2)";
+ }
+ }
+
+ if (status < 0) {
+ close(fd);
+ arg->fd = fd = -1;
+ continue;
+ } else
+ break;
+ }
+ if (status < 0) {
+ rb_sys_fail(syscall);
+ }
+
+ arg->fd = -1;
+
+ if (type == INET_SERVER)
+ listen(fd, 5);
+
+ /* create new instance */
+ return init_sock(arg->sock, fd);
+}
+
+static VALUE
+init_inetsock(sock, remote_host, remote_serv, local_host, local_serv, type)
+ VALUE sock, remote_host, remote_serv, local_host, local_serv;
+ int type;
+{
+ struct inetsock_arg arg;
+ arg.sock = sock;
+ arg.remote.host = remote_host;
+ arg.remote.serv = remote_serv;
+ arg.remote.res = 0;
+ arg.local.host = local_host;
+ arg.local.serv = local_serv;
+ arg.local.res = 0;
+ arg.type = type;
+ arg.fd = -1;
+ return rb_ensure(init_inetsock_internal, (VALUE)&arg,
+ inetsock_cleanup, (VALUE)&arg);
+}
+
+/*
+ * call-seq:
+ * TCPSocket.new(remote_host, remote_port, local_host=nil, local_port=nil)
+ *
+ * Opens a TCP connection to +remote_host+ on +remote_port+. If +local_host+
+ * and +local_port+ are specified, then those parameters are used on the local
+ * end to establish the connection.
+ */
static VALUE
-io_call_close(VALUE io)
+tcp_init(argc, argv, sock)
+ int argc;
+ VALUE *argv;
+ VALUE sock;
{
- return rb_funcall(io, rb_intern("close"), 0, 0);
+ VALUE remote_host, remote_serv;
+ VALUE local_host, local_serv;
+
+ rb_scan_args(argc, argv, "22", &remote_host, &remote_serv,
+ &local_host, &local_serv);
+
+ return init_inetsock(sock, remote_host, remote_serv,
+ local_host, local_serv, INET_CLIENT);
}
+#ifdef SOCKS
static VALUE
-io_close(VALUE io)
+socks_init(sock, host, serv)
+ VALUE sock, host, serv;
{
- return rb_rescue(io_call_close, io, 0, 0);
+ static init = 0;
+
+ if (init == 0) {
+ SOCKSinit("ruby");
+ init = 1;
+ }
+
+ return init_inetsock(sock, host, serv, Qnil, Qnil, INET_SOCKS);
}
+#ifdef SOCKS5
static VALUE
-pair_yield(VALUE pair)
+socks_s_close(sock)
+ VALUE sock;
{
- return rb_ensure(rb_yield, pair, io_close, rb_ary_entry(pair, 1));
+ rb_io_t *fptr;
+
+ if (rb_safe_level() >= 4 && !OBJ_TAINTED(sock)) {
+ rb_raise(rb_eSecurityError, "Insecure: can't close socket");
+ }
+ GetOpenFile(sock, fptr);
+ shutdown(fileno(fptr->f), 2);
+ shutdown(fileno(fptr->f2), 2);
+ return rb_io_close(sock);
}
#endif
+#endif
+
+struct hostent_arg {
+ VALUE host;
+ struct addrinfo* addr;
+ VALUE (*ipaddr)_((struct sockaddr*, size_t));
+};
+
+static VALUE
+make_hostent_internal(arg)
+ struct hostent_arg *arg;
+{
+ VALUE host = arg->host;
+ struct addrinfo* addr = arg->addr;
+ VALUE (*ipaddr)_((struct sockaddr*, size_t)) = arg->ipaddr;
+
+ struct addrinfo *ai;
+ struct hostent *h;
+ VALUE ary, names;
+ char **pch;
+ const char* hostp;
+ char hbuf[NI_MAXHOST];
+
+ ary = rb_ary_new();
+ if (addr->ai_canonname) {
+ hostp = addr->ai_canonname;
+ }
+ else {
+ hostp = host_str(host, hbuf, sizeof(hbuf));
+ }
+ rb_ary_push(ary, rb_str_new2(hostp));
+
+ if (addr->ai_canonname && (h = gethostbyname(addr->ai_canonname))) {
+ names = rb_ary_new();
+ if (h->h_aliases != NULL) {
+ for (pch = h->h_aliases; *pch; pch++) {
+ rb_ary_push(names, rb_str_new2(*pch));
+ }
+ }
+ }
+ else {
+ names = rb_ary_new2(0);
+ }
+ rb_ary_push(ary, names);
+ rb_ary_push(ary, INT2NUM(addr->ai_family));
+ for (ai = addr; ai; ai = ai->ai_next) {
+ /* Pushing all addresses regardless of address family is not the
+ * behaviour expected of gethostbyname(). All the addresses in struct
+ * hostent->h_addr_list must be of the same family.
+ */
+ if(ai->ai_family == addr->ai_family) {
+ rb_ary_push(ary, (*ipaddr)(ai->ai_addr, ai->ai_addrlen));
+ }
+ }
+
+ return ary;
+}
+
+static VALUE
+make_hostent(host, addr, ipaddr)
+ VALUE host;
+ struct addrinfo* addr;
+ VALUE (*ipaddr)_((struct sockaddr*, size_t));
+{
+ struct hostent_arg arg;
+
+ arg.host = host;
+ arg.addr = addr;
+ arg.ipaddr = ipaddr;
+ return rb_ensure(make_hostent_internal, (VALUE)&arg,
+ RUBY_METHOD_FUNC(freeaddrinfo), (VALUE)addr);
+}
+
+VALUE
+tcp_sockaddr(addr, len)
+ struct sockaddr *addr;
+ size_t len;
+{
+ return make_ipaddr(addr);
+}
+
+static VALUE
+tcp_s_gethostbyname(obj, host)
+ VALUE obj, host;
+{
+ rb_secure(3);
+ return make_hostent(host, sock_addrinfo(host, Qnil, SOCK_STREAM, AI_CANONNAME), tcp_sockaddr);
+}
+
+static VALUE
+tcp_svr_init(argc, argv, sock)
+ int argc;
+ VALUE *argv;
+ VALUE sock;
+{
+ VALUE arg1, arg2;
+
+ if (rb_scan_args(argc, argv, "11", &arg1, &arg2) == 2)
+ return init_inetsock(sock, arg1, arg2, Qnil, Qnil, INET_SERVER);
+ else
+ return init_inetsock(sock, Qnil, arg1, Qnil, Qnil, INET_SERVER);
+}
+
+static void
+make_fd_nonblock(int fd)
+{
+ int flags;
+#ifdef F_GETFL
+ flags = fcntl(fd, F_GETFL);
+ if (flags == -1) {
+ rb_sys_fail(0);
+ }
+#else
+ flags = 0;
+#endif
+ flags |= O_NONBLOCK;
+ if (fcntl(fd, F_SETFL, flags) == -1) {
+ rb_sys_fail(0);
+ }
+}
+
+static VALUE
+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 = accept(fileno(fptr->f), (struct sockaddr*)sockaddr, len);
+ if (fd2 < 0) {
+ rb_sys_fail("accept(2)");
+ }
+ make_fd_nonblock(fd2);
+ return init_sock(rb_obj_alloc(klass), fd2);
+}
+
+static VALUE
+s_accept(klass, fd, sockaddr, len)
+ VALUE klass;
+ int fd;
+ struct sockaddr *sockaddr;
+ socklen_t *len;
+{
+ int fd2;
+ int retry = 0;
+
+ rb_secure(3);
+ retry:
+ rb_thread_wait_fd(fd);
+#if defined(_nec_ews)
+ fd2 = accept(fd, sockaddr, len);
+#else
+ TRAP_BEG;
+ fd2 = accept(fd, sockaddr, len);
+ TRAP_END;
+#endif
+ if (fd2 < 0) {
+ switch (errno) {
+ case EMFILE:
+ case ENFILE:
+ if (retry) break;
+ rb_gc();
+ retry = 1;
+ goto retry;
+ case EWOULDBLOCK:
+ break;
+ default:
+ if (!rb_io_wait_readable(fd)) break;
+ retry = 0;
+ goto retry;
+ }
+ rb_sys_fail(0);
+ }
+ if (!klass) return INT2NUM(fd2);
+ return init_sock(rb_obj_alloc(klass), fd2);
+}
+
+static VALUE
+tcp_accept(sock)
+ VALUE sock;
+{
+ rb_io_t *fptr;
+ struct sockaddr_storage from;
+ socklen_t fromlen;
+
+ GetOpenFile(sock, fptr);
+ fromlen = sizeof(from);
+ return s_accept(rb_cTCPSocket, fileno(fptr->f),
+ (struct sockaddr*)&from, &fromlen);
+}
-#if defined HAVE_SOCKETPAIR
/*
* call-seq:
- * Socket.pair(domain, type, protocol) => [socket1, socket2]
- * Socket.socketpair(domain, type, protocol) => [socket1, socket2]
+ * 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
+ * sock = serv.accept_nonblock
+ * rescue Errno::EAGAIN, Errno::EWOULDBLOCK, Errno::ECONNABORTED, Errno::EPROTO, 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.
*
- * Creates a pair of sockets connected each other.
+ * TCPServer#accept_nonblock may raise any error corresponding to accept(2) failure,
+ * including Errno::EAGAIN.
+ *
+ * === See
+ * * TCPServer#accept
+ * * Socket#accept
+ */
+static VALUE
+tcp_accept_nonblock(sock)
+ VALUE sock;
+{
+ rb_io_t *fptr;
+ struct sockaddr_storage from;
+ socklen_t fromlen;
+
+ GetOpenFile(sock, fptr);
+ fromlen = sizeof(from);
+ return s_accept_nonblock(rb_cTCPSocket, fptr,
+ (struct sockaddr *)&from, &fromlen);
+}
+
+static VALUE
+tcp_sysaccept(sock)
+ VALUE sock;
+{
+ rb_io_t *fptr;
+ struct sockaddr_storage from;
+ socklen_t fromlen;
+
+ GetOpenFile(sock, fptr);
+ fromlen = sizeof(from);
+ return s_accept(0, fileno(fptr->f), (struct sockaddr*)&from, &fromlen);
+}
+
+#ifdef HAVE_SYS_UN_H
+struct unixsock_arg {
+ struct sockaddr_un *sockaddr;
+ int fd;
+};
+
+static VALUE
+unixsock_connect_internal(arg)
+ struct unixsock_arg *arg;
+{
+ return (VALUE)ruby_connect(arg->fd, arg->sockaddr, sizeof(*arg->sockaddr),
+ 0);
+}
+
+static VALUE
+init_unixsock(sock, path, server)
+ VALUE sock;
+ VALUE path;
+ int server;
+{
+ struct sockaddr_un sockaddr;
+ int fd, status;
+ rb_io_t *fptr;
+
+ SafeStringValue(path);
+ fd = ruby_socket(AF_UNIX, SOCK_STREAM, 0);
+ if (fd < 0) {
+ rb_sys_fail("socket(2)");
+ }
+
+ MEMZERO(&sockaddr, struct sockaddr_un, 1);
+ sockaddr.sun_family = AF_UNIX;
+ if (sizeof(sockaddr.sun_path) <= RSTRING(path)->len) {
+ rb_raise(rb_eArgError, "too long unix socket path (max: %dbytes)",
+ (int)sizeof(sockaddr.sun_path)-1);
+ }
+ strcpy(sockaddr.sun_path, StringValueCStr(path));
+
+ if (server) {
+ status = bind(fd, (struct sockaddr*)&sockaddr, sizeof(sockaddr));
+ }
+ else {
+ int prot;
+ struct unixsock_arg arg;
+ arg.sockaddr = &sockaddr;
+ arg.fd = fd;
+ status = rb_protect(unixsock_connect_internal, (VALUE)&arg, &prot);
+ if (prot) {
+ close(fd);
+ rb_jump_tag(prot);
+ }
+ }
+
+ if (status < 0) {
+ close(fd);
+ rb_sys_fail(sockaddr.sun_path);
+ }
+
+ if (server) listen(fd, 5);
+
+ init_sock(sock, fd);
+ GetOpenFile(sock, fptr);
+ if (server) {
+ fptr->path = strdup(RSTRING(path)->ptr);
+ }
+
+ return sock;
+}
+#endif
+
+static VALUE
+ip_addr(sock)
+ VALUE sock;
+{
+ rb_io_t *fptr;
+ struct sockaddr_storage addr;
+ socklen_t len = sizeof addr;
+
+ GetOpenFile(sock, fptr);
+
+ if (getsockname(fileno(fptr->f), (struct sockaddr*)&addr, &len) < 0)
+ rb_sys_fail("getsockname(2)");
+ return ipaddr((struct sockaddr*)&addr);
+}
+
+static VALUE
+ip_peeraddr(sock)
+ VALUE sock;
+{
+ rb_io_t *fptr;
+ struct sockaddr_storage addr;
+ socklen_t len = sizeof addr;
+
+ GetOpenFile(sock, fptr);
+
+ if (getpeername(fileno(fptr->f), (struct sockaddr*)&addr, &len) < 0)
+ rb_sys_fail("getpeername(2)");
+ return ipaddr((struct sockaddr*)&addr);
+}
+
+static VALUE
+ip_recvfrom(argc, argv, sock)
+ int argc;
+ VALUE *argv;
+ VALUE sock;
+{
+ return s_recvfrom(sock, argc, argv, RECV_IP);
+}
+
+static VALUE
+ip_s_getaddress(obj, host)
+ VALUE obj, host;
+{
+ struct sockaddr_storage addr;
+ struct addrinfo *res = sock_addrinfo(host, Qnil, SOCK_STREAM, 0);
+
+ /* just take the first one */
+ memcpy(&addr, res->ai_addr, res->ai_addrlen);
+ freeaddrinfo(res);
+
+ return make_ipaddr((struct sockaddr*)&addr);
+}
+
+static VALUE
+udp_init(argc, argv, sock)
+ int argc;
+ VALUE *argv;
+ VALUE sock;
+{
+ VALUE arg;
+ int socktype = AF_INET;
+ int fd;
+
+ rb_secure(3);
+ if (rb_scan_args(argc, argv, "01", &arg) == 1) {
+ socktype = NUM2INT(arg);
+ }
+ fd = ruby_socket(socktype, SOCK_DGRAM, 0);
+ if (fd < 0) {
+ rb_sys_fail("socket(2) - udp");
+ }
+
+ return init_sock(sock, fd);
+}
+
+struct udp_arg
+{
+ struct addrinfo *res;
+ int fd;
+};
+
+static VALUE
+udp_connect_internal(arg)
+ struct udp_arg *arg;
+{
+ int fd = arg->fd;
+ struct addrinfo *res;
+
+ for (res = arg->res; res; res = res->ai_next) {
+ if (ruby_connect(fd, res->ai_addr, res->ai_addrlen, 0) >= 0) {
+ return Qtrue;
+ }
+ }
+ return Qfalse;
+}
+
+static VALUE
+udp_connect(sock, host, port)
+ VALUE sock, host, port;
+{
+ rb_io_t *fptr;
+ struct udp_arg arg;
+ VALUE ret;
+
+ rb_secure(3);
+ arg.res = sock_addrinfo(host, port, SOCK_DGRAM, 0);
+ GetOpenFile(sock, fptr);
+ arg.fd = fileno(fptr->f);
+ ret = rb_ensure(udp_connect_internal, (VALUE)&arg,
+ RUBY_METHOD_FUNC(freeaddrinfo), (VALUE)arg.res);
+ if (!ret) rb_sys_fail("connect(2)");
+ return INT2FIX(0);
+}
+
+static VALUE
+udp_bind(sock, host, port)
+ VALUE sock, host, port;
+{
+ rb_io_t *fptr;
+ struct addrinfo *res0, *res;
+
+ rb_secure(3);
+ res0 = sock_addrinfo(host, port, SOCK_DGRAM, 0);
+ GetOpenFile(sock, fptr);
+ for (res = res0; res; res = res->ai_next) {
+ if (bind(fileno(fptr->f), res->ai_addr, res->ai_addrlen) < 0) {
+ continue;
+ }
+ freeaddrinfo(res0);
+ return INT2FIX(0);
+ }
+ freeaddrinfo(res0);
+ rb_sys_fail("bind(2)");
+ return INT2FIX(0);
+}
+
+static VALUE
+udp_send(argc, argv, sock)
+ int argc;
+ VALUE *argv;
+ VALUE sock;
+{
+ VALUE mesg, flags, host, port;
+ rb_io_t *fptr;
+ FILE *f;
+ int n;
+ struct addrinfo *res0, *res;
+
+ if (argc == 2 || argc == 3) {
+ return bsock_send(argc, argv, sock);
+ }
+ rb_secure(4);
+ rb_scan_args(argc, argv, "4", &mesg, &flags, &host, &port);
+
+ StringValue(mesg);
+ res0 = sock_addrinfo(host, port, SOCK_DGRAM, 0);
+ GetOpenFile(sock, fptr);
+ f = GetWriteFile(fptr);
+ for (res = res0; res; res = res->ai_next) {
+ retry:
+ n = sendto(fileno(f), RSTRING(mesg)->ptr, RSTRING(mesg)->len, NUM2INT(flags),
+ res->ai_addr, res->ai_addrlen);
+ if (n >= 0) {
+ freeaddrinfo(res0);
+ return INT2FIX(n);
+ }
+ if (rb_io_wait_writable(fileno(f))) {
+ goto retry;
+ }
+ }
+ freeaddrinfo(res0);
+ rb_sys_fail("sendto(2)");
+ return INT2FIX(n);
+}
+
+/*
+ * 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.
+ * _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.
*
- * _domain_ should be a communications domain such as: :INET, :INET6, :UNIX, etc.
+ * 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
+ * IO.select([s2])
+ * p s2.recvfrom_nonblock(10) #=> ["aaa", ["AF_INET", 33302, "localhost.localdomain", "127.0.0.1"]]
*
- * _socktype_ should be a socket type such as: :STREAM, :DGRAM, :RAW, etc.
+ * Refer to Socket#recvfrom for the exceptions that may be thrown if the call
+ * to _recvfrom_nonblock_ fails.
*
- * _protocol_ should be a protocol defined in the domain.
- * 0 is default protocol for the domain.
+ * UDPSocket#recvfrom_nonblock may raise any error corresponding to recvfrom(2) failure,
+ * including Errno::EAGAIN.
*
- * s1, s2 = Socket.pair(:UNIX, :DGRAM, 0)
- * s1.send "a", 0
- * s1.send "b", 0
- * p s2.recv(10) #=> "a"
- * p s2.recv(10) #=> "b"
+ * === See
+ * * Socket#recvfrom
+ */
+static VALUE
+udp_recvfrom_nonblock(int argc, VALUE *argv, VALUE sock)
+{
+ return s_recvfrom_nonblock(sock, argc, argv, RECV_IP);
+}
+
+#ifdef HAVE_SYS_UN_H
+static VALUE
+unix_init(sock, path)
+ VALUE sock, path;
+{
+ return init_unixsock(sock, path, 0);
+}
+
+static char *
+unixpath(struct sockaddr_un *sockaddr, socklen_t len)
+{
+ if (sockaddr->sun_path < (char*)sockaddr + len)
+ return sockaddr->sun_path;
+ else
+ return "";
+}
+
+static VALUE
+unix_path(sock)
+ VALUE sock;
+{
+ rb_io_t *fptr;
+
+ GetOpenFile(sock, fptr);
+ if (fptr->path == 0) {
+ struct sockaddr_un addr;
+ socklen_t len = sizeof(addr);
+ if (getsockname(fileno(fptr->f), (struct sockaddr*)&addr, &len) < 0)
+ rb_sys_fail(0);
+ fptr->path = strdup(unixpath(&addr, len));
+ }
+ return rb_str_new2(fptr->path);
+}
+
+static VALUE
+unix_svr_init(sock, path)
+ VALUE sock, path;
+{
+ return init_unixsock(sock, path, 1);
+}
+
+static VALUE
+unix_recvfrom(argc, argv, sock)
+ int argc;
+ VALUE *argv;
+ VALUE sock;
+{
+ return s_recvfrom(sock, argc, argv, RECV_UNIX);
+}
+
+#if defined(HAVE_ST_MSG_CONTROL) && defined(SCM_RIGHTS)
+#define FD_PASSING_BY_MSG_CONTROL 1
+#else
+#define FD_PASSING_BY_MSG_CONTROL 0
+#endif
+
+#if defined(HAVE_ST_MSG_ACCRIGHTS)
+#define FD_PASSING_BY_MSG_ACCRIGHTS 1
+#else
+#define FD_PASSING_BY_MSG_ACCRIGHTS 0
+#endif
+
+static VALUE
+unix_send_io(sock, val)
+ VALUE sock, val;
+{
+#if defined(HAVE_SENDMSG) && (FD_PASSING_BY_MSG_CONTROL || FD_PASSING_BY_MSG_ACCRIGHTS)
+ int fd;
+ rb_io_t *fptr;
+ struct msghdr msg;
+ struct iovec vec[1];
+ char buf[1];
+
+#if FD_PASSING_BY_MSG_CONTROL
+ struct {
+ struct cmsghdr hdr;
+ char pad[8+sizeof(int)+8];
+ } cmsg;
+#endif
+
+ if (rb_obj_is_kind_of(val, rb_cIO)) {
+ rb_io_t *valfptr;
+ GetOpenFile(val, valfptr);
+ fd = fileno(valfptr->f);
+ }
+ else if (FIXNUM_P(val)) {
+ fd = FIX2INT(val);
+ }
+ else {
+ rb_raise(rb_eTypeError, "neither IO nor file descriptor");
+ }
+
+ GetOpenFile(sock, fptr);
+
+ msg.msg_name = NULL;
+ msg.msg_namelen = 0;
+
+ /* Linux and Solaris doesn't work if msg_iov is NULL. */
+ buf[0] = '\0';
+ vec[0].iov_base = buf;
+ vec[0].iov_len = 1;
+ msg.msg_iov = vec;
+ msg.msg_iovlen = 1;
+
+#if FD_PASSING_BY_MSG_CONTROL
+ msg.msg_control = (caddr_t)&cmsg;
+ msg.msg_controllen = CMSG_LEN(sizeof(int));
+ msg.msg_flags = 0;
+ MEMZERO((char*)&cmsg, char, sizeof(cmsg));
+ cmsg.hdr.cmsg_len = CMSG_LEN(sizeof(int));
+ cmsg.hdr.cmsg_level = SOL_SOCKET;
+ cmsg.hdr.cmsg_type = SCM_RIGHTS;
+ *(int *)CMSG_DATA(&cmsg.hdr) = fd;
+#else
+ msg.msg_accrights = (caddr_t)&fd;
+ msg.msg_accrightslen = sizeof(fd);
+#endif
+
+ if (sendmsg(fileno(fptr->f), &msg, 0) == -1)
+ rb_sys_fail("sendmsg(2)");
+
+ return Qnil;
+#else
+ rb_notimplement();
+ return Qnil; /* not reached */
+#endif
+}
+
+#if defined(HAVE_RECVMSG) && (FD_PASSING_BY_MSG_CONTROL || FD_PASSING_BY_MSG_ACCRIGHTS)
+static void
+thread_read_select(fd)
+ int fd;
+{
+ fd_set fds;
+
+ FD_ZERO(&fds);
+ FD_SET(fd, &fds);
+ rb_thread_select(fd+1, &fds, 0, 0, 0);
+}
+#endif
+
+static VALUE
+unix_recv_io(argc, argv, sock)
+ int argc;
+ VALUE *argv;
+ VALUE sock;
+{
+#if defined(HAVE_RECVMSG) && (FD_PASSING_BY_MSG_CONTROL || FD_PASSING_BY_MSG_ACCRIGHTS)
+ VALUE klass, mode;
+ rb_io_t *fptr;
+ struct msghdr msg;
+ struct iovec vec[2];
+ char buf[1];
+
+ int fd;
+#if FD_PASSING_BY_MSG_CONTROL
+ struct {
+ struct cmsghdr hdr;
+ char pad[8+sizeof(int)+8];
+ } cmsg;
+#endif
+
+ rb_scan_args(argc, argv, "02", &klass, &mode);
+ if (argc == 0)
+ klass = rb_cIO;
+ if (argc <= 1)
+ mode = Qnil;
+
+ GetOpenFile(sock, fptr);
+
+ thread_read_select(fileno(fptr->f));
+
+ msg.msg_name = NULL;
+ msg.msg_namelen = 0;
+
+ vec[0].iov_base = buf;
+ vec[0].iov_len = sizeof(buf);
+ msg.msg_iov = vec;
+ msg.msg_iovlen = 1;
+
+#if FD_PASSING_BY_MSG_CONTROL
+ msg.msg_control = (caddr_t)&cmsg;
+ msg.msg_controllen = CMSG_SPACE(sizeof(int));
+ msg.msg_flags = 0;
+ cmsg.hdr.cmsg_len = CMSG_LEN(sizeof(int));
+ cmsg.hdr.cmsg_level = SOL_SOCKET;
+ cmsg.hdr.cmsg_type = SCM_RIGHTS;
+ *(int *)CMSG_DATA(&cmsg.hdr) = -1;
+#else
+ msg.msg_accrights = (caddr_t)&fd;
+ msg.msg_accrightslen = sizeof(fd);
+ fd = -1;
+#endif
+
+ if (recvmsg(fileno(fptr->f), &msg, 0) == -1)
+ rb_sys_fail("recvmsg(2)");
+
+#if FD_PASSING_BY_MSG_CONTROL
+ if (msg.msg_controllen != CMSG_SPACE(sizeof(int))) {
+ rb_raise(rb_eSocket,
+ "file descriptor was not passed (msg_controllen=%d, %d expected)",
+ msg.msg_controllen, CMSG_SPACE(sizeof(int)));
+ }
+ if (cmsg.hdr.cmsg_len != CMSG_LEN(sizeof(int))) {
+ rb_raise(rb_eSocket,
+ "file descriptor was not passed (cmsg_len=%d, %d expected)",
+ cmsg.hdr.cmsg_len, CMSG_LEN(sizeof(int)));
+ }
+ if (cmsg.hdr.cmsg_level != SOL_SOCKET) {
+ rb_raise(rb_eSocket,
+ "file descriptor was not passed (cmsg_level=%d, %d expected)",
+ cmsg.hdr.cmsg_level, SOL_SOCKET);
+ }
+ if (cmsg.hdr.cmsg_type != SCM_RIGHTS) {
+ rb_raise(rb_eSocket,
+ "file descriptor was not passed (cmsg_type=%d, %d expected)",
+ cmsg.hdr.cmsg_type, SCM_RIGHTS);
+ }
+#else
+ if (msg.msg_accrightslen != sizeof(fd)) {
+ rb_raise(rb_eSocket,
+ "file descriptor was not passed (accrightslen) : %d != %d",
+ msg.msg_accrightslen, sizeof(fd));
+ }
+#endif
+
+#if FD_PASSING_BY_MSG_CONTROL
+ fd = *(int *)CMSG_DATA(&cmsg.hdr);
+#endif
+
+ if (klass == Qnil)
+ return INT2FIX(fd);
+ else {
+ static ID for_fd = 0;
+ int ff_argc;
+ VALUE ff_argv[2];
+ if (!for_fd)
+ for_fd = rb_intern("for_fd");
+ ff_argc = mode == Qnil ? 1 : 2;
+ ff_argv[0] = INT2FIX(fd);
+ ff_argv[1] = mode;
+ return rb_funcall2(klass, for_fd, ff_argc, ff_argv);
+ }
+#else
+ rb_notimplement();
+ return Qnil; /* not reached */
+#endif
+}
+
+static VALUE
+unix_accept(sock)
+ VALUE sock;
+{
+ rb_io_t *fptr;
+ struct sockaddr_un from;
+ socklen_t fromlen;
+
+ GetOpenFile(sock, fptr);
+ fromlen = sizeof(struct sockaddr_un);
+ return s_accept(rb_cUNIXSocket, fileno(fptr->f),
+ (struct sockaddr*)&from, &fromlen);
+}
+
+/*
+ * call-seq:
+ * unixserver.accept_nonblock => unixsocket
+ *
+ * Accepts an incoming connection using accept(2) after
+ * O_NONBLOCK is set for the underlying file descriptor.
+ * It returns an accepted UNIXSocket for the incoming connection.
+ *
+ * === Example
+ * require 'socket'
+ * serv = UNIXServer.new("/tmp/sock")
+ * begin
+ * sock = serv.accept_nonblock
+ * rescue Errno::EAGAIN, Errno::EWOULDBLOCK, Errno::ECONNABORTED, Errno::EPROTO, 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::EAGAIN.
+ *
+ * === See
+ * * UNIXServer#accept
+ * * Socket#accept
*/
-VALUE
-rsock_sock_s_socketpair(int argc, VALUE *argv, VALUE klass)
+static VALUE
+unix_accept_nonblock(sock)
+ VALUE sock;
{
- VALUE domain, type, protocol;
+ rb_io_t *fptr;
+ struct sockaddr_un from;
+ socklen_t fromlen;
+
+ GetOpenFile(sock, fptr);
+ fromlen = sizeof(from);
+ return s_accept_nonblock(rb_cUNIXSocket, fptr,
+ (struct sockaddr *)&from, &fromlen);
+}
+
+static VALUE
+unix_sysaccept(sock)
+ VALUE sock;
+{
+ rb_io_t *fptr;
+ struct sockaddr_un from;
+ socklen_t fromlen;
+
+ GetOpenFile(sock, fptr);
+ fromlen = sizeof(struct sockaddr_un);
+ return s_accept(0, fileno(fptr->f), (struct sockaddr*)&from, &fromlen);
+}
+
+static VALUE
+unixaddr(sockaddr, len)
+ struct sockaddr_un *sockaddr;
+ socklen_t len;
+{
+ return rb_assoc_new(rb_str_new2("AF_UNIX"),
+ rb_str_new2(unixpath(sockaddr, len)));
+}
+
+static VALUE
+unix_addr(sock)
+ VALUE sock;
+{
+ rb_io_t *fptr;
+ struct sockaddr_un addr;
+ socklen_t len = sizeof addr;
+
+ GetOpenFile(sock, fptr);
+
+ if (getsockname(fileno(fptr->f), (struct sockaddr*)&addr, &len) < 0)
+ rb_sys_fail("getsockname(2)");
+ return unixaddr(&addr, len);
+}
+
+static VALUE
+unix_peeraddr(sock)
+ VALUE sock;
+{
+ rb_io_t *fptr;
+ struct sockaddr_un addr;
+ socklen_t len = sizeof addr;
+
+ GetOpenFile(sock, fptr);
+
+ if (getpeername(fileno(fptr->f), (struct sockaddr*)&addr, &len) < 0)
+ rb_sys_fail("getpeername(2)");
+ return unixaddr(&addr, len);
+}
+#endif
+
+static void
+setup_domain_and_type(domain, dv, type, tv)
+ VALUE domain, type;
+ int *dv, *tv;
+{
+ VALUE tmp;
+ char *ptr;
+
+ tmp = rb_check_string_type(domain);
+ if (!NIL_P(tmp)) {
+ domain = tmp;
+ rb_check_safe_obj(domain);
+ ptr = RSTRING(domain)->ptr;
+ if (strcmp(ptr, "AF_INET") == 0)
+ *dv = AF_INET;
+#ifdef AF_UNIX
+ else if (strcmp(ptr, "AF_UNIX") == 0)
+ *dv = AF_UNIX;
+#endif
+#ifdef AF_ISO
+ else if (strcmp(ptr, "AF_ISO") == 0)
+ *dv = AF_ISO;
+#endif
+#ifdef AF_NS
+ else if (strcmp(ptr, "AF_NS") == 0)
+ *dv = AF_NS;
+#endif
+#ifdef AF_IMPLINK
+ else if (strcmp(ptr, "AF_IMPLINK") == 0)
+ *dv = AF_IMPLINK;
+#endif
+#ifdef PF_INET
+ else if (strcmp(ptr, "PF_INET") == 0)
+ *dv = PF_INET;
+#endif
+#ifdef PF_UNIX
+ else if (strcmp(ptr, "PF_UNIX") == 0)
+ *dv = PF_UNIX;
+#endif
+#ifdef PF_IMPLINK
+ else if (strcmp(ptr, "PF_IMPLINK") == 0)
+ *dv = PF_IMPLINK;
+ else if (strcmp(ptr, "AF_IMPLINK") == 0)
+ *dv = AF_IMPLINK;
+#endif
+#ifdef PF_AX25
+ else if (strcmp(ptr, "PF_AX25") == 0)
+ *dv = PF_AX25;
+#endif
+#ifdef PF_IPX
+ else if (strcmp(ptr, "PF_IPX") == 0)
+ *dv = PF_IPX;
+#endif
+ else
+ rb_raise(rb_eSocket, "unknown socket domain %s", ptr);
+ }
+ else {
+ *dv = NUM2INT(domain);
+ }
+ tmp = rb_check_string_type(type);
+ if (!NIL_P(tmp)) {
+ type = tmp;
+ rb_check_safe_obj(type);
+ ptr = RSTRING(type)->ptr;
+ if (strcmp(ptr, "SOCK_STREAM") == 0)
+ *tv = SOCK_STREAM;
+ else if (strcmp(ptr, "SOCK_DGRAM") == 0)
+ *tv = SOCK_DGRAM;
+#ifdef SOCK_RAW
+ else if (strcmp(ptr, "SOCK_RAW") == 0)
+ *tv = SOCK_RAW;
+#endif
+#ifdef SOCK_SEQPACKET
+ else if (strcmp(ptr, "SOCK_SEQPACKET") == 0)
+ *tv = SOCK_SEQPACKET;
+#endif
+#ifdef SOCK_RDM
+ else if (strcmp(ptr, "SOCK_RDM") == 0)
+ *tv = SOCK_RDM;
+#endif
+#ifdef SOCK_PACKET
+ else if (strcmp(ptr, "SOCK_PACKET") == 0)
+ *tv = SOCK_PACKET;
+#endif
+ else
+ rb_raise(rb_eSocket, "unknown socket type %s", ptr);
+ }
+ else {
+ *tv = NUM2INT(type);
+ }
+}
+
+static VALUE
+sock_initialize(sock, domain, type, protocol)
+ VALUE sock, domain, type, protocol;
+{
+ int fd;
+ int d, t;
+
+ rb_secure(3);
+ setup_domain_and_type(domain, &d, type, &t);
+ fd = ruby_socket(d, t, NUM2INT(protocol));
+ if (fd < 0) rb_sys_fail("socket(2)");
+
+ return init_sock(sock, fd);
+}
+
+static VALUE
+sock_s_socketpair(klass, domain, type, protocol)
+ VALUE klass, domain, type, protocol;
+{
+#if defined HAVE_SOCKETPAIR
int d, t, p, sp[2];
int ret;
- VALUE s1, s2, r;
-
- rb_scan_args(argc, argv, "21", &domain, &type, &protocol);
- if (NIL_P(protocol))
- protocol = INT2FIX(0);
setup_domain_and_type(domain, &d, type, &t);
p = NUM2INT(protocol);
@@ -120,16 +2384,31 @@ rsock_sock_s_socketpair(int argc, VALUE *argv, VALUE klass)
rb_sys_fail("socketpair(2)");
}
- s1 = rsock_init_sock(rb_obj_alloc(klass), sp[0]);
- s2 = rsock_init_sock(rb_obj_alloc(klass), sp[1]);
- r = rb_assoc_new(s1, s2);
- if (rb_block_given_p()) {
- return rb_ensure(pair_yield, r, io_close, s1);
- }
- return r;
-}
+ return rb_assoc_new(init_sock(rb_obj_alloc(klass), sp[0]),
+ init_sock(rb_obj_alloc(klass), sp[1]));
#else
-#define rsock_sock_s_socketpair rb_f_notimplement
+ rb_notimplement();
+#endif
+}
+
+#ifdef HAVE_SYS_UN_H
+static VALUE
+unix_s_socketpair(argc, argv, klass)
+ int argc;
+ VALUE *argv;
+ VALUE klass;
+{
+ VALUE domain, type, protocol;
+ domain = INT2FIX(PF_UNIX);
+
+ rb_scan_args(argc, argv, "02", &type, &protocol);
+ if (argc == 0)
+ type = INT2FIX(SOCK_STREAM);
+ if (argc <= 1)
+ protocol = INT2FIX(0);
+
+ return sock_s_socketpair(klass, domain, type, protocol);
+}
#endif
/*
@@ -244,21 +2523,21 @@ rsock_sock_s_socketpair(int argc, VALUE *argv, VALUE klass)
* * connect function in Microsoft's Winsock functions reference
*/
static VALUE
-sock_connect(VALUE sock, VALUE addr)
+sock_connect(sock, addr)
+ VALUE sock, addr;
{
rb_io_t *fptr;
- int fd, n;
+ int fd;
- SockAddrStringValue(addr);
+ StringValue(addr);
addr = rb_str_new4(addr);
GetOpenFile(sock, fptr);
- fd = fptr->fd;
- n = rsock_connect(fd, (struct sockaddr*)RSTRING_PTR(addr), RSTRING_LEN(addr), 0);
- if (n < 0) {
+ fd = fileno(fptr->f);
+ if (ruby_connect(fd, (struct sockaddr*)RSTRING(addr)->ptr, RSTRING(addr)->len, 0) < 0) {
rb_sys_fail("connect(2)");
}
- return INT2FIX(n);
+ return INT2FIX(0);
}
/*
@@ -278,12 +2557,12 @@ sock_connect(VALUE sock, VALUE addr)
* include Socket::Constants
* socket = Socket.new(AF_INET, SOCK_STREAM, 0)
* sockaddr = Socket.sockaddr_in(80, 'www.google.com')
- * begin # emulate blocking connect
+ * begin
* socket.connect_nonblock(sockaddr)
- * rescue IO::WaitWritable
- * IO.select(nil, [socket]) # wait 3-way handshake completion
+ * rescue Errno::EINPROGRESS
+ * IO.select(nil, [socket])
* begin
- * socket.connect_nonblock(sockaddr) # check connection failure
+ * socket.connect_nonblock(sockaddr)
* rescue Errno::EISCONN
* end
* end
@@ -296,27 +2575,22 @@ sock_connect(VALUE sock, VALUE addr)
* 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)
+sock_connect_nonblock(sock, addr)
+ VALUE sock, addr;
{
rb_io_t *fptr;
int n;
- SockAddrStringValue(addr);
+ StringValue(addr);
addr = rb_str_new4(addr);
GetOpenFile(sock, fptr);
rb_io_set_nonblock(fptr);
- n = connect(fptr->fd, (struct sockaddr*)RSTRING_PTR(addr), RSTRING_LEN(addr));
+ n = connect(fileno(fptr->f), (struct sockaddr*)RSTRING(addr)->ptr, RSTRING(addr)->len);
if (n < 0) {
- if (errno == EINPROGRESS)
- rb_mod_sys_fail(rb_mWaitWritable, "connect(2) would block");
rb_sys_fail("connect(2)");
}
@@ -403,13 +2677,14 @@ sock_connect_nonblock(VALUE sock, VALUE addr)
* * bind function in Microsoft's Winsock functions reference
*/
static VALUE
-sock_bind(VALUE sock, VALUE addr)
+sock_bind(sock, addr)
+ VALUE sock, addr;
{
rb_io_t *fptr;
- SockAddrStringValue(addr);
+ StringValue(addr);
GetOpenFile(sock, fptr);
- if (bind(fptr->fd, (struct sockaddr*)RSTRING_PTR(addr), RSTRING_LEN(addr)) < 0)
+ if (bind(fileno(fptr->f), (struct sockaddr*)RSTRING(addr)->ptr, RSTRING(addr)->len) < 0)
rb_sys_fail("bind(2)");
return INT2FIX(0);
@@ -486,7 +2761,8 @@ sock_bind(VALUE sock, VALUE addr)
* * listen function in Microsoft's Winsock functions reference
*/
static VALUE
-sock_listen(VALUE sock, VALUE log)
+sock_listen(sock, log)
+ VALUE sock, log;
{
rb_io_t *fptr;
int backlog;
@@ -494,7 +2770,7 @@ sock_listen(VALUE sock, VALUE log)
rb_secure(4);
backlog = NUM2INT(log);
GetOpenFile(sock, fptr);
- if (listen(fptr->fd, backlog) < 0)
+ if (listen(fileno(fptr->f), backlog) < 0)
rb_sys_fail("listen(2)");
return INT2FIX(0);
@@ -606,9 +2882,12 @@ sock_listen(VALUE sock, VALUE log)
* message.
*/
static VALUE
-sock_recvfrom(int argc, VALUE *argv, VALUE sock)
+sock_recvfrom(argc, argv, sock)
+ int argc;
+ VALUE *argv;
+ VALUE sock;
{
- return rsock_s_recvfrom(sock, argc, argv, RECV_SOCKET);
+ return s_recvfrom(sock, argc, argv, RECV_SOCKET);
}
/*
@@ -640,9 +2919,9 @@ sock_recvfrom(int argc, VALUE *argv, VALUE sock)
* socket.bind(sockaddr)
* socket.listen(5)
* client, client_sockaddr = socket.accept
- * begin # emulate blocking recvfrom
+ * begin
* pair = client.recvfrom_nonblock(20)
- * rescue IO::WaitReadable
+ * rescue Errno::EAGAIN, Errno::EWOULDBLOCK
* IO.select([client])
* retry
* end
@@ -664,11 +2943,7 @@ sock_recvfrom(int argc, VALUE *argv, VALUE sock)
* 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.
+ * including Errno::EAGAIN.
*
* === See
* * Socket#recvfrom
@@ -676,40 +2951,109 @@ sock_recvfrom(int argc, VALUE *argv, VALUE sock)
static VALUE
sock_recvfrom_nonblock(int argc, VALUE *argv, VALUE sock)
{
- return rsock_s_recvfrom_nonblock(sock, argc, argv, RECV_SOCKET);
+ return s_recvfrom_nonblock(sock, argc, argv, RECV_SOCKET);
}
/*
* call-seq:
- * socket.accept => [client_socket, client_addrinfo]
- *
- * Accepts a next connection.
- * Returns a new Socket object and Addrinfo object.
- *
- * serv = Socket.new(:INET, :STREAM, 0)
- * serv.listen(5)
- * c = Socket.new(:INET, :STREAM, 0)
- * c.connect(serv.local_address)
- * p serv.accept #=> [#<Socket:fd 6>, #<Addrinfo: 127.0.0.1:48555 TCP>]
- *
+ * socket.accept => [ socket, string ]
+ *
+ * Accepts an incoming connection returning an array containing a new
+ * Socket object and a string holding the +struct+ sockaddr information about
+ * the caller.
+ *
+ * === 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, client_sockaddr = socket.accept
+ * puts "The client said, '#{client.readline.chomp}'"
+ * client.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
+ *
+ * === Unix-based Exceptions
+ * On unix-based based systems the following system exceptions may be raised if the
+ * call to _accept_ fails:
+ * * Errno::EAGAIN - O_NONBLOCK is set for the +socket+ file descriptor and no
+ * connections are parent to be accepted
+ * * Errno::EWOULDBLOCK - same as Errno::EAGAIN
+ * * Errno::EBADF - the +socket+ is not a valid file descriptor
+ * * Errno::ECONNABORTED - a connection has been aborted
+ * * Errno::EFAULT - the socket's internal address or address length parameter
+ * cannot be access or written
+ * * Errno::EINTR - the _accept_ method was interrupted by a signal that was
+ * caught before a valid connection arrived
+ * * Errno::EINVAL - the +socket+ is not accepting connections
+ * * Errno::EMFILE - OPEN_MAX file descriptors are currently open in the calling
+ * process
+ * * Errno::ENOBUFS - no buffer space is available
+ * * Errno::ENOMEM - there was insufficient memory available to complete the
+ * operation
+ * * Errno::ENOSR - there was insufficient STREAMS resources available to
+ * complete the operation
+ * * Errno::ENFILE - the maximum number of file descriptors in the system are
+ * already open
+ * * Errno::ENOTSOCK - the +socket+ does not refer to a socket
+ * * Errno::EOPNOTSUPP - the socket type for the calling +socket+ does not
+ * support accept connections
+ * * Errno::EPROTO - a protocol error has occurred
+ *
+ * === Windows Exceptions
+ * On Windows systems the following system exceptions may be raised if
+ * the call to _accept_ fails:
+ * * Errno::ECONNRESET - an incoming connection was indicated, but was
+ * terminated by the remote peer prior to accepting the connection
+ * * Errno::EFAULT - the socket's internal address or address length parameter
+ * is too small or is not a valid part of the user space address
+ * * Errno::EINVAL - the _listen_ method was not invoked prior to calling _accept_
+ * * Errno::EINPROGRESS - a blocking Windows Sockets 1.1 call is in progress or
+ * the service provider is still processing a callback function
+ * * Errno::EMFILE - the queue is not empty, upong etry to _accept_ and there are
+ * no socket descriptors available
+ * * Errno::ENETDOWN - the network is down
+ * * Errno::ENOBUFS - no buffer space is available
+ * * Errno::ENOTSOCK - +socket+ is not a socket
+ * * Errno::EOPNOTSUPP - +socket+ is not a type that supports connection-oriented
+ * service.
+ * * Errno::EWOULDBLOCK - +socket+ is marked as nonblocking and no connections are
+ * present to be accepted
+ *
+ * === See
+ * * accept manual pages on unix-based systems
+ * * accept function in Microsoft's Winsock functions reference
*/
static VALUE
-sock_accept(VALUE sock)
+sock_accept(sock)
+ VALUE sock;
{
rb_io_t *fptr;
VALUE sock2;
- struct sockaddr_storage buf;
+ char buf[1024];
socklen_t len = sizeof buf;
GetOpenFile(sock, fptr);
- sock2 = rsock_s_accept(rb_cSocket,fptr->fd,(struct sockaddr*)&buf,&len);
+ sock2 = s_accept(rb_cSocket,fileno(fptr->f),(struct sockaddr*)buf,&len);
- return rb_assoc_new(sock2, rsock_io_socket_addrinfo(sock2, (struct sockaddr*)&buf, len));
+ return rb_assoc_new(sock2, rb_str_new(buf, len));
}
/*
* call-seq:
- * socket.accept_nonblock => [client_socket, client_sockaddr]
+ * socket.accept_nonblock => [client_socket, client_sockaddr]
*
* Accepts an incoming connection using accept(2) after
* O_NONBLOCK is set for the underlying file descriptor.
@@ -726,16 +3070,16 @@ sock_accept(VALUE sock)
* sockaddr = Socket.sockaddr_in(2200, 'localhost')
* socket.bind(sockaddr)
* socket.listen(5)
- * begin # emulate blocking accept
+ * begin
* client_socket, client_sockaddr = socket.accept_nonblock
- * rescue IO::WaitReadable, Errno::EINTR
+ * rescue Errno::EAGAIN, Errno::EWOULDBLOCK, Errno::ECONNABORTED, Errno::EPROTO, 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
@@ -750,26 +3094,23 @@ sock_accept(VALUE sock)
* 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.
+ * including Errno::EAGAIN.
*
* === See
* * Socket#accept
*/
static VALUE
-sock_accept_nonblock(VALUE sock)
+sock_accept_nonblock(sock)
+ VALUE sock;
{
rb_io_t *fptr;
VALUE sock2;
- struct sockaddr_storage buf;
+ char buf[1024];
socklen_t len = sizeof buf;
GetOpenFile(sock, fptr);
- sock2 = rsock_s_accept_nonblock(rb_cSocket, fptr, (struct sockaddr *)&buf, &len);
- return rb_assoc_new(sock2, rsock_io_socket_addrinfo(sock2, (struct sockaddr*)&buf, len));
+ sock2 = s_accept_nonblock(rb_cSocket, fptr, (struct sockaddr *)buf, &len);
+ return rb_assoc_new(sock2, rb_str_new(buf, len));
}
/*
@@ -812,38 +3153,26 @@ sock_accept_nonblock(VALUE sock)
* * Socket#accept
*/
static VALUE
-sock_sysaccept(VALUE sock)
+sock_sysaccept(sock)
+ VALUE sock;
{
rb_io_t *fptr;
VALUE sock2;
- struct sockaddr_storage buf;
+ char buf[1024];
socklen_t len = sizeof buf;
GetOpenFile(sock, fptr);
- sock2 = rsock_s_accept(0,fptr->fd,(struct sockaddr*)&buf,&len);
+ sock2 = s_accept(0,fileno(fptr->f),(struct sockaddr*)buf,&len);
- return rb_assoc_new(sock2, rsock_io_socket_addrinfo(sock2, (struct sockaddr*)&buf, len));
+ return rb_assoc_new(sock2, rb_str_new(buf, len));
}
#ifdef HAVE_GETHOSTNAME
-/*
- * call-seq:
- * Socket.gethostname => hostname
- *
- * Returns the hostname.
- *
- * Note that it is not guaranteed to be able to convert to IP address using gethostbyname, getaddrinfo, etc.
- *
- * p Socket.gethostname #=> "hal"
- *
- */
static VALUE
-sock_gethostname(VALUE obj)
+sock_gethostname(obj)
+ VALUE obj;
{
-#ifndef HOST_NAME_MAX
-# define HOST_NAME_MAX 1024
-#endif
- char buf[HOST_NAME_MAX+1];
+ char buf[1024];
rb_secure(3);
if (gethostname(buf, (int)sizeof buf - 1) < 0)
@@ -858,7 +3187,8 @@ sock_gethostname(VALUE obj)
#include <sys/utsname.h>
static VALUE
-sock_gethostname(VALUE obj)
+sock_gethostname(obj)
+ VALUE obj;
{
struct utsname un;
@@ -867,12 +3197,18 @@ sock_gethostname(VALUE obj)
return rb_str_new2(un.nodename);
}
#else
-#define sock_gethostname rb_f_notimplement
+static VALUE
+sock_gethostname(obj)
+ VALUE obj;
+{
+ rb_notimplement();
+}
#endif
#endif
static VALUE
-make_addrinfo(struct addrinfo *res0)
+make_addrinfo(res0)
+ struct addrinfo *res0;
{
VALUE base, ary;
struct addrinfo *res;
@@ -882,10 +3218,7 @@ make_addrinfo(struct addrinfo *res0)
}
base = rb_ary_new();
for (res = res0; res; res = res->ai_next) {
- ary = rsock_ipaddr(res->ai_addr, rsock_do_not_reverse_lookup);
- if (res->ai_canonname) {
- RARRAY_PTR(ary)[2] = rb_str_new2(res->ai_canonname);
- }
+ ary = ipaddr(res->ai_addr);
rb_ary_push(ary, INT2FIX(res->ai_family));
rb_ary_push(ary, INT2FIX(res->ai_socktype));
rb_ary_push(ary, INT2FIX(res->ai_protocol));
@@ -894,8 +3227,11 @@ make_addrinfo(struct addrinfo *res0)
return base;
}
-static VALUE
-sock_sockaddr(struct sockaddr *addr, size_t len)
+/* Returns a String containing the binary value of a struct sockaddr. */
+VALUE
+sock_sockaddr(addr, len)
+ struct sockaddr *addr;
+ size_t len;
{
char *ptr;
@@ -918,51 +3254,132 @@ sock_sockaddr(struct sockaddr *addr, size_t len)
}
/*
- * call-seq:
- * Socket.gethostbyname(hostname) => [official_hostname, alias_hostnames, address_family, *address_list]
+ * Document-class: IPSocket
*
- * Obtains the host information for _hostname_.
+ * IPSocket is the parent of TCPSocket and UDPSocket and implements
+ * functionality common to them.
*
- * p Socket.gethostbyname("hal") #=> ["localhost", ["hal"], 2, "\x7F\x00\x00\x01"]
+ * A number of APIs in IPSocket, Socket, and their descendants return an
+ * address as an array. The members of that array are:
+ * - address family: A string like "AF_INET" or "AF_INET6" if it is one of the
+ * commonly used families, the string "unknown:#" (where `#' is the address
+ * family number) if it is not one of the common ones. The strings map to
+ * the Socket::AF_* constants.
+ * - port: The port number.
+ * - name: Either the canonical name from looking the address up in the DNS, or
+ * the address in presentation format
+ * - address: The address in presentation format (a dotted decimal string for
+ * IPv4, a hex string for IPv6).
*
+ * The address and port can be used directly to create sockets and to bind or
+ * connect them to the address.
*/
-static VALUE
-sock_s_gethostbyname(VALUE obj, VALUE host)
-{
- rb_secure(3);
- return rsock_make_hostent(host, rsock_addrinfo(host, Qnil, SOCK_STREAM, AI_CANONNAME), sock_sockaddr);
-}
/*
- * call-seq:
- * Socket.gethostbyaddr(address_string [, address_family]) => hostent
+ * Document-class: Socket
+ *
+ * Socket contains a number of generally useful singleton methods and
+ * constants, as well as offering low-level interfaces that can be used to
+ * develop socket applications using protocols other than TCP, UDP, and UNIX
+ * domain sockets.
+ */
+
+/*
+ * Document-method: gethostbyname
+ * call-seq: Socket.gethostbyname(host) => hostent
+ *
+ * Resolve +host+ and return name and address information for it, similarly to
+ * gethostbyname(3). +host+ can be a domain name or the presentation format of
+ * an address.
+ *
+ * Returns an array of information similar to that found in a +struct hostent+:
+ * - cannonical name: the cannonical name for host in the DNS, or a
+ * string representing the address
+ * - aliases: an array of aliases for the canonical name, there may be no aliases
+ * - address family: usually one of Socket::AF_INET or Socket::AF_INET6
+ * - address: a string, the binary value of the +struct sockaddr+ for this name, in
+ * the indicated address family
+ * - ...: if there are multiple addresses for this host, a series of
+ * strings/+struct sockaddr+s may follow, not all necessarily in the same
+ * address family. Note that the fact that they may not be all in the same
+ * address family is a departure from the behaviour of gethostbyname(3).
+ *
+ * Note: I believe that the fact that the multiple addresses returned are not
+ * necessarily in the same address family may be a bug, since if this function
+ * actually called gethostbyname(3), ALL the addresses returned in the trailing
+ * address list (h_addr_list from struct hostent) would be of the same address
+ * family! Examples from my system, OS X 10.3:
+ *
+ * ["localhost", [], 30, "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001", "\177\000\000\001"]
+ * and
+ * ["ensemble.local", [], 30, "\376\200\000\004\000\000\000\000\002\003\223\377\376\255\010\214", "\300\250{\232" ]
+ *
+ * Similar information can be returned by Socket.getaddrinfo if called as:
*
- * Obtains the host information for _address_.
+ * Socket.getaddrinfo(+host+, 0, Socket::AF_UNSPEC, Socket::SOCK_STREAM, nil, Socket::AI_CANONNAME)
*
- * p Socket.gethostbyaddr([221,186,184,68].pack("CCCC"))
- * #=> ["carbon.ruby-lang.org", [], 2, "\xDD\xBA\xB8D"]
+ * == Examples
+ *
+ * Socket.gethostbyname "example.com"
+ * => ["example.com", [], 2, "\300\000\"\246"]
+ *
+ * This name has no DNS aliases, and a single IPv4 address.
+ *
+ * Socket.gethostbyname "smtp.telus.net"
+ * => ["smtp.svc.telus.net", ["smtp.telus.net"], 2, "\307\271\334\371"]
+ *
+ * This name is an an alias so the canonical name is returned, as well as the
+ * alias and a single IPv4 address.
+ *
+ * Socket.gethostbyname "localhost"
+ * => ["localhost", [], 30, "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001", "\177\000\000\001"]
+ *
+ * This machine has no aliases, returns an IPv6 address, and has an additional IPv4 address.
+ *
+ * +host+ can also be an IP address in presentation format, in which case a
+ * reverse lookup is done on the address:
+ *
+ * Socket.gethostbyname("127.0.0.1")
+ * => ["localhost", [], 2, "\177\000\000\001"]
+ *
+ * Socket.gethostbyname("192.0.34.166")
+ * => ["www.example.com", [], 2, "\300\000\"\246"]
+ *
+ *
+ * == See
+ * See: Socket.getaddrinfo
*/
static VALUE
-sock_s_gethostbyaddr(int argc, VALUE *argv)
+sock_s_gethostbyname(obj, host)
+ VALUE obj, host;
{
- VALUE addr, family;
+ rb_secure(3);
+ return make_hostent(host, sock_addrinfo(host, Qnil, SOCK_STREAM, AI_CANONNAME), sock_sockaddr);
+}
+
+static VALUE
+sock_s_gethostbyaddr(argc, argv)
+ int argc;
+ VALUE *argv;
+{
+ VALUE addr, type;
struct hostent *h;
struct sockaddr *sa;
char **pch;
VALUE ary, names;
int t = AF_INET;
- rb_scan_args(argc, argv, "11", &addr, &family);
+ rb_scan_args(argc, argv, "11", &addr, &type);
sa = (struct sockaddr*)StringValuePtr(addr);
- if (!NIL_P(family)) {
- t = rsock_family_arg(family);
+ if (!NIL_P(type)) {
+ t = NUM2INT(type);
}
#ifdef INET6
- else if (RSTRING_LEN(addr) == 16) {
+ else if (RSTRING(addr)->len == 16) {
t = AF_INET6;
}
#endif
- h = gethostbyaddr(RSTRING_PTR(addr), RSTRING_LEN(addr), t);
+ h = gethostbyaddr(RSTRING(addr)->ptr, RSTRING(addr)->len, t);
if (h == NULL) {
#ifdef HAVE_HSTRERROR
extern int h_errno;
@@ -993,119 +3410,215 @@ sock_s_gethostbyaddr(int argc, VALUE *argv)
}
/*
- * call-seq:
- * Socket.getservbyname(service_name) => port_number
- * Socket.getservbyname(service_name, protocol_name) => port_number
- *
- * Obtains the port number for _service_name_.
+ * Document-method: getservbyname
+ * call-seq: Socket.getservbyname(name, proto="tcp") => port
*
- * If _protocol_name_ is not given, "tcp" is assumed.
+ * +name+ is a service name ("ftp", "telnet", ...) and proto is a protocol name
+ * ("udp", "tcp", ...). '/etc/services' (or your system's equivalent) is
+ * searched for a service for +name+ and +proto+, and the port number is
+ * returned.
*
- * Socket.getservbyname("smtp") #=> 25
- * Socket.getservbyname("shell") #=> 514
- * Socket.getservbyname("syslog", "udp") #=> 514
- */
+ * Note that unlike Socket.getaddrinfo, +proto+ may not be specified using the
+ * Socket::SOCK_* constants, a string must must be used.
+ */
static VALUE
-sock_s_getservbyname(int argc, VALUE *argv)
+sock_s_getservbyaname(argc, argv)
+ int argc;
+ VALUE *argv;
{
VALUE service, proto;
struct servent *sp;
int port;
- const char *servicename, *protoname = "tcp";
rb_scan_args(argc, argv, "11", &service, &proto);
+ if (NIL_P(proto)) proto = rb_str_new2("tcp");
StringValue(service);
- if (!NIL_P(proto)) StringValue(proto);
- servicename = StringValueCStr(service);
- if (!NIL_P(proto)) protoname = StringValueCStr(proto);
- sp = getservbyname(servicename, protoname);
+ StringValue(proto);
+
+ sp = getservbyname(StringValueCStr(service), StringValueCStr(proto));
if (sp) {
port = ntohs(sp->s_port);
}
else {
+ char *s = RSTRING(service)->ptr;
char *end;
- port = STRTOUL(servicename, &end, 0);
+ port = strtoul(s, &end, 0);
if (*end != '\0') {
- rb_raise(rb_eSocket, "no such service %s/%s", servicename, protoname);
+ rb_raise(rb_eSocket, "no such service %s/%s", s, RSTRING(proto)->ptr);
}
}
return INT2FIX(port);
}
/*
- * call-seq:
- * Socket.getservbyport(port [, protocol_name]) => service
- *
- * Obtains the port number for _port_.
- *
- * If _protocol_name_ is not given, "tcp" is assumed.
- *
- * Socket.getservbyport(80) #=> "www"
- * Socket.getservbyport(514, "tcp") #=> "shell"
- * Socket.getservbyport(514, "udp") #=> "syslog"
- *
- */
-static VALUE
-sock_s_getservbyport(int argc, VALUE *argv)
-{
- VALUE port, proto;
- struct servent *sp;
- long portnum;
- const char *protoname = "tcp";
+Documentation should explain the following:
- rb_scan_args(argc, argv, "11", &port, &proto);
- portnum = NUM2LONG(port);
- if (portnum != (uint16_t)portnum) {
- const char *s = portnum > 0 ? "big" : "small";
- rb_raise(rb_eRangeError, "integer %ld too %s to convert into `int16_t'", portnum, s);
- }
- if (!NIL_P(proto)) protoname = StringValueCStr(proto);
+ $ pp Socket.getaddrinfo("", 1, Socket::AF_UNSPEC, Socket::SOCK_STREAM, 0, Socket::AI_PASSIVE)
+ [["AF_INET", 1, "0.0.0.0", "0.0.0.0", 2, 1, 6]]
- sp = getservbyport((int)htons((uint16_t)portnum), protoname);
- if (!sp) {
- rb_raise(rb_eSocket, "no such service for port %d/%s", (int)portnum, protoname);
- }
- return rb_tainted_str_new2(sp->s_name);
-}
+ $ pp Socket.getaddrinfo(nil, 1, Socket::AF_UNSPEC, Socket::SOCK_STREAM, 0, Socket::AI_PASSIVE)
+ [["AF_INET6", 1, "::", "::", 30, 1, 6],
+ ["AF_INET", 1, "0.0.0.0", "0.0.0.0", 2, 1, 6]]
+
+ $ pp Socket.getaddrinfo("localhost", 1, Socket::AF_UNSPEC, Socket::SOCK_STREAM, 0, Socket::AI_PASSIVE)
+ [["AF_INET6", 1, "localhost", "::1", 30, 1, 6],
+ ["AF_INET", 1, "localhost", "127.0.0.1", 2, 1, 6]]
+
+ $ pp Socket.getaddrinfo("ensemble.local.", 1, Socket::AF_UNSPEC, Socket::SOCK_STREAM, 0, Socket::AI_PASSIVE)
+ [["AF_INET", 1, "localhost", "192.168.123.154", 2, 1, 6]]
+
+Does it?
+
+API suggestion: this method has too many arguments, it would be backwards compatible and easier
+to understand if limit args were accepted as :family=>..., :flags=>...
+*/
/*
- * call-seq:
- * Socket.getaddrinfo(nodename, servname[, family[, socktype[, protocol[, flags]]]]) => array
+ * Document-method: getaddrinfo
+ * call-seq: Socket.getaddrinfo(host, service, family=nil, socktype=nil, protocol=nil, flags=nil) => addrinfo
+ *
+ * Return address information for +host+ and +port+. The remaining arguments
+ * are hints that limit the address information returned.
+ *
+ * This method corresponds closely to the POSIX.1g getaddrinfo() definition.
+ *
+ * === Parameters
+ * - +host+ is a host name or an address string (dotted decimal for IPv4, or a hex string
+ * for IPv6) for which to return information. A nil is also allowed, its meaning
+ * depends on +flags+, see below.
+ * - +service+ is a service name ("http", "ssh", ...), or
+ * a port number (80, 22, ...), see Socket.getservbyname for more
+ * information. A nil is also allowed, meaning zero.
+ * - +family+ limits the output to a specific address family, one of the
+ * Socket::AF_* constants. Socket::AF_INET (IPv4) and Socket::AF_INET6 (IPv6)
+ * are the most commonly used families. You will usually pass either nil or
+ * Socket::AF_UNSPEC, allowing the IPv6 information to be returned first if
+ * +host+ is reachable via IPv6, and IPv4 information otherwise. The two
+ * strings "AF_INET" or "AF_INET6" are also allowed, they are converted to
+ * their respective Socket::AF_* constants.
+ * - +socktype+ limits the output to a specific type of socket, one of the
+ * Socket::SOCK_* constants. Socket::SOCK_STREAM (for TCP) and
+ * Socket::SOCK_DGRAM (for UDP) are the most commonly used socket types. If
+ * nil, then information for all types of sockets supported by +service+ will
+ * be returned. You will usually know what type of socket you intend to
+ * create, and should pass that socket type in.
+ * - +protocol+ limits the output to a specific protocol numpber, one of the
+ * Socket::IPPROTO_* constants. It is usually implied by the socket type
+ * (Socket::SOCK_STREAM => Socket::IPPROTO_TCP, ...), if you pass other than
+ * nil you already know what this is for.
+ * - +flags+ is one of the Socket::AI_* constants. They mean:
+ * - Socket::AI_PASSIVE: when set, if +host+ is nil the 'any' address will be
+ * returned, Socket::INADDR_ANY or 0 for IPv4, "0::0" or "::" for IPv6. This
+ * address is suitable for use by servers that will bind their socket and do
+ * a passive listen, thus the name of the flag. Otherwise the local or
+ * loopback address will be returned, this is "127.0.0.1" for IPv4 and "::1'
+ * for IPv6.
+ * - ...
*
- * Obtains address information for _nodename_:_servname_.
*
- * _family_ should be an address family such as: :INET, :INET6, :UNIX, etc.
+ * === Returns
*
- * _socktype_ should be a socket type such as: :STREAM, :DGRAM, :RAW, etc.
+ * Returns an array of arrays, where each subarray contains:
+ * - address family, a string like "AF_INET" or "AF_INET6"
+ * - port number, the port number for +service+
+ * - host name, either a canonical name for +host+, or it's address in presentation
+ * format if the address could not be looked up.
+ * - host IP, the address of +host+ in presentation format
+ * - address family, as a numeric value (one of the Socket::AF_* constants).
+ * - socket type, as a numeric value (one of the Socket::SOCK_* constants).
+ * - protocol number, as a numeric value (one of the Socket::IPPROTO_* constants).
*
- * _protocol_ should be a protocol defined in the family.
- * 0 is default protocol for the family.
+ * The first four values are identical to what is commonly returned as an
+ * address array, see IPSocket for more information.
*
- * _flags_ should be bitwise OR of Socket::AI_* constants.
+ * === Examples
*
- * Socket.getaddrinfo("www.ruby-lang.org", "http", nil, :STREAM)
- * #=> [["AF_INET", 80, "carbon.ruby-lang.org", "221.186.184.68", 2, 1, 6]] # PF_INET/SOCK_STREAM/IPPROTO_TCP
+ * Not all input combinations are valid, and while there are many combinations,
+ * only a few cases are common.
*
- * Socket.getaddrinfo("localhost", nil)
- * #=> [["AF_INET", 0, "localhost", "127.0.0.1", 2, 1, 6], # PF_INET/SOCK_STREAM/IPPROTO_TCP
- * # ["AF_INET", 0, "localhost", "127.0.0.1", 2, 2, 17], # PF_INET/SOCK_DGRAM/IPPROTO_UDP
- * # ["AF_INET", 0, "localhost", "127.0.0.1", 2, 3, 0]] # PF_INET/SOCK_RAW/IPPROTO_IP
+ * A typical client will call getaddrinfo with the +host+ and +service+ it
+ * wants to connect to. It knows that it will attempt to connect with either
+ * TCP or UDP, and specifies +socktype+ accordingly. It loops through all
+ * returned addresses, and try to connect to them in turn:
*
+ * addrinfo = Socket::getaddrinfo('www.example.com', 'www', nil, Socket::SOCK_STREAM)
+ * addrinfo.each do |af, port, name, addr|
+ * begin
+ * sock = TCPSocket.new(addr, port)
+ * # ...
+ * exit 1
+ * rescue
+ * end
+ * end
+ *
+ * With UDP you don't know if connect suceeded, but if communication fails,
+ * the next address can be tried.
+ *
+ * A typical server will call getaddrinfo with a +host+ of nil, the +service+
+ * it listens to, and a +flags+ of Socket::AI_PASSIVE. It will listen for
+ * connections on the first returned address:
+ * addrinfo = Socket::getaddrinfo(nil, 'www', nil, Socket::SOCK_STREAM, nil, Socket::AI_PASSIVE)
+ * af, port, name, addr = addrinfo.first
+ * sock = TCPServer(addr, port)
+ * while( client = s.accept )
+ * # ...
+ * end
*/
static VALUE
-sock_s_getaddrinfo(int argc, VALUE *argv)
+sock_s_getaddrinfo(argc, argv)
+ int argc;
+ VALUE *argv;
{
VALUE host, port, family, socktype, protocol, flags, ret;
+ char hbuf[1024], pbuf[1024];
+ char *hptr, *pptr, *ap;
struct addrinfo hints, *res;
+ int error;
+ host = port = family = socktype = protocol = flags = Qnil;
rb_scan_args(argc, argv, "24", &host, &port, &family, &socktype, &protocol, &flags);
+ if (NIL_P(host)) {
+ hptr = NULL;
+ }
+ else {
+ strncpy(hbuf, StringValuePtr(host), sizeof(hbuf));
+ hbuf[sizeof(hbuf) - 1] = '\0';
+ hptr = hbuf;
+ }
+ if (NIL_P(port)) {
+ pptr = NULL;
+ }
+ else if (FIXNUM_P(port)) {
+ snprintf(pbuf, sizeof(pbuf), "%ld", FIX2LONG(port));
+ pptr = pbuf;
+ }
+ else {
+ strncpy(pbuf, StringValuePtr(port), sizeof(pbuf));
+ pbuf[sizeof(pbuf) - 1] = '\0';
+ pptr = pbuf;
+ }
MEMZERO(&hints, struct addrinfo, 1);
- hints.ai_family = NIL_P(family) ? PF_UNSPEC : rsock_family_arg(family);
+ if (NIL_P(family)) {
+ hints.ai_family = PF_UNSPEC;
+ }
+ else if (FIXNUM_P(family)) {
+ hints.ai_family = FIX2INT(family);
+ }
+ else if ((ap = StringValuePtr(family)) != 0) {
+ if (strcmp(ap, "AF_INET") == 0) {
+ hints.ai_family = PF_INET;
+ }
+#ifdef INET6
+ else if (strcmp(ap, "AF_INET6") == 0) {
+ hints.ai_family = PF_INET6;
+ }
+#endif
+ }
if (!NIL_P(socktype)) {
- hints.ai_socktype = rsock_socktype_arg(socktype);
+ hints.ai_socktype = NUM2INT(socktype);
}
if (!NIL_P(protocol)) {
hints.ai_protocol = NUM2INT(protocol);
@@ -1113,34 +3626,20 @@ sock_s_getaddrinfo(int argc, VALUE *argv)
if (!NIL_P(flags)) {
hints.ai_flags = NUM2INT(flags);
}
- res = rsock_getaddrinfo(host, port, &hints, 0);
+ error = getaddrinfo(hptr, pptr, &hints, &res);
+ if (error) {
+ rb_raise(rb_eSocket, "getaddrinfo: %s", gai_strerror(error));
+ }
ret = make_addrinfo(res);
freeaddrinfo(res);
return ret;
}
-/*
- * call-seq:
- * Socket.getnameinfo(sockaddr [, flags]) => [hostname, servicename]
- *
- * Obtains name information for _sockaddr_.
- *
- * _sockaddr_ should be one of follows.
- * - packed sockddr string such as Socket.sockaddr_in(80, "127.0.0.1")
- * - 3-elements array such as ["AF_INET", 80, "127.0.0.1"]
- * - 4-elements array such as ["AF_INET", 80, ignored, "127.0.0.1"]
- *
- * _flags_ should be bitwise OR of Socket::NI_* constants.
- *
- * Note that the last form is compatible with IPSocket#{addr,peeraddr}.
- *
- * Socket.getnameinfo(Socket.sockaddr_in(80, "127.0.0.1")) #=> ["localhost", "www"]
- * Socket.getnameinfo(["AF_INET", 80, "127.0.0.1"]) #=> ["localhost", "www"]
- * Socket.getnameinfo(["AF_INET", 80, "localhost", "127.0.0.1"]) #=> ["localhost", "www"]
- */
static VALUE
-sock_s_getnameinfo(int argc, VALUE *argv)
+sock_s_getnameinfo(argc, argv)
+ int argc;
+ VALUE *argv;
{
VALUE sa, af = Qnil, host = Qnil, port = Qnil, flags, tmp;
char *hptr, *pptr;
@@ -1150,6 +3649,7 @@ sock_s_getnameinfo(int argc, VALUE *argv)
int error;
struct sockaddr_storage ss;
struct sockaddr *sap;
+ char *ap;
sa = flags = Qnil;
rb_scan_args(argc, argv, "11", &sa, &flags);
@@ -1158,14 +3658,14 @@ sock_s_getnameinfo(int argc, VALUE *argv)
if (!NIL_P(flags)) {
fl = NUM2INT(flags);
}
- tmp = rb_check_sockaddr_string_type(sa);
+ tmp = rb_check_string_type(sa);
if (!NIL_P(tmp)) {
sa = tmp;
- if (sizeof(ss) < (size_t)RSTRING_LEN(sa)) {
+ if (sizeof(ss) < RSTRING(sa)->len) {
rb_raise(rb_eTypeError, "sockaddr length too big");
}
- memcpy(&ss, RSTRING_PTR(sa), RSTRING_LEN(sa));
- if ((size_t)RSTRING_LEN(sa) != SS_LEN(&ss)) {
+ memcpy(&ss, RSTRING(sa)->ptr, RSTRING(sa)->len);
+ if (RSTRING(sa)->len != SA_LEN((struct sockaddr*)&ss)) {
rb_raise(rb_eTypeError, "sockaddr size differs - should not happen");
}
sap = (struct sockaddr*)&ss;
@@ -1175,22 +3675,22 @@ sock_s_getnameinfo(int argc, VALUE *argv)
if (!NIL_P(tmp)) {
sa = tmp;
MEMZERO(&hints, struct addrinfo, 1);
- if (RARRAY_LEN(sa) == 3) {
- af = RARRAY_PTR(sa)[0];
- port = RARRAY_PTR(sa)[1];
- host = RARRAY_PTR(sa)[2];
+ if (RARRAY(sa)->len == 3) {
+ af = RARRAY(sa)->ptr[0];
+ port = RARRAY(sa)->ptr[1];
+ host = RARRAY(sa)->ptr[2];
}
- else if (RARRAY_LEN(sa) >= 4) {
- af = RARRAY_PTR(sa)[0];
- port = RARRAY_PTR(sa)[1];
- host = RARRAY_PTR(sa)[3];
+ else if (RARRAY(sa)->len >= 4) {
+ af = RARRAY(sa)->ptr[0];
+ port = RARRAY(sa)->ptr[1];
+ host = RARRAY(sa)->ptr[3];
if (NIL_P(host)) {
- host = RARRAY_PTR(sa)[2];
+ host = RARRAY(sa)->ptr[2];
}
else {
/*
* 4th element holds numeric form, don't resolve.
- * see rsock_ipaddr().
+ * see ipaddr().
*/
#ifdef AI_NUMERICHOST /* AIX 4.3.3 doesn't have AI_NUMERICHOST. */
hints.ai_flags |= AI_NUMERICHOST;
@@ -1199,7 +3699,7 @@ sock_s_getnameinfo(int argc, VALUE *argv)
}
else {
rb_raise(rb_eArgError, "array size should be 3 or 4, %ld given",
- RARRAY_LEN(sa));
+ RARRAY(sa)->len);
}
/* host */
if (NIL_P(host)) {
@@ -1226,8 +3726,23 @@ sock_s_getnameinfo(int argc, VALUE *argv)
}
hints.ai_socktype = (fl & NI_DGRAM) ? SOCK_DGRAM : SOCK_STREAM;
/* af */
- hints.ai_family = NIL_P(af) ? PF_UNSPEC : rsock_family_arg(af);
- error = rb_getaddrinfo(hptr, pptr, &hints, &res);
+ if (NIL_P(af)) {
+ hints.ai_family = PF_UNSPEC;
+ }
+ else if (FIXNUM_P(af)) {
+ hints.ai_family = FIX2INT(af);
+ }
+ else if ((ap = StringValuePtr(af)) != 0) {
+ if (strcmp(ap, "AF_INET") == 0) {
+ hints.ai_family = PF_INET;
+ }
+#ifdef INET6
+ else if (strcmp(ap, "AF_INET6") == 0) {
+ hints.ai_family = PF_INET6;
+ }
+#endif
+ }
+ error = getaddrinfo(hptr, pptr, &hints, &res);
if (error) goto error_exit_addr;
sap = res->ai_addr;
}
@@ -1236,16 +3751,16 @@ sock_s_getnameinfo(int argc, VALUE *argv)
}
call_nameinfo:
- error = rb_getnameinfo(sap, SA_LEN(sap), hbuf, sizeof(hbuf),
- pbuf, sizeof(pbuf), fl);
+ error = getnameinfo(sap, SA_LEN(sap), hbuf, sizeof(hbuf),
+ pbuf, sizeof(pbuf), fl);
if (error) goto error_exit_name;
if (res) {
for (r = res->ai_next; r; r = r->ai_next) {
char hbuf2[1024], pbuf2[1024];
sap = r->ai_addr;
- error = rb_getnameinfo(sap, SA_LEN(sap), hbuf2, sizeof(hbuf2),
- pbuf2, sizeof(pbuf2), fl);
+ error = getnameinfo(sap, SA_LEN(sap), hbuf2, sizeof(hbuf2),
+ pbuf2, sizeof(pbuf2), fl);
if (error) goto error_exit_name;
if (strcmp(hbuf, hbuf2) != 0|| strcmp(pbuf, pbuf2) != 0) {
freeaddrinfo(res);
@@ -1258,31 +3773,18 @@ sock_s_getnameinfo(int argc, VALUE *argv)
error_exit_addr:
if (res) freeaddrinfo(res);
- rsock_raise_socket_error("getaddrinfo", error);
+ rb_raise(rb_eSocket, "getaddrinfo: %s", gai_strerror(error));
error_exit_name:
if (res) freeaddrinfo(res);
- rsock_raise_socket_error("getnameinfo", error);
+ rb_raise(rb_eSocket, "getnameinfo: %s", gai_strerror(error));
}
-/*
- * call-seq:
- * Socket.sockaddr_in(port, host) => sockaddr
- * Socket.pack_sockaddr_in(port, host) => sockaddr
- *
- * Packs _port_ and _host_ as an AF_INET/AF_INET6 sockaddr string.
- *
- * Socket.sockaddr_in(80, "127.0.0.1")
- * #=> "\x02\x00\x00P\x7F\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00"
- *
- * Socket.sockaddr_in(80, "::1")
- * #=> "\n\x00\x00P\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00"
- *
- */
static VALUE
-sock_s_pack_sockaddr_in(VALUE self, VALUE port, VALUE host)
+sock_s_pack_sockaddr_in(self, port, host)
+ VALUE self, port, host;
{
- struct addrinfo *res = rsock_addrinfo(host, port, 0, 0);
+ struct addrinfo *res = sock_addrinfo(host, port, 0, 0);
VALUE addr = rb_str_new((char*)res->ai_addr, res->ai_addrlen);
freeaddrinfo(res);
@@ -1292,31 +3794,14 @@ sock_s_pack_sockaddr_in(VALUE self, VALUE port, VALUE host)
return addr;
}
-/*
- * call-seq:
- * Socket.unpack_sockaddr_in(sockaddr) => [port, ip_address]
- *
- * Unpacks _sockaddr_ into port and ip_address.
- *
- * _sockaddr_ should be a string or an addrinfo for AF_INET/AF_INET6.
- *
- * sockaddr = Socket.sockaddr_in(80, "127.0.0.1")
- * p sockaddr #=> "\x02\x00\x00P\x7F\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00"
- * p Socket.unpack_sockaddr_in(sockaddr) #=> [80, "127.0.0.1"]
- *
- */
static VALUE
-sock_s_unpack_sockaddr_in(VALUE self, VALUE addr)
+sock_s_unpack_sockaddr_in(self, addr)
+ VALUE self, addr;
{
struct sockaddr_in * sockaddr;
VALUE host;
- sockaddr = (struct sockaddr_in*)SockAddrStringValuePtr(addr);
- if (RSTRING_LEN(addr) <
- (char*)&((struct sockaddr *)sockaddr)->sa_family +
- sizeof(((struct sockaddr *)sockaddr)->sa_family) -
- (char*)sockaddr)
- rb_raise(rb_eArgError, "too short sockaddr");
+ sockaddr = (struct sockaddr_in*)StringValuePtr(addr);
if (((struct sockaddr *)sockaddr)->sa_family != AF_INET
#ifdef INET6
&& ((struct sockaddr *)sockaddr)->sa_family != AF_INET6
@@ -1328,25 +3813,15 @@ sock_s_unpack_sockaddr_in(VALUE self, VALUE addr)
rb_raise(rb_eArgError, "not an AF_INET sockaddr");
#endif
}
- host = rsock_make_ipaddr((struct sockaddr*)sockaddr);
+ host = make_ipaddr((struct sockaddr*)sockaddr);
OBJ_INFECT(host, addr);
return rb_assoc_new(INT2NUM(ntohs(sockaddr->sin_port)), host);
}
#ifdef HAVE_SYS_UN_H
-
-/*
- * call-seq:
- * Socket.sockaddr_un(path) => sockaddr
- * Socket.pack_sockaddr_un(path) => sockaddr
- *
- * Packs _path_ as an AF_UNIX sockaddr string.
- *
- * Socket.sockaddr_un("/tmp/sock") #=> "\x01\x00/tmp/sock\x00\x00..."
- *
- */
static VALUE
-sock_s_pack_sockaddr_un(VALUE self, VALUE path)
+sock_s_pack_sockaddr_un(self, path)
+ VALUE self, path;
{
struct sockaddr_un sockaddr;
char *sun_path;
@@ -1366,42 +3841,26 @@ sock_s_pack_sockaddr_un(VALUE self, VALUE path)
return addr;
}
-/*
- * call-seq:
- * Socket.unpack_sockaddr_un(sockaddr) => path
- *
- * Unpacks _sockaddr_ into path.
- *
- * _sockaddr_ should be a string or an addrinfo for AF_UNIX.
- *
- * sockaddr = Socket.sockaddr_un("/tmp/sock")
- * p Socket.unpack_sockaddr_un(sockaddr) #=> "/tmp/sock"
- *
- */
static VALUE
-sock_s_unpack_sockaddr_un(VALUE self, VALUE addr)
+sock_s_unpack_sockaddr_un(self, addr)
+ VALUE self, addr;
{
struct sockaddr_un * sockaddr;
- const char *sun_path;
+ char *sun_path;
VALUE path;
- sockaddr = (struct sockaddr_un*)SockAddrStringValuePtr(addr);
- if (RSTRING_LEN(addr) <
- (char*)&((struct sockaddr *)sockaddr)->sa_family +
- sizeof(((struct sockaddr *)sockaddr)->sa_family) -
- (char*)sockaddr)
- rb_raise(rb_eArgError, "too short sockaddr");
+ sockaddr = (struct sockaddr_un*)StringValuePtr(addr);
if (((struct sockaddr *)sockaddr)->sa_family != AF_UNIX) {
rb_raise(rb_eArgError, "not an AF_UNIX sockaddr");
}
- if (sizeof(struct sockaddr_un) < (size_t)RSTRING_LEN(addr)) {
- rb_raise(rb_eTypeError, "too long sockaddr_un - %ld longer than %d",
- RSTRING_LEN(addr), (int)sizeof(struct sockaddr_un));
+ if (sizeof(struct sockaddr_un) < RSTRING(addr)->len) {
+ rb_raise(rb_eTypeError, "too long sockaddr_un - %ld longer than %d",
+ RSTRING(addr)->len, sizeof(struct sockaddr_un));
}
- sun_path = rsock_unixpath(sockaddr, RSTRING_LEN(addr));
- if (sizeof(struct sockaddr_un) == RSTRING_LEN(addr) &&
+ sun_path = unixpath(sockaddr, RSTRING(addr)->len);
+ if (sizeof(struct sockaddr_un) == RSTRING(addr)->len &&
sun_path == sockaddr->sun_path &&
- sun_path + strlen(sun_path) == RSTRING_PTR(addr) + RSTRING_LEN(addr)) {
+ sun_path + strlen(sun_path) == RSTRING(addr)->ptr + RSTRING(addr)->len) {
rb_raise(rb_eArgError, "sockaddr_un.sun_path not NUL terminated");
}
path = rb_str_new2(sun_path);
@@ -1410,363 +3869,23 @@ sock_s_unpack_sockaddr_un(VALUE self, VALUE addr)
}
#endif
-#if defined(HAVE_GETIFADDRS) || defined(SIOCGLIFCONF) || defined(SIOCGIFCONF) || defined(_WIN32)
-static VALUE
-sockaddr_obj(struct sockaddr *addr)
-{
- socklen_t len;
-#if defined(AF_INET6) && defined(__KAME__)
- struct sockaddr_in6 addr6;
-#endif
-
- if (addr == NULL)
- return Qnil;
-
- switch (addr->sa_family) {
- case AF_INET:
- len = sizeof(struct sockaddr_in);
- break;
-
-#ifdef AF_INET6
- case AF_INET6:
- len = sizeof(struct sockaddr_in6);
-# ifdef __KAME__
- /* KAME uses the 2nd 16bit word of link local IPv6 address as interface index internally */
- /* http://orange.kame.net/dev/cvsweb.cgi/kame/IMPLEMENTATION */
- /* convert fe80:1::1 to fe80::1%1 */
- memcpy(&addr6, addr, len);
- addr = (struct sockaddr *)&addr6;
- if (IN6_IS_ADDR_LINKLOCAL(&addr6.sin6_addr) &&
- addr6.sin6_scope_id == 0 &&
- (addr6.sin6_addr.s6_addr[2] || addr6.sin6_addr.s6_addr[3])) {
- addr6.sin6_scope_id = (addr6.sin6_addr.s6_addr[2] << 8) | addr6.sin6_addr.s6_addr[3];
- addr6.sin6_addr.s6_addr[2] = 0;
- addr6.sin6_addr.s6_addr[3] = 0;
- }
-# endif
- break;
-#endif
-
-#ifdef HAVE_SYS_UN_H
- case AF_UNIX:
- len = sizeof(struct sockaddr_un);
- break;
-#endif
+static VALUE mConst;
- default:
- len = sizeof(struct sockaddr_in);
- break;
- }
-#ifdef SA_LEN
- if (len < SA_LEN(addr))
- len = SA_LEN(addr);
-#endif
-
- return rsock_addrinfo_new(addr, len, addr->sa_family, 0, 0, Qnil, Qnil);
-}
-#endif
-
-#if defined(HAVE_GETIFADDRS) || (defined(SIOCGLIFCONF) && defined(SIOCGLIFNUM) && !defined(__hpux)) || defined(SIOCGIFCONF) || defined(_WIN32)
-/*
- * call-seq:
- * Socket.ip_address_list => array
- *
- * Returns local IP addresses as an array.
- *
- * The array contains Addrinfo objects.
- *
- * pp Socket.ip_address_list
- * #=> [#<Addrinfo: 127.0.0.1>,
- * #<Addrinfo: 192.168.0.128>,
- * #<Addrinfo: ::1>,
- * ...]
- *
- */
-static VALUE
-socket_s_ip_address_list(VALUE self)
+static void
+sock_define_const(name, value)
+ char *name;
+ int value;
{
-#if defined(HAVE_GETIFADDRS)
- struct ifaddrs *ifp = NULL;
- struct ifaddrs *p;
- int ret;
- VALUE list;
-
- ret = getifaddrs(&ifp);
- if (ret == -1) {
- rb_sys_fail("getifaddrs");
- }
-
- list = rb_ary_new();
- for (p = ifp; p; p = p->ifa_next) {
- if (p->ifa_addr != NULL && IS_IP_FAMILY(p->ifa_addr->sa_family)) {
- rb_ary_push(list, sockaddr_obj(p->ifa_addr));
- }
- }
-
- freeifaddrs(ifp);
-
- return list;
-#elif defined(SIOCGLIFCONF) && defined(SIOCGLIFNUM) && !defined(__hpux)
- /* Solaris if_tcp(7P) */
- /* HP-UX has SIOCGLIFCONF too. But it uses differenet struct */
- int fd = -1;
- int ret;
- struct lifnum ln;
- struct lifconf lc;
- char *reason = NULL;
- int save_errno;
- int i;
- VALUE list = Qnil;
-
- lc.lifc_buf = NULL;
-
- fd = socket(AF_INET, SOCK_DGRAM, 0);
- if (fd == -1)
- rb_sys_fail("socket");
-
- memset(&ln, 0, sizeof(ln));
- ln.lifn_family = AF_UNSPEC;
-
- ret = ioctl(fd, SIOCGLIFNUM, &ln);
- if (ret == -1) {
- reason = "SIOCGLIFNUM";
- goto finish;
- }
-
- memset(&lc, 0, sizeof(lc));
- lc.lifc_family = AF_UNSPEC;
- lc.lifc_flags = 0;
- lc.lifc_len = sizeof(struct lifreq) * ln.lifn_count;
- lc.lifc_req = xmalloc(lc.lifc_len);
-
- ret = ioctl(fd, SIOCGLIFCONF, &lc);
- if (ret == -1) {
- reason = "SIOCGLIFCONF";
- goto finish;
- }
-
- close(fd);
- fd = -1;
-
- list = rb_ary_new();
- for (i = 0; i < ln.lifn_count; i++) {
- struct lifreq *req = &lc.lifc_req[i];
- if (IS_IP_FAMILY(req->lifr_addr.ss_family)) {
- rb_ary_push(list, sockaddr_obj((struct sockaddr *)&req->lifr_addr));
- }
- }
-
- finish:
- save_errno = errno;
- if (lc.lifc_buf != NULL)
- xfree(lc.lifc_req);
- if (fd != -1)
- close(fd);
- errno = save_errno;
-
- if (reason)
- rb_sys_fail(reason);
- return list;
-
-#elif defined(SIOCGIFCONF)
- int fd = -1;
- int ret;
-#define EXTRA_SPACE (sizeof(struct ifconf) + sizeof(struct sockaddr_storage))
- char initbuf[4096+EXTRA_SPACE];
- char *buf = initbuf;
- int bufsize;
- struct ifconf conf;
- struct ifreq *req;
- VALUE list = Qnil;
- const char *reason = NULL;
- int save_errno;
-
- fd = socket(AF_INET, SOCK_DGRAM, 0);
- if (fd == -1)
- rb_sys_fail("socket");
-
- bufsize = sizeof(initbuf);
- buf = initbuf;
-
- retry:
- conf.ifc_len = bufsize;
- conf.ifc_req = (struct ifreq *)buf;
-
- /* fprintf(stderr, "bufsize: %d\n", bufsize); */
-
- ret = ioctl(fd, SIOCGIFCONF, &conf);
- if (ret == -1) {
- reason = "SIOCGIFCONF";
- goto finish;
- }
-
- /* fprintf(stderr, "conf.ifc_len: %d\n", conf.ifc_len); */
-
- if (bufsize - EXTRA_SPACE < conf.ifc_len) {
- if (bufsize < conf.ifc_len) {
- /* NetBSD returns required size for all interfaces. */
- bufsize = conf.ifc_len + EXTRA_SPACE;
- }
- else {
- bufsize = bufsize << 1;
- }
- if (buf == initbuf)
- buf = NULL;
- buf = xrealloc(buf, bufsize);
- goto retry;
- }
-
- close(fd);
- fd = -1;
-
- list = rb_ary_new();
- req = conf.ifc_req;
- while ((char*)req < (char*)conf.ifc_req + conf.ifc_len) {
- struct sockaddr *addr = &req->ifr_addr;
- if (IS_IP_FAMILY(addr->sa_family)) {
- rb_ary_push(list, sockaddr_obj(addr));
- }
-#ifdef HAVE_SA_LEN
-# ifndef _SIZEOF_ADDR_IFREQ
-# define _SIZEOF_ADDR_IFREQ(r) \
- (sizeof(struct ifreq) + \
- (sizeof(struct sockaddr) < (r).ifr_addr.sa_len ? \
- (r).ifr_addr.sa_len - sizeof(struct sockaddr) : \
- 0))
-# endif
- req = (struct ifreq *)((char*)req + _SIZEOF_ADDR_IFREQ(*req));
-#else
- req = (struct ifreq *)((char*)req + sizeof(struct ifreq));
-#endif
- }
-
- finish:
-
- save_errno = errno;
- if (buf != initbuf)
- xfree(buf);
- if (fd != -1)
- close(fd);
- errno = save_errno;
-
- if (reason)
- rb_sys_fail(reason);
- return list;
-
-#undef EXTRA_SPACE
-#elif defined(_WIN32)
- typedef struct ip_adapter_unicast_address_st {
- unsigned LONG_LONG dummy0;
- struct ip_adapter_unicast_address_st *Next;
- struct {
- struct sockaddr *lpSockaddr;
- int iSockaddrLength;
- } Address;
- int dummy1;
- int dummy2;
- int dummy3;
- long dummy4;
- long dummy5;
- long dummy6;
- } ip_adapter_unicast_address_t;
- typedef struct ip_adapter_anycast_address_st {
- unsigned LONG_LONG dummy0;
- struct ip_adapter_anycast_address_st *Next;
- struct {
- struct sockaddr *lpSockaddr;
- int iSockaddrLength;
- } Address;
- } ip_adapter_anycast_address_t;
- typedef struct ip_adapter_addresses_st {
- unsigned LONG_LONG dummy0;
- struct ip_adapter_addresses_st *Next;
- void *dummy1;
- ip_adapter_unicast_address_t *FirstUnicastAddress;
- ip_adapter_anycast_address_t *FirstAnycastAddress;
- void *dummy2;
- void *dummy3;
- void *dummy4;
- void *dummy5;
- void *dummy6;
- BYTE dummy7[8];
- DWORD dummy8;
- DWORD dummy9;
- DWORD dummy10;
- DWORD IfType;
- int OperStatus;
- DWORD dummy12;
- DWORD dummy13[16];
- void *dummy14;
- } ip_adapter_addresses_t;
- typedef ULONG (WINAPI *GetAdaptersAddresses_t)(ULONG, ULONG, PVOID, ip_adapter_addresses_t *, PULONG);
- HMODULE h;
- GetAdaptersAddresses_t pGetAdaptersAddresses;
- ULONG len;
- DWORD ret;
- ip_adapter_addresses_t *adapters;
- VALUE list;
-
- h = LoadLibrary("iphlpapi.dll");
- if (!h)
- rb_notimplement();
- pGetAdaptersAddresses = (GetAdaptersAddresses_t)GetProcAddress(h, "GetAdaptersAddresses");
- if (!pGetAdaptersAddresses) {
- CloseHandle(h);
- rb_notimplement();
- }
-
- ret = pGetAdaptersAddresses(AF_UNSPEC, 0, NULL, NULL, &len);
- if (ret != ERROR_SUCCESS && ret != ERROR_BUFFER_OVERFLOW) {
- errno = rb_w32_map_errno(ret);
- CloseHandle(h);
- rb_sys_fail("GetAdaptersAddresses");
- }
- adapters = (ip_adapter_addresses_t *)ALLOCA_N(BYTE, len);
- ret = pGetAdaptersAddresses(AF_UNSPEC, 0, NULL, adapters, &len);
- if (ret != ERROR_SUCCESS) {
- errno = rb_w32_map_errno(ret);
- CloseHandle(h);
- rb_sys_fail("GetAdaptersAddresses");
- }
-
- list = rb_ary_new();
- for (; adapters; adapters = adapters->Next) {
- ip_adapter_unicast_address_t *uni;
- ip_adapter_anycast_address_t *any;
- if (adapters->OperStatus != 1) /* 1 means IfOperStatusUp */
- continue;
- for (uni = adapters->FirstUnicastAddress; uni; uni = uni->Next) {
-#ifndef INET6
- if (uni->Address.lpSockaddr->sa_family == AF_INET)
-#else
- if (IS_IP_FAMILY(uni->Address.lpSockaddr->sa_family))
-#endif
- rb_ary_push(list, sockaddr_obj(uni->Address.lpSockaddr));
- }
- for (any = adapters->FirstAnycastAddress; any; any = any->Next) {
-#ifndef INET6
- if (any->Address.lpSockaddr->sa_family == AF_INET)
-#else
- if (IS_IP_FAMILY(any->Address.lpSockaddr->sa_family))
-#endif
- rb_ary_push(list, sockaddr_obj(any->Address.lpSockaddr));
- }
- }
-
- CloseHandle(h);
- return list;
-#endif
+ rb_define_const(rb_cSocket, name, INT2FIX(value));
+ rb_define_const(mConst, name, INT2FIX(value));
}
-#else
-#define socket_s_ip_address_list rb_f_notimplement
-#endif
/*
* Class +Socket+ provides access to the underlying operating system
* socket implementations. It can be used to provide more operating system
* specific functionality than the protocol-specific socket classes but at the
* expense of greater complexity. In particular, the class handles addresses
- * using +struct+ sockaddr structures packed into Ruby strings, which can be
+ * using +struct sockaddr+ structures packed into Ruby strings, which can be
* a joy to manipulate.
*
* === Exception Handling
@@ -1789,13 +3908,90 @@ socket_s_ip_address_list(VALUE self)
void
Init_socket()
{
- Init_basicsocket();
+ rb_eSocket = rb_define_class("SocketError", rb_eStandardError);
+
+ rb_cBasicSocket = rb_define_class("BasicSocket", rb_cIO);
+ rb_undef_method(rb_cBasicSocket, "initialize");
+
+ rb_define_singleton_method(rb_cBasicSocket, "do_not_reverse_lookup",
+ bsock_do_not_rev_lookup, 0);
+ rb_define_singleton_method(rb_cBasicSocket, "do_not_reverse_lookup=",
+ bsock_do_not_rev_lookup_set, 1);
+ rb_define_singleton_method(rb_cBasicSocket, "for_fd", bsock_s_for_fd, 1);
+
+ rb_define_method(rb_cBasicSocket, "close_read", bsock_close_read, 0);
+ rb_define_method(rb_cBasicSocket, "close_write", bsock_close_write, 0);
+ rb_define_method(rb_cBasicSocket, "shutdown", bsock_shutdown, -1);
+ rb_define_method(rb_cBasicSocket, "setsockopt", bsock_setsockopt, 3);
+ rb_define_method(rb_cBasicSocket, "getsockopt", bsock_getsockopt, 2);
+ rb_define_method(rb_cBasicSocket, "getsockname", bsock_getsockname, 0);
+ rb_define_method(rb_cBasicSocket, "getpeername", bsock_getpeername, 0);
+ rb_define_method(rb_cBasicSocket, "send", bsock_send, -1);
+ rb_define_method(rb_cBasicSocket, "recv", bsock_recv, -1);
+ rb_define_method(rb_cBasicSocket, "recv_nonblock", bsock_recv_nonblock, -1);
+
+ rb_cIPSocket = rb_define_class("IPSocket", rb_cBasicSocket);
+ rb_define_global_const("IPsocket", rb_cIPSocket);
+ rb_define_method(rb_cIPSocket, "addr", ip_addr, 0);
+ rb_define_method(rb_cIPSocket, "peeraddr", ip_peeraddr, 0);
+ rb_define_method(rb_cIPSocket, "recvfrom", ip_recvfrom, -1);
+ rb_define_singleton_method(rb_cIPSocket, "getaddress", ip_s_getaddress, 1);
+
+ rb_cTCPSocket = rb_define_class("TCPSocket", rb_cIPSocket);
+ rb_define_global_const("TCPsocket", rb_cTCPSocket);
+ rb_define_singleton_method(rb_cTCPSocket, "gethostbyname", tcp_s_gethostbyname, 1);
+ rb_define_method(rb_cTCPSocket, "initialize", tcp_init, -1);
+
+#ifdef SOCKS
+ rb_cSOCKSSocket = rb_define_class("SOCKSSocket", rb_cTCPSocket);
+ rb_define_global_const("SOCKSsocket", rb_cSOCKSSocket);
+ rb_define_method(rb_cSOCKSSocket, "initialize", socks_init, 2);
+#ifdef SOCKS5
+ rb_define_method(rb_cSOCKSSocket, "close", socks_s_close, 0);
+#endif
+#endif
- rb_cSocket = rb_define_class("Socket", rb_cBasicSocket);
+ rb_cTCPServer = rb_define_class("TCPServer", rb_cTCPSocket);
+ rb_define_global_const("TCPserver", rb_cTCPServer);
+ rb_define_method(rb_cTCPServer, "accept", tcp_accept, 0);
+ 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", sock_listen, 1);
+
+ rb_cUDPSocket = rb_define_class("UDPSocket", rb_cIPSocket);
+ rb_define_global_const("UDPsocket", rb_cUDPSocket);
+ rb_define_method(rb_cUDPSocket, "initialize", udp_init, -1);
+ rb_define_method(rb_cUDPSocket, "connect", udp_connect, 2);
+ rb_define_method(rb_cUDPSocket, "bind", udp_bind, 2);
+ rb_define_method(rb_cUDPSocket, "send", udp_send, -1);
+ rb_define_method(rb_cUDPSocket, "recvfrom_nonblock", udp_recvfrom_nonblock, -1);
+
+#ifdef HAVE_SYS_UN_H
+ rb_cUNIXSocket = rb_define_class("UNIXSocket", rb_cBasicSocket);
+ rb_define_global_const("UNIXsocket", rb_cUNIXSocket);
+ rb_define_method(rb_cUNIXSocket, "initialize", unix_init, 1);
+ rb_define_method(rb_cUNIXSocket, "path", unix_path, 0);
+ rb_define_method(rb_cUNIXSocket, "addr", unix_addr, 0);
+ rb_define_method(rb_cUNIXSocket, "peeraddr", unix_peeraddr, 0);
+ rb_define_method(rb_cUNIXSocket, "recvfrom", unix_recvfrom, -1);
+ rb_define_method(rb_cUNIXSocket, "send_io", unix_send_io, 1);
+ rb_define_method(rb_cUNIXSocket, "recv_io", unix_recv_io, -1);
+ rb_define_singleton_method(rb_cUNIXSocket, "socketpair", unix_s_socketpair, -1);
+ rb_define_singleton_method(rb_cUNIXSocket, "pair", unix_s_socketpair, -1);
+
+ rb_cUNIXServer = rb_define_class("UNIXServer", rb_cUNIXSocket);
+ rb_define_global_const("UNIXserver", rb_cUNIXServer);
+ rb_define_method(rb_cUNIXServer, "initialize", unix_svr_init, 1);
+ rb_define_method(rb_cUNIXServer, "accept", unix_accept, 0);
+ rb_define_method(rb_cUNIXServer, "accept_nonblock", unix_accept_nonblock, 0);
+ rb_define_method(rb_cUNIXServer, "sysaccept", unix_sysaccept, 0);
+ rb_define_method(rb_cUNIXServer, "listen", sock_listen, 1);
+#endif
- Init_socket_init();
+ rb_cSocket = rb_define_class("Socket", rb_cBasicSocket);
- rb_define_method(rb_cSocket, "initialize", sock_initialize, -1);
+ rb_define_method(rb_cSocket, "initialize", sock_initialize, 3);
rb_define_method(rb_cSocket, "connect", sock_connect, 1);
rb_define_method(rb_cSocket, "connect_nonblock", sock_connect_nonblock, 1);
rb_define_method(rb_cSocket, "bind", sock_bind, 1);
@@ -1807,13 +4003,12 @@ Init_socket()
rb_define_method(rb_cSocket, "recvfrom", sock_recvfrom, -1);
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);
+ rb_define_singleton_method(rb_cSocket, "socketpair", sock_s_socketpair, 3);
+ rb_define_singleton_method(rb_cSocket, "pair", sock_s_socketpair, 3);
rb_define_singleton_method(rb_cSocket, "gethostname", sock_gethostname, 0);
rb_define_singleton_method(rb_cSocket, "gethostbyname", sock_s_gethostbyname, 1);
rb_define_singleton_method(rb_cSocket, "gethostbyaddr", sock_s_gethostbyaddr, -1);
- rb_define_singleton_method(rb_cSocket, "getservbyname", sock_s_getservbyname, -1);
- rb_define_singleton_method(rb_cSocket, "getservbyport", sock_s_getservbyport, -1);
+ rb_define_singleton_method(rb_cSocket, "getservbyname", sock_s_getservbyaname, -1);
rb_define_singleton_method(rb_cSocket, "getaddrinfo", sock_s_getaddrinfo, -1);
rb_define_singleton_method(rb_cSocket, "getnameinfo", sock_s_getnameinfo, -1);
rb_define_singleton_method(rb_cSocket, "sockaddr_in", sock_s_pack_sockaddr_in, 2);
@@ -1825,11 +4020,702 @@ Init_socket()
rb_define_singleton_method(rb_cSocket, "unpack_sockaddr_un", sock_s_unpack_sockaddr_un, 1);
#endif
- rb_define_singleton_method(rb_cSocket, "ip_address_list", socket_s_ip_address_list, 0);
+ /* constants */
+ mConst = rb_define_module_under(rb_cSocket, "Constants");
+ sock_define_const("SOCK_STREAM", SOCK_STREAM);
+ sock_define_const("SOCK_DGRAM", SOCK_DGRAM);
+#ifdef SOCK_RAW
+ sock_define_const("SOCK_RAW", SOCK_RAW);
+#endif
+#ifdef SOCK_RDM
+ sock_define_const("SOCK_RDM", SOCK_RDM);
+#endif
+#ifdef SOCK_SEQPACKET
+ sock_define_const("SOCK_SEQPACKET", SOCK_SEQPACKET);
+#endif
+#ifdef SOCK_PACKET
+ sock_define_const("SOCK_PACKET", SOCK_PACKET);
+#endif
- /* defined here for rdoc */
- rb_define_method(rb_cTCPServer, "listen", sock_listen, 1);
-#ifdef HAVE_SYS_UN_H
- rb_define_method(rb_cUNIXServer, "listen", sock_listen, 1);
+ sock_define_const("AF_INET", AF_INET);
+#ifdef PF_INET
+ sock_define_const("PF_INET", PF_INET);
+#endif
+#ifdef AF_UNIX
+ sock_define_const("AF_UNIX", AF_UNIX);
+ sock_define_const("PF_UNIX", PF_UNIX);
+#endif
+#ifdef AF_AX25
+ sock_define_const("AF_AX25", AF_AX25);
+ sock_define_const("PF_AX25", PF_AX25);
+#endif
+#ifdef AF_IPX
+ sock_define_const("AF_IPX", AF_IPX);
+ sock_define_const("PF_IPX", PF_IPX);
+#endif
+#ifdef AF_APPLETALK
+ sock_define_const("AF_APPLETALK", AF_APPLETALK);
+ sock_define_const("PF_APPLETALK", PF_APPLETALK);
+#endif
+#ifdef AF_UNSPEC
+ sock_define_const("AF_UNSPEC", AF_UNSPEC);
+ sock_define_const("PF_UNSPEC", PF_UNSPEC);
+#endif
+#ifdef INET6
+ sock_define_const("AF_INET6", AF_INET6);
+#endif
+#ifdef INET6
+ sock_define_const("PF_INET6", PF_INET6);
+#endif
+#ifdef AF_LOCAL
+ sock_define_const("AF_LOCAL", AF_LOCAL);
+#endif
+#ifdef PF_LOCAL
+ sock_define_const("PF_LOCAL", PF_LOCAL);
+#endif
+#ifdef AF_IMPLINK
+ sock_define_const("AF_IMPLINK", AF_IMPLINK);
+#endif
+#ifdef PF_IMPLINK
+ sock_define_const("PF_IMPLINK", PF_IMPLINK);
+#endif
+#ifdef AF_PUP
+ sock_define_const("AF_PUP", AF_PUP);
+#endif
+#ifdef PF_PUP
+ sock_define_const("PF_PUP", PF_PUP);
+#endif
+#ifdef AF_CHAOS
+ sock_define_const("AF_CHAOS", AF_CHAOS);
+#endif
+#ifdef PF_CHAOS
+ sock_define_const("PF_CHAOS", PF_CHAOS);
+#endif
+#ifdef AF_NS
+ sock_define_const("AF_NS", AF_NS);
+#endif
+#ifdef PF_NS
+ sock_define_const("PF_NS", PF_NS);
+#endif
+#ifdef AF_ISO
+ sock_define_const("AF_ISO", AF_ISO);
+#endif
+#ifdef PF_ISO
+ sock_define_const("PF_ISO", PF_ISO);
+#endif
+#ifdef AF_OSI
+ sock_define_const("AF_OSI", AF_OSI);
+#endif
+#ifdef PF_OSI
+ sock_define_const("PF_OSI", PF_OSI);
+#endif
+#ifdef AF_ECMA
+ sock_define_const("AF_ECMA", AF_ECMA);
+#endif
+#ifdef PF_ECMA
+ sock_define_const("PF_ECMA", PF_ECMA);
+#endif
+#ifdef AF_DATAKIT
+ sock_define_const("AF_DATAKIT", AF_DATAKIT);
+#endif
+#ifdef PF_DATAKIT
+ sock_define_const("PF_DATAKIT", PF_DATAKIT);
+#endif
+#ifdef AF_CCITT
+ sock_define_const("AF_CCITT", AF_CCITT);
+#endif
+#ifdef PF_CCITT
+ sock_define_const("PF_CCITT", PF_CCITT);
+#endif
+#ifdef AF_SNA
+ sock_define_const("AF_SNA", AF_SNA);
+#endif
+#ifdef PF_SNA
+ sock_define_const("PF_SNA", PF_SNA);
+#endif
+#ifdef AF_DEC
+ sock_define_const("AF_DEC", AF_DEC);
+#endif
+#ifdef PF_DEC
+ sock_define_const("PF_DEC", PF_DEC);
+#endif
+#ifdef AF_DLI
+ sock_define_const("AF_DLI", AF_DLI);
+#endif
+#ifdef PF_DLI
+ sock_define_const("PF_DLI", PF_DLI);
+#endif
+#ifdef AF_LAT
+ sock_define_const("AF_LAT", AF_LAT);
+#endif
+#ifdef PF_LAT
+ sock_define_const("PF_LAT", PF_LAT);
+#endif
+#ifdef AF_HYLINK
+ sock_define_const("AF_HYLINK", AF_HYLINK);
+#endif
+#ifdef PF_HYLINK
+ sock_define_const("PF_HYLINK", PF_HYLINK);
+#endif
+#ifdef AF_ROUTE
+ sock_define_const("AF_ROUTE", AF_ROUTE);
+#endif
+#ifdef PF_ROUTE
+ sock_define_const("PF_ROUTE", PF_ROUTE);
+#endif
+#ifdef AF_LINK
+ sock_define_const("AF_LINK", AF_LINK);
+#endif
+#ifdef PF_LINK
+ sock_define_const("PF_LINK", PF_LINK);
+#endif
+#ifdef AF_COIP
+ sock_define_const("AF_COIP", AF_COIP);
+#endif
+#ifdef PF_COIP
+ sock_define_const("PF_COIP", PF_COIP);
+#endif
+#ifdef AF_CNT
+ sock_define_const("AF_CNT", AF_CNT);
+#endif
+#ifdef PF_CNT
+ sock_define_const("PF_CNT", PF_CNT);
+#endif
+#ifdef AF_SIP
+ sock_define_const("AF_SIP", AF_SIP);
+#endif
+#ifdef PF_SIP
+ sock_define_const("PF_SIP", PF_SIP);
+#endif
+#ifdef AF_NDRV
+ sock_define_const("AF_NDRV", AF_NDRV);
+#endif
+#ifdef PF_NDRV
+ sock_define_const("PF_NDRV", PF_NDRV);
+#endif
+#ifdef AF_ISDN
+ sock_define_const("AF_ISDN", AF_ISDN);
+#endif
+#ifdef PF_ISDN
+ sock_define_const("PF_ISDN", PF_ISDN);
+#endif
+#ifdef AF_NATM
+ sock_define_const("AF_NATM", AF_NATM);
+#endif
+#ifdef PF_NATM
+ sock_define_const("PF_NATM", PF_NATM);
+#endif
+#ifdef AF_SYSTEM
+ sock_define_const("AF_SYSTEM", AF_SYSTEM);
+#endif
+#ifdef PF_SYSTEM
+ sock_define_const("PF_SYSTEM", PF_SYSTEM);
+#endif
+#ifdef AF_NETBIOS
+ sock_define_const("AF_NETBIOS", AF_NETBIOS);
+#endif
+#ifdef PF_NETBIOS
+ sock_define_const("PF_NETBIOS", PF_NETBIOS);
+#endif
+#ifdef AF_PPP
+ sock_define_const("AF_PPP", AF_PPP);
+#endif
+#ifdef PF_PPP
+ sock_define_const("PF_PPP", PF_PPP);
+#endif
+#ifdef AF_ATM
+ sock_define_const("AF_ATM", AF_ATM);
+#endif
+#ifdef PF_ATM
+ sock_define_const("PF_ATM", PF_ATM);
+#endif
+#ifdef AF_NETGRAPH
+ sock_define_const("AF_NETGRAPH", AF_NETGRAPH);
+#endif
+#ifdef PF_NETGRAPH
+ sock_define_const("PF_NETGRAPH", PF_NETGRAPH);
+#endif
+#ifdef AF_MAX
+ sock_define_const("AF_MAX", AF_MAX);
+#endif
+#ifdef PF_MAX
+ sock_define_const("PF_MAX", PF_MAX);
+#endif
+#ifdef AF_E164
+ sock_define_const("AF_E164", AF_E164);
+#endif
+#ifdef PF_XTP
+ sock_define_const("PF_XTP", PF_XTP);
+#endif
+#ifdef PF_RTIP
+ sock_define_const("PF_RTIP", PF_RTIP);
+#endif
+#ifdef PF_PIP
+ sock_define_const("PF_PIP", PF_PIP);
+#endif
+#ifdef PF_KEY
+ sock_define_const("PF_KEY", PF_KEY);
+#endif
+
+ sock_define_const("MSG_OOB", MSG_OOB);
+#ifdef MSG_PEEK
+ sock_define_const("MSG_PEEK", MSG_PEEK);
+#endif
+#ifdef MSG_DONTROUTE
+ sock_define_const("MSG_DONTROUTE", MSG_DONTROUTE);
+#endif
+#ifdef MSG_EOR
+ sock_define_const("MSG_EOR", MSG_EOR);
+#endif
+#ifdef MSG_TRUNC
+ sock_define_const("MSG_TRUNC", MSG_TRUNC);
+#endif
+#ifdef MSG_CTRUNC
+ sock_define_const("MSG_CTRUNC", MSG_CTRUNC);
+#endif
+#ifdef MSG_WAITALL
+ sock_define_const("MSG_WAITALL", MSG_WAITALL);
+#endif
+#ifdef MSG_DONTWAIT
+ sock_define_const("MSG_DONTWAIT", MSG_DONTWAIT);
+#endif
+#ifdef MSG_EOF
+ sock_define_const("MSG_EOF", MSG_EOF);
+#endif
+#ifdef MSG_FLUSH
+ sock_define_const("MSG_FLUSH", MSG_FLUSH);
+#endif
+#ifdef MSG_HOLD
+ sock_define_const("MSG_HOLD", MSG_HOLD);
+#endif
+#ifdef MSG_SEND
+ sock_define_const("MSG_SEND", MSG_SEND);
+#endif
+#ifdef MSG_HAVEMORE
+ sock_define_const("MSG_HAVEMORE", MSG_HAVEMORE);
+#endif
+#ifdef MSG_RCVMORE
+ sock_define_const("MSG_RCVMORE", MSG_RCVMORE);
+#endif
+#ifdef MSG_COMPAT
+ sock_define_const("MSG_COMPAT", MSG_COMPAT);
+#endif
+
+ sock_define_const("SOL_SOCKET", SOL_SOCKET);
+#ifdef SOL_IP
+ sock_define_const("SOL_IP", SOL_IP);
+#endif
+#ifdef SOL_IPX
+ sock_define_const("SOL_IPX", SOL_IPX);
+#endif
+#ifdef SOL_AX25
+ sock_define_const("SOL_AX25", SOL_AX25);
+#endif
+#ifdef SOL_ATALK
+ sock_define_const("SOL_ATALK", SOL_ATALK);
+#endif
+#ifdef SOL_TCP
+ sock_define_const("SOL_TCP", SOL_TCP);
+#endif
+#ifdef SOL_UDP
+ sock_define_const("SOL_UDP", SOL_UDP);
+#endif
+
+#ifdef IPPROTO_IP
+ sock_define_const("IPPROTO_IP", IPPROTO_IP);
+#else
+ sock_define_const("IPPROTO_IP", 0);
+#endif
+#ifdef IPPROTO_ICMP
+ sock_define_const("IPPROTO_ICMP", IPPROTO_ICMP);
+#else
+ sock_define_const("IPPROTO_ICMP", 1);
+#endif
+#ifdef IPPROTO_IGMP
+ sock_define_const("IPPROTO_IGMP", IPPROTO_IGMP);
+#endif
+#ifdef IPPROTO_GGP
+ sock_define_const("IPPROTO_GGP", IPPROTO_GGP);
+#endif
+#ifdef IPPROTO_TCP
+ sock_define_const("IPPROTO_TCP", IPPROTO_TCP);
+#else
+ sock_define_const("IPPROTO_TCP", 6);
+#endif
+#ifdef IPPROTO_EGP
+ sock_define_const("IPPROTO_EGP", IPPROTO_EGP);
+#endif
+#ifdef IPPROTO_PUP
+ sock_define_const("IPPROTO_PUP", IPPROTO_PUP);
+#endif
+#ifdef IPPROTO_UDP
+ sock_define_const("IPPROTO_UDP", IPPROTO_UDP);
+#else
+ sock_define_const("IPPROTO_UDP", 17);
+#endif
+#ifdef IPPROTO_IDP
+ sock_define_const("IPPROTO_IDP", IPPROTO_IDP);
+#endif
+#ifdef IPPROTO_HELLO
+ sock_define_const("IPPROTO_HELLO", IPPROTO_HELLO);
+#endif
+#ifdef IPPROTO_ND
+ sock_define_const("IPPROTO_ND", IPPROTO_ND);
+#endif
+#ifdef IPPROTO_TP
+ sock_define_const("IPPROTO_TP", IPPROTO_TP);
+#endif
+#ifdef IPPROTO_XTP
+ sock_define_const("IPPROTO_XTP", IPPROTO_XTP);
+#endif
+#ifdef IPPROTO_EON
+ sock_define_const("IPPROTO_EON", IPPROTO_EON);
+#endif
+#ifdef IPPROTO_BIP
+ sock_define_const("IPPROTO_BIP", IPPROTO_BIP);
+#endif
+/**/
+#ifdef IPPROTO_RAW
+ sock_define_const("IPPROTO_RAW", IPPROTO_RAW);
+#else
+ sock_define_const("IPPROTO_RAW", 255);
+#endif
+#ifdef IPPROTO_MAX
+ sock_define_const("IPPROTO_MAX", IPPROTO_MAX);
+#endif
+
+ /* Some port configuration */
+#ifdef IPPORT_RESERVED
+ sock_define_const("IPPORT_RESERVED", IPPORT_RESERVED);
+#else
+ sock_define_const("IPPORT_RESERVED", 1024);
+#endif
+#ifdef IPPORT_USERRESERVED
+ sock_define_const("IPPORT_USERRESERVED", IPPORT_USERRESERVED);
+#else
+ sock_define_const("IPPORT_USERRESERVED", 5000);
+#endif
+ /* Some reserved IP v.4 addresses */
+#ifdef INADDR_ANY
+ sock_define_const("INADDR_ANY", INADDR_ANY);
+#else
+ sock_define_const("INADDR_ANY", 0x00000000);
+#endif
+#ifdef INADDR_BROADCAST
+ sock_define_const("INADDR_BROADCAST", INADDR_BROADCAST);
+#else
+ sock_define_const("INADDR_BROADCAST", 0xffffffff);
+#endif
+#ifdef INADDR_LOOPBACK
+ sock_define_const("INADDR_LOOPBACK", INADDR_LOOPBACK);
+#else
+ sock_define_const("INADDR_LOOPBACK", 0x7F000001);
+#endif
+#ifdef INADDR_UNSPEC_GROUP
+ sock_define_const("INADDR_UNSPEC_GROUP", INADDR_UNSPEC_GROUP);
+#else
+ sock_define_const("INADDR_UNSPEC_GROUP", 0xe0000000);
+#endif
+#ifdef INADDR_ALLHOSTS_GROUP
+ sock_define_const("INADDR_ALLHOSTS_GROUP", INADDR_ALLHOSTS_GROUP);
+#else
+ sock_define_const("INADDR_ALLHOSTS_GROUP", 0xe0000001);
+#endif
+#ifdef INADDR_MAX_LOCAL_GROUP
+ sock_define_const("INADDR_MAX_LOCAL_GROUP", INADDR_MAX_LOCAL_GROUP);
+#else
+ sock_define_const("INADDR_MAX_LOCAL_GROUP", 0xe00000ff);
+#endif
+#ifdef INADDR_NONE
+ sock_define_const("INADDR_NONE", INADDR_NONE);
+#else
+ sock_define_const("INADDR_NONE", 0xffffffff);
+#endif
+ /* IP [gs]etsockopt options */
+#ifdef IP_OPTIONS
+ sock_define_const("IP_OPTIONS", IP_OPTIONS);
+#endif
+#ifdef IP_HDRINCL
+ sock_define_const("IP_HDRINCL", IP_HDRINCL);
+#endif
+#ifdef IP_TOS
+ sock_define_const("IP_TOS", IP_TOS);
+#endif
+#ifdef IP_TTL
+ sock_define_const("IP_TTL", IP_TTL);
+#endif
+#ifdef IP_RECVOPTS
+ sock_define_const("IP_RECVOPTS", IP_RECVOPTS);
+#endif
+#ifdef IP_RECVRETOPTS
+ sock_define_const("IP_RECVRETOPTS", IP_RECVRETOPTS);
+#endif
+#ifdef IP_RECVDSTADDR
+ sock_define_const("IP_RECVDSTADDR", IP_RECVDSTADDR);
+#endif
+#ifdef IP_RETOPTS
+ sock_define_const("IP_RETOPTS", IP_RETOPTS);
+#endif
+#ifdef IP_MULTICAST_IF
+ sock_define_const("IP_MULTICAST_IF", IP_MULTICAST_IF);
+#endif
+#ifdef IP_MULTICAST_TTL
+ sock_define_const("IP_MULTICAST_TTL", IP_MULTICAST_TTL);
+#endif
+#ifdef IP_MULTICAST_LOOP
+ sock_define_const("IP_MULTICAST_LOOP", IP_MULTICAST_LOOP);
+#endif
+#ifdef IP_ADD_MEMBERSHIP
+ sock_define_const("IP_ADD_MEMBERSHIP", IP_ADD_MEMBERSHIP);
+#endif
+#ifdef IP_DROP_MEMBERSHIP
+ sock_define_const("IP_DROP_MEMBERSHIP", IP_DROP_MEMBERSHIP);
+#endif
+#ifdef IP_DEFAULT_MULTICAST_TTL
+ sock_define_const("IP_DEFAULT_MULTICAST_TTL", IP_DEFAULT_MULTICAST_TTL);
+#endif
+#ifdef IP_DEFAULT_MULTICAST_LOOP
+ sock_define_const("IP_DEFAULT_MULTICAST_LOOP", IP_DEFAULT_MULTICAST_LOOP);
+#endif
+#ifdef IP_MAX_MEMBERSHIPS
+ sock_define_const("IP_MAX_MEMBERSHIPS", IP_MAX_MEMBERSHIPS);
+#endif
+#ifdef SO_DEBUG
+ sock_define_const("SO_DEBUG", SO_DEBUG);
+#endif
+ sock_define_const("SO_REUSEADDR", SO_REUSEADDR);
+#ifdef SO_REUSEPORT
+ sock_define_const("SO_REUSEPORT", SO_REUSEPORT);
+#endif
+#ifdef SO_TYPE
+ sock_define_const("SO_TYPE", SO_TYPE);
+#endif
+#ifdef SO_ERROR
+ sock_define_const("SO_ERROR", SO_ERROR);
+#endif
+#ifdef SO_DONTROUTE
+ sock_define_const("SO_DONTROUTE", SO_DONTROUTE);
+#endif
+#ifdef SO_BROADCAST
+ sock_define_const("SO_BROADCAST", SO_BROADCAST);
+#endif
+#ifdef SO_SNDBUF
+ sock_define_const("SO_SNDBUF", SO_SNDBUF);
+#endif
+#ifdef SO_RCVBUF
+ sock_define_const("SO_RCVBUF", SO_RCVBUF);
+#endif
+#ifdef SO_KEEPALIVE
+ sock_define_const("SO_KEEPALIVE", SO_KEEPALIVE);
+#endif
+#ifdef SO_OOBINLINE
+ sock_define_const("SO_OOBINLINE", SO_OOBINLINE);
+#endif
+#ifdef SO_NO_CHECK
+ sock_define_const("SO_NO_CHECK", SO_NO_CHECK);
+#endif
+#ifdef SO_PRIORITY
+ sock_define_const("SO_PRIORITY", SO_PRIORITY);
+#endif
+#ifdef SO_LINGER
+ sock_define_const("SO_LINGER", SO_LINGER);
+#endif
+#ifdef SO_PASSCRED
+ sock_define_const("SO_PASSCRED", SO_PASSCRED);
+#endif
+#ifdef SO_PEERCRED
+ sock_define_const("SO_PEERCRED", SO_PEERCRED);
+#endif
+#ifdef SO_RCVLOWAT
+ sock_define_const("SO_RCVLOWAT", SO_RCVLOWAT);
+#endif
+#ifdef SO_SNDLOWAT
+ sock_define_const("SO_SNDLOWAT", SO_SNDLOWAT);
+#endif
+#ifdef SO_RCVTIMEO
+ sock_define_const("SO_RCVTIMEO", SO_RCVTIMEO);
+#endif
+#ifdef SO_SNDTIMEO
+ sock_define_const("SO_SNDTIMEO", SO_SNDTIMEO);
+#endif
+#ifdef SO_ACCEPTCONN
+ sock_define_const("SO_ACCEPTCONN", SO_ACCEPTCONN);
+#endif
+#ifdef SO_USELOOPBACK
+ sock_define_const("SO_USELOOPBACK", SO_USELOOPBACK);
+#endif
+#ifdef SO_ACCEPTFILTER
+ sock_define_const("SO_ACCEPTFILTER", SO_ACCEPTFILTER);
+#endif
+#ifdef SO_DONTTRUNC
+ sock_define_const("SO_DONTTRUNC", SO_DONTTRUNC);
+#endif
+#ifdef SO_WANTMORE
+ sock_define_const("SO_WANTMORE", SO_WANTMORE);
+#endif
+#ifdef SO_WANTOOBFLAG
+ sock_define_const("SO_WANTOOBFLAG", SO_WANTOOBFLAG);
+#endif
+#ifdef SO_NREAD
+ sock_define_const("SO_NREAD", SO_NREAD);
+#endif
+#ifdef SO_NKE
+ sock_define_const("SO_NKE", SO_NKE);
+#endif
+#ifdef SO_NOSIGPIPE
+ sock_define_const("SO_NOSIGPIPE", SO_NOSIGPIPE);
+#endif
+
+#ifdef SO_SECURITY_AUTHENTICATION
+ sock_define_const("SO_SECURITY_AUTHENTICATION", SO_SECURITY_AUTHENTICATION);
+#endif
+#ifdef SO_SECURITY_ENCRYPTION_TRANSPORT
+ sock_define_const("SO_SECURITY_ENCRYPTION_TRANSPORT", SO_SECURITY_ENCRYPTION_TRANSPORT);
+#endif
+#ifdef SO_SECURITY_ENCRYPTION_NETWORK
+ sock_define_const("SO_SECURITY_ENCRYPTION_NETWORK", SO_SECURITY_ENCRYPTION_NETWORK);
+#endif
+
+#ifdef SO_BINDTODEVICE
+ sock_define_const("SO_BINDTODEVICE", SO_BINDTODEVICE);
+#endif
+#ifdef SO_ATTACH_FILTER
+ sock_define_const("SO_ATTACH_FILTER", SO_ATTACH_FILTER);
+#endif
+#ifdef SO_DETACH_FILTER
+ sock_define_const("SO_DETACH_FILTER", SO_DETACH_FILTER);
+#endif
+#ifdef SO_PEERNAME
+ sock_define_const("SO_PEERNAME", SO_PEERNAME);
+#endif
+#ifdef SO_TIMESTAMP
+ sock_define_const("SO_TIMESTAMP", SO_TIMESTAMP);
+#endif
+
+#ifdef SOPRI_INTERACTIVE
+ sock_define_const("SOPRI_INTERACTIVE", SOPRI_INTERACTIVE);
+#endif
+#ifdef SOPRI_NORMAL
+ sock_define_const("SOPRI_NORMAL", SOPRI_NORMAL);
+#endif
+#ifdef SOPRI_BACKGROUND
+ sock_define_const("SOPRI_BACKGROUND", SOPRI_BACKGROUND);
+#endif
+
+#ifdef IPX_TYPE
+ sock_define_const("IPX_TYPE", IPX_TYPE);
+#endif
+
+#ifdef TCP_NODELAY
+ sock_define_const("TCP_NODELAY", TCP_NODELAY);
+#endif
+#ifdef TCP_MAXSEG
+ sock_define_const("TCP_MAXSEG", TCP_MAXSEG);
+#endif
+
+#ifdef EAI_ADDRFAMILY
+ sock_define_const("EAI_ADDRFAMILY", EAI_ADDRFAMILY);
+#endif
+#ifdef EAI_AGAIN
+ sock_define_const("EAI_AGAIN", EAI_AGAIN);
+#endif
+#ifdef EAI_BADFLAGS
+ sock_define_const("EAI_BADFLAGS", EAI_BADFLAGS);
+#endif
+#ifdef EAI_FAIL
+ sock_define_const("EAI_FAIL", EAI_FAIL);
+#endif
+#ifdef EAI_FAMILY
+ sock_define_const("EAI_FAMILY", EAI_FAMILY);
+#endif
+#ifdef EAI_MEMORY
+ sock_define_const("EAI_MEMORY", EAI_MEMORY);
+#endif
+#ifdef EAI_NODATA
+ sock_define_const("EAI_NODATA", EAI_NODATA);
+#endif
+#ifdef EAI_NONAME
+ sock_define_const("EAI_NONAME", EAI_NONAME);
+#endif
+#ifdef EAI_SERVICE
+ sock_define_const("EAI_SERVICE", EAI_SERVICE);
+#endif
+#ifdef EAI_SOCKTYPE
+ sock_define_const("EAI_SOCKTYPE", EAI_SOCKTYPE);
+#endif
+#ifdef EAI_SYSTEM
+ sock_define_const("EAI_SYSTEM", EAI_SYSTEM);
+#endif
+#ifdef EAI_BADHINTS
+ sock_define_const("EAI_BADHINTS", EAI_BADHINTS);
+#endif
+#ifdef EAI_PROTOCOL
+ sock_define_const("EAI_PROTOCOL", EAI_PROTOCOL);
+#endif
+#ifdef EAI_MAX
+ sock_define_const("EAI_MAX", EAI_MAX);
+#endif
+#ifdef AI_PASSIVE
+ sock_define_const("AI_PASSIVE", AI_PASSIVE);
+#endif
+#ifdef AI_CANONNAME
+ sock_define_const("AI_CANONNAME", AI_CANONNAME);
+#endif
+#ifdef AI_NUMERICHOST
+ sock_define_const("AI_NUMERICHOST", AI_NUMERICHOST);
+#endif
+#ifdef AI_MASK
+ sock_define_const("AI_MASK", AI_MASK);
+#endif
+#ifdef AI_ALL
+ sock_define_const("AI_ALL", AI_ALL);
+#endif
+#ifdef AI_V4MAPPED_CFG
+ sock_define_const("AI_V4MAPPED_CFG", AI_V4MAPPED_CFG);
+#endif
+#ifdef AI_ADDRCONFIG
+ sock_define_const("AI_ADDRCONFIG", AI_ADDRCONFIG);
+#endif
+#ifdef AI_V4MAPPED
+ sock_define_const("AI_V4MAPPED", AI_V4MAPPED);
+#endif
+#ifdef AI_DEFAULT
+ sock_define_const("AI_DEFAULT", AI_DEFAULT);
+#endif
+#ifdef NI_MAXHOST
+ sock_define_const("NI_MAXHOST", NI_MAXHOST);
+#endif
+#ifdef NI_MAXSERV
+ sock_define_const("NI_MAXSERV", NI_MAXSERV);
+#endif
+#ifdef NI_NOFQDN
+ sock_define_const("NI_NOFQDN", NI_NOFQDN);
+#endif
+#ifdef NI_NUMERICHOST
+ sock_define_const("NI_NUMERICHOST", NI_NUMERICHOST);
+#endif
+#ifdef NI_NAMEREQD
+ sock_define_const("NI_NAMEREQD", NI_NAMEREQD);
+#endif
+#ifdef NI_NUMERICSERV
+ sock_define_const("NI_NUMERICSERV", NI_NUMERICSERV);
+#endif
+#ifdef NI_DGRAM
+ sock_define_const("NI_DGRAM", NI_DGRAM);
+#endif
+#ifdef SHUT_RD
+ sock_define_const("SHUT_RD", SHUT_RD);
+#else
+ sock_define_const("SHUT_RD", 0);
+#endif
+#ifdef SHUT_WR
+ sock_define_const("SHUT_WR", SHUT_WR);
+#else
+ sock_define_const("SHUT_WR", 1);
+#endif
+#ifdef SHUT_RDWR
+ sock_define_const("SHUT_RDWR", SHUT_RDWR);
+#else
+ sock_define_const("SHUT_RDWR", 2);
#endif
}
diff --git a/ext/socket/sockport.h b/ext/socket/sockport.h
index 5f2fd24530..e1cddf53f4 100644
--- a/ext/socket/sockport.h
+++ b/ext/socket/sockport.h
@@ -3,6 +3,7 @@
sockport.h -
$Author$
+ $Date$
created at: Fri Apr 30 23:19:34 JST 1999
************************************************/
@@ -10,34 +11,25 @@
#ifndef SOCKPORT_H
#define SOCKPORT_H
-#ifdef SA_LEN
-# define SS_LEN(ss) (ss)->ss_len
-#else
+#ifndef SA_LEN
# ifdef HAVE_SA_LEN
# define SA_LEN(sa) (sa)->sa_len
-# define SS_LEN(ss) (ss)->ss_len
# else
-# ifdef AF_INET6
+# ifdef INET6
# define SA_LEN(sa) \
(((sa)->sa_family == AF_INET6) ? sizeof(struct sockaddr_in6) \
: sizeof(struct sockaddr))
-# define SS_LEN(ss) \
- (((ss)->ss_family == AF_INET6) ? sizeof(struct sockaddr_in6) \
- : sizeof(struct sockaddr))
# else
/* by tradition, sizeof(struct sockaddr) covers most of the sockaddrs */
# define SA_LEN(sa) (sizeof(struct sockaddr))
-# define SS_LEN(ss) (sizeof(struct sockaddr))
# endif
# endif
#endif
#ifdef HAVE_SA_LEN
-# define SET_SA_LEN(sa, len) (void)((sa)->sa_len = (len))
-# define SET_SS_LEN(ss, len) (void)((ss)->ss_len = (len))
+# define SET_SA_LEN(sa, len) (sa)->sa_len = (len)
#else
-# define SET_SA_LEN(sa, len) (void)(len)
-# define SET_SS_LEN(ss, len) (void)(len)
+# define SET_SA_LEN(sa, len) (len)
#endif
#ifdef HAVE_SIN_LEN
diff --git a/ext/socket/sockssocket.c b/ext/socket/sockssocket.c
deleted file mode 100644
index 71836f704d..0000000000
--- a/ext/socket/sockssocket.c
+++ /dev/null
@@ -1,56 +0,0 @@
-/************************************************
-
- sockssocket.c -
-
- created at: Thu Mar 31 12:21:29 JST 1994
-
- Copyright (C) 1993-2007 Yukihiro Matsumoto
-
-************************************************/
-
-#include "rubysocket.h"
-
-#ifdef SOCKS
-static VALUE
-socks_init(VALUE sock, VALUE host, VALUE serv)
-{
- static int init = 0;
-
- if (init == 0) {
- SOCKSinit("ruby");
- init = 1;
- }
-
- return rsock_init_inetsock(sock, host, serv, Qnil, Qnil, INET_SOCKS);
-}
-
-#ifdef SOCKS5
-static VALUE
-socks_s_close(VALUE sock)
-{
- rb_io_t *fptr;
-
- if (rb_safe_level() >= 4 && !OBJ_TAINTED(sock)) {
- rb_raise(rb_eSecurityError, "Insecure: can't close socket");
- }
- GetOpenFile(sock, fptr);
- shutdown(fptr->fd, 2);
- return rb_io_close(sock);
-}
-#endif
-#endif
-
-/*
- * SOCKSSocket class
- */
-void
-Init_sockssocket(void)
-{
-#ifdef SOCKS
- rb_cSOCKSSocket = rb_define_class("SOCKSSocket", rb_cTCPSocket);
- rb_define_method(rb_cSOCKSSocket, "initialize", socks_init, 2);
-#ifdef SOCKS5
- rb_define_method(rb_cSOCKSSocket, "close", socks_s_close, 0);
-#endif
-#endif
-}
diff --git a/ext/socket/tcpserver.c b/ext/socket/tcpserver.c
deleted file mode 100644
index 59cd7dd3cc..0000000000
--- a/ext/socket/tcpserver.c
+++ /dev/null
@@ -1,142 +0,0 @@
-/************************************************
-
- tcpserver.c -
-
- created at: Thu Mar 31 12:21:29 JST 1994
-
- Copyright (C) 1993-2007 Yukihiro Matsumoto
-
-************************************************/
-
-#include "rubysocket.h"
-
-/*
- * call-seq:
- * TCPServer.new([hostname,] port) => tcpserver
- *
- * Creates a new server socket bound to _port_.
- *
- * If _hostname_ is given, the socket is bound to it.
- *
- * serv = TCPServer.new("127.0.0.1", 28561)
- * s = serv.accept
- * s.puts Time.now
- * s.close
- */
-static VALUE
-tcp_svr_init(int argc, VALUE *argv, VALUE sock)
-{
- VALUE hostname, port;
-
- rb_scan_args(argc, argv, "011", &hostname, &port);
- return rsock_init_inetsock(sock, hostname, port, Qnil, Qnil, INET_SERVER);
-}
-
-/*
- * call-seq:
- * tcpserver.accept => tcpsocket
- *
- * TCPServer.open("127.0.0.1", 14641) {|serv|
- * s = serv.accept
- * s.puts Time.now
- * s.close
- * }
- *
- */
-static VALUE
-tcp_accept(VALUE sock)
-{
- rb_io_t *fptr;
- struct sockaddr_storage from;
- socklen_t fromlen;
-
- GetOpenFile(sock, fptr);
- fromlen = sizeof(from);
- return rsock_s_accept(rb_cTCPSocket, fptr->fd,
- (struct sockaddr*)&from, &fromlen);
-}
-
-/*
- * call-seq:
- * tcpserver.accept_nonblock => tcpsocket
- *
- * Accepts an incoming connection using accept(2) after
- * O_NONBLOCK is set for the underlying file descriptor.
- * It returns an accepted TCPSocket for the incoming connection.
- *
- * === Example
- * require 'socket'
- * serv = TCPServer.new(2202)
- * begin # emulate blocking accept
- * sock = serv.accept_nonblock
- * rescue IO::WaitReadable, Errno::EINTR
- * IO.select([serv])
- * retry
- * end
- * # sock is an accepted socket.
- *
- * Refer to Socket#accept for the exceptions that may be thrown if the call
- * to TCPServer#accept_nonblock fails.
- *
- * TCPServer#accept_nonblock may raise any error corresponding to accept(2) failure,
- * including Errno::EWOULDBLOCK.
- *
- * If the exception is Errno::EWOULDBLOCK, Errno::AGAIN, Errno::ECONNABORTED, Errno::EPROTO,
- * it is extended by IO::WaitReadable.
- * So IO::WaitReadable can be used to rescue the exceptions for retrying accept_nonblock.
- *
- * === See
- * * TCPServer#accept
- * * Socket#accept
- */
-static VALUE
-tcp_accept_nonblock(VALUE sock)
-{
- rb_io_t *fptr;
- struct sockaddr_storage from;
- socklen_t fromlen;
-
- GetOpenFile(sock, fptr);
- fromlen = sizeof(from);
- return rsock_s_accept_nonblock(rb_cTCPSocket, fptr,
- (struct sockaddr *)&from, &fromlen);
-}
-
-/*
- * call-seq:
- * tcpserver.sysaccept => file_descriptor
- *
- * Returns a file descriptor of a accepted connection.
- *
- * TCPServer.open("127.0.0.1", 28561) {|serv|
- * fd = serv.sysaccept
- * s = IO.for_fd(fd)
- * s.puts Time.now
- * s.close
- * }
- *
- */
-static VALUE
-tcp_sysaccept(VALUE sock)
-{
- rb_io_t *fptr;
- struct sockaddr_storage from;
- socklen_t fromlen;
-
- GetOpenFile(sock, fptr);
- fromlen = sizeof(from);
- return rsock_s_accept(0, fptr->fd, (struct sockaddr*)&from, &fromlen);
-}
-
-/*
- * TCPServer class
- */
-void
-Init_tcpserver(void)
-{
- rb_cTCPServer = rb_define_class("TCPServer", rb_cTCPSocket);
- rb_define_method(rb_cTCPServer, "accept", tcp_accept, 0);
- rb_define_method(rb_cTCPServer, "accept_nonblock", tcp_accept_nonblock, 0);
- rb_define_method(rb_cTCPServer, "sysaccept", tcp_sysaccept, 0);
- rb_define_method(rb_cTCPServer, "initialize", tcp_svr_init, -1);
-}
diff --git a/ext/socket/tcpsocket.c b/ext/socket/tcpsocket.c
deleted file mode 100644
index 1ab62459d1..0000000000
--- a/ext/socket/tcpsocket.c
+++ /dev/null
@@ -1,67 +0,0 @@
-/************************************************
-
- tcpsocket.c -
-
- created at: Thu Mar 31 12:21:29 JST 1994
-
- Copyright (C) 1993-2007 Yukihiro Matsumoto
-
-************************************************/
-
-#include "rubysocket.h"
-
-/*
- * call-seq:
- * TCPSocket.new(remote_host, remote_port, local_host=nil, local_port=nil)
- *
- * Opens a TCP connection to +remote_host+ on +remote_port+. If +local_host+
- * and +local_port+ are specified, then those parameters are used on the local
- * end to establish the connection.
- */
-static VALUE
-tcp_init(int argc, VALUE *argv, VALUE sock)
-{
- VALUE remote_host, remote_serv;
- VALUE local_host, local_serv;
-
- rb_scan_args(argc, argv, "22", &remote_host, &remote_serv,
- &local_host, &local_serv);
-
- return rsock_init_inetsock(sock, remote_host, remote_serv,
- local_host, local_serv, INET_CLIENT);
-}
-
-static VALUE
-tcp_sockaddr(struct sockaddr *addr, size_t len)
-{
- return rsock_make_ipaddr(addr);
-}
-
-/*
- * call-seq:
- * TCPSocket.gethostbyname(hostname) => [official_hostname, alias_hostnames, address_family, *address_list]
- *
- * Lookups host information by _hostname_.
- *
- * TCPSocket.gethostbyname("localhost")
- * #=> ["localhost", ["hal"], 2, "127.0.0.1"]
- *
- */
-static VALUE
-tcp_s_gethostbyname(VALUE obj, VALUE host)
-{
- rb_secure(3);
- return rsock_make_hostent(host, rsock_addrinfo(host, Qnil, SOCK_STREAM, AI_CANONNAME),
- tcp_sockaddr);
-}
-
-/*
- * TCPSocket class
- */
-void
-Init_tcpsocket(void)
-{
- rb_cTCPSocket = rb_define_class("TCPSocket", rb_cIPSocket);
- rb_define_singleton_method(rb_cTCPSocket, "gethostbyname", tcp_s_gethostbyname, 1);
- rb_define_method(rb_cTCPSocket, "initialize", tcp_init, -1);
-}
diff --git a/ext/socket/udpsocket.c b/ext/socket/udpsocket.c
deleted file mode 100644
index ae1f70eb10..0000000000
--- a/ext/socket/udpsocket.c
+++ /dev/null
@@ -1,260 +0,0 @@
-/************************************************
-
- udpsocket.c -
-
- created at: Thu Mar 31 12:21:29 JST 1994
-
- Copyright (C) 1993-2007 Yukihiro Matsumoto
-
-************************************************/
-
-#include "rubysocket.h"
-
-/*
- * call-seq:
- * UDPSocket.new([address_family]) => socket
- *
- * Creates a new UDPSocket object.
- *
- * _address_family_ should be an integer, a string or a symbol:
- * Socket::AF_INET, "AF_INET", :INET, etc.
- *
- * UDPSocket.new #=> #<UDPSocket:fd 3>
- * UDPSocket.new(Socket::AF_INET6) #=> #<UDPSocket:fd 4>
- *
- */
-static VALUE
-udp_init(int argc, VALUE *argv, VALUE sock)
-{
- VALUE arg;
- int family = AF_INET;
- int fd;
-
- rb_secure(3);
- if (rb_scan_args(argc, argv, "01", &arg) == 1) {
- family = rsock_family_arg(arg);
- }
- fd = rsock_socket(family, SOCK_DGRAM, 0);
- if (fd < 0) {
- rb_sys_fail("socket(2) - udp");
- }
-
- return rsock_init_sock(sock, fd);
-}
-
-struct udp_arg
-{
- struct addrinfo *res;
- int fd;
-};
-
-static VALUE
-udp_connect_internal(struct udp_arg *arg)
-{
- int fd = arg->fd;
- struct addrinfo *res;
-
- for (res = arg->res; res; res = res->ai_next) {
- if (rsock_connect(fd, res->ai_addr, res->ai_addrlen, 0) >= 0) {
- return Qtrue;
- }
- }
- return Qfalse;
-}
-
-/*
- * call-seq:
- * udpsocket.connect(host, port) => 0
- *
- * Connects _udpsocket_ to _host_:_port_.
- *
- * This makes possible to send without destination address.
- *
- * u1 = UDPSocket.new
- * u1.bind("127.0.0.1", 4913)
- * u2 = UDPSocket.new
- * u2.connect("127.0.0.1", 4913)
- * u2.send "uuuu", 0
- * p u1.recvfrom(10) #=> ["uuuu", ["AF_INET", 33230, "localhost", "127.0.0.1"]]
- *
- */
-static VALUE
-udp_connect(VALUE sock, VALUE host, VALUE port)
-{
- rb_io_t *fptr;
- struct udp_arg arg;
- VALUE ret;
-
- rb_secure(3);
- arg.res = rsock_addrinfo(host, port, SOCK_DGRAM, 0);
- GetOpenFile(sock, fptr);
- arg.fd = fptr->fd;
- ret = rb_ensure(udp_connect_internal, (VALUE)&arg,
- RUBY_METHOD_FUNC(freeaddrinfo), (VALUE)arg.res);
- if (!ret) rb_sys_fail("connect(2)");
- return INT2FIX(0);
-}
-
-/*
- * call-seq:
- * udpsocket.bind(host, port) #=> 0
- *
- * Binds _udpsocket_ to _host_:_port_.
- *
- * u1 = UDPSocket.new
- * u1.bind("127.0.0.1", 4913)
- * u1.send "message-to-self", 0, "127.0.0.1", 4913
- * p u1.recvfrom(10) #=> ["message-to", ["AF_INET", 4913, "localhost", "127.0.0.1"]]
- *
- */
-static VALUE
-udp_bind(VALUE sock, VALUE host, VALUE port)
-{
- rb_io_t *fptr;
- struct addrinfo *res0, *res;
-
- rb_secure(3);
- res0 = rsock_addrinfo(host, port, SOCK_DGRAM, 0);
- GetOpenFile(sock, fptr);
- for (res = res0; res; res = res->ai_next) {
- if (bind(fptr->fd, res->ai_addr, res->ai_addrlen) < 0) {
- continue;
- }
- freeaddrinfo(res0);
- return INT2FIX(0);
- }
- freeaddrinfo(res0);
- rb_sys_fail("bind(2)");
- return INT2FIX(0);
-}
-
-/*
- * call-seq:
- * udpsocket.send(mesg, flags, host, port) => numbytes_sent
- * udpsocket.send(mesg, flags, sockaddr_to) => numbytes_sent
- * udpsocket.send(mesg, flags) => numbytes_sent
- *
- * Sends _mesg_ via _udpsocket_.
- *
- * _flags_ should be a bitwise OR of Socket::MSG_* constants.
- *
- * u1 = UDPSocket.new
- * u1.bind("127.0.0.1", 4913)
- *
- * u2 = UDPSocket.new
- * u2.send "hi", 0, "127.0.0.1", 4913
- *
- * mesg, addr = u1.recvfrom(10)
- * u1.send mesg, 0, addr[3], addr[1]
- *
- * p u2.recv(100) #=> "hi"
- *
- */
-static VALUE
-udp_send(int argc, VALUE *argv, VALUE sock)
-{
- VALUE flags, host, port;
- rb_io_t *fptr;
- int n;
- struct addrinfo *res0, *res;
- struct rsock_send_arg arg;
-
- if (argc == 2 || argc == 3) {
- return rsock_bsock_send(argc, argv, sock);
- }
- rb_secure(4);
- rb_scan_args(argc, argv, "4", &arg.mesg, &flags, &host, &port);
-
- StringValue(arg.mesg);
- res0 = rsock_addrinfo(host, port, SOCK_DGRAM, 0);
- GetOpenFile(sock, fptr);
- arg.fd = fptr->fd;
- arg.flags = NUM2INT(flags);
- for (res = res0; res; res = res->ai_next) {
- retry:
- arg.to = res->ai_addr;
- arg.tolen = res->ai_addrlen;
- rb_thread_fd_writable(arg.fd);
- n = (int)BLOCKING_REGION(rsock_sendto_blocking, &arg);
- if (n >= 0) {
- freeaddrinfo(res0);
- return INT2FIX(n);
- }
- if (rb_io_wait_writable(fptr->fd)) {
- goto retry;
- }
- }
- freeaddrinfo(res0);
- rb_sys_fail("sendto(2)");
- return INT2FIX(n);
-}
-
-/*
- * 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 ommitted, 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(int argc, VALUE *argv, VALUE sock)
-{
- return rsock_s_recvfrom_nonblock(sock, argc, argv, RECV_IP);
-}
-
-/*
- * UDPSocket class
- */
-void
-Init_udpsocket(void)
-{
- rb_cUDPSocket = rb_define_class("UDPSocket", rb_cIPSocket);
- rb_define_method(rb_cUDPSocket, "initialize", udp_init, -1);
- rb_define_method(rb_cUDPSocket, "connect", udp_connect, 2);
- rb_define_method(rb_cUDPSocket, "bind", udp_bind, 2);
- rb_define_method(rb_cUDPSocket, "send", udp_send, -1);
- rb_define_method(rb_cUDPSocket, "recvfrom_nonblock", udp_recvfrom_nonblock, -1);
-}
-
diff --git a/ext/socket/unixserver.c b/ext/socket/unixserver.c
deleted file mode 100644
index fa41cba02a..0000000000
--- a/ext/socket/unixserver.c
+++ /dev/null
@@ -1,151 +0,0 @@
-/************************************************
-
- unixserver.c -
-
- created at: Thu Mar 31 12:21:29 JST 1994
-
- Copyright (C) 1993-2007 Yukihiro Matsumoto
-
-************************************************/
-
-#include "rubysocket.h"
-
-#ifdef HAVE_SYS_UN_H
-/*
- * call-seq:
- * UNIXServer.new(path) => unixserver
- *
- * Creates a new UNIX server socket bound to _path_.
- *
- * serv = UNIXServer.new("/tmp/sock")
- * s = serv.accept
- * p s.read
- */
-static VALUE
-unix_svr_init(VALUE sock, VALUE path)
-{
- return rsock_init_unixsock(sock, path, 1);
-}
-
-/*
- * call-seq:
- * unixserver.accept => unixsocket
- *
- * Accepts a new connection.
- * It returns new UNIXSocket object.
- *
- * UNIXServer.open("/tmp/sock") {|serv|
- * UNIXSocket.open("/tmp/sock") {|c|
- * s = serv.accept
- * s.puts "hi"
- * s.close
- * p c.read #=> "hi\n"
- * }
- * }
- *
- */
-static VALUE
-unix_accept(VALUE sock)
-{
- rb_io_t *fptr;
- struct sockaddr_un from;
- socklen_t fromlen;
-
- GetOpenFile(sock, fptr);
- fromlen = sizeof(struct sockaddr_un);
- return rsock_s_accept(rb_cUNIXSocket, fptr->fd,
- (struct sockaddr*)&from, &fromlen);
-}
-
-/*
- * call-seq:
- * unixserver.accept_nonblock => unixsocket
- *
- * Accepts an incoming connection using accept(2) after
- * O_NONBLOCK is set for the underlying file descriptor.
- * It returns an accepted UNIXSocket for the incoming connection.
- *
- * === Example
- * require 'socket'
- * serv = UNIXServer.new("/tmp/sock")
- * begin # emulate blocking accept
- * sock = serv.accept_nonblock
- * rescue IO::WaitReadable, Errno::EINTR
- * IO.select([serv])
- * retry
- * end
- * # sock is an accepted socket.
- *
- * Refer to Socket#accept for the exceptions that may be thrown if the call
- * to UNIXServer#accept_nonblock fails.
- *
- * UNIXServer#accept_nonblock may raise any error corresponding to accept(2) failure,
- * including Errno::EWOULDBLOCK.
- *
- * If the exception is Errno::EWOULDBLOCK, Errno::AGAIN, Errno::ECONNABORTED or Errno::EPROTO,
- * it is extended by IO::WaitReadable.
- * So IO::WaitReadable can be used to rescue the exceptions for retrying accept_nonblock.
- *
- * === See
- * * UNIXServer#accept
- * * Socket#accept
- */
-static VALUE
-unix_accept_nonblock(VALUE sock)
-{
- rb_io_t *fptr;
- struct sockaddr_un from;
- socklen_t fromlen;
-
- GetOpenFile(sock, fptr);
- fromlen = sizeof(from);
- return rsock_s_accept_nonblock(rb_cUNIXSocket, fptr,
- (struct sockaddr *)&from, &fromlen);
-}
-
-/*
- * call-seq:
- * unixserver.sysaccept => file_descriptor
- *
- * Accepts a new connection.
- * It returns the new file descriptor which is an integer.
- *
- * UNIXServer.open("/tmp/sock") {|serv|
- * UNIXSocket.open("/tmp/sock") {|c|
- * fd = serv.sysaccept
- * s = IO.new(fd)
- * s.puts "hi"
- * s.close
- * p c.read #=> "hi\n"
- * }
- * }
- *
- */
-static VALUE
-unix_sysaccept(VALUE sock)
-{
- rb_io_t *fptr;
- struct sockaddr_un from;
- socklen_t fromlen;
-
- GetOpenFile(sock, fptr);
- fromlen = sizeof(struct sockaddr_un);
- return rsock_s_accept(0, fptr->fd, (struct sockaddr*)&from, &fromlen);
-}
-
-#endif
-
-/*
- * UNIXServer class
- */
-void
-Init_unixserver(void)
-{
-#ifdef HAVE_SYS_UN_H
- rb_cUNIXServer = rb_define_class("UNIXServer", rb_cUNIXSocket);
- rb_define_method(rb_cUNIXServer, "initialize", unix_svr_init, 1);
- rb_define_method(rb_cUNIXServer, "accept", unix_accept, 0);
- rb_define_method(rb_cUNIXServer, "accept_nonblock", unix_accept_nonblock, 0);
- rb_define_method(rb_cUNIXServer, "sysaccept", unix_sysaccept, 0);
-#endif
-}
diff --git a/ext/socket/unixsocket.c b/ext/socket/unixsocket.c
deleted file mode 100644
index df1a11d094..0000000000
--- a/ext/socket/unixsocket.c
+++ /dev/null
@@ -1,505 +0,0 @@
-/************************************************
-
- unixsocket.c -
-
- created at: Thu Mar 31 12:21:29 JST 1994
-
- Copyright (C) 1993-2007 Yukihiro Matsumoto
-
-************************************************/
-
-#include "rubysocket.h"
-
-#ifdef HAVE_SYS_UN_H
-struct unixsock_arg {
- struct sockaddr_un *sockaddr;
- int fd;
-};
-
-static VALUE
-unixsock_connect_internal(struct unixsock_arg *arg)
-{
- return (VALUE)rsock_connect(arg->fd, (struct sockaddr*)arg->sockaddr,
- sizeof(*arg->sockaddr), 0);
-}
-
-VALUE
-rsock_init_unixsock(VALUE sock, VALUE path, int server)
-{
- struct sockaddr_un sockaddr;
- int fd, status;
- rb_io_t *fptr;
-
- SafeStringValue(path);
- fd = rsock_socket(AF_UNIX, SOCK_STREAM, 0);
- if (fd < 0) {
- rb_sys_fail("socket(2)");
- }
-
- MEMZERO(&sockaddr, struct sockaddr_un, 1);
- sockaddr.sun_family = AF_UNIX;
- if (sizeof(sockaddr.sun_path) <= (size_t)RSTRING_LEN(path)) {
- rb_raise(rb_eArgError, "too long unix socket path (max: %dbytes)",
- (int)sizeof(sockaddr.sun_path)-1);
- }
- memcpy(sockaddr.sun_path, RSTRING_PTR(path), RSTRING_LEN(path));
-
- if (server) {
- status = bind(fd, (struct sockaddr*)&sockaddr, sizeof(sockaddr));
- }
- else {
- int prot;
- struct unixsock_arg arg;
- arg.sockaddr = &sockaddr;
- arg.fd = fd;
- status = rb_protect((VALUE(*)(VALUE))unixsock_connect_internal,
- (VALUE)&arg, &prot);
- if (prot) {
- close(fd);
- rb_jump_tag(prot);
- }
- }
-
- if (status < 0) {
- close(fd);
- rb_sys_fail(sockaddr.sun_path);
- }
-
- if (server) listen(fd, 5);
-
- rsock_init_sock(sock, fd);
- if (server) {
- GetOpenFile(sock, fptr);
- fptr->pathv = rb_str_new_frozen(path);
- }
-
- return sock;
-}
-
-/*
- * call-seq:
- * UNIXSocket.new(path) => unixsocket
- *
- * Creates a new UNIX client socket connected to _path_.
- *
- * s = UNIXSocket.new("/tmp/sock")
- * s.send "hello", 0
- *
- */
-static VALUE
-unix_init(VALUE sock, VALUE path)
-{
- return rsock_init_unixsock(sock, path, 0);
-}
-
-/*
- * call-seq:
- * unixsocket.path => path
- *
- * Returns the path of the local address of unixsocket.
- *
- * s = UNIXServer.new("/tmp/sock")
- * p s.path #=> "/tmp/sock"
- *
- */
-static VALUE
-unix_path(VALUE sock)
-{
- rb_io_t *fptr;
-
- GetOpenFile(sock, fptr);
- if (NIL_P(fptr->pathv)) {
- struct sockaddr_un addr;
- socklen_t len = sizeof(addr);
- if (getsockname(fptr->fd, (struct sockaddr*)&addr, &len) < 0)
- rb_sys_fail(0);
- fptr->pathv = rb_obj_freeze(rb_str_new_cstr(rsock_unixpath(&addr, len)));
- }
- return rb_str_dup(fptr->pathv);
-}
-
-/*
- * call-seq:
- * unixsocket.recvfrom(maxlen [, flags]) => [mesg, unixaddress]
- *
- * Receives a message via _unixsocket_.
- *
- * _maxlen_ is the maximum number of bytes to receive.
- *
- * _flags_ should be a bitwise OR of Socket::MSG_* constants.
- *
- * s1 = Socket.new(:UNIX, :DGRAM, 0)
- * s1_ai = Addrinfo.unix("/tmp/sock1")
- * s1.bind(s1_ai)
- *
- * s2 = Socket.new(:UNIX, :DGRAM, 0)
- * s2_ai = Addrinfo.unix("/tmp/sock2")
- * s2.bind(s2_ai)
- * s3 = UNIXSocket.for_fd(s2.fileno)
- *
- * s1.send "a", 0, s2_ai
- * p s3.recvfrom(10) #=> ["a", ["AF_UNIX", "/tmp/sock1"]]
- *
- */
-static VALUE
-unix_recvfrom(int argc, VALUE *argv, VALUE sock)
-{
- return rsock_s_recvfrom(sock, argc, argv, RECV_UNIX);
-}
-
-#if defined(HAVE_ST_MSG_CONTROL) && defined(SCM_RIGHTS)
-#define FD_PASSING_BY_MSG_CONTROL 1
-#else
-#define FD_PASSING_BY_MSG_CONTROL 0
-#endif
-
-#if defined(HAVE_ST_MSG_ACCRIGHTS)
-#define FD_PASSING_BY_MSG_ACCRIGHTS 1
-#else
-#define FD_PASSING_BY_MSG_ACCRIGHTS 0
-#endif
-
-struct iomsg_arg {
- int fd;
- struct msghdr msg;
-};
-
-static VALUE
-sendmsg_blocking(void *data)
-{
- struct iomsg_arg *arg = data;
- return sendmsg(arg->fd, &arg->msg, 0);
-}
-
-#if defined(HAVE_SENDMSG) && (FD_PASSING_BY_MSG_CONTROL || FD_PASSING_BY_MSG_ACCRIGHTS)
-/*
- * call-seq:
- * unixsocket.send_io(io) => nil
- *
- * Sends _io_ as file descriptor passing.
- *
- * s1, s2 = UNIXSocket.pair
- *
- * s1.send_io STDOUT
- * stdout = s2.recv_io
- *
- * p STDOUT.fileno #=> 1
- * p stdout.fileno #=> 6
- *
- * stdout.puts "hello" # outputs "hello\n" to standard output.
- */
-static VALUE
-unix_send_io(VALUE sock, VALUE val)
-{
- int fd;
- rb_io_t *fptr;
- struct iomsg_arg arg;
- struct iovec vec[1];
- char buf[1];
-
-#if FD_PASSING_BY_MSG_CONTROL
- struct {
- struct cmsghdr hdr;
- char pad[8+sizeof(int)+8];
- } cmsg;
-#endif
-
- if (rb_obj_is_kind_of(val, rb_cIO)) {
- rb_io_t *valfptr;
- GetOpenFile(val, valfptr);
- fd = valfptr->fd;
- }
- else if (FIXNUM_P(val)) {
- fd = FIX2INT(val);
- }
- else {
- rb_raise(rb_eTypeError, "neither IO nor file descriptor");
- }
-
- GetOpenFile(sock, fptr);
-
- arg.msg.msg_name = NULL;
- arg.msg.msg_namelen = 0;
-
- /* Linux and Solaris doesn't work if msg_iov is NULL. */
- buf[0] = '\0';
- vec[0].iov_base = buf;
- vec[0].iov_len = 1;
- arg.msg.msg_iov = vec;
- arg.msg.msg_iovlen = 1;
-
-#if FD_PASSING_BY_MSG_CONTROL
- arg.msg.msg_control = (caddr_t)&cmsg;
- arg.msg.msg_controllen = CMSG_LEN(sizeof(int));
- arg.msg.msg_flags = 0;
- MEMZERO((char*)&cmsg, char, sizeof(cmsg));
- cmsg.hdr.cmsg_len = CMSG_LEN(sizeof(int));
- cmsg.hdr.cmsg_level = SOL_SOCKET;
- cmsg.hdr.cmsg_type = SCM_RIGHTS;
- memcpy(CMSG_DATA(&cmsg.hdr), &fd, sizeof(int));
-#else
- arg.msg.msg_accrights = (caddr_t)&fd;
- arg.msg.msg_accrightslen = sizeof(fd);
-#endif
-
- arg.fd = fptr->fd;
- rb_thread_fd_writable(arg.fd);
- if ((int)BLOCKING_REGION(sendmsg_blocking, &arg) == -1)
- rb_sys_fail("sendmsg(2)");
-
- return Qnil;
-}
-#else
-#define unix_send_io rb_f_notimplement
-#endif
-
-static VALUE
-recvmsg_blocking(void *data)
-{
- struct iomsg_arg *arg = data;
- return recvmsg(arg->fd, &arg->msg, 0);
-}
-
-#if defined(HAVE_RECVMSG) && (FD_PASSING_BY_MSG_CONTROL || FD_PASSING_BY_MSG_ACCRIGHTS)
-/*
- * call-seq:
- * unixsocket.recv_io([klass [, mode]]) => io
- *
- * UNIXServer.open("/tmp/sock") {|serv|
- * UNIXSocket.open("/tmp/sock") {|c|
- * s = serv.accept
- *
- * c.send_io STDOUT
- * stdout = s.recv_io
- *
- * p STDOUT.fileno #=> 1
- * p stdout.fileno #=> 7
- *
- * stdout.puts "hello" # outputs "hello\n" to standard output.
- * }
- * }
- *
- */
-static VALUE
-unix_recv_io(int argc, VALUE *argv, VALUE sock)
-{
- VALUE klass, mode;
- rb_io_t *fptr;
- struct iomsg_arg arg;
- struct iovec vec[2];
- char buf[1];
-
- int fd;
-#if FD_PASSING_BY_MSG_CONTROL
- struct {
- struct cmsghdr hdr;
- char pad[8+sizeof(int)+8];
- } cmsg;
-#endif
-
- rb_scan_args(argc, argv, "02", &klass, &mode);
- if (argc == 0)
- klass = rb_cIO;
- if (argc <= 1)
- mode = Qnil;
-
- GetOpenFile(sock, fptr);
-
- arg.msg.msg_name = NULL;
- arg.msg.msg_namelen = 0;
-
- vec[0].iov_base = buf;
- vec[0].iov_len = sizeof(buf);
- arg.msg.msg_iov = vec;
- arg.msg.msg_iovlen = 1;
-
-#if FD_PASSING_BY_MSG_CONTROL
- arg.msg.msg_control = (caddr_t)&cmsg;
- arg.msg.msg_controllen = CMSG_SPACE(sizeof(int));
- arg.msg.msg_flags = 0;
- cmsg.hdr.cmsg_len = CMSG_LEN(sizeof(int));
- cmsg.hdr.cmsg_level = SOL_SOCKET;
- cmsg.hdr.cmsg_type = SCM_RIGHTS;
- fd = -1;
- memcpy(CMSG_DATA(&cmsg.hdr), &fd, sizeof(int));
-#else
- arg.msg.msg_accrights = (caddr_t)&fd;
- arg.msg.msg_accrightslen = sizeof(fd);
- fd = -1;
-#endif
-
- arg.fd = fptr->fd;
- rb_thread_wait_fd(arg.fd);
- if ((int)BLOCKING_REGION(recvmsg_blocking, &arg) == -1)
- rb_sys_fail("recvmsg(2)");
-
-#if FD_PASSING_BY_MSG_CONTROL
- if (arg.msg.msg_controllen < sizeof(struct cmsghdr)) {
- 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));
- }
- if (cmsg.hdr.cmsg_level != SOL_SOCKET) {
- rb_raise(rb_eSocket,
- "file descriptor was not passed (cmsg_level=%d, %d expected)",
- cmsg.hdr.cmsg_level, SOL_SOCKET);
- }
- if (cmsg.hdr.cmsg_type != SCM_RIGHTS) {
- rb_raise(rb_eSocket,
- "file descriptor was not passed (cmsg_type=%d, %d expected)",
- cmsg.hdr.cmsg_type, SCM_RIGHTS);
- }
- if (arg.msg.msg_controllen < CMSG_LEN(sizeof(int))) {
- rb_raise(rb_eSocket,
- "file descriptor was not passed (msg_controllen=%d smaller than CMSG_LEN(sizeof(int))=%d)",
- (int)arg.msg.msg_controllen, (int)CMSG_LEN(sizeof(int)));
- }
- if (CMSG_SPACE(sizeof(int)) < arg.msg.msg_controllen) {
- rb_raise(rb_eSocket,
- "file descriptor was not passed (msg_controllen=%d bigger than CMSG_SPACE(sizeof(int))=%d)",
- (int)arg.msg.msg_controllen, (int)CMSG_SPACE(sizeof(int)));
- }
- if (cmsg.hdr.cmsg_len != CMSG_LEN(sizeof(int))) {
- rsock_discard_cmsg_resource(&arg.msg);
- rb_raise(rb_eSocket,
- "file descriptor was not passed (cmsg_len=%d, %d expected)",
- (int)cmsg.hdr.cmsg_len, (int)CMSG_LEN(sizeof(int)));
- }
-#else
- if (arg.msg.msg_accrightslen != sizeof(fd)) {
- rb_raise(rb_eSocket,
- "file descriptor was not passed (accrightslen) : %d != %d",
- arg.msg.msg_accrightslen, (int)sizeof(fd));
- }
-#endif
-
-#if FD_PASSING_BY_MSG_CONTROL
- memcpy(&fd, CMSG_DATA(&cmsg.hdr), sizeof(int));
-#endif
-
- if (klass == Qnil)
- return INT2FIX(fd);
- else {
- ID for_fd;
- int ff_argc;
- VALUE ff_argv[2];
- CONST_ID(for_fd, "for_fd");
- ff_argc = mode == Qnil ? 1 : 2;
- ff_argv[0] = INT2FIX(fd);
- ff_argv[1] = mode;
- return rb_funcall2(klass, for_fd, ff_argc, ff_argv);
- }
-}
-#else
-#define unix_recv_io rb_f_notimplement
-#endif
-
-/*
- * call-seq:
- * unixsocket.addr => [address_family, unix_path]
- *
- * Returns the local address as an array which contains
- * address_family and unix_path.
- *
- * Example
- * serv = UNIXServer.new("/tmp/sock")
- * p serv.addr #=> ["AF_UNIX", "/tmp/sock"]
- */
-static VALUE
-unix_addr(VALUE sock)
-{
- rb_io_t *fptr;
- struct sockaddr_un addr;
- socklen_t len = sizeof addr;
-
- GetOpenFile(sock, fptr);
-
- if (getsockname(fptr->fd, (struct sockaddr*)&addr, &len) < 0)
- rb_sys_fail("getsockname(2)");
- return rsock_unixaddr(&addr, len);
-}
-
-/*
- * call-seq:
- * unixsocket.peeraddr => [address_family, unix_path]
- *
- * Returns the remote address as an array which contains
- * address_family and unix_path.
- *
- * Example
- * serv = UNIXServer.new("/tmp/sock")
- * c = UNIXSocket.new("/tmp/sock")
- * p c.peeraddr #=> ["AF_UNIX", "/tmp/sock"]
- */
-static VALUE
-unix_peeraddr(VALUE sock)
-{
- rb_io_t *fptr;
- struct sockaddr_un addr;
- socklen_t len = sizeof addr;
-
- GetOpenFile(sock, fptr);
-
- if (getpeername(fptr->fd, (struct sockaddr*)&addr, &len) < 0)
- rb_sys_fail("getpeername(2)");
- return rsock_unixaddr(&addr, len);
-}
-
-/*
- * call-seq:
- * UNIXSocket.pair([type [, protocol]]) => [unixsocket1, unixsocket2]
- * UNIXSocket.socketpair([type [, protocol]]) => [unixsocket1, unixsocket2]
- *
- * Creates a pair of sockets connected each other.
- *
- * _socktype_ should be a socket type such as: :STREAM, :DGRAM, :RAW, etc.
- *
- * _protocol_ should be a protocol defined in the domain.
- * 0 is default protocol for the domain.
- *
- * s1, s2 = UNIXSocket.pair
- * s1.send "a", 0
- * s1.send "b", 0
- * p s2.recv(10) #=> "ab"
- *
- */
-static VALUE
-unix_s_socketpair(int argc, VALUE *argv, VALUE klass)
-{
- VALUE domain, type, protocol;
- domain = INT2FIX(PF_UNIX);
- VALUE args[3];
-
- rb_scan_args(argc, argv, "02", &type, &protocol);
- if (argc == 0)
- type = INT2FIX(SOCK_STREAM);
- if (argc <= 1)
- protocol = INT2FIX(0);
-
- args[0] = domain;
- args[1] = type;
- args[2] = protocol;
-
- return rsock_sock_s_socketpair(3, args, klass);
-}
-#endif
-
-/*
- * UNIXSocket class
- */
-void
-Init_unixsocket(void)
-{
-#ifdef HAVE_SYS_UN_H
- rb_cUNIXSocket = rb_define_class("UNIXSocket", rb_cBasicSocket);
- rb_define_method(rb_cUNIXSocket, "initialize", unix_init, 1);
- rb_define_method(rb_cUNIXSocket, "path", unix_path, 0);
- rb_define_method(rb_cUNIXSocket, "addr", unix_addr, 0);
- rb_define_method(rb_cUNIXSocket, "peeraddr", unix_peeraddr, 0);
- rb_define_method(rb_cUNIXSocket, "recvfrom", unix_recvfrom, -1);
- rb_define_method(rb_cUNIXSocket, "send_io", unix_send_io, 1);
- rb_define_method(rb_cUNIXSocket, "recv_io", unix_recv_io, -1);
- rb_define_singleton_method(rb_cUNIXSocket, "socketpair", unix_s_socketpair, -1);
- rb_define_singleton_method(rb_cUNIXSocket, "pair", unix_s_socketpair, -1);
-#endif
-}
diff --git a/ext/stringio/.cvsignore b/ext/stringio/.cvsignore
index 814345ece8..4088712231 100644
--- a/ext/stringio/.cvsignore
+++ b/ext/stringio/.cvsignore
@@ -1,4 +1,3 @@
Makefile
mkmf.log
*.def
-extconf.h
diff --git a/ext/stringio/README b/ext/stringio/README
index 10dd237de8..c4031f7e97 100644
--- a/ext/stringio/README
+++ b/ext/stringio/README
@@ -1,5 +1,6 @@
-*- rd -*-
$Author$
+$Date$
=begin
diff --git a/ext/stringio/depend b/ext/stringio/depend
index 338ebde529..cc9eae3f55 100644
--- a/ext/stringio/depend
+++ b/ext/stringio/depend
@@ -1,3 +1,2 @@
-stringio.o: stringio.c $(hdrdir)/ruby/ruby.h $(arch_hdrdir)/ruby/config.h \
- $(hdrdir)/ruby/defines.h $(hdrdir)/ruby/intern.h $(hdrdir)/ruby/io.h \
- $(hdrdir)/ruby/encoding.h
+stringio.o: stringio.c $(hdrdir)/ruby.h $(topdir)/config.h \
+ $(hdrdir)/defines.h $(hdrdir)/intern.h $(hdrdir)/rubyio.h
diff --git a/ext/stringio/stringio.c b/ext/stringio/stringio.c
index 7514264f6a..71b7b69f71 100644
--- a/ext/stringio/stringio.c
+++ b/ext/stringio/stringio.c
@@ -3,6 +3,7 @@
stringio.c -
$Author$
+ $Date$
$RoughId: stringio.c,v 1.13 2002/03/14 03:24:18 nobu Exp $
created at: Tue Feb 19 04:10:38 JST 2002
@@ -12,14 +13,16 @@
**********************************************************************/
#include "ruby.h"
-#include "ruby/io.h"
-#include "ruby/encoding.h"
+#include "rubyio.h"
+#include "re.h"
#if defined(HAVE_FCNTL_H) || defined(_WIN32)
#include <fcntl.h>
#elif defined(HAVE_SYS_FCNTL_H)
#include <sys/fcntl.h>
#endif
+#define STRIO_EOF FMODE_SYNC
+
struct StringIO {
VALUE string;
long pos;
@@ -28,9 +31,14 @@ struct StringIO {
int count;
};
+static struct StringIO* strio_alloc _((void));
static void strio_mark _((struct StringIO *));
static void strio_free _((struct StringIO *));
-static void strio_init(int, VALUE *, struct StringIO *);
+static struct StringIO* check_strio _((VALUE));
+static struct StringIO* get_strio _((VALUE));
+static struct StringIO* readable _((struct StringIO *));
+static struct StringIO* writable _((struct StringIO *));
+static void check_modifiable _((struct StringIO *));
#define IS_STRIO(obj) (RDATA(obj)->dmark == (RUBY_DATA_FUNC)strio_mark)
#define error_inval(msg) (errno = EINVAL, rb_sys_fail(msg))
@@ -48,7 +56,8 @@ strio_alloc()
}
static void
-strio_mark(struct StringIO *ptr)
+strio_mark(ptr)
+ struct StringIO *ptr;
{
if (ptr) {
rb_gc_mark(ptr->string);
@@ -56,7 +65,8 @@ strio_mark(struct StringIO *ptr)
}
static void
-strio_free(struct StringIO *ptr)
+strio_free(ptr)
+ struct StringIO *ptr;
{
if (--ptr->count <= 0) {
xfree(ptr);
@@ -64,7 +74,8 @@ strio_free(struct StringIO *ptr)
}
static struct StringIO*
-check_strio(VALUE self)
+check_strio(self)
+ VALUE self;
{
Check_Type(self, T_DATA);
if (!IS_STRIO(self)) {
@@ -75,7 +86,8 @@ check_strio(VALUE self)
}
static struct StringIO*
-get_strio(VALUE self)
+get_strio(self)
+ VALUE self;
{
struct StringIO *ptr = check_strio(self);
@@ -85,18 +97,6 @@ get_strio(VALUE self)
return ptr;
}
-static VALUE
-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;
- return rb_enc_str_new(RSTRING_PTR(str)+pos, len, enc);
-}
-
#define StringIO(obj) get_strio(obj)
#define CLOSED(ptr) (!((ptr)->flags & FMODE_READWRITE))
@@ -104,7 +104,8 @@ strio_substr(struct StringIO *ptr, long pos, long len)
#define WRITABLE(ptr) ((ptr)->flags & FMODE_WRITABLE)
static struct StringIO*
-readable(struct StringIO *ptr)
+readable(ptr)
+ struct StringIO *ptr;
{
if (!READABLE(ptr)) {
rb_raise(rb_eIOError, "not opened for reading");
@@ -113,7 +114,8 @@ readable(struct StringIO *ptr)
}
static struct StringIO*
-writable(struct StringIO *ptr)
+writable(ptr)
+ struct StringIO *ptr;
{
if (!WRITABLE(ptr)) {
rb_raise(rb_eIOError, "not opened for writing");
@@ -125,26 +127,97 @@ writable(struct StringIO *ptr)
}
static void
-check_modifiable(struct StringIO *ptr)
+check_modifiable(ptr)
+ struct StringIO *ptr;
{
if (OBJ_FROZEN(ptr->string)) {
rb_raise(rb_eIOError, "not modifiable string");
}
}
+static VALUE strio_s_allocate _((VALUE));
+static VALUE strio_s_open _((int, VALUE *, VALUE));
+static void strio_init _((int, VALUE *, struct StringIO *));
+static VALUE strio_initialize _((int, VALUE *, VALUE));
+static VALUE strio_finalize _((VALUE));
+static VALUE strio_self _((VALUE));
+static VALUE strio_false _((VALUE));
+static VALUE strio_nil _((VALUE));
+static VALUE strio_0 _((VALUE));
+static VALUE strio_first _((VALUE, VALUE));
+static VALUE strio_unimpl _((int, VALUE *, VALUE));
+static VALUE strio_get_string _((VALUE));
+static VALUE strio_set_string _((VALUE, VALUE));
+static VALUE strio_close _((VALUE));
+static VALUE strio_close_read _((VALUE));
+static VALUE strio_close_write _((VALUE));
+static VALUE strio_closed _((VALUE));
+static VALUE strio_closed_read _((VALUE));
+static VALUE strio_closed_write _((VALUE));
+static VALUE strio_eof _((VALUE));
+static VALUE strio_get_lineno _((VALUE));
+static VALUE strio_set_lineno _((VALUE, VALUE));
+static VALUE strio_get_pos _((VALUE));
+static VALUE strio_set_pos _((VALUE, VALUE));
+static VALUE strio_rewind _((VALUE));
+static VALUE strio_seek _((int, VALUE *, VALUE));
+static VALUE strio_get_sync _((VALUE));
+static VALUE strio_each_byte _((VALUE));
+static VALUE strio_each_char _((VALUE));
+static VALUE strio_getc _((VALUE));
+static VALUE strio_ungetc _((VALUE, VALUE));
+static VALUE strio_readchar _((VALUE));
+static VALUE strio_getline _((int, VALUE *, struct StringIO *));
+static VALUE strio_gets _((int, VALUE *, VALUE));
+static VALUE strio_readline _((int, VALUE *, VALUE));
+static VALUE strio_each _((int, VALUE *, VALUE));
+static VALUE strio_readlines _((int, VALUE *, VALUE));
+static VALUE strio_write _((VALUE, VALUE));
+static VALUE strio_putc _((VALUE, VALUE));
+static VALUE strio_read _((int, VALUE *, VALUE));
+static VALUE strio_size _((VALUE));
+static VALUE strio_truncate _((VALUE, VALUE));
+void Init_stringio _((void));
+
+/* Boyer-Moore search: copied from regex.c */
+static void bm_init_skip _((long *, const char *, long));
+static long bm_search _((const char *, long, const char *, long, const long *));
+
static VALUE
-strio_s_allocate(VALUE klass)
+strio_s_allocate(klass)
+ VALUE klass;
{
return Data_Wrap_Struct(klass, strio_mark, strio_free, 0);
}
/*
+ * call-seq: StringIO.open(string=""[, mode]) {|strio| ...}
+ *
+ * Equivalent to StringIO.new except that when it is called with a block, it
+ * yields with the new instance and closes it, and returns the result which
+ * returned from the block.
+ */
+static VALUE
+strio_s_open(argc, argv, klass)
+ int argc;
+ VALUE *argv;
+ VALUE klass;
+{
+ 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);
+}
+
+/*
* call-seq: StringIO.new(string=""[, mode])
*
* Creates new StringIO instance from with _string_ and _mode_.
*/
static VALUE
-strio_initialize(int argc, VALUE *argv, VALUE self)
+strio_initialize(argc, argv, self)
+ int argc;
+ VALUE *argv;
+ VALUE self;
{
struct StringIO *ptr = check_strio(self);
@@ -157,10 +230,13 @@ strio_initialize(int argc, VALUE *argv, VALUE self)
}
static void
-strio_init(int argc, VALUE *argv, struct StringIO *ptr)
+strio_init(argc, argv, ptr)
+ int argc;
+ VALUE *argv;
+ struct StringIO *ptr;
{
VALUE string, mode;
- int trunc = 0;
+ int trunc = Qfalse;
switch (rb_scan_args(argc, argv, "02", &string, &mode)) {
case 2:
@@ -188,17 +264,16 @@ strio_init(int argc, VALUE *argv, struct StringIO *ptr)
ptr->flags = OBJ_FROZEN(string) ? FMODE_READABLE : FMODE_READWRITE;
break;
case 0:
- string = rb_enc_str_new("", 0, rb_default_external_encoding());
+ string = rb_str_new("", 0);
ptr->flags = FMODE_READWRITE;
break;
}
ptr->string = string;
- ptr->pos = 0;
- ptr->lineno = 0;
}
static VALUE
-strio_finalize(VALUE self)
+strio_finalize(self)
+ VALUE self;
{
struct StringIO *ptr = StringIO(self);
ptr->string = Qnil;
@@ -207,25 +282,11 @@ strio_finalize(VALUE self)
}
/*
- * call-seq: StringIO.open(string=""[, mode]) {|strio| ...}
- *
- * Equivalent to StringIO.new except that when it is called with a block, it
- * yields with the new instance and closes it, and returns the result which
- * returned from the block.
- */
-static VALUE
-strio_s_open(int argc, VALUE *argv, VALUE klass)
-{
- 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);
-}
-
-/*
* Returns +false+. Just for compatibility to IO.
*/
static VALUE
-strio_false(VALUE self)
+strio_false(self)
+ VALUE self;
{
StringIO(self);
return Qfalse;
@@ -235,7 +296,8 @@ strio_false(VALUE self)
* Returns +nil+. Just for compatibility to IO.
*/
static VALUE
-strio_nil(VALUE self)
+strio_nil(self)
+ VALUE self;
{
StringIO(self);
return Qnil;
@@ -245,7 +307,8 @@ strio_nil(VALUE self)
* Returns *strio* itself. Just for compatibility to IO.
*/
static VALUE
-strio_self(VALUE self)
+strio_self(self)
+ VALUE self;
{
StringIO(self);
return self;
@@ -255,7 +318,8 @@ strio_self(VALUE self)
* Returns 0. Just for compatibility to IO.
*/
static VALUE
-strio_0(VALUE self)
+strio_0(self)
+ VALUE self;
{
StringIO(self);
return INT2FIX(0);
@@ -265,7 +329,8 @@ strio_0(VALUE self)
* Returns the argument unchanged. Just for compatibility to IO.
*/
static VALUE
-strio_first(VALUE self, VALUE arg)
+strio_first(self, arg)
+ VALUE self, arg;
{
StringIO(self);
return arg;
@@ -275,7 +340,10 @@ strio_first(VALUE self, VALUE arg)
* Raises NotImplementedError.
*/
static VALUE
-strio_unimpl(int argc, VALUE *argv, VALUE self)
+strio_unimpl(argc, argv, self)
+ int argc;
+ VALUE *argv;
+ VALUE self;
{
StringIO(self);
rb_notimplement();
@@ -288,7 +356,8 @@ strio_unimpl(int argc, VALUE *argv, VALUE self)
* Returns underlying String object, the subject of IO.
*/
static VALUE
-strio_get_string(VALUE self)
+strio_get_string(self)
+ VALUE self;
{
return StringIO(self)->string;
}
@@ -300,7 +369,8 @@ strio_get_string(VALUE self)
* Changes underlying String object, the subject of IO.
*/
static VALUE
-strio_set_string(VALUE self, VALUE string)
+strio_set_string(self, string)
+ VALUE self, string;
{
struct StringIO *ptr = StringIO(self);
@@ -321,7 +391,8 @@ strio_set_string(VALUE self, VALUE string)
* operations; an +IOError+ is raised if such an attempt is made.
*/
static VALUE
-strio_close(VALUE self)
+strio_close(self)
+ VALUE self;
{
struct StringIO *ptr = StringIO(self);
if (CLOSED(ptr)) {
@@ -339,7 +410,8 @@ strio_close(VALUE self)
* *strio* is not readable.
*/
static VALUE
-strio_close_read(VALUE self)
+strio_close_read(self)
+ VALUE self;
{
struct StringIO *ptr = StringIO(self);
if (!READABLE(ptr)) {
@@ -357,7 +429,8 @@ strio_close_read(VALUE self)
* *strio* is not writeable.
*/
static VALUE
-strio_close_write(VALUE self)
+strio_close_write(self)
+ VALUE self;
{
struct StringIO *ptr = StringIO(self);
if (!WRITABLE(ptr)) {
@@ -374,7 +447,8 @@ strio_close_write(VALUE self)
* Returns +true+ if *strio* is completely closed, +false+ otherwise.
*/
static VALUE
-strio_closed(VALUE self)
+strio_closed(self)
+ VALUE self;
{
struct StringIO *ptr = StringIO(self);
if (!CLOSED(ptr)) return Qfalse;
@@ -388,7 +462,8 @@ strio_closed(VALUE self)
* Returns +true+ if *strio* is not readable, +false+ otherwise.
*/
static VALUE
-strio_closed_read(VALUE self)
+strio_closed_read(self)
+ VALUE self;
{
struct StringIO *ptr = StringIO(self);
if (READABLE(ptr)) return Qfalse;
@@ -402,7 +477,8 @@ strio_closed_read(VALUE self)
* Returns +true+ if *strio* is not writable, +false+ otherwise.
*/
static VALUE
-strio_closed_write(VALUE self)
+strio_closed_write(self)
+ VALUE self;
{
struct StringIO *ptr = StringIO(self);
if (WRITABLE(ptr)) return Qfalse;
@@ -418,16 +494,18 @@ strio_closed_write(VALUE self)
* opened for reading or an +IOError+ will be raised.
*/
static VALUE
-strio_eof(VALUE self)
+strio_eof(self)
+ VALUE self;
{
struct StringIO *ptr = readable(StringIO(self));
- if (ptr->pos < RSTRING_LEN(ptr->string)) return Qfalse;
+ if (ptr->pos < RSTRING(ptr->string)->len) return Qfalse;
return Qtrue;
}
/* :nodoc: */
static VALUE
-strio_copy(VALUE copy, VALUE orig)
+strio_copy(copy, orig)
+ VALUE copy, orig;
{
struct StringIO *ptr;
@@ -454,7 +532,8 @@ strio_copy(VALUE copy, VALUE orig)
* newline. See also the <code>$.</code> variable.
*/
static VALUE
-strio_get_lineno(VALUE self)
+strio_get_lineno(self)
+ VALUE self;
{
return LONG2NUM(StringIO(self)->lineno);
}
@@ -467,7 +546,8 @@ strio_get_lineno(VALUE self)
* <code>$.</code> is updated only on the next read.
*/
static VALUE
-strio_set_lineno(VALUE self, VALUE lineno)
+strio_set_lineno(self, lineno)
+ VALUE self, lineno;
{
StringIO(self)->lineno = NUM2LONG(lineno);
return lineno;
@@ -494,7 +574,10 @@ strio_set_lineno(VALUE self, VALUE lineno)
* and _mode_ (see StringIO#new).
*/
static VALUE
-strio_reopen(int argc, VALUE *argv, VALUE self)
+strio_reopen(argc, argv, self)
+ int argc;
+ VALUE *argv;
+ VALUE self;
{
if (!OBJ_TAINTED(self)) rb_secure(4);
if (argc == 1 && TYPE(*argv) != T_STRING) {
@@ -512,7 +595,8 @@ strio_reopen(int argc, VALUE *argv, VALUE self)
* Returns the current offset (in bytes) of *strio*.
*/
static VALUE
-strio_get_pos(VALUE self)
+strio_get_pos(self)
+ VALUE self;
{
return LONG2NUM(StringIO(self)->pos);
}
@@ -524,7 +608,9 @@ strio_get_pos(VALUE self)
* Seeks to the given position (in bytes) in *strio*.
*/
static VALUE
-strio_set_pos(VALUE self, VALUE pos)
+strio_set_pos(self, pos)
+ VALUE self;
+ VALUE pos;
{
struct StringIO *ptr = StringIO(self);
long p = NUM2LONG(pos);
@@ -532,6 +618,7 @@ strio_set_pos(VALUE self, VALUE pos)
error_inval(0);
}
ptr->pos = p;
+ ptr->flags &= ~STRIO_EOF;
return pos;
}
@@ -543,11 +630,13 @@ strio_set_pos(VALUE self, VALUE pos)
* +lineno+ to zero.
*/
static VALUE
-strio_rewind(VALUE self)
+strio_rewind(self)
+ VALUE self;
{
struct StringIO *ptr = StringIO(self);
ptr->pos = 0;
ptr->lineno = 0;
+ ptr->flags &= ~STRIO_EOF;
return INT2FIX(0);
}
@@ -559,7 +648,10 @@ strio_rewind(VALUE self)
* the value of _whence_ (see IO#seek).
*/
static VALUE
-strio_seek(int argc, VALUE *argv, VALUE self)
+strio_seek(argc, argv, self)
+ int argc;
+ VALUE *argv;
+ VALUE self;
{
VALUE whence;
struct StringIO *ptr = StringIO(self);
@@ -577,7 +669,7 @@ strio_seek(int argc, VALUE *argv, VALUE self)
offset += ptr->pos;
break;
case 2:
- offset += RSTRING_LEN(ptr->string);
+ offset += RSTRING(ptr->string)->len;
break;
default:
error_inval("invalid whence");
@@ -586,6 +678,7 @@ strio_seek(int argc, VALUE *argv, VALUE self)
error_inval(0);
}
ptr->pos = offset;
+ ptr->flags &= ~STRIO_EOF;
return INT2FIX(0);
}
@@ -596,7 +689,8 @@ strio_seek(int argc, VALUE *argv, VALUE self)
* Returns +true+ always.
*/
static VALUE
-strio_get_sync(VALUE self)
+strio_get_sync(self)
+ VALUE self;
{
StringIO(self);
return Qtrue;
@@ -614,7 +708,8 @@ strio_get_sync(VALUE self)
* See IO#each_byte.
*/
static VALUE
-strio_each_byte(VALUE self)
+strio_each_byte(self)
+ VALUE self;
{
struct StringIO *ptr = readable(StringIO(self));
@@ -629,56 +724,37 @@ strio_each_byte(VALUE self)
/*
* call-seq:
- * strio.getc -> string or nil
+ * strio.getc -> fixnum or nil
*
* See IO#getc.
*/
static VALUE
-strio_getc(VALUE self)
-{
- struct StringIO *ptr = readable(StringIO(self));
- rb_encoding *enc = rb_enc_get(ptr->string);
- int len;
- char *p;
-
- if (ptr->pos >= RSTRING_LEN(ptr->string)) {
- return Qnil;
- }
- p = RSTRING_PTR(ptr->string)+ptr->pos;
- len = rb_enc_mbclen(p, RSTRING_END(ptr->string), enc);
- ptr->pos += len;
- return rb_enc_str_new(p, len, rb_enc_get(ptr->string));
-}
-
-/*
- * call-seq:
- * strio.getbyte -> fixnum or nil
- *
- * See IO#getbyte.
- */
-static VALUE
-strio_getbyte(VALUE self)
+strio_getc(self)
+ VALUE self;
{
struct StringIO *ptr = readable(StringIO(self));
int c;
- if (ptr->pos >= RSTRING_LEN(ptr->string)) {
+ if (ptr->pos >= RSTRING(ptr->string)->len) {
+ ptr->flags |= STRIO_EOF;
return Qnil;
}
- c = RSTRING_PTR(ptr->string)[ptr->pos++];
+ c = RSTRING(ptr->string)->ptr[ptr->pos++];
return CHR2FIX(c);
}
static void
-strio_extend(struct StringIO *ptr, long pos, long len)
+strio_extend(ptr, pos, len)
+ struct StringIO *ptr;
+ long pos, len;
{
long olen;
check_modifiable(ptr);
- olen = RSTRING_LEN(ptr->string);
+ olen = RSTRING(ptr->string)->len;
if (pos + len > olen) {
rb_str_resize(ptr->string, pos + len);
if (pos > olen)
- MEMZERO(RSTRING_PTR(ptr->string) + olen, char, pos - olen);
+ MEMZERO(RSTRING(ptr->string)->ptr + olen, char, pos - olen);
}
else {
rb_str_modify(ptr->string);
@@ -687,7 +763,7 @@ strio_extend(struct StringIO *ptr, long pos, long len)
/*
* call-seq:
- * strio.ungetc(string) -> nil
+ * strio.ungetc(integer) -> nil
*
* Pushes back one character (passed as a parameter) onto *strio*
* such that a subsequent buffered read will return it. Pushing back
@@ -696,95 +772,45 @@ strio_extend(struct StringIO *ptr, long pos, long len)
* In other case, there is no limitation for multiple pushbacks.
*/
static VALUE
-strio_ungetc(VALUE self, VALUE c)
+strio_ungetc(self, ch)
+ VALUE self, ch;
{
struct StringIO *ptr = readable(StringIO(self));
- long lpos, clen;
- char *p, *pend;
- rb_encoding *enc, *enc2;
-
- if (NIL_P(c)) return Qnil;
- if (FIXNUM_P(c)) {
- int cc = FIX2INT(c);
- char buf[16];
-
- enc = rb_enc_get(ptr->string);
- rb_enc_mbcput(cc, buf, enc);
- c = rb_enc_str_new(buf, rb_enc_codelen(cc, enc), enc);
- }
- else {
- SafeStringValue(c);
- enc = rb_enc_get(ptr->string);
- enc2 = rb_enc_get(c);
- if (enc != enc2 && enc != rb_ascii8bit_encoding()) {
- c = rb_str_conv_enc(c, enc2, enc);
+ int cc = NUM2INT(ch);
+ long len, pos = ptr->pos;
+
+ if (cc != EOF) {
+ len = RSTRING(ptr->string)->len;
+ if (pos == 0) {
+ char *p;
+ rb_str_resize(ptr->string, len + 1);
+ p = RSTRING(ptr->string)->ptr;
+ memmove(p + 1, p, len);
}
+ else {
+ if (len < pos-- ||
+ (unsigned char)RSTRING(ptr->string)->ptr[pos] !=
+ (unsigned char)cc) {
+ strio_extend(ptr, pos, 1);
+ }
+ --ptr->pos;
+ }
+ RSTRING(ptr->string)->ptr[pos] = cc;
+ OBJ_INFECT(ptr->string, self);
+ ptr->flags &= ~STRIO_EOF;
}
- /* 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;
-}
-
-/*
- * call-seq:
- * strio.ungetbyte(fixnum) -> nil
- *
- * See IO#ungetbyte
- */
-static VALUE
-strio_ungetbyte(VALUE self, VALUE c)
-{
- struct StringIO *ptr = readable(StringIO(self));
- char buf[1], *cp = buf;
- long pos = ptr->pos, cl = 1;
- VALUE str = ptr->string;
-
- if (NIL_P(c)) return Qnil;
- if (FIXNUM_P(c)) {
- buf[0] = (char)FIX2INT(c);
- }
- else {
- SafeStringValue(c);
- cp = RSTRING_PTR(c);
- cl = RSTRING_LEN(c);
- if (cl == 0) return Qnil;
- }
- rb_str_modify(str);
- if (cl > pos) {
- char *s;
- long rest = RSTRING_LEN(str) - pos;
- rb_str_resize(str, rest + cl);
- s = RSTRING_PTR(str);
- memmove(s + cl, s + pos, rest);
- pos = 0;
- }
- else {
- pos -= cl;
- }
- memcpy(RSTRING_PTR(str) + pos, cp, cl);
- ptr->pos = pos;
- RB_GC_GUARD(c);
return Qnil;
}
/*
* call-seq:
- * strio.readchar -> string
+ * strio.readchar -> fixnum
*
* See IO#readchar.
*/
static VALUE
-strio_readchar(VALUE self)
+strio_readchar(self)
+ VALUE self;
{
VALUE c = strio_getc(self);
if (NIL_P(c)) rb_eof_error();
@@ -793,71 +819,44 @@ strio_readchar(VALUE self)
/*
* call-seq:
- * strio.readbyte -> fixnum
- *
- * See IO#readbyte.
- */
-static VALUE
-strio_readbyte(VALUE self)
-{
- VALUE c = strio_getbyte(self);
- if (NIL_P(c)) rb_eof_error();
- return c;
-}
-
-/*
- * call-seq:
* strio.each_char {|char| block } -> strio
*
* See IO#each_char.
*/
static VALUE
-strio_each_char(VALUE self)
+strio_each_char(self)
+ VALUE self;
{
- VALUE c;
+ struct StringIO *sio;
+ VALUE str;
+ const char *ptr;
+ size_t len;
RETURN_ENUMERATOR(self, 0, 0);
- while (!NIL_P(c = strio_getc(self))) {
- rb_yield(c);
- }
- return self;
-}
-
-/*
- * call-seq:
- * strio.each_codepoint {|c| block } -> strio
- *
- * See IO#each_codepoint.
- */
-static VALUE
-strio_each_codepoint(VALUE self)
-{
- struct StringIO *ptr;
- rb_encoding *enc;
- unsigned int c;
- int n;
+ sio = readable(StringIO(self));
+ str = sio->string;
+ ptr = RSTRING_PTR(str);
+ len = RSTRING_LEN(str);
- RETURN_ENUMERATOR(self, 0, 0);
+ while (sio->pos < len) {
+ int pos = sio->pos;
+ char c = ptr[pos];
+ int n = mbclen(c);
- ptr = readable(StringIO(self));
- enc = rb_enc_get(ptr->string);
- for (;;) {
- if (ptr->pos >= RSTRING_LEN(ptr->string)) {
- return self;
- }
+ if (len < pos + n) n = len - pos;
- c = rb_enc_codepoint_len(RSTRING_PTR(ptr->string)+ptr->pos,
- RSTRING_END(ptr->string), &n, enc);
- rb_yield(UINT2NUM(c));
- ptr->pos += n;
+ sio->pos += n;
+ rb_yield(rb_str_substr(str, pos, n));
}
return self;
}
-/* Boyer-Moore search: copied from regex.c */
static void
-bm_init_skip(long *skip, const char *pat, long m)
+bm_init_skip(skip, pat, m)
+ long *skip;
+ const char *pat;
+ long m;
{
int c;
@@ -870,7 +869,12 @@ bm_init_skip(long *skip, const char *pat, long m)
}
static long
-bm_search(const char *little, long llen, const char *big, long blen, const long *skip)
+bm_search(little, llen, big, blen, skip)
+ const char *little;
+ long llen;
+ const char *big;
+ long blen;
+ const long *skip;
{
long i, j, k;
@@ -889,75 +893,61 @@ bm_search(const char *little, long llen, const char *big, long blen, const long
}
static VALUE
-strio_getline(int argc, VALUE *argv, struct StringIO *ptr)
+strio_getline(argc, argv, ptr)
+ int argc;
+ VALUE *argv;
+ struct StringIO *ptr;
{
const char *s, *e, *p;
- long n, limit = 0;
+ long n;
VALUE str;
if (argc == 0) {
str = rb_rs;
}
else {
- VALUE lim, tmp;
-
- rb_scan_args(argc, argv, "11", &str, &lim);
- if (!NIL_P(lim)) limit = NUM2LONG(lim);
- else if (!NIL_P(str) && TYPE(str) != T_STRING) {
- 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 {
- str = tmp;
- }
- }
- else if (!NIL_P(str)) {
- StringValue(str);
- }
+ rb_scan_args(argc, argv, "1", &str);
+ if (!NIL_P(str)) StringValue(str);
}
- if (ptr->pos >= (n = RSTRING_LEN(ptr->string))) {
+ if (ptr->pos >= (n = RSTRING(ptr->string)->len)) {
+ ptr->flags |= STRIO_EOF;
return Qnil;
}
- s = RSTRING_PTR(ptr->string);
- e = s + RSTRING_LEN(ptr->string);
+ s = RSTRING(ptr->string)->ptr;
+ e = s + RSTRING(ptr->string)->len;
s += ptr->pos;
- if (limit > 0 && s + limit < e) {
- e = s + limit;
- }
if (NIL_P(str)) {
- str = strio_substr(ptr, ptr->pos, e - s);
+ str = rb_str_substr(ptr->string, ptr->pos, e - s);
}
- else if ((n = RSTRING_LEN(str)) == 0) {
+ else if ((n = RSTRING(str)->len) == 0) {
p = s;
while (*p == '\n') {
if (++p == e) {
+ ptr->flags |= STRIO_EOF;
return Qnil;
}
}
s = p;
while ((p = memchr(p, '\n', e - p)) && (p != e)) {
if (*++p == '\n') {
- e = p + 1;
+ e = p;
break;
}
}
- str = strio_substr(ptr, s - RSTRING_PTR(ptr->string), e - s);
+ str = rb_str_substr(ptr->string, s - RSTRING(ptr->string)->ptr, e - s);
}
else if (n == 1) {
- if ((p = memchr(s, RSTRING_PTR(str)[0], e - s)) != 0) {
+ if ((p = memchr(s, RSTRING(str)->ptr[0], e - s)) != 0) {
e = p + 1;
}
- str = strio_substr(ptr, ptr->pos, e - s);
+ str = rb_str_substr(ptr->string, 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) {
+ if (MEMCMP(p, RSTRING(str)->ptr, char, n) == 0) {
e = p + n;
break;
}
@@ -965,30 +955,31 @@ strio_getline(int argc, VALUE *argv, struct StringIO *ptr)
}
else {
long skip[1 << CHAR_BIT], pos;
- p = RSTRING_PTR(str);
+ p = RSTRING(str)->ptr;
bm_init_skip(skip, p, n);
if ((pos = bm_search(p, n, s, e - s, skip)) >= 0) {
e = s + pos + n;
}
}
}
- str = strio_substr(ptr, ptr->pos, e - s);
+ str = rb_str_substr(ptr->string, ptr->pos, e - s);
}
- ptr->pos = e - RSTRING_PTR(ptr->string);
+ ptr->pos = e - RSTRING(ptr->string)->ptr;
ptr->lineno++;
return str;
}
/*
* call-seq:
- * strio.gets(sep=$/) -> string or nil
- * strio.gets(limit) -> string or nil
- * strio.gets(sep, limit) -> string or nil
+ * strio.gets(sep_string=$/) -> string or nil
*
* See IO#gets.
*/
static VALUE
-strio_gets(int argc, VALUE *argv, VALUE self)
+strio_gets(argc, argv, self)
+ int argc;
+ VALUE *argv;
+ VALUE self;
{
VALUE str = strio_getline(argc, argv, readable(StringIO(self)));
@@ -998,14 +989,15 @@ strio_gets(int argc, VALUE *argv, VALUE self)
/*
* call-seq:
- * strio.readline(sep=$/) -> string
- * strio.readline(limit) -> string or nil
- * strio.readline(sep, limit) -> string or nil
+ * strio.readline(sep_string=$/) -> string
*
* See IO#readline.
*/
static VALUE
-strio_readline(int argc, VALUE *argv, VALUE self)
+strio_readline(argc, argv, self)
+ int argc;
+ VALUE *argv;
+ VALUE self;
{
VALUE line = strio_gets(argc, argv, self);
if (NIL_P(line)) rb_eof_error();
@@ -1014,17 +1006,16 @@ strio_readline(int argc, VALUE *argv, VALUE self)
/*
* call-seq:
- * strio.each(sep=$/) {|line| block } -> strio
- * strio.each(limit) {|line| block } -> strio
- * strio.each(sep, limit) {|line| block } -> strio
- * strio.each_line(sep=$/) {|line| block } -> strio
- * strio.each_line(limit) {|line| block } -> strio
- * strio.each_line(sep,limit) {|line| block } -> strio
+ * strio.each(sep_string=$/) {|line| block } -> strio
+ * strio.each_line(sep_string=$/) {|line| block } -> strio
*
* See IO#each.
*/
static VALUE
-strio_each(int argc, VALUE *argv, VALUE self)
+strio_each(argc, argv, self)
+ int argc;
+ VALUE *argv;
+ VALUE self;
{
struct StringIO *ptr = StringIO(self);
VALUE line;
@@ -1039,14 +1030,15 @@ strio_each(int argc, VALUE *argv, VALUE self)
/*
* call-seq:
- * strio.readlines(sep=$/) -> array
- * strio.readlines(limit) -> array
- * strio.readlines(sep,limit) -> array
+ * strio.readlines(sep_string=$/) -> array
*
* See IO#readlines.
*/
static VALUE
-strio_readlines(int argc, VALUE *argv, VALUE self)
+strio_readlines(argc, argv, self)
+ int argc;
+ VALUE *argv;
+ VALUE self;
{
struct StringIO *ptr = StringIO(self);
VALUE ary = rb_ary_new(), line;
@@ -1067,33 +1059,27 @@ strio_readlines(int argc, VALUE *argv, VALUE self)
* Returns the number of bytes written. See IO#write.
*/
static VALUE
-strio_write(VALUE self, VALUE str)
+strio_write(self, str)
+ VALUE self, str;
{
struct StringIO *ptr = writable(StringIO(self));
long len, olen;
- rb_encoding *enc, *enc2;
if (TYPE(str) != T_STRING)
str = rb_obj_as_string(str);
- enc = rb_enc_get(ptr->string);
- enc2 = rb_enc_get(str);
- if (enc != enc2 && enc != rb_ascii8bit_encoding()) {
- str = rb_str_conv_enc(str, enc2, enc);
- }
- len = RSTRING_LEN(str);
- if (len == 0) return INT2FIX(0);
+ len = RSTRING(str)->len;
+ if (!len) return INT2FIX(0);
check_modifiable(ptr);
- olen = RSTRING_LEN(ptr->string);
+ olen = RSTRING(ptr->string)->len;
if (ptr->flags & FMODE_APPEND) {
ptr->pos = olen;
}
if (ptr->pos == olen) {
- rb_str_cat(ptr->string, RSTRING_PTR(str), len);
+ rb_str_cat(ptr->string, RSTRING(str)->ptr, len);
}
else {
strio_extend(ptr, ptr->pos, len);
- memmove(RSTRING_PTR(ptr->string)+ptr->pos, RSTRING_PTR(str), len);
- OBJ_INFECT(ptr->string, str);
+ rb_str_update(ptr->string, ptr->pos, len, str);
}
OBJ_INFECT(ptr->string, self);
ptr->pos += len;
@@ -1132,19 +1118,20 @@ strio_write(VALUE self, VALUE str)
* See IO#putc.
*/
static VALUE
-strio_putc(VALUE self, VALUE ch)
+strio_putc(self, ch)
+ VALUE self, ch;
{
struct StringIO *ptr = writable(StringIO(self));
int c = NUM2CHR(ch);
long olen;
check_modifiable(ptr);
- olen = RSTRING_LEN(ptr->string);
+ olen = RSTRING(ptr->string)->len;
if (ptr->flags & FMODE_APPEND) {
ptr->pos = olen;
}
strio_extend(ptr, ptr->pos, 1);
- RSTRING_PTR(ptr->string)[ptr->pos++] = c;
+ RSTRING(ptr->string)->ptr[ptr->pos++] = c;
OBJ_INFECT(ptr->string, self);
return ch;
}
@@ -1164,7 +1151,10 @@ strio_putc(VALUE self, VALUE ch)
* See IO#read.
*/
static VALUE
-strio_read(int argc, VALUE *argv, VALUE self)
+strio_read(argc, argv, self)
+ int argc;
+ VALUE *argv;
+ VALUE self;
{
struct StringIO *ptr = readable(StringIO(self));
VALUE str = Qnil;
@@ -1181,7 +1171,12 @@ strio_read(int argc, VALUE *argv, VALUE self)
if (len < 0) {
rb_raise(rb_eArgError, "negative length %ld given", len);
}
- if (len > 0 && ptr->pos >= RSTRING_LEN(ptr->string)) {
+ if (len > 0 && ptr->pos >= RSTRING(ptr->string)->len) {
+ ptr->flags |= STRIO_EOF;
+ if (!NIL_P(str)) rb_str_resize(str, 0);
+ return Qnil;
+ }
+ else if (ptr->flags & STRIO_EOF) {
if (!NIL_P(str)) rb_str_resize(str, 0);
return Qnil;
}
@@ -1190,8 +1185,9 @@ strio_read(int argc, VALUE *argv, VALUE self)
/* fall through */
case 0:
olen = -1;
- len = RSTRING_LEN(ptr->string);
+ len = RSTRING(ptr->string)->len;
if (len <= ptr->pos) {
+ ptr->flags |= STRIO_EOF;
if (NIL_P(str)) {
str = rb_str_new(0, 0);
}
@@ -1208,21 +1204,22 @@ strio_read(int argc, VALUE *argv, VALUE self)
rb_raise(rb_eArgError, "wrong number of arguments (%d for 0)", argc);
}
if (NIL_P(str)) {
- str = strio_substr(ptr, ptr->pos, len);
+ str = rb_str_substr(ptr->string, ptr->pos, len);
}
else {
- long rest = RSTRING_LEN(ptr->string) - ptr->pos;
+ long rest = RSTRING(ptr->string)->len - ptr->pos;
if (len > rest) len = rest;
rb_str_resize(str, len);
- MEMCPY(RSTRING_PTR(str), RSTRING_PTR(ptr->string) + ptr->pos, char, len);
+ MEMCPY(RSTRING(str)->ptr, RSTRING(ptr->string)->ptr + ptr->pos, char, len);
}
if (NIL_P(str)) {
- str = rb_str_new(0, 0);
+ if (!(ptr->flags & STRIO_EOF)) str = rb_str_new(0, 0);
len = 0;
}
else {
- ptr->pos += len = RSTRING_LEN(str);
+ ptr->pos += len = RSTRING(str)->len;
}
+ if (olen < 0 || olen > len) ptr->flags |= STRIO_EOF;
return str;
}
@@ -1234,10 +1231,13 @@ strio_read(int argc, VALUE *argv, VALUE self)
* returning +nil+, as well as IO#sysread does.
*/
static VALUE
-strio_sysread(int argc, VALUE *argv, VALUE self)
+strio_sysread(argc, argv, self)
+ int argc;
+ VALUE *argv;
+ VALUE self;
{
VALUE val = strio_read(argc, argv, self);
- if (NIL_P(val)) {
+ if (NIL_P(val) || RSTRING(val)->len == 0) {
rb_eof_error();
}
return val;
@@ -1245,6 +1245,9 @@ strio_sysread(int argc, VALUE *argv, VALUE self)
#define strio_syswrite strio_write
+/* call-seq: strio.path -> nil */
+#define strio_path strio_nil
+
/*
* call-seq:
* strio.isatty -> nil
@@ -1266,13 +1269,14 @@ strio_sysread(int argc, VALUE *argv, VALUE self)
* Returns the size of the buffer string.
*/
static VALUE
-strio_size(VALUE self)
+strio_size(self)
+ VALUE self;
{
VALUE string = StringIO(self)->string;
if (NIL_P(string)) {
rb_raise(rb_eIOError, "not opened");
}
- return ULONG2NUM(RSTRING_LEN(string));
+ return ULONG2NUM(RSTRING(string)->len);
}
/*
@@ -1283,67 +1287,23 @@ strio_size(VALUE self)
* must be opened for writing.
*/
static VALUE
-strio_truncate(VALUE self, VALUE len)
+strio_truncate(self, len)
+ VALUE self, len;
{
VALUE string = writable(StringIO(self))->string;
long l = NUM2LONG(len);
- long plen = RSTRING_LEN(string);
+ long plen = RSTRING(string)->len;
if (l < 0) {
error_inval("negative legnth");
}
rb_str_resize(string, l);
if (plen < l) {
- MEMZERO(RSTRING_PTR(string) + plen, char, l - plen);
+ MEMZERO(RSTRING(string)->ptr + plen, char, l - plen);
}
return len;
}
/*
- * call-seq:
- * strio.external_encoding => encoding
- *
- * Returns the Encoding object that represents the encoding of the file.
- * If strio is write mode and no encoding is specified, returns <code>nil</code>.
- */
-
-static VALUE
-strio_external_encoding(VALUE self)
-{
- return rb_enc_from_encoding(rb_enc_get(StringIO(self)->string));
-}
-
-/*
- * call-seq:
- * strio.internal_encoding => encoding
- *
- * Returns the Encoding of the internal string if conversion is
- * specified. Otherwise returns nil.
- */
-
-static VALUE
-strio_internal_encoding(VALUE self)
-{
- return Qnil;
-}
-
-/*
- * call-seq:
- * strio.set_encoding(ext_enc) => strio
- *
- * Tagged with the encoding specified.
- */
-
-static VALUE
-strio_set_encoding(VALUE self, VALUE ext_enc)
-{
- rb_encoding* enc;
- VALUE str = StringIO(self)->string;
- enc = rb_to_encoding(ext_enc);
- rb_enc_associate(str, enc);
- return self;
-}
-
-/*
* Pseudo I/O on String object.
*/
void
@@ -1382,6 +1342,7 @@ Init_stringio()
rb_define_method(StringIO, "sync", strio_get_sync, 0);
rb_define_method(StringIO, "sync=", strio_set_sync, 1);
rb_define_method(StringIO, "tell", strio_tell, 0);
+ rb_define_method(StringIO, "path", strio_path, 0);
rb_define_method(StringIO, "each", strio_each, -1);
rb_define_method(StringIO, "each_line", strio_each, -1);
@@ -1390,20 +1351,16 @@ Init_stringio()
rb_define_method(StringIO, "bytes", strio_each_byte, 0);
rb_define_method(StringIO, "each_char", strio_each_char, 0);
rb_define_method(StringIO, "chars", strio_each_char, 0);
- rb_define_method(StringIO, "each_codepoint", strio_each_codepoint, 0);
- rb_define_method(StringIO, "codepoints", strio_each_codepoint, 0);
rb_define_method(StringIO, "getc", strio_getc, 0);
+ rb_define_method(StringIO, "getbyte", strio_getc, 0);
rb_define_method(StringIO, "ungetc", strio_ungetc, 1);
- rb_define_method(StringIO, "ungetbyte", strio_ungetbyte, 1);
rb_define_method(StringIO, "readchar", strio_readchar, 0);
- rb_define_method(StringIO, "getbyte", strio_getbyte, 0);
- rb_define_method(StringIO, "readbyte", strio_readbyte, 0);
+ rb_define_method(StringIO, "readbyte", strio_readchar, 0);
rb_define_method(StringIO, "gets", strio_gets, -1);
rb_define_method(StringIO, "readline", strio_readline, -1);
rb_define_method(StringIO, "readlines", strio_readlines, -1);
rb_define_method(StringIO, "read", strio_read, -1);
rb_define_method(StringIO, "sysread", strio_sysread, -1);
- rb_define_method(StringIO, "readpartial", strio_sysread, -1);
rb_define_method(StringIO, "write", strio_write, 1);
rb_define_method(StringIO, "<<", strio_addstr, 1);
@@ -1420,8 +1377,4 @@ Init_stringio()
rb_define_method(StringIO, "size", strio_size, 0);
rb_define_method(StringIO, "length", strio_size, 0);
rb_define_method(StringIO, "truncate", strio_truncate, 1);
-
- 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);
}
diff --git a/ext/strscan/.cvsignore b/ext/strscan/.cvsignore
index 814345ece8..4088712231 100644
--- a/ext/strscan/.cvsignore
+++ b/ext/strscan/.cvsignore
@@ -1,4 +1,3 @@
Makefile
mkmf.log
*.def
-extconf.h
diff --git a/ext/strscan/depend b/ext/strscan/depend
index 76f6e0b18b..9199574c3f 100644
--- a/ext/strscan/depend
+++ b/ext/strscan/depend
@@ -1,2 +1 @@
-strscan.o: strscan.c $(hdrdir)/ruby.h $(hdrdir)/re.h $(hdrdir)/regex.h \
- $(hdrdir)/oniguruma.h $(topdir)/config.h $(hdrdir)/defines.h
+strscan.o: strscan.c $(hdrdir)/ruby.h $(topdir)/config.h $(hdrdir)/defines.h
diff --git a/ext/strscan/strscan.c b/ext/strscan/strscan.c
index e843e547fb..b5ee20282c 100644
--- a/ext/strscan/strscan.c
+++ b/ext/strscan/strscan.c
@@ -8,9 +8,8 @@
the Ruby License. For details, see the file COPYING.
*/
-#include "ruby/ruby.h"
-#include "ruby/re.h"
-#include "ruby/encoding.h"
+#include "ruby.h"
+#include "re.h"
#define STRSCAN_VERSION "0.7.0"
@@ -42,13 +41,13 @@ struct strscanner
#define MATCHED(s) (s)->flags |= FLAG_MATCHED
#define CLEAR_MATCH_STATUS(s) (s)->flags &= ~FLAG_MATCHED
-#define S_PBEG(s) (RSTRING_PTR((s)->str))
-#define S_LEN(s) (RSTRING_LEN((s)->str))
+#define S_PBEG(s) (RSTRING((s)->str)->ptr)
+#define S_LEN(s) (RSTRING((s)->str)->len)
#define S_PEND(s) (S_PBEG(s) + S_LEN(s))
#define CURPTR(s) (S_PBEG(s) + (s)->curr)
#define S_RESTLEN(s) (S_LEN(s) - (s)->curr)
-#define EOS_P(s) ((s)->curr >= RSTRING_LEN(p->str))
+#define EOS_P(s) ((s)->curr >= RSTRING(p->str)->len)
#define GET_SCANNER(obj,var) do {\
Data_Get_Struct(obj, struct strscanner, var);\
@@ -63,7 +62,7 @@ static VALUE infect _((VALUE str, struct strscanner *p));
static VALUE extract_range _((struct strscanner *p, long beg_i, long end_i));
static VALUE extract_beg_len _((struct strscanner *p, long beg_i, long len));
-void check_strscan _((VALUE obj));
+static void check_strscan _((VALUE obj));
static void strscan_mark _((struct strscanner *p));
static void strscan_free _((struct strscanner *p));
static VALUE strscan_s_allocate _((VALUE klass));
@@ -127,20 +126,12 @@ infect(VALUE str, struct strscanner *p)
}
static VALUE
-str_new(struct strscanner *p, const char *ptr, long len)
-{
- 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;
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);
+ return infect(rb_str_new(S_PBEG(p) + beg_i, end_i - beg_i), p);
}
static VALUE
@@ -149,7 +140,7 @@ extract_beg_len(struct strscanner *p, long beg_i, long len)
if (beg_i > S_LEN(p)) return Qnil;
if (beg_i + len > S_LEN(p))
len = S_LEN(p) - beg_i;
- return infect(str_new(p, S_PBEG(p) + beg_i, len), p);
+ return infect(rb_str_new(S_PBEG(p) + beg_i, len), p);
}
/* =======================================================================
@@ -165,8 +156,8 @@ strscan_mark(struct strscanner *p)
static void
strscan_free(struct strscanner *p)
{
- onig_region_free(&(p->regs), 0);
- ruby_xfree(p);
+ re_free_registers(&(p->regs));
+ free(p);
}
static VALUE
@@ -177,7 +168,7 @@ strscan_s_allocate(VALUE klass)
p = ALLOC(struct strscanner);
MEMZERO(p, struct strscanner, 1);
CLEAR_MATCH_STATUS(p);
- onig_region_init(&(p->regs));
+ MEMZERO(&(p->regs), struct re_registers, 1);
p->str = Qnil;
return Data_Wrap_Struct(klass, strscan_mark, strscan_free, p);
}
@@ -202,7 +193,7 @@ strscan_initialize(int argc, VALUE *argv, VALUE self)
return self;
}
-void
+static void
check_strscan(VALUE obj)
{
if (TYPE(obj) != T_DATA || RDATA(obj)->dmark != (RUBY_DATA_FUNC)strscan_mark) {
@@ -228,13 +219,12 @@ strscan_init_copy(VALUE vself, VALUE vorig)
check_strscan(vorig);
Data_Get_Struct(vorig, struct strscanner, orig);
if (self != orig) {
- self->flags = orig->flags;
- self->str = orig->str;
- self->prev = orig->prev;
- self->curr = orig->curr;
- onig_region_copy(&self->regs, &orig->regs);
+ self->flags = orig->flags;
+ self->str = orig->str;
+ self->prev = orig->prev;
+ self->curr = orig->curr;
+ re_copy_registers(&self->regs, &orig->regs);
}
-
return vself;
}
@@ -403,11 +393,8 @@ strscan_set_pos(VALUE self, VALUE v)
static VALUE
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;
int ret;
- int tmpreg;
Check_Type(regex, T_REGEXP);
GET_SCANNER(self, p);
@@ -416,31 +403,21 @@ strscan_do_scan(VALUE self, VALUE regex, int succptr, int getstr, int headonly)
if (S_RESTLEN(p) < 0) {
return Qnil;
}
- re = rb_reg_prepare_re(regex, p->str);
- tmpreg = re != RREGEXP(regex)->ptr;
- if (!tmpreg) RREGEXP(regex)->usecnt++;
-
+ rb_kcode_set_option(regex);
if (headonly) {
- ret = onig_match(re, (UChar* )CURPTR(p),
- (UChar* )(CURPTR(p) + S_RESTLEN(p)),
- (UChar* )CURPTR(p), &(p->regs), ONIG_OPTION_NONE);
+ ret = re_match(RREGEXP(regex)->ptr,
+ CURPTR(p), S_RESTLEN(p),
+ 0,
+ &(p->regs));
}
else {
- 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);
- }
- else {
- onig_free(RREGEXP(regex)->ptr);
- RREGEXP(regex)->ptr = re;
- }
+ ret = re_search(RREGEXP(regex)->ptr,
+ CURPTR(p), S_RESTLEN(p),
+ 0,
+ S_RESTLEN(p),
+ &(p->regs));
}
+ rb_kcode_reset_option();
if (ret == -2) rb_raise(ScanError, "regexp buffer overflow");
if (ret < 0) {
@@ -544,11 +521,11 @@ strscan_check(VALUE self, VALUE re)
}
/*
- * call-seq: scan_full(pattern, advance_pointer_p, return_string_p)
+ * call-seq: scan_full(pattern, return_string_p, advance_pointer_p)
*
* Tests whether the given +pattern+ is matched from the current scan pointer.
- * Advances the scan pointer if +advance_pointer_p+ is true.
* Returns the matched string if +return_string_p+ is true.
+ * Advances the scan pointer if +advance_pointer_p+ is true.
* The match register is affected.
*
* "full" means "#scan with full parameters".
@@ -559,6 +536,7 @@ strscan_scan_full(VALUE self, VALUE re, VALUE s, VALUE f)
return strscan_do_scan(self, re, RTEST(s), RTEST(f), 1);
}
+
/*
* call-seq: scan_until(pattern)
*
@@ -587,7 +565,7 @@ strscan_scan_until(VALUE self, VALUE re)
* s = StringScanner.new('test string')
* s.exist? /s/ # -> 3
* s.scan /test/ # -> "test"
- * s.exist? /s/ # -> 2
+ * s.exist? /s/ # -> 6
* s.exist? /e/ # -> nil
*/
static VALUE
@@ -638,12 +616,12 @@ strscan_check_until(VALUE self, VALUE re)
}
/*
- * call-seq: search_full(pattern, advance_pointer_p, return_string_p)
+ * call-seq: search_full(pattern, return_string_p, advance_pointer_p)
*
* Scans the string _until_ the +pattern+ is matched.
- * Advances the scan pointer if +advance_pointer_p+, otherwise not.
* Returns the matched string if +return_string_p+ is true, otherwise
* returns the number of bytes advanced.
+ * Advances the scan pointer if +advance_pointer_p+, otherwise not.
* This method does affect the match register.
*/
static VALUE
@@ -652,18 +630,26 @@ strscan_search_full(VALUE self, VALUE re, VALUE s, VALUE f)
return strscan_do_scan(self, re, RTEST(s), RTEST(f), 0);
}
+/* DANGEROUS; need to synchronize with regex.c */
static void
adjust_registers_to_matched(struct strscanner *p)
{
- onig_region_clear(&(p->regs));
- onig_region_set(&(p->regs), 0, 0, p->curr - p->prev);
+ if (p->regs.allocated == 0) {
+ p->regs.beg = ALLOC_N(int, RE_NREGS);
+ p->regs.end = ALLOC_N(int, RE_NREGS);
+ p->regs.allocated = RE_NREGS;
+ }
+ p->regs.num_regs = 1;
+ p->regs.beg[0] = 0;
+ p->regs.end[0] = p->curr - p->prev;
}
/*
* Scans one character and returns it.
- * This method is multibyte character sensitive.
+ * This method is multi-byte character sensitive.
+ * See also #get_byte.
*
- * s = StringScanner.new("ab")
+ * s = StringScanner.new('ab')
* s.getch # => "a"
* s.getch # => "b"
* s.getch # => nil
@@ -683,8 +669,7 @@ strscan_getch(VALUE self)
CLEAR_MATCH_STATUS(p);
if (EOS_P(p))
return Qnil;
-
- len = rb_enc_mbclen(CURPTR(p), S_PEND(p), rb_enc_get(p->str));
+ len = mbclen(*CURPTR(p));
if (p->curr + len > S_LEN(p)) {
len = S_LEN(p) - p->curr;
}
@@ -698,15 +683,14 @@ strscan_getch(VALUE self)
/*
* Scans one byte and returns it.
- * This method is not multibyte character sensitive.
- * See also: #getch.
+ * This method is NOT multi-byte character sensitive.
+ * See also #getch.
*
* s = StringScanner.new('ab')
* s.get_byte # => "a"
* s.get_byte # => "b"
* s.get_byte # => nil
*
- * $KCODE = 'EUC'
* s = StringScanner.new("\244\242")
* s.get_byte # => "\244"
* s.get_byte # => "\242"
@@ -719,9 +703,9 @@ strscan_get_byte(VALUE self)
GET_SCANNER(self, p);
CLEAR_MATCH_STATUS(p);
- if (EOS_P(p))
+ if (EOS_P(p)) {
return Qnil;
-
+ }
p->prev = p->curr;
p->curr++;
MATCHED(p);
@@ -759,13 +743,13 @@ strscan_peek(VALUE self, VALUE vlen)
long len;
GET_SCANNER(self, p);
-
len = NUM2LONG(vlen);
- if (EOS_P(p))
- return infect(str_new(p, "", 0), p);
-
- if (p->curr + len > S_LEN(p))
+ if (EOS_P(p)) {
+ return infect(rb_str_new("", 0), p);
+ }
+ if (p->curr + len > S_LEN(p)) {
len = S_LEN(p) - p->curr;
+ }
return extract_beg_len(p, p->curr, len);
}
@@ -789,7 +773,7 @@ strscan_peep(VALUE self, VALUE vlen)
* s.unscan
* s.scan(/../) # => "te"
* s.scan(/\d/) # => nil
- * s.unscan # ScanError: unscan failed: previous match record not exist
+ * s.unscan # ScanError: unscan failed: previous match had failed
*/
static VALUE
strscan_unscan(VALUE self)
@@ -797,8 +781,9 @@ strscan_unscan(VALUE self)
struct strscanner *p;
GET_SCANNER(self, p);
- if (! MATCHED_P(p))
- rb_raise(ScanError, "unscan failed: previous match record not exist");
+ if (! MATCHED_P(p)) {
+ rb_raise(ScanError, "unscan failed: previous match had failed");
+ }
p->curr = p->prev;
CLEAR_MATCH_STATUS(p);
return self;
@@ -906,6 +891,7 @@ strscan_matched(VALUE self)
GET_SCANNER(self, p);
if (! MATCHED_P(p)) return Qnil;
+
return extract_range(p, p->prev + p->regs.beg[0],
p->prev + p->regs.end[0]);
}
@@ -927,10 +913,22 @@ strscan_matched_size(VALUE self)
GET_SCANNER(self, p);
if (! MATCHED_P(p)) return Qnil;
+
return INT2NUM(p->regs.end[0] - p->regs.beg[0]);
}
/*
+ * Equivalent to #matched_size.
+ * This method is obsolete; use #matched_size instead.
+ */
+static VALUE
+strscan_matchedsize(VALUE self)
+{
+ rb_warning("StringScanner#matchedsize is obsolete; use #matched_size instead");
+ return strscan_matched_size(self);
+}
+
+/*
* call-seq: [](n)
*
* Return the n-th subgroup in the most recent match.
@@ -980,6 +978,7 @@ strscan_pre_match(VALUE self)
GET_SCANNER(self, p);
if (! MATCHED_P(p)) return Qnil;
+
return extract_range(p, 0, p->prev + p->regs.beg[0]);
}
@@ -999,6 +998,7 @@ strscan_post_match(VALUE self)
GET_SCANNER(self, p);
if (! MATCHED_P(p)) return Qnil;
+
return extract_range(p, p->prev + p->regs.end[0], S_LEN(p));
}
@@ -1013,7 +1013,7 @@ strscan_rest(VALUE self)
GET_SCANNER(self, p);
if (EOS_P(p)) {
- return infect(str_new(p, "", 0), p);
+ return infect(rb_str_new("", 0), p);
}
return extract_range(p, p->curr, S_LEN(p));
}
@@ -1031,6 +1031,7 @@ strscan_rest_size(VALUE self)
if (EOS_P(p)) {
return INT2FIX(0);
}
+
i = S_LEN(p) - p->curr;
return INT2FIX(i);
}
@@ -1084,7 +1085,7 @@ strscan_inspect(VALUE self)
len = snprintf(buf, BUFSIZE, "#<%s %ld/%ld @ %s>",
rb_class2name(CLASS_OF(self)),
p->curr, S_LEN(p),
- RSTRING_PTR(b));
+ RSTRING(b)->ptr);
return infect(rb_str_new(buf, len), p);
}
a = inspect1(p);
@@ -1092,8 +1093,8 @@ strscan_inspect(VALUE self)
len = snprintf(buf, BUFSIZE, "#<%s %ld/%ld %s @ %s>",
rb_class2name(CLASS_OF(self)),
p->curr, S_LEN(p),
- RSTRING_PTR(a),
- RSTRING_PTR(b));
+ RSTRING(a)->ptr,
+ RSTRING(b)->ptr);
return infect(rb_str_new(buf, len), p);
}
@@ -1244,7 +1245,7 @@ inspect2(struct strscanner *p)
* There are aliases to several of the methods.
*/
void
-Init_strscan()
+Init_strscan(void)
{
ID id_scanerr = rb_intern("ScanError");
VALUE tmp;
@@ -1306,6 +1307,7 @@ Init_strscan()
rb_define_method(StringScanner, "matched?", strscan_matched_p, 0);
rb_define_method(StringScanner, "matched", strscan_matched, 0);
rb_define_method(StringScanner, "matched_size", strscan_matched_size, 0);
+ rb_define_method(StringScanner, "matchedsize", strscan_matchedsize, 0);
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);
diff --git a/ext/syck/.cvsignore b/ext/syck/.cvsignore
index 814345ece8..4088712231 100644
--- a/ext/syck/.cvsignore
+++ b/ext/syck/.cvsignore
@@ -1,4 +1,3 @@
Makefile
mkmf.log
*.def
-extconf.h
diff --git a/ext/syck/bytecode.c b/ext/syck/bytecode.c
index 25ba678300..567aaf52a8 100644
--- a/ext/syck/bytecode.c
+++ b/ext/syck/bytecode.c
@@ -4,10 +4,11 @@
* bytecode.re
*
* $Author$
+ * $Date$
*
* Copyright (C) 2003 why the lucky stiff
*/
-#include "ruby/ruby.h"
+#include "ruby.h"
#include "syck.h"
#include "gram.h"
@@ -164,7 +165,7 @@ sycklex_bytecode_utf8( YYSTYPE *sycklval, SyckParser *parser )
#line 165 "<stdout>"
{
YYCTYPE yych;
- unsigned int yyaccept = 0;
+ unsigned int yyaccept;
goto yy0;
++YYCURSOR;
yy0:
@@ -542,7 +543,7 @@ Directive:
#line 543 "<stdout>"
{
YYCTYPE yych;
- unsigned int yyaccept = 0;
+ unsigned int yyaccept;
goto yy45;
++YYCURSOR;
yy45:
diff --git a/ext/syck/emitter.c b/ext/syck/emitter.c
index 73ff5d7a0b..9c8ab8d49b 100644
--- a/ext/syck/emitter.c
+++ b/ext/syck/emitter.c
@@ -2,13 +2,14 @@
* emitter.c
*
* $Author$
+ * $Date$
*
* Copyright (C) 2003 why the lucky stiff
*
* All Base64 code from Ruby's pack.c.
- * Ruby is Copyright (C) 1993-2007 Yukihiro Matsumoto
+ * Ruby is Copyright (C) 1993-2003 Yukihiro Matsumoto
*/
-#include "ruby/ruby.h"
+#include "ruby.h"
#include <stdio.h>
#include <string.h>
@@ -97,7 +98,7 @@ syck_base64dec( char *s, long len )
}
}
*end = '\0';
- /*RSTRING_LEN(buf) = ptr - RSTRING_PTR(buf);*/
+ /*RSTRING(buf)->len = ptr - RSTRING(buf)->ptr;*/
return ptr;
}
@@ -105,7 +106,7 @@ syck_base64dec( char *s, long len )
* Allocate an emitter
*/
SyckEmitter *
-syck_new_emitter(void)
+syck_new_emitter()
{
SyckEmitter *e;
e = S_ALLOC( SyckEmitter );
@@ -281,10 +282,10 @@ syck_emitter_clear( SyckEmitter *e )
* Raw write to the emitter buffer.
*/
void
-syck_emitter_write( SyckEmitter *e, const char *str, long len )
+syck_emitter_write( SyckEmitter *e, char *str, long len )
{
long at;
- ASSERT( str != NULL );
+ ASSERT( str != NULL )
if ( e->buffer == NULL )
{
syck_emitter_clear( e );
@@ -391,7 +392,7 @@ syck_emit( SyckEmitter *e, st_data_t n )
/* Look for anchor */
if ( e->anchors != NULL &&
st_lookup( e->markers, n, (st_data_t *)&oid ) &&
- st_lookup( e->anchors, (st_data_t)oid, (void *)&anchor_name ) )
+ st_lookup( e->anchors, (st_data_t)oid, (st_data_t *)&anchor_name ) )
{
if ( e->anchored == NULL )
{
@@ -437,7 +438,7 @@ end_emit:
* and the implicit tag which would be assigned to this node. If a tag is
* required, write the tag.
*/
-void syck_emit_tag( SyckEmitter *e, const char *tag, const char *ignore )
+void syck_emit_tag( SyckEmitter *e, char *tag, char *ignore )
{
SyckLevel *lvl;
if ( tag == NULL ) return;
@@ -456,7 +457,7 @@ void syck_emit_tag( SyckEmitter *e, const char *tag, const char *ignore )
int skip = 4 + strlen( YAML_DOMAIN ) + 1;
syck_emitter_write( e, tag + skip, taglen - skip );
} else {
- const char *subd = tag + 4;
+ char *subd = tag + 4;
while ( *subd != ':' && *subd != '\0' ) subd++;
if ( *subd == ':' ) {
if ( subd - tag > ( strlen( YAML_DOMAIN ) + 5 ) &&
@@ -538,7 +539,7 @@ void syck_emit_indent( SyckEmitter *e )
* Basic printable test for LATIN-1 characters.
*/
int
-syck_scan_scalar( int req_width, const char *cursor, long len )
+syck_scan_scalar( int req_width, char *cursor, long len )
{
long i = 0, start = 0;
int flags = SCAN_NONE;
@@ -638,14 +639,13 @@ syck_scan_scalar( int req_width, const char *cursor, long len )
* All scalars should be emitted through this function, which determines an appropriate style,
* tag and indent.
*/
-void syck_emit_scalar( SyckEmitter *e, const char *tag, enum scalar_style force_style, int force_indent, int force_width,
- char keep_nl, const char *str, long len )
+void syck_emit_scalar( SyckEmitter *e, char *tag, enum scalar_style force_style, int force_indent, int force_width,
+ char keep_nl, char *str, long len )
{
enum scalar_style favor_style = scalar_literal;
SyckLevel *parent = syck_emitter_parent_level( e );
SyckLevel *lvl = syck_emitter_current_level( e );
int scan = 0;
- const char *match_implicit;
char *implicit;
if ( str == NULL ) str = "";
@@ -659,10 +659,10 @@ void syck_emit_scalar( SyckEmitter *e, const char *tag, enum scalar_style force_
}
scan = syck_scan_scalar( force_width, str, len );
- match_implicit = syck_match_implicit( str, len );
+ implicit = syck_match_implicit( str, len );
/* quote strings which default to implicits */
- implicit = syck_taguri( YAML_DOMAIN, match_implicit, strlen( match_implicit ) );
+ implicit = syck_taguri( YAML_DOMAIN, implicit, strlen( implicit ) );
if ( syck_tagcmp( tag, implicit ) != 0 && syck_tagcmp( tag, "tag:yaml.org,2002:str" ) == 0 ) {
force_style = scalar_2quote;
} else {
@@ -773,7 +773,7 @@ void syck_emit_scalar( SyckEmitter *e, const char *tag, enum scalar_style force_
}
void
-syck_emitter_escape( SyckEmitter *e, const char *src, long len )
+syck_emitter_escape( SyckEmitter *e, char *src, long len )
{
int i;
for( i = 0; i < len; i++ )
@@ -786,8 +786,8 @@ syck_emitter_escape( SyckEmitter *e, const char *src, long len )
else
{
syck_emitter_write( e, "x", 1 );
- syck_emitter_write( e, (const char *)hex_table + ((src[i] & 0xF0) >> 4), 1 );
- syck_emitter_write( e, (const char *)hex_table + (src[i] & 0x0F), 1 );
+ syck_emitter_write( e, (char *)hex_table + ((src[i] & 0xF0) >> 4), 1 );
+ syck_emitter_write( e, (char *)hex_table + (src[i] & 0x0F), 1 );
}
}
else
@@ -802,13 +802,12 @@ syck_emitter_escape( SyckEmitter *e, const char *src, long len )
/*
* Outputs a single-quoted block.
*/
-void
-syck_emit_1quoted( SyckEmitter *e, int width, const char *str, long len )
+void syck_emit_1quoted( SyckEmitter *e, int width, char *str, long len )
{
char do_indent = 0;
- const char *mark = str;
- const char *start = str;
- const char *end = str;
+ char *mark = str;
+ char *start = str;
+ char *end = str;
syck_emitter_write( e, "'", 1 );
while ( mark < str + len ) {
if ( do_indent ) {
@@ -850,13 +849,12 @@ syck_emit_1quoted( SyckEmitter *e, int width, const char *str, long len )
/*
* Outputs a double-quoted block.
*/
-void
-syck_emit_2quoted( SyckEmitter *e, int width, const char *str, long len )
+void syck_emit_2quoted( SyckEmitter *e, int width, char *str, long len )
{
char do_indent = 0;
- const char *mark = str;
- const char *start = str;
- const char *end = str;
+ char *mark = str;
+ char *start = str;
+ char *end = str;
syck_emitter_write( e, "\"", 1 );
while ( mark < str + len ) {
if ( do_indent > 0 ) {
@@ -911,12 +909,11 @@ syck_emit_2quoted( SyckEmitter *e, int width, const char *str, long len )
/*
* Outputs a literal block.
*/
-void
-syck_emit_literal( SyckEmitter *e, char keep_nl, const char *str, long len )
+void syck_emit_literal( SyckEmitter *e, char keep_nl, char *str, long len )
{
- const char *mark = str;
- const char *start = str;
- const char *end = str;
+ char *mark = str;
+ char *start = str;
+ char *end = str;
syck_emitter_write( e, "|", 1 );
if ( keep_nl == NL_CHOMP ) {
syck_emitter_write( e, "-", 1 );
@@ -947,12 +944,11 @@ syck_emit_literal( SyckEmitter *e, char keep_nl, const char *str, long len )
/*
* Outputs a folded block.
*/
-void
-syck_emit_folded( SyckEmitter *e, int width, char keep_nl, const char *str, long len )
+void syck_emit_folded( SyckEmitter *e, int width, char keep_nl, char *str, long len )
{
- const char *mark = str;
- const char *start = str;
- const char *end = str;
+ char *mark = str;
+ char *start = str;
+ char *end = str;
syck_emitter_write( e, ">", 1 );
if ( keep_nl == NL_CHOMP ) {
syck_emitter_write( e, "-", 1 );
@@ -997,7 +993,7 @@ syck_emit_folded( SyckEmitter *e, int width, char keep_nl, const char *str, long
/*
* Begins emission of a sequence.
*/
-void syck_emit_seq( SyckEmitter *e, const char *tag, enum seq_style style )
+void syck_emit_seq( SyckEmitter *e, char *tag, enum seq_style style )
{
SyckLevel *parent = syck_emitter_parent_level( e );
SyckLevel *lvl = syck_emitter_current_level( e );
@@ -1018,8 +1014,7 @@ void syck_emit_seq( SyckEmitter *e, const char *tag, enum seq_style style )
/*
* Begins emission of a mapping.
*/
-void
-syck_emit_map( SyckEmitter *e, const char *tag, enum map_style style )
+void syck_emit_map( SyckEmitter *e, char *tag, enum map_style style )
{
SyckLevel *parent = syck_emitter_parent_level( e );
SyckLevel *lvl = syck_emitter_current_level( e );
@@ -1223,10 +1218,10 @@ syck_emitter_mark_node( SyckEmitter *e, st_data_t n )
e->anchors = st_init_numtable();
}
- if ( ! st_lookup( e->anchors, (st_data_t)oid, (void *)&anchor_name ) )
+ if ( ! st_lookup( e->anchors, (st_data_t)oid, (st_data_t *)&anchor_name ) )
{
int idx = 0;
- const char *anc = ( e->anchor_format == NULL ? DEFAULT_ANCHOR_FORMAT : e->anchor_format );
+ char *anc = ( e->anchor_format == NULL ? DEFAULT_ANCHOR_FORMAT : e->anchor_format );
/*
* Second time hitting this object, let's give it an anchor
diff --git a/ext/syck/handler.c b/ext/syck/handler.c
index d76a72e5cc..56fe838fbd 100644
--- a/ext/syck/handler.c
+++ b/ext/syck/handler.c
@@ -2,11 +2,12 @@
* handler.c
*
* $Author$
+ * $Date$
*
* Copyright (C) 2003 why the lucky stiff
*/
-#include "ruby/ruby.h"
+#include "ruby.h"
#include "syck.h"
SYMID
@@ -36,7 +37,7 @@ syck_hdlr_add_anchor( SyckParser *p, char *a, SyckNode *n )
if ( p->bad_anchors != NULL )
{
SyckNode *bad;
- if ( st_lookup( p->bad_anchors, (st_data_t)a, (void *)&bad ) )
+ if ( st_lookup( p->bad_anchors, (st_data_t)a, (st_data_t *)&bad ) )
{
if ( n->kind != syck_str_kind )
{
@@ -49,7 +50,7 @@ syck_hdlr_add_anchor( SyckParser *p, char *a, SyckNode *n )
{
p->anchors = st_init_strtable();
}
- if ( st_lookup( p->anchors, (st_data_t)a, (void *)&ntmp ) )
+ if ( st_lookup( p->anchors, (st_data_t)a, (st_data_t *)&ntmp ) )
{
if ( ntmp != (void *)1 )
{
@@ -69,7 +70,7 @@ syck_hdlr_remove_anchor( SyckParser *p, char *a )
{
p->anchors = st_init_strtable();
}
- if ( st_delete( p->anchors, (void *)&atmp, (void *)&ntmp ) )
+ if ( st_delete( p->anchors, (st_data_t *)&atmp, (st_data_t *)&ntmp ) )
{
if ( ntmp != (void *)1 )
{
@@ -86,7 +87,7 @@ syck_hdlr_get_anchor( SyckParser *p, char *a )
if ( p->anchors != NULL )
{
- if ( st_lookup( p->anchors, (st_data_t)a, (void *)&n ) )
+ if ( st_lookup( p->anchors, (st_data_t)a, (st_data_t *)&n ) )
{
if ( n != (void *)1 )
{
@@ -99,7 +100,7 @@ syck_hdlr_get_anchor( SyckParser *p, char *a )
{
p->bad_anchors = st_init_strtable();
}
- if ( ! st_lookup( p->bad_anchors, (st_data_t)a, (void *)&n ) )
+ if ( ! st_lookup( p->bad_anchors, (st_data_t)a, (st_data_t *)&n ) )
{
n = (p->bad_anchor_handler)( p, a );
st_insert( p->bad_anchors, (st_data_t)a, (st_data_t)n );
@@ -144,7 +145,7 @@ syck_add_transfer( char *uri, SyckNode *n, int taguri )
}
char *
-syck_xprivate( const char *type_id, int type_len )
+syck_xprivate( char *type_id, int type_len )
{
char *uri = S_ALLOC_N( char, type_len + 14 );
uri[0] = '\0';
@@ -154,7 +155,7 @@ syck_xprivate( const char *type_id, int type_len )
}
char *
-syck_taguri( const char *domain, const char *type_id, int type_len )
+syck_taguri( char *domain, char *type_id, int type_len )
{
char *uri = S_ALLOC_N( char, strlen( domain ) + type_len + 14 );
uri[0] = '\0';
diff --git a/ext/syck/implicit.c b/ext/syck/implicit.c
index 126b896f18..d356faf7d9 100644
--- a/ext/syck/implicit.c
+++ b/ext/syck/implicit.c
@@ -4,11 +4,12 @@
* implicit.re
*
* $Author$
+ * $Date$
*
* Copyright (C) 2003 why the lucky stiff
*/
-#include "ruby/ruby.h"
+#include "ruby.h"
#include "syck.h"
#define YYCTYPE char
@@ -20,7 +21,7 @@
void
try_tag_implicit( SyckNode *n, int taguri )
{
- const char *tid = "";
+ char *tid = "";
switch ( n->kind )
{
case syck_str_kind:
@@ -44,10 +45,9 @@ try_tag_implicit( SyckNode *n, int taguri )
}
}
-const char *
-syck_match_implicit( const char *str, size_t len )
+char *syck_match_implicit( char *str, size_t len )
{
- const char *cursor, *limit, *marker = 0;
+ char *cursor, *limit, *marker;
cursor = str;
limit = str + len;
@@ -1585,7 +1585,7 @@ yy201: ++YYCURSOR;
/* Remove ending fragment and compare types */
int
-syck_tagcmp( const char *tag1, const char *tag2 )
+syck_tagcmp( char *tag1, char *tag2 )
{
if ( tag1 == tag2 ) return 1;
if ( tag1 == NULL || tag2 == NULL ) return 0;
@@ -1609,9 +1609,9 @@ syck_tagcmp( const char *tag1, const char *tag2 )
}
char *
-syck_type_id_to_uri( const char *type_id )
+syck_type_id_to_uri( char *type_id )
{
- const char *cursor, *limit, *marker = 0;
+ char *cursor, *limit, *marker;
cursor = type_id;
limit = type_id + strlen( type_id );
@@ -1620,7 +1620,7 @@ syck_type_id_to_uri( const char *type_id )
#line 1620 "<stdout>"
{
YYCTYPE yych;
- unsigned int yyaccept = 0;
+ unsigned int yyaccept;
goto yy202;
++YYCURSOR;
yy202:
diff --git a/ext/syck/node.c b/ext/syck/node.c
index fb98f655cc..28fc78c077 100644
--- a/ext/syck/node.c
+++ b/ext/syck/node.c
@@ -2,11 +2,12 @@
* node.c
*
* $Author$
+ * $Date$
*
* Copyright (C) 2003 why the lucky stiff
*/
-#include "ruby/ruby.h"
+#include "ruby.h"
#include "syck.h"
/*
@@ -45,7 +46,7 @@ syck_free_node( SyckNode *n )
}
SyckNode *
-syck_alloc_map(void)
+syck_alloc_map()
{
SyckNode *n;
struct SyckMap *m;
@@ -64,7 +65,7 @@ syck_alloc_map(void)
}
SyckNode *
-syck_alloc_seq(void)
+syck_alloc_seq()
{
SyckNode *n;
struct SyckSeq *s;
@@ -82,7 +83,7 @@ syck_alloc_seq(void)
}
SyckNode *
-syck_alloc_str(void)
+syck_alloc_str()
{
SyckNode *n;
struct SyckStr *s;
@@ -99,13 +100,13 @@ syck_alloc_str(void)
}
SyckNode *
-syck_new_str( const char *str, enum scalar_style style )
+syck_new_str( char *str, enum scalar_style style )
{
return syck_new_str2( str, strlen( str ), style );
}
SyckNode *
-syck_new_str2( const char *str, long len, enum scalar_style style )
+syck_new_str2( char *str, long len, enum scalar_style style )
{
SyckNode *n;
@@ -128,7 +129,7 @@ syck_replace_str( SyckNode *n, char *str, enum scalar_style style )
void
syck_replace_str2( SyckNode *n, char *str, long len, enum scalar_style style )
{
- if ( n->data.str->ptr != NULL )
+ if ( n->data.str != NULL )
{
S_FREE( n->data.str->ptr );
n->data.str->ptr = NULL;
diff --git a/ext/syck/rubyext.c b/ext/syck/rubyext.c
index 3538deb5e3..76e8279601 100644
--- a/ext/syck/rubyext.c
+++ b/ext/syck/rubyext.c
@@ -3,12 +3,12 @@
* rubyext.c
*
* $Author$
+ * $Date$
*
* Copyright (C) 2003-2005 why the lucky stiff
*/
-#include "ruby/ruby.h"
-#include "ruby/encoding.h"
+#include "ruby.h"
#include "syck.h"
#include <sys/types.h>
#include <time.h>
@@ -49,21 +49,21 @@ typedef struct {
/*
* symbols and constants
*/
-static ID s_new, s_utc, s_at, s_to_f, s_to_i, s_read, s_binmode, s_call, s_cmp, s_transfer, s_update, s_dup, s_haskey, s_match, s_keys, s_unpack, s_tr_bang, s_default_set, s_tag_read_class, s_tag_subclasses, s_resolver, s_push, s_emitter, s_level, s_detect_implicit, s_node_import, s_out, s_input, s_intern, s_transform, s_yaml_new, s_yaml_initialize, s_node_export, s_to_yaml, s_write, s_set_resolver, s_each;
-static ID s_tags, s_kind, s_name, s_options, s_type_id, s_type_id_set, s_style, s_style_set, s_value, s_value_set, s_parse;
+static ID s_new, s_utc, s_at, s_to_f, s_to_i, s_read, s_binmode, s_call, s_cmp, s_transfer, s_update, s_dup, s_haskey, s_match, s_keys, s_unpack, s_tr_bang, s_default_set, s_tag_read_class, s_tag_subclasses, s_resolver, s_push, s_emitter, s_level, s_detect_implicit, s_node_import, s_out, s_input, s_intern, s_transform, s_yaml_new, s_yaml_initialize, s_node_export, s_to_yaml, s_write, s_set_resolver;
+static ID s_tags, s_domain, s_kind, s_name, s_options, s_type_id, s_type_id_set, s_style, s_style_set, s_value, s_value_set;
static VALUE sym_model, sym_generic, sym_input, sym_bytecode;
static VALUE sym_scalar, sym_seq, sym_map;
static VALUE sym_1quote, sym_2quote, sym_fold, sym_literal, sym_plain, sym_inline;
-static VALUE cDate, cNode, cMap, cSeq, cScalar, cOut, cParser, cResolver, cPrivateType, cDomainType, cYObject, cBadAlias, cDefaultKey, cMergeKey, cEmitter, cDateTime;
+static VALUE cDate, cNode, cMap, cSeq, cScalar, cOut, cParser, cResolver, cPrivateType, cDomainType, cYObject, cBadAlias, cDefaultKey, cMergeKey, cEmitter;
static VALUE oDefaultResolver, oGenericResolver;
/*
* my private collection of numerical oddities.
*/
-static double S_zero(void) { return 0.0; }
-static double S_one(void) { return 1.0; }
-static double S_inf(void) { return S_one() / S_zero(); }
-static double S_nan(void) { return S_zero() / S_zero(); }
+static double S_zero() { return 0.0; }
+static double S_one() { return 1.0; }
+static double S_inf() { return S_one() / S_zero(); }
+static double S_nan() { return S_zero() / S_zero(); }
static VALUE syck_node_transform( VALUE );
@@ -71,7 +71,7 @@ static VALUE syck_node_transform( VALUE );
* handler prototypes
*/
SYMID rb_syck_load_handler _((SyckParser *, SyckNode *));
-void rb_syck_err_handler _((SyckParser *, const char *));
+void rb_syck_err_handler _((SyckParser *, char *));
SyckNode * rb_syck_bad_anchor_handler _((SyckParser *, char *));
void rb_syck_output_handler _((SyckEmitter *, char *, long));
void rb_syck_emitter_handler _((SyckEmitter *, st_data_t));
@@ -97,14 +97,14 @@ struct emitter_xtra {
* Convert YAML to bytecode
*/
VALUE
-rb_syck_compile(VALUE self, VALUE port)
+rb_syck_compile(self, port)
+ VALUE self, port;
{
SYMID oid;
int taint;
char *ret;
VALUE bc;
- bytestring_t *sav = NULL;
- void *data = NULL;
+ bytestring_t *sav;
SyckParser *parser = syck_new_parser();
taint = syck_parser_assign_io(parser, &port);
@@ -113,10 +113,7 @@ rb_syck_compile(VALUE self, VALUE port)
syck_parser_implicit_typing( parser, 0 );
syck_parser_taguri_expansion( parser, 0 );
oid = syck_parse( parser );
- if (!syck_lookup_sym( parser, oid, &data )) {
- rb_raise(rb_eSyntaxError, "root node <%lx> not found", oid);
- }
- sav = data;
+ syck_lookup_sym( parser, oid, (char **)&sav );
ret = S_ALLOCA_N( char, strlen( sav->buffer ) + 3 );
ret[0] = '\0';
@@ -153,8 +150,8 @@ rb_syck_io_str_read( char *buf, SyckIoStr *str, long max_size, long skip )
if (!NIL_P(str2))
{
StringValue(str2);
- len = RSTRING_LEN(str2);
- memcpy( buf + skip, RSTRING_PTR(str2), len );
+ len = RSTRING(str2)->len;
+ memcpy( buf + skip, RSTRING(str2)->ptr, len );
}
}
len += skip;
@@ -167,14 +164,16 @@ rb_syck_io_str_read( char *buf, SyckIoStr *str, long max_size, long skip )
* (returns tainted? boolean)
*/
int
-syck_parser_assign_io(SyckParser *parser, VALUE *pport)
+syck_parser_assign_io(parser, pport)
+ SyckParser *parser;
+ VALUE *pport;
{
int taint = Qtrue;
VALUE tmp, port = *pport;
if (!NIL_P(tmp = rb_check_string_type(port))) {
taint = OBJ_TAINTED(port); /* original taintedness */
port = tmp;
- syck_parser_str( parser, RSTRING_PTR(port), RSTRING_LEN(port), NULL );
+ syck_parser_str( parser, RSTRING(port)->ptr, RSTRING(port)->len, NULL );
}
else if (rb_respond_to(port, s_read)) {
if (rb_respond_to(port, s_binmode)) {
@@ -193,7 +192,8 @@ syck_parser_assign_io(SyckParser *parser, VALUE *pport)
* Get value in hash by key, forcing an empty hash if nil.
*/
VALUE
-syck_get_hash_aref(VALUE hsh, VALUE key)
+syck_get_hash_aref(hsh, key)
+ VALUE hsh, key;
{
VALUE val = rb_hash_aref( hsh, key );
if ( NIL_P( val ) )
@@ -207,17 +207,12 @@ syck_get_hash_aref(VALUE hsh, VALUE key)
/*
* creating timestamps
*/
-struct mktime_arg {
+SYMID
+rb_syck_mktime(str, len)
char *str;
long len;
-};
-
-SYMID
-mktime_do(struct mktime_arg *arg)
{
VALUE time;
- char *str = arg->str;
- long len = arg->len;
char *ptr = str;
VALUE year = INT2FIX(0);
VALUE mon = INT2FIX(0);
@@ -291,7 +286,7 @@ mktime_do(struct mktime_arg *arg)
if ( len > ptr - str && ( *ptr == '-' || *ptr == '+' ) )
{
time_t tz_offset = strtol(ptr, NULL, 10) * 3600;
- VALUE tmp;
+ time_t tmp;
while ( *ptr != ':' && *ptr != '\0' ) ptr++;
if ( *ptr == ':' )
@@ -309,9 +304,8 @@ mktime_do(struct mktime_arg *arg)
/* Make TZ time*/
time = rb_funcall(rb_cTime, s_utc, 6, year, mon, day, hour, min, sec);
- tmp = rb_funcall(time, s_to_i, 0);
- tmp = rb_funcall(tmp, '-', 1, LONG2FIX(tz_offset));
- return rb_funcall(rb_cTime, s_at, 2, tmp, LONG2NUM(usec));
+ tmp = NUM2LONG(rb_funcall(time, s_to_i, 0)) - tz_offset;
+ return rb_funcall(rb_cTime, s_at, 2, LONG2NUM(tmp), LONG2NUM(usec));
}
else
{
@@ -320,35 +314,13 @@ mktime_do(struct mktime_arg *arg)
}
}
-SYMID
-mktime_r(struct mktime_arg *arg)
-{
- if (!cDateTime) {
- /*
- * Load Date module
- */
- rb_require("date");
- cDateTime = rb_const_get(rb_cObject, rb_intern("DateTime"));
- }
- return rb_funcall(cDateTime, s_parse, 1, rb_str_new(arg->str, arg->len));
-}
-
-SYMID
-rb_syck_mktime(char *str, long len)
-{
- struct mktime_arg a;
-
- a.str = str;
- a.len = len;
- return rb_rescue2(mktime_do, (VALUE)&a, mktime_r, (VALUE)&a, rb_eArgError, NULL);
-}
-
/*
* handles merging of an array of hashes
* (see http://www.yaml.org/type/merge/)
*/
VALUE
-syck_merge_i(VALUE entry, VALUE hsh )
+syck_merge_i( entry, hsh )
+ VALUE entry, hsh;
{
VALUE tmp;
if ( !NIL_P(tmp = rb_check_convert_type(entry, T_HASH, "Hash", "to_hash")) )
@@ -363,7 +335,9 @@ syck_merge_i(VALUE entry, VALUE hsh )
* default handler for ruby.yaml.org types
*/
int
-yaml_org_handler( SyckNode *n, VALUE *ref )
+yaml_org_handler( n, ref )
+ SyckNode *n;
+ VALUE *ref;
{
char *type_id = n->type_id;
int transferred = 0;
@@ -547,7 +521,6 @@ yaml_org_handler( SyckNode *n, VALUE *ref )
else if ( strcmp( type_id, "str" ) == 0 )
{
obj = rb_str_new( n->data.str->ptr, n->data.str->len );
- rb_enc_associate(obj, rb_utf8_encoding());
}
else
{
@@ -602,7 +575,7 @@ yaml_org_handler( SyckNode *n, VALUE *ref )
VALUE dup = rb_funcall( tmph, s_dup, 0 );
tmp = rb_ary_reverse( tmp );
rb_ary_push( tmp, obj );
- rb_block_call( tmp, s_each, 0, 0, syck_merge_i, dup );
+ rb_iterate( rb_each, tmp, syck_merge_i, dup );
obj = dup;
skip_aset = 1;
}
@@ -633,7 +606,9 @@ static void syck_node_mark( SyckNode *n );
* - Converts data into native Ruby types
*/
SYMID
-rb_syck_load_handler(SyckParser *p, SyckNode *n)
+rb_syck_load_handler(p, n)
+ SyckParser *p;
+ SyckNode *n;
{
VALUE obj = Qnil;
struct parser_xtra *bonus = (struct parser_xtra *)p->bonus;
@@ -661,7 +636,7 @@ rb_syck_load_handler(SyckParser *p, SyckNode *n)
if ( bonus->taint) OBJ_TAINT( obj );
if ( bonus->proc != 0 ) rb_funcall(bonus->proc, s_call, 1, obj);
- rb_hash_aset(bonus->data, INT2FIX(RHASH_SIZE(bonus->data)), obj);
+ rb_hash_aset(bonus->data, INT2FIX(RHASH(bonus->data)->tbl->num_entries), obj);
return obj;
}
@@ -669,7 +644,9 @@ rb_syck_load_handler(SyckParser *p, SyckNode *n)
* friendly errors.
*/
void
-rb_syck_err_handler(SyckParser *p, const char *msg)
+rb_syck_err_handler(p, msg)
+ SyckParser *p;
+ char *msg;
{
char *endl = p->cursor;
@@ -677,7 +654,7 @@ rb_syck_err_handler(SyckParser *p, const char *msg)
endl++;
endl[0] = '\0';
- rb_raise(rb_eArgError, "%s on line %d, col %"PRIdPTRDIFF": `%s'",
+ rb_raise(rb_eArgError, "%s on line %d, col %d: `%s'",
msg,
p->linect,
p->cursor - p->lineptr,
@@ -688,7 +665,9 @@ rb_syck_err_handler(SyckParser *p, const char *msg)
* provide bad anchor object to the parser.
*/
SyckNode *
-rb_syck_bad_anchor_handler(SyckParser *p, char *a)
+rb_syck_bad_anchor_handler(p, a)
+ SyckParser *p;
+ char *a;
{
VALUE anchor_name = rb_str_new2( a );
SyckNode *badanc = syck_new_map( rb_str_new2( "name" ), anchor_name );
@@ -700,7 +679,8 @@ rb_syck_bad_anchor_handler(SyckParser *p, char *a)
* data loaded based on the model requested.
*/
void
-syck_set_model(VALUE p, VALUE input, VALUE model)
+syck_set_model( p, input, model )
+ VALUE p, input, model;
{
SyckParser *parser;
Data_Get_Struct(p, SyckParser, parser);
@@ -740,7 +720,8 @@ syck_st_mark_nodes( char *key, SyckNode *n, char *arg )
* mark parser nodes
*/
static void
-syck_mark_parser(SyckParser *parser)
+syck_mark_parser(parser)
+ SyckParser *parser;
{
struct parser_xtra *bonus = (struct parser_xtra *)parser->bonus;
rb_gc_mark_maybe(parser->root);
@@ -763,7 +744,8 @@ syck_mark_parser(SyckParser *parser)
* Free the parser and any bonus attachment.
*/
void
-rb_syck_free_parser(SyckParser *p)
+rb_syck_free_parser(p)
+ SyckParser *p;
{
S_FREE( p->bonus );
syck_free_parser(p);
@@ -774,7 +756,8 @@ rb_syck_free_parser(SyckParser *p)
*/
VALUE syck_parser_s_alloc _((VALUE));
VALUE
-syck_parser_s_alloc(VALUE class)
+syck_parser_s_alloc(class)
+ VALUE class;
{
VALUE pobj;
SyckParser *parser = syck_new_parser();
@@ -793,7 +776,10 @@ syck_parser_s_alloc(VALUE class)
* YAML::Syck::Parser.initialize( resolver, options )
*/
static VALUE
-syck_parser_initialize(int argc, VALUE *argv, VALUE self)
+syck_parser_initialize(argc, argv, self)
+ int argc;
+ VALUE *argv;
+ VALUE self;
{
VALUE options;
if (rb_scan_args(argc, argv, "01", &options) == 0)
@@ -813,7 +799,8 @@ syck_parser_initialize(int argc, VALUE *argv, VALUE self)
* YAML::Syck::Parser.bufsize = Integer
*/
static VALUE
-syck_parser_bufsize_set(VALUE self, VALUE size)
+syck_parser_bufsize_set( self, size )
+ VALUE self, size;
{
SyckParser *parser;
@@ -829,7 +816,8 @@ syck_parser_bufsize_set(VALUE self, VALUE size)
* YAML::Syck::Parser.bufsize => Integer
*/
static VALUE
-syck_parser_bufsize_get(VALUE self)
+syck_parser_bufsize_get( self )
+ VALUE self;
{
SyckParser *parser;
@@ -841,7 +829,10 @@ syck_parser_bufsize_get(VALUE self)
* YAML::Syck::Parser.load( IO or String )
*/
VALUE
-syck_parser_load(int argc, VALUE *argv, VALUE self)
+syck_parser_load(argc, argv, self)
+ int argc;
+ VALUE *argv;
+ VALUE self;
{
VALUE port, proc, model, input;
SyckParser *parser;
@@ -868,7 +859,10 @@ syck_parser_load(int argc, VALUE *argv, VALUE self)
* YAML::Syck::Parser.load_documents( IO or String ) { |doc| }
*/
VALUE
-syck_parser_load_documents(int argc, VALUE *argv, VALUE self)
+syck_parser_load_documents(argc, argv, self)
+ int argc;
+ VALUE *argv;
+ VALUE self;
{
VALUE port, proc, v, input, model;
SyckParser *parser;
@@ -909,7 +903,8 @@ syck_parser_load_documents(int argc, VALUE *argv, VALUE self)
* YAML::Syck::Parser#set_resolver
*/
VALUE
-syck_parser_set_resolver(VALUE self, VALUE resolver)
+syck_parser_set_resolver( self, resolver )
+ VALUE self, resolver;
{
rb_ivar_set( self, s_resolver, resolver );
return self;
@@ -919,7 +914,8 @@ syck_parser_set_resolver(VALUE self, VALUE resolver)
* YAML::Syck::Resolver.initialize
*/
static VALUE
-syck_resolver_initialize(VALUE self)
+syck_resolver_initialize( self )
+ VALUE self;
{
rb_ivar_set(self, s_tags, rb_hash_new());
return self;
@@ -929,7 +925,8 @@ syck_resolver_initialize(VALUE self)
* YAML::Syck::Resolver#add_type
*/
VALUE
-syck_resolver_add_type(VALUE self, VALUE taguri, VALUE cls)
+syck_resolver_add_type( self, taguri, cls )
+ VALUE self, taguri, cls;
{
VALUE tags = rb_attr_get(self, s_tags);
rb_hash_aset( tags, taguri, cls );
@@ -940,7 +937,8 @@ syck_resolver_add_type(VALUE self, VALUE taguri, VALUE cls)
* YAML::Syck::Resolver#use_types_at
*/
VALUE
-syck_resolver_use_types_at(VALUE self, VALUE hsh)
+syck_resolver_use_types_at( self, hsh )
+ VALUE self, hsh;
{
rb_ivar_set( self, s_tags, hsh );
return Qnil;
@@ -950,7 +948,8 @@ syck_resolver_use_types_at(VALUE self, VALUE hsh)
* YAML::Syck::Resolver#detect_implicit
*/
VALUE
-syck_resolver_detect_implicit(VALUE self, VALUE val)
+syck_resolver_detect_implicit( self, val )
+ VALUE self, val;
{
return rb_str_new2( "" );
}
@@ -959,10 +958,11 @@ syck_resolver_detect_implicit(VALUE self, VALUE val)
* YAML::Syck::Resolver#node_import
*/
VALUE
-syck_resolver_node_import(VALUE self, VALUE node)
+syck_resolver_node_import( self, node )
+ VALUE self, node;
{
SyckNode *n;
- VALUE obj = Qnil;
+ VALUE obj;
int i = 0;
Data_Get_Struct(node, SyckNode, n);
@@ -1008,7 +1008,7 @@ syck_resolver_node_import(VALUE self, VALUE node)
VALUE dup = rb_funcall( end, s_dup, 0 );
v = rb_ary_reverse( v );
rb_ary_push( v, obj );
- rb_block_call( v, s_each, 0, 0, syck_merge_i, dup );
+ rb_iterate( rb_each, v, syck_merge_i, dup );
obj = dup;
skip_aset = 1;
}
@@ -1039,15 +1039,16 @@ syck_resolver_node_import(VALUE self, VALUE node)
* Set instance variables
*/
VALUE
-syck_set_ivars(VALUE vars, VALUE obj)
+syck_set_ivars( vars, obj )
+ VALUE vars, obj;
{
VALUE ivname = rb_ary_entry( vars, 0 );
char *ivn;
StringValue( ivname );
- ivn = S_ALLOCA_N( char, RSTRING_LEN(ivname) + 2 );
+ ivn = S_ALLOCA_N( char, RSTRING(ivname)->len + 2 );
ivn[0] = '@';
ivn[1] = '\0';
- strncat( ivn, RSTRING_PTR(ivname), RSTRING_LEN(ivname) );
+ strncat( ivn, RSTRING(ivname)->ptr, RSTRING(ivname)->len );
rb_iv_set( obj, ivn, rb_ary_entry( vars, 1 ) );
return Qnil;
}
@@ -1056,12 +1057,13 @@ syck_set_ivars(VALUE vars, VALUE obj)
* YAML::Syck::Resolver#const_find
*/
VALUE
-syck_const_find(VALUE const_name)
+syck_const_find( const_name )
+ VALUE const_name;
{
VALUE tclass = rb_cObject;
VALUE tparts = rb_str_split( const_name, "::" );
int i = 0;
- for ( i = 0; i < RARRAY_LEN(tparts); i++ ) {
+ for ( i = 0; i < RARRAY(tparts)->len; i++ ) {
VALUE tpart = rb_to_id( rb_ary_entry( tparts, i ) );
if ( !rb_const_defined( tclass, tpart ) ) return Qnil;
tclass = rb_const_get( tclass, tpart );
@@ -1073,14 +1075,15 @@ syck_const_find(VALUE const_name)
* YAML::Syck::Resolver#transfer
*/
VALUE
-syck_resolver_transfer(VALUE self, VALUE type, VALUE val)
+syck_resolver_transfer( self, type, val )
+ VALUE self, type, val;
{
- if (NIL_P(type) || RSTRING_LEN(StringValue(type)) == 0)
+ if (NIL_P(type) || RSTRING(StringValue(type))->len == 0)
{
type = rb_funcall( self, s_detect_implicit, 1, val );
}
- if ( ! (NIL_P(type) || RSTRING_LEN(StringValue(type)) == 0) )
+ if ( ! (NIL_P(type) || RSTRING(StringValue(type))->len == 0) )
{
VALUE str_xprivate = rb_str_new2( "x-private" );
VALUE colon = rb_str_new2( ":" );
@@ -1097,7 +1100,7 @@ syck_resolver_transfer(VALUE self, VALUE type, VALUE val)
VALUE subclass_parts = rb_ary_new();
VALUE parts = rb_str_split( type, ":" );
- while ( RARRAY_LEN(parts) > 1 )
+ while ( RARRAY(parts)->len > 1 )
{
VALUE partial;
rb_ary_unshift( subclass_parts, rb_ary_pop( parts ) );
@@ -1115,7 +1118,7 @@ syck_resolver_transfer(VALUE self, VALUE type, VALUE val)
if ( ! NIL_P( target_class ) )
{
subclass = target_class;
- if ( RARRAY_LEN(subclass_parts) > 0 && rb_respond_to( target_class, s_tag_subclasses ) &&
+ if ( RARRAY(subclass_parts)->len > 0 && rb_respond_to( target_class, s_tag_subclasses ) &&
RTEST( rb_funcall( target_class, s_tag_subclasses, 0 ) ) )
{
VALUE subclass_v;
@@ -1174,7 +1177,7 @@ syck_resolver_transfer(VALUE self, VALUE type, VALUE val)
}
else if ( !NIL_P( obj ) && rb_obj_is_instance_of( val, rb_cHash ) )
{
- rb_block_call( val, s_each, 0, 0, syck_set_ivars, obj );
+ rb_iterate( rb_each, val, syck_set_ivars, obj );
}
}
else
@@ -1204,13 +1207,14 @@ syck_resolver_transfer(VALUE self, VALUE type, VALUE val)
* YAML::Syck::Resolver#tagurize
*/
VALUE
-syck_resolver_tagurize(VALUE self, VALUE val)
+syck_resolver_tagurize( self, val )
+ VALUE self, val;
{
VALUE tmp = rb_check_string_type(val);
if ( !NIL_P(tmp) )
{
- char *taguri = syck_type_id_to_uri( RSTRING_PTR(tmp) );
+ char *taguri = syck_type_id_to_uri( RSTRING(tmp)->ptr );
val = rb_str_new2( taguri );
S_FREE( taguri );
}
@@ -1222,15 +1226,16 @@ syck_resolver_tagurize(VALUE self, VALUE val)
* YAML::Syck::DefaultResolver#detect_implicit
*/
VALUE
-syck_defaultresolver_detect_implicit(VALUE self, VALUE val)
+syck_defaultresolver_detect_implicit( self, val )
+ VALUE self, val;
{
- const char *type_id;
+ char *type_id;
VALUE tmp = rb_check_string_type(val);
if ( !NIL_P(tmp) )
{
val = tmp;
- type_id = syck_match_implicit( RSTRING_PTR(val), RSTRING_LEN(val) );
+ type_id = syck_match_implicit( RSTRING(val)->ptr, RSTRING(val)->len );
return rb_str_new2( type_id );
}
@@ -1241,7 +1246,8 @@ syck_defaultresolver_detect_implicit(VALUE self, VALUE val)
* YAML::Syck::DefaultResolver#node_import
*/
VALUE
-syck_defaultresolver_node_import(VALUE self, VALUE node)
+syck_defaultresolver_node_import( self, node )
+ VALUE self, node;
{
SyckNode *n;
VALUE obj;
@@ -1257,7 +1263,8 @@ syck_defaultresolver_node_import(VALUE self, VALUE node)
* YAML::Syck::GenericResolver#node_import
*/
VALUE
-syck_genericresolver_node_import(VALUE self, VALUE node)
+syck_genericresolver_node_import( self, node )
+ VALUE self, node;
{
SyckNode *n;
int i = 0;
@@ -1274,7 +1281,6 @@ syck_genericresolver_node_import(VALUE self, VALUE node)
case syck_str_kind:
{
v = rb_str_new( n->data.str->ptr, n->data.str->len );
- rb_enc_associate(v, rb_utf8_encoding());
if ( n->data.str->style == scalar_1quote )
{
style = sym_1quote;
@@ -1335,7 +1341,8 @@ syck_genericresolver_node_import(VALUE self, VALUE node)
* YAML::Syck::BadAlias.initialize
*/
VALUE
-syck_badalias_initialize(VALUE self, VALUE val)
+syck_badalias_initialize( self, val )
+ VALUE self, val;
{
rb_iv_set( self, "@name", val );
return self;
@@ -1345,7 +1352,8 @@ syck_badalias_initialize(VALUE self, VALUE val)
* YAML::Syck::BadAlias.<=>
*/
VALUE
-syck_badalias_cmp(VALUE alias1, VALUE alias2)
+syck_badalias_cmp( alias1, alias2 )
+ VALUE alias1, alias2;
{
VALUE str1 = rb_ivar_get( alias1, s_name );
VALUE str2 = rb_ivar_get( alias2, s_name );
@@ -1357,7 +1365,8 @@ syck_badalias_cmp(VALUE alias1, VALUE alias2)
* YAML::DomainType.initialize
*/
VALUE
-syck_domaintype_initialize(VALUE self, VALUE domain, VALUE type_id, VALUE val)
+syck_domaintype_initialize( self, domain, type_id, val )
+ VALUE self, domain, type_id, val;
{
rb_iv_set( self, "@domain", domain );
rb_iv_set( self, "@type_id", type_id );
@@ -1369,7 +1378,8 @@ syck_domaintype_initialize(VALUE self, VALUE domain, VALUE type_id, VALUE val)
* YAML::Object.initialize
*/
VALUE
-syck_yobject_initialize(VALUE self, VALUE klass, VALUE ivars)
+syck_yobject_initialize( self, klass, ivars )
+ VALUE self, klass, ivars;
{
rb_iv_set( self, "@class", klass );
rb_iv_set( self, "@ivars", ivars );
@@ -1380,7 +1390,8 @@ syck_yobject_initialize(VALUE self, VALUE klass, VALUE ivars)
* YAML::PrivateType.initialize
*/
VALUE
-syck_privatetype_initialize(VALUE self, VALUE type_id, VALUE val)
+syck_privatetype_initialize( self, type_id, val )
+ VALUE self, type_id, val;
{
rb_iv_set( self, "@type_id", type_id );
rb_iv_set( self, "@value", val );
@@ -1391,7 +1402,8 @@ syck_privatetype_initialize(VALUE self, VALUE type_id, VALUE val)
* Mark node contents.
*/
static void
-syck_node_mark(SyckNode *n)
+syck_node_mark( n )
+ SyckNode *n;
{
int i;
rb_gc_mark_maybe( n->id );
@@ -1411,11 +1423,6 @@ syck_node_mark(SyckNode *n)
rb_gc_mark( syck_map_read( n, map_value, i ) );
}
break;
-
- case syck_str_kind:
- default:
- /* nothing */
- break;
}
#if 0 /* maybe needed */
if ( n->shortcut ) syck_node_mark( n->shortcut ); /* caution: maybe cyclic */
@@ -1426,7 +1433,8 @@ syck_node_mark(SyckNode *n)
* YAML::Syck::Scalar.allocate
*/
VALUE
-syck_scalar_alloc(VALUE class)
+syck_scalar_alloc( class )
+ VALUE class;
{
SyckNode *node = syck_alloc_str();
VALUE obj = Data_Wrap_Struct( class, syck_node_mark, syck_free_node, node );
@@ -1438,7 +1446,8 @@ syck_scalar_alloc(VALUE class)
* YAML::Syck::Scalar.initialize
*/
VALUE
-syck_scalar_initialize(VALUE self, VALUE type_id, VALUE val, VALUE style)
+syck_scalar_initialize( self, type_id, val, style )
+ VALUE self, type_id, val, style;
{
rb_iv_set( self, "@kind", sym_scalar );
rb_funcall( self, s_type_id_set, 1, type_id );
@@ -1451,7 +1460,8 @@ syck_scalar_initialize(VALUE self, VALUE type_id, VALUE val, VALUE style)
* YAML::Syck::Scalar.style=
*/
VALUE
-syck_scalar_style_set(VALUE self, VALUE style)
+syck_scalar_style_set( self, style )
+ VALUE self, style;
{
SyckNode *node;
Data_Get_Struct( self, SyckNode, node );
@@ -1489,14 +1499,15 @@ syck_scalar_style_set(VALUE self, VALUE style)
* YAML::Syck::Scalar.value=
*/
VALUE
-syck_scalar_value_set(VALUE self, VALUE val)
+syck_scalar_value_set( self, val )
+ VALUE self, val;
{
SyckNode *node;
Data_Get_Struct( self, SyckNode, node );
StringValue( val );
- node->data.str->ptr = syck_strndup( RSTRING_PTR(val), RSTRING_LEN(val) );
- node->data.str->len = RSTRING_LEN(val);
+ node->data.str->ptr = syck_strndup( RSTRING(val)->ptr, RSTRING(val)->len );
+ node->data.str->len = RSTRING(val)->len;
node->data.str->style = scalar_none;
rb_iv_set( self, "@value", val );
@@ -1507,7 +1518,8 @@ syck_scalar_value_set(VALUE self, VALUE val)
* YAML::Syck::Seq.allocate
*/
VALUE
-syck_seq_alloc(VALUE class)
+syck_seq_alloc( class )
+ VALUE class;
{
SyckNode *node;
VALUE obj;
@@ -1521,7 +1533,8 @@ syck_seq_alloc(VALUE class)
* YAML::Syck::Seq.initialize
*/
VALUE
-syck_seq_initialize(VALUE self, VALUE type_id, VALUE val, VALUE style)
+syck_seq_initialize( self, type_id, val, style )
+ VALUE self, type_id, val, style;
{
SyckNode *node;
Data_Get_Struct( self, SyckNode, node );
@@ -1537,7 +1550,8 @@ syck_seq_initialize(VALUE self, VALUE type_id, VALUE val, VALUE style)
* YAML::Syck::Seq.value=
*/
VALUE
-syck_seq_value_set(VALUE self, VALUE val)
+syck_seq_value_set( self, val )
+ VALUE self, val;
{
SyckNode *node;
Data_Get_Struct( self, SyckNode, node );
@@ -1546,7 +1560,7 @@ syck_seq_value_set(VALUE self, VALUE val)
if ( !NIL_P( val ) ) {
int i;
syck_seq_empty( node );
- for ( i = 0; i < RARRAY_LEN( val ); i++ )
+ for ( i = 0; i < RARRAY( val )->len; i++ )
{
syck_seq_add( node, rb_ary_entry(val, i) );
}
@@ -1560,7 +1574,8 @@ syck_seq_value_set(VALUE self, VALUE val)
* YAML::Syck::Seq.add
*/
VALUE
-syck_seq_add_m(VALUE self, VALUE val)
+syck_seq_add_m( self, val )
+ VALUE self, val;
{
SyckNode *node;
VALUE emitter = rb_ivar_get( self, s_emitter );
@@ -1579,7 +1594,8 @@ syck_seq_add_m(VALUE self, VALUE val)
* YAML::Syck::Seq.style=
*/
VALUE
-syck_seq_style_set(VALUE self, VALUE style)
+syck_seq_style_set( self, style )
+ VALUE self, style;
{
SyckNode *node;
Data_Get_Struct( self, SyckNode, node );
@@ -1601,7 +1617,8 @@ syck_seq_style_set(VALUE self, VALUE style)
* YAML::Syck::Map.allocate
*/
VALUE
-syck_map_alloc(VALUE class)
+syck_map_alloc( class )
+ VALUE class;
{
SyckNode *node;
VALUE obj;
@@ -1615,7 +1632,8 @@ syck_map_alloc(VALUE class)
* YAML::Syck::Map.initialize
*/
VALUE
-syck_map_initialize(VALUE self, VALUE type_id, VALUE val, VALUE style)
+syck_map_initialize( self, type_id, val, style )
+ VALUE self, type_id, val, style;
{
SyckNode *node;
Data_Get_Struct( self, SyckNode, node );
@@ -1631,7 +1649,7 @@ syck_map_initialize(VALUE self, VALUE type_id, VALUE val, VALUE style)
}
keys = rb_funcall( hsh, s_keys, 0 );
- for ( i = 0; i < RARRAY_LEN(keys); i++ )
+ for ( i = 0; i < RARRAY(keys)->len; i++ )
{
VALUE key = rb_ary_entry(keys, i);
syck_map_add( node, key, rb_hash_aref(hsh, key) );
@@ -1649,7 +1667,8 @@ syck_map_initialize(VALUE self, VALUE type_id, VALUE val, VALUE style)
* YAML::Syck::Map.value=
*/
VALUE
-syck_map_value_set(VALUE self, VALUE val)
+syck_map_value_set( self, val )
+ VALUE self, val;
{
SyckNode *node;
Data_Get_Struct( self, SyckNode, node );
@@ -1666,7 +1685,7 @@ syck_map_value_set(VALUE self, VALUE val)
syck_map_empty( node );
keys = rb_funcall( hsh, s_keys, 0 );
- for ( i = 0; i < RARRAY_LEN(keys); i++ )
+ for ( i = 0; i < RARRAY(keys)->len; i++ )
{
VALUE key = rb_ary_entry(keys, i);
syck_map_add( node, key, rb_hash_aref(hsh, key) );
@@ -1681,7 +1700,8 @@ syck_map_value_set(VALUE self, VALUE val)
* YAML::Syck::Map.add
*/
VALUE
-syck_map_add_m(VALUE self, VALUE key, VALUE val)
+syck_map_add_m( self, key, val )
+ VALUE self, key, val;
{
SyckNode *node;
VALUE emitter = rb_ivar_get( self, s_emitter );
@@ -1701,7 +1721,8 @@ syck_map_add_m(VALUE self, VALUE key, VALUE val)
* YAML::Syck::Map.style=
*/
VALUE
-syck_map_style_set(VALUE self, VALUE style)
+syck_map_style_set( self, style )
+ VALUE self, style;
{
SyckNode *node;
Data_Get_Struct( self, SyckNode, node );
@@ -1723,7 +1744,8 @@ syck_map_style_set(VALUE self, VALUE style)
* Cloning method for all node types
*/
VALUE
-syck_node_init_copy(VALUE copy, VALUE orig)
+syck_node_init_copy( copy, orig )
+ VALUE copy, orig;
{
SyckNode *copy_n;
SyckNode *orig_n;
@@ -1746,7 +1768,8 @@ syck_node_init_copy(VALUE copy, VALUE orig)
* YAML::Syck::Node#type_id=
*/
VALUE
-syck_node_type_id_set(VALUE self, VALUE type_id)
+syck_node_type_id_set( self, type_id )
+ VALUE self, type_id;
{
SyckNode *node;
Data_Get_Struct( self, SyckNode, node );
@@ -1755,7 +1778,7 @@ syck_node_type_id_set(VALUE self, VALUE type_id)
if ( !NIL_P( type_id ) ) {
StringValue( type_id );
- node->type_id = syck_strndup( RSTRING_PTR(type_id), RSTRING_LEN(type_id) );
+ node->type_id = syck_strndup( RSTRING(type_id)->ptr, RSTRING(type_id)->len );
}
rb_iv_set( self, "@type_id", type_id );
@@ -1766,10 +1789,11 @@ syck_node_type_id_set(VALUE self, VALUE type_id)
* YAML::Syck::Node.transform
*/
VALUE
-syck_node_transform(VALUE self)
+syck_node_transform( self )
+ VALUE self;
{
VALUE t;
- SyckNode *n = NULL;
+ SyckNode *n;
SyckNode *orig_n;
Data_Get_Struct(self, SyckNode, orig_n);
t = Data_Wrap_Struct( cNode, syck_node_mark, syck_free_node, 0 );
@@ -1822,7 +1846,9 @@ syck_node_transform(VALUE self)
* No one could possibly object.
*/
void
-rb_syck_emitter_handler(SyckEmitter *e, st_data_t data)
+rb_syck_emitter_handler(e, data)
+ SyckEmitter *e;
+ st_data_t data;
{
SyckNode *n;
Data_Get_Struct((VALUE)data, SyckNode, n);
@@ -1866,7 +1892,10 @@ rb_syck_emitter_handler(SyckEmitter *e, st_data_t data)
* Handle output from the emitter
*/
void
-rb_syck_output_handler(SyckEmitter * emitter, char *str, long len)
+rb_syck_output_handler( emitter, str, len )
+ SyckEmitter *emitter;
+ char *str;
+ long len;
{
struct emitter_xtra *bonus = (struct emitter_xtra *)emitter->bonus;
VALUE dest = bonus->port;
@@ -1882,7 +1911,8 @@ rb_syck_output_handler(SyckEmitter * emitter, char *str, long len)
* symbol table.
*/
void
-syck_out_mark(VALUE emitter, VALUE node)
+syck_out_mark( emitter, node )
+ VALUE emitter, node;
{
SyckEmitter *emitterPtr;
struct emitter_xtra *bonus;
@@ -1899,7 +1929,8 @@ syck_out_mark(VALUE emitter, VALUE node)
* Mark emitter values.
*/
static void
-syck_mark_emitter(SyckEmitter *emitter)
+syck_mark_emitter(emitter)
+ SyckEmitter *emitter;
{
struct emitter_xtra *bonus = (struct emitter_xtra *)emitter->bonus;
rb_gc_mark( bonus->oid );
@@ -1911,7 +1942,8 @@ syck_mark_emitter(SyckEmitter *emitter)
* Free the emitter and any bonus attachment.
*/
void
-rb_syck_free_emitter(SyckEmitter *e)
+rb_syck_free_emitter(e)
+ SyckEmitter *e;
{
S_FREE( e->bonus );
syck_free_emitter(e);
@@ -1922,7 +1954,8 @@ rb_syck_free_emitter(SyckEmitter *e)
*/
VALUE syck_emitter_s_alloc _((VALUE));
VALUE
-syck_emitter_s_alloc(VALUE class)
+syck_emitter_s_alloc(class)
+ VALUE class;
{
VALUE pobj;
SyckEmitter *emitter = syck_new_emitter();
@@ -1942,7 +1975,10 @@ syck_emitter_s_alloc(VALUE class)
* YAML::Syck::Emitter.reset( options )
*/
VALUE
-syck_emitter_reset(int argc, VALUE *argv, VALUE self)
+syck_emitter_reset( argc, argv, self )
+ int argc;
+ VALUE *argv;
+ VALUE self;
{
VALUE options, tmp;
SyckEmitter *emitter;
@@ -1984,7 +2020,10 @@ syck_emitter_reset(int argc, VALUE *argv, VALUE self)
* YAML::Syck::Emitter.emit( object_id ) { |out| ... }
*/
VALUE
-syck_emitter_emit(int argc, VALUE *argv, VALUE self)
+syck_emitter_emit( argc, argv, self )
+ int argc;
+ VALUE *argv;
+ VALUE self;
{
VALUE oid, proc;
SyckEmitter *emitter;
@@ -2024,7 +2063,8 @@ syck_emitter_emit(int argc, VALUE *argv, VALUE self)
* YAML::Syck::Emitter#node_export
*/
VALUE
-syck_emitter_node_export(VALUE self, VALUE node)
+syck_emitter_node_export( self, node )
+ VALUE self, node;
{
return rb_funcall( node, s_to_yaml, 1, self );
}
@@ -2033,7 +2073,8 @@ syck_emitter_node_export(VALUE self, VALUE node)
* YAML::Syck::Emitter#set_resolver
*/
VALUE
-syck_emitter_set_resolver(VALUE self, VALUE resolver)
+syck_emitter_set_resolver( self, resolver )
+ VALUE self, resolver;
{
rb_ivar_set( self, s_resolver, resolver );
return self;
@@ -2043,7 +2084,8 @@ syck_emitter_set_resolver(VALUE self, VALUE resolver)
* YAML::Syck::Out::initialize
*/
VALUE
-syck_out_initialize(VALUE self, VALUE emitter)
+syck_out_initialize( self, emitter )
+ VALUE self, emitter;
{
rb_ivar_set( self, s_emitter, emitter );
return self;
@@ -2053,7 +2095,10 @@ syck_out_initialize(VALUE self, VALUE emitter)
* YAML::Syck::Out::map
*/
VALUE
-syck_out_map(int argc, VALUE *argv, VALUE self)
+syck_out_map( argc, argv, self )
+ int argc;
+ VALUE *argv;
+ VALUE self;
{
VALUE type_id, style, map;
if (rb_scan_args(argc, argv, "11", &type_id, &style) == 1) {
@@ -2069,7 +2114,10 @@ syck_out_map(int argc, VALUE *argv, VALUE self)
* YAML::Syck::Out::seq
*/
VALUE
-syck_out_seq(int argc, VALUE *argv, VALUE self)
+syck_out_seq( argc, argv, self )
+ int argc;
+ VALUE *argv;
+ VALUE self;
{
VALUE type_id, style, seq;
if (rb_scan_args(argc, argv, "11", &type_id, &style) == 1) {
@@ -2087,10 +2135,15 @@ syck_out_scalar( self, type_id, str, style )
VALUE self, type_id, str, style;
*/
VALUE
-syck_out_scalar(int argc, VALUE *argv, VALUE self)
+syck_out_scalar( argc, argv, self )
+ int argc;
+ VALUE *argv;
+ VALUE self;
{
VALUE type_id, str, style, scalar;
- rb_scan_args(argc, argv, "21", &type_id, &str, &style);
+ if (rb_scan_args(argc, argv, "21", &type_id, &str, &style) == 2) {
+ style = Qnil;
+ }
scalar = rb_funcall( cScalar, s_new, 3, type_id, str, style );
syck_out_mark( rb_ivar_get( self, s_emitter ), scalar );
return scalar;
@@ -2142,8 +2195,6 @@ Init_syck()
s_transform = rb_intern( "transform" );
s_yaml_new = rb_intern("yaml_new");
s_yaml_initialize = rb_intern("yaml_initialize");
- s_each = rb_intern("each");
- s_parse = rb_intern("parse");
s_tags = rb_intern("@tags");
s_name = rb_intern("@name");
diff --git a/ext/syck/syck.c b/ext/syck/syck.c
index e0fc2bc244..a83c8813c1 100644
--- a/ext/syck/syck.c
+++ b/ext/syck/syck.c
@@ -2,10 +2,11 @@
* syck.c
*
* $Author$
+ * $Date$
*
* Copyright (C) 2003 why the lucky stiff
*/
-#include "ruby/ruby.h"
+#include "ruby.h"
#include <stdio.h>
#include <string.h>
@@ -18,11 +19,11 @@ void syck_parser_pop_level( SyckParser * );
* Custom assert
*/
void
-syck_assert( const char *file_name, unsigned line_num, const char *expr )
+syck_assert( char *file_name, unsigned line_num )
{
fflush( NULL );
- fprintf( stderr, "\nAssertion failed: %s, line %u: %s\n",
- file_name, line_num, expr );
+ fprintf( stderr, "\nAssertion failed: %s, line %u\n",
+ file_name, line_num );
fflush( stderr );
abort();
}
@@ -31,7 +32,7 @@ syck_assert( const char *file_name, unsigned line_num, const char *expr )
* Allocates and copies a string
*/
char *
-syck_strndup( const char *buf, long len )
+syck_strndup( char *buf, long len )
{
char *new = S_ALLOC_N( char, len + 1 );
S_MEMZERO( new, char, len + 1 );
@@ -154,7 +155,7 @@ syck_parser_set_root_on_error( SyckParser *p, SYMID roer )
* Allocate the parser
*/
SyckParser *
-syck_new_parser(void)
+syck_new_parser()
{
SyckParser *p;
p = S_ALLOC( SyckParser );
@@ -177,7 +178,7 @@ syck_new_parser(void)
}
int
-syck_add_sym( SyckParser *p, void *data )
+syck_add_sym( SyckParser *p, char *data )
{
SYMID id = 0;
if ( p->syms == NULL )
@@ -190,14 +191,10 @@ syck_add_sym( SyckParser *p, void *data )
}
int
-syck_lookup_sym( SyckParser *p, SYMID id, void **datap )
+syck_lookup_sym( SyckParser *p, SYMID id, char **data )
{
- st_data_t data;
- int ret;
if ( p->syms == NULL ) return 0;
- ret = st_lookup( p->syms, id, &data );
- if(ret) *datap = (void *)data;
- return ret;
+ return st_lookup( p->syms, id, (st_data_t *)data );
}
int
@@ -229,22 +226,6 @@ syck_st_free( SyckParser *p )
}
}
-typedef struct {
- long hash;
- char *buffer;
- long length;
- long remaining;
- int printed;
-} bytestring_t;
-
-int
-syck_st_free_syms( void *key, bytestring_t *sav, void *dummy )
-{
- S_FREE(sav->buffer);
- S_FREE(sav);
- return ST_CONTINUE;
-}
-
void
syck_free_parser( SyckParser *p )
{
@@ -253,7 +234,6 @@ syck_free_parser( SyckParser *p )
*/
if ( p->syms != NULL )
{
- st_foreach( p->syms, syck_st_free_syms, 0 );
st_free_table( p->syms );
p->syms = NULL;
}
@@ -514,9 +494,9 @@ syck_parse( SyckParser *p )
}
void
-syck_default_error_handler( SyckParser *p, const char *msg )
+syck_default_error_handler( SyckParser *p, char *msg )
{
- printf( "Error at [Line %d, Col %"PRIdPTRDIFF"]: %s\n",
+ printf( "Error at [Line %d, Col %d]: %s\n",
p->linect,
p->cursor - p->lineptr,
msg );
diff --git a/ext/syck/syck.h b/ext/syck/syck.h
index 81b3d67952..e7d07e9c0d 100644
--- a/ext/syck/syck.h
+++ b/ext/syck/syck.h
@@ -2,6 +2,7 @@
* syck.h
*
* $Author$
+ * $Date$
*
* Copyright (C) 2003 why the lucky stiff
*/
@@ -18,7 +19,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
-#include "ruby/st.h"
+#include "st.h"
#if defined(__cplusplus)
extern "C" {
@@ -32,11 +33,14 @@ extern "C" {
#endif
#if DEBUG
-void syck_assert( const char *, unsigned, const char * );
+ void syck_assert( char *, unsigned );
# define ASSERT(f) \
- (( f ) ? (void)0 : syck_assert( __FILE__, __LINE__, #f ))
+ if ( f ) \
+ {} \
+ else \
+ syck_assert( __FILE__, __LINE__ )
#else
-# define ASSERT(f) ((void)0)
+# define ASSERT(f)
#endif
#ifndef NULL
@@ -152,7 +156,7 @@ typedef struct _syck_str SyckIoStr;
typedef struct _syck_level SyckLevel;
typedef SYMID (*SyckNodeHandler)(SyckParser *, SyckNode *);
-typedef void (*SyckErrorHandler)(SyckParser *, const char *);
+typedef void (*SyckErrorHandler)(SyckParser *, char *);
typedef SyckNode * (*SyckBadAnchorHandler)(SyckParser *, char *);
typedef long (*SyckIoFileRead)(char *, SyckIoFile *, long, long);
typedef long (*SyckIoStrRead)(char *, SyckIoStr *, long, long);
@@ -342,57 +346,57 @@ SyckNode *syck_hdlr_add_anchor( SyckParser *, char *, SyckNode * );
void syck_hdlr_remove_anchor( SyckParser *, char * );
SyckNode *syck_hdlr_get_anchor( SyckParser *, char * );
void syck_add_transfer( char *, SyckNode *, int );
-char *syck_xprivate( const char *, int );
-char *syck_taguri( const char *, const char *, int );
-int syck_tagcmp( const char *, const char * );
-int syck_add_sym( SyckParser *, void * );
-int syck_lookup_sym( SyckParser *, SYMID, void ** );
+char *syck_xprivate( char *, int );
+char *syck_taguri( char *, char *, int );
+int syck_tagcmp( char *, char * );
+int syck_add_sym( SyckParser *, char * );
+int syck_lookup_sym( SyckParser *, SYMID, char ** );
int syck_try_implicit( SyckNode * );
-char *syck_type_id_to_uri( const char * );
+char *syck_type_id_to_uri( char * );
void try_tag_implicit( SyckNode *, int );
-const char *syck_match_implicit( const char *, size_t );
+char *syck_match_implicit( char *, size_t );
/*
* API prototypes
*/
-char *syck_strndup( const char *, long );
+char *syck_strndup( char *, long );
long syck_io_file_read( char *, SyckIoFile *, long, long );
long syck_io_str_read( char *, SyckIoStr *, long, long );
char *syck_base64enc( char *, long );
char *syck_base64dec( char *, long );
-SyckEmitter *syck_new_emitter(void);
+SyckEmitter *syck_new_emitter();
SYMID syck_emitter_mark_node( SyckEmitter *, st_data_t );
void syck_emitter_ignore_id( SyckEmitter *, SYMID );
void syck_output_handler( SyckEmitter *, SyckOutputHandler );
void syck_emitter_handler( SyckEmitter *, SyckEmitterHandler );
void syck_free_emitter( SyckEmitter * );
void syck_emitter_clear( SyckEmitter * );
-void syck_emitter_write( SyckEmitter *, const char *, long );
-void syck_emitter_escape( SyckEmitter *, const char *, long );
+void syck_emitter_write( SyckEmitter *, char *, long );
+void syck_emitter_escape( SyckEmitter *, char *, long );
void syck_emitter_flush( SyckEmitter *, long );
void syck_emit( SyckEmitter *, st_data_t );
-void syck_emit_scalar( SyckEmitter *, const char *, enum scalar_style, int, int, char, const char *, long );
-void syck_emit_1quoted( SyckEmitter *, int, const char *, long );
-void syck_emit_2quoted( SyckEmitter *, int, const char *, long );
-void syck_emit_folded( SyckEmitter *, int, char, const char *, long );
-void syck_emit_literal( SyckEmitter *, char, const char *, long );
-void syck_emit_seq( SyckEmitter *, const char *, enum seq_style );
+void syck_emit_scalar( SyckEmitter *, char *, enum scalar_style, int, int, char, char *, long );
+void syck_emit_1quoted( SyckEmitter *, int, char *, long );
+void syck_emit_2quoted( SyckEmitter *, int, char *, long );
+void syck_emit_folded( SyckEmitter *, int, char, char *, long );
+void syck_emit_literal( SyckEmitter *, char, char *, long );
+void syck_emit_seq( SyckEmitter *, char *, enum seq_style );
void syck_emit_item( SyckEmitter *, st_data_t );
-void syck_emit_map( SyckEmitter *, const char *, enum map_style );
+void syck_emit_map( SyckEmitter *, char *, enum map_style );
void syck_emit_end( SyckEmitter * );
-void syck_emit_tag( SyckEmitter *, const char *, const char * );
+void syck_emit_tag( SyckEmitter *, char *, char * );
void syck_emit_indent( SyckEmitter * );
SyckLevel *syck_emitter_current_level( SyckEmitter * );
SyckLevel *syck_emitter_parent_level( SyckEmitter * );
void syck_emitter_pop_level( SyckEmitter * );
void syck_emitter_add_level( SyckEmitter *, int, enum syck_level_status );
void syck_emitter_reset_levels( SyckEmitter * );
-SyckParser *syck_new_parser(void);
+SyckParser *syck_new_parser();
void syck_free_parser( SyckParser * );
void syck_parser_set_root_on_error( SyckParser *, SYMID );
void syck_parser_implicit_typing( SyckParser *, int );
void syck_parser_taguri_expansion( SyckParser *, int );
-int syck_scan_scalar( int, const char *, long );
+int syck_scan_scalar( int, char *, long );
void syck_parser_handler( SyckParser *, SyckNodeHandler );
void syck_parser_error_handler( SyckParser *, SyckErrorHandler );
void syck_parser_bad_anchor_handler( SyckParser *, SyckBadAnchorHandler );
@@ -407,20 +411,20 @@ void free_any_io( SyckParser * );
long syck_parser_read( SyckParser * );
long syck_parser_readlen( SyckParser *, long );
SYMID syck_parse( SyckParser * );
-void syck_default_error_handler( SyckParser *, const char * );
+void syck_default_error_handler( SyckParser *, char * );
SYMID syck_yaml2byte_handler( SyckParser *, SyckNode * );
char *syck_yaml2byte( char * );
/*
* Allocation prototypes
*/
-SyckNode *syck_alloc_map(void);
-SyckNode *syck_alloc_seq(void);
-SyckNode *syck_alloc_str(void);
+SyckNode *syck_alloc_map();
+SyckNode *syck_alloc_seq();
+SyckNode *syck_alloc_str();
void syck_free_node( SyckNode * );
void syck_free_members( SyckNode * );
-SyckNode *syck_new_str( const char *, enum scalar_style );
-SyckNode *syck_new_str2( const char *, long, enum scalar_style );
+SyckNode *syck_new_str( char *, enum scalar_style );
+SyckNode *syck_new_str2( char *, long, enum scalar_style );
void syck_replace_str( SyckNode *, char *, enum scalar_style );
void syck_replace_str2( SyckNode *, char *, long, enum scalar_style );
void syck_str_blow_away_commas( SyckNode * );
@@ -442,7 +446,7 @@ long syck_seq_count( SyckNode * );
/*
* Lexer prototypes
*/
-void syckerror( const char * );
+void syckerror( char * );
int syckparse( void * );
union YYSTYPE;
int sycklex( union YYSTYPE *, SyckParser * );
diff --git a/ext/syck/token.c b/ext/syck/token.c
index 1b26e66bdb..3c6cd1a9cf 100644
--- a/ext/syck/token.c
+++ b/ext/syck/token.c
@@ -4,10 +4,11 @@
* token.re
*
* $Author$
+ * $Date$
*
* Copyright (C) 2003 why the lucky stiff
*/
-#include "ruby/ruby.h"
+#include "ruby.h"
#include "syck.h"
#include "gram.h"
@@ -1116,7 +1117,7 @@ Directive:
#line 1117 "<stdout>"
{
YYCTYPE yych;
- unsigned int yyaccept = 0;
+ unsigned int yyaccept;
goto yy94;
++YYCURSOR;
yy94:
@@ -2713,7 +2714,7 @@ syckwrap()
}
void
-syckerror( const char *msg )
+syckerror( char *msg )
{
if ( syck_parser_ptr->error_handler == NULL )
syck_parser_ptr->error_handler = syck_default_error_handler;
diff --git a/ext/syck/yaml2byte.c b/ext/syck/yaml2byte.c
index 1b1ce26c49..821a3cd5b5 100644
--- a/ext/syck/yaml2byte.c
+++ b/ext/syck/yaml2byte.c
@@ -2,13 +2,14 @@
* yaml2byte.c
*
* $Author$
+ * $Date$
*
* Copyright (C) 2003 why the lucky stiff, clark evans
*
* WARNING WARNING WARNING --- THIS IS *NOT JUST* PLAYING
* ANYMORE! -- WHY HAS EMBRACED THIS AS THE REAL THING!
*/
-#include "ruby/ruby.h"
+#include "ruby.h"
#include <syck.h>
#include <assert.h>
#define YAMLBYTE_UTF8
@@ -34,7 +35,7 @@ typedef struct {
long remaining;
int printed;
} bytestring_t;
-bytestring_t *bytestring_alloc(void) {
+bytestring_t *bytestring_alloc() {
bytestring_t *ret;
/*TRACE0("bytestring_alloc()");*/
ret = S_ALLOC(bytestring_t);
@@ -128,7 +129,6 @@ syck_yaml2byte_handler(p, n)
char *finish;
bytestring_t *val = NULL;
bytestring_t *sav = NULL;
- void *data;
/*TRACE0("syck_yaml2byte_handler()");*/
val = bytestring_alloc();
if(n->anchor) bytestring_append(val,YAMLBYTE_ANCHOR, n->anchor, NULL);
@@ -189,7 +189,7 @@ syck_yaml2byte_handler(p, n)
for ( i = 0; i < n->data.list->idx; i++ )
{
oid = syck_seq_read( n, i );
- if (syck_lookup_sym( p, oid, &data )) sav = data;
+ syck_lookup_sym( p, oid, (char **)&sav );
bytestring_extend(val, sav);
}
bytestring_append(val,YAMLBYTE_END_BRANCH,NULL,NULL);
@@ -199,10 +199,10 @@ syck_yaml2byte_handler(p, n)
for ( i = 0; i < n->data.pairs->idx; i++ )
{
oid = syck_map_read( n, map_key, i );
- if (syck_lookup_sym( p, oid, &data )) sav = data;
+ syck_lookup_sym( p, oid, (char **)&sav );
bytestring_extend(val, sav);
oid = syck_map_read( n, map_value, i );
- if (syck_lookup_sym( p, oid, &data )) sav = data;
+ syck_lookup_sym( p, oid, (char **)&sav );
bytestring_extend(val, sav);
}
bytestring_append(val,YAMLBYTE_END_BRANCH,NULL,NULL);
@@ -218,8 +218,7 @@ syck_yaml2byte(char *yamlstr)
{
SYMID oid;
char *ret;
- bytestring_t *sav;
- void *data;
+ bytestring_t *sav;
SyckParser *parser = syck_new_parser();
syck_parser_str_auto( parser, yamlstr, NULL );
@@ -229,8 +228,7 @@ syck_yaml2byte(char *yamlstr)
syck_parser_taguri_expansion( parser, 1 );
oid = syck_parse( parser );
- if ( syck_lookup_sym( parser, oid, &data ) ) {
- sav = data;
+ if ( syck_lookup_sym( parser, oid, (char **)&sav ) == 1 ) {
ret = S_ALLOC_N( char, strlen( sav->buffer ) + 3 );
ret[0] = '\0';
strcat( ret, "D\n" );
diff --git a/ext/syslog/.cvsignore b/ext/syslog/.cvsignore
index 814345ece8..4088712231 100644
--- a/ext/syslog/.cvsignore
+++ b/ext/syslog/.cvsignore
@@ -1,4 +1,3 @@
Makefile
mkmf.log
*.def
-extconf.h
diff --git a/ext/syslog/syslog.c b/ext/syslog/syslog.c
index 1bd82bf7d0..ecc49318f7 100644
--- a/ext/syslog/syslog.c
+++ b/ext/syslog/syslog.c
@@ -7,8 +7,8 @@
* $Id$
*/
-#include "ruby/ruby.h"
-#include "ruby/util.h"
+#include "ruby.h"
+#include "util.h"
#include <syslog.h>
/* Syslog class */
@@ -33,7 +33,7 @@ static void syslog_write(int pri, int argc, VALUE *argv)
str = rb_f_sprintf(argc, argv);
- syslog(pri, "%s", RSTRING_PTR(str));
+ syslog(pri, "%s", RSTRING(str)->ptr);
}
/* Syslog module methods */
@@ -67,8 +67,12 @@ static VALUE mSyslog_open(int argc, VALUE *argv, VALUE self)
if (NIL_P(ident)) {
ident = rb_gv_get("$0");
}
+#ifdef SafeStringValue
SafeStringValue(ident);
- syslog_ident = strdup(RSTRING_PTR(ident));
+#else
+ Check_SafeStr(ident);
+#endif
+ syslog_ident = strdup(RSTRING(ident)->ptr);
if (NIL_P(opt)) {
syslog_options = LOG_PID | LOG_CONS;
@@ -220,12 +224,12 @@ define_syslog_shortcut_method(LOG_DEBUG, debug)
static VALUE mSyslogConstants_LOG_MASK(VALUE klass, VALUE pri)
{
- return INT2FIX(LOG_MASK(NUM2INT(pri)));
+ return INT2FIX(LOG_MASK(FIX2INT(pri)));
}
static VALUE mSyslogConstants_LOG_UPTO(VALUE klass, VALUE pri)
{
- return INT2FIX(LOG_UPTO(NUM2INT(pri)));
+ return INT2FIX(LOG_UPTO(FIX2INT(pri)));
}
/* Init for package syslog */
diff --git a/ext/syslog/test.rb b/ext/syslog/test.rb
new file mode 100644
index 0000000000..cfa33eff8f
--- /dev/null
+++ b/ext/syslog/test.rb
@@ -0,0 +1,164 @@
+#!/usr/bin/env ruby
+# $RoughId: test.rb,v 1.9 2002/02/25 08:20:14 knu Exp $
+# $Id$
+
+# Please only run this test on machines reasonable for testing.
+# If in doubt, ask your admin.
+
+require 'test/unit'
+
+# Prepend current directory to load path for testing.
+$:.unshift('.')
+
+require 'syslog'
+
+class TestSyslog < Test::Unit::TestCase
+ def test_new
+ assert_raises(NoMethodError) {
+ Syslog.new
+ }
+ end
+
+ def test_instance
+ sl1 = Syslog.instance
+ sl2 = Syslog.open
+ sl3 = Syslog.instance
+
+ assert_equal(Syslog, sl1)
+ assert_equal(Syslog, sl2)
+ assert_equal(Syslog, sl3)
+ ensure
+ Syslog.close if Syslog.opened?
+ end
+
+ def test_open
+ # default parameters
+ Syslog.open
+
+ assert_equal($0, Syslog.ident)
+ assert_equal(Syslog::LOG_PID | Syslog::LOG_CONS, Syslog.options)
+ assert_equal(Syslog::LOG_USER, Syslog.facility)
+
+ # open without close
+ assert_raises(RuntimeError) {
+ Syslog.open
+ }
+
+ Syslog.close
+
+ # given parameters
+ Syslog.open("foo", Syslog::LOG_NDELAY | Syslog::LOG_PERROR, Syslog::LOG_DAEMON)
+
+ assert_equal('foo', Syslog.ident)
+ assert_equal(Syslog::LOG_NDELAY | Syslog::LOG_PERROR, Syslog.options)
+ assert_equal(Syslog::LOG_DAEMON, Syslog.facility)
+
+ Syslog.close
+
+ # default parameters again (after close)
+ Syslog.open
+ Syslog.close
+
+ assert_equal(nil, Syslog.ident)
+ assert_equal(nil, Syslog.options)
+ assert_equal(nil, Syslog.facility)
+
+ # block
+ param = nil
+ Syslog.open { |param| }
+ assert_equal(Syslog, param)
+ ensure
+ Syslog.close if Syslog.opened?
+ end
+
+ def test_opened?
+ assert_equal(false, Syslog.opened?)
+
+ Syslog.open
+ assert_equal(true, Syslog.opened?)
+
+ Syslog.close
+ assert_equal(false, Syslog.opened?)
+
+ Syslog.open {
+ assert_equal(true, Syslog.opened?)
+ }
+
+ assert_equal(false, Syslog.opened?)
+ end
+
+ def test_close
+ assert_raises(RuntimeError) {
+ Syslog.close
+ }
+ end
+
+ def test_mask
+ assert_equal(nil, Syslog.mask)
+
+ Syslog.open
+
+ orig = Syslog.mask
+
+ Syslog.mask = Syslog.LOG_UPTO(Syslog::LOG_ERR)
+ assert_equal(Syslog.LOG_UPTO(Syslog::LOG_ERR), Syslog.mask)
+
+ Syslog.mask = Syslog.LOG_MASK(Syslog::LOG_CRIT)
+ assert_equal(Syslog.LOG_MASK(Syslog::LOG_CRIT), Syslog.mask)
+
+ Syslog.mask = orig
+ ensure
+ Syslog.close if Syslog.opened?
+ end
+
+ def test_log
+ stderr = IO::pipe
+
+ pid = fork {
+ stderr[0].close
+ STDERR.reopen(stderr[1])
+ stderr[1].close
+
+ options = Syslog::LOG_PERROR | Syslog::LOG_NDELAY
+
+ Syslog.open("syslog_test", options) { |sl|
+ sl.log(Syslog::LOG_NOTICE, "test1 - hello, %s!", "world")
+ sl.notice("test1 - hello, %s!", "world")
+ }
+
+ Syslog.open("syslog_test", options | Syslog::LOG_PID) { |sl|
+ sl.log(Syslog::LOG_CRIT, "test2 - pid")
+ sl.crit("test2 - pid")
+ }
+ exit!
+ }
+
+ stderr[1].close
+ Process.waitpid(pid)
+
+ # LOG_PERROR is not yet implemented on Cygwin.
+ return if RUBY_PLATFORM =~ /cygwin/
+
+ 2.times {
+ assert_equal("syslog_test: test1 - hello, world!\n", stderr[0].gets)
+ }
+
+ 2.times {
+ assert_equal(format("syslog_test[%d]: test2 - pid\n", pid), stderr[0].gets)
+ }
+ end
+
+ def test_inspect
+ Syslog.open { |sl|
+ assert_equal(format('<#%s: opened=true, ident="%s", options=%d, facility=%d, mask=%d>',
+ Syslog,
+ sl.ident,
+ sl.options,
+ sl.facility,
+ sl.mask),
+ sl.inspect)
+ }
+
+ assert_equal(format('<#%s: opened=false>', Syslog), Syslog.inspect)
+ end
+end
diff --git a/ext/thread/extconf.rb b/ext/thread/extconf.rb
new file mode 100644
index 0000000000..2f984efc6d
--- /dev/null
+++ b/ext/thread/extconf.rb
@@ -0,0 +1,9 @@
+require 'mkmf'
+
+enable_config('fastthread', true) or exit
+
+if with_config('mem-pools', true)
+ $CPPFLAGS << ' -DUSE_MEM_POOLS'
+end
+
+create_makefile("thread")
diff --git a/ext/thread/lib/thread.rb b/ext/thread/lib/thread.rb
new file mode 100644
index 0000000000..6c533aba39
--- /dev/null
+++ b/ext/thread/lib/thread.rb
@@ -0,0 +1,5 @@
+unless defined? Thread
+ fail "Thread not available for this ruby interpreter"
+end
+
+require 'thread.so'
diff --git a/ext/thread/thread.c b/ext/thread/thread.c
new file mode 100644
index 0000000000..68f172220a
--- /dev/null
+++ b/ext/thread/thread.c
@@ -0,0 +1,1182 @@
+/*
+ * Optimized Ruby Mutex implementation, loosely based on thread.rb by
+ * Yukihiro Matsumoto <matz@ruby-lang.org>
+ *
+ * Copyright 2006-2007 MenTaLguY <mental@rydia.net>
+ *
+ * RDoc taken from original.
+ *
+ * This file is made available under the same terms as Ruby.
+ */
+
+#include <ruby.h>
+#include <intern.h>
+#include <rubysig.h>
+
+static VALUE rb_cMutex;
+static VALUE rb_cConditionVariable;
+static VALUE rb_cQueue;
+static VALUE rb_cSizedQueue;
+
+static VALUE set_critical(VALUE value);
+
+static VALUE
+thread_exclusive(VALUE (*func)(ANYARGS), VALUE arg)
+{
+ VALUE critical = rb_thread_critical;
+
+ rb_thread_critical = 1;
+ return rb_ensure(func, arg, set_critical, (VALUE)critical);
+}
+
+/*
+ * call-seq:
+ * Thread.exclusive { block } => obj
+ *
+ * Wraps a block in Thread.critical, restoring the original value
+ * upon exit from the critical section, and returns the value of the
+ * block.
+ */
+
+static VALUE
+rb_thread_exclusive(void)
+{
+ return thread_exclusive(rb_yield, Qundef);
+}
+
+typedef struct _Entry {
+ VALUE value;
+ struct _Entry *next;
+} Entry;
+
+typedef struct _List {
+ Entry *entries;
+ Entry *last_entry;
+ Entry *entry_pool;
+ unsigned long size;
+} List;
+
+static void
+init_list(List *list)
+{
+ list->entries = NULL;
+ list->last_entry = NULL;
+ list->entry_pool = NULL;
+ list->size = 0;
+}
+
+static void
+mark_list(List *list)
+{
+ Entry *entry;
+ for (entry = list->entries; entry; entry = entry->next) {
+ rb_gc_mark(entry->value);
+ }
+}
+
+static void
+free_entries(Entry *first)
+{
+ Entry *next;
+ while (first) {
+ next = first->next;
+ xfree(first);
+ first = next;
+ }
+}
+
+static void
+finalize_list(List *list)
+{
+ free_entries(list->entries);
+ free_entries(list->entry_pool);
+}
+
+static void
+push_list(List *list, VALUE value)
+{
+ Entry *entry;
+
+ if (list->entry_pool) {
+ entry = list->entry_pool;
+ list->entry_pool = entry->next;
+ } else {
+ entry = ALLOC(Entry);
+ }
+
+ entry->value = value;
+ entry->next = NULL;
+
+ if (list->last_entry) {
+ list->last_entry->next = entry;
+ } else {
+ list->entries = entry;
+ }
+ list->last_entry = entry;
+
+ ++list->size;
+}
+
+static void
+push_multiple_list(List *list, VALUE *values, unsigned count)
+{
+ unsigned i;
+ for (i = 0; i < count; i++) {
+ push_list(list, values[i]);
+ }
+}
+
+static void
+recycle_entries(List *list, Entry *first_entry, Entry *last_entry)
+{
+#ifdef USE_MEM_POOLS
+ last_entry->next = list->entry_pool;
+ list->entry_pool = first_entry;
+#else
+ last_entry->next = NULL;
+ free_entries(first_entry);
+#endif
+}
+
+static VALUE
+shift_list(List *list)
+{
+ Entry *entry;
+ VALUE value;
+
+ entry = list->entries;
+ if (!entry) return Qnil;
+
+ list->entries = entry->next;
+ if (entry == list->last_entry) {
+ list->last_entry = NULL;
+ }
+
+ --list->size;
+
+ value = entry->value;
+ recycle_entries(list, entry, entry);
+
+ return value;
+}
+
+static void
+remove_one(List *list, VALUE value)
+{
+ Entry **ref;
+ Entry *prev;
+ Entry *entry;
+
+ for (ref = &list->entries, prev = NULL, entry = list->entries;
+ entry != NULL;
+ ref = &entry->next, prev = entry, entry = entry->next) {
+ if (entry->value == value) {
+ *ref = entry->next;
+ list->size--;
+ if (!entry->next) {
+ list->last_entry = prev;
+ }
+ recycle_entries(list, entry, entry);
+ break;
+ }
+ }
+}
+
+static void
+clear_list(List *list)
+{
+ if (list->last_entry) {
+ recycle_entries(list, list->entries, list->last_entry);
+ list->entries = NULL;
+ list->last_entry = NULL;
+ list->size = 0;
+ }
+}
+
+static VALUE
+array_from_list(List const *list)
+{
+ VALUE ary;
+ Entry *entry;
+ ary = rb_ary_new();
+ for (entry = list->entries; entry; entry = entry->next) {
+ rb_ary_push(ary, entry->value);
+ }
+ return ary;
+}
+
+static VALUE
+wake_thread(VALUE thread)
+{
+ return rb_thread_wakeup_alive(thread);
+}
+
+static VALUE
+run_thread(VALUE thread)
+{
+ thread = wake_thread(thread);
+ if (RTEST(thread) && !rb_thread_critical)
+ rb_thread_schedule();
+ return thread;
+}
+
+static VALUE
+wake_one(List *list)
+{
+ VALUE waking;
+
+ waking = Qnil;
+ while (list->entries && !RTEST(waking)) {
+ waking = wake_thread(shift_list(list));
+ }
+
+ return waking;
+}
+
+static VALUE
+wake_all(List *list)
+{
+ while (list->entries) {
+ wake_one(list);
+ }
+ return Qnil;
+}
+
+static VALUE
+wait_list_inner(List *list)
+{
+ push_list(list, rb_thread_current());
+ rb_thread_stop();
+ return Qnil;
+}
+
+static VALUE
+wait_list_cleanup(List *list)
+{
+ /* cleanup in case of spurious wakeups */
+ remove_one(list, rb_thread_current());
+ return Qnil;
+}
+
+static VALUE
+wait_list(List *list)
+{
+ return rb_ensure(wait_list_inner, (VALUE)list, wait_list_cleanup, (VALUE)list);
+}
+
+static void
+kill_waiting_threads(List *waiting)
+{
+ Entry *entry;
+
+ for (entry = waiting->entries; entry; entry = entry->next) {
+ rb_thread_kill(entry->value);
+ }
+}
+
+/*
+ * Document-class: Mutex
+ *
+ * Mutex implements a simple semaphore that can be used to coordinate access to
+ * shared data from multiple concurrent threads.
+ *
+ * Example:
+ *
+ * require 'thread'
+ * semaphore = Mutex.new
+ *
+ * a = Thread.new {
+ * semaphore.synchronize {
+ * # access shared resource
+ * }
+ * }
+ *
+ * b = Thread.new {
+ * semaphore.synchronize {
+ * # access shared resource
+ * }
+ * }
+ *
+ */
+
+typedef struct _Mutex {
+ VALUE owner;
+ List waiting;
+} Mutex;
+
+#define MUTEX_LOCKED_P(mutex) (RTEST((mutex)->owner) && rb_thread_alive_p((mutex)->owner))
+
+static void
+mark_mutex(Mutex *mutex)
+{
+ rb_gc_mark(mutex->owner);
+ mark_list(&mutex->waiting);
+}
+
+static void
+finalize_mutex(Mutex *mutex)
+{
+ finalize_list(&mutex->waiting);
+}
+
+static void
+free_mutex(Mutex *mutex)
+{
+ kill_waiting_threads(&mutex->waiting);
+ finalize_mutex(mutex);
+ xfree(mutex);
+}
+
+static void
+init_mutex(Mutex *mutex)
+{
+ mutex->owner = Qnil;
+ init_list(&mutex->waiting);
+}
+
+/*
+ * Document-method: new
+ * call-seq: Mutex.new
+ *
+ * Creates a new Mutex
+ *
+ */
+
+static VALUE
+rb_mutex_alloc(VALUE klass)
+{
+ Mutex *mutex;
+ mutex = ALLOC(Mutex);
+ init_mutex(mutex);
+ return Data_Wrap_Struct(klass, mark_mutex, free_mutex, mutex);
+}
+
+/*
+ * Document-method: locked?
+ * call-seq: locked?
+ *
+ * Returns +true+ if this lock is currently held by some thread.
+ *
+ */
+
+static VALUE
+rb_mutex_locked_p(VALUE self)
+{
+ Mutex *mutex;
+ Data_Get_Struct(self, Mutex, mutex);
+ return MUTEX_LOCKED_P(mutex) ? Qtrue : Qfalse;
+}
+
+/*
+ * Document-method: try_lock
+ * call-seq: try_lock
+ *
+ * Attempts to obtain the lock and returns immediately. Returns +true+ if the
+ * lock was granted.
+ *
+ */
+
+static VALUE
+rb_mutex_try_lock(VALUE self)
+{
+ Mutex *mutex;
+
+ Data_Get_Struct(self, Mutex, mutex);
+
+ if (MUTEX_LOCKED_P(mutex))
+ return Qfalse;
+
+ mutex->owner = rb_thread_current();
+ return Qtrue;
+}
+
+/*
+ * Document-method: lock
+ * call-seq: lock
+ *
+ * Attempts to grab the lock and waits if it isn't available.
+ *
+ */
+
+static VALUE
+lock_mutex(Mutex *mutex)
+{
+ VALUE current;
+ current = rb_thread_current();
+
+ rb_thread_critical = 1;
+
+ if (!MUTEX_LOCKED_P(mutex)) {
+ mutex->owner = current;
+ }
+ else {
+ do {
+ wait_list(&mutex->waiting);
+ rb_thread_critical = 1;
+ if (!MUTEX_LOCKED_P(mutex)) {
+ mutex->owner = current;
+ break;
+ }
+ } while (mutex->owner != current);
+ }
+
+ rb_thread_critical = 0;
+ return Qnil;
+}
+
+static VALUE
+rb_mutex_lock(VALUE self)
+{
+ Mutex *mutex;
+ Data_Get_Struct(self, Mutex, mutex);
+ lock_mutex(mutex);
+ return self;
+}
+
+/*
+ * Document-method: unlock
+ *
+ * Releases the lock. Returns +nil+ if ref wasn't locked.
+ *
+ */
+
+static VALUE
+unlock_mutex_inner(Mutex *mutex)
+{
+ VALUE waking;
+
+ if (mutex->owner != rb_thread_current()) {
+ rb_raise(rb_eThreadError, "not owner");
+ }
+
+ waking = wake_one(&mutex->waiting);
+ mutex->owner = waking;
+
+ return waking;
+}
+
+static VALUE
+set_critical(VALUE value)
+{
+ rb_thread_critical = (int)value;
+ return Qundef;
+}
+
+static VALUE
+unlock_mutex(Mutex *mutex)
+{
+ VALUE waking = thread_exclusive(unlock_mutex_inner, (VALUE)mutex);
+
+ if (!RTEST(waking)) {
+ return Qfalse;
+ }
+
+ run_thread(waking);
+
+ return Qtrue;
+}
+
+static VALUE
+rb_mutex_unlock(VALUE self)
+{
+ Mutex *mutex;
+ Data_Get_Struct(self, Mutex, mutex);
+
+ if (RTEST(unlock_mutex(mutex))) {
+ return self;
+ } else {
+ return Qnil;
+ }
+}
+
+/*
+ * Document-method: exclusive_unlock
+ * call-seq: exclusive_unlock { ... }
+ *
+ * If the mutex is locked, unlocks the mutex, wakes one waiting thread, and
+ * yields in a critical section.
+ *
+ */
+
+static VALUE
+rb_mutex_exclusive_unlock_inner(Mutex *mutex)
+{
+ VALUE waking;
+ waking = unlock_mutex_inner(mutex);
+ rb_yield(Qundef);
+ return waking;
+}
+
+static VALUE
+rb_mutex_exclusive_unlock(VALUE self)
+{
+ Mutex *mutex;
+ VALUE waking;
+ Data_Get_Struct(self, Mutex, mutex);
+
+ waking = thread_exclusive(rb_mutex_exclusive_unlock_inner, (VALUE)mutex);
+
+ if (!RTEST(waking)) {
+ return Qnil;
+ }
+
+ run_thread(waking);
+
+ return self;
+}
+
+/*
+ * Document-method: synchronize
+ * call-seq: synchronize { ... }
+ *
+ * Obtains a lock, runs the block, and releases the lock when the block
+ * completes. See the example under Mutex.
+ *
+ */
+
+static VALUE
+rb_mutex_synchronize(VALUE self)
+{
+ rb_mutex_lock(self);
+ return rb_ensure(rb_yield, Qundef, rb_mutex_unlock, self);
+}
+
+/*
+ * 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
+ * }
+ * }
+ *
+ */
+
+typedef struct _ConditionVariable {
+ List waiting;
+} ConditionVariable;
+
+static void
+mark_condvar(ConditionVariable *condvar)
+{
+ mark_list(&condvar->waiting);
+}
+
+static void
+finalize_condvar(ConditionVariable *condvar)
+{
+ finalize_list(&condvar->waiting);
+}
+
+static void
+free_condvar(ConditionVariable *condvar)
+{
+ kill_waiting_threads(&condvar->waiting);
+ finalize_condvar(condvar);
+ xfree(condvar);
+}
+
+static void
+init_condvar(ConditionVariable *condvar)
+{
+ init_list(&condvar->waiting);
+}
+
+/*
+ * Document-method: new
+ * call-seq: ConditionVariable.new
+ *
+ * Creates a new ConditionVariable
+ *
+ */
+
+static VALUE
+rb_condvar_alloc(VALUE klass)
+{
+ ConditionVariable *condvar;
+
+ condvar = ALLOC(ConditionVariable);
+ init_condvar(condvar);
+
+ return Data_Wrap_Struct(klass, mark_condvar, free_condvar, condvar);
+}
+
+/*
+ * Document-method: wait
+ * call-seq: wait
+ *
+ * Releases the lock held in +mutex+ and waits; reacquires the lock on wakeup.
+ *
+ */
+
+static void
+wait_condvar(ConditionVariable *condvar, Mutex *mutex)
+{
+ VALUE waking;
+
+ rb_thread_critical = 1;
+ if (rb_thread_current() != mutex->owner) {
+ rb_thread_critical = 0;
+ rb_raise(rb_eThreadError, "not owner of the synchronization mutex");
+ }
+ waking = unlock_mutex_inner(mutex);
+ if (RTEST(waking)) {
+ wake_thread(waking);
+ }
+ rb_ensure(wait_list, (VALUE)&condvar->waiting, lock_mutex, (VALUE)mutex);
+}
+
+static VALUE
+legacy_exclusive_unlock(VALUE mutex)
+{
+ return rb_funcall(mutex, rb_intern("exclusive_unlock"), 0);
+}
+
+typedef struct {
+ ConditionVariable *condvar;
+ VALUE mutex;
+} legacy_wait_args;
+
+static VALUE
+legacy_wait(VALUE unused, legacy_wait_args *args)
+{
+ wait_list(&args->condvar->waiting);
+ rb_funcall(args->mutex, rb_intern("lock"), 0);
+ return Qnil;
+}
+
+static VALUE
+rb_condvar_wait(VALUE self, VALUE mutex_v)
+{
+ ConditionVariable *condvar;
+ Data_Get_Struct(self, ConditionVariable, condvar);
+
+ if (CLASS_OF(mutex_v) != rb_cMutex) {
+ /* interoperate with legacy mutex */
+ legacy_wait_args args;
+ args.condvar = condvar;
+ args.mutex = mutex_v;
+ rb_iterate(legacy_exclusive_unlock, mutex_v, legacy_wait, (VALUE)&args);
+ } else {
+ Mutex *mutex;
+ Data_Get_Struct(mutex_v, Mutex, mutex);
+ wait_condvar(condvar, mutex);
+ }
+
+ return self;
+}
+
+/*
+ * Document-method: broadcast
+ * call-seq: broadcast
+ *
+ * Wakes up all threads waiting for this condition.
+ *
+ */
+
+static VALUE
+rb_condvar_broadcast(VALUE self)
+{
+ ConditionVariable *condvar;
+
+ Data_Get_Struct(self, ConditionVariable, condvar);
+
+ thread_exclusive(wake_all, (VALUE)&condvar->waiting);
+ rb_thread_schedule();
+
+ return self;
+}
+
+/*
+ * Document-method: signal
+ * call-seq: signal
+ *
+ * Wakes up the first thread in line waiting for this condition.
+ *
+ */
+
+static void
+signal_condvar(ConditionVariable *condvar)
+{
+ VALUE waking = thread_exclusive(wake_one, (VALUE)&condvar->waiting);
+
+ if (RTEST(waking)) {
+ run_thread(waking);
+ }
+}
+
+static VALUE
+rb_condvar_signal(VALUE self)
+{
+ ConditionVariable *condvar;
+ Data_Get_Struct(self, ConditionVariable, condvar);
+ signal_condvar(condvar);
+ 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
+ *
+ * consumer.join
+ *
+ */
+
+typedef struct _Queue {
+ Mutex mutex;
+ ConditionVariable value_available;
+ ConditionVariable space_available;
+ List values;
+ unsigned long capacity;
+} Queue;
+
+static void
+mark_queue(Queue *queue)
+{
+ mark_mutex(&queue->mutex);
+ mark_condvar(&queue->value_available);
+ mark_condvar(&queue->space_available);
+ mark_list(&queue->values);
+}
+
+static void
+finalize_queue(Queue *queue)
+{
+ finalize_mutex(&queue->mutex);
+ finalize_condvar(&queue->value_available);
+ finalize_condvar(&queue->space_available);
+ finalize_list(&queue->values);
+}
+
+static void
+free_queue(Queue *queue)
+{
+ kill_waiting_threads(&queue->mutex.waiting);
+ kill_waiting_threads(&queue->space_available.waiting);
+ kill_waiting_threads(&queue->value_available.waiting);
+ finalize_queue(queue);
+ xfree(queue);
+}
+
+static void
+init_queue(Queue *queue)
+{
+ init_mutex(&queue->mutex);
+ init_condvar(&queue->value_available);
+ init_condvar(&queue->space_available);
+ init_list(&queue->values);
+ queue->capacity = 0;
+}
+
+/*
+ * Document-method: new
+ * call-seq: new
+ *
+ * Creates a new queue.
+ *
+ */
+
+static VALUE
+rb_queue_alloc(VALUE klass)
+{
+ Queue *queue;
+ queue = ALLOC(Queue);
+ init_queue(queue);
+ return Data_Wrap_Struct(klass, mark_queue, free_queue, queue);
+}
+
+static VALUE
+rb_queue_marshal_load(VALUE self, VALUE data)
+{
+ Queue *queue;
+ VALUE array;
+ Data_Get_Struct(self, Queue, queue);
+
+ array = rb_marshal_load(data);
+ if (TYPE(array) != T_ARRAY) {
+ rb_raise(rb_eTypeError, "expected Array of queue data");
+ }
+ if (RARRAY(array)->len < 1) {
+ rb_raise(rb_eArgError, "missing capacity value");
+ }
+ queue->capacity = NUM2ULONG(rb_ary_shift(array));
+ push_multiple_list(&queue->values, RARRAY(array)->ptr, (unsigned)RARRAY(array)->len);
+
+ return self;
+}
+
+static VALUE
+rb_queue_marshal_dump(VALUE self)
+{
+ Queue *queue;
+ VALUE array;
+ Data_Get_Struct(self, Queue, queue);
+
+ array = array_from_list(&queue->values);
+ rb_ary_unshift(array, ULONG2NUM(queue->capacity));
+ return rb_marshal_dump(array, Qnil);
+}
+
+/*
+ * Document-method: clear
+ * call-seq: clear
+ *
+ * Removes all objects from the queue.
+ *
+ */
+
+static VALUE
+rb_queue_clear(VALUE self)
+{
+ Queue *queue;
+ Data_Get_Struct(self, Queue, queue);
+
+ lock_mutex(&queue->mutex);
+ clear_list(&queue->values);
+ signal_condvar(&queue->space_available);
+ unlock_mutex(&queue->mutex);
+
+ return self;
+}
+
+/*
+ * Document-method: empty?
+ * call-seq: empty?
+ *
+ * Returns +true+ if the queue is empty.
+ *
+ */
+
+static VALUE
+rb_queue_empty_p(VALUE self)
+{
+ Queue *queue;
+ VALUE result;
+ Data_Get_Struct(self, Queue, queue);
+
+ lock_mutex(&queue->mutex);
+ result = queue->values.size == 0 ? Qtrue : Qfalse;
+ unlock_mutex(&queue->mutex);
+
+ return result;
+}
+
+/*
+ * Document-method: length
+ * call-seq: length
+ *
+ * Returns the length of the queue.
+ *
+ */
+
+static VALUE
+rb_queue_length(VALUE self)
+{
+ Queue *queue;
+ VALUE result;
+ Data_Get_Struct(self, Queue, queue);
+
+ lock_mutex(&queue->mutex);
+ result = ULONG2NUM(queue->values.size);
+ unlock_mutex(&queue->mutex);
+
+ return result;
+}
+
+/*
+ * Document-method: num_waiting
+ * call-seq: num_waiting
+ *
+ * Returns the number of threads waiting on the queue.
+ *
+ */
+
+static VALUE
+rb_queue_num_waiting(VALUE self)
+{
+ Queue *queue;
+ VALUE result;
+ Data_Get_Struct(self, Queue, queue);
+
+ lock_mutex(&queue->mutex);
+ result = ULONG2NUM(queue->value_available.waiting.size +
+ queue->space_available.waiting.size);
+ unlock_mutex(&queue->mutex);
+
+ return result;
+}
+
+/*
+ * Document-method: pop
+ * call_seq: pop(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)
+{
+ Queue *queue;
+ int should_block;
+ VALUE result;
+ Data_Get_Struct(self, Queue, queue);
+
+ if (argc == 0) {
+ should_block = 1;
+ } else if (argc == 1) {
+ should_block = !RTEST(argv[0]);
+ } else {
+ rb_raise(rb_eArgError, "wrong number of arguments (%d for 1)", argc);
+ }
+
+ lock_mutex(&queue->mutex);
+ if (!queue->values.entries && !should_block) {
+ unlock_mutex(&queue->mutex);
+ rb_raise(rb_eThreadError, "queue empty");
+ }
+
+ while (!queue->values.entries) {
+ wait_condvar(&queue->value_available, &queue->mutex);
+ }
+
+ result = shift_list(&queue->values);
+ if (queue->capacity && queue->values.size < queue->capacity) {
+ signal_condvar(&queue->space_available);
+ }
+ unlock_mutex(&queue->mutex);
+
+ return result;
+}
+
+/*
+ * Document-method: push
+ * call-seq: push(obj)
+ *
+ * Pushes +obj+ to the queue.
+ *
+ */
+
+static VALUE
+rb_queue_push(VALUE self, VALUE value)
+{
+ Queue *queue;
+ Data_Get_Struct(self, Queue, queue);
+
+ lock_mutex(&queue->mutex);
+ while (queue->capacity && queue->values.size >= queue->capacity) {
+ wait_condvar(&queue->space_available, &queue->mutex);
+ }
+ push_list(&queue->values, value);
+ signal_condvar(&queue->value_available);
+ unlock_mutex(&queue->mutex);
+
+ return self;
+}
+
+/*
+ * 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: new
+ * call-seq: new
+ *
+ * Creates a fixed-length queue with a maximum size of +max+.
+ *
+ */
+
+/*
+ * Document-method: max
+ * call-seq: max
+ *
+ * Returns the maximum size of the queue.
+ *
+ */
+
+static VALUE
+rb_sized_queue_max(VALUE self)
+{
+ Queue *queue;
+ VALUE result;
+ Data_Get_Struct(self, Queue, queue);
+
+ lock_mutex(&queue->mutex);
+ result = ULONG2NUM(queue->capacity);
+ unlock_mutex(&queue->mutex);
+
+ return result;
+}
+
+/*
+ * Document-method: max=
+ * call-seq: max=(size)
+ *
+ * Sets the maximum size of the queue.
+ *
+ */
+
+static VALUE
+rb_sized_queue_max_set(VALUE self, VALUE value)
+{
+ Queue *queue;
+ unsigned long new_capacity;
+ unsigned long difference;
+ Data_Get_Struct(self, Queue, queue);
+
+ new_capacity = NUM2ULONG(value);
+
+ if (new_capacity < 1) {
+ rb_raise(rb_eArgError, "value must be positive");
+ }
+
+ lock_mutex(&queue->mutex);
+ if (queue->capacity && new_capacity > queue->capacity) {
+ difference = new_capacity - queue->capacity;
+ } else {
+ difference = 0;
+ }
+ queue->capacity = new_capacity;
+ for (; difference > 0; --difference) {
+ signal_condvar(&queue->space_available);
+ }
+ unlock_mutex(&queue->mutex);
+
+ return self;
+}
+
+/*
+ * Document-method: push
+ * call-seq: push(obj)
+ *
+ * Pushes +obj+ to the queue. If there is no space left in the queue, waits
+ * until space becomes available.
+ *
+ */
+
+/*
+ * Document-method: pop
+ * call-seq: pop(non_block=false)
+ *
+ * Retrieves data from the queue and runs a waiting thread, if any.
+ *
+ */
+
+/* for marshalling mutexes and condvars */
+
+static VALUE
+dummy_load(VALUE self, VALUE string)
+{
+ return Qnil;
+}
+
+static VALUE
+dummy_dump(VALUE self)
+{
+ return rb_str_new2("");
+}
+
+void
+Init_thread(void)
+{
+ rb_define_singleton_method(rb_cThread, "exclusive", rb_thread_exclusive, 0);
+
+ rb_cMutex = rb_define_class("Mutex", rb_cObject);
+ rb_define_alloc_func(rb_cMutex, rb_mutex_alloc);
+ rb_define_method(rb_cMutex, "marshal_load", dummy_load, 1);
+ rb_define_method(rb_cMutex, "marshal_dump", dummy_dump, 0);
+ rb_define_method(rb_cMutex, "locked?", rb_mutex_locked_p, 0);
+ rb_define_method(rb_cMutex, "try_lock", rb_mutex_try_lock, 0);
+ rb_define_method(rb_cMutex, "lock", rb_mutex_lock, 0);
+ rb_define_method(rb_cMutex, "unlock", rb_mutex_unlock, 0);
+ rb_define_method(rb_cMutex, "exclusive_unlock", rb_mutex_exclusive_unlock, 0);
+ rb_define_method(rb_cMutex, "synchronize", rb_mutex_synchronize, 0);
+
+ rb_cConditionVariable = rb_define_class("ConditionVariable", rb_cObject);
+ rb_define_alloc_func(rb_cConditionVariable, rb_condvar_alloc);
+ rb_define_method(rb_cConditionVariable, "marshal_load", dummy_load, 1);
+ rb_define_method(rb_cConditionVariable, "marshal_dump", dummy_dump, 0);
+ rb_define_method(rb_cConditionVariable, "wait", rb_condvar_wait, 1);
+ rb_define_method(rb_cConditionVariable, "broadcast", rb_condvar_broadcast, 0);
+ rb_define_method(rb_cConditionVariable, "signal", rb_condvar_signal, 0);
+
+ rb_cQueue = rb_define_class("Queue", rb_cObject);
+ rb_define_alloc_func(rb_cQueue, rb_queue_alloc);
+ rb_define_method(rb_cQueue, "marshal_load", rb_queue_marshal_load, 1);
+ rb_define_method(rb_cQueue, "marshal_dump", rb_queue_marshal_dump, 0);
+ rb_define_method(rb_cQueue, "clear", rb_queue_clear, 0);
+ rb_define_method(rb_cQueue, "empty?", rb_queue_empty_p, 0);
+ rb_define_method(rb_cQueue, "length", rb_queue_length, 0);
+ rb_define_method(rb_cQueue, "num_waiting", rb_queue_num_waiting, 0);
+ rb_define_method(rb_cQueue, "pop", rb_queue_pop, -1);
+ rb_define_method(rb_cQueue, "push", rb_queue_push, 1);
+ rb_alias(rb_cQueue, rb_intern("enq"), rb_intern("push"));
+ rb_alias(rb_cQueue, rb_intern("<<"), rb_intern("push"));
+ rb_alias(rb_cQueue, rb_intern("deq"), rb_intern("pop"));
+ rb_alias(rb_cQueue, rb_intern("shift"), rb_intern("pop"));
+ rb_alias(rb_cQueue, rb_intern("size"), rb_intern("length"));
+
+ rb_cSizedQueue = rb_define_class("SizedQueue", rb_cQueue);
+ rb_define_method(rb_cSizedQueue, "initialize", rb_sized_queue_max_set, 1);
+ rb_define_method(rb_cSizedQueue, "num_waiting", rb_queue_num_waiting, 0);
+ rb_define_method(rb_cSizedQueue, "pop", rb_queue_pop, -1);
+ rb_define_method(rb_cSizedQueue, "push", rb_queue_push, 1);
+ rb_define_method(rb_cSizedQueue, "max", rb_sized_queue_max, 0);
+ rb_define_method(rb_cSizedQueue, "max=", rb_sized_queue_max_set, 1);
+ rb_alias(rb_cSizedQueue, rb_intern("enq"), rb_intern("push"));
+ rb_alias(rb_cSizedQueue, rb_intern("<<"), rb_intern("push"));
+ rb_alias(rb_cSizedQueue, rb_intern("deq"), rb_intern("pop"));
+ rb_alias(rb_cSizedQueue, rb_intern("shift"), rb_intern("pop"));
+}
+
diff --git a/ext/tk/.cvsignore b/ext/tk/.cvsignore
index 90c83ed9b1..44e7f262dc 100644
--- a/ext/tk/.cvsignore
+++ b/ext/tk/.cvsignore
@@ -1,3 +1,3 @@
Makefile
+mkmf.log
*.log
-*.def
diff --git a/ext/tk/ChangeLog.tkextlib b/ext/tk/ChangeLog.tkextlib
index 4aa9cb61d6..8c5d01a954 100644
--- a/ext/tk/ChangeLog.tkextlib
+++ b/ext/tk/ChangeLog.tkextlib
@@ -1,28 +1,3 @@
-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.
diff --git a/ext/tk/MANUAL_tcltklib.eng b/ext/tk/MANUAL_tcltklib.eng
index c139947da4..6fa775b7de 100644
--- a/ext/tk/MANUAL_tcltklib.eng
+++ b/ext/tk/MANUAL_tcltklib.eng
@@ -140,7 +140,8 @@ module TclTklib
[module methods]
get_version()
: return an array of major, minor, release-type number,
- : and patchlevel of current Tcl/Tk library.
+ : number, release-type name, and patchlevel of current
+ : Tcl/Tk library.
mainloop(check_root = true)
: Starts the eventloop. If 'check_root' is true, this method
@@ -353,11 +354,6 @@ class TclTkIp
: to _eval and regist 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
diff --git a/ext/tk/MANUAL_tcltklib.eucj b/ext/tk/MANUAL_tcltklib.eucj
index 26b39f7943..7df42997b4 100644
--- a/ext/tk/MANUAL_tcltklib.eucj
+++ b/ext/tk/MANUAL_tcltklib.eucj
@@ -235,8 +235,8 @@ require "tcltklib" , ʲΥ⥸塼, 饹ѲǽǤ.
⥸塼᥽å
get_version()
- : Tcl/Tk major, minor, release-type ֹ, patchlevel
- : ˤ֤
+ : Tcl/Tk major, minor, release-type ֹ, release-type ̾,
+ : patchlevel ˤ֤
mainloop(check_root = true)
: ٥ȥ롼פư롥check_root true ǤС
@@ -464,11 +464,6 @@ require "tcltklib" , ʲΥ⥸塼, 饹ѲǽǤ.
: ϿСʹߤ _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 ѴƤӽФ
diff --git a/ext/tk/README.ActiveTcl b/ext/tk/README.ActiveTcl
index c0f9ef8fe4..3afb3f4cf6 100644
--- a/ext/tk/README.ActiveTcl
+++ b/ext/tk/README.ActiveTcl
@@ -3,22 +3,9 @@ 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>
diff --git a/ext/tk/README.tcltklib b/ext/tk/README.tcltklib
index 0db2758f26..8c6dd5178f 100644
--- a/ext/tk/README.tcltklib
+++ b/ext/tk/README.tcltklib
@@ -1,53 +1,18 @@
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),
+Although 'extconf.rb' script searches Tcl/Tk libraries and header files,
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>
force version of Tcl/Tk libaray
(e.g. libtcl8.4g.so ==> --with-tcltkversion=8.4g)
- --without-tcl-config / --without-tk-config
- --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"
@@ -71,12 +36,6 @@ some or all of the following options.
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")
diff --git a/ext/tk/config_list.in b/ext/tk/config_list.in
deleted file mode 100644
index 5ddd11c6b0..0000000000
--- a/ext/tk/config_list.in
+++ /dev/null
@@ -1,36 +0,0 @@
-##############################################
-# configure options for Ruby/Tk
-# release date: 2009-07-15
-##############################################
-with tk-old-extconf
-with ActiveTcl
-with tk-shlib-search-path
-with tcltkversion
-with tcl-config
-with tk-config
-with tclConfig-dir
-with tkConfig-dir
-with tcllib
-with tklib
-enable tcltk-stubs
-with tcl-dir
-with tk-dir
-with tcl-include
-with tcl-lib
-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
-with tclConfig-file
-enable space-on-tk-libpath
diff --git a/ext/tk/depend b/ext/tk/depend
index f7ba3229c1..2cd9c400f7 100644
--- a/ext/tk/depend
+++ b/ext/tk/depend
@@ -1,2 +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
+tcltklib.o: tcltklib.c $(hdrdir)/ruby.h $(topdir)/config.h $(hdrdir)/defines.h
+stubs.o: stubs.c $(hdrdir)/ruby.h $(topdir)/config.h $(hdrdir)/defines.h
diff --git a/ext/tk/extconf.rb b/ext/tk/extconf.rb
index 6a9befd121..4807ea7b40 100644
--- a/ext/tk/extconf.rb
+++ b/ext/tk/extconf.rb
@@ -1,126 +1,76 @@
-##############################################################
# extconf.rb for tcltklib
-# release date: 2009-07-15
-##############################################################
+
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 4.2]
+#is_win32 = (/mswin32|mingw|cygwin|bccwin32/ =~ RUBY_PLATFORM)
+is_win32 = (/mswin|mingw|cygwin|bccwin|wince/ =~ RUBY_PLATFORM)
+#is_macosx = (/darwin/ =~ RUBY_PLATFORM)
+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
-##############################################################
-# use old extconf.rb ?
-##############################################################
-if with_config('tk-old-extconf')
- require File.join(File.dirname(__FILE__), 'old-extconf.rb')
- exit
+ 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")
-##############################################################
-# check configs
-##############################################################
-$cleanfiles << 'config_list'
-config_list_file = File.join(File.dirname(__FILE__),'config_list')
-config_list_file_source = config_list_file + '.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
+tcltk_framework = find_framework(tcl_framework_header, tk_framework_header)
-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
-}
+unless is_win32
+ have_library("nsl", "t_open")
+ have_library("socket", "socket")
+ have_library("dl", "dlopen")
+ have_library("m", "log")
+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
-}
+tk_idir, tk_ldir = dir_config("tk")
+tcl_idir, tcl_ldir = dir_config("tcl")
+x11_idir, x11_ldir = dir_config("X11")
-# 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
+tk_ldir2 = with_config("tk-lib")
+tcl_ldir2 = with_config("tcl-lib")
+x11_ldir2 = with_config("X11-lib")
-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(File.join(File.dirname(__FILE__),
- "*.#{CONFIG['DLEXT']}"))))
- File.delete(*(Dir.glob(File.join(File.dirname(__FILE__), "*.#{$OBJEXT}"))))
- File.delete(File.join(File.dirname(__FILE__), 'Makefile')) rescue nil
+tk_ldir_list = [tk_ldir2, tk_ldir]
+tcl_ldir_list = [tcl_ldir2, tcl_ldir]
-else
- makefile = File.join(File.dirname(__FILE__),'Makefile')
- if File.exist?(makefile) &&
- File.ctime(config_list_file) > File.ctime(makefile)
- # no need to update Makefile
- exit
- end
-end
+tklib = with_config("tklib")
+tcllib = with_config("tcllib")
+stubs = enable_config("tcltk_stubs") || with_config("tcltk_stubs")
-##############################################################
-# fuctions
-##############################################################
-def is_win32?
- /mswin|mingw|cygwin|bccwin/ =~ RUBY_PLATFORM
-end
+tcltk_version = with_config("tcltkversion")
-def is_macosx?
- /darwin/ =~ RUBY_PLATFORM
-end
+use_X = with_config("X11", (! is_win32))
def check_tcltk_version(version)
- return [nil, nil] unless version.kind_of? String
+ return [nil, nil] unless version
version = version.strip
tclver = version.dup
tkver = version.dup
- dot = major = minor_dot = minor = plvl_dot = plvl = ext = nil
+ 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
+ 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
@@ -144,560 +94,12 @@ def check_tcltk_version(version)
[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_dirs.concat Dir.glob(TkLib_Config["ActiveTcl"]).sort.reverse
- end
-
- if is_win32?
- if TkLib_Config["ActiveTcl"]
- path_head.concat ["c:/ActiveTcl", "c:/Program Files/ActiveTcl"]
- end
- path_head.concat [
- "c:/Tcl", "c:/Program Files/Tcl",
- "/Tcl", "/Program Files/Tcl"
- ]
- path_head.each{|dir| path_dirs << "#{dir}"}
-
- 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}/lib"
- path_dirs << "#{dir}" unless Dir.glob("#{dir}/lib*.*").empty?
-
- dirnames = []
- if TkLib_Config["ActiveTcl"]
- dirnames.concat ["ActiveTcl","activeTcl","Activetcl","activetcl"]
- end
- dirnames.concat ["TclTk","Tcl_Tk","Tcl-Tk","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_]*").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.map{|dir| dir.strip.chomp('/')}.each{|dir|
- next unless File.directory?(tcldir = File.join(dir, "Tcl.framework"))
- 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}.join(' ')
-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 fro {TCL,Tk}_LIB_FLAG and {TCL,Tk}_LIB_SPEC
- libpath = lib_spec.gsub(/(#{lib_flag}|-L)/, "").strip
-end
-
-def search_tclConfig(*paths) # list of lib-dir or [tcl-libdir, tk-libdir]
- TkLib_Config["tclConfig_paths"] = []
- config_dir = []
-
- paths.compact!
-
- fixed_tclConfig = ! paths.empty?
-
- paths.each{|path|
- if path.kind_of?(Array)
- config_dir << path
- else
- dirs = Dir.glob(path)
- config_dir.concat(dirs.zip(dirs))
- end
- }
-
- if is_win32?
- if TkLib_Config["ActiveTcl"]
- dirs = []
- if TkLib_Config["ActiveTcl"].kind_of?(String)
- dirs << TkLib_Config["ActiveTcl"]
- end
- dirs.concat [
- "c:/ActiveTcl*/lib", "c:/Activetcl*/lib",
- "c:/activeTcl*/lib", "c:/activetcl*/lib",
- "c:/Tcl*/lib", "c:/tcl*/lib",
- "c:/Program Files/ActiveTcl*/lib", "c:/Program Files/Activetcl*/lib",
- "c:/Program Files/activeTcl*/lib", "c:/Program Files/activetcl*/lib",
- "c:/Program Files/Tcl*/lib", "c:/Program Files/tcl*/lib",
- "/ActiveTcl*/lib", "/Activetcl*/lib",
- "/activeTcl*/lib", "/activetcl*/lib",
- "/Tcl*/lib", "/tcl*/lib",
- "/Program Files/ActiveTcl*/lib", "/Program Files/Activetcl*/lib",
- "/Program Files/activeTcl*/lib", "/Program Files/activetcl*/lib",
- "/Program Files/Tcl*/lib", "/Program Files/tcl*/lib"
- ]
- else
- dirs = [
- "c:/Tcl*/lib", "c:/tcl*/lib",
- "c:/Program Files/Tcl*/lib", "c:/Program Files/tcl*/lib",
- "/Tcl*/lib", "/tcl*/lib",
- "/Program Files/Tcl*/lib", "/Program Files/tcl*/lib"
- ]
- end
- dirs.collect{|d| Dir.glob(d)}.flatten!
- dirs |= dirs
-
- ENV['PATH'].split(';').each{|dir|
- 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))
-
- elsif framework = find_macosx_framework()
- config_dir.unshift(framework)
-
- else
- if activeTcl = TkLib_Config['ActiveTcl']
- # check latest version at first
- config_dir.concat(Dir.glob(activeTcl).sort.reverse)
- end
-
- config_dir.concat [
- RbConfig::CONFIG['libdir'],
- File.join(RbConfig::CONFIG['exec_prefix'], 'lib'),
- File.join(RbConfig::CONFIG['prefix'], 'lib'),
- "/usr/local/opt/lib", "/usr/local/pkg/lib", "/usr/local/share/lib",
- "/usr/local/lib", "/usr/opt/lib", "/usr/pkg/lib",
- "/usr/share/lib", "/usr/contrib/lib", "/usr/lib"
- ]
-
- 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,tcltk,Tcl,tcl,Tk,tk}[87]*/lib')
- Dir.glob(dir + '/{TclTk,tcltk,Tcl,tcl,Tk,tk}[87]*')
- Dir.glob(dir + '/{TclTk,tcltk,Tcl,tcl,Tk,tk}/lib')
- Dir.glob(dir + '/{TclTk,tcltk,Tcl,tcl,Tk,tk}')
- }.flatten!
-
- ENV['PATH'].split(':').each{|dir|
- config_dir << File.expand_path(File.join(dir, '..', 'lib'))
- }
-
- # for MacOS X
- #config_dir << "~/Library/Tcl"
- #config_dir.concat(Dir.glob("~/Library/Tcl/*").sort.reverse)
- config_dir << "/Library/Tcl"
- config_dir.concat(Dir.glob("/Library/Tcl/*").sort.reverse)
- config_dir << "/Network/Library/Tcl"
- config_dir.concat(Dir.glob("/Network/Library/Tcl/*").sort.reverse)
- config_dir << "/System/Library/Tcl"
- config_dir.concat(Dir.glob("/System/Library/Tcl/*").sort.reverse)
- [
- #"~/Library/Frameworks",
- "/Library/Frameworks",
- "/Network/Library/Frameworks", "/System/Library/Frameworks"
- ].each{|framework|
- config_dir << [File.expand_path(File.join(framework, 'Tcl.framework')),
- File.expand_path(File.join(framework, 'Tk.framework'))]
- }
- end
-
- tclver, tkver = TkLib_Config['tcltkversion']
- conf = nil
-
- config_dir.map{|dir|
- if dir.kind_of? Array
- [dir[0].strip.chomp('/'), dir[1].strip.chomp('/')]
- else
- dir.strip.chomp('/')
- end
- }.each{|dir|
- # print("check #{dir} ==>");
- if dir.kind_of? Array
- tcldir, tkdir = dir
- else
- tcldir = tkdir = dir
- end
-
- ['Config-shared.sh','config-shared.sh','Config.sh','config.sh'].each{|f|
- tclpath = File.join(tcldir, 'tcl' << f)
- tkpath = File.join(tkdir, 'tk' << f)
- next if !File.exist?(tclpath) || !File.exist?(tkpath)
-
- # parse tclConfig.sh/tkConfig.sh
- tclconf = parse_tclConfig(tclpath)
- next if tclver && tclver !~ /^#{tclconf['TCL_MAJOR_VERSION']}(\.?)#{tclconf['TCL_MINOR_VERSION']}/
- tkconf = parse_tclConfig(tkpath)
- next if tkver && tkver !~ /^#{tkconf['TK_MAJOR_VERSION']}(\.?)#{tkconf['TK_MINOR_VERSION']}/
-
- # find tclConfig.sh & tkConfig.sh
- conf = [tclconf, tkconf] unless conf
-
- # nativethread check
- unless TkLib_Config["ruby_with_thread"]
- tclconf['TCL_THREADS'] == '1'
- puts "WARNIG: find #{tclpath.inspect}, but it WITH nativethread-support under ruby WITHOUT nativethread-support. So, ignore it."
- TkLib_Config["tcltk-NG-path"] << File.dirname(tclpath)
- next
- end
-
- #return [tclpath, tkpath]
- # print(" #{[tclpath, tkpath]}");
- TkLib_Config["tclConfig_paths"] << [tclpath, tkpath]
- }
-
- # print("\n");
- }
-
- 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, tclConfig_dir, tkConfig_dir)
- use_tclConfig = (tclConfig_file != false) &&
- (tclConfig_dir != false) && (tkConfig_dir != false)
-
- tclConfig_file = nil unless tclConfig_file.kind_of? String
- tclConfig_dir = nil unless tclConfig_dir.kind_of? String
- tkConfig_dir = nil unless tkConfig_dir.kind_of? String
-
- unless tclConfig_dir
- if tclConfig_file
- tclConfig_dir = File.dirname(tclConfig_file)
- elsif tkConfig_dir
- tclConfig_dir = tkConfig_dir
- end
- end
- tkConfig_dir ||= tclConfig_dir
-
- TkLib_Config["tclConfig-file"] = tclConfig_file
- TkLib_Config["tclConfig-dir"] = tclConfig_dir
- TkLib_Config["tkConfig-dir"] = tkConfig_dir
-
- unless use_tclConfig
- puts("Don't use [tclConfig.sh, tkConfig.sh]")
- else
- puts("Search tclConfig.sh and tkConfig.sh.")
- if tclConfig_dir
- tclConfig, tkConfig = search_tclConfig([tclConfig_dir, tkConfig_dir])
- else
- tclConfig, tkConfig = search_tclConfig()
- end
- # TclConfig_Info = TkLib_Config["tclConfig_info"]
- # TkConfig_Info = TkLib_Config["tkConfig_info"]
-
- if tclConfig && tkConfig
- puts("Use [tclConfig.sh,tkConfig.sh] == ['#{tclConfig}','#{tkConfig}']")
- $LIBPATH |= [File.dirname(tclConfig)]
- $LIBPATH |= [File.dirname(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
- end
-
- [tclConfig, tkConfig]
-end
-
-def check_NG_path(path_list)
- path_list.find_all{|path| not TkLib_Config["tcltk-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"]).sort.reverse
- #end
- if TkLib_Config["ActiveTcl"].kind_of?(String) # glob path
- path_list.concat Dir.glob(TkLib_Config["ActiveTcl"]).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 + "-*").empty?
- dirs << head + "-#{ver}/lib" if !Dir.glob(head + "-[89].*").empty?
- dirs << head + "-#{ver.delete('.')}/lib" if !Dir.glob(head + "-[89][0-9]*").empty?
- end
-
- if !Dir.glob(head + "[_-]*").empty?
- dirs << head + "_#{ver}/lib" if !Dir.glob(head + "_[89].*").empty?
- dirs << head + "-#{ver}/lib" if !Dir.glob(head + "-[89].*").empty?
- dirs << head + "_#{ver.delete('.')}/lib" if !Dir.glob(head + "_[89][0-9]*").empty?
- dirs << head + "-#{ver.delete('.')}/lib" if !Dir.glob(head + "-[89][0-9]*").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)
-
- if is_win32?
- # exist-dir only
- path_list.each{|path|
- path = path.strip; $LIBPATH |= [path] if File.directory?(path)
- }
- else
- path_list.each{|path| $LIBPATH |= [path.strip] }
- end
-end
-
def find_tcl(tcllib, stubs, version, *opt_paths)
- puts "Search Tcl library"
- 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)}
-
- default_paths.concat [
- "c:/Tcl/lib", "c:/Program Files/Tcl/lib",
- "/Tcl/lib", "/Program Files/Tcl/lib"
- ].find_all{|dir| File.directory?(dir)}
-
- unless TkLib_Config["space-on-tk-libpath"]
- default_paths.delete_if{|path| path =~ / /}
- end
+ default_paths = ["/usr/local/lib", "/usr/pkg/lib", "/usr/lib"]
+ default_paths << "/Tcl/lib" # default for ActiveTcl
if (paths = opt_paths.compact).empty?
- if TclConfig_Info['config_file_path']
- # use definisions on tclConfig.sh
- TclConfig_Info['TCL_LIB_SPEC'].sub(TclConfig_Info['TCL_LIB_FLAG'],"").strip.sub("-L","") =~ /("|'|)([^"']+)\1/
- $LIBPATH |= [$2] unless $2.empty?
-
- unless stubs
- #*** Probably, TCL_LIBS is a subset of TK_LIBS. ***
- unless is_win32? # ignore tclConfig on Windows
- # $LDFLAGS << ' ' << TclConfig_Info['TCL_LIBS']
- # $DLDFLAGS << ' ' << TclConfig_Info['TCL_LIBS']
- $LDFLAGS << ' ' << TclConfig_Info['TCL_LIB_SPEC']
- end
- return true
- end
-
- if TclConfig_Info['TCL_SUPPORTS_STUBS'] == '0' ||
- TclConfig_Info['TCL_STUB_LIB_SPEC'].strip.empty?
- puts "#{TclConfig_Info['config_file_path']} tells us that your Tcl/Tk library doesn't support stub."
- return false
- else
- #*** Probably, TCL_LIBS is a subset of TK_LIBS. ***
- unless is_win32? # ignore tclConfig on Windows
- # $LDFLAGS << ' ' << TclConfig_Info['TCL_LIBS']
- # $DLDFLAGS << ' ' << TclConfig_Info['TCL_LIBS']
- $LDFLAGS << ' ' << TclConfig_Info['TCL_STUB_LIB_SPEC']
- end
- return true
- end
- end
-
- paths = check_NG_path(default_paths)
+ paths = default_paths
end
if stubs
@@ -711,7 +113,7 @@ def find_tcl(tcllib, stubs, version, *opt_paths)
if version && ! version.empty?
versions = [version]
else
- versions = TkLib_Config['search_versions']
+ versions = %w[8.6 8.5 8.4 8.3 8.2 8.1 8.0 7.6]
end
if tcllib
@@ -735,72 +137,12 @@ def find_tcl(tcllib, stubs, version, *opt_paths)
st
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)
- puts "Search Tk library"
- 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)}
-
- default_paths.concat [
- "c:/Tcl/lib", "c:/Program Files/Tcl/lib",
- "/Tcl/lib", "/Program Files/Tcl/lib"
- ].find_all{|dir| File.directory?(dir)}
-
- unless TkLib_Config["space-on-tk-libpath"]
- default_paths.delete_if{|path| path =~ / /}
- end
+ default_paths = ["/usr/local/lib", "/usr/pkg/lib", "/usr/lib"]
+ default_paths << "/Tcl/lib" # default for ActiveTcl
if (paths = opt_paths.compact).empty?
- if TkConfig_Info['config_file_path']
- # use definisions on tkConfig.sh
- TkConfig_Info['TK_LIB_SPEC'].sub(TkConfig_Info['TK_LIB_FLAG'],"").strip.sub("-L","") =~ /("|'|)([^"']+)\1/
- $LIBPATH |= [$2] unless $2.empty?
-
- unless stubs
- unless is_win32? # ignore tclConfig on Windows
- # $LDFLAGS << ' ' << parse_TK_LIBS(TkConfig_Info['TK_LIBS'])
- $LDFLAGS << ' ' << TkConfig_Info['TK_LIBS'] unless is_win32?
- # $DLDFLAGS << ' ' << parse_TK_LIBS(TkConfig_Info['TK_LIBS'])
- $LDFLAGS << ' ' << TkConfig_Info['TK_LIB_SPEC'] unless is_win32?
- end
- return true
- end
-
- if TkConfig_Info['TK_STUB_LIB_SPEC'].strip.empty?
- puts "#{TkConfig_Info['config_file_path']} tells us that your Tcl/Tk library doesn't support stub."
- return false
- else
- unless is_win32? # ignore tclConfig on Windows
- # $LDFLAGS << ' ' << parse_TK_LIBS(TkConfig_Info['TK_LIBS'])
- $LDFLAGS << ' ' << TkConfig_Info['TK_LIBS']
- # $DLDFLAGS << ' ' << parse_TK_LIBS(TkConfig_Info['TK_LIBS'])
- $LDFLAGS << ' ' << TkConfig_Info['TK_STUB_LIB_SPEC']
- end
- return true
- end
- end
-
- paths = check_NG_path(default_paths)
+ paths = default_paths
end
if stubs
@@ -814,7 +156,7 @@ def find_tk(tklib, stubs, version, *opt_paths)
if version && ! version.empty?
versions = [version]
else
- versions = TkLib_Config['search_versions']
+ versions = %w[8.6 8.5 8.4 8.3 8.2 8.1 8.0 4.2]
end
if tklib
@@ -826,7 +168,7 @@ def find_tk(tklib, stubs, version, *opt_paths)
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.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))
@@ -838,129 +180,16 @@ def find_tk(tklib, stubs, version, *opt_paths)
st
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)}
-
- base_dir.concat [
- "c:/Tcl/include", "c:/Program Files/Tcl/include",
- "/Tcl/include", "/Program Files/Tcl/include"
- ].find_all{|dir| File.directory?(dir)}
-
- unless TkLib_Config["space-on-tk-libpath"]
- base_dir.delete_if{|path| path =~ / /}
- end
-
- if TclConfig_Info['TCL_INCLUDE_SPEC'] &&
- have_tcl_h = try_cpp('tcl.h', TclConfig_Info['TCL_INCLUDE_SPEC'])
- $INCFLAGS << " " << TclConfig_Info['TCL_INCLUDE_SPEC']
- elsif have_tcl_h = have_header('tcl.h')
- # find
- else
- 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.delete('.')]
- }.flatten)
- }
- have_tcl_h = find_header('tcl.h', *paths)
- end
-
- if TkConfig_Info['TK_INCLUDE_SPEC'] &&
- have_tk_h = try_cpp('tk.h', TclConfig_Info['TK_INCLUDE_SPEC'])
- $INCFLAGS << " " << TkConfig_Info['TK_INCLUDE_SPEC']
- elsif have_tk_h = have_header('tk.h')
- # find
- else
- 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.delete('.')]
- }.flatten)
- }
- have_tk_h = find_header('tk.h', *paths)
- end
-
- have_tcl_h && have_tk_h
-end
-
-def setup_for_macosx_framework
- # search directory of header files
- if File.exist?(dir = File.join(TkLib_Config["tcltk-framework"],
- 'Tcl.framework', 'Headers'))
- TclConfig_Info['TCL_INCLUDE_SPEC'] = "-I#{dir} "
- TclConfig_Info['TK_INCLUDE_SPEC'] = "-I#{File.join(TkLib_Config['tcltk-framework'], 'Tk.framework', 'Headers')} "
- else
- dir = Dir.glob(File.join(TkLib_Config["tcltk-framework"],
- 'Tcl.framework', '*', 'Headers'))
- TclConfig_Info['TCL_INCLUDE_SPEC'] = "-I#{dir[0]} " unless dir.empty?
- TclConfig_Info['TK_INCLUDE_SPEC'] = "-I#{Dir.glob(File.join(TkLib_Config['tcltk-framework'], 'Tk.framework', '*', 'Headers'))[0]} "
- end
-
- $LDFLAGS << ' -framework Tk -framework Tcl'
-
- if TkLib_Config["tcl-framework-header"]
- TclConfig_Info['TCL_INCLUDE_SPEC'] =
- "-I#{TkLib_Config["tcl-framework-header"]} "
- end
- if TkLib_Config["tk-framework-header"]
- TkConfig_Info['TK_INCLUDE_SPEC'] =
- "-I#{TkLib_Config["tk-framework-header"]} "
- 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('/')))}
- defaults.compact.each{|path| paths.concat(Dir.glob(path.strip.chomp('/')))}
+ 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 search_X_libraries
- if TkConfig_Info['config_file_path']
- # use definitions on tkConfig.sh
- if TkConfig_Info['TK_XINCLUDES'] && TkConfig_Info['TK_XLIBSW'] &&
- !TkConfig_Info['TK_XINCLUDES'].strip.empty? &&
- !TkConfig_Info['TK_XLIBSW'].strip.empty?
- use_X = true && with_config("X11", (! is_win32?))
- else
- use_X = false || with_config("X11", false)
- end
- else
- # depend on configure options
- use_X = with_config("X11", (! is_win32?))
- end
-
- if use_X
- puts("Use X11 libraries.")
- x11_idir, x11_ldir = dir_config("X11")
- x11_ldir2 = with_config("X11-lib")
- exit unless find_X11(x11_ldir2, x11_ldir)
- end
-
- use_X
-end
+end
def pthread_check()
tcl_major_ver = nil
@@ -976,36 +205,60 @@ def pthread_check()
tcl_enable_thread = nil
end
- if TclConfig_Info['config_file_path']
+ if (tclConfig = with_config("tclConfig-file"))
if tcl_enable_thread == true
- puts("Warning: definiton of tclConfig.sh is ignored, because --enable-tcl-thread option is given.")
+ puts("Warning: --with-tclConfig-file option 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.")
+ 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
- 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
+ begin
+ open(tclConfig, "r") do |cfg|
+ while line = cfg.gets()
+ if line =~ /^\s*TCL_THREADS=(0|1)/
+ tcl_enable_thread = ($1 == "1")
+ break
+ end
+
+ if line =~ /^\s*TCL_MAJOR_VERSION=("|')(\d+)\1/
+ tcl_major_ver = $2
+ if tcl_major_ver =~ /^[1-7]$/
+ tcl_enable_thread = false
+ break
+ end
+ if tcl_major_ver == "8" && tcl_minor_ver == "0"
+ tcl_enable_thread = false
+ break
+ end
+ end
+
+ if line =~ /^\s*TCL_MINOR_VERSION=("|')(\d+)\1/
+ tcl_minor_ver = $2
+ if tcl_major_ver == "8" && tcl_minor_ver == "0"
+ tcl_enable_thread = false
+ break
+ end
+ end
+ end
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.")
+ if tcl_enable_thread == nil
+ # not 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_Info['config_file_path']
+ if tcl_enable_thread == nil && !tclConfig
# tcl-thread is unknown and tclConfig is unavailable
begin
try_run_available = try_run("int main() { exit(0); }")
@@ -1014,12 +267,12 @@ def pthread_check()
puts(%Q'\
*****************************************************************************
**
-** NATIVETHREAD SUPPORT CHECK WARNING:
+** PTHREAD 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
+** 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.
**
@@ -1033,7 +286,7 @@ def pthread_check()
# tcl-thread is unknown
if try_run(<<EOF)
#include <tcl.h>
-int main() {
+int main() {
Tcl_Interp *ip;
ip = Tcl_CreateInterp();
exit((Tcl_Eval(ip, "set tcl_platform(threaded)") == TCL_OK)? 0: 1);
@@ -1052,27 +305,26 @@ EOF
end
# check pthread mode
- if (TkLib_Config["ruby_with_thread"])
+ if (macro_defined?('HAVE_NATIVETHREAD', '#include "ruby.h"'))
# ruby -> enable
unless tcl_enable_thread
# ruby -> enable && tcl -> disable
puts(%Q'\
*****************************************************************************
**
-** NATIVETHREAD SUPPORT MODE WARNING:
+** PTHREAD 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.
+** 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 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).
+** 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).
**
*****************************************************************************
')
@@ -1094,13 +346,13 @@ EOF
puts(%Q'\
*****************************************************************************
**
-** NATIVETHREAD SUPPORT MODE ERROR:
+** PTHREAD SUPPORT MODE ERROR:
**
-** Ruby is not compiled with --enable-pthread, but your Tcl/Tk
-** library seems to be compiled with nativethread support. This
+** 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 nativethread support.
+** 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.
@@ -1117,139 +369,44 @@ EOF
end
end
-##############################################################
-# main
-##############################################################
-# check header files
-have_func("ruby_native_thread_p", "ruby.h")
-have_func("rb_errinfo", "ruby.h")
-have_func("rb_safe_level", "ruby.h")
-have_func("rb_hash_lookup", "ruby.h")
-have_func("rb_proc_new", "ruby.h")
-have_func("rb_obj_untrust", "ruby.h")
-have_func("rb_obj_taint", "ruby.h")
-have_func("rb_set_safe_level_force", "ruby.h")
-
-have_struct_member("struct RArray", "ptr", "ruby.h")
-have_struct_member("struct RArray", "len", "ruby.h")
-
-# check libraries
-unless is_win32?
- have_library("nsl", "t_open")
- have_library("socket", "socket")
- have_library("dl", "dlopen")
- have_library("m", "log")
-end
-$CPPFLAGS += ' -D_WIN32' if /cygwin/ =~ RUBY_PLATFORM
-
-# Does ruby have nativethread ?
-TkLib_Config["ruby_with_thread"] =
- macro_defined?('HAVE_NATIVETHREAD', '#include "ruby.h"')
+tclver, tkver = check_tcltk_version(tcltk_version)
-#---------------------------------------------------
-# check requirement of Tcl/tk version
-tcltk_version = with_config("tcltkversion")
-tclver, tkver =
- TkLib_Config["tcltkversion"] = check_tcltk_version(tcltk_version)
-puts("Specified Tcl/Tk version is #{[tclver, tkver]}") if tclver && tkver
+if have_header("tcl.h") && have_header("tk.h") &&
+ ( tcltk_framework ||
+ ( ( !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
-# use ActiveTcl ?
-#if activeTcl = with_config("ActiveTcl")
-if activeTcl = with_config("ActiveTcl", true)
- puts("Use ActiveTcl libraries (if available).")
- activeTcl = '/opt/ActiveTcl*/lib' unless activeTcl.kind_of? String
-end
-TkLib_Config["ActiveTcl"] = activeTcl
+ if tcltk_framework
+ if tcl_framework_header
+ $CPPFLAGS += " -I#{tcl_framework_header}"
+ else
+ $CPPFLAGS += " -I#{tcltk_framework}/Tcl.framework/Headers"
+ end
-# allow space chars on a libpath
-TkLib_Config["space-on-tk-libpath"] =
- enable_config("space-on-tk-libpath", ! is_win32?)
+ if tk_framework_header
+ $CPPFLAGS += " -I#{tk_framework_header}"
+ else
+ $CPPFLAGS += " -I#{tcltk_framework}/Tk.framework/Headers"
+ end
-# 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
+ $LDFLAGS += ' -framework Tk -framework Tcl'
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 += ' -DUSE_TCL_STUBS -DUSE_TK_STUBS'
-end
-# get tclConfig.sh/tkConfig.sh
-TkLib_Config["tcltk-NG-path"] = []
-tclcfg, tkcfg = get_tclConfig(with_config("tclConfig-file", true),
- with_config("tclConfig-dir", true),
- with_config("tkConfig-dir", true))
-TclConfig_Info = TkLib_Config["tclConfig_info"] || {}
-TkConfig_Info = TkLib_Config["tkConfig_info"] || {}
-TclConfig_Info['config_file_path'] = tclcfg
-TkConfig_Info['config_file_path'] = tkcfg
+ if stubs or pthread_check
+ # create Makefile
-# check tk_shlib_search_path
-check_shlib_search_path(with_config('tk-shlib-search-path'))
+ # for SUPPORT_STATUS
+ $INSTALLFILES ||= []
+ $INSTALLFILES << ["lib/tkextlib/SUPPORT_STATUS", "$(RUBYLIBDIR)", "lib"]
-# search X libraries
-use_X = search_X_libraries
+ have_func("rb_hash_lookup", "ruby.h")
-# set TCL_DEFS and TK_DEFS
-# $CPPFLAGS += " #{TclConfig_Info['TCL_DEFS']}"
-# $CPPFLAGS += " #{TkConfig_Info['TK_DEFS']}"
-$CPPFLAGS += collect_tcltk_defs(TclConfig_Info['TCL_DEFS'], TkConfig_Info['TK_DEFS'])
-
-# MacOS X Frameworks?
-if TkLib_Config["tcltk-framework"]
- puts("Use MacOS X Frameworks.")
- setup_for_macosx_framework
-end
-
-# search Tcl/Tk libraries
-tk_idir, tk_ldir = dir_config("tk")
-tcl_idir, tcl_ldir = dir_config("tcl")
-
-tk_ldir2 = with_config("tk-lib")
-tcl_ldir2 = with_config("tcl-lib")
-
-tk_ldir_list = [tk_ldir2, tk_ldir]
-tcl_ldir_list = [tcl_ldir2, tcl_ldir]
-
-tklib = with_config("tklib")
-tcllib = with_config("tcllib")
-
-TclConfig_Info['TCL_INCLUDE_SPEC'] = "-I#{tcl_idir.quote}" if tcl_idir
-TkConfig_Info['TK_INCLUDE_SPEC'] = "-I#{tk_idir.quote}" if tk_idir
-
-#---------------------------------------------------
-
-if (TkLib_Config["tcltk-framework"] ||
- ( find_tcltk_header(tclver, tkver) &&
- find_tcl(tcllib, stubs, tclver, *tcl_ldir_list) &&
- find_tk(tklib, stubs, tkver, *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}\\"]
-
- create_makefile("tcltklib")
-
- puts "Find Tcl/Tk libraries. Make tcltklib.so which is required by Ruby/Tk."
-else
- puts "Can't find proper Tcl/Tk libraries. So, can't make tcltklib.so which is required by Ruby/Tk."
+ # create
+ $defs << %[-DRUBY_VERSION=\\"#{RUBY_VERSION}\\"]
+ $defs << %[-DRUBY_RELEASE_DATE=\\"#{RUBY_RELEASE_DATE}\\"]
+ create_makefile("tcltklib")
+ end
end
diff --git a/ext/tk/lib/multi-tk.rb b/ext/tk/lib/multi-tk.rb
index c491d0c7ba..ec718678f0 100644
--- a/ext/tk/lib/multi-tk.rb
+++ b/ext/tk/lib/multi-tk.rb
@@ -28,20 +28,14 @@ class << TclTkIp
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
+ __new__(*args)
end
end
################################################
# use pseudo-toplevel feature of MultiTkIp ?
-if (!defined?(Use_PseudoToplevel_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)
@@ -73,9 +67,9 @@ if (!defined?(Use_PseudoToplevel_Feature_of_MultiTkIp) ||
def method_missing(id, *args)
begin
- has_top = (top = MultiTkIp.__getip.__pseudo_toplevel) &&
- top.respond_to?(:pseudo_toplevel_evaluable?) &&
- top.pseudo_toplevel_evaluable? &&
+ 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
@@ -120,35 +114,34 @@ MultiTkIp_OK.freeze
class MultiTkIp
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
+ WITH_RUBY_VM = Object.const_defined?(:VM) && ::VM.class == Class
+ WITH_ENCODING = Object.const_defined?(:Encoding) && ::Encoding.class == Class
- (@@SLAVE_IP_ID = ['slave'.freeze, TkUtil.untrust('0')]).instance_eval{
+ (@@SLAVE_IP_ID = ['slave'.freeze, '0'.taint]).instance_eval{
@mutex = Mutex.new
def mutex; @mutex; end
freeze
}
- @@IP_TABLE = TkUtil.untrust({}) unless defined?(@@IP_TABLE)
+ @@IP_TABLE = {}.taint 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]
+ @@INIT_IP_ENV = [].taint unless defined?(@@INIT_IP_ENV) # table of Procs
+ @@ADD_TK_PROCS = [].taint unless defined?(@@ADD_TK_PROCS) # table of [name, args, body]
- @@TK_TABLE_LIST = TkUtil.untrust([]) unless defined?(@@TK_TABLE_LIST)
+ @@TK_TABLE_LIST = [].taint unless defined?(@@TK_TABLE_LIST)
unless defined?(@@TK_CMD_TBL)
- @@TK_CMD_TBL = TkUtil.untrust(Object.new)
+ @@TK_CMD_TBL = Object.new.taint
# @@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)
+ @@TK_CMD_TBL.instance_variable_set('@tbl', Hash.new{|hash,key|
+ fail IndexError,
+ "unknown command ID '#{key}'"
+ }.taint)
class << @@TK_CMD_TBL
allow = [
- '__send__', '__id__', 'freeze', 'inspect', 'kind_of?', 'object_id',
+ '__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)}
@@ -187,7 +180,7 @@ class MultiTkIp
def delete(idx, &blk)
# if gets an entry, is permited to delete
if self[idx]
- @tbl.delete(idx)
+ @tbl.delete(idx)
elsif blk
blk.call(idx)
else
@@ -223,10 +216,7 @@ class MultiTkIp
@@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)}
+ @cmd = cmd
self.freeze
end
attr_reader :ip, :cmd
@@ -236,8 +226,8 @@ class MultiTkIp
def call(*args)
unless @ip.deleted?
current = Thread.current
- backup_ip = current[:callback_ip]
- current[:callback_ip] = @ip
+ backup_ip = current['callback_ip']
+ current['callback_ip'] = @ip
begin
ret = @ip.cb_eval(@cmd, *args)
fail ret if ret.kind_of?(Exception)
@@ -270,7 +260,7 @@ class MultiTkIp
fail e
end
ensure
- current[:callback_ip] = backup_ip
+ current['callback_ip'] = backup_ip
end
end
end
@@ -446,7 +436,7 @@ class MultiTkIp
rescue SystemExit => e
# delete IP
unless @interp.deleted?
- @slave_ip_tbl.each{|name, subip|
+ @slave_ip_tbl.each{|name, subip|
_destroy_slaves_of_slaveIP(subip)
begin
# subip._eval_without_enc("foreach i [after info] {after cancel $i}")
@@ -469,11 +459,11 @@ class MultiTkIp
next if subip.deleted?
end
end
- if subip.respond_to?(:safe_base?) && subip.safe_base? &&
+ 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')
+ subip._eval_without_enc('exit')
rescue Exception
end
else
@@ -548,11 +538,11 @@ class MultiTkIp
next if subip.deleted?
end
end
- if subip.respond_to?(:safe_base?) && subip.safe_base? &&
+ 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')
+ subip._eval_without_enc('exit')
rescue Exception
end
else
@@ -667,12 +657,12 @@ class MultiTkIp
case cmd
when 'set_safe_level'
begin
- safe_level = args[0] if safe_level < args[0]
+ safe_level = args[0] if safe_level < args[0]
rescue Exception
end
when 'call_mainloop'
thread = args.shift
- _check_and_return(thread,
+ _check_and_return(thread,
MultiTkIp_OK.new(_receiver_mainloop(*args)))
else
# ignore
@@ -680,8 +670,8 @@ class MultiTkIp
else
# procedure
- last_thread[thread] = _receiver_eval_proc(last_thread[thread],
- safe_level, thread,
+ last_thread[thread] = _receiver_eval_proc(last_thread[thread],
+ safe_level, thread,
cmd, *args)
end
end
@@ -706,7 +696,7 @@ class MultiTkIp
if @interp.deleted?
thread.raise RuntimeError, 'the interpreter is already deleted'
else
- thread.raise RuntimeError,
+ thread.raise RuntimeError,
'the interpreter no longer receives command procedures'
end
end
@@ -739,15 +729,15 @@ class MultiTkIp
@@DEFAULT_MASTER = self.allocate
@@DEFAULT_MASTER.instance_eval{
- @tk_windows = TkUtil.untrust({})
+ @tk_windows = {}.taint
- @tk_table_list = TkUtil.untrust([])
+ @tk_table_list = [].taint
- @slave_ip_tbl = TkUtil.untrust({})
+ @slave_ip_tbl = {}.taint
- @slave_ip_top = TkUtil.untrust({})
+ @slave_ip_top = {}.taint
- @evloop_thread = TkUtil.untrust([])
+ @evloop_thread = [].taint
unless keys.kind_of? Hash
fail ArgumentError, "expecting a Hash object for the 2nd argument"
@@ -758,49 +748,19 @@ class MultiTkIp
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
+ current[:interp] = interp = TclTkIp.new(name, _keys2opts(keys))
#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)
-
+ current[:status] = interp.mainloop(true)
+ rescue Exception=>e
+ current[:status] = e
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
+ mutex.synchronize{ cond_var.broadcast }
end
+ current[:status] = interp.mainloop(false)
}
until @interp_thread[:interp]
Thread.pass
@@ -818,19 +778,13 @@ class MultiTkIp
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([])
+ @callback_status = [].taint
@system = Object.new
- @wait_on_mainloop = TkUtil.untrust([true, 0])
+ @wait_on_mainloop = [true, 0].taint
@threadgroup = Thread.current.group
@@ -855,13 +809,13 @@ class MultiTkIp
@pseudo_toplevel = [false, nil]
def self.__pseudo_toplevel
- Thread.current.group == ThreadGroup::Default &&
+ 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 &&
+ unless (Thread.current.group == ThreadGroup::Default &&
MultiTkIp.__getip == @@DEFAULT_MASTER)
fail SecurityError, "no permission to manipulate"
end
@@ -885,7 +839,7 @@ class MultiTkIp
end
def self.__pseudo_toplevel_evaluable=(mode)
- unless (Thread.current.group == ThreadGroup::Default &&
+ unless (Thread.current.group == ThreadGroup::Default &&
MultiTkIp.__getip == @@DEFAULT_MASTER)
fail SecurityError, "no permission to manipulate"
end
@@ -912,7 +866,7 @@ class MultiTkIp
rescue @assign_request=>req
begin
req.ret[0] = req.target.instance_eval{
- @cmd_receiver, @receiver_watchdog =
+ @cmd_receiver, @receiver_watchdog =
_create_receiver_and_watchdog(@safe_level[0])
@threadgroup.add @cmd_receiver
@threadgroup.add @receiver_watchdog
@@ -997,9 +951,8 @@ class MultiTkIp
begin
class << subclass
self.methods.each{|m|
- name = m.to_s
begin
- unless name == '__id__' || name == '__send__' || name == 'freeze'
+ unless m == '__id__' || m == '__send__' || m == 'freeze'
undef_method(m)
end
rescue Exception
@@ -1009,7 +962,7 @@ class MultiTkIp
end
ensure
subclass.freeze
- fail SecurityError,
+ fail SecurityError,
"cannot create subclass of MultiTkIp on a untrusted ThreadGroup"
end
end
@@ -1018,9 +971,9 @@ class MultiTkIp
######################################
@@SAFE_OPT_LIST = [
- 'accessPath'.freeze,
- 'statics'.freeze,
- 'nested'.freeze,
+ 'accessPath'.freeze,
+ 'statics'.freeze,
+ 'nested'.freeze,
'deleteHook'.freeze
].freeze
@@ -1033,7 +986,7 @@ class MultiTkIp
keys.each{|k,v|
k_str = k.to_s
if k_str == 'name'
- name = v
+ name = v
elsif k_str == 'safe'
safe = v
elsif @@SAFE_OPT_LIST.member?(k_str)
@@ -1105,8 +1058,8 @@ class MultiTkIp
# match display?
if assoc_display != new_keys['display']
if optkeys.key?(:display) || optkeys.key?('display')
- fail RuntimeError,
- "conflicting 'display'=>#{new_keys['display']} " +
+ fail RuntimeError,
+ "conflicting 'display'=>#{new_keys['display']} " +
"and display '#{assoc_display}' on 'use'=>#{new_keys['use']}"
else
new_keys['display'] = assoc_display
@@ -1173,14 +1126,14 @@ class MultiTkIp
fc.bindtags = fc.bindtags.unshift(tag)
TkFrame.new(fc, :bd=>0){|f|
- TkButton.new(f,
- :text=>'Delete', :bd=>1, :padx=>2, :pady=>0,
+ 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,
+ TkLabel.new(fc, :text=>msg, :padx=>2, :pady=>0,
:anchor=>:w).pack(:side=>:left, :fill=>:both, :expand=>true)
fc.pack(:side=>:bottom, :fill=>:x)
@@ -1204,11 +1157,6 @@ class MultiTkIp
# 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
@@ -1223,7 +1171,7 @@ class MultiTkIp
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, top_path = __create_safetk_frame(slave_ip, ip_name, app_name,
tk_opts)
@slave_ip_top[ip_name] = top_path
end
@@ -1233,11 +1181,11 @@ class MultiTkIp
end
if safe_opts.key?('deleteHook') || safe_opts.key?(:deleteHook)
- @interp._eval("::safe::interpConfigure #{ip_name} " +
+ @interp._eval("::safe::interpConfigure #{ip_name} " +
_keys2opts(safe_opts))
else
- @interp._eval("::safe::interpConfigure #{ip_name} " +
- _keys2opts(safe_opts) + '-deleteHook {' +
+ @interp._eval("::safe::interpConfigure #{ip_name} " +
+ _keys2opts(safe_opts) + '-deleteHook {' +
TkComm._get_eval_string(proc{|slave|
self._default_delete_hook(slave)
}) + '}')
@@ -1251,11 +1199,6 @@ class MultiTkIp
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)
@@ -1306,12 +1249,12 @@ class MultiTkIp
@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?
+ @tk_windows.taint unless @tk_windows.tainted?
+ @tk_table_list.taint unless @tk_table_list.tainted?
+ @slave_ip_tbl.taint unless @slave_ip_tbl.tainted?
+ @slave_ip_top.taint unless @slave_ip_top.tainted?
+ @cb_error_proc.taint unless @cb_error_proc.tainted?
+ @evloop_thread.taint unless @evloop_thread.tainted?
@callback_status = []
@@ -1325,22 +1268,9 @@ class MultiTkIp
# 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)
}
@@ -1349,79 +1279,20 @@ class MultiTkIp
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
- 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)
- }
- 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,
+ @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 !!!!!!!!!!!
@@ -1442,15 +1313,15 @@ class MultiTkIp
@safe_level = [master.safe_level]
end
end
- @set_alias_proc = proc{|name|
+ @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])
+ @wait_on_mainloop = [true, 0].taint
+ # @wait_on_mainloop = [false, 0].taint
@threadgroup = ThreadGroup.new
@@ -1469,8 +1340,9 @@ class MultiTkIp
@@DEFAULT_MASTER.assign_receiver_and_watchdog(self)
@@IP_TABLE[@threadgroup] = self
- @@TK_TABLE_LIST.size.times{
- @tk_table_list << TkUtil.untrust({})
+ @@TK_TABLE_LIST.size.times{
+ (tbl = {}).tainted? || tbl.taint
+ @tk_table_list << tbl
}
_init_ip_internal(@@INIT_IP_ENV, @@ADD_TK_PROCS)
@@ -1518,17 +1390,6 @@ 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
@@ -1539,18 +1400,15 @@ class MultiTkIp
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]
+ 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,
+ fail SecurityError,
"cannot call Tk methods on #{Thread.current.inspect}"
end
ip
@@ -1564,11 +1422,11 @@ class << MultiTkIp
alias __new new
private :__new
- def new_master(safe=nil, keys={}, &blk)
+ def new_master(safe=nil, keys={})
if MultiTkIp::WITH_RUBY_VM
#### TODO !!!!!!
- fail RuntimeError,
- 'sorry, still not support multiple master-interpreters on RubyVM'
+ fail RuntimeError,
+ 'sorry, still not support multiple master-interpreters on Ruby VM'
end
if safe.kind_of?(Hash)
@@ -1586,17 +1444,15 @@ class << MultiTkIp
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
+ if block_given?
+ Thread.new{ip.eval_proc(proc{$SAFE=ip.safe_level; Proc.new}.call)}
+ end
ip
end
alias new new_master
- def new_slave(safe=nil, keys={}, &blk)
+ def new_slave(safe=nil, keys={})
if safe.kind_of?(Hash)
keys = safe
elsif safe.kind_of?(Integer)
@@ -1613,15 +1469,13 @@ class << MultiTkIp
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)
+ Thread.new{ip.eval_proc(proc{$SAFE=ip.safe_level; Proc.new}.call)}
end
ip
end
alias new_trusted_slave new_slave
- def new_safe_slave(safe=4, keys={}, &blk)
+ def new_safe_slave(safe=4, keys={})
if safe.kind_of?(Hash)
keys = safe
elsif safe.kind_of?(Integer)
@@ -1636,9 +1490,7 @@ class << MultiTkIp
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)
+ Thread.new{ip.eval_proc(proc{$SAFE=ip.safe_level; Proc.new}.call)}
end
ip
end
@@ -1724,7 +1576,7 @@ class MultiTkIp
def slaves(all = false)
raise SecurityError, "no permission to manipulate" unless self.manipulable?
- @interp._invoke('interp','slaves').split.map!{|name|
+ @interp._invoke('interp','slaves').split.map!{|name|
if @slave_ip_tbl.key?(name)
@slave_ip_tbl[name]
elsif all
@@ -1771,8 +1623,9 @@ class MultiTkIp
end
def _add_new_tables
- (@@TK_TABLE_LIST.size - @tk_table_list.size).times{
- @tk_table_list << TkUtil.untrust({})
+ (@@TK_TABLE_LIST.size - @tk_table_list.size).times{
+ (tbl = {}).tainted? || tbl.taint
+ @tk_table_list << tbl
}
end
@@ -1807,7 +1660,7 @@ class MultiTkIp
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|
+ add_tk_procs.each{|name, args, body|
if master?
@interp._invoke('proc', name, args, body) if args && body
else
@@ -1830,7 +1683,7 @@ class MultiTkIp
__getip._tk_table_list[id]
end
def self.create_table
- if __getip.slave?
+ if __getip.slave?
begin
raise SecurityError, "slave-IP has no permission creating a new table"
rescue SecurityError => e
@@ -1880,7 +1733,7 @@ class MultiTkIp
end
end
- # @@IP_TABLE.each{|tg, ip|
+ # @@IP_TABLE.each{|tg, ip|
# ip._init_ip_env(script)
# }
@@DEFAULT_MASTER.__init_ip_env__(@@IP_TABLE, script)
@@ -1892,7 +1745,7 @@ class MultiTkIp
else
name = name.to_s
@@ADD_TK_PROCS << [name, args, body]
- @@IP_TABLE.each{|tg, ip|
+ @@IP_TABLE.each{|tg, ip|
ip._add_tk_procs(name, args, body)
}
end
@@ -1901,11 +1754,11 @@ class MultiTkIp
def self.remove_tk_procs(*names)
names.each{|name|
name = name.to_s
- @@ADD_TK_PROCS.delete_if{|elem|
+ @@ADD_TK_PROCS.delete_if{|elem|
elem.kind_of?(Array) && elem[0].to_s == name
}
}
- @@IP_TABLE.each{|tg, ip|
+ @@IP_TABLE.each{|tg, ip|
ip._remove_tk_procs(*names)
}
end
@@ -1915,6 +1768,7 @@ class MultiTkIp
end
end
+
# for callback operation
class MultiTkIp
def self.cb_entry_class
@@ -1939,20 +1793,12 @@ class MultiTkIp
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
@@ -2012,7 +1858,7 @@ class MultiTkIp
end
def __pseudo_toplevel=(m)
- unless (Thread.current.group == ThreadGroup::Default &&
+ unless (Thread.current.group == ThreadGroup::Default &&
MultiTkIp.__getip == @@DEFAULT_MASTER)
fail SecurityError, "no permission to manipulate"
end
@@ -2036,7 +1882,7 @@ class MultiTkIp
end
def __pseudo_toplevel_evaluable=(mode)
- unless (Thread.current.group == ThreadGroup::Default &&
+ unless (Thread.current.group == ThreadGroup::Default &&
MultiTkIp.__getip == @@DEFAULT_MASTER)
fail SecurityError, "no permission to manipulate"
end
@@ -2047,48 +1893,6 @@ end
# evaluate a procedure on the proper interpreter
class MultiTkIp
- # instance & class method
- def _proc_on_safelevel(cmd=nil, &blk) # require a block for eval
- 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
@@ -2098,23 +1902,23 @@ class MultiTkIp
end
# on IP thread
- if @cmd_receiver == Thread.current ||
+ 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
+ warn("Warning: "+ $! + " on " + self.inspect) if $DEBUG
begin
self._eval_without_enc('exit')
- rescue Exception => e
+ rescue Exception
end
self.delete
ret = nil
rescue Exception => e
if $DEBUG
- warn("Warning: " + e.class.inspect +
- ((e.message.length > 0)? ' "' + e.message + '"': '') +
+ warn("Warning: " + e.class.inspect +
+ ((e.message.length > 0)? ' "' + e.message + '"': '') +
" on " + self.inspect)
end
=begin
@@ -2141,9 +1945,9 @@ class MultiTkIp
rescue Exception => e
# ignore
if $DEBUG
- warn("Warning: " + e.class.inspect +
- ((e.message.length > 0)? ' "' + e.message + '"': '') +
- " on " + self.inspect)
+ warn("Warning: " + e.class.inspect +
+ ((e.message.length > 0)? ' "' + e.message + '"': '') +
+ " on " + self.inspect)
end
return e
end
@@ -2159,7 +1963,7 @@ class MultiTkIp
return ret.value
rescue SystemExit => e
# exit IP
- warn("Warning: " + e.inspect + " on " + self.inspect) if $DEBUG
+ warn("Warning: " + $! + " on " + self.inspect) if $DEBUG
begin
self._eval_without_enc('exit')
rescue Exception
@@ -2172,9 +1976,9 @@ class MultiTkIp
end
rescue Exception => e
if $DEBUG
- warn("Warning: " + e.class.inspect +
- ((e.message.length > 0)? ' "' + e.message + '"': '') +
- " on " + self.inspect)
+ warn("Warning: " + e.class.inspect +
+ ((e.message.length > 0)? ' "' + e.message + '"': '') +
+ " on " + self.inspect)
end
return e
end
@@ -2182,80 +1986,25 @@ class MultiTkIp
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
+ current = Thread.current
+ backup_ip = current['callback_ip']
+ current['callback_ip'] = self
begin
eval_proc_core(false, cmd, *args)
- rescue Exception=>e
- e
ensure
+ current['callback_ip'] = backup_ip
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,
+ # 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
@@ -2267,27 +2016,26 @@ end
if TclTkLib.mainloop_thread? == true
# call from eventloop
current = Thread.current
- backup_ip = current[:callback_ip]
- current[:callback_ip] = self
+ backup_ip = current['callback_ip']
+ current['callback_ip'] = self
begin
- eval_proc_core(false,
+ eval_proc_core(false,
proc{|safe, *params|
$SAFE=safe if $SAFE < safe
cmd.call(*params)
}, *args)
ensure
- current[:callback_ip] = backup_ip
+ current['callback_ip'] = backup_ip
end
else
- eval_proc_core(true,
- proc{|safe, *params|
+ 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)
@@ -2301,8 +2049,8 @@ end
Thread.new{
eval_proc(cmd, *args)
=begin
- eval_proc_core(false,
- proc{|safe, *params|
+ eval_proc_core(false,
+ proc{|safe, *params|
$SAFE=safe if $SAFE < safe
Thread.new(*params, &cmd).value
},
@@ -2321,8 +2069,8 @@ end
raise RuntimeError, "A String object is expected for the 'cmd' argument"
end
- eval_proc_core(true,
- proc{|safe|
+ eval_proc_core(true,
+ proc{|safe|
Kernel.eval("$SAFE=#{safe} if $SAFE < #{safe};" << cmd,
*eval_args)
})
@@ -2335,8 +2083,8 @@ end
raise RuntimeError, "A String object is expected for the 'cmd' argument"
end
Thread.new{
- eval_proc_core(true,
- proc{|safe|
+ eval_proc_core(true,
+ proc{|safe|
Kernel.eval("$SAFE=#{safe} if $SAFE < #{safe};" << cmd,
*eval_args)
})
@@ -2421,11 +2169,6 @@ 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)
@@ -2685,8 +2428,7 @@ end
# depend on TclTkIp
class MultiTkIp
-# def mainloop(check_root = true, restart_on_dead = true)
- def mainloop(check_root = true, restart_on_dead = false)
+ def mainloop(check_root = true, restart_on_dead = true)
raise SecurityError, "no permission to manipulate" unless self.manipulable?
if WITH_RUBY_VM ### Ruby 1.9 !!!!!!!!!!!
@@ -2702,7 +2444,7 @@ class MultiTkIp
if $SAFE >= 4
_receiver_mainloop(check_root).join
else
- @cmd_queue.enq([@system, 'call_mainloop',
+ @cmd_queue.enq([@system, 'call_mainloop',
Thread.current, check_root])
Thread.stop
end
@@ -2715,7 +2457,7 @@ class MultiTkIp
end
rescue SystemExit => e
# exit IP
- warn("Warning: " + e.inspect + " on " + self.inspect) if $DEBUG
+ warn("Warning: " + $! + " on " + self.inspect) if $DEBUG
begin
self._eval_without_enc('exit')
rescue Exception
@@ -2723,9 +2465,9 @@ class MultiTkIp
self.delete
rescue StandardError => e
if $DEBUG
- warn("Warning: " + e.class.inspect +
- ((e.message.length > 0)? ' "' + e.message + '"': '') +
- " on " + self.inspect)
+ warn("Warning: " + e.class.inspect +
+ ((e.message.length > 0)? ' "' + e.message + '"': '') +
+ " on " + self.inspect)
end
return e
rescue Exception => e
@@ -2744,9 +2486,9 @@ class MultiTkIp
@interp.mainloop(check_root)
rescue StandardError => e
if $DEBUG
- warn("Warning: " + e.class.inspect +
- ((e.message.length > 0)? ' "' + e.message + '"': '') +
- " on " + self.inspect)
+ warn("Warning: " + e.class.inspect +
+ ((e.message.length > 0)? ' "' + e.message + '"': '') +
+ " on " + self.inspect)
end
end
=end
@@ -2771,7 +2513,7 @@ class MultiTkIp
@interp.mainloop(check_root)
rescue StandardError => e
if TclTkLib.mainloop_abort_on_exception != nil
- #STDERR.print("Warning: Tk mainloop receives ", $!.class.inspect,
+ #STDERR.print("Warning: Tk mainloop receives ", $!.class.inspect,
# " exception (ignore) : ", $!.message, "\n");
if $DEBUG
warn("Warning: Tk mainloop receives " << e.class.inspect <<
@@ -2782,7 +2524,7 @@ class MultiTkIp
rescue Exception => e
=begin
if TclTkLib.mainloop_abort_on_exception != nil
- #STDERR.print("Warning: Tk mainloop receives ", $!.class.inspect,
+ #STDERR.print("Warning: Tk mainloop receives ", $!.class.inspect,
# " exception (ignore) : ", $!.message, "\n");
if $DEBUG
warn("Warning: Tk mainloop receives " << e.class.inspect <<
@@ -2853,11 +2595,11 @@ class MultiTkIp
next if subip.deleted?
end
end
- if subip.respond_to?(:safe_base?) && subip.safe_base? &&
+ 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')
+ subip._eval_without_enc('exit')
rescue Exception
end
else
@@ -3151,7 +2893,7 @@ class MultiTkIp
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,
+ ret = @interp._invoke('interp', 'alias', _slavearg(slave), new_cmd,
'', org_cmd, *args)
(ret == new_cmd)? self: nil
end
@@ -3244,7 +2986,7 @@ class MultiTkIp
end
keys << _slavearg(slave)
if Tk::TCL_MAJOR_VERSION > 8 ||
- (Tk::TCL_MAJOR_VERSION == 8 && Tk::TCL_MINOR_VERSION >= 5)
+ (Tk::TCL_MAJOR_VERSION == 8 && Tk::TCL_MINOR_VERSION >= 5)
keys << '--'
end
keys << cmd
@@ -3265,7 +3007,7 @@ class MultiTkIp
keys << _slavearg(slave)
keys << '-global'
if Tk::TCL_MAJOR_VERSION > 8 ||
- (Tk::TCL_MAJOR_VERSION == 8 && Tk::TCL_MINOR_VERSION >= 5)
+ (Tk::TCL_MAJOR_VERSION == 8 && Tk::TCL_MINOR_VERSION >= 5)
keys << '--'
end
keys << cmd
@@ -3341,11 +3083,11 @@ class MultiTkIp
raise SecurityError, "no permission to manipulate" unless self.manipulable?
if slot
- num_or_str(@interp._invoke('interp', 'limit', _slavearg(slave),
+ 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),
+ l = @interp._split_tklist(@interp._invoke_without_enc('interp', 'limit',
+ _slavearg(slave),
limit_type))
l.map!{|s| _fromUTF8(s)}
r = {}
@@ -3364,7 +3106,7 @@ class MultiTkIp
def recursion_limit(slave = '', limit = None)
raise SecurityError, "no permission to manipulate" unless self.manipulable?
- number(@interp._invoke('interp', 'recursionlimit',
+ number(@interp._invoke('interp', 'recursionlimit',
_slavearg(slave), limit))
end
def self.recursion_limit(slave = '', limit = None)
@@ -3474,7 +3216,7 @@ class MultiTkIp
ip = MultiTkIp.__getip
ip._eval('::safe::interpConfigure ' + @ip_name + ' ' + _keys2opts(slot))
else
- ip._eval('::safe::interpConfigure ' + @ip_name + ' ' +
+ ip._eval('::safe::interpConfigure ' + @ip_name + ' ' +
"-#{slot} #{_get_eval_string(value)}")
end
self
@@ -3484,7 +3226,7 @@ class MultiTkIp
ip = MultiTkIp.__getip
ret = {}
if slot
- conf = _lst2ary(ip._eval("::safe::interpConfigure " +
+ conf = _lst2ary(ip._eval("::safe::interpConfigure " +
@ip_name + " -#{slot}"))
if conf[0] == '-deleteHook'
=begin
@@ -3500,7 +3242,7 @@ class MultiTkIp
ret[conf[0][1..-1]] = conf[1]
end
else
- Hash[*_lst2ary(ip._eval("::safe::interpConfigure " +
+ Hash[*_lst2ary(ip._eval("::safe::interpConfigure " +
@ip_name))].each{|k, v|
if k == '-deleteHook'
=begin
@@ -3547,42 +3289,6 @@ 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
@@ -3633,48 +3339,20 @@ 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 &&
+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
diff --git a/ext/tk/lib/remote-tk.rb b/ext/tk/lib/remote-tk.rb
index 0fa713359e..70115a60aa 100644
--- a/ext/tk/lib/remote-tk.rb
+++ b/ext/tk/lib/remote-tk.rb
@@ -10,8 +10,8 @@ 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)
+ @@IP_TABLE = {}.taint unless defined?(@@IP_TABLE)
+ @@TK_TABLE_LIST = [].taint unless defined?(@@TK_TABLE_LIST)
def self._IP_TABLE; @@IP_TABLE; end
def self._TK_TABLE_LIST; @@TK_TABLE_LIST; end
@@ -88,14 +88,10 @@ class RemoteTkIp
@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?
+ @tk_windows.taint unless @tk_windows.tainted?
+ @tk_table_list.taint unless @tk_table_list.tainted?
+ @slave_ip_tbl.taint unless @slave_ip_tbl.tainted?
+ @slave_ip_top.taint unless @slave_ip_top.tainted?
@system = Object.new
@@ -118,8 +114,8 @@ class RemoteTkIp
@@DEFAULT_MASTER.assign_receiver_and_watchdog(self)
@@IP_TABLE[@threadgroup] = self
- @@TK_TABLE_LIST.size.times{
- (tbl = {}).tainted? || TkUtil.untrust(tbl)
+ @@TK_TABLE_LIST.size.times{
+ (tbl = {}).tainted? || tbl.taint
@tk_table_list << tbl
}
@@ -158,13 +154,13 @@ class RemoteTkIp
return nil if timeout < 1
@ret_val.value = ''
- @interp._invoke('send', '-async', @remote,
- 'send', '-async', Tk.appname,
+ @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
+ sleep 0.2
Tk.update
break if @ret_val == 'ready'
}
@@ -208,10 +204,10 @@ class RemoteTkIp
cmds = @interp._merge_tklist(*TkUtil::_conv_args([], enc_mode, *cmds))
if @displayof
if async
- @interp.__invoke('send', '-async', '-displayof', @displayof,
+ @interp.__invoke('send', '-async', '-displayof', @displayof,
'--', @remote, *cmds)
else
- @interp.__invoke('send', '-displayof', @displayof,
+ @interp.__invoke('send', '-displayof', @displayof,
'--', @remote, *cmds)
end
else
@@ -233,7 +229,7 @@ class RemoteTkIp
def is_rubytk?
return false if _appsend(false, false, 'info', 'command', 'ruby') == ""
- [ _appsend(false, false, 'ruby', 'RUBY_VERSION'),
+ [ _appsend(false, false, 'ruby', 'RUBY_VERSION'),
_appsend(false, false, 'set', 'tk_patchLevel') ]
end
@@ -302,7 +298,7 @@ class RemoteTkIp
raise SecurityError, "no permission to manipulate" unless self.manipulable?
if @displayof
- lst = @interp._invoke_without_enc('winfo', 'interps',
+ lst = @interp._invoke_without_enc('winfo', 'interps',
'-displayof', @displayof)
else
lst = @interp._invoke_without_enc('winfo', 'interps')
diff --git a/ext/tk/lib/tcltk.rb b/ext/tk/lib/tcltk.rb
index 2df3b2fd8c..7f6f41605d 100644
--- a/ext/tk/lib/tcltk.rb
+++ b/ext/tk/lib/tcltk.rb
@@ -84,7 +84,7 @@ end
# class TclTkInterpreter: tcl/tk interpreter
class TclTkInterpreter
- # initialize():
+ # initialize():
def initialize()
# generate interpreter object
@ip = TclTkIp.new()
@@ -181,7 +181,7 @@ end
# class TclTkObject: base class of the tcl/tk objects
class TclTkObject
- # initialize(ip, exp):
+ # initialize(ip, exp):
# ip: interpreter(TclTkIp)
# exp: tcl/tk representation
def initialize(ip, exp)
@@ -211,7 +211,7 @@ end
# class TclTkLibCommand: tcl/tk commands in the library
class TclTkLibCommand < TclTkCommand
- # initialize(ip, name):
+ # initialize(ip, name):
# ip: interpreter(TclTkInterpreter)
# name: command name (String)
def initialize(ip, name)
@@ -222,7 +222,7 @@ end
# class TclTkVariable: tcl/tk variable
class TclTkVariable < TclTkObject
- # initialize(interp, dat):
+ # initialize(interp, dat):
# interp: interpreter(TclTkInterpreter)
# dat: the value to set(String)
# if nil, not initialize variable
@@ -237,7 +237,7 @@ class TclTkVariable < TclTkObject
set(dat) if dat
end
- # although you can set/read variables by using set in tcl/tk,
+ # although you can set/refer variable by using set in tcl/tk,
# we provide the method for accessing variables
# set(data): set tcl/tk variable using `set'
@@ -255,7 +255,7 @@ end
# class TclTkWidget: tcl/tk widget
class TclTkWidget < TclTkCommand
- # initialize(*args):
+ # initialize(*args):
# *args: parameters
def initialize(*args)
if args[0].kind_of?(TclTkIp)
@@ -281,7 +281,7 @@ class TclTkWidget < TclTkCommand
# interp: interpreter(TclTkInterpreter)
# parent: parent widget
# command: widget generating tk command(label )
- # *args: argument to the command
+ # *args: argument to the command
interp, parent, command, *args = args
# generate widget name
@@ -303,14 +303,14 @@ end
# class TclTkCallback: tcl/tk callbacks
class TclTkCallback < TclTkObject
- # initialize(interp, pr, arg):
+ # 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
+ # 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)
@@ -347,7 +347,7 @@ end
# class TclTkImage: tcl/tk images
class TclTkImage < TclTkCommand
- # initialize(interp, t, *args):
+ # initialize(interp, t, *args):
# generating image is done by TclTkImage.new()
# destrying is done by image delete (inconsistent, sigh)
# interp: interpreter(TclTkInterpreter)
diff --git a/ext/tk/lib/tk.rb b/ext/tk/lib/tk.rb
index f97c02dfad..c5d5b804d2 100644
--- a/ext/tk/lib/tk.rb
+++ b/ext/tk/lib/tk.rb
@@ -15,25 +15,12 @@ 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)
@@ -41,8 +28,8 @@ module TkComm
include TkUtil
extend TkUtil
- WidgetClassNames = TkUtil.untrust({})
- TkExtlibAutoloadModule = TkUtil.untrust([])
+ WidgetClassNames = {}.taint
+ TkExtlibAutoloadModule = [].taint
# None = Object.new ### --> definition is moved to TkUtil module
# def None.to_s
@@ -52,10 +39,7 @@ module TkComm
#Tk_CMDTBL = {}
#Tk_WINDOWS = {}
- Tk_IDs = [
- TkUtil.untrust("00000"), # [0]-cmdid
- TkUtil.untrust("00000") # [1]-winid
- ]
+ Tk_IDs = ["00000".taint, "00000".taint] # [0]-cmdid, [1]-winid
Tk_IDs.instance_eval{
@mutex = Mutex.new
def mutex; @mutex; end
@@ -75,13 +59,13 @@ module TkComm
Tk_WINDOWS.freeze
self.instance_eval{
- @cmdtbl = TkUtil.untrust([])
+ @cmdtbl = [].taint
}
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.
+ # val is a list which includes resource info.
GET_CONFIGINFO_AS_ARRAY = true
end
unless const_defined?(:GET_CONFIGINFOwoRES_AS_ARRAY)
@@ -118,22 +102,15 @@ module TkComm
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
+ 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
+ }
unless ruby_class
std_class = 'Tk' << tk_class
@@ -143,14 +120,6 @@ module TkComm
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
@@ -197,7 +166,7 @@ module TkComm
#{classname_def}
end"
end
- Object.class_eval "#{gen_class_name}.new('widgetname'=>'#{path}',
+ Object.class_eval "#{gen_class_name}.new('widgetname'=>'#{path}',
'without_creating'=>true)"
=end
base = Object
@@ -212,7 +181,7 @@ module TkComm
#{klass}"
end
}
- base.class_eval "#{gen_class_name}.new('widgetname'=>'#{path}',
+ base.class_eval "#{gen_class_name}.new('widgetname'=>'#{path}',
'without_creating'=>true)"
end
private :_genobj_for_tkwidget
@@ -253,7 +222,7 @@ module TkComm
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]?
TkCore::INTERP.tk_windows[val] : _genobj_for_tkwidget(val)
when /\Ai(_\d+_)?\d+\z/
TkImage::Tk_IMGTBL.mutex.synchronize{
@@ -458,7 +427,7 @@ else
def tk_split_list(str, depth=0, src_enc=true, dst_enc=true)
return [] if str == ""
- tk_split_escstr(str).collect{|token|
+ tk_split_escstr(str).collect{|token|
tk_split_sublist(token, depth - 1)
}
end
@@ -604,7 +573,7 @@ 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]?
TkCore::INTERP.tk_windows[val] : _genobj_for_tkwidget(val)
else
nil
@@ -633,38 +602,14 @@ end
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
+ private :bool, :number, :string, :num_or_str
+ private :list, :simplelist, :window, :procedure
+ module_function :bool, :number, :num_or_str, :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',
+ tk_call('subst',
*(opts.collect{|opt|
opt = opt.to_s
(opt[0] == ?-)? opt: '-' << opt
@@ -722,7 +667,7 @@ end
else
str = str.to_s() || ''
unless str.kind_of? String
- fail RuntimeError, "fail to convert the object to a string"
+ fail RuntimeError, "fail to convert the object to a string"
end
str = _toUTF8(str) if enc_mode
end
@@ -761,7 +706,7 @@ end
begin
obj = obj.to_s || ''
rescue
- fail RuntimeError, "fail to convert object '#{obj}' to string"
+ fail RuntimeError, "fail to convert object '#{obj}' to string"
end
(enc_mode)? _toUTF8(obj): obj
end
@@ -847,7 +792,7 @@ end
TkCore::INTERP.tk_cmd_tbl[id] = TkCore::INTERP.get_cb_entry(cmd)
end
@cmdtbl = [] unless defined? @cmdtbl
- TkUtil.untrust(@cmdtbl) unless @cmdtbl.tainted?
+ @cmdtbl.taint unless @cmdtbl.tainted?
@cmdtbl.push id
if local_cmdtbl && local_cmdtbl.kind_of?(Array)
@@ -980,7 +925,7 @@ module TkComm
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)}>",
+ tk_call_without_enc(*(what + ["<#{tk_event_sequence(context)}>",
mode + id]))
rescue
uninstall_cmd(id) if cmd
@@ -1039,7 +984,7 @@ module TkComm
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)}>",
+ tk_call_without_enc(*(what + ["<#{tk_event_sequence(context)}>",
mode + id]))
rescue
uninstall_cmd(id) if cmd
@@ -1065,8 +1010,8 @@ module TkComm
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,
+ 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)
@@ -1153,9 +1098,13 @@ 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
+ WITH_RUBY_VM = Object.const_defined?(:VM) && ::VM.class == Class
+ WITH_ENCODING = Object.const_defined?(:Encoding) && ::Encoding.class == Class
+
+ unless self.const_defined? :RUN_EVENTLOOP_ON_MAIN_THREAD
+ ### Ruby 1.9 !!!!!!!!!!!!!!!!!!!!!!!!!!
+ RUN_EVENTLOOP_ON_MAIN_THREAD = false
+ end
unless self.const_defined? :INTERP
if self.const_defined? :IP_NAME
@@ -1174,51 +1123,8 @@ module TkCore
opts = ''
end
- unless self.const_defined? :RUN_EVENTLOOP_ON_MAIN_THREAD
- if WITH_RUBY_VM ### check Ruby 1.9 !!!!!!!
- # *** NEED TO FIX ***
- ip = TclTkIp.new(name, opts)
- if RUBY_PLATFORM =~ /cygwin/
- RUN_EVENTLOOP_ON_MAIN_THREAD = true
- INTERP = ip
- elsif ip._invoke_without_enc('tk', 'windowingsystem') == '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
- # ----------------------------------------------------------
- #
- RUN_EVENTLOOP_ON_MAIN_THREAD = true
- INTERP = ip
- else
- unless self.const_defined? :RUN_EVENTLOOP_ON_MAIN_THREAD
- RUN_EVENTLOOP_ON_MAIN_THREAD = false
- end
- if RUN_EVENTLOOP_ON_MAIN_THREAD
- INTERP = ip
- else
- ip.delete
- end
- end
- ip = nil
-
- 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
+ INTERP = TclTkIp.new(name, opts)
else
INTERP_MUTEX = Mutex.new
INTERP_ROOT_CHECK = ConditionVariable.new
@@ -1229,42 +1135,17 @@ module TkCore
Thread.current[:interp] = e
raise e
end
-
- status = [nil]
- def status.value
- self[0]
- end
- def status.value=(val)
- self[0] = val
- end
-
- Thread.current[:status] = status
+ Thread.current[:status] = nil
#sleep
begin
- begin
- #TclTkLib.mainloop_abort_on_exception = false
- #Thread.current[:status].value = TclTkLib.mainloop(true)
- interp.mainloop_abort_on_exception = true
- Thread.current[:status].value = interp.mainloop(true)
- rescue SystemExit=>e
- Thread.current[:status].value = e
- rescue Exception=>e
- Thread.current[:status].value = e
- retry if interp.has_mainwindow?
- ensure
- INTERP_MUTEX.synchronize{ INTERP_ROOT_CHECK.broadcast }
- end
-
- #Thread.current[:status].value = TclTkLib.mainloop(false)
- Thread.current[:status].value = interp.mainloop(false)
-
+ Thread.current[:status] = TclTkLib.mainloop(true)
+ rescue Exception=>e
+ Thread.current[:status] = e
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
+ INTERP_MUTEX.synchronize{ INTERP_ROOT_CHECK.broadcast }
end
+ Thread.current[:status] = TclTkLib.mainloop(false)
}
until INTERP_THREAD[:interp]
@@ -1274,22 +1155,17 @@ module TkCore
raise INTERP_THREAD[:interp] if INTERP_THREAD[:interp].kind_of? Exception
INTERP = INTERP_THREAD[:interp]
- INTERP_THREAD_STATUS = INTERP_THREAD[:status]
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}'"
- })
+ # @tk_cmd_tbl = {}.taint
+ @tk_cmd_tbl = Hash.new{|hash, key|
+ fail IndexError, "unknown command ID '#{key}'"
+ }.taint
def @tk_cmd_tbl.[]=(idx,val)
if self.has_key?(idx) && Thread.current.group != ThreadGroup::Default
fail SecurityError,"cannot change the entried command"
@@ -1297,16 +1173,12 @@ module TkCore
super(idx,val)
end
- @tk_windows = TkUtil.untrust({})
-
- @tk_table_list = TkUtil.untrust([])
+ @tk_windows = {}.taint
- @init_ip_env = TkUtil.untrust([]) # table of Procs
- @add_tk_procs = TkUtil.untrust([]) # table of [name, args, body]
+ @tk_table_list = [].taint
- @force_default_encoding ||= TkUtil.untrust([false])
- @encoding ||= TkUtil.untrust([nil])
- def @encoding.to_s; self.join(nil); end
+ @init_ip_env = [].taint # table of Procs
+ @add_tk_procs = [].taint # table of [name, args, body]
@cb_entry_class = Class.new(TkCallbackEntry){
class << self
@@ -1359,7 +1231,7 @@ module TkCore
end
def INTERP.create_table
id = @tk_table_list.size
- (tbl = {}).tainted? || TkUtil.untrust(tbl)
+ (tbl = {}).tainted? || tbl.taint
@tk_table_list << tbl
# obj = Object.new
# obj.instance_eval <<-EOD
@@ -1394,11 +1266,10 @@ module TkCore
def INTERP.remove_tk_procs(*names)
names.each{|name|
name = name.to_s
- @add_tk_procs.delete_if{|elem|
+ @add_tk_procs.delete_if{|elem|
elem.kind_of?(Array) && elem[0].to_s == name
}
- #self._invoke('rename', name, '')
- self.__invoke__('rename', name, '')
+ self._invoke('rename', name, '')
}
end
def INTERP.init_ip_internal
@@ -1408,13 +1279,8 @@ module TkCore
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',
+ INTERP._invoke_without_enc('event', 'add',
"<#{WIDGET_DESTROY_HOOK}>", '<Destroy>')
INTERP._invoke_without_enc('bind', 'all', "<#{WIDGET_DESTROY_HOOK}>",
install_cmd(proc{|path|
@@ -1431,7 +1297,7 @@ module TkCore
end
}) << ' %W')
- INTERP.add_tk_procs(TclTkLib::FINALIZE_PROC_NAME, '',
+ INTERP.add_tk_procs(TclTkLib::FINALIZE_PROC_NAME, '',
"catch { bind all <#{WIDGET_DESTROY_HOOK}> {} }")
INTERP.add_tk_procs('rb_out', 'ns args', <<-'EOL')
@@ -1534,10 +1400,10 @@ module TkCore
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")) +
+ 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')
@@ -1545,9 +1411,9 @@ module TkCore
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") +
+ 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)
@@ -1560,15 +1426,15 @@ module TkCore
# 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],
+ #_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") +
+ 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
@@ -1586,7 +1452,7 @@ module TkCore
# cb_obj.call(*arg)
# rescue
# trace = $!.backtrace
-# raise $!, "\n#{trace[0]}: #{$!.message} (#{$!.class})\n" +
+# raise $!, "\n#{trace[0]}: #{$!.message} (#{$!.class})\n" +
# "\tfrom #{trace[1..pos].join("\n\tfrom ")}"
# end
# end
@@ -1776,36 +1642,17 @@ module TkCore
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
+ if !TkCore::WITH_RUBY_VM || TkCore::RUN_EVENTLOOP_ON_MAIN_THREAD
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
-
begin
TclTkLib.set_eventloop_window_mode(true)
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
+ status = INTERP_THREAD[:status]
+ if status
+ INTERP_THREAD[:status] = nil
raise status if status.kind_of?(Exception)
end
}
@@ -1890,11 +1737,11 @@ module TkCore
if context.kind_of?(TkEvent::Event)
context.generate(win, ((keys)? keys: {}))
elsif keys
- tk_call_without_enc('event', 'generate', win,
- "<#{tk_event_sequence(context)}>",
+ tk_call_without_enc('event', 'generate', win,
+ "<#{tk_event_sequence(context)}>",
*hash_kv(keys, true))
else
- tk_call_without_enc('event', 'generate', win,
+ tk_call_without_enc('event', 'generate', win,
"<#{tk_event_sequence(context)}>")
end
nil
@@ -1991,7 +1838,7 @@ module TkCore
puts 'invoke args => ' + args.inspect if $DEBUG
### print "=> ", args.join(" ").inspect, "\n" if $DEBUG
begin
- # res = TkUtil.untrust(INTERP._invoke(*args))
+ # res = INTERP._invoke(*args).taint
# res = INTERP._invoke(enc_mode, *args)
res = _ip_invoke_core(enc_mode, *args)
# >>>>> _invoke returns a TAINTED string <<<<<
@@ -1999,9 +1846,9 @@ module TkCore
# err = $!
begin
args.unshift "unknown"
- #res = TkUtil.untrust(INTERP._invoke(*args))
- #res = INTERP._invoke(enc_mode, *args)
- res = _ip_invoke_core(enc_mode, *args)
+ #res = INTERP._invoke(*args).taint
+ #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
@@ -2083,7 +1930,7 @@ module Tk
TK_MAJOR_VERSION = major.to_i
TK_MINOR_VERSION = minor.to_i
- JAPANIZED_TK = (INTERP._invoke_without_enc("info", "commands",
+ JAPANIZED_TK = (INTERP._invoke_without_enc("info", "commands",
"kanji") != "").freeze
def Tk.const_missing(sym)
@@ -2112,14 +1959,14 @@ module Tk
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',
+ 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 #<===
+ #when :AUTO_PATH #<===
# tk_split_simplelist(INTERP._invoke('set', 'auto_path'))
#when :AUTO_OLDPATH
@@ -2137,7 +1984,7 @@ module Tk
var_nam = 'tkPriv'
end
INTERP._invoke_without_enc('global', var_nam)
- Hash[*tk_split_simplelist(INTERP._invoke('array', 'get',
+ Hash[*tk_split_simplelist(INTERP._invoke('array', 'get',
var_nam))].each{|k,v|
k.freeze
case v
@@ -2293,7 +2140,7 @@ module Tk
end
def Tk.exit
- TkCore::INTERP.has_mainwindow? && tk_call_without_enc('destroy', '.')
+ tk_call_without_enc('destroy', '.')
end
################################################
@@ -2364,9 +2211,9 @@ module Tk
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.
+ # 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')
@@ -2438,7 +2285,7 @@ module Tk
def Tk.add_kinsoku(chars, mode='both')
begin
if /^8\.*/ === TK_VERSION && JAPANIZED_TK
- tk_split_simplelist(tk_call('kinsoku', 'add', mode,
+ tk_split_simplelist(tk_call('kinsoku', 'add', mode,
*(chars.split(''))))
else
[]
@@ -2450,7 +2297,7 @@ module Tk
def Tk.delete_kinsoku(chars, mode='both')
begin
if /^8\.*/ === TK_VERSION && JAPANIZED_TK
- tk_split_simplelist(tk_call('kinsoku', 'delete', mode,
+ tk_split_simplelist(tk_call('kinsoku', 'delete', mode,
*(chars.split(''))))
end
rescue
@@ -2460,7 +2307,7 @@ module Tk
def Tk.toUTF8(str, encoding = nil)
_toUTF8(str, encoding)
end
-
+
def Tk.fromUTF8(str, encoding = nil)
_fromUTF8(str, encoding)
end
@@ -2508,7 +2355,6 @@ if (/^(8\.[1-9]|9\.|[1-9][0-9])/ =~ Tk::TCL_VERSION && !Tk::JAPANIZED_TK)
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')
@@ -2517,11 +2363,11 @@ if (/^(8\.[1-9]|9\.|[1-9][0-9])/ =~ Tk::TCL_VERSION && !Tk::JAPANIZED_TK)
ENCODING_TABLE = TkCore::INTERP.encoding_table
=begin
ENCODING_TABLE = {
- 'binary' => BINARY,
- # 'UNKNOWN-8BIT' => UNKNOWN,
+ 'binary' => BINARY,
+ # 'UNKNOWN-8BIT' => UNKNOWN,
}
- list = TkCore::INTERP._invoke_without_enc(ENCNAMES_CMD[0],
+ list = TkCore::INTERP._invoke_without_enc(ENCNAMES_CMD[0],
ENCNAMES_CMD[1])
TkCore::INTERP._split_tklist(list).each{|name|
begin
@@ -2569,7 +2415,7 @@ if (/^(8\.[1-9]|9\.|[1-9][0-9])/ =~ Tk::TCL_VERSION && !Tk::JAPANIZED_TK)
end
# Is it new ?
- list = TkCore::INTERP._invoke_without_enc(ENCNAMES_CMD[0],
+ list = TkCore::INTERP._invoke_without_enc(ENCNAMES_CMD[0],
ENCNAMES_CMD[1])
TkComm.simplelist(list).each{|name|
if ((enc == RubyEncoding.find(name)) rescue false)
@@ -2586,7 +2432,7 @@ if (/^(8\.[1-9]|9\.|[1-9][0-9])/ =~ Tk::TCL_VERSION && !Tk::JAPANIZED_TK)
# Is it new ?
if (enc_obj = (RubyEncoding.find(name) rescue false))
- list = TkCore::INTERP._invoke_without_enc(ENCNAMES_CMD[0],
+ list = TkCore::INTERP._invoke_without_enc(ENCNAMES_CMD[0],
ENCNAMES_CMD[1])
if TkComm.simplelist(list).index(name)
# Tk's encoding name ?
@@ -2646,9 +2492,8 @@ if (/^(8\.[1-9]|9\.|[1-9][0-9])/ =~ Tk::TCL_VERSION && !Tk::JAPANIZED_TK)
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
+ TkComm.simplelist(TkCore::INTERP._invoke_without_enc(Tk::Encoding::ENCNAMES_CMD[0], Tk::Encoding::ENCNAMES_CMD[1]))
+ end
def encoding_names
self.tk_encoding_names.find_all{|name|
Tk::Encoding::ENCODING_TABLE.get_name(name) rescue false
@@ -2740,7 +2585,7 @@ if (/^(8\.[1-9]|9\.|[1-9][0-9])/ =~ Tk::TCL_VERSION && !Tk::JAPANIZED_TK)
else
str.instance_variable_set('@encoding', 'binary')
end
- ret = TkCore::INTERP._invoke_without_enc('encoding', 'convertfrom',
+ ret = TkCore::INTERP._invoke_without_enc('encoding', 'convertfrom',
enc, str)
if TkCore::WITH_ENCODING
ret.force_encoding('utf-8')
@@ -2754,7 +2599,7 @@ if (/^(8\.[1-9]|9\.|[1-9][0-9])/ =~ Tk::TCL_VERSION && !Tk::JAPANIZED_TK)
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',
+ ret = TkCore::INTERP._invoke_without_enc('encoding', 'convertto',
enc, str)
#ret.instance_variable_set('@encoding', 'binary')
if TkCore::WITH_ENCODING
@@ -2781,16 +2626,16 @@ if (/^(8\.[1-9]|9\.|[1-9][0-9])/ =~ Tk::TCL_VERSION && !Tk::JAPANIZED_TK)
class TclTkIp
def force_default_encoding=(mode)
- @force_default_encoding[0] = (mode)? true: false
+ @force_default_encoding = (mode)? true: false
end
def force_default_encoding?
- @force_default_encoding[0] ||= false
+ @force_default_encoding ||= false
end
def default_encoding=(name)
- name = name.name if Tk::WITH_ENCODING && name.kind_of?(::Encoding)
- @encoding[0] = name.to_s.dup
+ name = name.name if name.kind_of?(::Encoding) if Tk::WITH_ENCODING
+ @encoding = name
end
# from tkencoding.rb by ttate@jaist.ac.jp
@@ -2801,16 +2646,16 @@ if (/^(8\.[1-9]|9\.|[1-9][0-9])/ =~ Tk::TCL_VERSION && !Tk::JAPANIZED_TK)
end
def encoding_name
- (@encoding[0])? @encoding[0].dup: nil
+ (@encoding)? @encoding.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])
+ Tk::Encoding.tcl2rb_encoding(@encoding)
else
- (@encoding[0])? @encoding[0].dup: nil
+ (@encoding)? @encoding.dup: nil
end
end
@@ -2838,15 +2683,10 @@ if (/^(8\.[1-9]|9\.|[1-9][0-9])/ =~ Tk::TCL_VERSION && !Tk::JAPANIZED_TK)
enc_name ||= str.instance_variable_get(:@encoding)
- enc_name ||=
+ 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
+ unless enc_name
# str.encoding isn't supported by Tk -> try to convert on Ruby
begin
return str.encode(Tk::Encoding::UTF8_NAME) # new string
@@ -2855,7 +2695,7 @@ if (/^(8\.[1-9]|9\.|[1-9][0-9])/ =~ Tk::TCL_VERSION && !Tk::JAPANIZED_TK)
end
end
- #enc_name ||=
+ #enc_name ||=
# Tk::Encoding::ENCODING_TABLE.get_name(Tk.encoding) rescue nil
enc_name ||= Tk::Encoding::ENCODING_TABLE.get_name(nil)
@@ -2876,7 +2716,7 @@ if (/^(8\.[1-9]|9\.|[1-9][0-9])/ =~ Tk::TCL_VERSION && !Tk::JAPANIZED_TK)
def _fromUTF8(str, enc = nil)
# str must be UTF-8 or binary.
enc_name = str.instance_variable_get(:@encoding)
- enc_name ||=
+ enc_name ||=
Tk::Encoding::ENCODING_TABLE.get_name(str.encoding) rescue nil
# is 'binary' encoding?
@@ -3066,7 +2906,7 @@ if (/^(8\.[1-9]|9\.|[1-9][0-9])/ =~ Tk::TCL_VERSION && !Tk::JAPANIZED_TK)
end
# estimate encoding
- unless TkCore::WITH_ENCODING
+ unless TkCore::WITH_ENCODING
case $KCODE
when /^e/i # EUC
Tk.encoding = 'euc-jp'
@@ -3099,16 +2939,14 @@ if (/^(8\.[1-9]|9\.|[1-9][0-9])/ =~ Tk::TCL_VERSION && !Tk::JAPANIZED_TK)
end
else ### Ruby 1.9 !!!!!!!!!!!!
- # loc_enc_obj = (::Encoding.find(::Encoding.locale_charmap) rescue Tk::Encoding::UNKNOWN)
- loc_enc_obj = ::Encoding.find("locale")
+ loc_enc_obj = ::Encoding.find(::Encoding.locale_charmap)
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 defind? DEFAULT_TK_ENCODING
if DEFAULT_TK_ENCODING.kind_of?(::Encoding)
tk_enc_name = DEFAULT_TK_ENCODING.name
tksys_enc_name = DEFAULT_TK_ENCODING.name
@@ -3174,13 +3012,12 @@ if (/^(8\.[1-9]|9\.|[1-9][0-9])/ =~ Tk::TCL_VERSION && !Tk::JAPANIZED_TK)
enc_name = nil
rescue ArgumentError
enc_name = nil
- fail ArgumentError,
+ 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 ext_enc_obj == Tk::Encoding::UNKNOWN
if loc_enc_obj == Tk::Encoding::UNKNOWN
# use Tk.encoding_system
enc_name = tksys_enc_name
@@ -3188,7 +3025,7 @@ if (/^(8\.[1-9]|9\.|[1-9][0-9])/ =~ Tk::TCL_VERSION && !Tk::JAPANIZED_TK)
# use locale_charmap
begin
loc_enc_name = Tk::Encoding::ENCODING_TABLE.get_name(loc_enc_obj)
- if loc_enc_name
+ if loc_enc_name && loc_enc_name != tksys_enc_name
# use locale_charmap
enc_name = loc_enc_name
else
@@ -3202,12 +3039,10 @@ if (/^(8\.[1-9]|9\.|[1-9][0-9])/ =~ Tk::TCL_VERSION && !Tk::JAPANIZED_TK)
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
+ 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
+ enc_name = ext_enc_name
else
# use Tk.encoding_system
enc_name = tksys_enc_name
@@ -3351,19 +3186,19 @@ module TkTreatFont
if key
pathname = [win, tag, key].join(';')
- TkFont.used_on(pathname) ||
+ 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.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) ||
+ optkeys.each{|key|
+ key = key.to_s
+ pathname = [win, tag, key].join(';')
+ fonts[key] =
+ TkFont.used_on(pathname) ||
TkFont.init_widget_font(pathname, *__confinfo_cmd)
}
fonts
@@ -3393,8 +3228,8 @@ module TkTreatFont
next
else
if fnt
- if (slot.key?(l_optkey) ||
- slot.key?(a_optkey) ||
+ if (slot.key?(l_optkey) ||
+ slot.key?(a_optkey) ||
slot.key?(k_optkey))
fnt = TkFont.new(fnt)
@@ -3405,7 +3240,7 @@ module TkTreatFont
fnt.latin_replace(lfnt) if lfnt
fnt.kanji_replace(kfnt) if kfnt
- fnt.call_font_configure([pathname, optkey],
+ fnt.call_font_configure([pathname, optkey],
*(__config_cmd << {}))
next
else
@@ -3430,7 +3265,7 @@ module TkTreatFont
kfnt = slot.delete(k_optkey)
if lfnt && kfnt
- TkFont.new(lfnt, kfnt).call_font_configure([pathname, optkey],
+ TkFont.new(lfnt, kfnt).call_font_configure([pathname, optkey],
*(__config_cmd << {}))
elsif lfnt
latinfont_configure([lfnt, optkey])
@@ -3487,7 +3322,7 @@ module TkTreatFont
if fobj.kind_of?(TkFont)
if ltn.kind_of?(TkFont)
conf = {}
- ltn.latin_configinfo.each{|k,val| conf[k] = val}
+ ltn.latin_configinfo.each{|key,val| conf[key] = val}
if keys
fobj.latin_configure(conf.update(keys))
else
@@ -3547,7 +3382,7 @@ module TkTreatFont
if fobj.kind_of?(TkFont)
if knj.kind_of?(TkFont)
conf = {}
- knj.kanji_configinfo.each{|k,val| conf[k] = val}
+ knj.kanji_configinfo.each{|key,val| conf[key] = val}
if keys
fobj.kanji_configure(conf.update(keys))
else
@@ -3588,7 +3423,7 @@ module TkTreatFont
def latinfont_copy(win, wintag=nil, winkey=nil, targetkey=nil)
if targetkey
- fontobj(targetkey).dup.call_font_configure([__pathname, targetkey],
+ fontobj(targetkey).dup.call_font_configure([__pathname, targetkey],
*(__config_cmd << {}))
else
fontobj.dup.call_font_configure(__pathname, *(__config_cmd << {}))
@@ -3613,7 +3448,7 @@ module TkTreatFont
def kanjifont_copy(win, wintag=nil, winkey=nil, targetkey=nil)
if targetkey
- fontobj(targetkey).dup.call_font_configure([__pathname, targetkey],
+ fontobj(targetkey).dup.call_font_configure([__pathname, targetkey],
*(__config_cmd << {}))
else
fontobj.dup.call_font_configure(__pathname, *(__config_cmd << {}))
@@ -3665,7 +3500,7 @@ module TkConfigMethod
private :__confinfo_cmd
def __configinfo_struct
- {:key=>0, :alias=>1, :db_name=>1, :db_class=>2,
+ {:key=>0, :alias=>1, :db_name=>1, :db_class=>2,
:default_value=>3, :current_value=>4}
end
private :__configinfo_struct
@@ -3692,10 +3527,10 @@ module TkConfigMethod
def __strval_optkeys
[
- 'text', 'label', 'show', 'data', 'file',
- 'activebackground', 'activeforeground', 'background',
- 'disabledforeground', 'disabledbackground', 'foreground',
- 'highlightbackground', 'highlightcolor', 'insertbackground',
+ 'text', 'label', 'show', 'data', 'file',
+ 'activebackground', 'activeforeground', 'background',
+ 'disabledforeground', 'disabledbackground', 'foreground',
+ 'highlightbackground', 'highlightcolor', 'insertbackground',
'selectbackground', 'selectforeground', 'troughcolor'
]
end
@@ -3781,17 +3616,11 @@ module TkConfigMethod
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
+
+ if slot.length == 0
fail ArgumentError, "Invalid option `#{orig_slot.inspect}'"
end
@@ -4017,12 +3846,12 @@ module TkConfigMethod
def __configinfo_core(slot = nil)
if TkComm::GET_CONFIGINFO_AS_ARRAY
- if (slot &&
+ 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]] =
conf[__configinfo_struct[:key]][1..-1]
if ( ! __configinfo_struct[:alias] \
|| conf.size > __configinfo_struct[:alias] + 1 )
@@ -4034,7 +3863,7 @@ module TkConfigMethod
elsif ( __configinfo_struct[:alias] \
&& conf.size == __configinfo_struct[:alias] + 1 \
&& conf[__configinfo_struct[:alias]][0] == ?- )
- conf[__configinfo_struct[:alias]] =
+ conf[__configinfo_struct[:alias]] =
conf[__configinfo_struct[:alias]][1..-1]
end
conf
@@ -4084,7 +3913,7 @@ module TkConfigMethod
if ( __configinfo_struct[:default_value] \
&& conf[__configinfo_struct[:default_value]])
begin
- conf[__configinfo_struct[:default_value]] =
+ conf[__configinfo_struct[:default_value]] =
number(conf[__configinfo_struct[:default_value]])
rescue
conf[__configinfo_struct[:default_value]] = nil
@@ -4092,7 +3921,7 @@ module TkConfigMethod
end
if ( conf[__configinfo_struct[:current_value]] )
begin
- conf[__configinfo_struct[:current_value]] =
+ conf[__configinfo_struct[:current_value]] =
number(conf[__configinfo_struct[:current_value]])
rescue
conf[__configinfo_struct[:current_value]] = nil
@@ -4105,11 +3934,11 @@ module TkConfigMethod
if ( __configinfo_struct[:default_value] \
&& conf[__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]] =
+ conf[__configinfo_struct[:current_value]] =
num_or_str(conf[__configinfo_struct[:current_value]])
end
@@ -4120,7 +3949,7 @@ module TkConfigMethod
if ( __configinfo_struct[:default_value] \
&& conf[__configinfo_struct[:default_value]])
begin
- conf[__configinfo_struct[:default_value]] =
+ conf[__configinfo_struct[:default_value]] =
bool(conf[__configinfo_struct[:default_value]])
rescue
conf[__configinfo_struct[:default_value]] = nil
@@ -4128,7 +3957,7 @@ module TkConfigMethod
end
if ( conf[__configinfo_struct[:current_value]] )
begin
- conf[__configinfo_struct[:current_value]] =
+ conf[__configinfo_struct[:current_value]] =
bool(conf[__configinfo_struct[:current_value]])
rescue
conf[__configinfo_struct[:current_value]] = nil
@@ -4141,11 +3970,11 @@ module TkConfigMethod
if ( __configinfo_struct[:default_value] \
&& conf[__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]] =
+ conf[__configinfo_struct[:current_value]] =
simplelist(conf[__configinfo_struct[:current_value]])
end
@@ -4156,12 +3985,12 @@ module TkConfigMethod
if ( __configinfo_struct[:default_value] \
&& conf[__configinfo_struct[:default_value]] \
&& conf[__configinfo_struct[:default_value]] =~ /^[0-9]/ )
- conf[__configinfo_struct[:default_value]] =
+ 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]] =
+ conf[__configinfo_struct[:current_value]] =
list(conf[__configinfo_struct[:current_value]])
end
@@ -4192,16 +4021,15 @@ module TkConfigMethod
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)
+ conf = tk_split_list(tk_call_without_enc(*(__confinfo_cmd << "-#{slot}")), 0, false, true)
end
- conf[__configinfo_struct[:key]] =
+ 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]] =
conf[__configinfo_struct[:alias]][1..-1]
end
@@ -4212,7 +4040,7 @@ module TkConfigMethod
# 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]] =
conf[__configinfo_struct[:key]][1..-1]
optkey = conf[__configinfo_struct[:key]]
@@ -4248,7 +4076,7 @@ module TkConfigMethod
if ( __configinfo_struct[:default_value] \
&& conf[__configinfo_struct[:default_value]] )
begin
- conf[__configinfo_struct[:default_value]] =
+ conf[__configinfo_struct[:default_value]] =
number(conf[__configinfo_struct[:default_value]])
rescue
conf[__configinfo_struct[:default_value]] = nil
@@ -4256,7 +4084,7 @@ module TkConfigMethod
end
if ( conf[__configinfo_struct[:current_value]] )
begin
- conf[__configinfo_struct[:current_value]] =
+ conf[__configinfo_struct[:current_value]] =
number(conf[__configinfo_struct[:current_value]])
rescue
conf[__configinfo_struct[:current_value]] = nil
@@ -4266,11 +4094,11 @@ module TkConfigMethod
when /^(#{__numstrval_optkeys.join('|')})$/
if ( __configinfo_struct[:default_value] \
&& conf[__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]] =
+ conf[__configinfo_struct[:current_value]] =
num_or_str(conf[__configinfo_struct[:current_value]])
end
@@ -4278,7 +4106,7 @@ module TkConfigMethod
if ( __configinfo_struct[:default_value] \
&& conf[__configinfo_struct[:default_value]] )
begin
- conf[__configinfo_struct[:default_value]] =
+ conf[__configinfo_struct[:default_value]] =
bool(conf[__configinfo_struct[:default_value]])
rescue
conf[__configinfo_struct[:default_value]] = nil
@@ -4286,7 +4114,7 @@ module TkConfigMethod
end
if ( conf[__configinfo_struct[:current_value]] )
begin
- conf[__configinfo_struct[:current_value]] =
+ conf[__configinfo_struct[:current_value]] =
bool(conf[__configinfo_struct[:current_value]])
rescue
conf[__configinfo_struct[:current_value]] = nil
@@ -4296,11 +4124,11 @@ module TkConfigMethod
when /^(#{__listval_optkeys.join('|')})$/
if ( __configinfo_struct[:default_value] \
&& conf[__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]] =
+ conf[__configinfo_struct[:current_value]] =
simplelist(conf[__configinfo_struct[:current_value]])
end
@@ -4308,12 +4136,12 @@ module TkConfigMethod
if ( __configinfo_struct[:default_value] \
&& conf[__configinfo_struct[:default_value]] \
&& conf[__configinfo_struct[:default_value]] =~ /^[0-9]/ )
- conf[__configinfo_struct[:default_value]] =
+ 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]] =
+ conf[__configinfo_struct[:current_value]] =
list(conf[__configinfo_struct[:current_value]])
end
@@ -4340,20 +4168,20 @@ module TkConfigMethod
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]])
+ 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]])
+ 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]])
+ 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]])
+ conf[__configinfo_struct[:current_value]] =
+ tk_tcl2ruby(conf[__configinfo_struct[:current_value]])
end
end
end
@@ -4361,7 +4189,7 @@ module TkConfigMethod
if ( __configinfo_struct[:alias] \
&& conf.size == __configinfo_struct[:alias] + 1 \
&& conf[__configinfo_struct[:alias]][0] == ?- )
- conf[__configinfo_struct[:alias]] =
+ conf[__configinfo_struct[:alias]] =
conf[__configinfo_struct[:alias]][1..-1]
end
@@ -4383,8 +4211,8 @@ module TkConfigMethod
end
}
- __methodcall_optkeys.each{|optkey, m|
- ret << [optkey.to_s, '', '', '', self.__send__(m)]
+ __methodcall_optkeys.each{|optkey, method|
+ ret << [optkey.to_s, '', '', '', self.__send__(method)]
}
ret
@@ -4392,12 +4220,12 @@ module TkConfigMethod
end
else # ! TkComm::GET_CONFIGINFO_AS_ARRAY
- if (slot &&
+ 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]] =
conf[__configinfo_struct[:key]][1..-1]
if ( ! __configinfo_struct[:alias] \
@@ -4411,7 +4239,7 @@ module TkConfigMethod
elsif ( __configinfo_struct[:alias] \
&& conf.size == __configinfo_struct[:alias] + 1 )
if conf[__configinfo_struct[:alias]][0] == ?-
- conf[__configinfo_struct[:alias]] =
+ conf[__configinfo_struct[:alias]] =
conf[__configinfo_struct[:alias]][1..-1]
end
{ conf[0] => conf[1] }
@@ -4422,7 +4250,7 @@ module TkConfigMethod
if slot
slot = slot.to_s
- alias_name, real_name = __optkey_aliases.find{|k,var| k.to_s == slot}
+ alias_name, real_name = __optkey_aliases.find{|k, v| k.to_s == slot}
if real_name
slot = real_name.to_s
end
@@ -4464,7 +4292,7 @@ module TkConfigMethod
if ( __configinfo_struct[:default_value] \
&& conf[__configinfo_struct[:default_value]] )
begin
- conf[__configinfo_struct[:default_value]] =
+ conf[__configinfo_struct[:default_value]] =
number(conf[__configinfo_struct[:default_value]])
rescue
conf[__configinfo_struct[:default_value]] = nil
@@ -4472,7 +4300,7 @@ module TkConfigMethod
end
if ( conf[__configinfo_struct[:current_value]] )
begin
- conf[__configinfo_struct[:current_value]] =
+ conf[__configinfo_struct[:current_value]] =
number(conf[__configinfo_struct[:current_value]])
rescue
conf[__configinfo_struct[:current_value]] = nil
@@ -4485,11 +4313,11 @@ module TkConfigMethod
if ( __configinfo_struct[:default_value] \
&& conf[__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]] =
+ conf[__configinfo_struct[:current_value]] =
num_or_str(conf[__configinfo_struct[:current_value]])
end
@@ -4500,7 +4328,7 @@ module TkConfigMethod
if ( __configinfo_struct[:default_value] \
&& conf[__configinfo_struct[:default_value]] )
begin
- conf[__configinfo_struct[:default_value]] =
+ conf[__configinfo_struct[:default_value]] =
bool(conf[__configinfo_struct[:default_value]])
rescue
conf[__configinfo_struct[:default_value]] = nil
@@ -4508,7 +4336,7 @@ module TkConfigMethod
end
if ( conf[__configinfo_struct[:current_value]] )
begin
- conf[__configinfo_struct[:current_value]] =
+ conf[__configinfo_struct[:current_value]] =
bool(conf[__configinfo_struct[:current_value]])
rescue
conf[__configinfo_struct[:current_value]] = nil
@@ -4521,11 +4349,11 @@ module TkConfigMethod
if ( __configinfo_struct[:default_value] \
&& conf[__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]] =
+ conf[__configinfo_struct[:current_value]] =
simplelist(conf[__configinfo_struct[:current_value]])
end
@@ -4536,12 +4364,12 @@ module TkConfigMethod
if ( __configinfo_struct[:default_value] \
&& conf[__configinfo_struct[:default_value]] \
&& conf[__configinfo_struct[:default_value]] =~ /^[0-9]/ )
- conf[__configinfo_struct[:default_value]] =
+ 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]] =
+ conf[__configinfo_struct[:current_value]] =
list(conf[__configinfo_struct[:current_value]])
end
@@ -4573,13 +4401,13 @@ module TkConfigMethod
# 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]] =
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]] =
conf[__configinfo_struct[:alias]][1..-1]
end
{ conf[0] => conf[1] }
@@ -4593,7 +4421,7 @@ module TkConfigMethod
# 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]] =
conf[__configinfo_struct[:key]][1..-1]
optkey = conf[__configinfo_struct[:key]]
@@ -4629,7 +4457,7 @@ module TkConfigMethod
if ( __configinfo_struct[:default_value] \
&& conf[__configinfo_struct[:default_value]] )
begin
- conf[__configinfo_struct[:default_value]] =
+ conf[__configinfo_struct[:default_value]] =
number(conf[__configinfo_struct[:default_value]])
rescue
conf[__configinfo_struct[:default_value]] = nil
@@ -4637,7 +4465,7 @@ module TkConfigMethod
end
if ( conf[__configinfo_struct[:current_value]] )
begin
- conf[__configinfo_struct[:current_value]] =
+ conf[__configinfo_struct[:current_value]] =
number(conf[__configinfo_struct[:current_value]])
rescue
conf[__configinfo_struct[:current_value]] = nil
@@ -4647,11 +4475,11 @@ module TkConfigMethod
when /^(#{__numstrval_optkeys.join('|')})$/
if ( __configinfo_struct[:default_value] \
&& conf[__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]] =
+ conf[__configinfo_struct[:current_value]] =
num_or_str(conf[__configinfo_struct[:current_value]])
end
@@ -4659,7 +4487,7 @@ module TkConfigMethod
if ( __configinfo_struct[:default_value] \
&& conf[__configinfo_struct[:default_value]] )
begin
- conf[__configinfo_struct[:default_value]] =
+ conf[__configinfo_struct[:default_value]] =
bool(conf[__configinfo_struct[:default_value]])
rescue
conf[__configinfo_struct[:default_value]] = nil
@@ -4667,7 +4495,7 @@ module TkConfigMethod
end
if ( conf[__configinfo_struct[:current_value]] )
begin
- conf[__configinfo_struct[:current_value]] =
+ conf[__configinfo_struct[:current_value]] =
bool(conf[__configinfo_struct[:current_value]])
rescue
conf[__configinfo_struct[:current_value]] = nil
@@ -4677,11 +4505,11 @@ module TkConfigMethod
when /^(#{__listval_optkeys.join('|')})$/
if ( __configinfo_struct[:default_value] \
&& conf[__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]] =
+ conf[__configinfo_struct[:current_value]] =
simplelist(conf[__configinfo_struct[:current_value]])
end
@@ -4689,12 +4517,12 @@ module TkConfigMethod
if ( __configinfo_struct[:default_value] \
&& conf[__configinfo_struct[:default_value]] \
&& conf[__configinfo_struct[:default_value]] =~ /^[0-9]/ )
- conf[__configinfo_struct[:default_value]] =
+ 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]] =
+ conf[__configinfo_struct[:current_value]] =
list(conf[__configinfo_struct[:current_value]])
end
@@ -4721,20 +4549,20 @@ module TkConfigMethod
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]])
+ 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]])
+ 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]])
+ 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]])
+ conf[__configinfo_struct[:current_value]] =
+ tk_tcl2ruby(conf[__configinfo_struct[:current_value]])
end
end
end
@@ -4742,7 +4570,7 @@ module TkConfigMethod
if ( __configinfo_struct[:alias] \
&& conf.size == __configinfo_struct[:alias] + 1 )
if conf[__configinfo_struct[:alias]][0] == ?-
- conf[__configinfo_struct[:alias]] =
+ conf[__configinfo_struct[:alias]] =
conf[__configinfo_struct[:alias]][1..-1]
end
ret[conf[0]] = conf[1]
@@ -4769,8 +4597,8 @@ module TkConfigMethod
end
}
- __methodcall_optkeys.each{|optkey, m|
- ret[optkey.to_s] = ['', '', '', self.__send__(m)]
+ __methodcall_optkeys.each{|optkey, method|
+ ret[optkey.to_s] = ['', '', '', self.__send__(method)]
}
ret
@@ -4804,22 +4632,22 @@ module TkConfigMethod
end
slot = conf[__configinfo_struct[:alias]]
end while(org_slot != slot)
- fail RuntimeError,
+ fail RuntimeError,
"there is a configure alias loop about '#{org_slot}'"
else
ret = {}
- configinfo().each{|cnf|
+ configinfo().each{|conf|
if ( ! __configinfo_struct[:alias] \
- || cnf.size > __configinfo_struct[:alias] + 1 )
- ret[cnf[0]] = cnf[-1]
+ || conf.size > __configinfo_struct[:alias] + 1 )
+ ret[conf[0]] = conf[-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)
+ configinfo(slot).each{|key, conf|
+ ret[key] = conf[-1] if conf.kind_of?(Array)
}
ret
end
@@ -4891,13 +4719,13 @@ class TkObject<TkKernel
cget(name)
rescue
if self.kind_of?(TkWindow)
- fail NameError,
+ 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}",
+# fail NameError,
+# "undefined local variable or method `#{name}' for #{self.to_s}",
# error_at
end
else
@@ -4921,14 +4749,14 @@ class TkObject<TkKernel
if context.kind_of?(TkEvent::Event)
context.generate(self, ((keys)? keys: {}))
elsif keys
- #tk_call('event', 'generate', path,
+ #tk_call('event', 'generate', path,
# "<#{tk_event_sequence(context)}>", *hash_kv(keys))
- tk_call_without_enc('event', 'generate', path,
- "<#{tk_event_sequence(context)}>",
+ 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_call_without_enc('event', 'generate', path,
"<#{tk_event_sequence(context)}>")
end
end
@@ -4951,7 +4779,6 @@ class TkWindow<TkObject
include TkWinfo
extend TkBindCore
include Tk::Wm_for_General
- include Tk::Busy
@@WIDGET_INSPECT_FULL = false
def TkWindow._widget_inspect_full_?
@@ -4962,10 +4789,10 @@ class TkWindow<TkObject
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.
+ ## ==> 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
+ # WidgetClassNames[WidgetClassName] = self
## ==> If self is a widget class, entry to the WidgetClassNames table.
def self.to_eval
self::WidgetClassName
@@ -4978,8 +4805,8 @@ class TkWindow<TkObject
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 without_creating && !widgetname
+ # fail ArgumentError,
# "if set 'without_creating' to true, need to define 'widgetname'"
# end
elsif keys
@@ -4987,8 +4814,8 @@ class TkWindow<TkObject
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 without_creating && !widgetname
+ # fail ArgumentError,
# "if set 'without_creating' to true, need to define 'widgetname'"
# end
else
@@ -5080,7 +4907,7 @@ class TkWindow<TkObject
tk_call_without_enc('destroy', @path)
rescue
# cannot rescue options error
- fail e
+ fail e
else
# re-create widget
tk_call_without_enc(cmd, @path, *hash_kv(keys, true))
@@ -5265,12 +5092,14 @@ class TkWindow<TkObject
TkGrid.columnconfigure(self, index, keys)
end
alias grid_columnconfigure grid_columnconfig
+ alias grid_column 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
+ alias grid_row grid_rowconfig
def grid_columnconfiginfo(index, slot=nil)
#if slot
@@ -5300,22 +5129,6 @@ class TkWindow<TkObject
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)
@@ -5352,9 +5165,9 @@ class TkWindow<TkObject
TkGrid.size(self)
end
- def grid_slaves(keys = nil)
+ def grid_slaves(args)
#list(tk_call('grid', 'slaves', epath, *hash_kv(args)))
- TkGrid.slaves(self, keys)
+ TkGrid.slaves(self, args)
end
def place(keys)
@@ -5399,7 +5212,7 @@ class TkWindow<TkObject
# conf[0] = conf[0][1..-1]
# conf
#else
- # tk_split_simplelist(tk_call('place',
+ # tk_split_simplelist(tk_call('place',
# 'configure', epath)).collect{|conflist|
# conf = tk_split_simplelist(conflist)
# conf[0] = conf[0][1..-1]
@@ -5609,7 +5422,7 @@ class TkWindow<TkObject
taglist
else
list(tk_call('bindtags', path)).collect{|tag|
- if tag.kind_of?(String)
+ if tag.kind_of?(String)
if cls = WidgetClassNames[tag]
cls
elsif btag = TkBindTag.id2obj(tag)
@@ -5653,7 +5466,7 @@ TkWidget = TkWindow
#Tk.freeze
module Tk
- RELEASE_DATE = '2009-07-18'.freeze
+ RELEASE_DATE = '2008-05-23'.freeze
autoload :AUTO_PATH, 'tk/variable'
autoload :TCL_PACKAGE_PATH, 'tk/variable'
diff --git a/ext/tk/lib/tk/autoload.rb b/ext/tk/lib/tk/autoload.rb
index 2ebee9ea24..0773f7708d 100644
--- a/ext/tk/lib/tk/autoload.rb
+++ b/ext/tk/lib/tk/autoload.rb
@@ -27,8 +27,6 @@ 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'
@@ -252,85 +250,78 @@ autoload :TkXIM, 'tk/xim'
module Tk
@TOPLEVEL_ALIAS_TABLE = {}
@TOPLEVEL_ALIAS_TABLE[:Tk] = {
- :TkButton => 'tk/button',
+ :TkButton => 'tk/button',
- :TkCanvas => 'tk/canvas',
+ :TkCanvas => 'tk/canvas',
- :TkCheckButton => 'tk/checkbutton',
- :TkCheckbutton => 'tk/checkbutton',
+ :TkCheckButton => 'tk/checkbutton',
+ :TkCheckbutton => 'tk/checkbutton',
- # :TkDialog => 'tk/dialog',
- # :TkDialog2 => 'tk/dialog',
- # :TkDialogObj => 'tk/dialog',
- # :TkWarning => 'tk/dialog',
- # :TkWarning2 => 'tk/dialog',
- # :TkWarningObj => 'tk/dialog',
+ # :TkDialog => 'tk/dialog',
+ # :TkDialog2 => 'tk/dialog',
+ # :TkDialogObj => 'tk/dialog',
+ # :TkWarning => 'tk/dialog',
+ # :TkWarning2 => 'tk/dialog',
+ # :TkWarningObj => 'tk/dialog',
- :TkEntry => 'tk/entry',
+ :TkEntry => 'tk/entry',
- :TkFrame => 'tk/frame',
+ :TkFrame => 'tk/frame',
- :TkLabel => 'tk/label',
+ :TkLabel => 'tk/label',
- :TkLabelFrame => 'tk/labelframe',
- :TkLabelframe => 'tk/labelframe',
+ :TkLabelFrame => 'tk/labelframe',
+ :TkLabelframe => 'tk/labelframe',
- :TkListbox => 'tk/listbox',
+ :TkListbox => 'tk/listbox',
- :TkMacResource => 'tk/macpkg',
+ :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',
+ :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',
+ :TkMessage => 'tk/message',
- :TkPanedWindow => 'tk/panedwindow',
- :TkPanedwindow => 'tk/panedwindow',
+ :TkPanedWindow => 'tk/panedwindow',
+ :TkPanedwindow => 'tk/panedwindow',
- :TkRadioButton => 'tk/radiobutton',
- :TkRadiobutton => 'tk/radiobutton',
+ :TkRadioButton => 'tk/radiobutton',
+ :TkRadiobutton => 'tk/radiobutton',
- # :TkRoot => 'tk/root',
+ # :TkRoot => 'tk/root',
- :TkScale => 'tk/scale',
+ :TkScale => 'tk/scale',
- :TkScrollbar => 'tk/scrollbar',
- :TkXScrollbar => 'tk/scrollbar',
- :TkYScrollbar => 'tk/scrollbar',
+ :TkScrollbar => 'tk/scrollbar',
+ :TkXScrollbar => 'tk/scrollbar',
+ :TkYScrollbar => 'tk/scrollbar',
- :TkSpinbox => 'tk/spinbox',
+ :TkSpinbox => 'tk/spinbox',
- :TkText => 'tk/text',
+ :TkText => 'tk/text',
- :TkToplevel => 'tk/toplevel',
+ :TkToplevel => 'tk/toplevel',
- :TkWinDDE => 'tk/winpkg',
- :TkWinRegistry => 'tk/winpkg',
+ :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
@@ -352,387 +343,50 @@ class << Tk
_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
+ def __set_toplevel_aliases__(target, obj, *symbols)
@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
+ # if @current_default_widget_set == target
+ if @TOPLEVEL_ALIAS_OWNER[sym] == target
+ Object.class_eval{remove_const sym} if Object.const_defined?(sym)
+ Object.const_set(sym, obj)
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
+ ###################################
+ private
+ def _replace_toplevel_aliases(target)
+ # check already autoloaded
+ if (table = @TOPLEVEL_ALIAS_TABLE[current = @current_default_widget_set])
+ table.each{|sym, file|
+ if !Object.autoload?(sym) && Object.const_defined?(sym) &&
+ @TOPLEVEL_ALIAS_TABLE[current][sym].kind_of?(String)
+ # autoload -> class
+ @TOPLEVEL_ALIAS_TABLE[current][sym] = Object.const_get(sym)
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)
+ # setup autoloads
+ @TOPLEVEL_ALIAS_TABLE[target].each{|sym, file|
+ Object.class_eval{remove_const sym} if Object.const_defined?(sym)
+ if file.kind_of?(String)
+ # file => autoload target file
+ Object.autoload(sym, file)
else
- # New definition
- @TOPLEVEL_ALIAS_OWNER[sym] = target
- replace_topalias(sym, obj)
- replace_topobj(sym, obj)
+ # file => loaded class object
+ Object.const_set(sym, file)
end
+ @TOPLEVEL_ALIAS_OWNER[sym] = target
}
- # change default_widget_set
+ # update current alias
@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
@@ -740,14 +394,14 @@ Tk.default_widget_set = :Tk
############################################
# depend on the version of Tcl/Tk
-# major, minor, type, patchlevel = TclTkLib.get_version
+# major, minor, type, type_name, patchlevel = TclTkLib.get_version
############################################
# Ttk (Tile) support
=begin
-if major > 8 ||
- (major == 8 && minor > 5) ||
- (major == 8 && minor == 5 && type >= TclTkLib::RELEASE_TYPE::BETA)
+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'
diff --git a/ext/tk/lib/tk/bindtag.rb b/ext/tk/lib/tk/bindtag.rb
index 23b4e0b7c3..88c8367a88 100644
--- a/ext/tk/lib/tk/bindtag.rb
+++ b/ext/tk/lib/tk/bindtag.rb
@@ -9,7 +9,7 @@ class TkBindTag
#BTagID_TBL = {}
BTagID_TBL = TkCore::INTERP.create_table
- (Tk_BINDTAG_ID = ["btag".freeze, TkUtil.untrust("00000")]).instance_eval{
+ (Tk_BINDTAG_ID = ["btag".freeze, "00000".taint]).instance_eval{
@mutex = Mutex.new
def mutex; @mutex; end
freeze
diff --git a/ext/tk/lib/tk/busy.rb b/ext/tk/lib/tk/busy.rb
deleted file mode 100644
index 7f4f89f524..0000000000
--- a/ext/tk/lib/tk/busy.rb
+++ /dev/null
@@ -1,118 +0,0 @@
-#
-# 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
index 65233c91b6..770a5785bb 100644
--- a/ext/tk/lib/tk/button.rb
+++ b/ext/tk/lib/tk/button.rb
@@ -7,7 +7,7 @@ require 'tk/label'
class Tk::Button<Tk::Label
TkCommandNames = ['button'.freeze].freeze
WidgetClassName = 'Button'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
#def create_self(keys)
# if keys and keys != None
# tk_call_without_enc('button', @path, *hash_kv(keys, true))
@@ -27,5 +27,4 @@ class Tk::Button<Tk::Label
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)
+Tk.__set_toplevel_aliases__(:Tk, Tk::Button, :TkButton)
diff --git a/ext/tk/lib/tk/canvas.rb b/ext/tk/lib/tk/canvas.rb
index 1e24c0be97..36ea008a17 100644
--- a/ext/tk/lib/tk/canvas.rb
+++ b/ext/tk/lib/tk/canvas.rb
@@ -13,7 +13,7 @@ module TkCanvasItemConfig
def __item_strval_optkeys(id)
# maybe need to override
super(id) + [
- 'fill', 'activefill', 'disabledfill',
+ 'fill', 'activefill', 'disabledfill',
'outline', 'activeoutline', 'disabledoutline'
]
end
@@ -45,7 +45,7 @@ class Tk::Canvas<TkWindow
TkCommandNames = ['canvas'.freeze].freeze
WidgetClassName = 'Canvas'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
def __destroy_hook__
TkcItem::CItemID_TBL.delete(@path)
@@ -117,7 +117,7 @@ class Tk::Canvas<TkWindow
end
def bbox(tagOrId, *tags)
- list(tk_send_without_enc('bbox', tagid(tagOrId),
+ list(tk_send_without_enc('bbox', tagid(tagOrId),
*tags.collect{|t| tagid(t)}))
end
@@ -181,7 +181,7 @@ class Tk::Canvas<TkWindow
end
def dchars(tag, first, last=None)
- tk_send_without_enc('dchars', tagid(tag),
+ tk_send_without_enc('dchars', tagid(tag),
_get_eval_enc_str(first), _get_eval_enc_str(last))
self
end
@@ -214,7 +214,7 @@ class Tk::Canvas<TkWindow
alias deltag dtag
def find(mode, *args)
- list(tk_send_without_enc('find', mode, *args)).collect!{|id|
+ list(tk_send_without_enc('find', mode, *args)).collect!{|id|
TkcItem.id2obj(self, id)
}
end
@@ -265,18 +265,12 @@ class Tk::Canvas<TkWindow
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,
+ tk_send_without_enc('insert', tagid(tagOrId), index,
_get_eval_enc_str(string))
self
end
@@ -306,7 +300,7 @@ class Tk::Canvas<TkWindow
fnt
end
else
- tk_tcl2ruby(_fromUTF8(tk_send_without_enc('itemcget', tagid(tagOrId),
+ tk_tcl2ruby(_fromUTF8(tk_send_without_enc('itemcget', tagid(tagOrId),
"-#{option}")))
end
end
@@ -321,16 +315,16 @@ class Tk::Canvas<TkWindow
|| key['latinfont'] || key['asciifont'] )
tagfont_configure(tagid(tagOrId), key.dup)
else
- _fromUTF8(tk_send_without_enc('itemconfigure', tagid(tagOrId),
+ _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 ||
+ elsif ( key == 'font' || key == :font ||
+ key == 'kanjifont' || key == :kanjifont ||
+ key == 'latinfont' || key == :latinfont ||
key == 'asciifont' || key == :asciifont )
if value == None
tagfontobj(tagid(tagOrId))
@@ -338,7 +332,7 @@ class Tk::Canvas<TkWindow
tagfont_configure(tagid(tagOrId), {key=>value})
end
else
- _fromUTF8(tk_send_without_enc('itemconfigure', tagid(tagOrId),
+ _fromUTF8(tk_send_without_enc('itemconfigure', tagid(tagOrId),
"-#{key}", _get_eval_enc_str(value)))
end
end
@@ -395,16 +389,16 @@ class Tk::Canvas<TkWindow
else
if conf[3]
if conf[3].index('{')
- conf[3] = tk_split_list(conf[3])
+ conf[3] = tk_split_list(conf[3])
else
- conf[3] = tk_tcl2ruby(conf[3])
+ conf[3] = tk_tcl2ruby(conf[3])
end
end
if conf[4]
if conf[4].index('{')
- conf[4] = tk_split_list(conf[4])
+ conf[4] = tk_split_list(conf[4])
else
- conf[4] = tk_tcl2ruby(conf[4])
+ conf[4] = tk_tcl2ruby(conf[4])
end
end
end
@@ -427,8 +421,8 @@ class Tk::Canvas<TkWindow
when 'coords'
{'coords' => ['', '', '', self.coords(tagOrId)]}
when 'dash', 'activedash', 'disableddash'
- conf = tk_split_simplelist(tk_send_without_enc('itemconfigure',
- tagid(tagOrId),
+ conf = tk_split_simplelist(tk_send_without_enc('itemconfigure',
+ tagid(tagOrId),
"-#{key}"))
if conf[3] && conf[3] =~ /^[0-9]/
conf[3] = list(conf[3])
@@ -463,16 +457,16 @@ class Tk::Canvas<TkWindow
else
if conf[2]
if conf[2].index('{')
- conf[2] = tk_split_list(conf[2])
+ conf[2] = tk_split_list(conf[2])
else
- conf[2] = tk_tcl2ruby(conf[2])
+ conf[2] = tk_tcl2ruby(conf[2])
end
end
if conf[3]
if conf[3].index('{')
- conf[3] = tk_split_list(conf[3])
+ conf[3] = tk_split_list(conf[3])
else
- conf[3] = tk_tcl2ruby(conf[3])
+ conf[3] = tk_tcl2ruby(conf[3])
end
end
end
@@ -529,18 +523,11 @@ class Tk::Canvas<TkWindow
self
end
- def move(tag, dx, dy)
- tk_send_without_enc('move', tagid(tag), dx, dy)
+ def move(tag, x, y)
+ tk_send_without_enc('move', tagid(tag), x, y)
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
@@ -554,15 +541,6 @@ class Tk::Canvas<TkWindow
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
@@ -603,8 +581,7 @@ class Tk::Canvas<TkWindow
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)
+Tk.__set_toplevel_aliases__(:Tk, Tk::Canvas, :TkCanvas)
class TkcItem<TkObject
@@ -699,7 +676,7 @@ class TkcItem<TkObject
fail RuntimeError, "#{self} is an abstract class"
end
args, fontkeys = _parse_create_args(args)
- idnum = tk_call_without_enc(canvas.path, 'create',
+ idnum = tk_call_without_enc(canvas.path, 'create',
self::CItemTypeName, *args)
canvas.itemconfigure(idnum, fontkeys) unless fontkeys.empty?
idnum.to_i # 'canvas item id' is an integer number
diff --git a/ext/tk/lib/tk/canvastag.rb b/ext/tk/lib/tk/canvastag.rb
index 495d92a9a8..49796d80b2 100644
--- a/ext/tk/lib/tk/canvastag.rb
+++ b/ext/tk/lib/tk/canvastag.rb
@@ -60,9 +60,6 @@ module TkcTagAccess
@c.itembindinfo(@id, seq)
end
- def cget_tkstring(option)
- @c.itemcget_tkstring(@id, option)
- end
def cget(option)
@c.itemcget(@id, option)
end
@@ -119,13 +116,6 @@ module TkcTagAccess
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
@@ -145,13 +135,6 @@ module TkcTagAccess
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
@@ -162,14 +145,6 @@ module TkcTagAccess
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
@@ -228,7 +203,7 @@ class TkcTag<TkObject
CTagID_TBL = TkCore::INTERP.create_table
- (Tk_CanvasTag_ID = ['ctag'.freeze, TkUtil.untrust('00000')]).instance_eval{
+ (Tk_CanvasTag_ID = ['ctag'.freeze, '00000'.taint]).instance_eval{
@mutex = Mutex.new
def mutex; @mutex; end
freeze
@@ -243,7 +218,7 @@ class TkcTag<TkObject
CTagID_TBL.mutex.synchronize{
if CTagID_TBL[cpath]
CTagID_TBL[cpath][id]? CTagID_TBL[cpath][id]: id
- else
+ else
id
end
}
@@ -414,7 +389,7 @@ class TkcTagCurrent<TkcTagString
end
class TkcGroup<TkcTag
- (Tk_cGroup_ID = ['tkcg'.freeze, TkUtil.untrust('00000')]).instance_eval{
+ (Tk_cGroup_ID = ['tkcg'.freeze, '00000'.taint]).instance_eval{
@mutex = Mutex.new
def mutex; @mutex; end
freeze
@@ -439,7 +414,7 @@ class TkcGroup<TkcTag
include(*args) if args != []
end
#private :create_self
-
+
def include(*tags)
for i in tags
#i.addtag(@id)
diff --git a/ext/tk/lib/tk/checkbutton.rb b/ext/tk/lib/tk/checkbutton.rb
index b7449541c5..b1186a87ed 100644
--- a/ext/tk/lib/tk/checkbutton.rb
+++ b/ext/tk/lib/tk/checkbutton.rb
@@ -7,7 +7,7 @@ require 'tk/radiobutton'
class Tk::CheckButton<Tk::RadioButton
TkCommandNames = ['checkbutton'.freeze].freeze
WidgetClassName = 'Checkbutton'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
#def create_self(keys)
# if keys and keys != None
# tk_call_without_enc('checkbutton', @path, *hash_kv(keys, true))
@@ -26,7 +26,5 @@ 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)
+Tk.__set_toplevel_aliases__(:Tk, Tk::CheckButton,
+ :TkCheckButton, :TkCheckbutton)
diff --git a/ext/tk/lib/tk/composite.rb b/ext/tk/lib/tk/composite.rb
index e267c7a22b..883d43c3ea 100644
--- a/ext/tk/lib/tk/composite.rb
+++ b/ext/tk/lib/tk/composite.rb
@@ -1,5 +1,5 @@
#
-# tk/composite.rb :
+# tk/composite.rb :
#
require 'tk'
@@ -145,34 +145,16 @@ module TkComposite
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
- }
+ opts.each{|m_set, m_cget, m_info|
+ 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
+ @option_methods[m_set] = {
+ :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)
@@ -233,14 +215,6 @@ module TkComposite
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)
@@ -384,7 +358,7 @@ module TkComposite
opt, wins = tbl[0]
next unless wins && wins[-1]
if slot == opt
- info_list.delete_if{|i| i[0] == slot} <<
+ info_list.delete_if{|i| i[0] == slot} <<
wins[-1].configinfo(slot)
else
info = wins[-1].configinfo(opt)
@@ -393,7 +367,7 @@ module TkComposite
end
else
opt, wins = tbl[-1]
- info_list.delete_if{|i| i[0] == slot} <<
+ info_list.delete_if{|i| i[0] == slot} <<
[slot, '', '', '', wins[-1].cget(opt)]
end
}
diff --git a/ext/tk/lib/tk/console.rb b/ext/tk/lib/tk/console.rb
index 64e257594c..26ce262caa 100644
--- a/ext/tk/lib/tk/console.rb
+++ b/ext/tk/lib/tk/console.rb
@@ -28,7 +28,7 @@ module TkConsole
# supports a Tcl script only
# I have no idea to support a Ruby script seamlessly.
#
- _fromUTF8(tk_call_without_enc('console', 'eval',
+ _fromUTF8(tk_call_without_enc('console', 'eval',
_get_eval_enc_str(tcl_script)))
end
def self.maininterp_eval(tcl_script)
@@ -36,7 +36,7 @@ module TkConsole
# supports a Tcl script only
# I have no idea to support a Ruby script seamlessly.
#
- _fromUTF8(tk_call_without_enc('consoleinterp', 'eval',
+ _fromUTF8(tk_call_without_enc('consoleinterp', 'eval',
_get_eval_enc_str(tcl_script)))
end
@@ -45,7 +45,7 @@ module TkConsole
# supports a Tcl script only
# I have no idea to support a Ruby script seamlessly.
#
- _fromUTF8(tk_call_without_enc('consoleinterp', 'record',
+ _fromUTF8(tk_call_without_enc('consoleinterp', 'record',
_get_eval_enc_str(tcl_script)))
end
diff --git a/ext/tk/lib/tk/dialog.rb b/ext/tk/lib/tk/dialog.rb
index 7ef7820699..180da101e3 100644
--- a/ext/tk/lib/tk/dialog.rb
+++ b/ext/tk/lib/tk/dialog.rb
@@ -18,11 +18,11 @@ class TkDialogObj < TkWindow
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 " +
+ 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; ",
+ # @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 '+
@@ -103,7 +103,7 @@ class TkDialogObj < TkWindow
#end
if @buttons.kind_of?(Array)
- _set_button_config(@buttons.collect{|cfg|
+ _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
@@ -127,7 +127,7 @@ class TkDialogObj < TkWindow
=end
if @message_config.kind_of?(Hash)
- # @config << Kernel.format("%s.msg configure %s;",
+ # @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 '+
@@ -135,7 +135,7 @@ class TkDialogObj < TkWindow
end
if @msgframe_config.kind_of?(Hash)
- # @config << Kernel.format("%s.top configure %s;",
+ # @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 '+
@@ -143,7 +143,7 @@ class TkDialogObj < TkWindow
end
if @btnframe_config.kind_of?(Hash)
- # @config << Kernel.format("%s.bot configure %s;",
+ # @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 '+
@@ -151,7 +151,7 @@ class TkDialogObj < TkWindow
end
if @bitmap_config.kind_of?(Hash)
- # @config << Kernel.format("%s.bitmap configure %s;",
+ # @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 '+
@@ -176,19 +176,19 @@ class TkDialogObj < TkWindow
# 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 '+
+ # '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 + ' ' +
+ # @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 + ' ' +
+ # @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,
+ self.class::TkCommandNames[0],
+ @path, @title, @message, @bitmap,
String(default_button)
].concat(@buttons))).to_i
end
@@ -226,7 +226,7 @@ class TkDialogObj < TkWindow
return nil
end
def bitmap
- # returns a bitmap name or a bitmap file path
+ # returns a bitmap name or a bitmap file path
# (@ + path ; e.g. '@/usr/share/bitmap/sample.xbm')
return "info"
end
diff --git a/ext/tk/lib/tk/encodedstr.rb b/ext/tk/lib/tk/encodedstr.rb
index 59fbb1911d..02de0b0d85 100644
--- a/ext/tk/lib/tk/encodedstr.rb
+++ b/ext/tk/lib/tk/encodedstr.rb
@@ -67,11 +67,11 @@ module Tk
def initialize(str, enc = nil)
super(str)
- # @encoding = ( enc ||
- # ((self.class::Encoding)?
+ # @encoding = ( enc ||
+ # ((self.class::Encoding)?
# self.class::Encoding : Tk.encoding_system) )
enc ||= (self.class::Encoding)?
- 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)
diff --git a/ext/tk/lib/tk/entry.rb b/ext/tk/lib/tk/entry.rb
index d4aa03f2b6..8ce8def1e7 100644
--- a/ext/tk/lib/tk/entry.rb
+++ b/ext/tk/lib/tk/entry.rb
@@ -13,7 +13,7 @@ class Tk::Entry<Tk::Label
TkCommandNames = ['entry'.freeze].freeze
WidgetClassName = 'Entry'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
#def create_self(keys)
# super(__conv_vcmd_on_hash_kv(keys))
@@ -116,5 +116,4 @@ class Tk::Entry<Tk::Label
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)
+Tk.__set_toplevel_aliases__(:Tk, Tk::Entry, :TkEntry)
diff --git a/ext/tk/lib/tk/event.rb b/ext/tk/lib/tk/event.rb
index bf4e122322..d8aad6248b 100644
--- a/ext/tk/lib/tk/event.rb
+++ b/ext/tk/lib/tk/event.rb
@@ -8,7 +8,7 @@ end
########################
require 'tkutil'
-require 'tk' unless Object.const_defined? :TkComm
+require 'tk'
########################
@@ -53,39 +53,39 @@ module TkEvent
#-----+-------------------+------------------+-----------------------#
# 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, ],
+ [ 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' ],
@@ -153,12 +153,12 @@ module TkEvent
FIELD_FLAG = {
# key => flag
- 'above' => Grp::CONFIG,
+ 'above' => Grp::CONFIG,
'borderwidth' => (Grp::CREATE|Grp::CONFIG),
- 'button' => Grp::BUTTON,
- 'count' => Grp::EXPOSE,
- 'data' => (Grp::VIRTUAL|Grp::STRING_DATA),
- 'delta' => Grp::MWHEEL,
+ '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),
@@ -191,23 +191,23 @@ module TkEvent
}
FIELD_OPERATION = {
- 'root' => proc{|val|
+ 'root' => proc{|val|
begin
Tk.tk_call_without_enc('winfo', 'pathname', val)
val
rescue
nil
end
- },
+ },
- 'subwindow' => proc{|val|
+ 'subwindow' => proc{|val|
begin
Tk.tk_call_without_enc('winfo', 'pathname', val)
val
rescue
nil
end
- },
+ },
'window' => proc{|val| nil}
}
@@ -280,7 +280,7 @@ module TkEvent
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.
+ # If not set, original widget will get the same event.
# That will make infinite loop.
w = Tk.tk_call_without_enc('focus')
begin
@@ -296,58 +296,58 @@ module TkEvent
# [ <'%' 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 ],
+ [ ?#, ?n, :serial ],
+ [ ?a, ?s, :above ],
+ [ ?b, ?n, :num ],
+ [ ?c, ?n, :count ],
+ [ ?d, ?s, :detail ],
# ?e
- [ ?f, ?b, :focus ],
+ [ ?f, ?b, :focus ],
# ?g
- [ ?h, ?n, :height ],
- [ ?i, ?s, :win_hex ],
+ [ ?h, ?n, :height ],
+ [ ?i, ?s, :win_hex ],
# ?j
- [ ?k, ?n, :keycode ],
+ [ ?k, ?n, :keycode ],
# ?l
- [ ?m, ?s, :mode ],
+ [ ?m, ?s, :mode ],
# ?n
- [ ?o, ?b, :override ],
- [ ?p, ?s, :place ],
+ [ ?o, ?b, :override ],
+ [ ?p, ?s, :place ],
# ?q
# ?r
- [ ?s, ?x, :state ],
- [ ?t, ?n, :time ],
+ [ ?s, ?x, :state ],
+ [ ?t, ?n, :time ],
# ?u
- [ ?v, ?n, :value_mask ],
- [ ?w, ?n, :width ],
- [ ?x, ?n, :x ],
- [ ?y, ?n, :y ],
+ [ ?v, ?n, :value_mask ],
+ [ ?w, ?n, :width ],
+ [ ?x, ?n, :x ],
+ [ ?y, ?n, :y ],
# ?z
- [ ?A, ?s, :char ],
- [ ?B, ?n, :borderwidth ],
+ [ ?A, ?s, :char ],
+ [ ?B, ?n, :borderwidth ],
# ?C
- [ ?D, ?n, :wheel_delta ],
- [ ?E, ?b, :send_event ],
+ [ ?D, ?n, :wheel_delta ],
+ [ ?E, ?b, :send_event ],
# ?F
# ?G
# ?H
# ?I
# ?J
- [ ?K, ?s, :keysym ],
+ [ ?K, ?s, :keysym ],
# ?L
# ?M
- [ ?N, ?n, :keysym_num ],
+ [ ?N, ?n, :keysym_num ],
# ?O
- [ ?P, ?s, :property ],
+ [ ?P, ?s, :property ],
# ?Q
- [ ?R, ?s, :rootwin_id ],
- [ ?S, ?s, :subwindow ],
- [ ?T, ?n, :type ],
+ [ ?R, ?s, :rootwin_id ],
+ [ ?S, ?s, :subwindow ],
+ [ ?T, ?n, :type ],
# ?U
# ?V
- [ ?W, ?w, :widget ],
- [ ?X, ?n, :x_root ],
- [ ?Y, ?n, :y_root ],
+ [ ?W, ?w, :widget ],
+ [ ?X, ?n, :x_root ],
+ [ ?Y, ?n, :y_root ],
# ?Z
nil
]
@@ -356,16 +356,16 @@ module TkEvent
# 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],
+ # ['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) ],
+ [ ?n, TkComm.method(:num_or_str) ],
+ [ ?s, TkComm.method(:string) ],
+ [ ?b, TkComm.method(:bool) ],
+ [ ?w, TkComm.method(:window) ],
[ ?x, proc{|val|
begin
@@ -374,7 +374,7 @@ module TkEvent
val
end
}
- ],
+ ],
nil
]
@@ -399,25 +399,25 @@ module TkEvent
# 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.
+ # _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().
+ # 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
+ # 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,
+ # If you need support extra arguments given by Tcl/Tk,
# please override _get_extra_args_tbl
#
#def self._get_extra_args_tbl
@@ -436,15 +436,15 @@ module TkEvent
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,
+ :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
}
@@ -482,26 +482,6 @@ module TkEvent
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
diff --git a/ext/tk/lib/tk/font.rb b/ext/tk/lib/tk/font.rb
index 03db850f96..62d628c132 100644
--- a/ext/tk/lib/tk/font.rb
+++ b/ext/tk/lib/tk/font.rb
@@ -11,7 +11,7 @@ class TkFont
TkCommandNames = ['font'.freeze].freeze
- (Tk_FontID = ["@font".freeze, TkUtil.untrust("00000")]).instance_eval{
+ (Tk_FontID = ["@font".freeze, "00000".taint]).instance_eval{
@mutex = Mutex.new
def mutex; @mutex; end
freeze
@@ -20,7 +20,7 @@ class TkFont
Tk_FontNameTBL = TkCore::INTERP.create_table
Tk_FontUseTBL = TkCore::INTERP.create_table
- TkCore::INTERP.init_ip_env{
+ TkCore::INTERP.init_ip_env{
Tk_FontNameTBL.mutex.synchronize{ Tk_FontNameTBL.clear }
Tk_FontUseTBL.mutex.synchronize{ Tk_FontUseTBL.clear }
}
@@ -66,8 +66,8 @@ class TkFont
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',
+ ltn, knj = tk_split_simplelist(tk_call('font', 'configure',
+ 'Mincho:Helvetica-Bold-12',
'-compound'))
else
# unknown Tcl/Tk-JP
@@ -75,7 +75,7 @@ class TkFont
platform = Tk::PLATFORM['platform']
case platform
when 'unix'
- ltn = {'family'=>'Helvetica'.freeze,
+ ltn = {'family'=>'Helvetica'.freeze,
'size'=>-12, 'weight'=>'bold'.freeze}
#knj = 'k14'
#knj = '-misc-fixed-medium-r-normal--14-*-*-*-c-*-jisx0208.1983-0'
@@ -102,7 +102,7 @@ class TkFont
platform = Tk::PLATFORM['platform']
case platform
when 'unix'
- ltn = {'family'=>'Helvetica'.freeze,
+ ltn = {'family'=>'Helvetica'.freeze,
'size'=>-12, 'weight'=>'bold'.freeze}
when 'windows'
ltn = {'family'=>'MS Sans Serif'.freeze, 'size'=>8}
@@ -211,7 +211,7 @@ class TkFont
end
end
def TkFont.actual_hash(fnt, option=nil)
- Hash[TkFont.actual(fnt, option)]
+ Hash[TkFont.actual_hash(fnt, option)]
end
def TkFont.actual_displayof(fnt, win, option=nil)
@@ -224,7 +224,7 @@ class TkFont
end
end
def TkFont.actual_hash_displayof(fnt, option=nil)
- Hash[TkFont.actual_displayof(fnt, option)]
+ Hash[TkFont.actual_hash_displayof(fnt, option)]
end
def TkFont.configure(fnt, slot, value=None)
@@ -294,7 +294,7 @@ class TkFont
end
h = Hash[TkFont.metrics(fnt)]
- h.keys.each{|k|
+ h.keys.each{|k|
case TkFont::MetricsType[k.to_s]
when ?n
h[k] = TkComm::num_or_str(h[k])
@@ -331,7 +331,7 @@ class TkFont
end
h = Hash[TkFont.metrics_displayof(fnt, win, option)]
- h.keys.each{|k|
+ h.keys.each{|k|
case TkFont::MetricsType[k.to_s]
when ?n
h[k] = TkComm::num_or_str(h[k])
@@ -459,7 +459,7 @@ class TkFont
else
begin
compound = tk_split_simplelist(
- Hash[*tk_split_simplelist(tk_call('font', 'configure',
+ Hash[*tk_split_simplelist(tk_call('font', 'configure',
fnt))].collect{|k,v|
[k[1..-1], v]
}.assoc('compound')[1])
@@ -473,7 +473,7 @@ class TkFont
TkFont.new(fnt).call_font_configure([path, key], *args)
end
else
- TkFont.new(compound[0],
+ TkFont.new(compound[0],
compound[1]).call_font_configure([path, key], *args)
end
end
@@ -570,7 +570,7 @@ class TkFont
if JAPANIZED_TK
tk_call('font', 'create', @latinfont, '-charset', 'iso8859')
tk_call('font', 'create', @kanjifont, '-charset', 'jisx0208.1983')
- tk_call('font', 'create', @compoundfont,
+ tk_call('font', 'create', @compoundfont,
'-compound', [@latinfont, @kanjifont])
else
tk_call('font', 'create', @latinfont)
@@ -614,7 +614,7 @@ class TkFont
# compound font check
if Tk::TK_VERSION == '8.0' && JAPANIZED_TK
begin
- compound = tk_split_simplelist(tk_call('font', 'configure',
+ compound = tk_split_simplelist(tk_call('font', 'configure',
ltn, '-compound'))
if knj == nil
if compound != []
@@ -624,7 +624,7 @@ class TkFont
if compound != []
ltn = compound[0]
end
- compound = tk_split_simplelist(tk_call('font', 'configure',
+ compound = tk_split_simplelist(tk_call('font', 'configure',
knj, '-compound'))
if compound != []
knj = compound[1]
@@ -639,7 +639,7 @@ class TkFont
if Tk::TK_VERSION =~ /^4..*/
knj = DEFAULT_KANJI_FONT_NAME
else
- knj = ltn
+ knj = ltn
end
end
else
@@ -806,7 +806,7 @@ class TkFont
if font[:charset] || font['charset']
tk_call('font', 'create', @latinfont, *hash_kv(font))
else
- tk_call('font', 'create', @latinfont,
+ tk_call('font', 'create', @latinfont,
'-charset', 'iso8859', *hash_kv(font))
end
elsif font.kind_of? Array
@@ -815,7 +815,7 @@ class TkFont
elsif font.kind_of? TkFont
tk_call('font', 'create', @latinfont, '-copy', font.latin_font)
elsif font
- tk_call('font', 'create', @latinfont, '-copy', font,
+ tk_call('font', 'create', @latinfont, '-copy', font,
'-charset', 'iso8859')
else
tk_call('font', 'create', @latinfont, '-charset', 'iso8859')
@@ -851,7 +851,7 @@ class TkFont
if font[:charset] || font['charset']
tk_call('font', 'create', @kanjifont, *hash_kv(font))
else
- tk_call('font', 'create', @kanjifont,
+ tk_call('font', 'create', @kanjifont,
'-charset', 'jisx0208.1983', *hash_kv(font))
end
elsif font.kind_of? Array
@@ -860,7 +860,7 @@ class TkFont
elsif font.kind_of? TkFont
tk_call('font', 'create', @kanjifont, '-copy', font.kanji_font_id)
elsif font
- tk_call('font', 'create', @kanjifont, '-copy', font,
+ tk_call('font', 'create', @kanjifont, '-copy', font,
'-charset', 'jisx0208.1983')
else
tk_call('font', 'create', @kanjifont, '-charset', 'jisx0208.1983')
@@ -922,7 +922,7 @@ class TkFont
@fontslot = {'font'=>@compoundfont}
# @fontslot['font'] = @compoundfont
begin
- tk_call('font', 'create', @compoundfont,
+ tk_call('font', 'create', @compoundfont,
'-compound', [@latinfont, @kanjifont], *hash_kv(keys))
rescue RuntimeError => e
if ltn == knj
@@ -930,7 +930,7 @@ class TkFont
tk_call('font', 'delete', @latinfont)
create_latinfont(DEFAULT_LATIN_FONT_NAME)
opts = []
- Hash[*(tk_split_simplelist(tk_call('font', 'configure',
+ Hash[*(tk_split_simplelist(tk_call('font', 'configure',
@kanjifont)))].each{|k,v|
case k
when '-size', '-weight', '-slant', '-underline', '-overstrike'
@@ -938,14 +938,14 @@ class TkFont
end
}
tk_call('font', 'configure', @latinfont, *opts)
- tk_call('font', 'create', @compoundfont,
+ 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',
+ Hash[*(tk_split_simplelist(tk_call('font', 'configure',
@latinfont)))].each{|k,v|
case k
when '-size', '-weight', '-slant', '-underline', '-overstrike'
@@ -953,7 +953,7 @@ class TkFont
end
}
tk_call('font', 'configure', @kanjifont, *opts)
- tk_call('font', 'create', @compoundfont,
+ tk_call('font', 'create', @compoundfont,
'-compound', [@latinfont, @kanjifont], *hash_kv(keys))
else
@@ -1392,7 +1392,7 @@ class TkFont
end
h = Hash[metrics(option)]
- h.keys.each{|k|
+ h.keys.each{|k|
case TkFont::MetricsType[k.to_s]
when ?n
h[k] = TkComm::num_or_str(h[k])
@@ -1424,7 +1424,7 @@ class TkFont
end
h = Hash[metrics_displayof(win, option)]
- h.keys.each{|k|
+ h.keys.each{|k|
case TkFont::MetricsType[k.to_s]
when ?n
h[k] = TkComm::num_or_str(h[k])
@@ -1459,7 +1459,7 @@ class TkFont
end
h = Hash[latin_metrics(option)]
- h.keys.each{|k|
+ h.keys.each{|k|
case TkFont::MetricsType[k.to_s]
when ?n
h[k] = TkComm::num_or_str(h[k])
@@ -1495,7 +1495,7 @@ class TkFont
end
h = Hash[latin_metrics_displayof(win, option)]
- h.keys.each{|k|
+ h.keys.each{|k|
case TkFont::MetricsType[k.to_s]
when ?n
h[k] = TkComm::num_or_str(h[k])
@@ -1532,7 +1532,7 @@ class TkFont
end
h = Hash[kanji_metrics(option)]
- h.keys.each{|k|
+ h.keys.each{|k|
case TkFont::MetricsType[k.to_s]
when ?n
h[k] = TkComm::num_or_str(h[k])
@@ -1570,7 +1570,7 @@ class TkFont
end
h = Hash[kanji_metrics_displayof(win, option)]
- h.keys.each{|k|
+ h.keys.each{|k|
case TkFont::MetricsType[k.to_s]
when ?n
h[k] = TkComm::num_or_str(h[k])
@@ -1586,7 +1586,7 @@ class TkFont
def reset_pointadjust
begin
if /^8\..*/ === Tk::TK_VERSION && JAPANIZED_TK
- configure('pointadjust' => latin_actual.assoc('size')[1].to_f /
+ configure('pointadjust' => latin_actual.assoc('size')[1].to_f /
kanji_actual.assoc('size')[1].to_f )
end
rescue
@@ -1659,8 +1659,8 @@ module TkFont::CoreMethods
''
end
else
- [['family',''], ['size',0], ['weight',''], ['slant',''],
- ['underline',false], ['overstrike',false], ['charset',''],
+ [['family',''], ['size',0], ['weight',''], ['slant',''],
+ ['underline',false], ['overstrike',false], ['charset',''],
['pointadjust',0]]
end
end
@@ -1672,7 +1672,7 @@ module TkFont::CoreMethods
""
elsif option
if win
- val = tk_call('font', 'actual', font,
+ val = tk_call('font', 'actual', font,
"-displayof", win, "-#{option}")
else
val = tk_call('font', 'actual', font, "-#{option}")
@@ -1687,7 +1687,7 @@ module TkFont::CoreMethods
end
else
l = tk_split_simplelist(if win
- tk_call('font', 'actual', font,
+ tk_call('font', 'actual', font,
"-displayof", win)
else
tk_call('font', 'actual', font)
@@ -1733,8 +1733,8 @@ module TkFont::CoreMethods
''
end
else
- [['family',''], ['size',0], ['weight',''], ['slant',''],
- ['underline',false], ['overstrike',false], ['charset',''],
+ [['family',''], ['size',0], ['weight',''], ['slant',''],
+ ['underline',false], ['overstrike',false], ['charset',''],
['pointadjust',1.0]]
end
else # ! TkComm::GET_CONFIGINFOwoRES_AS_ARRAY
@@ -1753,8 +1753,8 @@ module TkFont::CoreMethods
''
end
else
- {'family'=>'', 'size'=>0, 'weight'=>'', 'slant'=>'',
- 'underline'=>false, 'overstrike'=>false,
+ {'family'=>'', 'size'=>0, 'weight'=>'', 'slant'=>'',
+ 'underline'=>false, 'overstrike'=>false,
'charset'=>false, 'pointadjust'=>1.0}
end
end
@@ -1775,20 +1775,20 @@ module TkFont::CoreMethods
configure_core_tk8x(font, 'family', slot.delete('family'))
end
- if ((slot.key?('size') || slot.key?(:size)) &&
+ if ((slot.key?('size') || slot.key?(:size)) &&
padjust && !slot.key?('pointadjust') && !slot.key?(:pointadjust))
- tk_call('font', 'configure', font,
+ 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,
+ 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',
+ compound = tk_split_simplelist(tk_call('font', 'configure',
font, '-compound'))
rescue
tk_call('font', 'configure', font, '-family', value)
@@ -1819,7 +1819,7 @@ module TkFont::CoreMethods
ensure
tk_call('font', 'delete', kfnt) if kfnt != ''
end
-
+
else
tk_call('font', 'configure', font, "-#{slot}", value)
end
@@ -2044,7 +2044,7 @@ module TkFont::CoreMethods
keys = self.configinfo
tk_call('font', 'delete', @compoundfont)
begin
- tk_call('font', 'create', @compoundfont,
+ tk_call('font', 'create', @compoundfont,
'-compound', [@latinfont, @kanjifont], *hash_kv(keys))
=begin
latinkeys = {}
@@ -2061,7 +2061,7 @@ module TkFont::CoreMethods
tk_call('font', 'delete', @latinfont)
if fnt_bup && fnt_bup != ''
tk_call('font', 'create', @latinfont, '-copy', fnt_bup)
- tk_call('font', 'create', @compoundfont,
+ tk_call('font', 'create', @compoundfont,
'-compound', [@latinfont, @kanjifont], *hash_kv(keys))
tk_call('font', 'delete', fnt_bup)
else
@@ -2082,7 +2082,7 @@ module TkFont::CoreMethods
# not exist? (deleted?) -> create font
tk_call('font', 'create', @compoundfont, *hash_kv(latinkeys))
end
- end
+ end
self
end
@@ -2112,20 +2112,20 @@ module TkFont::CoreMethods
keys = self.configinfo
tk_call('font', 'delete', @compoundfont)
begin
- tk_call('font', 'create', @compoundfont,
+ 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,
+ tk_call('font', 'create', @compoundfont,
'-compound', [@latinfont, @kanjifont], *hash_kv(keys))
tk_call('font', 'delete', fnt_bup)
else
fail e
end
end
- end
+ end
self
end
@@ -2137,7 +2137,7 @@ module TkFont::CoreMethods
font = '{}' if font == ''
if win
- number(tk_call('font', 'measure', font,
+ number(tk_call('font', 'measure', font,
'-displayof', win, text))
else
number(tk_call('font', 'measure', font, text))
@@ -2158,7 +2158,7 @@ module TkFont::CoreMethods
if option
if win
- number(tk_call('font', 'metrics', font,
+ number(tk_call('font', 'metrics', font,
"-displayof", win, "-#{option}"))
else
number(tk_call('font', 'metrics', font, "-#{option}"))
@@ -2199,7 +2199,7 @@ module TkFont::CoreMethods
alias measure_core measure_core_tk4x
alias metrics_core metrics_core_tk4x
- when /^8\.[0-9]/
+ when /^8\.[0-5]/
alias actual_core actual_core_tk8x
alias configure_core configure_core_tk8x
alias configinfo_core configinfo_core_tk8x
@@ -2304,12 +2304,12 @@ end
#######################################
# define system font names
#######################################
-if Tk::TCL_MAJOR_VERSION > 8 ||
+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',
+ 'TkDefaultFont', 'TkTextFont', 'TkFixedFont', 'TkMenuFont',
+ 'TkHeadingFont', 'TkCaptionFont', 'TkSmallCaptionFont',
'TkIconFont', 'TkTooltipFont'
]
end
@@ -2323,29 +2323,22 @@ TkFont::SYSTEM_FONT_NAMES.add [
# -- macintosh, macosx
TkFont::SYSTEM_FONT_NAMES.add ['system', 'application']
-if Tk::TCL_MAJOR_VERSION > 8 ||
+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 ||
+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',
+ '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
deleted file mode 100644
index f9f816be59..0000000000
--- a/ext/tk/lib/tk/fontchooser.rb
+++ /dev/null
@@ -1,166 +0,0 @@
-#
-# tk/fontchooser.rb -- "tk fontchooser" support (Tcl/Tk8.6 or later)
-#
-require 'tk'
-require 'tk/font'
-
-module TkFont::Chooser
- extend TkCore
-end
-
-class << TkFont::Chooser
- def method_missing(id, *args)
- name = id.id2name
- case args.length
- when 1
- if name[-1] == ?=
- configure name[0..-2], args[0]
- args[0]
- else
- configure name, args[0]
- self
- end
- when 0
- begin
- cget(name)
- rescue
- super(id, *args)
- end
- else
- super(id, *args)
- end
- end
-
- def __conviginfo_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 :__conviginfo_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, __conviginfo_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?
- __conviginfo_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] = __conviginfo_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))
- }
- }
- 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
index 5118939732..263b160f29 100644
--- a/ext/tk/lib/tk/frame.rb
+++ b/ext/tk/lib/tk/frame.rb
@@ -6,7 +6,7 @@ require 'tk'
class Tk::Frame<TkWindow
TkCommandNames = ['frame'.freeze].freeze
WidgetClassName = 'Frame'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
################# old version
# def initialize(parent=nil, keys=nil)
@@ -128,5 +128,4 @@ class Tk::Frame<TkWindow
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)
+Tk.__set_toplevel_aliases__(:Tk, Tk::Frame, :TkFrame)
diff --git a/ext/tk/lib/tk/grid.rb b/ext/tk/lib/tk/grid.rb
index e1e07c44fa..0dfd7263a7 100644
--- a/ext/tk/lib/tk/grid.rb
+++ b/ext/tk/lib/tk/grid.rb
@@ -101,15 +101,17 @@ module TkGrid
def columnconfigure(master, index, args)
# master = master.epath if master.kind_of?(TkObject)
master = _epath(master)
- tk_call_without_enc("grid", 'columnconfigure',
+ tk_call_without_enc("grid", 'columnconfigure',
master, index, *hash_kv(args))
end
+ alias column columnconfigure
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
+ alias row rowconfigure
def columnconfiginfo(master, index, slot=nil)
# master = master.epath if master.kind_of?(TkObject)
@@ -117,15 +119,15 @@ module TkGrid
if slot
case slot
when 'uniform', :uniform
- tk_call_without_enc('grid', 'columnconfigure',
+ tk_call_without_enc('grid', 'columnconfigure',
master, index, "-#{slot}")
else
- num_or_str(tk_call_without_enc('grid', 'columnconfigure',
+ 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',
+ ilist = simplelist(tk_call_without_enc('grid', 'columnconfigure',
master, index))
info = {}
while key = ilist.shift
@@ -146,15 +148,15 @@ module TkGrid
if slot
case slot
when 'uniform', :uniform
- tk_call_without_enc('grid', 'rowconfigure',
+ tk_call_without_enc('grid', 'rowconfigure',
master, index, "-#{slot}")
else
- num_or_str(tk_call_without_enc('grid', 'rowconfigure',
+ 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',
+ ilist = simplelist(tk_call_without_enc('grid', 'rowconfigure',
master, index))
info = {}
while key = ilist.shift
@@ -169,22 +171,6 @@ module TkGrid
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
@@ -242,7 +228,7 @@ module TkGrid
list(tk_call_without_enc('grid', 'size', master))
end
- def slaves(master, keys=nil)
+ def slaves(master, args)
# master = master.epath if master.kind_of?(TkObject)
master = _epath(master)
list(tk_call_without_enc('grid', 'slaves', master, *hash_kv(args)))
diff --git a/ext/tk/lib/tk/image.rb b/ext/tk/lib/tk/image.rb
index 79d9ce8d00..dffdc19644 100644
--- a/ext/tk/lib/tk/image.rb
+++ b/ext/tk/lib/tk/image.rb
@@ -11,7 +11,7 @@ class TkImage<TkObject
Tk_IMGTBL = TkCore::INTERP.create_table
- (Tk_Image_ID = ['i'.freeze, TkUtil.untrust('00000')]).instance_eval{
+ (Tk_Image_ID = ['i'.freeze, '00000'.taint]).instance_eval{
@mutex = Mutex.new
def mutex; @mutex; end
freeze
@@ -45,7 +45,7 @@ class TkImage<TkObject
keys.delete('imagename')
keys.delete('without_creating')
obj.instance_eval{
- tk_call_without_enc('image', 'create',
+ tk_call_without_enc('image', 'create',
@type, @path, *hash_kv(keys, true))
}
end
@@ -78,7 +78,7 @@ class TkImage<TkObject
}
end
unless without_creating
- tk_call_without_enc('image', 'create',
+ tk_call_without_enc('image', 'create',
@type, @path, *hash_kv(keys, true))
end
end
diff --git a/ext/tk/lib/tk/itemconfig.rb b/ext/tk/lib/tk/itemconfig.rb
index 14396048ba..9c6a98d0f8 100644
--- a/ext/tk/lib/tk/itemconfig.rb
+++ b/ext/tk/lib/tk/itemconfig.rb
@@ -31,10 +31,10 @@ module TkItemConfigOptkeys
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',
+ 'text', 'label', 'show', 'data', 'file', 'maskdata', 'maskfile',
+ 'activebackground', 'activeforeground', 'background',
+ 'disabledforeground', 'disabledbackground', 'foreground',
+ 'highlightbackground', 'highlightcolor', 'insertbackground',
'selectbackground', 'selectforeground', 'troughcolor'
]
end
@@ -148,7 +148,7 @@ module TkItemConfigMethod
def __item_configinfo_struct(id)
# maybe need to override
- {:key=>0, :alias=>1, :db_name=>1, :db_class=>2,
+ {:key=>0, :alias=>1, :db_name=>1, :db_class=>2,
:default_value=>3, :current_value=>4}
end
private :__item_configinfo_struct
@@ -162,13 +162,6 @@ module TkItemConfigMethod
################################################
-
- 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
@@ -409,7 +402,7 @@ module TkItemConfigMethod
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]] =
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 )
@@ -421,7 +414,7 @@ module TkItemConfigMethod
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]] =
conf[__item_configinfo_struct(tagid(tagOrId))[:alias]][1..-1]
end
conf
@@ -471,7 +464,7 @@ module TkItemConfigMethod
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]] =
+ 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
@@ -479,7 +472,7 @@ module TkItemConfigMethod
end
if ( conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] )
begin
- conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] =
+ 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
@@ -492,11 +485,11 @@ module TkItemConfigMethod
if ( __item_configinfo_struct(tagid(tagOrId))[:default_value] \
&& conf[__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]] =
+ conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] =
num_or_str(conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]])
end
@@ -507,7 +500,7 @@ module TkItemConfigMethod
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]] =
+ 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
@@ -515,7 +508,7 @@ module TkItemConfigMethod
end
if ( conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] )
begin
- conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] =
+ 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
@@ -528,11 +521,11 @@ module TkItemConfigMethod
if ( __item_configinfo_struct(tagid(tagOrId))[:default_value] \
&& conf[__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]] =
+ conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] =
simplelist(conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]])
end
@@ -543,12 +536,12 @@ module TkItemConfigMethod
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]] =
+ 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]] =
+ conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] =
list(conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]])
end
@@ -581,13 +574,13 @@ module TkItemConfigMethod
# 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]] =
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]] =
conf[__item_configinfo_struct(tagid(tagOrId))[:alias]][1..-1]
end
@@ -598,7 +591,7 @@ module TkItemConfigMethod
# 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]] =
conf[__item_configinfo_struct(tagid(tagOrId))[:key]][1..-1]
optkey = conf[__item_configinfo_struct(tagid(tagOrId))[:key]]
@@ -634,7 +627,7 @@ module TkItemConfigMethod
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]] =
+ 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
@@ -642,7 +635,7 @@ module TkItemConfigMethod
end
if ( conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] )
begin
- conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] =
+ 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
@@ -652,11 +645,11 @@ module TkItemConfigMethod
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]] =
+ 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]] =
+ conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] =
num_or_str(conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]])
end
@@ -664,7 +657,7 @@ module TkItemConfigMethod
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]] =
+ 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
@@ -672,7 +665,7 @@ module TkItemConfigMethod
end
if ( conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] )
begin
- conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] =
+ 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
@@ -682,11 +675,11 @@ module TkItemConfigMethod
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]] =
+ 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]] =
+ conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] =
simplelist(conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]])
end
@@ -694,12 +687,12 @@ module TkItemConfigMethod
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]] =
+ 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]] =
+ conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] =
list(conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]])
end
@@ -726,20 +719,20 @@ module TkItemConfigMethod
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]])
+ 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]])
+ 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]])
+ 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]])
+ conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] =
+ tk_tcl2ruby(conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]])
end
end
end
@@ -747,7 +740,7 @@ module TkItemConfigMethod
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]] =
conf[__item_configinfo_struct(tagid(tagOrId))[:alias]][1..-1]
end
@@ -781,7 +774,7 @@ module TkItemConfigMethod
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]] =
conf[__item_configinfo_struct(tagid(tagOrId))[:key]][1..-1]
if ( ! __item_configinfo_struct(tagid(tagOrId))[:alias] \
@@ -795,7 +788,7 @@ module TkItemConfigMethod
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]] =
conf[__item_configinfo_struct(tagid(tagOrId))[:alias]][1..-1]
end
{ conf[0] => conf[1] }
@@ -848,7 +841,7 @@ module TkItemConfigMethod
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]] =
+ 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
@@ -856,7 +849,7 @@ module TkItemConfigMethod
end
if ( conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] )
begin
- conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] =
+ 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
@@ -869,11 +862,11 @@ module TkItemConfigMethod
if ( __item_configinfo_struct(tagid(tagOrId))[:default_value] \
&& conf[__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]] =
+ conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] =
num_or_str(conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]])
end
@@ -884,7 +877,7 @@ module TkItemConfigMethod
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]] =
+ 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
@@ -892,7 +885,7 @@ module TkItemConfigMethod
end
if ( conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] )
begin
- conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] =
+ 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
@@ -905,11 +898,11 @@ module TkItemConfigMethod
if ( __item_configinfo_struct(tagid(tagOrId))[:default_value] \
&& conf[__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]] =
+ conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] =
simplelist(conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]])
end
@@ -920,12 +913,12 @@ module TkItemConfigMethod
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]] =
+ 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]] =
+ conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] =
list(conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]])
end
@@ -958,13 +951,13 @@ module TkItemConfigMethod
# 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]] =
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]] =
conf[__item_configinfo_struct(tagid(tagOrId))[:alias]][1..-1]
end
{ conf[0] => conf[1] }
@@ -978,7 +971,7 @@ module TkItemConfigMethod
# 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]] =
conf[__item_configinfo_struct(tagid(tagOrId))[:key]][1..-1]
optkey = conf[__item_configinfo_struct(tagid(tagOrId))[:key]]
@@ -1014,7 +1007,7 @@ module TkItemConfigMethod
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]] =
+ 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
@@ -1022,7 +1015,7 @@ module TkItemConfigMethod
end
if ( conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] )
begin
- conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] =
+ 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
@@ -1032,11 +1025,11 @@ module TkItemConfigMethod
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]] =
+ 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]] =
+ conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] =
num_or_str(conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]])
end
@@ -1044,7 +1037,7 @@ module TkItemConfigMethod
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]] =
+ 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
@@ -1052,7 +1045,7 @@ module TkItemConfigMethod
end
if ( conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] )
begin
- conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] =
+ 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
@@ -1062,11 +1055,11 @@ module TkItemConfigMethod
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]] =
+ 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]] =
+ conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] =
simplelist(conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]])
end
@@ -1074,12 +1067,12 @@ module TkItemConfigMethod
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]] =
+ 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]] =
+ conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] =
list(conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]])
end
@@ -1106,19 +1099,19 @@ module TkItemConfigMethod
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]])
+ 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]] =
+ 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]])
+ 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]] =
+ conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] =
tk_tcl2ruby(conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]])
end
end
@@ -1127,7 +1120,7 @@ module TkItemConfigMethod
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]] =
conf[__item_configinfo_struct(tagid(tagOrId))[:alias]][1..-1]
end
ret[conf[0]] = conf[1]
@@ -1194,7 +1187,7 @@ module TkItemConfigMethod
end
slot = conf[__item_configinfo_struct(tagid(tagOrId))[:alias]]
end while(org_slot != slot)
- fail RuntimeError,
+ fail RuntimeError,
"there is a configure alias loop about '#{org_slot}'"
else
ret = {}
diff --git a/ext/tk/lib/tk/itemfont.rb b/ext/tk/lib/tk/itemfont.rb
index b5da4fa1ef..4c5c917c57 100644
--- a/ext/tk/lib/tk/itemfont.rb
+++ b/ext/tk/lib/tk/itemfont.rb
@@ -32,22 +32,22 @@ module TkTreatItemFont
if key
pathname = [win, tag, key].join(';')
- TkFont.used_on(pathname) ||
- TkFont.init_widget_font(pathname,
+ 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,
+ 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,
+ fonts[key] =
+ TkFont.used_on(pathname) ||
+ TkFont.init_widget_font(pathname,
*(__item_confinfo_cmd(tagid(tagOrId))))
}
fonts
@@ -73,13 +73,13 @@ module TkTreatItemFont
slot.delete(a_optkey)
slot.delete(k_optkey)
- fnt.call_font_configure([pathname, 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) ||
+ if (slot.key?(l_optkey) ||
+ slot.key?(a_optkey) ||
slot.key?(k_optkey))
fnt = TkFont.new(fnt)
@@ -90,7 +90,7 @@ module TkTreatItemFont
fnt.latin_replace(lfnt) if lfnt
fnt.kanji_replace(kfnt) if kfnt
- fnt.call_font_configure([pathname, optkey],
+ fnt.call_font_configure([pathname, optkey],
*(__item_config_cmd(tagid(tagOrId)) << {}))
next
else
@@ -115,7 +115,7 @@ module TkTreatItemFont
kfnt = slot.delete(k_optkey)
if lfnt && kfnt
- TkFont.new(lfnt, kfnt).call_font_configure([pathname, optkey],
+ TkFont.new(lfnt, kfnt).call_font_configure([pathname, optkey],
*(__item_config_cmd(tagid(tagOrId)) << {}))
elsif lfnt
latintagfont_configure([lfnt, optkey])
@@ -264,10 +264,10 @@ module TkTreatItemFont
end
if targetkey
- fnt.call_font_configure([__item_pathname(tagid(tagOrId)), targetkey],
+ fnt.call_font_configure([__item_pathname(tagid(tagOrId)), targetkey],
*(__item_config_cmd(tagid(tagOrId)) << {}))
else
- fnt.call_font_configure(__item_pathname(tagid(tagOrId)),
+ fnt.call_font_configure(__item_pathname(tagid(tagOrId)),
*(__item_config_cmd(tagid(tagOrId)) << {}))
end
self
@@ -276,10 +276,10 @@ module TkTreatItemFont
def latintagfont_copy(tagOrId, win, wintag=nil, winkey=nil, targetkey=nil)
if targetkey
- fontobj(targetkey).dup.call_font_configure([__item_pathname(tagid(tagOrId)), 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)),
+ fontobj.dup.call_font_configure(__item_pathname(tagid(tagOrId)),
*(__item_config_cmd(tagid(tagOrId)) << {}))
end
@@ -302,10 +302,10 @@ module TkTreatItemFont
def kanjifont_copy(tagOrId, win, wintag=nil, winkey=nil, targetkey=nil)
if targetkey
- fontobj(targetkey).dup.call_font_configure([__item_pathname(tagid(tagOrId)), 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)),
+ fontobj.dup.call_font_configure(__item_pathname(tagid(tagOrId)),
*(__item_config_cmd(tagid(tagOrId)) << {}))
end
diff --git a/ext/tk/lib/tk/kinput.rb b/ext/tk/lib/tk/kinput.rb
index b63f756def..a29dbcdb72 100644
--- a/ext/tk/lib/tk/kinput.rb
+++ b/ext/tk/lib/tk/kinput.rb
@@ -8,8 +8,8 @@ module TkKinput
extend Tk
TkCommandNames = [
- 'kinput_start'.freeze,
- 'kinput_send_spot'.freeze,
+ 'kinput_start'.freeze,
+ 'kinput_send_spot'.freeze,
'kanjiInput'.freeze
].freeze
@@ -47,7 +47,7 @@ module TkKinput
def TkKinput.attribute_info(win, slot=nil)
if slot
- conf = tk_split_list(tk_call('kanjiInput', 'attribute',
+ conf = tk_split_list(tk_call('kanjiInput', 'attribute',
win, "-#{slot}"))
conf[0] = conf[0][1..-1]
conf
diff --git a/ext/tk/lib/tk/label.rb b/ext/tk/lib/tk/label.rb
index 05e430e49b..80b3d778f1 100644
--- a/ext/tk/lib/tk/label.rb
+++ b/ext/tk/lib/tk/label.rb
@@ -6,7 +6,7 @@ require 'tk'
class Tk::Label<TkWindow
TkCommandNames = ['label'.freeze].freeze
WidgetClassName = 'Label'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
#def create_self(keys)
# if keys and keys != None
# tk_call_without_enc('label', @path, *hash_kv(keys, true))
@@ -18,5 +18,4 @@ class Tk::Label<TkWindow
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)
+Tk.__set_toplevel_aliases__(:Tk, Tk::Label, :TkLabel)
diff --git a/ext/tk/lib/tk/labelframe.rb b/ext/tk/lib/tk/labelframe.rb
index 6f679e55b5..995b5b7e72 100644
--- a/ext/tk/lib/tk/labelframe.rb
+++ b/ext/tk/lib/tk/labelframe.rb
@@ -7,7 +7,7 @@ require 'tk/frame'
class Tk::LabelFrame<Tk::Frame
TkCommandNames = ['labelframe'.freeze].freeze
WidgetClassName = 'Labelframe'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
#def create_self(keys)
# if keys and keys != None
# tk_call_without_enc('labelframe', @path, *hash_kv(keys, true))
@@ -26,6 +26,4 @@ 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)
+Tk.__set_toplevel_aliases__(:Tk, Tk::LabelFrame, :TkLabelFrame, :TkLabelframe)
diff --git a/ext/tk/lib/tk/listbox.rb b/ext/tk/lib/tk/listbox.rb
index 6742b2132c..bb039ffb0e 100644
--- a/ext/tk/lib/tk/listbox.rb
+++ b/ext/tk/lib/tk/listbox.rb
@@ -21,7 +21,7 @@ class Tk::Listbox<TkTextWin
TkCommandNames = ['listbox'.freeze].freeze
WidgetClassName = 'Listbox'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
#def create_self(keys)
# if keys and keys != None
@@ -92,7 +92,7 @@ class Tk::Listbox<TkTextWin
fail ArgumentError, 'an Array is expected'
end
tk_send_without_enc('delete', '0', 'end')
- tk_send_without_enc('insert', '0',
+ tk_send_without_enc('insert', '0',
*(vals.collect{|v| _get_eval_enc_str(v)}))
vals
end
@@ -110,7 +110,7 @@ class Tk::Listbox<TkTextWin
_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,
+ fnt = tk_tcl2ruby(_fromUTF8(tk_send_without_enc('itemcget', index,
'-font')))
unless fnt.kind_of?(TkFont)
fnt = tagfontobj(index, fnt)
@@ -127,9 +127,9 @@ class Tk::Listbox<TkTextWin
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] ||
+ if (key['font'] || key[:font] ||
+ key['kanjifont'] || key[:kanjifont] ||
+ key['latinfont'] || key[:latinfont] ||
key['asciifont'] || key[:asciifont] )
tagfont_configure(index, _symbolkey2str(key))
else
@@ -137,9 +137,9 @@ class Tk::Listbox<TkTextWin
end
else
- if (key == 'font' || key == :font ||
- key == 'kanjifont' || key == :kanjifont ||
- key == 'latinfont' || key == :latinfont ||
+ if (key == 'font' || key == :font ||
+ key == 'kanjifont' || key == :kanjifont ||
+ key == 'latinfont' || key == :latinfont ||
key == 'asciifont' || key == :asciifont )
if val == None
tagfontobj(index)
@@ -176,16 +176,16 @@ class Tk::Listbox<TkTextWin
else
if conf[3]
if conf[3].index('{')
- conf[3] = tk_split_list(conf[3])
+ conf[3] = tk_split_list(conf[3])
else
- conf[3] = tk_tcl2ruby(conf[3])
+ conf[3] = tk_tcl2ruby(conf[3])
end
end
if conf[4]
if conf[4].index('{')
- conf[4] = tk_split_list(conf[4])
+ conf[4] = tk_split_list(conf[4])
else
- conf[4] = tk_tcl2ruby(conf[4])
+ conf[4] = tk_tcl2ruby(conf[4])
end
end
end
@@ -224,16 +224,16 @@ class Tk::Listbox<TkTextWin
else
if conf[2]
if conf[2].index('{')
- conf[2] = tk_split_list(conf[2])
+ conf[2] = tk_split_list(conf[2])
else
- conf[2] = tk_tcl2ruby(conf[2])
+ conf[2] = tk_tcl2ruby(conf[2])
end
end
if conf[3]
if conf[3].index('{')
- conf[3] = tk_split_list(conf[3])
+ conf[3] = tk_split_list(conf[3])
else
- conf[3] = tk_tcl2ruby(conf[3])
+ conf[3] = tk_tcl2ruby(conf[3])
end
end
end
@@ -279,6 +279,4 @@ class Tk::Listbox<TkTextWin
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)
+Tk.__set_toplevel_aliases__(:Tk, Tk::Listbox, :TkListbox)
diff --git a/ext/tk/lib/tk/macpkg.rb b/ext/tk/lib/tk/macpkg.rb
index 3ca7953c13..67b0a4bb60 100644
--- a/ext/tk/lib/tk/macpkg.rb
+++ b/ext/tk/lib/tk/macpkg.rb
@@ -23,9 +23,7 @@ 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)
+Tk.__set_toplevel_aliases__(:Tk, Tk::MacResource, :TkMacResource)
module Tk::MacResource
extend Tk
diff --git a/ext/tk/lib/tk/menu.rb b/ext/tk/lib/tk/menu.rb
index bcd250026d..3ae0548dd1 100644
--- a/ext/tk/lib/tk/menu.rb
+++ b/ext/tk/lib/tk/menu.rb
@@ -33,14 +33,13 @@ module TkMenuEntryConfig
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 :itemcget, :itemcget_strict
private :itemconfigure, :itemconfiginfo, :current_itemconfiginfo
end
@@ -51,7 +50,7 @@ class Tk::Menu<TkWindow
TkCommandNames = ['menu'.freeze].freeze
WidgetClassName = 'Menu'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
#def create_self(keys)
# if keys and keys != None
@@ -156,13 +155,13 @@ class Tk::Menu<TkWindow
_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),
+ 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),
+ 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))
@@ -171,7 +170,7 @@ class Tk::Menu<TkWindow
end
def popup(x, y, index=nil)
if index
- tk_call_without_enc('tk_popup', path, x, y,
+ tk_call_without_enc('tk_popup', path, x, y,
_get_eval_enc_str(index))
else
tk_call_without_enc('tk_popup', path, x, y)
@@ -215,7 +214,7 @@ class Tk::Menu<TkWindow
def entrycget(index, key)
case key.to_s
when 'text', 'label', 'show'
- _fromUTF8(tk_send_without_enc('entrycget',
+ _fromUTF8(tk_send_without_enc('entrycget',
_get_eval_enc_str(index), "-#{key}"))
when 'font', 'kanjifont'
#fnt = tk_tcl2ruby(tk_send('entrycget', index, "-#{key}"))
@@ -235,20 +234,20 @@ class Tk::Menu<TkWindow
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] ||
+ 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),
+ 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 ||
+ if (key == 'font' || key == :font ||
+ key == 'kanjifont' || key == :kanjifont ||
+ key == 'latinfont' || key == :latinfont ||
key == 'asciifont' || key == :asciifont )
if val == None
tagfontobj(index)
@@ -285,16 +284,16 @@ class Tk::Menu<TkWindow
else
if conf[3]
if conf[3].index('{')
- conf[3] = tk_split_list(conf[3])
+ conf[3] = tk_split_list(conf[3])
else
- conf[3] = tk_tcl2ruby(conf[3])
+ conf[3] = tk_tcl2ruby(conf[3])
end
end
if conf[4]
if conf[4].index('{')
- conf[4] = tk_split_list(conf[4])
+ conf[4] = tk_split_list(conf[4])
else
- conf[4] = tk_tcl2ruby(conf[4])
+ conf[4] = tk_tcl2ruby(conf[4])
end
end
end
@@ -332,16 +331,16 @@ class Tk::Menu<TkWindow
else
if conf[2]
if conf[2].index('{')
- conf[2] = tk_split_list(conf[2])
+ conf[2] = tk_split_list(conf[2])
else
- conf[2] = tk_tcl2ruby(conf[2])
+ conf[2] = tk_tcl2ruby(conf[2])
end
end
if conf[3]
if conf[3].index('{')
- conf[3] = tk_split_list(conf[3])
+ conf[3] = tk_split_list(conf[3])
else
- conf[3] = tk_tcl2ruby(conf[3])
+ conf[3] = tk_tcl2ruby(conf[3])
end
end
end
@@ -387,32 +386,8 @@ class Tk::Menu<TkWindow
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
+Tk.__set_toplevel_aliases__(:Tk, Tk::Menu, :TkMenu)
- 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
@@ -471,9 +446,7 @@ 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)
+Tk.__set_toplevel_aliases__(:Tk, Tk::MenuClone, :TkMenuClone, :TkCloneMenu)
module Tk::SystemMenu
def initialize(parent, keys=nil)
@@ -507,9 +480,7 @@ class Tk::SysMenu_Help<Tk::Menu
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)
+Tk.__set_toplevel_aliases__(:Tk, Tk::SysMenu_Help, :TkSysMenu_Help)
class Tk::SysMenu_System<Tk::Menu
@@ -518,9 +489,7 @@ class Tk::SysMenu_System<Tk::Menu
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)
+Tk.__set_toplevel_aliases__(:Tk, Tk::SysMenu_System, :TkSysMenu_System)
class Tk::SysMenu_Apple<Tk::Menu
@@ -529,31 +498,29 @@ class Tk::SysMenu_Apple<Tk::Menu
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)
+Tk.__set_toplevel_aliases__(:Tk, Tk::SysMenu_Apple, :TkSysMenu_Apple)
class Tk::Menubutton<Tk::Label
TkCommandNames = ['menubutton'.freeze].freeze
WidgetClassName = 'Menubutton'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ 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,
+ tk_call_without_enc(self.class::TkCommandNames[0], @path,
*hash_kv(keys, true))
else
begin
- tk_call_without_enc(self.class::TkCommandNames[0], @path,
+ 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,
+ tk_call_without_enc(self.class::TkCommandNames[0], @path,
*hash_kv(keys, true))
end
end
@@ -574,9 +541,7 @@ 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)
+Tk.__set_toplevel_aliases__(:Tk, Tk::Menubutton, :TkMenubutton, :TkMenuButton)
class Tk::OptionMenubutton<Tk::Menubutton
@@ -604,17 +569,17 @@ class Tk::OptionMenubutton<Tk::Menubutton
keys = _symbolkey2str(keys)
parent = nil
- if !args.empty? && (args[0].kind_of?(TkWindow) || args[0] == nil)
+ if args[0].kind_of?(TkWindow) || args[0] == nil
keys.delete('parent') # ignore
- parent = args.shift
+ parent = args.shift
else
parent = keys.delete('parent')
end
@variable = nil
- if !args.empty? && (args[0].kind_of?(TkVariable) || args[0] == nil)
+ if args[0].kind_of?(TkVariable) || args[0] == nil
keys.delete('variable') # ignore
- @variable = args.shift
+ @variable = args.shift
else
@variable = keys.delete('variable')
end
@@ -628,7 +593,7 @@ class Tk::OptionMenubutton<Tk::Menubutton
end
install_win(if parent then parent.path end)
- @menu = OptionMenu.new(tk_call('tk_optionMenu',
+ @menu = OptionMenu.new(tk_call('tk_optionMenu',
@path, @variable.id, *args))
configure(keys) if keys
@@ -647,7 +612,7 @@ class Tk::OptionMenubutton<Tk::Menubutton
self
end
def add(value)
- @menu.add('radiobutton', 'variable'=>@variable,
+ @menu.add('radiobutton', 'variable'=>@variable,
'label'=>value, 'value'=>value)
self
end
@@ -658,7 +623,7 @@ class Tk::OptionMenubutton<Tk::Menubutton
@menu.invoke(index)
end
def insert(index, value)
- @menu.insert(index, 'radiobutton', 'variable'=>@variable,
+ @menu.insert(index, 'radiobutton', 'variable'=>@variable,
'label'=>value, 'value'=>value)
self
end
@@ -712,7 +677,5 @@ 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)
+Tk.__set_toplevel_aliases__(:Tk, Tk::OptionMenubutton,
+ :TkOptionMenubutton, :TkOptionMenuButton)
diff --git a/ext/tk/lib/tk/menubar.rb b/ext/tk/lib/tk/menubar.rb
index 9d5571c470..ef9da809b9 100644
--- a/ext/tk/lib/tk/menubar.rb
+++ b/ext/tk/lib/tk/menubar.rb
@@ -2,7 +2,7 @@
# tk/menubar.rb
#
# Original version:
-# Copyright (C) 1998 maeda shugo. All rights reserved.
+# Copyright (C) 1998 maeda shugo. All rights reserved.
# This file can be distributed under the terms of the Ruby.
# Usage:
@@ -52,18 +52,18 @@
# {:label=>'Open', :command=>proc{puts('Open clicked')}, :underline=>0},
# '---',
# ['Check_A', TkVariable.new(true), 6],
-# {:type=>'checkbutton', :label=>'Check_B',
+# {: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],
+# ['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]],
@@ -92,31 +92,25 @@ require 'tk/menuspec'
class TkMenubar<Tk::Frame
include TkComposite
include TkMenuSpec
-
- def initialize(parent = nil, spec = nil, options = {})
+
+ def initialize(parent = nil, spec = nil, options = nil)
if parent.kind_of? Hash
- options = parent
- parent = nil
- spec = (options.has_key?('spec'))? options.delete('spec'): nil
+ options = _symbolkey2str(parent)
+ spec = options.delete('spec')
+ super(options)
+ else
+ super(parent, options)
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
+
+ spec.each{|info| add_menu(info)} 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)
+ def add_menu(menu_info)
+ mbtn, menu = _create_menubutton(@frame, menu_info)
submenus = _get_cascade_menus(menu).flatten
@@ -130,7 +124,7 @@ class TkMenubar<Tk::Frame
delegate('font', mbtn, menu, *submenus)
delegate('kanjifont', mbtn, menu, *submenus)
end
-
+
def [](index)
return @menus[index]
end
diff --git a/ext/tk/lib/tk/menuspec.rb b/ext/tk/lib/tk/menuspec.rb
index 9521a157d9..2a2eb9ba3c 100644
--- a/ext/tk/lib/tk/menuspec.rb
+++ b/ext/tk/lib/tk/menuspec.rb
@@ -3,50 +3,35 @@
# Hidethoshi NAGAI (nagai@ai.kyutech.ac.jp)
#
# based on tkmenubar.rb :
-# Copyright (C) 1998 maeda shugo. All rights reserved.
+# 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, ... ]
+# [ menu_info, menu_info, ... ]
#
-# The format of the menubutton_info is:
-# [ menubutton_info, entry_info, entry_info, ... ]
-#
-# And each format of *_info is:
+# And the format of the menu_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],
+# [label, [TkVar_obj, value],
# underline, accelerator, configs], # radiobutton entry
-# [label, [[...menu_info...], [...menu_info...], ...],
+# [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',
+# 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
+# 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)
@@ -54,11 +39,7 @@
# to the configs of the cascade entry.
module TkMenuSpec
- extend TkMenuSpec
-
- MENUSPEC_OPTKEYS = [ 'layout_proc' ]
-
- def _create_menu(parent, menu_info, menu_name = nil,
+ def _create_menu(parent, menu_info, menu_name = nil,
tearoff = false, default_opts = nil)
if tearoff.kind_of?(Hash)
default_opts = tearoff
@@ -78,7 +59,6 @@ module TkMenuSpec
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)
@@ -100,27 +80,10 @@ module TkMenuSpec
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,
+ 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)
@@ -154,7 +117,7 @@ module TkMenuSpec
menu_config = opts.delete('menu_config') || {}
menu_opts.update(_symbolkey2str(menu_config))
end
- submenu = _create_menu(menu, item_info[1], menu_name,
+ submenu = _create_menu(menu, item_info[1], menu_name,
tearoff, menu_opts)
options['menu'] = submenu
end
@@ -175,25 +138,6 @@ module TkMenuSpec
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
@@ -211,7 +155,7 @@ module TkMenuSpec
def _use_menubar?(parent)
use_menubar = false
if parent.kind_of?(Tk::Root) || parent.kind_of?(Tk::Toplevel)
- true
+ true
elsif parent.current_configinfo.has_key?('menu')
true
else
@@ -233,7 +177,7 @@ module TkMenuSpec
end
private :_create_menu_for_menubar
- def _create_menubutton(parent, menu_info, tearoff=false, default_opts = {})
+ def _create_menubutton(parent, menu_info, tearoff=false, default_opts = nil)
btn_info = menu_info[0]
if tearoff.kind_of?(Hash)
@@ -242,49 +186,14 @@ module TkMenuSpec
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
+ keys = _symbolkey2str(default_opts)
+ else
+ keys = {}
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
+ if _use_menubar?(parent)
# menubar by menu entries
mbar = _create_menu_for_menubar(parent)
@@ -293,57 +202,19 @@ module TkMenuSpec
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
-
+ keys['label'] = keys.delete('text') if keys.key?('text')
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
-
+ keys['underline'] = btn_info[1] if btn_info[1]
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,
+ menu = _create_menu(mbar, menu_info[1..-1], menu_name,
tearoff, default_opts)
menu.tearoff(tearoff)
@@ -363,42 +234,9 @@ module TkMenuSpec
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
+ keys['text'] = keys.delete('label') if keys.key?('label')
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]
@@ -407,41 +245,22 @@ module TkMenuSpec
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,
+ mbtn.pack('side' => 'left')
+
+ 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|
diff --git a/ext/tk/lib/tk/message.rb b/ext/tk/lib/tk/message.rb
index 5f73b3066f..946b68c704 100644
--- a/ext/tk/lib/tk/message.rb
+++ b/ext/tk/lib/tk/message.rb
@@ -7,7 +7,7 @@ require 'tk/label'
class Tk::Message<Tk::Label
TkCommandNames = ['message'.freeze].freeze
WidgetClassName = 'Message'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
#def create_self(keys)
# if keys and keys != None
# tk_call_without_enc('message', @path, *hash_kv(keys, true))
@@ -19,6 +19,4 @@ class Tk::Message<Tk::Label
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)
+Tk.__set_toplevel_aliases__(:Tk, Tk::Message, :TkMessage)
diff --git a/ext/tk/lib/tk/mngfocus.rb b/ext/tk/lib/tk/mngfocus.rb
index a05fb94f8e..1a2049c8a8 100644
--- a/ext/tk/lib/tk/mngfocus.rb
+++ b/ext/tk/lib/tk/mngfocus.rb
@@ -8,8 +8,8 @@ module TkManageFocus
extend Tk
TkCommandNames = [
- 'tk_focusFollowMouse'.freeze,
- 'tk_focusNext'.freeze,
+ 'tk_focusFollowMouse'.freeze,
+ 'tk_focusNext'.freeze,
'tk_focusPrev'.freeze
].freeze
diff --git a/ext/tk/lib/tk/msgcat.rb b/ext/tk/lib/tk/msgcat.rb
index 4abbcad85e..162953f425 100644
--- a/ext/tk/lib/tk/msgcat.rb
+++ b/ext/tk/lib/tk/msgcat.rb
@@ -11,13 +11,13 @@ class TkMsgCatalog < TkObject
#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::mc'.freeze,
+ '::msgcat::mcmax'.freeze,
+ '::msgcat::mclocale'.freeze,
+ '::msgcat::mcpreferences'.freeze,
+ '::msgcat::mcload'.freeze,
+ '::msgcat::mcset'.freeze,
+ '::msgcat::mcmset'.freeze,
'::msgcat::mcunknown'.freeze
].freeze
@@ -36,7 +36,7 @@ class TkMsgCatalog < TkObject
MSGCAT_EXT = '.msg'
- UNKNOWN_CBTBL = TkUtil.untrust(Hash.new{|hash,key| hash[key] = {}})
+ UNKNOWN_CBTBL = Hash.new{|hash,key| hash[key] = {}}.taint
TkCore::INTERP.add_tk_procs('::msgcat::mcunknown', 'args', <<-'EOL')
if {[set st [catch {eval {ruby_cmd TkMsgCatalog callback} [namespace current] $args} ret]] != 0} {
@@ -69,10 +69,10 @@ class TkMsgCatalog < TkObject
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")) +
+ 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')
@@ -80,9 +80,9 @@ class TkMsgCatalog < TkObject
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") +
+ 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)
@@ -153,7 +153,7 @@ class TkMsgCatalog < TkObject
end
def translate(*args)
dst = args.collect{|src|
- @namespace.eval{tk_call_without_enc('::msgcat::mc',
+ @namespace.eval{tk_call_without_enc('::msgcat::mc',
_get_eval_string(src, true))}
}
Tk.UTF8_String(sprintf(*dst))
@@ -229,29 +229,29 @@ class TkMsgCatalog < TkObject
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(tk_call_without_enc('::msgcat::mcset',
- locale,
- _get_eval_string(src_str, true),
+ Tk.UTF8_String(tk_call_without_enc('::msgcat::mcset',
+ locale,
+ _get_eval_string(src_str, true),
trans_str))
else
- Tk.UTF8_String(tk_call_without_enc('::msgcat::mcset',
- locale,
+ Tk.UTF8_String(tk_call_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))
+ trans_str = Tk.UTF8_String(_toUTF8(trans_str, enc))
Tk.UTF8_String(@namespace.eval{
- tk_call_without_enc('::msgcat::mcset',
- locale,
- _get_eval_string(src_str, true),
+ tk_call_without_enc('::msgcat::mcset',
+ locale,
+ _get_eval_string(src_str, true),
trans_str)
})
else
Tk.UTF8_String(@namespace.eval{
- tk_call_without_enc('::msgcat::mcset',
- locale,
+ tk_call_without_enc('::msgcat::mcset',
+ locale,
_get_eval_string(src_str, true))})
end
end
@@ -261,7 +261,7 @@ class TkMsgCatalog < TkObject
list = []
trans_list.each{|src, trans|
if trans && trans != None
- list << _get_eval_string(src, true)
+ list << _get_eval_string(src, true)
list << Tk.UTF8_Stirng(_toUTF8(trans, enc))
else
list << _get_eval_string(src, true) << ''
@@ -274,7 +274,7 @@ class TkMsgCatalog < TkObject
list = []
trans_list.each{|src, trans|
if trans && trans != None
- list << _get_eval_string(src, true)
+ list << _get_eval_string(src, true)
list << Tk.UTF8_String(_toUTF8(trans, enc))
else
list << _get_eval_string(src, true) << ''
diff --git a/ext/tk/lib/tk/namespace.rb b/ext/tk/lib/tk/namespace.rb
index 4af891995e..20a8d65215 100644
--- a/ext/tk/lib/tk/namespace.rb
+++ b/ext/tk/lib/tk/namespace.rb
@@ -8,12 +8,12 @@ class TkNamespace < TkObject
extend Tk
TkCommandNames = [
- 'namespace'.freeze,
+ 'namespace'.freeze,
].freeze
Tk_Namespace_ID_TBL = TkCore::INTERP.create_table
- (Tk_Namespace_ID = ["ns".freeze, TkUtil.untrust("00000")]).instance_eval{
+ (Tk_Namespace_ID = ["ns".freeze, "00000".taint]).instance_eval{
@mutex = Mutex.new
def mutex; @mutex; end
freeze
@@ -46,7 +46,7 @@ class TkNamespace < TkObject
private :__config_cmd
def __configinfo_struct
- {:key=>0, :alias=>nil, :db_name=>nil, :db_class=>nil,
+ {:key=>0, :alias=>nil, :db_name=>nil, :db_class=>nil,
:default_value=>nil, :current_value=>2}
end
private :__configinfo_struct
@@ -122,8 +122,8 @@ class TkNamespace < TkObject
if TkComm::GET_CONFIGINFO_AS_ARRAY
Tk_Namespace_ID_TBL.mutex.synchronize{
- info.map!{|inf|
- if inf[0] == 'namespace' &&
+ 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
@@ -160,19 +160,19 @@ class TkNamespace < TkObject
def tk_call(*args)
#super('namespace', 'eval', @namespace, *args)
args = args.collect{|arg| (s = _get_eval_string(arg, true))? s: ''}
- super('namespace', 'eval', @namespace,
+ 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,
+ 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,
+ super('namespace', 'eval', @namespace,
TkCore::INTERP._merge_tklist(*args))
end
@@ -223,19 +223,19 @@ class TkNamespace < TkObject
def tk_call(*args)
#super('namespace', 'eval', @fullname, *args)
args = args.collect{|arg| (s = _get_eval_string(arg, true))? s: ''}
- super('namespace', 'eval', @fullname,
+ 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,
+ 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,
+ super('namespace', 'eval', @fullname,
TkCore::INTERP._merge_tklist(*args))
end
alias ns_tk_call tk_call
@@ -318,7 +318,7 @@ class TkNamespace < TkObject
else
fail ArgumentError, "String or Proc is expected"
end
- TkNamespace::NsCode.new(tk_call_without_enc('namespace', 'code',
+ TkNamespace::NsCode.new(tk_call_without_enc('namespace', 'code',
_get_eval_string(cmd, false)))
end
=end
@@ -350,8 +350,8 @@ class TkNamespace < TkObject
else
fail ArgumentError, "String or Proc is expected"
end
- TkNamespace::NsCode.new(tk_call_without_enc('namespace', 'code',
- _get_eval_string(cmd, false)),
+ TkNamespace::NsCode.new(tk_call_without_enc('namespace', 'code',
+ _get_eval_string(cmd, false)),
true)
end
diff --git a/ext/tk/lib/tk/optiondb.rb b/ext/tk/lib/tk/optiondb.rb
index 0f3be30ff7..186811d37d 100644
--- a/ext/tk/lib/tk/optiondb.rb
+++ b/ext/tk/lib/tk/optiondb.rb
@@ -8,7 +8,7 @@ module TkOptionDB
extend Tk
TkCommandNames = ['option'.freeze].freeze
- (CmdClassID = ['CMD_CLASS'.freeze, TkUtil.untrust('00000')]).instance_eval{
+ (CmdClassID = ['CMD_CLASS'.freeze, '00000'.taint]).instance_eval{
@mutex = Mutex.new
def mutex; @mutex; end
freeze
@@ -44,7 +44,7 @@ module TkOptionDB
def read_entries(file, f_enc=nil)
if TkCore::INTERP.safe?
- fail SecurityError,
+ fail SecurityError,
"can't call 'TkOptionDB.read_entries' on a safe interpreter"
end
@@ -86,7 +86,7 @@ module TkOptionDB
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|
@@ -136,7 +136,7 @@ module TkOptionDB
@@resource_proc_class.const_set(:CARRIER, '.'.freeze)
- @@resource_proc_class.instance_variable_set('@method_tbl',
+ @@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)
@@ -144,7 +144,7 @@ module TkOptionDB
class << @@resource_proc_class
private :new
-=begin
+=begin
CARRIER = '.'.freeze
METHOD_TBL = TkCore::INTERP.create_table
ADD_METHOD = false
@@ -171,7 +171,7 @@ module TkOptionDB
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.
+ # Please define this in the block given to 'new_proc_class' method.
str
end
@@ -186,20 +186,20 @@ module TkOptionDB
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,
+ 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{
+ 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:/,
+ raise SyntaxError,
+ TkCore::INTERP._toUTF8(err.message.gsub(/\(eval\):\d:/,
"(#{id.id2name}):"))
end
}.call
@@ -291,7 +291,7 @@ module TkOptionDB
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|
+ func.each{|f|
cmd_klass.instance_variable_get('@method_tbl')[f.to_s.intern] = nil
}
=begin
@@ -310,14 +310,14 @@ module TkOptionDB
# 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,
+ [ :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)
@@ -331,7 +331,7 @@ module TkOptionDB
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],
+ 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{
@@ -344,9 +344,9 @@ module TkOptionDB
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.
+ # 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?
@@ -357,7 +357,7 @@ module TkOptionDB
module_function :new_proc_class
def eval_under_random_base(parent = nil, &b)
- new_klass = __create_new_class(__get_random_basename(),
+ 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)
diff --git a/ext/tk/lib/tk/optionobj.rb b/ext/tk/lib/tk/optionobj.rb
index 29b06da0eb..8fe7e0ee5a 100644
--- a/ext/tk/lib/tk/optionobj.rb
+++ b/ext/tk/lib/tk/optionobj.rb
@@ -1,10 +1,10 @@
#
# 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.
+# 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})
+# e.g. hash_kv({'aaa'=>1, 'bbb'=>Tk::None, 'ccc'=>3})
# => ["-aaa", 1, "-bbb", "-ccc", 3]
#
require 'tk'
@@ -36,7 +36,7 @@ module Tk
def _remove_win(win)
if win.kind_of?(Array)
widget, method = win
- @observ.delete_if{|x|
+ @observ.delete_if{|x|
if x.kind_of?(Array)
x[0] == widget
else
@@ -56,15 +56,15 @@ module Tk
private :_remove_win
def assign(*wins)
- # win :=
+ # win :=
# widget #==> call widget.configure(hash)
# [widget] #==> call widget.configure(hash)
# [widget, nil, {src=>target, ... }]
- # #==> call widget.configure(hash)
+ # #==> call widget.configure(hash)
# with converting hash-key
# [widget, method] #==> call widget.method(hash)
# [widget, method, {src=>target, ... }]
- # #==> call widget.method(hash)
+ # #==> call widget.method(hash)
# with converting hash-key
# [widget [receiver, method, arg, ... ]]
# #==> call receiver.method(arg, ... , hash)
@@ -74,7 +74,7 @@ module Tk
#
# src := option_name_on_optobj
#
- # target :=
+ # target :=
# nil #==> not use the src
# option_name_on_target_widget
# [ option_name_on_target_widget, ... ]
@@ -123,7 +123,7 @@ module Tk
next unless key
if key.kind_of?(Array)
key.each{|k| hash[k] = val}
- else
+ else
hash[key] = val
end
}
diff --git a/ext/tk/lib/tk/palette.rb b/ext/tk/lib/tk/palette.rb
index 9462bb0667..2d08d50f6a 100644
--- a/ext/tk/lib/tk/palette.rb
+++ b/ext/tk/lib/tk/palette.rb
@@ -9,8 +9,8 @@ module TkPalette
extend Tk
TkCommandNames = [
- 'tk_setPalette'.freeze,
- 'tk_bisque'.freeze,
+ 'tk_setPalette'.freeze,
+ 'tk_bisque'.freeze,
'tkDarken'.freeze
].freeze
diff --git a/ext/tk/lib/tk/panedwindow.rb b/ext/tk/lib/tk/panedwindow.rb
index 04407802ea..030144e677 100644
--- a/ext/tk/lib/tk/panedwindow.rb
+++ b/ext/tk/lib/tk/panedwindow.rb
@@ -6,7 +6,7 @@ require 'tk'
class Tk::PanedWindow<TkWindow
TkCommandNames = ['panedwindow'.freeze].freeze
WidgetClassName = 'Panedwindow'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
#def create_self(keys)
# if keys and keys != None
# tk_call_without_enc('panedwindow', @path, *hash_kv(keys, true))
@@ -128,10 +128,10 @@ class Tk::PanedWindow<TkWindow
# win = win.epath if win.kind_of?(TkObject)
win = _epath(win)
if key
- #conf = tk_split_list(tk_send_without_enc('paneconfigure',
+ #conf = tk_split_list(tk_send_without_enc('paneconfigure',
# win, "-#{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'
@@ -140,10 +140,10 @@ class Tk::PanedWindow<TkWindow
end
conf
else
- #tk_split_simplelist(tk_send_without_enc('paneconfigure',
+ #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),
+ 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]
@@ -151,18 +151,18 @@ class Tk::PanedWindow<TkWindow
if conf[0] == 'hide'
conf[3] = bool(conf[3]) unless conf[3].empty?
elsif conf[3].index('{')
- conf[3] = tk_split_list(conf[3])
+ conf[3] = tk_split_list(conf[3])
else
- conf[3] = tk_tcl2ruby(conf[3])
+ 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])
+ conf[4] = tk_split_list(conf[4])
else
- conf[4] = tk_tcl2ruby(conf[4])
+ conf[4] = tk_tcl2ruby(conf[4])
end
end
conf[1] = conf[1][1..-1] if conf.size == 2 # alias info
@@ -173,10 +173,10 @@ class Tk::PanedWindow<TkWindow
# win = win.epath if win.kind_of?(TkObject)
win = _epath(win)
if key
- #conf = tk_split_list(tk_send_without_enc('paneconfigure',
+ #conf = tk_split_list(tk_send_without_enc('paneconfigure',
# win, "-#{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'
@@ -186,10 +186,10 @@ class Tk::PanedWindow<TkWindow
{ key => conf }
else
ret = {}
- #tk_split_simplelist(tk_send_without_enc('paneconfigure',
+ #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),
+ 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]
@@ -197,18 +197,18 @@ class Tk::PanedWindow<TkWindow
if key == 'hide'
conf[2] = bool(conf[2]) unless conf[2].empty?
elsif conf[2].index('{')
- conf[2] = tk_split_list(conf[2])
+ conf[2] = tk_split_list(conf[2])
else
- conf[2] = tk_tcl2ruby(conf[2])
+ 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])
+ conf[3] = tk_split_list(conf[3])
else
- conf[3] = tk_tcl2ruby(conf[3])
+ conf[3] = tk_tcl2ruby(conf[3])
end
end
if conf.size == 1
@@ -254,7 +254,5 @@ 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)
+Tk.__set_toplevel_aliases__(:Tk, Tk::PanedWindow,
+ :TkPanedWindow, :TkPanedwindow)
diff --git a/ext/tk/lib/tk/place.rb b/ext/tk/lib/tk/place.rb
index 109d866fda..f7ebdfcbd6 100644
--- a/ext/tk/lib/tk/place.rb
+++ b/ext/tk/lib/tk/place.rb
@@ -35,9 +35,9 @@ module TkPlace
# win = win.epath if win.kind_of?(TkObject)
win = _epath(win)
if slot
- #conf = tk_split_list(tk_call_without_enc('place', 'configure',
+ #conf = tk_split_list(tk_call_without_enc('place', 'configure',
# win, "-#{slot}") )
- conf = tk_split_simplelist(tk_call_without_enc('place', 'configure',
+ conf = tk_split_simplelist(tk_call_without_enc('place', 'configure',
win, "-#{slot}") )
conf[0] = conf[0][1..-1]
conf[1] = tk_tcl2ruby(conf[1])
@@ -46,7 +46,7 @@ module TkPlace
conf[4] = tk_tcl2ruby(conf[1])
conf
else
- tk_split_simplelist(tk_call_without_enc('place', 'configure',
+ tk_split_simplelist(tk_call_without_enc('place', 'configure',
win)).collect{|conflist|
#conf = list(conflist)
conf = simplelist(conflist).collect!{|inf| tk_tcl2ruby(inf)}
@@ -63,16 +63,16 @@ module TkPlace
# win = win.epath if win.kind_of?(TkObject)
win = _epath(win)
if slot
- #conf = tk_split_list(tk_call_without_enc('place', 'configure',
+ #conf = tk_split_list(tk_call_without_enc('place', 'configure',
# win, "-#{slot}") )
- conf = tk_split_simplelist(tk_call_without_enc('place', 'configure',
+ 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',
+ tk_split_simplelist(tk_call_without_enc('place', 'configure',
win)).each{|conf_list|
#ret[conf[0][1..-1]] = conf[1]
conf = simplelist(conf_list)
diff --git a/ext/tk/lib/tk/radiobutton.rb b/ext/tk/lib/tk/radiobutton.rb
index 627df6d9cf..1f864ec06b 100644
--- a/ext/tk/lib/tk/radiobutton.rb
+++ b/ext/tk/lib/tk/radiobutton.rb
@@ -7,7 +7,7 @@ require 'tk/button'
class Tk::RadioButton<Tk::Button
TkCommandNames = ['radiobutton'.freeze].freeze
WidgetClassName = 'Radiobutton'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
#def create_self(keys)
# if keys and keys != None
# tk_call_without_enc('radiobutton', @path, *hash_kv(keys, true))
@@ -67,7 +67,5 @@ 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)
+Tk.__set_toplevel_aliases__(:Tk, Tk::RadioButton,
+ :TkRadioButton, :TkRadiobutton)
diff --git a/ext/tk/lib/tk/root.rb b/ext/tk/lib/tk/root.rb
index b4f0bd107f..7237b4c614 100644
--- a/ext/tk/lib/tk/root.rb
+++ b/ext/tk/lib/tk/root.rb
@@ -16,7 +16,7 @@ class Tk::Root<TkWindow
def Root.new(keys=nil, &b)
unless TkCore::INTERP.tk_windows['.']
- TkCore::INTERP.tk_windows['.'] =
+ TkCore::INTERP.tk_windows['.'] =
super(:without_creating=>true, :widgetname=>'.'){}
end
root = TkCore::INTERP.tk_windows['.']
@@ -52,7 +52,7 @@ class Tk::Root<TkWindow
end
WidgetClassName = 'Tk'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
def self.to_eval
# self::WidgetClassName
@@ -70,8 +70,8 @@ class Tk::Root<TkWindow
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.
+ # 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
@@ -82,7 +82,7 @@ class Tk::Root<TkWindow
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.
+ # Configs of menu_spec can override it.
menu_spec.each{|info| add_menu(info, tearoff, opts)}
self.menu
end
diff --git a/ext/tk/lib/tk/scale.rb b/ext/tk/lib/tk/scale.rb
index 0bdcead7f2..7e758d92f4 100644
--- a/ext/tk/lib/tk/scale.rb
+++ b/ext/tk/lib/tk/scale.rb
@@ -6,7 +6,7 @@ require 'tk'
class Tk::Scale<TkWindow
TkCommandNames = ['scale'.freeze].freeze
WidgetClassName = 'Scale'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
def create_self(keys)
if keys and keys != None
@@ -16,11 +16,11 @@ class Tk::Scale<TkWindow
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,
+ tk_call_without_enc(self.class::TkCommandNames[0], @path,
*hash_kv(keys, true))
else
begin
- tk_call_without_enc(self.class::TkCommandNames[0], @path,
+ tk_call_without_enc(self.class::TkCommandNames[0], @path,
*hash_kv(keys, true))
rescue
tk_call_without_enc(self.class::TkCommandNames[0], @path)
@@ -33,7 +33,7 @@ class Tk::Scale<TkWindow
configure(keys)
else
# re-create widget
- tk_call_without_enc(self.class::TkCommandNames[0], @path,
+ tk_call_without_enc(self.class::TkCommandNames[0], @path,
*hash_kv(keys, true))
end
end
@@ -69,7 +69,7 @@ class Tk::Scale<TkWindow
def configure(slot, value=None)
if (slot == 'command' || slot == :command)
configure('command'=>value)
- elsif slot.kind_of?(Hash) &&
+ elsif slot.kind_of?(Hash) &&
(slot.key?('command') || slot.key?(:command))
slot = _symbolkey2str(slot)
slot['command'] = _wrap_command_arg(slot.delete('command'))
@@ -108,5 +108,4 @@ class Tk::Scale<TkWindow
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)
+Tk.__set_toplevel_aliases__(:Tk, Tk::Scale, :TkScale)
diff --git a/ext/tk/lib/tk/scrollbar.rb b/ext/tk/lib/tk/scrollbar.rb
index c0ac201acb..87db46a9f9 100644
--- a/ext/tk/lib/tk/scrollbar.rb
+++ b/ext/tk/lib/tk/scrollbar.rb
@@ -6,11 +6,11 @@ require 'tk'
class Tk::Scrollbar<TkWindow
TkCommandNames = ['scrollbar'.freeze].freeze
WidgetClassName = 'Scrollbar'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
def create_self(keys)
@assigned = []
- @scroll_proc = proc{|*args|
+ @scroll_proc = proc{|*args|
if self.orient == 'horizontal'
@assigned.each{|w| w.xview(*args)}
else # 'vertical'
@@ -21,11 +21,11 @@ class Tk::Scrollbar<TkWindow
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,
+ tk_call_without_enc(self.class::TkCommandNames[0], @path,
*hash_kv(keys, true))
else
begin
- tk_call_without_enc(self.class::TkCommandNames[0], @path,
+ tk_call_without_enc(self.class::TkCommandNames[0], @path,
*hash_kv(keys, true))
rescue
tk_call_without_enc(self.class::TkCommandNames[0], @path)
@@ -38,7 +38,7 @@ class Tk::Scrollbar<TkWindow
configure(keys)
else
# re-create widget
- tk_call_without_enc(self.class::TkCommandNames[0], @path,
+ tk_call_without_enc(self.class::TkCommandNames[0], @path,
*hash_kv(keys, true))
end
end
@@ -148,9 +148,7 @@ class Tk::Scrollbar<TkWindow
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)
+Tk.__set_toplevel_aliases__(:Tk, Tk::Scrollbar, :TkScrollbar)
class Tk::XScrollbar<Tk::Scrollbar
@@ -163,9 +161,7 @@ class Tk::XScrollbar<Tk::Scrollbar
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)
+Tk.__set_toplevel_aliases__(:Tk, Tk::XScrollbar, :TkXScrollbar)
class Tk::YScrollbar<Tk::Scrollbar
@@ -178,6 +174,4 @@ class Tk::YScrollbar<Tk::Scrollbar
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)
+Tk.__set_toplevel_aliases__(:Tk, Tk::YScrollbar, :TkYScrollbar)
diff --git a/ext/tk/lib/tk/selection.rb b/ext/tk/lib/tk/selection.rb
index ba0a6f49f9..5caa6ef8ef 100644
--- a/ext/tk/lib/tk/selection.rb
+++ b/ext/tk/lib/tk/selection.rb
@@ -18,7 +18,7 @@ module TkSelection
end
def self.clear_on_display(win, sel=nil)
if sel
- tk_call_without_enc('selection', 'clear',
+ tk_call_without_enc('selection', 'clear',
'-displayof', win, '-selection', sel)
else
tk_call_without_enc('selection', 'clear', '-displayof', win)
@@ -35,7 +35,7 @@ module TkSelection
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',
+ _fromUTF8(tk_call_without_enc('selection', 'get', '-displayof',
win, *hash_kv(keys)))
end
def get(keys=nil)
@@ -65,7 +65,7 @@ module TkSelection
end
def self.get_owner_on_display(win, sel=nil)
if sel
- window(tk_call_without_enc('selection', 'own',
+ window(tk_call_without_enc('selection', 'own',
'-displayof', win, '-selection', sel))
else
window(tk_call_without_enc('selection', 'own', '-displayof', win))
diff --git a/ext/tk/lib/tk/spinbox.rb b/ext/tk/lib/tk/spinbox.rb
index f2917d60ca..34dc1904f7 100644
--- a/ext/tk/lib/tk/spinbox.rb
+++ b/ext/tk/lib/tk/spinbox.rb
@@ -8,20 +8,20 @@ require 'tk/entry'
class Tk::Spinbox<Tk::Entry
TkCommandNames = ['spinbox'.freeze].freeze
WidgetClassName = 'Spinbox'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
class SpinCommand < TkValidateCommand
class ValidateArgs < TkUtil::CallbackSubst
KEY_TBL = [
- [ ?d, ?s, :direction ],
- [ ?s, ?e, :current ],
- [ ?W, ?w, :widget ],
+ [ ?d, ?s, :direction ],
+ [ ?s, ?e, :current ],
+ [ ?W, ?w, :widget ],
nil
]
PROC_TBL = [
- [ ?s, TkComm.method(:string) ],
- [ ?w, TkComm.method(:window) ],
+ [ ?s, TkComm.method(:string) ],
+ [ ?w, TkComm.method(:window) ],
[ ?e, proc{|val|
#enc = Tk.encoding
@@ -32,7 +32,7 @@ class Tk::Spinbox<Tk::Entry
TkComm::string(val)
end
}
- ],
+ ],
nil
]
@@ -100,36 +100,13 @@ class Tk::Spinbox<Tk::Entry
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
+ tk_send_without_enc('invoke', 'spinup')
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
+ tk_send_without_enc('invoke', 'spindown')
self
end
@@ -139,6 +116,4 @@ class Tk::Spinbox<Tk::Entry
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)
+Tk.__set_toplevel_aliases__(:Tk, Tk::Spinbox, :TkSpinbox)
diff --git a/ext/tk/lib/tk/text.rb b/ext/tk/lib/tk/text.rb
index bc2aa0a293..4ec82bed1d 100644
--- a/ext/tk/lib/tk/text.rb
+++ b/ext/tk/lib/tk/text.rb
@@ -29,9 +29,6 @@ module TkTextTagConfig
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
@@ -48,9 +45,6 @@ module TkTextTagConfig
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
@@ -67,7 +61,7 @@ module TkTextTagConfig
current_itemconfiginfo(['window', tagOrId], slot)
end
- private :itemcget_tkstring, :itemcget, :itemcget_strict
+ private :itemcget, :itemcget_strict
private :itemconfigure, :itemconfiginfo, :current_itemconfiginfo
end
@@ -257,7 +251,7 @@ class Tk::Text<TkTextWin
TkCommandNames = ['text'.freeze].freeze
WidgetClassName = 'Text'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
def self.new(*args, &block)
obj = super(*args){}
@@ -287,7 +281,7 @@ class Tk::Text<TkTextWin
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,
+ # tk_call_without_enc(self.class::TkCommandNames[0], @path,
# *hash_kv(keys, true))
#else
# #tk_call_without_enc('text', @path)
@@ -312,7 +306,7 @@ class Tk::Text<TkTextWin
end
def index(idx)
- Tk::Text::IndexString.new(tk_send_without_enc('index',
+ Tk::Text::IndexString.new(tk_send_without_enc('index',
_get_eval_enc_str(idx)))
end
@@ -381,7 +375,7 @@ class Tk::Text<TkTextWin
def mark_gravity(mark, direction=nil)
if direction
- tk_send_without_enc('mark', 'gravity',
+ tk_send_without_enc('mark', 'gravity',
_get_eval_enc_str(mark), direction)
self
else
@@ -390,27 +384,27 @@ class Tk::Text<TkTextWin
end
def mark_set(mark, index)
- tk_send_without_enc('mark', 'set', _get_eval_enc_str(mark),
+ 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',
+ 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',
+ 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',
+ tagid2obj(_fromUTF8(tk_send_without_enc('mark', 'previous',
_get_eval_enc_str(index))))
end
alias previous_mark mark_previous
@@ -418,11 +412,11 @@ class Tk::Text<TkTextWin
def image_cget_strict(index, slot)
case slot.to_s
when 'text', 'label', 'show', 'data', 'file'
- _fromUTF8(tk_send_without_enc('image', 'cget',
+ _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),
+ tk_tcl2ruby(_fromUTF8(tk_send_without_enc('image', 'cget',
+ _get_eval_enc_str(index),
"-#{slot}")))
end
end
@@ -451,13 +445,13 @@ class Tk::Text<TkTextWin
def image_configure(index, slot, value=None)
if slot.kind_of?(Hash)
- _fromUTF8(tk_send_without_enc('image', 'configure',
- _get_eval_enc_str(index),
+ _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}",
+ _fromUTF8(tk_send_without_enc('image', 'configure',
+ _get_eval_enc_str(index),
+ "-#{slot}",
_get_eval_enc_str(value)))
end
self
@@ -487,16 +481,16 @@ class Tk::Text<TkTextWin
else
if conf[3]
if conf[3].index('{')
- conf[3] = tk_split_list(conf[3])
+ conf[3] = tk_split_list(conf[3])
else
- conf[3] = tk_tcl2ruby(conf[3])
+ conf[3] = tk_tcl2ruby(conf[3])
end
end
if conf[4]
if conf[4].index('{')
- conf[4] = tk_split_list(conf[4])
+ conf[4] = tk_split_list(conf[4])
else
- conf[4] = tk_tcl2ruby(conf[4])
+ conf[4] = tk_tcl2ruby(conf[4])
end
end
end
@@ -528,16 +522,16 @@ class Tk::Text<TkTextWin
else
if conf[2]
if conf[2].index('{')
- conf[2] = tk_split_list(conf[2])
+ conf[2] = tk_split_list(conf[2])
else
- conf[2] = tk_tcl2ruby(conf[2])
+ conf[2] = tk_tcl2ruby(conf[2])
end
end
if conf[3]
if conf[3].index('{')
- conf[3] = tk_split_list(conf[3])
+ conf[3] = tk_split_list(conf[3])
else
- conf[3] = tk_tcl2ruby(conf[3])
+ conf[3] = tk_tcl2ruby(conf[3])
end
end
end
@@ -626,7 +620,7 @@ class Tk::Text<TkTextWin
end
def compare(idx1, op, idx2)
- bool(tk_send_without_enc('compare', _get_eval_enc_str(idx1),
+ bool(tk_send_without_enc('compare', _get_eval_enc_str(idx1),
op, _get_eval_enc_str(idx2)))
end
@@ -649,7 +643,7 @@ class Tk::Text<TkTextWin
def count_info(idx1, idx2, update=true)
# Tk8.5 feature
opts = [
- :chars, :displaychars, :displayindices, :displaylines,
+ :chars, :displaychars, :displayindices, :displaylines,
:indices, :lines, :xpixels, :ypixels
]
if update
@@ -743,8 +737,8 @@ class Tk::Text<TkTextWin
end
def tag_add(tag, index1, index2=None)
- tk_send_without_enc('tag', 'add', _get_eval_enc_str(tag),
- _get_eval_enc_str(index1),
+ tk_send_without_enc('tag', 'add', _get_eval_enc_str(tag),
+ _get_eval_enc_str(index1),
_get_eval_enc_str(index2))
self
end
@@ -752,15 +746,15 @@ class Tk::Text<TkTextWin
alias add_tag tag_add
def tag_delete(*tags)
- tk_send_without_enc('tag', 'delete',
+ 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)
+ TkTextTag::TTagID_TBL[@path].delete(tag.id)
else
- TkTextTag::TTagID_TBL[@path].delete(tag)
+ TkTextTag::TTagID_TBL[@path].delete(tag)
end
}
end
@@ -813,7 +807,7 @@ class Tk::Text<TkTextWin
def tag_cget(tag, key)
case key.to_s
when 'text', 'label', 'show', 'data', 'file'
- tk_call_without_enc(@path, 'tag', 'cget',
+ 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}"))
@@ -839,14 +833,14 @@ class Tk::Text<TkTextWin
|| key['latinfont'] || key['asciifont'] )
tagfont_configure(tag, key)
else
- tk_send_without_enc('tag', 'configure', _get_eval_enc_str(tag),
+ tk_send_without_enc('tag', 'configure', _get_eval_enc_str(tag),
*hash_kv(key, true))
end
else
- if key == 'font' || key == :font ||
+ if key == 'font' || key == :font ||
key == 'kanjifont' || key == :kanjifont ||
- key == 'latinfont' || key == :latinfont ||
+ key == 'latinfont' || key == :latinfont ||
key == 'asciifont' || key == :asciifont
if val == None
tagfontobj(tag)
@@ -854,7 +848,7 @@ class Tk::Text<TkTextWin
tagfont_configure(tag, {key=>val})
end
else
- tk_send_without_enc('tag', 'configure', _get_eval_enc_str(tag),
+ tk_send_without_enc('tag', 'configure', _get_eval_enc_str(tag),
"-#{key}", _get_eval_enc_str(val))
end
end
@@ -884,16 +878,16 @@ class Tk::Text<TkTextWin
else
if conf[3]
if conf[3].index('{')
- conf[3] = tk_split_list(conf[3])
+ conf[3] = tk_split_list(conf[3])
else
- conf[3] = tk_tcl2ruby(conf[3])
+ conf[3] = tk_tcl2ruby(conf[3])
end
end
if conf[4]
if conf[4].index('{')
- conf[4] = tk_split_list(conf[4])
+ conf[4] = tk_split_list(conf[4])
else
- conf[4] = tk_tcl2ruby(conf[4])
+ conf[4] = tk_tcl2ruby(conf[4])
end
end
end
@@ -932,16 +926,16 @@ class Tk::Text<TkTextWin
else
if conf[2]
if conf[2].index('{')
- conf[2] = tk_split_list(conf[2])
+ conf[2] = tk_split_list(conf[2])
else
- conf[2] = tk_tcl2ruby(conf[2])
+ conf[2] = tk_tcl2ruby(conf[2])
end
end
if conf[3]
if conf[3].index('{')
- conf[3] = tk_split_list(conf[3])
+ conf[3] = tk_split_list(conf[3])
else
- conf[3] = tk_tcl2ruby(conf[3])
+ conf[3] = tk_tcl2ruby(conf[3])
end
end
end
@@ -986,19 +980,19 @@ class Tk::Text<TkTextWin
=end
def tag_raise(tag, above=None)
- tk_send_without_enc('tag', 'raise', _get_eval_enc_str(tag),
+ 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),
+ 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),
+ tk_send_without_enc('tag', 'remove', _get_eval_enc_str(tag),
*(indices.collect{|idx| _get_eval_enc_str(idx)}))
self
end
@@ -1007,7 +1001,7 @@ class Tk::Text<TkTextWin
#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)),
+ _get_eval_enc_str(tag)),
false, true)
r = []
while key=l.shift
@@ -1017,18 +1011,18 @@ class Tk::Text<TkTextWin
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),
+ 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),
+ 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)
}
@@ -1038,7 +1032,7 @@ class Tk::Text<TkTextWin
def window_cget(index, slot)
case slot.to_s
when 'text', 'label', 'show', 'data', 'file'
- _fromUTF8(tk_send_without_enc('window', 'cget',
+ _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}"))
@@ -1082,12 +1076,12 @@ class Tk::Text<TkTextWin
slot['create'] = install_cmd(proc{_epath(p_create.call)})
end
end
- tk_send_without_enc('window', 'configure',
- _get_eval_enc_str(index),
+ tk_send_without_enc('window', 'configure',
+ _get_eval_enc_str(index),
*hash_kv(slot, true))
else
if slot == 'window' || slot == :window
- # id = value
+ # id = value
# value = id.epath if id.kind_of?(TkWindow)
value = _epath(value)
end
@@ -1107,8 +1101,8 @@ class Tk::Text<TkTextWin
value = install_cmd(proc{_epath(p_create.call)})
end
end
- tk_send_without_enc('window', 'configure',
- _get_eval_enc_str(index),
+ tk_send_without_enc('window', 'configure',
+ _get_eval_enc_str(index),
"-#{slot}", _get_eval_enc_str(value))
end
end
@@ -1135,16 +1129,16 @@ class Tk::Text<TkTextWin
else
if conf[3]
if conf[3].index('{')
- conf[3] = tk_split_list(conf[3])
+ conf[3] = tk_split_list(conf[3])
else
- conf[3] = tk_tcl2ruby(conf[3])
+ conf[3] = tk_tcl2ruby(conf[3])
end
end
if conf[4]
if conf[4].index('{')
- conf[4] = tk_split_list(conf[4])
+ conf[4] = tk_split_list(conf[4])
else
- conf[4] = tk_tcl2ruby(conf[4])
+ conf[4] = tk_tcl2ruby(conf[4])
end
end
end
@@ -1172,16 +1166,16 @@ class Tk::Text<TkTextWin
else
if conf[2]
if conf[2].index('{')
- conf[2] = tk_split_list(conf[2])
+ conf[2] = tk_split_list(conf[2])
else
- conf[2] = tk_tcl2ruby(conf[2])
+ conf[2] = tk_tcl2ruby(conf[2])
end
end
if conf[3]
if conf[3].index('{')
- conf[3] = tk_split_list(conf[3])
+ conf[3] = tk_split_list(conf[3])
else
- conf[3] = tk_tcl2ruby(conf[3])
+ conf[3] = tk_tcl2ruby(conf[3])
end
end
end
@@ -1237,11 +1231,11 @@ class Tk::Text<TkTextWin
# $KCODE == 'NONE'
if JAPANIZED_TK
- tk_call_without_enc('kstring', 'length',
+ tk_call_without_enc('kstring', 'length',
_get_eval_enc_str(txt)).to_i
else
begin
- tk_call_without_enc('encoding', 'convertto', 'ascii',
+ tk_call_without_enc('encoding', 'convertto', 'ascii',
_get_eval_enc_str(txt)).length
rescue StandardError, NameError
# sorry, I have no plan
@@ -1330,11 +1324,11 @@ class Tk::Text<TkTextWin
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"),
+ return [index(start + " + #{pos} chars"),
_ktext_length(pat), pat.dup]
else
#return [index(start + " + #{pos} chars"), $&.split('').length]
- return [index(start + " + #{pos} chars"),
+ return [index(start + " + #{pos} chars"),
_ktext_length(match), match]
end
else
@@ -1348,11 +1342,11 @@ class Tk::Text<TkTextWin
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"),
+ return [index(start + " + #{pos} chars"),
_ktext_length(pat), pat.dup]
else
#return [index(start + " + #{pos} chars"), $&.split('').length]
- return [index(start + " + #{pos} chars"),
+ return [index(start + " + #{pos} chars"),
_ktext_length(match), match]
end
else
@@ -1363,7 +1357,7 @@ class Tk::Text<TkTextWin
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"),
+ return [index("1.0 + #{pos} chars"),
_ktext_length(pat), pat.dup]
else
#return [index("1.0 + #{pos} chars"), $&.split('').length]
@@ -1453,7 +1447,7 @@ class Tk::Text<TkTextWin
idx = str.index(/ /, i)
result.push str[i..(idx-1)]
i = idx + 1
-
+
# retrieve value
case result[-1]
when 'text'
@@ -1511,7 +1505,7 @@ class Tk::Text<TkTextWin
break
end
end
-
+
kvis = []
until result.empty?
kvis.push [result.shift, result.shift, result.shift]
@@ -1576,8 +1570,7 @@ class Tk::Text<TkTextWin
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)
+Tk.__set_toplevel_aliases__(:Tk, Tk::Text, :TkText)
#######################################
@@ -1594,8 +1587,7 @@ class Tk::Text::Peer < Tk::Text
def create_self(keys)
if keys and keys != None
- tk_call_without_enc(@src_text.path, 'peer', 'create',
- @path, *hash_kv(keys, true))
+ tk_call_without_enc(@src_text.path, 'peer', 'create', @path)
else
tk_call_without_enc(@src_text.path, 'peer', 'create', @path)
end
diff --git a/ext/tk/lib/tk/textimage.rb b/ext/tk/lib/tk/textimage.rb
index 99027a06fb..fb306a9c17 100644
--- a/ext/tk/lib/tk/textimage.rb
+++ b/ext/tk/lib/tk/textimage.rb
@@ -16,19 +16,19 @@ class TkTextImage<TkObject
@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',
+ @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',
+ @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',
+ @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,
+ @id = tk_call_without_enc(@t.path, 'image', 'create', @index,
*hash_kv(keys, true)).freeze
@path.gravity = 'right'
end
@@ -78,7 +78,7 @@ class TkTextImage<TkObject
end
def image=(value)
- tk_call_without_enc(@t.path, 'image', 'configure', @index, '-image',
+ tk_call_without_enc(@t.path, 'image', 'configure', @index, '-image',
_get_eval_enc_str(value))
#self
value
diff --git a/ext/tk/lib/tk/textmark.rb b/ext/tk/lib/tk/textmark.rb
index d1888c5e54..72c1ce1ab4 100644
--- a/ext/tk/lib/tk/textmark.rb
+++ b/ext/tk/lib/tk/textmark.rb
@@ -9,7 +9,7 @@ class TkTextMark<TkObject
TMarkID_TBL = TkCore::INTERP.create_table
- (Tk_TextMark_ID = ['mark'.freeze, TkUtil.untrust('00000')]).instance_eval{
+ (Tk_TextMark_ID = ['mark'.freeze, '00000'.taint]).instance_eval{
@mutex = Mutex.new
def mutex; @mutex; end
freeze
@@ -25,7 +25,7 @@ class TkTextMark<TkObject
if TMarkID_TBL[tpath]
TMarkID_TBL[tpath][id]? TMarkID_TBL[tpath][id]: id
else
- id
+ id
end
}
end
@@ -46,7 +46,7 @@ class TkTextMark<TkObject
TMarkID_TBL[@tpath] = {} unless TMarkID_TBL[@tpath]
TMarkID_TBL[@tpath][@id] = self
}
- tk_call_without_enc(@t.path, 'mark', 'set', @id,
+ tk_call_without_enc(@t.path, 'mark', 'set', @id,
_get_eval_enc_str(index))
@t._addtag id, self
end
@@ -100,7 +100,7 @@ class TkTextMark<TkObject
end
def set(where)
- tk_call_without_enc(@t.path, 'mark', 'set', @id,
+ tk_call_without_enc(@t.path, 'mark', 'set', @id,
_get_eval_enc_str(where))
self
end
@@ -159,7 +159,7 @@ class TkTextNamedMark<TkTextMark
end
if obj && index
- tk_call_without_enc(parent.path, 'mark', 'set', name,
+ tk_call_without_enc(parent.path, 'mark', 'set', name,
_get_eval_enc_str(index))
end
obj
@@ -175,7 +175,7 @@ class TkTextNamedMark<TkTextMark
@parent = @t = parent
@tpath = parent.path
@path = @id = name
- tk_call_without_enc(@t.path, 'mark', 'set', @id,
+ tk_call_without_enc(@t.path, 'mark', 'set', @id,
_get_eval_enc_str(index)) if index
@t._addtag @id, self
end
diff --git a/ext/tk/lib/tk/texttag.rb b/ext/tk/lib/tk/texttag.rb
index 96692014e4..b08d923ea1 100644
--- a/ext/tk/lib/tk/texttag.rb
+++ b/ext/tk/lib/tk/texttag.rb
@@ -11,7 +11,7 @@ class TkTextTag<TkObject
TTagID_TBL = TkCore::INTERP.create_table
- (Tk_TextTag_ID = ['tag'.freeze, TkUtil.untrust('00000')]).instance_eval{
+ (Tk_TextTag_ID = ['tag'.freeze, '00000'.taint]).instance_eval{
@mutex = Mutex.new
def mutex; @mutex; end
freeze
@@ -26,7 +26,7 @@ class TkTextTag<TkObject
TTagID_TBL.mutex.synchronize{
if TTagID_TBL[tpath]
TTagID_TBL[tpath][id]? TTagID_TBL[tpath][id]: id
- else
+ else
id
end
}
@@ -84,13 +84,13 @@ class TkTextTag<TkObject
end
def add(*indices)
- tk_call_without_enc(@t.path, 'tag', 'add', @id,
+ 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,
+ tk_call_without_enc(@t.path, 'tag', 'remove', @id,
*(indices.collect{|idx| _get_eval_enc_str(idx)}))
self
end
@@ -105,16 +105,16 @@ class TkTextTag<TkObject
end
def nextrange(first, last=None)
- simplelist(tk_call_without_enc(@t.path, 'tag', 'nextrange', @id,
- _get_eval_enc_str(first),
+ 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),
+ 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)
}
@@ -129,9 +129,6 @@ class TkTextTag<TkObject
val
end
- def cget_tkstring(key)
- @t.tag_cget_tkstring @id, key
- end
def cget(key)
@t.tag_cget @id, key
end
@@ -145,7 +142,7 @@ class TkTextTag<TkObject
_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',
+ fnt = tk_tcl2ruby(_fromUTF8(tk_call_without_enc(@t.path, 'tag', 'cget',
@id, '-font')))
unless fnt.kind_of?(TkFont)
fnt = tagfontobj(@id, fnt)
@@ -157,7 +154,7 @@ class TkTextTag<TkObject
fnt
end
else
- tk_tcl2ruby(_fromUTF8(tk_call_without_enc(@t.path, 'tag', 'cget',
+ tk_tcl2ruby(_fromUTF8(tk_call_without_enc(@t.path, 'tag', 'cget',
@id, "-#{key}")))
end
end
@@ -230,13 +227,13 @@ class TkTextTag<TkObject
end
def raise(above=None)
- tk_call_without_enc(@t.path, 'tag', 'raise', @id,
+ 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,
+ tk_call_without_enc(@t.path, 'tag', 'lower', @id,
_get_eval_enc_str(below))
self
end
diff --git a/ext/tk/lib/tk/textwindow.rb b/ext/tk/lib/tk/textwindow.rb
index 49327b2c81..004422e4f3 100644
--- a/ext/tk/lib/tk/textwindow.rb
+++ b/ext/tk/lib/tk/textwindow.rb
@@ -13,14 +13,14 @@ class TkTextWindow<TkObject
#end
@t = parent
if index == 'end' || index == :end
- @path = TkTextMark.new(@t, tk_call_without_enc(@t.path, 'index',
+ @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',
+ @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',
+ @path = TkTextMark.new(@t, tk_call_without_enc(@t.path, 'index',
index.path))
end
else
@@ -49,7 +49,7 @@ class TkTextWindow<TkObject
keys['create'] = install_cmd(proc{@id = @p_create.call; _epath(@id)})
end
end
- tk_call_without_enc(@t.path, 'window', 'create', @index,
+ tk_call_without_enc(@t.path, 'window', 'create', @index,
*hash_kv(keys, true))
@path.gravity = 'right'
end
@@ -80,7 +80,7 @@ class TkTextWindow<TkObject
if slot.kind_of?(Hash)
slot = _symbolkey2str(slot)
if slot['window']
- @id = slot['window']
+ @id = slot['window']
# slot['window'] = @id.epath if @id.kind_of?(TkWindow)
slot['window'] = _epath(@id) if @id
end
@@ -88,19 +88,19 @@ class TkTextWindow<TkObject
self.create=slot.delete('create')
end
if slot.size > 0
- tk_call_without_enc(@t.path, 'window', 'configure', @index,
+ tk_call_without_enc(@t.path, 'window', 'configure', @index,
*hash_kv(slot, true))
end
else
if slot == 'window' || slot == :window
- @id = value
+ @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,
+ tk_call_without_enc(@t.path, 'window', 'configure', @index,
"-#{slot}", _get_eval_enc_str(value))
end
end
@@ -123,7 +123,7 @@ class TkTextWindow<TkObject
@id = value
# value = @id.epath if @id.kind_of?(TkWindow)
value = _epath(@id) if @id
- tk_call_without_enc(@t.path, 'window', 'configure', @index,
+ tk_call_without_enc(@t.path, 'window', 'configure', @index,
'-window', _get_eval_enc_str(value))
value
end
@@ -145,7 +145,7 @@ class TkTextWindow<TkObject
end
})
end
- tk_call_without_enc(@t.path, 'window', 'configure', @index,
+ tk_call_without_enc(@t.path, 'window', 'configure', @index,
'-create', _get_eval_enc_str(value))
value
end
diff --git a/ext/tk/lib/tk/timer.rb b/ext/tk/lib/tk/timer.rb
index be2a8919e4..91840d0575 100644
--- a/ext/tk/lib/tk/timer.rb
+++ b/ext/tk/lib/tk/timer.rb
@@ -11,13 +11,13 @@ class TkTimer
TkCommandNames = ['after'.freeze].freeze
- (Tk_CBID = ['a'.freeze, TkUtil.untrust('00000')]).instance_eval{
+ (Tk_CBID = ['a'.freeze, '00000'.taint]).instance_eval{
@mutex = Mutex.new
def mutex; @mutex; end
freeze
}
- Tk_CBTBL = TkUtil.untrust({})
+ Tk_CBTBL = {}.taint
TkCore::INTERP.add_tk_procs('rb_after', 'id', <<-'EOL')
if {[set st [catch {eval {ruby_cmd TkTimer callback} $id} ret]] != 0} {
@@ -76,7 +76,7 @@ class TkTimer
rescue Interrupt
exit!(1)
rescue Exception => e
- if @cancel_on_exception &&
+ if @cancel_on_exception &&
@cancel_on_exception.find{|exc| e.kind_of?(exc)}
cancel
@return_value = e
@@ -180,12 +180,12 @@ class TkTimer
@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).
+ # 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
@@ -229,7 +229,7 @@ class TkTimer
end
def current_status
- [@running, @current_sleep, @current_proc, @current_args,
+ [@running, @current_sleep, @current_proc, @current_args,
@do_loop, @cancel_on_exception]
end
@@ -484,11 +484,11 @@ class TkTimer
def at_end(*arg, &b)
if arg.empty?
- if b
+ if b
@at_end_proc = b
- else
+ else
# no proc
- return @at_end_proc
+ return @at_end_proc
end
else
fail ArgumentError, "wrong number of arguments" if arg.length != 1 || b
@@ -504,17 +504,17 @@ class TkTimer
unless @running
if @return_value.kind_of?(Exception)
- fail @return_value
+ fail @return_value
else
- return @return_value
+ return @return_value
end
end
@wait_var.wait(on_thread, check_root)
if @return_value.kind_of?(Exception)
- fail @return_value
+ fail @return_value
else
- @return_value
+ @return_value
end
end
def eventloop_wait(check_root = false)
@@ -628,12 +628,12 @@ class TkRTTimer < TkTimer
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,
+ @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 +
+ 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
@@ -653,7 +653,7 @@ class TkRTTimer < TkTimer
if @current_sleep == 0
@offset_list.push([
- @offset_s - @cb_start_time.to_i,
+ @offset_s - @cb_start_time.to_i,
@offset_u - @cb_start_time.usec
])
else
diff --git a/ext/tk/lib/tk/toplevel.rb b/ext/tk/lib/tk/toplevel.rb
index 30ef009517..bd6e8307f5 100644
--- a/ext/tk/lib/tk/toplevel.rb
+++ b/ext/tk/lib/tk/toplevel.rb
@@ -11,7 +11,7 @@ class Tk::Toplevel<TkWindow
TkCommandNames = ['toplevel'.freeze].freeze
WidgetClassName = 'Toplevel'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
################# old version
# def initialize(parent=nil, screen=nil, classname=nil, keys=nil)
@@ -38,7 +38,7 @@ class Tk::Toplevel<TkWindow
# s << "-class" << @classname if @classname
# s << "-colormap" << @colormap if @colormap
# s << "-container" << @container if @container
-# s << "-screen" << @screen if @screen
+# s << "-screen" << @screen if @screen
# s << "-use" << @use if @use
# s << "-visual" << @visual if @visual
# tk_call 'toplevel', @path, *s
@@ -113,7 +113,7 @@ class Tk::Toplevel<TkWindow
@use = keys['use']
@visual = keys['visual']
if !@classname && my_class_name
- keys['class'] = @classname = my_class_name
+ keys['class'] = @classname = my_class_name
end
if @classname.kind_of? TkBindTag
@db_class = @classname
@@ -127,7 +127,7 @@ class Tk::Toplevel<TkWindow
end
keys, cmds = _wm_command_option_chk(keys)
super(keys)
- cmds.each{|k,v|
+ cmds.each{|k,v|
if v.kind_of? Array
self.__send__(k,*v)
else
@@ -162,7 +162,7 @@ class Tk::Toplevel<TkWindow
keys = {}
end
if !@classname && my_class_name
- keys['class'] = @classname = my_class_name
+ keys['class'] = @classname = my_class_name
end
if @classname.kind_of? TkBindTag
@db_class = @classname
@@ -176,7 +176,7 @@ class Tk::Toplevel<TkWindow
end
keys, cmds = _wm_command_option_chk(keys)
super(parent, keys)
- cmds.each{|k,v|
+ cmds.each{|k,v|
if v.kind_of? Array
self.send(k,*v)
else
@@ -200,8 +200,8 @@ class Tk::Toplevel<TkWindow
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.
+ # 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
@@ -212,7 +212,7 @@ class Tk::Toplevel<TkWindow
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.
+ # Configs of menu_spec can override it.
menu_spec.each{|info| add_menu(info, tearoff, opts)}
self.menu
end
@@ -259,6 +259,4 @@ class Tk::Toplevel<TkWindow
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)
+Tk.__set_toplevel_aliases__(:Tk, Tk::Toplevel, :TkToplevel)
diff --git a/ext/tk/lib/tk/ttk_selector.rb b/ext/tk/lib/tk/ttk_selector.rb
index 522249e6a9..72ed637a38 100644
--- a/ext/tk/lib/tk/ttk_selector.rb
+++ b/ext/tk/lib/tk/ttk_selector.rb
@@ -5,92 +5,70 @@
# toplevel classes/modules
module Tk
@TOPLEVEL_ALIAS_TABLE[:Ttk] = {
- :TkButton => 'tkextlib/tile/tbutton',
+ :TkButton => 'tkextlib/tile/tbutton',
- :TkCheckbutton => 'tkextlib/tile/tcheckbutton',
- :TkCheckButton => 'tkextlib/tile/tcheckbutton',
+ :TkCheckbutton => 'tkextlib/tile/tcheckbutton',
+ :TkCheckButton => 'tkextlib/tile/tcheckbutton',
- # :TkDialog => 'tkextlib/tile/dialog',
+ # :TkDialog => 'tkextlib/tile/dialog',
- :TkEntry => 'tkextlib/tile/tentry',
+ :TkEntry => 'tkextlib/tile/tentry',
- :TkCombobox => 'tkextlib/tile/tcombobox',
+ :TkCombobox => 'tkextlib/tile/tcombobox',
- :TkFrame => 'tkextlib/tile/tframe',
+ :TkFrame => 'tkextlib/tile/tframe',
- :TkLabel => 'tkextlib/tile/tlabel',
+ :TkLabel => 'tkextlib/tile/tlabel',
- :TkLabelframe => 'tkextlib/tile/tlabelframe',
- :TkLabelFrame => 'tkextlib/tile/tlabelframe',
+ :TkLabelframe => 'tkextlib/tile/tlabelframe',
+ :TkLabelFrame => 'tkextlib/tile/tlabelframe',
- :TkMenubutton => 'tkextlib/tile/tmenubutton',
- :TkMenuButton => 'tkextlib/tile/tmenubutton',
+ :TkMenubutton => 'tkextlib/tile/tmenubutton',
+ :TkMenuButton => 'tkextlib/tile/tmenubutton',
- :TkNotebook => 'tkextlib/tile/tnotebook',
+ :TkNotebook => 'tkextlib/tile/tnotebook',
- # :TkPaned => 'tkextlib/tile/tpaned',
- :TkPanedwindow => 'tkextlib/tile/tpaned',
- :TkPanedWindow => 'tkextlib/tile/tpaned',
+ # :TkPaned => 'tkextlib/tile/tpaned',
+ :TkPanedwindow => 'tkextlib/tile/tpaned',
+ :TkPanedWindow => 'tkextlib/tile/tpaned',
- :TkProgressbar => 'tkextlib/tile/tprogressbar',
+ :TkProgressbar => 'tkextlib/tile/tprogressbar',
- :TkRadiobutton => 'tkextlib/tile/tradiobutton',
- :TkRadioButton => 'tkextlib/tile/tradiobutton',
+ :TkRadiobutton => 'tkextlib/tile/tradiobutton',
+ :TkRadioButton => 'tkextlib/tile/tradiobutton',
- :TkScale => 'tkextlib/tile/tscale',
- # :TkProgress => 'tkextlib/tile/tscale',
+ :TkScale => 'tkextlib/tile/tscale',
+ # :TkProgress => 'tkextlib/tile/tscale',
- :TkScrollbar => 'tkextlib/tile/tscrollbar',
- :TkXScrollbar => 'tkextlib/tile/tscrollbar',
- :TkYScrollbar => 'tkextlib/tile/tscrollbar',
+ :TkScrollbar => 'tkextlib/tile/tscrollbar',
+ :TkXScrollbar => 'tkextlib/tile/tscrollbar',
+ :TkYScrollbar => 'tkextlib/tile/tscrollbar',
- :TkSeparator => 'tkextlib/tile/tseparator',
+ :TkSeparator => 'tkextlib/tile/tseparator',
- :TkSizeGrip => 'tkextlib/tile/sizegrip',
- :TkSizegrip => 'tkextlib/tile/sizegrip',
+ :TkSizeGrip => 'tkextlib/tile/sizegrip',
+ :TkSizegrip => 'tkextlib/tile/sizegrip',
- # :TkSquare => 'tkextlib/tile/tsquare',
+ # :TkSquare => 'tkextlib/tile/tsquare',
- :TkTreeview => 'tkextlib/tile/treeview',
+ :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
+ @TOPLEVEL_ALIAS_TABLE[:Tile] = @TOPLEVEL_ALIAS_TABLE[:Ttk]
################################################
# 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)
+ unless Object.autoload?(sym) || Object.const_defined?(sym)
+ Object.autoload(sym, file)
+ end
}
################################################
- # @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)
+ @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
diff --git a/ext/tk/lib/tk/validation.rb b/ext/tk/lib/tk/validation.rb
index 0ebd5c51b7..60bd433cdc 100644
--- a/ext/tk/lib/tk/validation.rb
+++ b/ext/tk/lib/tk/validation.rb
@@ -211,21 +211,21 @@ class TkValidateCommand
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 ],
+ [ ?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) ],
+ [ ?n, TkComm.method(:number) ],
+ [ ?s, TkComm.method(:string) ],
+ [ ?w, TkComm.method(:window) ],
[ ?e, proc{|val|
#enc = Tk.encoding
@@ -236,7 +236,7 @@ class TkValidateCommand
TkComm::string(val)
end
}
- ],
+ ],
[ ?x, proc{|val|
idx = TkComm::number(val)
@@ -246,7 +246,7 @@ class TkValidateCommand
idx
end
}
- ],
+ ],
nil
]
@@ -272,7 +272,7 @@ class TkValidateCommand
_setup_subst_table(KEY_TBL, PROC_TBL);
#
- # NOTE: The order of parameters which passed to callback procedure is
+ # NOTE: The order of parameters which passed to callback procedure is
# <extra_arg>, <extra_arg>, ... , <subst_arg>, <subst_arg>, ...
#
diff --git a/ext/tk/lib/tk/variable.rb b/ext/tk/lib/tk/variable.rb
index 6fc2ffdf2f..f738a96ee7 100644
--- a/ext/tk/lib/tk/variable.rb
+++ b/ext/tk/lib/tk/variable.rb
@@ -16,7 +16,7 @@ class TkVariable
#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{
+ (Tk_VARIABLE_ID = ["v".freeze, "00000".taint]).instance_eval{
@mutex = Mutex.new
def mutex; @mutex; end
freeze
@@ -26,10 +26,10 @@ class TkVariable
TkVar_ID_TBL.mutex.synchronize{ TkVar_ID_TBL.clear }
}
- major, minor, type, patchlevel = TclTkLib.get_version
+ major, minor, type, type_name, patchlevel = TclTkLib.get_version
USE_OLD_TRACE_OPTION_STYLE = (major < 8) || (major == 8 && minor < 4)
- #TkCore::INTERP.add_tk_procs('rb_var', 'args',
+ #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} {
@@ -65,10 +65,10 @@ class TkVariable
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")) +
+ 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')
@@ -76,9 +76,9 @@ class TkVariable
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") +
+ 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)
@@ -94,7 +94,7 @@ class TkVariable
_get_eval_string(TkVar_CB_TBL[name1].trace_callback(name2,op))
rescue
trace = $!.backtrace
- raise $!, "\n#{trace[0]}: #{$!.message} (#{$!.class})\n" +
+ raise $!, "\n#{trace[0]}: #{$!.message} (#{$!.class})\n" +
"\tfrom #{trace[1..pos].join("\n\tfrom ")}"
end
=end
@@ -112,7 +112,7 @@ class TkVariable
end
#
- # default_value is available only when the variable is an assoc array.
+ # default_value is available only when the variable is an assoc array.
#
def default_value(val=nil, &b)
if b
@@ -322,7 +322,7 @@ class TkVariable
=begin
if val == []
- # INTERP._eval(format('global %s; set %s(0) 0; unset %s(0)',
+ # INTERP._eval(format('global %s; set %s(0) 0; unset %s(0)',
# @id, @id, @id))
elsif val.kind_of?(Array)
a = []
@@ -370,7 +370,7 @@ class TkVariable
else
INTERP._thread_vwait(@id)
end
- else
+ else
if check_root
INTERP._invoke_without_enc('tkwait', 'variable', @id)
else
@@ -421,7 +421,7 @@ class TkVariable
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}")) &&
TkComm.bool(tk_call('info', 'exist', "#{@id}(#{index})"))
end
end
@@ -433,7 +433,7 @@ class TkVariable
#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),
+ tk_split_simplelist(INTERP._invoke_without_enc('array', 'names', @id),
false, true)
end
@@ -484,9 +484,9 @@ if USE_TCLs_SET_VARIABLE_FUNCTIONS
if val.kind_of?(Hash)
self.clear
val.each{|k, v|
- #INTERP._set_global_var2(@id, _toUTF8(_get_eval_string(k)),
+ #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),
+ INTERP._set_global_var2(@id, _get_eval_string(k, true),
_get_eval_string(v, true))
}
self.value
@@ -494,11 +494,11 @@ if USE_TCLs_SET_VARIABLE_FUNCTIONS
=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 |
+ #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::APPEND_VALUE |
TclTkLib::VarAccessFlag::LIST_ELEMENT)
}
self.value
@@ -535,9 +535,9 @@ if USE_TCLs_SET_VARIABLE_FUNCTIONS
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)),
+ #_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),
+ #_fromUTF8(INTERP._set_global_var2(@id, _get_eval_string(index, true),
# _get_eval_string(val, true)))
end
@@ -562,7 +562,7 @@ else
#INTERP._eval(Kernel.format('set %s', @id))
#INTERP._invoke_without_enc('set', @id)
rescue
- if INTERP._eval(Kernel.format('global %s; array exists %s',
+ 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"
@@ -583,7 +583,7 @@ else
#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',
+ 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"
@@ -591,7 +591,7 @@ else
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)',
+ #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)
@@ -601,9 +601,9 @@ else
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',
+ 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',
+ #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)))
@@ -612,9 +612,9 @@ else
# .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',
+ 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',
+ #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)))
@@ -640,7 +640,7 @@ else
end
end
#INTERP._eval(Kernel.format('global %s; set %s(%s)', @id, @id, index))
- #INTERP._eval(Kernel.format('global %s; set %s(%s)',
+ #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) + ')')
@@ -651,13 +651,13 @@ else
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,
+ 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,
+ #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,
+ #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) + ') ' +
+ #INTERP._eval('set ' + @id + '(' + _get_eval_string(index) + ') ' +
# _get_eval_string(val))
end
@@ -669,7 +669,7 @@ else
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)',
+ #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) + ')')
@@ -1239,14 +1239,6 @@ end
end
end
- def ===(other)
- if other.kind_of?(TkVariable)
- self.id == other.id
- else
- super
- end
- end
-
def zero?
numeric.zero?
end
@@ -1356,10 +1348,10 @@ end
TkVar_CB_TBL[@id] = self
@trace_opts = opts
if USE_OLD_TRACE_OPTION_STYLE
- Tk.tk_call_without_enc('trace', 'variable',
+ Tk.tk_call_without_enc('trace', 'variable',
@id, @trace_opts, 'rb_var ' << @id)
else
- Tk.tk_call_without_enc('trace', 'add', 'variable',
+ Tk.tk_call_without_enc('trace', 'add', 'variable',
@id, @trace_opts, 'rb_var ' << @id)
end
else
@@ -1367,19 +1359,19 @@ end
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',
+ Tk.tk_call_without_enc('trace', 'vdelete',
@id, @trace_opts, 'rb_var ' << @id)
@trace_opts.replace(newopts)
- Tk.tk_call_without_enc('trace', 'variable',
+ 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',
+ 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',
+ Tk.tk_call_without_enc('trace', 'add', 'variable',
@id, @trace_opts, 'rb_var ' << @id)
end
end
@@ -1390,7 +1382,7 @@ end
def trace_element(elem, opts, cmd = Proc.new)
if @elem
- fail(RuntimeError,
+ fail(RuntimeError,
"invalid for a TkVariable which denotes an element of Tcl's array")
end
@@ -1402,10 +1394,10 @@ end
TkVar_CB_TBL[@id] = self
@trace_opts = opts
if USE_OLD_TRACE_OPTION_STYLE
- Tk.tk_call_without_enc('trace', 'add', 'variable',
+ Tk.tk_call_without_enc('trace', 'add', 'variable',
@id, @trace_opts, 'rb_var ' << @id)
else
- Tk.tk_call_without_enc('trace', 'variable',
+ Tk.tk_call_without_enc('trace', 'variable',
@id, @trace_opts, 'rb_var ' << @id)
end
else
@@ -1413,19 +1405,19 @@ end
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',
+ Tk.tk_call_without_enc('trace', 'vdelete',
@id, @trace_opts, 'rb_var ' << @id)
@trace_opts.replace(newopts)
- Tk.tk_call_without_enc('trace', 'variable',
+ 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',
+ 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',
+ Tk.tk_call_without_enc('trace', 'add', 'variable',
@id, @trace_opts, 'rb_var ' << @id)
end
end
@@ -1442,7 +1434,7 @@ end
def trace_info_for_element(elem)
if @elem
- fail(RuntimeError,
+ fail(RuntimeError,
"invalid for a TkVariable which denotes an element of Tcl's array")
end
return [] unless @trace_elem
@@ -1476,7 +1468,7 @@ end
else
newopts = []
@trace_var.each_with_index{|e, i|
- if idx < 0 && e[1] == cmd &&
+ if idx < 0 && e[1] == cmd &&
e[0].size == opts.size && (e[0] - opts).empty?
# find
idx = i
@@ -1487,7 +1479,7 @@ end
end
if idx >= 0
- @trace_var.delete_at(idx)
+ @trace_var.delete_at(idx)
else
return self
end
@@ -1506,21 +1498,21 @@ end
diff = false
@trace_opts.each_byte{|c| break if (diff = ! newopts.index(c))}
if diff
- Tk.tk_call_without_enc('trace', 'vdelete',
+ 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',
+ 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',
+ 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',
+ Tk.tk_call_without_enc('trace', 'add', 'variable',
@id, @trace_opts, 'rb_var ' << @id)
end
end
@@ -1533,7 +1525,7 @@ end
def trace_remove_for_element(elem,opts,cmd)
if @elem
- fail(RuntimeError,
+ fail(RuntimeError,
"invalid for a TkVariable which denotes an element of Tcl's array")
end
return self unless @trace_elem.kind_of? Hash
@@ -1558,7 +1550,7 @@ end
}
else
@trace_elem[elem].each_with_index{|e, i|
- if idx < 0 && e[1] == cmd &&
+ if idx < 0 && e[1] == cmd &&
e[0].size == opts.size && (e[0] - opts).empty?
# find
idx = i
@@ -1575,7 +1567,7 @@ end
if USE_OLD_TRACE_OPTION_STYLE
newopts = ''
- @trace_var.each{|e|
+ @trace_var.each{|e|
e[0].each_byte{|c| newopts.concat(c.chr) unless newopts.index(c.chr)}
}
@trace_elem.each{|elem|
@@ -1599,21 +1591,21 @@ end
diff = false
@trace_opts.each_byte{|c| break if (diff = ! newopts.index(c))}
if diff
- Tk.tk_call_without_enc('trace', 'vdelete',
+ 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',
+ 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',
+ 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',
+ Tk.tk_call_without_enc('trace', 'add', 'variable',
@id, @trace_opts, 'rb_var ' << @id)
end
end
@@ -1629,7 +1621,7 @@ class TkVarAccess<TkVariable
def self.new(name, *args)
if name.kind_of?(TkVariable)
name.value = args[0] unless args.empty?
- return name
+ return name
end
name = name.to_s
@@ -1657,7 +1649,7 @@ class TkVarAccess<TkVariable
fail ArgumentError, "already exist as a scalar variable"
end
name.value = args[0] unless args.empty?
- return name
+ return name
end
name = name.to_s
diff --git a/ext/tk/lib/tk/virtevent.rb b/ext/tk/lib/tk/virtevent.rb
index 19c0dac380..ae31ac1f8f 100644
--- a/ext/tk/lib/tk/virtevent.rb
+++ b/ext/tk/lib/tk/virtevent.rb
@@ -9,7 +9,7 @@ class TkVirtualEvent<TkObject
TkCommandNames = ['event'.freeze].freeze
- (TkVirtualEventID = ["VirtEvent".freeze, TkUtil.untrust("00000")]).instance_eval{
+ (TkVirtualEventID = ["VirtEvent".freeze, "00000".taint]).instance_eval{
@mutex = Mutex.new
def mutex; @mutex; end
freeze
@@ -80,8 +80,8 @@ class TkVirtualEvent<TkObject
def _add_sequences(seq_ary)
unless seq_ary.empty?
- tk_call_without_enc('event', 'add', "<#{@id}>",
- *(seq_ary.collect{|seq|
+ tk_call_without_enc('event', 'add', "<#{@id}>",
+ *(seq_ary.collect{|seq|
"<#{tk_event_sequence(seq)}>"
}) )
end
@@ -106,8 +106,8 @@ class TkVirtualEvent<TkObject
TkVirtualEventTBL.delete(@id)
}
else
- tk_call_without_enc('event', 'delete', "<#{@id}>",
- *(sequences.collect{|seq|
+ tk_call_without_enc('event', 'delete', "<#{@id}>",
+ *(sequences.collect{|seq|
"<#{tk_event_sequence(seq)}>"
}) )
if tk_call_without_enc('event','info',"<#{@id}>").empty?
diff --git a/ext/tk/lib/tk/winfo.rb b/ext/tk/lib/tk/winfo.rb
index b10cfe6760..c649b4a0c9 100644
--- a/ext/tk/lib/tk/winfo.rb
+++ b/ext/tk/lib/tk/winfo.rb
@@ -14,7 +14,7 @@ module TkWinfo
def TkWinfo.atom(name, win=nil)
if win
- number(tk_call_without_enc('winfo', 'atom', '-displayof', 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)))
@@ -26,7 +26,7 @@ module TkWinfo
def TkWinfo.atomname(id, win=nil)
if win
- _fromUTF8(tk_call_without_enc('winfo', 'atomname',
+ _fromUTF8(tk_call_without_enc('winfo', 'atomname',
'-displayof', win, id))
else
_fromUTF8(tk_call_without_enc('winfo', 'atomname', id))
@@ -67,7 +67,7 @@ module TkWinfo
def TkWinfo.containing(rootX, rootY, win=nil)
if win
- window(tk_call_without_enc('winfo', 'containing',
+ window(tk_call_without_enc('winfo', 'containing',
'-displayof', win, rootX, rootY))
else
window(tk_call_without_enc('winfo', 'containing', rootX, rootY))
@@ -128,7 +128,7 @@ module TkWinfo
false, true)
else
#tk_split_simplelist(tk_call_without_enc('winfo', 'interps'))
- tk_split_simplelist(tk_call_without_enc('winfo', 'interps'),
+ tk_split_simplelist(tk_call_without_enc('winfo', 'interps'),
false, true)
end
end
@@ -303,7 +303,7 @@ module TkWinfo
def TkWinfo.visualsavailable(win, includeids=false)
if includeids
- list(tk_call_without_enc('winfo', 'visualsavailable',
+ list(tk_call_without_enc('winfo', 'visualsavailable',
win, "includeids"))
else
list(tk_call_without_enc('winfo', 'visualsavailable', win))
diff --git a/ext/tk/lib/tk/winpkg.rb b/ext/tk/lib/tk/winpkg.rb
index 80e0439ace..89fb391c77 100644
--- a/ext/tk/lib/tk/winpkg.rb
+++ b/ext/tk/lib/tk/winpkg.rb
@@ -10,8 +10,7 @@ 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)
+Tk.__set_toplevel_aliases__(:Tk, Tk::WinDDE, :TkWinDDE)
module Tk::WinDDE
extend Tk
@@ -46,7 +45,7 @@ module Tk::WinDDE
elsif args.size == 0
tk_call('dde', 'servername', force, exact, *hash_kv(keys))
else
- tk_call('dde', 'servername', force, exact,
+ tk_call('dde', 'servername', force, exact,
*((hash_kv(keys) << '--') + args))
end
else
@@ -87,16 +86,14 @@ module Tk::WinDDE
tk_call('dde', 'eval', -async, topic, cmd, *args)
end
- module_function :servername, :execute, :async_execute,
+ 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)
+Tk.__set_toplevel_aliases__(:Tk, Tk::WinRegistry, :TkWinRegistry)
module Tk::WinRegistry
extend Tk
diff --git a/ext/tk/lib/tk/wm.rb b/ext/tk/lib/tk/wm.rb
index b1a2ed886a..0394296189 100644
--- a/ext/tk/lib/tk/wm.rb
+++ b/ext/tk/lib/tk/wm.rb
@@ -123,7 +123,7 @@ module Tk
TOPLEVEL_METHODCALL_OPTKEYS['focusmodel'] = 'focusmodel'
def Wm.forget(win)
- # Tcl/Tk 8.5+
+ # Tcl/Tk 8.5+
# work with dockable frames
tk_call_without_enc('wm', 'forget', win.epath)
win
@@ -200,7 +200,7 @@ module Tk
if imgs.empty?
win.instance_eval{
@wm_iconphoto = nil unless defined? @wm_iconphoto
- return @wm_iconphoto
+ return @wm_iconphoto
}
end
@@ -308,10 +308,10 @@ module Tk
def Wm.manage(win, use_id = nil)
# Tcl/Tk 8.5+ feature
# --------------------------------------------------------------
- # In the future release, I want to support to embed the 'win'
+ # 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),
+ # 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
diff --git a/ext/tk/lib/tk/xim.rb b/ext/tk/lib/tk/xim.rb
index c0126c5175..0ac8559bb9 100644
--- a/ext/tk/lib/tk/xim.rb
+++ b/ext/tk/lib/tk/xim.rb
@@ -12,14 +12,14 @@ module TkXIM
def TkXIM.useinputmethods(value = None, win = nil)
if value == None
if win
- bool(tk_call_without_enc('tk', 'useinputmethods',
+ 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',
+ bool(tk_call_without_enc('tk', 'useinputmethods',
'-displayof', win, value))
else
bool(tk_call_without_enc('tk', 'useinputmethods', value))
diff --git a/ext/tk/lib/tkextlib/ICONS/icons.rb b/ext/tk/lib/tkextlib/ICONS/icons.rb
index bd3180aa55..b430bae55d 100644
--- a/ext/tk/lib/tkextlib/ICONS/icons.rb
+++ b/ext/tk/lib/tkextlib/ICONS/icons.rb
@@ -34,10 +34,10 @@ module Tk
def self.create(*args) # icon, icon, ..., ?option=>value, ...?
if args[-1].kind_of?(Hash)
keys = args.pop
- icons = simplelist(tk_call('::icons::icons', 'create',
+ icons = simplelist(tk_call('::icons::icons', 'create',
*(hash_kv(keys) << (args.flatten))))
else
- icons = simplelist(tk_call('::icons::icons', 'create',
+ icons = simplelist(tk_call('::icons::icons', 'create',
args.flatten))
end
@@ -66,7 +66,7 @@ module Tk
def self.query(*args) # icon, icon, ..., ?option=>value, ...?
if args[-1].kind_of?(Hash)
keys = args.pop
- simplelist(tk_call('::icons::icons', 'query',
+ simplelist(tk_call('::icons::icons', 'query',
*(hash_kv(keys) << (args.flatten))))
else
simplelist(tk_call('::icons::icons', 'query', args.flatten))
@@ -121,7 +121,7 @@ module Tk
end
def query(keys={})
- list(simplelist(tk_call('::icons::icons', 'query',
+ list(simplelist(tk_call('::icons::icons', 'query',
*(hash_kv(keys) << @name))
)[0])
end
diff --git a/ext/tk/lib/tkextlib/ICONS/setup.rb b/ext/tk/lib/tkextlib/ICONS/setup.rb
index ee406c6ca0..ce0f0bd4d4 100644
--- a/ext/tk/lib/tkextlib/ICONS/setup.rb
+++ b/ext/tk/lib/tkextlib/ICONS/setup.rb
@@ -2,7 +2,7 @@
# 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
+# 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
index 6b31ababb3..cfbe274c86 100644
--- a/ext/tk/lib/tkextlib/SUPPORT_STATUS
+++ b/ext/tk/lib/tkextlib/SUPPORT_STATUS
@@ -55,20 +55,18 @@ script may give you some hints about that.
===< 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)
+Tcllib 1.8
+Tklib 0.4.1 http://sourceforge.net/projects/tcllib ==> tcllib
IWidgets 4.0.2 http://sourceforge.net/projects/incrtcl ==> iwidgets
-BWidget 1.8 [ CVS/Hd(2009-07-02) ]
- http://sourceforge.net/projects/tcllib ==> bwidget
+BWidgets 1.7 http://sourceforge.net/projects/tcllib ==> bwidget
-TkTable 2.10 http://sourceforge.net/projects/tktable ==> tktable
+TkTable 2.9 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
+vu 2.3.0 http://sourceforge.net/projects/tktable ==> vu
TkHTML 2.0 http://www.hwaci.com/sw/tkhtml/ ==> tkHTML
@@ -82,25 +80,25 @@ BLT 2.4z http://sourceforge.net/projects/blt
(http://raa.ruby-lang.org/)
==> blt
-TkTreeCtrl 2.2.9
- http://tktreectrl.sourceforge.net/ ==> treectrl
+TkTreeCtrl CVS/Hd(2005-12-02)
+ http://sourceforge.net/projects/tktreectrl ==> treectrl
-Tile 0.8.3/8.6b1
+Tile 0.8.0/8.5.1
http://sourceforge.net/projects/tktable ==> tile
===< support (may be alpha or beta quality) >=================================
-IncrTcl CVS/Hd(2008-12-15)
+IncrTcl CVS/Hd(2005-02-14)
http://sourceforge.net/projects/incrtcl ==> itcl, itk
-TclX CVS/Hd(2008-12-15)
+TclX CVS/Hd(2005-02-07)
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/
+Trofs 0.4.3 http://math.nist.gov/~DPorter/tcltk/trofs/
diff --git a/ext/tk/lib/tkextlib/blt.rb b/ext/tk/lib/tkextlib/blt.rb
index 8b132e41a7..8d58c1f1bc 100644
--- a/ext/tk/lib/tkextlib/blt.rb
+++ b/ext/tk/lib/tkextlib/blt.rb
@@ -19,8 +19,6 @@ 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
diff --git a/ext/tk/lib/tkextlib/blt/barchart.rb b/ext/tk/lib/tkextlib/blt/barchart.rb
index a86b91c959..cb481c5889 100644
--- a/ext/tk/lib/tkextlib/blt/barchart.rb
+++ b/ext/tk/lib/tkextlib/blt/barchart.rb
@@ -11,7 +11,7 @@ module Tk::BLT
class Barchart < TkWindow
TkCommandNames = ['::blt::barchart'.freeze].freeze
WidgetClassName = 'Barchart'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
include PlotComponent
include GraphCommand
@@ -22,7 +22,7 @@ module Tk::BLT
private :__boolval_optkeys
def __strval_optkeys
- ['text', 'label', 'title', 'file',
+ ['text', 'label', 'title', 'file',
'background', 'plotbackground']
end
private :__strval_optkeys
@@ -33,7 +33,7 @@ module Tk::BLT
private :__tkvariable_optkeys
=begin
- BarElement_ID = ['blt_barchart_bar'.freeze, TkUtil.untrust('00000')].freeze
+ BarElement_ID = ['blt_barchart_bar'.freeze, '00000'.taint].freeze
def bar(elem=nil, keys={})
if elem.kind_of?(Hash)
diff --git a/ext/tk/lib/tkextlib/blt/bitmap.rb b/ext/tk/lib/tkextlib/blt/bitmap.rb
index 3254b63116..23c6d2d064 100644
--- a/ext/tk/lib/tkextlib/blt/bitmap.rb
+++ b/ext/tk/lib/tkextlib/blt/bitmap.rb
@@ -14,7 +14,7 @@ module Tk::BLT
BITMAP_ID_TBL = TkCore::INTERP.create_table
- (BITMAP_ID = ['blt_bitmap_id'.freeze, TkUtil.untrust('00000')]).instance_eval{
+ (BITMAP_ID = ['blt_bitmap_id'.freeze, '00000'.taint]).instance_eval{
@mutex = Mutex.new
def mutex; @mutex; end
freeze
diff --git a/ext/tk/lib/tkextlib/blt/busy.rb b/ext/tk/lib/tkextlib/blt/busy.rb
index b5287fb5b7..2f807fcd9c 100644
--- a/ext/tk/lib/tkextlib/blt/busy.rb
+++ b/ext/tk/lib/tkextlib/blt/busy.rb
@@ -44,7 +44,6 @@ class << Tk::BLT::Busy
private :__item_config_cmd
undef itemcget
- undef itemcget_tkstring
alias configure itemconfigure
alias configinfo itemconfiginfo
alias current_configinfo current_itemconfiginfo
diff --git a/ext/tk/lib/tkextlib/blt/component.rb b/ext/tk/lib/tkextlib/blt/component.rb
index 20db035fdd..b2005b2f2b 100644
--- a/ext/tk/lib/tkextlib/blt/component.rb
+++ b/ext/tk/lib/tkextlib/blt/component.rb
@@ -22,15 +22,15 @@ module Tk::BLT
private :__item_numstrval_optkeys
def __item_boolval_optkeys(id)
- ['hide', 'under', 'descending', 'logscale', 'loose', 'showticks',
- 'titlealternate', 'scalesymbols', 'minor', 'raised',
+ ['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',
+ ['text', 'label', 'limits', 'title',
+ 'show', 'file', 'maskdata', 'maskfile',
'color', 'titlecolor', 'fill', 'outline', 'offdash']
end
private :__item_strval_optkeys
@@ -82,9 +82,6 @@ module Tk::BLT
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
@@ -97,7 +94,7 @@ module Tk::BLT
value = None
slot = _symbolkey2str(slot)
if cmd = slot.delete('command')
- slot['command'] = proc{|w, tick|
+ slot['command'] = proc{|w, tick|
cmd.call(TkComm.window(w), TkComm.num_or_str(tick))
}
end
@@ -106,7 +103,7 @@ module Tk::BLT
slot = args.pop
if slot == :command || slot == 'command'
cmd = value
- value = proc{|w, tick|
+ value = proc{|w, tick|
cmd.call(TkComm.window(w), TkComm.num_or_str(tick))
}
end
@@ -121,9 +118,6 @@ module Tk::BLT
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
@@ -140,9 +134,6 @@ module Tk::BLT
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
@@ -167,9 +158,6 @@ module Tk::BLT
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
@@ -194,9 +182,6 @@ module Tk::BLT
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
@@ -221,9 +206,6 @@ module Tk::BLT
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
@@ -240,9 +222,6 @@ module Tk::BLT
current_itemconfiginfo('grid', slot)
end
- def legend_cget_tkstring(option)
- itemcget_tkstring('legend', option)
- end
def legend_cget(option)
itemcget('legend', option)
end
@@ -259,9 +238,6 @@ module Tk::BLT
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
@@ -286,9 +262,6 @@ module Tk::BLT
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
@@ -305,9 +278,6 @@ module Tk::BLT
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
@@ -332,16 +302,12 @@ module Tk::BLT
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
+ private :__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
@@ -407,13 +373,13 @@ module Tk::BLT
ret
end
- private :itemcget_tkstring, :itemcget, :itemcget_strict
+ private :itemcget, :itemcget_strict
private :itemconfigure, :itemconfiginfo, :current_itemconfiginfo
#################
class Axis < TkObject
- (OBJ_ID = ['blt_chart_axis'.freeze, TkUtil.untrust('00000')]).instance_eval{
+ (OBJ_ID = ['blt_chart_axis'.freeze, '00000'.taint]).instance_eval{
@mutex = Mutex.new
def mutex; @mutex; end
freeze
@@ -511,9 +477,6 @@ module Tk::BLT
@id
end
- def cget_tkstring(option)
- @chart.axis_cget_tkstring(@id, option)
- end
def cget(option)
@chart.axis_cget(@id, option)
end
@@ -557,7 +520,7 @@ module Tk::BLT
def name
@axis
end
-
+
def transform(val)
@chart.axis_transform(@id, val)
end
@@ -619,9 +582,6 @@ module Tk::BLT
@id
end
- def cget_tkstring(option)
- @chart.crosshair_cget_tkstring(option)
- end
def cget(option)
@chart.crosshair_cget(option)
end
@@ -671,7 +631,7 @@ module Tk::BLT
ElementID_TBL.mutex.synchronize{ ElementID_TBL.clear }
}
- (OBJ_ID = ['blt_chart_element'.freeze, TkUtil.untrust('00000')]).instance_eval{
+ (OBJ_ID = ['blt_chart_element'.freeze, '00000'.taint]).instance_eval{
@mutex = Mutex.new
def mutex; @mutex; end
freeze
@@ -769,10 +729,6 @@ module Tk::BLT
@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)
@@ -877,9 +833,6 @@ module Tk::BLT
@id
end
- def cget_tkstring(option)
- @chart.gridline_cget_tkstring(option)
- end
def cget(option)
@chart.gridline_cget(option)
end
@@ -954,9 +907,6 @@ module Tk::BLT
@id
end
- def cget_tkstring(option)
- @chart.legend_cget_tkstring(option)
- end
def cget(option)
@chart.legend_cget(option)
end
@@ -990,7 +940,7 @@ module Tk::BLT
#################
class Pen < TkObject
- (OBJ_ID = ['blt_chart_pen'.freeze, TkUtil.untrust('00000')]).instance_eval{
+ (OBJ_ID = ['blt_chart_pen'.freeze, '00000'.taint]).instance_eval{
@mutex = Mutex.new
def mutex; @mutex; end
freeze
@@ -1086,9 +1036,6 @@ module Tk::BLT
@id
end
- def cget_tkstring(option)
- @chart.pen_cget_tkstring(@id, option)
- end
def cget(option)
@chart.pen_cget(@id, option)
end
@@ -1159,9 +1106,6 @@ module Tk::BLT
@id
end
- def cget_tkstring(option)
- @chart.postscript_cget_tkstring(option)
- end
def cget(option)
@chart.postscript_cget(option)
end
@@ -1277,7 +1221,7 @@ module Tk::BLT
fail RuntimeError, "#{self} is an abstract class"
end
args, fontkeys = _parse_create_args(keys)
- idnum = tk_call_without_enc(chart.path, 'marker', 'create',
+ idnum = tk_call_without_enc(chart.path, 'marker', 'create',
self::MarkerTypeName, *args)
chart.marker_configure(idnum, fontkeys) unless fontkeys.empty?
idnum.to_i # 'item id' is an integer number
@@ -1285,7 +1229,7 @@ module Tk::BLT
def self.create_type(chart, type, keys={})
args, fontkeys = _parse_create_args(keys)
- idnum = tk_call_without_enc(chart.path, 'marker', 'create',
+ idnum = tk_call_without_enc(chart.path, 'marker', 'create',
type, *args)
chart.marker_configure(idnum, fontkeys) unless fontkeys.empty?
id = idnum.to_i # 'item id' is an integer number
@@ -1325,9 +1269,6 @@ module Tk::BLT
@id
end
- def cget_tkstring(option)
- @chart.marker_cget_tkstring(@id, option)
- end
def cget(option)
@chart.marker_cget(@id, option)
end
@@ -1545,7 +1486,7 @@ module Tk::BLT
list(tk_send('axis', 'limits', tagid(id)))
end
def axis_names(*pats)
- simplelist(tk_send('axis', 'names',
+ simplelist(tk_send('axis', 'names',
*(pats.collect{|pat| tagid(pat)}))).collect{|axis|
Tk::BLT::PlotComponent::Axis.id2obj(self, axis)
}
@@ -1559,11 +1500,11 @@ module Tk::BLT
end
def axis_use(id, target=nil)
if target
- Tk::BLT::PlotComponent::Axis.id2obj(self,
- tk_send('axis', 'use',
+ Tk::BLT::PlotComponent::Axis.id2obj(self,
+ tk_send('axis', 'use',
tagid(id), tagid(target)))
else
- Tk::BLT::PlotComponent::Axis.id2obj(self,
+ Tk::BLT::PlotComponent::Axis.id2obj(self,
tk_send('axis', 'use', tagid(id)))
end
end
@@ -1603,10 +1544,10 @@ module Tk::BLT
def element_closest(x, y, var, *args)
if args[-1].kind_of?(Hash)
keys = args.pop
- bool(tk_send('element', 'closest', x, y, var,
+ 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,
+ bool(tk_send('element', 'closest', x, y, var,
*(args.collect{|id| tagid(id)})))
end
end
@@ -1622,7 +1563,7 @@ module Tk::BLT
bool(tk_send('element', 'exists', tagid(id)))
end
def element_names(*pats)
- simplelist(tk_send('element', 'names',
+ simplelist(tk_send('element', 'names',
*(pats.collect{|pat| tagid(pat)}))).collect{|elem|
Tk::BLT::PlotComponent::Element.id2obj(self, elem)
}
@@ -1660,10 +1601,10 @@ module Tk::BLT
def bar_closest(x, y, var, *args)
if args[-1].kind_of?(Hash)
keys = args.pop
- bool(tk_send('bar', 'closest', x, y, var,
+ 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,
+ bool(tk_send('bar', 'closest', x, y, var,
*(args.collect{|id| tagid(id)})))
end
end
@@ -1679,7 +1620,7 @@ module Tk::BLT
bool(tk_send('bar', 'exists', tagid(id)))
end
def bar_names(*pats)
- simplelist(tk_send('bar', 'names',
+ simplelist(tk_send('bar', 'names',
*(pats.collect{|pat| tagid(pat)}))).collect{|elem|
Tk::BLT::PlotComponent::Element.id2obj(self, elem)
}
@@ -1717,10 +1658,10 @@ module Tk::BLT
def line_closest(x, y, var, *args)
if args[-1].kind_of?(Hash)
keys = args.pop
- bool(tk_send('line', 'closest', x, y, var,
+ 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,
+ bool(tk_send('line', 'closest', x, y, var,
*(args.collect{|id| tagid(id)})))
end
end
@@ -1736,7 +1677,7 @@ module Tk::BLT
bool(tk_send('line', 'exists', tagid(id)))
end
def line_names(*pats)
- simplelist(tk_send('line', 'names',
+ simplelist(tk_send('line', 'names',
*(pats.collect{|pat| tagid(pat)}))).collect{|elem|
Tk::BLT::PlotComponent::Element.id2obj(self, elem)
}
@@ -1782,7 +1723,7 @@ module Tk::BLT
keys.delete('without_creating')
end
- legend = self.class.new(parent, :without_creating=>true,
+ legend = self.class.new(parent, :without_creating=>true,
:widgetname=>widgetname)
class << legend
def __destroy_hook__
@@ -1799,24 +1740,24 @@ module Tk::BLT
end
def legend_activate(*pats)
- list(tk_send('legend', 'activate',
+ 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',
+ 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',
+ Tk::BLT::PlotComponent::Element.id2obj(self,
+ tk_send('legend', 'get',
_at(pos, y)))
else
- Tk::BLT::PlotComponent::Element.id2obj(self,
+ Tk::BLT::PlotComponent::Element.id2obj(self,
tk_send('legend', 'get', pos))
end
end
@@ -1832,7 +1773,7 @@ module Tk::BLT
self
end
def pen_names(*pats)
- simplelist(tk_send('pen', 'names',
+ simplelist(tk_send('pen', 'names',
*(pats.collect{|pat| tagid(pat)}))).collect{|pen|
Tk::BLT::PlotComponent::Pen.id2obj(self, pen)
}
@@ -1902,7 +1843,7 @@ module Tk::BLT
bool(tk_send('marker', 'exists', tagid(id)))
end
def marker_names(*pats)
- simplelist(tk_send('marker', 'names',
+ simplelist(tk_send('marker', 'names',
*(pats.collect{|pat| tagid(pat)}))).collect{|id|
Tk::BLT::PlotComponent::Marker.id2obj(self, id)
}
@@ -1913,9 +1854,6 @@ module Tk::BLT
###################
- def xaxis_cget_tkstring(option)
- itemcget_tkstring('xaxis', option)
- end
def xaxis_cget(option)
itemcget('xaxis', option)
end
@@ -1926,13 +1864,13 @@ module Tk::BLT
if slot.kind_of?(Hash)
slot = _symbolkey2str(slot)
if cmd = slot.delete('command')
- slot['command'] = proc{|w, tick|
+ 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|
+ value = proc{|w, tick|
cmd.call(TkComm.window(w), TkComm.num_or_str(tick))
}
end
@@ -1980,17 +1918,14 @@ module Tk::BLT
end
def xaxis_use(target=nil)
if target
- Tk::BLT::PlotComponent::Axis.id2obj(self,
- tk_send('xaxis', 'use',
+ 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
@@ -2001,13 +1936,13 @@ module Tk::BLT
if slot.kind_of?(Hash)
slot = _symbolkey2str(slot)
if cmd = slot.delete('command')
- slot['command'] = proc{|w, tick|
+ 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|
+ value = proc{|w, tick|
cmd.call(TkComm.window(w), TkComm.num_or_str(tick))
}
end
@@ -2055,17 +1990,14 @@ module Tk::BLT
end
def x2axis_use(target=nil)
if target
- Tk::BLT::PlotComponent::Axis.id2obj(self,
- tk_send('x2axis', 'use',
+ 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
@@ -2076,13 +2008,13 @@ module Tk::BLT
if slot.kind_of?(Hash)
slot = _symbolkey2str(slot)
if cmd = slot.delete('command')
- slot['command'] = proc{|w, tick|
+ 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|
+ value = proc{|w, tick|
cmd.call(TkComm.window(w), TkComm.num_or_str(tick))
}
end
@@ -2130,17 +2062,14 @@ module Tk::BLT
end
def yaxis_use(target=nil)
if target
- Tk::BLT::PlotComponent::Axis.id2obj(self,
- tk_send('yaxis', 'use',
+ 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
@@ -2151,13 +2080,13 @@ module Tk::BLT
if slot.kind_of?(Hash)
slot = _symbolkey2str(slot)
if cmd = slot.delete('command')
- slot['command'] = proc{|w, tick|
+ 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|
+ value = proc{|w, tick|
cmd.call(TkComm.window(w), TkComm.num_or_str(tick))
}
end
@@ -2205,8 +2134,8 @@ module Tk::BLT
end
def y2axis_use(target=nil)
if target
- Tk::BLT::PlotComponent::Axis.id2obj(self,
- tk_send('y2axis', 'use',
+ Tk::BLT::PlotComponent::Axis.id2obj(self,
+ tk_send('y2axis', 'use',
tagid(target)))
else
Tk::BLT::PlotComponent::Axis.id2obj(self, tk_send('y2axis', 'use'))
diff --git a/ext/tk/lib/tkextlib/blt/container.rb b/ext/tk/lib/tkextlib/blt/container.rb
index be05828d95..cdbec21f25 100644
--- a/ext/tk/lib/tkextlib/blt/container.rb
+++ b/ext/tk/lib/tkextlib/blt/container.rb
@@ -10,7 +10,7 @@ module Tk::BLT
class Container < TkWindow
TkCommandNames = ['::blt::container'.freeze].freeze
WidgetClassName = 'Container'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
def __strval_optkeys
super() << 'name'
diff --git a/ext/tk/lib/tkextlib/blt/dragdrop.rb b/ext/tk/lib/tkextlib/blt/dragdrop.rb
index aa5c5654c2..201548504a 100644
--- a/ext/tk/lib/tkextlib/blt/dragdrop.rb
+++ b/ext/tk/lib/tkextlib/blt/dragdrop.rb
@@ -15,7 +15,7 @@ module Tk::BLT
class Token < TkWindow
WidgetClassName = 'DragDropToken'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
def initialize(arg)
if arg.kind_of?(Hash) # arg is a hash includes the widgetpath of token
@@ -55,7 +55,6 @@ module Tk::BLT
private :__item_strval_optkeys
undef itemcget
- undef itemcget_tkstring
private :itemconfigure, :itemconfiginfo, :current_itemconfiginfo
def source_configure(win, slot, value=None)
@@ -78,7 +77,7 @@ module Tk::BLT
]
PROC_TBL = [
- [ ?w, TkComm.method(:window) ],
+ [ ?w, TkComm.method(:window) ],
nil
]
@@ -121,8 +120,8 @@ module Tk::BLT
]
PROC_TBL = [
- [ ?b, TkComm.method(:bool) ],
- [ ?w, TkComm.method(:window) ],
+ [ ?b, TkComm.method(:bool) ],
+ [ ?w, TkComm.method(:window) ],
nil
]
@@ -176,9 +175,9 @@ module Tk::BLT
]
PROC_TBL = [
- [ ?i, TkComm.method(:string) ],
- [ ?v, TkComm.method(:tk_tcl2ruby) ],
- [ ?w, TkComm.method(:window) ],
+ [ ?i, TkComm.method(:string) ],
+ [ ?v, TkComm.method(:tk_tcl2ruby) ],
+ [ ?w, TkComm.method(:window) ],
nil
]
@@ -204,14 +203,14 @@ module Tk::BLT
end
def self.source_handler(win, datatype, cmd=Proc.new, *args)
- _bind_for_event_class(DnD_Handle,
- ['::blt::drag&drop', 'source', win, 'handler'],
+ _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'],
+ _bind_for_event_class(DnD_Handle,
+ ['::blt::drag&drop', 'target', win, 'handler'],
cmd, *args)
end
diff --git a/ext/tk/lib/tkextlib/blt/graph.rb b/ext/tk/lib/tkextlib/blt/graph.rb
index 6bd4424065..9ae99bff5c 100644
--- a/ext/tk/lib/tkextlib/blt/graph.rb
+++ b/ext/tk/lib/tkextlib/blt/graph.rb
@@ -11,7 +11,7 @@ module Tk::BLT
class Graph < TkWindow
TkCommandNames = ['::blt::graph'.freeze].freeze
WidgetClassName = 'Graph'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
include PlotComponent
include GraphCommand
@@ -27,7 +27,7 @@ module Tk::BLT
private :__strval_optkeys
=begin
- BarElement_ID = ['blt_graph_bar'.freeze, TkUtil.untrust('00000')].freeze
+ BarElement_ID = ['blt_graph_bar'.freeze, '00000'.taint].freeze
def bar(elem=nil, keys={})
if elem.kind_of?(Hash)
diff --git a/ext/tk/lib/tkextlib/blt/htext.rb b/ext/tk/lib/tkextlib/blt/htext.rb
index 878bd9982d..0d9cb30185 100644
--- a/ext/tk/lib/tkextlib/blt/htext.rb
+++ b/ext/tk/lib/tkextlib/blt/htext.rb
@@ -19,9 +19,8 @@ module Tk::BLT
TkCommandNames = ['::blt::htext'.freeze].freeze
WidgetClassName = 'Htext'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
- alias window_cget_tkstring itemcget_tkstring
alias window_cget itemcget
alias window_cget_strict itemcget_strict
alias window_configure itemconfigure
diff --git a/ext/tk/lib/tkextlib/blt/setup.rb b/ext/tk/lib/tkextlib/blt/setup.rb
index ee406c6ca0..ce0f0bd4d4 100644
--- a/ext/tk/lib/tkextlib/blt/setup.rb
+++ b/ext/tk/lib/tkextlib/blt/setup.rb
@@ -2,7 +2,7 @@
# 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
+# 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/stripchart.rb b/ext/tk/lib/tkextlib/blt/stripchart.rb
index 74093f1868..fe5afbb095 100644
--- a/ext/tk/lib/tkextlib/blt/stripchart.rb
+++ b/ext/tk/lib/tkextlib/blt/stripchart.rb
@@ -11,7 +11,7 @@ module Tk::BLT
class Stripchart < TkWindow
TkCommandNames = ['::blt::stripchart'.freeze].freeze
WidgetClassName = 'Stripchart'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
include PlotComponent
include GraphCommand
@@ -22,13 +22,13 @@ module Tk::BLT
private :__boolval_optkeys
def __strval_optkeys
- ['text', 'label', 'title', 'file',
+ ['text', 'label', 'title', 'file',
'background', 'plotbackground']
end
private :__strval_optkeys
=begin
- BarElement_ID = ['blt_stripchart_bar'.freeze, TkUtil.untrust('00000')].freeze
+ BarElement_ID = ['blt_stripchart_bar'.freeze, '00000'.taint].freeze
def bar(elem=nil, keys={})
if elem.kind_of?(Hash)
diff --git a/ext/tk/lib/tkextlib/blt/table.rb b/ext/tk/lib/tkextlib/blt/table.rb
index 205e29e6c5..dfa10269ed 100644
--- a/ext/tk/lib/tkextlib/blt/table.rb
+++ b/ext/tk/lib/tkextlib/blt/table.rb
@@ -26,9 +26,6 @@ module Tk::BLT
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
@@ -95,9 +92,6 @@ module Tk::BLT
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
@@ -147,14 +141,13 @@ class << Tk::BLT::Table
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 :__itemcget, :__itemcget_strict
private :__itemconfigure, :__itemconfiginfo, :__current_itemconfiginfo
def __boolval_optkeys
@@ -187,9 +180,6 @@ class << Tk::BLT::Table
############################################
- def cget_tkstring(container, option)
- __itemcget_tkstring([container], option)
- end
def cget(container, option)
__itemcget([container], option)
end
@@ -209,9 +199,6 @@ class << Tk::BLT::Table
__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
diff --git a/ext/tk/lib/tkextlib/blt/tabnotebook.rb b/ext/tk/lib/tkextlib/blt/tabnotebook.rb
index 82936c67d3..508fa2b82f 100644
--- a/ext/tk/lib/tkextlib/blt/tabnotebook.rb
+++ b/ext/tk/lib/tkextlib/blt/tabnotebook.rb
@@ -11,100 +11,11 @@ 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
-
- #######################################
+ WidgetClassNames[WidgetClassName] = self
def get_tab(index)
- if (idx = tk_send_without_enc('id', tagindex(index))).empty?
- nil
- else
- Tk::BLT::Tabset::Tab.id2obj(self, idx)
- end
+ Tk::BLT::Tabset::Tab.id2obj(tk_send_without_enc('id', tagindex(index)))
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
index c4716c7304..ca81ad8f95 100644
--- a/ext/tk/lib/tkextlib/blt/tabset.rb
+++ b/ext/tk/lib/tkextlib/blt/tabset.rb
@@ -13,7 +13,7 @@ module Tk::BLT
TabID_TBL = TkCore::INTERP.create_table
- (TabsetTab_ID = ['blt_tabset_tab'.freeze, TkUtil.untrust('00000')]).instance_eval{
+ (TabsetTab_ID = ['blt_tabset_tab'.freeze, '00000'.taint]).instance_eval{
@mutex = Mutex.new
def mutex; @mutex; end
freeze
@@ -27,7 +27,7 @@ module Tk::BLT
tpath = tabset.path
TabID_TBL.mutex.synchronize{
if TabID_TBL[tpath]
- TabID_TBL[tpath][id]? TabID_TBL[tpath][id]: id
+ TabID_TBL[tpath][id]? TabID_TBL[tpath]: id
else
id
end
@@ -48,13 +48,6 @@ module Tk::BLT
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{
@@ -76,9 +69,9 @@ module Tk::BLT
if pos
idx = tk_call(@tpath, 'index', '-name', @id)
if pos.to_s == 'end'
- tk_call(@tpath, 'move', idx, 'after', 'end')
+ tk_call(@tpath, idx, 'moveto', 'after', 'end')
else
- tk_call(@tpath, 'move', idx, 'before', pos)
+ tk_call(@tpath, idx, 'moveto', 'before', pos)
end
end
tk_call(@tpath, 'tab', 'configure', @id, keys)
@@ -87,11 +80,11 @@ module Tk::BLT
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!
}
+ pos = 'end' unless pos
tk_call(@tpath, 'insert', pos, @id, keys)
end
end
@@ -132,9 +125,6 @@ module Tk::BLT
@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
@@ -183,10 +173,10 @@ module Tk::BLT
end
def perforation_highlight(mode)
- @t.perforation_highlight(self.index, mode)
+ @t.perforation.highlight(self.index, mode)
end
def perforation_invoke()
- @t.perforation_invoke(self.index)
+ @t.perforation.invoke(self.index)
end
def see()
@@ -213,7 +203,7 @@ module Tk::BLT
TkCommandNames = ['::blt::tabset'.freeze].freeze
WidgetClassName = 'Tabset'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
def __destroy_hook__
Tk::BLT::Tabset::Tab::TabID_TBL.mutex.synchronize{
@@ -252,7 +242,6 @@ module Tk::BLT
end
private :__item_pathname
- alias tab_cget_tkstring itemcget_tkstring
alias tab_cget itemcget
alias tab_cget_strict itemcget_strict
alias tab_configure itemconfigure
@@ -346,43 +335,19 @@ module Tk::BLT
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
+ Tk::BLT::Tabset::Tab.id2obj(tk_send_without_enc('get', tagindex(index)))
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)))
+ num_or_str(tk_send('index', '-mame', 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))
@@ -398,31 +363,15 @@ module Tk::BLT
end
def nearest(x, y)
- Tk::BLT::Tabset::Tab.id2obj(self, num_or_str(tk_send_without_enc('nearest', x, y)))
+ Tk::BLT::Tabset::Tab.id2obj(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
+ def perforation_highlight(index, mode)
+ tk_send('perforation', 'highlight', tagindex(index), mode)
self
end
- def perforation_invoke(index=nil)
- if index
- tk_send('perforation', 'invoke', tagindex(index))
- else
- tk_send('perforation', 'invoke')
- end
+ def perforation_invoke(index)
+ tk_send('perforation', 'invoke', tagindex(index))
end
def scan_mark(x, y)
@@ -448,37 +397,14 @@ module Tk::BLT
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)
+ Tk::BLT::Tabset::Tab.id2obj(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))
+ def tab_tearoff(index, name=None)
+ window(tk_send('tab', 'tearoff', tagindex(index), name))
end
def xscrollcommand(cmd=Proc.new)
diff --git a/ext/tk/lib/tkextlib/blt/ted.rb b/ext/tk/lib/tkextlib/blt/ted.rb
index 53ab9acdaa..670265fc78 100644
--- a/ext/tk/lib/tkextlib/blt/ted.rb
+++ b/ext/tk/lib/tkextlib/blt/ted.rb
@@ -30,12 +30,9 @@ module Tk::BLT
end
private :__item_config_cmd
- private :itemcget_tkstring, :itemcget, :itemcget_strict
+ private :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
diff --git a/ext/tk/lib/tkextlib/blt/tile.rb b/ext/tk/lib/tkextlib/blt/tile.rb
index c67cafd8d6..5f5242f299 100644
--- a/ext/tk/lib/tkextlib/blt/tile.rb
+++ b/ext/tk/lib/tkextlib/blt/tile.rb
@@ -8,10 +8,6 @@ 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'
diff --git a/ext/tk/lib/tkextlib/blt/tree.rb b/ext/tk/lib/tkextlib/blt/tree.rb
index da53a6ed04..77b85f1717 100644
--- a/ext/tk/lib/tkextlib/blt/tree.rb
+++ b/ext/tk/lib/tkextlib/blt/tree.rb
@@ -182,7 +182,7 @@ module Tk::BLT
def move(dest, keys={})
@tree.keys(@id, dest, keys)
self
- end
+ end
def next()
@tree.next(@id)
@@ -272,7 +272,7 @@ module Tk::BLT
TreeTagID_TBL.mutex.synchronize{ TreeTagID_TBL.clear }
}
- (TreeTag_ID = ['blt_tree_tag'.freeze, TkUtil.untrust('00000')]).instance_eval{
+ (TreeTag_ID = ['blt_tree_tag'.freeze, '00000'.taint]).instance_eval{
@mutex = Mutex.new
def mutex; @mutex; end
freeze
@@ -397,10 +397,10 @@ module Tk::BLT
NotifyID_TBL.mutex.synchronize{
if tree.kind_of?(Array)
# not create
- tpath = tree[0].path
+ tpath = tree[0].path
NotifyID_TBL[tpath] ||= {}
unless (obj = NotifyID_TBL[tpath][tree[1]])
- (NotifyID_TBL[tpath][tree[1]] =
+ (NotifyID_TBL[tpath][tree[1]] =
obj = self.allocate).instance_eval{
@parent = @tree = tree[0]
@tpath = @parent.path
@@ -438,7 +438,7 @@ module Tk::BLT
args = args.collect{|arg| '-' << arg.to_s}
args << proc{|id, type|
- cmd.call(Tk::BLT::Tree::Node.id2obj(@tree, id),
+ cmd.call(Tk::BLT::Tree::Node.id2obj(@tree, id),
((type[0] == ?-)? type[1..-1]: type))
}
@@ -509,7 +509,7 @@ module Tk::BLT
tpath = tree[0].path
TraceID_TBL[tpath] ||= {}
unless (obj = TraceID_TBL[tpath][tree[1]])
- (TraceID_TBL[tpath][tree[1]] =
+ (TraceID_TBL[tpath][tree[1]] =
obj = self.allocate).instance_eval{
@parent = @tree = tree
@tpath = @parent.path
@@ -541,8 +541,8 @@ module Tk::BLT
end
end
- @path = @id = tk_call(@tpath, 'trace', 'create', node, key, opts,
- proc{|t, id, k, ops|
+ @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)
@@ -578,7 +578,7 @@ module Tk::BLT
TreeID_TBL = TkCore::INTERP.create_table
- (Tree_ID = ['blt_tree'.freeze, TkUtil.untrust('00000')]).instance_eval{
+ (Tree_ID = ['blt_tree'.freeze, '00000'.taint]).instance_eval{
@mutex = Mutex.new
def mutex; @mutex; end
freeze
@@ -599,8 +599,8 @@ module Tk::BLT
'recurse'=>nil, 'tags'=>nil,
# sort command
- 'ascii'=>nil, 'decreasing'=>nil, 'disctionary'=>nil,
- 'integer'=>nil, 'real'=>nil, 'recurse'=>nil, 'reorder'=>nil,
+ 'ascii'=>nil, 'decreasing'=>nil, 'disctionary'=>nil,
+ 'integer'=>nil, 'real'=>nil, 'recurse'=>nil, 'reorder'=>nil,
}
end
@@ -624,7 +624,7 @@ module Tk::BLT
def self.new(name = nil)
TreeID_TBL.mutex.synchronize{
if name && TreeID_TBL[name]
- TreeID_TBL[name]
+ TreeID_TBL[name]
else
(obj = self.allocate).instance_eval{
initialize(name)
@@ -680,7 +680,7 @@ module Tk::BLT
end
def ancestor(node1, node2)
- Tk::BLT::Tree::Node.id2obj(self, tk_call('::blt::tree', 'ancestor',
+ Tk::BLT::Tree::Node.id2obj(self, tk_call('::blt::tree', 'ancestor',
tagid(node1), tagid(node2)))
end
@@ -701,14 +701,14 @@ module Tk::BLT
end
def copy(src, parent, keys={})
- id = tk_call('::blt::tree', 'copy', tagid(src), tagid(parent),
+ 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,
+ 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
@@ -751,7 +751,7 @@ module Tk::BLT
end
def find(node, keys={})
- simplelist(tk_call('::blt::tree', 'find', tagid(node),
+ simplelist(tk_call('::blt::tree', 'find', tagid(node),
__conv_keyonly_opts(keys))).collect{|n|
Tk::BLT::Tree::Node.id2obj(self, n)
}
@@ -775,7 +775,7 @@ module Tk::BLT
end
def index(node)
- Tk::BLT::Tree::Node.id2obj(self,
+ Tk::BLT::Tree::Node.id2obj(self,
tk_call('::blt::tree', 'index', tagid(node)))
end
@@ -785,11 +785,11 @@ module Tk::BLT
end
def ancestor?(node1, node2)
- bool(tk_call('::blt::tree', 'is', 'ancestor',
+ bool(tk_call('::blt::tree', 'is', 'ancestor',
tagid(node1), tagid(node2)))
end
def before?(node1, node2)
- bool(tk_call('::blt::tree', 'is', 'before',
+ bool(tk_call('::blt::tree', 'is', 'before',
tagid(node1), tagid(node2)))
end
def leaf?(node)
@@ -806,7 +806,7 @@ module Tk::BLT
if nodes.empty?
simplelist(tk_call('blt::tree', 'keys', tagid(node)))
else
- simplelist(tk_call('blt::tree', 'keys', tagid(node),
+ simplelist(tk_call('blt::tree', 'keys', tagid(node),
*(nodes.collect{|n| tagid(n)}))).collect{|lst|
simplelist(lst)
}
@@ -828,7 +828,7 @@ module Tk::BLT
end
def link(parent, node, keys={})
- ret = tk_call('::blt::tree', 'link', tagid(parent), tagid(node),
+ 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
@@ -902,7 +902,7 @@ module Tk::BLT
end
def restore(node, str, keys={})
- tk_call('::blt::tree', 'restore', tagid(node), str,
+ tk_call('::blt::tree', 'restore', tagid(node), str,
__conv_keyonly_opts(keys))
self
end
@@ -915,7 +915,7 @@ module Tk::BLT
end
def restore_from_file(node, file, keys={})
- tk_call('::blt::tree', 'restorefile', tagid(node), file,
+ tk_call('::blt::tree', 'restorefile', tagid(node), file,
__conv_keyonly_opts(keys))
self
end
@@ -923,13 +923,13 @@ module Tk::BLT
keys = __conv_keyonly_opts(keys)
keys.delete('overwrite')
keys.delete(:overwrite)
- tk_call('::blt::tree', 'restorefile', tagid(node), file,
+ 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',
+ Tk::BLT::Tree::Node.id2obj(self, tk_call('::blt::tree', 'root',
tagid(node)))
end
@@ -958,7 +958,7 @@ module Tk::BLT
end
def tag_delete(tag, *nodes)
- tk_call(@path, 'tag', 'delete', tagid(tag),
+ tk_call(@path, 'tag', 'delete', tagid(tag),
*(nodes.collect{|n| tagid(n)}))
self
end
@@ -973,7 +973,7 @@ module Tk::BLT
end
def tag_get(node, *patterns)
- simplelist(tk_call(@tpath, 'tag', 'get', tagid(node),
+ simplelist(tk_call(@tpath, 'tag', 'get', tagid(node),
*(patterns.collect{|pat| tagid(pat)}))).collect{|str|
Tk::BLT::Tree::Tag.id2obj(self, str)
}
@@ -997,7 +997,7 @@ module Tk::BLT
end
def tag_unset(node, *tags)
- tk_call(@path, 'tag', 'unset', tagid(node),
+ tk_call(@path, 'tag', 'unset', tagid(node),
*(tags.collect{|t| tagid(t)}))
self
end
diff --git a/ext/tk/lib/tkextlib/blt/treeview.rb b/ext/tk/lib/tkextlib/blt/treeview.rb
index 046cf7f837..c5a5697186 100644
--- a/ext/tk/lib/tkextlib/blt/treeview.rb
+++ b/ext/tk/lib/tkextlib/blt/treeview.rb
@@ -95,9 +95,6 @@ module Tk::BLT::Treeview::ConfigMethod
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
@@ -114,9 +111,6 @@ module Tk::BLT::Treeview::ConfigMethod
current_itemconfiginfo(['column', name], slot)
end
- def button_cget_tkstring(option)
- itemcget_tkstring('button', option)
- end
def button_cget(option)
itemcget('button', option)
end
@@ -133,9 +127,6 @@ module Tk::BLT::Treeview::ConfigMethod
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
@@ -190,9 +181,6 @@ module Tk::BLT::Treeview::ConfigMethod
ret
end
- def sort_cget_tkstring(option)
- itemcget_tkstring('sort', option)
- end
def sort_cget(option)
itemcget('sort', option)
end
@@ -209,9 +197,6 @@ module Tk::BLT::Treeview::ConfigMethod
current_itemconfiginfo('sort', slot)
end
- def text_cget_tkstring(option)
- itemcget_tkstring('text', option)
- end
def text_cget(option)
itemcget('text', option)
end
@@ -228,14 +213,14 @@ module Tk::BLT::Treeview::ConfigMethod
current_itemconfiginfo('text', slot)
end
- private :itemcget_tkstring, :itemcget, :itemcget_strict
+ private :itemcget, :itemcget_strict
private :itemconfigure, :itemconfiginfo, :current_itemconfiginfo
end
class Tk::BLT::Treeview
TkCommandNames = ['::blt::treeview'.freeze].freeze
WidgetClassName = 'TreeView'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
include Scrollable
include ValidateConfigure
@@ -245,7 +230,7 @@ class Tk::BLT::Treeview
########################
def __boolval_optkeys
- ['autocreate', 'allowduplicates', 'exportselection', 'flat', 'hideroot',
+ ['autocreate', 'allowduplicates', 'exportselection', 'flat', 'hideroot',
'newtags', 'showtitles', 'sortselection']
end
private :__boolval_optkeys
@@ -260,17 +245,17 @@ class Tk::BLT::Treeview
class OpenCloseCommand < TkValidateCommand
class ValidateArgs < TkUtil::CallbackSubst
KEY_TBL = [
- [ ?W, ?w, :widget ],
- [ ?p, ?s, :name ],
- [ ?P, ?s, :fullpath ],
- [ ?#, ?x, :node_id ],
+ [ ?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) ],
+ [ ?x, TkComm.method(:num_or_str) ],
+ [ ?s, TkComm.method(:string) ],
+ [ ?w, TkComm.method(:window) ],
nil
]
@@ -478,7 +463,7 @@ class Tk::BLT::Treeview
self
end
def entry_children(tag, first=None, last=None)
- simplelist(tk_send('entry', 'children', tagid(tag),
+ simplelist(tk_send('entry', 'children', tagid(tag),
first, last)).collect{|id| tagid2obj(id)}
end
def entry_delete(tag, first=None, last=None)
@@ -515,17 +500,17 @@ class Tk::BLT::Treeview
class FindExecFlagValue < TkValidateCommand
class ValidateArgs < TkUtil::CallbackSubst
KEY_TBL = [
- [ ?W, ?w, :widget ],
- [ ?p, ?s, :name ],
- [ ?P, ?s, :fullpath ],
- [ ?#, ?x, :node_id ],
+ [ ?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) ],
+ [ ?x, TkComm.method(:num_or_str) ],
+ [ ?s, TkComm.method(:string) ],
+ [ ?w, TkComm.method(:window) ],
nil
]
@@ -661,7 +646,7 @@ class Tk::BLT::Treeview
}
end
def range_open(first, last)
- simplelist(tk_send('range', '-open',
+ simplelist(tk_send('range', '-open',
tagid(first), tagid(last))).collect{|id|
tagid2obj(id)
}
@@ -1044,7 +1029,7 @@ class Tk::BLT::Treeview::Node < TkObject
TreeNodeID_TBL = TkCore::INTERP.create_table
- (TreeNode_ID = ['blt_treeview_node'.freeze, TkUtil.untrust('00000')]).instance_eval{
+ (TreeNode_ID = ['blt_treeview_node'.freeze, '00000'.taint]).instance_eval{
@mutex = Mutex.new
def mutex; @mutex; end
freeze
@@ -1133,7 +1118,7 @@ class Tk::BLT::Treeview::Node < TkObject
at = keys.delete['at']
if parent
- if parent.kind_of?(Tk::BLT::Treeview::Node) ||
+ 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
@@ -1165,7 +1150,7 @@ class Tk::BLT::Treeview::Tag < TkObject
TreeTagID_TBL = TkCore::INTERP.create_table
- (TreeTag_ID = ['blt_treeview_tag'.freeze, TkUtil.untrust('00000')]).instance_eval{
+ (TreeTag_ID = ['blt_treeview_tag'.freeze, '00000'.taint]).instance_eval{
@mutex = Mutex.new
def mutex; @mutex; end
freeze
@@ -1283,5 +1268,5 @@ end
class Tk::BLT::Hiertable
TkCommandNames = ['::blt::hiertable'.freeze].freeze
WidgetClassName = 'Hiertable'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
end
diff --git a/ext/tk/lib/tkextlib/blt/unix_dnd.rb b/ext/tk/lib/tkextlib/blt/unix_dnd.rb
index 8996f7c891..445002d7a5 100644
--- a/ext/tk/lib/tkextlib/blt/unix_dnd.rb
+++ b/ext/tk/lib/tkextlib/blt/unix_dnd.rb
@@ -30,12 +30,9 @@ module Tk::BLT
end
private :__item_config_cmd
- private :itemcget_tkstring, :itemcget, :itemcget_strict
+ private :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
@@ -52,9 +49,6 @@ module Tk::BLT
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
diff --git a/ext/tk/lib/tkextlib/blt/vector.rb b/ext/tk/lib/tkextlib/blt/vector.rb
index 742e901d3e..97fb1b96ff 100644
--- a/ext/tk/lib/tkextlib/blt/vector.rb
+++ b/ext/tk/lib/tkextlib/blt/vector.rb
@@ -49,10 +49,10 @@ module Tk::BLT
size = size.join(':')
end
if size
- @id = TkCore::INTERP._invoke('::blt::vector', 'create',
+ @id = TkCore::INTERP._invoke('::blt::vector', 'create',
"#auto(#{size})", *hash_kv(keys))
else
- @id = TkCore::INTERP._invoke('::blt::vector', 'create',
+ @id = TkCore::INTERP._invoke('::blt::vector', 'create',
"#auto", *hash_kv(keys))
end
diff --git a/ext/tk/lib/tkextlib/blt/watch.rb b/ext/tk/lib/tkextlib/blt/watch.rb
index 292623ff58..219ff78e97 100644
--- a/ext/tk/lib/tkextlib/blt/watch.rb
+++ b/ext/tk/lib/tkextlib/blt/watch.rb
@@ -14,7 +14,7 @@ module Tk::BLT
WATCH_ID_TBL = TkCore::INTERP.create_table
- (BLT_WATCH_ID = ['blt_watch_id'.freeze, TkUtil.untrust('00000')]).instance_eval{
+ (BLT_WATCH_ID = ['blt_watch_id'.freeze, '00000'.taint]).instance_eval{
@mutex = Mutex.new
def mutex; @mutex; end
freeze
diff --git a/ext/tk/lib/tkextlib/blt/winop.rb b/ext/tk/lib/tkextlib/blt/winop.rb
index 03bdb60810..e371d28ab7 100644
--- a/ext/tk/lib/tkextlib/blt/winop.rb
+++ b/ext/tk/lib/tkextlib/blt/winop.rb
@@ -38,7 +38,7 @@ class << Tk::BLT::Winop
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',
+ tk_call('::blt::winop', 'image', 'resample',
src, dest, horiz_filter, vert_filter)
end
def image_rotate(src, dest, angle)
@@ -47,9 +47,9 @@ class << Tk::BLT::Winop
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,
+ def image_subsample(src, dest, x, y, width, height,
horiz_filter=None, vert_filter=None)
- tk_call('::blt::winop', 'image', 'subsample',
+ tk_call('::blt::winop', 'image', 'subsample',
src, dest, x, y, width, height, horiz_filter, vert_filter)
end
@@ -66,13 +66,13 @@ class << Tk::BLT::Winop
end
def resample(src, dest, horiz_filter=None, vert_filter=None)
- tk_call('::blt::winop', 'resample',
+ tk_call('::blt::winop', 'resample',
src, dest, horiz_filter, vert_filter)
end
- def subsample(src, dest, x, y, width, height,
+ def subsample(src, dest, x, y, width, height,
horiz_filter=None, vert_filter=None)
- tk_call('::blt::winop', 'subsample',
+ tk_call('::blt::winop', 'subsample',
src, dest, x, y, width, height, horiz_filter, vert_filter)
end
diff --git a/ext/tk/lib/tkextlib/bwidget.rb b/ext/tk/lib/tkextlib/bwidget.rb
index 7a1eff51d8..62631d8b54 100644
--- a/ext/tk/lib/tkextlib/bwidget.rb
+++ b/ext/tk/lib/tkextlib/bwidget.rb
@@ -18,8 +18,6 @@ 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
diff --git a/ext/tk/lib/tkextlib/bwidget/arrowbutton.rb b/ext/tk/lib/tkextlib/bwidget/arrowbutton.rb
index 13fe9e59bf..770e5e9ef1 100644
--- a/ext/tk/lib/tkextlib/bwidget/arrowbutton.rb
+++ b/ext/tk/lib/tkextlib/bwidget/arrowbutton.rb
@@ -17,5 +17,5 @@ end
class Tk::BWidget::ArrowButton
TkCommandNames = ['ArrowButton'.freeze].freeze
WidgetClassName = 'ArrowButton'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
end
diff --git a/ext/tk/lib/tkextlib/bwidget/button.rb b/ext/tk/lib/tkextlib/bwidget/button.rb
index e139fb6708..8f3087d098 100644
--- a/ext/tk/lib/tkextlib/bwidget/button.rb
+++ b/ext/tk/lib/tkextlib/bwidget/button.rb
@@ -17,7 +17,7 @@ end
class Tk::BWidget::Button
TkCommandNames = ['Button'.freeze].freeze
WidgetClassName = 'Button'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
def __strval_optkeys
super() << 'helptext'
diff --git a/ext/tk/lib/tkextlib/bwidget/buttonbox.rb b/ext/tk/lib/tkextlib/bwidget/buttonbox.rb
index a6de33c40c..8d6d212189 100644
--- a/ext/tk/lib/tkextlib/bwidget/buttonbox.rb
+++ b/ext/tk/lib/tkextlib/bwidget/buttonbox.rb
@@ -17,7 +17,7 @@ end
class Tk::BWidget::ButtonBox
TkCommandNames = ['ButtonBox'.freeze].freeze
WidgetClassName = 'ButtonBox'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
include TkItemConfigMethod
diff --git a/ext/tk/lib/tkextlib/bwidget/combobox.rb b/ext/tk/lib/tkextlib/bwidget/combobox.rb
index 16143dfbc6..1c58a4ccb0 100644
--- a/ext/tk/lib/tkextlib/bwidget/combobox.rb
+++ b/ext/tk/lib/tkextlib/bwidget/combobox.rb
@@ -21,12 +21,7 @@ class Tk::BWidget::ComboBox
TkCommandNames = ['ComboBox'.freeze].freeze
WidgetClassName = 'ComboBox'.freeze
- WidgetClassNames[WidgetClassName] ||= self
-
- def __boolval_optkeys
- super() << 'autocomplete' << 'autopost'
- end
- private :__boolval_optkeys
+ WidgetClassNames[WidgetClassName] = self
def get_listbox(&b)
win = window(tk_send_without_enc('getlistbox'))
@@ -40,12 +35,6 @@ class Tk::BWidget::ComboBox
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
diff --git a/ext/tk/lib/tkextlib/bwidget/dialog.rb b/ext/tk/lib/tkextlib/bwidget/dialog.rb
index 3b0656f021..291ca4a962 100644
--- a/ext/tk/lib/tkextlib/bwidget/dialog.rb
+++ b/ext/tk/lib/tkextlib/bwidget/dialog.rb
@@ -18,17 +18,12 @@ end
class Tk::BWidget::Dialog
TkCommandNames = ['Dialog'.freeze].freeze
WidgetClassName = 'Dialog'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
include TkItemConfigMethod
- def __numstrval_optkeys
- super() << 'buttonwidth'
- end
- private :__numstrval_optkeys
-
def __strval_optkeys
- super() << 'title' << 'geometry'
+ super() << 'title'
end
private :__strval_optkeys
@@ -57,20 +52,13 @@ class Tk::BWidget::Dialog
def create_self(keys)
cmd = self.class::TkCommandNames[0]
if keys and keys != None
- tk_call_without_enc(cmd, @path, '-parent', @relative,
+ 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')
diff --git a/ext/tk/lib/tkextlib/bwidget/entry.rb b/ext/tk/lib/tkextlib/bwidget/entry.rb
index 8dc4496123..a56890f4e3 100644
--- a/ext/tk/lib/tkextlib/bwidget/entry.rb
+++ b/ext/tk/lib/tkextlib/bwidget/entry.rb
@@ -19,7 +19,7 @@ class Tk::BWidget::Entry
TkCommandNames = ['Entry'.freeze].freeze
WidgetClassName = 'Entry'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
def __strval_optkeys
super() << 'helptext' << 'insertbackground'
diff --git a/ext/tk/lib/tkextlib/bwidget/label.rb b/ext/tk/lib/tkextlib/bwidget/label.rb
index e8d9352c62..88a504aa50 100644
--- a/ext/tk/lib/tkextlib/bwidget/label.rb
+++ b/ext/tk/lib/tkextlib/bwidget/label.rb
@@ -17,7 +17,7 @@ end
class Tk::BWidget::Label
TkCommandNames = ['Label'.freeze].freeze
WidgetClassName = 'Label'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
def __strval_optkeys
super() << 'helptext'
diff --git a/ext/tk/lib/tkextlib/bwidget/labelentry.rb b/ext/tk/lib/tkextlib/bwidget/labelentry.rb
index 16e7b46933..95b40946a6 100644
--- a/ext/tk/lib/tkextlib/bwidget/labelentry.rb
+++ b/ext/tk/lib/tkextlib/bwidget/labelentry.rb
@@ -21,7 +21,7 @@ class Tk::BWidget::LabelEntry
TkCommandNames = ['LabelEntry'.freeze].freeze
WidgetClassName = 'LabelEntry'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
def __strval_optkeys
super() << 'helptext' << 'insertbackground' << 'entryfg' << 'entrybg'
diff --git a/ext/tk/lib/tkextlib/bwidget/labelframe.rb b/ext/tk/lib/tkextlib/bwidget/labelframe.rb
index 0710f213f0..dc221806e4 100644
--- a/ext/tk/lib/tkextlib/bwidget/labelframe.rb
+++ b/ext/tk/lib/tkextlib/bwidget/labelframe.rb
@@ -18,7 +18,7 @@ end
class Tk::BWidget::LabelFrame
TkCommandNames = ['LabelFrame'.freeze].freeze
WidgetClassName = 'LabelFrame'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
def __strval_optkeys
super() << 'helptext'
diff --git a/ext/tk/lib/tkextlib/bwidget/listbox.rb b/ext/tk/lib/tkextlib/bwidget/listbox.rb
index 930491c869..093fcb6fb3 100644
--- a/ext/tk/lib/tkextlib/bwidget/listbox.rb
+++ b/ext/tk/lib/tkextlib/bwidget/listbox.rb
@@ -11,7 +11,7 @@ module Tk
module BWidget
class ListBox < TkWindow
# is NOT a subclass of a listbox widget class.
- # because it constructed on a canvas widget.
+ # because it constructed on a canvas widget.
class Item < TkObject
end
@@ -25,11 +25,11 @@ class Tk::BWidget::ListBox
TkCommandNames = ['ListBox'.freeze].freeze
WidgetClassName = 'ListBox'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
class Event_for_Items < TkEvent::Event
def self._get_extra_args_tbl
- [
+ [
TkComm.method(:string) # item idenfier
]
end
@@ -60,7 +60,7 @@ class Tk::BWidget::ListBox
else
cmd = Proc.new
end
- _bind_for_event_class(Event_for_Items, [path, 'bindImage'],
+ _bind_for_event_class(Event_for_Items, [path, 'bindImage'],
context, cmd, *args)
self
end
@@ -76,7 +76,7 @@ class Tk::BWidget::ListBox
else
cmd = Proc.new
end
- _bind_append_for_event_class(Event_for_Items, [path, 'bindImage'],
+ _bind_append_for_event_class(Event_for_Items, [path, 'bindImage'],
context, cmd, *args)
self
end
@@ -101,7 +101,7 @@ class Tk::BWidget::ListBox
else
cmd = Proc.new
end
- _bind_for_event_class(Event_for_Items, [path, 'bindText'],
+ _bind_for_event_class(Event_for_Items, [path, 'bindText'],
context, cmd, *args)
self
end
@@ -117,7 +117,7 @@ class Tk::BWidget::ListBox
else
cmd = Proc.new
end
- _bind_append_for_event_class(Event_for_Items, [path, 'bindText'],
+ _bind_append_for_event_class(Event_for_Items, [path, 'bindText'],
context, cmd, *args)
self
end
@@ -183,19 +183,19 @@ class Tk::BWidget::ListBox
end
def selection_set(*args)
- tk_send_without_enc('selection', 'set',
+ tk_send_without_enc('selection', 'set',
*(args.collect{|item| tagid(item)}))
self
end
def selection_add(*args)
- tk_send_without_enc('selection', 'add',
+ tk_send_without_enc('selection', 'add',
*(args.collect{|item| tagid(item)}))
self
end
def selection_remove(*args)
- tk_send_without_enc('selection', 'remove',
+ tk_send_without_enc('selection', 'remove',
*(args.collect{|item| tagid(item)}))
self
end
@@ -212,7 +212,7 @@ class Tk::BWidget::ListBox::Item
ListItem_TBL = TkCore::INTERP.create_table
- (ListItem_ID = ['bw:item'.freeze, TkUtil.untrust('00000')]).instance_eval{
+ (ListItem_ID = ['bw:item'.freeze, '00000'.taint]).instance_eval{
@mutex = Mutex.new
def mutex; @mutex; end
freeze
@@ -237,7 +237,7 @@ class Tk::BWidget::ListBox::Item
if lbox.kind_of?(Tk::BWidget::ListBox)
@listbox = lbox
else
- fail RuntimeError,
+ fail RuntimeError,
"expect Tk::BWidget::ListBox or Tk::BWidget::ListBox::Item for 1st argument"
end
@@ -294,9 +294,6 @@ class Tk::BWidget::ListBox::Item
val
end
- def cget_tkstring(key)
- @listbox.itemcget_tkstring(@id, key)
- end
def cget(key)
@listbox.itemcget(@id, key)
end
diff --git a/ext/tk/lib/tkextlib/bwidget/mainframe.rb b/ext/tk/lib/tkextlib/bwidget/mainframe.rb
index 92253bd8d3..de66eaf81e 100644
--- a/ext/tk/lib/tkextlib/bwidget/mainframe.rb
+++ b/ext/tk/lib/tkextlib/bwidget/mainframe.rb
@@ -18,7 +18,7 @@ end
class Tk::BWidget::MainFrame
TkCommandNames = ['MainFrame'.freeze].freeze
WidgetClassName = 'MainFrame'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
def __strval_optkeys
super() << 'progressfg'
@@ -111,10 +111,6 @@ class Tk::BWidget::MainFrame
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
diff --git a/ext/tk/lib/tkextlib/bwidget/messagedlg.rb b/ext/tk/lib/tkextlib/bwidget/messagedlg.rb
index 7b62614737..b88461baf7 100644
--- a/ext/tk/lib/tkextlib/bwidget/messagedlg.rb
+++ b/ext/tk/lib/tkextlib/bwidget/messagedlg.rb
@@ -17,7 +17,7 @@ end
class Tk::BWidget::MessageDlg
TkCommandNames = ['MessageDlg'.freeze].freeze
WidgetClassName = 'MessageDlg'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
def initialize(parent=nil, keys=nil)
@relative = ''
@@ -185,7 +185,7 @@ class Tk::BWidget::MessageDlg
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],
+ ret = num_or_str(tk_call(self.class::TkCommandNames[0],
@path, *hash_kv(@keys)))
(ret < 0)? nil: ret
end
diff --git a/ext/tk/lib/tkextlib/bwidget/notebook.rb b/ext/tk/lib/tkextlib/bwidget/notebook.rb
index ed28bcd86a..423943619c 100644
--- a/ext/tk/lib/tkextlib/bwidget/notebook.rb
+++ b/ext/tk/lib/tkextlib/bwidget/notebook.rb
@@ -19,11 +19,11 @@ class Tk::BWidget::NoteBook
TkCommandNames = ['NoteBook'.freeze].freeze
WidgetClassName = 'NoteBook'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
class Event_for_Tabs < TkEvent::Event
def self._get_extra_args_tbl
- [
+ [
TkComm.method(:string) # page idenfier
]
end
@@ -57,7 +57,7 @@ class Tk::BWidget::NoteBook
else
cmd = Proc.new
end
- _bind_for_event_class(Event_for_Tabs, [path, 'bindtabs'],
+ _bind_for_event_class(Event_for_Tabs, [path, 'bindtabs'],
context, cmd, *args)
self
end
@@ -73,7 +73,7 @@ class Tk::BWidget::NoteBook
else
cmd = Proc.new
end
- _bind_append_for_event_class(Event_for_Tabs, [path, 'bindtabs'],
+ _bind_append_for_event_class(Event_for_Tabs, [path, 'bindtabs'],
context, cmd, *args)
self
end
diff --git a/ext/tk/lib/tkextlib/bwidget/pagesmanager.rb b/ext/tk/lib/tkextlib/bwidget/pagesmanager.rb
index 31bbf1fb8b..fbc2c11255 100644
--- a/ext/tk/lib/tkextlib/bwidget/pagesmanager.rb
+++ b/ext/tk/lib/tkextlib/bwidget/pagesmanager.rb
@@ -17,7 +17,7 @@ end
class Tk::BWidget::PagesManager
TkCommandNames = ['PagesManager'.freeze].freeze
WidgetClassName = 'PagesManager'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
def tagid(id)
# id.to_s
diff --git a/ext/tk/lib/tkextlib/bwidget/panedwindow.rb b/ext/tk/lib/tkextlib/bwidget/panedwindow.rb
index 54cf06cbde..4d979fd523 100644
--- a/ext/tk/lib/tkextlib/bwidget/panedwindow.rb
+++ b/ext/tk/lib/tkextlib/bwidget/panedwindow.rb
@@ -17,12 +17,7 @@ end
class Tk::BWidget::PanedWindow
TkCommandNames = ['PanedWindow'.freeze].freeze
WidgetClassName = 'PanedWindow'.freeze
- WidgetClassNames[WidgetClassName] ||= self
-
- def __strval_optkeys
- super() << 'activator'
- end
- private :__strval_optkeys
+ WidgetClassNames[WidgetClassName] = self
def add(keys={})
window(tk_send('add', *hash_kv(keys)))
diff --git a/ext/tk/lib/tkextlib/bwidget/panelframe.rb b/ext/tk/lib/tkextlib/bwidget/panelframe.rb
index 1cbf914425..84bae0768b 100644
--- a/ext/tk/lib/tkextlib/bwidget/panelframe.rb
+++ b/ext/tk/lib/tkextlib/bwidget/panelframe.rb
@@ -17,7 +17,7 @@ end
class Tk::BWidget::PanelFrame
TkCommandNames = ['PanelFrame'.freeze].freeze
WidgetClassName = 'PanelFrame'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
def __strval_optkeys
super() + ['panelforeground', 'panelbackground']
@@ -47,21 +47,11 @@ class Tk::BWidget::PanelFrame
end
def items
- simplelist(tk_send('items')).map{|w| window(w)}
+ list(tk_send('items'))
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
index ea50c87cef..0b635d97bb 100644
--- a/ext/tk/lib/tkextlib/bwidget/passwddlg.rb
+++ b/ext/tk/lib/tkextlib/bwidget/passwddlg.rb
@@ -17,10 +17,10 @@ end
class Tk::BWidget::PasswdDlg
TkCommandNames = ['PasswdDlg'.freeze].freeze
WidgetClassName = 'PasswdDlg'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
def __strval_optkeys
- super() << 'loginhelptext' << 'loginlabel' << 'logintext' <<
+ super() << 'loginhelptext' << 'loginlabel' << 'logintext' <<
'passwdlabel' << 'passwdtext'
end
private :__strval_optkeys
@@ -31,13 +31,13 @@ class Tk::BWidget::PasswdDlg
private :__boolval_optkeys
def __tkvariable_optkeys
- super() << 'loginhelpvar' << 'logintextvariable' <<
+ super() << 'loginhelpvar' << 'logintextvariable' <<
'passwdhelpvar' << 'passwdtextvariable'
end
private :__tkvariable_optkeys
def create
- login, passwd = simplelist(tk_call(self.class::TkCommandNames[0],
+ login, passwd = simplelist(tk_call(self.class::TkCommandNames[0],
@path, *hash_kv(@keys)))
[login, passwd]
end
diff --git a/ext/tk/lib/tkextlib/bwidget/progressbar.rb b/ext/tk/lib/tkextlib/bwidget/progressbar.rb
index 18eb67349b..0253ce2ada 100644
--- a/ext/tk/lib/tkextlib/bwidget/progressbar.rb
+++ b/ext/tk/lib/tkextlib/bwidget/progressbar.rb
@@ -16,5 +16,5 @@ end
class Tk::BWidget::ProgressBar
TkCommandNames = ['ProgressBar'.freeze].freeze
WidgetClassName = 'ProgressBar'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
end
diff --git a/ext/tk/lib/tkextlib/bwidget/progressdlg.rb b/ext/tk/lib/tkextlib/bwidget/progressdlg.rb
index 0c0c4540bc..32600255d5 100644
--- a/ext/tk/lib/tkextlib/bwidget/progressdlg.rb
+++ b/ext/tk/lib/tkextlib/bwidget/progressdlg.rb
@@ -19,7 +19,7 @@ end
class Tk::BWidget::ProgressDlg
TkCommandNames = ['ProgressDlg'.freeze].freeze
WidgetClassName = 'ProgressDlg'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
def create_self(keys)
# NOT create widget for reusing the object
diff --git a/ext/tk/lib/tkextlib/bwidget/scrollableframe.rb b/ext/tk/lib/tkextlib/bwidget/scrollableframe.rb
index 5bd00d6870..010c960ec5 100644
--- a/ext/tk/lib/tkextlib/bwidget/scrollableframe.rb
+++ b/ext/tk/lib/tkextlib/bwidget/scrollableframe.rb
@@ -19,7 +19,7 @@ class Tk::BWidget::ScrollableFrame
TkCommandNames = ['ScrollableFrame'.freeze].freeze
WidgetClassName = 'ScrollableFrame'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
def get_frame(&b)
win = window(tk_send_without_enc('getframe'))
diff --git a/ext/tk/lib/tkextlib/bwidget/scrolledwindow.rb b/ext/tk/lib/tkextlib/bwidget/scrolledwindow.rb
index ea5a18cc66..3599fd8459 100644
--- a/ext/tk/lib/tkextlib/bwidget/scrolledwindow.rb
+++ b/ext/tk/lib/tkextlib/bwidget/scrolledwindow.rb
@@ -17,17 +17,7 @@ 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
+ WidgetClassNames[WidgetClassName] = self
def get_frame(&b)
win = window(tk_send_without_enc('getframe'))
diff --git a/ext/tk/lib/tkextlib/bwidget/scrollview.rb b/ext/tk/lib/tkextlib/bwidget/scrollview.rb
index ab27bc91cf..0546af2c43 100644
--- a/ext/tk/lib/tkextlib/bwidget/scrollview.rb
+++ b/ext/tk/lib/tkextlib/bwidget/scrollview.rb
@@ -16,7 +16,7 @@ end
class Tk::BWidget::ScrollView
TkCommandNames = ['ScrollView'.freeze].freeze
WidgetClassName = 'ScrollView'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
def __strval_optkeys
super() << 'fill'
diff --git a/ext/tk/lib/tkextlib/bwidget/selectcolor.rb b/ext/tk/lib/tkextlib/bwidget/selectcolor.rb
index 456175e87e..0f9014f8de 100644
--- a/ext/tk/lib/tkextlib/bwidget/selectcolor.rb
+++ b/ext/tk/lib/tkextlib/bwidget/selectcolor.rb
@@ -24,7 +24,7 @@ class Tk::BWidget::SelectColor
TkCommandNames = ['SelectColor'.freeze].freeze
WidgetClassName = 'SelectColor'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
def dialog(keys={})
newkeys = @keys.dup
@@ -57,7 +57,7 @@ class Tk::BWidget::SelectColor::Dialog
def create
@keys['type'] = 'dialog' # 'dialog' type returns color
- tk_call(Tk::BWidget::SelectColor::TkCommandNames[0],
+ tk_call(Tk::BWidget::SelectColor::TkCommandNames[0],
@path, *hash_kv(@keys))
end
end
@@ -67,7 +67,7 @@ class Tk::BWidget::SelectColor::Menubutton
keys = {} unless keys
keys = _symbolkey2str(keys)
keys['type'] = 'menubutton' # 'toolbar' type returns widget path
- window(tk_call(Tk::BWidget::SelectColor::TkCommandNames[0],
+ 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
index 23419cb0fa..e53eb3b5bc 100644
--- a/ext/tk/lib/tkextlib/bwidget/selectfont.rb
+++ b/ext/tk/lib/tkextlib/bwidget/selectfont.rb
@@ -23,18 +23,13 @@ class Tk::BWidget::SelectFont
TkCommandNames = ['SelectFont'.freeze].freeze
WidgetClassName = 'SelectFont'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ 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
@@ -85,7 +80,7 @@ class Tk::BWidget::SelectFont::Toolbar
keys = {} unless keys
keys = _symbolkey2str(keys)
keys['type'] = 'toolbar' # 'toolbar' type returns widget path
- window(tk_call(Tk::BWidget::SelectFont::TkCommandNames[0],
+ 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
index 6d92321210..d9c3458e51 100644
--- a/ext/tk/lib/tkextlib/bwidget/separator.rb
+++ b/ext/tk/lib/tkextlib/bwidget/separator.rb
@@ -16,5 +16,5 @@ end
class Tk::BWidget::Separator
TkCommandNames = ['Separator'.freeze].freeze
WidgetClassName = 'Separator'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
end
diff --git a/ext/tk/lib/tkextlib/bwidget/setup.rb b/ext/tk/lib/tkextlib/bwidget/setup.rb
index ee406c6ca0..ce0f0bd4d4 100644
--- a/ext/tk/lib/tkextlib/bwidget/setup.rb
+++ b/ext/tk/lib/tkextlib/bwidget/setup.rb
@@ -2,7 +2,7 @@
# 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
+# 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
index 0a45b045fb..48358baa5c 100644
--- a/ext/tk/lib/tkextlib/bwidget/spinbox.rb
+++ b/ext/tk/lib/tkextlib/bwidget/spinbox.rb
@@ -20,7 +20,7 @@ class Tk::BWidget::SpinBox
TkCommandNames = ['SpinBox'.freeze].freeze
WidgetClassName = 'SpinBox'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
def __strval_optkeys
super() << 'helptext' << 'insertbackground' << 'entryfg' << 'entrybg'
diff --git a/ext/tk/lib/tkextlib/bwidget/statusbar.rb b/ext/tk/lib/tkextlib/bwidget/statusbar.rb
index 5c5dd43fe4..39c678d37e 100644
--- a/ext/tk/lib/tkextlib/bwidget/statusbar.rb
+++ b/ext/tk/lib/tkextlib/bwidget/statusbar.rb
@@ -17,10 +17,10 @@ end
class Tk::BWidget::StatusBar
TkCommandNames = ['StatusBar'.freeze].freeze
WidgetClassName = 'StatusBar'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
def __boolval_optkeys
- super() << 'showresize' << 'showseparator' << 'showresizesep'
+ super() << 'showresize'
end
private :__boolval_optkeys
@@ -29,17 +29,7 @@ class Tk::BWidget::StatusBar
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'
+ def delete(*wins)
tk_send('delete', *wins)
self
end
@@ -57,6 +47,6 @@ class Tk::BWidget::StatusBar
end
def items
- simplelist(tk_send('items')).map{|w| window(w)}
+ list(tk_send('items'))
end
end
diff --git a/ext/tk/lib/tkextlib/bwidget/titleframe.rb b/ext/tk/lib/tkextlib/bwidget/titleframe.rb
index 71879111c1..68534e66e9 100644
--- a/ext/tk/lib/tkextlib/bwidget/titleframe.rb
+++ b/ext/tk/lib/tkextlib/bwidget/titleframe.rb
@@ -17,7 +17,7 @@ end
class Tk::BWidget::TitleFrame
TkCommandNames = ['TitleFrame'.freeze].freeze
WidgetClassName = 'TitleFrame'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
def get_frame(&b)
win = window(tk_send_without_enc('getframe'))
diff --git a/ext/tk/lib/tkextlib/bwidget/tree.rb b/ext/tk/lib/tkextlib/bwidget/tree.rb
index 089c482fe8..aed4512a73 100644
--- a/ext/tk/lib/tkextlib/bwidget/tree.rb
+++ b/ext/tk/lib/tkextlib/bwidget/tree.rb
@@ -22,11 +22,11 @@ class Tk::BWidget::Tree
TkCommandNames = ['Tree'.freeze].freeze
WidgetClassName = 'Tree'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
class Event_for_Items < TkEvent::Event
def self._get_extra_args_tbl
- [
+ [
TkComm.method(:string) # item idenfier
]
end
@@ -38,7 +38,7 @@ class Tk::BWidget::Tree
private :__strval_optkeys
def __boolval_optkeys
- super() << 'dragenabled' << 'dropenabled' <<
+ super() << 'dragenabled' << 'dropenabled' <<
'redraw' << 'selectfill' << 'showlines'
end
private :__boolval_optkeys
@@ -57,37 +57,6 @@ class Tk::BWidget::Tree
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
@@ -99,7 +68,7 @@ class Tk::BWidget::Tree
else
cmd = Proc.new
end
- _bind_for_event_class(Event_for_Items, [path, 'bindImage'],
+ _bind_for_event_class(Event_for_Items, [path, 'bindImage'],
context, cmd, *args)
self
end
@@ -115,7 +84,7 @@ class Tk::BWidget::Tree
else
cmd = Proc.new
end
- _bind_append_for_event_class(Event_for_Items, [path, 'bindImage'],
+ _bind_append_for_event_class(Event_for_Items, [path, 'bindImage'],
context, cmd, *args)
self
end
@@ -140,7 +109,7 @@ class Tk::BWidget::Tree
else
cmd = Proc.new
end
- _bind_for_event_class(Event_for_Items, [path, 'bindText'],
+ _bind_for_event_class(Event_for_Items, [path, 'bindText'],
context, cmd, *args)
self
end
@@ -156,7 +125,7 @@ class Tk::BWidget::Tree
else
cmd = Proc.new
end
- _bind_append_for_event_class(Event_for_Items, [path, 'bindText'],
+ _bind_append_for_event_class(Event_for_Items, [path, 'bindText'],
context, cmd, *args)
self
end
@@ -189,16 +158,6 @@ class Tk::BWidget::Tree
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
@@ -208,10 +167,6 @@ class Tk::BWidget::Tree
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
@@ -228,7 +183,7 @@ class Tk::BWidget::Tree
end
def open?(node)
- bool(self.itemcget(tagid(node), 'open'))
+ bool(@tree.itemcget(tagid(node), 'open'))
end
def open_tree(node, recurse=None)
@@ -251,7 +206,7 @@ class Tk::BWidget::Tree
end
def selection_add(*args)
- tk_send_without_enc('selection', 'add',
+ tk_send_without_enc('selection', 'add',
*(args.collect{|node| tagid(node)}))
self
end
@@ -266,30 +221,30 @@ class Tk::BWidget::Tree
end
def selection_include?(*args)
- bool(tk_send_without_enc('selection', 'get',
+ bool(tk_send_without_enc('selection', 'get',
*(args.collect{|node| tagid(node)})))
end
def selection_range(*args)
- tk_send_without_enc('selection', 'range',
+ tk_send_without_enc('selection', 'range',
*(args.collect{|node| tagid(node)}))
self
end
def selection_remove(*args)
- tk_send_without_enc('selection', 'remove',
+ tk_send_without_enc('selection', 'remove',
*(args.collect{|node| tagid(node)}))
self
end
def selection_set(*args)
- tk_send_without_enc('selection', 'set',
+ tk_send_without_enc('selection', 'set',
*(args.collect{|node| tagid(node)}))
self
end
def selection_toggle(*args)
- tk_send_without_enc('selection', 'toggle',
+ tk_send_without_enc('selection', 'toggle',
*(args.collect{|node| tagid(node)}))
self
end
@@ -309,7 +264,7 @@ class Tk::BWidget::Tree::Node
TreeNode_TBL = TkCore::INTERP.create_table
- (TreeNode_ID = ['bw:node'.freeze, TkUtil.untrust('00000')]).instance_eval{
+ (TreeNode_ID = ['bw:node'.freeze, '00000'.taint]).instance_eval{
@mutex = Mutex.new
def mutex; @mutex; end
freeze
@@ -343,7 +298,7 @@ class Tk::BWidget::Tree::Node
@tree = tree.tree
parent = tree.parent
else
- fail RuntimeError,
+ fail RuntimeError,
"expect Tk::BWidget::Tree or Tk::BWidget::Tree::Node for 1st argument"
end
@@ -400,9 +355,6 @@ class Tk::BWidget::Tree::Node
val
end
- def cget_tkstring(key)
- @tree.itemcget_tkstring(@id, key)
- end
def cget(key)
@tree.itemcget(@id, key)
end
@@ -498,3 +450,4 @@ class Tk::BWidget::Tree::Node
@tree.visible(@id)
end
end
+
diff --git a/ext/tk/lib/tkextlib/itcl/incr_tcl.rb b/ext/tk/lib/tkextlib/itcl/incr_tcl.rb
index 8f6bb33abe..2b75d62eb9 100644
--- a/ext/tk/lib/tkextlib/itcl/incr_tcl.rb
+++ b/ext/tk/lib/tkextlib/itcl/incr_tcl.rb
@@ -40,12 +40,12 @@ module Tk
class ItclObject < TkObject
ITCL_CLASSNAME = ''.freeze
- (ITCL_OBJ_ID = ['itclobj'.freeze, TkUtil.untrust('00000')]).instance_eval{
+ (ITCL_OBJ_ID = ['itclobj'.freeze, '00000'.taint]).instance_eval{
@mutex = Mutex.new
def mutex; @mutex; end
freeze
}
- ITCL_OBJ_TBL = TkUtil.untrust({})
+ ITCL_OBJ_TBL = {}.taint
def initialize(*args)
if (@klass = self.class::ITCL_CLASSNAME).empty?
diff --git a/ext/tk/lib/tkextlib/itcl/setup.rb b/ext/tk/lib/tkextlib/itcl/setup.rb
index 70b38e4916..5be0588703 100644
--- a/ext/tk/lib/tkextlib/itcl/setup.rb
+++ b/ext/tk/lib/tkextlib/itcl/setup.rb
@@ -2,8 +2,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
+# 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/itk/incr_tk.rb b/ext/tk/lib/tkextlib/itk/incr_tk.rb
index 989585e33b..e06deb552c 100644
--- a/ext/tk/lib/tkextlib/itk/incr_tk.rb
+++ b/ext/tk/lib/tkextlib/itk/incr_tk.rb
@@ -99,7 +99,7 @@ module Tk
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
@@ -111,7 +111,7 @@ module Tk
class Toplevel < Archetype
TkCommandNames = ['::itk::Toplevel'].freeze
WidgetClassName = 'Toplevel'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
include Wm
include TkMenuSpec
@@ -127,7 +127,7 @@ module Tk
class Widget < Archetype
TkCommandNames = ['::itk::Widget'].freeze
WidgetClassName = 'Widget'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
end
@@ -146,7 +146,7 @@ module Tk
ComponentID_TBL = TkCore::INTERP.create_table
- (Itk_Component_ID = ['itk:component'.freeze, TkUtil.untrust('00000')]).instance_eval{
+ (Itk_Component_ID = ['itk:component'.freeze, '00000'.taint]).instance_eval{
@mutex = Mutex.new
def mutex; @mutex; end
freeze
@@ -192,7 +192,7 @@ module Tk
ComponentID_TBL.mutex.synchronize{
if ComponentID_TBL.key?(master)
if ComponentID_TBL[master].key?(component)
- return ComponentID_TBL[master][component]
+ return ComponentID_TBL[master][component]
end
else
ComponentID_TBL[master] = {}
diff --git a/ext/tk/lib/tkextlib/itk/setup.rb b/ext/tk/lib/tkextlib/itk/setup.rb
index 544926efe0..e47b64adae 100644
--- a/ext/tk/lib/tkextlib/itk/setup.rb
+++ b/ext/tk/lib/tkextlib/itk/setup.rb
@@ -2,8 +2,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
+# 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/buttonbox.rb b/ext/tk/lib/tkextlib/iwidgets/buttonbox.rb
index 91e06d1b52..05d58c386f 100644
--- a/ext/tk/lib/tkextlib/iwidgets/buttonbox.rb
+++ b/ext/tk/lib/tkextlib/iwidgets/buttonbox.rb
@@ -16,7 +16,7 @@ end
class Tk::Iwidgets::Buttonbox
TkCommandNames = ['::iwidgets::buttonbox'.freeze].freeze
WidgetClassName = 'Buttonbox'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
####################################
@@ -46,14 +46,13 @@ class Tk::Iwidgets::Buttonbox
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 :itemcget, :itemcget_strict
private :itemconfigure, :itemconfiginfo, :current_itemconfiginfo
####################################
diff --git a/ext/tk/lib/tkextlib/iwidgets/calendar.rb b/ext/tk/lib/tkextlib/iwidgets/calendar.rb
index a5478c7cc6..8495f0e29b 100644
--- a/ext/tk/lib/tkextlib/iwidgets/calendar.rb
+++ b/ext/tk/lib/tkextlib/iwidgets/calendar.rb
@@ -16,11 +16,11 @@ end
class Tk::Iwidgets::Calendar
TkCommandNames = ['::iwidgets::calendar'.freeze].freeze
WidgetClassName = 'Calendar'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
def __strval_optkeys
super() + [
- 'buttonforeground', 'outline', 'selectcolor',
+ 'buttonforeground', 'outline', 'selectcolor',
'weekdaybackground', 'weekendbackground'
]
end
diff --git a/ext/tk/lib/tkextlib/iwidgets/canvasprintbox.rb b/ext/tk/lib/tkextlib/iwidgets/canvasprintbox.rb
index 398eec3f1a..fa5e90ad05 100644
--- a/ext/tk/lib/tkextlib/iwidgets/canvasprintbox.rb
+++ b/ext/tk/lib/tkextlib/iwidgets/canvasprintbox.rb
@@ -16,7 +16,7 @@ end
class Tk::Iwidgets::Canvasprintbox
TkCommandNames = ['::iwidgets::canvasprintbox'.freeze].freeze
WidgetClassName = 'Canvasprintbox'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
def __strval_optkeys
super() << 'filename'
diff --git a/ext/tk/lib/tkextlib/iwidgets/canvasprintdialog.rb b/ext/tk/lib/tkextlib/iwidgets/canvasprintdialog.rb
index e64d8154ca..bbf507677c 100644
--- a/ext/tk/lib/tkextlib/iwidgets/canvasprintdialog.rb
+++ b/ext/tk/lib/tkextlib/iwidgets/canvasprintdialog.rb
@@ -16,7 +16,7 @@ end
class Tk::Iwidgets::Canvasprintdialog
TkCommandNames = ['::iwidgets::canvasprintdialog'.freeze].freeze
WidgetClassName = 'Canvasprintdialog'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
def get_output
tk_call(@path, 'getoutput')
diff --git a/ext/tk/lib/tkextlib/iwidgets/checkbox.rb b/ext/tk/lib/tkextlib/iwidgets/checkbox.rb
index a7476c824e..c85d356c55 100644
--- a/ext/tk/lib/tkextlib/iwidgets/checkbox.rb
+++ b/ext/tk/lib/tkextlib/iwidgets/checkbox.rb
@@ -16,7 +16,7 @@ end
class Tk::Iwidgets::Checkbox
TkCommandNames = ['::iwidgets::checkbox'.freeze].freeze
WidgetClassName = 'Checkbox'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
####################################
@@ -46,14 +46,13 @@ class Tk::Iwidgets::Checkbox
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 :itemcget, :itemcget_strict
private :itemconfigure, :itemconfiginfo, :current_itemconfiginfo
####################################
diff --git a/ext/tk/lib/tkextlib/iwidgets/combobox.rb b/ext/tk/lib/tkextlib/iwidgets/combobox.rb
index 82dcf25d0b..a6d54d78fa 100644
--- a/ext/tk/lib/tkextlib/iwidgets/combobox.rb
+++ b/ext/tk/lib/tkextlib/iwidgets/combobox.rb
@@ -16,7 +16,7 @@ end
class Tk::Iwidgets::Combobox
TkCommandNames = ['::iwidgets::combobox'.freeze].freeze
WidgetClassName = 'Combobox'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
def __boolval_optkeys
super() << 'completion' << 'dropdown' << 'editable' << 'unique'
diff --git a/ext/tk/lib/tkextlib/iwidgets/dateentry.rb b/ext/tk/lib/tkextlib/iwidgets/dateentry.rb
index 98a0051e55..0a8897f50d 100644
--- a/ext/tk/lib/tkextlib/iwidgets/dateentry.rb
+++ b/ext/tk/lib/tkextlib/iwidgets/dateentry.rb
@@ -16,5 +16,5 @@ end
class Tk::Iwidgets::Dateentry
TkCommandNames = ['::iwidgets::dateentry'.freeze].freeze
WidgetClassName = 'Dateentry'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
end
diff --git a/ext/tk/lib/tkextlib/iwidgets/datefield.rb b/ext/tk/lib/tkextlib/iwidgets/datefield.rb
index 50d5405a3b..632f3334dc 100644
--- a/ext/tk/lib/tkextlib/iwidgets/datefield.rb
+++ b/ext/tk/lib/tkextlib/iwidgets/datefield.rb
@@ -16,7 +16,7 @@ end
class Tk::Iwidgets::Datefield
TkCommandNames = ['::iwidgets::datefield'.freeze].freeze
WidgetClassName = 'Datefield'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
def __boolval_optkeys
super() << 'gmt'
diff --git a/ext/tk/lib/tkextlib/iwidgets/dialog.rb b/ext/tk/lib/tkextlib/iwidgets/dialog.rb
index 2d554ca7b5..8540eae1b5 100644
--- a/ext/tk/lib/tkextlib/iwidgets/dialog.rb
+++ b/ext/tk/lib/tkextlib/iwidgets/dialog.rb
@@ -16,5 +16,5 @@ end
class Tk::Iwidgets::Dialog
TkCommandNames = ['::iwidgets::dialog'.freeze].freeze
WidgetClassName = 'Dialog'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
end
diff --git a/ext/tk/lib/tkextlib/iwidgets/dialogshell.rb b/ext/tk/lib/tkextlib/iwidgets/dialogshell.rb
index e880594532..8d43cc07ab 100644
--- a/ext/tk/lib/tkextlib/iwidgets/dialogshell.rb
+++ b/ext/tk/lib/tkextlib/iwidgets/dialogshell.rb
@@ -16,7 +16,7 @@ end
class Tk::Iwidgets::Dialogshell
TkCommandNames = ['::iwidgets::dialogshell'.freeze].freeze
WidgetClassName = 'Dialogshell'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
####################################
@@ -46,14 +46,13 @@ class Tk::Iwidgets::Dialogshell
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 :itemcget, :itemcget_strict
private :itemconfigure, :itemconfiginfo, :current_itemconfiginfo
####################################
diff --git a/ext/tk/lib/tkextlib/iwidgets/disjointlistbox.rb b/ext/tk/lib/tkextlib/iwidgets/disjointlistbox.rb
index 07ab025cdf..9bc063ba69 100644
--- a/ext/tk/lib/tkextlib/iwidgets/disjointlistbox.rb
+++ b/ext/tk/lib/tkextlib/iwidgets/disjointlistbox.rb
@@ -16,7 +16,7 @@ end
class Tk::Iwidgets::Disjointlistbox
TkCommandNames = ['::iwidgets::disjointlistbox'.freeze].freeze
WidgetClassName = 'Disjointlistbox'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
def __strval_optkeys
super() << 'lhslabeltext' << 'rhslabeltext' << 'lhsbuttonlabel' << 'rhsbuttonlabel'
diff --git a/ext/tk/lib/tkextlib/iwidgets/entryfield.rb b/ext/tk/lib/tkextlib/iwidgets/entryfield.rb
index 3e7149a662..d53df216bf 100644
--- a/ext/tk/lib/tkextlib/iwidgets/entryfield.rb
+++ b/ext/tk/lib/tkextlib/iwidgets/entryfield.rb
@@ -16,7 +16,7 @@ end
class Tk::Iwidgets::Entryfield
TkCommandNames = ['::iwidgets::entryfield'.freeze].freeze
WidgetClassName = 'Entryfield'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
def __font_optkeys
super() << 'textfont'
@@ -30,16 +30,16 @@ class Tk::Iwidgets::Entryfield
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 ],
+ 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) ],
+ PROC_TBL = [
+ [ ?s, TkComm.method(:string) ],
+ [ ?w, TkComm.method(:window) ],
nil
]
diff --git a/ext/tk/lib/tkextlib/iwidgets/extbutton.rb b/ext/tk/lib/tkextlib/iwidgets/extbutton.rb
index e744fba91a..158d9d474a 100644
--- a/ext/tk/lib/tkextlib/iwidgets/extbutton.rb
+++ b/ext/tk/lib/tkextlib/iwidgets/extbutton.rb
@@ -16,7 +16,7 @@ end
class Tk::Iwidgets::Extbutton
TkCommandNames = ['::iwidgets::extbutton'.freeze].freeze
WidgetClassName = 'Extbutton'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
def __strval_optkeys
super() << 'bitmapforeground' << 'ringbackground'
diff --git a/ext/tk/lib/tkextlib/iwidgets/extfileselectionbox.rb b/ext/tk/lib/tkextlib/iwidgets/extfileselectionbox.rb
index 2ff15bb509..501f4c90a0 100644
--- a/ext/tk/lib/tkextlib/iwidgets/extfileselectionbox.rb
+++ b/ext/tk/lib/tkextlib/iwidgets/extfileselectionbox.rb
@@ -16,11 +16,11 @@ end
class Tk::Iwidgets::Extfileselectionbox
TkCommandNames = ['::iwidgets::extfileselectionbox'.freeze].freeze
WidgetClassName = 'Extfileselectionbox'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
def __strval_optkeys
super() + [
- 'dirslabel', 'fileslabel', 'filterlabel', 'mask', 'nomatchstring',
+ 'dirslabel', 'fileslabel', 'filterlabel', 'mask', 'nomatchstring',
'selectionlabel'
]
end
diff --git a/ext/tk/lib/tkextlib/iwidgets/extfileselectiondialog.rb b/ext/tk/lib/tkextlib/iwidgets/extfileselectiondialog.rb
index 509fdcf636..14388be7c4 100644
--- a/ext/tk/lib/tkextlib/iwidgets/extfileselectiondialog.rb
+++ b/ext/tk/lib/tkextlib/iwidgets/extfileselectiondialog.rb
@@ -16,7 +16,7 @@ end
class Tk::Iwidgets::Extfileselectiondialog
TkCommandNames = ['::iwidgets::extfileselectiondialog'.freeze].freeze
WidgetClassName = 'Extfileselectiondialog'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
def child_site
window(tk_call(@path, 'childsite'))
diff --git a/ext/tk/lib/tkextlib/iwidgets/feedback.rb b/ext/tk/lib/tkextlib/iwidgets/feedback.rb
index 29d04c8a5d..0a25237a24 100644
--- a/ext/tk/lib/tkextlib/iwidgets/feedback.rb
+++ b/ext/tk/lib/tkextlib/iwidgets/feedback.rb
@@ -16,7 +16,7 @@ end
class Tk::Iwidgets::Feedback
TkCommandNames = ['::iwidgets::feedback'.freeze].freeze
WidgetClassName = 'Feedback'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
def __strval_optkeys
super() << 'barcolor'
diff --git a/ext/tk/lib/tkextlib/iwidgets/fileselectionbox.rb b/ext/tk/lib/tkextlib/iwidgets/fileselectionbox.rb
index a425b53b5f..7b331d0b40 100644
--- a/ext/tk/lib/tkextlib/iwidgets/fileselectionbox.rb
+++ b/ext/tk/lib/tkextlib/iwidgets/fileselectionbox.rb
@@ -16,11 +16,11 @@ end
class Tk::Iwidgets::Fileselectionbox
TkCommandNames = ['::iwidgets::fileselectionbox'.freeze].freeze
WidgetClassName = 'Fileselectionbox'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
def __strval_optkeys
super() + [
- 'directory', 'dirslabel', 'fileslabel', 'filterlabel', 'mask',
+ 'directory', 'dirslabel', 'fileslabel', 'filterlabel', 'mask',
'nomatchstring', 'selectionlabel'
]
end
diff --git a/ext/tk/lib/tkextlib/iwidgets/fileselectiondialog.rb b/ext/tk/lib/tkextlib/iwidgets/fileselectiondialog.rb
index ebcdaf8c0b..50f459e56d 100644
--- a/ext/tk/lib/tkextlib/iwidgets/fileselectiondialog.rb
+++ b/ext/tk/lib/tkextlib/iwidgets/fileselectiondialog.rb
@@ -16,7 +16,7 @@ end
class Tk::Iwidgets::Fileselectiondialog
TkCommandNames = ['::iwidgets::fileselectiondialog'.freeze].freeze
WidgetClassName = 'Fileselectiondialog'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
def child_site
window(tk_call(@path, 'childsite'))
diff --git a/ext/tk/lib/tkextlib/iwidgets/finddialog.rb b/ext/tk/lib/tkextlib/iwidgets/finddialog.rb
index 3d522e07c8..75e219c37e 100644
--- a/ext/tk/lib/tkextlib/iwidgets/finddialog.rb
+++ b/ext/tk/lib/tkextlib/iwidgets/finddialog.rb
@@ -16,11 +16,11 @@ end
class Tk::Iwidgets::Finddialog
TkCommandNames = ['::iwidgets::finddialog'.freeze].freeze
WidgetClassName = 'Finddialog'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
def __strval_optkeys
super() + [
- 'patternbackground', 'patternforeground',
+ 'patternbackground', 'patternforeground',
'searchbackground', 'searchforeground'
]
end
diff --git a/ext/tk/lib/tkextlib/iwidgets/hierarchy.rb b/ext/tk/lib/tkextlib/iwidgets/hierarchy.rb
index cb9301d0c9..d9220fecbf 100644
--- a/ext/tk/lib/tkextlib/iwidgets/hierarchy.rb
+++ b/ext/tk/lib/tkextlib/iwidgets/hierarchy.rb
@@ -20,7 +20,7 @@ class Tk::Iwidgets::Hierarchy
TkCommandNames = ['::iwidgets::hierarchy'.freeze].freeze
WidgetClassName = 'Hierarchy'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
####################################
@@ -64,15 +64,15 @@ class Tk::Iwidgets::Hierarchy
class IndicatorCommand < TkValidateCommand
class ValidateArgs < TkUtil::CallbackSubst
- KEY_TBL = [
- [ ?n, ?s, :node ],
- [ ?s, ?b, :status ],
+ KEY_TBL = [
+ [ ?n, ?s, :node ],
+ [ ?s, ?b, :status ],
nil
]
- PROC_TBL = [
- [ ?s, TkComm.method(:string) ],
- [ ?b, TkComm.method(:bool) ],
+ PROC_TBL = [
+ [ ?s, TkComm.method(:string) ],
+ [ ?b, TkComm.method(:bool) ],
nil
]
@@ -109,9 +109,9 @@ class Tk::Iwidgets::Hierarchy
class IconCommand < TkValidateCommand
class ValidateArgs < TkUtil::CallbackSubst
- KEY_TBL = [
- [ ?n, ?s, :node ],
- [ ?i, ?s, :icon ],
+ KEY_TBL = [
+ [ ?n, ?s, :node ],
+ [ ?i, ?s, :icon ],
nil
]
PROC_TBL = [ [ ?s, TkComm.method(:string) ], nil ]
@@ -270,7 +270,7 @@ class Tk::Iwidgets::Hierarchy
end
def compare(idx1, op, idx2)
- bool(tk_send_without_enc('compare', _get_eval_enc_str(idx1),
+ bool(tk_send_without_enc('compare', _get_eval_enc_str(idx1),
op, _get_eval_enc_str(idx2)))
end
diff --git a/ext/tk/lib/tkextlib/iwidgets/hyperhelp.rb b/ext/tk/lib/tkextlib/iwidgets/hyperhelp.rb
index d4ea1aac65..77b0e090cd 100644
--- a/ext/tk/lib/tkextlib/iwidgets/hyperhelp.rb
+++ b/ext/tk/lib/tkextlib/iwidgets/hyperhelp.rb
@@ -16,7 +16,7 @@ end
class Tk::Iwidgets::Hyperhelp
TkCommandNames = ['::iwidgets::hyperhelp'.freeze].freeze
WidgetClassName = 'Hyperhelp'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
def __strval_optkeys
super() << 'helpdir'
diff --git a/ext/tk/lib/tkextlib/iwidgets/labeledframe.rb b/ext/tk/lib/tkextlib/iwidgets/labeledframe.rb
index 6595398427..e77e85045d 100644
--- a/ext/tk/lib/tkextlib/iwidgets/labeledframe.rb
+++ b/ext/tk/lib/tkextlib/iwidgets/labeledframe.rb
@@ -16,7 +16,7 @@ end
class Tk::Iwidgets::Labeledframe
TkCommandNames = ['::iwidgets::labeledframe'.freeze].freeze
WidgetClassName = 'Labeledframe'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
def __strval_optkeys
super() << 'labeltext'
diff --git a/ext/tk/lib/tkextlib/iwidgets/labeledwidget.rb b/ext/tk/lib/tkextlib/iwidgets/labeledwidget.rb
index d36d42878d..99387710cb 100644
--- a/ext/tk/lib/tkextlib/iwidgets/labeledwidget.rb
+++ b/ext/tk/lib/tkextlib/iwidgets/labeledwidget.rb
@@ -18,7 +18,7 @@ class Tk::Iwidgets::Labeledwidget
TkCommandNames = ['::iwidgets::labeledwidget'.freeze].freeze
WidgetClassName = 'Labeledwidget'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
def __strval_optkeys
super() << 'labeltext'
diff --git a/ext/tk/lib/tkextlib/iwidgets/mainwindow.rb b/ext/tk/lib/tkextlib/iwidgets/mainwindow.rb
index ebf48021db..4b2541b997 100644
--- a/ext/tk/lib/tkextlib/iwidgets/mainwindow.rb
+++ b/ext/tk/lib/tkextlib/iwidgets/mainwindow.rb
@@ -16,7 +16,7 @@ end
class Tk::Iwidgets::Mainwindow
TkCommandNames = ['::iwidgets::mainwindow'.freeze].freeze
WidgetClassName = 'Mainwindow'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
def __boolval_optkeys
super() << 'helpline' << 'statusline'
diff --git a/ext/tk/lib/tkextlib/iwidgets/menubar.rb b/ext/tk/lib/tkextlib/iwidgets/menubar.rb
index f9a17d0b55..5aaefbe50d 100644
--- a/ext/tk/lib/tkextlib/iwidgets/menubar.rb
+++ b/ext/tk/lib/tkextlib/iwidgets/menubar.rb
@@ -16,7 +16,7 @@ end
class Tk::Iwidgets::Menubar
TkCommandNames = ['::iwidgets::menubar'.freeze].freeze
WidgetClassName = 'Menubar'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
def __strval_optkeys
super() << 'menubuttons'
@@ -61,14 +61,13 @@ class Tk::Iwidgets::Menubar
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 :itemcget, :itemcget_strict
private :itemconfigure, :itemconfiginfo, :current_itemconfiginfo
####################################
diff --git a/ext/tk/lib/tkextlib/iwidgets/messagebox.rb b/ext/tk/lib/tkextlib/iwidgets/messagebox.rb
index 6adb53d941..98ac32900c 100644
--- a/ext/tk/lib/tkextlib/iwidgets/messagebox.rb
+++ b/ext/tk/lib/tkextlib/iwidgets/messagebox.rb
@@ -16,7 +16,7 @@ end
class Tk::Iwidgets::Messagebox
TkCommandNames = ['::iwidgets::messagebox'.freeze].freeze
WidgetClassName = 'Messagebox'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
####################################
@@ -46,14 +46,13 @@ class Tk::Iwidgets::Messagebox
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 :itemcget, :itemcget_strict
private :itemconfigure, :itemconfiginfo, :current_itemconfiginfo
####################################
diff --git a/ext/tk/lib/tkextlib/iwidgets/messagedialog.rb b/ext/tk/lib/tkextlib/iwidgets/messagedialog.rb
index 9aa590056f..c19b83e517 100644
--- a/ext/tk/lib/tkextlib/iwidgets/messagedialog.rb
+++ b/ext/tk/lib/tkextlib/iwidgets/messagedialog.rb
@@ -16,5 +16,5 @@ end
class Tk::Iwidgets::Messagedialog
TkCommandNames = ['::iwidgets::messagedialog'.freeze].freeze
WidgetClassName = 'Messagedialog'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
end
diff --git a/ext/tk/lib/tkextlib/iwidgets/notebook.rb b/ext/tk/lib/tkextlib/iwidgets/notebook.rb
index 7ed4126a4d..03b50633df 100644
--- a/ext/tk/lib/tkextlib/iwidgets/notebook.rb
+++ b/ext/tk/lib/tkextlib/iwidgets/notebook.rb
@@ -16,7 +16,7 @@ end
class Tk::Iwidgets::Notebook
TkCommandNames = ['::iwidgets::notebook'.freeze].freeze
WidgetClassName = 'Notebook'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
####################################
@@ -41,14 +41,13 @@ class Tk::Iwidgets::Notebook
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 :itemcget, :itemcget_strict
private :itemconfigure, :itemconfiginfo, :current_itemconfiginfo
####################################
diff --git a/ext/tk/lib/tkextlib/iwidgets/optionmenu.rb b/ext/tk/lib/tkextlib/iwidgets/optionmenu.rb
index 57a3cc7d2b..0c74440be7 100644
--- a/ext/tk/lib/tkextlib/iwidgets/optionmenu.rb
+++ b/ext/tk/lib/tkextlib/iwidgets/optionmenu.rb
@@ -16,7 +16,7 @@ end
class Tk::Iwidgets::Optionmenu
TkCommandNames = ['::iwidgets::optionmenu'.freeze].freeze
WidgetClassName = 'Optionmenu'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
def __boolval_optkeys
super() << 'cyclicon'
diff --git a/ext/tk/lib/tkextlib/iwidgets/panedwindow.rb b/ext/tk/lib/tkextlib/iwidgets/panedwindow.rb
index 65463cc85a..3bf73d69fe 100644
--- a/ext/tk/lib/tkextlib/iwidgets/panedwindow.rb
+++ b/ext/tk/lib/tkextlib/iwidgets/panedwindow.rb
@@ -16,7 +16,7 @@ end
class Tk::Iwidgets::Panedwindow
TkCommandNames = ['::iwidgets::panedwindow'.freeze].freeze
WidgetClassName = 'Panedwindow'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
####################################
@@ -41,14 +41,13 @@ class Tk::Iwidgets::Panedwindow
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 :itemcget, :itemcget_strict
private :itemconfigure, :itemconfiginfo, :current_itemconfiginfo
####################################
diff --git a/ext/tk/lib/tkextlib/iwidgets/promptdialog.rb b/ext/tk/lib/tkextlib/iwidgets/promptdialog.rb
index 7c7ff7ad62..620b14b5d5 100644
--- a/ext/tk/lib/tkextlib/iwidgets/promptdialog.rb
+++ b/ext/tk/lib/tkextlib/iwidgets/promptdialog.rb
@@ -16,7 +16,7 @@ end
class Tk::Iwidgets::Promptdialog
TkCommandNames = ['::iwidgets::promptdialog'.freeze].freeze
WidgetClassName = 'Promptdialog'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
# index method is not available, because it shows index of the entry field
def default(name)
diff --git a/ext/tk/lib/tkextlib/iwidgets/pushbutton.rb b/ext/tk/lib/tkextlib/iwidgets/pushbutton.rb
index ae56788289..c21007ca6c 100644
--- a/ext/tk/lib/tkextlib/iwidgets/pushbutton.rb
+++ b/ext/tk/lib/tkextlib/iwidgets/pushbutton.rb
@@ -16,7 +16,7 @@ end
class Tk::Iwidgets::Pushbutton
TkCommandNames = ['::iwidgets::pushbutton'.freeze].freeze
WidgetClassName = 'Pushbutton'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
def __boolval_optkeys
super() << 'defaultring'
diff --git a/ext/tk/lib/tkextlib/iwidgets/radiobox.rb b/ext/tk/lib/tkextlib/iwidgets/radiobox.rb
index 21181777b5..e9d9521252 100644
--- a/ext/tk/lib/tkextlib/iwidgets/radiobox.rb
+++ b/ext/tk/lib/tkextlib/iwidgets/radiobox.rb
@@ -16,7 +16,7 @@ end
class Tk::Iwidgets::Radiobox
TkCommandNames = ['::iwidgets::radiobox'.freeze].freeze
WidgetClassName = 'Radiobox'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
####################################
@@ -46,14 +46,13 @@ class Tk::Iwidgets::Radiobox
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 :itemcget, :itemcget_strict
private :itemconfigure, :itemconfiginfo, :current_itemconfiginfo
####################################
diff --git a/ext/tk/lib/tkextlib/iwidgets/scopedobject.rb b/ext/tk/lib/tkextlib/iwidgets/scopedobject.rb
index 056cd85322..bddef50841 100644
--- a/ext/tk/lib/tkextlib/iwidgets/scopedobject.rb
+++ b/ext/tk/lib/tkextlib/iwidgets/scopedobject.rb
@@ -16,7 +16,7 @@ end
class Tk::Iwidgets::Scopedobject
TkCommandNames = ['::iwidgets::scopedobject'.freeze].freeze
WidgetClassName = 'Scopedobject'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
def initialize(obj_name, keys={})
@path = tk_call(self.class::TkCommandNames[0], obj_name, *hash_kv(keys))
diff --git a/ext/tk/lib/tkextlib/iwidgets/scrolledcanvas.rb b/ext/tk/lib/tkextlib/iwidgets/scrolledcanvas.rb
index 935e04bbcc..67ad67d07e 100644
--- a/ext/tk/lib/tkextlib/iwidgets/scrolledcanvas.rb
+++ b/ext/tk/lib/tkextlib/iwidgets/scrolledcanvas.rb
@@ -17,7 +17,7 @@ end
class Tk::Iwidgets::Scrolledcanvas
TkCommandNames = ['::iwidgets::scrolledcanvas'.freeze].freeze
WidgetClassName = 'Scrolledcanvas'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
################################
@@ -103,7 +103,7 @@ class Tk::Iwidgets::Scrolledcanvas
end
def bbox(tagOrId, *tags)
- list(tk_send_without_enc('bbox', tagid(tagOrId),
+ list(tk_send_without_enc('bbox', tagid(tagOrId),
*tags.collect{|t| tagid(t)}))
end
@@ -165,7 +165,7 @@ class Tk::Iwidgets::Scrolledcanvas
end
def dchars(tag, first, last=None)
- tk_send_without_enc('dchars', tagid(tag),
+ tk_send_without_enc('dchars', tagid(tag),
_get_eval_enc_str(first), _get_eval_enc_str(last))
self
end
@@ -176,7 +176,7 @@ class Tk::Iwidgets::Scrolledcanvas
tbl = TkcItem::CItemID_TBL[self.path]
}
if tbl
- find('withtag', *args).each{|item|
+ find('withtag', *args).each{|item|
if item.kind_of?(TkcItem)
TkcItem::CItemID_TBL.mutex.synchronize{
tbl.delete(item.id)
@@ -195,7 +195,7 @@ class Tk::Iwidgets::Scrolledcanvas
end
def find(mode, *args)
- list(tk_send_without_enc('find', mode, *args)).collect!{|id|
+ list(tk_send_without_enc('find', mode, *args)).collect!{|id|
TkcItem.id2obj(self, id)
}
end
@@ -251,7 +251,7 @@ class Tk::Iwidgets::Scrolledcanvas
end
def insert(tagOrId, index, string)
- tk_send_without_enc('insert', tagid(tagOrId), index,
+ tk_send_without_enc('insert', tagid(tagOrId), index,
_get_eval_enc_str(string))
self
end
diff --git a/ext/tk/lib/tkextlib/iwidgets/scrolledframe.rb b/ext/tk/lib/tkextlib/iwidgets/scrolledframe.rb
index 7b7b95df1c..8b47460357 100644
--- a/ext/tk/lib/tkextlib/iwidgets/scrolledframe.rb
+++ b/ext/tk/lib/tkextlib/iwidgets/scrolledframe.rb
@@ -16,7 +16,7 @@ end
class Tk::Iwidgets::Scrolledframe
TkCommandNames = ['::iwidgets::scrolledframe'.freeze].freeze
WidgetClassName = 'Scrolledframe'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
def child_site
window(tk_call(@path, 'childsite'))
diff --git a/ext/tk/lib/tkextlib/iwidgets/scrolledhtml.rb b/ext/tk/lib/tkextlib/iwidgets/scrolledhtml.rb
index dc2966bd48..9b69ef07fe 100644
--- a/ext/tk/lib/tkextlib/iwidgets/scrolledhtml.rb
+++ b/ext/tk/lib/tkextlib/iwidgets/scrolledhtml.rb
@@ -16,7 +16,7 @@ end
class Tk::Iwidgets::Scrolledhtml
TkCommandNames = ['::iwidgets::scrolledhtml'.freeze].freeze
WidgetClassName = 'Scrolledhtml'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
def __boolval_optkeys
super() << 'update'
diff --git a/ext/tk/lib/tkextlib/iwidgets/scrolledlistbox.rb b/ext/tk/lib/tkextlib/iwidgets/scrolledlistbox.rb
index 20a4cd1d36..7543d557e3 100644
--- a/ext/tk/lib/tkextlib/iwidgets/scrolledlistbox.rb
+++ b/ext/tk/lib/tkextlib/iwidgets/scrolledlistbox.rb
@@ -17,7 +17,7 @@ end
class Tk::Iwidgets::Scrolledlistbox
TkCommandNames = ['::iwidgets::scrolledlistbox'.freeze].freeze
WidgetClassName = 'Scrolledlistbox'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
def __strval_optkeys
super() << 'textbackground'
@@ -141,7 +141,7 @@ class Tk::Iwidgets::Scrolledlistbox
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),
+ tk_split_simplelist(tk_send_without_enc('get', first, last),
false, true)
else
_fromUTF8(tk_send_without_enc('get', first))
diff --git a/ext/tk/lib/tkextlib/iwidgets/scrolledtext.rb b/ext/tk/lib/tkextlib/iwidgets/scrolledtext.rb
index 69b7d314fd..d6436d202a 100644
--- a/ext/tk/lib/tkextlib/iwidgets/scrolledtext.rb
+++ b/ext/tk/lib/tkextlib/iwidgets/scrolledtext.rb
@@ -17,7 +17,7 @@ end
class Tk::Iwidgets::Scrolledtext
TkCommandNames = ['::iwidgets::scrolledtext'.freeze].freeze
WidgetClassName = 'Scrolledtext'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
def __strval_optkeys
super() << 'textbackground'
@@ -86,7 +86,7 @@ class Tk::Iwidgets::Scrolledtext
list(tk_send('bbox', index))
end
def compare(idx1, op, idx2)
- bool(tk_send_without_enc('compare', _get_eval_enc_str(idx1),
+ bool(tk_send_without_enc('compare', _get_eval_enc_str(idx1),
op, _get_eval_enc_str(idx2)))
end
@@ -116,18 +116,14 @@ class Tk::Iwidgets::Scrolledtext
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',
+ _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),
+ tk_tcl2ruby(_fromUTF8(tk_send_without_enc('image', 'cget',
+ _get_eval_enc_str(index),
"-#{slot}")))
end
end
@@ -155,13 +151,13 @@ class Tk::Iwidgets::Scrolledtext
def image_configure(index, slot, value=None)
if slot.kind_of? Hash
- _fromUTF8(tk_send_without_enc('image', 'configure',
- _get_eval_enc_str(index),
+ _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}",
+ _fromUTF8(tk_send_without_enc('image', 'configure',
+ _get_eval_enc_str(index),
+ "-#{slot}",
_get_eval_enc_str(value)))
end
self
@@ -191,16 +187,16 @@ class Tk::Iwidgets::Scrolledtext
else
if conf[3]
if conf[3].index('{')
- conf[3] = tk_split_list(conf[3])
+ conf[3] = tk_split_list(conf[3])
else
- conf[3] = tk_tcl2ruby(conf[3])
+ conf[3] = tk_tcl2ruby(conf[3])
end
end
if conf[4]
if conf[4].index('{')
- conf[4] = tk_split_list(conf[4])
+ conf[4] = tk_split_list(conf[4])
else
- conf[4] = tk_tcl2ruby(conf[4])
+ conf[4] = tk_tcl2ruby(conf[4])
end
end
end
@@ -232,16 +228,16 @@ class Tk::Iwidgets::Scrolledtext
else
if conf[2]
if conf[2].index('{')
- conf[2] = tk_split_list(conf[2])
+ conf[2] = tk_split_list(conf[2])
else
- conf[2] = tk_tcl2ruby(conf[2])
+ conf[2] = tk_tcl2ruby(conf[2])
end
end
if conf[3]
if conf[3].index('{')
- conf[3] = tk_split_list(conf[3])
+ conf[3] = tk_split_list(conf[3])
else
- conf[3] = tk_tcl2ruby(conf[3])
+ conf[3] = tk_tcl2ruby(conf[3])
end
end
end
@@ -302,7 +298,7 @@ class Tk::Iwidgets::Scrolledtext
def mark_gravity(mark, direction=nil)
if direction
- tk_send_without_enc('mark', 'gravity',
+ tk_send_without_enc('mark', 'gravity',
_get_eval_enc_str(mark), direction)
self
else
@@ -311,27 +307,27 @@ class Tk::Iwidgets::Scrolledtext
end
def mark_set(mark, index)
- tk_send_without_enc('mark', 'set', _get_eval_enc_str(mark),
+ 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',
+ 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',
+ 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',
+ tagid2obj(_fromUTF8(tk_send_without_enc('mark', 'previous',
_get_eval_enc_str(index))))
end
alias previous_mark mark_previous
@@ -358,11 +354,11 @@ class Tk::Iwidgets::Scrolledtext
# $KCODE == 'NONE'
if JAPANIZED_TK
- tk_call_without_enc('kstring', 'length',
+ tk_call_without_enc('kstring', 'length',
_get_eval_enc_str(txt)).to_i
else
begin
- tk_call_without_enc('encoding', 'convertto', 'ascii',
+ tk_call_without_enc('encoding', 'convertto', 'ascii',
_get_eval_enc_str(txt)).length
rescue StandardError, NameError
# sorry, I have no plan
@@ -423,11 +419,11 @@ class Tk::Iwidgets::Scrolledtext
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"),
+ return [index(start + " + #{pos} chars"),
_ktext_length(pat), pat.dup]
else
#return [index(start + " + #{pos} chars"), $&.split('').length]
- return [index(start + " + #{pos} chars"),
+ return [index(start + " + #{pos} chars"),
_ktext_length(match), match]
end
else
@@ -441,11 +437,11 @@ class Tk::Iwidgets::Scrolledtext
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"),
+ return [index(start + " + #{pos} chars"),
_ktext_length(pat), pat.dup]
else
#return [index(start + " + #{pos} chars"), $&.split('').length]
- return [index(start + " + #{pos} chars"),
+ return [index(start + " + #{pos} chars"),
_ktext_length(match), match]
end
else
@@ -456,7 +452,7 @@ class Tk::Iwidgets::Scrolledtext
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"),
+ return [index("1.0 + #{pos} chars"),
_ktext_length(pat), pat.dup]
else
#return [index("1.0 + #{pos} chars"), $&.split('').length]
diff --git a/ext/tk/lib/tkextlib/iwidgets/scrolledwidget.rb b/ext/tk/lib/tkextlib/iwidgets/scrolledwidget.rb
index 5ecd2d72d2..eef093d314 100644
--- a/ext/tk/lib/tkextlib/iwidgets/scrolledwidget.rb
+++ b/ext/tk/lib/tkextlib/iwidgets/scrolledwidget.rb
@@ -16,5 +16,5 @@ end
class Tk::Iwidgets::Scrolledwidget
TkCommandNames = ['::iwidgets::scrolledwidget'.freeze].freeze
WidgetClassName = 'Scrolledwidget'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
end
diff --git a/ext/tk/lib/tkextlib/iwidgets/selectionbox.rb b/ext/tk/lib/tkextlib/iwidgets/selectionbox.rb
index eb8fe3ad52..bf9b5ec30a 100644
--- a/ext/tk/lib/tkextlib/iwidgets/selectionbox.rb
+++ b/ext/tk/lib/tkextlib/iwidgets/selectionbox.rb
@@ -16,7 +16,7 @@ end
class Tk::Iwidgets::Selectionbox
TkCommandNames = ['::iwidgets::selectionbox'.freeze].freeze
WidgetClassName = 'Selectionbox'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
def __boolval_optkeys
super() << 'itemson' << 'selectionon'
diff --git a/ext/tk/lib/tkextlib/iwidgets/selectiondialog.rb b/ext/tk/lib/tkextlib/iwidgets/selectiondialog.rb
index 45aecf3266..f772ecf8c2 100644
--- a/ext/tk/lib/tkextlib/iwidgets/selectiondialog.rb
+++ b/ext/tk/lib/tkextlib/iwidgets/selectiondialog.rb
@@ -16,7 +16,7 @@ end
class Tk::Iwidgets::Selectiondialog
TkCommandNames = ['::iwidgets::selectiondialog'.freeze].freeze
WidgetClassName = 'Selectiondialog'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
def child_site
window(tk_call(@path, 'childsite'))
diff --git a/ext/tk/lib/tkextlib/iwidgets/setup.rb b/ext/tk/lib/tkextlib/iwidgets/setup.rb
index ee406c6ca0..ce0f0bd4d4 100644
--- a/ext/tk/lib/tkextlib/iwidgets/setup.rb
+++ b/ext/tk/lib/tkextlib/iwidgets/setup.rb
@@ -2,7 +2,7 @@
# 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
+# 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
index c560e3ac29..dabf2e6f25 100644
--- a/ext/tk/lib/tkextlib/iwidgets/shell.rb
+++ b/ext/tk/lib/tkextlib/iwidgets/shell.rb
@@ -16,7 +16,7 @@ end
class Tk::Iwidgets::Shell
TkCommandNames = ['::iwidgets::shell'.freeze].freeze
WidgetClassName = 'Shell'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
def activate
tk_call(@path, 'activate') # may return val of deactibate method
diff --git a/ext/tk/lib/tkextlib/iwidgets/spindate.rb b/ext/tk/lib/tkextlib/iwidgets/spindate.rb
index b3de9ed989..2c98eb4629 100644
--- a/ext/tk/lib/tkextlib/iwidgets/spindate.rb
+++ b/ext/tk/lib/tkextlib/iwidgets/spindate.rb
@@ -16,7 +16,7 @@ end
class Tk::Iwidgets::Spindate
TkCommandNames = ['::iwidgets::spindate'.freeze].freeze
WidgetClassName = 'Spindate'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
def __boolval_optkeys
super() << 'dayon' << 'monthon' << 'yearon'
diff --git a/ext/tk/lib/tkextlib/iwidgets/spinint.rb b/ext/tk/lib/tkextlib/iwidgets/spinint.rb
index bede3bb1bf..5eb944d081 100644
--- a/ext/tk/lib/tkextlib/iwidgets/spinint.rb
+++ b/ext/tk/lib/tkextlib/iwidgets/spinint.rb
@@ -16,7 +16,7 @@ end
class Tk::Iwidgets::Spinint
TkCommandNames = ['::iwidgets::spinint'.freeze].freeze
WidgetClassName = 'Spinint'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
def __boolval_optkeys
super() << 'wrap'
diff --git a/ext/tk/lib/tkextlib/iwidgets/spinner.rb b/ext/tk/lib/tkextlib/iwidgets/spinner.rb
index d960996e22..aeee5c9038 100644
--- a/ext/tk/lib/tkextlib/iwidgets/spinner.rb
+++ b/ext/tk/lib/tkextlib/iwidgets/spinner.rb
@@ -16,7 +16,7 @@ end
class Tk::Iwidgets::Spinner
TkCommandNames = ['::iwidgets::spinner'.freeze].freeze
WidgetClassName = 'Spinner'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
####################################
@@ -25,16 +25,16 @@ class Tk::Iwidgets::Spinner
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 ],
+ 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) ],
+ PROC_TBL = [
+ [ ?s, TkComm.method(:string) ],
+ [ ?w, TkComm.method(:window) ],
nil
]
diff --git a/ext/tk/lib/tkextlib/iwidgets/spintime.rb b/ext/tk/lib/tkextlib/iwidgets/spintime.rb
index 20f8197a09..0ff683ab56 100644
--- a/ext/tk/lib/tkextlib/iwidgets/spintime.rb
+++ b/ext/tk/lib/tkextlib/iwidgets/spintime.rb
@@ -16,7 +16,7 @@ end
class Tk::Iwidgets::Spintime
TkCommandNames = ['::iwidgets::spintime'.freeze].freeze
WidgetClassName = 'Spintime'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
def __boolval_optkeys
super() << 'houron' << 'militaryon' << 'minutelabel' << 'secondlabel'
diff --git a/ext/tk/lib/tkextlib/iwidgets/tabnotebook.rb b/ext/tk/lib/tkextlib/iwidgets/tabnotebook.rb
index f56efa9aaf..dbb90e5102 100644
--- a/ext/tk/lib/tkextlib/iwidgets/tabnotebook.rb
+++ b/ext/tk/lib/tkextlib/iwidgets/tabnotebook.rb
@@ -16,7 +16,7 @@ end
class Tk::Iwidgets::Tabnotebook
TkCommandNames = ['::iwidgets::tabnotebook'.freeze].freeze
WidgetClassName = 'Tabnotebook'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
####################################
@@ -46,14 +46,13 @@ class Tk::Iwidgets::Tabnotebook
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 :itemcget, :itemcget_strict
private :itemconfigure, :itemconfiginfo, :current_itemconfiginfo
####################################
diff --git a/ext/tk/lib/tkextlib/iwidgets/tabset.rb b/ext/tk/lib/tkextlib/iwidgets/tabset.rb
index 501ead4964..300ba9dee0 100644
--- a/ext/tk/lib/tkextlib/iwidgets/tabset.rb
+++ b/ext/tk/lib/tkextlib/iwidgets/tabset.rb
@@ -16,7 +16,7 @@ end
class Tk::Iwidgets::Tabset
TkCommandNames = ['::iwidgets::tabset'.freeze].freeze
WidgetClassName = 'Tabset'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
####################################
@@ -41,14 +41,13 @@ class Tk::Iwidgets::Tabset
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 :itemcget, :itemcget_strict
private :itemconfigure, :itemconfiginfo, :current_itemconfiginfo
####################################
@@ -117,9 +116,9 @@ class Tk::Iwidgets::Tabset
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} .
+ 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'
@@ -128,9 +127,9 @@ class Tk::Iwidgets::Tabset
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} .
+ 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
diff --git a/ext/tk/lib/tkextlib/iwidgets/timeentry.rb b/ext/tk/lib/tkextlib/iwidgets/timeentry.rb
index b0afb3afd9..588da77dc8 100644
--- a/ext/tk/lib/tkextlib/iwidgets/timeentry.rb
+++ b/ext/tk/lib/tkextlib/iwidgets/timeentry.rb
@@ -16,7 +16,7 @@ end
class Tk::Iwidgets::Timeentry
TkCommandNames = ['::iwidgets::timeentry'.freeze].freeze
WidgetClassName = 'Timeentry'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
def __strval_optkeys
super() << 'closetext'
diff --git a/ext/tk/lib/tkextlib/iwidgets/timefield.rb b/ext/tk/lib/tkextlib/iwidgets/timefield.rb
index c34281d4ff..28e1504797 100644
--- a/ext/tk/lib/tkextlib/iwidgets/timefield.rb
+++ b/ext/tk/lib/tkextlib/iwidgets/timefield.rb
@@ -16,7 +16,7 @@ end
class Tk::Iwidgets::Timefield
TkCommandNames = ['::iwidgets::timefield'.freeze].freeze
WidgetClassName = 'Timefield'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
def __boolval_optkeys
super() << 'gmt'
diff --git a/ext/tk/lib/tkextlib/iwidgets/toolbar.rb b/ext/tk/lib/tkextlib/iwidgets/toolbar.rb
index 5b474c3816..17cfa62156 100644
--- a/ext/tk/lib/tkextlib/iwidgets/toolbar.rb
+++ b/ext/tk/lib/tkextlib/iwidgets/toolbar.rb
@@ -16,7 +16,7 @@ end
class Tk::Iwidgets::Toolbar
TkCommandNames = ['::iwidgets::toolbar'.freeze].freeze
WidgetClassName = 'Toolbar'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
def __tkvariable_optkeys
super() << 'helpvariable'
@@ -105,7 +105,7 @@ class Tk::Iwidgets::Toolbar
else
tag = Tk::Itk::Component.new(self)
end
- window(tk_call(@path, 'insert', index(idx), type,
+ window(tk_call(@path, 'insert', index(idx), type,
tagid(tag), *hash_kv(keys)))
tag
end
diff --git a/ext/tk/lib/tkextlib/iwidgets/watch.rb b/ext/tk/lib/tkextlib/iwidgets/watch.rb
index f10ec54cb2..ab2b687cf9 100644
--- a/ext/tk/lib/tkextlib/iwidgets/watch.rb
+++ b/ext/tk/lib/tkextlib/iwidgets/watch.rb
@@ -16,7 +16,7 @@ end
class Tk::Iwidgets::Watch
TkCommandNames = ['::iwidgets::watch'.freeze].freeze
WidgetClassName = 'Watch'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
def __boolval_optkeys
super() << 'showampm'
@@ -24,7 +24,7 @@ class Tk::Iwidgets::Watch
private :__boolval_optkeys
def __strval_optkeys
- super() << 'clockcolor' << 'hourcolor' << 'minutecolor' <<
+ super() << 'clockcolor' << 'hourcolor' << 'minutecolor' <<
'pivotcolor' << 'secondcolor' << 'tickcolor'
end
private :__strval_optkeys
diff --git a/ext/tk/lib/tkextlib/pkg_checker.rb b/ext/tk/lib/tkextlib/pkg_checker.rb
index ecc6bfa131..5002ed7ff8 100755
--- a/ext/tk/lib/tkextlib/pkg_checker.rb
+++ b/ext/tk/lib/tkextlib/pkg_checker.rb
@@ -151,7 +151,7 @@ def subdir_check(dir, verbose=false)
if err.empty?
print 'Ready : ', path, ' : require->', suc.inspect, "\n"
else
- print '*LACK : ', path, ' : require->', suc.inspect,
+ print '*LACK : ', path, ' : require->', suc.inspect,
' FAIL->', err.inspect, "\n"
end
end
@@ -176,7 +176,7 @@ Dir.chdir(dir)
if err.empty?
print 'Ready : ', f, ' : require->', suc.inspect, "\n"
else
- print '*LACK : ', f, ' : require->', suc.inspect,
+ print '*LACK : ', f, ' : require->', suc.inspect,
' FAIL->', err.inspect, "\n"
end
diff --git a/ext/tk/lib/tkextlib/setup.rb b/ext/tk/lib/tkextlib/setup.rb
index 79facc5ee3..12867e8f9c 100644
--- a/ext/tk/lib/tkextlib/setup.rb
+++ b/ext/tk/lib/tkextlib/setup.rb
@@ -1,8 +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'".
+# 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
index 2831989759..c6138f4275 100644
--- a/ext/tk/lib/tkextlib/tcllib.rb
+++ b/ext/tk/lib/tkextlib/tcllib.rb
@@ -42,25 +42,19 @@ 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:: datefield
+ autoload :Datefield, 'tkextlib/tcllib/datefield'
+ autoload :DateField, 'tkextlib/tcllib/datefield'
+
# package:: ico
autoload :ICO, 'tkextlib/tcllib/ico'
@@ -68,21 +62,12 @@ module Tk
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:: swaplist
+ autoload :Swaplist_Dialog, 'tkextlib/tcllib/swaplist'
# 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'
@@ -96,7 +81,7 @@ module Tk
autoload :Tooltip, 'tkextlib/tcllib/tooltip'
# package:: widget
- autoload :Widget, 'tkextlib/tcllib/widget'
+ autoload :Wdiget, 'tkextlib/tcllib/widget'
end
end
diff --git a/ext/tk/lib/tkextlib/tcllib/autoscroll.rb b/ext/tk/lib/tkextlib/tcllib/autoscroll.rb
index 2def59bf73..7db3c2e2b7 100644
--- a/ext/tk/lib/tkextlib/tcllib/autoscroll.rb
+++ b/ext/tk/lib/tkextlib/tcllib/autoscroll.rb
@@ -7,20 +7,20 @@
#
# (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
+# 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
+# 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
+# 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.
#
@@ -110,14 +110,14 @@ end
class Tk::Scrollbar
def autoscroll
- # Arranges for the already existing scrollbar to be mapped
+ # 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.
+ # Returns the scrollbar to its original static state.
#tk_call_without_enc('::autoscroll::unautoscroll', @path)
Tk::Tcllib::Autoscroll.unautoscroll(self)
self
diff --git a/ext/tk/lib/tkextlib/tcllib/calendar.rb b/ext/tk/lib/tkextlib/tcllib/calendar.rb
deleted file mode 100644
index b6843df176..0000000000
--- a/ext/tk/lib/tkextlib/tcllib/calendar.rb
+++ /dev/null
@@ -1,55 +0,0 @@
-#
-# 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
deleted file mode 100644
index 0bd59511c1..0000000000
--- a/ext/tk/lib/tkextlib/tcllib/canvas_sqmap.rb
+++ /dev/null
@@ -1,36 +0,0 @@
-#
-# 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
deleted file mode 100644
index e2a5061112..0000000000
--- a/ext/tk/lib/tkextlib/tcllib/canvas_zoom.rb
+++ /dev/null
@@ -1,21 +0,0 @@
-#
-# 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
deleted file mode 100644
index 860b9e899b..0000000000
--- a/ext/tk/lib/tkextlib/tcllib/chatwidget.rb
+++ /dev/null
@@ -1,151 +0,0 @@
-#
-# 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
deleted file mode 100644
index 49b5361e4f..0000000000
--- a/ext/tk/lib/tkextlib/tcllib/crosshair.rb
+++ /dev/null
@@ -1,117 +0,0 @@
-#
-# 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
index 308847c233..9014037f3d 100644
--- a/ext/tk/lib/tkextlib/tcllib/ctext.rb
+++ b/ext/tk/lib/tkextlib/tcllib/ctext.rb
@@ -35,11 +35,11 @@ end
class Tk::Tcllib::CText
TkCommandNames = ['ctext'.freeze].freeze
WidgetClassName = 'Ctext'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
def create_self(keys)
if keys and keys != None
- tk_call_without_enc(self.class::TkCommandNames[0], @path,
+ tk_call_without_enc(self.class::TkCommandNames[0], @path,
*hash_kv(keys, true))
else
tk_call_without_enc(self.class::TkCommandNames[0], @path)
@@ -48,7 +48,7 @@ class Tk::Tcllib::CText
private :create_self
def __strval_optkeys
- super() << 'linemapfg' << 'linemapbg' <<
+ super() << 'linemapfg' << 'linemapbg' <<
'linemap_select_fg' << 'linemap_select_bg'
end
private :__strval_optkeys
@@ -96,19 +96,19 @@ class Tk::Tcllib::CText
end
def add_highlight_class_for_special_chars(klass, col, *chrs)
- tk_call('ctext::addHighlightClassForSpecialChars',
+ 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',
+ 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',
+ tk_call('ctext::addHighlightClassWithOnlyCharStart',
@path, klass, col, chr)
self
end
diff --git a/ext/tk/lib/tkextlib/tcllib/cursor.rb b/ext/tk/lib/tkextlib/tcllib/cursor.rb
index 5c47f9709b..9bb828e8dd 100644
--- a/ext/tk/lib/tkextlib/tcllib/cursor.rb
+++ b/ext/tk/lib/tkextlib/tcllib/cursor.rb
@@ -44,8 +44,8 @@ module Tk
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.
+ # 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)
@@ -54,15 +54,15 @@ end
class TkWindow
def cursor_propagate(cursor)
- # Sets the cursor for self and all its descendants to 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).
+ # 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
diff --git a/ext/tk/lib/tkextlib/tcllib/dateentry.rb b/ext/tk/lib/tkextlib/tcllib/dateentry.rb
deleted file mode 100644
index 77038d95bc..0000000000
--- a/ext/tk/lib/tkextlib/tcllib/dateentry.rb
+++ /dev/null
@@ -1,62 +0,0 @@
-#
-# 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
index 4c2eae741e..2244dd7a9a 100644
--- a/ext/tk/lib/tkextlib/tcllib/datefield.rb
+++ b/ext/tk/lib/tkextlib/tcllib/datefield.rb
@@ -7,12 +7,12 @@
#
# (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
+# 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
+#
+# 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'
@@ -47,7 +47,7 @@ class Tk::Tcllib::Datefield
def create_self(keys)
if keys and keys != None
- tk_call_without_enc(self.class::TkCommandNames[0], @path,
+ tk_call_without_enc(self.class::TkCommandNames[0], @path,
*hash_kv(keys, true))
else
tk_call_without_enc(self.class::TkCommandNames[0], @path)
diff --git a/ext/tk/lib/tkextlib/tcllib/diagrams.rb b/ext/tk/lib/tkextlib/tcllib/diagrams.rb
deleted file mode 100644
index d24ba9d232..0000000000
--- a/ext/tk/lib/tkextlib/tcllib/diagrams.rb
+++ /dev/null
@@ -1,224 +0,0 @@
-#
-# 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
index 86a0ef2269..825621b5a1 100644
--- a/ext/tk/lib/tkextlib/tcllib/dialog.rb
+++ b/ext/tk/lib/tkextlib/tcllib/dialog.rb
@@ -41,7 +41,7 @@ class Tk::Tcllib::Widget::Dialog
def create_self(keys)
if keys and keys != None
- tk_call_without_enc(self.class::TkCommandNames[0], @path,
+ tk_call_without_enc(self.class::TkCommandNames[0], @path,
*hash_kv(keys, true))
else
tk_call_without_enc(self.class::TkCommandNames[0], @path)
diff --git a/ext/tk/lib/tkextlib/tcllib/getstring.rb b/ext/tk/lib/tkextlib/tcllib/getstring.rb
index 48711d3b66..fc5d8b26d9 100644
--- a/ext/tk/lib/tkextlib/tcllib/getstring.rb
+++ b/ext/tk/lib/tkextlib/tcllib/getstring.rb
@@ -34,7 +34,7 @@ end
class Tk::Tcllib::GetString_Dialog
TkCommandNames = ['::getstring::tk_getString'.freeze].freeze
WidgetClassName = 'TkSDialog'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
def self.show(*args)
dialog = self.new(*args)
@@ -74,7 +74,7 @@ class Tk::Tcllib::GetString_Dialog
def show
@variable.value = ''
- @status = bool(tk_call(self.class::TkCommandNames[0],
+ @status = bool(tk_call(self.class::TkCommandNames[0],
@path, @variable, @text, *hash_kv(@keys)))
end
alias display show
diff --git a/ext/tk/lib/tkextlib/tcllib/ico.rb b/ext/tk/lib/tkextlib/tcllib/ico.rb
index 36a32c6b09..8c92926a4c 100644
--- a/ext/tk/lib/tkextlib/tcllib/ico.rb
+++ b/ext/tk/lib/tkextlib/tcllib/ico.rb
@@ -8,7 +8,7 @@
require 'tk'
require 'tk/image'
-#require 'tkextlib/tcllib.rb'
+require 'tkextlib/tcllib.rb'
# TkPackage.require('ico', '0.3')
TkPackage.require('ico')
@@ -38,39 +38,9 @@ class Tk::Tcllib::ICO
*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)
@@ -80,23 +50,23 @@ class Tk::Tcllib::ICO
def self.get_data(file, index, keys={})
keys['format'] = 'data'
- tk_split_list(tk_call_without_enc('::ico::getIcon', file, index,
+ 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,
+ 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,
+ 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,
+ tk_call_without_enc('::ico::copyIcon', exe_file, ico_file,
*hash_kv(keys, true))
end
@@ -106,7 +76,7 @@ class Tk::Tcllib::ICO
def self.transparent_color(image, color)
if image.kind_of?(Array)
- tk_split_list(tk_call_without_enc('::ico::transparentColor',
+ tk_split_list(tk_call_without_enc('::ico::transparentColor',
image, color))
else
tk_call_without_enc('::ico::transparentColor', image, color)
@@ -129,7 +99,7 @@ class Tk::Tcllib::ICO
Tk_Image_ID[1].succ!
}
end
- tk_call_without_enc('::ico::getIcon', file, index, '-name', @path,
+ tk_call_without_enc('::ico::getIcon', file, index, '-name', @path,
'-format', 'image', *hash_kv(keys, true))
Tk_IMGTBL[@path] = self
end
diff --git a/ext/tk/lib/tkextlib/tcllib/ip_entry.rb b/ext/tk/lib/tkextlib/tcllib/ip_entry.rb
index e5e0f8d42d..c4b8240c04 100644
--- a/ext/tk/lib/tkextlib/tcllib/ip_entry.rb
+++ b/ext/tk/lib/tkextlib/tcllib/ip_entry.rb
@@ -7,7 +7,7 @@
#
# (The following is the original description of the library.)
#
-# This package provides a widget for the entering of a IP address.
+# This package provides a widget for the entering of a IP address.
# It guarantees a valid address at all times.
require 'tk'
@@ -33,22 +33,17 @@ module Tk
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
+ WidgetClassNames[WidgetClassName] = self
def create_self(keys)
if keys and keys != None
- tk_call_without_enc(self.class::TkCommandNames[0], @path,
+ tk_call_without_enc(self.class::TkCommandNames[0], @path,
*hash_kv(keys, true))
else
tk_call_without_enc(self.class::TkCommandNames[0], @path)
@@ -69,7 +64,3 @@ class Tk::Tcllib::IP_Entry
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
deleted file mode 100644
index 00acff91d9..0000000000
--- a/ext/tk/lib/tkextlib/tcllib/khim.rb
+++ /dev/null
@@ -1,68 +0,0 @@
-#
-# 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
deleted file mode 100644
index f1eb2f295c..0000000000
--- a/ext/tk/lib/tkextlib/tcllib/menuentry.rb
+++ /dev/null
@@ -1,47 +0,0 @@
-#
-# 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
deleted file mode 100644
index 7888ed4871..0000000000
--- a/ext/tk/lib/tkextlib/tcllib/ntext.rb
+++ /dev/null
@@ -1,146 +0,0 @@
-#
-# 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
index 020c51cbd1..2a4562e779 100644
--- a/ext/tk/lib/tkextlib/tcllib/panelframe.rb
+++ b/ext/tk/lib/tkextlib/tcllib/panelframe.rb
@@ -37,7 +37,7 @@ class Tk::Tcllib::Widget::PanelFrame
def create_self(keys)
if keys and keys != None
- tk_call_without_enc(self.class::TkCommandNames[0], @path,
+ tk_call_without_enc(self.class::TkCommandNames[0], @path,
*hash_kv(keys, true))
else
tk_call_without_enc(self.class::TkCommandNames[0], @path)
@@ -60,17 +60,11 @@ class Tk::Tcllib::Widget::PanelFrame
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
+ alias delete remove_destroy
def items
simplelist(tk_send('items')).collect!{|w| window(w)}
diff --git a/ext/tk/lib/tkextlib/tcllib/plotchart.rb b/ext/tk/lib/tkextlib/tcllib/plotchart.rb
index 6b7a526b75..06ab20f3e6 100644
--- a/ext/tk/lib/tkextlib/tcllib/plotchart.rb
+++ b/ext/tk/lib/tkextlib/tcllib/plotchart.rb
@@ -7,10 +7,10 @@
#
# (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
+# 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:
@@ -32,27 +32,27 @@
# $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
+# 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
+# * 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
+# * 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
+# 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
+# * 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
+# * 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)
#
@@ -62,7 +62,6 @@ 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
@@ -92,13 +91,13 @@ module Tk::Tcllib::Plotchart
end
def self.world_coordinates(w, *args) # args := xmin, ymin, xmax, ymax
- tk_call_without_enc('::Plotchart::worldCoordinates',
+ tk_call_without_enc('::Plotchart::worldCoordinates',
w.path, *(args.flatten))
end
- def self.world_3D_coordinates(w, *args)
+ def self.world_3D_coordinates(w, *args)
# args := xmin, ymin, zmin, xmax, ymax, zmax
- tk_call_without_enc('::Plotchart::world3DCoordinates',
+ tk_call_without_enc('::Plotchart::world3DCoordinates',
w.path, *(args.flatten))
end
@@ -110,29 +109,6 @@ module Tk::Tcllib::Plotchart
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
@@ -181,7 +157,8 @@ module Tk::Tcllib::Plotchart
if key.kind_of?(Hash)
tk_call_without_enc(@chart, 'xconfig', *hash_kv(key, true))
else
- tk_call(@chart, 'xconfig', "-#{key}",value)
+ tk_call_without_enc(@chart, 'xconfig',
+ "-#{key}", _get_eval_enc_str(value))
end
self
end
@@ -190,100 +167,27 @@ module Tk::Tcllib::Plotchart
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
+ tk_call_without_enc(@chart, 'yconfig',
+ "-#{key}", _get_eval_enc_str(value))
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',
+ tk_call_without_enc('::Plotchart::worldCoordinates',
@path, *(args.flatten))
self
end
- def world_3D_coordinates(*args)
+ def world_3D_coordinates(*args)
# args := xmin, ymin, zmin, xmax, ymax, zmax
- tk_call_without_enc('::Plotchart::world3DCoordinates',
+ tk_call_without_enc('::Plotchart::world3DCoordinates',
@path, *(args.flatten))
self
end
@@ -296,11 +200,6 @@ module Tk::Tcllib::Plotchart
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
@@ -330,7 +229,7 @@ module Tk::Tcllib::Plotchart
include ChartMethod
TkCommandNames = [
- 'canvas'.freeze,
+ 'canvas'.freeze,
'::Plotchart::createXYPlot'.freeze
].freeze
@@ -360,7 +259,7 @@ module Tk::Tcllib::Plotchart
def _create_chart
p self.class::TkCommandNames[1] if $DEBUG
- tk_call_without_enc(self.class::TkCommandNames[1], @path,
+ tk_call_without_enc(self.class::TkCommandNames[1], @path,
array2tk_list(@xaxis), array2tk_list(@yaxis))
end
private :_create_chart
@@ -382,27 +281,27 @@ module Tk::Tcllib::Plotchart
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)
+ tk_call_without_enc(@chart, 'contourlines', xcrd, ycrd, vals, clss)
self
end
- def contourfill(xcrd, ycrd, vals, clss=None)
+ def contourfill(xcrd, ycrd, vals, klasses=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)
+ tk_call_without_enc(@chart, 'contourfill', xcrd, ycrd, vals, clss)
self
end
- def contourbox(xcrd, ycrd, vals, clss=None)
+ def contourbox(xcrd, ycrd, vals, klasses=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)
+ tk_call_without_enc(@chart, 'contourbox', xcrd, ycrd, vals, clss)
self
end
@@ -425,110 +324,26 @@ module Tk::Tcllib::Plotchart
if key.kind_of?(Hash)
tk_call_without_enc(@chart, 'dataconfig', series, *hash_kv(key, true))
else
- tk_call(@chart, 'dataconfig', series, "-#{key}", value)
+ tk_call_without_enc(@chart, 'dataconfig', series,
+ "-#{key}", _get_eval_enc_str(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,
+ '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::createHistgram'.freeze
- ].freeze
- end
-
- ############################
class PolarPlot < Tk::Canvas
include ChartMethod
TkCommandNames = [
- 'canvas'.freeze,
+ 'canvas'.freeze,
'::Plotchart::createPolarplot'.freeze
].freeze
@@ -555,7 +370,7 @@ module Tk::Tcllib::Plotchart
def _create_chart
p self.class::TkCommandNames[1] if $DEBUG
- tk_call_without_enc(self.class::TkCommandNames[1], @path,
+ tk_call_without_enc(self.class::TkCommandNames[1], @path,
array2tk_list(@radius_data))
end
private :_create_chart
@@ -567,17 +382,17 @@ module Tk::Tcllib::Plotchart
end
def plot(series, radius, angle)
- tk_call_without_enc(@chart, 'plot', _get_eval_enc_str(series),
+ 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))
+ tk_call_without_enc(@chart, 'dataconfig', series, *hash_kv(key, true))
else
- tk_call(@chart, 'dataconfig', series, "-#{key}", value)
+ tk_call_without_enc(@chart, 'dataconfig', series,
+ "-#{key}", _get_eval_enc_str(value))
end
end
end
@@ -588,7 +403,7 @@ module Tk::Tcllib::Plotchart
include ChartMethod
TkCommandNames = [
- 'canvas'.freeze,
+ 'canvas'.freeze,
'::Plotchart::createIsometricPlot'.freeze
].freeze
@@ -631,8 +446,8 @@ module Tk::Tcllib::Plotchart
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),
+ tk_call_without_enc(self.class::TkCommandNames[1], @path,
+ array2tk_list(@xaxis), array2tk_list(@yaxis),
@stepsize)
end
private :_create_chart
@@ -668,7 +483,7 @@ module Tk::Tcllib::Plotchart
include ChartMethod
TkCommandNames = [
- 'canvas'.freeze,
+ 'canvas'.freeze,
'::Plotchart::create3DPlot'.freeze
].freeze
@@ -701,9 +516,9 @@ module Tk::Tcllib::Plotchart
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),
+ tk_call_without_enc(self.class::TkCommandNames[1], @path,
+ array2tk_list(@xaxis),
+ array2tk_list(@yaxis),
array2tk_list(@zaxis))
end
private :_create_chart
@@ -726,33 +541,15 @@ module Tk::Tcllib::Plotchart
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.
+ # 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)
@@ -764,137 +561,11 @@ module Tk::Tcllib::Plotchart
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,
+ 'canvas'.freeze,
'::Plotchart::createPiechart'.freeze
].freeze
@@ -915,76 +586,9 @@ module Tk::Tcllib::Plotchart
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)
+ tk_call_without_enc(@chart, 'plot', dat.flatten)
self
end
- alias colors colours
end
############################
@@ -992,11 +596,11 @@ module Tk::Tcllib::Plotchart
include ChartMethod
TkCommandNames = [
- 'canvas'.freeze,
+ 'canvas'.freeze,
'::Plotchart::createBarchart'.freeze
].freeze
- def initialize(*args)
+ def initialize(*args)
# args := ([parent,] xlabels, ylabels [, series] [, keys])
# xlabels, ylabels := labels | axis ( depend on normal or horizontal )
# labels := Array of [label, label, ...]
@@ -1038,8 +642,8 @@ module Tk::Tcllib::Plotchart
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),
+ tk_call_without_enc(self.class::TkCommandNames[1], @path,
+ array2tk_list(@xlabels), array2tk_list(@ylabels),
@series_size)
end
private :_create_chart
@@ -1051,13 +655,13 @@ module Tk::Tcllib::Plotchart
end
def plot(series, dat, col=None)
- tk_call(@chart, 'plot', series, dat, col)
+ tk_call_without_enc(@chart, 'plot', series, dat, col)
self
end
def colours(*cols)
# set the colours to be used
- tk_call(@chart, 'colours', *cols)
+ tk_call_without_enc(@chart, 'colours', *cols)
self
end
alias colour colours
@@ -1068,108 +672,12 @@ module Tk::Tcllib::Plotchart
############################
class HorizontalBarchart < Barchart
TkCommandNames = [
- 'canvas'.freeze,
+ '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
@@ -1209,66 +717,52 @@ module Tk::Tcllib::Plotchart
def _create_chart
p self.class::TkCommandNames[1] if $DEBUG
- tk_call_without_enc(self.class::TkCommandNames[1], @path,
+ 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)
+ tk_call_without_enc(@chart, 'period', txt, time_begin, time_end, col)
self
end
def milestone(txt, time, col=None)
- tk_call(@chart, 'milestone', txt, time, col)
+ tk_call_without_enc(@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)
+ tk_call_without_enc(@chart, 'vertline', txt, time)
self
end
end
############################
- class Ganttchart < Tk::Canvas
+ class Gnattchart < Tk::Canvas
include ChartMethod
TkCommandNames = [
'canvas'.freeze,
- '::Plotchart::createGanttchart'.freeze
+ '::Plotchart::createGnattchart'.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, ... } )
+ # 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
- @args = args
+ @items = args.shift
+
+ if args[0].kind_of?(Fixnum)
+ @text_width = args.shift
+ else
+ @text_width = None
+ end
super(*args) # create canvas widget
else
@@ -1276,7 +770,13 @@ module Tk::Tcllib::Plotchart
@time_begin = args.shift
@time_end = args.shift
- @args = args
+ @items = args.shift
+
+ if args[0].kind_of?(Fixnum)
+ @text_width = args.shift
+ else
+ @text_width = None
+ end
if parent.kind_of?(Tk::Canvas)
@path = parent.path
@@ -1290,25 +790,25 @@ module Tk::Tcllib::Plotchart
def _create_chart
p self.class::TkCommandNames[1] if $DEBUG
- tk_call(self.class::TkCommandNames[1], @path,
- @time_begin, @time_end, *args)
+ tk_call_without_enc(self.class::TkCommandNames[1], @path,
+ @time_begin, @time_end, @items, @text_width)
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|
+ list(tk_call_without_enc(@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)
+ tk_call_without_enc(@chart, 'milestone', txt, time, col)
self
end
def vertline(txt, time)
- tk_call(@chart, 'vertline', txt, time)
+ tk_call_without_enc(@chart, 'vertline', txt, time)
self
end
@@ -1316,41 +816,23 @@ module Tk::Tcllib::Plotchart
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)
+ tk_call_without_enc(@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)
+ tk_call_without_enc(@chart, 'summary', tasks)
self
end
def color_of_part(keyword, newcolor)
- tk_call(@chart, 'color', keyword, newcolor)
+ tk_call_without_enc(@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)
+ tk_call_without_enc(@chart, 'font', keyword, newfont)
self
end
end
@@ -1359,7 +841,7 @@ module Tk::Tcllib::Plotchart
class PlotSeries < TkObject
SeriesID_TBL = TkCore::INTERP.create_table
- (Series_ID = ['series'.freeze, TkUtil.untrust('00000')]).instance_eval{
+ (Series_ID = ['series'.freeze, '00000'.taint]).instance_eval{
@mutex = Mutex.new
def mutex; @mutex; end
freeze
diff --git a/ext/tk/lib/tkextlib/tcllib/ruler.rb b/ext/tk/lib/tkextlib/tcllib/ruler.rb
index d22dafa053..88ffb2c912 100644
--- a/ext/tk/lib/tkextlib/tcllib/ruler.rb
+++ b/ext/tk/lib/tkextlib/tcllib/ruler.rb
@@ -46,7 +46,7 @@ class Tk::Tcllib::Widget::Ruler
def create_self(keys)
if keys and keys != None
- tk_call_without_enc(self.class::TkCommandNames[0], @path,
+ tk_call_without_enc(self.class::TkCommandNames[0], @path,
*hash_kv(keys, true))
else
tk_call_without_enc(self.class::TkCommandNames[0], @path)
diff --git a/ext/tk/lib/tkextlib/tcllib/screenruler.rb b/ext/tk/lib/tkextlib/tcllib/screenruler.rb
index 75fa36b66d..1b4067e2f0 100644
--- a/ext/tk/lib/tkextlib/tcllib/screenruler.rb
+++ b/ext/tk/lib/tkextlib/tcllib/screenruler.rb
@@ -47,7 +47,7 @@ class Tk::Tcllib::Widget::ScreenRuler
def create_self(keys)
if keys and keys != None
- tk_call_without_enc(self.class::TkCommandNames[0], @path,
+ tk_call_without_enc(self.class::TkCommandNames[0], @path,
*hash_kv(keys, true))
else
tk_call_without_enc(self.class::TkCommandNames[0], @path)
diff --git a/ext/tk/lib/tkextlib/tcllib/scrolledwindow.rb b/ext/tk/lib/tkextlib/tcllib/scrolledwindow.rb
deleted file mode 100644
index c9488b4686..0000000000
--- a/ext/tk/lib/tkextlib/tcllib/scrolledwindow.rb
+++ /dev/null
@@ -1,57 +0,0 @@
-#
-# 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
index c9f6062fef..717728e34a 100644
--- a/ext/tk/lib/tkextlib/tcllib/scrollwin.rb
+++ b/ext/tk/lib/tkextlib/tcllib/scrollwin.rb
@@ -42,7 +42,7 @@ class Tk::Tcllib::Widget::ScrolledWindow
def create_self(keys)
if keys and keys != None
- tk_call_without_enc(self.class::TkCommandNames[0], @path,
+ tk_call_without_enc(self.class::TkCommandNames[0], @path,
*hash_kv(keys, true))
else
tk_call_without_enc(self.class::TkCommandNames[0], @path)
diff --git a/ext/tk/lib/tkextlib/tcllib/setup.rb b/ext/tk/lib/tkextlib/tcllib/setup.rb
index ee406c6ca0..ce0f0bd4d4 100644
--- a/ext/tk/lib/tkextlib/tcllib/setup.rb
+++ b/ext/tk/lib/tkextlib/tcllib/setup.rb
@@ -2,7 +2,7 @@
# 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
+# 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
deleted file mode 100644
index 46a4b9d8b6..0000000000
--- a/ext/tk/lib/tkextlib/tcllib/statusbar.rb
+++ /dev/null
@@ -1,79 +0,0 @@
-#
-# 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/superframe.rb b/ext/tk/lib/tkextlib/tcllib/superframe.rb
index adc9c4adbd..35da37efbf 100644
--- a/ext/tk/lib/tkextlib/tcllib/superframe.rb
+++ b/ext/tk/lib/tkextlib/tcllib/superframe.rb
@@ -37,7 +37,7 @@ class Tk::Tcllib::Widget::SuperFrame
def create_self(keys)
if keys and keys != None
- tk_call_without_enc(self.class::TkCommandNames[0], @path,
+ tk_call_without_enc(self.class::TkCommandNames[0], @path,
*hash_kv(keys, true))
else
tk_call_without_enc(self.class::TkCommandNames[0], @path)
diff --git a/ext/tk/lib/tkextlib/tcllib/swaplist.rb b/ext/tk/lib/tkextlib/tcllib/swaplist.rb
index 7698640534..1c813e36da 100644
--- a/ext/tk/lib/tkextlib/tcllib/swaplist.rb
+++ b/ext/tk/lib/tkextlib/tcllib/swaplist.rb
@@ -33,7 +33,7 @@ end
class Tk::Tcllib::Swaplist_Dialog
TkCommandNames = ['::swaplist::swaplist'.freeze].freeze
WidgetClassName = 'Swaplist'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
def self.show(*args)
dialog = self.new(*args)
@@ -44,7 +44,7 @@ class Tk::Tcllib::Swaplist_Dialog
self.show(*args)
end
- def initialize(*args)
+ def initialize(*args)
# args = (parent=nil, complete_list=[], selected_list=[], keys=nil)
keys = args.pop
if keys.kind_of?(Hash)
@@ -74,9 +74,9 @@ class Tk::Tcllib::Swaplist_Dialog
def show
@variable.value = ''
- @status = bool(tk_call(self.class::TkCommandNames[0],
- @path, @variable,
- @complete_list, @selected_list,
+ @status = bool(tk_call(self.class::TkCommandNames[0],
+ @path, @variable,
+ @complete_list, @selected_list,
*hash_kv(@keys)))
end
alias display show
diff --git a/ext/tk/lib/tkextlib/tcllib/tablelist.rb b/ext/tk/lib/tkextlib/tcllib/tablelist.rb
index b40f7a5b8b..efeb8fbbac 100644
--- a/ext/tk/lib/tkextlib/tcllib/tablelist.rb
+++ b/ext/tk/lib/tkextlib/tcllib/tablelist.rb
@@ -10,8 +10,7 @@ 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')
+ Tk::Tcllib::Tablelist_usingTile = TkPackage.provide('tile')
end
if Tk::Tcllib::Tablelist_usingTile
@@ -21,8 +20,8 @@ if Tk::Tcllib::Tablelist_usingTile
else
# without Tile
- # TkPackage.require('tablelist', '4.2')
- TkPackage.require('tablelist')
+ # 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
index 850e75d845..d7a6c97210 100644
--- a/ext/tk/lib/tkextlib/tcllib/tablelist_core.rb
+++ b/ext/tk/lib/tkextlib/tcllib/tablelist_core.rb
@@ -4,7 +4,7 @@
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
#
# * Part of tcllib extension
-# * This file is required by 'tkextlib/tcllib/tablelist.rb' or
+# * This file is required by 'tkextlib/tcllib/tablelist.rb' or
# 'tkextlib/tcllib/tablelist_tile.rb'.
#
@@ -54,7 +54,7 @@ module Tk::Tcllib::TablelistItemConfig
elsif idx =~ /([^,]+),([^,]+)/
row = $1, column = $2
[num_or_str(row), num_or_str(column)]
- else
+ else
num_or_str(idx)
end
end
@@ -67,9 +67,6 @@ module Tk::Tcllib::TablelistItemConfig
[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
@@ -85,16 +82,12 @@ module Tk::Tcllib::TablelistItemConfig
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
@@ -110,16 +103,12 @@ module Tk::Tcllib::TablelistItemConfig
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
@@ -135,14 +124,13 @@ module Tk::Tcllib::TablelistItemConfig
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 :itemcget, :itemcget_strict
private :itemconfigure, :itemconfiginfo, :current_itemconfiginfo
end
@@ -152,11 +140,11 @@ class Tk::Tcllib::Tablelist
TkCommandNames = ['::tablelist::tablelist'.freeze].freeze
WidgetClassName = 'Tablelist'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
def create_self(keys)
if keys and keys != None
- tk_call_without_enc(self.class::TkCommandNames[0], @path,
+ tk_call_without_enc(self.class::TkCommandNames[0], @path,
*hash_kv(keys, true))
else
tk_call_without_enc(self.class::TkCommandNames[0], @path)
@@ -177,16 +165,16 @@ class Tk::Tcllib::Tablelist
private :__strval_optkeys
def __boolval_optkeys
- super() - ['takefocus'] + [
- 'forceeditendcommand', 'movablecolumns', 'movablerows',
- 'protecttitlecolumns', 'resizablecolumns', 'setfocus',
+ super() + [
+ 'forceeditendcommand', 'movablecolumns', 'movablerows',
+ 'protecttitlecolumns', 'resizablecolumns',
'showarrow', 'showlabels', 'showseparators'
]
end
private :__boolval_optkeys
def __listval_optkeys
- super() + ['columns', 'columntitles']
+ super() + ['columns']
end
private :__listval_optkeys
@@ -198,21 +186,7 @@ class Tk::Tcllib::Tablelist
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
- })
+ super().update('stretch'=>proc{|v| (v == 'all')? v: simplelist(v)})
end
private :__val2ruby_optkeys
@@ -220,20 +194,8 @@ class Tk::Tcllib::Tablelist
# 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|
+ 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
@@ -249,15 +211,14 @@ class Tk::Tcllib::Tablelist
if id[0] == 'cell'
super(id) + ['title']
else
- super(id) - ['text'] + ['title', 'name']
+ super(id) - ['text'] + ['title']
end
end
private :__item_strval_optkeys
def __item_boolval_optkeys(id)
super(id) + [
- 'changesnipside', 'editable', 'hide', 'resizable', 'selectable',
- 'showarrow', 'showlinenumbers', 'stretchable', 'stretchwindow', 'wrap'
+ 'editable', 'hide', 'resizable', 'showarrow', 'stretchable',
]
end
private :__item_boolval_optkeys
@@ -288,7 +249,7 @@ class Tk::Tcllib::Tablelist
tk_send('activatecell', _to_idx(index))
self
end
- alias activatecell activate_cell
+ alias activatecell activate_cell
def get_attrib(name=nil)
if name && name != None
@@ -319,29 +280,12 @@ class Tk::Tcllib::Tablelist
TkBindTag.new_by_name(tk_send('bodytag'))
end
- def cancel_editing
+ 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
@@ -377,23 +321,6 @@ class Tk::Tcllib::Tablelist
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
@@ -402,83 +329,6 @@ class Tk::Tcllib::Tablelist
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
@@ -488,7 +338,7 @@ class Tk::Tcllib::Tablelist
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[0].kind_of?(Fixnum) && idx[0] < 0)? nil: idx[0]),
((idx[1].kind_of?(Fixnum) && idx[1] < 0)? nil: idx[1])
]
else
@@ -542,10 +392,6 @@ class Tk::Tcllib::Tablelist
end
alias editcell edit_cell
- def editwintag
- TkBindTag.new_by_name(tk_send('editwintag'))
- end
-
def editwinpath
window(tk_send('editwinpath'))
end
@@ -566,11 +412,6 @@ class Tk::Tcllib::Tablelist
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) }
@@ -614,22 +455,6 @@ class Tk::Tcllib::Tablelist
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
@@ -661,16 +486,6 @@ class Tk::Tcllib::Tablelist
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
@@ -683,10 +498,6 @@ class Tk::Tcllib::Tablelist
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
@@ -724,23 +535,6 @@ class Tk::Tcllib::Tablelist
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
@@ -839,22 +633,7 @@ class Tk::Tcllib::Tablelist
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
+ DEFAULT_sortByColumn_cmd = '::tablelist::sortByColumn'
def sort_by_column(idx, order=nil)
if order
@@ -880,49 +659,15 @@ class Tk::Tcllib::Tablelist
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)})
@@ -935,26 +680,6 @@ class Tk::Tcllib::Tablelist
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
@@ -967,18 +692,13 @@ class << Tk::Tcllib::Tablelist
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
+ # with the BWidget package
def addBWidgetEntry(name=None)
Tk.tk_call('::tablelist::addBWidgetEntry', name)
end
@@ -993,7 +713,7 @@ class << Tk::Tcllib::Tablelist
############################################################
- # with the Iwidgets ([incr Widgets]) package
+ # with the Iwidgets ([incr Widgets]) package
def addIncrEntryfield(name=None)
Tk.tk_call('::tablelist::addIncrEntry', name)
end
@@ -1047,16 +767,6 @@ class << Tk::Tcllib::Tablelist
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'
diff --git a/ext/tk/lib/tkextlib/tcllib/tablelist_tile.rb b/ext/tk/lib/tkextlib/tcllib/tablelist_tile.rb
index 0a1458415e..0cb4eb735d 100644
--- a/ext/tk/lib/tkextlib/tcllib/tablelist_tile.rb
+++ b/ext/tk/lib/tkextlib/tcllib/tablelist_tile.rb
@@ -9,7 +9,7 @@ require 'tk'
require 'tkextlib/tcllib.rb'
# TkPackage.require('tablelist_tile', '4.2')
-TkPackage.require('tablelist_tile')
+TkPackage.require('Tablelist_tile')
unless defined? Tk::Tcllib::Tablelist_usingTile
Tk::Tcllib::Tablelist_usingTile = true
@@ -19,24 +19,6 @@ requrie 'tkextlib/tcllib/tablelist_core'
module Tk
module Tcllib
- class Tablelist
- # commands related to tile Themems
- def self.set_theme(theme)
- Tk.tk_call('::tablelist::setTheme', theme)
- end
-
- def self.get_current_theme
- Tk.tk_call('::tablelist::getCurrentTheme')
- end
-
- def self.get_theme_list
- TkComm.simplelist(Tk.tk_call('::tablelist::getThemes'))
- end
- def self.set_theme_defaults
- Tk.tk_call('::tablelist::setThemeDefaults')
- end
- end
-
Tablelist_Tile = Tablelist
TableList_Tile = Tablelist
end
diff --git a/ext/tk/lib/tkextlib/tcllib/tkpiechart.rb b/ext/tk/lib/tkextlib/tcllib/tkpiechart.rb
index 2f6e4b44fc..b366e0198b 100644
--- a/ext/tk/lib/tkextlib/tcllib/tkpiechart.rb
+++ b/ext/tk/lib/tkextlib/tcllib/tkpiechart.rb
@@ -52,7 +52,7 @@ module Tk::Tcllib::Tkpiechart
private :__config_cmd
def __configinfo_struct
- {:key=>0, :alias=>nil, :db_name=>nil, :db_class=>nil,
+ {:key=>0, :alias=>nil, :db_name=>nil, :db_class=>nil,
:default_value=>1, :current_value=>2}
end
private :__configinfo_struct
@@ -63,7 +63,7 @@ module Tk::Tcllib::Tkpiechart
private :__boolval_optkeys
def __strval_optkeys
- super() << 'bordercolor' << 'textbackground' <<
+ super() << 'bordercolor' << 'textbackground' <<
'widestvaluetext' << 'title'
end
private :__strval_optkeys
@@ -90,7 +90,7 @@ module Tk::Tcllib::Tkpiechart
def create_self(x, y, width, height, keys=None)
if keys and keys != None
- @tag_key = tk_call_without_enc('::stooop::new', 'pie',
+ @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)
@@ -148,7 +148,7 @@ module Tk::Tcllib::Tkpiechart
end
def selected_slices
- tk_split_simplelist(tk_call_without_enc('pie::selectedSlices',
+ tk_split_simplelist(tk_call_without_enc('pie::selectedSlices',
@tag_key)).collect{|slice|
@slice_tbl[slice] || Slice.new(:no_create, self, slice)
}
@@ -212,7 +212,7 @@ module Tk::Tcllib::Tkpiechart
end
def size(share, disp=None)
- tk_call_without_enc('pie::sizeSlice',
+ tk_call_without_enc('pie::sizeSlice',
@pie.tag_key, @tag_key, share, disp)
self
end
@@ -236,7 +236,7 @@ module Tk::Tcllib::Tkpiechart
def create_self(keys=None)
if keys and keys != None
- @tag_key = tk_call_without_enc('::stooop::new', 'pieBoxLabeler',
+ @tag_key = tk_call_without_enc('::stooop::new', 'pieBoxLabeler',
*hash_kv(keys, true))
else
@tag_key = tk_call_without_enc('::stooop::new', 'pieBoxLabeler')
@@ -268,8 +268,8 @@ module Tk::Tcllib::Tkpiechart
def create_self(keys=None)
if keys and keys != None
- @tag_key = tk_call_without_enc('::stooop::new',
- 'piePeripheralLabeler',
+ @tag_key = tk_call_without_enc('::stooop::new',
+ 'piePeripheralLabeler',
*hash_kv(keys, true))
else
@tag_key = tk_call_without_enc('::stooop::new', 'piePeripheralLabeler')
@@ -296,11 +296,11 @@ module Tk::Tcllib::Tkpiechart
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,
+ @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',
+ @tag_key = tk_call_without_enc('::stooop::new', 'canvasLabel',
@c, x, y, width, height)
end
diff --git a/ext/tk/lib/tkextlib/tcllib/toolbar.rb b/ext/tk/lib/tkextlib/tcllib/toolbar.rb
deleted file mode 100644
index 6eae4eb3e1..0000000000
--- a/ext/tk/lib/tkextlib/tcllib/toolbar.rb
+++ /dev/null
@@ -1,175 +0,0 @@
-#
-# tkextlib/tcllib/toolbar.rb
-# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
-#
-# * Part of tcllib extension
-# * toolbar widget
-#
-
-require 'tk'
-require 'tkextlib/tcllib.rb'
-
-# TkPackage.require('widget::toolbar', '1.2')
-TkPackage.require('widget::toolbar')
-
-module Tk::Tcllib
- module Widget
- class Toolbar < TkWindow
- PACKAGE_NAME = 'widget::toolbar'.freeze
- def self.package_name
- PACKAGE_NAME
- end
-
- def self.package_version
- begin
- TkPackage.require('widget::toolbar')
- rescue
- ''
- end
- end
- end
-
- module ToolbarItemConfig
- include TkItemConfigMethod
- end
- end
-end
-
-
-class Tk::Tcllib::Widget::ToolbarItem < TkObject
- include TkTreatTagFont
-
- ToolbarItemID_TBL = TkCore::INTERP.create_table
-
- TkCore::INTERP.init_ip_env{
- TTagID_TBL.mutex.synchronize{ TTagID_TBL.clear }
- }
-
- def ToolbarItem.id2obj(tbar, id)
- tpath = tbar.path
- ToolbarItemID_TBL.mutex.synchronize{
- if ToolbarItemID_TBL[tpath]
- ToolbarItemID_TBL[tpath][id]? ToolbarItemID_TBL[tpath][id]: id
- else
- id
- end
- }
- end
-
- def initaialize(parent, *args)
- @parent = @t = parent
- @tpath = parent.path
-
- @path = @id = @t.tk_send('add', *args)
- # A same id is rejected by the Tcl function.
-
- ToolbarItemID_TBL.mutex.synchronize{
- ToolbarItemID_TBL[@id] = self
- ToolbarItemID_TBL[@tpath] = {} unless ToolbarItemID_TBL[@tpath]
- ToolbarItemID_TBL[@tpath][@id] = self
- }
- end
-
- def [](key)
- cget key
- end
-
- def []=(key,val)
- configure key, val
- val
- end
-
- def cget_tkstring(option)
- @t.itemcget_tkstring(@id, option)
- end
- def cget(option)
- @t.itemcget(@id, option)
- end
- def cget_strict(option)
- @t.itemcget_strict(@id, option)
- end
-
- def configure(key, value=None)
- @t.itemconfigure(@id, key, value)
- self
- end
-
- def configinfo(key=nil)
- @t.itemconfiginfo(@id, key)
- end
-
- def current_configinfo(key=nil)
- @t.current_itemconfiginfo(@id, key)
- end
-
- def delete
- @t.delete(@id)
- end
-
- def itemid
- @t.itemid(@id)
- end
-
- def remove
- @t.remove(@id)
- end
- def remove_with_destroy
- @t.remove_with_destroy(@id)
- end
-end
-
-class Tk::Tcllib::Widget::Toolbar
- include Tk::Tcllib::Widget::ToolbarItemConfig
-
- TkCommandNames = ['::widget::toolbar'.freeze].freeze
-
- def __destroy_hook__
- Tk::Tcllib::Widget::ToolbarItem::ToolbarItemID_TBL.mutex.synchronize{
- Tk::Tcllib::Widget::ToolbarItem::ToolbarItemID_TBL.delete(@path)
- }
- end
-
- def create_self(keys)
- if keys and keys != None
- tk_call_without_enc(self.class::TkCommandNames[0], @path,
- *hash_kv(keys, true))
- else
- tk_call_without_enc(self.class::TkCommandNames[0], @path)
- end
- end
- private :create_self
-
- def getframe
- window(tk_send('getframe'))
- end
- alias get_frame getframe
-
- def add(*args)
- Tk::Tcllib::Widget::Toolbar.new(self, *args)
- end
-
- def itemid(item)
- window(tk_send('itemid'))
- end
-
- def items(pattern)
- tk_split_simplelist(tk_send('items', pattern)).map{|id|
- Tk::Tcllib::Widget::ToolbarItem.id2obj(self, id)
- }
- end
-
- def remove(*items)
- tk_send('remove', *items)
- self
- end
-
- def remove_with_destroy(*items)
- tk_send('remove', '-destroy', *items)
- self
- end
-
- def delete(*items)
- tk_send('delete', *items)
- self
- end
-end
diff --git a/ext/tk/lib/tkextlib/tcllib/tooltip.rb b/ext/tk/lib/tkextlib/tcllib/tooltip.rb
index 070e63a7b5..4301b39fd3 100644
--- a/ext/tk/lib/tkextlib/tcllib/tooltip.rb
+++ b/ext/tk/lib/tkextlib/tcllib/tooltip.rb
@@ -3,7 +3,7 @@
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
#
# * Part of tcllib extension
-# * Provides tooltips, a small text message that is displayed when the
+# * Provides tooltips, a small text message that is displayed when the
# mouse hovers over a widget.
#
@@ -34,8 +34,6 @@ module Tk::Tcllib::Tooltip
extend TkCore
WidgetClassName = 'Tooltip'.freeze
- WidgetClassNames[WidgetClassName] ||= self
-
def self.database_classname
self::WidgetClassName
end
@@ -66,13 +64,6 @@ module Tk::Tcllib::Tooltip
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
@@ -95,7 +86,7 @@ module Tk::Tcllib::Tooltip
else
args = msg
end
- tk_call('::tooltip::tooltip', widget.path, *args)
+ tk_call_without_enc('::tooltip::tooltip', widget.path, *args)
end
def self.erase(widget)
diff --git a/ext/tk/lib/tkextlib/tcllib/widget.rb b/ext/tk/lib/tkextlib/tcllib/widget.rb
index 57fdf7a575..ed69f67ce6 100644
--- a/ext/tk/lib/tkextlib/tcllib/widget.rb
+++ b/ext/tk/lib/tkextlib/tcllib/widget.rb
@@ -26,41 +26,10 @@ module Tk::Tcllib
''
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'
@@ -76,7 +45,4 @@ module Tk::Tcllib::Widget
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/setup.rb b/ext/tk/lib/tkextlib/tclx/setup.rb
index ee406c6ca0..ce0f0bd4d4 100644
--- a/ext/tk/lib/tkextlib/tclx/setup.rb
+++ b/ext/tk/lib/tkextlib/tclx/setup.rb
@@ -2,7 +2,7 @@
# 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
+# 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.rb b/ext/tk/lib/tkextlib/tile.rb
index 6c11e212ae..60ea012cc0 100644
--- a/ext/tk/lib/tkextlib/tile.rb
+++ b/ext/tk/lib/tkextlib/tile.rb
@@ -16,39 +16,12 @@ require 'tkextlib/tile/setup.rb'
# TkPackage.require('tile', '0.4')
# TkPackage.require('tile', '0.6')
# TkPackage.require('tile', '0.7')
-if Tk::TK_MAJOR_VERSION > 8 ||
+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'
+ TkPackage.require('tile') # for compatibility (version check of 'tile')
+ verstr = TkPackage.require('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
+ verstr = TkPackage.require('tile')
end
ver = verstr.split('.')
@@ -132,17 +105,17 @@ module Tk
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
+ # 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
+ # 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.
+ # 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
@@ -167,7 +140,7 @@ module Tk
next
end
TkNamespace.eval(ns){
- TkCore::INTERP.add_tk_procs(proc_name, 'imgdir {patterns {*.gif}}',
+ TkCore::INTERP.add_tk_procs(proc_name, 'imgdir {patterns {*.gif}}',
<<-'EOS')
foreach pattern $patterns {
foreach file [glob -directory $imgdir $pattern] {
@@ -193,7 +166,7 @@ module Tk
pat ||= TkComm::None
images = Hash[*TkComm.simplelist(Tk.tk_call(cmd, imgdir, pat))]
images.keys.each{|k|
- images[k] = TkPhotoImage.new(:imagename=>images[k],
+ images[k] = TkPhotoImage.new(:imagename=>images[k],
:without_creating=>true)
}
else ## TILE_SPEC_VERSION_ID >= 8
@@ -208,7 +181,7 @@ module Tk
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('set', "images(#{img})",
Tk.tk_call('image', 'create', 'photo', '-file', f))
end
}
@@ -216,7 +189,7 @@ module Tk
}
images = Hash[*TkComm.simplelist(Tk.tk_call('array', 'get', 'images'))]
images.keys.each{|k|
- images[k] = TkPhotoImage.new(:imagename=>images[k],
+ images[k] = TkPhotoImage.new(:imagename=>images[k],
:without_creating=>true)
}
end
@@ -240,8 +213,8 @@ module Tk
begin
TkComm.simplelist(Tk.tk_call_without_enc(*cmd))
rescue
- TkComm.simplelist(Tk.tk_call('lsearch', '-all', '-inline',
- Tk::Tile::Style.theme_names,
+ TkComm.simplelist(Tk.tk_call('lsearch', '-all', '-inline',
+ Tk::Tile::Style.theme_names,
glob_ptn))
end
end
@@ -291,8 +264,8 @@ module Tk
Icon = 'TkIconFont'
TkFont::SYSTEM_FONT_NAMES.add [
- 'TkDefaultFont', 'TkTextFont', 'TkHeadingFont',
- 'TkCaptionFont', 'TkTooltipFont', 'TkFixedFont',
+ 'TkDefaultFont', 'TkTextFont', 'TkHeadingFont',
+ 'TkCaptionFont', 'TkTooltipFont', 'TkFixedFont',
'TkMenuFont', 'TkSmallCaptionFont', 'TkIconFont'
]
end
@@ -307,7 +280,7 @@ module Tk
until lst.empty?
if lst[0][0] == ?-
k = lst.shift[1..-1]
- children = lst.shift
+ children = lst.shift
children = _style_layout(children) if children.kind_of?(Array)
keys[k] = children
else
@@ -359,7 +332,7 @@ module Tk
end
alias tile_identify ttk_identify
- # remove instate/state/identify method
+ # 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
@@ -431,9 +404,6 @@ module Tk
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'
diff --git a/ext/tk/lib/tkextlib/tile/dialog.rb b/ext/tk/lib/tkextlib/tile/dialog.rb
index b112e6152b..ef2d1fe577 100644
--- a/ext/tk/lib/tkextlib/tile/dialog.rb
+++ b/ext/tk/lib/tkextlib/tile/dialog.rb
@@ -12,12 +12,6 @@ module Tk
end
end
-begin
- TkPackage.require('ttk::dialog') # this may be required.
-rescue RuntimeError
- # ignore
-end
-
class Tk::Tile::Dialog
TkCommandNames = ['::ttk::dialog'.freeze].freeze
diff --git a/ext/tk/lib/tkextlib/tile/setup.rb b/ext/tk/lib/tkextlib/tile/setup.rb
index ee406c6ca0..ce0f0bd4d4 100644
--- a/ext/tk/lib/tkextlib/tile/setup.rb
+++ b/ext/tk/lib/tkextlib/tile/setup.rb
@@ -2,7 +2,7 @@
# 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
+# 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
index d7da0a4075..c5068919a4 100644
--- a/ext/tk/lib/tkextlib/tile/sizegrip.rb
+++ b/ext/tk/lib/tkextlib/tile/sizegrip.rb
@@ -13,20 +13,17 @@ module Tk
end
end
+Tk.__set_toplevel_aliases__(:Ttk, Tk::Tile::Sizegrip, :TkSizegrip, :TkSizeGrip)
+
+
class Tk::Tile::SizeGrip < TkWindow
include Tk::Tile::TileWidget
TkCommandNames = ['::ttk::sizegrip'.freeze].freeze
WidgetClassName = 'TSizegrip'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ 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
index f38deda503..ca7ee99c32 100644
--- a/ext/tk/lib/tkextlib/tile/style.rb
+++ b/ext/tk/lib/tkextlib/tile/style.rb
@@ -21,16 +21,16 @@ class << Tk::Tile::Style
TkCommandNames = ['style'.freeze].freeze
# --- Tk::Tile::Style.__define_wrapper_proc_for_compatibility__! ---
- # On Ttk (Tile) extension, 'style' command has imcompatible changes
- # depend on the version of the extention. 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.
+ # On Ttk (Tile) extension, 'style' command has imcompatible changes
+ # depend on the version of the extention. 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.
+ # 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__!
@@ -210,7 +210,7 @@ class << Tk::Tile::Style
end
def lookup(style, opt, state=None, fallback_value=None)
- tk_call(TkCommandNames[0], 'lookup', style,
+ tk_call(TkCommandNames[0], 'lookup', style,
'-' << opt.to_s, state, fallback_value)
end
@@ -233,8 +233,6 @@ class << Tk::Tile::Style
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
@@ -255,7 +253,7 @@ class << Tk::Tile::Style
# 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],
+ tk_call(TkCommandNames[0],
'element', 'create', name, 'image', spec, opts)
else
tk_call(TkCommandNames[0], 'element', 'create', name, 'image', spec)
@@ -264,7 +262,7 @@ class << Tk::Tile::Style
fail ArgumentError, 'illegal arguments' if opts.key?('map')
base = spec.shift
opts['map'] = spec
- tk_call(TkCommandNames[0],
+ tk_call(TkCommandNames[0],
'element', 'create', name, 'image', base, opts)
end
else
@@ -273,7 +271,7 @@ class << Tk::Tile::Style
spec = [spec, *(opts.delete('map'))] if opts.key?('map')
end
if opts
- tk_call(TkCommandNames[0],
+ tk_call(TkCommandNames[0],
'element', 'create', name, 'image', spec, opts)
else
tk_call(TkCommandNames[0], 'element', 'create', name, 'image', spec)
@@ -281,24 +279,6 @@ class << Tk::Tile::Style
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
diff --git a/ext/tk/lib/tkextlib/tile/tbutton.rb b/ext/tk/lib/tkextlib/tile/tbutton.rb
index c852024842..5d7db10fe9 100644
--- a/ext/tk/lib/tkextlib/tile/tbutton.rb
+++ b/ext/tk/lib/tkextlib/tile/tbutton.rb
@@ -13,6 +13,9 @@ module Tk
end
end
+Tk.__set_toplevel_aliases__(:Ttk, Tk::Tile::Button, :TkButton)
+
+
class Tk::Tile::TButton < Tk::Button
include Tk::Tile::TileWidget
@@ -22,13 +25,9 @@ class Tk::Tile::TButton < Tk::Button
TkCommandNames = ['::tbutton'.freeze].freeze
end
WidgetClassName = 'TButton'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ 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
index 01751ede0f..172225fcec 100644
--- a/ext/tk/lib/tkextlib/tile/tcheckbutton.rb
+++ b/ext/tk/lib/tkextlib/tile/tcheckbutton.rb
@@ -15,6 +15,10 @@ module Tk
end
end
+Tk.__set_toplevel_aliases__(:Ttk, Tk::Tile::Checkbutton,
+ :TkCheckbutton, :TkCheckButton)
+
+
class Tk::Tile::TCheckButton < Tk::CheckButton
include Tk::Tile::TileWidget
@@ -24,15 +28,9 @@ class Tk::Tile::TCheckButton < Tk::CheckButton
TkCommandNames = ['::tcheckbutton'.freeze].freeze
end
WidgetClassName = 'TCheckbutton'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ 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
index b5ab827e2d..b64372f1c9 100644
--- a/ext/tk/lib/tkextlib/tile/tcombobox.rb
+++ b/ext/tk/lib/tkextlib/tile/tcombobox.rb
@@ -13,6 +13,9 @@ module Tk
end
end
+Tk.__set_toplevel_aliases__(:Ttk, Tk::Tile::Combobox, :TkCombobox)
+
+
class Tk::Tile::TCombobox < Tk::Tile::TEntry
include Tk::Tile::TileWidget
@@ -22,7 +25,7 @@ class Tk::Tile::TCombobox < Tk::Tile::TEntry
TkCommandNames = ['::tcombobox'.freeze].freeze
end
WidgetClassName = 'TCombobox'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
def __boolval_optkeys
super() << 'exportselection'
@@ -49,7 +52,3 @@ class Tk::Tile::TCombobox < Tk::Tile::TEntry
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
index 8d2633a774..0bea98dcd9 100644
--- a/ext/tk/lib/tkextlib/tile/tentry.rb
+++ b/ext/tk/lib/tkextlib/tile/tentry.rb
@@ -13,6 +13,9 @@ module Tk
end
end
+Tk.__set_toplevel_aliases__(:Ttk, Tk::Tile::Entry, :TkEntry)
+
+
class Tk::Tile::TEntry < Tk::Entry
include Tk::Tile::TileWidget
@@ -22,7 +25,7 @@ class Tk::Tile::TEntry < Tk::Entry
TkCommandNames = ['::tentry'.freeze].freeze
end
WidgetClassName = 'TEntry'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
def __optkey_aliases
{:vcmd=>:validatecommand, :invcmd=>:invalidcommand}
@@ -43,7 +46,3 @@ class Tk::Tile::TEntry < Tk::Entry
[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
index d6d4312628..3b5f98bb6e 100644
--- a/ext/tk/lib/tkextlib/tile/tframe.rb
+++ b/ext/tk/lib/tkextlib/tile/tframe.rb
@@ -13,6 +13,9 @@ module Tk
end
end
+Tk.__set_toplevel_aliases__(:Ttk, Tk::Tile::Frame, :TkFrame)
+
+
class Tk::Tile::TFrame < Tk::Frame
include Tk::Tile::TileWidget
@@ -22,13 +25,9 @@ class Tk::Tile::TFrame < Tk::Frame
TkCommandNames = ['::tframe'.freeze].freeze
end
WidgetClassName = 'TFrame'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ 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
index 55b98acc68..7d074d3842 100644
--- a/ext/tk/lib/tkextlib/tile/tlabel.rb
+++ b/ext/tk/lib/tkextlib/tile/tlabel.rb
@@ -13,6 +13,9 @@ module Tk
end
end
+Tk.__set_toplevel_aliases__(:Ttk, Tk::Tile::Label, :TkLabel)
+
+
class Tk::Tile::TLabel < Tk::Label
include Tk::Tile::TileWidget
@@ -22,13 +25,9 @@ class Tk::Tile::TLabel < Tk::Label
TkCommandNames = ['::tlabel'.freeze].freeze
end
WidgetClassName = 'TLabel'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ 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
index a34c98583f..cff66d8658 100644
--- a/ext/tk/lib/tkextlib/tile/tlabelframe.rb
+++ b/ext/tk/lib/tkextlib/tile/tlabelframe.rb
@@ -15,6 +15,10 @@ module Tk
end
end
+Tk.__set_toplevel_aliases__(:Ttk, Tk::Tile::Labelframe,
+ :TkLabelframe, :TkLabelFrame)
+
+
class Tk::Tile::TLabelframe < Tk::Tile::TFrame
include Tk::Tile::TileWidget
@@ -24,15 +28,9 @@ class Tk::Tile::TLabelframe < Tk::Tile::TFrame
TkCommandNames = ['::tlabelframe'.freeze].freeze
end
WidgetClassName = 'TLabelframe'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ 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
index 1cf553ec8c..7c6ab28e52 100644
--- a/ext/tk/lib/tkextlib/tile/tmenubutton.rb
+++ b/ext/tk/lib/tkextlib/tile/tmenubutton.rb
@@ -15,6 +15,10 @@ module Tk
end
end
+Tk.__set_toplevel_aliases__(:Ttk, Tk::Tile::Menubutton,
+ :TkMenubutton, :TkMenuButton)
+
+
class Tk::Tile::TMenubutton < Tk::Menubutton
include Tk::Tile::TileWidget
@@ -24,15 +28,9 @@ class Tk::Tile::TMenubutton < Tk::Menubutton
TkCommandNames = ['::tmenubutton'.freeze].freeze
end
WidgetClassName = 'TMenubutton'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ 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
index 9e27e2c1fd..4d65e363da 100644
--- a/ext/tk/lib/tkextlib/tile/tnotebook.rb
+++ b/ext/tk/lib/tkextlib/tile/tnotebook.rb
@@ -13,10 +13,13 @@ module Tk
end
end
+Tk.__set_toplevel_aliases__(:Ttk, Tk::Tile::Notebook, :TkNotebook)
+
+
class Tk::Tile::TNotebook < TkWindow
################################
include TkItemConfigMethod
-
+
def __item_cget_cmd(id)
[self.path, 'tab', id]
end
@@ -43,11 +46,8 @@ class Tk::Tile::TNotebook < TkWindow
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]
+ tabconfigure(tagOrId, option)[-1]
end
def tabcget(tagOrId, option)
unless TkItemConfigMethod.__IGNORE_UNKNOWN_CONFIGURE_OPTION__
@@ -80,7 +80,7 @@ class Tk::Tile::TNotebook < TkWindow
TkCommandNames = ['::tnotebook'.freeze].freeze
end
WidgetClassName = 'TNotebook'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
def self.style(*args)
[self::WidgetClassName, *(args.map!{|a| _get_eval_string(a)})].join('.')
@@ -109,11 +109,7 @@ class Tk::Tile::TNotebook < TkWindow
def forget(idx)
tk_send('forget', idx)
self
- end
-
- def hide(idx)
- tk_send('hide', idx)
- end
+ end
def index(idx)
number(tk_send('index', idx))
@@ -141,7 +137,3 @@ class Tk::Tile::TNotebook < TkWindow
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
index d6ad234559..d96ff43973 100644
--- a/ext/tk/lib/tkextlib/tile/tpaned.rb
+++ b/ext/tk/lib/tkextlib/tile/tpaned.rb
@@ -13,6 +13,10 @@ module Tk
end
end
+Tk.__set_toplevel_aliases__(:Ttk, Tk::Tile::Panedwindow,
+ :TkPanedwindow, :TkPanedWindow)
+
+
class Tk::Tile::TPaned < TkWindow
include Tk::Tile::TileWidget
@@ -26,7 +30,7 @@ class Tk::Tile::TPaned < TkWindow
TkCommandNames = ['::tpaned'.freeze].freeze
end
WidgetClassName = 'TPaned'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
def self.style(*args)
[self::WidgetClassName, *(args.map!{|a| _get_eval_string(a)})].join('.')
@@ -62,12 +66,6 @@ class Tk::Tile::TPaned < TkWindow
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}"))
@@ -129,7 +127,7 @@ class Tk::Tile::TPaned < TkWindow
end
conf
else
- tk_split_simplelist(tk_send_without_enc('pane',
+ tk_split_simplelist(tk_send_without_enc('pane',
win)).collect{|conflist|
conf = tk_split_simplelist(conflist)
conf[0] = conf[0][1..-1]
@@ -137,18 +135,18 @@ class Tk::Tile::TPaned < TkWindow
if conf[0] == 'hide'
conf[3] = bool(conf[3]) unless conf[3].empty?
elsif conf[3].index('{')
- conf[3] = tk_split_list(conf[3])
+ conf[3] = tk_split_list(conf[3])
else
- conf[3] = tk_tcl2ruby(conf[3])
+ 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])
+ conf[4] = tk_split_list(conf[4])
else
- conf[4] = tk_tcl2ruby(conf[4])
+ conf[4] = tk_tcl2ruby(conf[4])
end
end
conf[1] = conf[1][1..-1] if conf.size == 2 # alias info
@@ -167,7 +165,7 @@ class Tk::Tile::TPaned < TkWindow
{ key => conf }
else
ret = {}
- tk_split_simplelist(tk_send_without_enc('pane',
+ tk_split_simplelist(tk_send_without_enc('pane',
win)).each{|conflist|
conf = tk_split_simplelist(conflist)
key = conf.shift[1..-1]
@@ -175,18 +173,18 @@ class Tk::Tile::TPaned < TkWindow
if key == 'hide'
conf[2] = bool(conf[2]) unless conf[2].empty?
elsif conf[2].index('{')
- conf[2] = tk_split_list(conf[2])
+ conf[2] = tk_split_list(conf[2])
else
- conf[2] = tk_tcl2ruby(conf[2])
+ 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])
+ conf[3] = tk_split_list(conf[3])
else
- conf[3] = tk_tcl2ruby(conf[3])
+ conf[3] = tk_tcl2ruby(conf[3])
end
end
if conf.size == 1
@@ -223,23 +221,11 @@ class Tk::Tile::TPaned < TkWindow
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))
+ list(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
index 0c9d15e1b9..f786d370dd 100644
--- a/ext/tk/lib/tkextlib/tile/tprogressbar.rb
+++ b/ext/tk/lib/tkextlib/tile/tprogressbar.rb
@@ -13,6 +13,9 @@ module Tk
end
end
+Tk.__set_toplevel_aliases__(:Ttk, Tk::Tile::Progressbar, :TkProgressbar)
+
+
class Tk::Tile::TProgressbar
include Tk::Tile::TileWidget
@@ -22,7 +25,7 @@ class Tk::Tile::TProgressbar
TkCommandNames = ['::tprogressbar'.freeze].freeze
end
WidgetClassName = 'TProgressbar'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
def self.style(*args)
[self::WidgetClassName, *(args.map!{|a| _get_eval_string(a)})].join('.')
@@ -51,7 +54,3 @@ class Tk::Tile::TProgressbar
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
index 5dbf260666..d653a6d256 100644
--- a/ext/tk/lib/tkextlib/tile/tradiobutton.rb
+++ b/ext/tk/lib/tkextlib/tile/tradiobutton.rb
@@ -15,6 +15,10 @@ module Tk
end
end
+Tk.__set_toplevel_aliases__(:Ttk, Tk::Tile::Radiobutton,
+ :TkRadiobutton, :TkRadioButton)
+
+
class Tk::Tile::TRadioButton < Tk::RadioButton
include Tk::Tile::TileWidget
@@ -24,15 +28,9 @@ class Tk::Tile::TRadioButton < Tk::RadioButton
TkCommandNames = ['::tradiobutton'.freeze].freeze
end
WidgetClassName = 'TRadiobutton'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ 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
index 70db3d6d78..c978a1a07b 100644
--- a/ext/tk/lib/tkextlib/tile/treeview.rb
+++ b/ext/tk/lib/tkextlib/tile/treeview.rb
@@ -12,12 +12,15 @@ module Tk
end
end
+Tk.__set_toplevel_aliases__(:Ttk, Tk::Tile::Treeview, :TkTreeview)
+
+
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,
+ {:key=>0, :alias=>nil, :db_name=>nil, :db_class=>nil,
:default_value=>nil, :current_value=>1}
end
private :__item_configinfo_struct
@@ -376,12 +379,12 @@ module Tk::Tile::TreeviewConfig
###################
def __item_cget_cmd(id)
- [self.path, *id]
+ [self.path, id[0], id[1]]
end
private :__item_cget_cmd
def __item_config_cmd(id)
- [self.path, *id]
+ [self.path, id[0], id[1]]
end
private :__item_config_cmd
@@ -448,7 +451,7 @@ module Tk::Tile::TreeviewConfig
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)
@@ -495,7 +498,7 @@ module Tk::Tile::TreeviewConfig
end
slot = conf[__item_configinfo_struct(tagid(tagOrId))[:alias]]
end while(org_slot != slot)
- fail RuntimeError,
+ fail RuntimeError,
"there is a configure alias loop about '#{org_slot}'"
else
ret = {}
@@ -516,20 +519,16 @@ module Tk::Tile::TreeviewConfig
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 :__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
@@ -547,9 +546,6 @@ module Tk::Tile::TreeviewConfig
end
# Treeview Column
- def columncget_tkstring(tagOrId, option)
- __itemcget_tkstring([:column, tagOrId], option)
- end
def columncget(tagOrId, option)
__itemcget([:column, tagOrId], option)
end
@@ -565,7 +561,6 @@ module Tk::Tile::TreeviewConfig
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
@@ -573,19 +568,6 @@ module Tk::Tile::TreeviewConfig
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
@@ -648,7 +630,6 @@ module Tk::Tile::TreeviewConfig
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
@@ -656,25 +637,21 @@ module Tk::Tile::TreeviewConfig
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)
+ __itemcget([:tag, tagOrId], option)
end
def tagcget_strict(tagOrId, option)
- __itemcget_strict([:tag, :configure, tagOrId], option)
+ __itemcget_strict([:tag, tagOrId], option)
end
def tagconfigure(tagOrId, slot, value=None)
- __itemconfigure([:tag, :configure, tagOrId], slot, value)
+ __itemconfigure([:tag, tagOrId], slot, value)
end
def tagconfiginfo(tagOrId, slot=nil)
- __itemconfiginfo([:tag, :configure, tagOrId], slot)
+ __itemconfiginfo([:tag, tagOrId], slot)
end
def current_tagconfiginfo(tagOrId, slot=nil)
- __current_itemconfiginfo([:tag, :configure, tagOrId], slot)
+ __current_itemconfiginfo([:tag, tagOrId], slot)
end
- alias tag_cget_tkstring tagcget_tkstring
alias tag_cget tagcget
alias tag_cget_strict tagcget_strict
alias tag_configure tagconfigure
@@ -730,7 +707,7 @@ class Tk::Tile::Treeview::Item < TkObject
keys = _symbolkey2str(keys)
id = keys.delete('id')
if id
- num_or_str(tk_call(tree, 'insert',
+ 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)))
@@ -760,9 +737,6 @@ class Tk::Tile::Treeview::Item < TkObject
@id
end
- def cget_tkstring(option)
- @t.itemcget_tkstring(@id, option)
- end
def cget(option)
@t.itemcget(@id, option)
end
@@ -795,11 +769,6 @@ class Tk::Tile::Treeview::Item < TkObject
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
@@ -938,7 +907,7 @@ class Tk::Tile::Treeview::Tag < TkObject
TagID_TBL = TkCore::INTERP.create_table
- (Tag_ID = ['tile_treeview_tag'.freeze, TkUtil.untrust('00000')]).instance_eval{
+ (Tag_ID = ['tile_treeview_tag'.freeze, '00000'.taint]).instance_eval{
@mutex = Mutex.new
def mutex; @mutex; end
freeze
@@ -974,18 +943,13 @@ class Tk::Tile::Treeview::Tag < TkObject
TagID_TBL[@tpath][@id] = self
}
if keys && keys != None
- tk_call_without_enc(@tpath, 'tag', 'configure', @id, *hash_kv(keys,true))
+ tk_call_without_enc(@tpath, 'tag', 'configure', *hash_kv(keys, true))
end
end
def id
@id
end
- def tag_has?(item)
- @t.tag_has?(@id, item)
- end
- alias added? tag_has?
-
def bind(seq, *args)
if TkComm._callback_entry?(args[0]) || !block_given?
cmd = args.shift
@@ -1015,9 +979,6 @@ class Tk::Tile::Treeview::Tag < TkObject
@t.tag_bindinfo(@id, seq)
end
- def cget_tkstring(option)
- @t.tagcget_tkstring(@id, option)
- end
def cget(option)
@t.tagcget(@id, option)
end
@@ -1053,7 +1014,7 @@ class Tk::Tile::Treeview < TkWindow
TkCommandNames = ['::treeview'.freeze].freeze
end
WidgetClassName = 'Treeview'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
def __destroy_hook__
Tk::Tile::Treeview::Item::ItemID_TBL.mutex.synchronize{
@@ -1069,12 +1030,11 @@ class Tk::Tile::Treeview < TkWindow
end
def tagid(id)
- if id.kind_of?(Tk::Tile::Treeview::Item) ||
+ 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])
+ [id[0], _get_eval_string(id[1])]
else
_get_eval_string(id)
end
@@ -1094,7 +1054,7 @@ class Tk::Tile::Treeview < TkWindow
}
end
def set_children(item, *items)
- tk_send_without_enc('children', item,
+ tk_send_without_enc('children', item,
array2tk_list(items.flatten, true))
self
end
@@ -1137,29 +1097,14 @@ class Tk::Tile::Treeview < TkWindow
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))
@@ -1258,15 +1203,6 @@ class Tk::Tile::Treeview < TkWindow
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
@@ -1300,7 +1236,3 @@ class Tk::Tile::Treeview < TkWindow
end
alias tagbindinfo tag_bindinfo
end
-
-#Tk.__set_toplevel_aliases__(:Ttk, Tk::Tile::Treeview, :TkTreeview)
-Tk.__set_loaded_toplevel_aliases__('tkextlib/tile/treeview.rb',
- :Ttk, Tk::Tile::Treeview, :TkTreeview)
diff --git a/ext/tk/lib/tkextlib/tile/tscale.rb b/ext/tk/lib/tkextlib/tile/tscale.rb
index 7eefcef731..2c46fd9bd4 100644
--- a/ext/tk/lib/tkextlib/tile/tscale.rb
+++ b/ext/tk/lib/tkextlib/tile/tscale.rb
@@ -17,6 +17,9 @@ module Tk
end
end
+Tk.__set_toplevel_aliases__(:Ttk, Tk::Tile::Scale, :TkScale)
+
+
class Tk::Tile::TScale < Tk::Scale
include Tk::Tile::TileWidget
@@ -26,13 +29,11 @@ class Tk::Tile::TScale < Tk::Scale
TkCommandNames = ['::tscale'.freeze].freeze
end
WidgetClassName = 'TScale'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ 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
@@ -44,13 +45,9 @@ class Tk::Tile::TProgress < Tk::Tile::TScale
TkCommandNames = ['::tprogress'.freeze].freeze
end
WidgetClassName = 'TProgress'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ 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
index c6bba5810b..163b8f4713 100644
--- a/ext/tk/lib/tkextlib/tile/tscrollbar.rb
+++ b/ext/tk/lib/tkextlib/tile/tscrollbar.rb
@@ -13,6 +13,9 @@ module Tk
end
end
+Tk.__set_toplevel_aliases__(:Ttk, Tk::Tile::Scrollbar, :TkScrollbar)
+
+
class Tk::Tile::TScrollbar < Tk::Scrollbar
include Tk::Tile::TileWidget
@@ -22,21 +25,13 @@ class Tk::Tile::TScrollbar < Tk::Scrollbar
TkCommandNames = ['::tscrollbar'.freeze].freeze
end
WidgetClassName = 'TScrollbar'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ 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
@@ -55,9 +50,5 @@ class Tk::Tile::YScrollbar < Tk::Tile::TScrollbar
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)
+Tk.__set_toplevel_aliases__(:Ttk, Tk::Tile::XScrollbar, :TkXScrollbar)
+Tk.__set_toplevel_aliases__(:Ttk, Tk::Tile::YScrollbar, :TkYScrollbar)
diff --git a/ext/tk/lib/tkextlib/tile/tseparator.rb b/ext/tk/lib/tkextlib/tile/tseparator.rb
index ffd2f6f89f..30fae2c525 100644
--- a/ext/tk/lib/tkextlib/tile/tseparator.rb
+++ b/ext/tk/lib/tkextlib/tile/tseparator.rb
@@ -13,6 +13,9 @@ module Tk
end
end
+Tk.__set_toplevel_aliases__(:Ttk, Tk::Tile::Separator, :TkSeparator)
+
+
class Tk::Tile::TSeparator < TkWindow
include Tk::Tile::TileWidget
@@ -22,13 +25,9 @@ class Tk::Tile::TSeparator < TkWindow
TkCommandNames = ['::tseparator'.freeze].freeze
end
WidgetClassName = 'TSeparator'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ 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
deleted file mode 100644
index 2f2d73c5ab..0000000000
--- a/ext/tk/lib/tkextlib/tile/tspinbox.rb
+++ /dev/null
@@ -1,107 +0,0 @@
-#
-# 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
index a81cd7b98a..600b55e4e7 100644
--- a/ext/tk/lib/tkextlib/tile/tsquare.rb
+++ b/ext/tk/lib/tkextlib/tile/tsquare.rb
@@ -22,7 +22,7 @@ class Tk::Tile::TSquare < TkWindow
TkCommandNames = ['::tsquare'.freeze].freeze
end
WidgetClassName = 'TSquare'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
def self.style(*args)
[self::WidgetClassName, *(args.map!{|a| _get_eval_string(a)})].join('.')
diff --git a/ext/tk/lib/tkextlib/tkDND/setup.rb b/ext/tk/lib/tkextlib/tkDND/setup.rb
index ee406c6ca0..ce0f0bd4d4 100644
--- a/ext/tk/lib/tkextlib/tkDND/setup.rb
+++ b/ext/tk/lib/tkextlib/tkDND/setup.rb
@@ -2,7 +2,7 @@
# 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
+# 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/tkdnd.rb b/ext/tk/lib/tkextlib/tkDND/tkdnd.rb
index 97cdfc7f1c..9a9b2dc42c 100644
--- a/ext/tk/lib/tkextlib/tkDND/tkdnd.rb
+++ b/ext/tk/lib/tkextlib/tkDND/tkdnd.rb
@@ -30,30 +30,30 @@ module Tk
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 ],
+ [ ?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) ],
+ [ ?n, TkComm.method(:num_or_str) ],
+ [ ?s, TkComm.method(:string) ],
+ [ ?l, TkComm.method(:list) ],
+ [ ?L, TkComm.method(:simplelist) ],
+ [ ?w, TkComm.method(:window) ],
nil
]
@@ -101,11 +101,11 @@ module Tk
#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),
+ # 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,
+ # tk_call('dnd', 'bindtarget', @path, type, event,
# install_bind_for_event_class(DND_Subst, cmd, prior, *args))
# end
# self
@@ -123,11 +123,11 @@ module Tk
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),
+ 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,
+ tk_call('dnd', 'bindtarget', @path, type, event,
install_bind_for_event_class(DND_Subst, cmd, prior, *args))
end
self
diff --git a/ext/tk/lib/tkextlib/tkHTML/htmlwidget.rb b/ext/tk/lib/tkextlib/tkHTML/htmlwidget.rb
index b9ee90aace..d893a83cf2 100644
--- a/ext/tk/lib/tkextlib/tkHTML/htmlwidget.rb
+++ b/ext/tk/lib/tkextlib/tkHTML/htmlwidget.rb
@@ -36,7 +36,7 @@ end
class Tk::HTML_Widget::ClippingWindow
WidgetClassName = 'HtmlClip'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
HtmlClip_TBL = TkCore::INTERP.create_table
@@ -73,7 +73,7 @@ class Tk::HTML_Widget::ClippingWindow
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"
@@ -101,11 +101,11 @@ class Tk::HTML_Widget
TkCommandNames = ['html'.freeze].freeze
WidgetClassName = 'Html'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
def create_self(keys)
if keys and keys != None
- tk_call_without_enc(self.class::TkCommandNames[0], @path,
+ tk_call_without_enc(self.class::TkCommandNames[0], @path,
*hash_kv(keys, true))
else
tk_call_without_enc(self.class::TkCommandNames[0], @path)
diff --git a/ext/tk/lib/tkextlib/tkHTML/setup.rb b/ext/tk/lib/tkextlib/tkHTML/setup.rb
index ee406c6ca0..ce0f0bd4d4 100644
--- a/ext/tk/lib/tkextlib/tkHTML/setup.rb
+++ b/ext/tk/lib/tkextlib/tkHTML/setup.rb
@@ -2,7 +2,7 @@
# 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
+# 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/setup.rb b/ext/tk/lib/tkextlib/tkimg/setup.rb
index ee406c6ca0..ce0f0bd4d4 100644
--- a/ext/tk/lib/tkextlib/tkimg/setup.rb
+++ b/ext/tk/lib/tkextlib/tkimg/setup.rb
@@ -2,7 +2,7 @@
# 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
+# 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/setup.rb b/ext/tk/lib/tkextlib/tktable/setup.rb
index ee406c6ca0..ce0f0bd4d4 100644
--- a/ext/tk/lib/tkextlib/tktable/setup.rb
+++ b/ext/tk/lib/tkextlib/tktable/setup.rb
@@ -2,7 +2,7 @@
# 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
+# 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
index bc7a6c9a2e..f6cf24b40f 100644
--- a/ext/tk/lib/tkextlib/tktable/tktable.rb
+++ b/ext/tk/lib/tkextlib/tktable/tktable.rb
@@ -74,9 +74,6 @@ module Tk::TkTable::ConfigMethod
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
@@ -93,9 +90,6 @@ module Tk::TkTable::ConfigMethod
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
@@ -120,7 +114,7 @@ module Tk::TkTable::ConfigMethod
current_itemconfiginfo(['window', tagid(tagOrId)], slot)
end
- private :itemcget_tkstring, :itemcget, :itemcget_strict
+ private :itemcget, :itemcget_strict
private :itemconfigure, :itemconfiginfo, :current_itemconfiginfo
end
@@ -131,7 +125,7 @@ class Tk::TkTable::CellTag
CellTagID_TBL = TkCore::INTERP.create_table
- (CellTag_ID = ['tktbl:celltag'.freeze, TkUtil.untrust('00000')]).instance_eval{
+ (CellTag_ID = ['tktbl:celltag'.freeze, '00000'.taint]).instance_eval{
@mutex = Mutex.new
def mutex; @mutex; end
freeze
@@ -203,9 +197,6 @@ class Tk::TkTable::CellTag
@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
@@ -262,7 +253,7 @@ end
class Tk::TkTable
TkCommandNames = ['table'.freeze].freeze
WidgetClassName = 'Table'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
include Scrollable
include Tk::TkTable::ConfigMethod
@@ -291,21 +282,21 @@ class Tk::TkTable
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 ],
+ [ ?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) ],
+ [ ?n, TkComm.method(:number) ],
+ [ ?x, TkComm.method(:num_or_str) ],
+ [ ?s, TkComm.method(:string) ],
+ [ ?w, TkComm.method(:window) ],
nil
]
@@ -342,21 +333,21 @@ class Tk::TkTable
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 ],
+ [ ?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)} ],
+ [ ?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
]
@@ -393,19 +384,19 @@ class Tk::TkTable
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 ],
+ [ ?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) ],
+ [ ?n, TkComm.method(:number) ],
+ [ ?s, TkComm.method(:string) ],
+ [ ?w, TkComm.method(:window) ],
nil
]
@@ -442,22 +433,22 @@ class Tk::TkTable
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 ],
+ [ ?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)} ],
+ [ ?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
]
@@ -490,7 +481,7 @@ class Tk::TkTable
#################################
def __validation_class_list
- super() <<
+ super() <<
BrowseCommand << CellCommand << SelectionCommand << ValidateCommand
end
@@ -606,7 +597,7 @@ class Tk::TkTable
def hidden_list
simplelist(tk_send('hidden'))
- end
+ end
def hidden?(idx, *args)
if args.empty?
if (ret = tk_send('hidden', tagid(idx))) == ''
@@ -710,7 +701,7 @@ class Tk::TkTable
self
end
- def set(*pairs) # idx, val, idx, val, ...
+ def set(*pairs) # idx, val, idx, val, ...
args = []
0.step(pairs.size-1, 2){|i|
args << tagid(pairs[i])
@@ -719,7 +710,7 @@ class Tk::TkTable
tk_send('set', *args)
self
end
- def set_row(*pairs) # idx, val, idx, val, ...
+ def set_row(*pairs) # idx, val, idx, val, ...
args = []
0.step(pairs.size-1, 2){|i|
args << tagid(pairs[i])
@@ -728,7 +719,7 @@ class Tk::TkTable
tk_send('set', 'row', *args)
self
end
- def set_col(*pairs) # idx, val, idx, val, ...
+ def set_col(*pairs) # idx, val, idx, val, ...
args = []
0.step(pairs.size-1, 2){|i|
args << tagid(pairs[i])
@@ -745,7 +736,7 @@ class Tk::TkTable
pairs.each{|idx, val| args << tagid(idx) << val }
tk_send('set', *args)
else
- # idx, val, idx, val, ...
+ # idx, val, idx, val, ...
args = []
0.step(pairs.size-1, 2){|i|
args << tagid(pairs[i])
@@ -762,7 +753,7 @@ class Tk::TkTable
pairs.each{|idx, val| args << tagid(idx) << val }
tk_send('set', 'row', *args)
else
- # idx, val, idx, val, ...
+ # idx, val, idx, val, ...
args = []
0.step(pairs.size-1, 2){|i|
args << tagid(pairs[i])
@@ -779,7 +770,7 @@ class Tk::TkTable
pairs.each{|idx, val| args << idx << val }
tk_send('set', 'col', *args)
else
- # idx, val, idx, val, ...
+ # idx, val, idx, val, ...
args = []
0.step(pairs.size-1, 2){|i|
args << tagid(pairs[i])
@@ -807,7 +798,7 @@ class Tk::TkTable
[idx [rows, cols]]
end
def set_spans(*pairs)
- # idx, val, idx, val, ...
+ # idx, val, idx, val, ...
args = []
0.step(pairs.size-1, 2){|i|
args << tagid(pairs[i])
@@ -836,7 +827,7 @@ class Tk::TkTable
}
tk_send('spans', *args)
else
- # idx, val, idx, val, ...
+ # idx, val, idx, val, ...
args = []
0.step(pairs.size-1, 2){|i|
args << tagid(pairs[i])
@@ -903,9 +894,9 @@ class Tk::TkTable
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)
+ Tk::TkTable::CellTag::CellTagID_TBL[@path].delete(tag.id)
else
- Tk::TkTable::CellTag::CellTagID_TBL[@path].delete(tag)
+ Tk::TkTable::CellTag::CellTagID_TBL[@path].delete(tag)
end
end
}
diff --git a/ext/tk/lib/tkextlib/tktrans/setup.rb b/ext/tk/lib/tkextlib/tktrans/setup.rb
index ee406c6ca0..ce0f0bd4d4 100644
--- a/ext/tk/lib/tkextlib/tktrans/setup.rb
+++ b/ext/tk/lib/tkextlib/tktrans/setup.rb
@@ -2,7 +2,7 @@
# 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
+# 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/setup.rb b/ext/tk/lib/tkextlib/treectrl/setup.rb
index ee406c6ca0..ce0f0bd4d4 100644
--- a/ext/tk/lib/tkextlib/treectrl/setup.rb
+++ b/ext/tk/lib/tkextlib/treectrl/setup.rb
@@ -2,7 +2,7 @@
# 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
+# 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
index 1879a531ae..e10e6e299e 100644
--- a/ext/tk/lib/tkextlib/treectrl/tktreectrl.rb
+++ b/ext/tk/lib/tkextlib/treectrl/tktreectrl.rb
@@ -32,14 +32,14 @@ module Tk
end
end
- HasColumnCreateCommand =
+ 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.
+ # 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
@@ -48,7 +48,7 @@ module Tk
# NOTE: platform == 'unix' only
# img => TkPhotoImage
- # x, y => screen coords
+ # 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)
@@ -76,28 +76,28 @@ 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 ],
+ [ ?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) ],
+ [ ?n, TkComm.method(:num_or_str) ],
+ [ ?s, TkComm.method(:string) ],
+ [ ?l, TkComm.method(:list) ],
+ [ ?w, TkComm.method(:window) ],
[ ?e, proc{|val|
case val
@@ -109,9 +109,9 @@ class Tk::TreeCtrl::NotifyEvent
val
end
}
- ],
+ ],
- [ ?o, proc{|val| TkComm.tk_tcl2ruby(val)} ],
+ [ ?o, proc{|val| TkComm.tk_tcl2ruby(val)} ],
[ ?x, proc{|val|
begin
@@ -132,7 +132,7 @@ class Tk::TreeCtrl::NotifyEvent
rescue
val
end
- } ],
+ } ],
nil
]
@@ -157,15 +157,15 @@ class Tk::TreeCtrl::NotifyEvent
# 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.
+ # _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().
+ # 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
@@ -185,7 +185,7 @@ module Tk::TreeCtrl::ConfigMethod
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.kind_of?(Tk::TreeCtrl::Style))
obj = obj.id
end
@@ -236,7 +236,7 @@ module Tk::TreeCtrl::ConfigMethod
def __item_cget_cmd(mixed_id)
if mixed_id[0] == 'column' && mixed_id[1] == 'drag'
return [self.path, 'column', 'dragcget']
- end
+ end
if mixed_id[1].kind_of?(Array)
id = mixed_id[1]
@@ -255,7 +255,7 @@ module Tk::TreeCtrl::ConfigMethod
def __item_config_cmd(mixed_id)
if mixed_id[0] == 'column' && mixed_id[1] == 'drag'
return [self.path, 'column', 'dragconfigure']
- end
+ end
if mixed_id[1].kind_of?(Array)
id = mixed_id[1]
@@ -291,10 +291,10 @@ module Tk::TreeCtrl::ConfigMethod
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,
+ {: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,
+ {:key=>0, :alias=>1, :db_name=>1, :db_class=>2,
:default_value=>3, :current_value=>4}
end
end
@@ -302,7 +302,7 @@ module Tk::TreeCtrl::ConfigMethod
def __item_font_optkeys(id)
- if id.kind_of?(Array) && (id[0] == 'element' ||
+ if id.kind_of?(Array) && (id[0] == 'element' ||
(id[0].kind_of?(Array) && id[0][1] == 'element'))
[]
else
@@ -322,7 +322,7 @@ module Tk::TreeCtrl::ConfigMethod
def __item_boolval_optkeys(id)
if id == 'debug'
- ['data', 'display', 'enable', 'span', 'textlayout']
+ ['data', 'display', 'enable']
elsif id == 'dragimage'
['visible']
elsif id == 'marquee'
@@ -330,20 +330,20 @@ module Tk::TreeCtrl::ConfigMethod
elsif id.kind_of?(Array)
case id[0]
when 'item'
- ['visible', 'wrap', 'open', 'returnid', 'visible']
+ ['button', 'visible']
when 'column'
if id[1] == 'drag'
['enable']
else
- ['button', 'expand', 'resize', 'squeeze', 'sunken',
+ ['button', 'expand', 'resize', 'squeeze', 'sunken',
'visible', 'widthhack']
end
when 'element'
- ['draw', 'filled', 'showfocus', 'clip', 'destroy']
+ ['draw', 'filled', 'showfocus', 'destroy']
when 'notify'
['active']
when 'style'
- ['detach', 'indent', 'visible']
+ ['detach']
else
if id[0].kind_of?(Array) && id[0][1] == 'element'
['filled', 'showfocus']
@@ -401,36 +401,19 @@ module Tk::TreeCtrl::ConfigMethod
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,
+ 'notreally'=>nil,
'increasing'=>'decreasing',
- 'decreasing'=>'increasing',
+ 'decreasing'=>'increasing',
'ascii'=>nil,
- 'dictionary'=>nil,
- 'integer'=>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
@@ -447,9 +430,6 @@ module Tk::TreeCtrl::ConfigMethod
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
@@ -466,9 +446,6 @@ module Tk::TreeCtrl::ConfigMethod
current_itemconfiginfo(['column', 'drag'], slot)
end
- def debug_cget_tkstring(option)
- itemcget_tkstring('debug', option)
- end
def debug_cget(option)
itemcget('debug', option)
end
@@ -485,9 +462,6 @@ module Tk::TreeCtrl::ConfigMethod
current_itemconfiginfo('debug', slot)
end
- def dragimage_cget_tkstring(option)
- itemcget_tkstring('dragimage', option)
- end
def dragimage_cget(option)
itemcget('dragimage', option)
end
@@ -504,9 +478,6 @@ module Tk::TreeCtrl::ConfigMethod
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
@@ -523,9 +494,6 @@ module Tk::TreeCtrl::ConfigMethod
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
@@ -542,9 +510,6 @@ module Tk::TreeCtrl::ConfigMethod
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
@@ -561,9 +526,6 @@ module Tk::TreeCtrl::ConfigMethod
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
@@ -580,11 +542,6 @@ module Tk::TreeCtrl::ConfigMethod
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.
@@ -614,9 +571,6 @@ module Tk::TreeCtrl::ConfigMethod
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
@@ -633,7 +587,7 @@ module Tk::TreeCtrl::ConfigMethod
current_itemconfiginfo(['style', tagOrId], slot)
end
- private :itemcget_tkstring, :itemcget, :itemcget_strict
+ private :itemcget, :itemcget_strict
private :itemconfigure, :itemconfiginfo, :current_itemconfiginfo
end
@@ -645,7 +599,7 @@ class Tk::TreeCtrl
TkCommandNames = ['treectrl'.freeze].freeze
WidgetClassName = 'TreeCtrl'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
#########################
@@ -675,9 +629,9 @@ class Tk::TreeCtrl
def __boolval_optkeys
[
- 'itemwidthequal', 'usetheme',
- 'showbuttons', 'showheader', 'showlines', 'showroot',
- 'showrootbutton', 'showrootlines', 'showrootchildbuttons'
+ 'itemwidthequal', 'usetheme',
+ 'showbuttons', 'showheader', 'showlines', 'showroot',
+ 'showrootbutton', 'showrootlines',
]
end
private :__boolval_optkeys
@@ -697,7 +651,7 @@ class Tk::TreeCtrl
def create_self(keys)
if keys and keys != None
- tk_call_without_enc(self.class::TkCommandNames[0], @path,
+ tk_call_without_enc(self.class::TkCommandNames[0], @path,
*hash_kv(keys, true))
else
tk_call_without_enc(self.class::TkCommandNames[0], @path)
@@ -726,7 +680,7 @@ class Tk::TreeCtrl
end
def collapse_recurse(*dsc)
- tk_send_without_enc('collapse', '-recurse',
+ tk_send_without_enc('collapse', '-recurse',
*(dsc.map!{|d| _get_eval_string(d, true)}))
self
end
@@ -977,7 +931,7 @@ class Tk::TreeCtrl
end
def item_collapse_recurse(item)
- tk_send_without_enc('item', 'collapse',
+ tk_send_without_enc('item', 'collapse',
_get_eval_string(item, true), '-recurse')
self
end
@@ -987,8 +941,8 @@ class Tk::TreeCtrl
end
def item_complex(item, *args)
- tk_send_without_enc('item', 'complex',
- _get_eval_string(item, true),
+ tk_send_without_enc('item', 'complex',
+ _get_eval_string(item, true),
*(args.map!{|arg| _get_eval_string(arg, true)}))
self
end
@@ -1054,12 +1008,12 @@ class Tk::TreeCtrl
def item_firstchild(parent, child=nil)
if child
- tk_send_without_enc('item', 'firstchild',
- _get_eval_string(parent, true),
+ 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',
+ id = num_or_str(tk_send_without_enc('item', 'firstchild',
_get_eval_string(parent, true)))
Tk::TreeCtrl::Item.id2obj(self, id)
end
@@ -1068,11 +1022,11 @@ class Tk::TreeCtrl
def item_hasbutton(item, st=None)
if st == None
- bool(tk_send_without_enc('item', 'hasbutton',
+ bool(tk_send_without_enc('item', 'hasbutton',
_get_eval_string(item, true)))
else
- tk_send_without_enc('item', 'hasbutton',
- _get_eval_string(item, true),
+ tk_send_without_enc('item', 'hasbutton',
+ _get_eval_string(item, true),
_get_eval_string(st))
self
end
@@ -1132,12 +1086,12 @@ class Tk::TreeCtrl
def item_lastchild(parent, child=nil)
if child
- tk_send_without_enc('item', 'lastchild',
+ 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',
+ id = num_or_str(tk_send_without_enc('item', 'lastchild',
_get_eval_string(parent, true)))
Tk::TreeCtrl::Item.id2obj(self, id)
end
@@ -1156,7 +1110,7 @@ class Tk::TreeCtrl
alias item_next_sibling item_nextsibling
def item_numchildren(item)
- number(tk_send_without_enc('item', 'numchildren',
+ number(tk_send_without_enc('item', 'numchildren',
_get_eval_string(item, true)))
end
alias item_num_children item_numchildren
@@ -1317,20 +1271,20 @@ class Tk::TreeCtrl
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),
+ 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',
+ 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),
+ 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)
}))
@@ -1593,8 +1547,8 @@ class Tk::TreeCtrl
self
end
- def see(item, column=None, keys={})
- tk_send('see', item, column, *hash_kv(keys))
+ def see(item)
+ tk_send('see', item)
self
end
@@ -1686,8 +1640,8 @@ class Tk::TreeCtrl
tk_send('style', 'layout', style, elem, *hash_kv(keys))
self
else
- _conv_style_layout_val(keys,
- tk_send('style', 'layout',
+ _conv_style_layout_val(keys,
+ tk_send('style', 'layout',
style, elem, "-#{keys}"))
end
else
@@ -1732,7 +1686,7 @@ end
class Tk::TreeCtrl::Column < TkObject
TreeCtrlColumnID_TBL = TkCore::INTERP.create_table
- (TreeCtrlColumnID = ['treectrl_column'.freeze, TkUtil.untrust('00000')]).instance_eval{
+ (TreeCtrlColumnID = ['treectrl_column'.freeze, '00000'.taint]).instance_eval{
@mutex = Mutex.new
def mutex; @mutex; end
freeze
@@ -1763,7 +1717,7 @@ class Tk::TreeCtrl::Column < TkObject
keys = _symbolkey2str(keys)
Tk::TreeCtrl::Column::TreeCtrlColumnID.mutex.synchronize{
- @path = @id =
+ @path = @id =
keys.delete('tag') ||
Tk::TreeCtrl::Column::TreeCtrlColumnID.join(TkCore::INTERP._ip_id_)
Tk::TreeCtrl::Column::TreeCtrlColumnID[1].succ!
@@ -1772,7 +1726,7 @@ class Tk::TreeCtrl::Column < TkObject
keys['tag'] = @id
Tk::TreeCtrl::Column::TreeCtrlColumnID_TBL.mutex.synchronize{
- Tk::TreeCtrl::Column::TreeCtrlColumnID_TBL[@tpath] ||= {}
+ Tk::TreeCtrl::Column::TreeCtrlColumnID_TBL[@tpath] ||= {}
Tk::TreeCtrl::Column::TreeCtrlColumnID_TBL[@tpath][@id] = self
}
@@ -1787,9 +1741,6 @@ class Tk::TreeCtrl::Column < TkObject
@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
@@ -1838,7 +1789,7 @@ end
class Tk::TreeCtrl::Element < TkObject
TreeCtrlElementID_TBL = TkCore::INTERP.create_table
- (TreeCtrlElementID = ['treectrl_element'.freeze, TkUtil.untrust('00000')]).instance_eval{
+ (TreeCtrlElementID = ['treectrl_element'.freeze, '00000'.taint]).instance_eval{
@mutex = Mutex.new
def mutex; @mutex; end
freeze
@@ -1872,13 +1823,13 @@ class Tk::TreeCtrl::Element < TkObject
@tpath = parent.path
@type = type.to_s
Tk::TreeCtrl::Element::TreeCtrlElementID.mutex.synchronize{
- @path = @id =
+ @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] ||= {}
Tk::TreeCtrl::Element::TreeCtrlElementID_TBL[@tpath][@id] = self
}
@@ -1893,9 +1844,6 @@ class Tk::TreeCtrl::Element < TkObject
@id.dup
end
- def cget_tkstring(opt)
- @tree.element_cget_tkstring(@id, opt)
- end
def cget(opt)
@tree.element_cget(@id, opt)
end
@@ -1990,7 +1938,7 @@ class Tk::TreeCtrl::Item < TkObject
@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] ||= {}
Tk::TreeCtrl::Item::TreeCtrlItemID_TBL[@tpath][@id] = self
}
end
@@ -2030,9 +1978,6 @@ class Tk::TreeCtrl::Item < TkObject
self
end
- def cget_tkstring(opt)
- @tree.item_cget_tkstring(@id, opt)
- end
def cget(opt)
@tree.item_cget(@id, opt)
end
@@ -2069,10 +2014,7 @@ class Tk::TreeCtrl::Item < TkObject
@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)
+ def element_cget(opt)
@tree.item_element_cget(@id, opt)
end
def element_cget_strict(opt)
@@ -2276,7 +2218,7 @@ end
class Tk::TreeCtrl::Style < TkObject
TreeCtrlStyleID_TBL = TkCore::INTERP.create_table
- (TreeCtrlStyleID = ['treectrl_style'.freeze, TkUtil.untrust('00000')]).instance_eval{
+ (TreeCtrlStyleID = ['treectrl_style'.freeze, '00000'.taint]).instance_eval{
@mutex = Mutex.new
def mutex; @mutex; end
freeze
@@ -2305,13 +2247,13 @@ class Tk::TreeCtrl::Style < TkObject
@tpath = parent.path
Tk::TreeCtrl::Style::TreeCtrlStyleID.mutex.synchronize{
- @path = @id =
+ @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] ||= {}
Tk::TreeCtrl::Style::TreeCtrlStyleID_TBL[@tpath][@id] = self
}
@@ -2326,9 +2268,6 @@ class Tk::TreeCtrl::Style < TkObject
@id.dup
end
- def cget_tkstring(opt)
- @tree.style_cget_tkstring(@id, opt)
- end
def cget(opt)
@tree.style_cget(@id, opt)
end
diff --git a/ext/tk/lib/tkextlib/trofs/setup.rb b/ext/tk/lib/tkextlib/trofs/setup.rb
index ee406c6ca0..ce0f0bd4d4 100644
--- a/ext/tk/lib/tkextlib/trofs/setup.rb
+++ b/ext/tk/lib/tkextlib/trofs/setup.rb
@@ -2,7 +2,7 @@
# 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
+# 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/version.rb b/ext/tk/lib/tkextlib/version.rb
index 3bc3ec5ae2..434ed11a2e 100644
--- a/ext/tk/lib/tkextlib/version.rb
+++ b/ext/tk/lib/tkextlib/version.rb
@@ -2,5 +2,5 @@
# release date of tkextlib
#
module Tk
- Tkextlib_RELEASE_DATE = '2009-07-12'.freeze
+ Tkextlib_RELEASE_DATE = '2008-05-23'.freeze
end
diff --git a/ext/tk/lib/tkextlib/vu/bargraph.rb b/ext/tk/lib/tkextlib/vu/bargraph.rb
index b9fcf925f3..27ff3c7cd0 100644
--- a/ext/tk/lib/tkextlib/vu/bargraph.rb
+++ b/ext/tk/lib/tkextlib/vu/bargraph.rb
@@ -19,7 +19,7 @@ require 'tkextlib/vu.rb'
class Tk::Vu::Bargraph < TkWindow
TkCommandNames = ['::vu::bargraph'.freeze].freeze
WidgetClassName = 'Bargraph'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
###############################
@@ -30,10 +30,10 @@ class Tk::Vu::Bargraph < TkWindow
def __strval_optkeys
super() + [
- 'title',
- 'barbackground', 'barcolor', 'barcolour',
- 'tickcolor', 'tickcolour',
- 'textcolor', 'textcolour',
+ 'title',
+ 'barbackground', 'barcolor', 'barcolour',
+ 'tickcolor', 'tickcolour',
+ 'textcolor', 'textcolour',
]
end
private :__strval_optkeys
diff --git a/ext/tk/lib/tkextlib/vu/charts.rb b/ext/tk/lib/tkextlib/vu/charts.rb
index 8569ac5541..ee4298fa1c 100644
--- a/ext/tk/lib/tkextlib/vu/charts.rb
+++ b/ext/tk/lib/tkextlib/vu/charts.rb
@@ -18,7 +18,7 @@ module Tk
private :__item_boolval_optkeys
def __item_strval_optkeys(id)
- super(id) << 'bar' << 'color' << 'outline' <<
+ super(id) << 'bar' << 'color' << 'outline' <<
'fill' << 'scaleline' << 'stripline'
end
private :__item_strval_optkeys
diff --git a/ext/tk/lib/tkextlib/vu/dial.rb b/ext/tk/lib/tkextlib/vu/dial.rb
index eca0bbb67c..e27a38ae42 100644
--- a/ext/tk/lib/tkextlib/vu/dial.rb
+++ b/ext/tk/lib/tkextlib/vu/dial.rb
@@ -19,7 +19,7 @@ require 'tkextlib/vu.rb'
class Tk::Vu::Dial < TkWindow
TkCommandNames = ['::vu::dial'.freeze].freeze
WidgetClassName = 'Dial'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
###############################
diff --git a/ext/tk/lib/tkextlib/vu/pie.rb b/ext/tk/lib/tkextlib/vu/pie.rb
index 6b0c485d8a..c1fb6857bf 100644
--- a/ext/tk/lib/tkextlib/vu/pie.rb
+++ b/ext/tk/lib/tkextlib/vu/pie.rb
@@ -37,7 +37,7 @@ end
class Tk::Vu::Pie < TkWindow
TkCommandNames = ['::vu::pie'.freeze].freeze
WidgetClassName = 'Pie'.freeze
- WidgetClassNames[WidgetClassName] ||= self
+ WidgetClassNames[WidgetClassName] = self
def __destroy_hook__
Tk::Vu::PieSlice::SliceID_TBL.delete(@path)
@@ -117,7 +117,7 @@ end
class Tk::Vu::PieSlice
SliceID_TBL = TkCore::INTERP.create_table
- (Pie_Slice_ID = ['vu:pie'.freeze, TkUtil.untrust('00000')]).instance_eval{
+ (Pie_Slice_ID = ['vu:pie'.freeze, '00000'.taint]).instance_eval{
@mutex = Mutex.new
def mutex; @mutex; end
freeze
@@ -173,10 +173,6 @@ class Tk::Vu::PieSlice
val
end
- def cget_tkstring(slot)
- @pie.itemcget_tkstring(@id, slot)
- end
-
def cget(slot)
@pie.itemcget(@id, slot)
end
diff --git a/ext/tk/lib/tkextlib/vu/setup.rb b/ext/tk/lib/tkextlib/vu/setup.rb
index ee406c6ca0..ce0f0bd4d4 100644
--- a/ext/tk/lib/tkextlib/vu/setup.rb
+++ b/ext/tk/lib/tkextlib/vu/setup.rb
@@ -2,7 +2,7 @@
# 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
+# 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
index 7d6104f4d1..a7e40ea319 100644
--- a/ext/tk/lib/tkextlib/vu/spinbox.rb
+++ b/ext/tk/lib/tkextlib/vu/spinbox.rb
@@ -7,7 +7,7 @@
#
require 'tk'
-if (Tk::TK_MAJOR_VERSION < 8 ||
+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'
diff --git a/ext/tk/lib/tkextlib/winico/setup.rb b/ext/tk/lib/tkextlib/winico/setup.rb
index ee406c6ca0..ce0f0bd4d4 100644
--- a/ext/tk/lib/tkextlib/winico/setup.rb
+++ b/ext/tk/lib/tkextlib/winico/setup.rb
@@ -2,7 +2,7 @@
# 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
+# 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
index 9160c2960f..00316fd441 100644
--- a/ext/tk/lib/tkextlib/winico/winico.rb
+++ b/ext/tk/lib/tkextlib/winico/winico.rb
@@ -46,7 +46,7 @@ class Tk::Winico
end
def self.info
- simplelist(Tk.tk_call('winico', 'info')).collect{|id|
+ simplelist(Tk.tk_call('winico', 'info')).collect{|id|
Tk::Winico.id2obj(id)
}
end
@@ -82,7 +82,7 @@ class Tk::Winico
elsif winico_id
@id = winico_id
else
- fail ArgumentError,
+ fail ArgumentError,
"must be given proper information from where loading icons"
end
@path = @id
@@ -96,7 +96,7 @@ class Tk::Winico
end
def set_window(win_id, *opts) # opts := ?'big'|'small'?, ?pos?
- # NOTE:: the window, which is denoted by win_id, MUST BE MAPPED.
+ # 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
@@ -119,22 +119,22 @@ class Tk::Winico
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 ],
+ [ ?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|
+ [ ?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]
@@ -146,7 +146,7 @@ class Tk::Winico
end
obj
}
- } ],
+ } ],
nil
]
diff --git a/ext/tk/old-extconf.rb b/ext/tk/old-extconf.rb
deleted file mode 100644
index ebc83a0c0b..0000000000
--- a/ext/tk/old-extconf.rb
+++ /dev/null
@@ -1,440 +0,0 @@
-# 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
index 29f84e0b40..60d8072c57 100644
--- a/ext/tk/sample/24hr_clock.rb
+++ b/ext/tk/sample/24hr_clock.rb
@@ -19,7 +19,7 @@ class Clock
@mark_color = 'black'
@submark_color = 'gray50'
- @c = TkCanvas.new(:width=>2*@size, :height=>2*@size,
+ @c = TkCanvas.new(:width=>2*@size, :height=>2*@size,
:scrollregion=>[-@size, -@size, @size, @size]
).pack(:fill=>:both, :expand=>true)
@@ -59,26 +59,26 @@ class Clock
def _create_marks
@mark_tag = TkcTag.new(@c)
- TkcLine.new(@c, 0, -0.90*@size, 0, -0.85*@size,
- :tags=>[@tag, @mark_tag],
+ 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],
+ 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],
+ 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],
+ 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,
+ 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),
+ 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),
+ 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,
+ TkcText.new(@c, [-0.92*@size, 0], :text=>@clock.div(4)*3,
:anchor=>'e', :fill=>@mark_color)
[30.0, 60.0].each{|angle|
@@ -92,17 +92,17 @@ class Clock
x2 = 0.85*x_base
y2 = 0.85*y_base
- TkcLine.new(@c, x1, y1, x2, y2,
- :tags=>[@tag, @mark_tag],
+ 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],
+ 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],
+ 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],
+ TkcLine.new(@c, -x1, -y1, -x2, -y2,
+ :tags=>[@tag, @mark_tag],
:width=>@mark_width, :fill=>@mark_color)
x3 = 0.92*x_base
@@ -114,13 +114,13 @@ class Clock
dh = angle.to_i/30
end
- TkcText.new(@c, x3, -y3, :text=>dh,
+ TkcText.new(@c, x3, -y3, :text=>dh,
:anchor=>'sw', :fill=>@mark_color)
- TkcText.new(@c, x3, y3, :text=>@clock.div(2)-dh,
+ 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,
+ TkcText.new(@c, -x3, y3, :text=>@clock.div(2)+dh,
:anchor=>'ne', :fill=>@mark_color)
- TkcText.new(@c, -x3, -y3, :text=>@clock-dh,
+ TkcText.new(@c, -x3, -y3, :text=>@clock-dh,
:anchor=>'se', :fill=>@mark_color)
}
@@ -136,17 +136,17 @@ class Clock
x2 = 0.875*x_base
y2 = 0.875*y_base
- TkcLine.new(@c, x1, y1, x2, y2,
- :tags=>[@tag, @mark_tag],
+ 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],
+ 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],
+ 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],
+ TkcLine.new(@c, -x1, -y1, -x2, -y2,
+ :tags=>[@tag, @mark_tag],
:width=>@mark_width, :fill=>@submark_color)
}
end
@@ -162,48 +162,48 @@ class Clock
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],
+ [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],
+ [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],
+ [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,
+ @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,
+ @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,
+ @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],
+ @center_dot = TkcOval.new(@c,
+ [-@cdot_size, -@cdot_size],
+ [@cdot_size, @cdot_size],
:outline=>@cdot_color, :fill=>@cdot_color)
end
private :_create_hands
@@ -269,8 +269,8 @@ class Clock
extent = -span/2.0
end
- pie = TkcArc.new(@c, @circle_coords, :tags=>[@tag],
- :outline=>'black', 'fill'=>color,
+ pie = TkcArc.new(@c, @circle_coords, :tags=>[@tag],
+ :outline=>'black', 'fill'=>color,
:start=>start, :extent=>extent)
_raise_hands
_raise_marks
diff --git a/ext/tk/sample/binding_sample.rb b/ext/tk/sample/binding_sample.rb
index 3c2eb5e1cb..693cc7de2f 100644
--- a/ext/tk/sample/binding_sample.rb
+++ b/ext/tk/sample/binding_sample.rb
@@ -43,7 +43,7 @@ class Button_clone < TkLabel
def invoke
if @command
- @command.call
+ @command.call
else
''
end
@@ -53,7 +53,7 @@ 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
+And the second one is a normal label widget
but with some bindings like a button widget.
EOT
@@ -66,7 +66,7 @@ TkFrame.new{|f|
TkLabel.new(f, :textvariable=>v).pack(:side=>:left)
}.pack
-TkButton.new(:text=>'normal Button widget',
+TkButton.new(:text=>'normal Button widget',
:command=>proc{
puts 'button is clicked!!'
lbl.text 'button is clicked!!'
@@ -75,7 +75,7 @@ TkButton.new(:text=>'normal Button widget',
pack(:fill=>:x, :expand=>true)
}
-Button_clone.new(:text=>'Label with Button binding',
+Button_clone.new(:text=>'Label with Button binding',
:command=>proc{
puts 'label is clicked!!'
lbl.text 'label is clicked!!'
diff --git a/ext/tk/sample/bindtag_sample.rb b/ext/tk/sample/bindtag_sample.rb
index b13364bb68..8c93b4a260 100644
--- a/ext/tk/sample/bindtag_sample.rb
+++ b/ext/tk/sample/bindtag_sample.rb
@@ -2,18 +2,18 @@
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
+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',
+ TkButton.bind('ButtonPress-1',
proc{puts 'bind "ButtonPress-1" of TkButton class'})
- TkButton.bind('ButtonRelease-1',
+ TkButton.bind('ButtonRelease-1',
proc{puts 'bind "ButtonRelease-1" of TkButton class'})
end
@@ -23,21 +23,21 @@ 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',
+TkBindTag::ALL.bind('ButtonPress-1',
proc{puts 'bind "ButtonPress-1" of the tag "all"'})
-TkBindTag::ALL.bind('ButtonRelease-1',
+TkBindTag::ALL.bind('ButtonRelease-1',
proc{puts 'bind "ButtonRelease-1" of the tag "all"'})
# create buttons
-b1 = TkButton.new(:text=>'button-1',
+b1 = TkButton.new(:text=>'button-1',
:command=>proc{puts "command of button-1"}).pack
-b2 = TkButton.new(:text=>'button-2',
+b2 = TkButton.new(:text=>'button-2',
:command=>proc{puts "command of button-2"}).pack
-b3 = TkButton.new(:text=>'button-3',
+b3 = TkButton.new(:text=>'button-3',
:command=>proc{puts "command of button-3"}).pack
-b4 = TkButton.new(:text=>'button-4',
+b4 = TkButton.new(:text=>'button-4',
:command=>proc{puts "command of button-4"}).pack
-b5 = TkButton.new(:text=>'button-5',
+b5 = TkButton.new(:text=>'button-5',
:command=>proc{puts "command of button-5"}).pack
# set button binding
@@ -62,14 +62,14 @@ 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',
+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',
+tag2.bind('ButtonRelease-1',
proc{
puts 'bind "ButtonRelease-1" of tag2'
puts 'call Tk.callback_continue'
@@ -78,14 +78,14 @@ tag2.bind('ButtonRelease-1',
})
tag3 = TkBindTag.new
-tag3.bind('ButtonPress-1',
+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',
+tag3.bind('ButtonRelease-1',
proc{
puts 'bind "ButtonRelease-1" of tag3'
puts 'call Tk.callback_break'
@@ -117,7 +117,7 @@ p b4.bindtags
b5.bindtags([tag1, TkButton, tag2, b5])
# create button to set button class binding
-TkButton.new(:text=>'set binding to TkButton class',
+TkButton.new(:text=>'set binding to TkButton class',
:command=>proc{
puts 'call "set_class_bind"'
set_class_bind
diff --git a/ext/tk/sample/binstr_usage.rb b/ext/tk/sample/binstr_usage.rb
index fa81f98b5e..be8399ba51 100644
--- a/ext/tk/sample/binstr_usage.rb
+++ b/ext/tk/sample/binstr_usage.rb
@@ -13,7 +13,7 @@ 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.
+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)
diff --git a/ext/tk/sample/cd_timer.rb b/ext/tk/sample/cd_timer.rb
index e2611fbf23..9154e89bfe 100644
--- a/ext/tk/sample/cd_timer.rb
+++ b/ext/tk/sample/cd_timer.rb
@@ -7,23 +7,23 @@
require 'tk'
if ARGV.empty?
- $stderr.puts 'Error:: No time arguments for counting down'
+ $stderr.puts 'Error:: No time arguments for counting down'
exit(1)
end
width = 10
-TkButton.new(:text=>'exit',
+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',
+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',
+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|
@@ -41,9 +41,9 @@ timers = [ TkRTTimer.new(10){|tm|
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,
+ 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,
+ 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
diff --git a/ext/tk/sample/cmd_res_test.rb b/ext/tk/sample/cmd_res_test.rb
index 8df2e61af7..6e954f26ee 100644
--- a/ext/tk/sample/cmd_res_test.rb
+++ b/ext/tk/sample/cmd_res_test.rb
@@ -1,5 +1,5 @@
require 'tk'
-TkOptionDB.readfile(File.expand_path('cmd_resource',
+TkOptionDB.readfile(File.expand_path('cmd_resource',
File.dirname(__FILE__)))
f = TkFrame.new(:class=>'BtnFrame').pack
b = TkButton.new(:parent=>f, :widgetname=>'hello').pack
diff --git a/ext/tk/sample/demos-en/anilabel.rb b/ext/tk/sample/demos-en/anilabel.rb
index ebd84accd2..0b9bc7357e 100644
--- a/ext/tk/sample/demos-en/anilabel.rb
+++ b/ext/tk/sample/demos-en/anilabel.rb
@@ -4,7 +4,7 @@
# based on Tcl/Tk8.5a2 widget demos
if defined?($anilabel_demo) && $anilabel_demo
- $anilabel_demo.destroy
+ $anilabel_demo.destroy
$anilabel_demo = nil
end
@@ -47,7 +47,7 @@ TkFrame.new(base_frame) {|frame|
# 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',
+Tk.pack(f_left, f_right, 'side'=>'left', 'expand'=>'yes', 'fill'=>'both',
'padx'=>10, 'pady'=>10)
# animated label
@@ -85,7 +85,7 @@ class AnimatedImageLabel < AnimatedTextLabel
@btag.bind_append('Destroy'){
if @destroy_image
begin
- self.image.delete
+ self.image.delete
rescue
end
end
@@ -121,13 +121,13 @@ class AnimatedImageLabel < AnimatedTextLabel
end
# create labels
-l1 = AnimatedTextLabel.new(f_left, :borderwidth=>4, :relief=>:ridge,
+l1 = AnimatedTextLabel.new(f_left, :borderwidth=>4, :relief=>:ridge,
:font=>{:family=>'Courier', :size=>10})
-l2 = AnimatedTextLabel.new(f_left, :borderwidth=>4, :relief=>:groove,
+l2 = AnimatedTextLabel.new(f_left, :borderwidth=>4, :relief=>:groove,
:font=>{:family=>'Courier', :size=>10})
-l3 = AnimatedTextLabel.new(f_left, :borderwidth=>4, :relief=>:flat,
+l3 = AnimatedTextLabel.new(f_left, :borderwidth=>4, :relief=>:flat,
:font=>{:family=>'Courier', :size=>10}, :width=>18)
-Tk.pack(l1, l2, l3,
+Tk.pack(l1, l2, l3,
:side=>:top, :expand=>true, :anchor=>:w, :padx=>10, :pady=>10)
limg = AnimatedImageLabel.new(f_right, :borderwidth=>0)
diff --git a/ext/tk/sample/demos-en/aniwave.rb b/ext/tk/sample/demos-en/aniwave.rb
index 57d58193f6..63a04a7b98 100644
--- a/ext/tk/sample/demos-en/aniwave.rb
+++ b/ext/tk/sample/demos-en/aniwave.rb
@@ -5,7 +5,7 @@
# destroy toplevel widget for this demo script
if defined?($aniwave_demo) && $aniwave_demo
- $aniwave_demo.destroy
+ $aniwave_demo.destroy
$aniwave_demo = nil
end
@@ -51,11 +51,11 @@ class AnimatedWaveDemo
@direction = dir
# create canvas widget
- @c = TkCanvas.new(frame, :width=>300, :height=>200,
+ @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.
+ # Creates a coordinates list of a wave.
@waveCoords = []
@backupCoords = []
n = 0
@@ -67,10 +67,10 @@ class AnimatedWaveDemo
# Create a smoothed line and arrange for its coordinates to be the
# contents of the variable waveCoords.
- @line = TkcLine.new(@c, @waveCoords,
+ @line = TkcLine.new(@c, @waveCoords,
:width=>1, :fill=>'green', :smooth=>true)
- # Main animation "loop".
+ # Main animation "loop".
# Theoretically 100 frames-per-second (==10ms between frames)
@timer = TkTimer.new(10){ basicMotion; reverser }
diff --git a/ext/tk/sample/demos-en/arrow.rb b/ext/tk/sample/demos-en/arrow.rb
index 452153d010..055cd2af3c 100644
--- a/ext/tk/sample/demos-en/arrow.rb
+++ b/ext/tk/sample/demos-en/arrow.rb
@@ -28,65 +28,65 @@ def arrowSetup(c)
# 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'
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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
+ # 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,
+ 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,
+ 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,
+ 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,
+ 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',
+ TkcText.new(c, v.x1, 310, 'text'=>"'width'=>#{v.width}", 'anchor'=>'w',
'font'=>'-*-Helvetica-Medium-R-Normal--*-180-*-*-*-*-*-*')
- TkcText.new(c, v.x1, 330,
+ 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',
+ TkcText.new(c, v.x1, 310, 'text'=>"'width'=>#{v.width}", 'anchor'=>'w',
'font'=>'Helvetica 18')
- TkcText.new(c, v.x1, 330,
+ TkcText.new(c, v.x1, 330,
'text'=>"'arrowshape'=>[#{v.a}, #{v.b}, #{v.c}]",
'anchor'=>'w', 'font'=>'Helvetica 18')
end
@@ -96,7 +96,7 @@ end
# toplevel widget
if defined?($arrow_demo) && $arrow_demo
- $arrow_demo.destroy
+ $arrow_demo.destroy
$arrow_demo = nil
end
@@ -110,7 +110,7 @@ $arrow_demo = TkToplevel.new {|w|
base_frame = TkFrame.new($arrow_demo).pack(:fill=>:both, :expand=>true)
# label
-TkLabel.new(base_frame, 'font'=>$font, 'wraplength'=>'5i', 'justify'=>'left',
+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')
}
@@ -133,15 +133,15 @@ $arrow_buttons = TkFrame.new(base_frame) {|frame|
}
$arrow_buttons.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
-# canvas
-$arrow_canvas = TkCanvas.new(base_frame, 'width'=>500, 'height'=>350,
+# 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,
+ $demo_arrowInfo = Struct.new("ArrowInfo", :a, :b, :c, :width, :motionProc,
+ :x1, :x2, :y, :smallTips, :count,
:bigLineStyle, :boxStyle, :activeStyle).new
end
$demo_arrowInfo.a = 8
@@ -159,7 +159,7 @@ if TkWinfo.depth($arrow_canvas) > 1
$demo_arrowInfo.boxStyle = {'fill'=>'', 'outline'=>'black', 'width'=>1}
$demo_arrowInfo.activeStyle = {'fill'=>'red', 'outline'=>'black', 'width'=>1}
else
- $demo_arrowInfo.bigLineStyle = {'fill'=>'black',
+ $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}
@@ -170,16 +170,16 @@ $arrowTag_box.bind('Enter', proc{$arrow_canvas.itemconfigure('current', $demo_ar
$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',
+$arrow_canvas.itembind('box1', '1',
proc{$demo_arrowInfo.motionProc \
= proc{|x,y| arrowMove1 $arrow_canvas, x, y}})
-$arrow_canvas.itembind('box2', '1',
+$arrow_canvas.itembind('box2', '1',
proc{$demo_arrowInfo.motionProc \
= proc{|x,y| arrowMove2 $arrow_canvas, x, y}})
-$arrow_canvas.itembind('box3', '1',
+$arrow_canvas.itembind('box3', '1',
proc{$demo_arrowInfo.motionProc \
= proc{|x,y| arrowMove3 $arrow_canvas, x, y}})
-$arrowTag_box.bind('B1-Motion',
+$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})
diff --git a/ext/tk/sample/demos-en/bind.rb b/ext/tk/sample/demos-en/bind.rb
index c291e4730a..665592a2bc 100644
--- a/ext/tk/sample/demos-en/bind.rb
+++ b/ext/tk/sample/demos-en/bind.rb
@@ -8,7 +8,7 @@
# toplevel widget
if defined?($bind_demo) && $bind_demo
- $bind_demo.destroy
+ $bind_demo.destroy
$bind_demo = nil
end
@@ -38,15 +38,15 @@ TkFrame.new(base_frame) {|frame|
}.pack('side'=>'left', 'expand'=>'yes')
}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
-# bind
+# bind
def tag_binding_for_bind_demo(tag, enter_style, leave_style)
tag.bind('Any-Enter', proc{tag.configure enter_style})
tag.bind('Any-Leave', proc{tag.configure leave_style})
end
-# text
+# text
txt = TkText.new(base_frame){|t|
- #
+ #
setgrid 'true'
#width 60
#height 24
@@ -59,9 +59,9 @@ txt = TkText.new(base_frame){|t|
}
pack('expand'=>'yes', 'fill'=>'both')
- #
+ #
if TkWinfo.depth($root).to_i > 1
- tagstyle_bold = {'background'=>'#43ce80', 'relief'=>'raised',
+ tagstyle_bold = {'background'=>'#43ce80', 'relief'=>'raised',
'borderwidth'=>1}
tagstyle_normal = {'background'=>'', 'relief'=>'flat'}
else
@@ -77,44 +77,44 @@ txt = TkText.new(base_frame){|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.',
+ 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.',
+ 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.',
+ 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.',
+ 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',
+ d1.bind('1',
proc{
eval_samplecode(`cat #{[$demo_dir,'items.rb'].join(File::Separator)}`, 'items.rb')
})
- d2.bind('1',
+ d2.bind('1',
proc{
eval_samplecode(`cat #{[$demo_dir,'plot.rb'].join(File::Separator)}`, 'plot.rb')
})
- d3.bind('1',
+ d3.bind('1',
proc{
eval_samplecode(`cat #{[$demo_dir,'ctext.rb'].join(File::Separator)}`, 'ctext.rb')
})
- d4.bind('1',
+ d4.bind('1',
proc{
eval_samplecode(`cat #{[$demo_dir,'arrow.rb'].join(File::Separator)}`, 'arrow.rb')
})
- d5.bind('1',
+ d5.bind('1',
proc{
eval_samplecode(`cat #{[$demo_dir,'ruler.rb'].join(File::Separator)}`, 'ruler.rb')
})
- d6.bind('1',
+ d6.bind('1',
proc{
eval_samplecode(`cat #{[$demo_dir,'cscroll.rb'].join(File::Separator)}`, 'cscroll.rb')
})
diff --git a/ext/tk/sample/demos-en/bitmap.rb b/ext/tk/sample/demos-en/bitmap.rb
index 858d067d0d..133adb0543 100644
--- a/ext/tk/sample/demos-en/bitmap.rb
+++ b/ext/tk/sample/demos-en/bitmap.rb
@@ -17,7 +17,7 @@
def bitmapRow(w,*args)
TkFrame.new(w){|row|
pack('side'=>'top', 'fill'=>'both')
- for bitmap in args
+ 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')
@@ -29,7 +29,7 @@ end
# toplevel widget
if defined?($bitmap_demo) && $bitmap_demo
- $bitmap_demo.destroy
+ $bitmap_demo.destroy
$bitmap_demo = nil
end
@@ -43,7 +43,7 @@ $bitmap_demo = TkToplevel.new {|w|
base_frame = TkFrame.new($bitmap_demo).pack(:fill=>:both, :expand=>true)
# label
-TkLabel.new(base_frame,'font'=>$font,'wraplength'=>'4i','justify'=>'left',
+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')
}
@@ -66,7 +66,7 @@ $bitmap_buttons = TkFrame.new(base_frame) {|frame|
}
$bitmap_buttons.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
-# frame
+# frame
TkFrame.new(base_frame){|f|
bitmapRow(f,'error','gray25','gray50','hourglass')
bitmapRow(f,'info','question','questhead','warning')
diff --git a/ext/tk/sample/demos-en/button.rb b/ext/tk/sample/demos-en/button.rb
index f63a2f3b06..5c03bd499b 100644
--- a/ext/tk/sample/demos-en/button.rb
+++ b/ext/tk/sample/demos-en/button.rb
@@ -6,20 +6,20 @@
# button widget demo (called by 'widget')
#
-# toplevel widget
+# toplevel widget
if defined?($button_demo) && $button_demo
- $button_demo.destroy
+ $button_demo.destroy
$button_demo = nil
end
-# demo toplevel widget
+# demo toplevel widget
$button_demo = TkToplevel.new {|w|
title("Button Demonstration")
iconname("button")
positionWindow(w)
}
-# label
+# label
msg = TkLabel.new($button_demo) {
font $kanji_font
wraplength '4i'
@@ -28,7 +28,7 @@ msg = TkLabel.new($button_demo) {
}
msg.pack('side'=>'top')
-# frame
+# frame
$button_buttons = Tk::Frame.new($button_demo) {|frame|
TkButton.new(frame) {
text 'Dismiss'
diff --git a/ext/tk/sample/demos-en/check.rb b/ext/tk/sample/demos-en/check.rb
index bf0b73476a..2951962a79 100644
--- a/ext/tk/sample/demos-en/check.rb
+++ b/ext/tk/sample/demos-en/check.rb
@@ -8,7 +8,7 @@
# toplevel widget
if defined?($check_demo) && $check_demo
- $check_demo.destroy
+ $check_demo.destroy
$check_demo = nil
end
@@ -21,7 +21,7 @@ $check_demo = TkToplevel.new {|w|
base_frame = TkFrame.new($check_demo).pack(:fill=>:both, :expand=>true)
-# label
+# label
msg = TkLabel.new(base_frame) {
font $font
wraplength '4i'
@@ -30,12 +30,12 @@ msg = TkLabel.new(base_frame) {
}
msg.pack('side'=>'top')
-#
+#
wipers = TkVariable.new(0)
brakes = TkVariable.new(0)
sober = TkVariable.new(0)
-# frame
+# frame
TkFrame.new(base_frame) {|frame|
TkButton.new(frame) {
text 'Dismiss'
@@ -56,7 +56,7 @@ TkFrame.new(base_frame) {|frame|
TkButton.new(frame) {
text 'See Variables'
command proc{
- showVars(base_frame,
+ showVars(base_frame,
['wipers', wipers], ['brakes', brakes], ['sober', sober])
}
}.pack('side'=>'left', 'expand'=>'yes')
diff --git a/ext/tk/sample/demos-en/check2.rb b/ext/tk/sample/demos-en/check2.rb
index 4f7b1f07bc..faea748a87 100644
--- a/ext/tk/sample/demos-en/check2.rb
+++ b/ext/tk/sample/demos-en/check2.rb
@@ -4,7 +4,7 @@
# delete old toplevel widget
if defined?($check2_demo) && $check2_demo
- $check2_demo.destroy
+ $check2_demo.destroy
$check2_demo = nil
end
@@ -34,35 +34,35 @@ sober = TkVariable.new(0)
# frame
TkFrame.new(base_frame) {|frame|
- TkGrid(TkFrame.new(frame, :height=>2, :relief=>:sunken, :bd=>2),
+ 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,
+ TkGrid('x',
+ TkButton.new(frame, :text=>'See Variables',
+ :image=>$image['view'], :compound=>:left,
:command=>proc{
- showVars($check2_demo,
- ['safety', safety], ['wipers', wipers],
+ 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,
+ }),
+ 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',
+TkCheckButton.new(base_frame, :text=>'Safety Check', :variable=>safety,
+ :relief=>:flat, :onvalue=>'all', :offvalue=>'none',
:tristatevalue=>'partial'){
pack('side'=>'top', 'pady'=>2, 'anchor'=>'w')
}
@@ -70,7 +70,7 @@ TkCheckButton.new(base_frame, :text=>'Safety Check', :variable=>safety,
[ 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|
+].each{|w|
w.relief('flat')
w.pack('side'=>'top', 'padx'=>15, 'pady'=>2, 'anchor'=>'w')
}
diff --git a/ext/tk/sample/demos-en/clrpick.rb b/ext/tk/sample/demos-en/clrpick.rb
index 6da28cb112..431439d55d 100644
--- a/ext/tk/sample/demos-en/clrpick.rb
+++ b/ext/tk/sample/demos-en/clrpick.rb
@@ -9,7 +9,7 @@
# toplevel widget
if defined?($clrpick_demo) && $clrpick_demo
- $clrpick_demo.destroy
+ $clrpick_demo.destroy
$clrpick_demo = nil
end
@@ -47,10 +47,10 @@ Tk::Frame.new($clrpick_demo) {|frame|
}.pack('side'=>'left', 'expand'=>'yes')
}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
-# button
+# 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',
+ command(proc{setColor $clrpick_demo, b, 'background',
['background', 'highlightbackground']})
pack('side'=>'top', 'anchor'=>'c', 'pady'=>'2m')
}
@@ -64,7 +64,7 @@ Tk::Button.new($clrpick_demo, 'text'=>'Set foreground color ...') {|b|
def setColor(w,button,name,options)
w.grab
initialColor = button[name]
- color = Tk.chooseColor('title'=>"Choose a #{name} color", 'parent'=>w,
+ color = Tk.chooseColor('title'=>"Choose a #{name} color", 'parent'=>w,
'initialcolor'=>initialColor)
if color != ""
setColor_helper(w,options,color)
diff --git a/ext/tk/sample/demos-en/colors.rb b/ext/tk/sample/demos-en/colors.rb
index b0ef9590b9..4300a660ae 100644
--- a/ext/tk/sample/demos-en/colors.rb
+++ b/ext/tk/sample/demos-en/colors.rb
@@ -9,7 +9,7 @@
# toplevel widget
if defined?($colors_demo) && $colors_demo
- $colors_demo.destroy
+ $colors_demo.destroy
$colors_demo = nil
end
diff --git a/ext/tk/sample/demos-en/combo.rb b/ext/tk/sample/demos-en/combo.rb
index d77660095c..0907d9e8ec 100644
--- a/ext/tk/sample/demos-en/combo.rb
+++ b/ext/tk/sample/demos-en/combo.rb
@@ -5,7 +5,7 @@
# 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.destroy
$combo_demo = nil
end
@@ -17,7 +17,7 @@ $combo_demo = TkToplevel.new {|w|
base_frame = TkFrame.new($combo_demo).pack(:fill=>:both, :expand=>true)
-Ttk::Label.new(base_frame, :font=>$font, :wraplength=>'5i', :justify=>:left,
+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 \
@@ -40,24 +40,24 @@ ozCity = TkVariable.new
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,
+ TkGrid('x',
+ Ttk::Button.new(frame, :text=>'See Variables',
+ :image=>$image['view'], :compound=>:left,
:command=>proc{
- showVars(base_frame,
- ['firstVariable', firstValue],
- ['secondVariable', secondValue],
+ 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,
+ }),
+ 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)
@@ -66,7 +66,7 @@ Ttk::Frame.new(base_frame) {|frame|
frame = Ttk::Frame.new(base_frame).pack(:fill=>:both, :expand=>true)
australianCities = [
- 'Canberra', 'Sydney', 'Melbourne', 'Perth', 'Adelaide', 'Brisbane',
+ 'Canberra', 'Sydney', 'Melbourne', 'Perth', 'Adelaide', 'Brisbane',
'Hobart', 'Darwin', 'Alice Springs'
]
@@ -80,17 +80,17 @@ Tk.pack(Ttk::Labelframe.new(frame, :text=>'Fully Editable'){|f|
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,
+ 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
index 40a3afc0ad..259ed3bd8c 100644
--- a/ext/tk/sample/demos-en/cscroll.rb
+++ b/ext/tk/sample/demos-en/cscroll.rb
@@ -8,7 +8,7 @@
# toplevel widget
if defined?($cscroll_demo) && $cscroll_demo
- $cscroll_demo.destroy
+ $cscroll_demo.destroy
$cscroll_demo = nil
end
@@ -22,7 +22,7 @@ $cscroll_demo = TkToplevel.new {|w|
base_frame = TkFrame.new($cscroll_demo).pack(:fill=>:both, :expand=>true)
# label
-TkLabel.new(base_frame, 'font'=>$font, 'wraplength'=>'4i',
+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')
}
@@ -45,7 +45,7 @@ $cscroll_buttons = TkFrame.new(base_frame) {|frame|
}
$cscroll_buttons.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
-# frame
+# frame
unless $tk_version =~ /^4\.[01]/
$cscroll_grid = TkFrame.new(base_frame) {
pack('expand'=>'yes', 'fill'=>'both', 'padx'=>1, 'pady'=>1)
@@ -55,14 +55,14 @@ unless $tk_version =~ /^4\.[01]/
end
# canvas
-$cscroll_canvas = TkCanvas.new(base_frame,
+$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')
+ pack('expand'=>'yes', 'fill'=>'both')
else
- grid('in'=>$cscroll_grid, 'padx'=>1, 'pady'=>1, 'row'=>0, 'column'=>0,
+ grid('in'=>$cscroll_grid, 'padx'=>1, 'pady'=>1, 'row'=>0, 'column'=>0,
'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news')
end
@@ -71,18 +71,18 @@ $cscroll_canvas = TkCanvas.new(base_frame,
if $tk_version =~ /^4\.[01]/
pack('side'=>'right', 'fill'=>'y')
else
- grid('in'=>$cscroll_grid, 'padx'=>1, 'pady'=>1, 'row'=>0, 'column'=>1,
+ 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',
+ 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')
+ pack('side'=>'bottom', 'fill'=>'x')
else
- grid('in'=>$cscroll_grid, 'padx'=>1, 'pady'=>1, 'row'=>1, 'column'=>0,
+ grid('in'=>$cscroll_grid, 'padx'=>1, 'pady'=>1, 'row'=>1, 'column'=>0,
'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news')
end
}
@@ -93,9 +93,9 @@ bg = $cscroll_canvas.configinfo('bg')[4]
x = -10+3*i
y = -10
(0..9).each{|j|
- TkcRectangle.new($cscroll_canvas, "#{x}c", "#{y}c", "#{x+2}c", "#{y+2}c",
+ 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",
+ TkcText.new($cscroll_canvas, "#{x+1}c", "#{y+1}c",
'text'=>"#{i},#{j}", 'anchor'=>'center', 'tags'=>'text')
y += 3
}
@@ -106,7 +106,7 @@ $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',
+$cscroll_canvas.bind('B2-Motion',
proc{|x,y| $cscroll_canvas.scan_dragto(x,y)}, '%x %y')
def scrollEnter(c)
diff --git a/ext/tk/sample/demos-en/ctext.rb b/ext/tk/sample/demos-en/ctext.rb
index e04cb283f0..01374b0321 100644
--- a/ext/tk/sample/demos-en/ctext.rb
+++ b/ext/tk/sample/demos-en/ctext.rb
@@ -8,7 +8,7 @@
# toplevel widget
if defined?($ctext_demo) && $ctext_demo
- $ctext_demo.destroy
+ $ctext_demo.destroy
$ctext_demo = nil
end
@@ -22,7 +22,7 @@ $ctext_demo = TkToplevel.new {|w|
base_frame = TkFrame.new($ctext_demo).pack(:fill=>:both, :expand=>true)
# label
-TkLabel.new(base_frame, 'font'=>$font, 'wraplength'=>'5i', 'justify'=>'left',
+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.
@@ -52,20 +52,20 @@ $ctext_buttons = TkFrame.new(base_frame) {|frame|
}
$ctext_buttons.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
-# canvas
-$ctext_canvas = TkCanvas.new(base_frame, 'relief'=>'flat',
+# canvas
+$ctext_canvas = TkCanvas.new(base_frame, 'relief'=>'flat',
'borderwidth'=>0, 'width'=>500, 'height'=>350)
$ctext_canvas.pack('side'=>'top', 'expand'=>'yes', 'fill'=>'both')
-# font
+# font
if $tk_version =~ /^4.*/
textFont = '-*-Helvetica-Medium-R-Normal--*-240-*-*-*-*-*-*'
else
textFont = 'Helvetica 24'
end
-# canvas
-TkcRectangle.new($ctext_canvas, 245, 195, 255, 205,
+# canvas
+TkcRectangle.new($ctext_canvas, 245, 195, 255, 205,
'outline'=>'black', 'fill'=>'red')
ctag_text_param = {
@@ -83,24 +83,24 @@ $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}"},
+$ctag_text.bind('Shift-1',
+ proc{|x,y| $ctext_canvas.seleect_adjust 'current', "@#{x},#{y}"},
"%x %y")
-$ctag_text.bind('Shift-B1-Motion',
+$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}"},
+$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
+# 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,
+ 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)
@@ -118,15 +118,15 @@ 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,
+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-*-*-*-*-*-*',
+ 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',
+ TkcText.new($ctext_canvas, x+45, y-5, 'text'=>'Text Position',
'font'=>'Times 24', 'anchor'=>'s', 'fill'=>'brown')
end
@@ -140,18 +140,18 @@ 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-*-*-*-*-*-*',
+ 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',
+ 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',
+$ctext_canvas.itembind('config', 'Leave',
proc{$ctext_canvas\
- .itemconfigure('current',
+ .itemconfigure('current',
'fill'=>$textConfigFill)})
$textConfigFill = ''
diff --git a/ext/tk/sample/demos-en/entry1.rb b/ext/tk/sample/demos-en/entry1.rb
index fac0afc243..6f5b10fb71 100644
--- a/ext/tk/sample/demos-en/entry1.rb
+++ b/ext/tk/sample/demos-en/entry1.rb
@@ -4,7 +4,7 @@
# toplevel widget
if defined?($entry1_demo) && $entry1_demo
- $entry1_demo.destroy
+ $entry1_demo.destroy
$entry1_demo = nil
end
@@ -43,13 +43,13 @@ TkFrame.new(base_frame) {|frame|
}.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 ")
diff --git a/ext/tk/sample/demos-en/entry2.rb b/ext/tk/sample/demos-en/entry2.rb
index 05a6c83cfd..d67d04b56d 100644
--- a/ext/tk/sample/demos-en/entry2.rb
+++ b/ext/tk/sample/demos-en/entry2.rb
@@ -8,7 +8,7 @@
# toplevel widget
if defined?($entry2_demo) && $entry2_demo
- $entry2_demo.destroy
+ $entry2_demo.destroy
$entry2_demo = nil
end
@@ -82,7 +82,7 @@ TkFrame.new(base_frame, 'borderwidth'=>10) {|w|
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 ")
diff --git a/ext/tk/sample/demos-en/entry3.rb b/ext/tk/sample/demos-en/entry3.rb
index d3bc629fdf..f7df3a5653 100644
--- a/ext/tk/sample/demos-en/entry3.rb
+++ b/ext/tk/sample/demos-en/entry3.rb
@@ -7,7 +7,7 @@
# based on Tcl/Tk8.4.4 widget demos
if defined?($entry3_demo) && $entry3_demo
- $entry3_demo.destroy
+ $entry3_demo.destroy
$entry3_demo = nil
end
@@ -19,8 +19,8 @@ $entry3_demo = TkToplevel.new {|w|
base_frame = TkFrame.new($entry3_demo).pack(:fill=>:both, :expand=>true)
-TkLabel.new(base_frame,
- :font=>$font, :wraplength=>'5i', :justify=>:left,
+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 \
@@ -63,8 +63,8 @@ TkFrame.new(base_frame){|f|
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)},
+ TkTimer.new(200, count,
+ proc{widget.configure(:foreground=>bg, :background=>fg)},
proc{widget.configure(:foreground=>fg, :background=>bg)}
).start
else
@@ -86,7 +86,7 @@ def focusAndFlash(widget, fg, bg, count=5)
end
l1 = TkLabelFrame.new(base_frame, :text=>"Integer Entry")
-TkEntry.new(l1, :validate=>:focus,
+TkEntry.new(l1, :validate=>:focus,
:vcmd=>[
proc{|s| s == '' || /^[+-]?\d+$/ =~ s }, '%P'
]) {|e|
@@ -97,7 +97,7 @@ TkEntry.new(l1, :validate=>:focus,
}
l2 = TkLabelFrame.new(base_frame, :text=>"Length-Constrained Entry")
-TkEntry.new(l2, :validate=>:key, :invcmd=>proc{Tk.bell},
+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')
@@ -171,7 +171,7 @@ end
def validatePhoneChange(widget, vmode, idx, char)
return true if idx == nil
- Tk.after_idle(proc{widget.configure(:validate=>vmode,
+ 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)
@@ -179,17 +179,17 @@ def validatePhoneChange(widget, vmode, idx, 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).
+ # 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,
+TkEntry.new(l3, :validate=>:key, :invcmd=>proc{Tk.bell},
+ :textvariable=>entry3content,
:vcmd=>[
- proc{|w,v,i,s| validatePhoneChange(w,v,i,s)},
+ proc{|w,v,i,s| validatePhoneChange(w,v,i,s)},
"%W %v %i %S"
]){|e|
# Click to focus goes to the first editable character...
@@ -205,9 +205,9 @@ TkEntry.new(l3, :validate=>:key, :invcmd=>proc{Tk.bell},
}
l4 = TkLabelFrame.new(base_frame, :text=>"Password Entry")
-TkEntry.new(l4, :validate=>:key, :show=>'*',
+TkEntry.new(l4, :validate=>:key, :show=>'*',
:vcmd=>[
- proc{|s| s.length <= 8},
+ proc{|s| s.length <= 8},
'%P'
]).pack(:fill=>:x, :expand=>true, :padx=>'1m', :pady=>'1m')
diff --git a/ext/tk/sample/demos-en/filebox.rb b/ext/tk/sample/demos-en/filebox.rb
index 0c284c11d4..676c347409 100644
--- a/ext/tk/sample/demos-en/filebox.rb
+++ b/ext/tk/sample/demos-en/filebox.rb
@@ -6,7 +6,7 @@
# toplevel widget
if defined?($filebox_demo) && $filebox_demo
- $filebox_demo.destroy
+ $filebox_demo.destroy
$filebox_demo = nil
end
@@ -49,7 +49,7 @@ TkFrame.new(base_frame) {|frame|
TkEntry.new(f, 'width'=>20) {|e|
pack('side'=>'left', 'expand'=>'yes', 'fill'=>'x')
- TkButton.new(f, 'text'=>'Browse ...',
+ TkButton.new(f, 'text'=>'Browse ...',
'command'=>proc{fileDialog base_frame,e,type})\
.pack('side'=>'left')
}
@@ -60,9 +60,9 @@ TkFrame.new(base_frame) {|frame|
$tk_strictMotif = TkVarAccess.new('tk_strictMotif')
if ($tk_platform['platform'] == 'unix')
- TkCheckButton.new(base_frame,
- 'text'=>'Use Motif Style Dialog',
- 'variable'=>$tk_strictMotif,
+ TkCheckButton.new(base_frame,
+ 'text'=>'Use Motif Style Dialog',
+ 'variable'=>$tk_strictMotif,
'onvalue'=>1, 'offvalue'=>0 ).pack('anchor'=>'c')
end
@@ -71,23 +71,23 @@ def fileDialog(w,ent,operation)
#
#--------------------------------------------------------
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']],
+ ['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',
+ file = Tk.getSaveFile('filetypes'=>types, 'parent'=>w,
+ 'initialfile'=>'Untitled',
'defaultextension'=>'.txt')
end
if file != ""
diff --git a/ext/tk/sample/demos-en/floor.rb b/ext/tk/sample/demos-en/floor.rb
index eb8b23eb7d..7023f2a72e 100644
--- a/ext/tk/sample/demos-en/floor.rb
+++ b/ext/tk/sample/demos-en/floor.rb
@@ -21,7 +21,7 @@ def floorDisplay(w,active)
w.delete('all')
$activeFloor = active
- # First go through the three floors, displaying the backgrounds for
+ # First go through the three floors, displaying the backgrounds for
# each floor.
floor_bg1(w,$floor_colors['bg1'],$floor_colors['outline1'])
@@ -32,12 +32,12 @@ def floorDisplay(w,active)
w.raise("floor#{active}")
- # Create a dummy item just to mark this point in the display list,
+ # 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
+ # 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.
@@ -302,7 +302,7 @@ def floor_bg3(w,fill,outline)
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,
+ TkcLine.new(w,107,300,159,300,159,248,107,248,107,300,
'fill'=>outline, 'tags'=>['floor3','bg'])
end
@@ -316,316 +316,316 @@ end
# 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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'])
@@ -798,321 +798,321 @@ end
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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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'])
@@ -1283,206 +1283,206 @@ def floor_fg3(w,color)
'fill'=>'', 'tags'=>['floor3','room'])
$floorLabels[i.id] = '316'
$floorItems['316'] = i
- TkcText.new(w,79.5,204, 'text'=>'316', 'fill'=>color,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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'])
@@ -1577,7 +1577,7 @@ end
# toplevel widget
if defined?($floor_demo) && $floor_demo
- $floor_demo.destroy
+ $floor_demo.destroy
$floor_demo = nil
end
@@ -1593,7 +1593,7 @@ $floor_demo = TkToplevel.new {|w|
base_frame = TkFrame.new($floor_demo).pack(:fill=>:both, :expand=>true)
# label
-TkLabel.new(base_frame, 'font'=>$font, 'wraplength'=>'8i', 'justify'=>'left',
+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')
}
@@ -1616,18 +1616,18 @@ $floor_buttons = TkFrame.new(base_frame) {|frame|
}
$floor_buttons.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
-#
+#
$floorLabels = {}
$floorItems = {}
-# canvas
+# canvas
if $tk_version =~ /^4\.[01]/
$floor_canvas_frame = TkFrame.new(base_frame,'bd'=>2,'relief'=>'sunken',
'highlightthickness'=>2)
- $floor_canvas = TkCanvas.new($floor_canvas_frame,
- 'width'=>900, 'height'=>500, 'borderwidth'=>0,
+ $floor_canvas = TkCanvas.new($floor_canvas_frame,
+ 'width'=>900, 'height'=>500, 'borderwidth'=>0,
'highlightthickness'=>0) {|c|
- TkScrollbar.new(base_frame, 'orient'=>'horiz',
+ 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')
@@ -1648,20 +1648,20 @@ else
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,
+ $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,
+ 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,
+ 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,
+ h.grid('padx'=>1, 'pady'=>1, 'row'=>1, 'column'=>0,
'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news')
TkGrid.rowconfigure(f, 0, 'weight'=>1, 'minsize'=>0)
@@ -1678,7 +1678,7 @@ end
# Create an entry for displaying and typing in current room.
$currentRoom = TkVariable.new
-$floor_entry = TkEntry.new($floor_canvas, 'width'=>10, 'relief'=>'sunken',
+$floor_entry = TkEntry.new($floor_canvas, 'width'=>10, 'relief'=>'sunken',
'bd'=>2, 'textvariable'=>$currentRoom)
# Choose colors, then fill in the floorplan.
@@ -1715,7 +1715,7 @@ $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',
+$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 = ''
diff --git a/ext/tk/sample/demos-en/floor2.rb b/ext/tk/sample/demos-en/floor2.rb
index 3bfa89a920..88b07aeee4 100644
--- a/ext/tk/sample/demos-en/floor2.rb
+++ b/ext/tk/sample/demos-en/floor2.rb
@@ -21,7 +21,7 @@ def floorDisplay2(w,active)
w.delete('all')
$activeFloor2 = active
- # First go through the three floors, displaying the backgrounds for
+ # First go through the three floors, displaying the backgrounds for
# each floor.
floor2_bg1(w,$floor2_colors['bg1'],$floor2_colors['outline1'])
@@ -32,12 +32,12 @@ def floorDisplay2(w,active)
w.raise("floor#{active}")
- # Create a dummy item just to mark this point in the display list,
+ # 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
+ # 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.
@@ -302,7 +302,7 @@ def floor2_bg3(w,fill,outline)
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,
+ w.create(TkcLine,107,300,159,300,159,248,107,248,107,300,
'fill'=>outline, 'tags'=>['floor3','bg'])
end
@@ -316,316 +316,316 @@ end
# 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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'])
@@ -798,321 +798,321 @@ end
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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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'])
@@ -1283,206 +1283,206 @@ def floor2_fg3(w,color)
'fill'=>'', 'tags'=>['floor3','room'])
$floorLabels2[i.id] = '316'
$floorItems2['316'] = i
- w.create(TkcText,79.5,204, 'text'=>'316', 'fill'=>color,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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'])
@@ -1577,7 +1577,7 @@ end
# toplevel widget
if defined?($floor2_demo) && $floor2_demo
- $floor2_demo.destroy
+ $floor2_demo.destroy
$floor2_demo = nil
end
@@ -1593,7 +1593,7 @@ $floor2_demo = TkToplevel.new {|w|
base_frame = TkFrame.new($floor2_demo).pack(:fill=>:both, :expand=>true)
# label
-TkLabel.new(base_frame, 'font'=>$font, 'wraplength'=>'8i', 'justify'=>'left',
+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')
}
@@ -1616,18 +1616,18 @@ $floor2_buttons = TkFrame.new(base_frame) {|frame|
}
$floor2_buttons.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
-#
+#
$floorLabels2 = {}
$floorItems2 = {}
-# canvas
+# canvas
if $tk_version =~ /^4\.[01]/
$floor2_canvas_frame = TkFrame.new(base_frame,'bd'=>2,'relief'=>'sunken',
'highlightthickness'=>2)
- $floor2_canvas = TkCanvas.new($floor2_canvas_frame,
- 'width'=>900, 'height'=>500, 'borderwidth'=>0,
+ $floor2_canvas = TkCanvas.new($floor2_canvas_frame,
+ 'width'=>900, 'height'=>500, 'borderwidth'=>0,
'highlightthickness'=>0) {|c|
- TkScrollbar.new(base_frame, 'orient'=>'horiz',
+ 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')
@@ -1648,20 +1648,20 @@ else
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,
+ $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,
+ 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,
+ 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,
+ h.grid('padx'=>1, 'pady'=>1, 'row'=>1, 'column'=>0,
'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news')
TkGrid.rowconfigure(f, 0, 'weight'=>1, 'minsize'=>0)
@@ -1678,7 +1678,7 @@ end
# Create an entry for displaying and typing in current room.
$currentRoom2 = TkVariable.new
-$floor2_entry = TkEntry.new($floor2_canvas, 'width'=>10, 'relief'=>'sunken',
+$floor2_entry = TkEntry.new($floor2_canvas, 'width'=>10, 'relief'=>'sunken',
'bd'=>2, 'textvariable'=>$currentRoom2)
# Choose colors, then fill in the floorplan.
@@ -1715,7 +1715,7 @@ $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',
+$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 = ''
diff --git a/ext/tk/sample/demos-en/form.rb b/ext/tk/sample/demos-en/form.rb
index abb3e0e10e..3119752b1c 100644
--- a/ext/tk/sample/demos-en/form.rb
+++ b/ext/tk/sample/demos-en/form.rb
@@ -4,7 +4,7 @@
# toplevel widget
if defined?($form_demo) && $form_demo
- $form_demo.destroy
+ $form_demo.destroy
$form_demo = nil
end
@@ -43,7 +43,7 @@ TkFrame.new(base_frame) {|frame|
}.pack('side'=>'left', 'expand'=>'yes')
}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
-# entry
+# entry
form_data = []
(1..5).each{|i|
f = TkFrame.new(base_frame, 'bd'=>2)
@@ -54,7 +54,7 @@ form_data = []
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:')
diff --git a/ext/tk/sample/demos-en/goldberg.rb b/ext/tk/sample/demos-en/goldberg.rb
index d3956ef78c..c6fa37c09c 100644
--- a/ext/tk/sample/demos-en/goldberg.rb
+++ b/ext/tk/sample/demos-en/goldberg.rb
@@ -43,7 +43,7 @@
#>># lots of canvas create and move calls.
if defined?($goldberg_demo) && $goldberg_demo
- $goldberg_demo.destroy
+ $goldberg_demo.destroy
$goldberg_demo = nil
end
@@ -101,7 +101,7 @@ class TkGoldberg_Demo
@S['pause'] = TkVariable.new
@S['details'] = TkVariable.new(true)
- @S['mode'] = TkVariable.new(:MSTART, :symbol)
+ @S['mode'] = TkVariable.new(:MSTART, :symbol)
# :MSTART, :MGO, :MPAUSE, :MSSTEP, :MBSTEP, :MDONE, :MDEBUG
# 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
@@ -132,19 +132,19 @@ class TkGoldberg_Demo
@XY = {}
@XY6 = {
- '-1'=>[366, 207], '-2'=>[349, 204], '-3'=>[359, 193], '-4'=>[375, 192],
+ '-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],
+ '-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]
}
@@ -161,11 +161,11 @@ class TkGoldberg_Demo
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,
+ @screen = TkFrame.new(@parent, :bd=>2,
+ :relief=>:raised).pack(:side=>:left, :fill=>:both,
:expand=>true)
- @canvas = TkCanvas.new(@parent, :width=>850, :height=>700,
+ @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)
@@ -204,8 +204,8 @@ class TkGoldberg_Demo
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},
+ # @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)
@@ -214,34 +214,34 @@ class TkGoldberg_Demo
end
def do_ctrl_frame
- @start = Tk::Button.new(@parent, :text=>'Start', :bd=>6,
+ @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,
+ @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,
+ @step = TkButton.new(@parent, :text=>'Single Step', :font=>font,
:command=>proc{do_button(2)})
- @bstep = TkButton.new(@parent, :text=>'Big Step', :font=>font,
+ @bstep = TkButton.new(@parent, :text=>'Big Step', :font=>font,
:command=>proc{do_button(4)})
- @reset = TkButton.new(@parent, :text=>'Reset', :font=>font,
+ @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,
+ @detail = TkCheckbutton.new(@parent, :text=>'Details', :font=>font,
:relief=>:raised, :variable=>@S['details'])
- @msg_entry = TkEntry.new(@parent, :textvariable=>@S['message'],
+ @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,
+ @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',
+ @about = TkButton.new(@parent, :text=>'About',
:command=>proc{about}, :font=>font)
Tk.grid(@start, :in=>@ctrl, :row=>0, :sticky=>:ew)
@@ -269,17 +269,17 @@ class TkGoldberg_Demo
def do_detail_frame
@f_details = TkFrame.new(@details)
- @label = TkLabel.new(@f_details, :textvariable=>@S['cnt'],
+ @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,
+ 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),
+ 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
@@ -383,7 +383,7 @@ class TkGoldberg_Demo
who = who.to_i
n = send("move#{who}")
if (n & 1).nonzero? # This guy still alive
- alive << who
+ alive << who
end
if (n & 2).nonzero? # Next guy is active
alive << (who + 1)
@@ -416,10 +416,10 @@ class TkGoldberg_Demo
# START HERE! banner
def draw0
color = @C['0']
- TkcText.new(@canvas, [579, 119], :text=>'START HERE!',
- :fill=>color, :anchor=>:w,
+ 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,
+ 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
@@ -433,7 +433,7 @@ class TkGoldberg_Demo
end
pos = [
- [673, 119], [678, 119], [683, 119], [688, 119],
+ [673, 119], [678, 119], [683, 119], [688, 119],
[693, 119], [688, 119], [683, 119], [678, 119]
]
step = step % pos.length
@@ -445,15 +445,15 @@ class TkGoldberg_Demo
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 ],
+ 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 ],
+ 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),
+ TkcOval.new(@canvas, box(812, 122, 9),
:tag=>'I1', :fill=>color2, :outline=>'')
@canvas.itembind('I1', '1'){ start }
@@ -462,9 +462,9 @@ class TkGoldberg_Demo
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],
+ [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
@@ -480,40 +480,40 @@ class TkGoldberg_Demo
color = @C['2']
# Fulcrum
- TkcPolygon.new(@canvas, [750, 369, 740, 392, 760, 392],
+ TkcPolygon.new(@canvas, [750, 369, 740, 392, 760, 392],
:fill=>@C['fg'], :outline=>@C['fg'])
# Strike box
- TkcRectangle.new(@canvas, [628, 335, 660, 383],
+ 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',
+ TkcBitmap.new(@canvas, [628, yy], :bitmap=>'gray25',
:anchor=>:nw, :foreground=>@C['fg'])
- TkcBitmap.new(@canvas, [644, yy], :bitmap=>'gray25',
+ TkcBitmap.new(@canvas, [644, yy], :bitmap=>'gray25',
:anchor=>:nw, :foreground=>@C['fg'])
}
# Lever
- TkcLine.new(@canvas, [702, 366, 798, 366],
+ TkcLine.new(@canvas, [702, 366, 798, 366],
:fill=>@C['fg'], :width=>6, :tag=>'I2_0')
# R strap
- TkcLine.new(@canvas, [712, 363, 712, 355],
+ TkcLine.new(@canvas, [712, 363, 712, 355],
:fill=>@C['fg'], :width=>3, :tag=>'I2_1')
# L strap
- TkcLine.new(@canvas, [705, 363, 705, 355],
+ 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],
+ 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 ],
+ 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
@@ -523,15 +523,15 @@ class TkGoldberg_Demo
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,
+ 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,
+ 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,
+ 686, 331, 704, 322, 688, 300, 678, 283, 678, 283, 674, 298,
666, 309, 660, 324, 672, 336
]
@@ -542,7 +542,7 @@ class TkGoldberg_Demo
if step == 0 # Rotate the match
beta = 20
-
+
ox, oy = anchor('I2_0', :s) # Where to pivot
i = 0
@@ -567,23 +567,23 @@ class TkGoldberg_Demo
xy = [ [602, 296], [577, 174], [518, 174] ]
xy.each{|x, y| # 3 Pulleys
- TkcOval.new(@canvas, box(x, y, 13),
+ 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',
+ 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',
+ 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',
+ 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',
+ TkcLine.new(@canvas, [589, 296, 589, 235], :tag=>'I3_2',
:width=>3, :fill=>@C['fg'])
# Pulley 1 other half to 2
@@ -593,26 +593,26 @@ class TkGoldberg_Demo
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',
+ 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),
+ TkcOval.new(@canvas, box(x1, y1, 6),
:tag=>'I3_', :fill=>color2, :outline=>color2)
- TkcOval.new(@canvas, box(x2, y2, 6),
+ TkcOval.new(@canvas, box(x2, y2, 6),
:tag=>'I3_', :fill=>color2, :outline=>color2)
- TkcRectangle.new(@canvas, x1, y1 - 6, x2, y2 + 6,
+ 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),
+
+ 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],
+ 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],
+ TkcLine.new(@canvas, [502, 393, 522, 393, 522, 465],
:tag=>'I3__', :fill=>@C['fg'], :joinstyle=>:miter, :width=>10)
end
@@ -655,7 +655,7 @@ class TkGoldberg_Demo
}
# Swing gate
- TkcLine.new(@canvas, [518, 464, 518, 428],
+ TkcLine.new(@canvas, [518, 464, 518, 428],
:tag=>'I4', :fill=>color, :width=>1)
end
@@ -682,7 +682,7 @@ class TkGoldberg_Demo
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,
+ 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)
@@ -692,7 +692,7 @@ class TkGoldberg_Demo
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'],
+ TkcPolygon.new(@canvas, xy, :tag=>['I5', 'I5_2'], :fill=>@C['bg'],
:outline=>'', :smooth=>true)
xy = [538, 454, 535, 461] # Front leg
@@ -712,9 +712,9 @@ class TkGoldberg_Demo
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],
+ [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]
]
@@ -735,16 +735,16 @@ class TkGoldberg_Demo
color = @C['6']
xy = [324, 130, 391, 204] # Ball holder
xy = round_rect(xy, 10)
- TkcPolygon.new(@canvas, xy, :smooth=>true,
+ 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,
+ 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,
+ 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,
+ TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>2, :style=>:arc,
:start=>-41, :extent=>85)
xy = box(346, 339, 15) # Center of rotor
@@ -759,10 +759,10 @@ class TkGoldberg_Demo
TkcRectangle.new(@canvas, xy, :fill=>color, :outline=>'')
xy = [
- 368, 356, 368, 403, 389, 403, 389, 464, 320, 464, 320, 403,
+ 368, 356, 368, 403, 389, 403, 389, 464, 320, 464, 320, 403,
352, 403, 352, 366
]
- TkcPolygon.new(@canvas, xy, :fill=>color, :outline=>'',
+ 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
@@ -787,7 +787,7 @@ class TkGoldberg_Demo
loc = -i
color = colors[i]
x, y = @XY6["#{loc}"]
- TkcOval.new(@canvas, box(x, y, 5),
+ TkcOval.new(@canvas, box(x, y, 5),
:fill=>color, :outline=>color, :tag=>"I6_b#{i}")
}
draw6a(12) # The wheel
@@ -813,7 +813,7 @@ class TkGoldberg_Demo
@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),
+ TkcRectangle.new(@canvas, xy, :fill=>@canvas.itemcget('I6c', :fill),
:outline=>'')
end
return 1
@@ -853,24 +853,24 @@ class TkGoldberg_Demo
def draw7
color = @C['7']
xy = [198, 306, 277, 374] # Box
- TkcRectangle.new(@canvas, xy, :outline=>@C['fg'], :width=>2,
+ 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,
+ 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,
+ 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,
+ TkcText.new(@canvas, xy, :text=>'off', :anchor=>:e,
:fill=>@C['fg'], :font=>font)
end
@@ -915,7 +915,7 @@ class TkGoldberg_Demo
xy = [280, 209, 296, 248]
TkcOval.new(@canvas, xy, :outline=>color, :fill=>color)
xy = [
- 288, 249, 252, 249, 260, 240, 280, 234,
+ 288, 249, 252, 249, 260, 240, 280, 234,
296, 234, 316, 240, 324, 249, 288, 249
]
TkcPolygon.new(@canvas, xy, :fill=>color, :smooth=>true)
@@ -924,16 +924,16 @@ class TkGoldberg_Demo
TkcPolygon.new(@canvas, xy, :fill=>color)
xy = [255, 206, 265, 234] # Fan blades
- TkcOval.new(@canvas, xy, :fill=>'', :outline=>@C['fg'],
+ 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'],
+ 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'],
+ 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'],
+ TkcOval.new(@canvas, xy, :fill=>'', :outline=>@C['fg'],
:width=>1, :tag=>'I9_1')
end
@@ -958,17 +958,17 @@ class TkGoldberg_Demo
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'],
+ 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,
+ 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,
+ 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,
+ 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,
+ TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>3, :style=>:arc,
:start=>120, :extent=>120, :tag=>'I10')
xy = [200, 171, 200, 249] # Mast
@@ -988,10 +988,10 @@ class TkGoldberg_Demo
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,
+ 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,
+ TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>3, :style=>:arc,
:extent=>190)
end
@@ -999,9 +999,9 @@ class TkGoldberg_Demo
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],
+ [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]
]
@@ -1028,21 +1028,21 @@ class TkGoldberg_Demo
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,
+ 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=>'',
+ 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,
+ 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=>'',
+ TkcOval.new(@canvas, xy, :fill=>color2, :outline=>'',
:width=>3, :tag=>'I11')
end
@@ -1050,8 +1050,8 @@ class TkGoldberg_Demo
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],
+ [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]
]
@@ -1065,11 +1065,11 @@ class TkGoldberg_Demo
# Hand
def draw12
xy = [
- 20, 637, 20, 617, 20, 610, 20, 590, 40, 590, 40, 590,
+ 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,
+ 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
@@ -1079,7 +1079,7 @@ class TkGoldberg_Demo
x2 = x - 10
xy << x << y0 << x1 << y1 << x2 << y0
}
- TkcPolygon.new(@canvas, xy, :fill=>@C['12'], :outline=>@C['fg'],
+ TkcPolygon.new(@canvas, xy, :fill=>@C['12'], :outline=>@C['fg'],
:smooth=>true, :tag=>'I12', :width=>3)
end
@@ -1103,25 +1103,25 @@ class TkGoldberg_Demo
]
radii = [2, 9, 9, 8, 5, 5, 2]
- round_poly(@canvas, xy, radii, :width=>3,
+ round_poly(@canvas, xy, radii, :width=>3,
:outline=>@C['fg'], :fill=>color)
- round_poly(@canvas, xy2, radii, :width=>3,
+ 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'],
+ 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'],
+ 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'],
+ 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'],
+ TkcText.new(@canvas, xy, :text=>'FAX', :fill=>@C['fg'],
:font=>['Times Roman', 12, :bold])
xy = [138, 663, 148, 636, 178, 636] # Paper guide
@@ -1129,7 +1129,7 @@ class TkGoldberg_Demo
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,
+ sine([149, 688, 720, 688], 5, 15,
:tag=>'I13_s', :fill=>@C['fg'], :width=>3)
end
@@ -1159,17 +1159,17 @@ class TkGoldberg_Demo
def draw14
color = @C['14']
xy = [102, 661, 113, 632, 130, 618] # Left paper edge
- TkcLine.new(@canvas, xy, :smooth=>true, :fill=>color,
+ 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,
+ 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,
+ 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
@@ -1177,7 +1177,7 @@ class TkGoldberg_Demo
xy = [
745.947897349, 662.428358855, 745.997829056, 662.452239237, 746.0, 662.5
]
- TkcLine.new(@canvas, xy, :smooth=>true, :fill=>color,
+ TkcLine.new(@canvas, xy, :smooth=>true, :fill=>color,
:width=>3, :tag=>'I14R_1')
@canvas.lower('I14R_1')
end
@@ -1190,11 +1190,11 @@ class TkGoldberg_Demo
x3, y3, x4, y4, x5, y5 = xy2
zz = [
- x0, y0, x0, y0, xy, x2, y2, x2, y2,
+ 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,
+ TkcPolygon.new(@canvas, zz, :tag=>"I14#{side}", :smooth=>true,
:fill=>color, :outline=>color, :width=>3)
@canvas.lower("I14#{side}")
end
@@ -1247,7 +1247,7 @@ class TkGoldberg_Demo
xy = [765, 557, 784, 583]
TkcRectangle.new(@canvas, xy, :fill=>color, :outline=>@C['fg'], :width=>2)
- sine([658, 580, 765, 580], 3, 15,
+ sine([658, 580, 765, 580], 3, 15,
:tag=>'I15_s', :fill=>@C['fg'], :width=>3)
end
@@ -1286,7 +1286,7 @@ class TkGoldberg_Demo
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',
+ 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')
@@ -1325,24 +1325,24 @@ class TkGoldberg_Demo
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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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_')
@@ -1352,23 +1352,23 @@ class TkGoldberg_Demo
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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>2,
:smooth=>true, :tag=>'I17')
end
@@ -1381,10 +1381,10 @@ class TkGoldberg_Demo
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=>'',
+ 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=>'',
+ TkcOval.new(@canvas, xy, :outline=>@C['fg'], :width=>3, :fill=>'',
:tag=>'I17_')
@canvas.move('I17_', 0, -20) # Move face up
@@ -1394,19 +1394,19 @@ class TkGoldberg_Demo
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,
+ 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,
+ 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,
+ TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>3,
:smooth=>true, :tag=>'I17_')
@canvas.raise('I17w') # Make whiskers visible
@@ -1435,14 +1435,14 @@ class TkGoldberg_Demo
step = get_step(18, step)
pos = [
- [587, 506], [537, 506], [466, 506], [376, 506], [266, 506, :x],
+ [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,
+ 491, 503, 524, 557, 563, 505, 559, 496, 546, 506, 551, 525,
553, 536, 538, 534, 532, 519, 529, 499
]
b[2] = [
@@ -1473,54 +1473,54 @@ class TkGoldberg_Demo
color = @C['19']
xx = [[249, 181], [155, 118], [86, 55], [22, 0]]
xx.each{|x1, x2|
- TkcRectangle.new(@canvas, x1, 453, x2, 467,
+ TkcRectangle.new(@canvas, x1, 453, x2, 467,
:fill=>color, :outline=>'', :tag=>'I19')
- TkcLine.new(@canvas, x1, 453, x2, 453,
+ TkcLine.new(@canvas, x1, 453, x2, 453,
:fill=>@C['fg'], :width=>1) # Pipe top
- TkcLine.new(@canvas, x1, 467, x2, 467,
+ 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,
+ 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,
+ 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,
+ TkcArc.new(@canvas, xy, :outline=>'', :fill=>color, :width=>1,
:style=>:pie, :start=>0, :extent=>-91)
- TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>1,
+ 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,
+ 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,
+ 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,
+ TkcArc.new(@canvas, xy, :outline=>'', :fill=>color, :width=>1,
:style=>:pie, :start=>0, :extent=>91)
- TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>1,
+ 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,
+ 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,
+ 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,
+ TkcArc.new(@canvas, xy, :outline=>'', :fill=>color, :width=>1,
:style=>:pie, :start=>90, :extent=>90)
- TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>1,
+ 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,
+ 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,
+ TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>1,
:style=>:arc, :start=>90, :extent=>90)
xy = [270, 427, 296, 433] # 2nd joint bottom
@@ -1562,7 +1562,7 @@ class TkGoldberg_Demo
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],
+ [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
@@ -1579,11 +1579,11 @@ class TkGoldberg_Demo
color = @C['20']
@canvas.delete('I20')
- sine([208, 428, 208, y], 4, f, :tag=>['I20', 'I20s'],
+ sine([208, 428, 208, y], 4, f, :tag=>['I20', 'I20s'],
:width=>3, :fill=>color, :smooth=>true)
- TkcLine.new(@canvas, @canvas.coords('I20s'), :width=>3,
+ TkcLine.new(@canvas, @canvas.coords('I20s'), :width=>3,
:fill=>color, :smooth=>1, :tag=>['I20', 'I20a'])
- TkcLine.new(@canvas, @canvas.coords('I20s'), :width=>3,
+ 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)
@@ -1599,18 +1599,18 @@ class TkGoldberg_Demo
xy = [245, 490, 237, 535] # Right side
xy2 = [189, 535, 181, 490] # Left side
- TkcPolygon.new(@canvas, xy + xy2, :fill=>color, :outline=>'',
+ 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,
+ TkcOval.new(@canvas, xy, :fill=>color, :outline=>'', :width=>2,
:tag=>['I21', 'I21f'])
- TkcOval.new(@canvas, xy, :fill=>'', :outline=>@C['fg'], :width=>2,
+ 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,
+ TkcOval.new(@canvas, xy, :fill=>color, :outline=>@C['fg'], :width=>2,
:tag=>['I21', 'I21b'])
end
@@ -1633,7 +1633,7 @@ class TkGoldberg_Demo
@canvas.itemconfigure('I21b', :fill=>@C['20'])
@canvas.delete('I21w')
- TkcPolygon.new(@canvas, x2, y2, x1, y1, xx1, yy1, xx2, yy1,
+ 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')
@@ -1669,21 +1669,21 @@ class TkGoldberg_Demo
color3 = @C['23c']
xy = [185, 623, 253, 650] # Block
- TkcRectangle.new(@canvas, xy, :fill=>'black', :outline=>@C['fg'],
+ 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',
+ 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'],
+ 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'],
+ 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')
@@ -1695,7 +1695,7 @@ class TkGoldberg_Demo
step = get_step(23, step)
pos = [
- [277, 607], [287, 607], [307, 607, :x], [347, 607], [407, 607],
+ [277, 607], [287, 607], [307, 607, :x], [347, 607], [407, 607],
[487, 607], [587, 607], [687, 607], [787, 607], [-100, -100]
]
@@ -1715,7 +1715,7 @@ class TkGoldberg_Demo
def draw24
color = @C['24a']
xy = [366, 518, 462, 665] # Balloon
- TkcOval.new(@canvas, xy, :fill=>color, :outline=>@C['fg'],
+ 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')
@@ -1724,16 +1724,16 @@ class TkGoldberg_Demo
:width=>3, :tag=>'I24')
xy = [387, 567, 390, 549, 404, 542] # Reflections
- TkcLine.new(@canvas, xy, :fill=>@C['fg'], :smooth=>true,
+ 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,
+ 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,
+ 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,
+ TkcLine.new(@canvas, xy, :fill=>@C['fg'], :smooth=>true,
:width=>2, :tag=>'I24')
end
@@ -1746,16 +1746,16 @@ class TkGoldberg_Demo
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,
+ 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'],
+ 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'],
+ TkcText.new(@canvas, centroid('I24'), :text=>msg, :tag=>['I24', 'I24t'],
:justify=>:center, :font=>['Times Roman', 18, :bold])
return 1
end
@@ -1786,8 +1786,8 @@ class TkGoldberg_Demo
if step >= 3
@canvas.delete('I24', 'I26')
- TkcText.new(@canvas, 430, 740, :anchor=>:s, :tag=>'I26',
- :text=>'click to continue',
+ 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
@@ -1967,11 +1967,11 @@ class TkGoldberg_Demo
def sparkle(oxy, tag)
xy = [
- [299, 283], [298, 302], [295, 314], [271, 331],
+ [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,
+ TkcLine.new(@canvas, 271, 304, x, y,
:fill=>'white', :width=>3, :tag=>tag)
}
move_abs(tag, oxy)
diff --git a/ext/tk/sample/demos-en/icon.rb b/ext/tk/sample/demos-en/icon.rb
index bab40da214..a3921d2333 100644
--- a/ext/tk/sample/demos-en/icon.rb
+++ b/ext/tk/sample/demos-en/icon.rb
@@ -8,7 +8,7 @@
# toplevel widget
if defined?($icon_demo) && $icon_demo
- $icon_demo.destroy
+ $icon_demo.destroy
$icon_demo = nil
end
@@ -48,7 +48,7 @@ TkFrame.new(base_frame) {|frame|
}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
-# image
+# image
flagup = \
TkBitmapImage.new('file'=>[$demo_dir,'..',
'images','flagup.xbm'].join(File::Separator),
diff --git a/ext/tk/sample/demos-en/image1.rb b/ext/tk/sample/demos-en/image1.rb
index 233cb963d1..a9072bb308 100644
--- a/ext/tk/sample/demos-en/image1.rb
+++ b/ext/tk/sample/demos-en/image1.rb
@@ -7,7 +7,7 @@
# toplevel widget
if defined?($image1_demo) && $image1_demo
- $image1_demo.destroy
+ $image1_demo.destroy
$image1_demo = nil
end
diff --git a/ext/tk/sample/demos-en/image2.rb b/ext/tk/sample/demos-en/image2.rb
index 13098af1b6..1975dd6b02 100644
--- a/ext/tk/sample/demos-en/image2.rb
+++ b/ext/tk/sample/demos-en/image2.rb
@@ -8,7 +8,7 @@
# toplevel widget
if defined?($image2_demo) && $image2_demo
- $image2_demo.destroy
+ $image2_demo.destroy
$image2_demo = nil
end
@@ -87,13 +87,13 @@ TkFrame.new(base_frame){|w|
}.pack('side'=>'top', 'anchor'=>'w')
-# image
+# image
[ TkFrame.new(base_frame, 'height'=>'3m', 'width'=>20),
TkLabel.new(base_frame, 'text'=>'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|
diff --git a/ext/tk/sample/demos-en/image3.rb b/ext/tk/sample/demos-en/image3.rb
index edb6d231bf..43afab7ecd 100644
--- a/ext/tk/sample/demos-en/image3.rb
+++ b/ext/tk/sample/demos-en/image3.rb
@@ -8,7 +8,7 @@
# toplevel widget
if defined?($image3_demo) && $image3_demo
- $image3_demo.destroy
+ $image3_demo.destroy
$image3_demo = nil
end
@@ -21,7 +21,7 @@ $image3_demo = TkToplevel.new {|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|
@@ -37,10 +37,10 @@ end
# Arguments:
# w - Name of the toplevel window of the demo.
def selectAndLoadDir3(w, lbox)
- dir = Tk.chooseDirectory(:initialdir=>$dirName.value,
+ dir = Tk.chooseDirectory(:initialdir=>$dirName.value,
:parent=>w, :mustexist=>true)
if dir.length > 0
- $dirName.value = dir
+ $dirName.value = dir
loadDir3(lbox)
end
end
@@ -92,11 +92,11 @@ 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:',
+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,
+ 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')
@@ -107,7 +107,7 @@ image3_ent = TkEntry.new(image3_df, :width=>30, :textvariable=>$dirName){
bind('Return', proc{loadDir3(image3_lbx)})
}
-TkButton.new(image3_df, :pady=>0, :padx=>'2m', :text=>"Select Dir.",
+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')
}
@@ -119,7 +119,7 @@ image3_if = TkLabelFrame.new(base_frame, :text=>'Image:') {|f|
Tk.grid(image3_df, '-',
:sticky=>:ew, :padx=>'1m', :pady=>'1m', :in=>image3_f)
-Tk.grid(image3_ff, image3_if,
+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
index 01a4072cb7..3fd44fd4f4 100644
--- a/ext/tk/sample/demos-en/items.rb
+++ b/ext/tk/sample/demos-en/items.rb
@@ -8,7 +8,7 @@
# toplevel widget
if defined?($items_demo) && $items_demo
- $items_demo.destroy
+ $items_demo.destroy
$items_demo = nil
end
@@ -49,7 +49,7 @@ TkFrame.new(base_frame) {|frame|
# frame
cvs = nil
TkFrame.new(base_frame) {|cf|
- # canvas
+ # canvas
cvs = TkCanvas.new(cf) {|c|
focus
scrollregion '0c 0c 30c 24c'
@@ -75,11 +75,11 @@ TkFrame.new(base_frame) {|cf|
c.pack('in'=>cf, 'expand'=>'yes', 'fill'=>'both')
else
- c.grid('in'=>cf, 'row'=>0, 'column'=>0,
+ c.grid('in'=>cf, 'row'=>0, 'column'=>0,
'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news')
- vs.grid('row'=>0, 'column'=>1,
+ vs.grid('row'=>0, 'column'=>1,
'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news')
- hs.grid('row'=>1, 'column'=>0,
+ 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)
@@ -115,13 +115,13 @@ else
green = 'black'
end
-# tag
+# tag
$tag_item = TkcGroup.new(cvs)
# Set up demos within each of the areas of the grid.
TkcText.new(cvs, '5c', '.2c', 'text'=>'Lines', 'anchor'=>'n')
-TkcLine.new(cvs, '1c', '1c', '3c', '1c', '1c', '4c', '3c', '4c',
- 'width'=>2, 'fill'=>blue, 'capstyle'=>'butt',
+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)
@@ -129,38 +129,38 @@ 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',
+TkcLine.new(cvs, '1c','5c','7c','5c','7c','7c','9c','7c', 'width'=>'.5c',
'stipple'=>'@'+[$demo_dir,'..',
- 'images','gray25.xbm'].join(File::Separator),
+ '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',
+ 'width'=>'.5c', 'capstyle'=>'round', 'join'=>'round',
'tags'=>$tag_item )
-TkcText.new(cvs, '15c', '.2c',
+TkcText.new(cvs, '15c', '.2c',
'text'=>'Curves (smoothed lines)', 'anchor'=>'n')
-TkcLine.new(cvs, '11c','4c','11.5c','1c','13.5c','1c','14c','4c',
+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',
+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',
+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',
+ 'smooth'=>'on', 'width'=>'3m', 'capstyle'=>'round',
'stipple'=>'@'+[$demo_dir, '..',
- 'images', 'gray25.xbm'].join(File::Separator),
+ '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,
+ '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',
+ '7.5c','22c','7.5c',
'stipple'=>'@' + [$demo_dir, '..',
'images', 'gray25.xbm'].join(File::Separator),
'outline'=>'black', 'tags'=>$tag_item )
@@ -168,7 +168,7 @@ TkcPolygon.new(cvs, '22c','4.5c','25c','4.5c','25c','6.75c','28c','6.75c',
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',
+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,'..',
@@ -178,7 +178,7 @@ TkcRectangle.new(cvs, '6c','10c','9c','15c', 'outline'=>'',
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',
+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,'..',
@@ -187,40 +187,40 @@ TkcOval.new(cvs, '16c','10c','19c','15c', 'outline'=>'',
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',
+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,
+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,
+ 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',
+ 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',
+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,
+#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,
+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,
+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,
+ 'fill'=>blue, 'outline'=>'', 'start'=>45, 'extent'=>270,
'tags'=>$tag_item)
TkcText.new(cvs, '15c', '16.2c', 'text'=>'Bitmaps', 'anchor'=>'n')
@@ -241,7 +241,7 @@ TkcBitmap.new(cvs, '17c','18.5c',
#TkcBitmap.new(cvs, '17c','21.5c',
# 'bitmap'=>'@' + ['images', 'letters'].join(File::Separator),
# 'tags'=>$tag_item)
-#
+#
TkcBitmap.new(cvs, '17c','21.5c') {
bitmap '@' + [$demo_dir, '..', 'images', 'letters.xbm'].join(File::Separator)
tags $tag_item
@@ -255,17 +255,17 @@ 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',
+ 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',
+ TkcWindow.new(cvs, '21c','21c',
'window'=>e, 'anchor'=>'nw', 'tags'=>$tag_item)
}
-TkScale.new(cvs, 'from'=>0, 'to'=>100, 'length'=>'6c', 'sliderlength'=>'.4c',
+TkScale.new(cvs, 'from'=>0, 'to'=>100, 'length'=>'6c', 'sliderlength'=>'.4c',
'width'=>'.5c', 'tickinterval'=>0 ) {|scl|
- TkcWindow.new(cvs, '28.5c','17.5c',
+ TkcWindow.new(cvs, '28.5c','17.5c',
'window'=>scl, 'anchor'=>'n', 'tags'=>$tag_item)
}
TkcText.new(cvs, '21c', '17.9c', 'text'=>'Button:', 'anchor'=>'sw')
@@ -316,7 +316,7 @@ def itemLeave(c)
$restoreCmd.call if $restoreCmd
end
-# Utility methods for stroking out a rectangle and printing what's
+# Utility methods for stroking out a rectangle and printing what's
# underneath the rectangle's area.
def itemMark(c,x,y)
@@ -330,7 +330,7 @@ def itemStroke(c,x,y)
y = c.canvasy(y)
if $areaX1 != x && $areaY1 != y
c.delete 'area'
- c.addtag_withtag 'area', TkcRectangle.new(c, $areaX1, $areaY1, x, y,
+ c.addtag_withtag 'area', TkcRectangle.new(c, $areaX1, $areaY1, x, y,
'-outline', 'black')
$areaX2 = x
$areaY2 = y
@@ -371,11 +371,11 @@ def itemDrag(c,x,y)
$lastY = y
end
-# Method that's invoked when the button embedded in the canvas
+# Method that's invoked when the button embedded in the canvas
# is invoked.
def butPress(w,color)
- i = TkcText.new(w, '25c', '18.1c',
+ 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/knightstour.rb b/ext/tk/sample/demos-en/knightstour.rb
index 6f96a5be10..618fce5f02 100644
--- a/ext/tk/sample/demos-en/knightstour.rb
+++ b/ext/tk/sample/demos-en/knightstour.rb
@@ -155,16 +155,16 @@ class Knights_Tour
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,
+ 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
@@ -176,7 +176,7 @@ class Knights_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,
+ @log = Tk::Text.new(base_f, :width=>12, :height=>1,
:font=>'Arial 8', :background=>'white')
scr = @log.yscrollbar(Ttk::Scrollbar.new(base_f))
@@ -186,13 +186,13 @@ class Knights_Tour
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,
+ 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',
+ check = Ttk::Checkbutton.new(tool_f, :text=>'Repeat',
:variable=>@continuous)
- @start_btn = Ttk::Button.new(tool_f, :text=>'Start',
+ @start_btn = Ttk::Button.new(tool_f, :text=>'Start',
:command=>proc{tour()})
- @exit_btn = Ttk::Button.new(tool_f, :text=>'Exit',
+ @exit_btn = Ttk::Button.new(tool_f, :text=>'Exit',
:command=>proc{_exit()})
7.downto(0){|row|
@@ -205,16 +205,16 @@ class Knights_Tour
dfill = 'tan4'
end
coords = [col * 30 + 4, row * 30 + 4, col * 30 + 30, row * 30 + 30]
- @board.create(TkcRectangle, coords,
+ @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',
+ @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)}
diff --git a/ext/tk/sample/demos-en/label.rb b/ext/tk/sample/demos-en/label.rb
index 5be06eafee..91e41e4a22 100644
--- a/ext/tk/sample/demos-en/label.rb
+++ b/ext/tk/sample/demos-en/label.rb
@@ -8,11 +8,11 @@
# toplevel widget
if defined?($label_demo) && $label_demo
- $label_demo.destroy
+ $label_demo.destroy
$label_demo = nil
end
-# demo toplevel widget
+# demo toplevel widget
$label_demo = TkToplevel.new {|w|
title("Label Demonstration")
iconname("label")
@@ -21,7 +21,7 @@ $label_demo = TkToplevel.new {|w|
base_frame = TkFrame.new($label_demo).pack(:fill=>:both, :expand=>true)
-# label
+# label
msg = TkLabel.new(base_frame) {
font $font
wraplength '4i'
@@ -30,7 +30,7 @@ msg = TkLabel.new(base_frame) {
}
msg.pack('side'=>'top')
-# frame
+# frame
TkFrame.new(base_frame) {|frame|
TkButton.new(frame) {
text 'Dismiss'
@@ -48,15 +48,15 @@ TkFrame.new(base_frame) {|frame|
}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
-# label demo
+# label demo
f_left = TkFrame.new(base_frame)
f_right = TkFrame.new(base_frame)
-[f_left, f_right].each{|w| w.pack('side'=>'left', 'expand'=>'yes',
+[f_left, f_right].each{|w| w.pack('side'=>'left', 'expand'=>'yes',
'padx'=>10, 'pady'=>10, 'fill'=>'both')}
-# label
+# label
[ TkLabel.new(f_left, 'text'=>'First label'),
- TkLabel.new(f_left, 'text'=>'Second label, raised',
+ 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')}
diff --git a/ext/tk/sample/demos-en/labelframe.rb b/ext/tk/sample/demos-en/labelframe.rb
index ad968bc061..c912ff4c52 100644
--- a/ext/tk/sample/demos-en/labelframe.rb
+++ b/ext/tk/sample/demos-en/labelframe.rb
@@ -7,7 +7,7 @@
if defined?($labelframe_demo) && $labelframe_demo
- $labelframe_demo.destroy
+ $labelframe_demo.destroy
$labelframe_demo = nil
end
@@ -20,8 +20,8 @@ $labelframe_demo = TkToplevel.new {|w|
base_frame = TkFrame.new($labelframe_demo).pack(:fill=>:both, :expand=>true)
# Some information
-TkLabel.new(base_frame,
- :font=>$font, :wraplength=>'4i', :justify=>:left,
+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. \
@@ -45,17 +45,17 @@ TkFrame.new(base_frame){|f|
}
# Demo area
-w = TkFrame.new(base_frame).pack(:side=>:bottom, :fill=>:both,
+w = TkFrame.new(base_frame).pack(:side=>:bottom, :fill=>:both,
:expand=>true)
# A group of radiobuttons in a labelframe
-TkLabelFrame.new(w, :text=>'Value',
+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}",
+ TkRadiobutton.new(f, :text=>"This is value #{i}",
:variable=>v, :value=>i) {
pack(:side=>:top, :fill=>:x, :pady=>2)
}
@@ -78,7 +78,7 @@ def lfEnableButtons(w)
end
TkLabelFrame.new(w, :pady=>2, :padx=>2){|f|
- TkCheckButton.new(f, :widgetname=>'cb', :variable=>$lfdummy,
+ TkCheckButton.new(f, :widgetname=>'cb', :variable=>$lfdummy,
:text=>"Use this option.", :padx=>0) {|cb|
command proc{lfEnableButtons(f)}
f.labelwidget(cb)
diff --git a/ext/tk/sample/demos-en/mclist.rb b/ext/tk/sample/demos-en/mclist.rb
index 17019bb15b..a849eba515 100644
--- a/ext/tk/sample/demos-en/mclist.rb
+++ b/ext/tk/sample/demos-en/mclist.rb
@@ -6,7 +6,7 @@
# 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.destroy
$mclist_demo = nil
end
@@ -19,8 +19,8 @@ $mclist_demo = TkToplevel.new {|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],
+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, \
@@ -36,23 +36,23 @@ EOL
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,
+ 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),
+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))
@@ -70,20 +70,20 @@ 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'],
+ ['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'],
]
@@ -91,7 +91,7 @@ data = [
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,
+ tree.heading_configure(col, :text=>name,
:command=>proc{sort_by(tree, col, false)})
tree.column_configure(col, :width=>TkFont.measure(font, name))
}
@@ -109,8 +109,8 @@ data.each{|country, capital, currency|
## 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})) .
+ 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)})
diff --git a/ext/tk/sample/demos-en/menu.rb b/ext/tk/sample/demos-en/menu.rb
index a458dbbc14..bf6c22cb9d 100644
--- a/ext/tk/sample/demos-en/menu.rb
+++ b/ext/tk/sample/demos-en/menu.rb
@@ -4,7 +4,7 @@
# toplevel widget
if defined?($menu_demo) && $menu_demo
- $menu_demo.destroy
+ $menu_demo.destroy
$menu_demo = nil
end
@@ -54,7 +54,7 @@ TkFrame.new(base_frame) {|frame|
}.pack('side'=>'left', 'expand'=>'yes')
}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
-# menu
+# menu
TkMenubutton.new($menu_frame, 'text'=>'File', 'underline'=>0) {|m|
pack('side'=>'left')
TkMenu.new(m, 'tearoff'=>false) {|file_menu|
@@ -86,8 +86,8 @@ TkMenubutton.new($menu_frame, 'text'=>'Basic', 'underline'=>0) {|m|
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}",
+ 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"})
}
@@ -98,17 +98,17 @@ TkMenubutton.new($menu_frame, 'text'=>'Cascades', 'underline'=>0) {|m|
pack('side'=>'left')
TkMenu.new(m, 'tearoff'=>false) {|cascade_menu|
m.configure('menu'=>cascade_menu)
- add('command', 'label'=>'Print hello',
- 'command'=>proc{print "Hello\n"},
+ add('command', 'label'=>'Print hello',
+ 'command'=>proc{print "Hello\n"},
'accelerator'=>"#{modifier}+H", 'underline'=>6)
$menu_demo.bind("#{modifier}-h", proc{print "Hello\n"})
- add('command', 'label'=>'Print goodbye',
- 'command'=>proc{print "Goodbye\n"},
+ 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',
+ cascade_menu.add('cascade', 'label'=>'Check buttons',
'menu'=>cascade_check, 'underline'=>0)
oil = TkVariable.new(0)
add('check', 'label'=>'Oil checked', 'variable'=>oil)
@@ -119,18 +119,18 @@ TkMenubutton.new($menu_frame, 'text'=>'Cascades', 'underline'=>0) {|m|
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],
+ 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',
+ cascade_menu.add('cascade', 'label'=>'Radio buttons',
'menu'=>cascade_radio, 'underline'=>0)
pointSize = TkVariable.new
add('radio', 'label'=>'10 point', 'variable'=>pointSize, 'value'=>10)
@@ -144,9 +144,9 @@ TkMenubutton.new($menu_frame, 'text'=>'Cascades', 'underline'=>0) {|m|
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],
+ add('command', 'label'=>'Show current values',
+ 'command'=>proc{showVars($menu_demo,
+ ['pointSize', pointSize],
['style', style])} )
invoke 1
invoke 7
@@ -158,15 +158,15 @@ 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',
+ add('command',
'bitmap'=>'@'+[$demo_dir,'..',
'images','pattern.xbm'].join(File::Separator),
- 'command'=>proc{TkDialog.new('title'=>'Bitmap Menu Entry',
+ '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,
+ 'bitmap'=>'', 'default'=>0,
'buttons'=>'Dismiss')} )
['info', 'questhead', 'error'].each{|icon|
- add('command', 'bitmap'=>icon,
+ add('command', 'bitmap'=>icon,
'command'=>proc{print "You invoked the #{icon} bitmap\n"})
}
}
@@ -178,7 +178,7 @@ TkMenubutton.new($menu_frame, 'text'=>'More', 'underline'=>0) {|m|
m.configure('menu'=>more_menu)
[ 'An entry','Another entry','Does nothing','Does almost nothing',
'Make life meaningful' ].each{|i|
- add('command', 'label'=>i,
+ add('command', 'label'=>i,
'command'=>proc{print "You invoked \"#{i}\"\n"})
}
}
@@ -189,7 +189,7 @@ TkMenubutton.new($menu_frame, 'text'=>'Colors', 'underline'=>0) {|m|
TkMenu.new(m) {|colors_menu|
m.configure('menu'=>colors_menu)
['red', 'orange', 'yellow', 'green', 'blue'].each{|c|
- add('command', 'label'=>c, 'background'=>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
index 4fc53962e7..4029ce5541 100644
--- a/ext/tk/sample/demos-en/menu84.rb
+++ b/ext/tk/sample/demos-en/menu84.rb
@@ -4,7 +4,7 @@
# toplevel widget
if defined?($menu84_demo) && $menu84_demo
- $menu84_demo.destroy
+ $menu84_demo.destroy
$menu84_demo = nil
end
@@ -36,9 +36,9 @@ TkLabel.new(base_frame,'font'=>$font,'wraplength'=>'4i','justify'=>'left') {
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,
+ 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)
}
@@ -92,8 +92,8 @@ 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}",
+ 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"})
}
@@ -101,17 +101,17 @@ TkMenu.new($menu84_frame, 'tearoff'=>false) {|m|
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"},
+ 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"},
+ 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',
+ m.add('cascade', 'label'=>'Check buttons',
'menu'=>cascade_check, 'underline'=>0)
oil = TkVariable.new(0)
add('check', 'label'=>'Oil checked', 'variable'=>oil)
@@ -122,18 +122,18 @@ TkMenu.new($menu84_frame, 'tearoff'=>false) {|m|
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],
+ 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',
+ m.add('cascade', 'label'=>'Radio buttons',
'menu'=>cascade_radio, 'underline'=>0)
pointSize = TkVariable.new
add('radio', 'label'=>'10 point', 'variable'=>pointSize, 'value'=>10)
@@ -147,9 +147,9 @@ TkMenu.new($menu84_frame, 'tearoff'=>false) {|m|
add('radio', 'label'=>'Bold', 'variable'=>style, 'value'=>'bold')
add('radio', 'label'=>'Italic', 'variable'=>style, 'value'=>'italic')
add('separator')
- add('command', 'label'=>'Show current values',
- 'command'=>proc{showVars($menu84_demo,
- ['pointSize', pointSize],
+ add('command', 'label'=>'Show current values',
+ 'command'=>proc{showVars($menu84_demo,
+ ['pointSize', pointSize],
['style', style])} )
invoke 1
invoke 7
@@ -158,15 +158,15 @@ TkMenu.new($menu84_frame, 'tearoff'=>false) {|m|
TkMenu.new($menu84_frame, 'tearoff'=>false) {|m|
$menu84_frame.add('cascade', 'label'=>'Icons', 'menu'=>m, 'underline'=>0)
- add('command', 'hidemargin'=>1,
+ add('command', 'hidemargin'=>1,
'bitmap'=>'@'+[$demo_dir,'..',
'images','pattern.xbm'].join(File::Separator),
- 'command'=>proc{TkDialog.new('title'=>'Bitmap Menu Entry',
+ '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,
+ 'bitmap'=>'', 'default'=>0,
'buttons'=>'Dismiss')} )
['info', 'questhead', 'error'].each{|icon|
- add('command', 'bitmap'=>icon, 'hidemargin'=>1,
+ add('command', 'bitmap'=>icon, 'hidemargin'=>1,
'command'=>proc{print "You invoked the #{icon} bitmap\n"})
}
@@ -177,19 +177,19 @@ 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,
+ add('command', 'label'=>i,
'command'=>proc{print "You invoked \"#{i}\"\n"})
}
- m.entryconfigure('Does almost nothing',
- 'bitmap'=>'questhead', 'compound'=>'left',
+ m.entryconfigure('Does almost nothing',
+ 'bitmap'=>'questhead', 'compound'=>'left',
'command'=>proc{
- TkDialog.new('title'=>'Compound Menu Entry',
+ 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.',
+ 'other menu entry.',
'buttons'=>['OK'], 'bitmap'=>'')
})
}
@@ -197,7 +197,7 @@ TkMenu.new($menu84_frame, 'tearoff'=>false) {|m|
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,
+ add('command', 'label'=>c, 'background'=>c,
'command'=>proc{print "You invoked \"#{c}\"\n"})
}
}
diff --git a/ext/tk/sample/demos-en/menubu.rb b/ext/tk/sample/demos-en/menubu.rb
index 6e28e813b3..b37367e515 100644
--- a/ext/tk/sample/demos-en/menubu.rb
+++ b/ext/tk/sample/demos-en/menubu.rb
@@ -21,7 +21,7 @@ def optionMenu(menubutton, varName, firstValue, *rest)
for i in rest
menu.add 'radio', 'label'=>i, 'variable'=>varName
end
-
+
return menu
end
@@ -188,7 +188,7 @@ msg.pack('side'=>'top', 'padx'=>25, 'pady'=>25)
TkFrame.new(center) {|f|
menubuttonoptions = TkVariable.new
mbutton = TkMenubutton.new(f)
- options = optionMenu(mbutton, menubuttonoptions,
+ options = optionMenu(mbutton, menubuttonoptions,
'one', 'two', 'three')
mbutton.pack('side'=>'left', 'padx'=>25, 'pady'=>25)
paletteColor = TkVariable.new
diff --git a/ext/tk/sample/demos-en/msgbox.rb b/ext/tk/sample/demos-en/msgbox.rb
index d3d66bfeb0..62b1f2b985 100644
--- a/ext/tk/sample/demos-en/msgbox.rb
+++ b/ext/tk/sample/demos-en/msgbox.rb
@@ -7,7 +7,7 @@
# toplevel widget
if defined?($msgbox_demo) && $msgbox_demo
- $msgbox_demo.destroy
+ $msgbox_demo.destroy
$msgbox_demo = nil
end
@@ -49,9 +49,9 @@ TkFrame.new(base_frame) {|frame|
# frame
$msgbox_leftframe = TkFrame.new(base_frame)
$msgbox_rightframe = TkFrame.new(base_frame)
-$msgbox_leftframe .pack('side'=>'left', 'expand'=>'yes', 'fill'=>'y',
+$msgbox_leftframe .pack('side'=>'left', 'expand'=>'yes', 'fill'=>'y',
'pady'=>'.5c', 'padx'=>'.5c')
-$msgbox_rightframe.pack('side'=>'left', 'expand'=>'yes', 'fill'=>'y',
+$msgbox_rightframe.pack('side'=>'left', 'expand'=>'yes', 'fill'=>'y',
'pady'=>'.5c', 'padx'=>'.5c')
TkLabel.new($msgbox_leftframe, 'text'=>'Icon').pack('side'=>'top')
@@ -60,9 +60,9 @@ TkFrame.new($msgbox_leftframe, 'relief'=>'ridge', 'bd'=>1, 'height'=>2)\
$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,
+ 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')
}
@@ -71,20 +71,20 @@ TkFrame.new($msgbox_rightframe, 'relief'=>'ridge', 'bd'=>1, 'height'=>2)\
.pack('side'=>'top', 'fill'=>'x', 'expand'=>'no')
$msgboxType = TkVariable.new('ok')
-['abortretryignore', 'ok', 'okcancel',
+['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,
+ 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,
+ 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,
+ 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
index c227b59bb1..6fe6c778b3 100644
--- a/ext/tk/sample/demos-en/msgbox2.rb
+++ b/ext/tk/sample/demos-en/msgbox2.rb
@@ -7,7 +7,7 @@
# toplevel widget
if defined?($msgbox2_demo) && $msgbox2_demo
- $msgbox2_demo.destroy
+ $msgbox2_demo.destroy
$msgbox2_demo = nil
end
@@ -42,16 +42,16 @@ TkFrame.new(base_frame) {|frame|
TkButton.new(frame) {
text 'Message Box'
- command proc{showMessageBox2 $msgbox2_demo}
+ command proc{showMessageBox $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',
+$msgbox_leftframe .pack('side'=>'left', 'expand'=>'yes', 'fill'=>'y',
'pady'=>'.5c', 'padx'=>'.5c')
-$msgbox_rightframe.pack('side'=>'left', 'expand'=>'yes', 'fill'=>'y',
+$msgbox_rightframe.pack('side'=>'left', 'expand'=>'yes', 'fill'=>'y',
'pady'=>'.5c', 'padx'=>'.5c')
TkLabel.new($msgbox_leftframe, 'text'=>'Icon').pack('side'=>'top')
@@ -60,9 +60,9 @@ TkFrame.new($msgbox_leftframe, 'relief'=>'ridge', 'bd'=>1, 'height'=>2)\
$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,
+ 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')
}
@@ -71,21 +71,21 @@ TkFrame.new($msgbox_rightframe, 'relief'=>'ridge', 'bd'=>1, 'height'=>2)\
.pack('side'=>'top', 'fill'=>'x', 'expand'=>'no')
$msgboxType = TkVariable.new('ok')
-['abortretryignore', 'ok', 'okcancel',
+['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,
+ 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,
+def showMessageBox(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,
+ 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
index d3d66d1b16..26941b84a8 100644
--- a/ext/tk/sample/demos-en/paned1.rb
+++ b/ext/tk/sample/demos-en/paned1.rb
@@ -6,7 +6,7 @@
# 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.destroy
$paned1_demo = nil
end
@@ -18,8 +18,8 @@ $paned1_demo = TkToplevel.new {|w|
base_frame = TkFrame.new($paned1_demo).pack(:fill=>:both, :expand=>true)
-TkLabel.new(base_frame,
- :font=>$font, :wraplength=>'4i', :justify=>:left,
+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'.
@@ -40,7 +40,7 @@ TkFrame.new(base_frame){|f|
}
TkPanedwindow.new(base_frame, :orient=>:horizontal){|f|
- add(Tk::Label.new(f, :text=>"This is the\nleft side", :bg=>'yellow'),
+ 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
index 02293b0309..0e62013886 100644
--- a/ext/tk/sample/demos-en/paned2.rb
+++ b/ext/tk/sample/demos-en/paned2.rb
@@ -6,7 +6,7 @@
# 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.destroy
$paned2_demo = nil
end
@@ -18,8 +18,8 @@ $paned2_demo = TkToplevel.new {|w|
base_frame = TkFrame.new($paned2_demo).pack(:fill=>:both, :expand=>true)
-TkLabel.new(base_frame,
- :font=>$font, :wraplength=>'4i', :justify=>:left,
+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'.
@@ -42,23 +42,23 @@ TkFrame.new(base_frame){|f|
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',
+ 'TkButton',
+ 'TkCanvas',
+ 'TkCheckbutton',
+ 'TkEntry',
+ 'TkFrame',
+ 'TkLabel',
+ 'TkLabelframe',
+ 'TkListbox',
+ 'TkMenu',
+ 'TkMenubutton',
+ 'TkMessage',
+ 'TkPanedwindow',
+ 'TkRadiobutton',
+ 'TkScale',
+ 'TkScrollbar',
+ 'TkSpinbox',
+ 'TkText',
'TkToplevel'
]
@@ -69,13 +69,13 @@ TkPanedwindow.new(base_frame, :orient=>:vertical){|f|
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),
+ itemconfigure(0, :background=>self.cget(:foreground),
:foreground=>self.cget(:background) )
- yscrollbar(TkScrollbar.new(paned2_top).pack(:side=>:right,
+ 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
diff --git a/ext/tk/sample/demos-en/pendulum.rb b/ext/tk/sample/demos-en/pendulum.rb
index 306ac94a21..5f7d361170 100644
--- a/ext/tk/sample/demos-en/pendulum.rb
+++ b/ext/tk/sample/demos-en/pendulum.rb
@@ -7,7 +7,7 @@
# destroy toplevel widget for this demo script
if defined?($pendulum_demo) && $pendulum_demo
- $pendulum_demo.destroy
+ $pendulum_demo.destroy
$pendulum_demo = nil
end
@@ -59,14 +59,14 @@ class PendulumAnimationDemo
# Create the canvas containing the graphical representation of the
# simulated system.
- @c = TkCanvas.new(@lf1, :width=>320, :height=>200, :background=>'white',
+ @c = TkCanvas.new(@lf1, :width=>320, :height=>200, :background=>'white',
:borderwidth=>2, :relief=>:sunken)
- TkcText.new(@c, 5, 5, :anchor=>:nw,
+ 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,
+ @bob = TkcOval.new(@c, 1, 1, 2, 2,
:width=>3, :fill=>'yellow', :outline=>'black')
TkcOval.new(@c, 155, 20, 165, 30, :fill=>'grey50', :outline=>'')
@@ -76,22 +76,22 @@ class PendulumAnimationDemo
# 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',
+ @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;
+ # 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,
+ @label_theta = TkcText.new(@k, 0, 0, :anchor=>:ne,
:text=>'q', :font=>'Symbol 8')
- @label_dtheta = TkcText.new(@k, 0, 0, :anchor=>:ne,
+ @label_dtheta = TkcText.new(@k, 0, 0, :anchor=>:ne,
:text=>'dq', :font=>'Symbol 8')
# pack
@@ -109,19 +109,19 @@ class PendulumAnimationDemo
# 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)},
+ 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 },
+ 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|
+ @k.bind('Configure', proc{|h, w|
h = h.to_i
w = w.to_i
- @psh = h/2;
+ @psh = h/2;
@psw = w/2
@x_axis.coords(2, @psh, w-2, @psh)
@y_axis.coords(@psw, h-2, @psw, 2)
@@ -142,9 +142,9 @@ class PendulumAnimationDemo
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
+ # 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)
diff --git a/ext/tk/sample/demos-en/plot.rb b/ext/tk/sample/demos-en/plot.rb
index f70daa3fb2..628c9df584 100644
--- a/ext/tk/sample/demos-en/plot.rb
+++ b/ext/tk/sample/demos-en/plot.rb
@@ -8,7 +8,7 @@
# toplevel widget
if defined?($plot_demo) && $plot_demo
- $plot_demo.destroy
+ $plot_demo.destroy
$plot_demo = nil
end
@@ -22,7 +22,7 @@ $plot_demo = TkToplevel.new {|w|
base_frame = TkFrame.new($plot_demo).pack(:fill=>:both, :expand=>true)
# label
-TkLabel.new(base_frame, 'font'=>$font, 'wraplength'=>'4i', 'justify'=>'left',
+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')
}
@@ -45,55 +45,55 @@ $plot_buttons = TkFrame.new(base_frame) {|frame|
}
$plot_buttons.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
-# font
+# font
plotFont = '-*-Helvetica-Medium-R-Normal--*-180-*-*-*-*-*-*'
-# canvas
+# canvas
$plot_canvas = TkCanvas.new(base_frame,'relief'=>'raised','width'=>450,'height'=>300)
$plot_canvas.pack('side'=>'top', 'fill'=>'x')
-# plot
+# plot
TkcLine.new($plot_canvas, 100, 250, 400, 250, 'width'=>2)
TkcLine.new($plot_canvas, 100, 250, 100, 50, 'width'=>2)
-TkcText.new($plot_canvas, 225, 20,
+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,
+ 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,
+ 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,
+ 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',
+$plot_canvas.itembind('point', 'Any-Enter',
proc{$plot_canvas.itemconfigure 'current','fill','red'})
-$plot_canvas.itembind('point', 'Any-Leave',
+$plot_canvas.itembind('point', 'Any-Leave',
proc{$plot_canvas.itemconfigure 'current','fill','SkyBlue2'})
-$plot_canvas.itembind('point', '1',
+$plot_canvas.itembind('point', '1',
proc{|x,y| plotDown $plot_canvas,x,y}, "%x %y")
-$plot_canvas.itembind('point', 'ButtonRelease-1',
+$plot_canvas.itembind('point', 'ButtonRelease-1',
proc{$plot_canvas.dtag 'selected'})
-$plot_canvas.bind('B1-Motion',
+$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
+# 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:
diff --git a/ext/tk/sample/demos-en/puzzle.rb b/ext/tk/sample/demos-en/puzzle.rb
index f16414aa4c..43c61f519f 100644
--- a/ext/tk/sample/demos-en/puzzle.rb
+++ b/ext/tk/sample/demos-en/puzzle.rb
@@ -8,7 +8,7 @@
# toplevel widget
if defined?($puzzle_demo) && $puzzle_demo
- $puzzle_demo.destroy
+ $puzzle_demo.destroy
$puzzle_demo = nil
end
@@ -70,7 +70,7 @@ end
# depend_on_button_width = true
depend_on_button_width = false
-
+
s = TkScrollbar.new(base_frame)
base = TkFrame.new(base_frame) {
width frameWidth
@@ -101,7 +101,7 @@ order = [3,1,6,2,5,7,15,13,4,11,8,9,14,10,12]
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],
+ }.place('relx'=>$xpos[num], 'rely'=>$ypos[num],
'relwidth'=>0.25, 'relheight'=>0.25)
}
$xpos['space'] = 0.75
diff --git a/ext/tk/sample/demos-en/radio.rb b/ext/tk/sample/demos-en/radio.rb
index bde31508e1..25cfac2134 100644
--- a/ext/tk/sample/demos-en/radio.rb
+++ b/ext/tk/sample/demos-en/radio.rb
@@ -8,7 +8,7 @@
# toplevel widget
if defined?($radio_demo) && $radio_demo
- $radio_demo.destroy
+ $radio_demo.destroy
$radio_demo = nil
end
@@ -21,7 +21,7 @@ $radio_demo = TkToplevel.new {|w|
base_frame = TkFrame.new($radio_demo).pack(:fill=>:both, :expand=>true)
-# label
+# label
msg = TkLabel.new(base_frame) {
font $font
wraplength '4i'
@@ -30,11 +30,11 @@ msg = TkLabel.new(base_frame) {
}
msg.pack('side'=>'top')
-#
+#
size = TkVariable.new
color = TkVariable.new
-# frame
+# frame
TkFrame.new(base_frame) {|frame|
TkButton.new(frame) {
text 'Dismiss'
@@ -59,13 +59,13 @@ TkFrame.new(base_frame) {|frame|
}.pack('side'=>'left', 'expand'=>'yes')
}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
-# frame
+# frame
f_left = TkFrame.new(base_frame)
f_right = TkFrame.new(base_frame)
f_left.pack('side'=>'left', 'expand'=>'yes', 'padx'=>'.5c', 'pady'=>'.5c')
f_right.pack('side'=>'left', 'expand'=>'yes', 'padx'=>'.5c', 'pady'=>'.5c')
-# radiobutton
+# radiobutton
[10, 12, 18, 24].each {|sz|
TkRadioButton.new(f_left) {
text "Point Size #{sz}"
diff --git a/ext/tk/sample/demos-en/radio2.rb b/ext/tk/sample/demos-en/radio2.rb
index 72fc2c610c..6c02aef0cf 100644
--- a/ext/tk/sample/demos-en/radio2.rb
+++ b/ext/tk/sample/demos-en/radio2.rb
@@ -8,7 +8,7 @@
# toplevel widget
if defined?($radio2_demo) && $radio2_demo
- $radio2_demo.destroy
+ $radio2_demo.destroy
$radio2_demo = nil
end
@@ -21,7 +21,7 @@ $radio2_demo = TkToplevel.new {|w|
base_frame = TkFrame.new($radio2_demo).pack(:fill=>:both, :expand=>true)
-# label
+# label
msg = TkLabel.new(base_frame) {
font $font
wraplength '5i'
@@ -30,12 +30,12 @@ msg = TkLabel.new(base_frame) {
}
msg.pack('side'=>'top')
-#
+#
size = TkVariable.new
color = TkVariable.new
align = TkVariable.new
-# frame
+# frame
TkFrame.new(base_frame) {|frame|
TkButton.new(frame) {
text 'Dismiss'
@@ -55,24 +55,24 @@ TkFrame.new(base_frame) {|frame|
TkButton.new(frame) {
text 'See Variables'
command proc{
- showVars(base_frame,
+ 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',
+# frame
+f_left = TkLabelFrame.new(base_frame, 'text'=>'Point Size',
'pady'=>2, 'padx'=>2)
-f_mid = TkLabelFrame.new(base_frame, 'text'=>'Color',
+f_mid = TkLabelFrame.new(base_frame, 'text'=>'Color',
'pady'=>2, 'padx'=>2)
-f_right = TkLabelFrame.new(base_frame, 'text'=>'Alignment',
+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
+# radiobutton
[10, 12, 18, 24].each {|sz|
TkRadioButton.new(f_left) {
text "Point Size #{sz}"
@@ -92,15 +92,15 @@ f_right.pack('side'=>'left', 'expand'=>'yes', 'padx'=>'.5c', 'pady'=>'.5c')
}.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',
+# 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,
+ TkRadioButton.new(f_right, 'text'=>a, 'variable'=>align, 'relief'=>'flat',
+ 'value'=>lower, 'indicatoron'=>0, 'width'=>7,
'command'=>proc{label.compound(align.value)})
}
diff --git a/ext/tk/sample/demos-en/radio3.rb b/ext/tk/sample/demos-en/radio3.rb
index 8a147edda7..9c9d75ef4a 100644
--- a/ext/tk/sample/demos-en/radio3.rb
+++ b/ext/tk/sample/demos-en/radio3.rb
@@ -8,7 +8,7 @@
# toplevel widget
if defined?($radio3_demo) && $radio3_demo
- $radio3_demo.destroy
+ $radio3_demo.destroy
$radio3_demo = nil
end
@@ -21,7 +21,7 @@ $radio3_demo = TkToplevel.new {|w|
base_frame = TkFrame.new($radio3_demo).pack(:fill=>:both, :expand=>true)
-# label
+# label
msg = TkLabel.new(base_frame) {
font $font
wraplength '5i'
@@ -35,50 +35,50 @@ size = TkVariable.new
color = TkVariable.new
align = TkVariable.new
-# frame
+# frame
TkFrame.new(base_frame) {|frame|
- TkGrid(TkFrame.new(frame, :height=>2, :relief=>:sunken, :bd=>2),
+ 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,
+ TkGrid('x',
+ TkButton.new(frame, :text=>'See Variables',
+ :image=>$image['view'], :compound=>:left,
:command=>proc{
- showVars(base_frame, ['size', size],
+ 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,
+ }),
+ 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',
+# frame
+f_left = TkLabelFrame.new(base_frame, 'text'=>'Point Size',
'pady'=>2, 'padx'=>2)
-f_mid = TkLabelFrame.new(base_frame, 'text'=>'Color',
+f_mid = TkLabelFrame.new(base_frame, 'text'=>'Color',
'pady'=>2, 'padx'=>2)
-f_right = TkLabelFrame.new(base_frame, 'text'=>'Alignment',
+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',
+TkButton.new(base_frame, 'text'=>'Tristate',
'command'=>proc{size.value = 'multi'; color.value = 'multi'}){
grid('column'=>2, 'row'=>2, 'pady'=>'.5c', 'padx'=>'.5c')
}
-# radiobutton
+# radiobutton
[10, 12, 14, 18, 24].each {|sz|
TkRadioButton.new(f_left) {
text "Point Size #{sz}"
@@ -101,14 +101,14 @@ TkButton.new(base_frame, 'text'=>'Tristate',
}.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',
+# 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,
+ TkRadioButton.new(f_right, 'text'=>a, 'variable'=>align, 'relief'=>'flat',
+ 'value'=>a.downcase, 'indicatoron'=>0, 'width'=>7,
'command'=>proc{label.compound(align.value)})
}
diff --git a/ext/tk/sample/demos-en/ruler.rb b/ext/tk/sample/demos-en/ruler.rb
index a9773699f7..26cd4f3b1c 100644
--- a/ext/tk/sample/demos-en/ruler.rb
+++ b/ext/tk/sample/demos-en/ruler.rb
@@ -21,7 +21,7 @@ end
# toplevel widget
if defined?($ruler_demo) && $ruler_demo
- $ruler_demo.destroy
+ $ruler_demo.destroy
$ruler_demo = nil
end
@@ -35,7 +35,7 @@ $ruler_demo = TkToplevel.new {|w|
base_frame = TkFrame.new($ruler_demo).pack(:fill=>:both, :expand=>true)
# label
-TkLabel.new(base_frame, 'font'=>$font, 'wraplength'=>'5i', 'justify'=>'left',
+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')
}
@@ -58,14 +58,14 @@ $ruler_buttons = TkFrame.new(base_frame) {|frame|
}
$ruler_buttons.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
-# canvas
+# canvas
$ruler_canvas = TkCanvas.new(base_frame, 'width'=>'14.8c', 'height'=>'2.5c')
$ruler_canvas.pack('side'=>'top', 'fill'=>'x')
-#
+#
unless Struct.const_defined?("RulerInfo")
- $demo_rulerInfo = Struct.new("RulerInfo", :grid, :left, :right, :x, :y,
- :top, :bottom, :size, :normalStyle,
+ $demo_rulerInfo = Struct.new("RulerInfo", :grid, :left, :right, :x, :y,
+ :top, :bottom, :size, :normalStyle,
:activeStyle, :deleteStyle).new
end
$demo_rulerInfo.grid = '.25c'
@@ -77,17 +77,17 @@ $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, '..',
+ $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, '..',
+ $demo_rulerInfo.deleteStyle = {'fill'=>'black',
+ 'stipple'=>'@'+[$demo_dir, '..',
'images', 'gray25.xbm'].join(File::Separator)}
end
-TkcLine.new($ruler_canvas,
+TkcLine.new($ruler_canvas,
'1c', '0.5c', '1c', '1c', '13c', '1c', '13c', '0.5c', 'width'=>1)
(0..11).each{|i|
x = i+1
@@ -101,21 +101,21 @@ TkcLine.new($ruler_canvas,
$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',
+ 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'),
+ 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',
+$ruler_canvas.itembind('tab', '1',
proc{|x,y| rulerSelectTab($ruler_canvas,x,y)}, '%x %y')
-$ruler_canvas.bind('B1-Motion',
+$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)})
diff --git a/ext/tk/sample/demos-en/sayings.rb b/ext/tk/sample/demos-en/sayings.rb
index a4dcf37cdc..06ec7c1e75 100644
--- a/ext/tk/sample/demos-en/sayings.rb
+++ b/ext/tk/sample/demos-en/sayings.rb
@@ -9,7 +9,7 @@
# toplevel widget
if defined?($sayings_demo) && $sayings_demo
- $sayings_demo.destroy
+ $sayings_demo.destroy
$sayings_demo = nil
end
@@ -70,11 +70,11 @@ TkFrame.new(base_frame, 'borderwidth'=>10) {|w|
sayings_lbox.pack('expand'=>'yes', 'fill'=>'y')
else
- sayings_lbox.grid('row'=>0, 'column'=>0,
+ sayings_lbox.grid('row'=>0, 'column'=>0,
'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news')
- sv.grid('row'=>0, 'column'=>1,
+ sv.grid('row'=>0, 'column'=>1,
'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news')
- sh.grid('row'=>1, 'column'=>0,
+ 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)
diff --git a/ext/tk/sample/demos-en/search.rb b/ext/tk/sample/demos-en/search.rb
index 7fb40d88b2..e1fc565e9d 100644
--- a/ext/tk/sample/demos-en/search.rb
+++ b/ext/tk/sample/demos-en/search.rb
@@ -62,13 +62,13 @@ end
def textToggle(cmd1,sleep1,cmd2,sleep2)
sleep_list = [sleep2, sleep1]
- TkAfter.new(proc{sleep = sleep_list.shift; sleep_list.push(sleep); sleep},
+ 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.destroy
$search_demo = nil
end
@@ -101,35 +101,35 @@ $search_buttons.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
# frame
TkFrame.new(base_frame) {|f|
- TkLabel.new(f, 'text'=>'File name:',
+ TkLabel.new(f, 'text'=>'File name:',
'width'=>13, 'anchor'=>'w').pack('side'=>'left')
$search_fileName = TkVariable.new
- TkEntry.new(f, 'width'=>40,
+ 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,
+ 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:',
+ 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,
+ $search_string_entry = TkEntry.new(f, 'width'=>40,
'textvariable'=>$search_searchString) {
pack('side'=>'left')
- bind('Return', proc{textSearch($search_text, $search_searchString.value,
+ bind('Return', proc{textSearch($search_text, $search_searchString.value,
$search_Tag)})
}
- TkButton.new(f, 'text'=>'Highlight',
- 'command'=>proc{textSearch($search_text,
- $search_searchString.value,
+ TkButton.new(f, 'text'=>'Highlight',
+ 'command'=>proc{textSearch($search_text,
+ $search_searchString.value,
$search_Tag)}) {
pack('side'=>'left', 'pady'=>5, 'padx'=>10)
}
@@ -148,20 +148,20 @@ $search_text = TkText.new(base_frame, 'setgrid'=>true, 'wrap'=>'word') {|t|
if TkWinfo.depth($search_demo) > 1
textToggle(proc{
- $search_Tag.configure('background'=>'#ce5555',
+ $search_Tag.configure('background'=>'#ce5555',
'foreground'=>'white')
},
- 800,
+ 800,
proc{
$search_Tag.configure('background'=>'', 'foreground'=>'')
},
200 )
else
textToggle(proc{
- $search_Tag.configure('background'=>'black',
+ $search_Tag.configure('background'=>'black',
'foreground'=>'white')
},
- 800,
+ 800,
proc{
$search_Tag.configure('background'=>'', 'foreground'=>'')
},
diff --git a/ext/tk/sample/demos-en/spin.rb b/ext/tk/sample/demos-en/spin.rb
index d51b7e6619..c2a3a8949b 100644
--- a/ext/tk/sample/demos-en/spin.rb
+++ b/ext/tk/sample/demos-en/spin.rb
@@ -5,7 +5,7 @@
# based on Tcl/Tk8.4.4 widget demos
if defined?($spin_demo) && $spin_demo
- $spin_demo.destroy
+ $spin_demo.destroy
$spin_demo = nil
end
@@ -17,8 +17,8 @@ $spin_demo = TkToplevel.new {|w|
base_frame = TkFrame.new($spin_demo).pack(:fill=>:both, :expand=>true)
-TkLabel.new(base_frame,
- :font=>$font, :wraplength=>'5i', :justify=>:left,
+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. \
@@ -50,16 +50,16 @@ TkFrame.new(base_frame){|f|
}
australianCities = [
- 'Canberra', 'Sydney', 'Melbourne', 'Perth', 'Adelaide',
+ 'Canberra', 'Sydney', 'Melbourne', 'Perth', 'Adelaide',
'Brisbane', 'Hobart', 'Darwin', 'Alice Springs'
]
[
- TkSpinbox.new(base_frame, :from=>1, :to=>10, :width=>10, :validate=>:key,
+ 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, :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/states.rb b/ext/tk/sample/demos-en/states.rb
index a5c01a867c..add0e84800 100644
--- a/ext/tk/sample/demos-en/states.rb
+++ b/ext/tk/sample/demos-en/states.rb
@@ -8,7 +8,7 @@
# toplevel widget
if defined?($states_demo) && $states_demo
- $states_demo.destroy
+ $states_demo.destroy
$states_demo = nil
end
@@ -63,16 +63,16 @@ TkFrame.new(base_frame, 'borderwidth'=>'.5c') {|w|
}.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',
+ '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'
]
diff --git a/ext/tk/sample/demos-en/style.rb b/ext/tk/sample/demos-en/style.rb
index 5c8777379e..c2fed23926 100644
--- a/ext/tk/sample/demos-en/style.rb
+++ b/ext/tk/sample/demos-en/style.rb
@@ -8,7 +8,7 @@
# toplevel widget
if defined?($style_demo) && $style_demo
- $style_demo.destroy
+ $style_demo.destroy
$style_demo = nil
end
@@ -38,9 +38,9 @@ TkFrame.new(base_frame) {|frame|
}.pack('side'=>'left', 'expand'=>'yes')
}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
-# text
+# text
txt = TkText.new(base_frame){|t|
- #
+ #
setgrid 'true'
#width 70
#height 32
@@ -53,7 +53,7 @@ txt = TkText.new(base_frame){|t|
}
pack('expand'=>'yes', 'fill'=>'both')
- #
+ #
family = 'Courier'
if $tk_version =~ /^4.*/
@@ -76,44 +76,44 @@ txt = TkText.new(base_frame){|t|
# when /^8.*/
# unless $style_demo_do_first
# $style_demo_do_first = true
-# Tk.tk_call('font', 'create', '@bigascii',
+# Tk.tk_call('font', 'create', '@bigascii',
# '-copy', '-*-Courier-Bold-R-Normal--*-140-*-*-*-*-*-*')
-# Tk.tk_call('font', 'create', '@smallascii',
+# Tk.tk_call('font', 'create', '@smallascii',
# '-copy', '-Adobe-Helvetica-Bold-R-Normal-*-100-*')
-# Tk.tk_call('font', 'create', '@cBigFont',
+# Tk.tk_call('font', 'create', '@cBigFont',
# '-compound', '@bigascii @msg_knj')
-# Tk.tk_call('font', 'create', '@cSmallFont',
+# 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',
+ style_tag_color1 = TkTextTag.new(t, 'background'=>'black',
'foreground'=>'white')
- style_tag_color2 = TkTextTag.new(t, 'background'=>'black',
+ style_tag_color2 = TkTextTag.new(t, 'background'=>'black',
'foreground'=>'white')
- style_tag_raised = TkTextTag.new(t, 'background'=>'white',
+ style_tag_raised = TkTextTag.new(t, 'background'=>'white',
'relief'=>'raised', 'borderwidth'=>1)
- style_tag_sunken = TkTextTag.new(t, 'background'=>'white',
+ 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,
+ style_tag_bgstipple = TkTextTag.new(t, 'background'=>'black',
+ 'borderwidth'=>0,
'bgstipple'=>'gray25')
else
- style_tag_bgstipple = TkTextTag.new(t, 'background'=>'black',
- 'borderwidth'=>0,
+ style_tag_bgstipple = TkTextTag.new(t, 'background'=>'black',
+ 'borderwidth'=>0,
'bgstipple'=>'gray12')
end
style_tag_fgstipple = TkTextTag.new(t, 'fgstipple'=>'gray50')
@@ -134,7 +134,7 @@ txt = TkText.new(base_frame){|t|
'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 ')
diff --git a/ext/tk/sample/demos-en/text.rb b/ext/tk/sample/demos-en/text.rb
index 5794a85e87..3ce8cdfda8 100644
--- a/ext/tk/sample/demos-en/text.rb
+++ b/ext/tk/sample/demos-en/text.rb
@@ -8,7 +8,7 @@
# toplevel widget
if defined?($text_demo) && $text_demo
- $text_demo.destroy
+ $text_demo.destroy
$text_demo = nil
end
@@ -45,7 +45,7 @@ TkFrame.new(base_frame) {|frame|
}.pack('side'=>'left', 'expand'=>'yes')
}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
-# text
+# text
TkText.new(base_frame){|t|
relief 'sunken'
bd 2
@@ -62,7 +62,7 @@ TkText.new(base_frame){|t|
}
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
diff --git a/ext/tk/sample/demos-en/textpeer.rb b/ext/tk/sample/demos-en/textpeer.rb
index 20192fcd05..c25ce15e5c 100644
--- a/ext/tk/sample/demos-en/textpeer.rb
+++ b/ext/tk/sample/demos-en/textpeer.rb
@@ -4,7 +4,7 @@
# based on Tcl/Tk8.5.0 widget demos
if defined?($textpeer_demo) && $textpeer_demo
- $textpeer_demo.destroy
+ $textpeer_demo.destroy
$textpeer_demo = nil
end
@@ -39,9 +39,9 @@ def makeClone(count, win, txt)
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',
+ 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',
+ 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)
@@ -51,7 +51,7 @@ def makeClone(count, win, txt)
end
def killClone(win, cnt)
- Tk.destroy("#{win.path}.text#{cnt}", "#{win.path}.sb#{cnt}",
+ Tk.destroy("#{win.path}.text#{cnt}", "#{win.path}.sb#{cnt}",
"#{win.path}.clone#{cnt}", "#{win.path}.kill#{cnt}")
end
diff --git a/ext/tk/sample/demos-en/toolbar.rb b/ext/tk/sample/demos-en/toolbar.rb
index e7cbeb4235..5cf863717b 100644
--- a/ext/tk/sample/demos-en/toolbar.rb
+++ b/ext/tk/sample/demos-en/toolbar.rb
@@ -5,7 +5,7 @@
# 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.destroy
$toolbar_demo = nil
end
@@ -18,7 +18,7 @@ $toolbar_demo = TkToplevel.new {|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',
+ 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 \
@@ -32,7 +32,7 @@ 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',
+ 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 \
@@ -70,7 +70,7 @@ if Tk.windowingsystem != 'aqua'
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) }
+ self.wm_protocol('WM_DELETE_WINDOW'){ self.untearoff(self) }
end
def tbar_base.untearoff(w)
self.wm_forget
@@ -83,25 +83,25 @@ end
text = TkText.new(base_frame, :width=>40, :height=>10)
## Toolbar contents
-tb_btn = Ttk::Button.new(tbar_base, :text=>'Button', :style=>'Toolbutton',
+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),
+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,
+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',
+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,
+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')
@@ -114,16 +114,16 @@ base_frame.grid_columnconfigure(text, :weight=>1)
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,
+ 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
index cd62ba8c9b..0c7f0e71a2 100644
--- a/ext/tk/sample/demos-en/tree.rb
+++ b/ext/tk/sample/demos-en/tree.rb
@@ -6,7 +6,7 @@
# 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.destroy
$tree_demo = nil
end
@@ -19,8 +19,8 @@ $tree_demo = TkToplevel.new {|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],
+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, \
@@ -37,16 +37,16 @@ EOL
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,
+ 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)
@@ -55,7 +55,7 @@ Ttk::Frame.new(base_frame) {|frame|
## 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,
+ populate_tree(tree, tree.insert(nil, :end, :text=>dir,
:values=>[dir, 'directory']))
}
end
@@ -68,7 +68,7 @@ def populate_tree(tree, node)
tree.delete(tree.children(node))
Dir.glob("#{path}/*").sort.each{|f|
type = File.ftype(f)
- id = tree.insert(node, :end,
+ id = tree.insert(node, :end,
:text=>File.basename(f), :values=>[f, type]).id
if type == 'directory'
## Make it so that this node is openable
@@ -94,7 +94,7 @@ def populate_tree(tree, node)
end
## Create the tree and set it up
-tree = Ttk::Treeview.new(base_frame, :columns=>%w(fullpath type size),
+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))
diff --git a/ext/tk/sample/demos-en/ttkbut.rb b/ext/tk/sample/demos-en/ttkbut.rb
index a784efcc08..b5780f589a 100644
--- a/ext/tk/sample/demos-en/ttkbut.rb
+++ b/ext/tk/sample/demos-en/ttkbut.rb
@@ -7,7 +7,7 @@
# 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.destroy
$ttkbut_demo = nil
end
@@ -19,7 +19,7 @@ $ttkbut_demo = TkToplevel.new {|w|
base_frame = TkFrame.new($ttkbut_demo).pack(:fill=>:both, :expand=>true)
-Ttk::Label.new(base_frame, :font=>$font, :wraplength=>'4i', :justify=>:left,
+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. \
@@ -34,11 +34,11 @@ 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,
+# 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,
+ Ttk::Button.new(buttons, :text=>theme,
:command=>proc{Ttk.set_theme theme}).pack(:pady=>2)
}
@@ -62,9 +62,9 @@ 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,
+e = Ttk::Checkbutton.new(checks, :text=>'Enabled', :variable=>enabled,
:command=>proc{
- setState($ttkbut_demo,
+ setState($ttkbut_demo,
((enabled.bool)? "!disabled" : "disabled"),
e)
})
@@ -90,15 +90,15 @@ radios = Ttk::Labelframe.new(base_frame, :text=>'Radiobuttons')
happyness = TkVariable.new
-r1 = Ttk::Radiobutton.new(radios, :variable=>happyness,
+r1 = Ttk::Radiobutton.new(radios, :variable=>happyness,
:text=>'Great', :value=>'great')
-r2 = Ttk::Radiobutton.new(radios, :variable=>happyness,
+r2 = Ttk::Radiobutton.new(radios, :variable=>happyness,
:text=>'Good', :value=>'good')
-r3 = Ttk::Radiobutton.new(radios, :variable=>happyness,
+r3 = Ttk::Radiobutton.new(radios, :variable=>happyness,
:text=>'Ok', :value=>'ok')
-r4 = Ttk::Radiobutton.new(radios, :variable=>happyness,
+r4 = Ttk::Radiobutton.new(radios, :variable=>happyness,
:text=>'Poor', :value=>'poor')
-r5 = Ttk::Radiobutton.new(radios, :variable=>happyness,
+r5 = Ttk::Radiobutton.new(radios, :variable=>happyness,
:text=>'Awful', :value=>'awful')
Tk.pack(r1, r2, r3, r4, r5, :fill=>:x, :padx=>3, :pady=>2)
@@ -107,26 +107,26 @@ Tk.pack(r1, r2, r3, r4, r5, :fill=>:x, :padx=>3, :pady=>2)
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,
+ 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],
+ 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,
+ }),
+ 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)
diff --git a/ext/tk/sample/demos-en/ttkmenu.rb b/ext/tk/sample/demos-en/ttkmenu.rb
index 9399568313..75ecdb09c4 100644
--- a/ext/tk/sample/demos-en/ttkmenu.rb
+++ b/ext/tk/sample/demos-en/ttkmenu.rb
@@ -6,7 +6,7 @@
# 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.destroy
$ttkmenu_demo = nil
end
@@ -18,7 +18,7 @@ $ttkmenu_demo = TkToplevel.new {|w|
base_frame = Ttk::Frame.new($ttkmenu_demo).pack(:fill=>:both, :expand=>true)
-Ttk::Label.new(base_frame, :font=>$font, :wraplength=>'4i', :justify=>:left,
+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. \
@@ -39,16 +39,16 @@ Ttk::Separator.new(base_frame).pack(:side=>:top, :fill=>:x)
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,
+ 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)
diff --git a/ext/tk/sample/demos-en/ttknote.rb b/ext/tk/sample/demos-en/ttknote.rb
index bc0c7b369a..c2a22b447a 100644
--- a/ext/tk/sample/demos-en/ttknote.rb
+++ b/ext/tk/sample/demos-en/ttknote.rb
@@ -6,7 +6,7 @@
# 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.destroy
$ttknote_demo = nil
end
@@ -20,16 +20,16 @@ $ttknote_demo = TkToplevel.new {|w|
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,
+ 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)
@@ -38,13 +38,13 @@ Ttk::Frame.new($ttknote_demo) {|frame|
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,
+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',
+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, \
@@ -58,7 +58,7 @@ 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,
+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
diff --git a/ext/tk/sample/demos-en/ttkpane.rb b/ext/tk/sample/demos-en/ttkpane.rb
index 87c4dedeb2..56df613db4 100644
--- a/ext/tk/sample/demos-en/ttkpane.rb
+++ b/ext/tk/sample/demos-en/ttkpane.rb
@@ -5,7 +5,7 @@
# 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.destroy
$ttkpane_demo = nil
end
@@ -17,7 +17,7 @@ $ttkpane_demo = TkToplevel.new {|w|
base_frame = TkFrame.new($ttkpane_demo).pack(:fill=>:both, :expand=>true)
-Ttk::Label.new(base_frame, :font=>$font, :wraplength=>'4i', :justify=>:left,
+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 \
@@ -30,16 +30,16 @@ Ttk::Separator.new(base_frame).pack(:side=>:top, :fill=>:x)
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,
+ 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)
@@ -59,25 +59,25 @@ if Tk.windowingsystem == 'aqua'
end
# Fill the button pane
-Ttk::Button.new(left_top, :text=>'Press Me',
+Ttk::Button.new(left_top, :text=>'Press Me',
:command=>proc{
- Tk.messageBox(:type=>'ok', :icon=>'info', :message=>'Ouch!',
- :detail=>'That hurt...', :parent=>base_frame,
+ 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/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'],
+ [':America/New_York'],
+ [':Asia/Singapore'],
+ [':Australia/Sydney'],
+ [':Asia/Tokyo'],
]
zones = []
@@ -155,7 +155,7 @@ time = TkVariable.new_hash
case tzinfo
when :tcl
update_proc = proc{|now, tz, label|
- time[label] = Tk.tk_call('clock', 'format', now.tv_sec,
+ time[label] = Tk.tk_call('clock', 'format', now.tv_sec,
'-timezone', tz, '-format', '%T')
}
when :tzinfo
@@ -176,7 +176,7 @@ end
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),
+ Ttk::Label.new(left_bot, :textvariable=>time.ref(label),
:anchor=>'w').pack(:fill=>:x)
}
diff --git a/ext/tk/sample/demos-en/ttkprogress.rb b/ext/tk/sample/demos-en/ttkprogress.rb
index c341a9385f..3eb9a64a4a 100644
--- a/ext/tk/sample/demos-en/ttkprogress.rb
+++ b/ext/tk/sample/demos-en/ttkprogress.rb
@@ -5,7 +5,7 @@
# 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.destroy
$ttkprogress_demo = nil
end
@@ -17,7 +17,7 @@ $ttkprogress_demo = TkToplevel.new {|w|
base_frame = TkFrame.new($ttkprogress_demo).pack(:fill=>:both, :expand=>true)
-Ttk::Label.new(base_frame, :font=>$font, :wraplength=>'4i', :justify=>:left,
+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, \
@@ -32,16 +32,16 @@ EOL
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,
+ 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)
@@ -52,9 +52,9 @@ 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',
+start = Ttk::Button.new(frame, :text=>'Start Progress',
:command=>proc{ p1.start; p2.start })
-stop = Ttk::Button.new(frame, :text=>'Stop Progress',
+stop = Ttk::Button.new(frame, :text=>'Stop Progress',
:command=>proc{ p1.stop; p2.stop })
Tk.grid(p1, '-', :pady=>5, :padx=>10)
diff --git a/ext/tk/sample/demos-en/twind.rb b/ext/tk/sample/demos-en/twind.rb
index 60a345d0b4..65ee712ff7 100644
--- a/ext/tk/sample/demos-en/twind.rb
+++ b/ext/tk/sample/demos-en/twind.rb
@@ -8,7 +8,7 @@
# toplevel widget
if defined?($twind_demo) && $twind_demo
- $twind_demo.destroy
+ $twind_demo.destroy
$twind_demo = nil
end
@@ -41,10 +41,10 @@ $twind_buttons.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
# frame
$twind_text = nil
-TkFrame.new(base_frame, 'highlightthickness'=>2, 'borderwidth'=>2,
+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',
+ $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)}
@@ -53,12 +53,12 @@ TkFrame.new(base_frame, 'highlightthickness'=>2, 'borderwidth'=>2,
}.pack('expand'=>'yes', 'fill'=>'both')
}.pack('expand'=>'yes', 'fill'=>'both')
-#
-$tag_center = TkTextTag.new($twind_text,
+#
+$tag_center = TkTextTag.new($twind_text,
'justify' =>'center',
'spacing1'=>'5m',
'spacing3'=>'5m' )
-$tag_buttons = TkTextTag.new($twind_text,
+$tag_buttons = TkTextTag.new($twind_text,
'lmargin1'=>'1c',
'lmargin2'=>'1c',
'rmargin' =>'1c',
@@ -71,7 +71,7 @@ $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',
+TkTextWindow.new($twind_text, 'end',
'window'=>TkButton.new($twind_text) {
#text 'ON'
text 'Turn On'
@@ -81,7 +81,7 @@ TkTextWindow.new($twind_text, 'end',
$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',
+TkTextWindow.new($twind_text, 'end',
'window'=>TkButton.new($twind_text) {
#text 'OFF'
text 'Turn Off'
@@ -91,7 +91,7 @@ TkTextWindow.new($twind_text, 'end',
$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',
+TkTextWindow.new($twind_text, 'end',
'window'=>TkButton.new($twind_text) {
text 'Click Here'
command proc{textWindPlot $twind_text}
@@ -102,7 +102,7 @@ $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',
+TkTextWindow.new($twind_text, 'end',
'window'=>TkButton.new($twind_text) {
text 'Delete'
command proc{textWindDel $twind_text}
@@ -124,7 +124,7 @@ $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',
+TkTextWindow.new($twind_text, 'end',
'window'=>TkButton.new($twind_text) {|b|
text 'Default'
command proc{embDefBg $twind_text}
@@ -133,7 +133,7 @@ TkTextWindow.new($twind_text, 'end',
},
'padx'=>3 )
embToggle = TkVariable.new('Short')
-TkTextWindow.new($twind_text, 'end',
+TkTextWindow.new($twind_text, 'end',
'window'=>TkCheckButton.new($twind_text) {
textvariable embToggle
indicatoron 0
@@ -144,25 +144,25 @@ TkTextWindow.new($twind_text, 'end',
pady 5
padx 2
},
- 'padx'=>3,
+ 'padx'=>3,
'pady'=>2 )
-[ 'AntiqueWhite3', 'Bisque1', 'Bisque2', 'Bisque3', 'Bisque4',
- 'SlateBlue3', 'RoyalBlue1', 'SteelBlue2', 'DeepSkyBlue3', 'LightBlue1',
- 'DarkSlateGray1', 'Aquamarine2', 'DarkSeaGreen2', 'SeaGreen1',
- 'Yellow1', 'IndianRed1', 'IndianRed2', 'Tan1', 'Tan4'
+[ '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',
+ 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,
+ 'padx'=>3,
'pady'=>2 )
}
-#
+#
def textWindOn (w,f)
if defined? $twind_scroll
begin
@@ -216,39 +216,39 @@ def textWindPlot (t)
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,
+ 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,
+ 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,
+ 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,
+ 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',
+ $twind_plot.itembind('point', 'Any-Enter',
proc{$twind_plot.itemconfigure 'current', 'fill', 'red'})
- $twind_plot.itembind('point', 'Any-Leave',
+ $twind_plot.itembind('point', 'Any-Leave',
proc{$twind_plot.itemconfigure 'current', 'fill', 'SkyBlue2'})
- $twind_plot.itembind('point', '1',
+ $twind_plot.itembind('point', '1',
proc{|x,y| embPlotDown $twind_plot,x,y}, "%x %y")
- $twind_plot.itembind('point', 'ButtonRelease-1',
+ $twind_plot.itembind('point', 'ButtonRelease-1',
proc{$twind_plot.dtag 'selected'})
- $twind_plot.bind('B1-Motion',
+ $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
diff --git a/ext/tk/sample/demos-en/twind2.rb b/ext/tk/sample/demos-en/twind2.rb
index af7313dd82..43990c1151 100644
--- a/ext/tk/sample/demos-en/twind2.rb
+++ b/ext/tk/sample/demos-en/twind2.rb
@@ -4,7 +4,7 @@
# delete toplevel widget
if defined?($twind2_demo) && $twind2_demo
- $twind2_demo.destroy
+ $twind2_demo.destroy
$twind2_demo = nil
end
@@ -19,20 +19,20 @@ 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),
+ 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,
+ 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)
}
@@ -40,11 +40,11 @@ $twind2_buttons.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
# frame
$twind2_text = nil
-TkFrame.new(base_frame, 'highlightthickness'=>2, 'borderwidth'=>2,
+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',
+ # '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)}
@@ -54,11 +54,11 @@ TkFrame.new(base_frame, 'highlightthickness'=>2, 'borderwidth'=>2,
}.pack('expand'=>'yes', 'fill'=>'both')
# text tags
-$tag2_center = TkTextTag.new($twind2_text,
+$tag2_center = TkTextTag.new($twind2_text,
'justify' =>'center',
'spacing1'=>'5m',
'spacing3'=>'5m' )
-$tag2_buttons = TkTextTag.new($twind2_text,
+$tag2_buttons = TkTextTag.new($twind2_text,
'lmargin1'=>'1c',
'lmargin2'=>'1c',
'rmargin' =>'1c',
@@ -67,7 +67,7 @@ $tag2_buttons = TkTextTag.new($twind2_text,
'spacing3'=>0 )
# insert text
-$twind2_text.insert('end',
+$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 ")
@@ -82,7 +82,7 @@ $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',
+TkTextWindow.new($twind2_text, 'end',
'window'=>TkButton.new($twind2_text) {
text 'ON'
command proc{textWindOn2 $twind2_text,$twind2_buttons}
@@ -91,30 +91,30 @@ TkTextWindow.new($twind2_text, 'end',
$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',
+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',
+$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',
+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',
+$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',
+$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',
+TkTextWindow.new($twind2_text, 'end',
'window'=>TkButton.new($twind2_text) {
text 'Delete'
command proc{textWindDel2 $twind2_text}
@@ -122,19 +122,19 @@ TkTextWindow.new($twind2_text, 'end',
})
$twind2_text.insert('end', " the plot again.\n\n")
-$twind2_text.insert('end',
+$twind2_text.insert('end',
"You may also find it useful to put embedded windows in ")
-$twind2_text.insert('end',
+$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',
+$twind2_text.insert('end',
"example, here is a collection of buttons laid out ")
-$twind2_text.insert('end',
+$twind2_text.insert('end',
"neatly into rows by the text widget. These buttons ")
-$twind2_text.insert('end',
+$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',
+$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 ")
@@ -148,7 +148,7 @@ btn_default = TkButton.new($twind2_text) {|b|
}
TkTextWindow.new($twind2_text, 'end', 'window'=>btn_default, 'padx'=>3)
embToggle = TkVariable.new('Short')
-TkTextWindow.new($twind2_text, 'end',
+TkTextWindow.new($twind2_text, 'end',
'window'=>TkCheckButton.new($twind2_text) {
textvariable embToggle
indicatoron 0
@@ -159,21 +159,21 @@ TkTextWindow.new($twind2_text, 'end',
pady 5
padx 2
},
- 'padx'=>3,
+ 'padx'=>3,
'pady'=>2 )
-[ 'AntiqueWhite3', 'Bisque1', 'Bisque2', 'Bisque3', 'Bisque4',
- 'SlateBlue3', 'RoyalBlue1', 'SteelBlue2', 'DeepSkyBlue3', 'LightBlue1',
- 'DarkSlateGray1', 'Aquamarine2', 'DarkSeaGreen2', 'SeaGreen1',
- 'Yellow1', 'IndianRed1', 'IndianRed2', 'Tan1', 'Tan4'
+[ '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',
+ 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,
+ 'padx'=>3,
'pady'=>2 )
}
@@ -187,54 +187,54 @@ $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',
+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',
+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',
+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',
+TkTextWindow.new($twind2_text, 'end',
'window'=>TkButton.new($twind2_text, :text=>"Small highlight",
- :cursor=>'top_left_arrow',
+ :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',
+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',
+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',
+$twind2_text.insert('end',
"\n\nFinally, images fit comfortably in text widgets too:")
-TkTextImage.new($twind2_text, 'end',
+TkTextImage.new($twind2_text, 'end',
'image'=>TkBitmapImage.new(:file=>[
- $demo_dir, '..',
+ $demo_dir, '..',
'images', 'face.xbm'
].join(File::Separator)))
@@ -309,39 +309,39 @@ def textWindPlot2 (t)
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,
+ 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,
+ 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,
+ 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,
+ 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',
+ $twind2_plot.itembind('point', 'Any-Enter',
proc{$twind2_plot.itemconfigure 'current', 'fill', 'red'})
- $twind2_plot.itembind('point', 'Any-Leave',
+ $twind2_plot.itembind('point', 'Any-Leave',
proc{$twind2_plot.itemconfigure 'current', 'fill', 'SkyBlue2'})
- $twind2_plot.itembind('point', '1',
+ $twind2_plot.itembind('point', '1',
proc{|x,y| embPlotDown2 $twind2_plot,x,y}, "%x %y")
- $twind2_plot.itembind('point', 'ButtonRelease-1',
+ $twind2_plot.itembind('point', 'ButtonRelease-1',
proc{$twind2_plot.dtag 'selected'})
- $twind2_plot.bind('B1-Motion',
+ $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
diff --git a/ext/tk/sample/demos-en/unicodeout.rb b/ext/tk/sample/demos-en/unicodeout.rb
index ee7b5afa15..9c230a2536 100644
--- a/ext/tk/sample/demos-en/unicodeout.rb
+++ b/ext/tk/sample/demos-en/unicodeout.rb
@@ -6,7 +6,7 @@
# based on Tcl/Tk8.4.4 widget demos
if defined?($unicodeout_demo) && $unicodeout_demo
- $unicodeout_demo.destroy
+ $unicodeout_demo.destroy
$unicodeout_demo = nil
end
@@ -18,8 +18,8 @@ $unicodeout_demo = TkToplevel.new {|w|
base_frame = TkFrame.new($unicodeout_demo).pack(:fill=>:both, :expand=>true)
-TkLabel.new(base_frame,
- :font=>$font, :wraplength=>'5.4i', :justify=>:left,
+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 \
@@ -32,10 +32,10 @@ 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:
+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.
+And the Tk::UTF8_String objects are passed to the label widgets.
EOL
TkFrame.new(base_frame){|f|
@@ -51,8 +51,8 @@ TkFrame.new(base_frame){|f|
}).pack(:side=>:left, :expand=>true)
}
-wait_msg = TkLabel.new(base_frame,
- :text=>"Please wait while loading fonts...",
+wait_msg = TkLabel.new(base_frame,
+ :text=>"Please wait while loading fonts...",
:font=>"Helvetica 12 italic").pack
class Unicodeout_SampleFrame < TkFrame
@@ -72,10 +72,10 @@ class Unicodeout_SampleFrame < TkFrame
def add_sample(lang, *args)
sample_txt = Tk::UTF8_String(args.join(''))
- l = TkLabel.new(self, :font=>@@font, :text=>lang+':',
+ 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,
+ #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')
@@ -91,23 +91,23 @@ oldCursor = $unicodeout_demo.cursor
$unicodeout_demo.cursor('watch')
Tk.update
-f.add_sample('Arabic',
- '\uFE94\uFEF4\uFE91\uFEAE\uFECC\uFEDF\uFE8D\uFE94',
+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 ',
+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 ',
+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, ',
+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 ',
+f.add_sample('Russian',
+ '\u0420\u0443\u0441\u0441\u043A\u0438\u0439 ',
'\u044F\u0437\u044B\u043A')
wait_msg.destroy
diff --git a/ext/tk/sample/demos-en/widget b/ext/tk/sample/demos-en/widget
index 250c589116..9a0605d8b9 100644
--- a/ext/tk/sample/demos-en/widget
+++ b/ext/tk/sample/demos-en/widget
@@ -170,12 +170,9 @@ else
}
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')
+ 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.*/
@@ -1038,7 +1035,7 @@ end
#
def aboutBox
Tk.messageBox('icon'=>'info', 'type'=>'ok', 'title'=>'About Widget Demo',
- 'message'=>"Ruby/Tk widget demonstration Ver.1.7.1-en\n\n" +
+ 'message'=>"Ruby/Tk widget demonstration Ver.1.7.0-en\n\n" +
"based on demos of Tk8.1 -- 8.5 " +
"( Copyright of Tcl/Tk demos:: " +
"(c) 1996-1997 Sun Microsystems, Inc. / " +
diff --git a/ext/tk/sample/demos-jp/anilabel.rb b/ext/tk/sample/demos-jp/anilabel.rb
index d2f5b12041..aee57f9f6a 100644
--- a/ext/tk/sample/demos-jp/anilabel.rb
+++ b/ext/tk/sample/demos-jp/anilabel.rb
@@ -6,7 +6,7 @@
# toplevel widget ¸ߤк
if defined?($anilabel_demo) && $anilabel_demo
- $anilabel_demo.destroy
+ $anilabel_demo.destroy
$anilabel_demo = nil
end
@@ -50,7 +50,7 @@ TkFrame.new(base_frame) {|frame|
# 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',
+Tk.pack(f_left, f_right, 'side'=>'left', 'expand'=>'yes', 'fill'=>'both',
'padx'=>10, 'pady'=>10)
# animated label
@@ -88,7 +88,7 @@ class AnimatedImageLabel < AnimatedTextLabel
@btag.bind_append('Destroy'){
if @destroy_image
begin
- self.image.delete
+ self.image.delete
rescue
end
end
@@ -124,13 +124,13 @@ class AnimatedImageLabel < AnimatedTextLabel
end
# label
-l1 = AnimatedTextLabel.new(f_left, :borderwidth=>4, :relief=>:ridge,
+l1 = AnimatedTextLabel.new(f_left, :borderwidth=>4, :relief=>:ridge,
:font=>{:family=>'Courier', :size=>10})
-l2 = AnimatedTextLabel.new(f_left, :borderwidth=>4, :relief=>:groove,
+l2 = AnimatedTextLabel.new(f_left, :borderwidth=>4, :relief=>:groove,
:font=>{:family=>'Courier', :size=>10})
-l3 = AnimatedTextLabel.new(f_left, :borderwidth=>4, :relief=>:flat,
+l3 = AnimatedTextLabel.new(f_left, :borderwidth=>4, :relief=>:flat,
:font=>{:family=>'Courier', :size=>10}, :width=>18)
-Tk.pack(l1, l2, l3,
+Tk.pack(l1, l2, l3,
:side=>:top, :expand=>true, :anchor=>:w, :padx=>10, :pady=>10)
limg = AnimatedImageLabel.new(f_right, :borderwidth=>0)
diff --git a/ext/tk/sample/demos-jp/aniwave.rb b/ext/tk/sample/demos-jp/aniwave.rb
index 973c1be1e9..8fa14f65fe 100644
--- a/ext/tk/sample/demos-jp/aniwave.rb
+++ b/ext/tk/sample/demos-jp/aniwave.rb
@@ -6,7 +6,7 @@
# destroy toplevel widget for this demo script
if defined?($aniwave_demo) && $aniwave_demo
- $aniwave_demo.destroy
+ $aniwave_demo.destroy
$aniwave_demo = nil
end
@@ -53,11 +53,11 @@ class AnimatedWaveDemo
@direction = dir
# create canvas widget
- @c = TkCanvas.new(frame, :width=>300, :height=>200,
+ @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.
+ # Creates a coordinates list of a wave.
@waveCoords = []
@backupCoords = []
n = 0
@@ -69,10 +69,10 @@ class AnimatedWaveDemo
# Create a smoothed line and arrange for its coordinates to be the
# contents of the variable waveCoords.
- @line = TkcLine.new(@c, @waveCoords,
+ @line = TkcLine.new(@c, @waveCoords,
:width=>1, :fill=>'green', :smooth=>true)
- # Main animation "loop".
+ # Main animation "loop".
# Theoretically 100 frames-per-second (==10ms between frames)
@timer = TkTimer.new(10){ basicMotion; reverser }
diff --git a/ext/tk/sample/demos-jp/arrow.rb b/ext/tk/sample/demos-jp/arrow.rb
index a1694d019d..3c49e67b09 100644
--- a/ext/tk/sample/demos-jp/arrow.rb
+++ b/ext/tk/sample/demos-jp/arrow.rb
@@ -25,65 +25,65 @@ def arrowSetup(c)
# 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'
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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
+ # 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,
+ 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,
+ 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,
+ 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,
+ 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',
+ TkcText.new(c, v.x1, 310, 'text'=>"'width'=>#{v.width}", 'anchor'=>'w',
'font'=>'-*-Helvetica-Medium-R-Normal--*-180-*-*-*-*-*-*')
- TkcText.new(c, v.x1, 330,
+ 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',
+ TkcText.new(c, v.x1, 310, 'text'=>"'width'=>#{v.width}", 'anchor'=>'w',
'font'=>'Helvetica 18')
- TkcText.new(c, v.x1, 330,
+ TkcText.new(c, v.x1, 330,
'text'=>"'arrowshape'=>[#{v.a}, #{v.b}, #{v.c}]",
'anchor'=>'w', 'font'=>'Helvetica 18')
end
@@ -93,7 +93,7 @@ end
# toplevel widget ¸ߤк
if defined?($arrow_demo) && $arrow_demo
- $arrow_demo.destroy
+ $arrow_demo.destroy
$arrow_demo = nil
end
@@ -107,7 +107,7 @@ $arrow_demo = TkToplevel.new {|w|
base_frame = TkFrame.new($arrow_demo).pack(:fill=>:both, :expand=>true)
# label
-TkLabel.new(base_frame, 'font'=>$font, 'wraplength'=>'5i', 'justify'=>'left',
+TkLabel.new(base_frame, 'font'=>$font, 'wraplength'=>'5i', 'justify'=>'left',
'text'=>" widget ǡХǻȤ饤ˤĤ͡ƬηƤߤ뤳ȤǤޤηѤˤϡ礵줿ˤĤƤ 3ĤλͳѤɥåƤ¦̤礭ǤΥץ򼨤ƤޤΥƥȤϥ饤󥢥ƥФꥪץǤ"){
pack('side'=>'top')
}
@@ -132,14 +132,14 @@ $arrow_buttons = TkFrame.new(base_frame) {|frame|
$arrow_buttons.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
# canvas
-$arrow_canvas = TkCanvas.new(base_frame, 'width'=>500, 'height'=>350,
+$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,
+ $demo_arrowInfo = Struct.new("ArrowInfo", :a, :b, :c, :width, :motionProc,
+ :x1, :x2, :y, :smallTips, :count,
:bigLineStyle, :boxStyle, :activeStyle).new
end
$demo_arrowInfo.a = 8
@@ -157,7 +157,7 @@ if TkWinfo.depth($arrow_canvas) > 1
$demo_arrowInfo.boxStyle = {'fill'=>'', 'outline'=>'black', 'width'=>1}
$demo_arrowInfo.activeStyle = {'fill'=>'red', 'outline'=>'black', 'width'=>1}
else
- $demo_arrowInfo.bigLineStyle = {'fill'=>'black',
+ $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}
@@ -168,16 +168,16 @@ $arrowTag_box.bind('Enter', proc{$arrow_canvas.itemconfigure('current', $demo_ar
$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',
+$arrow_canvas.itembind('box1', '1',
proc{$demo_arrowInfo.motionProc \
= proc{|x,y| arrowMove1 $arrow_canvas, x, y}})
-$arrow_canvas.itembind('box2', '1',
+$arrow_canvas.itembind('box2', '1',
proc{$demo_arrowInfo.motionProc \
= proc{|x,y| arrowMove2 $arrow_canvas, x, y}})
-$arrow_canvas.itembind('box3', '1',
+$arrow_canvas.itembind('box3', '1',
proc{$demo_arrowInfo.motionProc \
= proc{|x,y| arrowMove3 $arrow_canvas, x, y}})
-$arrowTag_box.bind('B1-Motion',
+$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})
diff --git a/ext/tk/sample/demos-jp/bind.rb b/ext/tk/sample/demos-jp/bind.rb
index 99e5c1718c..a1bcfdd2e7 100644
--- a/ext/tk/sample/demos-jp/bind.rb
+++ b/ext/tk/sample/demos-jp/bind.rb
@@ -5,7 +5,7 @@
# toplevel widget ¸ߤк
if defined?($bind_demo) && $bind_demo
- $bind_demo.destroy
+ $bind_demo.destroy
$bind_demo = nil
end
@@ -59,7 +59,7 @@ txt = TkText.new(base_frame){|t|
#
if TkWinfo.depth($root).to_i > 1
- tagstyle_bold = {'background'=>'#43ce80', 'relief'=>'raised',
+ tagstyle_bold = {'background'=>'#43ce80', 'relief'=>'raised',
'borderwidth'=>1}
tagstyle_normal = {'background'=>'', 'relief'=>'flat'}
else
@@ -75,44 +75,44 @@ txt = TkText.new(base_frame){|t|
insert('end', "\n\n")
insert('end', '2. ñ 2ΥץåȡǡɽưȤǤ롣', (d2 = TkTextTag.new(t)) )
insert('end', "\n\n")
- insert('end', '3. ƥȥƥΥ󥫡ȹ·',
+ insert('end', '3. ƥȥƥΥ󥫡ȹ·',
(d3 = TkTextTag.new(t)) )
insert('end', "\n\n")
- insert('end', '4. 饤󥢥ƥΤƬηΥǥ',
+ insert('end', '4. 饤󥢥ƥΤƬηΥǥ',
(d4 = TkTextTag.new(t)) )
insert('end', "\n\n")
- insert('end', '5. ֥ȥåפѹ뤿εǽĤΥ롼顼',
+ insert('end', '5. ֥ȥåפѹ뤿εǽĤΥ롼顼',
(d5 = TkTextTag.new(t)) )
insert('end', "\n\n")
- insert('end',
- '6. Хɤäƥ뤹Τ򼨤åɡ',
+ 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',
+ d1.bind('1',
proc{
eval_samplecode(`cat #{[$demo_dir,'items.rb'].join(File::Separator)}`, 'items.rb')
})
- d2.bind('1',
+ d2.bind('1',
proc{
eval_samplecode(`cat #{[$demo_dir,'plot.rb'].join(File::Separator)}`, 'plot.rb')
})
- d3.bind('1',
+ d3.bind('1',
proc{
eval_samplecode(`cat #{[$demo_dir,'ctext.rb'].join(File::Separator)}`, 'ctext.rb')
})
- d4.bind('1',
+ d4.bind('1',
proc{
eval_samplecode(`cat #{[$demo_dir,'arrow.rb'].join(File::Separator)}`, 'arrow.rb')
})
- d5.bind('1',
+ d5.bind('1',
proc{
eval_samplecode(`cat #{[$demo_dir,'ruler.rb'].join(File::Separator)}`, 'ruler.rb')
})
- d6.bind('1',
+ d6.bind('1',
proc{
eval_samplecode(`cat #{[$demo_dir,'cscroll.rb'].join(File::Separator)}`, 'cscroll.rb')
})
diff --git a/ext/tk/sample/demos-jp/bitmap.rb b/ext/tk/sample/demos-jp/bitmap.rb
index 1193e8de24..b6b0e54bbe 100644
--- a/ext/tk/sample/demos-jp/bitmap.rb
+++ b/ext/tk/sample/demos-jp/bitmap.rb
@@ -15,7 +15,7 @@
def bitmapRow(w,*args)
TkFrame.new(w){|row|
pack('side'=>'top', 'fill'=>'both')
- for bitmap in args
+ 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')
@@ -27,7 +27,7 @@ end
# toplevel widget ¸ߤк
if defined?($bitmap_demo) && $bitmap_demo
- $bitmap_demo.destroy
+ $bitmap_demo.destroy
$bitmap_demo = nil
end
@@ -41,7 +41,7 @@ $bitmap_demo = TkToplevel.new {|w|
base_frame = TkFrame.new($bitmap_demo).pack(:fill=>:both, :expand=>true)
# label
-TkLabel.new(base_frame,'font'=>$font,'wraplength'=>'4i','justify'=>'left',
+TkLabel.new(base_frame,'font'=>$font,'wraplength'=>'4i','justify'=>'left',
'text'=>"ΥɥˤϡTk Ȥ߹ޤ줿٤ƤΥӥåȥޥåפ̾ȶɽƤޤTcl ΥץǤϡ줾̾ѤƻȤޤ"){
pack('side'=>'top')
}
diff --git a/ext/tk/sample/demos-jp/button.rb b/ext/tk/sample/demos-jp/button.rb
index 87ced45810..18e42008c9 100644
--- a/ext/tk/sample/demos-jp/button.rb
+++ b/ext/tk/sample/demos-jp/button.rb
@@ -6,7 +6,7 @@
# toplevel widget ¸ߤк
if defined?($button_demo) && $button_demo
- $button_demo.destroy
+ $button_demo.destroy
$button_demo = nil
end
diff --git a/ext/tk/sample/demos-jp/check.rb b/ext/tk/sample/demos-jp/check.rb
index 762b99778b..b953e7f623 100644
--- a/ext/tk/sample/demos-jp/check.rb
+++ b/ext/tk/sample/demos-jp/check.rb
@@ -5,7 +5,7 @@
# toplevel widget ¸ߤк
if defined?($check_demo) && $check_demo
- $check_demo.destroy
+ $check_demo.destroy
$check_demo = nil
end
@@ -54,7 +54,7 @@ TkFrame.new(base_frame) {|frame|
TkButton.new(frame) {
text 'ѿ'
command proc{
- showVars(base_frame,
+ showVars(base_frame,
['wipers', wipers], ['brakes', brakes], ['sober', sober])
}
}.pack('side'=>'left', 'expand'=>'yes')
diff --git a/ext/tk/sample/demos-jp/check2.rb b/ext/tk/sample/demos-jp/check2.rb
index 9f845183f3..7f7cb9e932 100644
--- a/ext/tk/sample/demos-jp/check2.rb
+++ b/ext/tk/sample/demos-jp/check2.rb
@@ -5,7 +5,7 @@
# toplevel widget ¸ߤк
if defined?($check2_demo) && $check2_demo
- $check2_demo.destroy
+ $check2_demo.destroy
$check2_demo = nil
end
@@ -35,35 +35,35 @@ sober = TkVariable.new(0)
# frame
TkFrame.new(base_frame) {|frame|
- TkGrid(TkFrame.new(frame, :height=>2, :relief=>:sunken, :bd=>2),
+ 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,
+ TkGrid('x',
+ TkButton.new(frame, :text=>'ѿ',
+ :image=>$image['view'], :compound=>:left,
:command=>proc{
- showVars($check2_demo,
- ['safety', safety], ['wipers', wipers],
+ 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,
+ }),
+ 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',
+TkCheckButton.new(base_frame, :text=>'', :variable=>safety,
+ :relief=>:flat, :onvalue=>'all', :offvalue=>'none',
:tristatevalue=>'partial'){
pack('side'=>'top', 'pady'=>2, 'anchor'=>'w')
}
@@ -71,7 +71,7 @@ TkCheckButton.new(base_frame, :text=>'', :variable=>safety,
[ 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|
+].each{|w|
w.relief('flat')
w.pack('side'=>'top', 'padx'=>15, 'pady'=>2, 'anchor'=>'w')
}
diff --git a/ext/tk/sample/demos-jp/clrpick.rb b/ext/tk/sample/demos-jp/clrpick.rb
index c188723c5a..ce6b99ab94 100644
--- a/ext/tk/sample/demos-jp/clrpick.rb
+++ b/ext/tk/sample/demos-jp/clrpick.rb
@@ -7,7 +7,7 @@
# toplevel widget ¸ߤк
if defined?($clrpick_demo) && $clrpick_demo
- $clrpick_demo.destroy
+ $clrpick_demo.destroy
$clrpick_demo = nil
end
@@ -47,7 +47,7 @@ Tk::Frame.new($clrpick_demo) {|frame|
# button
# TkButton.new($clrpick_demo, 'text'=>'طʿ ...') {|b|
Tk::Button.new($clrpick_demo, 'text'=>'طʿ ...') {|b|
- command(proc{setColor $clrpick_demo, b, 'background',
+ command(proc{setColor $clrpick_demo, b, 'background',
['background', 'highlightbackground']})
pack('side'=>'top', 'anchor'=>'c', 'pady'=>'2m')
}
@@ -61,7 +61,7 @@ Tk::Button.new($clrpick_demo, 'text'=>'ʿ ...') {|b|
def setColor(w,button,name,options)
w.grab
initialColor = button[name]
- color = Tk.chooseColor('title'=>"Choose a #{name} color", 'parent'=>w,
+ color = Tk.chooseColor('title'=>"Choose a #{name} color", 'parent'=>w,
'initialcolor'=>initialColor)
if color != ""
setColor_helper(w,options,color)
diff --git a/ext/tk/sample/demos-jp/colors.rb b/ext/tk/sample/demos-jp/colors.rb
index 9fcf0333b5..91817a947b 100644
--- a/ext/tk/sample/demos-jp/colors.rb
+++ b/ext/tk/sample/demos-jp/colors.rb
@@ -5,7 +5,7 @@
# toplevel widget ¸ߤк
if defined?($colors_demo) && $colors_demo
- $colors_demo.destroy
+ $colors_demo.destroy
$colors_demo = nil
end
diff --git a/ext/tk/sample/demos-jp/combo.rb b/ext/tk/sample/demos-jp/combo.rb
index 2059662d48..da00d712ba 100644
--- a/ext/tk/sample/demos-jp/combo.rb
+++ b/ext/tk/sample/demos-jp/combo.rb
@@ -7,7 +7,7 @@
# 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.destroy
$combo_demo = nil
end
@@ -19,7 +19,7 @@ $combo_demo = TkToplevel.new {|w|
base_frame = TkFrame.new($combo_demo).pack(:fill=>:both, :expand=>true)
-Ttk::Label.new(base_frame, :font=>$font, :wraplength=>'5i', :justify=>:left,
+Ttk::Label.new(base_frame, :font=>$font, :wraplength=>'5i', :justify=>:left,
:text=><<EOL).pack(:side=>:top, :fill=>:x)
ʲǤ3ΥܥܥåɽƤޤ\
ǽΤΤϡȥꥦåȤƱͤˡ\
@@ -42,24 +42,24 @@ ozCity = TkVariable.new
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,
+ TkGrid('x',
+ Ttk::Button.new(frame, :text=>'ѿ',
+ :image=>$image['view'], :compound=>:left,
:command=>proc{
- showVars(base_frame,
- ['firstVariable', firstValue],
- ['secondVariable', secondValue],
+ 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,
+ }),
+ 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)
@@ -68,7 +68,7 @@ Ttk::Frame.new(base_frame) {|frame|
frame = Ttk::Frame.new(base_frame).pack(:fill=>:both, :expand=>true)
australianCities = [
- '٥', 'ɥˡ', 'ܥ', 'ѡ', 'ǥ졼',
+ '٥', 'ɥˡ', 'ܥ', 'ѡ', 'ǥ졼',
'֥ꥹ١', 'ۥС', '', 'ꥹ ץ󥰥'
]
@@ -82,17 +82,17 @@ Tk.pack(Ttk::Labelframe.new(frame, :text=>'Fully Editable'){|f|
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,
+ 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
index 0a31f28b5e..845952679a 100644
--- a/ext/tk/sample/demos-jp/cscroll.rb
+++ b/ext/tk/sample/demos-jp/cscroll.rb
@@ -5,7 +5,7 @@
# toplevel widget ¸ߤк
if defined?($cscroll_demo) && $cscroll_demo
- $cscroll_demo.destroy
+ $cscroll_demo.destroy
$cscroll_demo = nil
end
@@ -19,7 +19,7 @@ $cscroll_demo = TkToplevel.new {|w|
base_frame = TkFrame.new($cscroll_demo).pack(:fill=>:both, :expand=>true)
# label
-TkLabel.new(base_frame, 'font'=>$font, 'wraplength'=>'4i',
+TkLabel.new(base_frame, 'font'=>$font, 'wraplength'=>'4i',
'justify'=>'left', 'text'=>"ΥɥˤϥСޥΥܥ2 ǥǤ륭Х widget ɽƤޤͳѤξǥܥ1 򥯥åȡΥǥåɸϤ˽Ϥޤ"){
pack('side'=>'top')
}
@@ -53,14 +53,14 @@ unless $tk_version =~ /^4\.[01]/
end
# canvas
-$cscroll_canvas = TkCanvas.new(base_frame,
+$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')
+ pack('expand'=>'yes', 'fill'=>'both')
else
- grid('in'=>$cscroll_grid, 'padx'=>1, 'pady'=>1, 'row'=>0, 'column'=>0,
+ grid('in'=>$cscroll_grid, 'padx'=>1, 'pady'=>1, 'row'=>0, 'column'=>0,
'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news')
end
@@ -69,18 +69,18 @@ $cscroll_canvas = TkCanvas.new(base_frame,
if $tk_version =~ /^4\.[01]/
pack('side'=>'right', 'fill'=>'y')
else
- grid('in'=>$cscroll_grid, 'padx'=>1, 'pady'=>1, 'row'=>0, 'column'=>1,
+ 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',
+ 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')
+ pack('side'=>'bottom', 'fill'=>'x')
else
- grid('in'=>$cscroll_grid, 'padx'=>1, 'pady'=>1, 'row'=>1, 'column'=>0,
+ grid('in'=>$cscroll_grid, 'padx'=>1, 'pady'=>1, 'row'=>1, 'column'=>0,
'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news')
end
}
@@ -91,9 +91,9 @@ bg = $cscroll_canvas.configinfo('bg')[4]
x = -10+3*i
y = -10
(0..9).each{|j|
- TkcRectangle.new($cscroll_canvas, "#{x}c", "#{y}c", "#{x+2}c", "#{y+2}c",
+ 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",
+ TkcText.new($cscroll_canvas, "#{x+1}c", "#{y+1}c",
'text'=>"#{i},#{j}", 'anchor'=>'center', 'tags'=>'text')
y += 3
}
@@ -104,7 +104,7 @@ $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',
+$cscroll_canvas.bind('B2-Motion',
proc{|x,y| $cscroll_canvas.scan_dragto(x,y)}, '%x %y')
def scrollEnter(c)
diff --git a/ext/tk/sample/demos-jp/ctext.rb b/ext/tk/sample/demos-jp/ctext.rb
index 70c1cad1a7..05ca732cfd 100644
--- a/ext/tk/sample/demos-jp/ctext.rb
+++ b/ext/tk/sample/demos-jp/ctext.rb
@@ -5,7 +5,7 @@
# toplevel widget ¸ߤк
if defined?($ctext_demo) && $ctext_demo
- $ctext_demo.destroy
+ $ctext_demo.destroy
$ctext_demo = nil
end
@@ -19,7 +19,7 @@ $ctext_demo = TkToplevel.new {|w|
base_frame = TkFrame.new($ctext_demo).pack(:fill=>:both, :expand=>true)
# label
-TkLabel.new(base_frame, 'font'=>$font, 'wraplength'=>'5i', 'justify'=>'left',
+TkLabel.new(base_frame, 'font'=>$font, 'wraplength'=>'5i', 'justify'=>'left',
'text'=>"ΥɥˤϥХwidgetΥƥȵǽǥ⤹뤿ΥƥʸɽƤޤޥͳѤ˻äƤåȰ֤Ѥа֤Ѥꡢ·Ѥꤹ뤳ȤǤޤޤʲΤ褦ԽΤδñʥХǥ󥰤򥵥ݡȤƤޤ
1. ޥäƤåϤǤޤ
@@ -50,7 +50,7 @@ $ctext_buttons = TkFrame.new(base_frame) {|frame|
$ctext_buttons.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
# canvas
-$ctext_canvas = TkCanvas.new(base_frame, 'relief'=>'flat',
+$ctext_canvas = TkCanvas.new(base_frame, 'relief'=>'flat',
'borderwidth'=>0, 'width'=>500, 'height'=>350)
$ctext_canvas.pack('side'=>'top', 'expand'=>'yes', 'fill'=>'both')
@@ -62,7 +62,7 @@ else
end
# canvas
-TkcRectangle.new($ctext_canvas, 245, 195, 255, 205,
+TkcRectangle.new($ctext_canvas, 245, 195, 255, 205,
'outline'=>'black', 'fill'=>'red')
ctag_text_param = {
@@ -80,24 +80,24 @@ $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}"},
+$ctag_text.bind('Shift-1',
+ proc{|x,y| $ctext_canvas.seleect_adjust 'current', "@#{x},#{y}"},
"%x %y")
-$ctag_text.bind('Shift-B1-Motion',
+$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}"},
+$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
+# 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,
+ 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)
@@ -115,15 +115,15 @@ 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,
+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-*-*-*-*-*-*',
+ 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',
+ TkcText.new($ctext_canvas, x+45, y-5, 'text'=>'Text Position',
'font'=>'Times 24', 'anchor'=>'s', 'fill'=>'brown')
end
@@ -137,18 +137,18 @@ 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-*-*-*-*-*-*',
+ 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',
+ 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',
+$ctext_canvas.itembind('config', 'Leave',
proc{$ctext_canvas\
- .itemconfigure('current',
+ .itemconfigure('current',
'fill'=>$textConfigFill)})
$textConfigFill = ''
diff --git a/ext/tk/sample/demos-jp/entry1.rb b/ext/tk/sample/demos-jp/entry1.rb
index eb71e87aec..2be29c18d3 100644
--- a/ext/tk/sample/demos-jp/entry1.rb
+++ b/ext/tk/sample/demos-jp/entry1.rb
@@ -5,7 +5,7 @@
# toplevel widget ¸ߤк
if defined?($entry1_demo) && $entry1_demo
- $entry1_demo.destroy
+ $entry1_demo.destroy
$entry1_demo = nil
end
diff --git a/ext/tk/sample/demos-jp/entry2.rb b/ext/tk/sample/demos-jp/entry2.rb
index b5187ab508..2675b5d324 100644
--- a/ext/tk/sample/demos-jp/entry2.rb
+++ b/ext/tk/sample/demos-jp/entry2.rb
@@ -5,7 +5,7 @@
# toplevel widget ¸ߤк
if defined?($entry2_demo) && $entry2_demo
- $entry2_demo.destroy
+ $entry2_demo.destroy
$entry2_demo = nil
end
diff --git a/ext/tk/sample/demos-jp/entry3.rb b/ext/tk/sample/demos-jp/entry3.rb
index 2728de0b93..6b9cd4cf37 100644
--- a/ext/tk/sample/demos-jp/entry3.rb
+++ b/ext/tk/sample/demos-jp/entry3.rb
@@ -8,7 +8,7 @@
# based on Tcl/Tk8.4.4 widget demos
if defined?($entry3_demo) && $entry3_demo
- $entry3_demo.destroy
+ $entry3_demo.destroy
$entry3_demo = nil
end
@@ -20,8 +20,8 @@ $entry3_demo = TkToplevel.new {|w|
base_frame = TkFrame.new($entry3_demo).pack(:fill=>:both, :expand=>true)
-TkLabel.new(base_frame,
- :font=>$font, :wraplength=>'5i', :justify=>:left,
+TkLabel.new(base_frame,
+ :font=>$font, :wraplength=>'5i', :justify=>:left,
:text=><<EOL).pack(:side=>:top)
ʲˤϣΥȥܥåɽƤޤƥȥܥåϡ\
ޥåʸǤळȤǽǤ줾줬ɤΤ褦\
@@ -68,20 +68,20 @@ TkFrame.new(base_frame){|f|
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)},
+ 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',
+ 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,
+ widget.configure(:foreground=>fg,
:background=>bg)
rescue
# ignore
@@ -91,7 +91,7 @@ def focusAndFlash(widget, fg, bg, count=5)
end
l1 = TkLabelFrame.new(base_frame, :text=>"ȥ")
-TkEntry.new(l1, :validate=>:focus,
+TkEntry.new(l1, :validate=>:focus,
:vcmd=>[
proc{|s| s == '' || /^[+-]?\d+$/ =~ s }, '%P'
]) {|e|
@@ -102,7 +102,7 @@ TkEntry.new(l1, :validate=>:focus,
}
l2 = TkLabelFrame.new(base_frame, :text=>"Ĺդȥ")
-TkEntry.new(l2, :validate=>:key, :invcmd=>proc{Tk.bell},
+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')
@@ -176,7 +176,7 @@ end
def validatePhoneChange(widget, vmode, idx, char)
return true if idx == nil
- Tk.after_idle(proc{widget.configure(:validate=>vmode,
+ 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)
@@ -191,10 +191,10 @@ end
l3 = TkLabelFrame.new(base_frame, :text=>"ƹֹ楨ȥ")
-TkEntry.new(l3, :validate=>:key, :invcmd=>proc{Tk.bell},
- :textvariable=>entry3content,
+TkEntry.new(l3, :validate=>:key, :invcmd=>proc{Tk.bell},
+ :textvariable=>entry3content,
:vcmd=>[
- proc{|w,v,i,s| validatePhoneChange(w,v,i,s)},
+ proc{|w,v,i,s| validatePhoneChange(w,v,i,s)},
"%W %v %i %S"
]){|e|
# Click to focus goes to the first editable character...
@@ -210,9 +210,9 @@ TkEntry.new(l3, :validate=>:key, :invcmd=>proc{Tk.bell},
}
l4 = TkLabelFrame.new(base_frame, :text=>"ѥɥȥ")
-TkEntry.new(l4, :validate=>:key, :show=>'*',
+TkEntry.new(l4, :validate=>:key, :show=>'*',
:vcmd=>[
- proc{|s| s.length <= 8},
+ proc{|s| s.length <= 8},
'%P'
]).pack(:fill=>:x, :expand=>true, :padx=>'1m', :pady=>'1m')
diff --git a/ext/tk/sample/demos-jp/filebox.rb b/ext/tk/sample/demos-jp/filebox.rb
index ffe5fbc5c6..b8846d08a0 100644
--- a/ext/tk/sample/demos-jp/filebox.rb
+++ b/ext/tk/sample/demos-jp/filebox.rb
@@ -5,7 +5,7 @@
# toplevel widget ¸ߤк
if defined?($filebox_demo) && $entry2_demo
- $filebox_demo.destroy
+ $filebox_demo.destroy
$filebox_demo = nil
end
@@ -49,7 +49,7 @@ TkFrame.new(base_frame) {|frame|
TkEntry.new(f, 'width'=>20) {|e|
pack('side'=>'left', 'expand'=>'yes', 'fill'=>'x')
- TkButton.new(f, 'text'=>'Browse ...',
+ TkButton.new(f, 'text'=>'Browse ...',
'command'=>proc{fileDialog base_frame,e,type})\
.pack('side'=>'left')
}
@@ -60,9 +60,9 @@ TkFrame.new(base_frame) {|frame|
$tk_strictMotif = TkVarAccess.new('tk_strictMotif')
if ($tk_platform['platform'] == 'unix')
- TkCheckButton.new(base_frame,
- 'text'=>'MotifΥѤ',
- 'variable'=>$tk_strictMotif,
+ TkCheckButton.new(base_frame,
+ 'text'=>'MotifΥѤ',
+ 'variable'=>$tk_strictMotif,
'onvalue'=>1, 'offvalue'=>0 ).pack('anchor'=>'c')
end
@@ -71,23 +71,23 @@ def fileDialog(w,ent,operation)
#
#--------------------------------------------------------
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']],
+ ['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',
+ file = Tk.getSaveFile('filetypes'=>types, 'parent'=>w,
+ 'initialfile'=>'Untitled',
'defaultextension'=>'.txt')
end
if file != ""
diff --git a/ext/tk/sample/demos-jp/floor.rb b/ext/tk/sample/demos-jp/floor.rb
index 78cc23a245..a2ec2e9969 100644
--- a/ext/tk/sample/demos-jp/floor.rb
+++ b/ext/tk/sample/demos-jp/floor.rb
@@ -18,7 +18,7 @@ def floorDisplay(w,active)
w.delete('all')
$activeFloor = active
- # First go through the three floors, displaying the backgrounds for
+ # First go through the three floors, displaying the backgrounds for
# each floor.
floor_bg1(w,$floor_colors['bg1'],$floor_colors['outline1'])
@@ -29,12 +29,12 @@ def floorDisplay(w,active)
w.raise("floor#{active}")
- # Create a dummy item just to mark this point in the display list,
+ # 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
+ # 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.
@@ -299,7 +299,7 @@ def floor_bg3(w,fill,outline)
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,
+ TkcLine.new(w,107,300,159,300,159,248,107,248,107,300,
'fill'=>outline, 'tags'=>['floor3','bg'])
end
@@ -313,316 +313,316 @@ end
# 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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'])
@@ -795,321 +795,321 @@ end
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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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'])
@@ -1280,206 +1280,206 @@ def floor_fg3(w,color)
'fill'=>'', 'tags'=>['floor3','room'])
$floorLabels[i.id] = '316'
$floorItems['316'] = i
- TkcText.new(w,79.5,204, 'text'=>'316', 'fill'=>color,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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'])
@@ -1574,7 +1574,7 @@ end
# toplevel widget ¸ߤк
if defined?($floor_demo) && $floor_demo
- $floor_demo.destroy
+ $floor_demo.destroy
$floor_demo = nil
end
@@ -1590,7 +1590,7 @@ $floor_demo = TkToplevel.new {|w|
base_frame = TkFrame.new($floor_demo).pack(:fill=>:both, :expand=>true)
# label
-TkLabel.new(base_frame, 'font'=>$font, 'wraplength'=>'8i', 'justify'=>'left',
+TkLabel.new(base_frame, 'font'=>$font, 'wraplength'=>'8i', 'justify'=>'left',
'text'=>"Υɥˤϥǥ륨åץȼҤΥꥵܥȥ (DECWRL) δּ꤬񤫤줿Х widget äƤޤ 3ƤǡˤΤ1ʬ򡢤Ĥޤꤽδּ꤬ɽ褦ˤʤäƤޤ볬򤹤ˤϡξǥޥκܥ򥯥åƤޥ򤵤Ƥ볬ξưȡβˤοѤꡢֹ椬ֹ:ץȥɽޤޤȥֹ񤯤ȤοѤޤ"){
pack('side'=>'top')
}
@@ -1622,10 +1622,10 @@ $floorItems = {}
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,
+ $floor_canvas = TkCanvas.new($floor_canvas_frame,
+ 'width'=>900, 'height'=>500, 'borderwidth'=>0,
'highlightthickness'=>0) {|c|
- TkScrollbar.new(base_frame, 'orient'=>'horiz',
+ 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')
@@ -1646,20 +1646,20 @@ else
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,
+ $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,
+ 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,
+ 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,
+ h.grid('padx'=>1, 'pady'=>1, 'row'=>1, 'column'=>0,
'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news')
TkGrid.rowconfigure(f, 0, 'weight'=>1, 'minsize'=>0)
@@ -1676,7 +1676,7 @@ end
# Create an entry for displaying and typing in current room.
$currentRoom = TkVariable.new
-$floor_entry = TkEntry.new($floor_canvas, 'width'=>10, 'relief'=>'sunken',
+$floor_entry = TkEntry.new($floor_canvas, 'width'=>10, 'relief'=>'sunken',
'bd'=>2, 'textvariable'=>$currentRoom)
# Choose colors, then fill in the floorplan.
@@ -1713,7 +1713,7 @@ $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',
+$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 = ''
diff --git a/ext/tk/sample/demos-jp/floor2.rb b/ext/tk/sample/demos-jp/floor2.rb
index 92ace6b51a..d4381c5543 100644
--- a/ext/tk/sample/demos-jp/floor2.rb
+++ b/ext/tk/sample/demos-jp/floor2.rb
@@ -18,7 +18,7 @@ def floorDisplay2(w,active)
w.delete('all')
$activeFloor2 = active
- # First go through the three floors, displaying the backgrounds for
+ # First go through the three floors, displaying the backgrounds for
# each floor.
floor2_bg1(w,$floor2_colors['bg1'],$floor2_colors['outline1'])
@@ -29,12 +29,12 @@ def floorDisplay2(w,active)
w.raise("floor#{active}")
- # Create a dummy item just to mark this point in the display list,
+ # 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
+ # 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.
@@ -299,7 +299,7 @@ def floor2_bg3(w,fill,outline)
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,
+ w.create(TkcLine,107,300,159,300,159,248,107,248,107,300,
'fill'=>outline, 'tags'=>['floor3','bg'])
end
@@ -313,316 +313,316 @@ end
# 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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'])
@@ -795,321 +795,321 @@ end
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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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'])
@@ -1280,206 +1280,206 @@ def floor2_fg3(w,color)
'fill'=>'', 'tags'=>['floor3','room'])
$floorLabels2[i.id] = '316'
$floorItems2['316'] = i
- w.create(TkcText,79.5,204, 'text'=>'316', 'fill'=>color,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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'])
@@ -1574,7 +1574,7 @@ end
# toplevel widget ¸ߤк
if defined?($floor2_demo) && $floor2_demo
- $floor2_demo.destroy
+ $floor2_demo.destroy
$floor2_demo = nil
end
@@ -1590,7 +1590,7 @@ $floor2_demo = TkToplevel.new {|w|
base_frame = TkFrame.new($floor2_demo).pack(:fill=>:both, :expand=>true)
# label
-TkLabel.new(base_frame, 'font'=>$font, 'wraplength'=>'8i', 'justify'=>'left',
+TkLabel.new(base_frame, 'font'=>$font, 'wraplength'=>'8i', 'justify'=>'left',
'text'=>"Υɥˤϥǥ륨åץȼҤΥꥵܥȥ (DECWRL) δּ꤬񤫤줿Х widget äƤޤ 3ƤǡˤΤ1ʬ򡢤Ĥޤꤽδּ꤬ɽ褦ˤʤäƤޤ볬򤹤ˤϡξǥޥκܥ򥯥åƤޥ򤵤Ƥ볬ξưȡβˤοѤꡢֹ椬ֹ:ץȥɽޤޤȥֹ񤯤ȤοѤޤ"){
pack('side'=>'top')
}
@@ -1622,10 +1622,10 @@ $floorItems2 = {}
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,
+ $floor2_canvas = TkCanvas.new($floor2_canvas_frame,
+ 'width'=>900, 'height'=>500, 'borderwidth'=>0,
'highlightthickness'=>0) {|c|
- TkScrollbar.new(base_frame, 'orient'=>'horiz',
+ 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')
@@ -1646,20 +1646,20 @@ else
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,
+ $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,
+ 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,
+ 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,
+ h.grid('padx'=>1, 'pady'=>1, 'row'=>1, 'column'=>0,
'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news')
TkGrid.rowconfigure(f, 0, 'weight'=>1, 'minsize'=>0)
@@ -1675,7 +1675,7 @@ end
# Create an entry for displaying and typing in current room.
$currentRoom2 = TkVariable.new
-$floor2_entry = TkEntry.new($floor2_canvas, 'width'=>10, 'relief'=>'sunken',
+$floor2_entry = TkEntry.new($floor2_canvas, 'width'=>10, 'relief'=>'sunken',
'bd'=>2, 'textvariable'=>$currentRoom2)
# Choose colors, then fill in the floorplan.
@@ -1712,7 +1712,7 @@ $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',
+$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 = ''
diff --git a/ext/tk/sample/demos-jp/form.rb b/ext/tk/sample/demos-jp/form.rb
index 84ed94de88..4de7056764 100644
--- a/ext/tk/sample/demos-jp/form.rb
+++ b/ext/tk/sample/demos-jp/form.rb
@@ -5,7 +5,7 @@
# toplevel widget ¸ߤк
if defined?($form_demo) && $form_demo
- $form_demo.destroy
+ $form_demo.destroy
$form_demo = nil
end
diff --git a/ext/tk/sample/demos-jp/goldberg.rb b/ext/tk/sample/demos-jp/goldberg.rb
index ea521b82ec..a81c7ec70c 100644
--- a/ext/tk/sample/demos-jp/goldberg.rb
+++ b/ext/tk/sample/demos-jp/goldberg.rb
@@ -44,7 +44,7 @@
#>># lots of canvas create and move calls.
if defined?($goldberg_demo) && $goldberg_demo
- $goldberg_demo.destroy
+ $goldberg_demo.destroy
$goldberg_demo = nil
end
@@ -103,7 +103,7 @@ class TkGoldberg_Demo
@S['pause'] = TkVariable.new
@S['details'] = TkVariable.new(true)
- @S['mode'] = TkVariable.new(:MSTART, :symbol)
+ @S['mode'] = TkVariable.new(:MSTART, :symbol)
# :MSTART, :MGO, :MPAUSE, :MSSTEP, :MBSTEP, :MDONE, :MDEBUG
# 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
@@ -134,19 +134,19 @@ class TkGoldberg_Demo
@XY = {}
@XY6 = {
- '-1'=>[366, 207], '-2'=>[349, 204], '-3'=>[359, 193], '-4'=>[375, 192],
+ '-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],
+ '-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]
}
@@ -163,11 +163,11 @@ class TkGoldberg_Demo
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,
+ @screen = TkFrame.new(@parent, :bd=>2,
+ :relief=>:raised).pack(:side=>:left, :fill=>:both,
:expand=>true)
- @canvas = TkCanvas.new(@parent, :width=>850, :height=>700,
+ @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)
@@ -206,8 +206,8 @@ class TkGoldberg_Demo
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},
+ # @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)
@@ -216,34 +216,34 @@ class TkGoldberg_Demo
end
def do_ctrl_frame
- @start = Tk::Button.new(@parent, :text=>'Start', :bd=>6,
+ @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,
+ @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,
+ @step = TkButton.new(@parent, :text=>'Single Step', :font=>font,
:command=>proc{do_button(2)})
- @bstep = TkButton.new(@parent, :text=>'Big Step', :font=>font,
+ @bstep = TkButton.new(@parent, :text=>'Big Step', :font=>font,
:command=>proc{do_button(4)})
- @reset = TkButton.new(@parent, :text=>'Reset', :font=>font,
+ @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,
+ @detail = TkCheckbutton.new(@parent, :text=>'Details', :font=>font,
:relief=>:raised, :variable=>@S['details'])
- @msg_entry = TkEntry.new(@parent, :textvariable=>@S['message'],
+ @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,
+ @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',
+ @about = TkButton.new(@parent, :text=>'About',
:command=>proc{about}, :font=>font)
Tk.grid(@start, :in=>@ctrl, :row=>0, :sticky=>:ew)
@@ -271,17 +271,17 @@ class TkGoldberg_Demo
def do_detail_frame
@f_details = TkFrame.new(@details)
- @label = TkLabel.new(@f_details, :textvariable=>@S['cnt'],
+ @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,
+ 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),
+ 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
@@ -385,7 +385,7 @@ class TkGoldberg_Demo
who = who.to_i
n = send("move#{who}")
if (n & 1).nonzero? # This guy still alive
- alive << who
+ alive << who
end
if (n & 2).nonzero? # Next guy is active
alive << (who + 1)
@@ -418,12 +418,12 @@ class TkGoldberg_Demo
# START HERE! banner
def draw0
color = @C['0']
- TkcText.new(@canvas,
- # [579, 119], :text=>'START HERE!',
- [558, 119], :text=>'饹ȡ',
- :fill=>color, :anchor=>:w,
+ 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,
+ 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
@@ -437,7 +437,7 @@ class TkGoldberg_Demo
end
pos = [
- [673, 119], [678, 119], [683, 119], [688, 119],
+ [673, 119], [678, 119], [683, 119], [688, 119],
[693, 119], [688, 119], [683, 119], [678, 119]
]
step = step % pos.length
@@ -449,15 +449,15 @@ class TkGoldberg_Demo
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 ],
+ 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 ],
+ 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),
+ TkcOval.new(@canvas, box(812, 122, 9),
:tag=>'I1', :fill=>color2, :outline=>'')
@canvas.itembind('I1', '1'){ start }
@@ -466,9 +466,9 @@ class TkGoldberg_Demo
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],
+ [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
@@ -484,40 +484,40 @@ class TkGoldberg_Demo
color = @C['2']
# Fulcrum
- TkcPolygon.new(@canvas, [750, 369, 740, 392, 760, 392],
+ TkcPolygon.new(@canvas, [750, 369, 740, 392, 760, 392],
:fill=>@C['fg'], :outline=>@C['fg'])
# Strike box
- TkcRectangle.new(@canvas, [628, 335, 660, 383],
+ 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',
+ TkcBitmap.new(@canvas, [628, yy], :bitmap=>'gray25',
:anchor=>:nw, :foreground=>@C['fg'])
- TkcBitmap.new(@canvas, [644, yy], :bitmap=>'gray25',
+ TkcBitmap.new(@canvas, [644, yy], :bitmap=>'gray25',
:anchor=>:nw, :foreground=>@C['fg'])
}
# Lever
- TkcLine.new(@canvas, [702, 366, 798, 366],
+ TkcLine.new(@canvas, [702, 366, 798, 366],
:fill=>@C['fg'], :width=>6, :tag=>'I2_0')
# R strap
- TkcLine.new(@canvas, [712, 363, 712, 355],
+ TkcLine.new(@canvas, [712, 363, 712, 355],
:fill=>@C['fg'], :width=>3, :tag=>'I2_1')
# L strap
- TkcLine.new(@canvas, [705, 363, 705, 355],
+ 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],
+ 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 ],
+ 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
@@ -527,15 +527,15 @@ class TkGoldberg_Demo
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,
+ 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,
+ 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,
+ 686, 331, 704, 322, 688, 300, 678, 283, 678, 283, 674, 298,
666, 309, 660, 324, 672, 336
]
@@ -546,7 +546,7 @@ class TkGoldberg_Demo
if step == 0 # Rotate the match
beta = 20
-
+
ox, oy = anchor('I2_0', :s) # Where to pivot
i = 0
@@ -571,23 +571,23 @@ class TkGoldberg_Demo
xy = [ [602, 296], [577, 174], [518, 174] ]
xy.each{|x, y| # 3 Pulleys
- TkcOval.new(@canvas, box(x, y, 13),
+ 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',
+ 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',
+ 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',
+ 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',
+ TkcLine.new(@canvas, [589, 296, 589, 235], :tag=>'I3_2',
:width=>3, :fill=>@C['fg'])
# Pulley 1 other half to 2
@@ -597,26 +597,26 @@ class TkGoldberg_Demo
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',
+ 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),
+ TkcOval.new(@canvas, box(x1, y1, 6),
:tag=>'I3_', :fill=>color2, :outline=>color2)
- TkcOval.new(@canvas, box(x2, y2, 6),
+ TkcOval.new(@canvas, box(x2, y2, 6),
:tag=>'I3_', :fill=>color2, :outline=>color2)
- TkcRectangle.new(@canvas, x1, y1 - 6, x2, y2 + 6,
+ 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),
+
+ 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],
+ 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],
+ TkcLine.new(@canvas, [502, 393, 522, 393, 522, 465],
:tag=>'I3__', :fill=>@C['fg'], :joinstyle=>:miter, :width=>10)
end
@@ -659,7 +659,7 @@ class TkGoldberg_Demo
}
# Swing gate
- TkcLine.new(@canvas, [518, 464, 518, 428],
+ TkcLine.new(@canvas, [518, 464, 518, 428],
:tag=>'I4', :fill=>color, :width=>1)
end
@@ -686,7 +686,7 @@ class TkGoldberg_Demo
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,
+ 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)
@@ -696,7 +696,7 @@ class TkGoldberg_Demo
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'],
+ TkcPolygon.new(@canvas, xy, :tag=>['I5', 'I5_2'], :fill=>@C['bg'],
:outline=>'', :smooth=>true)
xy = [538, 454, 535, 461] # Front leg
@@ -716,9 +716,9 @@ class TkGoldberg_Demo
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],
+ [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]
]
@@ -739,16 +739,16 @@ class TkGoldberg_Demo
color = @C['6']
xy = [324, 130, 391, 204] # Ball holder
xy = round_rect(xy, 10)
- TkcPolygon.new(@canvas, xy, :smooth=>true,
+ 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,
+ 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,
+ 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,
+ TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>2, :style=>:arc,
:start=>-41, :extent=>85)
xy = box(346, 339, 15) # Center of rotor
@@ -763,10 +763,10 @@ class TkGoldberg_Demo
TkcRectangle.new(@canvas, xy, :fill=>color, :outline=>'')
xy = [
- 368, 356, 368, 403, 389, 403, 389, 464, 320, 464, 320, 403,
+ 368, 356, 368, 403, 389, 403, 389, 464, 320, 464, 320, 403,
352, 403, 352, 366
]
- TkcPolygon.new(@canvas, xy, :fill=>color, :outline=>'',
+ 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
@@ -791,7 +791,7 @@ class TkGoldberg_Demo
loc = -i
color = colors[i]
x, y = @XY6["#{loc}"]
- TkcOval.new(@canvas, box(x, y, 5),
+ TkcOval.new(@canvas, box(x, y, 5),
:fill=>color, :outline=>color, :tag=>"I6_b#{i}")
}
draw6a(12) # The wheel
@@ -817,7 +817,7 @@ class TkGoldberg_Demo
@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),
+ TkcRectangle.new(@canvas, xy, :fill=>@canvas.itemcget('I6c', :fill),
:outline=>'')
end
return 1
@@ -857,24 +857,24 @@ class TkGoldberg_Demo
def draw7
color = @C['7']
xy = [198, 306, 277, 374] # Box
- TkcRectangle.new(@canvas, xy, :outline=>@C['fg'], :width=>2,
+ 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,
+ 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,
+ 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,
+ TkcText.new(@canvas, xy, :text=>'off', :anchor=>:e,
:fill=>@C['fg'], :font=>font)
end
@@ -919,7 +919,7 @@ class TkGoldberg_Demo
xy = [280, 209, 296, 248]
TkcOval.new(@canvas, xy, :outline=>color, :fill=>color)
xy = [
- 288, 249, 252, 249, 260, 240, 280, 234,
+ 288, 249, 252, 249, 260, 240, 280, 234,
296, 234, 316, 240, 324, 249, 288, 249
]
TkcPolygon.new(@canvas, xy, :fill=>color, :smooth=>true)
@@ -928,16 +928,16 @@ class TkGoldberg_Demo
TkcPolygon.new(@canvas, xy, :fill=>color)
xy = [255, 206, 265, 234] # Fan blades
- TkcOval.new(@canvas, xy, :fill=>'', :outline=>@C['fg'],
+ 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'],
+ 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'],
+ 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'],
+ TkcOval.new(@canvas, xy, :fill=>'', :outline=>@C['fg'],
:width=>1, :tag=>'I9_1')
end
@@ -962,17 +962,17 @@ class TkGoldberg_Demo
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'],
+ 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,
+ 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,
+ 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,
+ 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,
+ TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>3, :style=>:arc,
:start=>120, :extent=>120, :tag=>'I10')
xy = [200, 171, 200, 249] # Mast
@@ -992,10 +992,10 @@ class TkGoldberg_Demo
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,
+ 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,
+ TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>3, :style=>:arc,
:extent=>190)
end
@@ -1003,9 +1003,9 @@ class TkGoldberg_Demo
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],
+ [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]
]
@@ -1032,21 +1032,21 @@ class TkGoldberg_Demo
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,
+ 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=>'',
+ 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,
+ 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=>'',
+ TkcOval.new(@canvas, xy, :fill=>color2, :outline=>'',
:width=>3, :tag=>'I11')
end
@@ -1054,8 +1054,8 @@ class TkGoldberg_Demo
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],
+ [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]
]
@@ -1069,11 +1069,11 @@ class TkGoldberg_Demo
# Hand
def draw12
xy = [
- 20, 637, 20, 617, 20, 610, 20, 590, 40, 590, 40, 590,
+ 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,
+ 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
@@ -1083,7 +1083,7 @@ class TkGoldberg_Demo
x2 = x - 10
xy << x << y0 << x1 << y1 << x2 << y0
}
- TkcPolygon.new(@canvas, xy, :fill=>@C['12'], :outline=>@C['fg'],
+ TkcPolygon.new(@canvas, xy, :fill=>@C['12'], :outline=>@C['fg'],
:smooth=>true, :tag=>'I12', :width=>3)
end
@@ -1107,25 +1107,25 @@ class TkGoldberg_Demo
]
radii = [2, 9, 9, 8, 5, 5, 2]
- round_poly(@canvas, xy, radii, :width=>3,
+ round_poly(@canvas, xy, radii, :width=>3,
:outline=>@C['fg'], :fill=>color)
- round_poly(@canvas, xy2, radii, :width=>3,
+ 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'],
+ 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'],
+ 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'],
+ 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'],
+ TkcText.new(@canvas, xy, :text=>'FAX', :fill=>@C['fg'],
:font=>['Times Roman', 12, :bold])
xy = [138, 663, 148, 636, 178, 636] # Paper guide
@@ -1133,7 +1133,7 @@ class TkGoldberg_Demo
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,
+ sine([149, 688, 720, 688], 5, 15,
:tag=>'I13_s', :fill=>@C['fg'], :width=>3)
end
@@ -1163,17 +1163,17 @@ class TkGoldberg_Demo
def draw14
color = @C['14']
xy = [102, 661, 113, 632, 130, 618] # Left paper edge
- TkcLine.new(@canvas, xy, :smooth=>true, :fill=>color,
+ 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,
+ 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,
+ 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
@@ -1181,7 +1181,7 @@ class TkGoldberg_Demo
xy = [
745.947897349, 662.428358855, 745.997829056, 662.452239237, 746.0, 662.5
]
- TkcLine.new(@canvas, xy, :smooth=>true, :fill=>color,
+ TkcLine.new(@canvas, xy, :smooth=>true, :fill=>color,
:width=>3, :tag=>'I14R_1')
@canvas.lower('I14R_1')
end
@@ -1194,11 +1194,11 @@ class TkGoldberg_Demo
x3, y3, x4, y4, x5, y5 = xy2
zz = [
- x0, y0, x0, y0, xy, x2, y2, x2, y2,
+ 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,
+ TkcPolygon.new(@canvas, zz, :tag=>"I14#{side}", :smooth=>true,
:fill=>color, :outline=>color, :width=>3)
@canvas.lower("I14#{side}")
end
@@ -1251,7 +1251,7 @@ class TkGoldberg_Demo
xy = [765, 557, 784, 583]
TkcRectangle.new(@canvas, xy, :fill=>color, :outline=>@C['fg'], :width=>2)
- sine([658, 580, 765, 580], 3, 15,
+ sine([658, 580, 765, 580], 3, 15,
:tag=>'I15_s', :fill=>@C['fg'], :width=>3)
end
@@ -1290,7 +1290,7 @@ class TkGoldberg_Demo
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',
+ 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')
@@ -1329,24 +1329,24 @@ class TkGoldberg_Demo
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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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_')
@@ -1356,23 +1356,23 @@ class TkGoldberg_Demo
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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>2,
:smooth=>true, :tag=>'I17')
end
@@ -1385,10 +1385,10 @@ class TkGoldberg_Demo
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=>'',
+ 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=>'',
+ TkcOval.new(@canvas, xy, :outline=>@C['fg'], :width=>3, :fill=>'',
:tag=>'I17_')
@canvas.move('I17_', 0, -20) # Move face up
@@ -1398,19 +1398,19 @@ class TkGoldberg_Demo
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,
+ 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,
+ 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,
+ TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>3,
:smooth=>true, :tag=>'I17_')
@canvas.raise('I17w') # Make whiskers visible
@@ -1439,14 +1439,14 @@ class TkGoldberg_Demo
step = get_step(18, step)
pos = [
- [587, 506], [537, 506], [466, 506], [376, 506], [266, 506, :x],
+ [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,
+ 491, 503, 524, 557, 563, 505, 559, 496, 546, 506, 551, 525,
553, 536, 538, 534, 532, 519, 529, 499
]
b[2] = [
@@ -1477,54 +1477,54 @@ class TkGoldberg_Demo
color = @C['19']
xx = [[249, 181], [155, 118], [86, 55], [22, 0]]
xx.each{|x1, x2|
- TkcRectangle.new(@canvas, x1, 453, x2, 467,
+ TkcRectangle.new(@canvas, x1, 453, x2, 467,
:fill=>color, :outline=>'', :tag=>'I19')
- TkcLine.new(@canvas, x1, 453, x2, 453,
+ TkcLine.new(@canvas, x1, 453, x2, 453,
:fill=>@C['fg'], :width=>1) # Pipe top
- TkcLine.new(@canvas, x1, 467, x2, 467,
+ 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,
+ 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,
+ 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,
+ TkcArc.new(@canvas, xy, :outline=>'', :fill=>color, :width=>1,
:style=>:pie, :start=>0, :extent=>-91)
- TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>1,
+ 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,
+ 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,
+ 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,
+ TkcArc.new(@canvas, xy, :outline=>'', :fill=>color, :width=>1,
:style=>:pie, :start=>0, :extent=>91)
- TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>1,
+ 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,
+ 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,
+ 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,
+ TkcArc.new(@canvas, xy, :outline=>'', :fill=>color, :width=>1,
:style=>:pie, :start=>90, :extent=>90)
- TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>1,
+ 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,
+ 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,
+ TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>1,
:style=>:arc, :start=>90, :extent=>90)
xy = [270, 427, 296, 433] # 2nd joint bottom
@@ -1566,7 +1566,7 @@ class TkGoldberg_Demo
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],
+ [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
@@ -1583,11 +1583,11 @@ class TkGoldberg_Demo
color = @C['20']
@canvas.delete('I20')
- sine([208, 428, 208, y], 4, f, :tag=>['I20', 'I20s'],
+ sine([208, 428, 208, y], 4, f, :tag=>['I20', 'I20s'],
:width=>3, :fill=>color, :smooth=>true)
- TkcLine.new(@canvas, @canvas.coords('I20s'), :width=>3,
+ TkcLine.new(@canvas, @canvas.coords('I20s'), :width=>3,
:fill=>color, :smooth=>1, :tag=>['I20', 'I20a'])
- TkcLine.new(@canvas, @canvas.coords('I20s'), :width=>3,
+ 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)
@@ -1603,18 +1603,18 @@ class TkGoldberg_Demo
xy = [245, 490, 237, 535] # Right side
xy2 = [189, 535, 181, 490] # Left side
- TkcPolygon.new(@canvas, xy + xy2, :fill=>color, :outline=>'',
+ 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,
+ TkcOval.new(@canvas, xy, :fill=>color, :outline=>'', :width=>2,
:tag=>['I21', 'I21f'])
- TkcOval.new(@canvas, xy, :fill=>'', :outline=>@C['fg'], :width=>2,
+ 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,
+ TkcOval.new(@canvas, xy, :fill=>color, :outline=>@C['fg'], :width=>2,
:tag=>['I21', 'I21b'])
end
@@ -1637,7 +1637,7 @@ class TkGoldberg_Demo
@canvas.itemconfigure('I21b', :fill=>@C['20'])
@canvas.delete('I21w')
- TkcPolygon.new(@canvas, x2, y2, x1, y1, xx1, yy1, xx2, yy1,
+ 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')
@@ -1673,21 +1673,21 @@ class TkGoldberg_Demo
color3 = @C['23c']
xy = [185, 623, 253, 650] # Block
- TkcRectangle.new(@canvas, xy, :fill=>'black', :outline=>@C['fg'],
+ 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',
+ 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'],
+ 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'],
+ 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')
@@ -1699,7 +1699,7 @@ class TkGoldberg_Demo
step = get_step(23, step)
pos = [
- [277, 607], [287, 607], [307, 607, :x], [347, 607], [407, 607],
+ [277, 607], [287, 607], [307, 607, :x], [347, 607], [407, 607],
[487, 607], [587, 607], [687, 607], [787, 607], [-100, -100]
]
@@ -1719,7 +1719,7 @@ class TkGoldberg_Demo
def draw24
color = @C['24a']
xy = [366, 518, 462, 665] # Balloon
- TkcOval.new(@canvas, xy, :fill=>color, :outline=>@C['fg'],
+ 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')
@@ -1728,16 +1728,16 @@ class TkGoldberg_Demo
:width=>3, :tag=>'I24')
xy = [387, 567, 390, 549, 404, 542] # Reflections
- TkcLine.new(@canvas, xy, :fill=>@C['fg'], :smooth=>true,
+ 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,
+ 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,
+ 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,
+ TkcLine.new(@canvas, xy, :fill=>@C['fg'], :smooth=>true,
:width=>2, :tag=>'I24')
end
@@ -1750,16 +1750,16 @@ class TkGoldberg_Demo
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,
+ 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'],
+ 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'],
+ TkcText.new(@canvas, centroid('I24'), :text=>msg, :tag=>['I24', 'I24t'],
:justify=>:center, :font=>['Times Roman', 18, :bold])
return 1
end
@@ -1790,9 +1790,9 @@ class TkGoldberg_Demo
if step >= 3
@canvas.delete('I24', 'I26')
- TkcText.new(@canvas, 430, 735, :anchor=>:s, :tag=>'I26',
- #:text=>'click to continue',
- :text=>'åǥꥻåȤޤ',
+ 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
@@ -1972,11 +1972,11 @@ class TkGoldberg_Demo
def sparkle(oxy, tag)
xy = [
- [299, 283], [298, 302], [295, 314], [271, 331],
+ [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,
+ TkcLine.new(@canvas, 271, 304, x, y,
:fill=>'white', :width=>3, :tag=>tag)
}
move_abs(tag, oxy)
diff --git a/ext/tk/sample/demos-jp/icon.rb b/ext/tk/sample/demos-jp/icon.rb
index 935519435b..a2ca6651dc 100644
--- a/ext/tk/sample/demos-jp/icon.rb
+++ b/ext/tk/sample/demos-jp/icon.rb
@@ -5,7 +5,7 @@
# toplevel widget ¸ߤк
if defined?($icon_demo) && $icon_demo
- $icon_demo.destroy
+ $icon_demo.destroy
$icon_demo = nil
end
diff --git a/ext/tk/sample/demos-jp/image1.rb b/ext/tk/sample/demos-jp/image1.rb
index 10078c6c22..d9435cc1a2 100644
--- a/ext/tk/sample/demos-jp/image1.rb
+++ b/ext/tk/sample/demos-jp/image1.rb
@@ -5,7 +5,7 @@
# toplevel widget ¸ߤк
if defined?($image1_demo) && $image1_demo
- $image1_demo.destroy
+ $image1_demo.destroy
$image1_demo = nil
end
diff --git a/ext/tk/sample/demos-jp/image2.rb b/ext/tk/sample/demos-jp/image2.rb
index 3e8b87461f..1bb2c9e9c3 100644
--- a/ext/tk/sample/demos-jp/image2.rb
+++ b/ext/tk/sample/demos-jp/image2.rb
@@ -5,7 +5,7 @@
# toplevel widget ¸ߤк
if defined?($image2_demo) && $image2_demo
- $image2_demo.destroy
+ $image2_demo.destroy
$image2_demo = nil
end
diff --git a/ext/tk/sample/demos-jp/image3.rb b/ext/tk/sample/demos-jp/image3.rb
index 625e69a21d..12b8aafd8e 100644
--- a/ext/tk/sample/demos-jp/image3.rb
+++ b/ext/tk/sample/demos-jp/image3.rb
@@ -9,7 +9,7 @@
# toplevel widget
if defined?($image3_demo) && $image3_demo
- $image3_demo.destroy
+ $image3_demo.destroy
$image3_demo = nil
end
@@ -22,7 +22,7 @@ $image3_demo = TkToplevel.new {|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|
@@ -38,10 +38,10 @@ end
# Arguments:
# w - Name of the toplevel window of the demo.
def selectAndLoadDir3(w, lbox)
- dir = Tk.chooseDirectory(:initialdir=>$dirName.value,
+ dir = Tk.chooseDirectory(:initialdir=>$dirName.value,
:parent=>w, :mustexist=>true)
if dir.length > 0
- $dirName.value = dir
+ $dirName.value = dir
loadDir3(lbox)
end
end
@@ -94,11 +94,11 @@ 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=>'ե:',
+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,
+ 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')
@@ -109,7 +109,7 @@ image3_ent = TkEntry.new(image3_df, :width=>30, :textvariable=>$dirName){
bind('Return', proc{loadDir3(image3_lbx)})
}
-TkButton.new(image3_df, :pady=>0, :padx=>'2m', :text=>"ǥ쥯ȥ",
+TkButton.new(image3_df, :pady=>0, :padx=>'2m', :text=>"ǥ쥯ȥ",
:command=>proc{selectAndLoadDir3(image3_ent, image3_lbx)}) {
pack(:side=>:left, :fill=>:y, :padx=>[0, '2m'], :pady=>'2m')
}
@@ -121,7 +121,7 @@ image3_if = TkLabelFrame.new(base_frame, :text=>'᡼:') {|f|
Tk.grid(image3_df, '-',
:sticky=>:ew, :padx=>'1m', :pady=>'1m', :in=>image3_f)
-Tk.grid(image3_ff, image3_if,
+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
index 4440905db8..64ceeff3ec 100644
--- a/ext/tk/sample/demos-jp/items.rb
+++ b/ext/tk/sample/demos-jp/items.rb
@@ -5,7 +5,7 @@
# toplevel widget ¸ߤк
if defined?($items_demo) && $items_demo
- $items_demo.destroy
+ $items_demo.destroy
$items_demo = nil
end
@@ -73,11 +73,11 @@ TkFrame.new(base_frame) {|cf|
c.pack('in'=>cf, 'expand'=>'yes', 'fill'=>'both')
else
- c.grid('in'=>cf, 'row'=>0, 'column'=>0,
+ c.grid('in'=>cf, 'row'=>0, 'column'=>0,
'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news')
- vs.grid('row'=>0, 'column'=>1,
+ vs.grid('row'=>0, 'column'=>1,
'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news')
- hs.grid('row'=>1, 'column'=>0,
+ 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)
@@ -118,8 +118,8 @@ $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',
+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)
@@ -127,38 +127,38 @@ 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',
+TkcLine.new(cvs, '1c','5c','7c','5c','7c','7c','9c','7c', 'width'=>'.5c',
'stipple'=>'@'+[$demo_dir,'..',
- 'images','gray25.xbm'].join(File::Separator),
+ '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',
+ 'width'=>'.5c', 'capstyle'=>'round', 'join'=>'round',
'tags'=>$tag_item )
-TkcText.new(cvs, '15c', '.2c',
+TkcText.new(cvs, '15c', '.2c',
'text'=>' (餫ˤĤʤľ)', 'anchor'=>'n')
-TkcLine.new(cvs, '11c','4c','11.5c','1c','13.5c','1c','14c','4c',
+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',
+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',
+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',
+ 'smooth'=>'on', 'width'=>'3m', 'capstyle'=>'round',
'stipple'=>'@'+[$demo_dir, '..',
- 'images', 'gray25.xbm'].join(File::Separator),
+ '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,
+ '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',
+ '7.5c','22c','7.5c',
'stipple'=>'@' + [$demo_dir, '..',
'images', 'gray25.xbm'].join(File::Separator),
'outline'=>'black', 'tags'=>$tag_item )
@@ -166,7 +166,7 @@ TkcPolygon.new(cvs, '22c','4.5c','25c','4.5c','25c','6.75c','28c','6.75c',
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',
+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,'..',
@@ -176,7 +176,7 @@ TkcRectangle.new(cvs, '6c','10c','9c','15c', 'outline'=>'',
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',
+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,'..',
@@ -185,40 +185,40 @@ TkcOval.new(cvs, '16c','10c','19c','15c', 'outline'=>'',
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',
+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,
+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,
+ 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',
+ 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',
+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,
+#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,
+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,
+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,
+ 'fill'=>blue, 'outline'=>'', 'start'=>45, 'extent'=>270,
'tags'=>$tag_item)
TkcText.new(cvs, '15c', '16.2c', 'text'=>'ӥåȥޥå', 'anchor'=>'n')
@@ -253,17 +253,17 @@ TkcText.new(cvs, '25c', '16.2c', 'text'=>'ɥ', 'anchor'=>'n')
TkButton.new(cvs) {|b|
text 'Ƥ'
command proc{butPress cvs, red}
- TkcWindow.new(cvs, '21c','18c',
+ 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',
+ TkcWindow.new(cvs, '21c','21c',
'window'=>e, 'anchor'=>'nw', 'tags'=>$tag_item)
}
-TkScale.new(cvs, 'from'=>0, 'to'=>100, 'length'=>'6c', 'sliderlength'=>'.4c',
+TkScale.new(cvs, 'from'=>0, 'to'=>100, 'length'=>'6c', 'sliderlength'=>'.4c',
'width'=>'.5c', 'tickinterval'=>0 ) {|scl|
- TkcWindow.new(cvs, '28.5c','17.5c',
+ TkcWindow.new(cvs, '28.5c','17.5c',
'window'=>scl, 'anchor'=>'n', 'tags'=>$tag_item)
}
TkcText.new(cvs, '21c', '17.9c', 'text'=>'ܥ:', 'anchor'=>'sw')
@@ -314,7 +314,7 @@ def itemLeave(c)
$restoreCmd.call if $restoreCmd
end
-# Utility methods for stroking out a rectangle and printing what's
+# Utility methods for stroking out a rectangle and printing what's
# underneath the rectangle's area.
def itemMark(c,x,y)
@@ -328,7 +328,7 @@ def itemStroke(c,x,y)
y = c.canvasy(y)
if $areaX1 != x && $areaY1 != y
c.delete 'area'
- c.addtag_withtag 'area', TkcRectangle.new(c, $areaX1, $areaY1, x, y,
+ c.addtag_withtag 'area', TkcRectangle.new(c, $areaX1, $areaY1, x, y,
'-outline', 'black')
$areaX2 = x
$areaY2 = y
@@ -369,11 +369,11 @@ def itemDrag(c,x,y)
$lastY = y
end
-# Method that's invoked when the button embedded in the canvas
+# Method that's invoked when the button embedded in the canvas
# is invoked.
def butPress(w,color)
- i = TkcText.new(w, '25c', '18.1c',
+ 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/knightstour.rb b/ext/tk/sample/demos-jp/knightstour.rb
index ae0f13076e..d4595ea441 100644
--- a/ext/tk/sample/demos-jp/knightstour.rb
+++ b/ext/tk/sample/demos-jp/knightstour.rb
@@ -157,16 +157,16 @@ class Knights_Tour
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,
+ 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
@@ -178,7 +178,7 @@ class Knights_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,
+ @log = Tk::Text.new(base_f, :width=>12, :height=>1,
:font=>'Arial 8', :background=>'white')
scr = @log.yscrollbar(Ttk::Scrollbar.new(base_f))
@@ -188,13 +188,13 @@ class Knights_Tour
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,
+ scale = Ttk::Scale.new(tool_f, :from=>8, :to=>2000, :variable=>@delay,
:command=>proc{|n| set_delay(n)})
- check = Ttk::Checkbutton.new(tool_f, :text=>'ȿ',
+ check = Ttk::Checkbutton.new(tool_f, :text=>'ȿ',
:variable=>@continuous)
- @start_btn = Ttk::Button.new(tool_f, :text=>'',
+ @start_btn = Ttk::Button.new(tool_f, :text=>'',
:command=>proc{tour()})
- @exit_btn = Ttk::Button.new(tool_f, :text=>'λ',
+ @exit_btn = Ttk::Button.new(tool_f, :text=>'λ',
:command=>proc{_exit()})
7.downto(0){|row|
@@ -207,16 +207,16 @@ class Knights_Tour
dfill = 'tan4'
end
coords = [col * 30 + 4, row * 30 + 4, col * 30 + 30, row * 30 + 30]
- @board.create(TkcRectangle, coords,
+ @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',
+ @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)}
diff --git a/ext/tk/sample/demos-jp/label.rb b/ext/tk/sample/demos-jp/label.rb
index 19105e6f71..2e6b3e7e57 100644
--- a/ext/tk/sample/demos-jp/label.rb
+++ b/ext/tk/sample/demos-jp/label.rb
@@ -5,7 +5,7 @@
# toplevel widget ¸ߤк
if defined?($label_demo) && $label_demo
- $label_demo.destroy
+ $label_demo.destroy
$label_demo = nil
end
@@ -49,12 +49,12 @@ TkFrame.new(base_frame) {|frame|
# 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',
+[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 ܡä⤭夬餻Ƥߤޤ',
+ 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')}
diff --git a/ext/tk/sample/demos-jp/labelframe.rb b/ext/tk/sample/demos-jp/labelframe.rb
index cee504f4b6..11b0d27308 100644
--- a/ext/tk/sample/demos-jp/labelframe.rb
+++ b/ext/tk/sample/demos-jp/labelframe.rb
@@ -9,7 +9,7 @@
if defined?($labelframe_demo) && $labelframe_demo
- $labelframe_demo.destroy
+ $labelframe_demo.destroy
$labelframe_demo = nil
end
@@ -22,18 +22,18 @@ $labelframe_demo = TkToplevel.new {|w|
base_frame = TkFrame.new($labelframe_demo).pack(:fill=>:both, :expand=>true)
# Some information
-TkLabel.new(base_frame,
- :font=>$font, :wraplength=>'4i', :justify=>:left,
+TkLabel.new(base_frame,
+ :font=>$font, :wraplength=>'4i', :justify=>:left,
:text=><<EOL).pack(:side=>:top)
-TkLabelFrame åȤϴϢ widget
+TkLabelFrame åȤϴϢ widget
ޤȤƼ갷Ѥޤ
٥̾ʸǤⲿ餫Υå
-Ǥ⤫ޤޤ󡣤⤷ʤȤäƤ
-Ruby ˥󥯤Ƥ Tk 饤֥꤬
+Ǥ⤫ޤޤ󡣤⤷ʤȤäƤ
+Ruby ˥󥯤Ƥ Tk 饤֥꤬
labelframe åȤƤʤ
硢ΥǥϤޤưʤϤǤ
ξˤ labelframe åȤ
-Ƥ褦ʤ꿷С Tk
+Ƥ褦ʤ꿷С Tk
Ȥ߹碌ƻ褦ˤƤ
EOL
@@ -52,17 +52,17 @@ TkFrame.new(base_frame){|f|
}
# Demo area
-w = TkFrame.new(base_frame).pack(:side=>:bottom, :fill=>:both,
+w = TkFrame.new(base_frame).pack(:side=>:bottom, :fill=>:both,
:expand=>true)
# A group of radiobuttons in a labelframe
-TkLabelFrame.new(w, :text=>'',
+TkLabelFrame.new(w, :text=>'',
:padx=>2, :pady=>2) {|f|
grid(:row=>0, :column=>0, :pady=>'2m', :padx=>'2m')
v = TkVariable.new
(1..4).each{|i|
- TkRadiobutton.new(f, :text=>"This is value #{i}",
+ TkRadiobutton.new(f, :text=>"This is value #{i}",
:variable=>v, :value=>i) {
pack(:side=>:top, :fill=>:x, :pady=>2)
}
@@ -85,7 +85,7 @@ def lfEnableButtons(w)
end
TkLabelFrame.new(w, :pady=>2, :padx=>2){|f|
- TkCheckButton.new(f, :widgetname=>'cb', :variable=>$lfdummy,
+ TkCheckButton.new(f, :widgetname=>'cb', :variable=>$lfdummy,
:text=>"ץ", :padx=>0) {|cb|
command proc{lfEnableButtons(f)}
f.labelwidget(cb)
diff --git a/ext/tk/sample/demos-jp/mclist.rb b/ext/tk/sample/demos-jp/mclist.rb
index 37f5dfa8eb..a7834d2668 100644
--- a/ext/tk/sample/demos-jp/mclist.rb
+++ b/ext/tk/sample/demos-jp/mclist.rb
@@ -8,7 +8,7 @@
# 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.destroy
$mclist_demo = nil
end
@@ -21,8 +21,8 @@ $mclist_demo = TkToplevel.new {|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],
+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åȤ\
@@ -40,23 +40,23 @@ EOL
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,
+ 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),
+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))
@@ -74,20 +74,20 @@ 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'],
+ ['를', '֥Υ쥹', 'ARS'],
+ ['ȥꥢ', '٥', 'AUD'],
+ ['֥饸', '֥饸ꥢ', 'BRL'],
+ ['ʥ', '', 'CAD'],
+ ['', '̵', 'CNY'],
+ ['ե', 'ѥ', 'EUR'],
+ ['ɥ', '٥', 'EUR'],
+ ['', '˥塼ǥ꡼', 'INR'],
+ ['ꥢ', '', 'EUR'],
+ ['', '', 'JPY'],
+ ['ᥭ', 'ᥭƥ', 'MXN'],
+ ['', '⥹', 'RUB'],
+ ['եꥫ', 'ץȥꥢ', 'ZAR'],
+ ['ѹ', 'ɥ', 'GBP'],
['ꥫ', '亮ȥ D.C.', 'USD'],
]
@@ -95,7 +95,7 @@ data = [
font = Ttk::Style.lookup(tree[:style], :font)
cols = %w(country capital currency)
cols.zip(%w(̾ ̲)).each{|col, name|
- tree.heading_configure(col, :text=>name,
+ tree.heading_configure(col, :text=>name,
:command=>proc{sort_by(tree, col, false)})
tree.column_configure(col, :width=>TkFont.measure(font, name))
}
@@ -113,8 +113,8 @@ data.each{|country, capital, currency|
## 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})) .
+ 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)})
diff --git a/ext/tk/sample/demos-jp/menu.rb b/ext/tk/sample/demos-jp/menu.rb
index e38a467000..c3d95176b4 100644
--- a/ext/tk/sample/demos-jp/menu.rb
+++ b/ext/tk/sample/demos-jp/menu.rb
@@ -5,7 +5,7 @@
# toplevel widget ¸ߤк
if defined?($menu_demo) && $menu_demo
- $menu_demo.destroy
+ $menu_demo.destroy
$menu_demo = nil
end
@@ -88,9 +88,9 @@ TkMenubutton.new($menu_frame, 'text'=>'Basic', 'underline'=>0) {|m|
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}",
+ # add('command', 'label'=>"ʸ \"#{c}\" ", 'underline'=>4,
+ add('command', 'label'=>"Print letter \"#{c}\" (ʸ \"#{c}\" )",
+ 'underline'=>14, 'accelerator'=>"Meta+#{c}",
'command'=>proc{print c,"\n"}, 'accelerator'=>"#{modifier}+#{c}")
$menu_demo.bind("#{modifier}-#{c.downcase}", proc{print c,"\n"})
}
@@ -101,18 +101,18 @@ TkMenubutton.new($menu_frame, 'text'=>'Cascades', 'underline'=>0) {|m|
pack('side'=>'left')
TkMenu.new(m, 'tearoff'=>false) {|cascade_menu|
m.configure('menu'=>cascade_menu)
- add('command', 'label'=>'Print hello(ˤ)',
- 'command'=>proc{print "Hello(ˤ)\n"},
+ add('command', 'label'=>'Print hello(ˤ)',
+ 'command'=>proc{print "Hello(ˤ)\n"},
'accelerator'=>"#{modifier}+H", 'underline'=>6)
$menu_demo.bind("#{modifier}-h", proc{print "Hello(ˤ)\n"})
- add('command', 'label'=>'Print goodbye(褦ʤ)',
- 'command'=>proc{print "Goodbye(褦ʤ)\n"},
+ 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(åܥ)',
+ cascade_menu.add('cascade', 'label'=>'Check buttons(åܥ)',
'menu'=>cascade_check, 'underline'=>0)
oil = TkVariable.new(0)
add('check', 'label'=>'', 'variable'=>oil)
@@ -123,11 +123,11 @@ TkMenubutton.new($menu_frame, 'text'=>'Cascades', 'underline'=>0) {|m|
lights = TkVariable.new(0)
add('check', 'label'=>'饤', 'variable'=>lights)
add('separator')
- add('command', 'label'=>'ߤͤɽ',
- 'command'=>proc{showVars($menu_demo,
- ['', oil],
- ['ȥ󥹥ߥå', trans],
- ['֥졼', brakes],
+ add('command', 'label'=>'ߤͤɽ',
+ 'command'=>proc{showVars($menu_demo,
+ ['', oil],
+ ['ȥ󥹥ߥå', trans],
+ ['֥졼', brakes],
['饤', lights])} )
invoke 1
invoke 3
@@ -135,7 +135,7 @@ TkMenubutton.new($menu_frame, 'text'=>'Cascades', 'underline'=>0) {|m|
#TkMenu.new(m, 'tearoff'=>false) {|cascade_radio|
TkMenu.new(cascade_menu, 'tearoff'=>false) {|cascade_radio|
- cascade_menu.add('cascade', 'label'=>'Radio buttons(饸ܥ)',
+ cascade_menu.add('cascade', 'label'=>'Radio buttons(饸ܥ)',
'menu'=>cascade_radio, 'underline'=>0)
pointSize = TkVariable.new
add('radio', 'label'=>'10 ݥ', 'variable'=>pointSize, 'value'=>10)
@@ -149,9 +149,9 @@ TkMenubutton.new($menu_frame, 'text'=>'Cascades', 'underline'=>0) {|m|
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],
+ add('command', 'label'=>'ߤͤɽ',
+ 'command'=>proc{showVars($menu_demo,
+ ['ݥȥ', pointSize],
['', style])} )
invoke 1
invoke 7
@@ -163,15 +163,15 @@ 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',
+ add('command',
'bitmap'=>'@'+[$demo_dir,'..',
'images','pattern.xbm'].join(File::Separator),
- 'command'=>proc{TkDialog.new('title'=>'Bitmap Menu Entry',
+ 'command'=>proc{TkDialog.new('title'=>'Bitmap Menu Entry',
'text'=>'ʤ򤷤˥塼ιܤϥƥȤǤϤʤӥåȥޥåפɽƤޤʳǤ¾Υ˥塼ܤѤޤ',
- 'bitmap'=>'', 'default'=>0,
+ 'bitmap'=>'', 'default'=>0,
'buttons'=>'λ')} )
['info', 'questhead', 'error'].each{|icon|
- add('command', 'bitmap'=>icon,
+ add('command', 'bitmap'=>icon,
'command'=>proc{print "You invoked the #{icon} bitmap\n"})
}
}
@@ -183,7 +183,7 @@ TkMenubutton.new($menu_frame, 'text'=>'More', 'underline'=>0) {|m|
m.configure('menu'=>more_menu)
[ 'ȥ','̤Υȥ','⤷ʤ','ۤȤɲ⤷ʤ',
'յΤ' ].each{|i|
- add('command', 'label'=>i,
+ add('command', 'label'=>i,
'command'=>proc{print "You invoked \"#{i}\"\n"})
}
}
@@ -194,7 +194,7 @@ TkMenubutton.new($menu_frame, 'text'=>'Colors', 'underline'=>0) {|m|
TkMenu.new(m) {|colors_menu|
m.configure('menu'=>colors_menu)
['red', 'orange', 'yellow', 'green', 'blue'].each{|c|
- add('command', 'label'=>c, 'background'=>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
index 094853a728..a631bacd43 100644
--- a/ext/tk/sample/demos-jp/menu84.rb
+++ b/ext/tk/sample/demos-jp/menu84.rb
@@ -5,7 +5,7 @@
# toplevel widget
if defined?($menu84_demo) && $menu84_demo
- $menu84_demo.destroy
+ $menu84_demo.destroy
$menu84_demo = nil
end
@@ -37,9 +37,9 @@ TkLabel.new(base_frame,'font'=>$font,'wraplength'=>'4i','justify'=>'left') {
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,
+ 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)
}
@@ -94,8 +94,8 @@ 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}",
+ 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"})
}
@@ -103,17 +103,17 @@ TkMenu.new($menu84_frame, 'tearoff'=>false) {|m|
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"},
+ 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"},
+ 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',
+ m.add('cascade', 'label'=>'Check button',
'menu'=>cascade_check, 'underline'=>0)
oil = TkVariable.new(0)
add('check', 'label'=>'븡', 'variable'=>oil)
@@ -124,18 +124,18 @@ TkMenu.new($menu84_frame, 'tearoff'=>false) {|m|
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],
+ 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',
+ m.add('cascade', 'label'=>'Radio buttons',
'menu'=>cascade_radio, 'underline'=>0)
pointSize = TkVariable.new
add('radio', 'label'=>'10 point', 'variable'=>pointSize, 'value'=>10)
@@ -149,9 +149,9 @@ TkMenu.new($menu84_frame, 'tearoff'=>false) {|m|
add('radio', 'label'=>'Bold', 'variable'=>style, 'value'=>'bold')
add('radio', 'label'=>'Italic', 'variable'=>style, 'value'=>'italic')
add('separator')
- add('command', 'label'=>'ͤɽ',
- 'command'=>proc{showVars($menu84_demo,
- ['pointSize', pointSize],
+ add('command', 'label'=>'ͤɽ',
+ 'command'=>proc{showVars($menu84_demo,
+ ['pointSize', pointSize],
['style', style])} )
invoke 1
invoke 7
@@ -160,15 +160,15 @@ TkMenu.new($menu84_frame, 'tearoff'=>false) {|m|
TkMenu.new($menu84_frame, 'tearoff'=>false) {|m|
$menu84_frame.add('cascade', 'label'=>'Icons', 'menu'=>m, 'underline'=>0)
- add('command', 'hidemargin'=>1,
+ add('command', 'hidemargin'=>1,
'bitmap'=>'@'+[$demo_dir,'..',
'images','pattern.xbm'].join(File::Separator),
- 'command'=>proc{TkDialog.new('title'=>'Bitmap Menu Entry',
+ 'command'=>proc{TkDialog.new('title'=>'Bitmap Menu Entry',
'text'=>'ʤ򤷤˥塼ܤϡʸ˥ӥåȥޥåץ᡼ǹܤɽΤǤʳǤϡۤΥ˥塼ܤȤδ֤ä˰㤤櫓ǤϤޤ',
- 'bitmap'=>'', 'default'=>0,
+ 'bitmap'=>'', 'default'=>0,
'buttons'=>'Ĥ')} )
['info', 'questhead', 'error'].each{|icon|
- add('command', 'bitmap'=>icon, 'hidemargin'=>1,
+ add('command', 'bitmap'=>icon, 'hidemargin'=>1,
'command'=>proc{print "You invoked the #{icon} bitmap\n"})
}
@@ -179,14 +179,14 @@ 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,
+ add('command', 'label'=>i,
'command'=>proc{print "You invoked \"#{i}\"\n"})
}
- m.entryconfigure('Does almost nothing',
- 'bitmap'=>'questhead', 'compound'=>'left',
+ m.entryconfigure('Does almost nothing',
+ 'bitmap'=>'questhead', 'compound'=>'left',
'command'=>proc{
- TkDialog.new('title'=>'Compound Menu Entry',
+ TkDialog.new('title'=>'Compound Menu Entry',
'message'=>'ʤ򤷤˥塼ܤϡӥåȥޥåץ᡼ʸȤƱ˰Ĥιܤɽ褦ˤΤǤʳǤϡۤΥ˥塼ܤȤδ֤ä˰㤤櫓ǤϤޤ',
'buttons'=>['λ'], 'bitmap'=>'')
})
@@ -195,7 +195,7 @@ TkMenu.new($menu84_frame, 'tearoff'=>false) {|m|
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,
+ add('command', 'label'=>c, 'background'=>c,
'command'=>proc{print "You invoked \"#{c}\"\n"})
}
}
diff --git a/ext/tk/sample/demos-jp/menu8x.rb b/ext/tk/sample/demos-jp/menu8x.rb
index 49aca6786d..9249f2491a 100644
--- a/ext/tk/sample/demos-jp/menu8x.rb
+++ b/ext/tk/sample/demos-jp/menu8x.rb
@@ -5,7 +5,7 @@
# toplevel widget ¸ߤк
if defined?($menu8x_demo) && $menu8x_demo
- $menu8x_demo.destroy
+ $menu8x_demo.destroy
$menu8x_demo = nil
end
@@ -65,7 +65,7 @@ TkLabel.new(base_frame,'font'=>$font,'wraplength'=>'4i','justify'=>'left') {
# ɽ
$menu8xstatus = TkVariable.new(" ")
TkFrame.new(base_frame) {|frame|
- TkLabel.new(frame, 'textvariable'=>$menu8xstatus, 'relief'=>'sunken',
+ 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)
@@ -116,9 +116,9 @@ TkMenu.new($menu8x_demo, 'tearoff'=>false) {|m|
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}",
+ # add('command', 'label'=>"ʸ \"#{c}\" ", 'underline'=>4,
+ add('command', 'label'=>"Print letter \"#{c}\" (ʸ \"#{c}\" )",
+ 'underline'=>14, 'accelerator'=>"Meta+#{c}",
'command'=>proc{print c,"\n"}, 'accelerator'=>"#{modifier}+#{c}")
$menu8x_demo.bind("#{modifier}-#{c.downcase}", proc{print c,"\n"})
}
@@ -126,17 +126,17 @@ TkMenu.new($menu8x_demo, 'tearoff'=>false) {|m|
TkMenu.new(m, 'tearoff'=>false) {|cascade_menu|
m.add('cascade', 'label'=>'Cascades', 'menu'=>cascade_menu, 'underline'=>0)
- add('command', 'label'=>'Print hello(ˤ)',
- 'command'=>proc{print "Hello(ˤ)\n"},
+ add('command', 'label'=>'Print hello(ˤ)',
+ 'command'=>proc{print "Hello(ˤ)\n"},
'accelerator'=>"#{modifier}+H", 'underline'=>6)
$menu8x_demo.bind("#{modifier}-h", proc{print "Hello(ˤ)\n"})
- add('command', 'label'=>'Print goodbye(褦ʤ)',
- 'command'=>proc{print "Goodbye(褦ʤ)\n"},
+ 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(åܥ)',
+ cascade_menu.add('cascade', 'label'=>'Check buttons(åܥ)',
'menu'=>cascade_check, 'underline'=>0)
oil = TkVariable.new(0)
add('check', 'label'=>'', 'variable'=>oil)
@@ -147,18 +147,18 @@ TkMenu.new($menu8x_demo, 'tearoff'=>false) {|m|
lights = TkVariable.new(0)
add('check', 'label'=>'饤', 'variable'=>lights)
add('separator')
- add('command', 'label'=>'ߤͤɽ',
- 'command'=>proc{showVars($menu8x_demo,
- ['', oil],
- ['ȥ󥹥ߥå', trans],
- ['֥졼', brakes],
+ 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(饸ܥ)',
+ cascade_menu.add('cascade', 'label'=>'Radio buttons(饸ܥ)',
'menu'=>cascade_radio, 'underline'=>0)
pointSize = TkVariable.new
add('radio', 'label'=>'10 ݥ', 'variable'=>pointSize, 'value'=>10)
@@ -172,9 +172,9 @@ TkMenu.new($menu8x_demo, 'tearoff'=>false) {|m|
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],
+ add('command', 'label'=>'ߤͤɽ',
+ 'command'=>proc{showVars($menu8x_demo,
+ ['ݥȥ', pointSize],
['', style])} )
invoke 1
invoke 7
@@ -183,16 +183,16 @@ TkMenu.new($menu8x_demo, 'tearoff'=>false) {|m|
TkMenu.new(m, 'tearoff'=>false) {|icon_menu|
m.add('cascade', 'label'=>'Icons', 'menu'=>icon_menu, 'underline'=>0)
- add('command',
+ add('command',
'bitmap'=>'@'+[$demo_dir,'..',
'images','pattern.xbm'].join(File::Separator),
- 'hidemargin'=>1,
- 'command'=>proc{TkDialog.new('title'=>'Bitmap Menu Entry',
+ 'hidemargin'=>1,
+ 'command'=>proc{TkDialog.new('title'=>'Bitmap Menu Entry',
'text'=>'ʤ򤷤˥塼ιܤϥƥȤǤϤʤӥåȥޥåפɽƤޤʳǤ¾Υ˥塼ܤѤޤ',
- 'bitmap'=>'', 'default'=>0,
+ 'bitmap'=>'', 'default'=>0,
'buttons'=>'λ')} )
['info', 'questhead', 'error'].each{|icon|
- add('command', 'bitmap'=>icon, 'hidemargin'=>1,
+ add('command', 'bitmap'=>icon, 'hidemargin'=>1,
'command'=>proc{print "You invoked the #{icon} bitmap\n"})
}
@@ -203,7 +203,7 @@ TkMenu.new($menu8x_demo, 'tearoff'=>false) {|m|
m.add('cascade', 'label'=>'More', 'menu'=>more_menu, 'underline'=>0)
[ 'ȥ','̤Υȥ','⤷ʤ','ۤȤɲ⤷ʤ',
'յΤ' ].each{|i|
- add('command', 'label'=>i,
+ add('command', 'label'=>i,
'command'=>proc{print "You invoked \"#{i}\"\n"})
}
}
@@ -211,7 +211,7 @@ TkMenu.new($menu8x_demo, 'tearoff'=>false) {|m|
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,
+ add('command', 'label'=>c, 'background'=>c,
'command'=>proc{print "You invoked \"#{c}\"\n"})
}
}
@@ -219,8 +219,8 @@ TkMenu.new($menu8x_demo, 'tearoff'=>false) {|m|
$menu8x_demo.configure('menu'=>m)
}
-TkMenu.bind('<MenuSelect>',
- proc{|w|
+TkMenu.bind('<MenuSelect>',
+ proc{|w|
begin
label = w.entrycget('active', 'label')
rescue
diff --git a/ext/tk/sample/demos-jp/menubu.rb b/ext/tk/sample/demos-jp/menubu.rb
index 78418ce3ea..90dc367305 100644
--- a/ext/tk/sample/demos-jp/menubu.rb
+++ b/ext/tk/sample/demos-jp/menubu.rb
@@ -17,7 +17,7 @@ def optionMenu(menubutton, varName, firstValue, *rest)
for i in rest
menu.add 'radio', 'label'=>i, 'variable'=>varName
end
-
+
return menu
end
@@ -189,7 +189,7 @@ msg.pack('side'=>'top', 'padx'=>25, 'pady'=>25)
TkFrame.new(center) {|f|
menubuttonoptions = TkVariable.new
mbutton = TkMenubutton.new(f)
- options = optionMenu(mbutton, menubuttonoptions,
+ options = optionMenu(mbutton, menubuttonoptions,
'one', 'two', 'three')
mbutton.pack('side'=>'left', 'padx'=>25, 'pady'=>25)
paletteColor = TkVariable.new
diff --git a/ext/tk/sample/demos-jp/msgbox.rb b/ext/tk/sample/demos-jp/msgbox.rb
index ed5d01252e..88380e08bd 100644
--- a/ext/tk/sample/demos-jp/msgbox.rb
+++ b/ext/tk/sample/demos-jp/msgbox.rb
@@ -5,7 +5,7 @@
# toplevel widget ¸ߤк
if defined?($msgbox_demo) && $msgbox_demo
- $msgbox_demo.destroy
+ $msgbox_demo.destroy
$msgbox_demo = nil
end
@@ -48,9 +48,9 @@ TkFrame.new(base_frame) {|frame|
# frame
$msgbox_leftframe = TkFrame.new(base_frame)
$msgbox_rightframe = TkFrame.new(base_frame)
-$msgbox_leftframe .pack('side'=>'left', 'expand'=>'yes', 'fill'=>'y',
+$msgbox_leftframe .pack('side'=>'left', 'expand'=>'yes', 'fill'=>'y',
'pady'=>'.5c', 'padx'=>'.5c')
-$msgbox_rightframe.pack('side'=>'left', 'expand'=>'yes', 'fill'=>'y',
+$msgbox_rightframe.pack('side'=>'left', 'expand'=>'yes', 'fill'=>'y',
'pady'=>'.5c', 'padx'=>'.5c')
TkLabel.new($msgbox_leftframe, 'text'=>'').pack('side'=>'top')
@@ -59,9 +59,9 @@ TkFrame.new($msgbox_leftframe, 'relief'=>'ridge', 'bd'=>1, 'height'=>2)\
$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,
+ 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')
}
@@ -70,20 +70,20 @@ TkFrame.new($msgbox_rightframe, 'relief'=>'ridge', 'bd'=>1, 'height'=>2)\
.pack('side'=>'top', 'fill'=>'x', 'expand'=>'no')
$msgboxType = TkVariable.new('ok')
-['abortretryignore', 'ok', 'okcancel',
+['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,
+ 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,
+ 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,
+ 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
index 8c80e08d70..d61f25129a 100644
--- a/ext/tk/sample/demos-jp/msgbox2.rb
+++ b/ext/tk/sample/demos-jp/msgbox2.rb
@@ -5,7 +5,7 @@
# toplevel widget ¸ߤк
if defined?($msgbox2_demo) && $msgbox2_demo
- $msgbox2_demo.destroy
+ $msgbox2_demo.destroy
$msgbox2_demo = nil
end
@@ -41,16 +41,16 @@ TkFrame.new(base_frame) {|frame|
TkButton.new(frame) {
text 'åܥå'
- command proc{showMessageBox2 $msgbox2_demo}
+ command proc{showMessageBox $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',
+$msgbox_leftframe .pack('side'=>'left', 'expand'=>'yes', 'fill'=>'y',
'pady'=>'.5c', 'padx'=>'.5c')
-$msgbox_rightframe.pack('side'=>'left', 'expand'=>'yes', 'fill'=>'y',
+$msgbox_rightframe.pack('side'=>'left', 'expand'=>'yes', 'fill'=>'y',
'pady'=>'.5c', 'padx'=>'.5c')
TkLabel.new($msgbox_leftframe, 'text'=>'').pack('side'=>'top')
@@ -59,9 +59,9 @@ TkFrame.new($msgbox_leftframe, 'relief'=>'ridge', 'bd'=>1, 'height'=>2)\
$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,
+ 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')
}
@@ -70,21 +70,21 @@ TkFrame.new($msgbox_rightframe, 'relief'=>'ridge', 'bd'=>1, 'height'=>2)\
.pack('side'=>'top', 'fill'=>'x', 'expand'=>'no')
$msgboxType = TkVariable.new('ok')
-['abortretryignore', 'ok', 'okcancel',
+['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,
+ 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,
+def showMessageBox(w)
+ button = Tk.messageBox('icon'=>$msgboxIcon.value, 'type'=>$msgboxType.value,
'title'=>'Message', 'parent'=>w,
- 'message'=>"\"#{$msgboxType.value}\"פΥåܥå",
+ 'message'=>"\"#{$msgboxType.value}\"פΥåܥå",
'detail'=>"\"#{$msgboxType.value}\"ȤΥåܥåǡ\"#{$msgboxIcon.value}\"ΥɽƤޤΥܥΤ줫򤷤ƥåƤ")
- Tk.messageBox('icon'=>'info', 'type'=>'ok', 'parent'=>w,
+ 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
index 987a073086..f994e83ff1 100644
--- a/ext/tk/sample/demos-jp/paned1.rb
+++ b/ext/tk/sample/demos-jp/paned1.rb
@@ -8,7 +8,7 @@
# 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.destroy
$paned1_demo = nil
end
@@ -20,8 +20,8 @@ $paned1_demo = TkToplevel.new {|w|
base_frame = TkFrame.new($paned1_demo).pack(:fill=>:both, :expand=>true)
-TkLabel.new(base_frame,
- :font=>$font, :wraplength=>'4i', :justify=>:left,
+TkLabel.new(base_frame,
+ :font=>$font, :wraplength=>'4i', :justify=>:left,
:text=><<EOL).pack(:side=>:top)
οդ줿ĤΥɥδ֤λڤȤϡĤΰ򤽤줾ΥɥΤʬ䤹뤿ΤΤǤܥǻڤȡʬ䥵ѹǤϺɽϤʤ줺ꤵȤɽޤޥˤڤɿ路ƥѹɽʤ褦ˤϡޥܥȤäƤ
⤷ʤȤäƤ Ruby ˥󥯤Ƥ Tk 饤֥꤬ panedwindow Ƥʤ
@@ -45,7 +45,7 @@ TkFrame.new(base_frame){|f|
}
TkPanedwindow.new(base_frame, :orient=>:horizontal){|f|
- add(Tk::Label.new(f, :text=>"This is the\nleft side", :bg=>'yellow'),
+ 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
index a1aee81690..cdc8253402 100644
--- a/ext/tk/sample/demos-jp/paned2.rb
+++ b/ext/tk/sample/demos-jp/paned2.rb
@@ -8,7 +8,7 @@
# 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.destroy
$paned2_demo = nil
end
@@ -20,8 +20,8 @@ $paned2_demo = TkToplevel.new {|w|
base_frame = TkFrame.new($paned2_demo).pack(:fill=>:both, :expand=>true)
-TkLabel.new(base_frame,
- :font=>$font, :wraplength=>'4i', :justify=>:left,
+TkLabel.new(base_frame,
+ :font=>$font, :wraplength=>'4i', :justify=>:left,
:text=><<EOL).pack(:side=>:top)
ΥСդΥåȤ֤줿ĤΥɥδ֤λڤȤϡĤΰ򤽤줾ΥɥΤʬ䤹뤿ΤΤǤܥǻڤȡʬ䥵ѹǤϺɽϤʤ줺ꤵȤɽޤޥˤڤɿ路ƥѹɽʤ褦ˤϡޥܥȤäƤ
⤷ʤȤäƤ Ruby ˥󥯤Ƥ Tk 饤֥꤬ panedwindow Ƥʤ
@@ -47,23 +47,23 @@ TkFrame.new(base_frame){|f|
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',
+ 'TkButton',
+ 'TkCanvas',
+ 'TkCheckbutton',
+ 'TkEntry',
+ 'TkFrame',
+ 'TkLabel',
+ 'TkLabelframe',
+ 'TkListbox',
+ 'TkMenu',
+ 'TkMenubutton',
+ 'TkMessage',
+ 'TkPanedwindow',
+ 'TkRadiobutton',
+ 'TkScale',
+ 'TkScrollbar',
+ 'TkSpinbox',
+ 'TkText',
'TkToplevel'
]
@@ -74,20 +74,20 @@ TkPanedwindow.new(base_frame, :orient=>:vertical){|f|
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),
+ itemconfigure(0, :background=>self.cget(:foreground),
:foreground=>self.cget(:background) )
- yscrollbar(TkScrollbar.new(paned2_top).pack(:side=>:right,
+ 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', '֤ƤΤϡ' +
+ insert('1.0', '֤ƤΤϡ' +
'̤ΥƥȥåȤǤ')
xscrollbar(paned2_xscr)
yscrollbar(paned2_yscr)
diff --git a/ext/tk/sample/demos-jp/pendulum.rb b/ext/tk/sample/demos-jp/pendulum.rb
index 48839aa58a..b115f5be2c 100644
--- a/ext/tk/sample/demos-jp/pendulum.rb
+++ b/ext/tk/sample/demos-jp/pendulum.rb
@@ -8,7 +8,7 @@
# destroy toplevel widget for this demo script
if defined?($pendulum_demo) && $pendulum_demo
- $pendulum_demo.destroy
+ $pendulum_demo.destroy
$pendulum_demo = nil
end
@@ -61,14 +61,14 @@ class PendulumAnimationDemo
# Create the canvas containing the graphical representation of the
# simulated system.
- @c = TkCanvas.new(@lf1, :width=>320, :height=>200, :background=>'white',
+ @c = TkCanvas.new(@lf1, :width=>320, :height=>200, :background=>'white',
:borderwidth=>2, :relief=>:sunken)
- TkcText.new(@c, 5, 5, :anchor=>:nw,
+ 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,
+ @bob = TkcOval.new(@c, 1, 1, 2, 2,
:width=>3, :fill=>'yellow', :outline=>'black')
TkcOval.new(@c, 155, 20, 165, 30, :fill=>'grey50', :outline=>'')
@@ -78,22 +78,22 @@ class PendulumAnimationDemo
# 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',
+ @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;
+ # 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,
+ @label_theta = TkcText.new(@k, 0, 0, :anchor=>:ne,
:text=>'q', :font=>'Symbol 8')
- @label_dtheta = TkcText.new(@k, 0, 0, :anchor=>:ne,
+ @label_dtheta = TkcText.new(@k, 0, 0, :anchor=>:ne,
:text=>'dq', :font=>'Symbol 8')
# pack
@@ -111,19 +111,19 @@ class PendulumAnimationDemo
# 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)},
+ 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 },
+ 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|
+ @k.bind('Configure', proc{|h, w|
h = h.to_i
w = w.to_i
- @psh = h/2;
+ @psh = h/2;
@psw = w/2
@x_axis.coords(2, @psh, w-2, @psh)
@y_axis.coords(@psw, h-2, @psw, 2)
@@ -144,9 +144,9 @@ class PendulumAnimationDemo
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
+ # 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)
diff --git a/ext/tk/sample/demos-jp/plot.rb b/ext/tk/sample/demos-jp/plot.rb
index a49ed00df8..9ff71904cd 100644
--- a/ext/tk/sample/demos-jp/plot.rb
+++ b/ext/tk/sample/demos-jp/plot.rb
@@ -5,7 +5,7 @@
# toplevel widget ¸ߤк
if defined?($plot_demo) && $plot_demo
- $plot_demo.destroy
+ $plot_demo.destroy
$plot_demo = nil
end
@@ -19,7 +19,7 @@ $plot_demo = TkToplevel.new {|w|
base_frame = TkFrame.new($plot_demo).pack(:fill=>:both, :expand=>true)
# label
-TkLabel.new(base_frame, 'font'=>$font, 'wraplength'=>'4i', 'justify'=>'left',
+TkLabel.new(base_frame, 'font'=>$font, 'wraplength'=>'4i', 'justify'=>'left',
'text'=>"Υɥϴñ2ΥץåȤޤХ widgetǤɽ줿ޥܥ1ǥɥåƥǡ򤤤뤳ȤǤޤ"){
pack('side'=>'top')
}
@@ -57,45 +57,45 @@ $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,
+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,
+ 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,
+ 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,
+ 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',
+$plot_canvas.itembind('point', 'Any-Enter',
proc{$plot_canvas.itemconfigure 'current','fill','red'})
-$plot_canvas.itembind('point', 'Any-Leave',
+$plot_canvas.itembind('point', 'Any-Leave',
proc{$plot_canvas.itemconfigure 'current','fill','SkyBlue2'})
-$plot_canvas.itembind('point', '1',
+$plot_canvas.itembind('point', '1',
proc{|x,y| plotDown $plot_canvas,x,y}, "%x %y")
-$plot_canvas.itembind('point', 'ButtonRelease-1',
+$plot_canvas.itembind('point', 'ButtonRelease-1',
proc{$plot_canvas.dtag 'selected'})
-$plot_canvas.bind('B1-Motion',
+$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
+# 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:
diff --git a/ext/tk/sample/demos-jp/puzzle.rb b/ext/tk/sample/demos-jp/puzzle.rb
index 16d7ce497c..2febc2c55a 100644
--- a/ext/tk/sample/demos-jp/puzzle.rb
+++ b/ext/tk/sample/demos-jp/puzzle.rb
@@ -5,7 +5,7 @@
# toplevel widget ¸ߤк
if defined?($puzzle_demo) && $puzzle_demo
- $puzzle_demo.destroy
+ $puzzle_demo.destroy
$puzzle_demo = nil
end
@@ -49,7 +49,7 @@ TkFrame.new(base_frame) {|frame|
# frame
#
# Special trick: scrollbar widget Ƥ trough color Ѥ뤳Ȥ
-# ʬΤΰſ򤷡ꤹ
+# ʬΤΰſ򤷡ꤹ
#
begin
if Tk.windowingsystem() == 'aqua'
@@ -69,7 +69,7 @@ end
# depend_on_button_width = true
depend_on_button_width = false
-
+
s = TkScrollbar.new(base_frame)
base = TkFrame.new(base_frame) {
width frameWidth
@@ -103,7 +103,7 @@ order = [3,1,6,2,5,7,15,13,4,11,8,9,14,10,12]
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],
+ }.place('relx'=>$xpos[num], 'rely'=>$ypos[num],
'relwidth'=>0.25, 'relheight'=>0.25)
}
$xpos['space'] = 0.75
diff --git a/ext/tk/sample/demos-jp/radio.rb b/ext/tk/sample/demos-jp/radio.rb
index 3355f25116..a61ad46d9b 100644
--- a/ext/tk/sample/demos-jp/radio.rb
+++ b/ext/tk/sample/demos-jp/radio.rb
@@ -5,7 +5,7 @@
# toplevel widget ¸ߤк
if defined?($radio_demo) && $radio_demo
- $radio_demo.destroy
+ $radio_demo.destroy
$radio_demo = nil
end
diff --git a/ext/tk/sample/demos-jp/radio2.rb b/ext/tk/sample/demos-jp/radio2.rb
index 91496beb6d..cf53e3e485 100644
--- a/ext/tk/sample/demos-jp/radio2.rb
+++ b/ext/tk/sample/demos-jp/radio2.rb
@@ -10,7 +10,7 @@
# toplevel widget
if defined?($radio2_demo) && $radio2_demo
- $radio2_demo.destroy
+ $radio2_demo.destroy
$radio2_demo = nil
end
@@ -23,7 +23,7 @@ $radio2_demo = TkToplevel.new {|w|
base_frame = TkFrame.new($radio2_demo).pack(:fill=>:both, :expand=>true)
-# label
+# label
msg = TkLabel.new(base_frame) {
font $font
wraplength '5i'
@@ -32,12 +32,12 @@ msg = TkLabel.new(base_frame) {
}
msg.pack('side'=>'top')
-#
+#
size = TkVariable.new
color = TkVariable.new
align = TkVariable.new
-# frame
+# frame
TkFrame.new(base_frame) {|frame|
TkButton.new(frame) {
#text 'λ'
@@ -58,24 +58,24 @@ TkFrame.new(base_frame) {|frame|
TkButton.new(frame) {
text 'ѿ'
command proc{
- showVars(base_frame,
+ 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'=>'ʸ',
+# frame
+f_left = TkLabelFrame.new(base_frame, 'text'=>'ʸ',
'pady'=>2, 'padx'=>2)
-f_mid = TkLabelFrame.new(base_frame, 'text'=>'',
+f_mid = TkLabelFrame.new(base_frame, 'text'=>'',
'pady'=>2, 'padx'=>2)
-f_right = TkLabelFrame.new(base_frame, 'text'=>'ӥåȥޥå',
+f_right = TkLabelFrame.new(base_frame, 'text'=>'ӥåȥޥå',
'pady'=>2, 'padx'=>2)
f_left.pack('side'=>'left', 'expand'=>'yes', 'padx'=>'.5c', 'pady'=>'.5c')
f_mid.pack('side'=>'left', 'expand'=>'yes', 'padx'=>'.5c', 'pady'=>'.5c')
f_right.pack('side'=>'left', 'expand'=>'yes', 'padx'=>'.5c', 'pady'=>'.5c')
-# radiobutton
+# radiobutton
[10, 12, 18, 24].each {|sz|
TkRadioButton.new(f_left) {
text "ݥȥ #{sz}"
@@ -95,15 +95,15 @@ f_right.pack('side'=>'left', 'expand'=>'yes', 'padx'=>'.5c', 'pady'=>'.5c')
}.pack('side'=>'top', 'pady'=>2, 'fill'=>'x')
}
-# label = TkLabel.new(f_right, 'text'=>'٥', 'bitmap'=>'questhead',
-label = Tk::Label.new(f_right, 'text'=>'٥', 'bitmap'=>'questhead',
+# label = TkLabel.new(f_right, 'text'=>'٥', 'bitmap'=>'questhead',
+label = Tk::Label.new(f_right, 'text'=>'٥', 'bitmap'=>'questhead',
'compound'=>'left')
label.configure('width'=>TkWinfo.reqwidth(label), 'compound'=>'top')
label.height(TkWinfo.reqheight(label))
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,
+ TkRadioButton.new(f_right, 'text'=>a, 'variable'=>align, 'relief'=>'flat',
+ 'value'=>lower, 'indicatoron'=>0, 'width'=>7,
'command'=>proc{label.compound(align.value)})
}
diff --git a/ext/tk/sample/demos-jp/radio3.rb b/ext/tk/sample/demos-jp/radio3.rb
index 763c522448..4bbc1b31f5 100644
--- a/ext/tk/sample/demos-jp/radio3.rb
+++ b/ext/tk/sample/demos-jp/radio3.rb
@@ -10,7 +10,7 @@
# toplevel widget
if defined?($radio3_demo) && $radio3_demo
- $radio3_demo.destroy
+ $radio3_demo.destroy
$radio3_demo = nil
end
@@ -23,7 +23,7 @@ $radio3_demo = TkToplevel.new {|w|
base_frame = TkFrame.new($radio3_demo).pack(:fill=>:both, :expand=>true)
-# label
+# label
msg = TkLabel.new(base_frame) {
font $font
wraplength '5i'
@@ -37,50 +37,50 @@ size = TkVariable.new
color = TkVariable.new
align = TkVariable.new
-# frame
+# frame
TkFrame.new(base_frame) {|frame|
- TkGrid(TkFrame.new(frame, :height=>2, :relief=>:sunken, :bd=>2),
+ 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,
+ TkGrid('x',
+ TkButton.new(frame, :text=>'ѿ',
+ :image=>$image['view'], :compound=>:left,
:command=>proc{
- showVars(base_frame, ['size', size],
+ 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,
+ }),
+ 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'=>'ʸ',
+# frame
+f_left = TkLabelFrame.new(base_frame, 'text'=>'ʸ',
'pady'=>2, 'padx'=>2)
-f_mid = TkLabelFrame.new(base_frame, 'text'=>'',
+f_mid = TkLabelFrame.new(base_frame, 'text'=>'',
'pady'=>2, 'padx'=>2)
-f_right = TkLabelFrame.new(base_frame, 'text'=>'ӥåȥޥå',
+f_right = TkLabelFrame.new(base_frame, 'text'=>'ӥåȥޥå',
'pady'=>2, 'padx'=>2)
f_left .grid('column'=>0, 'row'=>1, 'pady'=>'.5c', 'padx'=>'.5c', 'rowspan'=>2)
f_mid .grid('column'=>1, 'row'=>1, 'pady'=>'.5c', 'padx'=>'.5c', 'rowspan'=>2)
f_right.grid('column'=>2, 'row'=>1, 'pady'=>'.5c', 'padx'=>'.5c')
-TkButton.new(base_frame, 'text'=>'ȥ饤ơ',
+TkButton.new(base_frame, 'text'=>'ȥ饤ơ',
'command'=>proc{size.value = 'multi'; color.value = 'multi'}){
grid('column'=>2, 'row'=>2, 'pady'=>'.5c', 'padx'=>'.5c')
}
-# radiobutton
+# radiobutton
[10, 12, 14, 18, 24].each {|sz|
TkRadioButton.new(f_left) {
text "ݥȥ #{sz}"
@@ -103,14 +103,14 @@ TkButton.new(base_frame, 'text'=>'ȥ饤ơ',
}.pack('side'=>'top', 'pady'=>2, 'fill'=>'x')
}
-# label = TkLabel.new(f_right, 'text'=>'٥', 'bitmap'=>'questhead',
-label = Tk::Label.new(f_right, 'text'=>'٥', 'bitmap'=>'questhead',
+# label = TkLabel.new(f_right, 'text'=>'٥', 'bitmap'=>'questhead',
+label = Tk::Label.new(f_right, 'text'=>'٥', 'bitmap'=>'questhead',
'compound'=>'left')
label.configure('width'=>TkWinfo.reqwidth(label), 'compound'=>'top')
label.height(TkWinfo.reqheight(label))
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,
+ TkRadioButton.new(f_right, 'text'=>a, 'variable'=>align, 'relief'=>'flat',
+ 'value'=>a.downcase, 'indicatoron'=>0, 'width'=>7,
'command'=>proc{label.compound(align.value)})
}
diff --git a/ext/tk/sample/demos-jp/ruler.rb b/ext/tk/sample/demos-jp/ruler.rb
index a721b95a6a..d6bc9e76d1 100644
--- a/ext/tk/sample/demos-jp/ruler.rb
+++ b/ext/tk/sample/demos-jp/ruler.rb
@@ -18,7 +18,7 @@ end
# toplevel widget ¸ߤк
if defined?($ruler_demo) && $ruler_demo
- $ruler_demo.destroy
+ $ruler_demo.destroy
$ruler_demo = nil
end
@@ -32,7 +32,7 @@ $ruler_demo = TkToplevel.new {|w|
base_frame = TkFrame.new($ruler_demo).pack(:fill=>:both, :expand=>true)
# label
-TkLabel.new(base_frame, 'font'=>$font, 'wraplength'=>'5i', 'justify'=>'left',
+TkLabel.new(base_frame, 'font'=>$font, 'wraplength'=>'5i', 'justify'=>'left',
'text'=>"ΥХwidgetϥ롼顼ϷǤ롼顼αˤΤϥ֥ȥåפΰͤǡĥäƤ뤳Ȥˤäƥ֥ȥåפ뤳ȤǤޤޤǤˤ륿֥ȥåפưȤǤޤ֥ȥåפޤϲˤɽޤǥɥåȡޥܥΥˤΥ֥ȥåפϾäޤ"){
pack('side'=>'top')
}
@@ -62,8 +62,8 @@ $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,
+ $demo_rulerInfo = Struct.new("RulerInfo", :grid, :left, :right, :x, :y,
+ :top, :bottom, :size, :normalStyle,
:activeStyle, :deleteStyle).new
end
$demo_rulerInfo.grid = '.25c'
@@ -75,17 +75,17 @@ $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, '..',
+ $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, '..',
+ $demo_rulerInfo.deleteStyle = {'fill'=>'black',
+ 'stipple'=>'@'+[$demo_dir, '..',
'images', 'gray25.xbm'].join(File::Separator)}
end
-TkcLine.new($ruler_canvas,
+TkcLine.new($ruler_canvas,
'1c', '0.5c', '1c', '1c', '13c', '1c', '13c', '0.5c', 'width'=>1)
(0..11).each{|i|
x = i+1
@@ -99,21 +99,21 @@ TkcLine.new($ruler_canvas,
$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',
+ 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'),
+ 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',
+$ruler_canvas.itembind('tab', '1',
proc{|x,y| rulerSelectTab($ruler_canvas,x,y)}, '%x %y')
-$ruler_canvas.bind('B1-Motion',
+$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)})
diff --git a/ext/tk/sample/demos-jp/sayings.rb b/ext/tk/sample/demos-jp/sayings.rb
index b3bdbe0bc5..aa24b3a2ad 100644
--- a/ext/tk/sample/demos-jp/sayings.rb
+++ b/ext/tk/sample/demos-jp/sayings.rb
@@ -5,7 +5,7 @@
# toplevel widget ¸ߤк
if defined?($sayings_demo) && $sayings_demo
- $sayings_demo.destroy
+ $sayings_demo.destroy
$sayings_demo = nil
end
@@ -67,11 +67,11 @@ TkFrame.new(base_frame, 'borderwidth'=>10) {|w|
sayings_lbox.pack('expand'=>'yes', 'fill'=>'y')
else
- sayings_lbox.grid('row'=>0, 'column'=>0,
+ sayings_lbox.grid('row'=>0, 'column'=>0,
'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news')
- sv.grid('row'=>0, 'column'=>1,
+ sv.grid('row'=>0, 'column'=>1,
'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news')
- sh.grid('row'=>1, 'column'=>0,
+ 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)
diff --git a/ext/tk/sample/demos-jp/search.rb b/ext/tk/sample/demos-jp/search.rb
index 293ae83910..9838ff5d19 100644
--- a/ext/tk/sample/demos-jp/search.rb
+++ b/ext/tk/sample/demos-jp/search.rb
@@ -58,13 +58,13 @@ end
def textToggle(cmd1,sleep1,cmd2,sleep2)
sleep_list = [sleep2, sleep1]
- TkAfter.new(proc{sleep = sleep_list.shift; sleep_list.push(sleep); sleep},
+ 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.destroy
$search_demo = nil
end
@@ -98,35 +98,35 @@ $search_buttons.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
# frame
TkFrame.new(base_frame) {|f|
- TkLabel.new(f, 'text'=>'ե̾:',
+ TkLabel.new(f, 'text'=>'ե̾:',
'width'=>13, 'anchor'=>'w').pack('side'=>'left')
$search_fileName = TkVariable.new
- TkEntry.new(f, 'width'=>40,
+ 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,
+ TkButton.new(f, 'text'=>'ɤ߹',
+ 'command'=>proc{textLoadFile($search_text,
$search_fileName.value)})\
.pack('side'=>'left', 'pady'=>5, 'padx'=>10)
}.pack('side'=>'top', 'fill'=>'x')
TkFrame.new(base_frame) {|f|
- TkLabel.new(f, 'text'=>'ʸ:',
+ TkLabel.new(f, 'text'=>'ʸ:',
'width'=>13, 'anchor'=>'w').pack('side'=>'left')
$search_searchString = TkVariable.new
- $search_string_entry = TkEntry.new(f, 'width'=>40,
+ $search_string_entry = TkEntry.new(f, 'width'=>40,
'textvariable'=>$search_searchString) {
pack('side'=>'left')
- bind('Return', proc{textSearch($search_text, $search_searchString.value,
+ bind('Return', proc{textSearch($search_text, $search_searchString.value,
$search_Tag)})
}
- TkButton.new(f, 'text'=>'ȿž',
- 'command'=>proc{textSearch($search_text,
- $search_searchString.value,
+ TkButton.new(f, 'text'=>'ȿž',
+ 'command'=>proc{textSearch($search_text,
+ $search_searchString.value,
$search_Tag)}) {
pack('side'=>'left', 'pady'=>5, 'padx'=>10)
}
@@ -139,26 +139,26 @@ $search_text = TkText.new(base_frame, 'setgrid'=>true) {|t|
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',
+ $search_Tag.configure('background'=>'#ce5555',
'foreground'=>'white')
},
- 800,
+ 800,
proc{
$search_Tag.configure('background'=>'', 'foreground'=>'')
},
200 )
else
textToggle(proc{
- $search_Tag.configure('background'=>'black',
+ $search_Tag.configure('background'=>'black',
'foreground'=>'white')
},
- 800,
+ 800,
proc{
$search_Tag.configure('background'=>'', 'foreground'=>'')
},
diff --git a/ext/tk/sample/demos-jp/spin.rb b/ext/tk/sample/demos-jp/spin.rb
index 2bcc3217e6..8d4e33cda0 100644
--- a/ext/tk/sample/demos-jp/spin.rb
+++ b/ext/tk/sample/demos-jp/spin.rb
@@ -7,7 +7,7 @@
# based on Tcl/Tk8.4.4 widget demos
if defined?($spin_demo) && $spin_demo
- $spin_demo.destroy
+ $spin_demo.destroy
$spin_demo = nil
end
@@ -19,8 +19,8 @@ $spin_demo = TkToplevel.new {|w|
base_frame = TkFrame.new($spin_demo).pack(:fill=>:both, :expand=>true)
-TkLabel.new(base_frame,
- :font=>$font, :wraplength=>'5i', :justify=>:left,
+TkLabel.new(base_frame,
+ :font=>$font, :wraplength=>'5i', :justify=>:left,
:text=><<EOL).pack(:side=>:top)
ˤϣΥԥܥåɽƤޤ
줾졢ޥ򤷤ʸϤ뤳ȤǤޤ
@@ -38,7 +38,7 @@ Backspace Control-h Ȥϥκ¦ʸ
⤷ʤȤäƤ Ruby ˥󥯤Ƥ Tk 饤
֥꤬ spinbox åȤƤʤ硢
ǥϤޤưʤϤǤξˤ spinbox
-åȤƤ褦ʤ꿷С Tk
+åȤƤ褦ʤ꿷С Tk
Ȥ߹碌ƻ褦ˤƤ
EOL
@@ -56,16 +56,16 @@ TkFrame.new(base_frame){|f|
}
australianCities = [
- 'Canberra', 'Sydney', 'Melbourne', 'Perth', 'Adelaide',
+ 'Canberra', 'Sydney', 'Melbourne', 'Perth', 'Adelaide',
'Brisbane', 'Hobart', 'Darwin', 'Alice Springs'
]
[
- TkSpinbox.new(base_frame, :from=>1, :to=>10, :width=>10, :validate=>:key,
+ 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, :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/states.rb b/ext/tk/sample/demos-jp/states.rb
index f354d28d84..5e242b7c38 100644
--- a/ext/tk/sample/demos-jp/states.rb
+++ b/ext/tk/sample/demos-jp/states.rb
@@ -5,7 +5,7 @@
# toplevel widget ¸ߤк
if defined?($states_demo) && $states_demo
- $states_demo.destroy
+ $states_demo.destroy
$states_demo = nil
end
diff --git a/ext/tk/sample/demos-jp/style.rb b/ext/tk/sample/demos-jp/style.rb
index 3189e1f6d8..66b6de0251 100644
--- a/ext/tk/sample/demos-jp/style.rb
+++ b/ext/tk/sample/demos-jp/style.rb
@@ -5,7 +5,7 @@
# toplevel widget ¸ߤк
if defined?($style_demo) && $style_demo
- $style_demo.destroy
+ $style_demo.destroy
$style_demo = nil
end
@@ -76,13 +76,13 @@ txt = TkText.new(base_frame){|t|
# when /^8.*/
# unless $style_demo_do_first
# $style_demo_do_first = true
-# Tk.tk_call('font', 'create', '@bigascii',
+# Tk.tk_call('font', 'create', '@bigascii',
# '-copy', '-*-Courier-Bold-R-Normal--*-140-*-*-*-*-*-*')
-# Tk.tk_call('font', 'create', '@smallascii',
+# Tk.tk_call('font', 'create', '@smallascii',
# '-copy', '-Adobe-Helvetica-Bold-R-Normal-*-100-*')
-# Tk.tk_call('font', 'create', '@cBigFont',
+# Tk.tk_call('font', 'create', '@cBigFont',
# '-compound', '@bigascii @msg_knj')
-# Tk.tk_call('font', 'create', '@cSmallFont',
+# Tk.tk_call('font', 'create', '@cSmallFont',
# '-compound', '@smallascii @kanji')
# end
# style_tag_big = TkTextTag.new(t, 'font'=>'@cBigFont')
@@ -96,24 +96,24 @@ txt = TkText.new(base_frame){|t|
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',
+ style_tag_color1 = TkTextTag.new(t, 'background'=>'black',
'foreground'=>'white')
- style_tag_color2 = TkTextTag.new(t, 'background'=>'black',
+ style_tag_color2 = TkTextTag.new(t, 'background'=>'black',
'foreground'=>'white')
- style_tag_raised = TkTextTag.new(t, 'background'=>'white',
+ style_tag_raised = TkTextTag.new(t, 'background'=>'white',
'relief'=>'raised', 'borderwidth'=>1)
- style_tag_sunken = TkTextTag.new(t, 'background'=>'white',
+ 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,
+ style_tag_bgstipple = TkTextTag.new(t, 'background'=>'black',
+ 'borderwidth'=>0,
'bgstipple'=>'gray25')
else
- style_tag_bgstipple = TkTextTag.new(t, 'background'=>'black',
- 'borderwidth'=>0,
+ style_tag_bgstipple = TkTextTag.new(t, 'background'=>'black',
+ 'borderwidth'=>0,
'bgstipple'=>'gray12')
end
style_tag_fgstipple = TkTextTag.new(t, 'fgstipple'=>'gray50')
@@ -217,9 +217,9 @@ X')
9. ޡ', style_tag_big)
insert('end', 'ƥȤκ¦;ʬʶ֤ȤǤޤ:
')
- insert('end', 'ϥޡλǤ꡼',
+ insert('end', 'ϥޡλǤ꡼',
style_tag_margins)
- insert('end', 'ޤ֤ɽƤ1ԤΥƥȤǤ',
+ insert('end', 'ޤ֤ɽƤ1ԤΥƥȤǤ',
style_tag_margins)
insert('end', '¦ˤ2Υޡޤ', style_tag_margins)
insert('end', '1ܤФΤȡ', style_tag_margins)
@@ -241,9 +241,9 @@ spacing3')
insert('end', 'ζ֤
򼨤ޤ
')
- insert('end', 'ΥǥȤ줿ϤɤΤ褦',
+ insert('end', 'ΥǥȤ줿ϤɤΤ褦',
style_tag_spacing)
- insert('end', 'ڡ󥰤ԤΤ򼨤ޤ',
+ insert('end', 'ڡ󥰤ԤΤ򼨤ޤ',
style_tag_spacing)
insert('end', 'ϼºݤϥƥwidget', style_tag_spacing)
insert('end', '1ԤǡwidgetˤäޤޤƤޤ
@@ -253,11 +253,11 @@ spacing3')
insert('end', 'ˤꡢδ֤礭ʴֳ֤', style_tag_spacing)
insert('end', '¸ߤƤޤ', style_tag_spacing)
insert('end', 'Spacing22pointꤵƤޤ', style_tag_spacing)
- insert('end', 'ˤۤξֳ֤¸ߤƤޤ',
+ insert('end', 'ˤۤξֳ֤¸ߤƤޤ',
style_tag_spacing)
insert('end', 'Spacing3ϤǤϻѤƤޤ
', style_tag_spacing)
- insert('end', 'ֳ֤ɤˤ뤫򸫤С',
+ insert('end', 'ֳ֤ɤˤ뤫򸫤С',
style_tag_spacing)
insert('end', 'ʤǥƥȤ򤷤Ƥ', style_tag_spacing)
insert('end', 'ȿžʬˤ;ʬˤȤ줿ֳ֤', style_tag_spacing)
diff --git a/ext/tk/sample/demos-jp/text.rb b/ext/tk/sample/demos-jp/text.rb
index ea15064830..0ae480eb00 100644
--- a/ext/tk/sample/demos-jp/text.rb
+++ b/ext/tk/sample/demos-jp/text.rb
@@ -5,7 +5,7 @@
# toplevel widget ¸ߤк
if defined?($text_demo) && $text_demo
- $text_demo.destroy
+ $text_demo.destroy
$text_demo = nil
end
diff --git a/ext/tk/sample/demos-jp/textpeer.rb b/ext/tk/sample/demos-jp/textpeer.rb
index de604f1940..4967a99c92 100644
--- a/ext/tk/sample/demos-jp/textpeer.rb
+++ b/ext/tk/sample/demos-jp/textpeer.rb
@@ -5,7 +5,7 @@
# based on Tcl/Tk8.5.0 widget demos
if defined?($textpeer_demo) && $textpeer_demo
- $textpeer_demo.destroy
+ $textpeer_demo.destroy
$textpeer_demo = nil
end
@@ -43,11 +43,11 @@ def makeClone(count, win, txt)
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)κ',
+ b1 = TkButton.new(win, :widgetname=>"clone#{cnt}",
+ :text=>'ԥ(peer)κ',
:command=>proc{makeClone(count, win, peer)})
- b2 = TkButton.new(win, :widgetname=>"kill#{cnt}",
- :text=>'ԥ(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)
@@ -57,7 +57,7 @@ def makeClone(count, win, txt)
end
def killClone(win, cnt)
- Tk.destroy("#{win.path}.text#{cnt}", "#{win.path}.sb#{cnt}",
+ Tk.destroy("#{win.path}.text#{cnt}", "#{win.path}.sb#{cnt}",
"#{win.path}.clone#{cnt}", "#{win.path}.kill#{cnt}")
end
diff --git a/ext/tk/sample/demos-jp/toolbar.rb b/ext/tk/sample/demos-jp/toolbar.rb
index 570d52704f..9cb3834c34 100644
--- a/ext/tk/sample/demos-jp/toolbar.rb
+++ b/ext/tk/sample/demos-jp/toolbar.rb
@@ -7,7 +7,7 @@
# 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.destroy
$toolbar_demo = nil
end
@@ -73,7 +73,7 @@ if Tk.windowingsystem != 'aqua'
w.grid_remove
self.wm_manage
# self.wm_title('Toolbar') # ⤷å̾򥦥ɥȥˤʤʤ顤ꤷƤ
- self.wm_protocol('WM_DELETE_WINDOW'){ self.untearoff(w) }
+ self.wm_protocol('WM_DELETE_WINDOW'){ self.untearoff(self) }
end
def tbar_base.untearoff(w)
self.wm_forget
@@ -86,28 +86,28 @@ end
text = TkText.new(base_frame, :width=>40, :height=>10)
## Toolbar contents
-tb_btn = Ttk::Button.new(tbar_base, :text=>'ܥ', :style=>'Toolbutton',
+tb_btn = Ttk::Button.new(tbar_base, :text=>'ܥ', :style=>'Toolbutton',
:command=>proc{
text.insert(:end, "ܥ󤬲ޤ\n")
})
-tb_chk = Ttk::Checkbutton.new(tbar_base, :text=>'åܥ',
- :style=>'Toolbutton',
- :variable=>(check = TkVariable.new),
+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,
+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',
+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,
+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')
@@ -120,16 +120,16 @@ base_frame.grid_columnconfigure(text, :weight=>1)
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,
+ 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
index 00d715282b..c3b4191144 100644
--- a/ext/tk/sample/demos-jp/tree.rb
+++ b/ext/tk/sample/demos-jp/tree.rb
@@ -8,7 +8,7 @@
# 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.destroy
$tree_demo = nil
end
@@ -21,8 +21,8 @@ $tree_demo = TkToplevel.new {|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],
+Ttk::Label.new(base_frame, :font=>$font, :wraplength=>'4i',
+ :justify=>:left, :anchor=>'n', :padding=>[10, 2, 10, 6],
:text=><<EOL).pack(:fill=>:x)
TtkȤϡơ޻ǽʿåȽǤ\
Υץϡե륷ƥΤ褦ʳŪʥǡ\
@@ -38,16 +38,16 @@ EOL
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,
+ 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)
@@ -56,7 +56,7 @@ Ttk::Frame.new(base_frame) {|frame|
## 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,
+ populate_tree(tree, tree.insert(nil, :end, :text=>dir,
:values=>[dir, 'directory']))
}
end
@@ -69,7 +69,7 @@ def populate_tree(tree, node)
tree.delete(tree.children(node))
Dir.glob("#{path}/*").sort.each{|f|
type = File.ftype(f)
- id = tree.insert(node, :end,
+ id = tree.insert(node, :end,
:text=>File.basename(f), :values=>[f, type]).id
if type == 'directory'
## Make it so that this node is openable
@@ -95,7 +95,7 @@ def populate_tree(tree, node)
end
## Create the tree and set it up
-tree = Ttk::Treeview.new(base_frame, :columns=>%w(fullpath type size),
+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))
diff --git a/ext/tk/sample/demos-jp/ttkbut.rb b/ext/tk/sample/demos-jp/ttkbut.rb
index 90ec3fce5b..4d577120bb 100644
--- a/ext/tk/sample/demos-jp/ttkbut.rb
+++ b/ext/tk/sample/demos-jp/ttkbut.rb
@@ -9,7 +9,7 @@
# 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.destroy
$ttkbut_demo = nil
end
@@ -21,7 +21,7 @@ $ttkbut_demo = TkToplevel.new {|w|
base_frame = TkFrame.new($ttkbut_demo).pack(:fill=>:both, :expand=>true)
-Ttk::Label.new(base_frame, :font=>$font, :wraplength=>'4i', :justify=>:left,
+Ttk::Label.new(base_frame, :font=>$font, :wraplength=>'4i', :justify=>:left,
:text=><<EOL).pack(:side=>:top, :fill=>:x)
TtkȤϡơ޻ǽʿåȽǤ\
ʤܤˤƤΤTtkΥơ޲٥ǡ\
@@ -40,11 +40,11 @@ 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,
+# 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,
+ Ttk::Button.new(buttons, :text=>theme,
:command=>proc{Ttk.set_theme theme}).pack(:pady=>2)
}
@@ -68,9 +68,9 @@ 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,
+e = Ttk::Checkbutton.new(checks, :text=>'ͭ', :variable=>enabled,
:command=>proc{
- setState($ttkbut_demo,
+ setState($ttkbut_demo,
((enabled.bool)? "!disabled" : "disabled"),
e)
})
@@ -96,15 +96,15 @@ radios = Ttk::Labelframe.new(base_frame, :text=>'饸ܥ')
happyness = TkVariable.new
-r1 = Ttk::Radiobutton.new(radios, :variable=>happyness,
+r1 = Ttk::Radiobutton.new(radios, :variable=>happyness,
:text=>'Great', :value=>'great')
-r2 = Ttk::Radiobutton.new(radios, :variable=>happyness,
+r2 = Ttk::Radiobutton.new(radios, :variable=>happyness,
:text=>'Good', :value=>'good')
-r3 = Ttk::Radiobutton.new(radios, :variable=>happyness,
+r3 = Ttk::Radiobutton.new(radios, :variable=>happyness,
:text=>'Ok', :value=>'ok')
-r4 = Ttk::Radiobutton.new(radios, :variable=>happyness,
+r4 = Ttk::Radiobutton.new(radios, :variable=>happyness,
:text=>'Poor', :value=>'poor')
-r5 = Ttk::Radiobutton.new(radios, :variable=>happyness,
+r5 = Ttk::Radiobutton.new(radios, :variable=>happyness,
:text=>'Awful', :value=>'awful')
Tk.pack(r1, r2, r3, r4, r5, :fill=>:x, :padx=>3, :pady=>2)
@@ -113,26 +113,26 @@ Tk.pack(r1, r2, r3, r4, r5, :fill=>:x, :padx=>3, :pady=>2)
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,
+ TkGrid('x',
+ Ttk::Button.new(frame, :text=>'ѿ',
+ :image=>$image['view'], :compound=>:left,
:command=>proc{
- showVars(base_frame, ['ͭ', enabled],
- ['', cheese], ['ȥޥ', tomato],
- ['Х', basil], ['쥬', oregano],
+ 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,
+ }),
+ 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)
diff --git a/ext/tk/sample/demos-jp/ttkmenu.rb b/ext/tk/sample/demos-jp/ttkmenu.rb
index 9e78678c8e..d349b42d11 100644
--- a/ext/tk/sample/demos-jp/ttkmenu.rb
+++ b/ext/tk/sample/demos-jp/ttkmenu.rb
@@ -8,7 +8,7 @@
# 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.destroy
$ttkmenu_demo = nil
end
@@ -20,7 +20,7 @@ $ttkmenu_demo = TkToplevel.new {|w|
base_frame = Ttk::Frame.new($ttkmenu_demo).pack(:fill=>:both, :expand=>true)
-Ttk::Label.new(base_frame, :font=>$font, :wraplength=>'4i', :justify=>:left,
+Ttk::Label.new(base_frame, :font=>$font, :wraplength=>'4i', :justify=>:left,
:text=><<EOL).pack(:side=>:top, :fill=>:x)
TtkȤϡơ޻ǽʿåȽǤ\
ˤơޤб뤳ȤǤ褦ˤʤäåȤΤҤȤĤ\
@@ -45,16 +45,16 @@ Ttk::Separator.new(base_frame).pack(:side=>:top, :fill=>:x)
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,
+ 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)
diff --git a/ext/tk/sample/demos-jp/ttknote.rb b/ext/tk/sample/demos-jp/ttknote.rb
index f0cd258893..09cc7960a3 100644
--- a/ext/tk/sample/demos-jp/ttknote.rb
+++ b/ext/tk/sample/demos-jp/ttknote.rb
@@ -8,7 +8,7 @@
# 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.destroy
$ttknote_demo = nil
end
@@ -22,16 +22,16 @@ $ttknote_demo = TkToplevel.new {|w|
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,
+ 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)
@@ -40,13 +40,13 @@ Ttk::Frame.new($ttknote_demo) {|frame|
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,
+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',
+msg_m = Ttk::Label.new(f_msg, :font=>$font, :wraplength=>'5i',
:justify=>:left, :anchor=>'n', :text=><<EOL)
TtkȤϡơ޻ǽʿåȽǤ\
˴ޤޤ륦åȤΤҤȤĤ˥Ρȥ֥ååȤޤ\
@@ -64,7 +64,7 @@ Ctrl+TabϤˤäƤԤȤǤޤ\
EOL
neat = TkVariable.new
after_id = nil
-msg_b = Ttk::Button.new(f_msg, :text=>'Ƥ(Neat!)', :underline=>6,
+msg_b = Ttk::Button.new(f_msg, :text=>'Ƥ(Neat!)', :underline=>6,
:command=>proc{
neat.value = 'ΤȤꤵ'
Tk.after_cancel(after_id) if after_id
diff --git a/ext/tk/sample/demos-jp/ttkpane.rb b/ext/tk/sample/demos-jp/ttkpane.rb
index a7b458a683..96670c0e5c 100644
--- a/ext/tk/sample/demos-jp/ttkpane.rb
+++ b/ext/tk/sample/demos-jp/ttkpane.rb
@@ -7,7 +7,7 @@
# 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.destroy
$ttkpane_demo = nil
end
@@ -19,7 +19,7 @@ $ttkpane_demo = TkToplevel.new {|w|
base_frame = TkFrame.new($ttkpane_demo).pack(:fill=>:both, :expand=>true)
-Ttk::Label.new(base_frame, :font=>$font, :wraplength=>'4i', :justify=>:left,
+Ttk::Label.new(base_frame, :font=>$font, :wraplength=>'4i', :justify=>:left,
:text=><<EOL).pack(:side=>:top, :fill=>:x)
Υǥϡߴطˤơդڥɥɥ򼨤Ƥޤ\
줾礭ϡޤޤƤڥδ֤ˤ륨ꥢĤ\
@@ -32,16 +32,16 @@ Ttk::Separator.new(base_frame).pack(:side=>:top, :fill=>:x)
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,
+ 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)
@@ -61,26 +61,26 @@ if Tk.windowingsystem == 'aqua'
end
# Fill the button pane
-Ttk::Button.new(left_top, :text=>'Ƥ',
+Ttk::Button.new(left_top, :text=>'Ƥ',
:command=>proc{
- Tk.messageBox(:type=>'ok', :icon=>'info',
- :message=>'Ƥơ',
- :detail=>'That hurt...', :parent=>base_frame,
+ 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/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'],
+ [':America/New_York'],
+ [':Asia/Singapore'],
+ [':Australia/Sydney'],
+ [':Asia/Tokyo'],
]
zones = []
@@ -158,7 +158,7 @@ time = TkVariable.new_hash
case tzinfo
when :tcl
update_proc = proc{|now, tz, label|
- time[label] = Tk.tk_call('clock', 'format', now.tv_sec,
+ time[label] = Tk.tk_call('clock', 'format', now.tv_sec,
'-timezone', tz, '-format', '%T')
}
when :tzinfo
@@ -179,7 +179,7 @@ end
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),
+ Ttk::Label.new(left_bot, :textvariable=>time.ref(label),
:anchor=>'w').pack(:fill=>:x)
}
diff --git a/ext/tk/sample/demos-jp/ttkprogress.rb b/ext/tk/sample/demos-jp/ttkprogress.rb
index 82898bf50e..43a9cbcd7e 100644
--- a/ext/tk/sample/demos-jp/ttkprogress.rb
+++ b/ext/tk/sample/demos-jp/ttkprogress.rb
@@ -7,7 +7,7 @@
# 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.destroy
$ttkprogress_demo = nil
end
@@ -19,7 +19,7 @@ $ttkprogress_demo = TkToplevel.new {|w|
base_frame = TkFrame.new($ttkprogress_demo).pack(:fill=>:both, :expand=>true)
-Ttk::Label.new(base_frame, :font=>$font, :wraplength=>'4i', :justify=>:left,
+Ttk::Label.new(base_frame, :font=>$font, :wraplength=>'4i', :justify=>:left,
:text=><<EOL).pack(:side=>:top, :fill=>:x)
ˤΤĤΥץ쥹СǤ\
ΤΤ"determinate"פΥץ쥹Сǡ\
@@ -37,16 +37,16 @@ EOL
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,
+ 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)
@@ -57,9 +57,9 @@ 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',
+start = Ttk::Button.new(frame, :text=>'Start Progress',
:command=>proc{ p1.start; p2.start })
-stop = Ttk::Button.new(frame, :text=>'Stop Progress',
+stop = Ttk::Button.new(frame, :text=>'Stop Progress',
:command=>proc{ p1.stop; p2.stop })
Tk.grid(p1, '-', :pady=>5, :padx=>10)
diff --git a/ext/tk/sample/demos-jp/twind.rb b/ext/tk/sample/demos-jp/twind.rb
index bd0b060754..faefaefd6e 100644
--- a/ext/tk/sample/demos-jp/twind.rb
+++ b/ext/tk/sample/demos-jp/twind.rb
@@ -5,7 +5,7 @@
# toplevel widget ¸ߤк
if defined?($twind_demo) && $twind_demo
- $twind_demo.destroy
+ $twind_demo.destroy
$twind_demo = nil
end
@@ -39,10 +39,10 @@ $twind_buttons.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
# frame
$twind_text = nil
-TkFrame.new(base_frame, 'highlightthickness'=>2, 'borderwidth'=>2,
+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',
+ $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)}
@@ -52,11 +52,11 @@ TkFrame.new(base_frame, 'highlightthickness'=>2, 'borderwidth'=>2,
}.pack('expand'=>'yes', 'fill'=>'both')
#
-$tag_center = TkTextTag.new($twind_text,
+$tag_center = TkTextTag.new($twind_text,
'justify' =>'center',
'spacing1'=>'5m',
'spacing3'=>'5m' )
-$tag_buttons = TkTextTag.new($twind_text,
+$tag_buttons = TkTextTag.new($twind_text,
'lmargin1'=>'1c',
'lmargin2'=>'1c',
'rmargin' =>'1c',
@@ -65,14 +65,14 @@ $tag_buttons = TkTextTag.new($twind_text,
'spacing3'=>0 )
# ƥȤ
-$twind_text.insert('end',
+$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',
+TkTextWindow.new($twind_text, 'end',
'window'=>TkButton.new($twind_text) {
#text 'ON'
text ''
@@ -81,7 +81,7 @@ TkTextWindow.new($twind_text, 'end',
})
$twind_text.insert('end', "ˤޤޤ2ĤΥܥ򥯥å\n")
$twind_text.insert('end', 'ʿΥ')
-TkTextWindow.new($twind_text, 'end',
+TkTextWindow.new($twind_text, 'end',
'window'=>TkButton.new($twind_text) {
#text 'OFF'
text ''
@@ -91,7 +91,7 @@ TkTextWindow.new($twind_text, 'end',
$twind_text.insert('end', 'ˤޤ')
$twind_text.insert('end', '⤦ҤȤĤǤ')
-TkTextWindow.new($twind_text, 'end',
+TkTextWindow.new($twind_text, 'end',
'window'=>TkButton.new($twind_text) {
text '򥯥å'
command proc{textWindPlot $twind_text}
@@ -101,7 +101,7 @@ $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',
+TkTextWindow.new($twind_text, 'end',
'window'=>TkButton.new($twind_text) {
text 'õ'
command proc{textWindDel $twind_text}
@@ -125,7 +125,7 @@ $twind_text.insert('end', '⤦Ʊܥ򲡤ȸޤ
')
-TkTextWindow.new($twind_text, 'end',
+TkTextWindow.new($twind_text, 'end',
'window'=>TkButton.new($twind_text) {|b|
text 'ǥե'
command proc{embDefBg $twind_text}
@@ -134,7 +134,7 @@ TkTextWindow.new($twind_text, 'end',
},
'padx'=>3 )
embToggle = TkVariable.new('Short')
-TkTextWindow.new($twind_text, 'end',
+TkTextWindow.new($twind_text, 'end',
'window'=>TkCheckButton.new($twind_text) {
textvariable embToggle
indicatoron 0
@@ -145,21 +145,21 @@ TkTextWindow.new($twind_text, 'end',
pady 5
padx 2
},
- 'padx'=>3,
+ 'padx'=>3,
'pady'=>2 )
-[ 'AntiqueWhite3', 'Bisque1', 'Bisque2', 'Bisque3', 'Bisque4',
- 'SlateBlue3', 'RoyalBlue1', 'SteelBlue2', 'DeepSkyBlue3', 'LightBlue1',
- 'DarkSlateGray1', 'Aquamarine2', 'DarkSeaGreen2', 'SeaGreen1',
- 'Yellow1', 'IndianRed1', 'IndianRed2', 'Tan1', 'Tan4'
+[ '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',
+ 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,
+ 'padx'=>3,
'pady'=>2 )
}
@@ -217,39 +217,39 @@ def textWindPlot (t)
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,
+ 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,
+ 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,
+ 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,
+ 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',
+ $twind_plot.itembind('point', 'Any-Enter',
proc{$twind_plot.itemconfigure 'current', 'fill', 'red'})
- $twind_plot.itembind('point', 'Any-Leave',
+ $twind_plot.itembind('point', 'Any-Leave',
proc{$twind_plot.itemconfigure 'current', 'fill', 'SkyBlue2'})
- $twind_plot.itembind('point', '1',
+ $twind_plot.itembind('point', '1',
proc{|x,y| embPlotDown $twind_plot,x,y}, "%x %y")
- $twind_plot.itembind('point', 'ButtonRelease-1',
+ $twind_plot.itembind('point', 'ButtonRelease-1',
proc{$twind_plot.dtag 'selected'})
- $twind_plot.bind('B1-Motion',
+ $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
diff --git a/ext/tk/sample/demos-jp/twind2.rb b/ext/tk/sample/demos-jp/twind2.rb
index 96000b0e14..2a26b28ef6 100644
--- a/ext/tk/sample/demos-jp/twind2.rb
+++ b/ext/tk/sample/demos-jp/twind2.rb
@@ -5,7 +5,7 @@
# toplevel widget ¸ߤк
if defined?($twind2_demo) && $twind2_demo
- $twind2_demo.destroy
+ $twind2_demo.destroy
$twind2_demo = nil
end
@@ -20,20 +20,20 @@ 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),
+ 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,
+ 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)
}
@@ -41,11 +41,11 @@ $twind2_buttons.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
# frame
$twind2_text = nil
-TkFrame.new(base_frame, 'highlightthickness'=>2, 'borderwidth'=>2,
+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',
+ # '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)}
@@ -55,11 +55,11 @@ TkFrame.new(base_frame, 'highlightthickness'=>2, 'borderwidth'=>2,
}.pack('expand'=>'yes', 'fill'=>'both')
#
-$tag2_center = TkTextTag.new($twind2_text,
+$tag2_center = TkTextTag.new($twind2_text,
'justify' =>'center',
'spacing1'=>'5m',
'spacing3'=>'5m' )
-$tag2_buttons = TkTextTag.new($twind2_text,
+$tag2_buttons = TkTextTag.new($twind2_text,
'lmargin1'=>'1c',
'lmargin2'=>'1c',
'rmargin' =>'1c',
@@ -86,7 +86,7 @@ $twind2_text.insert('end', '㤨СˤϣĤ')
$twind2_text.insert('end', 'ܥ󥦥åȤޤƤޤ')
$twind2_text.insert('end', 'ǽΥܥ򥯥åȡ')
$twind2_text.insert('end', 'ʿΥ ')
-TkTextWindow.new($twind2_text, 'end',
+TkTextWindow.new($twind2_text, 'end',
'window'=>TkButton.new($twind2_text) {
#text 'ON'
text ''
@@ -95,7 +95,7 @@ TkTextWindow.new($twind2_text, 'end',
})
$twind2_text.insert('end', "ˤޤޤĤΥܥ򥯥å\n")
$twind2_text.insert('end', 'ʿΥ')
-TkTextWindow.new($twind2_text, 'end',
+TkTextWindow.new($twind2_text, 'end',
'window'=>TkButton.new($twind2_text) {
#text 'OFF'
text ''
@@ -105,7 +105,7 @@ TkTextWindow.new($twind2_text, 'end',
$twind2_text.insert('end', "ˤޤ\n\n")
$twind2_text.insert('end', 'Ϥ⤦ҤȤĤǤ')
-TkTextWindow.new($twind2_text, 'end',
+TkTextWindow.new($twind2_text, 'end',
'window'=>TkButton.new($twind2_text) {
text '򥯥å'
command proc{textWindPlot2 $twind2_text}
@@ -116,7 +116,7 @@ $mark2_plot = TkTextMark.new($twind2_text, 'insert')
$mark2_plot.gravity='left'
$twind2_text.insert('end', 'ޥǥɥå뤳Ȥǡ')
$twind2_text.insert('end', 'ץåȾΥǡư뤳ȤǤޤ')
-TkTextWindow.new($twind2_text, 'end',
+TkTextWindow.new($twind2_text, 'end',
'window'=>TkButton.new($twind2_text) {
text 'õ'
command proc{textWindDel2 $twind2_text}
@@ -148,7 +148,7 @@ btn_default = TkButton.new($twind2_text) {|b|
}
TkTextWindow.new($twind2_text, 'end', 'window'=>btn_default, 'padx'=>3)
embToggle = TkVariable.new('Short')
-TkTextWindow.new($twind2_text, 'end',
+TkTextWindow.new($twind2_text, 'end',
'window'=>TkCheckButton.new($twind2_text) {
textvariable embToggle
indicatoron 0
@@ -159,21 +159,21 @@ TkTextWindow.new($twind2_text, 'end',
pady 5
padx 2
},
- 'padx'=>3,
+ 'padx'=>3,
'pady'=>2 )
-[ 'AntiqueWhite3', 'Bisque1', 'Bisque2', 'Bisque3', 'Bisque4',
- 'SlateBlue3', 'RoyalBlue1', 'SteelBlue2', 'DeepSkyBlue3', 'LightBlue1',
- 'DarkSlateGray1', 'Aquamarine2', 'DarkSeaGreen2', 'SeaGreen1',
- 'Yellow1', 'IndianRed1', 'IndianRed2', 'Tan1', 'Tan4'
+[ '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',
+ 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,
+ 'padx'=>3,
'pady'=>2 )
}
@@ -187,44 +187,44 @@ $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',
+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',
+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',
+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',
+TkTextWindow.new($twind2_text, 'end',
'window'=>TkButton.new($twind2_text, :text=>"Small highlight",
- :cursor=>'top_left_arrow',
+ :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',
+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',
+TkTextWindow.new($twind2_text, 'end',
+ 'window'=>TkButton.new($twind2_text, :text=>"Small pad",
+ :cursor=>'top_left_arrow',
'command'=>proc{
textWinSmallP2 $twind2_text
}))
@@ -232,9 +232,9 @@ TkTextWindow.new($twind2_text, 'end',
$twind2_text.insert('end', "\n\n˥᡼ƥȥåȤ")
$twind2_text.insert('end', "ޤ֤Ǥޤ")
-TkTextImage.new($twind2_text, 'end',
+TkTextImage.new($twind2_text, 'end',
'image'=>TkBitmapImage.new(:file=>[
- $demo_dir, '..',
+ $demo_dir, '..',
'images', 'face.xbm'
].join(File::Separator)))
@@ -309,39 +309,39 @@ def textWindPlot2 (t)
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,
+ 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,
+ 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,
+ 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,
+ 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',
+ $twind2_plot.itembind('point', 'Any-Enter',
proc{$twind2_plot.itemconfigure 'current', 'fill', 'red'})
- $twind2_plot.itembind('point', 'Any-Leave',
+ $twind2_plot.itembind('point', 'Any-Leave',
proc{$twind2_plot.itemconfigure 'current', 'fill', 'SkyBlue2'})
- $twind2_plot.itembind('point', '1',
+ $twind2_plot.itembind('point', '1',
proc{|x,y| embPlotDown2 $twind2_plot,x,y}, "%x %y")
- $twind2_plot.itembind('point', 'ButtonRelease-1',
+ $twind2_plot.itembind('point', 'ButtonRelease-1',
proc{$twind2_plot.dtag 'selected'})
- $twind2_plot.bind('B1-Motion',
+ $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
diff --git a/ext/tk/sample/demos-jp/unicodeout.rb b/ext/tk/sample/demos-jp/unicodeout.rb
index 4857cd131d..178077ec08 100644
--- a/ext/tk/sample/demos-jp/unicodeout.rb
+++ b/ext/tk/sample/demos-jp/unicodeout.rb
@@ -8,7 +8,7 @@
# based on Tcl/Tk8.4.4 widget demos
if defined?($unicodeout_demo) && $unicodeout_demo
- $unicodeout_demo.destroy
+ $unicodeout_demo.destroy
$unicodeout_demo = nil
end
@@ -20,8 +20,8 @@ $unicodeout_demo = TkToplevel.new {|w|
base_frame = TkFrame.new($unicodeout_demo).pack(:fill=>:both, :expand=>true)
-TkLabel.new(base_frame,
- :font=>$font, :wraplength=>'5.4i', :justify=>:left,
+TkLabel.new(base_frame,
+ :font=>$font, :wraplength=>'5.4i', :justify=>:left,
:text=><<EOL).pack(:side=>:top)
ϡTkˤʸѤФ륵ݡȤˤĤƤ\
ץǤɽˤƤʤºݤˤɤΤ褦ɽ\
@@ -55,9 +55,9 @@ TkFrame.new(base_frame){|f|
}).pack(:side=>:left, :expand=>true)
}
-wait_msg = TkLabel.new(base_frame,
- :text=>"եɤ߹ߤδλޤ" +
- "Ф餯Ԥ",
+wait_msg = TkLabel.new(base_frame,
+ :text=>"եɤ߹ߤδλޤ" +
+ "Ф餯Ԥ",
:font=>"Helvetica 12 italic").pack
class Unicodeout_SampleFrame < TkFrame
@@ -77,10 +77,10 @@ class Unicodeout_SampleFrame < TkFrame
def add_sample(lang, *args)
sample_txt = Tk::UTF8_String(args.join(''))
- l = TkLabel.new(self, :font=>@@font, :text=>lang+':',
+ 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,
+ #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')
@@ -96,23 +96,23 @@ oldCursor = $unicodeout_demo.cursor
$unicodeout_demo.cursor('watch')
Tk.update
-f.add_sample('Arabic',
- '\uFE94\uFEF4\uFE91\uFEAE\uFECC\uFEDF\uFE8D\uFE94',
+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 ',
+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 ',
+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, ',
+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 ',
+f.add_sample('Russian',
+ '\u0420\u0443\u0441\u0441\u043A\u0438\u0439 ',
'\u044F\u0437\u044B\u043A')
wait_msg.destroy
diff --git a/ext/tk/sample/demos-jp/widget b/ext/tk/sample/demos-jp/widget
index dfaa9c004e..8eb699e513 100644
--- a/ext/tk/sample/demos-jp/widget
+++ b/ext/tk/sample/demos-jp/widget
@@ -2,8 +2,7 @@
# -*- coding: euc-jp -*-
# ( tk.rb Υɻ encoding /˻Ȥ )
-#if RUBY_VERSION < '1.9.0' ### !!!!!!!!!!!!!!
-unless defined?(::Encoding.default_external)
+if RUBY_VERSION < '1.9.0' ### !!!!!!!!!!!!!!
$KCODE = 'euc'
else
DEFAULT_TK_ENCODING = 'EUC-JP'
@@ -190,14 +189,10 @@ else
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')
+ 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.*/
@@ -886,12 +881,18 @@ def showCode1(demo)
$code_window.title("Demo code: #{file}")
$code_window.iconname(file)
- code = open([$demo_dir, file].join(File::Separator), 'r'){|fid| fid.read }
+# fid = open(file, 'r')
+ fid = open([$demo_dir, file].join(File::Separator), 'r')
$code_text.delete('1.0', 'end')
- code.force_encoding('EUC-JP') if defined?(::Encoding.default_external)
- $code_text.insert('1.0', code)
+ #$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)
@@ -972,12 +973,14 @@ def showCode2(demo)
$code_window.title("Demo code: #{file}")
$code_window.iconname(file)
- code = open([$demo_dir, file].join(File::Separator), 'r'){|fid| fid.read }
+ fid = open([$demo_dir, file].join(File::Separator), 'r')
$code_text.delete('1.0', 'end')
- code.force_encoding('EUC-JP') if defined?(::Encoding.default_external)
- $code_text.insert('1.0', code)
+ $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
@@ -1074,7 +1077,7 @@ end
#
def aboutBox
Tk.messageBox('icon'=>'info', 'type'=>'ok', 'title'=>'About Widget Demo',
- 'message'=>"Ruby/Tk åȥǥ Ver.1.7.1-jp\n\n" +
+ 'message'=>"Ruby/Tk åȥǥ Ver.1.7.0-jp\n\n" +
"based on demos of Tk8.1 -- 8.5 " +
"( Copyright of Tcl/Tk demos:: " +
"(c) 1996-1997 Sun Microsystems, Inc. / " +
diff --git a/ext/tk/sample/editable_listbox.rb b/ext/tk/sample/editable_listbox.rb
index 7a9ad4450b..99345da380 100644
--- a/ext/tk/sample/editable_listbox.rb
+++ b/ext/tk/sample/editable_listbox.rb
@@ -1,115 +1,28 @@
#
-# Tk::RbWidget::Editable_Listbox class
+# Editable_TkListbox 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
+# 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)
+class Editable_TkListbox < TkListbox
+ def _ebox_placer(coord_y)
+ idx = self.nearest(coord_y)
+ x, y, w, h = self.bbox(idx)
+ @ebox.place(:x => 0, :relwidth => 1.0,
+ :y => y - self.selectborderwidth,
+ :height => h + 2 * self.selectborderwidth)
@ebox.pos = idx
+ @ebox.value = self.listvariable.list[idx]
@ebox.focus
end
+ private :_ebox_placer
- 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)
@@ -119,30 +32,38 @@ class Tk::RbWidget::Editable_Listbox < TkListbox
end
@ebox = TkEntry.new(self){
- @pos = nil
+ @pos = -1
def self.pos; @pos; end
def self.pos=(idx); @pos = idx; end
}
- _setup_ebox_bindings
- _setup_listbox_bindings
+ @ebox.bind('Return'){
+ list = self.listvariable.list
+ list[@ebox.pos] = @ebox.value
+ self.listvariable.value = list
+ @ebox.place_forget
+ @ebox.pos = -1
+ }
+
+ @ebox.bind('Escape'){
+ @ebox.place_forget
+ @ebox.pos = -1
+ }
+
+ self.bind('Double-1', '%y'){|y| _ebox_placer(y) }
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)
+ lbox1 = Editable_TkListbox.new.pack(:side=>:left)
+ lbox2 = Editable_TkListbox.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
index 39dc9c4018..b22c2504ac 100644
--- a/ext/tk/sample/encstr_usage.rb
+++ b/ext/tk/sample/encstr_usage.rb
@@ -13,12 +13,12 @@ t3 = TkText.new(:height=>5).pack
src_str = IO.readlines(File.join(File.dirname(__FILE__),'iso2022-kr.txt')).join
-t1.insert('end',
+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',
+t2.insert('end',
"use Tk::EncodedString class (Tk.encoding => '#{Tk.encoding}')\n\n")
t2.insert('end', enc_str)
diff --git a/ext/tk/sample/figmemo_sample.rb b/ext/tk/sample/figmemo_sample.rb
index 25ec618fe8..1b6979d2dd 100644
--- a/ext/tk/sample/figmemo_sample.rb
+++ b/ext/tk/sample/figmemo_sample.rb
@@ -55,14 +55,14 @@ 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
+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
+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
+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.
@@ -108,8 +108,8 @@ EOT
@border = 2
@selectborder = 1
@delta = @border + @selectborder
- @entry = TkEntry.new(self, :relief=>:ridge, :borderwidth=>@border,
- :selectborderwidth=>@selectborder,
+ @entry = TkEntry.new(self, :relief=>:ridge, :borderwidth=>@border,
+ :selectborderwidth=>@selectborder,
:highlightthickness=>0)
@entry.bind('Return'){@state.value = 0}
@@ -131,7 +131,7 @@ EOT
x = w.canvasx(x)
y = w.canvasy(y)
tag = nil
- w.find_overlapping(x - @overlap_d, y - @overlap_d,
+ 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+)$/
@@ -161,8 +161,8 @@ EOT
def _state1(x,y) # set center
@mode = 1
- @target = TkcOval.new(self,
- [canvasx(x), canvasy(y)], [canvasx(x), canvasy(y)],
+ @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]
@@ -175,16 +175,16 @@ EOT
@mode = 2
r = Integer(Math.sqrt((x-@mark[0])**2 + (y-@mark[1])**2))
- @target.coords([canvasx(@mark[0] - r), canvasy(@mark[1] - r)],
+ @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],
+ @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]
@@ -196,7 +196,7 @@ EOT
def _state4(x,y) # create line
@mode = 4
- @target.coords([canvasx(@mark[0]), canvasy(@mark[1])],
+ @target.coords([canvasx(@mark[0]), canvasy(@mark[1])],
[canvasx(x), canvasy(y)])
end
@@ -232,8 +232,8 @@ EOT
@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,
+ ewin = TkcWindow.new(self, [canvasx(x)+dx, canvasy(y)+dy],
+ :window=>@entry, :state=>:normal, :anchor=>anchor,
:tags=>[@memo_id_tag])
@entry.focus
@@ -243,9 +243,9 @@ EOT
ewin.delete
- @target = TkcText.new(self, [canvasx(x), canvasy(y)],
- :anchor=>anchor, :justify=>justify,
- :fill=>@col, :font=>@font, :text=>@entry.value,
+ @target = TkcText.new(self, [canvasx(x), canvasy(y)],
+ :anchor=>anchor, :justify=>justify,
+ :fill=>@col, :font=>@font, :text=>@entry.value,
:tags=>[@memo_id_tag])
_state0()
@@ -305,9 +305,9 @@ def open_file(canvas, fname)
end
filetypes = [
- ['GIF Files', '.gif'],
- ['GIF Files', [], 'GIFF'],
- ['PPM Files', '.ppm'],
+ ['GIF Files', '.gif'],
+ ['GIF Files', [], 'GIFF'],
+ ['PPM Files', '.ppm'],
['PGM Files', '.pgm']
]
@@ -339,7 +339,7 @@ def open_file(canvas, fname)
begin
canvas.load_photo(fpath)
rescue => e
- Tk.messageBox(:icon=>'error', :type=>'ok',
+ Tk.messageBox(:icon=>'error', :type=>'ok',
:message=>"Fail to read '#{fpath}'.\n#{e.message}")
end
@@ -354,11 +354,11 @@ 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', '*'] ],
+ fpath = Tk.getSaveFile(:filetypes=>[ ['Text Files', '.txt'],
+ ['ALL Files', '*'] ],
:initialfile=>initname)
else
- fpath = Tk.getSaveFile(:filetypes=>[ ['Text Files', '.txt'],
+ fpath = Tk.getSaveFile(:filetypes=>[ ['Text Files', '.txt'],
['ALL Files', '*'] ])
end
return if fpath.empty?
@@ -366,7 +366,7 @@ def save_memo(canvas, fname)
begin
fid = open(fpath, 'w')
rescue => e
- Tk.messageBox(:icon=>'error', :type=>'ok',
+ Tk.messageBox(:icon=>'error', :type=>'ok',
:message=>"Fail to open '#{fname.value}'.\n#{e.message}")
end
@@ -384,24 +384,24 @@ 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', '*'] ],
+ fpath = Tk.getSaveFile(:filetypes=>[ ['Postscript Files', '.ps'],
+ ['ALL Files', '*'] ],
:initialfile=>initname)
else
- fpath = Tk.getSaveFile(:filetypes=>[ ['Postscript Files', '.ps'],
+ 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],
+ 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',
+ ret = Tk.messageBox(:icon=>'warning', :type=>'okcancel',
+ :default=>'cancel',
:message=>'Realy quit? ')
exit if ret == 'ok'
end
@@ -413,11 +413,11 @@ 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,
+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,
+usage = TkLabel.new(usage_frame, :text=>PhotoCanvas::USAGE,
:font=>'Helvetica 8', :justify=>:left).pack
show_usage = proc{
@@ -426,20 +426,20 @@ show_usage = proc{
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},
+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],
- '---',
+ [ ['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]
]
]
diff --git a/ext/tk/sample/irbtk.rb b/ext/tk/sample/irbtk.rb
index 70dd33e4da..53ef10d0d1 100644
--- a/ext/tk/sample/irbtk.rb
+++ b/ext/tk/sample/irbtk.rb
@@ -4,8 +4,8 @@
#
# 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'.
+# 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')
diff --git a/ext/tk/sample/irbtkw.rbw b/ext/tk/sample/irbtkw.rbw
index 04de3a2022..3fb6dde626 100644
--- a/ext/tk/sample/irbtkw.rbw
+++ b/ext/tk/sample/irbtkw.rbw
@@ -48,20 +48,10 @@ 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
+ Tk.mainloop
+ irb_thread.kill if irb_thread
}
# window position control
@@ -152,5 +142,5 @@ console.bind('Control-c'){
irb_thread.join
# exit
-ev_loop.kill
+ev_thread.kill
Tk.exit
diff --git a/ext/tk/sample/menubar1.rb b/ext/tk/sample/menubar1.rb
index a233c6e088..9fa1201d41 100644
--- a/ext/tk/sample/menubar1.rb
+++ b/ext/tk/sample/menubar1.rb
@@ -11,21 +11,21 @@ menu_spec = [
{:label=>'Open', :command=>proc{puts('Open clicked')}, :underline=>0},
'---',
['Check_A', TkVariable.new(true), 6],
- {:type=>'checkbutton', :label=>'Check_B',
+ {: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',
+ ['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]],
@@ -33,7 +33,7 @@ menu_spec = [
[['Edit', 0],
['Cut', proc{puts('Cut clicked')}, 2],
['Copy', proc{puts('Copy clicked')}, 0],
- ['Paste', proc{puts('Paste clicked')}, 0]],
+ ['Paste', proc{puts('Paste clicked')}, 0]],
[['Help', 0, {:menu_name=>'help'}],
['About This', proc{puts('Ruby/Tk menubar sample 1')}, 6]]
diff --git a/ext/tk/sample/menubar2.rb b/ext/tk/sample/menubar2.rb
index e3cd68eaef..4507d8b2fe 100644
--- a/ext/tk/sample/menubar2.rb
+++ b/ext/tk/sample/menubar2.rb
@@ -11,21 +11,21 @@ menu_spec = [
{:label=>'Open', :command=>proc{puts('Open clicked')}, :underline=>0},
'---',
['Check_A', TkVariable.new(true), 6],
- {:type=>'checkbutton', :label=>'Check_B',
+ {: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',
+ ['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]],
@@ -33,16 +33,16 @@ menu_spec = [
[['Edit', 0],
['Cut', proc{puts('Cut clicked')}, 2],
['Copy', proc{puts('Copy clicked')}, 0],
- ['Paste', proc{puts('Paste 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,
+mbar = Tk.root.add_menubar(menu_spec,
# followings are default configure options
'tearoff'=>'false',
- 'foreground'=>'grey40',
+ 'foreground'=>'grey40',
'activeforeground'=>'red',
'font'=>'Helvetia 12 bold')
# This (default configure options) is NOT same the following.
diff --git a/ext/tk/sample/menubar3.rb b/ext/tk/sample/menubar3.rb
deleted file mode 100644
index 129cfd779b..0000000000
--- a/ext/tk/sample/menubar3.rb
+++ /dev/null
@@ -1,72 +0,0 @@
-#
-# menubar sample 3 : vertical layout menubar; use frame and menubuttons
-#
-
-require 'tk'
-
-radio_var = TkVariable.new('y')
-
-menu_spec = [
- [['&File', true], # when underline option is ture, '&' index is the position
- {:label=>'Open', :command=>proc{puts('Open clicked')}, :underline=>0},
- '---',
- ['Check_A', TkVariable.new(true), 6],
- {:type=>'checkbutton', :label=>'Check_B',
- :variable=>TkVariable.new, :underline=>6},
- '---',
- ['Radio_X', [radio_var, 'x'], /[XYZ]/, '', {:foreground=>'black'}],
- ['Radio_Y', [radio_var, 'y'], /[XYZ]/],
- ['Radio_Z', [radio_var, 'z'], /[XYZ]/], # use Regexp for underline position
- '---',
- ['cascade', [
- ['sss', proc{p 'sss'}, 0],
- ['ttt', proc{p 'ttt'}, 0],
- ['uuu', proc{p 'uuu'}, 0],
- ['vvv', proc{p 'vvv'}, 0],
- ],
- 0, '',
- {:font=>'Courier 16 italic',
- :menu_config=>{:font=>'Times -18 bold', :foreground=>'black'}}],
- '---',
- ['Quit', proc{exit}, 0]],
-
- [['Edit', 0],
- ['Cut', proc{puts('Cut clicked')}, 2],
- ['Copy', proc{puts('Copy clicked')}, 0],
- ['Paste', proc{puts('Paste clicked')}, 0]],
-
- [['Help', 0, {:menu_name=>'help'}],
- ['About This', proc{puts('Ruby/Tk menubar sample 3')}, "This"]]
- # use string index for underline position
-]
-
-layout_proc = 'vertical'
-# The following procedure is same to 'layout_proc'=>'vertical'
-=begin
-layout_proc = proc{|parent, mbtn|
- mbtn.direction :right
- mbtn.pack(:side=>:top, :fill=>:x)
-
- menu = mbtn.menu
- cmd = proc{|m, dir|
- Tk::Menu::TkInternalFunction.next_menu(m, dir) rescue nil
- # ignore error when the internal function doesn't exist
- }
- menu.bind('Tab', cmd, :widget, 'forward')
- menu.bind('Alt-Tab', cmd, :widget, 'backward')
-}
-=end
-
-menubar = TkMenubar.new(nil, menu_spec,
- 'layout_proc'=>layout_proc,
- 'tearoff'=>false,
- 'foreground'=>'grey40',
- 'activeforeground'=>'red',
- 'font'=>'Helvetia 12 bold')
-menubar.pack('side'=>'left', 'fill'=>'y')
-
-TkText.new(:wrap=>'word').pack.insert('1.0', 'This sample script generates "Menu Sidebar".
-If "::tk::MenuNextMenuon" function is available your Tcl/Tk library, you will be able to move to the next menu by Tab key on the posted menu, or the previous menu by Alt + Tab key.
-Please read the sample source, and check how to override default configure options of menu entries on a menu_spec. Maybe, on windows, this menubar does not work properly about keyboard shortcuts. Then, please use "menu" option of root/toplevel widget (see sample/menubar3.rb).')
-
-Tk.mainloop
diff --git a/ext/tk/sample/msgs_rb/README b/ext/tk/sample/msgs_rb/README
index d986e031fd..2e3ff2a9c4 100644
--- a/ext/tk/sample/msgs_rb/README
+++ b/ext/tk/sample/msgs_rb/README
@@ -1,3 +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'.
+Please refer '../msgs_tk/README'.
diff --git a/ext/tk/sample/multi-ip_sample.rb b/ext/tk/sample/multi-ip_sample.rb
index eccf0201f8..8d6e1bc626 100644
--- a/ext/tk/sample/multi-ip_sample.rb
+++ b/ext/tk/sample/multi-ip_sample.rb
@@ -19,6 +19,7 @@ cmd = Proc.new{|txt|
else
root = TkRoot.new(:title=>'timer sample')
end
+
label = TkLabel.new(:parent=>root, :relief=>:raised, :width=>10) \
.pack(:side=>:bottom, :fill=>:both)
@@ -47,7 +48,6 @@ cmd = Proc.new{|txt|
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')
}
@@ -80,20 +80,19 @@ 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,
+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,
+TkTimer.new(10000, 1,
proc{
trusted_slave.eval_proc{Tk.root.destroy}
trusted_slave.delete
diff --git a/ext/tk/sample/multi-ip_sample2.rb b/ext/tk/sample/multi-ip_sample2.rb
index 79c78dec4a..f4a45d8d9a 100644
--- a/ext/tk/sample/multi-ip_sample2.rb
+++ b/ext/tk/sample/multi-ip_sample2.rb
@@ -14,7 +14,7 @@ cmd = proc{|s|
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',
+ 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)
diff --git a/ext/tk/sample/optobj_sample.rb b/ext/tk/sample/optobj_sample.rb
index a781254a28..cafacbdd17 100644
--- a/ext/tk/sample/optobj_sample.rb
+++ b/ext/tk/sample/optobj_sample.rb
@@ -12,13 +12,13 @@ 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,
+optobj.assign( b1,
+ [ b2, 'configure',
+ { 'foreground'=>'background',
+ 'background'=>'foreground' } ],
+ [ b3, nil,
+ { 'foreground'=>'background',
+ 'activeforeground'=>nil,
'background'=>['foreground', 'activeforeground'] } ] )
optobj.update('activeforeground'=>'yellow')
@@ -29,26 +29,26 @@ TkButton.new(f){
}
TkButton.new(f){
- configure( optobj.assign([self, nil,
- {'foreground'=>'activeforeground',
- 'background'=>'foreground',
+ 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
+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',
+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',
+TkButton.new(f, :text=>'exit',
:command=>proc{exit}).pack(:fill=>:x, :pady=>10)
TkFrame.new{|f|
diff --git a/ext/tk/sample/propagate.rb b/ext/tk/sample/propagate.rb
index 66f14aeb72..800cef553d 100644
--- a/ext/tk/sample/propagate.rb
+++ b/ext/tk/sample/propagate.rb
@@ -3,7 +3,7 @@ require 'tk'
TkLabel.new(:text=>"Please click the bottom frame").pack
-f = TkFrame.new(:width=>400, :height=>100, :background=>'yellow',
+f = TkFrame.new(:width=>400, :height=>100, :background=>'yellow',
:relief=>'ridge', :borderwidth=>5).pack
# TkPack.propagate(f, false) # <== important!!
diff --git a/ext/tk/sample/remote-ip_sample.rb b/ext/tk/sample/remote-ip_sample.rb
index f6eed9e985..3696a20852 100644
--- a/ext/tk/sample/remote-ip_sample.rb
+++ b/ext/tk/sample/remote-ip_sample.rb
@@ -3,8 +3,8 @@ 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.
+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
#'
@@ -19,15 +19,15 @@ 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 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',
+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
index d8cf3c7650..e12b2a96c9 100644
--- a/ext/tk/sample/remote-ip_sample2.rb
+++ b/ext/tk/sample/remote-ip_sample2.rb
@@ -17,23 +17,23 @@ ip = RemoteTkIp.new(app)
# setup remote-ip window
btns = []
ip.eval_proc{
- btns <<
+ 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 <<
+ 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 <<
+ 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)
@@ -41,15 +41,15 @@ ip.eval_proc{
# 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,
+ # 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}",
+ 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',
+TkButton.new(:command=>proc{exit}, :text=>'QUIT',
:padx=>10, :pady=>7).pack(:padx=>10, :pady=>7)
# start eventloop
diff --git a/ext/tk/sample/safe-tk.rb b/ext/tk/sample/safe-tk.rb
index 2aeae235df..e2289697e0 100644
--- a/ext/tk/sample/safe-tk.rb
+++ b/ext/tk/sample/safe-tk.rb
@@ -7,32 +7,29 @@ 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,
+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]}
+ip = MultiTkIp.new_safe_slave(1)
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}',
+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)}',
+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}',
+TkLabel.new(:text=>'z = proc{p [\'proc z\', "$SAFE==#{$SAFE}"]; exit}',
:anchor=>:w).pack(:fill=>:x)
puts "\n---- call 1st eval_proc ----------"
@@ -45,14 +42,12 @@ p lbl = ip.eval_proc{
# 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)}',
+ 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,
+ TkButton.new(:text=>':command=>proc{exit}',
+ :command=>proc{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
@@ -67,33 +62,19 @@ p ip.eval_proc(proc{
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,
+ 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,
+ 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}',
+ TkButton.new(:text=>':command=>proc{z.call}',
:command=>proc{z.call}).pack(:fill=>:x, :padx=>5)
- TkFrame.new(:borderwidth=>2, :height=>3,
+ TkFrame.new(:borderwidth=>2, :height=>3,
:relief=>:sunken).pack(:fill=>:x, :expand=>true,
:padx=>10, :pady=>7)
})
@@ -104,15 +85,15 @@ p bind = ip.eval_str('
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)}",
+ 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 }',
+ TkButton.new(:text=>':command=>proc{ l.text = $SAFE }',
:command=>proc{ l.text = $SAFE }).pack(:fill=>:x, :padx=>5)
- TkFrame.new(:borderwidth=>2, :height=>3,
+ TkFrame.new(:borderwidth=>2, :height=>3,
:relief=>:sunken).pack(:fill=>:x, :expand=>true,
:padx=>10, :pady=>7)
", bind)
@@ -125,7 +106,7 @@ 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 }',
+ TkButton.new(:text=>':command=>proc{ lbl.text = $SAFE }',
:command=>proc{ lbl.text = $SAFE }).pack(:fill=>:x, :padx=>5)
}
diff --git a/ext/tk/sample/scrollframe.rb b/ext/tk/sample/scrollframe.rb
index 6a9381d465..b0ac6d3874 100644
--- a/ext/tk/sample/scrollframe.rb
+++ b/ext/tk/sample/scrollframe.rb
@@ -1,19 +1,19 @@
#
-# Tk::RbWidget::ScrollFrame class
+# Tk::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
+# Scrollbars can be toggled by Tk::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'
-class Tk::RbWidget::ScrollFrame < TkFrame
+class Tk::ScrollFrame < TkFrame
include TkComposite
DEFAULT_WIDTH = 200
@@ -27,8 +27,8 @@ class Tk::RbWidget::ScrollFrame < TkFrame
@v_scroll = TkScrollbar.new(@frame, 'orient'=>'vertical')
# create a canvas widget
- @canvas = TkCanvas.new(@frame,
- :borderwidth=>0, :selectborderwidth=>0,
+ @canvas = TkCanvas.new(@frame,
+ :borderwidth=>0, :selectborderwidth=>0,
:highlightthickness=>0)
# allignment
@@ -209,38 +209,28 @@ end
# test
if __FILE__ == $0
- f = Tk::RbWidget::ScrollFrame.new(:scrollbarwidth=>10,
- :width=>300, :height=>200)
+ f = Tk::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',
+ 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")
+ t.insert(:end, 'Here is a text widget')
}
- # 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
diff --git a/ext/tk/sample/tcltklib/sample1.rb b/ext/tk/sample/tcltklib/sample1.rb
index 1965781533..13df440751 100644
--- a/ext/tk/sample/tcltklib/sample1.rb
+++ b/ext/tk/sample/tcltklib/sample1.rb
@@ -1,5 +1,5 @@
#! /usr/local/bin/ruby -d
-# -*- encoding: euc-jp -*-
+#! /usr/local/bin/ruby
# -d ץդ, ǥХåɽ.
# tcltk 饤֥Υץ
diff --git a/ext/tk/sample/tcltklib/sample2.rb b/ext/tk/sample/tcltklib/sample2.rb
index f187d6ce1d..110e81ebc4 100644
--- a/ext/tk/sample/tcltklib/sample2.rb
+++ b/ext/tk/sample/tcltklib/sample2.rb
@@ -23,37 +23,37 @@ $button, $canvas, $checkbutton, $frame, $label, $pack, $update, $wm =
"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],
@@ -68,19 +68,19 @@ class Othello
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
@@ -100,7 +100,7 @@ class Othello
x -= dir_x
end until y == row && x == col
end
-
+
def put_disk(row, col, disk)
@data[row][col] = disk
changed
@@ -109,7 +109,7 @@ class Othello
reverse_to(row, col, disk, *dir)
end
end
-
+
def count_disk(disk)
num = 0
@data.each do |rows|
@@ -121,7 +121,7 @@ class Othello
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
@@ -140,7 +140,7 @@ class Othello
end
return 0
end
-
+
def count_point(row, col, my_disk)
count = 0
DIRECTIONS.each do |dir|
@@ -148,14 +148,14 @@ class Othello
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
@@ -173,30 +173,30 @@ class Othello
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",
+ @id = @view.e("create rectangle",
*(view.tk_rect(view.left + col,
view.top + row,
view.left + col + 1,
@@ -219,7 +219,7 @@ class Othello
view.click_square(self)
}))
end
-
+
def blink(color)
@view.e("itemconfigure", @id, "-fill #{color}")
$update.e()
@@ -227,13 +227,13 @@ class Othello
@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)
@@ -242,7 +242,7 @@ class Othello
@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}")
@@ -252,15 +252,15 @@ class Othello
@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
@@ -269,7 +269,7 @@ class Othello
end
end
end
-
+
def draw_disk(row, col, disk)
if disk == EMPTY
if @squares[row][col].oval != nil
@@ -278,7 +278,7 @@ class Othello
end
return
end
-
+
$update.e()
sleep(0.05)
oval = @squares[row][col].oval
@@ -299,7 +299,7 @@ class Othello
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))
@@ -311,7 +311,7 @@ class Othello
end
@othello.show_point
end
-
+
def each_square
@squares.each do |rows|
rows.each do |square|
@@ -319,7 +319,7 @@ class Othello
end
end
end
-
+
def click_square(square)
if @othello.in_com_turn || @othello.game_over ||
@board.count_point(square.row,
@@ -331,15 +331,15 @@ class Othello
@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
@@ -352,39 +352,39 @@ class Othello
"}")
#### ޤ
$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")
@@ -393,7 +393,7 @@ class Othello
com_turn unless @game_over
end
end
-
+
def reset_game
if @board.com_disk == BLACK
@board.com_disk = WHITE
@@ -404,7 +404,7 @@ class Othello
$wm.e("title", $root, "Othello")
@game_over = FALSE
end
-
+
def com_turn
@in_com_turn = TRUE
$update.e()
diff --git a/ext/tk/sample/tkalignbox.rb b/ext/tk/sample/tkalignbox.rb
index fb1b58f458..32915a5e69 100644
--- a/ext/tk/sample/tkalignbox.rb
+++ b/ext/tk/sample/tkalignbox.rb
@@ -1,26 +1,19 @@
#
# 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
+# 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
+class TkAlignBox < TkFrame
def initialize(*args)
- if self.class == Tk::RbWidget::AlignBox
- fail RuntimeError, "Tk::AlignBox is an abstract class"
+ if self.class == TkAlignBox
+ fail RuntimeError, "TkAlignBox is an abstract class"
end
@padx = 0
@pady = 0
@@ -38,12 +31,12 @@ class Tk::RbWidget::AlignBox < TkFrame
end
def _set_framesize
- fail RuntimeError, "Tk::AlignBox is an abstract class"
+ fail RuntimeError, "TkAlignBox is an abstract class"
end
private :_set_framesize
def _place_config(widget, idx, cnt)
- fail RuntimeError, "Tk::AlignBox is an abstract class"
+ fail RuntimeError, "TkAlignBox is an abstract class"
end
private :_place_config
@@ -124,7 +117,7 @@ class Tk::RbWidget::AlignBox < TkFrame
attr_accessor :propagate
end
-class Tk::RbWidget::HBox < Tk::RbWidget::AlignBox
+class TkHBox < TkAlignBox
def _set_framesize
bd = self.borderwidth
self.width((@max_width + 2*@padx) * @widgets.size + 2*bd)
@@ -133,28 +126,28 @@ class Tk::RbWidget::HBox < Tk::RbWidget::AlignBox
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,
+ 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
+TkHLBox = TkHBox
-class Tk::RbWidget::HRBox < Tk::RbWidget::HBox
+class TkHRBox < TkHBox
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,
+ 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
+class TkVBox < TkAlignBox
def _set_framesize
bd = self.borderwidth
self.width(@max_width + 2*@padx + 2*bd)
@@ -163,22 +156,22 @@ class Tk::RbWidget::VBox < Tk::RbWidget::AlignBox
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,
+ 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
+TkVTBox = TkVBox
-class Tk::RbWidget::VBBox < Tk::RbWidget::VBox
+class TkVBBox < TkVBox
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,
+ 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
@@ -188,46 +181,43 @@ end
# test
################################################
if __FILE__ == $0
- f = Tk::RbWidget::HBox.new(:borderwidth=>3, :relief=>'ridge').pack
+ f = TkHBox.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 = TkHBox.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 = TkVBox.new(:borderwidth=>5, :relief=>'groove').pack
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 = TkHRBox.new(:borderwidth=>3, :relief=>'raised').pack(:fill=>:x)
f.add(TkButton.new(f, :text=>'a'),
- TkButton.new(f, :text=>'aa'),
+ TkButton.new(f, :text=>'aa'),
TkButton.new(f, :text=>'aaa'))
- f = Tk::RbWidget::VBBox.new(:borderwidth=>3,
- :relief=>'ridge').pack(:fill=>:x)
+ f = TkVBBox.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,
+ 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,
+ },
+ 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,
+ },
+ TkFrame.new(f){|ff|
+ TkButton.new(ff, :text=>'aaaa').pack(:pady=>4, :padx=>6,
:fill=>:both, :expand=>true)
})
diff --git a/ext/tk/sample/tkballoonhelp.rb b/ext/tk/sample/tkballoonhelp.rb
index a9bd371db6..c2c95f771d 100644
--- a/ext/tk/sample/tkballoonhelp.rb
+++ b/ext/tk/sample/tkballoonhelp.rb
@@ -2,26 +2,16 @@
# 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,
+# 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).
+# (default is 1000ms).
#
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
-
+class TkBalloonHelp<TkLabel
def _balloon_binding(interval)
@timer = TkAfter.new(interval, 1, proc{show})
def @timer.interval(val)
@@ -60,13 +50,10 @@ class Tk::RbWidget::BalloonHelp<TkLabel
@command = keys.delete('command')
- @interval = keys.delete('interval'){DEFAULT_INTERVAL}
+ @interval = keys.delete('interval'){1000}
_balloon_binding(@interval)
- # @label = TkLabel.new(@frame, 'background'=>'bisque').pack
- @label = TkLabel.new(@frame,
- 'foreground'=>DEFAULT_FOREGROUND,
- 'background'=>DEFAULT_BACKGROUND).pack
+ @label = TkLabel.new(@frame, 'background'=>'bisque').pack
@label.configure(_symbolkey2str(keys)) unless keys.empty?
@path = @label
end
@@ -100,10 +87,10 @@ class Tk::RbWidget::BalloonHelp<TkLabel
when 2
@command.call(x - TkWinfo.rootx(@parent), y - TkWinfo.rooty(@parent))
when 3
- @command.call(x - TkWinfo.rootx(@parent), y - TkWinfo.rooty(@parent),
+ @command.call(x - TkWinfo.rootx(@parent), y - TkWinfo.rooty(@parent),
self)
else
- @command.call(x - TkWinfo.rootx(@parent), y - TkWinfo.rooty(@parent),
+ @command.call(x - TkWinfo.rootx(@parent), y - TkWinfo.rooty(@parent),
self, @parent)
end
end
@@ -112,11 +99,11 @@ class Tk::RbWidget::BalloonHelp<TkLabel
@frame.raise
@org_cursor = @parent['cursor']
- @parent.cursor('crosshair')
+ @parent.cursor('crosshair')
end
def erase
- @parent.cursor(@org_cursor)
+ @parent.cursor(@org_cursor)
@frame.withdraw
end
@@ -131,42 +118,41 @@ end
if __FILE__ == $0
TkButton.new('text'=>'This button has a balloon help') {|b|
pack('fill'=>'x')
- Tk::RbWidget::BalloonHelp.new(b, 'text'=>' Message ')
+ TkBalloonHelp.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')
+ TkBalloonHelp.new(b, 'text'=>'configured message',
+ '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)}"
- })
+ bh = TkBalloonHelp.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)}"
- })
+ bh = TkBalloonHelp.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)}"
- })
+ TkBalloonHelp.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
@@ -174,16 +160,16 @@ if __FILE__ == $0
bhelp.text "current index == #{parent.nearest(y)}"
}
- Tk::RbWidget::BalloonHelp.new(sb, :interval=>500,
- :relief=>:ridge, :background=>'white',
- :command=>cmd)
+ TkBalloonHelp.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)
+ TkBalloonHelp.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
@@ -192,16 +178,16 @@ if __FILE__ == $0
end
cmd = self.method(:set_msg)
- Tk::RbWidget::BalloonHelp.new(sb, :interval=>500,
- :relief=>:ridge, :background=>'white',
- :command=>cmd)
+ TkBalloonHelp.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)
+ TkBalloonHelp.new(sb2, :interval=>500,
+ :padx=>5, :relief=>:raised,
+ :background=>'gray25', :foreground=>'white',
+ :command=>cmd)
#=end
Tk.mainloop
diff --git a/ext/tk/sample/tkbiff.rb b/ext/tk/sample/tkbiff.rb
index c0953a1b1b..c6699629cc 100644
--- a/ext/tk/sample/tkbiff.rb
+++ b/ext/tk/sample/tkbiff.rb
@@ -11,10 +11,10 @@ end
if ARGV.length == 0
if ENV['MAIL']
$spool = ENV['MAIL']
- else
+ else
$spool = '/var/spool/mail/' + ENV['USER']
end
-else
+else
$spool = ARGV[0]
end
@@ -40,7 +40,7 @@ class Mail
@body = []
while line = f.gets()
line.chop!
- next if /^From / =~ line # skip From-line
+ next if /^From / =~ line # skip From-line
break if /^$/ =~ line # end of header
if /^(\S+):\s*(.*)/ =~ line
@header[attr = $1.capitalize] = $2
diff --git a/ext/tk/sample/tkbrowse.rb b/ext/tk/sample/tkbrowse.rb
index 56d5a80fcf..4893f57f95 100644
--- a/ext/tk/sample/tkbrowse.rb
+++ b/ext/tk/sample/tkbrowse.rb
@@ -69,7 +69,7 @@ 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
+if ARGV.length>0
dir = ARGV[0]
else
dir="."
diff --git a/ext/tk/sample/tkcombobox.rb b/ext/tk/sample/tkcombobox.rb
index 59db565f06..1840270951 100644
--- a/ext/tk/sample/tkcombobox.rb
+++ b/ext/tk/sample/tkcombobox.rb
@@ -1,20 +1,11 @@
#
-# tkcombobox.rb : auto scrollbox & combobox
-#
+# tkcombobox.rb : TkAutoScrollbox & TkCombobox
+#
# 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
+class TkAutoScrollbox < TkListbox
include TkComposite
@@up_bmp = TkBitmapImage.new(:data=><<EOD)
@@ -53,9 +44,9 @@ EOD
@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,
+ @up_arrow = TkLabel.new(@lbox, :image=>@@up_bmp,
:relief=>:raised, :borderwidth=>1)
- @down_arrow = TkLabel.new(@lbox, :image=>@@down_bmp,
+ @down_arrow = TkLabel.new(@lbox, :image=>@@down_bmp,
:relief=>:raised, :borderwidth=>1)
_init_binding
@@ -87,7 +78,7 @@ EOD
def _show_down_arrow
unless @down_arrow.winfo_mapped?
- @down_arrow.pack(:side=>:bottom, :fill=>:x)
+ @down_arrow.pack(:side=>:bottom, :fill=>:x)
end
end
@@ -100,11 +91,11 @@ EOD
def _check_sel(cidx, tidx = nil, bidx = nil)
_set_sel(cidx)
unless tidx
- tidx = @lbox.nearest(0)
+ tidx = @lbox.nearest(0)
tidx += 1 if tidx > 0
end
unless bidx
- bidx = @lbox.nearest(10000)
+ bidx = @lbox.nearest(10000)
bidx -= 1 if bidx < @lbox.index('end') - 1
end
if cidx > bidx
@@ -206,7 +197,7 @@ EOD
@lbox.bind('Configure', proc{_config_proc})
@lbox.bind('Enter', proc{|y| _set_sel(@lbox.nearest(y))}, '%y')
- @lbox.bind('Motion', proc{|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))
@@ -230,7 +221,7 @@ end
################################################
-class Tk::RbWidget::Combobox < TkEntry
+class TkCombobox < TkEntry
include TkComposite
@@down_btn_bmp = TkBitmapImage.new(:data=><<EOD)
@@ -250,7 +241,6 @@ static unsigned char up_arrow_bits[] = {
EOD
def _button_proc(dir = true)
- return if @ent.state == 'disabled'
@btn.relief(:sunken)
x = @frame.winfo_rootx
y = @frame.winfo_rooty
@@ -275,10 +265,9 @@ EOD
@top.grab
begin
- @wait_var.tkwait
- if (idx = @wait_var.to_i) >= 0
- # @ent.value = @lst.get(idx)
- _set_entry_value(@lst.get(idx))
+ @var.tkwait
+ if (idx = @var.to_i) >= 0
+ @ent.value = @lst.get(idx)
end
@top.withdraw
@btn.relief(:raised)
@@ -298,66 +287,19 @@ EOD
@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]})
+ @lst.bind('1', proc{|y| @var.value = @lst.nearest(y)}, '%y')
+ @lst.bind('Return', proc{@var.value = @lst.curselection[0]})
cancel = TkVirtualEvent.new('2', '3', 'Escape')
- @lst.bind(cancel, proc{@wait_var.value = -1})
+ @lst.bind(cancel, proc{@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,
+ @btn = TkLabel.new(@frame, :relief=>:raised, :borderwidth=>3,
+ :image=>@@down_btn_bmp).pack(:side=>:right,
:ipadx=>2, :fill=>:y)
@ent = TkEntry.new(@frame).pack(:side=>:left)
@path = @ent.path
@@ -370,21 +312,16 @@ EOD
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)
+ @lst = TkAutoScrollbox.new(@top,
+ :startwait=>startwait,
+ :interval=>interval).pack(:fill=>:both,
+ :expand=>true)
@ent_list = []
- @wait_var = TkVariable.new
- @var = @default_var = TkVariable.new
-
- @ent.textvariable @default_var
+ @var = TkVariable.new
_init_bindings
- option_methods('textvariable' => :_textvariable_control)
-
delegate('DEFAULT', @ent)
delegate('height', @lst)
delegate('relief', @frame)
@@ -393,8 +330,6 @@ EOD
delegate('arrowrelief', @lst)
delegate('arrowborderwidth', @lst)
- delegate('state', false)
-
if mode = keys.delete('scrollbar')
scrollbar(mode)
end
@@ -460,14 +395,10 @@ 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 = TkCombobox.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'
@@ -477,19 +408,17 @@ if __FILE__ == $0
TkLabel.new(f, :font=>fnt, :textvariable=>v).pack(:side=>:left)
}.pack
- TkFrame.new(:relief=>:raised, :borderwidth=>2,
+ 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)
+ l = TkAutoScrollbox.new(nil, :relief=>:groove, :borderwidth=>4,
+ :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',
+ TkButton.new(self, :text=>'ON',
:command=>proc{l.scrollbar(true)}).pack(:side=>:left)
- TkButton.new(self, :text=>'OFF',
+ TkButton.new(self, :text=>'OFF',
:command=>proc{l.scrollbar(false)}).pack(:side=>:right)
pack(:fill=>:x)
}
diff --git a/ext/tk/sample/tkdialog.rb b/ext/tk/sample/tkdialog.rb
index eb8cd04796..00cc12ab11 100644
--- a/ext/tk/sample/tkdialog.rb
+++ b/ext/tk/sample/tkdialog.rb
@@ -8,7 +8,7 @@ top = TkFrame.new(root) {
}
msg = TkMessage.new(top) {
text "File main.c hasn't been saved to disk since \
-it was last modified. What should I do?"
+it was last modified. What should I do?"
justify 'center'
aspect 200
font '-Adobe-helvetica-medium-r-normal--*-240*'
diff --git a/ext/tk/sample/tkextlib/ICONS/viewIcons.rb b/ext/tk/sample/tkextlib/ICONS/viewIcons.rb
index 02ba19a629..fc88eb5c85 100644
--- a/ext/tk/sample/tkextlib/ICONS/viewIcons.rb
+++ b/ext/tk/sample/tkextlib/ICONS/viewIcons.rb
@@ -4,7 +4,7 @@
#
# -- Display icons from icon library.
#
-# -- Copy the clicked icon data (command string of creating
+# -- Copy the clicked icon data (command string of creating
# a TkPhotoImage instance) to the clipboard.
#
require 'tk'
@@ -27,7 +27,7 @@ class ViewIcons
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',
+ btn_browse = TkButton.new(base, :text=>'Browse',
:command=>method(:select_icons))
btn_view = TkButton.new(base, :text=>'View',
:command=>method(:display_icons))
@@ -35,8 +35,8 @@ class ViewIcons
@column_btns = {}
6.step(20, 2){|i|
- @column_btns[i] = TkButton.new(columns,
- :text=>i.to_s, :width=>2,
+ @column_btns[i] = TkButton.new(columns,
+ :text=>i.to_s, :width=>2,
:command=>proc{set_columns(i)}
).pack(:side=>:left)
}
@@ -90,15 +90,15 @@ class ViewIcons
end
def _create_info_window
- @info_window = TkToplevel.new(:background=>'lightyellow', :borderwidth=>1,
+ @info_window = TkToplevel.new(:background=>'lightyellow', :borderwidth=>1,
:relief=>:solid){|w|
- lbl_name = TkLabel.new(w, :text=>'Name', :background=>'lightyellow',
+ lbl_name = TkLabel.new(w, :text=>'Name', :background=>'lightyellow',
:font=>@boldfont, :justify=>:left)
- lbl_grps = TkLabel.new(w, :text=>'Groups', :background=>'lightyellow',
+ lbl_grps = TkLabel.new(w, :text=>'Groups', :background=>'lightyellow',
:font=>@boldfont, :justify=>:left)
- lbl_type = TkLabel.new(w, :text=>'Type', :background=>'lightyellow',
+ lbl_type = TkLabel.new(w, :text=>'Type', :background=>'lightyellow',
:font=>@boldfont, :justify=>:left)
- lbl_size = TkLabel.new(w, :text=>'Size', :background=>'lightyellow',
+ lbl_size = TkLabel.new(w, :text=>'Size', :background=>'lightyellow',
:font=>@boldfont, :justify=>:left)
lbl_name.grid(:row=>0, :column=>0, :sticky=>:w)
@@ -192,7 +192,7 @@ class ViewIcons
def cancel_info
if @delay_timer
- @delay_timer.cancel
+ @delay_timer.cancel
@delay_timer = nil
end
@info_window.withdraw
@@ -242,9 +242,9 @@ class ViewIcons
TkClipboard.append(@command)
if Tk::PLATFORM['platform'] == 'unix'
- TkSelection.handle(Tk.root, method(:primary_transfer),
+ TkSelection.handle(Tk.root, method(:primary_transfer),
:selection=>'PRIMARY')
- TkSelection.set_owner(Tk.root, :selection=>'PRIMARY',
+ TkSelection.set_owner(Tk.root, :selection=>'PRIMARY',
:command=>method(:lost_selection))
end
@@ -256,17 +256,17 @@ class ViewIcons
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',
+ @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',
+ new_lib = Tk.getOpenFile(:initialdir=>@initial_dir,
+ :initialfile=>'tkIcons',
+ :title=>'Select Icon Library',
:filetypes=>[
- ['Icon Libraries', ['tkIcons*']],
+ ['Icon Libraries', ['tkIcons*']],
['All Files', ['*']]
])
@@ -280,7 +280,7 @@ class ViewIcons
row = 0
unless File.exist?(@library.value)
- Tk.messageBox(:icon=>'warning', :message=>'File does not exist',
+ Tk.messageBox(:icon=>'warning', :message=>'File does not exist',
:title=>'viewIcons')
return
end
diff --git a/ext/tk/sample/tkextlib/blt/barchart5.rb b/ext/tk/sample/tkextlib/blt/barchart5.rb
index 86101b200d..db181d10ca 100644
--- a/ext/tk/sample/tkextlib/blt/barchart5.rb
+++ b/ext/tk/sample/tkextlib/blt/barchart5.rb
@@ -2,7 +2,7 @@
require 'tk'
require 'tkextlib/blt'
-load File.join(File.dirname(File.expand_path(__FILE__)),
+load File.join(File.dirname(File.expand_path(__FILE__)),
'scripts', 'stipples.rb')
TkOption.add('*graph.x.Title', 'X Axis Label')
@@ -23,27 +23,27 @@ if visual != 'staticgray' && visual != 'grayscale'
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.
+ 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',
+ 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.
+%% button.
%%
ruby {
- $graph = Tk::BLT::Barchart.new(:widgetname=>'.htext.graph',
+ $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,
+ Tk::BLT::Htext::Htext_Widget.window.append($graph,
:fill=>:both, :padx=>4)
}
@@ -51,8 +51,8 @@ htext = Tk::BLT::Htext.new(:widgetname=>'.htext', :text=><<EOD)
Hit the %%
ruby {
- b = TkButton.new(Tk::BLT::Htext::Htext_Widget.window,
- :widgetname=>'quit', :text=>'Quit',
+ b = TkButton.new(Tk::BLT::Htext::Htext_Widget.window,
+ :widgetname=>'quit', :text=>'Quit',
:command=>proc{ exit })
Tk::BLT::Htext::Htext_Widget.window.append(b)
}
@@ -86,7 +86,7 @@ x.seq(-5.0, 5.0, 0.2)
y.expr("sin(#{x})")
barWidth = 0.19
-$graph.element_create('sin', :relief=>:raised, :borderwidth=>1,
+$graph.element_create('sin', :relief=>:raised, :borderwidth=>1,
:x=>x, :y=>y, :barwidth=>barWidth)
Tk::BLT::Table.add(Tk.root, htext, :fill=>:both)
diff --git a/ext/tk/sample/tkextlib/blt/calendar.rb b/ext/tk/sample/tkextlib/blt/calendar.rb
index 86d34043dc..4fc6d64d9e 100644
--- a/ext/tk/sample/tkextlib/blt/calendar.rb
+++ b/ext/tk/sample/tkextlib/blt/calendar.rb
@@ -31,17 +31,17 @@ 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],
+ ['January', 31],
+ ['February', 28],
+ ['March', 31],
+ ['April', 30],
+ ['May', 31],
+ ['June', 30],
+ ['July', 31],
+ ['August', 31],
+ ['Septembar', 30],
+ ['October', 31],
+ ['November', 30],
['December', 31]
]
@@ -53,23 +53,23 @@ class BLT_Calendar_sample
if TkComm.bool(Tk.info(:commands, '.calendar'))
Tk.destroy('.calendar')
end
- cal = Tk::BLT::Tile::Frame.new(:widgetname=>'.calendar',
- :classname=>'Calendar',
+ 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]} " +
+ 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',
+ 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'),
+ Tk::BLT::Table.add(cal,
+ Tk::BLT::Tile::Label.new(cal, :text=>dayName,
+ :font=>'Helvetica 12'),
[2, idx], :pady=>2, :padx=>2)
}
@@ -83,11 +83,11 @@ class BLT_Calendar_sample
wkday += 7 if wkday < 0
while cnt <= numDays
- Tk::BLT::Table.add(cal,
+ Tk::BLT::Table.add(cal,
Tk::BLT::Tile::Label.new(cal, :text=>cnt){
- self.configure(:borderwidth=>1,
+ self.configure(:borderwidth=>1,
:relief=>:sunken) if cnt == today.day
- },
+ },
[week+3, wkday], :fill=>:both, :ipadx=>10, :ipady=>4)
cnt += 1
wkday += 1
@@ -98,11 +98,11 @@ class BLT_Calendar_sample
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'),
+ 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)
}
diff --git a/ext/tk/sample/tkextlib/blt/graph6.rb b/ext/tk/sample/tkextlib/blt/graph6.rb
index b3eeb81231..f899b44115 100644
--- a/ext/tk/sample/tkextlib/blt/graph6.rb
+++ b/ext/tk/sample/tkextlib/blt/graph6.rb
@@ -6,55 +6,55 @@ 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'],
+ ['*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)}
##############################
@@ -71,7 +71,7 @@ class BLT_Graph_Demo
@top = Tk::BLT::Tile::Toplevel.new
=begin
- legend = Tk::BLT::Graph.new(@top, :widgetname=>'legend',
+ legend = Tk::BLT::Graph.new(@top, :widgetname=>'legend',
:without_creating=>true)
@graph.legend_configure(:position=>legend)
=end
@@ -81,7 +81,7 @@ class BLT_Graph_Demo
Tk::BLT::Table.add(@root, @graph, [0,0], :fill=>:both)
- @quit_btn = Tk::BLT::Tile::Button.new(:text=>' quit ', :background=>'red',
+ @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)
@@ -90,9 +90,9 @@ class BLT_Graph_Demo
@graph.closest_point
@graph.print_key
- @graph.legend_bind(:all, 'ButtonRelease-1',
+ @graph.legend_bind(:all, 'ButtonRelease-1',
proc{|w| highlightTrace(w)}, '%W')
- @graph.legend_bind(:all, 'ButtonRelease-3',
+ @graph.legend_bind(:all, 'ButtonRelease-3',
proc{|w|
w.legend_deactivate('*')
active = w.element_activate
@@ -108,2098 +108,2098 @@ class BLT_Graph_Demo
(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
+ 0 1e-10 2e-10 3e-10 4e-10 5e-10 6e-10 7e-10 8e-10 9e-10
+ 1e-09 1.1e-09 1.2e-09 1.3e-09 1.4e-09 1.5e-09 1.6e-09 1.7e-09
+ 1.8e-09 1.9e-09 2e-09 2.1e-09 2.2e-09 2.3e-09 2.4e-09 2.5e-09
+ 2.6e-09 2.7e-09 2.8e-09 2.9e-09 3e-09 3.1e-09 3.2e-09 3.3e-09
+ 3.4e-09 3.5e-09 3.6e-09 3.7e-09 3.8e-09 3.9e-09 4e-09 4.1e-09
+ 4.2e-09 4.3e-09 4.4e-09 4.5e-09 4.6e-09 4.7e-09 4.8e-09
+ 4.9e-09 5e-09 5.1e-09 5.2e-09 5.3e-09 5.4e-09 5.5e-09 5.6e-09
+ 5.7e-09 5.8e-09 5.9e-09 6e-09 6.1e-09 6.2e-09 6.3e-09 6.4e-09
+ 6.5e-09 6.6e-09 6.7e-09 6.8e-09 6.9e-09 7e-09 7.1e-09 7.2e-09
+ 7.3e-09 7.4e-09 7.5e-09 7.6e-09 7.7e-09 7.8e-09 7.9e-09
+ 8e-09 8.1e-09 8.2e-09 8.3e-09 8.4e-09 8.5e-09 8.6e-09 8.7e-09
+ 8.8e-09 8.9e-09 9e-09 9.1e-09 9.2e-09 9.3e-09 9.4e-09 9.5e-09
+ 9.6e-09 9.7e-09 9.8e-09 9.9e-09 1e-08 1.01e-08 1.02e-08
+ 1.03e-08 1.04e-08 1.05e-08 1.06e-08 1.07e-08 1.08e-08 1.09e-08
+ 1.1e-08 1.11e-08 1.12e-08 1.13e-08 1.14e-08 1.15e-08 1.16e-08
+ 1.17e-08 1.18e-08 1.19e-08 1.2e-08 1.21e-08 1.22e-08 1.23e-08
+ 1.24e-08 1.25e-08 1.26e-08 1.27e-08 1.28e-08 1.29e-08 1.3e-08
+ 1.31e-08 1.32e-08 1.33e-08 1.34e-08 1.35e-08 1.36e-08 1.37e-08
+ 1.38e-08 1.39e-08 1.4e-08 1.41e-08 1.42e-08 1.43e-08 1.44e-08
+ 1.45e-08 1.46e-08 1.47e-08 1.48e-08 1.49e-08 1.5e-08 1.51e-08
+ 1.52e-08 1.53e-08 1.54e-08 1.55e-08 1.56e-08 1.57e-08 1.58e-08
+ 1.59e-08 1.6e-08 1.61e-08 1.62e-08 1.63e-08 1.64e-08 1.65e-08
+ 1.66e-08 1.67e-08 1.68e-08 1.69e-08 1.7e-08 1.71e-08 1.72e-08
+ 1.73e-08 1.74e-08 1.75e-08 1.76e-08 1.77e-08 1.78e-08 1.79e-08
+ 1.8e-08 1.81e-08 1.82e-08 1.83e-08 1.84e-08 1.85e-08 1.86e-08
+ 1.87e-08 1.88e-08 1.89e-08 1.9e-08 1.91e-08 1.92e-08 1.93e-08
+ 1.94e-08 1.95e-08 1.96e-08 1.97e-08 1.98e-08 1.99e-08 2e-08
+ 2.01e-08 2.02e-08 2.03e-08 2.04e-08 2.05e-08 2.06e-08 2.07e-08
+ 2.08e-08 2.09e-08 2.1e-08 2.11e-08 2.12e-08 2.13e-08 2.14e-08
+ 2.15e-08 2.16e-08 2.17e-08 2.18e-08 2.19e-08 2.2e-08 2.21e-08
+ 2.22e-08 2.23e-08 2.24e-08 2.25e-08 2.26e-08 2.27e-08 2.28e-08
+ 2.29e-08 2.3e-08 2.31e-08 2.32e-08 2.33e-08 2.34e-08 2.35e-08
+ 2.36e-08 2.37e-08 2.38e-08 2.39e-08 2.4e-08 2.41e-08 2.42e-08
+ 2.43e-08 2.44e-08 2.45e-08 2.46e-08 2.47e-08 2.48e-08 2.49e-08
+ 2.5e-08 2.51e-08 2.52e-08 2.53e-08 2.54e-08 2.55e-08 2.56e-08
+ 2.57e-08 2.58e-08 2.59e-08 2.6e-08 2.61e-08 2.62e-08 2.63e-08
+ 2.64e-08 2.65e-08 2.66e-08 2.67e-08 2.68e-08 2.69e-08 2.7e-08
+ 2.71e-08 2.72e-08 2.73e-08 2.74e-08 2.75e-08 2.76e-08 2.77e-08
+ 2.78e-08 2.79e-08 2.8e-08 2.81e-08 2.82e-08 2.83e-08 2.84e-08
+ 2.85e-08 2.86e-08 2.87e-08 2.88e-08 2.89e-08 2.9e-08 2.91e-08
+ 2.92e-08 2.93e-08 2.94e-08 2.95e-08 2.96e-08 2.97e-08 2.98e-08
+ 2.99e-08 3e-08 3.01e-08 3.02e-08 3.03e-08 3.04e-08 3.05e-08
+ 3.06e-08 3.07e-08 3.08e-08 3.09e-08 3.1e-08 3.11e-08 3.12e-08
+ 3.13e-08 3.14e-08 3.15e-08 3.16e-08 3.17e-08 3.18e-08 3.19e-08
+ 3.2e-08 3.21e-08 3.22e-08 3.23e-08 3.24e-08 3.25e-08 3.26e-08
+ 3.27e-08 3.28e-08 3.29e-08 3.3e-08 3.31e-08 3.32e-08 3.33e-08
+ 3.34e-08 3.35e-08 3.36e-08 3.37e-08 3.38e-08 3.39e-08 3.4e-08
+ 3.41e-08 3.42e-08 3.43e-08 3.44e-08 3.45e-08 3.46e-08 3.47e-08
+ 3.48e-08 3.49e-08 3.5e-08 3.51e-08 3.52e-08 3.53e-08 3.54e-08
+ 3.55e-08 3.56e-08 3.57e-08 3.58e-08 3.59e-08 3.6e-08
EOD
@v[1].set(<<-'EOD')
- 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
- 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
- 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
- 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
- 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
- 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
- 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
- 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
- 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
- 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
- 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
- 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
- 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
+ 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
+ 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
+ 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
+ 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
+ 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
+ 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
+ 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
+ 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
+ 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
+ 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
+ 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
+ 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
+ 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
EOD
@v[2].set(<<-'EOD')
- 0 1 2 3 4 5 5 5 5 5 5 5 5 5 5 5 4 3 2 1 0 0 0 0 0 0 0 0
- 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- 0 0 0 0 0 0 0 0 0 0 0 0 0 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 4 3 2 1
- 5.32907e-15 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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 4 3 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- 0 0 0 0 0 0 0 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 4 3 2 1 0 0 0 0 0 0 0 0
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 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 4 3 2 1
+ 5.32907e-15 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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 4 3 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+ 0 0 0 0 0 0 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[3].set(<<-'EOD')
- 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 8.88178e-16
- 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- 0 0 0 0 0 0 0 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
+ 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 8.88178e-16
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+ 0 0 0 0 0 0 0 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[4].set(<<-'EOD')
- 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 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- 0 0 0 0 0 0 0 0 0 0 0 0 0 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
+ 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 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 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
EOD
@v[5].set(<<-'EOD')
- 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 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- 0 0 0 0 0 0 0 0 0 0 0 0 0 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
+ 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 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 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
EOD
@v[6].set(<<-'EOD')
- 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 8.88178e-16
- 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- 0 0 0 0 0 0 0 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
+ 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 8.88178e-16
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+ 0 0 0 0 0 0 0 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
+ 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
+ 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
+ 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
+ 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
+ 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
+ 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
+ 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
+ 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
+ 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
+ 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
+ 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
+ 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
+ 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
+ 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
+ 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
+ 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
+ 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
+ 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
+ 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
+ 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
+ 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
+ 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
+ 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
+ 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
+ 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
+ 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
+ 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
+ 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
+ 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
+ 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
+ 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
+ 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
+ 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
diff --git a/ext/tk/sample/tkextlib/blt/graph7.rb b/ext/tk/sample/tkextlib/blt/graph7.rb
index 8b31b28c91..27fbe53d97 100644
--- a/ext/tk/sample/tkextlib/blt/graph7.rb
+++ b/ext/tk/sample/tkextlib/blt/graph7.rb
@@ -16,10 +16,10 @@ 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',
+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)
diff --git a/ext/tk/sample/tkextlib/blt/graph7a.rb b/ext/tk/sample/tkextlib/blt/graph7a.rb
index 8def766060..a014f72fc7 100644
--- a/ext/tk/sample/tkextlib/blt/graph7a.rb
+++ b/ext/tk/sample/tkextlib/blt/graph7a.rb
@@ -2,7 +2,7 @@
require 'tk'
require 'tkextlib/blt'
-file = File.join(File.dirname(File.expand_path(__FILE__)),
+file = File.join(File.dirname(File.expand_path(__FILE__)),
'images', 'buckskin.gif')
bgTexture = TkPhotoImage.new(:file=>file)
@@ -39,10 +39,10 @@ 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',
+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)
diff --git a/ext/tk/sample/tkextlib/blt/graph7b.rb b/ext/tk/sample/tkextlib/blt/graph7b.rb
index 8b00f154b2..c589f18d86 100644
--- a/ext/tk/sample/tkextlib/blt/graph7b.rb
+++ b/ext/tk/sample/tkextlib/blt/graph7b.rb
@@ -17,10 +17,10 @@ y = Array.new(length)
y[i] = rand
}
-plot = Tk::BLT::PlotComponent::Element.new(graph, :symbol=>:square,
- :color=>'green4', :fill=>'green2',
- :linewidth=>0, :outlinewidth=>1,
- :pixels=>4, :label=>'plot',
+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)
diff --git a/ext/tk/sample/tkextlib/blt/graph7c.rb b/ext/tk/sample/tkextlib/blt/graph7c.rb
index d4ed1a66ad..495b66f4af 100644
--- a/ext/tk/sample/tkextlib/blt/graph7c.rb
+++ b/ext/tk/sample/tkextlib/blt/graph7c.rb
@@ -21,10 +21,10 @@ y = Array.new(length)
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',
+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)
diff --git a/ext/tk/sample/tkextlib/blt/pareto.rb b/ext/tk/sample/tkextlib/blt/pareto.rb
index bf9a1ec749..94d5f3f97f 100644
--- a/ext/tk/sample/tkextlib/blt/pareto.rb
+++ b/ext/tk/sample/tkextlib/blt/pareto.rb
@@ -8,21 +8,21 @@ require 'tkextlib/blt'
# 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],
+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'],
+ ["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']
]
@@ -41,8 +41,8 @@ labels = []
data.each{|label, value, color|
count += 1
- b.element_create(label, :xdata=>count, :ydata=>value, :foreground=>color,
- :relief=>:solid, :borderwidth=>1, :stipple=>pattern1,
+ 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.
@@ -51,7 +51,7 @@ data.each{|label, value, color|
xdata << count
}
-# Configure the coordinates of the accumulated defects,
+# Configure the coordinates of the accumulated defects,
# now that we know what they are.
b.element_configure('accum', :xdata=>xdata, :ydata=>ydata)
@@ -63,19 +63,19 @@ xdata.zip(ydata){|x, y|
else
text = '%.1f' % percent
end
- b.marker_create(:text, :coords=>[x, y], :text=>text, :font=>'Helvetica 10',
+ b.marker_create(:text, :coords=>[x, y], :text=>text, :font=>'Helvetica 10',
:foreground=>'red4', :anchor=>:center, :yoffset=>-5)
}
# Display an auxillary y-axis for percentages.
-b.axis_configure('y2', :hide=>false, :min=>0.0, :max=>100.0,
+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,
+b.axis_configure('x', :title=>'Process', :rotate=>90, :subdivisions=>0,
:command=>proc{|w, val|
val = val.round
labels[val]? labels[val]: val
diff --git a/ext/tk/sample/tkextlib/blt/plot1b.rb b/ext/tk/sample/tkextlib/blt/plot1b.rb
index 8a3ce8216d..eb41e361f9 100644
--- a/ext/tk/sample/tkextlib/blt/plot1b.rb
+++ b/ext/tk/sample/tkextlib/blt/plot1b.rb
@@ -4,7 +4,7 @@ require 'tkextlib/blt'
graph = Tk::BLT::Graph.new.pack
plot = graph.element_create
-plot.configure(:linewidth=>0, :label=>'foo',
+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/winop1.rb b/ext/tk/sample/tkextlib/blt/winop1.rb
index 97c31aa295..e94138cd94 100644
--- a/ext/tk/sample/tkextlib/blt/winop1.rb
+++ b/ext/tk/sample/tkextlib/blt/winop1.rb
@@ -2,7 +2,7 @@
require 'tk'
require 'tkextlib/blt'
-file = File.join(File.dirname(File.expand_path(__FILE__)),
+file = File.join(File.dirname(File.expand_path(__FILE__)),
'images', 'sample.gif')
if File.exist?(file)
src = TkPhotoImage.new(:file=>file)
@@ -30,9 +30,9 @@ Tk.root.background('white')
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,
+ Tk::BLT::Table.add(Tk.root,
+ [0,i], l_hdr,
+ [1,i], l_img,
[2,i], l_ftr)
Tk.update
}
diff --git a/ext/tk/sample/tkextlib/blt/winop2.rb b/ext/tk/sample/tkextlib/blt/winop2.rb
index d59c43ba22..1f674ee893 100644
--- a/ext/tk/sample/tkextlib/blt/winop2.rb
+++ b/ext/tk/sample/tkextlib/blt/winop2.rb
@@ -2,7 +2,7 @@
require 'tk'
require 'tkextlib/blt'
-file = File.join(File.dirname(File.expand_path(__FILE__)),
+file = File.join(File.dirname(File.expand_path(__FILE__)),
'images', 'qv100.t.gif')
if File.exist?(file)
src = TkPhotoImage.new(:file=>file)
diff --git a/ext/tk/sample/tkextlib/bwidget/basic.rb b/ext/tk/sample/tkextlib/bwidget/basic.rb
index 060baf8a6c..c1521651fd 100644
--- a/ext/tk/sample/tkextlib/bwidget/basic.rb
+++ b/ext/tk/sample/tkextlib/bwidget/basic.rb
@@ -29,37 +29,37 @@ module DemoBasic
end
def self._label(parent)
- lab = Tk::BWidget::Label.new(parent, :text=>'This is a Label widget',
+ 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',
+ 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',
+ 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',
+ 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,
+ 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'),
+ lab = TkLabel.new(parent, :textvariable=>@@var.ref('entcmd'),
:foreground=>'red')
ent.pack(:pady=>4, :anchor=>:w)
@@ -69,22 +69,22 @@ module DemoBasic
def self._button(parent)
frame = TkFrame.new(parent)
- but = Tk::BWidget::Button.new(frame, :text=>'Press me!',
- :repeatdelay=>300,
- :command=>proc{_butcmd('command')},
+ 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')},
+ 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')},
+ 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)
@@ -94,49 +94,49 @@ module DemoBasic
arr2.pack(:side=>:left, :padx=>4)
frame.pack
- Tk::BWidget::Separator.new(parent,
+ Tk::BWidget::Separator.new(parent,
:orient=>:horizontal).pack(:fill=>:x, :pady=>10)
- labf1 = Tk::BWidget::LabelFrame.new(parent, :text=>'Command',
- :side=>:top, :anchor=>:w,
+ 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'],
+ 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'],
+ 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'),
+ 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,
+ 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,
+ 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,
+ 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,
+ TkRadiobutton.new(f, :text=>relief,
+ :variable=>@@var.ref('brelief'), :value=>relief,
:command=>proc{
_brelief(@@var['brelief'], but, arr1, arr2)
}).pack(:anchor=>:w)
@@ -163,19 +163,19 @@ module DemoBasic
def self._barmcmd(value, but, arr1, arr2)
if TkComm.bool(value)
- but.configure(:armcommand=>proc{_butcmd('arm')},
- :disarmcommand=>proc{_butcmd('disarm')},
+ 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')},
+ arr.configure(:armcommand=>proc{_butcmd('arm')},
+ :disarmcommand=>proc{_butcmd('disarm')},
:command=>'')
}
else
- but.configure(:armcommand=>'', :disarmcommand=>'',
+ but.configure(:armcommand=>'', :disarmcommand=>'',
:command=>proc{_butcmd('command')})
[arr1, arr2].each{|arr|
- arr.configure(:armcommand=>'', :disarmcommand=>'',
+ arr.configure(:armcommand=>'', :disarmcommand=>'',
:command=>proc{_butcmd('command')})
}
end
diff --git a/ext/tk/sample/tkextlib/bwidget/demo.rb b/ext/tk/sample/tkextlib/bwidget/demo.rb
index 3eb98818f3..785d2681a8 100644
--- a/ext/tk/sample/tkextlib/bwidget/demo.rb
+++ b/ext/tk/sample/tkextlib/bwidget/demo.rb
@@ -54,21 +54,21 @@ class BWidget_Demo
descmenu = [
'&File', 'all', 'file', 0, [
- ['command', 'E&xit', [], 'Exit BWidget demo', [],
+ ['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,
+ ['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,
+ ],
+ ['checkbutton', 'Toolbar &2', ['all', 'option'],
+ 'Show/hide toolbar 2', [],
+ { :variable=>DemoVar.toolbar2,
:command=>proc{
DemoVar.mainframe.show_toolbar(1, DemoVar.toolbar2.value)
}
@@ -81,8 +81,8 @@ class BWidget_Demo
DemoVar.prgindic.value = 0
DemoVar.mainframe = Tk::BWidget::MainFrame.new(
- :menu=>descmenu,
- :textvariable=>DemoVar.status,
+ :menu=>descmenu,
+ :textvariable=>DemoVar.status,
:progressvar=>DemoVar.prgindic
)
@@ -91,22 +91,22 @@ class BWidget_Demo
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'},
+ 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'},
+ 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'},
+ 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)
@@ -119,22 +119,22 @@ class BWidget_Demo
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'},
+ 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'},
+ 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'},
+ 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)
@@ -145,7 +145,7 @@ class BWidget_Demo
DemoVar.prgindic.numeric += 1
tb2 = DemoVar.mainframe.add_toolbar
- DemoVar._wfont = Tk::BWidget::SelectFont::Toolbar.new(tb2,
+ DemoVar._wfont = Tk::BWidget::SelectFont::Toolbar.new(tb2,
:command=>proc{update_font(DemoVar._wfont[:font])}
)
DemoVar.font = DemoVar._wfont[:font]
@@ -213,18 +213,18 @@ class BWidget_Demo
top.withdraw
top.overrideredirect(true)
- ximg = TkLabel.new(top, :bitmap=>"@#{File.join(DEMODIR,'x1.xbm')}",
+ 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',
+ TkLabel.new(frame, :text=>'Loading demo',
:background=>'white', :font=>'times 8').pack
- TkLabel.new(frame, :textvariable=>DemoVar.prgtext,
+ 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,
+ 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)
diff --git a/ext/tk/sample/tkextlib/bwidget/dnd.rb b/ext/tk/sample/tkextlib/bwidget/dnd.rb
index b1b1cf60ff..1c8b036530 100644
--- a/ext/tk/sample/tkextlib/bwidget/dnd.rb
+++ b/ext/tk/sample/tkextlib/bwidget/dnd.rb
@@ -12,19 +12,19 @@ module DemoDnD
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,
+ ent1 = Tk::BWidget::LabelEntry.new(subf, :label=>'Entry',
+ :labelwidth=>14, :dragenabled=>true,
:dragevent=>3)
- labf1 = Tk::BWidget::LabelFrame.new(subf, :text=>'Label (text)',
+ 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',
+ lab = Tk::BWidget::Label.new(f, :text=>'Drag this text',
:dragenabled=>true, :dragevent=>3).pack
- labf2 = Tk::BWidget::LabelFrame.new(subf, :text=>'Label (bitmap)',
+ labf2 = Tk::BWidget::LabelFrame.new(subf, :text=>'Label (bitmap)',
:width=>14)
f = labf2.get_frame
- lab = Tk::BWidget::Label.new(f, :bitmap=>'info',
+ lab = Tk::BWidget::Label.new(f, :bitmap=>'info',
:dragenabled=>true, :dragevent=>3).pack
Tk.pack(ent1, labf1, labf2, :side=>:top, :fill=>:x, :pady=>4)
@@ -32,11 +32,11 @@ module DemoDnD
titf2 = Tk::BWidget::TitleFrame.new(frame, :text=>'Drop targets')
subf = titf2.get_frame
- ent1 = Tk::BWidget::LabelEntry.new(subf, :label=>'Entry',
+ 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,
+ 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)
diff --git a/ext/tk/sample/tkextlib/bwidget/manager.rb b/ext/tk/sample/tkextlib/bwidget/manager.rb
index a59afb8b86..776cb3065b 100644
--- a/ext/tk/sample/tkextlib/bwidget/manager.rb
+++ b/ext/tk/sample/tkextlib/bwidget/manager.rb
@@ -32,19 +32,19 @@ module DemoManager
end
def self._mainframe(parent)
- labf1 = Tk::BWidget::LabelFrame.new(parent, :text=>'Toolbar',
- :side=>:top, :anchor=>:w,
+ 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,
+ 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,
+ chk2 = TkCheckbutton.new(subf, :text=>'View toolbar 2',
+ :variable=>DemoVar.toolbar2,
:command=>proc{
DemoVar.mainframe.show_toolbar(
1, DemoVar.toolbar2.value
@@ -54,12 +54,12 @@ module DemoManager
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,
+ 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,
+ chk1 = TkCheckbutton.new(subf, :text=>"Show Progress\nindicator",
+ :justify=>:left, :variable=>@@progress,
:command=>proc{ _show_progress })
chk1.pack(:anchor=>:w, :fill=>:x)
@@ -67,8 +67,8 @@ module DemoManager
end
def self._notebook(parent)
- TkCheckbutton.new(parent, :text=>'Homogeneous label',
- :variable=>@@homogeneous,
+ TkCheckbutton.new(parent, :text=>'Homogeneous label',
+ :variable=>@@homogeneous,
:command=>proc{
DemoVar.notebook[:homogeneous] = @@homogeneous.value
}).pack(:side=>:left, :anchor=>:n, :fill=>:x)
@@ -92,13 +92,13 @@ module DemoManager
sw.pack(:fill=>:both, :expand=>true)
}
- sw = Tk::BWidget::ScrolledWindow.new(pane3, :relief=>:sunken,
+ 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',
+ chk = TkCheckbutton.new(subf, :text=>'Constrained with',
:variable=>@@constw, :command=>proc{
sf['constrainedwidth'] = @@constw.value
})
diff --git a/ext/tk/sample/tkextlib/bwidget/select.rb b/ext/tk/sample/tkextlib/bwidget/select.rb
index 3a1a810e14..ea24b47e2e 100644
--- a/ext/tk/sample/tkextlib/bwidget/select.rb
+++ b/ext/tk/sample/tkextlib/bwidget/select.rb
@@ -13,28 +13,28 @@ module DemoSelect
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'),
+ 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,
+ 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,
+ 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,
+ 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',
+ chk2 = TkCheckbutton.new(subf, :text=>'Disabled',
+ :variable=>@@var.ref('spin', 'state'),
+ :onvalue=>'disabled', :offvalue=>'normal',
:command=>proc{
spin.state(@@var['spin', 'state'])
})
@@ -47,28 +47,28 @@ module DemoSelect
combo = Tk::BWidget::ComboBox.new(subf,
:textvariable=>@@var.ref('combo', 'var'),
:values=>[
- 'first value', 'second value',
- 'third value', 'fourth value',
+ '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,
+ 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,
+ 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,
+ 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',
+ chk2 = TkCheckbutton.new(subf, :text=>'Disabled',
+ :variable=>@@var.ref('combo', 'state'),
+ :onvalue=>'disabled', :offvalue=>'normal',
:command=>proc{
combo.state(@@var['combo', 'state'])
})
diff --git a/ext/tk/sample/tkextlib/bwidget/tmpldlg.rb b/ext/tk/sample/tkextlib/bwidget/tmpldlg.rb
index da2c9678c0..3d19c8d092 100644
--- a/ext/tk/sample/tkextlib/bwidget/tmpldlg.rb
+++ b/ext/tk/sample/tkextlib/bwidget/tmpldlg.rb
@@ -23,14 +23,14 @@ module DemoDialog
titf4 = Tk::BWidget::TitleFrame.new(frame, :text=>'Other dialog')
subf = titf1.get_frame
- cmd = proc{ TkOption.read_file(File.join(Tk::BWidget::LIBRARY, 'lang',
+ 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),
+ 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)
@@ -46,34 +46,34 @@ module DemoDialog
@@tmpl['side'] = :bottom
@@tmpl['anchor'] = :c
- labf1 = Tk::BWidget::LabelFrame.new(parent, :text=>'Button side',
- :side=>:top, :anchor=>:w,
+ 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),
+ 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,
+ 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),
+ 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)
@@ -88,44 +88,44 @@ module DemoDialog
@@msg['type'] = 'ok'
@@msg['icon'] = 'info'
- labf1 = Tk::BWidget::LabelFrame.new(parent, :text=>'Type', :side=>:top,
- :anchor=>:w, :relief=>:sunken,
+ 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),
+ 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.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,
+ 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),
+ 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)
@@ -139,13 +139,13 @@ module DemoDialog
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}),
+ },
+ 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
@@ -158,15 +158,15 @@ module DemoDialog
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'],
+ 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,
+ 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
@@ -174,16 +174,16 @@ module DemoDialog
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'],
+ @@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 = Tk::BWidget::SelectFont.new(:relative=>Tk.root,
:font=>DemoVar.font).create
DemoVar::Demo.update_font(font)
end
@@ -192,11 +192,11 @@ module DemoDialog
@@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,
+ @@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
diff --git a/ext/tk/sample/tkextlib/bwidget/tree.rb b/ext/tk/sample/tkextlib/bwidget/tree.rb
index 9ef6569d16..e1fcaa774f 100644
--- a/ext/tk/sample/tkextlib/bwidget/tree.rb
+++ b/ext/tk/sample/tkextlib/bwidget/tree.rb
@@ -16,28 +16,28 @@ module DemoTree
pane = pw.add(:weight=>1)
title = Tk::BWidget::TitleFrame.new(pane, :text=>'Directory tree')
- sw = Tk::BWidget::ScrolledWindow.new(title.get_frame,
+ 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,
+ 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, [],
+ :copy, [],
:move, [],
:link, []
- ],
+ ],
'LISTBOX_ITEM', [
- :copy, [],
+ :copy, [],
:move, [],
:link, []
]
- ],
- :opencmd=>proc{|node|
+ ],
+ :opencmd=>proc{|node|
moddir(1, tree, node)
- },
- :closecmd=>proc{|node|
+ },
+ :closecmd=>proc{|node|
moddir(0, tree, node)
})
sw.set_widget(tree)
@@ -47,24 +47,24 @@ module DemoTree
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,
+ 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,
+ 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, [],
+ :copy, [],
:move, [],
:link, []
- ],
+ ],
'LISTBOX_ITEM', [
- :copy, [],
+ :copy, [],
:move, [],
:link, []
]
@@ -77,43 +77,43 @@ module DemoTree
tree.textbind('ButtonPress-1',
proc{|node, ev| select('tree', 1, tree, list, node)})
- tree.textbind('Double-ButtonPress-1',
+ 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',
+ list.textbind('Double-ButtonPress-1',
proc{|node, ev| select('list', 2, tree, list, node)})
- list.imagebind('Double-ButtonPress-1',
+ list.imagebind('Double-ButtonPress-1',
proc{|node, ev| select('list', 2, tree, list, node)})
- nb.itemconfigure('demoTree',
- :createcmd=>proc{|*args| init(tree, list, *args)},
+ nb.itemconfigure('demoTree',
+ :createcmd=>proc{|*args| init(tree, list, *args)},
:raisecmd=>proc{
- Tk.root.geometry =~
+ 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,
+ 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 =~
+ 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,
+ 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')
@@ -131,8 +131,8 @@ module DemoTree
rootdir = 'c:'
end
- tree.insert('end', 'root', 'home',
- :text=>rootdir, :data=>rootdir, :open=>true,
+ 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')
@@ -147,8 +147,8 @@ module DemoTree
@@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,
+ Tk::BWidget::ScrollView.new(@@top, :window=>tree, :fill=>'white',
+ :width=>300, :height=>300, :relief=>:sunken,
:bd=>1).pack(:fill=>:both, :expand=>true)
end
@@ -156,11 +156,11 @@ module DemoTree
lentries = Dir.glob(File.join(path, '*')).sort
lfiles = []
lentries.each{|f|
- basename = File.basename(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'),
+ Tk::BWidget::Tree::Node.new(tree, node,
+ :index=>'end', :text=>basename,
+ :image=>Tk::BWidget::Bitmap.new('folder'),
:drawcross=>:allways, :data=>f)
@@count += 1
else
@@ -187,7 +187,7 @@ module DemoTree
def self.select(where, num, tree, list, node)
@@dblclick = true
if num == 1
- if (where == 'tree' &&
+ if (where == 'tree' &&
tree.selection_get.find{|x|
TkUtil._get_eval_string(x) == TkUtil._get_eval_string(node)
})
@@ -195,7 +195,7 @@ module DemoTree
Tk.after(500, proc{edit('tree', tree, list, node)})
return
end
- if (where == 'list' &&
+ if (where == 'list' &&
list.selection_get.find{|x|
TkUtil._get_eval_string(x) == TkUtil._get_eval_string(node)
})
@@ -230,13 +230,13 @@ module DemoTree
end
tree.nodes(node).each{|subnode|
- list.insert('end', subnode,
- :text=>tree.itemcget(subnode, :text),
+ 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,
+ Tk::BWidget::ListBox::Item.new(list, 'end', :text=>f,
:image=>Tk::BWidget::Bitmap.new('file'))
}
end
@@ -244,7 +244,7 @@ module DemoTree
def self.edit(where, tree, list, node)
return if @@dblclick
- if (where == 'tree' &&
+ if (where == 'tree' &&
tree.selection_get.find{|x|
TkUtil._get_eval_string(x) == TkUtil._get_eval_string(node)
})
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/calendar.rb b/ext/tk/sample/tkextlib/iwidgets/sample/calendar.rb
index bb09b4dfd3..4dd929c035 100644
--- a/ext/tk/sample/tkextlib/iwidgets/sample/calendar.rb
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/calendar.rb
@@ -2,9 +2,9 @@
require 'tk'
require 'tkextlib/iwidgets'
-Tk::Iwidgets::Calendar.new(:command=>proc{|arg| puts(arg.date)},
- :weekendbackground=>'mistyrose',
- :weekdaybackground=>'ghostwhite',
- :outline=>'black', :startday=>'wednesday',
+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/combobox.rb b/ext/tk/sample/tkextlib/iwidgets/sample/combobox.rb
index 36847538d6..ec9c7a1df3 100644
--- a/ext/tk/sample/tkextlib/iwidgets/sample/combobox.rb
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/combobox.rb
@@ -5,11 +5,11 @@ require 'tkextlib/iwidgets'
#
# Non-editable Dropdown Combobox
#
-cb1 = Tk::Iwidgets::Combobox.new(:labeltext=>'Month:',
+cb1 = Tk::Iwidgets::Combobox.new(:labeltext=>'Month:',
:selectioncommand=>proc{
puts(cb1.get_curselection)
- },
- :editable=>false, :listheight=>185,
+ },
+ :editable=>false, :listheight=>185,
:popupcursor=>'hand1')
cb1.insert_list('end', *%w(Jan Feb Mar Apr May June Jul Aug Sept Oct Nov Dec))
@@ -18,7 +18,7 @@ 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:',
+cb2 = Tk::Iwidgets::Combobox.new(:labeltext=>'Operating System:',
:selectioncommand=>proc{
puts(cb2.get_curselection)
})
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/dialogshell.rb b/ext/tk/sample/tkextlib/iwidgets/sample/dialogshell.rb
index 00ee99786c..197521e0a4 100644
--- a/ext/tk/sample/tkextlib/iwidgets/sample/dialogshell.rb
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/dialogshell.rb
@@ -8,7 +8,7 @@ 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,
+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
index 682c853e47..85c5d03d17 100644
--- a/ext/tk/sample/tkextlib/iwidgets/sample/disjointlistbox.rb
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/disjointlistbox.rb
@@ -2,7 +2,7 @@
require 'tk'
require 'tkextlib/iwidgets'
-djl = Tk::Iwidgets::Disjointlistbox.new.pack(:fill=>:both, :expand=>true,
+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)
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/entryfield-1.rb b/ext/tk/sample/tkextlib/iwidgets/sample/entryfield-1.rb
index 8563a0894d..856d883a92 100644
--- a/ext/tk/sample/tkextlib/iwidgets/sample/entryfield-1.rb
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/entryfield-1.rb
@@ -11,20 +11,20 @@ TkOption.add('*textBackground', 'white')
ef = Tk::Iwidgets::Entryfield.new(:command=>proc{puts "Return Pressed"})
-fef = Tk::Iwidgets::Entryfield.new(:labeltext=>'Fixed:',
+fef = Tk::Iwidgets::Entryfield.new(:labeltext=>'Fixed:',
:fixed=>10, :width=>12)
-nef = Tk::Iwidgets::Entryfield.new(:labeltext=>'Numeric:',
+nef = Tk::Iwidgets::Entryfield.new(:labeltext=>'Numeric:',
:validate=>:numeric, :width=>12)
-aef = Tk::Iwidgets::Entryfield.new(:labeltext=>'Alphabetic:',
- :validate=>:alphabetic, :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"),
+pef = Tk::Iwidgets::Entryfield.new(:labeltext=>'Password:', :width=>12,
+ :show=>Tk::UTF8_String("\267"),
## <=== utf8 character
:command=>proc{puts "Return Pressed"})
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/entryfield-2.rb b/ext/tk/sample/tkextlib/iwidgets/sample/entryfield-2.rb
index d8ccdf8555..4a4c2e7eb7 100644
--- a/ext/tk/sample/tkextlib/iwidgets/sample/entryfield-2.rb
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/entryfield-2.rb
@@ -4,11 +4,7 @@
# set $KCODE to 'utf' for a utf8 charecter
#
#########################################################
-unless defined?(::Encoding.default_external)
- $KCODE='utf'
-else
- DEFAULT_TK_ENCODING = 'UTF-8'
-end
+$KCODE='utf'
require 'tk'
require 'tkextlib/iwidgets'
@@ -17,19 +13,19 @@ TkOption.add('*textBackground', 'white')
ef = Tk::Iwidgets::Entryfield.new(:command=>proc{puts "Return Pressed"})
-fef = Tk::Iwidgets::Entryfield.new(:labeltext=>'Fixed:',
+fef = Tk::Iwidgets::Entryfield.new(:labeltext=>'Fixed:',
:fixed=>10, :width=>12)
-nef = Tk::Iwidgets::Entryfield.new(:labeltext=>'Numeric:',
+nef = Tk::Iwidgets::Entryfield.new(:labeltext=>'Numeric:',
:validate=>:numeric, :width=>12)
-aef = Tk::Iwidgets::Entryfield.new(:labeltext=>'Alphabetic:',
- :validate=>:alphabetic, :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,
+pef = Tk::Iwidgets::Entryfield.new(:labeltext=>'Password:', :width=>12,
:show=>"\267", ## <=== utf8 character
:command=>proc{puts "Return Pressed"})
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/entryfield-3.rb b/ext/tk/sample/tkextlib/iwidgets/sample/entryfield-3.rb
index 327f90893c..bddd542f64 100644
--- a/ext/tk/sample/tkextlib/iwidgets/sample/entryfield-3.rb
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/entryfield-3.rb
@@ -13,19 +13,19 @@ TkOption.add('*textBackground', 'white')
ef = Tk::Iwidgets::Entryfield.new(:command=>proc{puts "Return Pressed"})
-fef = Tk::Iwidgets::Entryfield.new(:labeltext=>'Fixed:',
+fef = Tk::Iwidgets::Entryfield.new(:labeltext=>'Fixed:',
:fixed=>10, :width=>12)
-nef = Tk::Iwidgets::Entryfield.new(:labeltext=>'Numeric:',
+nef = Tk::Iwidgets::Entryfield.new(:labeltext=>'Numeric:',
:validate=>:numeric, :width=>12)
-aef = Tk::Iwidgets::Entryfield.new(:labeltext=>'Alphabetic:',
- :validate=>:alphabetic, :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,
+pef = Tk::Iwidgets::Entryfield.new(:labeltext=>'Password:', :width=>12,
:show=>"\267", ## <=== utf8 character
:command=>proc{puts "Return Pressed"})
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/extbutton.rb b/ext/tk/sample/tkextlib/iwidgets/sample/extbutton.rb
index 4944c72ea5..6971052b60 100644
--- a/ext/tk/sample/tkextlib/iwidgets/sample/extbutton.rb
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/extbutton.rb
@@ -2,9 +2,9 @@
require 'tk'
require 'tkextlib/iwidgets'
-Tk::Iwidgets::Extbutton.new(:text=>'Bitmap example', :bitmap=>'info',
- :background=>'bisque', :activeforeground=>'red',
- :bitmapforeground=>'blue', :defaultring=>true,
+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)
@@ -12,9 +12,9 @@ Tk::Iwidgets::Extbutton.new(:text=>'Bitmap example', :bitmap=>'info',
#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',
+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
index 63e4be2fee..4738084d9d 100644
--- a/ext/tk/sample/tkextlib/iwidgets/sample/extfileselectionbox.rb
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/extfileselectionbox.rb
@@ -2,7 +2,7 @@
require 'tk'
require 'tkextlib/iwidgets'
-Tk::Iwidgets::Extfileselectionbox.new.pack(:padx=>10, :pady=>10,
+Tk::Iwidgets::Extfileselectionbox.new.pack(:padx=>10, :pady=>10,
:fill=>:both, :expand=>true)
Tk.mainloop
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/fileselectionbox.rb b/ext/tk/sample/tkextlib/iwidgets/sample/fileselectionbox.rb
index 3a5b513bde..2ad3adb974 100644
--- a/ext/tk/sample/tkextlib/iwidgets/sample/fileselectionbox.rb
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/fileselectionbox.rb
@@ -2,7 +2,7 @@
require 'tk'
require 'tkextlib/iwidgets'
-Tk::Iwidgets::Fileselectionbox.new.pack(:padx=>10, :pady=>10,
+Tk::Iwidgets::Fileselectionbox.new.pack(:padx=>10, :pady=>10,
:fill=>:both, :expand=>true)
Tk.mainloop
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/hierarchy.rb b/ext/tk/sample/tkextlib/iwidgets/sample/hierarchy.rb
index 085070e652..ddb08d8b78 100644
--- a/ext/tk/sample/tkextlib/iwidgets/sample/hierarchy.rb
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/hierarchy.rb
@@ -10,16 +10,16 @@ def get_files(file)
}
end
-Tk::Iwidgets::Hierarchy.new(:querycommand=>proc{|arg| get_files(arg.node)},
- :visibleitems=>'30x15',
- :labeltext=>ENV['HOME']).pack(:side=>:left,
- :expand=>true,
+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,
+# 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/labeledwidget.rb b/ext/tk/sample/tkextlib/iwidgets/sample/labeledwidget.rb
index 577550af55..1d2e0a98a3 100644
--- a/ext/tk/sample/tkextlib/iwidgets/sample/labeledwidget.rb
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/labeledwidget.rb
@@ -2,11 +2,11 @@
require 'tk'
require 'tkextlib/iwidgets'
-lw = Tk::Iwidgets::Labeledwidget.new(:labeltext=>'Canvas Widget',
+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,
+cw = TkCanvas.new(lw.child_site, :relief=>:raised, :width=>200, :height=>200,
:borderwidth=>3, :background=>:white)
cw.pack(:padx=>10, :pady=>10)
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/mainwindow.rb b/ext/tk/sample/tkextlib/iwidgets/sample/mainwindow.rb
index c9677f2270..b87a6d27f9 100644
--- a/ext/tk/sample/tkextlib/iwidgets/sample/mainwindow.rb
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/mainwindow.rb
@@ -4,55 +4,55 @@ require 'tkextlib/iwidgets'
mw = Tk::Iwidgets::Mainwindow.new
-mw.menubar.add(:menubutton, 'file', :text=>'File', :underline=>0,
+mw.menubar.add(:menubutton, 'file', :text=>'File', :underline=>0,
:padx=>8, :pady=>2, :menu=>[
- [:options, {:tearoff=>false}],
+ [:options, {:tearoff=>false}],
[:command, 'new', {
- :label=>'New', :underline=>0,
+ :label=>'New', :underline=>0,
:helpstr=>'Create a new file'
}
- ],
+ ],
[:command, 'open', {
- :label=>'Open ...', :underline=>0,
+ :label=>'Open ...', :underline=>0,
:helpstr=>'Open an existing file'
}
- ],
+ ],
[:command, 'save', {
- :label=>'Save', :underline=>0,
+ :label=>'Save', :underline=>0,
:helpstr=>'Save the current file'
}
- ],
+ ],
[:command, 'saveas', {
- :label=>'Save As', :underline=>5,
+ :label=>'Save As', :underline=>5,
:helpstr=>'Save the file as a different name'
}
- ],
+ ],
[:command, 'print', {
- :label=>'Print', :underline=>0,
+ :label=>'Print', :underline=>0,
:helpstr=>'Print the file'
}
- ],
+ ],
- [:separator, 'sep1'],
+ [:separator, 'sep1'],
[:command, 'close', {
- :label=>'Close', :underline=>0,
+ :label=>'Close', :underline=>0,
:helpstr=>'Close the file'
}
- ],
+ ],
- [:separator, 'sep2'],
+ [:separator, 'sep2'],
[:command, 'exit', {
- :label=>'Exit', :underline=>1,
+ :label=>'Exit', :underline=>1,
:helpstr=>'Exit this application'
}
- ],
+ ],
nil
])
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/menubar.rb b/ext/tk/sample/tkextlib/iwidgets/sample/menubar.rb
index e01275217d..891761adc1 100644
--- a/ext/tk/sample/tkextlib/iwidgets/sample/menubar.rb
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/menubar.rb
@@ -8,96 +8,96 @@ viewmode = TkVariable.new
menu_spec = [
[:menubutton, 'file', {
:text=>'File', :menu=>[
- [:options, {:tearoff=>false}],
+ [:options, {:tearoff=>false}],
[:command, 'new', {
- :label=>'New', :helpstr=>'Open new document',
+ :label=>'New', :helpstr=>'Open new document',
:command=>proc{puts 'NEW'}
}
- ],
+ ],
[:command, 'close', {
- :label=>'Close', :helpstr=>'Close current document',
+ :label=>'Close', :helpstr=>'Close current document',
:command=>proc{puts 'CLOSE'}
}
- ],
+ ],
- [:separator, 'sep1'],
+ [:separator, 'sep1'],
[:command, 'exit', {
- :label=>'Exit', :helpstr=>'Exit application',
+ :label=>'Exit', :helpstr=>'Exit application',
:command=>proc{exit}
}
]
]
}
- ],
+ ],
[:menubutton, 'edit', {
:text=>'Edit', :menu=>[
- [:options, {:tearoff=>false}],
+ [:options, {:tearoff=>false}],
[:command, 'undo', {
- :label=>'Undo', :underline=>0,
- :helpstr=>'Undo last command',
+ :label=>'Undo', :underline=>0,
+ :helpstr=>'Undo last command',
:command=>proc{puts 'UNDO'}
}
- ],
+ ],
- [:separator, 'sep2'],
+ [:separator, 'sep2'],
[:command, 'cut', {
- :label=>'Cut', :underline=>1,
- :helpstr=>'Cut selection to clipboard',
+ :label=>'Cut', :underline=>1,
+ :helpstr=>'Cut selection to clipboard',
:command=>proc{puts 'CUT'}
}
- ],
+ ],
[:command, 'copy', {
- :label=>'Copy', :underline=>1,
- :helpstr=>'Copy selection to clipboard',
+ :label=>'Copy', :underline=>1,
+ :helpstr=>'Copy selection to clipboard',
:command=>proc{puts 'COPY'}
}
- ],
+ ],
[:command, 'paste', {
- :label=>'Paste', :underline=>0,
- :helpstr=>'Paste clipboard contents',
+ :label=>'Paste', :underline=>0,
+ :helpstr=>'Paste clipboard contents',
:command=>proc{puts 'PASTE'}
}
]
]
}
- ],
+ ],
[:menubutton, 'options', {
:text=>'Options', :menu=>[
- [:options, {:tearoff=>false, :selectcolor=>'blue'}],
+ [:options, {:tearoff=>false, :selectcolor=>'blue'}],
[:radiobutton, 'byName', {
- :variable=>viewmode, :value=>'NAME',
- :label=>'by Name', :helpstr=>'View files by name order',
+ :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',
+ :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',
+ :label=>'Colors...', :helpstr=>'Change text colors',
:command=>proc{puts 'COLORS'}
}
- ],
+ ],
[:command, 'fonts', {
- :label=>'Fonts...', :helpstr=>'Change text font',
+ :label=>'Fonts...', :helpstr=>'Change text font',
:command=>proc{puts 'COLORS'}
}
]
@@ -109,7 +109,7 @@ menu_spec = [
]
]
-#mb = Tk::Iwidgets::Menubar.new(:helpvariable=>helpvar,
+#mb = Tk::Iwidgets::Menubar.new(:helpvariable=>helpvar,
# :menubuttons=>menu_spec)
mb = Tk::Iwidgets::Menubar.new(:helpvariable=>helpvar)
mb.configure(:menubuttons=>menu_spec)
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/menubar2.rb b/ext/tk/sample/tkextlib/iwidgets/sample/menubar2.rb
index 477c916e07..d6f2292650 100644
--- a/ext/tk/sample/tkextlib/iwidgets/sample/menubar2.rb
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/menubar2.rb
@@ -9,13 +9,13 @@ mb = Tk::Iwidgets::Menubar.new
mb.menubuttons = [
[:menubutton, 'file', {
:text=>'File', :menu=>[
- [:command, 'new', {:label=>'New'}],
- [:command, 'close', {:label=>'Close'}],
- [:separator, 'sep1'],
+ [:command, 'new', {:label=>'New'}],
+ [:command, 'close', {:label=>'Close'}],
+ [:separator, 'sep1'],
[:command, 'quit', {:label=>'Quit'}]
]
}
- ],
+ ],
[:menubutton, 'edit', {:text=>'Edit'}]
]
@@ -28,14 +28,14 @@ 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, 'colors', {:label=>'Colors...'}],
[:command, 'fonts', {:label=>'Fonts...'}]
])
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/messagebox1.rb b/ext/tk/sample/tkextlib/iwidgets/sample/messagebox1.rb
index 87b2d38907..3221dbc30c 100644
--- a/ext/tk/sample/tkextlib/iwidgets/sample/messagebox1.rb
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/messagebox1.rb
@@ -2,9 +2,9 @@
require 'tk'
require 'tkextlib/iwidgets'
-mb = Tk::Iwidgets::Messagebox.new(:hscrollmode=>:dynamic,
- :labeltext=>'Messages', :labelpos=>:n,
- :height=>120, :width=>550,
+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)
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/messagebox2.rb b/ext/tk/sample/tkextlib/iwidgets/sample/messagebox2.rb
index 5278883568..2f0e3648a6 100644
--- a/ext/tk/sample/tkextlib/iwidgets/sample/messagebox2.rb
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/messagebox2.rb
@@ -2,9 +2,9 @@
require 'tk'
require 'tkextlib/iwidgets'
-mb = Tk::Iwidgets::Messagebox.new(:hscrollmode=>:dynamic,
- :labeltext=>'Messages', :labelpos=>:n,
- :height=>120, :width=>550,
+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)
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/messagedialog.rb b/ext/tk/sample/tkextlib/iwidgets/sample/messagedialog.rb
index 52799f206c..6c6bfbca3f 100644
--- a/ext/tk/sample/tkextlib/iwidgets/sample/messagedialog.rb
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/messagedialog.rb
@@ -7,8 +7,8 @@ mainloop = Thread.new{Tk.mainloop}
#
# Standard question message dialog used for confirmation.
#
-md = Tk::Iwidgets::Messagedialog.new(:title=>'Message Dialog',
- :text=>'Are you sure ? ',
+md = Tk::Iwidgets::Messagedialog.new(:title=>'Message Dialog',
+ :text=>'Are you sure ? ',
:bitmap=>'questhead', :modality=>:global)
md.buttonconfigure('OK', :text=>'Yes')
@@ -32,8 +32,8 @@ md.destroy
#
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,
+cr = Tk::Iwidgets::Messagedialog.new(:title=>'Copyright',
+ :bitmap=>bmp, :imagepos=>:n,
:text=>"Copyright 200x XXX Corporation\nAll rights reserved")
cr.hide('Cancel')
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/notebook.rb b/ext/tk/sample/tkextlib/iwidgets/sample/notebook.rb
index 055312ec96..e33b81eb6f 100644
--- a/ext/tk/sample/tkextlib/iwidgets/sample/notebook.rb
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/notebook.rb
@@ -4,7 +4,7 @@ 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,
+nb.pack(:anchor=>:nw, :fill=>:both, :expand=>true,
:side=>:left, :padx=>10, :pady=>10)
# Add two pages to the tabnotebook,
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/notebook2.rb b/ext/tk/sample/tkextlib/iwidgets/sample/notebook2.rb
index 41e9ce1bfc..649de4f024 100644
--- a/ext/tk/sample/tkextlib/iwidgets/sample/notebook2.rb
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/notebook2.rb
@@ -4,7 +4,7 @@ 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,
+nb.pack(:anchor=>:nw, :fill=>:both, :expand=>true,
:side=>:top, :padx=>10, :pady=>0)
# Add two pages to the tabnotebook,
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/optionmenu.rb b/ext/tk/sample/tkextlib/iwidgets/sample/optionmenu.rb
index 2b921ffab9..1fd7a5bc05 100644
--- a/ext/tk/sample/tkextlib/iwidgets/sample/optionmenu.rb
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/optionmenu.rb
@@ -2,7 +2,7 @@
require 'tk'
require 'tkextlib/iwidgets'
-om = Tk::Iwidgets::Optionmenu.new(:labelmargin=>5, :labelpos=>:w,
+om = Tk::Iwidgets::Optionmenu.new(:labelmargin=>5, :labelpos=>:w,
:labeltext=>"Operating System :")
om.insert('end', 'Unix', 'VMS', 'Linux', 'OS/2', 'Windows NT', 'DOS')
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/panedwindow.rb b/ext/tk/sample/tkextlib/iwidgets/sample/panedwindow.rb
index 88fc401483..6e4458e508 100644
--- a/ext/tk/sample/tkextlib/iwidgets/sample/panedwindow.rb
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/panedwindow.rb
@@ -11,7 +11,7 @@ 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,
+ TkButton.new(pane, :text=>pane.path, :relief=>:raised,
:borderwidth=>2).pack(:fill=>:both, :expand=>true)
}
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/panedwindow2.rb b/ext/tk/sample/tkextlib/iwidgets/sample/panedwindow2.rb
index 96987d529c..6779cb57db 100644
--- a/ext/tk/sample/tkextlib/iwidgets/sample/panedwindow2.rb
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/panedwindow2.rb
@@ -11,7 +11,7 @@ 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,
+ TkButton.new(pane, :text=>pane.path, :relief=>:raised,
:borderwidth=>2).pack(:fill=>:both, :expand=>true)
}
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/promptdialog.rb b/ext/tk/sample/tkextlib/iwidgets/sample/promptdialog.rb
index d92a26ead9..2c643e56f7 100644
--- a/ext/tk/sample/tkextlib/iwidgets/sample/promptdialog.rb
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/promptdialog.rb
@@ -6,7 +6,7 @@ mainloop = Thread.new{Tk.mainloop}
TkOption.add('*textBackground', 'white')
-pd = Tk::Iwidgets::Promptdialog.new(:modality=>:global, :title=>'Password',
+pd = Tk::Iwidgets::Promptdialog.new(:modality=>:global, :title=>'Password',
:labeltext=>'Password:', :show=>'*')
pd.hide('Apply')
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/pushbutton.rb b/ext/tk/sample/tkextlib/iwidgets/sample/pushbutton.rb
index e76dda88c6..6e1c3fffe3 100644
--- a/ext/tk/sample/tkextlib/iwidgets/sample/pushbutton.rb
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/pushbutton.rb
@@ -2,8 +2,8 @@
require 'tk'
require 'tkextlib/iwidgets'
-Tk::Iwidgets::Pushbutton.new(:text=>'Hello',
- :command=>proc{puts 'Hello World'},
+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/scrolledframe.rb b/ext/tk/sample/tkextlib/iwidgets/sample/scrolledframe.rb
index e5bd90a1cb..5219847c9c 100644
--- a/ext/tk/sample/tkextlib/iwidgets/sample/scrolledframe.rb
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/scrolledframe.rb
@@ -2,7 +2,7 @@
require 'tk'
require 'tkextlib/iwidgets'
-sf = Tk::Iwidgets::Scrolledframe.new(:width=>150, :height=>180,
+sf = Tk::Iwidgets::Scrolledframe.new(:width=>150, :height=>180,
:labeltext=>'scrolledframe')
cs = sf.child_site
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/scrolledhtml.rb b/ext/tk/sample/tkextlib/iwidgets/sample/scrolledhtml.rb
index 2b675f802c..04334b8da8 100644
--- a/ext/tk/sample/tkextlib/iwidgets/sample/scrolledhtml.rb
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/scrolledhtml.rb
@@ -4,7 +4,7 @@ require 'tkextlib/iwidgets'
TkOption.add('*textBackground', 'white')
-sh = Tk::Iwidgets::Scrolledhtml.new(:fontname=>'helvetica',
+sh = Tk::Iwidgets::Scrolledhtml.new(:fontname=>'helvetica',
:linkcommand=>proc{|href|
sh.import_link(href)
})
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/scrolledlistbox.rb b/ext/tk/sample/tkextlib/iwidgets/sample/scrolledlistbox.rb
index bf2c60191f..0b69751911 100644
--- a/ext/tk/sample/tkextlib/iwidgets/sample/scrolledlistbox.rb
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/scrolledlistbox.rb
@@ -4,13 +4,13 @@ require 'tkextlib/iwidgets'
TkOption.add('*textBackground', 'white')
-slb = Tk::Iwidgets::Scrolledlistbox.new(:selectmode=>:single,
+slb = Tk::Iwidgets::Scrolledlistbox.new(:selectmode=>:single,
:vscrollmode=>:static,
:hscrollmode=>:dynamic,
- :labeltext=>'List',
+ :labeltext=>'List',
:selectioncommand=>proc{
puts(slb.get_curselection)
- },
+ },
:dblclickcommand=>proc{
puts('Double Click')
puts(slb.get_curselection)
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/scrolledtext.rb b/ext/tk/sample/tkextlib/iwidgets/sample/scrolledtext.rb
index 41498e67f7..dd1a99a829 100644
--- a/ext/tk/sample/tkextlib/iwidgets/sample/scrolledtext.rb
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/scrolledtext.rb
@@ -2,7 +2,7 @@
require 'tk'
require 'tkextlib/iwidgets'
-st = Tk::Iwidgets::Scrolledtext.new(:hscrollmode=>:dynamic, :wrap=>:none,
+st = Tk::Iwidgets::Scrolledtext.new(:hscrollmode=>:dynamic, :wrap=>:none,
:labeltext=>'Password File')
st.pack(:expand=>true, :fill=>:both, :padx=>10, :pady=>10)
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/selectionbox.rb b/ext/tk/sample/tkextlib/iwidgets/sample/selectionbox.rb
index 74684974b1..a5d623ae80 100644
--- a/ext/tk/sample/tkextlib/iwidgets/sample/selectionbox.rb
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/selectionbox.rb
@@ -4,12 +4,12 @@ require 'tkextlib/iwidgets'
TkOption.add('*textBackground', 'white')
-sb = Tk::Iwidgets::Selectionbox.new.pack(:padx=>10, :pady=>10,
+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,
+TkLabel.new(sb.child_site,
:text=>'Child Site is Here').pack(:fill=>:x, :padx=>10, :pady=>10)
sb.insert_items(2, 'Cruel Cruel')
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/selectiondialog.rb b/ext/tk/sample/tkextlib/iwidgets/sample/selectiondialog.rb
index d53391f2f3..f40b419180 100644
--- a/ext/tk/sample/tkextlib/iwidgets/sample/selectiondialog.rb
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/selectiondialog.rb
@@ -4,7 +4,7 @@ require 'tkextlib/iwidgets'
mainloop = Thread.new{Tk.mainloop}
-TkButton.new(:text=>'QUIT',
+TkButton.new(:text=>'QUIT',
:command=>proc{Tk.root.destroy}).pack(:padx=>10, :pady=>10)
Tk::Iwidgets::Selectiondialog.new.activate
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/shell.rb b/ext/tk/sample/tkextlib/iwidgets/sample/shell.rb
index 6d01280141..c44b5554a6 100644
--- a/ext/tk/sample/tkextlib/iwidgets/sample/shell.rb
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/shell.rb
@@ -2,16 +2,16 @@
require 'tk'
require 'tkextlib/iwidgets'
-sh = Tk::Iwidgets::Shell.new(:modality=>:application,
+sh = Tk::Iwidgets::Shell.new(:modality=>:application,
:padx=>20, :pady=>20, :title=>'Shell')
-TkButton.new(:text=>'ACTIVATE', :padx=>7, :pady=>7,
+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',
+TkButton.new(sh.child_site, :text=>'YES',
:command=>proc{sh.deactivate 'press YES'}).pack(:fill=>:x)
-TkButton.new(sh.child_site, :text=>'NO',
+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/spinint.rb b/ext/tk/sample/tkextlib/iwidgets/sample/spinint.rb
index e2dde01b18..0bcdefb763 100644
--- a/ext/tk/sample/tkextlib/iwidgets/sample/spinint.rb
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/spinint.rb
@@ -4,7 +4,7 @@ require 'tkextlib/iwidgets'
TkOption.add('*textBackground', 'white')
-Tk::Iwidgets::Spinint.new(:labeltext=>'Temperature', :labelpos=>:w, :width=>5,
+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
index 6a20b0eb87..295d38ee96 100644
--- a/ext/tk/sample/tkextlib/iwidgets/sample/spinner.rb
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/spinner.rb
@@ -18,10 +18,10 @@ class Spinner_demo < TkWindow
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},
+ @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])
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/tabnotebook.rb b/ext/tk/sample/tkextlib/iwidgets/sample/tabnotebook.rb
index 382b34d3ce..6f1ecc4fa4 100644
--- a/ext/tk/sample/tkextlib/iwidgets/sample/tabnotebook.rb
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/tabnotebook.rb
@@ -4,7 +4,7 @@ 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,
+tn.pack(:anchor=>:nw, :fill=>:both, :expand=>true,
:side=>:left, :padx=>10, :pady=>10)
# Add two pages to the tabnotebook,
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/tabnotebook2.rb b/ext/tk/sample/tkextlib/iwidgets/sample/tabnotebook2.rb
index 2689759bde..4a5eef5a8f 100644
--- a/ext/tk/sample/tkextlib/iwidgets/sample/tabnotebook2.rb
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/tabnotebook2.rb
@@ -4,7 +4,7 @@ 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,
+tn.pack(:anchor=>:nw, :fill=>:both, :expand=>true,
:side=>:top, :padx=>10, :pady=>0)
# Add two pages to the tabnotebook,
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/toolbar.rb b/ext/tk/sample/tkextlib/iwidgets/sample/toolbar.rb
index 608efd0af1..355466eb1a 100644
--- a/ext/tk/sample/tkextlib/iwidgets/sample/toolbar.rb
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/toolbar.rb
@@ -88,7 +88,7 @@ EOD
##########################################
-bmp_dir = File.join(File.dirname(File.expand_path(__FILE__)),
+bmp_dir = File.join(File.dirname(File.expand_path(__FILE__)),
'../catalog_demo/images')
##########################################
@@ -102,16 +102,16 @@ tb = Tk::Iwidgets::Toolbar.new(:helpvariable=>status_var)
##########################################
-tb.add(:button, :helpstr=>'Copy It', :image=>editcopy22,
+tb.add(:button, :helpstr=>'Copy It', :image=>editcopy22,
:balloonstr=>'Copy', :command=>proc{puts 'Copy It'})
-tb.add(:button, :helpstr=>'Cut It', :image=>editcut22,
+tb.add(:button, :helpstr=>'Cut It', :image=>editcut22,
:balloonstr=>'Cut', :command=>proc{puts 'Cut It'})
-tb.add(:button, :helpstr=>'Paste It', :image=>editpaste22,
+tb.add(:button, :helpstr=>'Paste It', :image=>editpaste22,
:balloonstr=>'Paste', :command=>proc{puts 'Paste It'})
-tb.add(:button, :helpstr=>'Delete It', :image=>editdelete22,
+tb.add(:button, :helpstr=>'Delete It', :image=>editdelete22,
:balloonstr=>'Delete', :command=>proc{puts 'Delete It'})
#--------------------------------
@@ -120,19 +120,19 @@ 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',
+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',
+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',
+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"'})
#--------------------------------
@@ -141,10 +141,10 @@ tb.add(:frame, :borderwidth=>1, :width=>10, :height=>10)
#--------------------------------
-tb.add(:checkbutton, :variable=>check_var1, :onvalue=>'yes', :offvalue=>'no',
+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',
+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)
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/watch.rb b/ext/tk/sample/tkextlib/iwidgets/sample/watch.rb
index 2af53ba63b..808c798aec 100644
--- a/ext/tk/sample/tkextlib/iwidgets/sample/watch.rb
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/watch.rb
@@ -8,7 +8,7 @@ Thread.new{
trap('INT', 'DEFAULT')
}
-Tk::Iwidgets::Watch.new(:state=>:disabled, :showampm=>:no,
+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
diff --git a/ext/tk/sample/tkextlib/tcllib/datefield.rb b/ext/tk/sample/tkextlib/tcllib/datefield.rb
index 3550af7d23..cfeca0c6de 100644
--- a/ext/tk/sample/tkextlib/tcllib/datefield.rb
+++ b/ext/tk/sample/tkextlib/tcllib/datefield.rb
@@ -20,8 +20,8 @@ my_date1.trace('w'){
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),
+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
diff --git a/ext/tk/sample/tkextlib/tcllib/plotdemos1.rb b/ext/tk/sample/tkextlib/tcllib/plotdemos1.rb
index 7f35a3833c..053b0de085 100644
--- a/ext/tk/sample/tkextlib/tcllib/plotdemos1.rb
+++ b/ext/tk/sample/tkextlib/tcllib/plotdemos1.rb
@@ -23,7 +23,7 @@ Tk.pack(vc1,vc2,vc3, :fill=>:both, :side=>:top)
###############################
-s = Tk::Tcllib::Plotchart::XYPlot.new(c1, [0.0, 100.0, 10.0],
+s = Tk::Tcllib::Plotchart::XYPlot.new(c1, [0.0, 100.0, 10.0],
[0.0, 100.0, 20.0])
@@ -56,7 +56,7 @@ s.save_plot "aha.ps"
s = Tk::Tcllib::Plotchart::Piechart.new(c2)
-s.plot([ ["Long names", 10], ["Short names", 30],
+s.plot([ ["Long names", 10], ["Short names", 30],
["Average", 40], ["Ultra-short names", 5] ])
#
@@ -78,7 +78,7 @@ s.title "Cardioid"
###############################
-s = Tk::Tcllib::Plotchart::Barchart.new(hc1, %w(A B C D E),
+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')
@@ -87,7 +87,7 @@ s.title "Arbitrary data"
###############################
-s = Tk::Tcllib::Plotchart::Barchart.new(hc2, %w(A B C D E),
+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')
@@ -96,7 +96,7 @@ s.title "Stacked diagram"
###############################
-s = Tk::Tcllib::Plotchart::HorizontalBarchart.new(vc1, [0.0, 10.0, 2.0],
+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')
@@ -105,7 +105,7 @@ s.title "Arbitrary data"
###############################
-s = Tk::Tcllib::Plotchart::HorizontalBarchart.new(vc2, [0.0, 20.0, 5.0],
+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')
@@ -114,7 +114,7 @@ s.title "Stacked diagram"
###############################
-s = Tk::Tcllib::Plotchart::Timechart.new(vc3, "1 january 2004",
+s = Tk::Tcllib::Plotchart::Timechart.new(vc3, "1 january 2004",
"31 december 2004", 4)
s.period("Spring", "1 march 2004", "1 june 2004", 'green')
@@ -134,7 +134,7 @@ 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,
+s = Tk::Tcllib::Plotchart::Plot3D.new(zc1,
[0, 10, 3], [-10, 10, 10], [0, 10, 2.5])
s.title "3D Plot"
@@ -145,12 +145,12 @@ s.plot_function{|x, y|
3.0 * (1.0-(x1*x1+y1*y1))*(1.0-(x1*x1+y1*y1))
}
-s = Tk::Tcllib::Plotchart::Plot3D.new(zc2,
+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],
+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] ])
###############################
diff --git a/ext/tk/sample/tkextlib/tcllib/plotdemos2.rb b/ext/tk/sample/tkextlib/tcllib/plotdemos2.rb
index cb657a40d8..33a6f29940 100644
--- a/ext/tk/sample/tkextlib/tcllib/plotdemos2.rb
+++ b/ext/tk/sample/tkextlib/tcllib/plotdemos2.rb
@@ -12,7 +12,7 @@ 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],
+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
@@ -34,7 +34,7 @@ slipchart.title "Aha!"
###############################
# Set up an isometric plot
###############################
-s = Tk::Tcllib::Plotchart::IsometricPlot.new(c2, [0.0, 100.0], [0.0, 200.0],
+s = Tk::Tcllib::Plotchart::IsometricPlot.new(c2, [0.0, 100.0], [0.0, 200.0],
:noaxes)
s.set_zoom_pan
@@ -50,8 +50,8 @@ s.plot('circle', [70.0, 70.0, 42.0])
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 = 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)
diff --git a/ext/tk/sample/tkextlib/tcllib/plotdemos3.rb b/ext/tk/sample/tkextlib/tcllib/plotdemos3.rb
index 66b8fe706a..2b5c7642bb 100644
--- a/ext/tk/sample/tkextlib/tcllib/plotdemos3.rb
+++ b/ext/tk/sample/tkextlib/tcllib/plotdemos3.rb
@@ -7,9 +7,9 @@ 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',
+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)
@@ -38,8 +38,8 @@ Tk::Tcllib::Plotchart::Stripchart.new([0.0, 100.0, 10.0],
###############################
# Set up an isometric plot
###############################
-Tk::Tcllib::Plotchart::IsometricPlot.new([0.0, 100.0], [0.0, 200.0], :noaxes,
- :background=>'white',
+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
@@ -54,17 +54,17 @@ Tk::Tcllib::Plotchart::IsometricPlot.new([0.0, 100.0], [0.0, 200.0], :noaxes,
# 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',
+ 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',
+ series1 = Tk::Tcllib::Plotchart::PlotSeries.new(chart, :colour=>'red',
:type=>:symbol)
- series2 = Tk::Tcllib::Plotchart::PlotSeries.new(chart, :colour=>'green',
+ series2 = Tk::Tcllib::Plotchart::PlotSeries.new(chart, :colour=>'green',
:type=>:both)
x = 5.0
diff --git a/ext/tk/sample/tkextlib/tcllib/xyplot.rb b/ext/tk/sample/tkextlib/tcllib/xyplot.rb
index 2aa101efcb..8f8c3eb880 100644
--- a/ext/tk/sample/tkextlib/tcllib/xyplot.rb
+++ b/ext/tk/sample/tkextlib/tcllib/xyplot.rb
@@ -5,7 +5,7 @@ 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],
+ 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)
diff --git a/ext/tk/sample/tkextlib/tile/demo.rb b/ext/tk/sample/tkextlib/tile/demo.rb
index 260ca00022..633a072460 100644
--- a/ext/tk/sample/tkextlib/tile/demo.rb
+++ b/ext/tk/sample/tkextlib/tile/demo.rb
@@ -34,7 +34,7 @@ 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.
+## --> This doesn't work.
## Because, unknown_proc may be "command + some arguments".
Tk.ip_eval("#{TkPackage.unknown_proc} Tcl #{TkPackage.provide('Tcl')}")
@@ -45,18 +45,18 @@ TkRoot.new{
# The descriptive names of the builtin themes.
$THEMELIST = [
- ['default', 'Default'],
- ['classic', 'Classic'],
- ['alt', 'Revitalized'],
- ['winnative', 'Windows native'],
- ['xpnative', 'XP Native'],
- ['aqua', 'Aqua'],
+ ['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',
+$V = TkVariable.new_hash(:THEME => 'default',
+ :COMPOUND => 'top',
+ :CONSOLE => false,
+ :MENURADIO1 => 'One',
:MENUCHECK1 => true,
:PBMODE => 'determinate',
:SELECTED => true,
@@ -84,8 +84,8 @@ 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),
+ 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}/})
@@ -93,8 +93,8 @@ def makeThemeControl(parent)
end
}
$RUBY_THEMELIST.each{|theme, name, available|
- b = Tk::Tile::Radiobutton.new(c, :text=>name, :value=>theme,
- :variable=>$V.ref(:THEME),
+ 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
@@ -105,14 +105,14 @@ end
def makeThemeMenu(parent)
m = TkMenu.new(parent)
$THEMELIST.each{|theme, name|
- m.add(:radiobutton, :label=>name, :variable=>$V.ref(:THEME),
+ 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),
+ m.add(:radiobutton, :label=>name, :variable=>$V.ref(:THEME),
:value=>theme, :command=>proc{setTheme(theme)})
m.entryconfigure(:end, :state=>:disabled) unless available
}
@@ -174,7 +174,7 @@ def sbstub(sb, cmd, num, units = 'units')
current = sb.get
sb.set(current[0] + delta * num, current[1] + delta * num)
end
-end
+end
# ... for debugging:
TkBindTag::ALL.bind('ButtonPress-3', proc{|w| $W = w}, '%W')
@@ -209,21 +209,21 @@ def makeToolbars
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,
+ 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,
+ 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'],
+ mb = Tk::Tile::Menubutton.new(tb, :text=>'toolbar', :image=>$ICON['file'],
:compound=>$V[:COMPOUND])
mb.configure(:menu=>makeCompoundMenu(mb))
i += 1
@@ -240,21 +240,21 @@ def makeToolbars
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,
+ 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,
+ 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'],
+ mb = TkMenubutton.new(tb, :text=>'toolbar', :image=>$ICON['file'],
:compound=>$V[:COMPOUND])
mb.configure(:menu=>makeCompoundMenu(mb))
i += 1
@@ -270,8 +270,8 @@ end
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,
+ menu.add(:radiobutton, :label=>Tk.tk_call('string', 'totitle', str),
+ :variable=>$V.ref(:COMPOUND), :value=>str,
:command=>proc{ changeToolbars() })
}
menu
@@ -289,7 +289,7 @@ makeThemeControl(control).grid(:sticky=>:news, :padx=>6, :ipadx=>6)
control.grid_rowconfigure(99, :weight=>1)
def changeToolbars
- foreachWidget($TOOLBARS,
+ foreachWidget($TOOLBARS,
proc{|w|
begin
w.compound($V[:COMPOUND])
@@ -350,7 +350,7 @@ nb, client, scales, combo, tree, others = makeNotebook()
#
def fillMenu(menu)
%w(above below left right flush).each{|dir|
- menu.add(:command, :label=>Tk.tk_call('string', 'totitle', 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)))
@@ -366,14 +366,14 @@ 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',
+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),
+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),
+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),
+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)
@@ -386,9 +386,9 @@ $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,
+ltext_f, ltext = scrolledWidget(l, TkText, true,
:width=>12, :height=>5, :wrap=>:none)
-# NOTE TO MAINTAINERS:
+# NOTE TO MAINTAINERS:
# The checkbuttons are -sticky ew / -expand x on purpose:
# it demonstrates one of the differences between TCheckbuttons
# and standard checkbuttons.
@@ -407,11 +407,11 @@ 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',
+rb1 = TkRadiobutton.new(r, :text=>'One',
:variable=>$V.ref(:CHOICE), :value=>1)
-rb2 = TkRadiobutton.new(r, :text=>'Two', :variable=>$V.ref(:CHOICE),
+rb2 = TkRadiobutton.new(r, :text=>'Two', :variable=>$V.ref(:CHOICE),
:value=>2, :underline=>1)
-rb3 = TkRadiobutton.new(r, :text=>'Three',
+rb3 = TkRadiobutton.new(r, :text=>'Three',
:variable=>$V.ref(:CHOICE), :value=>3)
btn = TkButton.new(r, :text=>'Button')
@@ -420,14 +420,14 @@ m = TkMenu.new(mb)
mb.menu(m)
$V[:rmbIndicatoron] = mb.indicatoron
m.add(:checkbutton, :label=>'Indicator?', #'
- :variable=>$V.ref(:rmbIndicatoron),
+ :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,
+rtext_f, rtext = scrolledWidget(r, TkText, false,
:width=>12, :height=>5, :wrap=>:none)
Tk.grid(cb, :sticky=>:ew)
@@ -450,9 +450,9 @@ 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",
+"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?",
@@ -493,8 +493,8 @@ if version?('0.6')
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
+ # 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)
@@ -609,10 +609,10 @@ 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,
+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,
+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)
@@ -639,20 +639,20 @@ 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,
+m_file.add(:command, :label=>'Open', :underline=>0,
:compound=>:left, :image=>$ICON['open'])
-m_file.add(:command, :label=>'Save', :underline=>0,
+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,
+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,
+ 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])
@@ -663,7 +663,7 @@ if Tk.windowingsystem != 'x11'
end
end
-m_file.add(:command, :label=>'Exit', :underline=>1,
+m_file.add(:command, :label=>'Exit', :underline=>1,
:command=>proc{Tk.event_generate(b_close, '<Invoke>')})
%w(One Two Three Four).each{|lbl|
@@ -672,7 +672,7 @@ m_file.add(:command, :label=>'Exit', :underline=>1,
# Add Theme menu.
#
-menu.add(:cascade, :label=>'Theme', :underline=>3,
+menu.add(:cascade, :label=>'Theme', :underline=>3,
:menu=>makeThemeMenu(menu))
setTheme($V[:THEME])
@@ -710,7 +710,7 @@ if version?('0.5')
tree.grid_rowconfigure(0, :weight=>1)
tree.grid_propagate(0)
- # Add initial tree node:
+ # Add initial tree node:
# Later nodes will be added in <<TreeviewOpen>> binding.
treeview.insert('', 0, :id=>'.', :text=>'Main Window', :open=>false,
:values=>[TkWinfo.classname('.')])
@@ -758,20 +758,20 @@ 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" ],
+ [ :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" ],
+ [ :scrollbarResizeDemo, "Scrollbar resize behavior...",
+ "Shows how Tile and standard scrollbars differ when they're sized too large" ],
- [ :trackFocus, "Track keyboard focus..." ,
+ [ :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,
+ b = Tk::Tile::Button.new(others, :text=>label,
:command=>proc{ self.__send__(demo_cmd) })
$Desc[b.path] = description
b.bindtags <<= showDescription
@@ -825,16 +825,16 @@ def trackFocus
$focus = TkToplevel.new(:title=>'Keyboard focus')
i = 0
[
- ["Focus widget:", :Widget],
- ["Class:", :WidgetClass],
- ["Next:", :WidgetNext],
- ["Grab:", :Grab],
+ ["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),
+ 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
}
@@ -857,7 +857,7 @@ def focusMonitor
$FocusInf[:Grab] = grab_wins = Tk.current_grabs
unless grab_wins.empty?
$FocusInf[:GrabStatus] = grab_wins[0].grab_status
- else
+ else
$FocusInf[:GrabStatus] = ''
end
@@ -869,13 +869,13 @@ end
#
$Widget = TkVariable.new
-TkBindTag::ALL.bind('Control-Shift-ButtonPress-1',
+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
+$states_list = %w(active disabled focus pressed selected
background indeterminate invalid default)
$states_btns = {}
$states = nil
@@ -893,17 +893,17 @@ def trackStates
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:',
+ l_lw = Tk::Tile::Label.new($states, :text=>'Widget:',
:anchor=>:e, :relief=>:groove)
- l_w = Tk::Tile::Label.new($states, :textvariable=>$Widget,
+ 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),
+ 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)
@@ -914,7 +914,7 @@ def trackStates
f_cmd = Tk::Tile::Frame.new($states)
Tk.grid('x', f_cmd, :sticky=>:nse)
- b_close = Tk::Tile::Button.new(f_cmd, :text=>'Close',
+ 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)
diff --git a/ext/tk/sample/tkextlib/tile/themes/kroc.rb b/ext/tk/sample/tkextlib/tile/themes/kroc.rb
index 72a7c6901d..27006d847f 100644
--- a/ext/tk/sample/tkextlib/tile/themes/kroc.rb
+++ b/ext/tk/sample/tkextlib/tile/themes/kroc.rb
@@ -1,5 +1,5 @@
#
-# kroc.rb
+# kroc.rb
#
# based on:
# >> kroc.tcl - Copyright (C) 2004 David Zolli <kroc@kroc.tk>
@@ -15,30 +15,30 @@ else
end
def kroc_rb_settings
- # Tk::Tile::Style.default(TkRoot, :background=>'#FCB64F',
+ # Tk::Tile::Style.default(TkRoot, :background=>'#FCB64F',
# :troughcolor=>'#F8C278', :borderwidth=>1)
# or
- # Tk::Tile::Style.default(Tk.root, :background=>'#FCB64F',
+ # Tk::Tile::Style.default(Tk.root, :background=>'#FCB64F',
# :troughcolor=>'#F8C278', :borderwidth=>1)
# or
- # Tk::Tile::Style.default('.', :background=>'#FCB64F',
+ # Tk::Tile::Style.default('.', :background=>'#FCB64F',
# :troughcolor=>'#F8C278', :borderwidth=>1)
# or
- # Tk::Tile::Style.default(nil, :background=>'#FCB64F',
+ # Tk::Tile::Style.default(nil, :background=>'#FCB64F',
# :troughcolor=>'#F8C278', :borderwidth=>1)
# or
- Tk::Tile::Style.default(:background=>'#FCB64F', :troughcolor=>'#F8C278',
+ Tk::Tile::Style.default(:background=>'#FCB64F', :troughcolor=>'#F8C278',
:borderwidth=>1)
- # Tk::Tile::Style.default(TkRoot, :font=>Tk::Tile::Font::Default,
+ # Tk::Tile::Style.default(TkRoot, :font=>Tk::Tile::Font::Default,
# :borderwidth=>1)
# or
- # Tk::Tile::Style.default(Tk.root, :font=>Tk::Tile::Font::Default,
+ # Tk::Tile::Style.default(Tk.root, :font=>Tk::Tile::Font::Default,
# :borderwidth=>1)
# or
- # Tk::Tile::Style.default('.', :font=>Tk::Tile::Font::Default,
+ # Tk::Tile::Style.default('.', :font=>Tk::Tile::Font::Default,
# :borderwidth=>1)
# or
- # Tk::Tile::Style.default(nil, :font=>Tk::Tile::Font::Default,
+ # Tk::Tile::Style.default(nil, :font=>Tk::Tile::Font::Default,
# :borderwidth=>1)
# or
Tk::Tile::Style.default(:font=>Tk::Tile::Font::Default, :borderwidth=>1)
@@ -57,37 +57,37 @@ def kroc_rb_settings
# 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,
+ # 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'],
+ # 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'],
+ # 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),
+ # 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.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),
+ # 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.leftarrow', {:side=>:left},
+ 'Scrollbar.rightarrow', {:side=>:right},
+ 'Scrollbar.leftarrow', {:side=>:right},
'Scrollbar.thumb', {:side=>:left, :expand=>true}
]}
])
@@ -96,15 +96,15 @@ def kroc_rb_settings
# Elements:
#
if Tk::Tile::TILE_SPEC_VERSION_ID >= 8
- Tk::Tile::Style.element_create('Button.button',
- :image,
+ Tk::Tile::Style.element_create('Button.button',
+ :image,
[ $images['button-n'],
- :pressed, $images['button-p'],
- :active, $images['button-h'],
+ :pressed, $images['button-p'],
+ :active, $images['button-h'],
], :border=>3, :sticky=>:ew)
- Tk::Tile::Style.element_create('Checkbutton.indicator',
- :image,
+ Tk::Tile::Style.element_create('Checkbutton.indicator',
+ :image,
[ $images['check-nu'],
[:pressed, :selected],$images['check-nc'],
:pressed, $images['check-nu'],
@@ -113,8 +113,8 @@ def kroc_rb_settings
:selected, $images['check-nc'],
], :sticky=>:w)
- Tk::Tile::Style.element_create('Radiobutton.indicator',
- :image,
+ Tk::Tile::Style.element_create('Radiobutton.indicator',
+ :image,
[ $images['radio-nu'],
[:pressed,:selected],$images['radio-nc'],
:pressed, $images['radio-nu'],
@@ -124,14 +124,14 @@ def kroc_rb_settings
], :sticky=>:w)
elsif TkPackage.vcompare(Tk::Tile.package_version, '0.5') >= 0
- Tk::Tile::Style.element_create('Button.button',
+ Tk::Tile::Style.element_create('Button.button',
:image, $images['button-n'],
:map=>[
- :pressed, $images['button-p'],
- :active, $images['button-h'],
+ :pressed, $images['button-p'],
+ :active, $images['button-h'],
], :border=>3, :sticky=>:ew)
- Tk::Tile::Style.element_create('Checkbutton.indicator',
+ Tk::Tile::Style.element_create('Checkbutton.indicator',
:image, $images['check-nu'],
:map=>[
[:pressed, :selected],$images['check-nc'],
@@ -141,7 +141,7 @@ def kroc_rb_settings
:selected, $images['check-nc'],
], :sticky=>:w)
- Tk::Tile::Style.element_create('Radiobutton.indicator',
+ Tk::Tile::Style.element_create('Radiobutton.indicator',
:image, $images['radio-nu'],
:map=>[
[:pressed, :selected],$images['radio-nc'],
@@ -152,14 +152,14 @@ def kroc_rb_settings
], :sticky=>:w)
else # tile 0.4 or earlier
- Tk::Tile::Style.element_create('Button.button', :pixmap,
+ Tk::Tile::Style.element_create('Button.button', :pixmap,
:images=>[
- :pressed, $images['button-p'],
- :active, $images['button-h'],
+ :pressed, $images['button-p'],
+ :active, $images['button-h'],
'', $images['button-n']
], :border=>3, :tiling=>:tile)
- Tk::Tile::Style.element_create('Checkbutton.indicator', :pixmap,
+ Tk::Tile::Style.element_create('Checkbutton.indicator', :pixmap,
:images=>[
[:pressed, :selected],$images['check-nc'],
:pressed, $images['check-nu'],
@@ -169,7 +169,7 @@ def kroc_rb_settings
'', $images['check-nu'],
], :tiling=>:fixed)
- Tk::Tile::Style.element_create('Radiobutton.indicator', :pixmap,
+ Tk::Tile::Style.element_create('Radiobutton.indicator', :pixmap,
:images=>[
[:pressed, :selected],$images['radio-nc'],
:pressed, $images['radio-nu'],
@@ -184,7 +184,7 @@ def kroc_rb_settings
#
# Settings:
#
- # Tk::Tile::Style.layout(Tk::Tile::TButton,
+ # Tk::Tile::Style.layout(Tk::Tile::TButton,
Tk::Tile::Style.layout('TButton', [
'Button.button', {:children=>[
'Button.focus', {:children=>[
@@ -195,12 +195,12 @@ def kroc_rb_settings
]}
])
- # Tk::Tile::Style.layout(Tk::Tile::TCheckbutton,
+ # 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.indicator', {:side=>:left},
'Checkbutton.focus', {:side=>:left, :children=>[
'Checkbutton.label'
]}
@@ -208,12 +208,12 @@ def kroc_rb_settings
]}
])
- # Tk::Tile::Style.layout(Tk::Tile::TRadiobutton,
+ # 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.indicator', {:side=>:left},
'Radiobutton.focus', {:expand=>true, :sticky=>:w, :children=>[
'Radiobutton.label', {:side=>:right, :expand=>true}
]}
@@ -222,5 +222,5 @@ def kroc_rb_settings
])
end
-Tk::Tile::Style.theme_create('kroc-rb', :parent=>'alt',
+Tk::Tile::Style.theme_create('kroc-rb', :parent=>'alt',
:settings=>proc{ kroc_rb_settings() })
diff --git a/ext/tk/sample/tkextlib/tkHTML/hv.rb b/ext/tk/sample/tkextlib/tkHTML/hv.rb
index 920eb15f5a..a4d78ea5b1 100644
--- a/ext/tk/sample/tkextlib/tkHTML/hv.rb
+++ b/ext/tk/sample/tkextlib/tkHTML/hv.rb
@@ -5,7 +5,7 @@
#
# 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'
@@ -51,11 +51,11 @@ show_img = TkVariable.new(1)
# 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(' ')
-}
+ [ ((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
@@ -126,7 +126,7 @@ script_cmd = proc{|*args|
# This routine is called for every <APPLET> markup
#
-applet_cmd = proc{|w, arglist|
+applet_cmd = proc{|w, arglist|
# puts "AppletCmd: w=#{w} arglist=#{arglist}"
TkLabel.new(w, :text=>"The Applet #{w}", :bd=>2, :relief=>raised)
}
@@ -134,12 +134,12 @@ applet_cmd = proc{|w, arglist|
#
# 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,
+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)
@@ -166,7 +166,7 @@ read_file = proc{|name|
rescue
ret = nil
fp = nil
- Tk.messageBox(:icon=>'error', :message=>"fail to open '#{name}'",
+ Tk.messageBox(:icon=>'error', :message=>"fail to open '#{name}'",
:type=>:ok)
ensure
fp.close if fp
@@ -221,7 +221,7 @@ html.clipping_window.bind('1', href_binding, '%x %y')
html.clipping_window.bind('B1-Motion', proc{|w, x, y|
w.selection_set(priv['mark'], "@#{x},#{y}")
TkClipboard.clear
- # avoid tkhtml0.0 errors
+ # avoid tkhtml0.0 errors
# anyone can fix this for tkhtml0.0
begin
TkClipboard.append(TkSelection.get)
@@ -235,7 +235,7 @@ html.clipping_window.bind('B1-Motion', proc{|w, x, y|
last_dir = Dir.pwd
sel_load = proc{
filetypes = [
- ['Html Files', ['.html', '.htm']],
+ ['Html Files', ['.html', '.htm']],
['All Files', '*']
]
@@ -268,15 +268,15 @@ Tk::HTML_Widget::ClippingWindow.bind('Motion', proc{|w, x, y|
# Setup menu
#
menu_spec = [
- [['File', 0],
- ['Open', sel_load, 0],
- ['Refresh', refresh, 0],
+ [['File', 0],
+ ['Open', sel_load, 0],
+ ['Refresh', refresh, 0],
'---',
- ['Exit', proc{exit}, 1]],
+ ['Exit', proc{exit}, 1]],
- [['View', 0],
- ['Underline Hyperlinks', ul_hyper],
- ['Show Table Structure', show_tbl],
+ [['View', 0],
+ ['Underline Hyperlinks', ul_hyper],
+ ['Show Table Structure', show_tbl],
['Show Images', show_img]]
]
@@ -285,7 +285,7 @@ mbar = Tk.root.add_menubar(menu_spec)
#
# Setup trace
#
-ul_hyper.trace('w', proc{
+ul_hyper.trace('w', proc{
html[:underlinehyperlinks] = ul_hyper.value
refresh.call
})
diff --git a/ext/tk/sample/tkextlib/tkHTML/ss.rb b/ext/tk/sample/tkextlib/tkHTML/ss.rb
index 45d4d87d69..1c13d7ac34 100644
--- a/ext/tk/sample/tkextlib/tkHTML/ss.rb
+++ b/ext/tk/sample/tkextlib/tkHTML/ss.rb
@@ -2,7 +2,7 @@
#
# This script implements the "ss" application. "ss" implements
# a presentation slide-show based on HTML slides.
-#
+#
require 'tk'
require 'tkextlib/tkHTML'
@@ -45,18 +45,18 @@ EOD
@key_block = false
- Tk::HTML_Widget::ClippingWindow.bind('1',
- proc{|w, ksym| key_press(w, ksym)},
+ 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)},
+ 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)},
+ 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)},
+ Tk::HTML_Widget::ClippingWindow.bind('KeyPress',
+ proc{|w, ksym| key_press(w, ksym)},
'%W %K')
############################################
@@ -64,37 +64,37 @@ EOD
# 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],
+ [['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,
+ @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|
+ },
+ :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)})
@@ -127,9 +127,9 @@ EOD
# 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 =~ /fixed/)? 'courier': 'charter'),
+ (12 * (1.2**(size.to_f - 4.0))).to_i,
+ ((attrs =~ /italic/)? 'italic': 'roman'),
((attrs =~ /bold/)? 'bold': 'normal') ].join(' ')
end
@@ -139,9 +139,9 @@ EOD
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 =~ /fixed/)? 'courier': 'charter'),
+ (baseFontSize * (1.2**(size.to_f - 4.0))).to_i,
+ ((attrs =~ /italic/)? 'italic': 'roman'),
((attrs =~ /bold/)? 'bold': 'normal') ].join(' ')
end
@@ -244,7 +244,7 @@ EOD
#
def sel_load
filetypes = [
- ['Html Files', ['.html', '.htm']],
+ ['Html Files', ['.html', '.htm']],
['All Files', '*']
]
@@ -280,7 +280,7 @@ EOD
rescue
ret = nil
fp = nil
- Tk.messageBox(:icon=>'error', :message=>"fail to open '#{name}'",
+ Tk.messageBox(:icon=>'error', :message=>"fail to open '#{name}'",
:type=>:ok)
ensure
fp.close if fp
@@ -371,32 +371,32 @@ EOD
width = @root.winfo_screenwidth
height = @root.winfo_screenheight
- @fswin = TkToplevel.new(:overrideredirect=>true,
+ @fswin = TkToplevel.new(:overrideredirect=>true,
:geometry=>"#{width}x#{height}+0+0")
- @html_fs = Tk::HTML_Widget.new(@fswin, :padx=>5, :pady=>9,
+ @html_fs = Tk::HTML_Widget.new(@fswin, :padx=>5, :pady=>9,
:formcommand=>proc{|*args|
form_cmd(*args)
},
- :imagecommand=>proc{|*args|
+ :imagecommand=>proc{|*args|
image_cmd(0, *args)
- },
+ },
:scriptcommand=>proc{|*args|
script_cmd(*args)
- },
+ },
:appletcommand=>proc{|*args|
applet_cmd(*args)
- },
- :hyperlinkcommand=>proc{|*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,
+ },
+ :bg=>'white', :tablerelief=>:raised,
:cursor=>:tcross) {
pack(:fill=>:both, :expand=>true)
token_handler('meta', proc{|*args| meta(self, *args)})
diff --git a/ext/tk/sample/tkextlib/tkimg/demo.rb b/ext/tk/sample/tkextlib/tkimg/demo.rb
index d453e8ee9d..a0c4d1b64f 100644
--- a/ext/tk/sample/tkextlib/tkimg/demo.rb
+++ b/ext/tk/sample/tkextlib/tkimg/demo.rb
@@ -2,7 +2,7 @@
#
# Tk::Img demo
#
-# -- This script is based on demo.tcl of Tcl/Tk's 'Img' extention.
+# -- This script is based on demo.tcl of Tcl/Tk's 'Img' extention.
# Image data in this script is those of demo.tcl.
# Please read 'license_terms_of_Img_extension' file.
#
@@ -85,7 +85,7 @@ class TkImg_demo
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}",
+ w.configure(:text=>"error displaying animated gif:\n#{e.message}",
:image=>'', :relief=>:ridge)
end
w.pack
@@ -98,15 +98,15 @@ class TkImg_demo
TkLabel.new(@typeFrame[fmt], :text=>"#{fmt} : ").pack(:side=>:left)
end
begin
- f = TkFrame.new(@typeFrame[fmt],
+ 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,
+ 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}",
+ TkMessage.new(f, :text=>"error displaying #{type} image: #{e.message}",
:aspect=>250).pack
end
Tk.update
diff --git a/ext/tk/sample/tkextlib/tktable/basic.rb b/ext/tk/sample/tkextlib/tktable/basic.rb
index dddbb776dc..0d2d48893a 100644
--- a/ext/tk/sample/tkextlib/tktable/basic.rb
+++ b/ext/tk/sample/tkextlib/tktable/basic.rb
@@ -3,7 +3,7 @@
## basic.rb
##
## This demo shows the basic use of the table widget
-##
+##
## ( based on 'basic.tcl' included source archive of tktable extension )
##
require 'tk'
@@ -22,19 +22,19 @@ cols = 8
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,
+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)
diff --git a/ext/tk/sample/tkextlib/tktable/buttons.rb b/ext/tk/sample/tkextlib/tktable/buttons.rb
index e35c137a28..b21e8673c2 100644
--- a/ext/tk/sample/tkextlib/tktable/buttons.rb
+++ b/ext/tk/sample/tkextlib/tktable/buttons.rb
@@ -14,11 +14,11 @@ 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,
+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)
@@ -67,7 +67,7 @@ table.bind('1', proc{|w, x, y|
0.step(cols){|j|
if i == 0
tab[-1,j] = j
- end
+ end
tab[i,j] = "OFF"
table.tag_cell('OFF', "#{i},#{j}")
}
diff --git a/ext/tk/sample/tkextlib/tktable/command.rb b/ext/tk/sample/tkextlib/tktable/command.rb
index e697ccf3bf..bf36159ccc 100644
--- a/ext/tk/sample/tkextlib/tktable/command.rb
+++ b/ext/tk/sample/tkextlib/tktable/command.rb
@@ -27,7 +27,7 @@ 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,
+table = Tk::TkTable.new(:rows=>rows, :cols=>cols,
:command=>[proc{|mode, cell, val|
if (mode == :w)
data[cell] = val
@@ -38,10 +38,10 @@ table = Tk::TkTable.new(:rows=>rows, :cols=>cols,
'' # not exist
end
end
- }, '%i %C %s'],
- :width=>6, :height=>6,
- :titlerows=>1, :titlecols=>1,
- :roworigin=>-1, :colorigin=>-1,
+ }, '%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)
@@ -50,20 +50,20 @@ table = Tk::TkTable.new(:rows=>rows, :cols=>cols,
:coltagcommand=>proc{|col|
col = Integer(col)
(col>0 && col%2 == 1)? 'OddCol': ''
- },
- :selectmode=>:extended, :flashmode=>true,
+ },
+ :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|
+ }, '%W %S'],
+ :validate=>true,
+ :validatecommand=>proc{|e|
ent_var.value = e.new_value; true
})
=begin
:validatecommand=>[
- proc{|s|
+ proc{|s|
ent_var.value = s; true
}, '%S'])
=end
diff --git a/ext/tk/sample/tkextlib/tktable/debug.rb b/ext/tk/sample/tkextlib/tktable/debug.rb
index 016d5b353e..d5cd5e49ba 100644
--- a/ext/tk/sample/tkextlib/tktable/debug.rb
+++ b/ext/tk/sample/tkextlib/tktable/debug.rb
@@ -23,15 +23,15 @@ cols = 20
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,
+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,
+ },
+ :selectmode=>:extended, :flashmode=>true,
:rowstretch=>:unset, :colstretch=>:unset,
:selecttitles=>false, :drawmode=>:single)
@@ -67,8 +67,8 @@ 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",
+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
diff --git a/ext/tk/sample/tkextlib/tktable/dynarows.rb b/ext/tk/sample/tkextlib/tktable/dynarows.rb
index cc72a021cf..d083e26559 100644
--- a/ext/tk/sample/tkextlib/tktable/dynarows.rb
+++ b/ext/tk/sample/tkextlib/tktable/dynarows.rb
@@ -5,7 +5,7 @@
## 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'
@@ -24,7 +24,7 @@ def table_validate(w, idx)
begin
time = Tk.tk_call('clock', 'scan', val)
date = []
- Tk.tk_call('clock', 'format', time,
+ Tk.tk_call('clock', 'format', time,
:format=>'%m %d %Y').split(' ').each{|item|
date << item.sub(/^\s*0*/,'')
}
@@ -54,12 +54,12 @@ 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,
+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)},
+ proc{|w,s| table_validate(w, s)},
'%W %s'
])
table.set([0,1], 'Begin', [0,2], 'End', [1,0], '*')
diff --git a/ext/tk/sample/tkextlib/tktable/maxsize.rb b/ext/tk/sample/tkextlib/tktable/maxsize.rb
index 74e136c49c..aff68ff377 100644
--- a/ext/tk/sample/tkextlib/tktable/maxsize.rb
+++ b/ext/tk/sample/tkextlib/tktable/maxsize.rb
@@ -4,7 +4,7 @@
##
## 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'
@@ -23,15 +23,15 @@ cols = 10
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,
+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,
+ },
+ :selectmode=>:extended,
+ :colstretch=>:unset, :rowstretch=>:unset,
:selecttitles=>false, :drawmode=>:slow)
sx = table.xscrollbar(TkScrollbar.new)
diff --git a/ext/tk/sample/tkextlib/tktable/spreadsheet.rb b/ext/tk/sample/tkextlib/tktable/spreadsheet.rb
index 2953b2e597..9da896f5a7 100644
--- a/ext/tk/sample/tkextlib/tktable/spreadsheet.rb
+++ b/ext/tk/sample/tkextlib/tktable/spreadsheet.rb
@@ -4,7 +4,7 @@
##
## 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'
@@ -67,15 +67,15 @@ 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,
+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,
+ :flashmode=>true, :selectmode=>:extended,
+ :colstretch=>:unset, :rowstretch=>:unset,
:browsecommand=>proc{|e| cur_var.value = e.new_index})
-page.trace(:w, proc{|var, elem, op|
+page.trace(:w, proc{|var, elem, op|
changepage(table_list, table, entry, color, var, elem, op)
})
@@ -128,7 +128,7 @@ 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',
+m_file.add(:command, :label=>'Fill Array',
:command=>proc{ fill_table(table_list, page.value) })
m_file.add(:command, :label=>'Quit', :command=>proc{exit})
diff --git a/ext/tk/sample/tkextlib/tktable/tcllogo.gif b/ext/tk/sample/tkextlib/tktable/tcllogo.gif
index 4603d4ff41..4603d4ff41 100644..100755
--- a/ext/tk/sample/tkextlib/tktable/tcllogo.gif
+++ 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
index 98e9c3855a..e5d3f11d84 100644
--- a/ext/tk/sample/tkextlib/tktable/valid.rb
+++ b/ext/tk/sample/tkextlib/tktable/valid.rb
@@ -4,7 +4,7 @@
##
## 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'
@@ -53,12 +53,12 @@ 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,
+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,
+ :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)
diff --git a/ext/tk/sample/tkextlib/treectrl/bitmaps.rb b/ext/tk/sample/tkextlib/treectrl/bitmaps.rb
index 0d8b37b81e..745e6a2e5b 100644
--- a/ext/tk/sample/tkextlib/treectrl/bitmaps.rb
+++ b/ext/tk/sample/tkextlib/treectrl/bitmaps.rb
@@ -4,12 +4,12 @@
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',
+ 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',
+ t.configure(:showroot=>false, :showbuttons=>false, :showlines=>false,
+ :selectmode=>:browse, :orient=>:horizontal, :wrap=>'5 items',
:showheader=>false)
end
@@ -19,15 +19,15 @@ def demoBitmaps(t)
t.column_configure(0, :itembackground=>['gray90', []])
end
- t.element_create('elemTxt', :text,
+ t.element_create('elemTxt', :text,
:fill=>[@SystemHighlightText, ['selected', 'focus']])
- t.element_create('elemSelTxt', :rect, :showfocus=>true,
+ t.element_create('elemSelTxt', :rect, :showfocus=>true,
:fill=>[@SystemHighlight, ['selected', 'focus']])
- t.element_create('elemSelBmp', :rect, :outlinewidth=>4,
+ t.element_create('elemSelBmp', :rect, :outlinewidth=>4,
:outline=>[@SystemHighlight, ['selected', 'focus']])
- t.element_create('elemBmp', :bitmap,
- :foreground=>[@SystemHighlight, ['selected', 'focus']],
- :background=>'linen',
+ t.element_create('elemBmp', :bitmap,
+ :foreground=>[@SystemHighlight, ['selected', 'focus']],
+ :background=>'linen',
:bitmap=>['question' ['selected']])
s = t.style_create('STYLE', :orient=>:vertical)
@@ -42,7 +42,7 @@ def demoBitmaps(t)
t.defaultstyle = [s]
end
- bitmap_names = %w(error gray75 gray50 gray25 gray12
+ bitmap_names = %w(error gray75 gray50 gray25 gray12
hourglass info questhead question warning)
bitmap_names.each{|name|
@@ -60,15 +60,15 @@ def demoBitmaps(t)
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', ''],
+ t.item_element_configure(i, 0, 'elemBmp', :bitmap=>name,
+ :foreground=>['brown', ''],
:background=>['', ''])
else
- t.item_element_configure(i, 0, 'elemBmp', :bitmap=>name,
+ t.item_element_configure(i, 0, 'elemBmp', :bitmap=>name,
:foreground=>[
- @SystemHighlight, ['selected', 'focus'],
+ @SystemHighlight, ['selected', 'focus'],
'brown', []
- ],
+ ],
:background=>['', []])
end
t.item_lastchild(:root, i)
diff --git a/ext/tk/sample/tkextlib/treectrl/demo.rb b/ext/tk/sample/tkextlib/treectrl/demo.rb
index 564a005bdc..eed95d0e1c 100644
--- a/ext/tk/sample/tkextlib/treectrl/demo.rb
+++ b/ext/tk/sample/tkextlib/treectrl/demo.rb
@@ -76,7 +76,7 @@ class TkTreeCtrl_demo
####################
- @tree2.bind('ButtonPress-3',
+ @tree2.bind('ButtonPress-3',
proc{|w, x, y, rootx, rooty|
show_list_popup(w, x, y, rootx, rooty)
}, '%W %x %y %X %Y')
@@ -94,7 +94,7 @@ class TkTreeCtrl_demo
####################
- @tree1.notify_bind(@tree1, 'Selection',
+ @tree1.notify_bind(@tree1, 'Selection',
proc{|c, t|
if c == 1
item = t.selection_get[0]
@@ -102,10 +102,10 @@ class TkTreeCtrl_demo
end
}, '%c %T')
- # When one item is selected in the demo list, display the styles in
+ # 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',
+ @tree2.notify_bind('DontDelete', 'Selection',
proc{|c, t|
display_styles_in_item(t.selection_get[0]) if c == 1
}, '%c %T')
@@ -156,13 +156,15 @@ class TkTreeCtrl_demo
@src_top = TkToplevel.new
f = TkFrame.new(@src_top, :borderwidth=>0)
case @thisPlatform
+ when 'macintosh', 'macos'
+ font = TkFont.new(['Geneva', 9])
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'),
+ @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))
@@ -196,6 +198,10 @@ class TkTreeCtrl_demo
def tree_plus_scrollbars_in_a_frame(parent, h, v)
f = TkFrame.new(parent, :borderwidth=>1, :relief=>:sunken)
case @thisPlatform
+ when 'macintosh'
+ font = TkFont.new(['Geneva', 9])
+ when 'macos'
+ font = TkFont.new(['Lucida Grande', 11])
when 'unix'
font = TkFont.new(['Helvetica', -12])
else
@@ -204,23 +210,23 @@ class TkTreeCtrl_demo
font = TkFont.new(['MS Sans', 8])
end
- tree = Tk::TreeCtrl.new(f, :highlightthickness=>0,
+ 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,
+ h_scr = TkScrollbar.new(f, :orient=>:horizontal,
:command=>proc{|*args| tree.xview(*args)})
- tree.notify_bind(h_scr, 'Scroll-x',
+ 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,
+ v_scr = TkScrollbar.new(f, :orient=>:vertical,
:command=>proc{|*args| tree.yview(*args)})
- tree.notify_bind(v_scr, 'Scroll-y',
+ 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
@@ -238,7 +244,7 @@ class TkTreeCtrl_demo
Tk.root.title('Tk::TreeCtrl Demo')
case @thisPlatform
- when 'macosx'
+ when 'macintosh', 'macosx'
Tk.root.geometry('+40+40')
else
Tk.root.geometry('+0+30')
@@ -249,13 +255,13 @@ class TkTreeCtrl_demo
# Tree + scrollbar: demos
f1, @tree1 = tree_plus_scrollbars_in_a_frame(nil, false, true)
- @tree1.configure(:showbuttons=>false, :showlines=>:false,
+ @tree1.configure(:showbuttons=>false, :showlines=>:false,
:showroot=>false, :height=>100)
if $HasColumnCreate
- @tree1.column_create(:text=>'List of Demos',
+ @tree1.column_create(:text=>'List of Demos',
:expand=>true, :button=>false)
else
- @tree1.column_configure(0, :text=>'List of Demos',
+ @tree1.column_configure(0, :text=>'List of Demos',
:expand=>true, :button=>false)
end
@@ -263,10 +269,10 @@ class TkTreeCtrl_demo
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',
+ @tree4.column_create(:text=>'Elements and Styles',
:expand=>true, :button=>false)
else
- @tree4.column_configure(0, :text=>'Elements and Styles',
+ @tree4.column_configure(0, :text=>'Elements and Styles',
:expand=>true, :button=>false)
end
@@ -274,10 +280,10 @@ class TkTreeCtrl_demo
f3, @tree3 = tree_plus_scrollbars_in_a_frame(nil, false, true)
@tree3.configure(:showroot=>false)
if $HasColumnCreate
- @tree3.column_create(:text=>'Styles in Item',
+ @tree3.column_create(:text=>'Styles in Item',
:expand=>true, :button=>false)
else
- @tree3.column_configure(0, :text=>'Styles in Item',
+ @tree3.column_configure(0, :text=>'Styles in Item',
:expand=>true, :button=>false)
end
@@ -290,7 +296,7 @@ class TkTreeCtrl_demo
# 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,
+ @tree2.debug_configure(:enable=>false, :display=>true,
:erasecolor=>'pink', :displaydelay=>30)
# Give it a big border to debug drawing
@@ -343,7 +349,7 @@ class TkTreeCtrl_demo
@popup[:show] = Hash.new{|h, k| h[k] = TkVariable.new}
menuspec = [
- [ 'Collapse', [], nil, '', {:menu_config=>{:tearoff=>false}} ],
+ [ 'Collapse', [], nil, '', {:menu_config=>{:tearoff=>false}} ],
[ 'Expand', [], nil, '', {:menu_config=>{:tearoff=>false}} ]
]
@@ -351,61 +357,61 @@ class TkTreeCtrl_demo
# if $Version_1_1_OrLater
if @has_bgimg
menuspec << \
- [ 'Background Image',
+ [ 'Background Image',
[
- [ 'none', [@popup[:bgimg], 'none'], nil, '',
- {:command=>proc{@tree2.backgroundimage = ''}} ],
- [ 'sky', [@popup[:bgimg], 'sky'], nil, '',
+ [ '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',
+ [ 'Background Mode',
%w(column index row visindex).collect{|val|
- [ val, [@popup[:bgmode], val] , nil, '',
+ [ val, [@popup[:bgmode], val] , nil, '',
{:command=>proc{@tree2.backgroundmode = @popup[:bgmode].value}} ]
- },
+ },
nil, '', {:menu_config=>{:tearoff=>false}}
],
- [ 'Debug',
+ [ 'Debug',
[
- [ 'Data', @popup[:debug][:data], nil, '',
+ [ 'Data', @popup[:debug][:data], nil, '',
{:command=>proc{
@tree2.debug_configure(:data=>@popup[:debug][:data].value)
}
- } ],
- [ 'Display', @popup[:debug][:display], nil, '',
+ } ],
+ [ 'Display', @popup[:debug][:display], nil, '',
{:command=>proc{
@tree2.debug_configure(:display=>@popup[:debug][:display].value)
}
- } ],
- [ 'Enable', @popup[:debug][:enable], nil, '',
+ } ],
+ [ 'Enable', @popup[:debug][:enable], nil, '',
{:command=>proc{
@tree2.debug_configure(:enable=>@popup[:debug][:enable].value)
}
} ]
- ],
+ ],
nil, '', {:menu_config=>{:tearoff=>false}}
],
- [ 'Buffering',
+ [ 'Buffering',
[
- [ 'none', [@popup[:doublebuffer], 'none'], nil, '',
+ [ 'none', [@popup[:doublebuffer], 'none'], nil, '',
{:command=>proc{
@tree2.doublebuffer = @popup[:doublebuffer].value
}
- } ],
- [ 'item', [@popup[:doublebuffer], 'item'], nil, '',
+ } ],
+ [ 'item', [@popup[:doublebuffer], 'item'], nil, '',
{:command=>proc{
@tree2.doublebuffer = @popup[:doublebuffer].value
}
- } ],
- [ 'window', [@popup[:doublebuffer], 'window'], nil, '',
+ } ],
+ [ 'window', [@popup[:doublebuffer], 'window'], nil, '',
{:command=>proc{
@tree2.doublebuffer = @popup[:doublebuffer].value
}
@@ -414,62 +420,62 @@ class TkTreeCtrl_demo
nil, '', {:menu_config=>{:tearoff=>false}}
],
- [ 'Line style',
+ [ 'Line style',
[
- [ 'dot', [@popup[:linestyle], 'dot'], nil, '',
- {:command=>proc{@tree2.linestyle = @popup[:linestyle].value}} ],
- [ 'solid', [@popup[:linestyle], 'solid'], nil, '',
+ [ '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',
+ [ 'Orient',
[
- [ 'Horizontal', [@popup[:orient], 'horizontal'], nil, '',
- {:command=>proc{@tree2.orient = @popup[:orient].value}} ],
- [ 'Vertical', [@popup[:orient], 'vertical'], nil, '',
+ [ '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',
+ [ 'Selectmode',
%w(list browse extended multiple single).collect{|val|
- [ val, [@popup[:selectmode], val] , nil, '',
+ [ val, [@popup[:selectmode], val] , nil, '',
{:command=>proc{@tree2.selectmode = @popup[:selectmode].value}} ]
- },
+ },
nil, '', {:menu_config=>{:tearoff=>false}}
],
- [ 'Show',
+ [ 'Show',
[
- [ 'Buttons', @popup[:show][:buttons], nil, '',
+ [ 'Buttons', @popup[:show][:buttons], nil, '',
{:command=>proc{
@tree2.showbuttons = @popup[:show][:buttons].value
}
- } ],
- [ 'Header', @popup[:show][:header], nil, '',
+ } ],
+ [ 'Header', @popup[:show][:header], nil, '',
{:command=>proc{
@tree2.showheader = @popup[:show][:header].value
}
- } ],
- [ 'Lines', @popup[:show][:lines], nil, '',
+ } ],
+ [ 'Lines', @popup[:show][:lines], nil, '',
{:command=>proc{
@tree2.showlines = @popup[:show][:lines].value
}
- } ],
- [ 'Root', @popup[:show][:root], nil, '',
+ } ],
+ [ 'Root', @popup[:show][:root], nil, '',
{:command=>proc{
@tree2.showroot = @popup[:show][:root].value
}
- } ],
- [ 'Root Button', @popup[:show][:rootbutton], nil, '',
+ } ],
+ [ 'Root Button', @popup[:show][:rootbutton], nil, '',
{:command=>proc{
@tree2.showrootbutton = @popup[:show][:rootbutton].value
}
} ]
- ],
+ ],
nil, '', {:menu_config=>{:tearoff=>false}}
],
@@ -509,14 +515,14 @@ class TkTreeCtrl_demo
if id[0] == 'item'
item = id[1]
if $Version_1_1_OrLater
- m.add_command(:label=>"Item #{item}",
+ m.add_command(:label=>"Item #{item}",
:command=>proc{w.item_collapse(item)})
- m.add_command(:label=>"Item #{item} (recurse)",
+ m.add_command(:label=>"Item #{item} (recurse)",
:command=>proc{w.item_collapse_recurse(item)})
else
- m.add_command(:label=>"Item #{item}",
+ m.add_command(:label=>"Item #{item}",
:command=>proc{w.collapse(item)})
- m.add_command(:label=>"Item #{item} (recurse)",
+ m.add_command(:label=>"Item #{item} (recurse)",
:command=>proc{w.collapse_recurse(item)})
end
end
@@ -533,14 +539,14 @@ class TkTreeCtrl_demo
if id[0] == 'item'
item = id[1]
if $Version_1_1_OrLater
- m.add_command(:label=>"Item #{item}",
+ m.add_command(:label=>"Item #{item}",
:command=>proc{w.item_expand(item)})
- m.add_command(:label=>"Item #{item} (recurse)",
+ m.add_command(:label=>"Item #{item} (recurse)",
:command=>proc{w.item_expand_recurse(item)})
else
- m.add_command(:label=>"Item #{item}",
+ m.add_command(:label=>"Item #{item}",
:command=>proc{w.expand(item)})
- m.add_command(:label=>"Item #{item} (recurse)",
+ m.add_command(:label=>"Item #{item} (recurse)",
:command=>proc{w.expand_recurse(item)})
end
end
@@ -572,8 +578,8 @@ class TkTreeCtrl_demo
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}]",
+ m.add_checkbutton(:variable=>@popup[:visible][i],
+ :label=>"Column #{i} \"#{txt}\" [#{img_name}]",
:command=>proc{w.column_configure(i, :visible=>@popup[:visible][i].value)})
}
@@ -590,90 +596,90 @@ class TkTreeCtrl_demo
@popup[:justify] = TkVariable.new
menuspec = [
- [ 'Arrow',
+ [ 'Arrow',
[
- [ 'None', [@popup[:arrow], 'none'], nil, '',
+ [ 'None', [@popup[:arrow], 'none'], nil, '',
{:command=>proc{
@tree2.column_configure(@popup[:column].value, :arrow=>:none)
}
} ],
- [ 'Up', [@popup[:arrow], 'up'], nil, '',
+ [ 'Up', [@popup[:arrow], 'up'], nil, '',
{:command=>proc{
@tree2.column_configure(@popup[:column].value, :arrow=>:up)
}
} ],
- [ 'Down', [@popup[:arrow], 'down'], nil, '',
+ [ 'Down', [@popup[:arrow], 'down'], nil, '',
{:command=>proc{
@tree2.column_configure(@popup[:column].value, :arrow=>:down)
}
} ],
- '---',
+ '---',
- [ 'Side Left', [@popup[:arrowside], 'left'], nil, '',
+ [ 'Side Left', [@popup[:arrowside], 'left'], nil, '',
{:command=>proc{
- @tree2.column_configure(@popup[:column].value,
+ @tree2.column_configure(@popup[:column].value,
:arrowside=>:left)
}
} ],
- [ 'Side Right', [@popup[:arrowside], 'right'], nil, '',
+ [ 'Side Right', [@popup[:arrowside], 'right'], nil, '',
{:command=>proc{
- @tree2.column_configure(@popup[:column].value,
+ @tree2.column_configure(@popup[:column].value,
:arrowside=>:right)
}
} ],
- '---',
+ '---',
- [ 'Gravity Left', [@popup[:arrowgravity], 'left'], nil, '',
+ [ 'Gravity Left', [@popup[:arrowgravity], 'left'], nil, '',
{:command=>proc{
- @tree2.column_configure(@popup[:column].value,
+ @tree2.column_configure(@popup[:column].value,
:arrowgravity=>:left)
}
} ],
- [ 'Gravity Right', [@popup[:arrowgravity], 'right'], nil, '',
+ [ 'Gravity Right', [@popup[:arrowgravity], 'right'], nil, '',
{:command=>proc{
- @tree2.column_configure(@popup[:column].value,
+ @tree2.column_configure(@popup[:column].value,
:arrowgravity=>:right)
}
} ],
- ],
- nil, '', {:menu_config=>{:tearoff=>false}} ],
+ ],
+ nil, '', {:menu_config=>{:tearoff=>false}} ],
- [ 'Expand', @popup[:expand], nil, '',
+ [ 'Expand', @popup[:expand], nil, '',
{:command=>proc{
- @tree2.column_configure(@popup[:column].value,
+ @tree2.column_configure(@popup[:column].value,
:expand=>@popup[:expand].value)
}
} ],
- [ 'Squeeze', @popup[:squeeze], nil, '',
+ [ 'Squeeze', @popup[:squeeze], nil, '',
{:command=>proc{
- @tree2.column_configure(@popup[:column].value,
+ @tree2.column_configure(@popup[:column].value,
:squeeze=>@popup[:squeeze].value)
}
} ],
- [ 'Justify',
+ [ 'Justify',
[
- [ 'Left', [@popup[:justify], 'left'], nil, '',
+ [ 'Left', [@popup[:justify], 'left'], nil, '',
{:command=>proc{
@tree2.column_configure(@popup[:column].value, :justify=>:left)
}
} ],
- [ 'Center', [@popup[:justify], 'center'], nil, '',
+ [ 'Center', [@popup[:justify], 'center'], nil, '',
{:command=>proc{
- @tree2.column_configure(@popup[:column].value,
+ @tree2.column_configure(@popup[:column].value,
:justify=>:center)
}
} ],
- [ 'Right', [@popup[:justify], 'right'], nil, '',
+ [ 'Right', [@popup[:justify], 'right'], nil, '',
{:command=>proc{
- @tree2.column_configure(@popup[:column].value,
+ @tree2.column_configure(@popup[:column].value,
:justify=>:right)
}
} ]
- ],
+ ],
nil, '', {:menu_config=>{:tearoff=>false}} ]
]
@@ -707,7 +713,7 @@ class TkTreeCtrl_demo
def master._pub_display_styles_in_item(item)
display_styles_in_item(item)
end
- proc_disp_styles_in_item = proc{|item|
+ proc_disp_styles_in_item = proc{|item|
master._pub_display_styles_in_item(item)
}
@@ -771,15 +777,15 @@ class TkTreeCtrl_demo
def load_demo_scripts
# demo sources
[
- 'bitmaps',
- 'explorer',
- 'help',
- 'imovie',
- 'layout',
- 'mailwasher',
- 'outlook-folders',
- 'outlook-newgroup',
- 'random',
+ 'bitmaps',
+ 'explorer',
+ 'help',
+ 'imovie',
+ 'layout',
+ 'mailwasher',
+ 'outlook-folders',
+ 'outlook-newgroup',
+ 'random',
'www-options'
].each{|f|
@demo_scripts.load_demo(File.join(@ScriptDir, "#{f}.rb"))
@@ -789,18 +795,18 @@ class TkTreeCtrl_demo
###########################
def init_demo_list
- @tree1.element_create('e1', :text,
+ @tree1.element_create('e1', :text,
:fill=>[@SystemHighlightText, ['selected', 'focus']])
- @tree1.element_create('e2', :rect, :showfocus=>true,
+ @tree1.element_create('e2', :rect, :showfocus=>true,
:fill=>[
- @SystemHighlight, ['selected', 'focus'],
- 'gray', ['selected', '!focus'],
+ @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'],
+ @tree1.style_layout('s1', 'e2', :union=>['e1'],
:ipadx=>2, :ipady=>[0, 1], :iexpand=>:e)
if $Version_1_1_OrLater
@@ -809,19 +815,19 @@ class TkTreeCtrl_demo
###
[
- ["Random #{@RandomN[0]} Items", :demoRandom, 'random.rb'],
- ["Random #{@RandomN[0]} Items, Button Images", :demoRandom2, 'random.rb'],
+ ["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'],
+ ["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
@@ -853,15 +859,15 @@ class TkTreeCtrl_demo
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,
+ @tree4.element_create('e1', :text,
:fill=>[@SystemHighlightText,['selected','focus']])
- @tree4.element_create('e2', :text,
+ @tree4.element_create('e2', :text,
:fill=>[
- @SystemHighlightText, ['selected','focus'],
- '', ['selected','!focus'],
+ @SystemHighlightText, ['selected','focus'],
+ '', ['selected','!focus'],
'blue', []
])
- @tree4.element_create('e3', :rect, :showfocus=>true,
+ @tree4.element_create('e3', :rect, :showfocus=>true,
:fill=>[
@SystemHighlight, ['selected','focus'],
'gray', ['selected', '!focus']
@@ -874,13 +880,13 @@ class TkTreeCtrl_demo
@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'],
+ @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
@@ -892,7 +898,7 @@ class TkTreeCtrl_demo
@tree4.collapse(item)
end
@tree4.item_style_set(item, 0, 's1')
- @tree4.item_text(item, 0,
+ @tree4.item_text(item, 0,
"Element #{elem} (#{@tree2.element_type(elem)})")
# One item for each configuration option for this element
@@ -907,7 +913,7 @@ class TkTreeCtrl_demo
else
@tree4.item_style_set(item2, 0, 's2')
@tree4.item_complex(item2, [
- ['e1', {:text=>name}],
+ ['e1', {:text=>name}],
['e2', {:text=>current.inspect}]
])
end
@@ -942,7 +948,7 @@ class TkTreeCtrl_demo
@tree4.collapse(item2)
end
@tree4.item_style_set(item2, 0, 's1')
- @tree4.item_text(item2, 0,
+ @tree4.item_text(item2, 0,
"Element #{elem} (#{@tree2.element_type(elem)})")
# One item for each layout option for this element in this style
@@ -971,15 +977,15 @@ class TkTreeCtrl_demo
# Create elements and styles the first time this is called
if @tree3.style_names.empty?
- @tree3.element_create('e1', :text,
+ @tree3.element_create('e1', :text,
:fill=>[@SystemHighlightText,['selected','focus']])
- @tree3.element_create('e2', :text,
+ @tree3.element_create('e2', :text,
:fill=>[
- @SystemHighlightText, ['selected','focus'],
- '', ['selected','!focus'],
+ @SystemHighlightText, ['selected','focus'],
+ '', ['selected','!focus'],
'blue', []
])
- @tree3.element_create('e3', :rect, :showfocus=>true,
+ @tree3.element_create('e3', :rect, :showfocus=>true,
:fill=>[
@SystemHighlight, ['selected','focus'],
'gray', ['selected', '!focus']
@@ -992,7 +998,7 @@ class TkTreeCtrl_demo
@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'],
+ @tree3.style_layout('s2', 'e3', :union=>['e1', 'e2'],
:ipadx=>1, :ipady=>[0,1])
end
# Clear the list
@@ -1008,7 +1014,7 @@ class TkTreeCtrl_demo
@tree3.collapse(item2)
end
@tree3.item_style_set(item2, 0, 's1')
- @tree3.item_element_configure(item2, 0, 'e1',
+ @tree3.item_element_configure(item2, 0, 'e1',
:text=>"Column #{column}: Style #{sty}")
button = false
@@ -1029,7 +1035,7 @@ class TkTreeCtrl_demo
@tree3.collapse(item3)
end
@tree3.item_style_set(item3, 0, 's1')
- @tree3.item_element_configure(item3, 0, 'e1',
+ @tree3.item_element_configure(item3, 0, 'e1',
:text=>"Element #{elem} (#{@tree2.element_type(elem)})")
# One item for each configuration option in this element
@@ -1046,13 +1052,13 @@ class TkTreeCtrl_demo
if sameAsMaster
@tree3.item_style_set(item4, 0, 's1')
@tree3.item_complex(item4, [
- ['e1',
+ ['e1',
{:text=>"#{name} #{current.inspect}"}]
])
else
@tree3.item_style_set(item4, 0, 's2')
@tree3.item_complex(item4, [
- ['e1', {:text=>name}],
+ ['e1', {:text=>name}],
['e2', {:text=>current.inspect}]
])
end
@@ -1112,28 +1118,28 @@ class TkTreeCtrl_demo
# 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,
+ @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=>'',
+ @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|
+ @tree2.winfo_children.each{|w|
w.destroy unless @non_clear_list.include?(w)
}
end
@@ -1147,8 +1153,8 @@ 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,
+ c = TkCanvas.new(top, :background=>'white',
+ :width=>50*10, :highlightthickness=>0,
:borderwidth=>0).pack(:expand=>true, :fill=>:both)
cursors = %w(
X_cursor
@@ -1241,7 +1247,7 @@ def cursor_window(top = nil)
begin
c.cursor = cur
- r = TkcRectangle.new(c, x, y, x+50, y+40,
+ 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)
@@ -1278,10 +1284,10 @@ if Tk::PLATFORM['platform'] == 'unix' && Tk.windowingsystem != 'aqua'
loupe[:y] = 0 unless loupe[:y]
loupe[:auto] = true unless loupe[:auto]
loupe[:delay] = 500 unless loupe[:delay]
- loupe[:image] =
+ loupe[:image] =
TkPhotoImage.new(:width=>150, :height=>150) unless loupe[:image]
- top = TkToplevel.new(:geometry=>'-0+30',
+ top = TkToplevel.new(:geometry=>'-0+30',
:title=>'A little screen magnifier for X11')
TkLabel.new(top, :image=>loupe[:image]).pack
diff --git a/ext/tk/sample/tkextlib/treectrl/explorer.rb b/ext/tk/sample/tkextlib/treectrl/explorer.rb
index 1b8c2a8287..242777cbce 100644
--- a/ext/tk/sample/tkextlib/treectrl/explorer.rb
+++ b/ext/tk/sample/tkextlib/treectrl/explorer.rb
@@ -49,44 +49,44 @@ 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,
+ 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',
+ t.column_create(:text=>'Name', :tag=>'name',
:width=>200, :arrow=>:up, :arrowpad=>6)
- t.column_create(:text=>'Size', :tag=>'size', :justify=>:right,
+ 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',
+ t.column_configure(0, :text=>'Name', :tag=>'name',
:width=>200, :arrow=>:up, :arrowpad=>6)
- t.column_configure(1, :text=>'Size', :tag=>'size', :justify=>:right,
+ 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,
+ t.element_create('e1', :image,
:image=>[
- @sel_images['small-folder'], ['selected'],
+ @sel_images['small-folder'], ['selected'],
@images['small-folder'], []
])
- t.element_create('e2', :text, :lines=>1,
+ 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,
+ t.element_create('txtSize', :text, :lines=>1,
:datatype=>:integer, :format=>'%dKB')
- t.element_create('txtDate', :text, :lines=>1,
+ 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'],
+ @SystemHighlight, ['selected', 'focus'],
'gray', ['selected', '!focus']
])
@@ -116,23 +116,23 @@ def demoExplorerDetails(t)
@Priv[:sensitive, t] = [ ['name', 'styName', 'e1', 'e2'] ]
@Priv[:dragimage, t] = [ ['name', 'styName', 'e1', 'e2'] ]
- t.notify_bind(t, 'Edit-accept',
+ 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'}]],
+ 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',
+ t.item_style_set(item, 0, 'styName', 1, 'stySize',
2, 'styType', 3, 'styDate')
ext = File.extname(file)
@@ -151,14 +151,14 @@ def demoExplorerDetails(t)
type = type[1..-1] << ' ' unless type.empty?
type << 'File'
- t.item_complex(item,
- [
- ['e1', {:image=>[@sel_images[img], ['selected'],
+ 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}] ],
+ ],
+ [ ['txtSize', {:data=>File.size(file)/1024 + 1}] ],
+ [ ['txtType', {:text=>type}] ],
[ ['txtDate', {:data=>File.mtime(file).tv_sec}] ]
)
t.item_lastchild(:root, item)
@@ -167,7 +167,7 @@ def demoExplorerDetails(t)
demoExplorerAux(t, dir_proc, file_proc)
@SortColumn = 0
- t.notify_bind(t, 'Header-invoke',
+ 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 ]
@@ -200,37 +200,37 @@ def explorerHeaderInvoke(t, w, c)
case t.column_cget(c, :tag)
when 'name'
if dirCount > 0
- t.item_sort(:root, order, {:last=>"root child #{lastDir}"},
+ 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}"},
+ 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},
+ 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},
+ 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},
+ 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},
+ t.item_sort(:root, order, {:first=>"root child #{dirCount}"},
+ {:column=>c, :integer=>true},
{:column=>'name', :dictionary=>true})
end
@@ -241,9 +241,9 @@ 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,
+ 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-*')
@@ -254,17 +254,17 @@ def demoExplorerLargeIcons(t)
t.column_configure(0, :width=>75)
end
- t.element_create('elemImg', :image,
+ t.element_create('elemImg', :image,
:image=>[
- @sel_images['big-folder'], ['selected'],
+ @sel_images['big-folder'], ['selected'],
@images['big-folder'], []
])
- t.element_create('elemTxt', :text, :justify=>:center,
- :lines=>1, :width=>71, :wrap=>:word,
+ t.element_create('elemTxt', :text, :justify=>:center,
+ :lines=>1, :width=>71, :wrap=>:word,
:fill=>[@SystemHighlightText, ['selected', 'focus']])
- t.element_create('elemSel', :rect, :showfocus=>true,
+ t.element_create('elemSel', :rect, :showfocus=>true,
:fill=>[
- @SystemHighlight, ['selected', 'focus'],
+ @SystemHighlight, ['selected', 'focus'],
'gray', ['selected']
])
@@ -272,7 +272,7 @@ def demoExplorerLargeIcons(t)
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',
+ t.style_layout(s, 'elemTxt',
:pady=>[4,0], :padx=>2, :squeeze=>:x, :expand=>:we)
t.style_layout(s, 'elemSel', :union=>['elemTxt'])
@@ -280,7 +280,7 @@ def demoExplorerLargeIcons(t)
@Priv[:sensitive, t] = [ [0, 'STYLE', 'elemImg', 'elemTxt'] ]
@Priv[:dragimage, t] = [ [0, 'STYLE', 'elemImg', 'elemTxt'] ]
- t.notify_bind(t, 'Edit-accept',
+ t.notify_bind(t, 'Edit-accept',
proc{|w, i, tt| w.item_text(i, 0, tt)}, '%T %I %t')
dir_proc = proc{|file|
@@ -310,9 +310,9 @@ def demoExplorerLargeIcons(t)
type = type[1..-1] << ' ' unless type.empty?
type << 'File'
- t.item_complex(item,
- [
- ['elemImg', {:image=>[@sel_images[img], ['selected'],
+ t.item_complex(item,
+ [
+ ['elemImg', {:image=>[@sel_images[img], ['selected'],
@images[img], []]}],
['elemTxt', {:text=>File.basename(file)}]
])
@@ -323,7 +323,7 @@ def demoExplorerLargeIcons(t)
t.activate(t.index('root firstchild'))
- t.notify_bind(t, 'ActiveItem',
+ 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)
@@ -346,9 +346,9 @@ 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,
+ 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-*')
@@ -359,16 +359,16 @@ def demoExplorerList(t)
t.column_configure(0, :widthhack=>true)
end
- t.element_create('elemImg', :image,
+ t.element_create('elemImg', :image,
:image=>[
- @sel_images['small-folder'], ['selected'],
+ @sel_images['small-folder'], ['selected'],
@images['small-folder'], []
])
- t.element_create('elemTxt', :text, :lines=>1,
+ t.element_create('elemTxt', :text, :lines=>1,
:fill=>[@SystemHighlightText, ['selected', 'focus']])
- t.element_create('elemSel', :rect, :showfocus=>true,
+ t.element_create('elemSel', :rect, :showfocus=>true,
:fill=>[
- @SystemHighlight, ['selected', 'focus'],
+ @SystemHighlight, ['selected', 'focus'],
'gray', ['selected', '!focus']
])
@@ -383,7 +383,7 @@ def demoExplorerList(t)
@Priv[:sensitive, t] = [ [0, 'STYLE', 'elemImg', 'elemTxt'] ]
@Priv[:dragimage, t] = [ [0, 'STYLE', 'elemImg', 'elemTxt'] ]
- t.notify_bind(t, 'Edit-accept',
+ t.notify_bind(t, 'Edit-accept',
proc{|w, i, tt| w.item_text(i, 0, tt)}, '%T %I %t')
dir_proc = proc{|file|
@@ -413,9 +413,9 @@ def demoExplorerList(t)
type = type[1..-1] << ' ' unless type.empty?
type << 'File'
- t.item_complex(item,
- [
- ['elemImg', {:image=>[@sel_images[img], ['selected'],
+ t.item_complex(item,
+ [
+ ['elemImg', {:image=>[@sel_images[img], ['selected'],
@images[img], []]}],
['elemTxt', {:text=>File.basename(file)}]
])
diff --git a/ext/tk/sample/tkextlib/treectrl/help.rb b/ext/tk/sample/tkextlib/treectrl/help.rb
index 31ec9eb3f8..af026fc006 100644
--- a/ext/tk/sample/tkextlib/treectrl/help.rb
+++ b/ext/tk/sample/tkextlib/treectrl/help.rb
@@ -4,7 +4,7 @@
def demoHelpContents(t)
height = t.font.metrics(:linespace)
height = 18 if height < 18
- t.configure(:showroot=>false, :showbuttons=>false, :showlines=>false,
+ t.configure(:showroot=>false, :showbuttons=>false, :showlines=>false,
:itemheight=>height, :selectmode=>:browse)
init_pics('help-*')
@@ -20,16 +20,16 @@ def demoHelpContents(t)
t.element_create('e1', :image, :image=>@images['help-page'])
t.element_create('e2', :image, :image=>[
- @images['help-book-open'], ['open'],
- @images['help-book-closed'], [],
+ @images['help-book-open'], ['open'],
+ @images['help-book-closed'], [],
])
- t.element_create('e3', :text,
- :font=>[t.font.dup.underline(true), ['mouseover']],
+ t.element_create('e3', :text,
+ :font=>[t.font.dup.underline(true), ['mouseover']],
:fill=>[
- @SystemHighlightText, ['selected', 'focus'],
+ @SystemHighlightText, ['selected', 'focus'],
'blue', ['mouseover']
])
- t.element_create('e4', :rect, :showfocus=>true,
+ t.element_create('e4', :rect, :showfocus=>true,
:fill=>[@SystemHighlight, ['selected', 'focus']])
# book
@@ -49,21 +49,21 @@ def demoHelpContents(t)
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"],
+ [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"],
+ [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
@@ -81,7 +81,7 @@ def demoHelpContents(t)
treeCtrlHelp = TkBindTag.new
- treeCtrlHelp.bind('Double-ButtonPress-1',
+ treeCtrlHelp.bind('Double-ButtonPress-1',
proc{|w, x, y|
if w.identify(x, y)[0] == 'header'
Tk::TreeCtrl::BindCallback.doubleButton1(w, x, y)
@@ -91,25 +91,25 @@ def demoHelpContents(t)
Tk.callback_break
}, '%W %x %y')
- treeCtrlHelp.bind('ButtonPress-1',
+ treeCtrlHelp.bind('ButtonPress-1',
proc{|w, x, y|
helpButton1(w, x, y)
Tk.callback_break
}, '%W %x %y')
- treeCtrlHelp.bind('Button1-Motion',
+ treeCtrlHelp.bind('Button1-Motion',
proc{|w, x, y|
helpMotion1(w, x, y)
Tk.callback_break
}, '%W %x %y')
- treeCtrlHelp.bind('Button1-Leave',
+ treeCtrlHelp.bind('Button1-Leave',
proc{|w, x, y|
helpLeave1(w, x, y)
Tk.callback_break
}, '%W %x %y')
- treeCtrlHelp.bind('ButtonRelease-1',
+ treeCtrlHelp.bind('ButtonRelease-1',
proc{|w, x, y|
helpRelease1(w, x, y)
Tk.callback_break
@@ -119,7 +119,7 @@ def demoHelpContents(t)
treeCtrlHelp.bind('Leave', proc{|w, x, y| helpMotion(w, x, y) }, '%W %x %y')
- treeCtrlHelp.bind('KeyPress-Return',
+ treeCtrlHelp.bind('KeyPress-Return',
proc{|w, x, y|
if w.selection_get.length == 1
if $Version_1_1_OrLater
@@ -141,7 +141,7 @@ end
def demoHelpContents2(t)
height = t.font.metrics(:linespace)
height = 18 if height < 18
- t.configure(:showroot=>false, :showbuttons=>false, :showlines=>false,
+ t.configure(:showroot=>false, :showbuttons=>false, :showlines=>false,
:itemheight=>height, :selectmode=>:browse)
init_pics('help-*')
@@ -154,19 +154,19 @@ def demoHelpContents2(t)
t.element_create('e1', :image, :image=>@images['help-page'])
t.element_create('e2', :image, :image=>[
- @images['help-book-open'], ['open'],
- @images['help-book-closed'], [],
+ @images['help-book-open'], ['open'],
+ @images['help-book-closed'], [],
])
- t.element_create('e3', :text,
+ t.element_create('e3', :text,
:fill=>[
- @SystemHighlightText, ['selected', 'focus'],
+ @SystemHighlightText, ['selected', 'focus'],
'blue', []
])
- t.element_create('e4', :rect, :showfocus=>true,
+ t.element_create('e4', :rect, :showfocus=>true,
:fill=>[@SystemHighligh, ['selected', 'focus']])
- t.element_create('e5', :text, :font=>t.font.dup.underline(true),
+ t.element_create('e5', :text, :font=>t.font.dup.underline(true),
:fill=>[
- @SystemHighlightText, ['selected', 'focus'],
+ @SystemHighlightText, ['selected', 'focus'],
'blue', []
])
@@ -201,21 +201,21 @@ def demoHelpContents2(t)
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"],
+ [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"],
+ [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
@@ -233,7 +233,7 @@ def demoHelpContents2(t)
treeCtrlHelp = TkBindTag.new
- treeCtrlHelp.bind('Double-ButtonPress-1',
+ treeCtrlHelp.bind('Double-ButtonPress-1',
proc{|w, x, y|
if w.identify(x, y)[0] == 'header'
Tk::TreeCtrl::BindCallback.doubleButton1(w, x, y)
@@ -243,25 +243,25 @@ def demoHelpContents2(t)
Tk.callback_break
}, '%W %x %y')
- treeCtrlHelp.bind('ButtonPress-1',
+ treeCtrlHelp.bind('ButtonPress-1',
proc{|w, x, y|
helpButton1(w, x, y)
Tk.callback_break
}, '%W %x %y')
- treeCtrlHelp.bind('Button1-Motion',
+ treeCtrlHelp.bind('Button1-Motion',
proc{|w, x, y|
helpMotion1(w, x, y)
Tk.callback_break
}, '%W %x %y')
- treeCtrlHelp.bind('Button1-Leave',
+ treeCtrlHelp.bind('Button1-Leave',
proc{|w, x, y|
helpLeave1(w, x, y)
Tk.callback_break
}, '%W %x %y')
- treeCtrlHelp.bind('ButtonRelease-1',
+ treeCtrlHelp.bind('ButtonRelease-1',
proc{|w, x, y|
helpRelease1(w, x, y)
Tk.callback_break
@@ -271,7 +271,7 @@ def demoHelpContents2(t)
treeCtrlHelp.bind('Leave', proc{|w, x, y| helpMotion(w, x, y) }, '%W %x %y')
- treeCtrlHelp.bind('KeyPress-Return',
+ treeCtrlHelp.bind('KeyPress-Return',
proc{|w, x, y|
if w.selection_get.length == 1
w.item_toggle(w.selection_get[0])
diff --git a/ext/tk/sample/tkextlib/treectrl/imovie.rb b/ext/tk/sample/tkextlib/treectrl/imovie.rb
index 72134ebda6..d61bf9a7c3 100644
--- a/ext/tk/sample/tkextlib/treectrl/imovie.rb
+++ b/ext/tk/sample/tkextlib/treectrl/imovie.rb
@@ -2,8 +2,8 @@
# Demo: iMovie
#
def demoIMovie(t)
- t.configure(:showroot=>false, :showbuttons=>false, :showlines=>false,
- :selectmode=>:browse, :orient=>:horizontal, :wrap=>:window,
+ t.configure(:showroot=>false, :showbuttons=>false, :showlines=>false,
+ :selectmode=>:browse, :orient=>:horizontal, :wrap=>:window,
:showheader=>false, :background=>'#dcdcdc')
if $HasColumnCreate
@@ -26,24 +26,24 @@ def demoIMovie(t)
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,
+ 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,
+ 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',
+ 'elemShadow', 'elemRect', 'elemTime',
'elemImg', 'elemName'
])
- t.style_layout(s, 'elemShadow', :detach=>true,
+ 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],
+ t.style_layout(s, 'elemName', :expand=>:we, :ipady=>[0,2], :padx=>[0,3],
:squeeze=>:x)
- t.style_layout(s, 'elemRect', :union=>['elemTime', 'elemImg', 'elemName'],
+ t.style_layout(s, 'elemRect', :union=>['elemTime', 'elemImg', 'elemName'],
:ipadx=>6, :padx=>[0,3], :pady=>[0,3])
# Set default item style
@@ -53,12 +53,12 @@ def demoIMovie(t)
(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']],
+ ['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
@@ -110,7 +110,7 @@ def iMovieButton1(w, x, y)
Tk::TreeCtrl::BindCallback.entryOpen(w, i, 0, e)
ent = TkComm.window(w.path + '.entry')
unless exists
- ent.configure(:borderwidth=>0, :justify=>:center,
+ ent.configure(:borderwidth=>0, :justify=>:center,
:background=>'#ffdc5a')
x1, y1, x2, y2 = w.item_bbox(i, 0, e)
ent.place(:y=>y1 - 1)
diff --git a/ext/tk/sample/tkextlib/treectrl/layout.rb b/ext/tk/sample/tkextlib/treectrl/layout.rb
index 488abe2aa9..745ac86f36 100644
--- a/ext/tk/sample/tkextlib/treectrl/layout.rb
+++ b/ext/tk/sample/tkextlib/treectrl/layout.rb
@@ -2,7 +2,7 @@
# Demo: Layout
#
def demoLayout(t)
- t.configure(:showroot=>false, :showrootbutton=>true, :showbuttons=>true,
+ t.configure(:showroot=>false, :showrootbutton=>true, :showbuttons=>true,
:showlines=>true, :itemheight=>0, :selectmode=>:browse)
if $HasColumnCreate
@@ -12,10 +12,10 @@ def demoLayout(t)
end
t.element_create('e1', :rect, :width=>30, :height=>30, :fill=>'gray20')
- t.element_create('e2', :rect, :width=>30, :height=>30, :fill=>'gray40',
+ 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,
+ t.element_create('e4', :rect, :showfocus=>true,
:fill=>[
@SystemHighlight, ['selected', 'focus'], 'gray80', []
])
@@ -31,9 +31,9 @@ def demoLayout(t)
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,
+ t.style_layout(s, 'e6', :detach=>true, :expand=>:ws,
:padx=>[0,2], :pady=>[2,0])
- t.style_layout(s, 'e7', :detach=>true, :expand=>:wn,
+ t.style_layout(s, 'e7', :detach=>true, :expand=>:wn,
:padx=>[0,2], :pady=>[0,2])
if $Version_1_1_OrLater
@@ -53,7 +53,7 @@ def demoLayout(t)
t.item_style_set(i, 0, s)
t.item_lastchild(parent, i)
- ###
+ ###
s = t.style_create('s2')
t.style_elements(s, ['e4', 'e3', 'e1'])
@@ -77,7 +77,7 @@ def demoLayout(t)
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'])
@@ -101,10 +101,10 @@ def demoLayout(t)
t.item_style_set(i2, 0, s)
t.item_lastchild(i, i2)
- ###
+ ###
- t.element_create('eb', :border, :background=>@SystemButtonFace,
- :relief=>[:sunken, ['selected'], :raised, []],
+ t.element_create('eb', :border, :background=>@SystemButtonFace,
+ :relief=>[:sunken, ['selected'], :raised, []],
:thickness=>2, :filled=>true)
t.element_create('et', :text)
@@ -134,11 +134,11 @@ def demoLayout(t)
t.item_text(i, 0, text)
t.item_lastchild(parent, i)
- ###
+ ###
styleNum = 5
- [
- [:horizontal, [:s, :ns, :n]],
+ [
+ [:horizontal, [:s, :ns, :n]],
[:vertical, [:e, :we, :w]]
].each{|orient, expandList|
expandList.each{|expand|
diff --git a/ext/tk/sample/tkextlib/treectrl/mailwasher.rb b/ext/tk/sample/tkextlib/treectrl/mailwasher.rb
index 1b51bb9b21..836e1e87de 100644
--- a/ext/tk/sample/tkextlib/treectrl/mailwasher.rb
+++ b/ext/tk/sample/tkextlib/treectrl/mailwasher.rb
@@ -7,8 +7,8 @@ def demoMailWasher(t)
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,
+ t.configure(:showroot=>false, :showrootbutton=>false, :showbuttons=>false,
+ :showlines=>false, :itemheight=>height, :selectmode=>:browse,
:xscrollincrement=>1)
pad = 4
@@ -16,14 +16,14 @@ def demoMailWasher(t)
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,
+ t.column_create(:text=>'Status', :width=>80, :textpadx=>pad,
:tag=>'status')
- t.column_create(:text=>'Size', :width=>40, :textpadx=>pad,
+ 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,
+ t.column_create(:text=>'Subject', :width=>240, :textpadx=>pad,
:tag=>'subject')
- t.column_create(:text=>'Received', :textpadx=>pad, :arrow=>:up,
+ t.column_create(:text=>'Received', :textpadx=>pad, :arrow=>:up,
:arrowpad=>[4,0], :tag=>'received')
t.column_create(:text=>'Attachments', :textpadx=>pad, :tag=>'attachments')
@@ -36,38 +36,38 @@ def demoMailWasher(t)
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,
+ t.column_configure(2, :text=>'Status', :width=>80, :textpadx=>pad,
:tag=>'status')
- t.column_configure(3, :text=>'Size', :width=>40, :textpadx=>pad,
+ t.column_configure(3, :text=>'Size', :width=>40, :textpadx=>pad,
:justify=>:right, :tag=>'size')
- t.column_configure(4, :text=>'From', :width=>140, :textpadx=>pad,
+ t.column_configure(4, :text=>'From', :width=>140, :textpadx=>pad,
:tag=>'from')
- t.column_configure(5, :text=>'Subject', :width=>240, :textpadx=>pad,
+ t.column_configure(5, :text=>'Subject', :width=>240, :textpadx=>pad,
:tag=>'subject')
- t.column_configure(6, :text=>'Received', :textpadx=>pad, :arrow=>:up,
+ t.column_configure(6, :text=>'Received', :textpadx=>pad, :arrow=>:up,
:arrowpad=>[4,0], :tag=>'received')
- t.column_configure(7, :text=>'Attachments', :textpadx=>pad,
+ 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',
+ t.element_create('border', :rect, :open=>:nw, :outline=>'gray',
:outlinewidth=>1, :fill=>[@SystemHighlight, ['selected']])
- t.element_create('txtAny', :text, :lines=>1,
+ t.element_create('txtAny', :text, :lines=>1,
:fill=>[@SystemHighlightText, ['selected']])
- t.element_create('txtNone', :text, :text=>'none', :lines=>1,
+ t.element_create('txtNone', :text, :text=>'none', :lines=>1,
:fill=>[@SystemHighlightText, ['selected']])
- t.element_create('txtYes', :text, :text=>'yes', :lines=>1,
+ t.element_create('txtYes', :text, :text=>'yes', :lines=>1,
:fill=>[@SystemHighlightText, ['selected']])
- t.element_create('txtNormal', :text, :text=>'Normal', :lines=>1,
+ t.element_create('txtNormal', :text, :text=>'Normal', :lines=>1,
:fill=>[@SystemHighlightText, ['selected'], '#006800', []])
- t.element_create('txtPossSpam', :text, :text=>'Possible Spam', :lines=>1,
+ t.element_create('txtPossSpam', :text, :text=>'Possible Spam', :lines=>1,
:fill=>[@SystemHighlightText, ['selected'], '#787800', []])
- t.element_create('txtProbSpam', :text, :text=>'Probably Spam', :lines=>1,
+ t.element_create('txtProbSpam', :text, :text=>'Probably Spam', :lines=>1,
:fill=>[@SystemHighlightText, ['selected'], '#FF9000', []])
- t.element_create('txtBlacklist', :text, :text=>'Blacklisted', :lines=>1,
+ t.element_create('txtBlacklist', :text, :text=>'Blacklisted', :lines=>1,
:fill=>[@SystemHighlightText, ['selected'], '#FF5800', []])
if $Version_1_1_OrLater
@@ -96,16 +96,16 @@ def demoMailWasher(t)
}
[
- ['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"],
+ ['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"],
+ ['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
@@ -115,8 +115,8 @@ def demoMailWasher(t)
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',
+ 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
@@ -124,8 +124,8 @@ def demoMailWasher(t)
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',
+ t.item_style_set(item,
+ 0, delete, 1, bounce, 2, status, 3, 'styAny',
4, 'styAny', 5, 'styAny', 6, 'styAny', 7, attachments)
end
@@ -138,7 +138,7 @@ def demoMailWasher(t)
}
sortColumn = 6
- t.notify_bind(t, 'Header-invoke',
+ t.notify_bind(t, 'Header-invoke',
proc{|c, w|
if c == sortColumn
if w.column_cget(sortColumn, :arrow) == 'down'
@@ -162,35 +162,35 @@ def demoMailWasher(t)
w.column_configure(c, :arrow=>arrow)
case w.column_cget(c, :tag)
when 'bounce', 'delete'
- w.item_sort(:root, order,
- {
- :column=>c,
+ 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,
+ w.item_sort(:root, order,
{ :column=>c, :dictionary=>true })
when 'from'
- w.item_sort(:root, order,
- { :column=>c, :dictionary=>true },
+ w.item_sort(:root, order,
+ { :column=>c, :dictionary=>true },
{ :column=>'subject', :dictionary=>true })
when 'subject'
- w.item_sort(:root, order,
+ w.item_sort(:root, order,
{ :column=>c, :dictionary=>true })
when 'size'
- w.item_sort(:root, order,
- { :column=>c, :dictionary=>true },
+ w.item_sort(:root, order,
+ { :column=>c, :dictionary=>true },
{ :column=>'subject', :dictionary=>true })
when 'received'
- w.item_sort(:root, order,
- { :column=>c, :dictionary=>true },
+ w.item_sort(:root, order,
+ { :column=>c, :dictionary=>true },
{ :column=>'subject', :dictionary=>true })
when 'attachments'
- w.item_sort(:root, order,
- { :column=>c, :dictionary=>true },
+ w.item_sort(:root, order,
+ { :column=>c, :dictionary=>true },
{ :column=>'subject', :dictionary=>true })
end
}, '%C %T')
@@ -198,7 +198,7 @@ def demoMailWasher(t)
mailWasher = TkBindTag.new
if $Version_1_1_OrLater
- mailWasher.bind('ButtonPress-1',
+ mailWasher.bind('ButtonPress-1',
proc{|w, x, y|
id = w.identify(x, y)
if id.empty?
@@ -214,7 +214,7 @@ def demoMailWasher(t)
end
}, '%W %x %y')
else # TreeCtrl 1.0
- mailWasher.bind('ButtonPress-1',
+ mailWasher.bind('ButtonPress-1',
proc{|w, x, y|
id = w.identify(x, y)
if id.empty?
diff --git a/ext/tk/sample/tkextlib/treectrl/outlook-folders.rb b/ext/tk/sample/tkextlib/treectrl/outlook-folders.rb
index d966807866..c3af86868e 100644
--- a/ext/tk/sample/tkextlib/treectrl/outlook-folders.rb
+++ b/ext/tk/sample/tkextlib/treectrl/outlook-folders.rb
@@ -7,7 +7,7 @@ def demoOutlookFolders(t)
height = t.font.metrics(:linespace) + 2
height = 18 if height < 18
- t.configure(:itemheight=>height, :selectmode=>:browse, :showlines=>true,
+ t.configure(:itemheight=>height, :selectmode=>:browse, :showlines=>true,
:showroot=>true, :showrootbutton=>false, :showbuttons=>true)
if $HasColumnCreate
@@ -17,15 +17,15 @@ def demoOutlookFolders(t)
end
t.element_create('e1', :image)
- t.element_create('e2', :text, :lines=>1,
+ t.element_create('e2', :text, :lines=>1,
:fill=>[@SystemHighlightText, ['selected', 'focus']])
- t.element_create('e3', :text, :lines=>1, :font=>t.font.dup.weight(:bold),
+ 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,
+ t.element_create('e6', :rect, :showfocus=>true,
:fill=>[
- @SystemHighlight, ['selected', 'focus'],
+ @SystemHighlight, ['selected', 'focus'],
'gray', ['selected', '!focus']
])
@@ -60,28 +60,28 @@ def demoOutlookFolders(t)
t.style_layout(s, 'e6', :union=>['e3'], :iexpand=>:ns, :ipadx=>2)
t.item_style_set(:root, 0, 's1')
- t.item_complex(:root,
+ t.item_complex(:root,
[
- ['e1', {:image=>@images['outlook-main']}],
+ ['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],
+ [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
@@ -93,7 +93,7 @@ def demoOutlookFolders(t)
if img == :folder
if unread != 0
t.item_style_set(item, 0, 's4')
- t.item_complex(item,
+ t.item_complex(item,
[['e3', {:text=>text}], ['e4', {:text=>"(#{unread})"}]])
else
t.item_style_set(item, 0, 's3')
@@ -102,17 +102,17 @@ def demoOutlookFolders(t)
else
if unread != 0
t.item_style_set(item, 0, 's2')
- t.item_complex(item,
+ t.item_complex(item,
[
- ['e1', {:image=>@images["outlook-#{img}"]}],
- ['e3', {:text=>text}],
+ ['e1', {:image=>@images["outlook-#{img}"]}],
+ ['e3', {:text=>text}],
['e4', {:text=>"(#{unread})"}]
])
else
t.item_style_set(item, 0, 's1')
- t.item_complex(item,
+ t.item_complex(item,
[
- ['e1', {:image=>@images["outlook-#{img}"]}],
+ ['e1', {:image=>@images["outlook-#{img}"]}],
['e2', {:text=>text}]
])
end
diff --git a/ext/tk/sample/tkextlib/treectrl/outlook-newgroup.rb b/ext/tk/sample/tkextlib/treectrl/outlook-newgroup.rb
index 3495522e5c..d7e7f7e004 100644
--- a/ext/tk/sample/tkextlib/treectrl/outlook-newgroup.rb
+++ b/ext/tk/sample/tkextlib/treectrl/outlook-newgroup.rb
@@ -6,7 +6,7 @@ def demoOutlookNewsgroup(t)
height = t.font.metrics(:linespace)
height = 18 if height < 18
- t.configure(:itemheight=>height, :selectmode=>:browse, :showlines=>false,
+ t.configure(:itemheight=>height, :selectmode=>:browse, :showlines=>false,
:showroot=>false, :showrootbutton=>false, :showbuttons=>true)
if $Version_1_1_OrLater
@@ -24,7 +24,7 @@ def demoOutlookNewsgroup(t)
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,
+ t.column_configure(6, :text=>'Size', :width=>60, :justify=>:right,
:tag=>'size')
end
@@ -37,35 +37,35 @@ def demoOutlookNewsgroup(t)
# State for a message with unread descendants
t.state_define('unread')
- t.element_create('elemImg', :image,
+ t.element_create('elemImg', :image,
:image=>[
- @sel_images['outlook-read-2'],
- ['selected', 'read', 'unread', '!open'],
+ @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'],
+ @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']],
+ 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', 'unread', '!open'],
t.font.dup.weight(:bold), ['!read']
])
- t.element_create('sel.e', :rect, :open=>:e, :showfocus=>true,
+ t.element_create('sel.e', :rect, :open=>:e, :showfocus=>true,
:fill=>[
- @SystemHighlight, ['selected', 'focus'],
+ @SystemHighlight, ['selected', 'focus'],
'gray', ['selected', '!focus']
])
- t.element_create('sel.w', :rect, :open=>:w, :showfocus=>true,
+ t.element_create('sel.w', :rect, :open=>:w, :showfocus=>true,
:fill=>[
- @SystemHighlight, ['selected', 'focus'],
+ @SystemHighlight, ['selected', 'focus'],
'gray', ['selected', '!focus']
])
- t.element_create('sel.we', :rect, :open=>:we, :showfocus=>true,
+ t.element_create('sel.we', :rect, :open=>:we, :showfocus=>true,
:fill=>[
- @SystemHighlight, ['selected', 'focus'],
+ @SystemHighlight, ['selected', 'focus'],
'gray', ['selected', '!focus']
])
@@ -74,7 +74,7 @@ def demoOutlookNewsgroup(t)
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'],
+ t.style_layout(s, 'sel.e', :union=>['elemTxt'],
:iexpand=>:nes, :ipadx=>[2,0])
# Text
@@ -168,12 +168,12 @@ def demoOutlookNewsgroup(t)
}
# Do something when the selection changes
- t.notify_bind(t, 'Selection',
+ 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])
+ Tk.after_cancel(@Message[:afterId][:id])
end
@Message[:afterId][:item] = w.selection_get[0]
@Message[:afterId][:id] = Tk.after(500, proc{
@@ -208,7 +208,7 @@ def demoOutlookNewsgroup2(t)
height = t.font.metrics(:linespace)
height = 18 if height < 18
- t.configure(:itemheight=>height, :selectmode=>:browse, :showlines=>false,
+ t.configure(:itemheight=>height, :selectmode=>:browse, :showlines=>false,
:showroot=>false, :showrootbutton=>false, :showbuttons=>true)
if $Version_1_1_OrLater
@@ -226,7 +226,7 @@ def demoOutlookNewsgroup2(t)
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,
+ t.column_configure(6, :text=>'Size', :width=>60, :justify=>:right,
:tag=>'size')
end
@@ -235,24 +235,24 @@ def demoOutlookNewsgroup2(t)
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,
+ t.element_create('text.read', :text, :lines=>1,
:fill=>[@SystemHighlightText, ['selected', 'focus']])
- t.element_create('text.unread', :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,
+ t.element_create('sel.e', :rect, :open=>:e, :showfocus=>true,
:fill=>[
- @SystemHighlight, ['selected', 'focus'],
+ @SystemHighlight, ['selected', 'focus'],
'gray', ['selected', '!focus']
])
- t.element_create('sel.w', :rect, :open=>:w, :showfocus=>true,
+ t.element_create('sel.w', :rect, :open=>:w, :showfocus=>true,
:fill=>[
- @SystemHighlight, ['selected', 'focus'],
+ @SystemHighlight, ['selected', 'focus'],
'gray', ['selected', '!focus']
])
- t.element_create('sel.we', :rect, :open=>:we, :showfocus=>true,
+ t.element_create('sel.we', :rect, :open=>:we, :showfocus=>true,
:fill=>[
- @SystemHighlight, ['selected', 'focus'],
+ @SystemHighlight, ['selected', 'focus'],
'gray', ['selected', '!focus']
])
@@ -261,7 +261,7 @@ def demoOutlookNewsgroup2(t)
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'],
+ t.style_layout(s, 'sel.e', :union=>['text.unread'],
:iexpand=>:nes, :ipadx=>[2,0])
# Image + text
@@ -269,7 +269,7 @@ def demoOutlookNewsgroup2(t)
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'],
+ t.style_layout(s, 'sel.e', :union=>['text.read'],
:iexpand=>:nes, :ipadx=>[2,0])
# Image + text
@@ -277,7 +277,7 @@ def demoOutlookNewsgroup2(t)
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'],
+ t.style_layout(s, 'sel.e', :union=>['text.unread'],
:iexpand=>:nes, :ipadx=>[2,0])
# Text
@@ -350,7 +350,7 @@ def demoOutlookNewsgroup2(t)
style = 'unread'
style2 = 'unread2'
end
- t.item_style_set(i, 3, style, 4, "#{style2}.we", 5, "#{style2}.we",
+ 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
@@ -359,24 +359,24 @@ def demoOutlookNewsgroup2(t)
}
# Do something when the selection changes
- t.notify_bind(t, 'Selection',
+ 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',
+ t.item_style_map(i, 'subject', 'read',
['text.unread', 'text.read'])
- t.item_style_map(i, 'from', 'read.we',
+ t.item_style_map(i, 'from', 'read.we',
['text.unread', 'text.read'])
- t.item_style_map(i, 'sent', 'read.we',
+ t.item_style_map(i, 'sent', 'read.we',
['text.unread', 'text.read'])
- t.item_style_map(i, 'size', 'read.w',
+ t.item_style_map(i, 'size', 'read.w',
['text.unread', 'text.read'])
else
# unread -> read2
- t.item_style_map(i, 'subject', 'read2',
+ t.item_style_map(i, 'subject', 'read2',
['text.unread', 'text.unread'])
end
@@ -386,34 +386,34 @@ def demoOutlookNewsgroup2(t)
end
}, '%T')
- t.notify_bind(t, 'Expand-after',
+ 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',
+ t.item_style_map(i, 'subject', 'read',
['text.unread', 'text.read'])
# unread -> read
- t.item_style_map(i, 'from', 'read.we',
+ t.item_style_map(i, 'from', 'read.we',
['text.unread', 'text.read'])
- t.item_style_map(i, 'sent', 'read.we',
+ t.item_style_map(i, 'sent', 'read.we',
['text.unread', 'text.read'])
- t.item_style_map(i, 'size', 'read.w',
+ t.item_style_map(i, 'size', 'read.w',
['text.unread', 'text.read'])
end
}, '%T %I')
- t.notify_bind(t, 'Collapse-after',
+ 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',
+ t.item_style_map(i, 'subject', 'read2',
['text.read', 'text.unread'])
# read -> unread
- t.item_style_map(i, 'from', 'unread.we',
+ t.item_style_map(i, 'from', 'unread.we',
['text.read', 'text.unread'])
- t.item_style_map(i, 'sent', 'unread.we',
+ t.item_style_map(i, 'sent', 'unread.we',
['text.read', 'text.unread'])
- t.item_style_map(i, 'size', 'unread.w',
+ t.item_style_map(i, 'size', 'unread.w',
['text.read', 'text.unread'])
end
}, '%T %I')
diff --git a/ext/tk/sample/tkextlib/treectrl/random.rb b/ext/tk/sample/tkextlib/treectrl/random.rb
index 43aca63283..2c9e614aa5 100644
--- a/ext/tk/sample/tkextlib/treectrl/random.rb
+++ b/ext/tk/sample/tkextlib/treectrl/random.rb
@@ -1,4 +1,4 @@
-#
+#
def random_N
@RandomN[0] || 500
end
@@ -11,39 +11,39 @@ def demoRandom(t)
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,
+ 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',
+ t.column_create(:expand=>true, :text=>'Item',
:itembackground=>['#e0e8f0', []], :tag=>'item')
- t.column_create(:text=>'Parent', :justify=>:center,
+ t.column_create(:text=>'Parent', :justify=>:center,
:itembackground=>['gray90', []], :tag=>'parent')
- t.column_create(:text=>'Depth', :justify=>:center,
+ t.column_create(:text=>'Depth', :justify=>:center,
:itembackground=>['linen', []], :tag=>'depth')
else # TreeCtrl 1.0
- t.column_configure(0, :expand=>true, :text=>'Item',
+ t.column_configure(0, :expand=>true, :text=>'Item',
:itembackground=>['#e0e8f0', []], :tag=>'item')
- t.column_configure(1, :text=>'Parent', :justify=>:center,
+ t.column_configure(1, :text=>'Parent', :justify=>:center,
:itembackground=>['gray90', []], :tag=>'parent')
- t.column_configure(2, :text=>'Depth', :justify=>:center,
+ 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-open'], ['open'],
@images['folder-closed'], []
])
t.element_create('e2', :image, :image=>@images['small-file'])
- t.element_create('e3', :text,
+ 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,
+ t.element_create('e5', :rect, :showfocus=>true,
:fill=>[
- @SystemHighlight, ['selected', 'focus'],
+ @SystemHighlight, ['selected', 'focus'],
'gray', ['selected', '!focus']
])
@@ -65,11 +65,11 @@ def demoRandom(t)
t.style_layout(s, 'e6', :padx=>6, :expand=>:ns)
@Priv[:sensitive, t] = [
- [:item, 's1', 'e5', 'e1', 'e3'],
+ [:item, 's1', 'e5', 'e1', 'e3'],
[:item, 's2', 'e5', 'e2', 'e3']
]
@Priv[:dragimage, t] = [
- [:item, 's1', 'e1', 'e3'],
+ [:item, 's1', 'e1', 'e3'],
[:item, 's2', 'e2', 'e3']
]
@@ -108,16 +108,16 @@ def demoRandom(t)
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)}"}] ],
+ 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)}"}] ],
+ t.item_complex(item_i,
+ [ ['e3', {:text=>"Item #{i}"}] ],
+ [ ['e6', {:text=>"#{t.item_parent(item_i)}"}] ],
[ ['e6', {:text=>"#{t.depth(item_i)}"}] ])
end
}
@@ -125,46 +125,46 @@ def demoRandom(t)
treeCtrlRandom = TkBindTag.new
- treeCtrlRandom.bind('Double-ButtonPress-1',
+ 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',
+ 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',
+ 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',
+ 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',
+ treeCtrlRandom.bind('Button1-Motion',
proc{|w, x, y|
randomMotion1(w, x, y)
Tk.callback_break
}, '%W %x %y')
- treeCtrlRandom.bind('Button1-Leave',
+ treeCtrlRandom.bind('Button1-Leave',
proc{|w, x, y|
randomLeave1(w, x, y)
Tk.callback_break
}, '%W %x %y')
- treeCtrlRandom.bind('ButtonRelease-1',
+ treeCtrlRandom.bind('ButtonRelease-1',
proc{|w, x, y|
randomRelease1(w, x, y)
Tk.callback_break
@@ -363,7 +363,7 @@ def randomRelease1(t, x, y)
t.selection_modify('', @Priv[:drop])
t[:cursor] = ''
if @Priv[:drop] != ''
- randomDrop(t, @Priv[:drop], @Priv.list_element(:selection),
+ randomDrop(t, @Priv[:drop], @Priv.list_element(:selection),
@Priv[:drop, :pos])
end
end
@@ -479,7 +479,7 @@ def randomAutoScanCheck(t, x, y)
when 'drag', 'marquee'
randomMotion(t, x, y)
end
- @Priv[:autoscan, :afterId, t] =
+ @Priv[:autoscan, :afterId, t] =
Tk.after(delay, proc{ randomAutoScanCheckAux(t) })
end
return
@@ -502,7 +502,7 @@ def demoRandom2(t)
init_pics('mac-*')
- t.configure(:openbuttonimage=>@images['mac-collapse'],
- :closedbuttonimage=>@images['mac-expand'],
+ t.configure(:openbuttonimage=>@images['mac-collapse'],
+ :closedbuttonimage=>@images['mac-expand'],
:showlines=>false)
end
diff --git a/ext/tk/sample/tkextlib/treectrl/www-options.rb b/ext/tk/sample/tkextlib/treectrl/www-options.rb
index 6a3e9c2201..efa55ca06c 100644
--- a/ext/tk/sample/tkextlib/treectrl/www-options.rb
+++ b/ext/tk/sample/tkextlib/treectrl/www-options.rb
@@ -3,7 +3,7 @@ def demoInternetOptions (t)
height = t.font.metrics(:linespace) + 2
height = 18 if height < 18
- t.configure(:showroot=>false, :showbuttons=>false, :showlines=>false,
+ t.configure(:showroot=>false, :showbuttons=>false, :showlines=>false,
:itemheight=>height, :selectmode=>:browse)
init_pics('internet-*')
@@ -19,14 +19,14 @@ def demoInternetOptions (t)
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-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,
+ t.element_create('e2', :text,
:fill=>[@SystemHighlightText, ['selected', 'focus']])
- t.element_create('e3', :rect, :showfocus=>true,
+ t.element_create('e3', :rect, :showfocus=>true,
:fill=>[@SystemHighlight, ['selected', 'focus']])
s = t.style_create('s1')
@@ -38,18 +38,18 @@ def demoInternetOptions (t)
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",
+ [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", ""],
+ [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|
@@ -73,7 +73,7 @@ def demoInternetOptions (t)
t.item_state_set(item, 'radio')
end
else
- t.item_element_configure(item, 0, 'e1',
+ t.item_element_configure(item, 0, 'e1',
:image=>@images["internet-#{setting}"])
end
t.item_lastchild(parentList[depth], item)
@@ -146,7 +146,7 @@ end
def demoInternetOptions_2(t)
height = t.font.metrics(:linespace) + 2
height = 18 if height < 18
- t.configure(:showroot=>false, :showbuttons=>false, :showlines=>false,
+ t.configure(:showroot=>false, :showbuttons=>false, :showlines=>false,
:itemheight=>height, :selectmode=>:browse)
init_pics('internet-*')
@@ -154,9 +154,9 @@ def demoInternetOptions_2(t)
t.column_configure(0, :text=>'Internet Options')
t.element_create('e1', :image)
- t.element_create('e2', :text,
+ t.element_create('e2', :text,
:fill=>[@SystemHighlightText, ['selected', 'focus']])
- t.element_create('e3', :rect, :showfocus=>true,
+ t.element_create('e3', :rect, :showfocus=>true,
:fill=>[@SystemHighlight, ['selected', 'focus']])
s = t.style_create('s1')
@@ -168,18 +168,18 @@ def demoInternetOptions_2(t)
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",
+ [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", ""],
+ [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|
@@ -201,7 +201,7 @@ def demoInternetOptions_2(t)
t.item_element_configure(item, 0, 'e1', :image=>img)
end
else
- t.item_element_configure(item, 0, 'e1',
+ t.item_element_configure(item, 0, 'e1',
:image=>@images["internet-#{setting}"])
end
t.item_lastchild(parentList[depth], item)
@@ -256,16 +256,16 @@ def optionButton1_2(w, x, y)
else
setting = :on
end
- w.item_element_configure(item, 0, 'e1',
+ 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',
+ w.item_element_configure(current, 0, 'e1',
:image=>@images["internet-radio-off"])
- w.item_element_configure(item, 0, 'e1',
+ w.item_element_configure(item, 0, 'e1',
:image=>@images["internet-radio-on"])
@Option[:setting, item] = :on
@Option[:current, group] = item
diff --git a/ext/tk/sample/tkextlib/vu/canvItems.rb b/ext/tk/sample/tkextlib/vu/canvItems.rb
index 364f87613b..33acf4f7e7 100644
--- a/ext/tk/sample/tkextlib/vu/canvItems.rb
+++ b/ext/tk/sample/tkextlib/vu/canvItems.rb
@@ -9,63 +9,63 @@ 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,
+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,
+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',
+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,
+TkcText.create(c0, 40, 40,
:text=>Tk::TCL_PATCHLEVEL, :fill=>'cyan', :tags=>'text')
-l1 = TkLabel.new(:width=>128, :height=>128,
+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,
+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',
+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",
+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,
+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,
+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,
+ 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
diff --git a/ext/tk/sample/tkextlib/vu/canvSticker.rb b/ext/tk/sample/tkextlib/vu/canvSticker.rb
index 85713ebcf3..e2cd604975 100644
--- a/ext/tk/sample/tkextlib/vu/canvSticker.rb
+++ b/ext/tk/sample/tkextlib/vu/canvSticker.rb
@@ -14,7 +14,7 @@ c = TkCanvas.new.pack
begin
st = Tk::Vu::TkcSticker.new(c, 0, 0, 10, 10)
rescue
- Tk.messageBox(:type=>'ok', :title=>"No sticker Item",
+ Tk.messageBox(:type=>'ok', :title=>"No sticker Item",
:message=>"This build of vu does not include the sticker item")
exit
end
@@ -56,7 +56,7 @@ steps << proc{
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,
+ st.configure(:anchor=>:n, :relw=>0.3, :relh=>0.7,
:relx=>0.6, :rely=>0.3, :bar=>'red')
}
diff --git a/ext/tk/sample/tkextlib/vu/canvSticker2.rb b/ext/tk/sample/tkextlib/vu/canvSticker2.rb
index 3d9495ffb0..548a72c2cb 100644
--- a/ext/tk/sample/tkextlib/vu/canvSticker2.rb
+++ b/ext/tk/sample/tkextlib/vu/canvSticker2.rb
@@ -10,7 +10,7 @@ c = TkCanvas.new.pack
begin
st = Tk::Vu::TkcSticker.new(c, 0, 0, 10, 10)
rescue
- Tk.messageBox(:type=>'ok', :title=>"No sticker Item",
+ Tk.messageBox(:type=>'ok', :title=>"No sticker Item",
:message=>"This build of vu does not include the sticker item")
exit
end
@@ -22,7 +22,7 @@ c.destroy
#sti_conf = [ [10, 10, 180, 180], "Sticker äöüß@²³¼½¾", :center ]
#txt_conf = [ [210, 210], "Text äöüß@²³¼½¾", :center ]
-sti_conf = [ [10, 10, 350, 350],
+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],
diff --git a/ext/tk/sample/tkextlib/vu/dial_demo.rb b/ext/tk/sample/tkextlib/vu/dial_demo.rb
index f1f2f110b1..09bd3e9186 100644
--- a/ext/tk/sample/tkextlib/vu/dial_demo.rb
+++ b/ext/tk/sample/tkextlib/vu/dial_demo.rb
@@ -12,61 +12,61 @@ 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,
+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,
+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,
+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,
+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,
+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',
+ :minortickinterval=>0.5, :radius=>20,
+ :dialcolor=>'red2', :activebackground=>'red',
:variable=>v_rot)
-large = Tk::Vu::Dial.new(:font=>"Helvetica -8", :from=>0, :to=>10,
+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',
+ :minortickinterval=>0.25, :radius=>40,
+ :dialcolor=>'red2', :activebackground=>'red',
:variable=>v_rot)
-turn = Tk::Vu::Dial.new(:needlecolor=>'red', :label=>"Linked",
+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,
+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',
+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',
+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
diff --git a/ext/tk/sample/tkextlib/vu/oscilloscope.rb b/ext/tk/sample/tkextlib/vu/oscilloscope.rb
index 1efe13ce01..2015e46645 100644
--- a/ext/tk/sample/tkextlib/vu/oscilloscope.rb
+++ b/ext/tk/sample/tkextlib/vu/oscilloscope.rb
@@ -22,26 +22,26 @@ geo_t1 = [15, 88]
c = TkCanvas.new(:width=>220, :height=>190).pack(:fill=>:both, :expand=>true)
#---background
-TkcRectangle.new(c, geo_fr, :width=>4, :fill=>'aquamarine3',
+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=>'',
+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=>'',
+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",
+txt1 = TkcText.new(c, geo_t1, :text=>"B1-Motion: X:%X\tY:%Y",
:anchor=>:nw, :tags=>['osc', 'txt1'])
#---BINDINGS
diff --git a/ext/tk/sample/tkextlib/vu/pie.rb b/ext/tk/sample/tkextlib/vu/pie.rb
index c8f9276e4e..ed598d6233 100644
--- a/ext/tk/sample/tkextlib/vu/pie.rb
+++ b/ext/tk/sample/tkextlib/vu/pie.rb
@@ -26,13 +26,13 @@ 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,
+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 = {
+priv = {
:x=>0, :y=>0, :pie_in=>false, :angle=>pie[:angle], :origin=>pie[:origin]
}
@@ -46,9 +46,9 @@ pie.bind('ButtonPress-1', proc{|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) *
+ 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')
diff --git a/ext/tk/sample/tkextlib/vu/vu_demo.rb b/ext/tk/sample/tkextlib/vu/vu_demo.rb
index 358d32495f..d078ae16f2 100644
--- a/ext/tk/sample/tkextlib/vu/vu_demo.rb
+++ b/ext/tk/sample/tkextlib/vu/vu_demo.rb
@@ -9,13 +9,13 @@ 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',
+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,
+bar = Tk::Vu::Bargraph.new(:from=>0, :to=>100, :relief=>:groove,
:border=>2, :label=>"Bar Chart")
#######################################
@@ -26,7 +26,7 @@ purple = 75
current = 50
def rand_bool
-
+
end
update = TkTimer.new(200, -1, proc{
@@ -61,7 +61,7 @@ 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
index f51f7f5d85..2cece7337e 100644
--- a/ext/tk/sample/tkfrom.rb
+++ b/ext/tk/sample/tkfrom.rb
@@ -22,7 +22,7 @@ class Mail
@body = []
while line = f.gets()
$_.chop!
- next if /^From / =~ line # skip From-line
+ next if /^From / =~ line # skip From-line
break if /^$/ =~ line # end of header
if /^(\S+):\s*(.*)/ =~ line
@header[attr = $1.capitalize] = $2
diff --git a/ext/tk/sample/tkhello.rb b/ext/tk/sample/tkhello.rb
index 597c1f6242..3b505f4983 100644
--- a/ext/tk/sample/tkhello.rb
+++ b/ext/tk/sample/tkhello.rb
@@ -1,6 +1,6 @@
require "tk"
-TkButton.new(nil,
+TkButton.new(nil,
:text => 'hello',
:command => proc{print "hello\n"}).pack(:fill=>'x')
TkButton.new(nil,
diff --git a/ext/tk/sample/tkmenubutton.rb b/ext/tk/sample/tkmenubutton.rb
index 8ae1359425..37f6128fd9 100644
--- a/ext/tk/sample/tkmenubutton.rb
+++ b/ext/tk/sample/tkmenubutton.rb
@@ -7,56 +7,56 @@ require 'tk'
TkLabel.new(:text=>'Sample of TkMenubutton').pack(:side=>:top)
TkFrame.new{|f|
- pack(:side=>:top)
+ pack(:side=>:top)
- TkMenubutton.new(:parent=>f, :text=>'Right', :underline=>0,
+ 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' +
+ 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' +
+ 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,
+ 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' +
+ 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' +
+ 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,
+ 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' +
+ 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' +
+ 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,
+ 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' +
+ 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' +
+ 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)
@@ -64,20 +64,20 @@ TkFrame.new{|f|
}
############################
-TkFrame.new(:borderwidth=>2, :relief=>:sunken,
+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
+colors = %w(Black red4 DarkGreen NavyBlue gray75 Red Green Blue gray50
Yellow Cyan Magenta White Brown DarkSeaGreen DarkViolet)
TkFrame.new{|f|
- pack(:side=>:top)
+ pack(:side=>:top)
- b1 = TkOptionMenubutton .
- new(:parent=>f, :values=>%w(one two three)) .
+ 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|
@@ -96,7 +96,7 @@ TkFrame.new{|f|
put 'Black', *[14, 2, 16, 14]
put color, *[ 2, 2, 14, 14]
}
- optMB.entryconfigure(color, :hidemargin=>1,
+ optMB.entryconfigure(color, :hidemargin=>1,
:image=>no_sel, :selectimage=>sel)
}
optMB.menuconfigure(:tearoff, 1)
@@ -114,7 +114,7 @@ TkFrame.new{|f|
}
############################
-TkFrame.new(:borderwidth=>2, :relief=>:sunken,
+TkFrame.new(:borderwidth=>2, :relief=>:sunken,
:height=>5).pack(:side=>:top, :fill=>:x, :padx=>20)
############################
diff --git a/ext/tk/sample/tkmsgcat-load_rb.rb b/ext/tk/sample/tkmsgcat-load_rb.rb
index 98a91fadf4..5373e0086f 100644
--- a/ext/tk/sample/tkmsgcat-load_rb.rb
+++ b/ext/tk/sample/tkmsgcat-load_rb.rb
@@ -15,7 +15,7 @@ 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',
+ msgcat["%1$s:: %2$s", 'Color',
color.capitalize])
w.flash; w.flash
Tk.callback_break;
@@ -23,7 +23,7 @@ col_proc = TkComm.install_bind(proc{|w, color, frame, label|
del_proc = TkComm.install_cmd(proc{top_win.destroy; top_win = nil})
-err_proc = TkComm.install_cmd(proc{fail(RuntimeError,
+err_proc = TkComm.install_cmd(proc{fail(RuntimeError,
msgcat['Application Error'])})
show_sample = proc{|loc|
@@ -38,10 +38,10 @@ show_sample = proc{|loc|
pack(:pady=>10, :padx=>10)
}
- lbl = TkLabel.new(top_win, :text=>msgcat["%1$s:: %2$s",
+ 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,
+ bg = TkFrame.new(top_win).pack(:ipadx=>20, :ipady=>10,
:expand=>true, :fill=>:both)
TkFrame.new(bg){|f|
@@ -53,9 +53,9 @@ show_sample = proc{|loc|
}.pack(:anchor=>'center', :pady=>15)
TkFrame.new(top_win){|f|
- TkButton.new(f, :text=>msgcat['Delete'],
+ TkButton.new(f, :text=>msgcat['Delete'],
:command=>del_proc).pack(:side=>:right, :padx=>5)
- TkButton.new(f, :text=>msgcat['Error'],
+ TkButton.new(f, :text=>msgcat['Error'],
:command=>err_proc).pack(:side=>:left, :padx=>5)
}.pack(:side=>:bottom, :fill=>:x)
@@ -67,7 +67,7 @@ show_sample = proc{|loc|
TkLabel.new(:text=>"Please click a locale.").pack(:padx=>5, :pady=>3)
TkFrame.new{|f|
- TkButton.new(f, :text=>msgcat['Exit'],
+ TkButton.new(f, :text=>msgcat['Exit'],
:command=>proc{exit}).pack(:side=>:right, :padx=>5)
}.pack(:side=>:bottom, :fill=>:x)
@@ -90,7 +90,7 @@ lbox.bind('ButtonRelease-1'){|ev|
lbox.insert('end', 'default')
-Dir.entries(msgcat_dir).sort.each{|f|
+Dir.entries(msgcat_dir).sort.each{|f|
if f =~ /^(.*).msg$/
lbox.insert('end', $1)
end
diff --git a/ext/tk/sample/tkmsgcat-load_rb2.rb b/ext/tk/sample/tkmsgcat-load_rb2.rb
index 05512a3131..55246545c8 100644
--- a/ext/tk/sample/tkmsgcat-load_rb2.rb
+++ b/ext/tk/sample/tkmsgcat-load_rb2.rb
@@ -15,7 +15,7 @@ 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',
+ msgcat["%1$s:: %2$s", 'Color',
color.capitalize])
w.flash; w.flash
Tk.callback_break;
@@ -23,7 +23,7 @@ col_proc = TkComm.install_bind(proc{|w, color, frame, label|
del_proc = TkComm.install_cmd(proc{top_win.destroy; top_win = nil})
-err_proc = TkComm.install_cmd(proc{fail(RuntimeError,
+err_proc = TkComm.install_cmd(proc{fail(RuntimeError,
msgcat['Application Error'])})
show_sample = proc{|loc|
@@ -38,10 +38,10 @@ show_sample = proc{|loc|
pack(:pady=>10, :padx=>10)
}
- lbl = TkLabel.new(top_win, :text=>msgcat["%1$s:: %2$s",
+ 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,
+ bg = TkFrame.new(top_win).pack(:ipadx=>20, :ipady=>10,
:expand=>true, :fill=>:both)
TkFrame.new(bg){|f|
@@ -53,9 +53,9 @@ show_sample = proc{|loc|
}.pack(:anchor=>'center', :pady=>15)
TkFrame.new(top_win){|f|
- TkButton.new(f, :text=>msgcat['Delete'],
+ TkButton.new(f, :text=>msgcat['Delete'],
:command=>del_proc).pack(:side=>:right, :padx=>5)
- TkButton.new(f, :text=>msgcat['Error'],
+ TkButton.new(f, :text=>msgcat['Error'],
:command=>err_proc).pack(:side=>:left, :padx=>5)
}.pack(:side=>:bottom, :fill=>:x)
@@ -67,7 +67,7 @@ show_sample = proc{|loc|
TkLabel.new(:text=>"Please click a locale.").pack(:padx=>5, :pady=>3)
TkFrame.new{|f|
- TkButton.new(f, :text=>msgcat['Exit'],
+ TkButton.new(f, :text=>msgcat['Exit'],
:command=>proc{exit}).pack(:side=>:right, :padx=>5)
}.pack(:side=>:bottom, :fill=>:x)
@@ -90,7 +90,7 @@ lbox.bind('ButtonRelease-1'){|ev|
lbox.insert('end', 'default')
-Dir.entries(msgcat_dir).sort.each{|f|
+Dir.entries(msgcat_dir).sort.each{|f|
if f =~ /^(.*).msg$/
lbox.insert('end', $1)
end
diff --git a/ext/tk/sample/tkmsgcat-load_tk.rb b/ext/tk/sample/tkmsgcat-load_tk.rb
index 703f471e19..45d68e4e0b 100644
--- a/ext/tk/sample/tkmsgcat-load_tk.rb
+++ b/ext/tk/sample/tkmsgcat-load_tk.rb
@@ -14,7 +14,7 @@ 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',
+ msgcat.mc("%1$s:: %2$s", 'Color',
color.capitalize))
w.flash; w.flash
Tk.callback_break;
@@ -22,7 +22,7 @@ col_proc = TkComm.install_bind(proc{|w, color, frame, label|
del_proc = TkComm.install_cmd(proc{top_win.destroy; top_win = nil})
-err_proc = TkComm.install_cmd(proc{fail(RuntimeError,
+err_proc = TkComm.install_cmd(proc{fail(RuntimeError,
msgcat.mc('Application Error'))})
show_sample = proc{|loc|
@@ -36,10 +36,10 @@ show_sample = proc{|loc|
pack(:pady=>10, :padx=>10)
}
- lbl = TkLabel.new(top_win, :text=>msgcat.mc("%1$s:: %2$s",
+ 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,
+ bg = TkFrame.new(top_win).pack(:ipadx=>20, :ipady=>10,
:expand=>true, :fill=>:both)
TkFrame.new(bg){|f|
@@ -48,7 +48,7 @@ show_sample = proc{|loc|
bind('ButtonRelease-1', col_proc, "#{col} #{bg.path} #{lbl.path}")
}.pack(:fill=>:x)
=begin
- TkButton.new(f, :text=>msgcat.mc(col),
+ TkButton.new(f, :text=>msgcat.mc(col),
:command=>proc{
bg.background col
lbl.text msgcat.mc("%1$s:: %2$s", 'Color', col.capitalize)
@@ -58,17 +58,17 @@ show_sample = proc{|loc|
}.pack(:anchor=>'center', :pady=>15)
TkFrame.new(top_win){|f|
- TkButton.new(f, :text=>msgcat.mc('Delete'),
+ TkButton.new(f, :text=>msgcat.mc('Delete'),
:command=>del_proc).pack(:side=>:right, :padx=>5)
- TkButton.new(f, :text=>msgcat.mc('Error'),
+ TkButton.new(f, :text=>msgcat.mc('Error'),
:command=>err_proc).pack(:side=>:left, :padx=>5)
=begin
- TkButton.new(f, :text=>msgcat.mc('Delete'),
+ 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'),
+ TkButton.new(f, :text=>msgcat.mc('Error'),
:command=>proc{
fail RuntimeError, msgcat.mc('Application Error')
}).pack(:side=>:left, :padx=>5)
@@ -83,7 +83,7 @@ show_sample = proc{|loc|
TkLabel.new(:text=>"Please click a locale.").pack(:padx=>5, :pady=>3)
TkFrame.new{|f|
- TkButton.new(f, :text=>msgcat.mc('Exit'),
+ TkButton.new(f, :text=>msgcat.mc('Exit'),
:command=>proc{exit}).pack(:side=>:right, :padx=>5)
}.pack(:side=>:bottom, :fill=>:x)
@@ -106,7 +106,7 @@ lbox.bind('ButtonRelease-1'){|ev|
lbox.insert('end', 'default')
-Dir.entries(msgcat_dir).sort.each{|f|
+Dir.entries(msgcat_dir).sort.each{|f|
if f =~ /^(.*).msg$/
lbox.insert('end', $1)
end
diff --git a/ext/tk/sample/tkmulticolumnlist.rb b/ext/tk/sample/tkmulticolumnlist.rb
index a1b3a1a2fa..255eb691e5 100644
--- a/ext/tk/sample/tkmulticolumnlist.rb
+++ b/ext/tk/sample/tkmulticolumnlist.rb
@@ -32,7 +32,7 @@ class TkMultiColumnList < TkText
# decide total width
@lbox_total = title_info.size
@width_total = 0
- title_info.each{|title, width, cmd|
+ title_info.each{|title, width, cmd|
@width_total += width.to_f
@title_cmd << cmd
}
@@ -54,28 +54,28 @@ class TkMultiColumnList < TkText
@command = nil
# virtical scrollbar
- @v_scroll = TkYScrollbar.new(@frame, 'highlightthickness'=>@h_l_thick,
- 'borderwidth'=>@scrbar_border,
+ @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,
+ @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,
+ @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,
+ @w_title = TkcWindow.new(@c_title, 0, 0,
'window'=>@f_title, 'anchor'=>'nw')
- @c_lbox = TkCanvas.new(@frame, 'highlightthickness'=>@h_l_thick,
+ @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,
+ @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')
@@ -99,28 +99,28 @@ class TkMultiColumnList < TkText
f = TkFrame.new(@f_title, 'width'=>width)
base = [f]
- title = TkLabel.new(f, 'text'=>label, 'borderwidth'=>@title_border,
+ 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,
+ 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,
+ @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',
+ @seltag = TkTextTag.new(self, 'background'=>'#b3b3b3',
'borderwidth'=>1, 'relief'=>'raised')
def self.nearest(y)
self.index("@1,#{y}").split('.')[0].to_i
@@ -151,17 +151,17 @@ class TkMultiColumnList < TkText
pack('fill'=>'both', 'expand'=>true)
}
- f.place('relx'=>@rel_list[idx], 'y'=>0, 'anchor'=>'nw', 'width'=>1,
+ 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,
+ @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,
+ 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])
@@ -171,23 +171,23 @@ class TkMultiColumnList < TkText
}
# pad
- @f_title_pad = TkFrame.new(@frame, 'relief'=>'raised',
- 'borderwidth'=>@title_border,
+ @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,
+ @f_scr_pad = TkFrame.new(@frame, 'relief'=>'sunken',
+ 'borderwidth'=>1,
'highlightthickness'=>@h_l_thick)
# height check
title_height = 0
- @title_list.each{|w|
+ @title_list.each{|w|
h = w.winfo_reqheight
title_height = h if title_height < h
}
hscr_height = 0
- @hscr_list.each{|w|
+ @hscr_list.each{|w|
h = w.winfo_reqheight
hscr_height = h if hscr_height < h
}
@@ -203,12 +203,12 @@ class TkMultiColumnList < TkText
@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|
+ @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|
+ l.bind('B1-Motion', proc{|w, y|
select_line(w, w.nearest(y))
}, '%W %y')
l.bind('Double-Button-1', proc{
@@ -218,11 +218,11 @@ class TkMultiColumnList < TkText
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|
+ 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|
+ 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')
@@ -265,8 +265,8 @@ class TkMultiColumnList < TkText
@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)},
+ @c_lbox.bind('Configure',
+ proc{|height, width| reconstruct(height, width)},
'%h %w')
# set default receiver of method calls
@@ -386,7 +386,7 @@ class TkMultiColumnList < TkText
def titlefont(font)
@title_list.each{|label| label['font'] = font}
title_height = 0
- @title_list.each{|w|
+ @title_list.each{|w|
h = w.winfo_reqheight
title_height = h if title_height < h
}
@@ -523,7 +523,7 @@ class TkMultiColumnList < TkText
array[indices[0]] = line[label]
else
if line[label].kind_of? Array
- indices.each_with_index{|index, num|
+ indices.each_with_index{|index, num|
array[index] = line[label][num]
}
else
@@ -541,9 +541,9 @@ class TkMultiColumnList < TkText
indices.each{|index| lbox_ins[index] << line[index]}
end
}
- }
+ }
- @lbox_list.each_with_index{|lbox, index|
+ @lbox_list.each_with_index{|lbox, index|
lbox.insert(idx, cr + lbox_ins[index].join("\n")) if lbox_ins[index]
}
end
@@ -581,7 +581,7 @@ class TkMultiColumnList < TkText
(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],
+ lbox.place('relwidth'=>@rel_list[idx+1] - @rel_list[idx],
'relheight'=>1.0)
hscr.place('relwidth'=>@rel_list[idx+1] - @rel_list[idx])
}
@@ -608,11 +608,11 @@ class TkMultiColumnList < TkText
# adjustment of rightside widget of the sash
title, lbox, hscr = @base_list[idx]
- title.place('relwidth'=>@rel_list[idx+1] - @rel_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],
+ 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],
+ hscr.place('relwidth'=>@rel_list[idx+1] - @rel_list[idx],
'relx'=>@rel_list[idx])
# update reference position
@@ -636,34 +636,34 @@ class TkMultiColumnList < TkText
end
def title_binding(title, index)
- title.bind('Motion', proc{|w, x, idx| motion_cb(w, x, idx.to_i)},
+ 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)},
+ 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|
+ 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|
+ 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")
@@ -705,13 +705,13 @@ 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',
+ 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'
@@ -719,7 +719,7 @@ if __FILE__ == $0
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',
+ l.insert('end', ['aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb',
'cccccccccccccccccccccccccccccccccccccccccccccccccccc'])
l.insert('end', [1,2,3])
diff --git a/ext/tk/sample/tkmultilistbox.rb b/ext/tk/sample/tkmultilistbox.rb
index 7791649c4b..6f956d0edb 100644
--- a/ext/tk/sample/tkmultilistbox.rb
+++ b/ext/tk/sample/tkmultilistbox.rb
@@ -35,10 +35,10 @@ class TkMultiListbox < TkListbox
# create base flames
@f_title = TkFrame.new(@frame, 'width'=>@width_total)
- @f_lbox = TkFrame.new(@frame,
+ @f_lbox = TkFrame.new(@frame,
'width'=>@width_total, 'height'=>lbox_height)
- @f_hscr = TkFrame.new(@frame, 'width'=>@width_total,
- 'height'=>@v_scroll.cget('width') +
+ @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
@@ -63,25 +63,25 @@ class TkMultiListbox < TkListbox
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,
+ 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,
+ 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') .
+ @hscr_list << TkScrollbar.new(f, 'orient'=>'horizontal') .
pack('fill'=>'x', 'anchor'=>'w')
- f.place('relx'=>@rel_list[idx], 'y'=>0, 'anchor'=>'nw', 'width'=>-4,
+ 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|
+ @lbox_list[idx].xscrollcommand proc{|first, last|
@hscr_list[idx].set first, last
}
@hscr_list[idx].command proc{|*args| @lbox_list[idx].xview *args}
@@ -93,19 +93,19 @@ class TkMultiListbox < TkListbox
# create tab
@tab_list = [nil]
(1..(@rel_list.size - 2)).each{|idx|
- tab = TkFrame.new(@f_title, 'cursor'=>'sb_h_double_arrow',
+ 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},
+ 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|
+ lbox.yscrollcommand proc{|first, last|
@v_scroll.set first, last
}
}
@@ -118,17 +118,17 @@ class TkMultiListbox < TkListbox
@mode['extended'] = extended_mode_bindtag
@mode['multiple'] = multiple_mode_bindtag
@current_mode = 'browse'
- @lbox_list.each{|l|
- l.bind('Shift-Key-Left',
+ @lbox_list.each{|l|
+ l.bind('Shift-Key-Left',
proc{|w| focus_shift(w, -1); Tk.callback_break}, '%W')
- l.bind('Shift-Key-Right',
+ l.bind('Shift-Key-Right',
proc{|w| focus_shift(w, 1); Tk.callback_break}, '%W')
- l.bind('Button-2', proc{|x, y|
+ 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|
+ 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')
@@ -189,7 +189,7 @@ class TkMultiListbox < TkListbox
# set 'mode' option of listboxes
def mode(sel_mode)
- @lbox_list.each{|l|
+ @lbox_list.each{|l|
tags = l.bindtags
tags = tags - [ @mode[@current_mode] ]
l.bindtags(tags.unshift(@mode[sel_mode]))
@@ -282,7 +282,7 @@ class TkMultiListbox < TkListbox
array[indices[0]] = line[label]
else
if line[label].kind_of? Array
- indices.each_with_index{|index, num|
+ indices.each_with_index{|index, num|
array[index] = line[label][num]
}
else
@@ -300,9 +300,9 @@ class TkMultiListbox < TkListbox
indices.each{|index| lbox_ins[index] << line[index]}
end
}
- }
+ }
- @lbox_list.each_with_index{|lbox, index|
+ @lbox_list.each_with_index{|lbox, index|
lbox.insert(idx, *lbox_ins[index]) if lbox_ins[index]
}
end
@@ -326,7 +326,7 @@ class TkMultiListbox < TkListbox
(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],
+ lbox.place('relwidth'=>@rel_list[idx+1] - @rel_list[idx],
'relheight'=>1.0)
hscr.place('relwidth'=>@rel_list[idx+1] - @rel_list[idx])
@@ -356,11 +356,11 @@ class TkMultiListbox < TkListbox
# adjustment of rightside widget of the tab
title, lbox, hscr = @base_list[idx]
- title.place('relwidth'=>@rel_list[idx+1] - @rel_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],
+ 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],
+ hscr.place('relwidth'=>@rel_list[idx+1] - @rel_list[idx],
'relx'=>@rel_list[idx])
# update reference position
@@ -370,11 +370,11 @@ class TkMultiListbox < TkListbox
#################################
def browse_mode_bindtag
t = TkBindTag.new
- t.bind('Button-1',
+ 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',
+ 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')
@@ -385,7 +385,7 @@ class TkMultiListbox < TkListbox
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',
+ t.bind('Control-slash',
proc{|w| select_line(w, w.index('active').to_i)}, '%W')
t
@@ -394,12 +394,12 @@ class TkMultiListbox < TkListbox
########################
def single_mode_bindtag
t = TkBindTag.new
- t.bind('Button-1',
+ t.bind('Button-1',
proc{|w, y| w.focus; select_only(w, w.nearest(y))}, '%W %y')
- t.bind('ButtonRelease-1',
+ t.bind('ButtonRelease-1',
proc{|w, y| active_line(w, w.nearest(y))}, '%W %y')
- t.bind('Shift-Button-1',
+ 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')
@@ -410,9 +410,9 @@ class TkMultiListbox < TkListbox
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',
+ t.bind('Control-slash',
proc{|w| select_line(w, w.index('active').to_i)}, '%W')
- t.bind('Control-backslash',
+ t.bind('Control-backslash',
proc{@lbox_list.each{|l| l.selection_clear(0, 'end')}})
t
@@ -421,22 +421,22 @@ class TkMultiListbox < TkListbox
########################
def extended_mode_bindtag
t = TkBindTag.new
- t.bind('Button-1',
+ 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',
+ t.bind('ButtonRelease-1',
proc{|w, y| active_line(w, w.nearest(y))}, '%W %y')
- t.bind('Shift-Button-1',
+ t.bind('Shift-Button-1',
proc{|w, y| select_range(w, w.nearest(y))}, '%W %y')
- t.bind('Shift-B1-Motion',
+ t.bind('Shift-B1-Motion',
proc{|w, y| select_range(w, w.nearest(y))}, '%W %y')
- t.bind('Control-Button-1',
+ t.bind('Control-Button-1',
proc{|w, y| select_toggle(w, w.nearest(y))}, '%W %y')
- t.bind('Control-B1-Motion',
+ 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')
@@ -462,9 +462,9 @@ class TkMultiListbox < TkListbox
########################
def multiple_mode_bindtag
t = TkBindTag.new
- t.bind('Button-1',
+ t.bind('Button-1',
proc{|w, y| w.focus; select_line3(w, w.nearest(y))}, '%W %y')
- t.bind('ButtonRelease-1',
+ 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')
@@ -624,15 +624,15 @@ end
# test
################################################
if __FILE__ == $0
- f = TkFrame.new(nil, 'width'=>300,
+ 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',
+ 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])
diff --git a/ext/tk/sample/tkmultilistframe.rb b/ext/tk/sample/tkmultilistframe.rb
index 7c0aac9a9e..ef1a0a824d 100644
--- a/ext/tk/sample/tkmultilistframe.rb
+++ b/ext/tk/sample/tkmultilistframe.rb
@@ -32,7 +32,7 @@ class TkMultiListFrame < TkListbox
# decide total width
@lbox_total = title_info.size
@width_total = 0
- title_info.each{|title, width, cmd|
+ title_info.each{|title, width, cmd|
@width_total += width.to_f
@title_cmd << cmd
}
@@ -54,37 +54,37 @@ class TkMultiListFrame < TkListbox
# virtical scrollbar
=begin
- @v_scroll = TkScrollbar.new(@frame, 'highlightthickness'=>@h_l_thick,
- 'borderwidth'=>@scrbar_border,
+ @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,
+ @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,
+ @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,
+ @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,
+ @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,
+ @w_title = TkcWindow.new(@c_title, 0, 0,
'window'=>@f_title, 'anchor'=>'nw')
- @c_lbox = TkCanvas.new(@frame, 'highlightthickness'=>@h_l_thick,
+ @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,
+ @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')
@@ -108,45 +108,45 @@ class TkMultiListFrame < TkListbox
f = TkFrame.new(@f_title, 'width'=>width)
base = [f]
- title = TkLabel.new(f, 'text'=>label, 'borderwidth'=>@title_border,
+ 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,
+ 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,
+ @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,
+ 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,
+ @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,
+ @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,
+ 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|
+ @lbox_list[idx].xscrollcommand proc{|first, last|
@hscr_list[idx].set first, last
}
@hscr_list[idx].command proc{|*args| @lbox_list[idx].xview *args}
@@ -159,23 +159,23 @@ class TkMultiListFrame < TkListbox
# pad
# @f_title_pad = TkFrame.new(@frame)
- @f_title_pad = TkFrame.new(@frame, 'relief'=>'raised',
- 'borderwidth'=>@title_border,
+ @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,
+ @f_scr_pad = TkFrame.new(@frame, 'relief'=>'sunken',
+ 'borderwidth'=>1,
'highlightthickness'=>@h_l_thick)
# height check
title_height = 0
- @title_list.each{|w|
+ @title_list.each{|w|
h = w.winfo_reqheight
title_height = h if title_height < h
}
hscr_height = 0
- @hscr_list.each{|w|
+ @hscr_list.each{|w|
h = w.winfo_reqheight
hscr_height = h if hscr_height < h
}
@@ -187,7 +187,7 @@ class TkMultiListFrame < TkListbox
# set control procedure for virtical scroll
=begin
@lbox_list.each{|lbox|
- lbox.yscrollcommand proc{|first, last|
+ lbox.yscrollcommand proc{|first, last|
@v_scroll.set first, last
}
}
@@ -197,16 +197,16 @@ class TkMultiListFrame < TkListbox
# set control procedure for horizoncal scroll
=begin
- @c_title.xscrollcommand proc{|first, last|
+ @c_title.xscrollcommand proc{|first, last|
@h_scroll.set first, last
}
- @c_lbox.xscrollcommand proc{|first, last|
+ @c_lbox.xscrollcommand proc{|first, last|
@h_scroll.set first, last
}
- @c_hscr.xscrollcommand proc{|first, last|
+ @c_hscr.xscrollcommand proc{|first, last|
@h_scroll.set first, last
}
- @h_scroll.command proc{|*args|
+ @h_scroll.command proc{|*args|
@c_title.xview *args
@c_lbox.xview *args
@c_hscr.xview *args if @show_each_hscr
@@ -221,17 +221,17 @@ class TkMultiListFrame < TkListbox
@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',
+ @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',
+ l.bind('Shift-Key-Right',
proc{|w| focus_shift(w, 1); Tk.callback_break}, '%W')
- l.bind('Button-2', proc{|x, y|
+ 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|
+ 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')
@@ -270,8 +270,8 @@ class TkMultiListFrame < TkListbox
@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)},
+ @c_lbox.bind('Configure',
+ proc{|height, width| reconstruct(height, width)},
'%h %w')
# set default receiver of method calls
@@ -316,7 +316,7 @@ class TkMultiListFrame < TkListbox
# set 'mode' option of listboxes
def mode(sel_mode)
- @lbox_list.each{|l|
+ @lbox_list.each{|l|
tags = l.bindtags
tags = tags - [ @lbox_mode[@current_mode] ]
l.bindtags(tags.unshift(@lbox_mode[sel_mode]))
@@ -395,7 +395,7 @@ class TkMultiListFrame < TkListbox
def titlefont(font)
@title_list.each{|label| label['font'] = font}
title_height = 0
- @title_list.each{|w|
+ @title_list.each{|w|
h = w.winfo_reqheight
title_height = h if title_height < h
}
@@ -498,7 +498,7 @@ class TkMultiListFrame < TkListbox
array[indices[0]] = line[label]
else
if line[label].kind_of? Array
- indices.each_with_index{|index, num|
+ indices.each_with_index{|index, num|
array[index] = line[label][num]
}
else
@@ -516,9 +516,9 @@ class TkMultiListFrame < TkListbox
indices.each{|index| lbox_ins[index] << line[index]}
end
}
- }
+ }
- @lbox_list.each_with_index{|lbox, index|
+ @lbox_list.each_with_index{|lbox, index|
lbox.insert(idx, *lbox_ins[index]) if lbox_ins[index]
}
end
@@ -560,7 +560,7 @@ class TkMultiListFrame < TkListbox
(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],
+ lbox.place('relwidth'=>@rel_list[idx+1] - @rel_list[idx],
'relheight'=>1.0)
hscr.place('relwidth'=>@rel_list[idx+1] - @rel_list[idx])
}
@@ -587,11 +587,11 @@ class TkMultiListFrame < TkListbox
# adjustment of rightside widget of the sash
title, lbox, hscr = @base_list[idx]
- title.place('relwidth'=>@rel_list[idx+1] - @rel_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],
+ 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],
+ hscr.place('relwidth'=>@rel_list[idx+1] - @rel_list[idx],
'relx'=>@rel_list[idx])
# update reference position
@@ -615,34 +615,34 @@ class TkMultiListFrame < TkListbox
end
def title_binding(title, index)
- title.bind('Motion', proc{|w, x, idx| motion_cb(w, x, idx.to_i)},
+ 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)},
+ 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|
+ 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|
+ 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")
@@ -651,11 +651,11 @@ class TkMultiListFrame < TkListbox
#################################
def browse_mode_bindtag
t = TkBindTag.new
- t.bind('Button-1',
+ 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',
+ 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')
@@ -666,7 +666,7 @@ class TkMultiListFrame < TkListbox
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',
+ t.bind('Control-slash',
proc{|w| select_line(w, w.index('active').to_i)}, '%W')
t
@@ -675,12 +675,12 @@ class TkMultiListFrame < TkListbox
########################
def single_mode_bindtag
t = TkBindTag.new
- t.bind('Button-1',
+ t.bind('Button-1',
proc{|w, y| w.focus; select_only(w, w.nearest(y))}, '%W %y')
- t.bind('ButtonRelease-1',
+ t.bind('ButtonRelease-1',
proc{|w, y| active_line(w, w.nearest(y))}, '%W %y')
- t.bind('Shift-Button-1',
+ 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')
@@ -691,9 +691,9 @@ class TkMultiListFrame < TkListbox
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',
+ t.bind('Control-slash',
proc{|w| select_line(w, w.index('active').to_i)}, '%W')
- t.bind('Control-backslash',
+ t.bind('Control-backslash',
proc{@lbox_list.each{|l| l.selection_clear(0, 'end')}})
t
@@ -702,22 +702,22 @@ class TkMultiListFrame < TkListbox
########################
def extended_mode_bindtag
t = TkBindTag.new
- t.bind('Button-1',
+ 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',
+ t.bind('ButtonRelease-1',
proc{|w, y| active_line(w, w.nearest(y))}, '%W %y')
- t.bind('Shift-Button-1',
+ t.bind('Shift-Button-1',
proc{|w, y| select_range(w, w.nearest(y))}, '%W %y')
- t.bind('Shift-B1-Motion',
+ t.bind('Shift-B1-Motion',
proc{|w, y| select_range(w, w.nearest(y))}, '%W %y')
- t.bind('Control-Button-1',
+ t.bind('Control-Button-1',
proc{|w, y| select_toggle(w, w.nearest(y))}, '%W %y')
- t.bind('Control-B1-Motion',
+ 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')
@@ -743,9 +743,9 @@ class TkMultiListFrame < TkListbox
########################
def multiple_mode_bindtag
t = TkBindTag.new
- t.bind('Button-1',
+ t.bind('Button-1',
proc{|w, y| w.focus; select_line3(w, w.nearest(y))}, '%W %y')
- t.bind('ButtonRelease-1',
+ 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')
@@ -905,13 +905,13 @@ 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',
+ 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'
@@ -919,7 +919,7 @@ if __FILE__ == $0
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',
+ l.insert('end', ['aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb',
'cccccccccccccccccccccccccccccccccccccccccccccccccccc'])
l.insert('end', [1,2,3])
diff --git a/ext/tk/sample/tkoptdb-safeTk.rb b/ext/tk/sample/tkoptdb-safeTk.rb
index 3972577b0f..a06098323f 100644
--- a/ext/tk/sample/tkoptdb-safeTk.rb
+++ b/ext/tk/sample/tkoptdb-safeTk.rb
@@ -18,19 +18,19 @@ EOM
if ENV['LANG'] =~ /^ja/
# read Japanese resource
- ent = TkOptionDB.read_entries(File.expand_path('resource.ja',
+ ent = TkOptionDB.read_entries(File.expand_path('resource.ja',
File.dirname(__FILE__)),
'euc-jp')
else
# read English resource
- ent = TkOptionDB.read_entries(File.expand_path('resource.en',
+ 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,
+ # 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)}
}
@@ -38,22 +38,22 @@ ip = MultiTkIp.new_safeTk{
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 ",
+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,
+ # 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
+ # So, the followings raises an exception.
+ # An Exception object of the exception is returned as a
# return value of this method.
load file
@@ -64,7 +64,7 @@ print "If a proc object is given, the proc is evaluated on the safe-level which
safe0_cmd = Proc.new{
print 'safe0_cmd safe-level == ', $SAFE, "\n"
- # This proc object keeps current safe-level ($SAFE==0).
+ # This proc object keeps current safe-level ($SAFE==0).
load file
}
ip.eval_proc{safe0_cmd.call}
diff --git a/ext/tk/sample/tkoptdb.rb b/ext/tk/sample/tkoptdb.rb
index 75c21e7e47..47784ea238 100644
--- a/ext/tk/sample/tkoptdb.rb
+++ b/ext/tk/sample/tkoptdb.rb
@@ -2,21 +2,21 @@
#
# 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.
+# 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__)),
+ TkOptionDB.read_with_encoding(File.expand_path('resource.ja',
+ File.dirname(__FILE__)),
'euc-jp')
else
# read English resource
- TkOptionDB.readfile(File.expand_path('resource.en',
+ TkOptionDB.readfile(File.expand_path('resource.en',
File.dirname(__FILE__)))
end
end
@@ -24,7 +24,7 @@ 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),
+ # If you want to check resource string (str),
# please define __check_proc_string__(str) like this.
class << self
def __check_proc_string__(str)
@@ -40,12 +40,12 @@ cmd = TkOptionDB.new_proc_class(:BTN_CMD, [:show_msg, :bye_msg], 3) {
# following two frame widgets use same database entry
TkFrame.new(:class=>'BtnFrame'){|f|
pack(:padx=>5, :pady=>5)
- TkButton.new(:parent=>f, :widgetname=>'hello'){
+ 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{
@@ -53,7 +53,7 @@ TkFrame.new(:class=>'BtnFrame'){|f|
cmd.bye_msg
print "(<<< $SAFE=#{$SAFE} ) : "
exit
- },
+ },
:parent=>f, :widgetname=>'quit'){
pack(:fill=>:x, :padx=>10, :pady=>10)
}
@@ -62,12 +62,12 @@ TkFrame.new(:class=>'BtnFrame'){|f|
class BtnFrame < TkFrame; end
BtnFrame.new{|f|
pack(:padx=>5, :pady=>5)
- TkButton.new(:parent=>f, :widgetname=>'hello'){
+ 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{
@@ -75,7 +75,7 @@ BtnFrame.new{|f|
cmd.bye_msg
print "(<<< $SAFE=#{$SAFE})"
exit
- },
+ },
:parent=>f, :widgetname=>'quit'){
pack(:fill=>:x, :padx=>10, :pady=>10)
}
@@ -84,12 +84,12 @@ BtnFrame.new{|f|
# if unknown class, use default option values
TkFrame.new(:class=>'BtnFrame2'){|f|
pack(:padx=>5, :pady=>5)
- TkButton.new(:parent=>f, :widgetname=>'hello'){
+ 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{
@@ -97,7 +97,7 @@ TkFrame.new(:class=>'BtnFrame2'){|f|
cmd.bye_msg
print "(<<< $SAFE=#{$SAFE})"
exit
- },
+ },
:parent=>f, :widgetname=>'quit'){
pack(:fill=>:x, :padx=>10, :pady=>10)
}
diff --git a/ext/tk/sample/tkrttimer.rb b/ext/tk/sample/tkrttimer.rb
index 1f9cbd9eb5..0abd4ecbd2 100644
--- a/ext/tk/sample/tkrttimer.rb
+++ b/ext/tk/sample/tkrttimer.rb
@@ -8,24 +8,24 @@ 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,
+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,
+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
+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
+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
diff --git a/ext/tk/sample/tktextframe.rb b/ext/tk/sample/tktextframe.rb
index b2b40c9138..bdab057d34 100644
--- a/ext/tk/sample/tktextframe.rb
+++ b/ext/tk/sample/tktextframe.rb
@@ -5,53 +5,9 @@
#
require 'tk'
-module Tk::ScrollbarComposite
+class TkTextFrame < TkText
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 defalut 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)
@@ -59,123 +15,55 @@ module Tk::ScrollbarComposite
@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)
+ # create a text widget
+ @text = TkText.new(@frame, 'wrap'=>'none')
# set default receiver of method calls
- @path = @component.path
+ @path = @text.path
# assign scrollbars
- @component.xscrollbar(@h_scroll)
- @component.yscrollbar(@v_scroll)
+ @text.xscrollbar(@h_scroll)
+ @text.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')
+ @text.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
+ vscroll(keys.delete('vscroll'){true})
+ hscroll(keys.delete('hscroll'){true})
+
+ # set background of the text widget
+=begin
+ color = keys.delete('textbackground')
+ textbackground(color) if color
+=end
+ # please check the differences of the following definitions
option_methods(
- [:textbackground, nil, :textbg_info],
- :textborderwidth,
+ [:scrollbarwidth, :get_scrollbarwidth],
+ [:textbackground, nil, :textbg_info],
+ :textborderwidth,
:textrelief
)
- # return the created componet
- @text
- end
- private :create_component
+ # set receiver widgets for configure methods (with alias)
+ delegate_alias('scrollbarrelief', 'relief', @h_scroll, @v_scroll)
- # def component_delegates; end
- # private :component_delegates
+ # set receiver widgets for configure methods
+ delegate('DEFAULT', @text)
+ delegate('background', @frame, @h_scroll, @v_scroll)
+ 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)
- 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
+ # do configure
+ configure keys unless keys.empty?
end
+ private :initialize_composite
# set background color of text widget
def textbackground(color = nil)
@@ -215,67 +103,60 @@ class TkTextFrame < TkText
def textrelief(type)
@text.relief(type)
end
+
+ # 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
+
+ # vertical scrollbar : ON/OFF
+ def vscroll(mode)
+ st = TkGrid.info(@v_scroll)
+ if mode && st.size == 0 then
+ @v_scroll.grid('row'=>0, 'column'=>1, 'sticky'=>'ns')
+ elsif !mode && st.size != 0 then
+ @v_scroll.ungrid
+ end
+ self
+ end
+
+ # horizontal scrollbar : ON/OFF
+ def hscroll(mode, wrap_mode="char")
+ st = TkGrid.info(@h_scroll)
+ if mode && st.size == 0 then
+ @h_scroll.grid('row'=>1, 'column'=>0, 'sticky'=>'ew')
+ wrap 'none' # => self.wrap('none')
+ elsif !mode && st.size != 0 then
+ @h_scroll.ungrid
+ wrap wrap_mode # => self.wrap(wrap_mode)
+ end
+ self
+ 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,
+ t = TkTextFrame.new(:textborderwidth=>3,
+ :textrelief=>:ridge,
:scrollbarrelief=>:ridge).pack
p t.configinfo
- TkButton.new(f, 'text'=>'vscr OFF',
+ TkButton.new(f, 'text'=>'vscr OFF',
'command'=>proc{t.vscroll(false)}).pack('side'=>'right')
- TkButton.new(f, 'text'=>'vscr ON',
+ TkButton.new(f, 'text'=>'vscr ON',
'command'=>proc{t.vscroll(true)}).pack('side'=>'right')
- TkButton.new(f, 'text'=>'hscr ON',
+ TkButton.new(f, 'text'=>'hscr ON',
'command'=>proc{t.hscroll(true)}).pack('side'=>'left')
- TkButton.new(f, 'text'=>'hscr OFF',
+ 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
index 679a2b7142..9f012feada 100644
--- a/ext/tk/sample/tktextio.rb
+++ b/ext/tk/sample/tktextio.rb
@@ -3,15 +3,15 @@
# 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
+# 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.
+# 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.
+# I think that it is not good on the supposed situation of using
+# TkTextIO.
#
require 'tk'
require 'tk/text'
@@ -24,14 +24,14 @@ class TkTextIO < TkText
OPT_DEFAULTS = {
'mode' => nil,
- 'overwrite' => false,
- 'text' => nil,
- 'show' => :pos,
- 'wrap' => 'char',
- 'sync' => true,
- 'prompt' => nil,
- 'prompt_cmd' => nil,
- 'hist_size' => 1000,
+ 'overwrite' => false,
+ 'text' => nil,
+ 'show' => :pos,
+ 'wrap' => 'char',
+ 'sync' => true,
+ 'prompt' => nil,
+ 'prompt_cmd' => nil,
+ 'hist_size' => 1000,
}
def create_self(keys)
@@ -46,7 +46,7 @@ class TkTextIO < TkText
@buf_size = 0
@buf_max = 1024
- @write_buf_queue, @write_buf_mutex,
+ @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 })
@@ -87,7 +87,7 @@ class TkTextIO < TkText
def _get_io_params(keys)
opts = {}
- self.class.const_get(:OPT_DEFAULTS).each{|k, v|
+ self.class.const_get(:OPT_DEFAULTS).each{|k, v|
if keys.has_key?(k)
opts[k] = keys.delete(k)
else
@@ -261,7 +261,7 @@ class TkTextIO < TkText
Tk.callback_break
end
end
- private :_cb_up, :_cb_down, :_cb_left, :_cb_backspace,
+ private :_cb_up, :_cb_down, :_cb_left, :_cb_backspace,
:_cb_ctrl_a, :_cb_ctrl_u
def _setup_console_bindings
@@ -484,7 +484,7 @@ class TkTextIO < TkText
Thread.pass
if @open[:w] || ! @write_buffer.empty?
@write_buf_mutex.synchronize {
- _sync_write_buf(@write_buffer)
+ _sync_write_buf(@write_buffer)
@write_buffer[0..-1] = ''
}
end
@@ -666,7 +666,7 @@ class TkTextIO < TkText
@txtpos.set('end - 1 char')
elsif rs == ''
@count_var.value # make it global
- idx = tksearch_with_count([:regexp], @count_var,
+ idx = tksearch_with_count([:regexp], @count_var,
"\n(\n)+", @txtpos, 'end - 1 char')
if idx
s = get(@txtpos, idx) << "\n"
@@ -779,9 +779,9 @@ class TkTextIO < TkText
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.
+ # 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
@@ -921,9 +921,9 @@ 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,
+ #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)
@@ -1045,12 +1045,12 @@ if __FILE__ == $0
num = 0
# io = TkTextIO.new(:mode=>:console, :prompt=>'').pack
#=begin
- io = TkTextIO.new(:mode=>:console,
+ io = TkTextIO.new(:mode=>:console,
:prompt_cmd=>proc{
s = "[#{num}]"
num += 1
s
- },
+ },
:prompt=>'-> ').pack
#=end
Thread.new{loop{sleep 2; io.puts 'hoge'}}
diff --git a/ext/tk/sample/tktimer2.rb b/ext/tk/sample/tktimer2.rb
index 125115e863..dd31bb098e 100644
--- a/ext/tk/sample/tktimer2.rb
+++ b/ext/tk/sample/tktimer2.rb
@@ -5,7 +5,7 @@ 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
+# * 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)
@@ -19,11 +19,11 @@ tick = proc{|aobj| #<== TkTimer object
}
timer = TkTimer.new(50, -1, tick).start(0, proc{ label.text('0.00'); 0 })
- # ==> repeat-interval : (about) 50 ms,
- # repeat : infinite (-1) times,
+ # ==> repeat-interval : (about) 50 ms,
+ # repeat : infinite (-1) times,
# repeat-procedure : tick (only one, in this case)
#
- # ==> wait-before-call-init-proc : 0 ms,
+ # ==> wait-before-call-init-proc : 0 ms,
# init_proc : proc{ label.text('0.00'); 0 }
#
# (0ms)-> init_proc ->(50ms)-> tick ->(50ms)-> tick ->....
diff --git a/ext/tk/sample/tktimer3.rb b/ext/tk/sample/tktimer3.rb
index 08e8a3cad4..e3bb4c3e4a 100644
--- a/ext/tk/sample/tktimer3.rb
+++ b/ext/tk/sample/tktimer3.rb
@@ -5,7 +5,7 @@ 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
+# * 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)
@@ -19,11 +19,11 @@ tick = proc{|aobj| #<== TkTimer object
}
timer = TkTimer.new(50, -1, tick).start(0, proc{ label.text('0.00'); 0 })
- # ==> repeat-interval : (about) 50 ms,
- # repeat : infinite (-1) times,
+ # ==> repeat-interval : (about) 50 ms,
+ # repeat : infinite (-1) times,
# repeat-procedure : tick (only one, in this case)
#
- # ==> wait-before-call-init-proc : 0 ms,
+ # ==> wait-before-call-init-proc : 0 ms,
# init_proc : proc{ label.text('0.00'); 0 }
#
# (0ms)-> init_proc ->(50ms)-> tick ->(50ms)-> tick ->....
diff --git a/ext/tk/sample/tktree.rb b/ext/tk/sample/tktree.rb
index 4eb7f60627..56b7211c88 100644
--- a/ext/tk/sample/tktree.rb
+++ b/ext/tk/sample/tktree.rb
@@ -3,10 +3,10 @@
#
# 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 ).
+# 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'
@@ -68,9 +68,9 @@ end
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.
+ 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)
@@ -79,14 +79,14 @@ EOL
tr1.focus
items.each{|item|
- tr1.newitem(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',
+ 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))
@@ -94,8 +94,8 @@ EOL
}
items.each{|item|
- tr2.newitem(item, :textcolor=>'green', :image=>'',
- :itemfont=>{:family=>'Times', :size=>10},
+ tr2.newitem(item, :textcolor=>'green', :image=>'',
+ :itemfont=>{:family=>'Times', :size=>10},
:command=>proc{Tk.messageBox(:message=>"#{item} executed")})
}
diff --git a/ext/tk/sample/ttk_wrapper.rb b/ext/tk/sample/ttk_wrapper.rb
index e4eb9c7964..1580668994 100644
--- a/ext/tk/sample/ttk_wrapper.rb
+++ b/ext/tk/sample/ttk_wrapper.rb
@@ -10,7 +10,7 @@ version = '0.1.3'
# parse commandline arguments
##########################################################################
require 'optparse'
-opt = OptionParser.new("Usage: #{$0} [options] rubytk_script" << "\n " <<
+opt = OptionParser.new("Usage: #{$0} [options] rubytk_script" << "\n " <<
"Ruby/Tk script wrapper. Use Ttk widgets as default.")
opt.version = version
@@ -21,7 +21,7 @@ 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|
+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|
@@ -42,7 +42,7 @@ begin
Tk.default_widget_set = :Ttk
rescue LoadError
if OPTS[:verbose]
- print "warning: fail to load 'Ttk' extension. use standard widgets.\n"
+ print "warning: fail to load 'Ttk' extension. use standard widgets.\n"
end
end
@@ -53,7 +53,7 @@ end
##########################################################################
# define Tcl/Tk procedures for compatibility.
-# those are required when want to use themes included
+# those are required when want to use themes included
# in "sample/tkextlib/tile/demo.rb".
##########################################################################
Tk::Tile.__define_LoadImages_proc_for_compatibility__!
@@ -111,7 +111,7 @@ 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"
+ 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]
@@ -122,7 +122,7 @@ 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
+# 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
diff --git a/ext/tk/stubs.c b/ext/tk/stubs.c
index 4388fb294d..6d3b330f0e 100644
--- a/ext/tk/stubs.c
+++ b/ext/tk/stubs.c
@@ -92,7 +92,7 @@ static DL_HANDLE tcl_dll = (DL_HANDLE)0;
static DL_HANDLE tk_dll = (DL_HANDLE)0;
int
-#ifdef HAVE_PROTOTYPES
+#ifdef RUBY_VM
ruby_open_tcl_dll(char *appname)
#else
ruby_open_tcl_dll(appname)
@@ -179,7 +179,7 @@ ruby_open_tk_dll()
}
int
-#ifdef HAVE_PROTOTYPES
+#ifdef RUBY_VM
ruby_open_tcltk_dll(char *appname)
#else
ruby_open_tcltk_dll(appname)
@@ -203,7 +203,7 @@ tk_stubs_init_p()
Tcl_Interp *
-#ifdef HAVE_PROTOTYPES
+#ifdef RUBY_VM
ruby_tcl_create_ip_and_stubs_init(int *st)
#else
ruby_tcl_create_ip_and_stubs_init(st)
@@ -290,7 +290,7 @@ ruby_tcl_stubs_init()
}
int
-#ifdef HAVE_PROTOTYPES
+#ifdef RUBY_VM
ruby_tk_stubs_init(Tcl_Interp *tcl_ip)
#else
ruby_tk_stubs_init(tcl_ip)
@@ -318,7 +318,7 @@ ruby_tk_stubs_init(tcl_ip)
if ((*p_Tk_Init)(tcl_ip) == TCL_ERROR)
return FAIL_Tk_Init;
- if (!Tk_InitStubs(tcl_ip, (char *)"8.1", 0))
+ if (!Tk_InitStubs(tcl_ip, "8.1", 0))
return FAIL_Tk_InitStubs;
#ifdef __MACOS__
@@ -330,7 +330,7 @@ ruby_tk_stubs_init(tcl_ip)
}
int
-#ifdef HAVE_PROTOTYPES
+#ifdef RUBY_VM
ruby_tk_stubs_safeinit(Tcl_Interp *tcl_ip)
#else
ruby_tk_stubs_safeinit(tcl_ip)
@@ -357,7 +357,7 @@ ruby_tk_stubs_safeinit(tcl_ip)
if ((*p_Tk_SafeInit)(tcl_ip) == TCL_ERROR)
return FAIL_Tk_Init;
- if (!Tk_InitStubs(tcl_ip, (char *)"8.1", 0))
+ if (!Tk_InitStubs(tcl_ip, "8.1", 0))
return FAIL_Tk_InitStubs;
#ifdef __MACOS__
@@ -421,7 +421,7 @@ static int open_tcl_dll = 0;
static int call_tk_stubs_init = 0;
int
-#ifdef HAVE_PROTOTYPES
+#ifdef RUBY_VM
ruby_open_tcl_dll(char *appname)
#else
ruby_open_tcl_dll(appname)
@@ -450,7 +450,7 @@ ruby_open_tk_dll()
}
int
-#ifdef HAVE_PROTOTYPES
+#ifdef RUBY_VM
ruby_open_tcltk_dll(char *appname)
#else
ruby_open_tcltk_dll(appname)
@@ -473,7 +473,7 @@ tk_stubs_init_p()
}
Tcl_Interp *
-#ifdef HAVE_PROTOTYPES
+#ifdef RUBY_VM
ruby_tcl_create_ip_and_stubs_init(int *st)
#else
ruby_tcl_create_ip_and_stubs_init(st)
@@ -506,7 +506,7 @@ ruby_tcl_stubs_init()
}
int
-#ifdef HAVE_PROTOTYPES
+#ifdef RUBY_VM
ruby_tk_stubs_init(Tcl_Interp *tcl_ip)
#else
ruby_tk_stubs_init(tcl_ip)
@@ -527,7 +527,7 @@ ruby_tk_stubs_init(tcl_ip)
}
int
-#ifdef HAVE_PROTOTYPES
+#ifdef RUBY_VM
ruby_tk_stubs_safeinit(Tcl_Interp *tcl_ip)
#else
ruby_tk_stubs_safeinit(tcl_ip)
diff --git a/ext/tk/tcltklib.c b/ext/tk/tcltklib.c
index cc3c0e9b8d..8701cfef27 100644
--- a/ext/tk/tcltklib.c
+++ b/ext/tk/tcltklib.c
@@ -4,34 +4,18 @@
* Oct. 24, 1997 Y. Matsumoto
*/
-#define TCLTKLIB_RELEASE_DATE "2009-07-12"
+#define TCLTKLIB_RELEASE_DATE "2008-05-23"
#include "ruby.h"
-#ifdef HAVE_RUBY_ENCODING_H
-#include "ruby/encoding.h"
-#endif
-#ifndef HAVE_RUBY_RUBY_H
-#include "version.h"
-#endif
-
#ifdef RUBY_VM
-static VALUE rb_thread_critical; /* dummy */
-int rb_thread_check_trap_pending();
+/* #include "ruby/ruby.h" */
+#include "ruby/signal.h"
+#include "ruby/encoding.h"
#else
-/* use rb_thread_critical on Ruby 1.8.x */
+/* #include "ruby.h" */
#include "rubysig.h"
-#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
-
-#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));
+#include "version.h"
#endif
#undef EXTERN /* avoid conflict with tcl.h of tcl8.2 or before */
@@ -47,33 +31,19 @@ extern VALUE rb_proc_new _((VALUE (*)(ANYARGS/* VALUE yieldarg[, VALUE procarg]
#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 */
-#endif
-#ifndef HAVE_RB_SAFE_LEVEL
-#define rb_safe_level() (ruby_safe_level+0) /* cannot be l-value */
-#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" */
+#define TCL_ALPHA_RELEASE 0
+#define TCL_BETA_RELEASE 1
+#define TCL_FINAL_RELEASE 2
#endif
static struct {
int major;
int minor;
- int type; /* ALPHA==0, BETA==1, FINAL==2 */
int patchlevel;
+ int type;
} tcltk_version = {0, 0, 0, 0};
static void
@@ -108,14 +78,6 @@ set_tcltk_version()
# 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
@@ -139,16 +101,16 @@ fprintf(stderr, ARG1, ARG2, ARG3); fprintf(stderr, "\n"); fflush(stderr); }
*/
/* release date */
-static const char tcltklib_release_date[] = TCLTKLIB_RELEASE_DATE;
+const char tcltklib_release_date[] = TCLTKLIB_RELEASE_DATE;
/* finalize_proc_name */
-static const char finalize_hook_name[] = "INTERP_FINALIZE_HOOK";
+static char *finalize_hook_name = "INTERP_FINALIZE_HOOK";
static void ip_finalize _((Tcl_Interp*));
static int at_exit = 0;
-#ifdef HAVE_RUBY_ENCODING_H
+#ifdef RUBY_VM
static VALUE cRubyEncoding;
/* encoding */
@@ -211,15 +173,14 @@ 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 char *Tcl_ObjTypeName_ByteArray = "bytearray";
+static Tcl_ObjType *Tcl_ObjType_ByteArray;
-static const char Tcl_ObjTypeName_String[] = "string";
-static CONST86 Tcl_ObjType *Tcl_ObjType_String;
+static char *Tcl_ObjTypeName_String = "string";
+static 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)
@@ -234,7 +195,7 @@ static CONST86 Tcl_ObjType *Tcl_ObjType_String;
/* safe Tcl_Eval and Tcl_GlobalEval */
static int
-#ifdef HAVE_PROTOTYPES
+#ifdef RUBY_VM
tcl_eval(Tcl_Interp *interp, const char *cmd)
#else
tcl_eval(interp, cmd)
@@ -255,7 +216,7 @@ tcl_eval(interp, cmd)
#define Tcl_Eval tcl_eval
static int
-#ifdef HAVE_PROTOTYPES
+#ifdef RUBY_VM
tcl_global_eval(Tcl_Interp *interp, const char *cmd)
#else
tcl_global_eval(interp, cmd)
@@ -432,12 +393,11 @@ call_queue_mark(struct call_queue *q)
static VALUE eventloop_thread;
-static Tcl_Interp *eventloop_interp;
-#ifdef RUBY_USE_NATIVE_THREAD
+#ifdef RUBY_VM
Tcl_ThreadId tk_eventloop_thread_id; /* native thread ID of Tcl interpreter */
#endif
static VALUE eventloop_stack;
-static int window_event_mode = ~0;
+static int window_event_mode = ( ~ TCL_IDLE_EVENTS | TCL_WINDOW_EVENTS );
static VALUE watchdog_thread;
@@ -449,15 +409,9 @@ Tcl_Interp *current_interp;
: 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;
@@ -470,14 +424,14 @@ static int have_rb_thread_waiting_for_value = 0;
* '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
+#ifdef RUBY_VM
#define DEFAULT_EVENT_LOOP_MAX 800/*counts*/
#define DEFAULT_NO_EVENT_TICK 10/*counts*/
-#define DEFAULT_NO_EVENT_WAIT 1/*milliseconds ( 1 -- 999 ) */
+#define DEFAULT_NO_EVENT_WAIT 10/*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 */
+#else /* ! RUBY_VM */
#define DEFAULT_EVENT_LOOP_MAX 800/*counts*/
#define DEFAULT_NO_EVENT_TICK 10/*counts*/
#define DEFAULT_NO_EVENT_WAIT 20/*milliseconds ( 1 -- 999 ) */
@@ -486,8 +440,6 @@ static int have_rb_thread_waiting_for_value = 0;
#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;
@@ -721,7 +673,7 @@ struct tcltkip {
#if TCL_NAMESPACE_DEBUG
Tcl_Namespace *default_ns; /* default namespace */
#endif
-#ifdef RUBY_USE_NATIVE_THREAD
+#ifdef RUBY_VM
Tcl_ThreadId tk_thread_id; /* native thread ID of Tcl interpreter */
#endif
int has_orig_exit; /* has original 'exit' command ? */
@@ -914,7 +866,7 @@ tcltkip_init_tk(interp)
}
#endif
-#ifdef RUBY_USE_NATIVE_THREAD
+#ifdef RUBY_VM
ptr->tk_thread_id = Tcl_GetCurrentThread();
#endif
@@ -1071,12 +1023,12 @@ call_original_exit(ptr, state)
} else {
/* string interface */
- CONST84 char **argv;
+ char **argv;
#define USE_RUBY_ALLOC 0
#if USE_RUBY_ALLOC
- argv = ALLOC_N(char *, 3); /* XXXXXXXXXX */
+ argv = (char **)ALLOC_N(char *, 3); /* XXXXXXXXXX */
#else /* not USE_RUBY_ALLOC */
- argv = (CONST84 char **)ckalloc(sizeof(char *) * 3);
+ argv = (char **)ckalloc(sizeof(char *) * 3);
#if 0 /* use Tcl_Preserve/Release */
Tcl_Preserve((ClientData)argv); /* XXXXXXXX */
#endif
@@ -1086,7 +1038,8 @@ call_original_exit(ptr, state)
argv[1] = Tcl_GetStringFromObj(state_obj, (int*)NULL);
argv[2] = (char *)NULL;
- ptr->return_value = (*(info->proc))(info->clientData, ptr->ip, 2, argv);
+ ptr->return_value = (*(info->proc))(info->clientData, ptr->ip,
+ 2, (CONST84 char **)argv);
#if USE_RUBY_ALLOC
free(argv);
@@ -1185,7 +1138,7 @@ _timer_for_tcl(clientData)
/* tick_counter += event_loop_max; */
}
-#ifdef RUBY_USE_NATIVE_THREAD
+#ifdef RUBY_VM
#if USE_TOGGLE_WINDOW_MODE_FOR_IDLE
static int
toggle_eventloop_window_mode_for_idle()
@@ -1215,7 +1168,7 @@ set_eventloop_window_mode(self, mode)
if (RTEST(mode)) {
window_event_mode = ~0;
} else {
- window_event_mode = ~TCL_WINDOW_EVENTS;
+ window_event_mode = ~(TCL_WINDOW_EVENTS | TCL_IDLE_EVENTS);
}
return mode;
@@ -1528,7 +1481,7 @@ static VALUE
lib_num_of_mainwindows(self)
VALUE self;
{
-#ifdef RUBY_USE_NATIVE_THREAD /* Ruby 1.9+ !!! */
+#ifdef RUBY_VM /* 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);
@@ -1536,7 +1489,7 @@ lib_num_of_mainwindows(self)
}
-#ifdef RUBY_USE_NATIVE_THREAD /* Ruby 1.9+ !!! */
+#ifdef RUBY_VM /* Ruby 1.9+ !!! */
static VALUE
call_DoOneEvent_core(flag_val)
VALUE flag_val;
@@ -1581,19 +1534,21 @@ eventloop_sleep(dummy)
{
struct timeval t;
- if (no_event_wait <= 0) {
- return Qnil;
- }
-
t.tv_sec = (time_t)0;
- t.tv_usec = (long)(no_event_wait*1000.0);
+ t.tv_usec = (time_t)(no_event_wait*1000.0);
#ifdef HAVE_NATIVETHREAD
-#ifndef RUBY_USE_NATIVE_THREAD
+#ifdef RUBY_VM
+#if 0
if (!ruby_native_thread_p()) {
rb_bug("cross-thread violation on eventloop_sleep()");
}
#endif
+#else
+ if (!is_ruby_native_thread()) {
+ rb_bug("cross-thread violation on eventloop_sleep()");
+ }
+#endif
#endif
DUMP2("eventloop_sleep: rb_thread_wait_for() at thread : %lx", rb_thread_current());
@@ -1601,11 +1556,17 @@ eventloop_sleep(dummy)
DUMP2("eventloop_sleep: finish at thread : %lx", rb_thread_current());
#ifdef HAVE_NATIVETHREAD
-#ifndef RUBY_USE_NATIVE_THREAD
+#ifdef RUBY_VM
+#if 0
if (!ruby_native_thread_p()) {
rb_bug("cross-thread violation on eventloop_sleep()");
}
#endif
+#else
+ if (!is_ruby_native_thread()) {
+ rb_bug("cross-thread violation on eventloop_sleep()");
+ }
+#endif
#endif
return Qnil;
@@ -1617,7 +1578,7 @@ eventloop_sleep(dummy)
static int
get_thread_alone_check_flag()
{
-#ifdef RUBY_USE_NATIVE_THREAD
+#ifdef RUBY_VM
return 0;
#else
set_tcltk_version();
@@ -1649,53 +1610,6 @@ get_thread_alone_check_flag()
}
#endif
-#define TRAP_CHECK() do { \
- if (trap_check(check_var) == 0) return 0; \
-} while (0)
-
-static int
-trap_check(int *check_var)
-{
- DUMP1("trap check");
-
-#ifdef RUBY_VM
- if (rb_thread_check_trap_pending()) {
- if (check_var != (int*)NULL) {
- /* wait command */
- return 0;
- }
- else {
- rb_thread_check_ints();
- }
- }
-#else
- if (rb_trap_pending) {
- run_timer_flag = 0;
- if (rb_prohibit_interrupt || check_var != (int*)NULL) {
- /* pending or on wait command */
- return 0;
- } else {
- rb_trap_exec();
- }
- }
-#endif
-
- return 1;
-}
-
-static int
-check_eventloop_interp()
-{
- DUMP1("check eventloop_interp");
- if (eventloop_interp != (Tcl_Interp*)NULL
- && Tcl_InterpDeleted(eventloop_interp)) {
- DUMP2("eventloop_interp(%p) was deleted", eventloop_interp);
- return 1;
- }
-
- return 0;
-}
-
static int
lib_eventloop_core(check_root, update_flag, check_var, interp)
int check_root;
@@ -1717,7 +1631,7 @@ lib_eventloop_core(check_root, update_flag, check_var, interp)
if (update_flag) DUMP1("update loop start!!");
t.tv_sec = (time_t)0;
- t.tv_usec = (long)(no_event_wait*1000.0);
+ t.tv_usec = (time_t)(no_event_wait*1000.0);
Tcl_DeleteTimerHandler(timer_token);
run_timer_flag = 0;
@@ -1737,8 +1651,6 @@ lib_eventloop_core(check_root, update_flag, check_var, interp)
#endif
for(;;) {
- if (check_eventloop_interp()) return 0;
-
#if USE_EVLOOP_THREAD_ALONE_CHECK_FLAG
if (thread_alone_check_flag && rb_thread_alone()) {
#else
@@ -1778,11 +1690,19 @@ lib_eventloop_core(check_root, update_flag, check_var, interp)
if (status) {
switch (status) {
case TAG_RAISE:
+#ifdef RUBY_VM
if (NIL_P(rb_errinfo())) {
+#else
+ if (NIL_P(ruby_errinfo)) {
+#endif
rbtk_pending_exception
= rb_exc_new2(rb_eException, "unknown exception");
} else {
+#ifdef RUBY_VM
rbtk_pending_exception = rb_errinfo();
+#else
+ rbtk_pending_exception = ruby_errinfo;
+#endif
if (!NIL_P(rbtk_pending_exception)) {
if (rbtk_eventloop_depth == 0) {
@@ -1797,10 +1717,18 @@ lib_eventloop_core(check_root, update_flag, check_var, interp)
break;
case TAG_FATAL:
+#ifdef RUBY_VM
if (NIL_P(rb_errinfo())) {
+#else
+ if (NIL_P(ruby_errinfo)) {
+#endif
rb_exc_raise(rb_exc_new2(rb_eFatal, "FATAL"));
} else {
+#ifdef RUBY_VM
rb_exc_raise(rb_errinfo());
+#else
+ rb_exc_raise(ruby_errinfo);
+#endif
}
}
}
@@ -1830,13 +1758,28 @@ lib_eventloop_core(check_root, update_flag, check_var, interp)
}
}
- TRAP_CHECK();
- if (check_eventloop_interp()) return 0;
+ DUMP1("trap check");
+ 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();
+ }
+ }
- DUMP1("check Root Widget");
+ DUMP1("check Root Widget");
if (check_root && tk_stubs_init_p() && Tk_GetNumMainWindows() == 0) {
run_timer_flag = 0;
- TRAP_CHECK();
+ if (rb_trap_pending) {
+ if (rb_prohibit_interrupt || check_var != (int*)NULL) {
+ /* pending or on wait command */
+ return 0;
+ } else {
+ rb_trap_exec();
+ }
+ }
return 1;
}
@@ -1876,7 +1819,7 @@ lib_eventloop_core(check_root, update_flag, check_var, interp)
if (NIL_P(eventloop_thread) || current == eventloop_thread) {
int st;
int status;
-#ifdef RUBY_USE_NATIVE_THREAD
+#ifdef RUBY_VM
if (update_flag) {
st = RTEST(rb_protect(call_DoOneEvent,
INT2FIX(event_flag), &status));
@@ -1912,12 +1855,20 @@ lib_eventloop_core(check_root, update_flag, check_var, interp)
if (status) {
switch (status) {
case TAG_RAISE:
+#ifdef RUBY_VM
if (NIL_P(rb_errinfo())) {
+#else
+ if (NIL_P(ruby_errinfo)) {
+#endif
rbtk_pending_exception
= rb_exc_new2(rb_eException,
"unknown exception");
} else {
+#ifdef RUBY_VM
rbtk_pending_exception = rb_errinfo();
+#else
+ rbtk_pending_exception = ruby_errinfo;
+#endif
if (!NIL_P(rbtk_pending_exception)) {
if (rbtk_eventloop_depth == 0) {
@@ -1932,10 +1883,18 @@ lib_eventloop_core(check_root, update_flag, check_var, interp)
break;
case TAG_FATAL:
+#ifdef RUBY_VM
if (NIL_P(rb_errinfo())) {
+#else
+ if (NIL_P(ruby_errinfo)) {
+#endif
rb_exc_raise(rb_exc_new2(rb_eFatal, "FATAL"));
} else {
+#ifdef RUBY_VM
rb_exc_raise(rb_errinfo());
+#else
+ rb_exc_raise(ruby_errinfo);
+#endif
}
}
}
@@ -1946,7 +1905,16 @@ lib_eventloop_core(check_root, update_flag, check_var, interp)
return 0;
}
- TRAP_CHECK();
+ DUMP1("trap check");
+ 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();
+ }
+ }
if (check_var != (int*)NULL
&& !NIL_P(rbtk_pending_exception)) {
@@ -1976,12 +1944,20 @@ lib_eventloop_core(check_root, update_flag, check_var, interp)
if (status) {
switch (status) {
case TAG_RAISE:
+#ifdef RUBY_VM
if (NIL_P(rb_errinfo())) {
+#else
+ if (NIL_P(ruby_errinfo)) {
+#endif
rbtk_pending_exception
= rb_exc_new2(rb_eException,
"unknown exception");
} else {
+#ifdef RUBY_VM
rbtk_pending_exception = rb_errinfo();
+#else
+ rbtk_pending_exception = ruby_errinfo;
+#endif
if (!NIL_P(rbtk_pending_exception)) {
if (rbtk_eventloop_depth == 0) {
@@ -1996,11 +1972,19 @@ lib_eventloop_core(check_root, update_flag, check_var, interp)
break;
case TAG_FATAL:
+#ifdef RUBY_VM
if (NIL_P(rb_errinfo())) {
+#else
+ if (NIL_P(ruby_errinfo)) {
+#endif
rb_exc_raise(rb_exc_new2(rb_eFatal,
"FATAL"));
} else {
+#ifdef RUBY_VM
rb_exc_raise(rb_errinfo());
+#else
+ rb_exc_raise(ruby_errinfo);
+#endif
}
}
}
@@ -2017,13 +2001,28 @@ lib_eventloop_core(check_root, update_flag, check_var, interp)
return 1;
}
- TRAP_CHECK();
- if (check_eventloop_interp()) return 0;
+ DUMP1("trap check");
+ 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();
+ }
+ }
DUMP1("check Root Widget");
if (check_root && tk_stubs_init_p() && Tk_GetNumMainWindows() == 0) {
run_timer_flag = 0;
- TRAP_CHECK();
+ if (rb_trap_pending) {
+ if (rb_prohibit_interrupt || check_var != (int*)NULL) {
+ /* pending or on wait command */
+ return 0;
+ } else {
+ rb_trap_exec();
+ }
+ }
return 1;
}
@@ -2046,7 +2045,7 @@ lib_eventloop_core(check_root, update_flag, check_var, interp)
}
DUMP1("trap check & thread scheduling");
-#ifdef RUBY_USE_NATIVE_THREAD
+#ifdef RUBY_VM
/* if (update_flag == 0) CHECK_INTS; */ /*XXXXXXXXXXXXX TODO !!!! */
#else
if (update_flag == 0) CHECK_INTS;
@@ -2097,19 +2096,35 @@ lib_eventloop_main(args)
switch (status) {
case TAG_RAISE:
+#ifdef RUBY_VM
if (NIL_P(rb_errinfo())) {
+#else
+ if (NIL_P(ruby_errinfo)) {
+#endif
rbtk_pending_exception
= rb_exc_new2(rb_eException, "unknown exception");
} else {
+#ifdef RUBY_VM
rbtk_pending_exception = rb_errinfo();
+#else
+ rbtk_pending_exception = ruby_errinfo;
+#endif
}
return Qnil;
case TAG_FATAL:
+#ifdef RUBY_VM
if (NIL_P(rb_errinfo())) {
+#else
+ if (NIL_P(ruby_errinfo)) {
+#endif
rbtk_pending_exception = rb_exc_new2(rb_eFatal, "FATAL");
} else {
+#ifdef RUBY_VM
rbtk_pending_exception = rb_errinfo();
+#else
+ rbtk_pending_exception = ruby_errinfo;
+#endif
}
return Qnil;
}
@@ -2155,11 +2170,8 @@ lib_eventloop_ensure(args)
break;
}
-#ifdef RUBY_VM
- if (RTEST(rb_funcall(eventloop_thread, ID_alive_p, 0, 0))) {
-#else
+ /* if (RTEST(rb_funcall(eventloop_thread, ID_alive_p, 0, 0))) { */
if (RTEST(rb_thread_alive_p(eventloop_thread))) {
-#endif
DUMP2("eventloop-enshure: wake up parent %lx", eventloop_thread);
rb_thread_wakeup(eventloop_thread);
@@ -2167,7 +2179,7 @@ lib_eventloop_ensure(args)
}
}
-#ifdef RUBY_USE_NATIVE_THREAD
+#ifdef RUBY_VM
if (NIL_P(eventloop_thread)) {
tk_eventloop_thread_id = (Tcl_ThreadId) 0;
}
@@ -2196,7 +2208,7 @@ lib_eventloop_launcher(check_root, update_flag, check_var, interp)
tcl_stubs_check();
eventloop_thread = rb_thread_current();
-#ifdef RUBY_USE_NATIVE_THREAD
+#ifdef RUBY_VM
tk_eventloop_thread_id = Tcl_GetCurrentThread();
#endif
@@ -2262,7 +2274,6 @@ ip_mainloop(argc, argv, self)
VALUE *argv;
VALUE self;
{
- volatile VALUE ret;
struct tcltkip *ptr = get_ip(self);
/* ip is deleted? */
@@ -2274,11 +2285,7 @@ ip_mainloop(argc, argv, self)
/* slave IP */
return Qnil;
}
-
- eventloop_interp = ptr->ip;
- ret = lib_mainloop(argc, argv, self);
- eventloop_interp = (Tcl_Interp*)NULL;
- return ret;
+ return lib_mainloop(argc, argv, self);
}
@@ -2303,9 +2310,9 @@ lib_watchdog_core(check_rootwidget)
struct timeval t0, t1;
t0.tv_sec = (time_t)0;
- t0.tv_usec = (long)((NO_THREAD_INTERRUPT_TIME)*1000.0);
+ t0.tv_usec = (time_t)((NO_THREAD_INTERRUPT_TIME)*1000.0);
t1.tv_sec = (time_t)0;
- t1.tv_usec = (long)((WATCHDOG_INTERVAL)*1000.0);
+ t1.tv_usec = (time_t)((WATCHDOG_INTERVAL)*1000.0);
/* check other watchdog thread */
if (!NIL_P(watchdog_thread)) {
@@ -2354,7 +2361,7 @@ lib_watchdog_ensure(arg)
VALUE arg;
{
eventloop_thread = Qnil; /* stop eventloops */
-#ifdef RUBY_USE_NATIVE_THREAD
+#ifdef RUBY_VM
tk_eventloop_thread_id = (Tcl_ThreadId) 0;
#endif
return Qnil;
@@ -2482,11 +2489,8 @@ lib_thread_callback(argc, argv, self)
foundEvent = RTEST(lib_eventloop_launcher(/* not check root-widget */0, 0,
q->done, (Tcl_Interp*)NULL));
-#ifdef RUBY_VM
- if (RTEST(rb_funcall(th, ID_alive_p, 0))) {
-#else
+ /* if (RTEST(rb_funcall(th, ID_alive_p, 0))) { */
if (RTEST(rb_thread_alive_p(th))) {
-#endif
rb_funcall(th, ID_kill, 0);
ret = Qnil;
} else {
@@ -2499,10 +2503,17 @@ lib_thread_callback(argc, argv, self)
/* ckfree((char*)q); */
if (NIL_P(rbtk_pending_exception)) {
+#ifdef RUBY_VM
/* return rb_errinfo(); */
if (status) {
rb_exc_raise(rb_errinfo());
}
+#else
+ /* return ruby_errinfo; */
+ if (status) {
+ rb_exc_raise(ruby_errinfo);
+ }
+#endif
} else {
VALUE exc = rbtk_pending_exception;
rbtk_pending_exception = Qnil;
@@ -2717,50 +2728,94 @@ tcl_protect_core(interp, proc, data) /* should not raise exception */
goto error;
error:
str = rb_str_new2("LocalJumpError: ");
+#ifdef RUBY_VM
rb_str_append(str, rb_obj_as_string(rb_errinfo()));
+#else
+ rb_str_append(str, rb_obj_as_string(ruby_errinfo));
+#endif
exc = rb_exc_new3(type, str);
break;
case TAG_RETRY:
+#ifdef RUBY_VM
if (NIL_P(rb_errinfo())) {
+#else
+ if (NIL_P(ruby_errinfo)) {
+#endif
DUMP1("rb_protect: retry");
exc = rb_exc_new2(eTkCallbackRetry, "retry jump error");
} else {
+#ifdef RUBY_VM
exc = rb_errinfo();
+#else
+ exc = ruby_errinfo;
+#endif
}
break;
case TAG_REDO:
+#ifdef RUBY_VM
if (NIL_P(rb_errinfo())) {
+#else
+ if (NIL_P(ruby_errinfo)) {
+#endif
DUMP1("rb_protect: redo");
exc = rb_exc_new2(eTkCallbackRedo, "redo jump error");
} else {
+#ifdef RUBY_VM
exc = rb_errinfo();
+#else
+ exc = ruby_errinfo;
+#endif
}
break;
case TAG_RAISE:
+#ifdef RUBY_VM
if (NIL_P(rb_errinfo())) {
+#else
+ if (NIL_P(ruby_errinfo)) {
+#endif
exc = rb_exc_new2(rb_eException, "unknown exception");
} else {
+#ifdef RUBY_VM
exc = rb_errinfo();
+#else
+ exc = ruby_errinfo;
+#endif
}
break;
case TAG_FATAL:
+#ifdef RUBY_VM
if (NIL_P(rb_errinfo())) {
+#else
+ if (NIL_P(ruby_errinfo)) {
+#endif
exc = rb_exc_new2(rb_eFatal, "FATAL");
} else {
+#ifdef RUBY_VM
exc = rb_errinfo();
+#else
+ exc = ruby_errinfo;
+#endif
}
break;
case TAG_THROW:
+#ifdef RUBY_VM
if (NIL_P(rb_errinfo())) {
+#else
+ if (NIL_P(ruby_errinfo)) {
+#endif
DUMP1("rb_protect: throw");
exc = rb_exc_new2(eTkCallbackThrow, "throw jump error");
} else {
+#ifdef RUBY_VM
exc = rb_errinfo();
+#else
+ exc = ruby_errinfo;
+#endif
}
break;
@@ -2864,26 +2919,26 @@ tcl_protect(interp, proc, data)
VALUE (*proc)();
VALUE data;
{
+ int old_trapflag = rb_trap_immediate;
int code;
#ifdef HAVE_NATIVETHREAD
-#ifndef RUBY_USE_NATIVE_THREAD
+#ifdef RUBY_VM
+#if 0
if (!ruby_native_thread_p()) {
rb_bug("cross-thread violation on tcl_protect()");
}
#endif
+#else
+ if (!is_ruby_native_thread()) {
+ rb_bug("cross-thread violation on tcl_protect()");
+ }
+#endif
#endif
-#ifdef RUBY_VM
+ rb_trap_immediate = 0;
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
+ rb_trap_immediate = old_trapflag;
return code;
}
@@ -2978,7 +3033,6 @@ ip_ruby_cmd_core(arg)
thr_crit_bup = rb_thread_critical;
rb_thread_critical = Qfalse;
ret = rb_apply(arg->receiver, arg->method, arg->args);
- DUMP2("rb_apply return:%lx", ret);
rb_thread_critical = thr_crit_bup;
DUMP1("finish ip_ruby_cmd_core");
@@ -2992,9 +3046,7 @@ 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
@@ -3044,9 +3096,8 @@ ip_ruby_cmd_receiver_get(str)
char *str;
{
volatile VALUE receiver;
-#if !SUPPORT_NESTED_CONST_AS_IP_RUBY_CMD_RECEIVER
+ volatile VALUE klass = rb_cObject;
int state;
-#endif
if (str[0] == ':' || ('A' <= str[0] && str[0] <= 'Z')) {
/* class | module | constant */
@@ -3162,20 +3213,26 @@ ip_ruby_cmd(clientData, interp, argc, argv)
/* get args */
args = rb_ary_new2(argc - 2);
+#ifdef RUBY_VM
+#else
+ RARRAY(args)->len = 0;
+#endif
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);
+#ifdef RUBY_VM
+ rb_ary_push(args, rb_tainted_str_new(str, len));
#else
- RARRAY(args)->ptr[RARRAY(args)->len++] = s;
+ RARRAY(args)->ptr[RARRAY(args)->len++] = rb_tainted_str_new(str, len);
+#endif
+#else /* TCL_MAJOR_VERSION < 8 */
+ DUMP2("arg:%s",argv[i]);
+#ifdef RUBY_VM
+ rb_ary_push(args, rb_tainted_str_new2(argv[i]));
+#else
+ RARRAY(args)->ptr[RARRAY(args)->len++] = rb_tainted_str_new2(argv[i]);
+#endif
#endif
}
@@ -3372,11 +3429,17 @@ ip_rbUpdateCommand(clientData, interp, objc, objv)
return TCL_ERROR;
}
#ifdef HAVE_NATIVETHREAD
-#ifndef RUBY_USE_NATIVE_THREAD
+#ifdef RUBY_VM
+#if 0
if (!ruby_native_thread_p()) {
rb_bug("cross-thread violation on ip_ruby_eval()");
}
#endif
+#else
+ if (!is_ruby_native_thread()) {
+ rb_bug("cross-thread violation on ip_ruby_eval()");
+ }
+#endif
#endif
Tcl_ResetResult(interp);
@@ -3447,11 +3510,7 @@ ip_rbUpdateCommand(clientData, interp, objc, objv)
}
/* trap check */
-#ifdef RUBY_VM
- if (rb_thread_check_trap_pending()) {
-#else
if (rb_trap_pending) {
-#endif
Tcl_Release(interp);
return TCL_RETURN;
@@ -3519,7 +3578,6 @@ ip_rb_threadUpdateCommand(clientData, interp, objc, objv)
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) {
@@ -3528,11 +3586,17 @@ ip_rb_threadUpdateCommand(clientData, interp, objc, objv)
return TCL_ERROR;
}
#ifdef HAVE_NATIVETHREAD
-#ifndef RUBY_USE_NATIVE_THREAD
+#ifdef RUBY_VM
+#if 0
if (!ruby_native_thread_p()) {
rb_bug("cross-thread violation on ip_rb_threadUpdateCommand()");
}
#endif
+#else
+ if (!is_ruby_native_thread()) {
+ rb_bug("cross-thread violation on ip_rb_threadUpdateCommand()");
+ }
+#endif
#endif
if (rb_thread_alone()
@@ -3607,17 +3671,10 @@ ip_rb_threadUpdateCommand(clientData, interp, objc, objv)
DUMP1("set idle proc");
Tcl_DoWhenIdle(rb_threadUpdateProc, (ClientData) param);
- t.tv_sec = (time_t)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;
- }
+ DUMP1("wait for complete idle proc");
+ /* rb_thread_stop(); */
+ rb_thread_sleep_forever();
}
#if 0 /* use Tcl_EventuallyFree */
@@ -3728,11 +3785,17 @@ ip_rbVwaitCommand(clientData, interp, objc, objv)
Tcl_Preserve(interp);
#ifdef HAVE_NATIVETHREAD
-#ifndef RUBY_USE_NATIVE_THREAD
+#ifdef RUBY_VM
+#if 0
if (!ruby_native_thread_p()) {
rb_bug("cross-thread violation on ip_rbVwaitCommand()");
}
#endif
+#else
+ if (!is_ruby_native_thread()) {
+ rb_bug("cross-thread violation on ip_rbVwaitCommand()");
+ }
+#endif
#endif
Tcl_ResetResult(interp);
@@ -3825,11 +3888,7 @@ ip_rbVwaitCommand(clientData, interp, objc, objv)
}
/* trap check */
-#ifdef RUBY_VM
- if (rb_thread_check_trap_pending()) {
-#else
if (rb_trap_pending) {
-#endif
#if TCL_MAJOR_VERSION >= 8
Tcl_DecrRefCount(objv[1]);
#endif
@@ -4118,11 +4177,7 @@ ip_rbTkWaitCommand(clientData, interp, objc, objv)
}
/* trap check */
-#ifdef RUBY_VM
- if (rb_thread_check_trap_pending()) {
-#else
- if (rb_trap_pending) {
-#endif
+ if (rb_trap_pending) {
Tcl_Release(interp);
return TCL_RETURN;
@@ -4182,11 +4237,7 @@ ip_rbTkWaitCommand(clientData, interp, objc, objv)
}
/* trap check */
-#ifdef RUBY_VM
- if (rb_thread_check_trap_pending()) {
-#else
- if (rb_trap_pending) {
-#endif
+ if (rb_trap_pending) {
#if TCL_MAJOR_VERSION >= 8
Tcl_DecrRefCount(objv[2]);
#endif
@@ -4281,11 +4332,7 @@ ip_rbTkWaitCommand(clientData, interp, objc, objv)
}
/* trap check */
-#ifdef RUBY_VM
- if (rb_thread_check_trap_pending()) {
-#else
- if (rb_trap_pending) {
-#endif
+ if (rb_trap_pending) {
Tcl_Release(interp);
return TCL_RETURN;
@@ -4405,7 +4452,6 @@ ip_rb_threadVwaitCommand(clientData, interp, objc, objv)
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) {
@@ -4500,16 +4546,9 @@ ip_rb_threadVwaitCommand(clientData, interp, objc, objv)
return TCL_ERROR;
}
- t.tv_sec = (time_t)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;
- }
+ /* rb_thread_stop(); */
+ rb_thread_sleep_forever();
}
thr_crit_bup = rb_thread_critical;
@@ -4568,7 +4607,6 @@ ip_rb_threadTkWaitCommand(clientData, interp, objc, objv)
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) {
@@ -4722,16 +4760,9 @@ ip_rb_threadTkWaitCommand(clientData, interp, objc, objv)
return TCL_ERROR;
}
- t.tv_sec = (time_t)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;
- }
+ /* rb_thread_stop(); */
+ rb_thread_sleep_forever();
}
thr_crit_bup = rb_thread_critical;
@@ -4808,17 +4839,10 @@ ip_rb_threadTkWaitCommand(clientData, interp, objc, objv)
rb_thread_critical = thr_crit_bup;
- t.tv_sec = (time_t)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;
- }
+ if (param->done == TKWAIT_MODE_DESTROY) break;
+ /* rb_thread_stop(); */
+ rb_thread_sleep_forever();
}
thr_crit_bup = rb_thread_critical;
@@ -4930,16 +4954,9 @@ ip_rb_threadTkWaitCommand(clientData, interp, objc, objv)
rb_thread_critical = thr_crit_bup;
- t.tv_sec = (time_t)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;
- }
+ /* rb_thread_stop(); */
+ rb_thread_sleep_forever();
}
Tcl_Release(window);
@@ -5204,9 +5221,7 @@ ip_finalize(ip)
}
/* delete root widget */
-#ifdef RUBY_VM
- /* cause SEGV on Ruby 1.9 */
-#else
+#if 1
DUMP1("check `destroy'");
if (Tcl_GetCommandInfo(ip, "destroy", &info)) {
DUMP1("call `destroy .'");
@@ -5425,7 +5440,7 @@ ip_rbNamespaceObjCmd(clientData, interp, objc, objv)
}
rbtk_eventloop_depth++;
- /* DUMP2("namespace wrapper enter depth == %d", rbtk_eventloop_depth); */
+ DUMP2("namespace wrapper enter depth == %d", rbtk_eventloop_depth);
if (info.isNativeObjectProc) {
ret = (*(info.objProc))(info.objClientData, interp, objc, objv);
@@ -5461,7 +5476,7 @@ ip_rbNamespaceObjCmd(clientData, interp, objc, objv)
#endif
}
- /* DUMP2("namespace wrapper exit depth == %d", rbtk_eventloop_depth); */
+ DUMP2("namespace wrapper exit depth == %d", rbtk_eventloop_depth);
rbtk_eventloop_depth--;
return ret;
@@ -5529,10 +5544,19 @@ ip_init(argc, argv, self)
Tk_Window mainWin = (Tk_Window)NULL;
/* security check */
+#ifdef RUBY_VM
if (rb_safe_level() >= 4) {
+#else
+ if (ruby_safe_level >= 4) {
+#endif
rb_raise(rb_eSecurityError,
"Cannot create a TclTkIp object at level %d",
- rb_safe_level());
+#ifdef RUBY_VM
+ rb_safe_level()
+#else
+ ruby_safe_level
+#endif
+ );
}
/* create object */
@@ -5540,7 +5564,7 @@ ip_init(argc, argv, self)
ptr = ALLOC(struct tcltkip);
/* ptr = (struct tcltkip *)ckalloc(sizeof(struct tcltkip)); */
DATA_PTR(self) = ptr;
-#ifdef RUBY_USE_NATIVE_THREAD
+#ifdef RUBY_VM
ptr->tk_thread_id = 0;
#endif
ptr->ref_count = 0;
@@ -5623,7 +5647,6 @@ ip_init(argc, argv, self)
;
}
- st = ruby_tcl_stubs_init();
/* from Tcl_AppInit() */
if (with_tk) {
DUMP1("Tk_Init");
@@ -5651,7 +5674,7 @@ ip_init(argc, argv, self)
(Tcl_PackageInitProc *) NULL);
#endif
-#ifdef RUBY_USE_NATIVE_THREAD
+#ifdef RUBY_VM
/* set Tk thread ID */
ptr->tk_thread_id = Tcl_GetCurrentThread();
#endif
@@ -5773,7 +5796,7 @@ ip_create_slave_core(interp, argc, argv)
#endif
/* create slave-ip */
-#ifdef RUBY_USE_NATIVE_THREAD
+#ifdef RUBY_VM
/* slave->tk_thread_id = 0; */
slave->tk_thread_id = master->tk_thread_id; /* == current thread */
#endif
@@ -6200,6 +6223,10 @@ get_str_from_obj(obj)
int len, binary = 0;
const char *s;
volatile VALUE str;
+#if TCL_MAJOR_VERSION > 8 || (TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION >= 4)
+ int len2;
+ const char *s2;
+#endif
#if TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION == 0
s = Tcl_GetStringFromObj(obj, &len);
@@ -6208,7 +6235,7 @@ get_str_from_obj(obj)
/* TCL_VERSION 8.1 -- 8.3 */
if (Tcl_GetCharLength(obj) != Tcl_UniCharLen(Tcl_GetUnicode(obj))) {
/* possibly binary string */
- s = (char *)Tcl_GetByteArrayFromObj(obj, &len);
+ s = Tcl_GetByteArrayFromObj(obj, &len);
binary = 1;
} else {
/* possibly text string */
@@ -6216,7 +6243,7 @@ get_str_from_obj(obj)
}
#else /* TCL_VERSION >= 8.4 */
if (IS_TCL_BYTEARRAY(obj)) {
- s = (char *)Tcl_GetByteArrayFromObj(obj, &len);
+ s = Tcl_GetByteArrayFromObj(obj, &len);
binary = 1;
} else {
s = Tcl_GetStringFromObj(obj, &len);
@@ -6226,13 +6253,13 @@ get_str_from_obj(obj)
#endif
str = s ? rb_str_new(s, len) : rb_str_new2("");
if (binary) {
-#ifdef HAVE_RUBY_ENCODING_H
+#ifdef RUBY_VM
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
+#ifdef RUBY_VM
rb_enc_associate_index(str, ENCODING_INDEX_UTF8);
#endif
rb_ivar_set(str, ID_at_enc, ENCODING_NAME_UTF8);
@@ -6256,19 +6283,19 @@ get_obj_from_str(str)
StringValue(enc);
if (strcmp(RSTRING_PTR(enc), "binary") == 0) {
/* binary string */
- return Tcl_NewByteArrayObj((const unsigned char *)s, RSTRING_LEN(str));
+ return Tcl_NewByteArrayObj(s, RSTRING_LEN(str));
} else {
/* text string */
return Tcl_NewStringObj(s, RSTRING_LEN(str));
}
-#ifdef HAVE_RUBY_ENCODING_H
+#ifdef RUBY_VM
} else if (rb_enc_get_index(str) == ENCODING_INDEX_BINARY) {
/* binary string */
- return Tcl_NewByteArrayObj((const unsigned char *)s, RSTRING_LEN(str));
+ return Tcl_NewByteArrayObj(s, RSTRING_LEN(str));
#endif
- } else if (memchr(s, 0, RSTRING_LEN(str))) {
+ } else if (strlen(s) != RSTRING_LEN(str)) {
/* probably binary string */
- return Tcl_NewByteArrayObj((const unsigned char *)s, RSTRING_LEN(str));
+ return Tcl_NewByteArrayObj(s, RSTRING_LEN(str));
} else {
/* probably text string */
return Tcl_NewStringObj(s, RSTRING_LEN(str));
@@ -6288,7 +6315,7 @@ ip_get_result_string_obj(interp)
retObj = Tcl_GetObjResult(interp);
Tcl_IncrRefCount(retObj);
strval = get_str_from_obj(retObj);
- RbTk_OBJ_UNTRUST(strval);
+ OBJ_TAINT(strval);
Tcl_ResetResult(interp);
Tcl_DecrRefCount(retObj);
return strval;
@@ -6334,13 +6361,8 @@ call_queue_handler(evPtr, flags)
DUMP1("process it on current event-loop");
}
-#ifdef RUBY_VM
- if (RTEST(rb_funcall(thread, ID_alive_p, 0))
- && ! RTEST(rb_funcall(thread, ID_stop_p, 0))) {
-#else
if (RTEST(rb_thread_alive_p(thread))
&& ! RTEST(rb_funcall(thread, ID_stop_p, 0))) {
-#endif
DUMP1("caller is not yet ready to receive the result -> pending");
return 0;
}
@@ -6389,11 +6411,8 @@ call_queue_handler(evPtr, flags)
q->thread = (VALUE)NULL;
/* back to caller */
-#ifdef RUBY_VM
- if (RTEST(rb_funcall(thread, ID_alive_p, 0, 0))) {
-#else
+ /* if (RTEST(rb_funcall(thread, ID_alive_p, 0, 0))) { */
if (RTEST(rb_thread_alive_p(thread))) {
-#endif
DUMP2("back to caller (caller thread:%lx)", thread);
DUMP2(" (current thread:%lx)", rb_thread_current());
#if CONTROL_BY_STATUS_OF_RB_THREAD_WAITING_FOR_VALUE
@@ -6431,7 +6450,6 @@ tk_funcall(func, argc, argv, obj)
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);
@@ -6440,7 +6458,7 @@ tk_funcall(func, argc, argv, obj)
ptr = (struct tcltkip *)NULL;
}
-#ifdef RUBY_USE_NATIVE_THREAD
+#ifdef RUBY_VM
if (ptr) {
/* on Tcl interpreter */
is_tk_evloop_thread = (ptr->tk_thread_id == (Tcl_ThreadId) 0
@@ -6516,7 +6534,7 @@ tk_funcall(func, argc, argv, obj)
/* add the handler to Tcl event queue */
DUMP1("add handler");
-#ifdef RUBY_USE_NATIVE_THREAD
+#ifdef RUBY_VM
if (ptr && ptr->tk_thread_id) {
/* Tcl_ThreadQueueEvent(ptr->tk_thread_id,
&(callq->ev), TCL_QUEUE_HEAD); */
@@ -6541,21 +6559,12 @@ tk_funcall(func, argc, argv, obj)
rb_thread_critical = thr_crit_bup;
/* wait for the handler to be processed */
- t.tv_sec = (time_t)0;
- t.tv_usec = (long)((EVENT_HANDLER_TIMEOUT)*1000.0);
-
- DUMP2("callq wait for handler (current thread:%lx)", current);
+ DUMP2("wait for handler (current thread:%lx)", current);
while(*alloc_done >= 0) {
- DUMP2("*** callq wait for handler (current thread:%lx)", current);
+ DUMP2("*** wait for handler (current thread:%lx)", current);
/* rb_thread_stop(); */
- /* rb_thread_sleep_forever(); */
- rb_thread_wait_for(t);
- DUMP2("*** callq wakeup (current thread:%lx)", current);
- DUMP2("*** (eventloop thread:%lx)", eventloop_thread);
- if (NIL_P(eventloop_thread)) {
- DUMP1("*** callq lost eventloop thread");
- break;
- }
+ rb_thread_sleep_forever();
+ DUMP2("*** wakeup (current thread:%lx)", current);
}
DUMP2("back from handler (current thread:%lx)", current);
@@ -6672,19 +6681,35 @@ ip_eval_real(self, cmd_str, cmd_len)
ret = rb_protect(call_tcl_eval, (VALUE)&inf, &status);
switch(status) {
case TAG_RAISE:
+#ifdef RUBY_VM
if (NIL_P(rb_errinfo())) {
+#else
+ if (NIL_P(ruby_errinfo)) {
+#endif
rbtk_pending_exception = rb_exc_new2(rb_eException,
"unknown exception");
} else {
+#ifdef RUBY_VM
rbtk_pending_exception = rb_errinfo();
+#else
+ rbtk_pending_exception = ruby_errinfo;
+#endif
}
break;
case TAG_FATAL:
+#ifdef RUBY_VM
if (NIL_P(rb_errinfo())) {
+#else
+ if (NIL_P(ruby_errinfo)) {
+#endif
rbtk_pending_exception = rb_exc_new2(rb_eFatal, "FATAL");
} else {
+#ifdef RUBY_VM
rbtk_pending_exception = rb_errinfo();
+#else
+ rbtk_pending_exception = ruby_errinfo;
+#endif
}
}
#endif
@@ -6699,26 +6724,11 @@ ip_eval_real(self, cmd_str, cmd_len)
return rbtk_pending_exception;
}
- /* if (ptr->return_value == TCL_ERROR) { */
- if (ptr->return_value != TCL_OK) {
+ if (ptr->return_value == TCL_ERROR) {
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));
- }
-
+ exc = create_ip_exc(self, rb_eRuntimeError,
+ "%s", Tcl_GetStringResult(ptr->ip));
rbtk_release_ip(ptr);
rb_thread_critical = thr_crit_bup;
return exc;
@@ -6760,23 +6770,10 @@ ip_eval_real(self, cmd_str, cmd_len)
return rbtk_pending_exception;
}
- /* if (ptr->return_value == TCL_ERROR) { */
- if (ptr->return_value != TCL_OK) {
+ if (ptr->return_value == TCL_ERROR) {
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);
- }
+ exc = create_ip_exc(self, rb_eRuntimeError, "%s", ptr->ip->result);
rbtk_release_ip(ptr);
return exc;
@@ -6826,13 +6823,8 @@ eval_queue_handler(evPtr, flags)
DUMP1("process it on current event-loop");
}
-#ifdef RUBY_VM
- if (RTEST(rb_funcall(thread, ID_alive_p, 0))
- && ! RTEST(rb_funcall(thread, ID_stop_p, 0))) {
-#else
if (RTEST(rb_thread_alive_p(thread))
&& ! RTEST(rb_funcall(thread, ID_stop_p, 0))) {
-#endif
DUMP1("caller is not yet ready to receive the result -> pending");
return 0;
}
@@ -6853,11 +6845,17 @@ eval_queue_handler(evPtr, flags)
/* check safe-level */
if (rb_safe_level() != q->safe_level) {
#ifdef HAVE_NATIVETHREAD
-#ifndef RUBY_USE_NATIVE_THREAD
+#ifdef RUBY_VM
+#if 0
if (!ruby_native_thread_p()) {
rb_bug("cross-thread violation on eval_queue_handler()");
}
#endif
+#else
+ if (!is_ruby_native_thread()) {
+ rb_bug("cross-thread violation on eval_queue_handler()");
+ }
+#endif
#endif
/* q_dat = Data_Wrap_Struct(rb_cData,0,-1,q); */
q_dat = Data_Wrap_Struct(rb_cData,eval_queue_mark,-1,q);
@@ -6885,11 +6883,8 @@ eval_queue_handler(evPtr, flags)
q->thread = (VALUE)NULL;
/* back to caller */
-#ifdef RUBY_VM
- if (RTEST(rb_funcall(thread, ID_alive_p, 0, 0))) {
-#else
+ /* if (RTEST(rb_funcall(thread, ID_alive_p, 0, 0))) { */
if (RTEST(rb_thread_alive_p(thread))) {
-#endif
DUMP2("back to caller (caller thread:%lx)", thread);
DUMP2(" (current thread:%lx)", rb_thread_current());
#if CONTROL_BY_STATUS_OF_RB_THREAD_WAITING_FOR_VALUE
@@ -6917,7 +6912,7 @@ ip_eval(self, str)
VALUE str;
{
struct eval_queue *evq;
-#ifdef RUBY_USE_NATIVE_THREAD
+#ifdef RUBY_VM
struct tcltkip *ptr;
#endif
char *eval_str;
@@ -6928,24 +6923,18 @@ ip_eval(self, str)
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
+#ifdef RUBY_VM
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 %lx", eventloop_thread);
if (
-#ifdef RUBY_USE_NATIVE_THREAD
+#ifdef RUBY_VM
(ptr->tk_thread_id == 0 || ptr->tk_thread_id == Tcl_GetCurrentThread())
&&
#endif
@@ -7008,7 +6997,7 @@ ip_eval(self, str)
/* add the handler to Tcl event queue */
DUMP1("add handler");
-#ifdef RUBY_USE_NATIVE_THREAD
+#ifdef RUBY_VM
if (ptr->tk_thread_id) {
/* Tcl_ThreadQueueEvent(ptr->tk_thread_id, &(evq->ev), position); */
Tcl_ThreadQueueEvent(ptr->tk_thread_id, (Tcl_Event*)evq, position);
@@ -7030,21 +7019,12 @@ ip_eval(self, str)
rb_thread_critical = thr_crit_bup;
/* wait for the handler to be processed */
- t.tv_sec = (time_t)0;
- t.tv_usec = (long)((EVENT_HANDLER_TIMEOUT)*1000.0);
-
- DUMP2("evq wait for handler (current thread:%lx)", current);
+ DUMP2("wait for handler (current thread:%lx)", current);
while(*alloc_done >= 0) {
- DUMP2("*** evq wait for handler (current thread:%lx)", current);
+ DUMP2("*** wait for handler (current thread:%lx)", current);
/* rb_thread_stop(); */
- /* rb_thread_sleep_forever(); */
- rb_thread_wait_for(t);
- DUMP2("*** evq wakeup (current thread:%lx)", current);
- DUMP2("*** (eventloop thread:%lx)", eventloop_thread);
- if (NIL_P(eventloop_thread)) {
- DUMP1("*** evq lost eventloop thread");
- break;
- }
+ rb_thread_sleep_forever();
+ DUMP2("*** wakeup (current thread:%lx)", current);
}
DUMP2("back from handler (current thread:%lx)", current);
@@ -7090,71 +7070,6 @@ ip_eval(self, str)
}
-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.");
-#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)
@@ -7304,7 +7219,7 @@ lib_toUTF8_core(ip_obj, src, encodename)
if (TYPE(str) == T_STRING) {
volatile VALUE enc;
-#ifdef HAVE_RUBY_ENCODING_H
+#ifdef RUBY_VM
enc = rb_funcall(rb_obj_encoding(str), ID_to_s, 0, 0);
#else
enc = rb_attr_get(str, ID_at_enc);
@@ -7334,7 +7249,7 @@ lib_toUTF8_core(ip_obj, src, encodename)
} else {
StringValue(enc);
if (strcmp(RSTRING_PTR(enc), "binary") == 0) {
-#ifdef HAVE_RUBY_ENCODING_H
+#ifdef RUBY_VM
rb_enc_associate_index(str, ENCODING_INDEX_BINARY);
#endif
rb_ivar_set(str, ID_at_enc, ENCODING_NAME_BINARY);
@@ -7354,7 +7269,7 @@ lib_toUTF8_core(ip_obj, src, encodename)
} else {
StringValue(encodename);
if (strcmp(RSTRING_PTR(encodename), "binary") == 0) {
-#ifdef HAVE_RUBY_ENCODING_H
+#ifdef RUBY_VM
rb_enc_associate_index(str, ENCODING_INDEX_BINARY);
#endif
rb_ivar_set(str, ID_at_enc, ENCODING_NAME_BINARY);
@@ -7391,11 +7306,11 @@ lib_toUTF8_core(ip_obj, src, encodename)
/* 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
+#ifdef RUBY_VM
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 (taint_flag) OBJ_TAINT(str);
/*
if (encoding != (Tcl_Encoding)NULL) {
@@ -7484,14 +7399,14 @@ lib_fromUTF8_core(ip_obj, src, encodename)
if (!NIL_P(enc)) {
StringValue(enc);
if (strcmp(RSTRING_PTR(enc), "binary") == 0) {
-#ifdef HAVE_RUBY_ENCODING_H
+#ifdef RUBY_VM
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
+#ifdef RUBY_VM
} 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);
@@ -7536,11 +7451,11 @@ lib_fromUTF8_core(ip_obj, src, encodename)
StringValue(str);
tclstr = Tcl_NewStringObj(RSTRING_PTR(str), RSTRING_LEN(str));
Tcl_IncrRefCount(tclstr);
- s = (char*)Tcl_GetByteArrayFromObj(tclstr, &len);
+ s = Tcl_GetByteArrayFromObj(tclstr, &len);
str = rb_tainted_str_new(s, len);
s = (char*)NULL;
Tcl_DecrRefCount(tclstr);
-#ifdef HAVE_RUBY_ENCODING_H
+#ifdef RUBY_VM
rb_enc_associate_index(str, ENCODING_INDEX_BINARY);
#endif
rb_ivar_set(str, ID_at_enc, ENCODING_NAME_BINARY);
@@ -7582,7 +7497,7 @@ lib_fromUTF8_core(ip_obj, src, encodename)
/* 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
+#ifdef RUBY_VM
if (interp) {
/* can access encoding_table of TclTkIp */
/* -> try to use encoding_table */
@@ -7595,10 +7510,10 @@ lib_fromUTF8_core(ip_obj, src, encodename)
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 (taint_flag) OBJ_TAINT(str);
+
/*
if (encoding != (Tcl_Encoding)NULL) {
Tcl_FreeEncoding(encoding);
@@ -7690,8 +7605,8 @@ lib_UTF_backslash_core(self, str, all_bs)
}
str = rb_str_new(dst_buf, dst_len);
- if (taint_flag) RbTk_OBJ_UNTRUST(str);
-#ifdef HAVE_RUBY_ENCODING_H
+ if (taint_flag) OBJ_TAINT(str);
+#ifdef RUBY_VM
rb_enc_associate_index(str, ENCODING_INDEX_UTF8);
#endif
rb_ivar_set(str, ID_at_enc, ENCODING_NAME_UTF8);
@@ -7996,19 +7911,35 @@ ip_invoke_core(interp, argc, argv)
ret = rb_protect(invoke_tcl_proc, (VALUE)&inf, &status);
switch(status) {
case TAG_RAISE:
+#ifdef RUBY_VM
if (NIL_P(rb_errinfo())) {
+#else
+ if (NIL_P(ruby_errinfo)) {
+#endif
rbtk_pending_exception = rb_exc_new2(rb_eException,
"unknown exception");
} else {
+#ifdef RUBY_VM
rbtk_pending_exception = rb_errinfo();
+#else
+ rbtk_pending_exception = ruby_errinfo;
+#endif
}
break;
case TAG_FATAL:
+#ifdef RUBY_VM
if (NIL_P(rb_errinfo())) {
+#else
+ if (NIL_P(ruby_errinfo)) {
+#endif
rbtk_pending_exception = rb_exc_new2(rb_eFatal, "FATAL");
} else {
+#ifdef RUBY_VM
rbtk_pending_exception = rb_errinfo();
+#else
+ rbtk_pending_exception = ruby_errinfo;
+#endif
}
}
@@ -8108,24 +8039,11 @@ ip_invoke_core(interp, argc, argv)
rb_thread_critical = thr_crit_bup;
- /* if (ptr->return_value == TCL_ERROR) { */
- if (ptr->return_value != TCL_OK) {
+ if (ptr->return_value == TCL_ERROR) {
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));
- }
+ 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));
@@ -8312,13 +8230,8 @@ invoke_queue_handler(evPtr, flags)
DUMP1("process it on current event-loop");
}
-#ifdef RUBY_VM
- if (RTEST(rb_funcall(thread, ID_alive_p, 0))
- && ! RTEST(rb_funcall(thread, ID_stop_p, 0))) {
-#else
if (RTEST(rb_thread_alive_p(thread))
&& ! RTEST(rb_funcall(thread, ID_stop_p, 0))) {
-#endif
DUMP1("caller is not yet ready to receive the result -> pending");
return 0;
}
@@ -8366,11 +8279,8 @@ invoke_queue_handler(evPtr, flags)
q->thread = (VALUE)NULL;
/* back to caller */
-#ifdef RUBY_VM
- if (RTEST(rb_funcall(thread, ID_alive_p, 0, 0))) {
-#else
+ /* if (RTEST(rb_funcall(thread, ID_alive_p, 0, 0))) { */
if (RTEST(rb_thread_alive_p(thread))) {
-#endif
DUMP2("back to caller (caller thread:%lx)", thread);
DUMP2(" (current thread:%lx)", rb_thread_current());
#if CONTROL_BY_STATUS_OF_RB_THREAD_WAITING_FOR_VALUE
@@ -8400,7 +8310,7 @@ ip_invoke_with_position(argc, argv, obj, position)
Tcl_QueuePosition position;
{
struct invoke_queue *ivq;
-#ifdef RUBY_USE_NATIVE_THREAD
+#ifdef RUBY_VM
struct tcltkip *ptr;
#endif
int *alloc_done;
@@ -8409,7 +8319,6 @@ ip_invoke_with_position(argc, argv, obj, position)
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;
@@ -8421,17 +8330,15 @@ ip_invoke_with_position(argc, argv, obj, position)
rb_raise(rb_eArgError, "command name missing");
}
-#ifdef RUBY_USE_NATIVE_THREAD
+#ifdef RUBY_VM
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());
+ DUMP2("status: ptr->tk_thread_id %d", ptr->tk_thread_id);
#endif
+ DUMP2("status: Tcl_GetCurrentThread %d", Tcl_GetCurrentThread());
DUMP2("status: eventloopt_thread %lx", eventloop_thread);
if (
-#ifdef RUBY_USE_NATIVE_THREAD
+#ifdef RUBY_VM
(ptr->tk_thread_id == 0 || ptr->tk_thread_id == Tcl_GetCurrentThread())
&&
#endif
@@ -8487,7 +8394,7 @@ ip_invoke_with_position(argc, argv, obj, position)
/* add the handler to Tcl event queue */
DUMP1("add handler");
-#ifdef RUBY_USE_NATIVE_THREAD
+#ifdef RUBY_VM
if (ptr->tk_thread_id) {
/* Tcl_ThreadQueueEvent(ptr->tk_thread_id, &(ivq->ev), position); */
Tcl_ThreadQueueEvent(ptr->tk_thread_id, (Tcl_Event*)ivq, position);
@@ -8510,25 +8417,15 @@ ip_invoke_with_position(argc, argv, obj, position)
rb_thread_critical = thr_crit_bup;
/* wait for the handler to be processed */
- t.tv_sec = (time_t)0;
- t.tv_usec = (long)((EVENT_HANDLER_TIMEOUT)*1000.0);
-
- DUMP2("ivq wait for handler (current thread:%lx)", current);
+ DUMP2("wait for handler (current thread:%lx)", current);
while(*alloc_done >= 0) {
- /* rb_thread_stop(); */
- /* rb_thread_sleep_forever(); */
- rb_thread_wait_for(t);
- DUMP2("*** ivq wakeup (current thread:%lx)", current);
- DUMP2("*** (eventloop thread:%lx)", eventloop_thread);
- if (NIL_P(eventloop_thread)) {
- DUMP1("*** ivq lost eventloop thread");
- break;
- }
+ /* rb_thread_stop(); */
+ rb_thread_sleep_forever();
}
DUMP2("back from handler (current thread:%lx)", current);
/* get result & free allocated memory */
- ret = RARRAY_PTR(result)[0];
+ ret = RARRAY(result)->ptr[0];
#if 0 /* use Tcl_EventuallyFree */
Tcl_EventuallyFree((ClientData)alloc_done, TCL_DYNAMIC); /* XXXXXXXX */
#else
@@ -8661,7 +8558,7 @@ ip_get_variable2_core(interp, argc, argv)
Tcl_IncrRefCount(ret);
strval = get_str_from_obj(ret);
- RbTk_OBJ_UNTRUST(strval);
+ OBJ_TAINT(strval);
Tcl_DecrRefCount(ret);
/* Tcl_Release(ptr->ip); */
@@ -8800,7 +8697,7 @@ ip_set_variable2_core(interp, argc, argv)
Tcl_IncrRefCount(ret);
strval = get_str_from_obj(ret);
- RbTk_OBJ_UNTRUST(strval);
+ OBJ_TAINT(strval);
Tcl_DecrRefCount(ret);
/* Tcl_Release(ptr->ip); */
@@ -9023,7 +8920,7 @@ lib_split_tklist_core(ip_obj, list_str)
volatile VALUE ary, elem;
int idx;
int taint_flag = OBJ_TAINTED(list_str);
-#ifdef HAVE_RUBY_ENCODING_H
+#ifdef RUBY_VM
int list_enc_idx;
volatile VALUE list_ivar_enc;
#endif
@@ -9041,7 +8938,7 @@ lib_split_tklist_core(ip_obj, list_str)
}
StringValue(list_str);
-#ifdef HAVE_RUBY_ENCODING_H
+#ifdef RUBY_VM
list_enc_idx = rb_enc_get_index(list_str);
list_ivar_enc = rb_ivar_get(list_str, ID_at_enc);
#endif
@@ -9077,15 +8974,13 @@ lib_split_tklist_core(ip_obj, list_str)
rb_thread_critical = Qtrue;
ary = rb_ary_new2(objc);
- if (taint_flag) RbTk_OBJ_UNTRUST(ary);
+ if (taint_flag) OBJ_TAINT(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
+#ifdef RUBY_VM
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);
@@ -9094,6 +8989,7 @@ lib_split_tklist_core(ip_obj, list_str)
rb_ivar_set(elem, ID_at_enc, list_ivar_enc);
}
#endif
+ if (taint_flag) OBJ_TAINT(elem);
/* RARRAY(ary)->ptr[idx] = elem; */
rb_ary_push(ary, elem);
}
@@ -9125,7 +9021,7 @@ lib_split_tklist_core(ip_obj, list_str)
}
ary = rb_ary_new2(argc);
- if (taint_flag) RbTk_OBJ_UNTRUST(ary);
+ if (taint_flag) OBJ_TAINT(ary);
old_gc = rb_gc_disable();
@@ -9245,7 +9141,7 @@ lib_merge_tklist(argc, argv, obj)
/* create object */
str = rb_str_new(result, dst - result - 1);
- if (taint_flag) RbTk_OBJ_UNTRUST(str);
+ if (taint_flag) OBJ_TAINT(str);
#if 0 /* use Tcl_EventuallyFree */
Tcl_EventuallyFree((ClientData)result, TCL_DYNAMIC); /* XXXXXXXX */
#else
@@ -9293,7 +9189,7 @@ lib_conv_listelement(self, src)
#endif
rb_str_resize(dst, len);
- if (taint_flag) RbTk_OBJ_UNTRUST(dst);
+ if (taint_flag) OBJ_TAINT(dst);
rb_thread_critical = thr_crit_bup;
@@ -9304,30 +9200,28 @@ 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));
-}
+ volatile VALUE type_name;
-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");
+ type_name = rb_str_new2("alpha");
+ break;
case TCL_BETA_RELEASE:
- return rb_str_new2("beta");
+ type_name = rb_str_new2("beta");
+ break;
case TCL_FINAL_RELEASE:
- return rb_str_new2("final");
+ type_name = rb_str_new2("final");
+ break;
default:
- rb_raise(rb_eRuntimeError, "tcltklib has invalid release type number");
+ type_name = rb_str_new2("unknown");
}
+
+ return rb_ary_new3(5, INT2NUM(tcltk_version.major),
+ INT2NUM(tcltk_version.minor),
+ INT2NUM(tcltk_version.type), type_name,
+ INT2NUM(tcltk_version.patchlevel));
}
@@ -9402,7 +9296,7 @@ create_dummy_encoding_for_tk_core(interp, name, error_mode)
VALUE name;
VALUE error_mode;
{
- get_ip(interp);
+ struct tcltkip *ptr = get_ip(interp);
rb_secure(4);
@@ -9419,7 +9313,7 @@ create_dummy_encoding_for_tk_core(interp, name, error_mode)
}
#endif
-#ifdef HAVE_RUBY_ENCODING_H
+#ifdef RUBY_VM
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));
@@ -9444,7 +9338,7 @@ create_dummy_encoding_for_tk(interp, name)
}
-#ifdef HAVE_RUBY_ENCODING_H
+#ifdef RUBY_VM
static int
update_encoding_table(table, interp, error_mode)
VALUE table;
@@ -9530,22 +9424,14 @@ encoding_table_get_name_core(table, enc_arg, error_mode)
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 */
+ /* 2nd: encoding system of Tcl/Tk */
if (NIL_P(enc)) {
enc = rb_str_new2(Tcl_GetEncodingName((Tcl_Encoding)NULL));
}
- /* 4th: Encoding.default_external */
+ /* 3rd: 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 */
@@ -9626,7 +9512,7 @@ encoding_table_get_obj_core(table, enc, error_mode)
}
}
-#else /* ! HAVE_RUBY_ENCODING_H */
+#else /* ! RUBY_VM */
#if TCL_MAJOR_VERSION > 8 || (TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION >= 1)
static int
update_encoding_table(table, interp, error_mode)
@@ -9636,10 +9522,11 @@ update_encoding_table(table, interp, error_mode)
{
struct tcltkip *ptr;
int retry = 0;
- int i, objc;
+ 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;
@@ -9681,6 +9568,7 @@ encoding_table_get_name_core(table, enc, error_mode)
VALUE error_mode;
{
volatile VALUE name = Qnil;
+ int retry = 0;
enc = rb_funcall(enc, ID_to_s, 0, 0);
name = rb_hash_lookup(table, enc);
@@ -9751,10 +9639,9 @@ encoding_table_get_obj(table, enc)
return encoding_table_get_obj_core(table, enc, Qtrue);
}
-#ifdef HAVE_RUBY_ENCODING_H
+#ifdef RUBY_VM
static VALUE
-create_encoding_table_core(arg, interp)
- VALUE arg;
+create_encoding_table(interp)
VALUE interp;
{
struct tcltkip *ptr = get_ip(interp);
@@ -9765,11 +9652,7 @@ create_encoding_table_core(arg, interp)
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
+ rb_secure(4);
/* set 'binary' encoding */
encobj = rb_enc_from_encoding(rb_enc_from_index(ENCODING_INDEX_BINARY));
@@ -9846,11 +9729,10 @@ create_encoding_table_core(arg, interp)
return table;
}
-#else /* ! HAVE_RUBY_ENCODING_H */
+#else /* ! RUBY_VM */
#if TCL_MAJOR_VERSION > 8 || (TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION >= 1)
static VALUE
-create_encoding_table_core(arg, interp)
- VALUE arg;
+create_encoding_table(interp)
VALUE interp;
{
struct tcltkip *ptr = get_ip(interp);
@@ -9891,8 +9773,7 @@ create_encoding_table_core(arg, interp)
#else /* Tcl/Tk 7.x or 8.0 */
static VALUE
-create_encoding_table_core(arg, interp)
- VALUE arg;
+create_encoding_table(interp)
VALUE interp;
{
volatile VALUE table = rb_hash_new();
@@ -9904,14 +9785,6 @@ create_encoding_table_core(arg, interp)
#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;
{
@@ -10089,9 +9962,9 @@ Init_tcltklib()
/* --------------------------------------------------------------- */
-#ifdef HAVE_RUBY_ENCODING_H
+#ifdef RUBY_VM
rb_global_variable(&cRubyEncoding);
- cRubyEncoding = rb_path2class("Encoding");
+ cRubyEncoding = rb_const_get(rb_cObject, rb_intern("Encoding"));
ENCODING_INDEX_UTF8 = rb_enc_to_index(rb_utf8_encoding());
ENCODING_INDEX_BINARY = rb_enc_find_index("binary");
@@ -10127,24 +10000,6 @@ Init_tcltklib()
/* --------------------------------------------------------------- */
-#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));
@@ -10174,8 +10029,6 @@ Init_tcltklib()
/* --------------------------------------------------------------- */
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));
@@ -10290,8 +10143,6 @@ Init_tcltklib()
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);
@@ -10354,13 +10205,12 @@ Init_tcltklib()
/* --------------------------------------------------------------- */
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);
+ OBJ_TAINT(eventloop_stack);
watchdog_thread = Qnil;
@@ -10370,7 +10220,11 @@ Init_tcltklib()
/* if ruby->nativethread-supprt and tcltklib->doen't,
the following will cause link-error. */
+#ifdef RUBY_VM
ruby_native_thread_p();
+#else
+ is_ruby_native_thread();
+#endif
/* --------------------------------------------------------------- */
@@ -10399,8 +10253,6 @@ Init_tcltklib()
Tcl_ObjType_String = Tcl_GetObjType(Tcl_ObjTypeName_String);
/* --------------------------------------------------------------- */
-
- (void)call_original_exit;
}
/* eof */
diff --git a/ext/tk/tkutil/extconf.rb b/ext/tk/tkutil/extconf.rb
index 57de973c0a..015bc3a45e 100644
--- a/ext/tk/tkutil/extconf.rb
+++ b/ext/tk/tkutil/extconf.rb
@@ -7,12 +7,7 @@ end
if has_tk
require 'mkmf'
-
have_func("rb_obj_instance_exec", "ruby.h")
- have_func("rb_obj_untrust", "ruby.h")
- have_func("rb_obj_taint", "ruby.h")
- have_func("rb_sym_to_s", "ruby.h")
have_func("strndup", "string.h")
-
create_makefile('tkutil')
end
diff --git a/ext/tk/tkutil/tkutil.c b/ext/tk/tkutil/tkutil.c
index 25011bb473..00d719143b 100644
--- a/ext/tk/tkutil/tkutil.c
+++ b/ext/tk/tkutil/tkutil.c
@@ -7,19 +7,18 @@
************************************************/
-#define TKUTIL_RELEASE_DATE "2009-07-12"
+#define TKUTIL_RELEASE_DATE "2008-05-23"
#include "ruby.h"
-#ifdef RUBY_VM
-static VALUE 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
+#ifdef RUBY_VM /* Ruby 1.9 */
+/* #include "ruby/ruby.h" */
+#include "ruby/signal.h"
#include "ruby/st.h"
#else
+/* #include "ruby.h" */
+#include "rubysig.h"
+#include "version.h"
#include "st.h"
#endif
@@ -60,9 +59,6 @@ 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;
@@ -87,34 +83,12 @@ 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[];
@@ -143,8 +117,8 @@ tk_do_callback(argc, argv, self)
ID_call, argc - 1, argv + 1);
}
-static const char cmd_id_head[] = "ruby_cmd TkUtil callback ";
-static const char cmd_id_prefix[] = "cmd";
+static char *cmd_id_head = "ruby_cmd TkUtil callback ";
+static char *cmd_id_prefix = "cmd";
static VALUE
tk_install_cmd_core(cmd)
@@ -231,7 +205,6 @@ fromDefaultEnc_toUTF8(str, self)
return tk_toUTF8(1, argv, self);
}
-#if 0
static VALUE
fromUTF8_toDefaultEnc(str, self)
VALUE str;
@@ -242,7 +215,6 @@ fromUTF8_toDefaultEnc(str, self)
argv[0] = str;
return tk_fromUTF8(1, argv, self);
}
-#endif
static int
to_strkey(key, value, hash)
@@ -819,7 +791,7 @@ get_eval_string_core(obj, enc_flag, self)
return fromDefaultEnc_toUTF8(rb_str_new2(rb_id2name(SYM2ID(obj))), self);
}
} else {
-#ifdef HAVE_RB_SYM_TO_S
+#ifdef RUBY_VM
return rb_sym_to_s(obj);
#else
return rb_str_new2(rb_id2name(SYM2ID(obj)));
@@ -996,14 +968,12 @@ tcl2rb_bool(self, value)
}
}
-#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)
@@ -1100,18 +1070,6 @@ tcl2rb_num_or_str(self, 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);
-}
-
/*************************************/
@@ -1119,8 +1077,8 @@ tcl2rb_num_or_nil(self, value)
struct cbsubst_info {
int full_subst_length;
int keylen[CBSUBST_TBL_MAX];
- char *key[CBSUBST_TBL_MAX];
- char type[CBSUBST_TBL_MAX];
+ unsigned char *key[CBSUBST_TBL_MAX];
+ unsigned char type[CBSUBST_TBL_MAX];
ID ivar[CBSUBST_TBL_MAX];
VALUE proc;
VALUE aliases;
@@ -1142,9 +1100,9 @@ subst_free(ptr)
if (ptr) {
for(i = 0; i < CBSUBST_TBL_MAX; i++) {
- if (ptr->key[i] != NULL) {
+ if (ptr->key[i] != (unsigned char *)NULL) {
free(ptr->key[i]);
- ptr->key[i] = NULL;
+ ptr->key[i] = (unsigned char *)NULL;
}
}
free(ptr);
@@ -1164,7 +1122,7 @@ allocate_cbsubst_info()
for(idx = 0; idx < CBSUBST_TBL_MAX; idx++) {
inf->keylen[idx] = 0;
- inf->key[idx] = NULL;
+ inf->key[idx] = (unsigned char *) NULL;
inf->type[idx] = '\0';
inf->ivar[idx] = (ID) 0;
}
@@ -1282,7 +1240,7 @@ cbsubst_sym_to_subst(self, sym)
{
struct cbsubst_info *inf;
const char *str;
- char *buf, *ptr;
+ unsigned char *buf, *ptr;
int idx, len;
ID id;
volatile VALUE ret;
@@ -1315,7 +1273,7 @@ cbsubst_sym_to_subst(self, sym)
ptr += len;
} else {
/* single char */
- *(ptr++) = (unsigned char)idx;
+ *(ptr++) = idx;
}
*(ptr++) = ' ';
@@ -1336,7 +1294,7 @@ cbsubst_get_subst_arg(argc, argv, self)
{
struct cbsubst_info *inf;
const char *str;
- char *buf, *ptr;
+ unsigned char *buf, *ptr;
int i, idx, len;
ID id;
volatile VALUE arg_sym, ret;
@@ -1381,7 +1339,7 @@ cbsubst_get_subst_arg(argc, argv, self)
ptr += len;
} else {
/* single char */
- *(ptr++) = (unsigned char)idx;
+ *(ptr++) = idx;
}
*(ptr++) = ' ';
@@ -1406,7 +1364,7 @@ cbsubst_get_subst_key(self, str)
volatile VALUE ret;
VALUE keyval;
int i, len, keylen, idx;
- char *buf, *ptr, *key;
+ unsigned char *buf, *ptr, *key;
list = rb_funcall(cTclTkLib, ID_split_tklist, 1, str);
len = RARRAY_LEN(list);
@@ -1414,11 +1372,11 @@ cbsubst_get_subst_key(self, str)
Data_Get_Struct(rb_const_get(self, ID_SUBST_INFO),
struct cbsubst_info, inf);
- ptr = buf = ALLOC_N(char, inf->full_subst_length + len + 1);
+ ptr = buf = ALLOC_N(unsigned char, inf->full_subst_length + len + 1);
for(i = 0; i < len; i++) {
keyval = RARRAY_PTR(list)[i];
- key = RSTRING_PTR(keyval);
+ key = (unsigned char*)RSTRING_PTR(keyval);
if (*key == '%') {
if (*(key + 2) == '\0') {
/* single char */
@@ -1428,7 +1386,7 @@ cbsubst_get_subst_key(self, str)
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 (inf->key[idx][0] != *(key + 1)) continue;
if (strncmp(inf->key[idx], key + 1, keylen)) continue;
break;
}
@@ -1444,7 +1402,7 @@ cbsubst_get_subst_key(self, str)
}
*ptr = '\0';
- ret = rb_str_new2(buf);
+ ret = rb_str_new2((const char*)buf);
free(buf);
return ret;
}
@@ -1454,16 +1412,16 @@ cbsubst_get_all_subst_keys(self)
VALUE self;
{
struct cbsubst_info *inf;
- char *buf, *ptr;
- char *keys_buf, *keys_ptr;
+ unsigned char *buf, *ptr;
+ unsigned char *keys_buf, *keys_ptr;
int idx, len;
volatile VALUE ret;
Data_Get_Struct(rb_const_get(self, ID_SUBST_INFO),
struct cbsubst_info, inf);
- ptr = buf = ALLOC_N(char, inf->full_subst_length + 1);
- keys_ptr = keys_buf = ALLOC_N(char, CBSUBST_TBL_MAX + 1);
+ ptr = buf = ALLOC_N(unsigned char, inf->full_subst_length + 1);
+ keys_ptr = keys_buf = ALLOC_N(unsigned char, CBSUBST_TBL_MAX + 1);
for(idx = 0; idx < CBSUBST_TBL_MAX; idx++) {
if (inf->ivar[idx] == (ID) 0) continue;
@@ -1487,7 +1445,7 @@ cbsubst_get_all_subst_keys(self)
*ptr = '\0';
*keys_ptr = '\0';
- ret = rb_ary_new3(2, rb_str_new2(keys_buf), rb_str_new2(buf));
+ ret = rb_ary_new3(2, rb_str_new2(keys_buf), rb_str_new2((const char*)buf));
free(buf);
free(keys_buf);
@@ -1795,7 +1753,7 @@ Init_tkutil()
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);
+ rb_define_singleton_method(TK_None, "inspect", tkNone_to_s, 0);
OBJ_FREEZE(TK_None);
/* --------------------- */
@@ -1803,8 +1761,6 @@ Init_tkutil()
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);
@@ -1821,7 +1777,6 @@ Init_tkutil()
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);
@@ -1835,7 +1790,6 @@ Init_tkutil()
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);
diff --git a/ext/win32ole/doc/win32ole.rd b/ext/win32ole/doc/win32ole.rd
new file mode 100644
index 0000000000..c563ce5d5b
--- /dev/null
+++ b/ext/win32ole/doc/win32ole.rd
@@ -0,0 +1,294 @@
+=begin
+= Win32OLE extension module
+
+== WIN32OLE
+=== Constants
+: VERSION
+ The version number of WIN32OLE.
+
+: ARGV
+ The argument of the method invoked recently.
+ This constant is used to get value of argument
+ when the argument is passed by reference.
+
+=== Class Method
+: connect(oleserver)
+ returns running OLE automation object or WIN32OLE object from moniker.
+
+: const_load(ole [,obj])
+ defines the constants of OLE automation
+ server as 'obj' class constants. If 'obj' omitted, the default
+ is WIN32OLE.
+
+: new(oleserver)
+ returns OLE Automation object.
+
+: ole_free(obj)
+ invokes Release method of Dispatch interface of WIN32OLE object.
+ This method should not be used because this method exists for debugging WIN32OLE.
+
+: ole_reference_count(obj)
+ returns reference counter of Dispatch interface.
+ This method should not be used because this method exists for debugging WIN32OLE.
+
+: ole_show_help(info [,helpcontext])
+ displays helpfile.
+ The first argument specifies WIN32OLE_TYPE object or WIN32OLE_METHOD object
+ or helpfile.
+
+=== Method
+: self[property]
+ gets property of OLE object.
+
+: self[property]=
+ sets property of OLE object.
+
+: _invoke(dispid, args, types)
+ runs the early binding method.
+ The dispid specifies Dispatch ID, args specifies the array of arguments,
+ types specifies array of the type of arguments.
+
+: each {...}
+ Iterates over each item of OLE collection which has IEnumVARIANT
+ interface.
+
+: invoke(method, args,...)
+ runs OLE method.
+
+: ole_func_methods
+ returns array of WIN32OLE_METHOD object which corresponds with function.
+
+: ole_get_methods
+ returns array of WIN32OLE_METHOD object which corresponds with get properties.
+
+: ole_method(method)
+ returns WIN32OLE_METHOD object which coreesponds with method
+ which specified by argument.
+
+: ole_method_help(method)
+ alias of ole_method.
+
+: ole_methods
+ returns WIN32OLE_METHOD object which coreesponds with method.
+
+: ole_obj_help
+ returns WIN32OLE_TYPE object.
+
+: ole_put_methods
+ returns array of WIN32OLE_METHOD object which corresponds with put properties.
+
+: setproperty(property, key, val)
+ set property of OLE object.
+ This method is used when the property has argument.
+
+ For example, in VB
+ obj.item("key") = val
+ in Win32OLE
+ obj.setproperty("item", "key", val)
+
+
+== WIN32OLE_EVENT class
+
+=== Class Method
+
+: new(ole, interface)
+ The new class method creates OLE event sink object to connect ole.
+ The ole must be WIN32OLE object, and interface is the interface
+ name of event.
+
+: message_loop
+ The message_loop class method translates and dispatches Windows
+ message.
+
+=== Method
+: on_event([event]){...}
+ defines the callback of event.
+ If event omitted, defines the callback of all events.
+
+: on_event_with_outargs([event]) {...}
+ defines the callback of event.
+ If you want modify argument in callback,
+
+== WIN32OLE_METHOD
+
+=== Class Methods
+: new(win32ole_type, method)
+ creates WIN32OLE_METHOD object.
+
+=== Methods
+: dispid
+ returns Dispatch ID.
+
+: event?
+ returns true if the method is event.
+
+: event_interface
+ returns interface name of event if the method is event.
+
+: helpcontext
+ returns help context.
+
+: helpfile
+ returns help file.
+
+: invkind
+ returns invkind.
+
+: invoke_kind
+ returns invoke kind string.
+
+: name
+ returns name of method.
+
+: offset_vtbl
+ returns the offset of Vtbl.
+
+: params
+ returns array of WIN32OLE_PARAM object.
+
+: return_type
+ returns string of return value type of method.
+
+: return_vtype
+ returns number of return value type of method.
+
+: return_type_detail
+ returns detail information of return value type of method.
+
+: size_params
+ returns the size of arguments.
+
+: size_opt_params
+ returns the size of optional arguments.
+
+: visible?
+ returns true if the method is public.
+
+== WIN32OLE_PARAM
+: default
+ returns default value.
+
+: input?
+ returns true if argument is input.
+
+: optional?
+ returns true if argument is optional.
+
+: output?
+ returns true if argument is output.
+
+: name
+ returns name.
+
+: ole_type
+ returns type of argument.
+
+: ole_type_detail
+ returns detail information of type of argument.
+
+: retval?
+ returns true if argument is return value.
+
+== WIN32OLE_TYPE
+=== Class Methods
+: new(typelibrary, class)
+ returns WIN32OLE_TYPE object.
+
+: ole_classes(typelibrary)
+ returns array of WIN32OLE_TYPE objects defined by Type Library.
+
+: progids
+ returns array of ProgID.
+
+: typelibs
+ returns array of type libraries.
+
+=== Methods
+: guid
+ returns GUID.
+
+: helpfile
+ returns helpfile.
+
+: helpcontext
+ returns helpcontext.
+
+: helpstring
+ returns help string.
+
+: major_version
+ returns major version.
+
+: minor_version
+ returns minor version.
+
+: name
+ returns name.
+
+: ole_methods
+ returns array of WIN32OLE_METHOD objects.
+
+: ole_type
+ returns type of class.
+
+: progid
+ returns ProgID if it exists. If not found, then returns nil.
+
+: src_type
+ returns source class when the OLE class is 'Alias'.
+
+: typekind
+ returns number which represents type.
+
+: variables
+ returns array of variables defined in OLE class.
+
+: visible?
+ returns true if the OLE class is public.
+
+== WIN32OLE_VARIABLE
+=== Methods
+: name
+ returns the name.
+
+: ole_type
+ returns type
+
+: ole_type_detail
+ returns detail information of type.
+
+: value
+ returns value.
+
+: variable_kind
+ returns variable kind string.
+
+: varkind
+ returns the number which represents variable kind.
+
+== WIN32OLE::VARIANT
+=== Constants
+ *VT_I4
+ *VT_R4
+ *VT_R8
+ *VT_CY
+ *VT_DATE
+ *VT_BSTR
+ *VT_USERDEFINED
+ *VT_PTR
+ *VT_DISPATCH
+ *VT_ERROR
+ *VT_BOOL
+ *VT_VARIANT
+ *VT_UNKNOWN
+ *VT_I1
+ *VT_UI1
+ *VT_UI2
+ *VT_UI4
+ *VT_INT
+ *VT_UINT
+ *VT_ARRAY
+ *VT_BYREF
+
+=end
+
diff --git a/ext/win32ole/extconf.rb b/ext/win32ole/extconf.rb
index b4f09fc7c0..cee922554a 100644
--- a/ext/win32ole/extconf.rb
+++ b/ext/win32ole/extconf.rb
@@ -1,6 +1,7 @@
#----------------------------------
# extconf.rb
# $Revision$
+# $Date$
#----------------------------------
require 'mkmf'
@@ -19,14 +20,11 @@ end
def create_win32ole_makefile
if have_library("ole32") and
have_library("oleaut32") and
- have_library("uuid") and
+ have_library("uuid") and
have_library("user32") and
have_library("kernel32") and
have_library("advapi32") and
have_header("windows.h")
- unless have_type("IMultiLanguage2", "mlang.h")
- have_type("IMultiLanguage", "mlang.h")
- end
create_makefile("win32ole")
create_docfile(SRCFILES)
else
@@ -34,9 +32,8 @@ def create_win32ole_makefile
end
end
-
case RUBY_PLATFORM
-when /mswin/
+when /mswin32/
$CFLAGS += ' /W3'
when /cygwin/, /mingw/
$defs << '-DNONAMELESSUNION'
diff --git a/ext/win32ole/sample/excel1.rb b/ext/win32ole/sample/excel1.rb
index c8cd38e732..e366a52839 100644
--- a/ext/win32ole/sample/excel1.rb
+++ b/ext/win32ole/sample/excel1.rb
@@ -1,33 +1,22 @@
require 'win32ole'
+#application = WIN32OLE.new('Excel.Application.5')
application = WIN32OLE.new('Excel.Application')
application.visible = TRUE
workbook = application.Workbooks.Add();
worksheet = workbook.Worksheets(1);
-
-=begin
worksheet.Range("A1:D1").value = ["North","South","East","West"];
worksheet.Range("A2:B2").value = [5.2, 10];
-
worksheet.Range("C2").value = 8;
worksheet.Range("D2").value = 20;
-=end
-
-worksheet.Range("A1:B2").value = [["North","South"],
- [5.2, 10]];
-
-vals = WIN32OLE_VARIANT.new([["East","West"],
- [8, 20]],
- WIN32OLE::VARIANT::VT_ARRAY)
-worksheet.Range("C1:D2").value = vals
range = worksheet.Range("A1:D2");
range.Select
chart = workbook.Charts.Add;
workbook.saved = TRUE;
-sleep 0.5
+
application.ActiveWorkbook.Close(0);
application.Quit();
diff --git a/ext/win32ole/sample/excel2.rb b/ext/win32ole/sample/excel2.rb
index dbe4178051..46f459b36b 100644
--- a/ext/win32ole/sample/excel2.rb
+++ b/ext/win32ole/sample/excel2.rb
@@ -9,14 +9,14 @@ 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;
-excel.Range("a3").value = 1;
+excel.Range("a1")['Value'] = 3;
+excel.Range("a2")['Value'] = 2;
+excel.Range("a3")['Value'] = 1;
excel.Range("a1:a3").Select();
excelchart = excel.Charts.Add();
-excelchart.type = ChartTypeVal;
+excelchart['Type'] = ChartTypeVal;
i = 30
i.step(180, 10) do |rot|
diff --git a/ext/win32ole/sample/ieconst.rb b/ext/win32ole/sample/ieconst.rb
index 2c6a7a383c..234272c7ed 100644
--- a/ext/win32ole/sample/ieconst.rb
+++ b/ext/win32ole/sample/ieconst.rb
@@ -20,7 +20,7 @@ end
# Remark!!! CONSTANTS has not tested enoughly!!!
# CONSTANTS is alpha release.
# If there are constants which first letter is not [a-zA-Z],
-# like a '_Foo', then maybe you can access the value by
+# like a '_Foo', then maybe you can access the value by
# using CONSTANTS['_Foo']
#------------------------------------------------------------
IE_CONST::CONSTANTS.each do |k, v|
diff --git a/ext/win32ole/sample/ienavi.rb b/ext/win32ole/sample/ienavi.rb
index 8b279ddaae..c7fa3f5ec2 100644
--- a/ext/win32ole/sample/ienavi.rb
+++ b/ext/win32ole/sample/ienavi.rb
@@ -26,7 +26,7 @@ ev = WIN32OLE_EVENT.new(ie, 'DWebBrowserEvents')
ev.on_event {|*args| default_handler(*args)}
ev.on_event("NavigateComplete") {|url| navigate(url)}
-ev.on_event("Quit") {|*args| stop_msg_loop}
+ev.on_event("Quit") {|*args| stop_msg_loop}
$LOOP = TRUE
while ($LOOP)
diff --git a/ext/win32ole/sample/ienavi2.rb b/ext/win32ole/sample/ienavi2.rb
deleted file mode 100644
index 67977e28ab..0000000000
--- a/ext/win32ole/sample/ienavi2.rb
+++ /dev/null
@@ -1,40 +0,0 @@
-require 'win32ole'
-
-class IEHandler
- attr_reader :loop
- def initialize
- @urls = []
- @loop = true
- end
- def method_missing(event, *args)
- case event
- when "BeforeNavigate2"
- puts "Now Navigate #{args[1]}..."
- end
- end
- def onNavigateComplete2(pdisp, url)
- @urls << url
- end
- def onOnQuit
- puts "Now Stop IE..."
- @loop = false
- end
- def put_urls
- puts "You Navigated the URLs ..."
- @urls.each_with_index do |url, i|
- puts "(#{i+1}) #{url}"
- end
- end
-end
-
-ie = WIN32OLE.new('InternetExplorer.Application')
-ie.visible = true
-ie.gohome
-
-ev = WIN32OLE_EVENT.new(ie)
-ev.handler = IEHandler.new
-
-while (ev.handler.loop)
- WIN32OLE_EVENT.message_loop
-end
-ev.handler.put_urls
diff --git a/ext/win32ole/sample/oledirs.rb b/ext/win32ole/sample/oledirs.rb
index dbacc2131d..1c77e76f14 100644
--- a/ext/win32ole/sample/oledirs.rb
+++ b/ext/win32ole/sample/oledirs.rb
@@ -7,7 +7,7 @@ require "win32ole"
def listup(items)
# items.each do |i|
for i in items
- puts i.name
+ puts i.name
end
end
diff --git a/ext/win32ole/sample/olegen.rb b/ext/win32ole/sample/olegen.rb
index 4ec576ca50..48d86893fe 100644
--- a/ext/win32ole/sample/olegen.rb
+++ b/ext/win32ole/sample/olegen.rb
@@ -1,5 +1,6 @@
#-----------------------------
# olegen.rb
+# $Date$
# $Revision$
#-----------------------------
@@ -49,7 +50,7 @@ class WIN32COMGen
ts = ''
typedetails.each do |t|
case t
- when 'CARRAY', 'VOID', 'UINT', 'RESULT', 'DECIMAL', 'I8', 'UI8'
+ when 'CARRAY', 'VOID', 'UINT', 'RESULT', 'DECIMAL', 'I8', 'UI8'
# raise "Sorry type\"" + t + "\" not supported"
ts << "\"??? NOT SUPPORTED TYPE:`#{t}'\""
when 'USERDEFINED', 'Unknown Type 9'
@@ -80,7 +81,7 @@ class WIN32COMGen
generate_argtype(param.ole_type_detail)
}.join(", ")
if proptypes
- types += ", " if types.size > 0
+ types += ", " if types.size > 0
types += generate_argtype(proptypes)
end
types
@@ -97,8 +98,8 @@ class WIN32COMGen
end
def generate_method_help(method, type = nil)
- str = " # "
- if type
+ str = " # "
+ if type
str += type
else
str += method.return_type
@@ -123,7 +124,7 @@ class WIN32COMGen
def generate_method_args_help(method)
args = []
method.params.each_with_index {|param, i|
- h = " # #{param.ole_type} arg#{i} --- #{param.name}"
+ h = " # #{param.ole_type} arg#{i} --- #{param.name}"
inout = []
inout.push "IN" if param.input?
inout.push "OUT" if param.output?
@@ -166,14 +167,14 @@ class WIN32COMGen
method.visible? &&
method.size_params > 0
}.each do |method|
- types = method.return_type_detail
+ types = method.return_type_detail
io.puts "\n"
io.puts generate_method_help(method, types[0])
io.puts " def #{method.name}"
if klass.ole_type == "Class"
- io.print " OLEProperty.new(@dispatch, #{method.dispid}, ["
+ io.print " OLEProperty.new(@dispatch, #{method.dispid}, ["
else
- io.print " OLEProperty.new(self, #{method.dispid}, ["
+ io.print " OLEProperty.new(self, #{method.dispid}, ["
end
io.print generate_argtypes(method, nil)
io.print "], ["
@@ -230,7 +231,7 @@ class WIN32COMGen
v.visible? && v.variable_kind == 'CONSTANT'
}.each do |v|
io.print " "
- io.print v.name.sub(/^./){$&.upcase}
+ io.print v.name.sub(/^./){|c| c.upcase}
io.print " = "
io.puts v.value
end
@@ -320,8 +321,8 @@ STR
ole_classes(typelib).select{|klass|
klass.visible? &&
- (klass.ole_type == "Class" ||
- klass.ole_type == "Interface" ||
+ (klass.ole_type == "Class" ||
+ klass.ole_type == "Interface" ||
klass.ole_type == "Dispatch" ||
klass.ole_type == "Enum")
}.each do |klass|
@@ -329,7 +330,7 @@ STR
end
begin
@ole.quit if @ole
- rescue
+ rescue
end
end
end
diff --git a/ext/win32ole/sample/xml.rb b/ext/win32ole/sample/xml.rb
index 4b1a54dc75..b95d6d5275 100644
--- a/ext/win32ole/sample/xml.rb
+++ b/ext/win32ole/sample/xml.rb
@@ -1,11 +1,11 @@
-#
+#
# This file created by olegen.rb as following.
# ruby olegen.rb 'Microsoft XML, version 2.0' > xml.rb
-#
+#
require 'win32ole'
require 'win32ole/property'
-#
+#
module IXMLDOMImplementation
include WIN32OLE::VARIANT
attr_reader :lastargs
@@ -343,7 +343,7 @@ module OLEtagDOMNodeType
NODE_NOTATION = 12
end
-#
+#
module IXMLDOMNodeList
include WIN32OLE::VARIANT
attr_reader :lastargs
@@ -380,7 +380,7 @@ module IXMLDOMNodeList
end
end
-#
+#
module IXMLDOMNamedNodeMap
include WIN32OLE::VARIANT
attr_reader :lastargs
@@ -464,7 +464,7 @@ module IXMLDOMNamedNodeMap
end
end
-#
+#
module IXMLDOMDocument
include WIN32OLE::VARIANT
attr_reader :lastargs
@@ -1040,7 +1040,7 @@ module IXMLDOMDocument
end
end
-#
+#
module IXMLDOMDocumentType
include WIN32OLE::VARIANT
attr_reader :lastargs
@@ -1368,7 +1368,7 @@ module IXMLDOMDocumentType
end
end
-#
+#
module IXMLDOMElement
include WIN32OLE::VARIANT
attr_reader :lastargs
@@ -1752,7 +1752,7 @@ module IXMLDOMElement
end
end
-#
+#
module IXMLDOMAttribute
include WIN32OLE::VARIANT
attr_reader :lastargs
@@ -2080,7 +2080,7 @@ module IXMLDOMAttribute
end
end
-#
+#
module IXMLDOMDocumentFragment
include WIN32OLE::VARIANT
attr_reader :lastargs
@@ -2384,7 +2384,7 @@ module IXMLDOMDocumentFragment
end
end
-#
+#
module IXMLDOMText
include WIN32OLE::VARIANT
attr_reader :lastargs
@@ -2771,7 +2771,7 @@ module IXMLDOMText
end
end
-#
+#
module IXMLDOMCharacterData
include WIN32OLE::VARIANT
attr_reader :lastargs
@@ -3149,7 +3149,7 @@ module IXMLDOMCharacterData
end
end
-#
+#
module IXMLDOMComment
include WIN32OLE::VARIANT
attr_reader :lastargs
@@ -3527,7 +3527,7 @@ module IXMLDOMComment
end
end
-#
+#
module IXMLDOMCDATASection
include WIN32OLE::VARIANT
attr_reader :lastargs
@@ -3914,7 +3914,7 @@ module IXMLDOMCDATASection
end
end
-#
+#
module IXMLDOMProcessingInstruction
include WIN32OLE::VARIANT
attr_reader :lastargs
@@ -4242,7 +4242,7 @@ module IXMLDOMProcessingInstruction
end
end
-#
+#
module IXMLDOMEntityReference
include WIN32OLE::VARIANT
attr_reader :lastargs
@@ -4608,7 +4608,7 @@ module IXMLDOMParseError
end
end
-#
+#
module IXMLDOMNotation
include WIN32OLE::VARIANT
attr_reader :lastargs
@@ -4928,7 +4928,7 @@ module IXMLDOMNotation
end
end
-#
+#
module IXMLDOMEntity
include WIN32OLE::VARIANT
attr_reader :lastargs
diff --git a/ext/win32ole/tests/oleserver.rb b/ext/win32ole/tests/oleserver.rb
new file mode 100644
index 0000000000..bf721373e5
--- /dev/null
+++ b/ext/win32ole/tests/oleserver.rb
@@ -0,0 +1,10 @@
+require 'win32ole'
+def oletypelib_name(pat)
+ WIN32OLE_TYPE.typelibs.each do |lib|
+ return lib if pat =~ lib
+ end
+end
+module OLESERVER
+ MS_EXCEL_TYPELIB = oletypelib_name(/^Microsoft Excel .* Object Library$/)
+ MS_XML_TYPELIB = oletypelib_name(/^Microsoft XML/)
+end
diff --git a/ext/win32ole/tests/testNIL2VTEMPTY.rb b/ext/win32ole/tests/testNIL2VTEMPTY.rb
new file mode 100644
index 0000000000..555d35fbf3
--- /dev/null
+++ b/ext/win32ole/tests/testNIL2VTEMPTY.rb
@@ -0,0 +1,28 @@
+# This is test script to check that WIN32OLE should convert nil to VT_EMPTY in second try.
+# [ruby-talk:137054]
+
+require 'win32ole'
+require 'test/unit'
+
+class TestNIL2VT_EMPTY < Test::Unit::TestCase
+ def setup
+ fs = WIN32OLE.new('Scripting.FileSystemObject')
+ @path = fs.GetFolder(".").path
+ end
+ def test_openSchema
+ con = nil
+ begin
+ con = WIN32OLE.new('ADODB.Connection')
+ con.connectionString = "Provider=MSDASQL;Extended Properties="
+ con.connectionString +="\"DRIVER={Microsoft Text Driver (*.txt; *.csv)};DBQ=#{@path}\""
+ con.open
+ rescue
+ con = nil
+ end
+ if con
+ rs = con.openSchema(4, [nil,nil,"DUMMY", "TABLE"])
+ assert(rs)
+ end
+ end
+end
+
diff --git a/ext/win32ole/tests/testOLEMETHOD.rb b/ext/win32ole/tests/testOLEMETHOD.rb
new file mode 100644
index 0000000000..390c9999f8
--- /dev/null
+++ b/ext/win32ole/tests/testOLEMETHOD.rb
@@ -0,0 +1,92 @@
+# You need RubyUnit and MS Excel and MSI to run this test script
+
+require 'rubyunit'
+
+require 'win32ole'
+require 'oleserver'
+
+class TestOLEMETHOD < RUNIT::TestCase
+ include OLESERVER
+ def setup
+ @excel_app = WIN32OLE_TYPE.new(MS_EXCEL_TYPELIB, 'Application')
+ end
+ def test_s_new
+ m = WIN32OLE_METHOD.new(@excel_app, 'Quit')
+ assert_instance_of(WIN32OLE_METHOD, m)
+ m = WIN32OLE_METHOD.new(@excel_app, 'WorkbookOpen')
+ assert_instance_of(WIN32OLE_METHOD, m)
+ m = WIN32OLE_METHOD.new(@excel_app, 'workbookopen')
+ assert_instance_of(WIN32OLE_METHOD, m)
+ end
+ def test_name
+ m = WIN32OLE_METHOD.new(@excel_app, 'Quit')
+ assert_equal('Quit', m.name)
+ end
+ def test_to_s
+ m = WIN32OLE_METHOD.new(@excel_app, 'Quit')
+ assert_equal('Quit', "#{m}")
+ end
+ def test_return_type
+ m = WIN32OLE_METHOD.new(@excel_app, 'ActiveCell')
+ assert_equal('Range', m.return_type)
+ m = WIN32OLE_METHOD.new(@excel_app, 'ActivePrinter')
+ assert_equal('BSTR', m.return_type)
+ end
+ def test_return_vtype
+ m = WIN32OLE_METHOD.new(@excel_app, 'ActiveCell')
+ assert_equal(WIN32OLE::VARIANT::VT_PTR, m.return_vtype)
+ m = WIN32OLE_METHOD.new(@excel_app, 'ActivePrinter')
+ assert_equal(WIN32OLE::VARIANT::VT_BSTR, m.return_vtype)
+ end
+ def test_return_type_detail
+ m = WIN32OLE_METHOD.new(@excel_app, 'ActiveCell')
+ assert_equal(['PTR', 'USERDEFINED', 'Range'], m.return_type_detail)
+ m = WIN32OLE_METHOD.new(@excel_app, 'ActivePrinter')
+ assert_equal(['BSTR'], m.return_type_detail)
+ end
+
+ def test_invoke_kind
+ m = WIN32OLE_METHOD.new(@excel_app, 'ActiveCell')
+ assert_equal('PROPERTYGET', m.invoke_kind)
+ end
+ def test_visible
+ m = WIN32OLE_METHOD.new(@excel_app, 'ActiveCell')
+ assert(m.visible?)
+ m = WIN32OLE_METHOD.new(@excel_app, 'AddRef')
+ assert(!m.visible?)
+ end
+ def test_event
+ m = WIN32OLE_METHOD.new(@excel_app, 'WorkbookOpen')
+ assert(m.event?)
+ m = WIN32OLE_METHOD.new(@excel_app, 'ActiveCell')
+ assert(!m.event?)
+ end
+ def test_event_interface
+ m = WIN32OLE_METHOD.new(@excel_app, 'WorkbookOpen')
+ assert_equal('AppEvents', m.event_interface)
+ m = WIN32OLE_METHOD.new(@excel_app, 'ActiveCell')
+ assert_nil(m.event_interface)
+ end
+ def test_helpstring
+ domdoc = WIN32OLE_TYPE.new(MS_XML_TYPELIB, 'DOMDocument')
+ m = WIN32OLE_METHOD.new(domdoc, 'abort')
+ assert_equal('abort an asynchronous download', m.helpstring)
+ end
+ def test_helpfile
+ m = WIN32OLE_METHOD.new(@excel_app, 'ActiveCell')
+ assert_match(/VBAXL.*\.(HLP|CHM)$/i, m.helpfile)
+ end
+ def test_helpcontext
+ m = WIN32OLE_METHOD.new(@excel_app, 'ActiveCell')
+ assert(m.helpcontext > 0)
+ end
+ def test_offset_vtbl
+ m = WIN32OLE_METHOD.new(@excel_app, 'QueryInterface')
+ assert_equal(0, m.offset_vtbl)
+ end
+ def test_dispid
+ tobj = WIN32OLE_TYPE.new('Microsoft Shell Controls And Automation', 'FolderItem2')
+ method = WIN32OLE_METHOD.new(tobj, 'InvokeVerb')
+ assert_equal(1610743824, method.dispid)
+ end
+end
diff --git a/ext/win32ole/tests/testOLEPARAM.rb b/ext/win32ole/tests/testOLEPARAM.rb
new file mode 100644
index 0000000000..4014fadbfc
--- /dev/null
+++ b/ext/win32ole/tests/testOLEPARAM.rb
@@ -0,0 +1,65 @@
+# You need RubyUnit and MS Excel and MSI to run this test script
+
+require 'rubyunit'
+
+require 'win32ole'
+require 'oleserver'
+
+class TestOLEPARAM < RUNIT::TestCase
+ include OLESERVER
+ def test_name
+ classes = WIN32OLE_TYPE.ole_classes(MS_EXCEL_TYPELIB)
+ sh = classes.find {|c| c.name == 'Worksheet'}
+ saveas = sh.ole_methods.find {|m| m.name == 'SaveAs'}
+ param_names = saveas.params.collect{|p| p.name}
+ assert(param_names.size > 0)
+ assert(param_names.include?('Filename'))
+ end
+ def test_to_s
+ classes = WIN32OLE_TYPE.ole_classes(MS_EXCEL_TYPELIB)
+ sh = classes.find {|c| c.name == 'Worksheet'}
+ saveas = sh.ole_methods.find {|m| m.name == 'SaveAs'}
+ param_names = saveas.params.collect{|p| "#{p}"}
+ assert(param_names.include?('Filename'))
+ end
+ def test_ole_type
+ classes = WIN32OLE_TYPE.ole_classes(MS_EXCEL_TYPELIB)
+ methods = classes.find {|c| c.name == 'Worksheet'}.ole_methods
+ f = methods.find {|m| m.name == 'SaveAs'}
+ assert_equal('BSTR', f.params[0].ole_type)
+ methods = classes.find {|c| c.name == 'Workbook'}.ole_methods
+ f = methods.find {|m| m.name == 'SaveAs'}
+ assert_equal('XlSaveAsAccessMode', f.params[6].ole_type)
+ end
+ def test_ole_type_detail
+ classes = WIN32OLE_TYPE.ole_classes(MS_EXCEL_TYPELIB)
+ methods = classes.find {|c| c.name == 'Worksheet'}.ole_methods
+ f = methods.find {|m| m.name == 'SaveAs'}
+ assert_equal(['BSTR'], f.params[0].ole_type_detail)
+ methods = classes.find {|c| c.name == 'Workbook'}.ole_methods
+ f = methods.find {|m| m.name == 'SaveAs'}
+ assert_equal(['USERDEFINED', 'XlSaveAsAccessMode'], f.params[6].ole_type_detail)
+ end
+ def test_input
+ classes = WIN32OLE_TYPE.ole_classes(MS_EXCEL_TYPELIB)
+ methods = classes.find {|c| c.name == 'Worksheet'}.ole_methods
+ f = methods.find {|m| m.name == 'SaveAs'}
+ assert(f.params[0].input?)
+ end
+
+ def test_output
+ classes = WIN32OLE_TYPE.ole_classes(MS_EXCEL_TYPELIB)
+ methods = classes.find {|c| c.name == 'Worksheet'}.ole_methods
+ f = methods.find {|m| m.name == 'SaveAs'}
+ assert(!f.params[0].output?)
+ end
+ def test_optional
+ classes = WIN32OLE_TYPE.ole_classes(MS_EXCEL_TYPELIB)
+ methods = classes.find {|c| c.name == 'Worksheet'}.ole_methods
+ f = methods.find {|m| m.name == 'SaveAs'}
+ assert(!f.params[0].optional?)
+ methods = classes.find {|c| c.name == 'Workbook'}.ole_methods
+ f = methods.find {|m| m.name == 'SaveAs'}
+ assert(f.params[0].optional?)
+ end
+end
diff --git a/ext/win32ole/tests/testOLETYPE.rb b/ext/win32ole/tests/testOLETYPE.rb
new file mode 100644
index 0000000000..d4eb1146e1
--- /dev/null
+++ b/ext/win32ole/tests/testOLETYPE.rb
@@ -0,0 +1,96 @@
+# You need RubyUnit and MS Excel and MSI to run this test script
+
+require 'rubyunit'
+
+require 'win32ole'
+require 'oleserver'
+
+class TestOLETYPE < RUNIT::TestCase
+ include OLESERVER
+ def test_s_new
+ type = WIN32OLE_TYPE.new(MS_EXCEL_TYPELIB, 'Application')
+ assert_instance_of(WIN32OLE_TYPE, type)
+ end
+ def test_s_ole_classes
+ classes = WIN32OLE_TYPE.ole_classes(MS_EXCEL_TYPELIB)
+ assert(classes.size > 0)
+ end
+ def test_s_typelibs
+ libs = WIN32OLE_TYPE.typelibs
+ assert(libs.include?(MS_EXCEL_TYPELIB))
+ assert(libs.include?(MS_XML_TYPELIB))
+ end
+ def test_s_progids
+ progids = WIN32OLE_TYPE.progids
+ assert(progids.include?('Excel.Application'))
+ end
+ def test_name
+ classes = WIN32OLE_TYPE.ole_classes(MS_EXCEL_TYPELIB)
+ class_names = classes.collect{|c|
+ c.name
+ }
+ assert(class_names.include?('Application'))
+ end
+
+ def test_class_to_s
+ classes = WIN32OLE_TYPE.ole_classes(MS_EXCEL_TYPELIB)
+ class_names = classes.collect{|c|
+ "#{c}"
+ }
+ assert(class_names.include?('Application'))
+ end
+
+ def test_ole_type
+ classes = WIN32OLE_TYPE.ole_classes(MS_EXCEL_TYPELIB)
+ app = classes.find {|c| c.name == 'Application'}
+ assert_equal('Class', app.ole_type)
+ app = classes.find {|c| c.name == '_Application'}
+ assert_equal('Dispatch', app.ole_type)
+ end
+ def test_typekind
+ classes = WIN32OLE_TYPE.ole_classes(MS_EXCEL_TYPELIB)
+ app = classes.find {|c| c.name == 'Application'}
+ assert_equal(5, app.typekind)
+ end
+ def test_visible
+ classes = WIN32OLE_TYPE.ole_classes(MS_EXCEL_TYPELIB)
+ app = classes.find {|c| c.name == 'Application'}
+ assert(app.visible?)
+ app = classes.find {|c| c.name == 'IAppEvents'}
+ assert(!app.visible?)
+ end
+ def test_src_type
+ classes = WIN32OLE_TYPE.ole_classes(MS_XML_TYPELIB)
+ domnode = classes.find {|c| c.name == 'DOMNodeType'}
+ assert_equal('tagDOMNodeType', domnode.src_type)
+ end
+ def test_helpstring
+ classes = WIN32OLE_TYPE.ole_classes(MS_XML_TYPELIB)
+ domdoc = classes.find {|c| c.name == 'DOMDocument'}
+ assert_equal('W3C-DOM XML Document', domdoc.helpstring)
+ end
+ def test_variables
+ classes = WIN32OLE_TYPE.ole_classes(MS_EXCEL_TYPELIB)
+ xlchart = classes.find {|c| c.name == 'XlChartType'}
+ assert(xlchart.variables.size > 0)
+ end
+ def test_ole_methods
+ classes = WIN32OLE_TYPE.ole_classes(MS_EXCEL_TYPELIB)
+ worksheet = classes.find {|c| c.name == 'Worksheet'}
+ assert(worksheet.ole_methods.size > 0)
+ end
+ def test_helpfile
+ classes = WIN32OLE_TYPE.ole_classes(MS_EXCEL_TYPELIB)
+ worksheet = classes.find {|c| c.name == 'Worksheet'}
+ assert_match(/VBAXL.*\.(CHM|HLP)$/, worksheet.helpfile)
+ end
+ def test_helpcontext
+ classes = WIN32OLE_TYPE.ole_classes(MS_EXCEL_TYPELIB)
+ worksheet = classes.find {|c| c.name == 'Worksheet'}
+ assert_equal(131088, worksheet.helpcontext)
+ end
+ def test_to_s
+ type = WIN32OLE_TYPE.new(MS_EXCEL_TYPELIB, 'Application')
+ assert_equal("Application", "#{type}");
+ end
+end
diff --git a/ext/win32ole/tests/testOLEVARIABLE.rb b/ext/win32ole/tests/testOLEVARIABLE.rb
new file mode 100644
index 0000000000..b4bb0b57d9
--- /dev/null
+++ b/ext/win32ole/tests/testOLEVARIABLE.rb
@@ -0,0 +1,49 @@
+# You need RubyUnit and MS Excel and MSI to run this test script
+
+require 'rubyunit'
+
+require 'win32ole'
+require 'oleserver'
+
+class TestOLEVARIABLE < RUNIT::TestCase
+ include OLESERVER
+ def test_name
+ classes = WIN32OLE_TYPE.ole_classes(MS_EXCEL_TYPELIB)
+ chart = classes.find {|c| c.name == 'XlChartType'}
+ var_names = chart.variables.collect {|m| m.name}
+ assert(var_names.size > 0)
+ assert(var_names.include?('xl3DColumn'))
+ end
+ def test_to_s
+ classes = WIN32OLE_TYPE.ole_classes(MS_EXCEL_TYPELIB)
+ chart = classes.find {|c| c.name == 'XlChartType'}
+ var_names = chart.variables.collect {|m| "#{m}"}
+ assert(var_names.size > 0)
+ assert(var_names.include?('xl3DColumn'))
+ end
+ def test_ole_type
+ classes = WIN32OLE_TYPE.ole_classes(MS_EXCEL_TYPELIB)
+ chart = classes.find {|c| c.name == 'XlChartType'}
+ var = chart.variables.find {|m| m.name == 'xl3DColumn'}
+ assert_equal('INT', var.ole_type)
+ end
+ def test_ole_type_detail
+ classes = WIN32OLE_TYPE.ole_classes(MS_EXCEL_TYPELIB)
+ chart = classes.find {|c| c.name == 'XlChartType'}
+ var = chart.variables.find {|m| m.name == 'xl3DColumn'}
+ assert_equal(['INT'], var.ole_type_detail)
+ end
+
+ def test_value
+ classes = WIN32OLE_TYPE.ole_classes(MS_EXCEL_TYPELIB)
+ chart = classes.find {|c| c.name == 'XlChartType'}
+ var = chart.variables.find {|m| m.name == 'xl3DColumn'}
+ assert_equal(-4100, var.value)
+ end
+ def test_visible
+ classes = WIN32OLE_TYPE.ole_classes(MS_EXCEL_TYPELIB)
+ chart = classes.find {|c| c.name == 'XlChartType'}
+ var = chart.variables.find {|m| m.name == 'xl3DColumn'}
+ assert(var.visible?)
+ end
+end
diff --git a/ext/win32ole/tests/testVARIANT.rb b/ext/win32ole/tests/testVARIANT.rb
new file mode 100644
index 0000000000..f274778f27
--- /dev/null
+++ b/ext/win32ole/tests/testVARIANT.rb
@@ -0,0 +1,32 @@
+# You need RubyUnit and MS Excel and MSI to run this test script
+
+require 'rubyunit'
+
+require 'win32ole'
+
+class TestWin32OLE_VARIANT < RUNIT::TestCase
+ include WIN32OLE::VARIANT
+ def test_variant
+ assert_equal(2, VT_I2)
+ assert_equal(3, VT_I4)
+ assert_equal(4, VT_R4)
+ assert_equal(5, VT_R8)
+ assert_equal(6, VT_CY)
+ assert_equal(7, VT_DATE)
+ assert_equal(8, VT_BSTR)
+ assert_equal(9, VT_DISPATCH)
+ assert_equal(10, VT_ERROR)
+ assert_equal(11, VT_BOOL)
+ assert_equal(12, VT_VARIANT)
+ assert_equal(13, VT_UNKNOWN)
+ assert_equal(16, VT_I1)
+ assert_equal(17, VT_UI1)
+ assert_equal(18, VT_UI2)
+ assert_equal(19, VT_UI4)
+ assert_equal(22, VT_INT)
+ assert_equal(23, VT_UINT)
+ assert_equal(0x2000, VT_ARRAY)
+ assert_equal(0x4000, VT_BYREF)
+ end
+end
+
diff --git a/ext/win32ole/tests/testWIN32OLE.rb b/ext/win32ole/tests/testWIN32OLE.rb
new file mode 100644
index 0000000000..d7f9dd2543
--- /dev/null
+++ b/ext/win32ole/tests/testWIN32OLE.rb
@@ -0,0 +1,373 @@
+# You need RubyUnit and MS Excel and MSI to run this test script
+
+require 'runit/testcase'
+require 'runit/cui/testrunner'
+
+require 'win32ole'
+require 'oleserver'
+
+module EXCEL_CONST
+end
+
+module CONST1
+end
+
+module CONST2
+end
+
+module CONST3
+end
+
+class TestWin32OLE < RUNIT::TestCase
+ include OLESERVER
+ def setup
+ @excel = WIN32OLE.new("Excel.Application")
+ @excel.visible = true
+ end
+ def test_s_new
+ assert_instance_of(WIN32OLE, @excel)
+ end
+ def test_s_new_DCOM
+ rexcel = WIN32OLE.new("Excel.Application", "localhost")
+ assert_instance_of(WIN32OLE, rexcel)
+ rexcel.visible = true
+ rexcel.quit
+ end
+ def test_s_new_from_clsid
+ excel = WIN32OLE.new("{00024500-0000-0000-C000-000000000046}")
+ assert_instance_of(WIN32OLE, excel)
+ excel.quit
+ exc = assert_exception(WIN32OLERuntimeError) {
+ WIN32OLE.new("{000}")
+ }
+ assert_match(/unknown OLE server: `\{000\}'/, exc.message)
+ end
+ def test_s_connect
+ excel2 = WIN32OLE.connect('Excel.Application')
+ assert_instance_of(WIN32OLE, excel2)
+ end
+
+ def test_s_const_load
+ assert(!defined?(EXCEL_CONST::XlTop))
+ WIN32OLE.const_load(@excel, EXCEL_CONST)
+ assert_equal(-4160, EXCEL_CONST::XlTop)
+
+ assert(!defined?(CONST1::XlTop))
+ WIN32OLE.const_load(MS_EXCEL_TYPELIB, CONST1)
+ assert_equal(-4160, CONST1::XlTop)
+ end
+
+ def test_s_codepage
+ assert_equal(WIN32OLE::CP_ACP, WIN32OLE.codepage)
+ end
+
+ def test_s_codepage_set
+ WIN32OLE.codepage = WIN32OLE::CP_UTF8
+ assert_equal(WIN32OLE::CP_UTF8, WIN32OLE.codepage)
+ WIN32OLE.codepage = WIN32OLE::CP_ACP
+ end
+
+ def test_const_CP_ACP
+ assert_equal(0, WIN32OLE::CP_ACP)
+ end
+
+ def test_const_CP_OEMCP
+ assert_equal(1, WIN32OLE::CP_OEMCP)
+ end
+
+ def test_const_CP_MACCP
+ assert_equal(2, WIN32OLE::CP_MACCP)
+ end
+
+ def test_const_CP_THREAD_ACP
+ assert_equal(3, WIN32OLE::CP_THREAD_ACP)
+ end
+
+ def test_const_CP_SYMBOL
+ assert_equal(42, WIN32OLE::CP_SYMBOL)
+ end
+
+ def test_const_CP_UTF7
+ assert_equal(65000, WIN32OLE::CP_UTF7)
+ end
+
+ def test_const_CP_UTF8
+ assert_equal(65001, WIN32OLE::CP_UTF8)
+ end
+
+ def test_s_codepage_changed
+ book = @excel.workbooks.add
+ sheet = book.worksheets(1)
+ begin
+ WIN32OLE.codepage = WIN32OLE::CP_UTF8
+ sheet.range("A1").value = [0x3042].pack("U*")
+ val = sheet.range("A1").value
+ assert_equal("\343\201\202", val)
+ WIN32OLE.codepage = WIN32OLE::CP_ACP
+ val = sheet.range("A1").value
+ assert_equal("\202\240", val)
+ ensure
+ book.saved = true
+ end
+ end
+
+ def test_get_win32ole_object
+ workbooks = @excel.Workbooks;
+ assert_instance_of(WIN32OLE, workbooks)
+ end
+ def test_each
+ workbooks = @excel.Workbooks
+ assert_no_exception {
+ i = 0;
+ workbooks.each do |workbook|
+ print i += 1
+ end
+ }
+ workbooks.add
+ workbooks.add
+ i = 0
+ workbooks.each do |workbook|
+ i+=1
+ end
+ assert_equal(2, i)
+ workbooks.each do |workbook|
+ workbook.saved = true
+ end
+ end
+ def test_setproperty_bracket
+ book = @excel.workbooks.add
+ sheet = book.worksheets(1)
+ begin
+ sheet.range("A1")['Value'] = 10
+ assert_equal(10, sheet.range("A1").value)
+ sheet['Cells', 1, 2] = 10
+ assert_equal(10, sheet.range("B1").value)
+ assert_equal(10, sheet['Cells', 1, 2].value)
+ ensure
+ book.saved = true
+ end
+ end
+ def test_convert_bignum
+ book = @excel.workbooks.add
+ sheet = book.worksheets(1)
+ begin
+ sheet.range("A1").value = 999999999
+ sheet.range("A2").value = 9999999999
+ sheet.range("A3").value = "=A1*10 + 9"
+ assert_equal(9999999999, sheet.range("A2").value)
+ assert_equal(9999999999, sheet.range("A3").value)
+ sheet.range("A4").value = "2008/03/04"
+ assert_equal("2008/03/04 00:00:00", sheet.range("A4").value)
+ ensure
+ book.saved = true
+ end
+ end
+
+ def test_ole_invoke_with_named_arg
+ book = @excel.workbooks.add
+ sheets = book.worksheets
+ sheet = book.worksheets(1)
+ num = sheets.count
+ begin
+ sheets.add({'count' => 2, 'after'=>sheet})
+ assert_equal(2, sheets.count - num);
+ ensure
+ book.saved = true
+ end
+ end
+
+ def test_ole_invoke_with_named_arg_last
+ book = @excel.workbooks.add
+ sheets = book.worksheets
+ sheet = book.worksheets(1)
+ num = sheets.count
+ begin
+ sheets.add(sheet, {'count' => 2})
+ assert_equal(2, sheets.count - num);
+ ensure
+ book.saved = true
+ end
+ end
+
+ def test_setproperty
+ @excel.setproperty('Visible', false)
+ assert_equal(false, @excel.Visible)
+ @excel.setproperty('Visible', true)
+ assert_equal(true, @excel.Visible)
+ book = @excel.workbooks.add
+ sheet = book.worksheets(1)
+ begin
+ sheet.setproperty('Cells', 1, 2, 10)
+ assert_equal(10, sheet.range("B1").value)
+ ensure
+ book.saved = true
+ end
+ end
+ def test_no_exist_property
+ isok = false
+ begin
+ @excel.unknown_prop = 1
+ rescue WIN32OLERuntimeError
+ isok = true
+ end
+ assert(isok)
+
+ isok = false
+ begin
+ @excel['unknown_prop'] = 2
+ rescue WIN32OLERuntimeError
+ isok = true
+ end
+ assert(isok)
+ end
+
+ def test_setproperty_with_equal
+ book = @excel.workbooks.add
+ sheet = book.worksheets(1)
+ begin
+ sheet.range("B1").value = 10
+ assert_equal(10, sheet.range("B1").value)
+ sheet.range("C1:D1").value = [11, 12]
+ assert_equal(11, sheet.range("C1").value)
+ assert_equal(12, sheet.range("D1").value)
+ ensure
+ book.saved = true
+ end
+ end
+ def test_invoke
+ workbooks = @excel.invoke( 'workbooks' )
+ assert_instance_of(WIN32OLE, workbooks)
+ book = workbooks.invoke( 'add' )
+ assert_instance_of(WIN32OLE, book)
+ end
+ def test_ole_methods
+ methods = @excel.ole_methods
+ method_names = methods.collect{|m| m.name}
+ assert(method_names.include?("Quit"))
+ end
+ def test_ole_func_methods
+ methods = @excel.ole_func_methods
+ assert(methods.size > 0)
+ method_names = methods.collect{|m| m.name}
+ assert(method_names.include?("Quit"))
+ end
+ def test_ole_put_methods
+ methods = @excel.ole_put_methods
+ assert(methods.size > 0)
+ method_names = methods.collect{|m| m.name}
+ assert(method_names.include?("Visible"))
+ end
+ def test_ole_get_methods
+ methods = @excel.ole_get_methods
+ assert(methods.size > 0)
+ method_names = methods.collect{|m| m.name}
+ assert(method_names.include?("Visible"))
+ end
+ def test_ole_method_help
+ quit_info = @excel.ole_method_help("Quit")
+ assert_equal(0, quit_info.size_params)
+ assert_equal(0, quit_info.size_opt_params)
+
+ workbooks = @excel.Workbooks
+ add_info = workbooks.ole_method_help("Add")
+ assert_equal(1, add_info.size_params)
+ assert_equal(1, add_info.size_opt_params)
+ assert(add_info.params[0].input?)
+ assert(add_info.params[0].optional?)
+ assert_equal('VARIANT', add_info.params[0].ole_type)
+ end
+ def teardown
+ @excel.quit
+ @excel = nil
+ GC.start
+ end
+end
+
+class TestWin32OLE_WITH_MSI < RUNIT::TestCase
+ def setup
+ installer = WIN32OLE.new("WindowsInstaller.Installer")
+ @record = installer.CreateRecord(2)
+ end
+
+ # Sorry, this test fails.
+ # Win32OLE does not support this style to set property.
+ # Use Win32OLE#setproperty or Win32OLE#[]= .
+ # def test_invoke
+ # @record.invoke("StringData", 1, 'cccc')
+ # assert_equal('cccc', @record.StringData(1))
+ # end
+
+ def test_setproperty
+ @record.setproperty( "StringData", 1, 'dddd')
+ assert_equal('dddd', @record.StringData(1))
+ end
+ def test_bracket_equal_with_arg
+ @record[ "StringData", 1 ] = 'ffff'
+ assert_equal('ffff', @record.StringData(1))
+ end
+
+ def test__invoke
+ shell=WIN32OLE.new('Shell.Application')
+ assert_equal(shell.NameSpace(0).title, shell._invoke(0x60020002, [0], [WIN32OLE::VARIANT::VT_VARIANT]).title)
+ end
+end
+
+# ---------------------
+#
+# a subclass of Win32OLE
+# override new() and connect()
+class MyExcel<WIN32OLE
+ def MyExcel.new
+ super "Excel.Application"
+ end
+ def MyExcel.connect
+ super "Excel.Application"
+ end
+end
+
+class TestMyExcel < TestWin32OLE
+#
+# because we overrided new() and connect()
+# we need to change the test.
+# also, because the class will be different
+#
+ def setup
+ @excel = MyExcel.new
+ @excel.visible = true
+ end
+ def test_s_new
+ assert_instance_of(MyExcel, @excel)
+ end
+ def test_s_connect
+ excel2 = MyExcel.connect
+ assert_instance_of(MyExcel, excel2)
+ end
+#
+# const_load didn't like to be called twice,
+# and I don't know how to undefine something in Ruby yet
+# so, hide the test.
+#
+ private :test_s_const_load
+end
+
+if $0 == __FILE__
+ puts "Now Test Win32OLE version #{WIN32OLE::VERSION}"
+ if ARGV.size == 0
+ suite = RUNIT::TestSuite.new
+ suite.add_test(TestWin32OLE.suite)
+ suite.add_test(TestMyExcel.suite)
+ begin
+ installer = WIN32OLE.new("WindowsInstaller.Installer")
+ suite.add_test(TestWin32OLE_WITH_MSI.suite)
+ rescue
+ puts "Skip some test with MSI"
+ end
+ else
+ suite = RUNIT::TestSuite.new
+ ARGV.each do |testmethod|
+ suite.add_test(TestWin32OLE.new(testmethod))
+ end
+ end
+ RUNIT::CUI::TestRunner.quiet_mode = true
+ RUNIT::CUI::TestRunner.run(suite)
+end
diff --git a/ext/win32ole/tests/test_ole_methods.rb b/ext/win32ole/tests/test_ole_methods.rb
new file mode 100644
index 0000000000..ca1c03b010
--- /dev/null
+++ b/ext/win32ole/tests/test_ole_methods.rb
@@ -0,0 +1,36 @@
+#
+# This is test for [ruby-talk:196897]
+#
+begin
+ require 'win32ole'
+rescue LoadError
+end
+require "test/unit"
+
+if defined?(WIN32OLE)
+ class TestWIN32OLE_FOR_PROPERTYPUTREF < Test::Unit::TestCase
+
+ def setup
+ @obj = WIN32OLE.new('Scripting.Dictionary')
+ end
+
+ def test_ole_methods
+ x = @obj.ole_methods.select {|m|
+ m.invoke_kind == 'PROPERTYPUTREF'
+ }
+ assert(x.size > 0)
+ assert_equal(1, x.size)
+ assert_equal('Item', x[0].name)
+ end
+
+ def test_ole_put_methods
+ x = @obj.ole_put_methods.select {|m|
+ m.invoke_kind == 'PROPERTYPUTREF'
+ }
+ assert(x.size > 0)
+ assert_equal(1, x.size)
+ assert_equal('Item', x[0].name)
+ end
+
+ end
+end
diff --git a/ext/win32ole/tests/test_propertyputref.rb b/ext/win32ole/tests/test_propertyputref.rb
new file mode 100644
index 0000000000..befc35ca9c
--- /dev/null
+++ b/ext/win32ole/tests/test_propertyputref.rb
@@ -0,0 +1,19 @@
+require 'test/unit'
+require 'win32ole'
+
+class TestWIN32OLE_PROPERTYPUTREF < Test::Unit::TestCase
+ def setup
+ begin
+ @sapi = WIN32OLE.new('SAPI.SpVoice')
+ rescue WIN32OLERuntimeError
+ @sapi = nil
+ end
+ end
+ def test_sapi
+ if @sapi
+ new_id = @sapi.getvoices.item(2).Id
+ @sapi.voice = @sapi.getvoices.item(2)
+ assert_equal(new_id, @sapi.voice.Id)
+ end
+ end
+end
diff --git a/ext/win32ole/tests/test_win32ole_event.rb b/ext/win32ole/tests/test_win32ole_event.rb
new file mode 100644
index 0000000000..744021dfd2
--- /dev/null
+++ b/ext/win32ole/tests/test_win32ole_event.rb
@@ -0,0 +1,133 @@
+begin
+ require 'win32ole'
+rescue LoadError
+end
+require 'test/unit'
+
+if defined?(WIN32OLE_EVENT)
+ class TestWIN32OLE_EVENT < Test::Unit::TestCase
+ def create_temp_html
+ fso = WIN32OLE.new('Scripting.FileSystemObject')
+ dummy_file = fso.GetTempName + ".html"
+ cfolder = fso.getFolder(".")
+ f = cfolder.CreateTextFile(dummy_file)
+ f.writeLine("<html><body>This is test HTML file for Win32OLE.</body></html>")
+ f.close
+ dummy_path = cfolder.path + "\\" + dummy_file
+ dummy_path
+ end
+
+ def setup
+ @ie = WIN32OLE.new("InternetExplorer.Application")
+ @ie.visible = true
+ @event = ""
+ @event2 = ""
+ @event3 = ""
+ @f = create_temp_html
+ end
+
+ def default_handler(event, *args)
+ @event += event
+ end
+
+ def test_on_event
+ ev = WIN32OLE_EVENT.new(@ie, 'DWebBrowserEvents')
+ ev.on_event {|*args| default_handler(*args)}
+ @ie.navigate("file:///#{@f}")
+ while @ie.busy
+ WIN32OLE_EVENT.new(@ie, 'DWebBrowserEvents')
+ GC.start
+ sleep 0.1
+ end
+ assert_match(/BeforeNavigate/, @event)
+ assert_match(/NavigateComplete/, @event)
+ end
+
+ def test_on_event2
+ ev = WIN32OLE_EVENT.new(@ie, 'DWebBrowserEvents')
+ ev.on_event('BeforeNavigate') {|*args| handler1}
+ ev.on_event('BeforeNavigate') {|*args| handler2}
+ @ie.navigate("file:///#{@f}")
+ while @ie.busy
+ sleep 0.1
+ end
+ assert_equal("handler2", @event2)
+ end
+
+ def test_on_event3
+ ev = WIN32OLE_EVENT.new(@ie, 'DWebBrowserEvents')
+ ev.on_event {|*args| handler1}
+ ev.on_event {|*args| handler2}
+ @ie.navigate("file:///#{@f}")
+ while @ie.busy
+ sleep 0.1
+ end
+ assert_equal("handler2", @event2)
+ end
+
+ def test_on_event4
+ ev = WIN32OLE_EVENT.new(@ie, 'DWebBrowserEvents')
+ ev.on_event{|*args| handler1}
+ ev.on_event{|*args| handler2}
+ ev.on_event('NavigateComplete'){|*args| handler3(*args)}
+ @ie.navigate("file:///#{@f}")
+ while @ie.busy
+ sleep 0.1
+ end
+ assert(@event3!="")
+ assert("handler2", @event2)
+ end
+
+ def test_on_event5
+ ev = WIN32OLE_EVENT.new(@ie, 'DWebBrowserEvents')
+ ev.on_event {|*args| default_handler(*args)}
+ ev.on_event('NavigateComplete'){|*args| handler3(*args)}
+ @ie.navigate("file:///#{@f}")
+ while @ie.busy
+ sleep 0.1
+ end
+ assert_match(/BeforeNavigate/, @event)
+ assert(/NavigateComplete/ !~ @event)
+ assert(@event!="")
+ end
+
+ def test_unadvise
+ ev = WIN32OLE_EVENT.new(@ie, 'DWebBrowserEvents')
+ ev.on_event {|*args| default_handler(*args)}
+ @ie.navigate("file:///#{@f}")
+ while @ie.busy
+ sleep 0.1
+ end
+ assert_match(/BeforeNavigate/, @event)
+ ev.unadvise
+ @event = ""
+ @ie.navigate("file:///#{@f}")
+ while @ie.busy
+ sleep 0.1
+ end
+ assert_equal("", @event);
+ assert_raise(WIN32OLERuntimeError) {
+ ev.on_event {|*args| default_handler(*args)}
+ }
+ end
+
+ def handler1
+ @event2 = "handler1"
+ end
+
+ def handler2
+ @event2 = "handler2"
+ end
+
+ def handler3(url)
+ @event3 += url
+ end
+
+ def teardown
+ @ie.quit
+ @ie = nil
+ File.unlink(@f)
+ GC.start
+ end
+ end
+end
diff --git a/ext/win32ole/tests/test_word.rb b/ext/win32ole/tests/test_word.rb
new file mode 100644
index 0000000000..53a6c521ba
--- /dev/null
+++ b/ext/win32ole/tests/test_word.rb
@@ -0,0 +1,37 @@
+#
+# This is test for [ruby-Bugs#3237]
+#
+begin
+ require 'win32ole'
+rescue LoadError
+end
+require "test/unit"
+
+if defined?(WIN32OLE)
+ class TestWIN32OLE_WITH_WORD < Test::Unit::TestCase
+
+ def setup
+ begin
+ @obj = WIN32OLE.new('Word.Application')
+ rescue WIN32OLERuntimeError
+ @obj = nil
+ end
+ end
+
+ def test_ole_methods
+ if @obj
+ @obj.visible = true
+ @obj.wordbasic.disableAutoMacros(true)
+ assert(true)
+ end
+ end
+
+ def teardown
+ if @obj
+ @obj.quit
+ @obj = nil
+ end
+ end
+
+ end
+end
diff --git a/ext/win32ole/tests/testall.rb b/ext/win32ole/tests/testall.rb
new file mode 100644
index 0000000000..553ce88509
--- /dev/null
+++ b/ext/win32ole/tests/testall.rb
@@ -0,0 +1,16 @@
+require 'rubyunit'
+require 'win32ole'
+puts "Now Test Win32OLE version #{WIN32OLE::VERSION}"
+# RUNIT::CUI::TestRunner.quiet_mode = true
+require "testWIN32OLE"
+require "testOLETYPE"
+require "testOLEPARAM"
+require "testOLEMETHOD"
+require "testOLEVARIABLE"
+require "testVARIANT"
+require "testNIL2VTEMPTY"
+require "test_ole_methods.rb"
+require "test_propertyputref.rb"
+require "test_word.rb"
+require "test_win32ole_event.rb"
+# require "testOLEEVENT"
diff --git a/ext/win32ole/win32ole.c b/ext/win32ole/win32ole.c
index 86f4f2e085..ae0066ffc9 100644
--- a/ext/win32ole/win32ole.c
+++ b/ext/win32ole/win32ole.c
@@ -12,22 +12,16 @@
*/
/*
+ $Date$
modified for win32ole (ruby) by Masaki.Suketa <masaki.suketa@nifty.ne.jp>
*/
-#include "ruby/ruby.h"
-#include "ruby/st.h"
-#include "ruby/encoding.h"
-#include <ctype.h>
+#include "ruby.h"
+#include "st.h"
#include <windows.h>
#include <ocidl.h>
#include <olectl.h>
#include <ole2.h>
-#if defined(HAVE_TYPE_IMULTILANGUAGE2) || defined(HAVE_TYPE_IMULTILANGUAGE)
-#include <mlang.h>
-#endif
-#include <stdlib.h>
-#include <math.h>
#ifdef HAVE_STDARG_PROTOTYPES
#include <stdarg.h>
#define va_init_list(a,b) va_start(a,b)
@@ -60,39 +54,6 @@
#define V_BOOL(X) V_UNION(X,boolVal)
#endif
-#ifndef V_I1REF
-#define V_I1REF(X) V_UNION(X, pcVal)
-#endif
-
-#ifndef U_UI2REF
-#define V_UI2REF(X) V_UNION(X, puiVal)
-#endif
-
-#ifndef V_INT
-#define V_INT(X) V_UNION(X, intVal)
-#endif
-
-#ifndef V_INTREF
-#define V_INTREF(X) V_UNION(X, pintVal)
-#endif
-
-#ifndef V_UINT
-#define V_UINT(X) V_UNION(X, uintVal)
-#endif
-
-#ifndef V_UINTREF
-#define V_UINTREF(X) V_UNION(X, puintVal)
-#endif
-
-/*
- * unfortunately IID_IMultiLanguage2 is not included in any libXXX.a
- * in Cygwin(mingw32).
- */
-#if defined(__CYGWIN__) || defined(__MINGW32__)
-#undef IID_IMultiLanguage2
-const IID IID_IMultiLanguage2 = {0xDCCFC164, 0x2B38, 0x11d2, {0xB7, 0xEC, 0x00, 0xC0, 0x4F, 0x8F, 0x5D, 0x9A}};
-#endif
-
#define OLE_RELEASE(X) (X) ? ((X)->lpVtbl->Release(X)) : 0
#define OLE_ADDREF(X) (X) ? ((X)->lpVtbl->AddRef(X)) : 0
@@ -101,7 +62,7 @@ const IID IID_IMultiLanguage2 = {0xDCCFC164, 0x2B38, 0x11d2, {0xB7, 0xEC, 0x00,
#define OLE_RELEASE_TYPEATTR(X, Y) ((X)->lpVtbl->ReleaseTypeAttr((X), (Y)))
#define OLE_FREE(x) {\
- if(g_ole_initialized == TRUE) {\
+ if(gOLEInitialized == Qtrue) {\
if(x) {\
OLE_RELEASE(x);\
(x) = 0;\
@@ -116,28 +77,15 @@ const IID IID_IMultiLanguage2 = {0xDCCFC164, 0x2B38, 0x11d2, {0xB7, 0xEC, 0x00,
}\
}
-#ifdef HAVE_LONG_LONG
-#define I8_2_NUM LL2NUM
-#define UI8_2_NUM ULL2NUM
-#define NUM2I8 NUM2LL
-#define NUM2UI8 NUM2ULL
-#else
-#define I8_2_NUM INT2NUM
-#define UI8_2_NUM UINT2NUM
-#define NUM2I8 NUM2INT
-#define NUM2UI8 NUM2UINT
-#endif
-
#define WC2VSTR(x) ole_wc2vstr((x), TRUE)
-#define WIN32OLE_VERSION "1.4.0"
+#define WIN32OLE_VERSION "0.7.6"
typedef HRESULT (STDAPICALLTYPE FNCOCREATEINSTANCEEX)
(REFCLSID, IUnknown*, DWORD, COSERVERINFO*, DWORD, MULTI_QI*);
typedef HWND (WINAPI FNHTMLHELP)(HWND hwndCaller, LPCSTR pszFile,
UINT uCommand, DWORD dwData);
-typedef BOOL (FNENUMSYSEMCODEPAGES) (CODEPAGE_ENUMPROC, DWORD);
typedef struct {
struct IEventSinkVtbl * lpVtbl;
} IEventSink, *PEVENTSINK;
@@ -184,50 +132,35 @@ typedef struct tagIEVENTSINKOBJ {
DWORD m_cRef;
IID m_iid;
int m_event_id;
+ DWORD m_dwCookie;
+ IConnectionPoint *pConnectionPoint;
ITypeInfo *pTypeInfo;
+ int *ptr_freed;
}IEVENTSINKOBJ, *PIEVENTSINKOBJ;
VALUE cWIN32OLE;
-VALUE cWIN32OLE_TYPELIB;
VALUE cWIN32OLE_TYPE;
VALUE cWIN32OLE_VARIABLE;
VALUE cWIN32OLE_METHOD;
VALUE cWIN32OLE_PARAM;
VALUE cWIN32OLE_EVENT;
-VALUE cWIN32OLE_VARIANT;
-VALUE eWIN32OLERuntimeError;
+VALUE eWIN32OLE_RUNTIME_ERROR;
VALUE mWIN32OLE_VARIANT;
-VALUE cWIN32OLE_PROPERTY;
static VALUE ary_ole_event;
static ID id_events;
-static BOOL g_ole_initialized = FALSE;
-static BOOL g_cp_installed = FALSE;
-static BOOL g_lcid_installed = FALSE;
+static BOOL gOLEInitialized = Qfalse;
static HINSTANCE ghhctrl = NULL;
static HINSTANCE gole32 = NULL;
static FNCOCREATEINSTANCEEX *gCoCreateInstanceEx = NULL;
static VALUE com_hash;
static IDispatchVtbl com_vtbl;
-static UINT cWIN32OLE_cp = CP_ACP;
-static LCID cWIN32OLE_lcid = LOCALE_SYSTEM_DEFAULT;
-static rb_encoding *cWIN32OLE_enc;
-static UINT g_cp_to_check = CP_ACP;
-static char g_lcid_to_check[8 + 1];
+static UINT cWIN32OLE_cp = CP_ACP;
static VARTYPE g_nil_to = VT_ERROR;
-static st_table *enc2cp_table;
static IMessageFilterVtbl message_filter;
static IMessageFilter imessage_filter = { &message_filter };
static IMessageFilter* previous_filter;
-#if defined(HAVE_TYPE_IMULTILANGUAGE2)
-static IMultiLanguage2 *pIMultiLanguage = NULL;
-#elif defined(HAVE_TYPE_IMULTILANGUAGE)
-static IMultiLanguage *pIMultiLanguage = NULL;
-#else
-#define pIMultiLanguage NULL /* dummy */
-#endif
-
struct oledata {
IDispatch *pDispatch;
};
@@ -254,9 +187,8 @@ struct oleparamdata {
};
struct oleeventdata {
- DWORD dwCookie;
- IConnectionPoint *pConnectionPoint;
- long event_id;
+ IEVENTSINKOBJ *pEvent;
+ int freed;
};
struct oleparam {
@@ -264,308 +196,15 @@ struct oleparam {
OLECHAR** pNamedArgs;
};
-struct olevariantdata {
- VARIANT realvar;
- VARIANT var;
-};
-
-
-static HRESULT ( STDMETHODCALLTYPE QueryInterface )(IDispatch __RPC_FAR *, REFIID riid, void __RPC_FAR *__RPC_FAR *ppvObject);
-static ULONG ( STDMETHODCALLTYPE AddRef )(IDispatch __RPC_FAR * This);
-static ULONG ( STDMETHODCALLTYPE Release )(IDispatch __RPC_FAR * This);
-static HRESULT ( STDMETHODCALLTYPE GetTypeInfoCount )(IDispatch __RPC_FAR * This, UINT __RPC_FAR *pctinfo);
-static HRESULT ( STDMETHODCALLTYPE GetTypeInfo )(IDispatch __RPC_FAR * This, UINT iTInfo, LCID lcid, ITypeInfo __RPC_FAR *__RPC_FAR *ppTInfo);
-static HRESULT ( STDMETHODCALLTYPE GetIDsOfNames )(IDispatch __RPC_FAR * This, REFIID riid, LPOLESTR __RPC_FAR *rgszNames, UINT cNames, LCID lcid, DISPID __RPC_FAR *rgDispId);
-static HRESULT ( STDMETHODCALLTYPE Invoke )( IDispatch __RPC_FAR * This, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS __RPC_FAR *pDispParams, VARIANT __RPC_FAR *pVarResult, EXCEPINFO __RPC_FAR *pExcepInfo, UINT __RPC_FAR *puArgErr);
-static IDispatch* val2dispatch(VALUE val);
-static void time2d(int hh, int mm, int ss, double *pv);
-static void d2time(double v, int *hh, int *mm, int *ss);
-static void civil2jd(int y, int m, int d, long *jd);
-static void jd2civil(long day, int *yy, int *mm, int *dd);
-static void double2time(double v, int *y, int *m, int *d, int *hh, int *mm, int *ss);
-static double time_object2date(VALUE tmobj);
-static VALUE date2time_str(double date);
-static rb_encoding *ole_cp2encoding(UINT cp);
-static UINT ole_encoding2cp(rb_encoding *enc);
-NORETURN(static void failed_load_conv51932(void));
-#ifndef pIMultiLanguage
-static void load_conv_function51932(void);
-#endif
-static UINT ole_init_cp(void);
-static char *ole_wc2mb(LPWSTR pw);
-static VALUE ole_hresult2msg(HRESULT hr);
-static void ole_freeexceptinfo(EXCEPINFO *pExInfo);
-static VALUE ole_excepinfo2msg(EXCEPINFO *pExInfo);
-static void ole_raise(HRESULT hr, VALUE ecs, const char *fmt, ...);
-static void ole_initialize();
-static void ole_msg_loop();
-static void ole_free(struct oledata *pole);
-static void oletype_free(struct oletypedata *poletype);
-static void olemethod_free(struct olemethoddata *polemethod);
-static void olevariable_free(struct olevariabledata *polevar);
-static void oleparam_free(struct oleparamdata *pole);
-static LPWSTR ole_vstr2wc(VALUE vstr);
-static LPWSTR ole_mb2wc(char *pm, int len);
-static VALUE ole_wc2vstr(LPWSTR pw, BOOL isfree);
-static VALUE ole_ary_m_entry(VALUE val, long *pid);
-static void * get_ptr_of_variant(VARIANT *pvar);
-static VALUE is_all_index_under(long *pid, long *pub, long dim);
-static void ole_set_safe_array(long n, SAFEARRAY *psa, long *pid, long *pub, VALUE val, long dim, VARTYPE vt);
-static long dimension(VALUE val);
-static long ary_len_of_dim(VALUE ary, long dim);
-static HRESULT ole_val_ary2variant_ary(VALUE val, VARIANT *var, VARTYPE vt);
-static void ole_val2variant(VALUE val, VARIANT *var);
-static void ole_val2variant_ex(VALUE val, VARIANT *var, VARTYPE vt);
-static void ole_val2ptr_variant(VALUE val, VARIANT *var);
-static void ole_set_byref(VARIANT *realvar, VARIANT *var, VARTYPE vt);
-static void ole_val2olevariantdata(VALUE val, VARTYPE vt, struct olevariantdata *pvar);
-static void ole_val2variant2(VALUE val, VARIANT *var);
-static VALUE make_inspect(const char *class_name, VALUE detail);
-static VALUE default_inspect(VALUE self, const char *class_name);
-static VALUE ole_set_member(VALUE self, IDispatch *dispatch);
-static VALUE fole_s_allocate(VALUE klass);
-static VALUE create_win32ole_object(VALUE klass, IDispatch *pDispatch, int argc, VALUE *argv);
-static VALUE ary_new_dim(VALUE myary, long *pid, long *plb, long dim);
-static void ary_store_dim(VALUE myary, long *pid, long *plb, long dim, VALUE val);
-static VALUE ole_variant2val(VARIANT *pvar);
-static LONG reg_open_key(HKEY hkey, const char *name, HKEY *phkey);
-static LONG reg_open_vkey(HKEY hkey, VALUE key, HKEY *phkey);
-static VALUE reg_enum_key(HKEY hkey, DWORD i);
-static VALUE reg_get_val(HKEY hkey, const char *subkey);
-static VALUE reg_get_typelib_file_path(HKEY hkey);
-static VALUE typelib_file_from_clsid(VALUE ole);
-static VALUE typelib_file_from_typelib(VALUE ole);
-static VALUE typelib_file(VALUE ole);
-static void ole_const_load(ITypeLib *pTypeLib, VALUE klass, VALUE self);
-static HRESULT clsid_from_remote(VALUE host, VALUE com, CLSID *pclsid);
-static VALUE ole_create_dcom(int argc, VALUE *argv, VALUE self);
-static VALUE ole_bind_obj(VALUE moniker, int argc, VALUE *argv, VALUE self);
-static VALUE fole_s_connect(int argc, VALUE *argv, VALUE self);
-static VALUE fole_s_const_load(int argc, VALUE *argv, VALUE self);
-static VALUE ole_types_from_typelib(ITypeLib *pTypeLib, VALUE classes);
-static ULONG reference_count(struct oledata * pole);
-static VALUE fole_s_reference_count(VALUE self, VALUE obj);
-static VALUE fole_s_free(VALUE self, VALUE obj);
-static HWND ole_show_help(VALUE helpfile, VALUE helpcontext);
-static VALUE fole_s_show_help(int argc, VALUE *argv, VALUE self);
-static VALUE fole_s_get_code_page(VALUE self);
-static BOOL CALLBACK installed_code_page_proc(LPTSTR str);
-static BOOL code_page_installed(UINT cp);
-static VALUE fole_s_set_code_page(VALUE self, VALUE vcp);
-static VALUE fole_s_get_locale(VALUE self);
-static BOOL CALLBACK installed_lcid_proc(LPTSTR str);
-static BOOL lcid_installed(LCID lcid);
-static VALUE fole_s_set_locale(VALUE self, VALUE vlcid);
-static VALUE fole_s_create_guid(VALUE self);
-static VALUE fole_initialize(int argc, VALUE *argv, VALUE self);
-static VALUE hash2named_arg(VALUE pair, struct oleparam* pOp);
-static VALUE set_argv(VARIANTARG* realargs, unsigned int beg, unsigned int end);
-static VALUE ole_invoke(int argc, VALUE *argv, VALUE self, USHORT wFlags, BOOL is_bracket);
-static VALUE fole_invoke(int argc, VALUE *argv, VALUE self);
-static VALUE ole_invoke2(VALUE self, VALUE dispid, VALUE args, VALUE types, USHORT dispkind);
-static VALUE fole_invoke2(VALUE self, VALUE dispid, VALUE args, VALUE types);
-static VALUE fole_getproperty2(VALUE self, VALUE dispid, VALUE args, VALUE types);
-static VALUE fole_setproperty2(VALUE self, VALUE dispid, VALUE args, VALUE types);
-static VALUE fole_setproperty_with_bracket(int argc, VALUE *argv, VALUE self);
-static VALUE fole_setproperty(int argc, VALUE *argv, VALUE self);
-static VALUE fole_getproperty_with_bracket(int argc, VALUE *argv, VALUE self);
-static VALUE ole_propertyput(VALUE self, VALUE property, VALUE value);
-static VALUE fole_free(VALUE self);
-static VALUE ole_each_sub(VALUE pEnumV);
-static VALUE ole_ienum_free(VALUE pEnumV);
-static VALUE fole_each(VALUE self);
-static VALUE fole_missing(int argc, VALUE *argv, VALUE self);
-static VALUE ole_method_sub(VALUE self, ITypeInfo *pOwnerTypeInfo, ITypeInfo *pTypeInfo, VALUE name);
-static VALUE olemethod_from_typeinfo(VALUE self, ITypeInfo *pTypeInfo, VALUE name);
-static VALUE ole_methods_sub(ITypeInfo *pOwnerTypeInfo, ITypeInfo *pTypeInfo, VALUE methods, int mask);
-static VALUE ole_methods_from_typeinfo(ITypeInfo *pTypeInfo, int mask);
-static HRESULT typeinfo_from_ole(struct oledata *pole, ITypeInfo **ppti);
-static VALUE ole_methods(VALUE self, int mask);
-static VALUE fole_methods(VALUE self);
-static VALUE fole_get_methods(VALUE self);
-static VALUE fole_put_methods(VALUE self);
-static VALUE fole_func_methods(VALUE self);
-static VALUE ole_type_from_itypeinfo(ITypeInfo *pTypeInfo);
-static VALUE fole_type(VALUE self);
-static VALUE make_oletypelib_obj(VALUE guid, VALUE major_version, VALUE minor_version);
-static VALUE ole_typelib_from_itypelib(ITypeLib *pTypeLib);
-static VALUE ole_typelib_from_itypeinfo(ITypeInfo *pTypeInfo);
-static VALUE fole_typelib(VALUE self);
-static VALUE fole_query_interface(VALUE self, VALUE str_iid);
-static VALUE fole_respond_to(VALUE self, VALUE method);
-static HRESULT ole_docinfo_from_type(ITypeInfo *pTypeInfo, BSTR *name, BSTR *helpstr, DWORD *helpcontext, BSTR *helpfile);
-static VALUE ole_usertype2val(ITypeInfo *pTypeInfo, TYPEDESC *pTypeDesc, VALUE typedetails);
-static VALUE ole_ptrtype2val(ITypeInfo *pTypeInfo, TYPEDESC *pTypeDesc, VALUE typedetails);
-static VALUE ole_typedesc2val(ITypeInfo *pTypeInfo, TYPEDESC *pTypeDesc, VALUE typedetails);
-static VALUE fole_method_help(VALUE self, VALUE cmdname);
-static VALUE fole_activex_initialize(VALUE self);
-static VALUE foletype_s_ole_classes(VALUE self, VALUE typelib);
-static VALUE foletype_s_typelibs(VALUE self);
-static VALUE foletype_s_progids(VALUE self);
-static VALUE foletype_s_allocate(VALUE klass);
-static VALUE oletype_set_member(VALUE self, ITypeInfo *pTypeInfo, VALUE name);
-static VALUE oleclass_from_typelib(VALUE self, ITypeLib *pTypeLib, VALUE oleclass);
-static VALUE oletypelib_set_member(VALUE self, VALUE typelib, VALUE guid, VALUE version);
-static VALUE foletypelib_s_typelibs(VALUE self);
-static VALUE make_version_str(VALUE major, VALUE minor);
-static VALUE oletypelib_search_registry2(VALUE self, VALUE args);
-static VALUE oletypelib_search_registry(VALUE self, VALUE typelib);
-static VALUE foletypelib_initialize(VALUE self, VALUE args);
-static VALUE foletypelib_guid(VALUE self);
-static VALUE foletypelib_name(VALUE self);
-static VALUE foletypelib_version(VALUE self);
-static VALUE foletypelib_major_version(VALUE self);
-static VALUE foletypelib_minor_version(VALUE self);
-static VALUE oletypelib_path(VALUE guid, VALUE version);
-static VALUE foletypelib_path(VALUE self);
-static void oletypelib2itypelib(VALUE self, ITypeLib **ppTypeLib);
-static VALUE foletypelib_visible(VALUE self);
-static VALUE foletypelib_library_name(VALUE self);
-static VALUE foletypelib_ole_types(VALUE self);
-static VALUE foletypelib_inspect(VALUE self);
-static VALUE foletype_initialize(VALUE self, VALUE typelib, VALUE oleclass);
-static VALUE foletype_name(VALUE self);
-static VALUE ole_ole_type(ITypeInfo *pTypeInfo);
-static VALUE foletype_ole_type(VALUE self);
-static VALUE ole_type_guid(ITypeInfo *pTypeInfo);
-static VALUE foletype_guid(VALUE self);
-static VALUE ole_type_progid(ITypeInfo *pTypeInfo);
-static VALUE foletype_progid(VALUE self);
-static VALUE ole_type_visible(ITypeInfo *pTypeInfo);
-static VALUE foletype_visible(VALUE self);
-static VALUE ole_type_major_version(ITypeInfo *pTypeInfo);
-static VALUE foletype_major_version(VALUE self);
-static VALUE ole_type_minor_version(ITypeInfo *pTypeInfo);
-static VALUE foletype_minor_version(VALUE self);
-static VALUE ole_type_typekind(ITypeInfo *pTypeInfo);
-static VALUE foletype_typekind(VALUE self);
-static VALUE ole_type_helpstring(ITypeInfo *pTypeInfo);
-static VALUE foletype_helpstring(VALUE self);
-static VALUE ole_type_src_type(ITypeInfo *pTypeInfo);
-static VALUE foletype_src_type(VALUE self);
-static VALUE ole_type_helpfile(ITypeInfo *pTypeInfo);
-static VALUE foletype_helpfile(VALUE self);
-static VALUE ole_type_helpcontext(ITypeInfo *pTypeInfo);
-static VALUE foletype_helpcontext(VALUE self);
-static VALUE foletype_ole_typelib(VALUE self);
-static VALUE ole_type_impl_ole_types(ITypeInfo *pTypeInfo, int implflags);
-static VALUE foletype_impl_ole_types(VALUE self);
-static VALUE foletype_source_ole_types(VALUE self);
-static VALUE foletype_default_event_sources(VALUE self);
-static VALUE foletype_default_ole_types(VALUE self);
-static VALUE foletype_inspect(VALUE self);
-static VALUE ole_variables(ITypeInfo *pTypeInfo);
-static VALUE foletype_variables(VALUE self);
-static VALUE foletype_methods(VALUE self);
-static VALUE folevariable_name(VALUE self);
-static VALUE ole_variable_ole_type(ITypeInfo *pTypeInfo, UINT var_index);
-static VALUE folevariable_ole_type(VALUE self);
-static VALUE ole_variable_ole_type_detail(ITypeInfo *pTypeInfo, UINT var_index);
-static VALUE folevariable_ole_type_detail(VALUE self);
-static VALUE ole_variable_value(ITypeInfo *pTypeInfo, UINT var_index);
-static VALUE folevariable_value(VALUE self);
-static VALUE ole_variable_visible(ITypeInfo *pTypeInfo, UINT var_index);
-static VALUE folevariable_visible(VALUE self);
-static VALUE ole_variable_kind(ITypeInfo *pTypeInfo, UINT var_index);
-static VALUE folevariable_variable_kind(VALUE self);
-static VALUE ole_variable_varkind(ITypeInfo *pTypeInfo, UINT var_index);
-static VALUE folevariable_varkind(VALUE self);
-static VALUE folevariable_inspect(VALUE self);
-static VALUE olemethod_set_member(VALUE self, ITypeInfo *pTypeInfo, ITypeInfo *pOwnerTypeInfo, int index, VALUE name);
-static VALUE folemethod_s_allocate(VALUE klass);
-static VALUE folemethod_initialize(VALUE self, VALUE oletype, VALUE method);
-static VALUE folemethod_name(VALUE self);
-static VALUE ole_method_return_type(ITypeInfo *pTypeInfo, UINT method_index);
-static VALUE folemethod_return_type(VALUE self);
-static VALUE ole_method_return_vtype(ITypeInfo *pTypeInfo, UINT method_index);
-static VALUE folemethod_return_vtype(VALUE self);
-static VALUE ole_method_return_type_detail(ITypeInfo *pTypeInfo, UINT method_index);
-static VALUE folemethod_return_type_detail(VALUE self);
-static VALUE ole_method_invkind(ITypeInfo *pTypeInfo, UINT method_index);
-static VALUE ole_method_invoke_kind(ITypeInfo *pTypeInfo, UINT method_index);
-static VALUE folemethod_invkind(VALUE self);
-static VALUE folemethod_invoke_kind(VALUE self);
-static VALUE ole_method_visible(ITypeInfo *pTypeInfo, UINT method_index);
-static VALUE folemethod_visible(VALUE self);
-static VALUE ole_method_event(ITypeInfo *pTypeInfo, UINT method_index, VALUE method_name);
-static VALUE folemethod_event(VALUE self);
-static VALUE folemethod_event_interface(VALUE self);
-static VALUE ole_method_docinfo_from_type(ITypeInfo *pTypeInfo, UINT method_index, BSTR *name, BSTR *helpstr, DWORD *helpcontext, BSTR *helpfile);
-static VALUE ole_method_helpstring(ITypeInfo *pTypeInfo, UINT method_index);
-static VALUE folemethod_helpstring(VALUE self);
-static VALUE ole_method_helpfile(ITypeInfo *pTypeInfo, UINT method_index);
-static VALUE folemethod_helpfile(VALUE self);
-static VALUE ole_method_helpcontext(ITypeInfo *pTypeInfo, UINT method_index);
-static VALUE folemethod_helpcontext(VALUE self);
-static VALUE ole_method_dispid(ITypeInfo *pTypeInfo, UINT method_index);
-static VALUE folemethod_dispid(VALUE self);
-static VALUE ole_method_offset_vtbl(ITypeInfo *pTypeInfo, UINT method_index);
-static VALUE folemethod_offset_vtbl(VALUE self);
-static VALUE ole_method_size_params(ITypeInfo *pTypeInfo, UINT method_index);
-static VALUE folemethod_size_params(VALUE self);
-static VALUE ole_method_size_opt_params(ITypeInfo *pTypeInfo, UINT method_index);
-static VALUE folemethod_size_opt_params(VALUE self);
-static VALUE ole_method_params(ITypeInfo *pTypeInfo, UINT method_index);
-static VALUE folemethod_params(VALUE self);
-static VALUE folemethod_inspect(VALUE self);
-static VALUE foleparam_name(VALUE self);
-static VALUE ole_param_ole_type(ITypeInfo *pTypeInfo, UINT method_index, UINT index);
-static VALUE foleparam_ole_type(VALUE self);
-static VALUE ole_param_ole_type_detail(ITypeInfo *pTypeInfo, UINT method_index, UINT index);
-static VALUE foleparam_ole_type_detail(VALUE self);
-static VALUE ole_param_flag_mask(ITypeInfo *pTypeInfo, UINT method_index, UINT index, USHORT mask);
-static VALUE foleparam_input(VALUE self);
-static VALUE foleparam_output(VALUE self);
-static VALUE foleparam_optional(VALUE self);
-static VALUE foleparam_retval(VALUE self);
-static VALUE ole_param_default(ITypeInfo *pTypeInfo, UINT method_index, UINT index);
-static VALUE foleparam_default(VALUE self);
-static VALUE foleparam_inspect(VALUE self);
-static long ole_search_event_at(VALUE ary, VALUE ev);
-static VALUE ole_search_event(VALUE ary, VALUE ev, BOOL *is_default);
-static VALUE ole_search_handler_method(VALUE handler, VALUE ev, BOOL *is_default_handler);
-static void ole_delete_event(VALUE ary, VALUE ev);
-static void hash2ptr_dispparams(VALUE hash, ITypeInfo *pTypeInfo, DISPID dispid, DISPPARAMS *pdispparams);
-static VALUE hash2result(VALUE hash);
-static void ary2ptr_dispparams(VALUE ary, DISPPARAMS *pdispparams);
-static VALUE exec_callback(VALUE arg);
-static VALUE rescue_callback(VALUE arg);
-static HRESULT find_iid(VALUE ole, char *pitf, IID *piid, ITypeInfo **ppTypeInfo);
-static HRESULT find_coclass(ITypeInfo *pTypeInfo, TYPEATTR *pTypeAttr, ITypeInfo **pTypeInfo2, TYPEATTR **pTypeAttr2);
-static HRESULT find_default_source_from_typeinfo(ITypeInfo *pTypeInfo, TYPEATTR *pTypeAttr, ITypeInfo **ppTypeInfo);
-static HRESULT find_default_source(VALUE ole, IID *piid, ITypeInfo **ppTypeInfo);
-static void ole_event_free(struct oleeventdata *poleev);
-static VALUE fev_s_allocate(VALUE klass);
-static VALUE ev_advise(int argc, VALUE *argv, VALUE self);
-static VALUE fev_initialize(int argc, VALUE *argv, VALUE self);
-static VALUE fev_s_msg_loop(VALUE klass);
-static void add_event_call_back(VALUE obj, VALUE event, VALUE data);
-static VALUE ev_on_event(int argc, VALUE *argv, VALUE self, VALUE is_ary_arg);
-static VALUE fev_on_event(int argc, VALUE *argv, VALUE self);
-static VALUE fev_on_event_with_outargs(int argc, VALUE *argv, VALUE self);
-static VALUE fev_off_event(int argc, VALUE *argv, VALUE self);
-static VALUE fev_unadvise(VALUE self);
-static VALUE fev_set_handler(VALUE self, VALUE val);
-static VALUE fev_get_handler(VALUE self);
-static VALUE evs_push(VALUE ev);
-static VALUE evs_delete(long i);
-static VALUE evs_entry(long i);
-static VALUE evs_length();
-static void olevariant_free(struct olevariantdata *pvar);
-static VALUE folevariant_s_allocate(VALUE klass);
-static VALUE folevariant_s_array(VALUE klass, VALUE dims, VALUE vvt);
-static VALUE folevariant_initialize(VALUE self, VALUE args);
-static long *ary2safe_array_index(int ary_size, VALUE *ary, SAFEARRAY *psa);
-static void unlock_safe_array(SAFEARRAY *psa);
-static SAFEARRAY *get_locked_safe_array(VALUE val);
-static VALUE folevariant_ary_aref(int argc, VALUE *argv, VALUE self);
-static VOID * val2variant_ptr(VALUE val, VARIANT *var, VARTYPE vt);
-static VALUE folevariant_ary_aset(int argc, VALUE *argv, VALUE self);
-static VALUE folevariant_value(VALUE self);
-static VALUE folevariant_vartype(VALUE self);
-static VALUE folevariant_set_value(VALUE self, VALUE val);
-static void init_enc2cp();
-static void free_enc2cp();
+static VALUE folemethod_s_allocate _((VALUE));
+static VALUE olemethod_set_member _((VALUE, ITypeInfo *, ITypeInfo *, int, VALUE));
+static VALUE foletype_s_allocate _((VALUE));
+static VALUE oletype_set_member _((VALUE, ITypeInfo *, VALUE));
+static VALUE olemethod_from_typeinfo _((VALUE, ITypeInfo *, VALUE));
+static HRESULT ole_docinfo_from_type _((ITypeInfo *, BSTR *, BSTR *, DWORD *, BSTR *));
+static char *ole_wc2mb(LPWSTR);
+static VALUE ole_variant2val(VARIANT*);
+static void ole_val2variant(VALUE, VARIANT*);
static HRESULT (STDMETHODCALLTYPE mf_QueryInterface)(
IMessageFilter __RPC_FAR * This,
@@ -730,9 +369,7 @@ static HRESULT ( STDMETHODCALLTYPE GetIDsOfNames )(
/* [in] */ LCID lcid,
/* [size_is][out] */ DISPID __RPC_FAR *rgDispId)
{
- /*
Win32OLEIDispatch* p = (Win32OLEIDispatch*)This;
- */
char* psz = ole_wc2mb(*rgszNames); // support only one method
*rgDispId = rb_intern(psz);
free(psz);
@@ -771,7 +408,8 @@ static /* [local] */ HRESULT ( STDMETHODCALLTYPE Invoke )(
}
static IDispatch*
-val2dispatch(VALUE val)
+val2dispatch(val)
+ VALUE val;
{
struct st_table *tbl = DATA_PTR(com_hash);
Win32OLEIDispatch* pdisp;
@@ -792,18 +430,22 @@ val2dispatch(VALUE val)
}
static void
-time2d(int hh, int mm, int ss, double *pv)
+time2d(hh, mm, ss, pv)
+ int hh, mm, ss;
+ double *pv;
{
*pv = (hh * 60.0 * 60.0 + mm * 60.0 + ss) / 86400.0;
}
static void
-d2time(double v, int *hh, int *mm, int *ss)
+d2time(v, hh, mm, ss)
+ double v;
+ int *hh, *mm, *ss;
{
double d_hh, d_mm, d_ss;
int i_hh, i_mm, i_ss;
- double d = fabs(v * 86400.0);
+ double d = v * 86400.0;
d_hh = d / 3600.0;
i_hh = (int)d_hh;
@@ -838,7 +480,9 @@ d2time(double v, int *hh, int *mm, int *ss)
}
static void
-civil2jd(int y, int m, int d, long *jd)
+civil2jd(y, m, d, jd)
+ int y, m, d;
+ long *jd;
{
long a, b;
if (m <= 2) {
@@ -853,7 +497,9 @@ civil2jd(int y, int m, int d, long *jd)
}
static void
-jd2civil(long day, int *yy, int *mm, int *dd)
+jd2civil(day, yy, mm, dd)
+ long day;
+ int *yy, *mm, *dd;
{
long x, a, b, c, d, e;
x = (long)(((double)day - 1867216.25) / 36524.25);
@@ -874,7 +520,9 @@ jd2civil(long day, int *yy, int *mm, int *dd)
}
static void
-double2time(double v, int *y, int *m, int *d, int *hh, int *mm, int *ss)
+double2time(v, y, m, d, hh, mm, ss)
+ double v;
+ int *y, *m, *d, *hh, *mm, *ss;
{
long day;
double t;
@@ -887,7 +535,8 @@ double2time(double v, int *y, int *m, int *d, int *hh, int *mm, int *ss)
}
static double
-time_object2date(VALUE tmobj)
+time_object2date(tmobj)
+ VALUE tmobj;
{
long y, m, d, hh, mm, ss;
long day;
@@ -904,243 +553,26 @@ time_object2date(VALUE tmobj)
}
static VALUE
-date2time_str(double date)
+date2time_str(date)
+ double date;
{
int y, m, d, hh, mm, ss;
+ char szTime[40];
double2time(date, &y, &m, &d, &hh, &mm, &ss);
- return rb_sprintf(
- "%04d/%02d/%02d %02d:%02d:%02d",
+ sprintf(szTime,
+ "%4.4d/%02.2d/%02.2d %02.2d:%02.2d:%02.2d",
y, m, d, hh, mm, ss);
+ return rb_str_new2(szTime);
}
-#define ENC_MACHING_CP(enc,encname,cp) if(strcasecmp(rb_enc_name((enc)),(encname)) == 0) return cp
-
-static UINT ole_encoding2cp(rb_encoding *enc)
-{
- /*
- * Is there any better solution to convert
- * Ruby encoding to Windows codepage???
- */
- ENC_MACHING_CP(enc, "Big5", 950);
- ENC_MACHING_CP(enc, "CP51932", 51932);
- ENC_MACHING_CP(enc, "CP850", 850);
- ENC_MACHING_CP(enc, "CP852", 852);
- ENC_MACHING_CP(enc, "CP855", 855);
- ENC_MACHING_CP(enc, "CP949", 949);
- ENC_MACHING_CP(enc, "EUC-JP", 20932);
- ENC_MACHING_CP(enc, "EUC-KR", 51949);
- ENC_MACHING_CP(enc, "EUC-TW", 51950);
- ENC_MACHING_CP(enc, "GB18030", 54936);
- ENC_MACHING_CP(enc, "GB2312", 51936);
- ENC_MACHING_CP(enc, "GBK", 936);
- ENC_MACHING_CP(enc, "IBM437", 437);
- ENC_MACHING_CP(enc, "IBM737", 737);
- ENC_MACHING_CP(enc, "IBM775", 775);
- ENC_MACHING_CP(enc, "IBM852", 852);
- ENC_MACHING_CP(enc, "IBM855", 855);
- ENC_MACHING_CP(enc, "IBM857", 857);
- ENC_MACHING_CP(enc, "IBM860", 860);
- ENC_MACHING_CP(enc, "IBM861", 861);
- ENC_MACHING_CP(enc, "IBM862", 862);
- ENC_MACHING_CP(enc, "IBM863", 863);
- ENC_MACHING_CP(enc, "IBM864", 864);
- ENC_MACHING_CP(enc, "IBM865", 865);
- ENC_MACHING_CP(enc, "IBM866", 866);
- ENC_MACHING_CP(enc, "IBM869", 869);
- ENC_MACHING_CP(enc, "ISO-2022-JP", 50220);
- ENC_MACHING_CP(enc, "ISO-8859-1", 28591);
- ENC_MACHING_CP(enc, "ISO-8859-15", 28605);
- ENC_MACHING_CP(enc, "ISO-8859-2", 28592);
- ENC_MACHING_CP(enc, "ISO-8859-3", 28593);
- ENC_MACHING_CP(enc, "ISO-8859-4", 28594);
- ENC_MACHING_CP(enc, "ISO-8859-5", 28595);
- ENC_MACHING_CP(enc, "ISO-8859-6", 28596);
- ENC_MACHING_CP(enc, "ISO-8859-7", 28597);
- ENC_MACHING_CP(enc, "ISO-8859-8", 28598);
- ENC_MACHING_CP(enc, "ISO-8859-9", 28599);
- ENC_MACHING_CP(enc, "KOI8-R", 20866);
- ENC_MACHING_CP(enc, "KOI8-U", 21866);
- ENC_MACHING_CP(enc, "Shift_JIS", 932);
- ENC_MACHING_CP(enc, "UTF-16BE", 1201);
- ENC_MACHING_CP(enc, "UTF-16LE", 1200);
- ENC_MACHING_CP(enc, "UTF-7", 65000);
- ENC_MACHING_CP(enc, "UTF-8", 65001);
- ENC_MACHING_CP(enc, "Windows-1250", 1250);
- ENC_MACHING_CP(enc, "Windows-1251", 1251);
- ENC_MACHING_CP(enc, "Windows-1252", 1252);
- ENC_MACHING_CP(enc, "Windows-1253", 1253);
- ENC_MACHING_CP(enc, "Windows-1254", 1254);
- ENC_MACHING_CP(enc, "Windows-1255", 1255);
- ENC_MACHING_CP(enc, "Windows-1256", 1256);
- ENC_MACHING_CP(enc, "Windows-1257", 1257);
- ENC_MACHING_CP(enc, "Windows-1258", 1258);
- ENC_MACHING_CP(enc, "Windows-31J", 932);
- ENC_MACHING_CP(enc, "Windows-874", 874);
- ENC_MACHING_CP(enc, "eucJP-ms", 20932);
- return CP_ACP;
-}
-
-static void
-failed_load_conv51932(void)
-{
- rb_raise(eWIN32OLERuntimeError, "fail to load convert function for CP51932");
-}
-
-#ifndef pIMultiLanguage
-static void
-load_conv_function51932(void)
-{
- HRESULT hr = E_NOINTERFACE;
- void *p;
- if (!pIMultiLanguage) {
-#if defined(HAVE_TYPE_IMULTILANGUAGE2)
- hr = CoCreateInstance(&CLSID_CMultiLanguage, NULL, CLSCTX_INPROC_SERVER,
- &IID_IMultiLanguage2, &p);
-#elif defined(HAVE_TYPE_IMULTILANGUAGE)
- hr = CoCreateInstance(&CLSID_CMultiLanguage, NULL, CLSCTX_INPROC_SERVER,
- &IID_IMultiLanguage, &p);
-#endif
- if (FAILED(hr)) {
- failed_load_conv51932();
- }
- pIMultiLanguage = p;
- }
-}
-#else
-#define load_conv_function51932() failed_load_conv51932()
-#endif
-
-#define conv_51932(cp) ((cp) == 51932 && (load_conv_function51932(), 1))
-
-static void
-set_ole_codepage(UINT cp)
-{
- if (code_page_installed(cp)) {
- cWIN32OLE_cp = cp;
- } else {
- switch(cp) {
- case CP_ACP:
- case CP_OEMCP:
- case CP_MACCP:
- case CP_THREAD_ACP:
- case CP_SYMBOL:
- case CP_UTF7:
- case CP_UTF8:
- cWIN32OLE_cp = cp;
- break;
- case 51932:
- cWIN32OLE_cp = cp;
- load_conv_function51932();
- break;
- default:
- rb_raise(eWIN32OLERuntimeError, "codepage should be WIN32OLE::CP_ACP, WIN32OLE::CP_OEMCP, WIN32OLE::CP_MACCP, WIN32OLE::CP_THREAD_ACP, WIN32OLE::CP_SYMBOL, WIN32OLE::CP_UTF7, WIN32OLE::CP_UTF8, or installed codepage.");
- break;
- }
- }
- cWIN32OLE_enc = ole_cp2encoding(cWIN32OLE_cp);
-}
-
-
-static UINT
-ole_init_cp(void)
-{
- UINT cp;
- rb_encoding *encdef;
- encdef = rb_default_internal_encoding();
- if (!encdef) {
- encdef = rb_default_external_encoding();
- }
- cp = ole_encoding2cp(encdef);
- set_ole_codepage(cp);
- return cp;
-}
-
-struct myCPINFOEX {
- UINT MaxCharSize;
- BYTE DefaultChar[2];
- BYTE LeadByte[12];
- WCHAR UnicodeDefaultChar;
- UINT CodePage;
- char CodePageName[MAX_PATH];
-};
-
-static rb_encoding *
-ole_cp2encoding(UINT cp)
-{
- static BOOL (*pGetCPInfoEx)(UINT, DWORD, struct myCPINFOEX *) = NULL;
- struct myCPINFOEX* buf;
- VALUE enc_name;
- char *enc_cstr;
- int idx;
-
- if (!code_page_installed(cp)) {
- switch(cp) {
- case CP_ACP:
- cp = GetACP();
- break;
- case CP_OEMCP:
- cp = GetOEMCP();
- break;
- case CP_MACCP:
- case CP_THREAD_ACP:
- if (!pGetCPInfoEx) {
- pGetCPInfoEx = (BOOL (*)(UINT, DWORD, struct myCPINFOEX *))
- GetProcAddress(GetModuleHandle("kernel32"), "GetCPInfoEx");
- if (!pGetCPInfoEx) {
- pGetCPInfoEx = (void*)-1;
- }
- }
- buf = ALLOCA_N(struct myCPINFOEX, 1);
- ZeroMemory(buf, sizeof(struct myCPINFOEX));
- if (pGetCPInfoEx == (void*)-1 || !pGetCPInfoEx(cp, 0, buf)) {
- rb_raise(eWIN32OLERuntimeError, "cannot map codepage to encoding.");
- break; /* never reach here */
- }
- cp = buf->CodePage;
- break;
- case CP_SYMBOL:
- case CP_UTF7:
- case CP_UTF8:
- break;
- case 51932:
- load_conv_function51932();
- break;
- default:
- rb_raise(eWIN32OLERuntimeError, "codepage should be WIN32OLE::CP_ACP, WIN32OLE::CP_OEMCP, WIN32OLE::CP_MACCP, WIN32OLE::CP_THREAD_ACP, WIN32OLE::CP_SYMBOL, WIN32OLE::CP_UTF7, WIN32OLE::CP_UTF8, or installed codepage.");
- break;
- }
- }
-
- enc_name = rb_sprintf("CP%d", cp);
- idx = rb_enc_find_index(enc_cstr = StringValueCStr(enc_name));
- if (idx < 0)
- idx = rb_define_dummy_encoding(enc_cstr);
- return rb_enc_from_index(idx);
-}
+static void ole_val2variant();
static char *
-ole_wc2mb(LPWSTR pw)
+ole_wc2mb(pw)
+ LPWSTR pw;
{
+ int size;
LPSTR pm;
- int size = 0;
- if (conv_51932(cWIN32OLE_cp)) {
-#ifndef pIMultiLanguage
- DWORD dw = 0;
- HRESULT hr = pIMultiLanguage->lpVtbl->ConvertStringFromUnicode(pIMultiLanguage,
- &dw, cWIN32OLE_cp, pw, NULL, NULL, &size);
- if (FAILED(hr)) {
- ole_raise(hr, eWIN32OLERuntimeError, "fail to convert Unicode to CP%d", cWIN32OLE_cp);
- }
- pm = ALLOC_N(char, size + 1);
- 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';
-#endif
- return pm;
- }
size = WideCharToMultiByte(cWIN32OLE_cp, 0, pw, -1, NULL, 0, NULL, NULL);
if (size) {
pm = ALLOC_N(char, size + 1);
@@ -1155,7 +587,8 @@ ole_wc2mb(LPWSTR pw)
}
static VALUE
-ole_hresult2msg(HRESULT hr)
+ole_hresult2msg(hr)
+ HRESULT hr;
{
VALUE msg = Qnil;
char *p_msg = NULL;
@@ -1163,13 +596,13 @@ ole_hresult2msg(HRESULT hr)
DWORD dwCount;
char strhr[100];
- sprintf(strhr, " HRESULT error code:0x%08x\n ", (unsigned)hr);
+ sprintf(strhr, " HRESULT error code:0x%08lx\n ", hr);
msg = rb_str_new2(strhr);
dwCount = FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |
FORMAT_MESSAGE_FROM_SYSTEM |
FORMAT_MESSAGE_IGNORE_INSERTS,
- NULL, hr, cWIN32OLE_lcid,
+ NULL, hr, LOCALE_SYSTEM_DEFAULT,
(LPTSTR)&p_msg, 0, NULL);
if (dwCount > 0) {
term = p_msg + strlen(p_msg);
@@ -1188,7 +621,8 @@ ole_hresult2msg(HRESULT hr)
}
static void
-ole_freeexceptinfo(EXCEPINFO *pExInfo)
+ole_freeexceptinfo(pExInfo)
+ EXCEPINFO *pExInfo;
{
SysFreeString(pExInfo->bstrDescription);
SysFreeString(pExInfo->bstrSource);
@@ -1196,7 +630,8 @@ ole_freeexceptinfo(EXCEPINFO *pExInfo)
}
static VALUE
-ole_excepinfo2msg(EXCEPINFO *pExInfo)
+ole_excepinfo2msg(pExInfo)
+ EXCEPINFO *pExInfo;
{
char error_code[40];
char *pSource = NULL;
@@ -1238,7 +673,15 @@ ole_excepinfo2msg(EXCEPINFO *pExInfo)
}
static void
+#ifdef HAVE_STDARG_PROTOTYPES
ole_raise(HRESULT hr, VALUE ecs, const char *fmt, ...)
+#else
+ole_raise(hr, exc, fmt, va_alist)
+ HRESULT hr;
+ VALUE exc;
+ const char *fmt;
+ va_dcl
+#endif
{
va_list args;
char buf[BUFSIZ];
@@ -1260,7 +703,7 @@ void
ole_uninitialize()
{
OleUninitialize();
- g_ole_initialized = FALSE;
+ gOLEInitialized = Qfalse;
}
static void
@@ -1268,12 +711,12 @@ ole_initialize()
{
HRESULT hr;
- if(g_ole_initialized == FALSE) {
+ if(gOLEInitialized == Qfalse) {
hr = OleInitialize(NULL);
if(FAILED(hr)) {
ole_raise(hr, rb_eRuntimeError, "fail: OLE initialize");
}
- g_ole_initialized = TRUE;
+ gOLEInitialized = Qtrue;
/*
* In some situation, OleUninitialize does not work fine. ;-<
*/
@@ -1298,21 +741,24 @@ ole_msg_loop() {
}
static void
-ole_free(struct oledata *pole)
+ole_free(pole)
+ struct oledata *pole;
{
OLE_FREE(pole->pDispatch);
free(pole);
}
static void
-oletype_free(struct oletypedata *poletype)
+oletype_free(poletype)
+ struct oletypedata *poletype;
{
OLE_FREE(poletype->pTypeInfo);
free(poletype);
}
static void
-olemethod_free(struct olemethoddata *polemethod)
+olemethod_free(polemethod)
+ struct olemethoddata *polemethod;
{
OLE_FREE(polemethod->pTypeInfo);
OLE_FREE(polemethod->pOwnerTypeInfo);
@@ -1320,97 +766,28 @@ olemethod_free(struct olemethoddata *polemethod)
}
static void
-olevariable_free(struct olevariabledata *polevar)
+olevariable_free(polevar)
+ struct olevariabledata *polevar;
{
OLE_FREE(polevar->pTypeInfo);
free(polevar);
}
static void
-oleparam_free(struct oleparamdata *pole)
+oleparam_free(pole)
+ struct oleparamdata *pole;
{
OLE_FREE(pole->pTypeInfo);
free(pole);
}
-
static LPWSTR
-ole_vstr2wc(VALUE vstr)
+ole_mb2wc(pm, len)
+ char *pm;
+ int len;
{
- rb_encoding *enc;
- int cp;
- int size = 0;
+ int size;
LPWSTR pw;
- st_data_t data;
- enc = rb_enc_get(vstr);
-
- if (st_lookup(enc2cp_table, (st_data_t)enc, &data)) {
- cp = data;
- } else {
- cp = ole_encoding2cp(enc);
- if (code_page_installed(cp) ||
- cp == CP_ACP ||
- cp == CP_OEMCP ||
- cp == CP_MACCP ||
- cp == CP_THREAD_ACP ||
- cp == CP_SYMBOL ||
- cp == CP_UTF7 ||
- cp == CP_UTF8 ||
- cp == 51932) {
- st_insert(enc2cp_table, (st_data_t)enc, (st_data_t)cp);
- } else {
- rb_raise(eWIN32OLERuntimeError, "not installed Windows codepage(%d) according to `%s'", cp, rb_enc_name(enc));
- }
- }
- if (conv_51932(cp)) {
-#ifndef pIMultiLanguage
- DWORD dw = 0;
- int len = RSTRING_LEN(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)
-{
- int size = 0;
- LPWSTR pw;
-
- if (conv_51932(cWIN32OLE_cp)) {
-#ifndef pIMultiLanguage
- DWORD dw = 0;
- int n = len;
- HRESULT hr = pIMultiLanguage->lpVtbl->ConvertStringToUnicode(pIMultiLanguage,
- &dw, cWIN32OLE_cp, pm, &n, NULL, &size);
- if (FAILED(hr)) {
- ole_raise(hr, eWIN32OLERuntimeError, "fail to convert CP%d to Unicode", cWIN32OLE_cp);
- }
- pw = SysAllocStringLen(NULL, size);
- hr = pIMultiLanguage->lpVtbl->ConvertStringToUnicode(pIMultiLanguage,
- &dw, cWIN32OLE_cp, pm, &n, pw, &size);
- if (FAILED(hr)) {
- ole_raise(hr, eWIN32OLERuntimeError, "fail to convert CP%d to Unicode", cWIN32OLE_cp);
- }
-#endif
- return pw;
- }
size = MultiByteToWideChar(cWIN32OLE_cp, 0, pm, len, NULL, 0);
pw = SysAllocStringLen(NULL, size - 1);
MultiByteToWideChar(cWIN32OLE_cp, 0, pm, len, pw, size);
@@ -1418,10 +795,12 @@ ole_mb2wc(char *pm, int len)
}
static VALUE
-ole_wc2vstr(LPWSTR pw, BOOL isfree)
+ole_wc2vstr(pw, isfree)
+ LPWSTR pw;
+ BOOL isfree;
{
char *p = ole_wc2mb(pw);
- VALUE vstr = rb_enc_str_new(p, strlen(p), cWIN32OLE_enc);
+ VALUE vstr = rb_str_new2(p);
if(isfree)
SysFreeString(pw);
free(p);
@@ -1429,7 +808,9 @@ ole_wc2vstr(LPWSTR pw, BOOL isfree)
}
static VALUE
-ole_ary_m_entry(VALUE val, long *pid)
+ole_ary_m_entry(val, pid)
+ VALUE val;
+ long *pid;
{
VALUE obj = Qnil;
int i = 0;
@@ -1441,230 +822,40 @@ ole_ary_m_entry(VALUE val, long *pid)
return obj;
}
-static void *
-get_ptr_of_variant(VARIANT *pvar)
-{
- switch(V_VT(pvar)) {
- case VT_UI1:
- return &V_UI1(pvar);
- break;
- case VT_I2:
- return &V_I2(pvar);
- break;
- case VT_UI2:
- return &V_UI2(pvar);
- break;
- case VT_I4:
- return &V_I4(pvar);
- break;
- case VT_UI4:
- return &V_UI4(pvar);
- break;
- case VT_R4:
- return &V_R4(pvar);
- break;
- case VT_R8:
- return &V_R8(pvar);
- break;
-#if (_MSC_VER >= 1300) || defined(__CYGWIN__) || defined(__MINGW32__)
- case VT_I8:
- return &V_I8(pvar);
- break;
- case VT_UI8:
- return &V_UI8(pvar);
- break;
-#endif
- case VT_INT:
- return &V_INT(pvar);
- break;
- case VT_UINT:
- return &V_UINT(pvar);
- break;
- case VT_CY:
- return &V_CY(pvar);
- break;
- case VT_DATE:
- return &V_DATE(pvar);
- break;
- case VT_BSTR:
- return V_BSTR(pvar);
- break;
- case VT_DISPATCH:
- return V_DISPATCH(pvar);
- break;
- case VT_ERROR:
- return &V_ERROR(pvar);
- break;
- case VT_BOOL:
- return &V_BOOL(pvar);
- break;
- case VT_UNKNOWN:
- return V_UNKNOWN(pvar);
- break;
- case VT_ARRAY:
- return &V_ARRAY(pvar);
- break;
- default:
- return NULL;
- break;
- }
-}
-
-static VALUE
-is_all_index_under(long *pid, long *pub, long dim)
-{
- long i = 0;
- for (i = 0; i < dim; i++) {
- if (pid[i] > pub[i]) {
- return Qfalse;
- }
- }
- return Qtrue;
-}
-
static void
-ole_set_safe_array(long n, SAFEARRAY *psa, long *pid, long *pub, VALUE val, long dim, VARTYPE vt)
+ole_set_safe_array(n, psa, pid, pub, val, dim)
+ long n;
+ SAFEARRAY *psa;
+ long *pid;
+ long *pub;
+ VALUE val;
+ long dim;
{
VALUE val1;
- HRESULT hr = S_OK;
VARIANT var;
- VOID *p = NULL;
- long i = n;
- while(i >= 0) {
+ VariantInit(&var);
+ if(n < 0) return;
+ if(n == dim) {
val1 = ole_ary_m_entry(val, pid);
- VariantInit(&var);
- p = val2variant_ptr(val1, &var, vt);
- if (is_all_index_under(pid, pub, dim) == Qtrue) {
- if ((V_VT(&var) == VT_DISPATCH && V_DISPATCH(&var) == NULL) ||
- (V_VT(&var) == VT_UNKNOWN && V_UNKNOWN(&var) == NULL)) {
- rb_raise(eWIN32OLERuntimeError, "element of array does not have IDispatch or IUnknown Interface");
- }
- hr = SafeArrayPutElement(psa, pid, p);
- }
- if (FAILED(hr)) {
- ole_raise(hr, rb_eRuntimeError, "failed to SafeArrayPutElement");
- }
- pid[i] += 1;
- if (pid[i] > pub[i]) {
- pid[i] = 0;
- i -= 1;
- } else {
- i = dim - 1;
- }
+ ole_val2variant(val1, &var);
+ SafeArrayPutElement(psa, pid, &var);
}
-}
-
-static long
-dimension(VALUE val) {
- long dim = 0;
- long dim1 = 0;
- long len = 0;
- long i = 0;
- if (TYPE(val) == T_ARRAY) {
- len = RARRAY_LEN(val);
- for (i = 0; i < len; i++) {
- dim1 = dimension(rb_ary_entry(val, i));
- if (dim < dim1) {
- dim = dim1;
- }
- }
- dim += 1;
- }
- return dim;
-}
-
-static long
-ary_len_of_dim(VALUE ary, long dim) {
- long ary_len = 0;
- long ary_len1 = 0;
- long len = 0;
- long i = 0;
- VALUE val;
- if (dim == 0) {
- if (TYPE(ary) == T_ARRAY) {
- ary_len = RARRAY_LEN(ary);
- }
- } else {
- if (TYPE(ary) == T_ARRAY) {
- len = RARRAY_LEN(ary);
- for (i = 0; i < len; i++) {
- val = rb_ary_entry(ary, i);
- ary_len1 = ary_len_of_dim(val, dim-1);
- if (ary_len < ary_len1) {
- ary_len = ary_len1;
- }
- }
- }
- }
- return ary_len;
-}
-
-static HRESULT
-ole_val_ary2variant_ary(VALUE val, VARIANT *var, VARTYPE vt)
-{
- long dim = 0;
- int i = 0;
- HRESULT hr = S_OK;
-
- SAFEARRAYBOUND *psab = NULL;
- SAFEARRAY *psa = NULL;
- long *pub, *pid;
-
- Check_Type(val, T_ARRAY);
-
- dim = dimension(val);
-
- psab = ALLOC_N(SAFEARRAYBOUND, dim);
- pub = ALLOC_N(long, dim);
- pid = ALLOC_N(long, dim);
-
- if(!psab || !pub || !pid) {
- if(pub) free(pub);
- if(psab) free(psab);
- if(pid) free(pid);
- rb_raise(rb_eRuntimeError, "memory allocation error");
- }
-
- for (i = 0; i < dim; i++) {
- psab[i].cElements = ary_len_of_dim(val, i);
- psab[i].lLbound = 0;
- pub[i] = psab[i].cElements - 1;
- pid[i] = 0;
- }
- /* Create and fill VARIANT array */
- if ((vt & ~VT_BYREF) == VT_ARRAY) {
- vt = (vt | VT_VARIANT);
- }
- psa = SafeArrayCreate((VARTYPE)(vt & VT_TYPEMASK), dim, psab);
- if (psa == NULL)
- hr = E_OUTOFMEMORY;
- else
- hr = SafeArrayLock(psa);
- if (SUCCEEDED(hr)) {
- ole_set_safe_array(dim-1, psa, pid, pub, val, dim, (VARTYPE)(vt & VT_TYPEMASK));
- hr = SafeArrayUnlock(psa);
- }
-
- if(pub) free(pub);
- if(psab) free(psab);
- if(pid) free(pid);
-
- if (SUCCEEDED(hr)) {
- V_VT(var) = vt;
- V_ARRAY(var) = psa;
+ pid[n] += 1;
+ if (pid[n] < pub[n]) {
+ ole_set_safe_array(dim, psa, pid, pub, val, dim);
}
else {
- if (psa != NULL)
- SafeArrayDestroy(psa);
+ pid[n] = 0;
+ ole_set_safe_array(n-1, psa, pid, pub, val, dim);
}
- return hr;
}
static void
-ole_val2variant(VALUE val, VARIANT *var)
+ole_val2variant(val, var)
+ VALUE val;
+ VARIANT *var;
{
struct oledata *pole;
- struct olevariantdata *pvar;
if(rb_obj_is_kind_of(val, cWIN32OLE)) {
Data_Get_Struct(val, struct oledata, pole);
OLE_ADDREF(pole->pDispatch);
@@ -1672,12 +863,6 @@ ole_val2variant(VALUE val, VARIANT *var)
V_DISPATCH(var) = pole->pDispatch;
return;
}
- if (rb_obj_is_kind_of(val, cWIN32OLE_VARIANT)) {
- Data_Get_Struct(val, struct olevariantdata, pvar);
- VariantCopy(var, &(pvar->var));
- return;
- }
-
if (rb_obj_is_kind_of(val, rb_cTime)) {
V_VT(var) = VT_DATE;
V_DATE(var) = time_object2date(val);
@@ -1685,11 +870,66 @@ ole_val2variant(VALUE val, VARIANT *var)
}
switch (TYPE(val)) {
case T_ARRAY:
- ole_val_ary2variant_ary(val, var, VT_VARIANT|VT_ARRAY);
+ {
+ VALUE val1;
+ long dim = 0;
+ int i = 0;
+
+ HRESULT hr;
+ SAFEARRAYBOUND *psab;
+ SAFEARRAY *psa;
+ long *pub, *pid;
+
+ val1 = val;
+ while(TYPE(val1) == T_ARRAY) {
+ val1 = rb_ary_entry(val1, 0);
+ dim += 1;
+ }
+ psab = ALLOC_N(SAFEARRAYBOUND, dim);
+ pub = ALLOC_N(long, dim);
+ pid = ALLOC_N(long, dim);
+
+ if(!psab || !pub || !pid) {
+ if(pub) free(pub);
+ if(psab) free(psab);
+ if(pid) free(pid);
+ rb_raise(rb_eRuntimeError, "memory allocation error");
+ }
+ val1 = val;
+ i = 0;
+ while(TYPE(val1) == T_ARRAY) {
+ psab[i].cElements = RARRAY(val1)->len;
+ psab[i].lLbound = 0;
+ pub[i] = psab[i].cElements;
+ pid[i] = 0;
+ i ++;
+ val1 = rb_ary_entry(val1, 0);
+ }
+ /* Create and fill VARIANT array */
+ psa = SafeArrayCreate(VT_VARIANT, dim, psab);
+ if (psa == NULL)
+ hr = E_OUTOFMEMORY;
+ else
+ hr = SafeArrayLock(psa);
+ if (SUCCEEDED(hr)) {
+ ole_set_safe_array(dim-1, psa, pid, pub, val, dim-1);
+ hr = SafeArrayUnlock(psa);
+ }
+ if(pub) free(pub);
+ if(psab) free(psab);
+ if(pid) free(pid);
+
+ if (SUCCEEDED(hr)) {
+ V_VT(var) = VT_VARIANT | VT_ARRAY;
+ V_ARRAY(var) = psa;
+ }
+ else if (psa != NULL)
+ SafeArrayDestroy(psa);
break;
+ }
case T_STRING:
V_VT(var) = VT_BSTR;
- V_BSTR(var) = ole_vstr2wc(val);
+ V_BSTR(var) = ole_mb2wc(StringValuePtr(val), -1);
break;
case T_FIXNUM:
V_VT(var) = VT_I4;
@@ -1727,290 +967,9 @@ ole_val2variant(VALUE val, VARIANT *var)
}
static void
-ole_val2variant_ex(VALUE val, VARIANT *var, VARTYPE vt)
-{
- if (val == Qnil) {
- if (vt == VT_VARIANT) {
- ole_val2variant2(val, var);
- } else {
- V_VT(var) = (vt & ~VT_BYREF);
- if (V_VT(var) == VT_DISPATCH) {
- V_DISPATCH(var) = NULL;
- } else if (V_VT(var) == VT_UNKNOWN) {
- V_UNKNOWN(var) = NULL;
- }
- }
- return;
- }
-#if (_MSC_VER >= 1300) || defined(__CYGWIN__) || defined(__MINGW32__)
- switch(vt & ~VT_BYREF) {
- case VT_I8:
- V_VT(var) = VT_I8;
- V_I8(var) = NUM2I8 (val);
- break;
- case VT_UI8:
- V_VT(var) = VT_UI8;
- V_UI8(var) = NUM2UI8(val);
- break;
- default:
- ole_val2variant2(val, var);
- break;
- }
-#else /* (_MSC_VER >= 1300) || defined(__CYGWIN__) || defined(__MINGW32__) */
- ole_val2variant2(val, var);
-#endif
-}
-
-static void
-ole_val2ptr_variant(VALUE val, VARIANT *var)
-{
- switch (TYPE(val)) {
- case T_STRING:
- if (V_VT(var) == (VT_BSTR | VT_BYREF)) {
- *V_BSTRREF(var) = ole_vstr2wc(val);
- }
- break;
- case T_FIXNUM:
- switch(V_VT(var)) {
- case (VT_UI1 | VT_BYREF) :
- *V_UI1REF(var) = NUM2CHR(val);
- break;
- case (VT_I2 | VT_BYREF) :
- *V_I2REF(var) = (short)NUM2INT(val);
- break;
- case (VT_I4 | VT_BYREF) :
- *V_I4REF(var) = NUM2INT(val);
- break;
- case (VT_R4 | VT_BYREF) :
- *V_R4REF(var) = (float)NUM2INT(val);
- break;
- case (VT_R8 | VT_BYREF) :
- *V_R8REF(var) = NUM2INT(val);
- break;
- default:
- break;
- }
- break;
- case T_FLOAT:
- switch(V_VT(var)) {
- case (VT_I2 | VT_BYREF) :
- *V_I2REF(var) = (short)NUM2INT(val);
- break;
- case (VT_I4 | VT_BYREF) :
- *V_I4REF(var) = NUM2INT(val);
- break;
- case (VT_R4 | VT_BYREF) :
- *V_R4REF(var) = (float)NUM2DBL(val);
- break;
- case (VT_R8 | VT_BYREF) :
- *V_R8REF(var) = NUM2DBL(val);
- break;
- default:
- break;
- }
- break;
- case T_BIGNUM:
- if (V_VT(var) == (VT_R8 | VT_BYREF)) {
- *V_R8REF(var) = rb_big2dbl(val);
- }
- break;
- case T_TRUE:
- if (V_VT(var) == (VT_BOOL | VT_BYREF)) {
- *V_BOOLREF(var) = VARIANT_TRUE;
- }
- break;
- case T_FALSE:
- if (V_VT(var) == (VT_BOOL | VT_BYREF)) {
- *V_BOOLREF(var) = VARIANT_FALSE;
- }
- break;
- default:
- break;
- }
-}
-
-static void
-ole_set_byref(VARIANT *realvar, VARIANT *var, VARTYPE vt)
-{
- V_VT(var) = vt;
- if (vt == (VT_VARIANT|VT_BYREF)) {
- V_VARIANTREF(var) = realvar;
- } else {
- if (V_VT(realvar) != (vt & ~VT_BYREF)) {
- rb_raise(eWIN32OLERuntimeError, "variant type mismatch");
- }
- switch(vt & ~VT_BYREF) {
- case VT_I1:
- V_I1REF(var) = &V_I1(realvar);
- break;
- case VT_UI1:
- V_UI1REF(var) = &V_UI1(realvar);
- break;
- case VT_I2:
- V_I2REF(var) = &V_I2(realvar);
- break;
- case VT_UI2:
- V_UI2REF(var) = &V_UI2(realvar);
- break;
- case VT_I4:
- V_I4REF(var) = &V_I4(realvar);
- break;
- case VT_UI4:
- V_UI4REF(var) = &V_UI4(realvar);
- break;
- case VT_R4:
- V_R4REF(var) = &V_R4(realvar);
- break;
- case VT_R8:
- V_R8REF(var) = &V_R8(realvar);
- break;
-
-#if (_MSC_VER >= 1300)
- case VT_I8:
- V_I8REF(var) = &V_I8(realvar);
- break;
- case VT_UI8:
- V_UI8REF(var) = &V_UI8(realvar);
- break;
-#endif
- case VT_INT:
- V_INTREF(var) = &V_INT(realvar);
- break;
-
- case VT_UINT:
- V_UINTREF(var) = &V_UINT(realvar);
- break;
-
- case VT_CY:
- V_CYREF(var) = &V_CY(realvar);
- break;
- case VT_DATE:
- V_DATEREF(var) = &V_DATE(realvar);
- break;
- case VT_BSTR:
- V_BSTRREF(var) = &V_BSTR(realvar);
- break;
- case VT_DISPATCH:
- V_DISPATCHREF(var) = &V_DISPATCH(realvar);
- break;
- case VT_ERROR:
- V_ERRORREF(var) = &V_ERROR(realvar);
- break;
- case VT_BOOL:
- V_BOOLREF(var) = &V_BOOL(realvar);
- break;
- case VT_UNKNOWN:
- V_UNKNOWNREF(var) = &V_UNKNOWN(realvar);
- break;
- case VT_ARRAY:
- V_ARRAYREF(var) = &V_ARRAY(realvar);
- break;
- default:
- rb_raise(eWIN32OLERuntimeError, "unknown type specified(setting BYREF):%d", vt);
- break;
- }
- }
-}
-
-static void
-ole_val2olevariantdata(VALUE val, VARTYPE vt, struct olevariantdata *pvar)
-{
- HRESULT hr = S_OK;
-
- if (((vt & ~VT_BYREF) == (VT_ARRAY | VT_UI1)) && TYPE(val) == T_STRING) {
- long len = RSTRING_LEN(val);
- void *pdest = NULL;
- SAFEARRAY *p = NULL;
- SAFEARRAY *psa = SafeArrayCreateVector(VT_UI1, 0, len);
- if (!psa) {
- rb_raise(rb_eRuntimeError, "fail to SafeArrayCreateVector");
- }
- hr = SafeArrayAccessData(psa, &pdest);
- if (SUCCEEDED(hr)) {
- memcpy(pdest, RSTRING_PTR(val), len);
- SafeArrayUnaccessData(psa);
- V_VT(&(pvar->realvar)) = (vt & ~VT_BYREF);
- p = V_ARRAY(&(pvar->realvar));
- if (p != NULL) {
- SafeArrayDestroy(p);
- }
- V_ARRAY(&(pvar->realvar)) = psa;
- if (vt & VT_BYREF) {
- V_VT(&(pvar->var)) = vt;
- V_ARRAYREF(&(pvar->var)) = &(V_ARRAY(&(pvar->realvar)));
- } else {
- hr = VariantCopy(&(pvar->var), &(pvar->realvar));
- }
- } else {
- if (psa)
- SafeArrayDestroy(psa);
- }
- } else if (vt & VT_ARRAY) {
- if (val == Qnil) {
- V_VT(&(pvar->var)) = vt;
- if (vt & VT_BYREF) {
- V_ARRAYREF(&(pvar->var)) = &(V_ARRAY(&(pvar->realvar)));
- }
- } else {
- hr = ole_val_ary2variant_ary(val, &(pvar->realvar), (VARTYPE)(vt & ~VT_BYREF));
- if (SUCCEEDED(hr)) {
- if (vt & VT_BYREF) {
- V_VT(&(pvar->var)) = vt;
- V_ARRAYREF(&(pvar->var)) = &(V_ARRAY(&(pvar->realvar)));
- } else {
- hr = VariantCopy(&(pvar->var), &(pvar->realvar));
- }
- }
- }
-#if (_MSC_VER >= 1300) || defined(__CYGWIN__) || defined(__MINGW32__)
- } else if ( (vt & ~VT_BYREF) == VT_I8 || (vt & ~VT_BYREF) == VT_UI8) {
- ole_val2variant_ex(val, &(pvar->realvar), (vt & ~VT_BYREF));
- ole_val2variant_ex(val, &(pvar->var), (vt & ~VT_BYREF));
- V_VT(&(pvar->var)) = vt;
- if (vt & VT_BYREF) {
- ole_set_byref(&(pvar->realvar), &(pvar->var), vt);
- }
-#endif
- } else {
- if (val == Qnil) {
- V_VT(&(pvar->var)) = vt;
- if (vt == (VT_BYREF | VT_VARIANT)) {
- ole_set_byref(&(pvar->realvar), &(pvar->var), vt);
- } else {
- V_VT(&(pvar->realvar)) = vt & ~VT_BYREF;
- if (vt & VT_BYREF) {
- ole_set_byref(&(pvar->realvar), &(pvar->var), vt);
- }
- }
- } else {
- ole_val2variant_ex(val, &(pvar->realvar), (VARTYPE)(vt & ~VT_BYREF));
- if (vt == (VT_BYREF | VT_VARIANT)) {
- ole_set_byref(&(pvar->realvar), &(pvar->var), vt);
- } else if (vt & VT_BYREF) {
- if ( (vt & ~VT_BYREF) != V_VT(&(pvar->realvar))) {
- hr = VariantChangeTypeEx(&(pvar->realvar), &(pvar->realvar),
- cWIN32OLE_lcid, 0, (VARTYPE)(vt & ~VT_BYREF));
- }
- if (SUCCEEDED(hr)) {
- ole_set_byref(&(pvar->realvar), &(pvar->var), vt);
- }
- } else {
- if (vt == V_VT(&(pvar->realvar))) {
- hr = VariantCopy(&(pvar->var), &(pvar->realvar));
- } else {
- hr = VariantChangeTypeEx(&(pvar->var), &(pvar->realvar),
- cWIN32OLE_lcid, 0, vt);
- }
- }
- }
- }
- if (FAILED(hr)) {
- ole_raise(hr, eWIN32OLERuntimeError, "failed to change type");
- }
-}
-
-static void
-ole_val2variant2(VALUE val, VARIANT *var)
+ole_val2variant2(val, var)
+ VALUE val;
+ VARIANT *var;
{
g_nil_to = VT_EMPTY;
ole_val2variant(val, var);
@@ -2018,26 +977,9 @@ ole_val2variant2(VALUE val, VARIANT *var)
}
static VALUE
-make_inspect(const char *class_name, VALUE detail)
-{
- VALUE str;
- str = rb_str_new2("#<");
- rb_str_cat2(str, class_name);
- rb_str_cat2(str, ":");
- rb_str_concat(str, detail);
- rb_str_cat2(str, ">");
- return str;
-}
-
-static VALUE
-default_inspect(VALUE self, const char *class_name)
-{
- VALUE detail = rb_funcall(self, rb_intern("to_s"), 0);
- return make_inspect(class_name, detail);
-}
-
-static VALUE
-ole_set_member(VALUE self, IDispatch *dispatch)
+ole_set_member(self, dispatch)
+ VALUE self;
+ IDispatch * dispatch;
{
struct oledata *pole;
Data_Get_Struct(self, struct oledata, pole);
@@ -2049,9 +991,10 @@ ole_set_member(VALUE self, IDispatch *dispatch)
return self;
}
-
+static VALUE fole_s_allocate _((VALUE));
static VALUE
-fole_s_allocate(VALUE klass)
+fole_s_allocate(klass)
+ VALUE klass;
{
struct oledata *pole;
VALUE obj;
@@ -2062,7 +1005,11 @@ fole_s_allocate(VALUE klass)
}
static VALUE
-create_win32ole_object(VALUE klass, IDispatch *pDispatch, int argc, VALUE *argv)
+create_win32ole_object(klass, pDispatch, argc, argv)
+ VALUE klass;
+ IDispatch *pDispatch;
+ int argc;
+ VALUE *argv;
{
VALUE obj = fole_s_allocate(klass);
ole_set_member(obj, pDispatch);
@@ -2070,40 +1017,8 @@ create_win32ole_object(VALUE klass, IDispatch *pDispatch, int argc, VALUE *argv)
}
static VALUE
-ary_new_dim(VALUE myary, long *pid, long *plb, long dim) {
- long i;
- VALUE obj = Qnil;
- VALUE pobj = Qnil;
- long *ids = ALLOC_N(long, dim);
- if (!ids) {
- rb_raise(rb_eRuntimeError, "memory allocation error");
- }
- for(i = 0; i < dim; i++) {
- ids[i] = pid[i] - plb[i];
- }
- obj = myary;
- pobj = myary;
- for(i = 0; i < dim-1; i++) {
- obj = rb_ary_entry(pobj, ids[i]);
- if (obj == Qnil) {
- rb_ary_store(pobj, ids[i], rb_ary_new());
- }
- obj = rb_ary_entry(pobj, ids[i]);
- pobj = obj;
- }
- if (ids) free(ids);
- return obj;
-}
-
-static void
-ary_store_dim(VALUE myary, long *pid, long *plb, long dim, VALUE val) {
- long id = pid[dim - 1] - plb[dim - 1];
- VALUE obj = ary_new_dim(myary, pid, plb, dim);
- rb_ary_store(obj, id, val);
-}
-
-static VALUE
-ole_variant2val(VARIANT *pvar)
+ole_variant2val(pvar)
+ VARIANT *pvar;
{
VALUE obj = Qnil;
HRESULT hr;
@@ -2112,70 +1027,75 @@ ole_variant2val(VARIANT *pvar)
if(V_ISARRAY(pvar)) {
SAFEARRAY *psa = V_ISBYREF(pvar) ? *V_ARRAYREF(pvar) : V_ARRAY(pvar);
- UINT i = 0;
- long *pid, *plb, *pub;
+ long i;
+ long *pID, *pLB, *pUB;
VARIANT variant;
VALUE val;
- UINT dim = 0;
+ VALUE val2;
+ int dim = 0;
+
if (!psa) {
return obj;
}
dim = SafeArrayGetDim(psa);
+
VariantInit(&variant);
V_VT(&variant) = (V_VT(pvar) & ~VT_ARRAY) | VT_BYREF;
- pid = ALLOC_N(long, dim);
- plb = ALLOC_N(long, dim);
- pub = ALLOC_N(long, dim);
+ pID = ALLOC_N(long, dim);
+ pLB = ALLOC_N(long, dim);
+ pUB = ALLOC_N(long, dim);
- if(!pid || !plb || !pub) {
- if(pid) free(pid);
- if(plb) free(plb);
- if(pub) free(pub);
+ if(!pID || !pLB || !pUB) {
+ if(pID) free(pID);
+ if(pLB) free(pLB);
+ if(pUB) free(pUB);
rb_raise(rb_eRuntimeError, "memory allocation error");
}
+ obj = Qnil;
+
for(i = 0; i < dim; ++i) {
- SafeArrayGetLBound(psa, i+1, &plb[i]);
- SafeArrayGetLBound(psa, i+1, &pid[i]);
- SafeArrayGetUBound(psa, i+1, &pub[i]);
+ SafeArrayGetLBound(psa, i+1, &pLB[i]);
+ SafeArrayGetLBound(psa, i+1, &pID[i]);
+ SafeArrayGetUBound(psa, i+1, &pUB[i]);
}
+
hr = SafeArrayLock(psa);
if (SUCCEEDED(hr)) {
- obj = rb_ary_new();
- i = 0;
- while (i < dim) {
- ary_new_dim(obj, pid, plb, dim);
- hr = SafeArrayPtrOfIndex(psa, pid, &V_BYREF(&variant));
- if (SUCCEEDED(hr)) {
- val = ole_variant2val(&variant);
- ary_store_dim(obj, pid, plb, dim, val);
- }
- for (i = 0; i < dim; ++i) {
- if (++pid[i] <= pub[i])
+ val2 = rb_ary_new();
+ while (i >= 0) {
+ hr = SafeArrayPtrOfIndex(psa, pID, &V_BYREF(&variant));
+ if (FAILED(hr))
+ break;
+
+ val = ole_variant2val(&variant);
+ rb_ary_push(val2, val);
+ for (i = dim-1 ; i >= 0 ; --i) {
+ if (++pID[i] <= pUB[i])
break;
- pid[i] = plb[i];
+
+ pID[i] = pLB[i];
+ if (i > 0) {
+ if (obj == Qnil)
+ obj = rb_ary_new();
+ rb_ary_push(obj, val2);
+ val2 = rb_ary_new();
+ }
}
}
SafeArrayUnlock(psa);
}
- if(pid) free(pid);
- if(plb) free(plb);
- if(pub) free(pub);
- return obj;
+ if(pID) free(pID);
+ if(pLB) free(pLB);
+ if(pUB) free(pUB);
+ return (obj == Qnil) ? val2 : obj;
}
switch(V_VT(pvar) & ~VT_BYREF){
case VT_EMPTY:
break;
case VT_NULL:
break;
- case VT_I1:
- if(V_ISBYREF(pvar))
- obj = INT2NUM((long)*V_I1REF(pvar));
- else
- obj = INT2NUM((long)V_I1(pvar));
- break;
-
case VT_UI1:
if(V_ISBYREF(pvar))
obj = INT2NUM((long)*V_UI1REF(pvar));
@@ -2190,13 +1110,6 @@ ole_variant2val(VARIANT *pvar)
obj = INT2NUM((long)V_I2(pvar));
break;
- case VT_UI2:
- if(V_ISBYREF(pvar))
- obj = INT2NUM((long)*V_UI2REF(pvar));
- else
- obj = INT2NUM((long)V_UI2(pvar));
- break;
-
case VT_I4:
if(V_ISBYREF(pvar))
obj = INT2NUM((long)*V_I4REF(pvar));
@@ -2204,50 +1117,6 @@ ole_variant2val(VARIANT *pvar)
obj = INT2NUM((long)V_I4(pvar));
break;
- case VT_UI4:
- if(V_ISBYREF(pvar))
- obj = INT2NUM((long)*V_UI4REF(pvar));
- else
- obj = INT2NUM((long)V_UI4(pvar));
- break;
-
- case VT_INT:
- if(V_ISBYREF(pvar))
- obj = INT2NUM((long)*V_INTREF(pvar));
- else
- obj = INT2NUM((long)V_INT(pvar));
- break;
-
- case VT_UINT:
- if(V_ISBYREF(pvar))
- obj = INT2NUM((long)*V_UINTREF(pvar));
- else
- obj = INT2NUM((long)V_UINT(pvar));
- break;
-
-#if (_MSC_VER >= 1300) || defined(__CYGWIN__) || defined(__MINGW32__)
- case VT_I8:
- if(V_ISBYREF(pvar))
-#if (_MSC_VER >= 1300)
- obj = I8_2_NUM(*V_I8REF(pvar));
-#else
- obj = Qnil;
-#endif
- else
- obj = I8_2_NUM(V_I8(pvar));
- break;
- case VT_UI8:
- if(V_ISBYREF(pvar))
-#if (_MSC_VER >= 1300)
- obj = UI8_2_NUM(*V_UI8REF(pvar));
-#else
- obj = Qnil;
-#endif
- else
- obj = UI8_2_NUM(V_UI8(pvar));
- break;
-#endif /* (_MSC_VER >= 1300) || defined(__CYGWIN__) || defined(__MINGW32__) */
-
case VT_R4:
if(V_ISBYREF(pvar))
obj = rb_float_new(*V_R4REF(pvar));
@@ -2264,10 +1133,13 @@ ole_variant2val(VARIANT *pvar)
case VT_BSTR:
{
+ char *p;
if(V_ISBYREF(pvar))
- obj = ole_wc2vstr(*V_BSTRREF(pvar), FALSE);
+ p = ole_wc2mb(*V_BSTRREF(pvar));
else
- obj = ole_wc2vstr(V_BSTR(pvar), FALSE);
+ p = ole_wc2mb(V_BSTR(pvar));
+ obj = rb_str_new2(p);
+ if(p) free(p);
break;
}
@@ -2303,10 +1175,10 @@ ole_variant2val(VARIANT *pvar)
case VT_UNKNOWN:
{
+
/* get IDispatch interface from IUnknown interface */
IUnknown *punk;
IDispatch *pDispatch;
- void *p;
HRESULT hr;
if (V_ISBYREF(pvar))
@@ -2315,9 +1187,9 @@ ole_variant2val(VARIANT *pvar)
punk = V_UNKNOWN(pvar);
if(punk != NULL) {
- hr = punk->lpVtbl->QueryInterface(punk, &IID_IDispatch, &p);
+ hr = punk->lpVtbl->QueryInterface(punk, &IID_IDispatch,
+ (void **)&pDispatch);
if(SUCCEEDED(hr)) {
- pDispatch = p;
obj = create_win32ole_object(cWIN32OLE, pDispatch, 0, 0);
}
}
@@ -2342,9 +1214,11 @@ ole_variant2val(VARIANT *pvar)
VARIANT variant;
VariantInit(&variant);
hr = VariantChangeTypeEx(&variant, pvar,
- cWIN32OLE_lcid, 0, VT_BSTR);
+ LOCALE_SYSTEM_DEFAULT, 0, VT_BSTR);
if (SUCCEEDED(hr) && V_VT(&variant) == VT_BSTR) {
- obj = ole_wc2vstr(V_BSTR(&variant), FALSE);
+ char *p = ole_wc2mb(V_BSTR(&variant));
+ obj = rb_str_new2(p);
+ if(p) free(p);
}
VariantClear(&variant);
break;
@@ -2353,23 +1227,30 @@ ole_variant2val(VARIANT *pvar)
return obj;
}
-static LONG
-reg_open_key(HKEY hkey, const char *name, HKEY *phkey)
+
+static LONG reg_open_key(hkey, name, phkey)
+ HKEY hkey;
+ const char *name;
+ HKEY *phkey;
{
return RegOpenKeyEx(hkey, name, 0, KEY_READ, phkey);
}
-static LONG
-reg_open_vkey(HKEY hkey, VALUE key, HKEY *phkey)
+static LONG reg_open_vkey(hkey, key, phkey)
+ HKEY hkey;
+ VALUE key;
+ HKEY *phkey;
{
return reg_open_key(hkey, StringValuePtr(key), phkey);
}
static VALUE
-reg_enum_key(HKEY hkey, DWORD i)
+reg_enum_key(hkey, i)
+ HKEY hkey;
+ DWORD i;
{
char buf[BUFSIZ + 1];
- DWORD size_buf = sizeof(buf);
+ DWORD size_buf = sizeof(buf) - 1;
FILETIME ft;
LONG err = RegEnumKeyEx(hkey, i, buf, &size_buf,
NULL, NULL, NULL, &ft);
@@ -2381,84 +1262,59 @@ reg_enum_key(HKEY hkey, DWORD i)
}
static VALUE
-reg_get_val(HKEY hkey, const char *subkey)
-{
- char *pbuf;
- DWORD dwtype = 0;
- LONG size = 0;
- VALUE val = Qnil;
- LONG err = RegQueryValueEx(hkey, subkey, NULL, &dwtype, NULL, &size);
-
- if (err == ERROR_SUCCESS) {
- pbuf = ALLOC_N(char, size + 1);
- err = RegQueryValueEx(hkey, subkey, NULL, &dwtype, pbuf, &size);
- if (err == ERROR_SUCCESS) {
- pbuf[size] = '\0';
- val = rb_str_new2(pbuf);
- }
- free(pbuf);
- }
- return val;
-}
-
-static VALUE
-reg_get_val2(HKEY hkey, const char *subkey)
+reg_get_val(hkey, subkey)
+ HKEY hkey;
+ const char *subkey;
{
- HKEY hsubkey;
- LONG err;
- VALUE val = Qnil;
- err = RegOpenKeyEx(hkey, subkey, 0, KEY_READ, &hsubkey);
+ char buf[BUFSIZ + 1];
+ LONG size_buf = sizeof(buf) - 1;
+ LONG err = RegQueryValue(hkey, subkey, buf, &size_buf);
if (err == ERROR_SUCCESS) {
- val = reg_get_val(hsubkey, NULL);
- RegCloseKey(hsubkey);
- }
- if (val == Qnil) {
- val = reg_get_val(hkey, subkey);
- }
- return val;
-}
-
-static VALUE
-reg_get_typelib_file_path(HKEY hkey)
-{
- VALUE path = Qnil;
- path = reg_get_val2(hkey, "win32");
- if (path == Qnil) {
- path = reg_get_val2(hkey, "win16");
+ buf[BUFSIZ] = '\0';
+ return rb_str_new2(buf);
}
- return path;
+ return Qnil;
}
static VALUE
-typelib_file_from_clsid(VALUE ole)
+typelib_file_from_clsid(ole)
+ VALUE ole;
{
+ OLECHAR *pbuf;
+ CLSID clsid;
+ HRESULT hr;
HKEY hroot, hclsid;
LONG err;
VALUE typelib;
- char path[MAX_PATH + 1];
+ VALUE vclsid;
+ char *pclsid = NULL;
+ pbuf = ole_mb2wc(StringValuePtr(ole), -1);
+ hr = CLSIDFromProgID(pbuf, &clsid);
+ SysFreeString(pbuf);
+ if (FAILED(hr)) {
+ return Qnil;
+ }
+ StringFromCLSID(&clsid, &pbuf);
+ vclsid = WC2VSTR(pbuf);
err = reg_open_key(HKEY_CLASSES_ROOT, "CLSID", &hroot);
if (err != ERROR_SUCCESS) {
return Qnil;
}
- err = reg_open_key(hroot, StringValuePtr(ole), &hclsid);
+ err = reg_open_key(hroot, StringValuePtr(vclsid), &hclsid);
if (err != ERROR_SUCCESS) {
RegCloseKey(hroot);
return Qnil;
}
- typelib = reg_get_val2(hclsid, "InprocServer32");
+ typelib = reg_get_val(hclsid, "InprocServer32");
RegCloseKey(hroot);
RegCloseKey(hclsid);
- if (typelib != Qnil) {
- ExpandEnvironmentStrings(StringValuePtr(typelib), path, sizeof(path));
- path[MAX_PATH] = '\0';
- typelib = rb_str_new2(path);
- }
return typelib;
}
static VALUE
-typelib_file_from_typelib(VALUE ole)
+typelib_file_from_typelib(ole)
+ VALUE ole;
{
HKEY htypelib, hclsid, hversion, hlang;
double fver;
@@ -2488,7 +1344,7 @@ typelib_file_from_typelib(VALUE ole)
if (ver == Qnil)
break;
err = reg_open_vkey(hclsid, ver, &hversion);
- if (err != ERROR_SUCCESS || fver > atof(StringValuePtr(ver)))
+ if (err != ERROR_SUCCESS || fver > atof(StringValuePtr(ver)))
continue;
fver = atof(StringValuePtr(ver));
typelib = reg_get_val(hversion, NULL);
@@ -2501,7 +1357,7 @@ typelib_file_from_typelib(VALUE ole)
break;
err = reg_open_vkey(hversion, lang, &hlang);
if (err == ERROR_SUCCESS) {
- if ((file = reg_get_typelib_file_path(hlang)) != Qnil)
+ if ((file = reg_get_val(hlang, "win32")) != Qnil)
found = TRUE;
RegCloseKey(hlang);
}
@@ -2516,7 +1372,8 @@ typelib_file_from_typelib(VALUE ole)
}
static VALUE
-typelib_file(VALUE ole)
+typelib_file(ole)
+ VALUE ole;
{
VALUE file = typelib_file_from_clsid(ole);
if (file != Qnil) {
@@ -2526,7 +1383,10 @@ typelib_file(VALUE ole)
}
static void
-ole_const_load(ITypeLib *pTypeLib, VALUE klass, VALUE self)
+ole_const_load(pTypeLib, klass, self)
+ ITypeLib *pTypeLib;
+ VALUE klass;
+ VALUE self;
{
unsigned int count;
unsigned int index;
@@ -2589,7 +1449,10 @@ ole_const_load(ITypeLib *pTypeLib, VALUE klass, VALUE self)
}
static HRESULT
-clsid_from_remote(VALUE host, VALUE com, CLSID *pclsid)
+clsid_from_remote(host, com, pclsid)
+ VALUE host;
+ VALUE com;
+ CLSID *pclsid;
{
HKEY hlm;
HKEY hpid;
@@ -2611,7 +1474,7 @@ clsid_from_remote(VALUE host, VALUE com, CLSID *pclsid)
hr = HRESULT_FROM_WIN32(err);
else {
len = sizeof(clsid);
- err = RegQueryValueEx(hpid, (LPBYTE)"", NULL, &dwtype, clsid, &len);
+ err = RegQueryValueEx(hpid, "", NULL, &dwtype, clsid, &len);
if (err == ERROR_SUCCESS && dwtype == REG_SZ) {
pbuf = ole_mb2wc(clsid, -1);
hr = CLSIDFromString(pbuf, pclsid);
@@ -2627,7 +1490,10 @@ clsid_from_remote(VALUE host, VALUE com, CLSID *pclsid)
}
static VALUE
-ole_create_dcom(int argc, VALUE *argv, VALUE self)
+ole_create_dcom(argc, argv, self)
+ int argc;
+ VALUE *argv;
+ VALUE self;
{
VALUE ole, host, others;
HRESULT hr;
@@ -2649,7 +1515,7 @@ ole_create_dcom(int argc, VALUE *argv, VALUE self)
rb_raise(rb_eRuntimeError, "CoCreateInstanceEx is not supported in this environment");
rb_scan_args(argc, argv, "2*", &ole, &host, &others);
- pbuf = ole_vstr2wc(ole);
+ pbuf = ole_mb2wc(StringValuePtr(ole), -1);
hr = CLSIDFromProgID(pbuf, &clsid);
if (FAILED(hr))
hr = clsid_from_remote(host, ole, &clsid);
@@ -2657,17 +1523,17 @@ ole_create_dcom(int argc, VALUE *argv, VALUE self)
hr = CLSIDFromString(pbuf, &clsid);
SysFreeString(pbuf);
if (FAILED(hr))
- ole_raise(hr, eWIN32OLERuntimeError,
+ ole_raise(hr, eWIN32OLE_RUNTIME_ERROR,
"unknown OLE server: `%s'",
StringValuePtr(ole));
memset(&serverinfo, 0, sizeof(COSERVERINFO));
- serverinfo.pwszName = ole_vstr2wc(host);
+ serverinfo.pwszName = ole_mb2wc(StringValuePtr(host), -1);
memset(&multi_qi, 0, sizeof(MULTI_QI));
multi_qi.pIID = &IID_IDispatch;
hr = gCoCreateInstanceEx(&clsid, NULL, clsctx, &serverinfo, 1, &multi_qi);
SysFreeString(serverinfo.pwszName);
if (FAILED(hr))
- ole_raise(hr, eWIN32OLERuntimeError,
+ ole_raise(hr, eWIN32OLE_RUNTIME_ERROR,
"failed to create DCOM server `%s' in `%s'",
StringValuePtr(ole),
StringValuePtr(host));
@@ -2677,12 +1543,15 @@ ole_create_dcom(int argc, VALUE *argv, VALUE self)
}
static VALUE
-ole_bind_obj(VALUE moniker, int argc, VALUE *argv, VALUE self)
+ole_bind_obj(moniker, argc, argv, self)
+ VALUE moniker;
+ int argc;
+ VALUE *argv;
+ VALUE self;
{
IBindCtx *pBindCtx;
IMoniker *pMoniker;
IDispatch *pDispatch;
- void *p;
HRESULT hr;
OLECHAR *pbuf;
ULONG eaten = 0;
@@ -2691,27 +1560,27 @@ ole_bind_obj(VALUE moniker, int argc, VALUE *argv, VALUE self)
hr = CreateBindCtx(0, &pBindCtx);
if(FAILED(hr)) {
- ole_raise(hr, eWIN32OLERuntimeError,
+ ole_raise(hr, eWIN32OLE_RUNTIME_ERROR,
"failed to create bind context");
}
- pbuf = ole_vstr2wc(moniker);
+ pbuf = ole_mb2wc(StringValuePtr(moniker), -1);
hr = MkParseDisplayName(pBindCtx, pbuf, &eaten, &pMoniker);
SysFreeString(pbuf);
if(FAILED(hr)) {
OLE_RELEASE(pBindCtx);
- ole_raise(hr, eWIN32OLERuntimeError,
+ ole_raise(hr, eWIN32OLE_RUNTIME_ERROR,
"failed to parse display name of moniker `%s'",
StringValuePtr(moniker));
}
hr = pMoniker->lpVtbl->BindToObject(pMoniker, pBindCtx, NULL,
- &IID_IDispatch, &p);
- pDispatch = p;
+ &IID_IDispatch,
+ (void**)&pDispatch);
OLE_RELEASE(pMoniker);
OLE_RELEASE(pBindCtx);
if(FAILED(hr)) {
- ole_raise(hr, eWIN32OLERuntimeError,
+ ole_raise(hr, eWIN32OLE_RUNTIME_ERROR,
"failed to bind moniker `%s'",
StringValuePtr(moniker));
}
@@ -2728,7 +1597,10 @@ ole_bind_obj(VALUE moniker, int argc, VALUE *argv, VALUE self)
* WIN32OLE.connect('Excel.Application') # => WIN32OLE object which represents running Excel.
*/
static VALUE
-fole_s_connect(int argc, VALUE *argv, VALUE self)
+fole_s_connect(argc, argv, self)
+ int argc;
+ VALUE *argv;
+ VALUE self;
{
VALUE svr_name;
VALUE others;
@@ -2736,7 +1608,6 @@ fole_s_connect(int argc, VALUE *argv, VALUE self)
CLSID clsid;
OLECHAR *pBuf;
IDispatch *pDispatch;
- void *p;
IUnknown *pUnknown;
rb_secure(4);
@@ -2744,14 +1615,13 @@ fole_s_connect(int argc, VALUE *argv, VALUE self)
ole_initialize();
rb_scan_args(argc, argv, "1*", &svr_name, &others);
- Check_SafeStr(svr_name);
- if (rb_safe_level() > 0 && OBJ_TAINTED(svr_name)) {
+ if (ruby_safe_level > 0 && OBJ_TAINTED(svr_name)) {
rb_raise(rb_eSecurityError, "Insecure Object Connection - %s",
StringValuePtr(svr_name));
}
/* get CLSID from OLE server name */
- pBuf = ole_vstr2wc(svr_name);
+ pBuf = ole_mb2wc(StringValuePtr(svr_name), -1);
hr = CLSIDFromProgID(pBuf, &clsid);
if(FAILED(hr)) {
hr = CLSIDFromString(pBuf, &clsid);
@@ -2763,14 +1633,14 @@ fole_s_connect(int argc, VALUE *argv, VALUE self)
hr = GetActiveObject(&clsid, 0, &pUnknown);
if (FAILED(hr)) {
- ole_raise(hr, eWIN32OLERuntimeError,
+ ole_raise(hr, eWIN32OLE_RUNTIME_ERROR,
"OLE server `%s' not running", StringValuePtr(svr_name));
}
- hr = pUnknown->lpVtbl->QueryInterface(pUnknown, &IID_IDispatch, &p);
- pDispatch = p;
+ hr = pUnknown->lpVtbl->QueryInterface(pUnknown, &IID_IDispatch,
+ (void **)&pDispatch);
if(FAILED(hr)) {
OLE_RELEASE(pUnknown);
- ole_raise(hr, eWIN32OLERuntimeError,
+ ole_raise(hr, eWIN32OLE_RUNTIME_ERROR,
"failed to create WIN32OLE server `%s'",
StringValuePtr(svr_name));
}
@@ -2810,7 +1680,10 @@ fole_s_connect(int argc, VALUE *argv, VALUE self)
* puts MSO::MsoLineSingle # => 1
*/
static VALUE
-fole_s_const_load(int argc, VALUE *argv, VALUE self)
+fole_s_const_load(argc, argv, self)
+ int argc;
+ VALUE *argv;
+ VALUE self;
{
VALUE ole;
VALUE klass;
@@ -2821,7 +1694,7 @@ fole_s_const_load(int argc, VALUE *argv, VALUE self)
HRESULT hr;
OLECHAR *pBuf;
VALUE file;
- LCID lcid = cWIN32OLE_lcid;
+ LCID lcid = LOCALE_SYSTEM_DEFAULT;
rb_secure(4);
rb_scan_args(argc, argv, "11", &ole, &klass);
@@ -2856,11 +1729,11 @@ fole_s_const_load(int argc, VALUE *argv, VALUE self)
if (file == Qnil) {
file = ole;
}
- pBuf = ole_vstr2wc(file);
+ pBuf = ole_mb2wc(StringValuePtr(file), -1);
hr = LoadTypeLibEx(pBuf, REGKIND_NONE, &pTypeLib);
SysFreeString(pBuf);
if (FAILED(hr))
- ole_raise(hr, eWIN32OLERuntimeError, "failed to LoadTypeLibEx");
+ ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "failed to LoadTypeLibEx");
if(TYPE(klass) != T_NIL) {
ole_const_load(pTypeLib, klass, self);
}
@@ -2876,7 +1749,9 @@ fole_s_const_load(int argc, VALUE *argv, VALUE self)
}
static VALUE
-ole_types_from_typelib(ITypeLib *pTypeLib, VALUE classes)
+ole_classes_from_typelib(pTypeLib, classes)
+ ITypeLib *pTypeLib;
+ VALUE classes;
{
long count;
@@ -2908,7 +1783,8 @@ ole_types_from_typelib(ITypeLib *pTypeLib, VALUE classes)
}
static ULONG
-reference_count(struct oledata * pole)
+reference_count(pole)
+ struct oledata * pole;
{
ULONG n = 0;
if(pole->pDispatch) {
@@ -2927,7 +1803,9 @@ reference_count(struct oledata * pole)
* exists only for debugging WIN32OLE.
*/
static VALUE
-fole_s_reference_count(VALUE self, VALUE obj)
+fole_s_reference_count(self, obj)
+ VALUE self;
+ VALUE obj;
{
struct oledata * pole;
OLEData_Get_Struct(obj, pole);
@@ -2944,7 +1822,9 @@ fole_s_reference_count(VALUE self, VALUE obj)
* The return value is reference counter of OLE object.
*/
static VALUE
-fole_s_free(VALUE self, VALUE obj)
+fole_s_free(self, obj)
+ VALUE self;
+ VALUE obj;
{
ULONG n = 0;
struct oledata * pole;
@@ -2958,7 +1838,9 @@ fole_s_free(VALUE self, VALUE obj)
}
static HWND
-ole_show_help(VALUE helpfile, VALUE helpcontext)
+ole_show_help(helpfile, helpcontext)
+ VALUE helpfile;
+ VALUE helpcontext;
{
FNHTMLHELP *pfnHtmlHelp;
HWND hwnd = 0;
@@ -2990,7 +1872,10 @@ ole_show_help(VALUE helpfile, VALUE helpcontext)
* WIN32OLE.ole_show_help(typeobj)
*/
static VALUE
-fole_s_show_help(int argc, VALUE *argv, VALUE self)
+fole_s_show_help(argc, argv, self)
+ int argc;
+ VALUE *argv;
+ VALUE self;
{
VALUE target;
VALUE helpcontext;
@@ -3029,179 +1914,51 @@ fole_s_show_help(int argc, VALUE *argv, VALUE self)
* WIN32OLE.codepage # => WIN32OLE::CP_ACP
*/
static VALUE
-fole_s_get_code_page(VALUE self)
+fole_s_get_code_page(self)
+ VALUE self;
{
return INT2FIX(cWIN32OLE_cp);
}
-static BOOL CALLBACK
-installed_code_page_proc(LPTSTR str) {
- if (strtoul(str, NULL, 10) == g_cp_to_check) {
- g_cp_installed = TRUE;
- return FALSE;
- }
- return TRUE;
-}
-
-static BOOL
-code_page_installed(UINT cp)
-{
- g_cp_installed = FALSE;
- g_cp_to_check = cp;
- EnumSystemCodePages(installed_code_page_proc, CP_INSTALLED);
- return g_cp_installed;
-}
-
/*
* call-seq:
* WIN32OLE.codepage = CP
*
- * Sets current codepage.
- * The WIN32OLE.codepage is initialized according to
- * Encoding.default_internal.
- * If Encoding.default_internal is nil then WIN32OLE.codepage
- * is initialized according to Encoding.default_external.
- *
+ * Sets current codepage.
* WIN32OLE.codepage = WIN32OLE::CP_UTF8
- * WIN32OLE.codepage = 65001
*/
static VALUE
-fole_s_set_code_page(VALUE self, VALUE vcp)
+fole_s_set_code_page(self, vcp)
+ VALUE self;
+ VALUE vcp;
{
UINT cp = FIX2INT(vcp);
- set_ole_codepage(cp);
- /*
- * Should this method return old codepage?
- */
- return Qnil;
-}
-/*
- * call-seq:
- * WIN32OLE.locale -> locale id.
- *
- * Returns current locale id (lcid). The default locale is
- * LOCALE_SYSTEM_DEFAULT.
- *
- * lcid = WIN32OLE.locale
- */
-static VALUE
-fole_s_get_locale(VALUE self)
-{
- return INT2FIX(cWIN32OLE_lcid);
-}
-
-static BOOL
-CALLBACK installed_lcid_proc(LPTSTR str)
-{
- if (strcmp(str, g_lcid_to_check) == 0) {
- g_lcid_installed = TRUE;
- return FALSE;
+ switch(cp) {
+ case CP_ACP:
+ case CP_OEMCP:
+ case CP_MACCP:
+ case CP_THREAD_ACP:
+ case CP_SYMBOL:
+ case CP_UTF7:
+ case CP_UTF8:
+ cWIN32OLE_cp = cp;
+ break;
+ default:
+ rb_raise(eWIN32OLE_RUNTIME_ERROR, "codepage should be WIN32OLE::CP_ACP, WIN32OLE::CP_OEMCP, WIN32OLE::CP_MACCP, WIN32OLE::CP_THREAD_ACP, WIN32OLE::CP_SYMBOL, WIN32OLE::CP_UTF7, WIN32OLE::CP_UTF8");
+ break;
}
- return TRUE;
-}
-static BOOL
-lcid_installed(LCID lcid)
-{
- g_lcid_installed = FALSE;
- snprintf(g_lcid_to_check, sizeof(g_lcid_to_check), "%08lx", lcid);
- EnumSystemLocales(installed_lcid_proc, LCID_INSTALLED);
- return g_lcid_installed;
-}
-
-/*
- * call-seq:
- * WIN32OLE.locale = lcid
- *
- * Sets current locale id (lcid).
- *
- * WIN32OLE.locale = 1033 # set locale English(U.S)
- * obj = WIN32OLE_VARIANT.new("$100,000", WIN32OLE::VARIANT::VT_CY)
- *
- */
-static VALUE
-fole_s_set_locale(VALUE self, VALUE vlcid)
-{
- LCID lcid = FIX2INT(vlcid);
- if (lcid_installed(lcid)) {
- cWIN32OLE_lcid = lcid;
- } else {
- switch (lcid) {
- case LOCALE_SYSTEM_DEFAULT:
- case LOCALE_USER_DEFAULT:
- cWIN32OLE_lcid = lcid;
- break;
- default:
- rb_raise(eWIN32OLERuntimeError, "not installed locale: %u", (unsigned int)lcid);
- }
- }
+ /*
+ * Should this method return old codepage?
+ */
return Qnil;
}
-/*
- * call-seq:
- * WIN32OLE.create_guid
- *
- * Creates GUID.
- * WIN32OLE.create_guid # => {1CB530F1-F6B1-404D-BCE6-1959BF91F4A8}
- */
-static VALUE
-fole_s_create_guid(VALUE self)
-{
- GUID guid;
- HRESULT hr;
- OLECHAR bstr[80];
- int len = 0;
- hr = CoCreateGuid(&guid);
- if (FAILED(hr)) {
- ole_raise(hr, eWIN32OLERuntimeError, "failed to create GUID");
- }
- len = StringFromGUID2(&guid, bstr, sizeof(bstr)/sizeof(OLECHAR));
- if (len == 0) {
- rb_raise(rb_eRuntimeError, "failed to create GUID(buffer over)");
- }
- return ole_wc2vstr(bstr, FALSE);
-}
-
/*
* Document-class: WIN32OLE
*
* <code>WIN32OLE</code> objects represent OLE Automation object in Ruby.
- *
- * By using WIN32OLE, you can access OLE server like VBScript.
- *
- * Here is sample script.
- *
- * require 'win32ole'
- *
- * excel = WIN32OLE.new('Excel.Application')
- * excel.visible = true
- * workbook = excel.Workbooks.Add();
- * worksheet = workbook.Worksheets(1);
- * worksheet.Range("A1:D1").value = ["North","South","East","West"];
- * worksheet.Range("A2:B2").value = [5.2, 10];
- * worksheet.Range("C2").value = 8;
- * worksheet.Range("D2").value = 20;
- *
- * range = worksheet.Range("A1:D2");
- * range.select
- * chart = workbook.Charts.Add;
- *
- * workbook.saved = true;
- *
- * excel.ActiveWorkbook.Close(0);
- * excel.Quit();
- *
- * Unfortunately, Win32OLE doesn't support the argument passed by
- * reference directly.
- * Instead, Win32OLE provides WIN32OLE::ARGV.
- * If you want to get the result value of argument passed by reference,
- * you can use WIN32OLE::ARGV.
- *
- * oleobj.method(arg1, arg2, refargv3)
- * puts WIN32OLE::ARGV[2] # the value of refargv3 after called oleobj.method
- *
*/
/*
@@ -3218,7 +1975,10 @@ fole_s_create_guid(VALUE self)
* WIN32OLE.new('{00024500-0000-0000-C000-000000000046}') # => Excel OLE Automation WIN32OLE object.
*/
static VALUE
-fole_initialize(int argc, VALUE *argv, VALUE self)
+fole_initialize(argc, argv, self)
+ int argc;
+ VALUE *argv;
+ VALUE self;
{
VALUE svr_name;
VALUE host;
@@ -3227,19 +1987,17 @@ fole_initialize(int argc, VALUE *argv, VALUE self)
CLSID clsid;
OLECHAR *pBuf;
IDispatch *pDispatch;
- void *p;
+
rb_secure(4);
rb_call_super(0, 0);
rb_scan_args(argc, argv, "11*", &svr_name, &host, &others);
- Check_SafeStr(svr_name);
- if (rb_safe_level() > 0 && OBJ_TAINTED(svr_name)) {
+ if (ruby_safe_level > 0 && OBJ_TAINTED(svr_name)) {
rb_raise(rb_eSecurityError, "Insecure Object Creation - %s",
StringValuePtr(svr_name));
}
if (!NIL_P(host)) {
- Check_SafeStr(host);
- if (rb_safe_level() > 0 && OBJ_TAINTED(host)) {
+ if (ruby_safe_level > 0 && OBJ_TAINTED(host)) {
rb_raise(rb_eSecurityError, "Insecure Object Creation - %s",
StringValuePtr(svr_name));
}
@@ -3247,44 +2005,45 @@ fole_initialize(int argc, VALUE *argv, VALUE self)
}
/* get CLSID from OLE server name */
- pBuf = ole_vstr2wc(svr_name);
+ pBuf = ole_mb2wc(StringValuePtr(svr_name), -1);
hr = CLSIDFromProgID(pBuf, &clsid);
if(FAILED(hr)) {
hr = CLSIDFromString(pBuf, &clsid);
}
SysFreeString(pBuf);
if(FAILED(hr)) {
- ole_raise(hr, eWIN32OLERuntimeError,
+ ole_raise(hr, eWIN32OLE_RUNTIME_ERROR,
"unknown OLE server: `%s'",
StringValuePtr(svr_name));
}
/* get IDispatch interface */
hr = CoCreateInstance(&clsid, NULL, CLSCTX_INPROC_SERVER | CLSCTX_LOCAL_SERVER,
- &IID_IDispatch, &p);
- pDispatch = p;
+ &IID_IDispatch, (void**)&pDispatch);
if(FAILED(hr)) {
- ole_raise(hr, eWIN32OLERuntimeError,
+ ole_raise(hr, eWIN32OLE_RUNTIME_ERROR,
"failed to create WIN32OLE object from `%s'",
StringValuePtr(svr_name));
}
-
+
ole_set_member(self, pDispatch);
return self;
}
static VALUE
-hash2named_arg(VALUE pair, struct oleparam* pOp)
+hash2named_arg(pair, pOp)
+ VALUE pair;
+ struct oleparam* pOp;
{
unsigned int index, i;
VALUE key, value;
index = pOp->dp.cNamedArgs;
- /*---------------------------------------------
- the data-type of key must be String or Symbol
- -----------------------------------------------*/
+ /*-------------------------------------
+ the data-type of key must be String
+ ---------------------------------------*/
key = rb_ary_entry(pair, 0);
- if(TYPE(key) != T_STRING && TYPE(key) != T_SYMBOL) {
+ if(TYPE(key) != T_STRING) {
/* clear name of dispatch parameters */
for(i = 1; i < index + 1; i++) {
SysFreeString(pOp->pNamedArgs[i]);
@@ -3294,14 +2053,11 @@ hash2named_arg(VALUE pair, struct oleparam* pOp)
VariantClear(&(pOp->dp.rgvarg[i]));
}
/* raise an exception */
- rb_raise(rb_eTypeError, "wrong argument type (expected String or Symbol)");
- }
- if (TYPE(key) == T_SYMBOL) {
- key = rb_sym_to_s(key);
+ Check_Type(key, T_STRING);
}
/* pNamedArgs[0] is <method name>, so "index + 1" */
- pOp->pNamedArgs[index + 1] = ole_vstr2wc(key);
+ pOp->pNamedArgs[index + 1] = ole_mb2wc(StringValuePtr(key), -1);
value = rb_ary_entry(pair, 1);
VariantInit(&(pOp->dp.rgvarg[index]));
@@ -3312,7 +2068,9 @@ hash2named_arg(VALUE pair, struct oleparam* pOp)
}
static VALUE
-set_argv(VARIANTARG* realargs, unsigned int beg, unsigned int end)
+set_argv(realargs, beg, end)
+ VARIANTARG* realargs;
+ unsigned int beg, end;
{
VALUE argv = rb_const_get(cWIN32OLE, rb_intern("ARGV"));
@@ -3326,9 +2084,13 @@ set_argv(VARIANTARG* realargs, unsigned int beg, unsigned int end)
}
static VALUE
-ole_invoke(int argc, VALUE *argv, VALUE self, USHORT wFlags, BOOL is_bracket)
+ole_invoke(argc, argv, self, wFlags)
+ int argc;
+ VALUE *argv;
+ VALUE self;
+ USHORT wFlags;
{
- LCID lcid = cWIN32OLE_lcid;
+ LCID lcid = LOCALE_SYSTEM_DEFAULT;
struct oledata *pole;
HRESULT hr;
VALUE cmd;
@@ -3349,7 +2111,6 @@ ole_invoke(int argc, VALUE *argv, VALUE self, USHORT wFlags, BOOL is_bracket)
unsigned int cNamedArgs;
int n;
struct oleparam op;
- struct olevariantdata *pvar;
memset(&excepinfo, 0, sizeof(EXCEPINFO));
VariantInit(&result);
@@ -3360,30 +2121,18 @@ ole_invoke(int argc, VALUE *argv, VALUE self, USHORT wFlags, BOOL is_bracket)
op.dp.cArgs = 0;
rb_scan_args(argc, argv, "1*", &cmd, &paramS);
- if(TYPE(cmd) != T_STRING && TYPE(cmd) != T_SYMBOL && !is_bracket) {
- rb_raise(rb_eTypeError, "method is wrong type (expected String or Symbol)");
- }
- if (TYPE(cmd) == T_SYMBOL) {
- cmd = rb_sym_to_s(cmd);
- }
OLEData_Get_Struct(self, pole);
if(!pole->pDispatch) {
rb_raise(rb_eRuntimeError, "failed to get dispatch interface");
}
- if (is_bracket) {
- DispID = DISPID_VALUE;
- argc += 1;
- rb_ary_unshift(paramS, cmd);
- } else {
- wcmdname = ole_vstr2wc(cmd);
- hr = pole->pDispatch->lpVtbl->GetIDsOfNames( pole->pDispatch, &IID_NULL,
- &wcmdname, 1, lcid, &DispID);
- SysFreeString(wcmdname);
- if(FAILED(hr)) {
- ole_raise(hr, eWIN32OLERuntimeError,
- "unknown property or method: `%s'",
- StringValuePtr(cmd));
- }
+ wcmdname = ole_mb2wc(StringValuePtr(cmd), -1);
+ hr = pole->pDispatch->lpVtbl->GetIDsOfNames( pole->pDispatch, &IID_NULL,
+ &wcmdname, 1, lcid, &DispID);
+ SysFreeString(wcmdname);
+ if(FAILED(hr)) {
+ ole_raise(hr, eWIN32OLE_RUNTIME_ERROR,
+ "unknown property or method `%s'",
+ StringValuePtr(cmd));
}
/* pick up last argument of method */
@@ -3400,10 +2149,10 @@ ole_invoke(int argc, VALUE *argv, VALUE self, USHORT wFlags, BOOL is_bracket)
op.dp.cArgs = cNamedArgs + argc - 2;
op.pNamedArgs = ALLOCA_N(OLECHAR*, cNamedArgs + 1);
op.dp.rgvarg = ALLOCA_N(VARIANTARG, op.dp.cArgs);
- rb_block_call(param, rb_intern("each"), 0, 0, hash2named_arg, (VALUE)&op);
+ rb_iterate(rb_each, param, hash2named_arg, (VALUE)&op);
pDispID = ALLOCA_N(DISPID, cNamedArgs + 1);
- op.pNamedArgs[0] = ole_vstr2wc(cmd);
+ op.pNamedArgs[0] = ole_mb2wc(StringValuePtr(cmd), -1);
hr = pole->pDispatch->lpVtbl->GetIDsOfNames(pole->pDispatch,
&IID_NULL,
op.pNamedArgs,
@@ -3418,7 +2167,7 @@ ole_invoke(int argc, VALUE *argv, VALUE self, USHORT wFlags, BOOL is_bracket)
for(i = 0; i < op.dp.cArgs; i++ ) {
VariantClear(&op.dp.rgvarg[i]);
}
- ole_raise(hr, eWIN32OLERuntimeError,
+ ole_raise(hr, eWIN32OLE_RUNTIME_ERROR,
"failed to get named argument info: `%s'",
StringValuePtr(cmd));
}
@@ -3442,20 +2191,17 @@ ole_invoke(int argc, VALUE *argv, VALUE self, USHORT wFlags, BOOL is_bracket)
VariantInit(&realargs[n]);
VariantInit(&op.dp.rgvarg[n]);
param = rb_ary_entry(paramS, i-cNamedArgs);
- if (rb_obj_is_kind_of(param, cWIN32OLE_VARIANT)) {
- Data_Get_Struct(param, struct olevariantdata, pvar);
- VariantCopy(&op.dp.rgvarg[n], &(pvar->var));
- } else {
- ole_val2variant(param, &realargs[n]);
- V_VT(&op.dp.rgvarg[n]) = VT_VARIANT | VT_BYREF;
- V_VARIANTREF(&op.dp.rgvarg[n]) = &realargs[n];
- }
+
+ ole_val2variant(param, &realargs[n]);
+ V_VT(&op.dp.rgvarg[n]) = VT_VARIANT | VT_BYREF;
+ V_VARIANTREF(&op.dp.rgvarg[n]) = &realargs[n];
+
}
}
/* apparent you need to call propput, you need this */
if (wFlags & DISPATCH_PROPERTYPUT) {
if (op.dp.cArgs == 0)
- ole_raise(ResultFromScode(E_INVALIDARG), eWIN32OLERuntimeError, "argument error");
+ return ResultFromScode(E_INVALIDARG);
op.dp.cNamedArgs = 1;
op.dp.rgdispidNamedArgs = ALLOCA_N( DISPID, 1 );
@@ -3465,7 +2211,6 @@ ole_invoke(int argc, VALUE *argv, VALUE self, USHORT wFlags, BOOL is_bracket)
hr = pole->pDispatch->lpVtbl->Invoke(pole->pDispatch, DispID,
&IID_NULL, lcid, wFlags, &op.dp,
&result, &excepinfo, &argErr);
-
if (FAILED(hr)) {
/* retry to call args by value */
if(op.dp.cArgs >= cNamedArgs) {
@@ -3497,14 +2242,12 @@ ole_invoke(int argc, VALUE *argv, VALUE self, USHORT wFlags, BOOL is_bracket)
&IID_NULL, lcid, wFlags,
&op.dp, NULL,
&excepinfo, &argErr);
-
}
for(i = cNamedArgs; i < op.dp.cArgs; i++) {
n = op.dp.cArgs - i + cNamedArgs - 1;
VariantClear(&op.dp.rgvarg[n]);
}
}
-
if (FAILED(hr)) {
/* retry after converting nil to VT_EMPTY */
if (op.dp.cArgs > cNamedArgs) {
@@ -3532,13 +2275,6 @@ ole_invoke(int argc, VALUE *argv, VALUE self, USHORT wFlags, BOOL is_bracket)
}
/* clear dispatch parameter */
if(op.dp.cArgs > cNamedArgs) {
- for(i = cNamedArgs; i < op.dp.cArgs; i++) {
- n = op.dp.cArgs - i + cNamedArgs - 1;
- param = rb_ary_entry(paramS, i-cNamedArgs);
- if (rb_obj_is_kind_of(param, cWIN32OLE_VARIANT)) {
- ole_val2variant(param, &realargs[n]);
- }
- }
set_argv(realargs, cNamedArgs, op.dp.cArgs);
}
else {
@@ -3549,9 +2285,8 @@ ole_invoke(int argc, VALUE *argv, VALUE self, USHORT wFlags, BOOL is_bracket)
if (FAILED(hr)) {
v = ole_excepinfo2msg(&excepinfo);
- ole_raise(hr, eWIN32OLERuntimeError, "(in OLE method `%s': )%s",
- StringValuePtr(cmd),
- StringValuePtr(v));
+ ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "%s%s",
+ StringValuePtr(cmd), StringValuePtr(v));
}
obj = ole_variant2val(&result);
VariantClear(&result);
@@ -3572,13 +2307,21 @@ ole_invoke(int argc, VALUE *argv, VALUE self, USHORT wFlags, BOOL is_bracket)
*
*/
static VALUE
-fole_invoke(int argc, VALUE *argv, VALUE self)
+fole_invoke(argc, argv, self)
+ int argc;
+ VALUE *argv;
+ VALUE self;
{
- return ole_invoke(argc, argv, self, DISPATCH_METHOD|DISPATCH_PROPERTYGET, FALSE);
+ return ole_invoke(argc, argv, self, DISPATCH_METHOD|DISPATCH_PROPERTYGET);
}
static VALUE
-ole_invoke2(VALUE self, VALUE dispid, VALUE args, VALUE types, USHORT dispkind)
+ole_invoke2(self, dispid, args, types, dispkind)
+ VALUE self;
+ VALUE dispid;
+ VALUE args;
+ VALUE types;
+ USHORT dispkind;
{
HRESULT hr;
struct oledata *pole;
@@ -3601,7 +2344,7 @@ ole_invoke2(VALUE self, VALUE dispid, VALUE args, VALUE types, USHORT dispkind)
VariantInit(&result);
OLEData_Get_Struct(self, pole);
- dispParams.cArgs = RARRAY_LEN(args);
+ dispParams.cArgs = RARRAY(args)->len;
dispParams.rgvarg = ALLOCA_N(VARIANTARG, dispParams.cArgs);
realargs = ALLOCA_N(VARIANTARG, dispParams.cArgs);
for (i = 0, j = dispParams.cArgs - 1; i < (int)dispParams.cArgs; i++, j--)
@@ -3632,7 +2375,7 @@ ole_invoke2(VALUE self, VALUE dispid, VALUE args, VALUE types, USHORT dispkind)
SAFEARRAYBOUND rgsabound[1];
Check_Type(param, T_ARRAY);
rgsabound[0].lLbound = 0;
- rgsabound[0].cElements = RARRAY_LEN(param);
+ rgsabound[0].cElements = RARRAY(param)->len;
v = vt & ~(VT_ARRAY | VT_BYREF);
V_ARRAY(&realargs[i]) = SafeArrayCreate(v, 1, rgsabound);
V_VT(&realargs[i]) = VT_ARRAY | v;
@@ -3650,7 +2393,7 @@ ole_invoke2(VALUE self, VALUE dispid, VALUE args, VALUE types, USHORT dispkind)
if (v != VT_VARIANT)
{
VariantChangeTypeEx(&velem, &velem,
- cWIN32OLE_lcid, 0, v);
+ LOCALE_SYSTEM_DEFAULT, 0, v);
}
switch (v)
{
@@ -3689,7 +2432,7 @@ ole_invoke2(VALUE self, VALUE dispid, VALUE args, VALUE types, USHORT dispkind)
if ((vt & (~VT_BYREF)) != VT_VARIANT)
{
hr = VariantChangeTypeEx(&realargs[i], &realargs[i],
- cWIN32OLE_lcid, 0,
+ LOCALE_SYSTEM_DEFAULT, 0,
(VARTYPE)(vt & (~VT_BYREF)));
if (hr != S_OK)
{
@@ -3745,15 +2488,14 @@ ole_invoke2(VALUE self, VALUE dispid, VALUE args, VALUE types, USHORT dispkind)
}
hr = pole->pDispatch->lpVtbl->Invoke(pole->pDispatch, NUM2INT(dispid),
- &IID_NULL, cWIN32OLE_lcid,
+ &IID_NULL, LOCALE_SYSTEM_DEFAULT,
dispkind,
&dispParams, &result,
&excepinfo, &argErr);
if (FAILED(hr)) {
v = ole_excepinfo2msg(&excepinfo);
- ole_raise(hr, eWIN32OLERuntimeError, "(in OLE method `<dispatch id:%d>': )%s",
- NUM2INT(dispid),
+ ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "_invoke %s",
StringValuePtr(v));
}
@@ -3780,7 +2522,11 @@ ole_invoke2(VALUE self, VALUE dispid, VALUE args, VALUE types, USHORT dispkind)
* excel._invoke(302, [], []) # same effect as excel.Quit
*/
static VALUE
-fole_invoke2(VALUE self, VALUE dispid, VALUE args, VALUE types)
+fole_invoke2(self, dispid, args, types)
+ VALUE self;
+ VALUE dispid;
+ VALUE args;
+ VALUE types;
{
return ole_invoke2(self, dispid, args, types, DISPATCH_METHOD);
}
@@ -3798,7 +2544,11 @@ fole_invoke2(VALUE self, VALUE dispid, VALUE args, VALUE types)
* puts excel._getproperty(558, [], []) # same effect as puts excel.visible
*/
static VALUE
-fole_getproperty2(VALUE self, VALUE dispid, VALUE args, VALUE types)
+fole_getproperty2(self, dispid, args, types)
+ VALUE self;
+ VALUE dispid;
+ VALUE args;
+ VALUE types;
{
return ole_invoke2(self, dispid, args, types, DISPATCH_PROPERTYGET);
}
@@ -3816,78 +2566,59 @@ fole_getproperty2(VALUE self, VALUE dispid, VALUE args, VALUE types)
* excel._setproperty(558, [true], [WIN32OLE::VARIANT::VT_BOOL]) # same effect as excel.visible = true
*/
static VALUE
-fole_setproperty2(VALUE self, VALUE dispid, VALUE args, VALUE types)
+fole_setproperty2(self, dispid, args, types)
+ VALUE self;
+ VALUE dispid;
+ VALUE args;
+ VALUE types;
{
return ole_invoke2(self, dispid, args, types, DISPATCH_PROPERTYPUT);
}
/*
* call-seq:
- * WIN32OLE[a1, a2, ...]=val
- *
- * Sets the value to WIN32OLE object specified by a1, a2, ...
- *
- * dict = WIN32OLE.new('Scripting.Dictionary')
- * dict.add('ruby', 'RUBY')
- * dict['ruby'] = 'Ruby'
- * puts dict['ruby'] # => 'Ruby'
- *
- * Remark: You can not use this method to set the property value.
- *
- * excel = WIN32OLE.new('Excel.Application')
- * # excel['Visible'] = true # This is error !!!
- * excel.Visible = true # You should to use this style to set the property.
- *
- */
-static VALUE
-fole_setproperty_with_bracket(int argc, VALUE *argv, VALUE self)
-{
- return ole_invoke(argc, argv, self, DISPATCH_PROPERTYPUT, TRUE);
-}
-
-/*
- * call-seq:
+ * WIN32OLE['property']=val
* WIN32OLE.setproperty('property', [arg1, arg2,...] val)
*
* Sets property of OLE object.
* When you want to set property with argument, you can use this method.
*
* excel = WIN32OLE.new('Excel.Application')
- * excel.Visible = true
+ * excel['Visible'] = true
* book = excel.workbooks.add
* sheet = book.worksheets(1)
* sheet.setproperty('Cells', 1, 2, 10) # => The B1 cell value is 10.
*/
static VALUE
-fole_setproperty(int argc, VALUE *argv, VALUE self)
+fole_setproperty(argc, argv, self)
+ int argc;
+ VALUE *argv;
+ VALUE self;
{
- return ole_invoke(argc, argv, self, DISPATCH_PROPERTYPUT, FALSE);
+ return ole_invoke(argc, argv, self, DISPATCH_PROPERTYPUT);
}
/*
* call-seq:
- * WIN32OLE[a1,a2,...]
+ * WIN32OLE['property']
*
- * Returns the value of Collection specified by a1, a2,....
+ * Returns property of OLE object.
*
- * dict = WIN32OLE.new('Scripting.Dictionary')
- * dict.add('ruby', 'Ruby')
- * puts dict['ruby'] # => 'Ruby' (same as `puts dict.item('ruby')')
- *
- * Remark: You can not use this method to get the property.
* excel = WIN32OLE.new('Excel.Application')
- * # puts excel['Visible'] This is error !!!
- * puts excel.Visible # You should to use this style to get the property.
- *
+ * puts excel['Visible'] # => false
*/
static VALUE
-fole_getproperty_with_bracket(int argc, VALUE *argv, VALUE self)
+fole_getproperty(argc, argv, self)
+ int argc;
+ VALUE *argv;
+ VALUE self;
{
- return ole_invoke(argc, argv, self, DISPATCH_PROPERTYGET, TRUE);
+ return ole_invoke(argc, argv, self, DISPATCH_PROPERTYGET);
}
static VALUE
-ole_propertyput(VALUE self, VALUE property, VALUE value)
+ole_propertyput(self, property, value)
+ VALUE self, property, value;
{
struct oledata *pole;
unsigned argErr;
@@ -3901,7 +2632,7 @@ ole_propertyput(VALUE self, VALUE property, VALUE value)
VARIANTARG propertyValue[2];
OLECHAR* pBuf[1];
VALUE v;
- LCID lcid = cWIN32OLE_lcid;
+ LCID lcid = LOCALE_SYSTEM_DEFAULT;
dispParams.rgdispidNamedArgs = &dispIDParam;
dispParams.rgvarg = propertyValue;
dispParams.cNamedArgs = 1;
@@ -3914,14 +2645,14 @@ ole_propertyput(VALUE self, VALUE property, VALUE value)
OLEData_Get_Struct(self, pole);
/* get ID from property name */
- pBuf[0] = ole_vstr2wc(property);
+ pBuf[0] = ole_mb2wc(StringValuePtr(property), -1);
hr = pole->pDispatch->lpVtbl->GetIDsOfNames(pole->pDispatch, &IID_NULL,
pBuf, 1, lcid, &dispID);
SysFreeString(pBuf[0]);
pBuf[0] = NULL;
if(FAILED(hr)) {
- ole_raise(hr, eWIN32OLERuntimeError,
+ ole_raise(hr, eWIN32OLE_RUNTIME_ERROR,
"unknown property or method: `%s'",
StringValuePtr(property));
}
@@ -3936,9 +2667,7 @@ ole_propertyput(VALUE self, VALUE property, VALUE value)
}
if (FAILED(hr)) {
v = ole_excepinfo2msg(&excepinfo);
- ole_raise(hr, eWIN32OLERuntimeError, "(in setting property `%s': )%s",
- StringValuePtr(property),
- StringValuePtr(v));
+ ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, StringValuePtr(v));
}
return Qnil;
}
@@ -3953,7 +2682,8 @@ ole_propertyput(VALUE self, VALUE property, VALUE value)
*
*/
static VALUE
-fole_free(VALUE self)
+fole_free(self)
+ VALUE self;
{
struct oledata *pole;
rb_secure(4);
@@ -3964,7 +2694,8 @@ fole_free(VALUE self)
}
static VALUE
-ole_each_sub(VALUE pEnumV)
+ole_each_sub(pEnumV)
+ VALUE pEnumV;
{
VARIANT variant;
VALUE obj = Qnil;
@@ -3980,7 +2711,8 @@ ole_each_sub(VALUE pEnumV)
}
static VALUE
-ole_ienum_free(VALUE pEnumV)
+ole_ienum_free(pEnumV)
+ VALUE pEnumV;
{
IEnumVARIANT *pEnum = (IEnumVARIANT *)pEnumV;
OLE_RELEASE(pEnum);
@@ -4002,9 +2734,10 @@ ole_ienum_free(VALUE pEnumV)
* end
*/
static VALUE
-fole_each(VALUE self)
+fole_each(self)
+ VALUE self;
{
- LCID lcid = cWIN32OLE_lcid;
+ LCID lcid = LOCALE_SYSTEM_DEFAULT;
struct oledata *pole;
@@ -4014,9 +2747,6 @@ fole_each(VALUE self)
VARIANT result;
HRESULT hr;
IEnumVARIANT *pEnum = NULL;
- void *p;
-
- RETURN_ENUMERATOR(self, 0, 0);
VariantInit(&result);
dispParams.rgvarg = NULL;
@@ -4034,20 +2764,17 @@ fole_each(VALUE self)
if (FAILED(hr)) {
VariantClear(&result);
- ole_raise(hr, eWIN32OLERuntimeError, "failed to get IEnum Interface");
+ ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "failed to get IEnum Interface");
}
- if (V_VT(&result) == VT_UNKNOWN) {
+ if (V_VT(&result) == VT_UNKNOWN)
hr = V_UNKNOWN(&result)->lpVtbl->QueryInterface(V_UNKNOWN(&result),
&IID_IEnumVARIANT,
- &p);
- pEnum = p;
- } else if (V_VT(&result) == VT_DISPATCH) {
+ (void**)&pEnum);
+ else if (V_VT(&result) == VT_DISPATCH)
hr = V_DISPATCH(&result)->lpVtbl->QueryInterface(V_DISPATCH(&result),
&IID_IEnumVARIANT,
- &p);
- pEnum = p;
- }
+ (void**)&pEnum);
if (FAILED(hr) || !pEnum) {
VariantClear(&result);
ole_raise(hr, rb_eRuntimeError, "failed to get IEnum Interface");
@@ -4065,10 +2792,13 @@ fole_each(VALUE self)
* Calls WIN32OLE#invoke method.
*/
static VALUE
-fole_missing(int argc, VALUE *argv, VALUE self)
+fole_missing(argc, argv, self)
+ int argc;
+ VALUE *argv;
+ VALUE self;
{
ID id;
- const char* mname;
+ char* mname;
int n;
id = rb_to_id(argv[0]);
mname = rb_id2name(id);
@@ -4077,18 +2807,22 @@ fole_missing(int argc, VALUE *argv, VALUE self)
}
n = strlen(mname);
if(mname[n-1] == '=') {
- argv[0] = rb_enc_str_new(mname, n-1, cWIN32OLE_enc);
+ argv[0] = rb_str_new(mname, n-1);
return ole_propertyput(self, argv[0], argv[1]);
}
else {
- argv[0] = rb_enc_str_new(mname, n, cWIN32OLE_enc);
- return ole_invoke(argc, argv, self, DISPATCH_METHOD|DISPATCH_PROPERTYGET, FALSE);
+ argv[0] = rb_str_new2(mname);
+ return ole_invoke(argc, argv, self, DISPATCH_METHOD|DISPATCH_PROPERTYGET);
}
}
static VALUE
-ole_method_sub(VALUE self, ITypeInfo *pOwnerTypeInfo, ITypeInfo *pTypeInfo, VALUE name)
+ole_method_sub(self, pOwnerTypeInfo, pTypeInfo, name)
+ VALUE self;
+ ITypeInfo *pOwnerTypeInfo;
+ ITypeInfo *pTypeInfo;
+ VALUE name;
{
HRESULT hr;
TYPEATTR *pTypeAttr;
@@ -4099,7 +2833,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, eWIN32OLERuntimeError, "failed to GetTypeAttr");
+ ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "failed to GetTypeAttr");
}
for(i = 0; i < pTypeAttr->cFuncs && method == Qnil; i++) {
hr = pTypeInfo->lpVtbl->GetFuncDesc(pTypeInfo, i, &pFuncDesc);
@@ -4125,7 +2859,10 @@ ole_method_sub(VALUE self, ITypeInfo *pOwnerTypeInfo, ITypeInfo *pTypeInfo, VALU
}
static VALUE
-olemethod_from_typeinfo(VALUE self, ITypeInfo *pTypeInfo, VALUE name)
+olemethod_from_typeinfo(self, pTypeInfo, name)
+ VALUE self;
+ ITypeInfo *pTypeInfo;
+ VALUE name;
{
HRESULT hr;
TYPEATTR *pTypeAttr;
@@ -4135,7 +2872,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, eWIN32OLERuntimeError, "failed to GetTypeAttr");
+ ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "failed to GetTypeAttr");
}
method = ole_method_sub(self, 0, pTypeInfo, name);
if (method != Qnil) {
@@ -4156,7 +2893,11 @@ olemethod_from_typeinfo(VALUE self, ITypeInfo *pTypeInfo, VALUE name)
}
static VALUE
-ole_methods_sub(ITypeInfo *pOwnerTypeInfo, ITypeInfo *pTypeInfo, VALUE methods, int mask)
+ole_methods_sub(pOwnerTypeInfo, pTypeInfo, methods, mask)
+ ITypeInfo *pOwnerTypeInfo;
+ ITypeInfo *pTypeInfo;
+ VALUE methods;
+ int mask;
{
HRESULT hr;
TYPEATTR *pTypeAttr;
@@ -4167,7 +2908,7 @@ ole_methods_sub(ITypeInfo *pOwnerTypeInfo, ITypeInfo *pTypeInfo, VALUE methods,
WORD i;
hr = OLE_GET_TYPEATTR(pTypeInfo, &pTypeAttr);
if (FAILED(hr)) {
- ole_raise(hr, eWIN32OLERuntimeError, "failed to GetTypeAttr");
+ ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "failed to GetTypeAttr");
}
for(i = 0; i < pTypeAttr->cFuncs; i++) {
pstr = NULL;
@@ -4196,7 +2937,9 @@ ole_methods_sub(ITypeInfo *pOwnerTypeInfo, ITypeInfo *pTypeInfo, VALUE methods,
}
static VALUE
-ole_methods_from_typeinfo(ITypeInfo *pTypeInfo, int mask)
+ole_methods_from_typeinfo(pTypeInfo, mask)
+ ITypeInfo *pTypeInfo;
+ int mask;
{
HRESULT hr;
TYPEATTR *pTypeAttr;
@@ -4206,7 +2949,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, eWIN32OLERuntimeError, "failed to GetTypeAttr");
+ ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "failed to GetTypeAttr");
}
ole_methods_sub(0, pTypeInfo, methods, mask);
@@ -4225,7 +2968,9 @@ ole_methods_from_typeinfo(ITypeInfo *pTypeInfo, int mask)
}
static HRESULT
-typeinfo_from_ole(struct oledata *pole, ITypeInfo **ppti)
+typeinfo_from_ole(pole, ppti)
+ struct oledata *pole;
+ ITypeInfo **ppti;
{
ITypeInfo *pTypeInfo;
ITypeLib *pTypeLib;
@@ -4233,7 +2978,7 @@ typeinfo_from_ole(struct oledata *pole, ITypeInfo **ppti)
VALUE type;
UINT i;
UINT count;
- LCID lcid = cWIN32OLE_lcid;
+ LCID lcid = LOCALE_SYSTEM_DEFAULT;
HRESULT hr = pole->pDispatch->lpVtbl->GetTypeInfo(pole->pDispatch,
0, lcid, &pTypeInfo);
if(FAILED(hr)) {
@@ -4266,7 +3011,9 @@ typeinfo_from_ole(struct oledata *pole, ITypeInfo **ppti)
}
static VALUE
-ole_methods(VALUE self, int mask)
+ole_methods(self,mask)
+ VALUE self;
+ int mask;
{
ITypeInfo *pTypeInfo;
HRESULT hr;
@@ -4296,7 +3043,8 @@ ole_methods(VALUE self, int mask)
*
*/
static VALUE
-fole_methods(VALUE self)
+fole_methods( self )
+ VALUE self;
{
return ole_methods( self, INVOKE_FUNC | INVOKE_PROPERTYGET | INVOKE_PROPERTYPUT | INVOKE_PROPERTYPUTREF);
}
@@ -4312,7 +3060,8 @@ fole_methods(VALUE self)
* properties = excel.ole_get_methods
*/
static VALUE
-fole_get_methods(VALUE self)
+fole_get_methods( self )
+ VALUE self;
{
return ole_methods( self, INVOKE_PROPERTYGET);
}
@@ -4328,9 +3077,10 @@ fole_get_methods(VALUE self)
* properties = excel.ole_put_methods
*/
static VALUE
-fole_put_methods(VALUE self)
+fole_put_methods( self )
+ VALUE self;
{
- return ole_methods( self, INVOKE_PROPERTYPUT|INVOKE_PROPERTYPUTREF);
+ return ole_methods( self, INVOKE_PROPERTYPUT | INVOKE_PROPERTYPUTREF);
}
/*
@@ -4338,58 +3088,39 @@ fole_put_methods(VALUE self)
* WIN32OLE#ole_func_methods
*
* Returns the array of WIN32OLE_METHOD object .
- * The element of the array is property (settable) of WIN32OLE object.
+ * The element of the array is functional method of WIN32OLE object.
*
* excel = WIN32OLE.new('Excel.Application')
* properties = excel.ole_func_methods
*
*/
static VALUE
-fole_func_methods(VALUE self)
+fole_func_methods( self )
+ VALUE self;
{
return ole_methods( self, INVOKE_FUNC);
}
-static VALUE
-ole_type_from_itypeinfo(ITypeInfo *pTypeInfo)
-{
- ITypeLib *pTypeLib;
- VALUE type = Qnil;
- HRESULT hr;
- unsigned int index;
- BSTR bstr;
-
- hr = pTypeInfo->lpVtbl->GetContainingTypeLib( pTypeInfo, &pTypeLib, &index );
- if(FAILED(hr)) {
- return Qnil;
- }
- hr = pTypeLib->lpVtbl->GetDocumentation( pTypeLib, index,
- &bstr, NULL, NULL, NULL);
- OLE_RELEASE(pTypeLib);
- if (FAILED(hr)) {
- return Qnil;
- }
- type = foletype_s_allocate(cWIN32OLE_TYPE);
- oletype_set_member(type, pTypeInfo, WC2VSTR(bstr));
- return type;
-}
-
/*
* call-seq:
- * WIN32OLE#ole_type
+ * WIN32OLE#ole_obj_help
*
* Returns WIN32OLE_TYPE object.
*
* excel = WIN32OLE.new('Excel.Application')
- * tobj = excel.ole_type
+ * tobj = excel.ole_obj_help
*/
static VALUE
-fole_type(VALUE self)
+fole_obj_help( self )
+ VALUE self;
{
+ unsigned int index;
ITypeInfo *pTypeInfo;
+ ITypeLib *pTypeLib;
HRESULT hr;
struct oledata *pole;
- LCID lcid = cWIN32OLE_lcid;
+ BSTR bstr;
+ LCID lcid = LOCALE_SYSTEM_DEFAULT;
VALUE type = Qnil;
OLEData_Get_Struct(self, pole);
@@ -4398,182 +3129,30 @@ fole_type(VALUE self)
if(FAILED(hr)) {
ole_raise(hr, rb_eRuntimeError, "failed to GetTypeInfo");
}
- type = ole_type_from_itypeinfo(pTypeInfo);
- OLE_RELEASE(pTypeInfo);
- if (type == Qnil) {
- rb_raise(rb_eRuntimeError, "failed to create WIN32OLE_TYPE obj from ITypeInfo");
- }
- return type;
-}
-
-static VALUE
-make_oletypelib_obj(VALUE guid, VALUE major_version, VALUE minor_version)
-{
- VALUE args = rb_ary_new();
- rb_ary_push(args, guid);
- rb_ary_push(args, major_version);
- rb_ary_push(args, minor_version);
- return rb_apply(cWIN32OLE_TYPELIB, rb_intern("new"), args);
-}
-
-static VALUE
-ole_typelib_from_itypelib(ITypeLib *pTypeLib)
-{
- TLIBATTR *pTLibAttr;
- OLECHAR bstr[80];
- VALUE guid = Qnil;
- VALUE major;
- VALUE minor;
- int len = 0;
- HRESULT hr = S_OK;
- hr = pTypeLib->lpVtbl->GetLibAttr(pTypeLib, &pTLibAttr);
- if (FAILED(hr)) {
- return Qnil;
- }
- len = StringFromGUID2(&pTLibAttr->guid, bstr, sizeof(bstr)/sizeof(OLECHAR));
- if (len > 3) {
- guid = ole_wc2vstr(bstr, FALSE);
- }
- major = INT2NUM(pTLibAttr->wMajorVerNum);
- minor = INT2NUM(pTLibAttr->wMinorVerNum);
- pTypeLib->lpVtbl->ReleaseTLibAttr(pTypeLib, pTLibAttr);
- if (guid == Qnil) {
- return Qnil;
- }
- return make_oletypelib_obj(guid, major, minor);
-}
-
-
-static VALUE
-ole_typelib_from_itypeinfo(ITypeInfo *pTypeInfo)
-{
- HRESULT hr;
- ITypeLib *pTypeLib;
- unsigned int index;
- VALUE retval = Qnil;
-
- hr = pTypeInfo->lpVtbl->GetContainingTypeLib(pTypeInfo, &pTypeLib, &index);
+ hr = pTypeInfo->lpVtbl->GetContainingTypeLib( pTypeInfo, &pTypeLib, &index );
if(FAILED(hr)) {
- return Qnil;
+ OLE_RELEASE(pTypeInfo);
+ ole_raise(hr, rb_eRuntimeError, "failed to GetContainingTypeLib");
}
- retval = ole_typelib_from_itypelib(pTypeLib);
- OLE_RELEASE(pTypeLib);
- return retval;
-}
-
-/*
- * call-seq:
- * WIN32OLE#ole_typelib -> The WIN32OLE_TYPELIB object
- *
- * Returns the WIN32OLE_TYPELIB object. The object represents the
- * type library which contains the WIN32OLE object.
- *
- * excel = WIN32OLE.new('Excel.Application')
- * tlib = excel.ole_typelib
- * puts tlib.name # -> 'Microsoft Excel 9.0 Object Library'
- */
-static VALUE
-fole_typelib(VALUE self)
-{
- struct oledata *pole;
- HRESULT hr;
- ITypeInfo *pTypeInfo;
- LCID lcid = cWIN32OLE_lcid;
- VALUE vtlib = Qnil;
-
- OLEData_Get_Struct(self, pole);
- hr = pole->pDispatch->lpVtbl->GetTypeInfo(pole->pDispatch,
- 0, lcid, &pTypeInfo);
- if(FAILED(hr)) {
- ole_raise(hr, rb_eRuntimeError, "failed to GetTypeInfo");
+ hr = pTypeLib->lpVtbl->GetDocumentation( pTypeLib, index,
+ &bstr, NULL, NULL, NULL);
+ if (SUCCEEDED(hr)) {
+ type = foletype_s_allocate(cWIN32OLE_TYPE);
+ oletype_set_member(type, pTypeInfo, WC2VSTR(bstr));
}
- vtlib = ole_typelib_from_itypeinfo(pTypeInfo);
+ OLE_RELEASE(pTypeLib);
OLE_RELEASE(pTypeInfo);
- if (vtlib == Qnil) {
- rb_raise(rb_eRuntimeError, "failed to get type library info.");
- }
- return vtlib;
-}
-
-/*
- * call-seq:
- * WIN32OLE#ole_query_interface(iid) -> WIN32OLE object
- *
- * Returns WIN32OLE object for a specific dispatch or dual
- * interface specified by iid.
- *
- * ie = WIN32OLE.new('InternetExplorer.Application')
- * ie_web_app = ie.ole_query_interface('{0002DF05-0000-0000-C000-000000000046}') # => WIN32OLE object for dispinterface IWebBrowserApp
- */
-static VALUE
-fole_query_interface(VALUE self, VALUE str_iid)
-{
- HRESULT hr;
- OLECHAR *pBuf;
- IID iid;
- struct oledata *pole;
- IDispatch *pDispatch;
- void *p;
-
- pBuf = ole_vstr2wc(str_iid);
- hr = CLSIDFromString(pBuf, &iid);
- SysFreeString(pBuf);
- if(FAILED(hr)) {
- ole_raise(hr, eWIN32OLERuntimeError,
- "invalid iid: `%s'",
- StringValuePtr(str_iid));
- }
- OLEData_Get_Struct(self, pole);
- if(!pole->pDispatch) {
- rb_raise(rb_eRuntimeError, "failed to get dispatch interface");
- }
-
- hr = pole->pDispatch->lpVtbl->QueryInterface(pole->pDispatch, &iid,
- &p);
- if(FAILED(hr)) {
- ole_raise(hr, eWIN32OLERuntimeError,
- "failed to get interface `%s'",
- StringValuePtr(str_iid));
- }
-
- pDispatch = p;
- return create_win32ole_object(cWIN32OLE, pDispatch, 0, 0);
-}
-
-/*
- * call-seq:
- * WIN32OLE#ole_respond_to?(method) -> true or false
- *
- * Returns true when OLE object has OLE method, otherwise returns false.
- *
- * ie = WIN32OLE.new('InternetExplorer.Application')
- * ie.ole_respond_to?("gohome") => true
- */
-static VALUE
-fole_respond_to(VALUE self, VALUE method)
-{
- struct oledata *pole;
- BSTR wcmdname;
- DISPID DispID;
- HRESULT hr;
- rb_secure(4);
- if(TYPE(method) != T_STRING && TYPE(method) != T_SYMBOL) {
- rb_raise(rb_eTypeError, "wrong argument type (expected String or Symbol)");
- }
- if (TYPE(method) == T_SYMBOL) {
- method = rb_sym_to_s(method);
- }
- OLEData_Get_Struct(self, pole);
- wcmdname = ole_vstr2wc(method);
- hr = pole->pDispatch->lpVtbl->GetIDsOfNames( pole->pDispatch, &IID_NULL,
- &wcmdname, 1, cWIN32OLE_lcid, &DispID);
- SysFreeString(wcmdname);
- return SUCCEEDED(hr) ? Qtrue : Qfalse;
+ return type;
}
static HRESULT
-ole_docinfo_from_type(ITypeInfo *pTypeInfo, BSTR *name, BSTR *helpstr, DWORD *helpcontext, BSTR *helpfile)
+ole_docinfo_from_type(pTypeInfo, name, helpstr, helpcontext, helpfile)
+ ITypeInfo *pTypeInfo;
+ BSTR *name;
+ BSTR *helpstr;
+ DWORD *helpcontext;
+ BSTR *helpfile;
{
HRESULT hr;
ITypeLib *pTypeLib;
@@ -4596,7 +3175,10 @@ ole_docinfo_from_type(ITypeInfo *pTypeInfo, BSTR *name, BSTR *helpstr, DWORD *he
}
static VALUE
-ole_usertype2val(ITypeInfo *pTypeInfo, TYPEDESC *pTypeDesc, VALUE typedetails)
+ole_usertype2val(pTypeInfo, pTypeDesc, typedetails)
+ ITypeInfo *pTypeInfo;
+ TYPEDESC *pTypeDesc;
+ VALUE typedetails;
{
HRESULT hr;
BSTR bstr;
@@ -4620,132 +3202,146 @@ ole_usertype2val(ITypeInfo *pTypeInfo, TYPEDESC *pTypeDesc, VALUE typedetails)
return type;
}
+static VALUE ole_typedesc2val();
static VALUE
-ole_ptrtype2val(ITypeInfo *pTypeInfo, TYPEDESC *pTypeDesc, VALUE typedetails)
+ole_ptrtype2val(pTypeInfo, pTypeDesc, typedetails)
+ ITypeInfo *pTypeInfo;
+ TYPEDESC *pTypeDesc;
+ VALUE typedetails;
{
TYPEDESC *p = pTypeDesc;
VALUE type = rb_str_new2("");
-
- if (p->vt == VT_PTR || p->vt == VT_SAFEARRAY) {
+ while(p->vt == VT_PTR || p->vt == VT_SAFEARRAY) {
p = V_UNION1(p, lptdesc);
- type = ole_typedesc2val(pTypeInfo, p, typedetails);
+ if(strlen(StringValuePtr(type)) == 0) {
+ type = ole_typedesc2val(pTypeInfo, p, typedetails);
+ } else {
+ rb_str_cat(type, ",", 1);
+ rb_str_concat(type, ole_typedesc2val(pTypeInfo, p, typedetails));
+ }
}
return type;
}
static VALUE
-ole_typedesc2val(ITypeInfo *pTypeInfo, TYPEDESC *pTypeDesc, VALUE typedetails)
+ole_typedesc2val(pTypeInfo, pTypeDesc, typedetails)
+ ITypeInfo *pTypeInfo;
+ TYPEDESC *pTypeDesc;
+ VALUE typedetails;
{
VALUE str;
- VALUE typestr = Qnil;
switch(pTypeDesc->vt) {
case VT_I2:
- typestr = rb_str_new2("I2");
- break;
+ if(typedetails != Qnil)
+ rb_ary_push(typedetails, rb_str_new2("I2"));
+ return rb_str_new2("I2");
case VT_I4:
- typestr = rb_str_new2("I4");
- break;
+ if(typedetails != Qnil)
+ rb_ary_push(typedetails, rb_str_new2("I4"));
+ return rb_str_new2("I4");
case VT_R4:
- typestr = rb_str_new2("R4");
- break;
+ if(typedetails != Qnil)
+ rb_ary_push(typedetails, rb_str_new2("R4"));
+ return rb_str_new2("R4");
case VT_R8:
- typestr = rb_str_new2("R8");
- break;
+ if(typedetails != Qnil)
+ rb_ary_push(typedetails, rb_str_new2("R8"));
+ return rb_str_new2("R8");
case VT_CY:
- typestr = rb_str_new2("CY");
- break;
+ if(typedetails != Qnil)
+ rb_ary_push(typedetails, rb_str_new2("CY"));
+ return rb_str_new2("CY");
case VT_DATE:
- typestr = rb_str_new2("DATE");
- break;
+ if(typedetails != Qnil)
+ rb_ary_push(typedetails, rb_str_new2("DATE"));
+ return rb_str_new2("DATE");
case VT_BSTR:
- typestr = rb_str_new2("BSTR");
- break;
+ if(typedetails != Qnil)
+ rb_ary_push(typedetails, rb_str_new2("BSTR"));
+ return rb_str_new2("BSTR");
case VT_BOOL:
- typestr = rb_str_new2("BOOL");
- break;
+ if(typedetails != Qnil)
+ rb_ary_push(typedetails, rb_str_new2("BOOL"));
+ return rb_str_new2("BOOL");
case VT_VARIANT:
- typestr = rb_str_new2("VARIANT");
- break;
+ if(typedetails != Qnil)
+ rb_ary_push(typedetails, rb_str_new2("VARIANT"));
+ return rb_str_new2("VARIANT");
case VT_DECIMAL:
- typestr = rb_str_new2("DECIMAL");
- break;
+ if(typedetails != Qnil)
+ rb_ary_push(typedetails, rb_str_new2("DECIMAL"));
+ return rb_str_new2("DECIMAL");
case VT_I1:
- typestr = rb_str_new2("I1");
- break;
+ if(typedetails != Qnil)
+ rb_ary_push(typedetails, rb_str_new2("I1"));
+ return rb_str_new2("I1");
case VT_UI1:
- typestr = rb_str_new2("UI1");
- break;
+ if(typedetails != Qnil)
+ rb_ary_push(typedetails, rb_str_new2("UI1"));
+ return rb_str_new2("UI1");
case VT_UI2:
- typestr = rb_str_new2("UI2");
- break;
+ if(typedetails != Qnil)
+ rb_ary_push(typedetails, rb_str_new2("UI2"));
+ return rb_str_new2("UI2");
case VT_UI4:
- typestr = rb_str_new2("UI4");
- break;
-#if (_MSC_VER >= 1300) || defined(__CYGWIN__) || defined(__MINGW32__)
+ if(typedetails != Qnil)
+ rb_ary_push(typedetails, rb_str_new2("UI4"));
+ return rb_str_new2("UI4");
case VT_I8:
- typestr = rb_str_new2("I8");
- break;
+ if(typedetails != Qnil)
+ rb_ary_push(typedetails, rb_str_new2("I8"));
+ return rb_str_new2("I8");
case VT_UI8:
- typestr = rb_str_new2("UI8");
- break;
-#endif
+ if(typedetails != Qnil)
+ rb_ary_push(typedetails, rb_str_new2("UI8"));
+ return rb_str_new2("UI8");
case VT_INT:
- typestr = rb_str_new2("INT");
- break;
+ if(typedetails != Qnil)
+ rb_ary_push(typedetails, rb_str_new2("INT"));
+ return rb_str_new2("INT");
case VT_UINT:
- typestr = rb_str_new2("UINT");
- break;
+ if(typedetails != Qnil)
+ rb_ary_push(typedetails, rb_str_new2("UINT"));
+ return rb_str_new2("UINT");
case VT_VOID:
- typestr = rb_str_new2("VOID");
- break;
+ if(typedetails != Qnil)
+ rb_ary_push(typedetails, rb_str_new2("VOID"));
+ return rb_str_new2("VOID");
case VT_HRESULT:
- typestr = rb_str_new2("HRESULT");
- break;
+ if(typedetails != Qnil)
+ rb_ary_push(typedetails, rb_str_new2("HRESULT"));
+ return rb_str_new2("HRESULT");
case VT_PTR:
- typestr = rb_str_new2("PTR");
if(typedetails != Qnil)
- rb_ary_push(typedetails, typestr);
+ rb_ary_push(typedetails, rb_str_new2("PTR"));
return ole_ptrtype2val(pTypeInfo, pTypeDesc, typedetails);
case VT_SAFEARRAY:
- typestr = rb_str_new2("SAFEARRAY");
if(typedetails != Qnil)
- rb_ary_push(typedetails, typestr);
+ rb_ary_push(typedetails, rb_str_new2("SAFEARRAY"));
return ole_ptrtype2val(pTypeInfo, pTypeDesc, typedetails);
case VT_CARRAY:
- typestr = rb_str_new2("CARRAY");
- break;
+ if(typedetails != Qnil)
+ rb_ary_push(typedetails, rb_str_new2("CARRAY"));
+ return rb_str_new2("CARRAY");
case VT_USERDEFINED:
- typestr = rb_str_new2("USERDEFINED");
- if (typedetails != Qnil)
- rb_ary_push(typedetails, typestr);
+ if(typedetails != Qnil)
+ rb_ary_push(typedetails, rb_str_new2("USERDEFINED"));
str = ole_usertype2val(pTypeInfo, pTypeDesc, typedetails);
if (str != Qnil) {
return str;
}
- return typestr;
+ return rb_str_new2("USERDEFINED");
case VT_UNKNOWN:
- typestr = rb_str_new2("UNKNOWN");
- break;
+ return rb_str_new2("UNKNOWN");
case VT_DISPATCH:
- typestr = rb_str_new2("DISPATCH");
- break;
- case VT_ERROR:
- typestr = rb_str_new2("ERROR");
- break;
- case VT_LPWSTR:
- typestr = rb_str_new2("LPWSTR");
- break;
- case VT_LPSTR:
- typestr = rb_str_new2("LPSTR");
- break;
+ if(typedetails != Qnil)
+ rb_ary_push(typedetails, rb_str_new2("DISPATCH"));
+ return rb_str_new2("DISPATCH");
default:
- typestr = rb_str_new2("Unknown Type ");
- rb_str_concat(typestr, rb_fix2str(INT2FIX(pTypeDesc->vt), 10));
- break;
+ str = rb_str_new2("Unknown Type ");
+ rb_str_concat(str, rb_fix2str(INT2FIX(pTypeDesc->vt), 10));
+ return str;
}
- if (typedetails != Qnil)
- rb_ary_push(typedetails, typestr);
- return typestr;
}
/*
@@ -4760,12 +3356,15 @@ ole_typedesc2val(ITypeInfo *pTypeInfo, TYPEDESC *pTypeDesc, VALUE typedetails)
*
*/
static VALUE
-fole_method_help(VALUE self, VALUE cmdname)
+fole_method_help( self, cmdname )
+ VALUE self;
+ VALUE cmdname;
{
ITypeInfo *pTypeInfo;
HRESULT hr;
struct oledata *pole;
VALUE method, obj;
+ LCID lcid = LOCALE_SYSTEM_DEFAULT;
Check_SafeStr(cmdname);
OLEData_Get_Struct(self, pole);
@@ -4776,7 +3375,7 @@ fole_method_help(VALUE self, VALUE cmdname)
obj = olemethod_from_typeinfo(method, pTypeInfo, cmdname);
OLE_RELEASE(pTypeInfo);
if (obj == Qnil)
- rb_raise(eWIN32OLERuntimeError, "not found %s",
+ rb_raise(eWIN32OLE_RUNTIME_ERROR, "not found %s",
StringValuePtr(cmdname));
return obj;
}
@@ -4792,7 +3391,7 @@ fole_method_help(VALUE self, VALUE cmdname)
* created with MFC should be initialized by calling
* IPersistXXX::InitNew.
*
- * If and only if you received the exception "HRESULT error code:
+ * If and only if you recieved the exception "HRESULT error code:
* 0x8000ffff catastrophic failure", try this method before
* invoking any ole_method.
*
@@ -4802,18 +3401,18 @@ fole_method_help(VALUE self, VALUE cmdname)
*
*/
static VALUE
-fole_activex_initialize(VALUE self)
+fole_activex_initialize(self)
+ VALUE self;
{
struct oledata *pole;
IPersistMemory *pPersistMemory;
- void *p;
HRESULT hr = S_OK;
OLEData_Get_Struct(self, pole);
- hr = pole->pDispatch->lpVtbl->QueryInterface(pole->pDispatch, &IID_IPersistMemory, &p);
- pPersistMemory = p;
+ hr = pole->pDispatch->lpVtbl->QueryInterface(pole->pDispatch, &IID_IPersistMemory,
+ (void **)&pPersistMemory);
if (SUCCEEDED(hr)) {
hr = pPersistMemory->lpVtbl->InitNew(pPersistMemory);
OLE_RELEASE(pPersistMemory);
@@ -4823,7 +3422,7 @@ fole_activex_initialize(VALUE self)
}
if (FAILED(hr)) {
- ole_raise(hr, eWIN32OLERuntimeError, "fail to initialize ActiveX control");
+ ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "fail to initialize ActiveX control");
}
return Qnil;
@@ -4834,20 +3433,35 @@ fole_activex_initialize(VALUE self)
* WIN32OLE_TYPE.ole_classes(typelib)
*
* Returns array of WIN32OLE_TYPE objects defined by the <i>typelib</i> type library.
- * This method will be OBSOLETE. Use WIN32OLE_TYPELIB.new(typelib).ole_classes instead.
*/
static VALUE
-foletype_s_ole_classes(VALUE self, VALUE typelib)
+foletype_s_ole_classes(self, typelib)
+ VALUE self;
+ VALUE typelib;
{
- VALUE obj;
+ VALUE file, classes;
+ OLECHAR * pbuf;
+ ITypeLib *pTypeLib;
+ HRESULT hr;
- /*
- rb_warn("%s is obsolete; use %s instead.",
- "WIN32OLE_TYPE.ole_classes",
- "WIN32OLE_TYPELIB.new(typelib).ole_types");
- */
- obj = rb_funcall(cWIN32OLE_TYPELIB, rb_intern("new"), 1, typelib);
- return rb_funcall(obj, rb_intern("ole_types"), 0);
+ rb_secure(4);
+ classes = rb_ary_new();
+ if(TYPE(typelib) == T_STRING) {
+ file = typelib_file(typelib);
+ if (file == Qnil) {
+ file = typelib;
+ }
+ pbuf = ole_mb2wc(StringValuePtr(file), -1);
+ hr = LoadTypeLibEx(pbuf, REGKIND_NONE, &pTypeLib);
+ if (FAILED(hr))
+ ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "failed to LoadTypeLibEx");
+ SysFreeString(pbuf);
+ ole_classes_from_typelib(pTypeLib, classes);
+ OLE_RELEASE(pTypeLib);
+ } else {
+ rb_raise(rb_eTypeError, "1st argument should be TypeLib string");
+ }
+ return classes;
}
/*
@@ -4855,18 +3469,48 @@ foletype_s_ole_classes(VALUE self, VALUE typelib)
* WIN32OLE_TYPE.typelibs
*
* Returns array of type libraries.
- * This method will be OBSOLETE. Use WIN32OLE_TYPELIB.typelibs.collect{|t| t.name} instead.
*
*/
static VALUE
-foletype_s_typelibs(VALUE self)
+foletype_s_typelibs(self)
+ VALUE self;
{
- /*
- rb_warn("%s is obsolete. use %s instead.",
- "WIN32OLE_TYPE.typelibs",
- "WIN32OLE_TYPELIB.typelibs.collect{t|t.name}");
- */
- return rb_eval_string("WIN32OLE_TYPELIB.typelibs.collect{|t|t.name}");
+ HKEY htypelib, hclsid;
+ double fversion;
+ DWORD i, j;
+ LONG err;
+ VALUE clsid;
+ VALUE ver;
+ VALUE v = Qnil;
+ VALUE typelibs = rb_ary_new();
+
+ err = reg_open_key(HKEY_CLASSES_ROOT, "TypeLib", &htypelib);
+ if(err != ERROR_SUCCESS) {
+ return typelibs;
+ }
+ for(i = 0; ; i++) {
+ clsid = reg_enum_key(htypelib, i);
+ if (clsid == Qnil)
+ break;
+ err = reg_open_vkey(htypelib, clsid, &hclsid);
+ if (err != ERROR_SUCCESS)
+ continue;
+ fversion = 0;
+ for(j = 0; ; j++) {
+ ver = reg_enum_key(hclsid, j);
+ if (ver == Qnil)
+ break;
+ if (fversion > atof(StringValuePtr(ver)))
+ continue;
+ fversion = atof(StringValuePtr(ver));
+ if ( (v = reg_get_val(hclsid, StringValuePtr(ver))) != Qnil ) {
+ rb_ary_push(typelibs, v);
+ }
+ }
+ RegCloseKey(hclsid);
+ }
+ RegCloseKey(htypelib);
+ return typelibs;
}
/*
@@ -4876,7 +3520,8 @@ foletype_s_typelibs(VALUE self)
* Returns array of ProgID.
*/
static VALUE
-foletype_s_progids(VALUE self)
+foletype_s_progids(self)
+ VALUE self;
{
HKEY hclsids, hclsid;
DWORD i;
@@ -4896,9 +3541,9 @@ foletype_s_progids(VALUE self)
err = reg_open_vkey(hclsids, clsid, &hclsid);
if (err != ERROR_SUCCESS)
continue;
- if ((v = reg_get_val2(hclsid, "ProgID")) != Qnil)
+ if ((v = reg_get_val(hclsid, "ProgID")) != Qnil)
rb_ary_push(progids, v);
- if ((v = reg_get_val2(hclsid, "VersionIndependentProgID")) != Qnil)
+ if ((v = reg_get_val(hclsid, "VersionIndependentProgID")) != Qnil)
rb_ary_push(progids, v);
RegCloseKey(hclsid);
}
@@ -4907,7 +3552,8 @@ foletype_s_progids(VALUE self)
}
static VALUE
-foletype_s_allocate(VALUE klass)
+foletype_s_allocate(klass)
+ VALUE klass;
{
struct oletypedata *poletype;
VALUE obj;
@@ -4918,7 +3564,10 @@ foletype_s_allocate(VALUE klass)
}
static VALUE
-oletype_set_member(VALUE self, ITypeInfo *pTypeInfo, VALUE name)
+oletype_set_member(self, pTypeInfo, name)
+ VALUE self;
+ ITypeInfo *pTypeInfo;
+ VALUE name;
{
struct oletypedata *ptype;
Data_Get_Struct(self, struct oletypedata, ptype);
@@ -4929,7 +3578,10 @@ oletype_set_member(VALUE self, ITypeInfo *pTypeInfo, VALUE name)
}
static VALUE
-oleclass_from_typelib(VALUE self, ITypeLib *pTypeLib, VALUE oleclass)
+oleclass_from_typelib(self, pTypeLib, oleclass)
+ VALUE self;
+ ITypeLib *pTypeLib;
+ VALUE oleclass;
{
long count;
@@ -4961,529 +3613,6 @@ oleclass_from_typelib(VALUE self, ITypeLib *pTypeLib, VALUE oleclass)
}
/*
- * Document-class: WIN32OLE_TYPELIB
- *
- * <code>WIN32OLE_TYPELIB</code> objects represent OLE tyblib information.
- */
-
-
-static VALUE
-oletypelib_set_member(VALUE self, VALUE typelib, VALUE guid, VALUE version)
-{
- rb_ivar_set(self, rb_intern("name"), typelib);
- rb_ivar_set(self, rb_intern("guid"), guid);
- rb_ivar_set(self, rb_intern("version"), version);
- return self;
-}
-
-/*
- * call-seq:
- *
- * WIN32OLE_TYPELIB.typelibs
- *
- * Returns the array of WIN32OLE_TYPELIB object.
- *
- * tlibs = WIN32OLE_TYPELIB.typelibs
- *
- */
-static VALUE
-foletypelib_s_typelibs(VALUE self)
-{
- HKEY htypelib, hguid;
- DWORD i, j;
- LONG err;
- VALUE guid;
- VALUE version;
- VALUE name = Qnil;
- VALUE typelibs = rb_ary_new();
- VALUE typelib = Qnil;
-
- err = reg_open_key(HKEY_CLASSES_ROOT, "TypeLib", &htypelib);
- if(err != ERROR_SUCCESS) {
- return typelibs;
- }
- for(i = 0; ; i++) {
- guid = reg_enum_key(htypelib, i);
- if (guid == Qnil)
- break;
- err = reg_open_vkey(htypelib, guid, &hguid);
- if (err != ERROR_SUCCESS)
- continue;
- for(j = 0; ; j++) {
- version = reg_enum_key(hguid, j);
- if (version == Qnil)
- break;
- if ( (name = reg_get_val2(hguid, StringValuePtr(version))) != Qnil ) {
- typelib = rb_funcall(cWIN32OLE_TYPELIB, rb_intern("allocate"), 0);
- oletypelib_set_member(typelib, name, guid, version);
- rb_ary_push(typelibs, typelib);
- }
- }
- RegCloseKey(hguid);
- }
- RegCloseKey(htypelib);
- return typelibs;
-}
-
-static VALUE
-make_version_str(VALUE major, VALUE minor)
-{
- VALUE version_str = Qnil;
- VALUE minor_str = Qnil;
- if (major == Qnil) {
- return Qnil;
- }
- version_str = rb_String(major);
- if (minor != Qnil) {
- minor_str = rb_String(minor);
- rb_str_cat2(version_str, ".");
- rb_str_append(version_str, minor_str);
- }
- return version_str;
-}
-
-static VALUE
-oletypelib_search_registry2(VALUE self, VALUE args)
-{
- HKEY htypelib, hguid, hversion;
- double fver;
- DWORD j;
- LONG err;
- VALUE found = Qfalse;
- VALUE tlib;
- VALUE ver;
- VALUE version_str;
- VALUE version = Qnil;
- VALUE typelib = Qnil;
-
- VALUE guid = rb_ary_entry(args, 0);
- version_str = make_version_str(rb_ary_entry(args, 1), rb_ary_entry(args, 2));
-
- err = reg_open_key(HKEY_CLASSES_ROOT, "TypeLib", &htypelib);
- if(err != ERROR_SUCCESS) {
- return Qfalse;
- }
- err = reg_open_vkey(htypelib, guid, &hguid);
- if (err != ERROR_SUCCESS) {
- RegCloseKey(htypelib);
- return Qfalse;
- }
- if (version_str != Qnil) {
- err = reg_open_vkey(hguid, version_str, &hversion);
- if (err == ERROR_SUCCESS) {
- tlib = reg_get_val(hversion, NULL);
- if (tlib != Qnil) {
- typelib = tlib;
- version = version_str;
- }
- }
- RegCloseKey(hversion);
- } else {
- fver = 0.0;
- for(j = 0; ;j++) {
- ver = reg_enum_key(hguid, j);
- if (ver == Qnil)
- break;
- err = reg_open_vkey(hguid, ver, &hversion);
- if (err != ERROR_SUCCESS)
- continue;
- tlib = reg_get_val(hversion, NULL);
- if (tlib == Qnil) {
- RegCloseKey(hversion);
- continue;
- }
- if (fver < atof(StringValuePtr(ver))) {
- fver = atof(StringValuePtr(ver));
- version = ver;
- typelib = tlib;
- }
- RegCloseKey(hversion);
- }
- }
- RegCloseKey(hguid);
- RegCloseKey(htypelib);
- if (typelib != Qnil) {
- found = Qtrue;
- oletypelib_set_member(self, typelib, guid, version);
- }
- return found;
-}
-
-static VALUE
-oletypelib_search_registry(VALUE self, VALUE typelib)
-{
- HKEY htypelib, hguid, hversion;
- DWORD i, j;
- LONG err;
- VALUE found = Qfalse;
- VALUE tlib;
- VALUE guid;
- VALUE ver;
-
- err = reg_open_key(HKEY_CLASSES_ROOT, "TypeLib", &htypelib);
- if(err != ERROR_SUCCESS) {
- return Qfalse;
- }
- for(i = 0; !found; i++) {
- guid = reg_enum_key(htypelib, i);
- if (guid == Qnil)
- break;
- err = reg_open_vkey(htypelib, guid, &hguid);
- if (err != ERROR_SUCCESS)
- continue;
- for(j = 0; found == Qfalse; j++) {
- ver = reg_enum_key(hguid, j);
- if (ver == Qnil)
- break;
- err = reg_open_vkey(hguid, ver, &hversion);
- if (err != ERROR_SUCCESS)
- continue;
- tlib = reg_get_val(hversion, NULL);
- if (tlib == Qnil) {
- RegCloseKey(hversion);
- continue;
- }
- if (rb_str_cmp(typelib, tlib) == 0) {
- oletypelib_set_member(self, typelib, guid, ver);
- found = Qtrue;
- }
- RegCloseKey(hversion);
- }
- RegCloseKey(hguid);
- }
- RegCloseKey(htypelib);
- return found;
-}
-
-/*
- * call-seq:
- * WIN32OLE_TYPELIB.new(typelib [, version1, version2]) -> WIN32OLE_TYPELIB object
- *
- * Returns a new WIN32OLE_TYPELIB object.
- *
- * The first argument <i>typelib</i> specifies OLE type library name or GUID or
- * OLE library file.
- * The second argument is major version or version of the type library.
- * The third argument is minor version.
- * The second argument and third argument are optional.
- * If the first argument is type library name, then the second and third argument
- * are ignored.
- *
- * tlib1 = WIN32OLE_TYPELIB.new('Microsoft Excel 9.0 Object Library')
- * tlib2 = WIN32OLE_TYPELIB.new('{00020813-0000-0000-C000-000000000046}')
- * tlib3 = WIN32OLE_TYPELIB.new('{00020813-0000-0000-C000-000000000046}', 1.3)
- * tlib4 = WIN32OLE_TYPELIB.new('{00020813-0000-0000-C000-000000000046}', 1, 3)
- * tlib5 = WIN32OLE_TYPELIB.new("C:\\WINNT\\SYSTEM32\\SHELL32.DLL")
- * puts tlib1.name # -> 'Microsoft Excel 9.0 Object Library'
- * puts tlib2.name # -> 'Microsoft Excel 9.0 Object Library'
- * puts tlib3.name # -> 'Microsoft Excel 9.0 Object Library'
- * puts tlib4.name # -> 'Microsoft Excel 9.0 Object Library'
- * puts tlib5.name # -> 'Microsoft Shell Controls And Automation'
- *
- */
-static VALUE
-foletypelib_initialize(VALUE self, VALUE args)
-{
- VALUE found = Qfalse;
- VALUE typelib = Qnil;
- int len = 0;
- OLECHAR * pbuf;
- ITypeLib *pTypeLib;
- VALUE retval;
- HRESULT hr = S_OK;
-
- len = RARRAY_LEN(args);
- if (len < 1 || len > 3) {
- rb_raise(rb_eArgError, "wrong number of arguments (%d for 1..3)", len);
- }
-
- typelib = rb_ary_entry(args, 0);
-
- Check_SafeStr(typelib);
-
- found = oletypelib_search_registry(self, typelib);
- if (found == Qfalse) {
- found = oletypelib_search_registry2(self, args);
- }
- if (found == Qfalse) {
- pbuf = ole_vstr2wc(typelib);
- hr = LoadTypeLibEx(pbuf, REGKIND_NONE, &pTypeLib);
- SysFreeString(pbuf);
- if (SUCCEEDED(hr)) {
- retval = ole_typelib_from_itypelib(pTypeLib);
- OLE_RELEASE(pTypeLib);
- if (retval != Qnil) {
- found = Qtrue;
- oletypelib_set_member(self,
- rb_ivar_get(retval, rb_intern("name")),
- rb_ivar_get(retval, rb_intern("guid")),
- rb_ivar_get(retval, rb_intern("version")));
- }
- }
- }
-
- if (found == Qfalse) {
- rb_raise(eWIN32OLERuntimeError, "not found type library `%s`",
- StringValuePtr(typelib));
- }
- return self;
-}
-
-/*
- * call-seq:
- * WIN32OLE_TYPELIB#guid -> The guid string.
- *
- * Returns guid string which specifies type library.
- *
- * tlib = WIN32OLE_TYPELIB.new('Microsoft Excel 9.0 Object Library')
- * guid = tlib.guid # -> '{00020813-0000-0000-C000-000000000046}'
- */
-static VALUE
-foletypelib_guid(VALUE self)
-{
- return rb_ivar_get(self, rb_intern("guid"));
-}
-
-/*
- * call-seq:
- * WIN32OLE_TYPELIB#name -> The type library name
- *
- * Returns the type library name.
- *
- * tlib = WIN32OLE_TYPELIB.new('Microsoft Excel 9.0 Object Library')
- * name = tlib.name # -> 'Microsoft Excel 9.0 Object Library'
- */
-static VALUE
-foletypelib_name(VALUE self)
-{
- VALUE name = rb_ivar_get(self, rb_intern("name"));
- return rb_enc_str_new(StringValuePtr(name), strlen(StringValuePtr(name)), cWIN32OLE_enc);
-}
-
-/*
- * call-seq:
- * WIN32OLE_TYPELIB#version -> The type library version.
- *
- * Returns the type library version.
- *
- * tlib = WIN32OLE_TYPELIB.new('Microsoft Excel 9.0 Object Library')
- * puts tlib.version #-> 1.3
- */
-static VALUE
-foletypelib_version(VALUE self)
-{
- VALUE ver = rb_ivar_get(self, rb_intern("version"));
- return rb_Float(ver);
-}
-
-/*
- * call-seq:
- * WIN32OLE_TYPELIB#major_version -> The type library major version.
- *
- * Returns the type library major version.
- *
- * tlib = WIN32OLE_TYPELIB.new('Microsoft Excel 9.0 Object Library')
- * puts tlib.major_version # -> 1
- */
-static VALUE
-foletypelib_major_version(VALUE self)
-{
- VALUE ver = rb_ivar_get(self, rb_intern("version"));
- VALUE ary = rb_str_split(ver, ".");
- return rb_Integer(rb_ary_entry(ary, 0));
-}
-
-/*
- * call-seq:
- * WIN32OLE_TYPELIB#minor_version -> The type library minor version.
- *
- * Returns the type library minor version.
- *
- * tlib = WIN32OLE_TYPELIB.new('Microsoft Excel 9.0 Object Library')
- * puts tlib.minor_version # -> 3
- */
-static VALUE
-foletypelib_minor_version(VALUE self)
-{
- VALUE ver = rb_ivar_get(self, rb_intern("version"));
- VALUE ary = rb_str_split(ver, ".");
- return rb_Integer(rb_ary_entry(ary, 1));
-}
-
-static VALUE
-oletypelib_path(VALUE guid, VALUE version)
-{
- int k;
- LONG err;
- HKEY hkey;
- HKEY hlang;
- VALUE lang;
- VALUE path = Qnil;
-
- VALUE key = rb_str_new2("TypeLib\\");
- rb_str_concat(key, guid);
- rb_str_cat2(key, "\\");
- rb_str_concat(key, version);
-
- err = reg_open_vkey(HKEY_CLASSES_ROOT, key, &hkey);
- if (err != ERROR_SUCCESS) {
- return Qnil;
- }
- for(k = 0; path == Qnil; k++) {
- lang = reg_enum_key(hkey, k);
- if (lang == Qnil)
- break;
- err = reg_open_vkey(hkey, lang, &hlang);
- if (err == ERROR_SUCCESS) {
- path = reg_get_typelib_file_path(hlang);
- RegCloseKey(hlang);
- }
- }
- RegCloseKey(hkey);
- return path;
-}
-
-/*
- * call-seq:
- * WIN32OLE_TYPELIB#path -> The type library file path.
- *
- * Returns the type library file path.
- *
- * tlib = WIN32OLE_TYPELIB.new('Microsoft Excel 9.0 Object Library')
- * puts tlib.path #-> 'C:\...\EXCEL9.OLB'
- */
-static VALUE
-foletypelib_path(VALUE self)
-{
- VALUE guid = rb_ivar_get(self, rb_intern("guid"));
- VALUE version = rb_ivar_get(self, rb_intern("version"));
- return oletypelib_path(guid, version);
-}
-
-static void
-oletypelib2itypelib(VALUE self, ITypeLib **ppTypeLib)
-{
- VALUE path = Qnil;
- OLECHAR *pbuf;
- HRESULT hr = S_OK;
- path = rb_funcall(self, rb_intern("path"), 0);
- if (path != Qnil) {
- pbuf = ole_vstr2wc(path);
- hr = LoadTypeLibEx(pbuf, REGKIND_NONE, ppTypeLib);
- SysFreeString(pbuf);
- if (FAILED(hr))
- ole_raise(hr, eWIN32OLERuntimeError, "failed to LoadTypeLibEx from `%s'",
- StringValuePtr(path));
- } else {
- rb_raise(eWIN32OLERuntimeError, "failed to get type library path");
- }
-}
-
-/*
- * call-seq:
- * WIN32OLE_TYPELIB#visible?
- *
- * Returns true if the type library information is not hidden.
- * If wLibFlags of TLIBATTR is 0 or LIBFLAG_FRESTRICTED or LIBFLAG_FHIDDEN,
- * the method returns false, otherwise, returns true.
- * If the method fails to access the TLIBATTR information, then
- * WIN32OLERuntimeError is raised.
- *
- * tlib = WIN32OLE_TYPELIB.new('Microsoft Excel 9.0 Object Library')
- * tlib.visible? # => true
- */
-static VALUE
-foletypelib_visible(VALUE self)
-{
- HRESULT hr;
- ITypeLib *pTypeLib = NULL;
- VALUE visible = Qtrue;
- TLIBATTR *pTLibAttr;
-
- oletypelib2itypelib(self, &pTypeLib);
-
- hr = pTypeLib->lpVtbl->GetLibAttr(pTypeLib, &pTLibAttr);
- if (FAILED(hr)) {
- OLE_RELEASE(pTypeLib);
- ole_raise(hr, eWIN32OLERuntimeError, "failed to get TLIBATTR information");
- }
- if ((pTLibAttr->wLibFlags == 0) ||
- (pTLibAttr->wLibFlags & LIBFLAG_FRESTRICTED) ||
- (pTLibAttr->wLibFlags & LIBFLAG_FHIDDEN)) {
- visible = Qfalse;
- }
- pTypeLib->lpVtbl->ReleaseTLibAttr(pTypeLib, pTLibAttr);
- OLE_RELEASE(pTypeLib);
- return visible;
-}
-
-/*
- * call-seq:
- * WIN32OLE_TYPELIB#library_name
- *
- * Returns library name.
- * If the method fails to access library name, WIN32OLERuntimeError is raised.
- *
- * tlib = WIN32OLE_TYPELIB.new('Microsoft Excel 9.0 Object Library')
- * tlib.library_name # => Excel
- */
-static VALUE
-foletypelib_library_name(VALUE self)
-{
- HRESULT hr;
- ITypeLib *pTypeLib = NULL;
- VALUE libname = Qnil;
- BSTR bstr;
-
- oletypelib2itypelib(self, &pTypeLib);
- hr = pTypeLib->lpVtbl->GetDocumentation(pTypeLib, -1,
- &bstr, NULL, NULL, NULL);
- if (FAILED(hr)) {
- OLE_RELEASE(pTypeLib);
- ole_raise(hr, eWIN32OLERuntimeError, "failed to get library name");
- }
- OLE_RELEASE(pTypeLib);
- libname = WC2VSTR(bstr);
- return libname;
-}
-
-
-/*
- * call-seq:
- * WIN32OLE_TYPELIB#ole_types -> The array of WIN32OLE_TYPE object included the type library.
- *
- * Returns the type library file path.
- *
- * tlib = WIN32OLE_TYPELIB.new('Microsoft Excel 9.0 Object Library')
- * classes = tlib.ole_types.collect{|k| k.name} # -> ['AddIn', 'AddIns' ...]
- */
-static VALUE
-foletypelib_ole_types(VALUE self)
-{
- ITypeLib *pTypeLib = NULL;
- VALUE classes = rb_ary_new();
- oletypelib2itypelib(self, &pTypeLib);
- ole_types_from_typelib(pTypeLib, classes);
- OLE_RELEASE(pTypeLib);
- return classes;
-}
-
-/*
- * call-seq:
- * WIN32OLE_TYPELIB#inspect -> String
- *
- * Returns the type library name with class name.
- *
- * tlib = WIN32OLE_TYPELIB.new('Microsoft Excel 9.0 Object Library')
- * tlib.inspect # => "<#WIN32OLE_TYPELIB:Microsoft Excel 9.0 Object Library>"
- */
-static VALUE
-foletypelib_inspect(VALUE self)
-{
- return default_inspect(self, "WIN32OLE_TYPELIB");
-}
-
-/*
* Document-class: WIN32OLE_TYPE
*
* <code>WIN32OLE_TYPE</code> objects represent OLE type libarary information.
@@ -5501,7 +3630,10 @@ foletypelib_inspect(VALUE self)
* # => WIN32OLE_TYPE object of Application class of Excel.
*/
static VALUE
-foletype_initialize(VALUE self, VALUE typelib, VALUE oleclass)
+foletype_initialize(self, typelib, oleclass)
+ VALUE self;
+ VALUE typelib;
+ VALUE oleclass;
{
VALUE file;
OLECHAR * pbuf;
@@ -5514,14 +3646,14 @@ foletype_initialize(VALUE self, VALUE typelib, VALUE oleclass)
if (file == Qnil) {
file = typelib;
}
- pbuf = ole_vstr2wc(file);
+ pbuf = ole_mb2wc(StringValuePtr(file), -1);
hr = LoadTypeLibEx(pbuf, REGKIND_NONE, &pTypeLib);
if (FAILED(hr))
- ole_raise(hr, eWIN32OLERuntimeError, "failed to LoadTypeLibEx");
+ ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "failed to LoadTypeLibEx");
SysFreeString(pbuf);
if (oleclass_from_typelib(self, pTypeLib, oleclass) == Qfalse) {
OLE_RELEASE(pTypeLib);
- rb_raise(eWIN32OLERuntimeError, "not found `%s` in `%s`",
+ rb_raise(eWIN32OLE_RUNTIME_ERROR, "not found `%s` in `%s`",
StringValuePtr(oleclass), StringValuePtr(typelib));
}
OLE_RELEASE(pTypeLib);
@@ -5537,13 +3669,15 @@ foletype_initialize(VALUE self, VALUE typelib, VALUE oleclass)
* puts tobj.name # => Application
*/
static VALUE
-foletype_name(VALUE self)
+foletype_name(self)
+ VALUE self;
{
return rb_ivar_get(self, rb_intern("name"));
}
static VALUE
-ole_ole_type(ITypeInfo *pTypeInfo)
+ole_ole_type(pTypeInfo)
+ ITypeInfo *pTypeInfo;
{
HRESULT hr;
TYPEATTR *pTypeAttr;
@@ -5597,7 +3731,8 @@ ole_ole_type(ITypeInfo *pTypeInfo)
* puts tobj.ole_type # => Class
*/
static VALUE
-foletype_ole_type(VALUE self)
+foletype_ole_type(self)
+ VALUE self;
{
struct oletypedata *ptype;
Data_Get_Struct(self, struct oletypedata, ptype);
@@ -5605,7 +3740,8 @@ foletype_ole_type(VALUE self)
}
static VALUE
-ole_type_guid(ITypeInfo *pTypeInfo)
+ole_type_guid(pTypeInfo)
+ ITypeInfo *pTypeInfo;
{
HRESULT hr;
TYPEATTR *pTypeAttr;
@@ -5632,7 +3768,8 @@ ole_type_guid(ITypeInfo *pTypeInfo)
* puts tobj.guid # => {00024500-0000-0000-C000-000000000046}
*/
static VALUE
-foletype_guid(VALUE self)
+foletype_guid(self)
+ VALUE self;
{
struct oletypedata *ptype;
Data_Get_Struct(self, struct oletypedata, ptype);
@@ -5640,7 +3777,8 @@ foletype_guid(VALUE self)
}
static VALUE
-ole_type_progid(ITypeInfo *pTypeInfo)
+ole_type_progid(pTypeInfo)
+ ITypeInfo *pTypeInfo;
{
HRESULT hr;
TYPEATTR *pTypeAttr;
@@ -5650,7 +3788,7 @@ ole_type_progid(ITypeInfo *pTypeInfo)
if (FAILED(hr))
return progid;
hr = ProgIDFromCLSID(&pTypeAttr->guid, &pbuf);
- if (SUCCEEDED(hr)) {
+ if (SUCCEEDED(hr)) {
progid = ole_wc2vstr(pbuf, FALSE);
CoTaskMemFree(pbuf);
}
@@ -5667,7 +3805,8 @@ ole_type_progid(ITypeInfo *pTypeInfo)
* puts tobj.progid # => Excel.Application.9
*/
static VALUE
-foletype_progid(VALUE self)
+foletype_progid(self)
+ VALUE self;
{
struct oletypedata *ptype;
Data_Get_Struct(self, struct oletypedata, ptype);
@@ -5676,7 +3815,8 @@ foletype_progid(VALUE self)
static VALUE
-ole_type_visible(ITypeInfo *pTypeInfo)
+ole_type_visible(pTypeInfo)
+ ITypeInfo *pTypeInfo;
{
HRESULT hr;
TYPEATTR *pTypeAttr;
@@ -5702,7 +3842,8 @@ ole_type_visible(ITypeInfo *pTypeInfo)
* puts tobj.visible # => true
*/
static VALUE
-foletype_visible(VALUE self)
+foletype_visible(self)
+ VALUE self;
{
struct oletypedata *ptype;
Data_Get_Struct(self, struct oletypedata, ptype);
@@ -5710,14 +3851,15 @@ foletype_visible(VALUE self)
}
static VALUE
-ole_type_major_version(ITypeInfo *pTypeInfo)
+ole_type_major_version(pTypeInfo)
+ ITypeInfo *pTypeInfo;
{
VALUE ver;
TYPEATTR *pTypeAttr;
HRESULT hr;
hr = OLE_GET_TYPEATTR(pTypeInfo, &pTypeAttr);
if (FAILED(hr))
- ole_raise(hr, eWIN32OLERuntimeError, "failed to GetTypeAttr");
+ ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "failed to GetTypeAttr");
ver = INT2FIX(pTypeAttr->wMajorVerNum);
OLE_RELEASE_TYPEATTR(pTypeInfo, pTypeAttr);
return ver;
@@ -5732,7 +3874,8 @@ ole_type_major_version(ITypeInfo *pTypeInfo)
* puts tobj.major_version # => 8
*/
static VALUE
-foletype_major_version(VALUE self)
+foletype_major_version(self)
+ VALUE self;
{
struct oletypedata *ptype;
Data_Get_Struct(self, struct oletypedata, ptype);
@@ -5740,14 +3883,15 @@ foletype_major_version(VALUE self)
}
static VALUE
-ole_type_minor_version(ITypeInfo *pTypeInfo)
+ole_type_minor_version(pTypeInfo)
+ ITypeInfo *pTypeInfo;
{
VALUE ver;
TYPEATTR *pTypeAttr;
HRESULT hr;
hr = OLE_GET_TYPEATTR(pTypeInfo, &pTypeAttr);
if (FAILED(hr))
- ole_raise(hr, eWIN32OLERuntimeError, "failed to GetTypeAttr");
+ ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "failed to GetTypeAttr");
ver = INT2FIX(pTypeAttr->wMinorVerNum);
OLE_RELEASE_TYPEATTR(pTypeInfo, pTypeAttr);
return ver;
@@ -5762,7 +3906,8 @@ ole_type_minor_version(ITypeInfo *pTypeInfo)
* puts tobj.minor_version # => 2
*/
static VALUE
-foletype_minor_version(VALUE self)
+foletype_minor_version(self)
+ VALUE self;
{
struct oletypedata *ptype;
Data_Get_Struct(self, struct oletypedata, ptype);
@@ -5770,14 +3915,15 @@ foletype_minor_version(VALUE self)
}
static VALUE
-ole_type_typekind(ITypeInfo *pTypeInfo)
+ole_type_typekind(pTypeInfo)
+ ITypeInfo *pTypeInfo;
{
VALUE typekind;
TYPEATTR *pTypeAttr;
HRESULT hr;
hr = OLE_GET_TYPEATTR(pTypeInfo, &pTypeAttr);
if (FAILED(hr))
- ole_raise(hr, eWIN32OLERuntimeError, "failed to GetTypeAttr");
+ ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "failed to GetTypeAttr");
typekind = INT2FIX(pTypeAttr->typekind);
OLE_RELEASE_TYPEATTR(pTypeInfo, pTypeAttr);
return typekind;
@@ -5793,7 +3939,8 @@ ole_type_typekind(ITypeInfo *pTypeInfo)
*
*/
static VALUE
-foletype_typekind(VALUE self)
+foletype_typekind(self)
+ VALUE self;
{
struct oletypedata *ptype;
Data_Get_Struct(self, struct oletypedata, ptype);
@@ -5801,7 +3948,8 @@ foletype_typekind(VALUE self)
}
static VALUE
-ole_type_helpstring(ITypeInfo *pTypeInfo)
+ole_type_helpstring(pTypeInfo)
+ ITypeInfo *pTypeInfo;
{
HRESULT hr;
BSTR bhelpstr;
@@ -5821,7 +3969,8 @@ ole_type_helpstring(ITypeInfo *pTypeInfo)
* puts tobj.helpstring # => Web Browser interface
*/
static VALUE
-foletype_helpstring(VALUE self)
+foletype_helpstring(self)
+ VALUE self;
{
struct oletypedata *ptype;
Data_Get_Struct(self, struct oletypedata, ptype);
@@ -5829,7 +3978,8 @@ foletype_helpstring(VALUE self)
}
static VALUE
-ole_type_src_type(ITypeInfo *pTypeInfo)
+ole_type_src_type(pTypeInfo)
+ ITypeInfo *pTypeInfo;
{
HRESULT hr;
TYPEATTR *pTypeAttr;
@@ -5856,7 +4006,8 @@ ole_type_src_type(ITypeInfo *pTypeInfo)
*
*/
static VALUE
-foletype_src_type(VALUE self)
+foletype_src_type(self)
+ VALUE self;
{
struct oletypedata *ptype;
Data_Get_Struct(self, struct oletypedata, ptype);
@@ -5864,7 +4015,8 @@ foletype_src_type(VALUE self)
}
static VALUE
-ole_type_helpfile(ITypeInfo *pTypeInfo)
+ole_type_helpfile(pTypeInfo)
+ ITypeInfo *pTypeInfo;
{
HRESULT hr;
BSTR bhelpfile;
@@ -5885,7 +4037,8 @@ ole_type_helpfile(ITypeInfo *pTypeInfo)
*
*/
static VALUE
-foletype_helpfile(VALUE self)
+foletype_helpfile(self)
+ VALUE self;
{
struct oletypedata *ptype;
Data_Get_Struct(self, struct oletypedata, ptype);
@@ -5893,7 +4046,8 @@ foletype_helpfile(VALUE self)
}
static VALUE
-ole_type_helpcontext(ITypeInfo *pTypeInfo)
+ole_type_helpcontext(pTypeInfo)
+ ITypeInfo *pTypeInfo;
{
HRESULT hr;
DWORD helpcontext;
@@ -5913,158 +4067,17 @@ ole_type_helpcontext(ITypeInfo *pTypeInfo)
* puts tobj.helpfile # => 131185
*/
static VALUE
-foletype_helpcontext(VALUE self)
+foletype_helpcontext(self)
+ VALUE self;
{
struct oletypedata *ptype;
Data_Get_Struct(self, struct oletypedata, ptype);
return ole_type_helpcontext(ptype->pTypeInfo);
}
-/*
- * call-seq:
- * WIN32OLE_TYPE#ole_typelib
- *
- * Returns the WIN32OLE_TYPELIB object which is including the WIN32OLE_TYPE
- * object. If it is not found, then returns nil.
- * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Worksheet')
- * puts tobj.ole_typelib # => 'Microsoft Excel 9.0 Object Library'
- */
-static VALUE
-foletype_ole_typelib(VALUE self)
-{
- struct oletypedata *ptype;
- Data_Get_Struct(self, struct oletypedata, ptype);
- return ole_typelib_from_itypeinfo(ptype->pTypeInfo);
-}
-
static VALUE
-ole_type_impl_ole_types(ITypeInfo *pTypeInfo, int implflags)
-{
- HRESULT hr;
- ITypeInfo *pRefTypeInfo;
- HREFTYPE href;
- WORD i;
- VALUE type;
- TYPEATTR *pTypeAttr;
- int flags;
-
- VALUE types = rb_ary_new();
- hr = OLE_GET_TYPEATTR(pTypeInfo, &pTypeAttr);
- if (FAILED(hr)) {
- return types;
- }
- for (i = 0; i < pTypeAttr->cImplTypes; i++) {
- hr = pTypeInfo->lpVtbl->GetImplTypeFlags(pTypeInfo, i, &flags);
- if (FAILED(hr))
- continue;
-
- hr = pTypeInfo->lpVtbl->GetRefTypeOfImplType(pTypeInfo, i, &href);
- if (FAILED(hr))
- continue;
- hr = pTypeInfo->lpVtbl->GetRefTypeInfo(pTypeInfo, href, &pRefTypeInfo);
- if (FAILED(hr))
- continue;
-
- if ((flags & implflags) == implflags) {
- type = ole_type_from_itypeinfo(pRefTypeInfo);
- if (type != Qnil) {
- rb_ary_push(types, type);
- }
- }
-
- OLE_RELEASE(pRefTypeInfo);
- }
- OLE_RELEASE_TYPEATTR(pTypeInfo, pTypeAttr);
- return types;
-}
-
-/*
- * call-seq:
- * WIN32OLE_TYPE#implemented_ole_types
- *
- * Returns the array of WIN32OLE_TYPE object which is implemented by the WIN32OLE_TYPE
- * object.
- * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Worksheet')
- * p tobj.implemented_ole_types # => [_Worksheet, DocEvents]
- */
-static VALUE
-foletype_impl_ole_types(VALUE self)
-{
- struct oletypedata *ptype;
- Data_Get_Struct(self, struct oletypedata, ptype);
- return ole_type_impl_ole_types(ptype->pTypeInfo, 0);
-}
-
-/*
- * call-seq:
- * WIN32OLE_TYPE#source_ole_types
- *
- * Returns the array of WIN32OLE_TYPE object which is implemented by the WIN32OLE_TYPE
- * object and having IMPLTYPEFLAG_FSOURCE.
- * tobj = WIN32OLE_TYPE.new('Microsoft Internet Controls', "InternetExplorer")
- * p tobj.source_ole_types
- * # => [#<WIN32OLE_TYPE:DWebBrowserEvents2>, #<WIN32OLE_TYPE:DWebBrowserEvents>]
- */
-static VALUE
-foletype_source_ole_types(VALUE self)
-{
- struct oletypedata *ptype;
- Data_Get_Struct(self, struct oletypedata, ptype);
- return ole_type_impl_ole_types(ptype->pTypeInfo, IMPLTYPEFLAG_FSOURCE);
-}
-
-/*
- * call-seq:
- * WIN32OLE_TYPE#default_event_sources
- *
- * Returns the array of WIN32OLE_TYPE object which is implemented by the WIN32OLE_TYPE
- * object and having IMPLTYPEFLAG_FSOURCE and IMPLTYPEFLAG_FDEFAULT.
- * tobj = WIN32OLE_TYPE.new('Microsoft Internet Controls', "InternetExplorer")
- * p tobj.default_event_sources # => [#<WIN32OLE_TYPE:DWebBrowserEvents2>]
- */
-static VALUE
-foletype_default_event_sources(VALUE self)
-{
- struct oletypedata *ptype;
- Data_Get_Struct(self, struct oletypedata, ptype);
- return ole_type_impl_ole_types(ptype->pTypeInfo, IMPLTYPEFLAG_FSOURCE|IMPLTYPEFLAG_FDEFAULT);
-}
-
-/*
- * call-seq:
- * WIN32OLE_TYPE#default_ole_types
- *
- * Returns the array of WIN32OLE_TYPE object which is implemented by the WIN32OLE_TYPE
- * object and having IMPLTYPEFLAG_FDEFAULT.
- * tobj = WIN32OLE_TYPE.new('Microsoft Internet Controls', "InternetExplorer")
- * p tobj.default_ole_types
- * # => [#<WIN32OLE_TYPE:IWebBrowser2>, #<WIN32OLE_TYPE:DWebBrowserEvents2>]
- */
-static VALUE
-foletype_default_ole_types(VALUE self)
-{
- struct oletypedata *ptype;
- Data_Get_Struct(self, struct oletypedata, ptype);
- return ole_type_impl_ole_types(ptype->pTypeInfo, IMPLTYPEFLAG_FDEFAULT);
-}
-
-/*
- * call-seq:
- * WIN32OLE_TYPE#inspect -> String
- *
- * Returns the type name with class name.
- *
- * ie = WIN32OLE.new('InternetExplorer.Application')
- * ie.ole_type.inspect => #<WIN32OLE_TYPE:IWebBrowser2>
- */
-static VALUE
-foletype_inspect(VALUE self)
-{
- return default_inspect(self, "WIN32OLE_TYPE");
-}
-
-static VALUE
-ole_variables(ITypeInfo *pTypeInfo)
+ole_variables(pTypeInfo)
+ ITypeInfo *pTypeInfo;
{
HRESULT hr;
TYPEATTR *pTypeAttr;
@@ -6078,7 +4091,7 @@ ole_variables(ITypeInfo *pTypeInfo)
VALUE variables = rb_ary_new();
hr = OLE_GET_TYPEATTR(pTypeInfo, &pTypeAttr);
if (FAILED(hr)) {
- ole_raise(hr, eWIN32OLERuntimeError, "failed to GetTypeAttr");
+ ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "failed to GetTypeAttr");
}
for(i = 0; i < pTypeAttr->cVars; i++) {
@@ -6128,7 +4141,8 @@ ole_variables(ITypeInfo *pTypeInfo)
*
*/
static VALUE
-foletype_variables(VALUE self)
+foletype_variables(self)
+ VALUE self;
{
struct oletypedata *ptype;
Data_Get_Struct(self, struct oletypedata, ptype);
@@ -6148,7 +4162,10 @@ foletype_variables(VALUE self)
* # => ['Activate', 'Copy', 'Delete',....]
*/
static VALUE
-foletype_methods(VALUE self)
+foletype_methods(argc, argv, self)
+ int argc;
+ VALUE *argv;
+ VALUE self;
{
struct oletypedata *ptype;
Data_Get_Struct(self, struct oletypedata, ptype);
@@ -6182,20 +4199,23 @@ foletype_methods(VALUE self)
*
*/
static VALUE
-folevariable_name(VALUE self)
+folevariable_name(self)
+ VALUE self;
{
return rb_ivar_get(self, rb_intern("name"));
}
static VALUE
-ole_variable_ole_type(ITypeInfo *pTypeInfo, UINT var_index)
+ole_variable_ole_type(pTypeInfo, var_index)
+ ITypeInfo *pTypeInfo;
+ UINT var_index;
{
VARDESC *pVarDesc;
HRESULT hr;
VALUE type;
hr = pTypeInfo->lpVtbl->GetVarDesc(pTypeInfo, var_index, &pVarDesc);
if (FAILED(hr))
- ole_raise(hr, eWIN32OLERuntimeError, "failed to GetVarDesc");
+ ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "failed to GetVarDesc");
type = ole_typedesc2val(pTypeInfo, &(pVarDesc->elemdescVar.tdesc), Qnil);
pTypeInfo->lpVtbl->ReleaseVarDesc(pTypeInfo, pVarDesc);
return type;
@@ -6222,7 +4242,8 @@ ole_variable_ole_type(ITypeInfo *pTypeInfo, UINT var_index)
*
*/
static VALUE
-folevariable_ole_type(VALUE self)
+folevariable_ole_type(self)
+ VALUE self;
{
struct olevariabledata *pvar;
Data_Get_Struct(self, struct olevariabledata, pvar);
@@ -6230,14 +4251,16 @@ folevariable_ole_type(VALUE self)
}
static VALUE
-ole_variable_ole_type_detail(ITypeInfo *pTypeInfo, UINT var_index)
+ole_variable_ole_type_detail(pTypeInfo, var_index)
+ ITypeInfo *pTypeInfo;
+ UINT var_index;
{
VARDESC *pVarDesc;
HRESULT hr;
VALUE type = rb_ary_new();
hr = pTypeInfo->lpVtbl->GetVarDesc(pTypeInfo, var_index, &pVarDesc);
if (FAILED(hr))
- ole_raise(hr, eWIN32OLERuntimeError, "failed to GetVarDesc");
+ ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "failed to GetVarDesc");
ole_typedesc2val(pTypeInfo, &(pVarDesc->elemdescVar.tdesc), type);
pTypeInfo->lpVtbl->ReleaseVarDesc(pTypeInfo, pVarDesc);
return type;
@@ -6256,7 +4279,8 @@ ole_variable_ole_type_detail(ITypeInfo *pTypeInfo, UINT var_index)
*
*/
static VALUE
-folevariable_ole_type_detail(VALUE self)
+folevariable_ole_type_detail(self)
+ VALUE self;
{
struct olevariabledata *pvar;
Data_Get_Struct(self, struct olevariabledata, pvar);
@@ -6264,7 +4288,9 @@ folevariable_ole_type_detail(VALUE self)
}
static VALUE
-ole_variable_value(ITypeInfo *pTypeInfo, UINT var_index)
+ole_variable_value(pTypeInfo, var_index)
+ ITypeInfo *pTypeInfo;
+ UINT var_index;
{
VARDESC *pVarDesc;
HRESULT hr;
@@ -6288,7 +4314,7 @@ ole_variable_value(ITypeInfo *pTypeInfo, UINT var_index)
* tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'XlSheetType')
* variables = tobj.variables
* variables.each do |variable|
- * puts "#{variable.name} #{variable.value}"
+ * puts "#{variable.name} = #{variable.value}"
* end
*
* The result of above script is following:
@@ -6300,7 +4326,8 @@ ole_variable_value(ITypeInfo *pTypeInfo, UINT var_index)
*
*/
static VALUE
-folevariable_value(VALUE self)
+folevariable_value(self)
+ VALUE self;
{
struct olevariabledata *pvar;
Data_Get_Struct(self, struct olevariabledata, pvar);
@@ -6308,7 +4335,9 @@ folevariable_value(VALUE self)
}
static VALUE
-ole_variable_visible(ITypeInfo *pTypeInfo, UINT var_index)
+ole_variable_visible(pTypeInfo, var_index)
+ ITypeInfo *pTypeInfo;
+ UINT var_index;
{
VARDESC *pVarDesc;
HRESULT hr;
@@ -6346,7 +4375,8 @@ ole_variable_visible(ITypeInfo *pTypeInfo, UINT var_index)
*
*/
static VALUE
-folevariable_visible(VALUE self)
+folevariable_visible(self)
+ VALUE self;
{
struct olevariabledata *pvar;
Data_Get_Struct(self, struct olevariabledata, pvar);
@@ -6354,7 +4384,9 @@ folevariable_visible(VALUE self)
}
static VALUE
-ole_variable_kind(ITypeInfo *pTypeInfo, UINT var_index)
+ole_variable_kind(pTypeInfo, var_index)
+ ITypeInfo *pTypeInfo;
+ UINT var_index;
{
VARDESC *pVarDesc;
HRESULT hr;
@@ -6402,7 +4434,8 @@ ole_variable_kind(ITypeInfo *pTypeInfo, UINT var_index)
* xlWorksheet CONSTANT
*/
static VALUE
-folevariable_variable_kind(VALUE self)
+folevariable_variable_kind(self)
+ VALUE self;
{
struct olevariabledata *pvar;
Data_Get_Struct(self, struct olevariabledata, pvar);
@@ -6410,7 +4443,9 @@ folevariable_variable_kind(VALUE self)
}
static VALUE
-ole_variable_varkind(ITypeInfo *pTypeInfo, UINT var_index)
+ole_variable_varkind(pTypeInfo, var_index)
+ ITypeInfo *pTypeInfo;
+ UINT var_index;
{
VARDESC *pVarDesc;
HRESULT hr;
@@ -6442,7 +4477,8 @@ ole_variable_varkind(ITypeInfo *pTypeInfo, UINT var_index)
* xlWorksheet 2
*/
static VALUE
-folevariable_varkind(VALUE self)
+folevariable_varkind(self)
+ VALUE self;
{
struct olevariabledata *pvar;
Data_Get_Struct(self, struct olevariabledata, pvar);
@@ -6450,29 +4486,18 @@ folevariable_varkind(VALUE self)
}
/*
- * call-seq:
- * WIN32OLE_VARIABLE#inspect -> String
- *
- * Returns the OLE variable name and the value with class name.
- *
- */
-static VALUE
-folevariable_inspect(VALUE self)
-{
- VALUE detail = rb_funcall(self, rb_intern("to_s"), 0);
- rb_str_cat2(detail, "=");
- rb_str_concat(detail, rb_funcall(rb_funcall(self, rb_intern("value"), 0), rb_intern("inspect"), 0));
- return make_inspect("WIN32OLE_VARIABLE", detail);
-}
-
-/*
* Document-class: WIN32OLE_METHOD
*
* <code>WIN32OLE_METHOD</code> objects represent OLE method information.
*/
static VALUE
-olemethod_set_member(VALUE self, ITypeInfo *pTypeInfo, ITypeInfo *pOwnerTypeInfo, int index, VALUE name)
+olemethod_set_member(self, pTypeInfo, pOwnerTypeInfo, index, name)
+ VALUE self;
+ ITypeInfo *pTypeInfo;
+ ITypeInfo *pOwnerTypeInfo;
+ int index;
+ VALUE name;
{
struct olemethoddata *pmethod;
Data_Get_Struct(self, struct olemethoddata, pmethod);
@@ -6486,7 +4511,8 @@ olemethod_set_member(VALUE self, ITypeInfo *pTypeInfo, ITypeInfo *pOwnerTypeInfo
}
static VALUE
-folemethod_s_allocate(VALUE klass)
+folemethod_s_allocate(klass)
+ VALUE klass;
{
struct olemethoddata *pmethod;
VALUE obj;
@@ -6513,7 +4539,10 @@ folemethod_s_allocate(VALUE klass)
* method = WIN32OLE_METHOD.new(tobj, 'SaveAs')
*/
static VALUE
-folemethod_initialize(VALUE self, VALUE oletype, VALUE method)
+folemethod_initialize(self, oletype, method)
+ VALUE self;
+ VALUE oletype;
+ VALUE method;
{
struct oletypedata *ptype;
VALUE obj = Qnil;
@@ -6522,7 +4551,7 @@ folemethod_initialize(VALUE self, VALUE oletype, VALUE method)
Data_Get_Struct(oletype, struct oletypedata, ptype);
obj = olemethod_from_typeinfo(self, ptype->pTypeInfo, method);
if (obj == Qnil) {
- rb_raise(eWIN32OLERuntimeError, "not found %s",
+ rb_raise(eWIN32OLE_RUNTIME_ERROR, "not found %s",
StringValuePtr(method));
}
}
@@ -6544,13 +4573,16 @@ folemethod_initialize(VALUE self, VALUE oletype, VALUE method)
*
*/
static VALUE
-folemethod_name(VALUE self)
+folemethod_name(self)
+ VALUE self;
{
return rb_ivar_get(self, rb_intern("name"));
}
static VALUE
-ole_method_return_type(ITypeInfo *pTypeInfo, UINT method_index)
+ole_method_return_type(pTypeInfo, method_index)
+ ITypeInfo *pTypeInfo;
+ UINT method_index;
{
FUNCDESC *pFuncDesc;
HRESULT hr;
@@ -6558,7 +4590,7 @@ ole_method_return_type(ITypeInfo *pTypeInfo, UINT method_index)
hr = pTypeInfo->lpVtbl->GetFuncDesc(pTypeInfo, method_index, &pFuncDesc);
if (FAILED(hr))
- ole_raise(hr, eWIN32OLERuntimeError, "failed to GetFuncDesc");
+ ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "failed to GetFuncDesc");
type = ole_typedesc2val(pTypeInfo, &(pFuncDesc->elemdescFunc.tdesc), Qnil);
pTypeInfo->lpVtbl->ReleaseFuncDesc(pTypeInfo, pFuncDesc);
@@ -6576,7 +4608,8 @@ ole_method_return_type(ITypeInfo *pTypeInfo, UINT method_index)
*
*/
static VALUE
-folemethod_return_type(VALUE self)
+folemethod_return_type(self)
+ VALUE self;
{
struct olemethoddata *pmethod;
Data_Get_Struct(self, struct olemethoddata, pmethod);
@@ -6584,19 +4617,21 @@ folemethod_return_type(VALUE self)
}
static VALUE
-ole_method_return_vtype(ITypeInfo *pTypeInfo, UINT method_index)
+ole_method_return_vtype(pTypeInfo, method_index)
+ ITypeInfo *pTypeInfo;
+ UINT method_index;
{
FUNCDESC *pFuncDesc;
HRESULT hr;
- VALUE vvt;
+ VALUE vt;
hr = pTypeInfo->lpVtbl->GetFuncDesc(pTypeInfo, method_index, &pFuncDesc);
if (FAILED(hr))
- ole_raise(hr, eWIN32OLERuntimeError, "failed to GetFuncDesc");
+ ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "failed to GetFuncDesc");
- vvt = INT2FIX(pFuncDesc->elemdescFunc.tdesc.vt);
+ vt = INT2FIX(pFuncDesc->elemdescFunc.tdesc.vt);
pTypeInfo->lpVtbl->ReleaseFuncDesc(pTypeInfo, pFuncDesc);
- return vvt;
+ return vt;
}
/*
@@ -6610,7 +4645,8 @@ ole_method_return_vtype(ITypeInfo *pTypeInfo, UINT method_index)
*
*/
static VALUE
-folemethod_return_vtype(VALUE self)
+folemethod_return_vtype(self)
+ VALUE self;
{
struct olemethoddata *pmethod;
Data_Get_Struct(self, struct olemethoddata, pmethod);
@@ -6618,7 +4654,9 @@ folemethod_return_vtype(VALUE self)
}
static VALUE
-ole_method_return_type_detail(ITypeInfo *pTypeInfo, UINT method_index)
+ole_method_return_type_detail(pTypeInfo, method_index)
+ ITypeInfo *pTypeInfo;
+ UINT method_index;
{
FUNCDESC *pFuncDesc;
HRESULT hr;
@@ -6644,7 +4682,8 @@ ole_method_return_type_detail(ITypeInfo *pTypeInfo, UINT method_index)
* p method.return_type_detail # => ["PTR", "USERDEFINED", "Workbook"]
*/
static VALUE
-folemethod_return_type_detail(VALUE self)
+folemethod_return_type_detail(self)
+ VALUE self;
{
struct olemethoddata *pmethod;
Data_Get_Struct(self, struct olemethoddata, pmethod);
@@ -6652,21 +4691,25 @@ folemethod_return_type_detail(VALUE self)
}
static VALUE
-ole_method_invkind(ITypeInfo *pTypeInfo, UINT method_index)
+ole_method_invkind(pTypeInfo, method_index)
+ ITypeInfo *pTypeInfo;
+ UINT method_index;
{
FUNCDESC *pFuncDesc;
HRESULT hr;
VALUE invkind;
hr = pTypeInfo->lpVtbl->GetFuncDesc(pTypeInfo, method_index, &pFuncDesc);
if(FAILED(hr))
- ole_raise(hr, eWIN32OLERuntimeError, "failed to GetFuncDesc");
+ ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "failed to GetFuncDesc");
invkind = INT2FIX(pFuncDesc->invkind);
pTypeInfo->lpVtbl->ReleaseFuncDesc(pTypeInfo, pFuncDesc);
return invkind;
}
static VALUE
-ole_method_invoke_kind(ITypeInfo *pTypeInfo, UINT method_index)
+ole_method_invoke_kind(pTypeInfo, method_index)
+ ITypeInfo *pTypeInfo;
+ WORD method_index;
{
VALUE type = rb_str_new2("UNKNOWN");
VALUE invkind = ole_method_invkind(pTypeInfo, method_index);
@@ -6696,7 +4739,8 @@ ole_method_invoke_kind(ITypeInfo *pTypeInfo, UINT method_index)
*
*/
static VALUE
-folemethod_invkind(VALUE self)
+folemethod_invkind(self)
+ VALUE self;
{
struct olemethoddata *pmethod;
Data_Get_Struct(self, struct olemethoddata, pmethod);
@@ -6715,7 +4759,8 @@ folemethod_invkind(VALUE self)
* puts method.invoke_kind # => "FUNC"
*/
static VALUE
-folemethod_invoke_kind(VALUE self)
+folemethod_invoke_kind(self)
+ VALUE self;
{
struct olemethoddata *pmethod;
Data_Get_Struct(self, struct olemethoddata, pmethod);
@@ -6723,7 +4768,9 @@ folemethod_invoke_kind(VALUE self)
}
static VALUE
-ole_method_visible(ITypeInfo *pTypeInfo, UINT method_index)
+ole_method_visible(pTypeInfo, method_index)
+ ITypeInfo *pTypeInfo;
+ UINT method_index;
{
FUNCDESC *pFuncDesc;
HRESULT hr;
@@ -6752,7 +4799,8 @@ ole_method_visible(ITypeInfo *pTypeInfo, UINT method_index)
* puts method.visible? # => true
*/
static VALUE
-folemethod_visible(VALUE self)
+folemethod_visible(self)
+ VALUE self;
{
struct olemethoddata *pmethod;
Data_Get_Struct(self, struct olemethoddata, pmethod);
@@ -6760,7 +4808,10 @@ folemethod_visible(VALUE self)
}
static VALUE
-ole_method_event(ITypeInfo *pTypeInfo, UINT method_index, VALUE method_name)
+ole_method_event(pTypeInfo, method_index, method_name)
+ ITypeInfo *pTypeInfo;
+ WORD method_index;
+ VALUE method_name;
{
TYPEATTR *pTypeAttr;
HRESULT hr;
@@ -6834,7 +4885,8 @@ ole_method_event(ITypeInfo *pTypeInfo, UINT method_index, VALUE method_name)
*
*/
static VALUE
-folemethod_event(VALUE self)
+folemethod_event(self)
+ VALUE self;
{
struct olemethoddata *pmethod;
Data_Get_Struct(self, struct olemethoddata, pmethod);
@@ -6855,7 +4907,8 @@ folemethod_event(VALUE self)
* puts method.event_interface # => WorkbookEvents
*/
static VALUE
-folemethod_event_interface(VALUE self)
+folemethod_event_interface(self)
+ VALUE self;
{
BSTR name;
struct olemethoddata *pmethod;
@@ -6870,14 +4923,14 @@ folemethod_event_interface(VALUE self)
}
static VALUE
-ole_method_docinfo_from_type(
- ITypeInfo *pTypeInfo,
- UINT method_index,
- BSTR *name,
- BSTR *helpstr,
- DWORD *helpcontext,
- BSTR *helpfile
- )
+ole_method_docinfo_from_type(pTypeInfo, method_index, name, helpstr,
+ helpcontext, helpfile)
+ ITypeInfo *pTypeInfo;
+ UINT method_index;
+ BSTR *name;
+ BSTR *helpstr;
+ DWORD *helpcontext;
+ BSTR *helpfile;
{
FUNCDESC *pFuncDesc;
HRESULT hr;
@@ -6892,7 +4945,9 @@ ole_method_docinfo_from_type(
}
static VALUE
-ole_method_helpstring(ITypeInfo *pTypeInfo, UINT method_index)
+ole_method_helpstring(pTypeInfo, method_index)
+ ITypeInfo *pTypeInfo;
+ UINT method_index;
{
HRESULT hr;
BSTR bhelpstring;
@@ -6915,7 +4970,8 @@ ole_method_helpstring(ITypeInfo *pTypeInfo, UINT method_index)
*
*/
static VALUE
-folemethod_helpstring(VALUE self)
+folemethod_helpstring(self)
+ VALUE self;
{
struct olemethoddata *pmethod;
Data_Get_Struct(self, struct olemethoddata, pmethod);
@@ -6923,7 +4979,9 @@ folemethod_helpstring(VALUE self)
}
static VALUE
-ole_method_helpfile(ITypeInfo *pTypeInfo, UINT method_index)
+ole_method_helpfile(pTypeInfo, method_index)
+ ITypeInfo *pTypeInfo;
+ UINT method_index;
{
HRESULT hr;
BSTR bhelpfile;
@@ -6945,7 +5003,8 @@ ole_method_helpfile(ITypeInfo *pTypeInfo, UINT method_index)
* puts method.helpfile # => C:\...\VBAXL9.CHM
*/
static VALUE
-folemethod_helpfile(VALUE self)
+folemethod_helpfile(self)
+ VALUE self;
{
struct olemethoddata *pmethod;
Data_Get_Struct(self, struct olemethoddata, pmethod);
@@ -6954,7 +5013,9 @@ folemethod_helpfile(VALUE self)
}
static VALUE
-ole_method_helpcontext(ITypeInfo *pTypeInfo, UINT method_index)
+ole_method_helpcontext(pTypeInfo, method_index)
+ ITypeInfo *pTypeInfo;
+ UINT method_index;
{
HRESULT hr;
DWORD helpcontext = 0;
@@ -6975,7 +5036,8 @@ ole_method_helpcontext(ITypeInfo *pTypeInfo, UINT method_index)
* puts method.helpcontext # => 65717
*/
static VALUE
-folemethod_helpcontext(VALUE self)
+folemethod_helpcontext(self)
+ VALUE self;
{
struct olemethoddata *pmethod;
Data_Get_Struct(self, struct olemethoddata, pmethod);
@@ -6983,7 +5045,9 @@ folemethod_helpcontext(VALUE self)
}
static VALUE
-ole_method_dispid(ITypeInfo *pTypeInfo, UINT method_index)
+ole_method_dispid(pTypeInfo, method_index)
+ ITypeInfo *pTypeInfo;
+ UINT method_index;
{
FUNCDESC *pFuncDesc;
HRESULT hr;
@@ -7006,7 +5070,8 @@ ole_method_dispid(ITypeInfo *pTypeInfo, UINT method_index)
* puts method.dispid # => 181
*/
static VALUE
-folemethod_dispid(VALUE self)
+folemethod_dispid(self)
+ VALUE self;
{
struct olemethoddata *pmethod;
Data_Get_Struct(self, struct olemethoddata, pmethod);
@@ -7014,7 +5079,9 @@ folemethod_dispid(VALUE self)
}
static VALUE
-ole_method_offset_vtbl(ITypeInfo *pTypeInfo, UINT method_index)
+ole_method_offset_vtbl(pTypeInfo, method_index)
+ ITypeInfo *pTypeInfo;
+ UINT method_index;
{
FUNCDESC *pFuncDesc;
HRESULT hr;
@@ -7037,7 +5104,8 @@ ole_method_offset_vtbl(ITypeInfo *pTypeInfo, UINT method_index)
* puts method.offset_vtbl # => 40
*/
static VALUE
-folemethod_offset_vtbl(VALUE self)
+folemethod_offset_vtbl(self)
+ VALUE self;
{
struct olemethoddata *pmethod;
Data_Get_Struct(self, struct olemethoddata, pmethod);
@@ -7045,7 +5113,9 @@ folemethod_offset_vtbl(VALUE self)
}
static VALUE
-ole_method_size_params(ITypeInfo *pTypeInfo, UINT method_index)
+ole_method_size_params(pTypeInfo, method_index)
+ ITypeInfo *pTypeInfo;
+ UINT method_index;
{
FUNCDESC *pFuncDesc;
HRESULT hr;
@@ -7069,7 +5139,8 @@ ole_method_size_params(ITypeInfo *pTypeInfo, UINT method_index)
*
*/
static VALUE
-folemethod_size_params(VALUE self)
+folemethod_size_params(self)
+ VALUE self;
{
struct olemethoddata *pmethod;
Data_Get_Struct(self, struct olemethoddata, pmethod);
@@ -7077,7 +5148,9 @@ folemethod_size_params(VALUE self)
}
static VALUE
-ole_method_size_opt_params(ITypeInfo *pTypeInfo, UINT method_index)
+ole_method_size_opt_params(pTypeInfo, method_index)
+ ITypeInfo *pTypeInfo;
+ UINT method_index;
{
FUNCDESC *pFuncDesc;
HRESULT hr;
@@ -7100,7 +5173,8 @@ ole_method_size_opt_params(ITypeInfo *pTypeInfo, UINT method_index)
* puts method.size_opt_params # => 4
*/
static VALUE
-folemethod_size_opt_params(VALUE self)
+folemethod_size_opt_params(self)
+ VALUE self;
{
struct olemethoddata *pmethod;
Data_Get_Struct(self, struct olemethoddata, pmethod);
@@ -7108,7 +5182,9 @@ folemethod_size_opt_params(VALUE self)
}
static VALUE
-ole_method_params(ITypeInfo *pTypeInfo, UINT method_index)
+ole_method_params(pTypeInfo, method_index)
+ ITypeInfo *pTypeInfo;
+ UINT method_index;
{
FUNCDESC *pFuncDesc;
HRESULT hr;
@@ -7147,7 +5223,6 @@ ole_method_params(ITypeInfo *pTypeInfo, UINT method_index)
return params;
}
-
/*
* call-seq:
* WIN32OLE_METHOD#params
@@ -7161,7 +5236,8 @@ ole_method_params(ITypeInfo *pTypeInfo, UINT method_index)
* TextVisualLayout]
*/
static VALUE
-folemethod_params(VALUE self)
+folemethod_params(self)
+ VALUE self;
{
struct olemethoddata *pmethod;
Data_Get_Struct(self, struct olemethoddata, pmethod);
@@ -7169,19 +5245,6 @@ folemethod_params(VALUE self)
}
/*
- * call-seq:
- * WIN32OLE_METHOD#inspect -> String
- *
- * Returns the method name with class name.
- *
- */
-static VALUE
-folemethod_inspect(VALUE self)
-{
- return default_inspect(self, "WIN32OLE_METHOD");
-}
-
-/*
* Document-class: WIN32OLE_PARAM
*
* <code>WIN32OLE_PARAM</code> objects represent param information of
@@ -7199,17 +5262,21 @@ folemethod_inspect(VALUE self)
* puts param1.name # => Filename
*/
static VALUE
-foleparam_name(VALUE self)
+foleparam_name(self)
+ VALUE self;
{
return rb_ivar_get(self, rb_intern("name"));
}
static VALUE
-ole_param_ole_type(ITypeInfo *pTypeInfo, UINT method_index, UINT index)
+ole_param_ole_type(pTypeInfo, method_index, index)
+ ITypeInfo *pTypeInfo;
+ UINT method_index;
+ UINT index;
{
FUNCDESC *pFuncDesc;
HRESULT hr;
- VALUE type = rb_str_new2("unknown type");
+ VALUE type = rb_str_new2("UNKNOWN");
hr = pTypeInfo->lpVtbl->GetFuncDesc(pTypeInfo, method_index, &pFuncDesc);
if (FAILED(hr))
return type;
@@ -7230,7 +5297,8 @@ ole_param_ole_type(ITypeInfo *pTypeInfo, UINT method_index, UINT index)
* puts param1.ole_type # => VARIANT
*/
static VALUE
-foleparam_ole_type(VALUE self)
+foleparam_ole_type(self)
+ VALUE self;
{
struct oleparamdata *pparam;
Data_Get_Struct(self, struct oleparamdata, pparam);
@@ -7239,7 +5307,10 @@ foleparam_ole_type(VALUE self)
}
static VALUE
-ole_param_ole_type_detail(ITypeInfo *pTypeInfo, UINT method_index, UINT index)
+ole_param_ole_type_detail(pTypeInfo, method_index, index)
+ ITypeInfo *pTypeInfo;
+ UINT method_index;
+ UINT index;
{
FUNCDESC *pFuncDesc;
HRESULT hr;
@@ -7264,7 +5335,8 @@ ole_param_ole_type_detail(ITypeInfo *pTypeInfo, UINT method_index, UINT index)
* p param1.ole_type_detail # => ["PTR", "USERDEFINED", "Range"]
*/
static VALUE
-foleparam_ole_type_detail(VALUE self)
+foleparam_ole_type_detail(self)
+ VALUE self;
{
struct oleparamdata *pparam;
Data_Get_Struct(self, struct oleparamdata, pparam);
@@ -7273,7 +5345,11 @@ foleparam_ole_type_detail(VALUE self)
}
static VALUE
-ole_param_flag_mask(ITypeInfo *pTypeInfo, UINT method_index, UINT index, USHORT mask)
+ole_param_flag_mask(pTypeInfo, method_index, index, mask)
+ ITypeInfo *pTypeInfo;
+ UINT method_index;
+ UINT index;
+ USHORT mask;
{
FUNCDESC *pFuncDesc;
HRESULT hr;
@@ -7297,7 +5373,8 @@ ole_param_flag_mask(ITypeInfo *pTypeInfo, UINT method_index, UINT index, USHORT
* param1 = method.params[0]
* puts param1.input? # => true
*/
-static VALUE foleparam_input(VALUE self)
+static VALUE foleparam_input(self)
+ VALUE self;
{
struct oleparamdata *pparam;
Data_Get_Struct(self, struct oleparamdata, pparam);
@@ -7324,7 +5401,8 @@ static VALUE foleparam_input(VALUE self)
* Headers false
* Processed true
*/
-static VALUE foleparam_output(VALUE self)
+static VALUE foleparam_output(self)
+ VALUE self;
{
struct oleparamdata *pparam;
Data_Get_Struct(self, struct oleparamdata, pparam);
@@ -7342,7 +5420,8 @@ static VALUE foleparam_output(VALUE self)
* param1 = method.params[0]
* puts "#{param1.name} #{param1.optional?}" # => Filename true
*/
-static VALUE foleparam_optional(VALUE self)
+static VALUE foleparam_optional(self)
+ VALUE self;
{
struct oleparamdata *pparam;
Data_Get_Struct(self, struct oleparamdata, pparam);
@@ -7361,7 +5440,8 @@ static VALUE foleparam_optional(VALUE self)
* param = method.params[0]
* puts "#{param.name} #{param.retval?}" # => name true
*/
-static VALUE foleparam_retval(VALUE self)
+static VALUE foleparam_retval(self)
+ VALUE self;
{
struct oleparamdata *pparam;
Data_Get_Struct(self, struct oleparamdata, pparam);
@@ -7370,7 +5450,10 @@ static VALUE foleparam_retval(VALUE self)
}
static VALUE
-ole_param_default(ITypeInfo *pTypeInfo, UINT method_index, UINT index)
+ole_param_default(pTypeInfo, method_index, index)
+ ITypeInfo *pTypeInfo;
+ UINT method_index;
+ UINT index;
{
FUNCDESC *pFuncDesc;
ELEMDESC *pElemDesc;
@@ -7421,7 +5504,8 @@ ole_param_default(ITypeInfo *pTypeInfo, UINT method_index, UINT index)
* TextCodepage
* TextVisualLayout
*/
-static VALUE foleparam_default(VALUE self)
+static VALUE foleparam_default(self)
+ VALUE self;
{
struct oleparamdata *pparam;
Data_Get_Struct(self, struct oleparamdata, pparam);
@@ -7429,26 +5513,7 @@ static VALUE foleparam_default(VALUE self)
pparam->index);
}
-/*
- * call-seq:
- * WIN32OLE_PARAM#inspect -> String
- *
- * Returns the parameter name with class name. If the parameter has default value,
- * then returns name=value string with class name.
- *
- */
-static VALUE
-foleparam_inspect(VALUE self)
-{
- VALUE detail = foleparam_name(self);
- VALUE defval = foleparam_default(self);
- if (defval != Qnil) {
- rb_str_cat2(detail, "=");
- rb_str_concat(detail, rb_funcall(defval, rb_intern("inspect"), 0));
- }
- return make_inspect("WIN32OLE_PARAM", detail);
-}
-
+
/*
* Document-class: WIN32OLE_EVENT
*
@@ -7517,24 +5582,20 @@ STDMETHODIMP EVENTSINK_GetTypeInfo(
}
STDMETHODIMP EVENTSINK_GetIDsOfNames(
- PEVENTSINK pEventSink,
+ PEVENTSINK pEV,
REFIID riid,
OLECHAR **szNames,
UINT cNames,
LCID lcid,
DISPID *pDispID
) {
- ITypeInfo *pTypeInfo;
- PIEVENTSINKOBJ pEV = (PIEVENTSINKOBJ)pEventSink;
- pTypeInfo = pEV->pTypeInfo;
- if (pTypeInfo) {
- return pTypeInfo->lpVtbl->GetIDsOfNames(pTypeInfo, szNames, cNames, pDispID);
- }
return DISP_E_UNKNOWNNAME;
}
static long
-ole_search_event_at(VALUE ary, VALUE ev)
+ole_search_event_at(ary, ev)
+ VALUE ary;
+ VALUE ev;
{
VALUE event;
VALUE def_event;
@@ -7542,7 +5603,7 @@ ole_search_event_at(VALUE ary, VALUE ev)
long i, len;
long ret = -1;
def_event = Qnil;
- len = RARRAY_LEN(ary);
+ len = RARRAY(ary)->len;
for(i = 0; i < len; i++) {
event = rb_ary_entry(ary, i);
event_name = rb_ary_entry(event, 1);
@@ -7561,15 +5622,18 @@ ole_search_event_at(VALUE ary, VALUE ev)
}
static VALUE
-ole_search_event(VALUE ary, VALUE ev, BOOL *is_default)
+ole_search_event(ary, ev, is_default)
+ VALUE ary;
+ VALUE ev;
+ BOOL *is_default;
{
VALUE event;
VALUE def_event;
VALUE event_name;
- int i, len;
+ long i, len;
*is_default = FALSE;
def_event = Qnil;
- len = RARRAY_LEN(ary);
+ len = RARRAY(ary)->len;
for(i = 0; i < len; i++) {
event = rb_ary_entry(ary, i);
event_name = rb_ary_entry(event, 1);
@@ -7584,114 +5648,92 @@ ole_search_event(VALUE ary, VALUE ev, BOOL *is_default)
}
return def_event;
}
-static VALUE
-ole_search_handler_method(VALUE handler, VALUE ev, BOOL *is_default_handler)
-{
- VALUE mid;
-
- *is_default_handler = FALSE;
- mid = rb_to_id(rb_sprintf("on%s", StringValuePtr(ev)));
- if (rb_respond_to(handler, mid)) {
- return mid;
- }
- mid = rb_intern("method_missing");
- if (rb_respond_to(handler, mid)) {
- *is_default_handler = TRUE;
- return mid;
- }
- return Qnil;
-}
static void
-ole_delete_event(VALUE ary, VALUE ev)
-{
- long at = -1;
- at = ole_search_event_at(ary, ev);
- if (at >= 0) {
- rb_ary_delete_at(ary, at);
- }
-}
-
-static void
-hash2ptr_dispparams(VALUE hash, ITypeInfo *pTypeInfo, DISPID dispid, DISPPARAMS *pdispparams)
-{
- BSTR *bstrs;
- HRESULT hr;
- UINT len, i;
- VARIANT *pvar;
+val2ptr_variant(val, var)
VALUE val;
- VALUE key;
- len = 0;
- bstrs = ALLOCA_N(BSTR, pdispparams->cArgs + 1);
- hr = pTypeInfo->lpVtbl->GetNames(pTypeInfo, dispid,
- bstrs, pdispparams->cArgs + 1,
- &len);
- if (FAILED(hr))
- return;
-
- for (i = 0; i < len - 1; i++) {
- key = WC2VSTR(bstrs[i + 1]);
- val = rb_hash_aref(hash, INT2FIX(i));
- if (val == Qnil)
- val = rb_hash_aref(hash, key);
- if (val == Qnil)
- val = rb_hash_aref(hash, rb_str_intern(key));
- pvar = &pdispparams->rgvarg[pdispparams->cArgs-i-1];
- ole_val2ptr_variant(val, pvar);
- }
-}
-
-static VALUE
-hash2result(VALUE hash)
+ VARIANT *var;
{
- VALUE ret = Qnil;
- ret = rb_hash_aref(hash, rb_str_new2("return"));
- if (ret == Qnil)
- ret = rb_hash_aref(hash, rb_str_intern(rb_str_new2("return")));
- return ret;
+ switch (TYPE(val)) {
+ case T_STRING:
+ if (V_VT(var) == (VT_BSTR | VT_BYREF)) {
+ *V_BSTRREF(var) = ole_mb2wc(StringValuePtr(val), -1);
+ }
+ break;
+ case T_FIXNUM:
+ switch(V_VT(var)) {
+ case (VT_UI1 | VT_BYREF) :
+ *V_UI1REF(var) = NUM2CHR(val);
+ break;
+ case (VT_I2 | VT_BYREF) :
+ *V_I2REF(var) = (short)NUM2INT(val);
+ break;
+ case (VT_I4 | VT_BYREF) :
+ *V_I4REF(var) = NUM2INT(val);
+ break;
+ case (VT_R4 | VT_BYREF) :
+ *V_R4REF(var) = (float)NUM2INT(val);
+ break;
+ case (VT_R8 | VT_BYREF) :
+ *V_R8REF(var) = NUM2INT(val);
+ break;
+ default:
+ break;
+ }
+ break;
+ case T_FLOAT:
+ switch(V_VT(var)) {
+ case (VT_I2 | VT_BYREF) :
+ *V_I2REF(var) = (short)NUM2INT(val);
+ break;
+ case (VT_I4 | VT_BYREF) :
+ *V_I4REF(var) = NUM2INT(val);
+ break;
+ case (VT_R4 | VT_BYREF) :
+ *V_R4REF(var) = (float)NUM2DBL(val);
+ break;
+ case (VT_R8 | VT_BYREF) :
+ *V_R8REF(var) = NUM2DBL(val);
+ break;
+ default:
+ break;
+ }
+ break;
+ case T_BIGNUM:
+ if (V_VT(var) == (VT_R8 | VT_BYREF)) {
+ *V_R8REF(var) = rb_big2dbl(val);
+ }
+ break;
+ case T_TRUE:
+ if (V_VT(var) == (VT_BOOL | VT_BYREF)) {
+ *V_BOOLREF(var) = VARIANT_TRUE;
+ }
+ break;
+ case T_FALSE:
+ if (V_VT(var) == (VT_BOOL | VT_BYREF)) {
+ *V_BOOLREF(var) = VARIANT_FALSE;
+ }
+ break;
+ default:
+ break;
+ }
}
static void
-ary2ptr_dispparams(VALUE ary, DISPPARAMS *pdispparams)
+ary2ptr_dispparams(ary, pdispparams)
+ VALUE ary;
+ DISPPARAMS *pdispparams;
{
int i;
VALUE v;
VARIANT *pvar;
- for(i = 0; i < RARRAY_LEN(ary) && (unsigned int) i < pdispparams->cArgs; i++) {
+ for(i = 0; i < RARRAY(ary)->len && (unsigned int) i < pdispparams->cArgs; i++) {
v = rb_ary_entry(ary, i);
pvar = &pdispparams->rgvarg[pdispparams->cArgs-i-1];
- ole_val2ptr_variant(v, pvar);
+ val2ptr_variant(v, pvar);
}
}
-static VALUE
-exec_callback(VALUE arg)
-{
- VALUE *parg = (VALUE *)arg;
- VALUE handler = parg[0];
- VALUE mid = parg[1];
- VALUE args = parg[2];
- return rb_apply(handler, mid, args);
-}
-
-static VALUE
-rescue_callback(VALUE arg)
-{
-
- VALUE error;
- VALUE e = rb_errinfo();
- VALUE bt = rb_funcall(e, rb_intern("backtrace"), 0);
- VALUE msg = rb_funcall(e, rb_intern("message"), 0);
- bt = rb_ary_entry(bt, 0);
- error = rb_sprintf("%s: %s (%s)\n", StringValuePtr(bt), StringValuePtr(msg), rb_obj_classname(e));
- rb_write_error(StringValuePtr(error));
- rb_backtrace();
- ruby_finalize();
- exit(-1);
-
- return Qnil;
-}
-
STDMETHODIMP EVENTSINK_Invoke(
PEVENTSINK pEventSink,
DISPID dispid,
@@ -7710,17 +5752,13 @@ STDMETHODIMP EVENTSINK_Invoke(
unsigned int i;
ITypeInfo *pTypeInfo;
VARIANT *pvar;
- VALUE ary, obj, event, args, outargv, ev, result;
- VALUE handler = Qnil;
- VALUE arg[3];
- VALUE mid;
- VALUE is_outarg = Qfalse;
+ VALUE ary, obj, event, handler, args, argv, ev, result;
BOOL is_default_handler = FALSE;
- int state;
PIEVENTSINKOBJ pEV = (PIEVENTSINKOBJ)pEventSink;
pTypeInfo = pEV->pTypeInfo;
- obj = evs_entry(pEV->m_event_id);
+
+ obj = rb_ary_entry(ary_ole_event, pEV->m_event_id);
if (!rb_obj_is_kind_of(obj, cWIN32OLE_EVENT)) {
return NOERROR;
}
@@ -7736,21 +5774,9 @@ STDMETHODIMP EVENTSINK_Invoke(
}
ev = WC2VSTR(bstr);
event = ole_search_event(ary, ev, &is_default_handler);
- if (TYPE(event) == T_ARRAY) {
- handler = rb_ary_entry(event, 0);
- mid = rb_intern("call");
- is_outarg = rb_ary_entry(event, 3);
- } else {
- handler = rb_ivar_get(obj, rb_intern("handler"));
- if (handler == Qnil) {
- return NOERROR;
- }
- mid = ole_search_handler_method(handler, ev, &is_default_handler);
- }
- if (handler == Qnil || mid == Qnil) {
- return NOERROR;
+ if (NIL_P(event)) {
+ return NOERROR;
}
-
args = rb_ary_new();
if (is_default_handler) {
rb_ary_push(args, ev);
@@ -7761,31 +5787,16 @@ STDMETHODIMP EVENTSINK_Invoke(
pvar = &pdispparams->rgvarg[pdispparams->cArgs-i-1];
rb_ary_push(args, ole_variant2val(pvar));
}
- outargv = Qnil;
- if (is_outarg == Qtrue) {
- outargv = rb_ary_new();
- rb_ary_push(args, outargv);
- }
+ handler = rb_ary_entry(event, 0);
- /*
- * if exception raised in event callback,
- * then you receive cfp consistency error.
- * to avoid this error we use begin rescue end.
- * and the exception raised then error message print
- * and exit ruby process by Win32OLE itself.
- */
- arg[0] = handler;
- arg[1] = mid;
- arg[2] = args;
- result = rb_protect(exec_callback, (VALUE)arg, &state);
- if (state != 0) {
- rescue_callback(Qnil);
+ if (rb_ary_entry(event, 3) == Qtrue) {
+ argv = rb_ary_new();
+ rb_ary_push(args, argv);
+ result = rb_apply(handler, rb_intern("call"), args);
+ ary2ptr_dispparams(argv, pdispparams);
}
- if(TYPE(result) == T_HASH) {
- hash2ptr_dispparams(result, pTypeInfo, dispid, pdispparams);
- result = hash2result(result);
- }else if (is_outarg == Qtrue && TYPE(outargv) == T_ARRAY) {
- ary2ptr_dispparams(outargv, pdispparams);
+ else {
+ result = rb_apply(handler, rb_intern("call"), args);
}
if (pvarResult) {
@@ -7814,7 +5825,10 @@ EVENTSINK_Constructor() {
pEv->lpVtbl = &vtEventSink;
pEv->m_cRef = 0;
pEv->m_event_id = 0;
+ pEv->m_dwCookie = 0;
+ pEv->pConnectionPoint = NULL;
pEv->pTypeInfo = NULL;
+ pEv->ptr_freed = NULL;
return pEv;
}
@@ -7822,14 +5836,17 @@ void EVENTSINK_Destructor(
PIEVENTSINKOBJ pEVObj
) {
if(pEVObj != NULL) {
- OLE_RELEASE(pEVObj->pTypeInfo);
+ *(pEVObj->ptr_freed) = 1;
free(pEVObj);
- pEVObj = NULL;
}
}
static HRESULT
-find_iid(VALUE ole, char *pitf, IID *piid, ITypeInfo **ppTypeInfo)
+find_iid(ole, pitf, piid, ppTypeInfo)
+ VALUE ole;
+ char *pitf;
+ IID *piid;
+ ITypeInfo **ppTypeInfo;
{
HRESULT hr;
IDispatch *pDispatch;
@@ -7848,7 +5865,7 @@ find_iid(VALUE ole, char *pitf, IID *piid, ITypeInfo **ppTypeInfo)
char *pstr;
BOOL is_found = FALSE;
- LCID lcid = cWIN32OLE_lcid;
+ LCID lcid = LOCALE_SYSTEM_DEFAULT;
OLEData_Get_Struct(ole, pole);
@@ -7939,130 +5956,22 @@ find_iid(VALUE ole, char *pitf, IID *piid, ITypeInfo **ppTypeInfo)
return hr;
}
-static HRESULT
-find_coclass(
- ITypeInfo *pTypeInfo,
- TYPEATTR *pTypeAttr,
- ITypeInfo **pCOTypeInfo,
- TYPEATTR **pCOTypeAttr)
-{
- HRESULT hr = E_NOINTERFACE;
- ITypeLib *pTypeLib;
- int count;
- BOOL found = FALSE;
- ITypeInfo *pTypeInfo2;
- TYPEATTR *pTypeAttr2;
- int flags;
- int i,j;
- HREFTYPE href;
- ITypeInfo *pRefTypeInfo;
- TYPEATTR *pRefTypeAttr;
-
- hr = pTypeInfo->lpVtbl->GetContainingTypeLib(pTypeInfo, &pTypeLib, NULL);
- if (FAILED(hr)) {
- return hr;
- }
- count = pTypeLib->lpVtbl->GetTypeInfoCount(pTypeLib);
- for (i = 0; i < count && !found; i++) {
- hr = pTypeLib->lpVtbl->GetTypeInfo(pTypeLib, i, &pTypeInfo2);
- if (FAILED(hr))
- continue;
- hr = OLE_GET_TYPEATTR(pTypeInfo2, &pTypeAttr2);
- if (FAILED(hr)) {
- OLE_RELEASE(pTypeInfo2);
- continue;
- }
- if (pTypeAttr2->typekind != TKIND_COCLASS) {
- OLE_RELEASE_TYPEATTR(pTypeInfo2, pTypeAttr2);
- OLE_RELEASE(pTypeInfo2);
- continue;
- }
- for (j = 0; j < pTypeAttr2->cImplTypes && !found; j++) {
- hr = pTypeInfo2->lpVtbl->GetImplTypeFlags(pTypeInfo2, j, &flags);
- if (FAILED(hr))
- continue;
- if (!(flags & IMPLTYPEFLAG_FDEFAULT))
- continue;
- hr = pTypeInfo2->lpVtbl->GetRefTypeOfImplType(pTypeInfo2, j, &href);
- if (FAILED(hr))
- continue;
- hr = pTypeInfo2->lpVtbl->GetRefTypeInfo(pTypeInfo2, href, &pRefTypeInfo);
- if (FAILED(hr))
- continue;
- hr = OLE_GET_TYPEATTR(pRefTypeInfo, &pRefTypeAttr);
- if (FAILED(hr)) {
- OLE_RELEASE(pRefTypeInfo);
- continue;
- }
- if (IsEqualGUID(&(pTypeAttr->guid), &(pRefTypeAttr->guid))) {
- found = TRUE;
- }
- }
- if (!found) {
- OLE_RELEASE_TYPEATTR(pTypeInfo2, pTypeAttr2);
- OLE_RELEASE(pTypeInfo2);
- }
- }
- OLE_RELEASE(pTypeLib);
- if (found) {
- *pCOTypeInfo = pTypeInfo2;
- *pCOTypeAttr = pTypeAttr2;
- hr = S_OK;
- } else {
- hr = E_NOINTERFACE;
- }
- return hr;
-}
-
-static HRESULT
-find_default_source_from_typeinfo(
- ITypeInfo *pTypeInfo,
- TYPEATTR *pTypeAttr,
- ITypeInfo **ppTypeInfo)
-{
- int i = 0;
- HRESULT hr = E_NOINTERFACE;
- int flags;
- HREFTYPE hRefType;
- /* Enumerate all implemented types of the COCLASS */
- for (i = 0; i < pTypeAttr->cImplTypes; i++) {
- hr = pTypeInfo->lpVtbl->GetImplTypeFlags(pTypeInfo, i, &flags);
- if (FAILED(hr))
- continue;
-
- /*
- looking for the [default] [source]
- we just hope that it is a dispinterface :-)
- */
- if ((flags & IMPLTYPEFLAG_FDEFAULT) &&
- (flags & IMPLTYPEFLAG_FSOURCE)) {
-
- hr = pTypeInfo->lpVtbl->GetRefTypeOfImplType(pTypeInfo,
- i, &hRefType);
- if (FAILED(hr))
- continue;
- hr = pTypeInfo->lpVtbl->GetRefTypeInfo(pTypeInfo,
- hRefType, ppTypeInfo);
- if (SUCCEEDED(hr))
- break;
- }
- }
- return hr;
-}
-
static HRESULT
-find_default_source(VALUE ole, IID *piid, ITypeInfo **ppTypeInfo)
+find_default_source(ole, piid, ppTypeInfo)
+ VALUE ole;
+ IID *piid;
+ ITypeInfo **ppTypeInfo;
{
HRESULT hr;
IProvideClassInfo2 *pProvideClassInfo2;
IProvideClassInfo *pProvideClassInfo;
- void *p;
IDispatch *pDispatch;
ITypeInfo *pTypeInfo;
- ITypeInfo *pTypeInfo2 = NULL;
TYPEATTR *pTypeAttr;
- TYPEATTR *pTypeAttr2 = NULL;
+ int i;
+ int iFlags;
+ HREFTYPE hRefType;
struct oledata *pole;
@@ -8070,52 +5979,58 @@ find_default_source(VALUE ole, IID *piid, ITypeInfo **ppTypeInfo)
pDispatch = pole->pDispatch;
hr = pDispatch->lpVtbl->QueryInterface(pDispatch,
&IID_IProvideClassInfo2,
- &p);
+ (void**)&pProvideClassInfo2);
if (SUCCEEDED(hr)) {
- pProvideClassInfo2 = p;
hr = pProvideClassInfo2->lpVtbl->GetGUID(pProvideClassInfo2,
GUIDKIND_DEFAULT_SOURCE_DISP_IID,
piid);
OLE_RELEASE(pProvideClassInfo2);
- if (SUCCEEDED(hr)) {
- hr = find_iid(ole, NULL, piid, ppTypeInfo);
- }
- }
- if (SUCCEEDED(hr)) {
- return hr;
+ return find_iid(ole, NULL, piid, ppTypeInfo);
}
hr = pDispatch->lpVtbl->QueryInterface(pDispatch,
&IID_IProvideClassInfo,
- &p);
- if (SUCCEEDED(hr)) {
- pProvideClassInfo = p;
- hr = pProvideClassInfo->lpVtbl->GetClassInfo(pProvideClassInfo,
- &pTypeInfo);
- OLE_RELEASE(pProvideClassInfo);
- }
- if (FAILED(hr)) {
- hr = pDispatch->lpVtbl->GetTypeInfo(pDispatch, 0, cWIN32OLE_lcid, &pTypeInfo );
- }
+ (void**)&pProvideClassInfo);
if (FAILED(hr))
return hr;
+
+ hr = pProvideClassInfo->lpVtbl->GetClassInfo(pProvideClassInfo,
+ &pTypeInfo);
+ OLE_RELEASE(pProvideClassInfo);
+ if (FAILED(hr))
+ return hr;
+
hr = OLE_GET_TYPEATTR(pTypeInfo, &pTypeAttr);
if (FAILED(hr)) {
OLE_RELEASE(pTypeInfo);
return hr;
}
+ /* Enumerate all implemented types of the COCLASS */
+ for (i = 0; i < pTypeAttr->cImplTypes; i++) {
+ hr = pTypeInfo->lpVtbl->GetImplTypeFlags(pTypeInfo, i, &iFlags);
+ if (FAILED(hr))
+ continue;
- *ppTypeInfo = 0;
- hr = find_default_source_from_typeinfo(pTypeInfo, pTypeAttr, ppTypeInfo);
- if (!*ppTypeInfo) {
- hr = find_coclass(pTypeInfo, pTypeAttr, &pTypeInfo2, &pTypeAttr2);
- if (SUCCEEDED(hr)) {
- hr = find_default_source_from_typeinfo(pTypeInfo2, pTypeAttr2, ppTypeInfo);
- OLE_RELEASE_TYPEATTR(pTypeInfo2, pTypeAttr2);
- OLE_RELEASE(pTypeInfo2);
- }
+ /*
+ looking for the [default] [source]
+ we just hope that it is a dispinterface :-)
+ */
+ if ((iFlags & IMPLTYPEFLAG_FDEFAULT) &&
+ (iFlags & IMPLTYPEFLAG_FSOURCE)) {
+
+ hr = pTypeInfo->lpVtbl->GetRefTypeOfImplType(pTypeInfo,
+ i, &hRefType);
+ if (FAILED(hr))
+ continue;
+ hr = pTypeInfo->lpVtbl->GetRefTypeInfo(pTypeInfo,
+ hRefType, ppTypeInfo);
+ if (SUCCEEDED(hr))
+ break;
+ }
}
+
OLE_RELEASE_TYPEATTR(pTypeInfo, pTypeAttr);
OLE_RELEASE(pTypeInfo);
+
/* Now that would be a bad surprise, if we didn't find it, wouldn't it? */
if (!*ppTypeInfo) {
if (SUCCEEDED(hr))
@@ -8137,45 +6052,72 @@ find_default_source(VALUE ole, IID *piid, ITypeInfo **ppTypeInfo)
}
static void
-ole_event_free(struct oleeventdata *poleev)
+ole_event_free(poleev)
+ struct oleeventdata *poleev;
{
- if (poleev->pConnectionPoint) {
- poleev->pConnectionPoint->lpVtbl->Unadvise(poleev->pConnectionPoint, poleev->dwCookie);
- OLE_RELEASE(poleev->pConnectionPoint);
- poleev->pConnectionPoint = NULL;
+ ITypeInfo *pti = NULL;
+ IConnectionPoint *pcp = NULL;
+
+ if (poleev->freed == 1) {
+ /*
+ * this return create memory leak.
+ * but poleev->pEvent->pConnectionPoint shoul'd not be freed
+ * until poleev-> freed == 0.
+ */
+ return;
+ }
+ if(poleev->pEvent) {
+ pti = poleev->pEvent->pTypeInfo;
+ if(pti) OLE_RELEASE(pti);
+ pcp = poleev->pEvent->pConnectionPoint;
+ if(pcp) {
+ pcp->lpVtbl->Unadvise(pcp, poleev->pEvent->m_dwCookie);
+ OLE_RELEASE(pcp);
+ }
+ free(poleev);
}
- free(poleev);
}
+static VALUE fev_s_allocate _((VALUE));
static VALUE
-fev_s_allocate(VALUE klass)
+fev_s_allocate(klass)
+ VALUE klass;
{
VALUE obj;
struct oleeventdata *poleev;
obj = Data_Make_Struct(klass,struct oleeventdata,0,ole_event_free,poleev);
- poleev->dwCookie = 0;
- poleev->pConnectionPoint = NULL;
- poleev->event_id = 0;
+ poleev->pEvent = NULL;
return obj;
}
+/*
+ * call-seq:
+ * WIN32OLE_EVENT.new(ole, event) #=> WIN32OLE_EVENT object.
+ *
+ * Returns OLE event object.
+ * The first argument specifies WIN32OLE object.
+ * The second argument specifies OLE event name.
+ * ie = WIN32OLE.new('InternetExplorer.Application')
+ * ev = WIN32OLE_EVENT.new(ie, 'DWebBrowserEvents')
+ */
static VALUE
-ev_advise(int argc, VALUE *argv, VALUE self)
+fev_initialize(argc, argv, self)
+ int argc;
+ VALUE *argv;
+ VALUE self;
{
-
VALUE ole, itf;
struct oledata *pole;
char *pitf;
HRESULT hr;
IID iid;
- ITypeInfo *pTypeInfo = 0;
+ ITypeInfo *pTypeInfo;
IDispatch *pDispatch;
IConnectionPointContainer *pContainer;
IConnectionPoint *pConnectionPoint;
IEVENTSINKOBJ *pIEV;
- DWORD dwCookie;
+ DWORD dwCookie = 0;
struct oleeventdata *poleev;
- void *p;
rb_secure(4);
rb_scan_args(argc, argv, "11", &ole, &itf);
@@ -8185,7 +6127,7 @@ ev_advise(int argc, VALUE *argv, VALUE self)
}
if(TYPE(itf) != T_NIL) {
- if (rb_safe_level() > 0 && OBJ_TAINTED(itf)) {
+ if (ruby_safe_level > 0 && OBJ_TAINTED(itf)) {
rb_raise(rb_eSecurityError, "Insecure Event Creation - %s",
StringValuePtr(itf));
}
@@ -8204,13 +6146,12 @@ ev_advise(int argc, VALUE *argv, VALUE self)
pDispatch = pole->pDispatch;
hr = pDispatch->lpVtbl->QueryInterface(pDispatch,
&IID_IConnectionPointContainer,
- &p);
+ (void**)&pContainer);
if (FAILED(hr)) {
OLE_RELEASE(pTypeInfo);
ole_raise(hr, rb_eRuntimeError,
"failed to query IConnectionPointContainer");
}
- pContainer = p;
hr = pContainer->lpVtbl->FindConnectionPoint(pContainer,
&iid,
@@ -8230,33 +6171,15 @@ ev_advise(int argc, VALUE *argv, VALUE self)
}
Data_Get_Struct(self, struct oleeventdata, poleev);
- pIEV->m_event_id
- = NUM2INT(evs_length());
- pIEV->pTypeInfo = pTypeInfo;
- poleev->dwCookie = dwCookie;
- poleev->pConnectionPoint = pConnectionPoint;
- poleev->event_id = pIEV->m_event_id;
-
- return self;
-}
-
-/*
- * call-seq:
- * WIN32OLE_EVENT.new(ole, event) #=> WIN32OLE_EVENT object.
- *
- * Returns OLE event object.
- * The first argument specifies WIN32OLE object.
- * The second argument specifies OLE event name.
- * ie = WIN32OLE.new('InternetExplorer.Application')
- * ev = WIN32OLE_EVENT.new(ie, 'DWebBrowserEvents')
- */
-static VALUE
-fev_initialize(int argc, VALUE *argv, VALUE self)
-{
- ev_advise(argc, argv, self);
- evs_push(self);
- rb_ivar_set(self, id_events, rb_ary_new());
- fev_set_handler(self, Qnil);
+ poleev->pEvent = pIEV;
+ poleev->pEvent->m_event_id
+ = NUM2INT(rb_funcall(ary_ole_event, rb_intern("length"), 0));
+ poleev->pEvent->pConnectionPoint = pConnectionPoint;
+ poleev->pEvent->pTypeInfo = pTypeInfo;
+ poleev->pEvent->m_dwCookie = dwCookie;
+ poleev->freed = 0;
+ poleev->pEvent->ptr_freed = &(poleev->freed);
+ rb_ary_push(ary_ole_event, self);
return self;
}
@@ -8267,7 +6190,8 @@ fev_initialize(int argc, VALUE *argv, VALUE self)
* Translates and dispatches Windows message.
*/
static VALUE
-fev_s_msg_loop(VALUE klass)
+fev_s_msg_loop(klass)
+ VALUE klass;
{
ole_msg_loop();
return Qnil;
@@ -8275,34 +6199,35 @@ fev_s_msg_loop(VALUE klass)
static void
-add_event_call_back(VALUE obj, VALUE event, VALUE data)
+add_event_call_back(obj, event, data)
+ VALUE obj;
+ VALUE event;
+ VALUE data;
{
+ long at;
VALUE events = rb_ivar_get(obj, id_events);
if (NIL_P(events) || TYPE(events) != T_ARRAY) {
events = rb_ary_new();
rb_ivar_set(obj, id_events, events);
}
- ole_delete_event(events, event);
+ at = ole_search_event_at(events, event);
+ if (at > -1) {
+ rb_ary_delete_at(events, at);
+ }
rb_ary_push(events, data);
}
static VALUE
-ev_on_event(int argc, VALUE *argv, VALUE self, VALUE is_ary_arg)
+ev_on_event(argc, argv, self, is_ary_arg)
+ int argc;
+ VALUE *argv;
+ VALUE self;
+ VALUE is_ary_arg;
{
- struct oleeventdata *poleev;
VALUE event, args, data;
- Data_Get_Struct(self, struct oleeventdata, poleev);
- if (poleev->pConnectionPoint == NULL) {
- rb_raise(eWIN32OLERuntimeError, "IConnectionPoint not found. You must call advise at first.");
- }
rb_scan_args(argc, argv, "01*", &event, &args);
if(!NIL_P(event)) {
- if(TYPE(event) != T_STRING && TYPE(event) != T_SYMBOL) {
- rb_raise(rb_eTypeError, "wrong argument type (expected String or Symbol)");
- }
- if (TYPE(event) == T_SYMBOL) {
- event = rb_sym_to_s(event);
- }
+ Check_SafeStr(event);
}
data = rb_ary_new3(4, rb_block_proc(), event, args, is_ary_arg);
add_event_call_back(self, event, data);
@@ -8315,31 +6240,15 @@ ev_on_event(int argc, VALUE *argv, VALUE self, VALUE is_ary_arg)
*
* Defines the callback event.
* If argument is omitted, this method defines the callback of all events.
- * If you want to modify reference argument in callback, return hash in
- * callback. If you want to return value to OLE server as result of callback
- * use `return' or :return.
- *
* ie = WIN32OLE.new('InternetExplorer.Application')
- * ev = WIN32OLE_EVENT.new(ie)
+ * ev = WIN32OLE_EVENT.new(ie, 'DWebBrowserEvents')
* ev.on_event("NavigateComplete") {|url| puts url}
- * ev.on_event() {|ev, *args| puts "#{ev} fired"}
- *
- * ev.on_event("BeforeNavigate2") {|*args|
- * ...
- * # set true to BeforeNavigate reference argument `Cancel'.
- * # Cancel is 7-th argument of BeforeNavigate,
- * # so you can use 6 as key of hash instead of 'Cancel'.
- * # The argument is counted from 0.
- * # The hash key of 0 means first argument.)
- * {:Cancel => true} # or {'Cancel' => true} or {6 => true}
- * }
- *
- * ev.on_event(...) {|*args|
- * {:return => 1, :xxx => yyy}
- * }
*/
static VALUE
-fev_on_event(int argc, VALUE *argv, VALUE self)
+fev_on_event(argc, argv, self)
+ int argc;
+ VALUE *argv;
+ VALUE self;
{
return ev_on_event(argc, argv, self, Qfalse);
}
@@ -8350,619 +6259,26 @@ fev_on_event(int argc, VALUE *argv, VALUE self)
*
* Defines the callback of event.
* If you want modify argument in callback,
- * you could use this method instead of WIN32OLE_EVENT#on_event.
- *
- * ie = WIN32OLE.new('InternetExplorer.Application')
- * ev = WIN32OLE_EVENT.new(ie)
- * ev.on_event_with_outargs('BeforeNavigate2') {|*args|
- * args.last[6] = true
- * }
+ * you should use this method instead of WIN32OLE_EVENT#on_event.
*/
static VALUE
-fev_on_event_with_outargs(int argc, VALUE *argv, VALUE self)
+fev_on_event_with_outargs(argc, argv, self)
+ int argc;
+ VALUE *argv;
+ VALUE self;
{
return ev_on_event(argc, argv, self, Qtrue);
}
-/*
- * call-seq:
- * WIN32OLE_EVENT#off_event([event])
- *
- * removes the callback of event.
- *
- * ie = WIN32OLE.new('InternetExplorer.Application')
- * ev = WIN32OLE_EVENT.new(ie)
- * ev.on_event('BeforeNavigate2') {|*args|
- * args.last[6] = true
- * }
- * ...
- * ev.off_event('BeforeNavigate2')
- * ...
- */
-static VALUE
-fev_off_event(int argc, VALUE *argv, VALUE self)
-{
- VALUE event = Qnil;
- VALUE events;
-
- rb_secure(4);
- rb_scan_args(argc, argv, "01", &event);
- if(!NIL_P(event)) {
- if(TYPE(event) != T_STRING && TYPE(event) != T_SYMBOL) {
- rb_raise(rb_eTypeError, "wrong argument type (expected String or Symbol)");
- }
- if (TYPE(event) == T_SYMBOL) {
- event = rb_sym_to_s(event);
- }
- }
- events = rb_ivar_get(self, id_events);
- if (NIL_P(events)) {
- return Qnil;
- }
- ole_delete_event(events, event);
- return Qnil;
-}
-
-/*
- * call-seq:
- * WIN32OLE_EVENT#unadvise -> nil
- *
- * disconnects OLE server. If this method called, then the WIN32OLE_EVENT object
- * does not receive the OLE server event any more.
- * This method is trial implementation.
- *
- * ie = WIN32OLE.new('InternetExplorer.Application')
- * ev = WIN32OLE_EVENT.new(ie)
- * ev.on_event() {...}
- * ...
- * ev.unadvise
- *
- */
-static VALUE
-fev_unadvise(VALUE self)
-{
- struct oleeventdata *poleev;
- Data_Get_Struct(self, struct oleeventdata, poleev);
- if (poleev->pConnectionPoint) {
- ole_msg_loop();
- evs_delete(poleev->event_id);
- poleev->pConnectionPoint->lpVtbl->Unadvise(poleev->pConnectionPoint, poleev->dwCookie);
- OLE_RELEASE(poleev->pConnectionPoint);
- poleev->pConnectionPoint = NULL;
- }
- return Qnil;
-}
-
-static VALUE
-evs_push(VALUE ev)
-{
- return rb_ary_push(ary_ole_event, ev);
-}
-
-static VALUE
-evs_delete(long i)
-{
- rb_ary_store(ary_ole_event, i, Qnil);
- return Qnil;
-}
-
-static VALUE
-evs_entry(long i)
-{
- return rb_ary_entry(ary_ole_event, i);
-}
-
-static VALUE
-evs_length()
-{
- return rb_funcall(ary_ole_event, rb_intern("length"), 0);
-}
-
-/*
- * call-seq:
- * WIN32OLE_EVENT#handler=
- *
- * sets event handler object. If handler object has onXXX
- * method according to XXX event, then onXXX method is called
- * when XXX event occurs.
- *
- * If handler object has method_missing and there is no
- * method according to the event, then method_missing
- * called and 1-st argument is event name.
- *
- * If handler object has onXXX method and there is block
- * defined by WIN32OLE_EVENT#on_event('XXX'){},
- * then block is executed but handler object method is not called
- * when XXX event occurs.
- *
- * class Handler
- * def onStatusTextChange(text)
- * puts "StatusTextChanged"
- * end
- * def onPropertyChange(prop)
- * puts "PropertyChanged"
- * end
- * def method_missing(ev, *arg)
- * puts "other event #{ev}"
- * end
- * end
- *
- * handler = Handler.new
- * ie = WIN32OLE.new('InternetExplorer.Application')
- * ev = WIN32OLE_EVENT.new(ie)
- * ev.on_event("StatusTextChange") {|*args|
- * puts "this block executed."
- * puts "handler.onStatusTextChange method is not called."
- * }
- * ev.handler = handler
- *
- */
-static VALUE
-fev_set_handler(VALUE self, VALUE val)
-{
- return rb_ivar_set(self, rb_intern("handler"), val);
-}
-
-/*
- * call-seq:
- * WIN32OLE_EVENT#handler
- *
- * returns handler object.
- *
- */
-static VALUE
-fev_get_handler(VALUE self)
-{
- return rb_ivar_get(self, rb_intern("handler"));
-}
-
-static void
-olevariant_free(struct olevariantdata *pvar)
-{
- VariantClear(&(pvar->realvar));
- VariantClear(&(pvar->var));
- free(pvar);
-}
-
-static VALUE
-folevariant_s_allocate(VALUE klass)
-{
- struct olevariantdata *pvar;
- VALUE obj;
- ole_initialize();
- obj = Data_Make_Struct(klass,struct olevariantdata,0,olevariant_free,pvar);
- VariantInit(&(pvar->var));
- VariantInit(&(pvar->realvar));
- return obj;
-}
-
-/*
- * call-seq:
- * WIN32OLE_VARIANT.array(ary, vt)
- *
- * Returns Ruby object wrapping OLE variant whose variant type is VT_ARRAY.
- * The first argument should be Array object which specifies dimensions
- * and each size of dimensions of OLE array.
- * The second argument specifies variant type of the element of OLE array.
- *
- * The following create 2 dimensions OLE array. The first dimensions size
- * is 3, and the second is 4.
- *
- * ole_ary = WIN32OLE_VARIANT.array([3,4], VT_I4)
- * ruby_ary = ole_ary.value # => [[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]]
- *
- */
-static VALUE
-folevariant_s_array(VALUE klass, VALUE elems, VALUE vvt)
-{
- VALUE obj = Qnil;
- VARTYPE vt;
- struct olevariantdata *pvar;
- SAFEARRAYBOUND *psab = NULL;
- SAFEARRAY *psa = NULL;
- UINT dim = 0;
- UINT i = 0;
-
- ole_initialize();
-
- vt = NUM2UINT(vvt);
- vt = (vt | VT_ARRAY);
- Check_Type(elems, T_ARRAY);
- obj = folevariant_s_allocate(klass);
-
- Data_Get_Struct(obj, struct olevariantdata, pvar);
- dim = RARRAY_LEN(elems);
-
- psab = ALLOC_N(SAFEARRAYBOUND, dim);
-
- if(!psab) {
- rb_raise(rb_eRuntimeError, "memory allocation error");
- }
-
- for (i = 0; i < dim; i++) {
- psab[i].cElements = FIX2INT(rb_ary_entry(elems, i));
- psab[i].lLbound = 0;
- }
-
- psa = SafeArrayCreate((VARTYPE)(vt & VT_TYPEMASK), dim, psab);
- if (psa == NULL) {
- if (psab) free(psab);
- rb_raise(rb_eRuntimeError, "memory allocation error(SafeArrayCreate)");
- }
-
- V_VT(&(pvar->var)) = vt;
- if (vt & VT_BYREF) {
- V_VT(&(pvar->realvar)) = (vt & ~VT_BYREF);
- V_ARRAY(&(pvar->realvar)) = psa;
- V_ARRAYREF(&(pvar->var)) = &(V_ARRAY(&(pvar->realvar)));
- } else {
- V_ARRAY(&(pvar->var)) = psa;
- }
- if (psab) free(psab);
- return obj;
-}
-
-/*
- * call-seq:
- * WIN32OLE_VARIANT.new(val, vartype) #=> WIN32OLE_VARIANT object.
- *
- * Returns Ruby object wrapping OLE variant.
- * The first argument specifies Ruby object to convert OLE variant variable.
- * The second argument specifies VARIANT type.
- * In some situation, you need the WIN32OLE_VARIANT object to pass OLE method
- *
- * shell = WIN32OLE.new("Shell.Application")
- * folder = shell.NameSpace("C:\\Windows")
- * item = folder.ParseName("tmp.txt")
- * # You can't use Ruby String object to call FolderItem.InvokeVerb.
- * # Instead, you have to use WIN32OLE_VARIANT object to call the method.
- * shortcut = WIN32OLE_VARIANT.new("Create Shortcut(\&S)")
- * item.invokeVerb(shortcut)
- *
- */
-static VALUE
-folevariant_initialize(VALUE self, VALUE args)
-{
- int len = 0;
- VARIANT var;
- VALUE val;
- VALUE vvt;
- VARTYPE vt;
- struct olevariantdata *pvar;
-
- len = RARRAY_LEN(args);
- if (len < 1 || len > 3) {
- rb_raise(rb_eArgError, "wrong number of arguments (%d for 1..3)", len);
- }
- VariantInit(&var);
- val = rb_ary_entry(args, 0);
-
- if(!rb_obj_is_kind_of(val, cWIN32OLE) &&
- !rb_obj_is_kind_of(val, cWIN32OLE_VARIANT) &&
- !rb_obj_is_kind_of(val, rb_cTime)) {
- switch (TYPE(val)) {
- case T_ARRAY:
- case T_STRING:
- case T_FIXNUM:
- case T_BIGNUM:
- case T_FLOAT:
- case T_TRUE:
- case T_FALSE:
- case T_NIL:
- break;
- default:
- rb_raise(rb_eTypeError, "can not convert WIN32OLE_VARIANT from type %s",
- rb_obj_classname(val));
- }
- }
-
- Data_Get_Struct(self, struct olevariantdata, pvar);
- if (len == 1) {
- ole_val2variant(val, &(pvar->var));
- } else {
- vvt = rb_ary_entry(args, 1);
- vt = NUM2INT(vvt);
- ole_val2olevariantdata(val, vt, pvar);
- }
- vt = V_VT(&pvar->var);
- return self;
-}
-
-static SAFEARRAY *
-get_locked_safe_array(VALUE val)
-{
- struct olevariantdata *pvar;
- SAFEARRAY *psa = NULL;
- HRESULT hr;
- Data_Get_Struct(val, struct olevariantdata, pvar);
- if (!(V_VT(&(pvar->var)) & VT_ARRAY)) {
- rb_raise(rb_eTypeError, "variant type is not VT_ARRAY.");
- }
- psa = V_ISBYREF(&(pvar->var)) ? *V_ARRAYREF(&(pvar->var)) : V_ARRAY(&(pvar->var));
- if (psa == NULL) {
- return psa;
- }
- hr = SafeArrayLock(psa);
- if (FAILED(hr)) {
- ole_raise(hr, rb_eRuntimeError, "failed to SafeArrayLock");
- }
- return psa;
-}
-
-static long *
-ary2safe_array_index(int ary_size, VALUE *ary, SAFEARRAY *psa)
-{
- long dim;
- long *pid;
- long i;
- dim = SafeArrayGetDim(psa);
- if (dim != ary_size) {
- rb_raise(rb_eArgError, "unmatch number of indices");
- }
- pid = ALLOC_N(long, dim);
- if (pid == NULL) {
- rb_raise(rb_eRuntimeError, "failed to allocate memory for indices");
- }
- for (i = 0; i < dim; i++) {
- pid[i] = NUM2INT(ary[i]);
- }
- return pid;
-}
-
-static void
-unlock_safe_array(SAFEARRAY *psa)
-{
- HRESULT hr;
- hr = SafeArrayUnlock(psa);
- if (FAILED(hr)) {
- ole_raise(hr, rb_eRuntimeError, "failed to SafeArrayUnlock");
- }
-}
-
-/*
- * call-seq:
- * WIN32OLE_VARIANT[i,j,...] #=> element of OLE array.
- *
- * Returns the element of WIN32OLE_VARIANT object(OLE array).
- * This method is available only when the variant type of
- * WIN32OLE_VARIANT object is VT_ARRAY.
- *
- * REMARK:
- * The all indicies should be 0 or natural number and
- * lower than or equal to max indicies.
- * (This point is different with Ruby Array indicies.)
- *
- * obj = WIN32OLE_VARIANT.new([[1,2,3],[4,5,6]])
- * p obj[0,0] # => 1
- * p obj[1,0] # => 4
- * p obj[2,0] # => WIN32OLERuntimeError
- * p obj[0, -1] # => WIN32OLERuntimeError
- *
- */
-static VALUE
-folevariant_ary_aref(int argc, VALUE *argv, VALUE self)
-{
- struct olevariantdata *pvar;
- SAFEARRAY *psa;
- VALUE val = Qnil;
- VARIANT variant;
- long *pid;
- HRESULT hr;
-
- Data_Get_Struct(self, struct olevariantdata, pvar);
- if (!V_ISARRAY(&(pvar->var))) {
- rb_raise(eWIN32OLERuntimeError,
- "`[]' is not available for this variant type object");
- }
- psa = get_locked_safe_array(self);
- if (psa == NULL) {
- return val;
- }
-
- pid = ary2safe_array_index(argc, argv, psa);
-
- VariantInit(&variant);
- V_VT(&variant) = (V_VT(&(pvar->var)) & ~VT_ARRAY) | VT_BYREF;
- hr = SafeArrayPtrOfIndex(psa, pid, &V_BYREF(&variant));
- if (FAILED(hr)) {
- ole_raise(hr, eWIN32OLERuntimeError, "failed to SafeArrayPtrOfIndex");
- }
- val = ole_variant2val(&variant);
-
- unlock_safe_array(psa);
- if (pid) free(pid);
- return val;
-}
-
-static VOID *
-val2variant_ptr(VALUE val, VARIANT *var, VARTYPE vt)
-{
- VOID *p = NULL;
- HRESULT hr = S_OK;
- ole_val2variant_ex(val, var, vt);
- if ((vt & ~VT_BYREF) == VT_VARIANT) {
- p = var;
- } else {
- if ( (vt & ~VT_BYREF) != V_VT(var)) {
- hr = VariantChangeTypeEx(var, var,
- cWIN32OLE_lcid, 0, (VARTYPE)(vt & ~VT_BYREF));
- if (FAILED(hr)) {
- ole_raise(hr, rb_eRuntimeError, "failed to change type");
- }
- }
- p = get_ptr_of_variant(var);
- }
- if (p == NULL) {
- rb_raise(rb_eRuntimeError, "failed to get pointer of variant");
- }
- return p;
-}
-
-/*
- * call-seq:
- * WIN32OLE_VARIANT[i,j,...] = val #=> set the element of OLE array
- *
- * Set the element of WIN32OLE_VARIANT object(OLE array) to val.
- * This method is available only when the variant type of
- * WIN32OLE_VARIANT object is VT_ARRAY.
- *
- * REMARK:
- * The all indicies should be 0 or natural number and
- * lower than or equal to max indicies.
- * (This point is different with Ruby Array indicies.)
- *
- * obj = WIN32OLE_VARIANT.new([[1,2,3],[4,5,6]])
- * obj[0,0] = 7
- * obj[1,0] = 8
- * p obj.value # => [[7,2,3], [8,5,6]]
- * obj[2,0] = 9 # => WIN32OLERuntimeError
- * obj[0, -1] = 9 # => WIN32OLERuntimeError
- *
- */
-static VALUE
-folevariant_ary_aset(int argc, VALUE *argv, VALUE self)
-{
- struct olevariantdata *pvar;
- SAFEARRAY *psa;
- VARIANT var;
- VARTYPE vt;
- long *pid;
- HRESULT hr;
- VOID *p = NULL;
-
- Data_Get_Struct(self, struct olevariantdata, pvar);
- if (!V_ISARRAY(&(pvar->var))) {
- rb_raise(eWIN32OLERuntimeError,
- "`[]' is not available for this variant type object");
- }
- psa = get_locked_safe_array(self);
- if (psa == NULL) {
- rb_raise(rb_eRuntimeError, "failed to get SafeArray pointer");
- }
-
- pid = ary2safe_array_index(argc-1, argv, psa);
-
- VariantInit(&var);
- vt = (V_VT(&(pvar->var)) & ~VT_ARRAY);
- p = val2variant_ptr(argv[argc-1], &var, vt);
- if ((V_VT(&var) == VT_DISPATCH && V_DISPATCH(&var) == NULL) ||
- (V_VT(&var) == VT_UNKNOWN && V_UNKNOWN(&var) == NULL)) {
- rb_raise(eWIN32OLERuntimeError, "argument does not have IDispatch or IUnknown Interface");
- }
- hr = SafeArrayPutElement(psa, pid, p);
- if (FAILED(hr)) {
- ole_raise(hr, eWIN32OLERuntimeError, "failed to SafeArrayPutElement");
- }
-
- unlock_safe_array(psa);
- if (pid) free(pid);
- return argv[argc-1];
-}
-
-/*
- * call-seq:
- * WIN32OLE_VARIANT.value #=> Ruby object.
- *
- * Returns Ruby object value from OLE variant.
- * obj = WIN32OLE_VARIANT.new(1, WIN32OLE::VARIANT::VT_BSTR)
- * obj.value # => "1" (not Fixnum object, but String object "1")
- *
- */
-static VALUE
-folevariant_value(VALUE self)
-{
- struct olevariantdata *pvar;
- VALUE val = Qnil;
- VARTYPE vt;
- int dim;
- SAFEARRAY *psa;
- Data_Get_Struct(self, struct olevariantdata, pvar);
-
- val = ole_variant2val(&(pvar->var));
- vt = V_VT(&(pvar->var));
-
- if ((vt & ~VT_BYREF) == (VT_UI1|VT_ARRAY)) {
- if (vt & VT_BYREF) {
- psa = *V_ARRAYREF(&(pvar->var));
- } else {
- psa = V_ARRAY(&(pvar->var));
- }
- if (!psa) {
- return val;
- }
- dim = SafeArrayGetDim(psa);
- if (dim == 1) {
- val = rb_funcall(val, rb_intern("pack"), 1, rb_str_new2("C*"));
- }
- }
- return val;
-}
-
-/*
- * call-seq:
- * WIN32OLE_VARIANT.vartype #=> OLE variant type.
- *
- * Returns OLE variant type.
- * obj = WIN32OLE_VARIANT.new("string")
- * obj.vartype # => WIN32OLE::VARIANT::VT_BSTR
- *
- */
-static VALUE
-folevariant_vartype(VALUE self)
-{
- struct olevariantdata *pvar;
- Data_Get_Struct(self, struct olevariantdata, pvar);
- return INT2FIX(V_VT(&pvar->var));
-}
-
-/*
- * call-seq:
- * WIN32OLE_VARIANT.value = val #=> set WIN32OLE_VARIANT value to val.
- *
- * Sets variant value to val. If the val type does not match variant value
- * type(vartype), then val is changed to match variant value type(vartype)
- * before setting val.
- * Thie method is not available when vartype is VT_ARRAY(except VT_UI1|VT_ARRAY).
- * If the vartype is VT_UI1|VT_ARRAY, the val should be String object.
- *
- * obj = WIN32OLE_VARIANT.new(1) # obj.vartype is WIN32OLE::VARIANT::VT_I4
- * obj.value = 3.2 # 3.2 is changed to 3 when setting value.
- * p obj.value # => 3
- */
-static VALUE
-folevariant_set_value(VALUE self, VALUE val)
-{
- struct olevariantdata *pvar;
- VARTYPE vt;
- Data_Get_Struct(self, struct olevariantdata, pvar);
- vt = V_VT(&(pvar->var));
- if (V_ISARRAY(&(pvar->var)) && ((vt & ~VT_BYREF) != (VT_UI1|VT_ARRAY) || TYPE(val) != T_STRING)) {
- rb_raise(eWIN32OLERuntimeError,
- "`value=' is not available for this variant type object");
- }
- ole_val2olevariantdata(val, vt, pvar);
- return Qnil;
-}
-
-static void
-init_enc2cp()
-{
- enc2cp_table = st_init_numtable();
-}
-
-static void
-free_enc2cp()
-{
- st_free_table(enc2cp_table);
-}
void
Init_win32ole()
{
+ rb_global_variable(&ary_ole_event);
ary_ole_event = rb_ary_new();
- rb_gc_register_mark_object(ary_ole_event);
id_events = rb_intern("events");
+ rb_global_variable(&com_hash);
com_vtbl.QueryInterface = QueryInterface;
com_vtbl.AddRef = AddRef;
com_vtbl.Release = Release;
@@ -8977,9 +6293,8 @@ Init_win32ole()
message_filter.HandleInComingCall = mf_HandleInComingCall;
message_filter.RetryRejectedCall = mf_RetryRejectedCall;
message_filter.MessagePending = mf_MessagePending;
-
+
com_hash = Data_Wrap_Struct(rb_cData, rb_mark_hash, st_free_table, st_init_numtable());
- rb_gc_register_mark_object(com_hash);
cWIN32OLE = rb_define_class("WIN32OLE", rb_cObject);
@@ -8995,18 +6310,16 @@ Init_win32ole()
rb_define_singleton_method(cWIN32OLE, "ole_show_help", fole_s_show_help, -1);
rb_define_singleton_method(cWIN32OLE, "codepage", fole_s_get_code_page, 0);
rb_define_singleton_method(cWIN32OLE, "codepage=", fole_s_set_code_page, 1);
- rb_define_singleton_method(cWIN32OLE, "locale", fole_s_get_locale, 0);
- rb_define_singleton_method(cWIN32OLE, "locale=", fole_s_set_locale, 1);
- rb_define_singleton_method(cWIN32OLE, "create_guid", fole_s_create_guid, 0);
+
rb_define_method(cWIN32OLE, "invoke", fole_invoke, -1);
- rb_define_method(cWIN32OLE, "[]", fole_getproperty_with_bracket, -1);
+ rb_define_method(cWIN32OLE, "[]", fole_getproperty, -1);
rb_define_method(cWIN32OLE, "_invoke", fole_invoke2, 3);
rb_define_method(cWIN32OLE, "_getproperty", fole_getproperty2, 3);
rb_define_method(cWIN32OLE, "_setproperty", fole_setproperty2, 3);
/* support propput method that takes an argument */
- rb_define_method(cWIN32OLE, "[]=", fole_setproperty_with_bracket, -1);
+ rb_define_method(cWIN32OLE, "[]=", fole_setproperty, -1);
rb_define_method(cWIN32OLE, "ole_free", fole_free, 0);
@@ -9023,30 +6336,20 @@ Init_win32ole()
rb_define_method(cWIN32OLE, "ole_method", fole_method_help, 1);
rb_define_alias(cWIN32OLE, "ole_method_help", "ole_method");
+ rb_define_method(cWIN32OLE, "ole_obj_help", fole_obj_help, 0);
rb_define_method(cWIN32OLE, "ole_activex_initialize", fole_activex_initialize, 0);
- rb_define_method(cWIN32OLE, "ole_type", fole_type, 0);
- rb_define_alias(cWIN32OLE, "ole_obj_help", "ole_type");
- rb_define_method(cWIN32OLE, "ole_typelib", fole_typelib, 0);
- rb_define_method(cWIN32OLE, "ole_query_interface", fole_query_interface, 1);
- rb_define_method(cWIN32OLE, "ole_respond_to?", fole_respond_to, 1);
rb_define_const(cWIN32OLE, "VERSION", rb_str_new2(WIN32OLE_VERSION));
rb_define_const(cWIN32OLE, "ARGV", rb_ary_new());
-
- rb_define_const(cWIN32OLE, "CP_ACP", INT2FIX(CP_ACP));
- rb_define_const(cWIN32OLE, "CP_OEMCP", INT2FIX(CP_OEMCP));
- rb_define_const(cWIN32OLE, "CP_MACCP", INT2FIX(CP_MACCP));
- rb_define_const(cWIN32OLE, "CP_THREAD_ACP", INT2FIX(CP_THREAD_ACP));
- rb_define_const(cWIN32OLE, "CP_SYMBOL", INT2FIX(CP_SYMBOL));
- rb_define_const(cWIN32OLE, "CP_UTF7", INT2FIX(CP_UTF7));
- rb_define_const(cWIN32OLE, "CP_UTF8", INT2FIX(CP_UTF8));
-
- rb_define_const(cWIN32OLE, "LOCALE_SYSTEM_DEFAULT", INT2FIX(LOCALE_SYSTEM_DEFAULT));
- rb_define_const(cWIN32OLE, "LOCALE_USER_DEFAULT", INT2FIX(LOCALE_USER_DEFAULT));
+ rb_define_const(cWIN32OLE, "CP_ACP" ,INT2FIX(CP_ACP));
+ rb_define_const(cWIN32OLE, "CP_OEMCP" ,INT2FIX(CP_OEMCP));
+ rb_define_const(cWIN32OLE, "CP_MACCP" ,INT2FIX(CP_MACCP));
+ rb_define_const(cWIN32OLE, "CP_THREAD_ACP",INT2FIX(CP_THREAD_ACP));
+ rb_define_const(cWIN32OLE, "CP_SYMBOL" ,INT2FIX(CP_SYMBOL));
+ rb_define_const(cWIN32OLE, "CP_UTF7" ,INT2FIX(CP_UTF7));
+ rb_define_const(cWIN32OLE, "CP_UTF8" ,INT2FIX(CP_UTF8));
mWIN32OLE_VARIANT = rb_define_module_under(cWIN32OLE, "VARIANT");
- rb_define_const(mWIN32OLE_VARIANT, "VT_EMPTY", INT2FIX(VT_EMPTY));
- rb_define_const(mWIN32OLE_VARIANT, "VT_NULL", INT2FIX(VT_NULL));
rb_define_const(mWIN32OLE_VARIANT, "VT_I2", INT2FIX(VT_I2));
rb_define_const(mWIN32OLE_VARIANT, "VT_I4", INT2FIX(VT_I4));
rb_define_const(mWIN32OLE_VARIANT, "VT_R4", INT2FIX(VT_R4));
@@ -9065,30 +6368,10 @@ Init_win32ole()
rb_define_const(mWIN32OLE_VARIANT, "VT_UI1", INT2FIX(VT_UI1));
rb_define_const(mWIN32OLE_VARIANT, "VT_UI2", INT2FIX(VT_UI2));
rb_define_const(mWIN32OLE_VARIANT, "VT_UI4", INT2FIX(VT_UI4));
-#if (_MSC_VER >= 1300) || defined(__CYGWIN__) || defined(__MINGW32__)
- rb_define_const(mWIN32OLE_VARIANT, "VT_I8", INT2FIX(VT_I8));
- rb_define_const(mWIN32OLE_VARIANT, "VT_UI8", INT2FIX(VT_UI8));
-#endif
rb_define_const(mWIN32OLE_VARIANT, "VT_INT", INT2FIX(VT_INT));
rb_define_const(mWIN32OLE_VARIANT, "VT_UINT", INT2FIX(VT_UINT));
rb_define_const(mWIN32OLE_VARIANT, "VT_ARRAY", INT2FIX(VT_ARRAY));
rb_define_const(mWIN32OLE_VARIANT, "VT_BYREF", INT2FIX(VT_BYREF));
-
- cWIN32OLE_TYPELIB = rb_define_class("WIN32OLE_TYPELIB", rb_cObject);
- rb_define_singleton_method(cWIN32OLE_TYPELIB, "typelibs", foletypelib_s_typelibs, 0);
- rb_define_method(cWIN32OLE_TYPELIB, "initialize", foletypelib_initialize, -2);
- rb_define_method(cWIN32OLE_TYPELIB, "guid", foletypelib_guid, 0);
- rb_define_method(cWIN32OLE_TYPELIB, "name", foletypelib_name, 0);
- rb_define_method(cWIN32OLE_TYPELIB, "version", foletypelib_version, 0);
- rb_define_method(cWIN32OLE_TYPELIB, "major_version", foletypelib_major_version, 0);
- rb_define_method(cWIN32OLE_TYPELIB, "minor_version", foletypelib_minor_version, 0);
- rb_define_method(cWIN32OLE_TYPELIB, "path", foletypelib_path, 0);
- rb_define_method(cWIN32OLE_TYPELIB, "ole_types", foletypelib_ole_types, 0);
- rb_define_alias(cWIN32OLE_TYPELIB, "ole_classes", "ole_types");
- rb_define_method(cWIN32OLE_TYPELIB, "visible?", foletypelib_visible, 0);
- rb_define_method(cWIN32OLE_TYPELIB, "library_name", foletypelib_library_name, 0);
- rb_define_alias(cWIN32OLE_TYPELIB, "to_s", "name");
- rb_define_method(cWIN32OLE_TYPELIB, "inspect", foletypelib_inspect, 0);
cWIN32OLE_TYPE = rb_define_class("WIN32OLE_TYPE", rb_cObject);
rb_define_singleton_method(cWIN32OLE_TYPE, "ole_classes", foletype_s_ole_classes, 1);
@@ -9102,6 +6385,7 @@ Init_win32ole()
rb_define_method(cWIN32OLE_TYPE, "progid", foletype_progid, 0);
rb_define_method(cWIN32OLE_TYPE, "visible?", foletype_visible, 0);
rb_define_alias(cWIN32OLE_TYPE, "to_s", "name");
+
rb_define_method(cWIN32OLE_TYPE, "major_version", foletype_major_version, 0);
rb_define_method(cWIN32OLE_TYPE, "minor_version", foletype_minor_version, 0);
rb_define_method(cWIN32OLE_TYPE, "typekind", foletype_typekind, 0);
@@ -9110,13 +6394,7 @@ Init_win32ole()
rb_define_method(cWIN32OLE_TYPE, "helpfile", foletype_helpfile, 0);
rb_define_method(cWIN32OLE_TYPE, "helpcontext", foletype_helpcontext, 0);
rb_define_method(cWIN32OLE_TYPE, "variables", foletype_variables, 0);
- rb_define_method(cWIN32OLE_TYPE, "ole_methods", foletype_methods, 0);
- rb_define_method(cWIN32OLE_TYPE, "ole_typelib", foletype_ole_typelib, 0);
- rb_define_method(cWIN32OLE_TYPE, "implemented_ole_types", foletype_impl_ole_types, 0);
- rb_define_method(cWIN32OLE_TYPE, "source_ole_types", foletype_source_ole_types, 0);
- rb_define_method(cWIN32OLE_TYPE, "default_event_sources", foletype_default_event_sources, 0);
- rb_define_method(cWIN32OLE_TYPE, "default_ole_types", foletype_default_ole_types, 0);
- rb_define_method(cWIN32OLE_TYPE, "inspect", foletype_inspect, 0);
+ rb_define_method(cWIN32OLE_TYPE, "ole_methods", foletype_methods, -1);
cWIN32OLE_VARIABLE = rb_define_class("WIN32OLE_VARIABLE", rb_cObject);
rb_define_method(cWIN32OLE_VARIABLE, "name", folevariable_name, 0);
@@ -9126,12 +6404,12 @@ Init_win32ole()
rb_define_method(cWIN32OLE_VARIABLE, "visible?", folevariable_visible, 0);
rb_define_method(cWIN32OLE_VARIABLE, "variable_kind", folevariable_variable_kind, 0);
rb_define_method(cWIN32OLE_VARIABLE, "varkind", folevariable_varkind, 0);
- rb_define_method(cWIN32OLE_VARIABLE, "inspect", folevariable_inspect, 0);
rb_define_alias(cWIN32OLE_VARIABLE, "to_s", "name");
cWIN32OLE_METHOD = rb_define_class("WIN32OLE_METHOD", rb_cObject);
rb_define_alloc_func(cWIN32OLE_METHOD, folemethod_s_allocate);
rb_define_method(cWIN32OLE_METHOD, "initialize", folemethod_initialize, 2);
+
rb_define_method(cWIN32OLE_METHOD, "name", folemethod_name, 0);
rb_define_method(cWIN32OLE_METHOD, "return_type", folemethod_return_type, 0);
rb_define_method(cWIN32OLE_METHOD, "return_vtype", folemethod_return_vtype, 0);
@@ -9150,7 +6428,6 @@ Init_win32ole()
rb_define_method(cWIN32OLE_METHOD, "size_opt_params", folemethod_size_opt_params, 0);
rb_define_method(cWIN32OLE_METHOD, "params", folemethod_params, 0);
rb_define_alias(cWIN32OLE_METHOD, "to_s", "name");
- rb_define_method(cWIN32OLE_METHOD, "inspect", folemethod_inspect, 0);
cWIN32OLE_PARAM = rb_define_class("WIN32OLE_PARAM", rb_cObject);
rb_define_method(cWIN32OLE_PARAM, "name", foleparam_name, 0);
@@ -9162,35 +6439,14 @@ Init_win32ole()
rb_define_method(cWIN32OLE_PARAM, "retval?", foleparam_retval, 0);
rb_define_method(cWIN32OLE_PARAM, "default", foleparam_default, 0);
rb_define_alias(cWIN32OLE_PARAM, "to_s", "name");
- rb_define_method(cWIN32OLE_PARAM, "inspect", foleparam_inspect, 0);
cWIN32OLE_EVENT = rb_define_class("WIN32OLE_EVENT", rb_cObject);
- rb_define_singleton_method(cWIN32OLE_EVENT, "message_loop", fev_s_msg_loop, 0);
+
rb_define_alloc_func(cWIN32OLE_EVENT, fev_s_allocate);
rb_define_method(cWIN32OLE_EVENT, "initialize", fev_initialize, -1);
+ rb_define_singleton_method(cWIN32OLE_EVENT, "message_loop", fev_s_msg_loop, 0);
+
rb_define_method(cWIN32OLE_EVENT, "on_event", fev_on_event, -1);
rb_define_method(cWIN32OLE_EVENT, "on_event_with_outargs", fev_on_event_with_outargs, -1);
- rb_define_method(cWIN32OLE_EVENT, "off_event", fev_off_event, -1);
- rb_define_method(cWIN32OLE_EVENT, "unadvise", fev_unadvise, 0);
- rb_define_method(cWIN32OLE_EVENT, "handler=", fev_set_handler, 1);
- rb_define_method(cWIN32OLE_EVENT, "handler", fev_get_handler, 0);
-
- cWIN32OLE_VARIANT = rb_define_class("WIN32OLE_VARIANT", rb_cObject);
- rb_define_alloc_func(cWIN32OLE_VARIANT, folevariant_s_allocate);
- rb_define_singleton_method(cWIN32OLE_VARIANT, "array", folevariant_s_array, 2);
- rb_define_method(cWIN32OLE_VARIANT, "initialize", folevariant_initialize, -2);
- rb_define_method(cWIN32OLE_VARIANT, "value", folevariant_value, 0);
- rb_define_method(cWIN32OLE_VARIANT, "value=", folevariant_set_value, 1);
- rb_define_method(cWIN32OLE_VARIANT, "vartype", folevariant_vartype, 0);
- rb_define_method(cWIN32OLE_VARIANT, "[]", folevariant_ary_aref, -1);
- rb_define_method(cWIN32OLE_VARIANT, "[]=", folevariant_ary_aset, -1);
- rb_define_const(cWIN32OLE_VARIANT, "Empty", rb_funcall(cWIN32OLE_VARIANT, rb_intern("new"), 2, Qnil, INT2FIX(VT_EMPTY)));
- rb_define_const(cWIN32OLE_VARIANT, "Null", rb_funcall(cWIN32OLE_VARIANT, rb_intern("new"), 2, Qnil, INT2FIX(VT_NULL)));
- rb_define_const(cWIN32OLE_VARIANT, "Nothing", rb_funcall(cWIN32OLE_VARIANT, rb_intern("new"), 2, Qnil, INT2FIX(VT_DISPATCH)));
-
- eWIN32OLERuntimeError = rb_define_class("WIN32OLERuntimeError", rb_eRuntimeError);
-
- init_enc2cp();
- atexit((void (*)(void))free_enc2cp);
- ole_init_cp();
+ eWIN32OLE_RUNTIME_ERROR = rb_define_class("WIN32OLERuntimeError", rb_eRuntimeError);
}
diff --git a/ext/zlib/.cvsignore b/ext/zlib/.cvsignore
index 814345ece8..4088712231 100644
--- a/ext/zlib/.cvsignore
+++ b/ext/zlib/.cvsignore
@@ -1,4 +1,3 @@
Makefile
mkmf.log
*.def
-extconf.h
diff --git a/ext/zlib/doc/zlib.rd b/ext/zlib/doc/zlib.rd
index 0a5e2d0abf..6a36dc7fed 100644
--- a/ext/zlib/doc/zlib.rd
+++ b/ext/zlib/doc/zlib.rd
@@ -543,12 +543,6 @@ GzipReader should be used with associating an instance of IO class
must respond to flush method. While `sync' mode is true,
the compression ratio decreases sharply.
---- Zlib::GzipFile#path
-
- Returns the path string of the associated IO-like object. This
- method is only defined when the IO-like object responds to
- #path().
-
== Zlib::GzipFile::Error
diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c
index 288b13b728..306e267856 100644
--- a/ext/zlib/zlib.c
+++ b/ext/zlib/zlib.c
@@ -9,7 +9,6 @@
#include <ruby.h>
#include <zlib.h>
#include <time.h>
-#include <ruby/encoding.h>
#define RUBY_ZLIB_VERSION "0.6.0"
@@ -32,170 +31,163 @@
/*--------- Prototypes --------*/
-static NORETURN(void raise_zlib_error(int, const char*));
-static VALUE rb_zlib_version(VALUE);
-static VALUE do_checksum(int, VALUE*, uLong (*)(uLong, const Bytef*, uInt));
-static VALUE rb_zlib_adler32(int, VALUE*, VALUE);
-static VALUE rb_zlib_crc32(int, VALUE*, VALUE);
-static VALUE rb_zlib_crc_table(VALUE);
-static voidpf zlib_mem_alloc(voidpf, uInt, uInt);
-static void zlib_mem_free(voidpf, voidpf);
-static void finalizer_warn(const char*);
+static NORETURN(void raise_zlib_error _((int, const char *)));
+static VALUE rb_zlib_version _((VALUE));
+static VALUE do_checksum _((int, VALUE*, uLong (*) _((uLong, const Bytef*, uInt))));
+static VALUE rb_zlib_adler32 _((int, VALUE*, VALUE));
+static VALUE rb_zlib_crc32 _((int, VALUE*, VALUE));
+static VALUE rb_zlib_crc_table _((VALUE));
+static voidpf zlib_mem_alloc _((voidpf, uInt, uInt));
+static void zlib_mem_free _((voidpf, voidpf));
+static void finalizer_warn _((const char*));
struct zstream;
struct zstream_funcs;
-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*, int);
-static void zstream_append_buffer(struct zstream*, const Bytef*, int);
-static VALUE zstream_detach_buffer(struct zstream*);
-static VALUE zstream_shift_buffer(struct zstream*, int);
-static void zstream_buffer_ungets(struct zstream*, const Bytef*, int);
-static void zstream_buffer_ungetbyte(struct zstream*, int);
-static void zstream_append_input(struct zstream*, const Bytef*, unsigned int);
-static void zstream_discard_input(struct zstream*, unsigned int);
-static void zstream_reset_input(struct zstream*);
-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 void zstream_run(struct zstream*, Bytef*, uInt, int);
-static VALUE zstream_sync(struct zstream*, Bytef*, uInt);
-static void zstream_mark(struct zstream*);
-static void zstream_free(struct zstream*);
-static VALUE zstream_new(VALUE, const struct zstream_funcs*);
-static struct zstream *get_zstream(VALUE);
-static void zstream_finalize(struct zstream*);
-
-static VALUE rb_zstream_end(VALUE);
-static VALUE rb_zstream_reset(VALUE);
-static VALUE rb_zstream_finish(VALUE);
-static VALUE rb_zstream_flush_next_in(VALUE);
-static VALUE rb_zstream_flush_next_out(VALUE);
-static VALUE rb_zstream_avail_out(VALUE);
-static VALUE rb_zstream_set_avail_out(VALUE, VALUE);
-static VALUE rb_zstream_avail_in(VALUE);
-static VALUE rb_zstream_total_in(VALUE);
-static VALUE rb_zstream_total_out(VALUE);
-static VALUE rb_zstream_data_type(VALUE);
-static VALUE rb_zstream_adler(VALUE);
-static VALUE rb_zstream_finished_p(VALUE);
-static VALUE rb_zstream_closed_p(VALUE);
-
-static VALUE rb_deflate_s_allocate(VALUE);
-static VALUE rb_deflate_initialize(int, VALUE*, VALUE);
-static VALUE rb_deflate_init_copy(VALUE, VALUE);
-static VALUE deflate_run(VALUE);
-static VALUE rb_deflate_s_deflate(int, VALUE*, VALUE);
-static void do_deflate(struct zstream*, VALUE, int);
-static VALUE rb_deflate_deflate(int, VALUE*, VALUE);
-static VALUE rb_deflate_addstr(VALUE, VALUE);
-static VALUE rb_deflate_flush(int, VALUE*, VALUE);
-static VALUE rb_deflate_params(VALUE, VALUE, VALUE);
-static VALUE rb_deflate_set_dictionary(VALUE, VALUE);
-
-static VALUE inflate_run(VALUE);
-static VALUE rb_inflate_s_allocate(VALUE);
-static VALUE rb_inflate_initialize(int, VALUE*, VALUE);
-static VALUE rb_inflate_s_inflate(VALUE, VALUE);
-static void do_inflate(struct zstream*, VALUE);
-static VALUE rb_inflate_inflate(VALUE, VALUE);
-static VALUE rb_inflate_addstr(VALUE, VALUE);
-static VALUE rb_inflate_sync(VALUE, VALUE);
-static VALUE rb_inflate_sync_point_p(VALUE);
-static VALUE rb_inflate_set_dictionary(VALUE, VALUE);
+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*, int));
+static void zstream_append_buffer _((struct zstream*, const char*, int));
+static VALUE zstream_detach_buffer _((struct zstream*));
+static VALUE zstream_shift_buffer _((struct zstream*, int));
+static void zstream_buffer_ungetc _((struct zstream*, int));
+static void zstream_append_input _((struct zstream*, const char*, unsigned int));
+static void zstream_discard_input _((struct zstream*, unsigned int));
+static void zstream_reset_input _((struct zstream*));
+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 void zstream_run _((struct zstream*, Bytef*, uInt, int));
+static VALUE zstream_sync _((struct zstream*, Bytef*, uInt));
+static void zstream_mark _((struct zstream*));
+static void zstream_free _((struct zstream*));
+static VALUE zstream_new _((VALUE, const struct zstream_funcs*));
+static struct zstream *get_zstream _((VALUE));
+static void zstream_finalize _((struct zstream*));
+
+static VALUE rb_zstream_end _((VALUE));
+static VALUE rb_zstream_reset _((VALUE));
+static VALUE rb_zstream_finish _((VALUE));
+static VALUE rb_zstream_flush_next_in _((VALUE));
+static VALUE rb_zstream_flush_next_out _((VALUE));
+static VALUE rb_zstream_avail_out _((VALUE));
+static VALUE rb_zstream_set_avail_out _((VALUE, VALUE));
+static VALUE rb_zstream_avail_in _((VALUE));
+static VALUE rb_zstream_total_in _((VALUE));
+static VALUE rb_zstream_total_out _((VALUE));
+static VALUE rb_zstream_data_type _((VALUE));
+static VALUE rb_zstream_adler _((VALUE));
+static VALUE rb_zstream_finished_p _((VALUE));
+static VALUE rb_zstream_closed_p _((VALUE));
+
+static VALUE rb_deflate_s_allocate _((VALUE));
+static VALUE rb_deflate_initialize _((int, VALUE*, VALUE));
+static VALUE rb_deflate_init_copy _((VALUE, VALUE));
+static VALUE deflate_run _((VALUE));
+static VALUE rb_deflate_s_deflate _((int, VALUE*, VALUE));
+static void do_deflate _((struct zstream*, VALUE, int));
+static VALUE rb_deflate_deflate _((int, VALUE*, VALUE));
+static VALUE rb_deflate_addstr _((VALUE, VALUE));
+static VALUE rb_deflate_flush _((int, VALUE*, VALUE));
+static VALUE rb_deflate_params _((VALUE, VALUE, VALUE));
+static VALUE rb_deflate_set_dictionary _((VALUE, VALUE));
+
+static VALUE inflate_run _((VALUE));
+static VALUE rb_inflate_s_allocate _((VALUE));
+static VALUE rb_inflate_initialize _((int, VALUE*, VALUE));
+static VALUE rb_inflate_s_inflate _((VALUE, VALUE));
+static void do_inflate _((struct zstream*, VALUE));
+static VALUE rb_inflate_inflate _((VALUE, VALUE));
+static VALUE rb_inflate_addstr _((VALUE, VALUE));
+static VALUE rb_inflate_sync _((VALUE, VALUE));
+static VALUE rb_inflate_sync_point_p _((VALUE));
+static VALUE rb_inflate_set_dictionary _((VALUE, VALUE));
#if GZIP_SUPPORT
struct gzfile;
-static void gzfile_mark(struct gzfile*);
-static void gzfile_free(struct gzfile*);
-static VALUE gzfile_new(VALUE, const struct zstream_funcs*, void (*) _((struct gzfile*)));
-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);
-static VALUE gzfile_read_raw(struct gzfile*);
-static int gzfile_read_raw_ensure(struct gzfile*, int);
-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*);
-static void gzfile_check_footer(struct gzfile*);
-static void gzfile_write(struct gzfile*, Bytef*, uInt);
-static long gzfile_read_more(struct gzfile*);
-static void gzfile_calc_crc(struct gzfile*, VALUE);
-static VALUE gzfile_read(struct gzfile*, int);
-static VALUE gzfile_read_all(struct gzfile*);
-static void gzfile_ungets(struct gzfile*, const Bytef*, int);
-static void gzfile_ungetbyte(struct gzfile*, int);
-static VALUE gzfile_writer_end_run(VALUE);
-static void gzfile_writer_end(struct gzfile*);
-static VALUE gzfile_reader_end_run(VALUE);
-static void gzfile_reader_end(struct gzfile*);
-static void gzfile_reader_rewind(struct gzfile*);
-static VALUE gzfile_reader_get_unused(struct gzfile*);
-static struct gzfile *get_gzfile(VALUE);
-static VALUE gzfile_ensure_close(VALUE);
-static VALUE rb_gzfile_s_wrap(int, VALUE*, VALUE);
-static VALUE gzfile_s_open(int, VALUE*, VALUE, const char*);
-
-static VALUE rb_gzfile_to_io(VALUE);
-static VALUE rb_gzfile_crc(VALUE);
-static VALUE rb_gzfile_mtime(VALUE);
-static VALUE rb_gzfile_level(VALUE);
-static VALUE rb_gzfile_os_code(VALUE);
-static VALUE rb_gzfile_orig_name(VALUE);
-static VALUE rb_gzfile_comment(VALUE);
-static VALUE rb_gzfile_lineno(VALUE);
-static VALUE rb_gzfile_set_lineno(VALUE, VALUE);
-static VALUE rb_gzfile_set_mtime(VALUE, VALUE);
-static VALUE rb_gzfile_set_orig_name(VALUE, VALUE);
-static VALUE rb_gzfile_set_comment(VALUE, VALUE);
-static VALUE rb_gzfile_close(VALUE);
-static VALUE rb_gzfile_finish(VALUE);
-static VALUE rb_gzfile_closed_p(VALUE);
-static VALUE rb_gzfile_eof_p(VALUE);
-static VALUE rb_gzfile_sync(VALUE);
-static VALUE rb_gzfile_set_sync(VALUE, VALUE);
-static VALUE rb_gzfile_total_in(VALUE);
-static VALUE rb_gzfile_total_out(VALUE);
-static VALUE rb_gzfile_path(VALUE);
-
-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(VALUE, VALUE);
-static VALUE rb_gzwriter_putc(VALUE, VALUE);
-
-static VALUE rb_gzreader_s_allocate(VALUE);
-static VALUE rb_gzreader_s_open(int, VALUE*, VALUE);
-static VALUE rb_gzreader_initialize(int, VALUE*, VALUE);
-static VALUE rb_gzreader_rewind(VALUE);
-static VALUE rb_gzreader_unused(VALUE);
-static VALUE rb_gzreader_read(int, VALUE*, VALUE);
-static VALUE rb_gzreader_getc(VALUE);
-static VALUE rb_gzreader_readchar(VALUE);
-static VALUE rb_gzreader_each_byte(VALUE);
-static VALUE rb_gzreader_ungetc(VALUE, VALUE);
-static VALUE rb_gzreader_ungetbyte(VALUE, VALUE);
-static void gzreader_skip_linebreaks(struct gzfile*);
-static VALUE gzreader_gets(int, VALUE*, VALUE);
-static VALUE rb_gzreader_gets(int, VALUE*, VALUE);
-static VALUE rb_gzreader_readline(int, VALUE*, VALUE);
-static VALUE rb_gzreader_each(int, VALUE*, VALUE);
-static VALUE rb_gzreader_readlines(int, VALUE*, VALUE);
+static void gzfile_mark _((struct gzfile*));
+static void gzfile_free _((struct gzfile*));
+static VALUE gzfile_new _((VALUE, const struct zstream_funcs*, void (*) _((struct gzfile*))));
+static void gzfile_reset _((struct gzfile*));
+static void gzfile_close _((struct gzfile*, int));
+static void gzfile_write_raw _((struct gzfile*));
+static VALUE gzfile_read_raw _((struct gzfile*));
+static int gzfile_read_raw_ensure _((struct gzfile*, int));
+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*));
+static void gzfile_check_footer _((struct gzfile*));
+static void gzfile_write _((struct gzfile*, Bytef*, uInt));
+static long gzfile_read_more _((struct gzfile*));
+static void gzfile_calc_crc _((struct gzfile*, VALUE));
+static VALUE gzfile_read _((struct gzfile*, int));
+static VALUE gzfile_read_all _((struct gzfile*));
+static void gzfile_ungetc _((struct gzfile*, int));
+static VALUE gzfile_writer_end_run _((VALUE));
+static void gzfile_writer_end _((struct gzfile*));
+static VALUE gzfile_reader_end_run _((VALUE));
+static void gzfile_reader_end _((struct gzfile*));
+static void gzfile_reader_rewind _((struct gzfile*));
+static VALUE gzfile_reader_get_unused _((struct gzfile*));
+static struct gzfile *get_gzfile _((VALUE));
+static VALUE gzfile_ensure_close _((VALUE));
+static VALUE rb_gzfile_s_wrap _((int, VALUE*, VALUE));
+static VALUE gzfile_s_open _((int, VALUE*, VALUE, const char*));
+
+static VALUE rb_gzfile_to_io _((VALUE));
+static VALUE rb_gzfile_crc _((VALUE));
+static VALUE rb_gzfile_mtime _((VALUE));
+static VALUE rb_gzfile_level _((VALUE));
+static VALUE rb_gzfile_os_code _((VALUE));
+static VALUE rb_gzfile_orig_name _((VALUE));
+static VALUE rb_gzfile_comment _((VALUE));
+static VALUE rb_gzfile_lineno _((VALUE));
+static VALUE rb_gzfile_set_lineno _((VALUE, VALUE));
+static VALUE rb_gzfile_set_mtime _((VALUE, VALUE));
+static VALUE rb_gzfile_set_orig_name _((VALUE, VALUE));
+static VALUE rb_gzfile_set_comment _((VALUE, VALUE));
+static VALUE rb_gzfile_close _((VALUE));
+static VALUE rb_gzfile_finish _((VALUE));
+static VALUE rb_gzfile_closed_p _((VALUE));
+static VALUE rb_gzfile_eof_p _((VALUE));
+static VALUE rb_gzfile_sync _((VALUE));
+static VALUE rb_gzfile_set_sync _((VALUE, VALUE));
+static VALUE rb_gzfile_total_in _((VALUE));
+static VALUE rb_gzfile_total_out _((VALUE));
+
+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 _((VALUE, VALUE));
+static VALUE rb_gzwriter_putc _((VALUE, VALUE));
+
+static VALUE rb_gzreader_s_allocate _((VALUE));
+static VALUE rb_gzreader_s_open _((int, VALUE*, VALUE));
+static VALUE rb_gzreader_initialize _((VALUE, VALUE));
+static VALUE rb_gzreader_rewind _((VALUE));
+static VALUE rb_gzreader_unused _((VALUE));
+static VALUE rb_gzreader_read _((int, VALUE*, VALUE));
+static VALUE rb_gzreader_getc _((VALUE));
+static VALUE rb_gzreader_readchar _((VALUE));
+static VALUE rb_gzreader_each_byte _((VALUE));
+static VALUE rb_gzreader_ungetc _((VALUE, VALUE));
+static void gzreader_skip_linebreaks _((struct gzfile*));
+static VALUE gzreader_gets _((int, VALUE*, VALUE));
+static VALUE rb_gzreader_gets _((int, VALUE*, VALUE));
+static VALUE rb_gzreader_readline _((int, VALUE*, VALUE));
+static VALUE rb_gzreader_each _((int, VALUE*, VALUE));
+static VALUE rb_gzreader_readlines _((int, VALUE*, VALUE));
#endif /* GZIP_SUPPORT */
-void Init_zlib(void);
+void Init_zlib _((void));
+
-int rb_io_extract_encoding_option(VALUE opt, rb_encoding **enc_p, rb_encoding **enc2_p);
-VALUE rb_str_conv_enc_opts(VALUE, rb_encoding*, rb_encoding*, int, VALUE);
/*--------- Exceptions --------*/
@@ -203,7 +195,9 @@ static VALUE cZError, cStreamEnd, cNeedDict;
static VALUE cStreamError, cDataError, cMemError, cBufError, cVersionError;
static void
-raise_zlib_error(int err, const char *msg)
+raise_zlib_error(err, msg)
+ int err;
+ const char *msg;
{
VALUE exc;
@@ -251,7 +245,8 @@ raise_zlib_error(int err, const char *msg)
/*--- Warning (in finalizer) ---*/
static void
-finalizer_warn(const char *msg)
+finalizer_warn(msg)
+ const char *msg;
{
fprintf(stderr, "zlib(finalizer): %s\n", msg);
}
@@ -263,7 +258,8 @@ finalizer_warn(const char *msg)
* Returns the string which represents the version of zlib library.
*/
static VALUE
-rb_zlib_version(VALUE klass)
+rb_zlib_version(klass)
+ VALUE klass;
{
VALUE str;
@@ -276,7 +272,7 @@ static VALUE
do_checksum(argc, argv, func)
int argc;
VALUE *argv;
- uLong (*func)(uLong, const Bytef*, uInt);
+ uLong (*func) _((uLong, const Bytef *, uInt));
{
VALUE str, vsum;
unsigned long sum;
@@ -298,7 +294,7 @@ do_checksum(argc, argv, func)
}
else {
StringValue(str);
- sum = func(sum, (Bytef*)RSTRING_PTR(str), RSTRING_LEN(str));
+ sum = func(sum, RSTRING(str)->ptr, RSTRING(str)->len);
}
return rb_uint2inum(sum);
}
@@ -313,7 +309,10 @@ do_checksum(argc, argv, func)
* FIXME: expression.
*/
static VALUE
-rb_zlib_adler32(int argc, VALUE *argv, VALUE klass)
+rb_zlib_adler32(argc, argv, klass)
+ int argc;
+ VALUE *argv;
+ VALUE klass;
{
return do_checksum(argc, argv, adler32);
}
@@ -328,7 +327,10 @@ rb_zlib_adler32(int argc, VALUE *argv, VALUE klass)
* FIXME: expression.
*/
static VALUE
-rb_zlib_crc32(int argc, VALUE *argv, VALUE klass)
+rb_zlib_crc32(argc, argv, klass)
+ int argc;
+ VALUE *argv;
+ VALUE klass;
{
return do_checksum(argc, argv, crc32);
}
@@ -337,7 +339,8 @@ rb_zlib_crc32(int argc, VALUE *argv, VALUE klass)
* Returns the table for calculating CRC checksum as an array.
*/
static VALUE
-rb_zlib_crc_table(VALUE obj)
+rb_zlib_crc_table(obj)
+ VALUE obj;
{
const unsigned long *crctbl;
VALUE dst;
@@ -363,9 +366,9 @@ struct zstream {
VALUE input;
z_stream stream;
const struct zstream_funcs {
- int (*reset)(z_streamp);
- int (*end)(z_streamp);
- int (*run)(z_streamp, int);
+ int (*reset) _((z_streamp));
+ int (*end) _((z_streamp));
+ int (*run) _((z_streamp, int));
} *func;
};
@@ -396,19 +399,24 @@ static const struct zstream_funcs inflate_funcs = {
static voidpf
-zlib_mem_alloc(voidpf opaque, uInt items, uInt size)
+zlib_mem_alloc(opaque, items, size)
+ voidpf opaque;
+ uInt items, size;
{
return xmalloc(items * size);
}
static void
-zlib_mem_free(voidpf opaque, voidpf address)
+zlib_mem_free(opaque, address)
+ voidpf opaque, address;
{
- xfree(address);
+ free(address);
}
static void
-zstream_init(struct zstream *z, const struct zstream_funcs *func)
+zstream_init(z, func)
+ struct zstream *z;
+ const struct zstream_funcs *func;
{
z->flags = 0;
z->buf = Qnil;
@@ -429,7 +437,8 @@ zstream_init(struct zstream *z, const struct zstream_funcs *func)
#define zstream_init_inflate(z) zstream_init((z), &inflate_funcs)
static void
-zstream_expand_buffer(struct zstream *z)
+zstream_expand_buffer(z)
+ struct zstream *z;
{
long inc;
@@ -438,13 +447,13 @@ zstream_expand_buffer(struct zstream *z)
rb_str_buf_new makes a zero-length string. */
z->buf = rb_str_new(0, ZSTREAM_INITIAL_BUFSIZE);
z->buf_filled = 0;
- z->stream.next_out = (Bytef*)RSTRING_PTR(z->buf);
+ z->stream.next_out = RSTRING(z->buf)->ptr;
z->stream.avail_out = ZSTREAM_INITIAL_BUFSIZE;
RBASIC(z->buf)->klass = 0;
return;
}
- if (RSTRING_LEN(z->buf) - z->buf_filled >= ZSTREAM_AVAIL_OUT_STEP_MAX) {
+ if (RSTRING(z->buf)->len - z->buf_filled >= ZSTREAM_AVAIL_OUT_STEP_MAX) {
/* to keep other threads from freezing */
z->stream.avail_out = ZSTREAM_AVAIL_OUT_STEP_MAX;
}
@@ -457,42 +466,47 @@ zstream_expand_buffer(struct zstream *z)
z->stream.avail_out = (inc < ZSTREAM_AVAIL_OUT_STEP_MAX) ?
inc : ZSTREAM_AVAIL_OUT_STEP_MAX;
}
- z->stream.next_out = (Bytef*)RSTRING_PTR(z->buf) + z->buf_filled;
+ z->stream.next_out = RSTRING(z->buf)->ptr + z->buf_filled;
}
static void
-zstream_expand_buffer_into(struct zstream *z, int size)
+zstream_expand_buffer_into(z, size)
+ struct zstream *z;
+ int 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_new(0, size);
z->buf_filled = 0;
- z->stream.next_out = (Bytef*)RSTRING_PTR(z->buf);
+ z->stream.next_out = RSTRING(z->buf)->ptr;
z->stream.avail_out = size;
RBASIC(z->buf)->klass = 0;
}
else if (z->stream.avail_out != size) {
rb_str_resize(z->buf, z->buf_filled + size);
- z->stream.next_out = (Bytef*)RSTRING_PTR(z->buf) + z->buf_filled;
+ z->stream.next_out = RSTRING(z->buf)->ptr + z->buf_filled;
z->stream.avail_out = size;
}
}
static void
-zstream_append_buffer(struct zstream *z, const Bytef *src, int len)
+zstream_append_buffer(z, src, len)
+ struct zstream *z;
+ const char *src;
+ int len;
{
if (NIL_P(z->buf)) {
z->buf = rb_str_buf_new(len);
- rb_str_buf_cat(z->buf, (const char*)src, len);
+ rb_str_buf_cat(z->buf, src, len);
z->buf_filled = len;
- z->stream.next_out = (Bytef*)RSTRING_PTR(z->buf);
+ z->stream.next_out = RSTRING(z->buf)->ptr;
z->stream.avail_out = 0;
RBASIC(z->buf)->klass = 0;
return;
}
- if (RSTRING_LEN(z->buf) < z->buf_filled + len) {
+ if (RSTRING(z->buf)->len < z->buf_filled + len) {
rb_str_resize(z->buf, z->buf_filled + len);
z->stream.avail_out = 0;
}
@@ -504,16 +518,17 @@ zstream_append_buffer(struct zstream *z, const Bytef *src, int len)
z->stream.avail_out = 0;
}
}
- memcpy(RSTRING_PTR(z->buf) + z->buf_filled, src, len);
+ memcpy(RSTRING(z->buf)->ptr + z->buf_filled, src, len);
z->buf_filled += len;
- z->stream.next_out = (Bytef*)RSTRING_PTR(z->buf) + z->buf_filled;
+ z->stream.next_out = RSTRING(z->buf)->ptr + z->buf_filled;
}
#define zstream_append_buffer2(z,v) \
- zstream_append_buffer((z),(Bytef*)RSTRING_PTR(v),RSTRING_LEN(v))
+ zstream_append_buffer((z),RSTRING(v)->ptr,RSTRING(v)->len)
static VALUE
-zstream_detach_buffer(struct zstream *z)
+zstream_detach_buffer(z)
+ struct zstream *z;
{
VALUE dst;
@@ -534,7 +549,9 @@ zstream_detach_buffer(struct zstream *z)
}
static VALUE
-zstream_shift_buffer(struct zstream *z, int len)
+zstream_shift_buffer(z, len)
+ struct zstream *z;
+ int len;
{
VALUE dst;
@@ -542,13 +559,13 @@ zstream_shift_buffer(struct zstream *z, int len)
return zstream_detach_buffer(z);
}
- dst = rb_str_subseq(z->buf, 0, len);
+ dst = rb_str_substr(z->buf, 0, len);
RBASIC(dst)->klass = rb_cString;
z->buf_filled -= len;
- memmove(RSTRING_PTR(z->buf), RSTRING_PTR(z->buf) + len,
+ memmove(RSTRING(z->buf)->ptr, RSTRING(z->buf)->ptr + len,
z->buf_filled);
- z->stream.next_out = (Bytef*)RSTRING_PTR(z->buf) + z->buf_filled;
- z->stream.avail_out = RSTRING_LEN(z->buf) - z->buf_filled;
+ z->stream.next_out = RSTRING(z->buf)->ptr + z->buf_filled;
+ z->stream.avail_out = RSTRING(z->buf)->len - z->buf_filled;
if (z->stream.avail_out > ZSTREAM_AVAIL_OUT_STEP_MAX) {
z->stream.avail_out = ZSTREAM_AVAIL_OUT_STEP_MAX;
}
@@ -557,30 +574,16 @@ zstream_shift_buffer(struct zstream *z, int len)
}
static void
-zstream_buffer_ungets(struct zstream *z, const Bytef *b, int len)
-{
- if (NIL_P(z->buf) || RSTRING_LEN(z->buf) - z->buf_filled == 0) {
- zstream_expand_buffer_into(z, 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) {
- z->stream.next_out+=len;
- z->stream.avail_out-=len;
- }
-}
-
-static void
-zstream_buffer_ungetbyte(struct zstream *z, int c)
+zstream_buffer_ungetc(z, c)
+ struct zstream *z;
+ int c;
{
- if (NIL_P(z->buf) || RSTRING_LEN(z->buf) - z->buf_filled == 0) {
+ if (NIL_P(z->buf) || RSTRING(z->buf)->len - 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;
+ memmove(RSTRING(z->buf)->ptr + 1, RSTRING(z->buf)->ptr, z->buf_filled);
+ RSTRING(z->buf)->ptr[0] = (char)c;
z->buf_filled++;
if (z->stream.avail_out > 0) {
z->stream.next_out++;
@@ -589,44 +592,51 @@ zstream_buffer_ungetbyte(struct zstream *z, int c)
}
static void
-zstream_append_input(struct zstream *z, const Bytef *src, unsigned int len)
+zstream_append_input(z, src, len)
+ struct zstream *z;
+ const char *src;
+ unsigned int len;
{
if (len <= 0) return;
if (NIL_P(z->input)) {
z->input = rb_str_buf_new(len);
- rb_str_buf_cat(z->input, (const char*)src, len);
+ rb_str_buf_cat(z->input, src, len);
RBASIC(z->input)->klass = 0;
}
else {
- rb_str_buf_cat(z->input, (const char*)src, len);
+ rb_str_buf_cat(z->input, src, len);
}
}
#define zstream_append_input2(z,v)\
- zstream_append_input((z), (Bytef*)RSTRING_PTR(v), RSTRING_LEN(v))
+ zstream_append_input((z), RSTRING(v)->ptr, RSTRING(v)->len)
static void
-zstream_discard_input(struct zstream *z, unsigned int len)
+zstream_discard_input(z, len)
+ struct zstream *z;
+ unsigned int len;
{
- if (NIL_P(z->input) || RSTRING_LEN(z->input) <= len) {
+ if (NIL_P(z->input) || RSTRING(z->input)->len <= len) {
z->input = Qnil;
}
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);
+ memmove(RSTRING(z->input)->ptr, RSTRING(z->input)->ptr + len,
+ RSTRING(z->input)->len - len);
+ rb_str_resize(z->input, RSTRING(z->input)->len - len);
}
}
static void
-zstream_reset_input(struct zstream *z)
+zstream_reset_input(z)
+ struct zstream *z;
{
z->input = Qnil;
}
static void
-zstream_passthrough_input(struct zstream *z)
+zstream_passthrough_input(z)
+ struct zstream *z;
{
if (!NIL_P(z->input)) {
zstream_append_buffer2(z, z->input);
@@ -635,7 +645,8 @@ zstream_passthrough_input(struct zstream *z)
}
static VALUE
-zstream_detach_input(struct zstream *z)
+zstream_detach_input(z)
+ struct zstream *z;
{
VALUE dst;
@@ -647,12 +658,12 @@ zstream_detach_input(struct zstream *z)
RBASIC(dst)->klass = rb_cString;
}
z->input = Qnil;
- RBASIC(dst)->klass = rb_cString;
return dst;
}
static void
-zstream_reset(struct zstream *z)
+zstream_reset(z)
+ struct zstream *z;
{
int err;
@@ -669,7 +680,8 @@ zstream_reset(struct zstream *z)
}
static VALUE
-zstream_end(struct zstream *z)
+zstream_end(z)
+ struct zstream *z;
{
int err;
@@ -692,20 +704,24 @@ zstream_end(struct zstream *z)
}
static void
-zstream_run(struct zstream *z, Bytef *src, uInt len, int flush)
+zstream_run(z, src, len, flush)
+ struct zstream *z;
+ Bytef *src;
+ uInt len;
+ int flush;
{
uInt n;
int err;
- volatile VALUE guard = Qnil;
+ volatile VALUE guard;
if (NIL_P(z->input) && len == 0) {
- z->stream.next_in = (Bytef*)"";
+ z->stream.next_in = "";
z->stream.avail_in = 0;
}
else {
zstream_append_input(z, src, len);
- z->stream.next_in = (Bytef*)RSTRING_PTR(z->input);
- z->stream.avail_in = RSTRING_LEN(z->input);
+ z->stream.next_in = RSTRING(z->input)->ptr;
+ z->stream.avail_in = RSTRING(z->input)->len;
/* keep reference to `z->input' so as not to be garbage collected
after zstream_reset_input() and prevent `z->stream.next_in'
from dangling. */
@@ -717,9 +733,6 @@ zstream_run(struct zstream *z, Bytef *src, uInt len, int flush)
}
for (;;) {
- /* VC allocates err and guard to same address. accessing err and guard
- in same scope prevents it. */
- RB_GC_GUARD(guard);
n = z->stream.avail_out;
err = z->func->run(&z->stream, flush);
z->buf_filled += n - z->stream.avail_out;
@@ -757,24 +770,27 @@ zstream_run(struct zstream *z, Bytef *src, uInt len, int flush)
}
static VALUE
-zstream_sync(struct zstream *z, Bytef *src, uInt len)
+zstream_sync(z, src, len)
+ struct zstream *z;
+ Bytef *src;
+ uInt len;
{
VALUE rest;
int err;
if (!NIL_P(z->input)) {
- z->stream.next_in = (Bytef*)RSTRING_PTR(z->input);
- z->stream.avail_in = RSTRING_LEN(z->input);
+ z->stream.next_in = RSTRING(z->input)->ptr;
+ z->stream.avail_in = RSTRING(z->input)->len;
err = inflateSync(&z->stream);
if (err == Z_OK) {
zstream_discard_input(z,
- RSTRING_LEN(z->input) - z->stream.avail_in);
+ RSTRING(z->input)->len - z->stream.avail_in);
zstream_append_input(z, src, len);
return Qtrue;
}
zstream_reset_input(z);
if (err != Z_DATA_ERROR) {
- rest = rb_str_new((char*)z->stream.next_in, z->stream.avail_in);
+ rest = rb_str_new(z->stream.next_in, z->stream.avail_in);
raise_zlib_error(err, z->stream.msg);
}
}
@@ -789,21 +805,23 @@ zstream_sync(struct zstream *z, Bytef *src, uInt len)
return Qtrue;
}
if (err != Z_DATA_ERROR) {
- rest = rb_str_new((char*)z->stream.next_in, z->stream.avail_in);
+ rest = rb_str_new(z->stream.next_in, z->stream.avail_in);
raise_zlib_error(err, z->stream.msg);
}
return Qfalse;
}
static void
-zstream_mark(struct zstream *z)
+zstream_mark(z)
+ struct zstream *z;
{
rb_gc_mark(z->buf);
rb_gc_mark(z->input);
}
static void
-zstream_finalize(struct zstream *z)
+zstream_finalize(z)
+ struct zstream *z;
{
int err = z->func->end(&z->stream);
if (err == Z_STREAM_ERROR)
@@ -813,16 +831,19 @@ zstream_finalize(struct zstream *z)
}
static void
-zstream_free(struct zstream *z)
+zstream_free(z)
+ struct zstream *z;
{
if (ZSTREAM_IS_READY(z)) {
zstream_finalize(z);
}
- xfree(z);
+ free(z);
}
static VALUE
-zstream_new(VALUE klass, const struct zstream_funcs *funcs)
+zstream_new(klass, funcs)
+ VALUE klass;
+ const struct zstream_funcs *funcs;
{
VALUE obj;
struct zstream *z;
@@ -837,7 +858,8 @@ zstream_new(VALUE klass, const struct zstream_funcs *funcs)
#define zstream_inflate_new(klass) zstream_new((klass), &inflate_funcs)
static struct zstream *
-get_zstream(VALUE obj)
+get_zstream(obj)
+ VALUE obj;
{
struct zstream *z;
@@ -917,7 +939,8 @@ get_zstream(VALUE obj)
* exception.
*/
static VALUE
-rb_zstream_end(VALUE obj)
+rb_zstream_end(obj)
+ VALUE obj;
{
zstream_end(get_zstream(obj));
return Qnil;
@@ -928,7 +951,8 @@ rb_zstream_end(VALUE obj)
* are discarded.
*/
static VALUE
-rb_zstream_reset(VALUE obj)
+rb_zstream_reset(obj)
+ VALUE obj;
{
zstream_reset(get_zstream(obj));
return Qnil;
@@ -939,12 +963,13 @@ rb_zstream_reset(VALUE obj)
* Zlib::Inflate#finish for details of this behavior.
*/
static VALUE
-rb_zstream_finish(VALUE obj)
+rb_zstream_finish(obj)
+ VALUE obj;
{
struct zstream *z = get_zstream(obj);
VALUE dst;
- zstream_run(z, (Bytef*)"", 0, Z_FINISH);
+ zstream_run(z, "", 0, Z_FINISH);
dst = zstream_detach_buffer(z);
OBJ_INFECT(dst, obj);
@@ -955,7 +980,8 @@ rb_zstream_finish(VALUE obj)
* Flushes input buffer and returns all data in that buffer.
*/
static VALUE
-rb_zstream_flush_next_in(VALUE obj)
+rb_zstream_flush_next_in(obj)
+ VALUE obj;
{
struct zstream *z;
VALUE dst;
@@ -970,7 +996,8 @@ rb_zstream_flush_next_in(VALUE obj)
* Flushes output buffer and returns all data in that buffer.
*/
static VALUE
-rb_zstream_flush_next_out(VALUE obj)
+rb_zstream_flush_next_out(obj)
+ VALUE obj;
{
struct zstream *z;
VALUE dst;
@@ -986,7 +1013,8 @@ rb_zstream_flush_next_out(VALUE obj)
* space is allocated automatically, this method returns 0 normally.
*/
static VALUE
-rb_zstream_avail_out(VALUE obj)
+rb_zstream_avail_out(obj)
+ VALUE obj;
{
struct zstream *z;
Data_Get_Struct(obj, struct zstream, z);
@@ -1000,7 +1028,8 @@ rb_zstream_avail_out(VALUE obj)
* method.
*/
static VALUE
-rb_zstream_set_avail_out(VALUE obj, VALUE size)
+rb_zstream_set_avail_out(obj, size)
+ VALUE obj, size;
{
struct zstream *z = get_zstream(obj);
@@ -1013,18 +1042,20 @@ rb_zstream_set_avail_out(VALUE obj, VALUE size)
* Returns bytes of data in the input buffer. Normally, returns 0.
*/
static VALUE
-rb_zstream_avail_in(VALUE obj)
+rb_zstream_avail_in(obj)
+ VALUE obj;
{
struct zstream *z;
Data_Get_Struct(obj, struct zstream, z);
- return INT2FIX(NIL_P(z->input) ? 0 : (int)(RSTRING_LEN(z->input)));
+ return INT2FIX(NIL_P(z->input) ? 0 : (int)(RSTRING(z->input)->len));
}
/*
* Returns the total bytes of the input data to the stream. FIXME
*/
static VALUE
-rb_zstream_total_in(VALUE obj)
+rb_zstream_total_in(obj)
+ VALUE obj;
{
return rb_uint2inum(get_zstream(obj)->stream.total_in);
}
@@ -1033,7 +1064,8 @@ rb_zstream_total_in(VALUE obj)
* Returns the total bytes of the output data from the stream. FIXME
*/
static VALUE
-rb_zstream_total_out(VALUE obj)
+rb_zstream_total_out(obj)
+ VALUE obj;
{
return rb_uint2inum(get_zstream(obj)->stream.total_out);
}
@@ -1044,7 +1076,8 @@ rb_zstream_total_out(VALUE obj)
* <tt>Zlib::UNKNOWN</tt>.
*/
static VALUE
-rb_zstream_data_type(VALUE obj)
+rb_zstream_data_type(obj)
+ VALUE obj;
{
return INT2FIX(get_zstream(obj)->stream.data_type);
}
@@ -1053,7 +1086,8 @@ rb_zstream_data_type(VALUE obj)
* Returns the adler-32 checksum.
*/
static VALUE
-rb_zstream_adler(VALUE obj)
+rb_zstream_adler(obj)
+ VALUE obj;
{
return rb_uint2inum(get_zstream(obj)->stream.adler);
}
@@ -1062,7 +1096,8 @@ rb_zstream_adler(VALUE obj)
* Returns true if the stream is finished.
*/
static VALUE
-rb_zstream_finished_p(VALUE obj)
+rb_zstream_finished_p(obj)
+ VALUE obj;
{
return ZSTREAM_IS_FINISHED(get_zstream(obj)) ? Qtrue : Qfalse;
}
@@ -1071,7 +1106,8 @@ rb_zstream_finished_p(VALUE obj)
* Returns true if the stream is closed.
*/
static VALUE
-rb_zstream_closed_p(VALUE obj)
+rb_zstream_closed_p(obj)
+ VALUE obj;
{
struct zstream *z;
Data_Get_Struct(obj, struct zstream, z);
@@ -1100,7 +1136,8 @@ rb_zstream_closed_p(VALUE obj)
static VALUE
-rb_deflate_s_allocate(VALUE klass)
+rb_deflate_s_allocate(klass)
+ VALUE klass;
{
return zstream_deflate_new(klass);
}
@@ -1115,7 +1152,10 @@ rb_deflate_s_allocate(VALUE klass)
* TODO: document better!
*/
static VALUE
-rb_deflate_initialize(int argc, VALUE *argv, VALUE obj)
+rb_deflate_initialize(argc, argv, obj)
+ int argc;
+ VALUE *argv;
+ VALUE obj;
{
struct zstream *z;
VALUE level, wbits, memlevel, strategy;
@@ -1139,7 +1179,8 @@ rb_deflate_initialize(int argc, VALUE *argv, VALUE obj)
* Duplicates the deflate stream.
*/
static VALUE
-rb_deflate_init_copy(VALUE self, VALUE orig)
+rb_deflate_init_copy(self, orig)
+ VALUE self, orig;
{
struct zstream *z1, *z2;
int err;
@@ -1160,12 +1201,13 @@ rb_deflate_init_copy(VALUE self, VALUE orig)
}
static VALUE
-deflate_run(VALUE args)
+deflate_run(args)
+ VALUE args;
{
- struct zstream *z = (struct zstream*)((VALUE*)args)[0];
- VALUE src = ((VALUE*)args)[1];
+ struct zstream *z = (struct zstream *)((VALUE *)args)[0];
+ VALUE src = ((VALUE *)args)[1];
- zstream_run(z, (Bytef*)RSTRING_PTR(src), RSTRING_LEN(src), Z_FINISH);
+ zstream_run(z, RSTRING(src)->ptr, RSTRING(src)->len, Z_FINISH);
return zstream_detach_buffer(z);
}
@@ -1190,7 +1232,10 @@ deflate_run(VALUE args)
*
*/
static VALUE
-rb_deflate_s_deflate(int argc, VALUE *argv, VALUE klass)
+rb_deflate_s_deflate(argc, argv, klass)
+ int argc;
+ VALUE *argv;
+ VALUE klass;
{
struct zstream z;
VALUE src, level, dst, args[2];
@@ -1216,15 +1261,18 @@ rb_deflate_s_deflate(int argc, VALUE *argv, VALUE klass)
}
static void
-do_deflate(struct zstream *z, VALUE src, int flush)
+do_deflate(z, src, flush)
+ struct zstream *z;
+ VALUE src;
+ int flush;
{
if (NIL_P(src)) {
- zstream_run(z, (Bytef*)"", 0, Z_FINISH);
+ zstream_run(z, "", 0, Z_FINISH);
return;
}
StringValue(src);
- if (flush != Z_NO_FLUSH || RSTRING_LEN(src) > 0) { /* prevent BUF_ERROR */
- zstream_run(z, (Bytef*)RSTRING_PTR(src), RSTRING_LEN(src), flush);
+ if (flush != Z_NO_FLUSH || RSTRING(src)->len > 0) { /* prevent BUF_ERROR */
+ zstream_run(z, RSTRING(src)->ptr, RSTRING(src)->len, flush);
}
}
@@ -1243,7 +1291,10 @@ do_deflate(struct zstream *z, VALUE src, int flush)
* TODO: document better!
*/
static VALUE
-rb_deflate_deflate(int argc, VALUE *argv, VALUE obj)
+rb_deflate_deflate(argc, argv, obj)
+ int argc;
+ VALUE *argv;
+ VALUE obj;
{
struct zstream *z = get_zstream(obj);
VALUE src, flush, dst;
@@ -1265,7 +1316,8 @@ rb_deflate_deflate(int argc, VALUE *argv, VALUE obj)
* preserved in output buffer.
*/
static VALUE
-rb_deflate_addstr(VALUE obj, VALUE src)
+rb_deflate_addstr(obj, src)
+ VALUE obj, src;
{
OBJ_INFECT(obj, src);
do_deflate(get_zstream(obj), src, Z_NO_FLUSH);
@@ -1282,7 +1334,10 @@ rb_deflate_addstr(VALUE obj, VALUE src)
* TODO: document better!
*/
static VALUE
-rb_deflate_flush(int argc, VALUE *argv, VALUE obj)
+rb_deflate_flush(argc, argv, obj)
+ int argc;
+ VALUE *argv;
+ VALUE obj;
{
struct zstream *z = get_zstream(obj);
VALUE v_flush, dst;
@@ -1291,7 +1346,7 @@ rb_deflate_flush(int argc, VALUE *argv, VALUE obj)
rb_scan_args(argc, argv, "01", &v_flush);
flush = FIXNUMARG(v_flush, Z_SYNC_FLUSH);
if (flush != Z_NO_FLUSH) { /* prevent Z_BUF_ERROR */
- zstream_run(z, (Bytef*)"", 0, flush);
+ zstream_run(z, "", 0, flush);
}
dst = zstream_detach_buffer(z);
@@ -1309,7 +1364,8 @@ rb_deflate_flush(int argc, VALUE *argv, VALUE obj)
* TODO: document better!
*/
static VALUE
-rb_deflate_params(VALUE obj, VALUE v_level, VALUE v_strategy)
+rb_deflate_params(obj, v_level, v_strategy)
+ VALUE obj, v_level, v_strategy;
{
struct zstream *z = get_zstream(obj);
int level, strategy;
@@ -1318,7 +1374,6 @@ rb_deflate_params(VALUE obj, VALUE v_level, VALUE v_strategy)
level = ARG_LEVEL(v_level);
strategy = ARG_STRATEGY(v_strategy);
- zstream_run(z, (Bytef*)"", 0, Z_SYNC_FLUSH);
err = deflateParams(&z->stream, level, strategy);
while (err == Z_BUF_ERROR) {
rb_warning("deflateParams() returned Z_BUF_ERROR");
@@ -1342,7 +1397,8 @@ rb_deflate_params(VALUE obj, VALUE v_level, VALUE v_strategy)
* TODO: document better!
*/
static VALUE
-rb_deflate_set_dictionary(VALUE obj, VALUE dic)
+rb_deflate_set_dictionary(obj, dic)
+ VALUE obj, dic;
{
struct zstream *z = get_zstream(obj);
VALUE src = dic;
@@ -1351,7 +1407,7 @@ rb_deflate_set_dictionary(VALUE obj, VALUE dic)
OBJ_INFECT(obj, dic);
StringValue(src);
err = deflateSetDictionary(&z->stream,
- (Bytef*)RSTRING_PTR(src), RSTRING_LEN(src));
+ RSTRING(src)->ptr, RSTRING(src)->len);
if (err != Z_OK) {
raise_zlib_error(err, z->stream.msg);
}
@@ -1373,7 +1429,8 @@ rb_deflate_set_dictionary(VALUE obj, VALUE dic)
static VALUE
-rb_inflate_s_allocate(VALUE klass)
+rb_inflate_s_allocate(klass)
+ VALUE klass;
{
return zstream_inflate_new(klass);
}
@@ -1387,7 +1444,10 @@ rb_inflate_s_allocate(VALUE klass)
* TODO: document better!
*/
static VALUE
-rb_inflate_initialize(int argc, VALUE *argv, VALUE obj)
+rb_inflate_initialize(argc, argv, obj)
+ int argc;
+ VALUE *argv;
+ VALUE obj;
{
struct zstream *z;
VALUE wbits;
@@ -1406,13 +1466,14 @@ rb_inflate_initialize(int argc, VALUE *argv, VALUE obj)
}
static VALUE
-inflate_run(VALUE args)
+inflate_run(args)
+ VALUE args;
{
- struct zstream *z = (struct zstream*)((VALUE*)args)[0];
- VALUE src = ((VALUE*)args)[1];
+ struct zstream *z = (struct zstream *)((VALUE *)args)[0];
+ VALUE src = ((VALUE *)args)[1];
- zstream_run(z, (Bytef*)RSTRING_PTR(src), RSTRING_LEN(src), Z_SYNC_FLUSH);
- zstream_run(z, (Bytef*)"", 0, Z_FINISH); /* for checking errors */
+ zstream_run(z, RSTRING(src)->ptr, RSTRING(src)->len, Z_SYNC_FLUSH);
+ zstream_run(z, "", 0, Z_FINISH); /* for checking errors */
return zstream_detach_buffer(z);
}
@@ -1434,7 +1495,8 @@ inflate_run(VALUE args)
*
*/
static VALUE
-rb_inflate_s_inflate(VALUE obj, VALUE src)
+rb_inflate_s_inflate(obj, src)
+ VALUE obj, src;
{
struct zstream z;
VALUE dst, args[2];
@@ -1457,15 +1519,17 @@ rb_inflate_s_inflate(VALUE obj, VALUE src)
}
static void
-do_inflate(struct zstream *z, VALUE src)
+do_inflate(z, src)
+ struct zstream *z;
+ VALUE src;
{
if (NIL_P(src)) {
- zstream_run(z, (Bytef*)"", 0, Z_FINISH);
+ zstream_run(z, "", 0, Z_FINISH);
return;
}
StringValue(src);
- if (RSTRING_LEN(src) > 0) { /* prevent Z_BUF_ERROR */
- zstream_run(z, (Bytef*)RSTRING_PTR(src), RSTRING_LEN(src), Z_SYNC_FLUSH);
+ if (RSTRING(src)->len > 0) { /* prevent Z_BUF_ERROR */
+ zstream_run(z, RSTRING(src)->ptr, RSTRING(src)->len, Z_SYNC_FLUSH);
}
}
@@ -1484,7 +1548,8 @@ do_inflate(struct zstream *z, VALUE src)
* TODO: document better!
*/
static VALUE
-rb_inflate_inflate(VALUE obj, VALUE src)
+rb_inflate_inflate(obj, src)
+ VALUE obj, src;
{
struct zstream *z = get_zstream(obj);
VALUE dst;
@@ -1521,7 +1586,8 @@ rb_inflate_inflate(VALUE obj, VALUE src)
* preserved in output buffer.
*/
static VALUE
-rb_inflate_addstr(VALUE obj, VALUE src)
+rb_inflate_addstr(obj, src)
+ VALUE obj, src;
{
struct zstream *z = get_zstream(obj);
@@ -1552,13 +1618,14 @@ rb_inflate_addstr(VALUE obj, VALUE src)
* following data of full flush point is preserved in the buffer.
*/
static VALUE
-rb_inflate_sync(VALUE obj, VALUE src)
+rb_inflate_sync(obj, src)
+ VALUE obj, src;
{
struct zstream *z = get_zstream(obj);
OBJ_INFECT(obj, src);
StringValue(src);
- return zstream_sync(z, (Bytef*)RSTRING_PTR(src), RSTRING_LEN(src));
+ return zstream_sync(z, RSTRING(src)->ptr, RSTRING(src)->len);
}
/*
@@ -1569,7 +1636,8 @@ rb_inflate_sync(VALUE obj, VALUE src)
* <tt>:)</tt>
*/
static VALUE
-rb_inflate_sync_point_p(VALUE obj)
+rb_inflate_sync_point_p(obj)
+ VALUE obj;
{
struct zstream *z = get_zstream(obj);
int err;
@@ -1591,7 +1659,8 @@ rb_inflate_sync_point_p(VALUE obj)
* TODO: document better!
*/
static VALUE
-rb_inflate_set_dictionary(VALUE obj, VALUE dic)
+rb_inflate_set_dictionary(obj, dic)
+ VALUE obj, dic;
{
struct zstream *z = get_zstream(obj);
VALUE src = dic;
@@ -1600,7 +1669,7 @@ rb_inflate_set_dictionary(VALUE obj, VALUE dic)
OBJ_INFECT(obj, dic);
StringValue(src);
err = inflateSetDictionary(&z->stream,
- (Bytef*)RSTRING_PTR(src), RSTRING_LEN(src));
+ RSTRING(src)->ptr, RSTRING(src)->len);
if (err != Z_OK) {
raise_zlib_error(err, z->stream.msg);
}
@@ -1654,7 +1723,7 @@ rb_inflate_set_dictionary(VALUE obj, VALUE dic)
#define OS_CODE OS_UNIX
#endif
-static ID id_write, id_read, id_readpartial, id_flush, id_seek, id_close, id_path;
+static ID id_write, id_read, id_flush, id_seek, id_close;
static VALUE cGzError, cNoFooter, cCRCError, cLengthError;
@@ -1673,15 +1742,7 @@ struct gzfile {
int lineno;
int ungetc;
void (*end)(struct gzfile *);
- rb_encoding *enc;
- rb_encoding *enc2;
- rb_econv_t *ec;
- int ecflags;
- VALUE ecopts;
- char *cbuf;
- VALUE path;
};
-#define GZFILE_CBUF_CAPA 10
#define GZFILE_FLAG_SYNC ZSTREAM_FLAG_UNUSED
#define GZFILE_FLAG_HEADER_FINISHED (ZSTREAM_FLAG_UNUSED << 1)
@@ -1694,18 +1755,18 @@ struct gzfile {
static void
-gzfile_mark(struct gzfile *gz)
+gzfile_mark(gz)
+ struct gzfile *gz;
{
rb_gc_mark(gz->io);
rb_gc_mark(gz->orig_name);
rb_gc_mark(gz->comment);
zstream_mark(&gz->z);
- rb_gc_mark(gz->ecopts);
- rb_gc_mark(gz->path);
}
static void
-gzfile_free(struct gzfile *gz)
+gzfile_free(gz)
+ struct gzfile *gz;
{
struct zstream *z = &gz->z;
@@ -1715,17 +1776,14 @@ gzfile_free(struct gzfile *gz)
}
zstream_finalize(z);
}
- if (gz->cbuf) {
- xfree(gz->cbuf);
- }
- xfree(gz);
+ free(gz);
}
static VALUE
gzfile_new(klass, funcs, endfunc)
VALUE klass;
const struct zstream_funcs *funcs;
- void (*endfunc)(struct gzfile *);
+ void (*endfunc) _((struct gzfile *));
{
VALUE obj;
struct gzfile *gz;
@@ -1742,13 +1800,6 @@ gzfile_new(klass, funcs, endfunc)
gz->lineno = 0;
gz->ungetc = 0;
gz->end = endfunc;
- gz->enc = rb_default_external_encoding();
- gz->enc2 = 0;
- gz->ec = NULL;
- gz->ecflags = 0;
- gz->ecopts = Qnil;
- gz->cbuf = 0;
- gz->path = Qnil;
return obj;
}
@@ -1757,21 +1808,19 @@ gzfile_new(klass, funcs, endfunc)
#define gzfile_reader_new(gz) gzfile_new((gz),&inflate_funcs,gzfile_reader_end)
static void
-gzfile_reset(struct gzfile *gz)
+gzfile_reset(gz)
+ struct gzfile *gz;
{
zstream_reset(&gz->z);
gz->crc = crc32(0, Z_NULL, 0);
gz->lineno = 0;
gz->ungetc = 0;
- if (gz->ec) {
- rb_econv_close(gz->ec);
- gz->ec = rb_econv_open_opts(gz->enc2->name, gz->enc->name,
- gz->ecflags, gz->ecopts);
- }
}
static void
-gzfile_close(struct gzfile *gz, int closeflag)
+gzfile_close(gz, closeflag)
+ struct gzfile *gz;
+ int closeflag;
{
VALUE io = gz->io;
@@ -1785,7 +1834,8 @@ gzfile_close(struct gzfile *gz, int closeflag)
}
static void
-gzfile_write_raw(struct gzfile *gz)
+gzfile_write_raw(gz)
+ struct gzfile *gz;
{
VALUE str;
@@ -1800,44 +1850,26 @@ gzfile_write_raw(struct gzfile *gz)
}
static VALUE
-gzfile_read_raw_partial(VALUE arg)
+gzfile_read_raw(gz)
+ struct gzfile *gz;
{
- struct gzfile *gz = (struct gzfile*)arg;
VALUE str;
- 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)
-{
- struct gzfile *gz = (struct gzfile*)arg;
- VALUE str = Qnil;
- if (rb_obj_is_kind_of(rb_errinfo(), rb_eNoMethodError)) {
- str = rb_funcall(gz->io, id_read, 1, INT2FIX(GZFILE_READ_SIZE));
- if (!NIL_P(str)) {
- Check_Type(str, T_STRING);
- }
+ str = rb_funcall(gz->io, id_read, 1, INT2FIX(GZFILE_READ_SIZE));
+ if (!NIL_P(str)) {
+ Check_Type(str, T_STRING);
}
- return str; /* return nil when EOFError */
-}
-
-static VALUE
-gzfile_read_raw(struct gzfile *gz)
-{
- return rb_rescue2(gzfile_read_raw_partial, (VALUE)gz,
- gzfile_read_raw_rescue, (VALUE)gz,
- rb_eEOFError, rb_eNoMethodError, (VALUE)0);
+ return str;
}
static int
-gzfile_read_raw_ensure(struct gzfile *gz, int size)
+gzfile_read_raw_ensure(gz, size)
+ struct gzfile *gz;
+ int size;
{
VALUE str;
- while (NIL_P(gz->z.input) || RSTRING_LEN(gz->z.input) < size) {
+ while (NIL_P(gz->z.input) || RSTRING(gz->z.input)->len < size) {
str = gzfile_read_raw(gz);
if (NIL_P(str)) return Qfalse;
zstream_append_input2(&gz->z, str);
@@ -1846,27 +1878,30 @@ gzfile_read_raw_ensure(struct gzfile *gz, int size)
}
static char *
-gzfile_read_raw_until_zero(struct gzfile *gz, long offset)
+gzfile_read_raw_until_zero(gz, offset)
+ struct gzfile *gz;
+ long offset;
{
VALUE str;
char *p;
for (;;) {
- p = memchr(RSTRING_PTR(gz->z.input) + offset, '\0',
- RSTRING_LEN(gz->z.input) - offset);
+ p = memchr(RSTRING(gz->z.input)->ptr + offset, '\0',
+ RSTRING(gz->z.input)->len - offset);
if (p) break;
str = gzfile_read_raw(gz);
if (NIL_P(str)) {
rb_raise(cGzError, "unexpected end of file");
}
- offset = RSTRING_LEN(gz->z.input);
+ offset = RSTRING(gz->z.input)->len;
zstream_append_input2(&gz->z, str);
}
return p;
}
static unsigned int
-gzfile_get16(const unsigned char *src)
+gzfile_get16(src)
+ const unsigned char *src;
{
unsigned int n;
n = *(src++) & 0xff;
@@ -1875,7 +1910,8 @@ gzfile_get16(const unsigned char *src)
}
static unsigned long
-gzfile_get32(const unsigned char *src)
+gzfile_get32(src)
+ const unsigned char *src;
{
unsigned long n;
n = *(src++) & 0xff;
@@ -1886,7 +1922,9 @@ gzfile_get32(const unsigned char *src)
}
static void
-gzfile_set32(unsigned long n, unsigned char *dst)
+gzfile_set32(n, dst)
+ unsigned long n;
+ unsigned char *dst;
{
*(dst++) = n & 0xff;
*(dst++) = (n >> 8) & 0xff;
@@ -1895,9 +1933,10 @@ gzfile_set32(unsigned long n, unsigned char *dst)
}
static void
-gzfile_make_header(struct gzfile *gz)
+gzfile_make_header(gz)
+ struct gzfile *gz;
{
- Bytef buf[10]; /* the size of gzip header */
+ unsigned char buf[10]; /* the size of gzip header */
unsigned char flags = 0, extraflags = 0;
if (!NIL_P(gz->orig_name)) {
@@ -1928,20 +1967,21 @@ gzfile_make_header(struct gzfile *gz)
if (!NIL_P(gz->orig_name)) {
zstream_append_buffer2(&gz->z, gz->orig_name);
- zstream_append_buffer(&gz->z, (Bytef*)"\0", 1);
+ zstream_append_buffer(&gz->z, "\0", 1);
}
if (!NIL_P(gz->comment)) {
zstream_append_buffer2(&gz->z, gz->comment);
- zstream_append_buffer(&gz->z, (Bytef*)"\0", 1);
+ zstream_append_buffer(&gz->z, "\0", 1);
}
gz->z.flags |= GZFILE_FLAG_HEADER_FINISHED;
}
static void
-gzfile_make_footer(struct gzfile *gz)
+gzfile_make_footer(gz)
+ struct gzfile *gz;
{
- Bytef buf[8]; /* 8 is the size of gzip footer */
+ unsigned char buf[8]; /* 8 is the size of gzip footer */
gzfile_set32(gz->crc, buf);
gzfile_set32(gz->z.stream.total_in, &buf[4]);
@@ -1950,7 +1990,8 @@ gzfile_make_footer(struct gzfile *gz)
}
static void
-gzfile_read_header(struct gzfile *gz)
+gzfile_read_header(gz)
+ struct gzfile *gz;
{
const unsigned char *head;
long len;
@@ -1960,7 +2001,7 @@ gzfile_read_header(struct gzfile *gz)
rb_raise(cGzError, "not in gzip format");
}
- head = (unsigned char*)RSTRING_PTR(gz->z.input);
+ head = RSTRING(gz->z.input)->ptr;
if (head[0] != GZ_MAGIC1 || head[1] != GZ_MAGIC2) {
rb_raise(cGzError, "not in gzip format");
@@ -1998,7 +2039,7 @@ gzfile_read_header(struct gzfile *gz)
if (!gzfile_read_raw_ensure(gz, 2)) {
rb_raise(cGzError, "unexpected end of file");
}
- len = gzfile_get16((Bytef*)RSTRING_PTR(gz->z.input));
+ len = gzfile_get16(RSTRING(gz->z.input)->ptr);
if (!gzfile_read_raw_ensure(gz, 2 + len)) {
rb_raise(cGzError, "unexpected end of file");
}
@@ -2006,26 +2047,27 @@ gzfile_read_header(struct gzfile *gz)
}
if (flags & GZ_FLAG_ORIG_NAME) {
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);
+ len = p - RSTRING(gz->z.input)->ptr;
+ gz->orig_name = rb_str_new(RSTRING(gz->z.input)->ptr, len);
OBJ_TAINT(gz->orig_name); /* for safe */
zstream_discard_input(&gz->z, len + 1);
}
if (flags & GZ_FLAG_COMMENT) {
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);
+ len = p - RSTRING(gz->z.input)->ptr;
+ gz->comment = rb_str_new(RSTRING(gz->z.input)->ptr, len);
OBJ_TAINT(gz->comment); /* for safe */
zstream_discard_input(&gz->z, len + 1);
}
- if (gz->z.input != Qnil && RSTRING_LEN(gz->z.input) > 0) {
+ if (gz->z.input != Qnil && RSTRING(gz->z.input)->len > 0) {
zstream_run(&gz->z, 0, 0, Z_SYNC_FLUSH);
}
}
static void
-gzfile_check_footer(struct gzfile *gz)
+gzfile_check_footer(gz)
+ struct gzfile *gz;
{
unsigned long crc, length;
@@ -2035,8 +2077,8 @@ gzfile_check_footer(struct gzfile *gz)
rb_raise(cNoFooter, "footer is not found");
}
- crc = gzfile_get32((Bytef*)RSTRING_PTR(gz->z.input));
- length = gzfile_get32((Bytef*)RSTRING_PTR(gz->z.input) + 4);
+ crc = gzfile_get32(RSTRING(gz->z.input)->ptr);
+ length = gzfile_get32(RSTRING(gz->z.input)->ptr + 4);
gz->z.stream.total_in += 8; /* to rewind correctly */
zstream_discard_input(&gz->z, 8);
@@ -2050,7 +2092,10 @@ gzfile_check_footer(struct gzfile *gz)
}
static void
-gzfile_write(struct gzfile *gz, Bytef *str, uInt len)
+gzfile_write(gz, str, len)
+ struct gzfile *gz;
+ Bytef *str;
+ uInt len;
{
if (!(gz->z.flags & GZFILE_FLAG_HEADER_FINISHED)) {
gzfile_make_header(gz);
@@ -2065,7 +2110,8 @@ gzfile_write(struct gzfile *gz, Bytef *str, uInt len)
}
static long
-gzfile_read_more(struct gzfile *gz)
+gzfile_read_more(gz)
+ struct gzfile *gz;
{
volatile VALUE str;
@@ -2077,8 +2123,8 @@ gzfile_read_more(struct gzfile *gz)
}
break;
}
- if (RSTRING_LEN(str) > 0) { /* prevent Z_BUF_ERROR */
- zstream_run(&gz->z, (Bytef*)RSTRING_PTR(str), RSTRING_LEN(str),
+ if (RSTRING(str)->len > 0) { /* prevent Z_BUF_ERROR */
+ zstream_run(&gz->z, RSTRING(str)->ptr, RSTRING(str)->len,
Z_SYNC_FLUSH);
}
if (gz->z.buf_filled > 0) break;
@@ -2087,38 +2133,24 @@ gzfile_read_more(struct gzfile *gz)
}
static void
-gzfile_calc_crc(struct gzfile *gz, VALUE str)
+gzfile_calc_crc(gz, str)
+ struct gzfile *gz;
+ VALUE str;
{
- if (RSTRING_LEN(str) <= gz->ungetc) {
- gz->ungetc -= RSTRING_LEN(str);
+ if (RSTRING(str)->len <= gz->ungetc) {
+ gz->ungetc -= RSTRING(str)->len;
}
else {
- gz->crc = crc32(gz->crc, (Bytef*)RSTRING_PTR(str) + gz->ungetc,
- RSTRING_LEN(str) - gz->ungetc);
+ gz->crc = crc32(gz->crc, RSTRING(str)->ptr + gz->ungetc,
+ RSTRING(str)->len - gz->ungetc);
gz->ungetc = 0;
}
}
static VALUE
-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,
- gz->ecflags, gz->ecopts);
-}
-
-static VALUE
-gzfile_read(struct gzfile *gz, int len)
+gzfile_read(gz, len)
+ struct gzfile *gz;
+ int len;
{
VALUE dst;
@@ -2138,54 +2170,14 @@ gzfile_read(struct gzfile *gz, int len)
dst = zstream_shift_buffer(&gz->z, len);
gzfile_calc_crc(gz, dst);
- return dst;
-}
-
-static VALUE
-gzfile_readpartial(struct gzfile *gz, int len, VALUE outbuf)
-{
- VALUE dst;
- if (len < 0)
- rb_raise(rb_eArgError, "negative length %d given", len);
-
- if (!NIL_P(outbuf))
- OBJ_TAINT(outbuf);
-
- if (len == 0) {
- if (NIL_P(outbuf))
- return rb_str_new(0, 0);
- else {
- rb_str_resize(outbuf, 0);
- return 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);
- }
- if (!NIL_P(outbuf))
- rb_str_resize(outbuf, 0);
- rb_raise(rb_eEOFError, "end of file reached");
- }
-
- dst = zstream_shift_buffer(&gz->z, len);
- gzfile_calc_crc(gz, dst);
-
- if (!NIL_P(outbuf)) {
- rb_str_resize(outbuf, RSTRING_LEN(dst));
- memcpy(RSTRING_PTR(outbuf), RSTRING_PTR(dst), RSTRING_LEN(dst));
- dst = outbuf;
- }
OBJ_TAINT(dst); /* for safe */
return dst;
}
static VALUE
-gzfile_read_all(struct gzfile *gz)
+gzfile_read_all(gz)
+ struct gzfile *gz;
{
VALUE dst;
@@ -2201,72 +2193,23 @@ gzfile_read_all(struct gzfile *gz)
dst = zstream_detach_buffer(&gz->z);
gzfile_calc_crc(gz, dst);
- OBJ_TAINT(dst);
- return dst;
-}
-
-static VALUE
-gzfile_getc(struct gzfile *gz)
-{
- VALUE buf, dst = 0;
- int len;
-
- len = rb_enc_mbmaxlen(gz->enc);
- 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);
- }
- return Qnil;
- }
- if (gz->ec && rb_enc_dummy_p(gz->enc2)) {
- const unsigned char *ss, *sp, *se;
- unsigned char *ds, *dp, *de;
- rb_econv_result_t res;
-
- if (!gz->cbuf) {
- gz->cbuf = ALLOC_N(char, GZFILE_CBUF_CAPA);
- }
- ss = sp = (const unsigned char*)RSTRING_PTR(gz->z.buf);
- se = sp + gz->z.buf_filled;
- ds = dp = (unsigned char *)gz->cbuf;
- de = (unsigned char *)ds + GZFILE_CBUF_CAPA;
- res = rb_econv_convert(gz->ec, &sp, se, &dp, de, ECONV_PARTIAL_INPUT|ECONV_AFTER_OUTPUT);
- rb_econv_check_error(gz->ec);
- dst = zstream_shift_buffer(&gz->z, sp - ss);
- gzfile_calc_crc(gz, dst);
- dst = rb_str_new(gz->cbuf, dp - ds);
- rb_enc_associate(dst, gz->enc);
- OBJ_TAINT(dst);
- return dst;
- }
- else {
- buf = gz->z.buf;
- len = rb_enc_mbclen(RSTRING_PTR(buf), RSTRING_END(buf), gz->enc);
- dst = gzfile_read(gz, len);
- return gzfile_newstr(gz, dst);
- }
-}
-
-static void
-gzfile_ungets(struct gzfile *gz, const Bytef *b, int len)
-{
- zstream_buffer_ungets(&gz->z, b, len);
- gz->ungetc+=len;
+ OBJ_TAINT(dst); /* for safe */
+ return dst;
}
static void
-gzfile_ungetbyte(struct gzfile *gz, int c)
+gzfile_ungetc(gz, c)
+ struct gzfile *gz;
+ int c;
{
- zstream_buffer_ungetbyte(&gz->z, c);
+ zstream_buffer_ungetc(&gz->z, c);
gz->ungetc++;
}
static VALUE
-gzfile_writer_end_run(VALUE arg)
+gzfile_writer_end_run(arg)
+ VALUE arg;
{
struct gzfile *gz = (struct gzfile *)arg;
@@ -2274,7 +2217,7 @@ gzfile_writer_end_run(VALUE arg)
gzfile_make_header(gz);
}
- zstream_run(&gz->z, (Bytef*)"", 0, Z_FINISH);
+ zstream_run(&gz->z, "", 0, Z_FINISH);
gzfile_make_footer(gz);
gzfile_write_raw(gz);
@@ -2282,7 +2225,8 @@ gzfile_writer_end_run(VALUE arg)
}
static void
-gzfile_writer_end(struct gzfile *gz)
+gzfile_writer_end(gz)
+ struct gzfile *gz;
{
if (ZSTREAM_IS_CLOSING(&gz->z)) return;
gz->z.flags |= ZSTREAM_FLAG_CLOSING;
@@ -2291,7 +2235,8 @@ gzfile_writer_end(struct gzfile *gz)
}
static VALUE
-gzfile_reader_end_run(VALUE arg)
+gzfile_reader_end_run(arg)
+ VALUE arg;
{
struct gzfile *gz = (struct gzfile *)arg;
@@ -2304,7 +2249,8 @@ gzfile_reader_end_run(VALUE arg)
}
static void
-gzfile_reader_end(struct gzfile *gz)
+gzfile_reader_end(gz)
+ struct gzfile *gz;
{
if (ZSTREAM_IS_CLOSING(&gz->z)) return;
gz->z.flags |= ZSTREAM_FLAG_CLOSING;
@@ -2313,13 +2259,14 @@ gzfile_reader_end(struct gzfile *gz)
}
static void
-gzfile_reader_rewind(struct gzfile *gz)
+gzfile_reader_rewind(gz)
+ struct gzfile *gz;
{
long n;
n = gz->z.stream.total_in;
if (!NIL_P(gz->z.input)) {
- n += RSTRING_LEN(gz->z.input);
+ n += RSTRING(gz->z.input)->len;
}
rb_funcall(gz->io, id_seek, 2, rb_int2inum(-n), INT2FIX(1));
@@ -2327,7 +2274,8 @@ gzfile_reader_rewind(struct gzfile *gz)
}
static VALUE
-gzfile_reader_get_unused(struct gzfile *gz)
+gzfile_reader_get_unused(gz)
+ struct gzfile *gz;
{
VALUE str;
@@ -2344,7 +2292,8 @@ gzfile_reader_get_unused(struct gzfile *gz)
}
static struct gzfile *
-get_gzfile(VALUE obj)
+get_gzfile(obj)
+ VALUE obj;
{
struct gzfile *gz;
@@ -2370,7 +2319,8 @@ get_gzfile(VALUE obj)
static VALUE
-gzfile_ensure_close(VALUE obj)
+gzfile_ensure_close(obj)
+ VALUE obj;
{
struct gzfile *gz;
@@ -2385,7 +2335,10 @@ gzfile_ensure_close(VALUE obj)
* See Zlib::GzipReader#wrap and Zlib::GzipWriter#wrap.
*/
static VALUE
-rb_gzfile_s_wrap(int argc, VALUE *argv, VALUE klass)
+rb_gzfile_s_wrap(argc, argv, klass)
+ int argc;
+ VALUE *argv;
+ VALUE klass;
{
VALUE obj = rb_class_new_instance(argc, argv, klass);
@@ -2401,7 +2354,11 @@ rb_gzfile_s_wrap(int argc, VALUE *argv, VALUE klass)
* See Zlib::GzipReader#open and Zlib::GzipWriter#open.
*/
static VALUE
-gzfile_s_open(int argc, VALUE *argv, VALUE klass, const char *mode)
+gzfile_s_open(argc, argv, klass, mode)
+ int argc;
+ VALUE *argv;
+ VALUE klass;
+ const char *mode;
{
VALUE io, filename;
@@ -2409,7 +2366,9 @@ gzfile_s_open(int argc, VALUE *argv, VALUE klass, const char *mode)
rb_raise(rb_eArgError, "wrong number of arguments (0 for 1)");
}
filename = argv[0];
- io = rb_file_open_str(filename, mode);
+ SafeStringValue(filename);
+ io = rb_file_open(RSTRING(filename)->ptr, mode);
+
argv[0] = io;
return rb_gzfile_s_wrap(argc, argv, klass);
}
@@ -2418,7 +2377,8 @@ gzfile_s_open(int argc, VALUE *argv, VALUE klass, const char *mode)
* Same as IO.
*/
static VALUE
-rb_gzfile_to_io(VALUE obj)
+rb_gzfile_to_io(obj)
+ VALUE obj;
{
return get_gzfile(obj)->io;
}
@@ -2427,7 +2387,8 @@ rb_gzfile_to_io(VALUE obj)
* Returns CRC value of the uncompressed data.
*/
static VALUE
-rb_gzfile_crc(VALUE obj)
+rb_gzfile_crc(obj)
+ VALUE obj;
{
return rb_uint2inum(get_gzfile(obj)->crc);
}
@@ -2436,7 +2397,8 @@ rb_gzfile_crc(VALUE obj)
* Returns last modification time recorded in the gzip file header.
*/
static VALUE
-rb_gzfile_mtime(VALUE obj)
+rb_gzfile_mtime(obj)
+ VALUE obj;
{
return rb_time_new(get_gzfile(obj)->mtime, (time_t)0);
}
@@ -2445,7 +2407,8 @@ rb_gzfile_mtime(VALUE obj)
* Returns compression level.
*/
static VALUE
-rb_gzfile_level(VALUE obj)
+rb_gzfile_level(obj)
+ VALUE obj;
{
return INT2FIX(get_gzfile(obj)->level);
}
@@ -2454,7 +2417,8 @@ rb_gzfile_level(VALUE obj)
* Returns OS code number recorded in the gzip file header.
*/
static VALUE
-rb_gzfile_os_code(VALUE obj)
+rb_gzfile_os_code(obj)
+ VALUE obj;
{
return INT2FIX(get_gzfile(obj)->os_code);
}
@@ -2464,7 +2428,8 @@ rb_gzfile_os_code(VALUE obj)
* original filename is not present.
*/
static VALUE
-rb_gzfile_orig_name(VALUE obj)
+rb_gzfile_orig_name(obj)
+ VALUE obj;
{
VALUE str = get_gzfile(obj)->orig_name;
if (!NIL_P(str)) {
@@ -2479,7 +2444,8 @@ rb_gzfile_orig_name(VALUE obj)
* is not present.
*/
static VALUE
-rb_gzfile_comment(VALUE obj)
+rb_gzfile_comment(obj)
+ VALUE obj;
{
VALUE str = get_gzfile(obj)->comment;
if (!NIL_P(str)) {
@@ -2493,7 +2459,8 @@ rb_gzfile_comment(VALUE obj)
* ???
*/
static VALUE
-rb_gzfile_lineno(VALUE obj)
+rb_gzfile_lineno(obj)
+ VALUE obj;
{
return INT2NUM(get_gzfile(obj)->lineno);
}
@@ -2502,7 +2469,8 @@ rb_gzfile_lineno(VALUE obj)
* ???
*/
static VALUE
-rb_gzfile_set_lineno(VALUE obj, VALUE lineno)
+rb_gzfile_set_lineno(obj, lineno)
+ VALUE obj, lineno;
{
struct gzfile *gz = get_gzfile(obj);
gz->lineno = NUM2INT(lineno);
@@ -2513,7 +2481,8 @@ rb_gzfile_set_lineno(VALUE obj, VALUE lineno)
* ???
*/
static VALUE
-rb_gzfile_set_mtime(VALUE obj, VALUE mtime)
+rb_gzfile_set_mtime(obj, mtime)
+ VALUE obj, mtime;
{
struct gzfile *gz = get_gzfile(obj);
VALUE val;
@@ -2536,7 +2505,8 @@ rb_gzfile_set_mtime(VALUE obj, VALUE mtime)
* ???
*/
static VALUE
-rb_gzfile_set_orig_name(VALUE obj, VALUE str)
+rb_gzfile_set_orig_name(obj, str)
+ VALUE obj, str;
{
struct gzfile *gz = get_gzfile(obj);
VALUE s;
@@ -2546,9 +2516,9 @@ rb_gzfile_set_orig_name(VALUE obj, VALUE str)
rb_raise(cGzError, "header is already written");
}
s = rb_str_dup(rb_str_to_str(str));
- p = memchr(RSTRING_PTR(s), '\0', RSTRING_LEN(s));
+ p = memchr(RSTRING(s)->ptr, '\0', RSTRING(s)->len);
if (p) {
- rb_str_resize(s, p - RSTRING_PTR(s));
+ rb_str_resize(s, p - RSTRING(s)->ptr);
}
gz->orig_name = s;
return str;
@@ -2558,7 +2528,8 @@ rb_gzfile_set_orig_name(VALUE obj, VALUE str)
* ???
*/
static VALUE
-rb_gzfile_set_comment(VALUE obj, VALUE str)
+rb_gzfile_set_comment(obj, str)
+ VALUE obj, str;
{
struct gzfile *gz = get_gzfile(obj);
VALUE s;
@@ -2568,9 +2539,9 @@ rb_gzfile_set_comment(VALUE obj, VALUE str)
rb_raise(cGzError, "header is already written");
}
s = rb_str_dup(rb_str_to_str(str));
- p = memchr(RSTRING_PTR(s), '\0', RSTRING_LEN(s));
+ p = memchr(RSTRING(s)->ptr, '\0', RSTRING(s)->len);
if (p) {
- rb_str_resize(s, p - RSTRING_PTR(s));
+ rb_str_resize(s, p - RSTRING(s)->ptr);
}
gz->comment = s;
return str;
@@ -2581,7 +2552,8 @@ rb_gzfile_set_comment(VALUE obj, VALUE str)
* associated IO object. Returns the associated IO object.
*/
static VALUE
-rb_gzfile_close(VALUE obj)
+rb_gzfile_close(obj)
+ VALUE obj;
{
struct gzfile *gz = get_gzfile(obj);
VALUE io;
@@ -2597,7 +2569,8 @@ rb_gzfile_close(VALUE obj)
* object.
*/
static VALUE
-rb_gzfile_finish(VALUE obj)
+rb_gzfile_finish(obj)
+ VALUE obj;
{
struct gzfile *gz = get_gzfile(obj);
VALUE io;
@@ -2611,7 +2584,8 @@ rb_gzfile_finish(VALUE obj)
* Same as IO.
*/
static VALUE
-rb_gzfile_closed_p(VALUE obj)
+rb_gzfile_closed_p(obj)
+ VALUE obj;
{
struct gzfile *gz;
Data_Get_Struct(obj, struct gzfile, gz);
@@ -2622,7 +2596,8 @@ rb_gzfile_closed_p(VALUE obj)
* ???
*/
static VALUE
-rb_gzfile_eof_p(VALUE obj)
+rb_gzfile_eof_p(obj)
+ VALUE obj;
{
struct gzfile *gz = get_gzfile(obj);
return GZFILE_IS_FINISHED(gz) ? Qtrue : Qfalse;
@@ -2632,7 +2607,8 @@ rb_gzfile_eof_p(VALUE obj)
* Same as IO.
*/
static VALUE
-rb_gzfile_sync(VALUE obj)
+rb_gzfile_sync(obj)
+ VALUE obj;
{
return (get_gzfile(obj)->z.flags & GZFILE_FLAG_SYNC) ? Qtrue : Qfalse;
}
@@ -2645,7 +2621,8 @@ rb_gzfile_sync(VALUE obj)
* decreases sharply.
*/
static VALUE
-rb_gzfile_set_sync(VALUE obj, VALUE mode)
+rb_gzfile_set_sync(obj, mode)
+ VALUE obj, mode;
{
struct gzfile *gz = get_gzfile(obj);
@@ -2662,7 +2639,8 @@ rb_gzfile_set_sync(VALUE obj, VALUE mode)
* ???
*/
static VALUE
-rb_gzfile_total_in(VALUE obj)
+rb_gzfile_total_in(obj)
+ VALUE obj;
{
return rb_uint2inum(get_gzfile(obj)->z.stream.total_in);
}
@@ -2671,41 +2649,13 @@ rb_gzfile_total_in(VALUE obj)
* ???
*/
static VALUE
-rb_gzfile_total_out(VALUE obj)
+rb_gzfile_total_out(obj)
+ VALUE obj;
{
struct gzfile *gz = get_gzfile(obj);
return rb_uint2inum(gz->z.stream.total_out - gz->z.buf_filled);
}
-/*
- * Document-method: path
- *
- * call-seq: path
- *
- * Returns the path string of the associated IO-like object. This
- * method is only defined when the IO-like object responds to #path().
- */
-static VALUE
-rb_gzfile_path(VALUE obj)
-{
- struct gzfile *gz;
- Data_Get_Struct(obj, struct gzfile, gz);
- return gz->path;
-}
-
-static void
-rb_gzfile_ecopts(struct gzfile *gz, VALUE opts)
-{
- if (!NIL_P(opts)) {
- rb_io_extract_encoding_option(opts, &gz->enc, &gz->enc2);
- }
- if (gz->enc2) {
- gz->ecflags = rb_econv_prepare_opts(opts, &opts);
- gz->ec = rb_econv_open_opts(gz->enc2->name, gz->enc->name,
- gz->ecflags, opts);
- gz->ecopts = opts;
- }
-}
/* ------------------------------------------------------------------------- */
@@ -2737,7 +2687,8 @@ rb_gzfile_ecopts(struct gzfile *gz, VALUE opts)
*/
static VALUE
-rb_gzwriter_s_allocate(VALUE klass)
+rb_gzwriter_s_allocate(klass)
+ VALUE klass;
{
return gzfile_writer_new(klass);
}
@@ -2750,7 +2701,10 @@ rb_gzwriter_s_allocate(VALUE klass)
* this method are found in Zlib::GzipWriter.new and Zlib::GzipWriter#wrap.
*/
static VALUE
-rb_gzwriter_s_open(int argc, VALUE *argv, VALUE klass)
+rb_gzwriter_s_open(argc, argv, klass)
+ int argc;
+ VALUE *argv;
+ VALUE klass;
{
return gzfile_s_open(argc, argv, klass, "wb");
}
@@ -2764,17 +2718,15 @@ rb_gzwriter_s_open(int argc, VALUE *argv, VALUE klass)
* +write+ method that behaves same as write method in IO class.
*/
static VALUE
-rb_gzwriter_initialize(int argc, VALUE *argv, VALUE obj)
+rb_gzwriter_initialize(argc, argv, obj)
+ int argc;
+ VALUE *argv;
+ VALUE obj;
{
struct gzfile *gz;
- VALUE io, level, strategy, opt = Qnil;
+ VALUE io, level, strategy;
int err;
- if (argc > 1) {
- opt = rb_check_convert_type(argv[argc-1], T_HASH, "Hash", "to_hash");
- if (!NIL_P(opt)) argc--;
- }
-
rb_scan_args(argc, argv, "12", &io, &level, &strategy);
Data_Get_Struct(obj, struct gzfile, gz);
@@ -2787,12 +2739,6 @@ rb_gzwriter_initialize(int argc, VALUE *argv, VALUE obj)
}
gz->io = io;
ZSTREAM_READY(&gz->z);
- rb_gzfile_ecopts(gz, opt);
-
- if (rb_respond_to(io, id_path)) {
- gz->path = rb_funcall(gz->io, id_path, 0);
- rb_define_singleton_method(obj, "path", rb_gzfile_path, 0);
- }
return obj;
}
@@ -2805,7 +2751,10 @@ rb_gzwriter_initialize(int argc, VALUE *argv, VALUE obj)
* +flush+ is omitted. It is no use giving flush <tt>Zlib::NO_FLUSH</tt>.
*/
static VALUE
-rb_gzwriter_flush(int argc, VALUE *argv, VALUE obj)
+rb_gzwriter_flush(argc, argv, obj)
+ int argc;
+ VALUE *argv;
+ VALUE obj;
{
struct gzfile *gz = get_gzfile(obj);
VALUE v_flush;
@@ -2815,7 +2764,7 @@ rb_gzwriter_flush(int argc, VALUE *argv, VALUE obj)
flush = FIXNUMARG(v_flush, Z_SYNC_FLUSH);
if (flush != Z_NO_FLUSH) { /* prevent Z_BUF_ERROR */
- zstream_run(&gz->z, (Bytef*)"", 0, flush);
+ zstream_run(&gz->z, "", 0, flush);
}
gzfile_write_raw(gz);
@@ -2829,29 +2778,29 @@ rb_gzwriter_flush(int argc, VALUE *argv, VALUE obj)
* Same as IO.
*/
static VALUE
-rb_gzwriter_write(VALUE obj, VALUE str)
+rb_gzwriter_write(obj, str)
+ VALUE obj, str;
{
struct gzfile *gz = get_gzfile(obj);
- if (TYPE(str) != T_STRING)
+ if (TYPE(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));
- return INT2FIX(RSTRING_LEN(str));
+ gzfile_write(gz, RSTRING(str)->ptr, RSTRING(str)->len);
+ return INT2FIX(RSTRING(str)->len);
}
/*
* Same as IO.
*/
static VALUE
-rb_gzwriter_putc(VALUE obj, VALUE ch)
+rb_gzwriter_putc(obj, ch)
+ VALUE obj, ch;
{
struct gzfile *gz = get_gzfile(obj);
char c = NUM2CHR(ch);
- gzfile_write(gz, (Bytef*)&c, 1);
+ gzfile_write(gz, &c, 1);
return ch;
}
@@ -2937,7 +2886,8 @@ rb_gzwriter_putc(VALUE obj, VALUE ch)
*/
static VALUE
-rb_gzreader_s_allocate(VALUE klass)
+rb_gzreader_s_allocate(klass)
+ VALUE klass;
{
return gzfile_reader_new(klass);
}
@@ -2950,7 +2900,10 @@ rb_gzreader_s_allocate(VALUE klass)
* are in Zlib::GzipReader.new and ZLib::GzipReader.wrap.
*/
static VALUE
-rb_gzreader_s_open(int argc, VALUE *argv, VALUE klass)
+rb_gzreader_s_open(argc, argv, klass)
+ int argc;
+ VALUE *argv;
+ VALUE klass;
{
return gzfile_s_open(argc, argv, klass, "rb");
}
@@ -2966,18 +2919,13 @@ rb_gzreader_s_open(int argc, VALUE *argv, VALUE klass)
* exception.
*/
static VALUE
-rb_gzreader_initialize(int argc, VALUE *argv, VALUE obj)
+rb_gzreader_initialize(obj, io)
+ VALUE obj, io;
{
- VALUE io, opt = Qnil;
struct gzfile *gz;
int err;
Data_Get_Struct(obj, struct gzfile, gz);
- if (argc > 1) {
- opt = rb_check_convert_type(argv[argc-1], T_HASH, "Hash", "to_hash");
- if (!NIL_P(opt)) argc--;
- }
- rb_scan_args(argc, argv, "1", &io);
/* this is undocumented feature of zlib */
err = inflateInit2(&gz->z.stream, -MAX_WBITS);
@@ -2987,12 +2935,6 @@ rb_gzreader_initialize(int argc, VALUE *argv, VALUE obj)
gz->io = io;
ZSTREAM_READY(&gz->z);
gzfile_read_header(gz);
- rb_gzfile_ecopts(gz, opt);
-
- if (rb_respond_to(io, id_path)) {
- gz->path = rb_funcall(gz->io, id_path, 0);
- rb_define_singleton_method(obj, "path", rb_gzfile_path, 0);
- }
return obj;
}
@@ -3002,7 +2944,8 @@ rb_gzreader_initialize(int argc, VALUE *argv, VALUE obj)
* object. The associated IO object needs to respond to the +seek+ method.
*/
static VALUE
-rb_gzreader_rewind(VALUE obj)
+rb_gzreader_rewind(obj)
+ VALUE obj;
{
struct gzfile *gz = get_gzfile(obj);
gzfile_reader_rewind(gz);
@@ -3014,7 +2957,8 @@ rb_gzreader_rewind(VALUE obj)
* +nil+ if the whole gzip file is not parsed yet.
*/
static VALUE
-rb_gzreader_unused(VALUE obj)
+rb_gzreader_unused(obj)
+ VALUE obj;
{
struct gzfile *gz;
Data_Get_Struct(obj, struct gzfile, gz);
@@ -3025,7 +2969,10 @@ rb_gzreader_unused(VALUE obj)
* See Zlib::GzipReader documentation for a description.
*/
static VALUE
-rb_gzreader_read(int argc, VALUE *argv, VALUE obj)
+rb_gzreader_read(argc, argv, obj)
+ int argc;
+ VALUE *argv;
+ VALUE obj;
{
struct gzfile *gz = get_gzfile(obj);
VALUE vlen;
@@ -3044,70 +2991,18 @@ rb_gzreader_read(int argc, VALUE *argv, VALUE obj)
}
/*
- * call-seq:
- * gzipreader.readpartial(maxlen [, outbuf]) => string, outbuf
- *
- * Reads at most <i>maxlen</i> bytes from the gziped stream but
- * it blocks only if <em>gzipreader</em> has no data immediately available.
- * If the optional <i>outbuf</i> argument is present,
- * it must reference a String, which will receive the data.
- * It raises <code>EOFError</code> on end of file.
- */
-static VALUE
-rb_gzreader_readpartial(int argc, VALUE *argv, VALUE obj)
-{
- struct gzfile *gz = get_gzfile(obj);
- VALUE vlen, outbuf;
- int len;
-
- rb_scan_args(argc, argv, "11", &vlen, &outbuf);
-
- len = NUM2INT(vlen);
- if (len < 0) {
- rb_raise(rb_eArgError, "negative length %d given", len);
- }
- if (!NIL_P(outbuf))
- Check_Type(outbuf, T_STRING);
- return gzfile_readpartial(gz, len, outbuf);
-}
-
-/*
* See Zlib::GzipReader documentation for a description.
*/
static VALUE
-rb_gzreader_getc(VALUE obj)
-{
- struct gzfile *gz = get_gzfile(obj);
-
- return gzfile_getc(gz);
-}
-
-/*
- * See Zlib::GzipReader documentation for a description.
- */
-static VALUE
-rb_gzreader_readchar(VALUE obj)
-{
- VALUE dst;
- dst = rb_gzreader_getc(obj);
- if (NIL_P(dst)) {
- rb_raise(rb_eEOFError, "end of file reached");
- }
- return dst;
-}
-
-/*
- * See Zlib::GzipReader documentation for a description.
- */
-static VALUE
-rb_gzreader_getbyte(VALUE obj)
+rb_gzreader_getc(obj)
+ VALUE obj;
{
struct gzfile *gz = get_gzfile(obj);
VALUE dst;
dst = gzfile_read(gz, 1);
if (!NIL_P(dst)) {
- dst = INT2FIX((unsigned int)(RSTRING_PTR(dst)[0]) & 0xff);
+ dst = INT2FIX((unsigned int)(RSTRING(dst)->ptr[0]) & 0xff);
}
return dst;
}
@@ -3116,10 +3011,11 @@ rb_gzreader_getbyte(VALUE obj)
* See Zlib::GzipReader documentation for a description.
*/
static VALUE
-rb_gzreader_readbyte(VALUE obj)
+rb_gzreader_readchar(obj)
+ VALUE obj;
{
VALUE dst;
- dst = rb_gzreader_getbyte(obj);
+ dst = rb_gzreader_getc(obj);
if (NIL_P(dst)) {
rb_raise(rb_eEOFError, "end of file reached");
}
@@ -3130,12 +3026,10 @@ rb_gzreader_readbyte(VALUE obj)
* See Zlib::GzipReader documentation for a description.
*/
static VALUE
-rb_gzreader_each_char(VALUE obj)
+rb_gzreader_each_byte(obj)
+ VALUE obj;
{
VALUE c;
-
- RETURN_ENUMERATOR(obj, 0, 0);
-
while (!NIL_P(c = rb_gzreader_getc(obj))) {
rb_yield(c);
}
@@ -3146,50 +3040,17 @@ rb_gzreader_each_char(VALUE obj)
* See Zlib::GzipReader documentation for a description.
*/
static VALUE
-rb_gzreader_each_byte(VALUE obj)
-{
- VALUE c;
-
- RETURN_ENUMERATOR(obj, 0, 0);
-
- while (!NIL_P(c = rb_gzreader_getbyte(obj))) {
- rb_yield(c);
- }
- return Qnil;
-}
-
-/*
- * See Zlib::GzipReader documentation for a description.
- */
-static VALUE
-rb_gzreader_ungetc(VALUE obj, VALUE s)
-{
- struct gzfile *gz;
-
- if (FIXNUM_P(s))
- return rb_gzreader_ungetbyte(obj, s);
- gz = get_gzfile(obj);
- StringValue(s);
- if (gz->enc2 && gz->enc2 != rb_ascii8bit_encoding()) {
- s = rb_str_conv_enc(s, rb_enc_get(s), gz->enc2);
- }
- gzfile_ungets(gz, (const Bytef*)RSTRING_PTR(s), RSTRING_LEN(s));
- return Qnil;
-}
-
-/*
- * See Zlib::GzipReader documentation for a description.
- */
-static VALUE
-rb_gzreader_ungetbyte(VALUE obj, VALUE ch)
+rb_gzreader_ungetc(obj, ch)
+ VALUE obj, ch;
{
struct gzfile *gz = get_gzfile(obj);
- gzfile_ungetbyte(gz, NUM2CHR(ch));
+ gzfile_ungetc(gz, NUM2CHR(ch));
return Qnil;
}
static void
-gzreader_skip_linebreaks(struct gzfile *gz)
+gzreader_skip_linebreaks(gz)
+ struct gzfile *gz;
{
VALUE str;
char *p;
@@ -3200,7 +3061,7 @@ gzreader_skip_linebreaks(struct gzfile *gz)
gzfile_read_more(gz);
}
n = 0;
- p = RSTRING_PTR(gz->z.buf);
+ p = RSTRING(gz->z.buf)->ptr;
while (n++, *(p++) == '\n') {
if (n >= gz->z.buf_filled) {
@@ -3211,7 +3072,7 @@ gzreader_skip_linebreaks(struct gzfile *gz)
gzfile_read_more(gz);
}
n = 0;
- p = RSTRING_PTR(gz->z.buf);
+ p = RSTRING(gz->z.buf)->ptr;
}
}
@@ -3220,20 +3081,25 @@ gzreader_skip_linebreaks(struct gzfile *gz)
}
static void
-rscheck(const char *rsptr, long rslen, VALUE rs)
+rscheck(rsptr, rslen, rs)
+ char *rsptr;
+ long rslen;
+ VALUE rs;
{
- if (RSTRING_PTR(rs) != rsptr && RSTRING_LEN(rs) != rslen)
+ if (RSTRING(rs)->ptr != rsptr && RSTRING(rs)->len != rslen)
rb_raise(rb_eRuntimeError, "rs modified");
}
static VALUE
-gzreader_gets(int argc, VALUE *argv, VALUE obj)
+gzreader_gets(argc, argv, obj)
+ int argc;
+ VALUE *argv;
+ VALUE obj;
{
struct gzfile *gz = get_gzfile(obj);
volatile VALUE rs;
VALUE dst;
- const char *rsptr;
- char *p, *res;
+ char *rsptr, *p, *res;
long rslen, n;
int rspara;
@@ -3249,19 +3115,19 @@ gzreader_gets(int argc, VALUE *argv, VALUE obj)
if (NIL_P(rs)) {
dst = gzfile_read_all(gz);
- if (RSTRING_LEN(dst) != 0) gz->lineno++;
+ if (RSTRING(dst)->len != 0) gz->lineno++;
else
- return Qnil;
+ return Qnil;
return dst;
}
- if (RSTRING_LEN(rs) == 0) {
+ if (RSTRING(rs)->len == 0) {
rsptr = "\n\n";
rslen = 2;
rspara = 1;
} else {
- rsptr = RSTRING_PTR(rs);
- rslen = RSTRING_LEN(rs);
+ rsptr = RSTRING(rs)->ptr;
+ rslen = RSTRING(rs)->len;
rspara = 0;
}
@@ -3277,13 +3143,13 @@ gzreader_gets(int argc, VALUE *argv, VALUE obj)
gzfile_read_more(gz);
}
- p = RSTRING_PTR(gz->z.buf);
+ p = RSTRING(gz->z.buf)->ptr;
n = rslen;
for (;;) {
if (n > gz->z.buf_filled) {
if (ZSTREAM_IS_FINISHED(&gz->z)) break;
gzfile_read_more(gz);
- p = RSTRING_PTR(gz->z.buf) + n - rslen;
+ p = RSTRING(gz->z.buf)->ptr + n - rslen;
}
if (!rspara) rscheck(rsptr, rslen, rs);
res = memchr(p, rsptr[0], (gz->z.buf_filled - n + 1));
@@ -3303,14 +3169,17 @@ gzreader_gets(int argc, VALUE *argv, VALUE obj)
gzreader_skip_linebreaks(gz);
}
- return gzfile_newstr(gz, dst);
+ return dst;
}
/*
* See Zlib::GzipReader documentation for a description.
*/
static VALUE
-rb_gzreader_gets(int argc, VALUE *argv, VALUE obj)
+rb_gzreader_gets(argc, argv, obj)
+ int argc;
+ VALUE *argv;
+ VALUE obj;
{
VALUE dst;
dst = gzreader_gets(argc, argv, obj);
@@ -3324,7 +3193,10 @@ rb_gzreader_gets(int argc, VALUE *argv, VALUE obj)
* See Zlib::GzipReader documentation for a description.
*/
static VALUE
-rb_gzreader_readline(int argc, VALUE *argv, VALUE obj)
+rb_gzreader_readline(argc, argv, obj)
+ int argc;
+ VALUE *argv;
+ VALUE obj;
{
VALUE dst;
dst = rb_gzreader_gets(argc, argv, obj);
@@ -3338,12 +3210,12 @@ rb_gzreader_readline(int argc, VALUE *argv, VALUE obj)
* See Zlib::GzipReader documentation for a description.
*/
static VALUE
-rb_gzreader_each(int argc, VALUE *argv, VALUE obj)
+rb_gzreader_each(argc, argv, obj)
+ int argc;
+ VALUE *argv;
+ VALUE obj;
{
VALUE str;
-
- RETURN_ENUMERATOR(obj, 0, 0);
-
while (!NIL_P(str = gzreader_gets(argc, argv, obj))) {
rb_yield(str);
}
@@ -3354,7 +3226,10 @@ rb_gzreader_each(int argc, VALUE *argv, VALUE obj)
* See Zlib::GzipReader documentation for a description.
*/
static VALUE
-rb_gzreader_readlines(int argc, VALUE *argv, VALUE obj)
+rb_gzreader_readlines(argc, argv, obj)
+ int argc;
+ VALUE *argv;
+ VALUE obj;
{
VALUE str, dst;
dst = rb_ary_new();
@@ -3447,8 +3322,7 @@ rb_gzreader_readlines(int argc, VALUE *argv, VALUE obj)
* Zlib::OS_UNKNOWN
* The return values of Zlib::GzipFile#os_code method.
*/
-void
-Init_zlib()
+void Init_zlib()
{
VALUE mZlib, cZStream, cDeflate, cInflate;
#if GZIP_SUPPORT
@@ -3541,11 +3415,9 @@ Init_zlib()
#if GZIP_SUPPORT
id_write = rb_intern("write");
id_read = rb_intern("read");
- id_readpartial = rb_intern("readpartial");
id_flush = rb_intern("flush");
id_seek = rb_intern("seek");
id_close = rb_intern("close");
- id_path = rb_intern("path");
cGzipFile = rb_define_class_under(mZlib, "GzipFile", rb_cObject);
cGzError = rb_define_class_under(cGzipFile, "Error", cZError);
@@ -3597,25 +3469,18 @@ Init_zlib()
rb_define_singleton_method(cGzipReader, "open", rb_gzreader_s_open,-1);
rb_define_alloc_func(cGzipReader, rb_gzreader_s_allocate);
- rb_define_method(cGzipReader, "initialize", rb_gzreader_initialize, -1);
+ rb_define_method(cGzipReader, "initialize", rb_gzreader_initialize, 1);
rb_define_method(cGzipReader, "rewind", rb_gzreader_rewind, 0);
rb_define_method(cGzipReader, "unused", rb_gzreader_unused, 0);
rb_define_method(cGzipReader, "read", rb_gzreader_read, -1);
- rb_define_method(cGzipReader, "readpartial", rb_gzreader_readpartial, -1);
rb_define_method(cGzipReader, "getc", rb_gzreader_getc, 0);
- rb_define_method(cGzipReader, "getbyte", rb_gzreader_getbyte, 0);
rb_define_method(cGzipReader, "readchar", rb_gzreader_readchar, 0);
- rb_define_method(cGzipReader, "readbyte", rb_gzreader_readbyte, 0);
rb_define_method(cGzipReader, "each_byte", rb_gzreader_each_byte, 0);
- rb_define_method(cGzipReader, "each_char", rb_gzreader_each_char, 0);
- rb_define_method(cGzipReader, "bytes", rb_gzreader_each_byte, 0);
rb_define_method(cGzipReader, "ungetc", rb_gzreader_ungetc, 1);
- rb_define_method(cGzipReader, "ungetbyte", rb_gzreader_ungetbyte, 1);
rb_define_method(cGzipReader, "gets", rb_gzreader_gets, -1);
rb_define_method(cGzipReader, "readline", rb_gzreader_readline, -1);
rb_define_method(cGzipReader, "each", rb_gzreader_each, -1);
rb_define_method(cGzipReader, "each_line", rb_gzreader_each, -1);
- rb_define_method(cGzipReader, "lines", rb_gzreader_each, -1);
rb_define_method(cGzipReader, "readlines", rb_gzreader_readlines, -1);
rb_define_const(mZlib, "OS_CODE", INT2FIX(OS_CODE));
diff --git a/file.c b/file.c
index f9dfc620ee..ca80795817 100644
--- a/file.c
+++ b/file.c
@@ -3,9 +3,10 @@
file.c -
$Author$
+ $Date$
created at: Mon Nov 15 12:24:34 JST 1993
- Copyright (C) 1993-2007 Yukihiro Matsumoto
+ Copyright (C) 1993-2003 Yukihiro Matsumoto
Copyright (C) 2000 Network Applied Communication Laboratory, Inc.
Copyright (C) 2000 Information-technology Promotion Agency, Japan
@@ -19,9 +20,10 @@
#include <sys/cygwin.h>
#endif
-#include "ruby/ruby.h"
-#include "ruby/io.h"
-#include "ruby/util.h"
+#include "ruby.h"
+#include "rubyio.h"
+#include "rubysig.h"
+#include "util.h"
#include "dln.h"
#ifdef HAVE_UNISTD_H
@@ -31,7 +33,7 @@
#ifdef HAVE_SYS_FILE_H
# include <sys/file.h>
#else
-int flock(int, int);
+int flock _((int, int));
#endif
#ifdef HAVE_SYS_PARAM_H
@@ -41,10 +43,10 @@ int flock(int, int);
# define MAXPATHLEN 1024
#endif
-#include <ctype.h>
-
#include <time.h>
+VALUE rb_time_new _((time_t, time_t));
+
#ifdef HAVE_UTIME_H
#include <utime.h>
#elif defined HAVE_SYS_UTIME_H
@@ -55,6 +57,10 @@ int flock(int, int);
#include <pwd.h>
#endif
+#ifndef HAVE_STRING_H
+char *strrchr _((const char*,const char));
+#endif
+
#include <sys/types.h>
#include <sys/stat.h>
@@ -62,13 +68,12 @@ int flock(int, int);
#include <sys/mkdev.h>
#endif
-#if defined(HAVE_FCNTL_H)
-#include <fcntl.h>
-#endif
-
#if !defined HAVE_LSTAT && !defined lstat
#define lstat stat
#endif
+#if !HAVE_FSEEKO && !defined(fseeko)
+# define fseeko fseek
+#endif
#ifdef __BEOS__ /* should not change ID if -1 */
static int
@@ -101,87 +106,54 @@ VALUE rb_cFile;
VALUE rb_mFileTest;
VALUE rb_cStat;
-#define insecure_obj_p(obj, level) (level >= 4 || (level > 0 && OBJ_TAINTED(obj)))
-
-static VALUE
-rb_get_path_check(VALUE obj, int level)
-{
- VALUE tmp;
- ID to_path;
-
- if (insecure_obj_p(obj, level)) {
- rb_insecure_operation();
- }
- tmp = rb_check_string_type(obj);
- if (!NIL_P(tmp)) goto exit;
-
- CONST_ID(to_path, "to_path");
- if (rb_respond_to(obj, to_path)) {
- tmp = rb_funcall(obj, to_path, 0, 0);
- }
- else {
- tmp = obj;
- }
- exit:
- StringValueCStr(tmp);
- if (obj != tmp && insecure_obj_p(tmp, level)) {
- rb_insecure_operation();
- }
- return rb_str_new4(tmp);
-}
-
-VALUE
-rb_get_path_no_checksafe(VALUE obj)
-{
- return rb_get_path_check(obj, 0);
-}
-
-VALUE
-rb_get_path(VALUE obj)
-{
- return rb_get_path_check(obj, rb_safe_level());
-}
-
+static long apply2files _((void (*)(const char *, void *), VALUE, void *));
static long
-apply2files(void (*func)(const char *, void *), VALUE vargs, void *arg)
+apply2files(func, vargs, arg)
+ void (*func)_((const char *, void *));
+ VALUE vargs;
+ void *arg;
{
long i;
- volatile VALUE path;
+ VALUE path;
+ struct RArray *args = RARRAY(vargs);
- rb_secure(4);
- for (i=0; i<RARRAY_LEN(vargs); i++) {
- path = rb_get_path(RARRAY_PTR(vargs)[i]);
+ for (i=0; i<args->len; i++) {
+ path = args->ptr[i];
+ SafeStringValue(path);
(*func)(StringValueCStr(path), arg);
}
- return RARRAY_LEN(vargs);
+ return args->len;
}
/*
* call-seq:
* file.path -> filename
- *
+ *
* Returns the pathname used to create <i>file</i> as a string. Does
* not normalize the name.
- *
+ *
* File.new("testfile").path #=> "testfile"
* File.new("/tmp/../tmp/xxx", "w").path #=> "/tmp/../tmp/xxx"
- *
+ *
*/
static VALUE
-rb_file_path(VALUE obj)
+rb_file_path(obj)
+ VALUE obj;
{
rb_io_t *fptr;
fptr = RFILE(rb_io_taint_check(obj))->fptr;
rb_io_check_initialized(fptr);
- if (NIL_P(fptr->pathv)) return Qnil;
- return rb_obj_taint(rb_str_dup(fptr->pathv));
+ if (!fptr->path) return Qnil;
+ return rb_tainted_str_new2(fptr->path);
}
static VALUE
-stat_new_0(VALUE klass, struct stat *st)
+stat_new_0(klass, st)
+ VALUE klass;
+ struct stat *st;
{
struct stat *nst = 0;
@@ -189,17 +161,19 @@ stat_new_0(VALUE klass, struct stat *st)
nst = ALLOC(struct stat);
*nst = *st;
}
- return Data_Wrap_Struct(klass, NULL, -1, nst);
+ return Data_Wrap_Struct(klass, NULL, free, nst);
}
static VALUE
-stat_new(struct stat *st)
+stat_new(st)
+ struct stat *st;
{
return stat_new_0(rb_cStat, st);
}
static struct stat*
-get_stat(VALUE self)
+get_stat(self)
+ VALUE self;
{
struct stat* st;
Data_Get_Struct(self, struct stat, st);
@@ -207,15 +181,13 @@ get_stat(VALUE self)
return st;
}
-static struct timespec stat_mtimespec(struct stat *st);
-
/*
* call-seq:
* stat <=> other_stat => -1, 0, 1
- *
+ *
* Compares <code>File::Stat</code> objects by comparing their
* respective modification times.
- *
+ *
* f1 = File.new("f1", "w")
* sleep 1
* f2 = File.new("f2", "w")
@@ -223,36 +195,49 @@ static struct timespec stat_mtimespec(struct stat *st);
*/
static VALUE
-rb_stat_cmp(VALUE self, VALUE other)
+rb_stat_cmp(self, other)
+ VALUE self, other;
{
if (rb_obj_is_kind_of(other, rb_obj_class(self))) {
- struct timespec ts1 = stat_mtimespec(get_stat(self));
- struct timespec ts2 = stat_mtimespec(get_stat(other));
- if (ts1.tv_sec == ts2.tv_sec) {
- if (ts1.tv_nsec == ts2.tv_nsec) return INT2FIX(0);
- if (ts1.tv_nsec < ts2.tv_nsec) return INT2FIX(-1);
- return INT2FIX(1);
- }
- if (ts1.tv_sec < ts2.tv_sec) return INT2FIX(-1);
- return INT2FIX(1);
+ time_t t1 = get_stat(self)->st_mtime;
+ time_t t2 = get_stat(other)->st_mtime;
+ if (t1 == t2)
+ return INT2FIX(0);
+ else if (t1 < t2)
+ return INT2FIX(-1);
+ else
+ return INT2FIX(1);
}
return Qnil;
}
-#define ST2UINT(val) ((val) & ~(~1UL << (sizeof(val) * CHAR_BIT - 1)))
+static VALUE rb_stat_dev _((VALUE));
+static VALUE rb_stat_ino _((VALUE));
+static VALUE rb_stat_mode _((VALUE));
+static VALUE rb_stat_nlink _((VALUE));
+static VALUE rb_stat_uid _((VALUE));
+static VALUE rb_stat_gid _((VALUE));
+static VALUE rb_stat_rdev _((VALUE));
+static VALUE rb_stat_size _((VALUE));
+static VALUE rb_stat_blksize _((VALUE));
+static VALUE rb_stat_blocks _((VALUE));
+static VALUE rb_stat_atime _((VALUE));
+static VALUE rb_stat_mtime _((VALUE));
+static VALUE rb_stat_ctime _((VALUE));
/*
* call-seq:
* stat.dev => fixnum
- *
+ *
* Returns an integer representing the device on which <i>stat</i>
* resides.
- *
+ *
* File.stat("testfile").dev #=> 774
*/
static VALUE
-rb_stat_dev(VALUE self)
+rb_stat_dev(self)
+ VALUE self;
{
return INT2NUM(get_stat(self)->st_dev);
}
@@ -260,16 +245,17 @@ rb_stat_dev(VALUE self)
/*
* call-seq:
* stat.dev_major => fixnum
- *
+ *
* Returns the major part of <code>File_Stat#dev</code> or
* <code>nil</code>.
- *
+ *
* File.stat("/dev/fd1").dev_major #=> 2
* File.stat("/dev/tty").dev_major #=> 5
*/
static VALUE
-rb_stat_dev_major(VALUE self)
+rb_stat_dev_major(self)
+ VALUE self;
{
#if defined(major)
long dev = get_stat(self)->st_dev;
@@ -282,16 +268,17 @@ rb_stat_dev_major(VALUE self)
/*
* call-seq:
* stat.dev_minor => fixnum
- *
+ *
* Returns the minor part of <code>File_Stat#dev</code> or
* <code>nil</code>.
- *
+ *
* File.stat("/dev/fd1").dev_minor #=> 1
* File.stat("/dev/tty").dev_minor #=> 0
*/
static VALUE
-rb_stat_dev_minor(VALUE self)
+rb_stat_dev_minor(self)
+ VALUE self;
{
#if defined(minor)
long dev = get_stat(self)->st_dev;
@@ -301,20 +288,22 @@ rb_stat_dev_minor(VALUE self)
#endif
}
+
/*
* call-seq:
* stat.ino => fixnum
- *
+ *
* Returns the inode number for <i>stat</i>.
- *
+ *
* File.stat("testfile").ino #=> 1083669
- *
+ *
*/
static VALUE
-rb_stat_ino(VALUE self)
+rb_stat_ino(self)
+ VALUE self;
{
-#if SIZEOF_STRUCT_STAT_ST_INO > SIZEOF_LONG
+#ifdef HUGE_ST_INO
return ULL2NUM(get_stat(self)->st_ino);
#else
return ULONG2NUM(get_stat(self)->st_ino);
@@ -324,86 +313,97 @@ rb_stat_ino(VALUE self)
/*
* call-seq:
* stat.mode => fixnum
- *
+ *
* Returns an integer representing the permission bits of
* <i>stat</i>. The meaning of the bits is platform dependent; on
* Unix systems, see <code>stat(2)</code>.
- *
+ *
* File.chmod(0644, "testfile") #=> 1
* s = File.stat("testfile")
* sprintf("%o", s.mode) #=> "100644"
*/
static VALUE
-rb_stat_mode(VALUE self)
+rb_stat_mode(self)
+ VALUE self;
{
- return UINT2NUM(ST2UINT(get_stat(self)->st_mode));
+#ifdef __BORLANDC__
+ return UINT2NUM((unsigned short)(get_stat(self)->st_mode));
+#else
+ return UINT2NUM(get_stat(self)->st_mode);
+#endif
}
/*
* call-seq:
* stat.nlink => fixnum
- *
+ *
* Returns the number of hard links to <i>stat</i>.
- *
+ *
* File.stat("testfile").nlink #=> 1
* File.link("testfile", "testfile.bak") #=> 0
* File.stat("testfile").nlink #=> 2
- *
+ *
*/
static VALUE
-rb_stat_nlink(VALUE self)
+rb_stat_nlink(self)
+ VALUE self;
{
return UINT2NUM(get_stat(self)->st_nlink);
}
+
/*
* call-seq:
* stat.uid => fixnum
- *
+ *
* Returns the numeric user id of the owner of <i>stat</i>.
- *
+ *
* File.stat("testfile").uid #=> 501
- *
+ *
*/
static VALUE
-rb_stat_uid(VALUE self)
+rb_stat_uid(self)
+ VALUE self;
{
- return UIDT2NUM(get_stat(self)->st_uid);
+ return UINT2NUM(get_stat(self)->st_uid);
}
/*
* call-seq:
* stat.gid => fixnum
- *
+ *
* Returns the numeric group id of the owner of <i>stat</i>.
- *
+ *
* File.stat("testfile").gid #=> 500
- *
+ *
*/
static VALUE
-rb_stat_gid(VALUE self)
+rb_stat_gid(self)
+ VALUE self;
{
- return GIDT2NUM(get_stat(self)->st_gid);
+ return UINT2NUM(get_stat(self)->st_gid);
}
+
/*
* call-seq:
* 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
* system doesn't support this feature.
- *
+ *
* File.stat("/dev/fd1").rdev #=> 513
* File.stat("/dev/tty").rdev #=> 1280
*/
static VALUE
-rb_stat_rdev(VALUE self)
+rb_stat_rdev(self)
+ VALUE self;
{
#ifdef HAVE_ST_RDEV
return ULONG2NUM(get_stat(self)->st_rdev);
@@ -415,16 +415,17 @@ rb_stat_rdev(VALUE self)
/*
* call-seq:
* stat.rdev_major => fixnum
- *
+ *
* Returns the major part of <code>File_Stat#rdev</code> or
* <code>nil</code>.
- *
+ *
* File.stat("/dev/fd1").rdev_major #=> 2
* File.stat("/dev/tty").rdev_major #=> 5
*/
static VALUE
-rb_stat_rdev_major(VALUE self)
+rb_stat_rdev_major(self)
+ VALUE self;
{
#if defined(HAVE_ST_RDEV) && defined(major)
long rdev = get_stat(self)->st_rdev;
@@ -437,16 +438,17 @@ rb_stat_rdev_major(VALUE self)
/*
* call-seq:
* stat.rdev_minor => fixnum
- *
+ *
* Returns the minor part of <code>File_Stat#rdev</code> or
* <code>nil</code>.
- *
+ *
* File.stat("/dev/fd1").rdev_minor #=> 1
* File.stat("/dev/tty").rdev_minor #=> 0
*/
static VALUE
-rb_stat_rdev_minor(VALUE self)
+rb_stat_rdev_minor(self)
+ VALUE self;
{
#if defined(HAVE_ST_RDEV) && defined(minor)
long rdev = get_stat(self)->st_rdev;
@@ -459,14 +461,15 @@ rb_stat_rdev_minor(VALUE self)
/*
* call-seq:
* stat.size => fixnum
- *
+ *
* Returns the size of <i>stat</i> in bytes.
- *
+ *
* File.stat("testfile").size #=> 66
*/
static VALUE
-rb_stat_size(VALUE self)
+rb_stat_size(self)
+ VALUE self;
{
return OFFT2NUM(get_stat(self)->st_size);
}
@@ -474,16 +477,17 @@ rb_stat_size(VALUE self)
/*
* call-seq:
* stat.blksize => integer or nil
- *
+ *
* Returns the native file system's block size. Will return <code>nil</code>
* on platforms that don't support this information.
- *
+ *
* File.stat("testfile").blksize #=> 4096
- *
+ *
*/
static VALUE
-rb_stat_blksize(VALUE self)
+rb_stat_blksize(self)
+ VALUE self;
{
#ifdef HAVE_ST_BLKSIZE
return ULONG2NUM(get_stat(self)->st_blksize);
@@ -495,149 +499,78 @@ rb_stat_blksize(VALUE self)
/*
* call-seq:
* stat.blocks => integer or nil
- *
+ *
* Returns the number of native file system blocks allocated for this
- * file, or <code>nil</code> if the operating system doesn't
+ * file, or <code>nil</code> if the operating system doesn't
* support this feature.
- *
+ *
* File.stat("testfile").blocks #=> 2
*/
static VALUE
-rb_stat_blocks(VALUE self)
+rb_stat_blocks(self)
+ VALUE self;
{
-#ifdef HAVE_STRUCT_STAT_ST_BLOCKS
-# if SIZEOF_STRUCT_STAT_ST_BLOCKS > SIZEOF_LONG
- return ULL2NUM(get_stat(self)->st_blocks);
-# else
+#ifdef HAVE_ST_BLOCKS
return ULONG2NUM(get_stat(self)->st_blocks);
-# endif
#else
return Qnil;
#endif
}
-static struct timespec
-stat_atimespec(struct stat *st)
-{
- struct timespec ts;
- ts.tv_sec = st->st_atime;
-#if defined(HAVE_STRUCT_STAT_ST_ATIM)
- ts.tv_nsec = st->st_atim.tv_nsec;
-#elif defined(HAVE_STRUCT_STAT_ST_ATIMESPEC)
- ts.tv_nsec = st->st_atimespec.tv_nsec;
-#elif defined(HAVE_STRUCT_STAT_ST_ATIMENSEC)
- ts.tv_nsec = st->st_atimensec;
-#else
- ts.tv_nsec = 0;
-#endif
- return ts;
-}
-
-static VALUE
-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(struct stat *st)
-{
- struct timespec ts;
- ts.tv_sec = st->st_mtime;
-#if defined(HAVE_STRUCT_STAT_ST_MTIM)
- ts.tv_nsec = st->st_mtim.tv_nsec;
-#elif defined(HAVE_STRUCT_STAT_ST_MTIMESPEC)
- ts.tv_nsec = st->st_mtimespec.tv_nsec;
-#elif defined(HAVE_STRUCT_STAT_ST_MTIMENSEC)
- ts.tv_nsec = st->st_mtimensec;
-#else
- ts.tv_nsec = 0;
-#endif
- return ts;
-}
-
-static VALUE
-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(struct stat *st)
-{
- struct timespec ts;
- ts.tv_sec = st->st_ctime;
-#if defined(HAVE_STRUCT_STAT_ST_CTIM)
- ts.tv_nsec = st->st_ctim.tv_nsec;
-#elif defined(HAVE_STRUCT_STAT_ST_CTIMESPEC)
- ts.tv_nsec = st->st_ctimespec.tv_nsec;
-#elif defined(HAVE_STRUCT_STAT_ST_CTIMENSEC)
- ts.tv_nsec = st->st_ctimensec;
-#else
- ts.tv_nsec = 0;
-#endif
- return ts;
-}
-
-static VALUE
-stat_ctime(struct stat *st)
-{
- struct timespec ts = stat_ctimespec(st);
- return rb_time_nano_new(ts.tv_sec, ts.tv_nsec);
-}
/*
* call-seq:
* stat.atime => time
- *
+ *
* Returns the last access time for this file as an object of class
* <code>Time</code>.
- *
+ *
* File.stat("testfile").atime #=> Wed Dec 31 18:00:00 CST 1969
- *
+ *
*/
static VALUE
-rb_stat_atime(VALUE self)
+rb_stat_atime(self)
+ VALUE self;
{
- return stat_atime(get_stat(self));
+ return rb_time_new(get_stat(self)->st_atime, 0);
}
/*
* call-seq:
* stat.mtime -> aTime
- *
+ *
* Returns the modification time of <i>stat</i>.
- *
+ *
* File.stat("testfile").mtime #=> Wed Apr 09 08:53:14 CDT 2003
- *
+ *
*/
static VALUE
-rb_stat_mtime(VALUE self)
+rb_stat_mtime(self)
+ VALUE self;
{
- return stat_mtime(get_stat(self));
+ return rb_time_new(get_stat(self)->st_mtime, 0);
}
/*
* call-seq:
* stat.ctime -> aTime
- *
+ *
* Returns the change time for <i>stat</i> (that is, the time
* directory information about the file was changed, not the file
* itself).
- *
+ *
* File.stat("testfile").ctime #=> Wed Apr 09 08:53:14 CDT 2003
- *
+ *
*/
static VALUE
-rb_stat_ctime(VALUE self)
+rb_stat_ctime(self)
+ VALUE self;
{
- return stat_ctime(get_stat(self));
+ return rb_time_new(get_stat(self)->st_ctime, 0);
}
/*
@@ -647,21 +580,22 @@ rb_stat_ctime(VALUE self)
* Produce a nicely formatted description of <i>stat</i>.
*
* File.stat("/etc/passwd").inspect
- * #=> "#<File::Stat dev=0xe000005, ino=1078078, mode=0100644,
- * # nlink=1, uid=0, gid=0, rdev=0x0, size=1374, blksize=4096,
- * # blocks=8, atime=Wed Dec 10 10:16:12 CST 2003,
- * # mtime=Fri Sep 12 15:41:41 CDT 2003,
- * # ctime=Mon Oct 27 11:20:27 CST 2003>"
+ * #=> "#<File::Stat dev=0xe000005, ino=1078078, mode=0100644,
+ * nlink=1, uid=0, gid=0, rdev=0x0, size=1374, blksize=4096,
+ * blocks=8, atime=Wed Dec 10 10:16:12 CST 2003,
+ * mtime=Fri Sep 12 15:41:41 CDT 2003,
+ * ctime=Mon Oct 27 11:20:27 CST 2003>"
*/
static VALUE
-rb_stat_inspect(VALUE self)
+rb_stat_inspect(self)
+ VALUE self;
{
VALUE str;
- size_t i;
+ int i;
static const struct {
const char *name;
- VALUE (*func)(VALUE);
+ VALUE (*func)_((VALUE));
} member[] = {
{"dev", rb_stat_dev},
{"ino", rb_stat_ino},
@@ -678,12 +612,6 @@ rb_stat_inspect(VALUE self)
{"ctime", rb_stat_ctime},
};
- struct stat* st;
- Data_Get_Struct(self, struct stat, st);
- if (!st) {
- return rb_sprintf("#<%s: uninitialized>", rb_obj_classname(self));
- }
-
str = rb_str_buf_new2("#<");
rb_str_buf_cat2(str, rb_obj_classname(self));
rb_str_buf_cat2(str, " ");
@@ -698,10 +626,16 @@ rb_stat_inspect(VALUE self)
rb_str_buf_cat2(str, "=");
v = (*member[i].func)(self);
if (i == 2) { /* mode */
- rb_str_catf(str, "0%lo", NUM2ULONG(v));
+ char buf[32];
+
+ sprintf(buf, "0%lo", NUM2ULONG(v));
+ rb_str_buf_cat2(str, buf);
}
else if (i == 0 || i == 6) { /* dev/rdev */
- rb_str_catf(str, "0x%lx", NUM2ULONG(v));
+ char buf[32];
+
+ sprintf(buf, "0x%lx", NUM2ULONG(v));
+ rb_str_buf_cat2(str, buf);
}
else {
rb_str_append(str, rb_inspect(v));
@@ -714,25 +648,29 @@ rb_stat_inspect(VALUE self)
}
static int
-rb_stat(VALUE file, struct stat *st)
+rb_stat(file, st)
+ VALUE file;
+ struct stat *st;
{
VALUE tmp;
- rb_secure(2);
tmp = rb_check_convert_type(file, T_FILE, "IO", "to_io");
if (!NIL_P(tmp)) {
rb_io_t *fptr;
+ rb_secure(2);
GetOpenFile(tmp, fptr);
- return fstat(fptr->fd, st);
+ return fstat(fileno(fptr->f), st);
}
- FilePathValue(file);
+ SafeStringValue(file);
return stat(StringValueCStr(file), st);
}
#ifdef _WIN32
static HANDLE
-w32_io_info(VALUE *file, BY_HANDLE_FILE_INFORMATION *st)
+w32_io_info(file, st)
+ VALUE *file;
+ BY_HANDLE_FILE_INFORMATION *st;
{
VALUE tmp;
HANDLE f, ret = 0;
@@ -742,11 +680,11 @@ w32_io_info(VALUE *file, BY_HANDLE_FILE_INFORMATION *st)
rb_io_t *fptr;
GetOpenFile(tmp, fptr);
- f = (HANDLE)rb_w32_get_osfhandle(fptr->fd);
+ f = (HANDLE)rb_w32_get_osfhandle(fileno(fptr->f));
if (f == (HANDLE)-1) return INVALID_HANDLE_VALUE;
}
else {
- FilePathValue(*file);
+ SafeStringValue(*file);
f = CreateFile(StringValueCStr(*file), 0,
FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING,
rb_w32_iswin95() ? 0 : FILE_FLAG_BACKUP_SEMANTICS, NULL);
@@ -765,23 +703,23 @@ w32_io_info(VALUE *file, BY_HANDLE_FILE_INFORMATION *st)
/*
* call-seq:
* File.stat(file_name) => 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
- *
+ *
*/
static VALUE
-rb_file_s_stat(VALUE klass, VALUE fname)
+rb_file_s_stat(klass, fname)
+ VALUE klass, fname;
{
struct stat st;
- rb_secure(4);
- FilePathValue(fname);
+ SafeStringValue(fname);
if (rb_stat(fname, &st) < 0) {
- rb_sys_fail(RSTRING_PTR(fname));
+ rb_sys_fail(StringValueCStr(fname));
}
return stat_new(&st);
}
@@ -789,28 +727,28 @@ rb_file_s_stat(VALUE klass, VALUE fname)
/*
* call-seq:
* ios.stat => stat
- *
+ *
* Returns status information for <em>ios</em> as an object of type
* <code>File::Stat</code>.
- *
+ *
* f = File.new("testfile")
* s = f.stat
* "%o" % s.mode #=> "100644"
* s.blksize #=> 4096
* s.atime #=> Wed Apr 09 08:53:54 CDT 2003
- *
+ *
*/
static VALUE
-rb_io_stat(VALUE obj)
+rb_io_stat(obj)
+ VALUE obj;
{
rb_io_t *fptr;
struct stat st;
-#define rb_sys_fail_path(path) rb_sys_fail(NIL_P(path) ? 0 : RSTRING_PTR(path))
GetOpenFile(obj, fptr);
- if (fstat(fptr->fd, &st) == -1) {
- rb_sys_fail_path(fptr->pathv);
+ if (fstat(fileno(fptr->f), &st) == -1) {
+ rb_sys_fail(fptr->path);
}
return stat_new(&st);
}
@@ -818,27 +756,27 @@ rb_io_stat(VALUE obj)
/*
* call-seq:
* File.lstat(file_name) => stat
- *
+ *
* 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
* File.lstat("link2test").size #=> 8
* File.stat("link2test").size #=> 66
- *
+ *
*/
static VALUE
-rb_file_s_lstat(VALUE klass, VALUE fname)
+rb_file_s_lstat(klass, fname)
+ VALUE klass, fname;
{
#ifdef HAVE_LSTAT
struct stat st;
- rb_secure(2);
- FilePathValue(fname);
+ SafeStringValue(fname);
if (lstat(StringValueCStr(fname), &st) == -1) {
- rb_sys_fail(RSTRING_PTR(fname));
+ rb_sys_fail(RSTRING(fname)->ptr);
}
return stat_new(&st);
#else
@@ -846,13 +784,14 @@ rb_file_s_lstat(VALUE klass, VALUE fname)
#endif
}
+
/*
* call-seq:
* file.lstat => stat
- *
+ *
* 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
* f = File.new("link2test")
@@ -861,7 +800,8 @@ rb_file_s_lstat(VALUE klass, VALUE fname)
*/
static VALUE
-rb_file_lstat(VALUE obj)
+rb_file_lstat(obj)
+ VALUE obj;
{
#ifdef HAVE_LSTAT
rb_io_t *fptr;
@@ -869,9 +809,9 @@ rb_file_lstat(VALUE obj)
rb_secure(2);
GetOpenFile(obj, fptr);
- if (NIL_P(fptr->pathv)) return Qnil;
- if (lstat(RSTRING_PTR(fptr->pathv), &st) == -1) {
- rb_sys_fail_path(fptr->pathv);
+ if (!fptr->path) return Qnil;
+ if (lstat(fptr->path, &st) == -1) {
+ rb_sys_fail(fptr->path);
}
return stat_new(&st);
#else
@@ -881,7 +821,8 @@ rb_file_lstat(VALUE obj)
#ifndef HAVE_GROUP_MEMBER
static int
-group_member(GETGROUPS_T gid)
+group_member(gid)
+ GETGROUPS_T gid;
{
#ifndef _WIN32
if (getgid() == gid || getegid() == gid)
@@ -920,11 +861,13 @@ group_member(GETGROUPS_T gid)
#ifndef HAVE_EACCESS
int
-eaccess(const char *path, int mode)
+eaccess(path, mode)
+ const char *path;
+ int mode;
{
#ifdef USE_GETEUID
struct stat st;
- rb_uid_t euid;
+ int euid;
if (stat(path, &st) < 0) return -1;
@@ -968,34 +911,11 @@ eaccess(const char *path, int mode)
* 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).
- *
+ *
*/
-/*
- * File.directory?(file_name) => true or false
- * File.directory?(file_name) => true or false
- *
- * Returns <code>true</code> if the named file is a directory,
- * <code>false</code> otherwise.
- *
- * File.directory?(".")
- */
-
-/*
- * Document-method: exist?
- *
- * call-seq:
- * Dir.exist?(file_name) => true or false
- * Dir.exists?(file_name) => true or false
- *
- * Returns <code>true</code> if the named file is a directory,
- * <code>false</code> otherwise.
- *
- */
/*
- * Document-method: directory?
- *
* call-seq:
* File.directory?(file_name) => true or false
*
@@ -1005,8 +925,9 @@ eaccess(const char *path, int mode)
* File.directory?(".")
*/
-VALUE
-rb_file_directory_p(VALUE obj, VALUE fname)
+static VALUE
+test_d(obj, fname)
+ VALUE obj, fname;
{
#ifndef S_ISDIR
# define S_ISDIR(m) ((m & S_IFMT) == S_IFDIR)
@@ -1027,7 +948,8 @@ rb_file_directory_p(VALUE obj, VALUE fname)
*/
static VALUE
-rb_file_pipe_p(VALUE obj, VALUE fname)
+test_p(obj, fname)
+ VALUE obj, fname;
{
#ifdef S_IFIFO
# ifndef S_ISFIFO
@@ -1051,11 +973,20 @@ rb_file_pipe_p(VALUE obj, VALUE fname)
*/
static VALUE
-rb_file_symlink_p(VALUE obj, VALUE fname)
+test_l(obj, fname)
+ VALUE obj, fname;
{
#ifndef S_ISLNK
# ifdef _S_ISLNK
# define S_ISLNK(m) _S_ISLNK(m)
+# elif defined __BORLANDC__
+# ifdef _S_IFLNK
+# define S_ISLNK(m) (((unsigned short)(m) & S_IFMT) == _S_IFLNK)
+# else
+# ifdef S_IFLNK
+# define S_ISLNK(m) (((unsigned short)(m) & S_IFMT) == S_IFLNK)
+# endif
+# endif
# else
# ifdef _S_IFLNK
# define S_ISLNK(m) ((m & S_IFMT) == _S_IFLNK)
@@ -1070,8 +1001,7 @@ rb_file_symlink_p(VALUE obj, VALUE fname)
#ifdef S_ISLNK
struct stat st;
- rb_secure(2);
- FilePathValue(fname);
+ SafeStringValue(fname);
if (lstat(StringValueCStr(fname), &st) < 0) return Qfalse;
if (S_ISLNK(st.st_mode)) return Qtrue;
#endif
@@ -1087,11 +1017,20 @@ rb_file_symlink_p(VALUE obj, VALUE fname)
*/
static VALUE
-rb_file_socket_p(VALUE obj, VALUE fname)
+test_S(obj, fname)
+ VALUE obj, fname;
{
#ifndef S_ISSOCK
# ifdef _S_ISSOCK
# define S_ISSOCK(m) _S_ISSOCK(m)
+# elif defined __BORLANDC__
+# ifdef _S_IFSOCK
+# define S_ISSOCK(m) (((unsigned short)(m) & S_IFMT) == _S_IFSOCK)
+# else
+# ifdef S_IFSOCK
+# define S_ISSOCK(m) (((unsigned short)(m) & S_IFMT) == S_IFSOCK)
+# endif
+# endif
# else
# ifdef _S_IFSOCK
# define S_ISSOCK(m) ((m & S_IFMT) == _S_IFSOCK)
@@ -1121,7 +1060,8 @@ rb_file_socket_p(VALUE obj, VALUE fname)
*/
static VALUE
-rb_file_blockdev_p(VALUE obj, VALUE fname)
+test_b(obj, fname)
+ VALUE obj, fname;
{
#ifndef S_ISBLK
# ifdef S_IFBLK
@@ -1148,7 +1088,8 @@ rb_file_blockdev_p(VALUE obj, VALUE fname)
* Returns <code>true</code> if the named file is a character device.
*/
static VALUE
-rb_file_chardev_p(VALUE obj, VALUE fname)
+test_c(obj, fname)
+ VALUE obj, fname;
{
#ifndef S_ISCHR
# define S_ISCHR(m) ((m & S_IFMT) == S_IFCHR)
@@ -1162,16 +1103,18 @@ rb_file_chardev_p(VALUE obj, VALUE fname)
return Qfalse;
}
+
/*
* call-seq:
* File.exist?(file_name) => true or false
- * File.exists?(file_name) => true or false
+ * File.exists?(file_name) => true or false (obsolete)
*
* Return <code>true</code> if the named file exists.
*/
static VALUE
-rb_file_exist_p(VALUE obj, VALUE fname)
+test_e(obj, fname)
+ VALUE obj, fname;
{
struct stat st;
@@ -1188,10 +1131,10 @@ rb_file_exist_p(VALUE obj, VALUE fname)
*/
static VALUE
-rb_file_readable_p(VALUE obj, VALUE fname)
+test_r(obj, fname)
+ VALUE obj, fname;
{
- rb_secure(2);
- FilePathValue(fname);
+ SafeStringValue(fname);
if (eaccess(StringValueCStr(fname), R_OK) < 0) return Qfalse;
return Qtrue;
}
@@ -1205,49 +1148,14 @@ rb_file_readable_p(VALUE obj, VALUE fname)
*/
static VALUE
-rb_file_readable_real_p(VALUE obj, VALUE fname)
+test_R(obj, fname)
+ VALUE obj, fname;
{
- rb_secure(2);
- FilePathValue(fname);
+ SafeStringValue(fname);
if (access(StringValueCStr(fname), R_OK) < 0) return Qfalse;
return Qtrue;
}
-#ifndef S_IRUGO
-# define S_IRUGO (S_IRUSR | S_IRGRP | S_IROTH)
-#endif
-
-#ifndef S_IWUGO
-# define S_IWUGO (S_IWUSR | S_IWGRP | S_IWOTH)
-#endif
-
-/*
- * call-seq:
- * 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
- * <code>nil</code> otherwise. The meaning of the bits is platform
- * dependent; on Unix systems, see <code>stat(2)</code>.
- *
- * File.world_readable?("/etc/passwd") # => 420
- * m = File.world_readable?("/etc/passwd")
- * sprintf("%o", m) # => "644"
- */
-
-static VALUE
-rb_file_world_readable_p(VALUE obj, VALUE fname)
-{
-#ifdef S_IROTH
- struct stat st;
-
- if (rb_stat(fname, &st) < 0) return Qnil;
- if ((st.st_mode & (S_IROTH)) == S_IROTH) {
- return UINT2NUM(st.st_mode & (S_IRUGO|S_IWUGO|S_IXUGO));
- }
-#endif
- return Qnil;
-}
/*
* call-seq:
@@ -1258,10 +1166,10 @@ rb_file_world_readable_p(VALUE obj, VALUE fname)
*/
static VALUE
-rb_file_writable_p(VALUE obj, VALUE fname)
+test_w(obj, fname)
+ VALUE obj, fname;
{
- rb_secure(2);
- FilePathValue(fname);
+ SafeStringValue(fname);
if (eaccess(StringValueCStr(fname), W_OK) < 0) return Qfalse;
return Qtrue;
}
@@ -1275,44 +1183,16 @@ rb_file_writable_p(VALUE obj, VALUE fname)
*/
static VALUE
-rb_file_writable_real_p(VALUE obj, VALUE fname)
+test_W(obj, fname)
+ VALUE obj, fname;
{
- rb_secure(2);
- FilePathValue(fname);
+ SafeStringValue(fname);
if (access(StringValueCStr(fname), W_OK) < 0) return Qfalse;
return Qtrue;
}
/*
* call-seq:
- * 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
- * <code>nil</code> otherwise. The meaning of the bits is platform
- * dependent; on Unix systems, see <code>stat(2)</code>.
- *
- * File.world_writable?("/tmp") #=> 511
- * m = File.world_writable?("/tmp")
- * sprintf("%o", m) #=> "777"
- */
-
-static VALUE
-rb_file_world_writable_p(VALUE obj, VALUE fname)
-{
-#ifdef S_IWOTH
- struct stat st;
-
- if (rb_stat(fname, &st) < 0) return Qnil;
- if ((st.st_mode & (S_IWOTH)) == S_IWOTH) {
- return UINT2NUM(st.st_mode & (S_IRUGO|S_IWUGO|S_IXUGO));
- }
-#endif
- return Qnil;
-}
-
-/*
- * call-seq:
* File.executable?(file_name) => true or false
*
* Returns <code>true</code> if the named file is executable by the effective
@@ -1320,10 +1200,10 @@ rb_file_world_writable_p(VALUE obj, VALUE fname)
*/
static VALUE
-rb_file_executable_p(VALUE obj, VALUE fname)
+test_x(obj, fname)
+ VALUE obj, fname;
{
- rb_secure(2);
- FilePathValue(fname);
+ SafeStringValue(fname);
if (eaccess(StringValueCStr(fname), X_OK) < 0) return Qfalse;
return Qtrue;
}
@@ -1337,10 +1217,10 @@ rb_file_executable_p(VALUE obj, VALUE fname)
*/
static VALUE
-rb_file_executable_real_p(VALUE obj, VALUE fname)
+test_X(obj, fname)
+ VALUE obj, fname;
{
- rb_secure(2);
- FilePathValue(fname);
+ SafeStringValue(fname);
if (access(StringValueCStr(fname), X_OK) < 0) return Qfalse;
return Qtrue;
}
@@ -1358,7 +1238,8 @@ rb_file_executable_real_p(VALUE obj, VALUE fname)
*/
static VALUE
-rb_file_file_p(VALUE obj, VALUE fname)
+test_f(obj, fname)
+ VALUE obj, fname;
{
struct stat st;
@@ -1376,7 +1257,8 @@ rb_file_file_p(VALUE obj, VALUE fname)
*/
static VALUE
-rb_file_zero_p(VALUE obj, VALUE fname)
+test_z(obj, fname)
+ VALUE obj, fname;
{
struct stat st;
@@ -1394,7 +1276,8 @@ rb_file_zero_p(VALUE obj, VALUE fname)
*/
static VALUE
-rb_file_size_p(VALUE obj, VALUE fname)
+test_s(obj, fname)
+ VALUE obj, fname;
{
struct stat st;
@@ -1413,7 +1296,8 @@ rb_file_size_p(VALUE obj, VALUE fname)
*/
static VALUE
-rb_file_owned_p(VALUE obj, VALUE fname)
+test_owned(obj, fname)
+ VALUE obj, fname;
{
struct stat st;
@@ -1423,7 +1307,8 @@ rb_file_owned_p(VALUE obj, VALUE fname)
}
static VALUE
-rb_file_rowned_p(VALUE obj, VALUE fname)
+test_rowned(obj, fname)
+ VALUE obj, fname;
{
struct stat st;
@@ -1442,7 +1327,8 @@ rb_file_rowned_p(VALUE obj, VALUE fname)
*/
static VALUE
-rb_file_grpowned_p(VALUE obj, VALUE fname)
+test_grpowned(obj, fname)
+ VALUE obj, fname;
{
#ifndef _WIN32
struct stat st;
@@ -1455,12 +1341,13 @@ rb_file_grpowned_p(VALUE obj, VALUE fname)
#if defined(S_ISUID) || defined(S_ISGID) || defined(S_ISVTX)
static VALUE
-check3rdbyte(VALUE fname, int mode)
+check3rdbyte(fname, mode)
+ VALUE fname;
+ int mode;
{
struct stat st;
- rb_secure(2);
- FilePathValue(fname);
+ SafeStringValue(fname);
if (stat(StringValueCStr(fname), &st) < 0) return Qfalse;
if (st.st_mode & mode) return Qtrue;
return Qfalse;
@@ -1475,7 +1362,8 @@ check3rdbyte(VALUE fname, int mode)
*/
static VALUE
-rb_file_suid_p(VALUE obj, VALUE fname)
+test_suid(obj, fname)
+ VALUE obj, fname;
{
#ifdef S_ISUID
return check3rdbyte(fname, S_ISUID);
@@ -1492,7 +1380,8 @@ rb_file_suid_p(VALUE obj, VALUE fname)
*/
static VALUE
-rb_file_sgid_p(VALUE obj, VALUE fname)
+test_sgid(obj, fname)
+ VALUE obj, fname;
{
#ifdef S_ISGID
return check3rdbyte(fname, S_ISGID);
@@ -1509,7 +1398,8 @@ rb_file_sgid_p(VALUE obj, VALUE fname)
*/
static VALUE
-rb_file_sticky_p(VALUE obj, VALUE fname)
+test_sticky(obj, fname)
+ VALUE obj, fname;
{
#ifdef S_ISVTX
return check3rdbyte(fname, S_ISVTX);
@@ -1536,7 +1426,8 @@ rb_file_sticky_p(VALUE obj, VALUE fname)
*/
static VALUE
-rb_file_identical_p(VALUE obj, VALUE fname1, VALUE fname2)
+test_identical(obj, fname1, fname2)
+ VALUE obj, fname1, fname2;
{
#ifndef DOSISH
struct stat st1, st2;
@@ -1567,16 +1458,16 @@ rb_file_identical_p(VALUE obj, VALUE fname1, VALUE fname2)
if (!f1 || !f2) return Qfalse;
if (rb_w32_iswin95()) return Qfalse;
#else
- FilePathValue(fname1);
+ SafeStringValue(fname1);
fname1 = rb_str_new4(fname1);
- FilePathValue(fname2);
- if (access(RSTRING_PTR(fname1), 0)) return Qfalse;
- if (access(RSTRING_PTR(fname2), 0)) return Qfalse;
+ SafeStringValue(fname2);
+ if (access(RSTRING(fname1)->ptr, 0)) return Qfalse;
+ if (access(RSTRING(fname2)->ptr, 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)))
+ if (RSTRING(fname1)->len != RSTRING(fname2)->len) return Qfalse;
+ if (rb_memcicmp(RSTRING(fname1)->ptr, RSTRING(fname2)->ptr, RSTRING(fname1)->len))
return Qfalse;
#endif
return Qtrue;
@@ -1590,19 +1481,19 @@ rb_file_identical_p(VALUE obj, VALUE fname1, VALUE fname2)
*/
static VALUE
-rb_file_s_size(VALUE klass, VALUE fname)
+rb_file_s_size(klass, fname)
+ VALUE klass, fname;
{
struct stat st;
- if (rb_stat(fname, &st) < 0) {
- FilePathValue(fname);
- rb_sys_fail(RSTRING_PTR(fname));
- }
+ if (rb_stat(fname, &st) < 0)
+ rb_sys_fail(StringValueCStr(fname));
return OFFT2NUM(st.st_size);
}
static VALUE
-rb_file_ftype(const struct stat *st)
+rb_file_ftype(st)
+ struct stat *st;
{
const char *t;
@@ -1639,33 +1530,33 @@ rb_file_ftype(const struct stat *st)
t = "unknown";
}
- return rb_usascii_str_new2(t);
+ return rb_str_new2(t);
}
/*
* call-seq:
* File.ftype(file_name) => string
- *
+ *
* Identifies the type of the named file; the return string is one of
* ``<code>file</code>'', ``<code>directory</code>'',
* ``<code>characterSpecial</code>'', ``<code>blockSpecial</code>'',
* ``<code>fifo</code>'', ``<code>link</code>'',
* ``<code>socket</code>'', or ``<code>unknown</code>''.
- *
+ *
* File.ftype("testfile") #=> "file"
* File.ftype("/dev/tty") #=> "characterSpecial"
* File.ftype("/tmp/.X11-unix/X0") #=> "socket"
*/
static VALUE
-rb_file_s_ftype(VALUE klass, VALUE fname)
+rb_file_s_ftype(klass, fname)
+ VALUE klass, fname;
{
struct stat st;
- rb_secure(2);
- FilePathValue(fname);
+ SafeStringValue(fname);
if (lstat(StringValueCStr(fname), &st) == -1) {
- rb_sys_fail(RSTRING_PTR(fname));
+ rb_sys_fail(RSTRING(fname)->ptr);
}
return rb_file_ftype(&st);
@@ -1674,170 +1565,147 @@ 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).
- *
+ *
* File.atime("testfile") #=> Wed Apr 09 08:51:48 CDT 2003
- *
+ *
*/
static VALUE
-rb_file_s_atime(VALUE klass, VALUE fname)
+rb_file_s_atime(klass, fname)
+ VALUE klass, fname;
{
struct stat st;
- if (rb_stat(fname, &st) < 0) {
- FilePathValue(fname);
- rb_sys_fail(RSTRING_PTR(fname));
- }
- return stat_atime(&st);
+ if (rb_stat(fname, &st) < 0)
+ rb_sys_fail(StringValueCStr(fname));
+ return rb_time_new(st.st_atime, 0);
}
/*
* call-seq:
* file.atime => time
- *
+ *
* Returns the last access time (a <code>Time</code> object)
* for <i>file</i>, or epoch if <i>file</i> has not been accessed.
- *
+ *
* File.new("testfile").atime #=> Wed Dec 31 18:00:00 CST 1969
- *
+ *
*/
static VALUE
-rb_file_atime(VALUE obj)
+rb_file_atime(obj)
+ VALUE obj;
{
rb_io_t *fptr;
struct stat st;
GetOpenFile(obj, fptr);
- if (fstat(fptr->fd, &st) == -1) {
- rb_sys_fail_path(fptr->pathv);
+ if (fstat(fileno(fptr->f), &st) == -1) {
+ rb_sys_fail(fptr->path);
}
- return stat_atime(&st);
+ return rb_time_new(st.st_atime, 0);
}
/*
* call-seq:
* File.mtime(file_name) => time
- *
+ *
* Returns the modification time for the named file as a Time object.
- *
+ *
* File.mtime("testfile") #=> Tue Apr 08 12:58:04 CDT 2003
- *
+ *
*/
static VALUE
-rb_file_s_mtime(VALUE klass, VALUE fname)
+rb_file_s_mtime(klass, fname)
+ VALUE klass, fname;
{
struct stat st;
- if (rb_stat(fname, &st) < 0) {
- FilePathValue(fname);
- rb_sys_fail(RSTRING_PTR(fname));
- }
- return stat_mtime(&st);
+ if (rb_stat(fname, &st) < 0)
+ rb_sys_fail(RSTRING(fname)->ptr);
+ return rb_time_new(st.st_mtime, 0);
}
/*
* call-seq:
* file.mtime -> time
- *
+ *
* Returns the modification time for <i>file</i>.
- *
+ *
* File.new("testfile").mtime #=> Wed Apr 09 08:53:14 CDT 2003
- *
+ *
*/
static VALUE
-rb_file_mtime(VALUE obj)
+rb_file_mtime(obj)
+ VALUE obj;
{
rb_io_t *fptr;
struct stat st;
GetOpenFile(obj, fptr);
- if (fstat(fptr->fd, &st) == -1) {
- rb_sys_fail_path(fptr->pathv);
+ if (fstat(fileno(fptr->f), &st) == -1) {
+ rb_sys_fail(fptr->path);
}
- return stat_mtime(&st);
+ return rb_time_new(st.st_mtime, 0);
}
/*
* call-seq:
* File.ctime(file_name) => time
- *
+ *
* Returns the change time for the named file (the time at which
* directory information about the file was changed, not the file
* itself).
- *
+ *
* File.ctime("testfile") #=> Wed Apr 09 08:53:13 CDT 2003
- *
+ *
*/
static VALUE
-rb_file_s_ctime(VALUE klass, VALUE fname)
+rb_file_s_ctime(klass, fname)
+ VALUE klass, fname;
{
struct stat st;
- if (rb_stat(fname, &st) < 0) {
- FilePathValue(fname);
- rb_sys_fail(RSTRING_PTR(fname));
- }
- return stat_ctime(&st);
+ if (rb_stat(fname, &st) < 0)
+ rb_sys_fail(RSTRING(fname)->ptr);
+ return rb_time_new(st.st_ctime, 0);
}
/*
* call-seq:
* file.ctime -> time
- *
+ *
* Returns the change time for <i>file</i> (that is, the time directory
* information about the file was changed, not the file itself).
- *
+ *
* File.new("testfile").ctime #=> Wed Apr 09 08:53:14 CDT 2003
- *
- */
-
-static VALUE
-rb_file_ctime(VALUE obj)
-{
- rb_io_t *fptr;
- struct stat st;
-
- GetOpenFile(obj, fptr);
- if (fstat(fptr->fd, &st) == -1) {
- rb_sys_fail_path(fptr->pathv);
- }
- return stat_ctime(&st);
-}
-
-/*
- * call-seq:
- * file.size => integer
- *
- * Returns the size of <i>file</i> in bytes.
- *
- * File.new("testfile").size #=> 66
- *
+ *
*/
static VALUE
-rb_file_size(VALUE obj)
+rb_file_ctime(obj)
+ VALUE obj;
{
rb_io_t *fptr;
struct stat st;
GetOpenFile(obj, fptr);
- if (fptr->mode & FMODE_WRITABLE) {
- rb_io_flush(obj);
- }
- if (fstat(fptr->fd, &st) == -1) {
- rb_sys_fail_path(fptr->pathv);
+ if (fstat(fileno(fptr->f), &st) == -1) {
+ rb_sys_fail(fptr->path);
}
- return OFFT2NUM(st.st_size);
+ return rb_time_new(st.st_ctime, 0);
}
+static void chmod_internal _((const char *, void *));
static void
-chmod_internal(const char *path, void *mode)
+chmod_internal(path, mode)
+ const char *path;
+ void *mode;
{
if (chmod(path, *(int *)mode) < 0)
rb_sys_fail(path);
@@ -1846,18 +1714,20 @@ chmod_internal(const char *path, void *mode)
/*
* call-seq:
* File.chmod(mode_int, file_name, ... ) -> integer
- *
+ *
* Changes permission bits on the named file(s) to the bit pattern
* represented by <i>mode_int</i>. Actual effects are operating system
* dependent (see the beginning of this section). On Unix systems, see
* <code>chmod(2)</code> for details. Returns the number of files
* processed.
- *
+ *
* File.chmod(0644, "testfile", "out") #=> 2
*/
static VALUE
-rb_file_s_chmod(int argc, VALUE *argv)
+rb_file_s_chmod(argc, argv)
+ int argc;
+ VALUE *argv;
{
VALUE vmode;
VALUE rest;
@@ -1875,18 +1745,19 @@ rb_file_s_chmod(int argc, VALUE *argv)
/*
* call-seq:
* file.chmod(mode_int) => 0
- *
+ *
* 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 <code>File#lchmod</code>.
- *
+ *
* f = File.new("out", "w");
* f.chmod(0644) #=> 0
*/
static VALUE
-rb_file_chmod(VALUE obj, VALUE vmode)
+rb_file_chmod(obj, vmode)
+ VALUE obj, vmode;
{
rb_io_t *fptr;
int mode;
@@ -1896,20 +1767,23 @@ rb_file_chmod(VALUE obj, VALUE vmode)
GetOpenFile(obj, fptr);
#ifdef HAVE_FCHMOD
- if (fchmod(fptr->fd, mode) == -1)
- rb_sys_fail_path(fptr->pathv);
+ if (fchmod(fileno(fptr->f), mode) == -1)
+ rb_sys_fail(fptr->path);
#else
- if (NIL_P(fptr->pathv)) return Qnil;
- if (chmod(RSTRING_PTR(fptr->pathv), mode) == -1)
- rb_sys_fail_path(fptr->pathv);
+ if (!fptr->path) return Qnil;
+ if (chmod(fptr->path, mode) == -1)
+ rb_sys_fail(fptr->path);
#endif
return INT2FIX(0);
}
#if defined(HAVE_LCHMOD)
+static void lchmod_internal _((const char *, void *));
static void
-lchmod_internal(const char *path, void *mode)
+lchmod_internal(path, mode)
+ const char *path;
+ void *mode;
{
if (lchmod(path, (int)(VALUE)mode) < 0)
rb_sys_fail(path);
@@ -1918,15 +1792,17 @@ lchmod_internal(const char *path, void *mode)
/*
* call-seq:
* File.lchmod(mode_int, file_name, ...) => integer
- *
+ *
* 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)
+rb_file_s_lchmod(argc, argv)
+ int argc;
+ VALUE *argv;
{
VALUE vmode;
VALUE rest;
@@ -1940,18 +1816,27 @@ rb_file_s_lchmod(int argc, VALUE *argv)
return LONG2FIX(n);
}
#else
-#define rb_file_s_lchmod rb_f_notimplement
+static VALUE
+rb_file_s_lchmod(argc, argv)
+ int argc;
+ VALUE *argv;
+{
+ rb_notimplement();
+ return Qnil; /* not reached */
+}
#endif
struct chown_args {
- rb_uid_t owner;
- rb_gid_t group;
+ int owner, group;
};
+static void chown_internal _((const char *, void *));
static void
-chown_internal(const char *path, void *arg)
+chown_internal(path, argp)
+ const char *path;
+ void *argp;
{
- struct chown_args *args = arg;
+ struct chown_args *args = (struct chown_args *)argp;
if (chown(path, args->owner, args->group) < 0)
rb_sys_fail(path);
}
@@ -1959,20 +1844,22 @@ chown_internal(const char *path, void *arg)
/*
* call-seq:
* 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
* privileges may 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.
* Returns the number of files processed.
- *
+ *
* File.chown(nil, 100, "testfile")
- *
+ *
*/
static VALUE
-rb_file_s_chown(int argc, VALUE *argv)
+rb_file_s_chown(argc, argv)
+ int argc;
+ VALUE *argv;
{
VALUE o, g, rest;
struct chown_args arg;
@@ -1984,13 +1871,13 @@ rb_file_s_chown(int argc, VALUE *argv)
arg.owner = -1;
}
else {
- arg.owner = NUM2UIDT(o);
+ arg.owner = NUM2INT(o);
}
if (NIL_P(g)) {
arg.group = -1;
}
else {
- arg.group = NUM2GIDT(g);
+ arg.group = NUM2INT(g);
}
n = apply2files(chown_internal, rest, &arg);
@@ -2000,20 +1887,21 @@ rb_file_s_chown(int argc, VALUE *argv)
/*
* call-seq:
* file.chown(owner_int, group_int ) => 0
- *
+ *
* Changes the owner and group of <i>file</i> to the given numeric
* owner and group id's. Only a process with superuser privileges may
* 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 <code>File#lchown</code>.
- *
+ *
* File.new("testfile").chown(502, 1000)
- *
+ *
*/
static VALUE
-rb_file_chown(VALUE obj, VALUE owner, VALUE group)
+rb_file_chown(obj, owner, group)
+ VALUE obj, owner, group;
{
rb_io_t *fptr;
int o, g;
@@ -2022,40 +1910,46 @@ rb_file_chown(VALUE obj, VALUE owner, VALUE group)
o = NIL_P(owner) ? -1 : NUM2INT(owner);
g = NIL_P(group) ? -1 : NUM2INT(group);
GetOpenFile(obj, fptr);
-#ifndef HAVE_FCHOWN
- if (NIL_P(fptr->pathv)) return Qnil;
- if (chown(RSTRING_PTR(fptr->pathv), o, g) == -1)
- rb_sys_fail_path(fptr->pathv);
+#if defined(DJGPP) || defined(__CYGWIN32__) || defined(_WIN32) || defined(__EMX__)
+ if (!fptr->path) return Qnil;
+ if (chown(fptr->path, o, g) == -1)
+ rb_sys_fail(fptr->path);
#else
- if (fchown(fptr->fd, o, g) == -1)
- rb_sys_fail_path(fptr->pathv);
+ if (fchown(fileno(fptr->f), o, g) == -1)
+ rb_sys_fail(fptr->path);
#endif
return INT2FIX(0);
}
-#if defined(HAVE_LCHOWN)
+#if defined(HAVE_LCHOWN) && !defined(__CHECKER__)
+static void lchown_internal _((const char *, void *));
static void
-lchown_internal(const char *path, void *arg)
+lchown_internal(path, argp)
+ const char *path;
+ void *argp;
{
- struct chown_args *args = arg;
+ struct chown_args *args = (struct chown_args *)argp;
if (lchown(path, args->owner, args->group) < 0)
rb_sys_fail(path);
}
+
/*
* call-seq:
* file.lchown(owner_int, group_int, file_name,..) => integer
- *
+ *
* 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.
- *
+ *
*/
static VALUE
-rb_file_s_lchown(int argc, VALUE *argv)
+rb_file_s_lchown(argc, argv)
+ int argc;
+ VALUE *argv;
{
VALUE o, g, rest;
struct chown_args arg;
@@ -2067,101 +1961,73 @@ rb_file_s_lchown(int argc, VALUE *argv)
arg.owner = -1;
}
else {
- arg.owner = NUM2UIDT(o);
+ arg.owner = NUM2INT(o);
}
if (NIL_P(g)) {
arg.group = -1;
}
else {
- arg.group = NUM2GIDT(g);
+ arg.group = NUM2INT(g);
}
n = apply2files(lchown_internal, rest, &arg);
return LONG2FIX(n);
}
#else
-#define rb_file_s_lchown rb_f_notimplement
+static VALUE
+rb_file_s_lchown(argc, argv)
+ int argc;
+ VALUE *argv;
+{
+ rb_notimplement();
+}
#endif
-struct timespec rb_time_timespec(VALUE time);
+struct timeval rb_time_timeval();
-struct utime_args {
- const struct timespec* tsp;
- VALUE atime, mtime;
-};
+static void utime_internal _((const char *, void *));
-#if defined DOSISH || defined __CYGWIN__
-NORETURN(static void utime_failed(const char *, const struct timespec *, VALUE, VALUE));
+#if defined(HAVE_UTIMES) && !defined(__CHECKER__)
static void
-utime_failed(const char *path, const struct timespec *tsp, VALUE atime, VALUE mtime)
+utime_internal(path, arg)
+ const char *path;
+ void *arg;
{
- if (tsp && errno == EINVAL) {
- VALUE e[2], a = Qnil, m = Qnil;
- int d = 0;
- if (!NIL_P(atime)) {
- a = rb_inspect(atime);
- }
- if (!NIL_P(mtime) && mtime != atime && !rb_equal(atime, mtime)) {
- m = rb_inspect(mtime);
- }
- if (NIL_P(a)) e[0] = m;
- else if (NIL_P(m) || rb_str_cmp(a, m) == 0) e[0] = a;
- else {
- e[0] = rb_str_plus(a, rb_str_new_cstr(" or "));
- rb_str_append(e[0], m);
- d = 1;
- }
- if (!NIL_P(e[0])) {
- if (path) {
- if (!d) e[0] = rb_str_dup(e[0]);
- rb_str_cat2(rb_str_cat2(e[0], " for "), path);
- }
- e[1] = INT2FIX(EINVAL);
- rb_exc_raise(rb_class_new_instance(2, e, rb_eSystemCallError));
- }
- errno = EINVAL;
- }
- rb_sys_fail(path);
+ struct timeval *tvp = arg;
+ if (utimes(path, tvp) < 0)
+ rb_sys_fail(path);
}
-#else
-#define utime_failed(path, tsp, atime, mtime) rb_sys_fail(path)
-#endif
-#if defined(HAVE_UTIMES)
+/*
+ * 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 void
-utime_internal(const char *path, void *arg)
-{
- struct utime_args *v = arg;
- const struct timespec *tsp = v->tsp;
- struct timeval tvbuf[2], *tvp = NULL;
-
-#ifdef HAVE_UTIMENSAT
- static int try_utimensat = 1;
-
- if (try_utimensat) {
- if (utimensat(AT_FDCWD, path, tsp, 0) < 0) {
- if (errno == ENOSYS) {
- try_utimensat = 0;
- goto no_utimensat;
- }
- utime_failed(path, tsp, v->atime, v->mtime);
- }
- return;
- }
-no_utimensat:
-#endif
+static VALUE
+rb_file_s_utime(argc, argv)
+ int argc;
+ VALUE *argv;
+{
+ VALUE atime, mtime, rest;
+ struct timeval tvs[2], *tvp = NULL;
+ long n;
- if (tsp) {
- tvbuf[0].tv_sec = tsp[0].tv_sec;
- tvbuf[0].tv_usec = (int)(tsp[0].tv_nsec / 1000);
- tvbuf[1].tv_sec = tsp[1].tv_sec;
- tvbuf[1].tv_usec = (int)(tsp[1].tv_nsec / 1000);
- tvp = tvbuf;
+ rb_secure(2);
+ rb_scan_args(argc, argv, "2*", &atime, &mtime, &rest);
+
+ if (!NIL_P(atime) || !NIL_P(mtime)) {
+ tvp = tvs;
+ tvp[0] = rb_time_timeval(atime);
+ tvp[1] = rb_time_timeval(mtime);
}
- if (utimes(path, tvp) < 0)
- utime_failed(path, tsp, v->atime, v->mtime);
+
+ n = apply2files(utime_internal, rest, tvp);
+ return LONG2FIX(n);
}
#else
@@ -2174,168 +2040,139 @@ struct utimbuf {
#endif
static void
-utime_internal(const char *path, void *arg)
+utime_internal(path, arg)
+ const char *path;
+ void *arg;
{
- struct utime_args *v = arg;
- const struct timespec *tsp = v->tsp;
- struct utimbuf utbuf, *utp = NULL;
- if (tsp) {
- utbuf.actime = tsp[0].tv_sec;
- utbuf.modtime = tsp[1].tv_sec;
- utp = &utbuf;
- }
+ struct utimbuf *utp = arg;
if (utime(path, utp) < 0)
- utime_failed(path, tsp, v->atime, v->mtime);
+ rb_sys_fail(path);
}
-#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
-rb_file_s_utime(int argc, VALUE *argv)
+rb_file_s_utime(argc, argv)
+ int argc;
+ VALUE *argv;
{
- VALUE rest;
- struct utime_args args;
- struct timespec tss[2], *tsp = NULL;
+ VALUE atime, mtime, rest;
long n;
+ struct timeval tv;
+ struct utimbuf utbuf, *utp = NULL;
- rb_secure(2);
- rb_scan_args(argc, argv, "2*", &args.atime, &args.mtime, &rest);
+ rb_scan_args(argc, argv, "2*", &atime, &mtime, &rest);
- if (!NIL_P(args.atime) || !NIL_P(args.mtime)) {
- tsp = tss;
- tsp[0] = rb_time_timespec(args.atime);
- tsp[1] = rb_time_timespec(args.mtime);
+ if (!NIL_P(atime) || !NIL_P(mtime)) {
+ utp = &utbuf;
+ tv = rb_time_timeval(atime);
+ utp->actime = tv.tv_sec;
+ tv = rb_time_timeval(mtime);
+ utp->modtime = tv.tv_sec;
}
- args.tsp = tsp;
- n = apply2files(utime_internal, rest, &args);
+ n = apply2files(utime_internal, rest, utp);
return LONG2FIX(n);
}
-NORETURN(static void sys_fail2(VALUE,VALUE));
+#endif
+
+NORETURN(static void sys_fail2 _((VALUE,VALUE)));
static void
-sys_fail2(VALUE s1, VALUE s2)
+sys_fail2(s1, s2)
+ VALUE s1, s2;
{
char *buf;
-#ifdef MAX_PATH
- const int max_pathlen = MAX_PATH;
-#else
- const int max_pathlen = MAXPATHLEN;
-#endif
- const char *e1, *e2;
- int len = 5;
- long l1 = RSTRING_LEN(s1), l2 = RSTRING_LEN(s2);
+ int len;
- e1 = e2 = "";
- if (l1 > max_pathlen) {
- l1 = max_pathlen - 3;
- e1 = "...";
- len += 3;
- }
- if (l2 > max_pathlen) {
- l2 = max_pathlen - 3;
- e2 = "...";
- len += 3;
- }
- len += (int)l1 + (int)l2;
+ len = RSTRING(s1)->len + RSTRING(s2)->len + 5;
buf = ALLOCA_N(char, len);
- snprintf(buf, len, "(%.*s%s, %.*s%s)",
- (int)l1, RSTRING_PTR(s1), e1,
- (int)l2, RSTRING_PTR(s2), e2);
+ snprintf(buf, len, "%s or %s", RSTRING(s1)->ptr, RSTRING(s2)->ptr);
rb_sys_fail(buf);
}
-#ifdef HAVE_LINK
/*
* call-seq:
* File.link(old_name, new_name) => 0
- *
+ *
* 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 <code>SystemCallError</code>). Not available on all platforms.
- *
+ *
* File.link("testfile", ".testfile") #=> 0
* IO.readlines(".testfile")[0] #=> "This is line one\n"
*/
static VALUE
-rb_file_s_link(VALUE klass, VALUE from, VALUE to)
+rb_file_s_link(klass, from, to)
+ VALUE klass, from, to;
{
- rb_secure(2);
- FilePathValue(from);
- FilePathValue(to);
+#ifdef HAVE_LINK
+ SafeStringValue(from);
+ SafeStringValue(to);
if (link(StringValueCStr(from), StringValueCStr(to)) < 0) {
sys_fail2(from, to);
}
return INT2FIX(0);
-}
#else
-#define rb_file_s_link rb_f_notimplement
+ rb_notimplement();
+ return Qnil; /* not reached */
#endif
+}
-#ifdef HAVE_SYMLINK
/*
* call-seq:
* 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 <code>NotImplemented</code> exception on
* platforms that do not support symbolic links.
- *
+ *
* File.symlink("testfile", "link2test") #=> 0
- *
+ *
*/
static VALUE
-rb_file_s_symlink(VALUE klass, VALUE from, VALUE to)
+rb_file_s_symlink(klass, from, to)
+ VALUE klass, from, to;
{
- rb_secure(2);
- FilePathValue(from);
- FilePathValue(to);
+#ifdef HAVE_SYMLINK
+ SafeStringValue(from);
+ SafeStringValue(to);
if (symlink(StringValueCStr(from), StringValueCStr(to)) < 0) {
sys_fail2(from, to);
}
return INT2FIX(0);
-}
#else
-#define rb_file_s_symlink rb_f_notimplement
+ rb_notimplement();
+ return Qnil; /* not reached */
#endif
+}
-#ifdef HAVE_READLINK
/*
* call-seq:
* File.readlink(link_name) -> file_name
- *
+ *
* Returns the name of the file referenced by the given link.
* Not available on all platforms.
- *
+ *
* File.symlink("testfile", "link2test") #=> 0
* File.readlink("link2test") #=> "testfile"
*/
static VALUE
-rb_file_s_readlink(VALUE klass, VALUE path)
+rb_file_s_readlink(klass, path)
+ VALUE klass, path;
{
+#ifdef HAVE_READLINK
char *buf;
int size = 100;
- ssize_t rv;
+ int rv;
VALUE v;
- rb_secure(2);
- FilePathValue(path);
+ SafeStringValue(path);
buf = xmalloc(size);
- while ((rv = readlink(RSTRING_PTR(path), buf, size)) == size
+ while ((rv = readlink(RSTRING(path)->ptr, buf, size)) == size
#ifdef _AIX
|| (rv < 0 && errno == ERANGE) /* quirky behavior of GPFS */
#endif
@@ -2344,20 +2181,24 @@ rb_file_s_readlink(VALUE klass, VALUE path)
buf = xrealloc(buf, size);
}
if (rv < 0) {
- xfree(buf);
- rb_sys_fail_path(path);
+ free(buf);
+ rb_sys_fail(RSTRING(path)->ptr);
}
v = rb_tainted_str_new(buf, rv);
- xfree(buf);
+ free(buf);
return v;
-}
#else
-#define rb_file_s_readlink rb_f_notimplement
+ rb_notimplement();
+ return Qnil; /* not reached */
#endif
+}
+static void unlink_internal _((const char *, void *));
static void
-unlink_internal(const char *path, void *arg)
+unlink_internal(path, arg)
+ const char *path;
+ void *arg;
{
if (unlink(path) < 0)
rb_sys_fail(path);
@@ -2367,14 +2208,15 @@ unlink_internal(const char *path, void *arg)
* call-seq:
* File.delete(file_name, ...) => integer
* File.unlink(file_name, ...) => integer
- *
+ *
* Deletes the named files, returning the number of names
* passed as arguments. Raises an exception on any error.
* See also <code>Dir::rmdir</code>.
*/
static VALUE
-rb_file_s_unlink(VALUE klass, VALUE args)
+rb_file_s_unlink(klass, args)
+ VALUE klass, args;
{
long n;
@@ -2386,21 +2228,21 @@ rb_file_s_unlink(VALUE klass, VALUE args)
/*
* call-seq:
* File.rename(old_name, new_name) => 0
- *
+ *
* 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
*/
static VALUE
-rb_file_s_rename(VALUE klass, VALUE from, VALUE to)
+rb_file_s_rename(klass, from, to)
+ VALUE klass, from, to;
{
const char *src, *dst;
+ SafeStringValue(from);
+ SafeStringValue(to);
- rb_secure(2);
- FilePathValue(from);
- FilePathValue(to);
src = StringValueCStr(from);
dst = StringValueCStr(to);
#if defined __CYGWIN__
@@ -2429,19 +2271,21 @@ rb_file_s_rename(VALUE klass, VALUE from, VALUE to)
* call-seq:
* File.umask() => integer
* File.umask(integer) => integer
- *
+ *
* Returns the current umask value for this process. If the optional
* argument is given, set the umask to that value and return the
* previous value. Umask values are <em>subtracted</em> from the
* default permissions, so a umask of <code>0222</code> would make a
* file read-only for everyone.
- *
+ *
* File.umask(0006) #=> 18
* File.umask #=> 6
*/
static VALUE
-rb_file_s_umask(int argc, VALUE *argv)
+rb_file_s_umask(argc, argv)
+ int argc;
+ VALUE *argv;
{
int omask = 0;
@@ -2470,27 +2314,34 @@ rb_file_s_umask(int argc, VALUE *argv)
#define isdirsep(x) ((x) == '/')
#endif
-#ifndef USE_NTFS
#if defined _WIN32 || defined __CYGWIN__
#define USE_NTFS 1
#else
#define USE_NTFS 0
#endif
+
+#ifdef DOSISH_DRIVE_LETTER
+#include <ctype.h>
#endif
#if USE_NTFS
-#define istrailinggarbage(x) ((x) == '.' || (x) == ' ')
+#define istrailinggabage(x) ((x) == '.' || (x) == ' ')
#else
-#define istrailinggarbage(x) 0
+#define istrailinggabage(x) 0
#endif
#ifndef CharNext /* defined as CharNext[AW] on Windows. */
-# define CharNext(p) ((p) + 1)
+# if defined(DJGPP)
+# define CharNext(p) ((p) + mblen(p, MB_CUR_MAX))
+# else
+# define CharNext(p) ((p) + 1)
+# endif
#endif
#ifdef DOSISH_DRIVE_LETTER
static inline int
-has_drive_letter(const char *buf)
+has_drive_letter(buf)
+ const char *buf;
{
if (ISALPHA(buf[0]) && buf[1] == ':') {
return 1;
@@ -2501,7 +2352,8 @@ has_drive_letter(const char *buf)
}
static char*
-getcwdofdrv(int drv)
+getcwdofdrv(drv)
+ int drv;
{
char drive[4];
char *drvcwd, *oldcwd;
@@ -2518,7 +2370,7 @@ getcwdofdrv(int drv)
if (chdir(drive) == 0) {
drvcwd = my_getcwd();
chdir(oldcwd);
- xfree(oldcwd);
+ free(oldcwd);
}
else {
/* perhaps the drive is not exist. we return only drive letter */
@@ -2529,7 +2381,8 @@ getcwdofdrv(int drv)
#endif
static inline char *
-skiproot(const char *path)
+skiproot(path)
+ const char *path;
{
#ifdef DOSISH_DRIVE_LETTER
if (has_drive_letter(path)) path += 2;
@@ -2540,7 +2393,8 @@ skiproot(const char *path)
#define nextdirsep rb_path_next
char *
-rb_path_next(const char *s)
+rb_path_next(s)
+ const char *s;
{
while (*s && !isdirsep(*s)) {
s = CharNext(s);
@@ -2548,15 +2402,16 @@ rb_path_next(const char *s)
return (char *)s;
}
-#if defined(DOSISH_UNC) || defined(DOSISH_DRIVE_LETTER)
+#if defined(DOSISH_UNC) || defined(DOSISH_DRIVE_LETTER)
#define skipprefix rb_path_skip_prefix
#else
#define skipprefix(path) (path)
#endif
char *
-rb_path_skip_prefix(const char *path)
+rb_path_skip_prefix(path)
+ const char *path;
{
-#if defined(DOSISH_UNC) || defined(DOSISH_DRIVE_LETTER)
+#if defined(DOSISH_UNC) || defined(DOSISH_DRIVE_LETTER)
#ifdef DOSISH_UNC
if (isdirsep(path[0]) && isdirsep(path[1])) {
path += 2;
@@ -2576,7 +2431,8 @@ rb_path_skip_prefix(const char *path)
#define strrdirsep rb_path_last_separator
char *
-rb_path_last_separator(const char *path)
+rb_path_last_separator(path)
+ const char *path;
{
char *last = NULL;
while (*path) {
@@ -2594,7 +2450,8 @@ rb_path_last_separator(const char *path)
}
static char *
-chompdirsep(const char *path)
+chompdirsep(path)
+ const char *path;
{
while (*path) {
if (isdirsep(*path)) {
@@ -2610,7 +2467,8 @@ chompdirsep(const char *path)
}
char *
-rb_path_end(const char *path)
+rb_path_end(path)
+ const char *path;
{
if (isdirsep(*path)) path++;
return chompdirsep(path);
@@ -2622,9 +2480,9 @@ ntfs_tail(const char *path)
{
while (*path == '.') path++;
while (*path && *path != ':') {
- if (istrailinggarbage(*path)) {
+ if (istrailinggabage(*path)) {
const char *last = path++;
- while (istrailinggarbage(*path)) path++;
+ while (istrailinggabage(*path)) path++;
if (!*path || *path == ':') return (char *)last;
}
else if (isdirsep(*path)) {
@@ -2642,7 +2500,7 @@ ntfs_tail(const char *path)
#endif
#define BUFCHECK(cond) do {\
- bdiff = p - buf;\
+ long bdiff = p - buf;\
if (cond) {\
do {buflen *= 2;} while (cond);\
rb_str_resize(result, buflen);\
@@ -2653,91 +2511,74 @@ ntfs_tail(const char *path)
} while (0)
#define BUFINIT() (\
- p = buf = RSTRING_PTR(result),\
- buflen = RSTRING_LEN(result),\
+ p = buf = RSTRING(result)->ptr,\
+ buflen = RSTRING(result)->len,\
pend = p + buflen)
-#define SET_EXTERNAL_ENCODING() (\
- (void)(extenc || (extenc = rb_default_external_encoding())),\
- rb_enc_associate(result, extenc))
-
-static int is_absolute_path(const char*);
-
-VALUE
-rb_home_dir(const char *user, VALUE result)
-{
- const char *dir;
- char *buf;
-#if defined DOSISH || defined __CYGWIN__
- char *p;
+#if !defined(TOLOWER)
+#define TOLOWER(c) (ISUPPER(c) ? tolower(c) : (c))
#endif
- long dirlen;
- if (!user || !*user) {
- if (!(dir = getenv("HOME"))) {
- rb_raise(rb_eArgError, "couldn't find HOME environment -- expanding `~'");
- }
- dirlen = strlen(dir);
- rb_str_resize(result, dirlen);
- memcpy(buf = RSTRING_PTR(result), dir, dirlen);
- }
- else {
-#ifdef HAVE_PWD_H
- struct passwd *pwPtr = getpwnam(user);
- if (!pwPtr) {
- endpwent();
- rb_raise(rb_eArgError, "user %s doesn't exist", user);
- }
- dirlen = strlen(pwPtr->pw_dir);
- rb_str_resize(result, dirlen);
- strcpy(buf = RSTRING_PTR(result), pwPtr->pw_dir);
- endpwent();
-#else
- return Qnil;
-#endif
- }
-#if defined DOSISH || defined __CYGWIN__
- for (p = buf; *p; p = CharNext(p)) {
- if (*p == '\\') {
- *p = '/';
- }
- }
-#endif
- return result;
-}
+static int is_absolute_path _((const char*));
static VALUE
-file_expand_path(VALUE fname, VALUE dname, int abs_mode, VALUE result)
+file_expand_path(fname, dname, result)
+ VALUE fname, dname, result;
{
const char *s, *b;
char *buf, *p, *pend, *root;
- size_t buflen, dirlen, bdiff;
+ long buflen, dirlen;
int tainted;
- rb_encoding *extenc = 0;
- FilePathValue(fname);
s = StringValuePtr(fname);
BUFINIT();
tainted = OBJ_TAINTED(fname);
- if (s[0] == '~' && abs_mode == 0) { /* execute only if NOT absolute_path() */
- tainted = 1;
+ if (s[0] == '~') {
if (isdirsep(s[1]) || s[1] == '\0') {
- buf = 0;
- rb_str_set_len(result, 0);
- if (*++s) ++s;
+ const char *dir = getenv("HOME");
+
+ if (!dir) {
+ rb_raise(rb_eArgError, "couldn't find HOME environment -- expanding `%s'", s);
+ }
+ dirlen = strlen(dir);
+ BUFCHECK(dirlen > buflen);
+ strcpy(buf, dir);
+#if defined DOSISH || defined __CYGWIN__
+ for (p = buf; *p; p = CharNext(p)) {
+ if (*p == '\\') {
+ *p = '/';
+ }
+ }
+#else
+ p = buf + strlen(dir);
+#endif
+ s++;
+ tainted = 1;
}
else {
+#ifdef HAVE_PWD_H
+ struct passwd *pwPtr;
+ s++;
+#endif
s = nextdirsep(b = s);
BUFCHECK(bdiff + (s-b) >= buflen);
memcpy(p, b, s-b);
- rb_str_set_len(result, s-b);
- buf = p + 1;
p += s-b;
+ *p = '\0';
+#ifdef HAVE_PWD_H
+ pwPtr = getpwnam(buf);
+ if (!pwPtr) {
+ endpwent();
+ rb_raise(rb_eArgError, "user %s doesn't exist", buf);
+ }
+ dirlen = strlen(pwPtr->pw_dir);
+ BUFCHECK(dirlen > buflen);
+ strcpy(buf, pwPtr->pw_dir);
+ p = buf + strlen(pwPtr->pw_dir);
+ endpwent();
+#endif
}
- rb_home_dir(buf, result);
- BUFINIT();
- p = pend;
}
#ifdef DOSISH_DRIVE_LETTER
/* skip drive letter */
@@ -2749,13 +2590,12 @@ file_expand_path(VALUE fname, VALUE dname, int abs_mode, VALUE result)
memcpy(p, s, 2);
p += 2;
s += 2;
- rb_enc_copy(result, fname);
}
else {
/* specified drive, but not full path */
int same = 0;
if (!NIL_P(dname)) {
- file_expand_path(dname, Qnil, abs_mode, result);
+ file_expand_path(dname, Qnil, result);
BUFINIT();
if (has_drive_letter(p) && TOLOWER(p[0]) == TOLOWER(s[0])) {
/* ok, same drive */
@@ -2769,8 +2609,7 @@ file_expand_path(VALUE fname, VALUE dname, int abs_mode, VALUE result)
dirlen = strlen(dir);
BUFCHECK(dirlen > buflen);
strcpy(buf, dir);
- xfree(dir);
- SET_EXTERNAL_ENCODING();
+ free(dir);
}
p = chompdirsep(skiproot(buf));
s += 2;
@@ -2779,7 +2618,7 @@ file_expand_path(VALUE fname, VALUE dname, int abs_mode, VALUE result)
#endif
else if (!is_absolute_path(s)) {
if (!NIL_P(dname)) {
- file_expand_path(dname, Qnil, abs_mode, result);
+ file_expand_path(dname, Qnil, result);
BUFINIT();
}
else {
@@ -2789,8 +2628,7 @@ file_expand_path(VALUE fname, VALUE dname, int abs_mode, VALUE result)
dirlen = strlen(dir);
BUFCHECK(dirlen > buflen);
strcpy(buf, dir);
- xfree(dir);
- SET_EXTERNAL_ENCODING();
+ free(dir);
}
#if defined DOSISH || defined __CYGWIN__
if (isdirsep(*s)) {
@@ -2808,16 +2646,12 @@ file_expand_path(VALUE fname, VALUE dname, int abs_mode, VALUE result)
p = buf + (s - b);
BUFCHECK(bdiff >= buflen);
memset(buf, '/', p - buf);
- rb_enc_copy(result, fname);
}
if (p > buf && p[-1] == '/')
--p;
- else {
- BUFCHECK(bdiff + 1 >= buflen);
+ else
*p = '/';
- }
- BUFCHECK(bdiff + 1 >= buflen);
p[1] = 0;
root = skipprefix(buf);
@@ -2845,7 +2679,7 @@ file_expand_path(VALUE fname, VALUE dname, int abs_mode, VALUE result)
}
#if USE_NTFS
else {
- do ++s; while (istrailinggarbage(*s));
+ do *++s; while (istrailinggabage(*s));
}
#endif
break;
@@ -2865,7 +2699,7 @@ file_expand_path(VALUE fname, VALUE dname, int abs_mode, VALUE result)
--s;
case ' ': {
const char *e = s;
- while (istrailinggarbage(*s)) s++;
+ while (istrailinggabage(*s)) s++;
if (!*s) {
s = e;
goto endpath;
@@ -2896,18 +2730,12 @@ file_expand_path(VALUE fname, VALUE dname, int abs_mode, VALUE result)
if (s > b) {
#if USE_NTFS
- static const char prime[] = ":$DATA";
- enum {prime_len = sizeof(prime) -1};
endpath:
- if (s > b + prime_len && strncasecmp(s - prime_len, prime, prime_len) == 0) {
+ if (s > b + 6 && strncasecmp(s - 6, ":$DATA", 6) == 0) {
/* alias of stream */
/* get rid of a bug of x64 VC++ */
- if (*(s - (prime_len+1)) == ':') {
- s -= prime_len + 1; /* prime */
- }
- else if (memchr(b, ':', s - prime_len - b)) {
- s -= prime_len; /* alternative */
- }
+ if (*(s-7) == ':') s -= 7; /* prime */
+ else if (memchr(b, ':', s - 6 - b)) s -= 6; /* alternative */
}
#endif
BUFCHECK(bdiff + (s-b) >= buflen);
@@ -2916,7 +2744,7 @@ file_expand_path(VALUE fname, VALUE dname, int abs_mode, VALUE result)
}
if (p == skiproot(buf) - 1) p++;
-#if USE_NTFS && defined __WIN32__
+#if USE_NTFS
*p = '\0';
if ((s = strrdirsep(b = buf)) != 0 && !strpbrk(s, "*?")) {
size_t len;
@@ -2937,7 +2765,7 @@ file_expand_path(VALUE fname, VALUE dname, int abs_mode, VALUE result)
*p = '\\';
strlcat(w32buf, p, sizeof(w32buf));
len = strlen(p);
- if (len > 4 && STRCASECMP(p + len - 4, ".lnk") != 0) {
+ if (len > 4 && strcasecmp(p + len - 4, ".lnk") != 0) {
lnk_added = 1;
strlcat(w32buf, ".lnk", sizeof(w32buf));
}
@@ -2950,7 +2778,7 @@ file_expand_path(VALUE fname, VALUE dname, int abs_mode, VALUE result)
len = strlen(wfd.cFileName);
#ifdef __CYGWIN__
if (lnk_added && len > 4 &&
- STRCASECMP(wfd.cFileName + len - 4, ".lnk") == 0) {
+ strcasecmp(wfd.cFileName + len - 4, ".lnk") == 0) {
wfd.cFileName[len -= 4] = '\0';
}
#else
@@ -2971,20 +2799,20 @@ file_expand_path(VALUE fname, VALUE dname, int abs_mode, VALUE result)
if (tainted) OBJ_TAINT(result);
rb_str_set_len(result, p - buf);
- rb_enc_check(fname, result);
return result;
}
VALUE
-rb_file_expand_path(VALUE fname, VALUE dname)
+rb_file_expand_path(fname, dname)
+ VALUE fname, dname;
{
- return file_expand_path(fname, dname, 0, rb_usascii_str_new(0, MAXPATHLEN + 2));
+ return file_expand_path(fname, dname, rb_str_new(0, MAXPATHLEN + 2));
}
/*
* call-seq:
* File.expand_path(file_name [, dir_string] ) -> abs_file_name
- *
+ *
* Converts a pathname to an absolute pathname. Relative paths are
* referenced from the current working directory of the process unless
* <i>dir_string</i> is given, in which case it will be used as the
@@ -2993,13 +2821,15 @@ rb_file_expand_path(VALUE fname, VALUE dname)
* directory (the environment variable <code>HOME</code> must be set
* correctly). ``<code>~</code><i>user</i>'' expands to the named
* user's home directory.
- *
+ *
* File.expand_path("~oracle/bin") #=> "/home/oracle/bin"
* File.expand_path("../../bin", "/tmp/x") #=> "/bin"
*/
VALUE
-rb_file_s_expand_path(int argc, VALUE *argv)
+rb_file_s_expand_path(argc, argv)
+ int argc;
+ VALUE *argv;
{
VALUE fname, dname;
@@ -3011,54 +2841,21 @@ rb_file_s_expand_path(int argc, VALUE *argv)
return rb_file_expand_path(fname, dname);
}
-VALUE
-rb_file_absolute_path(VALUE fname, VALUE dname)
-{
- return file_expand_path(fname, dname, 1, rb_usascii_str_new(0, MAXPATHLEN + 2));
-}
-
-/*
- * call-seq:
- * File.absolute_path(file_name [, dir_string] ) -> abs_file_name
- *
- * Converts a pathname to an absolute pathname. Relative paths are
- * referenced from the current working directory of the process unless
- * <i>dir_string</i> is given, in which case it will be used as the
- * starting point. If the given pathname starts with a ``<code>~</code>''
- * it is NOT expanded, it is treated as a normal directory name.
- *
- * File.absolute_path("~oracle/bin") #=> "<relative_path>/~oracle/bin"
- */
-
-VALUE
-rb_file_s_absolute_path(int argc, VALUE *argv)
-{
- VALUE fname, dname;
-
- if (argc == 1) {
- return rb_file_absolute_path(argv[0], Qnil);
- }
- rb_scan_args(argc, argv, "11", &fname, &dname);
-
- return rb_file_absolute_path(fname, dname);
-}
-
-static size_t
-rmext(const char *p, long l1, const char *e)
+static int
+rmext(p, l1, e)
+ const char *p, *e;
+ int l1;
{
- long l0, l2;
+ int l2;
if (!e) return 0;
- for (l0 = 0; l0 < l1; ++l0) {
- if (p[l0] != '.') break;
- }
l2 = strlen(e);
if (l2 == 2 && e[1] == '*') {
unsigned char c = *e;
e = p + l1;
do {
- if (e <= p + l0) return 0;
+ if (e <= p) return 0;
} while (*--e != c);
return e - p;
}
@@ -3078,33 +2875,35 @@ rmext(const char *p, long l1, const char *e)
/*
* call-seq:
* File.basename(file_name [, suffix] ) -> base_name
- *
+ *
* Returns the last component of the filename given in <i>file_name</i>,
* which must be formed using forward slashes (``<code>/</code>'')
* regardless of the separator used on the local file system. If
* <i>suffix</i> is given and present at the end of <i>file_name</i>,
* it is removed.
- *
+ *
* File.basename("/home/gumby/work/ruby.rb") #=> "ruby.rb"
* File.basename("/home/gumby/work/ruby.rb", ".rb") #=> "ruby"
*/
static VALUE
-rb_file_s_basename(int argc, VALUE *argv)
+rb_file_s_basename(argc, argv)
+ int argc;
+ VALUE *argv;
{
VALUE fname, fext, basename;
const char *name, *p;
#if defined DOSISH_DRIVE_LETTER || defined DOSISH_UNC
const char *root;
#endif
- long f, n;
+ int f, n;
if (rb_scan_args(argc, argv, "11", &fname, &fext) == 2) {
StringValue(fext);
}
- FilePathStringValue(fname);
- if (RSTRING_LEN(fname) == 0 || !*(name = RSTRING_PTR(fname)))
- return rb_str_new_shared(fname);
+ StringValue(fname);
+ if (RSTRING(fname)->len == 0 || !*(name = RSTRING(fname)->ptr))
+ return fname;
name = skipprefix(name);
#if defined DOSISH_DRIVE_LETTER || defined DOSISH_UNC
root = name;
@@ -3146,10 +2945,9 @@ rb_file_s_basename(int argc, VALUE *argv)
if (NIL_P(fext) || !(f = rmext(p, n, StringValueCStr(fext)))) {
f = n;
}
- if (f == RSTRING_LEN(fname)) return rb_str_new_shared(fname);
+ if (f == RSTRING_LEN(fname)) return fname;
}
basename = rb_str_new(p, f);
- rb_enc_copy(basename, fname);
OBJ_INFECT(basename, fname);
return basename;
}
@@ -3157,22 +2955,22 @@ rb_file_s_basename(int argc, VALUE *argv)
/*
* call-seq:
* File.dirname(file_name ) -> dir_name
- *
+ *
* Returns all components of the filename given in <i>file_name</i>
* except the last one. The filename must be formed using forward
* slashes (``<code>/</code>'') regardless of the separator used on the
* local file system.
- *
+ *
* File.dirname("/home/gumby/work/ruby.rb") #=> "/home/gumby/work"
*/
static VALUE
-rb_file_s_dirname(VALUE klass, VALUE fname)
+rb_file_s_dirname(klass, fname)
+ VALUE klass, fname;
{
const char *name, *root, *p;
VALUE dirname;
- FilePathStringValue(fname);
name = StringValueCStr(fname);
root = skiproot(name);
#ifdef DOSISH_UNC
@@ -3187,7 +2985,7 @@ rb_file_s_dirname(VALUE klass, VALUE fname)
p = root;
}
if (p == name)
- return rb_usascii_str_new2(".");
+ return rb_str_new2(".");
#ifdef DOSISH_DRIVE_LETTER
if (has_drive_letter(name) && isdirsep(*(name + 2))) {
const char *top = skiproot(name + 2);
@@ -3201,7 +2999,6 @@ rb_file_s_dirname(VALUE klass, VALUE fname)
if (has_drive_letter(name) && root == name + 2 && p - name == 2)
rb_str_cat(dirname, ".", 1);
#endif
- rb_enc_copy(dirname, fname);
OBJ_INFECT(dirname, fname);
return dirname;
}
@@ -3209,24 +3006,24 @@ rb_file_s_dirname(VALUE klass, VALUE fname)
/*
* call-seq:
* File.extname(path) -> string
- *
+ *
* Returns the extension (the portion of file name in <i>path</i>
* after the period).
- *
+ *
* File.extname("test.rb") #=> ".rb"
* File.extname("a/b/d/test.rb") #=> ".rb"
* File.extname("test") #=> ""
* File.extname(".profile") #=> ""
- *
+ *
*/
static VALUE
-rb_file_s_extname(VALUE klass, VALUE fname)
+rb_file_s_extname(klass, fname)
+ VALUE klass, fname;
{
const char *name, *p, *e;
VALUE extname;
- FilePathStringValue(fname);
name = StringValueCStr(fname);
p = strrdirsep(name); /* get the last path component */
if (!p)
@@ -3235,12 +3032,11 @@ rb_file_s_extname(VALUE klass, VALUE fname)
name = ++p;
e = 0;
- while (*p && *p == '.') p++;
while (*p) {
- if (*p == '.' || istrailinggarbage(*p)) {
+ if (*p == '.' || istrailinggabage(*p)) {
#if USE_NTFS
const char *last = p++, *dot = last;
- while (istrailinggarbage(*p)) {
+ while (istrailinggabage(*p)) {
if (*p == '.') dot = p;
p++;
}
@@ -3248,7 +3044,7 @@ rb_file_s_extname(VALUE klass, VALUE fname)
p = last;
break;
}
- if (*last == '.' || dot > last) e = dot;
+ if (*last == '.') e = dot;
continue;
#else
e = p; /* get the last dot of the last component */
@@ -3266,196 +3062,185 @@ rb_file_s_extname(VALUE klass, VALUE fname)
if (!e || e == name || e+1 == p) /* no dot, or the only dot is first or end? */
return rb_str_new(0, 0);
extname = rb_str_new(e, p - e); /* keep the dot, too! */
- rb_enc_copy(extname, fname);
OBJ_INFECT(extname, fname);
return extname;
}
/*
* call-seq:
- * File.path(path) -> string
- *
- * Returns the string representation of the path
- *
- * File.path("/dev/null") #=> "/dev/null"
- * File.path(Pathname.new("/tmp")) #=> "/tmp"
- *
- */
-
-static VALUE
-rb_file_s_path(VALUE klass, VALUE fname)
-{
- return rb_get_path(fname);
-}
-
-/*
- * call-seq:
* 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
* <code>File::dirname</code> and <code>File::basename</code>.
- *
+ *
* File.split("/home/gumby/.profile") #=> ["/home/gumby", ".profile"]
*/
static VALUE
-rb_file_s_split(VALUE klass, VALUE path)
+rb_file_s_split(klass, path)
+ VALUE klass, path;
{
- FilePathStringValue(path); /* get rid of converting twice */
+ StringValue(path); /* get rid of converting twice */
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 rb_file_join _((VALUE ary, VALUE sep));
static VALUE
-file_inspect_join(VALUE ary, VALUE argp, int recur)
+file_inspect_join(ary, arg)
+ VALUE ary;
+ VALUE *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, VALUE sep)
+rb_file_join(ary, sep)
+ VALUE ary, sep;
{
long len, i;
+ int taint = 0;
VALUE result, tmp;
const char *name, *tail;
- if (RARRAY_LEN(ary) == 0) return rb_str_new(0, 0);
+ if (RARRAY(ary)->len == 0) return rb_str_new(0, 0);
+ if (OBJ_TAINTED(ary)) taint = 1;
+ if (OBJ_TAINTED(sep)) taint = 1;
len = 1;
- for (i=0; i<RARRAY_LEN(ary); i++) {
- if (TYPE(RARRAY_PTR(ary)[i]) == T_STRING) {
- len += RSTRING_LEN(RARRAY_PTR(ary)[i]);
+ for (i=0; i<RARRAY(ary)->len; i++) {
+ if (TYPE(RARRAY(ary)->ptr[i]) == T_STRING) {
+ len += RSTRING(RARRAY(ary)->ptr[i])->len;
}
else {
len += 10;
}
}
- if (!NIL_P(sep)) {
- StringValue(sep);
- len += RSTRING_LEN(sep) * RARRAY_LEN(ary) - 1;
+ if (!NIL_P(sep) && TYPE(sep) == T_STRING) {
+ len += RSTRING(sep)->len * RARRAY(ary)->len - 1;
}
result = rb_str_buf_new(len);
- OBJ_INFECT(result, ary);
- for (i=0; i<RARRAY_LEN(ary); i++) {
- tmp = RARRAY_PTR(ary)[i];
+ for (i=0; i<RARRAY(ary)->len; i++) {
+ tmp = RARRAY(ary)->ptr[i];
switch (TYPE(tmp)) {
case T_STRING:
break;
case T_ARRAY:
- if (ary == tmp) {
- rb_raise(rb_eArgError, "recursive array");
+ if (rb_inspecting_p(tmp)) {
+ tmp = rb_str_new2("[...]");
}
else {
VALUE args[2];
args[0] = tmp;
args[1] = sep;
- tmp = rb_exec_recursive(file_inspect_join, ary, (VALUE)args);
+ tmp = rb_protect_inspect(file_inspect_join, ary, (VALUE)args);
}
break;
default:
- FilePathStringValue(tmp);
+ StringValueCStr(tmp);
}
name = StringValueCStr(result);
if (i > 0 && !NIL_P(sep)) {
tail = chompdirsep(name);
- if (RSTRING_PTR(tmp) && isdirsep(RSTRING_PTR(tmp)[0])) {
- rb_str_set_len(result, tail - name);
+ if (RSTRING(tmp)->ptr && isdirsep(RSTRING(tmp)->ptr[0])) {
+ RSTRING(result)->len = tail - name;
}
else if (!*tail) {
rb_str_buf_append(result, sep);
}
}
rb_str_buf_append(result, tmp);
+ if (OBJ_TAINTED(tmp)) taint = 1;
}
+ if (taint) OBJ_TAINT(result);
return result;
}
/*
* call-seq:
* File.join(string, ...) -> path
- *
+ *
* Returns a new string formed by joining the strings using
* <code>File::SEPARATOR</code>.
- *
+ *
* File.join("usr", "mail", "gumby") #=> "usr/mail/gumby"
- *
+ *
*/
static VALUE
-rb_file_s_join(VALUE klass, VALUE args)
+rb_file_s_join(klass, args)
+ VALUE klass, args;
{
return rb_file_join(args, separator);
}
-#if defined(HAVE_TRUNCATE) || defined(HAVE_CHSIZE)
/*
* call-seq:
* File.truncate(file_name, integer) => 0
- *
+ *
* Truncates the file <i>file_name</i> to be at most <i>integer</i>
* bytes long. Not available on all platforms.
- *
+ *
* f = File.new("out", "w")
* f.write("1234567890") #=> 10
* f.close #=> nil
* File.truncate("out", 5) #=> 0
* File.size("out") #=> 5
- *
+ *
*/
static VALUE
-rb_file_s_truncate(VALUE klass, VALUE path, VALUE len)
+rb_file_s_truncate(klass, path, len)
+ VALUE klass, path, len;
{
off_t pos;
rb_secure(2);
pos = NUM2OFFT(len);
- FilePathValue(path);
+ SafeStringValue(path);
+
#ifdef HAVE_TRUNCATE
if (truncate(StringValueCStr(path), pos) < 0)
- rb_sys_fail(RSTRING_PTR(path));
-#else /* defined(HAVE_CHSIZE) */
+ rb_sys_fail(RSTRING(path)->ptr);
+#else
+# ifdef HAVE_CHSIZE
{
int tmpfd;
# ifdef _WIN32
if ((tmpfd = open(StringValueCStr(path), O_RDWR)) < 0) {
- rb_sys_fail(RSTRING_PTR(path));
+ rb_sys_fail(RSTRING(path)->ptr);
}
# else
if ((tmpfd = open(StringValueCStr(path), 0)) < 0) {
- rb_sys_fail(RSTRING_PTR(path));
+ rb_sys_fail(RSTRING(path)->ptr);
}
# endif
if (chsize(tmpfd, pos) < 0) {
close(tmpfd);
- rb_sys_fail(RSTRING_PTR(path));
+ rb_sys_fail(RSTRING(path)->ptr);
}
close(tmpfd);
}
+# else
+ rb_notimplement();
+# endif
#endif
return INT2FIX(0);
}
-#else
-#define rb_file_s_truncate rb_f_notimplement
-#endif
-#if defined(HAVE_FTRUNCATE) || defined(HAVE_CHSIZE)
/*
* call-seq:
* file.truncate(integer) => 0
- *
+ *
* Truncates <i>file</i> to at most <i>integer</i> bytes. The file
* must be opened for writing. Not available on all platforms.
- *
+ *
* f = File.new("out", "w")
* f.syswrite("1234567890") #=> 10
* f.truncate(5) #=> 0
@@ -3464,9 +3249,11 @@ rb_file_s_truncate(VALUE klass, VALUE path, VALUE len)
*/
static VALUE
-rb_file_truncate(VALUE obj, VALUE len)
+rb_file_truncate(obj, len)
+ VALUE obj, len;
{
rb_io_t *fptr;
+ FILE *f;
off_t pos;
rb_secure(2);
@@ -3475,19 +3262,22 @@ rb_file_truncate(VALUE obj, VALUE len)
if (!(fptr->mode & FMODE_WRITABLE)) {
rb_raise(rb_eIOError, "not opened for writing");
}
- rb_io_flush(obj);
+ f = GetWriteFile(fptr);
+ fflush(f);
+ fseeko(f, (off_t)0, SEEK_CUR);
#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(fptr->pathv);
+ if (ftruncate(fileno(f), pos) < 0)
+ rb_sys_fail(fptr->path);
+#else
+# ifdef HAVE_CHSIZE
+ if (chsize(fileno(f), pos) < 0)
+ rb_sys_fail(fptr->path);
+# else
+ rb_notimplement();
+# endif
#endif
return INT2FIX(0);
}
-#else
-#define rb_file_truncate rb_f_notimplement
-#endif
# ifndef LOCK_SH
# define LOCK_SH 1
@@ -3505,35 +3295,65 @@ rb_file_truncate(VALUE obj, VALUE len)
#ifdef __CYGWIN__
#include <winerror.h>
extern unsigned long __attribute__((stdcall)) GetLastError(void);
-#endif
-static VALUE
-rb_thread_flock(void *data)
+static int
+cygwin_flock(int fd, int op)
{
-#ifdef __CYGWIN__
int old_errno = errno;
-#endif
- int *op = data, ret = flock(op[0], op[1]);
-
-#ifdef __CYGWIN__
+ int ret = flock(fd, op);
if (GetLastError() == ERROR_NOT_LOCKED) {
ret = 0;
errno = old_errno;
}
+ return ret;
+}
+# define flock(fd, op) cygwin_flock(fd, op)
#endif
- return (VALUE)ret;
+
+static int
+rb_thread_flock(fd, op, fptr)
+ int fd, op;
+ rb_io_t *fptr;
+{
+ if (rb_thread_alone() || (op & LOCK_NB)) {
+ int ret;
+ TRAP_BEG;
+ ret = flock(fd, op);
+ TRAP_END;
+ return ret;
+ }
+ op |= LOCK_NB;
+ while (flock(fd, op) < 0) {
+ switch (errno) {
+ case EAGAIN:
+ case EACCES:
+#if defined(EWOULDBLOCK) && EWOULDBLOCK != EAGAIN
+ case EWOULDBLOCK:
+#endif
+ rb_thread_polling(); /* busy wait */
+ rb_io_check_closed(fptr);
+ continue;
+ default:
+ return -1;
+ }
+ }
+ return 0;
}
+#ifdef __CYGWIN__
+# undef flock
+#endif
+#define flock(fd, op) rb_thread_flock(fd, op, fptr)
/*
* call-seq:
* file.flock (locking_constant ) => 0 or false
- *
+ *
* 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 <code>File::LOCK_NB</code> is
* specified and the operation would otherwise have blocked. Not
* available on all platforms.
- *
+ *
* Locking constants (in class File):
*
* LOCK_EX | Exclusive lock. Only one process may hold an
@@ -3549,78 +3369,62 @@ rb_thread_flock(void *data)
*
* Example:
*
- * # update a counter using write lock
- * # don't use "w" because it truncates the file before lock.
- * File.open("counter", File::RDWR|File::CREAT, 0644) {|f|
- * f.flock(File::LOCK_EX)
- * value = f.read.to_i + 1
- * f.rewind
- * f.write("#{value}\n")
- * f.flush
- * f.truncate(f.pos)
- * }
- *
- * # read the counter using read lock
- * File.open("counter", "r") {|f|
- * f.flock(File::LOCK_SH)
- * p f.read
- * }
- *
+ * File.new("testfile").flock(File::LOCK_UN) #=> 0
+ *
*/
static VALUE
-rb_file_flock(VALUE obj, VALUE operation)
+rb_file_flock(obj, operation)
+ VALUE obj;
+ VALUE operation;
{
+#ifndef __CHECKER__
rb_io_t *fptr;
- int op[2], op1;
+ int op;
rb_secure(2);
- op[1] = op1 = NUM2INT(operation);
+ op = NUM2INT(operation);
GetOpenFile(obj, fptr);
- op[0] = fptr->fd;
if (fptr->mode & FMODE_WRITABLE) {
- rb_io_flush(obj);
+ fflush(GetWriteFile(fptr));
}
- while ((int)rb_thread_blocking_region(rb_thread_flock, op, RUBY_UBF_IO, 0) < 0) {
+ retry:
+ if (flock(fileno(fptr->f), op) < 0) {
switch (errno) {
case EAGAIN:
case EACCES:
#if defined(EWOULDBLOCK) && EWOULDBLOCK != EAGAIN
case EWOULDBLOCK:
#endif
- if (op1 & LOCK_NB) return Qfalse;
- rb_thread_polling();
- rb_io_check_closed(fptr);
- continue;
-
+ return Qfalse;
case EINTR:
#if defined(ERESTART)
case ERESTART:
#endif
- break;
-
- default:
- rb_sys_fail_path(fptr->pathv);
+ goto retry;
}
+ rb_sys_fail(fptr->path);
}
+#endif
return INT2FIX(0);
}
#undef flock
static void
-test_check(int n, int argc, VALUE *argv)
+test_check(n, argc, argv)
+ int n, argc;
+ VALUE *argv;
{
int i;
- rb_secure(2);
n+=1;
if (n != argc) rb_raise(rb_eArgError, "wrong number of arguments (%d for %d)", argc, n);
for (i=1; i<n; i++) {
switch (TYPE(argv[i])) {
case T_STRING:
default:
- FilePathValue(argv[i]);
+ SafeStringValue(argv[i]);
break;
case T_FILE:
break;
@@ -3633,11 +3437,11 @@ test_check(int n, int argc, VALUE *argv)
/*
* call-seq:
* test(int_cmd, file1 [, file2] ) => obj
- *
+ *
* Uses the integer <i>aCmd</i> to perform various tests on
* <i>file1</i> (first table below) or on <i>file1</i> and
* <i>file2</i> (second table).
- *
+ *
* File tests on a single file:
*
* Test Returns Meaning
@@ -3655,7 +3459,7 @@ test_check(int n, int argc, VALUE *argv)
* ?k | boolean | True if file1 exists and has the sticky bit set
* ?l | boolean | True if file1 exists and is a symbolic link
* ?M | Time | Last modification time for file1
- * ?o | boolean | True if file1 exists and is owned by
+ * ?o | boolean | True if file1 exists and is owned by
* | | the caller's effective uid
* ?O | boolean | True if file1 exists and is owned by
* | | the caller's real uid
@@ -3690,108 +3494,113 @@ test_check(int n, int argc, VALUE *argv)
*/
static VALUE
-rb_f_test(int argc, VALUE *argv)
+rb_f_test(argc, argv)
+ int argc;
+ VALUE *argv;
{
int cmd;
if (argc == 0) rb_raise(rb_eArgError, "wrong number of arguments");
+#if 0 /* 1.7 behavior? */
+ if (argc == 1) {
+ return RTEST(argv[0]) ? Qtrue : Qfalse;
+ }
+#endif
cmd = NUM2CHR(argv[0]);
- if (cmd == 0) goto unknown;
+ if (cmd == 0) return Qfalse;
if (strchr("bcdefgGkloOprRsSuwWxXz", cmd)) {
CHECK(1);
switch (cmd) {
case 'b':
- return rb_file_blockdev_p(0, argv[1]);
+ return test_b(0, argv[1]);
case 'c':
- return rb_file_chardev_p(0, argv[1]);
+ return test_c(0, argv[1]);
case 'd':
- return rb_file_directory_p(0, argv[1]);
+ return test_d(0, argv[1]);
case 'a':
case 'e':
- return rb_file_exist_p(0, argv[1]);
+ return test_e(0, argv[1]);
case 'f':
- return rb_file_file_p(0, argv[1]);
+ return test_f(0, argv[1]);
case 'g':
- return rb_file_sgid_p(0, argv[1]);
+ return test_sgid(0, argv[1]);
case 'G':
- return rb_file_grpowned_p(0, argv[1]);
+ return test_grpowned(0, argv[1]);
case 'k':
- return rb_file_sticky_p(0, argv[1]);
+ return test_sticky(0, argv[1]);
case 'l':
- return rb_file_symlink_p(0, argv[1]);
+ return test_l(0, argv[1]);
case 'o':
- return rb_file_owned_p(0, argv[1]);
+ return test_owned(0, argv[1]);
case 'O':
- return rb_file_rowned_p(0, argv[1]);
+ return test_rowned(0, argv[1]);
case 'p':
- return rb_file_pipe_p(0, argv[1]);
+ return test_p(0, argv[1]);
case 'r':
- return rb_file_readable_p(0, argv[1]);
+ return test_r(0, argv[1]);
case 'R':
- return rb_file_readable_real_p(0, argv[1]);
+ return test_R(0, argv[1]);
case 's':
- return rb_file_size_p(0, argv[1]);
+ return test_s(0, argv[1]);
case 'S':
- return rb_file_socket_p(0, argv[1]);
+ return test_S(0, argv[1]);
case 'u':
- return rb_file_suid_p(0, argv[1]);
+ return test_suid(0, argv[1]);
case 'w':
- return rb_file_writable_p(0, argv[1]);
+ return test_w(0, argv[1]);
case 'W':
- return rb_file_world_writable_p(0, argv[1]);
+ return test_W(0, argv[1]);
case 'x':
- return rb_file_executable_p(0, argv[1]);
+ return test_x(0, argv[1]);
case 'X':
- return rb_file_executable_real_p(0, argv[1]);
+ return test_X(0, argv[1]);
case 'z':
- return rb_file_zero_p(0, argv[1]);
+ return test_z(0, argv[1]);
}
}
if (strchr("MAC", cmd)) {
struct stat st;
- VALUE fname = argv[1];
CHECK(1);
- if (rb_stat(fname, &st) == -1) {
- FilePathValue(fname);
- rb_sys_fail(RSTRING_PTR(fname));
+ if (rb_stat(argv[1], &st) == -1) {
+ rb_sys_fail(RSTRING(argv[1])->ptr);
}
switch (cmd) {
case 'A':
- return stat_atime(&st);
+ return rb_time_new(st.st_atime, 0);
case 'M':
- return stat_mtime(&st);
+ return rb_time_new(st.st_mtime, 0);
case 'C':
- return stat_ctime(&st);
+ return rb_time_new(st.st_ctime, 0);
}
}
if (cmd == '-') {
CHECK(2);
- return rb_file_identical_p(0, argv[1], argv[2]);
+ return test_identical(0, argv[1], argv[2]);
}
if (strchr("=<>", cmd)) {
@@ -3815,18 +3624,13 @@ rb_f_test(int argc, VALUE *argv)
return Qfalse;
}
}
- unknown:
/* unknown command */
- if (ISPRINT(cmd)) {
- rb_raise(rb_eArgError, "unknown command ?%c", cmd);
- }
- else {
- rb_raise(rb_eArgError, "unknown command ?\\x%02X", cmd);
- }
+ rb_raise(rb_eArgError, "unknown command ?%c", cmd);
return Qnil; /* not reached */
}
+
/*
* Document-class: File::Stat
*
@@ -3841,8 +3645,10 @@ rb_f_test(int argc, VALUE *argv)
* meaningful on all systems. See also <code>Kernel#test</code>.
*/
+static VALUE rb_stat_s_alloc _((VALUE));
static VALUE
-rb_stat_s_alloc(VALUE klass)
+rb_stat_s_alloc(klass)
+ VALUE klass;
{
return stat_new_0(klass, 0);
}
@@ -3857,17 +3663,18 @@ rb_stat_s_alloc(VALUE klass)
*/
static VALUE
-rb_stat_init(VALUE obj, VALUE fname)
+rb_stat_init(obj, fname)
+ VALUE obj, fname;
{
struct stat st, *nst;
- rb_secure(2);
- FilePathValue(fname);
+ SafeStringValue(fname);
+
if (stat(StringValueCStr(fname), &st) == -1) {
- rb_sys_fail(RSTRING_PTR(fname));
+ rb_sys_fail(RSTRING(fname)->ptr);
}
if (DATA_PTR(obj)) {
- xfree(DATA_PTR(obj));
+ free(DATA_PTR(obj));
DATA_PTR(obj) = NULL;
}
nst = ALLOC(struct stat);
@@ -3879,7 +3686,8 @@ rb_stat_init(VALUE obj, VALUE fname)
/* :nodoc: */
static VALUE
-rb_stat_init_copy(VALUE copy, VALUE orig)
+rb_stat_init_copy(copy, orig)
+ VALUE copy, orig;
{
struct stat *nst;
@@ -3890,7 +3698,7 @@ rb_stat_init_copy(VALUE copy, VALUE orig)
rb_raise(rb_eTypeError, "wrong argument class");
}
if (DATA_PTR(copy)) {
- xfree(DATA_PTR(copy));
+ free(DATA_PTR(copy));
DATA_PTR(copy) = 0;
}
if (DATA_PTR(orig)) {
@@ -3905,19 +3713,20 @@ rb_stat_init_copy(VALUE copy, VALUE orig)
/*
* call-seq:
* stat.ftype => string
- *
+ *
* Identifies the type of <i>stat</i>. The return string is one of:
* ``<code>file</code>'', ``<code>directory</code>'',
* ``<code>characterSpecial</code>'', ``<code>blockSpecial</code>'',
* ``<code>fifo</code>'', ``<code>link</code>'',
* ``<code>socket</code>'', or ``<code>unknown</code>''.
- *
+ *
* File.stat("/dev/tty").ftype #=> "characterSpecial"
- *
+ *
*/
static VALUE
-rb_stat_ftype(VALUE obj)
+rb_stat_ftype(obj)
+ VALUE obj;
{
return rb_file_ftype(get_stat(obj));
}
@@ -3925,16 +3734,17 @@ rb_stat_ftype(VALUE obj)
/*
* call-seq:
* stat.directory? => true or false
- *
+ *
* Returns <code>true</code> if <i>stat</i> is a directory,
* <code>false</code> otherwise.
- *
+ *
* File.stat("testfile").directory? #=> false
* File.stat(".").directory? #=> true
*/
static VALUE
-rb_stat_d(VALUE obj)
+rb_stat_d(obj)
+ VALUE obj;
{
if (S_ISDIR(get_stat(obj)->st_mode)) return Qtrue;
return Qfalse;
@@ -3943,13 +3753,14 @@ rb_stat_d(VALUE obj)
/*
* call-seq:
* stat.pipe? => true or false
- *
+ *
* Returns <code>true</code> if the operating system supports pipes and
* <i>stat</i> is a pipe; <code>false</code> otherwise.
*/
static VALUE
-rb_stat_p(VALUE obj)
+rb_stat_p(obj)
+ VALUE obj;
{
#ifdef S_IFIFO
if (S_ISFIFO(get_stat(obj)->st_mode)) return Qtrue;
@@ -3961,22 +3772,23 @@ rb_stat_p(VALUE obj)
/*
* call-seq:
* stat.symlink? => true or false
- *
+ *
* 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 <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
* File.lstat("alink").symlink? #=> true
- *
+ *
*/
static VALUE
-rb_stat_l(VALUE obj)
+rb_stat_l(obj)
+ VALUE obj;
{
#ifdef S_ISLNK
if (S_ISLNK(get_stat(obj)->st_mode)) return Qtrue;
@@ -3987,17 +3799,18 @@ rb_stat_l(VALUE obj)
/*
* call-seq:
* stat.socket? => true or false
- *
+ *
* Returns <code>true</code> if <i>stat</i> is a socket,
* <code>false</code> if it isn't or if the operating system doesn't
* support this feature.
- *
+ *
* File.stat("testfile").socket? #=> false
- *
+ *
*/
static VALUE
-rb_stat_S(VALUE obj)
+rb_stat_S(obj)
+ VALUE obj;
{
#ifdef S_ISSOCK
if (S_ISSOCK(get_stat(obj)->st_mode)) return Qtrue;
@@ -4009,18 +3822,19 @@ rb_stat_S(VALUE obj)
/*
* call-seq:
* stat.blockdev? => true or false
- *
+ *
* Returns <code>true</code> if the file is a block device,
* <code>false</code> if it isn't or if the operating system doesn't
* support this feature.
- *
+ *
* File.stat("testfile").blockdev? #=> false
* File.stat("/dev/hda1").blockdev? #=> true
- *
+ *
*/
static VALUE
-rb_stat_b(VALUE obj)
+rb_stat_b(obj)
+ VALUE obj;
{
#ifdef S_ISBLK
if (S_ISBLK(get_stat(obj)->st_mode)) return Qtrue;
@@ -4032,17 +3846,18 @@ rb_stat_b(VALUE obj)
/*
* call-seq:
* stat.chardev? => true or false
- *
+ *
* Returns <code>true</code> if the file is a character device,
* <code>false</code> if it isn't or if the operating system doesn't
* support this feature.
- *
+ *
* File.stat("/dev/tty").chardev? #=> true
- *
+ *
*/
static VALUE
-rb_stat_c(VALUE obj)
+rb_stat_c(obj)
+ VALUE obj;
{
if (S_ISCHR(get_stat(obj)->st_mode)) return Qtrue;
@@ -4052,24 +3867,26 @@ rb_stat_c(VALUE obj)
/*
* call-seq:
* stat.owned? => true or false
- *
+ *
* Returns <code>true</code> if the effective user id of the process is
* the same as the owner of <i>stat</i>.
- *
+ *
* File.stat("testfile").owned? #=> true
* File.stat("/etc/passwd").owned? #=> false
- *
+ *
*/
static VALUE
-rb_stat_owned(VALUE obj)
+rb_stat_owned(obj)
+ VALUE obj;
{
if (get_stat(obj)->st_uid == geteuid()) return Qtrue;
return Qfalse;
}
static VALUE
-rb_stat_rowned(VALUE obj)
+rb_stat_rowned(obj)
+ VALUE obj;
{
if (get_stat(obj)->st_uid == getuid()) return Qtrue;
return Qfalse;
@@ -4078,17 +3895,18 @@ rb_stat_rowned(VALUE obj)
/*
* call-seq:
* stat.grpowned? => true or false
- *
+ *
* Returns true if the effective group id of the process is the same as
* the group id of <i>stat</i>. On Windows NT, returns <code>false</code>.
- *
+ *
* File.stat("testfile").grpowned? #=> true
* File.stat("/etc/passwd").grpowned? #=> false
- *
+ *
*/
static VALUE
-rb_stat_grpowned(VALUE obj)
+rb_stat_grpowned(obj)
+ VALUE obj;
{
#ifndef _WIN32
if (group_member(get_stat(obj)->st_gid)) return Qtrue;
@@ -4099,16 +3917,17 @@ rb_stat_grpowned(VALUE obj)
/*
* call-seq:
* stat.readable? => true or false
- *
+ *
* Returns <code>true</code> if <i>stat</i> is readable by the
* effective user id of this process.
- *
+ *
* File.stat("testfile").readable? #=> true
- *
+ *
*/
static VALUE
-rb_stat_r(VALUE obj)
+rb_stat_r(obj)
+ VALUE obj;
{
struct stat *st = get_stat(obj);
@@ -4129,19 +3948,22 @@ rb_stat_r(VALUE obj)
return Qtrue;
}
+
+
/*
* call-seq:
* stat.readable_real? -> true or false
- *
+ *
* Returns <code>true</code> if <i>stat</i> is readable by the real
* user id of this process.
- *
+ *
* File.stat("testfile").readable_real? #=> true
- *
+ *
*/
static VALUE
-rb_stat_R(VALUE obj)
+rb_stat_R(obj)
+ VALUE obj;
{
struct stat *st = get_stat(obj);
@@ -4163,44 +3985,19 @@ rb_stat_R(VALUE obj)
}
/*
- * call-seq:
- * 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
- * <code>nil</code> otherwise. The meaning of the bits is platform
- * dependent; on Unix systems, see <code>stat(2)</code>.
- *
- * m = File.stat("/etc/passwd").world_readable? # => 420
- * sprintf("%o", m) # => "644"
- */
-
-static VALUE
-rb_stat_wr(VALUE obj)
-{
-#ifdef S_IROTH
- if ((get_stat(obj)->st_mode & (S_IROTH)) == S_IROTH) {
- return UINT2NUM(get_stat(obj)->st_mode & (S_IRUGO|S_IWUGO|S_IXUGO));
- }
- else {
- return Qnil;
- }
-#endif
-}
-
-/*
* call-seq:
* stat.writable? -> true or false
- *
+ *
* Returns <code>true</code> if <i>stat</i> is writable by the
* effective user id of this process.
- *
+ *
* File.stat("testfile").writable? #=> true
- *
+ *
*/
static VALUE
-rb_stat_w(VALUE obj)
+rb_stat_w(obj)
+ VALUE obj;
{
struct stat *st = get_stat(obj);
@@ -4224,16 +4021,17 @@ rb_stat_w(VALUE obj)
/*
* call-seq:
* stat.writable_real? -> true or false
- *
+ *
* Returns <code>true</code> if <i>stat</i> is writable by the real
* user id of this process.
- *
+ *
* File.stat("testfile").writable_real? #=> true
- *
+ *
*/
static VALUE
-rb_stat_W(VALUE obj)
+rb_stat_W(obj)
+ VALUE obj;
{
struct stat *st = get_stat(obj);
@@ -4255,46 +4053,21 @@ rb_stat_W(VALUE obj)
}
/*
- * call-seq:
- * 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
- * <code>nil</code> otherwise. The meaning of the bits is platform
- * dependent; on Unix systems, see <code>stat(2)</code>.
- *
- * m = File.stat("/tmp").world_writable? # => 511
- * sprintf("%o", m) # => "777"
- */
-
-static VALUE
-rb_stat_ww(VALUE obj)
-{
-#ifdef S_IROTH
- if ((get_stat(obj)->st_mode & (S_IWOTH)) == S_IWOTH) {
- return UINT2NUM(get_stat(obj)->st_mode & (S_IRUGO|S_IWUGO|S_IXUGO));
- }
- else {
- return Qnil;
- }
-#endif
-}
-
-/*
* call-seq:
* stat.executable? => true or false
- *
+ *
* Returns <code>true</code> if <i>stat</i> is executable or if the
* operating system doesn't distinguish executable files from
* nonexecutable files. The tests are made using the effective owner of
* the process.
- *
+ *
* File.stat("testfile").executable? #=> false
- *
+ *
*/
static VALUE
-rb_stat_x(VALUE obj)
+rb_stat_x(obj)
+ VALUE obj;
{
struct stat *st = get_stat(obj);
@@ -4320,13 +4093,15 @@ rb_stat_x(VALUE obj)
/*
* call-seq:
* stat.executable_real? => true or false
- *
+ *
* Same as <code>executable?</code>, but tests using the real owner of
* the process.
*/
+
static VALUE
-rb_stat_X(VALUE obj)
+rb_stat_X(obj)
+ VALUE obj;
{
struct stat *st = get_stat(obj);
@@ -4352,16 +4127,17 @@ rb_stat_X(VALUE obj)
/*
* call-seq:
* stat.file? => true or false
- *
+ *
* Returns <code>true</code> if <i>stat</i> is a regular file (not
* a device file, pipe, socket, etc.).
- *
+ *
* File.stat("testfile").file? #=> true
- *
+ *
*/
static VALUE
-rb_stat_f(VALUE obj)
+rb_stat_f(obj)
+ VALUE obj;
{
if (S_ISREG(get_stat(obj)->st_mode)) return Qtrue;
return Qfalse;
@@ -4370,33 +4146,36 @@ rb_stat_f(VALUE obj)
/*
* call-seq:
* stat.zero? => true or false
- *
+ *
* Returns <code>true</code> if <i>stat</i> is a zero-length file;
* <code>false</code> otherwise.
- *
+ *
* File.stat("testfile").zero? #=> false
- *
+ *
*/
static VALUE
-rb_stat_z(VALUE obj)
+rb_stat_z(obj)
+ VALUE obj;
{
if (get_stat(obj)->st_size == 0) return Qtrue;
return Qfalse;
}
+
/*
* call-seq:
* state.size => integer
- *
+ *
* Returns the size of <i>stat</i> in bytes.
- *
+ *
* File.stat("testfile").size #=> 66
- *
+ *
*/
static VALUE
-rb_stat_s(VALUE obj)
+rb_stat_s(obj)
+ VALUE obj;
{
off_t size = get_stat(obj)->st_size;
@@ -4407,16 +4186,17 @@ rb_stat_s(VALUE obj)
/*
* call-seq:
* stat.setuid? => true or false
- *
+ *
* Returns <code>true</code> if <i>stat</i> has the set-user-id
* permission bit set, <code>false</code> if it doesn't or if the
* operating system doesn't support this feature.
- *
+ *
* File.stat("/bin/su").setuid? #=> true
*/
static VALUE
-rb_stat_suid(VALUE obj)
+rb_stat_suid(obj)
+ VALUE obj;
{
#ifdef S_ISUID
if (get_stat(obj)->st_mode & S_ISUID) return Qtrue;
@@ -4427,17 +4207,18 @@ rb_stat_suid(VALUE obj)
/*
* call-seq:
* stat.setgid? => true or false
- *
+ *
* Returns <code>true</code> if <i>stat</i> has the set-group-id
* permission bit set, <code>false</code> if it doesn't or if the
* operating system doesn't support this feature.
- *
+ *
* File.stat("/usr/sbin/lpc").setgid? #=> true
- *
+ *
*/
static VALUE
-rb_stat_sgid(VALUE obj)
+rb_stat_sgid(obj)
+ VALUE obj;
{
#ifdef S_ISGID
if (get_stat(obj)->st_mode & S_ISGID) return Qtrue;
@@ -4448,17 +4229,18 @@ rb_stat_sgid(VALUE obj)
/*
* call-seq:
* stat.sticky? => true or false
- *
+ *
* Returns <code>true</code> if <i>stat</i> has its sticky bit set,
* <code>false</code> if it doesn't or if the operating system doesn't
* support this feature.
- *
+ *
* File.stat("testfile").sticky? #=> false
- *
+ *
*/
static VALUE
-rb_stat_sticky(VALUE obj)
+rb_stat_sticky(obj)
+ VALUE obj;
{
#ifdef S_ISVTX
if (get_stat(obj)->st_mode & S_ISVTX) return Qtrue;
@@ -4469,13 +4251,16 @@ rb_stat_sticky(VALUE obj)
VALUE rb_mFConst;
void
-rb_file_const(const char *name, VALUE value)
+rb_file_const(name, value)
+ const char *name;
+ VALUE value;
{
rb_define_const(rb_mFConst, name, value);
}
static int
-is_absolute_path(const char *path)
+is_absolute_path(path)
+ const char *path;
{
#ifdef DOSISH_DRIVE_LETTER
if (has_drive_letter(path) && isdirsep(path[2])) return 1;
@@ -4499,10 +4284,12 @@ is_absolute_path(const char *path)
#if ENABLE_PATH_CHECK
static int
-path_check_0(VALUE path, int execpath)
+path_check_0(fpath, execpath)
+ VALUE fpath;
+ int execpath;
{
struct stat st;
- const char *p0 = StringValueCStr(path);
+ const char *p0 = StringValueCStr(fpath);
char *p = 0, *s;
if (!is_absolute_path(p0)) {
@@ -4510,11 +4297,11 @@ path_check_0(VALUE path, int execpath)
VALUE newpath;
newpath = rb_str_new2(buf);
- xfree(buf);
+ free(buf);
rb_str_cat2(newpath, "/");
rb_str_cat2(newpath, p0);
- p0 = RSTRING_PTR(path = newpath);
+ p0 = RSTRING(fpath = newpath)->ptr;
}
for (;;) {
#ifndef S_IWOTH
@@ -4524,7 +4311,7 @@ path_check_0(VALUE path, int execpath)
#ifdef S_ISVTX
&& !(p && execpath && (st.st_mode & S_ISVTX))
#endif
- && !access(p0, W_OK)) {
+ ) {
rb_warn("Insecure world writable dir %s in %sPATH, mode 0%o",
p0, (execpath ? "" : "LOAD_"), st.st_mode);
if (p) *p = '/';
@@ -4540,7 +4327,8 @@ path_check_0(VALUE path, int execpath)
#endif
static int
-fpath_check(const char *path)
+fpath_check(path)
+ const char *path;
{
#if ENABLE_PATH_CHECK
return path_check_0(rb_str_new2(path), Qfalse);
@@ -4550,7 +4338,8 @@ fpath_check(const char *path)
}
int
-rb_path_check(const char *path)
+rb_path_check(path)
+ const char *path;
{
#if ENABLE_PATH_CHECK
const char *p0, *p, *pend;
@@ -4576,189 +4365,170 @@ rb_path_check(const char *path)
return 1;
}
+#if defined(__MACOS__) || defined(riscos)
static int
-file_load_ok(const char *path)
+is_macos_native_path(path)
+ const char *path;
{
- int ret = 1;
- int fd = open(path, O_RDONLY);
- if (fd == -1) return 0;
-#if !defined DOSISH
- {
- struct stat st;
- if (fstat(fd, &st) || !S_ISREG(st.st_mode)) {
- ret = 0;
- }
- }
-#endif
- (void)close(fd);
- return ret;
-}
-
-int
-rb_file_load_ok(const char *path)
-{
- return file_load_ok(path);
+ if (strchr(path, ':')) return 1;
+ return 0;
}
+#endif
static int
-is_explicit_relative(const char *path)
+file_load_ok(file)
+ const char *file;
{
- if (*path++ != '.') return 0;
- if (*path == '.') path++;
- return isdirsep(*path);
-}
-
-VALUE rb_get_load_path(void);
+ FILE *f;
-static VALUE
-copy_path_class(VALUE path, VALUE orig)
-{
- RBASIC(path)->klass = rb_obj_class(orig);
- OBJ_FREEZE(path);
- return path;
+ if (!file) return 0;
+ f = fopen(file, "r");
+ if (f == NULL) return 0;
+ fclose(f);
+ return 1;
}
-int
-rb_find_file_ext(VALUE *filep, const char *const *ext)
-{
- return rb_find_file_ext_safe(filep, ext, rb_safe_level());
-}
+extern VALUE rb_load_path;
int
-rb_find_file_ext_safe(VALUE *filep, const char *const *ext, int safe_level)
+rb_find_file_ext(filep, ext)
+ VALUE *filep;
+ const char * const *ext;
{
- const char *f = StringValueCStr(*filep);
- VALUE fname = *filep, load_path, tmp;
- long i, j, fnlen;
- int expanded = 0;
-
- if (!ext[0]) return 0;
+ const char *path, *found;
+ const char *f = RSTRING(*filep)->ptr;
+ VALUE fname;
+ long i, j;
if (f[0] == '~') {
fname = rb_file_expand_path(*filep, Qnil);
- if (safe_level >= 1 && OBJ_TAINTED(fname)) {
+ if (rb_safe_level() >= 2 && OBJ_TAINTED(fname)) {
rb_raise(rb_eSecurityError, "loading from unsafe file %s", f);
}
- f = RSTRING_PTR(fname);
+ OBJ_FREEZE(fname);
+ f = StringValueCStr(fname);
*filep = fname;
- expanded = 1;
}
- if (expanded || is_absolute_path(f) || is_explicit_relative(f)) {
- if (safe_level >= 1 && !fpath_check(f)) {
- rb_raise(rb_eSecurityError, "loading from unsafe path %s", f);
- }
- if (!expanded) fname = rb_file_expand_path(fname, Qnil);
- fnlen = RSTRING_LEN(fname);
+ if (is_absolute_path(f)) {
for (i=0; ext[i]; i++) {
+ fname = rb_str_dup(*filep);
rb_str_cat2(fname, ext[i]);
- if (file_load_ok(RSTRING_PTR(fname))) {
- *filep = copy_path_class(fname, *filep);
- return (int)(i+1);
+ OBJ_FREEZE(fname);
+ if (file_load_ok(StringValueCStr(fname))) {
+ *filep = fname;
+ return i+1;
}
- rb_str_set_len(fname, fnlen);
}
return 0;
}
- if (safe_level >= 4) {
- rb_raise(rb_eSecurityError, "loading from non-absolute path %s", f);
- }
+ if (!rb_load_path) return 0;
- RB_GC_GUARD(load_path) = rb_get_load_path();
- if (!load_path) return 0;
-
- fname = rb_str_dup(*filep);
- RBASIC(fname)->klass = 0;
- fnlen = RSTRING_LEN(fname);
- tmp = rb_str_tmp_new(MAXPATHLEN + 2);
- for (j=0; ext[j]; j++) {
- rb_str_cat2(fname, ext[j]);
- for (i = 0; i < RARRAY_LEN(load_path); i++) {
- VALUE str = RARRAY_PTR(load_path)[i];
-
- RB_GC_GUARD(str) = rb_get_path_check(str, safe_level);
- if (RSTRING_LEN(str) == 0) continue;
- file_expand_path(fname, str, 0, tmp);
- if (file_load_ok(RSTRING_PTR(tmp))) {
- *filep = copy_path_class(tmp, *filep);
- return (int)(j+1);
+ Check_Type(rb_load_path, T_ARRAY);
+ for (i=0;i<RARRAY(rb_load_path)->len;i++) {
+ VALUE str = RARRAY(rb_load_path)->ptr[i];
+
+ SafeStringValue(str);
+ if (RSTRING(str)->len == 0) continue;
+ path = RSTRING(str)->ptr;
+ for (j=0; ext[j]; j++) {
+ fname = rb_str_dup(*filep);
+ rb_str_cat2(fname, ext[j]);
+ OBJ_FREEZE(fname);
+ found = dln_find_file(StringValueCStr(fname), path);
+ if (found && file_load_ok(found)) {
+ *filep = fname;
+ return j+1;
}
- FL_UNSET(tmp, FL_TAINT | FL_UNTRUSTED);
}
- rb_str_set_len(fname, fnlen);
}
- RB_GC_GUARD(load_path);
return 0;
}
VALUE
-rb_find_file(VALUE path)
-{
- return rb_find_file_safe(path, rb_safe_level());
-}
-
-VALUE
-rb_find_file_safe(VALUE path, int safe_level)
+rb_find_file(path)
+ VALUE path;
{
- VALUE tmp, load_path;
+ VALUE tmp;
const char *f = StringValueCStr(path);
- int expanded = 0;
+ const char *lpath;
if (f[0] == '~') {
- tmp = rb_file_expand_path(path, Qnil);
- if (safe_level >= 1 && OBJ_TAINTED(tmp)) {
+ path = rb_file_expand_path(path, Qnil);
+ if (rb_safe_level() >= 1 && OBJ_TAINTED(path)) {
+ rb_raise(rb_eSecurityError, "loading from unsafe path %s", f);
+ }
+ OBJ_FREEZE(path);
+ f = StringValueCStr(path);
+ }
+
+#if defined(__MACOS__) || defined(riscos)
+ if (is_macos_native_path(f)) {
+ if (rb_safe_level() >= 1 && !fpath_check(f)) {
rb_raise(rb_eSecurityError, "loading from unsafe file %s", f);
}
- path = copy_path_class(tmp, path);
- f = RSTRING_PTR(path);
- expanded = 1;
+ if (file_load_ok(f)) return path;
}
+#endif
- if (expanded || is_absolute_path(f) || is_explicit_relative(f)) {
- if (safe_level >= 1 && !fpath_check(f)) {
- rb_raise(rb_eSecurityError, "loading from unsafe path %s", f);
+ if (is_absolute_path(f)) {
+ if (rb_safe_level() >= 1 && !fpath_check(f)) {
+ rb_raise(rb_eSecurityError, "loading from unsafe file %s", f);
}
- if (!file_load_ok(f)) return 0;
- if (!expanded)
- path = copy_path_class(rb_file_expand_path(path, Qnil), path);
- return path;
+ if (file_load_ok(f)) return path;
}
- if (safe_level >= 4) {
+ if (rb_safe_level() >= 4) {
rb_raise(rb_eSecurityError, "loading from non-absolute path %s", f);
}
- RB_GC_GUARD(load_path) = rb_get_load_path();
- if (load_path) {
+ if (rb_load_path) {
long i;
- tmp = rb_str_tmp_new(MAXPATHLEN + 2);
- for (i = 0; i < RARRAY_LEN(load_path); i++) {
- VALUE str = RARRAY_PTR(load_path)[i];
- RB_GC_GUARD(str) = rb_get_path_check(str, safe_level);
- if (RSTRING_LEN(str) > 0) {
- file_expand_path(path, str, 0, tmp);
- f = RSTRING_PTR(tmp);
- if (file_load_ok(f)) goto found;
+ Check_Type(rb_load_path, T_ARRAY);
+ tmp = rb_ary_new();
+ for (i=0;i<RARRAY(rb_load_path)->len;i++) {
+ VALUE str = RARRAY(rb_load_path)->ptr[i];
+ SafeStringValue(str);
+ if (RSTRING(str)->len > 0) {
+ rb_ary_push(tmp, str);
}
}
- return 0;
+ tmp = rb_ary_join(tmp, rb_str_new2(PATH_SEP));
+ if (RSTRING(tmp)->len == 0) {
+ lpath = 0;
+ }
+ else {
+ lpath = RSTRING(tmp)->ptr;
+ }
}
else {
- return 0; /* no path, no load */
+ lpath = 0;
}
- found:
- if (safe_level >= 1 && !fpath_check(f)) {
+ if (!lpath) {
+ return 0; /* no path, no load */
+ }
+ if (!(f = dln_find_file(f, lpath))) {
+ return 0;
+ }
+ if (rb_safe_level() >= 1 && !fpath_check(f)) {
rb_raise(rb_eSecurityError, "loading from unsafe file %s", f);
}
-
- return copy_path_class(tmp, path);
+ if (file_load_ok(f)) {
+ tmp = rb_str_new2(f);
+ OBJ_FREEZE(tmp);
+ return tmp;
+ }
+ return 0;
}
static void
-define_filetest_function(const char *name, VALUE (*func)(ANYARGS), int argc)
+define_filetest_function(name, func, argc)
+ const char *name;
+ VALUE (*func)();
+ int argc;
{
rb_define_module_function(rb_mFileTest, name, func, argc);
rb_define_singleton_method(rb_cFile, name, func, argc);
@@ -4771,7 +4541,7 @@ define_filetest_function(const char *name, VALUE (*func)(ANYARGS), int argc)
* <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
* set of bits that indicate permissions of a file. On Unix-based
@@ -4779,7 +4549,7 @@ define_filetest_function(const char *name, VALUE (*func)(ANYARGS), int argc)
* owner, the group, and the rest of the world. For each of these
* entities, permissions may be set to read, write, or execute the
* file:
- *
+ *
* The permission bits <code>0644</code> (in octal) would thus be
* interpreted as read/write for owner, and read-only for group and
* other. Higher-order bits may also be used to indicate the type of
@@ -4787,7 +4557,7 @@ define_filetest_function(const char *name, VALUE (*func)(ANYARGS), int argc)
* special features. If the permissions are for a directory, the
* meaning of the execute bit changes; when set the directory can be
* searched.
- *
+ *
* On non-Posix operating systems, there may be only the ability to
* make a file read-only or read-write. In this case, the remaining
* permission bits will be synthesized to resemble typical values. For
@@ -4798,41 +4568,39 @@ define_filetest_function(const char *name, VALUE (*func)(ANYARGS), int argc)
*/
void
-Init_File(void)
+Init_File()
{
rb_mFileTest = rb_define_module("FileTest");
rb_cFile = rb_define_class("File", rb_cIO);
- define_filetest_function("directory?", rb_file_directory_p, 1);
- define_filetest_function("exist?", rb_file_exist_p, 1);
- define_filetest_function("exists?", rb_file_exist_p, 1);
- define_filetest_function("readable?", rb_file_readable_p, 1);
- define_filetest_function("readable_real?", rb_file_readable_real_p, 1);
- define_filetest_function("world_readable?", rb_file_world_readable_p, 1);
- define_filetest_function("writable?", rb_file_writable_p, 1);
- define_filetest_function("writable_real?", rb_file_writable_real_p, 1);
- define_filetest_function("world_writable?", rb_file_world_writable_p, 1);
- define_filetest_function("executable?", rb_file_executable_p, 1);
- 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("size?", rb_file_size_p, 1);
+ define_filetest_function("directory?", test_d, 1);
+ define_filetest_function("exist?", test_e, 1);
+ define_filetest_function("exists?", test_e, 1); /* temporary */
+ define_filetest_function("readable?", test_r, 1);
+ define_filetest_function("readable_real?", test_R, 1);
+ define_filetest_function("writable?", test_w, 1);
+ define_filetest_function("writable_real?", test_W, 1);
+ define_filetest_function("executable?", test_x, 1);
+ define_filetest_function("executable_real?", test_X, 1);
+ define_filetest_function("file?", test_f, 1);
+ define_filetest_function("zero?", test_z, 1);
+ define_filetest_function("size?", test_s, 1);
define_filetest_function("size", rb_file_s_size, 1);
- define_filetest_function("owned?", rb_file_owned_p, 1);
- define_filetest_function("grpowned?", rb_file_grpowned_p, 1);
+ define_filetest_function("owned?", test_owned, 1);
+ define_filetest_function("grpowned?", test_grpowned, 1);
- define_filetest_function("pipe?", rb_file_pipe_p, 1);
- define_filetest_function("symlink?", rb_file_symlink_p, 1);
- define_filetest_function("socket?", rb_file_socket_p, 1);
+ define_filetest_function("pipe?", test_p, 1);
+ define_filetest_function("symlink?", test_l, 1);
+ define_filetest_function("socket?", test_S, 1);
- define_filetest_function("blockdev?", rb_file_blockdev_p, 1);
- define_filetest_function("chardev?", rb_file_chardev_p, 1);
+ define_filetest_function("blockdev?", test_b, 1);
+ define_filetest_function("chardev?", test_c, 1);
- define_filetest_function("setuid?", rb_file_suid_p, 1);
- define_filetest_function("setgid?", rb_file_sgid_p, 1);
- define_filetest_function("sticky?", rb_file_sticky_p, 1);
+ define_filetest_function("setuid?", test_suid, 1);
+ define_filetest_function("setgid?", test_sgid, 1);
+ define_filetest_function("sticky?", test_sticky, 1);
- define_filetest_function("identical?", rb_file_identical_p, 2);
+ define_filetest_function("identical?", test_identical, 2);
rb_define_singleton_method(rb_cFile, "stat", rb_file_s_stat, 1);
rb_define_singleton_method(rb_cFile, "lstat", rb_file_s_lstat, 1);
@@ -4858,20 +4626,18 @@ Init_File(void)
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, "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, "basename", rb_file_s_basename, -1);
rb_define_singleton_method(rb_cFile, "dirname", rb_file_s_dirname, 1);
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_obj_freeze(rb_usascii_str_new2("/"));
+ separator = rb_obj_freeze(rb_str_new2("/"));
rb_define_const(rb_cFile, "Separator", separator);
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);
#ifdef DOSISH
- rb_define_const(rb_cFile, "ALT_SEPARATOR", rb_obj_freeze(rb_usascii_str_new2("\\")));
+ rb_define_const(rb_cFile, "ALT_SEPARATOR", rb_obj_freeze(rb_str_new2("\\")));
#else
rb_define_const(rb_cFile, "ALT_SEPARATOR", Qnil);
#endif
@@ -4883,7 +4649,6 @@ Init_File(void)
rb_define_method(rb_cFile, "atime", rb_file_atime, 0);
rb_define_method(rb_cFile, "mtime", rb_file_mtime, 0);
rb_define_method(rb_cFile, "ctime", rb_file_ctime, 0);
- rb_define_method(rb_cFile, "size", rb_file_size, 0);
rb_define_method(rb_cFile, "chmod", rb_file_chmod, 1);
rb_define_method(rb_cFile, "chown", rb_file_chown, 2);
@@ -4899,7 +4664,6 @@ Init_File(void)
rb_file_const("LOCK_NB", INT2FIX(LOCK_NB));
rb_define_method(rb_cFile, "path", rb_file_path, 0);
- rb_define_method(rb_cFile, "to_path", rb_file_path, 0);
rb_define_global_function("test", rb_f_test, -1);
rb_cStat = rb_define_class_under(rb_cFile, "Stat", rb_cObject);
@@ -4936,10 +4700,8 @@ Init_File(void)
rb_define_method(rb_cStat, "directory?", rb_stat_d, 0);
rb_define_method(rb_cStat, "readable?", rb_stat_r, 0);
rb_define_method(rb_cStat, "readable_real?", rb_stat_R, 0);
- rb_define_method(rb_cStat, "world_readable?", rb_stat_wr, 0);
rb_define_method(rb_cStat, "writable?", rb_stat_w, 0);
rb_define_method(rb_cStat, "writable_real?", rb_stat_W, 0);
- rb_define_method(rb_cStat, "world_writable?", rb_stat_ww, 0);
rb_define_method(rb_cStat, "executable?", rb_stat_x, 0);
rb_define_method(rb_cStat, "executable_real?", rb_stat_X, 0);
rb_define_method(rb_cStat, "file?", rb_stat_f, 0);
diff --git a/gc.c b/gc.c
index d7b1291d33..489533251d 100644
--- a/gc.c
+++ b/gc.c
@@ -3,22 +3,21 @@
gc.c -
$Author$
+ $Date$
created at: Tue Oct 5 09:44:46 JST 1993
- Copyright (C) 1993-2007 Yukihiro Matsumoto
+ Copyright (C) 1993-2003 Yukihiro Matsumoto
Copyright (C) 2000 Network Applied Communication Laboratory, Inc.
Copyright (C) 2000 Information-technology Promotion Agency, Japan
**********************************************************************/
-#include "ruby/ruby.h"
-#include "ruby/st.h"
-#include "ruby/re.h"
-#include "ruby/io.h"
-#include "ruby/util.h"
-#include "eval_intern.h"
-#include "vm_core.h"
-#include "gc.h"
+#include "ruby.h"
+#include "rubysig.h"
+#include "st.h"
+#include "node.h"
+#include "env.h"
+#include "re.h"
#include <stdio.h>
#include <setjmp.h>
#include <sys/types.h>
@@ -35,23 +34,14 @@
#include <windows.h>
#endif
-#ifdef HAVE_VALGRIND_MEMCHECK_H
-# include <valgrind/memcheck.h>
-# ifndef VALGRIND_MAKE_MEM_DEFINED
-# define VALGRIND_MAKE_MEM_DEFINED(p, n) VALGRIND_MAKE_READABLE(p, n)
-# endif
-# ifndef VALGRIND_MAKE_MEM_UNDEFINED
-# define VALGRIND_MAKE_MEM_UNDEFINED(p, n) VALGRIND_MAKE_WRITABLE(p, n)
-# endif
-#else
-# define VALGRIND_MAKE_MEM_DEFINED(p, n) /* empty */
-# define VALGRIND_MAKE_MEM_UNDEFINED(p, n) /* empty */
-#endif
-
-int rb_io_fptr_finalize(struct rb_io_t*);
+void re_free_registers _((struct re_registers*));
+void rb_io_fptr_finalize _((struct rb_io_t*));
#define rb_setjmp(env) RUBY_SETJMP(env)
#define rb_jmp_buf rb_jmpbuf_t
+#ifdef __CYGWIN__
+int _setjmp(), _longjmp();
+#endif
/* Make alloca work the best possible way. */
#ifdef __GNUC__
@@ -64,9 +54,7 @@ int rb_io_fptr_finalize(struct rb_io_t*);
# ifdef HAVE_ALLOCA_H
# include <alloca.h>
# else
-# ifdef _AIX
- #pragma alloca
-# else
+# ifndef _AIX
# ifndef alloca /* predefined by HP cc +Olibcalls */
void *alloca ();
# endif
@@ -75,404 +63,35 @@ void *alloca ();
#endif /* __GNUC__ */
#ifndef GC_MALLOC_LIMIT
-#define GC_MALLOC_LIMIT 8000000
-#endif
-
-#define nomem_error GET_VM()->special_exceptions[ruby_error_nomemory]
-
-#define MARK_STACK_MAX 1024
-
-int ruby_gc_debug_indent = 0;
-
-/* for GC profile */
-#define GC_PROFILE_MORE_DETAIL 0
-typedef struct gc_profile_record {
- double gc_time;
- double gc_mark_time;
- double gc_sweep_time;
- double gc_invoke_time;
-
- size_t heap_use_slots;
- size_t heap_longlife_use_slots;
- size_t heap_live_objects;
- size_t heap_free_objects;
- size_t heap_total_objects;
- size_t heap_use_size;
- size_t heap_total_size;
-
- int have_finalize;
- int longlife_collection;
-
- size_t allocate_increase;
- size_t allocate_limit;
-} gc_profile_record;
-
-static double
-getrusage_time(void)
-{
-#ifdef RUSAGE_SELF
- struct rusage usage;
- struct timeval time;
- getrusage(RUSAGE_SELF, &usage);
- time = usage.ru_utime;
- return time.tv_sec + time.tv_usec * 1e-6;
-#elif defined _WIN32
- FILETIME creation_time, exit_time, kernel_time, user_time;
- ULARGE_INTEGER ui;
- LONG_LONG q;
- double t;
-
- if (GetProcessTimes(GetCurrentProcess(),
- &creation_time, &exit_time, &kernel_time, &user_time) == 0)
- {
- return 0.0;
- }
- memcpy(&ui, &user_time, sizeof(FILETIME));
- q = ui.QuadPart / 10L;
- t = (DWORD)(q % 1000000L) * 1e-6;
- q /= 1000000L;
-#ifdef __GNUC__
- t += q;
-#else
- t += (double)(DWORD)(q >> 16) * (1 << 16);
- t += (DWORD)q & ~(~0 << 16);
-#endif
- return t;
-#else
- return 0.0;
-#endif
-}
-
-#define GC_PROF_TIMER_START do {\
- if (objspace->profile.run) {\
- if (!objspace->profile.record) {\
- objspace->profile.size = 1000;\
- objspace->profile.record = malloc(sizeof(gc_profile_record) * objspace->profile.size);\
- }\
- if (count >= objspace->profile.size) {\
- objspace->profile.size += 1000;\
- objspace->profile.record = realloc(objspace->profile.record, sizeof(gc_profile_record) * objspace->profile.size);\
- }\
- if (!objspace->profile.record) {\
- rb_bug("gc_profile malloc or realloc miss");\
- }\
- MEMZERO(&objspace->profile.record[count], gc_profile_record, 1);\
- gc_time = getrusage_time();\
- objspace->profile.record[count].gc_invoke_time = gc_time - objspace->profile.invoke_time;\
- objspace->profile.record[count].longlife_collection = objspace->flags.longlife_collection;\
- }\
- } while(0)
-
-#define GC_PROF_TIMER_STOP do {\
- if (objspace->profile.run) {\
- gc_time = getrusage_time() - gc_time;\
- if (gc_time < 0) gc_time = 0;\
- objspace->profile.record[count].gc_time = gc_time;\
- objspace->profile.count++;\
- }\
- } while(0)
-
-#if GC_PROFILE_MORE_DETAIL
-#define INIT_GC_PROF_PARAMS double gc_time = 0, mark_time = 0, sweep_time = 0;\
- size_t count = objspace->profile.count
-
-#define GC_PROF_MARK_TIMER_START do {\
- if (objspace->profile.run) {\
- mark_time = getrusage_time();\
- }\
- } while(0)
-
-#define GC_PROF_MARK_TIMER_STOP do {\
- if (objspace->profile.run) {\
- mark_time = getrusage_time() - mark_time;\
- if (mark_time < 0) mark_time = 0;\
- objspace->profile.record[count].gc_mark_time = mark_time;\
- }\
- } while(0)
-
-#define GC_PROF_SWEEP_TIMER_START do {\
- if (objspace->profile.run) {\
- sweep_time = getrusage_time();\
- }\
- } while(0)
-
-#define GC_PROF_SWEEP_TIMER_STOP do {\
- if (objspace->profile.run) {\
- sweep_time = getrusage_time() - sweep_time;\
- if (sweep_time < 0) sweep_time = 0;\
- objspace->profile.record[count].gc_sweep_time = sweep_time;\
- }\
- } while(0)
-#define GC_PROF_SET_MALLOC_INFO do {\
- if (objspace->profile.run) {\
- gc_profile_record *record = &objspace->profile.record[objspace->profile.count];\
- record->allocate_increase = malloc_increase;\
- record->allocate_limit = malloc_limit; \
- }\
- } while(0)
-#define GC_PROF_SET_HEAP_INFO do {\
- if (objspace->profile.run) {\
- gc_profile_record *record = &objspace->profile.record[objspace->profile.count];\
- record->heap_use_slots = heaps_used;\
- record->heap_longlife_use_slots = objspace->heap.longlife_used;\
- record->heap_live_objects = live + objspace->profile.longlife_objects;\
- record->heap_free_objects = freed + (objspace->heap.longlife_used * HEAP_OBJ_LIMIT - objspace->profile.longlife_objects); \
- record->heap_total_objects = heaps_used * HEAP_OBJ_LIMIT;\
- record->have_finalize = final_list ? Qtrue : Qfalse;\
- record->heap_use_size = (live + objspace->profile.longlife_objects) * sizeof(RVALUE); \
- record->heap_total_size = heaps_used * (HEAP_OBJ_LIMIT * sizeof(RVALUE));\
- }\
- } while(0)
+#if defined(MSDOS) || defined(__human68k__)
+#define GC_MALLOC_LIMIT 200000
#else
-#define INIT_GC_PROF_PARAMS double gc_time = 0;\
- size_t count = objspace->profile.count
-#define GC_PROF_MARK_TIMER_START
-#define GC_PROF_MARK_TIMER_STOP
-#define GC_PROF_SWEEP_TIMER_START
-#define GC_PROF_SWEEP_TIMER_STOP
-#define GC_PROF_SET_MALLOC_INFO
-#define GC_PROF_SET_HEAP_INFO do {\
- if (objspace->profile.run) {\
- gc_profile_record *record = &objspace->profile.record[objspace->profile.count];\
- record->heap_total_objects = heaps_used * HEAP_OBJ_LIMIT;\
- record->heap_use_size = (live + objspace->profile.longlife_objects) * sizeof(RVALUE); \
- record->heap_total_size = heaps_used * HEAP_SIZE;\
- }\
- } while(0)
-#endif
-
-
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__CYGWIN__)
-#pragma pack(push, 1) /* magic for reducing sizeof(RVALUE): 24 -> 20 */
-#endif
-
-typedef struct RVALUE {
- union {
- struct {
- VALUE flags; /* always 0 for freed obj */
- struct RVALUE *next;
- } free;
- struct RBasic basic;
- struct RObject object;
- struct RClass klass;
- struct RFloat flonum;
- struct RString string;
- struct RArray array;
- struct RRegexp regexp;
- struct RHash hash;
- struct RData data;
- struct RTypedData typeddata;
- struct RStruct rstruct;
- struct RBignum bignum;
- struct RFile file;
- struct RNode node;
- struct RMatch match;
- struct RRational rational;
- struct RComplex complex;
- } as;
-#ifdef GC_DEBUG
- const char *file;
- int line;
-#endif
-} RVALUE;
-
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__CYGWIN__)
-#pragma pack(pop)
-#endif
-
-enum lifetime {
- lifetime_normal,
- lifetime_longlife
-};
-
-struct heaps_slot {
- void *membase;
- RVALUE *slot;
- size_t limit;
- enum lifetime lifetime;
-};
-
-#define HEAP_MIN_SLOTS 10000
-#define FREE_MIN 4096
-
-struct gc_list {
- VALUE *varptr;
- struct gc_list *next;
-};
-
-#define CALC_EXACT_MALLOC_SIZE 0
-
-typedef struct remembered_set {
- RVALUE *obj;
- struct remembered_set *next;
-} remembered_set_t;
-
-typedef struct rb_objspace {
- struct {
- size_t limit;
- size_t increase;
-#if CALC_EXACT_MALLOC_SIZE
- size_t allocated_size;
- size_t allocations;
-#endif
- } malloc_params;
- struct {
- size_t increment;
- struct heaps_slot *ptr;
- size_t length;
- size_t used;
- size_t longlife_used;
- RVALUE *freelist;
- RVALUE *longlife_freelist;
- RVALUE *range[2];
- RVALUE *freed;
- } heap;
- struct {
- remembered_set_t *ptr;
- remembered_set_t *freed;
- } remembered_set;
- struct {
- int dont_gc;
- int during_gc;
- int longlife_collection;
- } flags;
- struct {
- st_table *table;
- RVALUE *deferred;
- } final;
- struct {
- VALUE buffer[MARK_STACK_MAX];
- VALUE *ptr;
- int overflow;
- } markstack;
- struct {
- int run;
- gc_profile_record *record;
- size_t count;
- size_t size;
- size_t longlife_objects;
- double invoke_time;
- } profile;
- struct gc_list *global_list;
- unsigned int count;
- int gc_stress;
-} rb_objspace_t;
-
-#if defined(ENABLE_VM_OBJSPACE) && ENABLE_VM_OBJSPACE
-#define rb_objspace (*GET_VM()->objspace)
-static int ruby_initial_gc_stress = 0;
-int *ruby_initial_gc_stress_ptr = &ruby_initial_gc_stress;
-#else
-static rb_objspace_t rb_objspace = {{GC_MALLOC_LIMIT}, {HEAP_MIN_SLOTS}};
-int *ruby_initial_gc_stress_ptr = &rb_objspace.gc_stress;
+#define GC_MALLOC_LIMIT 8000000
#endif
-#define malloc_limit objspace->malloc_params.limit
-#define malloc_increase objspace->malloc_params.increase
-#define heap_slots objspace->heap.slots
-#define heaps objspace->heap.ptr
-#define heaps_length objspace->heap.length
-#define heaps_used objspace->heap.used
-#define freelist objspace->heap.freelist
-#define lomem objspace->heap.range[0]
-#define himem objspace->heap.range[1]
-#define heaps_inc objspace->heap.increment
-#define heaps_freed objspace->heap.freed
-#define dont_gc objspace->flags.dont_gc
-#define during_gc objspace->flags.during_gc
-#define finalizer_table objspace->final.table
-#define deferred_final_list objspace->final.deferred
-#define mark_stack objspace->markstack.buffer
-#define mark_stack_ptr objspace->markstack.ptr
-#define mark_stack_overflow objspace->markstack.overflow
-#define global_List objspace->global_list
-#define ruby_gc_stress objspace->gc_stress
-
-#define need_call_final (finalizer_table && finalizer_table->num_entries)
-
-#if defined(ENABLE_VM_OBJSPACE) && ENABLE_VM_OBJSPACE
-rb_objspace_t *
-rb_objspace_alloc(void)
-{
- rb_objspace_t *objspace = malloc(sizeof(rb_objspace_t));
- memset(objspace, 0, sizeof(*objspace));
- malloc_limit = GC_MALLOC_LIMIT;
- ruby_gc_stress = ruby_initial_gc_stress;
-
- return objspace;
-}
#endif
-/* tiny heap size */
-/* 32KB */
-/*#define HEAP_SIZE 0x8000 */
-/* 128KB */
-/*#define HEAP_SIZE 0x20000 */
-/* 64KB */
-/*#define HEAP_SIZE 0x10000 */
-/* 16KB */
-#define HEAP_SIZE 0x4000
-/* 8KB */
-/*#define HEAP_SIZE 0x2000 */
-/* 4KB */
-/*#define HEAP_SIZE 0x1000 */
-/* 2KB */
-/*#define HEAP_SIZE 0x800 */
-
-#define HEAP_OBJ_LIMIT (HEAP_SIZE / sizeof(struct RVALUE))
-#define NORMAL_HEAPS_USED (objspace->heap.used - objspace->heap.longlife_used)
-
-extern VALUE rb_cMutex;
-extern st_table *rb_class_tbl;
+static unsigned long malloc_increase = 0;
+static unsigned long malloc_limit = GC_MALLOC_LIMIT;
+static void run_final();
+static VALUE nomem_error;
+static void garbage_collect();
-int ruby_disable_gc_stress = 0;
+int ruby_gc_stress = 0;
-static void run_final(rb_objspace_t *objspace, VALUE obj);
-static int garbage_collect(rb_objspace_t *objspace);
+NORETURN(void rb_exc_jump _((VALUE)));
void
-rb_global_variable(VALUE *var)
-{
- rb_gc_register_address(var);
-}
-
-static void *
-ruby_memerror_body(void *dummy)
+rb_memerror()
{
- rb_memerror();
- return 0;
-}
+ rb_thread_t th = rb_curr_thread;
-static void
-ruby_memerror(void)
-{
- if (ruby_thread_has_gvl_p()) {
- rb_memerror();
- }
- else {
- if (ruby_native_thread_p()) {
- rb_thread_call_with_gvl(ruby_memerror_body, 0);
- }
- else {
- /* no ruby thread */
- fprintf(stderr, "[FATAL] failed to allocate memory\n");
- exit(EXIT_FAILURE);
- }
- }
-}
-
-void
-rb_memerror(void)
-{
- rb_thread_t *th = GET_THREAD();
if (!nomem_error ||
(rb_thread_raised_p(th, RAISED_NOMEMORY) && rb_safe_level() < 4)) {
fprintf(stderr, "[FATAL] failed to allocate memory\n");
- exit(EXIT_FAILURE);
+ exit(1);
}
if (rb_thread_raised_p(th, RAISED_NOMEMORY)) {
- rb_thread_raised_clear(th);
- GET_THREAD()->errinfo = nomem_error;
- JUMP_TAG(TAG_RAISE);
+ rb_exc_jump(nomem_error);
}
rb_thread_raised_set(th, RAISED_NOMEMORY);
rb_exc_raise(nomem_error);
@@ -486,9 +105,9 @@ rb_memerror(void)
*/
static VALUE
-gc_stress_get(VALUE self)
+gc_stress_get(self)
+ VALUE self;
{
- rb_objspace_t *objspace = &rb_objspace;
return ruby_gc_stress ? Qtrue : Qfalse;
}
@@ -505,269 +124,93 @@ gc_stress_get(VALUE self)
*/
static VALUE
-gc_stress_set(VALUE self, VALUE flag)
+gc_stress_set(self, bool)
+ VALUE self, bool;
{
- rb_objspace_t *objspace = &rb_objspace;
rb_secure(2);
- ruby_gc_stress = RTEST(flag);
- return flag;
-}
-
-/*
- * call-seq:
- * GC::Profiler.enable? => true or false
- *
- * returns current status of GC profile mode.
- */
-
-static VALUE
-gc_profile_enable_get(VALUE self)
-{
- rb_objspace_t *objspace = &rb_objspace;
- return objspace->profile.run;
-}
-
-/*
- * call-seq:
- * GC::Profiler.enable => nil
- *
- * updates GC profile mode.
- * start profiler for GC.
- *
- */
-
-static VALUE
-gc_profile_enable(void)
-{
- rb_objspace_t *objspace = &rb_objspace;
-
- objspace->profile.run = Qtrue;
- return Qnil;
-}
-
-/*
- * call-seq:
- * GC::Profiler.disable => nil
- *
- * updates GC profile mode.
- * stop profiler for GC.
- *
- */
-
-static VALUE
-gc_profile_disable(void)
-{
- rb_objspace_t *objspace = &rb_objspace;
-
- objspace->profile.run = Qfalse;
- return Qnil;
-}
-
-/*
- * call-seq:
- * GC::Profiler.clear => nil
- *
- * clear before profile data.
- *
- */
-
-static VALUE
-gc_profile_clear(void)
-{
- rb_objspace_t *objspace = &rb_objspace;
- MEMZERO(objspace->profile.record, gc_profile_record, objspace->profile.size);
- objspace->profile.count = 0;
- return Qnil;
-}
-
-static void *
-negative_size_allocation_error_with_gvl(void *ptr)
-{
- rb_raise(rb_eNoMemError, "%s", (const char *)ptr);
- return 0; /* should not be reached */
-}
-
-static void
-negative_size_allocation_error(const char *msg)
-{
- if (ruby_thread_has_gvl_p()) {
- rb_raise(rb_eNoMemError, "%s", msg);
- }
- else {
- if (ruby_native_thread_p()) {
- rb_thread_call_with_gvl(negative_size_allocation_error_with_gvl, (void *)msg);
- }
- else {
- fprintf(stderr, "[FATAL] %s\n", msg);
- exit(EXIT_FAILURE);
- }
- }
-}
-
-static void *
-gc_with_gvl(void *ptr)
-{
- return (void *)(VALUE)garbage_collect((rb_objspace_t *)ptr);
+ ruby_gc_stress = RTEST(bool);
+ return bool;
}
-static int
-garbage_collect_with_gvl(rb_objspace_t *objspace)
-{
- if (ruby_thread_has_gvl_p()) {
- return garbage_collect(objspace);
- }
- else {
- if (ruby_native_thread_p()) {
- return (int)(VALUE)rb_thread_call_with_gvl(gc_with_gvl, (void *)objspace);
- }
- else {
- /* no ruby thread */
- fprintf(stderr, "[FATAL] failed to allocate memory\n");
- exit(EXIT_FAILURE);
- }
- }
-}
-
-static void *
-vm_xmalloc(rb_objspace_t *objspace, size_t size)
+void *
+ruby_xmalloc(size)
+ long size;
{
void *mem;
- if ((ssize_t)size < 0) {
- negative_size_allocation_error("negative allocation size (or too big)");
+ if (size < 0) {
+ rb_raise(rb_eNoMemError, "negative allocation size (or too big)");
}
if (size == 0) size = 1;
-#if CALC_EXACT_MALLOC_SIZE
- size += sizeof(size_t);
-#endif
-
- if ((ruby_gc_stress && !ruby_disable_gc_stress) ||
- (malloc_increase+size) > malloc_limit) {
- garbage_collect_with_gvl(objspace);
+ if (ruby_gc_stress || (malloc_increase+size) > malloc_limit) {
+ garbage_collect();
}
- mem = malloc(size);
+ RUBY_CRITICAL(mem = malloc(size));
if (!mem) {
- if (garbage_collect_with_gvl(objspace)) {
- mem = malloc(size);
- }
+ garbage_collect();
+ RUBY_CRITICAL(mem = malloc(size));
if (!mem) {
- ruby_memerror();
+ rb_memerror();
}
}
malloc_increase += size;
-#if CALC_EXACT_MALLOC_SIZE
- objspace->malloc_params.allocated_size += size;
- objspace->malloc_params.allocations++;
- ((size_t *)mem)[0] = size;
- mem = (size_t *)mem + 1;
-#endif
-
return mem;
}
-static void *
-vm_xrealloc(rb_objspace_t *objspace, void *ptr, size_t size)
+void *
+ruby_xcalloc(n, size)
+ long n, size;
{
void *mem;
- if ((ssize_t)size < 0) {
- negative_size_allocation_error("negative re-allocation size");
- }
- if (!ptr) return ruby_xmalloc(size);
- if (size == 0) size = 1;
- if (ruby_gc_stress && !ruby_disable_gc_stress)
- garbage_collect_with_gvl(objspace);
-
-#if CALC_EXACT_MALLOC_SIZE
- size += sizeof(size_t);
- objspace->malloc_params.allocated_size -= size;
- ptr = (size_t *)ptr - 1;
-#endif
-
- mem = realloc(ptr, size);
- if (!mem) {
- if (garbage_collect_with_gvl(objspace)) {
- mem = realloc(ptr, size);
- }
- if (!mem) {
- ruby_memerror();
- }
- }
- malloc_increase += size;
-
-#if CALC_EXACT_MALLOC_SIZE
- objspace->malloc_params.allocated_size += size;
- ((size_t *)mem)[0] = size;
- mem = (size_t *)mem + 1;
-#endif
+ mem = xmalloc(n * size);
+ memset(mem, 0, n * size);
return mem;
}
-static void
-vm_xfree(rb_objspace_t *objspace, void *ptr)
-{
-#if CALC_EXACT_MALLOC_SIZE
- size_t size;
- ptr = ((size_t *)ptr) - 1;
- size = ((size_t*)ptr)[0];
- objspace->malloc_params.allocated_size -= size;
- objspace->malloc_params.allocations--;
-#endif
-
- free(ptr);
-}
-
void *
-ruby_xmalloc(size_t size)
+ruby_xrealloc(ptr, size)
+ void *ptr;
+ long size;
{
- return vm_xmalloc(&rb_objspace, size);
-}
+ void *mem;
-void *
-ruby_xmalloc2(size_t n, size_t size)
-{
- size_t len = size * n;
- if (n != 0 && size != len / n) {
- rb_raise(rb_eArgError, "malloc: possible integer overflow");
+ if (size < 0) {
+ rb_raise(rb_eArgError, "negative re-allocation size");
}
- return vm_xmalloc(&rb_objspace, len);
-}
-
-void *
-ruby_xcalloc(size_t n, size_t size)
-{
- void *mem = ruby_xmalloc2(n, size);
- memset(mem, 0, n * size);
+ if (!ptr) return xmalloc(size);
+ if (size == 0) size = 1;
+ if (ruby_gc_stress) garbage_collect();
+ RUBY_CRITICAL(mem = realloc(ptr, size));
+ if (!mem) {
+ garbage_collect();
+ RUBY_CRITICAL(mem = realloc(ptr, size));
+ if (!mem) {
+ rb_memerror();
+ }
+ }
+ malloc_increase += size;
return mem;
}
-void *
-ruby_xrealloc(void *ptr, size_t size)
-{
- return vm_xrealloc(&rb_objspace, ptr, size);
-}
-
-void *
-ruby_xrealloc2(void *ptr, size_t n, size_t size)
-{
- size_t len = size * n;
- if (n != 0 && size != len / n) {
- rb_raise(rb_eArgError, "realloc: possible integer overflow");
- }
- return ruby_xrealloc(ptr, len);
-}
-
void
-ruby_xfree(void *x)
+ruby_xfree(x)
+ void *x;
{
if (x)
- vm_xfree(&rb_objspace, x);
+ RUBY_CRITICAL(free(x));
}
+extern int ruby_in_compile;
+static int dont_gc;
+static int during_gc;
+static int need_call_final = 0;
+static st_table *finalizer_table = 0;
+
/*
* call-seq:
@@ -783,9 +226,8 @@ ruby_xfree(void *x)
*/
VALUE
-rb_gc_enable(void)
+rb_gc_enable()
{
- rb_objspace_t *objspace = &rb_objspace;
int old = dont_gc;
dont_gc = Qfalse;
@@ -805,9 +247,8 @@ rb_gc_enable(void)
*/
VALUE
-rb_gc_disable(void)
+rb_gc_disable()
{
- rb_objspace_t *objspace = &rb_objspace;
int old = dont_gc;
dont_gc = Qtrue;
@@ -816,17 +257,15 @@ rb_gc_disable(void)
VALUE rb_mGC;
-void
-rb_gc_register_mark_object(VALUE obj)
-{
- VALUE ary = GET_THREAD()->vm->mark_object_ary;
- rb_ary_push(ary, obj);
-}
+static struct gc_list {
+ VALUE *varptr;
+ struct gc_list *next;
+} *global_List = 0;
void
-rb_gc_register_address(VALUE *addr)
+rb_gc_register_address(addr)
+ VALUE *addr;
{
- rb_objspace_t *objspace = &rb_objspace;
struct gc_list *tmp;
tmp = ALLOC(struct gc_list);
@@ -836,14 +275,14 @@ rb_gc_register_address(VALUE *addr)
}
void
-rb_gc_unregister_address(VALUE *addr)
+rb_gc_unregister_address(addr)
+ VALUE *addr;
{
- rb_objspace_t *objspace = &rb_objspace;
struct gc_list *tmp = global_List;
if (tmp->varptr == addr) {
global_List = tmp->next;
- xfree(tmp);
+ RUBY_CRITICAL(free(tmp));
return;
}
while (tmp->next) {
@@ -851,319 +290,167 @@ rb_gc_unregister_address(VALUE *addr)
struct gc_list *t = tmp->next;
tmp->next = tmp->next->next;
- xfree(t);
+ RUBY_CRITICAL(free(t));
break;
}
tmp = tmp->next;
}
}
+#undef GC_DEBUG
-static void
-allocate_heaps(rb_objspace_t *objspace, size_t next_heaps_length)
+void
+rb_global_variable(var)
+ VALUE *var;
{
- struct heaps_slot *p;
- size_t size;
+ rb_gc_register_address(var);
+}
- size = next_heaps_length*sizeof(struct heaps_slot);
+#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__CYGWIN__)
+#pragma pack(push, 1) /* magic for reducing sizeof(RVALUE): 24 -> 20 */
+#endif
- if (heaps_used > 0) {
- p = (struct heaps_slot *)realloc(heaps, size);
- if (p) heaps = p;
- }
- else {
- p = heaps = (struct heaps_slot *)malloc(size);
- }
+typedef struct RVALUE {
+ union {
+ struct {
+ unsigned long flags; /* always 0 for freed obj */
+ struct RVALUE *next;
+ } free;
+ struct RBasic basic;
+ struct RObject object;
+ struct RClass klass;
+ struct RFloat flonum;
+ struct RString string;
+ struct RArray array;
+ struct RRegexp regexp;
+ struct RHash hash;
+ struct RData data;
+ struct RStruct rstruct;
+ struct RBignum bignum;
+ struct RFile file;
+ struct RNode node;
+ struct RMatch match;
+ struct RVarmap varmap;
+ struct SCOPE scope;
+ } as;
+#ifdef GC_DEBUG
+ char *file;
+ int line;
+#endif
+} RVALUE;
- if (p == 0) {
- during_gc = 0;
- rb_memerror();
- }
- heaps_length = next_heaps_length;
-}
+#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__CYGWIN__)
+#pragma pack(pop)
+#endif
-static void
-assign_heap_slot(rb_objspace_t *objspace, RVALUE **list, enum lifetime lifetime)
-{
- RVALUE *p, *pend, *membase;
- size_t hi, lo, mid;
- size_t objs;
+static RVALUE *freelist = 0;
+static RVALUE *deferred_final_list = 0;
- objs = HEAP_OBJ_LIMIT;
- p = (RVALUE*)malloc(HEAP_SIZE);
+#define HEAPS_INCREMENT 10
+static struct heaps_slot {
+ void *membase;
+ RVALUE *slot;
+ int limit;
+} *heaps;
+static int heaps_length = 0;
+static int heaps_used = 0;
- if (p == 0) {
- during_gc = 0;
- rb_memerror();
- }
+#define HEAP_MIN_SLOTS 10000
+static int heap_slots = HEAP_MIN_SLOTS;
- membase = p;
- if ((VALUE)p % sizeof(RVALUE) != 0) {
- p = (RVALUE*)((VALUE)p + sizeof(RVALUE) - ((VALUE)p % sizeof(RVALUE)));
- if ((HEAP_SIZE - HEAP_OBJ_LIMIT * sizeof(RVALUE)) < (size_t)((char*)p - (char*)membase)) {
- objs--;
- }
+#define FREE_MIN 4096
+
+static RVALUE *himem, *lomem;
+
+static void
+add_heap()
+{
+ RVALUE *p, *pend;
+
+ if (heaps_used == heaps_length) {
+ /* Realloc heaps */
+ struct heaps_slot *p;
+ int length;
+
+ heaps_length += HEAPS_INCREMENT;
+ length = heaps_length*sizeof(struct heaps_slot);
+ RUBY_CRITICAL(
+ if (heaps_used > 0) {
+ p = (struct heaps_slot *)realloc(heaps, length);
+ if (p) heaps = p;
+ }
+ else {
+ p = heaps = (struct heaps_slot *)malloc(length);
+ });
+ if (p == 0) rb_memerror();
}
- lo = 0;
- hi = heaps_used;
- while (lo < hi) {
- register RVALUE *mid_membase;
- mid = (lo + hi) / 2;
- mid_membase = heaps[mid].membase;
- if (mid_membase < membase) {
- lo = mid + 1;
- }
- else if (mid_membase > membase) {
- hi = mid;
- }
- else {
- rb_bug("same heap slot is allocated: %p at %"PRIuVALUE, (void *)membase, (VALUE)mid);
+ for (;;) {
+ RUBY_CRITICAL(p = (RVALUE*)malloc(sizeof(RVALUE)*(heap_slots+1)));
+ if (p == 0) {
+ if (heap_slots == HEAP_MIN_SLOTS) {
+ rb_memerror();
+ }
+ heap_slots = HEAP_MIN_SLOTS;
+ continue;
}
+ heaps[heaps_used].membase = p;
+ if ((VALUE)p % sizeof(RVALUE) == 0)
+ heap_slots += 1;
+ else
+ p = (RVALUE*)((VALUE)p + sizeof(RVALUE) - ((VALUE)p % sizeof(RVALUE)));
+ heaps[heaps_used].slot = p;
+ heaps[heaps_used].limit = heap_slots;
+ break;
}
- if (hi < heaps_used) {
- MEMMOVE(&heaps[hi+1], &heaps[hi], struct heaps_slot, heaps_used - hi);
- }
- heaps[hi].membase = membase;
- heaps[hi].slot = p;
- heaps[hi].limit = objs;
- heaps[hi].lifetime = lifetime;
- pend = p + objs;
+ pend = p + heap_slots;
if (lomem == 0 || lomem > p) lomem = p;
if (himem < pend) himem = pend;
- if (lifetime == lifetime_longlife) objspace->heap.longlife_used++;
heaps_used++;
+ heap_slots *= 1.8;
+ if (heap_slots <= 0) heap_slots = HEAP_MIN_SLOTS;
while (p < pend) {
p->as.free.flags = 0;
- p->as.free.next = *list;
- *list = p;
+ p->as.free.next = freelist;
+ freelist = p;
p++;
}
}
-
-static void
-init_heap(rb_objspace_t *objspace)
-{
- size_t add, i;
-
- add = HEAP_MIN_SLOTS / HEAP_OBJ_LIMIT;
-
- if (!add) {
- add = 1;
- }
-
- if ((heaps_used + add) > heaps_length) {
- allocate_heaps(objspace, heaps_used + add);
- }
-
- for (i = 0; i < add; i++) {
- assign_heap_slot(objspace, &freelist, lifetime_normal);
- }
- heaps_inc = 0;
- objspace->profile.invoke_time = getrusage_time();
-}
-
-
-static void
-set_heaps_increment(rb_objspace_t *objspace)
-{
- size_t next_heaps_length = (size_t)(heaps_used * 1.8);
-
- if (next_heaps_length == heaps_used) {
- next_heaps_length++;
- }
-
- heaps_inc = next_heaps_length - heaps_used;
-
- if (next_heaps_length > heaps_length) {
- allocate_heaps(objspace, next_heaps_length);
- }
-}
-
-static int
-heaps_increment(rb_objspace_t *objspace)
-{
- if (heaps_inc > 0) {
- assign_heap_slot(objspace, &freelist, lifetime_normal);
- heaps_inc--;
- return Qtrue;
- }
- return Qfalse;
-}
-
-#define LONGLIFE_ALLOCATE_HEAPS_MIN 10
-
-static void
-add_longlife_heaps_slot(rb_objspace_t *objspace)
-{
- if ((heaps_used + heaps_inc) >= heaps_length) {
- allocate_heaps(objspace, (heaps_length + LONGLIFE_ALLOCATE_HEAPS_MIN));
- }
- assign_heap_slot(objspace, &objspace->heap.longlife_freelist, lifetime_longlife);
-}
-
#define RANY(o) ((RVALUE*)(o))
-static VALUE
-rb_newobj_from_longlife_heap(rb_objspace_t *objspace)
+int
+rb_during_gc()
{
- VALUE obj;
- if (!objspace->heap.longlife_freelist) {
- add_longlife_heaps_slot(objspace);
- }
-
- obj = (VALUE)objspace->heap.longlife_freelist;
- objspace->heap.longlife_freelist = objspace->heap.longlife_freelist->as.free.next;
-
- MEMZERO((void*)obj, RVALUE, 1);
- FL_SET(RANY(obj), FL_MARK);
- objspace->profile.longlife_objects++;
-
- return obj;
+ return during_gc;
}
-static VALUE
-rb_newobj_from_heap(rb_objspace_t *objspace)
+VALUE
+rb_newobj()
{
VALUE obj;
- if ((ruby_gc_stress && !ruby_disable_gc_stress) || !freelist) {
- if (!heaps_increment(objspace) && !garbage_collect(objspace)) {
- during_gc = 0;
- rb_memerror();
- }
- }
+ if (during_gc)
+ rb_bug("object allocation during garbage collection phase");
+
+ if (ruby_gc_stress || !freelist) garbage_collect();
obj = (VALUE)freelist;
freelist = freelist->as.free.next;
-
MEMZERO((void*)obj, RVALUE, 1);
#ifdef GC_DEBUG
- RANY(obj)->file = rb_sourcefile();
- RANY(obj)->line = rb_sourceline();
+ RANY(obj)->file = ruby_sourcefile;
+ RANY(obj)->line = ruby_sourceline;
#endif
-
return obj;
}
-#if USE_VALUE_CACHE
-static VALUE
-rb_fill_value_cache(rb_thread_t *th)
-{
- rb_objspace_t *objspace = &rb_objspace;
- int i;
- VALUE rv;
-
- /* LOCK */
- for (i=0; i<RUBY_VM_VALUE_CACHE_SIZE; i++) {
- VALUE v = rb_newobj_from_heap(objspace);
-
- th->value_cache[i] = v;
- RBASIC(v)->flags = FL_MARK;
- }
- th->value_cache_ptr = &th->value_cache[0];
- rv = rb_newobj_from_heap(objspace);
- /* UNLOCK */
- return rv;
-}
-#endif
-
-int
-rb_during_gc(void)
-{
- rb_objspace_t *objspace = &rb_objspace;
- return during_gc;
-}
-
-VALUE
-rb_newobj(void)
-{
-#if USE_VALUE_CACHE || (defined(ENABLE_VM_OBJSPACE) && ENABLE_VM_OBJSPACE)
- rb_thread_t *th = GET_THREAD();
-#endif
-#if USE_VALUE_CACHE
- VALUE v = *th->value_cache_ptr;
-#endif
-#if defined(ENABLE_VM_OBJSPACE) && ENABLE_VM_OBJSPACE
- rb_objspace_t *objspace = th->vm->objspace;
-#else
- rb_objspace_t *objspace = &rb_objspace;
-#endif
-
- if (during_gc) {
- dont_gc = 1;
- during_gc = 0;
- rb_bug("object allocation during garbage collection phase");
- }
-
-#if USE_VALUE_CACHE
- if (v) {
- RBASIC(v)->flags = 0;
- th->value_cache_ptr++;
- }
- else {
- v = rb_fill_value_cache(th);
- }
-
-#if defined(GC_DEBUG)
- printf("cache index: %d, v: %p, th: %p\n",
- th->value_cache_ptr - th->value_cache, v, th);
-#endif
- return v;
-#else
- return rb_newobj_from_heap(objspace);
-#endif
-}
-
-VALUE
-rb_newobj_longlife(void)
-{
-#if defined(ENABLE_VM_OBJSPACE) && ENABLE_VM_OBJSPACE
- rb_objspace_t *objspace = th->vm->objspace;
-#else
- rb_objspace_t *objspace = &rb_objspace;
-#endif
- if (during_gc) {
- dont_gc = 1;
- during_gc = 0;
- rb_bug("object allocation during garbage collection phase");
- }
- return rb_newobj_from_longlife_heap(objspace);
-}
-
-NODE*
-rb_node_newnode(enum node_type type, VALUE a0, VALUE a1, VALUE a2)
-{
- NODE *n = (NODE*)rb_newobj();
-
- n->flags |= T_NODE;
- nd_set_type(n, type);
-
- n->u1.value = a0;
- n->u2.value = a1;
- n->u3.value = a2;
-
- return n;
-}
-
-NODE*
-rb_node_newnode_longlife(enum node_type type, VALUE a0, VALUE a1, VALUE a2)
-{
- NODE *n = (NODE*)rb_newobj_longlife();
-
- n->flags |= T_NODE;
- nd_set_type(n, type);
-
- n->u1.value = a0;
- n->u2.value = a1;
- n->u3.value = a2;
-
- return n;
-}
-
VALUE
-rb_data_object_alloc(VALUE klass, void *datap, RUBY_DATA_FUNC dmark, RUBY_DATA_FUNC dfree)
+rb_data_object_alloc(klass, datap, dmark, dfree)
+ VALUE klass;
+ void *datap;
+ RUBY_DATA_FUNC dmark;
+ RUBY_DATA_FUNC dfree;
{
NEWOBJ(data, struct RData);
if (klass) Check_Type(klass, T_CLASS);
@@ -1175,114 +462,108 @@ rb_data_object_alloc(VALUE klass, void *datap, RUBY_DATA_FUNC dmark, RUBY_DATA_F
return (VALUE)data;
}
-VALUE
-rb_data_typed_object_alloc(VALUE klass, void *datap, const rb_data_type_t *type)
-{
- NEWOBJ(data, struct RTypedData);
-
- if (klass) Check_Type(klass, T_CLASS);
-
- OBJSETUP(data, klass, T_DATA);
-
- data->data = datap;
- data->typed_flag = 1;
- data->type = type;
+extern st_table *rb_class_tbl;
+VALUE *rb_gc_stack_start = 0;
+#ifdef __ia64
+VALUE *rb_gc_register_stack_start = 0;
+#endif
- return (VALUE)data;
-}
+#ifdef DJGPP
+/* set stack size (http://www.delorie.com/djgpp/v2faq/faq15_9.html) */
+unsigned int _stklen = 0x180000; /* 1.5 kB */
+#endif
-size_t
-rb_objspace_data_type_memsize(VALUE obj)
-{
- if (RTYPEDDATA_P(obj)) {
- return RTYPEDDATA_TYPE(obj)->dsize(RTYPEDDATA_DATA(obj));
- }
- else {
- return 0;
- }
-}
+#if defined(DJGPP) || defined(_WIN32_WCE)
+static unsigned int STACK_LEVEL_MAX = 65535;
+#elif defined(__human68k__)
+unsigned int _stacksize = 262144;
+# define STACK_LEVEL_MAX (_stacksize - 4096)
+# undef HAVE_GETRLIMIT
+#elif defined(HAVE_GETRLIMIT) || defined(_WIN32)
+static size_t STACK_LEVEL_MAX = 655300;
+#else
+# define STACK_LEVEL_MAX 655300
+#endif
-const char *
-rb_objspace_data_type_name(VALUE obj)
+#ifdef C_ALLOCA
+# define SET_STACK_END VALUE stack_end; alloca(0);
+# define STACK_END (&stack_end)
+#else
+# if defined(__GNUC__) && defined(USE_BUILTIN_FRAME_ADDRESS) && !defined(__ia64)
+# if ( __GNUC__ == 3 && __GNUC_MINOR__ > 0 ) || __GNUC__ > 3
+__attribute__ ((noinline))
+# endif
+static void
+stack_end_address(VALUE **stack_end_p)
{
- if (RTYPEDDATA_P(obj)) {
- return RTYPEDDATA_TYPE(obj)->wrap_struct_name;
- }
- else {
- return 0;
- }
+ VALUE stack_end;
+ *stack_end_p = &stack_end;
}
-
-#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)
+# define SET_STACK_END VALUE *stack_end; stack_end_address(&stack_end)
+# else
+# define SET_STACK_END VALUE *stack_end = alloca(1)
+# endif
+# define STACK_END (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)
+# define STACK_LENGTH (rb_gc_stack_start - STACK_END)
#elif STACK_GROW_DIRECTION > 0
-# define STACK_LENGTH (size_t)(STACK_END - STACK_START + 1)
+# define STACK_LENGTH (STACK_END - rb_gc_stack_start + 1)
#else
-# define STACK_LENGTH ((STACK_END < STACK_START) ? (size_t)(STACK_START - STACK_END) \
- : (size_t)(STACK_END - STACK_START + 1))
+# define STACK_LENGTH ((STACK_END < rb_gc_stack_start) ? rb_gc_stack_start - STACK_END\
+ : STACK_END - rb_gc_stack_start + 1)
#endif
-#if !STACK_GROW_DIRECTION
-int ruby_stack_grow_direction;
-int
-ruby_get_stack_grow_direction(volatile VALUE *addr)
+#if STACK_GROW_DIRECTION > 0
+# define STACK_UPPER(x, a, b) a
+#elif STACK_GROW_DIRECTION < 0
+# define STACK_UPPER(x, a, b) b
+#else
+static int grow_direction;
+static int
+stack_grow_direction(addr)
+ VALUE *addr;
{
- VALUE *end;
- SET_MACHINE_STACK_END(&end);
+ SET_STACK_END;
- if (end > addr) return ruby_stack_grow_direction = 1;
- return ruby_stack_grow_direction = -1;
+ if (STACK_END > addr) return grow_direction = 1;
+ return grow_direction = -1;
}
+# define stack_growup_p(x) ((grow_direction ? grow_direction : stack_grow_direction(x)) > 0)
+# define STACK_UPPER(x, a, b) (stack_growup_p(x) ? a : b)
#endif
#define GC_WATER_MARK 512
+#define CHECK_STACK(ret) do {\
+ SET_STACK_END;\
+ (ret) = (STACK_LENGTH > STACK_LEVEL_MAX + GC_WATER_MARK);\
+} while (0)
+
size_t
-ruby_stack_length(VALUE **p)
+ruby_stack_length(p)
+ VALUE **p;
{
- rb_thread_t *th = GET_THREAD();
SET_STACK_END;
- if (p) *p = STACK_UPPER(STACK_END, STACK_START, STACK_END);
+ if (p) *p = STACK_UPPER(STACK_END, rb_gc_stack_start, STACK_END);
return STACK_LENGTH;
}
-static int
-stack_check(void)
+int
+ruby_stack_check()
{
int ret;
- rb_thread_t *th = GET_THREAD();
- SET_STACK_END;
- ret = STACK_LENGTH > STACK_LEVEL_MAX - GC_WATER_MARK;
-#ifdef __ia64
- if (!ret) {
- ret = (VALUE*)rb_ia64_bsp() - th->machine_register_stack_start >
- th->machine_register_stack_maxsize/sizeof(VALUE) - GC_WATER_MARK;
- }
-#endif
+
+ CHECK_STACK(ret);
return ret;
}
-int
-ruby_stack_check(void)
-{
-#if defined(POSIX_SIGNAL) && defined(SIGSEGV) && defined(HAVE_SIGALTSTACK)
- return 0;
-#else
- return stack_check();
-#endif
-}
+#define MARK_STACK_MAX 1024
+static VALUE mark_stack[MARK_STACK_MAX];
+static VALUE *mark_stack_ptr;
+static int mark_stack_overflow;
static void
-init_mark_stack(rb_objspace_t *objspace)
+init_mark_stack()
{
mark_stack_overflow = 0;
mark_stack_ptr = mark_stack;
@@ -1290,22 +571,65 @@ init_mark_stack(rb_objspace_t *objspace)
#define MARK_STACK_EMPTY (mark_stack_ptr == mark_stack)
-static void gc_mark(rb_objspace_t *objspace, VALUE ptr, int lev);
-static void gc_mark_children(rb_objspace_t *objspace, VALUE ptr, int lev);
+static st_table *source_filenames;
+
+char *
+rb_source_filename(f)
+ const char *f;
+{
+ st_data_t name;
+
+ if (!st_lookup(source_filenames, (st_data_t)f, &name)) {
+ long len = strlen(f) + 1;
+ char *ptr = ALLOC_N(char, len + 1);
+ name = (st_data_t)ptr;
+ *ptr++ = 0;
+ MEMCPY(ptr, f, char, len);
+ st_add_direct(source_filenames, (st_data_t)ptr, name);
+ return ptr;
+ }
+ return (char *)name + 1;
+}
static void
-gc_mark_all(rb_objspace_t *objspace)
+mark_source_filename(f)
+ char *f;
+{
+ if (f) {
+ f[-1] = 1;
+ }
+}
+
+static int
+sweep_source_filename(key, value)
+ char *key, *value;
+{
+ if (*value) {
+ *value = 0;
+ return ST_CONTINUE;
+ }
+ else {
+ free(value);
+ return ST_DELETE;
+ }
+}
+
+static void gc_mark _((VALUE ptr, int lev));
+static void gc_mark_children _((VALUE ptr, int lev));
+
+static void
+gc_mark_all()
{
RVALUE *p, *pend;
- size_t i;
+ int i;
- init_mark_stack(objspace);
+ init_mark_stack();
for (i = 0; i < heaps_used; i++) {
p = heaps[i].slot; pend = p + heaps[i].limit;
while (p < pend) {
if ((p->as.basic.flags & FL_MARK) &&
(p->as.basic.flags != FL_MARK)) {
- gc_mark_children(objspace, (VALUE)p, 0);
+ gc_mark_children((VALUE)p, 0);
}
p++;
}
@@ -1313,247 +637,159 @@ gc_mark_all(rb_objspace_t *objspace)
}
static void
-gc_mark_rest(rb_objspace_t *objspace)
+gc_mark_rest()
{
VALUE tmp_arry[MARK_STACK_MAX];
VALUE *p;
p = (mark_stack_ptr - mark_stack) + tmp_arry;
- MEMCPY(tmp_arry, mark_stack, VALUE, p - tmp_arry);
+ MEMCPY(tmp_arry, mark_stack, VALUE, MARK_STACK_MAX);
- init_mark_stack(objspace);
- while (p != tmp_arry) {
+ init_mark_stack();
+ while(p != tmp_arry){
p--;
- gc_mark_children(objspace, *p, 0);
+ gc_mark_children(*p, 0);
}
}
static inline int
-is_pointer_to_heap(rb_objspace_t *objspace, void *ptr)
+is_pointer_to_heap(ptr)
+ void *ptr;
{
register RVALUE *p = RANY(ptr);
- register struct heaps_slot *heap;
- register size_t hi, lo, mid;
+ register RVALUE *heap_org;
+ register long i;
if (p < lomem || p > himem) return Qfalse;
if ((VALUE)p % sizeof(RVALUE) != 0) return Qfalse;
- /* check if p looks like a pointer using bsearch*/
- lo = 0;
- hi = heaps_used;
- while (lo < hi) {
- mid = (lo + hi) / 2;
- heap = &heaps[mid];
- if (heap->slot <= p) {
- if (p < heap->slot + heap->limit)
- return Qtrue;
- lo = mid + 1;
- }
- else {
- hi = mid;
- }
+ /* check if p looks like a pointer */
+ for (i=0; i < heaps_used; i++) {
+ heap_org = heaps[i].slot;
+ if (heap_org <= p && p < heap_org + heaps[i].limit)
+ return Qtrue;
}
return Qfalse;
}
-VALUE
-rb_gc_write_barrier(VALUE ptr)
-{
- rb_objspace_t *objspace = &rb_objspace;
- remembered_set_t *tmp;
- RVALUE *obj = RANY(ptr);
-
- if (!SPECIAL_CONST_P(ptr) &&
- !(RBASIC(ptr)->flags & FL_MARK || RBASIC(ptr)->flags & FL_REMEMBERED_SET)) {
- if (objspace->remembered_set.freed) {
- tmp = objspace->remembered_set.freed;
- objspace->remembered_set.freed = objspace->remembered_set.freed->next;
- }
- else {
- tmp = ALLOC(remembered_set_t);
- }
- tmp->next = objspace->remembered_set.ptr;
- tmp->obj = obj;
- obj->as.basic.flags |= FL_REMEMBERED_SET;
- objspace->remembered_set.ptr = tmp;
- }
- return ptr;
-}
-
static void
-mark_locations_array(rb_objspace_t *objspace, register VALUE *x, register long n)
+mark_locations_array(x, n)
+ register VALUE *x;
+ register long n;
{
VALUE v;
while (n--) {
v = *x;
- VALGRIND_MAKE_MEM_DEFINED(&v, sizeof(v));
- if (is_pointer_to_heap(objspace, (void *)v)) {
- gc_mark(objspace, v, 0);
+ if (is_pointer_to_heap((void *)v)) {
+ gc_mark(v, 0);
}
x++;
}
}
-static void
-gc_mark_locations(rb_objspace_t *objspace, VALUE *start, VALUE *end)
+void
+rb_gc_mark_locations(start, end)
+ VALUE *start, *end;
{
long n;
- if (end <= start) return;
n = end - start;
- mark_locations_array(objspace, start, n);
-}
-
-void
-rb_gc_mark_locations(VALUE *start, VALUE *end)
-{
- gc_mark_locations(&rb_objspace, start, end);
-}
-
-#define rb_gc_mark_locations(start, end) gc_mark_locations(objspace, start, end)
-
-struct mark_tbl_arg {
- rb_objspace_t *objspace;
- int lev;
-};
-
-static int
-mark_entry(ID key, VALUE value, st_data_t data)
-{
- struct mark_tbl_arg *arg = (void*)data;
- gc_mark(arg->objspace, value, arg->lev);
- return ST_CONTINUE;
-}
-
-static void
-mark_tbl(rb_objspace_t *objspace, st_table *tbl, int lev)
-{
- struct mark_tbl_arg arg;
- if (!tbl) return;
- arg.objspace = objspace;
- arg.lev = lev;
- st_foreach(tbl, mark_entry, (st_data_t)&arg);
+ mark_locations_array(start,n);
}
static int
-mark_key(VALUE key, VALUE value, st_data_t data)
+mark_entry(key, value, lev)
+ ID key;
+ VALUE value;
+ int lev;
{
- struct mark_tbl_arg *arg = (void*)data;
- gc_mark(arg->objspace, key, arg->lev);
+ gc_mark(value, lev);
return ST_CONTINUE;
}
static void
-mark_set(rb_objspace_t *objspace, st_table *tbl, int lev)
+mark_tbl(tbl, lev)
+ st_table *tbl;
+ int lev;
{
- struct mark_tbl_arg arg;
if (!tbl) return;
- arg.objspace = objspace;
- arg.lev = lev;
- st_foreach(tbl, mark_key, (st_data_t)&arg);
+ st_foreach(tbl, mark_entry, lev);
}
void
-rb_mark_set(st_table *tbl)
+rb_mark_tbl(tbl)
+ st_table *tbl;
{
- mark_set(&rb_objspace, tbl, 0);
+ mark_tbl(tbl, 0);
}
static int
-mark_keyvalue(VALUE key, VALUE value, st_data_t data)
+mark_key(key, value, lev)
+ VALUE key, value;
+ int lev;
{
- struct mark_tbl_arg *arg = (void*)data;
- gc_mark(arg->objspace, key, arg->lev);
- gc_mark(arg->objspace, value, arg->lev);
+ gc_mark(key, lev);
return ST_CONTINUE;
}
static void
-mark_hash(rb_objspace_t *objspace, st_table *tbl, int lev)
+mark_set(tbl, lev)
+ st_table *tbl;
+ int lev;
{
- struct mark_tbl_arg arg;
if (!tbl) return;
- arg.objspace = objspace;
- arg.lev = lev;
- st_foreach(tbl, mark_keyvalue, (st_data_t)&arg);
-}
-
-void
-rb_mark_hash(st_table *tbl)
-{
- mark_hash(&rb_objspace, tbl, 0);
-}
-
-static void
-mark_method_entry(rb_objspace_t *objspace, const rb_method_entry_t *me, int lev)
-{
- gc_mark(objspace, me->klass, lev);
- switch (me->type) {
- case VM_METHOD_TYPE_ISEQ:
- gc_mark(objspace, me->body.iseq->self, lev);
- break;
- case VM_METHOD_TYPE_BMETHOD:
- gc_mark(objspace, me->body.proc, lev);
- break;
- default:
- break; /* ignore */
- }
+ st_foreach(tbl, mark_key, lev);
}
void
-rb_gc_mark_method_entry(const rb_method_entry_t *me)
+rb_mark_set(tbl)
+ st_table *tbl;
{
- mark_method_entry(&rb_objspace, me, 0);
+ mark_set(tbl, 0);
}
static int
-mark_method_entry_i(ID key, const rb_method_entry_t *me, st_data_t data)
-{
- struct mark_tbl_arg *arg = (void*)data;
- mark_method_entry(arg->objspace, me, arg->lev);
- return ST_CONTINUE;
-}
-
-static void
-mark_m_tbl(rb_objspace_t *objspace, st_table *tbl, int lev) {
- struct mark_tbl_arg arg;
- if (!tbl) return;
- arg.objspace = objspace;
- arg.lev = lev;
- st_foreach(tbl, mark_method_entry_i, (st_data_t)&arg);
-}
-
-static int
-free_method_entry_i(ID key, rb_method_entry_t *me, st_data_t data)
+mark_keyvalue(key, value, lev)
+ VALUE key;
+ VALUE value;
+ int lev;
{
- xfree(me);
+ gc_mark(key, lev);
+ gc_mark(value, lev);
return ST_CONTINUE;
}
static void
-free_m_table(st_table *tbl)
+mark_hash(tbl, lev)
+ st_table *tbl;
+ int lev;
{
- st_foreach(tbl, free_method_entry_i, 0);
+ if (!tbl) return;
+ st_foreach(tbl, mark_keyvalue, lev);
}
void
-rb_mark_tbl(st_table *tbl)
+rb_mark_hash(tbl)
+ st_table *tbl;
{
- mark_tbl(&rb_objspace, tbl, 0);
+ mark_hash(tbl, 0);
}
void
-rb_gc_mark_maybe(VALUE obj)
+rb_gc_mark_maybe(obj)
+ VALUE obj;
{
- if (is_pointer_to_heap(&rb_objspace, (void *)obj)) {
- gc_mark(&rb_objspace, obj, 0);
+ if (is_pointer_to_heap((void *)obj)) {
+ gc_mark(obj, 0);
}
}
#define GC_LEVEL_MAX 250
static void
-gc_mark(rb_objspace_t *objspace, VALUE ptr, int lev)
+gc_mark(ptr, lev)
+ VALUE ptr;
+ int lev;
{
register RVALUE *obj;
@@ -1563,7 +799,7 @@ gc_mark(rb_objspace_t *objspace, VALUE ptr, int lev)
if (obj->as.basic.flags & FL_MARK) return; /* already marked */
obj->as.basic.flags |= FL_MARK;
- if (lev > GC_LEVEL_MAX || (lev == 0 && stack_check())) {
+ if (lev > GC_LEVEL_MAX || (lev == 0 && ruby_stack_check())) {
if (!mark_stack_overflow) {
if (mark_stack_ptr - mark_stack < MARK_STACK_MAX) {
*mark_stack_ptr = ptr;
@@ -1575,17 +811,20 @@ gc_mark(rb_objspace_t *objspace, VALUE ptr, int lev)
}
return;
}
- gc_mark_children(objspace, ptr, lev+1);
+ gc_mark_children(ptr, lev+1);
}
void
-rb_gc_mark(VALUE ptr)
+rb_gc_mark(ptr)
+ VALUE ptr;
{
- gc_mark(&rb_objspace, ptr, 0);
+ gc_mark(ptr, 0);
}
static void
-gc_mark_children(rb_objspace_t *objspace, VALUE ptr, int lev)
+gc_mark_children(ptr, lev)
+ VALUE ptr;
+ int lev;
{
register RVALUE *obj = RANY(ptr);
@@ -1603,47 +842,47 @@ gc_mark_children(rb_objspace_t *objspace, VALUE ptr, int lev)
rb_mark_generic_ivar(ptr);
}
- switch (BUILTIN_TYPE(obj)) {
+ switch (obj->as.basic.flags & T_MASK) {
case T_NIL:
case T_FIXNUM:
rb_bug("rb_gc_mark() called for broken object");
break;
case T_NODE:
+ mark_source_filename(obj->as.node.nd_file);
switch (nd_type(obj)) {
case NODE_IF: /* 1,2,3 */
case NODE_FOR:
case NODE_ITER:
+ case NODE_CREF:
case NODE_WHEN:
case NODE_MASGN:
case NODE_RESCUE:
case NODE_RESBODY:
case NODE_CLASS:
- case NODE_BLOCK_PASS:
- gc_mark(objspace, (VALUE)obj->as.node.u2.node, lev);
+ gc_mark((VALUE)obj->as.node.u2.node, lev);
/* fall through */
case NODE_BLOCK: /* 1,3 */
- case NODE_OPTBLOCK:
case NODE_ARRAY:
case NODE_DSTR:
case NODE_DXSTR:
case NODE_DREGX:
case NODE_DREGX_ONCE:
+ case NODE_FBODY:
case NODE_ENSURE:
case NODE_CALL:
case NODE_DEFS:
case NODE_OP_ASGN1:
- case NODE_ARGS:
- gc_mark(objspace, (VALUE)obj->as.node.u1.node, lev);
+ gc_mark((VALUE)obj->as.node.u1.node, lev);
/* fall through */
case NODE_SUPER: /* 3 */
case NODE_FCALL:
case NODE_DEFN:
- case NODE_ARGS_AUX:
+ case NODE_NEWLINE:
ptr = (VALUE)obj->as.node.u3.node;
goto again;
- case NODE_WHILE:
+ case NODE_WHILE: /* 1,2 */
case NODE_UNTIL:
case NODE_AND:
case NODE_OR:
@@ -1660,21 +899,22 @@ gc_mark_children(rb_objspace_t *objspace, VALUE ptr, int lev)
case NODE_MODULE:
case NODE_ALIAS:
case NODE_VALIAS:
- case NODE_ARGSCAT:
- gc_mark(objspace, (VALUE)obj->as.node.u1.node, lev);
+ case NODE_ARGS:
+ gc_mark((VALUE)obj->as.node.u1.node, lev);
/* fall through */
+ case NODE_METHOD: /* 2 */
+ case NODE_NOT:
case NODE_GASGN:
case NODE_LASGN:
case NODE_DASGN:
case NODE_DASGN_CURR:
case NODE_IASGN:
- case NODE_IASGN2:
+ case NODE_CVDECL:
case NODE_CVASGN:
case NODE_COLON3:
case NODE_OPT_N:
case NODE_EVSTR:
case NODE_UNDEF:
- case NODE_POSTEXE:
ptr = (VALUE)obj->as.node.u2.node;
goto again;
@@ -1691,18 +931,20 @@ gc_mark_children(rb_objspace_t *objspace, VALUE ptr, int lev)
case NODE_COLON2:
case NODE_SPLAT:
case NODE_TO_ARY:
+ case NODE_SVALUE:
ptr = (VALUE)obj->as.node.u1.node;
goto again;
case NODE_SCOPE: /* 2,3 */
+ case NODE_BLOCK_PASS:
case NODE_CDECL:
- case NODE_OPT_ARG:
- gc_mark(objspace, (VALUE)obj->as.node.u3.node, lev);
+ gc_mark((VALUE)obj->as.node.u3.node, lev);
ptr = (VALUE)obj->as.node.u2.node;
goto again;
case NODE_ZARRAY: /* - */
case NODE_ZSUPER:
+ case NODE_CFUNC:
case NODE_VCALL:
case NODE_GVAR:
case NODE_LVAR:
@@ -1717,187 +959,157 @@ gc_mark_children(rb_objspace_t *objspace, VALUE ptr, int lev)
case NODE_NIL:
case NODE_TRUE:
case NODE_FALSE:
- case NODE_ERRINFO:
+ case NODE_ATTRSET:
case NODE_BLOCK_ARG:
+ case NODE_POSTEXE:
break;
case NODE_ALLOCA:
- mark_locations_array(objspace,
- (VALUE*)obj->as.node.u1.value,
+ mark_locations_array((VALUE*)obj->as.node.u1.value,
obj->as.node.u3.cnt);
ptr = (VALUE)obj->as.node.u2.node;
goto again;
default: /* unlisted NODE */
- if (is_pointer_to_heap(objspace, obj->as.node.u1.node)) {
- gc_mark(objspace, (VALUE)obj->as.node.u1.node, lev);
+ if (is_pointer_to_heap(obj->as.node.u1.node)) {
+ gc_mark((VALUE)obj->as.node.u1.node, lev);
}
- if (is_pointer_to_heap(objspace, obj->as.node.u2.node)) {
- gc_mark(objspace, (VALUE)obj->as.node.u2.node, lev);
+ if (is_pointer_to_heap(obj->as.node.u2.node)) {
+ gc_mark((VALUE)obj->as.node.u2.node, lev);
}
- if (is_pointer_to_heap(objspace, obj->as.node.u3.node)) {
- gc_mark(objspace, (VALUE)obj->as.node.u3.node, lev);
+ if (is_pointer_to_heap(obj->as.node.u3.node)) {
+ gc_mark((VALUE)obj->as.node.u3.node, lev);
}
}
return; /* no need to mark class. */
}
- gc_mark(objspace, obj->as.basic.klass, lev);
- switch (BUILTIN_TYPE(obj)) {
+ gc_mark(obj->as.basic.klass, lev);
+ switch (obj->as.basic.flags & T_MASK) {
case T_ICLASS:
case T_CLASS:
case T_MODULE:
- mark_m_tbl(objspace, RCLASS_M_TBL(obj), lev);
- mark_tbl(objspace, RCLASS_IV_TBL(obj), lev);
- ptr = RCLASS_SUPER(obj);
+ mark_tbl(obj->as.klass.m_tbl, lev);
+ mark_tbl(obj->as.klass.iv_tbl, lev);
+ ptr = obj->as.klass.super;
goto again;
case T_ARRAY:
if (FL_TEST(obj, ELTS_SHARED)) {
- ptr = obj->as.array.as.heap.aux.shared;
+ ptr = obj->as.array.aux.shared;
goto again;
}
else {
- long i, len = RARRAY_LEN(obj);
- VALUE *ptr = RARRAY_PTR(obj);
+ long i, len = obj->as.array.len;
+ VALUE *ptr = obj->as.array.ptr;
+
for (i=0; i < len; i++) {
- gc_mark(objspace, *ptr++, lev);
+ gc_mark(*ptr++, lev);
}
}
break;
case T_HASH:
- mark_hash(objspace, obj->as.hash.ntbl, lev);
+ mark_hash(obj->as.hash.tbl, lev);
ptr = obj->as.hash.ifnone;
goto again;
case T_STRING:
#define STR_ASSOC FL_USER3 /* copied from string.c */
- if (FL_TEST(obj, RSTRING_NOEMBED) && FL_ANY(obj, ELTS_SHARED|STR_ASSOC)) {
- ptr = obj->as.string.as.heap.aux.shared;
+ if (FL_TEST(obj, ELTS_SHARED|STR_ASSOC)) {
+ ptr = obj->as.string.aux.shared;
goto again;
}
break;
case T_DATA:
- if (RTYPEDDATA_P(obj)) {
- if (obj->as.typeddata.type->dmark) (*obj->as.typeddata.type->dmark)(DATA_PTR(obj));
- }
- else {
- if (obj->as.data.dmark) (*obj->as.data.dmark)(DATA_PTR(obj));
- }
+ if (obj->as.data.dmark) (*obj->as.data.dmark)(DATA_PTR(obj));
break;
case T_OBJECT:
- {
- long i, len = ROBJECT_NUMIV(obj);
- VALUE *ptr = ROBJECT_IVPTR(obj);
- for (i = 0; i < len; i++) {
- gc_mark(objspace, *ptr++, lev);
- }
- }
+ mark_tbl(obj->as.object.iv_tbl, lev);
break;
case T_FILE:
- if (obj->as.file.fptr) {
- gc_mark(objspace, obj->as.file.fptr->pathv, lev);
- gc_mark(objspace, obj->as.file.fptr->tied_io_for_writing, lev);
- gc_mark(objspace, obj->as.file.fptr->writeconv_asciicompat, lev);
- gc_mark(objspace, obj->as.file.fptr->writeconv_pre_ecopts, lev);
- gc_mark(objspace, obj->as.file.fptr->encs.ecopts, lev);
- gc_mark(objspace, obj->as.file.fptr->write_lock, lev);
- }
- break;
-
case T_REGEXP:
- gc_mark(objspace, obj->as.regexp.src, lev);
- break;
-
case T_FLOAT:
case T_BIGNUM:
- case T_ZOMBIE:
+ case T_BLKTAG:
break;
case T_MATCH:
- gc_mark(objspace, obj->as.match.regexp, lev);
if (obj->as.match.str) {
ptr = obj->as.match.str;
goto again;
}
break;
- case T_RATIONAL:
- gc_mark(objspace, obj->as.rational.num, lev);
- gc_mark(objspace, obj->as.rational.den, lev);
- break;
+ case T_VARMAP:
+ gc_mark(obj->as.varmap.val, lev);
+ ptr = (VALUE)obj->as.varmap.next;
+ goto again;
+
+ case T_SCOPE:
+ if (obj->as.scope.local_vars && (obj->as.scope.flags & SCOPE_MALLOC)) {
+ int n = obj->as.scope.local_tbl[0]+1;
+ VALUE *vars = &obj->as.scope.local_vars[-1];
- case T_COMPLEX:
- gc_mark(objspace, obj->as.complex.real, lev);
- gc_mark(objspace, obj->as.complex.imag, lev);
+ while (n--) {
+ gc_mark(*vars++, lev);
+ }
+ }
break;
case T_STRUCT:
{
- long len = RSTRUCT_LEN(obj);
- VALUE *ptr = RSTRUCT_PTR(obj);
+ long len = obj->as.rstruct.len;
+ VALUE *ptr = obj->as.rstruct.ptr;
while (len--) {
- gc_mark(objspace, *ptr++, lev);
+ gc_mark(*ptr++, lev);
}
}
break;
default:
- rb_bug("rb_gc_mark(): unknown data type 0x%x(%p) %s",
- BUILTIN_TYPE(obj), (void *)obj,
- is_pointer_to_heap(objspace, obj) ? "corrupted object" : "non object");
+ rb_bug("rb_gc_mark(): unknown data type 0x%lx(0x%lx) %s",
+ obj->as.basic.flags & T_MASK, obj,
+ is_pointer_to_heap(obj) ? "corrupted object" : "non object");
}
}
-static int obj_free(rb_objspace_t *, VALUE);
+static int obj_free _((VALUE));
static inline void
-add_freelist(rb_objspace_t *objspace, RVALUE **list, RVALUE *p)
+add_freelist(p)
+ RVALUE *p;
{
- VALGRIND_MAKE_MEM_UNDEFINED((void*)p, sizeof(RVALUE));
p->as.free.flags = 0;
- p->as.free.next = *list;
- *list = p;
+ p->as.free.next = freelist;
+ freelist = p;
}
static void
-finalize_list(rb_objspace_t *objspace, RVALUE *p)
+finalize_list(p)
+ RVALUE *p;
{
while (p) {
RVALUE *tmp = p->as.free.next;
- run_final(objspace, (VALUE)p);
+ run_final((VALUE)p);
if (!FL_TEST(p, FL_SINGLETON)) { /* not freeing page */
- add_freelist(objspace, &freelist, p);
- }
- else {
- struct heaps_slot *slot = (struct heaps_slot *)RDATA(p)->dmark;
- slot->limit--;
+ add_freelist(p);
}
p = tmp;
}
}
static void
-free_unused_heaps(rb_objspace_t *objspace)
+free_unused_heaps()
{
- size_t i, j;
- RVALUE *last = 0;
+ int i, j;
for (i = j = 1; j < heaps_used; i++) {
if (heaps[i].limit == 0) {
- if (!last) {
- last = heaps[i].membase;
- }
- else {
- free(heaps[i].membase);
- }
- if (heaps[i].lifetime == lifetime_longlife) {
- objspace->heap.longlife_used--;
- }
+ free(heaps[i].membase);
heaps_used--;
}
else {
@@ -1907,64 +1119,75 @@ free_unused_heaps(rb_objspace_t *objspace)
j++;
}
}
- if (last) {
- if (last < heaps_freed) {
- free(heaps_freed);
- heaps_freed = last;
- }
- else {
- free(last);
- }
- }
}
+#define T_DEFERRED 0x3a
+
+void rb_gc_abort_threads(void);
+
static void
-gc_sweep(rb_objspace_t *objspace)
+gc_sweep()
{
RVALUE *p, *pend, *final_list;
- size_t freed = 0;
- size_t i;
- size_t live = 0, free_min = 0, do_heap_free = 0;
-
- do_heap_free = (size_t)((heaps_used * HEAP_OBJ_LIMIT) * 0.65);
- free_min = (size_t)((heaps_used * HEAP_OBJ_LIMIT) * 0.2);
+ int freed = 0;
+ int i;
+ unsigned long live = 0;
+ unsigned long free_min = 0;
- if (free_min < FREE_MIN) {
- do_heap_free = heaps_used * HEAP_OBJ_LIMIT;
+ for (i = 0; i < heaps_used; i++) {
+ free_min += heaps[i].limit;
+ }
+ free_min = free_min * 0.2;
+ if (free_min < FREE_MIN)
free_min = FREE_MIN;
+
+ if (ruby_in_compile && ruby_parser_stack_on_heap()) {
+ /* should not reclaim nodes during compilation
+ if yacc's semantic stack is not allocated on machine stack */
+ for (i = 0; i < heaps_used; i++) {
+ p = heaps[i].slot; pend = p + heaps[i].limit;
+ while (p < pend) {
+ if (!(p->as.basic.flags&FL_MARK) && BUILTIN_TYPE(p) == T_NODE)
+ gc_mark((VALUE)p, 0);
+ p++;
+ }
+ }
+ }
+
+ mark_source_filename(ruby_sourcefile);
+ if (source_filenames) {
+ st_foreach(source_filenames, sweep_source_filename, 0);
}
freelist = 0;
final_list = deferred_final_list;
deferred_final_list = 0;
for (i = 0; i < heaps_used; i++) {
- size_t free_num = 0, final_num = 0;
+ int n = 0;
RVALUE *free = freelist;
RVALUE *final = final_list;
int deferred;
- if (heaps[i].lifetime == lifetime_longlife) continue;
p = heaps[i].slot; pend = p + heaps[i].limit;
while (p < pend) {
if (!(p->as.basic.flags & FL_MARK)) {
if (p->as.basic.flags &&
- ((deferred = obj_free(objspace, (VALUE)p)) ||
+ ((deferred = obj_free((VALUE)p)) ||
((FL_TEST(p, FL_FINALIZE)) && need_call_final))) {
if (!deferred) {
- p->as.free.flags = T_ZOMBIE;
+ p->as.free.flags = T_DEFERRED;
RDATA(p)->dfree = 0;
}
p->as.free.flags |= FL_MARK;
p->as.free.next = final_list;
final_list = p;
- final_num++;
}
else {
- add_freelist(objspace, &freelist, p);
- free_num++;
+ add_freelist(p);
}
+ n++;
}
- else if (BUILTIN_TYPE(p) == T_ZOMBIE) {
+ else if (BUILTIN_TYPE(p) == T_DEFERRED) {
/* objects to be finalized */
/* do nothing remain marked */
}
@@ -1974,127 +1197,55 @@ gc_sweep(rb_objspace_t *objspace)
}
p++;
}
- if (final_num + free_num == heaps[i].limit && freed > do_heap_free) {
+ if (n == heaps[i].limit && freed > free_min) {
RVALUE *pp;
+ heaps[i].limit = 0;
for (pp = final_list; pp != final; pp = pp->as.free.next) {
- RDATA(pp)->dmark = (void *)&heaps[i];
pp->as.free.flags |= FL_SINGLETON; /* freeing page mark */
}
- heaps[i].limit = final_num;
-
freelist = free; /* cancel this page from freelist */
}
else {
- freed += free_num;
+ freed += n;
}
}
- GC_PROF_SET_MALLOC_INFO;
if (malloc_increase > malloc_limit) {
- malloc_limit += (size_t)((malloc_increase - malloc_limit) * (double)live / (live + freed));
+ malloc_limit += (malloc_increase - malloc_limit) * (double)live / (live + freed);
if (malloc_limit < GC_MALLOC_LIMIT) malloc_limit = GC_MALLOC_LIMIT;
}
malloc_increase = 0;
if (freed < free_min) {
- if (!heaps_inc && objspace->heap.longlife_used)
- objspace->flags.longlife_collection = Qtrue;
- set_heaps_increment(objspace);
- heaps_increment(objspace);
+ add_heap();
}
during_gc = 0;
/* clear finalization list */
if (final_list) {
- GC_PROF_SET_HEAP_INFO;
deferred_final_list = final_list;
- RUBY_VM_SET_FINALIZER_INTERRUPT(GET_THREAD());
- }
- else{
- free_unused_heaps(objspace);
- GC_PROF_SET_HEAP_INFO;
- }
-}
-
-static void
-remembered_set_recycle(rb_objspace_t *objspace)
-{
- remembered_set_t *top = 0, *rem, *next;
-
- rem = objspace->remembered_set.ptr;
- while (rem) {
- next = rem->next;
- if (RBASIC(rem->obj)->flags & FL_MARK) {
- top = rem;
- }
- else {
- if (top) {
- top->next = next;
- }
- else {
- objspace->remembered_set.ptr = next;
- }
- rem->obj = 0;
- rem->next = objspace->remembered_set.freed;
- objspace->remembered_set.freed = rem;
- }
- rem = next;
- }
-}
-
-static void
-gc_sweep_for_longlife(rb_objspace_t *objspace)
-{
- RVALUE *p, *pend;
- size_t i, freed = 0;
-
- objspace->heap.longlife_freelist = 0;
- for (i = 0; i < heaps_used; i++) {
-
- if (heaps[i].lifetime == lifetime_normal) continue;
- p = heaps[i].slot; pend = p + heaps[i].limit;
- while (p < pend) {
- if (!(p->as.basic.flags & FL_MARK)) {
- if (p->as.basic.flags) {
- obj_free(objspace, (VALUE)p);
- }
- add_freelist(objspace, &objspace->heap.longlife_freelist, p);
- freed++;
- }
- p++;
- }
+ rb_thread_pending = 1;
+ return;
}
-
- remembered_set_recycle(objspace);
- objspace->flags.longlife_collection = Qfalse;
- objspace->profile.longlife_objects = objspace->profile.longlife_objects - freed;
+ free_unused_heaps();
}
void
-rb_gc_force_recycle(VALUE p)
+rb_gc_force_recycle(p)
+ VALUE p;
{
- rb_objspace_t *objspace = &rb_objspace;
- if (!(RBASIC(p)->flags & FL_MARK || RBASIC(p)->flags & FL_REMEMBERED_SET)) {
- add_freelist(objspace, &freelist, (RVALUE *)p);
- }
-}
-
-static inline void
-make_deferred(RVALUE *p)
-{
- p->as.basic.flags = (p->as.basic.flags & ~T_MASK) | T_ZOMBIE;
+ add_freelist(p);
}
static inline void
-make_io_deferred(RVALUE *p)
+make_deferred(p)
+ RVALUE *p;
{
- rb_io_t *fptr = p->as.file.fptr;
- make_deferred(p);
- p->as.data.dfree = (void (*)(void*))rb_io_fptr_finalize;
- p->as.data.data = fptr;
+ p->as.basic.flags = (p->as.basic.flags & ~T_MASK) | T_DEFERRED;
}
static int
-obj_free(rb_objspace_t *objspace, VALUE obj)
+obj_free(obj)
+ VALUE obj;
{
switch (BUILTIN_TYPE(obj)) {
case T_NIL:
@@ -2107,51 +1258,49 @@ obj_free(rb_objspace_t *objspace, VALUE obj)
if (FL_TEST(obj, FL_EXIVAR)) {
rb_free_generic_ivar((VALUE)obj);
- FL_UNSET(obj, FL_EXIVAR);
}
switch (BUILTIN_TYPE(obj)) {
case T_OBJECT:
- if (!(RANY(obj)->as.basic.flags & ROBJECT_EMBED) &&
- RANY(obj)->as.object.as.heap.ivptr) {
- xfree(RANY(obj)->as.object.as.heap.ivptr);
+ if (RANY(obj)->as.object.iv_tbl) {
+ st_free_table(RANY(obj)->as.object.iv_tbl);
}
break;
case T_MODULE:
case T_CLASS:
rb_clear_cache_by_class((VALUE)obj);
- free_m_table(RCLASS_M_TBL(obj));
- if (RCLASS_IV_TBL(obj)) {
- st_free_table(RCLASS_IV_TBL(obj));
+ st_free_table(RANY(obj)->as.klass.m_tbl);
+ if (RANY(obj)->as.object.iv_tbl) {
+ st_free_table(RANY(obj)->as.object.iv_tbl);
}
- if (RCLASS_IV_INDEX_TBL(obj)) {
- st_free_table(RCLASS_IV_INDEX_TBL(obj));
- }
- xfree(RANY(obj)->as.klass.ptr);
break;
case T_STRING:
- rb_str_free(obj);
+ if (RANY(obj)->as.string.ptr && !FL_TEST(obj, ELTS_SHARED)) {
+ RUBY_CRITICAL(free(RANY(obj)->as.string.ptr));
+ }
break;
case T_ARRAY:
- rb_ary_free(obj);
+ if (RANY(obj)->as.array.ptr && !FL_TEST(obj, ELTS_SHARED)) {
+ RUBY_CRITICAL(free(RANY(obj)->as.array.ptr));
+ }
break;
case T_HASH:
- if (RANY(obj)->as.hash.ntbl) {
- st_free_table(RANY(obj)->as.hash.ntbl);
+ if (RANY(obj)->as.hash.tbl) {
+ st_free_table(RANY(obj)->as.hash.tbl);
}
break;
case T_REGEXP:
if (RANY(obj)->as.regexp.ptr) {
- onig_free(RANY(obj)->as.regexp.ptr);
+ re_free_pattern(RANY(obj)->as.regexp.ptr);
+ }
+ if (RANY(obj)->as.regexp.str) {
+ RUBY_CRITICAL(free(RANY(obj)->as.regexp.str));
}
break;
case T_DATA:
if (DATA_PTR(obj)) {
- if (RTYPEDDATA_P(obj)) {
- RDATA(obj)->dfree = RANY(obj)->as.typeddata.type->dfree;
- }
if ((long)RANY(obj)->as.data.dfree == -1) {
- xfree(DATA_PTR(obj));
+ RUBY_CRITICAL(free(DATA_PTR(obj)));
}
else if (RANY(obj)->as.data.dfree) {
make_deferred(RANY(obj));
@@ -2160,190 +1309,181 @@ obj_free(rb_objspace_t *objspace, VALUE obj)
}
break;
case T_MATCH:
- if (RANY(obj)->as.match.rmatch) {
- struct rmatch *rm = RANY(obj)->as.match.rmatch;
- onig_region_free(&rm->regs, 0);
- if (rm->char_offset)
- xfree(rm->char_offset);
- xfree(rm);
+ if (RANY(obj)->as.match.regs) {
+ re_free_registers(RANY(obj)->as.match.regs);
+ RUBY_CRITICAL(free(RANY(obj)->as.match.regs));
}
break;
case T_FILE:
if (RANY(obj)->as.file.fptr) {
- make_io_deferred(RANY(obj));
+ struct rb_io_t *fptr = RANY(obj)->as.file.fptr;
+ make_deferred(RANY(obj));
+ RDATA(obj)->dfree = (void (*)(void*))rb_io_fptr_finalize;
+ RDATA(obj)->data = fptr;
return 1;
}
break;
- case T_RATIONAL:
- case T_COMPLEX:
- break;
case T_ICLASS:
/* iClass shares table with the module */
break;
case T_FLOAT:
+ case T_VARMAP:
+ case T_BLKTAG:
break;
case T_BIGNUM:
- if (!(RBASIC(obj)->flags & RBIGNUM_EMBED_FLAG) && RBIGNUM_DIGITS(obj)) {
- xfree(RBIGNUM_DIGITS(obj));
+ if (RANY(obj)->as.bignum.digits) {
+ RUBY_CRITICAL(free(RANY(obj)->as.bignum.digits));
}
break;
case T_NODE:
switch (nd_type(obj)) {
case NODE_SCOPE:
if (RANY(obj)->as.node.u1.tbl) {
- xfree(RANY(obj)->as.node.u1.tbl);
+ RUBY_CRITICAL(free(RANY(obj)->as.node.u1.tbl));
}
break;
case NODE_ALLOCA:
- xfree(RANY(obj)->as.node.u1.node);
+ RUBY_CRITICAL(free(RANY(obj)->as.node.u1.node));
break;
}
break; /* no need to free iv_tbl */
+ case T_SCOPE:
+ if (RANY(obj)->as.scope.local_vars &&
+ RANY(obj)->as.scope.flags != SCOPE_ALLOCA) {
+ VALUE *vars = RANY(obj)->as.scope.local_vars-1;
+ if (!(RANY(obj)->as.scope.flags & SCOPE_CLONE) && vars[0] == 0)
+ RUBY_CRITICAL(free(RANY(obj)->as.scope.local_tbl));
+ if (RANY(obj)->as.scope.flags & SCOPE_MALLOC)
+ RUBY_CRITICAL(free(vars));
+ }
+ break;
+
case T_STRUCT:
- if ((RBASIC(obj)->flags & RSTRUCT_EMBED_LEN_MASK) == 0 &&
- RANY(obj)->as.rstruct.as.heap.ptr) {
- xfree(RANY(obj)->as.rstruct.as.heap.ptr);
+ if (RANY(obj)->as.rstruct.ptr) {
+ RUBY_CRITICAL(free(RANY(obj)->as.rstruct.ptr));
}
break;
default:
- rb_bug("gc_sweep(): unknown data type 0x%x(%p)",
- BUILTIN_TYPE(obj), (void*)obj);
+ rb_bug("gc_sweep(): unknown data type 0x%lx(0x%lx)",
+ RANY(obj)->as.basic.flags & T_MASK, obj);
}
return 0;
}
-#define GC_NOTIFY 0
-
-void rb_vm_mark(void *ptr);
-
-static void
-mark_current_machine_context(rb_objspace_t *objspace, rb_thread_t *th)
+void
+rb_gc_mark_frame(frame)
+ struct FRAME *frame;
{
- rb_jmp_buf save_regs_gc_mark;
- VALUE *stack_start, *stack_end;
+ gc_mark((VALUE)frame->node, 0);
+}
- SET_STACK_END;
-#if STACK_GROW_DIRECTION < 0
- stack_start = th->machine_stack_end;
- stack_end = th->machine_stack_start;
-#elif STACK_GROW_DIRECTION > 0
- stack_start = th->machine_stack_start;
- stack_end = th->machine_stack_end + 1;
+#ifdef __GNUC__
+#if defined(__human68k__) || defined(DJGPP)
+#undef rb_setjmp
+#undef rb_jmp_buf
+#if defined(__human68k__)
+typedef unsigned long rb_jmp_buf[8];
+__asm__ (".even\n\
+_rb_setjmp:\n\
+ move.l 4(sp),a0\n\
+ movem.l d3-d7/a3-a5,(a0)\n\
+ moveq.l #0,d0\n\
+ rts");
#else
- if (th->machine_stack_end < th->machine_stack_start) {
- stack_start = th->machine_stack_end;
- stack_end = th->machine_stack_start;
- }
- else {
- stack_start = th->machine_stack_start;
- stack_end = th->machine_stack_end + 1;
- }
-#endif
-
- FLUSH_REGISTER_WINDOWS;
- /* This assumes that all registers are saved into the jmp_buf (and stack) */
- rb_setjmp(save_regs_gc_mark);
- mark_locations_array(objspace,
- (VALUE*)save_regs_gc_mark,
- sizeof(save_regs_gc_mark) / sizeof(VALUE));
-
- rb_gc_mark_locations(stack_start, stack_end);
-#ifdef __ia64
- rb_gc_mark_locations(th->machine_register_stack_start, th->machine_register_stack_end);
+#if defined(DJGPP)
+typedef unsigned long rb_jmp_buf[6];
+__asm__ (".align 4\n\
+_rb_setjmp:\n\
+ pushl %ebp\n\
+ movl %esp,%ebp\n\
+ movl 8(%ebp),%ebp\n\
+ movl %eax,(%ebp)\n\
+ movl %ebx,4(%ebp)\n\
+ movl %ecx,8(%ebp)\n\
+ movl %edx,12(%ebp)\n\
+ movl %esi,16(%ebp)\n\
+ movl %edi,20(%ebp)\n\
+ popl %ebp\n\
+ xorl %eax,%eax\n\
+ ret");
#endif
-#if defined(__mc68000__)
- mark_locations_array((VALUE*)((char*)STACK_END + 2),
- (STACK_START - STACK_END));
#endif
-}
-
-void rb_gc_mark_encodings(void);
-
-static void
-rb_gc_mark_remembered_set(rb_objspace_t *objspace)
-{
- remembered_set_t *rem;
-
- rem = objspace->remembered_set.ptr;
- while (rem) {
- rb_gc_mark((VALUE)rem->obj);
- rem = rem->next;
- }
-}
+int rb_setjmp (rb_jmp_buf);
+#endif /* __human68k__ or DJGPP */
+#endif /* __GNUC__ */
static void
-clear_mark_longlife_heaps(rb_objspace_t *objspace)
-{
- size_t i;
-
- for (i = 0; i < heaps_used; i++) {
- RVALUE *p, *pend;
-
- if (heaps[i].lifetime == lifetime_longlife) {
- p = heaps[i].slot; pend = p + heaps[i].limit;
- for (;p < pend; p++) {
- if (p->as.basic.flags & FL_MARK) {
- RBASIC(p)->flags &= ~FL_MARK;
- }
- }
- }
- }
-}
-
-static int
-garbage_collect(rb_objspace_t *objspace)
+garbage_collect()
{
struct gc_list *list;
- rb_thread_t *th = GET_THREAD();
- INIT_GC_PROF_PARAMS;
-
- if (GC_NOTIFY) printf("start garbage_collect()\n");
+ struct FRAME * volatile frame; /* gcc 2.7.2.3 -O2 bug?? */
+ jmp_buf save_regs_gc_mark;
+ SET_STACK_END;
- if (!heaps) {
- return Qfalse;
+#ifdef HAVE_NATIVETHREAD
+ if (!is_ruby_native_thread()) {
+ rb_bug("cross-thread violation on rb_gc()");
}
-
+#endif
if (dont_gc || during_gc) {
if (!freelist) {
- if (!heaps_increment(objspace)) {
- set_heaps_increment(objspace);
- heaps_increment(objspace);
- }
+ add_heap();
}
- return Qtrue;
+ return;
}
+ if (during_gc) return;
during_gc++;
- objspace->count++;
- GC_PROF_TIMER_START;
- GC_PROF_MARK_TIMER_START;
- SET_STACK_END;
+ init_mark_stack();
- init_mark_stack(objspace);
+ gc_mark((VALUE)ruby_current_node, 0);
- if (objspace->flags.longlife_collection) {
- clear_mark_longlife_heaps(objspace);
- }
- else {
- rb_gc_mark_remembered_set(objspace);
+ /* mark frame stack */
+ for (frame = ruby_frame; frame; frame = frame->prev) {
+ rb_gc_mark_frame(frame);
+ if (frame->tmp) {
+ struct FRAME *tmp = frame->tmp;
+ while (tmp) {
+ rb_gc_mark_frame(tmp);
+ tmp = tmp->prev;
+ }
+ }
}
-
- th->vm->self ? rb_gc_mark(th->vm->self) : rb_vm_mark(th->vm);
-
+ gc_mark((VALUE)ruby_scope, 0);
+ gc_mark((VALUE)ruby_dyna_vars, 0);
if (finalizer_table) {
- mark_tbl(objspace, finalizer_table, 0);
+ mark_tbl(finalizer_table, 0);
}
- mark_current_machine_context(objspace, th);
-
+ FLUSH_REGISTER_WINDOWS;
+ /* This assumes that all registers are saved into the jmp_buf (and stack) */
+ rb_setjmp(save_regs_gc_mark);
+ mark_locations_array((VALUE*)save_regs_gc_mark, sizeof(save_regs_gc_mark) / sizeof(VALUE *));
+#if STACK_GROW_DIRECTION < 0
+ rb_gc_mark_locations((VALUE*)STACK_END, rb_gc_stack_start);
+#elif STACK_GROW_DIRECTION > 0
+ rb_gc_mark_locations(rb_gc_stack_start, (VALUE*)STACK_END + 1);
+#else
+ if ((VALUE*)STACK_END < rb_gc_stack_start)
+ rb_gc_mark_locations((VALUE*)STACK_END, rb_gc_stack_start);
+ else
+ rb_gc_mark_locations(rb_gc_stack_start, (VALUE*)STACK_END + 1);
+#endif
+#ifdef __ia64
+ /* mark backing store (flushed register window on the stack) */
+ /* the basic idea from guile GC code */
+ rb_gc_mark_locations(rb_gc_register_stack_start, (VALUE*)rb_ia64_bsp());
+#endif
+#if defined(__human68k__) || defined(__mc68000__)
+ rb_gc_mark_locations((VALUE*)((char*)STACK_END + 2),
+ (VALUE*)((char*)rb_gc_stack_start + 2));
+#endif
rb_gc_mark_threads();
- rb_gc_mark_symbols();
- rb_gc_mark_encodings();
/* mark protected global variables */
for (list = global_List; list; list = list->next) {
@@ -2352,7 +1492,8 @@ garbage_collect(rb_objspace_t *objspace)
rb_mark_end_proc();
rb_gc_mark_global_tbl();
- mark_tbl(objspace, rb_class_tbl, 0);
+ rb_mark_tbl(rb_class_tbl);
+ rb_gc_mark_trap_list();
/* mark generic instance variables for special constants */
rb_mark_generic_ivar_tbl();
@@ -2360,56 +1501,28 @@ garbage_collect(rb_objspace_t *objspace)
rb_gc_mark_parser();
/* gc_mark objects whose marking are not completed*/
- while (!MARK_STACK_EMPTY) {
- if (mark_stack_overflow) {
- gc_mark_all(objspace);
- }
- else {
- gc_mark_rest(objspace);
+ do {
+ while (!MARK_STACK_EMPTY) {
+ if (mark_stack_overflow){
+ gc_mark_all();
+ }
+ else {
+ gc_mark_rest();
+ }
}
- }
- GC_PROF_MARK_TIMER_STOP;
-
- GC_PROF_SWEEP_TIMER_START;
- if (objspace->flags.longlife_collection) {
- gc_sweep_for_longlife(objspace);
- }
- gc_sweep(objspace);
- GC_PROF_SWEEP_TIMER_STOP;
+ rb_gc_abort_threads();
+ } while (!MARK_STACK_EMPTY);
- GC_PROF_TIMER_STOP;
- if (GC_NOTIFY) printf("end garbage_collect()\n");
- return Qtrue;
-}
-
-int
-rb_garbage_collect(void)
-{
- return garbage_collect(&rb_objspace);
+ gc_sweep();
}
void
-rb_gc_mark_machine_stack(rb_thread_t *th)
+rb_gc()
{
- rb_objspace_t *objspace = &rb_objspace;
-#if STACK_GROW_DIRECTION < 0
- rb_gc_mark_locations(th->machine_stack_end, th->machine_stack_start);
-#elif STACK_GROW_DIRECTION > 0
- rb_gc_mark_locations(th->machine_stack_start, th->machine_stack_end);
-#else
- if (th->machine_stack_start < th->machine_stack_end) {
- rb_gc_mark_locations(th->machine_stack_start, th->machine_stack_end);
- }
- else {
- rb_gc_mark_locations(th->machine_stack_end, th->machine_stack_start);
- }
-#endif
-#ifdef __ia64
- rb_gc_mark_locations(th->machine_register_stack_start, th->machine_register_stack_end);
-#endif
+ garbage_collect();
+ rb_gc_finalize_deferred();
}
-
/*
* call-seq:
* GC.start => nil
@@ -2421,22 +1534,128 @@ rb_gc_mark_machine_stack(rb_thread_t *th)
*/
VALUE
-rb_gc_start(void)
+rb_gc_start()
{
- rb_objspace_t *objspace = &rb_objspace;
- if (objspace->heap.longlife_used) {
- objspace->flags.longlife_collection = Qtrue;
- }
rb_gc();
return Qnil;
}
-#undef Init_stack
+void
+ruby_set_stack_size(size)
+ size_t size;
+{
+#ifndef STACK_LEVEL_MAX
+ STACK_LEVEL_MAX = size / sizeof(VALUE);
+#endif
+}
void
-Init_stack(volatile VALUE *addr)
+Init_stack(addr)
+ VALUE *addr;
+{
+#ifdef __ia64
+ if (rb_gc_register_stack_start == 0) {
+# if defined(__FreeBSD__)
+ /*
+ * FreeBSD/ia64 currently does not have a way for a process to get the
+ * base address for the RSE backing store, so hardcode it.
+ */
+ rb_gc_register_stack_start = (4ULL<<61);
+# elif defined(HAVE___LIBC_IA64_REGISTER_BACKING_STORE_BASE)
+# pragma weak __libc_ia64_register_backing_store_base
+ extern unsigned long __libc_ia64_register_backing_store_base;
+ rb_gc_register_stack_start = (VALUE*)__libc_ia64_register_backing_store_base;
+# endif
+ }
+ {
+ VALUE *bsp = (VALUE*)rb_ia64_bsp();
+ if (rb_gc_register_stack_start == 0 ||
+ bsp < rb_gc_register_stack_start) {
+ rb_gc_register_stack_start = bsp;
+ }
+ }
+#endif
+#if defined(_WIN32) || defined(__CYGWIN__)
+ MEMORY_BASIC_INFORMATION m;
+ memset(&m, 0, sizeof(m));
+ VirtualQuery(&m, &m, sizeof(m));
+ rb_gc_stack_start =
+ STACK_UPPER((VALUE *)&m, (VALUE *)m.BaseAddress,
+ (VALUE *)((char *)m.BaseAddress + m.RegionSize) - 1);
+#elif defined(STACK_END_ADDRESS)
+ {
+ extern void *STACK_END_ADDRESS;
+ rb_gc_stack_start = STACK_END_ADDRESS;
+ }
+#else
+ if (!addr) addr = (void *)&addr;
+ STACK_UPPER(&addr, addr, ++addr);
+ if (rb_gc_stack_start) {
+ if (STACK_UPPER(&addr,
+ rb_gc_stack_start > addr,
+ rb_gc_stack_start < addr))
+ rb_gc_stack_start = addr;
+ return;
+ }
+ rb_gc_stack_start = addr;
+#endif
+#ifdef HAVE_GETRLIMIT
+ {
+ struct rlimit rlim;
+
+ if (getrlimit(RLIMIT_STACK, &rlim) == 0) {
+ unsigned int space = rlim.rlim_cur/5;
+
+ if (space > 1024*1024) space = 1024*1024;
+ STACK_LEVEL_MAX = (rlim.rlim_cur - space) / sizeof(VALUE);
+ }
+ }
+#endif
+}
+
+void ruby_init_stack(VALUE *addr
+#ifdef __ia64
+ , void *bsp
+#endif
+ )
{
- ruby_init_stack(addr);
+ if (!rb_gc_stack_start ||
+ STACK_UPPER(&addr,
+ rb_gc_stack_start > addr,
+ rb_gc_stack_start < addr)) {
+ rb_gc_stack_start = addr;
+ }
+#ifdef __ia64
+ if (!rb_gc_register_stack_start ||
+ (VALUE*)bsp < rb_gc_register_stack_start) {
+ rb_gc_register_stack_start = (VALUE*)bsp;
+ }
+#endif
+#ifdef HAVE_GETRLIMIT
+ {
+ struct rlimit rlim;
+
+ if (getrlimit(RLIMIT_STACK, &rlim) == 0) {
+ unsigned int space = rlim.rlim_cur/5;
+
+ if (space > 1024*1024) space = 1024*1024;
+ STACK_LEVEL_MAX = (rlim.rlim_cur - space) / sizeof(VALUE);
+ }
+ }
+#elif defined _WIN32
+ {
+ MEMORY_BASIC_INFORMATION mi;
+ DWORD size;
+ DWORD space;
+
+ if (VirtualQuery(&mi, &mi, sizeof(mi))) {
+ size = (char *)mi.BaseAddress - (char *)mi.AllocationBase;
+ space = size / 5;
+ if (space > 1024*1024) space = 1024*1024;
+ STACK_LEVEL_MAX = (size - space) / sizeof(VALUE);
+ }
+ }
+#endif
}
/*
@@ -2471,133 +1690,51 @@ Init_stack(volatile VALUE *addr)
*/
void
-Init_heap(void)
+Init_heap()
{
- init_heap(&rb_objspace);
-}
-
-/*
- * rb_objspace_each_objects() is special C API to walk through
- * Ruby object space. This C API is too difficult to use it.
- * To be frank, you should not use it. Or you need to read the
- * source code of this function and understand what this function does.
- *
- * 'callback' will be called several times (the number of heap slot,
- * at current implementation) with:
- * vstart: a pointer to the first living object of the heap_slot.
- * vend: a pointer to next to the valid heap_slot area.
- * stride: a distance to next VALUE.
- *
- * If callback() returns non-zero, the iteration will be stopped.
- *
- * This is a sample callback code to iterate liveness objects:
- *
- * int
- * sample_callback(void *vstart, void *vend, int stride, void *data) {
- * VALUE v = (VALUE)vstart;
- * for (; v != (VALUE)vend; v += stride) {
- * if (RBASIC(v)->flasgs) { // liveness check
- * // do something with live object 'v'
- * }
- * return 0; // continue to iteration
- * }
- *
- * Note: 'vstart' is not a top of heap_slot. This point the first
- * living object to grasp at least one object to avoid GC issue.
- * This means that you can not walk through all Ruby object slot
- * including freed object slot.
- *
- * Note: On this implementation, 'stride' is same as sizeof(RVALUE).
- * However, there are possibilities to pass variable values with
- * 'stride' with some reasons. You must use stride instead of
- * use some constant value in the iteration.
- */
-void
-rb_objspace_each_objects(int (*callback)(void *vstart, void *vend,
- size_t stride, void *d),
- void *data)
-{
- size_t i;
- RVALUE *membase = 0;
- RVALUE *pstart, *pend;
- rb_objspace_t *objspace = &rb_objspace;
- volatile VALUE v;
-
- i = 0;
- while (i < heaps_used) {
- while (0 < i && (uintptr_t)membase < (uintptr_t)heaps[i-1].membase)
- i--;
- while (i < heaps_used && (uintptr_t)heaps[i].membase <= (uintptr_t)membase )
- i++;
- if (heaps_used <= i)
- break;
- membase = heaps[i].membase;
-
- pstart = heaps[i].slot;
- pend = pstart + heaps[i].limit;
-
- for (; pstart != pend; pstart++) {
- if (pstart->as.basic.flags) {
- v = (VALUE)pstart; /* acquire to save this object */
- break;
- }
- }
- if (pstart != pend) {
- if ((*callback)(pstart, pend, sizeof(RVALUE), data)) {
- return;
- }
- }
+ if (!rb_gc_stack_start) {
+ Init_stack(0);
}
-
- return;
+ add_heap();
}
-struct os_each_struct {
- size_t num;
+static VALUE
+os_obj_of(of)
VALUE of;
-};
-
-static int
-os_obj_of_i(void *vstart, void *vend, size_t stride, void *data)
{
- struct os_each_struct *oes = (struct os_each_struct *)data;
- RVALUE *p = (RVALUE *)vstart, *pend = (RVALUE *)vend;
+ int i;
+ int n = 0;
volatile VALUE v;
- for (; p != pend; p++) {
- if (p->as.basic.flags) {
- switch (BUILTIN_TYPE(p)) {
- case T_NONE:
- case T_ICLASS:
- case T_NODE:
- case T_ZOMBIE:
- continue;
- case T_CLASS:
- if (FL_TEST(p, FL_SINGLETON))
- continue;
- default:
- if (!p->as.basic.klass) continue;
- v = (VALUE)p;
- if (!oes->of || rb_obj_is_kind_of(v, oes->of)) {
- rb_yield(v);
- oes->num++;
+ for (i = 0; i < heaps_used; i++) {
+ RVALUE *p, *pend;
+
+ p = heaps[i].slot; pend = p + heaps[i].limit;
+ for (;p < pend; p++) {
+ if (p->as.basic.flags) {
+ switch (BUILTIN_TYPE(p)) {
+ case T_NONE:
+ case T_ICLASS:
+ case T_VARMAP:
+ case T_SCOPE:
+ case T_NODE:
+ case T_DEFERRED:
+ continue;
+ case T_CLASS:
+ if (FL_TEST(p, FL_SINGLETON)) continue;
+ default:
+ if (!p->as.basic.klass) continue;
+ v = (VALUE)p;
+ if (!of || rb_obj_is_kind_of(v, of)) {
+ rb_yield(v);
+ n++;
+ }
}
}
}
}
- return 0;
-}
-
-static VALUE
-os_obj_of(VALUE of)
-{
- struct os_each_struct oes;
-
- oes.num = 0;
- oes.of = of;
- rb_objspace_each_objects(os_obj_of_i, &oes);
- return SIZET2NUM(oes.num);
+ return INT2FIX(n);
}
/*
@@ -2634,7 +1771,10 @@ os_obj_of(VALUE of)
*/
static VALUE
-os_each_obj(int argc, VALUE *argv, VALUE os)
+os_each_obj(argc, argv, os)
+ int argc;
+ VALUE *argv;
+ VALUE os;
{
VALUE of;
@@ -2649,6 +1789,60 @@ os_each_obj(int argc, VALUE *argv, VALUE os)
return os_obj_of(of);
}
+static VALUE finalizers;
+
+/* deprecated
+ */
+
+static VALUE
+add_final(os, block)
+ VALUE os, block;
+{
+ rb_warn("ObjectSpace::add_finalizer is deprecated; use define_finalizer");
+ if (!rb_respond_to(block, rb_intern("call"))) {
+ rb_raise(rb_eArgError, "wrong type argument %s (should be callable)",
+ rb_obj_classname(block));
+ }
+ rb_ary_push(finalizers, block);
+ return block;
+}
+
+/*
+ * deprecated
+ */
+static VALUE
+rm_final(os, block)
+ VALUE os, block;
+{
+ rb_warn("ObjectSpace::remove_finalizer is deprecated; use undefine_finalizer");
+ rb_ary_delete(finalizers, block);
+ return block;
+}
+
+/*
+ * deprecated
+ */
+static VALUE
+finals()
+{
+ rb_warn("ObjectSpace::finalizers is deprecated");
+ return finalizers;
+}
+
+/*
+ * deprecated
+ */
+
+static VALUE
+call_final(os, obj)
+ VALUE os, obj;
+{
+ rb_warn("ObjectSpace::call_finalizer is deprecated; use define_finalizer");
+ need_call_final = 1;
+ FL_SET(obj, FL_FINALIZE);
+ return obj;
+}
+
/*
* call-seq:
* ObjectSpace.undefine_finalizer(obj)
@@ -2658,14 +1852,12 @@ os_each_obj(int argc, VALUE *argv, VALUE os)
*/
static VALUE
-undefine_final(VALUE os, VALUE obj)
+undefine_final(os, obj)
+ VALUE os, obj;
{
- rb_objspace_t *objspace = &rb_objspace;
- if (OBJ_FROZEN(obj)) rb_error_frozen("object");
if (finalizer_table) {
st_delete(finalizer_table, (st_data_t*)&obj, 0);
}
- FL_UNSET(obj, FL_FINALIZE);
return obj;
}
@@ -2679,13 +1871,14 @@ undefine_final(VALUE os, VALUE obj)
*/
static VALUE
-define_final(int argc, VALUE *argv, VALUE os)
+define_final(argc, argv, os)
+ int argc;
+ VALUE *argv;
+ VALUE os;
{
- rb_objspace_t *objspace = &rb_objspace;
VALUE obj, block, table;
rb_scan_args(argc, argv, "11", &obj, &block);
- if (OBJ_FROZEN(obj)) rb_error_frozen("object");
if (argc == 1) {
block = rb_block_proc();
}
@@ -2693,13 +1886,14 @@ define_final(int argc, VALUE *argv, VALUE os)
rb_raise(rb_eArgError, "wrong type argument %s (should be callable)",
rb_obj_classname(block));
}
+ need_call_final = 1;
if (!FL_ABLE(obj)) {
rb_raise(rb_eArgError, "cannot define finalizer for %s",
rb_obj_classname(obj));
}
RBASIC(obj)->flags |= FL_FINALIZE;
- block = rb_ary_new3(2, INT2FIX(rb_safe_level()), block);
+ block = rb_ary_new3(2, INT2FIX(ruby_safe_level), block);
OBJ_FREEZE(block);
if (!finalizer_table) {
@@ -2717,9 +1911,9 @@ define_final(int argc, VALUE *argv, VALUE os)
}
void
-rb_gc_copy_finalizer(VALUE dest, VALUE obj)
+rb_gc_copy_finalizer(dest, obj)
+ VALUE dest, obj;
{
- rb_objspace_t *objspace = &rb_objspace;
VALUE table;
if (!finalizer_table) return;
@@ -2727,163 +1921,111 @@ rb_gc_copy_finalizer(VALUE dest, VALUE obj)
if (st_lookup(finalizer_table, obj, &table)) {
st_insert(finalizer_table, dest, table);
}
- FL_SET(dest, FL_FINALIZE);
+ RBASIC(dest)->flags |= FL_FINALIZE;
}
static VALUE
-run_single_final(VALUE arg)
+run_single_final(args)
+ VALUE *args;
{
- VALUE *args = (VALUE *)arg;
rb_eval_cmd(args[0], args[1], (int)args[2]);
return Qnil;
}
static void
-run_final(rb_objspace_t *objspace, VALUE obj)
+run_final(obj)
+ VALUE obj;
{
long i;
- int status;
+ int status, critical_save = rb_thread_critical;
VALUE args[3], table, objid;
- RUBY_DATA_FUNC free_func = 0;
objid = rb_obj_id(obj); /* make obj into id */
- RBASIC(obj)->klass = 0;
-
- if (RTYPEDDATA_P(obj)) {
- free_func = RTYPEDDATA_TYPE(obj)->dfree;
- }
- else {
- free_func = RDATA(obj)->dfree;
- }
- if (free_func) {
- (*free_func)(DATA_PTR(obj));
- }
-
- if (finalizer_table &&
- st_delete(finalizer_table, (st_data_t*)&obj, &table)) {
- args[1] = 0;
- args[2] = (VALUE)rb_safe_level();
- if (!args[1] && RARRAY_LEN(table) > 0) {
- args[1] = rb_obj_freeze(rb_ary_new3(1, objid));
- }
- for (i=0; i<RARRAY_LEN(table); i++) {
- VALUE final = RARRAY_PTR(table)[i];
- args[0] = RARRAY_PTR(final)[1];
- args[2] = FIX2INT(RARRAY_PTR(final)[0]);
- rb_protect(run_single_final, (VALUE)args, &status);
+ rb_thread_critical = Qtrue;
+ args[1] = 0;
+ args[2] = (VALUE)ruby_safe_level;
+ for (i=0; i<RARRAY(finalizers)->len; i++) {
+ args[0] = RARRAY(finalizers)->ptr[i];
+ if (!args[1]) args[1] = rb_ary_new3(1, objid);
+ rb_protect((VALUE(*)_((VALUE)))run_single_final, (VALUE)args, &status);
+ }
+ if (finalizer_table && st_delete(finalizer_table, (st_data_t*)&obj, &table)) {
+ for (i=0; i<RARRAY(table)->len; i++) {
+ VALUE final = RARRAY(table)->ptr[i];
+ args[0] = RARRAY(final)->ptr[1];
+ if (!args[1]) args[1] = rb_ary_new3(1, objid);
+ args[2] = FIX2INT(RARRAY(final)->ptr[0]);
+ rb_protect((VALUE(*)_((VALUE)))run_single_final, (VALUE)args, &status);
}
}
+ rb_thread_critical = critical_save;
}
-static void
-finalize_deferred(rb_objspace_t *objspace)
+void
+rb_gc_finalize_deferred()
{
RVALUE *p = deferred_final_list;
- deferred_final_list = 0;
+ deferred_final_list = 0;
if (p) {
- finalize_list(objspace, p);
+ finalize_list(p);
+ free_unused_heaps();
}
}
-static void
-gc_finalize_deferred(rb_objspace_t *objspace)
-{
- finalize_deferred(objspace);
- free_unused_heaps(objspace);
-}
-
-void
-rb_gc_finalize_deferred(void)
-{
- gc_finalize_deferred(&rb_objspace);
-}
-
static int
chain_finalized_object(st_data_t key, st_data_t val, st_data_t arg)
{
RVALUE *p = (RVALUE *)key, **final_list = (RVALUE **)arg;
- if (p->as.basic.flags & FL_FINALIZE) {
- if (BUILTIN_TYPE(p) != T_ZOMBIE) {
- p->as.free.flags = FL_MARK | T_ZOMBIE; /* remain marked */
+ if ((p->as.basic.flags & (FL_FINALIZE|FL_MARK)) == FL_FINALIZE) {
+ if (BUILTIN_TYPE(p) != T_DEFERRED) {
+ p->as.free.flags = FL_MARK | T_DEFERRED; /* remain marked */
RDATA(p)->dfree = 0;
}
p->as.free.next = *final_list;
*final_list = p;
- return ST_CONTINUE;
- }
- else {
- return ST_DELETE;
}
+ return ST_CONTINUE;
}
void
-rb_gc_call_finalizer_at_exit(void)
+rb_gc_call_finalizer_at_exit()
{
- rb_objspace_t *objspace = &rb_objspace;
RVALUE *p, *pend;
- RVALUE *final_list = 0;
- size_t i;
+ int i;
/* run finalizers */
- if (finalizer_table) {
- finalize_deferred(objspace);
- while (finalizer_table->num_entries > 0) {
+ if (need_call_final) {
+ do {
+ p = deferred_final_list;
+ deferred_final_list = 0;
+ finalize_list(p);
+ mark_tbl(finalizer_table, 0);
st_foreach(finalizer_table, chain_finalized_object,
- (st_data_t)&final_list);
- if (!(p = final_list)) break;
- do {
- final_list = p->as.free.next;
- run_final(objspace, (VALUE)p);
- } while ((p = final_list) != 0);
- }
- st_free_table(finalizer_table);
- finalizer_table = 0;
+ (st_data_t)&deferred_final_list);
+ } while (deferred_final_list);
}
- /* finalizers are part of garbage collection */
- during_gc++;
/* run data object's finalizers */
for (i = 0; i < heaps_used; i++) {
p = heaps[i].slot; pend = p + heaps[i].limit;
while (p < pend) {
if (BUILTIN_TYPE(p) == T_DATA &&
- DATA_PTR(p) && RANY(p)->as.data.dfree &&
- RANY(p)->as.basic.klass != rb_cThread && RANY(p)->as.basic.klass != rb_cMutex) {
+ DATA_PTR(p) && RANY(p)->as.data.dfree) {
p->as.free.flags = 0;
- if (RTYPEDDATA_P(p)) {
- RDATA(p)->dfree = RANY(p)->as.typeddata.type->dfree;
- }
if ((long)RANY(p)->as.data.dfree == -1) {
- xfree(DATA_PTR(p));
+ RUBY_CRITICAL(free(DATA_PTR(p)));
}
else if (RANY(p)->as.data.dfree) {
- make_deferred(RANY(p));
- RANY(p)->as.free.next = final_list;
- final_list = p;
+ (*RANY(p)->as.data.dfree)(DATA_PTR(p));
}
}
else if (BUILTIN_TYPE(p) == T_FILE) {
- if (RANY(p)->as.file.fptr) {
- make_io_deferred(RANY(p));
- RANY(p)->as.free.next = final_list;
- final_list = p;
- }
+ p->as.free.flags = 0;
+ rb_io_fptr_finalize(RANY(p)->as.file.fptr);
}
p++;
}
}
- during_gc = 0;
- if (final_list) {
- finalize_list(objspace, final_list);
- }
-}
-
-void
-rb_gc(void)
-{
- rb_objspace_t *objspace = &rb_objspace;
- garbage_collect(objspace);
- gc_finalize_deferred(objspace);
}
/*
@@ -2900,21 +2042,14 @@ rb_gc(void)
*/
static VALUE
-id2ref(VALUE obj, VALUE objid)
+id2ref(obj, objid)
+ VALUE obj, objid;
{
-#if SIZEOF_LONG == SIZEOF_VOIDP
-#define NUM2PTR(x) NUM2ULONG(x)
-#elif SIZEOF_LONG_LONG == SIZEOF_VOIDP
-#define NUM2PTR(x) NUM2ULL(x)
-#endif
- rb_objspace_t *objspace = &rb_objspace;
- VALUE ptr;
- void *p0;
+ unsigned long ptr, p0;
+ int type;
rb_secure(4);
- ptr = NUM2PTR(objid);
- p0 = (void *)ptr;
-
+ p0 = ptr = NUM2ULONG(objid);
if (ptr == Qtrue) return Qtrue;
if (ptr == Qfalse) return Qfalse;
if (ptr == Qnil) return Qnil;
@@ -2924,16 +2059,16 @@ id2ref(VALUE obj, VALUE objid)
if ((ptr % sizeof(RVALUE)) == (4 << 2)) {
ID symid = ptr / sizeof(RVALUE);
if (rb_id2name(symid) == 0)
- rb_raise(rb_eRangeError, "%p is not symbol id value", p0);
- return ID2SYM(symid);
+ rb_raise(rb_eRangeError, "%p is not symbol id value", p0);
+ return ID2SYM(symid);
}
- if (!is_pointer_to_heap(objspace, (void *)ptr) ||
- BUILTIN_TYPE(ptr) > T_FIXNUM || BUILTIN_TYPE(ptr) == T_ICLASS) {
- rb_raise(rb_eRangeError, "%p is not id value", p0);
+ if (!is_pointer_to_heap((void *)ptr)||
+ (type = BUILTIN_TYPE(ptr)) > T_SYMBOL || type == T_ICLASS) {
+ rb_raise(rb_eRangeError, "0x%lx is not id value", p0);
}
if (BUILTIN_TYPE(ptr) == 0 || RBASIC(ptr)->klass == 0) {
- rb_raise(rb_eRangeError, "%p is recycled object", p0);
+ rb_raise(rb_eRangeError, "0x%lx is recycled object", p0);
}
return (VALUE)ptr;
}
@@ -3000,289 +2135,9 @@ rb_obj_id(VALUE obj)
return (SYM2ID(obj) * sizeof(RVALUE) + (4 << 2)) | FIXNUM_FLAG;
}
if (SPECIAL_CONST_P(obj)) {
- return LONG2NUM((SIGNED_VALUE)obj);
- }
- return (VALUE)((SIGNED_VALUE)obj|FIXNUM_FLAG);
-}
-
-static int
-set_zero(st_data_t key, st_data_t val, st_data_t arg)
-{
- VALUE k = (VALUE)key;
- VALUE hash = (VALUE)arg;
- rb_hash_aset(hash, k, INT2FIX(0));
- return ST_CONTINUE;
-}
-
-/*
- * call-seq:
- * ObjectSpace.count_objects([result_hash]) -> hash
- *
- * Counts objects for each type.
- *
- * It returns a hash as:
- * {:TOTAL=>10000, :FREE=>3011, :T_OBJECT=>6, :T_CLASS=>404, ...}
- *
- * If the optional argument, result_hash, is given,
- * it is overwritten and returned.
- * This is intended to avoid probe effect.
- *
- * The contents of the returned hash is implementation defined.
- * It may be changed in future.
- *
- * This method is not expected to work except C Ruby.
- *
- */
-
-static VALUE
-count_objects(int argc, VALUE *argv, VALUE os)
-{
- rb_objspace_t *objspace = &rb_objspace;
- size_t counts[T_MASK+1];
- size_t freed = 0;
- size_t total = 0;
- size_t i;
- VALUE hash;
-
- if (rb_scan_args(argc, argv, "01", &hash) == 1) {
- if (TYPE(hash) != T_HASH)
- rb_raise(rb_eTypeError, "non-hash given");
- }
-
- for (i = 0; i <= T_MASK; i++) {
- counts[i] = 0;
- }
-
- for (i = 0; i < heaps_used; i++) {
- RVALUE *p, *pend;
-
- p = heaps[i].slot; pend = p + heaps[i].limit;
- for (;p < pend; p++) {
- if (p->as.basic.flags) {
- counts[BUILTIN_TYPE(p)]++;
- }
- else {
- freed++;
- }
- }
- total += heaps[i].limit;
- }
-
- if (hash == Qnil) {
- hash = rb_hash_new();
- }
- else if (!RHASH_EMPTY_P(hash)) {
- st_foreach(RHASH_TBL(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;
- 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]));
+ return LONG2NUM((long)obj);
}
-
- return hash;
-}
-
-/*
- * call-seq:
- * GC.count -> Integer
- *
- * The number of times GC occured.
- *
- * It returns the number of times GC occured since the process started.
- *
- */
-
-static VALUE
-gc_count(VALUE self)
-{
- return UINT2NUM((&rb_objspace)->count);
-}
-
-#if CALC_EXACT_MALLOC_SIZE
-/*
- * call-seq:
- * GC.malloc_allocated_size -> Integer
- *
- * The allocated size by malloc().
- *
- * It returns the allocated size by malloc().
- */
-
-static VALUE
-gc_malloc_allocated_size(VALUE self)
-{
- return UINT2NUM((&rb_objspace)->malloc_params.allocated_size);
-}
-
-/*
- * call-seq:
- * GC.malloc_allocations -> Integer
- *
- * The number of allocated memory object by malloc().
- *
- * It returns the number of allocated memory object by malloc().
- */
-
-static VALUE
-gc_malloc_allocations(VALUE self)
-{
- return UINT2NUM((&rb_objspace)->malloc_params.allocations);
-}
-#endif
-
-static VALUE
-gc_profile_record_get(void)
-{
- VALUE prof;
- VALUE gc_profile = rb_ary_new();
- size_t i;
- rb_objspace_t *objspace = (&rb_objspace);
-
- if (!objspace->profile.run) {
- return Qnil;
- }
-
- for (i =0; i < objspace->profile.count; i++) {
- prof = rb_hash_new();
- rb_hash_aset(prof, ID2SYM(rb_intern("GC_TIME")), DBL2NUM(objspace->profile.record[i].gc_time));
- rb_hash_aset(prof, ID2SYM(rb_intern("GC_INVOKE_TIME")), DBL2NUM(objspace->profile.record[i].gc_invoke_time));
- rb_hash_aset(prof, ID2SYM(rb_intern("HEAP_USE_SIZE")), rb_uint2inum(objspace->profile.record[i].heap_use_size));
- rb_hash_aset(prof, ID2SYM(rb_intern("HEAP_TOTAL_SIZE")), rb_uint2inum(objspace->profile.record[i].heap_total_size));
- rb_hash_aset(prof, ID2SYM(rb_intern("HEAP_TOTAL_OBJECTS")), rb_uint2inum(objspace->profile.record[i].heap_total_objects));
-#if GC_PROFILE_MORE_DETAIL
- rb_hash_aset(prof, ID2SYM(rb_intern("LONGLIFE_COLLECTION")), objspace->profile.record[i].longlife_collection);
- rb_hash_aset(prof, ID2SYM(rb_intern("GC_MARK_TIME")), DBL2NUM(objspace->profile.record[i].gc_mark_time));
- rb_hash_aset(prof, ID2SYM(rb_intern("GC_SWEEP_TIME")), DBL2NUM(objspace->profile.record[i].gc_sweep_time));
- rb_hash_aset(prof, ID2SYM(rb_intern("ALLOCATE_INCREASE")), rb_uint2inum(objspace->profile.record[i].allocate_increase));
- rb_hash_aset(prof, ID2SYM(rb_intern("ALLOCATE_LIMIT")), rb_uint2inum(objspace->profile.record[i].allocate_limit));
- rb_hash_aset(prof, ID2SYM(rb_intern("HEAP_USE_SLOTS")), rb_uint2inum(objspace->profile.record[i].heap_use_slots));
- rb_hash_aset(prof, ID2SYM(rb_intern("HEAP_LONGLIFE_USE_SLOTS")), rb_uint2inum(objspace->profile.record[i].heap_longlife_use_slots));
- rb_hash_aset(prof, ID2SYM(rb_intern("HEAP_LIVE_OBJECTS")), rb_uint2inum(objspace->profile.record[i].heap_live_objects));
- rb_hash_aset(prof, ID2SYM(rb_intern("HEAP_FREE_OBJECTS")), rb_uint2inum(objspace->profile.record[i].heap_free_objects));
- rb_hash_aset(prof, ID2SYM(rb_intern("HAVE_FINALIZE")), objspace->profile.record[i].have_finalize);
-#endif
- rb_ary_push(gc_profile, prof);
- }
-
- return gc_profile;
-}
-
-/*
- * call-seq:
- * GC::Profiler.result -> string
- *
- * Report profile data to string.
- *
- * It returns a string as:
- * GC 1 invokes.
- * Index Invoke Time(sec) Use Size(byte) Total Size(byte) Total Object GC time(ms)
- * 1 0.012 159240 212940 10647 0.00000000000001530000
- */
-
-static VALUE
-gc_profile_result(void)
-{
- rb_objspace_t *objspace = &rb_objspace;
- VALUE record;
- VALUE result;
- int i;
-
- record = gc_profile_record_get();
- if (objspace->profile.run && objspace->profile.count) {
- result = rb_sprintf("GC %d invokes.\n", NUM2INT(gc_count(0)));
- rb_str_cat2(result, "Index Invoke Time(sec) Use Size(byte) Total Size(byte) Total Object GC Time(ms)\n");
- for (i = 0; i < (int)RARRAY_LEN(record); i++) {
- VALUE r = RARRAY_PTR(record)[i];
- rb_str_catf(result, "%5d %19.3f %20d %20d %20d %30.20f\n",
- i+1, NUM2DBL(rb_hash_aref(r, ID2SYM(rb_intern("GC_INVOKE_TIME")))),
- NUM2INT(rb_hash_aref(r, ID2SYM(rb_intern("HEAP_USE_SIZE")))),
- NUM2INT(rb_hash_aref(r, ID2SYM(rb_intern("HEAP_TOTAL_SIZE")))),
- NUM2INT(rb_hash_aref(r, ID2SYM(rb_intern("HEAP_TOTAL_OBJECTS")))),
- NUM2DBL(rb_hash_aref(r, ID2SYM(rb_intern("GC_TIME"))))*1000
- );
- }
-#if GC_PROFILE_MORE_DETAIL
- rb_str_cat2(result, "\n\n");
- rb_str_cat2(result, "More detail.\n");
- rb_str_cat2(result, "Index Allocate Increase Allocate Limit Use Slot Longlife Slot Have Finalize Collection Mark Time(ms) Sweep Time(ms)\n");
- for (i = 0; i < (int)RARRAY_LEN(record); i++) {
- VALUE r = RARRAY_PTR(record)[i];
- rb_str_catf(result, "%5d %17d %17d %9d %14d %14s %11s %25.20f %25.20f\n",
- i+1, NUM2INT(rb_hash_aref(r, ID2SYM(rb_intern("ALLOCATE_INCREASE")))),
- NUM2INT(rb_hash_aref(r, ID2SYM(rb_intern("ALLOCATE_LIMIT")))),
- NUM2INT(rb_hash_aref(r, ID2SYM(rb_intern("HEAP_USE_SLOTS")))),
- NUM2INT(rb_hash_aref(r, ID2SYM(rb_intern("HEAP_LONGLIFE_USE_SLOTS")))),
- rb_hash_aref(r, ID2SYM(rb_intern("HAVE_FINALIZE")))? "true" : "false",
- rb_hash_aref(r, ID2SYM(rb_intern("LONGLIFE_COLLECTION")))? "longlife" : "normal",
- NUM2DBL(rb_hash_aref(r, ID2SYM(rb_intern("GC_MARK_TIME"))))*1000,
- NUM2DBL(rb_hash_aref(r, ID2SYM(rb_intern("GC_SWEEP_TIME"))))*1000
- );
- }
-#endif
- }
- else {
- result = rb_str_new2("");
- }
- return result;
-}
-
-
-/*
- * call-seq:
- * GC::Profiler.report
- *
- * GC::Profiler.result display
- *
- */
-
-static VALUE
-gc_profile_report(int argc, VALUE *argv, VALUE self)
-{
- VALUE out;
-
- if (argc == 0) {
- out = rb_stdout;
- }
- else {
- rb_scan_args(argc, argv, "01", &out);
- }
- rb_io_write(out, gc_profile_result());
-
- return Qnil;
+ return (VALUE)((long)obj|FIXNUM_FLAG);
}
/*
@@ -3292,10 +2147,9 @@ gc_profile_report(int argc, VALUE *argv, VALUE self)
*/
void
-Init_GC(void)
+Init_GC()
{
VALUE rb_mObSpace;
- VALUE rb_mProfiler;
rb_mGC = rb_define_module("GC");
rb_define_singleton_method(rb_mGC, "start", rb_gc_start, 0);
@@ -3303,38 +2157,35 @@ Init_GC(void)
rb_define_singleton_method(rb_mGC, "disable", rb_gc_disable, 0);
rb_define_singleton_method(rb_mGC, "stress", gc_stress_get, 0);
rb_define_singleton_method(rb_mGC, "stress=", gc_stress_set, 1);
- rb_define_singleton_method(rb_mGC, "count", gc_count, 0);
rb_define_method(rb_mGC, "garbage_collect", rb_gc_start, 0);
- rb_mProfiler = rb_define_module_under(rb_mGC, "Profiler");
- rb_define_singleton_method(rb_mProfiler, "enabled?", gc_profile_enable_get, 0);
- rb_define_singleton_method(rb_mProfiler, "enable", gc_profile_enable, 0);
- rb_define_singleton_method(rb_mProfiler, "disable", gc_profile_disable, 0);
- rb_define_singleton_method(rb_mProfiler, "clear", gc_profile_clear, 0);
- rb_define_singleton_method(rb_mProfiler, "result", gc_profile_result, 0);
- rb_define_singleton_method(rb_mProfiler, "report", gc_profile_report, -1);
-
rb_mObSpace = rb_define_module("ObjectSpace");
rb_define_module_function(rb_mObSpace, "each_object", os_each_obj, -1);
rb_define_module_function(rb_mObSpace, "garbage_collect", rb_gc_start, 0);
+ rb_define_module_function(rb_mObSpace, "add_finalizer", add_final, 1);
+ rb_define_module_function(rb_mObSpace, "remove_finalizer", rm_final, 1);
+ rb_define_module_function(rb_mObSpace, "finalizers", finals, 0);
+ rb_define_module_function(rb_mObSpace, "call_finalizer", call_final, 1);
rb_define_module_function(rb_mObSpace, "define_finalizer", define_final, -1);
rb_define_module_function(rb_mObSpace, "undefine_finalizer", undefine_final, 1);
rb_define_module_function(rb_mObSpace, "_id2ref", id2ref, 1);
+ rb_gc_register_address(&rb_mObSpace);
+ rb_global_variable(&finalizers);
+ rb_gc_unregister_address(&rb_mObSpace);
+ finalizers = rb_ary_new();
+
+ source_filenames = st_init_strtable();
+
+ rb_global_variable(&nomem_error);
nomem_error = rb_exc_new3(rb_eNoMemError,
rb_obj_freeze(rb_str_new2("failed to allocate memory")));
OBJ_TAINT(nomem_error);
OBJ_FREEZE(nomem_error);
+ rb_define_method(rb_mKernel, "hash", rb_obj_id, 0);
rb_define_method(rb_mKernel, "__id__", rb_obj_id, 0);
rb_define_method(rb_mKernel, "object_id", rb_obj_id, 0);
-
- rb_define_module_function(rb_mObSpace, "count_objects", count_objects, -1);
-
-#if CALC_EXACT_MALLOC_SIZE
- rb_define_singleton_method(rb_mGC, "malloc_allocated_size", gc_malloc_allocated_size, 0);
- rb_define_singleton_method(rb_mGC, "malloc_allocations", gc_malloc_allocations, 0);
-#endif
}
diff --git a/gc.h b/gc.h
deleted file mode 100644
index 29fd6b407c..0000000000
--- a/gc.h
+++ /dev/null
@@ -1,75 +0,0 @@
-
-#ifndef RUBY_GC_H
-#define RUBY_GC_H 1
-
-#if defined(__i386) && defined(__GNUC__)
-#define SET_MACHINE_STACK_END(p) __asm__("mov %%esp, %0" : "=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)
-#define USE_CONSERVATIVE_STACK_END
-#endif
-
-/* for GC debug */
-
-#ifndef RUBY_MARK_FREE_DEBUG
-#define RUBY_MARK_FREE_DEBUG 0
-#endif
-
-#if RUBY_MARK_FREE_DEBUG
-extern int ruby_gc_debug_indent;
-
-static void
-rb_gc_debug_indent(void)
-{
- printf("%*s", ruby_gc_debug_indent, "");
-}
-
-static void
-rb_gc_debug_body(char *mode, char *msg, int st, void *ptr)
-{
- if (st == 0) {
- ruby_gc_debug_indent--;
- }
- rb_gc_debug_indent();
- printf("%s: %s %s (%p)\n", mode, st ? "->" : "<-", msg, ptr);
-
- if (st) {
- ruby_gc_debug_indent++;
- }
-
- fflush(stdout);
-}
-
-#define RUBY_MARK_ENTER(msg) rb_gc_debug_body("mark", msg, 1, ptr)
-#define RUBY_MARK_LEAVE(msg) rb_gc_debug_body("mark", msg, 0, ptr)
-#define RUBY_FREE_ENTER(msg) rb_gc_debug_body("free", msg, 1, ptr)
-#define RUBY_FREE_LEAVE(msg) rb_gc_debug_body("free", msg, 0, ptr)
-#define RUBY_GC_INFO rb_gc_debug_indent(); printf
-
-#else
-#define RUBY_MARK_ENTER(msg)
-#define RUBY_MARK_LEAVE(msg)
-#define RUBY_FREE_ENTER(msg)
-#define RUBY_FREE_LEAVE(msg)
-#define RUBY_GC_INFO if(0)printf
-#endif
-
-#define RUBY_MARK_UNLESS_NULL(ptr) if(RTEST(ptr)){rb_gc_mark(ptr);}
-#define RUBY_FREE_UNLESS_NULL(ptr) if(ptr){ruby_xfree(ptr);}
-
-#if STACK_GROW_DIRECTION > 0
-# define STACK_UPPER(x, a, b) a
-#elif STACK_GROW_DIRECTION < 0
-# define STACK_UPPER(x, a, b) b
-#else
-RUBY_EXTERN int ruby_stack_grow_direction;
-int ruby_get_stack_grow_direction(VALUE *addr);
-# define stack_growup_p(x) ( \
- (ruby_stack_grow_direction ? \
- ruby_stack_grow_direction : \
- ruby_get_stack_grow_direction(x)) > 0)
-# define STACK_UPPER(x, a, b) (stack_growup_p(x) ? a : b)
-#endif
-
-#endif /* RUBY_GC_H */
diff --git a/gem_prelude.rb b/gem_prelude.rb
deleted file mode 100644
index e93f6045f9..0000000000
--- a/gem_prelude.rb
+++ /dev/null
@@ -1,402 +0,0 @@
-# depends on: array.rb dir.rb env.rb file.rb hash.rb module.rb regexp.rb
-# vim: filetype=ruby
-# THIS FILE WAS AUTOGENERATED, DO NOT EDIT
-
-# NOTICE: Ruby is during initialization here.
-# * Encoding.default_external does not reflects -E.
-# * Should not expect Encoding.default_internal.
-# * Locale encoding is available.
-
-if defined?(Gem) then
-
- # :stopdoc:
-
- module Kernel
-
- def gem(gem_name, *version_requirements)
- Gem.push_gem_version_on_load_path(gem_name, *version_requirements)
- end
-
- end
-
- module Gem
-
- ConfigMap = {
- :EXEEXT => RbConfig::CONFIG["EXEEXT"],
- :RUBY_SO_NAME => RbConfig::CONFIG["RUBY_SO_NAME"],
- :arch => RbConfig::CONFIG["arch"],
- :bindir => RbConfig::CONFIG["bindir"],
- :libdir => RbConfig::CONFIG["libdir"],
- :ruby_install_name => RbConfig::CONFIG["ruby_install_name"],
- :ruby_version => RbConfig::CONFIG["ruby_version"],
- :rubylibprefix => RbConfig::CONFIG["rubylibprefix"],
- :sitedir => RbConfig::CONFIG["sitedir"],
- :sitelibdir => RbConfig::CONFIG["sitelibdir"],
- }
-
- def self.dir
- @gem_home ||= nil
- set_home(ENV['GEM_HOME'] || default_dir) unless @gem_home
- @gem_home
- end
-
- def self.path
- @gem_path ||= nil
- unless @gem_path
- paths = [ENV['GEM_PATH']]
- paths << APPLE_GEM_HOME if defined? APPLE_GEM_HOME
- set_paths(paths.compact.join(File::PATH_SEPARATOR))
- end
- @gem_path
- end
-
- def self.post_install(&hook)
- @post_install_hooks << hook
- end
-
- def self.post_uninstall(&hook)
- @post_uninstall_hooks << hook
- end
-
- def self.pre_install(&hook)
- @pre_install_hooks << hook
- end
-
- def self.pre_uninstall(&hook)
- @pre_uninstall_hooks << hook
- end
-
- def self.set_home(home)
- home = home.gsub File::ALT_SEPARATOR, File::SEPARATOR if File::ALT_SEPARATOR
- @gem_home = home
- end
-
- def self.set_paths(gpaths)
- if gpaths
- @gem_path = gpaths.split(File::PATH_SEPARATOR)
-
- if File::ALT_SEPARATOR then
- @gem_path.map! do |path|
- path.gsub File::ALT_SEPARATOR, File::SEPARATOR
- end
- end
-
- @gem_path << Gem.dir
- else
- # TODO: should this be Gem.default_path instead?
- @gem_path = [Gem.dir]
- end
-
- @gem_path.uniq!
- end
-
- # begin rubygems/defaults
-
- @post_install_hooks ||= []
- @post_uninstall_hooks ||= []
- @pre_uninstall_hooks ||= []
- @pre_install_hooks ||= []
-
- ##
- # An Array of the default sources that come with RubyGems
-
- def self.default_sources
- %w[http://gems.rubyforge.org/]
- end
-
- ##
- # Default home directory path to be used if an alternate value is not
- # specified in the environment
-
- def self.default_dir
- if defined? RUBY_FRAMEWORK_VERSION then
- File.join File.dirname(ConfigMap[:sitedir]), 'Gems',
- ConfigMap[:ruby_version]
- elsif RUBY_VERSION >= '1.9.2' then
- File.join(ConfigMap[:rubylibprefix], 'gems',
- ConfigMap[:ruby_version])
- # only Ruby 1.9.1 has a peculiar feature
- elsif RUBY_VERSION > '1.9' and
- File.join(ConfigMap[:libdir], ConfigMap[:ruby_install_name], 'gems',
- ConfigMap[:ruby_version])
- else
- File.join(ConfigMap[:libdir], ruby_engine, 'gems',
- ConfigMap[:ruby_version])
- end
- end
-
- ##
- # Path for gems in the user's home directory
-
- def self.user_dir
- File.join(Gem.user_home, '.gem', ruby_engine,
- ConfigMap[:ruby_version])
- end
-
- ##
- # Default gem load path
-
- def self.default_path
- if File.exist?(Gem.user_home)
- [user_dir, default_dir]
- else
- [default_dir]
- end
- end
-
- ##
- # Deduce Ruby's --program-prefix and --program-suffix from its install name
-
- def self.default_exec_format
- exec_format = ConfigMap[:ruby_install_name].sub('ruby', '%s') rescue '%s'
-
- unless exec_format =~ /%s/ then
- raise Gem::Exception,
- "[BUG] invalid exec_format #{exec_format.inspect}, no %s"
- end
-
- exec_format
- end
-
- ##
- # The default directory for binaries
-
- def self.default_bindir
- if defined? RUBY_FRAMEWORK_VERSION then # mac framework support
- '/usr/bin'
- else # generic install
- ConfigMap[:bindir]
- end
- end
-
- ##
- # The default system-wide source info cache directory
-
- def self.default_system_source_cache_dir
- File.join Gem.dir, 'source_cache'
- end
-
- ##
- # The default user-specific source info cache directory
-
- def self.default_user_source_cache_dir
- File.join Gem.user_home, '.gem', 'source_cache'
- end
-
- ##
- # A wrapper around RUBY_ENGINE const that may not be defined
-
- def self.ruby_engine
- if defined? RUBY_ENGINE then
- RUBY_ENGINE
- else
- 'ruby'
- end
- end
-
-
- # end rubygems/defaults
-
- ##
- # Methods before this line will be removed when QuickLoader is replaced
- # with the real RubyGems
-
- GEM_PRELUDE_METHODS = Gem.methods(false)
-
- begin
- verbose, debug = $VERBOSE, $DEBUG
- $VERBOSE = $DEBUG = nil
-
- begin
- require 'rubygems/defaults/operating_system'
- rescue ::LoadError
- end
-
- if defined?(RUBY_ENGINE) then
- begin
- require "rubygems/defaults/#{RUBY_ENGINE}"
- rescue ::LoadError
- end
- end
- ensure
- $VERBOSE, $DEBUG = verbose, debug
- end
-
- module QuickLoader
-
- @loaded_full_rubygems_library = false
-
- def self.load_full_rubygems_library
- return if @loaded_full_rubygems_library
-
- @loaded_full_rubygems_library = true
-
- class << Gem
- Gem::GEM_PRELUDE_METHODS.each do |method_name|
- undef_method method_name
- end
- undef_method :const_missing
- undef_method :method_missing
- end
-
- Kernel.module_eval do
- undef_method :gem if method_defined? :gem
- end
-
- $".delete path_to_full_rubygems_library
- $".each do |path|
- if /#{Regexp.escape File::SEPARATOR}rubygems\.rb\z/ =~ path
- raise LoadError, "another rubygems is already loaded from #{path}"
- end
- end
- require 'rubygems'
- end
-
- def self.fake_rubygems_as_loaded
- path = path_to_full_rubygems_library
- $" << path unless $".include?(path)
- end
-
- def self.path_to_full_rubygems_library
- installed_path = File.join(Gem::ConfigMap[:rubylibprefix], Gem::ConfigMap[:ruby_version])
- if $:.include?(installed_path)
- return File.join(installed_path, 'rubygems.rb')
- else # e.g., on test-all
- $:.each do |dir|
- if File.exist?( path = File.join(dir, 'rubygems.rb') )
- return path
- end
- end
- raise LoadError, 'rubygems.rb'
- end
- end
-
- GemPaths = {}
- GemVersions = {}
-
- def push_gem_version_on_load_path(gem_name, *version_requirements)
- if version_requirements.empty?
- unless GemPaths.has_key?(gem_name) then
- raise Gem::LoadError, "Could not find RubyGem #{gem_name} (>= 0)\n"
- end
-
- # highest version gems already active
- return false
- else
- if version_requirements.length > 1 then
- QuickLoader.load_full_rubygems_library
- return gem(gem_name, *version_requirements)
- end
-
- requirement, version = version_requirements[0].split
- requirement.strip!
-
- if loaded_version = GemVersions[gem_name] then
- case requirement
- when ">", ">=" then
- return false if
- (loaded_version <=> Gem.integers_for(version)) >= 0
- when "~>" then
- required_version = Gem.integers_for version
-
- return false if loaded_version.first == required_version.first
- end
- end
-
- QuickLoader.load_full_rubygems_library
- gem gem_name, *version_requirements
- end
- end
-
- def integers_for(gem_version)
- numbers = gem_version.split(".").collect {|n| n.to_i}
- numbers.pop while numbers.last == 0
- numbers << 0 if numbers.empty?
- numbers
- end
-
- def push_all_highest_version_gems_on_load_path
- Gem.path.each do |path|
- gems_directory = File.join(path, "gems")
-
- if File.exist?(gems_directory) then
- Dir.entries(gems_directory).each do |gem_directory_name|
- next if gem_directory_name == "." || gem_directory_name == ".."
-
- dash = gem_directory_name.rindex("-")
- next if dash.nil?
-
- gem_name = gem_directory_name[0...dash]
- current_version = GemVersions[gem_name]
- new_version = integers_for(gem_directory_name[dash+1..-1])
-
- if current_version then
- if (current_version <=> new_version) == -1 then
- GemVersions[gem_name] = new_version
- GemPaths[gem_name] = File.join(gems_directory, gem_directory_name)
- end
- else
- GemVersions[gem_name] = new_version
- GemPaths[gem_name] = File.join(gems_directory, gem_directory_name)
- end
- end
- end
- end
-
- require_paths = []
-
- GemPaths.each_value do |path|
- if File.exist?(file = File.join(path, ".require_paths")) then
- paths = File.read(file).split.map do |require_path|
- File.join path, require_path
- end
-
- require_paths.concat paths
- else
- require_paths << file if File.exist?(file = File.join(path, "bin"))
- require_paths << file if File.exist?(file = File.join(path, "lib"))
- end
- end
-
- # "tag" the first require_path inserted into the $LOAD_PATH to enable
- # indexing correctly with rubygems proper when it inserts an explicitly
- # gem version
- unless require_paths.empty? then
- require_paths.first.instance_variable_set(:@gem_prelude_index, true)
- end
- # gem directories must come after -I and ENV['RUBYLIB']
- $:[$:.index(ConfigMap[:sitelibdir]),0] = require_paths
- end
-
- def const_missing(constant)
- QuickLoader.load_full_rubygems_library
-
- if Gem.const_defined?(constant) then
- Gem.const_get constant
- else
- super
- end
- end
-
- def method_missing(method, *args, &block)
- QuickLoader.load_full_rubygems_library
- super unless Gem.respond_to?(method)
- Gem.send(method, *args, &block)
- end
- end
-
- extend QuickLoader
-
- end
-
- begin
- Gem.push_all_highest_version_gems_on_load_path
- Gem::QuickLoader.fake_rubygems_as_loaded
- rescue Exception => e
- puts "Error loading gem paths on load path in gem_prelude"
- puts e
- puts e.backtrace.join("\n")
- end
-
-end
-
diff --git a/golf_prelude.rb b/golf_prelude.rb
deleted file mode 100644
index 4363b496f0..0000000000
--- a/golf_prelude.rb
+++ /dev/null
@@ -1,114 +0,0 @@
-class Object
- @@golf_hash = {}
- def method_missing m, *a, &b
- t = @@golf_hash[ [m,self.class] ] ||= matching_methods(m)[0]
- if t && b
- __send__(t, *a) {|*args|
- b.binding.eval("proc{|golf_matchdata| $~ = golf_matchdata }").call($~) if $~
- b.call(*args)
- }
- else
- t ? __send__(t, *a, &b) : super
- end
- end
-
- def matching_methods(s='', m=callable_methods)
- r=/^#{s.to_s.gsub(/./){"(.*?)"+Regexp.escape($&)}}/
- m.grep(r).sort_by do |i|
- i.to_s.match(r).captures.map(&:size) << i
- end
- end
-
- def self.const_missing c
- t = @@golf_hash[ [c,self.class] ] ||= matching_methods(c,constants)[0]
- t and return const_get(t)
- raise NameError, "uninitialized constant #{c}", caller(1)
- end
-
- def shortest_abbreviation(s='', m=callable_methods)
- s=s.to_s
- our_case = (?A..?Z)===s[0]
- if m.index(s.to_sym)
- 1.upto(s.size){|z|s.scan(/./).combination(z).map{|trial|
- next unless ((?A..?Z)===trial[0]) == our_case
- trial*=''
- return trial if matching_methods(trial,m)[0].to_s==s
- }}
- else
- nil
- end
- end
-
- def callable_methods
- self.class == Object ? methods + private_methods : methods
- end
-
- private
-
- def h(a='H', b='w', c='!')
- puts "#{a}ello, #{b}orld#{c}"
- end
-
- alias say puts
-
- def do_while
- 0 while yield
- end
-
- def do_until
- 0 until yield
- end
-end
-
-class Array
- alias old_to_s to_s
- alias to_s join
-end
-
-class FalseClass
- alias old_to_s to_s
- def to_s
- ""
- end
-end
-
-class Integer
- alias each times
- include Enumerable
-end
-
-class String
- alias / split
-
- def to_a
- split('')
- end
-
- (Array.instance_methods-instance_methods-[:to_ary,:transpose,:flatten,:flatten!,:compact,:compact!,:assoc,:rassoc]).each{|meth|
- eval"
- def #{meth}(*args, &block)
- a=to_a
- result = a.#{meth}(*args, &block)
- replace(a.join)
- if result.class == Array
- Integer===result[0] ? result.pack('c*') : result.join
- elsif result.class == Enumerator
- result.map(&:join).to_enum
- else
- result
- end
- end"
- }
-end
-
-class Enumerator
- alias old_to_s to_s
- (Array.instance_methods-instance_methods-[:replace]+[:to_s]).each{|meth|
- eval"
- def #{meth}(*args, &block)
- to_a.#{meth}(*args, &block)
- end"
- }
- alias old_inspect inspect
- alias inspect old_to_s
-end
diff --git a/goruby.c b/goruby.c
deleted file mode 100644
index 17be654800..0000000000
--- a/goruby.c
+++ /dev/null
@@ -1,24 +0,0 @@
-void Init_golf(void);
-#define ruby_run_node goruby_run_node
-#include "main.c"
-#undef ruby_run_node
-
-RUBY_EXTERN int ruby_run_node(void*);
-RUBY_EXTERN void ruby_init_ext(const char *name, void (*init)(void));
-
-static VALUE
-init_golf(VALUE arg)
-{
- ruby_init_ext("golf", Init_golf);
- return arg;
-}
-
-int
-goruby_run_node(void *arg)
-{
- int state;
- if (NIL_P(rb_protect(init_golf, Qtrue, &state))) {
- return state == EXIT_SUCCESS ? EXIT_FAILURE : state;
- }
- return ruby_run_node(arg);
-}
diff --git a/hash.c b/hash.c
index da47b55bea..771eab1069 100644
--- a/hash.c
+++ b/hash.c
@@ -3,29 +3,40 @@
hash.c -
$Author$
+ $Date$
created at: Mon Nov 22 18:51:18 JST 1993
- Copyright (C) 1993-2007 Yukihiro Matsumoto
+ Copyright (C) 1993-2003 Yukihiro Matsumoto
Copyright (C) 2000 Network Applied Communication Laboratory, Inc.
Copyright (C) 2000 Information-technology Promotion Agency, Japan
**********************************************************************/
-#include "ruby/ruby.h"
-#include "ruby/st.h"
-#include "ruby/util.h"
+#include "ruby.h"
+#include "st.h"
+#include "util.h"
+#include "rubysig.h"
#ifdef __APPLE__
#include <crt_externs.h>
#endif
-static VALUE rb_hash_s_try_convert(VALUE, VALUE);
-
#define HASH_DELETED FL_USER1
#define HASH_PROC_DEFAULT FL_USER2
+static void
+rb_hash_modify(hash)
+ VALUE hash;
+{
+ if (!RHASH(hash)->tbl) rb_raise(rb_eTypeError, "uninitialized Hash");
+ if (OBJ_FROZEN(hash)) rb_error_frozen("hash");
+ if (!OBJ_TAINTED(hash) && rb_safe_level() >= 4)
+ rb_raise(rb_eSecurityError, "Insecure: can't modify hash");
+}
+
VALUE
-rb_hash_freeze(VALUE hash)
+rb_hash_freeze(hash)
+ VALUE hash;
{
return rb_obj_freeze(hash);
}
@@ -33,58 +44,57 @@ rb_hash_freeze(VALUE hash)
VALUE rb_cHash;
static VALUE envtbl;
-static ID id_hash, id_yield, id_default;
+static ID id_hash, id_call, id_default;
+
+static VALUE
+eql(args)
+ VALUE *args;
+{
+ return (VALUE)rb_eql(args[0], args[1]);
+}
static int
-rb_any_cmp(VALUE a, VALUE b)
+rb_any_cmp(a, b)
+ VALUE a, b;
{
+ VALUE args[2];
+
if (a == b) return 0;
if (FIXNUM_P(a) && FIXNUM_P(b)) {
return a != b;
}
if (TYPE(a) == T_STRING && RBASIC(a)->klass == rb_cString &&
TYPE(b) == T_STRING && RBASIC(b)->klass == rb_cString) {
- return rb_str_hash_cmp(a, b);
+ return rb_str_cmp(a, b);
}
if (a == Qundef || b == Qundef) return -1;
if (SYMBOL_P(a) && SYMBOL_P(b)) {
return a != b;
}
- return !rb_eql(a, b);
+ args[0] = a;
+ args[1] = b;
+ return !rb_with_disable_interrupt(eql, (VALUE)args);
}
VALUE
-rb_hash(VALUE obj)
+rb_hash(obj)
+ VALUE obj;
{
- VALUE hval = rb_funcall(obj, id_hash, 0);
- retry:
- switch (TYPE(hval)) {
- case T_FIXNUM:
- return hval;
-
- case T_BIGNUM:
- return LONG2FIX(((long*)(RBIGNUM_DIGITS(hval)))[0]);
-
- default:
- hval = rb_to_int(hval);
- goto retry;
- }
+ return rb_funcall(obj, id_hash, 0);
}
static int
-rb_any_hash(VALUE a)
+rb_any_hash(a)
+ VALUE a;
{
VALUE hval;
- VALUE hnum;
+ int hnum;
switch (TYPE(a)) {
case T_FIXNUM:
case T_SYMBOL:
- case T_NIL:
- case T_FALSE:
- case T_TRUE:
- hnum = rb_hash_end(rb_hash_start((unsigned int)a));
+ hnum = (int)a;
break;
case T_STRING:
@@ -92,23 +102,21 @@ rb_any_hash(VALUE a)
break;
default:
- hval = rb_hash(a);
- hnum = FIX2LONG(hval);
+ hval = rb_funcall(a, id_hash, 0);
+ if (!FIXNUM_P(hval)) {
+ hval = rb_funcall(hval, '%', 1, INT2FIX(536870923));
+ }
+ hnum = (int)FIX2LONG(hval);
}
hnum <<= 1;
- return (int)RSHIFT(hnum, 1);
+ return RSHIFT(hnum, 1);
}
-static const struct st_hash_type objhash = {
+static struct st_hash_type objhash = {
rb_any_cmp,
rb_any_hash,
};
-static const struct st_hash_type identhash = {
- st_numcmp,
- st_numhash,
-};
-
typedef int st_foreach_func(st_data_t, st_data_t, st_data_t);
struct foreach_safe_arg {
@@ -118,7 +126,9 @@ struct foreach_safe_arg {
};
static int
-foreach_safe_i(st_data_t key, st_data_t value, struct foreach_safe_arg *arg)
+foreach_safe_i(key, value, arg)
+ st_data_t key, value;
+ struct foreach_safe_arg *arg;
{
int status;
@@ -131,7 +141,10 @@ foreach_safe_i(st_data_t key, st_data_t value, struct foreach_safe_arg *arg)
}
void
-st_foreach_safe(st_table *table, int (*func)(ANYARGS), st_data_t a)
+st_foreach_safe(table, func, a)
+ st_table *table;
+ int (*func)();
+ st_data_t a;
{
struct foreach_safe_arg arg;
@@ -152,37 +165,40 @@ struct hash_foreach_arg {
};
static int
-hash_foreach_iter(st_data_t key, st_data_t value, struct hash_foreach_arg *arg)
+hash_foreach_iter(key, value, arg)
+ VALUE key, value;
+ struct hash_foreach_arg *arg;
{
int status;
st_table *tbl;
- tbl = RHASH(arg->hash)->ntbl;
- if ((VALUE)key == Qundef) return ST_CONTINUE;
- status = (*arg->func)((VALUE)key, (VALUE)value, arg->arg);
- if (RHASH(arg->hash)->ntbl != tbl) {
+ tbl = RHASH(arg->hash)->tbl;
+ if (key == Qundef) return ST_CONTINUE;
+ status = (*arg->func)(key, value, arg->arg);
+ if (RHASH(arg->hash)->tbl != tbl) {
rb_raise(rb_eRuntimeError, "rehash occurred during iteration");
}
switch (status) {
case ST_DELETE:
- st_delete_safe(tbl, &key, 0, Qundef);
+ st_delete_safe(tbl, (st_data_t*)&key, 0, Qundef);
FL_SET(arg->hash, HASH_DELETED);
case ST_CONTINUE:
- break;
+ break;
case ST_STOP:
- return ST_STOP;
+ return ST_STOP;
}
return ST_CHECK;
}
static VALUE
-hash_foreach_ensure(VALUE hash)
+hash_foreach_ensure(hash)
+ VALUE hash;
{
RHASH(hash)->iter_lev--;
if (RHASH(hash)->iter_lev == 0) {
if (FL_TEST(hash, HASH_DELETED)) {
- st_cleanup_safe(RHASH(hash)->ntbl, Qundef);
+ st_cleanup_safe(RHASH(hash)->tbl, Qundef);
FL_UNSET(hash, HASH_DELETED);
}
}
@@ -190,21 +206,23 @@ hash_foreach_ensure(VALUE hash)
}
static VALUE
-hash_foreach_call(struct hash_foreach_arg *arg)
+hash_foreach_call(arg)
+ struct hash_foreach_arg *arg;
{
- if (st_foreach(RHASH(arg->hash)->ntbl, hash_foreach_iter, (st_data_t)arg)) {
+ if (st_foreach(RHASH(arg->hash)->tbl, hash_foreach_iter, (st_data_t)arg)) {
rb_raise(rb_eRuntimeError, "hash modified during iteration");
}
return Qnil;
}
void
-rb_hash_foreach(VALUE hash, int (*func)(ANYARGS), VALUE farg)
+rb_hash_foreach(hash, func, farg)
+ VALUE hash;
+ int (*func)();
+ VALUE farg;
{
struct hash_foreach_arg arg;
- if (!RHASH(hash)->ntbl)
- return;
RHASH(hash)->iter_lev++;
arg.hash = hash;
arg.func = (rb_foreach_func *)func;
@@ -212,8 +230,11 @@ rb_hash_foreach(VALUE hash, int (*func)(ANYARGS), VALUE farg)
rb_ensure(hash_foreach_call, (VALUE)&arg, hash_foreach_ensure, hash);
}
+static VALUE hash_alloc0 _((VALUE));
+static VALUE hash_alloc _((VALUE));
static VALUE
-hash_alloc(VALUE klass)
+hash_alloc0(klass)
+ VALUE klass;
{
NEWOBJ(hash, struct RHash);
OBJSETUP(hash, klass, T_HASH);
@@ -223,49 +244,21 @@ hash_alloc(VALUE klass)
return (VALUE)hash;
}
-VALUE
-rb_hash_new(void)
-{
- return hash_alloc(rb_cHash);
-}
-
-VALUE
-rb_hash_dup(VALUE hash)
+static VALUE
+hash_alloc(klass)
+ VALUE klass;
{
- NEWOBJ(ret, struct RHash);
- DUPSETUP(ret, hash);
+ VALUE hash = hash_alloc0(klass);
- if (!RHASH_EMPTY_P(hash))
- ret->ntbl = st_copy(RHASH(hash)->ntbl);
- if (FL_TEST(hash, HASH_PROC_DEFAULT)) {
- FL_SET(ret, HASH_PROC_DEFAULT);
- }
- ret->ifnone = RHASH(hash)->ifnone;
- return (VALUE)ret;
-}
-
-static void
-rb_hash_modify_check(VALUE hash)
-{
- if (OBJ_FROZEN(hash)) rb_error_frozen("hash");
- if (!OBJ_UNTRUSTED(hash) && rb_safe_level() >= 4)
- rb_raise(rb_eSecurityError, "Insecure: can't modify hash");
-}
+ RHASH(hash)->tbl = st_init_table(&objhash);
-struct st_table *
-rb_hash_tbl(VALUE hash)
-{
- if (!RHASH(hash)->ntbl) {
- RHASH(hash)->ntbl = st_init_table(&objhash);
- }
- return RHASH(hash)->ntbl;
+ return hash;
}
-static void
-rb_hash_modify(VALUE hash)
+VALUE
+rb_hash_new()
{
- rb_hash_modify_check(hash);
- rb_hash_tbl(hash);
+ return hash_alloc(rb_cHash);
}
/*
@@ -304,7 +297,10 @@ rb_hash_modify(VALUE hash)
*/
static VALUE
-rb_hash_initialize(int argc, VALUE *argv, VALUE hash)
+rb_hash_initialize(argc, argv, hash)
+ int argc;
+ VALUE *argv;
+ VALUE hash;
{
VALUE ifnone;
@@ -338,18 +334,19 @@ rb_hash_initialize(int argc, VALUE *argv, VALUE hash)
*/
static VALUE
-rb_hash_s_create(int argc, VALUE *argv, VALUE klass)
+rb_hash_s_create(argc, argv, klass)
+ 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_check_convert_type(argv[0], T_HASH, "Hash", "to_hash");
if (!NIL_P(tmp)) {
- hash = hash_alloc(klass);
- if (RHASH(tmp)->ntbl) {
- RHASH(hash)->ntbl = st_copy(RHASH(tmp)->ntbl);
- }
+ hash = hash_alloc0(klass);
+ RHASH(hash)->tbl = st_copy(RHASH(tmp)->tbl);
return hash;
}
@@ -387,33 +384,17 @@ rb_hash_s_create(int argc, VALUE *argv, VALUE klass)
}
static VALUE
-to_hash(VALUE hash)
+to_hash(hash)
+ VALUE hash;
{
return rb_convert_type(hash, T_HASH, "Hash", "to_hash");
}
-/*
- * call-seq:
- * Hash.try_convert(obj) -> hash or nil
- *
- * Try to convert <i>obj</i> into a hash, using to_hash method.
- * Returns converted hash or nil if <i>obj</i> cannot be converted
- * for any reason.
- *
- * Hash.try_convert({1=>2}) # => {1=>2}
- * Hash.try_convert("1=>2") # => nil
- */
-static VALUE
-rb_hash_s_try_convert(VALUE dummy, VALUE hash)
-{
- return rb_check_convert_type(hash, T_HASH, "Hash", "to_hash");
-}
-
static int
-rb_hash_rehash_i(VALUE key, VALUE value, VALUE arg)
+rb_hash_rehash_i(key, value, tbl)
+ VALUE key, value;
+ st_table *tbl;
{
- st_table *tbl = (st_table *)arg;
-
if (key != Qundef) st_insert(tbl, key, value);
return ST_CONTINUE;
}
@@ -426,7 +407,7 @@ rb_hash_rehash_i(VALUE key, VALUE value, VALUE arg)
* values of key objects have changed since they were inserted, this
* method will reindex <i>hsh</i>. If <code>Hash#rehash</code> is
* called while an iterator is traversing the hash, an
- * <code>RuntimeError</code> will be raised in the iterator.
+ * <code>IndexError</code> will be raised in the iterator.
*
* a = [ "a", "b" ]
* c = [ "c", "d" ]
@@ -439,20 +420,16 @@ rb_hash_rehash_i(VALUE key, VALUE value, VALUE arg)
*/
static VALUE
-rb_hash_rehash(VALUE hash)
+rb_hash_rehash(hash)
+ VALUE hash;
{
st_table *tbl;
- if (RHASH(hash)->iter_lev > 0) {
- rb_raise(rb_eRuntimeError, "rehash during iteration");
- }
- rb_hash_modify_check(hash);
- if (!RHASH(hash)->ntbl)
- return hash;
- tbl = st_init_table_with_size(RHASH(hash)->ntbl->type, RHASH(hash)->ntbl->num_entries);
- rb_hash_foreach(hash, rb_hash_rehash_i, (VALUE)tbl);
- st_free_table(RHASH(hash)->ntbl);
- RHASH(hash)->ntbl = tbl;
+ rb_hash_modify(hash);
+ tbl = st_init_table_with_size(&objhash, RHASH(hash)->tbl->num_entries);
+ rb_hash_foreach(hash, rb_hash_rehash_i, (st_data_t)tbl);
+ st_free_table(RHASH(hash)->tbl);
+ RHASH(hash)->tbl = tbl;
return hash;
}
@@ -472,33 +449,29 @@ rb_hash_rehash(VALUE hash)
*/
VALUE
-rb_hash_aref(VALUE hash, VALUE key)
+rb_hash_aref(hash, key)
+ VALUE hash, key;
{
VALUE val;
- if (!RHASH(hash)->ntbl || !st_lookup(RHASH(hash)->ntbl, key, &val)) {
+ if (!st_lookup(RHASH(hash)->tbl, key, &val)) {
return rb_funcall(hash, id_default, 1, key);
}
return val;
}
VALUE
-rb_hash_lookup2(VALUE hash, VALUE key, VALUE def)
+rb_hash_lookup(hash, key)
+ VALUE hash, key;
{
VALUE val;
- if (!RHASH(hash)->ntbl || !st_lookup(RHASH(hash)->ntbl, key, &val)) {
- return def; /* without Hash#default */
+ if (!st_lookup(RHASH(hash)->tbl, key, &val)) {
+ return Qnil; /* without Hash#default */
}
return val;
}
-VALUE
-rb_hash_lookup(VALUE hash, VALUE key)
-{
- return rb_hash_lookup2(hash, key, Qnil);
-}
-
/*
* call-seq:
* hsh.fetch(key [, default] ) => obj
@@ -506,7 +479,7 @@ 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 an <code>KeyError</code> exception; if <i>default</i> is
+ * raise an <code>IndexError</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.
*
@@ -523,13 +496,16 @@ rb_hash_lookup(VALUE hash, VALUE key)
*
* <em>produces:</em>
*
- * prog.rb:2:in `fetch': key not found (KeyError)
+ * prog.rb:2:in `fetch': key not found (IndexError)
* from prog.rb:2
*
*/
static VALUE
-rb_hash_fetch_m(int argc, VALUE *argv, VALUE hash)
+rb_hash_fetch(argc, argv, hash)
+ int argc;
+ VALUE *argv;
+ VALUE hash;
{
VALUE key, if_none;
VALUE val;
@@ -541,22 +517,16 @@ rb_hash_fetch_m(int argc, VALUE *argv, VALUE hash)
if (block_given && argc == 2) {
rb_warn("block supersedes default value argument");
}
- if (!RHASH(hash)->ntbl || !st_lookup(RHASH(hash)->ntbl, key, &val)) {
+ if (!st_lookup(RHASH(hash)->tbl, key, &val)) {
if (block_given) return rb_yield(key);
if (argc == 1) {
- rb_raise(rb_eKeyError, "key not found");
+ rb_raise(rb_eIndexError, "key not found");
}
return if_none;
}
return val;
}
-VALUE
-rb_hash_fetch(VALUE hash, VALUE key)
-{
- return rb_hash_fetch_m(1, &key, hash);
-}
-
/*
* call-seq:
* hsh.default(key=nil) => obj
@@ -579,21 +549,24 @@ rb_hash_fetch(VALUE hash, VALUE key)
*/
static VALUE
-rb_hash_default(int argc, VALUE *argv, VALUE hash)
+rb_hash_default(argc, argv, hash)
+ int argc;
+ VALUE *argv;
+ VALUE hash;
{
VALUE key;
rb_scan_args(argc, argv, "01", &key);
if (FL_TEST(hash, HASH_PROC_DEFAULT)) {
if (argc == 0) return Qnil;
- return rb_funcall(RHASH(hash)->ifnone, id_yield, 2, hash, key);
+ return rb_funcall(RHASH(hash)->ifnone, id_call, 2, hash, key);
}
return RHASH(hash)->ifnone;
}
/*
* call-seq:
- * hsh.default = obj => obj
+ * hsh.default = obj => hsh
*
* Sets the default value, the value returned for a key that does not
* exist in the hash. It is not possible to set the a default to a
@@ -612,7 +585,8 @@ rb_hash_default(int argc, VALUE *argv, VALUE hash)
*/
static VALUE
-rb_hash_set_default(VALUE hash, VALUE ifnone)
+rb_hash_set_default(hash, ifnone)
+ VALUE hash, ifnone;
{
rb_hash_modify(hash);
RHASH(hash)->ifnone = ifnone;
@@ -636,7 +610,8 @@ rb_hash_set_default(VALUE hash, VALUE ifnone)
static VALUE
-rb_hash_default_proc(VALUE hash)
+rb_hash_default_proc(hash)
+ VALUE hash;
{
if (FL_TEST(hash, HASH_PROC_DEFAULT)) {
return RHASH(hash)->ifnone;
@@ -644,44 +619,11 @@ rb_hash_default_proc(VALUE hash)
return Qnil;
}
-VALUE rb_obj_is_proc(VALUE proc);
-
-/*
- * call-seq:
- * hsh.default_proc = proc_obj => proc_obj
- *
- * Sets the default proc to be executed on each key lookup.
- *
- * h.default_proc = proc do |hash, key|
- * hash[key] = key + key
- * end
- * h[2] #=> 4
- * h["cat"] #=> "catcat"
- */
-
-static VALUE
-rb_hash_set_default_proc(VALUE hash, VALUE proc)
-{
- VALUE b;
-
- rb_hash_modify(hash);
- 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;
- RHASH(hash)->ifnone = proc;
- FL_SET(hash, HASH_PROC_DEFAULT);
- return proc;
-}
-
static int
-key_i(VALUE key, VALUE value, VALUE arg)
+index_i(key, value, args)
+ VALUE key, value;
+ VALUE *args;
{
- VALUE *args = (VALUE *)arg;
-
if (rb_equal(value, args[0])) {
args[1] = key;
return ST_STOP;
@@ -689,55 +631,75 @@ key_i(VALUE key, VALUE value, VALUE arg)
return ST_CONTINUE;
}
+static VALUE
+rb_hash_delete_key(hash, key)
+ VALUE hash, key;
+{
+ st_data_t ktmp = (st_data_t)key, val;
+
+ if (RHASH(hash)->iter_lev > 0) {
+ if (st_delete_safe(RHASH(hash)->tbl, &ktmp, &val, Qundef)) {
+ FL_SET(hash, HASH_DELETED);
+ return (VALUE)val;
+ }
+ }
+ else if (st_delete(RHASH(hash)->tbl, &ktmp, &val))
+ return (VALUE)val;
+ return Qundef;
+}
+
/*
* call-seq:
- * hsh.key(value) => key
+ * hsh.index(value) => key
*
* Returns the key for a given value. If not found, returns <code>nil</code>.
*
* h = { "a" => 100, "b" => 200 }
- * h.key(200) #=> "b"
- * h.key(999) #=> nil
+ * h.index(200) #=> "b"
+ * h.index(999) #=> nil
*
*/
static VALUE
-rb_hash_key(VALUE hash, VALUE value)
+rb_hash_index(hash, value)
+ VALUE hash, value;
{
VALUE args[2];
args[0] = value;
args[1] = Qnil;
- rb_hash_foreach(hash, key_i, (VALUE)args);
+ rb_hash_foreach(hash, index_i, (st_data_t)args);
return args[1];
}
-/* :nodoc: */
-static VALUE
-rb_hash_index(VALUE hash, VALUE value)
-{
- rb_warn("Hash#index is deprecated; use Hash#key");
- return rb_hash_key(hash, value);
-}
+/*
+ * call-seq:
+ * hsh.indexes(key, ...) => array
+ * hsh.indices(key, ...) => array
+ *
+ * Deprecated in favor of <code>Hash#select</code>.
+ *
+ */
static VALUE
-rb_hash_delete_key(VALUE hash, VALUE key)
+rb_hash_indexes(argc, argv, hash)
+ int argc;
+ VALUE *argv;
+ VALUE hash;
{
- st_data_t ktmp = (st_data_t)key, val;
+ VALUE indexes;
+ int i;
- if (!RHASH(hash)->ntbl)
- return Qundef;
- if (RHASH(hash)->iter_lev > 0) {
- if (st_delete_safe(RHASH(hash)->ntbl, &ktmp, &val, Qundef)) {
- FL_SET(hash, HASH_DELETED);
- return (VALUE)val;
- }
+ rb_warn("Hash#%s is deprecated; use Hash#values_at",
+ rb_id2name(rb_frame_last_func()));
+ indexes = rb_ary_new2(argc);
+ for (i=0; i<argc; i++) {
+ RARRAY(indexes)->ptr[i] = rb_hash_aref(hash, argv[i]);
+ RARRAY(indexes)->len++;
}
- else if (st_delete(RHASH(hash)->ntbl, &ktmp, &val))
- return (VALUE)val;
- return Qundef;
+ return indexes;
}
/*
@@ -746,10 +708,9 @@ rb_hash_delete_key(VALUE hash, VALUE key)
* hsh.delete(key) {| key | block } => value
*
* Deletes and returns a key-value pair from <i>hsh</i> whose key is
- * equal to <i>key</i>. If the key is not found, returns the
- * <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>.
+ * equal to <i>key</i>. If the key is not found, returns <code>nil</code>.
+ * 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>.
*
* h = { "a" => 100, "b" => 200 }
* h.delete("a") #=> 100
@@ -759,7 +720,8 @@ rb_hash_delete_key(VALUE hash, VALUE key)
*/
VALUE
-rb_hash_delete(VALUE hash, VALUE key)
+rb_hash_delete(hash, key)
+ VALUE hash, key;
{
VALUE val;
@@ -778,10 +740,10 @@ struct shift_var {
};
static int
-shift_i(VALUE key, VALUE value, VALUE arg)
+shift_i(key, value, var)
+ VALUE key, value;
+ struct shift_var *var;
{
- struct shift_var *var = (struct shift_var *)arg;
-
if (key == Qundef) return ST_CONTINUE;
if (var->key != Qundef) return ST_STOP;
var->key = key;
@@ -790,10 +752,10 @@ shift_i(VALUE key, VALUE value, VALUE arg)
}
static int
-shift_i_safe(VALUE key, VALUE value, VALUE arg)
+shift_i_safe(key, value, var)
+ VALUE key, value;
+ struct shift_var *var;
{
- struct shift_var *var = (struct shift_var *)arg;
-
if (key == Qundef) return ST_CONTINUE;
var->key = key;
var->val = value;
@@ -814,23 +776,31 @@ shift_i_safe(VALUE key, VALUE value, VALUE arg)
*/
static VALUE
-rb_hash_shift(VALUE hash)
+rb_hash_shift(hash)
+ VALUE hash;
{
struct shift_var var;
rb_hash_modify(hash);
var.key = Qundef;
- rb_hash_foreach(hash, RHASH(hash)->iter_lev > 0 ? shift_i_safe : shift_i,
- (VALUE)&var);
+ if (RHASH(hash)->iter_lev > 0) {
+ rb_hash_foreach(hash, shift_i_safe, (st_data_t)&var);
+ if (var.key != Qundef) {
+ st_data_t key = var.key;
+ if (st_delete_safe(RHASH(hash)->tbl, &key, 0, Qundef)) {
+ FL_SET(hash, HASH_DELETED);
+ }
+ }
+ }
+ else {
+ rb_hash_foreach(hash, shift_i, (st_data_t)&var);
+ }
if (var.key != Qundef) {
- if (RHASH(hash)->iter_lev > 0) {
- rb_hash_delete_key(hash, var.key);
- }
return rb_assoc_new(var.key, var.val);
}
else if (FL_TEST(hash, HASH_PROC_DEFAULT)) {
- return rb_funcall(RHASH(hash)->ifnone, id_yield, 2, hash, Qnil);
+ return rb_funcall(RHASH(hash)->ifnone, id_call, 2, hash, Qnil);
}
else {
return RHASH(hash)->ifnone;
@@ -838,7 +808,8 @@ rb_hash_shift(VALUE hash)
}
static int
-delete_if_i(VALUE key, VALUE value, VALUE hash)
+delete_if_i(key, value, hash)
+ VALUE key, value, hash;
{
if (key == Qundef) return ST_CONTINUE;
if (RTEST(rb_yield_values(2, key, value))) {
@@ -860,7 +831,8 @@ delete_if_i(VALUE key, VALUE value, VALUE hash)
*/
VALUE
-rb_hash_delete_if(VALUE hash)
+rb_hash_delete_if(hash)
+ VALUE hash;
{
RETURN_ENUMERATOR(hash, 0, 0);
rb_hash_modify(hash);
@@ -877,17 +849,15 @@ rb_hash_delete_if(VALUE hash)
*/
VALUE
-rb_hash_reject_bang(VALUE hash)
+rb_hash_reject_bang(hash)
+ VALUE hash;
{
- st_index_t n;
+ int n;
RETURN_ENUMERATOR(hash, 0, 0);
- rb_hash_modify(hash);
- if (!RHASH(hash)->ntbl)
- return Qnil;
- n = RHASH(hash)->ntbl->num_entries;
- rb_hash_foreach(hash, delete_if_i, hash);
- if (n == RHASH(hash)->ntbl->num_entries) return Qnil;
+ n = RHASH(hash)->tbl->num_entries;
+ rb_hash_delete_if(hash);
+ if (n == RHASH(hash)->tbl->num_entries) return Qnil;
return hash;
}
@@ -902,11 +872,22 @@ rb_hash_reject_bang(VALUE hash)
*/
static VALUE
-rb_hash_reject(VALUE hash)
+rb_hash_reject(hash)
+ VALUE hash;
{
return rb_hash_delete_if(rb_obj_dup(hash));
}
+static int
+select_i(key, value, result)
+ VALUE key, value, result;
+{
+ if (key == Qundef) return ST_CONTINUE;
+ if (RTEST(rb_yield_values(2, key, value)))
+ rb_ary_push(result, rb_assoc_new(key, value));
+ return ST_CONTINUE;
+}
+
/*
* call-seq:
* hsh.values_at(key, ...) => array
@@ -919,9 +900,12 @@ rb_hash_reject(VALUE hash)
*/
VALUE
-rb_hash_values_at(int argc, VALUE *argv, VALUE hash)
+rb_hash_values_at(argc, argv, hash)
+ int argc;
+ VALUE *argv;
+ VALUE hash;
{
- VALUE result = rb_ary_new2(argc);
+ VALUE result = rb_ary_new();
long i;
for (i=0; i<argc; i++) {
@@ -930,39 +914,34 @@ rb_hash_values_at(int argc, VALUE *argv, VALUE hash)
return result;
}
-static int
-select_i(VALUE key, VALUE value, VALUE result)
-{
- if (key == Qundef) return ST_CONTINUE;
- if (RTEST(rb_yield_values(2, key, value)))
- rb_hash_aset(result, key, value);
- return ST_CONTINUE;
-}
-
/*
* call-seq:
- * hsh.select {|key, value| block} => a_hash
+ * hsh.select {|key, value| block} => array
*
- * Returns a new hash consisting of entries which the block returns true.
+ * Returns a new array consisting of <code>[key,value]</code>
+ * pairs for which the block returns true.
+ * Also see <code>Hash.values_at</code>.
*
* 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}
+ * h.select {|k,v| k > "a"} #=> [["b", 200], ["c", 300]]
+ * h.select {|k,v| v < 200} #=> [["a", 100]]
*/
VALUE
-rb_hash_select(VALUE hash)
+rb_hash_select(hash)
+ VALUE hash;
{
VALUE result;
RETURN_ENUMERATOR(hash, 0, 0);
- result = rb_hash_new();
+ result = rb_ary_new();
rb_hash_foreach(hash, select_i, result);
return result;
}
static int
-clear_i(VALUE key, VALUE value, VALUE dummy)
+clear_i(key, value, dummy)
+ VALUE key, value, dummy;
{
return ST_DELETE;
}
@@ -979,16 +958,12 @@ clear_i(VALUE key, VALUE value, VALUE dummy)
*/
static VALUE
-rb_hash_clear(VALUE hash)
+rb_hash_clear(hash)
+ VALUE hash;
{
- rb_hash_modify_check(hash);
- if (!RHASH(hash)->ntbl)
- return hash;
- if (RHASH(hash)->ntbl->num_entries > 0) {
- if (RHASH(hash)->iter_lev > 0)
- rb_hash_foreach(hash, clear_i, 0);
- else
- st_clear(RHASH(hash)->ntbl);
+ rb_hash_modify(hash);
+ if (RHASH(hash)->tbl->num_entries > 0) {
+ rb_hash_foreach(hash, clear_i, 0);
}
return hash;
@@ -1013,23 +988,22 @@ rb_hash_clear(VALUE hash)
*/
VALUE
-rb_hash_aset(VALUE hash, VALUE key, VALUE val)
+rb_hash_aset(hash, key, val)
+ VALUE hash, key, val;
{
rb_hash_modify(hash);
- if (hash == key) {
- rb_raise(rb_eArgError, "recursive key for hash");
- }
- if (RHASH(hash)->ntbl->type == &identhash || rb_obj_class(key) != rb_cString) {
- st_insert(RHASH(hash)->ntbl, key, val);
+ if (TYPE(key) != T_STRING || st_lookup(RHASH(hash)->tbl, key, 0)) {
+ st_insert(RHASH(hash)->tbl, key, val);
}
else {
- st_insert2(RHASH(hash)->ntbl, key, val, rb_str_new4);
+ st_add_direct(RHASH(hash)->tbl, rb_str_new4(key), val);
}
return val;
}
static int
-replace_i(VALUE key, VALUE val, VALUE hash)
+replace_i(key, val, hash)
+ VALUE key, val, hash;
{
if (key != Qundef) {
rb_hash_aset(hash, key, val);
@@ -1051,7 +1025,8 @@ replace_i(VALUE key, VALUE val, VALUE hash)
*/
static VALUE
-rb_hash_replace(VALUE hash, VALUE hash2)
+rb_hash_replace(hash, hash2)
+ VALUE hash, hash2;
{
hash2 = to_hash(hash2);
if (hash == hash2) return hash;
@@ -1082,11 +1057,10 @@ rb_hash_replace(VALUE hash, VALUE hash2)
*/
static VALUE
-rb_hash_size(VALUE hash)
+rb_hash_size(hash)
+ VALUE hash;
{
- if (!RHASH(hash)->ntbl)
- return INT2FIX(0);
- return INT2FIX(RHASH(hash)->ntbl->num_entries);
+ return INT2FIX(RHASH(hash)->tbl->num_entries);
}
@@ -1101,13 +1075,17 @@ rb_hash_size(VALUE hash)
*/
static VALUE
-rb_hash_empty_p(VALUE hash)
+rb_hash_empty_p(hash)
+ VALUE hash;
{
- return RHASH_EMPTY_P(hash) ? Qtrue : Qfalse;
+ if (RHASH(hash)->tbl->num_entries == 0)
+ return Qtrue;
+ return Qfalse;
}
static int
-each_value_i(VALUE key, VALUE value)
+each_value_i(key, value)
+ VALUE key, value;
{
if (key == Qundef) return ST_CONTINUE;
rb_yield(value);
@@ -1131,7 +1109,8 @@ each_value_i(VALUE key, VALUE value)
*/
static VALUE
-rb_hash_each_value(VALUE hash)
+rb_hash_each_value(hash)
+ VALUE hash;
{
RETURN_ENUMERATOR(hash, 0, 0);
rb_hash_foreach(hash, each_value_i, 0);
@@ -1139,7 +1118,8 @@ rb_hash_each_value(VALUE hash)
}
static int
-each_key_i(VALUE key, VALUE value)
+each_key_i(key, value)
+ VALUE key, value;
{
if (key == Qundef) return ST_CONTINUE;
rb_yield(key);
@@ -1162,7 +1142,8 @@ each_key_i(VALUE key, VALUE value)
* b
*/
static VALUE
-rb_hash_each_key(VALUE hash)
+rb_hash_each_key(hash)
+ VALUE hash;
{
RETURN_ENUMERATOR(hash, 0, 0);
rb_hash_foreach(hash, each_key_i, 0);
@@ -1170,7 +1151,43 @@ rb_hash_each_key(VALUE hash)
}
static int
-each_pair_i(VALUE key, VALUE value)
+each_pair_i(key, value)
+ VALUE key, value;
+{
+ if (key == Qundef) return ST_CONTINUE;
+ rb_yield_values(2, key, value);
+ return ST_CONTINUE;
+}
+
+/*
+ * call-seq:
+ * hsh.each_pair {| key_value_array | block } -> hsh
+ *
+ * Calls <i>block</i> once for each key in <i>hsh</i>, passing the key
+ * and value as parameters.
+ *
+ * h = { "a" => 100, "b" => 200 }
+ * h.each_pair {|key, value| puts "#{key} is #{value}" }
+ *
+ * <em>produces:</em>
+ *
+ * a is 100
+ * b is 200
+ *
+ */
+
+static VALUE
+rb_hash_each_pair(hash)
+ VALUE hash;
+{
+ RETURN_ENUMERATOR(hash, 0, 0);
+ rb_hash_foreach(hash, each_pair_i, 0);
+ return hash;
+}
+
+static int
+each_i(key, value)
+ VALUE key, value;
{
if (key == Qundef) return ST_CONTINUE;
rb_yield(rb_assoc_new(key, value));
@@ -1180,10 +1197,12 @@ each_pair_i(VALUE key, VALUE value)
/*
* call-seq:
* hsh.each {| key, value | block } -> hsh
- * hsh.each_pair {| key, value | block } -> hsh
*
- * Calls <i>block</i> once for each key in <i>hsh</i>, passing the key-value
- * pair as parameters.
+ * Calls <i>block</i> once for each key in <i>hsh</i>, passing the key
+ * and value to the block as a two-element array. Because of the assignment
+ * semantics of block parameters, these elements will be split out if the
+ * block has two formal parameters. Also see <code>Hash.each_pair</code>, which
+ * will be marginally more efficient for blocks with two parameters.
*
* h = { "a" => 100, "b" => 200 }
* h.each {|key, value| puts "#{key} is #{value}" }
@@ -1196,15 +1215,17 @@ each_pair_i(VALUE key, VALUE value)
*/
static VALUE
-rb_hash_each_pair(VALUE hash)
+rb_hash_each(hash)
+ VALUE hash;
{
RETURN_ENUMERATOR(hash, 0, 0);
- rb_hash_foreach(hash, each_pair_i, 0);
+ rb_hash_foreach(hash, each_i, 0);
return hash;
}
static int
-to_a_i(VALUE key, VALUE value, VALUE ary)
+to_a_i(key, value, ary)
+ VALUE key, value, ary;
{
if (key == Qundef) return ST_CONTINUE;
rb_ary_push(ary, rb_assoc_new(key, value));
@@ -1219,28 +1240,54 @@ to_a_i(VALUE key, VALUE value, VALUE ary)
* value</i> <code>]</code> arrays.
*
* h = { "c" => 300, "a" => 100, "d" => 400, "c" => 300 }
- * h.to_a #=> [["c", 300], ["a", 100], ["d", 400]]
+ * h.to_a #=> [["a", 100], ["c", 300], ["d", 400]]
*/
static VALUE
-rb_hash_to_a(VALUE hash)
+rb_hash_to_a(hash)
+ VALUE hash;
{
VALUE ary;
ary = rb_ary_new();
rb_hash_foreach(hash, to_a_i, ary);
- OBJ_INFECT(ary, hash);
+ if (OBJ_TAINTED(hash)) OBJ_TAINT(ary);
return ary;
}
+/*
+ * call-seq:
+ * hsh.sort => array
+ * hsh.sort {| a, b | block } => array
+ *
+ * Converts <i>hsh</i> to a nested array of <code>[</code> <i>key,
+ * value</i> <code>]</code> arrays and sorts it, using
+ * <code>Array#sort</code>.
+ *
+ * h = { "a" => 20, "b" => 30, "c" => 10 }
+ * h.sort #=> [["a", 20], ["b", 30], ["c", 10]]
+ * h.sort {|a,b| a[1]<=>b[1]} #=> [["c", 10], ["a", 20], ["b", 30]]
+ *
+ */
+
+static VALUE
+rb_hash_sort(hash)
+ VALUE hash;
+{
+ VALUE entries = rb_hash_to_a(hash);
+ rb_ary_sort_bang(entries);
+ return entries;
+}
+
static int
-inspect_i(VALUE key, VALUE value, VALUE str)
+inspect_i(key, value, str)
+ VALUE key, value, str;
{
VALUE str2;
if (key == Qundef) return ST_CONTINUE;
- if (RSTRING_LEN(str) > 1) {
+ if (RSTRING(str)->len > 1) {
rb_str_cat2(str, ", ");
}
str2 = rb_inspect(key);
@@ -1255,11 +1302,11 @@ inspect_i(VALUE key, VALUE value, VALUE str)
}
static VALUE
-inspect_hash(VALUE hash, VALUE dummy, int recur)
+inspect_hash(hash)
+ VALUE hash;
{
VALUE str;
- if (recur) return rb_usascii_str_new2("{...}");
str = rb_str_buf_new2("{");
rb_hash_foreach(hash, inspect_i, str);
rb_str_buf_cat2(str, "}");
@@ -1270,21 +1317,47 @@ inspect_hash(VALUE hash, VALUE dummy, int recur)
/*
* call-seq:
- * hsh.to_s => string
* hsh.inspect => string
*
* Return the contents of this hash as a string.
+ */
+
+static VALUE
+rb_hash_inspect(hash)
+ VALUE hash;
+{
+ if (RHASH(hash)->tbl == 0 || RHASH(hash)->tbl->num_entries == 0)
+ return rb_str_new2("{}");
+ if (rb_inspecting_p(hash)) return rb_str_new2("{...}");
+ return rb_protect_inspect(inspect_hash, hash, 0);
+}
+
+static VALUE
+to_s_hash(hash)
+ VALUE hash;
+{
+ return rb_ary_to_s(rb_hash_to_a(hash));
+}
+
+/*
+ * call-seq:
+ * hsh.to_s => string
+ *
+ * Converts <i>hsh</i> to a string by converting the hash to an array
+ * of <code>[</code> <i>key, value</i> <code>]</code> pairs and then
+ * converting that array to a string using <code>Array#join</code> with
+ * the default separator.
*
* h = { "c" => 300, "a" => 100, "d" => 400, "c" => 300 }
- * h.to_s #=> "{\"c\"=>300, \"a\"=>100, \"d\"=>400}"
+ * h.to_s #=> "a100c300d400"
*/
static VALUE
-rb_hash_inspect(VALUE hash)
+rb_hash_to_s(hash)
+ VALUE hash;
{
- if (RHASH_EMPTY_P(hash))
- return rb_usascii_str_new2("{}");
- return rb_exec_recursive(inspect_hash, hash, 0);
+ if (rb_inspecting_p(hash)) return rb_str_new2("{...}");
+ return rb_protect_inspect(to_s_hash, hash, 0);
}
/*
@@ -1295,13 +1368,15 @@ rb_hash_inspect(VALUE hash)
*/
static VALUE
-rb_hash_to_hash(VALUE hash)
+rb_hash_to_hash(hash)
+ VALUE hash;
{
return hash;
}
static int
-keys_i(VALUE key, VALUE value, VALUE ary)
+keys_i(key, value, ary)
+ VALUE key, value, ary;
{
if (key == Qundef) return ST_CONTINUE;
rb_ary_push(ary, key);
@@ -1321,7 +1396,8 @@ keys_i(VALUE key, VALUE value, VALUE ary)
*/
static VALUE
-rb_hash_keys(VALUE hash)
+rb_hash_keys(hash)
+ VALUE hash;
{
VALUE ary;
@@ -1332,7 +1408,8 @@ rb_hash_keys(VALUE hash)
}
static int
-values_i(VALUE key, VALUE value, VALUE ary)
+values_i(key, value, ary)
+ VALUE key, value, ary;
{
if (key == Qundef) return ST_CONTINUE;
rb_ary_push(ary, value);
@@ -1352,7 +1429,8 @@ values_i(VALUE key, VALUE value, VALUE ary)
*/
static VALUE
-rb_hash_values(VALUE hash)
+rb_hash_values(hash)
+ VALUE hash;
{
VALUE ary;
@@ -1378,21 +1456,20 @@ rb_hash_values(VALUE hash)
*/
static VALUE
-rb_hash_has_key(VALUE hash, VALUE key)
+rb_hash_has_key(hash, key)
+ VALUE hash;
+ VALUE key;
{
- if (!RHASH(hash)->ntbl)
- return Qfalse;
- if (st_lookup(RHASH(hash)->ntbl, key, 0)) {
+ if (st_lookup(RHASH(hash)->tbl, key, 0)) {
return Qtrue;
}
return Qfalse;
}
static int
-rb_hash_search_value(VALUE key, VALUE value, VALUE arg)
+rb_hash_search_value(key, value, data)
+ VALUE key, value, *data;
{
- VALUE *data = (VALUE *)arg;
-
if (key == Qundef) return ST_CONTINUE;
if (rb_equal(value, data[1])) {
data[0] = Qtrue;
@@ -1415,26 +1492,30 @@ rb_hash_search_value(VALUE key, VALUE value, VALUE arg)
*/
static VALUE
-rb_hash_has_value(VALUE hash, VALUE val)
+rb_hash_has_value(hash, val)
+ VALUE hash;
+ VALUE val;
{
VALUE data[2];
data[0] = Qfalse;
data[1] = val;
- rb_hash_foreach(hash, rb_hash_search_value, (VALUE)data);
+ rb_hash_foreach(hash, rb_hash_search_value, (st_data_t)data);
return data[0];
}
struct equal_data {
- VALUE result;
+ int result;
st_table *tbl;
int eql;
};
static int
-eql_i(VALUE key, VALUE val1, VALUE arg)
+eql_i(key, val1, data)
+ VALUE key;
+ VALUE val1;
+ struct equal_data *data;
{
- struct equal_data *data = (struct equal_data *)arg;
VALUE val2;
if (key == Qundef) return ST_CONTINUE;
@@ -1442,28 +1523,34 @@ eql_i(VALUE key, VALUE val1, VALUE arg)
data->result = Qfalse;
return ST_STOP;
}
- if (!(data->eql ? rb_eql(val1, val2) : (int)rb_equal(val1, val2))) {
+ if (!(data->eql ? rb_eql(val1, val2) : rb_equal(val1, val2))) {
data->result = Qfalse;
return ST_STOP;
}
return ST_CONTINUE;
}
+static VALUE recursive_eql _((VALUE, VALUE, int));
static VALUE
-recursive_eql(VALUE hash, VALUE dt, int recur)
+recursive_eql(hash, dt, recur)
+ VALUE hash;
+ VALUE dt;
+ int recur;
{
struct equal_data *data;
- if (recur) return Qtrue; /* Subtle! */
+ if (recur) return Qfalse;
data = (struct equal_data*)dt;
data->result = Qtrue;
- rb_hash_foreach(hash, eql_i, dt);
+ rb_hash_foreach(hash, eql_i, (st_data_t)data);
return data->result;
}
static VALUE
-hash_equal(VALUE hash1, VALUE hash2, int eql)
+hash_equal(hash1, hash2, eql)
+ VALUE hash1, hash2;
+ int eql; /* compare default value if true */
{
struct equal_data data;
@@ -1472,26 +1559,19 @@ hash_equal(VALUE hash1, VALUE hash2, int eql)
if (!rb_respond_to(hash2, rb_intern("to_hash"))) {
return Qfalse;
}
- if (eql)
- return rb_eql(hash2, hash1);
- else
- return rb_equal(hash2, hash1);
+ return rb_equal(hash2, hash1);
}
- if (RHASH_SIZE(hash1) != RHASH_SIZE(hash2))
+ if (RHASH(hash1)->tbl->num_entries != RHASH(hash2)->tbl->num_entries)
return Qfalse;
- 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(hash1)->ifnone, RHASH(hash2)->ifnone) &&
- FL_TEST(hash1, HASH_PROC_DEFAULT) == FL_TEST(hash2, HASH_PROC_DEFAULT)))
- return Qfalse;
-#endif
+ if (eql) {
+ if (!(rb_equal(RHASH(hash1)->ifnone, RHASH(hash2)->ifnone) &&
+ FL_TEST(hash1, HASH_PROC_DEFAULT) == FL_TEST(hash2, HASH_PROC_DEFAULT)))
+ return Qfalse;
+ }
- data.tbl = RHASH(hash2)->ntbl;
+ data.tbl = RHASH(hash2)->tbl;
data.eql = eql;
- return rb_exec_recursive_paired(recursive_eql, hash1, hash2, (VALUE)&data);
+ return rb_exec_recursive(recursive_eql, hash1, (VALUE)&data);
}
/*
@@ -1514,66 +1594,76 @@ hash_equal(VALUE hash1, VALUE hash2, int eql)
*/
static VALUE
-rb_hash_equal(VALUE hash1, VALUE hash2)
+rb_hash_equal(hash1, hash2)
+ VALUE hash1, hash2;
{
return hash_equal(hash1, hash2, Qfalse);
}
-/*
- * call-seq:
- * hash.eql?(other) -> true or false
- *
- * Returns <code>true</code> if <i>hash</i> and <i>other</i> are
- * both hashes with the same content.
- */
-
-static VALUE
-rb_hash_eql(VALUE hash1, VALUE hash2)
-{
- return hash_equal(hash1, hash2, Qtrue);
-}
-
static int
-hash_i(VALUE key, VALUE val, VALUE arg)
+hash_i(key, val, hval)
+ VALUE key;
+ VALUE val;
+ int *hval;
{
- VALUE *hval = (VALUE *)arg;
-
if (key == Qundef) return ST_CONTINUE;
- *hval ^= rb_hash_end(rb_hash_uint(rb_hash_start(rb_hash(key)), rb_hash(val)));
+ *hval ^= rb_hash(key);
+ *hval ^= rb_hash(val);
return ST_CONTINUE;
}
+static VALUE recursive_hash _((VALUE, VALUE, int));
static VALUE
-recursive_hash(VALUE hash, VALUE dummy, int recur)
+recursive_hash(hash, dummy, recur)
+ VALUE hash;
+ VALUE dummy;
+ int recur;
{
- VALUE hval;
+ int hval;
if (recur) {
- rb_raise(rb_eArgError, "recursive key for hash");
+ return LONG2FIX(0);
}
- if (!RHASH(hash)->ntbl)
- return LONG2FIX(0);
- hval = RHASH(hash)->ntbl->num_entries;
- rb_hash_foreach(hash, hash_i, (VALUE)&hval);
+ hval = RHASH(hash)->tbl->num_entries;
+ rb_hash_foreach(hash, hash_i, (st_data_t)&hval);
return INT2FIX(hval);
}
/*
* call-seq:
- * hsh.hash -> fixnum
+ * array.hash -> fixnum
*
- * Compute a hash-code for this hash. Two hashes with the same content
+ * Compute a hash-code for this array. Two arrays with the same content
* will have the same hash code (and will compare using <code>eql?</code>).
*/
static VALUE
-rb_hash_hash(VALUE hash)
+rb_hash_hash(hash)
+ VALUE hash;
{
return rb_exec_recursive(recursive_hash, hash, 0);
}
+
+/*
+ * call-seq:
+ * hash.eql?(other) -> true or false
+ *
+ * Returns <code>true</code> if <i>hash</i> and <i>other</i> are
+ * both hashes with the same content.
+ */
+
+static VALUE
+rb_hash_eql(hash1, hash2)
+ VALUE hash1, hash2;
+{
+ return hash_equal(hash1, hash2, Qtrue);
+}
+
static int
-rb_hash_invert_i(VALUE key, VALUE value, VALUE hash)
+rb_hash_invert_i(key, value, hash)
+ VALUE key, value;
+ VALUE hash;
{
if (key == Qundef) return ST_CONTINUE;
rb_hash_aset(hash, value, key);
@@ -1588,12 +1678,13 @@ rb_hash_invert_i(VALUE key, VALUE value, VALUE hash)
* the keys as values.
*
* h = { "n" => 100, "m" => 100, "y" => 300, "d" => 200, "a" => 0 }
- * h.invert #=> {0=>"a", 100=>"m", 200=>"d", 300=>"y"}
+ * h.invert #=> {0=>"a", 100=>"n", 200=>"d", 300=>"y"}
*
*/
static VALUE
-rb_hash_invert(VALUE hash)
+rb_hash_invert(hash)
+ VALUE hash;
{
VALUE h = rb_hash_new();
@@ -1602,21 +1693,25 @@ rb_hash_invert(VALUE hash)
}
static int
-rb_hash_update_i(VALUE key, VALUE value, VALUE hash)
+rb_hash_update_i(key, value, hash)
+ VALUE key, value;
+ VALUE hash;
{
if (key == Qundef) return ST_CONTINUE;
- st_insert(RHASH(hash)->ntbl, key, value);
+ rb_hash_aset(hash, key, value);
return ST_CONTINUE;
}
static int
-rb_hash_update_block_i(VALUE key, VALUE value, VALUE hash)
+rb_hash_update_block_i(key, value, hash)
+ VALUE key, value;
+ VALUE hash;
{
if (key == Qundef) return ST_CONTINUE;
if (rb_hash_has_key(hash, key)) {
value = rb_yield_values(3, key, rb_hash_aref(hash, key), value);
}
- st_insert(RHASH(hash)->ntbl, key, value);
+ rb_hash_aset(hash, key, value);
return ST_CONTINUE;
}
@@ -1644,9 +1739,9 @@ rb_hash_update_block_i(VALUE key, VALUE value, VALUE hash)
*/
static VALUE
-rb_hash_update(VALUE hash1, VALUE hash2)
+rb_hash_update(hash1, hash2)
+ VALUE hash1, hash2;
{
- rb_hash_modify(hash1);
hash2 = to_hash(hash2);
if (rb_block_given_p()) {
rb_hash_foreach(hash2, rb_hash_update_block_i, hash1);
@@ -1674,162 +1769,12 @@ rb_hash_update(VALUE hash1, VALUE hash2)
*/
static VALUE
-rb_hash_merge(VALUE hash1, VALUE hash2)
+rb_hash_merge(hash1, hash2)
+ VALUE hash1, hash2;
{
return rb_hash_update(rb_obj_dup(hash1), hash2);
}
-static int
-assoc_i(VALUE key, VALUE val, VALUE arg)
-{
- VALUE *args = (VALUE *)arg;
-
- if (key == Qundef) return ST_CONTINUE;
- if (RTEST(rb_equal(args[0], key))) {
- args[1] = rb_assoc_new(key, val);
- return ST_STOP;
- }
- return ST_CONTINUE;
-}
-
-/*
- * call-seq:
- * hash.assoc(obj) -> an_array or nil
- *
- * 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 <code>Array#assoc</code>.
- *
- * h = {"colors" => ["red", "blue", "green"],
- * "letters" => ["a", "b", "c" ]}
- * h.assoc("letters") #=> ["letters", ["a", "b", "c"]]
- * h.assoc("foo") #=> nil
- */
-
-VALUE
-rb_hash_assoc(VALUE hash, VALUE obj)
-{
- VALUE args[2];
-
- args[0] = obj;
- args[1] = Qnil;
- rb_hash_foreach(hash, assoc_i, (VALUE)args);
- return args[1];
-}
-
-static int
-rassoc_i(VALUE key, VALUE val, VALUE arg)
-{
- VALUE *args = (VALUE *)arg;
-
- if (key == Qundef) return ST_CONTINUE;
- if (RTEST(rb_equal(args[0], val))) {
- args[1] = rb_assoc_new(key, val);
- return ST_STOP;
- }
- return ST_CONTINUE;
-}
-
-/*
- * call-seq:
- * hash.rassoc(key) -> an_array or nil
- *
- * Searches through the hash comparing _obj_ with the value using <code>==</code>.
- * Returns the first key-value pair (two elements array) that matches. See
- * also <code>Array#rassoc</code>.
- *
- * a = {1=> "one", 2 => "two", 3 => "three", "ii" => "two"}
- * a.rassoc("two") #=> [2, "two"]
- * a.rassoc("four") #=> nil
- */
-
-VALUE
-rb_hash_rassoc(VALUE hash, VALUE obj)
-{
- VALUE args[2];
-
- args[0] = obj;
- args[1] = Qnil;
- rb_hash_foreach(hash, rassoc_i, (VALUE)args);
- return args[1];
-}
-
-/*
- * call-seq:
- * hash.flatten -> an_array
- * hash.flatten(level) -> an_array
- *
- * Returns a new array that is a one-dimensional flattening of this
- * hash. That is, for every key or value that is an array, extract
- * its elements into the new array. Unlike Array#flatten, this
- * method does not flatten recursively by default. If the optional
- * <i>level</i> argument determines the level of recursion to flatten.
- *
- * a = {1=> "one", 2 => [2,"two"], 3 => "three"}
- * a.flatten # => [1, "one", 2, [2, "two"], 3, "three"]
- * a.flatten(2) # => [1, "one", 2, 2, "two", 3, "three"]
- */
-
-static VALUE
-rb_hash_flatten(int argc, VALUE *argv, VALUE hash)
-{
- VALUE ary, tmp;
-
- ary = rb_hash_to_a(hash);
- if (argc == 0) {
- argc = 1;
- tmp = INT2FIX(1);
- argv = &tmp;
- }
- rb_funcall2(ary, rb_intern("flatten!"), argc, argv);
- return ary;
-}
-
-/*
- * call-seq:
- * hsh.compare_by_identity => hsh
- *
- * Makes <i>hsh</i> to compare its keys by their identity, i.e. it
- * will consider exact same objects as same keys.
- *
- * h1 = { "a" => 100, "b" => 200, :c => "c" }
- * h1["a"] #=> 100
- * h1.compare_by_identity
- * h1.compare_by_identity? #=> true
- * h1["a"] #=> nil # different objects.
- * h1[:c] #=> "c" # same symbols are all same.
- *
- */
-
-static VALUE
-rb_hash_compare_by_id(VALUE hash)
-{
- rb_hash_modify(hash);
- RHASH(hash)->ntbl->type = &identhash;
- rb_hash_rehash(hash);
- return hash;
-}
-
-/*
- * call-seq:
- * hsh.compare_by_identity? => true or false
- *
- * Returns <code>true</code> if <i>hsh</i> will compare its keys by
- * their identity. Also see <code>Hash#compare_by_identity</code>.
- *
- */
-
-static VALUE
-rb_hash_compare_by_id_p(VALUE hash)
-{
- if (!RHASH(hash)->ntbl)
- return Qfalse;
- if (RHASH(hash)->ntbl->type == &identhash) {
- return Qtrue;
- }
- return Qfalse;
-}
-
static int path_tainted = -1;
static char **origenviron;
@@ -1849,39 +1794,36 @@ extern char **environ;
#define GET_ENVIRON(e) (e)
#define FREE_ENVIRON(e)
#endif
-#ifdef ENV_IGNORECASE
-#define ENVMATCH(s1, s2) (STRCASECMP(s1, s2) == 0)
-#define ENVNMATCH(s1, s2, n) (STRNCASECMP(s1, s2, n) == 0)
-#else
-#define ENVMATCH(n1, n2) (strcmp(n1, n2) == 0)
-#define ENVNMATCH(s1, s2, n) (memcmp(s1, s2, n) == 0)
-#endif
static VALUE
-env_str_new(const char *ptr, long len)
+env_str_new(ptr, len)
+ const char *ptr;
+ long len;
{
- VALUE str = rb_locale_str_new(ptr, len);
+ VALUE str = rb_tainted_str_new(ptr, len);
rb_obj_freeze(str);
return str;
}
static VALUE
-env_str_new2(const char *ptr)
+env_str_new2(ptr)
+ const char *ptr;
{
if (!ptr) return Qnil;
return env_str_new(ptr, strlen(ptr));
}
static VALUE
-env_delete(VALUE obj, VALUE name)
+env_delete(obj, name)
+ VALUE obj, name;
{
char *nam, *val;
rb_secure(4);
SafeStringValue(name);
- nam = RSTRING_PTR(name);
- if (memchr(nam, '\0', RSTRING_LEN(name))) {
+ nam = RSTRING(name)->ptr;
+ if (strlen(nam) != RSTRING(name)->len) {
rb_raise(rb_eArgError, "bad environment variable name");
}
val = getenv(nam);
@@ -1889,7 +1831,12 @@ env_delete(VALUE obj, VALUE name)
VALUE value = env_str_new2(val);
ruby_setenv(nam, 0);
- if (ENVMATCH(nam, PATH_ENV)) {
+#ifdef ENV_IGNORECASE
+ if (strcasecmp(nam, PATH_ENV) == 0)
+#else
+ if (strcmp(nam, PATH_ENV) == 0)
+#endif
+ {
path_tainted = 0;
}
return value;
@@ -1898,7 +1845,8 @@ env_delete(VALUE obj, VALUE name)
}
static VALUE
-env_delete_m(VALUE obj, VALUE name)
+env_delete_m(obj, name)
+ VALUE obj, name;
{
VALUE val;
@@ -1908,19 +1856,25 @@ env_delete_m(VALUE obj, VALUE name)
}
static VALUE
-rb_f_getenv(VALUE obj, VALUE name)
+rb_f_getenv(obj, name)
+ VALUE obj, name;
{
char *nam, *env;
rb_secure(4);
SafeStringValue(name);
- nam = RSTRING_PTR(name);
- if (memchr(nam, '\0', RSTRING_LEN(name))) {
+ nam = RSTRING(name)->ptr;
+ if (strlen(nam) != RSTRING(name)->len) {
rb_raise(rb_eArgError, "bad environment variable name");
}
env = getenv(nam);
if (env) {
- if (ENVMATCH(nam, PATH_ENV) && !rb_env_path_tainted()) {
+#ifdef ENV_IGNORECASE
+ if (strcasecmp(nam, PATH_ENV) == 0 && !rb_env_path_tainted())
+#else
+ if (strcmp(nam, PATH_ENV) == 0 && !rb_env_path_tainted())
+#endif
+ {
VALUE str = rb_str_new2(env);
rb_obj_freeze(str);
@@ -1932,7 +1886,9 @@ rb_f_getenv(VALUE obj, VALUE name)
}
static VALUE
-env_fetch(int argc, VALUE *argv)
+env_fetch(argc, argv)
+ int argc;
+ VALUE *argv;
{
VALUE key, if_none;
long block_given;
@@ -1945,31 +1901,36 @@ env_fetch(int argc, VALUE *argv)
rb_warn("block supersedes default value argument");
}
SafeStringValue(key);
- nam = RSTRING_PTR(key);
- if (memchr(nam, '\0', RSTRING_LEN(key))) {
+ nam = RSTRING(key)->ptr;
+ if (strlen(nam) != RSTRING(key)->len) {
rb_raise(rb_eArgError, "bad environment variable name");
}
env = getenv(nam);
if (!env) {
if (block_given) return rb_yield(key);
if (argc == 1) {
- rb_raise(rb_eKeyError, "key not found");
+ rb_raise(rb_eIndexError, "key not found");
}
return if_none;
}
- if (ENVMATCH(nam, PATH_ENV) && !rb_env_path_tainted())
+#ifdef ENV_IGNORECASE
+ if (strcasecmp(nam, PATH_ENV) == 0 && !rb_env_path_tainted())
+#else
+ if (strcmp(nam, PATH_ENV) == 0 && !rb_env_path_tainted())
+#endif
return rb_str_new2(env);
return env_str_new2(env);
}
static void
-path_tainted_p(char *path)
+path_tainted_p(path)
+ char *path;
{
path_tainted = rb_path_check(path)?0:1;
}
int
-rb_env_path_tainted(void)
+rb_env_path_tainted()
{
if (path_tainted < 0) {
path_tainted_p(getenv(PATH_ENV));
@@ -1979,14 +1940,21 @@ rb_env_path_tainted(void)
#if !defined(_WIN32) && !(defined(HAVE_SETENV) && defined(HAVE_UNSETENV))
static int
-envix(const char *nam)
+envix(nam)
+ const char *nam;
{
register int i, len = strlen(nam);
char **env;
env = GET_ENVIRON(environ);
for (i = 0; env[i]; i++) {
- if (ENVNMATCH(env[i],nam,len) && env[i][len] == '=')
+ if (
+#ifdef ENV_IGNORECASE
+ strncasecmp(env[i],nam,len) == 0
+#else
+ memcmp(env[i],nam,len) == 0
+#endif
+ && env[i][len] == '=')
break; /* memcmp must come first to avoid */
} /* potential SEGV's */
FREE_ENVIRON(environ);
@@ -1995,7 +1963,9 @@ envix(const char *nam)
#endif
void
-ruby_setenv(const char *name, const char *value)
+ruby_setenv(name, value)
+ const char *name;
+ const char *value;
{
#if defined(_WIN32)
/* The sane way to deal with the environment.
@@ -2043,7 +2013,7 @@ ruby_setenv(const char *name, const char *value)
char **envp = origenviron;
while (*envp && *envp != environ[i]) envp++;
if (!*envp)
- xfree(environ[i]);
+ free(environ[i]);
if (!value) {
while (environ[i]) {
environ[i] = environ[i+1];
@@ -2059,18 +2029,31 @@ ruby_setenv(const char *name, const char *value)
}
len = strlen(name) + strlen(value) + 2;
environ[i] = ALLOC_N(char, len);
+#ifndef MSDOS
snprintf(environ[i],len,"%s=%s",name,value); /* all that work just for this */
+#else
+ /* MS-DOS requires environment variable names to be in uppercase */
+ /* [Tom Dinger, 27 August 1990: Well, it doesn't _require_ it, but
+ * some utilities and applications may break because they only look
+ * for upper case strings. (Fixed strupr() bug here.)]
+ */
+ strcpy(environ[i],name); strupr(environ[i]);
+ sprintf(environ[i] + strlen(name),"=%s", value);
+#endif /* MSDOS */
+
#endif /* WIN32 */
}
void
-ruby_unsetenv(const char *name)
+ruby_unsetenv(name)
+ const char *name;
{
ruby_setenv(name, 0);
}
static VALUE
-env_aset(VALUE obj, VALUE nm, VALUE val)
+env_aset(obj, nm, val)
+ VALUE obj, nm, val;
{
char *name, *value;
@@ -2082,17 +2065,22 @@ env_aset(VALUE obj, VALUE nm, VALUE val)
env_delete(obj, nm);
return Qnil;
}
+
StringValue(nm);
StringValue(val);
- name = RSTRING_PTR(nm);
- value = RSTRING_PTR(val);
- if (memchr(name, '\0', RSTRING_LEN(nm)))
+ name = RSTRING(nm)->ptr;
+ value = RSTRING(val)->ptr;
+ if (strlen(name) != RSTRING(nm)->len)
rb_raise(rb_eArgError, "bad environment variable name");
- if (memchr(value, '\0', RSTRING_LEN(val)))
+ if (strlen(value) != RSTRING(val)->len)
rb_raise(rb_eArgError, "bad environment variable value");
ruby_setenv(name, value);
- if (ENVMATCH(name, PATH_ENV)) {
+#ifdef ENV_IGNORECASE
+ if (strcasecmp(name, PATH_ENV) == 0) {
+#else
+ if (strcmp(name, PATH_ENV) == 0) {
+#endif
if (OBJ_TAINTED(val)) {
/* already tainted, no check */
path_tainted = 1;
@@ -2106,7 +2094,7 @@ env_aset(VALUE obj, VALUE nm, VALUE val)
}
static VALUE
-env_keys(void)
+env_keys()
{
char **env;
VALUE ary;
@@ -2126,21 +2114,22 @@ env_keys(void)
}
static VALUE
-env_each_key(VALUE ehash)
+env_each_key(ehash)
+ VALUE ehash;
{
VALUE keys;
long i;
RETURN_ENUMERATOR(ehash, 0, 0);
keys = env_keys(); /* rb_secure(4); */
- for (i=0; i<RARRAY_LEN(keys); i++) {
- rb_yield(RARRAY_PTR(keys)[i]);
+ for (i=0; i<RARRAY(keys)->len; i++) {
+ rb_yield(RARRAY(keys)->ptr[i]);
}
return ehash;
}
static VALUE
-env_values(void)
+env_values()
{
VALUE ary;
char **env;
@@ -2160,28 +2149,29 @@ env_values(void)
}
static VALUE
-env_each_value(VALUE ehash)
+env_each_value(ehash)
+ VALUE ehash;
{
VALUE values;
long i;
RETURN_ENUMERATOR(ehash, 0, 0);
values = env_values(); /* rb_secure(4); */
- for (i=0; i<RARRAY_LEN(values); i++) {
- rb_yield(RARRAY_PTR(values)[i]);
+ for (i=0; i<RARRAY(values)->len; i++) {
+ rb_yield(RARRAY(values)->ptr[i]);
}
return ehash;
}
static VALUE
-env_each_pair(VALUE ehash)
+env_each_i(ehash, values)
+ VALUE ehash;
+ int values;
{
char **env;
VALUE ary;
long i;
- RETURN_ENUMERATOR(ehash, 0, 0);
-
rb_secure(4);
ary = rb_ary_new();
env = GET_ENVIRON(environ);
@@ -2195,14 +2185,36 @@ env_each_pair(VALUE ehash)
}
FREE_ENVIRON(environ);
- for (i=0; i<RARRAY_LEN(ary); i+=2) {
- rb_yield(rb_assoc_new(RARRAY_PTR(ary)[i], RARRAY_PTR(ary)[i+1]));
+ for (i=0; i<RARRAY(ary)->len; i+=2) {
+ if (values) {
+ rb_yield_values(2, RARRAY(ary)->ptr[i], RARRAY(ary)->ptr[i+1]);
+ }
+ else {
+ rb_yield(rb_assoc_new(RARRAY(ary)->ptr[i], RARRAY(ary)->ptr[i+1]));
+ }
}
return ehash;
}
static VALUE
-env_reject_bang(VALUE ehash)
+env_each(ehash)
+ VALUE ehash;
+{
+ RETURN_ENUMERATOR(ehash, 0, 0);
+ return env_each_i(ehash, Qfalse);
+}
+
+static VALUE
+env_each_pair(ehash)
+ VALUE ehash;
+{
+ RETURN_ENUMERATOR(ehash, 0, 0);
+ return env_each_i(ehash, Qtrue);
+}
+
+static VALUE
+env_reject_bang(ehash)
+ VALUE ehash;
{
volatile VALUE keys;
long i;
@@ -2210,12 +2222,12 @@ env_reject_bang(VALUE ehash)
RETURN_ENUMERATOR(ehash, 0, 0);
keys = env_keys(); /* rb_secure(4); */
- for (i=0; i<RARRAY_LEN(keys); i++) {
- VALUE val = rb_f_getenv(Qnil, RARRAY_PTR(keys)[i]);
+ for (i=0; i<RARRAY(keys)->len; i++) {
+ VALUE val = rb_f_getenv(Qnil, RARRAY(keys)->ptr[i]);
if (!NIL_P(val)) {
- if (RTEST(rb_yield_values(2, RARRAY_PTR(keys)[i], val))) {
- FL_UNSET(RARRAY_PTR(keys)[i], FL_TAINT);
- env_delete(Qnil, RARRAY_PTR(keys)[i]);
+ if (RTEST(rb_yield_values(2, RARRAY(keys)->ptr[i], val))) {
+ FL_UNSET(RARRAY(keys)->ptr[i], FL_TAINT);
+ env_delete(Qnil, RARRAY(keys)->ptr[i]);
del++;
}
}
@@ -2225,7 +2237,8 @@ env_reject_bang(VALUE ehash)
}
static VALUE
-env_delete_if(VALUE ehash)
+env_delete_if(ehash)
+ VALUE ehash;
{
RETURN_ENUMERATOR(ehash, 0, 0);
env_reject_bang(ehash);
@@ -2233,7 +2246,9 @@ env_delete_if(VALUE ehash)
}
static VALUE
-env_values_at(int argc, VALUE *argv)
+env_values_at(argc, argv)
+ int argc;
+ VALUE *argv;
{
VALUE result;
long i;
@@ -2247,14 +2262,15 @@ env_values_at(int argc, VALUE *argv)
}
static VALUE
-env_select(VALUE ehash)
+env_select(ehash)
+ VALUE ehash;
{
VALUE result;
char **env;
RETURN_ENUMERATOR(ehash, 0, 0);
rb_secure(4);
- result = rb_hash_new();
+ result = rb_ary_new();
env = GET_ENVIRON(environ);
while (*env) {
char *s = strchr(*env, '=');
@@ -2262,7 +2278,7 @@ env_select(VALUE ehash)
VALUE k = env_str_new(*env, s-*env);
VALUE v = env_str_new2(s+1);
if (RTEST(rb_yield_values(2, k, v))) {
- rb_hash_aset(result, k, v);
+ rb_ary_push(result, rb_assoc_new(k, v));
}
}
env++;
@@ -2272,30 +2288,30 @@ env_select(VALUE ehash)
return result;
}
-VALUE
-rb_env_clear(void)
+static VALUE
+env_clear()
{
volatile VALUE keys;
long i;
keys = env_keys(); /* rb_secure(4); */
- for (i=0; i<RARRAY_LEN(keys); i++) {
- VALUE val = rb_f_getenv(Qnil, RARRAY_PTR(keys)[i]);
+ for (i=0; i<RARRAY(keys)->len; i++) {
+ VALUE val = rb_f_getenv(Qnil, RARRAY(keys)->ptr[i]);
if (!NIL_P(val)) {
- env_delete(Qnil, RARRAY_PTR(keys)[i]);
+ env_delete(Qnil, RARRAY(keys)->ptr[i]);
}
}
return envtbl;
}
static VALUE
-env_to_s(void)
+env_to_s()
{
- return rb_usascii_str_new2("ENV");
+ return rb_str_new2("ENV");
}
static VALUE
-env_inspect(void)
+env_inspect()
{
char **env;
VALUE str, i;
@@ -2326,7 +2342,7 @@ env_inspect(void)
}
static VALUE
-env_to_a(void)
+env_to_a()
{
char **env;
VALUE ary;
@@ -2347,13 +2363,13 @@ env_to_a(void)
}
static VALUE
-env_none(void)
+env_none()
{
return Qnil;
}
static VALUE
-env_size(void)
+env_size()
{
int i;
char **env;
@@ -2367,7 +2383,7 @@ env_size(void)
}
static VALUE
-env_empty_p(void)
+env_empty_p()
{
char **env;
@@ -2382,46 +2398,34 @@ env_empty_p(void)
}
static VALUE
-env_has_key(VALUE env, VALUE key)
+env_has_key(env, key)
+ VALUE env, key;
{
char *s;
rb_secure(4);
s = StringValuePtr(key);
- if (memchr(s, '\0', RSTRING_LEN(key)))
+ if (strlen(s) != RSTRING(key)->len)
rb_raise(rb_eArgError, "bad environment variable name");
if (getenv(s)) return Qtrue;
return Qfalse;
}
static VALUE
-env_assoc(VALUE env, VALUE key)
-{
- char *s, *e;
-
- rb_secure(4);
- s = StringValuePtr(key);
- if (memchr(s, '\0', RSTRING_LEN(key)))
- rb_raise(rb_eArgError, "bad environment variable name");
- e = getenv(s);
- if (e) return rb_assoc_new(key, rb_tainted_str_new2(e));
- return Qnil;
-}
-
-static VALUE
-env_has_value(VALUE dmy, VALUE obj)
+env_has_value(dmy, value)
+ VALUE dmy, value;
{
char **env;
rb_secure(4);
- obj = rb_check_string_type(obj);
- if (NIL_P(obj)) return Qnil;
+ value = rb_check_string_type(value);
+ if (NIL_P(value)) return Qfalse;
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) {
+ if (RSTRING(value)->len == len && strncmp(s, RSTRING(value)->ptr, len) == 0) {
FREE_ENVIRON(environ);
return Qtrue;
}
@@ -2433,22 +2437,23 @@ env_has_value(VALUE dmy, VALUE obj)
}
static VALUE
-env_rassoc(VALUE dmy, VALUE obj)
+env_index(dmy, value)
+ VALUE dmy, value;
{
char **env;
+ VALUE str;
rb_secure(4);
- obj = rb_check_string_type(obj);
- if (NIL_P(obj)) return Qnil;
+ StringValue(value);
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_tainted_str_new(*env, s-*env-1), obj);
+ if (RSTRING(value)->len == len && strncmp(s, RSTRING(value)->ptr, len) == 0) {
+ str = env_str_new(*env, s-*env-1);
FREE_ENVIRON(environ);
- return result;
+ return str;
}
}
env++;
@@ -2458,39 +2463,32 @@ env_rassoc(VALUE dmy, VALUE obj)
}
static VALUE
-env_key(VALUE dmy, VALUE value)
+env_indexes(argc, argv)
+ int argc;
+ VALUE *argv;
{
- char **env;
- VALUE str;
+ int i;
+ VALUE indexes = rb_ary_new2(argc);
+ rb_warn("ENV.%s is deprecated; use ENV.values_at",
+ rb_id2name(rb_frame_last_func()));
rb_secure(4);
- StringValue(value);
- env = GET_ENVIRON(environ);
- while (*env) {
- char *s = strchr(*env, '=');
- if (s++) {
- long len = strlen(s);
- if (RSTRING_LEN(value) == len && strncmp(s, RSTRING_PTR(value), len) == 0) {
- str = env_str_new(*env, s-*env-1);
- FREE_ENVIRON(environ);
- return str;
- }
+ for (i=0;i<argc;i++) {
+ VALUE tmp = rb_check_string_type(argv[i]);
+ if (NIL_P(tmp)) {
+ RARRAY(indexes)->ptr[i] = Qnil;
}
- env++;
+ else {
+ RARRAY(indexes)->ptr[i] = env_str_new2(getenv(RSTRING(tmp)->ptr));
+ }
+ RARRAY(indexes)->len = i+1;
}
- FREE_ENVIRON(environ);
- return Qnil;
-}
-static VALUE
-env_index(VALUE dmy, VALUE value)
-{
- rb_warn("ENV.index is deprecated; use ENV.key");
- return env_key(dmy, value);
+ return indexes;
}
static VALUE
-env_to_hash(void)
+env_to_hash()
{
char **env;
VALUE hash;
@@ -2511,13 +2509,13 @@ env_to_hash(void)
}
static VALUE
-env_reject(void)
+env_reject()
{
return rb_hash_delete_if(env_to_hash());
}
static VALUE
-env_shift(void)
+env_shift()
{
char **env;
@@ -2527,7 +2525,7 @@ env_shift(void)
char *s = strchr(*env, '=');
if (s) {
VALUE key = env_str_new(*env, s-*env);
- VALUE val = env_str_new2(getenv(RSTRING_PTR(key)));
+ VALUE val = env_str_new2(getenv(RSTRING(key)->ptr));
env_delete(Qnil, key);
return rb_assoc_new(key, val);
}
@@ -2537,13 +2535,14 @@ env_shift(void)
}
static VALUE
-env_invert(void)
+env_invert()
{
return rb_hash_invert(env_to_hash());
}
static int
-env_replace_i(VALUE key, VALUE val, VALUE keys)
+env_replace_i(key, val, keys)
+ VALUE key, val, keys;
{
if (key != Qundef) {
env_aset(Qnil, key, val);
@@ -2555,7 +2554,8 @@ env_replace_i(VALUE key, VALUE val, VALUE keys)
}
static VALUE
-env_replace(VALUE env, VALUE hash)
+env_replace(env, hash)
+ VALUE env, hash;
{
volatile VALUE keys;
long i;
@@ -2565,14 +2565,15 @@ env_replace(VALUE env, VALUE hash)
hash = to_hash(hash);
rb_hash_foreach(hash, env_replace_i, keys);
- for (i=0; i<RARRAY_LEN(keys); i++) {
- env_delete(env, RARRAY_PTR(keys)[i]);
+ for (i=0; i<RARRAY(keys)->len; i++) {
+ env_delete(env, RARRAY(keys)->ptr[i]);
}
return env;
}
static int
-env_update_i(VALUE key, VALUE val)
+env_update_i(key, val)
+ VALUE key, val;
{
if (key != Qundef) {
if (rb_block_given_p()) {
@@ -2584,7 +2585,8 @@ env_update_i(VALUE key, VALUE val)
}
static VALUE
-env_update(VALUE env, VALUE hash)
+env_update(env, hash)
+ VALUE env, hash;
{
rb_secure(4);
if (env == hash) return env;
@@ -2604,16 +2606,45 @@ env_update(VALUE env, VALUE hash)
* keys that do not exist in the hash. By default, that value is
* <code>nil</code>.
*
+ * <code>Hash</code> uses <code>key.eql?</code> to test keys for equality.
+ * If you need to use instances of your own classes as keys in a <code>Hash</code>,
+ * it is recommended that you define both the <code>eql?</code> and <code>hash</code>
+ * methods. The <code>hash</code> method must have the property that
+ * <code>a.eql?(b)</code> implies <code>a.hash == b.hash</code>.
+ *
+ * class MyClass
+ * attr_reader :str
+ * def initialize(str)
+ * @str = str
+ * end
+ * def eql?(o)
+ * o.is_a?(MyClass) && str == o.str
+ * end
+ * def hash
+ * @str.hash
+ * end
+ * end
+ *
+ * a = MyClass.new("some string")
+ * b = MyClass.new("some string")
+ * a.eql? b #=> true
+ *
+ * h = {}
+ *
+ * h[a] = 1
+ * h[a] #=> 1
+ * h[b] #=> 1
+ *
+ * h[b] = 2
+ * h[a] #=> 2
+ * h[b] #=> 2
*/
void
-Init_Hash(void)
+Init_Hash()
{
-#undef rb_intern
-#define rb_intern(str) rb_intern_const(str)
-
id_hash = rb_intern("hash");
- id_yield = rb_intern("yield");
+ id_call = rb_intern("call");
id_default = rb_intern("default");
rb_cHash = rb_define_class("Hash", rb_cObject);
@@ -2622,37 +2653,37 @@ Init_Hash(void)
rb_define_alloc_func(rb_cHash, 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_a", rb_hash_to_a, 0);
+ rb_define_method(rb_cHash,"to_s", rb_hash_to_s, 0);
rb_define_method(rb_cHash,"inspect", rb_hash_inspect, 0);
- rb_define_alias(rb_cHash, "to_s", "inspect");
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,"fetch", rb_hash_fetch, -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,"indexes", rb_hash_indexes, -1);
+ rb_define_method(rb_cHash,"indices", rb_hash_indexes, -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", rb_hash_each, 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,"sort", rb_hash_sort, 0);
rb_define_method(rb_cHash,"keys", rb_hash_keys, 0);
rb_define_method(rb_cHash,"values", rb_hash_values, 0);
@@ -2670,9 +2701,6 @@ Init_Hash(void)
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,"include?", rb_hash_has_key, 1);
rb_define_method(rb_cHash,"member?", rb_hash_has_key, 1);
@@ -2681,9 +2709,7 @@ Init_Hash(void)
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);
-
+#ifndef __MACOS__ /* environment variables nothing on MacOS. */
origenviron = environ;
envtbl = rb_obj_alloc(rb_cObject);
rb_extend_object(envtbl, rb_mEnumerable);
@@ -2692,13 +2718,13 @@ Init_Hash(void)
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", env_each, 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,"clear", rb_env_clear, 0);
+ 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);
@@ -2710,8 +2736,9 @@ Init_Hash(void)
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,"indexes", env_indexes, -1);
+ rb_define_singleton_method(envtbl,"indices", env_indexes, -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);
@@ -2725,8 +2752,10 @@ Init_Hash(void)
rb_define_singleton_method(envtbl,"key?", env_has_key, 1);
rb_define_singleton_method(envtbl,"value?", env_has_value, 1);
rb_define_singleton_method(envtbl,"to_hash", env_to_hash, 0);
- rb_define_singleton_method(envtbl,"assoc", env_assoc, 1);
- rb_define_singleton_method(envtbl,"rassoc", env_rassoc, 1);
rb_define_global_const("ENV", envtbl);
+#else /* __MACOS__ */
+ envtbl = rb_hash_s_new(0, NULL, rb_cHash);
+ rb_define_global_const("ENV", envtbl);
+#endif /* ifndef __MACOS__ environment variables nothing on MacOS. */
}
diff --git a/ia64.s b/ia64.s
index 92415b4e97..ba5241daf2 100644
--- a/ia64.s
+++ b/ia64.s
@@ -6,15 +6,6 @@
// 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
diff --git a/id.c b/id.c
deleted file mode 100644
index 4fd760af03..0000000000
--- a/id.c
+++ /dev/null
@@ -1,49 +0,0 @@
-/**********************************************************************
-
- id.c -
-
- $Author$
- created at: Thu Jul 12 04:37:51 2007
-
- Copyright (C) 2004-2007 Koichi Sasada
-
-**********************************************************************/
-
-#include "ruby/ruby.h"
-
-#include "id.h"
-
-static void
-Init_id(void)
-{
-#undef rb_intern
-#define rb_intern(str) rb_intern_const(str)
- rb_encoding *enc = rb_usascii_encoding();
-
- REGISTER_SYMID(idNULL, "");
- REGISTER_SYMID(idIFUNC, "<IFUNC>");
- REGISTER_SYMID(idCFUNC, "<CFUNC>");
- REGISTER_SYMID(idRespond_to, "respond_to?");
-
- REGISTER_SYMID(id_core_set_method_alias, "core#set_method_alias");
- REGISTER_SYMID(id_core_set_variable_alias, "core#set_variable_alias");
- REGISTER_SYMID(id_core_undef_method, "core#undef_method");
- REGISTER_SYMID(id_core_define_method, "core#define_method");
- REGISTER_SYMID(id_core_define_singleton_method, "core#define_singleton_method");
- REGISTER_SYMID(id_core_set_postexe, "core#set_postexe");
-
- REGISTER_SYMID(idEach, "each");
- REGISTER_SYMID(idLength, "length");
- REGISTER_SYMID(idLambda, "lambda");
- REGISTER_SYMID(idIntern, "intern");
- REGISTER_SYMID(idGets, "gets");
- REGISTER_SYMID(idSucc, "succ");
- REGISTER_SYMID(idMethodMissing, "method_missing");
-#if SUPPORT_JOKE
- REGISTER_SYMID(idBitblt, "bitblt");
- REGISTER_SYMID(idAnswer, "the_answer_to_life_the_universe_and_everything");
-#endif
- REGISTER_SYMID(idSend, "send");
- REGISTER_SYMID(id__send__, "__send__");
- REGISTER_SYMID(idInitialize, "initialize");
-}
diff --git a/id.h b/id.h
deleted file mode 100644
index 1f94dbb996..0000000000
--- a/id.h
+++ /dev/null
@@ -1,168 +0,0 @@
-/* DO NOT EDIT THIS FILE DIRECTLY */
-/**********************************************************************
-
- id.h -
-
- $Author: nobu $
- created at: Sun Oct 19 21:12:51 2008
-
- Copyright (C) 2007 Koichi Sasada
-
-**********************************************************************/
-
-#ifndef RUBY_ID_H
-#define RUBY_ID_H
-
-#define ID_SCOPE_SHIFT 3
-#define ID_SCOPE_MASK 0x07
-#define ID_LOCAL 0x00
-#define ID_INSTANCE 0x01
-#define ID_GLOBAL 0x03
-#define ID_ATTRSET 0x04
-#define ID_CONST 0x05
-#define ID_CLASS 0x06
-#define ID_JUNK 0x07
-#define ID_INTERNAL ID_JUNK
-
-#ifdef USE_PARSE_H
-#include "parse.h"
-#endif
-
-#define symIFUNC ID2SYM(idIFUNC)
-#define symCFUNC ID2SYM(idCFUNC)
-
-#if !defined tLAST_TOKEN && defined YYTOKENTYPE
-#define tLAST_TOKEN tLAST_TOKEN
-#endif
-
-enum ruby_method_ids {
-#ifndef tLAST_TOKEN
- tUPLUS = 321,
- tUMINUS = 322,
- tPOW = 323,
- tCMP = 324,
- tEQ = 325,
- tEQQ = 326,
- tNEQ = 327,
- tGEQ = 328,
- tLEQ = 329,
- tANDOP = 330,
- tOROP = 331,
- tMATCH = 332,
- tNMATCH = 333,
- tDOT2 = 334,
- tDOT3 = 335,
- tAREF = 336,
- tASET = 337,
- tLSHFT = 338,
- tRSHFT = 339,
- tLAMBDA = 352,
- idNULL = 365,
- idRespond_to = 366,
- idIFUNC = 367,
- idCFUNC = 368,
- id_core_set_method_alias = 369,
- id_core_set_variable_alias = 370,
- id_core_undef_method = 371,
- id_core_define_method = 372,
- id_core_define_singleton_method = 373,
- id_core_set_postexe = 374,
- tLAST_TOKEN = 375,
-#endif
- idDot2 = tDOT2,
- idDot3 = tDOT3,
- idUPlus = tUPLUS,
- idUMinus = tUMINUS,
- idPow = tPOW,
- idCmp = tCMP,
- idPLUS = '+',
- idMINUS = '-',
- idMULT = '*',
- idDIV = '/',
- idMOD = '%',
- idLT = '<',
- idLTLT = tLSHFT,
- idLE = tLEQ,
- idGT = '>',
- idGE = tGEQ,
- idEq = tEQ,
- idEqq = tEQQ,
- idNeq = tNEQ,
- idNot = '!',
- idBackquote = '`',
- idEqTilde = tMATCH,
- idNeqTilde = tNMATCH,
- idAREF = tAREF,
- idASET = tASET,
- idLAST_TOKEN = tLAST_TOKEN >> ID_SCOPE_SHIFT,
- tIntern,
- tMethodMissing,
- tLength,
- tGets,
- tSucc,
- tEach,
- tLambda,
- tSend,
- t__send__,
- tInitialize,
-#if SUPPORT_JOKE
- tBitblt,
- tAnswer,
-#endif
- tLAST_ID,
-#define TOKEN2ID(n) id##n = ((t##n<<ID_SCOPE_SHIFT)|ID_LOCAL)
-#if SUPPORT_JOKE
- TOKEN2ID(Bitblt),
- TOKEN2ID(Answer),
-#endif
- TOKEN2ID(Intern),
- TOKEN2ID(MethodMissing),
- TOKEN2ID(Length),
- TOKEN2ID(Gets),
- TOKEN2ID(Succ),
- TOKEN2ID(Each),
- TOKEN2ID(Lambda),
- TOKEN2ID(Send),
- TOKEN2ID(__send__),
- TOKEN2ID(Initialize)
-};
-
-#ifdef tLAST_TOKEN
-struct ruby_method_ids_check {
-#define ruby_method_id_check_for(name, value) \
- int checking_for_##name[name == value ? 1 : -1]
-ruby_method_id_check_for(tUPLUS, 321);
-ruby_method_id_check_for(tUMINUS, 322);
-ruby_method_id_check_for(tPOW, 323);
-ruby_method_id_check_for(tCMP, 324);
-ruby_method_id_check_for(tEQ, 325);
-ruby_method_id_check_for(tEQQ, 326);
-ruby_method_id_check_for(tNEQ, 327);
-ruby_method_id_check_for(tGEQ, 328);
-ruby_method_id_check_for(tLEQ, 329);
-ruby_method_id_check_for(tANDOP, 330);
-ruby_method_id_check_for(tOROP, 331);
-ruby_method_id_check_for(tMATCH, 332);
-ruby_method_id_check_for(tNMATCH, 333);
-ruby_method_id_check_for(tDOT2, 334);
-ruby_method_id_check_for(tDOT3, 335);
-ruby_method_id_check_for(tAREF, 336);
-ruby_method_id_check_for(tASET, 337);
-ruby_method_id_check_for(tLSHFT, 338);
-ruby_method_id_check_for(tRSHFT, 339);
-ruby_method_id_check_for(tLAMBDA, 352);
-ruby_method_id_check_for(idNULL, 365);
-ruby_method_id_check_for(idRespond_to, 366);
-ruby_method_id_check_for(idIFUNC, 367);
-ruby_method_id_check_for(idCFUNC, 368);
-ruby_method_id_check_for(id_core_set_method_alias, 369);
-ruby_method_id_check_for(id_core_set_variable_alias, 370);
-ruby_method_id_check_for(id_core_undef_method, 371);
-ruby_method_id_check_for(id_core_define_method, 372);
-ruby_method_id_check_for(id_core_define_singleton_method, 373);
-ruby_method_id_check_for(id_core_set_postexe, 374);
-ruby_method_id_check_for(tLAST_TOKEN, 375);
-};
-#endif
-
-#endif /* RUBY_ID_H */
diff --git a/include/ruby.h b/include/ruby.h
deleted file mode 100644
index dd7e2b8e59..0000000000
--- a/include/ruby.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/**********************************************************************
-
- ruby.h -
-
- $Author$
- created at: Sun 10 12:06:15 Jun JST 2007
-
- Copyright (C) 2007-2008 Yukihiro Matsumoto
-
-**********************************************************************/
-
-#ifndef RUBY_H
-#define RUBY_H 1
-
-#define HAVE_RUBY_DEFINES_H 1
-#define HAVE_RUBY_ENCODING_H 1
-#define HAVE_RUBY_INTERN_H 1
-#define HAVE_RUBY_IO_H 1
-#define HAVE_RUBY_MISSING_H 1
-#define HAVE_RUBY_VM_H 1
-#define HAVE_RUBY_ONIGURUMA_H 1
-#define HAVE_RUBY_RE_H 1
-#define HAVE_RUBY_REGEX_H 1
-#define HAVE_RUBY_RUBY_H 1
-#define HAVE_RUBY_ST_H 1
-#define HAVE_RUBY_UTIL_H 1
-#define HAVE_RUBY_VM_H 1
-#ifdef _WIN32
-#define HAVE_RUBY_WIN32_H 1
-#endif
-
-#include "ruby/ruby.h"
-
-#endif /* RUBY_H */
diff --git a/include/ruby/backward/rubyio.h b/include/ruby/backward/rubyio.h
deleted file mode 100644
index d5246db546..0000000000
--- a/include/ruby/backward/rubyio.h
+++ /dev/null
@@ -1,6 +0,0 @@
-#if defined __GNUC__
-#warning use "ruby/io.h" instead of "rubyio.h"
-#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
deleted file mode 100644
index 3952f7e85e..0000000000
--- a/include/ruby/backward/rubysig.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/**********************************************************************
-
- rubysig.h -
-
- $Author$
- $Date$
- created at: Wed Aug 16 01:15:38 JST 1995
-
- Copyright (C) 1993-2008 Yukihiro Matsumoto
-
-**********************************************************************/
-
-#if defined __GNUC__
-#warning rubysig.h is obsolete
-#elif defined _MSC_VER || defined __BORLANDC__
-#pragma message("warning: rubysig.h is obsolete")
-#endif
-
-#ifndef RUBYSIG_H
-#define RUBYSIG_H
-#include "ruby/ruby.h"
-
-#if defined(__cplusplus)
-extern "C" {
-#if 0
-} /* satisfy cc-mode */
-#endif
-#endif
-
-struct rb_blocking_region_buffer;
-DEPRECATED(RUBY_EXTERN struct rb_blocking_region_buffer *rb_thread_blocking_region_begin(void));
-DEPRECATED(RUBY_EXTERN void rb_thread_blocking_region_end(struct rb_blocking_region_buffer *));
-#define TRAP_BEG do {struct rb_blocking_region_buffer *__region = rb_thread_blocking_region_begin();
-#define TRAP_END rb_thread_blocking_region_end(__region);} while (0)
-#define RUBY_CRITICAL(statements) do {statements;} while (0)
-#define DEFER_INTS (0)
-#define ENABLE_INTS (1)
-#define ALLOW_INTS do {CHECK_INTS;} while (0)
-#define CHECK_INTS rb_thread_check_ints()
-
-#if defined(__cplusplus)
-#if 0
-{ /* satisfy cc-mode */
-#endif
-} /* extern "C" { */
-#endif
-
-#endif
diff --git a/include/ruby/backward/st.h b/include/ruby/backward/st.h
deleted file mode 100644
index 514128e616..0000000000
--- a/include/ruby/backward/st.h
+++ /dev/null
@@ -1,6 +0,0 @@
-#if defined __GNUC__
-#warning use "ruby/st.h" instead of bare "st.h"
-#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
deleted file mode 100644
index 6b47940ddc..0000000000
--- a/include/ruby/backward/util.h
+++ /dev/null
@@ -1,6 +0,0 @@
-#if defined __GNUC__
-#warning use "ruby/util.h" instead of bare "util.h"
-#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/defines.h b/include/ruby/defines.h
deleted file mode 100644
index 50b60c60e1..0000000000
--- a/include/ruby/defines.h
+++ /dev/null
@@ -1,288 +0,0 @@
-/************************************************
-
- defines.h -
-
- $Author$
- created at: Wed May 18 00:21:44 JST 1994
-
-************************************************/
-
-#ifndef RUBY_DEFINES_H
-#define RUBY_DEFINES_H 1
-
-#if defined(__cplusplus)
-extern "C" {
-#if 0
-} /* satisfy cc-mode */
-#endif
-#endif
-
-#define RUBY
-
-#include <stdlib.h>
-#ifdef __cplusplus
-# ifndef HAVE_PROTOTYPES
-# define HAVE_PROTOTYPES 1
-# endif
-# ifndef HAVE_STDARG_PROTOTYPES
-# define HAVE_STDARG_PROTOTYPES 1
-# endif
-#endif
-
-#undef _
-#ifdef HAVE_PROTOTYPES
-# define _(args) args
-#else
-# define _(args) ()
-#endif
-
-#undef __
-#ifdef HAVE_STDARG_PROTOTYPES
-# define __(args) args
-#else
-# define __(args) ()
-#endif
-
-#ifdef __cplusplus
-#define ANYARGS ...
-#else
-#define ANYARGS
-#endif
-
-#define xmalloc ruby_xmalloc
-#define xmalloc2 ruby_xmalloc2
-#define xcalloc ruby_xcalloc
-#define xrealloc ruby_xrealloc
-#define xrealloc2 ruby_xrealloc2
-#define xfree ruby_xfree
-
-void *xmalloc(size_t);
-void *xmalloc2(size_t,size_t);
-void *xcalloc(size_t,size_t);
-void *xrealloc(void*,size_t);
-void *xrealloc2(void*,size_t,size_t);
-void xfree(void*);
-
-#define STRINGIZE(expr) STRINGIZE0(expr)
-#ifndef STRINGIZE0
-#define STRINGIZE0(expr) #expr
-#endif
-
-#if SIZEOF_LONG_LONG > 0
-# define LONG_LONG long long
-#elif SIZEOF___INT64 > 0
-# define HAVE_LONG_LONG 1
-# define LONG_LONG __int64
-# undef SIZEOF_LONG_LONG
-# define SIZEOF_LONG_LONG SIZEOF___INT64
-#endif
-
-#if SIZEOF_INT*2 <= SIZEOF_LONG_LONG
-# define BDIGIT unsigned int
-# define SIZEOF_BDIGITS SIZEOF_INT
-# define BDIGIT_DBL unsigned LONG_LONG
-# define BDIGIT_DBL_SIGNED LONG_LONG
-#elif SIZEOF_INT*2 <= SIZEOF_LONG
-# define BDIGIT unsigned int
-# define SIZEOF_BDIGITS SIZEOF_INT
-# define BDIGIT_DBL unsigned long
-# define BDIGIT_DBL_SIGNED long
-#elif SIZEOF_SHORT*2 <= SIZEOF_LONG
-# define BDIGIT unsigned short
-# define SIZEOF_BDIGITS SIZEOF_SHORT
-# define BDIGIT_DBL unsigned long
-# define BDIGIT_DBL_SIGNED long
-#else
-# define BDIGIT unsigned short
-# define SIZEOF_BDIGITS (SIZEOF_LONG/2)
-# define BDIGIT_DBL unsigned long
-# define BDIGIT_DBL_SIGNED long
-#endif
-
-#ifdef __CYGWIN__
-#undef _WIN32
-#endif
-
-#if defined(_WIN32) || defined(__EMX__)
-#define DOSISH 1
-# define DOSISH_DRIVE_LETTER
-#endif
-
-#ifdef AC_APPLE_UNIVERSAL_BUILD
-#undef WORDS_BIGENDIAN
-#ifdef __BIG_ENDIAN__
-#define WORDS_BIGENDIAN
-#endif
-#endif
-
-#ifdef __NeXT__
-/* NextStep, OpenStep, Rhapsody */
-#ifndef S_IRUSR
-#define S_IRUSR 0000400 /* read permission, owner */
-#endif
-#ifndef S_IRGRP
-#define S_IRGRP 0000040 /* read permission, group */
-#endif
-#ifndef S_IROTH
-#define S_IROTH 0000004 /* read permission, other */
-#endif
-#ifndef S_IWUSR
-#define S_IWUSR 0000200 /* write permission, owner */
-#endif
-#ifndef S_IWGRP
-#define S_IWGRP 0000020 /* write permission, group */
-#endif
-#ifndef S_IWOTH
-#define S_IWOTH 0000002 /* write permission, other */
-#endif
-#ifndef S_IXUSR
-#define S_IXUSR 0000100 /* execute/search permission, owner */
-#endif
-#ifndef S_IXGRP
-#define S_IXGRP 0000010 /* execute/search permission, group */
-#endif
-#ifndef S_IXOTH
-#define S_IXOTH 0000001 /* execute/search permission, other */
-#endif
-#ifndef S_IRWXU
-#define S_IRWXU 0000700 /* read, write, execute permissions, owner */
-#endif
-#ifndef S_IRWXG
-#define S_IRWXG 0000070 /* read, write, execute permissions, group */
-#endif
-#ifndef S_IRWXO
-#define S_IRWXO 0000007 /* read, write, execute permissions, other */
-#endif
-#ifndef S_ISBLK
-#define S_ISBLK(mode) (((mode) & (0170000)) == (0060000))
-#endif
-#ifndef S_ISCHR
-#define S_ISCHR(mode) (((mode) & (0170000)) == (0020000))
-#endif
-#ifndef S_ISDIR
-#define S_ISDIR(mode) (((mode) & (0170000)) == (0040000))
-#endif
-#ifndef S_ISFIFO
-#define S_ISFIFO(mode) (((mode) & (0170000)) == (0010000))
-#endif
-#ifndef S_ISREG
-#define S_ISREG(mode) (((mode) & (0170000)) == (0100000))
-#endif
-#ifndef __APPLE__
-/* NextStep, OpenStep (but not Rhapsody) */
-#ifndef GETPGRP_VOID
-#define GETPGRP_VOID 1
-#endif
-#ifndef WNOHANG
-#define WNOHANG 01
-#endif
-#ifndef WUNTRACED
-#define WUNTRACED 02
-#endif
-#ifndef X_OK
-#define X_OK 1
-#endif
-#endif /* __APPLE__ */
-#endif /* NeXT */
-
-#ifdef _WIN32
-#include "ruby/win32.h"
-#endif
-
-#if defined(__BEOS__) && !defined(__HAIKU__) && !defined(BONE)
-#include <net/socket.h> /* intern.h needs fd_set definition */
-#elif defined (__SYMBIAN32__) && defined (HAVE_SYS_SELECT_H)
-# include <sys/select.h>
-#endif
-
-#ifdef RUBY_EXPORT
-#undef RUBY_EXTERN
-#endif
-
-#ifndef RUBY_EXTERN
-#define RUBY_EXTERN extern
-#endif
-
-#ifndef EXTERN
-#define EXTERN RUBY_EXTERN /* deprecated */
-#endif
-
-#ifndef RUBY_MBCHAR_MAXSIZE
-#define RUBY_MBCHAR_MAXSIZE INT_MAX
- /* MB_CUR_MAX will not work well in C locale */
-#endif
-
-#if defined(sparc) || defined(__sparc__)
-static inline void
-flush_register_windows(void)
-{
- asm
-#ifdef __GNUC__
- volatile
-#endif
-# if defined(__sparc_v9__) || defined(__sparcv9) || defined(__arch64__)
- ("flushw")
-# else
- ("ta 0x03")
-# endif /* trap always to flush register windows if we are on a Sparc system */
- ;
-}
-# define FLUSH_REGISTER_WINDOWS flush_register_windows()
-#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
-
-#if defined(DOSISH)
-#define PATH_SEP ";"
-#else
-#define PATH_SEP ":"
-#endif
-#define PATH_SEP_CHAR PATH_SEP[0]
-
-#define PATH_ENV "PATH"
-
-#if defined(DOSISH) && !defined(__EMX__)
-#define ENV_IGNORECASE
-#endif
-
-#ifndef CASEFOLD_FILESYSTEM
-# if defined DOSISH
-# define CASEFOLD_FILESYSTEM 1
-# else
-# define CASEFOLD_FILESYSTEM 0
-# endif
-#endif
-
-#ifndef DLEXT_MAXLEN
-#define DLEXT_MAXLEN 4
-#endif
-
-#ifndef RUBY_PLATFORM
-#define RUBY_PLATFORM "unknown-unknown"
-#endif
-
-#ifndef RUBY_ALIAS_FUNCTION_TYPE
-#define RUBY_ALIAS_FUNCTION_TYPE(type, prot, name, args) \
- type prot {return name args;}
-#endif
-#ifndef RUBY_ALIAS_FUNCTION_VOID
-#define RUBY_ALIAS_FUNCTION_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
-
-#if defined(__cplusplus)
-#if 0
-{ /* satisfy cc-mode */
-#endif
-} /* extern "C" { */
-#endif
-
-#endif /* RUBY_DEFINES_H */
diff --git a/include/ruby/encoding.h b/include/ruby/encoding.h
deleted file mode 100644
index 9be412ddf2..0000000000
--- a/include/ruby/encoding.h
+++ /dev/null
@@ -1,303 +0,0 @@
-/**********************************************************************
-
- encoding.h -
-
- $Author: matz $
- created at: Thu May 24 11:49:41 JST 2007
-
- Copyright (C) 2007 Yukihiro Matsumoto
-
-**********************************************************************/
-
-#ifndef RUBY_ENCODING_H
-#define RUBY_ENCODING_H 1
-
-#include <stdarg.h>
-#include "ruby/oniguruma.h"
-
-#define ENCODING_INLINE_MAX 1023
-#define ENCODING_SHIFT (FL_USHIFT+10)
-#define ENCODING_MASK (((VALUE)ENCODING_INLINE_MAX)<<ENCODING_SHIFT)
-
-#define ENCODING_SET_INLINED(obj,i) do {\
- RBASIC(obj)->flags &= ~ENCODING_MASK;\
- RBASIC(obj)->flags |= (VALUE)(i) << ENCODING_SHIFT;\
-} while (0)
-#define ENCODING_SET(obj,i) do {\
- VALUE rb_encoding_set_obj = (obj); \
- int encoding_set_enc_index = (i); \
- if (encoding_set_enc_index < ENCODING_INLINE_MAX) \
- ENCODING_SET_INLINED(rb_encoding_set_obj, encoding_set_enc_index); \
- else \
- rb_enc_set_index(rb_encoding_set_obj, encoding_set_enc_index); \
-} while (0)
-
-#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 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 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 ENCODING_CODERANGE_SET(obj, encindex, cr) \
- do { \
- VALUE rb_encoding_coderange_obj = (obj); \
- ENCODING_SET(rb_encoding_coderange_obj, (encindex)); \
- ENC_CODERANGE_SET(rb_encoding_coderange_obj, (cr)); \
- } while (0)
-
-typedef OnigEncodingType rb_encoding;
-
-int rb_enc_replicate(const char *, rb_encoding *);
-int rb_define_dummy_encoding(const char *);
-#define rb_enc_to_index(enc) ((enc) ? ENC_TO_ENCINDEX(enc) : 0)
-int rb_enc_get_index(VALUE obj);
-void rb_enc_set_index(VALUE obj, int encindex);
-int rb_enc_find_index(const char *name);
-int rb_to_encoding_index(VALUE);
-rb_encoding* rb_to_encoding(VALUE);
-rb_encoding* rb_enc_get(VALUE);
-rb_encoding* rb_enc_compatible(VALUE,VALUE);
-rb_encoding* rb_enc_check(VALUE,VALUE);
-VALUE rb_enc_associate_index(VALUE, int);
-VALUE rb_enc_associate(VALUE, rb_encoding*);
-void rb_enc_copy(VALUE dst, VALUE src);
-
-VALUE rb_enc_str_new(const char*, long, rb_encoding*);
-VALUE rb_enc_reg_new(const char*, long, rb_encoding*, int);
-PRINTF_ARGS(VALUE rb_enc_sprintf(rb_encoding *, const char*, ...), 2, 3);
-VALUE rb_enc_vsprintf(rb_encoding *, const char*, va_list);
-long rb_enc_strlen(const char*, const char*, rb_encoding*);
-char* rb_enc_nth(const char*, const char*, long, rb_encoding*);
-VALUE rb_obj_encoding(VALUE);
-VALUE rb_enc_str_buf_cat(VALUE str, const char *ptr, long len, rb_encoding *enc);
-
-VALUE rb_external_str_new_with_enc(const char *ptr, long len, rb_encoding *);
-VALUE rb_str_export_to_enc(VALUE, rb_encoding *);
-VALUE rb_str_conv_enc(VALUE str, rb_encoding *from, rb_encoding *to);
-
-/* index -> rb_encoding */
-rb_encoding* rb_enc_from_index(int idx);
-
-/* name -> rb_encoding */
-rb_encoding * rb_enc_find(const char *name);
-
-/* rb_encoding * -> name */
-#define rb_enc_name(enc) (enc)->name
-
-/* rb_encoding * -> minlen/maxlen */
-#define rb_enc_mbminlen(enc) (enc)->min_enc_len
-#define rb_enc_mbmaxlen(enc) (enc)->max_enc_len
-
-/* -> mbclen (no error notification: 0 < ret <= e-p, no exception) */
-int rb_enc_mbclen(const char *p, const char *e, rb_encoding *enc);
-
-/* -> mbclen (only for valid encoding) */
-int rb_enc_fast_mbclen(const char *p, const char *e, rb_encoding *enc);
-
-/* -> chlen, invalid or needmore */
-int rb_enc_precise_mbclen(const char *p, const char *e, rb_encoding *enc);
-#define MBCLEN_CHARFOUND_P(ret) ONIGENC_MBCLEN_CHARFOUND_P(ret)
-#define MBCLEN_CHARFOUND_LEN(ret) ONIGENC_MBCLEN_CHARFOUND_LEN(ret)
-#define MBCLEN_INVALID_P(ret) ONIGENC_MBCLEN_INVALID_P(ret)
-#define MBCLEN_NEEDMORE_P(ret) ONIGENC_MBCLEN_NEEDMORE_P(ret)
-#define MBCLEN_NEEDMORE_LEN(ret) ONIGENC_MBCLEN_NEEDMORE_LEN(ret)
-
-/* -> 0x00..0x7f, -1 */
-int rb_enc_ascget(const char *p, const char *e, int *len, rb_encoding *enc);
-
-
-/* -> code (and len) or raise exception */
-unsigned int rb_enc_codepoint_len(const char *p, const char *e, int *len, rb_encoding *enc);
-
-/* prototype for obsolete function */
-unsigned int rb_enc_codepoint(const char *p, const char *e, rb_encoding *enc);
-/* overriding macro */
-#define rb_enc_codepoint(p,e,enc) rb_enc_codepoint_len((p),(e),0,(enc))
-#define rb_enc_mbc_to_codepoint(p, e, enc) ONIGENC_MBC_TO_CODE(enc,(UChar*)(p),(UChar*)(e))
-
-/* -> codelen>0 or raise exception */
-int rb_enc_codelen(int code, rb_encoding *enc);
-
-/* code,ptr,encoding -> write buf */
-#define rb_enc_mbcput(c,buf,enc) ONIGENC_CODE_TO_MBC(enc,c,(UChar*)(buf))
-
-/* start, ptr, end, encoding -> prev_char */
-#define rb_enc_prev_char(s,p,e,enc) (char *)onigenc_get_prev_char_head(enc,(UChar*)(s),(UChar*)(p),(UChar*)(e))
-/* start, ptr, end, encoding -> next_char */
-#define rb_enc_left_char_head(s,p,e,enc) (char *)onigenc_get_left_adjust_char_head(enc,(UChar*)(s),(UChar*)(p),(UChar*)(e))
-#define rb_enc_right_char_head(s,p,e,enc) (char *)onigenc_get_right_adjust_char_head(enc,(UChar*)(s),(UChar*)(p),(UChar*)(e))
-
-/* ptr, ptr, encoding -> newline_or_not */
-#define rb_enc_is_newline(p,end,enc) ONIGENC_IS_MBC_NEWLINE(enc,(UChar*)(p),(UChar*)(end))
-
-#define rb_enc_isctype(c,t,enc) ONIGENC_IS_CODE_CTYPE(enc,c,t)
-#define rb_enc_isascii(c,enc) ONIGENC_IS_CODE_ASCII(c)
-#define rb_enc_isalpha(c,enc) ONIGENC_IS_CODE_ALPHA(enc,c)
-#define rb_enc_islower(c,enc) ONIGENC_IS_CODE_LOWER(enc,c)
-#define rb_enc_isupper(c,enc) ONIGENC_IS_CODE_UPPER(enc,c)
-#define rb_enc_ispunct(c,enc) ONIGENC_IS_CODE_PUNCT(enc,c)
-#define rb_enc_isalnum(c,enc) ONIGENC_IS_CODE_ALNUM(enc,c)
-#define rb_enc_isprint(c,enc) ONIGENC_IS_CODE_PRINT(enc,c)
-#define rb_enc_isspace(c,enc) ONIGENC_IS_CODE_SPACE(enc,c)
-#define rb_enc_isdigit(c,enc) ONIGENC_IS_CODE_DIGIT(enc,c)
-
-#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);
-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*);
-int rb_enc_str_coderange(VALUE);
-long rb_str_coderange_scan_restartable(const char*, const char*, rb_encoding*, int*);
-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);
-rb_encoding *rb_ascii8bit_encoding(void);
-rb_encoding *rb_utf8_encoding(void);
-rb_encoding *rb_usascii_encoding(void);
-rb_encoding *rb_locale_encoding(void);
-rb_encoding *rb_filesystem_encoding(void);
-rb_encoding *rb_default_external_encoding(void);
-rb_encoding *rb_default_internal_encoding(void);
-int rb_ascii8bit_encindex(void);
-int rb_utf8_encindex(void);
-int rb_usascii_encindex(void);
-VALUE rb_enc_default_external(void);
-VALUE rb_enc_default_internal(void);
-void rb_enc_set_default_external(VALUE encoding);
-void rb_enc_set_default_internal(VALUE encoding);
-VALUE rb_locale_charmap(VALUE klass);
-long rb_memsearch(const void*,long,const void*,long,rb_encoding*);
-
-RUBY_EXTERN VALUE rb_cEncoding;
-#define ENC_DUMMY_FLAG (1<<24)
-#define ENC_INDEX_MASK (~(~0U<<24))
-
-#define ENC_TO_ENCINDEX(enc) ((enc)->ruby_encoding_index & ENC_INDEX_MASK)
-
-#define ENC_DUMMY_P(enc) ((enc)->ruby_encoding_index & ENC_DUMMY_FLAG)
-#define ENC_SET_DUMMY(enc) ((enc)->ruby_encoding_index |= ENC_DUMMY_FLAG)
-
-static inline int
-rb_enc_dummy_p(rb_encoding *enc)
-{
- return ENC_DUMMY_P(enc) != 0;
-}
-
-/* econv stuff */
-
-typedef enum {
- econv_invalid_byte_sequence,
- econv_undefined_conversion,
- econv_destination_buffer_full,
- econv_source_buffer_empty,
- econv_finished,
- econv_after_output,
- econv_incomplete_input
-} rb_econv_result_t;
-
-typedef struct rb_econv_t rb_econv_t;
-
-VALUE rb_str_encode(VALUE str, VALUE to, int ecflags, VALUE ecopts);
-int rb_econv_has_convpath_p(const char* from_encoding, const char* to_encoding);
-
-int rb_econv_prepare_opts(VALUE opthash, VALUE *ecopts);
-
-rb_econv_t *rb_econv_open(const char *source_encoding, const char *destination_encoding, int ecflags);
-rb_econv_t *rb_econv_open_opts(const char *source_encoding, const char *destination_encoding, int ecflags, VALUE ecopts);
-
-rb_econv_result_t rb_econv_convert(rb_econv_t *ec,
- const unsigned char **source_buffer_ptr, const unsigned char *source_buffer_end,
- unsigned char **destination_buffer_ptr, unsigned char *destination_buffer_end,
- int flags);
-void rb_econv_close(rb_econv_t *ec);
-
-/* result: 0:success -1:failure */
-int rb_econv_set_replacement(rb_econv_t *ec, const unsigned char *str, size_t len, const char *encname);
-
-/* result: 0:success -1:failure */
-int rb_econv_decorate_at_first(rb_econv_t *ec, const char *decorator_name);
-int rb_econv_decorate_at_last(rb_econv_t *ec, const char *decorator_name);
-
-VALUE rb_econv_open_exc(const char *senc, const char *denc, int ecflags);
-
-/* result: 0:success -1:failure */
-int rb_econv_insert_output(rb_econv_t *ec,
- const unsigned char *str, size_t len, const char *str_encoding);
-
-/* encoding that rb_econv_insert_output doesn't need conversion */
-const char *rb_econv_encoding_to_insert_output(rb_econv_t *ec);
-
-/* raise an error if the last rb_econv_convert is error */
-void rb_econv_check_error(rb_econv_t *ec);
-
-/* returns an exception object or nil */
-VALUE rb_econv_make_exception(rb_econv_t *ec);
-
-int rb_econv_putbackable(rb_econv_t *ec);
-void rb_econv_putback(rb_econv_t *ec, unsigned char *p, int n);
-
-/* returns the corresponding ASCII compatible encoding for encname,
- * or NULL if encname is not ASCII incompatible encoding. */
-const char *rb_econv_asciicompat_encoding(const char *encname);
-
-VALUE rb_econv_str_convert(rb_econv_t *ec, VALUE src, int flags);
-VALUE rb_econv_substr_convert(rb_econv_t *ec, VALUE src, long byteoff, long bytesize, int flags);
-VALUE rb_econv_str_append(rb_econv_t *ec, VALUE src, VALUE dst, int flags);
-VALUE rb_econv_substr_append(rb_econv_t *ec, VALUE src, long byteoff, long bytesize, VALUE dst, int flags);
-
-void rb_econv_binmode(rb_econv_t *ec);
-
-/* flags for rb_econv_open */
-
-#define ECONV_ERROR_HANDLER_MASK 0x000000ff
-
-#define ECONV_INVALID_MASK 0x0000000f
-#define ECONV_INVALID_REPLACE 0x00000002
-
-#define ECONV_UNDEF_MASK 0x000000f0
-#define ECONV_UNDEF_REPLACE 0x00000020
-#define ECONV_UNDEF_HEX_CHARREF 0x00000030
-
-#define ECONV_DECORATOR_MASK 0x0000ff00
-
-#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
-
-/* end of flags for rb_econv_open */
-
-/* flags for rb_econv_convert */
-#define ECONV_PARTIAL_INPUT 0x00010000
-#define ECONV_AFTER_OUTPUT 0x00020000
-/* end of flags for rb_econv_convert */
-
-#endif /* RUBY_ENCODING_H */
diff --git a/include/ruby/intern.h b/include/ruby/intern.h
deleted file mode 100644
index 7375442b41..0000000000
--- a/include/ruby/intern.h
+++ /dev/null
@@ -1,821 +0,0 @@
-/**********************************************************************
-
- intern.h -
-
- $Author$
- created at: Thu Jun 10 14:22:17 JST 1993
-
- Copyright (C) 1993-2007 Yukihiro Matsumoto
- Copyright (C) 2000 Network Applied Communication Laboratory, Inc.
- Copyright (C) 2000 Information-technology Promotion Agency, Japan
-
-**********************************************************************/
-
-#ifndef RUBY_INTERN_H
-#define RUBY_INTERN_H 1
-
-#if defined(__cplusplus)
-extern "C" {
-#if 0
-} /* satisfy cc-mode */
-#endif
-#endif
-
-#ifdef HAVE_STDARG_PROTOTYPES
-# include <stdarg.h>
-#else
-# include <varargs.h>
-#endif
-#include "ruby/st.h"
-
-/*
- * Functions and variables that are used by more than one source file of
- * the kernel.
- */
-
-#define ID_ALLOCATOR 1
-
-/* array.c */
-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);
-VALUE rb_ary_new2(long);
-VALUE rb_ary_new3(long,...);
-VALUE rb_ary_new4(long, const VALUE *);
-VALUE rb_ary_tmp_new(long);
-void rb_ary_free(VALUE);
-VALUE rb_ary_freeze(VALUE);
-VALUE rb_ary_aref(int, VALUE*, VALUE);
-VALUE rb_ary_subseq(VALUE, long, long);
-void rb_ary_store(VALUE, long, VALUE);
-VALUE rb_ary_dup(VALUE);
-VALUE rb_ary_to_ary(VALUE);
-VALUE rb_ary_to_s(VALUE);
-VALUE rb_ary_push(VALUE, VALUE);
-VALUE rb_ary_pop(VALUE);
-VALUE rb_ary_shift(VALUE);
-VALUE rb_ary_unshift(VALUE, VALUE);
-VALUE rb_ary_entry(VALUE, long);
-VALUE rb_ary_each(VALUE);
-VALUE rb_ary_join(VALUE, VALUE);
-VALUE rb_ary_print_on(VALUE, VALUE);
-VALUE rb_ary_reverse(VALUE);
-VALUE rb_ary_sort(VALUE);
-VALUE rb_ary_sort_bang(VALUE);
-VALUE rb_ary_delete(VALUE, VALUE);
-VALUE rb_ary_delete_at(VALUE, long);
-VALUE rb_ary_clear(VALUE);
-VALUE rb_ary_plus(VALUE, VALUE);
-VALUE rb_ary_concat(VALUE, VALUE);
-VALUE rb_ary_assoc(VALUE, VALUE);
-VALUE rb_ary_rassoc(VALUE, VALUE);
-VALUE rb_ary_includes(VALUE, VALUE);
-VALUE rb_ary_cmp(VALUE, VALUE);
-VALUE rb_ary_replace(VALUE copy, VALUE orig);
-VALUE rb_get_values_at(VALUE, long, int, VALUE*, VALUE(*)(VALUE,long));
-/* bignum.c */
-VALUE rb_big_new(long, int);
-int rb_bigzero_p(VALUE x);
-VALUE rb_big_clone(VALUE);
-void rb_big_2comp(VALUE);
-VALUE rb_big_norm(VALUE);
-void rb_big_resize(VALUE big, long len);
-VALUE rb_uint2big(VALUE);
-VALUE rb_int2big(SIGNED_VALUE);
-VALUE rb_uint2inum(VALUE);
-VALUE rb_int2inum(SIGNED_VALUE);
-VALUE rb_cstr_to_inum(const char*, int, int);
-VALUE rb_str_to_inum(VALUE, int, int);
-VALUE rb_cstr2inum(const char*, int);
-VALUE rb_str2inum(VALUE, int);
-VALUE rb_big2str(VALUE, int);
-VALUE rb_big2str0(VALUE, int, int);
-SIGNED_VALUE rb_big2long(VALUE);
-#define rb_big2int(x) rb_big2long(x)
-VALUE rb_big2ulong(VALUE);
-#define rb_big2uint(x) rb_big2ulong(x)
-#if HAVE_LONG_LONG
-VALUE rb_ll2inum(LONG_LONG);
-VALUE rb_ull2inum(unsigned LONG_LONG);
-LONG_LONG rb_big2ll(VALUE);
-unsigned LONG_LONG rb_big2ull(VALUE);
-#endif /* HAVE_LONG_LONG */
-void rb_quad_pack(char*,VALUE);
-VALUE rb_quad_unpack(const char*,int);
-int rb_uv_to_utf8(char[6],unsigned long);
-VALUE rb_dbl2big(double);
-double rb_big2dbl(VALUE);
-VALUE rb_big_cmp(VALUE, VALUE);
-VALUE rb_big_eq(VALUE, VALUE);
-VALUE rb_big_plus(VALUE, VALUE);
-VALUE rb_big_minus(VALUE, VALUE);
-VALUE rb_big_mul(VALUE, VALUE);
-VALUE rb_big_div(VALUE, VALUE);
-VALUE rb_big_modulo(VALUE, VALUE);
-VALUE rb_big_divmod(VALUE, VALUE);
-VALUE rb_big_pow(VALUE, VALUE);
-VALUE rb_big_and(VALUE, VALUE);
-VALUE rb_big_or(VALUE, VALUE);
-VALUE rb_big_xor(VALUE, VALUE);
-VALUE rb_big_lshift(VALUE, VALUE);
-VALUE rb_big_rshift(VALUE, VALUE);
-/* rational.c */
-VALUE rb_rational_raw(VALUE, VALUE);
-#define rb_rational_raw1(x) rb_rational_raw(x, INT2FIX(1))
-#define rb_rational_raw2(x,y) rb_rational_raw(x, y)
-VALUE rb_rational_new(VALUE, VALUE);
-#define rb_rational_new1(x) rb_rational_new(x, INT2FIX(1))
-#define rb_rational_new2(x,y) rb_rational_new(x, y)
-VALUE rb_Rational(VALUE, VALUE);
-#define rb_Rational1(x) rb_Rational(x, INT2FIX(1))
-#define rb_Rational2(x,y) rb_Rational(x, y)
-/* complex.c */
-VALUE rb_complex_raw(VALUE, VALUE);
-#define rb_complex_raw1(x) rb_complex_raw(x, INT2FIX(0))
-#define rb_complex_raw2(x,y) rb_complex_raw(x, y)
-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_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)
-/* class.c */
-VALUE rb_class_boot(VALUE);
-VALUE rb_class_new(VALUE);
-VALUE rb_mod_init_copy(VALUE, VALUE);
-VALUE rb_class_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_module_new(void);
-VALUE rb_define_module_id(ID);
-VALUE rb_mod_included_modules(VALUE);
-VALUE rb_mod_include_p(VALUE, VALUE);
-VALUE rb_mod_ancestors(VALUE);
-VALUE rb_class_instance_methods(int, VALUE*, VALUE);
-VALUE rb_class_public_instance_methods(int, VALUE*, VALUE);
-VALUE rb_class_protected_instance_methods(int, VALUE*, VALUE);
-VALUE rb_class_private_instance_methods(int, VALUE*, VALUE);
-VALUE rb_obj_singleton_methods(int, VALUE*, VALUE);
-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);
-void rb_define_singleton_method(VALUE, const char*, VALUE(*)(ANYARGS), int);
-VALUE rb_singleton_class(VALUE);
-/* compar.c */
-int rb_cmpint(VALUE, VALUE, VALUE);
-NORETURN(void rb_cmperr(VALUE, VALUE));
-/* cont.c */
-VALUE rb_fiber_new(VALUE (*)(ANYARGS), VALUE);
-VALUE rb_fiber_resume(VALUE fib, int argc, VALUE *args);
-VALUE rb_fiber_yield(int argc, VALUE *args);
-VALUE rb_fiber_current(void);
-VALUE rb_fiber_alive_p(VALUE);
-/* enum.c */
-/* enumerator.c */
-VALUE rb_enumeratorize(VALUE, VALUE, int, VALUE *);
-#define RETURN_ENUMERATOR(obj, argc, argv) do { \
- if (!rb_block_given_p()) \
- return rb_enumeratorize(obj, ID2SYM(rb_frame_this_func()), \
- argc, argv); \
- } while (0)
-/* error.c */
-VALUE rb_exc_new(VALUE, const char*, long);
-VALUE rb_exc_new2(VALUE, const char*);
-VALUE rb_exc_new3(VALUE, VALUE);
-PRINTF_ARGS(NORETURN(void rb_loaderror(const char*, ...)), 1, 2);
-PRINTF_ARGS(NORETURN(void rb_name_error(ID, 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_append(const char*, ...), 1, 2);
-NORETURN(void rb_load_fail(const char*));
-NORETURN(void rb_error_frozen(const char*));
-void rb_check_frozen(VALUE);
-/* eval.c */
-int rb_sourceline(void);
-const char *rb_sourcefile(void);
-
-#if defined(NFDBITS) && defined(HAVE_RB_FD_INIT)
-typedef struct {
- int maxfd;
- fd_set *fdset;
-} rb_fdset_t;
-
-void rb_fd_init(volatile rb_fdset_t *);
-void rb_fd_term(rb_fdset_t *);
-void rb_fd_zero(rb_fdset_t *);
-void rb_fd_set(int, rb_fdset_t *);
-void rb_fd_clr(int, rb_fdset_t *);
-int rb_fd_isset(int, const rb_fdset_t *);
-void rb_fd_copy(rb_fdset_t *, const fd_set *, int);
-int rb_fd_select(int, rb_fdset_t *, rb_fdset_t *, rb_fdset_t *, struct timeval *);
-
-#define rb_fd_ptr(f) ((f)->fdset)
-#define rb_fd_max(f) ((f)->maxfd)
-
-#elif defined(_WIN32)
-
-typedef struct {
- int capa;
- fd_set *fdset;
-} rb_fdset_t;
-
-void rb_fd_init(volatile rb_fdset_t *);
-void rb_fd_term(rb_fdset_t *);
-#define rb_fd_zero(f) ((f)->fdset->fd_count = 0)
-void rb_fd_set(int, rb_fdset_t *);
-#define rb_fd_clr(n, f) rb_w32_fdclr(n, (f)->fdset)
-#define rb_fd_isset(n, f) rb_w32_fdisset(n, (f)->fdset)
-#define rb_fd_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)
-#define rb_fd_max(f) ((f)->fdset->fd_count)
-
-#else
-
-typedef fd_set rb_fdset_t;
-#define rb_fd_zero(f) FD_ZERO(f)
-#define rb_fd_set(n, f) FD_SET(n, f)
-#define rb_fd_clr(n, f) FD_CLR(n, f)
-#define rb_fd_isset(n, f) FD_ISSET(n, f)
-#define rb_fd_copy(d, s, n) (*(d) = *(s))
-#define rb_fd_resize(n, f) (void)(f)
-#define rb_fd_ptr(f) (f)
-#define rb_fd_init(f) FD_ZERO(f)
-#define rb_fd_term(f) (void)(f)
-#define rb_fd_max(f) FD_SETSIZE
-#define rb_fd_select(n, rfds, wfds, efds, timeout) select(n, rfds, wfds, efds, timeout)
-
-#endif
-
-NORETURN(void rb_exc_raise(VALUE));
-NORETURN(void rb_exc_fatal(VALUE));
-VALUE rb_f_exit(int,VALUE*);
-VALUE rb_f_abort(int,VALUE*);
-void rb_remove_method(VALUE, const char*);
-#define rb_disable_super(klass, name) ((void)0)
-#define rb_enable_super(klass, name) ((void)0)
-#define HAVE_RB_DEFINE_ALLOC_FUNC 1
-typedef VALUE (*rb_alloc_func_t)(VALUE);
-void rb_define_alloc_func(VALUE, rb_alloc_func_t);
-void rb_undef_alloc_func(VALUE);
-rb_alloc_func_t rb_get_alloc_func(VALUE);
-void rb_clear_cache(void);
-void rb_clear_cache_by_class(VALUE);
-void rb_alias(VALUE, ID, ID);
-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);
-int rb_obj_respond_to(VALUE, ID, int);
-int rb_respond_to(VALUE, ID);
-VALUE rb_f_notimplement(int argc, VALUE *argv, VALUE obj);
-void rb_interrupt(void);
-VALUE rb_apply(VALUE, ID, VALUE);
-void rb_backtrace(void);
-ID rb_frame_this_func(void);
-VALUE rb_obj_instance_eval(int, VALUE*, VALUE);
-VALUE rb_obj_instance_exec(int, VALUE*, VALUE);
-VALUE rb_mod_module_eval(int, VALUE*, VALUE);
-VALUE rb_mod_module_exec(int, VALUE*, VALUE);
-void rb_load(VALUE, int);
-void rb_load_protect(VALUE, int, int*);
-NORETURN(void rb_jump_tag(int));
-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);
-void rb_obj_call_init(VALUE, int, VALUE*);
-VALUE rb_class_new_instance(int, VALUE*, VALUE);
-VALUE rb_block_proc(void);
-VALUE rb_f_lambda(void);
-VALUE rb_proc_new(VALUE (*)(ANYARGS/* VALUE yieldarg[, VALUE procarg] */), VALUE);
-VALUE rb_proc_call(VALUE, VALUE);
-VALUE rb_proc_call_with_block(VALUE, int argc, VALUE *argv, VALUE);
-int rb_proc_arity(VALUE);
-VALUE rb_binding_new(void);
-VALUE rb_obj_method(VALUE, VALUE);
-VALUE rb_method_call(int, VALUE*, VALUE);
-int rb_mod_method_arity(VALUE, ID);
-int rb_obj_method_arity(VALUE, ID);
-VALUE rb_protect(VALUE (*)(VALUE), VALUE, int*);
-void rb_set_end_proc(void (*)(VALUE), VALUE);
-void rb_mark_end_proc(void);
-void rb_exec_end_proc(void);
-void Init_jump(void);
-void ruby_finalize(void);
-NORETURN(void ruby_stop(int));
-int ruby_cleanup(volatile int);
-void rb_gc_mark_threads(void);
-void rb_thread_schedule(void);
-void rb_thread_wait_fd(int);
-int rb_thread_fd_writable(int);
-void rb_thread_fd_close(int);
-int rb_thread_alone(void);
-void rb_thread_polling(void);
-void rb_thread_sleep(int);
-void rb_thread_sleep_forever(void);
-VALUE rb_thread_stop(void);
-VALUE rb_thread_wakeup(VALUE);
-VALUE rb_thread_run(VALUE);
-VALUE rb_thread_kill(VALUE);
-VALUE rb_thread_create(VALUE (*)(ANYARGS), void*);
-int rb_thread_select(int, fd_set *, fd_set *, fd_set *, struct timeval *);
-int rb_thread_fd_select(int, rb_fdset_t *, rb_fdset_t *, rb_fdset_t *, struct timeval *);
-void rb_thread_wait_for(struct timeval);
-VALUE rb_thread_current(void);
-VALUE rb_thread_main(void);
-VALUE rb_thread_local_aref(VALUE, ID);
-VALUE rb_thread_local_aset(VALUE, ID, VALUE);
-void rb_thread_atfork(void);
-void rb_thread_atfork_before_exec(void);
-VALUE rb_exec_recursive(VALUE(*)(VALUE, VALUE, int),VALUE,VALUE);
-VALUE rb_exec_recursive_paired(VALUE(*)(VALUE, VALUE, int),VALUE,VALUE,VALUE);
-/* file.c */
-VALUE rb_file_s_expand_path(int, VALUE *);
-VALUE rb_file_expand_path(VALUE, VALUE);
-VALUE rb_file_s_absolute_path(int, VALUE *);
-VALUE rb_file_absolute_path(VALUE, VALUE);
-void rb_file_const(const char*, VALUE);
-int rb_file_load_ok(const char *);
-int rb_find_file_ext_safe(VALUE*, const char* const*, int);
-VALUE rb_find_file_safe(VALUE, int);
-int rb_find_file_ext(VALUE*, const char* const*);
-VALUE rb_find_file(VALUE);
-char *rb_path_next(const char *);
-char *rb_path_skip_prefix(const char *);
-char *rb_path_last_separator(const char *);
-char *rb_path_end(const char *);
-VALUE rb_file_directory_p(VALUE,VALUE);
-/* gc.c */
-void ruby_set_stack_size(size_t);
-NORETURN(void rb_memerror(void));
-int ruby_stack_check(void);
-size_t ruby_stack_length(VALUE**);
-int rb_during_gc(void);
-void rb_gc_mark_locations(VALUE*, VALUE*);
-void rb_mark_tbl(struct st_table*);
-void rb_mark_set(struct st_table*);
-void rb_mark_hash(struct st_table*);
-void rb_gc_mark_maybe(VALUE);
-void rb_gc_mark(VALUE);
-void rb_gc_force_recycle(VALUE);
-void rb_gc(void);
-VALUE rb_gc_write_barrier(VALUE);
-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);
-#define Init_stack(addr) ruby_init_stack(addr)
-/* hash.c */
-void st_foreach_safe(struct st_table *, int (*)(ANYARGS), st_data_t);
-void rb_hash_foreach(VALUE, int (*)(ANYARGS), VALUE);
-VALUE rb_hash(VALUE);
-VALUE rb_hash_new(void);
-VALUE rb_hash_dup(VALUE);
-VALUE rb_hash_freeze(VALUE);
-VALUE rb_hash_aref(VALUE, VALUE);
-VALUE rb_hash_lookup(VALUE, VALUE);
-VALUE rb_hash_lookup2(VALUE, VALUE, VALUE);
-VALUE rb_hash_fetch(VALUE, VALUE);
-VALUE rb_hash_aset(VALUE, VALUE, VALUE);
-VALUE rb_hash_delete_if(VALUE);
-VALUE rb_hash_delete(VALUE,VALUE);
-struct st_table *rb_hash_tbl(VALUE);
-int rb_path_check(const char*);
-int rb_env_path_tainted(void);
-VALUE rb_env_clear(void);
-/* io.c */
-#define rb_defout rb_stdout
-RUBY_EXTERN VALUE rb_fs;
-RUBY_EXTERN VALUE rb_output_fs;
-RUBY_EXTERN VALUE rb_rs;
-RUBY_EXTERN VALUE rb_default_rs;
-RUBY_EXTERN VALUE rb_output_rs;
-VALUE rb_io_write(VALUE, VALUE);
-VALUE rb_io_gets(VALUE);
-VALUE rb_io_getbyte(VALUE);
-VALUE rb_io_ungetc(VALUE, VALUE);
-VALUE rb_io_ungetbyte(VALUE, VALUE);
-VALUE rb_io_close(VALUE);
-VALUE rb_io_flush(VALUE);
-VALUE rb_io_eof(VALUE);
-VALUE rb_io_binmode(VALUE);
-VALUE rb_io_ascii8bit_binmode(VALUE);
-VALUE rb_io_addstr(VALUE, VALUE);
-VALUE rb_io_printf(int, VALUE*, VALUE);
-VALUE rb_io_print(int, VALUE*, VALUE);
-VALUE rb_io_puts(int, VALUE*, VALUE);
-VALUE rb_io_fdopen(int, int, const char*);
-VALUE rb_io_get_io(VALUE);
-VALUE rb_file_open(const char*, const char*);
-VALUE rb_file_open_str(VALUE, const char*);
-VALUE rb_gets(void);
-void rb_write_error(const char*);
-void rb_write_error2(const char*, long);
-void rb_close_before_exec(int lowfd, int maxhint, VALUE noclose_fds);
-int rb_pipe(int *pipes);
-/* marshal.c */
-VALUE rb_marshal_dump(VALUE, VALUE);
-VALUE rb_marshal_load(VALUE);
-void rb_marshal_define_compat(VALUE newclass, VALUE oldclass, VALUE (*dumper)(VALUE), VALUE (*loader)(VALUE, VALUE));
-/* numeric.c */
-void rb_num_zerodiv(void);
-#define RB_NUM_COERCE_FUNCS_NEED_OPID 1
-VALUE rb_num_coerce_bin(VALUE, VALUE, ID);
-VALUE rb_num_coerce_cmp(VALUE, VALUE, ID);
-VALUE rb_num_coerce_relop(VALUE, VALUE, ID);
-VALUE rb_float_new(double);
-VALUE rb_num2fix(VALUE);
-VALUE rb_fix2str(VALUE, int);
-VALUE rb_dbl_cmp(double, double);
-/* object.c */
-int rb_eql(VALUE, VALUE);
-VALUE rb_any_to_s(VALUE);
-VALUE rb_inspect(VALUE);
-VALUE rb_obj_is_instance_of(VALUE, VALUE);
-VALUE rb_obj_is_kind_of(VALUE, VALUE);
-VALUE rb_obj_alloc(VALUE);
-VALUE rb_obj_clone(VALUE);
-VALUE rb_obj_dup(VALUE);
-VALUE rb_obj_init_copy(VALUE,VALUE);
-VALUE rb_obj_taint(VALUE);
-VALUE rb_obj_tainted(VALUE);
-VALUE rb_obj_untaint(VALUE);
-VALUE rb_obj_untrust(VALUE);
-VALUE rb_obj_untrusted(VALUE);
-VALUE rb_obj_trust(VALUE);
-VALUE rb_obj_freeze(VALUE);
-VALUE rb_obj_frozen_p(VALUE);
-VALUE rb_obj_id(VALUE);
-VALUE rb_obj_class(VALUE);
-VALUE rb_class_real(VALUE);
-VALUE rb_class_inherited_p(VALUE, VALUE);
-VALUE rb_convert_type(VALUE,int,const char*,const char*);
-VALUE rb_check_convert_type(VALUE,int,const char*,const char*);
-VALUE rb_check_to_integer(VALUE, const char *);
-VALUE rb_to_int(VALUE);
-VALUE rb_Integer(VALUE);
-VALUE rb_to_float(VALUE);
-VALUE rb_Float(VALUE);
-VALUE rb_String(VALUE);
-VALUE rb_Array(VALUE);
-double rb_cstr_to_dbl(const char*, int);
-double rb_str_to_dbl(VALUE, int);
-/* parse.y */
-RUBY_EXTERN int ruby_sourceline;
-RUBY_EXTERN char *ruby_sourcefile;
-ID rb_id_attrset(ID);
-void rb_gc_mark_parser(void);
-int rb_is_const_id(ID);
-int rb_is_instance_id(ID);
-int rb_is_class_id(ID);
-int rb_is_local_id(ID);
-int rb_is_junk_id(ID);
-int rb_symname_p(const char*);
-int rb_sym_interned_p(VALUE);
-void rb_gc_mark_symbols(void);
-VALUE rb_backref_get(void);
-void rb_backref_set(VALUE);
-VALUE rb_lastline_get(void);
-void rb_lastline_set(VALUE);
-VALUE rb_sym_all_symbols(void);
-/* process.c */
-void rb_last_status_set(int status, rb_pid_t pid);
-VALUE rb_last_status_get(void);
-struct rb_exec_arg {
- int argc;
- VALUE *argv;
- const char *prog;
- VALUE options;
- VALUE redirect_fds;
-};
-int rb_proc_exec_n(int, VALUE*, const char*);
-int rb_proc_exec(const char*);
-VALUE rb_exec_arg_init(int argc, VALUE *argv, int accept_shell, struct rb_exec_arg *e);
-int rb_exec_arg_addopt(struct rb_exec_arg *e, VALUE key, VALUE val);
-void rb_exec_arg_fixup(struct rb_exec_arg *e);
-int rb_run_exec_options(const struct rb_exec_arg *e, struct rb_exec_arg *s);
-int rb_run_exec_options_err(const struct rb_exec_arg *e, struct rb_exec_arg *s, char*, size_t);
-int rb_exec(const struct rb_exec_arg*);
-int rb_exec_err(const struct rb_exec_arg*, char*, size_t);
-rb_pid_t rb_fork(int*, int (*)(void*), void*, VALUE);
-rb_pid_t rb_fork_err(int*, int (*)(void*, char*, size_t), void*, VALUE, char*, size_t);
-VALUE rb_f_exec(int,VALUE*);
-rb_pid_t rb_waitpid(rb_pid_t pid, int *status, int flags);
-void rb_syswait(rb_pid_t pid);
-rb_pid_t rb_spawn(int, VALUE*);
-rb_pid_t rb_spawn_err(int, VALUE*, char*, size_t);
-VALUE rb_proc_times(VALUE);
-VALUE rb_detach_process(rb_pid_t pid);
-/* range.c */
-VALUE rb_range_new(VALUE, VALUE, int);
-VALUE rb_range_beg_len(VALUE, long*, long*, long, int);
-int rb_range_values(VALUE range, VALUE *begp, VALUE *endp, int *exclp);
-/* random.c */
-unsigned long rb_genrand_int32(void);
-double rb_genrand_real(void);
-void rb_reset_random_seed(void);
-/* re.c */
-#define rb_memcmp memcmp
-int rb_memcicmp(const void*,const void*,long);
-void rb_match_busy(VALUE);
-VALUE rb_reg_nth_defined(int, VALUE);
-VALUE rb_reg_nth_match(int, VALUE);
-int rb_reg_backref_number(VALUE match, VALUE backref);
-VALUE rb_reg_last_match(VALUE);
-VALUE rb_reg_match_pre(VALUE);
-VALUE rb_reg_match_post(VALUE);
-VALUE rb_reg_match_last(VALUE);
-#define HAVE_RB_REG_NEW_STR 1
-VALUE rb_reg_new_str(VALUE, int);
-VALUE rb_reg_new(const char *, long, int);
-VALUE rb_reg_match(VALUE, VALUE);
-VALUE rb_reg_match2(VALUE);
-int rb_reg_options(VALUE);
-void rb_set_kcode(const char*);
-const char* rb_get_kcode(void);
-/* ruby.c */
-#define rb_argv rb_get_argv()
-RUBY_EXTERN VALUE rb_argv0;
-VALUE rb_get_argv(void);
-void *rb_load_file(const char*);
-void ruby_script(const char*);
-void ruby_prog_init(void);
-void ruby_set_argv(int, char**);
-void *ruby_process_options(int, char**);
-void ruby_init_loadpath(void);
-void ruby_incpush(const char*);
-/* signal.c */
-VALUE rb_f_kill(int, VALUE*);
-void rb_gc_mark_trap_list(void);
-#ifdef POSIX_SIGNAL
-#define posix_signal ruby_posix_signal
-RETSIGTYPE (*posix_signal(int, RETSIGTYPE (*)(int)))(int);
-#endif
-void ruby_sig_finalize(void);
-void rb_trap_exit(void);
-void rb_trap_exec(void);
-const char *ruby_signal_name(int);
-void ruby_default_signal(int);
-/* sprintf.c */
-VALUE rb_f_sprintf(int, const VALUE*);
-PRINTF_ARGS(VALUE rb_sprintf(const char*, ...), 1, 2);
-VALUE rb_vsprintf(const char*, va_list);
-PRINTF_ARGS(VALUE rb_str_catf(VALUE, const char*, ...), 2, 3);
-VALUE rb_str_vcatf(VALUE, const char*, va_list);
-VALUE rb_str_format(int, const VALUE *, VALUE);
-/* string.c */
-VALUE rb_str_new(const char*, long);
-VALUE rb_str_new_cstr(const char*);
-VALUE rb_str_new2(const char*);
-VALUE rb_str_new_shared(VALUE);
-VALUE rb_str_new3(VALUE);
-VALUE rb_str_new_frozen(VALUE);
-VALUE rb_str_new4(VALUE);
-VALUE rb_str_new_with_class(VALUE, const char*, long);
-VALUE rb_str_new5(VALUE, const char*, long);
-VALUE rb_tainted_str_new_cstr(const char*);
-VALUE rb_tainted_str_new(const char*, long);
-VALUE rb_tainted_str_new2(const char*);
-VALUE rb_external_str_new(const char*, long);
-VALUE rb_external_str_new_cstr(const char*);
-VALUE rb_locale_str_new(const char*, long);
-VALUE rb_locale_str_new_cstr(const char*);
-VALUE rb_str_buf_new(long);
-VALUE rb_str_buf_new_cstr(const char*);
-VALUE rb_str_buf_new2(const char*);
-VALUE rb_str_tmp_new(long);
-VALUE rb_usascii_str_new(const char*, long);
-VALUE rb_usascii_str_new_cstr(const char*);
-VALUE rb_usascii_str_new2(const char*);
-void rb_str_free(VALUE);
-void rb_str_shared_replace(VALUE, VALUE);
-VALUE rb_str_buf_append(VALUE, VALUE);
-VALUE rb_str_buf_cat(VALUE, const char*, long);
-VALUE rb_str_buf_cat2(VALUE, const char*);
-VALUE rb_str_buf_cat_ascii(VALUE, const char*);
-VALUE rb_obj_as_string(VALUE);
-VALUE rb_check_string_type(VALUE);
-VALUE rb_str_dup(VALUE);
-VALUE rb_str_locktmp(VALUE);
-VALUE rb_str_unlocktmp(VALUE);
-VALUE rb_str_dup_frozen(VALUE);
-#define rb_str_dup_frozen rb_str_new_frozen
-VALUE rb_str_plus(VALUE, VALUE);
-VALUE rb_str_times(VALUE, VALUE);
-long rb_str_sublen(VALUE, long);
-VALUE rb_str_substr(VALUE, long, long);
-VALUE rb_str_subseq(VALUE, long, long);
-void rb_str_modify(VALUE);
-VALUE rb_str_freeze(VALUE);
-void rb_str_set_len(VALUE, long);
-VALUE rb_str_resize(VALUE, long);
-VALUE rb_str_cat(VALUE, const char*, long);
-VALUE rb_str_cat2(VALUE, const char*);
-VALUE rb_str_append(VALUE, VALUE);
-VALUE rb_str_concat(VALUE, VALUE);
-int rb_memhash(const void *ptr, long len);
-VALUE rb_hash_start(VALUE);
-VALUE rb_hash_uint32(VALUE, unsigned int);
-VALUE rb_hash_uint(VALUE, VALUE);
-VALUE rb_hash_end(VALUE);
-int rb_str_hash(VALUE);
-int rb_str_hash_cmp(VALUE,VALUE);
-int rb_str_comparable(VALUE, VALUE);
-int rb_str_cmp(VALUE, VALUE);
-VALUE rb_str_equal(VALUE str1, VALUE str2);
-VALUE rb_str_drop_bytes(VALUE, long);
-void rb_str_update(VALUE, long, long, VALUE);
-VALUE rb_str_replace(VALUE, VALUE);
-VALUE rb_str_inspect(VALUE);
-VALUE rb_str_dump(VALUE);
-VALUE rb_str_split(VALUE, const char*);
-void rb_str_associate(VALUE, VALUE);
-VALUE rb_str_associated(VALUE);
-void rb_str_setter(VALUE, ID, VALUE*);
-VALUE rb_str_intern(VALUE);
-VALUE rb_sym_to_s(VALUE);
-VALUE rb_str_length(VALUE);
-long rb_str_offset(VALUE, long);
-size_t rb_str_capacity(VALUE);
-#if defined __GNUC__
-#define rb_str_new_cstr(str) __extension__ ( \
-{ \
- (__builtin_constant_p(str)) ? \
- rb_str_new(str, strlen(str)) : \
- rb_str_new_cstr(str); \
-})
-#define rb_tainted_str_new_cstr(str) __extension__ ( \
-{ \
- (__builtin_constant_p(str)) ? \
- rb_tainted_str_new(str, strlen(str)) : \
- rb_tainted_str_new_cstr(str); \
-})
-#define rb_usascii_str_new_cstr(str) __extension__ ( \
-{ \
- (__builtin_constant_p(str)) ? \
- rb_usascii_str_new(str, strlen(str)) : \
- rb_usascii_str_new_cstr(str); \
-})
-#define rb_external_str_new_cstr(str) __extension__ ( \
-{ \
- (__builtin_constant_p(str)) ? \
- rb_external_str_new(str, strlen(str)) : \
- rb_external_str_new_cstr(str); \
-})
-#define rb_locale_str_new_cstr(str) __extension__ ( \
-{ \
- (__builtin_constant_p(str)) ? \
- rb_locale_str_new(str, strlen(str)) : \
- 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(strlen(str)), \
- str, strlen(str)) : \
- rb_str_buf_new_cstr(str); \
-})
-#define rb_str_buf_cat2(str, ptr) __extension__ ( \
-{ \
- (__builtin_constant_p(ptr)) ? \
- rb_str_buf_cat(str, ptr, strlen(ptr)) : \
- rb_str_buf_cat2(str, ptr); \
-})
-#define rb_str_cat2(str, ptr) __extension__ ( \
-{ \
- (__builtin_constant_p(ptr)) ? \
- rb_str_cat(str, ptr, strlen(ptr)) : \
- rb_str_cat2(str, ptr); \
-})
-#define rb_exc_new2(klass, ptr) __extension__ ( \
-{ \
- (__builtin_constant_p(ptr)) ? \
- rb_exc_new(klass, ptr, strlen(ptr)) : \
- rb_exc_new2(klass, ptr); \
-})
-#endif
-#define rb_str_new2 rb_str_new_cstr
-#define rb_str_new3 rb_str_new_shared
-#define rb_str_new4 rb_str_new_frozen
-#define rb_str_new5 rb_str_new_with_class
-#define rb_tainted_str_new2 rb_tainted_str_new_cstr
-#define rb_str_buf_new2 rb_str_buf_new_cstr
-#define rb_usascii_str_new2 rb_usascii_str_new_cstr
-/* struct.c */
-VALUE rb_struct_new(VALUE, ...);
-VALUE rb_struct_define(const char*, ...);
-VALUE rb_struct_alloc(VALUE, VALUE);
-VALUE rb_struct_initialize(VALUE, VALUE);
-VALUE rb_struct_aref(VALUE, VALUE);
-VALUE rb_struct_aset(VALUE, VALUE, VALUE);
-VALUE rb_struct_getmember(VALUE, ID);
-VALUE rb_struct_iv_get(VALUE, const char*);
-VALUE rb_struct_s_members(VALUE);
-VALUE rb_struct_members(VALUE);
-VALUE rb_struct_alloc_noinit(VALUE);
-VALUE rb_struct_define_without_accessor(const char *, VALUE, rb_alloc_func_t, ...);
-/* thread.c */
-typedef void rb_unblock_function_t(void *);
-typedef VALUE rb_blocking_function_t(void *);
-void rb_thread_check_ints(void);
-int rb_thread_interrupted(VALUE thval);
-VALUE rb_thread_blocking_region(rb_blocking_function_t *func, void *data1,
- rb_unblock_function_t *ubf, void *data2);
-#define RUBY_UBF_IO ((rb_unblock_function_t *)-1)
-#define RUBY_UBF_PROCESS ((rb_unblock_function_t *)-1)
-VALUE rb_mutex_new(void);
-VALUE rb_mutex_locked_p(VALUE mutex);
-VALUE rb_mutex_try_lock(VALUE mutex);
-VALUE rb_mutex_lock(VALUE mutex);
-VALUE rb_mutex_unlock(VALUE mutex);
-VALUE rb_mutex_sleep(VALUE self, VALUE timeout);
-VALUE rb_mutex_synchronize(VALUE mutex, VALUE (*func)(VALUE arg), VALUE arg);
-VALUE rb_barrier_new(void);
-VALUE rb_barrier_wait(VALUE self);
-VALUE rb_barrier_release(VALUE self);
-VALUE rb_barrier_destroy(VALUE self);
-/* time.c */
-VALUE rb_time_new(time_t, long);
-VALUE rb_time_nano_new(time_t, long);
-VALUE rb_time_num_new(VALUE, VALUE);
-/* variable.c */
-VALUE rb_mod_name(VALUE);
-VALUE rb_class_path(VALUE);
-void rb_set_class_path(VALUE, VALUE, const char*);
-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);
-void rb_gc_mark_global_tbl(void);
-VALUE rb_f_trace_var(int, VALUE*);
-VALUE rb_f_untrace_var(int, VALUE*);
-VALUE rb_f_global_variables(void);
-void rb_alias_variable(ID, ID);
-struct st_table* rb_generic_ivar_table(VALUE);
-void rb_copy_generic_ivar(VALUE,VALUE);
-void rb_mark_generic_ivar(VALUE);
-void rb_mark_generic_ivar_tbl(void);
-void rb_free_generic_ivar(VALUE);
-VALUE rb_ivar_get(VALUE, ID);
-VALUE rb_ivar_set(VALUE, ID, VALUE);
-VALUE rb_ivar_defined(VALUE, ID);
-void rb_ivar_foreach(VALUE, int (*)(ANYARGS), st_data_t);
-VALUE rb_iv_set(VALUE, const char*, VALUE);
-VALUE rb_iv_get(VALUE, const char*);
-VALUE rb_attr_get(VALUE, ID);
-VALUE rb_obj_instance_variables(VALUE);
-VALUE rb_obj_remove_instance_variable(VALUE, VALUE);
-void *rb_mod_const_at(VALUE, void*);
-void *rb_mod_const_of(VALUE, void*);
-VALUE rb_const_list(void*);
-VALUE rb_mod_constants(int, VALUE *, VALUE);
-VALUE rb_mod_remove_const(VALUE, VALUE);
-int rb_const_defined(VALUE, ID);
-int rb_const_defined_at(VALUE, ID);
-int rb_const_defined_from(VALUE, ID);
-VALUE rb_const_get(VALUE, ID);
-VALUE rb_const_get_at(VALUE, ID);
-VALUE rb_const_get_from(VALUE, ID);
-void rb_const_set(VALUE, ID, VALUE);
-VALUE rb_mod_const_missing(VALUE,VALUE);
-VALUE rb_cvar_defined(VALUE, ID);
-void rb_cvar_set(VALUE, ID, VALUE);
-VALUE rb_cvar_get(VALUE, ID);
-void rb_cv_set(VALUE, const char*, VALUE);
-VALUE rb_cv_get(VALUE, const char*);
-void rb_define_class_variable(VALUE, const char*, VALUE);
-VALUE rb_mod_class_variables(VALUE);
-VALUE rb_mod_remove_cvar(VALUE, VALUE);
-/* version.c */
-void ruby_show_version(void);
-void ruby_show_copyright(void);
-
-ID rb_frame_callee(void);
-VALUE rb_str_succ(VALUE);
-VALUE rb_time_succ(VALUE);
-void rb_frame_pop(void);
-int rb_frame_method_id_and_class(ID *idp, VALUE *klassp);
-
-#if defined(__cplusplus)
-#if 0
-{ /* satisfy cc-mode */
-#endif
-} /* extern "C" { */
-#endif
-
-#endif /* RUBY_INTERN_H */
diff --git a/include/ruby/io.h b/include/ruby/io.h
deleted file mode 100644
index 7d9512aa92..0000000000
--- a/include/ruby/io.h
+++ /dev/null
@@ -1,176 +0,0 @@
-/**********************************************************************
-
- rubyio.h -
-
- $Author$
- created at: Fri Nov 12 16:47:09 JST 1993
-
- Copyright (C) 1993-2007 Yukihiro Matsumoto
-
-**********************************************************************/
-
-#ifndef RUBY_IO_H
-#define RUBY_IO_H 1
-
-#if defined(__cplusplus)
-extern "C" {
-#if 0
-} /* satisfy cc-mode */
-#endif
-#endif
-
-#include <stdio.h>
-#include <errno.h>
-#include "ruby/encoding.h"
-
-#if defined(HAVE_STDIO_EXT_H)
-#include <stdio_ext.h>
-#endif
-
-typedef struct rb_io_t {
- int fd; /* file descriptor */
- FILE *stdio_file; /* stdio ptr for read/write if available */
- int mode; /* mode flags: FMODE_XXXs */
- rb_pid_t pid; /* child's pid (for pipes) */
- int lineno; /* number of lines read */
- VALUE pathv; /* pathname for file */
- void (*finalize)(struct rb_io_t*,int); /* finalize proc */
-
- char *wbuf; /* wbuf_off + wbuf_len <= wbuf_capa */
- int wbuf_off;
- int wbuf_len;
- int wbuf_capa;
-
- char *rbuf; /* rbuf_off + rbuf_len <= rbuf_capa */
- int rbuf_off;
- int rbuf_len;
- int rbuf_capa;
-
- VALUE tied_io_for_writing;
-
- /*
- * enc enc2 read action write action
- * NULL NULL force_encoding(default_external) write the byte sequence of str
- * e1 NULL force_encoding(e1) convert str.encoding to e1
- * e1 e2 convert from e2 to e1 convert str.encoding to e2
- */
- struct rb_io_enc_t {
- rb_encoding *enc;
- rb_encoding *enc2;
- int ecflags;
- VALUE ecopts;
- } encs;
-
- rb_econv_t *readconv;
- char *cbuf; /* cbuf_off + cbuf_len <= cbuf_capa */
- int cbuf_off;
- int cbuf_len;
- int cbuf_capa;
-
- rb_econv_t *writeconv;
- VALUE writeconv_asciicompat;
- int writeconv_pre_ecflags;
- VALUE writeconv_pre_ecopts;
- int writeconv_initialized;
-
- VALUE write_lock;
-} rb_io_t;
-
-#define HAVE_RB_IO_T 1
-
-#define FMODE_READABLE 0x00000001
-#define FMODE_WRITABLE 0x00000002
-#define FMODE_READWRITE (FMODE_READABLE|FMODE_WRITABLE)
-#define FMODE_BINMODE 0x00000004
-#define FMODE_SYNC 0x00000008
-#define FMODE_TTY 0x00000010
-#define FMODE_DUPLEX 0x00000020
-#define FMODE_APPEND 0x00000040
-#define FMODE_CREATE 0x00000080
-/* #define FMODE_NOREVLOOKUP 0x00000100 */
-#define FMODE_WSPLIT 0x00000200
-#define FMODE_WSPLIT_INITIALIZED 0x00000400
-#define FMODE_TRUNC 0x00000800
-#define FMODE_TEXTMODE 0x00001000
-#define FMODE_EOF 0x00002000
-/* #define FMODE_PREP 0x00010000 */
-#define FMODE_STRIP_BOM 0x00100000
-
-#define GetOpenFile(obj,fp) rb_io_check_closed((fp) = RFILE(rb_io_taint_check(obj))->fptr)
-
-#define MakeOpenFile(obj, fp) do {\
- if (RFILE(obj)->fptr) {\
- rb_io_close(obj);\
- free(RFILE(obj)->fptr);\
- RFILE(obj)->fptr = 0;\
- }\
- fp = 0;\
- fp = RFILE(obj)->fptr = ALLOC(rb_io_t);\
- fp->fd = -1;\
- fp->stdio_file = NULL;\
- fp->mode = 0;\
- fp->pid = 0;\
- fp->lineno = 0;\
- fp->pathv = Qnil;\
- fp->finalize = 0;\
- fp->wbuf = NULL;\
- fp->wbuf_off = 0;\
- fp->wbuf_len = 0;\
- fp->wbuf_capa = 0;\
- fp->rbuf = NULL;\
- fp->rbuf_off = 0;\
- fp->rbuf_len = 0;\
- fp->rbuf_capa = 0;\
- fp->readconv = NULL;\
- fp->cbuf = NULL;\
- fp->cbuf_off = 0;\
- fp->cbuf_len = 0;\
- fp->cbuf_capa = 0;\
- fp->writeconv = NULL;\
- fp->writeconv_asciicompat = Qnil;\
- fp->writeconv_pre_ecflags = 0;\
- fp->writeconv_pre_ecopts = Qnil;\
- fp->writeconv_initialized = 0;\
- fp->tied_io_for_writing = 0;\
- fp->encs.enc = NULL;\
- fp->encs.enc2 = NULL;\
- fp->encs.ecflags = 0;\
- fp->encs.ecopts = Qnil;\
- fp->write_lock = 0;\
-} while (0)
-
-FILE *rb_io_stdio_file(rb_io_t *fptr);
-
-FILE *rb_fdopen(int, const char*);
-int rb_io_modestr_fmode(const char *modestr);
-int rb_io_modestr_oflags(const char *modestr);
-int rb_io_oflags_fmode(int oflags);
-void rb_io_check_writable(rb_io_t*);
-void rb_io_check_readable(rb_io_t*);
-int rb_io_fptr_finalize(rb_io_t*);
-void rb_io_synchronized(rb_io_t*);
-void rb_io_check_initialized(rb_io_t*);
-void rb_io_check_closed(rb_io_t*);
-int rb_io_wait_readable(int);
-int rb_io_wait_writable(int);
-void rb_io_set_nonblock(rb_io_t *fptr);
-
-/* compatibility for ruby 1.8 and older */
-#define rb_io_mode_flags(modestr) rb_io_modestr_fmode(modestr)
-#define rb_io_modenum_flags(oflags) rb_io_oflags_fmode(oflags)
-
-VALUE rb_io_taint_check(VALUE);
-NORETURN(void rb_eof_error(void));
-
-void rb_io_read_check(rb_io_t*);
-int rb_io_read_pending(rb_io_t*);
-void rb_read_check(FILE*);
-
-#if defined(__cplusplus)
-#if 0
-{ /* satisfy cc-mode */
-#endif
-} /* extern "C" { */
-#endif
-
-#endif /* RUBY_IO_H */
diff --git a/include/ruby/missing.h b/include/ruby/missing.h
deleted file mode 100644
index 61524d2db1..0000000000
--- a/include/ruby/missing.h
+++ /dev/null
@@ -1,172 +0,0 @@
-/************************************************
-
- missing.h - prototype for *.c in ./missing, and
- for missing timeval struct
-
- $Author$
- created at: Sat May 11 23:46:03 JST 2002
-
-************************************************/
-
-#ifndef RUBY_MISSING_H
-#define RUBY_MISSING_H 1
-
-#if defined(__cplusplus)
-extern "C" {
-#if 0
-} /* satisfy cc-mode */
-#endif
-#endif
-
-#if defined(HAVE_SYS_TIME_H)
-# include <sys/time.h>
-#elif !defined(_WIN32)
-# define time_t long
-struct timeval {
- time_t tv_sec; /* seconds */
- long tv_usec; /* microseconds */
-};
-#endif
-#if defined(HAVE_SYS_TYPES_H)
-# include <sys/types.h>
-#endif
-
-#if !defined(HAVE_STRUCT_TIMESPEC)
-struct timespec {
- time_t tv_sec; /* seconds */
- long tv_nsec; /* nanoseconds */
-};
-#endif
-
-#ifndef RUBY_EXTERN
-#define RUBY_EXTERN extern
-#endif
-
-#ifndef HAVE_ACOSH
-RUBY_EXTERN double acosh(double);
-RUBY_EXTERN double asinh(double);
-RUBY_EXTERN double atanh(double);
-#endif
-
-#ifndef HAVE_CRYPT
-RUBY_EXTERN char *crypt(const char *, const char *);
-#endif
-
-#ifndef HAVE_DUP2
-RUBY_EXTERN int dup2(int, int);
-#endif
-
-#ifndef HAVE_EACCESS
-RUBY_EXTERN int eaccess(const char*, int);
-#endif
-
-#ifndef HAVE_FINITE
-RUBY_EXTERN int finite(double);
-#endif
-
-#ifndef HAVE_FLOCK
-RUBY_EXTERN int flock(int, int);
-#endif
-
-/*
-#ifndef HAVE_FREXP
-RUBY_EXTERN double frexp(double, int *);
-#endif
-*/
-
-#ifndef HAVE_HYPOT
-RUBY_EXTERN double hypot(double, double);
-#endif
-
-#ifndef HAVE_ERF
-RUBY_EXTERN double erf(double);
-RUBY_EXTERN double erfc(double);
-#endif
-
-#ifndef HAVE_TGAMMA
-RUBY_EXTERN double tgamma(double);
-#endif
-
-#ifndef HAVE_LGAMMA_R
-RUBY_EXTERN double lgamma_r(double, int *);
-#endif
-
-#ifndef HAVE_CBRT
-RUBY_EXTERN double cbrt(double);
-#endif
-
-#ifndef isinf
-# ifndef HAVE_ISINF
-# if defined(HAVE_FINITE) && defined(HAVE_ISNAN)
-# define isinf(x) (!finite(x) && !isnan(x))
-# else
-RUBY_EXTERN int isinf(double);
-# endif
-# endif
-#endif
-
-#ifndef HAVE_ISNAN
-RUBY_EXTERN int isnan(double);
-#endif
-
-/*
-#ifndef HAVE_MEMCMP
-RUBY_EXTERN int memcmp(const void *, const void *, size_t);
-#endif
-*/
-
-#ifndef HAVE_MEMMOVE
-RUBY_EXTERN void *memmove(void *, const void *, size_t);
-#endif
-
-/*
-#ifndef HAVE_MODF
-RUBY_EXTERN double modf(double, double *);
-#endif
-*/
-
-#ifndef HAVE_STRCHR
-RUBY_EXTERN char *strchr(const char *, int);
-RUBY_EXTERN char *strrchr(const char *, int);
-#endif
-
-#ifndef HAVE_STRERROR
-RUBY_EXTERN char *strerror(int);
-#endif
-
-#ifndef HAVE_STRSTR
-RUBY_EXTERN char *strstr(const char *, const char *);
-#endif
-
-/*
-#ifndef HAVE_STRTOL
-RUBY_EXTERN long strtol(const char *, char **, int);
-#endif
-*/
-
-#if defined HAVE_VSNPRINTF || defined HAVE_SNPRINTF
-# include <stdarg.h>
-#endif
-#ifndef HAVE_SNPRINTF
-RUBY_EXTERN int snprintf(char *, size_t n, char const *, ...);
-#endif
-#ifndef HAVE_VSNPRINTF
-extern int vsnprintf(char *, size_t n, char const *, va_list);
-#endif
-
-#ifndef HAVE_STRLCPY
-RUBY_EXTERN size_t strlcpy(char *, const char*, size_t);
-#endif
-
-#ifndef HAVE_STRLCAT
-RUBY_EXTERN size_t strlcat(char *, const char*, size_t);
-#endif
-
-#if defined(__cplusplus)
-#if 0
-{ /* satisfy cc-mode */
-#endif
-} /* extern "C" { */
-#endif
-
-#endif /* RUBY_MISSING_H */
diff --git a/include/ruby/oniguruma.h b/include/ruby/oniguruma.h
deleted file mode 100644
index 34707d2693..0000000000
--- a/include/ruby/oniguruma.h
+++ /dev/null
@@ -1,784 +0,0 @@
-#ifndef ONIGURUMA_H
-#define ONIGURUMA_H
-/**********************************************************************
- oniguruma.h - 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.
- */
-
-#ifdef __cplusplus
-extern "C" {
-#if 0
-} /* satisfy cc-mode */
-#endif
-#endif
-
-#define ONIGURUMA
-#define ONIGURUMA_VERSION_MAJOR 5
-#define ONIGURUMA_VERSION_MINOR 9
-#define ONIGURUMA_VERSION_TEENY 1
-
-#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
-
-/* 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;
-
-#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, struct OnigEncodingTypeST* enc);
- const char* name;
- int max_enc_len;
- int min_enc_len;
- int (*is_mbc_newline)(const OnigUChar* p, const OnigUChar* end, struct OnigEncodingTypeST* enc);
- OnigCodePoint (*mbc_to_code)(const OnigUChar* p, const OnigUChar* end, struct OnigEncodingTypeST* enc);
- int (*code_to_mbclen)(OnigCodePoint code, struct OnigEncodingTypeST* enc);
- int (*code_to_mbc)(OnigCodePoint code, OnigUChar *buf, struct OnigEncodingTypeST* enc);
- int (*mbc_case_fold)(OnigCaseFoldType flag, const OnigUChar** pp, const OnigUChar* end, OnigUChar* to, struct OnigEncodingTypeST* enc);
- int (*apply_all_case_fold)(OnigCaseFoldType flag, OnigApplyAllCaseFoldFunc f, void* arg, struct OnigEncodingTypeST* enc);
- int (*get_case_fold_codes_by_str)(OnigCaseFoldType flag, const OnigUChar* p, const OnigUChar* end, OnigCaseFoldCodeItem acs[], struct OnigEncodingTypeST* enc);
- int (*property_name_to_ctype)(struct OnigEncodingTypeST* enc, OnigUChar* p, OnigUChar* end);
- int (*is_code_ctype)(OnigCodePoint code, OnigCtype ctype, struct OnigEncodingTypeST* enc);
- int (*get_ctype_code_range)(OnigCtype ctype, OnigCodePoint* sb_out, const OnigCodePoint* ranges[], struct OnigEncodingTypeST* enc);
- OnigUChar* (*left_adjust_char_head)(const OnigUChar* start, const OnigUChar* p, const OnigUChar* end, struct OnigEncodingTypeST* enc);
- int (*is_allowed_reverse_match)(const OnigUChar* p, const OnigUChar* end, struct OnigEncodingTypeST* enc);
- int ruby_encoding_index;
-} OnigEncodingType;
-
-typedef OnigEncodingType* OnigEncoding;
-
-ONIG_EXTERN 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
-
-
-#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_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, 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_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_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)
-#define ONIG_OPTION_MAXBIT ONIG_OPTION_POSIX_REGION /* 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 OnigSyntaxPerl;
-ONIG_EXTERN const OnigSyntaxType OnigSyntaxPerl_NG;
-ONIG_EXTERN const OnigSyntaxType OnigSyntaxRuby;
-
-/* 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_PERL (&OnigSyntaxPerl)
-#define ONIG_SYNTAX_PERL_NG (&OnigSyntaxPerl_NG)
-#define ONIG_SYNTAX_RUBY (&OnigSyntaxRuby)
-
-/* 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_OP2_ESC_CAPITAL_Q_QUOTE (1U<<0) /* \Q...\E */
-#define ONIG_SYN_OP2_QMARK_GROUP_EFFECT (1U<<1) /* (?...) */
-#define ONIG_SYN_OP2_OPTION_PERL (1U<<2) /* (?imsx),(?-imsx) */
-#define ONIG_SYN_OP2_OPTION_RUBY (1U<<3) /* (?imx), (?-imx) */
-#define ONIG_SYN_OP2_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) /* \ */
-
-/* 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})? */
-
-/* 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*)+ */
-
-/* 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_SETTED -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
-/* 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_LONG_WIDE_CHAR_VALUE -212
-#define ONIGERR_EMPTY_GROUP_NAME -214
-#define ONIGERR_INVALID_GROUP_NAME -215
-#define ONIGERR_INVALID_CHAR_IN_GROUP_NAME -216
-#define ONIGERR_UNDEFINED_NAME_REFERENCE -217
-#define ONIGERR_UNDEFINED_GROUP_REFERENCE -218
-#define ONIGERR_MULTIPLEX_DEFINED_NAME -219
-#define ONIGERR_MULTIPLEX_DEFINITION_NAME_CALL -220
-#define ONIGERR_NEVER_ENDING_RECURSION -221
-#define ONIGERR_GROUP_NUMBER_OVER_FOR_CAPTURE_HISTORY -222
-#define ONIGERR_INVALID_CHAR_PROPERTY_NAME -223
-#define ONIGERR_INVALID_CODE_POINT_VALUE -400
-#define ONIGERR_INVALID_WIDE_CHAR_VALUE -400
-#define ONIGERR_TOO_BIG_WIDE_CHAR_VALUE -401
-#define ONIGERR_NOT_SUPPORTED_ENCODING_COMBINATION -402
-#define ONIGERR_INVALID_COMBINATION_OF_OPTIONS -403
-
-/* errors related to thread */
-#define ONIGERR_OVER_THREAD_PASS_LIMIT_COUNT -1001
-
-
-/* must be smaller than BIT_STATUS_BITS_NUM (unsigned int * 8) */
-#define ONIG_MAX_CAPTURE_HISTORY_GROUP 31
-#define ONIG_IS_CAPTURE_HISTORY_GROUP(r, i) \
- ((i) <= ONIG_MAX_CAPTURE_HISTORY_GROUP && (r)->list && (r)->list[i])
-
-typedef struct OnigCaptureTreeNodeStruct {
- int group; /* group number */
- int beg;
- int end;
- int allocated;
- int num_childs;
- struct OnigCaptureTreeNodeStruct** childs;
-} OnigCaptureTreeNode;
-
-/* match result region type */
-struct re_registers {
- int allocated;
- int num_regs;
- int* beg;
- int* 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;
- OnigRepeatRange* repeat_range;
-
- OnigEncoding enc;
- OnigOptionType options;
- const OnigSyntaxType* syntax;
- OnigCaseFoldType case_fold_flag;
- void* name_table;
-
- /* 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;
- 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, int 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_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
-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
-long onig_search P_((OnigRegex, const OnigUChar* str, const OnigUChar* end, const OnigUChar* start, const OnigUChar* range, OnigRegion* region, OnigOptionType option));
-ONIG_EXTERN
-long onig_match P_((OnigRegex, const OnigUChar* str, const OnigUChar* end, const OnigUChar* at, OnigRegion* region, OnigOptionType option));
-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,int,int,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_((OnigEncoding 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));
-
-#ifdef __cplusplus
-#if 0
-{ /* satisfy cc-mode */
-#endif
-}
-#endif
-
-#endif /* ONIGURUMA_H */
diff --git a/include/ruby/re.h b/include/ruby/re.h
deleted file mode 100644
index c60ab96016..0000000000
--- a/include/ruby/re.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/**********************************************************************
-
- re.h -
-
- $Author$
- created at: Thu Sep 30 14:18:32 JST 1993
-
- Copyright (C) 1993-2007 Yukihiro Matsumoto
-
-**********************************************************************/
-
-#ifndef RUBY_RE_H
-#define RUBY_RE_H 1
-
-#if defined(__cplusplus)
-extern "C" {
-#if 0
-} /* satisfy cc-mode */
-#endif
-#endif
-
-#include <sys/types.h>
-#include <stdio.h>
-
-#include "ruby/regex.h"
-
-typedef struct re_pattern_buffer Regexp;
-
-struct rmatch_offset {
- long beg;
- long end;
-};
-
-struct rmatch {
- struct re_registers regs;
-
- int char_offset_updated;
- int char_offset_num_allocated;
- struct rmatch_offset *char_offset;
-};
-
-struct RMatch {
- struct RBasic basic;
- VALUE str;
- struct rmatch *rmatch;
- VALUE regexp; /* RRegexp */
-};
-
-#define RMATCH(obj) (R_CAST(RMatch)(obj))
-#define RMATCH_REGS(obj) (&(R_CAST(RMatch)(obj))->rmatch->regs)
-
-VALUE rb_reg_regcomp(VALUE);
-long rb_reg_search(VALUE, VALUE, long, int);
-VALUE rb_reg_regsub(VALUE, VALUE, struct re_registers *, VALUE);
-long rb_reg_adjust_startpos(VALUE, VALUE, long, int);
-void rb_match_busy(VALUE);
-VALUE rb_reg_quote(VALUE);
-
-#if defined(__cplusplus)
-#if 0
-{ /* satisfy cc-mode */
-#endif
-} /* extern "C" { */
-#endif
-
-#endif /* RUBY_RE_H */
diff --git a/include/ruby/regex.h b/include/ruby/regex.h
deleted file mode 100644
index a63e2f6a4c..0000000000
--- a/include/ruby/regex.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/**********************************************************************
-
- regex.h -
-
- $Author$
-
- Copyright (C) 1993-2007 Yukihiro Matsumoto
-
-**********************************************************************/
-
-#ifndef ONIGURUMA_REGEX_H
-#define ONIGURUMA_REGEX_H 1
-
-#if defined(__cplusplus)
-extern "C" {
-#if 0
-} /* satisfy cc-mode */
-#endif
-#endif
-
-#ifdef RUBY
-#include "ruby/oniguruma.h"
-#else
-#include "oniguruma.h"
-#endif
-
-#ifndef ONIG_RUBY_M17N
-
-ONIG_EXTERN OnigEncoding OnigEncDefaultCharEncoding;
-
-#define mbclen(p,e,enc) rb_enc_mbclen((p),(e),(enc))
-
-#endif /* ifndef ONIG_RUBY_M17N */
-
-#if defined(__cplusplus)
-#if 0
-{ /* satisfy cc-mode */
-#endif
-} /* extern "C" { */
-#endif
-
-#endif /* ONIGURUMA_REGEX_H */
diff --git a/include/ruby/ruby.h b/include/ruby/ruby.h
deleted file mode 100644
index c4a417a595..0000000000
--- a/include/ruby/ruby.h
+++ /dev/null
@@ -1,1320 +0,0 @@
-/**********************************************************************
-
- ruby/ruby.h -
-
- $Author$
- created at: Thu Jun 10 14:26:32 JST 1993
-
- Copyright (C) 1993-2008 Yukihiro Matsumoto
- Copyright (C) 2000 Network Applied Communication Laboratory, Inc.
- Copyright (C) 2000 Information-technology Promotion Agency, Japan
-
-**********************************************************************/
-
-#ifndef RUBY_RUBY_H
-#define RUBY_RUBY_H 1
-
-#if defined(__cplusplus)
-extern "C" {
-#if 0
-} /* satisfy cc-mode */
-#endif
-#endif
-
-#ifndef RUBY_LIB
-#include "ruby/config.h"
-#ifdef RUBY_EXTCONF_H
-#include RUBY_EXTCONF_H
-#endif
-#endif
-
-#define NORETURN_STYLE_NEW 1
-#ifndef NORETURN
-# define NORETURN(x) x
-#endif
-#ifndef DEPRECATED
-# define DEPRECATED(x) x
-#endif
-#ifndef NOINLINE
-# define NOINLINE(x) x
-#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
-
-#ifdef HAVE_STDLIB_H
-# include <stdlib.h>
-#endif
-
-#ifdef HAVE_STRING_H
-# include <string.h>
-#else
-# include <strings.h>
-#endif
-
-#ifdef HAVE_INTRINSICS_H
-# include <intrinsics.h>
-#endif
-
-#ifdef HAVE_STDINT_H
-# include <stdint.h>
-#endif
-#ifdef HAVE_INTTYPES_H
-# include <inttypes.h>
-#endif
-
-#include <stddef.h>
-#include <stdio.h>
-
-#include "defines.h"
-
-#if defined(HAVE_ALLOCA_H)
-#include <alloca.h>
-#else
-# ifdef _AIX
-#pragma alloca
-# endif
-#endif
-
-#if defined HAVE_UINTPTR_T && 0
-typedef uintptr_t VALUE;
-typedef uintptr_t ID;
-# define SIGNED_VALUE intptr_t
-# define SIZEOF_VALUE SIZEOF_UINTPTR_T
-# undef PRI_VALUE_PREFIX
-#elif SIZEOF_LONG == SIZEOF_VOIDP
-typedef unsigned long VALUE;
-typedef unsigned long ID;
-# define SIGNED_VALUE long
-# define SIZEOF_VALUE SIZEOF_LONG
-# define PRI_VALUE_PREFIX "l"
-#elif SIZEOF_LONG_LONG == SIZEOF_VOIDP
-typedef unsigned LONG_LONG VALUE;
-typedef unsigned LONG_LONG ID;
-# define SIGNED_VALUE LONG_LONG
-# define LONG_LONG_VALUE 1
-# define SIZEOF_VALUE SIZEOF_LONG_LONG
-# define PRI_VALUE_PREFIX "ll"
-#else
-# error ---->> ruby requires sizeof(void*) == sizeof(long) to be compiled. <<----
-#endif
-
-typedef char ruby_check_sizeof_int[SIZEOF_INT == sizeof(int) ? 1 : -1];
-typedef char ruby_check_sizeof_long[SIZEOF_LONG == sizeof(long) ? 1 : -1];
-#ifdef SIZEOF_LONG_LONG
-typedef char ruby_check_sizeof_long_long[SIZEOF_LONG_LONG == sizeof(LONG_LONG) ? 1 : -1];
-#endif
-typedef char ruby_check_sizeof_voidp[SIZEOF_VOIDP == sizeof(void*) ? 1 : -1];
-
-#if defined PRIdPTR && !defined PRI_VALUE_PREFIX
-#define PRIdVALUE PRIdPTR
-#define PRIiVALUE PRIiPTR
-#define PRIoVALUE PRIoPTR
-#define PRIuVALUE PRIuPTR
-#define PRIxVALUE PRIxPTR
-#define PRIXVALUE PRIXPTR
-#else
-#define PRIdVALUE PRI_VALUE_PREFIX"d"
-#define PRIiVALUE PRI_VALUE_PREFIX"i"
-#define PRIoVALUE PRI_VALUE_PREFIX"o"
-#define PRIuVALUE PRI_VALUE_PREFIX"u"
-#define PRIxVALUE PRI_VALUE_PREFIX"x"
-#define PRIXVALUE PRI_VALUE_PREFIX"X"
-#endif
-#ifndef PRI_VALUE_PREFIX
-# define PRI_VALUE_PREFIX ""
-#endif
-
-#if defined PRIdPTR
-# define PRI_PTRDIFF_PREFIX "t"
-#elif SIZEOF_PTRDIFF_T == SIZEOF_INT
-# define PRI_PTRDIFF_PREFIX
-#elif SIZEOF_PTRDIFF_T == SIZEOF_LONG
-# define PRI_PTRDIFF_PREFIX "l"
-#elif SIZEOF_PTRDIFF_T == SIZEOF_LONG_LONG
-# define PRI_PTRDIFF_PREFIX "ll"
-#endif
-#define PRIdPTRDIFF PRI_PTRDIFF_PREFIX"d"
-#define PRIiPTRDIFF PRI_PTRDIFF_PREFIX"i"
-#define PRIoPTRDIFF PRI_PTRDIFF_PREFIX"o"
-#define PRIuPTRDIFF PRI_PTRDIFF_PREFIX"u"
-#define PRIxPTRDIFF PRI_PTRDIFF_PREFIX"x"
-#define PRIXPTRDIFF PRI_PTRDIFF_PREFIX"X"
-
-#if defined PRIdPTR
-# define PRI_SIZE_PREFIX "z"
-#elif SIZEOF_SIZE_T == SIZEOF_INT
-# define PRI_SIZE_PREFIX
-#elif SIZEOF_SIZE_T == SIZEOF_LONG
-# define PRI_SIZE_PREFIX "l"
-#elif SIZEOF_SIZE_T == SIZEOF_LONG_LONG
-# define PRI_SIZE_PREFIX "ll"
-#endif
-#define PRIdSIZE PRI_SIZE_PREFIX"d"
-#define PRIiSIZE PRI_SIZE_PREFIX"i"
-#define PRIoSIZE PRI_SIZE_PREFIX"o"
-#define PRIuSIZE PRI_SIZE_PREFIX"u"
-#define PRIxSIZE PRI_SIZE_PREFIX"x"
-#define PRIXSIZE PRI_SIZE_PREFIX"X"
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# ifndef LONG_MAX
-# ifdef HAVE_LIMITS_H
-# include <limits.h>
-# else
- /* assuming 32bit(2's compliment) long */
-# define LONG_MAX 2147483647
-# endif
-# endif
-# ifndef LONG_MIN
-# define LONG_MIN (-LONG_MAX-1)
-# endif
-# ifndef CHAR_BIT
-# define CHAR_BIT 8
-# endif
-#endif
-
-#ifdef HAVE_LONG_LONG
-# ifndef LLONG_MAX
-# ifdef LONG_LONG_MAX
-# define LLONG_MAX LONG_LONG_MAX
-# else
-# ifdef _I64_MAX
-# define LLONG_MAX _I64_MAX
-# else
- /* assuming 64bit(2's complement) long long */
-# define LLONG_MAX 9223372036854775807LL
-# endif
-# endif
-# endif
-# ifndef LLONG_MIN
-# ifdef LONG_LONG_MIN
-# define LLONG_MIN LONG_LONG_MIN
-# else
-# ifdef _I64_MIN
-# define LLONG_MIN _I64_MIN
-# else
-# define LLONG_MIN (-LLONG_MAX-1)
-# endif
-# endif
-# endif
-#endif
-
-#define FIXNUM_MAX (LONG_MAX>>1)
-#define FIXNUM_MIN RSHIFT((long)LONG_MIN,1)
-
-#define INT2FIX(i) ((VALUE)(((SIGNED_VALUE)(i))<<1 | FIXNUM_FLAG))
-#define LONG2FIX(i) INT2FIX(i)
-#define rb_fix_new(v) INT2FIX(v)
-VALUE rb_int2inum(SIGNED_VALUE);
-
-#define rb_int_new(v) rb_int2inum(v)
-VALUE rb_uint2inum(VALUE);
-
-#define rb_uint_new(v) rb_uint2inum(v)
-
-#ifdef HAVE_LONG_LONG
-VALUE rb_ll2inum(LONG_LONG);
-#define LL2NUM(v) rb_ll2inum(v)
-VALUE rb_ull2inum(unsigned LONG_LONG);
-#define ULL2NUM(v) rb_ull2inum(v)
-#endif
-
-#if SIZEOF_OFF_T > SIZEOF_LONG && defined(HAVE_LONG_LONG)
-# define OFFT2NUM(v) LL2NUM(v)
-#elif SIZEOF_OFF_T == SIZEOF_LONG
-# define OFFT2NUM(v) LONG2NUM(v)
-#else
-# define OFFT2NUM(v) INT2NUM(v)
-#endif
-
-#if SIZEOF_SIZE_T > SIZEOF_LONG && defined(HAVE_LONG_LONG)
-# define SIZET2NUM(v) ULL2NUM(v)
-# define SSIZET2NUM(v) LL2NUM(v)
-#elif SIZEOF_SIZE_T == SIZEOF_LONG
-# define SIZET2NUM(v) ULONG2NUM(v)
-# define SSIZET2NUM(v) LONG2NUM(v)
-#else
-# define SIZET2NUM(v) UINT2NUM(v)
-# define SSIZET2NUM(v) INT2NUM(v)
-#endif
-
-#ifndef SSIZE_MAX
-# if SIZEOF_SIZE_T > SIZEOF_LONG && defined(HAVE_LONG_LONG)
-# define SSIZE_MAX LLONG_MAX
-# define SSIZE_MIN LLONG_MIN
-# elif SIZEOF_SIZE_T == SIZEOF_LONG
-# define SSIZE_MAX LONG_MAX
-# define SSIZE_MIN LONG_MIN
-# elif SIZEOF_SIZE_T == SIZEOF_INT
-# define SSIZE_MAX INT_MAX
-# define SSIZE_MIN INT_MIN
-# else
-# define SSIZE_MAX SHRT_MAX
-# define SSIZE_MIN SHRT_MIN
-# endif
-#endif
-
-#ifndef PIDT2NUM
-#define PIDT2NUM(v) LONG2NUM(v)
-#endif
-#ifndef NUM2PIDT
-#define NUM2PIDT(v) NUM2LONG(v)
-#endif
-#ifndef UIDT2NUM
-#define UIDT2NUM(v) LONG2NUM(v)
-#endif
-#ifndef NUM2UIDT
-#define NUM2UIDT(v) NUM2LONG(v)
-#endif
-#ifndef GIDT2NUM
-#define GIDT2NUM(v) LONG2NUM(v)
-#endif
-#ifndef NUM2GIDT
-#define NUM2GIDT(v) NUM2LONG(v)
-#endif
-
-#define FIX2LONG(x) RSHIFT((SIGNED_VALUE)x,1)
-#define FIX2ULONG(x) ((((VALUE)(x))>>1)&LONG_MAX)
-#define FIXNUM_P(f) (((SIGNED_VALUE)(f))&FIXNUM_FLAG)
-#define POSFIXABLE(f) ((f) < FIXNUM_MAX+1)
-#define NEGFIXABLE(f) ((f) >= FIXNUM_MIN)
-#define FIXABLE(f) (POSFIXABLE(f) && NEGFIXABLE(f))
-
-#define IMMEDIATE_P(x) ((VALUE)(x) & IMMEDIATE_MASK)
-
-#define SYMBOL_P(x) (((VALUE)(x)&~(~(VALUE)0<<RUBY_SPECIAL_SHIFT))==SYMBOL_FLAG)
-#define ID2SYM(x) (((VALUE)(x)<<RUBY_SPECIAL_SHIFT)|SYMBOL_FLAG)
-#define SYM2ID(x) RSHIFT((unsigned long)x,RUBY_SPECIAL_SHIFT)
-
-/* Module#methods, #singleton_methods and so on return Symbols */
-#define USE_SYMBOL_AS_METHOD_NAME 1
-
-/* special constants - i.e. non-zero and non-fixnum constants */
-enum ruby_special_consts {
- RUBY_Qfalse = 0,
- RUBY_Qtrue = 2,
- RUBY_Qnil = 4,
- RUBY_Qundef = 6,
-
- RUBY_IMMEDIATE_MASK = 0x03,
- RUBY_FIXNUM_FLAG = 0x01,
- RUBY_SYMBOL_FLAG = 0x0e,
- RUBY_SPECIAL_SHIFT = 8
-};
-
-#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
-#define SYMBOL_FLAG RUBY_SYMBOL_FLAG
-
-#define RTEST(v) (((VALUE)(v) & ~Qnil) != 0)
-#define NIL_P(v) ((VALUE)(v) == Qnil)
-
-#define CLASS_OF(v) rb_class_of((VALUE)(v))
-
-enum ruby_value_type {
- RUBY_T_NONE = 0x00,
-
- RUBY_T_OBJECT = 0x01,
- RUBY_T_CLASS = 0x02,
- RUBY_T_MODULE = 0x03,
- RUBY_T_FLOAT = 0x04,
- RUBY_T_STRING = 0x05,
- RUBY_T_REGEXP = 0x06,
- RUBY_T_ARRAY = 0x07,
- RUBY_T_HASH = 0x08,
- RUBY_T_STRUCT = 0x09,
- RUBY_T_BIGNUM = 0x0a,
- RUBY_T_FILE = 0x0b,
- RUBY_T_DATA = 0x0c,
- RUBY_T_MATCH = 0x0d,
- RUBY_T_COMPLEX = 0x0e,
- RUBY_T_RATIONAL = 0x0f,
-
- RUBY_T_NIL = 0x11,
- RUBY_T_TRUE = 0x12,
- RUBY_T_FALSE = 0x13,
- RUBY_T_SYMBOL = 0x14,
- RUBY_T_FIXNUM = 0x15,
-
- RUBY_T_UNDEF = 0x1b,
- RUBY_T_NODE = 0x1c,
- RUBY_T_ICLASS = 0x1d,
- RUBY_T_ZOMBIE = 0x1e,
-
- RUBY_T_MASK = 0x1f
-};
-
-#define T_NONE RUBY_T_NONE
-#define T_NIL RUBY_T_NIL
-#define T_OBJECT RUBY_T_OBJECT
-#define T_CLASS RUBY_T_CLASS
-#define T_ICLASS RUBY_T_ICLASS
-#define T_MODULE RUBY_T_MODULE
-#define T_FLOAT RUBY_T_FLOAT
-#define T_STRING RUBY_T_STRING
-#define T_REGEXP RUBY_T_REGEXP
-#define T_ARRAY RUBY_T_ARRAY
-#define T_HASH RUBY_T_HASH
-#define T_STRUCT RUBY_T_STRUCT
-#define T_BIGNUM RUBY_T_BIGNUM
-#define T_FILE RUBY_T_FILE
-#define T_FIXNUM RUBY_T_FIXNUM
-#define T_TRUE RUBY_T_TRUE
-#define T_FALSE RUBY_T_FALSE
-#define T_DATA RUBY_T_DATA
-#define T_MATCH RUBY_T_MATCH
-#define T_SYMBOL RUBY_T_SYMBOL
-#define T_RATIONAL RUBY_T_RATIONAL
-#define T_COMPLEX RUBY_T_COMPLEX
-#define T_UNDEF RUBY_T_UNDEF
-#define T_NODE RUBY_T_NODE
-#define T_ZOMBIE RUBY_T_ZOMBIE
-#define T_MASK RUBY_T_MASK
-
-#define BUILTIN_TYPE(x) (int)(((struct RBasic*)(x))->flags & T_MASK)
-
-#define TYPE(x) rb_type((VALUE)(x))
-
-#define RB_GC_GUARD(v) (*(volatile VALUE *)&(v))
-
-void rb_check_type(VALUE,int);
-#define Check_Type(v,t) rb_check_type((VALUE)(v),t)
-
-VALUE rb_str_to_str(VALUE);
-VALUE rb_string_value(volatile VALUE*);
-char *rb_string_value_ptr(volatile VALUE*);
-char *rb_string_value_cstr(volatile VALUE*);
-
-#define StringValue(v) rb_string_value(&(v))
-#define StringValuePtr(v) rb_string_value_ptr(&(v))
-#define StringValueCStr(v) rb_string_value_cstr(&(v))
-
-void rb_check_safe_obj(VALUE);
-void rb_check_safe_str(VALUE);
-#define SafeStringValue(v) do {\
- StringValue(v);\
- rb_check_safe_obj(v);\
-} while (0)
-/* obsolete macro - use SafeStringValue(v) */
-#define Check_SafeStr(v) rb_check_safe_str((VALUE)(v))
-
-VALUE rb_str_export(VALUE);
-#define ExportStringValue(v) do {\
- SafeStringValue(v);\
- (v) = rb_str_export(v);\
-} while (0)
-VALUE rb_str_export_locale(VALUE);
-
-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_no_checksafe(v))
-
-void rb_secure(int);
-int rb_safe_level(void);
-void rb_set_safe_level(int);
-void rb_set_safe_level_force(int);
-void rb_secure_update(VALUE);
-NORETURN(void rb_insecure_operation(void));
-
-VALUE rb_errinfo(void);
-void rb_set_errinfo(VALUE);
-
-SIGNED_VALUE rb_num2long(VALUE);
-VALUE rb_num2ulong(VALUE);
-#define NUM2LONG_internal(x) (FIXNUM_P(x) ? FIX2LONG(x) : rb_num2long(x))
-#ifdef __GNUC__
-#define NUM2LONG(x) \
- __extension__ ({VALUE num2long_x = (x); NUM2LONG_internal(num2long_x);})
-#else
-static inline long
-NUM2LONG(VALUE x)
-{
- return NUM2LONG_internal(x);
-}
-#endif
-#define NUM2ULONG(x) rb_num2ulong((VALUE)x)
-#if SIZEOF_INT < SIZEOF_LONG
-long rb_num2int(VALUE);
-long rb_fix2int(VALUE);
-#define FIX2INT(x) ((int)rb_fix2int((VALUE)x))
-static inline int
-NUM2INT(VALUE x)
-{
- return FIXNUM_P(x) ? FIX2INT(x) : (int)rb_num2int(x);
-}
-unsigned long rb_num2uint(VALUE);
-#define NUM2UINT(x) ((unsigned int)rb_num2uint(x))
-unsigned long rb_fix2uint(VALUE);
-#define FIX2UINT(x) ((unsigned int)rb_fix2uint(x))
-#else
-#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
-
-#ifdef HAVE_LONG_LONG
-LONG_LONG rb_num2ll(VALUE);
-unsigned LONG_LONG rb_num2ull(VALUE);
-static inline LONG_LONG
-NUM2LL(VALUE x)
-{
- return FIXNUM_P(x) ? FIX2LONG(x) : rb_num2ll(x);
-}
-# define NUM2ULL(x) rb_num2ull((VALUE)x)
-#endif
-
-#if defined(HAVE_LONG_LONG) && SIZEOF_OFF_T > SIZEOF_LONG
-# define NUM2OFFT(x) ((off_t)NUM2LL(x))
-#else
-# define NUM2OFFT(x) NUM2LONG(x)
-#endif
-
-#if defined(HAVE_LONG_LONG) && SIZEOF_SIZE_T > SIZEOF_LONG
-# define NUM2SIZET(x) ((size_t)NUM2ULL(x))
-# define NUM2SSIZET(x) ((size_t)NUM2LL(x))
-#else
-# define NUM2SIZET(x) NUM2ULONG(x)
-# define NUM2SSIZET(x) NUM2LONG(x)
-#endif
-
-double rb_num2dbl(VALUE);
-#define NUM2DBL(x) rb_num2dbl((VALUE)(x))
-
-VALUE rb_uint2big(VALUE);
-VALUE rb_int2big(SIGNED_VALUE);
-
-#if SIZEOF_INT < SIZEOF_VALUE
-# define INT2NUM(v) INT2FIX((int)(v))
-# define UINT2NUM(v) LONG2FIX((unsigned int)(v))
-#else
-static inline VALUE
-INT2NUM(int v)
-{
- if (!FIXABLE(v))
- return rb_int2big(v);
- return INT2FIX(v);
-}
-
-static inline VALUE
-UINT2NUM(unsigned int v)
-{
- if (!POSFIXABLE(v))
- return rb_uint2big(v);
- return LONG2FIX(v);
-}
-#endif
-
-static inline VALUE
-LONG2NUM(long v)
-{
- if (FIXABLE(v)) return LONG2FIX(v);
- return rb_int2big(v);
-}
-
-static inline VALUE
-ULONG2NUM(unsigned long v)
-{
- if (POSFIXABLE(v)) return LONG2FIX(v);
- return rb_uint2big(v);
-}
-
-#define NUM2CHR(x) (((TYPE(x) == T_STRING)&&(RSTRING_LEN(x)>=1))?\
- RSTRING_PTR(x)[0]:(char)(NUM2INT(x)&0xff))
-#define CHR2FIX(x) INT2FIX((long)((x)&0xff))
-
-VALUE rb_newobj(void);
-#define NEWOBJ(obj,type) type *obj = (type*)rb_newobj()
-#define OBJSETUP(obj,c,t) do {\
- RBASIC(obj)->flags = (t);\
- RBASIC(obj)->klass = (c);\
- if (rb_safe_level() >= 3) FL_SET(obj, FL_TAINT | FL_UNTRUSTED);\
-} while (0)
-#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|FL_UNTRUSTED)); \
- if (FL_TEST(obj, FL_EXIVAR)) rb_copy_generic_ivar((VALUE)dup,(VALUE)obj);\
-} while (0)
-
-struct RBasic {
- VALUE flags;
- VALUE klass;
-};
-
-#define ROBJECT_EMBED_LEN_MAX 3
-struct RObject {
- struct RBasic basic;
- union {
- struct {
- long numiv;
- VALUE *ivptr;
- 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 : \
- ROBJECT(o)->as.heap.numiv)
-#define ROBJECT_IVPTR(o) \
- ((RBASIC(o)->flags & ROBJECT_EMBED) ? \
- ROBJECT(o)->as.ary : \
- ROBJECT(o)->as.heap.ivptr)
-#define ROBJECT_IV_INDEX_TBL(o) \
- ((RBASIC(o)->flags & ROBJECT_EMBED) ? \
- RCLASS_IV_INDEX_TBL(rb_obj_class(o)) : \
- ROBJECT(o)->as.heap.iv_index_tbl)
-
-typedef struct {
- VALUE super;
- struct st_table *iv_tbl;
-} rb_classext_t;
-
-struct RClass {
- struct RBasic basic;
- rb_classext_t *ptr;
- struct st_table *m_tbl;
- struct st_table *iv_index_tbl;
-};
-#define RCLASS_IV_TBL(c) (RCLASS(c)->ptr->iv_tbl)
-#define RCLASS_M_TBL(c) (RCLASS(c)->m_tbl)
-#define RCLASS_SUPER(c) (RCLASS(c)->ptr->super)
-#define RCLASS_IV_INDEX_TBL(c) (RCLASS(c)->iv_index_tbl)
-#define RMODULE_IV_TBL(m) RCLASS_IV_TBL(m)
-#define RMODULE_M_TBL(m) RCLASS_M_TBL(m)
-#define RMODULE_SUPER(m) RCLASS_SUPER(m)
-
-struct RFloat {
- struct RBasic basic;
- double float_value;
-};
-#define RFLOAT_VALUE(v) (RFLOAT(v)->float_value)
-#define DBL2NUM(dbl) rb_float_new(dbl)
-
-#define ELTS_SHARED FL_USER2
-
-#define RSTRING_EMBED_LEN_MAX ((int)((sizeof(VALUE)*3)/sizeof(char)-1))
-struct RString {
- struct RBasic basic;
- union {
- struct {
- long len;
- char *ptr;
- union {
- long capa;
- VALUE shared;
- } aux;
- } heap;
- char ary[RSTRING_EMBED_LEN_MAX + 1];
- } as;
-};
-#define RSTRING_NOEMBED FL_USER1
-#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_LEN(str) \
- (!(RBASIC(str)->flags & RSTRING_NOEMBED) ? \
- (long)((RBASIC(str)->flags >> RSTRING_EMBED_LEN_SHIFT) & \
- (RSTRING_EMBED_LEN_MASK >> RSTRING_EMBED_LEN_SHIFT)) : \
- RSTRING(str)->as.heap.len)
-#define RSTRING_PTR(str) \
- (!(RBASIC(str)->flags & RSTRING_NOEMBED) ? \
- RSTRING(str)->as.ary : \
- RSTRING(str)->as.heap.ptr)
-#define RSTRING_END(str) (RSTRING_PTR(str)+RSTRING_LEN(str))
-
-#define RARRAY_EMBED_LEN_MAX 3
-struct RArray {
- struct RBasic basic;
- union {
- struct {
- long len;
- union {
- long capa;
- VALUE shared;
- } aux;
- VALUE *ptr;
- } heap;
- VALUE ary[RARRAY_EMBED_LEN_MAX];
- } as;
-};
-#define RARRAY_EMBED_FLAG FL_USER1
-/* FL_USER2 is for ELTS_SHARED */
-#define RARRAY_EMBED_LEN_MASK (FL_USER4|FL_USER3)
-#define RARRAY_EMBED_LEN_SHIFT (FL_USHIFT+3)
-#define RARRAY_LEN(a) \
- ((RBASIC(a)->flags & RARRAY_EMBED_FLAG) ? \
- (long)((RBASIC(a)->flags >> RARRAY_EMBED_LEN_SHIFT) & \
- (RARRAY_EMBED_LEN_MASK >> RARRAY_EMBED_LEN_SHIFT)) : \
- RARRAY(a)->as.heap.len)
-#define RARRAY_PTR(a) \
- ((RBASIC(a)->flags & RARRAY_EMBED_FLAG) ? \
- RARRAY(a)->as.ary : \
- RARRAY(a)->as.heap.ptr)
-
-#if SIZEOF_INT < SIZEOF_VALUE
-NORETURN(void rb_out_of_int(SIGNED_VALUE num));
-#endif
-
-#if SIZEOF_INT < SIZEOF_LONG
-#define rb_long2int_internal(n, i) \
- int i = (int)(n); \
- if ((long)i != (n)) rb_out_of_int(n)
-#ifdef __GNUC__
-#define rb_long2int(i2l_n) __extension__ ({rb_long2int_internal(i2l_n, i2l_i); i2l_i;})
-#else
-static inline int
-rb_long2int(long n) {rb_long2int_internal(n, i); return i;}
-#endif
-#else
-#define rb_long2int(n) ((int)(n))
-#endif
-#define RARRAY_LENINT(ary) rb_long2int(RARRAY_LEN(ary))
-
-struct RRegexp {
- struct RBasic basic;
- struct re_pattern_buffer *ptr;
- VALUE src;
- unsigned long usecnt;
-};
-#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)
-
-struct RHash {
- struct RBasic basic;
- struct st_table *ntbl; /* possibly 0 */
- int iter_lev;
- VALUE ifnone;
-};
-/* RHASH_TBL allocates st_table if not available. */
-#define RHASH_TBL(h) rb_hash_tbl(h)
-#define RHASH_ITER_LEV(h) (RHASH(h)->iter_lev)
-#define RHASH_IFNONE(h) (RHASH(h)->ifnone)
-#define RHASH_SIZE(h) (RHASH(h)->ntbl ? RHASH(h)->ntbl->num_entries : 0)
-#define RHASH_EMPTY_P(h) (RHASH_SIZE(h) == 0)
-
-struct RFile {
- struct RBasic basic;
- struct rb_io_t *fptr;
-};
-
-struct RRational {
- struct RBasic basic;
- VALUE num;
- VALUE den;
-};
-
-struct RComplex {
- struct RBasic basic;
- VALUE real;
- VALUE imag;
-};
-
-struct RData {
- struct RBasic basic;
- void (*dmark)(void*);
- void (*dfree)(void*);
- void *data;
-};
-
-typedef struct rb_data_type_struct {
- const char *wrap_struct_name;
- void (*dmark)(void*);
- void (*dfree)(void*);
- size_t (*dsize)(void *);
- void *ary[4]; /* for extension */
-} rb_data_type_t;
-
-struct RTypedData {
- struct RBasic basic;
- const rb_data_type_t *type;
- VALUE typed_flag; /* 1 or not */
- void *data;
-};
-
-#define DATA_PTR(dta) (RDATA(dta)->data)
-
-#define RTYPEDDATA_P(v) (RTYPEDDATA(v)->typed_flag == 1)
-#define RTYPEDDATA_TYPE(v) (RTYPEDDATA(v)->type)
-#define RTYPEDDATA_DATA(v) (RTYPEDDATA(v)->data)
-
-/*
-#define RUBY_DATA_FUNC(func) ((void (*)(void*))func)
-*/
-typedef void (*RUBY_DATA_FUNC)(void*);
-
-VALUE rb_data_object_alloc(VALUE,void*,RUBY_DATA_FUNC,RUBY_DATA_FUNC);
-VALUE rb_data_typed_object_alloc(VALUE klass, void *datap, const rb_data_type_t *);
-int rb_typeddata_is_kind_of(VALUE, const rb_data_type_t *);
-void *rb_check_typeddata(VALUE, const rb_data_type_t *);
-#define Check_TypedStruct(v,t) rb_check_typeddata((VALUE)(v),t)
-#define RUBY_TYPED_DEFAULT_FREE ((void (*)(void *))-1)
-
-#define Data_Wrap_Struct(klass,mark,free,sval)\
- rb_data_object_alloc(klass,sval,(RUBY_DATA_FUNC)mark,(RUBY_DATA_FUNC)free)
-
-#define Data_Make_Struct(klass,type,mark,free,sval) (\
- sval = ALLOC(type),\
- memset(sval, 0, sizeof(type)),\
- Data_Wrap_Struct(klass,mark,free,sval)\
-)
-
-#define TypedData_Wrap_Struct(klass,data_type,sval)\
- rb_data_typed_object_alloc(klass,sval,data_type)
-
-#define TypedData_Make_Struct(klass, type, data_type, sval) (\
- sval = ALLOC(type),\
- memset(sval, 0, sizeof(type)),\
- TypedData_Wrap_Struct(klass,data_type,sval)\
-)
-
-#define Data_Get_Struct(obj,type,sval) do {\
- Check_Type(obj, T_DATA); \
- sval = (type*)DATA_PTR(obj);\
-} while (0)
-
-#define TypedData_Get_Struct(obj,type,data_type,sval) do {\
- sval = (type*)rb_check_typeddata(obj, data_type); \
-} while (0)
-
-#define RSTRUCT_EMBED_LEN_MAX 3
-struct RStruct {
- struct RBasic basic;
- union {
- struct {
- long len;
- VALUE *ptr;
- } heap;
- 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_PTR(st) \
- ((RBASIC(st)->flags & RSTRUCT_EMBED_LEN_MASK) ? \
- RSTRUCT(st)->as.ary : \
- RSTRUCT(st)->as.heap.ptr)
-
-#define RBIGNUM_EMBED_LEN_MAX ((int)((sizeof(VALUE)*3)/sizeof(BDIGIT)))
-struct RBignum {
- struct RBasic basic;
- union {
- struct {
- long len;
- BDIGIT *digits;
- } heap;
- BDIGIT ary[RBIGNUM_EMBED_LEN_MAX];
- } as;
-};
-#define RBIGNUM_SIGN_BIT FL_USER1
-/* sign: positive:1, negative:0 */
-#define RBIGNUM_SIGN(b) ((RBASIC(b)->flags & RBIGNUM_SIGN_BIT) != 0)
-#define RBIGNUM_SET_SIGN(b,sign) \
- ((sign) ? (RBASIC(b)->flags |= RBIGNUM_SIGN_BIT) \
- : (RBASIC(b)->flags &= ~RBIGNUM_SIGN_BIT))
-#define RBIGNUM_POSITIVE_P(b) RBIGNUM_SIGN(b)
-#define RBIGNUM_NEGATIVE_P(b) (!RBIGNUM_SIGN(b))
-
-#define RBIGNUM_EMBED_FLAG FL_USER2
-#define RBIGNUM_EMBED_LEN_MASK (FL_USER5|FL_USER4|FL_USER3)
-#define RBIGNUM_EMBED_LEN_SHIFT (FL_USHIFT+3)
-#define RBIGNUM_LEN(b) \
- ((RBASIC(b)->flags & RBIGNUM_EMBED_FLAG) ? \
- (long)((RBASIC(b)->flags >> RBIGNUM_EMBED_LEN_SHIFT) & \
- (RBIGNUM_EMBED_LEN_MASK >> RBIGNUM_EMBED_LEN_SHIFT)) : \
- RBIGNUM(b)->as.heap.len)
-/* LSB:RBIGNUM_DIGITS(b)[0], MSB:RBIGNUM_DIGITS(b)[RBIGNUM_LEN(b)-1] */
-#define RBIGNUM_DIGITS(b) \
- ((RBASIC(b)->flags & RBIGNUM_EMBED_FLAG) ? \
- RBIGNUM(b)->as.ary : \
- RBIGNUM(b)->as.heap.digits)
-
-#define R_CAST(st) (struct st*)
-#define RBASIC(obj) (R_CAST(RBasic)(obj))
-#define ROBJECT(obj) (R_CAST(RObject)(obj))
-#define RCLASS(obj) (R_CAST(RClass)(obj))
-#define RMODULE(obj) RCLASS(obj)
-#define RFLOAT(obj) (R_CAST(RFloat)(obj))
-#define RSTRING(obj) (R_CAST(RString)(obj))
-#define RREGEXP(obj) (R_CAST(RRegexp)(obj))
-#define RARRAY(obj) (R_CAST(RArray)(obj))
-#define RHASH(obj) (R_CAST(RHash)(obj))
-#define RDATA(obj) (R_CAST(RData)(obj))
-#define RTYPEDDATA(obj) (R_CAST(RTypedData)(obj))
-#define RSTRUCT(obj) (R_CAST(RStruct)(obj))
-#define RBIGNUM(obj) (R_CAST(RBignum)(obj))
-#define RFILE(obj) (R_CAST(RFile)(obj))
-#define RRATIONAL(obj) (R_CAST(RRational)(obj))
-#define RCOMPLEX(obj) (R_CAST(RComplex)(obj))
-
-#define FL_SINGLETON FL_USER0
-#define FL_MARK (((VALUE)1)<<5)
-#define FL_REMEMBERED_SET (((VALUE)1)<<6)
-#define FL_FINALIZE (((VALUE)1)<<7)
-#define FL_TAINT (((VALUE)1)<<8)
-#define FL_UNTRUSTED (((VALUE)1)<<9)
-#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(x,f) (FL_ABLE(x)?(RBASIC(x)->flags&(f)):0)
-#define FL_ANY(x,f) FL_TEST(x,f)
-#define FL_ALL(x,f) (FL_TEST(x,f) == (f))
-#define FL_SET(x,f) do {if (FL_ABLE(x)) RBASIC(x)->flags |= (f);} while (0)
-#define FL_UNSET(x,f) do {if (FL_ABLE(x)) RBASIC(x)->flags &= ~(f);} while (0)
-#define FL_REVERSE(x,f) do {if (FL_ABLE(x)) RBASIC(x)->flags ^= (f);} while (0)
-
-#define OBJ_TAINTED(x) (!!FL_TEST((x), FL_TAINT))
-#define OBJ_TAINT(x) FL_SET((x), FL_TAINT)
-#define OBJ_UNTRUSTED(x) (!!FL_TEST((x), FL_UNTRUSTED))
-#define OBJ_UNTRUST(x) FL_SET((x), FL_UNTRUSTED)
-#define OBJ_INFECT(x,s) do {if (FL_ABLE(x) && FL_ABLE(s)) RBASIC(x)->flags |= RBASIC(s)->flags & (FL_TAINT | FL_UNTRUSTED);} while (0)
-
-#define OBJ_FROZEN(x) (!!FL_TEST((x), FL_FREEZE))
-#define OBJ_FREEZE(x) FL_SET((x), FL_FREEZE)
-
-#define ALLOC_N(type,n) (type*)xmalloc2((n),sizeof(type))
-#define ALLOC(type) (type*)xmalloc(sizeof(type))
-#define REALLOC_N(var,type,n) (var)=(type*)xrealloc2((char*)(var),(n),sizeof(type))
-
-#define ALLOCA_N(type,n) (type*)alloca(sizeof(type)*(n))
-
-#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);
-int ruby_glob(const char*,int,ruby_glob_func*,VALUE);
-int ruby_brace_glob(const char*,int,ruby_glob_func*,VALUE);
-
-VALUE rb_define_class(const char*,VALUE);
-VALUE rb_define_module(const char*);
-VALUE rb_define_class_under(VALUE, const char*, VALUE);
-VALUE rb_define_module_under(VALUE, const char*);
-
-void rb_include_module(VALUE,VALUE);
-void rb_extend_object(VALUE,VALUE);
-
-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);
-
-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);
-
-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);
-
-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);
-
-void rb_gvar_readonly_setter(VALUE val, ID id, void *data, struct rb_global_variable *gvar);
-
-void rb_define_variable(const char*,VALUE*);
-void rb_define_virtual_variable(const char*,VALUE(*)(ANYARGS),void(*)(ANYARGS));
-void rb_define_hooked_variable(const char*,VALUE*,VALUE(*)(ANYARGS),void(*)(ANYARGS));
-void rb_define_readonly_variable(const char*,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);
-
-void rb_undef_method(VALUE,const char*);
-void rb_define_alias(VALUE,const char*,const char*);
-void rb_define_attr(VALUE,const char*,int,int);
-
-void rb_global_variable(VALUE*);
-void rb_gc_register_mark_object(VALUE);
-void rb_gc_register_address(VALUE*);
-void rb_gc_unregister_address(VALUE*);
-
-ID rb_intern(const char*);
-ID rb_intern2(const char*, long);
-ID rb_intern_str(VALUE str);
-const char *rb_id2name(ID);
-ID rb_to_id(VALUE);
-VALUE rb_id2str(ID);
-
-#define CONST_ID_CACHE(result, str) \
- { \
- static ID rb_intern_id_cache; \
- if (!rb_intern_id_cache) \
- rb_intern_id_cache = rb_intern2(str, strlen(str)); \
- result rb_intern_id_cache; \
- }
-#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__ (CONST_ID_CACHE(/**/, str)) : \
- rb_intern(str))
-#define rb_intern_const(str) \
- (__builtin_constant_p(str) ? \
- __extension__ (rb_intern2(str, strlen(str))) : \
- (rb_intern)(str))
-#else
-#define rb_intern_const(str) rb_intern2(str, strlen(str))
-#endif
-
-const char *rb_class2name(VALUE);
-const char *rb_obj_classname(VALUE);
-
-void rb_p(VALUE);
-
-VALUE rb_eval_string(const char*);
-VALUE rb_eval_string_protect(const char*, int*);
-VALUE rb_eval_string_wrap(const char*, int*);
-VALUE rb_funcall(VALUE, ID, int, ...);
-VALUE rb_funcall2(VALUE, ID, int, const VALUE*);
-VALUE rb_funcall3(VALUE, ID, int, const VALUE*);
-int rb_scan_args(int, const VALUE*, const char*, ...);
-VALUE rb_call_super(int, const VALUE*);
-
-VALUE rb_gv_set(const char*, VALUE);
-VALUE rb_gv_get(const char*);
-VALUE rb_iv_get(VALUE, const char*);
-VALUE rb_iv_set(VALUE, const char*, VALUE);
-
-VALUE rb_equal(VALUE,VALUE);
-
-VALUE *rb_ruby_verbose_ptr(void);
-VALUE *rb_ruby_debug_ptr(void);
-#define ruby_verbose (*rb_ruby_verbose_ptr())
-#define ruby_debug (*rb_ruby_debug_ptr())
-
-PRINTF_ARGS(NORETURN(void rb_raise(VALUE, const char*, ...)), 2, 3);
-PRINTF_ARGS(NORETURN(void rb_fatal(const char*, ...)), 1, 2);
-PRINTF_ARGS(NORETURN(void rb_bug(const char*, ...)), 1, 2);
-NORETURN(void rb_sys_fail(const char*));
-NORETURN(void rb_mod_sys_fail(VALUE, const char*));
-NORETURN(void rb_iter_break(void));
-NORETURN(void rb_exit(int));
-NORETURN(void rb_notimplement(void));
-
-/* 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 */
-PRINTF_ARGS(void rb_warn(const char*, ...), 1, 2);
-PRINTF_ARGS(void rb_compile_warn(const char *, int, const char*, ...), 3, 4);
-
-typedef VALUE rb_block_call_func(VALUE, VALUE, int, VALUE*);
-
-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_splat(VALUE);
-int rb_block_given_p(void);
-void rb_need_block(void);
-VALUE rb_iterate(VALUE(*)(VALUE),VALUE,VALUE(*)(ANYARGS),VALUE);
-VALUE rb_block_call(VALUE,ID,int,VALUE*,VALUE(*)(ANYARGS),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));
-
-VALUE rb_require(const char*);
-
-#ifdef __ia64
-void ruby_init_stack(volatile VALUE*, void*);
-#define ruby_init_stack(addr) ruby_init_stack(addr, rb_ia64_bsp())
-#else
-void ruby_init_stack(volatile VALUE*);
-#endif
-#define RUBY_INIT_STACK \
- VALUE variable_in_this_stack_frame; \
- ruby_init_stack(&variable_in_this_stack_frame);
-void ruby_init(void);
-void *ruby_options(int, char**);
-int ruby_run_node(void *);
-
-RUBY_EXTERN VALUE rb_mKernel;
-RUBY_EXTERN VALUE rb_mComparable;
-RUBY_EXTERN VALUE rb_mEnumerable;
-RUBY_EXTERN VALUE rb_mErrno;
-RUBY_EXTERN VALUE rb_mFileTest;
-RUBY_EXTERN VALUE rb_mGC;
-RUBY_EXTERN VALUE rb_mMath;
-RUBY_EXTERN VALUE rb_mProcess;
-RUBY_EXTERN VALUE rb_mWaitReadable;
-RUBY_EXTERN VALUE rb_mWaitWritable;
-
-RUBY_EXTERN VALUE rb_cBasicObject;
-RUBY_EXTERN VALUE rb_cObject;
-RUBY_EXTERN VALUE rb_cArray;
-RUBY_EXTERN VALUE rb_cBignum;
-RUBY_EXTERN VALUE rb_cBinding;
-RUBY_EXTERN VALUE rb_cClass;
-RUBY_EXTERN VALUE rb_cCont;
-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_cFile;
-RUBY_EXTERN VALUE rb_cFixnum;
-RUBY_EXTERN VALUE rb_cFloat;
-RUBY_EXTERN VALUE rb_cHash;
-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;
-RUBY_EXTERN VALUE rb_cNameErrorMesg;
-RUBY_EXTERN VALUE rb_cNilClass;
-RUBY_EXTERN VALUE rb_cNumeric;
-RUBY_EXTERN VALUE rb_cProc;
-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;
-RUBY_EXTERN VALUE rb_cStruct;
-RUBY_EXTERN VALUE rb_cSymbol;
-RUBY_EXTERN VALUE rb_cThread;
-RUBY_EXTERN VALUE rb_cTime;
-RUBY_EXTERN VALUE rb_cTrueClass;
-RUBY_EXTERN VALUE rb_cUnboundMethod;
-
-RUBY_EXTERN VALUE rb_eException;
-RUBY_EXTERN VALUE rb_eStandardError;
-RUBY_EXTERN VALUE rb_eSystemExit;
-RUBY_EXTERN VALUE rb_eInterrupt;
-RUBY_EXTERN VALUE rb_eSignal;
-RUBY_EXTERN VALUE rb_eFatal;
-RUBY_EXTERN VALUE rb_eArgError;
-RUBY_EXTERN VALUE rb_eEOFError;
-RUBY_EXTERN VALUE rb_eIndexError;
-RUBY_EXTERN VALUE rb_eStopIteration;
-RUBY_EXTERN VALUE rb_eKeyError;
-RUBY_EXTERN VALUE rb_eRangeError;
-RUBY_EXTERN VALUE rb_eIOError;
-RUBY_EXTERN VALUE rb_eRuntimeError;
-RUBY_EXTERN VALUE rb_eSecurityError;
-RUBY_EXTERN VALUE rb_eSystemCallError;
-RUBY_EXTERN VALUE rb_eThreadError;
-RUBY_EXTERN VALUE rb_eTypeError;
-RUBY_EXTERN VALUE rb_eZeroDivError;
-RUBY_EXTERN VALUE rb_eNotImpError;
-RUBY_EXTERN VALUE rb_eNoMemError;
-RUBY_EXTERN VALUE rb_eNoMethodError;
-RUBY_EXTERN VALUE rb_eFloatDomainError;
-RUBY_EXTERN VALUE rb_eLocalJumpError;
-RUBY_EXTERN VALUE rb_eSysStackError;
-RUBY_EXTERN VALUE rb_eRegexpError;
-RUBY_EXTERN VALUE rb_eEncodingError;
-RUBY_EXTERN VALUE rb_eEncCompatError;
-
-RUBY_EXTERN VALUE rb_eScriptError;
-RUBY_EXTERN VALUE rb_eNameError;
-RUBY_EXTERN VALUE rb_eSyntaxError;
-RUBY_EXTERN VALUE rb_eLoadError;
-
-RUBY_EXTERN VALUE rb_stdin, rb_stdout, rb_stderr;
-
-static inline VALUE
-rb_class_of(VALUE obj)
-{
- if (IMMEDIATE_P(obj)) {
- if (FIXNUM_P(obj)) return rb_cFixnum;
- if (obj == Qtrue) return rb_cTrueClass;
- if (SYMBOL_P(obj)) return rb_cSymbol;
- }
- else if (!RTEST(obj)) {
- if (obj == Qnil) return rb_cNilClass;
- if (obj == Qfalse) return rb_cFalseClass;
- }
- return RBASIC(obj)->klass;
-}
-
-static inline int
-rb_type(VALUE obj)
-{
- if (IMMEDIATE_P(obj)) {
- if (FIXNUM_P(obj)) return T_FIXNUM;
- if (obj == Qtrue) return T_TRUE;
- if (SYMBOL_P(obj)) return T_SYMBOL;
- if (obj == Qundef) return T_UNDEF;
- }
- else if (!RTEST(obj)) {
- if (obj == Qnil) return T_NIL;
- if (obj == Qfalse) return T_FALSE;
- }
- return BUILTIN_TYPE(obj);
-}
-
-static inline int
-rb_special_const_p(VALUE obj)
-{
- if (SPECIAL_CONST_P(obj)) return (int)Qtrue;
- return (int)Qfalse;
-}
-
-#include "ruby/missing.h"
-#include "ruby/intern.h"
-
-#if defined(EXTLIB) && defined(USE_DLN_A_OUT)
-/* hook for external modules */
-static char *dln_libs_to_be_linked[] = { EXTLIB, 0 };
-#endif
-
-#if (defined(__APPLE__) || defined(__NeXT__)) && defined(__MACH__)
-/* to link startup code with ObjC support */
-#define RUBY_GLOBAL_SETUP static void objcdummyfunction(void) {objc_msgSend();}
-#else
-#define RUBY_GLOBAL_SETUP
-#endif
-
-void ruby_sysinit(int *, char ***);
-
-#define RUBY_VM 1 /* YARV */
-#define HAVE_NATIVETHREAD
-int ruby_native_thread_p(void);
-
-#define RUBY_EVENT_NONE 0x0000
-#define RUBY_EVENT_LINE 0x0001
-#define RUBY_EVENT_CLASS 0x0002
-#define RUBY_EVENT_END 0x0004
-#define RUBY_EVENT_CALL 0x0008
-#define RUBY_EVENT_RETURN 0x0010
-#define RUBY_EVENT_C_CALL 0x0020
-#define RUBY_EVENT_C_RETURN 0x0040
-#define RUBY_EVENT_RAISE 0x0080
-#define RUBY_EVENT_ALL 0xffff
-#define RUBY_EVENT_VM 0x10000
-#define RUBY_EVENT_SWITCH 0x20000
-#define RUBY_EVENT_COVERAGE 0x40000
-
-typedef unsigned int rb_event_flag_t;
-typedef void (*rb_event_hook_func_t)(rb_event_flag_t, VALUE data, VALUE, ID, VALUE klass);
-
-typedef struct rb_event_hook_struct {
- rb_event_flag_t flag;
- rb_event_hook_func_t func;
- VALUE data;
- struct rb_event_hook_struct *next;
-} rb_event_hook_t;
-
-#define RB_EVENT_HOOKS_HAVE_CALLBACK_DATA 1
-void rb_add_event_hook(rb_event_hook_func_t func, rb_event_flag_t events,
- VALUE data);
-int rb_remove_event_hook(rb_event_hook_func_t func);
-
-/* locale insensitive functions */
-
-#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((unsigned char)(c))
-#undef ISPRINT
-#define ISPRINT(c) rb_isprint((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_strcasecmp(const char *s1, const char *s2);
-int st_strncasecmp(const char *s1, const char *s2, size_t n);
-#define STRCASECMP(s1, s2) (st_strcasecmp(s1, s2))
-#define STRNCASECMP(s1, s2, n) (st_strncasecmp(s1, s2, n))
-
-unsigned long ruby_strtoul(const char *str, char **endptr, int base);
-#define STRTOUL(str, endptr, base) (ruby_strtoul(str, endptr, base))
-
-#if defined(__cplusplus)
-#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
deleted file mode 100644
index aebdaf569d..0000000000
--- a/include/ruby/st.h
+++ /dev/null
@@ -1,119 +0,0 @@
-/* This is a public domain general purpose hash table package written by Peter Moore @ UCB. */
-
-/* @(#) st.h 5.1 89/12/14 */
-
-#ifndef RUBY_ST_H
-#define RUBY_ST_H 1
-
-#if defined(__cplusplus)
-extern "C" {
-#if 0
-} /* satisfy cc-mode */
-#endif
-#endif
-
-#ifndef RUBY_LIB
-#include "ruby/config.h"
-#include "ruby/defines.h"
-#ifdef RUBY_EXTCONF_H
-#include RUBY_EXTCONF_H
-#endif
-#endif
-
-#if defined STDC_HEADERS
-#include <stddef.h>
-#elif defined HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-
-#if SIZEOF_LONG == SIZEOF_VOIDP
-typedef unsigned long st_data_t;
-#elif SIZEOF_LONG_LONG == SIZEOF_VOIDP
-typedef unsigned LONG_LONG st_data_t;
-#else
-# error ---->> st.c requires sizeof(void*) == sizeof(long) to be compiled. <<----
-#endif
-#define ST_DATA_T_DEFINED
-
-#ifndef CHAR_BIT
-# ifdef HAVE_LIMITS_H
-# include <limits.h>
-# else
-# define CHAR_BIT 8
-# endif
-#endif
-#ifndef _
-# define _(args) args
-#endif
-#ifndef ANYARGS
-# ifdef __cplusplus
-# define ANYARGS ...
-# else
-# define ANYARGS
-# endif
-#endif
-
-typedef struct st_table st_table;
-
-typedef int st_compare_func(st_data_t, st_data_t);
-typedef int st_hash_func(st_data_t);
-
-struct st_hash_type {
- int (*compare)(ANYARGS /*st_data_t, st_data_t*/); /* st_compare_func* */
- int (*hash)(ANYARGS /*st_data_t*/); /* st_hash_func* */
-};
-
-typedef st_data_t st_index_t;
-#define ST_INDEX_BITS (sizeof(st_index_t) * CHAR_BIT)
-
-struct st_table {
- const struct st_hash_type *type;
- st_index_t num_bins;
- unsigned int entries_packed : 1;
-#ifdef __GNUC__
- __extension__
-#endif
- st_index_t num_entries : ST_INDEX_BITS - 1;
- struct st_table_entry **bins;
- struct st_table_entry *head, *tail;
-};
-
-#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_table *st_init_table(const struct st_hash_type *);
-st_table *st_init_table_with_size(const struct st_hash_type *, int);
-st_table *st_init_numtable(void);
-st_table *st_init_numtable_with_size(int);
-st_table *st_init_strtable(void);
-st_table *st_init_strtable_with_size(int);
-st_table *st_init_strcasetable(void);
-st_table *st_init_strcasetable_with_size(int);
-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_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 *);
-int st_foreach(st_table *, int (*)(ANYARGS), st_data_t);
-int st_reverse_foreach(st_table *, int (*)(ANYARGS), st_data_t);
-void st_add_direct(st_table *, st_data_t, st_data_t);
-void st_free_table(st_table *);
-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);
-int st_numhash(st_data_t);
-int st_strcasecmp(const char *s1, const char *s2);
-int st_strncasecmp(const char *s1, const char *s2, size_t n);
-size_t st_memsize(st_table *);
-
-#if defined(__cplusplus)
-#if 0
-{ /* satisfy cc-mode */
-#endif
-} /* extern "C" { */
-#endif
-
-#endif /* RUBY_ST_H */
diff --git a/include/ruby/util.h b/include/ruby/util.h
deleted file mode 100644
index 1c52c576da..0000000000
--- a/include/ruby/util.h
+++ /dev/null
@@ -1,96 +0,0 @@
-/**********************************************************************
-
- util.h -
-
- $Author$
- created at: Thu Mar 9 11:55:53 JST 1995
-
- Copyright (C) 1993-2007 Yukihiro Matsumoto
-
-**********************************************************************/
-
-#ifndef RUBY_UTIL_H
-#define RUBY_UTIL_H 1
-
-#if defined(__cplusplus)
-extern "C" {
-#if 0
-} /* satisfy cc-mode */
-#endif
-#endif
-
-#ifndef _
-#ifdef __cplusplus
-# ifndef HAVE_PROTOTYPES
-# define HAVE_PROTOTYPES 1
-# endif
-# ifndef HAVE_STDARG_PROTOTYPES
-# define HAVE_STDARG_PROTOTYPES 1
-# endif
-#endif
-#ifdef HAVE_PROTOTYPES
-# define _(args) args
-#else
-# define _(args) ()
-#endif
-#ifdef HAVE_STDARG_PROTOTYPES
-# define __(args) args
-#else
-# define __(args) ()
-#endif
-#endif
-
-#define scan_oct(s,l,e) (int)ruby_scan_oct(s,l,e)
-unsigned long ruby_scan_oct(const char *, size_t, size_t *);
-#define scan_hex(s,l,e) (int)ruby_scan_hex(s,l,e)
-unsigned long ruby_scan_hex(const char *, size_t, size_t *);
-
-#if defined(__CYGWIN32__) || defined(_WIN32)
-void ruby_add_suffix(VALUE str, const char *suffix);
-#endif
-
-void ruby_qsort(void *, const size_t, const size_t,
- int (*)(const void *, const void *, void *), void *);
-
-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
-static inline double
-ruby_div0(double x)
-{
- double t = 0.0;
- return x / t;
-}
-#if defined _MSC_VER && _MSC_VER >= 1300
-#pragma warning(pop)
-#endif
-
-void ruby_each_words(const char *, void (*)(const char*, int, void*), void *);
-
-#if defined(__cplusplus)
-#if 0
-{ /* satisfy cc-mode */
-#endif
-} /* extern "C" { */
-#endif
-
-#endif /* RUBY_UTIL_H */
diff --git a/include/ruby/version.h b/include/ruby/version.h
deleted file mode 100644
index 32b09b3f52..0000000000
--- a/include/ruby/version.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/**********************************************************************
-
- ruby/version.h -
-
- $Author$
- created at: Wed May 13 12:56:56 JST 2009
-
- Copyright (C) 1993-2009 Yukihiro Matsumoto
- Copyright (C) 2000 Network Applied Communication Laboratory, Inc.
- Copyright (C) 2000 Information-technology Promotion Agency, Japan
-
-**********************************************************************/
-
-/*
- * This file contains only
- * - never-changable informations, and
- * - interfaces accessible from extension libraries.
- *
- * Never try to check RUBY_VERSION_CODE etc in extension libraries,
- * check the features with mkmf.rb instead.
- */
-
-#ifndef RUBY_VERSION_H
-#define RUBY_VERSION_H 1
-
-/* The origin. */
-#define RUBY_AUTHOR "Yukihiro Matsumoto"
-#define RUBY_BIRTH_YEAR 1993
-#define RUBY_BIRTH_MONTH 2
-#define RUBY_BIRTH_DAY 24
-
-#ifdef RUBY_EXTERN
-#if defined(__cplusplus)
-extern "C" {
-#if 0
-} /* satisfy cc-mode */
-#endif
-#endif
-/*
- * Interfaces from extension libraries.
- *
- * Before using these infos, think thrice whether they are really
- * necessary or not, and if the answer was yes, think twice a week
- * later again.
- */
-RUBY_EXTERN const char ruby_version[];
-RUBY_EXTERN const char ruby_release_date[];
-RUBY_EXTERN const char ruby_platform[];
-RUBY_EXTERN const int ruby_patchlevel;
-RUBY_EXTERN const char ruby_description[];
-RUBY_EXTERN const char ruby_copyright[];
-RUBY_EXTERN const char ruby_engine[];
-#if defined(__cplusplus)
-#if 0
-{ /* satisfy cc-mode */
-#endif
-} /* extern "C" { */
-#endif
-#endif
-
-#endif
diff --git a/include/ruby/vm.h b/include/ruby/vm.h
deleted file mode 100644
index 6843469735..0000000000
--- a/include/ruby/vm.h
+++ /dev/null
@@ -1,22 +0,0 @@
-/**********************************************************************
-
- ruby/vm.h -
-
- $Author$
- created at: Sat May 31 15:17:36 2008
-
- Copyright (C) 2008 Yukihiro Matsumoto
-
-**********************************************************************/
-
-#ifndef RUBY_VM_H
-#define RUBY_VM_H 1
-
-/* 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/
- */
-
-#endif /* RUBY_VM_H */
diff --git a/include/ruby/win32.h b/include/ruby/win32.h
deleted file mode 100644
index 7c0da1f49f..0000000000
--- a/include/ruby/win32.h
+++ /dev/null
@@ -1,563 +0,0 @@
-#ifndef RUBY_WIN32_H
-#define RUBY_WIN32_H 1
-
-#if defined(__cplusplus)
-extern "C" {
-#if 0
-} /* satisfy cc-mode */
-#endif
-#endif
-
-/*
- * 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.
- *
- */
-
-//
-// Definitions for NT port of Perl
-//
-
-
-//
-// Ok now we can include the normal include files.
-//
-
-// #include <stdarg.h> conflict with varargs.h?
-#if !defined(WSAAPI)
-#if defined(__cplusplus) && defined(_MSC_VER)
-extern "C++" { /* template without extern "C++" */
-#endif
-#include <winsock2.h>
-#include <ws2tcpip.h>
-#if defined(__cplusplus) && defined(_MSC_VER)
-}
-#endif
-#endif
-
-#define NT 1 /* deprecated */
-
-//
-// We're not using Microsoft's "extensions" to C for
-// Structured Exception Handling (SEH) so we can nuke these
-//
-#undef try
-#undef except
-#undef finally
-#undef leave
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <direct.h>
-#include <process.h>
-#include <time.h>
-#if defined(__cplusplus) && defined(_MSC_VER) && _MSC_VER == 1200
-extern "C++" { /* template without extern "C++" */
-#endif
-#include <math.h>
-#if defined(__cplusplus) && defined(_MSC_VER) && _MSC_VER == 1200
-}
-#endif
-#include <signal.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#ifdef HAVE_SYS_UTIME_H
-# include <sys/utime.h>
-#else
-# include <utime.h>
-#endif
-#include <io.h>
-#include <malloc.h>
-#if defined __MINGW32__ || __BORLANDC__ >= 0x0580
-# include <stdint.h>
-#else
-# if !defined(_INTPTR_T_DEFINED)
-# ifdef _WIN64
-typedef __int64 intptr_t;
-# else
-typedef int intptr_t;
-# endif
-# define _INTPTR_T_DEFINED
-# endif
-# if !defined(_UINTPTR_T_DEFINED)
-# ifdef _WIN64
-typedef unsigned __int64 uintptr_t;
-# else
-typedef unsigned int uintptr_t;
-# endif
-# define _UINTPTR_T_DEFINED
-# endif
-#endif
-#ifndef __MINGW32__
-# define mode_t int
-#endif
-
-#ifdef WIN95
-extern DWORD rb_w32_osid(void);
-#define rb_w32_iswinnt() (rb_w32_osid() == VER_PLATFORM_WIN32_NT)
-#define rb_w32_iswin95() (rb_w32_osid() == VER_PLATFORM_WIN32_WINDOWS)
-#else
-#define rb_w32_iswinnt() TRUE
-#define rb_w32_iswin95() FALSE
-#endif
-
-#define WNOHANG -1
-
-#undef getc
-#undef putc
-#undef fgetc
-#undef fputc
-#undef getchar
-#undef putchar
-#undef fgetchar
-#undef fputchar
-#undef utime
-#undef lseek
-#undef fstat
-#define getc(_stream) rb_w32_getc(_stream)
-#define getchar() rb_w32_getc(stdin)
-#define putc(_c, _stream) rb_w32_putc(_c, _stream)
-#define putchar(_c) rb_w32_putc(_c, stdout)
-#ifdef RUBY_EXPORT
-#define fgetc(_stream) getc(_stream)
-#define fputc(_c, _stream) putc(_c, _stream)
-#define fgetchar() getchar()
-#define fputchar(_c) putchar(_c)
-#define utime(_p, _t) rb_w32_utime(_p, _t)
-#define lseek(_f, _o, _w) _lseeki64(_f, _o, _w)
-
-#define pipe(p) rb_w32_pipe(p)
-#define open rb_w32_open
-#define close(h) rb_w32_close(h)
-#define fclose(f) rb_w32_fclose(f)
-#define read(f, b, s) rb_w32_read(f, b, s)
-#define write(f, b, s) rb_w32_write(f, b, s)
-#define getpid() rb_w32_getpid()
-#define getppid() rb_w32_getppid()
-#define sleep(x) rb_w32_Sleep((x)*1000)
-#define Sleep(msec) (void)rb_w32_Sleep(msec)
-#define fstat(fd,st) _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
-#define _fstati64(fd,st) rb_w32_fstati64(fd,st)
-#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
-
-#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
-
-#undef mkdir
-#define mkdir(p, m) rb_w32_mkdir(p, m)
-#undef rmdir
-#define rmdir(p) rb_w32_rmdir(p)
-#undef unlink
-#define unlink(p) rb_w32_unlink(p)
-#endif
-
-#if SIZEOF_OFF_T == 8
-#define off_t __int64
-#define stat stati64
-#if defined(__BORLANDC__)
-#define stati64(path, st) rb_w32_stati64(path, st)
-#elif !defined(_MSC_VER) || _MSC_VER < 1400
-#define stati64 _stati64
-#define _stati64(path, st) rb_w32_stati64(path, st)
-#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 strcasecmp _stricmp
-#define strncasecmp _strnicmp
-#define fsync _commit
-
-#ifdef __MINGW32__
-struct timezone {
- int tz_minuteswest;
- int tz_dsttime;
-};
-#undef isascii
-#define isascii __isascii
-#endif
-#define NtInitialize ruby_sysinit
-extern int rb_w32_cmdvector(const char *, char ***);
-extern rb_pid_t rb_w32_pipe_exec(const char *, const char *, int, int *, int *);
-extern int flock(int fd, int oper);
-extern int rb_w32_is_socket(int);
-extern int WSAAPI rb_w32_accept(int, struct sockaddr *, int *);
-extern int WSAAPI rb_w32_bind(int, const struct sockaddr *, int);
-extern int WSAAPI rb_w32_connect(int, const struct sockaddr *, int);
-extern void rb_w32_fdset(int, fd_set*);
-extern void rb_w32_fdclr(int, fd_set*);
-extern int rb_w32_fdisset(int, fd_set*);
-extern int WSAAPI rb_w32_select(int, fd_set *, fd_set *, fd_set *, struct timeval *);
-extern int WSAAPI rb_w32_getpeername(int, struct sockaddr *, int *);
-extern int WSAAPI rb_w32_getsockname(int, struct sockaddr *, int *);
-extern int WSAAPI rb_w32_getsockopt(int, int, int, char *, int *);
-extern int WSAAPI rb_w32_ioctlsocket(int, long, u_long *);
-extern int WSAAPI rb_w32_listen(int, int);
-extern int WSAAPI rb_w32_recv(int, char *, int, int);
-extern int WSAAPI rb_w32_recvfrom(int, char *, int, int, struct sockaddr *, int *);
-extern int WSAAPI rb_w32_send(int, const char *, int, int);
-extern int WSAAPI rb_w32_sendto(int, const char *, int, int, const struct sockaddr *, int);
-extern int WSAAPI rb_w32_setsockopt(int, int, int, const char *, int);
-extern int WSAAPI rb_w32_shutdown(int, int);
-extern int WSAAPI rb_w32_socket(int, int, int);
-extern SOCKET rb_w32_get_osfhandle(int);
-extern struct hostent *WSAAPI rb_w32_gethostbyaddr(const char *, int, int);
-extern struct hostent *WSAAPI rb_w32_gethostbyname(const char *);
-extern int WSAAPI rb_w32_gethostname(char *, int);
-extern struct protoent *WSAAPI rb_w32_getprotobyname(const char *);
-extern struct protoent *WSAAPI rb_w32_getprotobynumber(int);
-extern struct servent *WSAAPI rb_w32_getservbyname(const char *, const char *);
-extern struct servent *WSAAPI rb_w32_getservbyport(int, const char *);
-extern int rb_w32_socketpair(int, int, int, int *);
-extern char * rb_w32_getcwd(char *, int);
-extern char * rb_w32_getenv(const char *);
-extern int rb_w32_rename(const char *, const char *);
-extern char **rb_w32_get_environ(void);
-extern void rb_w32_free_environ(char **);
-extern int rb_w32_map_errno(DWORD);
-
-extern int chown(const char *, int, int);
-extern int link(const char *, const char *);
-extern int gettimeofday(struct timeval *, struct timezone *);
-extern rb_pid_t waitpid (rb_pid_t, int *, int);
-extern rb_pid_t rb_w32_spawn(int, const char *, const char*);
-extern rb_pid_t rb_w32_aspawn(int, const char *, char *const *);
-extern int kill(int, int);
-extern int fcntl(int, 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_mkdir(const char *, int);
-extern int rb_w32_rmdir(const char *);
-extern int rb_w32_unlink(const char *);
-extern int rb_w32_stati64(const char *, struct stati64 *);
-
-#ifdef __BORLANDC__
-extern int rb_w32_fstati64(int, struct stati64 *);
-extern off_t _lseeki64(int, off_t, int);
-extern FILE *rb_w32_fopen(const char *, const char *);
-extern FILE *rb_w32_fdopen(int, const char *);
-extern FILE *rb_w32_fsopen(const char *, const char *, int);
-#endif
-
-#include <float.h>
-#if !defined __MINGW32__ || defined __NO_ISOCEXT
-#ifndef isnan
-#define isnan(x) _isnan(x)
-#endif
-#ifndef finite
-#define finite(x) _finite(x)
-#endif
-#ifndef copysign
-#define copysign(a, b) _copysign(a, b)
-#endif
-#ifndef scalb
-#define scalb(a, b) _scalb(a, b)
-#endif
-#endif
-
-#if !defined S_IFIFO && defined _S_IFIFO
-#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
-#ifndef S_IRGRP
-#define S_IRGRP 0040
-#endif
-#ifndef S_IROTH
-#define S_IROTH 0004
-#endif
-
-#if !defined S_IWUSR && !defined __MINGW32__
-#define S_IWUSR 0200
-#endif
-#ifndef S_IWGRP
-#define S_IWGRP 0020
-#endif
-#ifndef S_IWOTH
-#define S_IWOTH 0002
-#endif
-
-#if !defined S_IXUSR && !defined __MINGW32__
-#define S_IXUSR 0100
-#endif
-#ifndef S_IXGRP
-#define S_IXGRP 0010
-#endif
-#ifndef S_IXOTH
-#define S_IXOTH 0001
-#endif
-
-//
-// define this so we can do inplace editing
-//
-
-#define SUFFIX
-extern int truncate(const char *path, off_t length);
-extern int ftruncate(int fd, off_t length);
-extern int fseeko(FILE *stream, off_t offset, int whence);
-extern off_t ftello(FILE *stream);
-
-//
-// stubs
-//
-extern int ioctl (int, int, ...);
-extern rb_uid_t getuid (void);
-extern rb_uid_t geteuid (void);
-extern rb_gid_t getgid (void);
-extern rb_gid_t getegid (void);
-extern int setuid (rb_uid_t);
-extern int setgid (rb_gid_t);
-
-extern char *rb_w32_strerror(int);
-
-#ifdef RUBY_EXPORT
-#define strerror(e) rb_w32_strerror(e)
-#endif
-
-#define PIPE_BUF 1024
-
-#define LOCK_SH 1
-#define LOCK_EX 2
-#define LOCK_NB 4
-#define LOCK_UN 8
-
-
-#ifndef SIGINT
-#define SIGINT 2
-#endif
-#ifndef SIGKILL
-#define SIGKILL 9
-#endif
-
-
-/* #undef va_start */
-/* #undef va_end */
-
-/* winsock error map */
-#define EWOULDBLOCK WSAEWOULDBLOCK
-#define EINPROGRESS WSAEINPROGRESS
-#define EALREADY WSAEALREADY
-#define ENOTSOCK WSAENOTSOCK
-#define EDESTADDRREQ WSAEDESTADDRREQ
-#define EMSGSIZE WSAEMSGSIZE
-#define EPROTOTYPE WSAEPROTOTYPE
-#define ENOPROTOOPT WSAENOPROTOOPT
-#define EPROTONOSUPPORT WSAEPROTONOSUPPORT
-#define ESOCKTNOSUPPORT WSAESOCKTNOSUPPORT
-#define EOPNOTSUPP WSAEOPNOTSUPP
-#define EPFNOSUPPORT WSAEPFNOSUPPORT
-#define EAFNOSUPPORT WSAEAFNOSUPPORT
-#define EADDRINUSE WSAEADDRINUSE
-#define EADDRNOTAVAIL WSAEADDRNOTAVAIL
-#define ENETDOWN WSAENETDOWN
-#define ENETUNREACH WSAENETUNREACH
-#define ENETRESET WSAENETRESET
-#define ECONNABORTED WSAECONNABORTED
-#define ECONNRESET WSAECONNRESET
-#define ENOBUFS WSAENOBUFS
-#define EISCONN WSAEISCONN
-#define ENOTCONN WSAENOTCONN
-#define ESHUTDOWN WSAESHUTDOWN
-#define ETOOMANYREFS WSAETOOMANYREFS
-#define ETIMEDOUT WSAETIMEDOUT
-#define ECONNREFUSED WSAECONNREFUSED
-#define ELOOP WSAELOOP
-/*#define ENAMETOOLONG WSAENAMETOOLONG*/
-#define EHOSTDOWN WSAEHOSTDOWN
-#define EHOSTUNREACH WSAEHOSTUNREACH
-/*#define ENOTEMPTY WSAENOTEMPTY*/
-#define EPROCLIM WSAEPROCLIM
-#define EUSERS WSAEUSERS
-#define EDQUOT WSAEDQUOT
-#define ESTALE WSAESTALE
-#define EREMOTE WSAEREMOTE
-
-#define F_SETFL 1
-#define O_NONBLOCK 1
-
-#undef FD_SET
-#define FD_SET(f, s) rb_w32_fdset(f, s)
-
-#undef FD_CLR
-#define FD_CLR(f, s) rb_w32_fdclr(f, s)
-
-#undef FD_ISSET
-#define FD_ISSET(f, s) rb_w32_fdisset(f, s)
-
-#ifdef RUBY_EXPORT
-#undef accept
-#define accept(s, a, l) rb_w32_accept(s, a, l)
-
-#undef bind
-#define bind(s, a, l) rb_w32_bind(s, a, l)
-
-#undef connect
-#define connect(s, a, l) rb_w32_connect(s, a, l)
-
-#undef select
-#define select(n, r, w, e, t) rb_w32_select(n, r, w, e, t)
-
-#undef getpeername
-#define getpeername(s, a, l) rb_w32_getpeername(s, a, l)
-
-#undef getsockname
-#define getsockname(s, a, l) rb_w32_getsockname(s, a, l)
-
-#undef getsockopt
-#define getsockopt(s, v, n, o, l) rb_w32_getsockopt(s, v, n, o, l)
-
-#undef ioctlsocket
-#define ioctlsocket(s, c, a) rb_w32_ioctlsocket(s, c, a)
-
-#undef listen
-#define listen(s, b) rb_w32_listen(s, b)
-
-#undef recv
-#define recv(s, b, l, f) rb_w32_recv(s, b, l, f)
-
-#undef recvfrom
-#define recvfrom(s, b, l, f, fr, frl) rb_w32_recvfrom(s, b, l, f, fr, frl)
-
-#undef send
-#define send(s, b, l, f) rb_w32_send(s, b, l, f)
-
-#undef sendto
-#define sendto(s, b, l, f, t, tl) rb_w32_sendto(s, b, l, f, t, tl)
-
-#undef setsockopt
-#define setsockopt(s, v, n, o, l) rb_w32_setsockopt(s, v, n, o, l)
-
-#undef shutdown
-#define shutdown(s, h) rb_w32_shutdown(s, h)
-
-#undef socket
-#define socket(s, t, p) rb_w32_socket(s, t, p)
-
-#undef gethostbyaddr
-#define gethostbyaddr(a, l, t) rb_w32_gethostbyaddr(a, l, t)
-
-#undef gethostbyname
-#define gethostbyname(n) rb_w32_gethostbyname(n)
-
-#undef gethostname
-#define gethostname(n, l) rb_w32_gethostname(n, l)
-
-#undef getprotobyname
-#define getprotobyname(n) rb_w32_getprotobyname(n)
-
-#undef getprotobynumber
-#define getprotobynumber(n) rb_w32_getprotobynumber(n)
-
-#undef getservbyname
-#define getservbyname(n, p) rb_w32_getservbyname(n, p)
-
-#undef getservbyport
-#define getservbyport(p, pr) rb_w32_getservbyport(p, pr)
-
-#undef socketpair
-#define socketpair(a, t, p, s) rb_w32_socketpair(a, t, p, s)
-
-#undef get_osfhandle
-#define get_osfhandle(h) rb_w32_get_osfhandle(h)
-
-#undef getcwd
-#define getcwd(b, s) rb_w32_getcwd(b, s)
-
-#undef getenv
-#define getenv(n) rb_w32_getenv(n)
-
-#undef rename
-#define rename(o, n) rb_w32_rename(o, n)
-
-#undef times
-#define times(t) rb_w32_times(t)
-#endif
-
-struct tms {
- long tms_utime;
- long tms_stime;
- long tms_cutime;
- long tms_cstime;
-};
-
-int rb_w32_times(struct tms *);
-
-/* thread stuff */
-HANDLE GetCurrentThreadHandle(void);
-int rb_w32_sleep(unsigned long msec);
-int rb_w32_putc(int, FILE*);
-int rb_w32_getc(FILE*);
-int rb_w32_wopen(const WCHAR *, int, ...);
-int rb_w32_open(const char *, int, ...);
-int rb_w32_close(int);
-int rb_w32_fclose(FILE*);
-int rb_w32_pipe(int[2]);
-size_t rb_w32_read(int, void *, size_t);
-size_t rb_w32_write(int, const void *, size_t);
-int rb_w32_utime(const char *, const struct utimbuf *);
-int WINAPI rb_w32_Sleep(unsigned long msec);
-int rb_w32_wait_events_blocking(HANDLE *events, int num, DWORD timeout);
-
-/*
-== ***CAUTION***
-Since this function is very dangerous, ((*NEVER*))
-* lock any HANDLEs(i.e. Mutex, Semaphore, CriticalSection and so on) or,
-* use anything like TRAP_BEG...TRAP_END block structure,
-in asynchronous_func_t.
-*/
-typedef uintptr_t (*asynchronous_func_t)(uintptr_t self, int argc, uintptr_t* argv);
-uintptr_t rb_w32_asynchronize(asynchronous_func_t func, uintptr_t self, int argc, uintptr_t* argv, uintptr_t intrval);
-
-#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 6fb7463c57..947bbbe242 100644
--- a/inits.c
+++ b/inits.c
@@ -3,61 +3,84 @@
inits.c -
$Author$
+ $Date$
created at: Tue Dec 28 16:01:58 JST 1993
- Copyright (C) 1993-2007 Yukihiro Matsumoto
+ Copyright (C) 1993-2003 Yukihiro Matsumoto
**********************************************************************/
-#include "ruby/ruby.h"
+#include "ruby.h"
-#define CALL(n) {void Init_##n(void); Init_##n();}
+void Init_Array _((void));
+void Init_Bignum _((void));
+void Init_Binding _((void));
+void Init_Comparable _((void));
+void Init_Dir _((void));
+void Init_Enumerable _((void));
+void Init_Enumerator _((void));
+void Init_Exception _((void));
+void Init_syserr _((void));
+void Init_eval _((void));
+void Init_load _((void));
+void Init_Proc _((void));
+void Init_Thread _((void));
+void Init_File _((void));
+void Init_GC _((void));
+void Init_Hash _((void));
+void Init_IO _((void));
+void Init_Math _((void));
+void Init_marshal _((void));
+void Init_Numeric _((void));
+void Init_Object _((void));
+void Init_pack _((void));
+void Init_Precision _((void));
+void Init_sym _((void));
+void Init_process _((void));
+void Init_Random _((void));
+void Init_Range _((void));
+void Init_Regexp _((void));
+void Init_signal _((void));
+void Init_String _((void));
+void Init_Struct _((void));
+void Init_Time _((void));
+void Init_var_tables _((void));
+void Init_version _((void));
void
-rb_call_inits(void)
+rb_call_inits()
{
- CALL(RandomSeed);
- CALL(sym);
- CALL(var_tables);
- CALL(Object);
- CALL(top_self);
- CALL(Encoding);
- CALL(Comparable);
- CALL(Enumerable);
- CALL(String);
- CALL(Exception);
- CALL(eval);
- CALL(safe);
- CALL(jump);
- CALL(Numeric);
- CALL(Bignum);
- CALL(syserr);
- CALL(Array);
- CALL(Hash);
- CALL(Struct);
- CALL(Regexp);
- CALL(pack);
- CALL(transcode);
- CALL(marshal);
- CALL(Range);
- CALL(IO);
- CALL(Dir);
- CALL(Time);
- CALL(Random);
- CALL(signal);
- CALL(process);
- CALL(load);
- CALL(Proc);
- CALL(Binding);
- CALL(Math);
- CALL(GC);
- CALL(Enumerator);
- CALL(VM);
- CALL(ISeq);
- CALL(Thread);
- CALL(Cont);
- CALL(Rational);
- CALL(Complex);
- CALL(version);
+ Init_sym();
+ Init_var_tables();
+ Init_Object();
+ Init_Comparable();
+ Init_Enumerable();
+ Init_Precision();
+ Init_eval();
+ Init_String();
+ Init_Exception();
+ Init_Thread();
+ Init_Numeric();
+ Init_Bignum();
+ Init_syserr();
+ Init_Array();
+ Init_Hash();
+ Init_Struct();
+ Init_Regexp();
+ Init_pack();
+ Init_Range();
+ Init_IO();
+ Init_Dir();
+ Init_Time();
+ Init_Random();
+ Init_signal();
+ Init_process();
+ Init_load();
+ Init_Proc();
+ Init_Binding();
+ Init_Math();
+ Init_GC();
+ Init_Enumerator();
+ Init_marshal();
+ Init_version();
}
-#undef CALL
diff --git a/insns.def b/insns.def
deleted file mode 100644
index 724f086dce..0000000000
--- a/insns.def
+++ /dev/null
@@ -1,2089 +0,0 @@
-/** ##skip -*- mode:c; style:ruby -*-
- insns.def - YARV instruction definitions
-
- $Author: $
- created at: 04/01/01 01:17:55 JST
-
- Copyright (C) 2004-2007 Koichi Sasada
-*/
-
-/** ##skip
- instruction comment
- @c: category
- @e: english description
- @j: japanese description
-
- instruction form:
- DEFINE_INSN
- instrunction_name
- (instruction_operands, ..)
- (pop_values, ..)
- (return value)
- {
- .. // insn body
- }
-
- */
-
-
-/**
- @c nop
- @e nop
- @j nop
- */
-DEFINE_INSN
-nop
-()
-()
-()
-{
- /* none */
-}
-
-/**********************************************************/
-/* deal with variables */
-/**********************************************************/
-
-/**
- @c variable
- @e get local variable value (which is pointed by idx).
- @j idx Ŏw肳ꂽ[JϐX^bNɒuB
- */
-DEFINE_INSN
-getlocal
-(lindex_t idx)
-()
-(VALUE val)
-{
- val = *(GET_LFP() - idx);
-}
-
-/**
- @c variable
- @e set local variable value (which is pointed by idx) as val.
- @j idx Ŏw肳ꂽ[Jϐ val ɐݒ肷B
- */
-DEFINE_INSN
-setlocal
-(lindex_t idx)
-(VALUE val)
-()
-{
- (*(GET_LFP() - idx)) = val;
-}
-
-/**
- @c variable
- @e get special local variable ($~, $_, ..) value.
- @j ȃ[Jϐi$~, $_, ...j̒l𓾂B
- */
-DEFINE_INSN
-getspecial
-(VALUE key, rb_num_t type)
-()
-(VALUE val)
-{
- val = vm_getspecial(th, GET_LFP(), key, type);
-}
-
-/**
- @c variable
- @e set special local variable ($~, $_, ...) value as obj.
- @j ʂȃ[Jϐi$~, $_, ...j̒lݒ肷B
- */
-DEFINE_INSN
-setspecial
-(VALUE key)
-(VALUE obj)
-()
-{
- lfp_svar_set(th, GET_LFP(), key, obj);
-}
-
-/**
- @c variable
- @e get block local variable(which is pointed by idx and level).
- level means nest level of block, and specify how above this variable.
- @j level, idx Ŏw肳ꂽubN[Jϐ̒lX^bNɒuB
- level ̓ubÑlXgxŁAiォB
- */
-DEFINE_INSN
-getdynamic
-(dindex_t idx, rb_num_t level)
-()
-(VALUE val)
-{
- rb_num_t i;
- VALUE *dfp2 = GET_DFP();
- for (i = 0; i < level; i++) {
- dfp2 = GET_PREV_DFP(dfp2);
- }
- val = *(dfp2 - idx);
-}
-
-/**
- @c variable
- @e set block local variable(which is pointed by 'idx') as val.
- level means nest level of block, and specify how above this variable.
- @j level, idx Ŏw肳ꂽubN[Jϐ̒l val ɂB
- level ̓ubÑlXgxŁAiォB
- */
-DEFINE_INSN
-setdynamic
-(dindex_t idx, rb_num_t level)
-(VALUE val)
-()
-{
- rb_num_t i;
- VALUE *dfp2 = GET_DFP();
- for (i = 0; i < level; i++) {
- dfp2 = GET_PREV_DFP(dfp2);
- }
- *(dfp2 - idx) = val;
-}
-
-/**
- @c variable
- @e get instance variable id of obj.
- if is_local is not 0, search as class local variable.
- @j self ̃CX^Xϐ id ̒l𓾂B
- */
-DEFINE_INSN
-getinstancevariable
-(ID id, IC ic)
-()
-(VALUE val)
-{
- val = vm_getivar(GET_SELF(), id, ic);
-}
-
-/**
- @c variable
- @e set instance variable id of obj as val.
- if is_local is not 0, search as class local variable.
- @j self ̃CX^Xϐ id val ɂB
- */
-DEFINE_INSN
-setinstancevariable
-(ID id)
-(VALUE val)
-()
-{
- rb_ivar_set(GET_SELF(), id, val);
-}
-
-/**
- @c variable
- @e get class variable id of klass as val.
- @j ݂̃XR[ṽNXϐ id ̒l𓾂B
- */
-DEFINE_INSN
-getclassvariable
-(ID id)
-()
-(VALUE val)
-{
- NODE * const cref = vm_get_cref(GET_ISEQ(), GET_LFP(), GET_DFP());
- val = rb_cvar_get(vm_get_cvar_base(cref), id);
-}
-
-/**
- @c variable
- @e set class variable id of klass as val.
- @j klass ̃NXϐ id val ɂB
- */
-DEFINE_INSN
-setclassvariable
-(ID id)
-(VALUE val)
-()
-{
- NODE * const cref = vm_get_cref(GET_ISEQ(), GET_LFP(), GET_DFP());
- rb_cvar_set(vm_get_cvar_base(cref), id, val);
-}
-
-/**
- @c variable
- @e
- get constant variable id. if klass is Qnil, constant
- are searched in current scope. if klass is Qfalse, constant as
- top level constant. otherwise, get constant under klass
- class or module.
- @j 萔 id ̒l𓾂B
- klass Qnil ȂÃXR[vœ萔̒l𓾂B
- Qfalse ȂAgbvxXR[v𓾂B
- ȊOȂAklass NX̉̒萔𓾂B
- */
-DEFINE_INSN
-getconstant
-(ID id)
-(VALUE klass)
-(VALUE val)
-{
- val = vm_get_ev_const(th, GET_ISEQ(), klass, id, 0);
-}
-
-/**
- @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 ̒l val ɂB
- klass Qfalse ȂÃXR[vœ萔 id ̒lݒ肷B
- Qnil ȂAgbvxXR[v̒lݒ肷B
- ȊOȂAklass NX̉̒萔ݒ肷B
- */
-DEFINE_INSN
-setconstant
-(ID id)
-(VALUE val, VALUE cbase)
-()
-{
- vm_check_if_namespace(cbase);
- rb_const_set(cbase, id, val);
- INC_VM_STATE_VERSION();
-}
-
-/**
- @c variable
- @e get global variable id.
- @j O[oϐ id ̒l𓾂B
- */
-DEFINE_INSN
-getglobal
-(GENTRY entry)
-()
-(VALUE val)
-{
- val = GET_GLOBAL(entry);
-}
-
-/**
- @c variable
- @e set global variable id as val.
- @j O[oϐ id ̒lݒ肷B
- */
-DEFINE_INSN
-setglobal
-(GENTRY entry)
-(VALUE val)
-()
-{
- SET_GLOBAL(entry, val);
-}
-
-
-/**********************************************************/
-/* deal with values */
-/**********************************************************/
-
-/**
- @c put
- @e put nil to stack.
- @j X^bN nil vbVB
- */
-DEFINE_INSN
-putnil
-()
-()
-(VALUE val)
-{
- val = Qnil;
-}
-
-/**
- @c put
- @e put self.
- @j X^bN self vbVB
- */
-DEFINE_INSN
-putself
-()
-()
-(VALUE val)
-{
- val = GET_SELF();
-}
-
-/**
- @c put
- @e put some object.
- i.e. Fixnum, true, false, nil, and so on.
- @j IuWFNg val X^bNɃvbVB
- i.e. Fixnum, true, false, nil, and so on.
- */
-DEFINE_INSN
-putobject
-(VALUE val)
-()
-(VALUE val)
-{
- /* */
-}
-
-/**
- @c put
- @e put special object. "value_type" is for expansion.
- @j ʂȃIuWFNg val X^bNɃvbVB
- IuWFNg̎ނ value_type ɂD
- */
-DEFINE_INSN
-putspecialobject
-(rb_num_t value_type)
-()
-(VALUE val)
-{
- switch (value_type) {
- case VM_SPECIAL_OBJECT_VMCORE:
- val = rb_mRubyVMFrozenCore;
- break;
- case VM_SPECIAL_OBJECT_CBASE:
- val = vm_get_cbase(GET_ISEQ(), GET_LFP(), GET_DFP());
- break;
- default:
- rb_bug("putspecialobject insn: unknown value_type");
- }
-}
-
-/**
- @c put
- @e put iseq value.
- @j put iseq value.
- */
-DEFINE_INSN
-putiseq
-(ISEQ iseq)
-()
-(VALUE ret)
-{
- ret = iseq->self;
-}
-
-/**
- @c put
- @e put string val. string will be copied.
- @j Rs[ăX^bNɃvbVB
- */
-DEFINE_INSN
-putstring
-(VALUE str)
-()
-(VALUE val)
-{
- val = rb_str_resurrect(str);
-}
-
-/**
- @c put
- @e put concatenate strings
- @j X^bNgbv̕ n ˜ACʂX^bNɃvbVB
- */
-DEFINE_INSN
-concatstrings
-(rb_num_t num)
-(...)
-(VALUE val) // inc += 1 - num;
-{
- rb_num_t i = num;
-
- val = rb_str_new(0, 0);
- while (i-- > 0) {
- const VALUE v = TOPN(i);
- rb_str_append(val, v);
- }
- POPN(num);
-}
-
-/**
- @c put
- @e to_str
- @j to_str ̌ʂX^bNɃvbVB
- */
-DEFINE_INSN
-tostring
-()
-(VALUE val)
-(VALUE val)
-{
- val = rb_obj_as_string(val);
-}
-
-/**
- @c put
- @e to Regexp
- @j str 𐳋K\ɃRpCăX^bNɃvbVB
- RpCCopt 𐳋K\̃IvVƂB
- */
-DEFINE_INSN
-toregexp
-(rb_num_t opt, rb_num_t cnt)
-(...)
-(VALUE val) // inc += 1 - 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);
-}
-
-/**
- @c put
- @e put new array.
- @j VzX^bN num ‚̒lŏĐvbVB
- */
-DEFINE_INSN
-newarray
-(rb_num_t num)
-(...)
-(VALUE val) // inc += 1 - num;
-{
- val = rb_ary_new4((long)num, STACK_ADDR_FROM_TOP(num));
- POPN(num);
-}
-
-/**
- @c put
- @e dup array
- @j z ary dup ăX^bNɃvbVB
- */
-DEFINE_INSN
-duparray
-(VALUE ary)
-()
-(VALUE val)
-{
- val = rb_ary_resurrect(ary);
-}
-
-/**
- @c put
- @e expand array to num objects.
- @j X^bNgbṽIuWFNgzł΁AWJB
- zIuWFNg̗vf numȉȂ΁A nil ςށBnumȏȂA
- numȏ̗vf͐؂̂ĂB
- zIuWFNgłȂ΁Anum - 1 ‚ nil ςށB
- flag ^ȂAcvf̔zς
- flag: 0x01 - Ōz
- flag: 0x02 - postarg p
- flag: 0x04 - reverse?
- */
-DEFINE_INSN
-expandarray
-(rb_num_t num, rb_num_t flag)
-(..., VALUE ary)
-(...) // inc += num - 1 + (flag & 1 ? 1 : 0);
-{
- vm_expandarray(GET_CFP(), ary, num, (int)flag);
-}
-
-/**
- @c put
- @e concat two arrays
- @j ‚̔z ary1, ary2 AX^bNփvbVB
- */
-DEFINE_INSN
-concatarray
-()
-(VALUE ary1, VALUE ary2st)
-(VALUE ary)
-{
- const VALUE ary2 = ary2st;
- VALUE tmp1 = rb_check_convert_type(ary1, T_ARRAY, "Array", "to_a");
- VALUE tmp2 = rb_check_convert_type(ary2, T_ARRAY, "Array", "to_a");
-
- if (NIL_P(tmp1)) {
- tmp1 = rb_ary_new3(1, ary1);
- }
-
- if (NIL_P(tmp2)) {
- tmp2 = rb_ary_new3(1, ary2);
- }
-
- if (tmp1 == ary1) {
- tmp1 = rb_ary_dup(ary1);
- }
- ary = rb_ary_concat(tmp1, tmp2);
-}
-
-/**
- @c put
- @e splat array
- @j z ary ɑ΂ to_a ĂяoB
- */
-DEFINE_INSN
-splatarray
-(VALUE flag)
-(VALUE ary)
-(VALUE obj)
-{
- VALUE tmp = rb_check_convert_type(ary, T_ARRAY, "Array", "to_a");
- if (NIL_P(tmp)) {
- tmp = rb_ary_new3(1, ary);
- }
- obj = tmp;
-}
-
-/**
- @c put
- @e check value is included in ary
- @j z ary ɗvf obj Ă邩ǂ`FbNBcase/when ŗpB
- */
-DEFINE_INSN
-checkincludearray
-(VALUE flag)
-(VALUE obj, VALUE ary)
-(VALUE obj, VALUE result)
-{
- int i;
- result = Qfalse;
-
- if (TYPE(ary) != T_ARRAY) {
- ary = rb_Array(ary);
- }
-
- if (flag == Qtrue) {
- /* NODE_CASE */
- for (i = 0; i < RARRAY_LEN(ary); i++) {
- /* TODO: fix me (use another method dispatch) */
- if (RTEST(rb_funcall2(RARRAY_PTR(ary)[i], idEqq, 1, &obj))) {
- result = Qtrue;
- break;
- }
- }
- }
- else {
- obj = Qfalse;
- /* NODE_WHEN */
- for (i = 0; i < RARRAY_LEN(ary); i++) {
- if (RTEST(RARRAY_PTR(ary)[i])) {
- obj = result = Qtrue;
- break;
- }
- }
- }
-}
-
-/**
- @c put
- @e put new Hash.
- @j VnbVX^bNgbv n ‚lƂĐB
- n ̓L[ƒl̃yAȂ̂ 2 ̔{łȂ΂ȂȂB
- */
-DEFINE_INSN
-newhash
-(rb_num_t num)
-(...)
-(VALUE val) // inc += 1 - num;
-{
- int i;
- val = rb_hash_new();
-
- 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);
-}
-
-/**
- @c put
- @e put new Range object.(Range.new(low, high, flag))
- @j Range.new(low, high, flag) ̂悤ȃIuWFNg𐶐X^bNɃvbVB
- */
-DEFINE_INSN
-newrange
-(rb_num_t flag)
-(VALUE low, VALUE high)
-(VALUE val)
-{
- val = rb_range_new(low, high, (int)flag);
-}
-
-/**********************************************************/
-/* deal with stack operation */
-/**********************************************************/
-
-/**
- @c stack
- @e pop from stack.
- @j X^bNƒ|bvB
- */
-DEFINE_INSN
-pop
-()
-(VALUE val)
-()
-{
- val = val;
- /* none */
-}
-
-/**
- @c stack
- @e duplicate stack top.
- @j X^bNgbvRs[ăX^bNɃvbVB
- */
-DEFINE_INSN
-dup
-()
-(VALUE val)
-(VALUE val1, VALUE val2)
-{
- val1 = val2 = val;
-}
-
-/**
- @c stack
- @e duplicate stack top n elements
- @j X^bNgbv n ‚Rs[ăX^bNɃvbVB
- */
-DEFINE_INSN
-dupn
-(rb_num_t n)
-(...)
-(...) // inc += 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);
-}
-
-
-/**
- @c stack
- @e swap top 2 vals
- @j X^bNgbv 2 ‚̒lB
- */
-DEFINE_INSN
-swap
-()
-(VALUE val, VALUE obj)
-(VALUE obj, VALUE val)
-{
- /* none */
-}
-
-/**
- @c stack
- @e for stack caching.
- @j X^bNLbVȌԂ𒲐邽߂ɕKvȖ߁B
- */
-DEFINE_INSN
-reput
-()
-(..., VALUE val)
-(VALUE val) // inc += 0;
-{
- /* none */
-}
-
-/**
- @c stack
- @e get nth stack value from stack top
- @j X^bNgbv n –ڂX^bNɃvbVB
- */
-DEFINE_INSN
-topn
-(rb_num_t n)
-(...)
-(VALUE val) // inc += 1;
-{
- val = TOPN(n);
-}
-
-/**
- @c stack
- @e set Nth stack entry to stack top
- @j X^bNgbv̒l n –ڂ̃X^bNɃRs[
- */
-DEFINE_INSN
-setn
-(rb_num_t n)
-(..., VALUE val)
-(VALUE val) // inc += 0
-{
- TOPN(n-1) = val;
-}
-
-/**
- @c stack
- @e empt current stack
- @j current stack ɂB
- */
-DEFINE_INSN
-adjuststack
-(rb_num_t n)
-(...)
-(...) // inc -= n
-{
- DEC_SP(n);
-}
-
-
-/**********************************************************/
-/* deal with setting */
-/**********************************************************/
-
-/**
- @c setting
- @e defined?
- @j defined? sB
- */
-DEFINE_INSN
-defined
-(rb_num_t type, VALUE obj, VALUE needstr)
-(VALUE v)
-(VALUE val)
-{
- VALUE klass;
- const char *expr_type = 0;
- val = Qnil;
-
- switch (type) {
- case DEFINED_IVAR:
- if (rb_ivar_defined(GET_SELF(), SYM2ID(obj))) {
- expr_type = "instance-variable";
- }
- break;
- case DEFINED_IVAR2:
- klass = vm_get_cbase(GET_ISEQ(), GET_LFP(), GET_DFP());
- break;
- case DEFINED_GVAR:
- if (rb_gvar_defined((struct rb_global_entry *)(obj & ~1))) {
- expr_type = "global-variable";
- }
- break;
- case DEFINED_CVAR:
- klass = vm_get_cbase(GET_ISEQ(), GET_LFP(), GET_DFP());
- if (rb_cvar_defined(klass, SYM2ID(obj))) {
- expr_type = "class variable";
- }
- break;
- case DEFINED_CONST:
- klass = v;
- if (vm_get_ev_const(th, GET_ISEQ(), klass, SYM2ID(obj), 1)) {
- expr_type = "constant";
- }
- break;
- case DEFINED_FUNC:
- klass = CLASS_OF(v);
- if (rb_method_boundp(klass, SYM2ID(obj), 0)) {
- expr_type = "method";
- }
- break;
- case DEFINED_METHOD:{
- VALUE klass = CLASS_OF(v);
- const rb_method_entry_t *me = rb_method_entry(klass, SYM2ID(obj));
-
- if (me) {
- if (!(me->flag & NOEX_PRIVATE)) {
- if (!((me->flag & NOEX_PROTECTED) &&
- !rb_obj_is_kind_of(GET_SELF(),
- rb_class_real(klass)))) {
- expr_type = "method";
- }
- }
- }
- break;
- }
- case DEFINED_YIELD:
- if (GET_BLOCK_PTR()) {
- expr_type = "yield";
- }
- break;
- case DEFINED_ZSUPER:{
- rb_iseq_t *ip = GET_ISEQ();
- while (ip) {
- if (ip->defined_method_id) {
- break;
- }
- ip = ip->parent_iseq;
- }
- if (ip) {
- VALUE klass = vm_search_normal_superclass(ip->klass, GET_SELF());
- if (rb_method_boundp(klass, ip->defined_method_id, 0)) {
- expr_type = "super";
- }
- }
- break;
- }
- case DEFINED_REF:{
- val = vm_getspecial(th, GET_LFP(), Qfalse, FIX2INT(obj));
- if (val != Qnil) {
- expr_type = "global-variable";
- }
- break;
- }
- default:
- rb_bug("unimplemented defined? type (VM)");
- break;
- }
- if (expr_type != 0) {
- if (needstr != Qfalse) {
- val = rb_str_new2(expr_type);
- }
- else {
- val = Qtrue;
- }
- }
-}
-
-/**
- @c setting
- @e trace
- @j trace p̖߁B
- */
-DEFINE_INSN
-trace
-(rb_num_t nf)
-()
-()
-{
- rb_event_flag_t flag = (rb_event_flag_t)nf;
-
- EXEC_EVENT_HOOK(th, flag, GET_SELF(), 0, 0 /* TODO: id, klass */);
-}
-
-/**********************************************************/
-/* deal with control flow 1: class/module */
-/**********************************************************/
-
-/**
- @c class/module
- @e
- enter class definition scope. if super is Qfalse, and clsas
- "klass" is defined, it's redefine. otherwise, define "klass" class.
- @j NX`XR[vֈڍsB
- super Qfalse klassNX`Ă΍Ē`łB
- łȂ΁Aklass NX`B
- */
-DEFINE_INSN
-defineclass
-(ID id, ISEQ class_iseq, rb_num_t define_type)
-(VALUE cbase, VALUE super)
-(VALUE val)
-{
- VALUE klass;
-
- switch ((int)define_type) {
- case 0:
- /* val is dummy. classdef returns class scope value */
-
- if (super == Qnil) {
- super = rb_cObject;
- }
-
- vm_check_if_namespace(cbase);
-
- /* find klass */
- rb_autoload_load(cbase, id);
- if (rb_const_defined_at(cbase, id)) {
- /* already exist */
- klass = rb_const_get_at(cbase, id);
- if (TYPE(klass) != T_CLASS) {
- rb_raise(rb_eTypeError, "%s is not a class", rb_id2name(id));
- }
-
- if (super != rb_cObject) {
- VALUE tmp;
- tmp = rb_class_real(RCLASS_SUPER(klass));
-
- if (tmp != super) {
- rb_raise(rb_eTypeError, "superclass mismatch for class %s",
- rb_id2name(id));
- }
- }
- }
- else {
- /* new class declaration */
- klass = rb_define_class_id(id, super);
- rb_set_class_path(klass, cbase, rb_id2name(id));
- rb_const_set(cbase, id, klass);
- rb_class_inherited(super, klass);
- }
- break;
- case 1:
- /* val is dummy. classdef returns class scope value */
- /* super is dummy */
- klass = rb_singleton_class(cbase);
- break;
- case 2:
- /* val is dummy. classdef returns class scope value */
- /* super is dummy */
-
- vm_check_if_namespace(cbase);
-
- /* find klass */
- if (rb_const_defined_at(cbase, id)) {
- klass = rb_const_get_at(cbase, id);
- /* already exist */
- if (TYPE(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(klass, cbase, rb_id2name(id));
- rb_const_set(cbase, id, klass);
- }
- break;
- default:
- rb_bug("unknown defineclass type: %d", (int)define_type);
- }
-
- COPY_CREF(class_iseq->cref_stack, vm_cref_push(th, klass, NOEX_PUBLIC));
-
- /* enter scope */
- vm_push_frame(th, class_iseq,
- VM_FRAME_MAGIC_CLASS, klass, (VALUE) GET_DFP() | 0x02,
- class_iseq->iseq_encoded, GET_SP(), 0,
- class_iseq->local_size);
- RESTORE_REGS();
-
- INC_VM_STATE_VERSION();
- NEXT_INSN();
-}
-
-
-/**********************************************************/
-/* deal with control flow 2: method/iterator */
-/**********************************************************/
-
-/**
- @c method/iterator
- @e obj.send(id, args..) # args.size => num
- @j \bhĂяosB
- obj.send(id, args..) # args.size => num
- flag & VM_CALL_ARGS_SPLAT_BIT != 0 -> splat last arg
- flag & VM_CALL_ARGS_BLOCKARG_BIT != 0 -> Proc as Block
- flag & VM_CALL_FCALL_BIT != 0 -> FCALL ( func() )
- flag & VM_CALL_VCALL_BIT != 0 -> VCALL ( func )
- ...
- */
-DEFINE_INSN
-send
-(ID op_id, rb_num_t op_argc, ISEQ blockiseq, rb_num_t op_flag, IC ic)
-(...)
-(VALUE val) // inc += - (int)(op_argc + ((op_flag & VM_CALL_ARGS_BLOCKARG_BIT) ? 1 : 0));
-{
- const rb_method_entry_t *me;
- VALUE recv, klass;
- rb_block_t *blockptr = 0;
- rb_num_t num = caller_setup_args(th, GET_CFP(), op_flag, (int)op_argc,
- (rb_iseq_t *)blockiseq, &blockptr);
- rb_num_t flag = op_flag;
- ID id = op_id;
-
- /* get receiver */
- recv = (flag & VM_CALL_FCALL_BIT) ? GET_SELF() : TOPN(num);
- klass = CLASS_OF(recv);
- me = vm_method_search(id, klass, ic);
- CALL_METHOD(num, blockptr, flag, id, me, recv);
-}
-
-/**
- @c method/iterator
- @e super(args) # args.size => num
- @j super sB
- super(args) # args.size => num
- flag IyḧӖ send ƓB
- */
-DEFINE_INSN
-invokesuper
-(rb_num_t op_argc, ISEQ blockiseq, rb_num_t op_flag)
-(...)
-(VALUE val) // inc += - (int)(op_argc + ((op_flag & VM_CALL_ARGS_BLOCKARG_BIT) ? 1 : 0));
-{
- rb_block_t *blockptr = !(op_flag & VM_CALL_ARGS_BLOCKARG_BIT) ? GET_BLOCK_PTR() : 0;
- rb_num_t num = caller_setup_args(th, GET_CFP(), op_flag,
- (int)op_argc, blockiseq, &blockptr);
- VALUE recv, klass;
- ID id;
- VALUE flag = VM_CALL_SUPER_BIT | VM_CALL_FCALL_BIT;
- const rb_method_entry_t *me;
-
- recv = GET_SELF();
- vm_search_superclass(GET_CFP(), GET_ISEQ(), recv, TOPN(num), &id, &klass);
- me = rb_method_entry(klass, id);
-
- CALL_METHOD(num, blockptr, flag, id, me, recv);
-}
-
-/**
- @c method/iterator
- @e yield(args) # args.size => num, flag shows expand argument or not
- @j yield sB
- yield(args) # args.size => num
- */
-DEFINE_INSN
-invokeblock
-(rb_num_t num, rb_num_t flag)
-(...)
-(VALUE val) // inc += 1 - num;
-{
- val = vm_invoke_block(th, GET_CFP(), num, flag);
- if (val == Qundef) {
- RESTORE_REGS();
- NEXT_INSN();
- }
-}
-
-/**
- @c method/iterator
- @e return from this scope.
- @j ̃XR[v甲B
- */
-DEFINE_INSN
-leave
-()
-(VALUE val)
-(VALUE val)
-{
- if (OPT_CHECKED_RUN) {
- if (reg_cfp->sp != reg_cfp->bp) {
- rb_bug("Stack consistency error (sp: %"PRIdPTRDIFF", bp: %"PRIdPTRDIFF")",
- VM_SP_CNT(th, reg_cfp->sp), VM_SP_CNT(th, reg_cfp->bp));
- }
- }
-
- RUBY_VM_CHECK_INTS();
- vm_pop_frame(th);
- RESTORE_REGS();
-}
-
-/**
- @c method/iterator
- @e return from this vm loop
- @j VM loop 甲B
- */
-DEFINE_INSN
-finish
-()
-(VALUE val)
-(VALUE val)
-{
-#if OPT_CALL_THREADED_CODE
- rb_bug("unused instruction on OPT_CALL_THREADED_CODE");
-#else
- th->cfp++;
- return val;
-#endif
-}
-
-/**********************************************************/
-/* deal with control flow 3: exception */
-/**********************************************************/
-
-/**
- @c exception
- @e longjump
- @j WvsB
- */
-DEFINE_INSN
-throw
-(rb_num_t throw_state)
-(VALUE throwobj)
-(VALUE val)
-{
- RUBY_VM_CHECK_INTS();
- val = vm_throw(th, GET_CFP(), throw_state, throwobj);
- THROW_EXCEPTION(val);
- /* unreachable */
-}
-
-/**********************************************************/
-/* deal with control flow 4: local jump */
-/**********************************************************/
-
-/**
- @c jump
- @e set PC to (PC + dst).
- @j PC (PC + dst) ɂB
- */
-DEFINE_INSN
-jump
-(OFFSET dst)
-()
-()
-{
- RUBY_VM_CHECK_INTS();
- JUMP(dst);
-}
-
-/**
- @c jump
- @e if val is not false or nil, set PC to (PC + dst).
- @j val false nil łȂ΁APC (PC + dst) ɂB
- */
-DEFINE_INSN
-branchif
-(OFFSET dst)
-(VALUE val)
-()
-{
- if (RTEST(val)) {
- RUBY_VM_CHECK_INTS();
- JUMP(dst);
- }
-}
-
-/**
- @c jump
- @e if val is false or nil, set PC to (PC + dst).
- @j val false nil Ȃ΁APC (PC + dst) ɂB
- */
-DEFINE_INSN
-branchunless
-(OFFSET dst)
-(VALUE val)
-()
-{
- if (!RTEST(val)) {
- RUBY_VM_CHECK_INTS();
- JUMP(dst);
- }
-}
-
-
-/**********************************************************/
-/* for optimize */
-/**********************************************************/
-
-/**
- @c optimize
- @e inline cache
- @j CCLbVLȂAlX^bNɃvbV dst փWvB
- */
-DEFINE_INSN
-getinlinecache
-(OFFSET dst, IC ic)
-()
-(VALUE val)
-{
- if (ic->ic_vmstat == GET_VM_STATE_VERSION()) {
- val = ic->ic_value;
- JUMP(dst);
- }
- else {
- /* none */
- val = Qnil;
- }
-}
-
-/**
- @c optimize
- @e inline cache (once)
- @j once B
- */
-DEFINE_INSN
-onceinlinecache
-(OFFSET dst, IC ic)
-()
-(VALUE val)
-{
- if (ic->ic_vmstat) {
- val = ic->ic_value;
- JUMP(dst);
- }
- else {
- /* none */
- val = Qnil;
- }
-}
-
-/**
- @c optimize
- @e set inline cache
- @j CCLbV̒lݒ肷B
- */
-DEFINE_INSN
-setinlinecache
-(OFFSET dst)
-(VALUE val)
-(VALUE val)
-{
- IC ic = GET_CONST_INLINE_CACHE(dst);
-
- ic->ic_value = val;
- ic->ic_vmstat = GET_VM_STATE_VERSION() - ruby_vm_const_missing_count;
- ruby_vm_const_missing_count = 0;
-}
-
-/**
- @c optimize
- @e case dispatcher
- @j case ŁA”\Ȃ\ŃWvB
- */
-DEFINE_INSN
-opt_case_dispatch
-(CDHASH hash, OFFSET else_offset)
-(..., VALUE key)
-() // inc += -1;
-{
- if (0) {
- /* TODO: if some === method is overrided */
- }
- else {
- VALUE val;
- if (st_lookup(RHASH_TBL(hash), key, &val)) {
- JUMP(FIX2INT(val));
- }
- else {
- JUMP(else_offset);
- }
- }
-}
-
-/**
- @c optimize
- @e check environment
- @j ̊gpB
- */
-DEFINE_INSN
-opt_checkenv
-()
-()
-()
-{
- if (GET_CFP()->bp != GET_DFP() + 1) {
- VALUE *new_dfp = GET_CFP()->bp - 1;
- /* TODO: copy env and clean stack at creating env? */
- *new_dfp = *GET_DFP();
- SET_DFP(new_dfp);
- }
-}
-
-
-/** simple functions */
-
-/**
- @c optimize
- @e optimized X+Y.
- @j œKꂽ X+YB
- */
-DEFINE_INSN
-opt_plus
-()
-(VALUE recv, VALUE obj)
-(VALUE val)
-{
- if (0) {
-
- }
-#if 1
- else if (FIXNUM_2_P(recv, obj) &&
- BASIC_OP_UNREDEFINED_P(BOP_PLUS)) {
- /* 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
- }
-#endif
-
- else if (!SPECIAL_CONST_P(recv) && !SPECIAL_CONST_P(obj)) {
- if (0) {
- }
-#if 1
- else if (HEAP_CLASS_OF(recv) == rb_cFloat &&
- HEAP_CLASS_OF(obj) == rb_cFloat &&
- BASIC_OP_UNREDEFINED_P(BOP_PLUS)) {
- val = DBL2NUM(RFLOAT_VALUE(recv) + RFLOAT_VALUE(obj));
- }
-#endif
-
-#if 1
- else if (HEAP_CLASS_OF(recv) == rb_cString &&
- HEAP_CLASS_OF(obj) == rb_cString &&
- BASIC_OP_UNREDEFINED_P(BOP_PLUS)) {
- val = rb_str_plus(recv, obj);
- }
-#endif
-#if 1
- else if (HEAP_CLASS_OF(recv) == rb_cArray &&
- BASIC_OP_UNREDEFINED_P(BOP_PLUS)) {
- val = rb_ary_plus(recv, obj);
- }
-#endif
- else {
- goto INSN_LABEL(normal_dispatch);
- }
- }
- else {
- INSN_LABEL(normal_dispatch):
- PUSH(recv);
- PUSH(obj);
- CALL_SIMPLE_METHOD(1, idPLUS, recv);
- }
-}
-
-/**
- @c optimize
- @e optimized X-Y.
- @j œKꂽ X-YB
- */
-DEFINE_INSN
-opt_minus
-()
-(VALUE recv, VALUE obj)
-(VALUE val)
-{
- if (FIXNUM_2_P(recv, obj) &&
- BASIC_OP_UNREDEFINED_P(BOP_MINUS)) {
- long a, b, c;
-
- 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 (!SPECIAL_CONST_P(recv) && !SPECIAL_CONST_P(obj)) {
- if (0) {
- }
-#if 1
- else if (HEAP_CLASS_OF(recv) == rb_cFloat &&
- HEAP_CLASS_OF(obj) == rb_cFloat &&
- BASIC_OP_UNREDEFINED_P(BOP_MINUS)) {
- val = DBL2NUM(RFLOAT_VALUE(recv) - RFLOAT_VALUE(obj));
- }
-#endif
- else {
- goto INSN_LABEL(normal_dispatch);
- }
- }
- else {
- /* other */
- INSN_LABEL(normal_dispatch):
- PUSH(recv);
- PUSH(obj);
- CALL_SIMPLE_METHOD(1, idMINUS, recv);
- }
-}
-
-/**
- @c optimize
- @e optimized X*Y.
- @j œKꂽ X*YB
- */
-DEFINE_INSN
-opt_mult
-()
-(VALUE recv, VALUE obj)
-(VALUE val)
-{
- if (FIXNUM_2_P(recv, obj) &&
- BASIC_OP_UNREDEFINED_P(BOP_MULT)) {
- long a, b, c;
-
- a = FIX2LONG(recv);
- if (a == 0) {
- val = recv;
- }
- else {
- b = FIX2LONG(obj);
- c = a * b;
-
- if (FIXABLE(c) && c / a == b) {
- val = LONG2FIX(c);
- }
- else {
- val = rb_big_mul(rb_int2big(a), rb_int2big(b));
- }
- }
- }
- else if (!SPECIAL_CONST_P(recv) && !SPECIAL_CONST_P(obj)) {
- if (0) {
- }
-#if 1
- else if (HEAP_CLASS_OF(recv) == rb_cFloat &&
- HEAP_CLASS_OF(obj) == rb_cFloat &&
- BASIC_OP_UNREDEFINED_P(BOP_MULT)) {
- val = DBL2NUM(RFLOAT_VALUE(recv) * RFLOAT_VALUE(obj));
- }
-#endif
- else {
- goto INSN_LABEL(normal_dispatch);
- }
- }
- else {
- INSN_LABEL(normal_dispatch):
- PUSH(recv);
- PUSH(obj);
- CALL_SIMPLE_METHOD(1, idMULT, recv);
- }
-}
-
-/**
- @c optimize
- @e optimized X/Y.
- @j œKꂽ X/YB
- */
-DEFINE_INSN
-opt_div
-()
-(VALUE recv, VALUE obj)
-(VALUE val)
-{
- if (FIXNUM_2_P(recv, obj) &&
- BASIC_OP_UNREDEFINED_P(BOP_DIV)) {
- 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 (!SPECIAL_CONST_P(recv) && !SPECIAL_CONST_P(obj)) {
- if (0) {
- }
-#if 1
- else if (HEAP_CLASS_OF(recv) == rb_cFloat &&
- HEAP_CLASS_OF(obj) == rb_cFloat &&
- BASIC_OP_UNREDEFINED_P(BOP_DIV)) {
- val = DBL2NUM(RFLOAT_VALUE(recv) / RFLOAT_VALUE(obj));
- }
-#endif
- else {
- goto INSN_LABEL(normal_dispatch);
- }
- }
- else {
- INSN_LABEL(normal_dispatch):
- PUSH(recv);
- PUSH(obj);
- CALL_SIMPLE_METHOD(1, idDIV, recv);
- }
-}
-
-/**
- @c optimize
- @e optimized X%Y.
- @j œKꂽ X%YB
- */
-DEFINE_INSN
-opt_mod
-()
-(VALUE recv, VALUE obj)
-(VALUE val)
-{
- if (FIXNUM_2_P(recv, obj) &&
- BASIC_OP_UNREDEFINED_P(BOP_MOD)) {
- long x, y, mod;
-
- x = FIX2LONG(recv);
- y = FIX2LONG(obj);
- {
- /* copied from numeric.c#fixdivmod */
- long div;
-
- if (y == 0)
- rb_num_zerodiv();
- if (y < 0) {
- if (x < 0)
- div = -x / -y;
- else
- div = -(x / -y);
- }
- else {
- if (x < 0)
- div = -(-x / y);
- else
- div = x / y;
- }
- mod = x - div * y;
- if ((mod < 0 && y > 0) || (mod > 0 && y < 0)) {
- mod += y;
- div -= 1;
- }
- }
- val = LONG2FIX(mod);
- }
- else if (!SPECIAL_CONST_P(recv) && !SPECIAL_CONST_P(obj)) {
- if (0) {
- }
- else if (HEAP_CLASS_OF(recv) == rb_cFloat &&
- HEAP_CLASS_OF(obj) == rb_cFloat &&
- BASIC_OP_UNREDEFINED_P(BOP_MOD)) {
- double x = RFLOAT_VALUE(recv);
- double y = RFLOAT_VALUE(obj);
- double div, mod;
-
- {
- double z;
-
- modf(x / y, &z);
- mod = x - z * y;
- }
-
- div = (x - mod) / y;
- if (y * mod < 0) {
- mod += y;
- div -= 1.0;
- }
- val = DBL2NUM(mod);
- }
- else {
- goto INSN_LABEL(normal_dispatch);
- }
- }
- else {
- INSN_LABEL(normal_dispatch):
- PUSH(recv);
- PUSH(obj);
- CALL_SIMPLE_METHOD(1, idMOD, recv);
- }
-}
-
-/**
- @c optimize
- @e optimized X==Y.
- @j œKꂽ X==YB
- */
-DEFINE_INSN
-opt_eq
-(IC ic)
-(VALUE recv, VALUE obj)
-(VALUE val)
-{
- val = opt_eq_func(recv, obj, ic);
-
- if (val == Qundef) {
- /* other */
- PUSH(recv);
- PUSH(obj);
- CALL_SIMPLE_METHOD(1, idEq, recv);
- }
-}
-
-/**
- @c optimize
- @e optimized X!=Y.
- @j œKꂽ X!=YB
- */
-DEFINE_INSN
-opt_neq
-(IC ic1, IC ic2)
-(VALUE recv, VALUE obj)
-(VALUE val)
-{
- extern VALUE rb_obj_not_equal(VALUE obj1, VALUE obj2);
- const rb_method_entry_t *me = vm_method_search(idNeq, CLASS_OF(recv), ic1);
- val = Qundef;
-
- if (check_cfunc(me, rb_obj_not_equal)) {
- val = opt_eq_func(recv, obj, ic2);
-
- if (val != Qundef) {
- val = RTEST(val) ? Qfalse : Qtrue;
- }
- }
-
- if (val == Qundef) {
- /* other */
- PUSH(recv);
- PUSH(obj);
- CALL_SIMPLE_METHOD(1, idNeq, recv);
- }
-}
-
-/**
- @c optimize
- @e optimized X<Y.
- @j œKꂽ X<YB
- */
-DEFINE_INSN
-opt_lt
-()
-(VALUE recv, VALUE obj)
-(VALUE val)
-{
- if (FIXNUM_2_P(recv, obj) &&
- BASIC_OP_UNREDEFINED_P(BOP_LT)) {
- SIGNED_VALUE a = recv, b = obj;
-
- if (a < b) {
- val = Qtrue;
- }
- else {
- val = Qfalse;
- }
- }
- else if (!SPECIAL_CONST_P(recv) && !SPECIAL_CONST_P(obj)) {
- if (0) {
- }
-#if 1
- else if (HEAP_CLASS_OF(recv) == rb_cFloat &&
- HEAP_CLASS_OF(obj) == rb_cFloat &&
- BASIC_OP_UNREDEFINED_P(BOP_LT)) {
- double a = RFLOAT_VALUE(recv);
- double b = RFLOAT_VALUE(obj);
-#if defined(_MSC_VER) && _MSC_VER < 1300
- if (isnan(a) || isnan(b)) val = Qfalse;
- else
-#endif
- val = a < b ? Qtrue : Qfalse;
- }
-#endif
- else {
- goto INSN_LABEL(normal_dispatch);
- }
- }
- else {
- INSN_LABEL(normal_dispatch):
- PUSH(recv);
- PUSH(obj);
- CALL_SIMPLE_METHOD(1, idLT, recv);
- }
-}
-
-/**
- @c optimize
- @e optimized X<=Y.
- @j œKꂽ X<=YB
- */
-DEFINE_INSN
-opt_le
-()
-(VALUE recv, VALUE obj)
-(VALUE val)
-{
- if (FIXNUM_2_P(recv, obj) &&
- BASIC_OP_UNREDEFINED_P(BOP_LE)) {
- SIGNED_VALUE a = recv, b = obj;
-
- if (a <= b) {
- val = Qtrue;
- }
- else {
- val = Qfalse;
- }
- }
- else {
- /* other */
- PUSH(recv);
- PUSH(obj);
- CALL_SIMPLE_METHOD(1, idLE, recv);
- }
-}
-
-/**
- @c optimize
- @e optimized X>Y.
- @j œKꂽ X>YB
- */
-DEFINE_INSN
-opt_gt
-()
-(VALUE recv, VALUE obj)
-(VALUE val)
-{
- if (FIXNUM_2_P(recv, obj) &&
- BASIC_OP_UNREDEFINED_P(BOP_GT)) {
- SIGNED_VALUE a = recv, b = obj;
-
- if (a > b) {
- val = Qtrue;
- }
- else {
- val = Qfalse;
- }
- }
- else if (!SPECIAL_CONST_P(recv) && !SPECIAL_CONST_P(obj)) {
- if (0) {
- }
-#if 1
- else if (HEAP_CLASS_OF(recv) == rb_cFloat &&
- HEAP_CLASS_OF(obj) == rb_cFloat &&
- BASIC_OP_UNREDEFINED_P(BOP_GT)) {
- double a = RFLOAT_VALUE(recv);
- double b = RFLOAT_VALUE(obj);
-#if defined(_MSC_VER) && _MSC_VER < 1300
- if (isnan(a) || isnan(b)) val = Qfalse;
- else
-#endif
- val = a > b ? Qtrue : Qfalse;
- }
-#endif
- else {
- goto INSN_LABEL(normal_dispatch);
- }
- }
- else {
- INSN_LABEL(normal_dispatch):
- PUSH(recv);
- PUSH(obj);
- CALL_SIMPLE_METHOD(1, idGT, recv);
- }
-}
-
-/**
- @c optimize
- @e optimized X>=Y.
- @j œKꂽ X>=YB
- */
-DEFINE_INSN
-opt_ge
-()
-(VALUE recv, VALUE obj)
-(VALUE val)
-{
- if (FIXNUM_2_P(recv, obj) &&
- BASIC_OP_UNREDEFINED_P(BOP_GE)) {
- SIGNED_VALUE a = recv, b = obj;
-
- if (a >= b) {
- val = Qtrue;
- }
- else {
- val = Qfalse;
- }
- }
- else {
- PUSH(recv);
- PUSH(obj);
- CALL_SIMPLE_METHOD(1, idGE, recv);
- }
-}
-
-/**
- @c optimize
- @e <<
- @j œKꂽ X<<YB
- */
-DEFINE_INSN
-opt_ltlt
-()
-(VALUE recv, VALUE obj)
-(VALUE val)
-{
- if (!SPECIAL_CONST_P(recv)) {
- if (0) {
- }
- else if (HEAP_CLASS_OF(recv) == rb_cString &&
- BASIC_OP_UNREDEFINED_P(BOP_LTLT)) {
- val = rb_str_concat(recv, obj);
- }
- else if (HEAP_CLASS_OF(recv) == rb_cArray &&
- BASIC_OP_UNREDEFINED_P(BOP_LTLT)) {
- val = rb_ary_push(recv, obj);
- }
- else {
- goto INSN_LABEL(normal_dispatch);
- }
- }
- else {
- INSN_LABEL(normal_dispatch):
- PUSH(recv);
- PUSH(obj);
- CALL_SIMPLE_METHOD(1, idLTLT, recv);
- }
-}
-
-/**
- @c optimize
- @e []
- @j œKꂽ recv[obj]B
- */
-DEFINE_INSN
-opt_aref
-()
-(VALUE recv, VALUE obj)
-(VALUE val)
-{
- if (!SPECIAL_CONST_P(recv) && BASIC_OP_UNREDEFINED_P(BOP_AREF)) {
- if (HEAP_CLASS_OF(recv) == rb_cArray && FIXNUM_P(obj)) {
- val = rb_ary_entry(recv, FIX2LONG(obj));
- }
- else if (HEAP_CLASS_OF(recv) == rb_cHash) {
- val = rb_hash_aref(recv, obj);
- }
- else {
- goto INSN_LABEL(normal_dispatch);
- }
- }
- else {
- INSN_LABEL(normal_dispatch):
- PUSH(recv);
- PUSH(obj);
- CALL_SIMPLE_METHOD(1, idAREF, recv);
- }
-}
-
-/**
- @c optimize
- @e recv[obj] = set
- @j œKꂽ recv[obj] = setB
- */
-DEFINE_INSN
-opt_aset
-()
-(VALUE recv, VALUE obj, VALUE set)
-(VALUE val)
-{
- if (!SPECIAL_CONST_P(recv) &&
- BASIC_OP_UNREDEFINED_P(BOP_ASET)) {
- if (HEAP_CLASS_OF(recv) == rb_cArray && FIXNUM_P(obj)) {
- rb_ary_store(recv, FIX2LONG(obj), set);
- val = set;
- }
- else if (HEAP_CLASS_OF(recv) == rb_cHash) {
- 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(2, idASET, recv);
- }
-}
-
-/**
- @c optimize
- @e optimized length
- @j œKꂽ recv.length()B
- */
-DEFINE_INSN
-opt_length
-()
-(VALUE recv)
-(VALUE val)
-{
- if (!SPECIAL_CONST_P(recv) &&
- BASIC_OP_UNREDEFINED_P(BOP_LENGTH)) {
- if (HEAP_CLASS_OF(recv) == rb_cString) {
- val = rb_str_length(recv);
- }
- else if (HEAP_CLASS_OF(recv) == rb_cArray) {
- val = LONG2NUM(RARRAY_LEN(recv));
- }
- else if (HEAP_CLASS_OF(recv) == rb_cHash) {
- val = INT2FIX(RHASH_SIZE(recv));
- }
- else {
- goto INSN_LABEL(normal_dispatch);
- }
- }
- else {
- INSN_LABEL(normal_dispatch):
- PUSH(recv);
- CALL_SIMPLE_METHOD(0, idLength, recv);
- }
-}
-
-/**
- @c optimize
- @e optimized succ
- @j œKꂽ recv.succ()B
- */
-DEFINE_INSN
-opt_succ
-()
-(VALUE recv)
-(VALUE val)
-{
- if (SPECIAL_CONST_P(recv)) {
- if (FIXNUM_P(recv) &&
- BASIC_OP_UNREDEFINED_P(BOP_SUCC)) {
- 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 (HEAP_CLASS_OF(recv) == rb_cString &&
- BASIC_OP_UNREDEFINED_P(BOP_SUCC)) {
- val = rb_str_succ(recv);
- }
- else if (HEAP_CLASS_OF(recv) == rb_cTime &&
- BASIC_OP_UNREDEFINED_P(BOP_SUCC)) {
- val = rb_time_succ(recv);
- }
- else
- {
- goto INSN_LABEL(normal_dispatch);
- }
- }
- if (0) {
- INSN_LABEL(normal_dispatch):
- PUSH(recv);
- CALL_SIMPLE_METHOD(0, idSucc, recv);
- }
-}
-
-/**
- @c optimize
- @e optimized not
- @j œKꂽ recv.!()B
- */
-DEFINE_INSN
-opt_not
-(IC ic)
-(VALUE recv)
-(VALUE val)
-{
- extern VALUE rb_obj_not(VALUE obj);
- const rb_method_entry_t *me = vm_method_search(idNot, CLASS_OF(recv), ic);
-
- if (check_cfunc(me, rb_obj_not)) {
- val = RTEST(recv) ? Qfalse : Qtrue;
- }
- else {
- PUSH(recv);
- CALL_SIMPLE_METHOD(0, idNot, recv);
- }
-}
-
-
-/**
- @c optimize
- @e optimized regexp match
- @j œKꂽK\}b`B
- */
-DEFINE_INSN
-opt_regexpmatch1
-(VALUE r)
-(VALUE obj)
-(VALUE val)
-{
- val = rb_reg_match(r, obj);
-}
-
-/**
- @c optimize
- @e optimized regexp match 2
- @j œKꂽK\}b` 2
- */
-DEFINE_INSN
-opt_regexpmatch2
-()
-(VALUE obj2, VALUE obj1)
-(VALUE val)
-{
- if (TYPE(obj2) == T_STRING) {
- val = rb_reg_match(obj1, obj2);
- }
- else {
- val = rb_funcall(obj2, idEqTilde, 1, obj1);
- }
-}
-
-/**
- @c optimize
- @e call native compiled method
- @j lCeBuRpC\bhNB
- */
-DEFINE_INSN
-opt_call_c_function
-(rb_insn_func_t funcptr)
-()
-()
-{
- reg_cfp = (funcptr)(th, reg_cfp);
-
- if (reg_cfp == 0) {
- VALUE err = th->errinfo;
- th->errinfo = Qnil;
- THROW_EXCEPTION(err);
- }
-
- RESTORE_REGS();
- NEXT_INSN();
-}
-
-/**
- @c joke
- @e BLT
- @j BLT
- */
-DEFINE_INSN
-bitblt
-()
-()
-(VALUE ret)
-{
- ret = rb_str_new2("a bit of bacon, lettuce and tomato");
-}
-
-/**
- @c joke
- @e The Answer to Life, the Universe, and Everything
- @j lAFAׂĂ̓B
- */
-DEFINE_INSN
-answer
-()
-()
-(VALUE ret)
-{
- ret = INT2FIX(42);
-}
-
diff --git a/tool/install-sh b/install-sh
index e69de29bb2..e69de29bb2 100755..100644
--- a/tool/install-sh
+++ b/install-sh
diff --git a/instruby.rb b/instruby.rb
new file mode 100755
index 0000000000..2903a7c739
--- /dev/null
+++ b/instruby.rb
@@ -0,0 +1,411 @@
+#!./miniruby
+
+load "./rbconfig.rb"
+include RbConfig
+
+srcdir = File.dirname(__FILE__)
+$:.unshift File.expand_path("lib", srcdir)
+require 'fileutils'
+require 'shellwords'
+require 'optparse'
+require 'optparse/shellwords'
+require 'tempfile'
+
+STDOUT.sync = true
+File.umask(0)
+
+def parse_args(argv = ARGV)
+ $mantype = 'doc'
+ $destdir = nil
+ $extout = nil
+ $make = 'make'
+ $mflags = []
+ $install = []
+ $installed_list = nil
+ $dryrun = false
+ $rdocdir = nil
+ $data_mode = 0644
+ $prog_mode = 0755
+ $dir_mode = nil
+ $script_mode = nil
+ $cmdtype = ('bat' if File::ALT_SEPARATOR == '\\')
+ mflags = []
+ opt = OptionParser.new
+ opt.on('-n') {$dryrun = true}
+ opt.on('--dest-dir=DIR') {|dir| $destdir = dir}
+ opt.on('--extout=DIR') {|dir| $extout = (dir unless dir.empty?)}
+ opt.on('--make=COMMAND') {|make| $make = make}
+ opt.on('--mantype=MAN') {|man| $mantype = man}
+ opt.on('--make-flags=FLAGS', '--mflags', Shellwords) do |v|
+ if arg = v.first
+ arg.insert(0, '-') if /\A[^-][^=]*\Z/ =~ arg
+ end
+ $mflags.concat(v)
+ end
+ opt.on('-i', '--install=TYPE',
+ [:local, :bin, :"bin-arch", :"bin-comm", :lib, :man, :ext, :"ext-arch", :"ext-comm", :rdoc]) do |ins|
+ $install << ins
+ end
+ opt.on('--data-mode=OCTAL-MODE', OptionParser::OctalInteger) do |mode|
+ $data_mode = mode
+ end
+ opt.on('--prog-mode=OCTAL-MODE', OptionParser::OctalInteger) do |mode|
+ $prog_mode = mode
+ end
+ opt.on('--dir-mode=OCTAL-MODE', OptionParser::OctalInteger) do |mode|
+ $dir_mode = mode
+ end
+ opt.on('--script-mode=OCTAL-MODE', OptionParser::OctalInteger) do |mode|
+ $script_mode = mode
+ end
+ opt.on('--installed-list [FILENAME]') {|name| $installed_list = name}
+ opt.on('--rdoc-output [DIR]') {|dir| $rdocdir = dir}
+ opt.on('--cmd-type=TYPE', %w[bat cmd plain]) {|cmd| $cmdtype = (cmd unless cmd == 'plain')}
+
+ opt.order!(argv) do |v|
+ case v
+ when /\AINSTALL[-_]([-\w]+)=(.*)/
+ argv.unshift("--#{$1.tr('_', '-')}=#{$2}")
+ when /\A\w[-\w+]*=\z/
+ mflags << v
+ when /\A\w[-\w+]*\z/
+ $install << v.intern
+ else
+ raise OptionParser::InvalidArgument, v
+ end
+ end rescue abort [$!.message, opt].join("\n")
+
+ $make, *rest = Shellwords.shellwords($make)
+ $mflags.unshift(*rest) unless rest.empty?
+ $mflags.unshift(*mflags)
+
+ def $mflags.set?(flag)
+ grep(/\A-(?!-).*#{flag.chr}/i) { return true }
+ false
+ end
+ def $mflags.defined?(var)
+ grep(/\A#{var}=(.*)/) {return block_given? ? yield($1) : $1}
+ false
+ end
+
+ if $mflags.set?(?n)
+ $dryrun = true
+ else
+ $mflags << '-n' if $dryrun
+ end
+
+ $destdir ||= $mflags.defined?("DESTDIR")
+ if $extout ||= $mflags.defined?("EXTOUT")
+ Config.expand($extout)
+ end
+
+ $continue = $mflags.set?(?k)
+
+ if $installed_list ||= $mflags.defined?('INSTALLED_LIST')
+ Config.expand($installed_list, Config::CONFIG)
+ $installed_list = open($installed_list, "ab")
+ $installed_list.sync = true
+ end
+
+ $rdocdir ||= $mflags.defined?('RDOCOUT')
+
+ $dir_mode ||= $prog_mode | 0700
+ $script_mode ||= $prog_mode
+end
+
+parse_args()
+
+include FileUtils
+include FileUtils::NoWrite if $dryrun
+@fileutils_output = STDOUT
+@fileutils_label = ''
+
+$install_procs = Hash.new {[]}
+def install?(*types, &block)
+ $install_procs[:all] <<= block
+ types.each do |type|
+ $install_procs[type] <<= block
+ end
+end
+
+def install(src, dest, options = {})
+ options[:preserve] = true
+ super(src, with_destdir(dest), options)
+ if $installed_list
+ dest = File.join(dest, File.basename(src)) if $made_dirs[dest]
+ $installed_list.puts dest
+ end
+end
+
+def ln_sf(src, dest)
+ super(src, with_destdir(dest))
+ $installed_list.puts dest if $installed_list
+end
+
+$made_dirs = {}
+def makedirs(dirs)
+ dirs = fu_list(dirs)
+ dirs.collect! do |dir|
+ realdir = with_destdir(dir)
+ realdir unless $made_dirs.fetch(dir) do
+ $made_dirs[dir] = true
+ $installed_list.puts(File.join(dir, "")) if $installed_list
+ File.directory?(realdir)
+ end
+ end.compact!
+ super(dirs, :mode => $dir_mode) unless dirs.empty?
+end
+
+def install_recursive(srcdir, dest, options = {})
+ opts = options.clone
+ noinst = opts.delete(:no_install)
+ glob = opts.delete(:glob) || "*"
+ subpath = srcdir.size..-1
+ Dir.glob("#{srcdir}/**/#{glob}") do |src|
+ case base = File.basename(src)
+ when /\A\#.*\#\z/, /~\z/
+ next
+ end
+ if noinst
+ if Array === noinst
+ next if noinst.any? {|n| File.fnmatch?(n, base)}
+ else
+ next if File.fnmatch?(noinst, base)
+ end
+ end
+ d = dest + src[subpath]
+ if File.directory?(src)
+ makedirs(d)
+ else
+ makedirs(File.dirname(d))
+ install src, d, opts
+ end
+ end
+end
+
+def open_for_install(path, mode)
+ data = open(realpath = with_destdir(path), "rb") {|f| f.read} rescue nil
+ newdata = yield
+ unless $dryrun
+ unless newdata == data
+ open(realpath, "wb", mode) {|f| f.write newdata}
+ end
+ File.chmod(mode, realpath)
+ end
+ $installed_list.puts path if $installed_list
+end
+
+def with_destdir(dir)
+ return dir if !$destdir or $destdir.empty?
+ dir = dir.sub(/\A\w:/, '') if File::PATH_SEPARATOR == ';'
+ $destdir + dir
+end
+
+exeext = CONFIG["EXEEXT"]
+
+ruby_install_name = CONFIG["ruby_install_name"]
+rubyw_install_name = CONFIG["rubyw_install_name"]
+
+version = CONFIG["ruby_version"]
+bindir = CONFIG["bindir"]
+libdir = CONFIG["libdir"]
+rubylibdir = CONFIG["rubylibdir"]
+archlibdir = CONFIG["archdir"]
+sitelibdir = CONFIG["sitelibdir"]
+sitearchlibdir = CONFIG["sitearchdir"]
+vendorlibdir = CONFIG["vendorlibdir"]
+vendorarchlibdir = CONFIG["vendorarchdir"]
+mandir = File.join(CONFIG["mandir"], "man")
+configure_args = Shellwords.shellwords(CONFIG["configure_args"])
+enable_shared = CONFIG["ENABLE_SHARED"] == 'yes'
+dll = CONFIG["LIBRUBY_SO"]
+lib = CONFIG["LIBRUBY"]
+arc = CONFIG["LIBRUBY_A"]
+
+install?(:local, :arch, :bin, :'bin-arch') do
+ puts "installing binary commands"
+
+ makedirs [bindir, libdir, archlibdir]
+
+ install ruby_install_name+exeext, bindir, :mode => $prog_mode
+ if rubyw_install_name and !rubyw_install_name.empty?
+ install rubyw_install_name+exeext, bindir, :mode => $prog_mode
+ end
+ if enable_shared and dll != lib
+ install dll, bindir, :mode => $prog_mode
+ end
+ install lib, libdir, :mode => $prog_mode unless lib == arc
+ install arc, libdir, :mode => $data_mode
+ install "config.h", archlibdir, :mode => $data_mode
+ install "rbconfig.rb", archlibdir, :mode => $data_mode
+ if CONFIG["ARCHFILE"]
+ for file in CONFIG["ARCHFILE"].split
+ install file, archlibdir, :mode => $data_mode
+ end
+ end
+
+ if dll == lib and dll != arc
+ for link in CONFIG["LIBRUBY_ALIASES"].split
+ ln_sf(dll, File.join(libdir, link))
+ end
+ end
+end
+
+if $extout
+ extout = "#$extout"
+ install?(:ext, :arch, :'ext-arch') do
+ puts "installing extension objects"
+ makedirs [archlibdir, sitearchlibdir, vendorarchlibdir]
+ if noinst = CONFIG["no_install_files"] and noinst.empty?
+ noinst = nil
+ end
+ install_recursive("#{extout}/#{CONFIG['arch']}", archlibdir, :no_install => noinst, :mode => $prog_mode)
+ end
+ install?(:ext, :comm, :'ext-comm') do
+ puts "installing extension scripts"
+ makedirs [rubylibdir, sitelibdir, vendorlibdir]
+ install_recursive("#{extout}/common", rubylibdir, :mode => $data_mode)
+ end
+end
+
+install?(:rdoc) do
+ if $rdocdir
+ puts "installing rdoc"
+
+ ridatadir = File.join(CONFIG['datadir'], 'ri/$(MAJOR).$(MINOR)/system')
+ Config.expand(ridatadir)
+ makedirs [ridatadir]
+ install_recursive($rdocdir, ridatadir, :mode => $data_mode)
+ end
+end
+
+install?(:local, :comm, :bin, :'bin-comm') do
+ puts "installing command scripts"
+
+ Dir.chdir srcdir
+ makedirs [bindir, rubylibdir]
+
+ ruby_shebang = File.join(bindir, ruby_install_name)
+ if File::ALT_SEPARATOR
+ ruby_bin = ruby_shebang.tr(File::SEPARATOR, File::ALT_SEPARATOR)
+ end
+ for src in Dir["bin/*"]
+ next unless File.file?(src)
+ next if /\/[.#]|(\.(old|bak|orig|rej|diff|patch|core)|~|\/core)$/i =~ src
+
+ name = ruby_install_name.sub(/ruby/, File.basename(src))
+
+ shebang = ''
+ body = ''
+ open(src, "rb") do |f|
+ shebang = f.gets
+ body = f.read
+ end
+ shebang.sub!(/^\#!.*?ruby\b/) {"#!" + ruby_shebang}
+ shebang.sub!(/\r$/, '')
+ body.gsub!(/\r$/, '')
+
+ cmd = File.join(bindir, name)
+ cmd << ".#{$cmdtype}" if $cmdtype
+ open_for_install(cmd, $script_mode) do
+ case $cmdtype
+ when "bat"
+ "#{<<EOH}#{shebang}#{body}#{<<EOF}".gsub(/$/, "\r")
+@echo off
+@if not "%~d0" == "~d0" goto WinNT
+#{ruby_bin} -x "#{cmd}" %1 %2 %3 %4 %5 %6 %7 %8 %9
+@goto endofruby
+:WinNT
+"%~dp0#{ruby_install_name}" -x "%~f0" %*
+@goto endofruby
+EOH
+__END__
+:endofruby
+EOF
+ when "cmd"
+ "#{<<EOH}#{shebang}#{body}"
+@"%~dp0#{ruby_install_name}" -x "%~f0" %*
+@exit /b %ERRORLEVEL%
+EOH
+ else
+ shebang + body
+ end
+ end
+ end
+end
+
+install?(:local, :comm, :lib) do
+ puts "installing library scripts"
+
+ Dir.chdir srcdir
+ makedirs [rubylibdir]
+
+ for f in Dir["lib/**/*{.rb,help-message}"]
+ dir = File.dirname(f).sub!(/\Alib/, rubylibdir) || rubylibdir
+ makedirs dir
+ install f, dir, :mode => $data_mode
+ end
+end
+
+install?(:local, :arch, :lib) do
+ puts "installing headers"
+
+ Dir.chdir(srcdir)
+ makedirs [archlibdir]
+ for f in Dir["*.h"]
+ install f, archlibdir, :mode => $data_mode
+ end
+
+ if RUBY_PLATFORM =~ /mswin32|mingw|bccwin32/
+ win32libdir = File.join(archlibdir, "win32")
+ makedirs win32libdir
+ install "win32/win32.h", win32libdir, :mode => $data_mode
+ end
+end
+
+install?(:local, :comm, :man) do
+ puts "installing manpages"
+
+ Dir.chdir(srcdir)
+ for mdoc in Dir["*.[1-9]"]
+ next unless File.file?(mdoc) and open(mdoc){|fh| fh.read(1) == '.'}
+
+ destdir = mandir + mdoc[/(\d+)$/]
+ destfile = File.join(destdir, mdoc.sub(/ruby/, ruby_install_name))
+
+ makedirs destdir
+
+ if $mantype == "doc"
+ install mdoc, destfile, :mode => $data_mode
+ else
+ require 'mdoc2man.rb'
+
+ w = Tempfile.open(mdoc)
+
+ open(mdoc) { |r|
+ Mdoc2Man.mdoc2man(r, w)
+ }
+
+ w.close
+
+ install w.path, destfile, :mode => $data_mode
+ end
+ end
+end
+
+$install << :local << :ext if $install.empty?
+$install.each do |inst|
+ if !(procs = $install_procs[inst]) || procs.empty?
+ next warn("unknown install target - #{inst}")
+ end
+ procs.each do |block|
+ dir = Dir.pwd
+ begin
+ block.call
+ ensure
+ Dir.chdir(dir)
+ end
+ end
+end
+
+# vi:set sw=2:
diff --git a/intern.h b/intern.h
new file mode 100644
index 0000000000..47f0cddaa2
--- /dev/null
+++ b/intern.h
@@ -0,0 +1,531 @@
+/**********************************************************************
+
+ intern.h -
+
+ $Author$
+ $Date$
+ created at: Thu Jun 10 14:22:17 JST 1993
+
+ Copyright (C) 1993-2003 Yukihiro Matsumoto
+ Copyright (C) 2000 Network Applied Communication Laboratory, Inc.
+ Copyright (C) 2000 Information-technology Promotion Agency, Japan
+
+**********************************************************************/
+
+/*
+ * Functions and variables that are used by more than one source file of
+ * the kernel.
+ */
+
+#define ID_ALLOCATOR 1
+
+/* array.c */
+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));
+VALUE rb_ary_new2 _((long));
+VALUE rb_ary_new3 __((long,...));
+VALUE rb_ary_new4 _((long, const VALUE *));
+VALUE rb_ary_freeze _((VALUE));
+VALUE rb_ary_aref _((int, VALUE*, VALUE));
+void rb_ary_store _((VALUE, long, VALUE));
+VALUE rb_ary_dup _((VALUE));
+VALUE rb_ary_to_ary _((VALUE));
+VALUE rb_ary_to_s _((VALUE));
+VALUE rb_ary_push _((VALUE, VALUE));
+VALUE rb_ary_pop _((VALUE));
+VALUE rb_ary_shift _((VALUE));
+VALUE rb_ary_unshift _((VALUE, VALUE));
+VALUE rb_ary_entry _((VALUE, long));
+VALUE rb_ary_each _((VALUE));
+VALUE rb_ary_join _((VALUE, VALUE));
+VALUE rb_ary_print_on _((VALUE, VALUE));
+VALUE rb_ary_reverse _((VALUE));
+VALUE rb_ary_sort _((VALUE));
+VALUE rb_ary_sort_bang _((VALUE));
+VALUE rb_ary_delete _((VALUE, VALUE));
+VALUE rb_ary_delete_at _((VALUE, long));
+VALUE rb_ary_clear _((VALUE));
+VALUE rb_ary_plus _((VALUE, VALUE));
+VALUE rb_ary_concat _((VALUE, VALUE));
+VALUE rb_ary_assoc _((VALUE, VALUE));
+VALUE rb_ary_rassoc _((VALUE, VALUE));
+VALUE rb_ary_includes _((VALUE, VALUE));
+VALUE rb_ary_cmp _((VALUE, VALUE));
+VALUE rb_protect_inspect _((VALUE(*)(ANYARGS),VALUE,VALUE));
+VALUE rb_inspecting_p _((VALUE));
+VALUE rb_check_array_value _((VALUE));
+VALUE rb_values_at _((VALUE, long, int, VALUE*, VALUE(*) _((VALUE,long))));
+/* bignum.c */
+VALUE rb_big_clone _((VALUE));
+void rb_big_2comp _((VALUE));
+VALUE rb_big_norm _((VALUE));
+VALUE rb_uint2big _((unsigned long));
+VALUE rb_int2big _((long));
+VALUE rb_uint2inum _((unsigned long));
+VALUE rb_int2inum _((long));
+VALUE rb_cstr_to_inum _((const char*, int, int));
+VALUE rb_str_to_inum _((VALUE, int, int));
+VALUE rb_cstr2inum _((const char*, int));
+VALUE rb_str2inum _((VALUE, int));
+VALUE rb_big2str _((VALUE, int));
+VALUE rb_big2str0 _((VALUE, int, int));
+long rb_big2long _((VALUE));
+#define rb_big2int(x) rb_big2long(x)
+unsigned long rb_big2ulong _((VALUE));
+#define rb_big2uint(x) rb_big2ulong(x)
+#if HAVE_LONG_LONG
+VALUE rb_ll2inum _((LONG_LONG));
+VALUE rb_ull2inum _((unsigned LONG_LONG));
+LONG_LONG rb_big2ll _((VALUE));
+unsigned LONG_LONG rb_big2ull _((VALUE));
+#endif /* HAVE_LONG_LONG */
+void rb_quad_pack _((char*,VALUE));
+VALUE rb_quad_unpack _((const char*,int));
+VALUE rb_dbl2big _((double));
+double rb_big2dbl _((VALUE));
+VALUE rb_big_plus _((VALUE, VALUE));
+VALUE rb_big_minus _((VALUE, VALUE));
+VALUE rb_big_mul _((VALUE, VALUE));
+VALUE rb_big_divmod _((VALUE, VALUE));
+VALUE rb_big_pow _((VALUE, VALUE));
+VALUE rb_big_and _((VALUE, VALUE));
+VALUE rb_big_or _((VALUE, VALUE));
+VALUE rb_big_xor _((VALUE, VALUE));
+VALUE rb_big_lshift _((VALUE, VALUE));
+VALUE rb_big_rand _((VALUE, double*));
+/* class.c */
+VALUE rb_class_boot _((VALUE));
+VALUE rb_class_new _((VALUE));
+VALUE rb_mod_init_copy _((VALUE, VALUE));
+VALUE rb_class_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_module_new _((void));
+VALUE rb_define_module_id _((ID));
+VALUE rb_mod_included_modules _((VALUE));
+VALUE rb_mod_include_p _((VALUE, VALUE));
+VALUE rb_mod_ancestors _((VALUE));
+VALUE rb_class_instance_methods _((int, VALUE*, VALUE));
+VALUE rb_class_public_instance_methods _((int, VALUE*, VALUE));
+VALUE rb_class_protected_instance_methods _((int, VALUE*, VALUE));
+VALUE rb_big_rshift(VALUE, VALUE);
+VALUE rb_class_private_instance_methods _((int, VALUE*, VALUE));
+VALUE rb_obj_singleton_methods _((int, 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));
+void rb_define_singleton_method _((VALUE, const char*, VALUE(*)(ANYARGS), int));
+VALUE rb_singleton_class _((VALUE));
+/* compar.c */
+int rb_cmpint _((VALUE, VALUE, VALUE));
+NORETURN(void rb_cmperr _((VALUE, VALUE)));
+/* enum.c */
+VALUE rb_block_call _((VALUE, ID, int, VALUE*, VALUE (*)(ANYARGS), VALUE));
+/* enumerator.c */
+VALUE rb_enumeratorize _((VALUE, VALUE, int, VALUE *));
+#define RETURN_ENUMERATOR(obj, argc, argv) do { \
+ if (!rb_block_given_p()) \
+ return rb_enumeratorize(obj, ID2SYM(rb_frame_this_func()), \
+ argc, argv); \
+ } while (0)
+/* error.c */
+RUBY_EXTERN int ruby_nerrs;
+VALUE rb_exc_new _((VALUE, const char*, long));
+VALUE rb_exc_new2 _((VALUE, const char*));
+VALUE rb_exc_new3 _((VALUE, VALUE));
+NORETURN(void rb_loaderror __((const char*, ...)));
+NORETURN(void rb_name_error __((ID, const char*, ...)));
+NORETURN(void rb_invalid_str _((const char*, const char*)));
+void rb_compile_error __((const char*, ...));
+void rb_compile_error_append __((const char*, ...));
+NORETURN(void rb_load_fail _((const char*)));
+NORETURN(void rb_error_frozen _((const char*)));
+void rb_check_frozen _((VALUE));
+/* eval.c */
+RUBY_EXTERN struct RNode *ruby_current_node;
+void ruby_set_current_source _((void));
+NORETURN(void rb_exc_raise _((VALUE)));
+NORETURN(void rb_exc_fatal _((VALUE)));
+VALUE rb_f_exit _((int,VALUE*));
+VALUE rb_f_abort _((int,VALUE*));
+void rb_remove_method _((VALUE, const char*));
+#define rb_disable_super(klass, name) ((void)0)
+#define rb_enable_super(klass, name) ((void)0)
+#define HAVE_RB_DEFINE_ALLOC_FUNC 1
+void rb_define_alloc_func _((VALUE, VALUE (*)(VALUE)));
+void rb_undef_alloc_func _((VALUE));
+void rb_clear_cache _((void));
+void rb_clear_cache_by_class _((VALUE));
+void rb_alias _((VALUE, ID, ID));
+void rb_attr _((VALUE,ID,int,int,int));
+int rb_method_boundp _((VALUE, ID, int));
+VALUE rb_dvar_defined _((ID));
+VALUE rb_dvar_curr _((ID));
+VALUE rb_dvar_ref _((ID));
+void rb_dvar_asgn _((ID, VALUE));
+void rb_dvar_push _((ID, VALUE));
+VALUE *rb_svar _((int));
+VALUE rb_eval_cmd _((VALUE, VALUE, int));
+int rb_obj_respond_to _((VALUE, ID, int));
+int rb_respond_to _((VALUE, ID));
+void rb_interrupt _((void));
+VALUE rb_apply _((VALUE, ID, VALUE));
+void rb_backtrace _((void));
+ID rb_frame_last_func _((void));
+ID rb_frame_this_func _((void));
+VALUE rb_obj_instance_eval _((int, VALUE*, VALUE));
+VALUE rb_mod_module_eval _((int, VALUE*, VALUE));
+void rb_load _((VALUE, int));
+void rb_load_protect _((VALUE, int, int*));
+NORETURN(void rb_jump_tag _((int)));
+int rb_provided _((const char*));
+void rb_provide _((const char*));
+VALUE rb_f_require _((VALUE, VALUE));
+VALUE rb_require_safe _((VALUE, int));
+void rb_obj_call_init _((VALUE, int, VALUE*));
+VALUE rb_class_new_instance _((int, VALUE*, VALUE));
+VALUE rb_block_proc _((void));
+VALUE rb_block_dup _((VALUE, VALUE, VALUE));
+VALUE rb_method_dup _((VALUE, VALUE, VALUE));
+VALUE rb_f_lambda _((void));
+VALUE rb_proc_call _((VALUE, VALUE));
+VALUE rb_obj_method _((VALUE, VALUE));
+VALUE rb_protect _((VALUE (*)(VALUE), VALUE, int*));
+void rb_set_end_proc _((void (*)(VALUE), VALUE));
+void rb_mark_end_proc _((void));
+void rb_exec_end_proc _((void));
+void ruby_finalize _((void));
+NORETURN(void ruby_stop _((int)));
+int ruby_cleanup _((int));
+int ruby_exec _((void));
+void rb_gc_mark_threads _((void));
+void rb_thread_start_timer _((void));
+void rb_thread_stop_timer _((void));
+void rb_thread_schedule _((void));
+void rb_thread_wait_fd _((int));
+int rb_thread_fd_writable _((int));
+void rb_thread_fd_close _((int));
+int rb_thread_alone _((void));
+void rb_thread_polling _((void));
+void rb_thread_sleep _((int));
+void rb_thread_sleep_forever _((void));
+VALUE rb_thread_stop _((void));
+VALUE rb_thread_wakeup _((VALUE));
+VALUE rb_thread_wakeup_alive _((VALUE));
+VALUE rb_thread_run _((VALUE));
+VALUE rb_thread_kill _((VALUE));
+VALUE rb_thread_alive_p _((VALUE));
+VALUE rb_thread_create _((VALUE (*)(ANYARGS), void*));
+void rb_thread_interrupt _((void));
+void rb_thread_trap_eval _((VALUE, int, int));
+void rb_thread_signal_raise _((int));
+void rb_thread_signal_exit _((void));
+int rb_thread_select _((int, fd_set *, fd_set *, fd_set *, struct timeval *));
+void rb_thread_wait_for _((struct timeval));
+VALUE rb_thread_current _((void));
+VALUE rb_thread_main _((void));
+VALUE rb_thread_local_aref _((VALUE, ID));
+VALUE rb_thread_local_aset _((VALUE, ID, VALUE));
+void rb_thread_atfork _((void));
+VALUE rb_exec_recursive _((VALUE(*)(VALUE, VALUE, int),VALUE,VALUE));
+VALUE rb_funcall_rescue __((VALUE, ID, int, ...));
+/* file.c */
+VALUE rb_file_s_expand_path _((int, VALUE *));
+VALUE rb_file_expand_path _((VALUE, VALUE));
+void rb_file_const _((const char*, VALUE));
+int rb_find_file_ext _((VALUE*, const char* const*));
+VALUE rb_find_file _((VALUE));
+char *rb_path_next _((const char *));
+char *rb_path_skip_prefix _((const char *));
+char *rb_path_last_separator _((const char *));
+char *rb_path_end _((const char *));
+VALUE rb_file_directory_p _((VALUE,VALUE));
+/* gc.c */
+NORETURN(void rb_memerror __((void)));
+int ruby_stack_check _((void));
+size_t ruby_stack_length _((VALUE**));
+int rb_during_gc _((void));
+char *rb_source_filename _((const char*));
+void rb_gc_mark_locations _((VALUE*, VALUE*));
+void rb_mark_tbl _((struct st_table*));
+void rb_mark_set _((struct st_table*));
+void rb_mark_hash _((struct st_table*));
+void rb_gc_mark_maybe _((VALUE));
+void rb_gc_mark _((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));
+/* hash.c */
+void st_foreach_safe _((struct st_table *, int (*)(ANYARGS), unsigned long));
+void rb_hash_foreach _((VALUE, int (*)(ANYARGS), VALUE));
+VALUE rb_hash _((VALUE));
+VALUE rb_hash_new _((void));
+VALUE rb_hash_freeze _((VALUE));
+VALUE rb_hash_aref _((VALUE, VALUE));
+VALUE rb_hash_lookup _((VALUE, VALUE));
+VALUE rb_hash_aset _((VALUE, VALUE, VALUE));
+VALUE rb_hash_delete_if _((VALUE));
+VALUE rb_hash_delete _((VALUE,VALUE));
+int rb_path_check _((const char*));
+int rb_env_path_tainted _((void));
+/* io.c */
+#define rb_defout rb_stdout
+RUBY_EXTERN VALUE rb_fs;
+RUBY_EXTERN VALUE rb_output_fs;
+RUBY_EXTERN VALUE rb_rs;
+RUBY_EXTERN VALUE rb_default_rs;
+RUBY_EXTERN VALUE rb_output_rs;
+VALUE rb_io_write _((VALUE, VALUE));
+VALUE rb_io_gets _((VALUE));
+VALUE rb_io_getc _((VALUE));
+VALUE rb_io_ungetc _((VALUE, VALUE));
+VALUE rb_io_close _((VALUE));
+VALUE rb_io_eof _((VALUE));
+VALUE rb_io_binmode _((VALUE));
+VALUE rb_io_addstr _((VALUE, VALUE));
+VALUE rb_io_printf _((int, VALUE*, VALUE));
+VALUE rb_io_print _((int, VALUE*, VALUE));
+VALUE rb_io_puts _((int, VALUE*, VALUE));
+VALUE rb_file_open _((const char*, const char*));
+VALUE rb_gets _((void));
+void rb_write_error _((const char*));
+void rb_write_error2 _((const char*, long));
+/* marshal.c */
+VALUE rb_marshal_dump _((VALUE, VALUE));
+VALUE rb_marshal_load _((VALUE));
+/* numeric.c */
+void rb_num_zerodiv _((void));
+VALUE rb_num_coerce_bin _((VALUE, VALUE));
+VALUE rb_num_coerce_cmp _((VALUE, VALUE));
+VALUE rb_num_coerce_relop _((VALUE, VALUE));
+VALUE rb_float_new _((double));
+VALUE rb_num2fix _((VALUE));
+VALUE rb_fix2str _((VALUE, int));
+VALUE rb_dbl_cmp _((double, double));
+/* object.c */
+int rb_eql _((VALUE, VALUE));
+VALUE rb_any_to_s _((VALUE));
+VALUE rb_inspect _((VALUE));
+VALUE rb_obj_is_instance_of _((VALUE, VALUE));
+VALUE rb_obj_is_kind_of _((VALUE, VALUE));
+VALUE rb_obj_alloc _((VALUE));
+VALUE rb_obj_clone _((VALUE));
+VALUE rb_obj_dup _((VALUE));
+VALUE rb_obj_init_copy _((VALUE,VALUE));
+VALUE rb_obj_taint _((VALUE));
+VALUE rb_obj_tainted _((VALUE));
+VALUE rb_obj_untaint _((VALUE));
+VALUE rb_obj_freeze _((VALUE));
+VALUE rb_obj_id _((VALUE));
+VALUE rb_obj_class _((VALUE));
+VALUE rb_class_real _((VALUE));
+VALUE rb_class_inherited_p _((VALUE, VALUE));
+VALUE rb_convert_type _((VALUE,int,const char*,const char*));
+VALUE rb_check_convert_type _((VALUE,int,const char*,const char*));
+VALUE rb_check_to_integer _((VALUE, const char *));
+VALUE rb_to_int _((VALUE));
+VALUE rb_Integer _((VALUE));
+VALUE rb_Float _((VALUE));
+VALUE rb_String _((VALUE));
+VALUE rb_Array _((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;
+int ruby_yyparse _((void));
+ID rb_id_attrset _((ID));
+void rb_parser_append_print _((void));
+void rb_parser_while_loop _((int, int));
+int ruby_parser_stack_on_heap _((void));
+void rb_gc_mark_parser _((void));
+int rb_is_const_id _((ID));
+int rb_is_instance_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 */
+int rb_proc_exec _((const char*));
+VALUE rb_f_exec _((int,VALUE*));
+int rb_waitpid _((int,int*,int));
+void rb_syswait _((int));
+VALUE rb_proc_times _((VALUE));
+VALUE rb_detach_process _((int));
+/* range.c */
+VALUE rb_range_new _((VALUE, VALUE, int));
+VALUE rb_range_beg_len _((VALUE, long*, long*, long, int));
+VALUE rb_length_by_each _((VALUE));
+/* random.c */
+unsigned long rb_genrand_int32(void);
+double rb_genrand_real(void);
+/* re.c */
+int rb_memcmp _((const void*,const void*,long));
+int rb_memcicmp _((const void*,const void*,long));
+long rb_memsearch _((const void*,long,const void*,long));
+VALUE rb_reg_nth_defined _((int, VALUE));
+VALUE rb_reg_nth_match _((int, VALUE));
+VALUE rb_reg_last_match _((VALUE));
+VALUE rb_reg_match_pre _((VALUE));
+VALUE rb_reg_match_post _((VALUE));
+VALUE rb_reg_match_last _((VALUE));
+VALUE rb_reg_new _((const char*, long, int));
+VALUE rb_reg_match _((VALUE, VALUE));
+VALUE rb_reg_match2 _((VALUE));
+int rb_reg_options _((VALUE));
+void rb_set_kcode _((const char*));
+const char* rb_get_kcode _((void));
+void rb_kcode_set_option _((VALUE));
+void rb_kcode_reset_option _((void));
+/* ruby.c */
+RUBY_EXTERN VALUE rb_argv;
+RUBY_EXTERN VALUE rb_argv0;
+void rb_load_file _((const char*));
+void ruby_script _((const char*));
+void ruby_prog_init _((void));
+void ruby_set_argv _((int, char**));
+void ruby_process_options _((int, char**));
+void ruby_load_script _((void));
+void ruby_init_loadpath _((void));
+void ruby_incpush _((const char*));
+/* signal.c */
+VALUE rb_f_kill _((int, VALUE*));
+void rb_gc_mark_trap_list _((void));
+#ifdef POSIX_SIGNAL
+#define posix_signal ruby_posix_signal
+void posix_signal _((int, RETSIGTYPE (*)(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 */
+VALUE rb_f_sprintf _((int, VALUE*));
+VALUE rb_str_format _((int, VALUE*, VALUE));
+/* string.c */
+VALUE rb_str_new _((const char*, long));
+VALUE rb_str_new2 _((const char*));
+VALUE rb_str_new3 _((VALUE));
+VALUE rb_str_new4 _((VALUE));
+VALUE rb_str_new5 _((VALUE, const char*, long));
+VALUE rb_tainted_str_new _((const char*, long));
+VALUE rb_tainted_str_new2 _((const char*));
+VALUE rb_str_buf_new _((long));
+VALUE rb_str_buf_new2 _((const char*));
+VALUE rb_str_tmp_new _((long));
+VALUE rb_str_buf_append _((VALUE, VALUE));
+VALUE rb_str_buf_cat _((VALUE, const char*, long));
+VALUE rb_str_buf_cat2 _((VALUE, const char*));
+VALUE rb_obj_as_string _((VALUE));
+VALUE rb_check_string_type _((VALUE));
+VALUE rb_str_dup _((VALUE));
+VALUE rb_str_locktmp _((VALUE));
+VALUE rb_str_unlocktmp _((VALUE));
+VALUE rb_str_dup_frozen _((VALUE));
+VALUE rb_str_plus _((VALUE, VALUE));
+VALUE rb_str_times _((VALUE, VALUE));
+VALUE rb_str_substr _((VALUE, long, long));
+void rb_str_modify _((VALUE));
+VALUE rb_str_freeze _((VALUE));
+void rb_str_set_len _((VALUE, long));
+VALUE rb_str_resize _((VALUE, long));
+VALUE rb_str_cat _((VALUE, const char*, long));
+VALUE rb_str_cat2 _((VALUE, const char*));
+VALUE rb_str_append _((VALUE, VALUE));
+VALUE rb_str_concat _((VALUE, VALUE));
+int rb_str_hash _((VALUE));
+int rb_str_cmp _((VALUE, VALUE));
+VALUE rb_str_upto _((VALUE, VALUE, int));
+void rb_str_update _((VALUE, long, long, VALUE));
+VALUE rb_str_inspect _((VALUE));
+VALUE rb_str_dump _((VALUE));
+VALUE rb_str_split _((VALUE, const char*));
+void rb_str_associate _((VALUE, VALUE));
+VALUE rb_str_associated _((VALUE));
+void rb_str_setter _((VALUE, ID, VALUE*));
+VALUE rb_str_intern _((VALUE));
+/* struct.c */
+VALUE rb_struct_new __((VALUE, ...));
+VALUE rb_struct_define __((const char*, ...));
+VALUE rb_struct_alloc _((VALUE, VALUE));
+VALUE rb_struct_aref _((VALUE, VALUE));
+VALUE rb_struct_aset _((VALUE, VALUE, VALUE));
+VALUE rb_struct_getmember _((VALUE, ID));
+VALUE rb_struct_iv_get _((VALUE, const char*));
+VALUE rb_struct_s_members _((VALUE));
+VALUE rb_struct_members _((VALUE));
+/* time.c */
+VALUE rb_time_new _((time_t, time_t));
+/* variable.c */
+VALUE rb_mod_name _((VALUE));
+VALUE rb_class_path _((VALUE));
+void rb_set_class_path _((VALUE, VALUE, const char*));
+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));
+void rb_gc_mark_global_tbl _((void));
+VALUE rb_f_trace_var _((int, VALUE*));
+VALUE rb_f_untrace_var _((int, VALUE*));
+VALUE rb_f_global_variables _((void));
+void rb_alias_variable _((ID, ID));
+struct st_table* rb_generic_ivar_table _((VALUE));
+void rb_copy_generic_ivar _((VALUE,VALUE));
+void rb_mark_generic_ivar _((VALUE));
+void rb_mark_generic_ivar_tbl _((void));
+void rb_free_generic_ivar _((VALUE));
+VALUE rb_ivar_get _((VALUE, ID));
+VALUE rb_ivar_set _((VALUE, ID, VALUE));
+VALUE rb_ivar_defined _((VALUE, ID));
+VALUE rb_iv_set _((VALUE, const char*, VALUE));
+VALUE rb_iv_get _((VALUE, const char*));
+VALUE rb_attr_get _((VALUE, ID));
+VALUE rb_obj_instance_variables _((VALUE));
+VALUE rb_obj_remove_instance_variable _((VALUE, VALUE));
+void *rb_mod_const_at _((VALUE, void*));
+void *rb_mod_const_of _((VALUE, void*));
+VALUE rb_const_list _((void*));
+VALUE rb_mod_constants _((VALUE));
+VALUE rb_mod_remove_const _((VALUE, VALUE));
+int rb_const_defined _((VALUE, ID));
+int rb_const_defined_at _((VALUE, ID));
+int rb_const_defined_from _((VALUE, ID));
+VALUE rb_const_get _((VALUE, ID));
+VALUE rb_const_get_at _((VALUE, ID));
+VALUE rb_const_get_from _((VALUE, ID));
+void rb_const_set _((VALUE, ID, VALUE));
+VALUE rb_mod_constants _((VALUE));
+VALUE rb_mod_const_missing _((VALUE,VALUE));
+VALUE rb_cvar_defined _((VALUE, ID));
+#define RB_CVAR_SET_4ARGS 1
+void rb_cvar_set _((VALUE, ID, VALUE, int));
+VALUE rb_cvar_get _((VALUE, ID));
+void rb_cv_set _((VALUE, const char*, VALUE));
+VALUE rb_cv_get _((VALUE, const char*));
+void rb_define_class_variable _((VALUE, const char*, VALUE));
+VALUE rb_mod_class_variables _((VALUE));
+VALUE rb_mod_remove_cvar _((VALUE, VALUE));
+/* version.c */
+void ruby_show_version _((void));
+void ruby_show_copyright _((void));
diff --git a/io.c b/io.c
index b1d985e4f5..8b0e51b460 100644
--- a/io.c
+++ b/io.c
@@ -3,38 +3,33 @@
io.c -
$Author$
+ $Date$
created at: Fri Oct 15 18:08:59 JST 1993
- Copyright (C) 1993-2007 Yukihiro Matsumoto
+ Copyright (C) 1993-2003 Yukihiro Matsumoto
Copyright (C) 2000 Network Applied Communication Laboratory, Inc.
Copyright (C) 2000 Information-technology Promotion Agency, Japan
**********************************************************************/
-#include "ruby/ruby.h"
-#include "ruby/io.h"
-#include "dln.h"
-#include <ctype.h>
-#include <errno.h>
-
-#define free(x) xfree(x)
-
-#if defined(DOSISH) || defined(__CYGWIN__)
-#include <io.h>
+#if defined(__VMS)
+#define _XOPEN_SOURCE
+#define _POSIX_C_SOURCE 2
#endif
-#include <sys/types.h>
-#if defined HAVE_NET_SOCKET_H
-# include <net/socket.h>
-#elif defined HAVE_SYS_SOCKET_H
-# include <sys/socket.h>
-#endif
+#include "ruby.h"
+#include "rubyio.h"
+#include "rubysig.h"
+#include "env.h"
+#include "re.h"
+#include <ctype.h>
+#include <errno.h>
-#if defined(__BOW__) || defined(__CYGWIN__) || defined(_WIN32) || defined(__EMX__) || defined(__BEOS__)
+#if defined(MSDOS) || defined(__BOW__) || defined(__CYGWIN__) || defined(_WIN32) || defined(__human68k__) || defined(__EMX__) || defined(__BEOS__)
# define NO_SAFE_RENAME
#endif
-#if defined(__CYGWIN__) || defined(_WIN32)
+#if defined(MSDOS) || defined(__CYGWIN__) || defined(_WIN32)
# define NO_LONG_FNAME
#endif
@@ -47,7 +42,7 @@
#endif
#include <sys/types.h>
-#if defined(HAVE_SYS_IOCTL_H) && !defined(_WIN32)
+#if defined(HAVE_SYS_IOCTL_H) && !defined(DJGPP) && !defined(_WIN32) && !defined(__human68k__)
#include <sys/ioctl.h>
#endif
#if defined(HAVE_FCNTL_H) || defined(_WIN32)
@@ -55,10 +50,19 @@
#elif defined(HAVE_SYS_FCNTL_H)
#include <sys/fcntl.h>
#endif
+#ifdef __CYGWIN__
+#include <io.h>
+#endif
#if !HAVE_OFF_T && !defined(off_t)
# define off_t long
#endif
+#if !HAVE_FSEEKO && !defined(fseeko)
+# define fseeko fseek
+#endif
+#if !HAVE_FTELLO && !defined(ftello)
+# define ftello ftell
+#endif
#include <sys/stat.h>
@@ -72,24 +76,25 @@
#endif
#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-
#ifdef HAVE_SYSCALL_H
#include <syscall.h>
#elif defined HAVE_SYS_SYSCALL_H
#include <sys/syscall.h>
#endif
-extern void Init_File(void);
+#include <unistd.h>
+#endif
+
+extern void Init_File _((void));
#ifdef __BEOS__
# ifndef NOFILE
# define NOFILE (OPEN_MAX)
# endif
+#include <net/socket.h>
#endif
-#include "ruby/util.h"
+#include "util.h"
#ifndef O_ACCMODE
#define O_ACCMODE (O_RDONLY | O_WRONLY | O_RDWR)
@@ -107,13 +112,9 @@ extern void Init_File(void);
# endif
#endif
-#define numberof(array) (int)(sizeof(array) / sizeof((array)[0]))
-
VALUE rb_cIO;
VALUE rb_eEOFError;
VALUE rb_eIOError;
-VALUE rb_mWaitReadable;
-VALUE rb_mWaitWritable;
VALUE rb_stdin, rb_stdout, rb_stderr;
VALUE rb_deferr; /* rescue VIM plugin */
@@ -126,114 +127,103 @@ VALUE rb_default_rs;
static VALUE argf;
-static ID id_write, id_read, id_getc, id_flush, id_readpartial;
-static VALUE sym_mode, sym_perm, sym_extenc, sym_intenc, sym_encoding, sym_open_args;
-static VALUE sym_textmode, sym_binmode;
-
-struct timeval rb_time_interval(VALUE);
-
-struct argf {
- VALUE filename, current_file;
- int last_lineno; /* $. */
- int lineno;
- int init_p, next_p;
- VALUE argv;
- char *inplace;
- int binmode;
- struct rb_io_enc_t encs;
-};
+static ID id_write, id_read, id_getc;
+
+extern char *ruby_inplace_mode;
-static int max_file_descriptor = NOFILE;
-#define UPDATE_MAXFD(fd) \
- do { \
- if (max_file_descriptor < (fd)) max_file_descriptor = (fd); \
- } while (0)
+struct timeval rb_time_interval _((VALUE));
-#define argf_of(obj) (*(struct argf *)DATA_PTR(obj))
-#define ARGF argf_of(argf)
+static VALUE filename, current_file;
+static int gets_lineno;
+static int init_p = 0, next_p = 0;
+static VALUE lineno = INT2FIX(0);
#ifdef _STDIO_USES_IOSTREAM /* GNU libc */
# ifdef _IO_fpos_t
-# define STDIO_READ_DATA_PENDING(fp) ((fp)->_IO_read_ptr != (fp)->_IO_read_end)
+# define READ_DATA_PENDING(fp) ((fp)->_IO_read_ptr != (fp)->_IO_read_end)
+# define READ_DATA_PENDING_COUNT(fp) ((fp)->_IO_read_end - (fp)->_IO_read_ptr)
+# define READ_DATA_PENDING_PTR(fp) ((fp)->_IO_read_ptr)
# else
-# define STDIO_READ_DATA_PENDING(fp) ((fp)->_gptr < (fp)->_egptr)
+# define READ_DATA_PENDING(fp) ((fp)->_gptr < (fp)->_egptr)
+# define READ_DATA_PENDING_COUNT(fp) ((fp)->_egptr - (fp)->_gptr)
+# define READ_DATA_PENDING_PTR(fp) ((fp)->_gptr)
# endif
+#elif defined(_LP64) && (defined(__sun__) || defined(__sun))
+typedef struct _FILE64 {
+ unsigned char *_ptr; /* next character from/to here in buffer */
+ unsigned char *_base; /* the buffer */
+ unsigned char *_end; /* the end of the buffer */
+ ssize_t _cnt; /* number of available characters in buffer */
+ int _file; /* UNIX System file descriptor */
+ unsigned int _flag; /* the state of the stream */
+ char __fill[80]; /* filler to bring size to 128 bytes */
+} FILE64;
+# define READ_DATA_PENDING(fp) (((FILE64*)(fp))->_cnt > 0)
+# define READ_DATA_PENDING_COUNT(fp) (((FILE64*)(fp))->_cnt)
+# define READ_DATA_PENDING_PTR(fp) ((char *)((FILE64*)(fp))->_ptr)
#elif defined(FILE_COUNT)
-# define STDIO_READ_DATA_PENDING(fp) ((fp)->FILE_COUNT > 0)
+# define READ_DATA_PENDING(fp) ((fp)->FILE_COUNT > 0)
+# define READ_DATA_PENDING_COUNT(fp) ((fp)->FILE_COUNT)
#elif defined(FILE_READEND)
-# define STDIO_READ_DATA_PENDING(fp) ((fp)->FILE_READPTR < (fp)->FILE_READEND)
+# define READ_DATA_PENDING(fp) ((fp)->FILE_READPTR < (fp)->FILE_READEND)
+# define READ_DATA_PENDING_COUNT(fp) ((fp)->FILE_READEND - (fp)->FILE_READPTR)
#elif defined(__BEOS__)
-# define STDIO_READ_DATA_PENDING(fp) (fp->_state._eof == 0)
+# define READ_DATA_PENDING(fp) (fp->_state._eof == 0)
+#elif defined(__VMS)
+# define READ_DATA_PENDING_COUNT(fp) ((unsigned int)(*(fp))->_cnt)
+# define READ_DATA_PENDING(fp) (((unsigned int)(*(fp))->_cnt) > 0)
+# define READ_DATA_BUFFERED(fp) 0
+#elif defined(__DragonFly__)
+/* FILE is an incomplete struct type since DragonFly BSD 1.4.0 */
+# define READ_DATA_PENDING(fp) (((struct __FILE_public *)(fp))->_r > 0)
+# define READ_DATA_PENDING_COUNT(fp) (((struct __FILE_public *)(fp))->_r)
#else
-# define STDIO_READ_DATA_PENDING(fp) (!feof(fp))
+/* requires systems own version of the ReadDataPending() */
+extern int ReadDataPending();
+# define READ_DATA_PENDING(fp) (!feof(fp))
+# define READ_DATA_BUFFERED(fp) 0
#endif
-
-#define GetWriteIO(io) rb_io_get_write_io(io)
-
-#define READ_DATA_PENDING(fptr) ((fptr)->rbuf_len)
-#define READ_DATA_PENDING_COUNT(fptr) ((fptr)->rbuf_len)
-#define READ_DATA_PENDING_PTR(fptr) ((fptr)->rbuf+(fptr)->rbuf_off)
-#define READ_DATA_BUFFERED(fptr) READ_DATA_PENDING(fptr)
-
-#define READ_CHECK(fptr) do {\
- if (!READ_DATA_PENDING(fptr)) {\
- rb_thread_wait_fd((fptr)->fd);\
- rb_io_check_closed(fptr);\
- }\
-} while(0)
-
-#ifndef S_ISSOCK
-# ifdef _S_ISSOCK
-# define S_ISSOCK(m) _S_ISSOCK(m)
-# else
-# ifdef _S_IFSOCK
-# define S_ISSOCK(m) ((m & S_IFMT) == _S_IFSOCK)
-# else
-# ifdef S_IFSOCK
-# define S_ISSOCK(m) ((m & S_IFMT) == S_IFSOCK)
-# endif
-# endif
-# endif
+#ifndef READ_DATA_BUFFERED
+# define READ_DATA_BUFFERED(fp) READ_DATA_PENDING(fp)
#endif
-#if !defined HAVE_SHUTDOWN && !defined shutdown
-#define shutdown(a,b) 0
+#ifndef READ_DATA_PENDING_PTR
+# ifdef FILE_READPTR
+# define READ_DATA_PENDING_PTR(fp) ((char *)(fp)->FILE_READPTR)
+# endif
#endif
-#define rb_sys_fail_path(path) rb_sys_fail(NIL_P(path) ? 0 : RSTRING_PTR(path))
-
-#if defined(_WIN32)
-#define is_socket(fd, path) rb_w32_is_socket(fd)
-#elif !defined(S_ISSOCK)
-#define is_socket(fd, path) 0
-#else
-static int
-is_socket(int fd, VALUE path)
-{
- struct stat sbuf;
- if (fstat(fd, &sbuf) < 0)
- rb_sys_fail_path(path);
- return S_ISSOCK(sbuf.st_mode);
-}
+#if defined __DJGPP__
+# undef READ_DATA_PENDING_COUNT
+# undef READ_DATA_PENDING_PTR
#endif
+#define READ_CHECK(fp) do {\
+ if (!READ_DATA_PENDING(fp)) {\
+ rb_thread_wait_fd(fileno(fp));\
+ rb_io_check_closed(fptr);\
+ }\
+} while(0)
+
void
-rb_eof_error(void)
+rb_eof_error()
{
rb_raise(rb_eEOFError, "end of file reached");
}
VALUE
-rb_io_taint_check(VALUE io)
+rb_io_taint_check(io)
+ VALUE io;
{
- if (!OBJ_UNTRUSTED(io) && rb_safe_level() >= 4)
- rb_raise(rb_eSecurityError, "Insecure: operation on trusted IO");
+ if (!OBJ_TAINTED(io) && rb_safe_level() >= 4)
+ rb_raise(rb_eSecurityError, "Insecure: operation on untainted IO");
rb_check_frozen(io);
return io;
}
void
-rb_io_check_initialized(rb_io_t *fptr)
+rb_io_check_initialized(fptr)
+ rb_io_t *fptr;
{
if (!fptr) {
rb_raise(rb_eIOError, "uninitialized stream");
@@ -241,130 +231,30 @@ rb_io_check_initialized(rb_io_t *fptr)
}
void
-rb_io_check_closed(rb_io_t *fptr)
+rb_io_check_closed(fptr)
+ rb_io_t *fptr;
{
rb_io_check_initialized(fptr);
- if (fptr->fd < 0) {
+ if (!fptr->f && !fptr->f2) {
rb_raise(rb_eIOError, "closed stream");
}
}
-static int io_fflush(rb_io_t *);
-
-VALUE
-rb_io_get_io(VALUE io)
-{
- return rb_convert_type(io, T_FILE, "IO", "to_io");
-}
-
-static VALUE
-rb_io_check_io(VALUE io)
-{
- return rb_check_convert_type(io, T_FILE, "IO", "to_io");
-}
-
-VALUE
-rb_io_get_write_io(VALUE io)
-{
- VALUE write_io;
- rb_io_check_initialized(RFILE(io)->fptr);
- write_io = RFILE(io)->fptr->tied_io_for_writing;
- if (write_io) {
- return write_io;
- }
- return io;
-}
-
-/*
- * call-seq:
- * 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
- * for any reason.
- *
- * IO.try_convert(STDOUT) # => STDOUT
- * IO.try_convert("STDOUT") # => nil
- *
- * require 'zlib'
- * f = open("/tmp/zz.gz") # => #<File:/tmp/zz.gz>
- * z = Zlib::GzipReader.open(f) # => #<Zlib::GzipReader:0x81d8744>
- * IO.try_convert(z) # => #<File:/tmp/zz.gz>
- *
- */
-static VALUE
-rb_io_s_try_convert(VALUE dummy, VALUE io)
-{
- return rb_io_check_io(io);
-}
-
-static void
-io_unread(rb_io_t *fptr)
-{
- off_t r;
- rb_io_check_closed(fptr);
- if (fptr->rbuf_len == 0 || fptr->mode & FMODE_DUPLEX)
- return;
- /* xxx: target position may be negative if buffer is filled by ungetc */
- r = lseek(fptr->fd, -fptr->rbuf_len, SEEK_CUR);
- if (r < 0) {
- if (errno == ESPIPE)
- fptr->mode |= FMODE_DUPLEX;
- return;
- }
- fptr->rbuf_off = 0;
- fptr->rbuf_len = 0;
- return;
-}
-
-static rb_encoding *io_input_encoding(rb_io_t *fptr);
-
-static void
-io_ungetbyte(VALUE str, rb_io_t *fptr)
-{
- long len = RSTRING_LEN(str);
-
- if (fptr->rbuf == NULL) {
- fptr->rbuf_off = 0;
- fptr->rbuf_len = 0;
-#if SIZEOF_LONG > SIZEOF_INT
- if (len > INT_MAX)
- rb_raise(rb_eIOError, "ungetbyte failed");
-#endif
- if (len > 8192)
- fptr->rbuf_capa = (int)len;
- else
- fptr->rbuf_capa = 8192;
- fptr->rbuf = ALLOC_N(char, fptr->rbuf_capa);
- }
- if (fptr->rbuf_capa < len + fptr->rbuf_len) {
- rb_raise(rb_eIOError, "ungetbyte failed");
- }
- if (fptr->rbuf_off < len) {
- MEMMOVE(fptr->rbuf+fptr->rbuf_capa-fptr->rbuf_len,
- fptr->rbuf+fptr->rbuf_off,
- char, fptr->rbuf_len);
- fptr->rbuf_off = fptr->rbuf_capa-fptr->rbuf_len;
- }
- fptr->rbuf_off-=(int)len;
- fptr->rbuf_len+=(int)len;
- MEMMOVE(fptr->rbuf+fptr->rbuf_off, RSTRING_PTR(str), char, len);
-}
+static void io_fflush _((FILE *, rb_io_t *));
static rb_io_t *
-flush_before_seek(rb_io_t *fptr)
+flush_before_seek(fptr)
+ rb_io_t *fptr;
{
- if (io_fflush(fptr) < 0)
- rb_sys_fail(0);
- io_unread(fptr);
+ if (fptr->mode & FMODE_WBUF) {
+ io_fflush(GetWriteFile(fptr), fptr);
+ }
errno = 0;
return fptr;
}
-#define io_set_eof(fptr) (void)(((fptr)->mode & FMODE_TTY) && ((fptr)->mode |= FMODE_EOF))
-#define io_unset_eof(fptr) (fptr->mode &= ~FMODE_EOF)
-#define io_seek(fptr, ofs, whence) (io_unset_eof(fptr), lseek(flush_before_seek(fptr)->fd, ofs, whence))
-#define io_tell(fptr) lseek(flush_before_seek(fptr)->fd, 0, SEEK_CUR)
+#define io_seek(fptr, ofs, whence) fseeko(flush_before_seek(fptr)->f, ofs, whence)
+#define io_tell(fptr) ftello(flush_before_seek(fptr)->f)
#ifndef SEEK_CUR
# define SEEK_SET 0
@@ -375,79 +265,59 @@ flush_before_seek(rb_io_t *fptr)
#define FMODE_SYNCWRITE (FMODE_SYNC|FMODE_WRITABLE)
void
-rb_io_check_readable(rb_io_t *fptr)
+rb_io_check_readable(fptr)
+ rb_io_t *fptr;
{
rb_io_check_closed(fptr);
if (!(fptr->mode & FMODE_READABLE)) {
rb_raise(rb_eIOError, "not opened for reading");
}
- if (fptr->wbuf_len) {
- if (io_fflush(fptr) < 0)
- rb_sys_fail(0);
+#ifdef NEED_IO_SEEK_BETWEEN_RW
+ if (((fptr->mode & FMODE_WBUF) ||
+ (fptr->mode & (FMODE_SYNCWRITE|FMODE_RBUF)) == FMODE_SYNCWRITE) &&
+ !feof(fptr->f) &&
+ !fptr->f2) {
+ io_seek(fptr, 0, SEEK_CUR);
}
- if (fptr->tied_io_for_writing) {
- rb_io_t *wfptr;
- GetOpenFile(fptr->tied_io_for_writing, wfptr);
- if (io_fflush(wfptr) < 0)
- rb_sys_fail(0);
- }
-}
-
-static rb_encoding*
-io_read_encoding(rb_io_t *fptr)
-{
- if (fptr->encs.enc) {
- return fptr->encs.enc;
- }
- return rb_default_external_encoding();
-}
-
-static rb_encoding*
-io_input_encoding(rb_io_t *fptr)
-{
- if (fptr->encs.enc2) {
- return fptr->encs.enc2;
- }
- return io_read_encoding(fptr);
+#endif
+ fptr->mode |= FMODE_RBUF;
}
void
-rb_io_check_writable(rb_io_t *fptr)
+rb_io_check_writable(fptr)
+ rb_io_t *fptr;
{
rb_io_check_closed(fptr);
if (!(fptr->mode & FMODE_WRITABLE)) {
rb_raise(rb_eIOError, "not opened for writing");
}
- if (fptr->rbuf_len) {
- io_unread(fptr);
+ if ((fptr->mode & FMODE_RBUF) && !feof(fptr->f) && !fptr->f2) {
+ io_seek(fptr, 0, SEEK_CUR);
+ }
+ if (!fptr->f2) {
+ fptr->mode &= ~FMODE_RBUF;
}
}
int
-rb_io_read_pending(rb_io_t *fptr)
+rb_read_pending(fp)
+ FILE *fp;
{
- return READ_DATA_PENDING(fptr);
+ return READ_DATA_PENDING(fp);
}
void
-rb_read_check(FILE *fp)
+rb_read_check(fp)
+ FILE *fp;
{
- if (!STDIO_READ_DATA_PENDING(fp)) {
+ if (!READ_DATA_PENDING(fp)) {
rb_thread_wait_fd(fileno(fp));
}
}
-void
-rb_io_read_check(rb_io_t *fptr)
-{
- if (!READ_DATA_PENDING(fptr)) {
- rb_thread_wait_fd(fptr->fd);
- }
- return;
-}
-
static int
-ruby_dup(int orig)
+ruby_dup(orig)
+ int orig;
{
int fd;
@@ -464,8 +334,10 @@ ruby_dup(int orig)
return fd;
}
+static VALUE io_alloc _((VALUE));
static VALUE
-io_alloc(VALUE klass)
+io_alloc(klass)
+ VALUE klass;
{
NEWOBJ(io, struct RFile);
OBJSETUP(io, klass, T_FILE);
@@ -475,153 +347,33 @@ io_alloc(VALUE klass)
return (VALUE)io;
}
-#ifndef S_ISREG
-# define S_ISREG(m) ((m & S_IFMT) == S_IFREG)
-#endif
-
-static int
-wsplit_p(rb_io_t *fptr)
-{
-#if defined(HAVE_FCNTL) && defined(F_GETFL) && defined(O_NONBLOCK)
- int r;
-#endif
-
- if (!(fptr->mode & FMODE_WSPLIT_INITIALIZED)) {
- struct stat buf;
- if (fstat(fptr->fd, &buf) == 0 &&
- !S_ISREG(buf.st_mode)
-#if defined(HAVE_FCNTL) && defined(F_GETFL) && defined(O_NONBLOCK)
- && (r = fcntl(fptr->fd, F_GETFL)) != -1 &&
- !(r & O_NONBLOCK)
-#endif
- ) {
- fptr->mode |= FMODE_WSPLIT;
- }
- fptr->mode |= FMODE_WSPLIT_INITIALIZED;
- }
- return fptr->mode & FMODE_WSPLIT;
-}
-
-struct io_internal_struct {
- int fd;
- void *buf;
- size_t capa;
-};
-
-static VALUE
-internal_read_func(void *ptr)
-{
- struct io_internal_struct *iis = (struct io_internal_struct*)ptr;
- return read(iis->fd, iis->buf, iis->capa);
-}
-
-static VALUE
-internal_write_func(void *ptr)
-{
- struct io_internal_struct *iis = (struct io_internal_struct*)ptr;
- return write(iis->fd, iis->buf, iis->capa);
-}
-
-static ssize_t
-rb_read_internal(int fd, void *buf, size_t count)
-{
- struct io_internal_struct iis;
- iis.fd = fd;
- iis.buf = buf;
- iis.capa = count;
-
- return (ssize_t)rb_thread_blocking_region(internal_read_func, &iis, RUBY_UBF_IO, 0);
-}
-
-static ssize_t
-rb_write_internal(int fd, void *buf, size_t count)
-{
- struct io_internal_struct iis;
- iis.fd = fd;
- iis.buf = buf;
- iis.capa = count;
-
- return (ssize_t)rb_thread_blocking_region(internal_write_func, &iis, RUBY_UBF_IO, 0);
-}
-
-static long
-io_writable_length(rb_io_t *fptr, long l)
-{
- if (PIPE_BUF < l &&
- !rb_thread_alone() &&
- wsplit_p(fptr)) {
- l = PIPE_BUF;
- }
- return l;
-}
-
-static VALUE
-io_flush_buffer(VALUE arg)
-{
- rb_io_t *fptr = (rb_io_t *)arg;
- long l = io_writable_length(fptr, fptr->wbuf_len);
- return rb_write_internal(fptr->fd, fptr->wbuf+fptr->wbuf_off, l);
-}
-
-static int
-io_fflush(rb_io_t *fptr)
+static void
+io_fflush(f, fptr)
+ FILE *f;
+ rb_io_t *fptr;
{
- long r;
+ int n;
- rb_io_check_closed(fptr);
- if (fptr->wbuf_len == 0)
- return 0;
- if (!rb_thread_fd_writable(fptr->fd)) {
+ if (!rb_thread_fd_writable(fileno(f))) {
rb_io_check_closed(fptr);
}
- retry:
- if (fptr->wbuf_len == 0)
- return 0;
- if (fptr->write_lock) {
- r = rb_mutex_synchronize(fptr->write_lock, io_flush_buffer, (VALUE)fptr);
- }
- else {
- long l = io_writable_length(fptr, fptr->wbuf_len);
- r = rb_write_internal(fptr->fd, fptr->wbuf+fptr->wbuf_off, l);
- }
- /* xxx: Other threads may modify wbuf.
- * A lock is required, definitely. */
- rb_io_check_closed(fptr);
- if (fptr->wbuf_len <= r) {
- fptr->wbuf_off = 0;
- fptr->wbuf_len = 0;
- return 0;
- }
- if (0 <= r) {
- fptr->wbuf_off += (int)r;
- fptr->wbuf_len -= (int)r;
- errno = EAGAIN;
- }
- if (rb_io_wait_writable(fptr->fd)) {
- rb_io_check_closed(fptr);
- goto retry;
+ for (;;) {
+ TRAP_BEG;
+ n = fflush(f);
+ TRAP_END;
+ if (n != EOF) break;
+ if (!rb_io_wait_writable(fileno(f)))
+ rb_sys_fail(fptr->path);
}
- return -1;
-}
-
-#ifdef HAVE_RB_FD_INIT
-static VALUE
-wait_readable(VALUE p)
-{
- rb_fdset_t *rfds = (rb_fdset_t *)p;
-
- return rb_thread_select(rb_fd_max(rfds), rb_fd_ptr(rfds), NULL, NULL, NULL);
+ fptr->mode &= ~FMODE_WBUF;
}
-#endif
int
-rb_io_wait_readable(int f)
+rb_io_wait_readable(f)
+ int f;
{
- rb_fdset_t rfds;
+ fd_set rfds;
- if (f < 0) {
- rb_raise(rb_eIOError, "closed stream");
- }
switch (errno) {
case EINTR:
#if defined(ERESTART)
@@ -634,14 +386,9 @@ rb_io_wait_readable(int f)
#if defined(EWOULDBLOCK) && EWOULDBLOCK != EAGAIN
case EWOULDBLOCK:
#endif
- rb_fd_init(&rfds);
- rb_fd_set(f, &rfds);
-#ifdef HAVE_RB_FD_INIT
- rb_ensure(wait_readable, (VALUE)&rfds,
- (VALUE (*)(VALUE))rb_fd_term, (VALUE)&rfds);
-#else
- rb_thread_select(f + 1, rb_fd_ptr(&rfds), NULL, NULL, NULL);
-#endif
+ FD_ZERO(&rfds);
+ FD_SET(f, &rfds);
+ rb_thread_select(f + 1, &rfds, NULL, NULL, NULL);
return Qtrue;
default:
@@ -649,24 +396,12 @@ rb_io_wait_readable(int f)
}
}
-#ifdef HAVE_RB_FD_INIT
-static VALUE
-wait_writable(VALUE p)
-{
- rb_fdset_t *wfds = (rb_fdset_t *)p;
-
- return rb_thread_select(rb_fd_max(wfds), NULL, rb_fd_ptr(wfds), NULL, NULL);
-}
-#endif
-
int
-rb_io_wait_writable(int f)
+rb_io_wait_writable(f)
+ int f;
{
- rb_fdset_t wfds;
+ fd_set wfds;
- if (f < 0) {
- rb_raise(rb_eIOError, "closed stream");
- }
switch (errno) {
case EINTR:
#if defined(ERESTART)
@@ -679,14 +414,9 @@ rb_io_wait_writable(int f)
#if defined(EWOULDBLOCK) && EWOULDBLOCK != EAGAIN
case EWOULDBLOCK:
#endif
- rb_fd_init(&wfds);
- rb_fd_set(f, &wfds);
-#ifdef HAVE_RB_FD_INIT
- rb_ensure(wait_writable, (VALUE)&wfds,
- (VALUE (*)(VALUE))rb_fd_term, (VALUE)&wfds);
-#else
- rb_thread_select(f + 1, NULL, rb_fd_ptr(&wfds), NULL, NULL);
-#endif
+ FD_ZERO(&wfds);
+ FD_SET(f, &wfds);
+ rb_thread_select(f + 1, NULL, &wfds, NULL, NULL);
return Qtrue;
default:
@@ -694,263 +424,177 @@ rb_io_wait_writable(int f)
}
}
-#if defined(RUBY_TEST_CRLF_ENVIRONMENT) || defined(_WIN32)
-/* Windows */
-# define NEED_NEWLINE_DECORATOR_ON_READ(fptr) (!(fptr->mode & FMODE_BINMODE))
-# define NEED_NEWLINE_DECORATOR_ON_WRITE(fptr) (!(fptr->mode & FMODE_BINMODE))
-# define TEXTMODE_NEWLINE_DECORATOR_ON_WRITE ECONV_CRLF_NEWLINE_DECORATOR
-#else
-/* Unix */
-# define NEED_NEWLINE_DECORATOR_ON_READ(fptr) (fptr->mode & FMODE_TEXTMODE)
-# define NEED_NEWLINE_DECORATOR_ON_WRITE(fptr) 0
+#ifndef S_ISREG
+# define S_ISREG(m) ((m & S_IFMT) == S_IFREG)
#endif
-#define NEED_READCONV(fptr) (fptr->encs.enc2 != NULL || NEED_NEWLINE_DECORATOR_ON_READ(fptr))
-#define NEED_WRITECONV(fptr) ((fptr->encs.enc != NULL && fptr->encs.enc != rb_ascii8bit_encoding()) || NEED_NEWLINE_DECORATOR_ON_WRITE(fptr) || (fptr->encs.ecflags & (ECONV_DECORATOR_MASK|ECONV_STATEFUL_DECORATOR_MASK)))
-static void
-make_writeconv(rb_io_t *fptr)
+static int
+wsplit_p(rb_io_t *fptr)
{
- if (!fptr->writeconv_initialized) {
- const char *senc, *denc;
- rb_encoding *enc;
- int ecflags;
- VALUE ecopts;
-
- fptr->writeconv_initialized = 1;
-
- ecflags = fptr->encs.ecflags;
- ecopts = fptr->encs.ecopts;
-#ifdef TEXTMODE_NEWLINE_DECORATOR_ON_WRITE
- if (NEED_NEWLINE_DECORATOR_ON_WRITE(fptr))
- ecflags |= TEXTMODE_NEWLINE_DECORATOR_ON_WRITE;
+ FILE *f = GetWriteFile(fptr);
+#if defined(HAVE_FCNTL) && defined(F_GETFL) && defined(O_NONBLOCK)
+ int r;
#endif
- if (!fptr->encs.enc || (fptr->encs.enc == rb_ascii8bit_encoding() && !fptr->encs.enc2)) {
- /* no encoding conversion */
- fptr->writeconv_pre_ecflags = 0;
- fptr->writeconv_pre_ecopts = Qnil;
- fptr->writeconv = rb_econv_open_opts("", "", ecflags, ecopts);
- if (!fptr->writeconv)
- rb_exc_raise(rb_econv_open_exc("", "", ecflags));
- fptr->writeconv_asciicompat = Qnil;
- }
- else {
- enc = fptr->encs.enc2 ? fptr->encs.enc2 : fptr->encs.enc;
- senc = rb_econv_asciicompat_encoding(rb_enc_name(enc));
- if (!senc && !(fptr->encs.ecflags & ECONV_STATEFUL_DECORATOR_MASK)) {
- /* single conversion */
- fptr->writeconv_pre_ecflags = ecflags;
- fptr->writeconv_pre_ecopts = ecopts;
- fptr->writeconv = NULL;
- fptr->writeconv_asciicompat = Qnil;
- }
- else {
- /* double conversion */
- fptr->writeconv_pre_ecflags = ecflags & ~ECONV_STATEFUL_DECORATOR_MASK;
- fptr->writeconv_pre_ecopts = ecopts;
- if (senc) {
- denc = rb_enc_name(enc);
- fptr->writeconv_asciicompat = rb_str_new2(senc);
- }
- else {
- senc = denc = "";
- fptr->writeconv_asciicompat = rb_str_new2(rb_enc_name(enc));
- }
- ecflags = fptr->encs.ecflags & (ECONV_ERROR_HANDLER_MASK|ECONV_STATEFUL_DECORATOR_MASK);
- ecopts = fptr->encs.ecopts;
- fptr->writeconv = rb_econv_open_opts(senc, denc, ecflags, ecopts);
- if (!fptr->writeconv)
- rb_exc_raise(rb_econv_open_exc(senc, denc, ecflags));
- }
+ if (!(fptr->mode & FMODE_WSPLIT_INITIALIZED)) {
+ struct stat buf;
+ if (fstat(fileno(f), &buf) == 0 &&
+ !S_ISREG(buf.st_mode)
+#if defined(HAVE_FCNTL) && defined(F_GETFL) && defined(O_NONBLOCK)
+ && (r = fcntl(fileno(f), F_GETFL)) != -1 &&
+ !(r & O_NONBLOCK)
+#endif
+ ) {
+ fptr->mode |= FMODE_WSPLIT;
}
+ fptr->mode |= FMODE_WSPLIT_INITIALIZED;
}
+ return fptr->mode & FMODE_WSPLIT;
}
/* writing functions */
-struct binwrite_arg {
- rb_io_t *fptr;
- VALUE str;
- long offset;
- long length;
-};
-
-static VALUE
-io_binwrite_string(VALUE arg)
-{
- struct binwrite_arg *p = (struct binwrite_arg *)arg;
- long l = io_writable_length(p->fptr, p->length);
- return rb_write_internal(p->fptr->fd, RSTRING_PTR(p->str)+p->offset, l);
-}
-
static long
-io_binwrite(VALUE str, rb_io_t *fptr, int nosync)
+io_fwrite(str, fptr)
+ VALUE str;
+ rb_io_t *fptr;
{
- long len, n, r, offset = 0;
+ long len, n, r, l, offset = 0;
+ FILE *f = GetWriteFile(fptr);
- len = RSTRING_LEN(str);
+ len = RSTRING(str)->len;
if ((n = len) <= 0) return n;
- if (fptr->wbuf == NULL && !(!nosync && (fptr->mode & FMODE_SYNC))) {
- fptr->wbuf_off = 0;
- fptr->wbuf_len = 0;
- fptr->wbuf_capa = 8192;
- fptr->wbuf = ALLOC_N(char, fptr->wbuf_capa);
- fptr->write_lock = rb_mutex_new();
- }
- if ((!nosync && (fptr->mode & (FMODE_SYNC|FMODE_TTY))) ||
- (fptr->wbuf && fptr->wbuf_capa <= fptr->wbuf_len + len)) {
- struct binwrite_arg arg;
-
- /* xxx: use writev to avoid double write if available */
- if (fptr->wbuf_len && fptr->wbuf_len+len <= fptr->wbuf_capa) {
- if (fptr->wbuf_capa < fptr->wbuf_off+fptr->wbuf_len+len) {
- MEMMOVE(fptr->wbuf, fptr->wbuf+fptr->wbuf_off, char, fptr->wbuf_len);
- fptr->wbuf_off = 0;
- }
- MEMMOVE(fptr->wbuf+fptr->wbuf_off+fptr->wbuf_len, RSTRING_PTR(str)+offset, char, len);
- fptr->wbuf_len += (int)len;
- n = 0;
- }
- if (io_fflush(fptr) < 0)
- return -1L;
- if (n == 0)
- return len;
- /* avoid context switch between "a" and "\n" in STDERR.puts "a".
- [ruby-dev:25080] */
- if (fptr->stdio_file != stderr && !rb_thread_fd_writable(fptr->fd)) {
+ if (fptr->mode & FMODE_SYNC) {
+ io_fflush(f, fptr);
+ if (!rb_thread_fd_writable(fileno(f))) {
rb_io_check_closed(fptr);
}
- arg.fptr = fptr;
- arg.str = str;
retry:
- arg.offset = offset;
- arg.length = n;
- if (fptr->write_lock) {
- r = rb_mutex_synchronize(fptr->write_lock, io_binwrite_string, (VALUE)&arg);
- }
- else {
- long l = io_writable_length(fptr, n);
- r = rb_write_internal(fptr->fd, RSTRING_PTR(str)+offset, l);
- }
- /* xxx: other threads may modify given string. */
+ l = n;
+ if (PIPE_BUF < l &&
+ !rb_thread_critical &&
+ !rb_thread_alone() &&
+ wsplit_p(fptr)) {
+ l = PIPE_BUF;
+ }
+ TRAP_BEG;
+ r = write(fileno(f), RSTRING(str)->ptr+offset, l);
+ TRAP_END;
if (r == n) return len;
if (0 <= r) {
offset += r;
n -= r;
errno = EAGAIN;
}
- if (rb_io_wait_writable(fptr->fd)) {
+ if (rb_io_wait_writable(fileno(f))) {
rb_io_check_closed(fptr);
- if (offset < RSTRING_LEN(str))
+ if (offset < RSTRING(str)->len)
goto retry;
}
return -1L;
}
-
- if (fptr->wbuf_off) {
- if (fptr->wbuf_len)
- MEMMOVE(fptr->wbuf, fptr->wbuf+fptr->wbuf_off, char, fptr->wbuf_len);
- fptr->wbuf_off = 0;
- }
- MEMMOVE(fptr->wbuf+fptr->wbuf_off+fptr->wbuf_len, RSTRING_PTR(str)+offset, char, len);
- fptr->wbuf_len += (int)len;
- return len;
-}
-
-static VALUE
-do_writeconv(VALUE str, rb_io_t *fptr)
-{
- if (NEED_WRITECONV(fptr)) {
- VALUE common_encoding = Qnil;
-
- make_writeconv(fptr);
-
- if (fptr->writeconv) {
- if (!NIL_P(fptr->writeconv_asciicompat))
- common_encoding = fptr->writeconv_asciicompat;
- else if (!rb_enc_asciicompat(rb_enc_get(str))) {
- rb_raise(rb_eArgError, "ASCII incompatible string written for text mode IO without encoding conversion: %s",
- rb_enc_name(rb_enc_get(str)));
- }
- }
- else {
- if (fptr->encs.enc2)
- common_encoding = rb_enc_from_encoding(fptr->encs.enc2);
- else if (fptr->encs.enc != rb_ascii8bit_encoding())
- common_encoding = rb_enc_from_encoding(fptr->encs.enc);
- }
-
- if (!NIL_P(common_encoding)) {
- str = rb_str_encode(str, common_encoding,
- fptr->writeconv_pre_ecflags, fptr->writeconv_pre_ecopts);
- }
-
- if (fptr->writeconv) {
- str = rb_econv_str_convert(fptr->writeconv, str, ECONV_PARTIAL_INPUT);
- }
+#if defined(__human68k__) || defined(__vms)
+ do {
+ if (fputc(RSTRING(str)->ptr[offset++], f) == EOF) {
+ if (ferror(f)) return -1L;
+ break;
+ }
+ } while (--n > 0);
+#else
+ while (errno = 0, offset += (r = fwrite(RSTRING(str)->ptr+offset, 1, n, f)), (n -= r) > 0) {
+ if (ferror(f)
+#if defined __BORLANDC__
+ || errno
+#endif
+ ) {
+#ifdef __hpux
+ if (!errno) errno = EAGAIN;
+#elif defined(_WIN32) && !defined(__BORLANDC__)
+ /* workaround for MSVCRT's bug */
+ if (!errno) {
+ if (GetLastError() == ERROR_NO_DATA)
+ errno = EPIPE;
+ else
+ errno = EBADF;
+ }
+#endif
+ if (rb_io_wait_writable(fileno(f))) {
+ rb_io_check_closed(fptr);
+ clearerr(f);
+ if (offset < RSTRING(str)->len)
+ continue;
+ }
+ return -1L;
+ }
}
- return str;
-}
-
-static long
-io_fwrite(VALUE str, rb_io_t *fptr, int nosync)
-{
- str = do_writeconv(str, fptr);
- return io_binwrite(str, fptr, nosync);
+#endif
+ return len - n;
}
-static VALUE
-io_write(VALUE io, VALUE str, int nosync)
+long
+rb_io_fwrite(ptr, len, f)
+ const char *ptr;
+ long len;
+ FILE *f;
{
- rb_io_t *fptr;
- long n;
- VALUE tmp;
-
- rb_secure(4);
- io = GetWriteIO(io);
- str = rb_obj_as_string(str);
- tmp = rb_io_check_io(io);
- if (NIL_P(tmp)) {
- /* port is not IO, call write method for it. */
- return rb_funcall(io, id_write, 1, str);
- }
- io = tmp;
- if (RSTRING_LEN(str) == 0) return INT2FIX(0);
+ rb_io_t of;
- GetOpenFile(io, fptr);
- rb_io_check_writable(fptr);
-
- n = io_fwrite(str, fptr, nosync);
- if (n == -1L) rb_sys_fail_path(fptr->pathv);
-
- return LONG2FIX(n);
+ of.f = f;
+ of.f2 = NULL;
+ of.mode = FMODE_WRITABLE;
+ of.path = NULL;
+ return io_fwrite(rb_str_new(ptr, len), &of);
}
/*
* call-seq:
* ios.write(string) => integer
- *
+ *
* 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.
- *
+ *
* count = $stdout.write( "This is a test\n" )
* puts "That was #{count} bytes of data"
- *
+ *
* <em>produces:</em>
- *
+ *
* This is a test
* That was 15 bytes of data
*/
static VALUE
-io_write_m(VALUE io, VALUE str)
+io_write(io, str)
+ VALUE io, str;
{
- return io_write(io, str, 0);
+ rb_io_t *fptr;
+ long n;
+
+ rb_secure(4);
+ if (TYPE(str) != T_STRING)
+ str = rb_obj_as_string(str);
+
+ if (TYPE(io) != T_FILE) {
+ /* port is not IO, call write method for it. */
+ return rb_funcall(io, id_write, 1, str);
+ }
+ if (RSTRING(str)->len == 0) return INT2FIX(0);
+
+ GetOpenFile(io, fptr);
+ rb_io_check_writable(fptr);
+
+ n = io_fwrite(str, fptr);
+ if (n == -1L) rb_sys_fail(fptr->path);
+ if (!(fptr->mode & FMODE_SYNC)) {
+ fptr->mode |= FMODE_WBUF;
+ }
+
+ return LONG2FIX(n);
}
VALUE
-rb_io_write(VALUE io, VALUE str)
+rb_io_write(io, str)
+ VALUE io, str;
{
return rb_funcall(io, id_write, 1, str);
}
@@ -958,21 +602,21 @@ rb_io_write(VALUE io, VALUE str)
/*
* call-seq:
* ios << obj => ios
- *
+ *
* String Output---Writes <i>obj</i> to <em>ios</em>.
* <i>obj</i> will be converted to a string using
* <code>to_s</code>.
- *
+ *
* $stdout << "Hello " << "world!\n"
- *
+ *
* <em>produces:</em>
- *
+ *
* Hello world!
*/
-
VALUE
-rb_io_addstr(VALUE io, VALUE str)
+rb_io_addstr(io, str)
+ VALUE io, str;
{
rb_io_write(io, str);
return io;
@@ -981,41 +625,31 @@ rb_io_addstr(VALUE io, VALUE str)
/*
* call-seq:
* ios.flush => ios
- *
+ *
* Flushes any buffered data within <em>ios</em> to the underlying
* operating system (note that this is Ruby internal buffering only;
* the OS may buffer the data as well).
- *
+ *
* $stdout.print "no newline"
* $stdout.flush
- *
+ *
* <em>produces:</em>
- *
+ *
* no newline
*/
-VALUE
-rb_io_flush(VALUE io)
+static VALUE
+rb_io_flush(io)
+ VALUE io;
{
rb_io_t *fptr;
+ FILE *f;
- if (TYPE(io) != T_FILE) {
- return rb_funcall(io, id_flush, 0);
- }
-
- io = GetWriteIO(io);
GetOpenFile(io, fptr);
+ rb_io_check_writable(fptr);
+ f = GetWriteFile(fptr);
- if (fptr->mode & FMODE_WRITABLE) {
- if (io_fflush(fptr) < 0)
- rb_sys_fail(0);
-#ifdef _WIN32
- fsync(fptr->fd);
-#endif
- }
- if (fptr->mode & FMODE_READABLE) {
- io_unread(fptr);
- }
+ io_fflush(f, fptr);
return io;
}
@@ -1024,9 +658,9 @@ rb_io_flush(VALUE io)
* call-seq:
* ios.pos => integer
* ios.tell => integer
- *
+ *
* Returns the current offset (in bytes) of <em>ios</em>.
- *
+ *
* f = File.new("testfile")
* f.pos #=> 0
* f.gets #=> "This is line one\n"
@@ -1034,19 +668,22 @@ rb_io_flush(VALUE io)
*/
static VALUE
-rb_io_tell(VALUE io)
+rb_io_tell(io)
+ VALUE io;
{
rb_io_t *fptr;
off_t pos;
GetOpenFile(io, fptr);
pos = io_tell(fptr);
- if (pos < 0 && errno) rb_sys_fail_path(fptr->pathv);
+ if (pos < 0 && errno) rb_sys_fail(fptr->path);
return OFFT2NUM(pos);
}
static VALUE
-rb_io_seek(VALUE io, VALUE offset, int whence)
+rb_io_seek(io, offset, whence)
+ VALUE io, offset;
+ int whence;
{
rb_io_t *fptr;
off_t pos;
@@ -1054,7 +691,8 @@ rb_io_seek(VALUE io, VALUE offset, int whence)
pos = NUM2OFFT(offset);
GetOpenFile(io, fptr);
pos = io_seek(fptr, pos, whence);
- if (pos < 0 && errno) rb_sys_fail_path(fptr->pathv);
+ if (pos < 0 && errno) rb_sys_fail(fptr->path);
+ clearerr(fptr->f);
return INT2FIX(0);
}
@@ -1062,26 +700,29 @@ rb_io_seek(VALUE io, VALUE offset, int whence)
/*
* call-seq:
* ios.seek(amount, whence=SEEK_SET) -> 0
- *
+ *
* Seeks to a given offset <i>anInteger</i> in the stream according to
* the value of <i>whence</i>:
*
* IO::SEEK_CUR | Seeks to _amount_ plus current position
* --------------+----------------------------------------------------
- * IO::SEEK_END | Seeks to _amount_ plus end of stream (you probably
+ * IO::SEEK_END | Seeks to _amount_ plus end of stream (you probably
* | want a negative value for _amount_)
* --------------+----------------------------------------------------
* IO::SEEK_SET | Seeks to the absolute location given by _amount_
*
* Example:
- *
+ *
* f = File.new("testfile")
* f.seek(-13, IO::SEEK_END) #=> 0
* f.readline #=> "And so on...\n"
*/
static VALUE
-rb_io_seek_m(int argc, VALUE *argv, VALUE io)
+rb_io_seek_m(argc, argv, io)
+ int argc;
+ VALUE *argv;
+ VALUE io;
{
VALUE offset, ptrname;
int whence = SEEK_SET;
@@ -1096,16 +737,17 @@ rb_io_seek_m(int argc, VALUE *argv, VALUE io)
/*
* call-seq:
* ios.pos = integer => integer
- *
+ *
* Seeks to the given position (in bytes) in <em>ios</em>.
- *
+ *
* f = File.new("testfile")
* f.pos = 17
* f.gets #=> "This is line two\n"
*/
static VALUE
-rb_io_set_pos(VALUE io, VALUE offset)
+rb_io_set_pos(io, offset)
+ VALUE io, offset;
{
rb_io_t *fptr;
off_t pos;
@@ -1113,20 +755,19 @@ rb_io_set_pos(VALUE io, VALUE offset)
pos = NUM2OFFT(offset);
GetOpenFile(io, fptr);
pos = io_seek(fptr, pos, SEEK_SET);
- if (pos < 0) rb_sys_fail_path(fptr->pathv);
+ if (pos != 0) rb_sys_fail(fptr->path);
+ clearerr(fptr->f);
return OFFT2NUM(pos);
}
-static void clear_readconv(rb_io_t *fptr);
-
/*
* call-seq:
* ios.rewind => 0
- *
+ *
* Positions <em>ios</em> to the beginning of input, resetting
* <code>lineno</code> to zero.
- *
+ *
* f = File.new("testfile")
* f.readline #=> "This is line one\n"
* f.rewind #=> 0
@@ -1135,57 +776,22 @@ static void clear_readconv(rb_io_t *fptr);
*/
static VALUE
-rb_io_rewind(VALUE io)
+rb_io_rewind(io)
+ VALUE io;
{
rb_io_t *fptr;
GetOpenFile(io, fptr);
- if (io_seek(fptr, 0L, 0) < 0) rb_sys_fail_path(fptr->pathv);
- if (io == ARGF.current_file) {
- ARGF.lineno -= fptr->lineno;
+ if (io_seek(fptr, 0L, 0) != 0) rb_sys_fail(fptr->path);
+ clearerr(fptr->f);
+ if (io == current_file) {
+ gets_lineno -= fptr->lineno;
}
fptr->lineno = 0;
- if (fptr->readconv) {
- clear_readconv(fptr);
- }
return INT2FIX(0);
}
-static int
-io_fillbuf(rb_io_t *fptr)
-{
- ssize_t r;
-
- if (fptr->mode & FMODE_EOF) {
- return -1;
- }
- if (fptr->rbuf == NULL) {
- fptr->rbuf_off = 0;
- fptr->rbuf_len = 0;
- fptr->rbuf_capa = 8192;
- fptr->rbuf = ALLOC_N(char, fptr->rbuf_capa);
- }
- if (fptr->rbuf_len == 0) {
- retry:
- {
- r = rb_read_internal(fptr->fd, fptr->rbuf, fptr->rbuf_capa);
- }
- if (r < 0) {
- if (rb_io_wait_readable(fptr->fd))
- goto retry;
- rb_sys_fail_path(fptr->pathv);
- }
- fptr->rbuf_off = 0;
- fptr->rbuf_len = (int)r; /* r should be <= rbuf_capa */
- if (r == 0) {
- io_set_eof(fptr);
- return -1; /* EOF */
- }
- }
- return 0;
-}
-
/*
* call-seq:
* ios.eof => true or false
@@ -1219,40 +825,51 @@ io_fillbuf(rb_io_t *fptr)
*/
VALUE
-rb_io_eof(VALUE io)
+rb_io_eof(io)
+ VALUE io;
{
rb_io_t *fptr;
+ int ch;
GetOpenFile(io, fptr);
rb_io_check_readable(fptr);
- if (READ_DATA_PENDING(fptr)) return Qfalse;
- READ_CHECK(fptr);
- if (io_fillbuf(fptr) < 0) {
- return Qtrue;
+ if (feof(fptr->f)) return Qtrue;
+ if (READ_DATA_PENDING(fptr->f)) return Qfalse;
+ READ_CHECK(fptr->f);
+ clearerr(fptr->f);
+ TRAP_BEG;
+ ch = getc(fptr->f);
+ TRAP_END;
+
+ if (ch != EOF) {
+ ungetc(ch, fptr->f);
+ return Qfalse;
}
- return Qfalse;
+ rb_io_check_closed(fptr);
+ clearerr(fptr->f);
+ return Qtrue;
}
/*
* call-seq:
* ios.sync => true or false
- *
+ *
* 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
* <code>IO#fsync</code>.
- *
+ *
* f = File.new("testfile")
* f.sync #=> false
*/
static VALUE
-rb_io_sync(VALUE io)
+rb_io_sync(io)
+ VALUE io;
{
rb_io_t *fptr;
- io = GetWriteIO(io);
GetOpenFile(io, fptr);
return (fptr->mode & FMODE_SYNC) ? Qtrue : Qfalse;
}
@@ -1260,152 +877,123 @@ rb_io_sync(VALUE io)
/*
* call-seq:
* ios.sync = boolean => boolean
- *
+ *
* 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 <code>IO#fsync</code>.
- *
+ *
* f = File.new("testfile")
* f.sync = true
- *
+ *
* <em>(produces no output)</em>
*/
static VALUE
-rb_io_set_sync(VALUE io, VALUE sync)
+rb_io_set_sync(io, mode)
+ VALUE io, mode;
{
rb_io_t *fptr;
- io = GetWriteIO(io);
GetOpenFile(io, fptr);
- if (RTEST(sync)) {
+ if (RTEST(mode)) {
fptr->mode |= FMODE_SYNC;
}
else {
fptr->mode &= ~FMODE_SYNC;
}
- return sync;
+ return mode;
}
-#ifdef HAVE_FSYNC
/*
* call-seq:
* ios.fsync => 0 or nil
- *
+ *
* Immediately writes all buffered data in <em>ios</em> to disk.
- * Note that <code>fsync</code> differs from
+ * Returns <code>nil</code> if the underlying operating system does not
+ * support <em>fsync(2)</em>. Note that <code>fsync</code> differs from
* using <code>IO#sync=</code>. The latter ensures that data is flushed
* from Ruby's buffers, but doesn't not guarantee that the underlying
* operating system actually writes it to disk.
- *
- * <code>NotImplementedError</code> is raised
- * if the underlying operating system does not support <em>fsync(2)</em>.
*/
static VALUE
-rb_io_fsync(VALUE io)
+rb_io_fsync(io)
+ VALUE io;
{
+#ifdef HAVE_FSYNC
rb_io_t *fptr;
+ FILE *f;
- io = GetWriteIO(io);
GetOpenFile(io, fptr);
+ f = GetWriteFile(fptr);
- if (io_fflush(fptr) < 0)
- rb_sys_fail(0);
- if (fsync(fptr->fd) < 0)
- rb_sys_fail_path(fptr->pathv);
+ io_fflush(f, fptr);
+ if (fsync(fileno(f)) < 0)
+ rb_sys_fail(fptr->path);
return INT2FIX(0);
-}
#else
-#define rb_io_fsync rb_f_notimplement
+ rb_notimplement();
+ return Qnil; /* not reached */
#endif
-
-#ifdef HAVE_FDATASYNC
-/*
- * call-seq:
- * ios.fdatasync => 0 or nil
- *
- * Immediately writes all buffered data in <em>ios</em> to disk.
- *
- * <code>NotImplementedError</code> is raised
- * if the underlying operating system does not support <em>fdatasync(2)</em>.
- */
-
-static VALUE
-rb_io_fdatasync(VALUE io)
-{
- rb_io_t *fptr;
-
- io = GetWriteIO(io);
- GetOpenFile(io, fptr);
-
- if (io_fflush(fptr) < 0)
- rb_sys_fail(0);
- if (fdatasync(fptr->fd) < 0)
- rb_sys_fail_path(fptr->pathv);
- return INT2FIX(0);
}
-#else
-#define rb_io_fdatasync rb_f_notimplement
-#endif
/*
* call-seq:
* ios.fileno => fixnum
* ios.to_i => fixnum
- *
+ *
* Returns an integer representing the numeric file descriptor for
* <em>ios</em>.
- *
+ *
* $stdin.fileno #=> 0
* $stdout.fileno #=> 1
*/
static VALUE
-rb_io_fileno(VALUE io)
+rb_io_fileno(io)
+ VALUE io;
{
rb_io_t *fptr;
int fd;
GetOpenFile(io, fptr);
- fd = fptr->fd;
+ fd = fileno(fptr->f);
return INT2FIX(fd);
}
-
/*
* call-seq:
* ios.pid => fixnum
- *
+ *
* Returns the process ID of a child process associated with
- * <em>ios</em>. This will be set by <code>IO.popen</code>.
- *
+ * <em>ios</em>. This will be set by <code>IO::popen</code>.
+ *
* pipe = IO.popen("-")
* if pipe
* $stderr.puts "In parent, child pid is #{pipe.pid}"
* else
* $stderr.puts "In child, pid is #{$$}"
* end
- *
+ *
* <em>produces:</em>
- *
+ *
* In child, pid is 26209
* In parent, child pid is 26209
*/
static VALUE
-rb_io_pid(VALUE io)
+rb_io_pid(io)
+ VALUE io;
{
rb_io_t *fptr;
GetOpenFile(io, fptr);
if (!fptr->pid)
return Qnil;
- return PIDT2NUM(fptr->pid);
+ return INT2FIX(fptr->pid);
}
-
/*
* call-seq:
* ios.inspect => string
@@ -1414,292 +1002,168 @@ rb_io_pid(VALUE io)
*/
static VALUE
-rb_io_inspect(VALUE obj)
+rb_io_inspect(obj)
+ VALUE obj;
{
rb_io_t *fptr;
- const char *cname;
- char fd_desc[256];
- const char *path;
- const char *st = "";
+ char *buf;
+ const char *cname, *st = "";
+ long len;
fptr = RFILE(rb_io_taint_check(obj))->fptr;
- if (!fptr) return rb_any_to_s(obj);
+ if (!fptr || !fptr->path) return rb_any_to_s(obj);
cname = rb_obj_classname(obj);
- if (NIL_P(fptr->pathv)) {
- if (fptr->fd < 0) {
- path = "";
- st = "(closed)";
- }
- else {
- snprintf(fd_desc, sizeof(fd_desc), "fd %d", fptr->fd);
- path = fd_desc;
- }
+ len = strlen(cname) + strlen(fptr->path) + 5;
+ if (!(fptr->f || fptr->f2)) {
+ st = " (closed)";
+ len += 9;
}
- else {
- path = RSTRING_PTR(fptr->pathv);
- if (fptr->fd < 0) {
- st = " (closed)";
- }
- }
- return rb_sprintf("#<%s:%s%s>", cname, path, st);
+ buf = ALLOCA_N(char, len);
+ snprintf(buf, len, "#<%s:%s%s>", cname, fptr->path, st);
+ return rb_str_new2(buf);
}
/*
* call-seq:
* ios.to_io -> ios
- *
+ *
* Returns <em>ios</em>.
*/
static VALUE
-rb_io_to_io(VALUE io)
+rb_io_to_io(io)
+ VALUE io;
{
return io;
}
/* reading functions */
static long
-read_buffered_data(char *ptr, long len, rb_io_t *fptr)
+read_buffered_data(ptr, len, f)
+ char *ptr;
+ long len;
+ FILE *f;
{
- int n;
+ long n;
- n = READ_DATA_PENDING_COUNT(fptr);
+#ifdef READ_DATA_PENDING_COUNT
+ n = READ_DATA_PENDING_COUNT(f);
if (n <= 0) return 0;
- if (n > len) n = (int)len;
- MEMMOVE(ptr, fptr->rbuf+fptr->rbuf_off, char, n);
- fptr->rbuf_off += n;
- fptr->rbuf_len -= n;
+ if (n > len) n = len;
+ return fread(ptr, 1, n, f);
+#else
+ int c;
+
+ for (n = 0; n < len && READ_DATA_PENDING(f) && (c = getc(f)) != EOF; ++n) {
+ *ptr++ = c;
+ }
return n;
+#endif
}
static long
-io_fread(VALUE str, long offset, rb_io_t *fptr)
+io_fread(ptr, len, fptr)
+ char *ptr;
+ long len;
+ rb_io_t *fptr;
{
- long len = RSTRING_LEN(str) - offset;
long n = len;
- long c;
-
- if (READ_DATA_PENDING(fptr) == 0) {
- while (n > 0) {
- again:
- c = rb_read_internal(fptr->fd, RSTRING_PTR(str)+offset, n);
- if (c == 0) {
- io_set_eof(fptr);
- break;
- }
- if (c < 0) {
- if (rb_io_wait_readable(fptr->fd))
- goto again;
- rb_sys_fail_path(fptr->pathv);
- }
- offset += c;
- if ((n -= c) <= 0) break;
- rb_thread_wait_fd(fptr->fd);
- }
- return len - n;
- }
+ int c;
+ int saved_errno;
while (n > 0) {
- c = read_buffered_data(RSTRING_PTR(str)+offset, n, fptr);
- if (c > 0) {
- offset += c;
- if ((n -= c) <= 0) break;
- }
- rb_thread_wait_fd(fptr->fd);
- rb_io_check_closed(fptr);
- if (io_fillbuf(fptr) < 0) {
+ c = read_buffered_data(ptr, n, fptr->f);
+ if (c < 0) goto eof;
+ if (c > 0) {
+ ptr += c;
+ if ((n -= c) <= 0) break;
+ }
+ rb_thread_wait_fd(fileno(fptr->f));
+ rb_io_check_closed(fptr);
+ clearerr(fptr->f);
+ TRAP_BEG;
+ c = getc(fptr->f);
+ TRAP_END;
+ if (c == EOF) {
+ eof:
+ if (ferror(fptr->f)) {
+ switch (errno) {
+ case EINTR:
+#if defined(ERESTART)
+ case ERESTART:
+#endif
+ clearerr(fptr->f);
+ continue;
+ case EAGAIN:
+#if defined(EWOULDBLOCK) && EWOULDBLOCK != EAGAIN
+ case EWOULDBLOCK:
+#endif
+ if (len > n) {
+ clearerr(fptr->f);
+ }
+ saved_errno = errno;
+ rb_warning("nonblocking IO#read is obsolete; use IO#readpartial or IO#sysread");
+ errno = saved_errno;
+ }
+ if (len == n) return 0;
+ }
break;
}
+ *ptr++ = c;
+ n--;
}
return len - n;
}
+long
+rb_io_fread(ptr, len, f)
+ char *ptr;
+ long len;
+ FILE *f;
+{
+ rb_io_t of;
+
+ of.f = f;
+ of.f2 = NULL;
+ return io_fread(ptr, len, &of);
+}
+
#define SMALLBUF 100
static long
-remain_size(rb_io_t *fptr)
+remain_size(fptr)
+ rb_io_t *fptr;
{
struct stat st;
- off_t siz = READ_DATA_PENDING_COUNT(fptr);
+ off_t siz = BUFSIZ;
off_t pos;
- if (fstat(fptr->fd, &st) == 0 && S_ISREG(st.st_mode)
+ if (feof(fptr->f)) return 0;
+ if (fstat(fileno(fptr->f), &st) == 0 && S_ISREG(st.st_mode)
#ifdef __BEOS__
&& (st.st_dev > 3)
#endif
)
{
- if (io_fflush(fptr) < 0)
- rb_sys_fail(0);
- pos = lseek(fptr->fd, 0, SEEK_CUR);
+ pos = io_tell(fptr);
if (st.st_size >= pos && pos >= 0) {
- siz += st.st_size - pos;
+ siz = st.st_size - pos + 1;
if (siz > LONG_MAX) {
rb_raise(rb_eIOError, "file too big for single read");
}
}
}
- else {
- siz += BUFSIZ;
- }
return (long)siz;
}
static VALUE
-io_enc_str(VALUE str, rb_io_t *fptr)
-{
- OBJ_TAINT(str);
- rb_enc_associate(str, io_read_encoding(fptr));
- return str;
-}
-
-static void
-make_readconv(rb_io_t *fptr, int size)
-{
- if (!fptr->readconv) {
- int ecflags;
- VALUE ecopts;
- const char *sname, *dname;
- ecflags = fptr->encs.ecflags;
- ecopts = fptr->encs.ecopts;
- if (NEED_NEWLINE_DECORATOR_ON_READ(fptr))
- ecflags |= ECONV_UNIVERSAL_NEWLINE_DECORATOR;
- if (fptr->encs.enc2) {
- sname = rb_enc_name(fptr->encs.enc2);
- dname = rb_enc_name(fptr->encs.enc);
- }
- else {
- sname = dname = "";
- }
- fptr->readconv = rb_econv_open_opts(sname, dname, ecflags, ecopts);
- if (!fptr->readconv)
- rb_exc_raise(rb_econv_open_exc(sname, dname, ecflags));
- fptr->cbuf_off = 0;
- fptr->cbuf_len = 0;
- fptr->cbuf_capa = size < 1024 ? 1024 : size;
- fptr->cbuf = ALLOC_N(char, fptr->cbuf_capa);
- }
-}
-
-static int
-more_char(rb_io_t *fptr)
-{
- const unsigned char *ss, *sp, *se;
- unsigned char *ds, *dp, *de;
- rb_econv_result_t res;
- int putbackable;
- int cbuf_len0;
-
- if (fptr->cbuf_len == fptr->cbuf_capa)
- return 0; /* cbuf full */
- if (fptr->cbuf_len == 0)
- fptr->cbuf_off = 0;
- else if (fptr->cbuf_off + fptr->cbuf_len == fptr->cbuf_capa) {
- memmove(fptr->cbuf, fptr->cbuf+fptr->cbuf_off, fptr->cbuf_len);
- fptr->cbuf_off = 0;
- }
-
- cbuf_len0 = fptr->cbuf_len;
-
- while (1) {
- ss = sp = (const unsigned char *)fptr->rbuf + fptr->rbuf_off;
- se = sp + fptr->rbuf_len;
- ds = dp = (unsigned char *)fptr->cbuf + fptr->cbuf_off + fptr->cbuf_len;
- de = (unsigned char *)fptr->cbuf + fptr->cbuf_capa;
- res = rb_econv_convert(fptr->readconv, &sp, se, &dp, de, ECONV_PARTIAL_INPUT|ECONV_AFTER_OUTPUT);
- fptr->rbuf_off += (int)(sp - ss);
- fptr->rbuf_len -= (int)(sp - ss);
- fptr->cbuf_len += (int)(dp - ds);
-
- putbackable = rb_econv_putbackable(fptr->readconv);
- if (putbackable) {
- rb_econv_putback(fptr->readconv, (unsigned char *)fptr->rbuf + fptr->rbuf_off - putbackable, putbackable);
- fptr->rbuf_off -= putbackable;
- fptr->rbuf_len += putbackable;
- }
-
- rb_econv_check_error(fptr->readconv);
-
- if (cbuf_len0 != fptr->cbuf_len)
- return 0;
-
- if (res == econv_finished) {
- clear_readconv(fptr);
- return -1;
- }
-
- if (res == econv_source_buffer_empty) {
- if (fptr->rbuf_len == 0) {
- rb_thread_wait_fd(fptr->fd);
- rb_io_check_closed(fptr);
- if (io_fillbuf(fptr) == -1) {
- ds = dp = (unsigned char *)fptr->cbuf + fptr->cbuf_off + fptr->cbuf_len;
- de = (unsigned char *)fptr->cbuf + fptr->cbuf_capa;
- res = rb_econv_convert(fptr->readconv, NULL, NULL, &dp, de, 0);
- fptr->cbuf_len += (int)(dp - ds);
- rb_econv_check_error(fptr->readconv);
- }
- }
- }
- }
-}
-
-static VALUE
-io_shift_cbuf(rb_io_t *fptr, int len, VALUE *strp)
-{
+read_all(fptr, siz, str)
+ rb_io_t *fptr;
+ long siz;
VALUE str;
- if (NIL_P(*strp)) {
- *strp = str = rb_str_new(fptr->cbuf+fptr->cbuf_off, len);
- }
- else {
- size_t slen;
- str = *strp;
- slen = RSTRING_LEN(str);
- rb_str_resize(str, RSTRING_LEN(str) + len);
- memcpy(RSTRING_PTR(str)+slen, fptr->cbuf+fptr->cbuf_off, len);
- }
- fptr->cbuf_off += len;
- fptr->cbuf_len -= len;
- OBJ_TAINT(str);
- rb_enc_associate(str, fptr->encs.enc);
- /* xxx: set coderange */
- if (fptr->cbuf_len == 0)
- fptr->cbuf_off = 0;
- if (fptr->cbuf_off < fptr->cbuf_capa/2) {
- memmove(fptr->cbuf, fptr->cbuf+fptr->cbuf_off, fptr->cbuf_len);
- fptr->cbuf_off = 0;
- }
- return str;
-}
-
-static VALUE
-read_all(rb_io_t *fptr, long siz, VALUE str)
{
- long bytes;
+ long bytes = 0;
long n;
- long pos;
- rb_encoding *enc;
- int cr;
-
- if (NEED_READCONV(fptr)) {
- if (NIL_P(str)) str = rb_str_new(NULL, 0);
- else rb_str_set_len(str, 0);
- make_readconv(fptr, 0);
- while (1) {
- if (fptr->cbuf_len) {
- io_shift_cbuf(fptr, fptr->cbuf_len, &str);
- }
- if (more_char(fptr) == -1) {
- return io_enc_str(str, fptr);
- }
- }
- }
-
- bytes = 0;
- pos = 0;
-
- enc = io_read_encoding(fptr);
- cr = 0;
if (siz == 0) siz = BUFSIZ;
if (NIL_P(str)) {
@@ -1709,40 +1173,58 @@ read_all(rb_io_t *fptr, long siz, VALUE str)
rb_str_resize(str, siz);
}
for (;;) {
- READ_CHECK(fptr);
- n = io_fread(str, bytes, fptr);
+ rb_str_locktmp(str);
+ READ_CHECK(fptr->f);
+ n = io_fread(RSTRING(str)->ptr+bytes, siz-bytes, fptr);
+ rb_str_unlocktmp(str);
if (n == 0 && bytes == 0) {
- break;
+ if (!fptr->f) break;
+ if (feof(fptr->f)) break;
+ if (!ferror(fptr->f)) break;
+ rb_sys_fail(fptr->path);
}
bytes += n;
- if (cr != ENC_CODERANGE_BROKEN)
- pos = rb_str_coderange_scan_restartable(RSTRING_PTR(str) + pos, RSTRING_PTR(str) + bytes, enc, &cr);
if (bytes < siz) break;
siz += BUFSIZ;
rb_str_resize(str, siz);
}
if (bytes != siz) rb_str_resize(str, bytes);
- str = io_enc_str(str, fptr);
- ENC_CODERANGE_SET(str, cr);
+ OBJ_TAINT(str);
+
return str;
}
-void
-rb_io_set_nonblock(rb_io_t *fptr)
+void rb_io_set_nonblock(rb_io_t *fptr)
{
- int oflags;
+ int flags;
#ifdef F_GETFL
- oflags = fcntl(fptr->fd, F_GETFL);
- if (oflags == -1) {
- rb_sys_fail_path(fptr->pathv);
+ flags = fcntl(fileno(fptr->f), F_GETFL);
+ if (flags == -1) {
+ rb_sys_fail(fptr->path);
+ }
+#else
+ flags = 0;
+#endif
+ if ((flags & O_NONBLOCK) == 0) {
+ flags |= O_NONBLOCK;
+ if (fcntl(fileno(fptr->f), F_SETFL, flags) == -1) {
+ rb_sys_fail(fptr->path);
+ }
}
+ if (fptr->f2) {
+#ifdef F_GETFL
+ flags = fcntl(fileno(fptr->f2), F_GETFL);
+ if (flags == -1) {
+ rb_sys_fail(fptr->path);
+ }
#else
- oflags = 0;
+ flags = 0;
#endif
- if ((oflags & O_NONBLOCK) == 0) {
- oflags |= O_NONBLOCK;
- if (fcntl(fptr->fd, F_SETFL, oflags) == -1) {
- rb_sys_fail_path(fptr->pathv);
+ if ((flags & O_NONBLOCK) == 0) {
+ flags |= O_NONBLOCK;
+ if (fcntl(fileno(fptr->f2), F_SETFL, flags) == -1) {
+ rb_sys_fail(fptr->path);
+ }
}
}
}
@@ -1757,15 +1239,15 @@ io_getpartial(int argc, VALUE *argv, VALUE io, int nonblock)
rb_scan_args(argc, argv, "11", &length, &str);
if ((len = NUM2LONG(length)) < 0) {
- rb_raise(rb_eArgError, "negative length %ld given", len);
+ rb_raise(rb_eArgError, "negative length %ld given", len);
}
if (NIL_P(str)) {
- str = rb_str_new(0, len);
+ str = rb_str_new(0, len);
}
else {
- StringValue(str);
- rb_str_modify(str);
+ StringValue(str);
+ rb_str_modify(str);
rb_str_resize(str, len);
}
OBJ_TAINT(str);
@@ -1774,32 +1256,35 @@ io_getpartial(int argc, VALUE *argv, VALUE io, int nonblock)
rb_io_check_readable(fptr);
if (len == 0)
- return str;
+ return str;
- if (!nonblock)
- READ_CHECK(fptr);
- if (RSTRING_LEN(str) != len) {
+ if (!nonblock) {
+ READ_CHECK(fptr->f);
+ }
+ if (RSTRING(str)->len != len) {
modified:
- rb_raise(rb_eRuntimeError, "buffer string modified");
+ rb_raise(rb_eRuntimeError, "buffer string modified");
}
- n = read_buffered_data(RSTRING_PTR(str), len, fptr);
+ n = read_buffered_data(RSTRING(str)->ptr, len, fptr->f);
if (n <= 0) {
again:
- if (RSTRING_LEN(str) != len) goto modified;
+ if (RSTRING(str)->len != len) goto modified;
if (nonblock) {
rb_io_set_nonblock(fptr);
+ n = read(fileno(fptr->f), RSTRING(str)->ptr, len);
+ }
+ else {
+ TRAP_BEG;
+ n = read(fileno(fptr->f), RSTRING(str)->ptr, len);
+ TRAP_END;
}
- n = rb_read_internal(fptr->fd, RSTRING_PTR(str), len);
if (n < 0) {
- if (!nonblock && rb_io_wait_readable(fptr->fd))
+ if (!nonblock && rb_io_wait_readable(fileno(fptr->f)))
goto again;
- if (nonblock && (errno == EWOULDBLOCK || errno == EAGAIN))
- rb_mod_sys_fail(rb_mWaitReadable, "read would block");
- rb_sys_fail_path(fptr->pathv);
+ rb_sys_fail(fptr->path);
}
- else if (n == 0) {
- io_set_eof(fptr);
- }
+ if (fptr->f) /* update pos in FILE structure [ruby-core:21561] */
+ fflush(fptr->f);
}
rb_str_resize(str, n);
@@ -1835,7 +1320,7 @@ io_getpartial(int argc, VALUE *argv, VALUE io, int nonblock)
* When readpartial doesn't blocks, it returns or raises immediately.
* If the buffer is not empty, it returns the data in the buffer.
* Otherwise if the stream has some content,
- * it returns the data in the stream.
+ * it returns the data in the stream.
* Otherwise if the stream is reached to EOF, it raises EOFError.
*
* r, w = IO.pipe # buffer pipe content
@@ -1859,10 +1344,10 @@ io_getpartial(int argc, VALUE *argv, VALUE io, int nonblock)
* Note that readpartial behaves similar to sysread.
* The differences are:
* * If the buffer is not empty, read from the 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.
+ * * It doesn't cause Errno::EAGAIN and Errno::EINTR. When readpartial meets EAGAIN and EINTR by read system call, readpartial retry the system call.
*
* 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.
+ * It blocks on the situation IO#sysread causes Errno::EAGAIN as if the fd is blocking mode.
*
*/
@@ -1884,40 +1369,22 @@ io_readpartial(int argc, VALUE *argv, VALUE io)
* 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
+ * 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.
*
- * read_nonblock just calls the read(2) system call.
- * It causes all errors the read(2) system call causes: Errno::EWOULDBLOCK, Errno::EINTR, etc.
+ * read_nonblock just calls read(2).
+ * It causes all errors read(2) causes: EAGAIN, 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 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.
- *
- * begin
- * result = io.read_nonblock(maxlen)
- * rescue IO::WaitReadable, Errno::EINTR
- * IO.select([io])
- * retry
- * end
+ * In this case, read(2) is not called.
*
- * Note that this is identical to readpartial
- * except the non-blocking flag is set.
*/
static VALUE
@@ -1937,75 +1404,36 @@ io_read_nonblock(int argc, VALUE *argv, VALUE io)
* ios.write_nonblock(string) => integer
*
* Writes the given string to <em>ios</em> using
- * the write(2) system call after O_NONBLOCK is set for
+ * 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.
+ * write_nonblock just calls write(2).
+ * It causes all errors write(2) causes: EAGAIN, 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.
- *
*/
static VALUE
rb_io_write_nonblock(VALUE io, VALUE str)
{
rb_io_t *fptr;
+ FILE *f;
long n;
rb_secure(4);
if (TYPE(str) != T_STRING)
str = rb_obj_as_string(str);
- io = GetWriteIO(io);
GetOpenFile(io, fptr);
rb_io_check_writable(fptr);
- if (io_fflush(fptr) < 0)
- rb_sys_fail(0);
+ f = GetWriteFile(fptr);
rb_io_set_nonblock(fptr);
- n = write(fptr->fd, RSTRING_PTR(str), RSTRING_LEN(str));
+ n = write(fileno(f), RSTRING(str)->ptr, RSTRING(str)->len);
- if (n == -1) {
- if (errno == EWOULDBLOCK || errno == EAGAIN)
- rb_mod_sys_fail(rb_mWaitWritable, "write would block");
- rb_sys_fail_path(fptr->pathv);
- }
+ if (n == -1) rb_sys_fail(fptr->path);
return LONG2FIX(n);
}
@@ -2014,23 +1442,9 @@ rb_io_write_nonblock(VALUE io, VALUE str)
* call-seq:
* ios.read([length [, buffer]]) => string, buffer, or nil
*
- * Reads <i>length</i> bytes from the I/O stream.
- *
+ * Reads at most <i>length</i> bytes from the I/O stream, or to the
+ * end of file if <i>length</i> is omitted or is <code>nil</code>.
* <i>length</i> must be a non-negative integer or nil.
- *
- * If <i>length</i> is a positive integer,
- * it try to read <i>length</i> bytes.
- * It returns nil or a string which length is 1 to <i>length</i> bytes.
- * nil 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.
- *
- * If <i>length</i> is omitted or is <code>nil</code>,
- * it reads until EOF.
- * It returns a string even if EOF is met at beginning.
- *
- * If <i>length</i> is zero, it returns <code>""</code>.
- *
* If the optional <i>buffer</i> argument is present, it must reference
* a String, which will receive the data.
*
@@ -2042,36 +1456,13 @@ rb_io_write_nonblock(VALUE io, VALUE str)
*
* f = File.new("testfile")
* f.read(16) #=> "This is line one"
- *
- * # reads whole file
- * open("file") {|f|
- * data = f.read # This returns a string even if the file is empty.
- * ...
- * }
- *
- * # iterate over fixed length records.
- * open("fixed-record-file") {|f|
- * while record = f.read(256)
- * ...
- * end
- * }
- *
- * # 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.
- * end
- * }
- *
- * Note that this method behaves like fread() function in C.
- * If you need the behavior like read(2) system call,
- * consider readpartial, read_nonblock and sysread.
*/
static VALUE
-io_read(int argc, VALUE *argv, VALUE io)
+io_read(argc, argv, io)
+ int argc;
+ VALUE *argv;
+ VALUE io;
{
rb_io_t *fptr;
long n, len;
@@ -2082,7 +1473,7 @@ io_read(int argc, VALUE *argv, VALUE io)
if (NIL_P(length)) {
if (!NIL_P(str)) StringValue(str);
GetOpenFile(io, fptr);
- rb_io_check_readable(fptr);
+ rb_io_check_readable(fptr);
return read_all(fptr, remain_size(fptr), str);
}
len = NUM2LONG(length);
@@ -2091,7 +1482,7 @@ io_read(int argc, VALUE *argv, VALUE io)
}
if (NIL_P(str)) {
- str = rb_str_new(0, len);
+ str = rb_tainted_str_new(0, len);
}
else {
StringValue(str);
@@ -2101,366 +1492,310 @@ io_read(int argc, VALUE *argv, VALUE io)
GetOpenFile(io, fptr);
rb_io_check_readable(fptr);
+ if (feof(fptr->f)) return Qnil;
if (len == 0) return str;
- READ_CHECK(fptr);
- if (RSTRING_LEN(str) != len) {
+ rb_str_locktmp(str);
+ READ_CHECK(fptr->f);
+ if (RSTRING(str)->len != len) {
rb_raise(rb_eRuntimeError, "buffer string modified");
}
- n = io_fread(str, 0, fptr);
+ n = io_fread(RSTRING(str)->ptr, len, fptr);
+ rb_str_unlocktmp(str);
if (n == 0) {
- if (fptr->fd < 0) return Qnil;
- rb_str_resize(str, 0);
- return Qnil;
+ if (!fptr->f) return Qnil;
+ if (feof(fptr->f)) {
+ rb_str_resize(str, 0);
+ return Qnil;
+ }
+ if (len > 0) rb_sys_fail(fptr->path);
}
rb_str_resize(str, n);
+ RSTRING(str)->len = n;
+ RSTRING(str)->ptr[n] = '\0';
+ OBJ_TAINT(str);
return str;
}
-static void
-rscheck(const char *rsptr, long rslen, VALUE rs)
-{
- if (!rs) return;
- if (RSTRING_PTR(rs) != rsptr && RSTRING_LEN(rs) != rslen)
- rb_raise(rb_eRuntimeError, "rs modified");
-}
-
static int
-appendline(rb_io_t *fptr, int delim, VALUE *strp, long *lp)
+appendline(fptr, delim, strp)
+ rb_io_t *fptr;
+ int delim;
+ VALUE *strp;
{
+ FILE *f = fptr->f;
VALUE str = *strp;
- long limit = *lp;
-
- if (NEED_READCONV(fptr)) {
- make_readconv(fptr, 0);
- do {
- const char *p, *e;
- int searchlen;
- if (fptr->cbuf_len) {
- p = fptr->cbuf+fptr->cbuf_off;
- searchlen = fptr->cbuf_len;
- if (0 < limit && limit < searchlen)
- searchlen = (int)limit;
- e = memchr(p, delim, searchlen);
- if (e) {
- int len = (int)(e-p+1);
- if (NIL_P(str))
- *strp = str = rb_str_new(p, len);
- else
- rb_str_buf_cat(str, p, len);
- fptr->cbuf_off += len;
- fptr->cbuf_len -= len;
- limit -= len;
- *lp = limit;
- return delim;
- }
-
- if (NIL_P(str))
- *strp = str = rb_str_new(p, searchlen);
- else
- rb_str_buf_cat(str, p, searchlen);
- fptr->cbuf_off += searchlen;
- fptr->cbuf_len -= searchlen;
- limit -= searchlen;
-
- if (limit == 0) {
- *lp = limit;
- return (unsigned char)RSTRING_PTR(str)[RSTRING_LEN(str)-1];
- }
- }
- } while (more_char(fptr) != -1);
- *lp = limit;
- return EOF;
- }
+ int c = EOF;
+#ifndef READ_DATA_PENDING_PTR
+ char buf[8192];
+ char *bp = buf, *bpe = buf + sizeof buf - 3;
+ int update = Qfalse;
+#endif
do {
- long pending = READ_DATA_PENDING_COUNT(fptr);
+#ifdef READ_DATA_PENDING_PTR
+ long pending = READ_DATA_PENDING_COUNT(f);
if (pending > 0) {
- const char *p = READ_DATA_PENDING_PTR(fptr);
- const char *e;
- long last;
-
- if (limit > 0 && pending > limit) pending = limit;
- e = memchr(p, delim, pending);
+ const char *p = READ_DATA_PENDING_PTR(f);
+ const char *e = memchr(p, delim, pending);
+ long last = 0, len = (c != EOF);
if (e) pending = e - p + 1;
+ len += pending;
if (!NIL_P(str)) {
- last = RSTRING_LEN(str);
- rb_str_resize(str, last + pending);
+ last = RSTRING(str)->len;
+ rb_str_resize(str, last + len);
}
else {
- last = 0;
- *strp = str = rb_str_buf_new(pending);
- rb_str_set_len(str, pending);
+ *strp = str = rb_str_buf_new(len);
+ RSTRING(str)->len = len;
+ RSTRING(str)->ptr[len] = '\0';
+ }
+ if (c != EOF) {
+ RSTRING(str)->ptr[last++] = c;
}
- read_buffered_data(RSTRING_PTR(str) + last, pending, fptr); /* must not fail */
- limit -= pending;
- *lp = limit;
+ fread(RSTRING(str)->ptr + last, 1, pending, f); /* must not fail */
if (e) return delim;
- if (limit == 0)
- return (unsigned char)RSTRING_PTR(str)[RSTRING_LEN(str)-1];
}
- rb_thread_wait_fd(fptr->fd);
+ else if (c != EOF) {
+ if (!NIL_P(str)) {
+ char ch = c;
+ rb_str_buf_cat(str, &ch, 1);
+ }
+ else {
+ *strp = str = rb_str_buf_new(1);
+ RSTRING(str)->ptr[RSTRING(str)->len++] = c;
+ }
+ }
+ rb_thread_wait_fd(fileno(f));
rb_io_check_closed(fptr);
- } while (io_fillbuf(fptr) >= 0);
- *lp = limit;
- return EOF;
+#else
+ READ_CHECK(f);
+#endif
+ clearerr(f);
+ TRAP_BEG;
+ c = getc(f);
+ TRAP_END;
+ if (c == EOF) {
+ if (ferror(f)) {
+ clearerr(f);
+ if (!rb_io_wait_readable(fileno(f)))
+ rb_sys_fail(fptr->path);
+ continue;
+ }
+#ifdef READ_DATA_PENDING_PTR
+ return c;
+#endif
+ }
+#ifndef READ_DATA_PENDING_PTR
+ if (c == EOF || (*bp++ = c) == delim || bp == bpe) {
+ int cnt = bp - buf;
+
+ if (cnt > 0) {
+ if (!NIL_P(str))
+ rb_str_cat(str, buf, cnt);
+ else
+ *strp = str = rb_str_new(buf, cnt);
+ }
+ if (c == EOF) {
+ if (update)
+ return (int)RSTRING(str)->ptr[RSTRING(str)->len-1];
+ return c;
+ }
+ bp = buf;
+ }
+ update = Qtrue;
+#endif
+ } while (c != delim);
+
+#ifdef READ_DATA_PENDING_PTR
+ {
+ char ch = c;
+ if (!NIL_P(str)) {
+ rb_str_cat(str, &ch, 1);
+ }
+ else {
+ *strp = str = rb_str_new(&ch, 1);
+ }
+ }
+#endif
+
+ return c;
}
static inline int
-swallow(rb_io_t *fptr, int term)
+swallow(fptr, term)
+ rb_io_t *fptr;
+ int term;
{
+ FILE *f = fptr->f;
+ int c;
+
do {
- size_t cnt;
- while ((cnt = READ_DATA_PENDING_COUNT(fptr)) > 0) {
+#ifdef READ_DATA_PENDING_PTR
+ long cnt;
+ while ((cnt = READ_DATA_PENDING_COUNT(f)) > 0) {
char buf[1024];
- const char *p = READ_DATA_PENDING_PTR(fptr);
+ const char *p = READ_DATA_PENDING_PTR(f);
int i;
if (cnt > sizeof buf) cnt = sizeof buf;
if (*p != term) return Qtrue;
- i = (int)cnt;
+ i = cnt;
while (--i && *++p == term);
- if (!read_buffered_data(buf, cnt - i, fptr)) /* must not fail */
- rb_sys_fail_path(fptr->pathv);
+ if (!fread(buf, 1, cnt - i, f)) /* must not fail */
+ rb_sys_fail(fptr->path);
}
- rb_thread_wait_fd(fptr->fd);
+ rb_thread_wait_fd(fileno(f));
rb_io_check_closed(fptr);
- } while (io_fillbuf(fptr) == 0);
+#else
+ READ_CHECK(f);
+#endif
+ clearerr(f);
+ TRAP_BEG;
+ c = getc(f);
+ TRAP_END;
+ if (c != term) {
+ ungetc(c, f);
+ return Qtrue;
+ }
+ } while (c != EOF);
return Qfalse;
}
static VALUE
-rb_io_getline_fast(rb_io_t *fptr, rb_encoding *enc)
+rb_io_getline_fast(fptr, delim)
+ rb_io_t *fptr;
+ unsigned char delim;
{
VALUE str = Qnil;
- int len = 0;
- long pos = 0;
- int cr = 0;
+ int c;
- for (;;) {
- int pending = READ_DATA_PENDING_COUNT(fptr);
+ while ((c = appendline(fptr, delim, &str)) != EOF && c != delim);
- if (pending > 0) {
- const char *p = READ_DATA_PENDING_PTR(fptr);
- const char *e;
-
- e = memchr(p, '\n', pending);
- if (e) {
- pending = (int)(e - p + 1);
- }
- if (NIL_P(str)) {
- str = rb_str_new(p, pending);
- fptr->rbuf_off += pending;
- fptr->rbuf_len -= pending;
- }
- else {
- rb_str_resize(str, len + pending);
- read_buffered_data(RSTRING_PTR(str)+len, pending, fptr);
- }
- 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;
- }
- rb_thread_wait_fd(fptr->fd);
- rb_io_check_closed(fptr);
- if (io_fillbuf(fptr) < 0) {
- if (NIL_P(str)) return Qnil;
- break;
- }
+ if (!NIL_P(str)) {
+ fptr->lineno++;
+ lineno = INT2FIX(fptr->lineno);
+ OBJ_TAINT(str);
}
- str = io_enc_str(str, fptr);
- ENC_CODERANGE_SET(str, cr);
- fptr->lineno++;
- ARGF.last_lineno = fptr->lineno;
-
return str;
}
-static void
-prepare_getline_args(int argc, VALUE *argv, VALUE *rsp, long *limit, VALUE io)
+static int
+rscheck(rsptr, rslen, rs)
+ const char *rsptr;
+ long rslen;
+ VALUE rs;
{
- VALUE rs = rb_rs, lim = Qnil;
- rb_io_t *fptr;
-
- if (argc == 1) {
- VALUE tmp = Qnil;
-
- if (NIL_P(argv[0]) || !NIL_P(tmp = rb_check_string_type(argv[0]))) {
- rs = tmp;
- }
- else {
- lim = argv[0];
- }
- }
- else if (2 <= argc) {
- rb_scan_args(argc, argv, "2", &rs, &lim);
- if (!NIL_P(rs))
- StringValue(rs);
- }
- if (!NIL_P(rs)) {
- rb_encoding *enc_rs, *enc_io;
-
- GetOpenFile(io, fptr);
- enc_rs = rb_enc_get(rs);
- enc_io = io_read_encoding(fptr);
- if (enc_io != enc_rs &&
- (rb_enc_str_coderange(rs) != ENC_CODERANGE_7BIT ||
- !rb_enc_asciicompat(enc_io))) {
- if (rs == rb_default_rs) {
- rs = rb_enc_str_new(0, 0, enc_io);
- rb_str_buf_cat_ascii(rs, "\n");
- }
- else {
- rb_raise(rb_eArgError, "encoding mismatch: %s IO with %s RS",
- rb_enc_name(enc_io),
- rb_enc_name(enc_rs));
- }
- }
- }
- *rsp = rs;
- *limit = NIL_P(lim) ? -1L : NUM2LONG(lim);
+ if (RSTRING(rs)->ptr != rsptr && RSTRING(rs)->len != rslen)
+ rb_raise(rb_eRuntimeError, "rs modified");
+ return 1;
}
+static VALUE rb_io_getline(VALUE rs, VALUE io);
+
static VALUE
-rb_io_getline_1(VALUE rs, long limit, VALUE io)
+rb_io_getline(rs, io)
+ VALUE rs, io;
{
VALUE str = Qnil;
rb_io_t *fptr;
- int nolimit = 0;
- rb_encoding *enc;
GetOpenFile(io, fptr);
rb_io_check_readable(fptr);
- if (NIL_P(rs) && limit < 0) {
+ if (NIL_P(rs)) {
str = read_all(fptr, 0, Qnil);
- if (RSTRING_LEN(str) == 0) return Qnil;
- }
- else if (limit == 0) {
- return rb_enc_str_new(0, 0, io_read_encoding(fptr));
+ if (RSTRING(str)->len == 0) return Qnil;
}
- else if (rs == rb_default_rs && limit < 0 && !NEED_READCONV(fptr) &&
- rb_enc_asciicompat(enc = io_read_encoding(fptr))) {
- return rb_io_getline_fast(fptr, enc);
+ else if (rs == rb_default_rs) {
+ return rb_io_getline_fast(fptr, '\n');
}
else {
- int c, newline = -1;
- const char *rsptr = 0;
- long rslen = 0;
+ int c, newline;
+ const char *rsptr;
+ long rslen;
int rspara = 0;
- int extra_limit = 16;
-
- if (!NIL_P(rs)) {
- rslen = RSTRING_LEN(rs);
- if (rslen == 0) {
- rsptr = "\n\n";
- rslen = 2;
- rspara = 1;
- swallow(fptr, '\n');
- rs = 0;
- }
- else {
- rsptr = RSTRING_PTR(rs);
- }
- newline = (unsigned char)rsptr[rslen - 1];
- }
- /* MS - Optimisation */
- enc = io_read_encoding(fptr);
- while ((c = appendline(fptr, newline, &str, &limit)) != EOF) {
- const char *s, *p, *pp, *e;
-
- if (c == newline) {
- if (RSTRING_LEN(str) < rslen) continue;
- s = RSTRING_PTR(str);
- e = s + RSTRING_LEN(str);
- p = e - rslen;
- 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) break;
- }
- if (limit == 0) {
- s = RSTRING_PTR(str);
- p = s + RSTRING_LEN(str);
- pp = rb_enc_left_char_head(s, p-1, p, enc);
- if (extra_limit &&
- MBCLEN_NEEDMORE_P(rb_enc_precise_mbclen(pp, p, enc))) {
- /* relax the limit while incomplete character.
- * extra_limit limits the relax length */
- limit = 1;
- extra_limit--;
- }
- else {
- nolimit = 1;
- break;
- }
- }
+ rslen = RSTRING(rs)->len;
+ if (rslen == 0) {
+ rsptr = "\n\n";
+ rslen = 2;
+ rspara = 1;
+ swallow(fptr, '\n');
}
+ else if (rslen == 1) {
+ return rb_io_getline_fast(fptr, (unsigned char)RSTRING(rs)->ptr[0]);
+ }
+ else {
+ rsptr = RSTRING(rs)->ptr;
+ }
+ newline = rsptr[rslen - 1];
+
+ while ((c = appendline(fptr, newline, &str)) != EOF &&
+ (c != newline || RSTRING(str)->len < rslen ||
+ ((rspara || rscheck(rsptr,rslen,rs)) && 0) ||
+ memcmp(RSTRING(str)->ptr+RSTRING(str)->len-rslen,rsptr,rslen)));
if (rspara) {
if (c != EOF) {
swallow(fptr, '\n');
}
}
- if (!NIL_P(str))
- str = io_enc_str(str, fptr);
}
if (!NIL_P(str)) {
- if (!nolimit) {
- fptr->lineno++;
- ARGF.last_lineno = fptr->lineno;
- }
+ fptr->lineno++;
+ lineno = INT2FIX(fptr->lineno);
+ OBJ_TAINT(str);
}
return str;
}
-static VALUE
-rb_io_getline(int argc, VALUE *argv, VALUE io)
-{
- VALUE rs;
- long limit;
-
- prepare_getline_args(argc, argv, &rs, &limit, io);
- return rb_io_getline_1(rs, limit, io);
-}
-
VALUE
-rb_io_gets(VALUE io)
+rb_io_gets(io)
+ VALUE io;
{
- return rb_io_getline_1(rb_default_rs, -1, io);
+ rb_io_t *fptr;
+
+ GetOpenFile(io, fptr);
+ rb_io_check_readable(fptr);
+ return rb_io_getline_fast(fptr, '\n');
}
/*
* call-seq:
- * ios.gets(sep=$/) => string or nil
- * ios.gets(limit) => string or nil
- * ios.gets(sep, limit) => string or nil
- *
+ * ios.gets(sep_string=$/) => string or nil
+ *
* Reads the next ``line'' from the I/O stream; lines are separated by
- * <i>sep</i>. A separator of <code>nil</code> reads the entire
+ * <i>sep_string</i>. A separator of <code>nil</code> reads the entire
* contents, and a zero-length separator reads the input a paragraph at
* a time (two successive newlines in the input separate paragraphs).
* The stream must be opened for reading or an <code>IOError</code>
* will be raised. The line read in will be returned and also assigned
* to <code>$_</code>. Returns <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.
+ *
* File.new("testfile").gets #=> "This is line one\n"
* $_ #=> "This is line one\n"
*/
static VALUE
-rb_io_gets_m(int argc, VALUE *argv, VALUE io)
+rb_io_gets_m(argc, argv, io)
+ int argc;
+ VALUE *argv;
+ VALUE io;
{
- VALUE str;
+ VALUE rs, str;
- str = rb_io_getline(argc, argv, io);
+ if (argc == 0) {
+ rs = rb_rs;
+ }
+ else {
+ rb_scan_args(argc, argv, "1", &rs);
+ if (!NIL_P(rs)) StringValue(rs);
+ }
+ str = rb_io_getline(rs, io);
rb_lastline_set(str);
return str;
@@ -2469,14 +1804,14 @@ rb_io_gets_m(int argc, VALUE *argv, VALUE io)
/*
* call-seq:
* ios.lineno => integer
- *
+ *
* Returns the current line number in <em>ios</em>. The stream must be
* opened for reading. <code>lineno</code> counts the number of times
* <code>gets</code> is called, rather than the number of newlines
* encountered. The two values will differ if <code>gets</code> is
* called with a separator other than newline. See also the
* <code>$.</code> variable.
- *
+ *
* f = File.new("testfile")
* f.lineno #=> 0
* f.gets #=> "This is line one\n"
@@ -2486,7 +1821,8 @@ rb_io_gets_m(int argc, VALUE *argv, VALUE io)
*/
static VALUE
-rb_io_lineno(VALUE io)
+rb_io_lineno(io)
+ VALUE io;
{
rb_io_t *fptr;
@@ -2498,22 +1834,23 @@ rb_io_lineno(VALUE io)
/*
* call-seq:
* ios.lineno = integer => integer
- *
+ *
* Manually sets the current line number to the given value.
* <code>$.</code> is updated only on the next read.
- *
+ *
* f = File.new("testfile")
* f.gets #=> "This is line one\n"
* $. #=> 1
* f.lineno = 1000
* f.lineno #=> 1000
- * $. #=> 1 # lineno of last read
+ * $. # lineno of last read #=> 1
* f.gets #=> "This is line two\n"
- * $. #=> 1001 # lineno of last read
+ * $. # lineno of last read #=> 1001
*/
static VALUE
-rb_io_set_lineno(VALUE io, VALUE lineno)
+rb_io_set_lineno(io, lineno)
+ VALUE io, lineno;
{
rb_io_t *fptr;
@@ -2523,18 +1860,44 @@ rb_io_set_lineno(VALUE io, VALUE lineno)
return lineno;
}
+static void
+lineno_setter(val, id, var)
+ VALUE val;
+ ID id;
+ VALUE *var;
+{
+ gets_lineno = NUM2INT(val);
+ *var = INT2FIX(gets_lineno);
+}
+
+static VALUE
+argf_set_lineno(argf, val)
+ VALUE argf, val;
+{
+ gets_lineno = NUM2INT(val);
+ lineno = INT2FIX(gets_lineno);
+ return Qnil;
+}
+
+static VALUE
+argf_lineno()
+{
+ return lineno;
+}
+
/*
* call-seq:
- * ios.readline(sep=$/) => string
- * ios.readline(limit) => string
- * ios.readline(sep, limit) => string
- *
+ * ios.readline(sep_string=$/) => string
+ *
* Reads a line as with <code>IO#gets</code>, but raises an
* <code>EOFError</code> on end of file.
*/
static VALUE
-rb_io_readline(int argc, VALUE *argv, VALUE io)
+rb_io_readline(argc, argv, io)
+ int argc;
+ VALUE *argv;
+ VALUE io;
{
VALUE line = rb_io_gets_m(argc, argv, io);
@@ -2546,31 +1909,37 @@ rb_io_readline(int argc, VALUE *argv, VALUE io)
/*
* call-seq:
- * ios.readlines(sep=$/) => array
- * ios.readlines(limit) => array
- * ios.readlines(sep, limit) => array
- *
+ * ios.readlines(sep_string=$/) => array
+ *
* Reads all of the lines in <em>ios</em>, and returns them in
- * <i>anArray</i>. Lines are separated by the optional <i>sep</i>. If
- * <i>sep</i> is <code>nil</code>, the rest of the stream is returned
- * as a single record. If the first argument is an integer, or
- * optional second argument is given, the returning string would not be
- * longer than the given value in bytes. The stream must be opened for
- * reading or an <code>IOError</code> will be raised.
- *
+ * <i>anArray</i>. Lines are separated by the optional
+ * <i>sep_string</i>. If <i>sep_string</i> is <code>nil</code>, the
+ * rest of the stream is returned as a single record.
+ * The stream must be opened for reading or an
+ * <code>IOError</code> will be raised.
+ *
* f = File.new("testfile")
* f.readlines[0] #=> "This is line one\n"
*/
static VALUE
-rb_io_readlines(int argc, VALUE *argv, VALUE io)
+rb_io_readlines(argc, argv, io)
+ int argc;
+ VALUE *argv;
+ VALUE io;
{
- VALUE line, ary, rs;
- long limit;
+ VALUE line, ary;
+ VALUE rs;
- prepare_getline_args(argc, argv, &rs, &limit, io);
+ if (argc == 0) {
+ rs = rb_rs;
+ }
+ else {
+ rb_scan_args(argc, argv, "1", &rs);
+ if (!NIL_P(rs)) StringValue(rs);
+ }
ary = rb_ary_new();
- while (!NIL_P(line = rb_io_getline_1(rs, limit, io))) {
+ while (!NIL_P(line = rb_io_getline(rs, io))) {
rb_ary_push(ary, line);
}
return ary;
@@ -2578,22 +1947,18 @@ rb_io_readlines(int argc, VALUE *argv, VALUE io)
/*
* call-seq:
- * ios.each(sep=$/) {|line| block } => ios
- * ios.each(limit) {|line| block } => ios
- * ios.each(sep,limit) {|line| block } => ios
- * ios.each_line(sep=$/) {|line| block } => ios
- * ios.each_line(limit) {|line| block } => ios
- * ios.each_line(sep,limit) {|line| block } => ios
- *
+ * ios.each(sep_string=$/) {|line| block } => ios
+ * ios.each_line(sep_string=$/) {|line| block } => ios
+ *
* 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
+ * separated by <i>sep_string</i>. <em>ios</em> must be opened for
* reading or an <code>IOError</code> will be raised.
- *
+ *
* f = File.new("testfile")
* f.each {|line| puts "#{f.lineno}: #{line}" }
- *
+ *
* <em>produces:</em>
- *
+ *
* 1: This is line one
* 2: This is line two
* 3: This is line three
@@ -2601,14 +1966,23 @@ rb_io_readlines(int argc, VALUE *argv, VALUE io)
*/
static VALUE
-rb_io_each_line(int argc, VALUE *argv, VALUE io)
+rb_io_each_line(argc, argv, io)
+ int argc;
+ VALUE *argv;
+ VALUE io;
{
- VALUE str, rs;
- long limit;
+ VALUE str;
+ VALUE rs;
RETURN_ENUMERATOR(io, argc, argv);
- prepare_getline_args(argc, argv, &rs, &limit, io);
- while (!NIL_P(str = rb_io_getline_1(rs, limit, io))) {
+ if (argc == 0) {
+ rs = rb_rs;
+ }
+ else {
+ rb_scan_args(argc, argv, "1", &rs);
+ if (!NIL_P(rs)) StringValue(rs);
+ }
+ while (!NIL_P(str = rb_io_getline(rs, io))) {
rb_yield(str);
}
return io;
@@ -2617,11 +1991,11 @@ rb_io_each_line(int argc, VALUE *argv, VALUE io)
/*
* call-seq:
* ios.each_byte {|byte| block } => ios
- *
+ *
* 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 <code>IOError</code> will be raised.
- *
+ *
* f = File.new("testfile")
* checksum = 0
* f.each_byte {|x| checksum ^= x } #=> #<File:testfile>
@@ -2629,121 +2003,40 @@ rb_io_each_line(int argc, VALUE *argv, VALUE io)
*/
static VALUE
-rb_io_each_byte(VALUE io)
+rb_io_each_byte(io)
+ VALUE io;
{
rb_io_t *fptr;
- char *p, *e;
+ FILE *f;
+ int c;
RETURN_ENUMERATOR(io, 0, 0);
GetOpenFile(io, fptr);
for (;;) {
- p = fptr->rbuf+fptr->rbuf_off;
- e = p + fptr->rbuf_len;
- while (p < e) {
- fptr->rbuf_off++;
- fptr->rbuf_len--;
- rb_yield(INT2FIX(*p & 0xff));
- p++;
- errno = 0;
- }
rb_io_check_readable(fptr);
- READ_CHECK(fptr);
- if (io_fillbuf(fptr) < 0) {
+ f = fptr->f;
+ READ_CHECK(f);
+ clearerr(f);
+ TRAP_BEG;
+ c = getc(f);
+ TRAP_END;
+ if (c == EOF) {
+ if (ferror(f)) {
+ clearerr(f);
+ if (!rb_io_wait_readable(fileno(f)))
+ rb_sys_fail(fptr->path);
+ continue;
+ }
break;
}
+ rb_yield(INT2FIX(c & 0xff));
}
+ if (ferror(f)) rb_sys_fail(fptr->path);
return io;
}
-static VALUE
-io_getc(rb_io_t *fptr, rb_encoding *enc)
-{
- int r, n, cr = 0;
- VALUE str;
-
- if (NEED_READCONV(fptr)) {
- VALUE str = Qnil;
-
- make_readconv(fptr, 0);
-
- while (1) {
- if (fptr->cbuf_len) {
- if (fptr->encs.enc)
- r = rb_enc_precise_mbclen(fptr->cbuf+fptr->cbuf_off,
- fptr->cbuf+fptr->cbuf_off+fptr->cbuf_len,
- fptr->encs.enc);
- else
- r = ONIGENC_CONSTRUCT_MBCLEN_CHARFOUND(1);
- if (!MBCLEN_NEEDMORE_P(r))
- break;
- if (fptr->cbuf_len == fptr->cbuf_capa) {
- rb_raise(rb_eIOError, "too long character");
- }
- }
-
- if (more_char(fptr) == -1) {
- if (fptr->cbuf_len == 0)
- return Qnil;
- /* return an incomplete character just before EOF */
- return io_shift_cbuf(fptr, fptr->cbuf_len, &str);
- }
- }
- if (MBCLEN_INVALID_P(r)) {
- r = rb_enc_mbclen(fptr->cbuf+fptr->cbuf_off,
- fptr->cbuf+fptr->cbuf_off+fptr->cbuf_len,
- fptr->encs.enc);
- return io_shift_cbuf(fptr, r, &str);
- }
- return io_shift_cbuf(fptr, MBCLEN_CHARFOUND_LEN(r), &str);
- }
-
- if (io_fillbuf(fptr) < 0) {
- return Qnil;
- }
- if (rb_enc_asciicompat(enc) && ISASCII(fptr->rbuf[fptr->rbuf_off])) {
- str = rb_str_new(fptr->rbuf+fptr->rbuf_off, 1);
- fptr->rbuf_off += 1;
- fptr->rbuf_len -= 1;
- cr = ENC_CODERANGE_7BIT;
- }
- else {
- r = rb_enc_precise_mbclen(fptr->rbuf+fptr->rbuf_off, fptr->rbuf+fptr->rbuf_off+fptr->rbuf_len, enc);
- if (MBCLEN_CHARFOUND_P(r) &&
- (n = MBCLEN_CHARFOUND_LEN(r)) <= fptr->rbuf_len) {
- str = rb_str_new(fptr->rbuf+fptr->rbuf_off, n);
- fptr->rbuf_off += n;
- fptr->rbuf_len -= n;
- cr = ENC_CODERANGE_VALID;
- }
- else if (MBCLEN_NEEDMORE_P(r)) {
- str = rb_str_new(fptr->rbuf+fptr->rbuf_off, fptr->rbuf_len);
- fptr->rbuf_len = 0;
- getc_needmore:
- if (io_fillbuf(fptr) != -1) {
- rb_str_cat(str, fptr->rbuf+fptr->rbuf_off, 1);
- fptr->rbuf_off++;
- fptr->rbuf_len--;
- r = rb_enc_precise_mbclen(RSTRING_PTR(str), RSTRING_PTR(str)+RSTRING_LEN(str), enc);
- if (MBCLEN_NEEDMORE_P(r)) {
- goto getc_needmore;
- }
- else if (MBCLEN_CHARFOUND_P(r)) {
- cr = ENC_CODERANGE_VALID;
- }
- }
- }
- else {
- str = rb_str_new(fptr->rbuf+fptr->rbuf_off, 1);
- fptr->rbuf_off++;
- fptr->rbuf_len--;
- }
- }
- if (!cr) cr = ENC_CODERANGE_BROKEN;
- str = io_enc_str(str, fptr);
- ENC_CODERANGE_SET(str, cr);
- return str;
-}
+VALUE rb_io_getc _((VALUE));
/*
* call-seq:
@@ -2751,117 +2044,43 @@ 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 <code>IOError</code> will be raised.
+ * reading or an <code>IOError</code> will be raised. Multibyte
+ * characters are dealt with according to $KCODE.
*
* f = File.new("testfile")
* f.each_char {|c| print c, ' ' } #=> #<File:testfile>
*/
static VALUE
-rb_io_each_char(VALUE io)
+rb_io_each_char(io)
+ VALUE io;
{
- rb_io_t *fptr;
- rb_encoding *enc;
- VALUE c;
+ VALUE ch;
RETURN_ENUMERATOR(io, 0, 0);
- GetOpenFile(io, fptr);
- rb_io_check_readable(fptr);
-
- enc = io_input_encoding(fptr);
- READ_CHECK(fptr);
- while (!NIL_P(c = io_getc(fptr, enc))) {
- rb_yield(c);
- }
- return io;
-}
-
-
-
-/*
- * call-seq:
- * ios.each_codepoint {|c| block } => ios
- *
- * 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 <code>IOError</code> will be raised.
- */
-static VALUE
-rb_io_each_codepoint(VALUE io)
-{
- rb_io_t *fptr;
- rb_encoding *enc;
- unsigned int c;
- int r, n;
+ while (!NIL_P(ch = rb_io_getc(io))) {
+ unsigned char c;
+ int n;
+ VALUE str;
- RETURN_ENUMERATOR(io, 0, 0);
- GetOpenFile(io, fptr);
- rb_io_check_readable(fptr);
+ c= FIX2INT(ch);
+ n = mbclen(c);
+ str = rb_tainted_str_new((const char *)&c, 1);
- READ_CHECK(fptr);
- if (NEED_READCONV(fptr)) {
- for (;;) {
- make_readconv(fptr, 0);
- for (;;) {
- if (fptr->cbuf_len) {
- if (fptr->encs.enc)
- r = rb_enc_precise_mbclen(fptr->cbuf+fptr->cbuf_off,
- fptr->cbuf+fptr->cbuf_off+fptr->cbuf_len,
- fptr->encs.enc);
- else
- r = ONIGENC_CONSTRUCT_MBCLEN_CHARFOUND(1);
- if (!MBCLEN_NEEDMORE_P(r))
- break;
- if (fptr->cbuf_len == fptr->cbuf_capa) {
- rb_raise(rb_eIOError, "too long character");
- }
- }
- if (more_char(fptr) == -1) {
- /* ignore an incomplete character before EOF */
- return io;
- }
+ while (--n > 0) {
+ if (NIL_P(ch = rb_io_getc(io))) {
+ rb_yield(str);
+ return io;
}
- if (MBCLEN_INVALID_P(r)) {
- rb_raise(rb_eArgError, "invalid byte sequence in %s",
- rb_enc_name(fptr->encs.enc));
- }
- n = MBCLEN_CHARFOUND_LEN(r);
- c = rb_enc_codepoint(fptr->cbuf+fptr->cbuf_off,
- fptr->cbuf+fptr->cbuf_off+fptr->cbuf_len,
- fptr->encs.enc);
- fptr->rbuf_off += n;
- fptr->rbuf_len -= n;
- rb_yield(UINT2NUM(c));
- }
- }
- enc = io_input_encoding(fptr);
- for (;;) {
- if (io_fillbuf(fptr) < 0) {
- return io;
- }
- r = rb_enc_precise_mbclen(fptr->rbuf+fptr->rbuf_off,
- fptr->rbuf+fptr->rbuf_off+fptr->rbuf_len, enc);
- if (MBCLEN_CHARFOUND_P(r) &&
- (n = MBCLEN_CHARFOUND_LEN(r)) <= fptr->rbuf_len) {
- c = rb_enc_codepoint(fptr->rbuf+fptr->rbuf_off,
- fptr->rbuf+fptr->rbuf_off+fptr->rbuf_len, enc);
- fptr->rbuf_off += n;
- fptr->rbuf_len -= n;
- rb_yield(UINT2NUM(c));
- }
- else if (MBCLEN_INVALID_P(r)) {
- rb_raise(rb_eArgError, "invalid byte sequence in %s", rb_enc_name(enc));
- }
- else {
- continue;
+ c = FIX2INT(ch);
+ rb_str_cat(str, (const char *)&c, 1);
}
+ rb_yield(str);
}
return io;
}
-
-
/*
* call-seq:
* ios.lines(sep=$/) => anEnumerator
@@ -2879,7 +2098,10 @@ rb_io_each_codepoint(VALUE io)
*/
static VALUE
-rb_io_lines(int argc, VALUE *argv, VALUE io)
+rb_io_lines(argc, argv, io)
+ int argc;
+ VALUE *argv;
+ VALUE io;
{
return rb_enumeratorize(io, ID2SYM(rb_intern("each_line")), argc, argv);
}
@@ -2891,7 +2113,7 @@ rb_io_lines(int argc, VALUE *argv, VALUE io)
* Returns an enumerator that gives each byte (0..255) in <em>ios</em>.
* The stream must be opened for reading or an <code>IOError</code>
* will be raised.
- *
+ *
* f = File.new("testfile")
* f.bytes.to_a #=> [104, 101, 108, 108, 111]
* f.rewind
@@ -2899,144 +2121,85 @@ rb_io_lines(int argc, VALUE *argv, VALUE io)
*/
static VALUE
-rb_io_bytes(VALUE io)
+rb_io_bytes(io)
+ VALUE io;
{
return rb_enumeratorize(io, ID2SYM(rb_intern("each_byte")), 0, 0);
}
/*
* call-seq:
- * ios.chars => anEnumerator
- *
- * Returns an enumerator that gives each character in <em>ios</em>.
- * The stream must be opened for reading or an <code>IOError</code>
- * will be raised.
- *
- * f = File.new("testfile")
- * f.chars.to_a #=> ["h", "e", "l", "l", "o"]
- * f.rewind
- * f.chars.sort #=> ["e", "h", "l", "l", "o"]
- */
-
-static VALUE
-rb_io_chars(VALUE io)
-{
- return rb_enumeratorize(io, ID2SYM(rb_intern("each_char")), 0, 0);
-}
-
-/*
- * call-seq:
- * ios.codepoints => anEnumerator
- *
- * Returns an enumerator that gives each codepoint in <em>ios</em>.
- * The stream must be opened for reading or an <code>IOError</code>
- * will be raised.
- */
-
-static VALUE
-rb_io_codepoints(VALUE io)
-{
- return rb_enumeratorize(io, ID2SYM(rb_intern("each_codepoint")), 0, 0);
-}
-
-/*
- * call-seq:
- * ios.getc => string or nil
- *
- * Reads a one-character string from <em>ios</em>. Returns
+ * ios.getc => fixnum or nil
+ *
+ * Gets the next 8-bit byte (0..255) from <em>ios</em>. Returns
* <code>nil</code> if called at end of file.
- *
+ *
* f = File.new("testfile")
- * f.getc #=> "h"
- * f.getc #=> "e"
+ * f.getc #=> 84
+ * f.getc #=> 104
*/
-static VALUE
-rb_io_getc(VALUE io)
+VALUE
+rb_io_getc(io)
+ VALUE io;
{
rb_io_t *fptr;
- rb_encoding *enc;
+ FILE *f;
+ int c;
GetOpenFile(io, fptr);
rb_io_check_readable(fptr);
+ f = fptr->f;
- enc = io_input_encoding(fptr);
- READ_CHECK(fptr);
- return io_getc(fptr, enc);
-}
-
-/*
- * call-seq:
- * ios.readchar => string
- *
- * Reads a one-character string from <em>ios</em>. Raises an
- * <code>EOFError</code> on end of file.
- *
- * f = File.new("testfile")
- * f.readchar #=> "h"
- * f.readchar #=> "e"
- */
-
-static VALUE
-rb_io_readchar(VALUE io)
-{
- VALUE c = rb_io_getc(io);
-
- if (NIL_P(c)) {
- rb_eof_error();
+ retry:
+ READ_CHECK(f);
+ clearerr(f);
+ TRAP_BEG;
+ c = getc(f);
+ TRAP_END;
+
+ if (c == EOF) {
+ if (ferror(f)) {
+ clearerr(f);
+ if (!rb_io_wait_readable(fileno(f)))
+ rb_sys_fail(fptr->path);
+ goto retry;
+ }
+ return Qnil;
}
- return c;
+ return INT2FIX(c & 0xff);
}
-/*
- * call-seq:
- * ios.getbyte => fixnum or nil
- *
- * Gets the next 8-bit byte (0..255) from <em>ios</em>. Returns
- * <code>nil</code> if called at end of file.
- *
- * f = File.new("testfile")
- * f.getbyte #=> 84
- * f.getbyte #=> 104
- */
-
-VALUE
-rb_io_getbyte(VALUE io)
+int
+rb_getc(f)
+ FILE *f;
{
- rb_io_t *fptr;
int c;
- GetOpenFile(io, fptr);
- rb_io_check_readable(fptr);
- READ_CHECK(fptr);
- if (fptr->fd == 0 && (fptr->mode & FMODE_TTY) && TYPE(rb_stdout) == T_FILE) {
- rb_io_t *ofp;
- GetOpenFile(rb_stdout, ofp);
- if (ofp->mode & FMODE_TTY) {
- rb_io_flush(rb_stdout);
- }
+ if (!READ_DATA_PENDING(f)) {
+ rb_thread_wait_fd(fileno(f));
}
- if (io_fillbuf(fptr) < 0) {
- return Qnil;
- }
- fptr->rbuf_off++;
- fptr->rbuf_len--;
- c = (unsigned char)fptr->rbuf[fptr->rbuf_off-1];
- return INT2FIX(c & 0xff);
+ clearerr(f);
+ TRAP_BEG;
+ c = getc(f);
+ TRAP_END;
+
+ return c;
}
/*
* call-seq:
- * ios.readbyte => fixnum
- *
- * Reads a byte as with <code>IO#getbyte</code>, but raises an
+ * ios.readchar => fixnum
+ *
+ * Reads a character as with <code>IO#getc</code>, but raises an
* <code>EOFError</code> on end of file.
*/
static VALUE
-rb_io_readbyte(VALUE io)
+rb_io_readchar(io)
+ VALUE io;
{
- VALUE c = rb_io_getbyte(io);
+ VALUE c = rb_io_getc(io);
if (NIL_P(c)) {
rb_eof_error();
@@ -3046,98 +2209,34 @@ rb_io_readbyte(VALUE io)
/*
* call-seq:
- * ios.ungetbyte(string) => 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 <code>IO#sysread</code>).
- *
- * f = File.new("testfile") #=> #<File:testfile>
- * b = f.getbyte #=> 0x38
- * f.ungetbyte(b) #=> nil
- * f.getbyte #=> 0x38
- */
-
-VALUE
-rb_io_ungetbyte(VALUE io, VALUE b)
-{
- rb_io_t *fptr;
-
- GetOpenFile(io, fptr);
- rb_io_check_readable(fptr);
- io_unset_eof(fptr);
- 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;
-}
-
-/*
- * call-seq:
- * ios.ungetc(string) => nil
- *
+ * ios.ungetc(integer) => nil
+ *
* Pushes back one character (passed as a parameter) onto <em>ios</em>,
* such that a subsequent buffered 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 <code>IO#sysread</code>).
- *
+ *
* f = File.new("testfile") #=> #<File:testfile>
- * c = f.getc #=> "8"
+ * c = f.getc #=> 84
* f.ungetc(c) #=> nil
- * f.getc #=> "8"
+ * f.getc #=> 84
*/
VALUE
-rb_io_ungetc(VALUE io, VALUE c)
+rb_io_ungetc(io, c)
+ VALUE io, c;
{
rb_io_t *fptr;
- long len;
+ int cc = NUM2INT(c);
GetOpenFile(io, fptr);
+ if (!(fptr->mode & FMODE_RBUF))
+ rb_raise(rb_eIOError, "unread stream");
rb_io_check_readable(fptr);
- io_unset_eof(fptr);
- if (NIL_P(c)) return Qnil;
- if (FIXNUM_P(c)) {
- int cc = FIX2INT(c);
- rb_encoding *enc = io_read_encoding(fptr);
- char buf[16];
- c = rb_str_new(buf, rb_enc_mbcput(cc, buf, enc));
- }
- else {
- SafeStringValue(c);
- }
- if (NEED_READCONV(fptr)) {
- len = RSTRING_LEN(c);
-#if SIZEOF_LONG > SIZEOF_INT
- if (len > INT_MAX)
- rb_raise(rb_eIOError, "ungetc failed");
-#endif
- make_readconv(fptr, (int)len);
- if (fptr->cbuf_capa - fptr->cbuf_len < len)
- rb_raise(rb_eIOError, "ungetc failed");
- if (fptr->cbuf_off < len) {
- MEMMOVE(fptr->cbuf+fptr->cbuf_capa-fptr->cbuf_len,
- fptr->cbuf+fptr->cbuf_off,
- char, fptr->cbuf_len);
- fptr->cbuf_off = fptr->cbuf_capa-fptr->cbuf_len;
- }
- fptr->cbuf_off -= (int)len;
- fptr->cbuf_len += (int)len;
- MEMMOVE(fptr->cbuf+fptr->cbuf_off, RSTRING_PTR(c), char, len);
- }
- else {
- io_ungetbyte(c, fptr);
+ if (ungetc(cc, fptr->f) == EOF && cc != EOF) {
+ rb_raise(rb_eIOError, "ungetc failed");
}
return Qnil;
}
@@ -3146,248 +2245,75 @@ rb_io_ungetc(VALUE io, VALUE c)
* call-seq:
* ios.isatty => true or false
* ios.tty? => true or false
- *
+ *
* Returns <code>true</code> if <em>ios</em> is associated with a
* terminal device (tty), <code>false</code> otherwise.
- *
+ *
* File.new("testfile").isatty #=> false
* File.new("/dev/tty").isatty #=> true
*/
static VALUE
-rb_io_isatty(VALUE io)
+rb_io_isatty(io)
+ VALUE io;
{
rb_io_t *fptr;
GetOpenFile(io, fptr);
- if (isatty(fptr->fd) == 0)
+ if (isatty(fileno(fptr->f)) == 0)
return Qfalse;
return Qtrue;
}
-#if defined(HAVE_FCNTL) && defined(F_GETFD) && defined(F_SETFD) && defined(FD_CLOEXEC)
-/*
- * call-seq:
- * ios.close_on_exec? => true or false
- *
- * Returns <code>true</code> if <em>ios</em> will be closed on exec.
- *
- * f = open("/dev/null")
- * f.close_on_exec? #=> false
- * f.close_on_exec = true
- * f.close_on_exec? #=> true
- * f.close_on_exec = false
- * f.close_on_exec? #=> false
- */
-
-static VALUE
-rb_io_close_on_exec_p(VALUE io)
-{
- rb_io_t *fptr;
- VALUE write_io;
- int fd, ret;
-
- write_io = GetWriteIO(io);
- if (io != write_io) {
- GetOpenFile(write_io, fptr);
- if (fptr && 0 <= (fd = fptr->fd)) {
- if ((ret = fcntl(fd, F_GETFD)) == -1) rb_sys_fail_path(fptr->pathv);
- if (!(ret & FD_CLOEXEC)) return Qfalse;
- }
- }
-
- GetOpenFile(io, fptr);
- if (fptr && 0 <= (fd = fptr->fd)) {
- if ((ret = fcntl(fd, F_GETFD)) == -1) rb_sys_fail_path(fptr->pathv);
- if (!(ret & FD_CLOEXEC)) return Qfalse;
- }
- return Qtrue;
-}
-#else
-#define rb_io_close_on_exec_p rb_f_notimplement
-#endif
-
-#if defined(HAVE_FCNTL) && defined(F_GETFD) && defined(F_SETFD) && defined(FD_CLOEXEC)
-/*
- * call-seq:
- * ios.close_on_exec = bool => true or false
- *
- * Sets a close-on-exec flag.
- *
- * f = open("/dev/null")
- * f.close_on_exec = true
- * system("cat", "/proc/self/fd/#{f.fileno}") # cat: /proc/self/fd/3: No such file or directory
- * f.closed? #=> false
- */
-
-static VALUE
-rb_io_set_close_on_exec(VALUE io, VALUE arg)
-{
- int flag = RTEST(arg) ? FD_CLOEXEC : 0;
- rb_io_t *fptr;
- VALUE write_io;
- int fd, ret;
-
- write_io = GetWriteIO(io);
- if (io != write_io) {
- GetOpenFile(write_io, fptr);
- if (fptr && 0 <= (fd = fptr->fd)) {
- if ((ret = fcntl(fptr->fd, F_GETFD)) == -1) rb_sys_fail_path(fptr->pathv);
- if ((ret & FD_CLOEXEC) != flag) {
- ret = (ret & ~FD_CLOEXEC) | flag;
- ret = fcntl(fd, F_SETFD, ret);
- if (ret == -1) rb_sys_fail_path(fptr->pathv);
- }
- }
-
- }
-
- GetOpenFile(io, fptr);
- if (fptr && 0 <= (fd = fptr->fd)) {
- if ((ret = fcntl(fd, F_GETFD)) == -1) rb_sys_fail_path(fptr->pathv);
- if ((ret & FD_CLOEXEC) != flag) {
- ret = (ret & ~FD_CLOEXEC) | flag;
- ret = fcntl(fd, F_SETFD, ret);
- if (ret == -1) rb_sys_fail_path(fptr->pathv);
- }
- }
- return Qnil;
-}
-#else
-#define rb_io_set_close_on_exec rb_f_notimplement
-#endif
-
-#define FMODE_PREP (1<<16)
-#define IS_PREP_STDIO(f) ((f)->mode & FMODE_PREP)
-#define PREP_STDIO_NAME(f) (RSTRING_PTR((f)->pathv))
-
-static VALUE
-finish_writeconv(rb_io_t *fptr, int noalloc)
-{
- unsigned char *ds, *dp, *de;
- rb_econv_result_t res;
-
- if (!fptr->wbuf) {
- unsigned char buf[1024];
- long r;
-
- res = econv_destination_buffer_full;
- while (res == econv_destination_buffer_full) {
- ds = dp = buf;
- de = buf + sizeof(buf);
- res = rb_econv_convert(fptr->writeconv, NULL, NULL, &dp, de, 0);
- while (dp-ds) {
- retry:
- r = rb_write_internal(fptr->fd, ds, dp-ds);
- if (r == dp-ds)
- break;
- if (0 <= r) {
- ds += r;
- }
- if (rb_io_wait_writable(fptr->fd)) {
- if (fptr->fd < 0)
- return noalloc ? Qtrue : rb_exc_new3(rb_eIOError, rb_str_new_cstr("closed stream"));
- goto retry;
- }
- return noalloc ? Qtrue : INT2NUM(errno);
- }
- if (res == econv_invalid_byte_sequence ||
- res == econv_incomplete_input ||
- res == econv_undefined_conversion) {
- return noalloc ? Qtrue : rb_econv_make_exception(fptr->writeconv);
- }
- }
-
- return Qnil;
- }
-
- res = econv_destination_buffer_full;
- while (res == econv_destination_buffer_full) {
- if (fptr->wbuf_len == fptr->wbuf_capa) {
- if (io_fflush(fptr) < 0)
- return noalloc ? Qtrue : INT2NUM(errno);
- }
-
- ds = dp = (unsigned char *)fptr->wbuf + fptr->wbuf_off + fptr->wbuf_len;
- de = (unsigned char *)fptr->wbuf + fptr->wbuf_capa;
- res = rb_econv_convert(fptr->writeconv, NULL, NULL, &dp, de, 0);
- fptr->wbuf_len += (int)(dp - ds);
- if (res == econv_invalid_byte_sequence ||
- res == econv_incomplete_input ||
- res == econv_undefined_conversion) {
- return noalloc ? Qtrue : rb_econv_make_exception(fptr->writeconv);
- }
- }
- return Qnil;
-}
-
-struct finish_writeconv_arg {
+static void
+fptr_finalize(fptr, noraise)
rb_io_t *fptr;
- int noalloc;
-};
-
-static VALUE
-finish_writeconv_sync(VALUE arg)
+ int noraise;
{
- struct finish_writeconv_arg *p = (struct finish_writeconv_arg *)arg;
- return finish_writeconv(p->fptr, p->noalloc);
-}
+ int n1 = 0, n2 = 0, f1, f2 = -1;
-static void
-fptr_finalize(rb_io_t *fptr, int noraise)
-{
- VALUE err = Qnil;
- if (fptr->writeconv) {
- if (fptr->write_lock) {
- struct finish_writeconv_arg arg;
- arg.fptr = fptr;
- arg.noalloc = noraise;
- err = rb_mutex_synchronize(fptr->write_lock, finish_writeconv_sync, (VALUE)&arg);
+ errno = 0;
+ if (fptr->f2) {
+ f2 = fileno(fptr->f2);
+ while (n2 = 0, fflush(fptr->f2) < 0) {
+ n2 = errno;
+ if (!rb_io_wait_writable(f2)) {
+ break;
+ }
+ if (!fptr->f2) break;
}
- else {
- err = finish_writeconv(fptr, noraise);
+ if (fclose(fptr->f2) < 0 && n2 == 0) {
+ n2 = errno;
+ }
+ fptr->f2 = 0;
+ }
+ if (fptr->f) {
+ f1 = fileno(fptr->f);
+ if ((f2 == -1) && (fptr->mode & FMODE_WBUF)) {
+ while (n1 = 0, fflush(fptr->f) < 0) {
+ n1 = errno;
+ if (!rb_io_wait_writable(f1)) break;
+ if (!fptr->f) break;
+ }
+ }
+ if (fclose(fptr->f) < 0 && n1 == 0) {
+ n1 = errno;
+ }
+ fptr->f = 0;
+ if (n1 == EBADF && f1 == f2) {
+ n1 = 0;
}
}
- if (fptr->wbuf_len) {
- if (io_fflush(fptr) < 0 && NIL_P(err))
- err = noraise ? Qtrue : INT2NUM(errno);
- }
- if (IS_PREP_STDIO(fptr) || fptr->fd <= 2) {
- goto skip_fd_close;
- }
- if (fptr->stdio_file) {
- /* fptr->stdio_file is deallocated anyway
- * even if fclose failed. */
- if (fclose(fptr->stdio_file) < 0 && NIL_P(err))
- err = noraise ? Qtrue : INT2NUM(errno);
- }
- else if (0 <= fptr->fd) {
- /* fptr->fd may be closed even if close fails.
- * POSIX doesn't specify it.
- * We assumes it is closed. */
- if (close(fptr->fd) < 0 && NIL_P(err))
- err = noraise ? Qtrue : INT2NUM(errno);
- }
- skip_fd_close:
- fptr->fd = -1;
- fptr->stdio_file = 0;
- fptr->mode &= ~(FMODE_READABLE|FMODE_WRITABLE);
-
- if (!NIL_P(err) && !noraise) {
- switch(TYPE(err)) {
- case T_FIXNUM:
- case T_BIGNUM:
- errno = NUM2INT(err);
- rb_sys_fail_path(fptr->pathv);
-
- default:
- rb_exc_raise(err);
- }
+ if (!noraise && (n1 || n2)) {
+ errno = (n1 ? n1 : n2);
+ rb_sys_fail(fptr->path);
}
}
static void
-rb_io_fptr_cleanup(rb_io_t *fptr, int noraise)
+rb_io_fptr_cleanup(fptr, noraise)
+ rb_io_t *fptr;
+ int noraise;
{
if (fptr->finalize) {
(*fptr->finalize)(fptr, noraise);
@@ -3397,94 +2323,41 @@ rb_io_fptr_cleanup(rb_io_t *fptr, int noraise)
}
}
-static void
-clear_readconv(rb_io_t *fptr)
-{
- if (fptr->readconv) {
- rb_econv_close(fptr->readconv);
- fptr->readconv = NULL;
- }
- if (fptr->cbuf) {
- free(fptr->cbuf);
- fptr->cbuf = NULL;
- }
-}
-
-static void
-clear_writeconv(rb_io_t *fptr)
+void
+rb_io_fptr_finalize(fptr)
+ rb_io_t *fptr;
{
- if (fptr->writeconv) {
- rb_econv_close(fptr->writeconv);
- fptr->writeconv = NULL;
+ if (!fptr) return;
+ if (fptr->path) {
+ free(fptr->path);
}
- fptr->writeconv_initialized = 0;
-}
-
-static void
-clear_codeconv(rb_io_t *fptr)
-{
- clear_readconv(fptr);
- clear_writeconv(fptr);
-}
-
-int
-rb_io_fptr_finalize(rb_io_t *fptr)
-{
- if (!fptr) return 0;
- fptr->pathv = Qnil;
- fptr->write_lock = 0;
- if (0 <= fptr->fd)
- rb_io_fptr_cleanup(fptr, Qtrue);
- if (fptr->rbuf) {
- free(fptr->rbuf);
- fptr->rbuf = 0;
- }
- if (fptr->wbuf) {
- free(fptr->wbuf);
- fptr->wbuf = 0;
- }
- clear_codeconv(fptr);
- free(fptr);
- return 1;
-}
+ if (!fptr->f && !fptr->f2) return;
+ if (fileno(fptr->f) < 3) return;
-size_t rb_econv_memsize(rb_econv_t *);
-
-size_t
-rb_io_memsize(rb_io_t *fptr)
-{
- size_t size = sizeof(rb_io_t);
- size += fptr->rbuf_capa;
- size += fptr->wbuf_capa;
- size += fptr->cbuf_capa;
- if (fptr->readconv) size += rb_econv_memsize(fptr->readconv);
- if (fptr->writeconv) size += rb_econv_memsize(fptr->writeconv);
- return size;
+ rb_io_fptr_cleanup(fptr, Qtrue);
}
VALUE
-rb_io_close(VALUE io)
+rb_io_close(io)
+ VALUE io;
{
rb_io_t *fptr;
- int fd;
- VALUE write_io;
- rb_io_t *write_fptr;
-
- write_io = GetWriteIO(io);
- if (io != write_io) {
- write_fptr = RFILE(write_io)->fptr;
- if (write_fptr && 0 <= write_fptr->fd) {
- rb_io_fptr_cleanup(write_fptr, Qtrue);
- }
- }
+ int fd, fd2;
fptr = RFILE(io)->fptr;
if (!fptr) return Qnil;
- if (fptr->fd < 0) return Qnil;
+ if (fptr->f2) {
+ fd2 = fileno(fptr->f2);
+ }
+ else {
+ if (!fptr->f) return Qnil;
+ fd2 = -1;
+ }
- fd = fptr->fd;
+ fd = fileno(fptr->f);
rb_io_fptr_cleanup(fptr, Qfalse);
rb_thread_fd_close(fd);
+ if (fd2 >= 0) rb_thread_fd_close(fd2);
if (fptr->pid) {
rb_syswait(fptr->pid);
@@ -3497,7 +2370,7 @@ rb_io_close(VALUE io)
/*
* call-seq:
* ios.close => nil
- *
+ *
* Closes <em>ios</em> and flushes any pending writes to the operating
* system. The stream is unavailable for any further data operations;
* an <code>IOError</code> is raised if such an attempt is made. I/O
@@ -3509,9 +2382,10 @@ rb_io_close(VALUE io)
*/
static VALUE
-rb_io_close_m(VALUE io)
+rb_io_close_m(io)
+ VALUE io;
{
- if (rb_safe_level() >= 4 && !OBJ_UNTRUSTED(io)) {
+ if (rb_safe_level() >= 4 && !OBJ_TAINTED(io)) {
rb_raise(rb_eSecurityError, "Insecure: can't close");
}
rb_io_check_closed(RFILE(io)->fptr);
@@ -3520,13 +2394,15 @@ rb_io_close_m(VALUE io)
}
static VALUE
-io_call_close(VALUE io)
+io_call_close(io)
+ VALUE io;
{
return rb_funcall(io, rb_intern("close"), 0, 0);
}
static VALUE
-io_close(VALUE io)
+io_close(io)
+ VALUE io;
{
return rb_rescue(io_call_close, io, 0, 0);
}
@@ -3534,11 +2410,11 @@ io_close(VALUE io)
/*
* call-seq:
* ios.closed? => true or false
- *
+ *
* Returns <code>true</code> if <em>ios</em> is completely closed (for
* duplex streams, both reader and writer), <code>false</code>
* otherwise.
- *
+ *
* f = File.new("testfile")
* f.close #=> nil
* f.closed? #=> true
@@ -3549,154 +2425,123 @@ io_close(VALUE io)
* f.closed? #=> true
*/
-
static VALUE
-rb_io_closed(VALUE io)
+rb_io_closed(io)
+ VALUE io;
{
rb_io_t *fptr;
- VALUE write_io;
- rb_io_t *write_fptr;
-
- write_io = GetWriteIO(io);
- if (io != write_io) {
- write_fptr = RFILE(write_io)->fptr;
- if (write_fptr && 0 <= write_fptr->fd) {
- return Qfalse;
- }
- }
fptr = RFILE(io)->fptr;
rb_io_check_initialized(fptr);
- return 0 <= fptr->fd ? Qfalse : Qtrue;
+ return (fptr->f || fptr->f2)?Qfalse:Qtrue;
}
/*
* call-seq:
* ios.close_read => nil
- *
+ *
* 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
* <code>IOError</code> if the stream is not duplexed.
- *
+ *
* f = IO.popen("/bin/sh","r+")
* f.close_read
* f.readlines
- *
+ *
* <em>produces:</em>
- *
+ *
* prog.rb:3:in `readlines': not opened for reading (IOError)
* from prog.rb:3
*/
static VALUE
-rb_io_close_read(VALUE io)
+rb_io_close_read(io)
+ VALUE io;
{
rb_io_t *fptr;
- VALUE write_io;
+ int n;
- if (rb_safe_level() >= 4 && !OBJ_UNTRUSTED(io)) {
+ if (rb_safe_level() >= 4 && !OBJ_TAINTED(io)) {
rb_raise(rb_eSecurityError, "Insecure: can't close");
}
GetOpenFile(io, fptr);
- if (is_socket(fptr->fd, fptr->pathv)) {
-#ifndef SHUT_RD
-# define SHUT_RD 0
-#endif
- if (shutdown(fptr->fd, SHUT_RD) < 0)
- rb_sys_fail_path(fptr->pathv);
- fptr->mode &= ~FMODE_READABLE;
- if (!(fptr->mode & FMODE_WRITABLE))
- return rb_io_close(io);
- return Qnil;
+ if (fptr->f2 == 0 && (fptr->mode & FMODE_WRITABLE)) {
+ rb_raise(rb_eIOError, "closing non-duplex IO for reading");
}
-
- write_io = GetWriteIO(io);
- if (io != write_io) {
- rb_io_t *wfptr;
- rb_io_fptr_cleanup(fptr, Qfalse);
- GetOpenFile(write_io, wfptr);
- RFILE(io)->fptr = wfptr;
- RFILE(write_io)->fptr = NULL;
- rb_io_fptr_finalize(fptr);
- return Qnil;
+ if (fptr->f2 == 0) {
+ return rb_io_close(io);
}
+ n = fclose(fptr->f);
+ fptr->mode &= ~FMODE_READABLE;
+ fptr->f = fptr->f2;
+ fptr->f2 = 0;
+ if (n != 0) rb_sys_fail(fptr->path);
- if (fptr->mode & FMODE_WRITABLE) {
- rb_raise(rb_eIOError, "closing non-duplex IO for reading");
- }
- return rb_io_close(io);
+ return Qnil;
}
/*
* call-seq:
* ios.close_write => nil
- *
+ *
* 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
* <code>IOError</code> if the stream is not duplexed.
- *
+ *
* f = IO.popen("/bin/sh","r+")
* f.close_write
* f.print "nowhere"
- *
+ *
* <em>produces:</em>
- *
+ *
* prog.rb:3:in `write': not opened for writing (IOError)
* from prog.rb:3:in `print'
* from prog.rb:3
*/
static VALUE
-rb_io_close_write(VALUE io)
+rb_io_close_write(io)
+ VALUE io;
{
rb_io_t *fptr;
- VALUE write_io;
+ int n;
- if (rb_safe_level() >= 4 && !OBJ_UNTRUSTED(io)) {
+ if (rb_safe_level() >= 4 && !OBJ_TAINTED(io)) {
rb_raise(rb_eSecurityError, "Insecure: can't close");
}
- write_io = GetWriteIO(io);
- GetOpenFile(write_io, fptr);
- if (is_socket(fptr->fd, fptr->pathv)) {
-#ifndef SHUT_WR
-# define SHUT_WR 1
-#endif
- if (shutdown(fptr->fd, SHUT_WR) < 0)
- rb_sys_fail_path(fptr->pathv);
- fptr->mode &= ~FMODE_WRITABLE;
- if (!(fptr->mode & FMODE_READABLE))
- return rb_io_close(write_io);
- return Qnil;
- }
-
- if (fptr->mode & FMODE_READABLE) {
+ GetOpenFile(io, fptr);
+ if (fptr->f2 == 0 && (fptr->mode & FMODE_READABLE)) {
rb_raise(rb_eIOError, "closing non-duplex IO for writing");
}
-
- rb_io_close(write_io);
- if (io != write_io) {
- GetOpenFile(io, fptr);
- fptr->tied_io_for_writing = 0;
- fptr->mode &= ~FMODE_DUPLEX;
+ if (fptr->f2 == 0) {
+ return rb_io_close(io);
}
+ n = fclose(fptr->f2);
+ fptr->f2 = 0;
+ fptr->mode &= ~FMODE_WRITABLE;
+ if (n != 0) rb_sys_fail(fptr->path);
+
return Qnil;
}
/*
* call-seq:
* ios.sysseek(offset, whence=SEEK_SET) => integer
- *
+ *
* Seeks to a given <i>offset</i> in the stream according to the value
* 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
* f.sysread(10) #=> "And so on."
*/
static VALUE
-rb_io_sysseek(int argc, VALUE *argv, VALUE io)
+rb_io_sysseek(argc, argv, io)
+ int argc;
+ VALUE *argv;
+ VALUE io;
{
VALUE offset, ptrname;
int whence = SEEK_SET;
@@ -3708,14 +2553,15 @@ rb_io_sysseek(int argc, VALUE *argv, VALUE io)
}
pos = NUM2OFFT(offset);
GetOpenFile(io, fptr);
- if ((fptr->mode & FMODE_READABLE) && READ_DATA_BUFFERED(fptr)) {
+ if ((fptr->mode & FMODE_READABLE) && READ_DATA_BUFFERED(fptr->f)) {
rb_raise(rb_eIOError, "sysseek for buffered IO");
}
- if ((fptr->mode & FMODE_WRITABLE) && fptr->wbuf_len) {
+ if ((fptr->mode & FMODE_WRITABLE) && (fptr->mode & FMODE_WBUF)) {
rb_warn("sysseek for buffered IO");
}
- pos = lseek(fptr->fd, pos, whence);
- if (pos == -1) rb_sys_fail_path(fptr->pathv);
+ pos = lseek(fileno(fptr->f), pos, whence);
+ if (pos == -1) rb_sys_fail(fptr->path);
+ clearerr(fptr->f);
return OFFT2NUM(pos);
}
@@ -3723,62 +2569,66 @@ rb_io_sysseek(int argc, VALUE *argv, VALUE io)
/*
* call-seq:
* ios.syswrite(string) => integer
- *
+ *
* 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 <code>SystemCallError</code> on error.
- *
+ *
* f = File.new("out", "w")
* f.syswrite("ABCDEF") #=> 6
*/
static VALUE
-rb_io_syswrite(VALUE io, VALUE str)
+rb_io_syswrite(io, str)
+ VALUE io, str;
{
rb_io_t *fptr;
+ FILE *f;
long n;
rb_secure(4);
if (TYPE(str) != T_STRING)
str = rb_obj_as_string(str);
- io = GetWriteIO(io);
GetOpenFile(io, fptr);
rb_io_check_writable(fptr);
+ f = GetWriteFile(fptr);
- if (fptr->wbuf_len) {
+ if (fptr->mode & FMODE_WBUF) {
rb_warn("syswrite for buffered IO");
}
- if (!rb_thread_fd_writable(fptr->fd)) {
+ if (!rb_thread_fd_writable(fileno(f))) {
rb_io_check_closed(fptr);
}
+ TRAP_BEG;
+ n = write(fileno(f), RSTRING(str)->ptr, RSTRING(str)->len);
+ TRAP_END;
- n = write(fptr->fd, RSTRING_PTR(str), RSTRING_LEN(str));
-
- if (n == -1) rb_sys_fail_path(fptr->pathv);
+ if (n == -1) rb_sys_fail(fptr->path);
return LONG2FIX(n);
}
/*
* call-seq:
- * ios.sysread(integer[, outbuf]) => string
- *
+ * ios.sysread(integer ) => string
+ *
* Reads <i>integer</i> bytes from <em>ios</em> using a low-level
* read and returns them as a string. Do not mix with other methods
* that read from <em>ios</em> or you may get unpredictable results.
- * If the optional <i>outbuf</i> argument is present, it must reference
- * a String, which will receive the data.
* 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"
*/
static VALUE
-rb_io_sysread(int argc, VALUE *argv, VALUE io)
+rb_io_sysread(argc, argv, io)
+ int argc;
+ VALUE *argv;
+ VALUE io;
{
VALUE len, str;
rb_io_t *fptr;
@@ -3800,296 +2650,239 @@ rb_io_sysread(int argc, VALUE *argv, VALUE io)
GetOpenFile(io, fptr);
rb_io_check_readable(fptr);
- if (READ_DATA_BUFFERED(fptr)) {
+ if (READ_DATA_BUFFERED(fptr->f)) {
rb_raise(rb_eIOError, "sysread for buffered IO");
}
+ rb_str_locktmp(str);
- n = fptr->fd;
- rb_thread_wait_fd(fptr->fd);
+ n = fileno(fptr->f);
+ rb_thread_wait_fd(fileno(fptr->f));
rb_io_check_closed(fptr);
- if (RSTRING_LEN(str) != ilen) {
+ if (RSTRING(str)->len != ilen) {
rb_raise(rb_eRuntimeError, "buffer string modified");
}
+ TRAP_BEG;
+ n = read(fileno(fptr->f), RSTRING(str)->ptr, ilen);
+ TRAP_END;
- n = rb_read_internal(fptr->fd, RSTRING_PTR(str), ilen);
-
+ rb_str_unlocktmp(str);
if (n == -1) {
- rb_sys_fail_path(fptr->pathv);
+ rb_sys_fail(fptr->path);
}
- rb_str_set_len(str, n);
+ rb_str_resize(str, n);
if (n == 0 && ilen > 0) {
rb_eof_error();
}
- rb_str_resize(str, n);
+ RSTRING(str)->len = n;
+ RSTRING(str)->ptr[n] = '\0';
OBJ_TAINT(str);
return str;
}
-VALUE
-rb_io_binmode(VALUE io)
-{
- rb_io_t *fptr;
-
- GetOpenFile(io, fptr);
- if (fptr->readconv)
- rb_econv_binmode(fptr->readconv);
- if (fptr->writeconv)
- rb_econv_binmode(fptr->writeconv);
- fptr->mode |= FMODE_BINMODE;
- fptr->mode &= ~FMODE_TEXTMODE;
- fptr->writeconv_pre_ecflags &= ~(ECONV_UNIVERSAL_NEWLINE_DECORATOR|ECONV_CRLF_NEWLINE_DECORATOR|ECONV_CR_NEWLINE_DECORATOR);
- return io;
-}
-
-VALUE
-rb_io_ascii8bit_binmode(VALUE io)
-{
- rb_io_t *fptr;
-
- GetOpenFile(io, fptr);
- if (fptr->readconv) {
- rb_econv_close(fptr->readconv);
- fptr->readconv = NULL;
- }
- if (fptr->writeconv) {
- rb_econv_close(fptr->writeconv);
- fptr->writeconv = NULL;
- }
- fptr->mode |= FMODE_BINMODE;
- fptr->mode &= ~FMODE_TEXTMODE;
-
- fptr->encs.enc = rb_ascii8bit_encoding();
- fptr->encs.enc2 = NULL;
- fptr->encs.ecflags = 0;
- fptr->encs.ecopts = Qnil;
- clear_codeconv(fptr);
-
- return io;
-}
-
/*
* call-seq:
* ios.binmode => ios
- *
- * Puts <em>ios</em> into binary mode.
- * Once a stream is in binary mode, it cannot be reset to nonbinary mode.
- *
- * - newline conversion disabled
- * - encoding conversion disabled
- * - content is treated as ASCII-8BIT
- *
+ *
+ * Puts <em>ios</em> into binary mode. This is useful only in
+ * MS-DOS/Windows environments. Once a stream is in binary mode, it
+ * cannot be reset to nonbinary mode.
*/
-static VALUE
-rb_io_binmode_m(VALUE io)
+VALUE
+rb_io_binmode(io)
+ VALUE io;
{
- VALUE write_io;
+#if defined(_WIN32) || defined(DJGPP) || defined(__CYGWIN__) || defined(__human68k__) || defined(__EMX__)
+ rb_io_t *fptr;
- rb_io_ascii8bit_binmode(io);
+ GetOpenFile(io, fptr);
+#ifdef __human68k__
+ if (fptr->f)
+ fmode(fptr->f, _IOBIN);
+ if (fptr->f2)
+ fmode(fptr->f2, _IOBIN);
+#else
+ if (fptr->f && setmode(fileno(fptr->f), O_BINARY) == -1)
+ rb_sys_fail(fptr->path);
+ if (fptr->f2 && setmode(fileno(fptr->f2), O_BINARY) == -1)
+ rb_sys_fail(fptr->path);
+#endif
- write_io = GetWriteIO(io);
- if (write_io != io)
- rb_io_ascii8bit_binmode(write_io);
+ fptr->mode |= FMODE_BINMODE;
+#endif
return io;
}
-/*
- * call-seq:
- * ios.binmode? => true or false
- *
- * Returns <code>true</code> if <em>ios</em> is binmode.
- */
-static VALUE
-rb_io_binmode_p(VALUE io)
-{
- rb_io_t *fptr;
- GetOpenFile(io, fptr);
- return fptr->mode & FMODE_BINMODE ? Qtrue : Qfalse;
-}
-
-static const char*
-rb_io_fmode_modestr(int fmode)
+const char*
+rb_io_flags_mode(flags)
+ int flags;
{
-# define MODE_BTMODE(a,b,c) ((fmode & FMODE_BINMODE) ? (b) : \
- (fmode & FMODE_TEXTMODE) ? (c) : (a))
- if (fmode & FMODE_APPEND) {
- if ((fmode & FMODE_READWRITE) == FMODE_READWRITE) {
- return MODE_BTMODE("a+", "ab+", "at+");
+#ifdef O_BINARY
+# define MODE_BINMODE(a,b) ((flags & FMODE_BINMODE) ? (b) : (a))
+#else
+# define MODE_BINMODE(a,b) (a)
+#endif
+ if (flags & FMODE_APPEND) {
+ if ((flags & FMODE_READWRITE) == FMODE_READWRITE) {
+ return MODE_BINMODE("a+", "ab+");
}
- return MODE_BTMODE("a", "ab", "at");
+ return MODE_BINMODE("a", "ab");
}
- switch (fmode & FMODE_READWRITE) {
+ switch (flags & FMODE_READWRITE) {
case FMODE_READABLE:
- return MODE_BTMODE("r", "rb", "rt");
+ return MODE_BINMODE("r", "rb");
case FMODE_WRITABLE:
- return MODE_BTMODE("w", "wb", "wt");
+ return MODE_BINMODE("w", "wb");
case FMODE_READWRITE:
- if (fmode & FMODE_CREATE) {
- return MODE_BTMODE("w+", "wb+", "wt+");
+ if (flags & FMODE_CREATE) {
+ return MODE_BINMODE("w+", "wb+");
}
- return MODE_BTMODE("r+", "rb+", "rt+");
+ return MODE_BINMODE("r+", "rb+");
}
- rb_raise(rb_eArgError, "invalid access fmode 0x%x", fmode);
+ rb_raise(rb_eArgError, "illegal access modenum %o", flags);
return NULL; /* not reached */
}
-static int
-io_encname_bom_p(const char *name, long len)
-{
- if (len) {
- if (len > 4 && STRNCASECMP(name + len - 4, "-bom", 4) == 0)
- return 1;
- }
- else {
- const char *p = strchr(name, ':');
- if (!p) p = name + strlen(name);
- if (p - name > 4 && STRNCASECMP(p - 4, "-bom", 4) == 0)
- return 1;
- }
- return 0;
-}
-
int
-rb_io_modestr_fmode(const char *modestr)
+rb_io_mode_flags(mode)
+ const char *mode;
{
- int fmode = 0;
- const char *m = modestr, *p = NULL;
+ int flags = 0;
+ const char *m = mode;
switch (*m++) {
case 'r':
- fmode |= FMODE_READABLE;
+ flags |= FMODE_READABLE;
break;
case 'w':
- fmode |= FMODE_WRITABLE | FMODE_TRUNC | FMODE_CREATE;
+ flags |= FMODE_WRITABLE | FMODE_CREATE;
break;
case 'a':
- fmode |= FMODE_WRITABLE | FMODE_APPEND | FMODE_CREATE;
+ flags |= FMODE_WRITABLE | FMODE_APPEND | FMODE_CREATE;
break;
default:
error:
- rb_raise(rb_eArgError, "invalid access mode %s", modestr);
+ rb_raise(rb_eArgError, "illegal access mode %s", mode);
}
while (*m) {
switch (*m++) {
- case 'b':
- fmode |= FMODE_BINMODE;
- break;
- case 't':
- fmode |= FMODE_TEXTMODE;
+ case 'b':
+ flags |= FMODE_BINMODE;
break;
- case '+':
- fmode |= FMODE_READWRITE;
+ case '+':
+ flags |= FMODE_READWRITE;
break;
- default:
+ case ':':
+ /* forward compatibility */
+ rb_warning("encoding options not supported in 1.8: %s", mode);
+ goto end;
+ default:
goto error;
- case ':':
- p = m;
- goto finished;
}
}
- finished:
- if ((fmode & FMODE_BINMODE) && (fmode & FMODE_TEXTMODE))
- goto error;
- if (p && io_encname_bom_p(p, 0))
- fmode |= FMODE_STRIP_BOM;
-
- return fmode;
+ end:
+ return flags;
}
int
-rb_io_oflags_fmode(int oflags)
+rb_io_modenum_flags(mode)
+ int mode;
{
- int fmode = 0;
+ int flags = 0;
- switch (oflags & (O_RDONLY|O_WRONLY|O_RDWR)) {
+ switch (mode & (O_RDONLY|O_WRONLY|O_RDWR)) {
case O_RDONLY:
- fmode = FMODE_READABLE;
+ flags = FMODE_READABLE;
break;
case O_WRONLY:
- fmode = FMODE_WRITABLE;
+ flags = FMODE_WRITABLE;
break;
case O_RDWR:
- fmode = FMODE_READWRITE;
+ flags = FMODE_READWRITE;
break;
}
- if (oflags & O_APPEND) {
- fmode |= FMODE_APPEND;
- }
- if (oflags & O_TRUNC) {
- fmode |= FMODE_TRUNC;
+ if (mode & O_APPEND) {
+ flags |= FMODE_APPEND;
}
- if (oflags & O_CREAT) {
- fmode |= FMODE_CREATE;
+ if (mode & O_CREAT) {
+ flags |= FMODE_CREATE;
}
#ifdef O_BINARY
- if (oflags & O_BINARY) {
- fmode |= FMODE_BINMODE;
+ if (mode & O_BINARY) {
+ flags |= FMODE_BINMODE;
}
#endif
- return fmode;
+ return flags;
}
static int
-rb_io_fmode_oflags(int fmode)
+rb_io_mode_modenum(mode)
+ const char *mode;
{
- int oflags = 0;
+ int flags = 0;
+ const char *m = mode;
- switch (fmode & FMODE_READWRITE) {
- case FMODE_READABLE:
- oflags |= O_RDONLY;
- break;
- case FMODE_WRITABLE:
- oflags |= O_WRONLY;
- break;
- case FMODE_READWRITE:
- oflags |= O_RDWR;
- break;
+ switch (*m++) {
+ case 'r':
+ flags |= O_RDONLY;
+ break;
+ case 'w':
+ flags |= O_WRONLY | O_CREAT | O_TRUNC;
+ break;
+ case 'a':
+ flags |= O_WRONLY | O_CREAT | O_APPEND;
+ break;
+ default:
+ error:
+ rb_raise(rb_eArgError, "illegal access mode %s", mode);
}
- if (fmode & FMODE_APPEND) {
- oflags |= O_APPEND;
- }
- if (fmode & FMODE_TRUNC) {
- oflags |= O_TRUNC;
- }
- if (fmode & FMODE_CREATE) {
- oflags |= O_CREAT;
- }
+ while (*m) {
+ switch (*m++) {
+ case 'b':
#ifdef O_BINARY
- if (fmode & FMODE_BINMODE) {
- oflags |= O_BINARY;
- }
+ flags |= O_BINARY;
#endif
+ break;
+ case '+':
+ flags = (flags & ~O_ACCMODE) | O_RDWR;
+ break;
+ case ':':
+ /* forward compatibility */
+ rb_warning("encoding options not supported in 1.8: %s", mode);
+ goto end;
+ default:
+ goto error;
+ }
+ }
- return oflags;
+ end:
+ return flags;
}
-int
-rb_io_modestr_oflags(const char *modestr)
-{
- return rb_io_fmode_oflags(rb_io_modestr_fmode(modestr));
-}
+#define MODENUM_MAX 4
static const char*
-rb_io_oflags_modestr(int oflags)
+rb_io_modenum_mode(flags)
+ int flags;
{
#ifdef O_BINARY
-# define MODE_BINARY(a,b) ((oflags & O_BINARY) ? (b) : (a))
+# define MODE_BINARY(a,b) ((flags & O_BINARY) ? (b) : (a))
#else
# define MODE_BINARY(a,b) (a)
#endif
- if (oflags & O_APPEND) {
- if ((oflags & O_RDWR) == O_RDWR) {
+ if (flags & O_APPEND) {
+ if ((flags & O_RDWR) == O_RDWR) {
return MODE_BINARY("a+", "ab+");
}
return MODE_BINARY("a", "ab");
}
- switch (oflags & (O_RDONLY|O_WRONLY|O_RDWR)) {
+ switch (flags & (O_RDONLY|O_WRONLY|O_RDWR)) {
case O_RDONLY:
return MODE_BINARY("r", "rb");
case O_WRONLY:
@@ -4097,419 +2890,92 @@ rb_io_oflags_modestr(int oflags)
case O_RDWR:
return MODE_BINARY("r+", "rb+");
}
- rb_raise(rb_eArgError, "invalid access oflags 0x%x", oflags);
+ rb_raise(rb_eArgError, "illegal access modenum %o", flags);
return NULL; /* not reached */
}
-/*
- * Convert external/internal encodings to enc/enc2
- * NULL => use default encoding
- * Qnil => no encoding specified (internal only)
- */
-static void
-rb_io_ext_int_to_encs(rb_encoding *ext, rb_encoding *intern, rb_encoding **enc, rb_encoding **enc2)
-{
- int default_ext = 0;
-
- if (ext == NULL) {
- ext = rb_default_external_encoding();
- default_ext = 1;
- }
- if (intern == NULL && ext != rb_ascii8bit_encoding())
- /* If external is ASCII-8BIT, no default transcoding */
- intern = rb_default_internal_encoding();
- if (intern == NULL || intern == (rb_encoding *)Qnil || intern == ext) {
- /* No internal encoding => use external + no transcoding */
- *enc = (default_ext && intern != ext) ? NULL : ext;
- *enc2 = NULL;
- }
- else {
- *enc = intern;
- *enc2 = ext;
- }
-}
-
-static void
-parse_mode_enc(const char *estr, rb_encoding **enc_p, rb_encoding **enc2_p)
-{
- const char *p;
- char encname[ENCODING_MAXNAMELEN+1];
- int idx, idx2;
- rb_encoding *ext_enc, *int_enc;
-
- /* parse estr as "enc" or "enc2:enc" or "enc:-" */
-
- p = strrchr(estr, ':');
- if (p) {
- long len = (p++) - estr;
- if (len == 0 || len > ENCODING_MAXNAMELEN)
- idx = -1;
- else {
- if (io_encname_bom_p(estr, len))
- 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)) {
- len -= 4;
- memcpy(encname, estr, len);
- encname[len] = '\0';
- estr = encname;
- }
- idx = rb_enc_find_index(estr);
- }
-
- if (idx >= 0)
- ext_enc = rb_enc_from_index(idx);
- else {
- if (idx != -2)
- rb_warn("Unsupported encoding %s ignored", estr);
- ext_enc = NULL;
- }
-
- int_enc = NULL;
- if (p) {
- if (*p == '-' && *(p+1) == '\0') {
- /* Special case - "-" => no transcoding */
- int_enc = (rb_encoding *)Qnil;
- }
- else {
- idx2 = rb_enc_find_index(p);
- if (idx2 < 0)
- rb_warn("Unsupported encoding %s ignored", p);
- else if (idx2 == idx) {
- rb_warn("Ignoring internal encoding %s: it is identical to external encoding %s", p, estr);
- int_enc = (rb_encoding *)Qnil;
- }
- else
- int_enc = rb_enc_from_index(idx2);
- }
- }
-
- rb_io_ext_int_to_encs(ext_enc, int_enc, enc_p, enc2_p);
-}
-
-static void
-mode_enc(rb_io_t *fptr, const char *estr)
-{
- clear_codeconv(fptr);
-
- parse_mode_enc(estr, &fptr->encs.enc, &fptr->encs.enc2);
-}
-
-static void
-rb_io_mode_enc(rb_io_t *fptr, const char *modestr)
-{
- const char *p = strchr(modestr, ':');
- if (p) {
- mode_enc(fptr, p+1);
- }
-}
-
-int
-rb_io_extract_encoding_option(VALUE opt, rb_encoding **enc_p, rb_encoding **enc2_p)
-{
- VALUE encoding=Qnil, extenc=Qundef, intenc=Qundef, tmp;
- int extracted = 0;
- rb_encoding *extencoding = NULL;
- rb_encoding *intencoding = NULL;
-
- if (!NIL_P(opt)) {
- VALUE v;
- v = rb_hash_lookup2(opt, sym_encoding, Qnil);
- if (v != Qnil) encoding = v;
- v = rb_hash_lookup2(opt, sym_extenc, Qundef);
- if (v != Qnil) extenc = v;
- v = rb_hash_lookup2(opt, sym_intenc, Qundef);
- if (v != Qundef) intenc = v;
- }
- if ((extenc != Qundef || intenc != Qundef) && !NIL_P(encoding)) {
- rb_warn("Ignoring encoding parameter '%s': %s_encoding is used",
- StringValueCStr(encoding),
- extenc == Qundef ? "internal" : "external");
- encoding = Qnil;
- }
- if (extenc != Qundef && !NIL_P(extenc)) {
- extencoding = rb_to_encoding(extenc);
- }
- if (intenc != Qundef) {
- if (NIL_P(intenc)) {
- /* internal_encoding: nil => no transcoding */
- intencoding = (rb_encoding *)Qnil;
- }
- else if (!NIL_P(tmp = rb_check_string_type(intenc))) {
- char *p = StringValueCStr(tmp);
-
- if (*p == '-' && *(p+1) == '\0') {
- /* Special case - "-" => no transcoding */
- intencoding = (rb_encoding *)Qnil;
- }
- else {
- intencoding = rb_to_encoding(intenc);
- }
- }
- else {
- intencoding = rb_to_encoding(intenc);
- }
- if (extencoding == intencoding) {
- intencoding = (rb_encoding *)Qnil;
- }
- }
- if (!NIL_P(encoding)) {
- extracted = 1;
- parse_mode_enc(StringValueCStr(encoding), enc_p, enc2_p);
- }
- else if (extenc != Qundef || intenc != Qundef) {
- extracted = 1;
- rb_io_ext_int_to_encs(extencoding, intencoding, enc_p, enc2_p);
- }
- return extracted;
-}
-
-typedef struct rb_io_enc_t convconfig_t;
-
-static void
-validate_enc_binmode(int fmode, rb_encoding *enc, rb_encoding *enc2)
-{
- if ((fmode & FMODE_READABLE) &&
- !enc2 &&
- !(fmode & FMODE_BINMODE) &&
- !rb_enc_asciicompat(enc ? enc : rb_default_external_encoding()))
- rb_raise(rb_eArgError, "ASCII incompatible encoding needs binmode");
-}
-
-static void
-extract_binmode(VALUE opthash, int *fmode)
-{
- if (!NIL_P(opthash)) {
- VALUE v;
- v = rb_hash_aref(opthash, sym_textmode);
- if (!NIL_P(v) && RTEST(v))
- *fmode |= FMODE_TEXTMODE;
- v = rb_hash_aref(opthash, sym_binmode);
- if (!NIL_P(v) && RTEST(v))
- *fmode |= FMODE_BINMODE;
-
- if ((*fmode & FMODE_BINMODE) && (*fmode & FMODE_TEXTMODE))
- rb_raise(rb_eArgError, "both textmode and binmode specified");
- }
-}
-
-static void
-rb_io_extract_modeenc(VALUE *vmode_p, VALUE *vperm_p, VALUE opthash,
- int *oflags_p, int *fmode_p, convconfig_t *convconfig_p)
+static int
+rb_sysopen(fname, flags, mode)
+ char *fname;
+ int flags;
+ unsigned int mode;
{
- VALUE vmode;
- int oflags, fmode;
- rb_encoding *enc, *enc2;
- int ecflags;
- VALUE ecopts;
- int has_enc = 0, has_vmode = 0;
- VALUE intmode;
-
- vmode = *vmode_p;
-
- /* Set to defaults */
- rb_io_ext_int_to_encs(NULL, NULL, &enc, &enc2);
-
- if (NIL_P(vmode)) {
- fmode = FMODE_READABLE;
- oflags = O_RDONLY;
- }
- else if (!NIL_P(intmode = rb_check_to_integer(vmode, "to_int"))) {
- vmode = intmode;
- oflags = NUM2INT(intmode);
- fmode = rb_io_oflags_fmode(oflags);
- }
- else {
- const char *p;
-
- vmode_handle:
- SafeStringValue(vmode);
- p = StringValueCStr(vmode);
- fmode = rb_io_modestr_fmode(p);
- oflags = rb_io_fmode_oflags(fmode);
- p = strchr(p, ':');
- if (p) {
- has_enc = 1;
- parse_mode_enc(p+1, &enc, &enc2);
- if (io_encname_bom_p(p+1, 0))
- fmode |= FMODE_STRIP_BOM;
- }
- else {
- rb_encoding *e;
-
- e = (fmode & FMODE_BINMODE) ? rb_ascii8bit_encoding() : NULL;
- rb_io_ext_int_to_encs(e, NULL, &enc, &enc2);
- }
- }
+ int fd;
- if (NIL_P(opthash)) {
- ecflags = 0;
- ecopts = Qnil;
- }
- else {
- VALUE v;
- extract_binmode(opthash, &fmode);
-#ifdef O_BINARY
- if (fmode & FMODE_BINMODE)
- oflags |= O_BINARY;
-#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;
- }
+ fd = open(fname, flags, mode);
+ if (fd < 0) {
+ if (errno == EMFILE || errno == ENFILE) {
+ rb_gc();
+ fd = open(fname, flags, mode);
}
- v = rb_hash_aref(opthash, sym_perm);
- if (!NIL_P(v)) {
- if (vperm_p) {
- if (!NIL_P(*vperm_p)) {
- rb_raise(rb_eArgError, "perm specified twice");
- }
- *vperm_p = v;
- }
- else {
- /* perm no use, just ignore */
- }
+ if (fd < 0) {
+ rb_sys_fail(fname);
}
- ecflags = rb_econv_prepare_opts(opthash, &ecopts);
-
- if (rb_io_extract_encoding_option(opthash, &enc, &enc2)) {
- if (has_enc) {
- rb_raise(rb_eArgError, "encoding specified twice");
- }
- }
}
-
- validate_enc_binmode(fmode, enc, enc2);
-
- *vmode_p = vmode;
-
- *oflags_p = oflags;
- *fmode_p = fmode;
- convconfig_p->enc = enc;
- convconfig_p->enc2 = enc2;
- convconfig_p->ecflags = ecflags;
- convconfig_p->ecopts = ecopts;
+ return fd;
}
-struct sysopen_struct {
+FILE *
+rb_fopen(fname, mode)
const char *fname;
- int oflags;
- mode_t perm;
-#ifdef _WIN32
- int wchar;
-#endif
-};
-
-static VALUE
-sysopen_func(void *ptr)
-{
- struct sysopen_struct *data = ptr;
-#ifdef _WIN32
- if (data->wchar)
- return (VALUE)rb_w32_wopen((WCHAR *)data->fname, data->oflags,
- data->perm);
-#endif
- return (VALUE)open(data->fname, data->oflags, data->perm);
-}
-
-static int
-rb_sysopen_internal(VALUE fname, int oflags, mode_t perm)
+ const char *mode;
{
-#ifdef _WIN32
- static rb_encoding *utf16 = (rb_encoding *)-1;
-#endif
- struct sysopen_struct data;
- data.fname = RSTRING_PTR(fname);
- data.oflags = oflags;
- data.perm = perm;
-#ifdef _WIN32
- if (utf16 == (rb_encoding *)-1) {
- utf16 = rb_enc_find("UTF-16LE");
- if (utf16 == rb_ascii8bit_encoding())
- utf16 = NULL;
- }
- if (utf16) {
- VALUE wfname = rb_str_encode(fname, rb_enc_from_encoding(utf16), 0,
- Qnil);
- rb_enc_str_buf_cat(wfname, "", 1, utf16); /* workaround */
- data.fname = RSTRING_PTR(wfname);
- data.wchar = 1;
- }
- else {
- data.wchar = 0;
- }
-#endif
- return (int)rb_thread_blocking_region(sysopen_func, &data, RUBY_UBF_IO, 0);
-}
-
-static int
-rb_sysopen(VALUE fname, int oflags, mode_t perm)
-{
- int fd;
-
-#ifdef O_BINARY
- oflags |= O_BINARY;
-#endif
+ FILE *file;
- fd = rb_sysopen_internal(fname, oflags, perm);
- if (fd < 0) {
+ file = fopen(fname, mode);
+ if (!file) {
if (errno == EMFILE || errno == ENFILE) {
rb_gc();
- fd = rb_sysopen_internal(fname, oflags, perm);
+ file = fopen(fname, mode);
}
- if (fd < 0) {
- rb_sys_fail(RSTRING_PTR(fname));
+ if (!file) {
+ rb_sys_fail(fname);
}
}
- UPDATE_MAXFD(fd);
- return fd;
+#ifdef USE_SETVBUF
+ if (setvbuf(file, NULL, _IOFBF, 0) != 0)
+ rb_warn("setvbuf() can't be honoured for %s", fname);
+#endif
+#ifdef __human68k__
+ fmode(file, _IOTEXT);
+#endif
+ return file;
}
FILE *
-rb_fdopen(int fd, const char *modestr)
+rb_fdopen(fd, mode)
+ int fd;
+ const char *mode;
{
FILE *file;
#if defined(sun)
errno = 0;
#endif
- file = fdopen(fd, modestr);
+ file = fdopen(fd, mode);
if (!file) {
- if (
#if defined(sun)
- errno == 0 ||
+ if (errno == 0 || errno == EMFILE || errno == ENFILE) {
+#else
+ if (errno == EMFILE || errno == ENFILE) {
#endif
- errno == EMFILE || errno == ENFILE) {
rb_gc();
#if defined(sun)
errno = 0;
#endif
- file = fdopen(fd, modestr);
+ file = fdopen(fd, mode);
}
if (!file) {
#ifdef _WIN32
if (errno == 0) errno = EINVAL;
-#elif defined(sun)
+#endif
+#if defined(sun)
if (errno == 0) errno = EMFILE;
#endif
rb_sys_fail(0);
}
}
- /* xxx: should be _IONBF? A buffer in FILE may have trouble. */
#ifdef USE_SETVBUF
if (setvbuf(file, NULL, _IOFBF, 0) != 0)
rb_warn("setvbuf() can't be honoured (fd=%d)", fd);
@@ -4517,167 +2983,67 @@ rb_fdopen(int fd, const char *modestr)
return file;
}
-static void
-io_check_tty(rb_io_t *fptr)
+static VALUE
+rb_file_open_internal(io, fname, mode)
+ VALUE io;
+ const char *fname, *mode;
{
- if (isatty(fptr->fd))
- fptr->mode |= FMODE_TTY|FMODE_DUPLEX;
-}
-
-static VALUE rb_io_internal_encoding(VALUE);
-static void io_encoding_set(rb_io_t *, VALUE, VALUE, VALUE);
+ rb_io_t *fptr;
-static int
-io_strip_bom(VALUE io)
-{
- int b1, b2, b3, b4;
- switch (b1 = FIX2INT(rb_io_getbyte(io))) {
- case 0xEF:
- b2 = FIX2INT(rb_io_getbyte(io));
- if (b2 == 0xBB) {
- b3 = FIX2INT(rb_io_getbyte(io));
- if (b3 == 0xBF) {
- return rb_utf8_encindex();
- }
- rb_io_ungetbyte(io, INT2FIX(b3));
- }
- rb_io_ungetbyte(io, INT2FIX(b2));
- break;
+ MakeOpenFile(io, fptr);
- case 0xFE:
- b2 = FIX2INT(rb_io_getbyte(io));
- if (b2 == 0xFF) {
- return rb_enc_find_index("UTF-16BE");
- }
- rb_io_ungetbyte(io, INT2FIX(b2));
- break;
+ fptr->mode = rb_io_mode_flags(mode);
+ fptr->path = strdup(fname);
+ fptr->f = rb_fopen(fptr->path, rb_io_flags_mode(fptr->mode));
- case 0xFF:
- b2 = FIX2INT(rb_io_getbyte(io));
- if (b2 == 0xFE) {
- b3 = FIX2INT(rb_io_getbyte(io));
- if (b3 == 0) {
- b4 = FIX2INT(rb_io_getbyte(io));
- if (b4 == 0) {
- return rb_enc_find_index("UTF-32LE");
- }
- rb_io_ungetbyte(io, INT2FIX(b4));
- }
- else {
- rb_io_ungetbyte(io, INT2FIX(b3));
- return rb_enc_find_index("UTF-16LE");
- }
- rb_io_ungetbyte(io, INT2FIX(b3));
- }
- rb_io_ungetbyte(io, INT2FIX(b2));
- break;
-
- case 0:
- b2 = FIX2INT(rb_io_getbyte(io));
- if (b2 == 0) {
- b3 = FIX2INT(rb_io_getbyte(io));
- if (b3 == 0xFE) {
- b4 = FIX2INT(rb_io_getbyte(io));
- if (b4 == 0xFF) {
- return rb_enc_find_index("UTF-32BE");
- }
- rb_io_ungetbyte(io, INT2FIX(b4));
- }
- rb_io_ungetbyte(io, INT2FIX(b3));
- }
- rb_io_ungetbyte(io, INT2FIX(b2));
- break;
- }
- rb_io_ungetbyte(io, INT2FIX(b1));
- return 0;
+ return io;
}
-static void
-io_set_encoding_by_bom(VALUE io)
+VALUE
+rb_file_open(fname, mode)
+ const char *fname, *mode;
{
- int idx = io_strip_bom(io);
-
- if (idx) {
- rb_io_t *fptr;
- GetOpenFile(io, fptr);
- io_encoding_set(fptr, rb_enc_from_encoding(rb_enc_from_index(idx)),
- rb_io_internal_encoding(io), Qnil);
- }
+ return rb_file_open_internal(io_alloc(rb_cFile), fname, mode);
}
static VALUE
-rb_file_open_generic(VALUE io, VALUE filename, int oflags, int fmode, convconfig_t *convconfig, mode_t perm)
+rb_file_sysopen_internal(io, fname, flags, mode)
+ VALUE io;
+ char *fname;
+ int flags, mode;
{
rb_io_t *fptr;
- convconfig_t cc;
- if (!convconfig) {
- /* Set to default encodings */
- rb_io_ext_int_to_encs(NULL, NULL, &cc.enc, &cc.enc2);
- cc.ecflags = 0;
- cc.ecopts = Qnil;
- convconfig = &cc;
- }
- validate_enc_binmode(fmode, convconfig->enc, convconfig->enc2);
+ int fd;
+ const char *m;
MakeOpenFile(io, fptr);
- fptr->mode = fmode;
- fptr->encs = *convconfig;
- fptr->pathv = rb_str_new_frozen(filename);
- fptr->fd = rb_sysopen(fptr->pathv, oflags, perm);
- io_check_tty(fptr);
- if (fmode & FMODE_STRIP_BOM) io_set_encoding_by_bom(io);
- return io;
-}
-
-static VALUE
-rb_file_open_internal(VALUE io, VALUE filename, const char *modestr)
-{
- int fmode = rb_io_modestr_fmode(modestr);
- const char *p = strchr(modestr, ':');
- convconfig_t convconfig;
+ fptr->path = strdup(fname);
+ m = rb_io_modenum_mode(flags);
+ fptr->mode = rb_io_modenum_flags(flags);
+ fd = rb_sysopen(fptr->path, flags, mode);
+ fptr->f = rb_fdopen(fd, m);
- if (p) {
- parse_mode_enc(p+1, &convconfig.enc, &convconfig.enc2);
- }
- else {
- rb_encoding *e;
- /* Set to default encodings */
-
- e = (fmode & FMODE_BINMODE) ? rb_ascii8bit_encoding() : NULL;
- rb_io_ext_int_to_encs(e, NULL, &convconfig.enc, &convconfig.enc2);
- convconfig.ecflags = 0;
- convconfig.ecopts = Qnil;
- }
-
- return rb_file_open_generic(io, filename,
- rb_io_fmode_oflags(fmode),
- fmode,
- &convconfig,
- 0666);
-}
-
-VALUE
-rb_file_open_str(VALUE fname, const char *modestr)
-{
- FilePathValue(fname);
- return rb_file_open_internal(io_alloc(rb_cFile), fname, modestr);
+ return io;
}
VALUE
-rb_file_open(const char *fname, const char *modestr)
+rb_file_sysopen(fname, flags, mode)
+ const char *fname;
+ int flags, mode;
{
- return rb_file_open_internal(io_alloc(rb_cFile), rb_str_new_cstr(fname), modestr);
+ return rb_file_sysopen_internal(io_alloc(rb_cFile), fname, flags, mode);
}
-#if defined(__CYGWIN__) || !defined(HAVE_FORK)
+#if defined (_WIN32) || defined(DJGPP) || defined(__CYGWIN__) || defined(__human68k__) || defined(__VMS)
static struct pipe_list {
rb_io_t *fptr;
struct pipe_list *next;
} *pipe_list;
static void
-pipe_add_fptr(rb_io_t *fptr)
+pipe_add_fptr(fptr)
+ rb_io_t *fptr;
{
struct pipe_list *list;
@@ -4688,7 +3054,8 @@ pipe_add_fptr(rb_io_t *fptr)
}
static void
-pipe_del_fptr(rb_io_t *fptr)
+pipe_del_fptr(fptr)
+ rb_io_t *fptr;
{
struct pipe_list *list = pipe_list;
struct pipe_list *tmp;
@@ -4711,7 +3078,7 @@ pipe_del_fptr(rb_io_t *fptr)
}
static void
-pipe_atexit(void)
+pipe_atexit _((void))
{
struct pipe_list *list = pipe_list;
struct pipe_list *tmp;
@@ -4723,17 +3090,27 @@ pipe_atexit(void)
}
}
+static void pipe_finalize _((rb_io_t *fptr,int));
+
static void
-pipe_finalize(rb_io_t *fptr, int noraise)
+pipe_finalize(fptr, noraise)
+ rb_io_t *fptr;
+ int noraise;
{
-#if !defined(HAVE_FORK) && !defined(_WIN32)
+#if !defined (__CYGWIN__) && !defined(_WIN32)
+ extern VALUE rb_last_status;
int status;
- if (fptr->stdio_file) {
- status = pclose(fptr->stdio_file);
+ if (fptr->f) {
+ status = pclose(fptr->f);
}
- fptr->fd = -1;
- fptr->stdio_file = 0;
- rb_last_status_set(status, fptr->pid);
+ if (fptr->f2) {
+ status = pclose(fptr->f2);
+ }
+ fptr->f = fptr->f2 = 0;
+#if defined DJGPP
+ status <<= 8;
+#endif
+ rb_last_status = INT2FIX(status);
#else
fptr_finalize(fptr, noraise);
#endif
@@ -4742,536 +3119,266 @@ pipe_finalize(rb_io_t *fptr, int noraise)
#endif
void
-rb_io_synchronized(rb_io_t *fptr)
+rb_io_synchronized(fptr)
+ rb_io_t *fptr;
{
- rb_io_check_initialized(fptr);
fptr->mode |= FMODE_SYNC;
}
void
-rb_io_unbuffered(rb_io_t *fptr)
+rb_io_unbuffered(fptr)
+ rb_io_t *fptr;
{
rb_io_synchronized(fptr);
}
-int
-rb_pipe(int *pipes)
-{
- int ret;
- ret = pipe(pipes);
- if (ret == -1) {
- if (errno == EMFILE || errno == ENFILE) {
- rb_gc();
- ret = pipe(pipes);
- }
- }
- if (ret == 0) {
- UPDATE_MAXFD(pipes[0]);
- UPDATE_MAXFD(pipes[1]);
- }
- return ret;
-}
-
-#ifdef HAVE_FORK
-struct popen_arg {
- struct rb_exec_arg *execp;
- int modef;
- int pair[2];
- int write_pair[2];
-};
-
-static void
-popen_redirect(struct popen_arg *p)
-{
- if ((p->modef & FMODE_READABLE) && (p->modef & FMODE_WRITABLE)) {
- close(p->write_pair[1]);
- if (p->write_pair[0] != 0) {
- dup2(p->write_pair[0], 0);
- close(p->write_pair[0]);
- }
- close(p->pair[0]);
- if (p->pair[1] != 1) {
- dup2(p->pair[1], 1);
- close(p->pair[1]);
- }
- }
- else if (p->modef & FMODE_READABLE) {
- close(p->pair[0]);
- if (p->pair[1] != 1) {
- dup2(p->pair[1], 1);
- close(p->pair[1]);
- }
- }
- else {
- close(p->pair[1]);
- if (p->pair[0] != 0) {
- dup2(p->pair[0], 0);
- close(p->pair[0]);
- }
- }
-}
-
-void
-rb_close_before_exec(int lowfd, int maxhint, VALUE noclose_fds)
-{
- int fd, ret;
- int max = max_file_descriptor;
- if (max < maxhint)
- max = maxhint;
- for (fd = lowfd; fd <= max; fd++) {
- if (!NIL_P(noclose_fds) &&
- RTEST(rb_hash_lookup(noclose_fds, INT2FIX(fd))))
- continue;
-#ifdef FD_CLOEXEC
- ret = fcntl(fd, F_GETFD);
- if (ret != -1 && !(ret & FD_CLOEXEC)) {
- fcntl(fd, F_SETFD, ret|FD_CLOEXEC);
- }
-#else
- ret = close(fd);
-#endif
-#define CONTIGUOUS_CLOSED_FDS 20
- if (ret != -1) {
- if (max < fd + CONTIGUOUS_CLOSED_FDS)
- max = fd + CONTIGUOUS_CLOSED_FDS;
- }
- }
-}
-
-static int
-popen_exec(void *pp, char *errmsg, size_t errmsg_len)
-{
- struct popen_arg *p = (struct popen_arg*)pp;
-
- rb_thread_atfork_before_exec();
- return rb_exec_err(p->execp, errmsg, errmsg_len);
-}
-#endif
+static VALUE pipe_open(VALUE pstr, const char *pname, const char *mode);
static VALUE
-pipe_open(struct rb_exec_arg *eargp, VALUE prog, const char *modestr, int fmode, convconfig_t *convconfig)
+pipe_open(pstr, pname, mode)
+ VALUE pstr;
+ const char *pname, *mode;
{
- rb_pid_t pid = 0;
+ int modef = rb_io_mode_flags(mode);
rb_io_t *fptr;
- VALUE port;
- rb_io_t *write_fptr;
- VALUE write_port;
-#if defined(HAVE_FORK)
- int status;
- struct popen_arg arg;
- char errmsg[80] = { '\0' };
-#elif defined(_WIN32)
- volatile VALUE argbuf;
- char **args = NULL;
- int pair[2], write_pair[2];
+#if defined(DJGPP) || defined(__human68k__) || defined(__VMS)
+ FILE *f;
+#else
+ int pid;
+#ifdef _WIN32
+ FILE *fpr, *fpw;
+#else
+ int pr[2], pw[2];
#endif
-#if !defined(HAVE_FORK)
- struct rb_exec_arg sarg;
#endif
- FILE *fp = 0;
- int fd = -1;
- int write_fd = -1;
- const char *cmd = 0;
- int argc;
- VALUE *argv;
+ volatile int doexec;
- if (prog)
- cmd = StringValueCStr(prog);
+ if (!pname) pname = StringValueCStr(pstr);
+ doexec = (strcmp("-", pname) != 0);
- if (!eargp) {
- /* fork : IO.popen("-") */
- argc = 0;
- argv = 0;
- }
- else if (eargp->argc) {
- /* no shell : IO.popen([prog, arg0], arg1, ...) */
- argc = eargp->argc;
- argv = eargp->argv;
+#if defined(DJGPP) || defined(__human68k__) || defined(__VMS) || defined(_WIN32)
+ if (!doexec) {
+ rb_raise(rb_eNotImpError,
+ "fork() function is unimplemented on this machine");
}
+#endif
+
+#if defined(DJGPP) || defined(__human68k__) || defined(__VMS)
+ f = popen(pname, mode);
+
+ if (!f) rb_sys_fail(pname);
else {
- /* with shell : IO.popen(prog) */
- argc = 0;
- argv = 0;
- }
-
-#if defined(HAVE_FORK)
- arg.execp = eargp;
- arg.modef = fmode;
- arg.pair[0] = arg.pair[1] = -1;
- arg.write_pair[0] = arg.write_pair[1] = -1;
- switch (fmode & (FMODE_READABLE|FMODE_WRITABLE)) {
- case FMODE_READABLE|FMODE_WRITABLE:
- if (rb_pipe(arg.write_pair) < 0)
- rb_sys_fail(cmd);
- if (rb_pipe(arg.pair) < 0) {
- int e = errno;
- close(arg.write_pair[0]);
- close(arg.write_pair[1]);
- errno = e;
- rb_sys_fail(cmd);
- }
- if (eargp) {
- rb_exec_arg_addopt(eargp, INT2FIX(0), INT2FIX(arg.write_pair[0]));
- rb_exec_arg_addopt(eargp, INT2FIX(1), INT2FIX(arg.pair[1]));
- }
- break;
- case FMODE_READABLE:
- if (rb_pipe(arg.pair) < 0)
- rb_sys_fail(cmd);
- if (eargp)
- rb_exec_arg_addopt(eargp, INT2FIX(1), INT2FIX(arg.pair[1]));
- break;
- case FMODE_WRITABLE:
- if (rb_pipe(arg.pair) < 0)
- rb_sys_fail(cmd);
- if (eargp)
- rb_exec_arg_addopt(eargp, INT2FIX(0), INT2FIX(arg.pair[0]));
- break;
- default:
- rb_sys_fail(cmd);
+ VALUE port = io_alloc(rb_cIO);
+
+ MakeOpenFile(port, fptr);
+ fptr->finalize = pipe_finalize;
+ fptr->mode = modef;
+
+ pipe_add_fptr(fptr);
+ if (modef & FMODE_READABLE) fptr->f = f;
+ if (modef & FMODE_WRITABLE) {
+ if (fptr->f) fptr->f2 = f;
+ else fptr->f = f;
+ rb_io_synchronized(fptr);
+ }
+ return (VALUE)port;
}
- if (eargp) {
- rb_exec_arg_fixup(arg.execp);
- pid = rb_fork_err(&status, popen_exec, &arg, arg.execp->redirect_fds, errmsg, sizeof(errmsg));
+#else
+#ifdef _WIN32
+retry:
+ pid = pipe_exec(pname, rb_io_mode_modenum(mode), &fpr, &fpw);
+ if (pid == -1) { /* exec failed */
+ if (errno == EAGAIN) {
+ rb_thread_sleep(1);
+ goto retry;
+ }
+ rb_sys_fail(pname);
}
else {
- fflush(stdin); /* is it really needed? */
- pid = rb_fork(&status, 0, 0, Qnil);
- if (pid == 0) { /* child */
- popen_redirect(&arg);
- rb_io_synchronized(RFILE(orig_stdout)->fptr);
- rb_io_synchronized(RFILE(orig_stderr)->fptr);
- return Qnil;
+ VALUE port = io_alloc(rb_cIO);
+
+ MakeOpenFile(port, fptr);
+ fptr->mode = modef;
+ fptr->mode |= FMODE_SYNC;
+ fptr->pid = pid;
+
+ if (modef & FMODE_READABLE) {
+ fptr->f = fpr;
+ }
+ if (modef & FMODE_WRITABLE) {
+ if (fptr->f) fptr->f2 = fpw;
+ else fptr->f = fpw;
}
+ fptr->finalize = pipe_finalize;
+ pipe_add_fptr(fptr);
+ return (VALUE)port;
}
+#else
+ if (((modef & FMODE_READABLE) && pipe(pr) == -1) ||
+ ((modef & FMODE_WRITABLE) && pipe(pw) == -1))
+ rb_sys_fail(pname);
- /* parent */
- if (pid == -1) {
- int e = errno;
- close(arg.pair[0]);
- close(arg.pair[1]);
- if ((fmode & (FMODE_READABLE|FMODE_WRITABLE)) == (FMODE_READABLE|FMODE_WRITABLE)) {
- close(arg.write_pair[0]);
- close(arg.write_pair[1]);
- }
- errno = e;
- if (errmsg[0])
- rb_sys_fail(errmsg);
- rb_sys_fail(cmd);
- }
- if ((fmode & FMODE_READABLE) && (fmode & FMODE_WRITABLE)) {
- close(arg.pair[1]);
- fd = arg.pair[0];
- close(arg.write_pair[0]);
- write_fd = arg.write_pair[1];
- }
- else if (fmode & FMODE_READABLE) {
- close(arg.pair[1]);
- fd = arg.pair[0];
- }
- else {
- close(arg.pair[0]);
- fd = arg.pair[1];
+ if (!doexec) {
+ fflush(stdin); /* is it really needed? */
+ fflush(stdout);
+ fflush(stderr);
}
-#elif defined(_WIN32)
- if (argc) {
- int i;
- if (argc >= FIXNUM_MAX / sizeof(char *)) {
- rb_raise(rb_eArgError, "too many arguments");
+ retry:
+ switch ((pid = fork())) {
+ case 0: /* child */
+ if (modef & FMODE_READABLE) {
+ close(pr[0]);
+ if (pr[1] != 1) {
+ dup2(pr[1], 1);
+ close(pr[1]);
+ }
}
- argbuf = rb_str_tmp_new((argc+1) * sizeof(char *));
- args = (void *)RSTRING_PTR(argbuf);
- for (i = 0; i < argc; ++i) {
- args[i] = StringValueCStr(argv[i]);
+ if (modef & FMODE_WRITABLE) {
+ close(pw[1]);
+ if (pw[0] != 0) {
+ dup2(pw[0], 0);
+ close(pw[0]);
+ }
}
- args[i] = NULL;
- }
- switch (fmode & (FMODE_READABLE|FMODE_WRITABLE)) {
- case FMODE_READABLE|FMODE_WRITABLE:
- if (rb_pipe(write_pair) < 0)
- rb_sys_fail(cmd);
- if (rb_pipe(pair) < 0) {
- int e = errno;
- close(write_pair[0]);
- close(write_pair[1]);
- errno = e;
- rb_sys_fail(cmd);
- }
- if (eargp) {
- rb_exec_arg_addopt(eargp, INT2FIX(0), INT2FIX(write_pair[0]));
- rb_exec_arg_addopt(eargp, INT2FIX(1), INT2FIX(pair[1]));
- }
- break;
- case FMODE_READABLE:
- if (rb_pipe(pair) < 0)
- rb_sys_fail(cmd);
- if (eargp)
- rb_exec_arg_addopt(eargp, INT2FIX(1), INT2FIX(pair[1]));
- break;
- case FMODE_WRITABLE:
- if (rb_pipe(pair) < 0)
- rb_sys_fail(cmd);
- if (eargp)
- rb_exec_arg_addopt(eargp, INT2FIX(0), INT2FIX(pair[0]));
- break;
- default:
- rb_sys_fail(cmd);
- }
- if (eargp) {
- rb_exec_arg_fixup(eargp);
- rb_run_exec_options(eargp, &sarg);
- }
- while ((pid = (args ?
- rb_w32_aspawn(P_NOWAIT, cmd, args) :
- rb_w32_spawn(P_NOWAIT, cmd, 0))) == -1) {
- /* exec failed */
- switch (errno) {
- case EAGAIN:
-#if defined(EWOULDBLOCK) && EWOULDBLOCK != EAGAIN
- case EWOULDBLOCK:
-#endif
+
+ if (doexec) {
+ int fd;
+
+ for (fd = 3; fd < NOFILE; fd++)
+ close(fd);
+ rb_proc_exec(pname);
+ fprintf(stderr, "%s:%d: command not found: %s\n",
+ ruby_sourcefile, ruby_sourceline, pname);
+ _exit(127);
+ }
+ rb_io_synchronized(RFILE(orig_stdout)->fptr);
+ rb_io_synchronized(RFILE(orig_stderr)->fptr);
+ return Qnil;
+
+ case -1: /* fork failed */
+ if (errno == EAGAIN) {
rb_thread_sleep(1);
- break;
- default:
- {
- int e = errno;
- if (eargp)
- rb_run_exec_options(&sarg, NULL);
- close(pair[0]);
- close(pair[1]);
- if ((fmode & (FMODE_READABLE|FMODE_WRITABLE)) == (FMODE_READABLE|FMODE_WRITABLE)) {
- close(write_pair[0]);
- close(write_pair[1]);
- }
- errno = e;
- rb_sys_fail(cmd);
+ goto retry;
+ }
+ else {
+ int e = errno;
+ if ((modef & FMODE_READABLE)) {
+ close(pr[0]);
+ close(pr[1]);
}
- break;
+ if ((modef & FMODE_WRITABLE)) {
+ close(pw[0]);
+ close(pw[1]);
+ }
+ errno = e;
+ rb_sys_fail(pname);
}
- }
- if (eargp)
- rb_run_exec_options(&sarg, NULL);
- if ((fmode & FMODE_READABLE) && (fmode & FMODE_WRITABLE)) {
- close(pair[1]);
- fd = pair[0];
- close(write_pair[0]);
- write_fd = write_pair[1];
- }
- else if (fmode & FMODE_READABLE) {
- close(pair[1]);
- fd = pair[0];
- }
- else {
- close(pair[0]);
- fd = pair[1];
- }
-#else
- if (argc) {
- prog = rb_ary_join(rb_ary_new4(argc, argv), rb_str_new2(" "));
- cmd = StringValueCStr(prog);
- }
- if (eargp) {
- rb_exec_arg_fixup(eargp);
- rb_run_exec_options(eargp, &sarg);
- }
- fp = popen(cmd, modestr);
- if (eargp)
- rb_run_exec_options(&sarg, NULL);
- if (!fp) rb_sys_fail(RSTRING_PTR(prog));
- fd = fileno(fp);
-#endif
+ break;
- port = io_alloc(rb_cIO);
- MakeOpenFile(port, fptr);
- fptr->fd = fd;
- fptr->stdio_file = fp;
- fptr->mode = fmode | FMODE_SYNC|FMODE_DUPLEX;
- if (convconfig) {
- fptr->encs = *convconfig;
- }
- fptr->pid = pid;
-
- if (0 <= write_fd) {
- write_port = io_alloc(rb_cIO);
- MakeOpenFile(write_port, write_fptr);
- write_fptr->fd = write_fd;
- write_fptr->mode = (fmode & ~FMODE_READABLE)| FMODE_SYNC|FMODE_DUPLEX;
- fptr->mode &= ~FMODE_WRITABLE;
- fptr->tied_io_for_writing = write_port;
- rb_ivar_set(port, rb_intern("@tied_io_for_writing"), write_port);
- }
-
-#if defined (__CYGWIN__) || !defined(HAVE_FORK)
- fptr->finalize = pipe_finalize;
- pipe_add_fptr(fptr);
-#endif
- return port;
-}
+ default: /* parent */
+ if (pid < 0) rb_sys_fail(pname);
+ else {
+ VALUE port = io_alloc(rb_cIO);
-static VALUE
-pipe_open_v(int argc, VALUE *argv, const char *modestr, int fmode, convconfig_t *convconfig)
-{
- VALUE prog;
- struct rb_exec_arg earg;
- prog = rb_exec_arg_init(argc, argv, Qfalse, &earg);
- return pipe_open(&earg, prog, modestr, fmode, convconfig);
-}
+ MakeOpenFile(port, fptr);
+ fptr->mode = modef;
+ fptr->mode |= FMODE_SYNC;
+ fptr->pid = pid;
-static VALUE
-pipe_open_s(VALUE prog, const char *modestr, int fmode, convconfig_t *convconfig)
-{
- const char *cmd = RSTRING_PTR(prog);
- int argc = 1;
- VALUE *argv = &prog;
- struct rb_exec_arg earg;
+ if (modef & FMODE_READABLE) {
+ close(pr[1]);
+ fptr->f = rb_fdopen(pr[0], "r");
+ }
+ if (modef & FMODE_WRITABLE) {
+ FILE *f = rb_fdopen(pw[1], "w");
- if (RSTRING_LEN(prog) == 1 && cmd[0] == '-') {
-#if !defined(HAVE_FORK)
- rb_raise(rb_eNotImpError,
- "fork() function is unimplemented on this machine");
+ close(pw[0]);
+ if (fptr->f) fptr->f2 = f;
+ else fptr->f = f;
+ }
+#if defined (__CYGWIN__)
+ fptr->finalize = pipe_finalize;
+ pipe_add_fptr(fptr);
#endif
- return pipe_open(0, 0, modestr, fmode, convconfig);
+ return port;
+ }
}
-
- rb_exec_arg_init(argc, argv, Qtrue, &earg);
- return pipe_open(&earg, prog, modestr, fmode, convconfig);
-}
-
-static VALUE
-pop_last_hash(int *argc_p, VALUE *argv)
-{
- VALUE last, tmp;
- if (*argc_p == 0)
- return Qnil;
- last = argv[*argc_p-1];
- tmp = rb_check_convert_type(last, T_HASH, "Hash", "to_hash");
- if (NIL_P(tmp))
- return Qnil;
- (*argc_p)--;
- return tmp;
+#endif
+#endif
}
/*
* call-seq:
- * IO.popen(cmd, mode="r" [, opt]) => io
- * IO.popen(cmd, mode="r" [, opt]) {|io| block } => obj
- *
- * Runs the specified command as a subprocess; the subprocess's
+ * IO.popen(cmd_string, mode="r" ) => io
+ * IO.popen(cmd_string, mode="r" ) {|io| block } => obj
+ *
+ * Runs the specified command string as a subprocess; the subprocess's
* standard input and output will be connected to the returned
- * <code>IO</code> object.
- *
- * The PID of the started process can be obtained by IO#pid method.
- *
- * _cmd_ is a string or an array as follows.
- *
- * cmd:
- * "-" : fork
- * commandline : command line string which is passed to a shell
- * [env, cmdname, arg1, ..., opts] : command name and zero or more arguments (no shell)
- * [env, [cmdname, argv0], arg1, ..., opts] : command name, argv[0] and zero or more arguments (no shell)
- * (env and opts are optional.)
- *
- * If _cmd_ is a +String+ ``<code>-</code>'',
- * then a new instance of Ruby is started as the subprocess.
- *
- * 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 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.
- * The last argument <i>opt</i> qualifies <i>mode</i>.
- *
- * # set IO encoding
- * IO.popen("nkf -e filename", :external_encoding=>"EUC-JP") {|nkf_io|
- * euc_jp_string = nkf_io.read
- * }
- *
- * # merge standard output and standard error using
- * # spawn option. See the document of Kernel.spawn.
- * IO.popen(["ls", "/", :err=>[:child, :out]]) {|ls_io|
- * ls_result_with_error = ls_io.read
- * }
- *
- * Raises exceptions which <code>IO.pipe</code> and
- * <code>Kernel.spawn</code> raise.
- *
+ * <code>IO</code> object. If <i>cmd_string</i> starts with a
+ * ``<code>-</code>'', then a new instance of Ruby is started as the
+ * subprocess. 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.
+ *
* If a block is given, Ruby will run the command as a child connected
* to Ruby with a pipe. Ruby's end of the pipe will be passed as a
* parameter to the block.
* At the end of block, Ruby close the pipe and sets <code>$?</code>.
- * In this case <code>IO.popen</code> returns
+ * In this case <code>IO::popen</code> returns
* the value of the block.
- *
- * If a block is given with a _cmd_ of ``<code>-</code>'',
+ *
+ * If a block is given with a <i>cmd_string</i> 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 <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.
- *
+ *
* f = IO.popen("uname")
* p f.readlines
- * f.close
* puts "Parent is #{Process.pid}"
- * IO.popen("date") { |f| puts f.gets }
- * IO.popen("-") {|f| $stderr.puts "#{Process.pid} is here, f is #{f.inspect}"}
+ * IO.popen ("date") { |f| puts f.gets }
+ * IO.popen("-") {|f| $stderr.puts "#{Process.pid} is here, f is #{f}"}
* p $?
- * IO.popen(%w"sed -e s|^|<foo>| -e s&$&;zot;&", "r+") {|f|
- * f.puts "bar"; f.close_write; puts f.gets
- * }
- *
+ *
* <em>produces:</em>
- *
+ *
* ["Linux\n"]
- * Parent is 21346
- * Thu Jan 15 22:41:19 JST 2009
- * 21346 is here, f is #<IO:fd 3>
- * 21352 is here, f is nil
- * #<Process::Status: pid 21352 exit 0>
- * <foo>bar;zot;
+ * Parent is 26166
+ * Wed Apr 9 08:53:52 CDT 2003
+ * 26169 is here, f is
+ * 26166 is here, f is #<IO:0x401b3d44>
+ * #<Process::Status: pid=26166,exited(0)>
*/
static VALUE
-rb_io_s_popen(int argc, VALUE *argv, VALUE klass)
+rb_io_s_popen(argc, argv, klass)
+ int argc;
+ VALUE *argv;
+ VALUE klass;
{
- const char *modestr;
- VALUE pname, pmode, port, tmp, opt;
- int oflags, fmode;
- convconfig_t convconfig;
-
- opt = pop_last_hash(&argc, argv);
- rb_scan_args(argc, argv, "11", &pname, &pmode);
-
- rb_io_extract_modeenc(&pmode, 0, opt, &oflags, &fmode, &convconfig);
- modestr = rb_io_oflags_modestr(oflags);
+ const char *mode;
+ VALUE pname, pmode, port;
- tmp = rb_check_array_type(pname);
- if (!NIL_P(tmp)) {
- long len = RARRAY_LEN(tmp);
-#if SIZEOF_LONG > SIZEOF_INT
- if (len > INT_MAX) {
- rb_raise(rb_eArgError, "too many arguments");
- }
-#endif
- tmp = rb_ary_dup(tmp);
- RBASIC(tmp)->klass = 0;
- port = pipe_open_v((int)len, RARRAY_PTR(tmp), modestr, fmode, &convconfig);
- rb_ary_clear(tmp);
+ if (rb_scan_args(argc, argv, "11", &pname, &pmode) == 1) {
+ mode = "r";
+ }
+ else if (FIXNUM_P(pmode)) {
+ mode = rb_io_modenum_mode(FIX2INT(pmode));
}
else {
- SafeStringValue(pname);
- port = pipe_open_s(pname, modestr, fmode, &convconfig);
+ mode = rb_io_flags_mode(rb_io_mode_flags(StringValueCStr(pmode)));
}
+ SafeStringValue(pname);
+ port = pipe_open(pname, 0, mode);
if (NIL_P(port)) {
/* child */
if (rb_block_given_p()) {
rb_yield(Qnil);
- rb_io_flush(rb_stdout);
- rb_io_flush(rb_stderr);
+ fflush(stdout);
+ fflush(stderr);
_exit(0);
}
return Qnil;
@@ -5283,96 +3390,58 @@ rb_io_s_popen(int argc, VALUE *argv, VALUE klass)
return port;
}
-static void
-rb_scan_open_args(int argc, VALUE *argv,
- VALUE *fname_p, int *oflags_p, int *fmode_p,
- convconfig_t *convconfig_p, mode_t *perm_p)
-{
- VALUE opt=Qnil, fname, vmode, vperm;
- int oflags, fmode;
- mode_t perm;
-
- opt = pop_last_hash(&argc, argv);
- rb_scan_args(argc, argv, "12", &fname, &vmode, &vperm);
- FilePathValue(fname);
-#if defined __APPLE__
- {
- static rb_encoding *fs_encoding;
- rb_encoding *fname_encoding = rb_enc_get(fname);
- if (!fs_encoding)
- fs_encoding = rb_filesystem_encoding();
- if (rb_usascii_encoding() != fname_encoding
- && rb_ascii8bit_encoding() != fname_encoding
-#if defined __APPLE__
- && rb_utf8_encoding() != fname_encoding
-#endif
- && fs_encoding != fname_encoding) {
- static VALUE fs_enc;
- if (!fs_enc)
- fs_enc = rb_enc_from_encoding(fs_encoding);
- fname = rb_str_encode(fname, fs_enc, 0, Qnil);
- }
- }
-#endif
-
- rb_io_extract_modeenc(&vmode, &vperm, opt, &oflags, &fmode, convconfig_p);
-
- perm = NIL_P(vperm) ? 0666 : NUM2UINT(vperm);
-
- *fname_p = fname;
- *oflags_p = oflags;
- *fmode_p = fmode;
- *perm_p = perm;
-}
-
static VALUE
-rb_open_file(int argc, VALUE *argv, VALUE io)
+rb_open_file(argc, argv, io)
+ int argc;
+ VALUE *argv;
+ VALUE io;
{
- VALUE fname;
- int oflags, fmode;
- convconfig_t convconfig;
- mode_t perm;
+ VALUE fname, vmode, perm;
+ const char *path, *mode;
+ int flags;
+ unsigned int fmode;
+
+ rb_scan_args(argc, argv, "12", &fname, &vmode, &perm);
+ SafeStringValue(fname);
- rb_scan_open_args(argc, argv, &fname, &oflags, &fmode, &convconfig, &perm);
- rb_file_open_generic(io, fname, oflags, fmode, &convconfig, perm);
+ path = StringValueCStr(fname);
+ if (FIXNUM_P(vmode) || !NIL_P(perm)) {
+ if (FIXNUM_P(vmode)) {
+ flags = FIX2INT(vmode);
+ }
+ else {
+ SafeStringValue(vmode);
+ flags = rb_io_mode_modenum(RSTRING(vmode)->ptr);
+ }
+ fmode = NIL_P(perm) ? 0666 : NUM2UINT(perm);
+ rb_file_sysopen_internal(io, path, flags, fmode);
+ }
+ else {
+ mode = NIL_P(vmode) ? "r" : StringValueCStr(vmode);
+ rb_file_open_internal(io, path, mode);
+ }
return io;
}
-
/*
- * Document-method: File::open
- *
* call-seq:
- * File.open(filename, mode="r" [, opt]) => file
- * File.open(filename [, mode [, perm]] [, opt]) => file
- * File.open(filename, mode="r" [, opt]) {|file| block } => obj
- * File.open(filename [, mode [, perm]] [, opt]) {|file| block } => obj
- *
+ * IO.open(fd, mode_string="r" ) => io
+ * IO.open(fd, mode_string="r" ) {|io| block } => obj
+ *
* With no associated block, <code>open</code> is a synonym for
- * <code>File.new</code>. If the optional code block is given, it will
- * be passed <i>file</i> as an argument, and the File object will
- * automatically be closed when the block terminates. In this instance,
- * <code>File.open</code> returns the value of the block.
- */
-
-/*
- * Document-method: IO::open
- *
- * call-seq:
- * IO.open(fd, mode_string="r" [, opt] ) => io
- * IO.open(fd, mode_string="r" [, opt] ) {|io| block } => obj
- *
- * With no associated block, <code>open</code> is a synonym for
- * <code>IO.new</code>. If the optional code block is given, it will
+ * <code>IO::new</code>. If the optional code block is given, it will
* be passed <i>io</i> as an argument, and the IO object will
* automatically be closed when the block terminates. In this instance,
- * <code>IO.open</code> returns the value of the block.
- *
+ * <code>IO::open</code> returns the value of the block.
+ *
*/
static VALUE
-rb_io_s_open(int argc, VALUE *argv, VALUE klass)
+rb_io_s_open(argc, argv, klass)
+ int argc;
+ VALUE *argv;
+ VALUE klass;
{
VALUE io = rb_class_new_instance(argc, argv, klass);
@@ -5386,101 +3455,61 @@ rb_io_s_open(int argc, VALUE *argv, VALUE klass)
/*
* call-seq:
* IO.sysopen(path, [mode, [perm]]) => fixnum
- *
+ *
* Opens the given path, returning the underlying file descriptor as a
* <code>Fixnum</code>.
- *
+ *
* IO.sysopen("testfile") #=> 3
- *
+ *
*/
static VALUE
-rb_io_s_sysopen(int argc, VALUE *argv)
+rb_io_s_sysopen(argc, argv)
+ int argc;
+ VALUE *argv;
{
- VALUE fname, vmode, vperm;
- VALUE intmode;
- int oflags, fd;
- mode_t perm;
+ VALUE fname, vmode, perm;
+ int flags, fd;
+ unsigned int fmode;
+ char *path;
- rb_scan_args(argc, argv, "12", &fname, &vmode, &vperm);
- FilePathValue(fname);
+ rb_scan_args(argc, argv, "12", &fname, &vmode, &perm);
+ SafeStringValue(fname);
- if (NIL_P(vmode))
- oflags = O_RDONLY;
- else if (!NIL_P(intmode = rb_check_to_integer(vmode, "to_int")))
- oflags = NUM2INT(intmode);
+ if (NIL_P(vmode)) flags = O_RDONLY;
+ else if (FIXNUM_P(vmode)) flags = FIX2INT(vmode);
else {
SafeStringValue(vmode);
- oflags = rb_io_modestr_oflags(StringValueCStr(vmode));
+ flags = rb_io_mode_modenum(RSTRING(vmode)->ptr);
}
- if (NIL_P(vperm)) perm = 0666;
- else perm = NUM2UINT(vperm);
+ if (NIL_P(perm)) fmode = 0666;
+ else fmode = NUM2UINT(perm);
- RB_GC_GUARD(fname) = rb_str_new4(fname);
- fd = rb_sysopen(fname, oflags, perm);
+ path = ALLOCA_N(char, strlen(RSTRING(fname)->ptr)+1);
+ strcpy(path, RSTRING(fname)->ptr);
+ fd = rb_sysopen(path, flags, fmode);
return INT2NUM(fd);
}
-static VALUE
-check_pipe_command(VALUE filename_or_command)
-{
- char *s = RSTRING_PTR(filename_or_command);
- long l = RSTRING_LEN(filename_or_command);
- char *e = s + l;
- int chlen;
-
- 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;
-}
-
/*
* call-seq:
- * open(path [, mode_enc [, perm]] [, opt] ) => io or nil
- * open(path [, mode_enc [, perm]] [, opt] ) {|io| block } => obj
- *
+ * open(path [, mode [, perm]] ) => io or nil
+ * open(path [, mode [, perm]] ) {|io| block } => obj
+ *
* Creates an <code>IO</code> object connected to the given stream,
* file, or subprocess.
- *
+ *
* If <i>path</i> does not start with a pipe character
* (``<code>|</code>''), treat it as the name of a file to open using
- * the specified mode (defaulting to ``<code>r</code>'').
- *
- * The mode_enc is
- * either a string or an integer. If it is an integer, it must be
- * bitwise-or of open(2) flags, such as File::RDWR or File::EXCL.
- * If it is a string, it is either "mode", "mode:ext_enc", or
- * "mode:ext_enc:int_enc".
- * The mode is one of the following:
- *
- * r: read (default)
- * w: write
- * a: append
- *
- * The mode can be followed by "b" (means binary-mode), or "+"
- * (means both reading and writing allowed) or both.
- * If ext_enc (external encoding) is specified,
- * read string will be tagged by the encoding in reading,
- * and output string will be converted
- * to the specified encoding in writing.
- * If two encoding names,
- * ext_enc and int_enc (external encoding and internal encoding),
- * are specified, the read string is converted from ext_enc
- * to int_enc then tagged with the int_enc in read mode,
- * and in write mode, the output string will be
- * converted from int_enc to ext_enc before writing.
- *
- * If a file is being created, its initial permissions may be
- * set using the integer third parameter.
- *
+ * the specified mode (defaulting to ``<code>r</code>''). (See the table
+ * of valid modes on page 331.) If a file is being created, its initial
+ * permissions may be set using the integer third parameter.
+ *
* If a block is specified, it will be invoked with the
* <code>File</code> object as a parameter, and the file will be
* automatically closed when the block terminates. The call
* returns the value of the block.
- *
+ *
* If <i>path</i> starts with a pipe character, a subprocess is
* created, connected to the caller by a pair of pipes. The returned
* <code>IO</code> object may be used to write to the standard input
@@ -5496,27 +3525,27 @@ check_pipe_command(VALUE filename_or_command)
* will be connected to the child's <code>$stdin</code> and
* <code>$stdout</code>. The subprocess will be terminated at the end
* of the block.
- *
+ *
* open("testfile") do |f|
* print f.gets
* end
- *
+ *
* <em>produces:</em>
- *
+ *
* This is line one
- *
+ *
* Open a subprocess and read its output:
- *
+ *
* cmd = open("|date")
* print cmd.gets
* cmd.close
- *
+ *
* <em>produces:</em>
- *
+ *
* Wed Apr 9 08:56:31 CDT 2003
- *
+ *
* Open a subprocess running the same Ruby program:
- *
+ *
* f = open("|-", "w+")
* if f == nil
* puts "in Child"
@@ -5524,13 +3553,13 @@ check_pipe_command(VALUE filename_or_command)
* else
* puts "Got: #{f.gets}"
* end
- *
+ *
* <em>produces:</em>
- *
+ *
* Got: in Child
- *
+ *
* Open a subprocess using a block to receive the I/O object:
- *
+ *
* open("|-") do |f|
* if f == nil
* puts "in Child"
@@ -5538,159 +3567,158 @@ check_pipe_command(VALUE filename_or_command)
* puts "Got: #{f.gets}"
* end
* end
- *
+ *
* <em>produces:</em>
- *
+ *
* Got: in Child
*/
static VALUE
-rb_f_open(int argc, VALUE *argv)
+rb_f_open(argc, argv)
+ int argc;
+ VALUE *argv;
{
- ID to_open = 0;
- int redirect = Qfalse;
-
if (argc >= 1) {
- CONST_ID(to_open, "to_open");
- if (rb_respond_to(argv[0], to_open)) {
- redirect = Qtrue;
- }
- else {
- VALUE tmp = argv[0];
- FilePathValue(tmp);
- if (NIL_P(tmp)) {
- redirect = Qtrue;
- }
- else {
- VALUE cmd = check_pipe_command(tmp);
- if (!NIL_P(cmd)) {
- argv[0] = cmd;
- return rb_io_s_popen(argc, argv, rb_cIO);
- }
- }
- }
- }
- if (redirect) {
- VALUE io = rb_funcall2(argv[0], to_open, argc-1, argv+1);
+ char *str = StringValuePtr(argv[0]);
- if (rb_block_given_p()) {
- return rb_ensure(rb_yield, io, io_close, io);
+ if (str[0] == '|') {
+ VALUE tmp = rb_str_new(str+1, RSTRING(argv[0])->len-1);
+ OBJ_INFECT(tmp, argv[0]);
+ argv[0] = tmp;
+ return rb_io_s_popen(argc, argv, rb_cIO);
}
- return io;
}
return rb_io_s_open(argc, argv, rb_cFile);
}
static VALUE
-rb_io_open(VALUE filename, VALUE vmode, VALUE vperm, VALUE opt)
+rb_io_open(fname, mode)
+ char *fname, *mode;
{
- 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 : NUM2UINT(vperm);
-
- if (!NIL_P(cmd = check_pipe_command(filename))) {
- return pipe_open_s(cmd, rb_io_oflags_modestr(oflags), fmode, &convconfig);
+ if (fname[0] == '|') {
+ return pipe_open(0, fname+1, mode);
}
else {
- return rb_file_open_generic(io_alloc(rb_cFile), filename,
- oflags, fmode, &convconfig, perm);
+ return rb_file_open(fname, mode);
}
}
static VALUE
-rb_io_open_with_args(int argc, VALUE *argv)
+rb_io_get_io(io)
+ VALUE io;
{
+ return rb_convert_type(io, T_FILE, "IO", "to_io");
+}
+
+static VALUE
+rb_io_check_io(io)
VALUE io;
+{
+ return rb_check_convert_type(io, T_FILE, "IO", "to_io");
+}
- io = io_alloc(rb_cFile);
- rb_open_file(argc, argv, io);
- return io;
+static const char*
+rb_io_mode_string(fptr)
+ rb_io_t *fptr;
+{
+ switch (fptr->mode & FMODE_READWRITE) {
+ case FMODE_READABLE:
+ default:
+ return "r";
+ case FMODE_WRITABLE:
+ return "w";
+ case FMODE_READWRITE:
+ return "r+";
+ }
}
static VALUE
-io_reopen(VALUE io, VALUE nfile)
+io_reopen(io, nfile)
+ VALUE io, nfile;
{
rb_io_t *fptr, *orig;
+ const char *mode;
int fd, fd2;
off_t pos = 0;
nfile = rb_io_get_io(nfile);
- if (rb_safe_level() >= 4 &&
- (!OBJ_UNTRUSTED(io) || !OBJ_UNTRUSTED(nfile))) {
+ if (rb_safe_level() >= 4 && (!OBJ_TAINTED(io) || !OBJ_TAINTED(nfile))) {
rb_raise(rb_eSecurityError, "Insecure: can't reopen");
}
GetOpenFile(io, fptr);
GetOpenFile(nfile, orig);
if (fptr == orig) return io;
- if (IS_PREP_STDIO(fptr)) {
- if ((fptr->stdio_file == stdin && !(orig->mode & FMODE_READABLE)) ||
- (fptr->stdio_file == stdout && !(orig->mode & FMODE_WRITABLE)) ||
- (fptr->stdio_file == stderr && !(orig->mode & FMODE_WRITABLE))) {
- rb_raise(rb_eArgError,
- "%s can't change access mode from \"%s\" to \"%s\"",
- PREP_STDIO_NAME(fptr), rb_io_fmode_modestr(fptr->mode),
- rb_io_fmode_modestr(orig->mode));
- }
- }
if (orig->mode & FMODE_READABLE) {
pos = io_tell(orig);
}
- if (orig->mode & FMODE_WRITABLE) {
- if (io_fflush(orig) < 0)
- rb_sys_fail(0);
+ if (orig->f2) {
+ io_fflush(orig->f2, orig);
}
- if (fptr->mode & FMODE_WRITABLE) {
- if (io_fflush(fptr) < 0)
- rb_sys_fail(0);
+ else if (orig->mode & FMODE_WRITABLE) {
+ io_fflush(orig->f, orig);
}
- else {
- io_tell(fptr);
+ if (fptr->mode & FMODE_WRITABLE) {
+ io_fflush(GetWriteFile(fptr), fptr);
}
/* copy rb_io_t structure */
- fptr->mode = orig->mode | (fptr->mode & FMODE_PREP);
+ fptr->mode = orig->mode;
fptr->pid = orig->pid;
fptr->lineno = orig->lineno;
- if (RTEST(orig->pathv)) fptr->pathv = orig->pathv;
- else if (!IS_PREP_STDIO(fptr)) fptr->pathv = Qnil;
+ if (fptr->path) free(fptr->path);
+ if (orig->path) fptr->path = strdup(orig->path);
+ else fptr->path = 0;
fptr->finalize = orig->finalize;
-#if defined (__CYGWIN__) || !defined(HAVE_FORK)
- if (fptr->finalize == pipe_finalize)
- pipe_add_fptr(fptr);
-#endif
- fd = fptr->fd;
- fd2 = orig->fd;
+ mode = rb_io_mode_string(fptr);
+ fd = fileno(fptr->f);
+ fd2 = fileno(orig->f);
if (fd != fd2) {
- if (IS_PREP_STDIO(fptr)) {
+ if (fptr->f == stdin || fptr->f == stdout || fptr->f == stderr) {
+ clearerr(fptr->f);
/* need to keep stdio objects */
if (dup2(fd2, fd) < 0)
- rb_sys_fail_path(orig->pathv);
+ rb_sys_fail(orig->path);
}
else {
- if (fptr->stdio_file)
- fclose(fptr->stdio_file);
- else
- close(fptr->fd);
- fptr->stdio_file = 0;
- fptr->fd = -1;
+ FILE *f2 = fptr->f2;
+ int m = fptr->mode;
+ fclose(fptr->f);
+ fptr->f = f2;
+ fptr->f2 = NULL;
+ fptr->mode &= (m & FMODE_READABLE) ? ~FMODE_READABLE : ~FMODE_WRITABLE;
if (dup2(fd2, fd) < 0)
- rb_sys_fail_path(orig->pathv);
- fptr->fd = fd;
+ rb_sys_fail(orig->path);
+ if (f2) {
+ fptr->f = rb_fdopen(fd, "r");
+ fptr->f2 = f2;
+ }
+ else {
+ fptr->f = rb_fdopen(fd, mode);
+ }
+ fptr->mode = m;
}
rb_thread_fd_close(fd);
if ((orig->mode & FMODE_READABLE) && pos >= 0) {
- if (io_seek(fptr, pos, SEEK_SET) < 0) {
- rb_sys_fail_path(fptr->pathv);
- }
- if (io_seek(orig, pos, SEEK_SET) < 0) {
- rb_sys_fail_path(orig->pathv);
- }
+ io_seek(fptr, pos, SEEK_SET);
+ io_seek(orig, pos, SEEK_SET);
+ }
+ }
+
+ if (fptr->f2 && fd != fileno(fptr->f2)) {
+ fd = fileno(fptr->f2);
+ if (!orig->f2) {
+ fclose(fptr->f2);
+ rb_thread_fd_close(fd);
+ fptr->f2 = 0;
+ }
+ else if (fd != (fd2 = fileno(orig->f2))) {
+ fclose(fptr->f2);
+ rb_thread_fd_close(fd);
+ if (dup2(fd2, fd) < 0)
+ rb_sys_fail(orig->path);
+ fptr->f2 = rb_fdopen(fd, "w");
}
}
@@ -5698,19 +3726,19 @@ io_reopen(VALUE io, VALUE nfile)
rb_io_binmode(io);
}
- RBASIC(io)->klass = rb_obj_class(nfile);
+ RBASIC(io)->klass = RBASIC(nfile)->klass;
return io;
}
/*
* call-seq:
- * ios.reopen(other_IO) => 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.
- *
+ *
* f1 = File.new("testfile")
* f2 = File.new("testfile")
* f2.readlines[0] #=> "This is line one\n"
@@ -5719,10 +3747,13 @@ io_reopen(VALUE io, VALUE nfile)
*/
static VALUE
-rb_io_reopen(int argc, VALUE *argv, VALUE file)
+rb_io_reopen(argc, argv, file)
+ int argc;
+ VALUE *argv;
+ VALUE file;
{
VALUE fname, nmode;
- int oflags;
+ const char *mode;
rb_io_t *fptr;
rb_secure(4);
@@ -5733,7 +3764,7 @@ rb_io_reopen(int argc, VALUE *argv, VALUE file)
}
}
- FilePathValue(fname);
+ SafeStringValue(fname);
rb_io_taint_check(file);
fptr = RFILE(file)->fptr;
if (!fptr) {
@@ -5742,50 +3773,37 @@ rb_io_reopen(int argc, VALUE *argv, VALUE file)
}
if (!NIL_P(nmode)) {
- int fmode = rb_io_modestr_fmode(StringValueCStr(nmode));
- if (IS_PREP_STDIO(fptr) &&
- ((fptr->mode & FMODE_READWRITE) & (fmode & FMODE_READWRITE)) !=
- (fptr->mode & FMODE_READWRITE)) {
- rb_raise(rb_eArgError,
- "%s can't change access mode from \"%s\" to \"%s\"",
- PREP_STDIO_NAME(fptr), rb_io_fmode_modestr(fptr->mode),
- rb_io_fmode_modestr(fmode));
- }
- fptr->mode = fmode;
- rb_io_mode_enc(fptr, StringValueCStr(nmode));
- fptr->encs.ecflags = 0;
- fptr->encs.ecopts = Qnil;
+ fptr->mode = rb_io_mode_flags(StringValueCStr(nmode));
}
- fptr->pathv = rb_str_new_frozen(fname);
- oflags = rb_io_fmode_oflags(fptr->mode);
- if (fptr->fd < 0) {
- fptr->fd = rb_sysopen(fptr->pathv, oflags, 0666);
- fptr->stdio_file = 0;
- return file;
+ if (fptr->path) {
+ free(fptr->path);
+ fptr->path = 0;
}
- if (fptr->mode & FMODE_WRITABLE) {
- if (io_fflush(fptr) < 0)
- rb_sys_fail(0);
+ fptr->path = strdup(StringValueCStr(fname));
+ mode = rb_io_flags_mode(fptr->mode);
+ if (!fptr->f) {
+ fptr->f = rb_fopen(fptr->path, mode);
+ if (fptr->f2) {
+ fclose(fptr->f2);
+ fptr->f2 = 0;
+ }
+ return file;
}
- fptr->rbuf_off = fptr->rbuf_len = 0;
- if (fptr->stdio_file) {
- if (freopen(RSTRING_PTR(fptr->pathv), rb_io_oflags_modestr(oflags), fptr->stdio_file) == 0) {
- rb_sys_fail_path(fptr->pathv);
- }
- fptr->fd = fileno(fptr->stdio_file);
+ if (freopen(fptr->path, mode, fptr->f) == 0) {
+ rb_sys_fail(fptr->path);
+ }
#ifdef USE_SETVBUF
- if (setvbuf(fptr->stdio_file, NULL, _IOFBF, 0) != 0)
- rb_warn("setvbuf() can't be honoured for %s", RSTRING_PTR(fptr->pathv));
+ if (setvbuf(fptr->f, NULL, _IOFBF, 0) != 0)
+ rb_warn("setvbuf() can't be honoured for %s", fptr->path);
#endif
- }
- else {
- if (close(fptr->fd) < 0)
- rb_sys_fail_path(fptr->pathv);
- fptr->fd = -1;
- fptr->fd = rb_sysopen(fptr->pathv, oflags, 0666);
+
+ if (fptr->f2) {
+ if (freopen(fptr->path, "w", fptr->f2) == 0) {
+ rb_sys_fail(fptr->path);
+ }
}
return file;
@@ -5793,62 +3811,78 @@ rb_io_reopen(int argc, VALUE *argv, VALUE file)
/* :nodoc: */
static VALUE
-rb_io_init_copy(VALUE dest, VALUE io)
+rb_io_init_copy(dest, io)
+ VALUE dest, io;
{
rb_io_t *fptr, *orig;
int fd;
- VALUE write_io;
- off_t pos;
+ const char *mode;
io = rb_io_get_io(io);
if (dest == io) return dest;
GetOpenFile(io, orig);
MakeOpenFile(dest, fptr);
- rb_io_flush(io);
+ if (orig->f2) {
+ io_fflush(orig->f2, orig);
+ fseeko(orig->f, 0L, SEEK_CUR);
+ }
+ else if (orig->mode & FMODE_WRITABLE) {
+ io_fflush(orig->f, orig);
+ }
+ else {
+ fseeko(orig->f, 0L, SEEK_CUR);
+ }
/* copy rb_io_t structure */
- fptr->mode = orig->mode & ~FMODE_PREP;
- fptr->encs = orig->encs;
+ fptr->mode = orig->mode;
fptr->pid = orig->pid;
fptr->lineno = orig->lineno;
- if (!NIL_P(orig->pathv)) fptr->pathv = orig->pathv;
+ if (orig->path) fptr->path = strdup(orig->path);
fptr->finalize = orig->finalize;
-#if defined (__CYGWIN__) || !defined(HAVE_FORK)
- if (fptr->finalize == pipe_finalize)
- pipe_add_fptr(fptr);
-#endif
- fd = ruby_dup(orig->fd);
- fptr->fd = fd;
- pos = io_tell(orig);
- if (0 <= pos)
- io_seek(fptr, pos, SEEK_SET);
+ switch (fptr->mode & FMODE_READWRITE) {
+ case FMODE_READABLE:
+ default:
+ mode = "r"; break;
+ case FMODE_WRITABLE:
+ mode = "w"; break;
+ case FMODE_READWRITE:
+ if (orig->f2) mode = "r";
+ else mode = "r+";
+ break;
+ }
+ fd = ruby_dup(fileno(orig->f));
+ fptr->f = rb_fdopen(fd, mode);
+ fseeko(fptr->f, ftello(orig->f), SEEK_SET);
+ if (orig->f2) {
+ if (fileno(orig->f) != fileno(orig->f2)) {
+ fd = ruby_dup(fileno(orig->f2));
+ }
+ fptr->f2 = rb_fdopen(fd, "w");
+ fseeko(fptr->f2, ftello(orig->f2), SEEK_SET);
+ }
if (fptr->mode & FMODE_BINMODE) {
rb_io_binmode(dest);
}
- write_io = GetWriteIO(io);
- if (io != write_io) {
- write_io = rb_obj_dup(write_io);
- fptr->tied_io_for_writing = write_io;
- rb_ivar_set(dest, rb_intern("@tied_io_for_writing"), write_io);
- }
-
return dest;
}
/*
* call-seq:
* ios.printf(format_string [, obj, ...] ) => nil
- *
+ *
* Formats and writes to <em>ios</em>, converting parameters under
* control of the format string. See <code>Kernel#sprintf</code>
* for details.
*/
VALUE
-rb_io_printf(int argc, VALUE *argv, VALUE out)
+rb_io_printf(argc, argv, out)
+ int argc;
+ VALUE argv[];
+ VALUE out;
{
rb_io_write(out, rb_f_sprintf(argc, argv));
return Qnil;
@@ -5858,7 +3892,7 @@ rb_io_printf(int argc, VALUE *argv, VALUE out)
* call-seq:
* printf(io, string [, obj ... ] ) => nil
* printf(string [, obj ... ] ) => nil
- *
+ *
* Equivalent to:
* io.write(sprintf(string, obj, ...)
* or
@@ -5866,7 +3900,9 @@ rb_io_printf(int argc, VALUE *argv, VALUE out)
*/
static VALUE
-rb_f_printf(int argc, VALUE *argv)
+rb_f_printf(argc, argv)
+ int argc;
+ VALUE argv[];
{
VALUE out;
@@ -5888,7 +3924,7 @@ rb_f_printf(int argc, VALUE *argv)
* call-seq:
* ios.print() => nil
* ios.print(obj, ...) => nil
- *
+ *
* Writes the given object(s) to <em>ios</em>. The stream must be
* opened for writing. If the output record separator (<code>$\\</code>)
* is not <code>nil</code>, it will be appended to the output. If no
@@ -5896,16 +3932,19 @@ rb_f_printf(int argc, VALUE *argv)
* 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")
- *
+ *
* <em>produces:</em>
- *
+ *
* This is 100 percent.
*/
VALUE
-rb_io_print(int argc, VALUE *argv, VALUE out)
+rb_io_print(argc, argv, out)
+ int argc;
+ VALUE *argv;
+ VALUE out;
{
int i;
VALUE line;
@@ -5917,12 +3956,19 @@ rb_io_print(int argc, VALUE *argv, VALUE out)
argv = &line;
}
for (i=0; i<argc; i++) {
- rb_io_write(out, argv[i]);
- if (!NIL_P(rb_output_fs)) {
+ if (!NIL_P(rb_output_fs) && i>0) {
rb_io_write(out, rb_output_fs);
}
+ switch (TYPE(argv[i])) {
+ case T_NIL:
+ rb_io_write(out, rb_str_new2("nil"));
+ break;
+ default:
+ rb_io_write(out, argv[i]);
+ break;
+ }
}
- if (argc > 0 && !NIL_P(rb_output_rs)) {
+ if (!NIL_P(rb_output_rs)) {
rb_io_write(out, rb_output_rs);
}
@@ -5932,7 +3978,7 @@ rb_io_print(int argc, VALUE *argv, VALUE out)
/*
* call-seq:
* print(obj, ...) => nil
- *
+ *
* Prints each object in turn to <code>$stdout</code>. If the output
* field separator (<code>$,</code>) is not +nil+, its
* contents will appear between each field. If the output record
@@ -5940,20 +3986,22 @@ rb_io_print(int argc, VALUE *argv, VALUE out)
* 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.
- *
+ *
* print "cat", [1,2,3], 99, "\n"
* $, = ", "
* $\ = "\n"
* print "cat", [1,2,3], 99
- *
+ *
* <em>produces:</em>
- *
+ *
* cat12399
* cat, 1, 2, 3, 99
*/
static VALUE
-rb_f_print(int argc, VALUE *argv)
+rb_f_print(argc, argv)
+ int argc;
+ VALUE *argv;
{
rb_io_print(argc, argv, rb_stdout);
return Qnil;
@@ -5962,21 +4010,22 @@ rb_f_print(int argc, VALUE *argv)
/*
* call-seq:
* ios.putc(obj) => obj
- *
+ *
* If <i>obj</i> is <code>Numeric</code>, write the character whose
* code is <i>obj</i>, otherwise write the first character of the
* string representation of <i>obj</i> to <em>ios</em>.
- *
+ *
* $stdout.putc "A"
* $stdout.putc 65
- *
+ *
* <em>produces:</em>
- *
+ *
* AA
*/
static VALUE
-rb_io_putc(VALUE io, VALUE ch)
+rb_io_putc(io, ch)
+ VALUE io, ch;
{
char c = NUM2CHR(ch);
@@ -5987,34 +4036,31 @@ rb_io_putc(VALUE io, VALUE ch)
/*
* call-seq:
* putc(int) => int
- *
+ *
* Equivalent to:
*
* $stdout.putc(int)
*/
static VALUE
-rb_f_putc(VALUE recv, VALUE ch)
+rb_f_putc(recv, ch)
+ VALUE recv, ch;
{
- if (recv == rb_stdout) {
- return rb_io_putc(recv, ch);
- }
- return rb_funcall2(rb_stdout, rb_intern("putc"), 1, &ch);
+ return rb_io_putc(rb_stdout, ch);
}
static VALUE
-io_puts_ary(VALUE ary, VALUE out, int recur)
+io_puts_ary(ary, out)
+ VALUE ary, out;
{
VALUE tmp;
long i;
- if (recur) {
- tmp = rb_str_new2("[...]");
- rb_io_puts(1, &tmp, out);
- return Qnil;
- }
- for (i=0; i<RARRAY_LEN(ary); i++) {
- tmp = RARRAY_PTR(ary)[i];
+ for (i=0; i<RARRAY(ary)->len; i++) {
+ tmp = RARRAY(ary)->ptr[i];
+ if (rb_inspecting_p(tmp)) {
+ tmp = rb_str_new2("[...]");
+ }
rb_io_puts(1, &tmp, out);
}
return Qnil;
@@ -6023,17 +4069,17 @@ io_puts_ary(VALUE ary, VALUE out, int recur)
/*
* call-seq:
* ios.puts(obj, ...) => nil
- *
+ *
* Writes the given objects to <em>ios</em> as with
* <code>IO#print</code>. Writes a record separator (typically a
* newline) after any that do not already end with a newline sequence.
* If called with an array argument, writes each element on a new line.
* If called without arguments, outputs a single record separator.
- *
+ *
* $stdout.puts("this", "is", "a", "test")
- *
+ *
* <em>produces:</em>
- *
+ *
* this
* is
* a
@@ -6041,7 +4087,10 @@ io_puts_ary(VALUE ary, VALUE out, int recur)
*/
VALUE
-rb_io_puts(int argc, VALUE *argv, VALUE out)
+rb_io_puts(argc, argv, out)
+ int argc;
+ VALUE *argv;
+ VALUE out;
{
int i;
VALUE line;
@@ -6052,15 +4101,20 @@ rb_io_puts(int argc, VALUE *argv, VALUE out)
return Qnil;
}
for (i=0; i<argc; i++) {
- line = rb_check_array_type(argv[i]);
- if (!NIL_P(line)) {
- rb_exec_recursive(io_puts_ary, line, out);
- continue;
+ if (NIL_P(argv[i])) {
+ line = rb_str_new2("nil");
+ }
+ else {
+ line = rb_check_array_type(argv[i]);
+ if (!NIL_P(line)) {
+ rb_protect_inspect(io_puts_ary, line, out);
+ continue;
+ }
+ line = rb_obj_as_string(argv[i]);
}
- line = rb_obj_as_string(argv[i]);
rb_io_write(out, line);
- if (RSTRING_LEN(line) == 0 ||
- RSTRING_PTR(line)[RSTRING_LEN(line)-1] != '\n') {
+ if (RSTRING(line)->len == 0 ||
+ RSTRING(line)->ptr[RSTRING(line)->len-1] != '\n') {
rb_io_write(out, rb_default_rs);
}
}
@@ -6071,134 +4125,122 @@ rb_io_puts(int argc, VALUE *argv, VALUE out)
/*
* call-seq:
* puts(obj, ...) => nil
- *
- * Equivalent to
+ *
+ * Equivalent to
*
* $stdout.puts(obj, ...)
*/
static VALUE
-rb_f_puts(int argc, VALUE *argv, VALUE recv)
+rb_f_puts(argc, argv)
+ int argc;
+ VALUE *argv;
{
- if (recv == rb_stdout) {
- return rb_io_puts(argc, argv, recv);
- }
- return rb_funcall2(rb_stdout, rb_intern("puts"), argc, argv);
+ rb_io_puts(argc, argv, rb_stdout);
+ return Qnil;
}
void
-rb_p(VALUE obj) /* for debug print within C code */
+rb_p(obj) /* for debug print within C code */
+ VALUE obj;
{
- VALUE str = rb_obj_as_string(rb_inspect(obj));
- if (TYPE(rb_stdout) == T_FILE &&
- rb_method_basic_definition_p(CLASS_OF(rb_stdout), id_write)) {
- io_write(rb_stdout, str, 1);
- io_write(rb_stdout, rb_default_rs, 0);
- }
- else {
- rb_io_write(rb_stdout, str);
- rb_io_write(rb_stdout, rb_default_rs);
- }
+ rb_io_write(rb_stdout, rb_obj_as_string(rb_inspect(obj)));
+ rb_io_write(rb_stdout, rb_default_rs);
}
/*
* call-seq:
- * p(obj) => obj
- * p(obj1, obj2, ...) => [obj, ...]
- * p() => nil
- *
+ * p(obj, ...) => nil
+ *
* For each object, directly writes
* _obj_.+inspect+ followed by the current output
* record separator to the program's standard output.
- *
+ *
* S = Struct.new(:name, :state)
* s = S['dave', 'TX']
* p s
- *
+ *
* <em>produces:</em>
- *
+ *
* #<S name="dave", state="TX">
*/
static VALUE
-rb_f_p(int argc, VALUE *argv, VALUE self)
+rb_f_p(argc, argv)
+ int argc;
+ VALUE *argv;
{
int i;
- VALUE ret = Qnil;
for (i=0; i<argc; i++) {
rb_p(argv[i]);
}
- if (argc == 1) {
- ret = argv[0];
- }
- else if (argc > 1) {
- ret = rb_ary_new4(argc, argv);
- }
if (TYPE(rb_stdout) == T_FILE) {
rb_io_flush(rb_stdout);
}
- return ret;
+ return Qnil;
}
/*
* call-seq:
* obj.display(port=$>) => nil
- *
+ *
* Prints <i>obj</i> on the given port (default <code>$></code>).
* Equivalent to:
- *
+ *
* def display(port=$>)
* port.write self
* end
- *
+ *
* For example:
- *
+ *
* 1.display
* "cat".display
* [ 4, 5, 6 ].display
* puts
- *
+ *
* <em>produces:</em>
- *
+ *
* 1cat456
*/
static VALUE
-rb_obj_display(int argc, VALUE *argv, VALUE self)
+rb_obj_display(argc, argv, self)
+ int argc;
+ VALUE *argv;
+ VALUE self;
{
VALUE out;
- if (argc == 0) {
+ if (rb_scan_args(argc, argv, "01", &out) == 0) {
out = rb_stdout;
}
- else {
- rb_scan_args(argc, argv, "01", &out);
- }
+
rb_io_write(out, self);
return Qnil;
}
void
-rb_write_error2(const char *mesg, long len)
+rb_write_error2(mesg, len)
+ const char *mesg;
+ long len;
{
- if (rb_stderr == orig_stderr || RFILE(orig_stderr)->fptr->fd < 0) {
- (void)fwrite(mesg, sizeof(char), len, stderr);
- }
- else {
- rb_io_write(rb_stderr, rb_str_new(mesg, len));
- }
+ rb_io_write(rb_stderr, rb_str_new(mesg, len));
}
void
-rb_write_error(const char *mesg)
+rb_write_error(mesg)
+ const char *mesg;
{
rb_write_error2(mesg, strlen(mesg));
}
static void
-must_respond_to(ID mid, VALUE val, ID id)
+must_respond_to(mid, val, id)
+ ID mid;
+ VALUE val;
+ ID id;
{
if (!rb_respond_to(val, mid)) {
rb_raise(rb_eTypeError, "%s must have %s method, %s given",
@@ -6208,212 +4250,139 @@ must_respond_to(ID mid, VALUE val, ID id)
}
static void
-stdout_setter(VALUE val, ID id, VALUE *variable)
+stdout_setter(val, id, variable)
+ VALUE val;
+ ID id;
+ VALUE *variable;
{
must_respond_to(id_write, val, id);
*variable = val;
}
+static void
+defout_setter(val, id, variable)
+ VALUE val;
+ ID id;
+ VALUE *variable;
+{
+ stdout_setter(val, id, variable);
+ rb_warn("$defout is obsolete; use $stdout instead");
+}
+
+static void
+deferr_setter(val, id, variable)
+ VALUE val;
+ ID id;
+ VALUE *variable;
+{
+ stdout_setter(val, id, variable);
+ rb_warn("$deferr is obsolete; use $stderr instead");
+}
+
static VALUE
-prep_io(int fd, int fmode, VALUE klass, const char *path)
+prep_stdio(f, mode, klass)
+ FILE *f;
+ int mode;
+ VALUE klass;
{
rb_io_t *fp;
VALUE io = io_alloc(klass);
MakeOpenFile(io, fp);
- fp->fd = fd;
#ifdef __CYGWIN__
- if (!isatty(fd)) {
- fmode |= FMODE_BINMODE;
- setmode(fd, O_BINARY);
+ if (!isatty(fileno(f))) {
+ mode |= O_BINARY;
+ setmode(fileno(f), O_BINARY);
}
#endif
- fp->mode = fmode;
- io_check_tty(fp);
- if (path) fp->pathv = rb_obj_freeze(rb_str_new_cstr(path));
+ fp->f = f;
+ fp->mode = mode;
return io;
}
-VALUE
-rb_io_fdopen(int fd, int oflags, const char *path)
-{
- VALUE klass = rb_cIO;
-
- if (path && strcmp(path, "-")) klass = rb_cFile;
- return prep_io(fd, rb_io_oflags_fmode(oflags), klass, path);
-}
-
-static VALUE
-prep_stdio(FILE *f, int fmode, VALUE klass, const char *path)
+static void
+prep_path(io, path)
+ VALUE io;
+ char *path;
{
rb_io_t *fptr;
- VALUE io = prep_io(fileno(f), fmode|FMODE_PREP, klass, path);
GetOpenFile(io, fptr);
- fptr->stdio_file = f;
-
- return io;
-}
-
-FILE *
-rb_io_stdio_file(rb_io_t *fptr)
-{
- if (!fptr->stdio_file) {
- int oflags = rb_io_fmode_oflags(fptr->mode);
- fptr->stdio_file = rb_fdopen(fptr->fd, rb_io_oflags_modestr(oflags));
- }
- return fptr->stdio_file;
+ if (fptr->path) rb_bug("illegal prep_path() call");
+ fptr->path = strdup(path);
}
/*
* call-seq:
- * IO.new(fd [, mode] [, opt]) => io
- *
+ * IO.new(fd, mode) => io
+ *
* Returns a new <code>IO</code> object (a stream) for the given
- * <code>IO</code> object or integer file descriptor and mode
- * string. See also <code>IO#fileno</code> and
- * <code>IO.for_fd</code>.
- *
- * === Parameters
- * fd:: numeric file descriptor
- * mode:: file mode. a string or an integer
- * opt:: hash for specifiying mode by name.
- *
- * ==== Mode
- * When <code>mode</code> is an integer it must be combination of
- * the modes defined in <code>File::Constants</code>.
- *
- * When <code>mode</code> is a string it must be in one of the
- * following forms:
- * - "fmode",
- * - "fmode:extern",
- * - "fmode:extern:intern".
- * <code>extern</code> is the external encoding name for the IO.
- * <code>intern</code> is the internal encoding.
- * <code>fmode</code> must be combination of the directives. See
- * the description of class +IO+ for a description of the directives.
- *
- * ==== Options
- * <code>opt</code> can have the following keys
- * :mode ::
- * same as <code>mode</code> parameter
- * :external_encoding ::
- * 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.
- * :encoding ::
- * specifies external and internal encodings as "extern:intern".
- * :textmode ::
- * If the value is truth value, same as "b" in argument <code>mode</code>.
- * :binmode ::
- * If the value is truth value, same as "t" in argument <code>mode</code>.
- *
- * Also <code>opt</code> can have same keys in <code>String#encode</code> for
- * controlling conversion between the external encoding and the internal encoding.
- *
- * === Example1
- *
+ * integer file descriptor and mode string. See also
+ * <code>IO#fileno</code> and <code>IO::for_fd</code>.
+ *
* a = IO.new(2,"w") # '2' is standard error
* $stderr.puts "Hello"
* a.puts "World"
- *
+ *
* <em>produces:</em>
- *
+ *
* Hello
* World
- *
- * === Example2
- * io = IO.new(2, mode: 'w:UTF-16LE', cr_newline: true)
- * io.puts "Hello, World!"
- *
- * io = IO.new(2, mode: 'w', cr_newline: true, external_encoding: Encoding::UTF_16LE)
- * io.puts "Hello, World!"
- *
- * both of aboves print "Hello, World!" in UTF-16LE to standard error output with
- * converting EOL generated by <code>puts</code> to CR.
*/
static VALUE
-rb_io_initialize(int argc, VALUE *argv, VALUE io)
+rb_io_initialize(argc, argv, io)
+ int argc;
+ VALUE *argv;
+ VALUE io;
{
- VALUE fnum, vmode;
+ VALUE fnum, mode;
rb_io_t *fp;
- int fd, fmode, oflags = O_RDONLY;
- convconfig_t convconfig;
- VALUE opt;
-#if defined(HAVE_FCNTL) && defined(F_GETFL)
- int ofmode;
-#else
- struct stat st;
-#endif
+ int fd, flags;
rb_secure(4);
-
- opt = pop_last_hash(&argc, argv);
- rb_scan_args(argc, argv, "11", &fnum, &vmode);
- rb_io_extract_modeenc(&vmode, 0, opt, &oflags, &fmode, &convconfig);
-
+ rb_scan_args(argc, argv, "11", &fnum, &mode);
fd = NUM2INT(fnum);
+ if (argc == 2) {
+ if (FIXNUM_P(mode)) {
+ flags = FIX2LONG(mode);
+ }
+ else {
+ SafeStringValue(mode);
+ flags = rb_io_mode_modenum(StringValueCStr(mode));
+ }
+ }
+ else {
#if defined(HAVE_FCNTL) && defined(F_GETFL)
- oflags = fcntl(fd, F_GETFL);
- if (oflags == -1) rb_sys_fail(0);
+ flags = fcntl(fd, F_GETFL);
+ if (flags == -1) rb_sys_fail(0);
#else
- if (fstat(fd, &st) == -1) rb_sys_fail(0);
+ flags = O_RDONLY;
#endif
- UPDATE_MAXFD(fd);
-#if defined(HAVE_FCNTL) && defined(F_GETFL)
- ofmode = rb_io_oflags_fmode(oflags);
- if (NIL_P(vmode)) {
- fmode = ofmode;
- }
- else if ((~ofmode & fmode) & FMODE_READWRITE) {
- VALUE error = INT2FIX(EINVAL);
- rb_exc_raise(rb_class_new_instance(1, &error, rb_eSystemCallError));
}
-#endif
MakeOpenFile(io, fp);
- fp->fd = fd;
- fp->mode = fmode;
- fp->encs = convconfig;
- clear_codeconv(fp);
- io_check_tty(fp);
- if (fileno(stdin) == fd)
- fp->stdio_file = stdin;
- else if (fileno(stdout) == fd)
- fp->stdio_file = stdout;
- else if (fileno(stderr) == fd)
- fp->stdio_file = stderr;
-
- if (fmode & FMODE_STRIP_BOM) io_set_encoding_by_bom(io);
+ fp->mode = rb_io_modenum_flags(flags);
+ fp->f = rb_fdopen(fd, rb_io_modenum_mode(flags));
+
return io;
}
/*
* call-seq:
- * File.new(filename, mode="r" [, opt]) => file
- * File.new(filename [, mode [, perm]] [, opt]) => file
- *
+ * File.new(filename, mode="r") => file
+ * File.new(filename [, mode [, perm]]) => file
+ *
+
* Opens the file named by _filename_ according to
* _mode_ (default is ``r'') and returns a new
- * <code>File</code> object.
- *
- * === Parameters
- * See the description of class +IO+ for a description of _mode_.
- * The file mode may optionally be specified as a +Fixnum+
- * by _or_-ing together the flags (O_RDONLY etc,
- * again described under +IO+).
- *
- * Optional permission bits may be given in _perm_.
- * These mode and permission bits are platform dependent;
- * on Unix systems, see <code>open(2)</code> for details.
- *
- * Optional _opt_ parameter is same as in <code.IO.open</code>.
- *
- * === Examples
+ * <code>File</code> object. See the description of class +IO+ for
+ * a description of _mode_. The file mode may optionally be
+ * specified as a +Fixnum+ by _or_-ing together the
+ * flags (O_RDONLY etc, again described under +IO+). Optional
+ * permission bits may be given in _perm_. These mode and permission
+ * bits are platform dependent; on Unix systems, see
+ * <code>open(2)</code> for details.
*
* f = File.new("testfile", "r")
* f = File.new("newfile", "w+")
@@ -6421,7 +4390,10 @@ rb_io_initialize(int argc, VALUE *argv, VALUE io)
*/
static VALUE
-rb_file_initialize(int argc, VALUE *argv, VALUE io)
+rb_file_initialize(argc, argv, io)
+ int argc;
+ VALUE *argv;
+ VALUE io;
{
if (RFILE(io)->fptr) {
rb_raise(rb_eRuntimeError, "reinitializing File");
@@ -6439,8 +4411,29 @@ rb_file_initialize(int argc, VALUE *argv, VALUE io)
return io;
}
+/*
+ * call-seq:
+ * IO.new(fd, mode_string) => io
+ *
+ * Returns a new <code>IO</code> object (a stream) for the given
+ * integer file descriptor and mode string. See also
+ * <code>IO#fileno</code> and <code>IO::for_fd</code>.
+ *
+ * a = IO.new(2,"w") # '2' is standard error
+ * $stderr.puts "Hello"
+ * a.puts "World"
+ *
+ * <em>produces:</em>
+ *
+ * Hello
+ * World
+ */
+
static VALUE
-rb_io_s_new(int argc, VALUE *argv, VALUE klass)
+rb_io_s_new(argc, argv, klass)
+ int argc;
+ VALUE *argv;
+ VALUE klass;
{
if (rb_block_given_p()) {
const char *cname = rb_class2name(klass);
@@ -6451,125 +4444,56 @@ rb_io_s_new(int argc, VALUE *argv, VALUE klass)
return rb_class_new_instance(argc, argv, klass);
}
-
/*
* call-seq:
- * IO.for_fd(fd, mode [, opt]) => io
- *
- * Synonym for <code>IO.new</code>.
- *
+ * IO.for_fd(fd, mode) => io
+ *
+ * Synonym for <code>IO::new</code>.
+ *
*/
static VALUE
-rb_io_s_for_fd(int argc, VALUE *argv, VALUE klass)
+rb_io_s_for_fd(argc, argv, klass)
+ int argc;
+ VALUE *argv;
+ VALUE klass;
{
VALUE io = rb_obj_alloc(klass);
rb_io_initialize(argc, argv, io);
return io;
}
-static void
-argf_mark(void *ptr)
-{
- struct argf *p = ptr;
- rb_gc_mark(p->filename);
- rb_gc_mark(p->current_file);
- rb_gc_mark(p->argv);
- rb_gc_mark(p->encs.ecopts);
-}
-
-static void
-argf_free(void *ptr)
-{
- struct argf *p = ptr;
- xfree(p->inplace);
- xfree(p);
-}
-
-static inline void
-argf_init(struct argf *p, VALUE v)
-{
- p->filename = Qnil;
- p->current_file = Qnil;
- p->lineno = 0;
- p->argv = v;
-}
-
-static VALUE
-argf_alloc(VALUE klass)
-{
- struct argf *p;
- VALUE argf = Data_Make_Struct(klass, struct argf, argf_mark, argf_free, p);
-
- argf_init(p, Qnil);
- return argf;
-}
-
-#undef rb_argv
-
-static VALUE
-argf_initialize(VALUE argf, VALUE argv)
-{
- memset(&ARGF, 0, sizeof(ARGF));
- argf_init(&ARGF, argv);
-
- return argf;
-}
+static int binmode = 0;
static VALUE
-argf_initialize_copy(VALUE argf, VALUE orig)
+argf_forward(int argc, VALUE *argv)
{
- 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;
+ return rb_funcall3(current_file, ruby_frame->last_func, argc, argv);
}
-static VALUE
-argf_set_lineno(VALUE argf, VALUE val)
-{
- ARGF.lineno = NUM2INT(val);
- ARGF.last_lineno = ARGF.lineno;
- return Qnil;
-}
-
-static VALUE
-argf_lineno(VALUE argf)
-{
- return INT2FIX(ARGF.lineno);
-}
-
-static VALUE
-argf_forward(int argc, VALUE *argv, VALUE argf)
-{
- return rb_funcall3(ARGF.current_file, rb_frame_this_func(), argc, argv);
-}
-
-#define next_argv() argf_next_argv(argf)
-#define ARGF_GENERIC_INPUT_P() \
- (ARGF.current_file == rb_stdin && TYPE(ARGF.current_file) != T_FILE)
#define ARGF_FORWARD(argc, argv) do {\
- if (ARGF_GENERIC_INPUT_P())\
- return argf_forward(argc, argv, argf);\
+ if (TYPE(current_file) != T_FILE)\
+ return argf_forward(argc, argv);\
} while (0)
#define NEXT_ARGF_FORWARD(argc, argv) do {\
- if (!next_argv()) return Qnil;\
- ARGF_FORWARD(argc, argv);\
+ if (!next_argv()) return Qnil;\
+ ARGF_FORWARD(argc, argv);\
} while (0)
static void
-argf_close(VALUE file)
+argf_close(file)
+ VALUE file;
{
- rb_funcall3(file, rb_intern("close"), 0, 0);
+ if (TYPE(file) == T_FILE)
+ rb_io_close(file);
+ else
+ rb_funcall3(file, rb_intern("close"), 0, 0);
}
static int
-argf_next_argv(VALUE argf)
+next_argv()
{
+ extern VALUE rb_argv;
char *fn;
rb_io_t *fptr;
int stdout_binmode = 0;
@@ -6580,61 +4504,62 @@ argf_next_argv(VALUE argf)
stdout_binmode = 1;
}
- if (ARGF.init_p == 0) {
- if (!NIL_P(ARGF.argv) && RARRAY_LEN(ARGF.argv) > 0) {
- ARGF.next_p = 1;
+ if (init_p == 0) {
+ if (RARRAY(rb_argv)->len > 0) {
+ next_p = 1;
}
else {
- ARGF.next_p = -1;
+ next_p = -1;
}
- ARGF.init_p = 1;
+ init_p = 1;
+ gets_lineno = 0;
}
- if (ARGF.next_p == 1) {
- ARGF.next_p = 0;
+ if (next_p == 1) {
+ next_p = 0;
retry:
- if (RARRAY_LEN(ARGF.argv) > 0) {
- ARGF.filename = rb_ary_shift(ARGF.argv);
- fn = StringValueCStr(ARGF.filename);
+ if (RARRAY(rb_argv)->len > 0) {
+ filename = rb_ary_shift(rb_argv);
+ fn = StringValueCStr(filename);
if (strlen(fn) == 1 && fn[0] == '-') {
- ARGF.current_file = rb_stdin;
- if (ARGF.inplace) {
+ current_file = rb_stdin;
+ if (ruby_inplace_mode) {
rb_warn("Can't do inplace edit for stdio; skipping");
goto retry;
}
}
else {
- int fr = rb_sysopen(ARGF.filename, O_RDONLY, 0);
+ FILE *fr = rb_fopen(fn, "r");
- if (ARGF.inplace) {
+ if (ruby_inplace_mode) {
struct stat st;
#ifndef NO_SAFE_RENAME
struct stat st2;
#endif
VALUE str;
- int fw;
+ FILE *fw;
if (TYPE(rb_stdout) == T_FILE && rb_stdout != orig_stdout) {
rb_io_close(rb_stdout);
}
- fstat(fr, &st);
- if (*ARGF.inplace) {
+ fstat(fileno(fr), &st);
+ if (*ruby_inplace_mode) {
str = rb_str_new2(fn);
#ifdef NO_LONG_FNAME
- ruby_add_suffix(str, ARGF.inplace);
+ ruby_add_suffix(str, ruby_inplace_mode);
#else
- rb_str_cat2(str, ARGF.inplace);
+ rb_str_cat2(str, ruby_inplace_mode);
#endif
#ifdef NO_SAFE_RENAME
- (void)close(fr);
- (void)unlink(RSTRING_PTR(str));
- (void)rename(fn, RSTRING_PTR(str));
- fr = rb_sysopen(str, O_RDONLY, 0);
+ (void)fclose(fr);
+ (void)unlink(RSTRING(str)->ptr);
+ (void)rename(fn, RSTRING(str)->ptr);
+ fr = rb_fopen(RSTRING(str)->ptr, "r");
#else
- if (rename(fn, RSTRING_PTR(str)) < 0) {
+ if (rename(fn, RSTRING(str)->ptr) < 0) {
rb_warn("Can't rename %s to %s: %s, skipping file",
- fn, RSTRING_PTR(str), strerror(errno));
- close(fr);
+ fn, RSTRING(str)->ptr, strerror(errno));
+ fclose(fr);
goto retry;
}
#endif
@@ -6646,50 +4571,41 @@ argf_next_argv(VALUE argf)
if (unlink(fn) < 0) {
rb_warn("Can't remove %s: %s, skipping file",
fn, strerror(errno));
- close(fr);
+ fclose(fr);
goto retry;
}
#endif
}
- fw = rb_sysopen(ARGF.filename, O_WRONLY|O_CREAT|O_TRUNC, 0666);
+ fw = rb_fopen(fn, "w");
#ifndef NO_SAFE_RENAME
- fstat(fw, &st2);
+ fstat(fileno(fw), &st2);
#ifdef HAVE_FCHMOD
- fchmod(fw, st.st_mode);
+ fchmod(fileno(fw), st.st_mode);
#else
chmod(fn, st.st_mode);
#endif
if (st.st_uid!=st2.st_uid || st.st_gid!=st2.st_gid) {
-#ifdef HAVE_FCHOWN
- (void)fchown(fw, st.st_uid, st.st_gid);
-#else
- (void)chown(fn, st.st_uid, st.st_gid);
-#endif
+ fchown(fileno(fw), st.st_uid, st.st_gid);
}
#endif
- rb_stdout = prep_io(fw, FMODE_WRITABLE, rb_cFile, fn);
+ rb_stdout = prep_stdio(fw, FMODE_WRITABLE, rb_cFile);
+ prep_path(rb_stdout, fn);
if (stdout_binmode) rb_io_binmode(rb_stdout);
}
- ARGF.current_file = prep_io(fr, FMODE_READABLE, rb_cFile, fn);
- }
- if (ARGF.binmode) rb_io_ascii8bit_binmode(ARGF.current_file);
- if (ARGF.encs.enc) {
- rb_io_t *fptr;
-
- GetOpenFile(ARGF.current_file, fptr);
- fptr->encs = ARGF.encs;
- clear_codeconv(fptr);
+ current_file = prep_stdio(fr, FMODE_READABLE, rb_cFile);
+ prep_path(current_file, fn);
}
+ if (binmode) rb_io_binmode(current_file);
}
else {
- ARGF.next_p = 1;
+ next_p = 1;
return Qfalse;
}
}
- else if (ARGF.next_p == -1) {
- ARGF.current_file = rb_stdin;
- ARGF.filename = rb_str_new2("-");
- if (ARGF.inplace) {
+ else if (next_p == -1) {
+ current_file = rb_stdin;
+ filename = rb_str_new2("-");
+ if (ruby_inplace_mode) {
rb_warn("Can't do inplace edit for stdio");
rb_stdout = orig_stdout;
}
@@ -6698,160 +4614,132 @@ argf_next_argv(VALUE argf)
}
static VALUE
-argf_getline(int argc, VALUE *argv, VALUE argf)
+argf_getline(argc, argv)
+ int argc;
+ VALUE *argv;
{
VALUE line;
retry:
if (!next_argv()) return Qnil;
- if (ARGF_GENERIC_INPUT_P()) {
- line = rb_funcall3(ARGF.current_file, rb_intern("gets"), argc, argv);
+ if (argc == 0 && rb_rs == rb_default_rs) {
+ line = rb_io_gets(current_file);
}
else {
- if (argc == 0 && rb_rs == rb_default_rs) {
- line = rb_io_gets(ARGF.current_file);
+ VALUE rs;
+
+ if (argc == 0) {
+ rs = rb_rs;
}
else {
- line = rb_io_getline(argc, argv, ARGF.current_file);
- }
- if (NIL_P(line) && ARGF.next_p != -1) {
- argf_close(ARGF.current_file);
- ARGF.next_p = 1;
- goto retry;
+ rb_scan_args(argc, argv, "1", &rs);
+ if (!NIL_P(rs)) StringValue(rs);
}
+ line = rb_io_getline(rs, current_file);
+ }
+ if (NIL_P(line) && next_p != -1) {
+ argf_close(current_file);
+ next_p = 1;
+ goto retry;
}
if (!NIL_P(line)) {
- ARGF.lineno++;
- ARGF.last_lineno = ARGF.lineno;
+ gets_lineno++;
+ lineno = INT2FIX(gets_lineno);
}
return line;
}
-static VALUE
-argf_lineno_getter(ID id, VALUE *var)
-{
- VALUE argf = *var;
- return INT2FIX(ARGF.last_lineno);
-}
-
-static void
-argf_lineno_setter(VALUE val, ID id, VALUE *var)
-{
- VALUE argf = *var;
- int n = NUM2INT(val);
- ARGF.last_lineno = ARGF.lineno = n;
-}
-
-static VALUE argf_gets(int, VALUE *, VALUE);
-
/*
* call-seq:
- * gets(sep=$/) => string or nil
- * gets(limit) => string or nil
- * gets(sep,limit) => string or nil
- *
+ * gets(separator=$/) => 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
- * no files are present on the command line. Returns +nil+ at end of
- * file. The optional argument specifies the record separator. The
- * separator is included with the contents of each record. A separator
- * of +nil+ reads the entire contents, and a zero-length separator
- * reads the input one paragraph at a time, where paragraphs are
- * divided by two consecutive newlines. If the first argument is an
- * integer, or optional second argument is given, the returning string
- * would not be longer than the given value in bytes. If multiple
- * filenames are present in +ARGV+, +gets(nil)+ will read the contents
- * one file at a time.
- *
+ * of files in +ARGV+ (or <code>$*</code>), or from standard
+ * input if no files are present on the command line. Returns
+ * +nil+ at end of file. The optional argument specifies the
+ * record separator. The separator is included with the contents of
+ * each record. A separator of +nil+ reads the entire
+ * contents, and a zero-length separator reads the input one paragraph
+ * at a time, where paragraphs are divided by two consecutive newlines.
+ * If multiple filenames are present in +ARGV+,
+ * +gets(nil)+ will read the contents one file at a time.
+ *
* ARGV << "testfile"
* print while gets
- *
+ *
* <em>produces:</em>
- *
+ *
* This is line one
* This is line two
* This is line three
* And so on...
- *
+ *
* The style of programming using <code>$_</code> as an implicit
* parameter is gradually losing favor in the Ruby community.
*/
static VALUE
-rb_f_gets(int argc, VALUE *argv, VALUE recv)
-{
- if (recv == argf) {
- return argf_gets(argc, argv, argf);
- }
- return rb_funcall2(argf, rb_intern("gets"), argc, argv);
-}
-
-static VALUE
-argf_gets(int argc, VALUE *argv, VALUE argf)
+rb_f_gets(argc, argv)
+ int argc;
+ VALUE *argv;
{
VALUE line;
- line = argf_getline(argc, argv, argf);
+ if (!next_argv()) return Qnil;
+ if (TYPE(current_file) != T_FILE) {
+ line = rb_funcall3(current_file, rb_intern("gets"), argc, argv);
+ }
+ else {
+ line = argf_getline(argc, argv);
+ }
rb_lastline_set(line);
-
return line;
}
VALUE
-rb_gets(void)
+rb_gets()
{
VALUE line;
if (rb_rs != rb_default_rs) {
- return rb_f_gets(0, 0, argf);
+ return rb_f_gets(0, 0);
}
retry:
if (!next_argv()) return Qnil;
- line = rb_io_gets(ARGF.current_file);
- if (NIL_P(line) && ARGF.next_p != -1) {
- rb_io_close(ARGF.current_file);
- ARGF.next_p = 1;
+ line = rb_io_gets(current_file);
+ if (NIL_P(line) && next_p != -1) {
+ argf_close(current_file);
+ next_p = 1;
goto retry;
}
rb_lastline_set(line);
if (!NIL_P(line)) {
- ARGF.lineno++;
- ARGF.last_lineno = ARGF.lineno;
+ gets_lineno++;
+ lineno = INT2FIX(gets_lineno);
}
return line;
}
-static VALUE argf_readline(int, VALUE *, VALUE);
-
/*
* call-seq:
- * readline(sep=$/) => string
- * readline(limit) => string
- * readline(sep, limit) => string
- *
+ * readline(separator=$/) => string
+ *
* Equivalent to <code>Kernel::gets</code>, except
* +readline+ raises +EOFError+ at end of file.
*/
static VALUE
-rb_f_readline(int argc, VALUE *argv, VALUE recv)
-{
- if (recv == argf) {
- return argf_readline(argc, argv, argf);
- }
- return rb_funcall2(argf, rb_intern("readline"), argc, argv);
-}
-
-static VALUE
-argf_readline(int argc, VALUE *argv, VALUE argf)
+rb_f_readline(argc, argv)
+ int argc;
+ VALUE *argv;
{
VALUE line;
if (!next_argv()) rb_eof_error();
ARGF_FORWARD(argc, argv);
- line = argf_gets(argc, argv, argf);
+ line = rb_f_gets(argc, argv);
if (NIL_P(line)) {
rb_eof_error();
}
@@ -6859,34 +4747,38 @@ argf_readline(int argc, VALUE *argv, VALUE argf)
return line;
}
-static VALUE argf_readlines(int, VALUE *, VALUE);
-
/*
- * call-seq:
- * 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.
+ * obsolete
*/
static VALUE
-rb_f_readlines(int argc, VALUE *argv, VALUE recv)
+rb_f_getc()
{
- if (recv == argf) {
- return argf_readlines(argc, argv, argf);
+ rb_warn("getc is obsolete; use STDIN.getc instead");
+ if (TYPE(rb_stdin) != T_FILE) {
+ return rb_funcall3(rb_stdin, rb_intern("getc"), 0, 0);
}
- return rb_funcall2(argf, rb_intern("readlines"), argc, argv);
+ return rb_io_getc(rb_stdin);
}
+/*
+ * call-seq:
+ * readlines(separator=$/) => array
+ *
+ * Returns an array containing the lines returned by calling
+ * <code>Kernel.gets(<i>separator</i>)</code> until the end of file.
+ */
+
static VALUE
-argf_readlines(int argc, VALUE *argv, VALUE argf)
+rb_f_readlines(argc, argv)
+ int argc;
+ VALUE *argv;
{
VALUE line, ary;
+ NEXT_ARGF_FORWARD(argc, argv);
ary = rb_ary_new();
- while (!NIL_P(line = argf_getline(argc, argv, argf))) {
+ while (!NIL_P(line = argf_getline(argc, argv))) {
rb_ary_push(ary, line);
}
@@ -6896,11 +4788,11 @@ argf_readlines(int argc, VALUE *argv, VALUE argf)
/*
* call-seq:
* `cmd` => string
- *
+ *
* Returns the standard output of running _cmd_ in a subshell.
* The built-in syntax <code>%x{...}</code> uses
* this method. Sets <code>$?</code> to the process status.
- *
+ *
* `date` #=> "Wed Apr 9 08:56:30 CDT 2003\n"
* `ls testdir`.split[1] #=> "main.rb"
* `echo oops && exit 99` #=> "oops\n"
@@ -6908,14 +4800,15 @@ argf_readlines(int argc, VALUE *argv, VALUE argf)
*/
static VALUE
-rb_f_backquote(VALUE obj, VALUE str)
+rb_f_backquote(obj, str)
+ VALUE obj, str;
{
volatile VALUE port;
VALUE result;
rb_io_t *fptr;
SafeStringValue(str);
- port = pipe_open_s(str, "r", FMODE_READABLE, NULL);
+ port = pipe_open(str, 0, "r");
if (NIL_P(port)) return rb_str_new(0,0);
GetOpenFile(port, fptr);
@@ -6929,66 +4822,93 @@ rb_f_backquote(VALUE obj, VALUE str)
#include <sys/select.h>
#endif
+/*
+ * call-seq:
+ * IO.select(read_array
+ * [, write_array
+ * [, error_array
+ * [, timeout]]] ) => array or nil
+ *
+ * See <code>Kernel#select</code>.
+ */
+
static VALUE
-select_internal(VALUE read, VALUE write, VALUE except, struct timeval *tp, rb_fdset_t *fds)
+rb_f_select(argc, argv, obj)
+ int argc;
+ VALUE *argv;
+ VALUE obj;
{
- VALUE res, list;
- rb_fdset_t *rp, *wp, *ep;
+ VALUE read, write, except, timeout, res, list;
+ fd_set rset, wset, eset, pset;
+ fd_set *rp, *wp, *ep;
+ struct timeval *tp, timerec;
rb_io_t *fptr;
long i;
int max = 0, n;
int interrupt_flag = 0;
int pending = 0;
- struct timeval timerec;
+ rb_scan_args(argc, argv, "13", &read, &write, &except, &timeout);
+ if (NIL_P(timeout)) {
+ tp = 0;
+ }
+ else {
+ timerec = rb_time_interval(timeout);
+ tp = &timerec;
+ }
+
+ FD_ZERO(&pset);
if (!NIL_P(read)) {
Check_Type(read, T_ARRAY);
- for (i=0; i<RARRAY_LEN(read); i++) {
- GetOpenFile(rb_io_get_io(RARRAY_PTR(read)[i]), fptr);
- rb_fd_set(fptr->fd, &fds[0]);
- if (READ_DATA_PENDING(fptr)) { /* check for buffered data */
+ rp = &rset;
+ FD_ZERO(rp);
+ for (i=0; i<RARRAY(read)->len; i++) {
+ GetOpenFile(rb_io_get_io(RARRAY(read)->ptr[i]), fptr);
+ FD_SET(fileno(fptr->f), rp);
+ if (READ_DATA_PENDING(fptr->f)) { /* check for buffered data */
pending++;
- rb_fd_set(fptr->fd, &fds[3]);
+ FD_SET(fileno(fptr->f), &pset);
}
- if (max < fptr->fd) max = fptr->fd;
+ if (max < fileno(fptr->f)) max = fileno(fptr->f);
}
if (pending) { /* no blocking if there's buffered data */
timerec.tv_sec = timerec.tv_usec = 0;
tp = &timerec;
}
- rp = &fds[0];
}
else
rp = 0;
if (!NIL_P(write)) {
Check_Type(write, T_ARRAY);
- for (i=0; i<RARRAY_LEN(write); i++) {
- VALUE write_io = GetWriteIO(rb_io_get_io(RARRAY_PTR(write)[i]));
- GetOpenFile(write_io, fptr);
- rb_fd_set(fptr->fd, &fds[1]);
- if (max < fptr->fd) max = fptr->fd;
+ wp = &wset;
+ FD_ZERO(wp);
+ for (i=0; i<RARRAY(write)->len; i++) {
+ GetOpenFile(rb_io_get_io(RARRAY(write)->ptr[i]), fptr);
+ FD_SET(fileno(fptr->f), wp);
+ if (max < fileno(fptr->f)) max = fileno(fptr->f);
+ if (fptr->f2) {
+ FD_SET(fileno(fptr->f2), wp);
+ if (max < fileno(fptr->f2)) max = fileno(fptr->f2);
+ }
}
- wp = &fds[1];
}
else
wp = 0;
if (!NIL_P(except)) {
Check_Type(except, T_ARRAY);
- for (i=0; i<RARRAY_LEN(except); i++) {
- VALUE io = rb_io_get_io(RARRAY_PTR(except)[i]);
- VALUE write_io = GetWriteIO(io);
- GetOpenFile(io, fptr);
- rb_fd_set(fptr->fd, &fds[2]);
- if (max < fptr->fd) max = fptr->fd;
- if (io != write_io) {
- GetOpenFile(write_io, fptr);
- rb_fd_set(fptr->fd, &fds[2]);
- if (max < fptr->fd) max = fptr->fd;
- }
+ ep = &eset;
+ FD_ZERO(ep);
+ for (i=0; i<RARRAY(except)->len; i++) {
+ GetOpenFile(rb_io_get_io(RARRAY(except)->ptr[i]), fptr);
+ FD_SET(fileno(fptr->f), ep);
+ if (max < fileno(fptr->f)) max = fileno(fptr->f);
+ if (fptr->f2) {
+ FD_SET(fileno(fptr->f2), ep);
+ if (max < fileno(fptr->f2)) max = fileno(fptr->f2);
+ }
}
- ep = &fds[2];
}
else {
ep = 0;
@@ -6996,7 +4916,7 @@ select_internal(VALUE read, VALUE write, VALUE except, struct timeval *tp, rb_fd
max++;
- n = rb_thread_fd_select(max, rp, wp, ep, tp);
+ n = rb_thread_select(max, rp, wp, ep, tp);
if (n < 0) {
rb_sys_fail(0);
}
@@ -7009,47 +4929,39 @@ select_internal(VALUE read, VALUE write, VALUE except, struct timeval *tp, rb_fd
if (interrupt_flag == 0) {
if (rp) {
- list = RARRAY_PTR(res)[0];
- for (i=0; i< RARRAY_LEN(read); i++) {
- VALUE obj = rb_ary_entry(read, i);
- VALUE io = rb_io_get_io(obj);
- GetOpenFile(io, fptr);
- if (rb_fd_isset(fptr->fd, &fds[0]) ||
- rb_fd_isset(fptr->fd, &fds[3])) {
- rb_ary_push(list, obj);
+ list = RARRAY(res)->ptr[0];
+ for (i=0; i< RARRAY(read)->len; i++) {
+ GetOpenFile(rb_io_get_io(RARRAY(read)->ptr[i]), fptr);
+ if (FD_ISSET(fileno(fptr->f), rp)
+ || FD_ISSET(fileno(fptr->f), &pset)) {
+ rb_ary_push(list, rb_ary_entry(read, i));
}
}
}
if (wp) {
- list = RARRAY_PTR(res)[1];
- for (i=0; i< RARRAY_LEN(write); i++) {
- VALUE obj = rb_ary_entry(write, i);
- VALUE io = rb_io_get_io(obj);
- VALUE write_io = GetWriteIO(io);
- GetOpenFile(write_io, fptr);
- if (rb_fd_isset(fptr->fd, &fds[1])) {
- rb_ary_push(list, obj);
+ list = RARRAY(res)->ptr[1];
+ for (i=0; i< RARRAY(write)->len; i++) {
+ GetOpenFile(rb_io_get_io(RARRAY(write)->ptr[i]), fptr);
+ if (FD_ISSET(fileno(fptr->f), wp)) {
+ rb_ary_push(list, rb_ary_entry(write, i));
+ }
+ else if (fptr->f2 && FD_ISSET(fileno(fptr->f2), wp)) {
+ rb_ary_push(list, rb_ary_entry(write, i));
}
}
}
if (ep) {
- list = RARRAY_PTR(res)[2];
- for (i=0; i< RARRAY_LEN(except); i++) {
- VALUE obj = rb_ary_entry(except, i);
- VALUE io = rb_io_get_io(obj);
- VALUE write_io = GetWriteIO(io);
- GetOpenFile(io, fptr);
- if (rb_fd_isset(fptr->fd, &fds[2])) {
- rb_ary_push(list, obj);
+ list = RARRAY(res)->ptr[2];
+ for (i=0; i< RARRAY(except)->len; i++) {
+ GetOpenFile(rb_io_get_io(RARRAY(except)->ptr[i]), fptr);
+ if (FD_ISSET(fileno(fptr->f), ep)) {
+ rb_ary_push(list, rb_ary_entry(except, i));
+ }
+ else if (fptr->f2 && FD_ISSET(fileno(fptr->f2), ep)) {
+ rb_ary_push(list, rb_ary_entry(except, i));
}
- else if (io != write_io) {
- GetOpenFile(write_io, fptr);
- if (rb_fd_isset(fptr->fd, &fds[2])) {
- rb_ary_push(list, obj);
- }
- }
}
}
}
@@ -7057,96 +4969,41 @@ select_internal(VALUE read, VALUE write, VALUE except, struct timeval *tp, rb_fd
return res; /* returns an empty array on interrupt */
}
-struct select_args {
- VALUE read, write, except;
- struct timeval *timeout;
- rb_fdset_t fdsets[4];
-};
-
-#ifdef HAVE_RB_FD_INIT
-static VALUE
-select_call(VALUE arg)
-{
- struct select_args *p = (struct select_args *)arg;
-
- return select_internal(p->read, p->write, p->except, p->timeout, p->fdsets);
-}
-
-static VALUE
-select_end(VALUE arg)
-{
- struct select_args *p = (struct select_args *)arg;
- int i;
-
- for (i = 0; i < numberof(p->fdsets); ++i)
- rb_fd_term(&p->fdsets[i]);
- return Qnil;
-}
-#endif
-
-/*
- * call-seq:
- * IO.select(read_array
- * [, write_array
- * [, error_array
- * [, timeout]]] ) => array or nil
- *
- * See <code>Kernel#select</code>.
- */
-
-static VALUE
-rb_f_select(int argc, VALUE *argv, VALUE obj)
-{
- VALUE timeout;
- struct select_args args;
- struct timeval timerec;
- int i;
-
- rb_scan_args(argc, argv, "13", &args.read, &args.write, &args.except, &timeout);
- if (NIL_P(timeout)) {
- args.timeout = 0;
- }
- else {
- timerec = rb_time_interval(timeout);
- args.timeout = &timerec;
- }
-
- for (i = 0; i < numberof(args.fdsets); ++i)
- rb_fd_init(&args.fdsets[i]);
-
-#ifdef HAVE_RB_FD_INIT
- return rb_ensure(select_call, (VALUE)&args, select_end, (VALUE)&args);
-#else
- return select_internal(args.read, args.write, args.except,
- args.timeout, args.fdsets);
-#endif
-
-}
-
+#if !defined(MSDOS) && !defined(__human68k__)
static int
-io_cntl(int fd, unsigned long cmd, long narg, int io_p)
+io_cntl(fd, cmd, narg, io_p)
+ int fd, cmd, io_p;
+ long narg;
{
int retval;
#ifdef HAVE_FCNTL
+ TRAP_BEG;
# if defined(__CYGWIN__)
retval = io_p?ioctl(fd, cmd, (void*)narg):fcntl(fd, cmd, narg);
# else
- retval = io_p?ioctl(fd, cmd, narg):fcntl(fd, (int)cmd, narg);
+ retval = io_p?ioctl(fd, cmd, narg):fcntl(fd, cmd, narg);
# endif
+ TRAP_END;
#else
if (!io_p) {
rb_notimplement();
}
+ TRAP_BEG;
retval = ioctl(fd, cmd, narg);
+ TRAP_END;
#endif
return retval;
}
+#endif
static VALUE
-rb_io_ctl(VALUE io, VALUE req, VALUE arg, int io_p)
+rb_io_ctl(io, req, arg, io_p)
+ VALUE io, req, arg;
+ int io_p;
{
- unsigned long cmd = NUM2ULONG(req);
+#if !defined(MSDOS) && !defined(__human68k__)
+ int cmd = NUM2ULONG(req);
rb_io_t *fptr;
long len = 0;
long narg = 0;
@@ -7183,41 +5040,49 @@ rb_io_ctl(VALUE io, VALUE req, VALUE arg, int io_p)
#endif
rb_str_modify(arg);
- if (len <= RSTRING_LEN(arg)) {
- len = RSTRING_LEN(arg);
+ if (len <= RSTRING(arg)->len) {
+ len = RSTRING(arg)->len;
}
- if (RSTRING_LEN(arg) < len) {
+ if (RSTRING(arg)->len < len) {
rb_str_resize(arg, len+1);
}
- RSTRING_PTR(arg)[len] = 17; /* a little sanity check here */
- narg = (long)RSTRING_PTR(arg);
+ RSTRING(arg)->ptr[len] = 17; /* a little sanity check here */
+ narg = (long)RSTRING(arg)->ptr;
}
}
GetOpenFile(io, fptr);
- retval = io_cntl(fptr->fd, cmd, narg, io_p);
- if (retval < 0) rb_sys_fail_path(fptr->pathv);
- if (TYPE(arg) == T_STRING && RSTRING_PTR(arg)[len] != 17) {
+ retval = io_cntl(fileno(fptr->f), cmd, narg, io_p);
+ if (retval < 0) rb_sys_fail(fptr->path);
+ if (TYPE(arg) == T_STRING && RSTRING(arg)->ptr[len] != 17) {
rb_raise(rb_eArgError, "return value overflowed string");
}
+ if (fptr->f2 && fileno(fptr->f) != fileno(fptr->f2)) {
+ /* call on f2 too; ignore result */
+ io_cntl(fileno(fptr->f2), cmd, narg, io_p);
+ }
+
if (!io_p && cmd == F_SETFL) {
- if (narg & O_NONBLOCK) {
- fptr->mode |= FMODE_WSPLIT_INITIALIZED;
- fptr->mode &= ~FMODE_WSPLIT;
- }
- else {
- fptr->mode &= ~(FMODE_WSPLIT_INITIALIZED|FMODE_WSPLIT);
- }
+ if (narg & O_NONBLOCK) {
+ fptr->mode |= FMODE_WSPLIT_INITIALIZED;
+ fptr->mode &= ~FMODE_WSPLIT;
+ }
+ else {
+ fptr->mode &= ~(FMODE_WSPLIT_INITIALIZED|FMODE_WSPLIT);
+ }
}
return INT2NUM(retval);
+#else
+ rb_notimplement();
+ return Qnil; /* not reached */
+#endif
}
-
/*
* call-seq:
* ios.ioctl(integer_cmd, arg) => integer
- *
+ *
* Provides a mechanism for issuing low-level commands to control or
* query I/O devices. Arguments and results are platform dependent. If
* <i>arg</i> is a number, its value is passed directly. If it is a
@@ -7227,7 +5092,10 @@ rb_io_ctl(VALUE io, VALUE req, VALUE arg, int io_p)
*/
static VALUE
-rb_io_ioctl(int argc, VALUE *argv, VALUE io)
+rb_io_ioctl(argc, argv, io)
+ int argc;
+ VALUE *argv;
+ VALUE io;
{
VALUE req, arg;
@@ -7235,11 +5103,10 @@ rb_io_ioctl(int argc, VALUE *argv, VALUE io)
return rb_io_ctl(io, req, arg, 1);
}
-#ifdef HAVE_FCNTL
/*
* call-seq:
* ios.fcntl(integer_cmd, arg) => integer
- *
+ *
* Provides a mechanism for issuing low-level commands to control or
* query file-oriented I/O streams. Arguments and results are platform
* dependent. If <i>arg</i> is a number, its value is passed
@@ -7250,22 +5117,26 @@ rb_io_ioctl(int argc, VALUE *argv, VALUE io)
*/
static VALUE
-rb_io_fcntl(int argc, VALUE *argv, VALUE io)
+rb_io_fcntl(argc, argv, io)
+ int argc;
+ VALUE *argv;
+ VALUE io;
{
+#ifdef HAVE_FCNTL
VALUE req, arg;
rb_scan_args(argc, argv, "11", &req, &arg);
return rb_io_ctl(io, req, arg, 0);
-}
#else
-#define rb_io_fcntl rb_f_notimplement
+ rb_notimplement();
+ return Qnil; /* not reached */
#endif
+}
-#if defined(HAVE_SYSCALL) && SIZEOF_LONG == SIZEOF_INT
/*
* call-seq:
* syscall(fixnum [, args...]) => integer
- *
+ *
* Calls the operating system function identified by _fixnum_,
* passing in the arguments, which must be either +String+
* objects, or +Integer+ objects that ultimately fit within
@@ -7273,17 +5144,20 @@ rb_io_fcntl(int argc, VALUE *argv, VALUE io)
* on the Atari-ST). The function identified by _fixnum_ is system
* dependent. On some Unix systems, the numbers may be obtained from a
* header file called <code>syscall.h</code>.
- *
+ *
* syscall 4, 1, "hello\n", 6 # '4' is write(2) on our box
- *
+ *
* <em>produces:</em>
- *
+ *
* hello
*/
static VALUE
-rb_f_syscall(int argc, VALUE *argv)
+rb_f_syscall(argc, argv)
+ int argc;
+ VALUE *argv;
{
+#if defined(HAVE_SYSCALL) && !defined(__CHECKER__)
#ifdef atarist
unsigned long arg[14]; /* yes, we really need that many ! */
#else
@@ -7301,7 +5175,7 @@ rb_f_syscall(int argc, VALUE *argv)
rb_secure(2);
if (argc == 0)
rb_raise(rb_eArgError, "too few arguments for syscall");
- if (argc > numberof(arg))
+ if (argc > sizeof(arg) / sizeof(arg[0]))
rb_raise(rb_eArgError, "too many arguments for syscall");
arg[0] = NUM2LONG(argv[0]); argv++;
while (items--) {
@@ -7318,7 +5192,7 @@ rb_f_syscall(int argc, VALUE *argv)
argv++;
i++;
}
-
+ TRAP_BEG;
switch (argc) {
case 1:
retval = syscall(arg[0]);
@@ -7372,126 +5246,41 @@ rb_f_syscall(int argc, VALUE *argv)
break;
#endif /* atarist */
}
-
+ TRAP_END;
if (retval < 0) rb_sys_fail(0);
return INT2NUM(retval);
-}
#else
-#define rb_f_syscall rb_f_notimplement
+ rb_notimplement();
+ return Qnil; /* not reached */
#endif
-
-static VALUE
-io_new_instance(VALUE args)
-{
- return rb_class_new_instance(2, (VALUE*)args+1, *(VALUE*)args);
-}
-
-static void
-io_encoding_set(rb_io_t *fptr, VALUE v1, VALUE v2, VALUE opt)
-{
- rb_encoding *enc, *enc2;
- int ecflags;
- VALUE ecopts, tmp;
-
- if (!NIL_P(v2)) {
- enc2 = rb_to_encoding(v1);
- tmp = rb_check_string_type(v2);
- if (!NIL_P(tmp)) {
- char *p = StringValueCStr(tmp);
- if (*p == '-' && *(p+1) == '\0') {
- /* Special case - "-" => no transcoding */
- enc = enc2;
- enc2 = NULL;
- }
- else
- enc = rb_to_encoding(v2);
- if (enc == enc2) {
- /* Special case - "-" => no transcoding */
- enc2 = NULL;
- }
- }
- else
- enc = rb_to_encoding(v2);
- ecflags = rb_econv_prepare_opts(opt, &ecopts);
- }
- else {
- if (NIL_P(v1)) {
- /* Set to default encodings */
- rb_io_ext_int_to_encs(NULL, NULL, &enc, &enc2);
- ecflags = 0;
- ecopts = Qnil;
- }
- else {
- tmp = rb_check_string_type(v1);
- if (!NIL_P(tmp)) {
- parse_mode_enc(StringValueCStr(tmp), &enc, &enc2);
- ecflags = rb_econv_prepare_opts(opt, &ecopts);
- }
- else {
- rb_io_ext_int_to_encs(rb_to_encoding(v1), NULL, &enc, &enc2);
- ecflags = 0;
- ecopts = Qnil;
- }
- }
- }
- validate_enc_binmode(fptr->mode, enc, enc2);
- fptr->encs.enc = enc;
- fptr->encs.enc2 = enc2;
- fptr->encs.ecflags = ecflags;
- fptr->encs.ecopts = ecopts;
- clear_codeconv(fptr);
-
}
+static VALUE io_new_instance _((VALUE));
static VALUE
-pipe_pair_close(VALUE rw)
+io_new_instance(args)
+ VALUE args;
{
- VALUE *rwp = (VALUE *)rw;
- return rb_ensure(io_close, rwp[0], io_close, rwp[1]);
+ return rb_class_new_instance(2, (VALUE*)args+1, *(VALUE*)args);
}
/*
* call-seq:
- * IO.pipe -> [read_io, write_io]
- * IO.pipe(ext_enc) -> [read_io, write_io]
- * IO.pipe("ext_enc:int_enc" [, opt]) -> [read_io, write_io]
- * IO.pipe(ext_enc, int_enc [, opt]) -> [read_io, write_io]
- *
- * IO.pipe(...) {|read_io, write_io| ... }
- *
+ * IO.pipe -> array
+ *
* Creates a pair of pipe endpoints (connected to each other) and
* 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
- * returns the value of the block.
- * <i>read_io</i> and <i>write_io</i> are sent to the block as arguments.
- * If read_io and write_io are not closed when the block exits, they are closed.
- * i.e. closing read_io and/or write_io doesn't cause an error.
- *
- * Not available on all platforms.
- *
- * If an encoding (encoding name or encoding object) is specified as an optional argument,
- * read string from pipe is tagged with the encoding specified.
- * If the argument is a colon separated two encoding names "A:B",
- * the read string is converted from encoding A (external encoding)
- * to encoding B (internal encoding), then tagged with B.
- * If two optional arguments are specified, those must be
- * encoding objects or encoding names,
- * and the first one is the external encoding,
- * and the second one is the internal encoding.
- * If the external encoding and the internal encoding is specified,
- * optional hash argument specify the conversion option.
- *
+ * <code>[</code> <i>read_file</i>, <i>write_file</i> <code>]</code>. Not
+ * available on all platforms.
+ *
* In the example below, the two processes close the ends of the pipe
* that they are not using. This is not just a cosmetic nicety. The
* read end of a pipe will not generate an end of file condition if
* there are any writers with the pipe still open. In the case of the
* parent process, the <code>rd.read</code> will never return if it
* does not first issue a <code>wr.close</code>.
- *
+ *
* rd, wr = IO.pipe
- *
+ *
* if fork
* wr.close
* puts "Parent got: <#{rd.read}>"
@@ -7503,27 +5292,27 @@ pipe_pair_close(VALUE rw)
* wr.write "Hi Dad"
* wr.close
* end
- *
+ *
* <em>produces:</em>
- *
+ *
* Sending message to parent
* Parent got: <Hi Dad>
*/
static VALUE
-rb_io_s_pipe(int argc, VALUE *argv, VALUE klass)
+rb_io_s_pipe(klass)
+ VALUE klass;
{
+#ifndef __human68k__
int pipes[2], state;
- VALUE r, w, args[3], v1, v2;
- VALUE opt;
- rb_io_t *fptr, *fptr2;
- int fmode = 0;
- VALUE ret;
+ VALUE r, w, args[3];
- opt = pop_last_hash(&argc, argv);
- rb_scan_args(argc, argv, "02", &v1, &v2);
- if (rb_pipe(pipes) == -1)
- rb_sys_fail(0);
+#ifdef _WIN32
+ if (_pipe(pipes, 1024, O_BINARY) == -1)
+#else
+ if (pipe(pipes) == -1)
+#endif
+ rb_sys_fail(0);
args[0] = klass;
args[1] = INT2NUM(pipes[0]);
@@ -7534,8 +5323,6 @@ rb_io_s_pipe(int argc, VALUE *argv, VALUE klass)
close(pipes[1]);
rb_jump_tag(state);
}
- GetOpenFile(r, fptr);
- io_encoding_set(fptr, v1, v2, opt);
args[1] = INT2NUM(pipes[1]);
args[2] = INT2FIX(O_WRONLY);
w = rb_protect(io_new_instance, (VALUE)args, &state);
@@ -7544,74 +5331,28 @@ rb_io_s_pipe(int argc, VALUE *argv, VALUE klass)
if (!NIL_P(r)) rb_io_close(r);
rb_jump_tag(state);
}
- GetOpenFile(w, fptr2);
- rb_io_synchronized(fptr2);
-
- extract_binmode(opt, &fmode);
- fptr->mode |= fmode;
- fptr2->mode |= fmode;
+ rb_io_synchronized(RFILE(w)->fptr);
- ret = rb_assoc_new(r, w);
- if (rb_block_given_p()) {
- VALUE rw[2];
- rw[0] = r;
- rw[1] = w;
- return rb_ensure(rb_yield, ret, pipe_pair_close, (VALUE)rw);
- }
- return ret;
+ return rb_assoc_new(r, w);
+#else
+ rb_notimplement();
+ return Qnil; /* not reached */
+#endif
}
struct foreach_arg {
int argc;
- VALUE *argv;
+ VALUE sep;
VALUE io;
};
-static void
-open_key_args(int argc, VALUE *argv, struct foreach_arg *arg)
-{
- VALUE opt, v;
-
- FilePathValue(argv[0]);
- arg->io = 0;
- arg->argc = argc - 1;
- arg->argv = argv + 1;
- if (argc == 1) {
- no_key:
- arg->io = rb_io_open(argv[0], INT2NUM(O_RDONLY), INT2FIX(0666), Qnil);
- return;
- }
- opt = pop_last_hash(&arg->argc, arg->argv);
- if (NIL_P(opt)) goto no_key;
-
- v = rb_hash_aref(opt, sym_open_args);
- if (!NIL_P(v)) {
- VALUE args;
- long n;
-
- 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, argv[0]);
- rb_ary_concat(args, v);
- arg->io = rb_io_open_with_args((int)n, RARRAY_PTR(args));
- rb_ary_clear(args); /* prevent from GC */
- return;
- }
- arg->io = rb_io_open(argv[0], Qnil, Qnil, opt);
-}
-
static VALUE
-io_s_foreach(struct foreach_arg *arg)
+io_s_foreach(arg)
+ struct foreach_arg *arg;
{
VALUE str;
- while (!NIL_P(str = rb_io_gets_m(arg->argc, arg->argv, arg->io))) {
+ while (!NIL_P(str = rb_io_getline(arg->sep, arg->io))) {
rb_yield(str);
}
return Qnil;
@@ -7619,887 +5360,194 @@ io_s_foreach(struct foreach_arg *arg)
/*
* call-seq:
- * 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(name, sep_string=$/) {|line| block } => nil
+ *
* Executes the block for every line in the named I/O port, where lines
- * are separated by <em>sep</em>.
- *
+ * are separated by <em>sep_string</em>.
+ *
* IO.foreach("testfile") {|x| print "GOT ", x }
- *
+ *
* <em>produces:</em>
- *
+ *
* GOT This is line one
* GOT This is line two
* GOT This is line three
* GOT And so on...
- *
- * If the last argument is a hash, it's the keyword argument to open.
- * See <code>IO.read</code> for detail.
- *
- */
+ */
static VALUE
-rb_io_s_foreach(int argc, VALUE *argv, VALUE self)
+rb_io_s_foreach(argc, argv, self)
+ int argc;
+ VALUE *argv;
+ VALUE self;
{
+ VALUE fname;
struct foreach_arg arg;
- rb_scan_args(argc, argv, "13", NULL, NULL, NULL, NULL);
+ rb_scan_args(argc, argv, "11", &fname, &arg.sep);
RETURN_ENUMERATOR(self, argc, argv);
- open_key_args(argc, argv, &arg);
+ SafeStringValue(fname);
+
+ if (argc == 1) {
+ arg.sep = rb_default_rs;
+ }
+ else if (!NIL_P(arg.sep)) {
+ StringValue(arg.sep);
+ }
+ arg.io = rb_io_open(StringValueCStr(fname), "r");
if (NIL_P(arg.io)) return Qnil;
+
return rb_ensure(io_s_foreach, (VALUE)&arg, rb_io_close, arg.io);
}
static VALUE
-io_s_readlines(struct foreach_arg *arg)
+io_s_readlines(arg)
+ struct foreach_arg *arg;
{
- return rb_io_readlines(arg->argc, arg->argv, arg->io);
+ return rb_io_readlines(arg->argc, &arg->sep, arg->io);
}
/*
* call-seq:
- * IO.readlines(name, sep=$/ [, open_args]) => array
- * IO.readlines(name, limit [, open_args]) => array
- * IO.readlines(name, sep, limit [, open_args]) => array
- *
+ * IO.readlines(name, sep_string=$/) => array
+ *
* Reads the entire file specified by <i>name</i> as individual
* lines, and returns those lines in an array. Lines are separated by
- * <i>sep</i>.
- *
+ * <i>sep_string</i>.
+ *
* a = IO.readlines("testfile")
* a[0] #=> "This is line one\n"
- *
- * If the last argument is a hash, it's the keyword argument to open.
- * See <code>IO.read</code> for detail.
- *
+ *
*/
static VALUE
-rb_io_s_readlines(int argc, VALUE *argv, VALUE io)
+rb_io_s_readlines(argc, argv, io)
+ int argc;
+ VALUE *argv;
+ VALUE io;
{
+ VALUE fname;
struct foreach_arg arg;
- rb_scan_args(argc, argv, "13", NULL, NULL, NULL, NULL);
- open_key_args(argc, argv, &arg);
+ rb_scan_args(argc, argv, "11", &fname, &arg.sep);
+ SafeStringValue(fname);
+
+ arg.argc = argc - 1;
+ arg.io = rb_io_open(StringValueCStr(fname), "r");
if (NIL_P(arg.io)) return Qnil;
return rb_ensure(io_s_readlines, (VALUE)&arg, rb_io_close, arg.io);
}
static VALUE
-io_s_read(struct foreach_arg *arg)
+io_s_read(arg)
+ struct foreach_arg *arg;
{
- return io_read(arg->argc, arg->argv, arg->io);
+ return io_read(arg->argc, &arg->sep, arg->io);
}
/*
* call-seq:
* IO.read(name, [length [, offset]] ) => string
- * IO.read(name, [length [, offset]], open_args) => string
- *
+ *
* Opens the file, optionally seeks to the given offset, then returns
* <i>length</i> bytes (defaulting to the rest of the file).
* <code>read</code> ensures the file is closed before returning.
- *
- * If the last argument is a hash, it specifies option for internal
- * open(). The key would be the following. open_args: is exclusive
- * to others.
- *
- * encoding: string or encoding
- *
- * specifies encoding of the read string. encoding will be ignored
- * if length is specified.
- *
- * mode: string
- *
- * specifies mode argument for open(). it should start with "r"
- * otherwise it would cause error.
- *
- * open_args: array of strings
- *
- * specifies arguments for open() as an array.
- *
+ *
* IO.read("testfile") #=> "This is line one\nThis is line two\nThis is line three\nAnd so on...\n"
* IO.read("testfile", 20) #=> "This is line one\nThi"
* IO.read("testfile", 20, 10) #=> "ne one\nThis is line "
*/
static VALUE
-rb_io_s_read(int argc, VALUE *argv, VALUE io)
+rb_io_s_read(argc, argv, io)
+ int argc;
+ VALUE *argv;
+ VALUE io;
{
- VALUE offset;
+ VALUE fname, offset;
struct foreach_arg arg;
- rb_scan_args(argc, argv, "13", NULL, NULL, &offset, NULL);
- open_key_args(argc, argv, &arg);
- if (NIL_P(arg.io)) return Qnil;
- if (!NIL_P(offset)) {
- rb_io_binmode(arg.io);
- rb_io_seek(arg.io, offset, SEEK_SET);
- if (arg.argc == 2) arg.argc = 1;
- }
- return rb_ensure(io_s_read, (VALUE)&arg, rb_io_close, arg.io);
-}
-
-/*
- * call-seq:
- * IO.binread(name, [length [, offset]] ) => string
- *
- * Opens the file, optionally seeks to the given offset, then returns
- * <i>length</i> bytes (defaulting to the rest of the file).
- * <code>read</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"
- * IO.binread("testfile", 20, 10) #=> "ne one\nThis is line "
- */
+ rb_scan_args(argc, argv, "12", &fname, &arg.sep, &offset);
+ SafeStringValue(fname);
-static VALUE
-rb_io_s_binread(int argc, VALUE *argv, VALUE io)
-{
- VALUE offset;
- struct foreach_arg arg;
-
- rb_scan_args(argc, argv, "12", NULL, NULL, &offset);
- FilePathValue(argv[0]);
- arg.io = rb_io_open(argv[0], rb_str_new_cstr("rb:ASCII-8BIT"), Qnil, Qnil);
+ arg.argc = argc ? 1 : 0;
+ arg.io = rb_io_open(StringValueCStr(fname), "r");
if (NIL_P(arg.io)) return Qnil;
- arg.argv = argv+1;
- arg.argc = (argc > 1) ? 1 : 0;
if (!NIL_P(offset)) {
rb_io_seek(arg.io, offset, SEEK_SET);
}
return rb_ensure(io_s_read, (VALUE)&arg, rb_io_close, arg.io);
}
-struct copy_stream_struct {
- VALUE src;
- VALUE dst;
- off_t copy_length; /* (off_t)-1 if not specified */
- off_t src_offset; /* (off_t)-1 if not specified */
-
- int src_fd;
- int dst_fd;
- int close_src;
- int close_dst;
- off_t total;
- const char *syserr;
- int error_no;
- const char *notimp;
- rb_fdset_t fds;
- VALUE th;
-};
-
-static int
-maygvl_copy_stream_wait_read(struct copy_stream_struct *stp)
-{
- int ret;
- rb_fd_zero(&stp->fds);
- rb_fd_set(stp->src_fd, &stp->fds);
- ret = rb_fd_select(rb_fd_max(&stp->fds), &stp->fds, NULL, NULL, NULL);
- if (ret == -1) {
- stp->syserr = "select";
- stp->error_no = errno;
- return -1;
- }
- return 0;
-}
-
-static int
-nogvl_copy_stream_wait_write(struct copy_stream_struct *stp)
-{
- int ret;
- 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);
- if (ret == -1) {
- stp->syserr = "select";
- stp->error_no = errno;
- return -1;
- }
- return 0;
-}
-
-#ifdef HAVE_SENDFILE
-
-#ifdef __linux__
-#define USE_SENDFILE
-
-#ifdef HAVE_SYS_SENDFILE_H
-#include <sys/sendfile.h>
-#endif
-
-static ssize_t
-simple_sendfile(int out_fd, int in_fd, off_t *offset, size_t count)
-{
- return sendfile(out_fd, in_fd, offset, count);
-}
-
-#endif
-
-#endif
-
-#ifdef USE_SENDFILE
-static int
-nogvl_copy_stream_sendfile(struct copy_stream_struct *stp)
-{
- struct stat src_stat, dst_stat;
- ssize_t ss;
- int ret;
-
- off_t copy_length;
- off_t src_offset;
- int use_pread;
-
- ret = fstat(stp->src_fd, &src_stat);
- if (ret == -1) {
- stp->syserr = "fstat";
- stp->error_no = errno;
- return -1;
- }
- if (!S_ISREG(src_stat.st_mode))
- return 0;
-
- ret = fstat(stp->dst_fd, &dst_stat);
- if (ret == -1) {
- stp->syserr = "fstat";
- stp->error_no = errno;
- return -1;
- }
- if ((dst_stat.st_mode & S_IFMT) != S_IFSOCK)
- return 0;
-
- src_offset = stp->src_offset;
- use_pread = src_offset != (off_t)-1;
-
- copy_length = stp->copy_length;
- if (copy_length == (off_t)-1) {
- if (use_pread)
- copy_length = src_stat.st_size - src_offset;
- else {
- off_t cur = lseek(stp->src_fd, 0, SEEK_CUR);
- if (cur == (off_t)-1) {
- stp->syserr = "lseek";
- stp->error_no = errno;
- return -1;
- }
- copy_length = src_stat.st_size - cur;
- }
- }
-
- retry_sendfile:
- if (use_pread) {
- ss = simple_sendfile(stp->dst_fd, stp->src_fd, &src_offset, copy_length);
- }
- else {
- ss = simple_sendfile(stp->dst_fd, stp->src_fd, NULL, copy_length);
- }
- if (0 < ss) {
- stp->total += ss;
- copy_length -= ss;
- if (0 < copy_length) {
- ss = -1;
- errno = EAGAIN;
- }
- }
- if (ss == -1) {
- switch (errno) {
- case EINVAL:
-#ifdef ENOSYS
- case ENOSYS:
-#endif
- return 0;
- case EAGAIN:
-#if defined(EWOULDBLOCK) && EWOULDBLOCK != EAGAIN
- case EWOULDBLOCK:
-#endif
- if (nogvl_copy_stream_wait_write(stp) == -1)
- return -1;
- if (rb_thread_interrupted(stp->th))
- return -1;
- goto retry_sendfile;
- }
- stp->syserr = "sendfile";
- stp->error_no = errno;
- return -1;
- }
- return 1;
-}
-#endif
-
-static ssize_t
-maygvl_copy_stream_read(struct copy_stream_struct *stp, char *buf, size_t len, off_t offset)
-{
- ssize_t ss;
- retry_read:
- if (offset == (off_t)-1)
- ss = read(stp->src_fd, buf, len);
- else {
-#ifdef HAVE_PREAD
- ss = pread(stp->src_fd, buf, len, offset);
-#else
- stp->notimp = "pread";
- return -1;
-#endif
- }
- if (ss == 0) {
- return 0;
- }
- if (ss == -1) {
- switch (errno) {
- case EAGAIN:
-#if defined(EWOULDBLOCK) && EWOULDBLOCK != EAGAIN
- case EWOULDBLOCK:
-#endif
- if (maygvl_copy_stream_wait_read(stp) == -1)
- return -1;
- goto retry_read;
-#ifdef ENOSYS
- case ENOSYS:
-#endif
- stp->notimp = "pread";
- return -1;
- }
- stp->syserr = offset == (off_t)-1 ? "read" : "pread";
- stp->error_no = errno;
- return -1;
- }
- return ss;
-}
-
-static int
-nogvl_copy_stream_write(struct copy_stream_struct *stp, char *buf, size_t len)
-{
- ssize_t ss;
- int off = 0;
- while (len) {
- ss = write(stp->dst_fd, buf+off, len);
- if (ss == -1) {
- if (errno == EAGAIN || errno == EWOULDBLOCK) {
- if (nogvl_copy_stream_wait_write(stp) == -1)
- return -1;
- continue;
- }
- stp->syserr = "write";
- stp->error_no = errno;
- return -1;
- }
- off += (int)ss;
- len -= (int)ss;
- stp->total += ss;
- }
- return 0;
-}
-
-static void
-nogvl_copy_stream_read_write(struct copy_stream_struct *stp)
-{
- char buf[1024*16];
- size_t len;
- ssize_t ss;
- int ret;
- off_t copy_length;
- int use_eof;
- off_t src_offset;
- int use_pread;
-
- copy_length = stp->copy_length;
- use_eof = copy_length == (off_t)-1;
- src_offset = stp->src_offset;
- use_pread = src_offset != (off_t)-1;
-
- if (use_pread && stp->close_src) {
- off_t r;
- r = lseek(stp->src_fd, src_offset, SEEK_SET);
- if (r == (off_t)-1) {
- stp->syserr = "lseek";
- stp->error_no = errno;
- return;
- }
- src_offset = (off_t)-1;
- use_pread = 0;
- }
-
- while (use_eof || 0 < copy_length) {
- if (!use_eof && copy_length < (off_t)sizeof(buf)) {
- len = (size_t)copy_length;
- }
- else {
- len = sizeof(buf);
- }
- if (use_pread) {
- ss = maygvl_copy_stream_read(stp, buf, len, src_offset);
- if (0 < ss)
- src_offset += ss;
- }
- else {
- ss = maygvl_copy_stream_read(stp, buf, len, (off_t)-1);
- }
- if (ss <= 0) /* EOF or error */
- return;
-
- ret = nogvl_copy_stream_write(stp, buf, ss);
- if (ret < 0)
- return;
-
- if (!use_eof)
- copy_length -= ss;
-
- if (rb_thread_interrupted(stp->th))
- return;
- }
-}
-
static VALUE
-nogvl_copy_stream_func(void *arg)
-{
- struct copy_stream_struct *stp = (struct copy_stream_struct *)arg;
-#ifdef USE_SENDFILE
- int ret;
-#endif
-
-#ifdef USE_SENDFILE
- ret = nogvl_copy_stream_sendfile(stp);
- if (ret != 0)
- goto finish; /* error or success */
-#endif
-
- nogvl_copy_stream_read_write(stp);
-
-#ifdef USE_SENDFILE
- finish:
-#endif
- return Qnil;
-}
-
-static VALUE
-copy_stream_fallback_body(VALUE arg)
-{
- struct copy_stream_struct *stp = (struct copy_stream_struct *)arg;
- const int buflen = 16*1024;
- VALUE n;
- VALUE buf = rb_str_buf_new(buflen);
- off_t rest = stp->copy_length;
- off_t off = stp->src_offset;
- ID read_method = id_readpartial;
-
- if (stp->src_fd == -1) {
- if (!rb_respond_to(stp->src, read_method)) {
- read_method = id_read;
- }
- }
-
- while (1) {
- long numwrote;
- long l;
- if (stp->copy_length == (off_t)-1) {
- l = buflen;
- }
- else {
- if (rest == 0)
- break;
- l = buflen < rest ? buflen : (long)rest;
- }
- if (stp->src_fd == -1) {
- rb_funcall(stp->src, read_method, 2, INT2FIX(l), buf);
- }
- else {
- ssize_t ss;
- rb_thread_wait_fd(stp->src_fd);
- rb_str_resize(buf, buflen);
- ss = maygvl_copy_stream_read(stp, RSTRING_PTR(buf), l, off);
- if (ss == -1)
- return Qnil;
- if (ss == 0)
- rb_eof_error();
- rb_str_resize(buf, ss);
- if (off != (off_t)-1)
- off += ss;
- }
- n = rb_io_write(stp->dst, buf);
- numwrote = NUM2LONG(n);
- stp->total += numwrote;
- rest -= numwrote;
- if (read_method == id_read && RSTRING_LEN(buf) == 0) {
- break;
- }
- }
-
- return Qnil;
-}
-
-static VALUE
-copy_stream_fallback(struct copy_stream_struct *stp)
-{
- 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 (*) (ANYARGS))0, (VALUE)0,
- rb_eEOFError, (VALUE)0);
- return Qnil;
-}
-
-static VALUE
-copy_stream_body(VALUE arg)
-{
- struct copy_stream_struct *stp = (struct copy_stream_struct *)arg;
- VALUE src_io, dst_io;
- rb_io_t *src_fptr = 0, *dst_fptr = 0;
- int src_fd, dst_fd;
-
- stp->th = rb_thread_current();
-
- stp->total = 0;
-
- if (stp->src == argf ||
- !(TYPE(stp->src) == T_FILE ||
- TYPE(stp->src) == T_STRING ||
- rb_respond_to(stp->src, rb_intern("to_path")))) {
- src_fd = -1;
- }
- else {
- src_io = TYPE(stp->src) == T_FILE ? stp->src : Qnil;
- if (NIL_P(src_io)) {
- VALUE args[2];
- int oflags = O_RDONLY;
-#ifdef O_NOCTTY
- oflags |= O_NOCTTY;
-#endif
- FilePathValue(stp->src);
- args[0] = stp->src;
- args[1] = INT2NUM(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_readable(src_fptr);
- src_fd = src_fptr->fd;
- }
- stp->src_fd = src_fd;
-
- if (stp->dst == argf ||
- !(TYPE(stp->dst) == T_FILE ||
- TYPE(stp->dst) == T_STRING ||
- rb_respond_to(stp->dst, rb_intern("to_path")))) {
- dst_fd = -1;
- }
- else {
- dst_io = TYPE(stp->dst) == T_FILE ? stp->dst : Qnil;
- if (NIL_P(dst_io)) {
- VALUE args[3];
- int oflags = O_WRONLY|O_CREAT|O_TRUNC;
-#ifdef O_NOCTTY
- oflags |= O_NOCTTY;
-#endif
- FilePathValue(stp->dst);
- args[0] = stp->dst;
- args[1] = INT2NUM(oflags);
- args[2] = INT2FIX(0600);
- 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;
-
- 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)-1 && stp->copy_length < (off_t)len) {
- len = (size_t)stp->copy_length;
- }
- str = rb_str_buf_new(len);
- rb_str_resize(str,len);
- read_buffered_data(RSTRING_PTR(str), len, src_fptr);
- if (dst_fptr) { /* IO or filename */
- if (io_binwrite(str, dst_fptr, 0) < 0)
- rb_sys_fail(0);
- }
- else /* others such as StringIO */
- rb_io_write(stp->dst, str);
- stp->total += len;
- if (stp->copy_length != (off_t)-1)
- stp->copy_length -= len;
- }
-
- if (dst_fptr && io_fflush(dst_fptr) < 0) {
- rb_raise(rb_eIOError, "flush failed");
- }
-
- if (stp->copy_length == 0)
- return Qnil;
-
- if (src_fd == -1 || dst_fd == -1) {
- return copy_stream_fallback(stp);
- }
-
- rb_fd_init(&stp->fds);
- rb_fd_set(src_fd, &stp->fds);
- rb_fd_set(dst_fd, &stp->fds);
-
- return rb_thread_blocking_region(nogvl_copy_stream_func, (void*)stp, RUBY_UBF_IO, 0);
-}
-
-static VALUE
-copy_stream_finalize(VALUE arg)
-{
- struct copy_stream_struct *stp = (struct copy_stream_struct *)arg;
- 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) {
- errno = stp->error_no;
- rb_sys_fail(stp->syserr);
- }
- if (stp->notimp) {
- rb_raise(rb_eNotImpError, "%s() not implemented", stp->notimp);
- }
- return Qnil;
-}
-
-/*
- * call-seq:
- * IO.copy_stream(src, dst)
- * IO.copy_stream(src, dst, copy_length)
- * 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.
- *
- * This method returns the number of bytes copied.
- *
- * If optional arguments are not given,
- * the start position of the copy is
- * the beginning of the filename or
- * the current file offset of the IO.
- * The end position of the copy is the end of file.
- *
- * If <i>copy_length</i> is given,
- * No more than <i>copy_length</i> bytes are copied.
- *
- * If <i>src_offset</i> is given,
- * it specifies the start position of the copy.
- *
- * When <i>src_offset</i> is specified and
- * <i>src</i> is an IO,
- * IO.copy_stream doesn't move the current file offset.
- *
- */
-static VALUE
-rb_io_s_copy_stream(int argc, VALUE *argv, VALUE io)
-{
- VALUE src, dst, length, src_offset;
- struct copy_stream_struct st;
-
- MEMZERO(&st, struct copy_stream_struct, 1);
-
- rb_scan_args(argc, argv, "22", &src, &dst, &length, &src_offset);
-
- st.src = src;
- st.dst = dst;
-
- if (NIL_P(length))
- st.copy_length = (off_t)-1;
- else
- st.copy_length = NUM2OFFT(length);
-
- if (NIL_P(src_offset))
- st.src_offset = (off_t)-1;
- else
- st.src_offset = NUM2OFFT(src_offset);
-
- rb_ensure(copy_stream_body, (VALUE)&st, copy_stream_finalize, (VALUE)&st);
-
- return OFFT2NUM(st.total);
-}
-
-/*
- * call-seq:
- * io.external_encoding => encoding
- *
- * Returns the Encoding object that represents the encoding of the file.
- * If io is write mode and no encoding is specified, returns <code>nil</code>.
- */
-
-static VALUE
-rb_io_external_encoding(VALUE io)
-{
- rb_io_t *fptr;
-
- GetOpenFile(io, fptr);
- if (fptr->encs.enc2) {
- return rb_enc_from_encoding(fptr->encs.enc2);
- }
- if (fptr->mode & FMODE_WRITABLE) {
- if (fptr->encs.enc)
- return rb_enc_from_encoding(fptr->encs.enc);
- return Qnil;
- }
- return rb_enc_from_encoding(io_read_encoding(fptr));
-}
-
-/*
- * call-seq:
- * io.internal_encoding => encoding
- *
- * Returns the Encoding of the internal string if conversion is
- * specified. Otherwise returns nil.
- */
-
-static VALUE
-rb_io_internal_encoding(VALUE io)
-{
- rb_io_t *fptr;
-
- GetOpenFile(io, fptr);
- if (!fptr->encs.enc2) return Qnil;
- return rb_enc_from_encoding(io_read_encoding(fptr));
-}
-
-/*
- * call-seq:
- * io.set_encoding(ext_enc) => io
- * io.set_encoding("ext_enc:int_enc") => io
- * io.set_encoding(ext_enc, int_enc) => io
- * io.set_encoding("ext_enc:int_enc", opt) => io
- * io.set_encoding(ext_enc, int_enc, opt) => io
- *
- * If single argument is specified, read string from io is tagged
- * with the encoding specified. If encoding is a colon separated two
- * encoding names "A:B", the read string is converted from encoding A
- * (external encoding) to encoding B (internal encoding), then tagged
- * with B. If two arguments are specified, those must be encoding
- * objects or encoding names, and the first one is the external encoding, and the
- * second one is the internal encoding.
- * If the external encoding and the internal encoding is specified,
- * optional hash argument specify the conversion option.
- */
-
-static VALUE
-rb_io_set_encoding(int argc, VALUE *argv, VALUE io)
-{
- rb_io_t *fptr;
- VALUE v1, v2, opt;
-
- opt = pop_last_hash(&argc, argv);
- rb_scan_args(argc, argv, "11", &v1, &v2);
- GetOpenFile(io, fptr);
- io_encoding_set(fptr, v1, v2, opt);
- return io;
-}
-
-static VALUE
-argf_external_encoding(VALUE argf)
-{
- if (!RTEST(ARGF.current_file)) {
- return rb_enc_from_encoding(rb_default_external_encoding());
- }
- return rb_io_external_encoding(rb_io_check_io(ARGF.current_file));
-}
-
-static VALUE
-argf_internal_encoding(VALUE argf)
-{
- if (!RTEST(ARGF.current_file)) {
- return rb_enc_from_encoding(rb_default_external_encoding());
- }
- return rb_io_internal_encoding(rb_io_check_io(ARGF.current_file));
-}
-
-static VALUE
-argf_set_encoding(int argc, VALUE *argv, VALUE argf)
-{
- rb_io_t *fptr;
-
- if (!next_argv()) {
- rb_raise(rb_eArgError, "no stream to set encoding");
- }
- rb_io_set_encoding(argc, argv, ARGF.current_file);
- GetOpenFile(ARGF.current_file, fptr);
- ARGF.encs = fptr->encs;
- return argf;
-}
-
-static VALUE
-argf_tell(VALUE argf)
+argf_tell()
{
if (!next_argv()) {
rb_raise(rb_eArgError, "no stream to tell");
}
ARGF_FORWARD(0, 0);
- return rb_io_tell(ARGF.current_file);
+ return rb_io_tell(current_file);
}
static VALUE
-argf_seek_m(int argc, VALUE *argv, VALUE argf)
+argf_seek_m(argc, argv, self)
+ int argc;
+ VALUE *argv;
+ VALUE self;
{
if (!next_argv()) {
rb_raise(rb_eArgError, "no stream to seek");
}
ARGF_FORWARD(argc, argv);
- return rb_io_seek_m(argc, argv, ARGF.current_file);
+ return rb_io_seek_m(argc, argv, current_file);
}
static VALUE
-argf_set_pos(VALUE argf, VALUE offset)
+argf_set_pos(self, offset)
+ VALUE self, offset;
{
if (!next_argv()) {
rb_raise(rb_eArgError, "no stream to set position");
}
ARGF_FORWARD(1, &offset);
- return rb_io_set_pos(ARGF.current_file, offset);
+ return rb_io_set_pos(current_file, offset);
}
static VALUE
-argf_rewind(VALUE argf)
+argf_rewind()
{
if (!next_argv()) {
rb_raise(rb_eArgError, "no stream to rewind");
}
ARGF_FORWARD(0, 0);
- return rb_io_rewind(ARGF.current_file);
+ return rb_io_rewind(current_file);
}
static VALUE
-argf_fileno(VALUE argf)
+argf_fileno()
{
if (!next_argv()) {
rb_raise(rb_eArgError, "no stream");
}
ARGF_FORWARD(0, 0);
- return rb_io_fileno(ARGF.current_file);
+ return rb_io_fileno(current_file);
}
static VALUE
-argf_to_io(VALUE argf)
+argf_to_io()
{
next_argv();
ARGF_FORWARD(0, 0);
- return ARGF.current_file;
+ return current_file;
}
static VALUE
-argf_eof(VALUE argf)
+argf_eof()
{
- if (ARGF.current_file) {
- if (ARGF.init_p == 0) return Qtrue;
+ if (current_file) {
+ if (init_p == 0) return Qtrue;
ARGF_FORWARD(0, 0);
- if (rb_io_eof(ARGF.current_file)) {
+ if (rb_io_eof(current_file)) {
return Qtrue;
}
}
@@ -8507,7 +5555,9 @@ argf_eof(VALUE argf)
}
static VALUE
-argf_read(int argc, VALUE *argv, VALUE argf)
+argf_read(argc, argv)
+ int argc;
+ VALUE *argv;
{
VALUE tmp, str, length;
long len = 0;
@@ -8526,24 +5576,24 @@ argf_read(int argc, VALUE *argv, VALUE argf)
if (!next_argv()) {
return str;
}
- if (ARGF_GENERIC_INPUT_P()) {
- tmp = argf_forward(argc, argv, argf);
+ if (TYPE(current_file) != T_FILE) {
+ tmp = argf_forward(argc, argv);
}
else {
- tmp = io_read(argc, argv, ARGF.current_file);
+ tmp = io_read(argc, argv, current_file);
}
if (NIL_P(str)) str = tmp;
else if (!NIL_P(tmp)) rb_str_append(str, tmp);
if (NIL_P(tmp) || NIL_P(length)) {
- if (ARGF.next_p != -1) {
- argf_close(ARGF.current_file);
- ARGF.next_p = 1;
+ if (next_p != -1) {
+ argf_close(current_file);
+ next_p = 1;
goto retry;
}
}
else if (argc >= 1) {
- if (RSTRING_LEN(str) < len) {
- len -= RSTRING_LEN(str);
+ if (RSTRING(str)->len < len) {
+ len -= RSTRING(str)->len;
argv[0] = INT2NUM(len);
goto retry;
}
@@ -8551,134 +5601,35 @@ argf_read(int argc, VALUE *argv, VALUE argf)
return str;
}
-struct argf_call_arg {
- int argc;
- VALUE *argv;
- VALUE argf;
-};
-
-static VALUE
-argf_forward_call(VALUE arg)
-{
- struct argf_call_arg *p = (struct argf_call_arg *)arg;
- argf_forward(p->argc, p->argv, p->argf);
- return Qnil;
-}
-
-static VALUE
-argf_readpartial(int argc, VALUE *argv, VALUE argf)
-{
- VALUE tmp, str, length;
-
- rb_scan_args(argc, argv, "11", &length, &str);
- if (!NIL_P(str)) {
- StringValue(str);
- argv[1] = str;
- }
-
- if (!next_argv()) {
- rb_str_resize(str, 0);
- rb_eof_error();
- }
- if (ARGF_GENERIC_INPUT_P()) {
- struct argf_call_arg arg;
- arg.argc = argc;
- arg.argv = argv;
- arg.argf = argf;
- tmp = rb_rescue2(argf_forward_call, (VALUE)&arg,
- RUBY_METHOD_FUNC(0), Qnil, rb_eEOFError, (VALUE)0);
- }
- else {
- tmp = io_getpartial(argc, argv, ARGF.current_file, 0);
- }
- if (NIL_P(tmp)) {
- if (ARGF.next_p == -1) {
- rb_eof_error();
- }
- argf_close(ARGF.current_file);
- ARGF.next_p = 1;
- if (RARRAY_LEN(ARGF.argv) == 0)
- rb_eof_error();
- if (NIL_P(str))
- str = rb_str_new(NULL, 0);
- return str;
- }
- return tmp;
-}
-
-static VALUE
-argf_getc(VALUE argf)
-{
- VALUE ch;
-
- retry:
- if (!next_argv()) return Qnil;
- if (ARGF_GENERIC_INPUT_P()) {
- ch = rb_funcall3(ARGF.current_file, rb_intern("getc"), 0, 0);
- }
- else {
- ch = rb_io_getc(ARGF.current_file);
- }
- if (NIL_P(ch) && ARGF.next_p != -1) {
- argf_close(ARGF.current_file);
- ARGF.next_p = 1;
- goto retry;
- }
-
- return ch;
-}
-
static VALUE
-argf_getbyte(VALUE argf)
+argf_getc()
{
- VALUE ch;
+ VALUE byte;
retry:
if (!next_argv()) return Qnil;
- if (TYPE(ARGF.current_file) != T_FILE) {
- ch = rb_funcall3(ARGF.current_file, rb_intern("getbyte"), 0, 0);
+ if (TYPE(current_file) != T_FILE) {
+ byte = rb_funcall3(current_file, rb_intern("getc"), 0, 0);
}
else {
- ch = rb_io_getbyte(ARGF.current_file);
+ byte = rb_io_getc(current_file);
}
- if (NIL_P(ch) && ARGF.next_p != -1) {
- argf_close(ARGF.current_file);
- ARGF.next_p = 1;
+ if (NIL_P(byte) && next_p != -1) {
+ argf_close(current_file);
+ next_p = 1;
goto retry;
}
- return ch;
+ return byte;
}
static VALUE
-argf_readchar(VALUE argf)
-{
- VALUE ch;
-
- retry:
- if (!next_argv()) rb_eof_error();
- if (TYPE(ARGF.current_file) != T_FILE) {
- ch = rb_funcall3(ARGF.current_file, rb_intern("getc"), 0, 0);
- }
- else {
- ch = rb_io_getc(ARGF.current_file);
- }
- if (NIL_P(ch) && ARGF.next_p != -1) {
- argf_close(ARGF.current_file);
- ARGF.next_p = 1;
- goto retry;
- }
-
- return ch;
-}
-
-static VALUE
-argf_readbyte(VALUE argf)
+argf_readchar()
{
VALUE c;
NEXT_ARGF_FORWARD(0, 0);
- c = argf_getbyte(argf);
+ c = argf_getc();
if (NIL_P(c)) {
rb_eof_error();
}
@@ -8686,214 +5637,195 @@ argf_readbyte(VALUE argf)
}
static VALUE
-argf_each_line(int argc, VALUE *argv, VALUE argf)
+argf_each_line(argc, argv, argf)
+ int argc;
+ VALUE *argv;
+ VALUE argf;
{
+ VALUE str;
+
RETURN_ENUMERATOR(argf, argc, argv);
- for (;;) {
- if (!next_argv()) return argf;
- rb_block_call(ARGF.current_file, rb_intern("each_line"), argc, argv, rb_yield, 0);
- ARGF.next_p = 1;
+ if (!next_argv()) return Qnil;
+ if (TYPE(current_file) != T_FILE) {
+ for (;;) {
+ if (!next_argv()) return argf;
+ rb_iterate(rb_each, current_file, rb_yield, 0);
+ next_p = 1;
+ }
+ }
+ while (!NIL_P(str = argf_getline(argc, argv))) {
+ rb_yield(str);
}
+ return argf;
}
static VALUE
-argf_each_byte(VALUE argf)
+argf_each_byte(argf)
+ VALUE argf;
{
+ VALUE byte;
+
RETURN_ENUMERATOR(argf, 0, 0);
- for (;;) {
- if (!next_argv()) return argf;
- rb_block_call(ARGF.current_file, rb_intern("each_byte"), 0, 0, rb_yield, 0);
- ARGF.next_p = 1;
+ while (!NIL_P(byte = argf_getc())) {
+ rb_yield(byte);
}
+ return argf;
}
static VALUE
-argf_each_char(VALUE argf)
+argf_each_char(argf)
+ VALUE argf;
{
+ VALUE ch;
+
RETURN_ENUMERATOR(argf, 0, 0);
- for (;;) {
- if (!next_argv()) return argf;
- rb_block_call(ARGF.current_file, rb_intern("each_char"), 0, 0, rb_yield, 0);
- ARGF.next_p = 1;
+
+ while (!NIL_P(ch = argf_getc())) {
+ unsigned char c;
+ int n;
+ VALUE str, file;
+
+ first_char:
+ c = FIX2INT(ch);
+ n = mbclen(c);
+ str = rb_tainted_str_new((const char *)&c, 1);
+ file = current_file;
+
+ while (--n > 0) {
+ if (NIL_P(ch = argf_getc())) {
+ rb_yield(str);
+ return argf;
+ }
+ if (current_file != file) {
+ rb_yield(str);
+ goto first_char;
+ }
+ c = FIX2INT(ch);
+ rb_str_cat(str, (const char *)&c, 1);
+ }
+ rb_yield(str);
}
+ return argf;
}
static VALUE
-argf_filename(VALUE argf)
+argf_filename()
{
next_argv();
- return ARGF.filename;
-}
-
-static VALUE
-argf_filename_getter(ID id, VALUE *var)
-{
- return argf_filename(*var);
+ return filename;
}
static VALUE
-argf_file(VALUE argf)
+argf_file()
{
next_argv();
- return ARGF.current_file;
+ return current_file;
}
static VALUE
-argf_binmode_m(VALUE argf)
+argf_binmode()
{
- ARGF.binmode = 1;
+ binmode = 1;
next_argv();
ARGF_FORWARD(0, 0);
- rb_io_ascii8bit_binmode(ARGF.current_file);
-
+ rb_io_binmode(current_file);
return argf;
}
static VALUE
-argf_binmode_p(VALUE argf)
-{
- return ARGF.binmode ? Qtrue : Qfalse;
-}
-
-static VALUE
-argf_skip(VALUE argf)
+argf_skip()
{
- if (ARGF.init_p && ARGF.next_p == 0) {
- argf_close(ARGF.current_file);
- ARGF.next_p = 1;
+ if (next_p != -1) {
+ argf_close(current_file);
+ next_p = 1;
}
return argf;
}
static VALUE
-argf_close_m(VALUE argf)
+argf_close_m()
{
next_argv();
- argf_close(ARGF.current_file);
- if (ARGF.next_p != -1) {
- ARGF.next_p = 1;
+ argf_close(current_file);
+ if (next_p != -1) {
+ next_p = 1;
}
- ARGF.lineno = 0;
+ gets_lineno = 0;
return argf;
}
static VALUE
-argf_closed(VALUE argf)
+argf_closed()
{
next_argv();
ARGF_FORWARD(0, 0);
- return rb_io_closed(ARGF.current_file);
+ return rb_io_closed(current_file);
}
static VALUE
-argf_to_s(VALUE argf)
+argf_to_s()
{
return rb_str_new2("ARGF");
}
static VALUE
-argf_inplace_mode_get(VALUE argf)
+opt_i_get()
{
- if (!ARGF.inplace) return Qnil;
- return rb_str_new2(ARGF.inplace);
+ if (!ruby_inplace_mode) return Qnil;
+ return rb_str_new2(ruby_inplace_mode);
}
-static VALUE
-opt_i_get(ID id, VALUE *var)
-{
- return argf_inplace_mode_get(*var);
-}
-
-static VALUE
-argf_inplace_mode_set(VALUE argf, VALUE val)
+static void
+opt_i_set(val)
+ VALUE val;
{
if (!RTEST(val)) {
- if (ARGF.inplace) free(ARGF.inplace);
- ARGF.inplace = 0;
- }
- else {
- StringValue(val);
- if (ARGF.inplace) free(ARGF.inplace);
- ARGF.inplace = 0;
- ARGF.inplace = strdup(RSTRING_PTR(val));
+ if (ruby_inplace_mode) free(ruby_inplace_mode);
+ ruby_inplace_mode = 0;
+ return;
}
- return argf;
-}
-
-static void
-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)
-{
- if (ARGF.inplace) free(ARGF.inplace);
- ARGF.inplace = 0;
- if (suffix) ARGF.inplace = strdup(suffix);
-}
-
-static VALUE
-argf_argv(VALUE argf)
-{
- return ARGF.argv;
-}
-
-static VALUE
-argf_argv_getter(ID id, VALUE *var)
-{
- return argf_argv(*var);
-}
-
-VALUE
-rb_get_argv(void)
-{
- return ARGF.argv;
+ StringValue(val);
+ if (ruby_inplace_mode) free(ruby_inplace_mode);
+ ruby_inplace_mode = 0;
+ ruby_inplace_mode = strdup(StringValueCStr(val));
}
/*
* Class <code>IO</code> is the basis for all input and output in Ruby.
* An I/O stream may be <em>duplexed</em> (that is, bidirectional), and
* so may use more than one native operating system stream.
- *
+ *
* Many of the examples in this section use class <code>File</code>,
* the only standard subclass of <code>IO</code>. The two classes are
* closely associated.
- *
+ *
* As used in this section, <em>portname</em> may take any of the
* following forms.
- *
+ *
* * A plain string represents a filename suitable for the underlying
* operating system.
- *
+ *
* * A string starting with ``<code>|</code>'' indicates a subprocess.
* The remainder of the string following the ``<code>|</code>'' is
* invoked as a process with appropriate input/output channels
* connected to it.
- *
+ *
* * A string equal to ``<code>|-</code>'' will create another Ruby
* instance as a subprocess.
- *
+ *
* Ruby will convert pathnames between different operating system
* conventions if possible. For instance, on a Windows system the
* filename ``<code>/gumby/ruby/test.rb</code>'' will be opened as
* ``<code>\gumby\ruby\test.rb</code>''. When specifying a
* Windows-style filename in a Ruby string, remember to escape the
* backslashes:
- *
+ *
* "c:\\gumby\\ruby\\test.rb"
- *
+ *
* Our examples here will use the Unix-style forward slashes;
* <code>File::SEPARATOR</code> can be used to get the
* platform-specific separator character.
- *
+ *
* I/O ports may be opened in any one of several different modes, which
* are shown in this section as <em>mode</em>. The mode may
* either be a Fixnum or a String. If numeric, it should be
@@ -8910,7 +5842,7 @@ rb_get_argv(void)
* -----+--------------------------------------------------------
* "r+" | Read-write, starts at beginning of file.
* -----+--------------------------------------------------------
- * "w" | Write-only, truncates existing file
+ * "w" | Write-only, truncates existing file
* | to zero length or creates a new file for writing.
* -----+--------------------------------------------------------
* "w+" | Read-write, truncates existing file to zero length
@@ -8920,17 +5852,11 @@ rb_get_argv(void)
* | otherwise creates a new file for writing.
* -----+--------------------------------------------------------
* "a+" | Read-write, starts at end of file if file exists,
- * | otherwise creates a new file for reading and
+ * | otherwise creates a new file for reading and
* | writing.
* -----+--------------------------------------------------------
- * "b" | Binary file mode (may appear with
+ * "b" | (DOS/Windows only) Binary file mode (may appear with
* | any of the key letters listed above).
- * | Suppresses EOL <-> CRLF conversion on Windows. And
- * | sets external encoding to ASCII-8BIT unless explicitly
- * | specified.
- * -----+--------------------------------------------------------
- * "t" | Text file mode (may appear with
- * | any of the key letters listed above except "b").
*
*
* The global constant ARGF (also accessible as $<) provides an
@@ -8941,13 +5867,9 @@ rb_get_argv(void)
*/
void
-Init_IO(void)
+Init_IO()
{
-#undef rb_intern
-#define rb_intern(str) rb_intern_const(str)
-
- VALUE rb_cARGF;
-#ifdef __CYGWIN__
+#ifdef __CYGWIN__
#include <sys/cygwin.h>
static struct __cygwin_perfile pf[] =
{
@@ -8966,8 +5888,6 @@ Init_IO(void)
id_write = rb_intern("write");
id_read = rb_intern("read");
id_getc = rb_intern("getc");
- id_flush = rb_intern("flush");
- id_readpartial = rb_intern("readpartial");
rb_define_global_function("syscall", rb_f_syscall, -1);
@@ -8978,6 +5898,7 @@ Init_IO(void)
rb_define_global_function("puts", rb_f_puts, -1);
rb_define_global_function("gets", rb_f_gets, -1);
rb_define_global_function("readline", rb_f_readline, -1);
+ rb_define_global_function("getc", rb_f_getc, 0);
rb_define_global_function("select", rb_f_select, -1);
rb_define_global_function("readlines", rb_f_readlines, -1);
@@ -8990,14 +5911,6 @@ Init_IO(void)
rb_cIO = rb_define_class("IO", rb_cObject);
rb_include_module(rb_cIO, rb_mEnumerable);
- rb_mWaitReadable = rb_define_module_under(rb_cIO, "WaitReadable");
- rb_mWaitWritable = rb_define_module_under(rb_cIO, "WaitWritable");
-
-#if 0
- /* This is necessary only for forcing rdoc handle File::open */
- rb_define_singleton_method(rb_cFile, "open", rb_io_s_open, -1);
-#endif
-
rb_define_alloc_func(rb_cIO, io_alloc);
rb_define_singleton_method(rb_cIO, "new", rb_io_s_new, -1);
rb_define_singleton_method(rb_cIO, "open", rb_io_s_open, -1);
@@ -9007,25 +5920,23 @@ Init_IO(void)
rb_define_singleton_method(rb_cIO, "foreach", rb_io_s_foreach, -1);
rb_define_singleton_method(rb_cIO, "readlines", rb_io_s_readlines, -1);
rb_define_singleton_method(rb_cIO, "read", rb_io_s_read, -1);
- rb_define_singleton_method(rb_cIO, "binread", rb_io_s_binread, -1);
rb_define_singleton_method(rb_cIO, "select", rb_f_select, -1);
- rb_define_singleton_method(rb_cIO, "pipe", rb_io_s_pipe, -1);
- rb_define_singleton_method(rb_cIO, "try_convert", rb_io_s_try_convert, 1);
- rb_define_singleton_method(rb_cIO, "copy_stream", rb_io_s_copy_stream, -1);
+ rb_define_singleton_method(rb_cIO, "pipe", rb_io_s_pipe, 0);
rb_define_method(rb_cIO, "initialize", rb_io_initialize, -1);
rb_output_fs = Qnil;
rb_define_hooked_variable("$,", &rb_output_fs, 0, rb_str_setter);
+ rb_global_variable(&rb_default_rs);
rb_rs = rb_default_rs = rb_str_new2("\n");
- rb_gc_register_mark_object(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_hooked_variable("$.", &lineno, 0, lineno_setter);
rb_define_virtual_variable("$_", rb_lastline_get, rb_lastline_set);
rb_define_method(rb_cIO, "initialize_copy", rb_io_init_copy, 1);
@@ -9040,11 +5951,9 @@ Init_IO(void)
rb_define_method(rb_cIO, "each_line", rb_io_each_line, -1);
rb_define_method(rb_cIO, "each_byte", rb_io_each_byte, 0);
rb_define_method(rb_cIO, "each_char", rb_io_each_char, 0);
- rb_define_method(rb_cIO, "each_codepoint", rb_io_each_codepoint, 0);
rb_define_method(rb_cIO, "lines", rb_io_lines, -1);
rb_define_method(rb_cIO, "bytes", rb_io_bytes, 0);
- rb_define_method(rb_cIO, "chars", rb_io_chars, 0);
- rb_define_method(rb_cIO, "codepoints", rb_io_codepoints, 0);
+ rb_define_method(rb_cIO, "chars", rb_io_each_char, 0);
rb_define_method(rb_cIO, "syswrite", rb_io_syswrite, 1);
rb_define_method(rb_cIO, "sysread", rb_io_sysread, -1);
@@ -9054,7 +5963,6 @@ Init_IO(void)
rb_define_method(rb_cIO, "to_io", rb_io_to_io, 0);
rb_define_method(rb_cIO, "fsync", rb_io_fsync, 0);
- rb_define_method(rb_cIO, "fdatasync", rb_io_fdatasync, 0);
rb_define_method(rb_cIO, "sync", rb_io_sync, 0);
rb_define_method(rb_cIO, "sync=", rb_io_set_sync, 1);
@@ -9067,14 +5975,13 @@ Init_IO(void)
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, 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);
- rb_define_method(rb_cIO, "getbyte", rb_io_getbyte, 0);
+ rb_define_method(rb_cIO, "getbyte", rb_io_getc, 0);
rb_define_method(rb_cIO, "readchar", rb_io_readchar, 0);
- rb_define_method(rb_cIO, "readbyte", rb_io_readbyte, 0);
- rb_define_method(rb_cIO, "ungetbyte",rb_io_ungetbyte, 1);
+ rb_define_method(rb_cIO, "readbyte", rb_io_readchar, 0);
rb_define_method(rb_cIO, "ungetc",rb_io_ungetc, 1);
rb_define_method(rb_cIO, "<<", rb_io_addstr, 1);
rb_define_method(rb_cIO, "flush", rb_io_flush, 0);
@@ -9089,9 +5996,6 @@ Init_IO(void)
rb_define_method(rb_cIO, "eof", rb_io_eof, 0);
rb_define_method(rb_cIO, "eof?", rb_io_eof, 0);
- rb_define_method(rb_cIO, "close_on_exec?", rb_io_close_on_exec_p, 0);
- rb_define_method(rb_cIO, "close_on_exec=", rb_io_set_close_on_exec, 1);
-
rb_define_method(rb_cIO, "close", rb_io_close_m, 0);
rb_define_method(rb_cIO, "closed?", rb_io_closed, 0);
rb_define_method(rb_cIO, "close_read", rb_io_close_read, 0);
@@ -9099,8 +6003,7 @@ Init_IO(void)
rb_define_method(rb_cIO, "isatty", rb_io_isatty, 0);
rb_define_method(rb_cIO, "tty?", rb_io_isatty, 0);
- rb_define_method(rb_cIO, "binmode", rb_io_binmode_m, 0);
- rb_define_method(rb_cIO, "binmode?", rb_io_binmode_p, 0);
+ rb_define_method(rb_cIO, "binmode", rb_io_binmode, 0);
rb_define_method(rb_cIO, "sysseek", rb_io_sysseek, -1);
rb_define_method(rb_cIO, "ioctl", rb_io_ioctl, -1);
@@ -9108,97 +6011,78 @@ Init_IO(void)
rb_define_method(rb_cIO, "pid", rb_io_pid, 0);
rb_define_method(rb_cIO, "inspect", rb_io_inspect, 0);
- 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_variable("$stdin", &rb_stdin);
- rb_stdin = prep_stdio(stdin, FMODE_READABLE, rb_cIO, "<STDIN>");
+ rb_stdin = prep_stdio(stdin, FMODE_READABLE, rb_cIO);
rb_define_hooked_variable("$stdout", &rb_stdout, 0, stdout_setter);
- rb_stdout = prep_stdio(stdout, FMODE_WRITABLE, rb_cIO, "<STDOUT>");
+ rb_stdout = prep_stdio(stdout, FMODE_WRITABLE, rb_cIO);
rb_define_hooked_variable("$stderr", &rb_stderr, 0, stdout_setter);
- rb_stderr = prep_stdio(stderr, FMODE_WRITABLE|FMODE_SYNC, rb_cIO, "<STDERR>");
+ rb_stderr = prep_stdio(stderr, FMODE_WRITABLE, rb_cIO);
rb_define_hooked_variable("$>", &rb_stdout, 0, stdout_setter);
orig_stdout = rb_stdout;
rb_deferr = orig_stderr = rb_stderr;
+ /* variables to be removed in 1.8.1 */
+ rb_define_hooked_variable("$defout", &rb_stdout, 0, defout_setter);
+ rb_define_hooked_variable("$deferr", &rb_stderr, 0, deferr_setter);
+
/* constants to hold original stdin/stdout/stderr */
rb_define_global_const("STDIN", rb_stdin);
rb_define_global_const("STDOUT", rb_stdout);
rb_define_global_const("STDERR", rb_stderr);
- rb_cARGF = rb_class_new(rb_cObject);
- rb_set_class_path(rb_cARGF, rb_cObject, "ARGF.class");
- rb_define_alloc_func(rb_cARGF, argf_alloc);
-
- rb_include_module(rb_cARGF, rb_mEnumerable);
-
- rb_define_method(rb_cARGF, "initialize", argf_initialize, -2);
- rb_define_method(rb_cARGF, "initialize_copy", argf_initialize_copy, 1);
- rb_define_method(rb_cARGF, "to_s", argf_to_s, 0);
- rb_define_method(rb_cARGF, "argv", argf_argv, 0);
-
- rb_define_method(rb_cARGF, "fileno", argf_fileno, 0);
- rb_define_method(rb_cARGF, "to_i", argf_fileno, 0);
- rb_define_method(rb_cARGF, "to_io", argf_to_io, 0);
- rb_define_method(rb_cARGF, "each", argf_each_line, -1);
- rb_define_method(rb_cARGF, "each_line", argf_each_line, -1);
- rb_define_method(rb_cARGF, "each_byte", argf_each_byte, 0);
- rb_define_method(rb_cARGF, "each_char", argf_each_char, 0);
- rb_define_method(rb_cARGF, "lines", argf_each_line, -1);
- rb_define_method(rb_cARGF, "bytes", argf_each_byte, 0);
- rb_define_method(rb_cARGF, "chars", argf_each_char, 0);
-
- rb_define_method(rb_cARGF, "read", argf_read, -1);
- rb_define_method(rb_cARGF, "readpartial", argf_readpartial, -1);
- rb_define_method(rb_cARGF, "readlines", argf_readlines, -1);
- rb_define_method(rb_cARGF, "to_a", argf_readlines, -1);
- rb_define_method(rb_cARGF, "gets", argf_gets, -1);
- rb_define_method(rb_cARGF, "readline", argf_readline, -1);
- rb_define_method(rb_cARGF, "getc", argf_getc, 0);
- rb_define_method(rb_cARGF, "getbyte", argf_getbyte, 0);
- rb_define_method(rb_cARGF, "readchar", argf_readchar, 0);
- rb_define_method(rb_cARGF, "readbyte", argf_readbyte, 0);
- rb_define_method(rb_cARGF, "tell", argf_tell, 0);
- rb_define_method(rb_cARGF, "seek", argf_seek_m, -1);
- rb_define_method(rb_cARGF, "rewind", argf_rewind, 0);
- rb_define_method(rb_cARGF, "pos", argf_tell, 0);
- rb_define_method(rb_cARGF, "pos=", argf_set_pos, 1);
- rb_define_method(rb_cARGF, "eof", argf_eof, 0);
- rb_define_method(rb_cARGF, "eof?", argf_eof, 0);
- rb_define_method(rb_cARGF, "binmode", argf_binmode_m, 0);
- rb_define_method(rb_cARGF, "binmode?", argf_binmode_p, 0);
-
- rb_define_method(rb_cARGF, "filename", argf_filename, 0);
- rb_define_method(rb_cARGF, "path", argf_filename, 0);
- rb_define_method(rb_cARGF, "file", argf_file, 0);
- rb_define_method(rb_cARGF, "skip", argf_skip, 0);
- rb_define_method(rb_cARGF, "close", argf_close_m, 0);
- rb_define_method(rb_cARGF, "closed?", argf_closed, 0);
-
- rb_define_method(rb_cARGF, "lineno", argf_lineno, 0);
- rb_define_method(rb_cARGF, "lineno=", argf_set_lineno, 1);
-
- rb_define_method(rb_cARGF, "inplace_mode", argf_inplace_mode_get, 0);
- rb_define_method(rb_cARGF, "inplace_mode=", argf_inplace_mode_set, 1);
-
- rb_define_method(rb_cARGF, "external_encoding", argf_external_encoding, 0);
- rb_define_method(rb_cARGF, "internal_encoding", argf_internal_encoding, 0);
- rb_define_method(rb_cARGF, "set_encoding", argf_set_encoding, -1);
-
- argf = rb_class_new_instance(0, 0, rb_cARGF);
-
rb_define_readonly_variable("$<", &argf);
+ argf = rb_obj_alloc(rb_cObject);
+ rb_extend_object(argf, rb_mEnumerable);
rb_define_global_const("ARGF", argf);
- rb_define_hooked_variable("$.", &argf, argf_lineno_getter, argf_lineno_setter);
- rb_define_hooked_variable("$FILENAME", &argf, argf_filename_getter, rb_gvar_readonly_setter);
- ARGF.filename = rb_str_new2("-");
-
- rb_define_hooked_variable("$-i", &argf, opt_i_get, opt_i_set);
- rb_define_hooked_variable("$*", &argf, argf_argv_getter, rb_gvar_readonly_setter);
-
-#if defined (_WIN32) || defined(__CYGWIN__)
+ rb_define_singleton_method(argf, "to_s", argf_to_s, 0);
+
+ rb_define_singleton_method(argf, "fileno", argf_fileno, 0);
+ rb_define_singleton_method(argf, "to_i", argf_fileno, 0);
+ rb_define_singleton_method(argf, "to_io", argf_to_io, 0);
+ rb_define_singleton_method(argf, "each", argf_each_line, -1);
+ rb_define_singleton_method(argf, "each_line", argf_each_line, -1);
+ rb_define_singleton_method(argf, "each_byte", argf_each_byte, 0);
+ rb_define_singleton_method(argf, "each_char", argf_each_char, 0);
+ rb_define_singleton_method(argf, "lines", argf_each_line, -1);
+ rb_define_singleton_method(argf, "bytes", argf_each_byte, 0);
+ rb_define_singleton_method(argf, "chars", argf_each_char, 0);
+
+ rb_define_singleton_method(argf, "read", argf_read, -1);
+ rb_define_singleton_method(argf, "readlines", rb_f_readlines, -1);
+ rb_define_singleton_method(argf, "to_a", rb_f_readlines, -1);
+ rb_define_singleton_method(argf, "gets", rb_f_gets, -1);
+ rb_define_singleton_method(argf, "readline", rb_f_readline, -1);
+ rb_define_singleton_method(argf, "getc", argf_getc, 0);
+ rb_define_singleton_method(argf, "getbyte", argf_getc, 0);
+ rb_define_singleton_method(argf, "readchar", argf_readchar, 0);
+ rb_define_singleton_method(argf, "readbyte", argf_readchar, 0);
+ rb_define_singleton_method(argf, "tell", argf_tell, 0);
+ rb_define_singleton_method(argf, "seek", argf_seek_m, -1);
+ rb_define_singleton_method(argf, "rewind", argf_rewind, 0);
+ rb_define_singleton_method(argf, "pos", argf_tell, 0);
+ rb_define_singleton_method(argf, "pos=", argf_set_pos, 1);
+ rb_define_singleton_method(argf, "eof", argf_eof, 0);
+ rb_define_singleton_method(argf, "eof?", argf_eof, 0);
+ rb_define_singleton_method(argf, "binmode", argf_binmode, 0);
+
+ rb_define_singleton_method(argf, "filename", argf_filename, 0);
+ rb_define_singleton_method(argf, "path", argf_filename, 0);
+ rb_define_singleton_method(argf, "file", argf_file, 0);
+ rb_define_singleton_method(argf, "skip", argf_skip, 0);
+ rb_define_singleton_method(argf, "close", argf_close_m, 0);
+ rb_define_singleton_method(argf, "closed?", argf_closed, 0);
+
+ rb_define_singleton_method(argf, "lineno", argf_lineno, 0);
+ rb_define_singleton_method(argf, "lineno=", argf_set_lineno, 1);
+
+ rb_global_variable(&current_file);
+ rb_define_readonly_variable("$FILENAME", &filename);
+ filename = rb_str_new2("-");
+
+ rb_define_virtual_variable("$-i", opt_i_get, opt_i_set);
+
+#if defined (_WIN32) || defined(DJGPP) || defined(__CYGWIN__) || defined(__human68k__)
atexit(pipe_atexit);
#endif
@@ -9225,31 +6109,8 @@ Init_IO(void)
#endif
#ifdef O_BINARY
rb_file_const("BINARY", INT2FIX(O_BINARY));
-#else
- rb_file_const("BINARY", INT2FIX(0));
#endif
#ifdef O_SYNC
rb_file_const("SYNC", INT2FIX(O_SYNC));
#endif
-#ifdef O_DSYNC
- rb_file_const("DSYNC", INT2FIX(O_DSYNC));
-#endif
-#ifdef O_RSYNC
- rb_file_const("RSYNC", INT2FIX(O_RSYNC));
-#endif
-#ifdef O_NOFOLLOW
- rb_file_const("NOFOLLOW", INT2FIX(O_NOFOLLOW)); /* FreeBSD, Linux */
-#endif
-#ifdef O_NOATIME
- rb_file_const("NOATIME", INT2FIX(O_NOATIME)); /* Linux */
-#endif
-
- sym_mode = ID2SYM(rb_intern("mode"));
- sym_perm = ID2SYM(rb_intern("perm"));
- sym_extenc = ID2SYM(rb_intern("external_encoding"));
- sym_intenc = ID2SYM(rb_intern("internal_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"));
}
diff --git a/iseq.c b/iseq.c
deleted file mode 100644
index d09f397f9d..0000000000
--- a/iseq.c
+++ /dev/null
@@ -1,1485 +0,0 @@
-/**********************************************************************
-
- iseq.c -
-
- $Author$
- created at: 2006-07-11(Tue) 09:00:03 +0900
-
- Copyright (C) 2006 Koichi Sasada
-
-**********************************************************************/
-
-#include "ruby/ruby.h"
-
-/* #define MARK_FREE_DEBUG 1 */
-#include "gc.h"
-#include "vm_core.h"
-#include "iseq.h"
-
-#include "insns.inc"
-#include "insns_info.inc"
-
-VALUE rb_cISeq;
-
-#define hidden_obj_p(obj) (!SPECIAL_CONST_P(obj) && !RBASIC(obj)->klass)
-
-static inline VALUE
-obj_resurrect(VALUE obj)
-{
- if (hidden_obj_p(obj)) {
- switch (BUILTIN_TYPE(obj)) {
- case T_STRING:
- obj = rb_str_resurrect(obj);
- break;
- case T_ARRAY:
- obj = rb_ary_resurrect(obj);
- break;
- }
- }
- return obj;
-}
-
-static void
-compile_data_free(struct iseq_compile_data *compile_data)
-{
- if (compile_data) {
- 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);
- }
-}
-
-static void
-iseq_free(void *ptr)
-{
- rb_iseq_t *iseq;
- RUBY_FREE_ENTER("iseq");
-
- if (ptr) {
- iseq = ptr;
- if (!iseq->orig) {
- /* It's possible that strings are freed
- * GC_INFO("%s @ %s\n", RSTRING_PTR(iseq->name),
- * RSTRING_PTR(iseq->filename));
- */
- if (iseq->iseq != iseq->iseq_encoded) {
- RUBY_FREE_UNLESS_NULL(iseq->iseq_encoded);
- }
-
- RUBY_FREE_UNLESS_NULL(iseq->iseq);
- RUBY_FREE_UNLESS_NULL(iseq->insn_info_table);
- RUBY_FREE_UNLESS_NULL(iseq->local_table);
- RUBY_FREE_UNLESS_NULL(iseq->ic_entries);
- RUBY_FREE_UNLESS_NULL(iseq->catch_table);
- RUBY_FREE_UNLESS_NULL(iseq->arg_opt_table);
- compile_data_free(iseq->compile_data);
- }
- ruby_xfree(ptr);
- }
- RUBY_FREE_LEAVE("iseq");
-}
-
-static void
-iseq_mark(void *ptr)
-{
- RUBY_MARK_ENTER("iseq");
-
- if (ptr) {
- int i;
- rb_iseq_t *iseq = ptr;
-
- RUBY_GC_INFO("%s @ %s\n", RSTRING_PTR(iseq->name), RSTRING_PTR(iseq->filename));
- RUBY_MARK_UNLESS_NULL(iseq->mark_ary);
- RUBY_MARK_UNLESS_NULL(iseq->name);
- RUBY_MARK_UNLESS_NULL(iseq->filename);
- RUBY_MARK_UNLESS_NULL((VALUE)iseq->cref_stack);
- RUBY_MARK_UNLESS_NULL(iseq->klass);
- RUBY_MARK_UNLESS_NULL(iseq->coverage);
-/* RUBY_MARK_UNLESS_NULL((VALUE)iseq->node); */
-/* RUBY_MARK_UNLESS_NULL(iseq->cached_special_block); */
- RUBY_MARK_UNLESS_NULL(iseq->orig);
-
- for (i=0; i<iseq->ic_size; i++) {
- RUBY_MARK_UNLESS_NULL(iseq->ic_entries[i].ic_class);
- RUBY_MARK_UNLESS_NULL(iseq->ic_entries[i].ic_value);
- if (iseq->ic_entries[i].ic_method) {
- rb_gc_mark_method_entry(iseq->ic_entries[i].ic_method);
- }
- }
-
- if (iseq->compile_data != 0) {
- RUBY_MARK_UNLESS_NULL(iseq->compile_data->mark_ary);
- RUBY_MARK_UNLESS_NULL(iseq->compile_data->err_info);
- RUBY_MARK_UNLESS_NULL(iseq->compile_data->catch_table_ary);
- }
- }
- RUBY_MARK_LEAVE("iseq");
-}
-
-static size_t
-iseq_memsize(void *ptr)
-{
- size_t size = sizeof(rb_iseq_t);
- rb_iseq_t *iseq;
-
- if (ptr) {
- iseq = ptr;
- if (!iseq->orig) {
- if (iseq->iseq != iseq->iseq_encoded) {
- size += iseq->iseq_size * sizeof(VALUE);
- }
-
- size += iseq->iseq_size * sizeof(VALUE);
- size += iseq->insn_info_size * sizeof(struct iseq_insn_info_entry);
- size += iseq->local_table_size * sizeof(ID);
- size += iseq->catch_table_size * sizeof(struct iseq_catch_table_entry);
- size += iseq->arg_opts * sizeof(VALUE);
- size += iseq->ic_size * sizeof(struct iseq_inline_cache_entry);
-
- if (iseq->compile_data) {
- struct iseq_compile_data_storage *cur;
-
- cur = iseq->compile_data->storage_head;
- while (cur) {
- size += cur->size + sizeof(struct iseq_compile_data_storage);
- cur = cur->next;
- }
- size += sizeof(struct iseq_compile_data);
- }
- }
- }
-
- return size;
-}
-
-static const rb_data_type_t iseq_data_type = {
- "iseq",
- iseq_mark,
- iseq_free,
- iseq_memsize,
-};
-
-static VALUE
-iseq_alloc(VALUE klass)
-{
- rb_iseq_t *iseq;
- return TypedData_Make_Struct(klass, rb_iseq_t, &iseq_data_type, iseq);
-}
-
-static void
-set_relation(rb_iseq_t *iseq, const VALUE parent)
-{
- const VALUE type = iseq->type;
- rb_thread_t *th = GET_THREAD();
-
- /* set class nest stack */
- if (type == ISEQ_TYPE_TOP) {
- /* toplevel is private */
- iseq->cref_stack = NEW_NODE_LONGLIFE(NODE_BLOCK, th->top_wrapper ? th->top_wrapper : rb_cObject, 0, 0);
- iseq->cref_stack->nd_file = 0;
- iseq->cref_stack->nd_visi = NOEX_PRIVATE;
- }
- else if (type == ISEQ_TYPE_METHOD || type == ISEQ_TYPE_CLASS) {
- iseq->cref_stack = NEW_NODE_LONGLIFE(NODE_BLOCK,0,0,0); /* place holder */
- iseq->cref_stack->nd_file = 0;
- }
- else if (RTEST(parent)) {
- rb_iseq_t *piseq;
- GetISeqPtr(parent, piseq);
- iseq->cref_stack = piseq->cref_stack;
- }
-
- if (type == ISEQ_TYPE_TOP ||
- type == ISEQ_TYPE_METHOD || type == ISEQ_TYPE_CLASS) {
- iseq->local_iseq = iseq;
- }
- else if (RTEST(parent)) {
- rb_iseq_t *piseq;
- GetISeqPtr(parent, piseq);
- iseq->local_iseq = piseq->local_iseq;
- }
-
- if (RTEST(parent)) {
- rb_iseq_t *piseq;
- GetISeqPtr(parent, piseq);
- iseq->parent_iseq = piseq;
- }
-}
-
-static VALUE
-prepare_iseq_build(rb_iseq_t *iseq,
- VALUE name, VALUE filename,
- VALUE parent, VALUE type, VALUE block_opt,
- const rb_compile_option_t *option)
-{
- OBJ_FREEZE(name);
- OBJ_FREEZE(filename);
-
- iseq->name = name;
- iseq->filename = filename;
- iseq->defined_method_id = 0;
- iseq->mark_ary = rb_ary_new();
- RBASIC(iseq->mark_ary)->klass = 0;
-
- iseq->type = type;
- iseq->arg_rest = -1;
- iseq->arg_block = -1;
- iseq->klass = 0;
-
- /*
- * iseq->special_block_builder = GC_GUARDED_PTR_REF(block_opt);
- * iseq->cached_special_block_builder = 0;
- * iseq->cached_special_block = 0;
- */
-
- iseq->compile_data = ALLOC(struct iseq_compile_data);
- MEMZERO(iseq->compile_data, struct iseq_compile_data, 1);
- 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(struct iseq_compile_data_storage));
-
- 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->storage_head->buff =
- (char *)(&iseq->compile_data->storage_head->buff + 1);
- iseq->compile_data->option = option;
-
- set_relation(iseq, parent);
-
- iseq->coverage = Qfalse;
- if (!GET_THREAD()->parse_in_eval) {
- extern VALUE rb_get_coverages(void);
- VALUE coverages = rb_get_coverages();
- if (RTEST(coverages)) {
- iseq->coverage = rb_hash_lookup(coverages, filename);
- if (NIL_P(iseq->coverage)) iseq->coverage = Qfalse;
- }
- }
-
- return Qtrue;
-}
-
-static VALUE
-cleanup_iseq_build(rb_iseq_t *iseq)
-{
- struct iseq_compile_data *data = iseq->compile_data;
- VALUE err = data->err_info;
- iseq->compile_data = 0;
- compile_data_free(data);
-
- if (RTEST(err)) {
- rb_funcall2(err, rb_intern("set_backtrace"), 1, &iseq->filename);
- rb_exc_raise(err);
- }
- return Qtrue;
-}
-
-static rb_compile_option_t COMPILE_OPTION_DEFAULT = {
- OPT_INLINE_CONST_CACHE, /* int inline_const_cache; */
- OPT_PEEPHOLE_OPTIMIZATION, /* int peephole_optimization; */
- OPT_TAILCALL_OPTIMIZATION, /* int tailcall_optimization */
- OPT_SPECIALISED_INSTRUCTION, /* int specialized_instruction; */
- OPT_OPERANDS_UNIFICATION, /* int operands_unification; */
- OPT_INSTRUCTIONS_UNIFICATION, /* int instructions_unification; */
- OPT_STACK_CACHING, /* int stack_caching; */
- OPT_TRACE_INSTRUCTION, /* int trace_instruction */
-};
-static const rb_compile_option_t COMPILE_OPTION_FALSE = {0};
-
-static void
-make_compile_option(rb_compile_option_t *option, VALUE opt)
-{
- if (opt == Qnil) {
- *option = COMPILE_OPTION_DEFAULT;
- }
- else if (opt == Qfalse) {
- *option = COMPILE_OPTION_FALSE;
- }
- else if (opt == Qtrue) {
- memset(option, 1, sizeof(rb_compile_option_t));
- }
- else if (CLASS_OF(opt) == rb_cHash) {
- *option = COMPILE_OPTION_DEFAULT;
-
-#define SET_COMPILE_OPTION(o, h, mem) \
- { VALUE flag = rb_hash_aref(h, ID2SYM(rb_intern(#mem))); \
- if (flag == Qtrue) { o->mem = 1; } \
- else if (flag == Qfalse) { o->mem = 0; } \
- }
-#define SET_COMPILE_OPTION_NUM(o, h, mem) \
- { VALUE num = rb_hash_aref(opt, ID2SYM(rb_intern(#mem))); \
- if (!NIL_P(num)) o->mem = NUM2INT(num); \
- }
- SET_COMPILE_OPTION(option, opt, inline_const_cache);
- SET_COMPILE_OPTION(option, opt, peephole_optimization);
- SET_COMPILE_OPTION(option, opt, tailcall_optimization);
- SET_COMPILE_OPTION(option, opt, specialized_instruction);
- SET_COMPILE_OPTION(option, opt, operands_unification);
- SET_COMPILE_OPTION(option, opt, instructions_unification);
- SET_COMPILE_OPTION(option, opt, stack_caching);
- SET_COMPILE_OPTION(option, opt, trace_instruction);
- SET_COMPILE_OPTION_NUM(option, opt, debug_level);
-#undef SET_COMPILE_OPTION
-#undef SET_COMPILE_OPTION_NUM
- }
- else {
- rb_raise(rb_eTypeError, "Compile option must be Hash/true/false/nil");
- }
-}
-
-static VALUE
-make_compile_option_value(rb_compile_option_t *option)
-{
- 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) \
- rb_hash_aset(h, ID2SYM(rb_intern(#mem)), INT2NUM(o->mem))
- {
- 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_NUM(option, opt, debug_level);
- }
-#undef SET_COMPILE_OPTION
-#undef SET_COMPILE_OPTION_NUM
- return opt;
-}
-
-VALUE
-rb_iseq_new(NODE *node, VALUE name, VALUE filename,
- VALUE parent, VALUE type)
-{
- return rb_iseq_new_with_opt(node, name, filename, parent, type,
- &COMPILE_OPTION_DEFAULT);
-}
-
-VALUE
-rb_iseq_new_top(NODE *node, VALUE name, VALUE filename, VALUE parent)
-{
- return rb_iseq_new_with_opt(node, name, filename, parent, ISEQ_TYPE_TOP,
- &COMPILE_OPTION_DEFAULT);
-}
-
-VALUE
-rb_iseq_new_main(NODE *node, VALUE filename)
-{
- rb_thread_t *th = GET_THREAD();
- VALUE parent = th->base_block->iseq->self;
- return rb_iseq_new_with_opt(node, rb_str_new2("<main>"), filename,
- parent, ISEQ_TYPE_MAIN, &COMPILE_OPTION_DEFAULT);
-}
-
-static VALUE
-rb_iseq_new_with_bopt_and_opt(NODE *node, VALUE name, VALUE filename,
- VALUE parent, VALUE type, VALUE bopt,
- const rb_compile_option_t *option)
-{
- rb_iseq_t *iseq;
- VALUE self = iseq_alloc(rb_cISeq);
-
- GetISeqPtr(self, iseq);
- iseq->self = self;
-
- prepare_iseq_build(iseq, name, filename, parent, type, bopt, option);
- rb_iseq_compile_node(self, node);
- cleanup_iseq_build(iseq);
- return self;
-}
-
-VALUE
-rb_iseq_new_with_opt(NODE *node, VALUE name, VALUE filename,
- VALUE parent, VALUE type,
- const rb_compile_option_t *option)
-{
- /* TODO: argument check */
- return rb_iseq_new_with_bopt_and_opt(node, name, filename, parent, type,
- Qfalse, option);
-}
-
-VALUE
-rb_iseq_new_with_bopt(NODE *node, VALUE name, VALUE filename,
- VALUE parent, VALUE type, VALUE bopt)
-{
- /* TODO: argument check */
- return rb_iseq_new_with_bopt_and_opt(node, name, filename, parent, type,
- bopt, &COMPILE_OPTION_DEFAULT);
-}
-
-#define CHECK_ARRAY(v) rb_convert_type(v, T_ARRAY, "Array", "to_ary")
-#define CHECK_STRING(v) rb_convert_type(v, T_STRING, "String", "to_str")
-#define CHECK_SYMBOL(v) rb_convert_type(v, T_SYMBOL, "Symbol", "to_sym")
-static inline VALUE CHECK_INTEGER(VALUE v) {NUM2LONG(v); return v;}
-static VALUE
-iseq_load(VALUE self, VALUE data, VALUE parent, VALUE opt)
-{
- VALUE iseqval = iseq_alloc(self);
-
- VALUE magic, version1, version2, format_type, misc;
- VALUE name, filename;
- VALUE type, body, locals, args, exception;
-
- VALUE iseq_type;
- struct st_table *type_map = 0;
- rb_iseq_t *iseq;
- rb_compile_option_t option;
- int i = 0;
-
- /* [magic, major_version, minor_version, format_type, misc,
- * name, filename,
- * type, locals, args, exception_table, body]
- */
-
- data = CHECK_ARRAY(data);
-
- magic = CHECK_STRING(rb_ary_entry(data, i++));
- version1 = CHECK_INTEGER(rb_ary_entry(data, i++));
- version2 = CHECK_INTEGER(rb_ary_entry(data, i++));
- format_type = CHECK_INTEGER(rb_ary_entry(data, i++));
- misc = rb_ary_entry(data, i++); /* TODO */
-
- name = CHECK_STRING(rb_ary_entry(data, i++));
- filename = CHECK_STRING(rb_ary_entry(data, i++));
-
- type = CHECK_SYMBOL(rb_ary_entry(data, i++));
- locals = CHECK_ARRAY(rb_ary_entry(data, i++));
-
- args = rb_ary_entry(data, i++);
- if (FIXNUM_P(args) || (args = CHECK_ARRAY(args))) {
- /* */
- }
-
- exception = CHECK_ARRAY(rb_ary_entry(data, i++));
- body = CHECK_ARRAY(rb_ary_entry(data, i++));
-
- GetISeqPtr(iseqval, iseq);
- iseq->self = iseqval;
-
- if (type_map == 0) {
- type_map = st_init_numtable();
- st_insert(type_map, ID2SYM(rb_intern("top")), ISEQ_TYPE_TOP);
- st_insert(type_map, ID2SYM(rb_intern("method")), ISEQ_TYPE_METHOD);
- st_insert(type_map, ID2SYM(rb_intern("block")), ISEQ_TYPE_BLOCK);
- st_insert(type_map, ID2SYM(rb_intern("class")), ISEQ_TYPE_CLASS);
- st_insert(type_map, ID2SYM(rb_intern("rescue")), ISEQ_TYPE_RESCUE);
- st_insert(type_map, ID2SYM(rb_intern("ensure")), ISEQ_TYPE_ENSURE);
- st_insert(type_map, ID2SYM(rb_intern("eval")), ISEQ_TYPE_EVAL);
- st_insert(type_map, ID2SYM(rb_intern("main")), ISEQ_TYPE_MAIN);
- st_insert(type_map, ID2SYM(rb_intern("defined_guard")), ISEQ_TYPE_DEFINED_GUARD);
- }
-
- if (st_lookup(type_map, type, &iseq_type) == 0) {
- const char *typename = rb_id2name(type);
- if (typename)
- rb_raise(rb_eTypeError, "unsupport type: :%s", typename);
- else
- rb_raise(rb_eTypeError, "unsupport type: %p", (void *)type);
- }
-
- if (parent == Qnil) {
- parent = 0;
- }
-
- make_compile_option(&option, opt);
- prepare_iseq_build(iseq, name, filename,
- parent, iseq_type, 0, &option);
-
- rb_iseq_build_from_ary(iseq, locals, args, exception, body);
-
- cleanup_iseq_build(iseq);
- return iseqval;
-}
-
-static VALUE
-iseq_s_load(int argc, VALUE *argv, VALUE self)
-{
- VALUE data, opt=Qnil;
- rb_scan_args(argc, argv, "11", &data, &opt);
-
- return iseq_load(self, data, 0, opt);
-}
-
-VALUE
-rb_iseq_load(VALUE data, VALUE parent, VALUE opt)
-{
- return iseq_load(rb_cISeq, data, parent, opt);
-}
-
-static NODE *
-compile_string(VALUE str, const char *file, int line)
-{
- VALUE parser = rb_parser_new();
- NODE *node = rb_parser_compile_string(parser, file, str, line);
-
- if (!node) {
- rb_exc_raise(GET_THREAD()->errinfo); /* TODO: check err */
- }
- return node;
-}
-
-VALUE
-rb_iseq_compile_with_option(VALUE src, VALUE file, VALUE line, VALUE opt)
-{
- rb_compile_option_t option;
- const char *fn = StringValueCStr(file);
- int ln = NUM2INT(line);
- NODE *node = compile_string(StringValue(src), fn, ln);
- rb_thread_t *th = GET_THREAD();
- make_compile_option(&option, opt);
-
- if (th->base_block && th->base_block->iseq) {
- return rb_iseq_new_with_opt(node, th->base_block->iseq->name,
- file, th->base_block->iseq->self,
- ISEQ_TYPE_EVAL, &option);
- }
- else {
- return rb_iseq_new_with_opt(node, rb_str_new2("<compiled>"), file, Qfalse,
- ISEQ_TYPE_TOP, &option);
- }
-}
-
-VALUE
-rb_iseq_compile(VALUE src, VALUE file, VALUE line)
-{
- return rb_iseq_compile_with_option(src, file, line, Qnil);
-}
-
-static VALUE
-iseq_s_compile(int argc, VALUE *argv, VALUE self)
-{
- VALUE src, file = Qnil, line = INT2FIX(1), opt = Qnil;
-
- rb_secure(1);
-
- rb_scan_args(argc, argv, "13", &src, &file, &line, &opt);
- if (NIL_P(file)) file = rb_str_new2("<compiled>");
- if (NIL_P(line)) line = INT2FIX(1);
-
- return rb_iseq_compile_with_option(src, file, line, opt);
-}
-
-static VALUE
-iseq_s_compile_file(int argc, VALUE *argv, VALUE self)
-{
- VALUE file, line = INT2FIX(1), opt = Qnil;
- VALUE parser;
- VALUE f;
- NODE *node;
- const char *fname;
- rb_compile_option_t option;
-
- rb_secure(1);
- rb_scan_args(argc, argv, "11", &file, &opt);
- FilePathValue(file);
- fname = StringValueCStr(file);
-
- f = rb_file_open_str(file, "r");
-
- parser = rb_parser_new();
- node = rb_parser_compile_file(parser, fname, f, NUM2INT(line));
- make_compile_option(&option, opt);
- return rb_iseq_new_with_opt(node, rb_str_new2("<main>"), file, Qfalse,
- ISEQ_TYPE_TOP, &option);
-}
-
-static VALUE
-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;
-}
-
-static VALUE
-iseq_s_compile_option_get(VALUE self)
-{
- return make_compile_option_value(&COMPILE_OPTION_DEFAULT);
-}
-
-static rb_iseq_t *
-iseq_check(VALUE val)
-{
- rb_iseq_t *iseq;
- GetISeqPtr(val, iseq);
- if (!iseq->name) {
- rb_raise(rb_eTypeError, "uninitialized InstructionSequence");
- }
- return iseq;
-}
-
-static VALUE
-iseq_eval(VALUE self)
-{
- rb_secure(1);
- return rb_iseq_eval(self);
-}
-
-static VALUE
-iseq_inspect(VALUE self)
-{
- rb_iseq_t *iseq;
- GetISeqPtr(self, iseq);
- if (!iseq->name) {
- return rb_sprintf("#<%s: uninitialized>", rb_obj_classname(self));
- }
-
- return rb_sprintf("<%s:%s@%s>",
- rb_obj_classname(self),
- RSTRING_PTR(iseq->name), RSTRING_PTR(iseq->filename));
-}
-
-static
-VALUE iseq_data_to_ary(rb_iseq_t *iseq);
-
-static VALUE
-iseq_to_a(VALUE self)
-{
- rb_iseq_t *iseq = iseq_check(self);
- rb_secure(1);
- return iseq_data_to_ary(iseq);
-}
-
-int
-rb_iseq_first_lineno(rb_iseq_t *iseq)
-{
- return iseq->insn_info_table[0].line_no;
-}
-
-/* TODO: search algorithm is brute force.
- this should be binary search or so. */
-
-static struct iseq_insn_info_entry *
-get_insn_info(const rb_iseq_t *iseq, const unsigned long pos)
-{
- unsigned long i, size = iseq->insn_info_size;
- struct iseq_insn_info_entry *table = iseq->insn_info_table;
-
- for (i = 0; i < size; i++) {
- if (table[i].position == pos) {
- return &table[i];
- }
- }
-
- return 0;
-}
-
-static unsigned short
-find_line_no(rb_iseq_t *iseq, unsigned long pos)
-{
- struct iseq_insn_info_entry *entry = get_insn_info(iseq, pos);
- if (entry) {
- return entry->line_no;
- }
- else {
- return 0;
- }
-}
-
-static unsigned short
-find_prev_line_no(rb_iseq_t *iseqdat, unsigned long pos)
-{
- unsigned long i, size = iseqdat->insn_info_size;
- struct iseq_insn_info_entry *iiary = iseqdat->insn_info_table;
-
- for (i = 0; i < size; i++) {
- if (iiary[i].position == pos) {
- if (i > 0) {
- return iiary[i - 1].line_no;
- }
- else {
- return 0;
- }
- }
- }
-
- return 0;
-}
-
-static VALUE
-insn_operand_intern(rb_iseq_t *iseq,
- int insn, int op_no, VALUE op,
- int len, int pos, VALUE *pnop, VALUE child)
-{
- const char *types = insn_op_types(insn);
- char type = types[op_no];
- VALUE ret;
-
- switch (type) {
- case TS_OFFSET: /* LONG */
- ret = rb_sprintf("%ld", pos + len + op);
- break;
-
- case TS_NUM: /* ULONG */
- ret = rb_sprintf("%lu", op);
- break;
-
- case TS_LINDEX:
- {
- rb_iseq_t *ip = iseq->local_iseq;
- int lidx = ip->local_size - op;
- const char *name = rb_id2name(ip->local_table[lidx]);
-
- if (name) {
- ret = rb_str_new2(name);
- }
- else {
- ret = rb_str_new2("*");
- }
- break;
- }
- case TS_DINDEX:{
- if (insn == BIN(getdynamic) || insn == BIN(setdynamic)) {
- rb_iseq_t *ip = iseq;
- int level = *pnop, i;
- const char *name;
- for (i = 0; i < level; i++) {
- ip = ip->parent_iseq;
- }
- name = rb_id2name(ip->local_table[ip->local_size - op]);
-
- if (!name) {
- name = "*";
- }
- ret = rb_str_new2(name);
- }
- else {
- ret = rb_inspect(INT2FIX(op));
- }
- break;
- }
- case TS_ID: /* ID (symbol) */
- op = ID2SYM(op);
-
- case TS_VALUE: /* VALUE */
- op = obj_resurrect(op);
- ret = rb_inspect(op);
- if (CLASS_OF(op) == rb_cISeq) {
- rb_ary_push(child, op);
- }
- break;
-
- case TS_ISEQ: /* iseq */
- {
- rb_iseq_t *iseq = (rb_iseq_t *)op;
- if (iseq) {
- ret = iseq->name;
- if (child) {
- rb_ary_push(child, iseq->self);
- }
- }
- else {
- ret = rb_str_new2("nil");
- }
- break;
- }
- case TS_GENTRY:
- {
- struct rb_global_entry *entry = (struct rb_global_entry *)op;
- ret = rb_str_dup(rb_id2str(entry->id));
- }
- break;
-
- case TS_IC:
- ret = rb_str_new2("<ic>");
- break;
-
- case TS_CDHASH:
- ret = rb_str_new2("<cdhash>");
- break;
-
- case TS_FUNCPTR:
- ret = rb_str_new2("<funcptr>");
- break;
-
- default:
- rb_bug("rb_iseq_disasm: unknown operand type: %c", type);
- }
- return ret;
-}
-
-/**
- * Disassemble a instruction
- * Iseq -> Iseq inspect object
- */
-VALUE
-rb_iseq_disasm_insn(VALUE ret, VALUE *iseq, int pos,
- rb_iseq_t *iseqdat, VALUE child)
-{
- int insn = iseq[pos];
- int len = insn_len(insn);
- int j;
- const char *types = insn_op_types(insn);
- VALUE str = rb_str_new(0, 0);
- const char *insn_name_buff;
-
- insn_name_buff = insn_name(insn);
- if (1) {
- rb_str_catf(str, "%04d %-16s ", pos, insn_name_buff);
- }
- else {
- rb_str_catf(str, "%04d %-16.*s ", pos,
- (int)strcspn(insn_name_buff, "_"), insn_name_buff);
- }
-
- for (j = 0; types[j]; j++) {
- const char *types = insn_op_types(insn);
- VALUE opstr = insn_operand_intern(iseqdat, insn, j, iseq[pos + j + 1],
- len, pos, &iseq[pos + j + 2],
- child);
- rb_str_concat(str, opstr);
-
- if (types[j + 1]) {
- rb_str_cat2(str, ", ");
- }
- }
-
- if (1) {
- int line_no = find_line_no(iseqdat, pos);
- int prev = find_prev_line_no(iseqdat, pos);
- if (line_no && line_no != prev) {
- long slen = RSTRING_LEN(str);
- slen = (slen > 70) ? 0 : (70 - slen);
- str = rb_str_catf(str, "%*s(%4d)", (int)slen, "", line_no);
- }
- }
- else {
- /* for debug */
- struct iseq_insn_info_entry *entry = get_insn_info(iseqdat, pos);
- long slen = RSTRING_LEN(str);
- slen = (slen > 60) ? 0 : (60 - slen);
- str = rb_str_catf(str, "%*s(line: %d, sp: %d)",
- (int)slen, "", entry->line_no, entry->sp);
- }
-
- if (ret) {
- rb_str_cat2(str, "\n");
- rb_str_concat(ret, str);
- }
- else {
- printf("%s\n", RSTRING_PTR(str));
- }
- return len;
-}
-
-static const char *
-catch_type(int type)
-{
- switch (type) {
- case CATCH_TYPE_RESCUE:
- return "rescue";
- case CATCH_TYPE_ENSURE:
- return "ensure";
- case CATCH_TYPE_RETRY:
- return "retry";
- case CATCH_TYPE_BREAK:
- return "break";
- case CATCH_TYPE_REDO:
- return "redo";
- case CATCH_TYPE_NEXT:
- return "next";
- default:
- rb_bug("unknown catch type (%d)", type);
- return 0;
- }
-}
-
-VALUE
-rb_iseq_disasm(VALUE self)
-{
- rb_iseq_t *iseqdat = iseq_check(self);
- VALUE *iseq;
- VALUE str = rb_str_new(0, 0);
- VALUE child = rb_ary_new();
- unsigned long size;
- int i;
- long l;
- ID *tbl;
- enum {header_minlen = 72};
-
- rb_secure(1);
-
- iseq = iseqdat->iseq;
- size = iseqdat->iseq_size;
-
- rb_str_cat2(str, "== disasm: ");
-
- 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 (iseqdat->catch_table_size != 0) {
- rb_str_cat2(str, "== catch table\n");
- }
- for (i = 0; i < iseqdat->catch_table_size; i++) {
- struct iseq_catch_table_entry *entry = &iseqdat->catch_table[i];
- rb_str_catf(str,
- "| catch type: %-6s st: %04d ed: %04d sp: %04d cont: %04d\n",
- catch_type((int)entry->type), (int)entry->start,
- (int)entry->end, (int)entry->sp, (int)entry->cont);
- if (entry->iseq) {
- rb_str_concat(str, rb_iseq_disasm(entry->iseq));
- }
- }
- if (iseqdat->catch_table_size != 0) {
- rb_str_cat2(str, "|-------------------------------------"
- "-----------------------------------\n");
- }
-
- /* show local table information */
- tbl = iseqdat->local_table;
-
- if (tbl) {
- rb_str_catf(str,
- "local table (size: %d, argc: %d "
- "[opts: %d, rest: %d, post: %d, block: %d] s%d)\n",
- iseqdat->local_size, iseqdat->argc,
- iseqdat->arg_opts, iseqdat->arg_rest,
- iseqdat->arg_post_len, iseqdat->arg_block,
- iseqdat->arg_simple);
-
- for (i = 0; i < iseqdat->local_table_size; i++) {
- const char *name = rb_id2name(tbl[i]);
- char info[0x100];
- char argi[0x100] = "";
- char opti[0x100] = "";
-
- if (iseqdat->arg_opts) {
- int argc = iseqdat->argc;
- int opts = iseqdat->arg_opts;
- if (i >= argc && i < argc + opts - 1) {
- snprintf(opti, sizeof(opti), "Opt=%ld",
- iseqdat->arg_opt_table[i - argc]);
- }
- }
-
- snprintf(argi, sizeof(argi), "%s%s%s%s%s", /* arg, opts, rest, post block */
- iseqdat->argc > i ? "Arg" : "",
- opti,
- iseqdat->arg_rest == i ? "Rest" : "",
- (iseqdat->arg_post_start <= i &&
- i < iseqdat->arg_post_start + iseqdat->arg_post_len) ? "Post" : "",
- iseqdat->arg_block == i ? "Block" : "");
-
- snprintf(info, sizeof(info), "%s%s%s%s", name ? name : "?",
- *argi ? "<" : "", argi, *argi ? ">" : "");
-
- rb_str_catf(str, "[%2d] %-11s", iseqdat->local_size - i, info);
- }
- rb_str_cat2(str, "\n");
- }
-
- /* show each line */
- for (i = 0; (size_t)i < size;) {
- i += rb_iseq_disasm_insn(str, iseq, i, iseqdat, child);
- }
-
- for (i = 0; i < RARRAY_LEN(child); i++) {
- VALUE isv = rb_ary_entry(child, i);
- rb_str_concat(str, rb_iseq_disasm(isv));
- }
-
- return str;
-}
-
-static VALUE
-iseq_s_disasm(VALUE klass, VALUE body)
-{
- VALUE ret = Qnil;
- rb_iseq_t *iseq;
- extern rb_iseq_t *rb_method_get_iseq(VALUE body);
-
- rb_secure(1);
-
- if ((iseq = rb_method_get_iseq(body)) != 0) {
- ret = rb_iseq_disasm(iseq->self);
- }
-
- return ret;
-}
-
-const char *
-ruby_node_name(int node)
-{
- switch (node) {
-#include "node_name.inc"
- default:
- rb_bug("unknown node (%d)", node);
- return 0;
- }
-}
-
-#define DECL_SYMBOL(name) \
- static VALUE sym_##name
-
-#define INIT_SYMBOL(name) \
- sym_##name = ID2SYM(rb_intern(#name))
-
-static VALUE
-register_label(struct st_table *table, int idx)
-{
- VALUE sym;
- char buff[8 + (sizeof(idx) * CHAR_BIT * 32 / 100)];
-
- snprintf(buff, sizeof(buff), "label_%u", idx);
- sym = ID2SYM(rb_intern(buff));
- st_insert(table, idx, sym);
- return sym;
-}
-
-static VALUE
-exception_type2symbol(VALUE type)
-{
- ID id;
- switch(type) {
- case CATCH_TYPE_RESCUE: CONST_ID(id, "rescue"); break;
- case CATCH_TYPE_ENSURE: CONST_ID(id, "ensure"); break;
- case CATCH_TYPE_RETRY: CONST_ID(id, "retry"); break;
- case CATCH_TYPE_BREAK: CONST_ID(id, "break"); break;
- case CATCH_TYPE_REDO: CONST_ID(id, "redo"); break;
- case CATCH_TYPE_NEXT: CONST_ID(id, "next"); break;
- default:
- rb_bug("...");
- }
- return ID2SYM(id);
-}
-
-static int
-cdhash_each(VALUE key, VALUE value, VALUE ary)
-{
- rb_ary_push(ary, obj_resurrect(key));
- rb_ary_push(ary, value);
- return ST_CONTINUE;
-}
-
-static VALUE
-iseq_data_to_ary(rb_iseq_t *iseq)
-{
- int i, pos, line = 0;
- VALUE *seq;
-
- VALUE val = rb_ary_new();
- VALUE type; /* Symbol */
- VALUE locals = rb_ary_new();
- VALUE args = rb_ary_new();
- VALUE body = rb_ary_new(); /* [[:insn1, ...], ...] */
- VALUE nbody;
- VALUE exception = rb_ary_new(); /* [[....]] */
- VALUE misc = rb_hash_new();
-
- static VALUE insn_syms[VM_INSTRUCTION_SIZE];
- struct st_table *labels_table = st_init_numtable();
-
- DECL_SYMBOL(top);
- DECL_SYMBOL(method);
- DECL_SYMBOL(block);
- DECL_SYMBOL(class);
- DECL_SYMBOL(rescue);
- DECL_SYMBOL(ensure);
- DECL_SYMBOL(eval);
- DECL_SYMBOL(main);
- DECL_SYMBOL(defined_guard);
-
- if (sym_top == 0) {
- int i;
- for (i=0; i<VM_INSTRUCTION_SIZE; i++) {
- insn_syms[i] = ID2SYM(rb_intern(insn_name(i)));
- }
- INIT_SYMBOL(top);
- INIT_SYMBOL(method);
- INIT_SYMBOL(block);
- INIT_SYMBOL(class);
- INIT_SYMBOL(rescue);
- INIT_SYMBOL(ensure);
- INIT_SYMBOL(eval);
- INIT_SYMBOL(main);
- INIT_SYMBOL(defined_guard);
- }
-
- /* 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;
- case ISEQ_TYPE_CLASS: type = sym_class; break;
- case ISEQ_TYPE_RESCUE: type = sym_rescue; break;
- 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_DEFINED_GUARD: type = sym_defined_guard; break;
- default: rb_bug("unsupported iseq type");
- };
-
- /* locals */
- 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 {
- rb_ary_push(locals, ID2SYM(rb_intern("#arg_rest")));
- }
- }
-
- /* args */
- {
- /*
- * [argc, # argc
- * [label1, label2, ...] # opts
- * rest index,
- * post_len
- * post_start
- * block index,
- * simple,
- * ]
- */
- VALUE arg_opt_labels = rb_ary_new();
- int j;
-
- for (j=0; j<iseq->arg_opts; j++) {
- rb_ary_push(arg_opt_labels,
- register_label(labels_table, iseq->arg_opt_table[j]));
- }
-
- /* commit */
- if (iseq->arg_simple == 1) {
- args = INT2FIX(iseq->argc);
- }
- else {
- rb_ary_push(args, INT2FIX(iseq->argc));
- rb_ary_push(args, arg_opt_labels);
- rb_ary_push(args, INT2FIX(iseq->arg_post_len));
- rb_ary_push(args, INT2FIX(iseq->arg_post_start));
- rb_ary_push(args, INT2FIX(iseq->arg_rest));
- rb_ary_push(args, INT2FIX(iseq->arg_block));
- rb_ary_push(args, INT2FIX(iseq->arg_simple));
- }
- }
-
- /* body */
- for (seq = iseq->iseq; seq < iseq->iseq + 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, insn_syms[insn]);
- for (j=0; j<len-1; j++, seq++) {
- switch (insn_op_type(insn, j)) {
- case TS_OFFSET: {
- unsigned int idx = nseq - iseq->iseq + *seq;
- rb_ary_push(ary, register_label(labels_table, idx));
- break;
- }
- case TS_LINDEX:
- case TS_DINDEX:
- case TS_NUM:
- rb_ary_push(ary, INT2FIX(*seq));
- break;
- case TS_VALUE:
- rb_ary_push(ary, obj_resurrect(*seq));
- break;
- case TS_ISEQ:
- {
- rb_iseq_t *iseq = (rb_iseq_t *)*seq;
- if (iseq) {
- VALUE val = iseq_data_to_ary(iseq);
- rb_ary_push(ary, val);
- }
- else {
- rb_ary_push(ary, Qnil);
- }
- }
- break;
- case TS_GENTRY:
- {
- struct rb_global_entry *entry = (struct rb_global_entry *)*seq;
- rb_ary_push(ary, ID2SYM(entry->id));
- }
- break;
- case TS_IC:
- rb_ary_push(ary, Qnil);
- break;
- case TS_ID:
- rb_ary_push(ary, ID2SYM(*seq));
- break;
- case TS_CDHASH:
- {
- VALUE hash = *seq;
- VALUE val = rb_ary_new();
- int i;
-
- rb_hash_foreach(hash, cdhash_each, val);
-
- for (i=0; i<RARRAY_LEN(val); i+=2) {
- VALUE pos = FIX2INT(rb_ary_entry(val, i+1));
- unsigned int idx = nseq - iseq->iseq + pos;
-
- rb_ary_store(val, i+1,
- register_label(labels_table, idx));
- }
- rb_ary_push(ary, val);
- }
- break;
- default:
- rb_bug("unknown operand: %c", insn_op_type(insn, j));
- }
- }
- rb_ary_push(body, ary);
- }
-
- nbody = body;
-
- /* exception */
- for (i=0; i<iseq->catch_table_size; i++) {
- VALUE ary = rb_ary_new();
- struct iseq_catch_table_entry *entry = &iseq->catch_table[i];
- rb_ary_push(ary, exception_type2symbol(entry->type));
- if (entry->iseq) {
- rb_iseq_t *eiseq;
- GetISeqPtr(entry->iseq, eiseq);
- rb_ary_push(ary, iseq_data_to_ary(eiseq));
- }
- else {
- rb_ary_push(ary, Qnil);
- }
- rb_ary_push(ary, register_label(labels_table, entry->start));
- rb_ary_push(ary, register_label(labels_table, entry->end));
- rb_ary_push(ary, register_label(labels_table, entry->cont));
- rb_ary_push(ary, INT2FIX(entry->sp));
- rb_ary_push(exception, ary);
- }
-
- /* make body with labels and insert line number */
- body = rb_ary_new();
-
- for (i=0, pos=0; i<RARRAY_LEN(nbody); i++) {
- VALUE ary = RARRAY_PTR(nbody)[i];
- VALUE label;
-
- if (st_lookup(labels_table, pos, &label)) {
- rb_ary_push(body, label);
- }
-
- if (iseq->insn_info_table[i].line_no != line) {
- line = iseq->insn_info_table[i].line_no;
- rb_ary_push(body, INT2FIX(line));
- }
-
- rb_ary_push(body, ary);
- pos += RARRAY_LEN(ary);
- }
-
- st_free_table(labels_table);
-
- rb_hash_aset(misc, ID2SYM(rb_intern("arg_size")), INT2FIX(iseq->arg_size));
- rb_hash_aset(misc, ID2SYM(rb_intern("local_size")), INT2FIX(iseq->local_size));
- rb_hash_aset(misc, ID2SYM(rb_intern("stack_max")), INT2FIX(iseq->stack_max));
-
- /*
- * [:magic, :major_version, :minor_version, :format_type, :misc,
- * :name, :filename, :type, :locals, :args,
- * :catch_table, :bytecode]
- */
- rb_ary_push(val, rb_str_new2("YARVInstructionSequence/SimpleDataFormat"));
- rb_ary_push(val, INT2FIX(1)); /* major */
- rb_ary_push(val, INT2FIX(2)); /* minor */
- rb_ary_push(val, INT2FIX(1));
- rb_ary_push(val, misc);
- rb_ary_push(val, iseq->name);
- rb_ary_push(val, iseq->filename);
- rb_ary_push(val, type);
- rb_ary_push(val, locals);
- rb_ary_push(val, args);
- rb_ary_push(val, exception);
- rb_ary_push(val, body);
- return val;
-}
-
-VALUE
-rb_iseq_clone(VALUE iseqval, VALUE newcbase)
-{
- VALUE newiseq = iseq_alloc(rb_cISeq);
- rb_iseq_t *iseq0, *iseq1;
-
- GetISeqPtr(iseqval, iseq0);
- GetISeqPtr(newiseq, iseq1);
-
- *iseq1 = *iseq0;
- iseq1->self = newiseq;
- if (!iseq1->orig) {
- iseq1->orig = iseqval;
- }
- if (newcbase) {
- iseq1->cref_stack = NEW_NODE_LONGLIFE(NODE_BLOCK, newcbase, 0, 0);
- if (iseq0->cref_stack->nd_next) {
- iseq1->cref_stack->nd_next = (NODE *)rb_gc_write_barrier((VALUE)iseq0->cref_stack->nd_next);
- }
- }
-
- return newiseq;
-}
-
-VALUE
-rb_iseq_parameters(const rb_iseq_t *iseq, int is_proc)
-{
- int i, r, s;
- VALUE a, args = rb_ary_new2(iseq->arg_size);
- ID req, opt, rest, block;
-#define PARAM_TYPE(type) rb_ary_push(a = rb_ary_new2(2), ID2SYM(type))
-#define PARAM_ID(i) iseq->local_table[i]
-#define PARAM(i, type) ( \
- PARAM_TYPE(type), \
- rb_id2name(PARAM_ID(i)) ? \
- rb_ary_push(a, ID2SYM(PARAM_ID(i))) : \
- a)
-
- CONST_ID(req, "req");
- CONST_ID(opt, "opt");
- if (is_proc) {
- for (i = 0; i < iseq->argc; i++) {
- PARAM_TYPE(opt);
- rb_ary_push(a, rb_id2name(PARAM_ID(i)) ? ID2SYM(PARAM_ID(i)) : Qnil);
- rb_ary_push(args, a);
- }
- }
- else {
- for (i = 0; i < iseq->argc; i++) {
- rb_ary_push(args, PARAM(i, req));
- }
- }
- r = iseq->arg_rest != -1 ? iseq->arg_rest :
- iseq->arg_post_len > 0 ? iseq->arg_post_start :
- iseq->arg_block != -1 ? iseq->arg_block :
- iseq->arg_size;
- for (s = i; i < r; i++) {
- PARAM_TYPE(opt);
- if (rb_id2name(PARAM_ID(i))) {
- rb_ary_push(a, ID2SYM(PARAM_ID(i)));
- }
- rb_ary_push(args, a);
- }
- if (iseq->arg_rest != -1) {
- CONST_ID(rest, "rest");
- rb_ary_push(args, PARAM(iseq->arg_rest, rest));
- }
- r = iseq->arg_post_start + iseq->arg_post_len;
- if (is_proc) {
- for (i = iseq->arg_post_start; i < r; i++) {
- PARAM_TYPE(opt);
- rb_ary_push(a, rb_id2name(PARAM_ID(i)) ? ID2SYM(PARAM_ID(i)) : Qnil);
- rb_ary_push(args, a);
- }
- }
- else {
- for (i = iseq->arg_post_start; i < r; i++) {
- rb_ary_push(args, PARAM(i, req));
- }
- }
- if (iseq->arg_block != -1) {
- CONST_ID(block, "block");
- rb_ary_push(args, PARAM(iseq->arg_block, block));
- }
- return args;
-}
-
-/* ruby2cext */
-
-VALUE
-rb_iseq_build_for_ruby2cext(
- const rb_iseq_t *iseq_template,
- const rb_insn_func_t *func,
- const struct iseq_insn_info_entry *insn_info_table,
- const char **local_table,
- const VALUE *arg_opt_table,
- const struct iseq_catch_table_entry *catch_table,
- const char *name,
- const char *filename)
-{
- unsigned long i;
- VALUE iseqval = iseq_alloc(rb_cISeq);
- rb_iseq_t *iseq;
- GetISeqPtr(iseqval, iseq);
-
- /* copy iseq */
- *iseq = *iseq_template;
- iseq->name = rb_str_new2(name);
- iseq->filename = rb_str_new2(filename);
- iseq->mark_ary = rb_ary_tmp_new(3);
- iseq->self = iseqval;
-
- iseq->iseq = ALLOC_N(VALUE, iseq->iseq_size);
-
- for (i=0; i<iseq->iseq_size; i+=2) {
- iseq->iseq[i] = BIN(opt_call_c_function);
- iseq->iseq[i+1] = (VALUE)func;
- }
-
- rb_iseq_translate_threaded_code(iseq);
-
-#define ALLOC_AND_COPY(dst, src, type, size) do { \
- if (size) { \
- (dst) = ALLOC_N(type, (size)); \
- MEMCPY((dst), (src), type, (size)); \
- } \
-} while (0)
-
- ALLOC_AND_COPY(iseq->insn_info_table, insn_info_table,
- struct iseq_insn_info_entry, iseq->insn_info_size);
-
- ALLOC_AND_COPY(iseq->catch_table, catch_table,
- struct iseq_catch_table_entry, iseq->catch_table_size);
-
- ALLOC_AND_COPY(iseq->arg_opt_table, arg_opt_table,
- VALUE, iseq->arg_opts);
-
- set_relation(iseq, 0);
-
- return iseqval;
-}
-
-void
-Init_ISeq(void)
-{
- /* declare ::VM::InstructionSequence */
- rb_cISeq = rb_define_class_under(rb_cRubyVM, "InstructionSequence", rb_cObject);
- rb_define_alloc_func(rb_cISeq, iseq_alloc);
- rb_define_method(rb_cISeq, "inspect", iseq_inspect, 0);
- rb_define_method(rb_cISeq, "disasm", rb_iseq_disasm, 0);
- rb_define_method(rb_cISeq, "disassemble", rb_iseq_disasm, 0);
- rb_define_method(rb_cISeq, "to_a", iseq_to_a, 0);
- rb_define_method(rb_cISeq, "eval", iseq_eval, 0);
-
- /* 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", 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);
-}
-
diff --git a/iseq.h b/iseq.h
deleted file mode 100644
index 981b1fca00..0000000000
--- a/iseq.h
+++ /dev/null
@@ -1,103 +0,0 @@
-/**********************************************************************
-
- iseq.h -
-
- $Author$
- created at: 04/01/01 23:36:57 JST
-
- Copyright (C) 2004-2008 Koichi Sasada
-
-**********************************************************************/
-
-#ifndef RUBY_COMPILE_H
-#define RUBY_COMPILE_H
-
-/* compile.c */
-VALUE rb_iseq_compile_node(VALUE self, NODE *node);
-int rb_iseq_translate_threaded_code(rb_iseq_t *iseq);
-VALUE rb_iseq_build_from_ary(rb_iseq_t *iseq, VALUE locals, VALUE args,
- VALUE exception, VALUE body);
-
-/* iseq.c */
-VALUE rb_iseq_load(VALUE data, VALUE parent, VALUE opt);
-struct st_table *ruby_insn_make_insn_table(void);
-
-#define ISEQ_TYPE_TOP INT2FIX(1)
-#define ISEQ_TYPE_METHOD INT2FIX(2)
-#define ISEQ_TYPE_BLOCK INT2FIX(3)
-#define ISEQ_TYPE_CLASS INT2FIX(4)
-#define ISEQ_TYPE_RESCUE INT2FIX(5)
-#define ISEQ_TYPE_ENSURE INT2FIX(6)
-#define ISEQ_TYPE_EVAL INT2FIX(7)
-#define ISEQ_TYPE_MAIN INT2FIX(8)
-#define ISEQ_TYPE_DEFINED_GUARD INT2FIX(9)
-
-#define CATCH_TYPE_RESCUE INT2FIX(1)
-#define CATCH_TYPE_ENSURE INT2FIX(2)
-#define CATCH_TYPE_RETRY INT2FIX(3)
-#define CATCH_TYPE_BREAK INT2FIX(4)
-#define CATCH_TYPE_REDO INT2FIX(5)
-#define CATCH_TYPE_NEXT INT2FIX(6)
-
-struct iseq_insn_info_entry {
- unsigned short position;
- unsigned short line_no;
- unsigned short sp;
-};
-
-struct iseq_catch_table_entry {
- VALUE type;
- VALUE iseq;
- unsigned long start;
- unsigned long end;
- unsigned long cont;
- unsigned long sp;
-};
-
-#define INITIAL_ISEQ_COMPILE_DATA_STORAGE_BUFF_SIZE (512)
-
-struct iseq_compile_data_storage {
- struct iseq_compile_data_storage *next;
- unsigned long pos;
- unsigned long size;
- char *buff;
-};
-
-struct iseq_compile_data {
- /* GC is needed */
- VALUE err_info;
- VALUE mark_ary;
- 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 loopval_popped; /* used by NODE_BREAK */
- VALUE ensure_node;
- VALUE for_iseq;
- struct iseq_compile_data_ensure_node_stack *ensure_node_stack;
- int cached_const;
- struct iseq_compile_data_storage *storage_head;
- struct iseq_compile_data_storage *storage_current;
- int last_line;
- int flip_cnt;
- int label_no;
- int node_level;
- const rb_compile_option_t *option;
-};
-
-/* defined? */
-#define DEFINED_IVAR INT2FIX(1)
-#define DEFINED_IVAR2 INT2FIX(2)
-#define DEFINED_GVAR INT2FIX(3)
-#define DEFINED_CVAR INT2FIX(4)
-#define DEFINED_CONST INT2FIX(5)
-#define DEFINED_METHOD INT2FIX(6)
-#define DEFINED_YIELD INT2FIX(7)
-#define DEFINED_REF INT2FIX(8)
-#define DEFINED_ZSUPER INT2FIX(9)
-#define DEFINED_FUNC INT2FIX(10)
-
-#endif /* RUBY_COMPILE_H */
diff --git a/keywords b/keywords
new file mode 100644
index 0000000000..6eed5e1f4d
--- /dev/null
+++ b/keywords
@@ -0,0 +1,42 @@
+struct kwtable {const char *name; int id[2]; enum lex_state state;};
+%%
+__LINE__, {k__LINE__, k__LINE__}, EXPR_END
+__FILE__, {k__FILE__, k__FILE__}, EXPR_END
+BEGIN, {klBEGIN, klBEGIN}, EXPR_END
+END, {klEND, klEND}, EXPR_END
+alias, {kALIAS, kALIAS}, EXPR_FNAME
+and, {kAND, kAND}, EXPR_BEG
+begin, {kBEGIN, kBEGIN}, EXPR_BEG
+break, {kBREAK, kBREAK}, EXPR_MID
+case, {kCASE, kCASE}, EXPR_BEG
+class, {kCLASS, kCLASS}, EXPR_CLASS
+def, {kDEF, kDEF}, EXPR_FNAME
+defined?, {kDEFINED, kDEFINED}, EXPR_ARG
+do, {kDO, kDO}, EXPR_BEG
+else, {kELSE, kELSE}, EXPR_BEG
+elsif, {kELSIF, kELSIF}, EXPR_BEG
+end, {kEND, kEND}, EXPR_END
+ensure, {kENSURE, kENSURE}, EXPR_BEG
+false, {kFALSE, kFALSE}, EXPR_END
+for, {kFOR, kFOR}, EXPR_BEG
+if, {kIF, kIF_MOD}, EXPR_BEG
+in, {kIN, kIN}, EXPR_BEG
+module, {kMODULE, kMODULE}, EXPR_BEG
+next, {kNEXT, kNEXT}, EXPR_MID
+nil, {kNIL, kNIL}, EXPR_END
+not, {kNOT, kNOT}, EXPR_BEG
+or, {kOR, kOR}, EXPR_BEG
+redo, {kREDO, kREDO}, EXPR_END
+rescue, {kRESCUE, kRESCUE_MOD}, EXPR_MID
+retry, {kRETRY, kRETRY}, EXPR_END
+return, {kRETURN, kRETURN}, EXPR_MID
+self, {kSELF, kSELF}, EXPR_END
+super, {kSUPER, kSUPER}, EXPR_ARG
+then, {kTHEN, kTHEN}, EXPR_BEG
+true, {kTRUE, kTRUE}, EXPR_END
+undef, {kUNDEF, kUNDEF}, EXPR_FNAME
+unless, {kUNLESS, kUNLESS_MOD}, EXPR_BEG
+until, {kUNTIL, kUNTIL_MOD}, EXPR_BEG
+when, {kWHEN, kWHEN}, EXPR_BEG
+while, {kWHILE, kWHILE_MOD}, EXPR_BEG
+yield, {kYIELD, kYIELD}, EXPR_ARG
diff --git a/lex.c b/lex.c
new file mode 100644
index 0000000000..a15309d502
--- /dev/null
+++ b/lex.c
@@ -0,0 +1,136 @@
+/* C code produced by gperf version 2.7.2 */
+/* Command-line: gperf -p -j1 -i 1 -g -o -t -N rb_reserved_word -k'1,3,$' ./keywords */
+struct kwtable {const char *name; int id[2]; enum lex_state state;};
+
+#define TOTAL_KEYWORDS 40
+#define MIN_WORD_LENGTH 2
+#define MAX_WORD_LENGTH 8
+#define MIN_HASH_VALUE 6
+#define MAX_HASH_VALUE 55
+/* maximum key range = 50, duplicates = 0 */
+
+#ifdef __GNUC__
+__inline
+#else
+#ifdef __cplusplus
+inline
+#endif
+#endif
+static unsigned int
+hash (str, len)
+ register const char *str;
+ register unsigned int len;
+{
+ static unsigned char asso_values[] =
+ {
+ 56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
+ 56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
+ 56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
+ 56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
+ 56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
+ 56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
+ 56, 56, 56, 11, 56, 56, 36, 56, 1, 37,
+ 31, 1, 56, 56, 56, 56, 29, 56, 1, 56,
+ 56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
+ 56, 56, 56, 56, 56, 1, 56, 32, 1, 2,
+ 1, 1, 4, 23, 56, 17, 56, 20, 9, 2,
+ 9, 26, 14, 56, 5, 1, 1, 16, 56, 21,
+ 20, 9, 56, 56, 56, 56, 56, 56, 56, 56,
+ 56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
+ 56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
+ 56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
+ 56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
+ 56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
+ 56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
+ 56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
+ 56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
+ 56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
+ 56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
+ 56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
+ 56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
+ 56, 56, 56, 56, 56, 56
+ };
+ register int hval = len;
+
+ switch (hval)
+ {
+ default:
+ case 3:
+ hval += asso_values[(unsigned char)str[2]];
+ case 2:
+ case 1:
+ hval += asso_values[(unsigned char)str[0]];
+ break;
+ }
+ return hval + asso_values[(unsigned char)str[len - 1]];
+}
+
+#ifdef __GNUC__
+__inline
+#endif
+struct kwtable *
+rb_reserved_word (str, len)
+ register const char *str;
+ register unsigned int len;
+{
+ static struct kwtable wordlist[] =
+ {
+ {""}, {""}, {""}, {""}, {""}, {""},
+ {"end", {kEND, kEND}, EXPR_END},
+ {"else", {kELSE, kELSE}, EXPR_BEG},
+ {"case", {kCASE, kCASE}, EXPR_BEG},
+ {"ensure", {kENSURE, kENSURE}, EXPR_BEG},
+ {"module", {kMODULE, kMODULE}, EXPR_BEG},
+ {"elsif", {kELSIF, kELSIF}, EXPR_BEG},
+ {"def", {kDEF, kDEF}, EXPR_FNAME},
+ {"rescue", {kRESCUE, kRESCUE_MOD}, EXPR_MID},
+ {"not", {kNOT, kNOT}, EXPR_BEG},
+ {"then", {kTHEN, kTHEN}, EXPR_BEG},
+ {"yield", {kYIELD, kYIELD}, EXPR_ARG},
+ {"for", {kFOR, kFOR}, EXPR_BEG},
+ {"self", {kSELF, kSELF}, EXPR_END},
+ {"false", {kFALSE, kFALSE}, EXPR_END},
+ {"retry", {kRETRY, kRETRY}, EXPR_END},
+ {"return", {kRETURN, kRETURN}, EXPR_MID},
+ {"true", {kTRUE, kTRUE}, EXPR_END},
+ {"if", {kIF, kIF_MOD}, EXPR_BEG},
+ {"defined?", {kDEFINED, kDEFINED}, EXPR_ARG},
+ {"super", {kSUPER, kSUPER}, EXPR_ARG},
+ {"undef", {kUNDEF, kUNDEF}, EXPR_FNAME},
+ {"break", {kBREAK, kBREAK}, EXPR_MID},
+ {"in", {kIN, kIN}, EXPR_BEG},
+ {"do", {kDO, kDO}, EXPR_BEG},
+ {"nil", {kNIL, kNIL}, EXPR_END},
+ {"until", {kUNTIL, kUNTIL_MOD}, EXPR_BEG},
+ {"unless", {kUNLESS, kUNLESS_MOD}, EXPR_BEG},
+ {"or", {kOR, kOR}, EXPR_BEG},
+ {"next", {kNEXT, kNEXT}, EXPR_MID},
+ {"when", {kWHEN, kWHEN}, EXPR_BEG},
+ {"redo", {kREDO, kREDO}, EXPR_END},
+ {"and", {kAND, kAND}, EXPR_BEG},
+ {"begin", {kBEGIN, kBEGIN}, EXPR_BEG},
+ {"__LINE__", {k__LINE__, k__LINE__}, EXPR_END},
+ {"class", {kCLASS, kCLASS}, EXPR_CLASS},
+ {"__FILE__", {k__FILE__, k__FILE__}, EXPR_END},
+ {"END", {klEND, klEND}, EXPR_END},
+ {"BEGIN", {klBEGIN, klBEGIN}, EXPR_END},
+ {"while", {kWHILE, kWHILE_MOD}, EXPR_BEG},
+ {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
+ {""},
+ {"alias", {kALIAS, kALIAS}, EXPR_FNAME}
+ };
+
+ if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
+ {
+ register int key = hash (str, len);
+
+ if (key <= MAX_HASH_VALUE && key >= 0)
+ {
+ register const char *s = wordlist[key].name;
+
+ if (*str == *s && !strcmp (str + 1, s + 1))
+ return &wordlist[key];
+ }
+ }
+ return 0;
+}
diff --git a/lex.c.blt b/lex.c.blt
deleted file mode 100644
index 1ae80990b9..0000000000
--- a/lex.c.blt
+++ /dev/null
@@ -1,219 +0,0 @@
-/* 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) \
- && (')' == 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 "defs/keywords"
-
-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);
-#define rb_reserved_word(str, len) reserved_word(str, len)
-#line 9 "defs/keywords"
-struct kwtable;
-
-#define TOTAL_KEYWORDS 41
-#define MIN_WORD_LENGTH 2
-#define MAX_WORD_LENGTH 12
-#define MIN_HASH_VALUE 8
-#define MAX_HASH_VALUE 50
-/* maximum key range = 43, duplicates = 0 */
-
-#ifdef __GNUC__
-__inline
-#else
-#ifdef __cplusplus
-inline
-#endif
-#endif
-static unsigned int
-hash (str, len)
- register const char *str;
- register unsigned int len;
-{
- static const unsigned char asso_values[] =
- {
- 51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
- 51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
- 51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
- 51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
- 51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
- 51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
- 51, 51, 51, 26, 51, 51, 14, 51, 16, 8,
- 11, 13, 51, 51, 51, 51, 10, 51, 13, 51,
- 51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
- 51, 51, 51, 51, 51, 11, 51, 13, 1, 26,
- 4, 1, 8, 28, 51, 23, 51, 1, 1, 27,
- 5, 19, 21, 51, 8, 3, 3, 11, 51, 21,
- 24, 16, 51, 51, 51, 51, 51, 51, 51, 51,
- 51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
- 51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
- 51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
- 51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
- 51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
- 51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
- 51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
- 51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
- 51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
- 51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
- 51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
- 51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
- 51, 51, 51, 51, 51, 51
- };
- register int hval = len;
-
- switch (hval)
- {
- default:
- hval += asso_values[(unsigned char)str[2]];
- /*FALLTHROUGH*/
- case 2:
- case 1:
- hval += asso_values[(unsigned char)str[0]];
- break;
- }
- return hval + asso_values[(unsigned char)str[len - 1]];
-}
-
-#ifdef __GNUC__
-__inline
-#if defined __GNUC_STDC_INLINE__ || defined __GNUC_GNU_INLINE__
-__attribute__ ((__gnu_inline__))
-#endif
-#endif
-const struct kwtable *
-rb_reserved_word (str, len)
- register const char *str;
- register unsigned int len;
-{
- static const struct kwtable wordlist[] =
- {
- {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
-#line 19 "defs/keywords"
- {"break", {keyword_break, keyword_break}, EXPR_MID},
-#line 25 "defs/keywords"
- {"else", {keyword_else, keyword_else}, EXPR_BEG},
-#line 35 "defs/keywords"
- {"nil", {keyword_nil, keyword_nil}, EXPR_END},
-#line 28 "defs/keywords"
- {"ensure", {keyword_ensure, keyword_ensure}, EXPR_BEG},
-#line 27 "defs/keywords"
- {"end", {keyword_end, keyword_end}, EXPR_END},
-#line 44 "defs/keywords"
- {"then", {keyword_then, keyword_then}, EXPR_BEG},
-#line 36 "defs/keywords"
- {"not", {keyword_not, keyword_not}, EXPR_ARG},
-#line 29 "defs/keywords"
- {"false", {keyword_false, keyword_false}, EXPR_END},
-#line 42 "defs/keywords"
- {"self", {keyword_self, keyword_self}, EXPR_END},
-#line 26 "defs/keywords"
- {"elsif", {keyword_elsif, keyword_elsif}, EXPR_VALUE},
-#line 39 "defs/keywords"
- {"rescue", {keyword_rescue, modifier_rescue}, EXPR_MID},
-#line 45 "defs/keywords"
- {"true", {keyword_true, keyword_true}, EXPR_END},
-#line 48 "defs/keywords"
- {"until", {keyword_until, modifier_until}, EXPR_VALUE},
-#line 47 "defs/keywords"
- {"unless", {keyword_unless, modifier_unless}, EXPR_VALUE},
-#line 41 "defs/keywords"
- {"return", {keyword_return, keyword_return}, EXPR_MID},
-#line 22 "defs/keywords"
- {"def", {keyword_def, keyword_def}, EXPR_FNAME},
-#line 17 "defs/keywords"
- {"and", {keyword_and, keyword_and}, EXPR_VALUE},
-#line 24 "defs/keywords"
- {"do", {keyword_do, keyword_do}, EXPR_BEG},
-#line 51 "defs/keywords"
- {"yield", {keyword_yield, keyword_yield}, EXPR_ARG},
-#line 30 "defs/keywords"
- {"for", {keyword_for, keyword_for}, EXPR_VALUE},
-#line 46 "defs/keywords"
- {"undef", {keyword_undef, keyword_undef}, EXPR_FNAME},
-#line 37 "defs/keywords"
- {"or", {keyword_or, keyword_or}, EXPR_VALUE},
-#line 32 "defs/keywords"
- {"in", {keyword_in, keyword_in}, EXPR_VALUE},
-#line 49 "defs/keywords"
- {"when", {keyword_when, keyword_when}, EXPR_VALUE},
-#line 40 "defs/keywords"
- {"retry", {keyword_retry, keyword_retry}, EXPR_END},
-#line 31 "defs/keywords"
- {"if", {keyword_if, modifier_if}, EXPR_VALUE},
-#line 20 "defs/keywords"
- {"case", {keyword_case, keyword_case}, EXPR_VALUE},
-#line 38 "defs/keywords"
- {"redo", {keyword_redo, keyword_redo}, EXPR_END},
-#line 34 "defs/keywords"
- {"next", {keyword_next, keyword_next}, EXPR_MID},
-#line 43 "defs/keywords"
- {"super", {keyword_super, keyword_super}, EXPR_ARG},
-#line 33 "defs/keywords"
- {"module", {keyword_module, keyword_module}, EXPR_VALUE},
-#line 18 "defs/keywords"
- {"begin", {keyword_begin, keyword_begin}, EXPR_BEG},
-#line 12 "defs/keywords"
- {"__LINE__", {keyword__LINE__, keyword__LINE__}, EXPR_END},
-#line 13 "defs/keywords"
- {"__FILE__", {keyword__FILE__, keyword__FILE__}, EXPR_END},
-#line 11 "defs/keywords"
- {"__ENCODING__", {keyword__ENCODING__, keyword__ENCODING__}, EXPR_END},
-#line 15 "defs/keywords"
- {"END", {keyword_END, keyword_END}, EXPR_END},
-#line 16 "defs/keywords"
- {"alias", {keyword_alias, keyword_alias}, EXPR_FNAME},
-#line 14 "defs/keywords"
- {"BEGIN", {keyword_BEGIN, keyword_BEGIN}, EXPR_END},
-#line 23 "defs/keywords"
- {"defined?", {keyword_defined, keyword_defined}, EXPR_ARG},
-#line 21 "defs/keywords"
- {"class", {keyword_class, keyword_class}, EXPR_CLASS},
- {""}, {""},
-#line 50 "defs/keywords"
- {"while", {keyword_while, modifier_while}, EXPR_VALUE}
- };
-
- if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
- {
- register int key = hash (str, len);
-
- if (key <= MAX_HASH_VALUE && key >= 0)
- {
- register const char *s = wordlist[key].name;
-
- if (*str == *s && !strcmp (str + 1, s + 1))
- return &wordlist[key];
- }
- }
- return 0;
-}
-#line 52 "defs/keywords"
-
-#endif
diff --git a/lib/.document b/lib/.document
index d3c4a1369b..2159be8360 100644
--- a/lib/.document
+++ b/lib/.document
@@ -14,6 +14,7 @@ base64.rb
benchmark.rb
cgi
cgi.rb
+cgi-lib.rb
complex.rb
csv.rb
date
@@ -23,6 +24,7 @@ debug.rb
delegate.rb
drb
drb.rb
+e2mmap.rb
erb.rb
eregex.rb
fileutils.rb
@@ -59,13 +61,11 @@ pathname.rb
ping.rb
pp.rb
prettyprint.rb
-prime.rb
profile.rb
profiler.rb
pstore.rb
racc
rational.rb
-rdoc.rb
rdoc
readbytes.rb
resolv-replace.rb
@@ -81,8 +81,7 @@ set.rb
shell
shell.rb
shellwords.rb
-# TODO: YARV cause error. why ...?
-# singleton.rb
+singleton.rb
soap
sync.rb
tempfile.rb
diff --git a/lib/English.rb b/lib/English.rb
index 4fd53c5ec6..1a0e11de74 100644
--- a/lib/English.rb
+++ b/lib/English.rb
@@ -11,7 +11,7 @@
# With English:
#
# require "English"
-#
+#
# $OUTPUT_FIELD_SEPARATOR = ' -- '
# "waterbuffalo" =~ /buff/
# print $LOADED_FEATURES, $POSTMATCH, $PID, "\n"
@@ -83,7 +83,7 @@ alias $DEFAULT_OUTPUT $>
# of the contents of all the files
# given as command-line arguments, or <tt>$stdin</tt>
# (in the case where there are no
-# arguments). <tt>$<</tt> supports methods similar to a
+# arguments). <tt>$<</tt> supports methods similar to a
# +File+ object:
# +inmode+, +close+,
# <tt>closed?</tt>, +each+,
@@ -91,7 +91,7 @@ alias $DEFAULT_OUTPUT $>
# +eof+, <tt>eof?</tt>, +file+,
# +filename+, +fileno+,
# +getc+, +gets+, +lineno+,
-# <tt>lineno=</tt>, +path+,
+# <tt>lineno=</tt>, +path+,
# +pos+, <tt>pos=</tt>,
# +read+, +readchar+,
# +readline+, +readlines+,
@@ -139,12 +139,12 @@ alias $ARGV $*
alias $MATCH $&
# The string preceding the match in the last
-# successful pattern match. This variable is local to
+# successful pattern match. This variable is local to
# the current scope. Read only. Thread local.
alias $PREMATCH $`
# The string following the match in the last
-# successful pattern match. This variable is local to
+# successful pattern match. This variable is local to
# the current scope. Read only. Thread local.
alias $POSTMATCH $'
diff --git a/lib/Env.rb b/lib/Env.rb
new file mode 100644
index 0000000000..452a28659e
--- /dev/null
+++ b/lib/Env.rb
@@ -0,0 +1,18 @@
+# Env.rb -- imports environment variables as global variables, Perlish ;(
+# Usage:
+#
+# require 'Env'
+# p $USER
+# $USER = "matz"
+# p ENV["USER"]
+
+require 'importenv'
+
+if __FILE__ == $0
+ p $TERM
+ $TERM = nil
+ p $TERM
+ p ENV["TERM"]
+ $TERM = "foo"
+ p ENV["TERM"]
+end
diff --git a/lib/README b/lib/README
index 1132755cf5..fa2bbd9635 100644
--- a/lib/README
+++ b/lib/README
@@ -1,26 +1,36 @@
English.rb lets Perl'ish global variables have English names
+Env.rb loads importenv.rb
README this file
+base64.rb encodes/decodes base64 (obsolete)
benchmark.rb a benchmark utility
+cgi-lib.rb simple CGI support library (old style)
cgi.rb CGI support library
cgi/session.rb CGI session class
complex.rb complex number support
csv.rb CSV parser/generator
date.rb date object
date/format.rb date parsing and formatting
+date2.rb date object (obsolete; use date)
debug.rb ruby debugger
delegate.rb delegates messages to other object
drb.rb distributed Ruby
e2mmap.rb exception utilities
erb.rb tiny eRuby library
+eregex.rb extended regular expression (just a proof of concept)
fileutils.rb file utilities
finalize.rb adds finalizer to the object
find.rb traverses directory tree
forwardable.rb explicit delegation library
+ftools.rb file tools
getoptlong.rb GNU getoptlong compatible
+getopts.rb parses command line options (use getoptlong)
gserver.rb general TCP server
+importenv.rb imports environment variables as global variables
ipaddr.rb defines the IPAddr class
irb.rb interactive ruby
+jcode.rb Japanese text handling (replace String methods)
logger.rb simple logging utility
+mailread.rb reads mail headers
mathn.rb extended math operation
matrix.rb matrix calculation library
mkmf.rb Makefile maker
@@ -38,25 +48,29 @@ open-uri.rb easy-to-use network interface using URI and Net
open3.rb opens subprocess connection stdin/stdout/stderr
optparse.rb command line option analysis
ostruct.rb python style object
+parsearg.rb argument parser using getopts
parsedate.rb parses date string (obsolete)
pathname.rb Object-Oriented Pathname Class
+ping.rb checks whether host is up, using TCP echo.
pp.rb pretty print objects
prettyprint.rb pretty printing algorithm
-prime.rb prime numbers and factorization
profile.rb runs ruby profiler
profiler.rb ruby profiler module
pstore.rb persistent object strage using marshal
racc/parser.rb racc (Ruby yACC) runtime
rational.rb rational number support
rdoc source-code documentation tool
+readbytes.rb define IO#readbytes
resolv-replace.rb replace Socket DNS by resolve.rb
resolv.rb DNS resolver in Ruby
rexml an XML parser for Ruby, in Ruby
+rubyunit.rb original Ruby Unit testing framework
scanf.rb scanf for Ruby
set.rb defines the Set class
shell.rb runs commands and does pipeline operations like shell
shellwords.rb split into words like shell
singleton.rb singleton design pattern library
+soap SOAP 1.1 implementation
sync.rb 2 phase lock
tempfile.rb temporary file with automatic removal
test/unit Ruby Unit Testing Framework
@@ -76,5 +90,7 @@ uri/ldap.rb ldap scheme support
uri/mailto.rb mailto scheme support
weakref.rb weak reference class
webrick.rb WEB server toolkit
+wsdl WSDL 1.1 implementation
xmlrpc XML-RPC implementation
+xsd XML Schema Datatypes implementation
yaml.rb YAML implementation
diff --git a/lib/base64.rb b/lib/base64.rb
index a240b730b4..8628d611b2 100644
--- a/lib/base64.rb
+++ b/lib/base64.rb
@@ -1,46 +1,46 @@
#
-# = base64.rb: methods for base64-encoding and -decoding strings
+# = base64.rb: methods for base64-encoding and -decoding stings
+#
+# Author:: Yukihiro Matsumoto
+# Documentation:: Dave Thomas and Gavin Sinclair
+#
+# Until Ruby 1.8.1, these methods were defined at the top-level. Now
+# they are in the Base64 module but included in the top-level, where
+# their usage is deprecated.
+#
+# See Base64 for documentation.
#
-# The Base64 module provides for the encoding (#encode64, #strict_encode64,
-# #urlsafe_encode64) and decoding (#decode64, #strict_decode64,
-# #urlsafe_decode64) of binary data using a Base64 representation.
+require "kconv"
+
+
+# The Base64 module provides for the encoding (#encode64) and decoding
+# (#decode64) of binary data using a Base64 representation.
+#
+# The following particular features are also provided:
+# - encode into lines of a given length (#b64encode)
+# - decode the special format specified in RFC2047 for the
+# representation of email headers (decode_b)
#
# == Example
#
-# A simple encoding and decoding.
-#
+# A simple encoding and decoding.
+#
# require "base64"
#
# enc = Base64.encode64('Send reinforcements')
-# # -> "U2VuZCByZWluZm9yY2VtZW50cw==\n"
+# # -> "U2VuZCByZWluZm9yY2VtZW50cw==\n"
# plain = Base64.decode64(enc)
# # -> "Send reinforcements"
#
# The purpose of using base64 to encode data is that it translates any
-# binary data into purely printable characters.
+# binary data into purely printable characters. It is specified in
+# RFC 2045 (http://www.faqs.org/rfcs/rfc2045.html).
module Base64
module_function
- # Returns the Base64-encoded version of +bin+.
- # This method complies with RFC 2045.
- # Line feeds are added to every 60 encoded charactors.
- #
- # require 'base64'
- # Base64.encode64("Now is the time for all good coders\nto learn Ruby")
- #
- # <i>Generates:</i>
- #
- # Tm93IGlzIHRoZSB0aW1lIGZvciBhbGwgZ29vZCBjb2RlcnMKdG8gbGVhcm4g
- # UnVieQ==
- def encode64(bin)
- [bin].pack("m")
- end
-
# Returns the Base64-decoded version of +str+.
- # This method complies with RFC 2045.
- # Characters outside the base alphabet are ignored.
#
# require 'base64'
# str = 'VGhpcyBpcyBsaW5lIG9uZQpUaGlzIG' +
@@ -54,38 +54,80 @@ module Base64
# This is line two
# This is line three
# And so on...
+
def decode64(str)
- str.unpack("m").first
+ str.unpack("m")[0]
end
- # Returns the Base64-encoded version of +bin+.
- # This method complies with RFC 4648.
- # No line feeds are added.
- def strict_encode64(bin)
- [bin].pack("m0")
- end
- # Returns the Base64-decoded version of +str+.
- # This method complies with RFC 4648.
- # 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.unpack("m0").first
+ # Decodes text formatted using a subset of RFC2047 (the one used for
+ # mime-encoding mail headers).
+ #
+ # Only supports an encoding type of 'b' (base 64), and only supports
+ # the character sets ISO-2022-JP and SHIFT_JIS (so the only two
+ # encoded word sequences recognized are <tt>=?ISO-2022-JP?B?...=</tt> and
+ # <tt>=?SHIFT_JIS?B?...=</tt>). Recognition of these sequences is case
+ # insensitive.
+
+ def decode_b(str)
+ str.gsub!(/=\?ISO-2022-JP\?B\?([!->@-~]+)\?=/i) {
+ decode64($1)
+ }
+ str = Kconv::toeuc(str)
+ str.gsub!(/=\?SHIFT_JIS\?B\?([!->@-~]+)\?=/i) {
+ decode64($1)
+ }
+ str = Kconv::toeuc(str)
+ str.gsub!(/\n/, ' ')
+ str.gsub!(/\0/, '')
+ str
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 '/'.
- def urlsafe_encode64(bin)
- strict_encode64(bin).tr("+/", "-_")
+ # Returns the Base64-encoded version of +str+.
+ #
+ # require 'base64'
+ # Base64.b64encode("Now is the time for all good coders\nto learn Ruby")
+ #
+ # <i>Generates:</i>
+ #
+ # Tm93IGlzIHRoZSB0aW1lIGZvciBhbGwgZ29vZCBjb2RlcnMKdG8gbGVhcm4g
+ # UnVieQ==
+
+ def encode64(bin)
+ [bin].pack("m")
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 '/'.
- def urlsafe_decode64(str)
- strict_decode64(str.tr("-_", "+/"))
+ # _Prints_ the Base64 encoded version of +bin+ (a +String+) in lines of
+ # +len+ (default 60) characters.
+ #
+ # require 'base64'
+ # data = "Now is the time for all good coders\nto learn Ruby"
+ # Base64.b64encode(data)
+ #
+ # <i>Generates:</i>
+ #
+ # Tm93IGlzIHRoZSB0aW1lIGZvciBhbGwgZ29vZCBjb2RlcnMKdG8gbGVhcm4g
+ # UnVieQ==
+
+ def b64encode(bin, len = 60)
+ encode64(bin).scan(/.{1,#{len}}/) do
+ print $&, "\n"
+ end
+ end
+
+
+ module Deprecated # :nodoc:
+ include Base64
+
+ for m in Base64.private_instance_methods(false)
+ module_eval %{
+ def #{m}(*args)
+ warn("\#{caller(1)[0]}: #{m} is deprecated; use Base64.#{m} instead")
+ super
+ end
+ }
+ end
end
end
+
+include Base64::Deprecated
diff --git a/lib/benchmark.rb b/lib/benchmark.rb
index 9a0bbef596..a54700a1c2 100644
--- a/lib/benchmark.rb
+++ b/lib/benchmark.rb
@@ -1,13 +1,13 @@
=begin
#
-# benchmark.rb - a performance benchmarking library
-#
+# benchmark.rb - a performance benchmarking library
+#
# $Id$
-#
-# Created by Gotoken (gotoken@notwork.org).
+#
+# Created by Gotoken (gotoken@notwork.org).
#
# Documentation by Gotoken (original RD), Lyle Johnson (RDoc conversion), and
-# Gavin Sinclair (editing).
+# Gavin Sinclair (editing).
#
=end
@@ -26,15 +26,15 @@
# require 'benchmark'
#
# puts Benchmark.measure { "a"*1_000_000 }
-#
+#
# On my machine (FreeBSD 3.2 on P5, 100MHz) this generates:
-#
+#
# 1.166667 0.050000 1.216667 ( 0.571355)
-#
+#
# This report shows the user CPU time, system CPU time, the sum of
# the user and system CPU times, and the elapsed real time. The unit
# of time is seconds.
-#
+#
# * Do some experiments sequentially using the #bm method:
#
# require 'benchmark'
@@ -45,7 +45,7 @@
# x.report { n.times do ; a = "1"; end }
# x.report { 1.upto(n) do ; a = "1"; end }
# end
-#
+#
# The result:
#
# user system total real
@@ -63,14 +63,14 @@
# x.report("times:") { n.times do ; a = "1"; end }
# x.report("upto:") { 1.upto(n) do ; a = "1"; end }
# end
-#
+#
# The result:
-#
+#
# user system total real
# for: 1.050000 0.000000 1.050000 ( 0.503462)
# times: 1.533333 0.016667 1.550000 ( 0.735473)
# upto: 1.500000 0.016667 1.516667 ( 0.711239)
-#
+#
#
# * The times for some benchmarks depend on the order in which items
# are run. These differences are due to the cost of memory
@@ -79,21 +79,21 @@
# sort an array of floats:
#
# require 'benchmark'
-#
+#
# array = (1..1000000).map { rand }
-#
+#
# Benchmark.bmbm do |x|
# x.report("sort!") { array.dup.sort! }
# x.report("sort") { array.dup.sort }
# end
-#
+#
# The result:
-#
+#
# Rehearsal -----------------------------------------
# sort! 11.928000 0.010000 11.938000 ( 12.756000)
# sort 13.048000 0.020000 13.068000 ( 13.857000)
# ------------------------------- total: 25.006000sec
-#
+#
# user system total real
# sort! 12.959000 0.010000 12.969000 ( 13.793000)
# sort 12.007000 0.000000 12.007000 ( 12.791000)
@@ -103,7 +103,6 @@
# using the #benchmark method:
#
# require 'benchmark'
-# include Benchmark # we need the CAPTION and FMTSTR constants
#
# n = 50000
# Benchmark.benchmark(" "*7 + CAPTION, 7, FMTSTR, ">total:", ">avg:") do |x|
@@ -112,9 +111,9 @@
# tu = x.report("upto:") { 1.upto(n) do ; a = "1"; end }
# [tf+tt+tu, (tf+tt+tu)/3]
# end
-#
+#
# The result:
-#
+#
# user system total real
# for: 1.016667 0.016667 1.033333 ( 0.485749)
# times: 1.450000 0.016667 1.466667 ( 0.681367)
@@ -145,10 +144,10 @@ module Benchmark
# suitable for nearly all benchmarking requirements. See the examples in
# Benchmark, and the #bm and #bmbm methods.
#
- # Example:
+ # Example:
#
# require 'benchmark'
- # include Benchmark # we need the CAPTION and FMTSTR constants
+ # include Benchmark # we need the CAPTION and FMTSTR constants
#
# n = 50000
# Benchmark.benchmark(" "*7 + CAPTION, 7, FMTSTR, ">total:", ">avg:") do |x|
@@ -157,16 +156,16 @@ module Benchmark
# tu = x.report("upto:") { 1.upto(n) do ; a = "1"; end }
# [tf+tt+tu, (tf+tt+tu)/3]
# end
- #
+ #
# <i>Generates:</i>
- #
+ #
# user system total real
# for: 1.016667 0.016667 1.033333 ( 0.485749)
# times: 1.450000 0.016667 1.466667 ( 0.681367)
# upto: 1.533333 0.000000 1.533333 ( 0.722166)
# >total: 4.000000 0.033333 4.033333 ( 1.889282)
# >avg: 1.333333 0.011111 1.344444 ( 0.629761)
- #
+ #
def benchmark(caption = "", label_width = nil, fmtstr = nil, *labels) # :yield: report
sync = STDOUT.sync
@@ -177,7 +176,7 @@ module Benchmark
print caption
results = yield(Report.new(label_width, fmtstr))
Array === results and results.grep(Tms).each {|t|
- print((labels.shift || t.label || "").ljust(label_width),
+ print((labels.shift || t.label || "").ljust(label_width),
t.format(fmtstr))
}
STDOUT.sync = sync
@@ -186,7 +185,7 @@ module Benchmark
# A simple interface to the #benchmark method, #bm is generates sequential reports
# with labels. The parameters have the same meaning as for #benchmark.
- #
+ #
# require 'benchmark'
#
# n = 50000
@@ -195,9 +194,9 @@ module Benchmark
# x.report("times:") { n.times do ; a = "1"; end }
# x.report("upto:") { 1.upto(n) do ; a = "1"; end }
# end
- #
+ #
# <i>Generates:</i>
- #
+ #
# user system total real
# for: 1.050000 0.000000 1.050000 ( 0.503462)
# times: 1.533333 0.016667 1.550000 ( 0.735473)
@@ -224,21 +223,21 @@ module Benchmark
# calculate the required label width.
#
# require 'benchmark'
- #
+ #
# array = (1..1000000).map { rand }
- #
+ #
# Benchmark.bmbm do |x|
# x.report("sort!") { array.dup.sort! }
# x.report("sort") { array.dup.sort }
# end
- #
+ #
# <i>Generates:</i>
- #
+ #
# Rehearsal -----------------------------------------
# sort! 11.928000 0.010000 11.938000 ( 12.756000)
# sort 13.048000 0.020000 13.068000 ( 13.857000)
# ------------------------------- total: 25.006000sec
- #
+ #
# user system total real
# sort! 12.959000 0.010000 12.969000 ( 13.793000)
# sort 12.007000 0.000000 12.007000 ( 12.791000)
@@ -267,7 +266,7 @@ module Benchmark
ets = sum.format("total: %tsec")
printf("%s %s\n\n",
"-"*(width+CAPTION.length-ets.length-1), ets)
-
+
# take
print ' '*width, CAPTION
list = []
@@ -285,7 +284,7 @@ module Benchmark
ary
end
- #
+ #
# Returns the time used to execute the given block as a
# Benchmark::Tms object.
#
@@ -293,10 +292,10 @@ module Benchmark
t0, r0 = Benchmark.times, Time.now
yield
t1, r1 = Benchmark.times, Time.now
- Benchmark::Tms.new(t1.utime - t0.utime,
- t1.stime - t0.stime,
- t1.cutime - t0.cutime,
- t1.cstime - t0.cstime,
+ Benchmark::Tms.new(t1.utime - t0.utime,
+ t1.stime - t0.stime,
+ t1.cutime - t0.cutime,
+ t1.cstime - t0.cstime,
r1.to_f - r0.to_f,
label)
end
@@ -323,8 +322,8 @@ module Benchmark
# Usually, one doesn't call this method directly, as new
# Job objects are created by the #bmbm method.
# _width_ is a initial value for the label offset used in formatting;
- # the #bmbm method passes its _width_ argument to this constructor.
- #
+ # the #bmbm method passes its _width_ argument to this constructor.
+ #
def initialize(width)
@width = width
@list = []
@@ -343,11 +342,11 @@ module Benchmark
end
alias report item
-
+
# An array of 2-element arrays, consisting of label and block pairs.
attr_reader :list
-
- # Length of the widest label in the #list, plus one.
+
+ # Length of the widest label in the #list, plus one.
attr_reader :width
end
@@ -363,10 +362,10 @@ module Benchmark
#
# Returns an initialized Report instance.
# Usually, one doesn't call this method directly, as new
- # Report objects are created by the #benchmark and #bm methods.
- # _width_ and _fmtstr_ are the label offset and
- # format string used by Tms#format.
- #
+ # Report objects are created by the #benchmark and #bm methods.
+ # _width_ and _fmtstr_ are the label offset and
+ # format string used by Tms#format.
+ #
def initialize(width = 0, fmtstr = nil)
@width, @fmtstr = width, fmtstr
end
@@ -398,50 +397,50 @@ module Benchmark
# User CPU time
attr_reader :utime
-
+
# System CPU time
attr_reader :stime
-
+
# User CPU time of children
attr_reader :cutime
-
+
# System CPU time of children
attr_reader :cstime
-
+
# Elapsed real time
attr_reader :real
-
- # Total time, that is _utime_ + _stime_ + _cutime_ + _cstime_
+
+ # Total time, that is _utime_ + _stime_ + _cutime_ + _cstime_
attr_reader :total
-
+
# Label
attr_reader :label
#
# Returns an initialized Tms object which has
- # _u_ as the user CPU time, _s_ as the system CPU time,
+ # _u_ as the user CPU time, _s_ as the system CPU time,
# _cu_ as the children's user CPU time, _cs_ as the children's
# system CPU time, _real_ as the elapsed real time and _l_
- # as the label.
- #
+ # as the label.
+ #
def initialize(u = 0.0, s = 0.0, cu = 0.0, cs = 0.0, real = 0.0, l = nil)
@utime, @stime, @cutime, @cstime, @real, @label = u, s, cu, cs, real, l
@total = @utime + @stime + @cutime + @cstime
end
- #
+ #
# Returns a new Tms object whose times are the sum of the times for this
# Tms object, plus the time required to execute the code block (_blk_).
- #
+ #
def add(&blk) # :yield:
- self + Benchmark::measure(&blk)
+ self + Benchmark::measure(&blk)
end
- #
+ #
# An in-place version of #add.
- #
+ #
def add!
- t = Benchmark::measure(&blk)
+ t = Benchmark::measure(&blk)
@utime = utime + t.utime
@stime = stime + t.stime
@cutime = cutime + t.cutime
@@ -450,32 +449,32 @@ module Benchmark
self
end
- #
+ #
# Returns a new Tms object obtained by memberwise summation
# of the individual times for this Tms object with those of the other
# Tms object.
- # This method and #/() are useful for taking statistics.
- #
+ # This method and #/() are useful for taking statistics.
+ #
def +(other); memberwise(:+, other) end
-
+
#
# Returns a new Tms object obtained by memberwise subtraction
# 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_.
#
def *(x); memberwise(:*, x) end
- #
+ #
# Returns a new Tms object obtained by memberwise division
# of the individual times for this Tms object by _x_.
- # This method and #+() are useful for taking statistics.
- #
+ # This method and #+() are useful for taking statistics.
+ #
def /(x); memberwise(:/, x) end
#
@@ -486,15 +485,15 @@ module Benchmark
#
# <tt>%u</tt>:: Replaced by the user CPU time, as reported by Tms#utime.
# <tt>%y</tt>:: Replaced by the system CPU time, as reported by #stime (Mnemonic: y of "s*y*stem")
- # <tt>%U</tt>:: Replaced by the children's user CPU time, as reported by Tms#cutime
+ # <tt>%U</tt>:: Replaced by the children's user CPU time, as reported by Tms#cutime
# <tt>%Y</tt>:: Replaced by the children's system CPU time, as reported by Tms#cstime
# <tt>%t</tt>:: Replaced by the total CPU time, as reported by Tms#total
# <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 _fmtstr_ is not given, FMTSTR is used as default value, detailing the
# user, system and real elapsed time.
- #
+ #
def format(arg0 = nil, *args)
fmtstr = (arg0 || FMTSTR).dup
fmtstr.gsub!(/(%[-+\.\d]*)n/){"#{$1}s" % label}
@@ -507,19 +506,19 @@ module Benchmark
arg0 ? Kernel::format(fmtstr, *args) : fmtstr
end
- #
+ #
# Same as #format.
- #
+ #
def to_s
format
end
- #
+ #
# Returns a new 6-element array, consisting of the
# label, user CPU time, system CPU time, children's
# user CPU time, children's system CPU time and elapsed
# real time.
- #
+ #
def to_a
[@label, @utime, @stime, @cutime, @cstime, @real]
end
@@ -548,7 +547,7 @@ module Benchmark
# The default caption string (heading above the output times).
CAPTION = Benchmark::Tms::CAPTION
- # The default format string used to display times. See also Benchmark::Tms#format.
+ # The default format string used to display times. See also Benchmark::Tms#format.
FMTSTR = Benchmark::Tms::FMTSTR
end
diff --git a/lib/cgi-lib.rb b/lib/cgi-lib.rb
new file mode 100644
index 0000000000..d6b60d66cc
--- /dev/null
+++ b/lib/cgi-lib.rb
@@ -0,0 +1,272 @@
+warn "Warning:#{caller[0].sub(/:in `.*'\z/, '')}: cgi-lib is deprecated after Ruby 1.8.1; use cgi instead"
+
+=begin
+
+= simple CGI support library
+
+= example
+
+== get form values
+
+ require "cgi-lib.rb"
+ query = CGI.new
+ query['field'] # <== value of 'field'
+ query.keys # <== array of fields
+
+and query has Hash class methods
+
+
+== get cookie values
+
+ require "cgi-lib.rb"
+ query = CGI.new
+ query.cookie['name'] # <== cookie value of 'name'
+ query.cookie.keys # <== all cookie names
+
+and query.cookie has Hash class methods
+
+
+== print HTTP header and HTML string to $>
+
+ require "cgi-lib.rb"
+ CGI::print{
+ CGI::tag("HTML"){
+ CGI::tag("HEAD"){ CGI::tag("TITLE"){"TITLE"} } +
+ CGI::tag("BODY"){
+ CGI::tag("FORM", {"ACTION"=>"test.rb", "METHOD"=>"POST"}){
+ CGI::tag("INPUT", {"TYPE"=>"submit", "VALUE"=>"submit"})
+ } +
+ CGI::tag("HR")
+ }
+ }
+ }
+
+
+== make raw cookie string
+
+ require "cgi-lib.rb"
+ cookie1 = CGI::cookie({'name' => 'name',
+ 'value' => 'value',
+ 'path' => 'path', # optional
+ 'domain' => 'domain', # optional
+ 'expires' => Time.now, # optional
+ 'secure' => true # optional
+ })
+
+ CGI::print("Content-Type: text/html", cookie1, cookie2){ "string" }
+
+
+== print HTTP header and string to $>
+
+ require "cgi-lib.rb"
+ CGI::print{ "string" }
+ # == CGI::print("Content-Type: text/html"){ "string" }
+ CGI::print("Content-Type: text/html", cookie1, cookie2){ "string" }
+
+
+=== NPH (no-parse-header) mode
+
+ require "cgi-lib.rb"
+ CGI::print("nph"){ "string" }
+ # == CGI::print("nph", "Content-Type: text/html"){ "string" }
+ CGI::print("nph", "Content-Type: text/html", cookie1, cookie2){ "string" }
+
+
+== make HTML tag string
+
+ require "cgi-lib.rb"
+ CGI::tag("element", {"attribute_name"=>"attribute_value"}){"content"}
+
+
+== make HTTP header string
+
+ require "cgi-lib.rb"
+ CGI::header # == CGI::header("Content-Type: text/html")
+ CGI::header("Content-Type: text/html", cookie1, cookie2)
+
+
+=== NPH (no-parse-header) mode
+
+ CGI::header("nph") # == CGI::header("nph", "Content-Type: text/html")
+ CGI::header("nph", "Content-Type: text/html", cookie1, cookie2)
+
+
+== escape url encode
+
+ require "cgi-lib.rb"
+ url_encoded_string = CGI::escape("string")
+
+
+== unescape url encoded
+
+ require "cgi-lib.rb"
+ string = CGI::unescape("url encoded string")
+
+
+== escape HTML &"<>
+
+ require "cgi-lib.rb"
+ CGI::escapeHTML("string")
+
+
+=end
+
+require "delegate"
+
+class CGI < SimpleDelegator
+
+ CR = "\015"
+ LF = "\012"
+ EOL = CR + LF
+
+ RFC822_DAYS = %w[ Sun Mon Tue Wed Thu Fri Sat ]
+ RFC822_MONTHS = %w[ Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec ]
+
+ # make rfc1123 date string
+ def CGI::rfc1123_date(time)
+ t = time.clone.gmtime
+ return format("%s, %.2d %s %d %.2d:%.2d:%.2d GMT",
+ RFC822_DAYS[t.wday], t.day, RFC822_MONTHS[t.month-1], t.year,
+ t.hour, t.min, t.sec)
+ end
+
+ # escape url encode
+ def CGI::escape(str)
+ str.gsub(/[^a-zA-Z0-9_\-.]/n){ sprintf("%%%02X", $&.unpack("C")[0]) }
+ end
+
+ # unescape url encoded
+ def CGI::unescape(str)
+ str.gsub(/\+/, ' ').gsub(/%([0-9a-fA-F]{2})/){ [$1.hex].pack("c") }
+ end
+
+ # escape HTML
+ def CGI::escapeHTML(str)
+ str.gsub(/&/, "&amp;").gsub(/\"/, "&quot;").gsub(/>/, "&gt;").gsub(/</, "&lt;")
+ end
+
+ # offline mode. read name=value pairs on standard input.
+ def read_from_cmdline
+ require "shellwords.rb"
+ words = Shellwords.shellwords(
+ if not ARGV.empty?
+ ARGV.join(' ')
+ else
+ STDERR.print "(offline mode: enter name=value pairs on standard input)\n" if STDIN.tty?
+ readlines.join(' ').gsub(/\n/, '')
+ end.gsub(/\\=/, '%3D').gsub(/\\&/, '%26'))
+
+ if words.find{|x| x =~ /=/} then words.join('&') else words.join('+') end
+ end
+
+ def initialize(input = $stdin)
+
+ @inputs = {}
+ @cookie = {}
+
+ case ENV['REQUEST_METHOD']
+ when "GET"
+ ENV['QUERY_STRING'] or ""
+ when "POST"
+ input.read(Integer(ENV['CONTENT_LENGTH'])) or ""
+ else
+ read_from_cmdline
+ end.split(/[&;]/).each do |x|
+ key, val = x.split(/=/,2).collect{|x|CGI::unescape(x)}
+ if @inputs.include?(key)
+ @inputs[key] += "\0" + (val or "")
+ else
+ @inputs[key] = (val or "")
+ end
+ end
+
+ super(@inputs)
+
+ if ENV.has_key?('HTTP_COOKIE') or ENV.has_key?('COOKIE')
+ (ENV['HTTP_COOKIE'] or ENV['COOKIE']).split(/; /).each do |x|
+ key, val = x.split(/=/,2)
+ key = CGI::unescape(key)
+ val = val.split(/&/).collect{|x|CGI::unescape(x)}.join("\0")
+ if @cookie.include?(key)
+ @cookie[key] += "\0" + val
+ else
+ @cookie[key] = val
+ end
+ end
+ end
+ end
+
+ attr("inputs")
+ attr("cookie")
+
+ # make HTML tag string
+ def CGI::tag(element, attributes = {})
+ "<" + escapeHTML(element) + attributes.collect{|name, value|
+ " " + escapeHTML(name) + '="' + escapeHTML(value) + '"'
+ }.to_s + ">" +
+ (iterator? ? yield.to_s + "</" + escapeHTML(element) + ">" : "")
+ end
+
+ # make raw cookie string
+ def CGI::cookie(options)
+ "Set-Cookie: " + options['name'] + '=' + escape(options['value']) +
+ (options['domain'] ? '; domain=' + options['domain'] : '') +
+ (options['path'] ? '; path=' + options['path'] : '') +
+ (options['expires'] ? '; expires=' + rfc1123_date(options['expires']) : '') +
+ (options['secure'] ? '; secure' : '')
+ end
+
+ # make HTTP header string
+ def CGI::header(*options)
+ if defined?(MOD_RUBY)
+ options.each{|option|
+ option.sub(/(.*?): (.*)/){
+ Apache::request.headers_out[$1] = $2
+ }
+ }
+ Apache::request.send_http_header
+ ''
+ else
+ if options.delete("nph") or (ENV['SERVER_SOFTWARE'] =~ /IIS/)
+ [(ENV['SERVER_PROTOCOL'] or "HTTP/1.0") + " 200 OK",
+ "Date: " + rfc1123_date(Time.now),
+ "Server: " + (ENV['SERVER_SOFTWARE'] or ""),
+ "Connection: close"] +
+ (options.empty? ? ["Content-Type: text/html"] : options)
+ else
+ options.empty? ? ["Content-Type: text/html"] : options
+ end.join(EOL) + EOL + EOL
+ end
+ end
+
+ # print HTTP header and string to $>
+ def CGI::print(*options)
+ $>.print CGI::header(*options) + yield.to_s
+ end
+
+ # print message to $>
+ def CGI::message(message, title = "", header = ["Content-Type: text/html"])
+ if message.kind_of?(Hash)
+ title = message['title']
+ header = message['header']
+ message = message['body']
+ end
+ CGI::print(*header){
+ CGI::tag("HTML"){
+ CGI::tag("HEAD"){ CGI.tag("TITLE"){ title } } +
+ CGI::tag("BODY"){ message }
+ }
+ }
+ true
+ end
+
+ # print error message to $> and exit
+ def CGI::error
+ CGI::message({'title'=>'ERROR', 'body'=>
+ CGI::tag("PRE"){
+ "ERROR: " + CGI::tag("STRONG"){ escapeHTML($!.to_s) } + "\n" + escapeHTML($@.join("\n"))
+ }
+ })
+ exit
+ end
+end
diff --git a/lib/cgi.rb b/lib/cgi.rb
index 6355a92804..5279439a08 100644
--- a/lib/cgi.rb
+++ b/lib/cgi.rb
@@ -1,14 +1,14 @@
-#
+#
# cgi.rb - cgi support library
-#
+#
# Copyright (C) 2000 Network Applied Communication Laboratory, Inc.
-#
+#
# Copyright (C) 2000 Information-technology Promotion Agency, Japan
#
# Author: Wakou Aoyama <wakou@ruby-lang.org>
#
-# Documentation: Wakou Aoyama (RDoc'd and embellished by William Webber)
-#
+# Documentation: Wakou Aoyama (RDoc'd and embellished by William Webber)
+#
# == Overview
#
# The Common Gateway Interface (CGI) is a simple protocol
@@ -18,7 +18,7 @@
# parameters of the request passed in either in the
# environment (GET) or via $stdin (POST), and everything
# it prints to $stdout is returned to the client.
-#
+#
# This file holds the +CGI+ class. This class provides
# functionality for retrieving HTTP request parameters,
# managing cookies, and generating HTML output. See the
@@ -30,7 +30,9 @@
# See http://www.w3.org/CGI/ for more information on the CGI
# protocol.
-raise "Please, use ruby 1.9.0 or later." if RUBY_VERSION < "1.9.0"
+raise "Please, use ruby 1.5.4 or later." if RUBY_VERSION < "1.5.4"
+
+require 'English'
# CGI class. See documentation for the file cgi.rb for an overview
# of the CGI protocol.
@@ -75,18 +77,18 @@ raise "Please, use ruby 1.9.0 or later." if RUBY_VERSION < "1.9.0"
#
#
# For each of these variables, there is a corresponding attribute with the
-# same name, except all lower case and without a preceding HTTP_.
+# same name, except all lower case and without a preceding HTTP_.
# +content_length+ and +server_port+ are integers; the rest are strings.
#
# === Parameters
#
# The method #params() returns a hash of all parameters in the request as
# name/value-list pairs, where the value-list is an Array of one or more
-# values. The CGI object itself also behaves as a hash of parameter names
-# to values, but only returns a single value (as a String) for each
+# values. The CGI object itself also behaves as a hash of parameter names
+# to values, but only returns a single value (as a String) for each
# parameter name.
#
-# For instance, suppose the request contains the parameter
+# For instance, suppose the request contains the parameter
# "favourite_colours" with the multiple values "blue" and "green". The
# following behaviour would occur:
#
@@ -105,7 +107,7 @@ raise "Please, use ruby 1.9.0 or later." if RUBY_VERSION < "1.9.0"
#
# === Multipart requests
#
-# If a request's method is POST and its content type is multipart/form-data,
+# If a request's method is POST and its content type is multipart/form-data,
# then it may contain uploaded files. These are stored by the QueryExtension
# module in the parameters of the request. The parameter name is the name
# attribute of the file input field, as usual. However, the value is not
@@ -136,7 +138,7 @@ raise "Please, use ruby 1.9.0 or later." if RUBY_VERSION < "1.9.0"
#
# Each HTML element has a corresponding method for generating that
# element as a String. The name of this method is the same as that
-# of the element, all lowercase. The attributes of the element are
+# of the element, all lowercase. The attributes of the element are
# passed in as a hash, and the body as a no-argument block that evaluates
# to a String. The HTML generation module knows which elements are
# always empty, and silently drops any passed-in body. It also knows
@@ -150,57 +152,57 @@ raise "Please, use ruby 1.9.0 or later." if RUBY_VERSION < "1.9.0"
# as arguments, rather than via a hash.
#
# == Examples of use
-#
+#
# === Get form values
-#
+#
# require "cgi"
# cgi = CGI.new
# value = cgi['field_name'] # <== value string for 'field_name'
# # if not 'field_name' included, then return "".
# fields = cgi.keys # <== array of field names
-#
+#
# # returns true if form has 'field_name'
# cgi.has_key?('field_name')
# cgi.has_key?('field_name')
# cgi.include?('field_name')
-#
-# CAUTION! cgi['field_name'] returned an Array with the old
+#
+# CAUTION! cgi['field_name'] returned an Array with the old
# cgi.rb(included in ruby 1.6)
-#
+#
# === Get form values as hash
-#
+#
# require "cgi"
# cgi = CGI.new
# params = cgi.params
-#
+#
# cgi.params is a hash.
-#
+#
# cgi.params['new_field_name'] = ["value"] # add new param
# cgi.params['field_name'] = ["new_value"] # change value
# cgi.params.delete('field_name') # delete param
# cgi.params.clear # delete all params
-#
-#
+#
+#
# === Save form values to file
-#
+#
# require "pstore"
# db = PStore.new("query.db")
# db.transaction do
# db["params"] = cgi.params
# end
-#
-#
+#
+#
# === Restore form values from file
-#
+#
# require "pstore"
# db = PStore.new("query.db")
# db.transaction do
# cgi.params = db["params"]
# end
-#
-#
+#
+#
# === Get multipart form values
-#
+#
# require "cgi"
# cgi = CGI.new
# value = cgi['field_name'] # <== value string for 'field_name'
@@ -208,37 +210,37 @@ raise "Please, use ruby 1.9.0 or later." if RUBY_VERSION < "1.9.0"
# value.local_path # <== path to local file of value
# value.original_filename # <== original filename of value
# value.content_type # <== content_type of value
-#
+#
# and value has StringIO or Tempfile class methods.
-#
+#
# === Get cookie values
-#
+#
# require "cgi"
# cgi = CGI.new
# values = cgi.cookies['name'] # <== array of 'name'
# # if not 'name' included, then return [].
# names = cgi.cookies.keys # <== array of cookie names
-#
+#
# and cgi.cookies is a hash.
-#
+#
# === Get cookie objects
-#
+#
# require "cgi"
# cgi = CGI.new
# for name, cookie in cgi.cookies
# cookie.expires = Time.now + 30
# end
# cgi.out("cookie" => cgi.cookies) {"string"}
-#
+#
# cgi.cookies # { "name1" => cookie1, "name2" => cookie2, ... }
-#
+#
# require "cgi"
# cgi = CGI.new
# cgi.cookies['name'].expires = Time.now + 30
# cgi.out("cookie" => cgi.cookies['name']) {"string"}
-#
+#
# === Print http header and html string to $DEFAULT_OUTPUT ($>)
-#
+#
# require "cgi"
# cgi = CGI.new("html3") # add HTML generation methods
# cgi.out() do
@@ -262,13 +264,2045 @@ raise "Please, use ruby 1.9.0 or later." if RUBY_VERSION < "1.9.0"
# end
# end
# end
-#
+#
# # add HTML generation methods
# CGI.new("html3") # html3.2
# CGI.new("html4") # html4.01 (Strict)
# CGI.new("html4Tr") # html4.01 Transitional
# CGI.new("html4Fr") # html4.01 Frameset
#
-require 'cgi/core'
-require 'cgi/cookie'
-require 'cgi/util'
+class CGI
+
+ # :stopdoc:
+
+ # String for carriage return
+ CR = "\015"
+
+ # String for linefeed
+ LF = "\012"
+
+ # Standard internet newline sequence
+ EOL = CR + LF
+
+ REVISION = '$Id$' #:nodoc:
+
+ NEEDS_BINMODE = true if /WIN/ni.match(RUBY_PLATFORM)
+
+ # Path separators in different environments.
+ PATH_SEPARATOR = {'UNIX'=>'/', 'WINDOWS'=>'\\', 'MACINTOSH'=>':'}
+
+ # HTTP status codes.
+ HTTP_STATUS = {
+ "OK" => "200 OK",
+ "PARTIAL_CONTENT" => "206 Partial Content",
+ "MULTIPLE_CHOICES" => "300 Multiple Choices",
+ "MOVED" => "301 Moved Permanently",
+ "REDIRECT" => "302 Found",
+ "NOT_MODIFIED" => "304 Not Modified",
+ "BAD_REQUEST" => "400 Bad Request",
+ "AUTH_REQUIRED" => "401 Authorization Required",
+ "FORBIDDEN" => "403 Forbidden",
+ "NOT_FOUND" => "404 Not Found",
+ "METHOD_NOT_ALLOWED" => "405 Method Not Allowed",
+ "NOT_ACCEPTABLE" => "406 Not Acceptable",
+ "LENGTH_REQUIRED" => "411 Length Required",
+ "PRECONDITION_FAILED" => "412 Rrecondition Failed",
+ "SERVER_ERROR" => "500 Internal Server Error",
+ "NOT_IMPLEMENTED" => "501 Method Not Implemented",
+ "BAD_GATEWAY" => "502 Bad Gateway",
+ "VARIANT_ALSO_VARIES" => "506 Variant Also Negotiates"
+ }
+
+ # Abbreviated day-of-week names specified by RFC 822
+ RFC822_DAYS = %w[ Sun Mon Tue Wed Thu Fri Sat ]
+
+ # Abbreviated month names specified by RFC 822
+ RFC822_MONTHS = %w[ Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec ]
+
+ # :startdoc:
+
+ def env_table
+ ENV
+ end
+
+ def stdinput
+ $stdin
+ end
+
+ def stdoutput
+ $DEFAULT_OUTPUT
+ end
+
+ private :env_table, :stdinput, :stdoutput
+
+ # URL-encode a string.
+ # url_encoded_string = CGI::escape("'Stop!' said Fred")
+ # # => "%27Stop%21%27+said+Fred"
+ def CGI::escape(string)
+ string.gsub(/([^ a-zA-Z0-9_.-]+)/n) do
+ '%' + $1.unpack('H2' * $1.size).join('%').upcase
+ end.tr(' ', '+')
+ end
+
+
+ # URL-decode a string.
+ # string = CGI::unescape("%27Stop%21%27+said+Fred")
+ # # => "'Stop!' said Fred"
+ def CGI::unescape(string)
+ string.tr('+', ' ').gsub(/((?:%[0-9a-fA-F]{2})+)/n) do
+ [$1.delete('%')].pack('H*')
+ end
+ end
+
+
+ # Escape special characters in HTML, namely &\"<>
+ # CGI::escapeHTML('Usage: foo "bar" <baz>')
+ # # => "Usage: foo &quot;bar&quot; &lt;baz&gt;"
+ def CGI::escapeHTML(string)
+ string.gsub(/&/n, '&amp;').gsub(/\"/n, '&quot;').gsub(/>/n, '&gt;').gsub(/</n, '&lt;')
+ end
+
+
+ # Unescape a string that has been HTML-escaped
+ # CGI::unescapeHTML("Usage: foo &quot;bar&quot; &lt;baz&gt;")
+ # # => "Usage: foo \"bar\" <baz>"
+ def CGI::unescapeHTML(string)
+ string.gsub(/&(amp|quot|gt|lt|\#[0-9]+|\#x[0-9A-Fa-f]+);/n) do
+ match = $1.dup
+ case match
+ when 'amp' then '&'
+ when 'quot' then '"'
+ when 'gt' then '>'
+ when 'lt' then '<'
+ when /\A#0*(\d+)\z/n then
+ if Integer($1) < 256
+ Integer($1).chr
+ else
+ if Integer($1) < 65536 and ($KCODE[0] == ?u or $KCODE[0] == ?U)
+ [Integer($1)].pack("U")
+ else
+ "&##{$1};"
+ end
+ end
+ when /\A#x([0-9a-f]+)\z/ni then
+ if $1.hex < 256
+ $1.hex.chr
+ else
+ if $1.hex < 65536 and ($KCODE[0] == ?u or $KCODE[0] == ?U)
+ [$1.hex].pack("U")
+ else
+ "&#x#{$1};"
+ end
+ end
+ else
+ "&#{match};"
+ end
+ end
+ end
+
+
+ # Escape only the tags of certain HTML elements in +string+.
+ #
+ # Takes an element or elements or array of elements. Each element
+ # is specified by the name of the element, without angle brackets.
+ # This matches both the start and the end tag of that element.
+ # 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")
+ # # "<BR>&lt;A HREF=&quot;url&quot;&gt;&lt;/A&gt"
+ #
+ # print CGI::escapeElement('<BR><A HREF="url"></A>', ["A", "IMG"])
+ # # "<BR>&lt;A HREF=&quot;url&quot;&gt;&lt;/A&gt"
+ def CGI::escapeElement(string, *elements)
+ elements = elements[0] if elements[0].kind_of?(Array)
+ unless elements.empty?
+ string.gsub(/<\/?(?:#{elements.join("|")})(?!\w)(?:.|\n)*?>/ni) do
+ CGI::escapeHTML($&)
+ end
+ else
+ string
+ end
+ end
+
+
+ # Undo escaping such as that done by CGI::escapeElement()
+ #
+ # 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"])
+ # # "&lt;BR&gt;<A HREF="url"></A>"
+ def CGI::unescapeElement(string, *elements)
+ elements = elements[0] if elements[0].kind_of?(Array)
+ unless elements.empty?
+ string.gsub(/&lt;\/?(?:#{elements.join("|")})(?!\w)(?:.|\n)*?&gt;/ni) do
+ CGI::unescapeHTML($&)
+ end
+ else
+ string
+ end
+ end
+
+
+ # Format a +Time+ object as a String using the format specified by RFC 1123.
+ #
+ # CGI::rfc1123_date(Time.now)
+ # # Sat, 01 Jan 2000 00:00:00 GMT
+ def CGI::rfc1123_date(time)
+ t = time.clone.gmtime
+ return format("%s, %.2d %s %.4d %.2d:%.2d:%.2d GMT",
+ RFC822_DAYS[t.wday], t.day, RFC822_MONTHS[t.month-1], t.year,
+ t.hour, t.min, t.sec)
+ end
+
+
+ # Create an HTTP header block as a string.
+ #
+ # Includes the empty line that ends the header block.
+ #
+ # +options+ can be a string specifying the Content-Type (defaults
+ # to text/html), or a hash of header key/value pairs. The following
+ # header keys are recognized:
+ #
+ # type:: the Content-Type header. Defaults to "text/html"
+ # charset:: the charset of the body, appended to the Content-Type header.
+ # nph:: a boolean value. If true, prepend protocol string and status code, and
+ # date; and sets default values for "server" and "connection" if not
+ # explicitly set.
+ # status:: the HTTP status code, returned as the Status header. See the
+ # list of available status codes below.
+ # server:: the server software, returned as the Server header.
+ # connection:: the connection type, returned as the Connection header (for
+ # instance, "close".
+ # length:: the length of the content that will be sent, returned as the
+ # Content-Length header.
+ # language:: the language of the content, returned as the Content-Language
+ # header.
+ # expires:: the time on which the current content expires, as a +Time+
+ # object, returned as the Expires header.
+ # cookie:: a cookie or cookies, returned as one or more Set-Cookie headers.
+ # The value can be the literal string of the cookie; a CGI::Cookie
+ # object; an Array of literal cookie strings or Cookie objects; or a
+ # hash all of whose values are literal cookie strings or Cookie objects.
+ # These cookies are in addition to the cookies held in the
+ # @output_cookies field.
+ #
+ # Other header lines can also be set; they are appended as key: value.
+ #
+ # header
+ # # Content-Type: text/html
+ #
+ # header("text/plain")
+ # # Content-Type: text/plain
+ #
+ # header("nph" => true,
+ # "status" => "OK", # == "200 OK"
+ # # "status" => "200 GOOD",
+ # "server" => ENV['SERVER_SOFTWARE'],
+ # "connection" => "close",
+ # "type" => "text/html",
+ # "charset" => "iso-2022-jp",
+ # # Content-Type: text/html; charset=iso-2022-jp
+ # "length" => 103,
+ # "language" => "ja",
+ # "expires" => Time.now + 30,
+ # "cookie" => [cookie1, cookie2],
+ # "my_header1" => "my_value"
+ # "my_header2" => "my_value")
+ #
+ # The status codes are:
+ #
+ # "OK" --> "200 OK"
+ # "PARTIAL_CONTENT" --> "206 Partial Content"
+ # "MULTIPLE_CHOICES" --> "300 Multiple Choices"
+ # "MOVED" --> "301 Moved Permanently"
+ # "REDIRECT" --> "302 Found"
+ # "NOT_MODIFIED" --> "304 Not Modified"
+ # "BAD_REQUEST" --> "400 Bad Request"
+ # "AUTH_REQUIRED" --> "401 Authorization Required"
+ # "FORBIDDEN" --> "403 Forbidden"
+ # "NOT_FOUND" --> "404 Not Found"
+ # "METHOD_NOT_ALLOWED" --> "405 Method Not Allowed"
+ # "NOT_ACCEPTABLE" --> "406 Not Acceptable"
+ # "LENGTH_REQUIRED" --> "411 Length Required"
+ # "PRECONDITION_FAILED" --> "412 Precondition Failed"
+ # "SERVER_ERROR" --> "500 Internal Server Error"
+ # "NOT_IMPLEMENTED" --> "501 Method Not Implemented"
+ # "BAD_GATEWAY" --> "502 Bad Gateway"
+ # "VARIANT_ALSO_VARIES" --> "506 Variant Also Negotiates"
+ #
+ # This method does not perform charset conversion.
+ #
+ def header(options = "text/html")
+
+ buf = ""
+
+ case options
+ when String
+ options = { "type" => options }
+ when Hash
+ options = options.dup
+ end
+
+ unless options.has_key?("type")
+ options["type"] = "text/html"
+ end
+
+ if options.has_key?("charset")
+ options["type"] += "; charset=" + options.delete("charset")
+ end
+
+ options.delete("nph") if defined?(MOD_RUBY)
+ if options.delete("nph") or
+ (/IIS\/(\d+)/n.match(env_table['SERVER_SOFTWARE']) and $1.to_i < 5)
+ buf += (env_table["SERVER_PROTOCOL"] or "HTTP/1.0") + " " +
+ (HTTP_STATUS[options["status"]] or options["status"] or "200 OK") +
+ EOL +
+ "Date: " + CGI::rfc1123_date(Time.now) + EOL
+
+ unless options.has_key?("server")
+ options["server"] = (env_table['SERVER_SOFTWARE'] or "")
+ end
+
+ unless options.has_key?("connection")
+ options["connection"] = "close"
+ end
+
+ options.delete("status")
+ end
+
+ if options.has_key?("status")
+ buf += "Status: " +
+ (HTTP_STATUS[options["status"]] or options["status"]) + EOL
+ options.delete("status")
+ end
+
+ if options.has_key?("server")
+ buf += "Server: " + options.delete("server") + EOL
+ end
+
+ if options.has_key?("connection")
+ buf += "Connection: " + options.delete("connection") + EOL
+ end
+
+ buf += "Content-Type: " + options.delete("type") + EOL
+
+ if options.has_key?("length")
+ buf += "Content-Length: " + options.delete("length").to_s + EOL
+ end
+
+ if options.has_key?("language")
+ buf += "Content-Language: " + options.delete("language") + EOL
+ end
+
+ if options.has_key?("expires")
+ buf += "Expires: " + CGI::rfc1123_date( options.delete("expires") ) + EOL
+ end
+
+ if options.has_key?("cookie")
+ if options["cookie"].kind_of?(String) or
+ options["cookie"].kind_of?(Cookie)
+ buf += "Set-Cookie: " + options.delete("cookie").to_s + EOL
+ elsif options["cookie"].kind_of?(Array)
+ options.delete("cookie").each{|cookie|
+ buf += "Set-Cookie: " + cookie.to_s + EOL
+ }
+ elsif options["cookie"].kind_of?(Hash)
+ options.delete("cookie").each_value{|cookie|
+ buf += "Set-Cookie: " + cookie.to_s + EOL
+ }
+ end
+ end
+ if @output_cookies
+ for cookie in @output_cookies
+ buf += "Set-Cookie: " + cookie.to_s + EOL
+ end
+ end
+
+ options.each{|key, value|
+ buf += key + ": " + value.to_s + EOL
+ }
+
+ if defined?(MOD_RUBY)
+ table = Apache::request.headers_out
+ buf.scan(/([^:]+): (.+)#{EOL}/n){ |name, value|
+ warn sprintf("name:%s value:%s\n", name, value) if $DEBUG
+ case name
+ when 'Set-Cookie'
+ table.add(name, value)
+ when /^status$/ni
+ Apache::request.status_line = value
+ Apache::request.status = value.to_i
+ when /^content-type$/ni
+ Apache::request.content_type = value
+ when /^content-encoding$/ni
+ Apache::request.content_encoding = value
+ when /^location$/ni
+ if Apache::request.status == 200
+ Apache::request.status = 302
+ end
+ Apache::request.headers_out[name] = value
+ else
+ Apache::request.headers_out[name] = value
+ end
+ }
+ Apache::request.send_http_header
+ ''
+ else
+ buf + EOL
+ end
+
+ end # header()
+
+
+ # Print an HTTP header and body to $DEFAULT_OUTPUT ($>)
+ #
+ # The header is provided by +options+, as for #header().
+ # The body of the document is that returned by the passed-
+ # in block. This block takes no arguments. It is required.
+ #
+ # cgi = CGI.new
+ # cgi.out{ "string" }
+ # # Content-Type: text/html
+ # # Content-Length: 6
+ # #
+ # # string
+ #
+ # cgi.out("text/plain") { "string" }
+ # # Content-Type: text/plain
+ # # Content-Length: 6
+ # #
+ # # string
+ #
+ # cgi.out("nph" => true,
+ # "status" => "OK", # == "200 OK"
+ # "server" => ENV['SERVER_SOFTWARE'],
+ # "connection" => "close",
+ # "type" => "text/html",
+ # "charset" => "iso-2022-jp",
+ # # Content-Type: text/html; charset=iso-2022-jp
+ # "language" => "ja",
+ # "expires" => Time.now + (3600 * 24 * 30),
+ # "cookie" => [cookie1, cookie2],
+ # "my_header1" => "my_value",
+ # "my_header2" => "my_value") { "string" }
+ #
+ # Content-Length is automatically calculated from the size of
+ # the String returned by the content block.
+ #
+ # If ENV['REQUEST_METHOD'] == "HEAD", then only the header
+ # is outputted (the content block is still required, but it
+ # is ignored).
+ #
+ # If the charset is "iso-2022-jp" or "euc-jp" or "shift_jis" then
+ # the content is converted to this charset, and the language is set
+ # to "ja".
+ def out(options = "text/html") # :yield:
+
+ options = { "type" => options } if options.kind_of?(String)
+ content = yield
+
+ if options.has_key?("charset")
+ require "nkf"
+ case options["charset"]
+ when /iso-2022-jp/ni
+ content = NKF::nkf('-m0 -x -j', content)
+ options["language"] = "ja" unless options.has_key?("language")
+ when /euc-jp/ni
+ content = NKF::nkf('-m0 -x -e', content)
+ options["language"] = "ja" unless options.has_key?("language")
+ when /shift_jis/ni
+ content = NKF::nkf('-m0 -x -s', content)
+ options["language"] = "ja" unless options.has_key?("language")
+ end
+ end
+
+ options["length"] = content.length.to_s
+ output = stdoutput
+ output.binmode if defined? output.binmode
+ output.print header(options)
+ output.print content unless "HEAD" == env_table['REQUEST_METHOD']
+ end
+
+
+ # Print an argument or list of arguments to the default output stream
+ #
+ # cgi = CGI.new
+ # cgi.print # default: cgi.print == $DEFAULT_OUTPUT.print
+ def print(*options)
+ stdoutput.print(*options)
+ end
+
+ require "delegate"
+
+ # Class representing an HTTP cookie.
+ #
+ # In addition to its specific fields and methods, a Cookie instance
+ # is a delegator to the array of its values.
+ #
+ # See RFC 2965.
+ #
+ # == 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
+ # )
+ #
+ # cgi.out("cookie" => [cookie1, cookie2]) { "string" }
+ #
+ # 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
+ class Cookie < DelegateClass(Array)
+
+ # Create a new CGI::Cookie object.
+ #
+ # The contents of the cookie can be specified as a +name+ and one
+ # or more +value+ arguments. Alternatively, the contents can
+ # be specified as a single hash argument. The possible keywords of
+ # this hash are as follows:
+ #
+ # 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 the
+ # base directory of the CGI script.
+ # 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.
+ #
+ # These keywords correspond to attributes of the cookie object.
+ def initialize(name = "", *value)
+ if name.kind_of?(String)
+ @name = name
+ @value = value
+ %r|^(.*/)|.match(ENV["SCRIPT_NAME"])
+ @path = ($1 or "")
+ @secure = false
+ return super(@value)
+ end
+
+ options = name
+ unless options.has_key?("name")
+ raise ArgumentError, "`name' required"
+ end
+
+ @name = options["name"]
+ @value = Array(options["value"])
+ # simple support for IE
+ 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 ? true : false
+
+ super(@value)
+ end
+
+ attr_accessor("name", "value", "path", "domain", "expires")
+ attr_reader("secure")
+
+ # Set whether the Cookie is a secure cookie or not.
+ #
+ # +val+ must be a boolean.
+ def secure=(val)
+ @secure = val if val == true or val == false
+ @secure
+ end
+
+ # Convert the Cookie to its string representation.
+ def to_s
+ buf = ""
+ buf += @name + '='
+
+ if @value.kind_of?(String)
+ buf += CGI::escape(@value)
+ else
+ buf += @value.collect{|v| CGI::escape(v) }.join("&")
+ end
+
+ if @domain
+ buf += '; domain=' + @domain
+ end
+
+ if @path
+ buf += '; path=' + @path
+ end
+
+ if @expires
+ buf += '; expires=' + CGI::rfc1123_date(@expires)
+ end
+
+ if @secure == true
+ buf += '; secure'
+ end
+
+ buf
+ end
+
+ end # class Cookie
+
+
+ # Parse a raw cookie string into a hash of cookie-name=>Cookie
+ # pairs.
+ #
+ # cookies = CGI::Cookie::parse("raw_cookie_string")
+ # # { "name1" => cookie1, "name2" => cookie2, ... }
+ #
+ def Cookie::parse(raw_cookie)
+ cookies = Hash.new([])
+ return cookies unless raw_cookie
+
+ raw_cookie.split(/[;,]\s?/).each do |pairs|
+ name, values = pairs.split('=',2)
+ next unless name and values
+ name = CGI::unescape(name)
+ values ||= ""
+ values = values.split('&').collect{|v| CGI::unescape(v) }
+ if cookies.has_key?(name)
+ values = cookies[name].value + values
+ end
+ cookies[name] = Cookie::new(name, *values)
+ end
+
+ cookies
+ end
+
+ # Parse an HTTP query string into a hash of key=>value pairs.
+ #
+ # params = CGI::parse("query_string")
+ # # {"name1" => ["value1", "value2", ...],
+ # # "name2" => ["value1", "value2", ...], ... }
+ #
+ def CGI::parse(query)
+ params = Hash.new([].freeze)
+
+ query.split(/[&;]/n).each do |pairs|
+ key, value = pairs.split('=',2).collect{|v| CGI::unescape(v) }
+ if params.has_key?(key)
+ params[key].push(value)
+ else
+ params[key] = [value]
+ end
+ end
+
+ params
+ end
+
+ # Mixin module. It provides the follow functionality groups:
+ #
+ # 1. Access to CGI environment variables as methods. See
+ # documentation to the CGI class for a list of these variables.
+ #
+ # 2. Access to cookies, including the cookies attribute.
+ #
+ # 3. Access to parameters, including the params attribute, and overloading
+ # [] to perform parameter value lookup by key.
+ #
+ # 4. The initialize_query method, for initialising the above
+ # mechanisms, handling multipart forms, and allowing the
+ # class to be used in "offline" mode.
+ #
+ module QueryExtension
+
+ %w[ CONTENT_LENGTH SERVER_PORT ].each do |env|
+ define_method(env.sub(/^HTTP_/n, '').downcase) do
+ (val = env_table[env]) && Integer(val)
+ end
+ end
+
+ %w[ AUTH_TYPE CONTENT_TYPE GATEWAY_INTERFACE PATH_INFO
+ PATH_TRANSLATED QUERY_STRING REMOTE_ADDR REMOTE_HOST
+ REMOTE_IDENT REMOTE_USER REQUEST_METHOD SCRIPT_NAME
+ SERVER_NAME SERVER_PROTOCOL SERVER_SOFTWARE
+
+ 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.sub(/^HTTP_/n, '').downcase) do
+ env_table[env]
+ end
+ end
+
+ # Get the raw cookies as a string.
+ def raw_cookie
+ env_table["HTTP_COOKIE"]
+ end
+
+ # Get the raw RFC2965 cookies as a string.
+ def raw_cookie2
+ env_table["HTTP_COOKIE2"]
+ end
+
+ # Get the cookies as a hash of cookie-name=>Cookie pairs.
+ attr_accessor("cookies")
+
+ # Get the parameters as a hash of name=>values pairs, where
+ # values is an Array.
+ attr("params")
+
+ # Set all the parameters.
+ def params=(hash)
+ @params.clear
+ @params.update(hash)
+ end
+
+ def read_multipart(boundary, content_length)
+ params = Hash.new([])
+ boundary = "--" + boundary
+ quoted_boundary = Regexp.quote(boundary, "n")
+ buf = ""
+ bufsize = 10 * 1024
+ boundary_end=""
+
+ # start multipart/form-data
+ stdinput.binmode if defined? stdinput.binmode
+ boundary_size = boundary.size + EOL.size
+ content_length -= boundary_size
+ status = stdinput.read(boundary_size)
+ if nil == status
+ raise EOFError, "no content body"
+ elsif boundary + EOL != status
+ raise EOFError, "bad content body"
+ end
+
+ loop do
+ head = nil
+ if 10240 < content_length
+ require "tempfile"
+ body = Tempfile.new("CGI")
+ else
+ begin
+ require "stringio"
+ body = StringIO.new
+ rescue LoadError
+ require "tempfile"
+ body = Tempfile.new("CGI")
+ end
+ end
+ body.binmode if defined? body.binmode
+
+ until head and /#{quoted_boundary}(?:#{EOL}|--)/n.match(buf)
+
+ if (not head) and /#{EOL}#{EOL}/n.match(buf)
+ buf = buf.sub(/\A((?:.|\n)*?#{EOL})#{EOL}/n) do
+ head = $1.dup
+ ""
+ end
+ next
+ end
+
+ if head and ( (EOL + boundary + EOL).size < buf.size )
+ body.print buf[0 ... (buf.size - (EOL + boundary + EOL).size)]
+ buf[0 ... (buf.size - (EOL + boundary + EOL).size)] = ""
+ end
+
+ c = if bufsize < content_length
+ stdinput.read(bufsize)
+ else
+ stdinput.read(content_length)
+ end
+ if c.nil? || c.empty?
+ raise EOFError, "bad content body"
+ end
+ buf.concat(c)
+ content_length -= c.size
+ end
+
+ buf = buf.sub(/\A((?:.|\n)*?)(?:[\r\n]{1,2})?#{quoted_boundary}([\r\n]{1,2}|--)/n) do
+ body.print $1
+ if "--" == $2
+ content_length = -1
+ end
+ boundary_end = $2.dup
+ ""
+ end
+
+ body.rewind
+
+ /Content-Disposition:.* filename=(?:"((?:\\.|[^\"])*)"|([^;\s]*))/ni.match(head)
+ filename = ($1 or $2 or "")
+ if /Mac/ni.match(env_table['HTTP_USER_AGENT']) and
+ /Mozilla/ni.match(env_table['HTTP_USER_AGENT']) and
+ (not /MSIE/ni.match(env_table['HTTP_USER_AGENT']))
+ filename = CGI::unescape(filename)
+ end
+
+ /Content-Type: ([^\s]*)/ni.match(head)
+ content_type = ($1 or "")
+
+ (class << body; self; end).class_eval do
+ alias local_path path
+ define_method(:original_filename) {filename.dup.taint}
+ define_method(:content_type) {content_type.dup.taint}
+ end
+
+ /Content-Disposition:.* name="?([^\";\s]*)"?/ni.match(head)
+ name = $1.dup
+
+ if params.has_key?(name)
+ params[name].push(body)
+ else
+ params[name] = [body]
+ end
+ break if buf.size == 0
+ break if content_length == -1
+ end
+ raise EOFError, "bad boundary end of body part" unless boundary_end=~/--/
+
+ params
+ end # read_multipart
+ private :read_multipart
+
+ # offline mode. read name=value pairs on standard input.
+ def read_from_cmdline
+ require "shellwords"
+
+ string = unless ARGV.empty?
+ ARGV.join(' ')
+ else
+ if STDIN.tty?
+ STDERR.print(
+ %|(offline mode: enter name=value pairs on standard input)\n|
+ )
+ end
+ readlines.join(' ').gsub(/\n/n, '')
+ end.gsub(/\\=/n, '%3D').gsub(/\\&/n, '%26')
+
+ words = Shellwords.shellwords(string)
+
+ if words.find{|x| /=/n.match(x) }
+ words.join('&')
+ else
+ words.join('+')
+ end
+ end
+ private :read_from_cmdline
+
+ # Initialize the data from the query.
+ #
+ # Handles multipart forms (in particular, forms that involve file uploads).
+ # 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=\"?([^\";,]+)\"?|n.match(env_table['CONTENT_TYPE'])
+ boundary = $1.dup
+ @multipart = true
+ @params = read_multipart(boundary, Integer(env_table['CONTENT_LENGTH']))
+ else
+ @multipart = false
+ @params = CGI::parse(
+ case env_table['REQUEST_METHOD']
+ when "GET", "HEAD"
+ if defined?(MOD_RUBY)
+ Apache::request.args or ""
+ else
+ env_table['QUERY_STRING'] or ""
+ end
+ when "POST"
+ stdinput.binmode if defined? stdinput.binmode
+ stdinput.read(Integer(env_table['CONTENT_LENGTH'])) or ''
+ else
+ read_from_cmdline
+ end
+ )
+ end
+
+ @cookies = CGI::Cookie::parse((env_table['HTTP_COOKIE'] or env_table['COOKIE']))
+ end
+ private :initialize_query
+
+ def multipart?
+ @multipart
+ end
+
+ module Value # :nodoc:
+ def set_params(params)
+ @params = params
+ end
+ def [](idx, *args)
+ if args.size == 0
+ warn "#{caller(1)[0]}:CAUTION! cgi['key'] == cgi.params['key'][0]; if want Array, use cgi.params['key']"
+ @params[idx]
+ else
+ super[idx,*args]
+ end
+ end
+ def first
+ warn "#{caller(1)[0]}:CAUTION! cgi['key'] == cgi.params['key'][0]; if want Array, use cgi.params['key']"
+ self
+ end
+ alias last first
+ def to_a
+ @params || [self]
+ end
+ alias to_ary to_a # to be rhs of multiple assignment
+ end
+
+ # Get the value for the parameter with a given key.
+ #
+ # If the parameter has multiple values, only the first will be
+ # retrieved; use #params() to get the array of values.
+ def [](key)
+ params = @params[key]
+ return '' unless params
+ value = params[0]
+ if @multipart
+ if value
+ return value
+ elsif defined? StringIO
+ StringIO.new("")
+ else
+ Tempfile.new("CGI")
+ end
+ else
+ str = if value then value.dup else "" end
+ str.extend(Value)
+ str.set_params(params)
+ str
+ end
+ end
+
+ # Return all parameter keys as an array.
+ def keys(*args)
+ @params.keys(*args)
+ end
+
+ # Returns true if a given parameter key exists in the query.
+ def has_key?(*args)
+ @params.has_key?(*args)
+ end
+ alias key? has_key?
+ alias include? has_key?
+
+ end # QueryExtension
+
+
+ # Prettify (indent) an HTML string.
+ #
+ # +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>")
+ # # <HTML>
+ # # <BODY>
+ # # </BODY>
+ # # </HTML>
+ #
+ # print CGI::pretty("<HTML><BODY></BODY></HTML>", "\t")
+ # # <HTML>
+ # # <BODY>
+ # # </BODY>
+ # # </HTML>
+ #
+ def CGI::pretty(string, shift = " ")
+ lines = string.gsub(/(?!\A)<(?:.|\n)*?>/n, "\n\\0").gsub(/<(?:.|\n)*?>(?!\n)/n, "\\0\n")
+ end_pos = 0
+ while end_pos = lines.index(/^<\/(\w+)/n, end_pos)
+ element = $1.dup
+ start_pos = lines.rindex(/^\s*<#{element}/ni, end_pos)
+ lines[start_pos ... end_pos] = "__" + lines[start_pos ... end_pos].gsub(/\n(?!\z)/n, "\n" + shift) + "__"
+ end
+ lines.gsub(/^((?:#{Regexp::quote(shift)})*)__(?=<\/?\w)/n, '\1')
+ end
+
+
+ # Base module for HTML-generation mixins.
+ #
+ # Provides methods for code generation for tags following
+ # the various DTD element types.
+ module TagMaker # :nodoc:
+
+ # Generate code for an element with required start and end tags.
+ #
+ # - -
+ def nn_element_def(element)
+ nOE_element_def(element, <<-END)
+ if block_given?
+ yield.to_s
+ else
+ ""
+ end +
+ "</#{element.upcase}>"
+ END
+ end
+
+ # Generate code for an empty element.
+ #
+ # - O EMPTY
+ def nOE_element_def(element, append = nil)
+ s = <<-END
+ "<#{element.upcase}" + attributes.collect{|name, value|
+ next unless value
+ " " + CGI::escapeHTML(name) +
+ if true == value
+ ""
+ else
+ '="' + CGI::escapeHTML(value) + '"'
+ end
+ }.to_s + ">"
+ END
+ s.sub!(/\Z/, " +") << append if append
+ s
+ end
+
+ # Generate code for an element for which the end (and possibly the
+ # start) tag is optional.
+ #
+ # O O or - O
+ def nO_element_def(element)
+ nOE_element_def(element, <<-END)
+ if block_given?
+ yield.to_s + "</#{element.upcase}>"
+ else
+ ""
+ end
+ END
+ end
+
+ end # TagMaker
+
+
+ #
+ # Mixin module providing HTML generation methods.
+ #
+ # For example,
+ # cgi.a("http://www.example.com") { "Example" }
+ # # => "<A HREF=\"http://www.example.com\">Example</A>"
+ #
+ # Modules Http3, Http4, etc., contain more basic HTML-generation methods
+ # (:title, :center, etc.).
+ #
+ # See class CGI for a detailed example.
+ #
+ module HtmlExtension
+
+
+ # Generate an Anchor element as a string.
+ #
+ # +href+ can either be a string, giving the URL
+ # for the HREF attribute, or it can be a hash of
+ # the element's attributes.
+ #
+ # The body of the element is the string returned by the no-argument
+ # block passed in.
+ #
+ # a("http://www.example.com") { "Example" }
+ # # => "<A HREF=\"http://www.example.com\">Example</A>"
+ #
+ # a("HREF" => "http://www.example.com", "TARGET" => "_top") { "Example" }
+ # # => "<A HREF=\"http://www.example.com\" TARGET=\"_top\">Example</A>"
+ #
+ def a(href = "") # :yield:
+ attributes = if href.kind_of?(String)
+ { "HREF" => href }
+ else
+ href
+ end
+ if block_given?
+ super(attributes){ yield }
+ else
+ super(attributes)
+ end
+ end
+
+ # Generate a Document Base URI element as a String.
+ #
+ # +href+ can either by a string, giving the base URL for the HREF
+ # attribute, or it can be a has of the element's attributes.
+ #
+ # The passed-in no-argument block is ignored.
+ #
+ # base("http://www.example.com/cgi")
+ # # => "<BASE HREF=\"http://www.example.com/cgi\">"
+ def base(href = "") # :yield:
+ attributes = if href.kind_of?(String)
+ { "HREF" => href }
+ else
+ href
+ end
+ if block_given?
+ super(attributes){ yield }
+ else
+ super(attributes)
+ end
+ end
+
+ # Generate a BlockQuote element as a string.
+ #
+ # +cite+ can either be a string, give the URI for the source of
+ # the quoted text, or a hash, giving all attributes of the element,
+ # or it can be omitted, in which case the element has no attributes.
+ #
+ # The body is provided by the passed-in no-argument block
+ #
+ # blockquote("http://www.example.com/quotes/foo.html") { "Foo!" }
+ # #=> "<BLOCKQUOTE CITE=\"http://www.example.com/quotes/foo.html\">Foo!</BLOCKQUOTE>
+ def blockquote(cite = nil) # :yield:
+ attributes = if cite.kind_of?(String)
+ { "CITE" => cite }
+ else
+ cite or ""
+ end
+ if block_given?
+ super(attributes){ yield }
+ else
+ super(attributes)
+ end
+ end
+
+
+ # Generate a Table Caption element as a string.
+ #
+ # +align+ can be a string, giving the alignment of the caption
+ # (one of top, bottom, left, or right). It can be a hash of
+ # all the attributes of the element. Or it can be omitted.
+ #
+ # The body of the element is provided by the passed-in no-argument block.
+ #
+ # caption("left") { "Capital Cities" }
+ # # => <CAPTION ALIGN=\"left\">Capital Cities</CAPTION>
+ def caption(align = nil) # :yield:
+ attributes = if align.kind_of?(String)
+ { "ALIGN" => align }
+ else
+ align or ""
+ end
+ if block_given?
+ super(attributes){ yield }
+ else
+ super(attributes)
+ end
+ end
+
+
+ # Generate a Checkbox Input element as a string.
+ #
+ # The attributes of the element can be specified as three arguments,
+ # +name+, +value+, and +checked+. +checked+ is a boolean value;
+ # if true, the CHECKED attribute will be included in the element.
+ #
+ # Alternatively, the attributes can be specified as a hash.
+ #
+ # checkbox("name")
+ # # = checkbox("NAME" => "name")
+ #
+ # checkbox("name", "value")
+ # # = checkbox("NAME" => "name", "VALUE" => "value")
+ #
+ # checkbox("name", "value", true)
+ # # = checkbox("NAME" => "name", "VALUE" => "value", "CHECKED" => true)
+ def checkbox(name = "", value = nil, checked = nil)
+ attributes = if name.kind_of?(String)
+ { "TYPE" => "checkbox", "NAME" => name,
+ "VALUE" => value, "CHECKED" => checked }
+ else
+ name["TYPE"] = "checkbox"
+ name
+ end
+ input(attributes)
+ end
+
+ # Generate a sequence of checkbox elements, as a String.
+ #
+ # The checkboxes will all have the same +name+ attribute.
+ # Each checkbox is followed by a label.
+ # There will be one checkbox for each value. Each value
+ # can be specified as a String, which will be used both
+ # as the value of the VALUE attribute and as the label
+ # for that checkbox. A single-element array has the
+ # same effect.
+ #
+ # Each value can also be specified as a three-element array.
+ # The first element is the VALUE attribute; the second is the
+ # label; and the third is a boolean specifying whether this
+ # checkbox is CHECKED.
+ #
+ # Each value can also be specified as a two-element
+ # array, by omitting either the value element (defaults
+ # to the same as the label), or the boolean checked element
+ # (defaults to false).
+ #
+ # checkbox_group("name", "foo", "bar", "baz")
+ # # <INPUT TYPE="checkbox" NAME="name" VALUE="foo">foo
+ # # <INPUT TYPE="checkbox" NAME="name" VALUE="bar">bar
+ # # <INPUT TYPE="checkbox" NAME="name" VALUE="baz">baz
+ #
+ # checkbox_group("name", ["foo"], ["bar", true], "baz")
+ # # <INPUT TYPE="checkbox" NAME="name" VALUE="foo">foo
+ # # <INPUT TYPE="checkbox" CHECKED NAME="name" VALUE="bar">bar
+ # # <INPUT TYPE="checkbox" NAME="name" VALUE="baz">baz
+ #
+ # checkbox_group("name", ["1", "Foo"], ["2", "Bar", true], "Baz")
+ # # <INPUT TYPE="checkbox" NAME="name" VALUE="1">Foo
+ # # <INPUT TYPE="checkbox" CHECKED NAME="name" VALUE="2">Bar
+ # # <INPUT TYPE="checkbox" NAME="name" VALUE="Baz">Baz
+ #
+ # checkbox_group("NAME" => "name",
+ # "VALUES" => ["foo", "bar", "baz"])
+ #
+ # checkbox_group("NAME" => "name",
+ # "VALUES" => [["foo"], ["bar", true], "baz"])
+ #
+ # checkbox_group("NAME" => "name",
+ # "VALUES" => [["1", "Foo"], ["2", "Bar", true], "Baz"])
+ def checkbox_group(name = "", *values)
+ if name.kind_of?(Hash)
+ values = name["VALUES"]
+ name = name["NAME"]
+ end
+ values.collect{|value|
+ if value.kind_of?(String)
+ checkbox(name, value) + value
+ else
+ if value[value.size - 1] == true
+ checkbox(name, value[0], true) +
+ value[value.size - 2]
+ else
+ checkbox(name, value[0]) +
+ value[value.size - 1]
+ end
+ end
+ }.to_s
+ end
+
+
+ # Generate an File Upload Input element as a string.
+ #
+ # The attributes of the element can be specified as three arguments,
+ # +name+, +size+, and +maxlength+. +maxlength+ is the maximum length
+ # of the file's _name_, not of the file's _contents_.
+ #
+ # Alternatively, the attributes can be specified as a hash.
+ #
+ # See #multipart_form() for forms that include file uploads.
+ #
+ # file_field("name")
+ # # <INPUT TYPE="file" NAME="name" SIZE="20">
+ #
+ # file_field("name", 40)
+ # # <INPUT TYPE="file" NAME="name" SIZE="40">
+ #
+ # file_field("name", 40, 100)
+ # # <INPUT TYPE="file" NAME="name" SIZE="40" MAXLENGTH="100">
+ #
+ # file_field("NAME" => "name", "SIZE" => 40)
+ # # <INPUT TYPE="file" NAME="name" SIZE="40">
+ def file_field(name = "", size = 20, maxlength = nil)
+ attributes = if name.kind_of?(String)
+ { "TYPE" => "file", "NAME" => name,
+ "SIZE" => size.to_s }
+ else
+ name["TYPE"] = "file"
+ name
+ end
+ attributes["MAXLENGTH"] = maxlength.to_s if maxlength
+ input(attributes)
+ end
+
+
+ # Generate a Form element as a string.
+ #
+ # +method+ should be either "get" or "post", and defaults to the latter.
+ # +action+ defaults to the current CGI script name. +enctype+
+ # defaults to "application/x-www-form-urlencoded".
+ #
+ # Alternatively, the attributes can be specified as a hash.
+ #
+ # See also #multipart_form() for forms that include file uploads.
+ #
+ # form{ "string" }
+ # # <FORM METHOD="post" ENCTYPE="application/x-www-form-urlencoded">string</FORM>
+ #
+ # form("get") { "string" }
+ # # <FORM METHOD="get" ENCTYPE="application/x-www-form-urlencoded">string</FORM>
+ #
+ # form("get", "url") { "string" }
+ # # <FORM METHOD="get" ACTION="url" ENCTYPE="application/x-www-form-urlencoded">string</FORM>
+ #
+ # form("METHOD" => "post", "ENCTYPE" => "enctype") { "string" }
+ # # <FORM METHOD="post" ENCTYPE="enctype">string</FORM>
+ def form(method = "post", action = script_name, enctype = "application/x-www-form-urlencoded")
+ attributes = if method.kind_of?(String)
+ { "METHOD" => method, "ACTION" => action,
+ "ENCTYPE" => enctype }
+ else
+ unless method.has_key?("METHOD")
+ method["METHOD"] = "post"
+ end
+ unless method.has_key?("ENCTYPE")
+ method["ENCTYPE"] = enctype
+ end
+ method
+ end
+ if block_given?
+ body = yield
+ else
+ body = ""
+ end
+ if @output_hidden
+ body += @output_hidden.collect{|k,v|
+ "<INPUT TYPE=\"HIDDEN\" NAME=\"#{k}\" VALUE=\"#{v}\">"
+ }.to_s
+ end
+ super(attributes){body}
+ end
+
+ # Generate a Hidden Input element as a string.
+ #
+ # The attributes of the element can be specified as two arguments,
+ # +name+ and +value+.
+ #
+ # Alternatively, the attributes can be specified as a hash.
+ #
+ # hidden("name")
+ # # <INPUT TYPE="hidden" NAME="name">
+ #
+ # hidden("name", "value")
+ # # <INPUT TYPE="hidden" NAME="name" VALUE="value">
+ #
+ # hidden("NAME" => "name", "VALUE" => "reset", "ID" => "foo")
+ # # <INPUT TYPE="hidden" NAME="name" VALUE="value" ID="foo">
+ def hidden(name = "", value = nil)
+ attributes = if name.kind_of?(String)
+ { "TYPE" => "hidden", "NAME" => name, "VALUE" => value }
+ else
+ name["TYPE"] = "hidden"
+ name
+ end
+ input(attributes)
+ end
+
+ # Generate a top-level HTML element as a string.
+ #
+ # The attributes of the element are specified as a hash. The
+ # pseudo-attribute "PRETTY" can be used to specify that the generated
+ # HTML string should be indented. "PRETTY" can also be specified as
+ # a string as the sole argument to this method. The pseudo-attribute
+ # "DOCTYPE", if given, is used as the leading DOCTYPE SGML tag; it
+ # should include the entire text of this tag, including angle brackets.
+ #
+ # The body of the html element is supplied as a block.
+ #
+ # html{ "string" }
+ # # <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><HTML>string</HTML>
+ #
+ # html("LANG" => "ja") { "string" }
+ # # <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><HTML LANG="ja">string</HTML>
+ #
+ # html("DOCTYPE" => false) { "string" }
+ # # <HTML>string</HTML>
+ #
+ # html("DOCTYPE" => '<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">') { "string" }
+ # # <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"><HTML>string</HTML>
+ #
+ # html("PRETTY" => " ") { "<BODY></BODY>" }
+ # # <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+ # # <HTML>
+ # # <BODY>
+ # # </BODY>
+ # # </HTML>
+ #
+ # html("PRETTY" => "\t") { "<BODY></BODY>" }
+ # # <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+ # # <HTML>
+ # # <BODY>
+ # # </BODY>
+ # # </HTML>
+ #
+ # html("PRETTY") { "<BODY></BODY>" }
+ # # = html("PRETTY" => " ") { "<BODY></BODY>" }
+ #
+ # html(if $VERBOSE then "PRETTY" end) { "HTML string" }
+ #
+ def html(attributes = {}) # :yield:
+ if nil == attributes
+ attributes = {}
+ elsif "PRETTY" == attributes
+ attributes = { "PRETTY" => true }
+ end
+ pretty = attributes.delete("PRETTY")
+ pretty = " " if true == pretty
+ buf = ""
+
+ if attributes.has_key?("DOCTYPE")
+ if attributes["DOCTYPE"]
+ buf += attributes.delete("DOCTYPE")
+ else
+ attributes.delete("DOCTYPE")
+ end
+ else
+ buf += doctype
+ end
+
+ if block_given?
+ buf += super(attributes){ yield }
+ else
+ buf += super(attributes)
+ end
+
+ if pretty
+ CGI::pretty(buf, pretty)
+ else
+ buf
+ end
+
+ end
+
+ # Generate an Image Button Input element as a string.
+ #
+ # +src+ is the URL of the image to use for the button. +name+
+ # is the input name. +alt+ is the alternative text for the image.
+ #
+ # Alternatively, the attributes can be specified as a hash.
+ #
+ # image_button("url")
+ # # <INPUT TYPE="image" SRC="url">
+ #
+ # image_button("url", "name", "string")
+ # # <INPUT TYPE="image" SRC="url" NAME="name" ALT="string">
+ #
+ # image_button("SRC" => "url", "ATL" => "strng")
+ # # <INPUT TYPE="image" SRC="url" ALT="string">
+ def image_button(src = "", name = nil, alt = nil)
+ attributes = if src.kind_of?(String)
+ { "TYPE" => "image", "SRC" => src, "NAME" => name,
+ "ALT" => alt }
+ else
+ src["TYPE"] = "image"
+ src["SRC"] ||= ""
+ src
+ end
+ input(attributes)
+ end
+
+
+ # Generate an Image element as a string.
+ #
+ # +src+ is the URL of the image. +alt+ is the alternative text for
+ # the image. +width+ is the width of the image, and +height+ is
+ # its height.
+ #
+ # Alternatively, the attributes can be specified as a hash.
+ #
+ # img("src", "alt", 100, 50)
+ # # <IMG SRC="src" ALT="alt" WIDTH="100" HEIGHT="50">
+ #
+ # img("SRC" => "src", "ALT" => "alt", "WIDTH" => 100, "HEIGHT" => 50)
+ # # <IMG SRC="src" ALT="alt" WIDTH="100" HEIGHT="50">
+ def img(src = "", alt = "", width = nil, height = nil)
+ attributes = if src.kind_of?(String)
+ { "SRC" => src, "ALT" => alt }
+ else
+ src
+ end
+ attributes["WIDTH"] = width.to_s if width
+ attributes["HEIGHT"] = height.to_s if height
+ super(attributes)
+ end
+
+
+ # Generate a Form element with multipart encoding as a String.
+ #
+ # Multipart encoding is used for forms that include file uploads.
+ #
+ # +action+ is the action to perform. +enctype+ is the encoding
+ # type, which defaults to "multipart/form-data".
+ #
+ # Alternatively, the attributes can be specified as a hash.
+ #
+ # multipart_form{ "string" }
+ # # <FORM METHOD="post" ENCTYPE="multipart/form-data">string</FORM>
+ #
+ # multipart_form("url") { "string" }
+ # # <FORM METHOD="post" ACTION="url" ENCTYPE="multipart/form-data">string</FORM>
+ def multipart_form(action = nil, enctype = "multipart/form-data")
+ attributes = if action == nil
+ { "METHOD" => "post", "ENCTYPE" => enctype }
+ elsif action.kind_of?(String)
+ { "METHOD" => "post", "ACTION" => action,
+ "ENCTYPE" => enctype }
+ else
+ unless action.has_key?("METHOD")
+ action["METHOD"] = "post"
+ end
+ unless action.has_key?("ENCTYPE")
+ action["ENCTYPE"] = enctype
+ end
+ action
+ end
+ if block_given?
+ form(attributes){ yield }
+ else
+ form(attributes)
+ end
+ end
+
+
+ # Generate a Password Input element as a string.
+ #
+ # +name+ is the name of the input field. +value+ is its default
+ # value. +size+ is the size of the input field display. +maxlength+
+ # is the maximum length of the inputted password.
+ #
+ # Alternatively, attributes can be specified as a hash.
+ #
+ # password_field("name")
+ # # <INPUT TYPE="password" NAME="name" SIZE="40">
+ #
+ # password_field("name", "value")
+ # # <INPUT TYPE="password" NAME="name" VALUE="value" SIZE="40">
+ #
+ # password_field("password", "value", 80, 200)
+ # # <INPUT TYPE="password" NAME="name" VALUE="value" SIZE="80" MAXLENGTH="200">
+ #
+ # password_field("NAME" => "name", "VALUE" => "value")
+ # # <INPUT TYPE="password" NAME="name" VALUE="value">
+ def password_field(name = "", value = nil, size = 40, maxlength = nil)
+ attributes = if name.kind_of?(String)
+ { "TYPE" => "password", "NAME" => name,
+ "VALUE" => value, "SIZE" => size.to_s }
+ else
+ name["TYPE"] = "password"
+ name
+ end
+ attributes["MAXLENGTH"] = maxlength.to_s if maxlength
+ input(attributes)
+ end
+
+ # Generate a Select element as a string.
+ #
+ # +name+ is the name of the element. The +values+ are the options that
+ # can be selected from the Select menu. Each value can be a String or
+ # a one, two, or three-element Array. If a String or a one-element
+ # Array, this is both the value of that option and the text displayed for
+ # it. If a three-element Array, the elements are the option value, displayed
+ # text, and a boolean value specifying whether this option starts as selected.
+ # The two-element version omits either the option value (defaults to the same
+ # as the display text) or the boolean selected specifier (defaults to false).
+ #
+ # The attributes and options can also be specified as a hash. In this
+ # case, options are specified as an array of values as described above,
+ # with the hash key of "VALUES".
+ #
+ # popup_menu("name", "foo", "bar", "baz")
+ # # <SELECT NAME="name">
+ # # <OPTION VALUE="foo">foo</OPTION>
+ # # <OPTION VALUE="bar">bar</OPTION>
+ # # <OPTION VALUE="baz">baz</OPTION>
+ # # </SELECT>
+ #
+ # popup_menu("name", ["foo"], ["bar", true], "baz")
+ # # <SELECT NAME="name">
+ # # <OPTION VALUE="foo">foo</OPTION>
+ # # <OPTION VALUE="bar" SELECTED>bar</OPTION>
+ # # <OPTION VALUE="baz">baz</OPTION>
+ # # </SELECT>
+ #
+ # popup_menu("name", ["1", "Foo"], ["2", "Bar", true], "Baz")
+ # # <SELECT NAME="name">
+ # # <OPTION VALUE="1">Foo</OPTION>
+ # # <OPTION SELECTED VALUE="2">Bar</OPTION>
+ # # <OPTION VALUE="Baz">Baz</OPTION>
+ # # </SELECT>
+ #
+ # popup_menu("NAME" => "name", "SIZE" => 2, "MULTIPLE" => true,
+ # "VALUES" => [["1", "Foo"], ["2", "Bar", true], "Baz"])
+ # # <SELECT NAME="name" MULTIPLE SIZE="2">
+ # # <OPTION VALUE="1">Foo</OPTION>
+ # # <OPTION SELECTED VALUE="2">Bar</OPTION>
+ # # <OPTION VALUE="Baz">Baz</OPTION>
+ # # </SELECT>
+ def popup_menu(name = "", *values)
+
+ if name.kind_of?(Hash)
+ values = name["VALUES"]
+ size = name["SIZE"].to_s if name["SIZE"]
+ multiple = name["MULTIPLE"]
+ name = name["NAME"]
+ else
+ size = nil
+ multiple = nil
+ end
+
+ select({ "NAME" => name, "SIZE" => size,
+ "MULTIPLE" => multiple }){
+ values.collect{|value|
+ if value.kind_of?(String)
+ option({ "VALUE" => value }){ value }
+ else
+ if value[value.size - 1] == true
+ option({ "VALUE" => value[0], "SELECTED" => true }){
+ value[value.size - 2]
+ }
+ else
+ option({ "VALUE" => value[0] }){
+ value[value.size - 1]
+ }
+ end
+ end
+ }.to_s
+ }
+
+ end
+
+ # Generates a radio-button Input element.
+ #
+ # +name+ is the name of the input field. +value+ is the value of
+ # the field if checked. +checked+ specifies whether the field
+ # starts off checked.
+ #
+ # Alternatively, the attributes can be specified as a hash.
+ #
+ # radio_button("name", "value")
+ # # <INPUT TYPE="radio" NAME="name" VALUE="value">
+ #
+ # radio_button("name", "value", true)
+ # # <INPUT TYPE="radio" NAME="name" VALUE="value" CHECKED>
+ #
+ # radio_button("NAME" => "name", "VALUE" => "value", "ID" => "foo")
+ # # <INPUT TYPE="radio" NAME="name" VALUE="value" ID="foo">
+ def radio_button(name = "", value = nil, checked = nil)
+ attributes = if name.kind_of?(String)
+ { "TYPE" => "radio", "NAME" => name,
+ "VALUE" => value, "CHECKED" => checked }
+ else
+ name["TYPE"] = "radio"
+ name
+ end
+ input(attributes)
+ end
+
+ # Generate a sequence of radio button Input elements, as a String.
+ #
+ # This works the same as #checkbox_group(). However, it is not valid
+ # to have more than one radiobutton in a group checked.
+ #
+ # radio_group("name", "foo", "bar", "baz")
+ # # <INPUT TYPE="radio" NAME="name" VALUE="foo">foo
+ # # <INPUT TYPE="radio" NAME="name" VALUE="bar">bar
+ # # <INPUT TYPE="radio" NAME="name" VALUE="baz">baz
+ #
+ # radio_group("name", ["foo"], ["bar", true], "baz")
+ # # <INPUT TYPE="radio" NAME="name" VALUE="foo">foo
+ # # <INPUT TYPE="radio" CHECKED NAME="name" VALUE="bar">bar
+ # # <INPUT TYPE="radio" NAME="name" VALUE="baz">baz
+ #
+ # radio_group("name", ["1", "Foo"], ["2", "Bar", true], "Baz")
+ # # <INPUT TYPE="radio" NAME="name" VALUE="1">Foo
+ # # <INPUT TYPE="radio" CHECKED NAME="name" VALUE="2">Bar
+ # # <INPUT TYPE="radio" NAME="name" VALUE="Baz">Baz
+ #
+ # radio_group("NAME" => "name",
+ # "VALUES" => ["foo", "bar", "baz"])
+ #
+ # radio_group("NAME" => "name",
+ # "VALUES" => [["foo"], ["bar", true], "baz"])
+ #
+ # radio_group("NAME" => "name",
+ # "VALUES" => [["1", "Foo"], ["2", "Bar", true], "Baz"])
+ def radio_group(name = "", *values)
+ if name.kind_of?(Hash)
+ values = name["VALUES"]
+ name = name["NAME"]
+ end
+ values.collect{|value|
+ if value.kind_of?(String)
+ radio_button(name, value) + value
+ else
+ if value[value.size - 1] == true
+ radio_button(name, value[0], true) +
+ value[value.size - 2]
+ else
+ radio_button(name, value[0]) +
+ value[value.size - 1]
+ end
+ end
+ }.to_s
+ end
+
+ # Generate a reset button Input element, as a String.
+ #
+ # This resets the values on a form to their initial values. +value+
+ # is the text displayed on the button. +name+ is the name of this button.
+ #
+ # Alternatively, the attributes can be specified as a hash.
+ #
+ # reset
+ # # <INPUT TYPE="reset">
+ #
+ # reset("reset")
+ # # <INPUT TYPE="reset" VALUE="reset">
+ #
+ # reset("VALUE" => "reset", "ID" => "foo")
+ # # <INPUT TYPE="reset" VALUE="reset" ID="foo">
+ def reset(value = nil, name = nil)
+ attributes = if (not value) or value.kind_of?(String)
+ { "TYPE" => "reset", "VALUE" => value, "NAME" => name }
+ else
+ value["TYPE"] = "reset"
+ value
+ end
+ input(attributes)
+ end
+
+ alias scrolling_list popup_menu
+
+ # Generate a submit button Input element, as a String.
+ #
+ # +value+ is the text to display on the button. +name+ is the name
+ # of the input.
+ #
+ # Alternatively, the attributes can be specified as a hash.
+ #
+ # submit
+ # # <INPUT TYPE="submit">
+ #
+ # submit("ok")
+ # # <INPUT TYPE="submit" VALUE="ok">
+ #
+ # submit("ok", "button1")
+ # # <INPUT TYPE="submit" VALUE="ok" NAME="button1">
+ #
+ # submit("VALUE" => "ok", "NAME" => "button1", "ID" => "foo")
+ # # <INPUT TYPE="submit" VALUE="ok" NAME="button1" ID="foo">
+ def submit(value = nil, name = nil)
+ attributes = if (not value) or value.kind_of?(String)
+ { "TYPE" => "submit", "VALUE" => value, "NAME" => name }
+ else
+ value["TYPE"] = "submit"
+ value
+ end
+ input(attributes)
+ end
+
+ # Generate a text field Input element, as a String.
+ #
+ # +name+ is the name of the input field. +value+ is its initial
+ # value. +size+ is the size of the input area. +maxlength+
+ # is the maximum length of input accepted.
+ #
+ # Alternatively, the attributes can be specified as a hash.
+ #
+ # text_field("name")
+ # # <INPUT TYPE="text" NAME="name" SIZE="40">
+ #
+ # text_field("name", "value")
+ # # <INPUT TYPE="text" NAME="name" VALUE="value" SIZE="40">
+ #
+ # text_field("name", "value", 80)
+ # # <INPUT TYPE="text" NAME="name" VALUE="value" SIZE="80">
+ #
+ # text_field("name", "value", 80, 200)
+ # # <INPUT TYPE="text" NAME="name" VALUE="value" SIZE="80" MAXLENGTH="200">
+ #
+ # text_field("NAME" => "name", "VALUE" => "value")
+ # # <INPUT TYPE="text" NAME="name" VALUE="value">
+ def text_field(name = "", value = nil, size = 40, maxlength = nil)
+ attributes = if name.kind_of?(String)
+ { "TYPE" => "text", "NAME" => name, "VALUE" => value,
+ "SIZE" => size.to_s }
+ else
+ name["TYPE"] = "text"
+ name
+ end
+ attributes["MAXLENGTH"] = maxlength.to_s if maxlength
+ input(attributes)
+ end
+
+ # Generate a TextArea element, as a String.
+ #
+ # +name+ is the name of the textarea. +cols+ is the number of
+ # columns and +rows+ is the number of rows in the display.
+ #
+ # Alternatively, the attributes can be specified as a hash.
+ #
+ # The body is provided by the passed-in no-argument block
+ #
+ # textarea("name")
+ # # = textarea("NAME" => "name", "COLS" => 70, "ROWS" => 10)
+ #
+ # textarea("name", 40, 5)
+ # # = textarea("NAME" => "name", "COLS" => 40, "ROWS" => 5)
+ def textarea(name = "", cols = 70, rows = 10) # :yield:
+ attributes = if name.kind_of?(String)
+ { "NAME" => name, "COLS" => cols.to_s,
+ "ROWS" => rows.to_s }
+ else
+ name
+ end
+ if block_given?
+ super(attributes){ yield }
+ else
+ super(attributes)
+ end
+ end
+
+ end # HtmlExtension
+
+
+ # Mixin module for HTML version 3 generation methods.
+ module Html3 # :nodoc:
+
+ # The DOCTYPE declaration for this version of HTML
+ def doctype
+ %|<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">|
+ end
+
+ # Initialise the HTML generation methods for this version.
+ def element_init
+ extend TagMaker
+ methods = ""
+ # - -
+ for element in %w[ A TT I B U STRIKE BIG SMALL SUB SUP EM STRONG
+ DFN CODE SAMP KBD VAR CITE FONT ADDRESS DIV center MAP
+ APPLET PRE XMP LISTING DL OL UL DIR MENU SELECT table TITLE
+ STYLE SCRIPT H1 H2 H3 H4 H5 H6 TEXTAREA FORM BLOCKQUOTE
+ CAPTION ]
+ methods += <<-BEGIN + nn_element_def(element) + <<-END
+ def #{element.downcase}(attributes = {})
+ BEGIN
+ end
+ END
+ end
+
+ # - O EMPTY
+ for element in %w[ IMG BASE BASEFONT BR AREA LINK PARAM HR INPUT
+ ISINDEX META ]
+ methods += <<-BEGIN + nOE_element_def(element) + <<-END
+ def #{element.downcase}(attributes = {})
+ BEGIN
+ end
+ END
+ end
+
+ # O O or - O
+ for element in %w[ HTML HEAD BODY P PLAINTEXT DT DD LI OPTION tr
+ th td ]
+ methods += <<-BEGIN + nO_element_def(element) + <<-END
+ def #{element.downcase}(attributes = {})
+ BEGIN
+ end
+ END
+ end
+ eval(methods)
+ end
+
+ end # Html3
+
+
+ # Mixin module for HTML version 4 generation methods.
+ module Html4 # :nodoc:
+
+ # The DOCTYPE declaration for this version of HTML
+ def doctype
+ %|<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">|
+ end
+
+ # Initialise the HTML generation methods for this version.
+ def element_init
+ extend TagMaker
+ methods = ""
+ # - -
+ for element in %w[ TT I B BIG SMALL EM STRONG DFN CODE SAMP KBD
+ VAR CITE ABBR ACRONYM SUB SUP SPAN BDO ADDRESS DIV MAP OBJECT
+ H1 H2 H3 H4 H5 H6 PRE Q INS DEL DL OL UL LABEL SELECT OPTGROUP
+ FIELDSET LEGEND BUTTON TABLE TITLE STYLE SCRIPT NOSCRIPT
+ TEXTAREA FORM A BLOCKQUOTE CAPTION ]
+ methods += <<-BEGIN + nn_element_def(element) + <<-END
+ def #{element.downcase}(attributes = {})
+ BEGIN
+ end
+ END
+ end
+
+ # - O EMPTY
+ for element in %w[ IMG BASE BR AREA LINK PARAM HR INPUT COL META ]
+ methods += <<-BEGIN + nOE_element_def(element) + <<-END
+ def #{element.downcase}(attributes = {})
+ BEGIN
+ end
+ END
+ end
+
+ # O O or - O
+ for element in %w[ HTML BODY P DT DD LI OPTION THEAD TFOOT TBODY
+ COLGROUP TR TH TD HEAD]
+ methods += <<-BEGIN + nO_element_def(element) + <<-END
+ def #{element.downcase}(attributes = {})
+ BEGIN
+ end
+ END
+ end
+ eval(methods)
+ end
+
+ end # Html4
+
+
+ # Mixin module for HTML version 4 transitional generation methods.
+ module Html4Tr # :nodoc:
+
+ # The DOCTYPE declaration for this version of HTML
+ def doctype
+ %|<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">|
+ end
+
+ # Initialise the HTML generation methods for this version.
+ def element_init
+ extend TagMaker
+ methods = ""
+ # - -
+ for element in %w[ TT I B U S STRIKE BIG SMALL EM STRONG DFN
+ CODE SAMP KBD VAR CITE ABBR ACRONYM FONT SUB SUP SPAN BDO
+ ADDRESS DIV CENTER MAP OBJECT APPLET H1 H2 H3 H4 H5 H6 PRE Q
+ INS DEL DL OL UL DIR MENU LABEL SELECT OPTGROUP FIELDSET
+ LEGEND BUTTON TABLE IFRAME NOFRAMES TITLE STYLE SCRIPT
+ NOSCRIPT TEXTAREA FORM A BLOCKQUOTE CAPTION ]
+ methods += <<-BEGIN + nn_element_def(element) + <<-END
+ def #{element.downcase}(attributes = {})
+ BEGIN
+ end
+ END
+ end
+
+ # - O EMPTY
+ for element in %w[ IMG BASE BASEFONT BR AREA LINK PARAM HR INPUT
+ COL ISINDEX META ]
+ methods += <<-BEGIN + nOE_element_def(element) + <<-END
+ def #{element.downcase}(attributes = {})
+ BEGIN
+ end
+ END
+ end
+
+ # O O or - O
+ for element in %w[ HTML BODY P DT DD LI OPTION THEAD TFOOT TBODY
+ COLGROUP TR TH TD HEAD ]
+ methods += <<-BEGIN + nO_element_def(element) + <<-END
+ def #{element.downcase}(attributes = {})
+ BEGIN
+ end
+ END
+ end
+ eval(methods)
+ end
+
+ end # Html4Tr
+
+
+ # Mixin module for generating HTML version 4 with framesets.
+ module Html4Fr # :nodoc:
+
+ # The DOCTYPE declaration for this version of HTML
+ def doctype
+ %|<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">|
+ end
+
+ # Initialise the HTML generation methods for this version.
+ def element_init
+ methods = ""
+ # - -
+ for element in %w[ FRAMESET ]
+ methods += <<-BEGIN + nn_element_def(element) + <<-END
+ def #{element.downcase}(attributes = {})
+ BEGIN
+ end
+ END
+ end
+
+ # - O EMPTY
+ for element in %w[ FRAME ]
+ methods += <<-BEGIN + nOE_element_def(element) + <<-END
+ def #{element.downcase}(attributes = {})
+ BEGIN
+ end
+ END
+ end
+ eval(methods)
+ end
+
+ end # Html4Fr
+
+
+ # Creates a new CGI instance.
+ #
+ # +type+ specifies which version of HTML to load the HTML generation
+ # methods for. The following versions of HTML are supported:
+ #
+ # html3:: HTML 3.x
+ # html4:: HTML 4.0
+ # html4Tr:: HTML 4.0 Transitional
+ # html4Fr:: HTML 4.0 with Framesets
+ #
+ # If not specified, no HTML generation methods will be loaded.
+ #
+ # If the CGI object is not created in a standard CGI call environment
+ # (that is, it can't locate REQUEST_METHOD in its environment), then
+ # it will run in "offline" mode. In this mode, it reads its parameters
+ # from the command line or (failing that) from standard input. Otherwise,
+ # cookies and other parameters are parsed automatically from the standard
+ # CGI locations, which varies according to the REQUEST_METHOD.
+ def initialize(type = "query")
+ if defined?(MOD_RUBY) && !ENV.key?("GATEWAY_INTERFACE")
+ Apache.request.setup_cgi_env
+ end
+
+ extend QueryExtension
+ @multipart = false
+ if defined?(CGI_PARAMS)
+ warn "do not use CGI_PARAMS and CGI_COOKIES"
+ @params = CGI_PARAMS.dup
+ @cookies = CGI_COOKIES.dup
+ else
+ initialize_query() # set @params, @cookies
+ end
+ @output_cookies = nil
+ @output_hidden = nil
+
+ case type
+ when "html3"
+ extend Html3
+ element_init()
+ extend HtmlExtension
+ when "html4"
+ extend Html4
+ element_init()
+ extend HtmlExtension
+ when "html4Tr"
+ extend Html4Tr
+ element_init()
+ extend HtmlExtension
+ when "html4Fr"
+ extend Html4Tr
+ element_init()
+ extend Html4Fr
+ element_init()
+ extend HtmlExtension
+ end
+ end
+
+end # class CGI
diff --git a/lib/cgi/.document b/lib/cgi/.document
index 4153f97aa5..107f2f317c 100644
--- a/lib/cgi/.document
+++ b/lib/cgi/.document
@@ -1 +1,2 @@
-session.rb \ No newline at end of file
+session.rb
+
diff --git a/lib/cgi/cookie.rb b/lib/cgi/cookie.rb
deleted file mode 100644
index 5c2cd62a27..0000000000
--- a/lib/cgi/cookie.rb
+++ /dev/null
@@ -1,137 +0,0 @@
- # Class representing an HTTP cookie.
- #
- # In addition to its specific fields and methods, a Cookie instance
- # is a delegator to the array of its values.
- #
- # See RFC 2965.
- #
- # == 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
- # )
- #
- # cgi.out("cookie" => [cookie1, cookie2]) { "string" }
- #
- # 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
-class CGI
- class Cookie < Array
-
- # Create a new CGI::Cookie object.
- #
- # The contents of the cookie can be specified as a +name+ and one
- # or more +value+ arguments. Alternatively, the contents can
- # be specified as a single hash argument. The possible keywords of
- # this hash are as follows:
- #
- # 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 the
- # base directory of the CGI script.
- # 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.
- #
- # These keywords correspond to attributes of the cookie object.
- def initialize(name = "", *value)
- if name.kind_of?(String)
- @name = name
- @value = value
- %r|^(.*/)|.match(ENV["SCRIPT_NAME"])
- @path = ($1 or "")
- @secure = false
- return super(@value)
- end
-
- options = name
- unless options.has_key?("name")
- raise ArgumentError, "`name' required"
- end
-
- @name = options["name"]
- @value = Array(options["value"])
- # simple support for IE
- 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 ? true : false
-
- super(@value)
- end
-
- attr_accessor("name", "value", "path", "domain", "expires")
- attr_reader("secure")
-
- # Set whether the Cookie is a secure cookie or not.
- #
- # +val+ must be a boolean.
- def secure=(val)
- @secure = val if val == true or val == false
- @secure
- end
-
- # Convert the Cookie to its string representation.
- def to_s
- val = @value.kind_of?(String) ? CGI::escape(@value) : @value.collect{|v| CGI::escape(v) }.join("&")
- 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 == true
- buf
- end
-
- end # class Cookie
-
-
- # Parse a raw cookie string into a hash of cookie-name=>Cookie
- # pairs.
- #
- # cookies = CGI::Cookie::parse("raw_cookie_string")
- # # { "name1" => cookie1, "name2" => cookie2, ... }
- #
- def Cookie::parse(raw_cookie)
- cookies = Hash.new([])
- return cookies unless raw_cookie
-
- raw_cookie.split(/[;,]\s?/).each do |pairs|
- name, values = pairs.split('=',2)
- next unless name and values
- name = CGI::unescape(name)
- values ||= ""
- values = values.split('&').collect{|v| CGI::unescape(v) }
- if cookies.has_key?(name)
- values = cookies[name].value + values
- end
- cookies[name] = Cookie::new(name, *values)
- end
-
- cookies
- end
-end
-
-
diff --git a/lib/cgi/core.rb b/lib/cgi/core.rb
deleted file mode 100644
index 02daf14e50..0000000000
--- a/lib/cgi/core.rb
+++ /dev/null
@@ -1,792 +0,0 @@
-class CGI
-
- $CGI_ENV = ENV # for FCGI support
-
- # String for carriage return
- CR = "\015"
-
- # String for linefeed
- LF = "\012"
-
- # Standard internet newline sequence
- EOL = CR + LF
-
- REVISION = '$Id$' #:nodoc:
-
- NEEDS_BINMODE = true if /WIN/i.match(RUBY_PLATFORM)
-
- # Path separators in different environments.
- PATH_SEPARATOR = {'UNIX'=>'/', 'WINDOWS'=>'\\', 'MACINTOSH'=>':'}
-
- # HTTP status codes.
- HTTP_STATUS = {
- "OK" => "200 OK",
- "PARTIAL_CONTENT" => "206 Partial Content",
- "MULTIPLE_CHOICES" => "300 Multiple Choices",
- "MOVED" => "301 Moved Permanently",
- "REDIRECT" => "302 Found",
- "NOT_MODIFIED" => "304 Not Modified",
- "BAD_REQUEST" => "400 Bad Request",
- "AUTH_REQUIRED" => "401 Authorization Required",
- "FORBIDDEN" => "403 Forbidden",
- "NOT_FOUND" => "404 Not Found",
- "METHOD_NOT_ALLOWED" => "405 Method Not Allowed",
- "NOT_ACCEPTABLE" => "406 Not Acceptable",
- "LENGTH_REQUIRED" => "411 Length Required",
- "PRECONDITION_FAILED" => "412 Precondition Failed",
- "SERVER_ERROR" => "500 Internal Server Error",
- "NOT_IMPLEMENTED" => "501 Method Not Implemented",
- "BAD_GATEWAY" => "502 Bad Gateway",
- "VARIANT_ALSO_VARIES" => "506 Variant Also Negotiates"
- }
-
- # Abbreviated day-of-week names specified by RFC 822
- RFC822_DAYS = %w[ Sun Mon Tue Wed Thu Fri Sat ]
-
- # Abbreviated month names specified by RFC 822
- RFC822_MONTHS = %w[ Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec ]
-
- # :startdoc:
-
- def env_table
- ENV
- end
-
- def stdinput
- $stdin
- end
-
- def stdoutput
- $stdout
- end
-
- private :env_table, :stdinput, :stdoutput
-
-
- # Create an HTTP header block as a string.
- #
- # Includes the empty line that ends the header block.
- #
- # +options+ can be a string specifying the Content-Type (defaults
- # to text/html), or a hash of header key/value pairs. The following
- # header keys are recognized:
- #
- # type:: the Content-Type header. Defaults to "text/html"
- # charset:: the charset of the body, appended to the Content-Type header.
- # nph:: a boolean value. If true, prepend protocol string and status code, and
- # date; and sets default values for "server" and "connection" if not
- # explicitly set.
- # status:: the HTTP status code, returned as the Status header. See the
- # list of available status codes below.
- # server:: the server software, returned as the Server header.
- # connection:: the connection type, returned as the Connection header (for
- # instance, "close".
- # length:: the length of the content that will be sent, returned as the
- # Content-Length header.
- # language:: the language of the content, returned as the Content-Language
- # header.
- # expires:: the time on which the current content expires, as a +Time+
- # object, returned as the Expires header.
- # cookie:: a cookie or cookies, returned as one or more Set-Cookie headers.
- # The value can be the literal string of the cookie; a CGI::Cookie
- # object; an Array of literal cookie strings or Cookie objects; or a
- # hash all of whose values are literal cookie strings or Cookie objects.
- # These cookies are in addition to the cookies held in the
- # @output_cookies field.
- #
- # Other header lines can also be set; they are appended as key: value.
- #
- # header
- # # Content-Type: text/html
- #
- # header("text/plain")
- # # Content-Type: text/plain
- #
- # header("nph" => true,
- # "status" => "OK", # == "200 OK"
- # # "status" => "200 GOOD",
- # "server" => ENV['SERVER_SOFTWARE'],
- # "connection" => "close",
- # "type" => "text/html",
- # "charset" => "iso-2022-jp",
- # # Content-Type: text/html; charset=iso-2022-jp
- # "length" => 103,
- # "language" => "ja",
- # "expires" => Time.now + 30,
- # "cookie" => [cookie1, cookie2],
- # "my_header1" => "my_value"
- # "my_header2" => "my_value")
- #
- # The status codes are:
- #
- # "OK" --> "200 OK"
- # "PARTIAL_CONTENT" --> "206 Partial Content"
- # "MULTIPLE_CHOICES" --> "300 Multiple Choices"
- # "MOVED" --> "301 Moved Permanently"
- # "REDIRECT" --> "302 Found"
- # "NOT_MODIFIED" --> "304 Not Modified"
- # "BAD_REQUEST" --> "400 Bad Request"
- # "AUTH_REQUIRED" --> "401 Authorization Required"
- # "FORBIDDEN" --> "403 Forbidden"
- # "NOT_FOUND" --> "404 Not Found"
- # "METHOD_NOT_ALLOWED" --> "405 Method Not Allowed"
- # "NOT_ACCEPTABLE" --> "406 Not Acceptable"
- # "LENGTH_REQUIRED" --> "411 Length Required"
- # "PRECONDITION_FAILED" --> "412 Precondition Failed"
- # "SERVER_ERROR" --> "500 Internal Server Error"
- # "NOT_IMPLEMENTED" --> "501 Method Not Implemented"
- # "BAD_GATEWAY" --> "502 Bad Gateway"
- # "VARIANT_ALSO_VARIES" --> "506 Variant Also Negotiates"
- #
- # This method does not perform charset conversion.
- def header(options='text/html')
- if options.is_a?(String)
- content_type = options
- buf = _header_for_string(content_type)
- elsif options.is_a?(Hash)
- if options.size == 1 && options.has_key?('type')
- content_type = options['type']
- buf = _header_for_string(content_type)
- else
- buf = _header_for_hash(options.dup)
- end
- else
- raise ArgumentError.new("expected String or Hash but got #{options.class}")
- end
- if defined?(MOD_RUBY)
- _header_for_modruby(buf)
- return ''
- else
- buf << EOL # empty line of separator
- return buf
- end
- end # header()
-
- def _header_for_string(content_type) #:nodoc:
- buf = ''
- if nph?()
- buf << "#{$CGI_ENV['SERVER_PROTOCOL'] || 'HTTP/1.0'} 200 OK#{EOL}"
- buf << "Date: #{CGI.rfc1123_date(Time.now)}#{EOL}"
- buf << "Server: #{$CGI_ENV['SERVER_SOFTWARE']}#{EOL}"
- buf << "Connection: close#{EOL}"
- end
- buf << "Content-Type: #{content_type}#{EOL}"
- if @output_cookies
- @output_cookies.each {|cookie| buf << "Set-Cookie: #{cookie}#{EOL}" }
- end
- return buf
- end # _header_for_string
- private :_header_for_string
-
- def _header_for_hash(options) #:nodoc:
- buf = ''
- ## add charset to option['type']
- options['type'] ||= 'text/html'
- charset = options.delete('charset')
- options['type'] += "; charset=#{charset}" if charset
- ## NPH
- options.delete('nph') if defined?(MOD_RUBY)
- if options.delete('nph') || nph?()
- protocol = $CGI_ENV['SERVER_PROTOCOL'] || 'HTTP/1.0'
- status = options.delete('status')
- status = HTTP_STATUS[status] || status || '200 OK'
- buf << "#{protocol} #{status}#{EOL}"
- buf << "Date: #{CGI.rfc1123_date(Time.now)}#{EOL}"
- options['server'] ||= $CGI_ENV['SERVER_SOFTWARE'] || ''
- options['connection'] ||= 'close'
- end
- ## common headers
- status = options.delete('status')
- buf << "Status: #{HTTP_STATUS[status] || status}#{EOL}" if status
- server = options.delete('server')
- buf << "Server: #{server}#{EOL}" if server
- connection = options.delete('connection')
- buf << "Connection: #{connection}#{EOL}" if connection
- type = options.delete('type')
- buf << "Content-Type: #{type}#{EOL}" #if type
- length = options.delete('length')
- buf << "Content-Length: #{length}#{EOL}" if length
- language = options.delete('language')
- buf << "Content-Language: #{language}#{EOL}" if language
- expires = options.delete('expires')
- buf << "Expires: #{CGI.rfc1123_date(expires)}#{EOL}" if expires
- ## cookie
- if cookie = options.delete('cookie')
- case cookie
- when String, Cookie
- buf << "Set-Cookie: #{cookie}#{EOL}"
- when Array
- arr = cookie
- arr.each {|c| buf << "Set-Cookie: #{c}#{EOL}" }
- when Hash
- hash = cookie
- hash.each {|name, c| buf << "Set-Cookie: #{c}#{EOL}" }
- end
- end
- if @output_cookies
- @output_cookies.each {|c| buf << "Set-Cookie: #{c}#{EOL}" }
- end
- ## other headers
- options.each do |key, value|
- buf << "#{key}: #{value}#{EOL}"
- end
- return buf
- end # _header_for_hash
- private :_header_for_hash
-
- def nph? #:nodoc:
- 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|
- warn sprintf("name:%s value:%s\n", name, value) if $DEBUG
- case name
- when 'Set-Cookie'
- request.headers_out.add(name, value)
- when /^status$/i
- request.status_line = value
- request.status = value.to_i
- when /^content-type$/i
- request.content_type = value
- when /^content-encoding$/i
- request.content_encoding = value
- when /^location$/i
- request.status = 302 if request.status == 200
- request.headers_out[name] = value
- else
- request.headers_out[name] = value
- end
- end
- request.send_http_header
- return ''
- end
- private :_header_for_modruby
- #
-
- # Print an HTTP header and body to $DEFAULT_OUTPUT ($>)
- #
- # The header is provided by +options+, as for #header().
- # The body of the document is that returned by the passed-
- # in block. This block takes no arguments. It is required.
- #
- # cgi = CGI.new
- # cgi.out{ "string" }
- # # Content-Type: text/html
- # # Content-Length: 6
- # #
- # # string
- #
- # cgi.out("text/plain") { "string" }
- # # Content-Type: text/plain
- # # Content-Length: 6
- # #
- # # string
- #
- # cgi.out("nph" => true,
- # "status" => "OK", # == "200 OK"
- # "server" => ENV['SERVER_SOFTWARE'],
- # "connection" => "close",
- # "type" => "text/html",
- # "charset" => "iso-2022-jp",
- # # Content-Type: text/html; charset=iso-2022-jp
- # "language" => "ja",
- # "expires" => Time.now + (3600 * 24 * 30),
- # "cookie" => [cookie1, cookie2],
- # "my_header1" => "my_value",
- # "my_header2" => "my_value") { "string" }
- #
- # Content-Length is automatically calculated from the size of
- # the String returned by the content block.
- #
- # If ENV['REQUEST_METHOD'] == "HEAD", then only the header
- # is outputted (the content block is still required, but it
- # is ignored).
- #
- # If the charset is "iso-2022-jp" or "euc-jp" or "shift_jis" then
- # the content is converted to this charset, and the language is set
- # to "ja".
- def out(options = "text/html") # :yield:
-
- options = { "type" => options } if options.kind_of?(String)
- content = yield
- options["length"] = content.bytesize.to_s
- output = stdoutput
- output.binmode if defined? output.binmode
- output.print header(options)
- output.print content unless "HEAD" == env_table['REQUEST_METHOD']
- end
-
-
- # Print an argument or list of arguments to the default output stream
- #
- # cgi = CGI.new
- # cgi.print # default: cgi.print == $DEFAULT_OUTPUT.print
- def print(*options)
- stdoutput.print(*options)
- end
-
- # Parse an HTTP query string into a hash of key=>value pairs.
- #
- # params = CGI::parse("query_string")
- # # {"name1" => ["value1", "value2", ...],
- # # "name2" => ["value1", "value2", ...], ... }
- #
- def CGI::parse(query)
- params = {}
- query.split(/[&;]/).each do |pairs|
- key, value = pairs.split('=',2).collect{|v| CGI::unescape(v) }
- if key && value
- params.has_key?(key) ? params[key].push(value) : params[key] = [value]
- elsif key
- params[key]=[]
- end
- end
- params.default=[].freeze
- params
- end
-
- # Maximum content length of post data
- ##MAX_CONTENT_LENGTH = 2 * 1024 * 1024
-
- # Maximum content length of multipart data
- MAX_MULTIPART_LENGTH = 128 * 1024 * 1024
-
- # Maximum number of request parameters when multipart
- MAX_MULTIPART_COUNT = 128
-
- # Mixin module. It provides the follow functionality groups:
- #
- # 1. Access to CGI environment variables as methods. See
- # documentation to the CGI class for a list of these variables.
- #
- # 2. Access to cookies, including the cookies attribute.
- #
- # 3. Access to parameters, including the params attribute, and overloading
- # [] to perform parameter value lookup by key.
- #
- # 4. The initialize_query method, for initialising the above
- # mechanisms, handling multipart forms, and allowing the
- # class to be used in "offline" mode.
- #
- module QueryExtension
-
- %w[ CONTENT_LENGTH SERVER_PORT ].each do |env|
- define_method(env.sub(/^HTTP_/, '').downcase) do
- (val = env_table[env]) && Integer(val)
- end
- end
-
- %w[ AUTH_TYPE CONTENT_TYPE GATEWAY_INTERFACE PATH_INFO
- PATH_TRANSLATED QUERY_STRING REMOTE_ADDR REMOTE_HOST
- REMOTE_IDENT REMOTE_USER REQUEST_METHOD SCRIPT_NAME
- SERVER_NAME SERVER_PROTOCOL SERVER_SOFTWARE
-
- 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.sub(/^HTTP_/, '').downcase) do
- env_table[env]
- end
- end
-
- # Get the raw cookies as a string.
- def raw_cookie
- env_table["HTTP_COOKIE"]
- end
-
- # Get the raw RFC2965 cookies as a string.
- def raw_cookie2
- env_table["HTTP_COOKIE2"]
- end
-
- # Get the cookies as a hash of cookie-name=>Cookie pairs.
- attr_accessor :cookies
-
- # Get the parameters as a hash of name=>values pairs, where
- # values is an Array.
- attr_reader :params
-
- # Get the uploaed files as a hash of name=>values pairs
- attr_reader :files
-
- # Set all the parameters.
- def params=(hash)
- @params.clear
- @params.update(hash)
- end
-
- def read_multipart(boundary, content_length)
- ## read first boundary
- stdin = $stdin
- first_line = "--#{boundary}#{EOL}"
- content_length -= first_line.bytesize
- status = stdin.read(first_line.bytesize)
- raise EOFError.new("no content body") unless status
- raise EOFError.new("bad content body") unless first_line == status
- ## parse and set params
- params = {}
- @files = {}
- boundary_rexp = /--#{Regexp.quote(boundary)}(#{EOL}|--)/
- boundary_size = "#{EOL}--#{boundary}#{EOL}".bytesize
- boundary_end = nil
- buf = ''
- bufsize = 10 * 1024
- max_count = MAX_MULTIPART_COUNT
- n = 0
- while true
- (n += 1) < max_count or raise StandardError.new("too many parameters.")
- ## create body (StringIO or Tempfile)
- body = create_body(bufsize < content_length)
- class << body
- if method_defined?(:path)
- alias local_path path
- else
- def local_path
- nil
- end
- end
- attr_reader :original_filename, :content_type
- end
- ## find head and boundary
- head = nil
- separator = EOL * 2
- until head && matched = boundary_rexp.match(buf)
- if !head && pos = buf.index(separator)
- len = pos + EOL.bytesize
- head = buf[0, len]
- buf = buf[(pos+separator.bytesize)..-1]
- else
- if head && buf.size > boundary_size
- len = buf.size - boundary_size
- body.print(buf[0, len])
- buf[0, len] = ''
- end
- c = stdin.read(bufsize < content_length ? bufsize : content_length)
- raise EOFError.new("bad content body") if c.nil? || c.empty?
- buf << c
- content_length -= c.bytesize
- end
- end
- ## read to end of boundary
- m = matched
- len = m.begin(0)
- s = buf[0, len]
- if s =~ /(\r?\n)\z/
- s = buf[0, len - $1.bytesize]
- end
- body.print(s)
- buf = buf[m.end(0)..-1]
- boundary_end = m[1]
- content_length = -1 if boundary_end == '--'
- ## reset file cursor position
- body.rewind
- ## original filename
- /Content-Disposition:.* filename=(?:"(.*?)"|([^;\r\n]*))/i.match(head)
- filename = $1 || $2 || ''
- filename = CGI.unescape(filename) if unescape_filename?()
- body.instance_variable_set('@original_filename', filename.taint)
- ## content type
- /Content-Type: (.*)/i.match(head)
- (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 || ''
- if body.original_filename.empty?
- value=body.read.dup.force_encoding(@accept_charset)
- (params[name] ||= []) << value
- unless value.valid_encoding?
- if @accept_charset_error_block
- @accept_charset_error_block.call(name,value)
- else
- raise InvalidEncoding,"Accept-Charset encoding error"
- end
- end
- class << params[name].last;self;end.class_eval do
- define_method(:read){self}
- define_method(:original_filename){""}
- define_method(:content_type){""}
- end
- else
- (params[name] ||= []) << body
- @files[name]=body
- end
- ## break loop
- break if buf.size == 0
- break if content_length == -1
- end
- raise EOFError, "bad boundary end of body part" unless boundary_end =~ /--/
- params.default = []
- params
- end # read_multipart
- private :read_multipart
- def create_body(is_large) #:nodoc:
- if is_large
- require 'tempfile'
- body = Tempfile.new('CGI', encoding: "ascii-8bit")
- else
- begin
- require 'stringio'
- body = StringIO.new("".force_encoding("ascii-8bit"))
- rescue LoadError
- require 'tempfile'
- body = Tempfile.new('CGI', encoding: "ascii-8bit")
- end
- end
- body.binmode if defined? body.binmode
- return body
- end
- def unescape_filename? #:nodoc:
- user_agent = $CGI_ENV['HTTP_USER_AGENT']
- return /Mac/i.match(user_agent) && /Mozilla/i.match(user_agent) && !/MSIE/i.match(user_agent)
- end
-
- # offline mode. read name=value pairs on standard input.
- def read_from_cmdline
- require "shellwords"
-
- string = unless ARGV.empty?
- ARGV.join(' ')
- else
- if STDIN.tty?
- STDERR.print(
- %|(offline mode: enter name=value pairs on standard input)\n|
- )
- end
- readlines.join(' ').gsub(/\n/, '')
- end.gsub(/\\=/, '%3D').gsub(/\\&/, '%26')
-
- words = Shellwords.shellwords(string)
-
- if words.find{|x| /=/.match(x) }
- words.join('&')
- else
- words.join('+')
- end
- end
- private :read_from_cmdline
-
- # A wrapper class to use a StringIO object as the body and switch
- # to a TempFile when the passed threshold is passed.
- # Initialize the data from the query.
- #
- # Handles multipart forms (in particular, forms that involve file uploads).
- # Reads query parameters in the @params field, and cookies into @cookies.
- def initialize_query()
- if ("POST" == env_table['REQUEST_METHOD']) and
- %r|\Amultipart/form-data.*boundary=\"?([^\";,]+)\"?|.match(env_table['CONTENT_TYPE'])
- raise StandardError.new("too large multipart data.") if env_table['CONTENT_LENGTH'].to_i > MAX_MULTIPART_LENGTH
- boundary = $1.dup
- @multipart = true
- @params = read_multipart(boundary, Integer(env_table['CONTENT_LENGTH']))
- else
- @multipart = false
- @params = CGI::parse(
- case env_table['REQUEST_METHOD']
- when "GET", "HEAD"
- if defined?(MOD_RUBY)
- Apache::request.args or ""
- else
- env_table['QUERY_STRING'] or ""
- end
- when "POST"
- stdinput.binmode if defined? stdinput.binmode
- stdinput.read(Integer(env_table['CONTENT_LENGTH'])) or ''
- else
- read_from_cmdline
- end.dup.force_encoding(@accept_charset)
- )
- unless Encoding.find(@accept_charset) == Encoding::ASCII_8BIT
- @params.each do |key,values|
- values.each do |value|
- unless value.valid_encoding?
- if @accept_charset_error_block
- @accept_charset_error_block.call(key,value)
- else
- raise InvalidEncoding,"Accept-Charset encoding error"
- end
- end
- end
- end
- end
- end
-
- @cookies = CGI::Cookie::parse((env_table['HTTP_COOKIE'] or env_table['COOKIE']))
- end
- private :initialize_query
-
- def multipart?
- @multipart
- end
-
- # Get the value for the parameter with a given key.
- #
- # If the parameter has multiple values, only the first will be
- # retrieved; use #params() to get the array of values.
- def [](key)
- params = @params[key]
- return '' unless params
- value = params[0]
- if @multipart
- if value
- return value
- elsif defined? StringIO
- StringIO.new("".force_encoding("ascii-8bit"))
- else
- Tempfile.new("CGI",encoding:"ascii-8bit")
- end
- else
- str = if value then value.dup else "" end
- str
- end
- end
-
- # Return all parameter keys as an array.
- def keys(*args)
- @params.keys(*args)
- end
-
- # Returns true if a given parameter key exists in the query.
- def has_key?(*args)
- @params.has_key?(*args)
- end
- alias key? has_key?
- alias include? has_key?
-
- end # QueryExtension
-
- # InvalidEncoding Exception class
- class InvalidEncoding < Exception; end
-
- # @@accept_charset is default accept character set.
- # This default value default is "UTF-8"
- # If you want to change the default accept character set
- # when create a new CGI instance, set this:
- #
- # CGI.accept_charset = "EUC-JP"
- #
-
- @@accept_charset="UTF-8"
-
- def self.accept_charset
- @@accept_charset
- end
-
- def self.accept_charset=(accept_charset)
- @@accept_charset=accept_charset
- end
-
- # Create a new CGI instance.
- #
- # CGI accept constructor parameters either in a hash, string as a block.
- # But string is as same as using :tag_maker of hash.
- #
- # CGI.new("html3") #=> CGI.new(:tag_maker=>"html3")
- #
- # And, if you specify string, @accept_charset cannot be changed.
- # Instead, please use hash parameter.
- #
- # == accept_charset
- #
- # :accept_charset specifies encoding of received query string.
- # ( Default value is @@accept_charset. )
- # If not valid, raise CGI::InvalidEncoding
- #
- # Example. Suppose @@accept_charset # => "UTF-8"
- #
- # when not specified:
- #
- # cgi=CGI.new # @accept_charset # => "UTF-8"
- #
- # when specified "EUC-JP":
- #
- # cgi=CGI.new(:accept_charset => "EUC-JP") # => "EUC-JP"
- #
- # == block
- #
- # When you use a block, you can write a process
- # that query encoding is invalid. Example:
- #
- # encoding_error={}
- # cgi=CGI.new(:accept_charset=>"EUC-JP") do |name,value|
- # encoding_error[key] = value
- # end
- #
- # == tag_maker
- #
- # :tag_maker specifies which version of HTML to load the HTML generation
- # methods for. The following versions of HTML are supported:
- #
- # html3:: HTML 3.x
- # html4:: HTML 4.0
- # html4Tr:: HTML 4.0 Transitional
- # html4Fr:: HTML 4.0 with Framesets
- #
- # If not specified, no HTML generation methods will be loaded.
- #
- # If the CGI object is not created in a standard CGI call environment
- # (that is, it can't locate REQUEST_METHOD in its environment), then
- # it will run in "offline" mode. In this mode, it reads its parameters
- # from the command line or (failing that) from standard input. Otherwise,
- # cookies and other parameters are parsed automatically from the standard
- # CGI locations, which varies according to the REQUEST_METHOD. It works this:
- #
- # CGI.new(:tag_maker=>"html3")
- #
- # This will be obsolete:
- #
- # CGI.new("html3")
- #
- attr_reader :accept_charset
- def initialize(options = {},&block)
- @accept_charset_error_block=block if block_given?
- @options={:accept_charset=>@@accept_charset}
- case options
- when Hash
- @options.merge!(options)
- when String
- @options[:tag_maker]=options
- end
- @accept_charset=@options[:accept_charset]
- if defined?(MOD_RUBY) && !ENV.key?("GATEWAY_INTERFACE")
- Apache.request.setup_cgi_env
- end
-
- extend QueryExtension
- @multipart = false
-
- initialize_query() # set @params, @cookies
- @output_cookies = nil
- @output_hidden = nil
-
- case @options[:tag_maker]
- when "html3"
- require 'cgi/html'
- extend Html3
- element_init()
- extend HtmlExtension
- when "html4"
- require 'cgi/html'
- extend Html4
- element_init()
- extend HtmlExtension
- when "html4Tr"
- require 'cgi/html'
- extend Html4Tr
- element_init()
- extend HtmlExtension
- when "html4Fr"
- require 'cgi/html'
- extend Html4Tr
- element_init()
- extend Html4Fr
- element_init()
- extend HtmlExtension
- end
- end
-
-end # class CGI
-
-
diff --git a/lib/cgi/html.rb b/lib/cgi/html.rb
deleted file mode 100644
index 8ee38000c5..0000000000
--- a/lib/cgi/html.rb
+++ /dev/null
@@ -1,1021 +0,0 @@
- # Base module for HTML-generation mixins.
- #
- # Provides methods for code generation for tags following
- # the various DTD element types.
-class CGI
- module TagMaker # :nodoc:
-
- # Generate code for an element with required start and end tags.
- #
- # - -
- def nn_element_def(element)
- nOE_element_def(element, <<-END)
- if block_given?
- yield.to_s
- else
- ""
- end +
- "</#{element.upcase}>"
- END
- end
-
- # Generate code for an empty element.
- #
- # - O EMPTY
- def nOE_element_def(element, append = nil)
- s = <<-END
- attributes={attributes=>nil} if attributes.kind_of?(String)
- "<#{element.upcase}" + attributes.collect{|name, value|
- next unless value
- " " + CGI::escapeHTML(name.to_s) +
- if true == value
- ""
- else
- '="' + CGI::escapeHTML(value.to_s) + '"'
- end
- }.join + ">"
- END
- s.sub!(/\Z/, " +") << append if append
- s
- end
-
- # Generate code for an element for which the end (and possibly the
- # start) tag is optional.
- #
- # O O or - O
- def nO_element_def(element)
- nOE_element_def(element, <<-END)
- if block_given?
- yield.to_s + "</#{element.upcase}>"
- else
- ""
- end
- END
- end
-
- end # TagMaker
-
-
- #
- # Mixin module providing HTML generation methods.
- #
- # For example,
- # cgi.a("http://www.example.com") { "Example" }
- # # => "<A HREF=\"http://www.example.com\">Example</A>"
- #
- # Modules Http3, Http4, etc., contain more basic HTML-generation methods
- # (:title, :center, etc.).
- #
- # See class CGI for a detailed example.
- #
- module HtmlExtension
-
-
- # Generate an Anchor element as a string.
- #
- # +href+ can either be a string, giving the URL
- # for the HREF attribute, or it can be a hash of
- # the element's attributes.
- #
- # The body of the element is the string returned by the no-argument
- # block passed in.
- #
- # a("http://www.example.com") { "Example" }
- # # => "<A HREF=\"http://www.example.com\">Example</A>"
- #
- # a("HREF" => "http://www.example.com", "TARGET" => "_top") { "Example" }
- # # => "<A HREF=\"http://www.example.com\" TARGET=\"_top\">Example</A>"
- #
- def a(href = "") # :yield:
- attributes = if href.kind_of?(String)
- { "HREF" => href }
- else
- href
- end
- if block_given?
- super(attributes){ yield }
- else
- super(attributes)
- end
- end
-
- # Generate a Document Base URI element as a String.
- #
- # +href+ can either by a string, giving the base URL for the HREF
- # attribute, or it can be a has of the element's attributes.
- #
- # The passed-in no-argument block is ignored.
- #
- # base("http://www.example.com/cgi")
- # # => "<BASE HREF=\"http://www.example.com/cgi\">"
- def base(href = "") # :yield:
- attributes = if href.kind_of?(String)
- { "HREF" => href }
- else
- href
- end
- if block_given?
- super(attributes){ yield }
- else
- super(attributes)
- end
- end
-
- # Generate a BlockQuote element as a string.
- #
- # +cite+ can either be a string, give the URI for the source of
- # the quoted text, or a hash, giving all attributes of the element,
- # or it can be omitted, in which case the element has no attributes.
- #
- # The body is provided by the passed-in no-argument block
- #
- # blockquote("http://www.example.com/quotes/foo.html") { "Foo!" }
- # #=> "<BLOCKQUOTE CITE=\"http://www.example.com/quotes/foo.html\">Foo!</BLOCKQUOTE>
- def blockquote(cite = {}) # :yield:
- attributes = if cite.kind_of?(String)
- { "CITE" => cite }
- else
- cite
- end
- if block_given?
- super(attributes){ yield }
- else
- super(attributes)
- end
- end
-
-
- # Generate a Table Caption element as a string.
- #
- # +align+ can be a string, giving the alignment of the caption
- # (one of top, bottom, left, or right). It can be a hash of
- # all the attributes of the element. Or it can be omitted.
- #
- # The body of the element is provided by the passed-in no-argument block.
- #
- # caption("left") { "Capital Cities" }
- # # => <CAPTION ALIGN=\"left\">Capital Cities</CAPTION>
- def caption(align = {}) # :yield:
- attributes = if align.kind_of?(String)
- { "ALIGN" => align }
- else
- align
- end
- if block_given?
- super(attributes){ yield }
- else
- super(attributes)
- end
- end
-
-
- # Generate a Checkbox Input element as a string.
- #
- # The attributes of the element can be specified as three arguments,
- # +name+, +value+, and +checked+. +checked+ is a boolean value;
- # if true, the CHECKED attribute will be included in the element.
- #
- # Alternatively, the attributes can be specified as a hash.
- #
- # checkbox("name")
- # # = checkbox("NAME" => "name")
- #
- # checkbox("name", "value")
- # # = checkbox("NAME" => "name", "VALUE" => "value")
- #
- # checkbox("name", "value", true)
- # # = checkbox("NAME" => "name", "VALUE" => "value", "CHECKED" => true)
- def checkbox(name = "", value = nil, checked = nil)
- attributes = if name.kind_of?(String)
- { "TYPE" => "checkbox", "NAME" => name,
- "VALUE" => value, "CHECKED" => checked }
- else
- name["TYPE"] = "checkbox"
- name
- end
- input(attributes)
- end
-
- # Generate a sequence of checkbox elements, as a String.
- #
- # The checkboxes will all have the same +name+ attribute.
- # Each checkbox is followed by a label.
- # There will be one checkbox for each value. Each value
- # can be specified as a String, which will be used both
- # as the value of the VALUE attribute and as the label
- # for that checkbox. A single-element array has the
- # same effect.
- #
- # Each value can also be specified as a three-element array.
- # The first element is the VALUE attribute; the second is the
- # label; and the third is a boolean specifying whether this
- # checkbox is CHECKED.
- #
- # Each value can also be specified as a two-element
- # array, by omitting either the value element (defaults
- # to the same as the label), or the boolean checked element
- # (defaults to false).
- #
- # checkbox_group("name", "foo", "bar", "baz")
- # # <INPUT TYPE="checkbox" NAME="name" VALUE="foo">foo
- # # <INPUT TYPE="checkbox" NAME="name" VALUE="bar">bar
- # # <INPUT TYPE="checkbox" NAME="name" VALUE="baz">baz
- #
- # checkbox_group("name", ["foo"], ["bar", true], "baz")
- # # <INPUT TYPE="checkbox" NAME="name" VALUE="foo">foo
- # # <INPUT TYPE="checkbox" CHECKED NAME="name" VALUE="bar">bar
- # # <INPUT TYPE="checkbox" NAME="name" VALUE="baz">baz
- #
- # checkbox_group("name", ["1", "Foo"], ["2", "Bar", true], "Baz")
- # # <INPUT TYPE="checkbox" NAME="name" VALUE="1">Foo
- # # <INPUT TYPE="checkbox" CHECKED NAME="name" VALUE="2">Bar
- # # <INPUT TYPE="checkbox" NAME="name" VALUE="Baz">Baz
- #
- # checkbox_group("NAME" => "name",
- # "VALUES" => ["foo", "bar", "baz"])
- #
- # checkbox_group("NAME" => "name",
- # "VALUES" => [["foo"], ["bar", true], "baz"])
- #
- # checkbox_group("NAME" => "name",
- # "VALUES" => [["1", "Foo"], ["2", "Bar", true], "Baz"])
- def checkbox_group(name = "", *values)
- if name.kind_of?(Hash)
- values = name["VALUES"]
- name = name["NAME"]
- end
- values.collect{|value|
- if value.kind_of?(String)
- checkbox(name, value) + value
- else
- if value[-1] == true || value[-1] == false
- checkbox(name, value[0], value[-1]) +
- value[-2]
- else
- checkbox(name, value[0]) +
- value[-1]
- end
- end
- }.join
- end
-
-
- # Generate an File Upload Input element as a string.
- #
- # The attributes of the element can be specified as three arguments,
- # +name+, +size+, and +maxlength+. +maxlength+ is the maximum length
- # of the file's _name_, not of the file's _contents_.
- #
- # Alternatively, the attributes can be specified as a hash.
- #
- # See #multipart_form() for forms that include file uploads.
- #
- # file_field("name")
- # # <INPUT TYPE="file" NAME="name" SIZE="20">
- #
- # file_field("name", 40)
- # # <INPUT TYPE="file" NAME="name" SIZE="40">
- #
- # file_field("name", 40, 100)
- # # <INPUT TYPE="file" NAME="name" SIZE="40" MAXLENGTH="100">
- #
- # file_field("NAME" => "name", "SIZE" => 40)
- # # <INPUT TYPE="file" NAME="name" SIZE="40">
- def file_field(name = "", size = 20, maxlength = nil)
- attributes = if name.kind_of?(String)
- { "TYPE" => "file", "NAME" => name,
- "SIZE" => size.to_s }
- else
- name["TYPE"] = "file"
- name
- end
- attributes["MAXLENGTH"] = maxlength.to_s if maxlength
- input(attributes)
- end
-
-
- # Generate a Form element as a string.
- #
- # +method+ should be either "get" or "post", and defaults to the latter.
- # +action+ defaults to the current CGI script name. +enctype+
- # defaults to "application/x-www-form-urlencoded".
- #
- # Alternatively, the attributes can be specified as a hash.
- #
- # See also #multipart_form() for forms that include file uploads.
- #
- # form{ "string" }
- # # <FORM METHOD="post" ENCTYPE="application/x-www-form-urlencoded">string</FORM>
- #
- # form("get") { "string" }
- # # <FORM METHOD="get" ENCTYPE="application/x-www-form-urlencoded">string</FORM>
- #
- # form("get", "url") { "string" }
- # # <FORM METHOD="get" ACTION="url" ENCTYPE="application/x-www-form-urlencoded">string</FORM>
- #
- # form("METHOD" => "post", "ENCTYPE" => "enctype") { "string" }
- # # <FORM METHOD="post" ENCTYPE="enctype">string</FORM>
- def form(method = "post", action = script_name, enctype = "application/x-www-form-urlencoded")
- attributes = if method.kind_of?(String)
- { "METHOD" => method, "ACTION" => action,
- "ENCTYPE" => enctype }
- else
- unless method.has_key?("METHOD")
- method["METHOD"] = "post"
- end
- unless method.has_key?("ENCTYPE")
- method["ENCTYPE"] = enctype
- end
- method
- end
- if block_given?
- body = yield
- else
- body = ""
- end
- if @output_hidden
- body += @output_hidden.collect{|k,v|
- "<INPUT TYPE=\"HIDDEN\" NAME=\"#{k}\" VALUE=\"#{v}\">"
- }.join
- end
- super(attributes){body}
- end
-
- # Generate a Hidden Input element as a string.
- #
- # The attributes of the element can be specified as two arguments,
- # +name+ and +value+.
- #
- # Alternatively, the attributes can be specified as a hash.
- #
- # hidden("name")
- # # <INPUT TYPE="hidden" NAME="name">
- #
- # hidden("name", "value")
- # # <INPUT TYPE="hidden" NAME="name" VALUE="value">
- #
- # hidden("NAME" => "name", "VALUE" => "reset", "ID" => "foo")
- # # <INPUT TYPE="hidden" NAME="name" VALUE="value" ID="foo">
- def hidden(name = "", value = nil)
- attributes = if name.kind_of?(String)
- { "TYPE" => "hidden", "NAME" => name, "VALUE" => value }
- else
- name["TYPE"] = "hidden"
- name
- end
- input(attributes)
- end
-
- # Generate a top-level HTML element as a string.
- #
- # The attributes of the element are specified as a hash. The
- # pseudo-attribute "PRETTY" can be used to specify that the generated
- # HTML string should be indented. "PRETTY" can also be specified as
- # a string as the sole argument to this method. The pseudo-attribute
- # "DOCTYPE", if given, is used as the leading DOCTYPE SGML tag; it
- # should include the entire text of this tag, including angle brackets.
- #
- # The body of the html element is supplied as a block.
- #
- # html{ "string" }
- # # <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><HTML>string</HTML>
- #
- # html("LANG" => "ja") { "string" }
- # # <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><HTML LANG="ja">string</HTML>
- #
- # html("DOCTYPE" => false) { "string" }
- # # <HTML>string</HTML>
- #
- # html("DOCTYPE" => '<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">') { "string" }
- # # <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"><HTML>string</HTML>
- #
- # html("PRETTY" => " ") { "<BODY></BODY>" }
- # # <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
- # # <HTML>
- # # <BODY>
- # # </BODY>
- # # </HTML>
- #
- # html("PRETTY" => "\t") { "<BODY></BODY>" }
- # # <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
- # # <HTML>
- # # <BODY>
- # # </BODY>
- # # </HTML>
- #
- # html("PRETTY") { "<BODY></BODY>" }
- # # = html("PRETTY" => " ") { "<BODY></BODY>" }
- #
- # html(if $VERBOSE then "PRETTY" end) { "HTML string" }
- #
- def html(attributes = {}) # :yield:
- if nil == attributes
- attributes = {}
- elsif "PRETTY" == attributes
- attributes = { "PRETTY" => true }
- end
- pretty = attributes.delete("PRETTY")
- pretty = " " if true == pretty
- buf = ""
-
- if attributes.has_key?("DOCTYPE")
- if attributes["DOCTYPE"]
- buf += attributes.delete("DOCTYPE")
- else
- attributes.delete("DOCTYPE")
- end
- else
- buf += doctype
- end
-
- if block_given?
- buf += super(attributes){ yield }
- else
- buf += super(attributes)
- end
-
- if pretty
- CGI::pretty(buf, pretty)
- else
- buf
- end
-
- end
-
- # Generate an Image Button Input element as a string.
- #
- # +src+ is the URL of the image to use for the button. +name+
- # is the input name. +alt+ is the alternative text for the image.
- #
- # Alternatively, the attributes can be specified as a hash.
- #
- # image_button("url")
- # # <INPUT TYPE="image" SRC="url">
- #
- # image_button("url", "name", "string")
- # # <INPUT TYPE="image" SRC="url" NAME="name" ALT="string">
- #
- # image_button("SRC" => "url", "ATL" => "strng")
- # # <INPUT TYPE="image" SRC="url" ALT="string">
- def image_button(src = "", name = nil, alt = nil)
- attributes = if src.kind_of?(String)
- { "TYPE" => "image", "SRC" => src, "NAME" => name,
- "ALT" => alt }
- else
- src["TYPE"] = "image"
- src["SRC"] ||= ""
- src
- end
- input(attributes)
- end
-
-
- # Generate an Image element as a string.
- #
- # +src+ is the URL of the image. +alt+ is the alternative text for
- # the image. +width+ is the width of the image, and +height+ is
- # its height.
- #
- # Alternatively, the attributes can be specified as a hash.
- #
- # img("src", "alt", 100, 50)
- # # <IMG SRC="src" ALT="alt" WIDTH="100" HEIGHT="50">
- #
- # img("SRC" => "src", "ALT" => "alt", "WIDTH" => 100, "HEIGHT" => 50)
- # # <IMG SRC="src" ALT="alt" WIDTH="100" HEIGHT="50">
- def img(src = "", alt = "", width = nil, height = nil)
- attributes = if src.kind_of?(String)
- { "SRC" => src, "ALT" => alt }
- else
- src
- end
- attributes["WIDTH"] = width.to_s if width
- attributes["HEIGHT"] = height.to_s if height
- super(attributes)
- end
-
-
- # Generate a Form element with multipart encoding as a String.
- #
- # Multipart encoding is used for forms that include file uploads.
- #
- # +action+ is the action to perform. +enctype+ is the encoding
- # type, which defaults to "multipart/form-data".
- #
- # Alternatively, the attributes can be specified as a hash.
- #
- # multipart_form{ "string" }
- # # <FORM METHOD="post" ENCTYPE="multipart/form-data">string</FORM>
- #
- # multipart_form("url") { "string" }
- # # <FORM METHOD="post" ACTION="url" ENCTYPE="multipart/form-data">string</FORM>
- def multipart_form(action = nil, enctype = "multipart/form-data")
- attributes = if action == nil
- { "METHOD" => "post", "ENCTYPE" => enctype }
- elsif action.kind_of?(String)
- { "METHOD" => "post", "ACTION" => action,
- "ENCTYPE" => enctype }
- else
- unless action.has_key?("METHOD")
- action["METHOD"] = "post"
- end
- unless action.has_key?("ENCTYPE")
- action["ENCTYPE"] = enctype
- end
- action
- end
- if block_given?
- form(attributes){ yield }
- else
- form(attributes)
- end
- end
-
-
- # Generate a Password Input element as a string.
- #
- # +name+ is the name of the input field. +value+ is its default
- # value. +size+ is the size of the input field display. +maxlength+
- # is the maximum length of the inputted password.
- #
- # Alternatively, attributes can be specified as a hash.
- #
- # password_field("name")
- # # <INPUT TYPE="password" NAME="name" SIZE="40">
- #
- # password_field("name", "value")
- # # <INPUT TYPE="password" NAME="name" VALUE="value" SIZE="40">
- #
- # password_field("password", "value", 80, 200)
- # # <INPUT TYPE="password" NAME="name" VALUE="value" SIZE="80" MAXLENGTH="200">
- #
- # password_field("NAME" => "name", "VALUE" => "value")
- # # <INPUT TYPE="password" NAME="name" VALUE="value">
- def password_field(name = "", value = nil, size = 40, maxlength = nil)
- attributes = if name.kind_of?(String)
- { "TYPE" => "password", "NAME" => name,
- "VALUE" => value, "SIZE" => size.to_s }
- else
- name["TYPE"] = "password"
- name
- end
- attributes["MAXLENGTH"] = maxlength.to_s if maxlength
- input(attributes)
- end
-
- # Generate a Select element as a string.
- #
- # +name+ is the name of the element. The +values+ are the options that
- # can be selected from the Select menu. Each value can be a String or
- # a one, two, or three-element Array. If a String or a one-element
- # Array, this is both the value of that option and the text displayed for
- # it. If a three-element Array, the elements are the option value, displayed
- # text, and a boolean value specifying whether this option starts as selected.
- # The two-element version omits either the option value (defaults to the same
- # as the display text) or the boolean selected specifier (defaults to false).
- #
- # The attributes and options can also be specified as a hash. In this
- # case, options are specified as an array of values as described above,
- # with the hash key of "VALUES".
- #
- # popup_menu("name", "foo", "bar", "baz")
- # # <SELECT NAME="name">
- # # <OPTION VALUE="foo">foo</OPTION>
- # # <OPTION VALUE="bar">bar</OPTION>
- # # <OPTION VALUE="baz">baz</OPTION>
- # # </SELECT>
- #
- # popup_menu("name", ["foo"], ["bar", true], "baz")
- # # <SELECT NAME="name">
- # # <OPTION VALUE="foo">foo</OPTION>
- # # <OPTION VALUE="bar" SELECTED>bar</OPTION>
- # # <OPTION VALUE="baz">baz</OPTION>
- # # </SELECT>
- #
- # popup_menu("name", ["1", "Foo"], ["2", "Bar", true], "Baz")
- # # <SELECT NAME="name">
- # # <OPTION VALUE="1">Foo</OPTION>
- # # <OPTION SELECTED VALUE="2">Bar</OPTION>
- # # <OPTION VALUE="Baz">Baz</OPTION>
- # # </SELECT>
- #
- # popup_menu("NAME" => "name", "SIZE" => 2, "MULTIPLE" => true,
- # "VALUES" => [["1", "Foo"], ["2", "Bar", true], "Baz"])
- # # <SELECT NAME="name" MULTIPLE SIZE="2">
- # # <OPTION VALUE="1">Foo</OPTION>
- # # <OPTION SELECTED VALUE="2">Bar</OPTION>
- # # <OPTION VALUE="Baz">Baz</OPTION>
- # # </SELECT>
- def popup_menu(name = "", *values)
-
- if name.kind_of?(Hash)
- values = name["VALUES"]
- size = name["SIZE"].to_s if name["SIZE"]
- multiple = name["MULTIPLE"]
- name = name["NAME"]
- else
- size = nil
- multiple = nil
- end
-
- select({ "NAME" => name, "SIZE" => size,
- "MULTIPLE" => multiple }){
- values.collect{|value|
- if value.kind_of?(String)
- option({ "VALUE" => value }){ value }
- else
- if value[value.size - 1] == true
- option({ "VALUE" => value[0], "SELECTED" => true }){
- value[value.size - 2]
- }
- else
- option({ "VALUE" => value[0] }){
- value[value.size - 1]
- }
- end
- end
- }.join
- }
-
- end
-
- # Generates a radio-button Input element.
- #
- # +name+ is the name of the input field. +value+ is the value of
- # the field if checked. +checked+ specifies whether the field
- # starts off checked.
- #
- # Alternatively, the attributes can be specified as a hash.
- #
- # radio_button("name", "value")
- # # <INPUT TYPE="radio" NAME="name" VALUE="value">
- #
- # radio_button("name", "value", true)
- # # <INPUT TYPE="radio" NAME="name" VALUE="value" CHECKED>
- #
- # radio_button("NAME" => "name", "VALUE" => "value", "ID" => "foo")
- # # <INPUT TYPE="radio" NAME="name" VALUE="value" ID="foo">
- def radio_button(name = "", value = nil, checked = nil)
- attributes = if name.kind_of?(String)
- { "TYPE" => "radio", "NAME" => name,
- "VALUE" => value, "CHECKED" => checked }
- else
- name["TYPE"] = "radio"
- name
- end
- input(attributes)
- end
-
- # Generate a sequence of radio button Input elements, as a String.
- #
- # This works the same as #checkbox_group(). However, it is not valid
- # to have more than one radiobutton in a group checked.
- #
- # radio_group("name", "foo", "bar", "baz")
- # # <INPUT TYPE="radio" NAME="name" VALUE="foo">foo
- # # <INPUT TYPE="radio" NAME="name" VALUE="bar">bar
- # # <INPUT TYPE="radio" NAME="name" VALUE="baz">baz
- #
- # radio_group("name", ["foo"], ["bar", true], "baz")
- # # <INPUT TYPE="radio" NAME="name" VALUE="foo">foo
- # # <INPUT TYPE="radio" CHECKED NAME="name" VALUE="bar">bar
- # # <INPUT TYPE="radio" NAME="name" VALUE="baz">baz
- #
- # radio_group("name", ["1", "Foo"], ["2", "Bar", true], "Baz")
- # # <INPUT TYPE="radio" NAME="name" VALUE="1">Foo
- # # <INPUT TYPE="radio" CHECKED NAME="name" VALUE="2">Bar
- # # <INPUT TYPE="radio" NAME="name" VALUE="Baz">Baz
- #
- # radio_group("NAME" => "name",
- # "VALUES" => ["foo", "bar", "baz"])
- #
- # radio_group("NAME" => "name",
- # "VALUES" => [["foo"], ["bar", true], "baz"])
- #
- # radio_group("NAME" => "name",
- # "VALUES" => [["1", "Foo"], ["2", "Bar", true], "Baz"])
- def radio_group(name = "", *values)
- if name.kind_of?(Hash)
- values = name["VALUES"]
- name = name["NAME"]
- end
- values.collect{|value|
- if value.kind_of?(String)
- radio_button(name, value) + value
- else
- if value[-1] == true || value[-1] == false
- radio_button(name, value[0], value[-1]) +
- value[-2]
- else
- radio_button(name, value[0]) +
- value[-1]
- end
- end
- }.join
- end
-
- # Generate a reset button Input element, as a String.
- #
- # This resets the values on a form to their initial values. +value+
- # is the text displayed on the button. +name+ is the name of this button.
- #
- # Alternatively, the attributes can be specified as a hash.
- #
- # reset
- # # <INPUT TYPE="reset">
- #
- # reset("reset")
- # # <INPUT TYPE="reset" VALUE="reset">
- #
- # reset("VALUE" => "reset", "ID" => "foo")
- # # <INPUT TYPE="reset" VALUE="reset" ID="foo">
- def reset(value = nil, name = nil)
- attributes = if (not value) or value.kind_of?(String)
- { "TYPE" => "reset", "VALUE" => value, "NAME" => name }
- else
- value["TYPE"] = "reset"
- value
- end
- input(attributes)
- end
-
- alias scrolling_list popup_menu
-
- # Generate a submit button Input element, as a String.
- #
- # +value+ is the text to display on the button. +name+ is the name
- # of the input.
- #
- # Alternatively, the attributes can be specified as a hash.
- #
- # submit
- # # <INPUT TYPE="submit">
- #
- # submit("ok")
- # # <INPUT TYPE="submit" VALUE="ok">
- #
- # submit("ok", "button1")
- # # <INPUT TYPE="submit" VALUE="ok" NAME="button1">
- #
- # submit("VALUE" => "ok", "NAME" => "button1", "ID" => "foo")
- # # <INPUT TYPE="submit" VALUE="ok" NAME="button1" ID="foo">
- def submit(value = nil, name = nil)
- attributes = if (not value) or value.kind_of?(String)
- { "TYPE" => "submit", "VALUE" => value, "NAME" => name }
- else
- value["TYPE"] = "submit"
- value
- end
- input(attributes)
- end
-
- # Generate a text field Input element, as a String.
- #
- # +name+ is the name of the input field. +value+ is its initial
- # value. +size+ is the size of the input area. +maxlength+
- # is the maximum length of input accepted.
- #
- # Alternatively, the attributes can be specified as a hash.
- #
- # text_field("name")
- # # <INPUT TYPE="text" NAME="name" SIZE="40">
- #
- # text_field("name", "value")
- # # <INPUT TYPE="text" NAME="name" VALUE="value" SIZE="40">
- #
- # text_field("name", "value", 80)
- # # <INPUT TYPE="text" NAME="name" VALUE="value" SIZE="80">
- #
- # text_field("name", "value", 80, 200)
- # # <INPUT TYPE="text" NAME="name" VALUE="value" SIZE="80" MAXLENGTH="200">
- #
- # text_field("NAME" => "name", "VALUE" => "value")
- # # <INPUT TYPE="text" NAME="name" VALUE="value">
- def text_field(name = "", value = nil, size = 40, maxlength = nil)
- attributes = if name.kind_of?(String)
- { "TYPE" => "text", "NAME" => name, "VALUE" => value,
- "SIZE" => size.to_s }
- else
- name["TYPE"] = "text"
- name
- end
- attributes["MAXLENGTH"] = maxlength.to_s if maxlength
- input(attributes)
- end
-
- # Generate a TextArea element, as a String.
- #
- # +name+ is the name of the textarea. +cols+ is the number of
- # columns and +rows+ is the number of rows in the display.
- #
- # Alternatively, the attributes can be specified as a hash.
- #
- # The body is provided by the passed-in no-argument block
- #
- # textarea("name")
- # # = textarea("NAME" => "name", "COLS" => 70, "ROWS" => 10)
- #
- # textarea("name", 40, 5)
- # # = textarea("NAME" => "name", "COLS" => 40, "ROWS" => 5)
- def textarea(name = "", cols = 70, rows = 10) # :yield:
- attributes = if name.kind_of?(String)
- { "NAME" => name, "COLS" => cols.to_s,
- "ROWS" => rows.to_s }
- else
- name
- end
- if block_given?
- super(attributes){ yield }
- else
- super(attributes)
- end
- end
-
- end # HtmlExtension
-
-
- # Mixin module for HTML version 3 generation methods.
- module Html3 # :nodoc:
-
- # The DOCTYPE declaration for this version of HTML
- def doctype
- %|<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">|
- end
-
- # Initialise the HTML generation methods for this version.
- def element_init
- extend TagMaker
- methods = ""
- # - -
- for element in %w[ A TT I B U STRIKE BIG SMALL SUB SUP EM STRONG
- DFN CODE SAMP KBD VAR CITE FONT ADDRESS DIV center MAP
- APPLET PRE XMP LISTING DL OL UL DIR MENU SELECT table TITLE
- STYLE SCRIPT H1 H2 H3 H4 H5 H6 TEXTAREA FORM BLOCKQUOTE
- CAPTION ]
- methods += <<-BEGIN + nn_element_def(element) + <<-END
- def #{element.downcase}(attributes = {})
- BEGIN
- end
- END
- end
-
- # - O EMPTY
- for element in %w[ IMG BASE BASEFONT BR AREA LINK PARAM HR INPUT
- ISINDEX META ]
- methods += <<-BEGIN + nOE_element_def(element) + <<-END
- def #{element.downcase}(attributes = {})
- BEGIN
- end
- END
- end
-
- # O O or - O
- for element in %w[ HTML HEAD BODY P PLAINTEXT DT DD LI OPTION tr
- th td ]
- methods += <<-BEGIN + nO_element_def(element) + <<-END
- def #{element.downcase}(attributes = {})
- BEGIN
- end
- END
- end
- eval(methods)
- end
-
- end # Html3
-
-
- # Mixin module for HTML version 4 generation methods.
- module Html4 # :nodoc:
-
- # The DOCTYPE declaration for this version of HTML
- def doctype
- %|<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">|
- end
-
- # Initialise the HTML generation methods for this version.
- def element_init
- extend TagMaker
- methods = ""
- # - -
- for element in %w[ TT I B BIG SMALL EM STRONG DFN CODE SAMP KBD
- VAR CITE ABBR ACRONYM SUB SUP SPAN BDO ADDRESS DIV MAP OBJECT
- H1 H2 H3 H4 H5 H6 PRE Q INS DEL DL OL UL LABEL SELECT OPTGROUP
- FIELDSET LEGEND BUTTON TABLE TITLE STYLE SCRIPT NOSCRIPT
- TEXTAREA FORM A BLOCKQUOTE CAPTION ]
- methods += <<-BEGIN + nn_element_def(element) + <<-END
- def #{element.downcase}(attributes = {})
- BEGIN
- end
- END
- end
-
- # - O EMPTY
- for element in %w[ IMG BASE BR AREA LINK PARAM HR INPUT COL META ]
- methods += <<-BEGIN + nOE_element_def(element) + <<-END
- def #{element.downcase}(attributes = {})
- BEGIN
- end
- END
- end
-
- # O O or - O
- for element in %w[ HTML BODY P DT DD LI OPTION THEAD TFOOT TBODY
- COLGROUP TR TH TD HEAD]
- methods += <<-BEGIN + nO_element_def(element) + <<-END
- def #{element.downcase}(attributes = {})
- BEGIN
- end
- END
- end
- eval(methods)
- end
-
- end # Html4
-
-
- # Mixin module for HTML version 4 transitional generation methods.
- module Html4Tr # :nodoc:
-
- # The DOCTYPE declaration for this version of HTML
- def doctype
- %|<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">|
- end
-
- # Initialise the HTML generation methods for this version.
- def element_init
- extend TagMaker
- methods = ""
- # - -
- for element in %w[ TT I B U S STRIKE BIG SMALL EM STRONG DFN
- CODE SAMP KBD VAR CITE ABBR ACRONYM FONT SUB SUP SPAN BDO
- ADDRESS DIV CENTER MAP OBJECT APPLET H1 H2 H3 H4 H5 H6 PRE Q
- INS DEL DL OL UL DIR MENU LABEL SELECT OPTGROUP FIELDSET
- LEGEND BUTTON TABLE IFRAME NOFRAMES TITLE STYLE SCRIPT
- NOSCRIPT TEXTAREA FORM A BLOCKQUOTE CAPTION ]
- methods += <<-BEGIN + nn_element_def(element) + <<-END
- def #{element.downcase}(attributes = {})
- BEGIN
- end
- END
- end
-
- # - O EMPTY
- for element in %w[ IMG BASE BASEFONT BR AREA LINK PARAM HR INPUT
- COL ISINDEX META ]
- methods += <<-BEGIN + nOE_element_def(element) + <<-END
- def #{element.downcase}(attributes = {})
- BEGIN
- end
- END
- end
-
- # O O or - O
- for element in %w[ HTML BODY P DT DD LI OPTION THEAD TFOOT TBODY
- COLGROUP TR TH TD HEAD ]
- methods += <<-BEGIN + nO_element_def(element) + <<-END
- def #{element.downcase}(attributes = {})
- BEGIN
- end
- END
- end
- eval(methods)
- end
-
- end # Html4Tr
-
-
- # Mixin module for generating HTML version 4 with framesets.
- module Html4Fr # :nodoc:
-
- # The DOCTYPE declaration for this version of HTML
- def doctype
- %|<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">|
- end
-
- # Initialise the HTML generation methods for this version.
- def element_init
- methods = ""
- # - -
- for element in %w[ FRAMESET ]
- methods += <<-BEGIN + nn_element_def(element) + <<-END
- def #{element.downcase}(attributes = {})
- BEGIN
- end
- END
- end
-
- # - O EMPTY
- for element in %w[ FRAME ]
- methods += <<-BEGIN + nOE_element_def(element) + <<-END
- def #{element.downcase}(attributes = {})
- BEGIN
- end
- END
- end
- eval(methods)
- end
-
- end # Html4Fr
-end
-
-
diff --git a/lib/cgi/session.rb b/lib/cgi/session.rb
index 65d6442b37..2dea08cf75 100644
--- a/lib/cgi/session.rb
+++ b/lib/cgi/session.rb
@@ -13,7 +13,7 @@
#
# This file provides the +CGI::Session+ class, which provides session
# support for CGI scripts. A session is a sequence of HTTP requests
-# and responses linked together and associated with a single client.
+# and responses linked together and associated with a single client.
# Information associated with the session is stored
# on the server between requests. A session id is passed between client
# and server with every request and response, transparently
@@ -28,7 +28,7 @@ require 'tmpdir'
class CGI
- # Class representing an HTTP session. See documentation for the file
+ # Class representing an HTTP session. See documentation for the file
# cgi/session.rb for an introduction to HTTP sessions.
#
# == Lifecycle
@@ -47,7 +47,7 @@ class CGI
# == Setting and retrieving session data.
#
# The Session class associates data with a session as key-value pairs.
- # This data can be set and retrieved by indexing the Session instance
+ # This data can be set and retrieved by indexing the Session instance
# using '[]', much the same as hashes (although other hash methods
# are not supported).
#
@@ -60,21 +60,21 @@ class CGI
#
# == Storing session state
#
- # The caller can specify what form of storage to use for the session's
+ # The caller can specify what form of storage to use for the session's
# data with the +database_manager+ option to CGI::Session::new. The
# following storage classes are provided as part of the standard library:
#
- # CGI::Session::FileStore:: stores data as plain text in a flat file. Only
- # works with String data. This is the default
+ # CGI::Session::FileStore:: stores data as plain text in a flat file. Only
+ # works with String data. This is the default
# storage type.
- # CGI::Session::MemoryStore:: stores data in an in-memory hash. The data
- # only persists for as long as the current ruby
+ # CGI::Session::MemoryStore:: stores data in an in-memory hash. The data
+ # only persists for as long as the current ruby
# interpreter instance does.
# CGI::Session::PStore:: stores data in Marshalled format. Provided by
- # cgi/session/pstore.rb. Supports data of any type,
+ # cgi/session/pstore.rb. Supports data of any type,
# and provides file-locking and transaction support.
#
- # Custom storage types can also be created by defining a class with
+ # Custom storage types can also be created by defining a class with
# the following methods:
#
# new(session, options)
@@ -99,14 +99,14 @@ class CGI
# The simplest way to do this is via cookies. The CGI::Session class
# provides transparent support for session id communication via cookies
# if the client has cookies enabled.
- #
+ #
# If the client has cookies disabled, the session id must be included
# as a parameter of all requests sent by the client to the server. The
# CGI::Session class in conjunction with the CGI class will transparently
# add the session id as a hidden input field to all forms generated
# using the CGI#form() HTML generation method. No built-in support is
# provided for other mechanisms, such as URL re-writing. The caller is
- # responsible for extracting the session id from the session_id
+ # responsible for extracting the session id from the session_id
# attribute and manually encoding it in URLs and adding it as a hidden
# input to HTML forms created by other mechanisms. Also, session expiry
# is not automatically handled.
@@ -124,10 +124,10 @@ class CGI
# session = CGI::Session.new(cgi,
# 'database_manager' => CGI::Session::PStore, # use PStore
# 'session_key' => '_rb_sess_id', # custom session key
- # 'session_expires' => Time.now + 30 * 60, # 30 minute timeout
+ # 'session_expires' => Time.now + 30 * 60, # 30 minute timeout
# 'prefix' => 'pstore_sid_') # PStore option
# if cgi.has_key?('user_name') and cgi['user_name'] != ''
- # # coerce to String: cgi[] returns the
+ # # coerce to String: cgi[] returns the
# # string-like CGI::QueryExtension::Value
# session['user_name'] = cgi['user_name'].to_s
# elsif !session['user_name']
@@ -143,11 +143,11 @@ class CGI
# cgi = CGI.new("html4")
#
# # We make sure to delete an old session if one exists,
- # # not just to free resources, but to prevent the session
+ # # not just to free resources, but to prevent the session
# # from being maliciously hijacked later on.
# begin
- # session = CGI::Session.new(cgi, 'new_session' => false)
- # session.delete
+ # session = CGI::Session.new(cgi, 'new_session' => false)
+ # session.delete
# rescue ArgumentError # if no old session
# end
# session = CGI::Session.new(cgi, 'new_session' => true)
@@ -163,7 +163,7 @@ class CGI
def Session::callback(dbman) #:nodoc:
Proc.new{
- dbman[0].close unless dbman.empty?
+ dbman[0].close unless dbman.empty?
}
end
@@ -172,7 +172,7 @@ class CGI
# 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.
+ # session ids.
def create_new_id
require 'securerandom'
begin
@@ -205,7 +205,7 @@ class CGI
# it is retrieved from the +session_key+ parameter
# of the request, or automatically generated for
# a new session.
- # new_session:: if true, force creation of a new session. If not set,
+ # new_session:: if true, force creation of a new session. If not set,
# a new session is only created if none currently
# exists. If false, a new session is never created,
# and if none currently exists and the +session_id+
@@ -220,7 +220,7 @@ class CGI
# The following options are also recognised, but only apply if the
# session id is stored in a cookie.
#
- # session_expires:: the time the current session expires, as a
+ # session_expires:: the time the current session expires, as a
# +Time+ object. If not set, the session will terminate
# when the user's browser is closed.
# session_domain:: the hostname domain for which this session is valid.
@@ -232,10 +232,10 @@ class CGI
# +option+ is also passed on to the session storage class initializer; see
# the documentation for each session storage class for the options
# they support.
- #
+ #
# The retrieved or created session is automatically added to +request+
# as a cookie, and also to its +output_hidden+ table, which is used
- # to add hidden input elements to forms.
+ # to add hidden input elements to forms.
#
# *WARNING* the +output_hidden+
# fields are surrounded by a <fieldset> tag in HTML 4 generation, which
@@ -253,26 +253,26 @@ class CGI
session_key = option['session_key'] || '_session_id'
session_id = option['session_id']
unless session_id
- if option['new_session']
- session_id = create_new_id
- @new_session = true
- end
+ if option['new_session']
+ session_id = create_new_id
+ @new_session = true
+ end
end
unless session_id
- if request.key?(session_key)
- session_id = request[session_key]
- session_id = session_id.read if session_id.respond_to?(:read)
- end
- unless session_id
- session_id, = request.cookies[session_key]
- end
- unless session_id
- unless option.fetch('new_session', true)
- raise ArgumentError, "session_key `%s' should be supplied"%session_key
- end
- session_id = create_new_id
- @new_session = true
- end
+ if request.key?(session_key)
+ session_id = request[session_key]
+ session_id = session_id.read if session_id.respond_to?(:read)
+ end
+ unless session_id
+ session_id, = request.cookies[session_key]
+ end
+ unless session_id
+ unless option.fetch('new_session', true)
+ raise ArgumentError, "session_key `%s' should be supplied"%session_key
+ end
+ session_id = create_new_id
+ @new_session = true
+ end
end
@session_id = session_id
dbman = option['database_manager'] || FileStore
@@ -283,25 +283,24 @@ class CGI
raise ArgumentError, "invalid session_id `%s'"%session_id
end
session_id = @session_id = create_new_id unless session_id
- @new_session=true
+ @new_session = true
retry
end
request.instance_eval do
- @output_hidden = {session_key => session_id} unless option['no_hidden']
- @output_cookies = [
+ @output_hidden = {session_key => session_id} unless option['no_hidden']
+ @output_cookies = [
Cookie::new("name" => session_key,
- "value" => session_id,
- "expires" => option['session_expires'],
- "domain" => option['session_domain'],
- "secure" => option['session_secure'],
- "path" =>
- if option['session_path']
- option['session_path']
- elsif ENV["SCRIPT_NAME"]
- File::dirname(ENV["SCRIPT_NAME"])
- else
- ""
- end)
+ "value" => session_id,
+ "expires" => option['session_expires'],
+ "domain" => option['session_domain'],
+ "secure" => option['session_secure'],
+ "path" => if option['session_path'] then
+ option['session_path']
+ elsif ENV["SCRIPT_NAME"] then
+ File::dirname(ENV["SCRIPT_NAME"])
+ else
+ ""
+ end)
] unless option['no_cookies']
end
@dbprot = [@dbman]
@@ -323,11 +322,11 @@ class CGI
# Store session data on the server. For some session storage types,
# this is a no-op.
- def update
+ def update
@dbman.update
end
- # Store session data on the server and close the session storage.
+ # Store session data on the server and close the session storage.
# For some session storage types, this is a no-op.
def close
@dbman.close
@@ -359,7 +358,7 @@ class CGI
# created. The session id must only contain alphanumeric
# characters; automatically generated session ids observe
# this requirement.
- #
+ #
# +option+ is a hash of options for the initializer. The
# following options are recognised:
#
@@ -368,7 +367,7 @@ class CGI
# on Unix systems).
# prefix:: the prefix to add to the session id when generating
# the filename for this session's FileStore file.
- # Defaults to "cgi_sid_".
+ # Defaults to the empty string.
# suffix:: the prefix to add to the session id when generating
# the filename for this session's FileStore file.
# Defaults to the empty string.
@@ -376,56 +375,56 @@ class CGI
# This session's FileStore file will be created if it does
# not exist, or opened if it does.
def initialize(session, option={})
- dir = option['tmpdir'] || Dir::tmpdir
- prefix = option['prefix'] || 'cgi_sid_'
- suffix = option['suffix'] || ''
- id = session.session_id
+ dir = option['tmpdir'] || Dir::tmpdir
+ prefix = option['prefix'] || ''
+ suffix = option['suffix'] || ''
+ id = session.session_id
require 'digest/md5'
md5 = Digest::MD5.hexdigest(id)[0,16]
- @path = dir+"/"+prefix+md5+suffix
- if File::exist? @path
- @hash = nil
- else
+ @path = dir+"/"+prefix+md5+suffix
+ if File::exist? @path
+ @hash = nil
+ else
unless session.new_session
raise CGI::Session::NoSession, "uninitialized session"
end
- @hash = {}
- end
+ @hash = {}
+ end
end
# Restore session state from the session's FileStore file.
#
# Returns the session state as a hash.
def restore
- unless @hash
- @hash = {}
+ unless @hash
+ @hash = {}
begin
lockf = File.open(@path+".lock", "r")
lockf.flock File::LOCK_SH
- f = File.open(@path, 'r')
- for line in f
- line.chomp!
- k, v = line.split('=',2)
- @hash[CGI::unescape(k)] = Marshal.restore(CGI::unescape(v))
- end
+ f = File.open(@path, 'r')
+ for line in f
+ line.chomp!
+ k, v = line.split('=',2)
+ @hash[CGI::unescape(k)] = CGI::unescape(v)
+ end
ensure
- f.close unless f.nil?
+ f.close unless f.nil?
lockf.close if lockf
end
- end
- @hash
+ end
+ @hash
end
# Save session state to the session's FileStore file.
def update
- return unless @hash
+ return unless @hash
begin
lockf = File.open(@path+".lock", File::CREAT|File::RDWR, 0600)
- lockf.flock File::LOCK_EX
+ 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)))
- end
+ for k,v in @hash
+ f.printf "%s=%s\n", CGI::escape(k), CGI::escape(String(v))
+ end
f.close
File.rename @path+".new", @path
ensure
@@ -436,21 +435,22 @@ class CGI
# Update and close the session's FileStore file.
def close
- update
+ update
end
# Close and delete the session's FileStore file.
def delete
File::unlink @path+".lock" rescue nil
File::unlink @path+".new" rescue nil
- File::unlink @path rescue Errno::ENOENT
+ File::unlink @path
+ rescue Errno::ENOENT
end
end
# In-memory session storage class.
#
# Implements session storage as a global in-memory hash. Session
- # data will only persist for as long as the ruby interpreter
+ # data will only persist for as long as the ruby interpreter
# instance does.
class MemoryStore
GLOBAL_HASH_TABLE = {} #:nodoc:
@@ -461,7 +461,7 @@ class CGI
# +option+ is a list of initialisation options. None are
# currently recognised.
def initialize(session, option=nil)
- @session_id = session.session_id
+ @session_id = session.session_id
unless GLOBAL_HASH_TABLE.key?(@session_id)
unless session.new_session
raise CGI::Session::NoSession, "uninitialized session"
@@ -474,63 +474,26 @@ class CGI
#
# Returns session data as a hash.
def restore
- GLOBAL_HASH_TABLE[@session_id]
- end
-
- # Update session state.
- #
- # A no-op.
- def update
- # don't need to update; hash is shared
- end
-
- # Close session storage.
- #
- # A no-op.
- def close
- # don't need to close
- end
-
- # Delete the session state.
- def delete
- GLOBAL_HASH_TABLE.delete(@session_id)
- end
- end
-
- # Dummy session storage class.
- #
- # Implements session storage place holder. No actual storage
- # will be done.
- class NullStore
- # Create a new NullStore instance.
- #
- # +session+ is the session this instance is associated with.
- # +option+ is a list of initialisation options. None are
- # currently recognised.
- def initialize(session, option=nil)
- end
-
- # Restore (empty) session state.
- def restore
- {}
+ GLOBAL_HASH_TABLE[@session_id]
end
# Update session state.
#
# A no-op.
def update
+ # don't need to update; hash is shared
end
# Close session storage.
#
# A no-op.
def close
+ # don't need to close
end
# Delete the session state.
- #
- # A no-op.
def delete
+ GLOBAL_HASH_TABLE.delete(@session_id)
end
end
end
diff --git a/lib/cgi/session/pstore.rb b/lib/cgi/session/pstore.rb
index a63d7d3984..3d204d5dc0 100644
--- a/lib/cgi/session/pstore.rb
+++ b/lib/cgi/session/pstore.rb
@@ -2,7 +2,7 @@
# cgi/session/pstore.rb - persistent storage of marshalled session data
#
# Documentation: William Webber (william@williamwebber.com)
-#
+#
# == Overview
#
# This file provides the CGI::Session::PStore class, which builds
@@ -29,7 +29,7 @@ class CGI
# created. The session id must only contain alphanumeric
# characters; automatically generated session ids observe
# this requirement.
- #
+ #
# +option+ is a hash of options for the initializer. The
# following options are recognised:
#
@@ -43,55 +43,55 @@ class CGI
# This session's PStore file will be created if it does
# not exist, or opened if it does.
def initialize(session, option={})
- dir = option['tmpdir'] || Dir::tmpdir
- prefix = option['prefix'] || ''
- id = session.session_id
+ dir = option['tmpdir'] || Dir::tmpdir
+ prefix = option['prefix'] || ''
+ id = session.session_id
require 'digest/md5'
md5 = Digest::MD5.hexdigest(id)[0,16]
- path = dir+"/"+prefix+md5
- path.untaint
- if File::exist?(path)
- @hash = nil
- else
+ path = dir+"/"+prefix+md5
+ path.untaint
+ if File::exist?(path)
+ @hash = nil
+ else
unless session.new_session
raise CGI::Session::NoSession, "uninitialized session"
end
- @hash = {}
- end
- @p = ::PStore.new(path)
- @p.transaction do |p|
- File.chmod(0600, p.path)
- end
+ @hash = {}
+ end
+ @p = ::PStore.new(path)
+ @p.transaction do |p|
+ File.chmod(0600, p.path)
+ end
end
# Restore session state from the session's PStore file.
#
# Returns the session state as a hash.
def restore
- unless @hash
- @p.transaction do
- @hash = @p['hash'] || {}
- end
- end
- @hash
+ unless @hash
+ @p.transaction do
+ @hash = @p['hash'] || {}
+ end
+ end
+ @hash
end
# Save session state to the session's PStore file.
- def update
- @p.transaction do
- @p['hash'] = @hash
- end
+ def update
+ @p.transaction do
+ @p['hash'] = @hash
+ end
end
# Update and close the session's PStore file.
def close
- update
+ update
end
# Close and delete the session's PStore file.
def delete
- path = @p.path
- File::unlink path
+ path = @p.path
+ File::unlink path
end
end
diff --git a/lib/cgi/util.rb b/lib/cgi/util.rb
deleted file mode 100644
index b7b0233b4d..0000000000
--- a/lib/cgi/util.rb
+++ /dev/null
@@ -1,181 +0,0 @@
-class CGI
- # URL-encode a string.
- # url_encoded_string = CGI::escape("'Stop!' said Fred")
- # # => "%27Stop%21%27+said+Fred"
- def CGI::escape(string)
- string.gsub(/([^ a-zA-Z0-9_.-]+)/) do
- '%' + $1.unpack('H2' * $1.bytesize).join('%').upcase
- end.tr(' ', '+')
- end
-
-
- # URL-decode a string.
- # string = CGI::unescape("%27Stop%21%27+said+Fred")
- # # => "'Stop!' said Fred"
- def CGI::unescape(string)
- enc = string.encoding
- string.tr('+', ' ').gsub(/((?:%[0-9a-fA-F]{2})+)/) do
- [$1.delete('%')].pack('H*').force_encoding(enc)
- end
- end
-
- TABLE_FOR_ESCAPE_HTML__ = {
- '&' => '&amp;',
- '"' => '&quot;',
- '<' => '&lt;',
- '>' => '&gt;',
- }
-
- # Escape special characters in HTML, namely &\"<>
- # CGI::escapeHTML('Usage: foo "bar" <baz>')
- # # => "Usage: foo &quot;bar&quot; &lt;baz&gt;"
- def CGI::escapeHTML(string)
- string.gsub(/[&\"<>]/, TABLE_FOR_ESCAPE_HTML__)
- end
-
-
- # Unescape a string that has been HTML-escaped
- # CGI::unescapeHTML("Usage: foo &quot;bar&quot; &lt;baz&gt;")
- # # => "Usage: foo \"bar\" <baz>"
- def CGI::unescapeHTML(string)
- enc = string.encoding
- if [Encoding::UTF_16BE, Encoding::UTF_16LE, Encoding::UTF_32BE, Encoding::UTF_32LE].include?(enc)
- return string.gsub(Regexp.new('&(amp|quot|gt|lt|#[0-9]+|#x[0-9A-Fa-f]+);'.encode(enc))) do
- case $1.encode("US-ASCII")
- when 'amp' then '&'.encode(enc)
- when 'quot' then '"'.encode(enc)
- when 'gt' then '>'.encode(enc)
- when 'lt' then '<'.encode(enc)
- when /\A#0*(\d+)\z/ then $1.to_i.chr(enc)
- when /\A#x([0-9a-f]+)\z/i then $1.hex.chr(enc)
- end
- end
- end
- asciicompat = Encoding.compatible?(string, "a")
- string.gsub(/&(amp|quot|gt|lt|\#[0-9]+|\#x[0-9A-Fa-f]+);/) do
- match = $1.dup
- case match
- when 'amp' then '&'
- when 'quot' then '"'
- when 'gt' then '>'
- when 'lt' then '<'
- when /\A#0*(\d+)\z/
- n = $1.to_i
- 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 enc == Encoding::UTF_8 or
- enc == Encoding::ISO_8859_1 && n < 256 or
- asciicompat && n < 128
- n.chr(enc)
- else
- "&#x#{$1};"
- end
- else
- "&#{match};"
- end
- end
- end
- def CGI::escape_html(str)
- escapeHTML(str)
- end
- def CGI::unescape_html(str)
- unescapeHTML(str)
- end
-
- # Escape only the tags of certain HTML elements in +string+.
- #
- # Takes an element or elements or array of elements. Each element
- # is specified by the name of the element, without angle brackets.
- # This matches both the start and the end tag of that element.
- # 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")
- # # "<BR>&lt;A HREF=&quot;url&quot;&gt;&lt;/A&gt"
- #
- # print CGI::escapeElement('<BR><A HREF="url"></A>', ["A", "IMG"])
- # # "<BR>&lt;A HREF=&quot;url&quot;&gt;&lt;/A&gt"
- def CGI::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($&)
- end
- else
- string
- end
- end
-
-
- # Undo escaping such as that done by CGI::escapeElement()
- #
- # 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"])
- # # "&lt;BR&gt;<A HREF="url"></A>"
- def CGI::unescapeElement(string, *elements)
- elements = elements[0] if elements[0].kind_of?(Array)
- unless elements.empty?
- string.gsub(/&lt;\/?(?:#{elements.join("|")})(?!\w)(?:.|\n)*?&gt;/i) do
- CGI::unescapeHTML($&)
- end
- else
- string
- end
- end
- def CGI::escape_element(str)
- escapeElement(str)
- end
- def CGI::unescape_element(str)
- unescapeElement(str)
- end
-
- # Format a +Time+ object as a String using the format specified by RFC 1123.
- #
- # CGI::rfc1123_date(Time.now)
- # # Sat, 01 Jan 2000 00:00:00 GMT
- def CGI::rfc1123_date(time)
- t = time.clone.gmtime
- return format("%s, %.2d %s %.4d %.2d:%.2d:%.2d GMT",
- RFC822_DAYS[t.wday], t.day, RFC822_MONTHS[t.month-1], t.year,
- t.hour, t.min, t.sec)
- end
-
- # Prettify (indent) an HTML string.
- #
- # +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>")
- # # <HTML>
- # # <BODY>
- # # </BODY>
- # # </HTML>
- #
- # print CGI::pretty("<HTML><BODY></BODY></HTML>", "\t")
- # # <HTML>
- # # <BODY>
- # # </BODY>
- # # </HTML>
- #
- def CGI::pretty(string, shift = " ")
- lines = string.gsub(/(?!\A)<(?:.|\n)*?>/, "\n\\0").gsub(/<(?:.|\n)*?>(?!\n)/, "\\0\n")
- end_pos = 0
- while end_pos = lines.index(/^<\/(\w+)/, end_pos)
- element = $1.dup
- start_pos = lines.rindex(/^\s*<#{element}/i, end_pos)
- lines[start_pos ... end_pos] = "__" + lines[start_pos ... end_pos].gsub(/\n(?!\z)/, "\n" + shift) + "__"
- end
- lines.gsub(/^((?:#{Regexp::quote(shift)})*)__(?=<\/?\w)/, '\1')
- end
-end
diff --git a/lib/cmath.rb b/lib/cmath.rb
deleted file mode 100644
index c4b14e3ef6..0000000000
--- a/lib/cmath.rb
+++ /dev/null
@@ -1,254 +0,0 @@
-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
-
- def exp(z)
- if z.real?
- exp!(z)
- else
- ere = exp!(z.real)
- Complex(ere * cos!(z.imag),
- ere * sin!(z.imag))
- end
- end
-
- def log(*args)
- z, b = args
- 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
- end
-
- def log2(z)
- if z.real? and z >= 0
- log2!(z)
- else
- log(z) / log!(2)
- end
- end
-
- def log10(z)
- if z.real? and z >= 0
- log10!(z)
- else
- log(z) / log!(10)
- end
- end
-
- def sqrt(z)
- 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), sqrt!((r - x) / 2))
- end
- end
- end
-
- def cbrt(z)
- if z.real? and z >= 0
- cbrt!(z)
- else
- Complex(z) ** (1.0/3)
- end
- end
-
- def sin(z)
- if z.real?
- sin!(z)
- else
- Complex(sin!(z.real) * cosh!(z.imag),
- cos!(z.real) * sinh!(z.imag))
- end
- end
-
- def cos(z)
- if z.real?
- cos!(z)
- else
- Complex(cos!(z.real) * cosh!(z.imag),
- -sin!(z.real) * sinh!(z.imag))
- end
- end
-
- def tan(z)
- if z.real?
- tan!(z)
- else
- sin(z) / cos(z)
- end
- end
-
- def sinh(z)
- if z.real?
- sinh!(z)
- else
- Complex(sinh!(z.real) * cos!(z.imag),
- cosh!(z.real) * sin!(z.imag))
- end
- end
-
- def cosh(z)
- if z.real?
- cosh!(z)
- else
- Complex(cosh!(z.real) * cos!(z.imag),
- sinh!(z.real) * sin!(z.imag))
- end
- end
-
- def tanh(z)
- if z.real?
- tanh!(z)
- else
- sinh(z) / cosh(z)
- end
- end
-
- def asin(z)
- if z.real? and z >= -1 and z <= 1
- asin!(z)
- else
- Complex(0, -1.0) * log(Complex(0, 1.0) * z + sqrt(1.0 - z * z))
- end
- end
-
- def acos(z)
- if z.real? and z >= -1 and z <= 1
- acos!(z)
- else
- Complex(0, -1.0) * log(z + Complex(0, 1.0) * sqrt(1.0 - z * z))
- end
- end
-
- def atan(z)
- if z.real?
- atan!(z)
- else
- Complex(0, 1.0) * log((Complex(0, 1.0) + z) / (Complex(0, 1.0) - z)) / 2.0
- end
- end
-
- def atan2(y,x)
- if y.real? and x.real?
- atan2!(y,x)
- else
- Complex(0, -1.0) * log((x + Complex(0, 1.0) * y) / sqrt(x * x + y * y))
- end
- end
-
- def asinh(z)
- if z.real?
- asinh!(z)
- else
- log(z + sqrt(1.0 + z * z))
- end
- end
-
- def acosh(z)
- if z.real? and z >= 1
- acosh!(z)
- else
- log(z + sqrt(z * z - 1.0))
- end
- end
-
- def atanh(z)
- if z.real? and z >= -1 and z <= 1
- atanh!(z)
- else
- log((1.0 + z) / (1.0 - z)) / 2.0
- 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
-
-end
diff --git a/lib/complex.rb b/lib/complex.rb
index c7c1a03b91..fbf50ffece 100644
--- a/lib/complex.rb
+++ b/lib/complex.rb
@@ -1,26 +1,663 @@
-# :enddoc:
+#
+# complex.rb -
+# $Release Version: 0.5 $
+# $Revision: 1.3 $
+# $Date: 1998/07/08 10:05:28 $
+# by Keiju ISHITSUKA(SHL Japan Inc.)
+#
+# ----
+#
+# complex.rb implements the Complex class for complex numbers. Additionally,
+# some methods in other Numeric classes are redefined or added to allow greater
+# interoperability with Complex numbers.
+#
+# Complex numbers can be created in the following manner:
+# - <tt>Complex(a, b)</tt>
+# - <tt>Complex.polar(radius, theta)</tt>
+#
+# Additionally, note the following:
+# - <tt>Complex::I</tt> (the mathematical constant <i>i</i>)
+# - <tt>Numeric#im</tt> (e.g. <tt>5.im -> 0+5i</tt>)
+#
+# The following +Math+ module methods are redefined to handle Complex arguments.
+# They will work as normal with non-Complex arguments.
+# sqrt exp cos sin tan log log10
+# cosh sinh tanh acos asin atan atan2 acosh asinh atanh
+#
-require 'cmath'
-unless defined?(Math.exp!)
- Object.instance_eval{remove_const :Math}
- Math = CMath
+#
+# Numeric is a built-in class on which Fixnum, Bignum, etc., are based. Here
+# some methods are added so that all number types can be treated to some extent
+# as Complex numbers.
+#
+class Numeric
+ #
+ # Returns a Complex number <tt>(0,<i>self</i>)</tt>.
+ #
+ def im
+ Complex(0, self)
+ end
+
+ #
+ # The real part of a complex number, i.e. <i>self</i>.
+ #
+ def real
+ self
+ end
+
+ #
+ # The imaginary part of a complex number, i.e. 0.
+ #
+ def image
+ 0
+ end
+ alias imag image
+
+ #
+ # See Complex#arg.
+ #
+ def arg
+ if self >= 0
+ return 0
+ else
+ return Math::PI
+ end
+ end
+ alias angle arg
+
+ #
+ # See Complex#polar.
+ #
+ def polar
+ return abs, arg
+ end
+
+ #
+ # See Complex#conjugate (short answer: returns <i>self</i>).
+ #
+ def conjugate
+ self
+ end
+ alias conj conjugate
end
-def Complex.generic? (other)
- other.kind_of?(Integer) ||
- other.kind_of?(Float) ||
- other.kind_of?(Rational)
+
+#
+# Creates a Complex number. +a+ and +b+ should be Numeric. The result will be
+# <tt>a+bi</tt>.
+#
+def Complex(a, b = 0)
+ if b == 0 and (a.kind_of?(Complex) or defined? Complex::Unify)
+ a
+ else
+ Complex.new( a.real-b.imag, a.imag+b.real )
+ end
end
-class Complex
+#
+# The complex number class. See complex.rb for an overview.
+#
+class Complex < Numeric
+ @RCS_ID='-$Id: complex.rb,v 1.3 1998/07/08 10:05:28 keiju Exp keiju $-'
+
+ undef step
+ undef div, divmod
+ undef floor, truncate, ceil, round
+
+ def Complex.generic?(other) # :nodoc:
+ other.kind_of?(Integer) or
+ other.kind_of?(Float) or
+ (defined?(Rational) and other.kind_of?(Rational))
+ end
+
+ #
+ # Creates a +Complex+ number in terms of +r+ (radius) and +theta+ (angle).
+ #
+ def Complex.polar(r, theta)
+ Complex(r*Math.cos(theta), r*Math.sin(theta))
+ end
+
+ #
+ # Creates a +Complex+ number <tt>a</tt>+<tt>b</tt><i>i</i>.
+ #
+ def Complex.new!(a, b=0)
+ new(a,b)
+ end
+
+ def initialize(a, b)
+ raise TypeError, "non numeric 1st arg `#{a.inspect}'" if !a.kind_of? Numeric
+ raise TypeError, "`#{a.inspect}' for 1st arg" if a.kind_of? Complex
+ raise TypeError, "non numeric 2nd arg `#{b.inspect}'" if !b.kind_of? Numeric
+ raise TypeError, "`#{b.inspect}' for 2nd arg" if b.kind_of? Complex
+ @real = a
+ @image = b
+ end
+
+ #
+ # Addition with real or complex number.
+ #
+ def + (other)
+ if other.kind_of?(Complex)
+ re = @real + other.real
+ im = @image + other.image
+ Complex(re, im)
+ elsif Complex.generic?(other)
+ Complex(@real + other, @image)
+ else
+ x , y = other.coerce(self)
+ x + y
+ end
+ end
+
+ #
+ # Subtraction with real or complex number.
+ #
+ def - (other)
+ if other.kind_of?(Complex)
+ re = @real - other.real
+ im = @image - other.image
+ Complex(re, im)
+ elsif Complex.generic?(other)
+ Complex(@real - other, @image)
+ else
+ x , y = other.coerce(self)
+ x - y
+ end
+ end
+
+ #
+ # Multiplication with real or complex number.
+ #
+ def * (other)
+ if other.kind_of?(Complex)
+ re = @real*other.real - @image*other.image
+ im = @real*other.image + @image*other.real
+ Complex(re, im)
+ elsif Complex.generic?(other)
+ Complex(@real * other, @image * other)
+ else
+ x , y = other.coerce(self)
+ x * y
+ end
+ end
+
+ #
+ # Division by real or complex number.
+ #
+ def / (other)
+ if other.kind_of?(Complex)
+ self*other.conjugate/other.abs2
+ elsif Complex.generic?(other)
+ Complex(@real/other, @image/other)
+ else
+ x, y = other.coerce(self)
+ x/y
+ end
+ end
+
+ def quo(other)
+ Complex(@real.quo(1), @image.quo(1)) / other
+ end
- alias image imag
+ #
+ # Raise this complex number to the given (real or complex) power.
+ #
+ def ** (other)
+ if other == 0
+ return Complex(1)
+ end
+ if other.kind_of?(Complex)
+ r, theta = polar
+ ore = other.real
+ oim = other.image
+ nr = Math.exp!(ore*Math.log!(r) - oim * theta)
+ ntheta = theta*ore + oim*Math.log!(r)
+ Complex.polar(nr, ntheta)
+ elsif other.kind_of?(Integer)
+ if other > 0
+ x = self
+ z = x
+ n = other - 1
+ while n != 0
+ while (div, mod = n.divmod(2)
+ mod == 0)
+ x = Complex(x.real*x.real - x.image*x.image, 2*x.real*x.image)
+ n = div
+ end
+ z *= x
+ n -= 1
+ end
+ z
+ else
+ if defined? Rational
+ (Rational(1) / self) ** -other
+ else
+ self ** Float(other)
+ end
+ end
+ elsif Complex.generic?(other)
+ r, theta = polar
+ Complex.polar(r**other, theta*other)
+ else
+ x, y = other.coerce(self)
+ x**y
+ end
+ end
+
+ #
+ # Remainder after division by a real or complex number.
+ #
+ def % (other)
+ if other.kind_of?(Complex)
+ Complex(@real % other.real, @image % other.image)
+ elsif Complex.generic?(other)
+ Complex(@real % other, @image % other)
+ else
+ x , y = other.coerce(self)
+ x % y
+ end
+ end
+
+#--
+# def divmod(other)
+# if other.kind_of?(Complex)
+# rdiv, rmod = @real.divmod(other.real)
+# idiv, imod = @image.divmod(other.image)
+# return Complex(rdiv, idiv), Complex(rmod, rmod)
+# elsif Complex.generic?(other)
+# Complex(@real.divmod(other), @image.divmod(other))
+# else
+# x , y = other.coerce(self)
+# x.divmod(y)
+# end
+# end
+#++
+
+ #
+ # Absolute value (aka modulus): distance from the zero point on the complex
+ # plane.
+ #
+ def abs
+ Math.hypot(@real, @image)
+ end
+
+ #
+ # Square of the absolute value.
+ #
+ def abs2
+ @real*@real + @image*@image
+ end
+
+ #
+ # Argument (angle from (1,0) on the complex plane).
+ #
+ def arg
+ Math.atan2!(@image, @real)
+ end
+ alias angle arg
+
+ #
+ # Returns the absolute value _and_ the argument.
+ #
+ def polar
+ return abs, arg
+ end
+
+ #
+ # Complex conjugate (<tt>z + z.conjugate = 2 * z.real</tt>).
+ #
+ def conjugate
+ Complex(@real, -@image)
+ end
+ alias conj conjugate
+
+ #
+ # Compares the absolute values of the two numbers.
+ #
+ def <=> (other)
+ self.abs <=> other.abs
+ end
+
+ #
+ # Test for numerical equality (<tt>a == a + 0<i>i</i></tt>).
+ #
+ def == (other)
+ if other.kind_of?(Complex)
+ @real == other.real and @image == other.image
+ elsif Complex.generic?(other)
+ @real == other and @image == 0
+ else
+ other == self
+ end
+ end
+ #
+ # Attempts to coerce +other+ to a Complex number.
+ #
+ def coerce(other)
+ if Complex.generic?(other)
+ return Complex.new!(other), self
+ else
+ super
+ end
+ end
+
+ #
+ # FIXME
+ #
+ def denominator
+ @real.denominator.lcm(@image.denominator)
+ end
+
+ #
+ # FIXME
+ #
+ def numerator
+ cd = denominator
+ Complex(@real.numerator*(cd/@real.denominator),
+ @image.numerator*(cd/@image.denominator))
+ end
+
+ #
+ # Standard string representation of the complex number.
+ #
+ def to_s
+ if @real != 0
+ if defined?(Rational) and @image.kind_of?(Rational) and @image.denominator != 1
+ if @image >= 0
+ @real.to_s+"+("+@image.to_s+")i"
+ else
+ @real.to_s+"-("+(-@image).to_s+")i"
+ end
+ else
+ if @image >= 0
+ @real.to_s+"+"+@image.to_s+"i"
+ else
+ @real.to_s+"-"+(-@image).to_s+"i"
+ end
+ end
+ else
+ if defined?(Rational) and @image.kind_of?(Rational) and @image.denominator != 1
+ "("+@image.to_s+")i"
+ else
+ @image.to_s+"i"
+ end
+ end
+ end
+
+ #
+ # Returns a hash code for the complex number.
+ #
+ def hash
+ @real.hash ^ @image.hash
+ end
+
+ #
+ # Returns "<tt>Complex(<i>real</i>, <i>image</i>)</tt>".
+ #
+ def inspect
+ sprintf("Complex(%s, %s)", @real.inspect, @image.inspect)
+ end
+
+
+ #
+ # +I+ is the imaginary number. It exists at point (0,1) on the complex plane.
+ #
+ I = Complex(0,1)
+
+ # The real part of a complex number.
+ attr :real
+
+ # The imaginary part of a complex number.
+ attr :image
+ alias imag image
+
end
-class Numeric
+class Integer
+
+ unless defined?(1.numerator)
+ def numerator() self end
+ def denominator() 1 end
+
+ def gcd(other)
+ min = self.abs
+ max = other.abs
+ while min > 0
+ tmp = min
+ min = max % min
+ max = tmp
+ end
+ max
+ end
+
+ def lcm(other)
+ if self.zero? or other.zero?
+ 0
+ else
+ (self.div(self.gcd(other)) * other).abs
+ end
+ end
- def im() Complex(0, self) end
+ end
end
+
+module Math
+ alias sqrt! sqrt
+ alias exp! exp
+ alias log! log
+ alias log10! log10
+ alias cos! cos
+ alias sin! sin
+ alias tan! tan
+ alias cosh! cosh
+ alias sinh! sinh
+ alias tanh! tanh
+ alias acos! acos
+ alias asin! asin
+ alias atan! atan
+ alias atan2! atan2
+ alias acosh! acosh
+ alias asinh! asinh
+ alias atanh! atanh
+
+ # Redefined to handle a Complex argument.
+ def sqrt(z)
+ if Complex.generic?(z)
+ if z >= 0
+ sqrt!(z)
+ else
+ Complex(0,sqrt!(-z))
+ end
+ else
+ if z.image < 0
+ sqrt(z.conjugate).conjugate
+ else
+ r = z.abs
+ x = z.real
+ Complex( sqrt!((r+x)/2), sqrt!((r-x)/2) )
+ end
+ end
+ end
+
+ # Redefined to handle a Complex argument.
+ def exp(z)
+ if Complex.generic?(z)
+ exp!(z)
+ else
+ Complex(exp!(z.real) * cos!(z.image), exp!(z.real) * sin!(z.image))
+ end
+ end
+
+ # Redefined to handle a Complex argument.
+ def cos(z)
+ if Complex.generic?(z)
+ cos!(z)
+ else
+ Complex(cos!(z.real)*cosh!(z.image),
+ -sin!(z.real)*sinh!(z.image))
+ end
+ end
+
+ # Redefined to handle a Complex argument.
+ def sin(z)
+ if Complex.generic?(z)
+ sin!(z)
+ else
+ Complex(sin!(z.real)*cosh!(z.image),
+ cos!(z.real)*sinh!(z.image))
+ end
+ end
+
+ # Redefined to handle a Complex argument.
+ def tan(z)
+ if Complex.generic?(z)
+ tan!(z)
+ else
+ sin(z)/cos(z)
+ end
+ end
+
+ def sinh(z)
+ if Complex.generic?(z)
+ sinh!(z)
+ else
+ Complex( sinh!(z.real)*cos!(z.image), cosh!(z.real)*sin!(z.image) )
+ end
+ end
+
+ def cosh(z)
+ if Complex.generic?(z)
+ cosh!(z)
+ else
+ Complex( cosh!(z.real)*cos!(z.image), sinh!(z.real)*sin!(z.image) )
+ end
+ end
+
+ def tanh(z)
+ if Complex.generic?(z)
+ tanh!(z)
+ else
+ sinh(z)/cosh(z)
+ end
+ end
+
+ # Redefined to handle a Complex argument.
+ def log(z)
+ if Complex.generic?(z) and z >= 0
+ log!(z)
+ else
+ r, theta = z.polar
+ Complex(log!(r.abs), theta)
+ end
+ end
+
+ # Redefined to handle a Complex argument.
+ def log10(z)
+ if Complex.generic?(z)
+ log10!(z)
+ else
+ log(z)/log!(10)
+ end
+ end
+
+ def acos(z)
+ if Complex.generic?(z) and z >= -1 and z <= 1
+ acos!(z)
+ else
+ -1.0.im * log( z + 1.0.im * sqrt(1.0-z*z) )
+ end
+ end
+
+ def asin(z)
+ if Complex.generic?(z) and z >= -1 and z <= 1
+ asin!(z)
+ else
+ -1.0.im * log( 1.0.im * z + sqrt(1.0-z*z) )
+ end
+ end
+
+ def atan(z)
+ if Complex.generic?(z)
+ atan!(z)
+ else
+ 1.0.im * log( (1.0.im+z) / (1.0.im-z) ) / 2.0
+ end
+ end
+
+ def atan2(y,x)
+ if Complex.generic?(y) and Complex.generic?(x)
+ atan2!(y,x)
+ else
+ -1.0.im * log( (x+1.0.im*y) / sqrt(x*x+y*y) )
+ end
+ end
+
+ def acosh(z)
+ if Complex.generic?(z) and z >= 1
+ acosh!(z)
+ else
+ log( z + sqrt(z*z-1.0) )
+ end
+ end
+
+ def asinh(z)
+ if Complex.generic?(z)
+ asinh!(z)
+ else
+ log( z + sqrt(1.0+z*z) )
+ end
+ end
+
+ def atanh(z)
+ if Complex.generic?(z) and z >= -1 and z <= 1
+ atanh!(z)
+ else
+ log( (1.0+z) / (1.0-z) ) / 2.0
+ end
+ end
+
+ module_function :sqrt!
+ module_function :sqrt
+ module_function :exp!
+ module_function :exp
+ module_function :log!
+ module_function :log
+ module_function :log10!
+ module_function :log10
+ module_function :cosh!
+ module_function :cosh
+ module_function :cos!
+ module_function :cos
+ module_function :sinh!
+ module_function :sinh
+ module_function :sin!
+ module_function :sin
+ module_function :tan!
+ module_function :tan
+ module_function :tanh!
+ module_function :tanh
+ module_function :acos!
+ module_function :acos
+ module_function :asin!
+ module_function :asin
+ module_function :atan!
+ module_function :atan
+ module_function :atan2!
+ module_function :atan2
+ module_function :acosh!
+ module_function :acosh
+ module_function :asinh!
+ module_function :asinh
+ module_function :atanh!
+ module_function :atanh
+
+end
+
+# Documentation comments:
+# - source: original (researched from pickaxe)
+# - a couple of fixme's
+# - RDoc output for Bignum etc. is a bit short, with nothing but an
+# (undocumented) alias. No big deal.
diff --git a/lib/csv.rb b/lib/csv.rb
index 862839a0e4..f6c12fa285 100644
--- a/lib/csv.rb
+++ b/lib/csv.rb
@@ -1,2308 +1,992 @@
-# encoding: UTF-8
-# = csv.rb -- CSV Reading and Writing
-#
-# 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.
-#
-# == Description
-#
-# 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
-# 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
-# core remains quite small.)
-# 3. Improve on the CSV interface.
-#
-# 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.
-#
-# We must have met our goals because FasterCSV was renamed to CSV and replaced
-# the original library.
-#
-# == 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 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
-# though.
-# * The old library returned empty lines as <tt>[nil]</tt>. This library calls
-# them <tt>[]</tt>.
-# * This library has a much faster parser.
-#
-# === Interface
-#
-# * CSV now uses Hash-style parameters to set options.
-# * CSV no longer has generate_row() or parse_row().
-# * The old CSV's Reader and Writer classes have been dropped.
-# * CSV::open() is now more like Ruby's open().
-# * CSV objects now support most standard IO methods.
-# * 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 allows the instance methods to override the separators for
-# 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].
-#
-# == Documentation
-#
-# See CSV for documentation.
-#
-# == 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
-# CSV.
-#
-# 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 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
-# easy as:
-#
-# data.split(",")
-#
-# == Questions and/or Comments
-#
-# Feel free to email {James Edward Gray II}[mailto:james@grayproductions.net]
-# with any questions.
-
-require "forwardable"
-require "English"
-require "date"
-require "stringio"
-
-#
-# 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.
-#
-# == Reading
-#
-# === From a File
-#
-# ==== A Line at a Time
-#
-# CSV.foreach("path/to/file.csv") do |row|
-# # use row here...
-# end
-#
-# ==== All at Once
-#
-# arr_of_arrs = CSV.read("path/to/file.csv")
-#
-# === From a String
-#
-# ==== A Line at a Time
-#
-# CSV.parse("CSV,data,String") do |row|
-# # use row here...
-# end
-#
-# ==== All at Once
-#
-# arr_of_arrs = CSV.parse("CSV,data,String")
-#
-# == Writing
-#
-# === To a File
-#
-# CSV.open("path/to/file.csv", "wb") do |csv|
-# csv << ["row", "of", "CSV", "data"]
-# csv << ["another", "row"]
-# # ...
-# end
-#
-# === To a String
-#
-# csv_string = CSV.generate do |csv|
-# csv << ["row", "of", "CSV", "data"]
-# csv << ["another", "row"]
-# # ...
-# end
-#
-# == Convert a Single Line
-#
-# csv_string = ["CSV", "data"].to_csv # to CSV
-# csv_array = "CSV,String".parse_csv # from CSV
-#
-# == 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 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
-# (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.
-#
-# Some transcoding must take place, of course, to accomplish this multiencoding
-# support. For example, <tt>:col_sep</tt>, <tt>:row_sep</tt>, and
-# <tt>:quote_char</tt> must be transcoded to match your data. Hopefully this
-# makes the entire process feel transparent, since CSV's defaults should just
-# magically work for you data. However, you can set these values manually in
-# 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
-# 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
-# conversions in all of Ruby's Encodings.
-#
-# 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
-# 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
-# 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.
-# Please feel free to {report}[mailto:james@grayproductions.net] any issues you
-# find with it.
-#
+# CSV -- module for generating/parsing CSV data.
+# Copyright (C) 2000-2004 NAKAMURA, Hiroshi <nakahiro@sarion.co.jp>.
+
+# $Id$
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
class CSV
- # The version of the installed library.
- VERSION = "2.4.5".freeze
-
- #
- # 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
+ class IllegalFormatError < RuntimeError; end
- # handle extra headers or fields
- @row = if headers.size > fields.size
- headers.zip(fields)
- else
- fields.zip(headers).map { |pair| pair.reverse }
- end
+ # deprecated
+ class Cell < String
+ def initialize(data = "", is_null = false)
+ super(is_null ? "" : data)
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
+ def data
+ to_s
end
+ end
- # Returns +true+ if this is a field row.
- def field_row?
- not header_row?
- end
+ # deprecated
+ class Row < Array
+ end
- # Returns the headers of this row.
- def headers
- @row.map { |pair| pair.first }
+ # Open a CSV formatted file for reading or writing.
+ #
+ # For reading.
+ #
+ # EXAMPLE 1
+ # CSV.open('csvfile.csv', 'r') do |row|
+ # p row
+ # end
+ #
+ # EXAMPLE 2
+ # reader = CSV.open('csvfile.csv', 'r')
+ # row1 = reader.shift
+ # row2 = reader.shift
+ # if row2.empty?
+ # p 'row2 not find.'
+ # end
+ # reader.close
+ #
+ # ARGS
+ # filename: filename to parse.
+ # col_sep: Column separator. ?, by default. If you want to separate
+ # fields with semicolon, give ?; here.
+ # row_sep: Row separator. nil by default. nil means "\r\n or \n". If you
+ # want to separate records with \r, give ?\r here.
+ #
+ # RETURNS
+ # reader instance. To get parse result, see CSV::Reader#each.
+ #
+ #
+ # For writing.
+ #
+ # EXAMPLE 1
+ # CSV.open('csvfile.csv', 'w') do |writer|
+ # writer << ['r1c1', 'r1c2']
+ # writer << ['r2c1', 'r2c2']
+ # writer << [nil, nil]
+ # end
+ #
+ # EXAMPLE 2
+ # writer = CSV.open('csvfile.csv', 'w')
+ # writer << ['r1c1', 'r1c2'] << ['r2c1', 'r2c2'] << [nil, nil]
+ # writer.close
+ #
+ # ARGS
+ # filename: filename to generate.
+ # col_sep: Column separator. ?, by default. If you want to separate
+ # fields with semicolon, give ?; here.
+ # row_sep: Row separator. nil by default. nil means "\r\n or \n". If you
+ # want to separate records with \r, give ?\r here.
+ #
+ # RETURNS
+ # writer instance. See CSV::Writer#<< and CSV::Writer#add_row to know how
+ # to generate CSV string.
+ #
+ def CSV.open(path, mode, fs = nil, rs = nil, &block)
+ if mode == 'r' or mode == 'rb'
+ open_reader(path, mode, fs, rs, &block)
+ elsif mode == 'w' or mode == 'wb'
+ open_writer(path, mode, fs, rs, &block)
+ else
+ raise ArgumentError.new("'mode' must be 'r', 'rb', 'w', or 'wb'")
end
+ end
- #
- # :call-seq:
- # field( header )
- # field( header, offset )
- # field( index )
- #
- # This method will fetch the field value by +header+ or +index+. If a field
- # is not found, +nil+ is returned.
- #
- # When provided, +offset+ ensures that a header match occurrs 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)
+ def CSV.foreach(path, rs = nil, &block)
+ open_reader(path, 'r', ',', rs, &block)
+ end
- # return the field if we have a pair
- pair.nil? ? nil : pair.last
+ def CSV.read(path, length = nil, offset = nil)
+ CSV.parse(IO.read(path, length, offset))
+ end
+
+ def CSV.readlines(path, rs = nil)
+ reader = open_reader(path, 'r', ',', rs)
+ begin
+ reader.collect { |row| row }
+ ensure
+ reader.close
end
- alias_method :[], :field
+ end
- #
- # :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
+ def CSV.generate(path, fs = nil, rs = nil, &block)
+ open_writer(path, 'w', fs, rs, &block)
+ end
- 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
+ # Parse lines from given string or stream. Return rows as an Array of Arrays.
+ def CSV.parse(str_or_readable, fs = nil, rs = nil, &block)
+ if File.exist?(str_or_readable)
+ STDERR.puts("CSV.parse(filename) is deprecated." +
+ " Use CSV.open(filename, 'r') instead.")
+ return open_reader(str_or_readable, 'r', fs, rs, &block)
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]
+ if block
+ CSV::Reader.parse(str_or_readable, fs, rs) do |row|
+ yield(row)
end
-
- self # for chaining
+ nil
+ else
+ CSV::Reader.create(str_or_readable, fs, rs).collect { |row| row }
end
+ 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
+ # Parse a line from given string. Bear in mind it parses ONE LINE. Rest of
+ # the string is ignored for example "a,b\r\nc,d" => ['a', 'b'] and the
+ # second line 'c,d' is ignored.
+ #
+ # If you don't know whether a target string to parse is exactly 1 line or
+ # not, use CSV.parse_row instead of this method.
+ def CSV.parse_line(src, fs = nil, rs = nil)
+ fs ||= ','
+ if fs.is_a?(Fixnum)
+ fs = fs.chr
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)
- else # by header
- @row.delete_at(index(header_or_index, minimum_index))
- end
+ if !rs.nil? and rs.is_a?(Fixnum)
+ rs = rs.chr
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
+ idx = 0
+ res_type = :DT_COLSEP
+ row = []
+ begin
+ while res_type == :DT_COLSEP
+ res_type, idx, cell = parse_body(src, idx, fs, rs)
+ row << cell
+ end
+ rescue IllegalFormatError
+ return []
end
+ row
+ 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))]
+ # Create a line from cells. each cell is stringified by to_s.
+ def CSV.generate_line(row, fs = nil, rs = nil)
+ if row.size == 0
+ return ''
+ end
+ fs ||= ','
+ if fs.is_a?(Fixnum)
+ fs = fs.chr
+ end
+ if !rs.nil? and rs.is_a?(Fixnum)
+ rs = rs.chr
+ end
+ res_type = :DT_COLSEP
+ result_str = ''
+ idx = 0
+ while true
+ generate_body(row[idx], result_str, fs, rs)
+ idx += 1
+ if (idx == row.size)
+ break
+ end
+ generate_separator(:DT_COLSEP, result_str, fs, rs)
+ end
+ result_str
+ end
+
+ # Parse a line from string. Consider using CSV.parse_line instead.
+ # To parse lines in CSV string, see EXAMPLE below.
+ #
+ # EXAMPLE
+ # src = "a,b\r\nc,d\r\ne,f"
+ # idx = 0
+ # begin
+ # parsed = []
+ # parsed_cells, idx = CSV.parse_row(src, idx, parsed)
+ # puts "Parsed #{ parsed_cells } cells."
+ # p parsed
+ # end while parsed_cells > 0
+ #
+ # ARGS
+ # src: a CSV data to be parsed. Must respond '[](idx)'.
+ # src[](idx) must return a char. (Not a string such as 'a', but 97).
+ # src[](idx_out_of_bounds) must return nil. A String satisfies this
+ # requirement.
+ # idx: index of parsing location of 'src'. 0 origin.
+ # out_dev: buffer for parsed cells. Must respond '<<(aString)'.
+ # col_sep: Column separator. ?, by default. If you want to separate
+ # fields with semicolon, give ?; here.
+ # row_sep: Row separator. nil by default. nil means "\r\n or \n". If you
+ # want to separate records with \r, give ?\r here.
+ #
+ # RETURNS
+ # parsed_cells: num of parsed cells.
+ # idx: index of next parsing location of 'src'.
+ #
+ def CSV.parse_row(src, idx, out_dev, fs = nil, rs = nil)
+ fs ||= ','
+ if fs.is_a?(Fixnum)
+ fs = fs.chr
+ end
+ if !rs.nil? and rs.is_a?(Fixnum)
+ rs = rs.chr
+ end
+ idx_backup = idx
+ parsed_cells = 0
+ res_type = :DT_COLSEP
+ begin
+ while res_type != :DT_ROWSEP
+ res_type, idx, cell = parse_body(src, idx, fs, rs)
+ if res_type == :DT_EOS
+ if idx == idx_backup #((parsed_cells == 0) and cell.nil?)
+ return 0, 0
end
+ res_type = :DT_ROWSEP
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)
- @row == other.row
- 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
+ parsed_cells += 1
+ out_dev << cell
+ end
+ rescue IllegalFormatError
+ return 0, 0
+ end
+ return parsed_cells, idx
+ end
+
+ # Convert a line from cells data to string. Consider using CSV.generate_line
+ # instead. To generate multi-row CSV string, see EXAMPLE below.
+ #
+ # EXAMPLE
+ # row1 = ['a', 'b']
+ # row2 = ['c', 'd']
+ # row3 = ['e', 'f']
+ # src = [row1, row2, row3]
+ # buf = ''
+ # src.each do |row|
+ # parsed_cells = CSV.generate_row(row, 2, buf)
+ # puts "Created #{ parsed_cells } cells."
+ # end
+ # p buf
+ #
+ # ARGS
+ # src: an Array of String to be converted to CSV string. Must respond to
+ # 'size' and '[](idx)'. src[idx] must return String.
+ # cells: num of cells in a line.
+ # out_dev: buffer for generated CSV string. Must respond to '<<(string)'.
+ # col_sep: Column separator. ?, by default. If you want to separate
+ # fields with semicolon, give ?; here.
+ # row_sep: Row separator. nil by default. nil means "\r\n or \n". If you
+ # want to separate records with \r, give ?\r here.
+ #
+ # RETURNS
+ # parsed_cells: num of converted cells.
+ #
+ def CSV.generate_row(src, cells, out_dev, fs = nil, rs = nil)
+ fs ||= ','
+ if fs.is_a?(Fixnum)
+ fs = fs.chr
+ end
+ if !rs.nil? and rs.is_a?(Fixnum)
+ rs = rs.chr
+ end
+ src_size = src.size
+ if (src_size == 0)
+ if cells == 0
+ generate_separator(:DT_ROWSEP, out_dev, fs, rs)
+ end
+ return 0
+ end
+ res_type = :DT_COLSEP
+ parsed_cells = 0
+ generate_body(src[parsed_cells], out_dev, fs, rs)
+ parsed_cells += 1
+ while ((parsed_cells < cells) and (parsed_cells != src_size))
+ generate_separator(:DT_COLSEP, out_dev, fs, rs)
+ generate_body(src[parsed_cells], out_dev, fs, rs)
+ parsed_cells += 1
+ end
+ if (parsed_cells == cells)
+ generate_separator(:DT_ROWSEP, out_dev, fs, rs)
+ else
+ generate_separator(:DT_COLSEP, out_dev, fs, rs)
end
+ parsed_cells
end
+
+ # Private class methods.
+ class << self
+ private
- #
- # 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
+ def open_reader(path, mode, fs, rs, &block)
+ file = File.open(path, mode)
+ if block
+ begin
+ CSV::Reader.parse(file, fs, rs) do |row|
+ yield(row)
+ end
+ ensure
+ file.close
+ end
+ nil
else
- @table.first.headers
+ reader = CSV::Reader.create(file, fs, rs)
+ reader.close_on_terminate
+ reader
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
+ def open_writer(path, mode, fs, rs, &block)
+ file = File.open(path, mode)
+ if block
+ begin
+ CSV::Writer.generate(file, fs, rs) do |writer|
+ yield(writer)
+ end
+ ensure
+ file.close
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]
+ nil
+ else
+ writer = CSV::Writer.create(file, fs, rs)
+ writer.close_on_terminate
+ writer
+ end
+ end
+
+ def parse_body(src, idx, fs, rs)
+ fs_str = fs
+ fs_size = fs_str.size
+ rs_str = rs || "\n"
+ rs_size = rs_str.size
+ fs_idx = rs_idx = 0
+ cell = Cell.new
+ state = :ST_START
+ quoted = cr = false
+ c = nil
+ last_idx = idx
+ while c = src[idx]
+ unless quoted
+ fschar = (c == fs_str[fs_idx])
+ rschar = (c == rs_str[rs_idx])
+ # simple 1 char backtrack
+ if !fschar and c == fs_str[0]
+ fs_idx = 0
+ fschar = true
+ if state == :ST_START
+ state = :ST_DATA
+ elsif state == :ST_QUOTE
+ raise IllegalFormatError
end
end
- else # repeated value
- @table.each do |row|
- if row.header_row?
- row[index_or_header] = index_or_header
+ if !rschar and c == rs_str[0]
+ rs_idx = 0
+ rschar = true
+ if state == :ST_START
+ state = :ST_DATA
+ elsif state == :ST_QUOTE
+ raise IllegalFormatError
+ end
+ end
+ end
+ if c == ?"
+ fs_idx = rs_idx = 0
+ if cr
+ raise IllegalFormatError
+ end
+ cell << src[last_idx, (idx - last_idx)]
+ last_idx = idx
+ if state == :ST_DATA
+ if quoted
+ last_idx += 1
+ quoted = false
+ state = :ST_QUOTE
else
- row[index_or_header] = value
+ raise IllegalFormatError
+ end
+ elsif state == :ST_QUOTE
+ cell << c.chr
+ last_idx += 1
+ quoted = true
+ state = :ST_DATA
+ else # :ST_START
+ quoted = true
+ last_idx += 1
+ state = :ST_DATA
+ end
+ elsif fschar or rschar
+ if fschar
+ fs_idx += 1
+ end
+ if rschar
+ rs_idx += 1
+ end
+ sep = nil
+ if fs_idx == fs_size
+ if state == :ST_START and rs_idx > 0 and fs_idx < rs_idx
+ state = :ST_DATA
+ end
+ cell << src[last_idx, (idx - last_idx - (fs_size - 1))]
+ last_idx = idx
+ fs_idx = rs_idx = 0
+ if cr
+ raise IllegalFormatError
+ end
+ sep = :DT_COLSEP
+ elsif rs_idx == rs_size
+ if state == :ST_START and fs_idx > 0 and rs_idx < fs_idx
+ state = :ST_DATA
+ end
+ if !(rs.nil? and cr)
+ cell << src[last_idx, (idx - last_idx - (rs_size - 1))]
+ last_idx = idx
end
+ fs_idx = rs_idx = 0
+ sep = :DT_ROWSEP
+ end
+ if sep
+ if state == :ST_DATA
+ return sep, idx + 1, cell;
+ elsif state == :ST_QUOTE
+ return sep, idx + 1, cell;
+ else # :ST_START
+ return sep, idx + 1, nil
+ end
+ end
+ elsif rs.nil? and c == ?\r
+ # special \r treatment for backward compatibility
+ fs_idx = rs_idx = 0
+ if cr
+ raise IllegalFormatError
+ end
+ cell << src[last_idx, (idx - last_idx)]
+ last_idx = idx
+ if quoted
+ state = :ST_DATA
+ else
+ cr = true
+ end
+ else
+ fs_idx = rs_idx = 0
+ if state == :ST_DATA or state == :ST_START
+ if cr
+ raise IllegalFormatError
+ end
+ state = :ST_DATA
+ else # :ST_QUOTE
+ raise IllegalFormatError
end
end
+ idx += 1
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, interation 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]]]
+ if state == :ST_START
+ if fs_idx > 0 or rs_idx > 0
+ state = :ST_DATA
+ else
+ return :DT_EOS, idx, nil
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, interation 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]]] }
+ elsif quoted
+ raise IllegalFormatError
+ elsif cr
+ raise IllegalFormatError
+ end
+ cell << src[last_idx, (idx - last_idx)]
+ last_idx = idx
+ return :DT_EOS, idx, cell
+ end
+
+ def generate_body(cell, out_dev, fs, rs)
+ if cell.nil?
+ # empty
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
+ cell = cell.to_s
+ row_data = cell.dup
+ if (row_data.gsub!('"', '""') or
+ row_data.index(fs) or
+ (rs and row_data.index(rs)) or
+ (/[\r\n]/ =~ row_data) or
+ (cell.empty?))
+ out_dev << '"' << row_data << '"'
else
- array + [row.fields]
+ out_dev << row_data
end
end
end
-
- #
- # Returns the table as a complete CSV String. Headers will be listed first,
- # then all of the field rows.
- #
- def to_csv(options = Hash.new)
- @table.inject([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")
+
+ def generate_separator(type, out_dev, fs, rs)
+ case type
+ when :DT_COLSEP
+ out_dev << fs
+ when :DT_ROWSEP
+ out_dev << (rs || "\n")
+ end
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
- # decisions based on field structure. See CSV.convert_fields() for an
- # example.
- #
- # <b><tt>index</tt></b>:: The zero-based index of the field in its row.
- # <b><tt>line</tt></b>:: The line of the data source this row is from.
- # <b><tt>header</tt></b>:: The header for the column, when available.
- #
- FieldInfo = Struct.new(:index, :line, :header)
-
- # A Regexp used to find and convert some common Date formats.
- DateMatcher = / \A(?: (\w+,?\s+)?\w+\s+\d{1,2},?\s+\d{2,4} |
- \d{4}-\d{2}-\d{2} )\z /x
- # 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} )\z /x
-
- # The encoding used by all converters.
- ConverterEncoding = Encoding.find("UTF-8")
-
- #
- # This Hash holds the built-in converters of CSV that can be accessed by name.
- # You can select Converters with CSV.convert() or through the +options+ Hash
- # passed to CSV::new().
- #
- # <b><tt>:integer</tt></b>:: Converts any field Integer() accepts.
- # <b><tt>:float</tt></b>:: Converts any field Float() accepts.
- # <b><tt>:numeric</tt></b>:: A combination of <tt>:integer</tt>
- # and <tt>:float</tt>.
- # <b><tt>:date</tt></b>:: Converts any field Date::parse() accepts.
- # <b><tt>:date_time</tt></b>:: Converts any field DateTime::parse() accepts.
- # <b><tt>:all</tt></b>:: All built-in converters. A combination of
- # <tt>:date_time</tt> and <tt>:numeric</tt>.
- #
- # All built-in converters transcode field data to UTF-8 before attempting a
- # conversion. If your data cannot be transcoded to UTF-8 the conversion will
- # fail and the field 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
- # can be nested with other combo fields.
- #
- Converters = { integer: lambda { |f|
- Integer(f.encode(ConverterEncoding)) rescue f
- },
- float: lambda { |f|
- Float(f.encode(ConverterEncoding)) rescue f
- },
- numeric: [:integer, :float],
- date: lambda { |f|
- begin
- e = f.encode(ConverterEncoding)
- e =~ DateMatcher ? Date.parse(e) : f
- rescue # encoding conversion or date parse errors
- f
- end
- },
- date_time: lambda { |f|
- begin
- e = f.encode(ConverterEncoding)
- e =~ DateTimeMatcher ? DateTime.parse(e) : f
- rescue # encoding conversion or date parse errors
- f
- end
- },
- all: [:date_time, :numeric] }
-
- #
- # 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
- # through the +options+ Hash passed to CSV::new().
- #
- # <b><tt>:downcase</tt></b>:: Calls downcase() on the header String.
- # <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
- # conversion will fail and the header will remain unchanged.
- #
- # This Hash is intetionally 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
- # can be nested with other combo fields.
- #
- HeaderConverters = {
- downcase: lambda { |h| h.encode(ConverterEncoding).downcase },
- symbol: lambda { |h|
- h.encode(ConverterEncoding).downcase.gsub(/\s+/, "_").
- gsub(/\W+/, "").to_sym
- }
- }
-
- #
- # 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>
- # <b><tt>:quote_char</tt></b>:: <tt>'"'</tt>
- # <b><tt>:field_size_limit</tt></b>:: +nil+
- # <b><tt>:converters</tt></b>:: +nil+
- # <b><tt>:unconverted_fields</tt></b>:: +nil+
- # <b><tt>:headers</tt></b>:: +false+
- # <b><tt>:return_headers</tt></b>:: +false+
- # <b><tt>:header_converters</tt></b>:: +nil+
- # <b><tt>:skip_blanks</tt></b>:: +false+
- # <b><tt>:force_quotes</tt></b>:: +false+
- #
- DEFAULT_OPTIONS = { col_sep: ",",
- row_sep: :auto,
- quote_char: '"',
- field_size_limit: nil,
- converters: nil,
- unconverted_fields: nil,
- headers: false,
- return_headers: false,
- header_converters: nil,
- skip_blanks: false,
- force_quotes: false }.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
-
- #
- # This method allows you to serialize an Array of Ruby objects to a String or
- # File of CSV data. This is not as powerful as Marshal or YAML, but perhaps
- # useful for spreadsheet and database interaction.
- #
- # Out of the box, this method is intended to work with simple data objects or
- # Structs. It will serialize a list of instance variables and/or
- # Struct.members().
- #
- # If you need need more complicated serialization, you can control the process
- # by adding methods to the class to be serialized.
- #
- # A class method csv_meta() is responsible for returning the first row of the
- # document (as an Array). This row is considered to be a Hash of the form
- # key_1,value_1,key_2,value_2,... CSV::load() expects to find a class key
- # with a value of the stringified class name and CSV::dump() will create this,
- # if you do not define this method. This method is only called on the first
- # object of the Array.
+ # CSV formatted string/stream reader.
#
- # The next method you can provide is an instance method called csv_headers().
- # This method is expected to return the second line of the document (again as
- # an Array), which is to be used to give each column a header. By default,
- # CSV::load() will set an instance variable if the field header starts with an
- # @ character or call send() passing the header as the method name and
- # the field value as an argument. This method is only called on the first
- # object of the Array.
+ # EXAMPLE
+ # read CSV lines untill the first column is 'stop'.
#
- # Finally, you can provide an instance method called csv_dump(), which will
- # be passed the headers. This should return an Array of fields that can be
- # serialized for this object. This method is called once for every object in
- # the Array.
+ # CSV::Reader.parse(File.open('bigdata', 'rb')) do |row|
+ # p row
+ # break if !row[0].is_null && row[0].data == 'stop'
+ # end
#
- # The +io+ parameter can be used to serialize to a File, and +options+ can be
- # anything CSV::new() accepts.
- #
- def self.dump(ary_of_objs, io = "", options = Hash.new)
- obj_template = ary_of_objs.first
-
- csv = new(io, options)
+ class Reader
+ include Enumerable
- # write meta information
- begin
- csv << obj_template.class.csv_meta
- rescue NoMethodError
- csv << [:class, obj_template.class]
+ # Parse CSV data and get lines. Given block is called for each parsed row.
+ # Block value is always nil. Rows are not cached for performance reason.
+ def Reader.parse(str_or_readable, fs = ',', rs = nil, &block)
+ reader = Reader.create(str_or_readable, fs, rs)
+ if block
+ reader.each do |row|
+ yield(row)
+ end
+ reader.close
+ nil
+ else
+ reader
+ end
end
- # write headers
- begin
- headers = obj_template.csv_headers
- rescue NoMethodError
- headers = obj_template.instance_variables.sort
- if obj_template.class.ancestors.find { |cls| cls.to_s =~ /\AStruct\b/ }
- headers += obj_template.members.map { |mem| "#{mem}=" }.sort
+ # Returns reader instance.
+ def Reader.create(str_or_readable, fs = ',', rs = nil)
+ case str_or_readable
+ when IO
+ IOReader.new(str_or_readable, fs, rs)
+ when String
+ StringReader.new(str_or_readable, fs, rs)
+ else
+ IOReader.new(str_or_readable, fs, rs)
end
end
- csv << headers
- # serialize each object
- ary_of_objs.each do |obj|
- begin
- csv << obj.csv_dump(headers)
- rescue NoMethodError
- csv << headers.map do |var|
- if var[0] == ?@
- obj.instance_variable_get(var)
- else
- obj[var[0..-2]]
- end
+ def each
+ while true
+ row = []
+ parsed_cells = get_row(row)
+ if parsed_cells == 0
+ break
end
+ yield(row)
end
+ nil
end
- if io.is_a? String
- csv.string
- else
- csv.close
+ def shift
+ row = []
+ parsed_cells = get_row(row)
+ row
end
- end
- #
- # This method is the reading counterpart to CSV::dump(). See that method for
- # a detailed description of the process.
- #
- # You can customize loading by adding a class method called csv_load() which
- # will be passed a Hash of meta information, an Array of headers, and an Array
- # of fields for the object the method is expected to return.
- #
- # Remember that all fields will be Strings after this load. If you need
- # something else, use +options+ to setup converters or provide a custom
- # csv_load() implementation.
- #
- def self.load(io_or_str, options = Hash.new)
- csv = new(io_or_str, options)
-
- # load meta information
- meta = Hash[*csv.shift]
- cls = meta["class".encode(csv.encoding)].split("::".encode(csv.encoding)).
- inject(Object) do |c, const|
- c.const_get(const)
+ def close
+ terminate
end
- # load headers
- headers = csv.shift
+ private
- # unserialize each object stored in the file
- results = csv.inject(Array.new) do |all, row|
- begin
- obj = cls.csv_load(meta, headers, row)
- rescue NoMethodError
- obj = cls.allocate
- headers.zip(row) do |name, value|
- if name[0] == ?@
- obj.instance_variable_set(name, value)
- else
- obj.send(name, value)
- end
- end
- end
- all << obj
+ def initialize(dev)
+ raise RuntimeError.new('Do not instanciate this class directly.')
end
- csv.close unless io_or_str.is_a? String
-
- results
- end
-
- #
- # :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
- when /\Aout(?:put)?_(.+)\Z/
- out_options[$1.to_sym] = value
- else
- in_options[key] = value
- out_options[key] = value
- end
- end
+ def get_row(row)
+ raise NotImplementedError.new('Method get_row must be defined in a derived class.')
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
+ def terminate
+ # Define if needed.
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 deterime 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)
- encoding = options.delete(:encoding)
- mode = "rb"
- mode << ":#{encoding}" if encoding
- open(path, mode, options) do |csv|
- csv.each(&block)
+ class StringReader < Reader
+ def initialize(string, fs = ',', rs = nil)
+ @fs = fs
+ @rs = rs
+ @dev = string
+ @idx = 0
+ if @dev[0, 3] == "\xef\xbb\xbf"
+ @idx += 3
+ end
end
- end
- #
- # :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* modfied by this method. Call dup() before
- # passing if you need a new String.
- #
- # The +options+ parameter can be anthing 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.last.is_a?(Hash) ? args.last.delete(:encoding) : nil
- str = ""
- str.encode!(encoding) if encoding
- args.unshift(str)
- end
- csv = new(*args) # wrap
- yield csv # yield for appending
- csv.string # return final String
- end
+ private
- #
- # This method is a shortcut for converting a single row (Array) into a CSV
- # String.
- #
- # The +options+ parameter can be anthing 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)
+ def get_row(row)
+ parsed_cells, next_idx = CSV.parse_row(@dev, @idx, row, @fs, @rs)
+ if parsed_cells == 0 and next_idx == 0 and @idx != @dev.size
+ raise IllegalFormatError.new
+ end
+ @idx = next_idx
+ parsed_cells
end
- (new(str, options) << row).string
end
- #
- # :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 deterime 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
- # default to a binary open mode
- args << "rb" if args.size == 1
- # wrap a File opened with the remaining +args+
- csv = new(File.open(*args), options)
- # handle blocks like Ruby's open(), not like the CSV library
- if block_given?
- begin
- yield csv
- ensure
- csv.close
+ class IOReader < Reader
+ def initialize(io, fs = ',', rs = nil)
+ @io = io
+ @fs = fs
+ @rs = rs
+ @dev = CSV::IOBuf.new(@io)
+ @idx = 0
+ if @dev[0] == 0xef and @dev[1] == 0xbb and @dev[2] == 0xbf
+ @idx += 3
end
- else
- csv
+ @close_on_terminate = false
end
- end
- #
- # :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)
+ # Tell this reader to close the IO when terminated (Triggered by invoking
+ # CSV::IOReader#close).
+ def close_on_terminate
+ @close_on_terminate = true
end
- end
-
- #
- # This method is a shortcut for converting a single line of a CSV String into
- # a into an Array. Note that if +line+ contains multiple rows, anything
- # beyond the first row is ignored.
- #
- # The +options+ parameter can be anthing 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 deterime
- # 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 = Hash.new)
- encoding = options.delete(:encoding)
- mode = "rb"
- mode << ":#{encoding}" if encoding
- open(path, mode, options) { |csv| csv.read }
- 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 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
- # a String for +data+, you can later retrieve it (after writing to it, for
- # example) with CSV.string().
- #
- # Note that a wrapped String will be positioned at at the beginning (for
- # 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.
- # Available options are:
- #
- # <b><tt>:col_sep</tt></b>:: The String placed between each field.
- # 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
- # <tt>:auto</tt> setting, which requests
- # that CSV automatically discover this
- # 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
- # 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
- # 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
- # note that IO objects should be opened
- # in binary mode on Windows if this
- # feature will be used as the
- # line-ending translation can cause
- # problems with resetting the document
- # position to where it was before the
- # read ahead. This String will be
- # transcoded into the data's Encoding
- # 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
- # application that incorrectly use
- # <tt>'</tt> as the quote character
- # instead of the correct <tt>"</tt>.
- # CSV will always consider a double
- # sequence this character to be an
- # escaped quote. This String will be
- # transcoded into the data's Encoding
- # 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
- # the first line ending beyond this
- # 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
- # prevent what are effectively DoS
- # 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
- # built-in converters try to transcode
- # fields to UTF-8 before converting.
- # The conversion will fail if the data
- # cannot be transcoded, leaving the
- # field unchanged.
- # <b><tt>:unconverted_fields</tt></b>:: If set to +true+, an
- # 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
- # that <tt>:headers</tt> supplied by
- # Array or String were not fields of the
- # document and thus will have an empty
- # Array attached.
- # <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
- # 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
- # 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
- # rows are returned in a CSV::Row object
- # with identical headers and
- # fields (save that the fields do not go
- # through the converters).
- # <b><tt>:write_headers</tt></b>:: When +true+ and <tt>:headers</tt> is
- # set, a header row will be added to the
- # output.
- # <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
- # transcode headers to UTF-8 before
- # converting. The conversion will fail
- # if the data cannot be transcoded,
- # leaving the header unchanged.
- # <b><tt>:skip_blanks</tt></b>:: When set to a +true+ value, CSV will
- # skip over any rows with no content.
- # <b><tt>:force_quotes</tt></b>:: When set to a +true+ value, CSV will
- # quote all CSV fields it creates.
- #
- # See CSV::DEFAULT_OPTIONS for the default settings.
- #
- # Options cannot be overriden in the instance methods for performance reasons,
- # so be sure to set what you want here.
- #
- def initialize(data, options = Hash.new)
- # build the options for this read/write
- options = DEFAULT_OPTIONS.merge(options)
-
- # create the IO object we will read from
- @io = if data.is_a? String then StringIO.new(data) else data end
- # honor the IO encoding if we can, otherwise default to ASCII-8BIT
- @encoding = if @io.respond_to? :internal_encoding
- @io.internal_encoding || @io.external_encoding
- elsif @io.is_a? StringIO
- @io.string.encoding
- end
- @encoding ||= 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 = %w[ \\ . [ ] - ^ $ ?
- * + { } ( ) | #
- \ \r \n \t \f \v ].
- map { |s| s.encode(@encoding) rescue nil }.compact
-
- init_separators(options)
- init_parsers(options)
- init_converters(options)
- init_headers(options)
+ private
- unless options.empty?
- raise ArgumentError, "Unknown options: #{options.keys.join(', ')}."
+ def get_row(row)
+ parsed_cells, next_idx = CSV.parse_row(@dev, @idx, row, @fs, @rs)
+ if parsed_cells == 0 and next_idx == 0 and !@dev.is_eos?
+ raise IllegalFormatError.new
+ end
+ dropped = @dev.drop(next_idx)
+ @idx = next_idx - dropped
+ parsed_cells
end
- # track our own lineno since IO gets confused about line-ends is CSV fields
- @lineno = 0
- end
+ def terminate
+ if @close_on_terminate
+ @io.close
+ end
- #
- # The encoded <tt>:col_sep</tt> used in parsing and writing. See CSV::new
- # for details.
- #
- attr_reader :col_sep
- #
- # The encoded <tt>:row_sep</tt> used in parsing and writing. See CSV::new
- # for details.
- #
- attr_reader :row_sep
- #
- # The encoded <tt>:quote_char</tt> used in parsing and writing. See CSV::new
- # for details.
- #
- attr_reader :quote_char
- # The limit for field size, if any. See CSV::new for details.
- attr_reader :field_size_limit
- #
- # 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
- @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.
- #
- 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.
- #
- def headers
- @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?() @return_headers end
- # Returns +true+ if headers are written in output. See CSV::new for details.
- def write_headers?() @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
- # will be returned as is.
- #
- def header_converters
- @header_converters.map do |converter|
- name = HeaderConverters.rassoc(converter)
- name ? name.first : converter
+ if @dev
+ @dev.close
+ end
end
end
- #
- # Returns +true+ blank lines are skipped by the parser. See CSV::new
- # for details.
- #
- def skip_blanks?() @skip_blanks end
- # Returns +true+ if all output fields are quoted. See CSV::new for details.
- def force_quotes?() @force_quotes end
- #
- # The Encoding CSV is parsing or writing in. This will be the Encoding you
- # receive parsed data in and/or the Encoding data will be written in.
- #
- attr_reader :encoding
+ # CSV formatted string/stream writer.
#
- # The line number of the last row read from this file. Fields with nested
- # line-end characters will not affect this count.
+ # EXAMPLE
+ # Write rows to 'csvout' file.
#
- attr_reader :lineno
-
- ### IO and StringIO Delegation ###
-
- extend Forwardable
- 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
- @headers = nil
- @lineno = 0
-
- @io.rewind
- end
-
- ### End Delegation ###
-
- #
- # 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 passed, only the row's fields() are appended to the output.
+ # outfile = File.open('csvout', 'wb')
+ # CSV::Writer.generate(outfile) do |csv|
+ # csv << ['c1', nil, '', '"', "\r\n", 'c2']
+ # ...
+ # end
#
- # The data source must be open for writing.
+ # outfile.close
#
- def <<(row)
- # 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
+ class Writer
+ # Given block is called with the writer instance. str_or_writable must
+ # handle '<<(string)'.
+ def Writer.generate(str_or_writable, fs = ',', rs = nil, &block)
+ writer = Writer.create(str_or_writable, fs, rs)
+ if block
+ yield(writer)
+ writer.close
+ nil
+ else
+ writer
+ end
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
-
- @io << row.map(&@quote).join(@col_sep) + @row_sep # quote and separate
-
- self # for chaining
- end
- alias_method :add_row, :<<
- alias_method :puts, :<<
+ # str_or_writable must handle '<<(string)'.
+ def Writer.create(str_or_writable, fs = ',', rs = nil)
+ BasicWriter.new(str_or_writable, fs, rs)
+ end
- #
- # :call-seq:
- # convert( name )
- # convert { |field| ... }
- # convert { |field, field_info| ... }
- #
- # You can use this method to install a CSV::Converters built-in, or provide a
- # 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
- # block takes two arguments, it will also be passed a CSV::FieldInfo Struct,
- # containing details about the field. Again, the block should return a
- # converted field or the field itself.
- #
- def convert(name = nil, &converter)
- add_converter(:converters, self.class::Converters, name, &converter)
- end
+ # dump CSV stream to the device. argument must be an Array of String.
+ def <<(row)
+ CSV.generate_row(row, row.size, @dev, @fs, @rs)
+ self
+ end
+ alias add_row <<
- #
- # :call-seq:
- # header_convert( name )
- # header_convert { |field| ... }
- # header_convert { |field, field_info| ... }
- #
- # Identical to CSV#convert(), but for header rows.
- #
- # Note that this method must be called before header rows are read to have any
- # effect.
- #
- def header_convert(name = nil, &converter)
- add_converter( :header_converters,
- self.class::HeaderConverters,
- name,
- &converter )
- end
+ def close
+ terminate
+ end
- include Enumerable
+ private
- #
- # Yields each row of the data source in turn.
- #
- # Support for Enumerable.
- #
- # The data source must be open for reading.
- #
- def each
- while row = shift
- yield row
+ def initialize(dev)
+ raise RuntimeError.new('Do not instanciate this class directly.')
end
- end
- #
- # Slurps the remaining rows and returns an Array of Arrays.
- #
- # The data source must be open for reading.
- #
- def read
- rows = to_a
- if @use_headers
- Table.new(rows)
- else
- rows
+ def terminate
+ # Define if needed.
end
end
- alias_method :readlines, :read
- # Returns +true+ if the next row read will be a header row.
- def header_row?
- @use_headers and @headers.nil?
- end
- #
- # The primary read method for wrapped Strings and IOs, a single row is pulled
- # from the data source, parsed and returned as an Array of fields (if header
- # rows are not used) or a CSV::Row (when header rows are used).
- #
- # The data source must be open for reading.
- #
- def shift
- #########################################################################
- ### 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
+ class BasicWriter < Writer
+ def initialize(str_or_writable, fs = ',', rs = nil)
+ @fs = fs
+ @rs = rs
+ @dev = str_or_writable
+ @close_on_terminate = false
end
- # begin with a blank line, so we can always add to it
- line = ""
+ # Tell this writer to close the IO when terminated (Triggered by invoking
+ # CSV::BasicWriter#close).
+ def close_on_terminate
+ @close_on_terminate = true
+ end
- #
- # 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
- #
- loop do
- # add another read to the line
- (line += @io.gets(@row_sep)) rescue return nil
- # copy the line so we can chop it up in parsing
- parse = line.dup
- parse.sub!(@parsers[:line_end], "")
+ private
- #
- # 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
- line = ""
- next
- elsif @unconverted_fields
- return add_unconverted_fields(Array.new, Array.new)
- elsif @use_headers
- return self.class::Row.new(Array.new, Array.new)
+ def terminate
+ if @close_on_terminate
+ @dev.close
+ end
+ end
+ end
+
+private
+
+ # Buffered stream.
+ #
+ # EXAMPLE 1 -- an IO.
+ # class MyBuf < StreamBuf
+ # # Do initialize myself before a super class. Super class might call my
+ # # method 'read'. (Could be awful for C++ user. :-)
+ # def initialize(s)
+ # @s = s
+ # super()
+ # end
+ #
+ # # define my own 'read' method.
+ # # CAUTION: Returning nil means EnfOfStream.
+ # def read(size)
+ # @s.read(size)
+ # end
+ #
+ # # release buffers. in Ruby which has GC, you do not have to call this...
+ # def terminate
+ # @s = nil
+ # super()
+ # end
+ # end
+ #
+ # buf = MyBuf.new(STDIN)
+ # my_str = ''
+ # p buf[0, 0] # => '' (null string)
+ # p buf[0] # => 97 (char code of 'a')
+ # p buf[0, 1] # => 'a'
+ # my_str = buf[0, 5]
+ # p my_str # => 'abcde' (5 chars)
+ # p buf[0, 6] # => "abcde\n" (6 chars)
+ # p buf[0, 7] # => "abcde\n" (6 chars)
+ # p buf.drop(3) # => 3 (dropped chars)
+ # p buf.get(0, 2) # => 'de' (2 chars)
+ # p buf.is_eos? # => false (is not EOS here)
+ # p buf.drop(5) # => 3 (dropped chars)
+ # p buf.is_eos? # => true (is EOS here)
+ # p buf[0] # => nil (is EOS here)
+ #
+ # EXAMPLE 2 -- String.
+ # This is a conceptual example. No pros with this.
+ #
+ # class StrBuf < StreamBuf
+ # def initialize(s)
+ # @str = s
+ # @idx = 0
+ # super()
+ # end
+ #
+ # def read(size)
+ # str = @str[@idx, size]
+ # @idx += str.size
+ # str
+ # end
+ # end
+ #
+ class StreamBuf
+ # get a char or a partial string from the stream.
+ # idx: index of a string to specify a start point of a string to get.
+ # unlike String instance, idx < 0 returns nil.
+ # n: size of a string to get.
+ # returns char at idx if n == nil.
+ # returns a partial string, from idx to (idx + n) if n != nil. at EOF,
+ # the string size could not equal to arg n.
+ def [](idx, n = nil)
+ if idx < 0
+ return nil
+ end
+ if (idx_is_eos?(idx))
+ if n and (@offset + idx == buf_size(@cur_buf))
+ # Like a String, 'abc'[4, 1] returns nil and
+ # 'abc'[3, 1] returns '' not nil.
+ return ''
else
- return Array.new
+ return nil
end
end
-
- #
- # shave leading empty fields if needed, because the main parser chokes
- # on these
- #
- csv = if parse.sub!(@parsers[:leading_fields], "")
- [nil] * ($&.length / @col_sep.length)
- else
- Array.new
- end
- #
- # then parse the main fields with a hyper-tuned Regexp from
- # Mastering Regular Expressions, Second Edition
- #
- parse.gsub!(@parsers[:csv_row]) do
- csv << if $1.nil? # we found an unquoted field
- if $2.empty? # switch empty unquoted fields to +nil+...
- nil # for Ruby 1.8 CSV compatibility
- else
- # I decided to take a strict approach to CSV parsing...
- if $2.count(@parsers[:return_newline]).zero? # verify correctness
- $2
- else
- # or throw an Exception
- raise MalformedCSVError, "Unquoted fields do not allow " +
- "\\r or \\n (line #{lineno + 1})."
- end
+ my_buf = @cur_buf
+ my_offset = @offset
+ next_idx = idx
+ while (my_offset + next_idx >= buf_size(my_buf))
+ if (my_buf == @buf_tail_idx)
+ unless add_buf
+ break
end
- else # we found a quoted field...
- $1.gsub(@quote_char * 2, @quote_char) # unescape contents
- end
- "" # gsub!'s replacement, clear the field
- end
-
- # if parse is empty?(), we found all the fields on the line...
- if parse.empty?
- @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
- # if we're not empty?() but at eof?(), a quoted field wasn't closed...
- if @io.eof?
- raise MalformedCSVError, "Unclosed quoted field on line #{lineno + 1}."
- elsif parse =~ @parsers[:bad_field]
- raise MalformedCSVError, "Illegal quoting on line #{lineno + 1}."
- elsif @field_size_limit and parse.length >= @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
- end
- end
- alias_method :gets, :shift
- alias_method :readline, :shift
-
- #
- # Returns a simplified description of the key FasterCSV attributes in an
- # ASCII compatible String.
- #
- def inspect
- str = ["<#", self.class.to_s, " io_type:"]
- # show type of wrapped IO
- if @io == $stdout then str << "$stdout"
- elsif @io == $stdin then str << "$stdin"
- elsif @io == $stderr then str << "$stderr"
- else str << @io.class.to_s
- end
- # show IO.path(), if available
- if @io.respond_to?(:path) and (p = @io.path)
- str << " io_path:" << p.inspect
- end
- # show encoding
- str << " encoding:" << @encoding.name
- # show other attributes
- %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
- if @use_headers
- str << " headers:" << headers.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
-
- private
-
- #
- # 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 @quote_char.length != 1
- raise ArgumentError, ":quote_char has to be a single character String"
- end
-
- #
- # 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
- saved_pos = @io.pos # remember where we were
- while @row_sep == :auto
- #
- # if we run out of data, it's probably a single line
- # (use a sensible default)
- #
- if @io.eof?
- @row_sep = $INPUT_RECORD_SEPARATOR
- break
- end
-
- # read ahead a bit
- sample = read_to_char(1024)
- sample += read_to_char(1) if sample[-1..-1] == encode_str("\r") and
- not @io.eof?
-
- # 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
+ next_idx = my_offset + next_idx - buf_size(my_buf)
+ my_buf += 1
+ my_offset = 0
+ end
+ loc = my_offset + next_idx
+ if !n
+ return @buf_list[my_buf][loc] # Fixnum of char code.
+ elsif (loc + n - 1 < buf_size(my_buf))
+ return @buf_list[my_buf][loc, n] # String.
+ else # should do loop insted of (tail) recursive call...
+ res = @buf_list[my_buf][loc, BufSize]
+ size_added = buf_size(my_buf) - loc
+ if size_added > 0
+ idx += size_added
+ n -= size_added
+ ret = self[idx, n]
+ if ret
+ res << ret
end
- @io.read(saved_pos) if saved_pos.nonzero?
- rescue IOError # stream not opened for reading
- @row_sep = $INPUT_RECORD_SEPARATOR
end
- end
- end
- @row_sep = @row_sep.to_s.encode(@encoding)
-
- # establish quoting rules
- @force_quotes = options.delete(:force_quotes)
- do_quote = lambda do |field|
- @quote_char +
- String(field).gsub(@quote_char, @quote_char * 2) +
- @quote_char
- end
- quotable_chars = encode_str("\r\n", @col_sep, @quote_char)
- @quote = if @force_quotes
- do_quote
- else
- 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)
+ return res
+ end
+ end
+ alias get []
+
+ # drop a string from the stream.
+ # returns dropped size. at EOF, dropped size might not equals to arg n.
+ # Once you drop the head of the stream, access to the dropped part via []
+ # or get returns nil.
+ def drop(n)
+ if is_eos?
+ return 0
+ end
+ size_dropped = 0
+ while (n > 0)
+ if !@is_eos or (@cur_buf != @buf_tail_idx)
+ if (@offset + n < buf_size(@cur_buf))
+ size_dropped += n
+ @offset += n
+ n = 0
else
- field # unquoted field
+ size = buf_size(@cur_buf) - @offset
+ size_dropped += size
+ n -= size
+ @offset = 0
+ unless rel_buf
+ unless add_buf
+ break
+ end
+ @cur_buf = @buf_tail_idx
+ end
end
end
end
+ size_dropped
+ end
+
+ def is_eos?
+ return idx_is_eos?(0)
+ end
+
+ # WARN: Do not instantiate this class directly. Define your own class
+ # which derives this class and define 'read' instance method.
+ def initialize
+ @buf_list = []
+ @cur_buf = @buf_tail_idx = -1
+ @offset = 0
+ @is_eos = false
+ add_buf
+ @cur_buf = @buf_tail_idx
+ end
+
+ protected
+
+ def terminate
+ while (rel_buf); end
+ end
+
+ # protected method 'read' must be defined in derived classes.
+ # CAUTION: Returning a string which size is not equal to 'size' means
+ # EnfOfStream. When it is not at EOS, you must block the callee, try to
+ # read and return the sized string.
+ def read(size) # raise EOFError
+ raise NotImplementedError.new('Method read must be defined in a derived class.')
+ end
+
+ private
+
+ def buf_size(idx)
+ @buf_list[idx].size
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_col_sep = escape_re(@col_sep)
- esc_row_sep = escape_re(@row_sep)
- esc_quote = escape_re(@quote_char)
- @parsers = {
- # for empty leading fields
- leading_fields: encode_re("\\A(?:", esc_col_sep, ")+"),
- # The Primary Parser
- csv_row: encode_re(
- "\\G(?:\\A|", esc_col_sep, ")", # anchor the match
- "(?:", esc_quote, # find quoted fields
- "((?>[^", esc_quote, "]*)", # "unrolling the loop"
- "(?>", esc_quote * 2, # double for escaping
- "[^", esc_quote, "]*)*)",
- esc_quote,
- "|", # ... or ...
- "([^", esc_quote, esc_col_sep, "]*))", # unquoted fields
- "(?=", esc_col_sep, "|\\z)" # ensure field is ended
- ),
- # a test for unescaped quotes
- bad_field: encode_re(
- "\\A", esc_col_sep, "?", # an optional comma
- "(?:", esc_quote, # a quoted field
- "(?>[^", esc_quote, "]*)", # "unrolling the loop"
- "(?>", esc_quote * 2, # double for escaping
- "[^", esc_quote, "]*)*",
- esc_quote, # the closing quote
- "[^", esc_quote, "]", # an extra character
- "|", # ... or ...
- "[^", esc_quote, esc_col_sep, "]+", # an unquoted field
- esc_quote, ")" # an extra quote
- ),
- # safer than chomp!()
- line_end: encode_re(esc_row_sep, "\\z"),
- # illegal unquoted characters
- return_newline: encode_str("\r\n")
- }
- end
-
- #
- # Loads any converters requested during construction.
- #
- # 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
-
- instance_variable_set("@#{field_name}", Array.new)
- # find the correct method to add the converters
- convert = method(field_name.to_s.sub(/ers\Z/, ""))
-
- # load converters
- 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]]
+ def add_buf
+ if @is_eos
+ return false
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
+ begin
+ str_read = read(BufSize)
+ rescue EOFError
+ str_read = nil
+ rescue
+ terminate
+ raise
+ end
+ if str_read.nil?
+ @is_eos = true
+ @buf_list.push('')
+ @buf_tail_idx += 1
+ false
+ else
+ @buf_list.push(str_read)
+ @buf_tail_idx += 1
+ true
end
end
-
- options.delete(field_name)
- end
-
- # Stores header row settings and loads header converters, if needed.
- def init_headers(options)
- @use_headers = options.delete(:headers)
- @return_headers = options.delete(:return_headers)
- @write_headers = options.delete(:write_headers)
-
- # headers must be delayed until shift(), in case they need a row of content
- @headers = nil
-
- init_converters(options, :header_converters)
- end
-
- #
- # 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
+
+ def rel_buf
+ if (@cur_buf < 0)
+ return false
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)
- # see if we are converting headers or fields
- converters = headers ? @header_converters : @converters
-
- fields.map.with_index do |field, index|
- converters.each do |converter|
- 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-curcuit pipeline for speed
+ @buf_list[@cur_buf] = nil
+ if (@cur_buf == @buf_tail_idx)
+ @cur_buf = -1
+ return false
+ else
+ @cur_buf += 1
+ return true
end
- field # final state of each field, converted or original
end
- end
-
- #
- # This methods 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)
-
- 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
+
+ def idx_is_eos?(idx)
+ (@is_eos and ((@cur_buf < 0) or (@cur_buf == @buf_tail_idx)))
end
-
- self.class::Row.new(@headers, convert_fields(row)) # field row
+
+ BufSize = 1024 * 8
end
+ # Buffered IO.
#
- # Thiw methods injects an instance variable <tt>unconverted_fields</tt> into
- # +row+ and an accessor method for it called unconverted_fields(). The
- # variable is set to the contents of +fields+.
+ # EXAMPLE
+ # # File 'bigdata' could be a giga-byte size one!
+ # buf = CSV::IOBuf.new(File.open('bigdata', 'rb'))
+ # CSV::Reader.new(buf).each do |row|
+ # p row
+ # break if row[0].data == 'admin'
+ # end
#
- def add_unconverted_fields(row, fields)
- class << row
- attr_reader :unconverted_fields
+ class IOBuf < StreamBuf
+ def initialize(s)
+ @s = s
+ super()
end
- row.instance_eval { @unconverted_fields = fields }
- row
- end
-
- #
- # 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.chars.map { |c| @re_chars.include?(c) ? @re_esc + c : c }.join
- end
-
- #
- # 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
-
- #
- # 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
-
- #
- # Reads at least +bytes+ from <tt>@io</tt>, but will read up 10 bytes ahead if
- # needed to ensure the data read is valid in the ecoding of that data. This
- # should ensure that it is safe to use regular expressions on the read data,
- # unless it is actually a broken encoding. The read data will be returned in
- # <tt>@encoding</tt>.
- #
- def read_to_char(bytes)
- return "" if @io.eof?
- data = @io.read(bytes)
- begin
- encoded = encode_str(data)
- raise unless encoded.valid_encoding?
- return encoded
- rescue # encoding error or my invalid data raise
- if @io.eof? or data.size >= bytes + 10
- return data
- else
- data += @io.read(1)
- retry
- end
+
+ def close
+ terminate
end
- end
-end
-# Another name for CSV::instance().
-def CSV(*args, &block)
- CSV.instance(*args, &block)
-end
-
-class Array
- # Equivalent to <tt>CSV::generate_line(self, options)</tt>.
- def to_csv(options = Hash.new)
- CSV.generate_line(self, options)
- end
-end
+ private
-class String
- # Equivalent to <tt>CSV::parse_line(self, options)</tt>.
- def parse_csv(options = Hash.new)
- CSV.parse_line(self, options)
+ def read(size)
+ @s.read(size)
+ end
+
+ def terminate
+ super()
+ end
end
end
diff --git a/lib/date.rb b/lib/date.rb
index ce1d327127..19991d60b4 100644
--- a/lib/date.rb
+++ b/lib/date.rb
@@ -193,6 +193,7 @@
#
# puts secs_to_new_year()
+require 'rational'
require 'date/format'
# Class representing a date.
@@ -327,392 +328,235 @@ class Date
UNIX_EPOCH_IN_CJD = 2440588 # :nodoc:
LD_EPOCH_IN_CJD = 2299160 # :nodoc:
- t = Module.new do
-
- private
-
- def find_fdoy(y, sg) # :nodoc:
- j = nil
- 1.upto(31) do |d|
- break if j = _valid_civil?(y, 1, d, sg)
+ # Does a given Julian Day Number fall inside the old-style (Julian)
+ # calendar?
+ #
+ # +jd+ is the Julian Day Number in question. +sg+ may be Date::GREGORIAN,
+ # in which case the answer is false; it may be Date::JULIAN, in which case
+ # the answer is true; or it may a number representing the Day of
+ # Calendar Reform. Date::ENGLAND and Date::ITALY are two possible such
+ # days.
+
+ def self.julian? (jd, sg)
+ case sg
+ when Numeric
+ jd < sg
+ else
+ if $VERBOSE
+ warn("#{caller.shift.sub(/:in .*/, '')}: " \
+"warning: do not use non-numerical object as julian day number anymore")
end
- j
+ not sg
end
+ end
- def find_ldoy(y, sg) # :nodoc:
- j = nil
- 31.downto(1) do |d|
- break if j = _valid_civil?(y, 12, d, sg)
- end
- j
- end
+ # Does a given Julian Day Number fall inside the new-style (Gregorian)
+ # calendar?
+ #
+ # The reverse of self.os? See the documentation for that method for
+ # more details.
+ def self.gregorian? (jd, sg) !julian?(jd, sg) end
- def find_fdom(y, m, sg) # :nodoc:
- j = nil
- 1.upto(31) do |d|
- break if j = _valid_civil?(y, m, d, sg)
- end
- j
- end
+ def self.fix_style(jd, sg) # :nodoc:
+ if julian?(jd, sg)
+ then JULIAN
+ else GREGORIAN end
+ end
- def find_ldom(y, m, sg) # :nodoc:
- j = nil
- 31.downto(1) do |d|
- break if j = _valid_civil?(y, m, d, sg)
- end
- j
- end
+ private_class_method :fix_style
- # Convert an Ordinal Date to a Julian Day Number.
- #
- # +y+ and +d+ are the year and day-of-year to convert.
- # +sg+ specifies the Day of Calendar Reform.
- #
- # Returns the corresponding Julian Day Number.
- def ordinal_to_jd(y, d, sg=GREGORIAN) # :nodoc:
- find_fdoy(y, sg) + d - 1
- end
+ # Convert an Ordinal Date to a Julian Day Number.
+ #
+ # +y+ and +d+ are the year and day-of-year to convert.
+ # +sg+ specifies the Day of Calendar Reform.
+ #
+ # Returns the corresponding Julian Day Number.
+ def self.ordinal_to_jd(y, d, sg=GREGORIAN)
+ civil_to_jd(y, 1, d, sg)
+ end
- # Convert a Julian Day Number to an Ordinal Date.
- #
- # +jd+ is the Julian Day Number to convert.
- # +sg+ specifies the Day of Calendar Reform.
- #
- # Returns the corresponding Ordinal Date as
- # [year, day_of_year]
- def jd_to_ordinal(jd, sg=GREGORIAN) # :nodoc:
- y = jd_to_civil(jd, sg)[0]
- j = find_fdoy(y, sg)
- doy = jd - j + 1
- return y, doy
- end
+ # Convert a Julian Day Number to an Ordinal Date.
+ #
+ # +jd+ is the Julian Day Number to convert.
+ # +sg+ specifies the Day of Calendar Reform.
+ #
+ # Returns the corresponding Ordinal Date as
+ # [year, day_of_year]
+ def self.jd_to_ordinal(jd, sg=GREGORIAN)
+ y = jd_to_civil(jd, sg)[0]
+ doy = jd - civil_to_jd(y - 1, 12, 31, fix_style(jd, sg))
+ return y, doy
+ end
- # Convert a Civil Date to a Julian Day Number.
- # +y+, +m+, and +d+ are the year, month, and day of the
- # month. +sg+ specifies the Day of Calendar Reform.
- #
- # Returns the corresponding Julian Day Number.
- def civil_to_jd(y, m, d, sg=GREGORIAN) # :nodoc:
- if m <= 2
- y -= 1
- m += 12
- end
- a = (y / 100.0).floor
- b = 2 - a + (a / 4.0).floor
- jd = (365.25 * (y + 4716)).floor +
- (30.6001 * (m + 1)).floor +
- d + b - 1524
- if jd < sg
- jd -= b
- end
- jd
+ # Convert a Civil Date to a Julian Day Number.
+ # +y+, +m+, and +d+ are the year, month, and day of the
+ # month. +sg+ specifies the Day of Calendar Reform.
+ #
+ # Returns the corresponding Julian Day Number.
+ def self.civil_to_jd(y, m, d, sg=GREGORIAN)
+ if m <= 2
+ y -= 1
+ m += 12
end
-
- # Convert a Julian Day Number to a Civil Date. +jd+ is
- # the Julian Day Number. +sg+ specifies the Day of
- # Calendar Reform.
- #
- # Returns the corresponding [year, month, day_of_month]
- # as a three-element array.
- def jd_to_civil(jd, sg=GREGORIAN) # :nodoc:
- if jd < sg
- a = jd
- else
- x = ((jd - 1867216.25) / 36524.25).floor
- a = jd + 1 + x - (x / 4.0).floor
- end
- b = a + 1524
- c = ((b - 122.1) / 365.25).floor
- d = (365.25 * c).floor
- e = ((b - d) / 30.6001).floor
- dom = b - d - (30.6001 * e).floor
- if e <= 13
- m = e - 1
- y = c - 4716
- else
- m = e - 13
- y = c - 4715
- end
- return y, m, dom
+ a = (y / 100.0).floor
+ b = 2 - a + (a / 4.0).floor
+ jd = (365.25 * (y + 4716)).floor +
+ (30.6001 * (m + 1)).floor +
+ d + b - 1524
+ if julian?(jd, sg)
+ jd -= b
end
+ jd
+ end
- # Convert a Commercial Date to a Julian Day Number.
- #
- # +y+, +w+, and +d+ are the (commercial) year, week of the year,
- # and day of the week of the Commercial Date to convert.
- # +sg+ specifies the Day of Calendar Reform.
- def commercial_to_jd(y, w, d, sg=GREGORIAN) # :nodoc:
- j = find_fdoy(y, sg) + 3
- (j - (((j - 1) + 1) % 7)) +
- 7 * (w - 1) +
- (d - 1)
+ # Convert a Julian Day Number to a Civil Date. +jd+ is
+ # the Julian Day Number. +sg+ specifies the Day of
+ # Calendar Reform.
+ #
+ # Returns the corresponding [year, month, day_of_month]
+ # as a three-element array.
+ def self.jd_to_civil(jd, sg=GREGORIAN)
+ if julian?(jd, sg)
+ a = jd
+ else
+ x = ((jd - 1867216.25) / 36524.25).floor
+ a = jd + 1 + x - (x / 4.0).floor
end
-
- # Convert a Julian Day Number to a Commercial Date
- #
- # +jd+ is the Julian Day Number to convert.
- # +sg+ specifies the Day of Calendar Reform.
- #
- # Returns the corresponding Commercial Date as
- # [commercial_year, week_of_year, day_of_week]
- def jd_to_commercial(jd, sg=GREGORIAN) # :nodoc:
- a = jd_to_civil(jd - 3, sg)[0]
- y = if jd >= commercial_to_jd(a + 1, 1, 1, sg) then a + 1 else a end
- w = 1 + ((jd - commercial_to_jd(y, 1, 1, sg)) / 7).floor
- d = (jd + 1) % 7
- d = 7 if d == 0
- return y, w, d
+ b = a + 1524
+ c = ((b - 122.1) / 365.25).floor
+ d = (365.25 * c).floor
+ e = ((b - d) / 30.6001).floor
+ dom = b - d - (30.6001 * e).floor
+ if e <= 13
+ m = e - 1
+ y = c - 4716
+ else
+ m = e - 13
+ y = c - 4715
end
+ return y, m, dom
+ end
- def weeknum_to_jd(y, w, d, f=0, sg=GREGORIAN) # :nodoc:
- a = find_fdoy(y, sg) + 6
- (a - ((a - f) + 1) % 7 - 7) + 7 * w + d
- end
+ # Convert a Commercial Date to a Julian Day Number.
+ #
+ # +y+, +w+, and +d+ are the (commercial) year, week of the year,
+ # and day of the week of the Commercial Date to convert.
+ # +sg+ specifies the Day of Calendar Reform.
+ def self.commercial_to_jd(y, w, d, ns=GREGORIAN)
+ jd = civil_to_jd(y, 1, 4, ns)
+ (jd - (((jd - 1) + 1) % 7)) +
+ 7 * (w - 1) +
+ (d - 1)
+ end
- def jd_to_weeknum(jd, f=0, sg=GREGORIAN) # :nodoc:
- y, m, d = jd_to_civil(jd, sg)
- a = find_fdoy(y, sg) + 6
- w, d = (jd - (a - ((a - f) + 1) % 7) + 7).divmod(7)
- return y, w, d
- end
+ # Convert a Julian Day Number to a Commercial Date
+ #
+ # +jd+ is the Julian Day Number to convert.
+ # +sg+ specifies the Day of Calendar Reform.
+ #
+ # Returns the corresponding Commercial Date as
+ # [commercial_year, week_of_year, day_of_week]
+ def self.jd_to_commercial(jd, sg=GREGORIAN)
+ ns = fix_style(jd, sg)
+ a = jd_to_civil(jd - 3, ns)[0]
+ y = if jd >= commercial_to_jd(a + 1, 1, 1, ns) then a + 1 else a end
+ w = 1 + ((jd - commercial_to_jd(y, 1, 1, ns)) / 7).floor
+ d = (jd + 1) % 7
+ d = 7 if d == 0
+ return y, w, d
+ end
- def nth_kday_to_jd(y, m, n, k, sg=GREGORIAN) # :nodoc:
- j = if n > 0
- find_fdom(y, m, sg) - 1
- else
- find_ldom(y, m, sg) + 7
- end
- (j - (((j - k) + 1) % 7)) + 7 * n
- end
+ def self.weeknum_to_jd(y, w, d, f=0, ns=GREGORIAN) # :nodoc:
+ a = civil_to_jd(y, 1, 1, ns) + 6
+ (a - ((a - f) + 1) % 7 - 7) + 7 * w + d
+ end
- def jd_to_nth_kday(jd, sg=GREGORIAN) # :nodoc:
- y, m, d = jd_to_civil(jd, sg)
- j = find_fdom(y, m, sg)
- return y, m, ((jd - j) / 7).floor + 1, jd_to_wday(jd)
- end
+ def self.jd_to_weeknum(jd, f=0, sg=GREGORIAN) # :nodoc:
+ ns = fix_style(jd, sg)
+ y, m, d = jd_to_civil(jd, ns)
+ a = civil_to_jd(y, 1, 1, ns) + 6
+ w, d = (jd - (a - ((a - f) + 1) % 7) + 7).divmod(7)
+ return y, w, d
+ end
- # Convert an Astronomical Julian Day Number to a (civil) Julian
- # Day Number.
- #
- # +ajd+ is the Astronomical Julian Day Number to convert.
- # +of+ is the offset from UTC as a fraction of a day (defaults to 0).
- #
- # Returns the (civil) Julian Day Number as [day_number,
- # fraction] where +fraction+ is always 1/2.
- def ajd_to_jd(ajd, of=0) (ajd + of + HALF_DAYS_IN_DAY).divmod(1) end # :nodoc:
-
- # Convert a (civil) Julian Day Number to an Astronomical Julian
- # Day Number.
- #
- # +jd+ is the Julian Day Number to convert, and +fr+ is a
- # fractional day.
- # +of+ is the offset from UTC as a fraction of a day (defaults to 0).
- #
- # Returns the Astronomical Julian Day Number as a single
- # numeric value.
- def jd_to_ajd(jd, fr, of=0) jd + fr - of - HALF_DAYS_IN_DAY end # :nodoc:
-
- # Convert a fractional day +fr+ to [hours, minutes, seconds,
- # fraction_of_a_second]
- def day_fraction_to_time(fr) # :nodoc:
- ss, fr = fr.divmod(SECONDS_IN_DAY) # 4p
- h, ss = ss.divmod(3600)
- min, s = ss.divmod(60)
- return h, min, s, fr * 86400
- end
+ private_class_method :weeknum_to_jd, :jd_to_weeknum
+
+ # Convert an Astronomical Julian Day Number to a (civil) Julian
+ # Day Number.
+ #
+ # +ajd+ is the Astronomical Julian Day Number to convert.
+ # +of+ is the offset from UTC as a fraction of a day (defaults to 0).
+ #
+ # Returns the (civil) Julian Day Number as [day_number,
+ # fraction] where +fraction+ is always 1/2.
+ def self.ajd_to_jd(ajd, of=0) (ajd + of + HALF_DAYS_IN_DAY).divmod(1) end
- # Convert an +h+ hour, +min+ minutes, +s+ seconds period
- # to a fractional day.
- begin
- Rational(Rational(1, 2), 2) # a challenge
+ # Convert a (civil) Julian Day Number to an Astronomical Julian
+ # Day Number.
+ #
+ # +jd+ is the Julian Day Number to convert, and +fr+ is a
+ # fractional day.
+ # +of+ is the offset from UTC as a fraction of a day (defaults to 0).
+ #
+ # Returns the Astronomical Julian Day Number as a single
+ # numeric value.
+ def self.jd_to_ajd(jd, fr, of=0) jd + fr - of - HALF_DAYS_IN_DAY end
- def time_to_day_fraction(h, min, s)
- Rational(h * 3600 + min * 60 + s, 86400) # 4p
- end
- rescue
- def time_to_day_fraction(h, min, s)
+ # Convert a fractional day +fr+ to [hours, minutes, seconds,
+ # fraction_of_a_second]
+ def self.day_fraction_to_time(fr)
+ ss, fr = fr.divmod(SECONDS_IN_DAY) # 4p
+ h, ss = ss.divmod(3600)
+ min, s = ss.divmod(60)
+ return h, min, s, fr
+ end
+
+ # Convert an +h+ hour, +min+ minutes, +s+ seconds period
+ # to a fractional day.
+ begin
+ Rational(Rational(1, 2), 2) # a challenge
+
+ def self.time_to_day_fraction(h, min, s)
+ Rational(h * 3600 + min * 60 + s, 86400) # 4p
+ end
+ rescue
+ def self.time_to_day_fraction(h, min, s)
if Integer === h && Integer === min && Integer === s
Rational(h * 3600 + min * 60 + s, 86400) # 4p
else
(h * 3600 + min * 60 + s).to_r/86400 # 4p
end
- end
end
+ end
- # Convert an Astronomical Modified Julian Day Number to an
- # Astronomical Julian Day Number.
- def amjd_to_ajd(amjd) amjd + MJD_EPOCH_IN_AJD end # :nodoc:
-
- # Convert an Astronomical Julian Day Number to an
- # Astronomical Modified Julian Day Number.
- def ajd_to_amjd(ajd) ajd - MJD_EPOCH_IN_AJD end # :nodoc:
-
- # Convert a Modified Julian Day Number to a Julian
- # Day Number.
- def mjd_to_jd(mjd) mjd + MJD_EPOCH_IN_CJD end # :nodoc:
-
- # Convert a Julian Day Number to a Modified Julian Day
- # Number.
- def jd_to_mjd(jd) jd - MJD_EPOCH_IN_CJD end # :nodoc:
-
- # Convert a count of the number of days since the adoption
- # of the Gregorian Calendar (in Italy) to a Julian Day Number.
- def ld_to_jd(ld) ld + LD_EPOCH_IN_CJD end # :nodoc:
-
- # Convert a Julian Day Number to the number of days since
- # the adoption of the Gregorian Calendar (in Italy).
- def jd_to_ld(jd) jd - LD_EPOCH_IN_CJD end # :nodoc:
-
- # Convert a Julian Day Number to the day of the week.
- #
- # Sunday is day-of-week 0; Saturday is day-of-week 6.
- def jd_to_wday(jd) (jd + 1) % 7 end # :nodoc:
-
- # Is +jd+ a valid Julian Day Number?
- #
- # If it is, returns it. In fact, any value is treated as a valid
- # Julian Day Number.
- def _valid_jd? (jd, sg=GREGORIAN) jd end # :nodoc:
-
- # Do the year +y+ and day-of-year +d+ make a valid Ordinal Date?
- # Returns the corresponding Julian Day Number if they do, or
- # nil if they don't.
- #
- # +d+ can be a negative number, in which case it counts backwards
- # from the end of the year (-1 being the last day of the year).
- # No year wraparound is performed, however, so valid values of
- # +d+ are -365 .. -1, 1 .. 365 on a non-leap-year,
- # -366 .. -1, 1 .. 366 on a leap year.
- # A date falling in the period skipped in the Day of Calendar Reform
- # adjustment is not valid.
- #
- # +sg+ specifies the Day of Calendar Reform.
- def _valid_ordinal? (y, d, sg=GREGORIAN) # :nodoc:
- if d < 0
- j = find_ldoy(y, sg)
- ny, nd = jd_to_ordinal(j + d + 1, sg)
- return unless ny == y
- d = nd
- end
- jd = ordinal_to_jd(y, d, sg)
- return unless [y, d] == jd_to_ordinal(jd, sg)
- jd
- end
+ # Convert an Astronomical Modified Julian Day Number to an
+ # Astronomical Julian Day Number.
+ def self.amjd_to_ajd(amjd) amjd + MJD_EPOCH_IN_AJD end
- # Do year +y+, month +m+, and day-of-month +d+ make a
- # valid Civil Date? Returns the corresponding Julian
- # Day Number if they do, nil if they don't.
- #
- # +m+ and +d+ can be negative, in which case they count
- # backwards from the end of the year and the end of the
- # month respectively. No wraparound is performed, however,
- # and invalid values cause an ArgumentError to be raised.
- # A date falling in the period skipped in the Day of Calendar
- # Reform adjustment is not valid.
- #
- # +sg+ specifies the Day of Calendar Reform.
- def _valid_civil? (y, m, d, sg=GREGORIAN) # :nodoc:
- if m < 0
- m += 13
- end
- if d < 0
- j = find_ldom(y, m, sg)
- ny, nm, nd = jd_to_civil(j + d + 1, sg)
- return unless [ny, nm] == [y, m]
- d = nd
- end
- jd = civil_to_jd(y, m, d, sg)
- return unless [y, m, d] == jd_to_civil(jd, sg)
- jd
- end
+ # Convert an Astronomical Julian Day Number to an
+ # Astronomical Modified Julian Day Number.
+ def self.ajd_to_amjd(ajd) ajd - MJD_EPOCH_IN_AJD end
- # Do year +y+, week-of-year +w+, and day-of-week +d+ make a
- # valid Commercial Date? Returns the corresponding Julian
- # Day Number if they do, nil if they don't.
- #
- # Monday is day-of-week 1; Sunday is day-of-week 7.
- #
- # +w+ and +d+ can be negative, in which case they count
- # backwards from the end of the year and the end of the
- # week respectively. No wraparound is performed, however,
- # and invalid values cause an ArgumentError to be raised.
- # A date falling in the period skipped in the Day of Calendar
- # Reform adjustment is not valid.
- #
- # +sg+ specifies the Day of Calendar Reform.
- def _valid_commercial? (y, w, d, sg=GREGORIAN) # :nodoc:
- if d < 0
- d += 8
- end
- if w < 0
- ny, nw, nd =
- jd_to_commercial(commercial_to_jd(y + 1, 1, 1, sg) + w * 7, sg)
- return unless ny == y
- w = nw
- end
- jd = commercial_to_jd(y, w, d, sg)
- return unless [y, w, d] == jd_to_commercial(jd, sg)
- jd
- end
-
- def _valid_weeknum? (y, w, d, f, sg=GREGORIAN) # :nodoc:
- if d < 0
- d += 7
- end
- if w < 0
- ny, nw, nd, nf =
- jd_to_weeknum(weeknum_to_jd(y + 1, 1, f, f, sg) + w * 7, f, sg)
- return unless ny == y
- w = nw
- end
- jd = weeknum_to_jd(y, w, d, f, sg)
- return unless [y, w, d] == jd_to_weeknum(jd, f, sg)
- jd
- end
+ # Convert a Modified Julian Day Number to a Julian
+ # Day Number.
+ def self.mjd_to_jd(mjd) mjd + MJD_EPOCH_IN_CJD end
- def _valid_nth_kday? (y, m, n, k, sg=GREGORIAN) # :nodoc:
- if k < 0
- k += 7
- end
- if n < 0
- ny, nm = (y * 12 + m).divmod(12)
- nm, = (nm + 1) .divmod(1)
- ny, nm, nn, nk =
- jd_to_nth_kday(nth_kday_to_jd(ny, nm, 1, k, sg) + n * 7, sg)
- return unless [ny, nm] == [y, m]
- n = nn
- end
- jd = nth_kday_to_jd(y, m, n, k, sg)
- return unless [y, m, n, k] == jd_to_nth_kday(jd, sg)
- jd
- end
+ # Convert a Julian Day Number to a Modified Julian Day
+ # Number.
+ def self.jd_to_mjd(jd) jd - MJD_EPOCH_IN_CJD end
- # Do hour +h+, minute +min+, and second +s+ constitute a valid time?
- #
- # If they do, returns their value as a fraction of a day. If not,
- # returns nil.
- #
- # The 24-hour clock is used. Negative values of +h+, +min+, and
- # +sec+ are treating as counting backwards from the end of the
- # next larger unit (e.g. a +min+ of -2 is treated as 58). No
- # wraparound is performed.
- def _valid_time? (h, min, s) # :nodoc:
- h += 24 if h < 0
- min += 60 if min < 0
- s += 60 if s < 0
- return unless ((0...24) === h &&
- (0...60) === min &&
- (0...60) === s) ||
- (24 == h &&
- 0 == min &&
- 0 == s)
- time_to_day_fraction(h, min, s)
- end
+ # Convert a count of the number of days since the adoption
+ # of the Gregorian Calendar (in Italy) to a Julian Day Number.
+ def self.ld_to_jd(ld) ld + LD_EPOCH_IN_CJD end
- end
+ # Convert a Julian Day Number to the number of days since
+ # the adoption of the Gregorian Calendar (in Italy).
+ def self.jd_to_ld(jd) jd - LD_EPOCH_IN_CJD end
- extend t
- include t
+ # Convert a Julian Day Number to the day of the week.
+ #
+ # Sunday is day-of-week 0; Saturday is day-of-week 6.
+ def self.jd_to_wday(jd) (jd + 1) % 7 end
# Is a year a leap year in the Julian calendar?
#
@@ -728,49 +572,148 @@ class Date
class << self; alias_method :leap?, :gregorian_leap? end
class << self; alias_method :new!, :new end
- def self.valid_jd? (jd, sg=ITALY)
- !!_valid_jd?(jd, sg)
- end
+ # Is +jd+ a valid Julian Day Number?
+ #
+ # If it is, returns it. In fact, any value is treated as a valid
+ # Julian Day Number.
+ def self.valid_jd? (jd, sg=ITALY) jd end
+ # Do the year +y+ and day-of-year +d+ make a valid Ordinal Date?
+ # Returns the corresponding Julian Day Number if they do, or
+ # nil if they don't.
+ #
+ # +d+ can be a negative number, in which case it counts backwards
+ # from the end of the year (-1 being the last day of the year).
+ # No year wraparound is performed, however, so valid values of
+ # +d+ are -365 .. -1, 1 .. 365 on a non-leap-year,
+ # -366 .. -1, 1 .. 366 on a leap year.
+ # A date falling in the period skipped in the Day of Calendar Reform
+ # adjustment is not valid.
+ #
+ # +sg+ specifies the Day of Calendar Reform.
def self.valid_ordinal? (y, d, sg=ITALY)
- !!_valid_ordinal?(y, d, sg)
+ if d < 0
+ ny, = (y + 1).divmod(1)
+ jd = ordinal_to_jd(ny, d + 1, sg)
+ ns = fix_style(jd, sg)
+ return unless [y] == jd_to_ordinal(jd, sg)[0..0]
+ return unless [ny, 1] == jd_to_ordinal(jd - d, ns)
+ else
+ jd = ordinal_to_jd(y, d, sg)
+ return unless [y, d] == jd_to_ordinal(jd, sg)
+ end
+ jd
end
+ # Do year +y+, month +m+, and day-of-month +d+ make a
+ # valid Civil Date? Returns the corresponding Julian
+ # Day Number if they do, nil if they don't.
+ #
+ # +m+ and +d+ can be negative, in which case they count
+ # backwards from the end of the year and the end of the
+ # month respectively. No wraparound is performed, however,
+ # and invalid values cause an ArgumentError to be raised.
+ # A date falling in the period skipped in the Day of Calendar
+ # Reform adjustment is not valid.
+ #
+ # +sg+ specifies the Day of Calendar Reform.
def self.valid_civil? (y, m, d, sg=ITALY)
- !!_valid_civil?(y, m, d, sg)
+ if m < 0
+ m += 13
+ end
+ if d < 0
+ ny, nm = (y * 12 + m).divmod(12)
+ nm, = (nm + 1).divmod(1)
+ jd = civil_to_jd(ny, nm, d + 1, sg)
+ ns = fix_style(jd, sg)
+ return unless [y, m] == jd_to_civil(jd, sg)[0..1]
+ return unless [ny, nm, 1] == jd_to_civil(jd - d, ns)
+ else
+ jd = civil_to_jd(y, m, d, sg)
+ return unless [y, m, d] == jd_to_civil(jd, sg)
+ end
+ jd
end
class << self; alias_method :valid_date?, :valid_civil? end
+ # Do year +y+, week-of-year +w+, and day-of-week +d+ make a
+ # valid Commercial Date? Returns the corresponding Julian
+ # Day Number if they do, nil if they don't.
+ #
+ # Monday is day-of-week 1; Sunday is day-of-week 7.
+ #
+ # +w+ and +d+ can be negative, in which case they count
+ # backwards from the end of the year and the end of the
+ # week respectively. No wraparound is performed, however,
+ # and invalid values cause an ArgumentError to be raised.
+ # A date falling in the period skipped in the Day of Calendar
+ # Reform adjustment is not valid.
+ #
+ # +sg+ specifies the Day of Calendar Reform.
def self.valid_commercial? (y, w, d, sg=ITALY)
- !!_valid_commercial?(y, w, d, sg)
+ if d < 0
+ d += 8
+ end
+ if w < 0
+ ny, nw, nd =
+ jd_to_commercial(commercial_to_jd(y + 1, 1, 1) + w * 7)
+ return unless ny == y
+ w = nw
+ end
+ jd = commercial_to_jd(y, w, d)
+ return unless gregorian?(jd, sg)
+ return unless [y, w, d] == jd_to_commercial(jd)
+ jd
end
def self.valid_weeknum? (y, w, d, f, sg=ITALY) # :nodoc:
- !!_valid_weeknum?(y, w, d, f, sg)
+ if d < 0
+ d += 7
+ end
+ if w < 0
+ ny, nw, nd, nf =
+ jd_to_weeknum(weeknum_to_jd(y + 1, 1, f, f) + w * 7, f)
+ return unless ny == y
+ w = nw
+ end
+ jd = weeknum_to_jd(y, w, d, f)
+ return unless gregorian?(jd, sg)
+ return unless [y, w, d] == jd_to_weeknum(jd, f)
+ jd
end
private_class_method :valid_weeknum?
- def self.valid_nth_kday? (y, m, n, k, sg=ITALY) # :nodoc:
- !!_valid_nth_kday?(y, m, n, k, sg)
- end
-
- private_class_method :valid_nth_kday?
-
- def self.valid_time? (h, min, s) # :nodoc:
- !!_valid_time?(h, min, s)
+ # Do hour +h+, minute +min+, and second +s+ constitute a valid time?
+ #
+ # If they do, returns their value as a fraction of a day. If not,
+ # returns nil.
+ #
+ # The 24-hour clock is used. Negative values of +h+, +min+, and
+ # +sec+ are treating as counting backwards from the end of the
+ # next larger unit (e.g. a +min+ of -2 is treated as 58). No
+ # wraparound is performed.
+ def self.valid_time? (h, min, s)
+ h += 24 if h < 0
+ min += 60 if min < 0
+ s += 60 if s < 0
+ return unless ((0...24) === h &&
+ (0...60) === min &&
+ (0...60) === s) ||
+ (24 == h &&
+ 0 == min &&
+ 0 == s)
+ time_to_day_fraction(h, min, s)
end
- private_class_method :valid_time?
-
# Create a new Date object from a Julian Day Number.
#
# +jd+ is the Julian Day Number; if not specified, it defaults to
# 0.
# +sg+ specifies the Day of Calendar Reform.
def self.jd(jd=0, sg=ITALY)
- jd = _valid_jd?(jd, sg)
+ jd = valid_jd?(jd, sg)
new!(jd_to_ajd(jd, 0, 0), 0, sg)
end
@@ -785,7 +728,7 @@ class Date
#
# +sg+ specifies the Day of Calendar Reform.
def self.ordinal(y=-4712, d=1, sg=ITALY)
- unless jd = _valid_ordinal?(y, d, sg)
+ unless jd = valid_ordinal?(y, d, sg)
raise ArgumentError, 'invalid date'
end
new!(jd_to_ajd(jd, 0, 0), 0, sg)
@@ -805,7 +748,7 @@ class Date
#
# +sg+ specifies the Day of Calendar Reform.
def self.civil(y=-4712, m=1, d=1, sg=ITALY)
- unless jd = _valid_civil?(y, m, d, sg)
+ unless jd = valid_civil?(y, m, d, sg)
raise ArgumentError, 'invalid date'
end
new!(jd_to_ajd(jd, 0, 0), 0, sg)
@@ -823,19 +766,19 @@ class Date
# week respectively. No wraparound is performed, however,
# and invalid values cause an ArgumentError to be raised.
#
- # +y+ defaults to -4712, +w+ to 1, and +d+ to 1; this is
- # Julian Day Number day 0.
+ # +y+ defaults to 1582, +w+ to 41, and +d+ to 5, the Day of
+ # Calendar Reform for Italy and the Catholic countries.
#
# +sg+ specifies the Day of Calendar Reform.
- def self.commercial(y=-4712, w=1, d=1, sg=ITALY)
- unless jd = _valid_commercial?(y, w, d, sg)
+ def self.commercial(y=1582, w=41, d=5, sg=ITALY)
+ unless jd = valid_commercial?(y, w, d, sg)
raise ArgumentError, 'invalid date'
end
new!(jd_to_ajd(jd, 0, 0), 0, sg)
end
- def self.weeknum(y=-4712, w=0, d=1, f=0, sg=ITALY)
- unless jd = _valid_weeknum?(y, w, d, f, sg)
+ def self.weeknum(y=1582, w=41, d=5, f=0, sg=ITALY) # :nodoc:
+ unless jd = valid_weeknum?(y, w, d, f, sg)
raise ArgumentError, 'invalid date'
end
new!(jd_to_ajd(jd, 0, 0), 0, sg)
@@ -843,15 +786,6 @@ class Date
private_class_method :weeknum
- def self.nth_kday(y=-4712, m=1, n=1, k=1, sg=ITALY)
- unless jd = _valid_nth_kday?(y, m, n, k, sg)
- raise ArgumentError, 'invalid date'
- end
- new!(jd_to_ajd(jd, 0, 0), 0, sg)
- end
-
- private_class_method :nth_kday
-
def self.rewrite_frags(elem) # :nodoc:
elem ||= {}
if seconds = elem[:seconds]
@@ -952,21 +886,21 @@ class Date
catch :jd do
a = elem.values_at(:jd)
if a.all?
- if jd = _valid_jd?(*(a << sg))
+ if jd = valid_jd?(*(a << sg))
throw :jd, jd
end
end
a = elem.values_at(:year, :yday)
if a.all?
- if jd = _valid_ordinal?(*(a << sg))
+ if jd = valid_ordinal?(*(a << sg))
throw :jd, jd
end
end
a = elem.values_at(:year, :mon, :mday)
if a.all?
- if jd = _valid_civil?(*(a << sg))
+ if jd = valid_civil?(*(a << sg))
throw :jd, jd
end
end
@@ -976,7 +910,7 @@ class Date
a[2] = elem[:wday].nonzero? || 7
end
if a.all?
- if jd = _valid_commercial?(*(a << sg))
+ if jd = valid_commercial?(*(a << sg))
throw :jd, jd
end
end
@@ -986,7 +920,7 @@ class Date
a[2] = elem[:cwday] % 7
end
if a.all?
- if jd = _valid_weeknum?(*(a << 0 << sg))
+ if jd = valid_weeknum?(*(a << 0 << sg))
throw :jd, jd
end
end
@@ -999,7 +933,7 @@ class Date
a[2] = (elem[:cwday] - 1) % 7
end
if a.all?
- if jd = _valid_weeknum?(*(a << 1 << sg))
+ if jd = valid_weeknum?(*(a << 1 << sg))
throw :jd, jd
end
end
@@ -1010,7 +944,7 @@ class Date
def self.valid_time_frags? (elem) # :nodoc:
h, min, s = elem.values_at(:hour, :min, :sec)
- _valid_time?(h, min, s)
+ valid_time?(h, min, s)
end
private_class_method :valid_time_frags?
@@ -1061,52 +995,20 @@ class Date
# Day Number day 0.
#
# +sg+ specifies the Day of Calendar Reform.
- def self.parse(str='-4712-01-01', comp=true, sg=ITALY)
+ def self.parse(str='-4712-01-01', comp=false, sg=ITALY)
elem = _parse(str, comp)
new_by_frags(elem, sg)
end
- def self.iso8601(str='-4712-01-01', sg=ITALY) # :nodoc:
- elem = _iso8601(str)
- new_by_frags(elem, sg)
- end
-
- def self.rfc3339(str='-4712-01-01T00:00:00+00:00', sg=ITALY) # :nodoc:
- elem = _rfc3339(str)
- new_by_frags(elem, sg)
- end
-
- def self.xmlschema(str='-4712-01-01', sg=ITALY) # :nodoc:
- elem = _xmlschema(str)
- new_by_frags(elem, sg)
- end
-
- def self.rfc2822(str='Mon, 1 Jan -4712 00:00:00 +0000', sg=ITALY) # :nodoc:
- elem = _rfc2822(str)
- new_by_frags(elem, sg)
- end
-
- class << self; alias_method :rfc822, :rfc2822 end
-
- def self.httpdate(str='Mon, 01 Jan -4712 00:00:00 GMT', sg=ITALY) # :nodoc:
- elem = _httpdate(str)
- new_by_frags(elem, sg)
- end
-
- def self.jisx0301(str='-4712-01-01', sg=ITALY) # :nodoc:
- elem = _jisx0301(str)
- new_by_frags(elem, sg)
- end
-
class << self
- def once(*ids) # :nodoc: -- restricted
+ def once(*ids) # :nodoc:
for id in ids
module_eval <<-"end;"
- alias_method :__#{id.object_id}__, :#{id.to_s}
- private :__#{id.object_id}__
- def #{id.to_s}(*args)
- @__ca__[#{id.object_id}] ||= __#{id.object_id}__(*args)
+ alias_method :__#{id.to_i}__, :#{id.to_s}
+ private :__#{id.to_i}__
+ def #{id.to_s}(*args, &block)
+ (@__#{id.to_i}__ ||= [__#{id.to_i}__(*args, &block)])[0]
end
end;
end
@@ -1135,45 +1037,42 @@ class Date
#
# Using one of the factory methods such as Date::civil is
# generally easier and safer.
- def initialize(ajd=0, of=0, sg=ITALY)
- @ajd, @of, @sg = ajd, of, sg
- @__ca__ = {}
- end
+ def initialize(ajd=0, of=0, sg=ITALY) @ajd, @of, @sg = ajd, of, sg end
# Get the date as an Astronomical Julian Day Number.
def ajd() @ajd end
# Get the date as an Astronomical Modified Julian Day Number.
- def amjd() ajd_to_amjd(@ajd) end
+ def amjd() self.class.ajd_to_amjd(@ajd) end
once :amjd
# Get the date as a Julian Day Number.
- def jd() ajd_to_jd(@ajd, @of)[0] end
+ def jd() self.class.ajd_to_jd(@ajd, @of)[0] end
# Get any fractional day part of the date.
- def day_fraction() ajd_to_jd(@ajd, @of)[1] end
+ def day_fraction() self.class.ajd_to_jd(@ajd, @of)[1] end
# Get the date as a Modified Julian Day Number.
- def mjd() jd_to_mjd(jd) end
+ def mjd() self.class.jd_to_mjd(jd) end
# Get the date as the number of days since the Day of Calendar
# Reform (in Italy and the Catholic countries).
- def ld() jd_to_ld(jd) end
+ def ld() self.class.jd_to_ld(jd) end
once :jd, :day_fraction, :mjd, :ld
# Get the date as a Civil Date, [year, month, day_of_month]
- def civil() jd_to_civil(jd, @sg) end # :nodoc:
+ def civil() self.class.jd_to_civil(jd, @sg) end # :nodoc:
# Get the date as an Ordinal Date, [year, day_of_year]
- def ordinal() jd_to_ordinal(jd, @sg) end # :nodoc:
+ def ordinal() self.class.jd_to_ordinal(jd, @sg) end # :nodoc:
# Get the date as a Commercial Date, [year, week_of_year, day_of_week]
- def commercial() jd_to_commercial(jd, @sg) end # :nodoc:
+ def commercial() self.class.jd_to_commercial(jd, @sg) end # :nodoc:
- def weeknum0() jd_to_weeknum(jd, 0, @sg) end # :nodoc:
- def weeknum1() jd_to_weeknum(jd, 1, @sg) end # :nodoc:
+ def weeknum0() self.class.__send__(:jd_to_weeknum, jd, 0, @sg) end # :nodoc:
+ def weeknum1() self.class.__send__(:jd_to_weeknum, jd, 1, @sg) end # :nodoc:
once :civil, :ordinal, :commercial, :weeknum0, :weeknum1
private :civil, :ordinal, :commercial, :weeknum0, :weeknum1
@@ -1204,7 +1103,7 @@ class Date
# Get the time of this date as [hours, minutes, seconds,
# fraction_of_a_second]
- def time() day_fraction_to_time(day_fraction) end # :nodoc:
+ def time() self.class.day_fraction_to_time(day_fraction) end # :nodoc:
once :time
private :time
@@ -1218,15 +1117,18 @@ class Date
# Get the second of this date.
def sec() time[2] end
- # Get the fraction-of-a-second of this date.
+ # Get the fraction-of-a-second of this date. The unit is in days.
+ # I do NOT recommend you to use this method.
def sec_fraction() time[3] end
+=begin
alias_method :minute, :min
alias_method :second, :sec
alias_method :second_fraction, :sec_fraction
+=end
- private :hour, :min, :sec, :sec_fraction,
- :minute, :second, :second_fraction
+ private :hour, :min, :sec, :sec_fraction
+# :minute, :second, :second_fraction
def zone() strftime('%:z') end
@@ -1245,7 +1147,7 @@ class Date
# Get the week day of this date. Sunday is day-of-week 0;
# Saturday is day-of-week 6.
- def wday() jd_to_wday(jd) end
+ def wday() self.class.jd_to_wday(jd) end
once :wday
@@ -1255,23 +1157,17 @@ class Date
define_method(n.downcase + '?'){mon == i}
end
end
-=end
DAYNAMES.each_with_index do |n, i|
define_method(n.downcase + '?'){wday == i}
end
-
- def nth_kday? (n, k)
- k == wday && jd === nth_kday_to_jd(year, mon, n, k, start)
- end
-
- private :nth_kday?
+=end
# Is the current date old-style (Julian Calendar)?
- def julian? () jd < @sg end
+ def julian? () self.class.julian?(jd, @sg) end
# Is the current date new-style (Gregorian Calendar)?
- def gregorian? () !julian? end
+ def gregorian? () self.class.gregorian?(jd, @sg) end
once :julian?, :gregorian?
@@ -1285,8 +1181,8 @@ class Date
# Is this a leap year?
def leap?
- jd_to_civil(civil_to_jd(year, 3, 1, fix_style) - 1,
- fix_style)[-1] == 29
+ self.class.jd_to_civil(self.class.civil_to_jd(year, 3, 1, fix_style) - 1,
+ fix_style)[-1] == 29
end
once :leap?
@@ -1390,7 +1286,9 @@ class Date
end
def next_day(n=1) self + n end
- def prev_day(n=1) self - n end
+# def prev_day(n=1) self - n end
+
+ private :next_day
# Return a new Date one day after this one.
def next() next_day end
@@ -1407,7 +1305,7 @@ class Date
y, m = (year * 12 + (mon - 1) + n).divmod(12)
m, = (m + 1) .divmod(1)
d = mday
- d -= 1 until jd2 = _valid_civil?(y, m, d, @sg)
+ d -= 1 until jd2 = self.class.valid_civil?(y, m, d, fix_style)
self + (jd2 - jd)
end
@@ -1419,13 +1317,15 @@ class Date
# of the returned Date will be the last day of the target month.
def << (n) self >> -n end
+=begin
def next_month(n=1) self >> n end
def prev_month(n=1) self << n end
def next_year(n=1) self >> n * 12 end
def prev_year(n=1) self << n * 12 end
+=end
- require 'enumerator'
+# require 'enumerator'
# Step the current date forward +step+ days at a
# time (or backward, if +step+ is negative) until
@@ -1437,9 +1337,11 @@ class Date
raise ArgumentError, "step can't be 0"
end
=end
+=begin
unless block_given?
return to_enum(:step, limit, step)
end
+=end
da = self
op = %w(- <= >=)[step <=> 0]
while da.__send__(op, limit)
@@ -1470,9 +1372,7 @@ class Date
def hash() @ajd.hash end
# Return internal object state as a programmer-readable string.
- def inspect
- format('#<%s: %s (%s,%s,%s)>', self.class, to_s, @ajd, @of, @sg)
- end
+ def inspect() format('#<%s: %s,%s,%s>', self.class, @ajd, @of, @sg) end
# Return the date as a human-readable string.
#
@@ -1480,12 +1380,21 @@ class Date
def to_s() format('%.4d-%02d-%02d', year, mon, mday) end # 4p
# Dump to Marshal format.
- def marshal_dump() [@ajd, @of, @sg] end
+ def _dump(limit) Marshal.dump([@ajd, @of, @sg], -1) end
+
+# def self._load(str) new!(*Marshal.load(str)) end
# Load from Marshal format.
- def marshal_load(a)
- @ajd, @of, @sg, = a
- @__ca__ = {}
+ def self._load(str)
+ a = Marshal.load(str)
+ if a.size == 2
+ ajd, sg = a
+ of = 0
+ ajd -= 1.to_r/2
+ else
+ ajd, of, sg = a
+ end
+ new!(ajd, of, sg)
end
end
@@ -1520,7 +1429,8 @@ end
# === sec_fraction()
#
# Get the fraction of a second of the time. This is returned as
-# a +Rational+.
+# a +Rational+. The unit is in days.
+# I do NOT recommend you to use this method.
#
# === zone()
#
@@ -1554,8 +1464,8 @@ class DateTime < Date
#
# All day/time values default to 0.
def self.jd(jd=0, h=0, min=0, s=0, of=0, sg=ITALY)
- unless (jd = _valid_jd?(jd, sg)) &&
- (fr = _valid_time?(h, min, s))
+ unless (jd = valid_jd?(jd, sg)) &&
+ (fr = valid_time?(h, min, s))
raise ArgumentError, 'invalid date'
end
if String === of
@@ -1579,8 +1489,8 @@ class DateTime < Date
# +y+ defaults to -4712, and +d+ to 1; this is Julian Day Number
# day 0. The time values default to 0.
def self.ordinal(y=-4712, d=1, h=0, min=0, s=0, of=0, sg=ITALY)
- unless (jd = _valid_ordinal?(y, d, sg)) &&
- (fr = _valid_time?(h, min, s))
+ unless (jd = valid_ordinal?(y, d, sg)) &&
+ (fr = valid_time?(h, min, s))
raise ArgumentError, 'invalid date'
end
if String === of
@@ -1604,8 +1514,8 @@ class DateTime < Date
# +y+ defaults to -4712, +m+ to 1, and +d+ to 1; this is Julian Day
# Number day 0. The time values default to 0.
def self.civil(y=-4712, m=1, d=1, h=0, min=0, s=0, of=0, sg=ITALY)
- unless (jd = _valid_civil?(y, m, d, sg)) &&
- (fr = _valid_time?(h, min, s))
+ unless (jd = valid_civil?(y, m, d, sg)) &&
+ (fr = valid_time?(h, min, s))
raise ArgumentError, 'invalid date'
end
if String === of
@@ -1628,12 +1538,12 @@ class DateTime < Date
# +of+ is the offset from UTC as a fraction of a day (defaults to 0).
# +sg+ specifies the Day of Calendar Reform.
#
- # +y+ defaults to -4712, +w+ to 1, and +d+ to 1; this is
- # Julian Day Number day 0.
+ # +y+ defaults to 1582, +w+ to 41, and +d+ to 5; this is the Day of
+ # Calendar Reform for Italy and the Catholic countries.
# The time values default to 0.
- def self.commercial(y=-4712, w=1, d=1, h=0, min=0, s=0, of=0, sg=ITALY)
- unless (jd = _valid_commercial?(y, w, d, sg)) &&
- (fr = _valid_time?(h, min, s))
+ def self.commercial(y=1582, w=41, d=5, h=0, min=0, s=0, of=0, sg=ITALY)
+ unless (jd = valid_commercial?(y, w, d, sg)) &&
+ (fr = valid_time?(h, min, s))
raise ArgumentError, 'invalid date'
end
if String === of
@@ -1642,9 +1552,9 @@ class DateTime < Date
new!(jd_to_ajd(jd, fr, of), of, sg)
end
- def self.weeknum(y=-4712, w=0, d=1, f=0, h=0, min=0, s=0, of=0, sg=ITALY) # :nodoc:
- unless (jd = _valid_weeknum?(y, w, d, f, sg)) &&
- (fr = _valid_time?(h, min, s))
+ def self.weeknum(y=1582, w=41, d=5, f=0, h=0, min=0, s=0, of=0, sg=ITALY) # :nodoc:
+ unless (jd = valid_weeknum?(y, w, d, f, sg)) &&
+ (fr = valid_time?(h, min, s))
raise ArgumentError, 'invalid date'
end
if String === of
@@ -1655,19 +1565,6 @@ class DateTime < Date
private_class_method :weeknum
- def self.nth_kday(y=-4712, m=1, n=1, k=1, h=0, min=0, s=0, of=0, sg=ITALY) # :nodoc:
- unless (jd = _valid_nth_kday?(y, m, n, k, sg)) &&
- (fr = _valid_time?(h, min, s))
- raise ArgumentError, 'invalid date'
- end
- if String === of
- of = Rational(zone_to_diff(of) || 0, 86400)
- end
- new!(jd_to_ajd(jd, fr, of), of, sg)
- end
-
- private_class_method :nth_kday
-
def self.new_by_frags(elem, sg) # :nodoc:
elem = rewrite_frags(elem)
elem = complete_frags(elem)
@@ -1716,45 +1613,13 @@ class DateTime < Date
# Day Number day 0.
#
# +sg+ specifies the Day of Calendar Reform.
- def self.parse(str='-4712-01-01T00:00:00+00:00', comp=true, sg=ITALY)
+ def self.parse(str='-4712-01-01T00:00:00+00:00', comp=false, sg=ITALY)
elem = _parse(str, comp)
new_by_frags(elem, sg)
end
- def self.iso8601(str='-4712-01-01T00:00:00+00:00', sg=ITALY) # :nodoc:
- elem = _iso8601(str)
- new_by_frags(elem, sg)
- end
-
- def self.rfc3339(str='-4712-01-01T00:00:00+00:00', sg=ITALY) # :nodoc:
- elem = _rfc3339(str)
- new_by_frags(elem, sg)
- end
-
- def self.xmlschema(str='-4712-01-01T00:00:00+00:00', sg=ITALY) # :nodoc:
- elem = _xmlschema(str)
- new_by_frags(elem, sg)
- end
-
- def self.rfc2822(str='Mon, 1 Jan -4712 00:00:00 +0000', sg=ITALY) # :nodoc:
- elem = _rfc2822(str)
- new_by_frags(elem, sg)
- end
-
- class << self; alias_method :rfc822, :rfc2822 end
-
- def self.httpdate(str='Mon, 01 Jan -4712 00:00:00 GMT', sg=ITALY) # :nodoc:
- elem = _httpdate(str)
- new_by_frags(elem, sg)
- end
-
- def self.jisx0301(str='-4712-01-01T00:00:00+00:00', sg=ITALY) # :nodoc:
- elem = _jisx0301(str)
- new_by_frags(elem, sg)
- end
-
- public :hour, :min, :sec, :sec_fraction, :zone, :offset, :new_offset,
- :minute, :second, :second_fraction
+ public :hour, :min, :sec, :sec_fraction, :zone, :offset, :new_offset
+# :minute, :second, :second_fraction
def to_s # 4p
format('%.4d-%02d-%02dT%02d:%02d:%02d%s',
@@ -1765,29 +1630,32 @@ end
class Time
- def to_time() getlocal end
+# def to_time() getlocal end
def to_date
- jd = Date.__send__(:civil_to_jd, year, mon, mday, Date::ITALY)
- Date.new!(Date.__send__(:jd_to_ajd, jd, 0, 0), 0, Date::ITALY)
+ jd = Date.civil_to_jd(year, mon, mday, Date::ITALY)
+ Date.new!(Date.jd_to_ajd(jd, 0, 0), 0, Date::ITALY)
end
def to_datetime
- jd = DateTime.__send__(:civil_to_jd, year, mon, mday, DateTime::ITALY)
- fr = DateTime.__send__(:time_to_day_fraction, hour, min, [sec, 59].min) +
- Rational(subsec, 86400)
+ jd = DateTime.civil_to_jd(year, mon, mday, DateTime::ITALY)
+ fr = DateTime.time_to_day_fraction(hour, min, [sec, 59].min) +
+ Rational(usec, 86400_000_000)
of = Rational(utc_offset, 86400)
- DateTime.new!(DateTime.__send__(:jd_to_ajd, jd, fr, of),
- of, DateTime::ITALY)
+ DateTime.new!(DateTime.jd_to_ajd(jd, fr, of), of, DateTime::ITALY)
end
+ private :to_date, :to_datetime
+
end
class Date
+=begin
def to_time() Time.local(year, mon, mday) end
def to_date() self end
- def to_datetime() DateTime.new!(jd_to_ajd(jd, 0, 0), @of, @sg) end
+ def to_datetime() DateTime.new!(self.class.jd_to_ajd(jd, 0, 0), @of, @sg) end
+=end
# Create a new Date object representing today.
#
@@ -1805,7 +1673,7 @@ class Date
t = Time.now
jd = civil_to_jd(t.year, t.mon, t.mday, sg)
fr = time_to_day_fraction(t.hour, t.min, [t.sec, 59].min) +
- Rational(t.subsec, 86400)
+ Rational(t.usec, 86400_000_000)
of = Rational(t.utc_offset, 86400)
new!(jd_to_ajd(jd, fr, of), of, sg)
end
@@ -1816,19 +1684,95 @@ end
class DateTime < Date
+=begin
def to_time
d = new_offset(0)
d.instance_eval do
- Time.utc(year, mon, mday, hour, min, sec +
- sec_fraction)
+ Time.utc(year, mon, mday, hour, min, sec,
+ (sec_fraction * 86400000000).to_i)
end.
getlocal
end
- def to_date() Date.new!(jd_to_ajd(jd, 0, 0), 0, @sg) end
+ def to_date() Date.new!(self.class.jd_to_ajd(jd, 0, 0), 0, @sg) end
def to_datetime() self end
+=end
private_class_method :today
public_class_method :now
end
+
+class Date
+
+ class << self
+
+ def deprecated_class_method_alias(old, new) # :nodoc:
+ module_eval <<-"end;"
+ class << self
+ def #{old}(*args, &block)
+ if $VERBOSE
+ warn("\#{caller.shift.sub(/:in .*/, '')}: " \
+ "warning: \#{self}::#{old} is deprecated; " \
+ "use \#{self}::#{new}")
+ end
+ #{new}(*args, &block)
+ end
+ end
+ end;
+ end
+
+ private :deprecated_class_method_alias
+
+ def deprecated_alias(old, new) # :nodoc:
+ module_eval <<-"end;"
+ def #{old}(*args, &block)
+ if $VERBOSE
+ warn("\#{caller.shift.sub(/:in .*/, '')}: " \
+ "warning: \#{self.class}\##{old} is deprecated; " \
+ "use \#{self.class}\##{new}")
+ end
+ #{new}(*args, &block)
+ end
+ end;
+ end
+
+ private :deprecated_alias
+
+ end
+
+ [ %w(os? julian?),
+ %w(ns? gregorian?),
+ %w(exist1? valid_jd?),
+ %w(exist2? valid_ordinal?),
+ %w(exist3? valid_date?),
+ %w(exist? valid_date?),
+ %w(existw? valid_commercial?),
+ %w(new0 new!),
+ %w(new1 jd),
+ %w(new2 ordinal),
+ %w(new3 new),
+ %w(neww commercial)
+ ].each do |old, new|
+ deprecated_class_method_alias(old, new)
+ end
+
+ [ %w(os? julian?),
+ %w(ns? gregorian?),
+ %w(sg start),
+ %w(newsg new_start),
+ %w(of offset),
+ %w(newof new_offset)
+ ].each do |old, new|
+ deprecated_alias(old, new)
+ end
+
+ private :of, :newof
+
+end
+
+class DateTime < Date
+
+ public :of, :newof
+
+end
diff --git a/lib/date/format.rb b/lib/date/format.rb
index a83b29802e..f89c1344a9 100644
--- a/lib/date/format.rb
+++ b/lib/date/format.rb
@@ -1,6 +1,8 @@
# format.rb: Written by Tadayoshi Funaba 1999-2008
# $Id: format.rb,v 2.43 2008-01-17 20:16:31+09 tadf Exp $
+require 'rational'
+
class Date
module Format # :nodoc:
@@ -213,9 +215,9 @@ class Date
:emit_a, :emit_ad, :emit_au
def strftime(fmt='%F')
- fmt.gsub(/%([-_0^#]+)?(\d+)?([EO]?(?::{1,3}z|.))/m) do
+ fmt.gsub(/%([-_0^#]+)?(\d+)?([EO]?(?::{1,3}z|.))/m) do |m|
f = {}
- m = $&
+ a = $&
s, w, c = $1, $2, $3
if s
s.scan(/./) do |k|
@@ -255,19 +257,13 @@ class Date
when 'j'; emit_n(yday, 3, f)
when 'k'; emit_a(hour, 2, f)
when 'L'
- f[:p] = nil
- w = f[:w] || 3
- u = 10**w
- emit_n((sec_fraction * u).floor, w, f)
+ emit_n((sec_fraction / MILLISECONDS_IN_DAY).floor, 3, f)
when 'l'; emit_a((hour % 12).nonzero? || 12, 2, f)
when 'M', 'OM'; emit_n(min, 2, f)
when 'm', 'Om'; emit_n(mon, 2, f)
when 'N'
- f[:p] = nil
- w = f[:w] || 9
- u = 10**w
- emit_n((sec_fraction * u).floor, w, f)
- when 'n'; emit_a("\n", 0, f)
+ emit_n((sec_fraction / NANOSECONDS_IN_DAY).floor, 9, f)
+ when 'n'; "\n"
when 'P'; emit_ad(strftime('%p').downcase, 0, f)
when 'p'; emit_au(if hour < 12 then 'AM' else 'PM' end, 0, f)
when 'Q'
@@ -285,7 +281,7 @@ class Date
else
emit_a(strftime('%H:%M:%S'), 0, f)
end
- when 't'; emit_a("\t", 0, f)
+ when 't'; "\t"
when 'U', 'W', 'OU', 'OW'
emit_n(if c[-1,1] == 'U' then wnum0 else wnum1 end, 2, f)
when 'u', 'Ou'; emit_n(cwday, 1, f)
@@ -330,8 +326,23 @@ class Date
([emit_z(sign * hh, 2, f)] + tail).join(sep)
when '%'; emit_a('%', 0, f)
when '+'; emit_a(strftime('%a %b %e %H:%M:%S %Z %Y'), 0, f)
+ when '1'
+ if $VERBOSE
+ warn("warning: strftime: %1 is deprecated; forget this")
+ end
+ emit_n(jd, 1, f)
+ when '2'
+ if $VERBOSE
+ warn("warning: strftime: %2 is deprecated; use '%Y-%j'")
+ end
+ emit_a(strftime('%Y-%j'), 0, f)
+ when '3'
+ if $VERBOSE
+ warn("warning: strftime: %3 is deprecated; use '%F'")
+ end
+ emit_a(strftime('%F'), 0, f)
else
- m
+ a
end
end
end
@@ -342,18 +353,15 @@ class Date
alias_method :ctime, :asctime
+=begin
def iso8601() strftime('%F') end
def rfc3339() iso8601 end
- def xmlschema() iso8601 end # :nodoc:
-
def rfc2822() strftime('%a, %-d %b %Y %T %z') end
alias_method :rfc822, :rfc2822
- def httpdate() new_offset(0).strftime('%a, %d %b %Y %T GMT') end # :nodoc:
-
def jisx0301
if jd < 2405160
iso8601
@@ -372,7 +380,6 @@ class Date
end
end
-=begin
def beat(n=0)
i, f = (new_offset(HOURS_IN_DAY).day_fraction * 1000).divmod(1)
('@%03d' % i) +
@@ -555,6 +562,23 @@ class Date
return unless str.sub!(/\A%/, '')
when '+'
return unless _strptime_i(str, '%a %b %e %H:%M:%S %Z %Y', e)
+ when '1'
+ if $VERBOSE
+ warn("warning: strptime: %1 is deprecated; forget this")
+ end
+ return unless str.sub!(/\A(\d+)/, '')
+ val = $1.to_i
+ e.jd = val
+ when '2'
+ if $VERBOSE
+ warn("warning: strptime: %2 is deprecated; use '%Y-%j'")
+ end
+ return unless _strptime_i(str, '%Y-%j', e)
+ when '3'
+ if $VERBOSE
+ warn("warning: strptime: %3 is deprecated; use '%F'")
+ end
+ return unless _strptime_i(str, '%F', e)
else
return unless str.sub!(Regexp.new('\\A' + Regexp.quote(a)), '')
end
@@ -669,11 +693,11 @@ class Date
private_class_method :s3e
def self._parse_day(str, e) # :nodoc:
- if str.sub!(/\b(#{Format::ABBR_DAYS.keys.join('|')})[^-\d\s]*/io, ' ')
+ if str.sub!(/\b(#{Format::ABBR_DAYS.keys.join('|')})[^-\d\s]*/ino, ' ')
e.wday = Format::ABBR_DAYS[$1.downcase]
true
=begin
- elsif str.sub!(/\b(?!\dth)(su|mo|tu|we|th|fr|sa)\b/i, ' ')
+ elsif str.sub!(/\b(?!\dth)(su|mo|tu|we|th|fr|sa)\b/in, ' ')
e.wday = %w(su mo tu we th fr sa).index($1.downcase)
true
=end
@@ -708,7 +732,7 @@ class Date
[[:alpha:]]+(?:\sdst)?\b
)
)?
- /ix,
+ /inx,
' ')
t = $1
@@ -720,7 +744,7 @@ class Date
\s*:?\s*(\d+)(?:[,.](\d+))?s?
)?
)?
- (?:\s*([ap])(?:m\b|\.m\.))?/ix
+ (?:\s*([ap])(?:m\b|\.m\.))?/inx
e.hour = $1.to_i
e.min = $2.to_i if $2
@@ -765,7 +789,7 @@ class Date
\s*
('?-?\d+(?:(?:st|nd|rd|th)\b)?)
)?
- /iox,
+ /inox,
' ') # '
s3e(e, $4, Format::ABBR_MONTHS[$2.downcase], $1,
$3 && $3[0,1].downcase == 'b')
@@ -784,7 +808,7 @@ class Date
\s*
('?-?\d+)
)?
- /iox,
+ /inox,
' ') # '
s3e(e, $4, Format::ABBR_MONTHS[$1.downcase], $2,
$3 && $3[0,1].downcase == 'b')
@@ -793,43 +817,43 @@ class Date
end
def self._parse_iso(str, e) # :nodoc:
- if str.sub!(/('?[-+]?\d+)-(\d+)-('?-?\d+)/, ' ')
+ if str.sub!(/('?[-+]?\d+)-(\d+)-('?-?\d+)/n, ' ')
s3e(e, $1, $2, $3)
true
end
end
def self._parse_iso2(str, e) # :nodoc:
- if str.sub!(/\b(\d{2}|\d{4})?-?w(\d{2})(?:-?(\d))?\b/i, ' ')
+ if str.sub!(/\b(\d{2}|\d{4})?-?w(\d{2})(?:-?(\d))?\b/in, ' ')
e.cwyear = $1.to_i if $1
e.cweek = $2.to_i
e.cwday = $3.to_i if $3
true
- elsif str.sub!(/-w-(\d)\b/i, ' ')
+ elsif str.sub!(/-w-(\d)\b/in, ' ')
e.cwday = $1.to_i
true
- elsif str.sub!(/--(\d{2})?-(\d{2})\b/, ' ')
+ elsif str.sub!(/--(\d{2})?-(\d{2})\b/n, ' ')
e.mon = $1.to_i if $1
e.mday = $2.to_i
true
- elsif str.sub!(/--(\d{2})(\d{2})?\b/, ' ')
+ elsif str.sub!(/--(\d{2})(\d{2})?\b/n, ' ')
e.mon = $1.to_i
e.mday = $2.to_i if $2
true
- elsif /[,.](\d{2}|\d{4})-\d{3}\b/ !~ str &&
- str.sub!(/\b(\d{2}|\d{4})-(\d{3})\b/, ' ')
+ elsif /[,.](\d{2}|\d{4})-\d{3}\b/n !~ str &&
+ str.sub!(/\b(\d{2}|\d{4})-(\d{3})\b/n, ' ')
e.year = $1.to_i
e.yday = $2.to_i
true
- elsif /\d-\d{3}\b/ !~ str &&
- str.sub!(/\b-(\d{3})\b/, ' ')
+ elsif /\d-\d{3}\b/n !~ str &&
+ str.sub!(/\b-(\d{3})\b/n, ' ')
e.yday = $1.to_i
true
end
end
def self._parse_jis(str, e) # :nodoc:
- if str.sub!(/\b([mtsh])(\d+)\.(\d+)\.(\d+)/i, ' ')
+ if str.sub!(/\b([mtsh])(\d+)\.(\d+)\.(\d+)/in, ' ')
era = { 'm'=>1867,
't'=>1911,
's'=>1925,
@@ -844,46 +868,46 @@ class Date
def self._parse_vms(str, e) # :nodoc:
if str.sub!(/('?-?\d+)-(#{Format::ABBR_MONTHS.keys.join('|')})[^-]*
- -('?-?\d+)/iox, ' ')
+ -('?-?\d+)/inox, ' ')
s3e(e, $3, Format::ABBR_MONTHS[$2.downcase], $1)
true
elsif str.sub!(/\b(#{Format::ABBR_MONTHS.keys.join('|')})[^-]*
- -('?-?\d+)(?:-('?-?\d+))?/iox, ' ')
+ -('?-?\d+)(?:-('?-?\d+))?/inox, ' ')
s3e(e, $3, Format::ABBR_MONTHS[$1.downcase], $2)
true
end
end
def self._parse_sla(str, e) # :nodoc:
- if str.sub!(%r|('?-?\d+)/\s*('?\d+)(?:\D\s*('?-?\d+))?|, ' ') # '
- s3e(e, $1, $2, $3)
+ if str.sub!(%r|('?-?\d+)/\s*('?\d+)(?:\D\s*('?-?\d+))?|n, ' ') # '
+ s3e(e, $3, $1, $2)
true
end
end
def self._parse_dot(str, e) # :nodoc:
- if str.sub!(%r|('?-?\d+)\.\s*('?\d+)\.\s*('?-?\d+)|, ' ') # '
+ if str.sub!(%r|('?-?\d+)\.\s*('?\d+)\.\s*('?-?\d+)|n, ' ') # '
s3e(e, $1, $2, $3)
true
end
end
def self._parse_year(str, e) # :nodoc:
- if str.sub!(/'(\d+)\b/, ' ')
+ if str.sub!(/'(\d+)\b/n, ' ')
e.year = $1.to_i
true
end
end
def self._parse_mon(str, e) # :nodoc:
- if str.sub!(/\b(#{Format::ABBR_MONTHS.keys.join('|')})\S*/io, ' ')
+ if str.sub!(/\b(#{Format::ABBR_MONTHS.keys.join('|')})\S*/ino, ' ')
e.mon = Format::ABBR_MONTHS[$1.downcase]
true
end
end
def self._parse_mday(str, e) # :nodoc:
- if str.sub!(/(\d+)(st|nd|rd|th)\b/i, ' ')
+ if str.sub!(/(\d+)(st|nd|rd|th)\b/in, ' ')
e.mday = $1.to_i
true
end
@@ -908,7 +932,7 @@ class Date
\[[-+]?\d[^\]]*\]
)
)?
- /ix,
+ /inx,
' ')
case $2.size
when 2
@@ -1027,14 +1051,14 @@ class Date
:_parse_jis, :_parse_vms, :_parse_sla, :_parse_dot,
:_parse_year, :_parse_mon, :_parse_mday, :_parse_ddd
- def self._parse(str, comp=true)
+ def self._parse(str, comp=false)
str = str.dup
e = Format::Bag.new
e._comp = comp
- str.gsub!(/[^-+',.\/:@[:alnum:]\[\]]+/, ' ')
+ str.gsub!(/[^-+',.\/:@[:alnum:]\[\]\x80-\xff]+/n, ' ')
_parse_time(str, e) # || _parse_beat(str, e)
_parse_day(str, e)
@@ -1052,13 +1076,13 @@ class Date
_parse_mday(str, e) ||
_parse_ddd(str, e)
- if str.sub!(/\b(bc\b|bce\b|b\.c\.|b\.c\.e\.)/i, ' ')
+ if str.sub!(/\b(bc\b|bce\b|b\.c\.|b\.c\.e\.)/in, ' ')
if e.year
e.year = -e.year + 1
end
end
- if str.sub!(/\A\s*(\d{1,2})\s*\z/, ' ')
+ if str.sub!(/\A\s*(\d{1,2})\s*\z/n, ' ')
if e.hour && !e.mday
v = $1.to_i
if (1..31) === v
@@ -1093,187 +1117,40 @@ class Date
e.to_hash
end
- def self._iso8601(str) # :nodoc:
- if /\A\s*(([-+]?\d{2,}|-)-\d{2}-\d{2}|
- ([-+]?\d{2,})?-\d{3}|
- (\d{2}|\d{4})?-w\d{2}-\d|
- -w-\d)
- (t
- \d{2}:\d{2}(:\d{2}([,.]\d+)?)?
- (z|[-+]\d{2}(:?\d{2})?)?)?\s*\z/ix =~ str
- _parse(str)
- elsif /\A\s*(([-+]?(\d{2}|\d{4})|--)\d{2}\d{2}|
- ([-+]?(\d{2}|\d{4}))?\d{3}|-\d{3}|
- (\d{2}|\d{4})?w\d{2}\d)
- (t?
- \d{2}\d{2}(\d{2}([,.]\d+)?)?
- (z|[-+]\d{2}(\d{2})?)?)?\s*\z/ix =~ str
- _parse(str)
- elsif /\A\s*(\d{2}:\d{2}(:\d{2}([,.]\d+)?)?
- (z|[-+]\d{2}(:?\d{2})?)?)?\s*\z/ix =~ str
- _parse(str)
- elsif /\A\s*(\d{2}\d{2}(\d{2}([,.]\d+)?)?
- (z|[-+]\d{2}(\d{2})?)?)?\s*\z/ix =~ str
- _parse(str)
- end
- end
-
- def self._rfc3339(str) # :nodoc:
- if /\A\s*-?\d{4}-\d{2}-\d{2} # allow minus, anyway
- (t|\s)
- \d{2}:\d{2}:\d{2}(\.\d+)?
- (z|[-+]\d{2}:\d{2})\s*\z/ix =~ str
- _parse(str)
- end
- end
-
- def self._xmlschema(str) # :nodoc:
- if /\A\s*(-?\d{4,})(?:-(\d{2})(?:-(\d{2}))?)?
- (?:t
- (\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?)?
- (z|[-+]\d{2}:\d{2})?\s*\z/ix =~ str
- e = Format::Bag.new
- e.year = $1.to_i
- e.mon = $2.to_i if $2
- e.mday = $3.to_i if $3
- e.hour = $4.to_i if $4
- e.min = $5.to_i if $5
- e.sec = $6.to_i if $6
- e.sec_fraction = Rational($7.to_i, 10**$7.size) if $7
- if $8
- e.zone = $8
- e.offset = zone_to_diff($8)
- end
- e.to_hash
- elsif /\A\s*(\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?
- (z|[-+]\d{2}:\d{2})?\s*\z/ix =~ str
- e = Format::Bag.new
- e.hour = $1.to_i if $1
- e.min = $2.to_i if $2
- e.sec = $3.to_i if $3
- e.sec_fraction = Rational($4.to_i, 10**$4.size) if $4
- if $5
- e.zone = $5
- e.offset = zone_to_diff($5)
- end
- e.to_hash
- elsif /\A\s*(?:--(\d{2})(?:-(\d{2}))?|---(\d{2}))
- (z|[-+]\d{2}:\d{2})?\s*\z/ix =~ str
- e = Format::Bag.new
- e.mon = $1.to_i if $1
- e.mday = $2.to_i if $2
- e.mday = $3.to_i if $3
- if $4
- e.zone = $4
- e.offset = zone_to_diff($4)
- end
- e.to_hash
- end
- end
-
- def self._rfc2822(str) # :nodoc:
- if /\A\s*(?:(?:#{Format::ABBR_DAYS.keys.join('|')})\s*,\s+)?
- \d{1,2}\s+
- (?:#{Format::ABBR_MONTHS.keys.join('|')})\s+
- -?(\d{2,})\s+ # allow minus, anyway
- \d{2}:\d{2}(:\d{2})?\s*
- (?:[-+]\d{4}|ut|gmt|e[sd]t|c[sd]t|m[sd]t|p[sd]t|[a-ik-z])\s*\z/iox =~ str
- e = _parse(str, false)
- if $1.size < 4
- if e[:year] < 50
- e[:year] += 2000
- elsif e[:year] < 1000
- e[:year] += 1900
- end
- end
- e
- end
- end
-
- class << self; alias_method :_rfc822, :_rfc2822 end
-
- def self._httpdate(str) # :nodoc:
- if /\A\s*(#{Format::ABBR_DAYS.keys.join('|')})\s*,\s+
- \d{2}\s+
- (#{Format::ABBR_MONTHS.keys.join('|')})\s+
- -?\d{4}\s+ # allow minus, anyway
- \d{2}:\d{2}:\d{2}\s+
- gmt\s*\z/iox =~ str
- _rfc2822(str)
- elsif /\A\s*(#{Format::DAYS.keys.join('|')})\s*,\s+
- \d{2}\s*-\s*
- (#{Format::ABBR_MONTHS.keys.join('|')})\s*-\s*
- \d{2}\s+
- \d{2}:\d{2}:\d{2}\s+
- gmt\s*\z/iox =~ str
- _parse(str)
- elsif /\A\s*(#{Format::ABBR_DAYS.keys.join('|')})\s+
- (#{Format::ABBR_MONTHS.keys.join('|')})\s+
- \d{1,2}\s+
- \d{2}:\d{2}:\d{2}\s+
- \d{4}\s*\z/iox =~ str
- _parse(str)
- end
- end
-
- def self._jisx0301(str) # :nodoc:
- if /\A\s*[mtsh]?\d{2}\.\d{2}\.\d{2}
- (t
- (\d{2}:\d{2}(:\d{2}([,.]\d*)?)?
- (z|[-+]\d{2}(:?\d{2})?)?)?)?\s*\z/ix =~ str
- if /\A\s*\d/ =~ str
- _parse(str.sub(/\A\s*(\d)/, 'h\1'))
- else
- _parse(str)
- end
+ def self.zone_to_diff(zone) # :nodoc:
+ zone = zone.downcase
+ if zone.sub!(/\s+(standard|daylight)\s+time\z/, '')
+ dst = $1 == 'daylight'
else
- _iso8601(str)
+ dst = zone.sub!(/\s+dst\z/, '')
end
- end
-
- t = Module.new do
-
- private
-
- def zone_to_diff(zone) # :nodoc:
- zone = zone.downcase
- if zone.sub!(/\s+(standard|daylight)\s+time\z/, '')
- dst = $1 == 'daylight'
+ if Format::ZONES.include?(zone)
+ offset = Format::ZONES[zone]
+ offset += 3600 if dst
+ elsif zone.sub!(/\A(?:gmt|utc?)?([-+])/, '')
+ sign = $1
+ if zone.include?(':')
+ hour, min, sec, = zone.split(':')
+ elsif zone.include?(',') || zone.include?('.')
+ hour, fr, = zone.split(/[,.]/)
+ min = Rational(fr.to_i, 10**fr.size) * 60
else
- dst = zone.sub!(/\s+dst\z/, '')
- end
- if Format::ZONES.include?(zone)
- offset = Format::ZONES[zone]
- offset += 3600 if dst
- elsif zone.sub!(/\A(?:gmt|utc?)?([-+])/, '')
- sign = $1
- if zone.include?(':')
- hour, min, sec, = zone.split(':')
- elsif zone.include?(',') || zone.include?('.')
- hour, fr, = zone.split(/[,.]/)
- min = Rational(fr.to_i, 10**fr.size) * 60
+ case zone.size
+ when 3
+ hour = zone[0,1]
+ min = zone[1,2]
else
- case zone.size
- when 3
- hour = zone[0,1]
- min = zone[1,2]
- else
- hour = zone[0,2]
- min = zone[2,2]
- sec = zone[4,2]
- end
+ hour = zone[0,2]
+ min = zone[2,2]
+ sec = zone[4,2]
end
- offset = hour.to_i * 3600 + min.to_i * 60 + sec.to_i
- offset *= -1 if sign == '-'
end
- offset
+ offset = hour.to_i * 3600 + min.to_i * 60 + sec.to_i
+ offset *= -1 if sign == '-'
end
-
+ offset
end
- extend t
- include t
-
end
class DateTime < Date
@@ -1286,12 +1163,13 @@ class DateTime < Date
super(str, fmt)
end
+=begin
def iso8601_timediv(n) # :nodoc:
strftime('T%T' +
if n < 1
''
else
- '.%0*d' % [n, (sec_fraction / Rational(1, 10**n)).round]
+ '.%0*d' % [n, (sec_fraction / SECONDS_IN_DAY / (10**n)).round]
end +
'%:z')
end
@@ -1304,10 +1182,9 @@ class DateTime < Date
def rfc3339(n=0) iso8601(n) end
- def xmlschema(n=0) iso8601(n) end # :nodoc:
-
def jisx0301(n=0)
super() + iso8601_timediv(n)
end
+=end
end
diff --git a/lib/date2.rb b/lib/date2.rb
new file mode 100644
index 0000000000..f7da78f650
--- /dev/null
+++ b/lib/date2.rb
@@ -0,0 +1,5 @@
+# date2 was overridden by date.
+# To be precise, date was overridden by date2,
+# and date2 was renamed to date.
+
+require 'date'
diff --git a/lib/debug.rb b/lib/debug.rb
index 10236c352d..9ae119f8fb 100644
--- a/lib/debug.rb
+++ b/lib/debug.rb
@@ -2,8 +2,6 @@
# 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
@@ -21,6 +19,45 @@ end
SCRIPT_LINES__ = {} unless defined? SCRIPT_LINES__
class DEBUGGER__
+class Mutex
+ def initialize
+ @locker = nil
+ @waiting = []
+ @locked = false;
+ end
+
+ def locked?
+ @locked
+ end
+
+ def lock
+ return if Thread.critical
+ return if @locker == Thread.current
+ while (Thread.critical = true; @locked)
+ @waiting.push Thread.current
+ Thread.stop
+ end
+ @locked = true
+ @locker = Thread.current
+ Thread.critical = false
+ self
+ end
+
+ def unlock
+ return if Thread.critical
+ return unless @locked
+ unless @locker == Thread.current
+ raise RuntimeError, "unlocked by other"
+ end
+ Thread.critical = true
+ t = @waiting.shift
+ @locked = false
+ @locker = nil
+ Thread.critical = false
+ t.run if t
+ self
+ end
+end
MUTEX = Mutex.new
class Context
@@ -81,14 +118,13 @@ class Context
end
def check_suspend
- while MUTEX.synchronize {
- if @suspend_next
- DEBUGGER__.waiting.push Thread.current
- @suspend_next = false
- true
- end
- }
+ return if Thread.critical
+ while (Thread.critical = true; @suspend_next)
+ DEBUGGER__.waiting.push Thread.current
+ @suspend_next = false
+ Thread.stop
end
+ Thread.critical = false
end
def trace?
@@ -220,7 +256,7 @@ class Context
def debug_command(file, line, id, binding)
MUTEX.lock
unless defined?($debugger_restart) and $debugger_restart
- callcc{|c| $debugger_restart = c}
+ callcc{|c| $debugger_restart = c}
end
set_last_thread(Thread.current)
frame_pos = 0
@@ -297,9 +333,9 @@ class Context
if break_points.find{|b| b[1] == 0}
n = 1
stdout.print "Breakpoints:\n"
- break_points.each do |b|
+ for b in break_points
if b[0] and b[1] == 0
- stdout.printf " %d %s:%s\n", n, b[2], b[3]
+ stdout.printf " %d %s:%s\n", n, b[2], b[3]
end
n += 1
end
@@ -593,6 +629,7 @@ EOHELP
def display_list(b, e, file, line)
stdout.printf "[%d, %d] in %s\n", b, e, file
if lines = SCRIPT_LINES__[file] and lines != true
+ n = 0
b.upto(e) do |n|
if n > 0 && lines[n-1]
if n == line
@@ -711,7 +748,10 @@ EOHELP
end
@frames.shift
- when 'raise'
+ when 'end'
+ @frames.shift
+
+ when 'raise'
excn_handle(file, line, id, binding)
end
@@ -750,12 +790,13 @@ class << DEBUGGER__
end
def set_trace( arg )
- MUTEX.synchronize do
- make_thread_list
- for th, in @thread_list
- context(th).set_trace arg
- end
+ saved_crit = Thread.critical
+ Thread.critical = true
+ make_thread_list
+ for th, in @thread_list
+ context(th).set_trace arg
end
+ Thread.critical = saved_crit
arg
end
@@ -764,29 +805,31 @@ class << DEBUGGER__
end
def suspend
- MUTEX.synchronize do
- make_thread_list
- for th, in @thread_list
- next if th == Thread.current
- context(th).set_suspend
- end
- end
+ saved_crit = Thread.critical
+ Thread.critical = true
+ make_thread_list
+ for th, in @thread_list
+ next if th == Thread.current
+ context(th).set_suspend
+ end
+ Thread.critical = saved_crit
# Schedule other threads to suspend as soon as possible.
- Thread.pass
+ Thread.pass unless Thread.critical
end
def resume
- MUTEX.synchronize do
- make_thread_list
- @thread_list.each do |th,|
- next if th == Thread.current
- context(th).clear_suspend
- end
- waiting.each do |th|
- th.run
- end
- waiting.clear
- end
+ saved_crit = Thread.critical
+ Thread.critical = true
+ make_thread_list
+ for th, in @thread_list
+ next if th == Thread.current
+ context(th).clear_suspend
+ end
+ waiting.each do |th|
+ th.run
+ end
+ waiting.clear
+ Thread.critical = saved_crit
# Schedule other threads to restart as soon as possible.
Thread.pass
end
@@ -804,7 +847,7 @@ class << DEBUGGER__
end
def get_thread(num)
- th = @thread_list.key(num)
+ th = @thread_list.index(num)
unless th
@stdout.print "No thread ##{num}\n"
throw :debug_error
@@ -878,7 +921,7 @@ class << DEBUGGER__
@stdout.print "Already stopped.\n"
else
thread_list(@thread_list[th])
- context(th).suspend
+ context(th).suspend
end
when /^resume\s+(\d+)/
@@ -898,9 +941,6 @@ end
stdout.printf "Debug.rb\n"
stdout.printf "Emacs support available.\n\n"
-RubyVM::InstructionSequence.compile_option = {
- trace_instruction: true
-}
set_trace_func proc { |event, file, line, id, binding, klass, *rest|
DEBUGGER__.context.trace_func event, file, line, id, binding, klass
}
diff --git a/lib/delegate.rb b/lib/delegate.rb
index 5fc0cafb4b..bd2b5e4813 100644
--- a/lib/delegate.rb
+++ b/lib/delegate.rb
@@ -37,16 +37,16 @@
# def initialize
# @source = SimpleDelegator.new([])
# end
-#
+#
# def stats( records )
# @source.__setobj__(records)
-#
+#
# "Elements: #{@source.size}\n" +
# " Non-Nil: #{@source.compact.size}\n" +
# " Unique: #{@source.uniq.size}\n"
# end
# end
-#
+#
# s = Stats.new
# puts s.stats(%w{James Edward Gray II})
# puts
@@ -57,7 +57,7 @@
# Elements: 4
# Non-Nil: 4
# Unique: 4
-#
+#
# Elements: 8
# Non-Nil: 7
# Unique: 6
@@ -72,19 +72,19 @@
#
# class Tempfile < DelegateClass(File)
# # constant and class member data initialization...
-#
+#
# def initialize(basename, tmpdir=Dir::tmpdir)
# # build up file path/name in var tmpname...
-#
+#
# @tmpfile = File.open(tmpname, File::RDWR|File::CREAT|File::EXCL, 0600)
-#
+#
# # ...
-#
+#
# super(@tmpfile)
-#
+#
# # below this point, all methods of File are supported...
# end
-#
+#
# # ...
# end
#
@@ -95,17 +95,17 @@
# class SimpleDelegator < Delegator
# def initialize(obj)
# super # pass obj to Delegator constructor, required
-# @delegate_sd_obj = obj # store obj for future use
+# @_sd_obj = obj # store obj for future use
# end
-#
+#
# def __getobj__
-# @delegate_sd_obj # return object we are delegating to, required
+# @_sd_obj # return object we are delegating to, required
# end
-#
+#
# def __setobj__(obj)
-# @delegate_sd_obj = obj # change delegation object, a feature we're providing
+# @_sd_obj = obj # change delegation object, a feature we're providing
# end
-#
+#
# # ...
# end
@@ -115,51 +115,60 @@
# implementation, see SimpleDelegator.
#
class Delegator
- [:to_s,:inspect,:=~,:!~,:===].each do |m|
- undef_method m
- end
+ IgnoreBacktracePat = %r"\A#{Regexp.quote(__FILE__)}:\d+:in `"
#
# Pass in the _obj_ to delegate method calls to. All methods supported by
# _obj_ will be delegated to.
#
def initialize(obj)
- __setobj__(obj)
+ preserved = ::Kernel.public_instance_methods(false)
+ preserved -= ["to_s","to_a","inspect","==","=~","==="]
+ for t in self.class.ancestors
+ preserved |= t.public_instance_methods(false)
+ preserved |= t.private_instance_methods(false)
+ preserved |= t.protected_instance_methods(false)
+ break if t == Delegator
+ end
+ preserved << "singleton_method_added"
+ for method in obj.methods
+ next if preserved.include? method
+ begin
+ eval <<-EOS, nil, __FILE__, __LINE__+1
+ def self.#{method}(*args, &block)
+ begin
+ __getobj__.__send__(:#{method}, *args, &block)
+ ensure
+ $@.delete_if{|s|IgnoreBacktracePat=~s} if $@
+ end
+ end
+ EOS
+ rescue SyntaxError
+ raise NameError, "invalid identifier %s" % method, caller(4)
+ end
+ end
end
+ alias initialize_methods initialize
# Handles the magic of delegation through \_\_getobj\_\_.
- def method_missing(m, *args, &block)
- begin
- target = self.__getobj__
- unless target.respond_to?(m)
- super(m, *args, &block)
- else
- target.__send__(m, *args, &block)
- end
- rescue Exception
- $@.delete_if{|s| %r"\A#{__FILE__}:\d+:in `method_missing'\z"o =~ s}
- ::Kernel::raise
+ def method_missing(m, *args)
+ target = self.__getobj__
+ unless target.respond_to?(m)
+ super(m, *args)
end
+ target.__send__(m, *args)
end
- #
- # Checks for a method provided by this the delegate object by fowarding the
+ #
+ # Checks for a method provided by this the delegate object by fowarding the
# call through \_\_getobj\_\_.
- #
+ #
def respond_to?(m, include_private = false)
return true if super
return self.__getobj__.respond_to?(m, include_private)
end
#
- # Returns true if two objects are considered same.
- #
- def ==(obj)
- return true if obj.equal?(self)
- self.__getobj__ == obj
- end
-
- #
# This method must be overridden by subclasses and should return the object
# method calls are being delegated to.
#
@@ -167,35 +176,15 @@ class Delegator
raise NotImplementedError, "need to define `__getobj__'"
end
- #
- # This method must be overridden by subclasses and change the object delegate
- # to _obj_.
- #
- def __setobj__(obj)
- raise NotImplementedError, "need to define `__setobj__'"
- end
-
# Serialization support for the object returned by \_\_getobj\_\_.
def marshal_dump
__getobj__
end
# Reinitializes delegation from a serialized object.
def marshal_load(obj)
+ initialize_methods(obj)
__setobj__(obj)
end
-
- # Clone support for the object returned by \_\_getobj\_\_.
- def clone
- new = super
- new.__setobj__(__getobj__.clone)
- new
- end
- # Duplication support for the object returned by \_\_getobj\_\_.
- def dup
- new = super
- new.__setobj__(__getobj__.dup)
- new
- end
end
#
@@ -205,9 +194,16 @@ end
# \_\_setobj\_\_ .
#
class SimpleDelegator<Delegator
+
+ # Pass in the _obj_ you would like to delegate method calls to.
+ def initialize(obj)
+ super
+ @_sd_obj = obj
+ end
+
# Returns the current object method calls are being delegated to.
def __getobj__
- @delegate_sd_obj
+ @_sd_obj
end
#
@@ -226,22 +222,27 @@ class SimpleDelegator<Delegator
#
def __setobj__(obj)
raise ArgumentError, "cannot delegate to self" if self.equal?(obj)
- @delegate_sd_obj = obj
+ @_sd_obj = obj
end
-end
-# :stopdoc:
-def Delegator.delegating_block(mid)
- lambda do |*args, &block|
- begin
- __getobj__.__send__(mid, *args, &block)
- rescue
- re = /\A#{Regexp.quote(__FILE__)}:#{__LINE__-2}:/o
- $!.backtrace.delete_if {|t| re =~ t}
- raise
- end
+ # Clone support for the object returned by \_\_getobj\_\_.
+ def clone
+ new = super
+ new.__setobj__(__getobj__.clone)
+ new
+ end
+ # Duplication support for the object returned by \_\_getobj\_\_.
+ def dup
+ new = super
+ new.__setobj__(__getobj__.clone)
+ new
end
end
+
+# :stopdoc:
+# backward compatibility ^_^;;;
+Delegater = Delegator
+SimpleDelegater = SimpleDelegator
# :startdoc:
#
@@ -255,22 +256,55 @@ end
# end
#
def DelegateClass(superclass)
- klass = Class.new(Delegator)
+ klass = Class.new
methods = superclass.public_instance_methods(true)
- methods -= ::Delegator.public_instance_methods
- methods -= [:to_s,:inspect,:=~,:!~,:===]
+ methods -= ::Kernel.public_instance_methods(false)
+ methods |= ["to_s","to_a","inspect","==","=~","==="]
klass.module_eval {
+ def initialize(obj) # :nodoc:
+ @_dc_obj = obj
+ end
+ def method_missing(m, *args) # :nodoc:
+ unless @_dc_obj.respond_to?(m)
+ super(m, *args)
+ end
+ @_dc_obj.__send__(m, *args)
+ end
+ def respond_to?(m, include_private = false) # :nodoc:
+ return true if super
+ return @_dc_obj.respond_to?(m, include_private)
+ end
def __getobj__ # :nodoc:
- @delegate_dc_obj
+ @_dc_obj
end
def __setobj__(obj) # :nodoc:
raise ArgumentError, "cannot delegate to self" if self.equal?(obj)
- @delegate_dc_obj = obj
+ @_dc_obj = obj
+ end
+ def clone # :nodoc:
+ new = super
+ new.__setobj__(__getobj__.clone)
+ new
+ end
+ def dup # :nodoc:
+ new = super
+ new.__setobj__(__getobj__.clone)
+ new
end
}
- klass.module_eval do
- methods.each do |method|
- define_method(method, Delegator.delegating_block(method))
+ for method in methods
+ begin
+ klass.module_eval <<-EOS, __FILE__, __LINE__+1
+ def #{method}(*args, &block)
+ begin
+ @_dc_obj.__send__(:#{method}, *args, &block)
+ ensure
+ $@.delete_if{|s| ::Delegator::IgnoreBacktracePat =~ s} if $@
+ end
+ end
+ EOS
+ rescue SyntaxError
+ raise NameError, "invalid identifier %s" % method, caller(3)
end
end
return klass
@@ -289,23 +323,15 @@ if __FILE__ == $0
p ary.class
ary.push 25
p ary
- ary.push 42
- ary.each {|x| p x}
foo = Object.new
def foo.test
25
end
- def foo.iter
- yield self
- end
def foo.error
raise 'this is OK'
end
foo2 = SimpleDelegator.new(foo)
- p foo2
- foo2.instance_eval{print "foo\n"}
p foo.test == foo2.test # => true
- p foo2.iter{[55,true]} # => true
foo2.error # raise error!
end
diff --git a/lib/drb/drb.rb b/lib/drb/drb.rb
index a2c11f980d..7dd0f01e76 100644
--- a/lib/drb/drb.rb
+++ b/lib/drb/drb.rb
@@ -18,7 +18,7 @@
#
# The Ruby standard library contains the core classes of the dRuby package.
# However, the full package also includes access control lists and the
-# Rinda tuple-space distributed task management system, as well as a
+# Rinda tuple-space distributed task management system, as well as a
# large number of samples. The full dRuby package can be downloaded from
# the dRuby home page (see *References*).
#
@@ -121,7 +121,7 @@ require 'drb/eq'
# are forwarded to the local object, as described in the discussion of
# DRbObjects. This has semantics similar to the normal Ruby
# pass-by-reference.
-#
+#
# The easiest way to signal that we want an otherwise marshallable
# object to be passed or returned as a DRbObject reference, rather
# than marshalled and sent as a copy, is to include the
@@ -135,7 +135,7 @@ require 'drb/eq'
# passed back to the remote execution context to be collected, before
# the collected values are finally returned to the local context as
# the return value of the method invocation.
-#
+#
# == Examples of usage
#
# For more dRuby samples, see the +samples+ directory in the full
@@ -148,33 +148,33 @@ require 'drb/eq'
# starting the server code first.
#
# ==== Server code
-#
+#
# require 'drb/drb'
-#
+#
# # The URI for the server to connect to
-# URI="druby://localhost:8787"
-#
+# URI="druby://localhost:8787"
+#
# class TimeServer
-#
+#
# def get_current_time
# return Time.now
# end
-#
+#
# end
-#
+#
# # 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
#
# ==== Client code
-#
+#
# require 'drb/drb'
-#
+#
# # The URI to connect to
# SERVER_URI="druby://localhost:8787"
#
@@ -184,43 +184,43 @@ require 'drb/eq'
# # as soon as we pass a non-marshallable object as an argument
# # to a dRuby call.
# DRb.start_service
-#
+#
# timeserver = DRbObject.new_with_uri(SERVER_URI)
-# puts timeserver.get_current_time
+# puts timeserver.get_current_time
#
# === Remote objects under dRuby
#
# This example illustrates returning a reference to an object
# from a dRuby call. The Logger instances live in the server
# process. References to them are returned to the client process,
-# where methods can be invoked upon them. These methods are
+# where methods can be invoked upon them. These methods are
# executed in the server process.
#
# ==== Server code
-#
+#
# require 'drb/drb'
-#
+#
# URI="druby://localhost:8787"
-#
+#
# class Logger
#
# # Make dRuby send Logger instances as dRuby references,
# # not copies.
# include DRb::DRbUndumped
-#
+#
# def initialize(n, fname)
# @name = n
# @filename = fname
# end
-#
+#
# def log(message)
# File.open(@filename, "a") do |f|
# f.puts("#{Time.now}: #{@name}: #{message}")
# end
# end
-#
+#
# end
-#
+#
# # We have a central object for creating and retrieving loggers.
# # This retains a local reference to all loggers created. This
# # is so an existing logger can be looked up by name, but also
@@ -228,12 +228,12 @@ require 'drb/eq'
# # reference to an object is not sufficient to prevent it being
# # garbage collected!
# class LoggerFactory
-#
+#
# def initialize(bdir)
# @basedir = bdir
# @loggers = {}
# end
-#
+#
# def get_logger(name)
# if !@loggers.has_key? name
# # make the filename safe, then declare it to be so
@@ -242,34 +242,34 @@ require 'drb/eq'
# end
# return @loggers[name]
# end
-#
+#
# end
-#
+#
# FRONT_OBJECT=LoggerFactory.new("/tmp/dlog")
#
# $SAFE = 1 # disable eval() and friends
-#
+#
# DRb.start_service(URI, FRONT_OBJECT)
# DRb.thread.join
#
# ==== Client code
#
# require 'drb/drb'
-#
+#
# SERVER_URI="druby://localhost:8787"
#
# DRb.start_service
-#
+#
# log_service=DRbObject.new_with_uri(SERVER_URI)
-#
+#
# ["loga", "logb", "logc"].each do |logname|
-#
+#
# logger=log_service.get_logger(logname)
-#
+#
# logger.log("Hello, world!")
# logger.log("Goodbye, world!")
# logger.log("=== EOT ===")
-#
+#
# end
#
# == Security
@@ -288,9 +288,9 @@ require 'drb/eq'
# ro.instance_eval("`rm -rf *`")
#
# The dangers posed by instance_eval and friends are such that a
-# 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
+# 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
@@ -360,7 +360,7 @@ module DRb
#
# This, the default implementation, uses an object's local ObjectSpace
# __id__ as its id. This means that an object's identification over
- # drb remains valid only while that object instance remains alive
+ # drb remains valid only while that object instance remains alive
# within the server runtime.
#
# For alternative mechanisms, see DRb::TimerIdConv in rdb/timeridconv.rb
@@ -374,7 +374,7 @@ module DRb
def to_obj(ref)
ObjectSpace._id2ref(ref)
end
-
+
# Convert an object into a reference id.
#
# This implementation returns the object's __id__ in the local
@@ -390,7 +390,7 @@ module DRb
# called over drb, then the object remains in the server space
# and a reference to the object is returned, rather than the
# object being marshalled and moved into the client space.
- module DRbUndumped
+ module DRbUndumped
def _dump(dummy) # :nodoc:
raise TypeError, 'can\'t dump'
end
@@ -424,7 +424,7 @@ module DRb
def self._load(s) # :nodoc:
Marshal::load(s)
end
-
+
def _dump(lv) # :nodoc:
Marshal::dump(@unknown)
end
@@ -456,11 +456,11 @@ module DRb
# +name+ attribute. The marshalled object is held in the +buf+
# attribute.
class DRbUnknown
-
+
# Create a new DRbUnknown object.
#
# +buf+ is a string containing a marshalled object that could not
- # be unmarshalled. +err+ is the error message that was raised
+ # be unmarshalled. +err+ is the error message that was raised
# when the unmarshalling failed. It is used to determine the
# name of the unmarshalled object.
def initialize(err, buf)
@@ -499,7 +499,7 @@ module DRb
# Attempt to load the wrapped marshalled object again.
#
# If the class of the object is now known locally, the object
- # will be unmarshalled and returned. Otherwise, a new
+ # will be unmarshalled and returned. Otherwise, a new
# but identical DRbUnknown object will be returned.
def reload
self.class._load(@buf)
@@ -513,7 +513,7 @@ module DRb
class DRbArray
def initialize(ary)
- @ary = ary.collect { |obj|
+ @ary = ary.collect { |obj|
if obj.kind_of? DRbUndumped
DRbObject.new(obj)
else
@@ -607,7 +607,7 @@ module DRb
rescue
raise(DRbConnError, $!.message, $!.backtrace)
end
-
+
def recv_request(stream) # :nodoc:
ref = load(stream)
ro = DRb.to_obj(ref)
@@ -656,10 +656,10 @@ module DRb
# using configuration +config+. Return a
# protocol instance for this listener.
# [uri_option(uri, config)] Take a URI, possibly containing an option
- # component (e.g. a trailing '?param=val'),
+ # component (e.g. a trailing '?param=val'),
# and return a [uri, option] tuple.
#
- # All of these methods should raise a DRbBadScheme error if the URI
+ # All of these methods should raise a DRbBadScheme error if the URI
# does not identify the protocol they support (e.g. "druby:" for
# the standard Ruby protocol). This is how the DRbProtocol module,
# given a URI, determines which protocol implementation serves that
@@ -675,14 +675,14 @@ module DRb
#
# The protocol instance returned by #open must have the following methods:
#
- # [send_request (ref, msg_id, arg, b)]
+ # [send_request (ref, msg_id, arg, b)]
# Send a request to +ref+ with the given message id and arguments.
# This is most easily implemented by calling DRbMessage.send_request,
# providing a stream that sits on top of the current protocol.
# [recv_reply]
# Receive a reply from the server and return it as a [success-boolean,
# reply-value] pair. This is most easily implemented by calling
- # DRb.recv_reply, providing a stream that sits on top of the
+ # DRb.recv_reply, providing a stream that sits on top of the
# current protocol.
# [alive?]
# Is this connection still alive?
@@ -725,7 +725,7 @@ module DRb
# URI by raising a DRbBadScheme error. If no protocol recognises the
# URI, then a DRbBadURI error is raised. If a protocol accepts the
# URI, but an error occurs in opening it, a DRbConnError is raised.
- def open(uri, config, first=true)
+ def open(uri, config, first=true)
@protocol.each do |prot|
begin
return prot.open(uri, config)
@@ -744,14 +744,14 @@ module DRb
end
module_function :open
- # Open a server listening for connections at +uri+ with
+ # Open a server listening for connections at +uri+ with
# configuration +config+.
#
# The DRbProtocol module asks each registered protocol in turn to
- # try to open a server at the URI. Each protocol signals that it does
- # not handle that URI by raising a DRbBadScheme error. If no protocol
- # recognises the URI, then a DRbBadURI error is raised. If a protocol
- # accepts the URI, but an error occurs in opening it, the underlying
+ # try to open a server at the URI. Each protocol signals that it does
+ # not handle that URI by raising a DRbBadScheme error. If no protocol
+ # recognises the URI, then a DRbBadURI error is raised. If a protocol
+ # accepts the URI, but an error occurs in opening it, the underlying
# error is passed on to the caller.
def open_server(uri, config, first=true)
@protocol.each do |prot|
@@ -773,7 +773,7 @@ module DRb
# The DRbProtocol module asks each registered protocol in turn to
# try to parse the URI. Each protocol signals that it does not handle that
# URI by raising a DRbBadScheme error. If no protocol recognises the
- # URI, then a DRbBadURI error is raised.
+ # URI, then a DRbBadURI error is raised.
def uri_option(uri, config, first=true)
@protocol.each do |prot|
begin
@@ -837,18 +837,23 @@ module DRb
end
def self.open_server_inaddr_any(host, port)
- infos = Socket::getaddrinfo(host, nil,
+ infos = Socket::getaddrinfo(host, nil,
Socket::AF_UNSPEC,
- Socket::SOCK_STREAM,
+ Socket::SOCK_STREAM,
0,
Socket::AI_PASSIVE)
- families = Hash[*infos.collect { |af, *_| af }.uniq.zip([]).flatten]
- return TCPServer.open('0.0.0.0', port) if families.has_key?('AF_INET')
- return TCPServer.open('::', port) if families.has_key?('AF_INET6')
- return TCPServer.open(port)
+ family = infos.collect { |af, *_| af }.uniq
+ case family
+ when ['AF_INET']
+ return TCPServer.open('0.0.0.0', port)
+ when ['AF_INET6']
+ return TCPServer.open('::', port)
+ else
+ return TCPServer.open(port)
+ end
end
- # Open a server listening for connections at +uri+ using
+ # Open a server listening for connections at +uri+ using
# configuration +config+.
def self.open_server(uri, config)
uri = 'druby://:0' unless uri
@@ -894,7 +899,7 @@ module DRb
def peeraddr
@socket.peeraddr
end
-
+
# Get the socket.
def stream; @socket; end
@@ -902,7 +907,7 @@ module DRb
def send_request(ref, msg_id, arg, b)
@msg.send_request(stream, ref, msg_id, arg, b)
end
-
+
# On the server side, receive a request from the client.
def recv_request
@msg.recv_request(stream)
@@ -932,14 +937,14 @@ module DRb
@socket = nil
end
end
-
- # On the server side, for an instance returned by #open_server,
+
+ # On the server side, for an instance returned by #open_server,
# accept a client connection and return a new instance to handle
# the server's side of this client-server session.
def accept
while true
s = @socket.accept
- break if (@acl ? @acl.allow_socket?(s) : true)
+ break if (@acl ? @acl.allow_socket?(s) : true)
s.close
end
if @config[:tcp_original_host].to_s.size == 0
@@ -976,16 +981,16 @@ module DRb
end
attr :option
def to_s; @option; end
-
+
def ==(other)
return false unless DRbURIOption === other
@option == other.option
end
-
+
def hash
@option.hash
end
-
+
alias eql? ==
end
@@ -1002,7 +1007,7 @@ module DRb
# created to act as a stub for the remote referenced object.
def self._load(s)
uri, ref = Marshal.load(s)
-
+
if DRb.here?(uri)
obj = DRb.to_obj(ref)
if ((! obj.tainted?) && Thread.current[:drb_untaint])
@@ -1052,7 +1057,7 @@ module DRb
end
# Get the URI of the remote object.
- def __drburi
+ def __drburi
@uri
end
@@ -1080,7 +1085,7 @@ module DRb
if DRb.here?(@uri)
obj = DRb.to_obj(@ref)
DRb.current_server.check_insecure_method(obj, msg_id)
- return obj.__send__(msg_id, *a, &b)
+ return obj.__send__(msg_id, *a, &b)
end
succ, result = self.class.with_friend(@uri) do
@@ -1103,7 +1108,7 @@ module DRb
def self.with_friend(uri)
friend = DRb.fetch_server(uri)
return yield() unless friend
-
+
save = Thread.current['DRb']
Thread.current['DRb'] = { 'server' => friend }
return yield
@@ -1115,7 +1120,7 @@ module DRb
prefix = "(#{uri}) "
bt = []
result.backtrace.each do |x|
- break if /`__send__'$/ =~ x
+ break if /`__send__'$/ =~ x
if /^\(druby:\/\// =~ x
bt.push(x)
else
@@ -1266,14 +1271,14 @@ module DRb
def self.verbose=(on)
@@verbose = on
end
-
+
# Get the default value of the :verbose option.
def self.verbose
@@verbose
end
def self.make_config(hash={}) # :nodoc:
- default_config = {
+ default_config = {
:idconv => @@idconv,
:verbose => @@verbose,
:tcp_acl => @@acl,
@@ -1363,7 +1368,7 @@ module DRb
attr_reader :thread
# The front object of the DRbServer.
- #
+ #
# This object receives remote method calls made on the server's
# URI alone, with an object id.
attr_reader :front
@@ -1456,7 +1461,7 @@ module DRb
def any_to_s(obj)
obj.to_s + ":#{obj.class}"
rescue
- sprintf("#<%s:0x%lx>", obj.class, obj.__id__)
+ sprintf("#<%s:0x%lx>", obj.class, obj.__id__)
end
# Check that a method is callable via dRuby.
@@ -1464,18 +1469,18 @@ module DRb
# +obj+ is the object we want to invoke the method on. +msg_id+ is the
# method name, as a Symbol.
#
- # If the method is an insecure method (see #insecure_method?) a
+ # If the method is an insecure method (see #insecure_method?) a
# SecurityError is thrown. If the method is private or undefined,
# a NameError is thrown.
def check_insecure_method(obj, msg_id)
return true if Proc === obj && msg_id == :__drb_yield
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)
-
- if obj.private_methods.include?(msg_id)
+
+ if obj.private_methods.include?(msg_id.to_s)
desc = any_to_s(obj)
raise NoMethodError, "private method `#{msg_id}' called for #{desc}"
- elsif obj.protected_methods.include?(msg_id)
+ elsif obj.protected_methods.include?(msg_id.to_s)
desc = any_to_s(obj)
raise NoMethodError, "protected method `#{msg_id}' called for #{desc}"
else
@@ -1483,7 +1488,7 @@ module DRb
end
end
public :check_insecure_method
-
+
class InvokeMethod # :nodoc:
def initialize(drb_server, client)
@drb_server = drb_server
@@ -1505,7 +1510,7 @@ module DRb
perform_with_block
}.value
else
- @result = Thread.new {
+ @result = Thread.new {
Thread.current['DRb'] = info
$SAFE = @safe_level
perform_without_block
@@ -1520,7 +1525,7 @@ module DRb
end
@succ = true
if @msg_id == :to_ary && @result.class == Array
- @result = DRbArray.new(@result)
+ @result = DRbArray.new(@result)
end
return @succ, @result
rescue StandardError, ScriptError, Interrupt
@@ -1536,7 +1541,7 @@ module DRb
@argv = argv
@block = block
end
-
+
def check_insecure_method
@drb_server.check_insecure_method(@obj, @msg_id)
end
@@ -1545,7 +1550,7 @@ module DRb
init_with_client
check_insecure_method
end
-
+
def perform_without_block
if Proc === @obj && @msg_id == :__drb_yield
if @argv.size == 1
@@ -1633,7 +1638,7 @@ module DRb
# The primary local dRuby server.
#
- # This is the server created by the #start_service call.
+ # This is the server created by the #start_service call.
attr_accessor :primary_server
module_function :primary_server=, :primary_server
@@ -1648,8 +1653,8 @@ module DRb
# If the above rule fails to find a server, a DRbServerNotFound
# error is raised.
def current_server
- drb = Thread.current['DRb']
- server = (drb && drb['server']) ? drb['server'] : @primary_server
+ drb = Thread.current['DRb']
+ server = (drb && drb['server']) ? drb['server'] : @primary_server
raise DRbServerNotFound unless server
return server
end
@@ -1695,7 +1700,7 @@ module DRb
DRbServer.make_config
end
module_function :config
-
+
# Get the front object of the current server.
#
# This raises a DRbServerNotFound error if there is no current server.
@@ -1766,7 +1771,7 @@ module DRb
@server.delete(server.uri)
end
module_function :remove_server
-
+
def fetch_server(uri)
@server[uri]
end
diff --git a/lib/drb/extserv.rb b/lib/drb/extserv.rb
index 5996626492..7da8130c2b 100644
--- a/lib/drb/extserv.rb
+++ b/lib/drb/extserv.rb
@@ -1,24 +1,19 @@
=begin
external service
- Copyright (c) 2000,2002 Masatoshi SEKI
+ Copyright (c) 2000,2002 Masatoshi SEKI
=end
require 'drb/drb'
-require 'monitor'
module DRb
class ExtServ
- include MonitorMixin
include DRbUndumped
def initialize(there, name, server=nil)
- super()
@server = server || DRb::primary_server
@name = name
ro = DRbObject.new(nil, there)
- synchronize do
- @invoker = ro.regist(name, DRbObject.new(self, @server.uri))
- end
+ @invoker = ro.regist(name, DRbObject.new(self, @server.uri))
end
attr_reader :server
@@ -27,13 +22,11 @@ module DRb
end
def stop_service
- synchronize do
- @invoker.unregist(@name)
- server = @server
- @server = nil
- server.stop_service
- true
- end
+ @invoker.unregist(@name)
+ server = @server
+ @server = nil
+ server.stop_service
+ true
end
def alive?
diff --git a/lib/drb/extservm.rb b/lib/drb/extservm.rb
index 5937cb0c50..be40aea9f5 100644
--- a/lib/drb/extservm.rb
+++ b/lib/drb/extservm.rb
@@ -1,6 +1,6 @@
=begin
external service manager
- Copyright (c) 2000 Masatoshi SEKI
+ Copyright (c) 2000 Masatoshi SEKI
=end
require 'drb/drb'
@@ -21,7 +21,7 @@ module DRb
def self.command=(cmd)
@@command = cmd
end
-
+
def initialize
super()
@cond = new_cond
@@ -51,7 +51,7 @@ module DRb
end
self
end
-
+
def unregist(name)
synchronize do
@servers.delete(name)
@@ -79,7 +79,11 @@ module DRb
@servers[name] = false
end
uri = @uri || DRb.uri
- Process.detach spawn("#{command} #{uri} #{name}")
+ if RUBY_PLATFORM =~ /mswin32/ && /NT/ =~ ENV["OS"]
+ system(%Q'cmd /c start "ruby" /b #{command} #{uri} #{name}')
+ else
+ system("#{command} #{uri} #{name} &")
+ end
end
end
end
diff --git a/lib/drb/invokemethod.rb b/lib/drb/invokemethod.rb
index 220d0ad68d..412b2ab9b5 100644
--- a/lib/drb/invokemethod.rb
+++ b/lib/drb/invokemethod.rb
@@ -9,7 +9,7 @@ module DRb
end
block_value = @block.call(*x)
end
-
+
def perform_with_block
@obj.__send__(@msg_id, *@argv) do |*x|
jump_error = nil
@@ -20,6 +20,8 @@ module DRb
end
if jump_error
case jump_error.reason
+ when :retry
+ retry
when :break
break(jump_error.exit_value)
else
diff --git a/lib/drb/observer.rb b/lib/drb/observer.rb
index 149426db7b..e7f1668c52 100644
--- a/lib/drb/observer.rb
+++ b/lib/drb/observer.rb
@@ -6,16 +6,16 @@ module DRb
def notify_observers(*arg)
if defined? @observer_state and @observer_state
- if defined? @observer_peers
- @observer_peers.each do |observer, method|
- begin
- observer.send(method, *arg)
- rescue
- delete_observer(observer)
- end
- end
- end
- @observer_state = false
+ if defined? @observer_peers
+ for i in @observer_peers.dup
+ begin
+ i.update(*arg)
+ rescue
+ delete_observer(i)
+ end
+ end
+ end
+ @observer_state = false
end
end
end
diff --git a/lib/drb/ssl.rb b/lib/drb/ssl.rb
index 08f97f4bc6..58d6b7d1e0 100644
--- a/lib/drb/ssl.rb
+++ b/lib/drb/ssl.rb
@@ -15,7 +15,7 @@ module DRb
:SSLClientCA => nil,
:SSLCACertificatePath => nil,
:SSLCACertificateFile => nil,
- :SSLVerifyMode => ::OpenSSL::SSL::VERIFY_NONE,
+ :SSLVerifyMode => ::OpenSSL::SSL::VERIFY_NONE,
:SSLVerifyDepth => nil,
:SSLVerifyCallback => nil, # custom verification
:SSLCertificateStore => nil,
@@ -31,7 +31,7 @@ module DRb
@ssl_ctx = nil
end
- def [](key);
+ def [](key);
@config[key] || DEFAULT[key]
end
@@ -41,14 +41,14 @@ module DRb
ssl.connect
ssl
end
-
+
def accept(tcp)
ssl = OpenSSL::SSL::SSLSocket.new(tcp, @ssl_ctx)
ssl.sync = true
ssl.accept
ssl
end
-
+
def setup_certificate
if @cert && @pkey
return
@@ -77,7 +77,7 @@ module DRb
cert.not_before = Time.now
cert.not_after = Time.now + (365*24*60*60)
cert.public_key = rsa.public_key
-
+
ef = OpenSSL::X509::ExtensionFactory.new(nil,cert)
cert.extensions = [
ef.create_extension("basicConstraints","CA:FALSE"),
@@ -89,7 +89,7 @@ module DRb
cert.add_extension(ef.create_extension("nsComment", comment))
end
cert.sign(rsa, OpenSSL::Digest::SHA1.new)
-
+
@cert = cert
@pkey = rsa
end
@@ -143,7 +143,7 @@ module DRb
end
port = soc.addr[1] if port == 0
@uri = "drbssl://#{host}:#{port}"
-
+
ssl_conf = SSLConfig.new(config)
ssl_conf.setup_certificate
ssl_conf.setup_ssl_context
@@ -159,7 +159,7 @@ module DRb
@ssl = is_established ? soc : nil
super(uri, soc.to_io, config)
end
-
+
def stream; @ssl; end
def close
@@ -169,12 +169,12 @@ module DRb
end
super
end
-
+
def accept
begin
while true
soc = @socket.accept
- break if (@acl ? @acl.allow_socket?(soc) : true)
+ break if (@acl ? @acl.allow_socket?(soc) : true)
soc.close
end
ssl = @config.accept(soc)
@@ -185,6 +185,6 @@ module DRb
end
end
end
-
+
DRbProtocol.add_protocol(DRbSSLSocket)
end
diff --git a/lib/drb/timeridconv.rb b/lib/drb/timeridconv.rb
index 6d8935b1ef..bb2c48d528 100644
--- a/lib/drb/timeridconv.rb
+++ b/lib/drb/timeridconv.rb
@@ -19,7 +19,7 @@ module DRb
end
def add(obj)
- synchronize do
+ synchronize do
key = obj.__id__
@curr[key] = obj
return key
@@ -27,7 +27,7 @@ module DRb
end
def fetch(key, dv=@sentinel)
- synchronize do
+ synchronize do
obj = peek(key)
if obj == @sentinel
return dv unless dv == @sentinel
@@ -39,7 +39,7 @@ module DRb
end
def include?(key)
- synchronize do
+ synchronize do
obj = peek(key)
return false if obj == @sentinel
true
@@ -47,7 +47,7 @@ module DRb
end
def peek(key)
- synchronize do
+ synchronize do
return @curr.fetch(key, @renew.fetch(key, @gc.fetch(key, @sentinel)))
end
end
diff --git a/lib/drb/unix.rb b/lib/drb/unix.rb
index ebecc22901..57feed8301 100644
--- a/lib/drb/unix.rb
+++ b/lib/drb/unix.rb
@@ -8,7 +8,7 @@ module DRb
class DRbUNIXSocket < DRbTCPSocket
def self.parse_uri(uri)
- if /^drbunix:(.*?)(\?(.*))?$/ =~ uri
+ if /^drbunix:(.*?)(\?(.*))?$/ =~ uri
filename = $1
option = $3
[filename, option]
@@ -59,7 +59,7 @@ module DRb
@server_mode = server_mode
@acl = nil
end
-
+
# import from tempfile.rb
Max_try = 10
private
diff --git a/lib/e2mmap.rb b/lib/e2mmap.rb
index ac2fb2dd49..3e2604af5d 100644
--- a/lib/e2mmap.rb
+++ b/lib/e2mmap.rb
@@ -2,6 +2,7 @@
# e2mmap.rb - for ruby 1.1
# $Release Version: 2.0$
# $Revision: 1.10 $
+# $Date: 1999/02/17 12:33:17 $
# by Keiju ISHITSUKA
#
# --
@@ -47,6 +48,8 @@
# Foo.Fail ExistingExceptionClass, arg...
#
#
+fail "Use Ruby 1.1" if VERSION < "1.1"
+
module Exception2MessageMapper
@RCS_ID='-$Id: e2mmap.rb,v 1.10 1999/02/17 12:33:17 keiju Exp keiju $-'
@@ -54,7 +57,13 @@ module Exception2MessageMapper
def E2MM.extend_object(cl)
super
- cl.bind(self) unless cl < E2MM
+ cl.bind(self) unless cl == E2MM
+ end
+
+ # backward compatibility
+ def E2MM.extend_to(b)
+ c = eval("self", b)
+ c.extend(self)
end
def bind(cl)
@@ -78,8 +87,21 @@ module Exception2MessageMapper
E2MM.Raise(self, err, *rest)
end
alias Fail Raise
- alias fail Raise
+ # backward compatibility
+ alias fail! fail
+ def fail(err = nil, *rest)
+ begin
+ E2MM.Fail(self, err, *rest)
+ rescue E2MM::ErrNotRegisteredException
+ super
+ end
+ end
+ class << self
+ public :fail
+ end
+
+
# def_e2message(c, m)
# c: exception
# m: message_form
@@ -88,7 +110,7 @@ module Exception2MessageMapper
def def_e2message(c, m)
E2MM.def_e2message(self, c, m)
end
-
+
# def_exception(n, m, s)
# n: exception_name
# m: message_form
@@ -105,7 +127,7 @@ module Exception2MessageMapper
# {[class, exp] => message, ...}
@MessageMap = {}
- # E2MM.def_e2message(k, e, m)
+ # E2MM.def_exception(k, e, m)
# k: class to define exception under.
# e: exception
# m: message_form
@@ -115,7 +137,7 @@ module Exception2MessageMapper
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
@@ -137,11 +159,12 @@ module Exception2MessageMapper
#
def E2MM.Raise(klass = E2MM, err = nil, *rest)
if form = e2mm_message(klass, err)
- b = $@.nil? ? caller(1) : $@
+ $! = err.new(sprintf(form, *rest))
+ $@ = caller(1) if $@.nil?
#p $@
#p __FILE__
- b.shift if b[0] =~ /^#{Regexp.quote(__FILE__)}:/
- raise err, sprintf(form, *rest), b
+ $@.shift if $@[0] =~ /^#{Regexp.quote(__FILE__)}:/
+ raise
else
E2MM.Fail E2MM, ErrNotRegisteredException, err.inspect
end
@@ -164,8 +187,8 @@ module Exception2MessageMapper
alias message e2mm_message
end
- E2MM.def_exception(E2MM,
- :ErrNotRegisteredException,
+ E2MM.def_exception(E2MM,
+ :ErrNotRegisteredException,
"not registerd exception(%s)")
end
diff --git a/lib/erb.rb b/lib/erb.rb
index 5e9feb9ba5..1ed3c60060 100644
--- a/lib/erb.rb
+++ b/lib/erb.rb
@@ -20,7 +20,7 @@
# purposes of generating document information details and/or flow control.
#
# A very simple example is this:
-#
+#
# require 'erb'
#
# x = 42
@@ -58,24 +58,6 @@
#
# See the ERB.new and ERB#result methods for more detail.
#
-# == Character encodings
-#
-# ERB (or ruby code generated by ERB) returns a string in the same
-# character encoding as the input string. When the input string has
-# a magic comment, however, it returns a string in the encoding specified
-# by the magic comment.
-#
-# # -*- coding: UTF-8 -*-
-# require 'erb'
-#
-# template = ERB.new <<EOF
-# <%#-*- coding: Big5 -*-%>
-# \_\_ENCODING\_\_ is <%= \_\_ENCODING\_\_ %>.
-# EOF
-# puts template.result
-#
-# <em>Prints:</em> \_\_ENCODING\_\_ is Big5.
-#
#
# == Examples
#
@@ -86,39 +68,39 @@
# <tt>%q{...}</tt> to avoid trouble with the backslash.
#
# require "erb"
-#
+#
# # Create template.
# template = %q{
# From: James Edward Gray II <james@grayproductions.net>
# To: <%= to %>
# Subject: Addressing Needs
-#
+#
# <%= to[/\w+/] %>:
-#
+#
# Just wanted to send a quick note assuring that your needs are being
# addressed.
-#
+#
# I want you to know that my team will keep working on the issues,
# especially:
-#
+#
# <%# ignore numerous minor requests -- focus on priorities %>
# % priorities.each do |priority|
# * <%= priority %>
# % end
-#
+#
# Thanks for your patience.
-#
+#
# James Edward Gray II
# }.gsub(/^ /, '')
-#
+#
# message = ERB.new(template, 0, "%<>")
-#
+#
# # Set up template data.
# to = "Community Spokesman <spokesman@ruby_community.org>"
# priorities = [ "Run Ruby Quiz",
# "Document Modules",
# "Answer Questions on Ruby Talk" ]
-#
+#
# # Produce result.
# email = message.result
# puts email
@@ -128,19 +110,19 @@
# From: James Edward Gray II <james@grayproductions.net>
# To: Community Spokesman <spokesman@ruby_community.org>
# Subject: Addressing Needs
-#
+#
# Community:
-#
+#
# Just wanted to send a quick note assuring that your needs are being addressed.
-#
+#
# I want you to know that my team will keep working on the issues, especially:
-#
+#
# * Run Ruby Quiz
# * Document Modules
# * Answer Questions on Ruby Talk
-#
+#
# Thanks for your patience.
-#
+#
# James Edward Gray II
#
# === Ruby in HTML
@@ -150,7 +132,7 @@
# variables in the Product object can be resolved.
#
# require "erb"
-#
+#
# # Build template data class.
# class Product
# def initialize( code, name, desc, cost )
@@ -158,37 +140,37 @@
# @name = name
# @desc = desc
# @cost = cost
-#
+#
# @features = [ ]
# end
-#
+#
# def add_feature( feature )
# @features << feature
# end
-#
+#
# # Support templating of member data.
# def get_binding
# binding
# end
-#
+#
# # ...
# end
-#
+#
# # Create template.
# template = %{
# <html>
# <head><title>Ruby Toys -- <%= @name %></title></head>
# <body>
-#
+#
# <h1><%= @name %> (<%= @code %>)</h1>
# <p><%= @desc %></p>
-#
+#
# <ul>
# <% @features.each do |f| %>
# <li><b><%= f %></b></li>
# <% end %>
# </ul>
-#
+#
# <p>
# <% if @cost < 10 %>
# <b>Only <%= @cost %>!!!</b>
@@ -196,13 +178,13 @@
# Call for a price, today!
# <% end %>
# </p>
-#
+#
# </body>
# </html>
# }.gsub(/^ /, '')
-#
+#
# rhtml = ERB.new(template)
-#
+#
# # Set up template data.
# toy = Product.new( "TZ-1002",
# "Rubysapien",
@@ -213,7 +195,7 @@
# toy.add_feature("Karate-Chop Action!!!")
# toy.add_feature("Matz signature on left leg.")
# toy.add_feature("Gem studded eyes... Rubies, of course!")
-#
+#
# # Produce result.
# rhtml.run(toy.get_binding)
#
@@ -222,10 +204,10 @@
# <html>
# <head><title>Ruby Toys -- Rubysapien</title></head>
# <body>
-#
+#
# <h1>Rubysapien (TZ-1002)</h1>
# <p>Geek's Best Friend! Responds to Ruby commands...</p>
-#
+#
# <ul>
# <li><b>Listens for verbal commands in the Ruby language!</b></li>
# <li><b>Ignores Perl, Java, and all C variants.</b></li>
@@ -233,15 +215,15 @@
# <li><b>Matz signature on left leg.</b></li>
# <li><b>Gem studded eyes... Rubies, of course!</b></li>
# </ul>
-#
+#
# <p>
# Call for a price, today!
# </p>
-#
+#
# </body>
# </html>
#
-#
+#
# == Notes
#
# There are a variety of templating solutions available in various Ruby projects:
@@ -254,7 +236,7 @@
# Rails, the web application framework, uses ERB to create views.
#
class ERB
- Revision = '$Date:: $' #'
+ Revision = '$Date$' #'
# Returns revision information for the erb.rb module.
def self.version
@@ -318,11 +300,11 @@ class ERB
end
end
attr_accessor :stag
-
+
def scan(&block)
@stag = nil
if @percent
- @src.each_line do |line|
+ @src.each do |line|
percent_line(line, &block)
end
else
@@ -425,7 +407,7 @@ class ERB
end
end
end
-
+
Scanner.regist_scanner(SimpleScanner, nil, false)
begin
@@ -471,10 +453,10 @@ class ERB
end
class Buffer # :nodoc:
- def initialize(compiler, enc=nil)
+ def initialize(compiler)
@compiler = compiler
@line = []
- @script = enc ? "#coding:#{enc.to_s}\n" : ""
+ @script = ""
@compiler.pre_cmd.each do |x|
push(x)
end
@@ -484,13 +466,13 @@ class ERB
def push(cmd)
@line << cmd
end
-
+
def cr
@script << (@line.join('; '))
@line = []
@script << "\n"
end
-
+
def close
return unless @line
@compiler.post_cmd.each do |x|
@@ -511,16 +493,12 @@ class ERB
end
def compile(s)
- enc = s.encoding
- raise ArgumentError, "#{enc} is not ASCII compatible" if enc.dummy?
- s = s.dup.force_encoding("ASCII-8BIT") # don't use constant Enoding::ASCII_8BIT for miniruby
- enc = detect_magic_comment(s) || enc
- out = Buffer.new(self, enc)
+ out = Buffer.new(self)
content = ''
scanner = make_scanner(s)
scanner.scan do |token|
- next if token.nil?
+ next if token.nil?
next if token == ''
if scanner.stag.nil?
case token
@@ -572,7 +550,7 @@ class ERB
end
out.push("#{@put_cmd} #{content_dump(content)}") if content.size > 0
out.close
- return out.script, enc
+ out.script
end
def prepare_trim_mode(mode)
@@ -612,18 +590,6 @@ class ERB
end
attr_reader :percent, :trim_mode
attr_accessor :put_cmd, :insert_cmd, :pre_cmd, :post_cmd
-
- private
- def detect_magic_comment(s)
- if /\A<%#(.*)%>/ =~ s or (@percent and /\A%#(.*)/ =~ s)
- comment = $1
- comment = $1 if comment[/-\*-\s*(.*?)\s*-*-$/]
- if %r"coding\s*[=:]\s*([[:alnum:]\-_]+)" =~ comment
- enc = $1.sub(/-(?:mac|dos|unix)/i, '')
- enc = Encoding.find(enc)
- end
- end
- end
end
end
@@ -632,19 +598,19 @@ end
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. 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:
- #
+ #
# % enables Ruby code processing for lines beginning with %
# <> omit newline for lines starting with <% and ending in %>
# > omit newline for lines ending in %>
- #
+ #
# _eoutvar_ can be used to set the name of the variable ERB will build up
# its output in. This is useful when you need to run multiple ERB
# templates through the same binding and/or when you want to control where
@@ -653,20 +619,20 @@ class ERB
# === Example
#
# require "erb"
- #
+ #
# # build data class
# class Listings
# PRODUCT = { :name => "Chicken Fried Steak",
# :desc => "A well messages pattie, breaded and fried.",
# :cost => 9.95 }
- #
+ #
# attr_reader :product, :price
- #
+ #
# def initialize( product = "", price = "" )
# @product = product
# @price = price
# end
- #
+ #
# def build
# b = binding
# # create and run templates, filling member data variables
@@ -680,26 +646,26 @@ class ERB
# END_PRICE
# end
# end
- #
+ #
# # setup template data
# listings = Listings.new
# listings.build
- #
+ #
# puts listings.product + "\n" + listings.price
#
# _Generates_
#
# Chicken Fried Steak
# A well messages pattie, breaded and fried.
- #
+ #
# Chicken Fried Steak -- 9.95
# A well messages pattie, breaded and fried.
- #
+ #
def initialize(str, safe_level=nil, trim_mode=nil, eoutvar='_erbout')
@safe_level = safe_level
compiler = ERB::Compiler.new(trim_mode)
set_eoutvar(compiler, eoutvar)
- @src, @enc = *compiler.compile(str)
+ @src = compiler.compile(str)
@filename = nil
end
@@ -721,11 +687,11 @@ class ERB
cmd = []
cmd.push "#{eoutvar} = ''"
-
+
compiler.pre_cmd = cmd
cmd = []
- cmd.push("#{eoutvar}.force_encoding(__ENCODING__)")
+ cmd.push(eoutvar)
compiler.post_cmd = cmd
end
@@ -739,18 +705,18 @@ class ERB
# Executes the generated ERB code to produce a completed template, returning
# the results of that code. (See ERB#new for details on how this process can
# be affected by _safe_level_.)
- #
+ #
# _b_ accepts a Binding or Proc object which is used to set the context of
# code evaluation.
#
def result(b=TOPLEVEL_BINDING)
if @safe_level
- proc {
+ proc {
$SAFE = @safe_level
- eval(@src, b, (@filename || '(erb)'), 0)
+ eval(@src, b, (@filename || '(erb)'), 1)
}.call
else
- eval(@src, b, (@filename || '(erb)'), 0)
+ eval(@src, b, (@filename || '(erb)'), 1)
end
end
@@ -762,11 +728,7 @@ 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
- magic_comment = "#coding:#{@enc}\n"
- mod.module_eval do
- eval(magic_comment + "def #{methodname}\n" + src + "\nend\n", binding, fname, -2)
- end
+ mod.module_eval("def #{methodname}\n" + self.src + "\nend\n", fname, 0)
end
# Create unnamed module, define _methodname_ as instance method of it, and return it.
@@ -813,14 +775,14 @@ class ERB
public
#
# A utility method for escaping HTML tag characters in _s_.
- #
+ #
# require "erb"
# include ERB::Util
- #
+ #
# puts html_escape("is a > 0 & a < 10?")
- #
+ #
# _Generates_
- #
+ #
# is a &gt; 0 &amp; a &lt; 10?
#
def html_escape(s)
@@ -829,23 +791,21 @@ class ERB
alias h html_escape
module_function :h
module_function :html_escape
-
+
#
# A utility method for encoding the String _s_ as a URL.
- #
+ #
# require "erb"
# include ERB::Util
- #
+ #
# puts url_encode("Programming Ruby: The Pragmatic Programmer's Guide")
- #
+ #
# _Generates_
- #
+ #
# Programming%20Ruby%3A%20%20The%20Pragmatic%20Programmer%27s%20Guide
#
def url_encode(s)
- s.to_s.dup.force_encoding("ASCII-8BIT").gsub(/[^a-zA-Z0-9_\-.]/n) {
- sprintf("%%%02X", $&.unpack("C")[0])
- }
+ s.to_s.gsub(/[^a-zA-Z0-9_\-.]/n){ sprintf("%%%02X", $&.unpack("C")[0]) }
end
alias u url_encode
module_function :u
diff --git a/lib/eregex.rb b/lib/eregex.rb
new file mode 100644
index 0000000000..cc7a7f6f46
--- /dev/null
+++ b/lib/eregex.rb
@@ -0,0 +1,37 @@
+# this is just a proof of concept toy.
+
+class RegOr
+ def initialize(re1, re2)
+ @re1 = re1
+ @re2 = re2
+ end
+
+ def =~ (str)
+ @re1 =~ str or @re2 =~ str
+ end
+end
+
+class RegAnd
+ def initialize(re1, re2)
+ @re1 = re1
+ @re2 = re2
+ end
+
+ def =~ (str)
+ @re1 =~ str and @re2 =~ str
+ end
+end
+
+class Regexp
+ def |(other)
+ RegOr.new(self, other)
+ end
+ def &(other)
+ RegAnd.new(self, other)
+ end
+end
+
+if __FILE__ == $0
+ p "abc" =~ /b/|/c/
+ p "abc" =~ /b/&/c/
+end
diff --git a/lib/fileutils.rb b/lib/fileutils.rb
index 2a6b248585..3fdb6cbfe6 100644
--- a/lib/fileutils.rb
+++ b/lib/fileutils.rb
@@ -1,17 +1,17 @@
-#
+#
# = fileutils.rb
-#
-# Copyright (c) 2000-2007 Minero Aoki
-#
+#
+# Copyright (c) 2000-2006 Minero Aoki
+#
# This program is free software.
# You can distribute/modify this program under the same terms of ruby.
-#
+#
# == module FileUtils
-#
+#
# Namespace for several file utility methods for copying, moving, removing, etc.
-#
+#
# === Module Functions
-#
+#
# cd(dir, options)
# cd(dir, options) {|dir| .... }
# pwd()
@@ -64,23 +64,23 @@
# uptodate?(file, cmp_list)
#
# == module FileUtils::Verbose
-#
+#
# This module has all methods of FileUtils module, but it outputs messages
# before acting. This equates to passing the <tt>:verbose</tt> flag to methods
# in FileUtils.
-#
+#
# == module FileUtils::NoWrite
-#
+#
# This module has all methods of FileUtils module, but never changes
# files/directories. This equates to passing the <tt>:noop</tt> flag to methods
# in FileUtils.
-#
+#
# == module FileUtils::DryRun
-#
+#
# This module has all methods of FileUtils module, but never changes
# files/directories. This equates to passing the <tt>:noop</tt> and
# <tt>:verbose</tt> flags to methods in FileUtils.
-#
+#
module FileUtils
@@ -107,14 +107,14 @@ module FileUtils
#
# Options: verbose
- #
+ #
# Changes the current directory to the directory +dir+.
- #
+ #
# If this method is called with block, resumes to the old
# working directory after the block execution finished.
- #
+ #
# FileUtils.cd('/', :verbose => true) # chdir and report it
- #
+ #
def cd(dir, options = {}, &block) # :yield: dir
fu_check_options options, OPT_TABLE['cd']
fu_output_message "cd #{dir}" if options[:verbose]
@@ -131,13 +131,13 @@ module FileUtils
#
# Options: (none)
- #
+ #
# Returns true if +newer+ is newer than all +old_list+.
# Non-existent files are older than any file.
- #
+ #
# FileUtils.uptodate?('hello.o', %w(hello.c hello.h)) or \
# system 'make hello.o'
- #
+ #
def uptodate?(new, old_list, options = nil)
raise ArgumentError, 'uptodate? does not accept any option' if options
@@ -154,14 +154,14 @@ module FileUtils
#
# 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
- #
+ #
def mkdir(list, options = {})
fu_check_options options, OPT_TABLE['mkdir']
list = fu_list(list)
@@ -178,12 +178,12 @@ module FileUtils
#
# 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 it does not exist.
# * /usr
# * /usr/local
@@ -191,7 +191,7 @@ module FileUtils
# * /usr/local/lib/ruby
#
# You can pass several directories at a time in a list.
- #
+ #
def mkdir_p(list, options = {})
fu_check_options options, OPT_TABLE['mkdir_p']
list = fu_list(list)
@@ -212,11 +212,11 @@ module FileUtils
stack.push path
path = File.dirname(path)
end
- stack.reverse_each do |dir|
+ stack.reverse_each do |path|
begin
- fu_mkdir dir, options[:mode]
+ fu_mkdir path, options[:mode]
rescue SystemCallError => err
- raise unless File.directory?(dir)
+ raise unless File.directory?(path)
end
end
end
@@ -247,35 +247,26 @@ module FileUtils
#
# Options: 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
- #
+ #
def rmdir(list, options = {})
fu_check_options options, OPT_TABLE['rmdir']
list = fu_list(list)
- parents = options[:parents]
- fu_output_message "rmdir #{parents ? '-p ' : ''}#{list.join ' '}" if options[:verbose]
+ fu_output_message "rmdir #{list.join ' '}" if options[:verbose]
return if options[:noop]
list.each do |dir|
- begin
- Dir.rmdir(dir = dir.sub(%r</\z>, ''))
- if parents
- until (parent = File.dirname(dir)) == '.' or parent == dir
- Dir.rmdir(dir)
- end
- end
- rescue Errno::ENOTEMPTY, Errno::ENOENT
- end
+ Dir.rmdir dir.sub(%r</\z>, '')
end
end
module_function :rmdir
- OPT_TABLE['rmdir'] = [:parents, :noop, :verbose]
+ OPT_TABLE['rmdir'] = [:noop, :verbose]
#
# Options: force noop verbose
@@ -286,19 +277,19 @@ module FileUtils
# 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 '/usr/bin/emacs21', '/usr/bin/emacs'
- #
+ #
# <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.
- #
+ #
# include FileUtils
# cd '/sbin'
# FileUtils.ln %w(cp mv mkdir), '/bin' # Now /sbin/cp and /bin/cp are linked.
- #
+ #
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]
@@ -320,24 +311,24 @@ module FileUtils
# Options: force noop verbose
#
# <b><tt>ln_s(old, new, options = {})</tt></b>
- #
+ #
# Creates a symbolic link +new+ which points to +old+. If +new+ already
# exists and it is a directory, creates a symbolic link +new/old+. If +new+
# already exists and it is not a directory, raises Errno::EEXIST. But if
# :force option is set, overwrite +new+.
- #
+ #
# FileUtils.ln_s '/usr/bin/ruby', '/usr/local/bin/ruby'
# FileUtils.ln_s 'verylongsourcefilename.c', 'c', :force => true
- #
+ #
# <b><tt>ln_s(list, destdir, options = {})</tt></b>
- #
+ #
# 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.
#
# If +destdir+ is not a directory, raises Errno::ENOTDIR.
- #
+ #
# FileUtils.ln_s Dir.glob('bin/*.rb'), '/home/aamine/bin'
- #
+ #
def ln_s(src, dest, options = {})
fu_check_options options, OPT_TABLE['ln_s']
fu_output_message "ln -s#{options[:force] ? 'f' : ''} #{[src,dest].flatten.join ' '}" if options[:verbose]
@@ -357,10 +348,10 @@ module FileUtils
#
# Options: noop verbose
- #
+ #
# Same as
# #ln_s(src, dest, :force)
- #
+ #
def ln_sf(src, dest, options = {})
fu_check_options options, OPT_TABLE['ln_sf']
options = options.dup
@@ -383,7 +374,7 @@ module FileUtils
# 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 'symlink', 'dest' # copy content, "dest" is not a symlink
- #
+ #
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]
@@ -402,17 +393,17 @@ module FileUtils
#
# 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
# +src+ to +dest/src+.
#
# +src+ can be a list of files.
- #
+ #
# # Installing ruby library "mylib" under the site_ruby
# 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/aamine/lib/ruby', :noop => true, :verbose => true
@@ -422,11 +413,12 @@ module FileUtils
# # use following code.
# FileUtils.cp_r 'src/.', 'dest' # cp_r('src', 'dest') makes src/dest,
# # but this doesn't.
- #
+ #
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[:dereference_root] = true unless options.key?(:dereference_root)
fu_each_src_dest(src, dest) do |s, d|
copy_entry s, d, options[:preserve], options[:dereference_root], options[:remove_destination]
end
@@ -479,22 +471,22 @@ module FileUtils
# +dest+ must respond to #write(str).
#
def copy_stream(src, dest)
- IO.copy_stream(src, dest)
+ fu_copy_stream0 src, dest, fu_stream_blksize(src, dest)
end
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.
- #
+ # disk partition, the file is copied instead.
+ #
# FileUtils.mv 'badname.rb', 'goodname.rb'
# FileUtils.mv 'stuff.rb', '/notexist/lib/ruby', :force => true # no error
- #
+ #
# FileUtils.mv %w(junk.txt dust.txt), '/home/aamine/.trash/'
# FileUtils.mv Dir.glob('test*.rb'), 'test', :noop => true, :verbose => true
- #
+ #
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]
@@ -533,20 +525,20 @@ module FileUtils
OPT_TABLE['move'] = [:force, :noop, :verbose, :secure]
def rename_cannot_overwrite_file? #:nodoc:
- /cygwin|mswin|mingw|bccwin|emx/ =~ RUBY_PLATFORM
+ /djgpp|cygwin|mswin|mingw|bccwin|wince|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
- #
+ #
def rm(list, options = {})
fu_check_options options, OPT_TABLE['rm']
list = fu_list(list)
@@ -567,7 +559,7 @@ module FileUtils
#
# Options: noop verbose
- #
+ #
# Equivalent to
#
# #rm(list, :force => true)
@@ -588,11 +580,11 @@ module FileUtils
#
# 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 '/', :force => true # :-)
#
@@ -606,7 +598,7 @@ module FileUtils
#
# NOTE: This method calls #remove_entry_secure if :secure option is set.
# See also #remove_entry_secure.
- #
+ #
def rm_r(list, options = {})
fu_check_options options, OPT_TABLE['rm_r']
# options[:secure] = true unless options.key?(:secure)
@@ -627,14 +619,14 @@ module FileUtils
#
# Options: noop verbose secure
- #
+ #
# Equivalent to
#
# #rm_r(list, :force => true)
#
# WARNING: This method causes local vulnerability.
# Read the documentation of #rm_r first.
- #
+ #
def rm_rf(list, options = {})
fu_check_options options, OPT_TABLE['rm_rf']
options = options.dup
@@ -694,7 +686,7 @@ module FileUtils
end
# is a directory.
parent_st = File.stat(File.dirname(fullpath))
- unless parent_st.world_writable?
+ unless fu_world_writable?(parent_st)
remove_entry path, force
return
end
@@ -732,6 +724,11 @@ module FileUtils
end
module_function :remove_entry_secure
+ def fu_world_writable?(st)
+ (st.mode & 0002) != 0
+ end
+ private_module_function :fu_world_writable?
+
def fu_have_symlink? #:nodoc
File.symlink nil, nil
rescue NotImplementedError
@@ -788,7 +785,7 @@ module FileUtils
#
# Returns true if the contents of a file A and a file B are identical.
- #
+ #
# FileUtils.compare_file('somefile', 'somefile') #=> true
# FileUtils.compare_file('/bin/cp', '/bin/mv') #=> maybe false
#
@@ -828,14 +825,14 @@ module FileUtils
#
# 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, 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]
@@ -856,14 +853,14 @@ module FileUtils
#
# Options: noop verbose
- #
+ #
# Changes permission bits on the named files (in +list+) to the bit pattern
# represented by +mode+.
- #
+ #
# FileUtils.chmod 0755, 'somecommand'
# FileUtils.chmod 0644, %w(my.rb your.rb his.rb her.rb)
# FileUtils.chmod 0755, '/usr/bin/ruby', :verbose => true
- #
+ #
def chmod(mode, list, options = {})
fu_check_options options, OPT_TABLE['chmod']
list = fu_list(list)
@@ -879,12 +876,12 @@ module FileUtils
#
# Options: noop verbose force
- #
+ #
# Changes permission bits on the named files (in +list+)
# to the bit pattern represented by +mode+.
- #
+ #
# FileUtils.chmod_R 0700, "/tmp/app.#{$$}"
- #
+ #
def chmod_R(mode, list, options = {})
fu_check_options options, OPT_TABLE['chmod_R']
list = fu_list(list)
@@ -908,16 +905,16 @@ module FileUtils
#
# Options: noop verbose
- #
+ #
# 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.
- #
+ #
# FileUtils.chown 'root', 'staff', '/usr/local/bin/ruby'
# FileUtils.chown nil, 'bin', Dir.glob('/usr/bin/*'), :verbose => true
- #
+ #
def chown(user, group, list, options = {})
fu_check_options options, OPT_TABLE['chown']
list = fu_list(list)
@@ -937,16 +934,16 @@ module FileUtils
#
# Options: noop verbose force
- #
+ #
# 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.
- #
+ #
# FileUtils.chown_R 'www', 'www', '/var/www/htdocs'
# FileUtils.chown_R 'cvs', 'cvs', '/var/cvs', :verbose => true
- #
+ #
def chown_R(user, group, list, options = {})
fu_check_options options, OPT_TABLE['chown_R']
list = fu_list(list)
@@ -987,7 +984,6 @@ module FileUtils
def fu_get_gid(group) #:nodoc:
return nil unless group
- group = group.to_s
if /\A\d+\z/ =~ group
then group.to_i
else Etc.getgrnam(group).gid
@@ -1011,13 +1007,13 @@ module FileUtils
#
# Options: noop verbose
- #
+ #
# 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, options = {})
fu_check_options options, OPT_TABLE['touch']
list = fu_list(list)
@@ -1051,11 +1047,14 @@ module FileUtils
private
def fu_windows?
- /mswin|mingw|bccwin|emx/ =~ RUBY_PLATFORM
+ /mswin|mingw|bccwin|wince|emx/ =~ RUBY_PLATFORM
end
- def fu_copy_stream0(src, dest, blksize = nil) #:nodoc:
- IO.copy_stream(src, dest)
+ def fu_copy_stream0(src, dest, blksize) #:nodoc:
+ # FIXME: readpartial?
+ while s = src.read(blksize)
+ dest.write s
+ end
end
def fu_stream_blksize(*streams)
@@ -1104,7 +1103,7 @@ module FileUtils
def path
if @path
- File.path(@path)
+ @path.to_str
else
join(@prefix, @rel)
end
@@ -1231,9 +1230,6 @@ module FileUtils
when file?
copy_file dest
when directory?
- if !File.exist?(dest) and /^#{Regexp.quote(path)}/ =~ File.dirname(dest)
- raise ArgumentError, "cannot copy directory %s to itself %s" % [path, dest]
- end
begin
Dir.mkdir dest
rescue
@@ -1261,9 +1257,12 @@ module FileUtils
end
def copy_file(dest)
- File.open(dest, 'wb') do |f|
- IO.copy_stream(path(), f)
- end
+ st = stat()
+ File.open(path(), 'rb') {|r|
+ File.open(dest, 'wb', st.mode) {|w|
+ fu_copy_stream0 r, w, (fu_blksize(st) || fu_default_blksize())
+ }
+ }
end
def copy_metadata(path)
@@ -1379,14 +1378,14 @@ module FileUtils
end
def join(dir, base)
- return File.path(dir) if not base or base == '.'
- return File.path(base) if not dir or dir == '.'
+ return dir.to_str if not base or base == '.'
+ return base.to_str if not dir or dir == '.'
File.join(dir, base)
end
end # class Entry_
def fu_list(arg) #:nodoc:
- [arg].flatten.map {|path| File.path(path) }
+ [arg].flatten.map {|path| path.to_str }
end
private_module_function :fu_list
@@ -1399,17 +1398,17 @@ module FileUtils
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)
+ if src.is_a?(Array)
+ src.each do |s|
+ s = s.to_str
yield s, File.join(dest, File.basename(s))
end
else
- src = File.path(src)
+ src = src.to_str
if File.directory?(dest)
yield src, File.join(dest, File.basename(src))
else
- yield src, File.path(dest)
+ yield src, dest.to_str
end
end
end
@@ -1443,8 +1442,8 @@ module FileUtils
private_module_function :fu_check_options
def fu_update_option(args, new) #:nodoc:
- if tmp = Hash.try_convert(args.last)
- args[-1] = tmp.dup.update(new)
+ if args.last.is_a?(Hash)
+ args[-1] = args.last.dup.update(new)
else
args.push new
end
@@ -1510,14 +1509,14 @@ module FileUtils
OPT_TABLE.keys.select {|m| OPT_TABLE[m].include?(opt) }
end
- METHODS = singleton_methods() - [:private_module_function,
- :commands, :options, :have_option?, :options_of, :collect_method]
+ METHODS = singleton_methods() - %w( private_module_function
+ commands options have_option? options_of collect_method )
- #
+ #
# This module has all methods of FileUtils module, but it outputs messages
# before acting. This equates to passing the <tt>:verbose</tt> flag to
# methods in FileUtils.
- #
+ #
module Verbose
include FileUtils
@fileutils_output = $stderr
@@ -1538,11 +1537,11 @@ module FileUtils
end
end
- #
+ #
# This module has all methods of FileUtils module, but never changes
# files/directories. This equates to passing the <tt>:noop</tt> flag
# to methods in FileUtils.
- #
+ #
module NoWrite
include FileUtils
@fileutils_output = $stderr
@@ -1563,12 +1562,12 @@ module FileUtils
end
end
- #
+ #
# This module has all methods of FileUtils module, but never changes
# files/directories, with printing message before acting.
# This equates to passing the <tt>:noop</tt> and <tt>:verbose</tt> flag
# to methods in FileUtils.
- #
+ #
module DryRun
include FileUtils
@fileutils_output = $stderr
diff --git a/lib/finalize.rb b/lib/finalize.rb
new file mode 100644
index 0000000000..9b6b302cac
--- /dev/null
+++ b/lib/finalize.rb
@@ -0,0 +1,193 @@
+#--
+# finalizer.rb -
+# $Release Version: 0.3$
+# $Revision: 1.4 $
+# $Date: 1998/02/27 05:34:33 $
+# by Keiju ISHITSUKA
+#++
+#
+# Usage:
+#
+# add dependency R_method(obj, dependant)
+# add(obj, dependant, method = :finalize, *opt)
+# add_dependency(obj, dependant, method = :finalize, *opt)
+#
+# delete dependency R_method(obj, dependant)
+# delete(obj_or_id, dependant, method = :finalize)
+# delete_dependency(obj_or_id, dependant, method = :finalize)
+#
+# delete dependency R_*(obj, dependant)
+# delete_all_dependency(obj_or_id, dependant)
+#
+# delete dependency R_method(*, dependant)
+# delete_by_dependant(dependant, method = :finalize)
+#
+# delete dependency R_*(*, dependant)
+# delete_all_by_dependant(dependant)
+#
+# delete all dependency R_*(*, *)
+# delete_all
+#
+# finalize the dependant connected by dependency R_method(obj, dependtant).
+# finalize(obj_or_id, dependant, method = :finalize)
+# finalize_dependency(obj_or_id, dependant, method = :finalize)
+#
+# finalize all dependants connected by dependency R_*(obj, dependtant).
+# finalize_all_dependency(obj_or_id, dependant)
+#
+# finalize the dependant connected by dependency R_method(*, dependtant).
+# finalize_by_dependant(dependant, method = :finalize)
+#
+# finalize all dependants connected by dependency R_*(*, dependant).
+# finalize_all_by_dependant(dependant)
+#
+# finalize all dependency registered to the Finalizer.
+# finalize_all
+#
+# stop invoking Finalizer on GC.
+# safe{..}
+#
+
+module Finalizer
+ RCS_ID='-$Id: finalize.rb,v 1.4 1998/02/27 05:34:33 keiju Exp keiju $-'
+
+ class <<self
+ # @dependency: {id => [[dependant, method, *opt], ...], ...}
+
+ # add dependency R_method(obj, dependant)
+ def add_dependency(obj, dependant, method = :finalize, *opt)
+ ObjectSpace.call_finalizer(obj)
+ method = method.intern unless method.kind_of?(Integer)
+ assoc = [dependant, method].concat(opt)
+ if dep = @dependency[obj.object_id]
+ dep.push assoc
+ else
+ @dependency[obj.object_id] = [assoc]
+ end
+ end
+ alias add add_dependency
+
+ # delete dependency R_method(obj, dependant)
+ def delete_dependency(id, dependant, method = :finalize)
+ id = id.object_id unless id.kind_of?(Integer)
+ method = method.intern unless method.kind_of?(Integer)
+ for assoc in @dependency[id]
+ assoc.delete_if do
+ |d, m, *o|
+ d == dependant && m == method
+ end
+ @dependency.delete(id) if assoc.empty?
+ end
+ end
+ alias delete delete_dependency
+
+ # delete dependency R_*(obj, dependant)
+ def delete_all_dependency(id, dependant)
+ id = id.object_id unless id.kind_of?(Integer)
+ method = method.intern unless method.kind_of?(Integer)
+ for assoc in @dependency[id]
+ assoc.delete_if do
+ |d, m, *o|
+ d == dependant
+ end
+ @dependency.delete(id) if assoc.empty?
+ end
+ end
+
+ # delete dependency R_method(*, dependant)
+ def delete_by_dependant(dependant, method = :finalize)
+ method = method.intern unless method.kind_of?(Integer)
+ for id in @dependency.keys
+ delete(id, dependant, method)
+ end
+ end
+
+ # delete dependency R_*(*, dependant)
+ def delete_all_by_dependant(dependant)
+ for id in @dependency.keys
+ delete_all_dependency(id, dependant)
+ end
+ end
+
+ # finalize the depandant connected by dependency R_method(obj, dependtant)
+ def finalize_dependency(id, dependant, method = :finalize)
+ id = id.object_id unless id.kind_of?(Integer)
+ method = method.intern unless method.kind_of?(Integer)
+ for assocs in @dependency[id]
+ assocs.delete_if do
+ |d, m, *o|
+ d.send(m, id, *o) if ret = d == dependant && m == method
+ ret
+ end
+ @dependency.delete(id) if assoc.empty?
+ end
+ end
+ alias finalize finalize_dependency
+
+ # finalize all dependants connected by dependency R_*(obj, dependtant)
+ def finalize_all_dependency(id, dependant)
+ id = id.object_id unless id.kind_of?(Integer)
+ method = method.intern unless method.kind_of?(Integer)
+ for assoc in @dependency[id]
+ assoc.delete_if do
+ |d, m, *o|
+ d.send(m, id, *o) if ret = d == dependant
+ end
+ @dependency.delete(id) if assoc.empty?
+ end
+ end
+
+ # finalize the dependant connected by dependency R_method(*, dependtant)
+ def finalize_by_dependant(dependant, method = :finalize)
+ method = method.intern unless method.kind_of?(Integer)
+ for id in @dependency.keys
+ finalize(id, dependant, method)
+ end
+ end
+
+ # finalize all dependants connected by dependency R_*(*, dependtant)
+ def finalize_all_by_dependant(dependant)
+ for id in @dependency.keys
+ finalize_all_dependency(id, dependant)
+ end
+ end
+
+ # finalize all dependants registered to the Finalizer.
+ def finalize_all
+ for id, assocs in @dependency
+ for dependant, method, *opt in assocs
+ dependant.send(method, id, *opt)
+ end
+ assocs.clear
+ end
+ end
+
+ # method to call finalize_* safely.
+ def safe
+ old_status = Thread.critical
+ Thread.critical = true
+ ObjectSpace.remove_finalizer(@proc)
+ begin
+ yield
+ ensure
+ ObjectSpace.add_finalizer(@proc)
+ Thread.critical = old_status
+ end
+ end
+
+ private
+
+ # registering function to ObjectSpace#add_finalizer
+ def final_of(id)
+ if assocs = @dependency.delete(id)
+ for dependant, method, *opt in assocs
+ dependant.send(method, id, *opt)
+ end
+ end
+ end
+
+ end
+ @dependency = Hash.new
+ @proc = proc{|id| final_of(id)}
+ ObjectSpace.add_finalizer(@proc)
+end
diff --git a/lib/find.rb b/lib/find.rb
index 79ff7c1378..0d22dd62d6 100644
--- a/lib/find.rb
+++ b/lib/find.rb
@@ -33,9 +33,7 @@ module Find
# See the +Find+ module documentation for an example.
#
def find(*paths) # :yield: path
- block_given? or return enum_for(__method__, *paths)
-
- paths.collect!{|d| raise Errno::ENOENT unless File.exist?(d); d.dup}
+ paths.collect!{|d| d.dup}
while file = paths.shift
catch(:prune) do
yield file.dup.taint
@@ -59,7 +57,7 @@ module Find
d.close
end
end
- rescue Errno::ENOENT, Errno::EACCES
+ rescue Errno::ENOENT, Errno::EACCES
end
end
end
diff --git a/lib/forwardable.rb b/lib/forwardable.rb
index 39b35d9cee..cc6e4ee418 100644
--- a/lib/forwardable.rb
+++ b/lib/forwardable.rb
@@ -1,17 +1,17 @@
+# = forwardable - Support for the Delegation Pattern
#
-# forwardable.rb -
-# $Release Version: 1.1$
-# $Revision$
-# by Keiju ISHITSUKA(keiju@ishitsuka.com)
-# original definition by delegator.rb
-# Revised by Daniel J. Berger with suggestions from Florian Gross.
+# $Release Version: 1.1$
+# $Revision$
+# $Date$
+# by Keiju ISHITSUKA(keiju@ishitsuka.com)
#
-# Documentation by James Edward Gray II and Gavin Sinclair
+# Documentation by James Edward Gray II and Gavin Sinclair
#
# == Introduction
#
# This library allows you delegate method calls to an object, on a method by
-# method basis.
+# method basis. You can use Forwardable to setup this delegation at the class
+# level, or SingleForwardable to handle it at the object level.
#
# == Notes
#
@@ -33,28 +33,28 @@
#
# class Queue
# extend Forwardable
-#
+#
# def initialize
# @q = [ ] # prepare delegate object
# end
-#
+#
# # setup preferred interface, enq() and deq()...
# def_delegator :@q, :push, :enq
# def_delegator :@q, :shift, :deq
-#
+#
# # support some general Array methods that fit Queues well
# def_delegators :@q, :clear, :first, :push, :shift, :size
# end
-#
+#
# q = Queue.new
# q.enq 1, 2, 3, 4, 5
# q.push 6
-#
+#
# q.shift # => 1
# while q.size > 0
# puts q.deq
# end
-#
+#
# q.enq "Ruby", "Perl", "Python"
# puts q.first
# q.clear
@@ -70,34 +70,13 @@
# Ruby
# nil
#
-# SingleForwardable can be used to setup delegation at the object level as well.
+# === SingleForwardable
#
# printer = String.new
# printer.extend SingleForwardable # prepare object for delegation
# printer.def_delegator "STDOUT", "puts" # add delegation for STDOUT.puts()
# printer.puts "Howdy!"
#
-# Also, SingleForwardable can be use to Class or Module.
-#
-# module Facade
-# extend SingleForwardable
-# def_delegator :Implementation, :service
-#
-# class Implementation
-# def service...
-# end
-# end
-#
-# If you want to use both Forwardable and SingleForwardable, you can
-# use methods def_instance_delegator and def_single_delegator, etc.
-#
-# If the object isn't a Module and Class, You can too extend
-# Forwardable module.
-# printer = String.new
-# printer.extend Forwardable # prepare object for delegation
-# printer.def_delegator "STDOUT", "puts" # add delegation for STDOUT.puts()
-# printer.puts "Howdy!"
-#
# <i>Prints:</i>
#
# Howdy!
@@ -124,38 +103,17 @@
# # extend Forwardable, but we did that above
# def_delegators :@records, :size, :<<, :map
# end
-# f = Foo.new
-# f.printf ...
-# f.gets
-# f.content_at(1)
#
# Also see the example at forwardable.rb.
-
+#
module Forwardable
- FORWARDABLE_VERSION = "1.1.0"
@debug = nil
class<<self
+ # force Forwardable to show up in stack backtraces of delegated methods
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. The value is
- # the accessor to which the methods will be delegated.
- #
- # :call-seq:
- # delegate method => accessor
- # delegate [method, method, ...] => accessor
- #
- def instance_delegate(hash)
- hash.each{ |methods, accessor|
- methods = methods.to_s unless methods.respond_to?(:each)
- methods.each{ |method|
- def_instance_delegator(accessor, method)
- }
- }
- end
-
#
# Shortcut for defining multiple delegator methods, but with no
# provision for using a different name. The following two code
@@ -167,76 +125,67 @@ module Forwardable
# def_delegator :@records, :<<
# def_delegator :@records, :map
#
+ # See the examples at Forwardable and forwardable.rb.
+ #
def def_instance_delegators(accessor, *methods)
- methods.delete("__send__")
- methods.delete("__id__")
for method in methods
def_instance_delegator(accessor, method)
end
end
+ #
+ # Defines a method _method_ which delegates to _obj_ (i.e. it calls
+ # the method of the same name in _obj_). If _new_name_ is
+ # provided, it is used as the name for the delegate method.
+ #
+ # See the examples at Forwardable and forwardable.rb.
+ #
def def_instance_delegator(accessor, method, ali = method)
- line_no = __LINE__; str = %{
+ accessor = accessor.id2name if accessor.kind_of?(Integer)
+ method = method.id2name if method.kind_of?(Integer)
+ ali = ali.id2name if ali.kind_of?(Integer)
+
+ module_eval(<<-EOS, "(__FORWARDABLE__)", 1)
def #{ali}(*args, &block)
begin
#{accessor}.__send__(:#{method}, *args, &block)
rescue Exception
- $@.delete_if{|s| %r"#{Regexp.quote(__FILE__)}"o =~ s} unless Forwardable::debug
- ::Kernel::raise
+ $@.delete_if{|s| /^\\(__FORWARDABLE__\\):/ =~ s} unless Forwardable::debug
+ Kernel::raise
end
end
- }
- # If it's not a class or module, it's an instance
- begin
- module_eval(str, __FILE__, line_no)
- rescue
- instance_eval(str, __FILE__, line_no)
- end
-
+ EOS
end
- alias delegate instance_delegate
alias def_delegators def_instance_delegators
alias def_delegator def_instance_delegator
end
#
-# Usage of The SingleForwardable is like Fowadable module.
+# The SingleForwardable module provides delegation of specified
+# methods to a designated object, using the methods #def_delegator
+# and #def_delegators. This module is similar to Forwardable, but it works on
+# objects themselves, instead of their defining classes.
+#
+# Also see the example at forwardable.rb.
#
module SingleForwardable
- # Takes a hash as its argument. The key is a symbol or an array of
- # symbols. These symbols correspond to method names. The value is
- # the accessor to which the methods will be delegated.
- #
- # :call-seq:
- # delegate method => accessor
- # delegate [method, method, ...] => accessor
- #
- def single_delegate(hash)
- hash.each{ |methods, accessor|
- methods = methods.to_s unless methods.respond_to?(:each)
- methods.each{ |method|
- def_single_delegator(accessor, method)
- }
- }
- end
-
#
# Shortcut for defining multiple delegator methods, but with no
# provision for using a different name. The following two code
# samples have the same effect:
#
- # def_delegators :@records, :size, :<<, :map
+ # single_forwardable.def_delegators :@records, :size, :<<, :map
#
- # def_delegator :@records, :size
- # def_delegator :@records, :<<
- # def_delegator :@records, :map
+ # single_forwardable.def_delegator :@records, :size
+ # single_forwardable.def_delegator :@records, :<<
+ # single_forwardable.def_delegator :@records, :map
#
- def def_single_delegators(accessor, *methods)
- methods.delete("__send__")
- methods.delete("__id__")
+ # See the example at forwardable.rb.
+ #
+ def def_singleton_delegators(accessor, *methods)
for method in methods
- def_single_delegator(accessor, method)
+ def_singleton_delegator(accessor, method)
end
end
@@ -245,26 +194,25 @@ module SingleForwardable
# the method of the same name in _obj_). If _new_name_ is
# provided, it is used as the name for the delegate method.
#
- def def_single_delegator(accessor, method, ali = method)
- line_no = __LINE__; str = %{
- def #{ali}(*args, &block)
- begin
- #{accessor}.__send__(:#{method}, *args, &block)
- rescue Exception
- $@.delete_if{|s| %r"#{Regexp.quote(__FILE__)}"o =~ s} unless Forwardable::debug
- ::Kernel::raise
- end
- end
- }
-
- instance_eval(str, __FILE__, __LINE__)
+ # See the example at forwardable.rb.
+ #
+ def def_singleton_delegator(accessor, method, ali = method)
+ accessor = accessor.id2name if accessor.kind_of?(Integer)
+ method = method.id2name if method.kind_of?(Integer)
+ ali = ali.id2name if ali.kind_of?(Integer)
+
+ instance_eval(<<-EOS, "(__FORWARDABLE__)", 1)
+ def #{ali}(*args, &block)
+ begin
+ #{accessor}.__send__(:#{method}, *args,&block)
+ rescue Exception
+ $@.delete_if{|s| /^\\(__FORWARDABLE__\\):/ =~ s} unless Forwardable::debug
+ Kernel::raise
+ end
+ end
+ EOS
end
- alias delegate single_delegate
- alias def_delegators def_single_delegators
- alias def_delegator def_single_delegator
+ alias def_delegators def_singleton_delegators
+ alias def_delegator def_singleton_delegator
end
-
-
-
-
diff --git a/lib/ftools.rb b/lib/ftools.rb
new file mode 100644
index 0000000000..5f082331fb
--- /dev/null
+++ b/lib/ftools.rb
@@ -0,0 +1,261 @@
+#
+# = ftools.rb: Extra tools for the File class
+#
+# Author:: WATANABE, Hirofumi
+# Documentation:: Zachary Landau
+#
+# This library can be distributed under the terms of the Ruby license.
+# You can freely distribute/modify this library.
+#
+# It is included in the Ruby standard library.
+#
+# == Description
+#
+# ftools adds several (class, not instance) methods to the File class, for
+# copying, moving, deleting, installing, and comparing files, as well as
+# creating a directory path. See the File class for details.
+#
+# FileUtils contains all or nearly all the same functionality and more, and
+# is a recommended option over ftools
+#
+# When you
+#
+# require 'ftools'
+#
+# then the File class aquires some utility methods for copying, moving, and
+# deleting files, and more.
+#
+# See the method descriptions below, and consider using FileUtils as it is
+# more comprehensive.
+#
+class File
+end
+
+class << File
+
+ BUFSIZE = 8 * 1024
+
+ #
+ # If +to+ is a valid directory, +from+ will be appended to +to+, adding
+ # and escaping backslashes as necessary. Otherwise, +to+ will be returned.
+ # Useful for appending +from+ to +to+ only if the filename was not specified
+ # in +to+.
+ #
+ def catname(from, to)
+ if directory? to
+ join to.sub(%r([/\\]$), ''), basename(from)
+ else
+ to
+ end
+ end
+
+ #
+ # Copies a file +from+ to +to+. If +to+ is a directory, copies +from+
+ # to <tt>to/from</tt>.
+ #
+ def syscopy(from, to)
+ to = catname(from, to)
+
+ fmode = stat(from).mode
+ tpath = to
+ not_exist = !exist?(tpath)
+
+ from = open(from, "rb")
+ to = open(to, "wb")
+
+ begin
+ while true
+ to.syswrite from.sysread(BUFSIZE)
+ end
+ rescue EOFError
+ ret = true
+ rescue
+ ret = false
+ ensure
+ to.close
+ from.close
+ end
+ chmod(fmode, tpath) if not_exist
+ ret
+ end
+
+ #
+ # Copies a file +from+ to +to+ using #syscopy. If +to+ is a directory,
+ # copies +from+ to <tt>to/from</tt>. If +verbose+ is true, <tt>from -> to</tt>
+ # is printed.
+ #
+ def copy(from, to, verbose = false)
+ $stderr.print from, " -> ", catname(from, to), "\n" if verbose
+ syscopy from, to
+ end
+
+ alias cp copy
+
+ #
+ # Moves a file +from+ to +to+ using #syscopy. If +to+ is a directory,
+ # copies from +from+ to <tt>to/from</tt>. If +verbose+ is true, <tt>from ->
+ # to</tt> is printed.
+ #
+ def move(from, to, verbose = false)
+ to = catname(from, to)
+ $stderr.print from, " -> ", to, "\n" if verbose
+
+ if RUBY_PLATFORM =~ /djgpp|(cyg|ms|bcc)win|mingw/ and file? to
+ unlink to
+ end
+ fstat = stat(from)
+ begin
+ rename from, to
+ rescue
+ begin
+ symlink readlink(from), to and unlink from
+ rescue
+ from_stat = stat(from)
+ syscopy from, to and unlink from
+ utime(from_stat.atime, from_stat.mtime, to)
+ begin
+ chown(fstat.uid, fstat.gid, to)
+ rescue
+ end
+ end
+ end
+ end
+
+ alias mv move
+
+ #
+ # Returns +true+ if and only if the contents of files +from+ and +to+ are
+ # identical. If +verbose+ is +true+, <tt>from <=> to</tt> is printed.
+ #
+ def compare(from, to, verbose = false)
+ $stderr.print from, " <=> ", to, "\n" if verbose
+
+ return false if stat(from).size != stat(to).size
+
+ from = open(from, "rb")
+ to = open(to, "rb")
+
+ ret = false
+ fr = tr = ''
+
+ begin
+ while fr == tr
+ fr = from.read(BUFSIZE)
+ if fr
+ tr = to.read(fr.size)
+ else
+ ret = to.read(BUFSIZE)
+ ret = !ret || ret.length == 0
+ break
+ end
+ end
+ rescue
+ ret = false
+ ensure
+ to.close
+ from.close
+ end
+ ret
+ end
+
+ alias cmp compare
+
+ #
+ # Removes a list of files. Each parameter should be the name of the file to
+ # delete. If the last parameter isn't a String, verbose mode will be enabled.
+ # Returns the number of files deleted.
+ #
+ def safe_unlink(*files)
+ verbose = if files[-1].is_a? String then false else files.pop end
+ files.each do |file|
+ begin
+ unlink file
+ $stderr.print "removing ", file, "\n" if verbose
+ rescue Errno::EACCES # for Windows
+ continue if symlink? file
+ begin
+ mode = stat(file).mode
+ o_chmod mode | 0200, file
+ unlink file
+ $stderr.print "removing ", file, "\n" if verbose
+ rescue
+ o_chmod mode, file rescue nil
+ end
+ rescue
+ end
+ end
+ end
+
+ alias rm_f safe_unlink
+
+ #
+ # Creates a directory and all its parent directories.
+ # For example,
+ #
+ # File.makedirs '/usr/lib/ruby'
+ #
+ # causes the following directories to be made, if they do not exist.
+ # * /usr
+ # * /usr/lib
+ # * /usr/lib/ruby
+ #
+ # You can pass several directories, each as a parameter. If the last
+ # parameter isn't a String, verbose mode will be enabled.
+ #
+ def makedirs(*dirs)
+ verbose = if dirs[-1].is_a? String then false else dirs.pop end
+ mode = 0755
+ for dir in dirs
+ parent = dirname(dir)
+ next if parent == dir or directory? dir
+ makedirs parent unless directory? parent
+ $stderr.print "mkdir ", dir, "\n" if verbose
+ if basename(dir) != ""
+ begin
+ Dir.mkdir dir, mode
+ rescue SystemCallError
+ raise unless directory? dir
+ end
+ end
+ end
+ end
+
+ alias mkpath makedirs
+
+ alias o_chmod chmod
+
+ vsave, $VERBOSE = $VERBOSE, false
+
+ #
+ # Changes permission bits on +files+ to the bit pattern represented
+ # by +mode+. If the last parameter isn't a String, verbose mode will
+ # be enabled.
+ #
+ # File.chmod 0755, 'somecommand'
+ # File.chmod 0644, 'my.rb', 'your.rb', true
+ #
+ def chmod(mode, *files)
+ verbose = if files[-1].is_a? String then false else files.pop end
+ $stderr.printf "chmod %04o %s\n", mode, files.join(" ") if verbose
+ o_chmod mode, *files
+ end
+ $VERBOSE = vsave
+
+ #
+ # If +src+ is not the same as +dest+, copies it and changes the permission
+ # mode to +mode+. If +dest+ is a directory, destination is <tt>dest/src</tt>.
+ # If +mode+ is not set, default is used. If +verbose+ is set to true, the
+ # name of each file copied will be printed.
+ #
+ def install(from, to, mode = nil, verbose = false)
+ to = catname(from, to)
+ unless exist? to and cmp from, to
+ safe_unlink to if exist? to
+ cp from, to, verbose
+ chmod mode, to, verbose if mode
+ end
+ end
+
+end
+
+# vi:set sw=2:
diff --git a/lib/gauntlet_rubygems.rb b/lib/gauntlet_rubygems.rb
deleted file mode 100644
index f6c4827129..0000000000
--- a/lib/gauntlet_rubygems.rb
+++ /dev/null
@@ -1,50 +0,0 @@
-require 'rubygems'
-require 'gauntlet'
-
-##
-# GemGauntlet validates all current gems. Currently these packages are
-# borked:
-#
-# Asami-0.04 : No such file or directory - bin/Asami.rb
-# ObjectGraph-1.0.1 : No such file or directory - bin/objectgraph
-# evil-ruby-0.1.0 : authors must be Array of Strings
-# fresh_cookies-1.0.0 : authors must be Array of Strings
-# plugems_deploy-0.2.0 : authors must be Array of Strings
-# pmsrb-0.2.0 : authors must be Array of Strings
-# pqa-1.6 : authors must be Array of Strings
-# rant-0.5.7 : authors must be Array of Strings
-# rvsh-0.4.5 : No such file or directory - bin/rvsh
-# xen-0.1.2.1 : authors must be Array of Strings
-
-class GemGauntlet < Gauntlet
- def run(name)
- warn name
-
- spec = begin
- Gem::Specification.load 'gemspec'
- rescue SyntaxError
- Gem::Specification.from_yaml File.read('gemspec')
- end
- spec.validate
-
- self.data[name] = false
- self.dirty = true
- rescue SystemCallError, Gem::InvalidSpecificationException => e
- self.data[name] = e.message
- self.dirty = true
- end
-
- def should_skip?(name)
- self.data[name] == false
- end
-
- def report
- self.data.sort.reject { |k,v| !v }.each do |k,v|
- puts "%-21s: %s" % [k, v]
- end
- end
-end
-
-gauntlet = GemGauntlet.new
-gauntlet.run_the_gauntlet ARGV.shift
-gauntlet.report
diff --git a/lib/generator.rb b/lib/generator.rb
new file mode 100644
index 0000000000..dbdd0f40a9
--- /dev/null
+++ b/lib/generator.rb
@@ -0,0 +1,418 @@
+#!/usr/bin/env ruby
+#--
+# $Idaemons: /home/cvs/rb/generator.rb,v 1.8 2001/10/03 08:54:32 knu Exp $
+# $RoughId: generator.rb,v 1.10 2003/10/14 19:36:58 knu Exp $
+# $Id$
+#++
+#
+# = generator.rb: convert an internal iterator to an external one
+#
+# Copyright (c) 2001,2003 Akinori MUSHA <knu@iDaemons.org>
+#
+# All rights reserved. You can redistribute and/or modify it under
+# the same terms as Ruby.
+#
+# == Overview
+#
+# This library provides the Generator class, which converts an
+# internal iterator (i.e. an Enumerable object) to an external
+# iterator. In that form, you can roll many iterators independently.
+#
+# The SyncEnumerator class, which is implemented using Generator,
+# makes it easy to roll many Enumerable objects synchronously.
+#
+# See the respective classes for examples of usage.
+
+
+#
+# Generator converts an internal iterator (i.e. an Enumerable object)
+# to an external iterator.
+#
+# Note that it is not very fast since it is implemented using
+# continuations, which are currently slow.
+#
+# == Example
+#
+# require 'generator'
+#
+# # Generator from an Enumerable object
+# g = Generator.new(['A', 'B', 'C', 'Z'])
+#
+# while g.next?
+# puts g.next
+# end
+#
+# # Generator from a block
+# g = Generator.new { |g|
+# for i in 'A'..'C'
+# g.yield i
+# end
+#
+# g.yield 'Z'
+# }
+#
+# # The same result as above
+# while g.next?
+# puts g.next
+# end
+#
+class Generator
+ include Enumerable
+
+ # Creates a new generator either from an Enumerable object or from a
+ # block.
+ #
+ # In the former, block is ignored even if given.
+ #
+ # In the latter, the given block is called with the generator
+ # itself, and expected to call the +yield+ method for each element.
+ def initialize(enum = nil, &block)
+ if enum
+ @block = proc { |g|
+ enum.each { |x| g.yield x }
+ }
+ else
+ @block = block
+ end
+
+ @index = 0
+ @queue = []
+ @cont_next = @cont_yield = @cont_endp = nil
+
+ if @cont_next = callcc { |c| c }
+ @block.call(self)
+
+ @cont_endp.call(nil) if @cont_endp
+ end
+
+ self
+ end
+
+ # Yields an element to the generator.
+ def yield(value)
+ if @cont_yield = callcc { |c| c }
+ @queue << value
+ @cont_next.call(nil)
+ end
+
+ self
+ end
+
+ # Returns true if the generator has reached the end.
+ def end?()
+ if @cont_endp = callcc { |c| c }
+ @cont_yield.nil? && @queue.empty?
+ else
+ @queue.empty?
+ end
+ end
+
+ # Returns true if the generator has not reached the end yet.
+ def next?()
+ !end?
+ end
+
+ # Returns the current index (position) counting from zero.
+ def index()
+ @index
+ end
+
+ # Returns the current index (position) counting from zero.
+ def pos()
+ @index
+ end
+
+ # Returns the element at the current position and moves forward.
+ def next()
+ if end?
+ raise EOFError, "no more elements available"
+ end
+
+ if @cont_next = callcc { |c| c }
+ @cont_yield.call(nil) if @cont_yield
+ end
+
+ @index += 1
+
+ @queue.shift
+ end
+
+ # Returns the element at the current position.
+ def current()
+ if @queue.empty?
+ raise EOFError, "no more elements available"
+ end
+
+ @queue.first
+ end
+
+ # Rewinds the generator.
+ def rewind()
+ initialize(nil, &@block) if @index.nonzero?
+
+ self
+ end
+
+ # Rewinds the generator and enumerates the elements.
+ def each
+ rewind
+
+ until end?
+ yield self.next
+ end
+
+ self
+ end
+end
+
+class Enumerable::Enumerator
+ def __generator
+ @generator ||= Generator.new(self)
+ end
+ private :__generator
+
+ # call-seq:
+ # e.next => object
+ #
+ # Returns the next object in the enumerator, and move the internal
+ # position forward. When the position reached at the end, internal
+ # position is rewinded then StopIteration is raised.
+ #
+ # Note that enumeration sequence by next method does not affect other
+ # non-external enumeration methods, unless underlying iteration
+ # methods itself has side-effect, e.g. IO#each_line.
+ #
+ # Caution: This feature internally uses Generator, which uses callcc
+ # to stop and resume enumeration to fetch each value. Use with care
+ # and be aware of the performance loss.
+ def next
+ g = __generator
+ return g.next unless g.end?
+
+ g.rewind
+ raise StopIteration, 'iteration reached at end'
+ end
+
+ # call-seq:
+ # e.rewind => e
+ #
+ # Rewinds the enumeration sequence by the next method.
+ def rewind
+ __generator.rewind
+ self
+ end
+end
+
+#
+# SyncEnumerator creates an Enumerable object from multiple Enumerable
+# objects and enumerates them synchronously.
+#
+# == Example
+#
+# require 'generator'
+#
+# s = SyncEnumerator.new([1,2,3], ['a', 'b', 'c'])
+#
+# # Yields [1, 'a'], [2, 'b'], and [3,'c']
+# s.each { |row| puts row.join(', ') }
+#
+class SyncEnumerator
+ include Enumerable
+
+ # Creates a new SyncEnumerator which enumerates rows of given
+ # Enumerable objects.
+ def initialize(*enums)
+ @gens = enums.map { |e| Generator.new(e) }
+ end
+
+ # Returns the number of enumerated Enumerable objects, i.e. the size
+ # of each row.
+ def size
+ @gens.size
+ end
+
+ # Returns the number of enumerated Enumerable objects, i.e. the size
+ # of each row.
+ def length
+ @gens.length
+ end
+
+ # Returns true if the given nth Enumerable object has reached the
+ # end. If no argument is given, returns true if any of the
+ # Enumerable objects has reached the end.
+ def end?(i = nil)
+ if i.nil?
+ @gens.detect { |g| g.end? } ? true : false
+ else
+ @gens[i].end?
+ end
+ end
+
+ # Enumerates rows of the Enumerable objects.
+ def each
+ @gens.each { |g| g.rewind }
+
+ loop do
+ count = 0
+
+ ret = @gens.map { |g|
+ if g.end?
+ count += 1
+ nil
+ else
+ g.next
+ end
+ }
+
+ if count == @gens.size
+ break
+ end
+
+ yield ret
+ end
+
+ self
+ end
+end
+
+if $0 == __FILE__
+ eval DATA.read, nil, $0, __LINE__+4
+end
+
+__END__
+
+require 'test/unit'
+
+class TC_Generator < Test::Unit::TestCase
+ def test_block1
+ g = Generator.new { |g|
+ # no yield's
+ }
+
+ assert_equal(0, g.pos)
+ assert_raises(EOFError) { g.current }
+ end
+
+ def test_block2
+ g = Generator.new { |g|
+ for i in 'A'..'C'
+ g.yield i
+ end
+
+ g.yield 'Z'
+ }
+
+ assert_equal(0, g.pos)
+ assert_equal('A', g.current)
+
+ assert_equal(true, g.next?)
+ assert_equal(0, g.pos)
+ assert_equal('A', g.current)
+ assert_equal(0, g.pos)
+ assert_equal('A', g.next)
+
+ assert_equal(1, g.pos)
+ assert_equal(true, g.next?)
+ assert_equal(1, g.pos)
+ assert_equal('B', g.current)
+ assert_equal(1, g.pos)
+ assert_equal('B', g.next)
+
+ assert_equal(g, g.rewind)
+
+ assert_equal(0, g.pos)
+ assert_equal('A', g.current)
+
+ assert_equal(true, g.next?)
+ assert_equal(0, g.pos)
+ assert_equal('A', g.current)
+ assert_equal(0, g.pos)
+ assert_equal('A', g.next)
+
+ assert_equal(1, g.pos)
+ assert_equal(true, g.next?)
+ assert_equal(1, g.pos)
+ assert_equal('B', g.current)
+ assert_equal(1, g.pos)
+ assert_equal('B', g.next)
+
+ assert_equal(2, g.pos)
+ assert_equal(true, g.next?)
+ assert_equal(2, g.pos)
+ assert_equal('C', g.current)
+ assert_equal(2, g.pos)
+ assert_equal('C', g.next)
+
+ assert_equal(3, g.pos)
+ assert_equal(true, g.next?)
+ assert_equal(3, g.pos)
+ assert_equal('Z', g.current)
+ assert_equal(3, g.pos)
+ assert_equal('Z', g.next)
+
+ assert_equal(4, g.pos)
+ assert_equal(false, g.next?)
+ assert_raises(EOFError) { g.next }
+ end
+
+ def test_each
+ a = [5, 6, 7, 8, 9]
+
+ g = Generator.new(a)
+
+ i = 0
+
+ g.each { |x|
+ assert_equal(a[i], x)
+
+ i += 1
+
+ break if i == 3
+ }
+
+ assert_equal(3, i)
+
+ i = 0
+
+ g.each { |x|
+ assert_equal(a[i], x)
+
+ i += 1
+ }
+
+ assert_equal(5, i)
+ end
+end
+
+class TC_SyncEnumerator < Test::Unit::TestCase
+ def test_each
+ r = ['a'..'f', 1..10, 10..20]
+ ra = r.map { |x| x.to_a }
+
+ a = (0...(ra.map {|x| x.size}.max)).map { |i| ra.map { |x| x[i] } }
+
+ s = SyncEnumerator.new(*r)
+
+ i = 0
+
+ s.each { |x|
+ assert_equal(a[i], x)
+
+ i += 1
+
+ break if i == 3
+ }
+
+ assert_equal(3, i)
+
+ i = 0
+
+ s.each { |x|
+ assert_equal(a[i], x)
+
+ i += 1
+ }
+
+ assert_equal(a.size, i)
+ end
+end
diff --git a/lib/getoptlong.rb b/lib/getoptlong.rb
index 2d3b617d6b..4d004419b1 100644
--- a/lib/getoptlong.rb
+++ b/lib/getoptlong.rb
@@ -12,10 +12,10 @@
# found at http://www.sra.co.jp/people/m-kasahr/ruby/getoptlong/
# The GetoptLong class allows you to parse command line options similarly to
-# the GNU getopt_long() C library call. Note, however, that GetoptLong is a
+# the GNU getopt_long() C library call. Note, however, that GetoptLong is a
# pure Ruby implementation.
#
-# GetoptLong allows for POSIX-style options like <tt>--file</tt> as well
+# GetoptLong allows for POSIX-style options like <tt>--file</tt> as well
# as single letter options like <tt>-f</tt>
#
# The empty option <tt>--</tt> (two minus symbols) is used to end option
@@ -24,34 +24,41 @@
#
# Here is a simple example of usage:
#
+# # == Synopsis
+# #
+# # hello: greets user, demonstrates command line parsing
+# #
+# # == Usage
+# #
+# # hello [OPTION] ... DIR
+# #
+# # -h, --help:
+# # show help
+# #
+# # --repeat x, -n x:
+# # repeat x times
+# #
+# # --name [name]:
+# # greet user by name, if name not supplied default is John
+# #
+# # DIR: The directory in which to issue the greeting.
+#
# require 'getoptlong'
-#
+# require 'rdoc/usage'
+#
# opts = GetoptLong.new(
# [ '--help', '-h', GetoptLong::NO_ARGUMENT ],
# [ '--repeat', '-n', GetoptLong::REQUIRED_ARGUMENT ],
# [ '--name', GetoptLong::OPTIONAL_ARGUMENT ]
# )
-#
+#
# dir = nil
# name = nil
# repetitions = 1
# opts.each do |opt, arg|
# case opt
# when '--help'
-# puts <<-EOF
-# hello [OPTION] ... DIR
-#
-# -h, --help:
-# show help
-#
-# --repeat x, -n x:
-# repeat x times
-#
-# --name [name]:
-# greet user by name, if name not supplied default is John
-#
-# DIR: The directory in which to issue the greeting.
-# EOF
+# RDoc::usage
# when '--repeat'
# repetitions = arg.to_i
# when '--name'
@@ -62,14 +69,14 @@
# end
# end
# end
-#
+#
# if ARGV.length != 1
# puts "Missing dir argument (try --help)"
# exit 0
# end
-#
+#
# dir = ARGV.shift
-#
+#
# Dir.chdir(dir)
# for i in (1..repetitions)
# print "Hello"
@@ -104,7 +111,7 @@ class GetoptLong
# Error types.
#
class Error < StandardError; end
- class AmbiguousOption < Error; end
+ class AmbigousOption < Error; end
class NeedlessArgument < Error; end
class MissingArgument < Error; end
class InvalidOption < Error; end
@@ -113,7 +120,7 @@ class GetoptLong
# Set up option processing.
#
# The options to support are passed to new() as an array of arrays.
- # Each sub-array contains any number of String option names which carry
+ # Each sub-array contains any number of String option names which carry
# the same meaning, and one of the following flags:
#
# GetoptLong::NO_ARGUMENT :: Option does not take an argument.
@@ -150,7 +157,7 @@ class GetoptLong
@argument_flags = Hash.new
#
- # Whether error messages are output to $stderr.
+ # Whether error messages are output to $deferr.
#
@quiet = FALSE
@@ -193,23 +200,23 @@ class GetoptLong
# the processing of options as follows:
#
# <b>REQUIRE_ORDER</b> :
- #
+ #
# Options are required to occur before non-options.
#
# Processing of options ends as soon as a word is encountered that has not
# been preceded by an appropriate option flag.
#
# For example, if -a and -b are options which do not take arguments,
- # parsing command line arguments of '-a one -b two' would result in
- # 'one', '-b', 'two' being left in ARGV, and only ('-a', '') being
+ # parsing command line arguments of '-a one -b two' would result in
+ # 'one', '-b', 'two' being left in ARGV, and only ('-a', '') being
# processed as an option/arg pair.
#
# This is the default ordering, if the environment variable
# POSIXLY_CORRECT is set. (This is for compatibility with GNU getopt_long.)
#
# <b>PERMUTE</b> :
- #
- # Options can occur anywhere in the command line parsed. This is the
+ #
+ # Options can occur anywhere in the command line parsed. This is the
# default behavior.
#
# Every sequence of words which can be interpreted as an option (with or
@@ -226,7 +233,7 @@ class GetoptLong
#
# <b>RETURN_IN_ORDER</b> :
#
- # All words on the command line are processed as options. Words not
+ # All words on the command line are processed as options. Words not
# preceded by a short or long option flag are passed as arguments
# with an option of '' (empty string).
#
@@ -272,7 +279,7 @@ class GetoptLong
# The method is failed if option processing has already started.
#
if @status != STATUS_YET
- raise RuntimeError,
+ raise RuntimeError,
"invoke set_options, but option processing has already started"
end
@@ -282,8 +289,14 @@ class GetoptLong
@canonical_names.clear
@argument_flags.clear
- arguments.each do |*arg|
- arg = arg.first # TODO: YARV Hack
+ arguments.each do |arg|
+ #
+ # Each argument must be an Array.
+ #
+ if !arg.is_a?(Array)
+ raise ArgumentError, "the option list contains non-Array argument"
+ end
+
#
# Find an argument flag and it set to `argument_flag'.
#
@@ -296,7 +309,6 @@ class GetoptLong
argument_flag = i
end
end
-
raise ArgumentError, "no argument-flag" if argument_flag == nil
canonical_name = nil
@@ -319,7 +331,7 @@ class GetoptLong
end
#
- # Register the option (`i') to the `@canonical_names' and
+ # Register the option (`i') to the `@canonical_names' and
# `@canonical_names' Hashes.
#
if canonical_name == nil
@@ -376,10 +388,10 @@ class GetoptLong
end
#
- # Set an error (a protected method).
+ # Set an error (protected).
#
def set_error(type, message)
- $stderr.print("#{$0}: #{message}\n") if !@quiet
+ $deferr.print("#{$0}: #{message}\n") if !@quiet
@error = type
@error_message = message
@@ -451,7 +463,7 @@ class GetoptLong
return nil
end
argument = ARGV.shift
- elsif @ordering == REQUIRE_ORDER
+ elsif @ordering == REQUIRE_ORDER
if (ARGV[0] !~ /^-./)
terminate
return nil
@@ -485,16 +497,16 @@ class GetoptLong
# The option `option_name' is not registered in `@canonical_names'.
# It may be an abbreviated.
#
- matches = []
+ match_count = 0
@canonical_names.each_key do |key|
if key.index(pattern) == 0
option_name = key
- matches << key
+ match_count += 1
end
end
- if 2 <= matches.length
- set_error(AmbiguousOption, "option `#{argument}' is ambiguous between #{matches.join(', ')}")
- elsif matches.length == 0
+ if 2 <= match_count
+ set_error(AmbigousOption, "option `#{argument}' is ambiguous")
+ elsif match_count == 0
set_error(InvalidOption, "unrecognized option `#{argument}'")
end
end
@@ -563,7 +575,7 @@ class GetoptLong
# 1003.2 specifies the format of this message.
#
if ENV.include?('POSIXLY_CORRECT')
- set_error(InvalidOption, "invalid option -- #{ch}")
+ set_error(InvalidOption, "illegal option -- #{ch}")
else
set_error(InvalidOption, "invalid option -- #{ch}")
end
@@ -588,7 +600,7 @@ class GetoptLong
#
# The block is called repeatedly with two arguments:
# The first is the option name.
- # The second is the argument which followed it (if any).
+ # The second is the argument which followed it (if any).
# Example: ('--opt', 'value')
#
# The option name is always converted to the first (preferred)
diff --git a/lib/getopts.rb b/lib/getopts.rb
new file mode 100644
index 0000000000..7124269351
--- /dev/null
+++ b/lib/getopts.rb
@@ -0,0 +1,127 @@
+#
+# getopts.rb -
+# $Release Version: $
+# $Revision$
+# $Date$
+# by Yasuo OHBA(SHL Japan Inc. Technology Dept.)
+#
+# --
+# this is obsolete; use getoptlong
+#
+# 2000-03-21
+# modified by Minero Aoki <aamine@dp.u-netsurf.ne.jp>
+#
+# 2002-03-05
+# rewritten by Akinori MUSHA <knu@ruby-lang.org>
+#
+
+warn "Warning:#{caller[0].sub(/:in `.*'\z/, '')}: getopts is deprecated after Ruby 1.8.1; use optparse instead" if caller[0] and $VERBOSE
+
+$RCS_ID=%q$Header$
+
+# getopts is obsolete. Use GetoptLong.
+
+def getopts(single_options, *options)
+ boolopts = {}
+ valopts = {}
+
+ #
+ # set defaults
+ #
+ single_options.scan(/.:?/) do |opt|
+ if opt.size == 1
+ boolopts[opt] = false
+ else
+ valopts[opt[0, 1]] = nil
+ end
+ end if single_options
+
+ options.each do |arg|
+ opt, val = arg.split(':', 2)
+
+ if val
+ valopts[opt] = val.empty? ? nil : val
+ else
+ boolopts[opt] = false
+ end
+ end
+
+ #
+ # scan
+ #
+ c = 0
+ argv = ARGV
+
+ while arg = argv.shift
+ case arg
+ when /\A--(.*)/
+ if $1.empty? # xinit -- -bpp 24
+ break
+ end
+
+ opt, val = $1.split('=', 2)
+
+ if opt.size == 1
+ argv.unshift arg
+ return nil
+ elsif valopts.key? opt # imclean --src +trash
+ valopts[opt] = val || argv.shift or return nil
+ elsif boolopts.key? opt # ruby --verbose
+ boolopts[opt] = true
+ else
+ argv.unshift arg
+ return nil
+ end
+
+ c += 1
+ when /\A-(.+)/
+ opts = $1
+
+ until opts.empty?
+ opt = opts.slice!(0, 1)
+
+ if valopts.key? opt
+ val = opts
+
+ if val.empty? # ruby -e 'p $:'
+ valopts[opt] = argv.shift or return nil
+ else # cc -ohello ...
+ valopts[opt] = val
+ end
+
+ c += 1
+ break
+ elsif boolopts.key? opt
+ boolopts[opt] = true # ruby -h
+ c += 1
+ else
+ argv.unshift arg
+ return nil
+ end
+ end
+ else
+ argv.unshift arg
+ break
+ end
+ end
+
+ #
+ # set
+ #
+ $OPT = {}
+
+ boolopts.each do |opt, val|
+ $OPT[opt] = val
+
+ sopt = opt.gsub(/[^A-Za-z0-9_]/, '_')
+ eval "$OPT_#{sopt} = val"
+ end
+ valopts.each do |opt, val|
+ $OPT[opt] = val
+
+ sopt = opt.gsub(/[^A-Za-z0-9_]/, '_')
+ eval "$OPT_#{sopt} = val"
+ end
+
+ c
+end
diff --git a/lib/gserver.rb b/lib/gserver.rb
index 2ab6e42bce..eb5f31b7b3 100644
--- a/lib/gserver.rb
+++ b/lib/gserver.rb
@@ -13,7 +13,7 @@ require "thread"
#
# GServer implements a generic server, featuring thread pool management,
-# simple logging, and multi-server management. See HttpServer in
+# simple logging, and multi-server management. See HttpServer in
# <tt>xmlrpc/httpserver.rb</tt> in the Ruby standard library for an example of
# GServer in action.
#
@@ -34,30 +34,30 @@ require "thread"
#
# #
# # A server that returns the time in seconds since 1970.
-# #
+# #
# class TimeServer < GServer
# def initialize(port=10001, *args)
# super(port, *args)
# end
# def serve(io)
-# io.puts(Time.now.to_s)
+# io.puts(Time.now.to_i)
# end
# end
#
# # Run the server with logging enabled (it's a separate thread).
# server = TimeServer.new
# server.audit = true # Turn logging on.
-# server.start
+# server.start
#
# # *** Now point your browser to http://localhost:10001 to see it working ***
#
-# # See if it's still running.
+# # See if it's still running.
# GServer.in_service?(10001) # -> true
# server.stopped? # -> false
#
# # Shut the server down gracefully.
# server.shutdown
-#
+#
# # Alternatively, stop it immediately.
# GServer.stop(10001)
# # or, of course, "server.stop".
diff --git a/lib/importenv.rb b/lib/importenv.rb
new file mode 100644
index 0000000000..8e1ba33b1d
--- /dev/null
+++ b/lib/importenv.rb
@@ -0,0 +1,33 @@
+# importenv.rb -- imports environment variables as global variables, Perlish ;(
+#
+# Usage:
+#
+# require 'importenv'
+# p $USER
+# $USER = "matz"
+# p ENV["USER"]
+
+warn "Warning:#{caller[0].sub(/:in `.*'\z/, '')}: importenv is deprecated after Ruby 1.8.1 (no replacement)"
+
+for k,v in ENV
+ next unless /^[a-zA-Z][_a-zA-Z0-9]*/ =~ k
+ eval <<EOS
+ $#{k} = v
+ trace_var "$#{k}", proc{|v|
+ ENV[%q!#{k}!] = v
+ $#{k} = v
+ if v == nil
+ untrace_var "$#{k}"
+ end
+ }
+EOS
+end
+
+if __FILE__ == $0
+ p $TERM
+ $TERM = nil
+ p $TERM
+ p ENV["TERM"]
+ $TERM = "foo"
+ p ENV["TERM"]
+end
diff --git a/lib/ipaddr.rb b/lib/ipaddr.rb
index 21c8787f80..fe963e406c 100644
--- a/lib/ipaddr.rb
+++ b/lib/ipaddr.rb
@@ -66,19 +66,19 @@ end
# == Example
#
# require 'ipaddr'
-#
+#
# ipaddr1 = IPAddr.new "3ffe:505:2::1"
-#
+#
# p ipaddr1 #=> #<IPAddr: IPv6:3ffe:0505:0002:0000:0000:0000:0000:0001/ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff>
-#
+#
# p ipaddr1.to_s #=> "3ffe:505:2::1"
-#
+#
# ipaddr2 = ipaddr1.mask(48) #=> #<IPAddr: IPv6:3ffe:0505:0002:0000:0000:0000:0000:0000/ffff:ffff:ffff:0000:0000:0000:0000:0000>
-#
+#
# p ipaddr2.to_s #=> "3ffe:505:2::"
-#
+#
# ipaddr3 = IPAddr.new "192.168.2.0/24"
-#
+#
# p ipaddr3 #=> #<IPAddr: IPv4:192.168.2.0/255.255.255.0>
class IPAddr
@@ -88,7 +88,7 @@ class IPAddr
IN6FORMAT = (["%.4x"] * 8).join(':')
# Returns the address family of this IP address.
- attr_reader :family
+ attr :family
# Creates a new ipaddr containing the given network byte ordered
# string form of an IP address.
@@ -425,7 +425,7 @@ class IPAddr
# Creates a new ipaddr object either from a human readable IP
# address representation in string, or from a packed in_addr value
# followed by an address family.
- #
+ #
# In the former case, the following are the valid formats that will
# be recognized: "address", "address/prefixlen" and "address/mask",
# where IPv6 address may be enclosed in square brackets (`[' and
@@ -433,7 +433,7 @@ class IPAddr
# IP address. Although the address family is determined
# automatically from a specified string, you can specify one
# explicitly by the optional second argument.
- #
+ #
# Otherwise an IP addess is generated from a packed in_addr value
# and an address family.
#
@@ -577,6 +577,7 @@ end
__END__
require 'test/unit'
+require 'test/unit/ui/console/testrunner'
class TC_IPAddr < Test::Unit::TestCase
def test_s_new
diff --git a/lib/irb.rb b/lib/irb.rb
index 17d4ae51bd..7580e39d43 100644
--- a/lib/irb.rb
+++ b/lib/irb.rb
@@ -1,7 +1,8 @@
#
# irb.rb - irb main module
-# $Release Version: 0.9.6 $
+# $Release Version: 0.9.5 $
# $Revision$
+# $Date$
# by Keiju ISHITSUKA(keiju@ruby-lang.org)
#
# --
@@ -64,7 +65,7 @@ module IRB
trap("SIGINT") do
irb.signal_handle
end
-
+
catch(:IRB_EXIT) do
irb.eval_input
end
@@ -84,7 +85,7 @@ module IRB
end
#
- # irb interpreter main routine
+ # irb interpriter main routine
#
class Irb
def initialize(workspace = nil, input_method = nil, output_method = nil)
@@ -107,7 +108,7 @@ module IRB
f = @context.prompt_c
elsif indent > 0
f = @context.prompt_n
- else
+ else @context.prompt_i
f = @context.prompt_i
end
f = "" unless f
@@ -125,7 +126,7 @@ module IRB
end
end
end
-
+
@scanner.set_input(@context.io) do
signal_status(:IN_INPUT) do
if l = @context.io.gets
@@ -156,13 +157,12 @@ module IRB
end
if exc
print exc.class, ": ", exc, "\n"
- if exc.backtrace[0] =~ /irb(2)?(\/.*|-.*|\.rb)?:/ && exc.class.to_s !~ /^IRB/ &&
- !(SyntaxError === exc)
- irb_bug = true
+ if exc.backtrace[0] =~ /irb(2)?(\/.*|-.*|\.rb)?:/ && exc.class.to_s !~ /^IRB/
+ irb_bug = true
else
irb_bug = false
end
-
+
messages = []
lasts = []
levels = 0
@@ -174,7 +174,7 @@ module IRB
else
lasts.push "\tfrom "+m
if lasts.size > @context.back_trace_limit
- lasts.shift
+ lasts.shift
levels += 1
end
end
@@ -279,13 +279,13 @@ module IRB
when "l"
ltype
when "i"
- if $1
+ if $1
format("%" + $1 + "d", indent)
else
indent.to_s
end
when "n"
- if $1
+ if $1
format("%" + $1 + "d", line_no)
else
line_no.to_s
@@ -298,13 +298,17 @@ module IRB
end
def output_value
- printf @context.return_format, @context.inspect_last_value
+ if @context.inspect?
+ printf @context.return_format, @context.last_value.inspect
+ else
+ printf @context.return_format, @context.last_value
+ end
end
def inspect
ary = []
for iv in instance_variables
- case (iv = iv.to_s)
+ case iv
when "@signal_status"
ary.push format("%s=:%s", iv, @signal_status.id2name)
when "@context"
diff --git a/lib/irb/cmd/chws.rb b/lib/irb/cmd/chws.rb
index 65c977016b..88585b778b 100644
--- a/lib/irb/cmd/chws.rb
+++ b/lib/irb/cmd/chws.rb
@@ -1,12 +1,13 @@
#
-# change-ws.rb -
-# $Release Version: 0.9.6$
+# change-ws.rb -
+# $Release Version: 0.9.5$
# $Revision$
+# $Date$
# by Keiju ISHITSUKA(keiju@ruby-lang.org)
#
# --
#
-#
+#
#
require "irb/cmd/nop.rb"
diff --git a/lib/irb/cmd/fork.rb b/lib/irb/cmd/fork.rb
index 45350cb1b7..2866b1373b 100644
--- a/lib/irb/cmd/fork.rb
+++ b/lib/irb/cmd/fork.rb
@@ -1,12 +1,13 @@
#
-# fork.rb -
-# $Release Version: 0.9.6 $
+# fork.rb -
+# $Release Version: 0.9.5 $
# $Revision$
+# $Date$
# by Keiju ISHITSUKA(keiju@ruby-lang.org)
#
# --
#
-#
+#
#
@RCS_ID='-$Id$-'
@@ -17,7 +18,7 @@ module IRB
class Fork<Nop
def execute(&block)
pid = send ExtendCommand.irb_original_method_name("fork")
- unless pid
+ unless pid
class<<self
alias_method :exit, ExtendCommand.irb_original_method_name('exit')
end
diff --git a/lib/irb/cmd/help.rb b/lib/irb/cmd/help.rb
index de3c6bd6bf..3e8d1388e0 100644
--- a/lib/irb/cmd/help.rb
+++ b/lib/irb/cmd/help.rb
@@ -1,28 +1,28 @@
#
# help.rb - helper using ri
-# $Release Version: 0.9.6$
+# $Release Version: 0.9.5$
# $Revision$
+# $Date$
#
# --
#
-#
+#
#
-require 'rdoc/ri/driver'
-require 'rdoc/ri/util'
+require 'rdoc/ri/ri_driver'
module IRB
module ExtendCommand
module Help
begin
- @ri = RDoc::RI::Driver.new
+ @ri = RiDriver.new
rescue SystemExit
else
def self.execute(context, *names)
names.each do |name|
begin
@ri.get_info_for(name.to_s)
- rescue RDoc::RI::Error
+ rescue RiError
puts $!.message
end
end
diff --git a/lib/irb/cmd/load.rb b/lib/irb/cmd/load.rb
index 2a6de21ed7..cbc5d91d03 100644
--- a/lib/irb/cmd/load.rb
+++ b/lib/irb/cmd/load.rb
@@ -1,12 +1,13 @@
#
-# load.rb -
-# $Release Version: 0.9.6$
+# load.rb -
+# $Release Version: 0.9.5$
# $Revision$
+# $Date$
# by Keiju ISHITSUKA(keiju@ruby-lang.org)
#
# --
#
-#
+#
#
require "irb/cmd/nop.rb"
@@ -25,7 +26,7 @@ module IRB
class Require<Nop
include IrbLoader
-
+
def execute(file_name)
# return ruby_require(file_name) unless IRB.conf[:USE_LOADER]
@@ -44,7 +45,7 @@ module IRB
when /\.(so|o|sl)$/
return ruby_require(file_name)
end
-
+
begin
irb_load(f = file_name + ".rb")
$".push f
diff --git a/lib/irb/cmd/nop.rb b/lib/irb/cmd/nop.rb
index 2b028975c8..aa553c959e 100644
--- a/lib/irb/cmd/nop.rb
+++ b/lib/irb/cmd/nop.rb
@@ -1,17 +1,18 @@
#
-# nop.rb -
-# $Release Version: 0.9.6$
+# nop.rb -
+# $Release Version: 0.9.5$
# $Revision$
+# $Date$
# by Keiju ISHITSUKA(keiju@ruby-lang.org)
#
# --
#
-#
+#
#
module IRB
module ExtendCommand
class Nop
-
+
@RCS_ID='-$Id$-'
def self.execute(conf, *opts)
diff --git a/lib/irb/cmd/pushws.rb b/lib/irb/cmd/pushws.rb
index 5fd567731c..eddaeae631 100644
--- a/lib/irb/cmd/pushws.rb
+++ b/lib/irb/cmd/pushws.rb
@@ -1,12 +1,13 @@
#
-# change-ws.rb -
-# $Release Version: 0.9.6$
+# change-ws.rb -
+# $Release Version: 0.9.5$
# $Revision$
+# $Date$
# by Keiju ISHITSUKA(keiju@ruby-lang.org)
#
# --
#
-#
+#
#
require "irb/cmd/nop.rb"
diff --git a/lib/irb/cmd/subirb.rb b/lib/irb/cmd/subirb.rb
index 4d54a72b6f..79d654b172 100644
--- a/lib/irb/cmd/subirb.rb
+++ b/lib/irb/cmd/subirb.rb
@@ -1,11 +1,14 @@
-# multi.rb -
-# $Release Version: 0.9.6$
+#!/usr/local/bin/ruby
+#
+# multi.rb -
+# $Release Version: 0.9.5$
# $Revision$
+# $Date$
# by Keiju ISHITSUKA(keiju@ruby-lang.org)
#
# --
#
-#
+#
#
require "irb/cmd/nop.rb"
diff --git a/lib/irb/completion.rb b/lib/irb/completion.rb
index 459f856dfe..000658e2a3 100644
--- a/lib/irb/completion.rb
+++ b/lib/irb/completion.rb
@@ -1,7 +1,8 @@
#
-# irb/completor.rb -
+# irb/completor.rb -
# $Release Version: 0.9$
# $Revision$
+# $Date$
# by Keiju ISHITSUKA(keiju@ishitsuka.com)
# From Original Idea of shugo@ruby-lang.org
#
@@ -15,16 +16,16 @@ module IRB
ReservedWords = [
"BEGIN", "END",
- "alias", "and",
- "begin", "break",
+ "alias", "and",
+ "begin", "break",
"case", "class",
"def", "defined", "do",
"else", "elsif", "end", "ensure",
- "false", "for",
- "if", "in",
- "module",
+ "false", "for",
+ "if", "in",
+ "module",
"next", "nil", "not",
- "or",
+ "or",
"redo", "rescue", "retry", "return",
"self", "super",
"then", "true",
@@ -32,10 +33,10 @@ module IRB
"when", "while",
"yield",
]
-
+
CompletionProc = proc { |input|
bind = IRB.conf[:MAIN_CONTEXT].workspace.binding
-
+
# puts "input: #{input}"
case input
@@ -44,7 +45,7 @@ module IRB
receiver = $1
message = Regexp.quote($2)
- candidates = Regexp.instance_methods.collect{|m| m.to_s}
+ candidates = Regexp.instance_methods(true)
select_message(receiver, message, candidates)
when /^([^\]]*\])\.([^.]*)$/
@@ -52,7 +53,7 @@ module IRB
receiver = $1
message = Regexp.quote($2)
- candidates = Array.instance_methods.collect{|m| m.to_s}
+ candidates = Array.instance_methods(true)
select_message(receiver, message, candidates)
when /^([^\}]*\})\.([^.]*)$/
@@ -60,10 +61,9 @@ module IRB
receiver = $1
message = Regexp.quote($2)
- candidates = Proc.instance_methods.collect{|m| m.to_s}
- candidates |= Hash.instance_methods.collect{|m| m.to_s}
+ candidates = Proc.instance_methods(true) | Hash.instance_methods(true)
select_message(receiver, message, candidates)
-
+
when /^(:[^:.]*)$/
# Symbol
if Symbol.respond_to?(:all_symbols)
@@ -77,7 +77,7 @@ module IRB
when /^::([A-Z][^:\.\(]*)$/
# Absolute Constant or class methods
receiver = $1
- candidates = Object.constants.collect{|m| m.to_s}
+ candidates = Object.constants
candidates.grep(/^#{receiver}/).collect{|e| "::" + e}
when /^(((::)?[A-Z][^:.\(]*)+)::?([^:.]*)$/
@@ -85,8 +85,7 @@ module IRB
receiver = $1
message = Regexp.quote($4)
begin
- candidates = eval("#{receiver}.constants.collect{|m| m.to_s}", bind)
- candidates |= eval("#{receiver}.methods.collect{|m| m.to_s}", bind)
+ candidates = eval("#{receiver}.constants | #{receiver}.methods", bind)
rescue Exception
candidates = []
end
@@ -97,7 +96,7 @@ module IRB
receiver = $1
message = Regexp.quote($2)
- candidates = Symbol.instance_methods.collect{|m| m.to_s}
+ candidates = Symbol.instance_methods(true)
select_message(receiver, message, candidates)
when /^(-?(0[dbo])?[0-9_]+(\.[0-9_]+)?([eE]-?[0-9]+)?)\.([^.]*)$/
@@ -106,7 +105,7 @@ module IRB
message = Regexp.quote($5)
begin
- candidates = eval(receiver, bind).methods.collect{|m| m.to_s}
+ candidates = eval(receiver, bind).methods
rescue Exception
candidates = []
end
@@ -118,15 +117,14 @@ module IRB
message = Regexp.quote($2)
begin
- candidates = eval(receiver, bind).methods.collect{|m| m.to_s}
+ candidates = eval(receiver, bind).methods
rescue Exception
candidates = []
end
select_message(receiver, message, candidates)
when /^(\$[^.]*)$/
- regmessage = Regexp.new(Regexp.quote($1))
- candidates = global_variables.collect{|m| m.to_s}.grep(regmessage)
+ candidates = global_variables.grep(Regexp.new(Regexp.quote($1)))
# when /^(\$?(\.?[^.]+)+)\.([^.]*)$/
when /^((\.?[^.]+)+)\.([^.]*)$/
@@ -134,17 +132,17 @@ module IRB
receiver = $1
message = Regexp.quote($3)
- gv = eval("global_variables", bind).collect{|m| m.to_s}
- lv = eval("local_variables", bind).collect{|m| m.to_s}
- cv = eval("self.class.constants", bind).collect{|m| m.to_s}
-
+ gv = eval("global_variables", bind)
+ lv = eval("local_variables", bind)
+ cv = eval("self.class.constants", bind)
+
if (gv | lv | cv).include?(receiver)
# foo.func and foo is local var.
- candidates = eval("#{receiver}.methods", bind).collect{|m| m.to_s}
+ candidates = eval("#{receiver}.methods", bind)
elsif /^[A-Z]/ =~ receiver and /\./ !~ receiver
# Foo::Bar.func
begin
- candidates = eval("#{receiver}.methods", bind).collect{|m| m.to_s}
+ candidates = eval("#{receiver}.methods", bind)
rescue Exception
candidates = []
end
@@ -157,9 +155,9 @@ module IRB
rescue Exception
name = ""
end
- next if name != "IRB::Context" and
+ next if name != "IRB::Context" and
/^(IRB|SLex|RubyLex|RubyToken)/ =~ name
- candidates.concat m.instance_methods(false).collect{|x| x.to_s}
+ candidates.concat m.instance_methods(false)
}
candidates.sort!
candidates.uniq!
@@ -172,19 +170,19 @@ module IRB
receiver = ""
message = Regexp.quote($1)
- candidates = String.instance_methods(true).collect{|m| m.to_s}
+ candidates = String.instance_methods(true)
select_message(receiver, message, candidates)
else
- candidates = eval("methods | private_methods | local_variables | self.class.constants", bind).collect{|m| m.to_s}
-
+ candidates = eval("methods | private_methods | local_variables | self.class.constants", bind)
+
(candidates|ReservedWords).grep(/^#{Regexp.quote(input)}/)
end
}
Operators = ["%", "&", "*", "**", "+", "-", "/",
"<", "<<", "<=", "<=>", "==", "===", "=~", ">", ">=", ">>",
- "[]", "[]=", "^", "!", "!=", "!~"]
+ "[]", "[]=", "^",]
def self.select_message(receiver, message, candidates)
candidates.grep(/^#{message}/).collect do |e|
diff --git a/lib/irb/context.rb b/lib/irb/context.rb
index a2778f76ab..d01bd4aefa 100644
--- a/lib/irb/context.rb
+++ b/lib/irb/context.rb
@@ -1,15 +1,15 @@
#
# irb/context.rb - irb context
-# $Release Version: 0.9.6$
+# $Release Version: 0.9.5$
# $Revision$
+# $Date$
# by Keiju ISHITSUKA(keiju@ruby-lang.org)
#
# --
#
-#
+#
#
require "irb/workspace"
-require "irb/inspector"
module IRB
class Context
@@ -35,8 +35,8 @@ module IRB
@load_modules = IRB.conf[:LOAD_MODULES]
@use_readline = IRB.conf[:USE_READLINE]
+ @inspect_mode = IRB.conf[:INSPECT_MODE]
- 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]
@@ -46,7 +46,7 @@ module IRB
@ignore_eof = IRB.conf[:IGNORE_EOF]
@back_trace_limit = IRB.conf[:BACK_TRACE_LIMIT]
-
+
self.prompt_mode = IRB.conf[:PROMPT_MODE]
if IRB.conf[:SINGLE_IRB] or !defined?(JobManager)
@@ -91,7 +91,7 @@ module IRB
@output_method = StdioOutputMethod.new
end
- @verbose = IRB.conf[:VERBOSE]
+ @verbose = IRB.conf[:VERBOSE]
@echo = IRB.conf[:ECHO]
if @echo.nil?
@echo = true
@@ -107,7 +107,7 @@ module IRB
attr_accessor :workspace
attr_reader :thread
attr_accessor :io
-
+
attr_accessor :irb
attr_accessor :ap_name
attr_accessor :rc
@@ -142,7 +142,7 @@ module IRB
def verbose?
if @verbose.nil?
- if defined?(ReadlineInputMethod) && @io.kind_of?(ReadlineInputMethod)
+ if defined?(ReadlineInputMethod) && @io.kind_of?(ReadlineInputMethod)
false
elsif !STDIN.tty? or @io.kind_of?(FileInputMethod)
true
@@ -180,7 +180,7 @@ module IRB
@auto_indent_mode = IRB.conf[:AUTO_INDENT]
end
end
-
+
def inspect?
@inspect_mode.nil? or @inspect_mode
end
@@ -190,49 +190,15 @@ module IRB
end
def inspect_mode=(opt)
-
- if i = INSPECTORS[opt]
+ if opt
@inspect_mode = opt
- @inspect_method = i
- i.init
else
- case opt
- when nil
- if INSPECTORS.keys_with_inspector(INSPECTORS[true]).include?(@inspect_mode)
- self.inspect_mode = false
- elsif INSPECTORS.keys_with_inspector(INSPECTORS[false]).include?(@inspect_mode)
- self.inspect_mode = true
- else
- puts "Can't switch inspect mode."
- return
- end
- when /^\s*\{.*\}\s*$/
- begin
- inspector = eval "proc#{opt}"
- rescue Exception
- puts "Can't switch inspect mode(#{opt})."
- return
- end
- self.inspect_mode = inspector
- when Proc
- self.inspect_mode = IRB::Inspector(opt)
- when Inspector
- prefix = "usr%d"
- i = 1
- while INSPECTORS[format(prefix, i)]; i += 1; end
- @inspect_mode = format(prefix, i)
- @inspect_method = opt
- INSPECTORS.def_inspector(format(prefix, i), @inspect_method)
- else
- puts "Can't switch inspect mode(#{opt})."
- return
- end
+ @inspect_mode = !@inspect_mode
end
print "Switch to#{unless @inspect_mode; ' non';end} inspect mode.\n" if verbose?
@inspect_mode
end
-
def use_readline=(opt)
@use_readline = opt
print "use readline module\n" if @use_readline
@@ -255,10 +221,6 @@ module IRB
# @_ = @workspace.evaluate(line, irb_path, line_no)
end
- def inspect_last_value
- @inspect_method.inspect_value(@last_value)
- end
-
alias __exit__ exit
def exit(ret = 0)
IRB.irb_exit(@irb, ret)
@@ -272,8 +234,7 @@ module IRB
def inspect
array = []
for ivar in instance_variables.sort{|e1, e2| e1 <=> e2}
- ivar = ivar.to_s
- name = ivar.sub(/^@(.*)$/, '\1')
+ name = ivar.sub(/^@(.*)$/){$1}
val = instance_eval(ivar)
case ivar
when *NOPRINTING_IVARS
diff --git a/lib/irb/ext/change-ws.rb b/lib/irb/ext/change-ws.rb
index dea969d384..fff8f58fe5 100644
--- a/lib/irb/ext/change-ws.rb
+++ b/lib/irb/ext/change-ws.rb
@@ -1,12 +1,13 @@
#
-# irb/ext/cb.rb -
-# $Release Version: 0.9.6$
+# irb/ext/cb.rb -
+# $Release Version: 0.9.5$
# $Revision$
+# $Date$
# by Keiju ISHITSUKA(keiju@ruby-lang.org)
#
# --
#
-#
+#
#
module IRB
@@ -22,12 +23,12 @@ module IRB
def change_workspace(*_main)
if _main.empty?
- @workspace = home_workspace
+ @workspace = home_workspace
return main
end
-
+
@workspace = WorkSpace.new(_main[0])
-
+
if !(class<<main;ancestors;end).include?(ExtendCommandBundle)
main.extend ExtendCommandBundle
end
@@ -56,6 +57,6 @@ module IRB
# end
# end
# alias change_workspace change_binding
- end
+ end
end
diff --git a/lib/irb/ext/history.rb b/lib/irb/ext/history.rb
index 1495f9eb14..40f8692e8b 100644
--- a/lib/irb/ext/history.rb
+++ b/lib/irb/ext/history.rb
@@ -1,12 +1,13 @@
#
-# history.rb -
-# $Release Version: 0.9.6$
+# history.rb -
+# $Release Version: 0.9.5$
# $Revision$
+# $Date$
# by Keiju ISHITSUKA(keiju@ruby-lang.org)
#
# --
#
-#
+#
#
module IRB
@@ -56,7 +57,7 @@ module IRB
end
def size(size)
- if size != 0 && size < @size
+ if size != 0 && size < @size
@contents = @contents[@size - size .. @size]
end
@size = size
@@ -78,7 +79,7 @@ module IRB
@contents.push [no, val]
@contents.shift if @size != 0 && @contents.size > @size
end
-
+
alias real_inspect inspect
def inspect
diff --git a/lib/irb/ext/loader.rb b/lib/irb/ext/loader.rb
index 26a3203676..837e2553ac 100644
--- a/lib/irb/ext/loader.rb
+++ b/lib/irb/ext/loader.rb
@@ -1,12 +1,13 @@
#
-# loader.rb -
-# $Release Version: 0.9.6$
+# loader.rb -
+# $Release Version: 0.9.5$
# $Revision$
+# $Date$
# by Keiju ISHITSUKA(keiju@ruby-lang.org)
#
# --
#
-#
+#
#
@@ -44,7 +45,7 @@ module IRB
irb.suspend_name(path, File.basename(path)) do
irb.suspend_input_method(FileInputMethod.new(path)) do
|back_io|
- irb.signal_status(:IN_LOAD) do
+ irb.signal_status(:IN_LOAD) do
if back_io.kind_of?(FileInputMethod)
irb.eval_input
else
@@ -61,7 +62,7 @@ module IRB
def load_file(path, priv = nil)
irb.suspend_name(path, File.basename(path)) do
-
+
if priv
ws = WorkSpace.new(Module.new)
else
@@ -70,7 +71,7 @@ module IRB
irb.suspend_workspace(ws) do
irb.suspend_input_method(FileInputMethod.new(path)) do
|back_io|
- irb.signal_status(:IN_LOAD) do
+ irb.signal_status(:IN_LOAD) do
# p irb.conf
if back_io.kind_of?(FileInputMethod)
irb.eval_input
diff --git a/lib/irb/ext/math-mode.rb b/lib/irb/ext/math-mode.rb
index 41be79841c..bd443b96ed 100644
--- a/lib/irb/ext/math-mode.rb
+++ b/lib/irb/ext/math-mode.rb
@@ -1,12 +1,13 @@
#
-# math-mode.rb -
-# $Release Version: 0.9.6$
+# math-mode.rb -
+# $Release Version: 0.9.5$
# $Revision$
+# $Date$
# by Keiju ISHITSUKA(keiju@ruby-lang.org)
#
# --
#
-#
+#
#
require "mathn"
diff --git a/lib/irb/ext/multi-irb.rb b/lib/irb/ext/multi-irb.rb
index 7bb1a7cfab..4589b1d554 100644
--- a/lib/irb/ext/multi-irb.rb
+++ b/lib/irb/ext/multi-irb.rb
@@ -1,12 +1,13 @@
#
# irb/multi-irb.rb - multiple irb module
-# $Release Version: 0.9.6$
+# $Release Version: 0.9.5$
# $Revision$
+# $Date$
# by Keiju ISHITSUKA(keiju@ruby-lang.org)
#
# --
#
-#
+#
#
IRB.fail CantShiftToMultiIrbMode unless defined?(Thread)
require "thread"
@@ -66,10 +67,10 @@ module IRB
IRB.fail IrbAlreadyDead unless th.alive?
th.exit
end
- end
+ end
def search(key)
- job = case key
+ case key
when Integer
@jobs[key]
when Irb
@@ -77,10 +78,10 @@ module IRB
when Thread
@jobs.assoc(key)
else
- @jobs.find{|k, v| v.context.main.equal?(key)}
+ assoc = @jobs.find{|k, v| v.context.main.equal?(key)}
+ IRB.fail NoSuchJob, key if assoc.nil?
+ assoc
end
- IRB.fail NoSuchJob, key if job.nil?
- job
end
def delete(key)
@@ -123,8 +124,8 @@ module IRB
t_status = "exited"
end
ary.push format("#%d->%s on %s (%s: %s)",
- i,
- irb.context.irb_name,
+ i,
+ irb.context.irb_name,
irb.context.main,
th,
t_status)
@@ -143,14 +144,14 @@ module IRB
IRB.JobManager.irb(Thread.current).context
end
- # invoke multi-irb
+ # invoke multi-irb
def IRB.irb(file = nil, *main)
workspace = WorkSpace.new(*main)
parent_thread = Thread.current
Thread.start do
begin
irb = Irb.new(workspace, file)
- rescue
+ rescue
print "Subirb can't start with context(self): ", workspace.main.inspect, "\n"
print "return to main irb\n"
Thread.pass
diff --git a/lib/irb/ext/save-history.rb b/lib/irb/ext/save-history.rb
index e3597c6216..5260bfcdd8 100644
--- a/lib/irb/ext/save-history.rb
+++ b/lib/irb/ext/save-history.rb
@@ -1,11 +1,14 @@
-# save-history.rb -
-# $Release Version: 0.9.6$
+#!/usr/local/bin/ruby
+#
+# save-history.rb -
+# $Release Version: 0.9.5$
# $Revision$
-# by Keiju ISHITSUKA(keiju@ruby-lang.org)
+# $Date$
+# by Keiju ISHITSUKAkeiju@ruby-lang.org)
#
# --
#
-#
+#
#
require "readline"
@@ -50,11 +53,11 @@ module IRB
def HistorySavingAbility.create_finalizer
proc do
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)
+ if hf = IRB.conf[:HISTORY_FILE]
+ file = File.expand_path(hf)
end
- history_file = IRB.rc_file("_history") unless history_file
- open(history_file, 'w' ) do |f|
+ file = IRB.rc_file("_history") unless file
+ open(file, 'w' ) do |f|
hist = HISTORY.to_a
f.puts(hist[-num..-1] || hist)
end
@@ -69,15 +72,14 @@ module IRB
end
def load_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|
+ hist = IRB.conf[:HISTORY_FILE]
+ hist = IRB.rc_file("_history") unless hist
+ if File.exist?(hist)
+ open(hist) do |f|
f.each {|l| HISTORY << l.chomp}
end
end
end
end
end
+
diff --git a/lib/irb/ext/tracer.rb b/lib/irb/ext/tracer.rb
index 46a9d53a2e..805f630a4d 100644
--- a/lib/irb/ext/tracer.rb
+++ b/lib/irb/ext/tracer.rb
@@ -1,12 +1,13 @@
#
-# irb/lib/tracer.rb -
-# $Release Version: 0.9.6$
+# irb/lib/tracer.rb -
+# $Release Version: 0.9.5$
# $Revision$
+# $Date$
# by Keiju ISHITSUKA(keiju@ruby-lang.org)
#
# --
#
-#
+#
#
require "tracer"
@@ -43,7 +44,7 @@ module IRB
alias __evaluate__ evaluate
def evaluate(context, statements, file = nil, line = nil)
if context.use_tracer? && file != nil && line != nil
- Tracer.on
+ Tracer.on
begin
__evaluate__(context, statements, file, line)
ensure
@@ -57,4 +58,4 @@ module IRB
IRB.initialize_tracer
end
-
+
diff --git a/lib/irb/ext/use-loader.rb b/lib/irb/ext/use-loader.rb
index 64283b8989..1b4d480fcd 100644
--- a/lib/irb/ext/use-loader.rb
+++ b/lib/irb/ext/use-loader.rb
@@ -1,12 +1,13 @@
#
-# use-loader.rb -
-# $Release Version: 0.9.6$
+# use-loader.rb -
+# $Release Version: 0.9.5$
# $Revision$
+# $Date$
# by Keiju ISHITSUKA(keiju@ruby-lang.org)
#
# --
#
-#
+#
#
require "irb/cmd/load"
@@ -30,7 +31,7 @@ module IRB
class Context
IRB.conf[:USE_LOADER] = false
-
+
def use_loader
IRB.conf[:USE_LOADER]
end
diff --git a/lib/irb/ext/workspaces.rb b/lib/irb/ext/workspaces.rb
index 118ea598c0..79098570dc 100644
--- a/lib/irb/ext/workspaces.rb
+++ b/lib/irb/ext/workspaces.rb
@@ -1,12 +1,13 @@
#
-# push-ws.rb -
-# $Release Version: 0.9.6$
+# push-ws.rb -
+# $Release Version: 0.9.5$
# $Revision$
+# $Date$
# by Keiju ISHITSUKA(keiju@ruby-lang.org)
#
# --
#
-#
+#
#
module IRB
diff --git a/lib/irb/extend-command.rb b/lib/irb/extend-command.rb
index 7bc033cee1..508721c11d 100644
--- a/lib/irb/extend-command.rb
+++ b/lib/irb/extend-command.rb
@@ -1,12 +1,13 @@
#
-# irb/extend-command.rb - irb extend command
-# $Release Version: 0.9.6$
+# irb/extend-command.rb - irb extend command
+# $Release Version: 0.9.5$
# $Revision$
+# $Date$
# by Keiju ISHITSUKA(keiju@ruby-lang.org)
#
# --
#
-#
+#
#
module IRB
#
@@ -89,15 +90,15 @@ module IRB
[:irb_load, :Load, "irb/cmd/load"],
[:irb_require, :Require, "irb/cmd/load"],
- [:irb_source, :Source, "irb/cmd/load",
+ [:irb_source, :Source, "irb/cmd/load",
[:source, NO_OVERRIDE]],
[:irb, :IrbCommand, "irb/cmd/subirb"],
- [:irb_jobs, :Jobs, "irb/cmd/subirb",
+ [:irb_jobs, :Jobs, "irb/cmd/subirb",
[:jobs, NO_OVERRIDE]],
- [:irb_fg, :Foreground, "irb/cmd/subirb",
+ [:irb_fg, :Foreground, "irb/cmd/subirb",
[:fg, NO_OVERRIDE]],
- [:irb_kill, :Kill, "irb/cmd/subirb",
+ [:irb_kill, :Kill, "irb/cmd/subirb",
[:kill, OVERRIDE_PRIVATE_ONLY]],
[:irb_help, :Help, "irb/cmd/help",
@@ -125,14 +126,9 @@ module IRB
eval %[
def #{cmd_name}(*opts, &b)
require "#{load_file}"
- arity = ExtendCommand::#{cmd_class}.instance_method(:execute).arity
- args = (1..arity.abs).map {|i| "arg" + i.to_s }
- args << "*opts" if arity < 0
- args << "&block"
- args = args.join(", ")
eval %[
- def #{cmd_name}(\#{args})
- ExtendCommand::#{cmd_class}.execute(irb_context, \#{args})
+ def #{cmd_name}(*opts, &b)
+ ExtendCommand::#{cmd_class}.execute(irb_context, *opts, &b)
end
]
send :#{cmd_name}, *opts, &b
@@ -161,9 +157,9 @@ module IRB
(override == NO_OVERRIDE) && !respond_to?(to, true)
target = self
(class<<self;self;end).instance_eval{
- if target.respond_to?(to, true) &&
+ if target.respond_to?(to, true) &&
!target.respond_to?(EXCB.irb_original_method_name(to), true)
- alias_method(EXCB.irb_original_method_name(to), to)
+ alias_method(EXCB.irb_original_method_name(to), to)
end
alias_method to, from
}
diff --git a/lib/irb/frame.rb b/lib/irb/frame.rb
index 8814b47a9d..f0b0a9abf3 100644
--- a/lib/irb/frame.rb
+++ b/lib/irb/frame.rb
@@ -1,12 +1,13 @@
#
-# frame.rb -
+# frame.rb -
# $Release Version: 0.9$
# $Revision$
+# $Date$
# by Keiju ISHITSUKA(Nihon Rational Software Co.,Ltd)
#
# --
#
-#
+#
#
require "e2mmap"
diff --git a/lib/irb/help.rb b/lib/irb/help.rb
index 4a308b6e46..4921de6ec9 100644
--- a/lib/irb/help.rb
+++ b/lib/irb/help.rb
@@ -1,35 +1,33 @@
#
# irb/help.rb - print usage module
-# $Release Version: 0.9.6$
+# $Release Version: 0.9.5$
# $Revision$
+# $Date$
# by Keiju ISHITSUKA(keiju@ishitsuka.com)
#
# --
#
+#
#
-#
-
-require 'irb/magic-file'
module IRB
def IRB.print_usage
lc = IRB.conf[:LC_MESSAGES]
path = lc.find("irb/help-message")
space_line = false
- IRB::MagicFile.open(path){|f|
- f.each_line do |l|
- if /^\s*$/ =~ l
- lc.puts l unless space_line
- space_line = true
- next
- end
- space_line = false
-
- l.sub!(/#.*$/, "")
- next if /^\s*$/ =~ l
- lc.puts l
+ File.foreach(path) do
+ |l|
+ if /^\s*$/ =~ l
+ lc.puts l unless space_line
+ space_line = true
+ next
end
- }
+ space_line = false
+
+ l.sub!(/#.*$/, "")
+ next if /^\s*$/ =~ l
+ lc.puts l
+ end
end
end
diff --git a/lib/irb/init.rb b/lib/irb/init.rb
index 489850a86b..db22ca639b 100644
--- a/lib/irb/init.rb
+++ b/lib/irb/init.rb
@@ -1,12 +1,13 @@
#
# irb/init.rb - irb initialize module
-# $Release Version: 0.9.6$
+# $Release Version: 0.9.5$
# $Revision$
+# $Date$
# by Keiju ISHITSUKA(keiju@ruby-lang.org)
#
# --
#
-#
+#
#
module IRB
@@ -20,7 +21,7 @@ module IRB
IRB.load_modules
unless @CONF[:PROMPT][@CONF[:PROMPT_MODE]]
- IRB.fail(UndefinedPromptMode, @CONF[:PROMPT_MODE])
+ IRB.fail(UndefinedPromptMode, @CONF[:PROMPT_MODE])
end
end
@@ -44,7 +45,7 @@ module IRB
@CONF[:MATH_MODE] = false
@CONF[:USE_READLINE] = false unless defined?(ReadlineInputMethod)
- @CONF[:INSPECT_MODE] = true
+ @CONF[:INSPECT_MODE] = nil
@CONF[:USE_TRACER] = false
@CONF[:USE_LOADER] = false
@CONF[:IGNORE_SIGINT] = true
@@ -112,7 +113,7 @@ module IRB
# @CONF[:LC_MESSAGES] = "en"
@CONF[:LC_MESSAGES] = Locale.new
-
+
@CONF[:DEBUG_LEVEL] = 1
end
@@ -139,17 +140,10 @@ module IRB
when /^-I(.+)?/
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
- set_encoding(*opt.split(':', 2))
+ when /^-K(.)/
+ $KCODE = $1
when "--inspect"
- if /^-/ !~ ARGV.first
- @CONF[:INSPECT_MODE] = ARGV.shift
- else
- @CONF[:INSPECT_MODE] = true
- end
+ @CONF[:INSPECT_MODE] = true
when "--noinspect"
@CONF[:INSPECT_MODE] = false
when "--readline"
@@ -164,9 +158,8 @@ module IRB
@CONF[:VERBOSE] = true
when "--noverbose"
@CONF[:VERBOSE] = false
- when /^--prompt-mode(?:=(.+))?/, /^--prompt(?:=(.+))?/
- opt = $1 || ARGV.shift
- prompt_mode = opt.upcase.tr("-", "_").intern
+ when "--prompt-mode", "--prompt"
+ prompt_mode = ARGV.shift.upcase.tr("-", "_").intern
@CONF[:PROMPT_MODE] = prompt_mode
when "--noprompt"
@CONF[:PROMPT_MODE] = :NULL
@@ -176,14 +169,14 @@ module IRB
@CONF[:PROMPT_MODE] = :SIMPLE
when "--tracer"
@CONF[:USE_TRACER] = true
- when /^--back-trace-limit(?:=(.+))?/
- @CONF[:BACK_TRACE_LIMIT] = ($1 || ARGV.shift).to_i
- when /^--context-mode(?:=(.+))?/
- @CONF[:CONTEXT_MODE] = ($1 || ARGV.shift).to_i
+ when "--back-trace-limit"
+ @CONF[:BACK_TRACE_LIMIT] = ARGV.shift.to_i
+ when "--context-mode"
+ @CONF[:CONTEXT_MODE] = ARGV.shift.to_i
when "--single-irb"
@CONF[:SINGLE_IRB] = true
- when /^--irb_debug=(?:=(.+))?/
- @CONF[:DEBUG_LEVEL] = ($1 || ARGV.shift).to_i
+ when "--irb_debug"
+ @CONF[:DEBUG_LEVEL] = ARGV.shift.to_i
when "-v", "--version"
print IRB.version, "\n"
exit 0
@@ -191,12 +184,6 @@ module IRB
require "irb/help"
IRB.print_usage
exit 0
- when "--"
- if opt = ARGV.shfit
- @CONF[:SCRIPT] = opt
- $0 = opt
- end
- break
when /^-/
IRB.fail UnrecognizedSwitch, opt
else
@@ -211,7 +198,6 @@ module IRB
end
end
$LOAD_PATH.unshift(*load_path)
-
end
# running config
@@ -220,7 +206,7 @@ module IRB
begin
load rc_file
rescue LoadError, Errno::ENOENT
- rescue # StandardError, ScriptError
+ rescue
print "load error: #{rc_file}\n"
print $!.class, ": ", $!, "\n"
for err in $@[0, $@.size - 2]
@@ -247,10 +233,10 @@ module IRB
# enumerate possible rc-file base name generators
def IRB.rc_file_generators
if irbrc = ENV["IRBRC"]
- yield proc{|rc| rc == "rc" ? irbrc : irbrc+rc}
+ yield proc{|rc| rc == "rc" ? irbrc : irbrc+rc}
end
if home = ENV["HOME"]
- yield proc{|rc| home+"/.irb#{rc}"}
+ yield proc{|rc| home+"/.irb#{rc}"}
end
home = Dir.pwd
yield proc{|rc| home+"/.irb#{rc}"}
@@ -264,27 +250,10 @@ module IRB
for m in @CONF[:LOAD_MODULES]
begin
require m
- rescue LoadError => err
- warn err.backtrace[0] << ":#{err.class}: #{err}"
+ rescue
+ print $@[0], ":", $!.class, ": ", $!, "\n"
end
end
end
-
- DefaultEncodings = Struct.new(:external, :internal)
- class << IRB
- private
- def set_encoding(extern, intern = nil)
- verbose, $VERBOSE = $VERBOSE, nil
- Encoding.default_external = extern unless extern.nil? || extern.empty?
- Encoding.default_internal = intern unless intern.nil? || intern.empty?
- @CONF[:ENCODINGS] = IRB::DefaultEncodings.new(extern, intern)
- [$stdin, $stdout, $stderr].each do |io|
- io.set_encoding(extern, intern)
- end
- @CONF[:LC_MESSAGES].instance_variable_set(:@encoding, extern)
- ensure
- $VERBOSE = verbose
- end
- end
end
diff --git a/lib/irb/input-method.rb b/lib/irb/input-method.rb
index 7227df4ca0..bfb90fa59a 100644
--- a/lib/irb/input-method.rb
+++ b/lib/irb/input-method.rb
@@ -1,18 +1,16 @@
#
# irb/input-method.rb - input methods used irb
-# $Release Version: 0.9.6$
+# $Release Version: 0.9.5$
# $Revision$
+# $Date$
# by Keiju ISHITSUKA(keiju@ruby-lang.org)
#
# --
#
+#
#
-#
-require 'irb/src_encoding'
-require 'irb/magic-file'
-
module IRB
- #
+ #
# InputMethod
# StdioInputMethod
# FileInputMethod
@@ -28,7 +26,7 @@ module IRB
attr_reader :file_name
attr_accessor :prompt
-
+
def gets
IRB.fail NotImplementedError, "gets"
end
@@ -38,24 +36,21 @@ module IRB
false
end
end
-
+
class StdioInputMethod < InputMethod
def initialize
super
@line_no = 0
@line = []
- @stdin = IO.open(STDIN.to_i, :external_encoding => IRB.conf[:LC_MESSAGES].encoding, :internal_encoding => "-")
- @stdout = IO.open(STDOUT.to_i, 'w', :external_encoding => IRB.conf[:LC_MESSAGES].encoding, :internal_encoding => "-")
end
def gets
print @prompt
- line = @stdin.gets
- @line[@line_no += 1] = line
+ @line[@line_no += 1] = $stdin.gets
end
def eof?
- @stdin.eof?
+ $stdin.eof?
end
def readable_atfer_eof?
@@ -65,16 +60,12 @@ module IRB
def line(line_no)
@line[line_no]
end
-
- def encoding
- @stdin.external_encoding
- end
end
-
+
class FileInputMethod < InputMethod
def initialize(file)
super
- @io = IRB::MagicFile.open(file)
+ @io = open(file)
end
attr_reader :file_name
@@ -88,32 +79,23 @@ module IRB
# print @prompt, l
l
end
-
- def encoding
- @io.external_encoding
- end
end
begin
require "readline"
class ReadlineInputMethod < InputMethod
- include Readline
+ include 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 => "-")
end
def gets
- Readline.input = @stdin
- Readline.output = @stdout
if l = readline(@prompt, false)
- HISTORY.push(l) if !l.empty?
+ HISTORY.push(l) if !l.empty?
@line[@line_no += 1] = l + "\n"
else
@eof = true
@@ -132,10 +114,6 @@ module IRB
def line(line_no)
@line[line_no]
end
-
- def encoding
- @stdin.external_encoding
- end
end
rescue LoadError
end
diff --git a/lib/irb/inspector.rb b/lib/irb/inspector.rb
deleted file mode 100644
index c254ab58d6..0000000000
--- a/lib/irb/inspector.rb
+++ /dev/null
@@ -1,103 +0,0 @@
-#
-# irb/inspector.rb - inspect methods
-# $Release Version: 0.9.6$
-# $Revision: 1.19 $
-# $Date: 2002/06/11 07:51:31 $
-# by Keiju ISHITSUKA(keiju@ruby-lang.org)
-#
-# --
-#
-#
-#
-
-module IRB
-
- def IRB::Inspector(inspect, init = nil)
- Inspector.new(inspect, init)
- end
-
- class Inspector
- def initialize(inspect_proc, init_proc = nil)
- @init = init_proc
- @inspect = inspect_proc
- end
-
- def init
- @init.call if @init
- end
-
- def inspect_value(v)
- @inspect.call(v)
- end
- end
-
- INSPECTORS = {}
-
- def INSPECTORS.keys_with_inspector(inspector)
- select{|k,v| v == inspector}.collect{|k, v| k}
- end
-
- # ex)
- # INSPECTORS.def_inspector(key, init_p=nil){|v| v.inspect}
- # INSPECTORS.def_inspector([key1,..], init_p=nil){|v| v.inspect}
- # INSPECTORS.def_inspector(key, inspector)
- # INSPECTORS.def_inspector([key1,...], inspector)
-
- def INSPECTORS.def_inspector(key, arg=nil, &block)
-# if !block_given?
-# case arg
-# when nil, Proc
-# inspector = IRB::Inspector(init_p)
-# when Inspector
-# inspector = init_p
-# else
-# IRB.Raise IllegalParameter, init_p
-# end
-# init_p = nil
-# else
-# inspector = IRB::Inspector(block, init_p)
-# end
-
- if block_given?
- inspector = IRB::Inspector(block, arg)
- else
- inspector = arg
- end
-
- case key
- when Array
- for k in key
- def_inspector(k, inspector)
- end
- when Symbol
- self[key] = inspector
- self[key.to_s] = inspector
- when String
- self[key] = inspector
- self[key.intern] = inspector
- else
- self[key] = inspector
- end
- end
-
- INSPECTORS.def_inspector([false, :to_s, :raw]){|v| v.to_s}
- INSPECTORS.def_inspector([true, :p, :inspect]){|v| v.inspect}
- INSPECTORS.def_inspector([:pp, :pretty_inspect], proc{require "pp"}){|v| v.pretty_inspect.chomp}
- INSPECTORS.def_inspector([:yaml, :YAML], proc{require "yaml"}){|v|
- begin
- YAML.dump(v)
- rescue
- puts "(can't dump yaml. use inspect)"
- v.inspect
- end
- }
-
- INSPECTORS.def_inspector([:marshal, :Marshal, :MARSHAL, Marshal]){|v|
- Marshal.dump(v)
- }
-end
-
-
-
-
-
diff --git a/lib/irb/lc/error.rb b/lib/irb/lc/error.rb
index 742821e3af..247596b7fe 100644
--- a/lib/irb/lc/error.rb
+++ b/lib/irb/lc/error.rb
@@ -1,12 +1,13 @@
#
-# irb/lc/error.rb -
-# $Release Version: 0.9.6$
+# irb/lc/error.rb -
+# $Release Version: 0.9.5$
# $Revision$
+# $Date$
# by Keiju ISHITSUKA(keiju@ruby-lang.org)
#
# --
#
-#
+#
#
require "e2mmap"
@@ -17,7 +18,7 @@ module IRB
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 :IllegalParameter, "Illegal parameter(%s)."
def_exception :IrbAlreadyDead, "Irb is already dead."
def_exception :IrbSwitchedToCurrentThread, "Switched to current thread."
def_exception :NoSuchJob, "No such job(%s)."
diff --git a/lib/irb/lc/help-message b/lib/irb/lc/help-message
index dd30b9fd24..32087d113c 100644
--- a/lib/irb/lc/help-message
+++ b/lib/irb/lc/help-message
@@ -1,8 +1,8 @@
-# -*- coding: US-ASCII -*-
#
# irb/lc/help-message.rb -
-# $Release Version: 0.9.6$
+# $Release Version: 0.9.5$
# $Revision$
+# $Date$
# by Keiju ISHITSUKA(keiju@ruby-lang.org)
#
# --
@@ -15,8 +15,6 @@ Usage: irb.rb [options] [programfile] [arguments]
-d Set $DEBUG to true (same as `ruby -d')
-r load-module Same as `ruby -r'
-I path Specify $LOAD_PATH directory
- -U Same as `ruby -U`
- -E enc Same as `ruby -E`
--inspect Use `inspect' for output (default except for bc mode)
--noinspect Don't use inspect for output
--readline Use Readline extension module
@@ -35,4 +33,3 @@ Usage: irb.rb [options] [programfile] [arguments]
value is 16.
--irb_debug n Set internal debug level to n (not for popular use)
-v, --version Print the version of irb
-# vim:fileencoding=us-ascii
diff --git a/lib/irb/lc/ja/encoding_aliases.rb b/lib/irb/lc/ja/encoding_aliases.rb
deleted file mode 100644
index a713dff4be..0000000000
--- a/lib/irb/lc/ja/encoding_aliases.rb
+++ /dev/null
@@ -1,8 +0,0 @@
-module IRB
- class Locale
- @@legacy_encoding_alias_map = {
- 'ujis' => Encoding::EUC_JP,
- 'euc' => Encoding::EUC_JP
- }.freeze
- end
-end
diff --git a/lib/irb/lc/ja/error.rb b/lib/irb/lc/ja/error.rb
index 9a7670f459..4c2fb3b839 100644
--- a/lib/irb/lc/ja/error.rb
+++ b/lib/irb/lc/ja/error.rb
@@ -1,27 +1,27 @@
-# -*- coding: utf-8 -*-
-# irb/lc/ja/error.rb -
-# $Release Version: 0.9.6$
+#
+# irb/lc/ja/error.rb -
+# $Release Version: 0.9.5$
# $Revision$
+# $Date$
# by Keiju ISHITSUKA(keiju@ruby-lang.org)
#
# --
#
-#
+#
#
require "e2mmap"
module IRB
# 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 :UnrecognizedSwitch, '$B%9%$%C%A(B(%s)$B$,J,$j$^$;$s(B'
+ def_exception :NotImplementedError, '`%s\'$B$NDj5A$,I,MW$G$9(B'
+ def_exception :CantReturnToNormalMode, 'Normal$B%b!<%I$KLa$l$^$;$s(B.'
+ def_exception :IllegalParameter, '$B%Q%i%a!<%?(B(%s)$B$,4V0c$C$F$$$^$9(B.'
+ def_exception :IrbAlreadyDead, 'Irb$B$O4{$K;`$s$G$$$^$9(B.'
+ def_exception :IrbSwitchedToCurrentThread, '$B%+%l%s%H%9%l%C%I$K@Z$jBX$o$j$^$7$?(B.'
+ def_exception :NoSuchJob, '$B$=$N$h$&$J%8%g%V(B(%s)$B$O$"$j$^$;$s(B.'
+ def_exception :CantShiftToMultiIrbMode, 'multi-irb mode$B$K0\$l$^$;$s(B.'
+ def_exception :CantChangeBinding, '$B%P%$%s%G%#%s%0(B(%s)$B$KJQ99$G$-$^$;$s(B.'
+ def_exception :UndefinedPromptMode, '$B%W%m%s%W%H%b!<%I(B(%s)$B$ODj5A$5$l$F$$$^$;$s(B.'
end
-# vim:fileencoding=utf-8
diff --git a/lib/irb/lc/ja/help-message b/lib/irb/lc/ja/help-message
index f2c4066cf6..debbfe9355 100644
--- a/lib/irb/lc/ja/help-message
+++ b/lib/irb/lc/ja/help-message
@@ -1,7 +1,8 @@
-# -*- coding: utf-8 -*-
+#
# irb/lc/ja/help-message.rb -
-# $Release Version: 0.9.6$
+# $Release Version: 0.9.5$
# $Revision$
+# $Date$
# by Keiju ISHITSUKA(keiju@ruby-lang.org)
#
# --
@@ -9,31 +10,27 @@
#
#
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 を追加する.
- -U ruby -U と同じ.
- -E enc ruby -E と同じ.
- --inspect 結果出力にinspectを用いる(bcモード以外はデフォルト).
- --noinspect 結果出力にinspectを用いない.
- --readline readlineライブラリを利用する.
- --noreadline readlineライブラリを利用しない.
+ -f ~/.irbrc $B$rFI$_9~$^$J$$(B.
+ -m bc$B%b!<%I(B($BJ,?t(B, $B9TNs$N7W;;$,$G$-$k(B)
+ -d $DEBUG $B$r(Btrue$B$K$9$k(B(ruby -d $B$HF1$8(B)
+ -r load-module ruby -r $B$HF1$8(B.
+ -I path $LOAD_PATH $B$K(B path $B$rDI2C$9$k(B.
+ --inspect $B7k2L=PNO$K(Binspect$B$rMQ$$$k(B(bc$B%b!<%I0J30$O%G%U%)%k%H(B).
+ --noinspect $B7k2L=PNO$K(Binspect$B$rMQ$$$J$$(B.
+ --readline readline$B%i%$%V%i%j$rMxMQ$9$k(B.
+ --noreadline readline$B%i%$%V%i%j$rMxMQ$7$J$$(B.
--prompt prompt-mode/--prompt-mode prompt-mode
- プロンプトモードを切替えます. 現在定義されているプ
- ロンプトモードは, default, simple, xmp, inf-rubyが
- 用意されています.
- --inf-ruby-mode emacsのinf-ruby-mode用のプロンプト表示を行なう. 特
- に指定がない限り, readlineライブラリは使わなくなる.
- --simple-prompt 非常にシンプルなプロンプトを用いるモードです.
- --noprompt プロンプト表示を行なわない.
- --tracer コマンド実行時にトレースを行なう.
+ $B%W%m%s%W%H%b!<%I$r@ZBX$($^$9(B. $B8=:_Dj5A$5$l$F$$$k%W(B
+ $B%m%s%W%H%b!<%I$O(B, default, simple, xmp, inf-ruby$B$,(B
+ $BMQ0U$5$l$F$$$^$9(B.
+ --inf-ruby-mode emacs$B$N(Binf-ruby-mode$BMQ$N%W%m%s%W%HI=<($r9T$J$&(B. $BFC(B
+ $B$K;XDj$,$J$$8B$j(B, readline$B%i%$%V%i%j$O;H$o$J$/$J$k(B.
+ --simple-prompt $BHs>o$K%7%s%W%k$J%W%m%s%W%H$rMQ$$$k%b!<%I$G$9(B.
+ --noprompt $B%W%m%s%W%HI=<($r9T$J$o$J$$(B.
+ --tracer $B%3%^%s%I<B9T;~$K%H%l!<%9$r9T$J$&(B.
--back-trace-limit n
- バックトレース表示をバックトレースの頭から n, 後ろ
- からnだけ行なう. デフォルトは16
- --irb_debug n irbのデバッグデバッグレベルをnに設定する(利用しな
- い方が無難でしょう).
- -v, --version irbのバージョンを表示する
-
-# vim:fileencoding=utf-8
+ $B%P%C%/%H%l!<%9I=<($r%P%C%/%H%l!<%9$NF,$+$i(B n, $B8e$m(B
+ $B$+$i(Bn$B$@$19T$J$&(B. $B%G%U%)%k%H$O(B16
+ --irb_debug n irb$B$N%G%P%C%0%G%P%C%0%l%Y%k$r(Bn$B$K@_Dj$9$k(B($BMxMQ$7$J(B
+ $B$$J}$,L5Fq$G$7$g$&(B).
+ -v, --version irb$B$N%P!<%8%g%s$rI=<($9$k(B
diff --git a/lib/irb/locale.rb b/lib/irb/locale.rb
index 9924409ba1..5ed9f54507 100644
--- a/lib/irb/locale.rb
+++ b/lib/irb/locale.rb
@@ -1,59 +1,51 @@
#
# irb/locale.rb - internationalization module
-# $Release Version: 0.9.6$
+# $Release Version: 0.9.5$
# $Revision$
+# $Date$
# by Keiju ISHITSUKA(keiju@ruby-lang.org)
#
# --
#
+#
#
-#
+
+autoload :Kconv, "kconv"
+
module IRB
class Locale
@RCS_ID='-$Id$-'
- LOCALE_NAME_RE = %r[
- (?<language>[[:alpha:]]{2})
- (?:_
- (?<territory>[[:alpha:]]{2,3})
- (?:\.
- (?<codeset>[^@]+)
- )?
- )?
- (?:@
- (?<modifier>.*)
- )?
- ]x
+ JPDefaultLocale = "ja"
LOCALE_DIR = "/lc/"
- @@legacy_encoding_alias_map = {}.freeze
-
def initialize(locale = nil)
- @lang = @territory = @encoding_name = @modifier = nil
- @locale = locale || ENV["IRB_LANG"] || ENV["LC_MESSAGES"] || ENV["LC_ALL"] || ENV["LANG"] || "C"
- if m = LOCALE_NAME_RE.match(@locale)
- @lang, @territory, @encoding_name, @modifier = m[:language], m[:territory], m[:codeset], m[:modifier]
-
- if @encoding_name
- begin load 'irb/encoding_aliases.rb'; rescue LoadError; end
- if @encoding = @@legacy_encoding_alias_map[@encoding_name]
- warn "%s is obsolete. use %s" % ["#{@lang}_#{@territory}.#{@encoding_name}", "#{@lang}_#{@territory}.#{@encoding.name}"]
- end
- @encoding = Encoding.find(@encoding_name) rescue nil
- end
- end
- @encoding ||= (Encoding.find('locale') rescue Encoding::ASCII_8BIT)
+ @lang = locale || ENV["IRB_LANG"] || ENV["LC_MESSAGES"] || ENV["LC_ALL"] || ENV["LANG"] || "C"
end
- attr_reader :lang, :territory, :encoding, :modifieer
+ attr_reader :lang
+
+ def lc2kconv(lang)
+ case lang
+ when "ja_JP.ujis", "ja_JP.euc", "ja_JP.eucJP"
+ Kconv::EUC
+ when "ja_JP.sjis", "ja_JP.SJIS"
+ Kconv::SJIS
+ when /ja_JP.utf-?8/i
+ Kconv::UTF8
+ end
+ end
+ private :lc2kconv
def String(mes)
mes = super(mes)
- if @encoding
- mes.encode(@encoding)
+ case @lang
+ when /^ja/
+ mes = Kconv::kconv(mes, lc2kconv(@lang))
else
mes
end
+ mes
end
def format(*opts)
@@ -109,26 +101,33 @@ module IRB
end
alias toplevel_load load
-
+
def load(file, priv=nil)
dir = File.dirname(file)
dir = "" if dir == "."
base = File.basename(file)
- if dir[0] == ?/ #/
- lc_path = search_file(dir, base)
- return real_load(lc_path, priv) if lc_path
+ if /^ja(_JP)?$/ =~ @lang
+ back, @lang = @lang, "C"
end
-
- for path in $:
- lc_path = search_file(path + "/" + dir, base)
- return real_load(lc_path, priv) if lc_path
+ begin
+ if dir[0] == ?/ #/
+ lc_path = search_file(dir, base)
+ return real_load(lc_path, priv) if lc_path
+ end
+
+ for path in $:
+ lc_path = search_file(path + "/" + dir, base)
+ return real_load(lc_path, priv) if lc_path
+ end
+ ensure
+ @lang = back if back
end
raise LoadError, "No such file to load -- #{file}"
- end
+ end
def real_load(path, priv)
- src = MagicFile.open(path){|f| f.read}
+ src = self.String(File.read(path))
if priv
eval("self", TOPLEVEL_BINDING).extend(Module.new {eval(src, nil, path)})
else
@@ -141,7 +140,7 @@ module IRB
dir = File.dirname(file)
dir = "" if dir == "."
base = File.basename(file)
- if dir =~ /^\//
+ if dir[0] == ?/ #/
return lc_path = search_file(dir, base)
else
for path in $:
@@ -154,39 +153,29 @@ module IRB
end
def search_file(path, file)
- each_sublocale do |lc|
- full_path = path + lc_path(file, lc)
- return full_path if File.exist?(full_path)
+ if File.exist?(p1 = path + lc_path(file, "C"))
+ if File.exist?(p2 = path + lc_path(file))
+ return p2
+ else
+ end
+ return p1
+ else
end
nil
end
private :search_file
- def lc_path(file = "", lc = @locale)
- if lc.nil?
+ def lc_path(file = "", lc = @lang)
+ case lc
+ when "C"
LOCALE_DIR + file
+ when /^ja/
+ LOCALE_DIR + "ja/" + file
else
LOCALE_DIR + @lang + "/" + file
end
end
private :lc_path
-
- def each_sublocale
- if @lang
- if @territory
- if @encoding_name
- yield "#{@lang}_#{@territory}.#{@encoding_name}@#{@modifier}" if @modifier
- yield "#{@lang}_#{@territory}.#{@encoding_name}"
- end
- yield "#{@lang}_#{@territory}@#{@modifier}" if @modifier
- yield "#{@lang}_#{@territory}"
- end
- yield "#{@lang}@#{@modifier}" if @modifier
- yield "#{@lang}"
- end
- yield nil
- end
- private :each_sublocale
end
end
diff --git a/lib/irb/magic-file.rb b/lib/irb/magic-file.rb
deleted file mode 100644
index 861262050e..0000000000
--- a/lib/irb/magic-file.rb
+++ /dev/null
@@ -1,36 +0,0 @@
-module IRB
- class << (MagicFile = Object.new)
- # see parser_magic_comment in parse.y
- ENCODING_SPEC_RE = %r"coding\s*[=:]\s*([[:alnum:]\-_]+)"
-
- def open(path)
- io = File.open(path, 'rb')
- line = io.gets
- line = io.gets if line[0,2] == "#!"
- encoding = detect_encoding(line)
- encoding ||= default_src_encoding
- io.rewind
- io.set_encoding(encoding, nil)
-
- if block_given?
- begin
- return (yield io)
- ensure
- io.close
- end
- else
- return io
- end
- end
-
- private
- def detect_encoding(line)
- return unless line[0] == ?#
- line = line[1..-1]
- line = $1 if line[/-\*-\s*(.*?)\s*-*-$/]
- return nil unless ENCODING_SPEC_RE =~ line
- encoding = $1
- return encoding.sub(/-(?:mac|dos|unix)/i, '')
- end
- end
-end
diff --git a/lib/irb/notifier.rb b/lib/irb/notifier.rb
index fdfcdd2dbc..0f79bc5a8d 100644
--- a/lib/irb/notifier.rb
+++ b/lib/irb/notifier.rb
@@ -1,12 +1,13 @@
#
-# notifier.rb - output methods used by irb
-# $Release Version: 0.9.6$
+# notifier.rb - output methods used by irb
+# $Release Version: 0.9.5$
# $Revision$
+# $Date$
# by Keiju ISHITSUKA(keiju@ruby-lang.org)
#
# --
#
-#
+#
#
require "e2mmap"
@@ -15,16 +16,16 @@ require "irb/output-method"
module IRB
module Notifier
extend Exception2MessageMapper
- def_exception :ErrUndefinedNotifier,
+ def_exception :ErrUndefinedNotifier,
"undefined notifier level: %d is specified"
- def_exception :ErrUnrecognizedLevel,
+ def_exception :ErrUnrecognizedLevel,
"unrecognized notifier level: %s is specified"
def def_notifier(prefix = "", output_method = StdioOutputMethod.new)
CompositeNotifier.new(prefix, output_method)
end
module_function :def_notifier
-
+
class AbstructNotifier
def initialize(prefix, base_notifier)
@prefix = prefix
@@ -112,7 +113,7 @@ module IRB
def initialize(base, level, prefix)
super(prefix, base)
-
+
@level = level
end
@@ -121,7 +122,7 @@ module IRB
def <=>(other)
@level <=> other.level
end
-
+
def notify?
@base_notifier.level >= self
end
diff --git a/lib/irb/output-method.rb b/lib/irb/output-method.rb
index 4201523a45..b9a3a8851e 100644
--- a/lib/irb/output-method.rb
+++ b/lib/irb/output-method.rb
@@ -1,12 +1,13 @@
#
-# output-method.rb - optput methods used by irb
-# $Release Version: 0.9.6$
+# output-method.rb - optput methods used by irb
+# $Release Version: 0.9.5$
# $Revision$
+# $Date$
# by Keiju ISHITSUKA(keiju@ruby-lang.org)
#
# --
#
-#
+#
#
require "e2mmap"
@@ -35,15 +36,30 @@ module IRB
end
# %
- # <flag> [#0- +]
- # <minimum field width> (\*|\*[1-9][0-9]*\$|[1-9][0-9]*)
- # <precision>.(\*|\*[1-9][0-9]*\$|[1-9][0-9]*|)?
- # #<length modifier>(hh|h|l|ll|L|q|j|z|t)
- # <conversion specifier>[diouxXeEfgGcsb%]
+ # <ե饰> [#0- +]
+ # <Ǿե> (\*|\*[1-9][0-9]*\$|[1-9][0-9]*)
+ # <>.(\*|\*[1-9][0-9]*\$|[1-9][0-9]*|)?
+ # #<Ĺʸ>(hh|h|l|ll|L|q|j|z|t)
+ # <Ѵʸ>[diouxXeEfgGcsb%]
def parse_printf_format(format, opts)
return format, opts if $1.size % 2 == 1
end
+ def foo(format)
+ pos = 0
+ inspects = []
+ format.scan(/%[#0\-+ ]?(\*(?=[^0-9])|\*[1-9][0-9]*\$|[1-9][0-9]*(?=[^0-9]))?(\.(\*(?=[^0-9])|\*[1-9][0-9]*\$|[1-9][0-9]*(?=[^0-9])))?(([1-9][0-9]*\$)*)([diouxXeEfgGcsb%])/) {|f, p, pp, pos, new_pos, c|
+ puts [f, p, pp, pos, new_pos, c].join("!")
+ pos = new_pos if new_pos
+ if c == "I"
+ inspects.push pos.to_i
+ (f||"")+(p||"")+(pp||"")+(pos||"")+"s"
+ else
+ $&
+ end
+ }
+ end
+
def puts(*objs)
for obj in objs
print(*obj)
diff --git a/lib/irb/ruby-lex.rb b/lib/irb/ruby-lex.rb
index b36629b38e..313a809ccd 100644
--- a/lib/irb/ruby-lex.rb
+++ b/lib/irb/ruby-lex.rb
@@ -1,12 +1,13 @@
#
# irb/ruby-lex.rb - ruby lexcal analyzer
-# $Release Version: 0.9.6$
+# $Release Version: 0.9.5$
# $Revision$
+# $Date$
# by Keiju ISHITSUKA(keiju@ruby-lang.org)
#
# --
#
-#
+#
#
require "e2mmap"
@@ -20,12 +21,12 @@ class RubyLex
def_exception(:AlreadyDefinedToken, "Already defined token(%s)")
def_exception(:TkReading2TokenNoKey, "key nothing(key='%s')")
def_exception(:TkSymbol2TokenNoKey, "key nothing(key='%s')")
- def_exception(:TkReading2TokenDuplicateError,
+ def_exception(:TkReading2TokenDuplicateError,
"key duplicate(token_n='%s', key='%s')")
def_exception(:SyntaxError, "%s")
def_exception(:TerminateLineInput, "Terminate Line Input")
-
+
include RubyToken
class << self
@@ -53,7 +54,7 @@ class RubyLex
@lex_state = EXPR_BEG
@space_seen = false
@here_header = false
-
+
@continue = false
@line = ""
@@ -91,7 +92,7 @@ class RubyLex
else
@base_char_no += @readed.size
end
-
+
readed = @readed.join("")
@readed = []
readed
@@ -103,7 +104,6 @@ class RubyLex
@rests.push nil unless buf_input
end
c = @rests.shift
- return if c == nil
if @here_header
@here_readed.push c
else
@@ -111,7 +111,7 @@ class RubyLex
end
@seek += 1
if c == "\n"
- @line_no += 1
+ @line_no += 1
@char_no = 0
else
@char_no += 1
@@ -148,10 +148,10 @@ class RubyLex
c2 = @here_readed.pop
end
c = c2 unless c
- @rests.unshift c #c =
+ @rests.unshift c #c =
@seek -= 1
if c == "\n"
- @line_no -= 1
+ @line_no -= 1
if idx = @readed.reverse.index("\n")
@char_no = @readed.size - idx
else
@@ -188,7 +188,7 @@ class RubyLex
prompt
line = @input.call
return nil unless line
- @rests.concat line.chars.to_a
+ @rests.concat line.split(//)
true
end
private :buf_input
@@ -216,14 +216,14 @@ class RubyLex
@lex_state = EXPR_BEG
@space_seen = false
@here_header = false
-
+
@continue = false
prompt
@line = ""
@exp_line_no = @line_no
end
-
+
def each_top_level_statement
initialize_input
catch(:TERM_INPUT) do
@@ -234,13 +234,13 @@ class RubyLex
unless l = lex
throw :TERM_INPUT if @line == ''
else
+ #p l
@line.concat l
if @ltype or @continue or @indent > 0
next
end
end
if @line != "\n"
- @line.force_encoding(@io.encoding)
yield @line, @exp_line_no
end
break unless l
@@ -297,7 +297,7 @@ class RubyLex
# Tracer.off
tk
end
-
+
ENINDENT_CLAUSE = [
"case", "class", "def", "do", "for", "if",
"module", "unless", "until", "while", "begin" #, "when"
@@ -314,7 +314,7 @@ class RubyLex
"W" => "]",
"s" => ":"
}
-
+
PERCENT_PAREN = {
"{" => "}",
"[" => "]",
@@ -354,7 +354,7 @@ class RubyLex
end
@OP.def_rule("=begin",
- proc{|op, io| @prev_char_no == 0 && peek(0) =~ /\s/}) do
+ proc{|op, io| @prev_char_no == 0 && peek(0) =~ /\s/}) do
|op, io|
@ltype = "="
until getc == "\n"; end
@@ -374,8 +374,8 @@ class RubyLex
else
@continue = false
@lex_state = EXPR_BEG
- until (@indent_stack.empty? ||
- [TkLPAREN, TkLBRACK, TkLBRACE,
+ until (@indent_stack.empty? ||
+ [TkLPAREN, TkLBRACK, TkLBRACE,
TkfLPAREN, TkfLBRACK, TkfLBRACE].include?(@indent_stack.last))
@indent_stack.pop
end
@@ -385,12 +385,11 @@ class RubyLex
Token(TkNL)
end
- @OP.def_rules("*", "**",
- "=", "==", "===",
- "=~", "<=>",
+ @OP.def_rules("*", "**",
+ "=", "==", "===",
+ "=~", "<=>",
"<", "<=",
- ">", ">=", ">>",
- "!", "!=", "!~") do
+ ">", ">=", ">>") do
|op, io|
case @lex_state
when EXPR_FNAME, EXPR_DOT
@@ -401,6 +400,12 @@ class RubyLex
Token(op)
end
+ @OP.def_rules("!", "!=", "!~") do
+ |op, io|
+ @lex_state = EXPR_BEG
+ Token(op)
+ end
+
@OP.def_rules("<<") do
|op, io|
tk = nil
@@ -450,7 +455,7 @@ class RubyLex
@lex_state = EXPR_BEG;
Token(TkQUESTION)
else
- if (ch == '\\')
+ if (ch == '\\')
read_escape
end
@lex_state = EXPR_END
@@ -464,8 +469,8 @@ class RubyLex
@lex_state = EXPR_BEG
Token(op)
end
-
- @OP.def_rules("+=", "-=", "*=", "**=",
+
+ @OP.def_rules("+=", "-=", "*=", "**=",
"&=", "|=", "^=", "<<=", ">>=", "||=", "&&=") do
|op, io|
@lex_state = EXPR_BEG
@@ -524,7 +529,7 @@ class RubyLex
lex_int2
end
-
+
def lex_int2
@OP.def_rules("]", "}", ")") do
|op, io|
@@ -567,7 +572,7 @@ class RubyLex
Token(TkOPASGN, "/") #/)
elsif @lex_state == EXPR_ARG and @space_seen and peek(0) !~ /\s/
identify_string(op)
- else
+ else
@lex_state = EXPR_BEG
Token("/") #/)
end
@@ -583,7 +588,7 @@ class RubyLex
# @lex_state = EXPR_BEG
# Token(OP_ASGN, :^)
# end
-
+
@OP.def_rules(",") do
|op, io|
@lex_state = EXPR_BEG
@@ -593,8 +598,8 @@ class RubyLex
@OP.def_rules(";") do
|op, io|
@lex_state = EXPR_BEG
- until (@indent_stack.empty? ||
- [TkLPAREN, TkLBRACK, TkLBRACE,
+ until (@indent_stack.empty? ||
+ [TkLPAREN, TkLBRACK, TkLBRACE,
TkfLPAREN, TkfLBRACK, TkfLBRACE].include?(@indent_stack.last))
@indent_stack.pop
end
@@ -612,7 +617,7 @@ class RubyLex
@lex_state = EXPR_BEG
Token("~")
end
-
+
@OP.def_rule("(") do
|op, io|
@indent += 1
@@ -713,7 +718,7 @@ class RubyLex
end
end
- # @OP.def_rule("def", proc{|op, io| /\s/ =~ io.peek(0)}) do
+ # @OP.def_rule("def", proc{|op, io| /\s/ =~ io.peek(0)}) do
# |op, io|
# @indent += 1
# @lex_state = EXPR_FNAME
@@ -734,13 +739,13 @@ class RubyLex
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)
@@ -756,12 +761,12 @@ class RubyLex
ungetc
ungetc
identify_identifier
- else
+ else
ungetc
Token("$")
end
end
-
+
def identify_identifier
token = ""
if peek(0) =~ /[$@]/
@@ -776,7 +781,7 @@ class RubyLex
token.concat ch
end
ungetc
-
+
if (ch == "!" || ch == "?") && token[0,1] =~ /\w/ && peek(0) != "="
token.concat getc
end
@@ -794,7 +799,7 @@ class RubyLex
@lex_state = EXPR_END
return Token(TkIVAR, token)
end
-
+
if @lex_state != EXPR_DOT
print token, "\n" if RubyLex.debug?
@@ -817,11 +822,11 @@ class RubyLex
when "class"
valid = false unless peek_match?(/^\s*(<<|\w|::)/)
when "def"
- valid = false if peek_match?(/^\s*(([+\-\/*&\|^]|<<|>>|\|\||\&\&)=|\&\&|\|\|)/)
+ valid = false if peek_match?(/^\s*(([+-\/*&\|^]|<<|>>|\|\||\&\&)=|\&\&|\|\|)/)
when "do"
- valid = false if peek_match?(/^\s*([+\-\/*]?=|\*|<|>|\&)/)
+ valid = false if peek_match?(/^\s*([+-\/*]?=|\*|<|>|\&)/)
when *ENINDENT_CLAUSE
- valid = false if peek_match?(/^\s*([+\-\/*]?=|\*|<|>|\&|\|)/)
+ valid = false if peek_match?(/^\s*([+-\/*]?=|\*|<|>|\&|\|)/)
else
# no nothing
end
@@ -922,7 +927,7 @@ class RubyLex
@lex_state = EXPR_END
Token(Ltype2Token[lt])
end
-
+
def identify_quotation
ch = getc
if lt = PERCENT_LTYPE[ch]
@@ -962,11 +967,11 @@ class RubyLex
when /[0-7]/
match = /[0-7_]/
when /[89]/
- RubyLex.fail SyntaxError, "Invalid octal digit"
- else
+ RubyLex.fail SyntaxError, "Illegal octal digit"
+ else
return Token(TkINTEGER)
end
-
+
len0 = true
non_digit = false
while ch = getc
@@ -994,7 +999,7 @@ class RubyLex
end
return Token(TkINTEGER)
end
-
+
type = TkINTEGER
allow_point = true
allow_e = true
@@ -1037,7 +1042,7 @@ class RubyLex
end
Token(type)
end
-
+
def identify_string(ltype, quoted = ltype)
@ltype = ltype
@quoted = quoted
@@ -1049,16 +1054,10 @@ class RubyLex
break
elsif @ltype != "'" && @ltype != "]" && @ltype != ":" and ch == "#"
subtype = true
- elsif ch == '\\' and @ltype == "'" #'
- case ch = getc
- when "\\", "\n", "'"
- else
- ungetc
- end
elsif ch == '\\' #'
read_escape
end
- if PERCENT_PAREN.values.include?(@quoted)
+ if PERCENT_PAREN.values.include?(@quoted)
if PERCENT_PAREN[ch] == @quoted
nest += 1
elsif ch == @quoted
@@ -1082,7 +1081,7 @@ class RubyLex
@lex_state = EXPR_END
end
end
-
+
def identify_comment
@ltype = "#"
@@ -1098,7 +1097,7 @@ class RubyLex
end
return Token(TkCOMMENT)
end
-
+
def read_escape
case ch = getc
when "\n", "\r", "\f"
@@ -1115,7 +1114,7 @@ class RubyLex
break
end
end
-
+
when "x"
2.times do
case ch = getc
@@ -1144,7 +1143,7 @@ class RubyLex
read_escape
end
else
- # other characters
+ # other characters
end
end
end
diff --git a/lib/irb/ruby-token.rb b/lib/irb/ruby-token.rb
index 9b06eab21b..525d4df14c 100644
--- a/lib/irb/ruby-token.rb
+++ b/lib/irb/ruby-token.rb
@@ -1,12 +1,13 @@
#
-# irb/ruby-token.rb - ruby tokens
-# $Release Version: 0.9.6$
+# irb/ruby-token.rb - ruby tokens
+# $Release Version: 0.9.5$
# $Revision$
+# $Date$
# by Keiju ISHITSUKA(keiju@ruby-lang.org)
#
# --
#
-#
+#
#
module RubyToken
EXPR_BEG = :EXPR_BEG
@@ -21,14 +22,16 @@ module RubyToken
if !defined?(Symbol)
Symbol = Integer
end
-
+
class Token
def initialize(seek, line_no, char_no)
@seek = seek
@line_no = line_no
@char_no = char_no
end
- attr :seek, :line_no, :char_no
+ attr :seek
+ attr :line_no
+ attr :char_no
end
class TkNode < Token
@@ -55,7 +58,7 @@ module RubyToken
end
class TkOp < Token
- attr_accessor :name
+ attr :name, true
end
class TkOPASGN < TkOp
@@ -84,7 +87,7 @@ module RubyToken
if (tk = TkReading2Token[token]).nil?
IRB.fail TkReading2TokenNoKey, token
end
- tk = Token(tk[0], value)
+ tk = Token(tk[0], value)
if tk.kind_of?(TkOp)
tk.name = token
end
@@ -93,8 +96,8 @@ module RubyToken
if (tk = TkSymbol2Token[token]).nil?
IRB.fail TkSymbol2TokenNoKey, token
end
- return Token(tk[0], value)
- else
+ 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
@@ -194,7 +197,7 @@ module RubyToken
[:TkASSOC, TkOp, "=>"],
[:TkQUESTION, TkOp, "?"], #?
[:TkCOLON, TkOp, ":"], #:
-
+
[:TkfLPAREN], # func( #
[:TkfLBRACK], # func[ #
[:TkfLBRACE], # func{ #
@@ -250,7 +253,7 @@ module RubyToken
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
diff --git a/lib/irb/slex.rb b/lib/irb/slex.rb
index fac62bfd93..f7e3a3b2b2 100644
--- a/lib/irb/slex.rb
+++ b/lib/irb/slex.rb
@@ -1,12 +1,13 @@
#
# irb/slex.rb - simple lex analyzer
-# $Release Version: 0.9.6$
+# $Release Version: 0.9.5$
# $Revision$
+# $Date$
# by Keiju ISHITSUKA(keiju@ruby-lang.org)
#
# --
#
-#
+#
#
require "e2mmap"
@@ -24,20 +25,20 @@ module IRB
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?
node = create(token, preproc, postproc)
end
-
+
def def_rules(*tokens, &block)
if block_given?
p = block
@@ -46,18 +47,18 @@ module IRB
def_rule(token, nil, p)
end
end
-
+
def preproc(token, proc)
node = search(token)
node.preproc=proc
end
-
- #$BMW%A%'%C%/(B?
+
+ #$BMW%A%'%C%/(B?
def postproc(token)
node = search(token, proc)
node.postproc=proc
end
-
+
def search(token)
@head.search(token.split(//))
end
@@ -65,7 +66,7 @@ module IRB
def create(token, preproc = nil, postproc = nil)
@head.create_subnode(token.split(//), preproc, postproc)
end
-
+
def match(token)
case token
when Array
@@ -78,14 +79,14 @@ module IRB
D_DETAIL.exec_if{D_DEATIL.printf "match end: %s:%s\n", ret, token.inspect}
ret
end
-
+
def inspect
format("<SLex: @head = %s>", @head.inspect)
end
#----------------------------------------------------------------------
#
- # class Node -
+ # class Node -
#
#----------------------------------------------------------------------
class Node
@@ -99,7 +100,7 @@ module IRB
attr_accessor :preproc
attr_accessor :postproc
-
+
def search(chrs, opt = nil)
return self if chrs.empty?
ch = chrs.shift
@@ -114,7 +115,7 @@ module IRB
end
end
end
-
+
def create_subnode(chrs, preproc = nil, postproc = nil)
if chrs.empty?
if @postproc
@@ -127,7 +128,7 @@ module IRB
end
return self
end
-
+
ch = chrs.shift
if node = @Tree[ch]
if chrs.empty?
@@ -161,7 +162,7 @@ module IRB
# chrs: String
# character array
# io must have getc()/ungetc(); and ungetc() must be
- # able to be called arbitrary number of times.
+ # able to be called arbitrary number of times.
#
def match(chrs, op = "")
D_DETAIL.print "match>: ", chrs, "op:", op, "\n"
@@ -244,6 +245,8 @@ module IRB
end
end
+SLex=IRB::SLex
+
if $0 == __FILE__
# Tracer.on
case $1
@@ -254,14 +257,14 @@ if $0 == __FILE__
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"
@@ -269,7 +272,7 @@ if $0 == __FILE__
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"
diff --git a/lib/irb/src_encoding.rb b/lib/irb/src_encoding.rb
deleted file mode 100644
index 958cef104c..0000000000
--- a/lib/irb/src_encoding.rb
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT WRITE ANY MAGIC COMMENT HERE.
-def default_src_encoding
- return __ENCODING__
-end
diff --git a/lib/irb/version.rb b/lib/irb/version.rb
index 621a127ebd..28b079740a 100644
--- a/lib/irb/version.rb
+++ b/lib/irb/version.rb
@@ -1,15 +1,16 @@
#
# irb/version.rb - irb version definition file
-# $Release Version: 0.9.6$
+# $Release Version: 0.9.5$
# $Revision$
+# $Date$
# by Keiju ISHITSUKA(keiju@ishitsuka.com)
#
# --
#
-#
+#
#
module IRB
- @RELEASE_VERSION = "0.9.6"
- @LAST_UPDATE_DATE = "09/06/30"
+ @RELEASE_VERSION = "0.9.5"
+ @LAST_UPDATE_DATE = "05/04/13"
end
diff --git a/lib/irb/workspace.rb b/lib/irb/workspace.rb
index 991df2e652..7d1794cd7b 100644
--- a/lib/irb/workspace.rb
+++ b/lib/irb/workspace.rb
@@ -1,12 +1,13 @@
#
-# irb/workspace-binding.rb -
-# $Release Version: 0.9.6$
+# irb/workspace-binding.rb -
+# $Release Version: 0.9.5$
# $Revision$
+# $Date$
# by Keiju ISHITSUKA(keiju@ruby-lang.org)
#
# --
#
-#
+#
#
module IRB
class WorkSpace
@@ -21,7 +22,7 @@ module IRB
case IRB.conf[:CONTEXT_MODE]
when 0 # binding in proc on TOPLEVEL_BINDING
@binding = eval("proc{binding}.call",
- TOPLEVEL_BINDING,
+ TOPLEVEL_BINDING,
__FILE__,
__LINE__)
when 1 # binding in loaded file
@@ -37,7 +38,7 @@ EOF
when 2 # binding in loaded file(thread use)
unless defined? BINDING_QUEUE
require "thread"
-
+
IRB.const_set("BINDING_QUEUE", SizedQueue.new(1))
Thread.abort_on_exception = true
Thread.start do
@@ -49,7 +50,7 @@ EOF
when 3 # binging in function on TOPLEVEL_BINDING(default)
@binding = eval("def irb_binding; binding; end; irb_binding",
- TOPLEVEL_BINDING,
+ TOPLEVEL_BINDING,
__FILE__,
__LINE__ - 3)
end
@@ -63,7 +64,7 @@ EOF
when Module
@binding = eval("IRB.conf[:__MAIN__].module_eval('binding', __FILE__, __LINE__)", @binding, __FILE__, __LINE__)
else
- begin
+ begin
@binding = eval("IRB.conf[:__MAIN__].instance_eval('binding', __FILE__, __LINE__)", @binding, __FILE__, __LINE__)
rescue TypeError
IRB.fail CantChangeBinding, @main.inspect
@@ -79,7 +80,7 @@ EOF
def evaluate(context, statements, file = __FILE__, line = __LINE__)
eval(statements, @binding, file, line)
end
-
+
# error message manipulator
def filter_backtrace(bt)
case IRB.conf[:CONTEXT_MODE]
@@ -93,11 +94,9 @@ EOF
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.sub!(/:\s*in `irb_binding'/, '')
+ bt.sub!(/:\s*in `irb_binding'/){""}
end
bt
end
diff --git a/lib/irb/ws-for-case-2.rb b/lib/irb/ws-for-case-2.rb
index bb3932ad62..afd49d23e1 100644
--- a/lib/irb/ws-for-case-2.rb
+++ b/lib/irb/ws-for-case-2.rb
@@ -1,12 +1,13 @@
#
-# irb/ws-for-case-2.rb -
-# $Release Version: 0.9.6$
+# irb/ws-for-case-2.rb -
+# $Release Version: 0.9.5$
# $Revision$
+# $Date$
# by Keiju ISHITSUKA(keiju@ruby-lang.org)
#
# --
#
-#
+#
#
while true
diff --git a/lib/irb/xmp.rb b/lib/irb/xmp.rb
index 1a58026f45..4bcc2ca22f 100644
--- a/lib/irb/xmp.rb
+++ b/lib/irb/xmp.rb
@@ -2,11 +2,12 @@
# xmp.rb - irb version of gotoken xmp
# $Release Version: 0.9$
# $Revision$
+# $Date$
# by Keiju ISHITSUKA(Nippon Rational Inc.)
#
# --
#
-#
+#
#
require "irb"
@@ -72,20 +73,8 @@ class XMP
end
def puts(exps)
- if @encoding and exps.encoding != @encoding
- enc = Encoding.compatible?(@exps.join("\n"), exps)
- if enc.nil?
- raise Encoding::CompatibilityError, "Encoding in which the passed exression is encoded is not compatible to the preceding's one"
- else
- @encoding = enc
- end
- else
- @encoding = exps.encoding
- end
@exps.concat exps.split(/\n/)
end
-
- attr_reader :encoding
end
end
diff --git a/lib/jcode.rb b/lib/jcode.rb
new file mode 100644
index 0000000000..78422f296f
--- /dev/null
+++ b/lib/jcode.rb
@@ -0,0 +1,220 @@
+# jcode.rb - ruby code to handle japanese (EUC/SJIS) string
+
+if $VERBOSE && $KCODE == "NONE"
+ warn "Warning: $KCODE is NONE."
+end
+
+$vsave, $VERBOSE = $VERBOSE, false
+class String
+ warn "feel free for some warnings:\n" if $VERBOSE
+
+ def _regex_quote(str)
+ str.gsub(/(\\[\[\]\-\\])|\\(.)|([\[\]\\])/) do
+ $1 || $2 || '\\' + $3
+ end
+ end
+ private :_regex_quote
+
+ PATTERN_SJIS = '[\x81-\x9f\xe0-\xef][\x40-\x7e\x80-\xfc]'
+ PATTERN_EUC = '[\xa1-\xfe][\xa1-\xfe]'
+ PATTERN_UTF8 = '[\xc0-\xdf][\x80-\xbf]|[\xe0-\xef][\x80-\xbf][\x80-\xbf]'
+
+ RE_SJIS = Regexp.new(PATTERN_SJIS, 0, 'n')
+ RE_EUC = Regexp.new(PATTERN_EUC, 0, 'n')
+ RE_UTF8 = Regexp.new(PATTERN_UTF8, 0, 'n')
+
+ SUCC = {}
+ SUCC['s'] = Hash.new(1)
+ for i in 0 .. 0x3f
+ SUCC['s'][i.chr] = 0x40 - i
+ end
+ SUCC['s']["\x7e"] = 0x80 - 0x7e
+ SUCC['s']["\xfd"] = 0x100 - 0xfd
+ SUCC['s']["\xfe"] = 0x100 - 0xfe
+ SUCC['s']["\xff"] = 0x100 - 0xff
+ SUCC['e'] = Hash.new(1)
+ for i in 0 .. 0xa0
+ SUCC['e'][i.chr] = 0xa1 - i
+ end
+ SUCC['e']["\xfe"] = 2
+ SUCC['u'] = Hash.new(1)
+ for i in 0 .. 0x7f
+ SUCC['u'][i.chr] = 0x80 - i
+ end
+ SUCC['u']["\xbf"] = 0x100 - 0xbf
+
+ def mbchar?
+ case $KCODE[0]
+ when ?s, ?S
+ self =~ RE_SJIS
+ when ?e, ?E
+ self =~ RE_EUC
+ when ?u, ?U
+ self =~ RE_UTF8
+ else
+ nil
+ end
+ end
+
+ def end_regexp
+ case $KCODE[0]
+ when ?s, ?S
+ /#{PATTERN_SJIS}$/on
+ when ?e, ?E
+ /#{PATTERN_EUC}$/on
+ when ?u, ?U
+ /#{PATTERN_UTF8}$/on
+ else
+ /.$/on
+ end
+ end
+
+ alias original_succ! succ!
+ private :original_succ!
+
+ alias original_succ succ
+ private :original_succ
+
+ def succ!
+ reg = end_regexp
+ if $KCODE != 'NONE' && self =~ reg
+ succ_table = SUCC[$KCODE[0,1].downcase]
+ begin
+ self[-1] += succ_table[self[-1]]
+ self[-2] += 1 if self[-1] == 0
+ end while self !~ reg
+ self
+ else
+ original_succ!
+ end
+ end
+
+ def succ
+ str = self.dup
+ str.succ! or str
+ end
+
+ private
+
+ def _expand_ch str
+ a = []
+ str.scan(/(?:\\(.)|([^\\]))-(?:\\(.)|([^\\]))|(?:\\(.)|(.))/m) do
+ from = $1 || $2
+ to = $3 || $4
+ one = $5 || $6
+ if one
+ a.push one
+ elsif from.length != to.length
+ next
+ elsif from.length == 1
+ from[0].upto(to[0]) { |c| a.push c.chr }
+ else
+ from.upto(to) { |c| a.push c }
+ end
+ end
+ a
+ end
+
+ def expand_ch_hash from, to
+ h = {}
+ afrom = _expand_ch(from)
+ ato = _expand_ch(to)
+ afrom.each_with_index do |x,i| h[x] = ato[i] || ato[-1] end
+ h
+ end
+
+ HashCache = {}
+ TrPatternCache = {}
+ DeletePatternCache = {}
+ SqueezePatternCache = {}
+
+ public
+
+ def tr!(from, to)
+ return nil if from == ""
+ return self.delete!(from) if to == ""
+
+ pattern = TrPatternCache[from] ||= /[#{_regex_quote(from)}]/
+ if from[0] == ?^
+ last = /.$/.match(to)[0]
+ self.gsub!(pattern, last)
+ else
+ h = HashCache[from + "1-0" + to] ||= expand_ch_hash(from, to)
+ self.gsub!(pattern) do |c| h[c] end
+ end
+ end
+
+ def tr(from, to)
+ (str = self.dup).tr!(from, to) or str
+ end
+
+ def delete!(del)
+ return nil if del == ""
+ self.gsub!(DeletePatternCache[del] ||= /[#{_regex_quote(del)}]+/, '')
+ end
+
+ def delete(del)
+ (str = self.dup).delete!(del) or str
+ end
+
+ def squeeze!(del=nil)
+ return nil if del == ""
+ pattern =
+ if del
+ SqueezePatternCache[del] ||= /([#{_regex_quote(del)}])\1+/
+ else
+ /(.|\n)\1+/
+ end
+ self.gsub!(pattern, '\1')
+ end
+
+ def squeeze(del=nil)
+ (str = self.dup).squeeze!(del) or str
+ end
+
+ def tr_s!(from, to)
+ return self.delete!(from) if to.length == 0
+
+ pattern = SqueezePatternCache[from] ||= /([#{_regex_quote(from)}])\1*/
+ if from[0] == ?^
+ last = /.$/.match(to)[0]
+ self.gsub!(pattern, last)
+ else
+ h = HashCache[from + "1-0" + to] ||= expand_ch_hash(from, to)
+ self.gsub!(pattern) do h[$1] end
+ end
+ end
+
+ def tr_s(from, to)
+ (str = self.dup).tr_s!(from,to) or str
+ end
+
+ def chop!
+ self.gsub!(/(?:.|\r?\n)\z/, '')
+ end
+
+ def chop
+ (str = self.dup).chop! or str
+ end
+
+ def jlength
+ self.gsub(/[^\Wa-zA-Z_\d]/, ' ').length
+ end
+ alias jsize jlength
+
+ def jcount(str)
+ self.delete("^#{str}").jlength
+ end
+
+ def each_char
+ if block_given?
+ scan(/./m) do |x|
+ yield x
+ end
+ else
+ scan(/./m)
+ end
+ end
+
+end
+$VERBOSE = $vsave
diff --git a/lib/logger.rb b/lib/logger.rb
index 07699e7017..15d95fcb10 100644
--- a/lib/logger.rb
+++ b/lib/logger.rb
@@ -3,8 +3,6 @@
require 'monitor'
-# = logger.rb
-#
# Simple logging utility.
#
# Author:: NAKAMURA, Hiroshi <nakahiro@sarion.co.jp>
@@ -14,11 +12,6 @@ require 'monitor'
# license; either the dual license version in 2003, or any later version.
# Revision:: $Id$
#
-# See Logger for documentation.
-#
-
-
-#
# == Description
#
# The Logger class provides a simple but sophisticated logging utility that
@@ -150,14 +143,14 @@ require 'monitor'
# 2. Log4r (somewhat) compatible interface.
#
# logger.level = Logger::INFO
-#
+#
# DEBUG < INFO < WARN < ERROR < FATAL < UNKNOWN
#
#
# == Format
#
-# Log messages are rendered in the output stream in a certain format by
-# default. The default format and a sample are shown below:
+# Log messages are rendered in the output stream in a certain format. The
+# default format and a sample are shown below:
#
# Log format:
# SeverityID, [Date Time mSec #pid] SeverityLabel -- ProgName: message
@@ -170,25 +163,15 @@ require 'monitor'
# logger.datetime_format = "%Y-%m-%d %H:%M:%S"
# # e.g. "2004-01-03 00:54:26"
#
-# You may change the overall format with Logger#formatter= method.
-#
-# logger.formatter = proc { |severity, datetime, progname, msg|
-# "#{datetime}: #{msg}\n"
-# }
-# # e.g. "Thu Sep 22 08:51:08 GMT+9:00 2005: hello world"
+# There is currently no supported way to change the overall format, but you may
+# have some luck hacking the Format constant.
#
class Logger
VERSION = "1.2.6"
id, name, rev = %w$Id$
- if name
- name = name.chomp(",v")
- else
- name = File.basename(__FILE__)
- end
- rev ||= "v#{VERSION}"
- ProgName = "#{name}/#{rev}"
+ ProgName = "#{name.chomp(",v")}/#{rev}"
class Error < RuntimeError; end
class ShiftingError < Error; end
@@ -642,8 +625,8 @@ private
class Application
include Logger::Severity
- # Name of the application given at initialize.
attr_reader :appname
+ attr_reader :logdev
#
# == Synopsis
@@ -682,21 +665,9 @@ private
status
end
- # Logger for this application. See the class Logger for an explanation.
- def logger
- @log
- end
-
- #
- # Sets the logger for this application. See the class Logger for an explanation.
- #
- def logger=(logger)
- @log = logger
- end
-
#
- # Sets the log device for this application. See <tt>Logger.new</tt> for an explanation
- # of the arguments.
+ # Sets the log device for this application. See the class Logger for an
+ # explanation of the arguments.
#
def set_log(logdev, shift_age = 0, shift_size = 1024000)
@log = Logger.new(logdev, shift_age, shift_size)
diff --git a/lib/mailread.rb b/lib/mailread.rb
new file mode 100644
index 0000000000..08b33c92a4
--- /dev/null
+++ b/lib/mailread.rb
@@ -0,0 +1,62 @@
+# The Mail class represents an internet mail message (as per RFC822, RFC2822)
+# with headers and a body.
+class Mail
+
+ # Create a new Mail where +f+ is either a stream which responds to gets(),
+ # or a path to a file. If +f+ is a path it will be opened.
+ #
+ # The whole message is read so it can be made available through the #header,
+ # #[] and #body methods.
+ #
+ # The "From " line is ignored if the mail is in mbox format.
+ def initialize(f)
+ unless defined? f.gets
+ f = open(f, "r")
+ opened = true
+ end
+
+ @header = {}
+ @body = []
+ begin
+ while line = f.gets()
+ line.chop!
+ next if /^From /=~line # skip From-line
+ break if /^$/=~line # end of header
+
+ if /^(\S+?):\s*(.*)/=~line
+ (attr = $1).capitalize!
+ @header[attr] = $2
+ elsif attr
+ line.sub!(/^\s*/, '')
+ @header[attr] += "\n" + line
+ end
+ end
+
+ return unless line
+
+ while line = f.gets()
+ break if /^From /=~line
+ @body.push(line)
+ end
+ ensure
+ f.close if opened
+ end
+ end
+
+ # Return the headers as a Hash.
+ def header
+ return @header
+ end
+
+ # Return the message body as an Array of lines
+ def body
+ return @body
+ end
+
+ # Return the header corresponding to +field+.
+ #
+ # Matching is case-insensitive.
+ def [](field)
+ @header[field.capitalize]
+ end
+end
diff --git a/lib/mathn.rb b/lib/mathn.rb
index 57eac113c7..a5a121c6c6 100644
--- a/lib/mathn.rb
+++ b/lib/mathn.rb
@@ -1,64 +1,133 @@
#
-# mathn.rb -
+# mathn.rb -
# $Release Version: 0.5 $
# $Revision: 1.1.1.1.4.1 $
+# $Date: 1998/01/16 12:36:05 $
# by Keiju ISHITSUKA(SHL Japan Inc.)
#
# --
#
-#
+#
#
-require "cmath.rb"
+require "complex.rb"
+require "rational.rb"
require "matrix.rb"
-require "prime.rb"
-require "mathn/rational"
-require "mathn/complex"
+class Integer
-unless defined?(Math.exp!)
- Object.instance_eval{remove_const :Math}
- Math = CMath
+ def gcd2(int)
+ a = self.abs
+ b = int.abs
+ a, b = b, a if a < b
+
+ pd_a = a.prime_division
+ pd_b = b.prime_division
+
+ gcd = 1
+ for pair in pd_a
+ as = pd_b.assoc(pair[0])
+ if as
+ gcd *= as[0] ** [as[1], pair[1]].min
+ end
+ end
+ return gcd
+ end
+
+ def Integer.from_prime_division(pd)
+ value = 1
+ for prime, index in pd
+ value *= prime**index
+ end
+ value
+ end
+
+ def prime_division
+ raise ZeroDivisionError if self == 0
+ ps = Prime.new
+ value = self
+ pv = []
+ for prime in ps
+ count = 0
+ while (value1, mod = value.divmod(prime)
+ mod) == 0
+ value = value1
+ count += 1
+ end
+ if count != 0
+ pv.push [prime, count]
+ end
+ break if prime * prime >= value
+ end
+ if value > 1
+ pv.push [value, 1]
+ end
+ return pv
+ end
end
+
+class Prime
+ include Enumerable
-class Fixnum
- remove_method :/
- alias / quo
-
- alias power! ** unless defined?(0.power!)
+ def initialize
+ @seed = 1
+ @primes = []
+ @counts = []
+ end
+
+ def succ
+ i = -1
+ size = @primes.size
+ while i < size
+ if i == -1
+ @seed += 1
+ i += 1
+ else
+ while @seed > @counts[i]
+ @counts[i] += @primes[i]
+ end
+ if @seed != @counts[i]
+ i += 1
+ else
+ i = -1
+ end
+ end
+ end
+ @primes.push @seed
+ @counts.push @seed + @seed
+ return @seed
+ end
+ alias next succ
- def ** (other)
- if self < 0 && other.round != other
- Complex(self, 0.0) ** other
- else
- power!(other)
+ def each
+ loop do
+ yield succ
end
end
+end
+class Fixnum
+ alias / quo
end
class Bignum
- remove_method :/
alias / quo
+end
- alias power! ** unless defined?(0.power!)
+class Rational
+ Unify = true
- def ** (other)
- if self < 0 && other.round != other
- Complex(self, 0.0) ** other
- else
- power!(other)
- end
+ def inspect
+ format "%s/%s", numerator.inspect, denominator.inspect
end
-end
+ alias power! **
-class Rational
def ** (other)
if other.kind_of?(Rational)
other2 = other
if self < 0
- return Complex(self, 0.0) ** other
+ return Complex.new!(self, 0) ** other
elsif other == 0
return Rational(1,1)
elsif self == 0
@@ -66,14 +135,14 @@ class Rational
elsif self == 1
return Rational(1,1)
end
-
+
npd = numerator.prime_division
dpd = denominator.prime_division
if other < 0
other = -other
npd, dpd = dpd, npd
end
-
+
for elm in npd
elm[1] = elm[1] * other
if !elm[1].kind_of?(Integer) and elm[1].denominator != 1
@@ -81,7 +150,7 @@ class Rational
end
elm[1] = elm[1].to_i
end
-
+
for elm in dpd
elm[1] = elm[1] * other
if !elm[1].kind_of?(Integer) and elm[1].denominator != 1
@@ -89,12 +158,56 @@ class Rational
end
elm[1] = elm[1].to_i
end
-
+
num = Integer.from_prime_division(npd)
den = Integer.from_prime_division(dpd)
-
+
Rational(num,den)
+
+ elsif other.kind_of?(Integer)
+ if other > 0
+ num = numerator ** other
+ den = denominator ** other
+ elsif other < 0
+ num = denominator ** -other
+ den = numerator ** -other
+ elsif other == 0
+ num = 1
+ den = 1
+ end
+ Rational.new!(num, den)
+ elsif other.kind_of?(Float)
+ Float(self) ** other
+ else
+ x , y = other.coerce(self)
+ x ** y
+ end
+ end
+ def power2(other)
+ if other.kind_of?(Rational)
+ if self < 0
+ return Complex(self, 0) ** other
+ elsif other == 0
+ return Rational(1,1)
+ elsif self == 0
+ return Rational(0,1)
+ elsif self == 1
+ return Rational(1,1)
+ end
+
+ dem = nil
+ x = self.denominator.to_f.to_i
+ neard = self.denominator.to_f ** (1.0/other.denominator.to_f)
+ loop do
+ if (neard**other.denominator == self.denominator)
+ dem = neaed
+ break
+ end
+ end
+ nearn = self.numerator.to_f ** (1.0/other.denominator.to_f)
+ Rational(num,den)
+
elsif other.kind_of?(Integer)
if other > 0
num = numerator ** other
@@ -106,7 +219,7 @@ class Rational
num = 1
den = 1
end
- Rational(num, den)
+ Rational.new!(num, den)
elsif other.kind_of?(Float)
Float(self) ** other
else
@@ -117,10 +230,9 @@ class Rational
end
module Math
- remove_method(:sqrt)
def sqrt(a)
if a.kind_of?(Complex)
- abs = sqrt(a.real*a.real + a.imag*a.imag)
+ abs = sqrt(a.real*a.real + a.image*a.image)
# if not abs.kind_of?(Rational)
# return a**Rational(1,2)
# end
@@ -129,20 +241,18 @@ module Math
# if !(x.kind_of?(Rational) and y.kind_of?(Rational))
# return a**Rational(1,2)
# end
- if a.imag >= 0
+ if a.image >= 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
-
+
def rsqrt(a)
if a.kind_of?(Float)
sqrt!(a)
@@ -156,7 +266,7 @@ module Math
while (src >= max) and (src >>= 32)
byte_a.unshift src & 0xffffffff
end
-
+
answer = 0
main = 0
side = 0
@@ -166,13 +276,13 @@ module Math
if answer != 0
if main * 4 < side * side
applo = main.div(side)
- else
+ 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
@@ -192,15 +302,7 @@ module Math
module_function :rsqrt
end
-class Float
- alias power! **
-
- def ** (other)
- if self < 0 && other.round != other
- Complex(self, 0.0) ** other
- else
- power!(other)
- end
- end
-
+class Complex
+ Unify = true
end
+
diff --git a/lib/matrix.rb b/lib/matrix.rb
index 5d350bb8f8..b1ee76f34b 100644
--- a/lib/matrix.rb
+++ b/lib/matrix.rb
@@ -1,7 +1,9 @@
+#!/usr/local/bin/ruby
#--
-# matrix.rb -
-# $Release Version: 1.0$
-# $Revision: 1.13 $
+# matrix.rb -
+# $Release Version: 1.0$
+# $Revision: 1.11 $
+# $Date: 1999/10/06 11:01:53 $
# Original Version from Smalltalk-80 version
# on July 23, 1985 at 8:37:17 am
# by Keiju ISHITSUKA
@@ -12,18 +14,19 @@
# An implementation of Matrix and Vector classes.
#
# Author:: Keiju ISHITSUKA
-# Documentation:: Gavin Sinclair (sourced from <i>Ruby in a Nutshell</i> (Matsumoto, O'Reilly))
+# Documentation:: Gavin Sinclair (sourced from <i>Ruby in a Nutshell</i> (Matsumoto, O'Reilly))
#
-# See classes Matrix and Vector for documentation.
+# See classes Matrix and Vector for documentation.
#
+
require "e2mmap.rb"
module ExceptionForMatrix # :nodoc:
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", "This operation(%s) can\\'t defined")
@@ -58,7 +61,7 @@ end
# * <tt> Matrix.row_vector(row) </tt>
# * <tt> Matrix.column_vector(column) </tt>
#
-# To access Matrix elements/columns/rows/submatrices/properties:
+# To access Matrix elements/columns/rows/submatrices/properties:
# * <tt> [](i, j) </tt>
# * <tt> #row_size </tt>
# * <tt> #column_size </tt>
@@ -102,14 +105,14 @@ end
# * <tt> #inspect </tt>
#
class Matrix
- @RCS_ID='-$Id: matrix.rb,v 1.13 2001/12/09 14:22:23 keiju Exp keiju $-'
-
+ @RCS_ID='-$Id: matrix.rb,v 1.11 1999/10/06 11:01:53 keiju Exp keiju $-'
+
# extend Exception2MessageMapper
include ExceptionForMatrix
-
+
# instance creations
private_class_method :new
-
+
#
# Creates a matrix where each argument is a row.
# Matrix[ [25, 93], [-1, 66] ]
@@ -119,7 +122,7 @@ class Matrix
def Matrix.[](*rows)
new(:init_rows, rows, false)
end
-
+
#
# Creates a matrix where +rows+ is an array of arrays, each of which is a row
# to the matrix. If the optional argument +copy+ is false, use the given
@@ -130,7 +133,7 @@ class Matrix
def Matrix.rows(rows, copy = true)
new(:init_rows, rows, copy)
end
-
+
#
# Creates a matrix using +columns+ as an array of column vectors.
# Matrix.columns([[25, 93], [-1, 66]])
@@ -139,14 +142,16 @@ class Matrix
#
#
def Matrix.columns(columns)
- rows = (0 .. columns[0].size - 1).collect {|i|
- (0 .. columns.size - 1).collect {|j|
+ rows = (0 .. columns[0].size - 1).collect {
+ |i|
+ (0 .. columns.size - 1).collect {
+ |j|
columns[j][i]
}
}
Matrix.rows(rows, false)
end
-
+
#
# Creates a matrix where the diagonal elements are composed of +values+.
# Matrix.diagonal(9, 5, -3)
@@ -156,14 +161,15 @@ class Matrix
#
def Matrix.diagonal(*values)
size = values.size
- rows = (0 .. size - 1).collect {|j|
+ rows = (0 .. size - 1).collect {
+ |j|
row = Array.new(size).fill(0, 0, size)
row[j] = values[j]
row
}
rows(rows, false)
end
-
+
#
# Creates an +n+ by +n+ diagonal matrix where each diagonal element is
# +value+.
@@ -184,11 +190,11 @@ class Matrix
def Matrix.identity(n)
Matrix.scalar(n, 1)
end
- class << Matrix
+ class << Matrix
alias unit identity
alias I identity
end
-
+
#
# Creates an +n+ by +n+ zero matrix.
# Matrix.zero(2)
@@ -198,7 +204,7 @@ class Matrix
def Matrix.zero(n)
Matrix.scalar(n, 0)
end
-
+
#
# Creates a single-row matrix where the values of that row are as given in
# +row+.
@@ -215,7 +221,7 @@ class Matrix
Matrix.rows([[row]], false)
end
end
-
+
#
# Creates a single-column matrix where the values of that column are as given
# in +column+.
@@ -242,7 +248,7 @@ class Matrix
def initialize(init_method, *argv)
self.send(init_method, *argv)
end
-
+
def init_rows(rows, copy)
if copy
@rows = rows.collect{|row| row.dup}
@@ -252,22 +258,13 @@ class Matrix
self
end
private :init_rows
-
+
#
# Returns element (+i+,+j+) of the matrix. That is: row +i+, column +j+.
#
def [](i, j)
@rows[i][j]
end
- alias element []
- alias component []
-
- def []=(i, j, v)
- @rows[i][j] = v
- end
- alias set_element []=
- alias set_component []=
- private :[]=, :set_element, :set_component
#
# Returns the number of rows.
@@ -275,7 +272,7 @@ class Matrix
def row_size
@rows.size
end
-
+
#
# Returns the number of columns. Note that it is possible to construct a
# matrix with uneven columns (e.g. Matrix[ [1,2,3], [4,5] ]), but this is
@@ -307,21 +304,23 @@ class Matrix
#
def column(j) # :yield: e
if block_given?
- 0.upto(row_size - 1) do |i|
+ 0.upto(row_size - 1) do
+ |i|
yield @rows[i][j]
end
else
- col = (0 .. row_size - 1).collect {|i|
+ col = (0 .. row_size - 1).collect {
+ |i|
@rows[i][j]
}
Vector.elements(col, false)
end
end
-
+
#
# Returns a matrix that is the result of iteration of the given block over all
# elements of the matrix.
- # Matrix[ [1,2], [3,4] ].collect { |e| e**2 }
+ # Matrix[ [1,2], [3,4] ].collect { |i| i**2 }
# => 1 4
# 9 16
#
@@ -330,7 +329,7 @@ class Matrix
Matrix.rows(rows, false)
end
alias map collect
-
+
#
# Returns a section of the matrix. The parameters are either:
# * start_row, nrows, start_col, ncols; OR
@@ -357,13 +356,14 @@ class Matrix
else
Matrix.Raise ArgumentError, param.inspect
end
-
- rows = @rows[from_row, size_row].collect{|row|
+
+ rows = @rows[from_row, size_row].collect{
+ |row|
row[from_col, size_col]
}
Matrix.rows(rows, false)
end
-
+
#--
# TESTING -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
#++
@@ -374,7 +374,7 @@ class Matrix
def regular?
square? and rank == column_size
end
-
+
#
# Returns +true+ is this is a singular (i.e. non-regular) matrix.
#
@@ -389,7 +389,7 @@ class Matrix
def square?
column_size == row_size
end
-
+
#--
# OBJECT METHODS -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
#++
@@ -399,27 +399,24 @@ class Matrix
#
def ==(other)
return false unless Matrix === other
-
+
other.compare_by_row_vectors(@rows)
end
- def eql?(other)
- return false unless Matrix === other
-
- other.compare_by_row_vectors(@rows, :eql?)
- end
-
+ alias eql? ==
+
#
# Not really intended for general consumption.
#
- def compare_by_row_vectors(rows, comparison = :==)
+ def compare_by_row_vectors(rows)
return false unless @rows.size == rows.size
-
- 0.upto(@rows.size - 1) do |i|
- return false unless @rows[i].send(comparison, rows[i])
+
+ 0.upto(@rows.size - 1) do
+ |i|
+ return false unless @rows[i] == rows[i]
end
true
end
-
+
#
# Returns a clone of the matrix, so that the contents of each do not reference
# identical objects.
@@ -427,7 +424,7 @@ class Matrix
def clone
Matrix.rows(@rows)
end
-
+
#
# Returns a hash-code for the matrix.
#
@@ -440,11 +437,11 @@ class Matrix
end
return value
end
-
+
#--
# ARITHMETIC -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
#++
-
+
#
# Matrix multiplication.
# Matrix[[2,4], [6,8]] * Matrix.identity(2)
@@ -454,8 +451,10 @@ class Matrix
def *(m) # m is matrix or vector or number
case(m)
when Numeric
- rows = @rows.collect {|row|
- row.collect {|e|
+ rows = @rows.collect {
+ |row|
+ row.collect {
+ |e|
e * m
}
}
@@ -466,11 +465,14 @@ class Matrix
return r.column(0)
when Matrix
Matrix.Raise ErrDimensionMismatch if column_size != m.row_size
-
- rows = (0 .. row_size - 1).collect {|i|
- (0 .. m.column_size - 1).collect {|j|
+
+ rows = (0 .. row_size - 1).collect {
+ |i|
+ (0 .. m.column_size - 1).collect {
+ |j|
vij = 0
- 0.upto(column_size - 1) do |k|
+ 0.upto(column_size - 1) do
+ |k|
vij += self[i, k] * m[k, j]
end
vij
@@ -482,7 +484,7 @@ class Matrix
return x * y
end
end
-
+
#
# Matrix addition.
# Matrix.scalar(2,5) + Matrix[[1,0], [-4,7]]
@@ -500,11 +502,13 @@ class Matrix
x, y = m.coerce(self)
return x + y
end
-
+
Matrix.Raise ErrDimensionMismatch unless row_size == m.row_size and column_size == m.column_size
-
- rows = (0 .. row_size - 1).collect {|i|
- (0 .. column_size - 1).collect {|j|
+
+ rows = (0 .. row_size - 1).collect {
+ |i|
+ (0 .. column_size - 1).collect {
+ |j|
self[i, j] + m[i, j]
}
}
@@ -528,17 +532,19 @@ class Matrix
x, y = m.coerce(self)
return x - y
end
-
+
Matrix.Raise ErrDimensionMismatch unless row_size == m.row_size and column_size == m.column_size
-
- rows = (0 .. row_size - 1).collect {|i|
- (0 .. column_size - 1).collect {|j|
+
+ rows = (0 .. row_size - 1).collect {
+ |i|
+ (0 .. column_size - 1).collect {
+ |j|
self[i, j] - m[i, j]
}
}
Matrix.rows(rows, false)
end
-
+
#
# Matrix division (multiplication by the inverse).
# Matrix[[7,6], [3,9]] / Matrix[[2,9], [3,1]]
@@ -548,8 +554,10 @@ class Matrix
def /(other)
case other
when Numeric
- rows = @rows.collect {|row|
- row.collect {|e|
+ rows = @rows.collect {
+ |row|
+ row.collect {
+ |e|
e / other
}
}
@@ -580,11 +588,11 @@ class Matrix
def inverse_from(src)
size = row_size - 1
a = src.to_a
-
+
for k in 0..size
i = k
akk = a[k][k].abs
- ((k+1)..size).each do |j|
+ for j in (k+1)..size
v = a[j][k].abs
if v > akk
i = j
@@ -597,31 +605,35 @@ class Matrix
@rows[i], @rows[k] = @rows[k], @rows[i]
end
akk = a[k][k]
-
+
for i in 0 .. size
next if i == k
- q = a[i][k].quo(akk)
+ q = a[i][k] / akk
a[i][k] = 0
-
- for j in (k + 1).. size
+
+ (k + 1).upto(size) do
+ |j|
a[i][j] -= a[k][j] * q
end
- for j in 0..size
+ 0.upto(size) do
+ |j|
@rows[i][j] -= @rows[k][j] * q
end
end
-
- for j in (k + 1).. size
- a[k][j] = a[k][j].quo(akk)
+
+ (k + 1).upto(size) do
+ |j|
+ a[k][j] /= akk
end
- for j in 0..size
- @rows[k][j] = @rows[k][j].quo(akk)
+ 0.upto(size) do
+ |j|
+ @rows[k][j] /= akk
end
end
self
end
#alias reciprocal inverse
-
+
#
# Matrix exponentiation. Defined for integer powers only. Equivalent to
# multiplying the matrix by itself N times.
@@ -655,106 +667,53 @@ class Matrix
Matrix.Raise ErrOperationNotDefined, "**"
end
end
-
+
#--
# MATRIX FUNCTIONS -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
#++
-
+
#
# Returns the determinant of the matrix. If the matrix is not square, the
- # result is 0. This method's algorism is Gaussian elimination method
- # and using Numeric#quo(). Beware that using Float values, with their
- # usual lack of precision, can affect the value returned by this method. Use
- # Rational values or Matrix#det_e instead if this is important to you.
- #
+ # result is 0.
# Matrix[[7,6], [3,9]].determinant
- # => 63.0
+ # => 63
#
def determinant
return 0 unless square?
-
+
size = row_size - 1
a = to_a
-
+
det = 1
k = 0
- loop do
+ begin
if (akk = a[k][k]) == 0
i = k
- loop do
- return 0 if (ii += 1) > size
- break unless a[i][k] == 0
- end
+ begin
+ return 0 if (i += 1) > size
+ end while a[i][k] == 0
a[i], a[k] = a[k], a[i]
akk = a[k][k]
det *= -1
end
-
- for i in k + 1 .. size
- q = a[i][k].quo(akk)
- (k + 1).upto(size) do |j|
+ (k + 1).upto(size) do
+ |i|
+ q = a[i][k] / akk
+ (k + 1).upto(size) do
+ |j|
a[i][j] -= a[k][j] * q
end
end
det *= akk
- break unless (k += 1) <= size
- end
+ end while (k += 1) <= size
det
end
alias det determinant
-
- #
- # Returns the determinant of the matrix. If the matrix is not square, the
- # result is 0. This method's algorism is Gaussian elimination method.
- # This method uses Euclidean algorism. If all elements are integer,
- # really exact value. But, if an element is a float, can't return
- # exact value.
- #
- # Matrix[[7,6], [3,9]].determinant
- # => 63
- #
- def determinant_e
- return 0 unless square?
-
- size = row_size - 1
- a = to_a
-
- det = 1
- k = 0
- loop do
- if a[k][k].zero?
- i = k
- loop do
- return 0 if (i += 1) > size
- break unless a[i][k].zero?
- end
- a[i], a[k] = a[k], a[i]
- det *= -1
- end
-
- for i in (k + 1)..size
- q = a[i][k].quo(a[k][k])
- k.upto(size) do |j|
- a[i][j] -= a[k][j] * q
- end
- unless a[i][k].zero?
- a[i], a[k] = a[k], a[i]
- det *= -1
- redo
- end
- end
- det *= a[k][k]
- break unless (k += 1) <= size
- end
- det
- end
- alias det_e determinant_e
-
- #
- # Returns the rank of the matrix. Beware that using Float values,
- # probably return faild value. Use Rational values or Matrix#rank_e
- # for getting exact result.
+
#
+ # Returns the rank of the matrix. Beware that using Float values, with their
+ # usual lack of precision, can affect the value returned by this method. Use
+ # Rational values instead if this is important to you.
# Matrix[[7,6], [3,9]].rank
# => 2
#
@@ -770,32 +729,31 @@ class Matrix
end
rank = 0
k = 0
- loop do
+ begin
if (akk = a[k][k]) == 0
i = k
exists = true
- loop do
+ begin
if (i += 1) > a_column_size - 1
exists = false
break
end
- break unless a[i][k] == 0
- end
+ end while a[i][k] == 0
if exists
a[i], a[k] = a[k], a[i]
akk = a[k][k]
else
i = k
exists = true
- loop do
+ begin
if (i += 1) > a_row_size - 1
exists = false
break
end
- break unless a[k][i] == 0
- end
+ end while a[k][i] == 0
if exists
- k.upto(a_column_size - 1) do |j|
+ k.upto(a_column_size - 1) do
+ |j|
a[j][k], a[j][i] = a[j][i], a[j][k]
end
akk = a[k][k]
@@ -804,68 +762,34 @@ class Matrix
end
end
end
-
- for i in (k + 1)..(a_row_size - 1)
- q = a[i][k].quo(akk)
- for j in (k + 1)..(a_column_size - 1)
+ (k + 1).upto(a_row_size - 1) do
+ |i|
+ q = a[i][k] / akk
+ (k + 1).upto(a_column_size - 1) do
+ |j|
a[i][j] -= a[k][j] * q
end
end
rank += 1
- break unless (k += 1) <= a_column_size - 1
- end
+ end while (k += 1) <= a_column_size - 1
return rank
end
#
- # Returns the rank of the matrix. This method uses Euclidean
- # algorism. If all elements are integer, really exact value. But, if
- # an element is a float, can't return exact value.
- #
- # Matrix[[7,6], [3,9]].rank
- # => 2
- #
- def rank_e
- a = to_a
- a_column_size = column_size
- a_row_size = row_size
- pi = 0
- (0 ... a_column_size).each do |j|
- if i = (pi ... a_row_size).find{|i0| !a[i0][j].zero?}
- if i != pi
- a[pi], a[i] = a[i], a[pi]
- end
- (pi + 1 ... a_row_size).each do |k|
- q = a[k][j].quo(a[pi][j])
- (pi ... a_column_size).each do |j0|
- a[k][j0] -= q * a[pi][j0]
- end
- if k > pi && !a[k][j].zero?
- a[k], a[pi] = a[pi], a[k]
- redo
- end
- end
- pi += 1
- end
- end
- pi
- end
-
-
- #
# Returns the trace (sum of diagonal elements) of the matrix.
# Matrix[[7,6], [3,9]].trace
# => 16
#
def trace
tr = 0
- 0.upto(column_size - 1) do |i|
+ 0.upto(column_size - 1) do
+ |i|
tr += @rows[i][i]
end
tr
end
alias tr trace
-
+
#
# Returns the transpose of the matrix.
# Matrix[[1,2], [3,4], [5,6]]
@@ -880,11 +804,11 @@ class Matrix
Matrix.columns(@rows)
end
alias t transpose
-
+
#--
# CONVERTING -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
#++
-
+
#
# FIXME: describe #coerce.
#
@@ -901,70 +825,61 @@ class Matrix
# Returns an array of the row vectors of the matrix. See Vector.
#
def row_vectors
- rows = (0 .. row_size - 1).collect {|i|
+ rows = (0 .. row_size - 1).collect {
+ |i|
row(i)
}
rows
end
-
+
#
# Returns an array of the column vectors of the matrix. See Vector.
#
def column_vectors
- columns = (0 .. column_size - 1).collect {|i|
+ columns = (0 .. column_size - 1).collect {
+ |i|
column(i)
}
columns
end
-
+
#
# Returns an array of arrays that describe the rows of the matrix.
#
def to_a
@rows.collect{|row| row.collect{|e| e}}
end
-
- def elements_to_f
- collect{|e| e.to_f}
- end
-
- def elements_to_i
- collect{|e| e.to_i}
- end
-
- def elements_to_r
- collect{|e| e.to_r}
- end
-
+
#--
# PRINTING -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
#++
-
+
#
# Overrides Object#to_s
#
def to_s
- "Matrix[" + @rows.collect{|row|
+ "Matrix[" + @rows.collect{
+ |row|
"[" + row.collect{|e| e.to_s}.join(", ") + "]"
}.join(", ")+"]"
end
-
+
#
# Overrides Object#inspect
#
def inspect
"Matrix"+@rows.inspect
end
-
+
# Private CLASS
-
+
class Scalar < Numeric # :nodoc:
include ExceptionForMatrix
-
+
def initialize(value)
@value = value
end
-
+
# ARITHMETIC
def +(other)
case other
@@ -979,7 +894,7 @@ class Matrix
x + y
end
end
-
+
def -(other)
case other
when Numeric
@@ -993,7 +908,7 @@ class Matrix
x - y
end
end
-
+
def *(other)
case other
when Numeric
@@ -1005,7 +920,7 @@ class Matrix
x * y
end
end
-
+
def / (other)
case other
when Numeric
@@ -1013,13 +928,13 @@ class Matrix
when Vector
Scalar.Raise WrongArgType, other.class, "Numeric or Scalar or Matrix"
when Matrix
- self * other.inverse
+ self * _M.inverse
else
x, y = other.coerce(self)
- x.quo(y)
+ x / y
end
end
-
+
def ** (other)
case other
when Numeric
@@ -1078,9 +993,9 @@ end
#
class Vector
include ExceptionForMatrix
-
+
#INSTANCE CREATION
-
+
private_class_method :new
#
@@ -1090,7 +1005,7 @@ class Vector
def Vector.[](*array)
new(:init_elements, array, copy = false)
end
-
+
#
# Creates a vector from an Array. The optional second argument specifies
# whether the array itself or a copy is used internally.
@@ -1098,14 +1013,14 @@ class Vector
def Vector.elements(array, copy = true)
new(:init_elements, array, copy)
end
-
+
#
# For internal use.
#
def initialize(method, array, copy)
self.send(method, array, copy)
end
-
+
#
# For internal use.
#
@@ -1116,32 +1031,23 @@ class Vector
@elements = array
end
end
-
+
# ACCESSING
-
+
#
# Returns element number +i+ (starting at zero) of the vector.
#
def [](i)
@elements[i]
end
- alias element []
- alias component []
-
- def []=(i, v)
- @elements[i]= v
- end
- alias set_element []=
- alias set_component []=
- private :[]=, :set_element, :set_component
-
+
#
# Returns the number of elements in the vector.
#
def size
@elements.size
end
-
+
#--
# ENUMERATIONS -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
#++
@@ -1151,18 +1057,20 @@ class Vector
#
def each2(v) # :yield: e1, e2
Vector.Raise ErrDimensionMismatch if size != v.size
- 0.upto(size - 1) do |i|
+ 0.upto(size - 1) do
+ |i|
yield @elements[i], v[i]
end
end
-
+
#
# Collects (as in Enumerable#collect) over the elements of this vector and +v+
# in conjunction.
#
def collect2(v) # :yield: e1, e2
Vector.Raise ErrDimensionMismatch if size != v.size
- (0 .. size - 1).collect do |i|
+ (0 .. size - 1).collect do
+ |i|
yield @elements[i], v[i]
end
end
@@ -1176,40 +1084,36 @@ class Vector
#
def ==(other)
return false unless Vector === other
-
+
other.compare_by(@elements)
end
- def eql?(other)
- return false unless Vector === other
-
- other.compare_by(@elements, :eql?)
- end
-
+ alias eql? ==
+
#
# For internal use.
#
- def compare_by(elements, comparison = :==)
- @elements.send(comparison, elements)
+ def compare_by(elements)
+ @elements == elements
end
-
+
#
# Return a copy of the vector.
#
def clone
Vector.elements(@elements)
end
-
+
#
# Return a hash-code for the vector.
#
def hash
@elements.hash
end
-
+
#--
# ARITHMETIC -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
#++
-
+
#
# Multiplies the vector by +x+, where +x+ is a number or another vector.
#
@@ -1233,7 +1137,8 @@ class Vector
case v
when Vector
Vector.Raise ErrDimensionMismatch if size != v.size
- els = collect2(v) {|v1, v2|
+ els = collect2(v) {
+ |v1, v2|
v1 + v2
}
Vector.elements(els, false)
@@ -1252,7 +1157,8 @@ class Vector
case v
when Vector
Vector.Raise ErrDimensionMismatch if size != v.size
- els = collect2(v) {|v1, v2|
+ els = collect2(v) {
+ |v1, v2|
v1 - v2
}
Vector.elements(els, false)
@@ -1263,46 +1169,49 @@ class Vector
s - x
end
end
-
+
#--
# VECTOR FUNCTIONS -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
#++
-
+
#
# Returns the inner product of this vector with the other.
# Vector[4,7].inner_product Vector[10,1] => 47
#
def inner_product(v)
Vector.Raise ErrDimensionMismatch if size != v.size
-
+
p = 0
- each2(v) {|v1, v2|
+ each2(v) {
+ |v1, v2|
p += v1 * v2
}
p
end
-
+
#
# Like Array#collect.
#
def collect # :yield: e
- els = @elements.collect {|v|
+ els = @elements.collect {
+ |v|
yield v
}
Vector.elements(els, false)
end
alias map collect
-
+
#
# Like Vector#collect2, but returns a Vector instead of an Array.
#
def map2(v) # :yield: e1, e2
- els = collect2(v) {|v1, v2|
+ els = collect2(v) {
+ |v1, v2|
yield v1, v2
}
Vector.elements(els, false)
end
-
+
#
# Returns the modulus (Pythagorean distance) of the vector.
# Vector[5,8,2].r => 9.643650761
@@ -1314,7 +1223,7 @@ class Vector
end
return Math.sqrt(v)
end
-
+
#--
# CONVERTING
#++
@@ -1325,49 +1234,37 @@ class Vector
def covector
Matrix.row_vector(self)
end
-
+
#
# Returns the elements of the vector in an array.
#
def to_a
@elements.dup
end
-
- def elements_to_f
- collect{|e| e.to_f}
- end
-
- def elements_to_i
- collect{|e| e.to_i}
- end
-
- def elements_to_r
- collect{|e| e.to_r}
- end
-
+
#
# FIXME: describe Vector#coerce.
#
def coerce(other)
case other
when Numeric
- return Matrix::Scalar.new(other), self
+ return Scalar.new(other), self
else
raise TypeError, "#{self.class} can't be coerced into #{other.class}"
end
end
-
+
#--
# PRINTING -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
#++
-
+
#
# Overrides Object#to_s
#
def to_s
"Vector[" + @elements.join(", ") + "]"
end
-
+
#
# Overrides Object#inspect
#
diff --git a/lib/minitest/autorun.rb b/lib/minitest/autorun.rb
deleted file mode 100644
index 5bf35f6ab8..0000000000
--- a/lib/minitest/autorun.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-############################################################
-# This file is imported from a different project.
-# DO NOT make modifications in this repo.
-# File a patch instead and assign it to Ryan Davis
-############################################################
-
-require 'minitest/unit'
-require 'minitest/spec'
-require 'minitest/mock'
-
-MiniTest::Unit.autorun
diff --git a/lib/minitest/mock.rb b/lib/minitest/mock.rb
deleted file mode 100644
index 54af28c453..0000000000
--- a/lib/minitest/mock.rb
+++ /dev/null
@@ -1,37 +0,0 @@
-############################################################
-# This file is imported from a different project.
-# DO NOT make modifications in this repo.
-# File a patch instead and assign it to Ryan Davis
-############################################################
-
-class MockExpectationError < StandardError; end
-
-module MiniTest
- class Mock
- def initialize
- @expected_calls = {}
- @actual_calls = Hash.new {|h,k| h[k] = [] }
- end
-
- def expect(name, retval, args=[])
- n, r, a = name, retval, args # for the closure below
- @expected_calls[name] = { :retval => retval, :args => args }
- self.class.__send__(:define_method, name) { |*x|
- raise ArgumentError unless @expected_calls[n][:args].size == x.size
- @actual_calls[n] << { :retval => r, :args => x }
- retval
- }
- self
- end
-
- def verify
- @expected_calls.each_key do |name|
- expected = @expected_calls[name]
- msg = "expected #{name}, #{expected.inspect}"
- raise MockExpectationError, msg unless
- @actual_calls.has_key? name and @actual_calls[name].include?(expected)
- end
- true
- end
- end
-end
diff --git a/lib/minitest/spec.rb b/lib/minitest/spec.rb
deleted file mode 100644
index 81bd08867a..0000000000
--- a/lib/minitest/spec.rb
+++ /dev/null
@@ -1,114 +0,0 @@
-############################################################
-# This file is imported from a different project.
-# DO NOT make modifications in this repo.
-# File a patch instead and assign it to Ryan Davis
-############################################################
-
-#!/usr/bin/ruby -w
-
-require 'minitest/unit'
-
-class Module
- def infect_with_assertions pos_prefix, neg_prefix, skip_re, map = {}
- MiniTest::Assertions.public_instance_methods(false).each do |meth|
- meth = meth.to_s
-
- new_name = case meth
- when /^assert/ then
- meth.sub(/^assert/, pos_prefix.to_s)
- when /^refute/ then
- meth.sub(/^refute/, neg_prefix.to_s)
- end
- next unless new_name
- next if new_name =~ skip_re
-
- regexp, replacement = map.find { |re, _| new_name =~ re }
- new_name.sub! regexp, replacement if replacement
-
- # warn "%-22p -> %p %p" % [meth, new_name, regexp]
- self.class_eval <<-EOM
- def #{new_name} *args, &block
- return MiniTest::Spec.current.#{meth}(*args, &self) if Proc === self
- return MiniTest::Spec.current.#{meth}(args.first, self) if args.size == 1
- return MiniTest::Spec.current.#{meth}(self, *args)
- end
- EOM
- end
- end
-end
-
-Object.infect_with_assertions(:must, :wont,
- /^(must|wont)$|wont_(throw)|
- must_(block|not?_|nothing|raise$)/x,
- /(must_throw)s/ => '\1',
- /(?!not)_same/ => '_be_same_as',
- /_in_/ => '_be_within_',
- /_operator/ => '_be',
- /_includes/ => '_include',
- /(must|wont)_(.*_of|nil|empty)/ => '\1_be_\2',
- /must_raises/ => 'must_raise')
-
-class Object
- alias :must_be_close_to :must_be_within_delta
- alias :wont_be_close_to :wont_be_within_delta
-end
-
-module Kernel
- def describe desc, &block
- stack = MiniTest::Spec.describe_stack
- name = desc.to_s.split(/\W+/).map { |s| s.capitalize }.join + "Spec"
- cls = Object.class_eval "class #{name} < #{stack.last}; end; #{name}"
-
- cls.nuke_test_methods!
-
- stack.push cls
- cls.class_eval(&block)
- stack.pop
- end
- private :describe
-end
-
-class MiniTest::Spec < MiniTest::Unit::TestCase
- @@describe_stack = [MiniTest::Spec]
- def self.describe_stack
- @@describe_stack
- end
-
- def self.current
- @@current_spec
- end
-
- def initialize name
- super
- @@current_spec = self
- end
-
- def self.nuke_test_methods!
- self.public_instance_methods.grep(/^test_/).each do |name|
- send :remove_method, name rescue nil
- end
- end
-
- def self.define_inheritable_method name, &block
- super_method = self.superclass.instance_method name
-
- define_method name do
- super_method.bind(self).call if super_method # regular super() warns
- instance_eval(&block)
- end
- end
-
- def self.before(type = :each, &block)
- raise "unsupported before type: #{type}" unless type == :each
- define_inheritable_method :setup, &block
- end
-
- def self.after(type = :each, &block)
- raise "unsupported after type: #{type}" unless type == :each
- define_inheritable_method :teardown, &block
- end
-
- def self.it desc, &block
- define_method "test_#{desc.gsub(/\W+/, '_').downcase}", &block
- end
-end
diff --git a/lib/minitest/unit.rb b/lib/minitest/unit.rb
deleted file mode 100644
index e936f39fc7..0000000000
--- a/lib/minitest/unit.rb
+++ /dev/null
@@ -1,536 +0,0 @@
-############################################################
-# This file is imported from a different project.
-# DO NOT make modifications in this repo.
-# File a patch instead and assign it to Ryan Davis
-############################################################
-
-##
-#
-# Totally minimal drop-in replacement for test-unit
-#
-# TODO: refute -> debunk, prove/rebut, show/deny... lots of possibilities
-
-module MiniTest
- class Assertion < Exception; end
- class Skip < Assertion; end
-
- file = if RUBY_VERSION =~ /^1\.9/ then # bt's expanded, but __FILE__ isn't :(
- File.expand_path __FILE__
- elsif __FILE__ =~ /^[^\.]/ then # assume both relative
- require 'pathname'
- pwd = Pathname.new Dir.pwd
- pn = Pathname.new File.expand_path(__FILE__)
- pn = File.join(".", pn.relative_path_from(pwd)) unless pn.relative?
- pn.to_s
- else # assume both are expanded
- __FILE__
- end
-
- # './lib' in project dir, or '/usr/local/blahblah' if installed
- MINI_DIR = File.dirname(File.dirname(file))
-
- def self.filter_backtrace bt
- return ["No backtrace"] unless bt
-
- new_bt = []
- bt.each do |line|
- break if line.rindex(MINI_DIR, 0)
- new_bt << line
- end
-
- new_bt = bt.reject { |line| line.rindex(MINI_DIR, 0) } if new_bt.empty?
- new_bt = bt.dup if new_bt.empty?
- new_bt
- end
-
- module Assertions
- def mu_pp(obj)
- s = obj.inspect
- s = s.force_encoding(Encoding.default_external) if defined? Encoding
- s
- end
-
- def _assertions= n
- @_assertions = n
- end
-
- def _assertions
- @_assertions ||= 0
- end
-
- def assert test, msg = nil
- msg ||= "Failed assertion, no message given."
- self._assertions += 1
- unless test then
- msg = msg.call if Proc === msg
- raise MiniTest::Assertion, msg
- end
- true
- end
-
- def assert_block msg = nil
- msg = message(msg) { "Expected block to return true value" }
- assert yield, msg
- end
-
- def assert_empty obj, msg = nil
- msg = message(msg) { "Expected #{obj.inspect} to be empty" }
- assert_respond_to obj, :empty?
- assert obj.empty?, msg
- end
-
- def assert_equal exp, act, msg = nil
- msg = message(msg) { "Expected #{mu_pp(exp)}, not #{mu_pp(act)}" }
- assert(exp == act, msg)
- end
-
- def assert_in_delta exp, act, delta = 0.001, msg = nil
- n = (exp - act).abs
- msg = message(msg) { "Expected #{exp} - #{act} (#{n}) to be < #{delta}" }
- assert delta >= n, msg
- end
-
- def assert_in_epsilon a, b, epsilon = 0.001, msg = nil
- assert_in_delta a, b, [a, b].min * epsilon, msg
- end
-
- def assert_includes collection, obj, msg = nil
- msg = message(msg) { "Expected #{mu_pp(collection)} to include #{mu_pp(obj)}" }
- flip = (obj.respond_to? :include?) && ! (collection.respond_to? :include?) # HACK for specs
- obj, collection = collection, obj if flip
- assert_respond_to collection, :include?
- assert collection.include?(obj), msg
- end
-
- def assert_instance_of cls, obj, msg = nil
- msg = message(msg) { "Expected #{mu_pp(obj)} to be an instance of #{cls}, not #{obj.class}" }
- flip = (Module === obj) && ! (Module === cls) # HACK for specs
- obj, cls = cls, obj if flip
- assert obj.instance_of?(cls), msg
- end
-
- def assert_kind_of cls, obj, msg = nil # TODO: merge with instance_of
- msg = message(msg) {
- "Expected #{mu_pp(obj)} to be a kind of #{cls}, not #{obj.class}" }
- flip = (Module === obj) && ! (Module === cls) # HACK for specs
- obj, cls = cls, obj if flip
- assert obj.kind_of?(cls), msg
- end
-
- def assert_match exp, act, msg = nil
- msg = message(msg) { "Expected #{mu_pp(exp)} to match #{mu_pp(act)}" }
- assert_respond_to act, :"=~"
- exp = /#{Regexp.escape(exp)}/ if String === exp && String === act
- assert exp =~ act, msg
- end
-
- def assert_nil obj, msg = nil
- msg = message(msg) { "Expected #{mu_pp(obj)} to be nil" }
- assert obj.nil?, msg
- end
-
- def assert_operator o1, op, o2, msg = nil
- msg = message(msg) { "Expected #{mu_pp(o1)} to be #{op} #{mu_pp(o2)}" }
- assert o1.__send__(op, o2), msg
- end
-
- def assert_raises *exp
- msg = String === exp.last ? exp.pop : nil
- should_raise = false
- begin
- yield
- should_raise = true
- rescue Exception => e
- assert(exp.any? { |ex|
- ex.instance_of?(Module) ? e.kind_of?(ex) : ex == e.class
- }, exception_details(e, "#{mu_pp(exp)} exception expected, not"))
-
- return e
- end
-
- exp = exp.first if exp.size == 1
- flunk "#{mu_pp(exp)} expected but nothing was raised." if should_raise
- end
-
- def assert_respond_to obj, meth, msg = nil
- msg = message(msg) {
- "Expected #{mu_pp(obj)} (#{obj.class}) to respond to ##{meth}"
- }
- flip = (Symbol === obj) && ! (Symbol === meth) # HACK for specs
- obj, meth = meth, obj if flip
- assert obj.respond_to?(meth), msg
- end
-
- def assert_same exp, act, msg = nil
- msg = message(msg) {
- data = [mu_pp(act), act.object_id, mu_pp(exp), exp.object_id]
- "Expected %s (0x%x) to be the same as %s (0x%x)" % data
- }
- assert exp.equal?(act), msg
- end
-
- def assert_send send_ary, m = nil
- recv, msg, *args = send_ary
- m = message(m) {
- "Expected #{mu_pp(recv)}.#{msg}(*#{mu_pp(args)}) to return true" }
- assert recv.__send__(msg, *args), m
- end
-
- def assert_throws sym, msg = nil
- default = "Expected #{mu_pp(sym)} to have been thrown"
- caught = true
- catch(sym) do
- begin
- yield
- rescue ArgumentError => e # 1.9 exception
- default += ", not #{e.message.split(/ /).last}"
- rescue NameError => e # 1.8 exception
- default += ", not #{e.name.inspect}"
- end
- caught = false
- end
-
- assert caught, message(msg) { default }
- end
-
- def capture_io
- require 'stringio'
-
- orig_stdout, orig_stderr = $stdout, $stderr
- captured_stdout, captured_stderr = StringIO.new, StringIO.new
- $stdout, $stderr = captured_stdout, captured_stderr
-
- yield
-
- return captured_stdout.string, captured_stderr.string
- ensure
- $stdout = orig_stdout
- $stderr = orig_stderr
- end
-
- def exception_details e, msg
- "#{msg}\nClass: <#{e.class}>\nMessage: <#{e.message.inspect}>\n---Backtrace---\n#{MiniTest::filter_backtrace(e.backtrace).join("\n")}\n---------------"
- end
-
- def flunk msg = nil
- msg ||= "Epic Fail!"
- assert false, msg
- end
-
- def message msg = nil, &default
- proc {
- if msg then
- msg = msg.to_s unless String === msg
- msg += '.' unless msg.empty?
- msg += "\n#{default.call}."
- msg.strip
- else
- "#{default.call}."
- end
- }
- end
-
- # used for counting assertions
- def pass msg = nil
- assert true
- end
-
- def refute test, msg = nil
- msg ||= "Failed refutation, no message given"
- not assert(! test, msg)
- end
-
- def refute_empty obj, msg = nil
- msg = message(msg) { "Expected #{obj.inspect} to not be empty" }
- assert_respond_to obj, :empty?
- refute obj.empty?, msg
- end
-
- def refute_equal exp, act, msg = nil
- msg = message(msg) { "Expected #{mu_pp(act)} to not be equal to #{mu_pp(exp)}" }
- refute exp == act, msg
- end
-
- def refute_in_delta exp, act, delta = 0.001, msg = nil
- n = (exp - act).abs
- msg = message(msg) { "Expected #{exp} - #{act} (#{n}) to not be < #{delta}" }
- refute delta > n, msg
- end
-
- def refute_in_epsilon a, b, epsilon = 0.001, msg = nil
- refute_in_delta a, b, a * epsilon, msg
- end
-
- def refute_includes collection, obj, msg = nil
- msg = message(msg) { "Expected #{mu_pp(collection)} to not include #{mu_pp(obj)}" }
- flip = (obj.respond_to? :include?) && ! (collection.respond_to? :include?) # HACK for specs
- obj, collection = collection, obj if flip
- assert_respond_to collection, :include?
- refute collection.include?(obj), msg
- end
-
- def refute_instance_of cls, obj, msg = nil
- msg = message(msg) { "Expected #{mu_pp(obj)} to not be an instance of #{cls}" }
- flip = (Module === obj) && ! (Module === cls) # HACK for specs
- obj, cls = cls, obj if flip
- refute obj.instance_of?(cls), msg
- end
-
- def refute_kind_of cls, obj, msg = nil # TODO: merge with instance_of
- msg = message(msg) { "Expected #{mu_pp(obj)} to not be a kind of #{cls}" }
- flip = (Module === obj) && ! (Module === cls) # HACK for specs
- obj, cls = cls, obj if flip
- refute obj.kind_of?(cls), msg
- end
-
- def refute_match exp, act, msg = nil
- msg = message(msg) { "Expected #{mu_pp(exp)} to not match #{mu_pp(act)}" }
- assert_respond_to act, :"=~"
- exp = /#{Regexp.escape(exp)}/ if String === exp && String === act
- refute exp =~ act, msg
- end
-
- def refute_nil obj, msg = nil
- msg = message(msg) { "Expected #{mu_pp(obj)} to not be nil" }
- refute obj.nil?, msg
- end
-
- def refute_operator o1, op, o2, msg = nil
- msg = message(msg) { "Expected #{mu_pp(o1)} to not be #{op} #{mu_pp(o2)}" }
- refute o1.__send__(op, o2), msg
- end
-
- def refute_respond_to obj, meth, msg = nil
- msg = message(msg) { "Expected #{mu_pp(obj)} to not respond to #{meth}" }
- flip = (Symbol === obj) && ! (Symbol === meth) # HACK for specs
- obj, meth = meth, obj if flip
- refute obj.respond_to?(meth), msg
- end
-
- def refute_same exp, act, msg = nil
- msg = message(msg) { "Expected #{mu_pp(act)} to not be the same as #{mu_pp(exp)}" }
- refute exp.equal?(act), msg
- end
-
- def skip msg = nil, bt = caller
- msg ||= "Skipped, no message given"
- raise MiniTest::Skip, msg, bt
- end
- end
-
- class Unit
- VERSION = "1.4.2"
-
- attr_accessor :report, :failures, :errors, :skips
- attr_accessor :test_count, :assertion_count
- attr_accessor :start_time
-
- @@installed_at_exit ||= false
- @@out = $stdout
-
- def self.autorun
- at_exit {
- next if $! # don't run if there was an exception
- exit_code = MiniTest::Unit.new.run(ARGV)
- exit false if exit_code && exit_code != 0
- } unless @@installed_at_exit
- @@installed_at_exit = true
- end
-
- def self.output= stream
- @@out = stream
- end
-
- def location e
- last_before_assertion = ""
- e.backtrace.reverse_each do |s|
- break if s =~ /in .(assert|refute|flunk|pass|fail|raise|must|wont)/
- last_before_assertion = s
- end
- last_before_assertion.sub(/:in .*$/, '')
- end
-
- def puke klass, meth, e
- e = case e
- when MiniTest::Skip then
- @skips += 1
- "Skipped:\n#{meth}(#{klass}) [#{location e}]:\n#{e.message}\n"
- when MiniTest::Assertion then
- @failures += 1
- "Failure:\n#{meth}(#{klass}) [#{location e}]:\n#{e.message}\n"
- else
- @errors += 1
- bt = MiniTest::filter_backtrace(e.backtrace).join("\n ")
- "Error:\n#{meth}(#{klass}):\n#{e.class}: #{e.message}\n #{bt}\n"
- end
- @report << e
- e[0, 1]
- end
-
- def initialize
- @report = []
- @errors = @failures = @skips = 0
- @verbose = false
- end
-
- ##
- # Top level driver, controls all output and filtering.
-
- def run args = []
- @verbose = args.delete('-v')
-
- filter = if args.first =~ /^(-n|--name)$/ then
- args.shift
- arg = args.shift
- arg =~ /\/(.*)\// ? Regexp.new($1) : arg
- else
- /./ # anything - ^test_ already filtered by #tests
- end
-
- @@out.puts "Loaded suite #{$0.sub(/\.rb$/, '')}\nStarted"
-
- start = Time.now
- run_test_suites filter
-
- @@out.puts
- @@out.puts "Finished in #{'%.6f' % (Time.now - start)} seconds."
-
- @report.each_with_index do |msg, i|
- @@out.puts "\n%3d) %s" % [i + 1, msg]
- end
-
- @@out.puts
-
- status
-
- return failures + errors if @test_count > 0 # or return nil...
- rescue Interrupt
- abort 'Interrupted'
- end
-
- def status io = @@out
- format = "%d tests, %d assertions, %d failures, %d errors, %d skips"
- io.puts format % [test_count, assertion_count, failures, errors, skips]
- end
-
- def run_test_suites filter = /./
- @test_count, @assertion_count = 0, 0
- old_sync, @@out.sync = @@out.sync, true if @@out.respond_to? :sync=
- TestCase.test_suites.each do |suite|
- suite.test_methods.grep(filter).each do |test|
- inst = suite.new test
- inst._assertions = 0
- @@out.print "#{suite}##{test}: " if @verbose
-
- @start_time = Time.now
- result = inst.run(self)
-
- @@out.print "%.2f s: " % (Time.now - @start_time) if @verbose
- @@out.print result
- @@out.puts if @verbose
- @test_count += 1
- @assertion_count += inst._assertions
- end
- end
- @@out.sync = old_sync if @@out.respond_to? :sync=
- [@test_count, @assertion_count]
- end
-
- class TestCase
- attr_reader :__name__
-
- PASSTHROUGH_EXCEPTIONS = [NoMemoryError, SignalException, Interrupt,
- SystemExit]
-
- SUPPORTS_INFO_SIGNAL = Signal.list['INFO']
-
- def run runner
- trap 'INFO' do
- warn '%s#%s %.2fs' % [self.class, self.__name__,
- (Time.now - runner.start_time)]
- runner.status $stderr
- end if SUPPORTS_INFO_SIGNAL
-
- result = '.'
- begin
- @passed = nil
- self.setup
- self.__send__ self.__name__
- @passed = true
- rescue *PASSTHROUGH_EXCEPTIONS
- raise
- rescue Exception => e
- @passed = false
- result = runner.puke(self.class, self.__name__, e)
- ensure
- begin
- self.teardown
- rescue *PASSTHROUGH_EXCEPTIONS
- raise
- rescue Exception => e
- result = runner.puke(self.class, self.__name__, e)
- end
- trap 'INFO', 'DEFAULT' if SUPPORTS_INFO_SIGNAL
- end
- result
- end
-
- def initialize name
- @__name__ = name
- @passed = nil
- end
-
- def self.reset
- @@test_suites = {}
- end
-
- reset
-
- def self.inherited klass
- @@test_suites[klass] = true
- end
-
- def self.test_order
- :random
- end
-
- def self.test_suites
- @@test_suites.keys.sort_by { |ts| ts.name }
- end
-
- def self.test_methods
- methods = public_instance_methods(true).grep(/^test/).map { |m|
- m.to_s
- }.sort
-
- if self.test_order == :random then
- max = methods.size
- methods = methods.sort_by { rand(max) }
- end
-
- methods
- end
-
- def setup; end
- def teardown; end
-
- def passed?
- @passed
- end
-
- include MiniTest::Assertions
- end # class TestCase
- end # class Test
-end # module Mini
-
-if $DEBUG then
- # this helps me ferret out porting issues
- module Test; end
- module Test::Unit; end
- class Test::Unit::TestCase
- def self.inherited x
- raise "You're running minitest and test/unit in the same process: #{x}"
- end
- end
-end
-
diff --git a/lib/mkmf.rb b/lib/mkmf.rb
index 9c1b838acd..380e660233 100644
--- a/lib/mkmf.rb
+++ b/lib/mkmf.rb
@@ -5,16 +5,15 @@ require 'rbconfig'
require 'fileutils'
require 'shellwords'
-CONFIG = RbConfig::MAKEFILE_CONFIG
+CONFIG = Config::MAKEFILE_CONFIG
ORIG_LIBPATH = ENV['LIB']
CXX_EXT = %w[cc cxx cpp]
-if File::FNM_SYSCASE.zero?
+if /mswin|bccwin|mingw|msdosdjgpp|human|os2/ !~ CONFIG['build_os']
CXX_EXT.concat(%w[C])
end
-SRC_EXT = %w[c m].concat(CXX_EXT)
-$static = nil
-$config_h = '$(arch_hdrdir)/ruby/config.h'
+SRC_EXT = %w[c m] << CXX_EXT
+$static = $config_h = nil
$default_static = $static
unless defined? $configure_args
@@ -60,12 +59,11 @@ $mswin = /mswin/ =~ RUBY_PLATFORM
$bccwin = /bccwin/ =~ RUBY_PLATFORM
$mingw = /mingw/ =~ RUBY_PLATFORM
$cygwin = /cygwin/ =~ RUBY_PLATFORM
+$human = /human/ =~ RUBY_PLATFORM
$netbsd = /netbsd/ =~ RUBY_PLATFORM
$os2 = /os2/ =~ RUBY_PLATFORM
$beos = /beos/ =~ RUBY_PLATFORM
-$haiku = /haiku/ =~ RUBY_PLATFORM
$solaris = /solaris/ =~ RUBY_PLATFORM
-$universal = /universal/ =~ RUBY_PLATFORM
$dest_prefix_pattern = (File::PATH_SEPARATOR == ';' ? /\A([[:alpha:]]:)?/ : /\A/)
# :stopdoc:
@@ -78,15 +76,6 @@ def dir_re(dir)
Regexp.new('\$(?:\('+dir+'\)|\{'+dir+'\})(?:\$(?:\(target_prefix\)|\{target_prefix\}))?')
end
-def relative_from(path, base)
- dir = File.join(path, "")
- if File.expand_path(dir) == File.expand_path(dir, base)
- path
- else
- File.join(base, path)
- end
-end
-
INSTALL_DIRS = [
[dir_re('commondir'), "$(RUBYCOMMONDIR)"],
[dir_re('sitedir'), "$(RUBYCOMMONDIR)"],
@@ -96,11 +85,8 @@ INSTALL_DIRS = [
[dir_re('sitelibdir'), "$(RUBYLIBDIR)"],
[dir_re('vendorlibdir'), "$(RUBYLIBDIR)"],
[dir_re('sitearchdir'), "$(RUBYARCHDIR)"],
- [dir_re('vendorarchdir'), "$(RUBYARCHDIR)"],
- [dir_re('rubyhdrdir'), "$(RUBYHDRDIR)"],
- [dir_re('sitehdrdir'), "$(SITEHDRDIR)"],
- [dir_re('vendorhdrdir'), "$(VENDORHDRDIR)"],
[dir_re('bindir'), "$(BINDIR)"],
+ [dir_re('vendorarchdir'), "$(RUBYARCHDIR)"],
]
def install_dirs(target_prefix = nil)
@@ -110,8 +96,6 @@ def install_dirs(target_prefix = nil)
['RUBYCOMMONDIR', '$(extout)/common'],
['RUBYLIBDIR', '$(RUBYCOMMONDIR)$(target_prefix)'],
['RUBYARCHDIR', '$(extout)/$(arch)$(target_prefix)'],
- ['HDRDIR', '$(extout)/include/ruby$(target_prefix)'],
- ['ARCHHDRDIR', '$(extout)/include/$(arch)/ruby$(target_prefix)'],
['extout', "#$extout"],
['extout_prefix', "#$extout_prefix"],
]
@@ -121,8 +105,6 @@ def install_dirs(target_prefix = nil)
['RUBYCOMMONDIR', '$(rubylibdir)'],
['RUBYLIBDIR', '$(rubylibdir)$(target_prefix)'],
['RUBYARCHDIR', '$(archdir)$(target_prefix)'],
- ['HDRDIR', '$(rubyhdrdir)/ruby$(target_prefix)'],
- ['ARCHHDRDIR', '$(rubyhdrdir)/$(arch)/ruby$(target_prefix)'],
]
elsif $configure_args.has_key?('--vendor')
dirs = [
@@ -130,8 +112,6 @@ def install_dirs(target_prefix = nil)
['RUBYCOMMONDIR', '$(vendordir)$(target_prefix)'],
['RUBYLIBDIR', '$(vendorlibdir)$(target_prefix)'],
['RUBYARCHDIR', '$(vendorarchdir)$(target_prefix)'],
- ['HDRDIR', '$(rubyhdrdir)/ruby$(target_prefix)'],
- ['ARCHHDRDIR', '$(rubyhdrdir)/$(arch)/ruby$(target_prefix)'],
]
else
dirs = [
@@ -139,8 +119,6 @@ def install_dirs(target_prefix = nil)
['RUBYCOMMONDIR', '$(sitedir)$(target_prefix)'],
['RUBYLIBDIR', '$(sitelibdir)$(target_prefix)'],
['RUBYARCHDIR', '$(sitearchdir)$(target_prefix)'],
- ['HDRDIR', '$(rubyhdrdir)/ruby$(target_prefix)'],
- ['ARCHHDRDIR', '$(rubyhdrdir)/$(arch)/ruby$(target_prefix)'],
]
end
dirs << ['target_prefix', (target_prefix ? "/#{target_prefix}" : "")]
@@ -149,29 +127,24 @@ end
def map_dir(dir, map = nil)
map ||= INSTALL_DIRS
- map.inject(dir) {|d, (orig, new)| d.gsub(orig, new)}
+ map.inject(dir) {|dir, (orig, new)| dir.gsub(orig, new)}
end
topdir = File.dirname(libdir = File.dirname(__FILE__))
extdir = File.expand_path("ext", topdir)
-path = File.expand_path($0)
-$extmk = path[0, topdir.size+1] == topdir+"/" && %r"\A(ext|enc|tool)\z" =~ File.dirname(path[topdir.size+1..-1])
-if not $extmk and File.exist?(($hdrdir = RbConfig::CONFIG["rubyhdrdir"]) + "/ruby/ruby.h")
+$extmk = File.expand_path($0)[0, extdir.size+1] == extdir+"/"
+if not $extmk and File.exist?(($hdrdir = Config::CONFIG["archdir"]) + "/ruby.h")
$topdir = $hdrdir
- $top_srcdir = $hdrdir
- $arch_hdrdir = $hdrdir + "/$(arch)"
-elsif File.exist?(($hdrdir = ($top_srcdir ||= topdir) + "/include") + "/ruby.h")
- $topdir ||= RbConfig::CONFIG["topdir"]
- $arch_hdrdir = "$(extout)/include/$(arch)"
+elsif File.exist?(($hdrdir = ($top_srcdir ||= topdir)) + "/ruby.h") and
+ File.exist?(($topdir ||= Config::CONFIG["topdir"]) + "/config.h")
else
abort "mkmf.rb can't find header files for ruby at #{$hdrdir}/ruby.h"
end
OUTFLAG = CONFIG['OUTFLAG']
-COUTFLAG = CONFIG['COUTFLAG']
CPPOUTFILE = CONFIG['CPPOUTFILE']
-CONFTEST_C = "conftest.c".freeze
+CONFTEST_C = "conftest.c"
class String
# Wraps a string in escaped quotes if it contains whitespace.
@@ -192,11 +165,7 @@ class Array
end
def rm_f(*files)
- FileUtils.rm_f(Dir[*files])
-end
-
-def rm_rf(*files)
- FileUtils.rm_rf(Dir[*files])
+ FileUtils.rm_f(Dir[files.join("\0")])
end
# Returns time stamp of the +target+ file if it exists and is newer
@@ -237,13 +206,9 @@ module Logging
@postpone = 0
@quiet = $extmk
- def self::log_open
- @log ||= File::open(@logfile, 'wb')
- @log.sync = true
- end
-
def self::open
- log_open
+ @log ||= File::open(@logfile, 'w')
+ @log.sync = true
$stderr.reopen(@log)
$stdout.reopen(@log)
yield
@@ -253,7 +218,8 @@ module Logging
end
def self::message(*s)
- log_open
+ @log ||= File::open(@logfile, 'w')
+ @log.sync = true
@log.printf(*s)
end
@@ -265,7 +231,7 @@ module Logging
@log = nil
end
end
-
+
def self::postpone
tmplog = "mkmftmp#{@postpone += 1}.log"
open do
@@ -273,9 +239,9 @@ module Logging
@log, @logfile, @orgout, @orgerr = nil, tmplog, log, log
begin
log.print(open {yield})
- ensure
@log.close
File::open(tmplog) {|t| FileUtils.copy_stream(t, log)}
+ ensure
@log, @logfile, @orgout, @orgerr = log, *save
@postpone -= 1
rm_f tmplog
@@ -328,77 +294,45 @@ EOM
end
def create_tmpsrc(src)
- src = "#{COMMON_HEADERS}\n#{src}"
src = yield(src) if block_given?
- src.gsub!(/[ \t]+$/, '')
- src.gsub!(/\A\n+|^\n+$/, '')
- src.sub!(/[^\n]\z/, "\\&\n")
- count = 0
- begin
- open(CONFTEST_C, "wb") do |cfile|
- cfile.print src
- end
- rescue Errno::EACCES
- if (count += 1) < 5
- sleep 0.2
- retry
- end
+ src = src.gsub(/[ \t]+$/, '').gsub(/\A\n+|^\n+$/, '').sub(/[^\n]\z/, "\\&\n")
+ open(CONFTEST_C, "wb") do |cfile|
+ cfile.print src
end
src
end
-def have_devel?
- unless defined? $have_devel
- $have_devel = true
- $have_devel = try_link(MAIN_DOES_NOTHING)
- end
- $have_devel
-end
-
def try_do(src, command, &b)
- unless have_devel?
- raise <<MSG
-The complier failed to generate an executable file.
-You have to install development tools first.
-MSG
- end
src = create_tmpsrc(src, &b)
xsystem(command)
ensure
log_src(src)
- rm_rf 'conftest.dSYM'
end
def link_command(ldflags, opt="", libpath=$DEFLIBPATH|$LIBPATH)
- conf = RbConfig::CONFIG.merge('hdrdir' => $hdrdir.quote,
- 'src' => "#{CONFTEST_C}",
- 'arch_hdrdir' => "#$arch_hdrdir",
- 'top_srcdir' => $top_srcdir.quote,
- 'INCFLAGS' => "#$INCFLAGS",
- 'CPPFLAGS' => "#$CPPFLAGS",
- 'CFLAGS' => "#$CFLAGS",
- 'ARCH_FLAG' => "#$ARCH_FLAG",
- 'LDFLAGS' => "#$LDFLAGS #{ldflags}",
- 'LIBPATH' => libpathflag(libpath),
- 'LOCAL_LIBS' => "#$LOCAL_LIBS #$libs",
- 'LIBS' => "#$LIBRUBYARG_STATIC #{opt} #$LIBS")
- RbConfig::expand(TRY_LINK.dup, conf)
+ conf = Config::CONFIG.merge('hdrdir' => $hdrdir.quote,
+ 'src' => CONFTEST_C,
+ 'INCFLAGS' => $INCFLAGS,
+ 'CPPFLAGS' => $CPPFLAGS,
+ 'CFLAGS' => "#$CFLAGS",
+ 'ARCH_FLAG' => "#$ARCH_FLAG",
+ 'LDFLAGS' => "#$LDFLAGS #{ldflags}",
+ 'LIBPATH' => libpathflag(libpath),
+ 'LOCAL_LIBS' => "#$LOCAL_LIBS #$libs",
+ 'LIBS' => "#$LIBRUBYARG_STATIC #{opt} #$LIBS")
+ Config::expand(TRY_LINK.dup, conf)
end
def cc_command(opt="")
- conf = RbConfig::CONFIG.merge('hdrdir' => $hdrdir.quote, 'srcdir' => $srcdir.quote,
- 'arch_hdrdir' => "#$arch_hdrdir",
- 'top_srcdir' => $top_srcdir.quote)
- RbConfig::expand("$(CC) #$INCFLAGS #$CPPFLAGS #$CFLAGS #$ARCH_FLAG #{opt} -c #{CONFTEST_C}",
- conf)
+ conf = Config::CONFIG.merge('hdrdir' => $hdrdir.quote, 'srcdir' => $srcdir.quote)
+ Config::expand("$(CC) #$INCFLAGS #$CPPFLAGS #$CFLAGS #$ARCH_FLAG #{opt} -c #{CONFTEST_C}",
+ conf)
end
def cpp_command(outfile, opt="")
- conf = RbConfig::CONFIG.merge('hdrdir' => $hdrdir.quote, 'srcdir' => $srcdir.quote,
- 'arch_hdrdir' => "#$arch_hdrdir",
- 'top_srcdir' => $top_srcdir.quote)
- RbConfig::expand("$(CPP) #$INCFLAGS #$CPPFLAGS #$CFLAGS #{opt} #{CONFTEST_C} #{outfile}",
- conf)
+ conf = Config::CONFIG.merge('hdrdir' => $hdrdir.quote, 'srcdir' => $srcdir.quote)
+ Config::expand("$(CPP) #$INCFLAGS #$CPPFLAGS #$CFLAGS #{opt} #{CONFTEST_C} #{outfile}",
+ conf)
end
def libpathflag(libpath=$DEFLIBPATH|$LIBPATH)
@@ -413,20 +347,7 @@ def libpathflag(libpath=$DEFLIBPATH|$LIBPATH)
end
def try_link0(src, opt="", &b)
- cmd = link_command("", opt)
- if $universal
- require 'tmpdir'
- Dir.mktmpdir("mkmf_", oldtmpdir = ENV["TMPDIR"]) do |tmpdir|
- begin
- ENV["TMPDIR"] = tmpdir
- try_do(src, cmd, &b)
- ensure
- ENV["TMPDIR"] = oldtmpdir
- end
- end
- else
- try_do(src, cmd, &b)
- end
+ try_do(src, link_command("", opt), &b)
end
def try_link(src, opt="", &b)
@@ -447,14 +368,10 @@ ensure
rm_f "conftest*"
end
-class Object
- alias_method :try_header, (config_string('try_header') || :try_cpp)
-end
-
def cpp_include(header)
if header
header = [header] unless header.kind_of? Array
- header.map {|h| String === h ? "#include <#{h}>\n" : h}.join
+ header.map {|h| "#include <#{h}>\n"}.join
else
""
end
@@ -487,6 +404,7 @@ end
def try_static_assert(expr, headers = nil, opt = "", &b)
headers = cpp_include(headers)
try_compile(<<SRC, opt, &b)
+#{COMMON_HEADERS}
#{headers}
/*top*/
int conftest_const[(#{expr}) ? 1 : -1];
@@ -525,7 +443,8 @@ def try_constant(const, headers = nil, opt = "", &b)
upper = -upper if neg
return upper
else
- src = %{#{includes}
+ src = %{#{COMMON_HEADERS}
+#{includes}
#include <stdio.h>
/*top*/
int conftest_const = (int)(#{const});
@@ -542,16 +461,16 @@ end
def try_func(func, libs, headers = nil, &b)
headers = cpp_include(headers)
- try_link(<<"SRC", libs, &b) or
+ try_link(<<"SRC", libs, &b) or try_link(<<"SRC", libs, &b)
+#{COMMON_HEADERS}
#{headers}
/*top*/
-#{MAIN_DOES_NOTHING}
+int main() { return 0; }
int t() { void ((*volatile p)()); p = (void ((*)()))#{func}; return 0; }
SRC
- try_link(<<"SRC", libs, &b)
#{headers}
/*top*/
-#{MAIN_DOES_NOTHING}
+int main() { return 0; }
int t() { #{func}(); return 0; }
SRC
end
@@ -559,9 +478,10 @@ end
def try_var(var, headers = nil, &b)
headers = cpp_include(headers)
try_compile(<<"SRC", &b)
+#{COMMON_HEADERS}
#{headers}
/*top*/
-#{MAIN_DOES_NOTHING}
+int main() { return 0; }
int t() { const volatile void *volatile p; p = &(&#{var})[0]; return 0; }
SRC
end
@@ -618,7 +538,7 @@ def install_files(mfile, ifiles, map = nil, srcprefix = nil)
ifiles or return
ifiles.empty? and return
srcprefix ||= '$(srcdir)'
- RbConfig::expand(srcdir = srcprefix.dup)
+ Config::expand(srcdir = srcprefix.dup)
dirs = []
path = Hash.new {|h, i| h[i] = dirs.push([i])[-1]}
ifiles.each do |files, dir, prefix|
@@ -634,8 +554,7 @@ def install_files(mfile, ifiles, map = nil, srcprefix = nil)
len = srcdir.size
end
f = nil
- Dir.glob(files) do |fx|
- f = fx
+ Dir.glob(files) do |f|
f[0..len] = "" if len
case File.basename(f)
when *$NONINSTALLFILES
@@ -678,7 +597,7 @@ end
# Internal use only.
#
def checking_for(m, fmt = nil)
- f = caller[0][/in `(.*)'$/, 1] and f << ": " #` for vim #'
+ f = caller[0][/in `(.*)'$/, 1] and f << ": " #` for vim
m = "checking #{/\Acheck/ =~ f ? '' : 'for '}#{m}... "
message "%s", m
a = r = nil
@@ -822,9 +741,9 @@ end
# For example, if have_header('foo.h') returned true, then the HAVE_FOO_H
# preprocessor macro would be passed to the compiler.
#
-def have_header(header, preheaders = nil, &b)
+def have_header(header, &b)
checking_for header do
- if try_header(cpp_include(preheaders)+cpp_include(header), &b)
+ if try_cpp(cpp_include(header), &b)
$defs.push(format("-DHAVE_%s", header.tr("a-z./\055", "A-Z___")))
true
else
@@ -843,13 +762,13 @@ def find_header(header, *paths)
message = checking_message(header, paths)
header = cpp_include(header)
checking_for message do
- if try_header(header)
+ if try_cpp(header)
true
else
found = false
paths.each do |dir|
opt = "-I#{dir}".quote
- if try_header(header, opt)
+ if try_cpp(header, opt)
$INCFLAGS << " " << opt
found = true
break
@@ -866,23 +785,21 @@ end
# (in addition to the common header files).
#
# If found, a macro is passed as a preprocessor constant to the compiler using
-# the type name and the member name, in uppercase, prepended with 'HAVE_'.
+# the member name, in uppercase, prepended with 'HAVE_ST_'.
#
# For example, if have_struct_member('struct foo', 'bar') returned true, then the
-# HAVE_STRUCT_FOO_BAR preprocessor macro would be passed to the compiler.
-#
-# HAVE_ST_BAR is also defined for backward compatibility.
-#
+# HAVE_ST_BAR preprocessor macro would be passed to the compiler.
+#
def have_struct_member(type, member, headers = nil, &b)
checking_for checking_message("#{type}.#{member}", headers) do
if try_compile(<<"SRC", &b)
+#{COMMON_HEADERS}
#{cpp_include(headers)}
/*top*/
-#{MAIN_DOES_NOTHING}
+int main() { return 0; }
int s = (char *)&((#{type}*)0)->#{member} - (char *)0;
SRC
- $defs.push(format("-DHAVE_%s_%s", type.tr_cpp, member.tr_cpp))
- $defs.push(format("-DHAVE_ST_%s", member.tr_cpp)) # backward compatibility
+ $defs.push(format("-DHAVE_ST_%s", member.tr_cpp))
true
else
false
@@ -892,6 +809,7 @@ end
def try_type(type, headers = nil, opt = "", &b)
if try_compile(<<"SRC", opt, &b)
+#{COMMON_HEADERS}
#{cpp_include(headers)}
/*top*/
typedef #{type} conftest_type;
@@ -946,6 +864,7 @@ end
def try_const(const, headers = nil, opt = "", &b)
const, type = *const
if try_compile(<<"SRC", opt, &b)
+#{COMMON_HEADERS}
#{cpp_include(headers)}
/*top*/
typedef #{type || 'int'} conftest_type;
@@ -991,26 +910,14 @@ end
# SIZEOF_MYSTRUCT=12 preprocessor macro would be passed to the compiler.
#
def check_sizeof(type, headers = nil, &b)
- typename, member = type.split('.', 2)
- prelude = cpp_include(headers).split(/$/)
- prelude << "typedef #{typename} rbcv_typedef_;\n"
- prelude << "static rbcv_typedef_ *rbcv_ptr_;\n"
- prelude = [prelude]
- expr = "sizeof((*rbcv_ptr_)#{"." << member if member})"
- fmt = "%s"
+ expr = "sizeof(#{type})"
+ fmt = "%d"
def fmt.%(x)
x ? super : "failed"
end
checking_for checking_message("size of #{type}", headers), fmt do
- if UNIVERSAL_INTS.include?(type)
- type
- elsif size = UNIVERSAL_INTS.find {|t|
- try_static_assert("#{expr} == sizeof(#{t})", prelude, opts, &b)
- }
- $defs.push(format("-DSIZEOF_%s=SIZEOF_%s", type.tr_cpp, size.tr_cpp))
- size
- elsif size = try_constant(expr, prelude, opts, &b)
- $defs.push(format("-DSIZEOF_%s=%s", type.tr_cpp, size))
+ if size = try_constant(expr, headers, &b)
+ $defs.push(format("-DSIZEOF_%s=%d", type.tr_cpp, size))
size
end
end
@@ -1022,10 +929,11 @@ end
# pointer.
def scalar_ptr_type?(type, member = nil, headers = nil, &b)
try_compile(<<"SRC", &b) # pointer
+#{COMMON_HEADERS}
#{cpp_include(headers)}
/*top*/
volatile #{type} conftestval;
-#{MAIN_DOES_NOTHING}
+int main() { return 0; }
int t() {return (int)(1-*(conftestval#{member ? ".#{member}" : ""}));}
SRC
end
@@ -1034,82 +942,44 @@ end
# pointer.
def scalar_type?(type, member = nil, headers = nil, &b)
try_compile(<<"SRC", &b) # pointer
+#{COMMON_HEADERS}
#{cpp_include(headers)}
/*top*/
volatile #{type} conftestval;
-#{MAIN_DOES_NOTHING}
+int main() { return 0; }
int t() {return (int)(1-(conftestval#{member ? ".#{member}" : ""}));}
SRC
end
-# Used internally by the what_type? method to check if _typeof_ GCC
-# extension is available.
-def have_typeof?
- return $typeof if defined?($typeof)
- $typeof = %w[__typeof__ typeof].find do |t|
- try_compile(<<SRC)
-int rbcv_foo;
-#{t}(rbcv_foo) rbcv_bar;
-SRC
- end
-end
-
def what_type?(type, member = nil, headers = nil, &b)
m = "#{type}"
- var = val = "*rbcv_var_"
- func = "rbcv_func_(void)"
+ name = type
if member
m << "." << member
- else
- type, member = type.split('.', 2)
- end
- if member
- val = "(#{var}).#{member}"
- end
- prelude = [cpp_include(headers).split(/^/)]
- prelude << ["typedef #{type} rbcv_typedef_;\n",
- "extern rbcv_typedef_ *#{func};\n",
- "static rbcv_typedef_ #{var};\n",
- ]
- type = "rbcv_typedef_"
- fmt = member && !(typeof = have_typeof?) ? "seems %s" : "%s"
- if typeof
- var = "*rbcv_member_"
- func = "rbcv_mem_func_(void)"
- member = nil
- type = "rbcv_mem_typedef_"
- prelude[-1] << "typedef #{typeof}(#{val}) #{type};\n"
- prelude[-1] << "extern #{type} *#{func};\n"
- prelude[-1] << "static #{type} #{var};\n"
- val = var
+ name = "(((#{type} *)0)->#{member})"
end
+ fmt = "seems %s"
def fmt.%(x)
x ? super : "unknown"
end
checking_for checking_message(m, headers), fmt do
- if scalar_ptr_type?(type, member, prelude, &b)
- if try_static_assert("sizeof(*#{var}) == 1", prelude)
- return "string"
+ if scalar_ptr_type?(type, member, headers, &b)
+ if try_static_assert("sizeof(*#{name}) == 1", headers)
+ "string"
end
- ptr = "*"
- elsif scalar_type?(type, member, prelude, &b)
- unless member and !typeof or try_static_assert("(#{type})-1 < 0", prelude)
- unsigned = "unsigned"
- end
- ptr = ""
- else
- next
- end
- type = UNIVERSAL_INTS.find do |t|
- pre = prelude
- unless member
- pre += [["static #{unsigned} #{t} #{ptr}#{var};\n",
- "extern #{unsigned} #{t} #{ptr}*#{func};\n"]]
+ elsif scalar_type?(type, member, headers, &b)
+ if try_static_assert("sizeof(#{name}) > sizeof(long)", headers)
+ "long long"
+ elsif try_static_assert("sizeof(#{name}) > sizeof(int)", headers)
+ "long"
+ elsif try_static_assert("sizeof(#{name}) > sizeof(short)", headers)
+ "int"
+ elsif try_static_assert("sizeof(#{name}) > 1", headers)
+ "short"
+ else
+ "char"
end
- try_static_assert("sizeof(#{ptr}#{val}) == sizeof(#{unsigned} #{t})", pre)
end
- type or next
- [unsigned, type, ptr].join(" ").strip
end
end
@@ -1156,14 +1026,9 @@ end
# :stopdoc:
-def arg_config(config, default=nil, &block)
- $arg_config << [config, default]
- defaults = []
- if default
- defaults << default
- elsif !block
- defaults << nil
- end
+def arg_config(config, *defaults, &block)
+ $arg_config << [config, *defaults]
+ defaults << nil if !block and defaults.empty?
$configure_args.fetch(config.tr('_', '-'), *defaults, &block)
end
@@ -1181,15 +1046,15 @@ end
# $defs.push("-DOSSL_DEBUG") unless $defs.include? "-DOSSL_DEBUG"
# end
#
-def with_config(config, default=nil)
+def with_config(config, *defaults)
config = config.sub(/^--with[-_]/, '')
val = arg_config("--with-"+config) do
if arg_config("--without-"+config)
false
elsif block_given?
- yield(config, default)
+ yield(config, *defaults)
else
- break default
+ break *defaults
end
end
case val
@@ -1214,15 +1079,15 @@ end
# $defs.push("-DOSSL_DEBUG") unless $defs.include? "-DOSSL_DEBUG"
# end
#
-def enable_config(config, default=nil)
+def enable_config(config, *defaults)
if arg_config("--enable-"+config)
true
elsif arg_config("--disable-"+config)
false
elsif block_given?
- yield(config, default)
+ yield(config, *defaults)
else
- return default
+ return *defaults
end
end
@@ -1232,7 +1097,7 @@ end
# 'extconf.h'.
#
# For example:
-#
+#
# # extconf.rb
# require 'mkmf'
# have_func('realpath')
@@ -1298,11 +1163,11 @@ def dir_config(target, idefault=nil, ldefault=nil)
idirs = idir ? Array === idir ? idir : idir.split(File::PATH_SEPARATOR) : []
if defaults
- idirs.concat(defaults.collect {|d| d + "/include"})
+ idirs.concat(defaults.collect {|dir| dir + "/include"})
idir = ([idir] + idirs).compact.join(File::PATH_SEPARATOR)
end
unless idirs.empty?
- idirs.collect! {|d| "-I" + d}
+ idirs.collect! {|dir| "-I" + dir}
idirs -= Shellwords.shellwords($CPPFLAGS)
unless idirs.empty?
$CPPFLAGS = (idirs.quote << $CPPFLAGS).join(" ")
@@ -1311,7 +1176,7 @@ def dir_config(target, idefault=nil, ldefault=nil)
ldirs = ldir ? Array === ldir ? ldir : ldir.split(File::PATH_SEPARATOR) : []
if defaults
- ldirs.concat(defaults.collect {|d| d + "/lib"})
+ ldirs.concat(defaults.collect {|dir| dir + "/lib"})
ldir = ([ldir] + ldirs).compact.join(File::PATH_SEPARATOR)
end
$LIBPATH = ldirs | $LIBPATH
@@ -1327,7 +1192,7 @@ def pkg_config(pkg)
if pkgconfig = with_config("#{pkg}-config") and find_executable0(pkgconfig)
# iff package specific config command is given
get = proc {|opt| `#{pkgconfig} --#{opt}`.chomp}
- elsif ($PKGCONFIG ||=
+ elsif ($PKGCONFIG ||=
(pkgconfig = with_config("pkg-config", ("pkg-config" unless CROSS_COMPILING))) &&
find_executable0(pkgconfig) && pkgconfig) and
system("#{$PKGCONFIG} --exists #{pkg}")
@@ -1368,54 +1233,35 @@ def winsep(s)
s.tr('/', '\\')
end
-# Converts native path to format acceptable in Makefile
-#
-# Internal use only.
-#
-if !CROSS_COMPILING
- case CONFIG['build_os']
- when 'mingw32'
- def mkintpath(path)
- # mingw uses make from msys and it needs special care
- # converts from C:\some\path to /C/some/path
- path = path.dup
- path.tr!('\\', '/')
- path.sub!(/\A([A-Za-z]):(?=\/)/, '/\1')
- path
- end
- end
-end
-unless defined?(mkintpath)
- def mkintpath(path)
- path
- end
-end
-
def configuration(srcdir)
mk = []
- vpath = $VPATH.dup
+ vpath = %w[$(srcdir) $(topdir) $(hdrdir)]
if !CROSS_COMPILING
case CONFIG['build_os']
when 'cygwin'
if CONFIG['target_os'] != 'cygwin'
- vpath = vpath.map {|p| p.sub(/.*/, '$(shell cygpath -u \&)')}
+ vpath.each {|p| p.sub!(/.*/, '$(shell cygpath -u \&)')}
end
+ when 'msdosdjgpp', 'mingw32'
+ CONFIG['PATH_SEPARATOR'] = ';'
end
end
- CONFIG["hdrdir"] ||= $hdrdir
mk << %{
SHELL = /bin/sh
#### Start of system configuration section. ####
-#{"top_srcdir = " + $top_srcdir.sub(%r"\A#{Regexp.quote($topdir)}/", "$(topdir)/") if $extmk}
-srcdir = #{srcdir.gsub(/\$\((srcdir)\)|\$\{(srcdir)\}/) {mkintpath(CONFIG[$1||$2])}.quote}
-topdir = #{mkintpath($extmk ? CONFIG["topdir"] : $topdir).quote}
-hdrdir = #{mkintpath(CONFIG["hdrdir"]).quote}
-arch_hdrdir = #{$arch_hdrdir}
+#{
+if $extmk
+ "top_srcdir = " + $top_srcdir.sub(%r"\A#{Regexp.quote($topdir)}/", "$(topdir)/")
+end
+}
+srcdir = #{srcdir.gsub(/\$\((srcdir)\)|\$\{(srcdir)\}/) {CONFIG[$1||$2]}.quote}
+topdir = #{($extmk ? CONFIG["topdir"] : $topdir).quote}
+hdrdir = #{$extmk ? CONFIG["hdrdir"].quote : '$(topdir)'}
VPATH = #{vpath.join(CONFIG['PATH_SEPARATOR'])}
}
if $extmk
- mk << "RUBYLIB = -\nRUBYOPT = -r$(top_srcdir)/ext/purelib.rb\n"
+ mk << "RUBYLIB = -\nRUBYOPT = -rpurelib.rb\n"
end
if destdir = CONFIG["prefix"][$dest_prefix_pattern, 1]
mk << "\nDESTDIR = #{destdir}\n"
@@ -1426,8 +1272,7 @@ VPATH = #{vpath.join(CONFIG['PATH_SEPARATOR'])}
end
CONFIG.each do |key, var|
next if /^abs_/ =~ key
- next if /^(?:src|top|hdr)dir$/ =~ key
- next unless /dir$/ =~ key
+ next unless /^(?:src|top|hdr|(.*))dir$/ =~ key and $1
mk << "#{key} = #{with_destdir(var)}\n"
end
if !$extmk and !$configure_args.has_key?('--ruby') and
@@ -1436,23 +1281,15 @@ VPATH = #{vpath.join(CONFIG['PATH_SEPARATOR'])}
else
sep = ""
end
- possible_command = (proc {|s| s if /top_srcdir/ !~ s} unless $extmk)
- extconf_h = $extconf_h ? "-DRUBY_EXTCONF_H=\\\"$(RUBY_EXTCONF_H)\\\" " : $defs.join(" ") << " "
+ extconf_h = $extconf_h ? "-DRUBY_EXTCONF_H=\\\"$(RUBY_EXTCONF_H)\\\" " : $defs.join(" ")<<" "
mk << %{
CC = #{CONFIG['CC']}
-CXX = #{CONFIG['CXX']}
LIBRUBY = #{CONFIG['LIBRUBY']}
LIBRUBY_A = #{CONFIG['LIBRUBY_A']}
LIBRUBYARG_SHARED = #$LIBRUBYARG_SHARED
LIBRUBYARG_STATIC = #$LIBRUBYARG_STATIC
-OUTFLAG = #{OUTFLAG}
-COUTFLAG = #{COUTFLAG}
RUBY_EXTCONF_H = #{$extconf_h}
-cflags = #{CONFIG['cflags']}
-optflags = #{CONFIG['optflags']}
-debugflags = #{CONFIG['debugflags']}
-warnflags = #{CONFIG['warnflags']}
CFLAGS = #{$static ? '' : CONFIG['CCDLFLAGS']} #$CFLAGS #$ARCH_FLAG
INCFLAGS = -I. #$INCFLAGS
DEFS = #{CONFIG['DEFS']}
@@ -1463,30 +1300,26 @@ dldflags = #{$DLDFLAGS}
archflag = #{$ARCH_FLAG}
DLDFLAGS = $(ldflags) $(dldflags) $(archflag)
LDSHARED = #{CONFIG['LDSHARED']}
-LDSHAREDXX = #{config_string('LDSHAREDXX') || '$(LDSHARED)'}
AR = #{CONFIG['AR']}
EXEEXT = #{CONFIG['EXEEXT']}
-RUBY_BASE_NAME = #{CONFIG['RUBY_BASE_NAME']}
RUBY_INSTALL_NAME = #{CONFIG['RUBY_INSTALL_NAME']}
RUBY_SO_NAME = #{CONFIG['RUBY_SO_NAME']}
arch = #{CONFIG['arch']}
sitearch = #{CONFIG['sitearch']}
-ruby_version = #{RbConfig::CONFIG['ruby_version']}
+ruby_version = #{Config::CONFIG['ruby_version']}
ruby = #{$ruby}
RUBY = $(ruby#{sep})
-RM = #{config_string('RM', &possible_command) || '$(RUBY) -run -e rm -- -f'}
-RM_RF = #{'$(RUBY) -run -e rm -- -rf'}
-RMDIRS = #{config_string('RMDIRS', &possible_command) || '$(RUBY) -run -e rmdir -- -p'}
-MAKEDIRS = #{config_string('MAKEDIRS', &possible_command) || '@$(RUBY) -run -e mkdir -- -p'}
-INSTALL = #{config_string('INSTALL', &possible_command) || '@$(RUBY) -run -e install -- -vp'}
+RM = #{config_string('RM') || '$(RUBY) -run -e rm -- -f'}
+MAKEDIRS = #{config_string('MAKEDIRS') || '@$(RUBY) -run -e mkdir -- -p'}
+INSTALL = #{config_string('INSTALL') || '@$(RUBY) -run -e install -- -vp'}
INSTALL_PROG = #{config_string('INSTALL_PROG') || '$(INSTALL) -m 0755'}
INSTALL_DATA = #{config_string('INSTALL_DATA') || '$(INSTALL) -m 0644'}
-COPY = #{config_string('CP', &possible_command) || '@$(RUBY) -run -e cp -- -v'}
+COPY = #{config_string('CP') || '@$(RUBY) -run -e cp -- -v'}
#### End of system configuration section. ####
-preload = #{defined?($preload) && $preload ? $preload.join(' ') : ''}
+preload = #{$preload ? $preload.join(' ') : ''}
}
if $nmake == ?b
mk.each do |x|
@@ -1499,7 +1332,6 @@ preload = #{defined?($preload) && $preload ? $preload.join(' ') : ''}
end
mk
end
-# :startdoc:
def dummy_makefile(srcdir)
configuration(srcdir) << <<RULES << CLEANINGS
@@ -1507,67 +1339,10 @@ CLEANFILES = #{$cleanfiles.join(' ')}
DISTCLEANFILES = #{$distcleanfiles.join(' ')}
all install static install-so install-rb: Makefile
-.PHONY: all install static install-so install-rb
-.PHONY: clean clean-so clean-rb
RULES
end
-
-def depend_rules(depend)
- suffixes = []
- depout = []
- cont = implicit = nil
- impconv = proc do
- COMPILE_RULES.each {|rule| depout << (rule % implicit[0]) << implicit[1]}
- implicit = nil
- end
- ruleconv = proc do |line|
- if implicit
- if /\A\t/ =~ line
- implicit[1] << line
- next
- else
- impconv[]
- end
- end
- if m = /\A\.(\w+)\.(\w+)(?:\s*:)/.match(line)
- suffixes << m[1] << m[2]
- implicit = [[m[1], m[2]], [m.post_match]]
- next
- elsif RULE_SUBST and /\A(?!\s*\w+\s*=)[$\w][^#]*:/ =~ line
- line.gsub!(%r"(\s)(?!\.)([^$(){}+=:\s\/\\,]+)(?=\s|\z)") {$1 + RULE_SUBST % $2}
- end
- depout << line
- end
- depend.each_line do |line|
- line.gsub!(/\.o\b/, ".#{$OBJEXT}")
- line.gsub!(/\$\((?:hdr|top)dir\)\/config.h/, $config_h)
- line.gsub!(%r"\$\(hdrdir\)/(?!ruby(?![^:;/\s]))(?=[-\w]+\.h)", '\&ruby/')
- if $nmake && /\A\s*\$\(RM|COPY\)/ =~ line
- line.gsub!(%r"[-\w\./]{2,}"){$&.tr("/", "\\")}
- line.gsub!(/(\$\((?!RM|COPY)[^:)]+)(?=\))/, '\1:/=\\')
- end
- if /(?:^|[^\\])(?:\\\\)*\\$/ =~ line
- (cont ||= []) << line
- next
- elsif cont
- line = (cont << line).join
- cont = nil
- end
- ruleconv.call(line)
- end
- if cont
- ruleconv.call(cont.join)
- elsif implicit
- impconv.call
- end
- unless suffixes.empty?
- depout.unshift(".SUFFIXES: ." + suffixes.uniq.join(" .") + "\n\n")
- end
- depout.unshift("$(OBJS): $(RUBY_EXTCONF_H)\n\n") if $extconf_h
- depout.flatten!
- depout
-end
+# :startdoc:
# Generates the Makefile for your extension, passing along any options and
# preprocessor constants that you may have generated through other methods.
@@ -1593,7 +1368,7 @@ end
# Makefile.
#
# Setting the +target_prefix+ will, in turn, install the generated binary in
-# a directory under your RbConfig::CONFIG['sitearchdir'] that mimics your local
+# a directory under your Config::CONFIG['sitearchdir'] that mimics your local
# filesystem when you run 'make install'.
#
# For example, given the following file tree:
@@ -1641,59 +1416,49 @@ def create_makefile(target, srcprefix = nil)
end
srcprefix ||= '$(srcdir)'
- RbConfig::expand(srcdir = srcprefix.dup)
+ Config::expand(srcdir = srcprefix.dup)
- ext = ".#{$OBJEXT}"
if not $objs
- srcs = $srcs || Dir[File.join(srcdir, "*.{#{SRC_EXT.join(%q{,})}}")]
- objs = srcs.inject(Hash.new {[]}) {|h, f| h[File.basename(f, ".*") << ext] <<= f; h}
- $objs = objs.keys
- unless objs.delete_if {|b, f| f.size == 1}.empty?
- dups = objs.sort.map {|b, f|
- "#{b[/.*\./]}{#{f.collect {|n| n[/([^.]+)\z/]}.join(',')}}"
- }
- abort "source files duplication - #{dups.join(", ")}"
+ $objs = []
+ srcs = Dir[File.join(srcdir, "*.{#{SRC_EXT.join(%q{,})}}")]
+ for f in srcs
+ obj = File.basename(f, ".*") << ".o"
+ $objs.push(obj) unless $objs.index(obj)
end
- else
- $objs.collect! {|o| File.basename(o, ".*") << ext} unless $OBJEXT == "o"
- srcs = $srcs || $objs.collect {|o| o.chomp(ext) << ".c"}
+ elsif !(srcs = $srcs)
+ srcs = $objs.collect {|obj| obj.sub(/\.o\z/, '.c')}
end
$srcs = srcs
+ for i in $objs
+ i.sub!(/\.o\z/, ".#{$OBJEXT}")
+ end
+ $objs = $objs.join(" ")
- target = nil if $objs.empty?
+ target = nil if $objs == ""
if target and EXPORT_PREFIX
if File.exist?(File.join(srcdir, target + '.def'))
deffile = "$(srcdir)/$(TARGET).def"
unless EXPORT_PREFIX.empty?
- makedef = %{-pe "$_.sub!(/^(?=\\w)/,'#{EXPORT_PREFIX}') unless 1../^EXPORTS$/i"}
+ makedef = %{-pe "sub!(/^(?=\\w)/,'#{EXPORT_PREFIX}') unless 1../^EXPORTS$/i"}
end
else
makedef = %{-e "puts 'EXPORTS', '#{EXPORT_PREFIX}Init_$(TARGET)'"}
end
if makedef
- $cleanfiles << '$(DEFFILE)'
+ $distcleanfiles << '$(DEFFILE)'
origdef = deffile
deffile = "$(TARGET)-$(arch).def"
end
end
origdef ||= ''
- if $extout and $INSTALLFILES
- $cleanfiles.concat($INSTALLFILES.collect {|files, dir|File.join(dir, files.sub(/\A\.\//, ''))})
- $distcleandirs.concat($INSTALLFILES.collect {|files, dir| dir})
- end
-
- if $extmk and not $extconf_h
- create_header
- end
-
libpath = libpathflag(libpath)
dllib = target ? "$(TARGET).#{CONFIG['DLEXT']}" : ""
staticlib = target ? "$(TARGET).#$LIBEXT" : ""
mfile = open("Makefile", "wb")
- mfile.print(*configuration(srcprefix))
+ mfile.print configuration(srcprefix)
mfile.print "
libpath = #{($DEFLIBPATH|$LIBPATH).join(" ")}
LIBPATH = #{libpath}
@@ -1701,47 +1466,31 @@ DEFFILE = #{deffile}
CLEANFILES = #{$cleanfiles.join(' ')}
DISTCLEANFILES = #{$distcleanfiles.join(' ')}
-DISTCLEANDIRS = #{$distcleandirs.join(' ')}
-extout = #{$extout && $extout.quote}
+extout = #{$extout}
extout_prefix = #{$extout_prefix}
target_prefix = #{target_prefix}
LOCAL_LIBS = #{$LOCAL_LIBS}
LIBS = #{$LIBRUBYARG} #{$libs} #{$LIBS}
SRCS = #{srcs.collect(&File.method(:basename)).join(' ')}
-OBJS = #{$objs.join(" ")}
+OBJS = #{$objs}
TARGET = #{target}
DLLIB = #{dllib}
EXTSTATIC = #{$static || ""}
STATIC_LIB = #{staticlib unless $static.nil?}
#{!$extout && defined?($installed_list) ? "INSTALLED_LIST = #{$installed_list}\n" : ""}
-" #"
- # TODO: fixme
+"
install_dirs.each {|d| mfile.print("%-14s= %s\n" % d) if /^[[:upper:]]/ =~ d[0]}
- n = ($extout ? '$(RUBYARCHDIR)/' : '') + '$(TARGET)'
+ 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
+CLEANLIBS = #{n}#{CONFIG['DLEXT']} #{n}il? #{n}tds #{n}map
+CLEANOBJS = *.#{$OBJEXT} *.#{$LIBEXT} *.s[ol] *.pdb *.exp *.bak
-all: #{$extout ? "install" : target ? "$(DLLIB)" : "Makefile"}
-static: $(STATIC_LIB)#{$extout ? " install-rb" : ""}
-.PHONY: all install static install-so install-rb
-.PHONY: clean clean-so clean-rb
+all: #{$extout ? "install" : target ? "$(DLLIB)" : "Makefile"}
+static: $(STATIC_LIB)#{$extout ? " install-rb" : ""}
"
mfile.print CLEANINGS
- fsep = config_string('BUILD_FILE_SEPARATOR') {|s| s unless s == "/"}
- if fsep
- sep = ":/=#{fsep}"
- fseprepl = proc {|s|
- s = s.gsub("/", fsep)
- s = s.gsub(/(\$\(\w+)(\))/) {$1+sep+$2}
- s = s.gsub(/(\$\{\w+)(\})/) {$1+sep+$2}
- }
- else
- fseprepl = proc {|s| s}
- sep = ""
- end
dirs = []
mfile.print "install: install-so install-rb\n\n"
sodir = (dir = "$(RUBYARCHDIR)").dup
@@ -1750,13 +1499,18 @@ static: $(STATIC_LIB)#{$extout ? " install-rb" : ""}
f = "$(DLLIB)"
dest = "#{dir}/#{f}"
mfile.puts dir, "install-so: #{dest}"
- if $extout
- mfile.print "clean-so::\n"
- mfile.print "\t@-$(RM) #{fseprepl[dest]}\n"
- mfile.print "\t@-$(RMDIRS) #{fseprepl[dir]}\n"
- else
- mfile.print "#{dest}: #{dir} #{f}\n"
- mfile.print "\t$(INSTALL_PROG) #{fseprepl[f]} #{fseprepl[dir]}\n"
+ unless $extout
+ mfile.print "#{dest}: #{f}\n"
+ if (sep = config_string('BUILD_FILE_SEPARATOR'))
+ f.gsub!("/", sep)
+ dir.gsub!("/", sep)
+ sep = ":/="+sep
+ f.gsub!(/(\$\(\w+)(\))/) {$1+sep+$2}
+ f.gsub!(/(\$\{\w+)(\})/) {$1+sep+$2}
+ dir.gsub!(/(\$\(\w+)(\))/) {$1+sep+$2}
+ dir.gsub!(/(\$\{\w+)(\})/) {$1+sep+$2}
+ end
+ mfile.print "\t$(INSTALL_PROG) #{f} #{dir}\n"
if defined?($installed_list)
mfile.print "\t@echo #{dir}/#{File.basename(f)}>>$(INSTALLED_LIST)\n"
end
@@ -1775,32 +1529,28 @@ static: $(STATIC_LIB)#{$extout ? " install-rb" : ""}
dirs << dir
mfile.print "pre-install-rb#{sfx}: #{dir}\n"
end
- for f in files
+ files.each do |f|
dest = "#{dir}/#{File.basename(f)}"
mfile.print("install-rb#{sfx}: #{dest}\n")
mfile.print("#{dest}: #{f} #{dir}\n\t$(#{$extout ? 'COPY' : 'INSTALL_DATA'}) ")
- mfile.print("#{f} $(@D)\n")
+ sep = config_string('BUILD_FILE_SEPARATOR')
+ if sep
+ f = f.gsub("/", sep)
+ sep = ":/="+sep
+ f = f.gsub(/(\$\(\w+)(\))/) {$1+sep+$2}
+ f = f.gsub(/(\$\{\w+)(\})/) {$1+sep+$2}
+ else
+ sep = ""
+ end
+ mfile.print("#{f} $(@D#{sep})\n")
if defined?($installed_list) and !$extout
mfile.print("\t@echo #{dest}>>$(INSTALLED_LIST)\n")
end
- if $extout
- mfile.print("clean-rb#{sfx}::\n")
- mfile.print("\t@-$(RM) #{fseprepl[dest]}\n")
- end
- end
- end
- if $extout
- dirs.uniq!
- unless dirs.empty?
- mfile.print("clean-rb#{sfx}::\n")
- for dir in dirs.sort_by {|d| -d.count('/')}
- mfile.print("\t@-$(RMDIRS) #{fseprepl[dir]}\n")
- end
end
end
end
dirs.unshift(sodir) if target and !dirs.include?(sodir)
- dirs.each {|d| mfile.print "#{d}:\n\t$(MAKEDIRS) $@\n"}
+ dirs.each {|dir| mfile.print "#{dir}:\n\t$(MAKEDIRS) $@\n"}
mfile.print <<-SITEINSTALL
@@ -1833,15 +1583,12 @@ site-install-rb: install-rb
mfile.print "$(DLLIB): "
mfile.print "$(DEFFILE) " if makedef
mfile.print "$(OBJS) Makefile\n"
- mfile.print "\t@-$(RM) $(@#{sep})\n"
+ mfile.print "\t@-$(RM) $@\n"
mfile.print "\t@-$(MAKEDIRS) $(@D)\n" if $extout
link_so = LINK_SO.gsub(/^/, "\t")
- if srcs.any?(&%r"\.(?:#{CXX_EXT.join('|')})\z".method(:===))
- link_so = link_so.sub(/\bLDSHARED\b/, '\&XX')
- end
mfile.print link_so, "\n\n"
unless $static.nil?
- mfile.print "$(STATIC_LIB): $(OBJS)\n\t@-$(RM) $(@#{sep})\n\t"
+ mfile.print "$(STATIC_LIB): $(OBJS)\n\t"
mfile.print "$(AR) #{config_string('ARFLAGS') || 'cru '}$@ $(OBJS)"
config_string('RANLIB') do |ranlib|
mfile.print "\n\t@-#{ranlib} $(DLLIB) 2> /dev/null || true"
@@ -1855,14 +1602,63 @@ site-install-rb: install-rb
depend = File.join(srcdir, "depend")
if File.exist?(depend)
- mfile.print("###\n", *depend_rules(File.read(depend)))
+ suffixes = []
+ depout = []
+ open(depend, "r") do |dfile|
+ mfile.printf "###\n"
+ cont = implicit = nil
+ impconv = proc do
+ COMPILE_RULES.each {|rule| depout << (rule % implicit[0]) << implicit[1]}
+ implicit = nil
+ end
+ ruleconv = proc do |line|
+ if implicit
+ if /\A\t/ =~ line
+ implicit[1] << line
+ next
+ else
+ impconv[]
+ end
+ end
+ if m = /\A\.(\w+)\.(\w+)(?:\s*:)/.match(line)
+ suffixes << m[1] << m[2]
+ implicit = [[m[1], m[2]], [m.post_match]]
+ next
+ elsif RULE_SUBST and /\A(?!\s*\w+\s*=)[$\w][^#]*:/ =~ line
+ line.gsub!(%r"(\s)(?!\.)([^$(){}+=:\s\/\\,]+)(?=\s|\z)") {$1 + RULE_SUBST % $2}
+ end
+ depout << line
+ end
+ while line = dfile.gets()
+ line.gsub!(/\.o\b/, ".#{$OBJEXT}")
+ line.gsub!(/\$\((?:hdr|top)dir\)\/config.h/, $config_h) if $config_h
+ if /(?:^|[^\\])(?:\\\\)*\\$/ =~ line
+ (cont ||= []) << line
+ next
+ elsif cont
+ line = (cont << line).join
+ cont = nil
+ end
+ ruleconv.call(line)
+ end
+ if cont
+ ruleconv.call(cont.join)
+ elsif implicit
+ impconv.call
+ end
+ end
+ unless suffixes.empty?
+ mfile.print ".SUFFIXES: .", suffixes.uniq.join(" ."), "\n\n"
+ end
+ mfile.print "$(OBJS): $(RUBY_EXTCONF_H)\n\n" if $extconf_h
+ mfile.print depout
else
- headers = %w[$(hdrdir)/ruby.h $(hdrdir)/ruby/defines.h]
+ headers = %w[ruby.h defines.h]
if RULE_SUBST
- headers.each {|h| h.sub!(/.*/, &RULE_SUBST.method(:%))}
+ headers.each {|h| h.sub!(/.*/) {|*m| RULE_SUBST % m}}
end
- headers << $config_h
- headers << '$(RUBY_EXTCONF_H)' if $extconf_h
+ headers << $config_h if $config_h
+ headers << "$(RUBY_EXTCONF_H)" if $extconf_h
mfile.print "$(OBJS): ", headers.join(' '), "\n"
end
@@ -1883,9 +1679,7 @@ def init_mkmf(config = CONFIG)
$ARCH_FLAG = with_config("arch_flag", arg_config("ARCH_FLAG", config["ARCH_FLAG"])).dup
$CPPFLAGS = with_config("cppflags", arg_config("CPPFLAGS", config["CPPFLAGS"])).dup
$LDFLAGS = with_config("ldflags", arg_config("LDFLAGS", config["LDFLAGS"])).dup
- $INCFLAGS = "-I$(arch_hdrdir)"
- $INCFLAGS << " -I$(hdrdir)/ruby/backward" unless $extmk
- $INCFLAGS << " -I$(hdrdir) -I$(srcdir)"
+ $INCFLAGS = "-I$(topdir) -I$(hdrdir) -I$(srcdir)"
$DLDFLAGS = with_config("dldflags", arg_config("DLDFLAGS", config["DLDFLAGS"])).dup
$LIBEXT = config['LIBEXT'].dup
$OBJEXT = config["OBJEXT"].dup
@@ -1893,17 +1687,16 @@ def init_mkmf(config = CONFIG)
$LIBRUBYARG = ""
$LIBRUBYARG_STATIC = config['LIBRUBYARG_STATIC']
$LIBRUBYARG_SHARED = config['LIBRUBYARG_SHARED']
- $DEFLIBPATH = [$extmk ? "$(topdir)" : "$(libdir)"]
+ $DEFLIBPATH = $extmk ? ["$(topdir)"] : CROSS_COMPILING ? [] : ["$(libdir)"]
$DEFLIBPATH.unshift(".")
$LIBPATH = []
$INSTALLFILES = []
$NONINSTALLFILES = [/~\z/, /\A#.*#\z/, /\A\.#/, /\.bak\z/i, /\.orig\z/, /\.rej\z/, /\.l[ao]\z/, /\.o\z/]
- $VPATH = %w[$(srcdir) $(arch_hdrdir)/ruby $(hdrdir)/ruby]
$objs = nil
$srcs = nil
$libs = ""
- if $enable_shared or RbConfig.expand(config["LIBRUBY"].dup) != RbConfig.expand(config["LIBRUBY_A"].dup)
+ if $enable_shared or Config.expand(config["LIBRUBY"].dup) != Config.expand(config["LIBRUBY_A"].dup)
$LIBRUBYARG = config['LIBRUBYARG']
end
@@ -1912,7 +1705,6 @@ def init_mkmf(config = CONFIG)
$cleanfiles = config_string('CLEANFILES') {|s| Shellwords.shellwords(s)} || []
$cleanfiles << "mkmf.log"
$distcleanfiles = config_string('DISTCLEANFILES') {|s| Shellwords.shellwords(s)} || []
- $distcleandirs = config_string('DISTCLEANDIRS') {|s| Shellwords.shellwords(s)} || []
$extout ||= nil
$extout_prefix ||= nil
@@ -1955,41 +1747,41 @@ when $bccwin
$nmake = ?b if /Borland/i =~ `#{make} -h`
end
-RbConfig::CONFIG["srcdir"] = CONFIG["srcdir"] =
+Config::CONFIG["srcdir"] = CONFIG["srcdir"] =
$srcdir = arg_config("--srcdir", File.dirname($0))
$configure_args["--topsrcdir"] ||= $srcdir
if $curdir = arg_config("--curdir")
- RbConfig.expand(curdir = $curdir.dup)
+ Config.expand(curdir = $curdir.dup)
else
curdir = $curdir = "."
end
-unless File.expand_path(RbConfig::CONFIG["topdir"]) == File.expand_path(curdir)
+unless File.expand_path(Config::CONFIG["topdir"]) == File.expand_path(curdir)
CONFIG["topdir"] = $curdir
- RbConfig::CONFIG["topdir"] = curdir
+ Config::CONFIG["topdir"] = curdir
end
$configure_args["--topdir"] ||= $curdir
-$ruby = arg_config("--ruby", File.join(RbConfig::CONFIG["bindir"], CONFIG["ruby_install_name"]))
+$ruby = arg_config("--ruby", File.join(Config::CONFIG["bindir"], CONFIG["ruby_install_name"]))
split = Shellwords.method(:shellwords).to_proc
EXPORT_PREFIX = config_string('EXPORT_PREFIX') {|s| s.strip}
-hdr = ['#include "ruby.h"' "\n"]
+hdr = []
config_string('COMMON_MACROS') do |s|
Shellwords.shellwords(s).each do |w|
hdr << "#define " + w.split(/=/, 2).join(" ")
end
end
config_string('COMMON_HEADERS') do |s|
- Shellwords.shellwords(s).each {|w| hdr << "#include <#{w}>"}
+ Shellwords.shellwords(s).each {|s| hdr << "#include <#{s}>"}
end
COMMON_HEADERS = hdr.join("\n")
COMMON_LIBS = config_string('COMMON_LIBS', &split) || []
COMPILE_RULES = config_string('COMPILE_RULES', &split) || %w[.%s.%s:]
RULE_SUBST = config_string('RULE_SUBST')
-COMPILE_C = config_string('COMPILE_C') || '$(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -c $<'
-COMPILE_CXX = config_string('COMPILE_CXX') || '$(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $<'
+COMPILE_C = config_string('COMPILE_C') || '$(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) -c $<'
+COMPILE_CXX = config_string('COMPILE_CXX') || '$(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) -c $<'
TRY_LINK = config_string('TRY_LINK') ||
"$(CC) #{OUTFLAG}conftest $(INCFLAGS) $(CPPFLAGS) " \
"$(CFLAGS) $(src) $(LIBPATH) $(LDFLAGS) $(ARCH_FLAG) $(LOCAL_LIBS) $(LIBS)"
@@ -2003,27 +1795,17 @@ LINK_SO = config_string('LINK_SO') ||
LIBPATHFLAG = config_string('LIBPATHFLAG') || ' -L"%s"'
RPATHFLAG = config_string('RPATHFLAG') || ''
LIBARG = config_string('LIBARG') || '-l%s'
-MAIN_DOES_NOTHING = config_string('MAIN_DOES_NOTHING') || 'int main() {return 0;}'
-UNIVERSAL_INTS = config_string('UNIVERSAL_INTS') {|s| Shellwords.shellwords(s)} ||
- %w[int short long long\ long]
-sep = config_string('BUILD_FILE_SEPARATOR') {|s| ":/=#{s}" if s != "/"} || ""
+sep = config_string('BUILD_FILE_SEPARATOR') {|sep| ":/=#{sep}" if sep != "/"} || ""
CLEANINGS = "
-clean-rb-default::
-clean-rb::
-clean-so::
-clean: clean-so clean-rb-default clean-rb
-\t\t@-$(RM) $(CLEANLIBS#{sep}) $(CLEANOBJS#{sep}) $(CLEANFILES#{sep})
-
-distclean-rb-default::
-distclean-rb::
-distclean-so::
-distclean: clean distclean-so distclean-rb-default distclean-rb
-\t\t@-$(RM) Makefile $(RUBY_EXTCONF_H) conftest.* mkmf.log
-\t\t@-$(RM) core ruby$(EXEEXT) *~ $(DISTCLEANFILES#{sep})
-\t\t@-$(RMDIRS) $(DISTCLEANDIRS#{sep})
-
-realclean: distclean
+clean:
+ @-$(RM) $(CLEANLIBS#{sep}) $(CLEANOBJS#{sep}) $(CLEANFILES#{sep})
+
+distclean: clean
+ @-$(RM) Makefile $(RUBY_EXTCONF_H) conftest.* mkmf.log
+ @-$(RM) core ruby$(EXEEXT) *~ $(DISTCLEANFILES#{sep})
+
+realclean: distclean
"
if not $extmk and /\A(extconf|makefile).rb\z/ =~ File.basename($0)
diff --git a/lib/monitor.rb b/lib/monitor.rb
index b9bf28ded0..4c146c8086 100644
--- a/lib/monitor.rb
+++ b/lib/monitor.rb
@@ -12,11 +12,11 @@ You can freely distribute/modify this library.
This is a simple example.
require 'monitor.rb'
-
+
buf = []
buf.extend(MonitorMixin)
empty_cond = buf.new_cond
-
+
# consumer
Thread.start do
loop do
@@ -26,7 +26,7 @@ This is a simple example.
end
end
end
-
+
# producer
while line = ARGF.gets
buf.synchronize do
@@ -41,19 +41,18 @@ reads a line from ARGF and push it to buf, then call
empty_cond.signal.
=end
-
-require 'thread'
+
#
# Adds monitor functionality to an arbitrary object by mixing the module with
# +include+. For example:
#
-# require 'monitor'
-#
+# require 'monitor.rb'
+#
# buf = []
# buf.extend(MonitorMixin)
# empty_cond = buf.new_cond
-#
+#
# # consumer
# Thread.start do
# loop do
@@ -63,7 +62,7 @@ require 'thread'
# end
# end
# end
-#
+#
# # producer
# while line = ARGF.gets
# buf.synchronize do
@@ -71,7 +70,7 @@ require 'thread'
# empty_cond.signal
# end
# end
-#
+#
# The consumer thread waits for the producer thread to push a line
# to buf while buf.empty?, and the producer thread (main thread)
# reads a line from ARGF and push it to buf, then call
@@ -86,72 +85,123 @@ module MonitorMixin
#
class ConditionVariable
class Timeout < Exception; end
-
+
+ # Create a new timer with the argument timeout, and add the
+ # current thread to the list of waiters. Then the thread is
+ # stopped. It will be resumed when a corresponding #signal
+ # occurs.
def wait(timeout = nil)
- if timeout
- raise NotImplementedError, "timeout is not implemented yet"
- end
- @monitor.__send__(:mon_check_owner)
- count = @monitor.__send__(:mon_exit_for_cond)
+ @monitor.instance_eval {mon_check_owner()}
+ timer = create_timer(timeout)
+
+ Thread.critical = true
+ count = @monitor.instance_eval {mon_exit_for_cond()}
+ @waiters.push(Thread.current)
+
begin
- @cond.wait(@monitor.instance_variable_get("@mon_mutex"))
+ Thread.stop
return true
+ rescue Timeout
+ return false
ensure
- @monitor.__send__(:mon_enter_for_cond, count)
+ Thread.critical = true
+ begin
+ if timer && timer.alive?
+ Thread.kill(timer)
+ end
+ if @waiters.include?(Thread.current) # interrupted?
+ @waiters.delete(Thread.current)
+ end
+ @monitor.instance_eval {mon_enter_for_cond(count)}
+ ensure
+ Thread.critical = false
+ end
end
end
+
+ # call #wait while the supplied block returns +true+.
def wait_while
while yield
wait
end
end
-
+
+ # call #wait until the supplied block returns +true+.
def wait_until
until yield
wait
end
end
-
+
+ # Wake up and run the next waiter
def signal
- @monitor.__send__(:mon_check_owner)
- @cond.signal
+ @monitor.instance_eval {mon_check_owner()}
+ Thread.critical = true
+ t = @waiters.shift
+ t.wakeup if t
+ Thread.critical = false
+ Thread.pass
end
-
+
+ # Wake up all the waiters.
def broadcast
- @monitor.__send__(:mon_check_owner)
- @cond.broadcast
+ @monitor.instance_eval {mon_check_owner()}
+ Thread.critical = true
+ for t in @waiters
+ t.wakeup
+ end
+ @waiters.clear
+ Thread.critical = false
+ Thread.pass
end
-
+
def count_waiters
- raise NotImplementedError
+ return @waiters.length
end
-
+
private
def initialize(monitor)
@monitor = monitor
- @cond = ::ConditionVariable.new
+ @waiters = []
end
- end
+ def create_timer(timeout)
+ if timeout
+ waiter = Thread.current
+ return Thread.start {
+ Thread.pass
+ sleep(timeout)
+ Thread.critical = true
+ waiter.raise(Timeout.new)
+ }
+ else
+ return nil
+ end
+ end
+ end
+
def self.extend_object(obj)
super(obj)
- obj.__send__(:mon_initialize)
+ obj.instance_eval {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
+ result = false
+ Thread.critical = true
+ if @mon_owner.nil?
@mon_owner = Thread.current
end
- @mon_count += 1
- return true
+ if @mon_owner == Thread.current
+ @mon_count += 1
+ result = true
+ end
+ Thread.critical = false
+ return result
end
# For backward compatibility
alias try_mon_enter mon_try_enter
@@ -160,23 +210,25 @@ module MonitorMixin
# Enters exclusive section.
#
def mon_enter
- if @mon_owner != Thread.current
- @mon_mutex.lock
- @mon_owner = Thread.current
- end
+ Thread.critical = true
+ mon_acquire(@mon_entering_queue)
@mon_count += 1
+ ensure
+ Thread.critical = false
end
-
+
#
# Leaves exclusive section.
#
def mon_exit
mon_check_owner
- @mon_count -=1
+ Thread.critical = true
+ @mon_count -= 1
if @mon_count == 0
- @mon_owner = nil
- @mon_mutex.unlock
+ mon_release
end
+ Thread.critical = false
+ Thread.pass
end
#
@@ -193,9 +245,12 @@ module MonitorMixin
end
end
alias synchronize mon_synchronize
-
+
#
# FIXME: This isn't documented in Nutshell.
+ #
+ # Create a new condition variable for this monitor.
+ # This facilitates control of the monitor with #signal and #wait.
#
def new_cond
return ConditionVariable.new(self)
@@ -208,31 +263,63 @@ module MonitorMixin
mon_initialize
end
+ # called by initialize method to set defaults for instance variables.
def mon_initialize
@mon_owner = nil
@mon_count = 0
- @mon_mutex = Mutex.new
+ @mon_entering_queue = []
+ @mon_waiting_queue = []
end
+ # Throw a ThreadError exception if the current thread
+ # does't own the monitor
def mon_check_owner
if @mon_owner != Thread.current
raise ThreadError, "current thread not owner"
end
end
- def mon_enter_for_cond(count)
+ def mon_acquire(queue)
+ while @mon_owner && @mon_owner != Thread.current
+ queue.push(Thread.current)
+ Thread.stop
+ Thread.critical = true
+ end
@mon_owner = Thread.current
+ end
+
+ def mon_release
+ @mon_owner = nil
+ t = @mon_waiting_queue.shift
+ t = @mon_entering_queue.shift unless t
+ t.wakeup if t
+ end
+
+ def mon_enter_for_cond(count)
+ mon_acquire(@mon_waiting_queue)
@mon_count = count
end
def mon_exit_for_cond
count = @mon_count
- @mon_owner = nil
@mon_count = 0
return count
+ ensure
+ mon_release
end
end
+# Monitors provide means of mutual exclusion for Thread programming.
+# A critical region is created by means of the synchronize method,
+# which takes a block.
+# The condition variables (created with #new_cond) may be used
+# to control the execution of a monitor with #signal and #wait.
+#
+# the Monitor class wraps MonitorMixin, and provides aliases
+# alias try_enter try_mon_enter
+# alias enter mon_enter
+# alias exit mon_exit
+# to access its methods more concisely.
class Monitor
include MonitorMixin
alias try_enter try_mon_enter
diff --git a/lib/mutex_m.rb b/lib/mutex_m.rb
index 21d828523e..8e0d42bc8d 100644
--- a/lib/mutex_m.rb
+++ b/lib/mutex_m.rb
@@ -1,29 +1,32 @@
-#
-# mutex_m.rb -
+#--
+# mutex_m.rb -
# $Release Version: 3.0$
# $Revision: 1.7 $
+# $Date: 1998/02/27 04:28:57 $
# Original from mutex.rb
# by Keiju ISHITSUKA(keiju@ishitsuka.com)
# modified by matz
# patched by akira yamada
+#++
#
-# --
-# Usage:
-# require "mutex_m.rb"
-# obj = Object.new
-# obj.extend Mutex_m
-# ...
-# extended object can be handled like Mutex
-# or
-# class Foo
-# include Mutex_m
-# ...
-# end
-# obj = Foo.new
-# this obj can be handled like Mutex
+# == Usage
#
-
-require 'thread'
+# Extend an object and use it like a Mutex object:
+#
+# require "mutex_m.rb"
+# obj = Object.new
+# obj.extend Mutex_m
+# # ...
+#
+# Or, include Mutex_m in a class to have its instances behave like a Mutex
+# object:
+#
+# class Foo
+# include Mutex_m
+# # ...
+# end
+#
+# obj = Foo.new
module Mutex_m
def Mutex_m.define_aliases(cl)
@@ -34,13 +37,13 @@ module Mutex_m
alias try_lock mu_try_lock
alias synchronize mu_synchronize
}
- end
+ end
def Mutex_m.append_features(cl)
super
define_aliases(cl) unless cl.instance_of?(Module)
end
-
+
def Mutex_m.extend_object(obj)
super
obj.mu_extended
@@ -56,32 +59,60 @@ module Mutex_m
end
mu_initialize
end
-
- # locking
- def mu_synchronize(&block)
- @_mutex.synchronize(&block)
+
+ # locking
+ def mu_synchronize
+ begin
+ mu_lock
+ yield
+ ensure
+ mu_unlock
+ end
end
-
+
def mu_locked?
- @_mutex.locked?
+ @mu_locked
end
-
+
def mu_try_lock
- @_mutex.try_lock
+ result = false
+ Thread.critical = true
+ unless @mu_locked
+ @mu_locked = true
+ result = true
+ end
+ Thread.critical = false
+ result
end
-
+
def mu_lock
- @_mutex.lock
+ while (Thread.critical = true; @mu_locked)
+ @mu_waiting.push Thread.current
+ Thread.stop
+ end
+ @mu_locked = true
+ Thread.critical = false
+ self
end
-
+
def mu_unlock
- @_mutex.unlock
+ return unless @mu_locked
+ Thread.critical = true
+ wait = @mu_waiting
+ @mu_waiting = []
+ @mu_locked = false
+ Thread.critical = false
+ for w in wait
+ w.run
+ end
+ self
end
-
+
private
-
+
def mu_initialize
- @_mutex = Mutex.new
+ @mu_waiting = []
+ @mu_locked = false;
end
def initialize(*args)
diff --git a/lib/net/.document b/lib/net/.document
deleted file mode 100644
index 6332bb9e7e..0000000000
--- a/lib/net/.document
+++ /dev/null
@@ -1,8 +0,0 @@
-ftp.rb
-http.rb
-https.rb
-imap.rb
-pop.rb
-smtp.rb
-smtps.rb
-telnet.rb
diff --git a/lib/net/ftp.rb b/lib/net/ftp.rb
index 40227b69d8..e07418e83e 100644
--- a/lib/net/ftp.rb
+++ b/lib/net/ftp.rb
@@ -1,11 +1,11 @@
-#
+#
# = net/ftp.rb - FTP Client Library
-#
+#
# Written by Shugo Maeda <shugo@ruby-lang.org>.
#
# Documentation by Gavin Sinclair, sourced from "Programming Ruby" (Hunt/Thomas)
# and "Ruby In a Nutshell" (Matsumoto), used with permission.
-#
+#
# This library is distributed under the terms of the Ruby license.
# You can freely distribute/modify this library.
#
@@ -22,8 +22,8 @@ module Net
# :stopdoc:
class FTPError < StandardError; end
class FTPReplyError < FTPError; end
- class FTPTempError < FTPError; end
- class FTPPermError < FTPError; end
+ class FTPTempError < FTPError; end
+ class FTPPermError < FTPError; end
class FTPProtoError < FTPError; end
# :startdoc:
@@ -34,11 +34,11 @@ module Net
# advantage of Ruby's style and strengths.
#
# == Example
- #
+ #
# require 'net/ftp'
#
# === Example 1
- #
+ #
# ftp = Net::FTP.new('ftp.netlab.co.jp')
# ftp.login
# files = ftp.chdir('pub/lang/ruby/contrib')
@@ -71,15 +71,15 @@ module Net
#
class FTP
include MonitorMixin
-
+
# :stopdoc:
FTP_PORT = 21
CRLF = "\r\n"
DEFAULT_BLOCKSIZE = 4096
# :startdoc:
-
+
# When +true+, transfers are performed in binary mode. Default: +true+.
- attr_reader :binary
+ attr_accessor :binary
# When +true+, the connection is in passive mode. Default: +false+.
attr_accessor :passive
@@ -101,7 +101,7 @@ module Net
# The server's last response.
attr_reader :last_response
-
+
#
# A synonym for <tt>FTP.new</tt>, but with a mandatory host parameter.
#
@@ -120,7 +120,7 @@ module Net
new(host, user, passwd, acct)
end
end
-
+
#
# Creates and returns a new +FTP+ object. If a +host+ is given, a connection
# is made. Additionally, if the +user+ is given, the given user name,
@@ -128,7 +128,7 @@ module Net
#
def initialize(host = nil, user = nil, passwd = nil, acct = nil)
super()
- @binary = false
+ @binary = true
@passive = false
@debug_mode = false
@resume = false
@@ -140,24 +140,6 @@ module Net
end
end
- def binary=(newmode)
- if newmode != @binary
- @binary = newmode
- @binary ? voidcmd("TYPE I") : voidcmd("TYPE A")
- end
- end
-
- def with_binary(newmode)
- oldmode = binary
- self.binary = newmode
- begin
- yield
- ensure
- self.binary = oldmode
- end
- end
- private :with_binary
-
# Obsolete
def return_code
$stderr.puts("warning: Net::FTP#return_code is obsolete and do nothing")
@@ -178,7 +160,7 @@ module Net
end
end
private :open_socket
-
+
#
# Establishes an FTP connection to host, optionally overriding the default
# port. If the environment variable +SOCKS_SERVER+ is set, sets up the
@@ -215,7 +197,7 @@ module Net
end
end
private :sanitize
-
+
def putline(line)
if @debug_mode
print "put: ", sanitize(line), "\n"
@@ -224,7 +206,7 @@ module Net
@sock.write(line)
end
private :putline
-
+
def getline
line = @sock.readline # if get EOF, raise EOFError
line.sub!(/(\r\n|\n|\r)\z/n, "")
@@ -234,7 +216,7 @@ module Net
return line
end
private :getline
-
+
def getmultiline
line = getline
buff = line
@@ -248,7 +230,7 @@ module Net
return buff << "\n"
end
private :getmultiline
-
+
def getresp
@last_response = getmultiline
@last_response_code = @last_response[0, 3]
@@ -264,7 +246,7 @@ module Net
end
end
private :getresp
-
+
def voidresp
resp = getresp
if resp[0] != ?2
@@ -272,7 +254,7 @@ module Net
end
end
private :voidresp
-
+
#
# Sends a command and returns the response.
#
@@ -282,7 +264,7 @@ module Net
return getresp
end
end
-
+
#
# Sends a command and expect a response beginning with '2'.
#
@@ -292,7 +274,7 @@ module Net
voidresp
end
end
-
+
def sendport(host, port)
af = (@sock.peeraddr)[0]
if af == "AF_INET"
@@ -305,7 +287,7 @@ module Net
voidcmd(cmd)
end
private :sendport
-
+
def makeport
sock = TCPServer.open(@sock.addr[3], 0)
port = sock.addr[1]
@@ -314,7 +296,7 @@ module Net
return sock
end
private :makeport
-
+
def makepasv
if @sock.peeraddr[0] == "AF_INET"
host, port = parse227(sendcmd("PASV"))
@@ -325,13 +307,13 @@ module Net
return host, port
end
private :makepasv
-
+
def transfercmd(cmd, rest_offset = nil)
if @passive
host, port = makepasv
conn = open_socket(host, port)
if @resume and rest_offset
- resp = sendcmd("REST " + rest_offset.to_s)
+ resp = sendcmd("REST " + rest_offset.to_s)
if resp[0] != ?3
raise FTPReplyError, resp
end
@@ -345,7 +327,7 @@ module Net
else
sock = makeport
if @resume and rest_offset
- resp = sendcmd("REST " + rest_offset.to_s)
+ resp = sendcmd("REST " + rest_offset.to_s)
if resp[0] != ?3
raise FTPReplyError, resp
end
@@ -362,7 +344,7 @@ module Net
return conn
end
private :transfercmd
-
+
def getaddress
thishost = Socket.gethostname
if not thishost.index(".")
@@ -378,7 +360,7 @@ module Net
return realuser + "@" + thishost
end
private :getaddress
-
+
#
# Logs in to the remote host. The session must have been previously
# connected. If +user+ is the string "anonymous" and the +password+ is
@@ -391,7 +373,7 @@ module Net
if user == "anonymous" and passwd == nil
passwd = getaddress
end
-
+
resp = ""
synchronize do
resp = sendcmd('USER ' + user)
@@ -408,9 +390,8 @@ module Net
raise FTPReplyError, resp
end
@welcome = resp
- self.binary = true
end
-
+
#
# Puts the connection into binary (image) mode, issues the given command,
# and fetches the data returned, passing it to the associated block in
@@ -419,19 +400,18 @@ module Net
#
def retrbinary(cmd, blocksize, rest_offset = nil) # :yield: data
synchronize do
- with_binary(true) do
- conn = transfercmd(cmd, rest_offset)
- loop do
- data = conn.read(blocksize)
- break if data == nil
- yield(data)
- end
- conn.close
- voidresp
- end
+ voidcmd("TYPE I")
+ conn = transfercmd(cmd, rest_offset)
+ loop do
+ data = conn.read(blocksize)
+ break if data == nil
+ yield(data)
+ end
+ conn.close
+ voidresp
end
end
-
+
#
# Puts the connection into ASCII (text) mode, issues the given command, and
# passes the resulting data, one line at a time, to the associated block. If
@@ -440,24 +420,23 @@ module Net
#
def retrlines(cmd) # :yield: line
synchronize do
- with_binary(false) do
- conn = transfercmd(cmd)
- loop do
- line = conn.gets
- break if line == nil
- if line[-2, 2] == CRLF
- line = line[0 .. -3]
- elsif line[-1] == ?\n
- line = line[0 .. -2]
- end
- yield(line)
- end
- conn.close
- voidresp
- end
+ voidcmd("TYPE A")
+ conn = transfercmd(cmd)
+ loop do
+ line = conn.gets
+ break if line == nil
+ if line[-2, 2] == CRLF
+ line = line[0 .. -3]
+ elsif line[-1] == ?\n
+ line = line[0 .. -2]
+ end
+ yield(line)
+ end
+ conn.close
+ voidresp
end
end
-
+
#
# Puts the connection into binary (image) mode, issues the given server-side
# command (such as "STOR myfile"), and sends the contents of the file named
@@ -469,27 +448,19 @@ module Net
file.seek(rest_offset, IO::SEEK_SET)
end
synchronize do
- with_binary(true) do
- conn = transfercmd(cmd, rest_offset)
- loop do
- buf = file.read(blocksize)
- break if buf == nil
- conn.write(buf)
- yield(buf) if block
- end
- conn.close
- voidresp
- end
+ voidcmd("TYPE I")
+ conn = transfercmd(cmd, rest_offset)
+ loop do
+ buf = file.read(blocksize)
+ break if buf == nil
+ conn.write(buf)
+ yield(buf) if block
+ end
+ conn.close
+ voidresp
end
- rescue Errno::EPIPE
- # EPIPE, in this case, means that the data connection was unexpectedly
- # terminated. Rather than just raising EPIPE to the caller, check the
- # response on the control connection. If getresp doesn't raise a more
- # appropriate exception, re-raise the original exception.
- getresp
- raise
end
-
+
#
# Puts the connection into ASCII (text) mode, issues the given server-side
# command (such as "STOR myfile"), and sends the contents of the file
@@ -498,86 +469,61 @@ module Net
#
def storlines(cmd, file, &block) # :yield: line
synchronize do
- with_binary(false) do
- conn = transfercmd(cmd)
- loop do
- buf = file.gets
- break if buf == nil
- if buf[-2, 2] != CRLF
- buf = buf.chomp + CRLF
- end
- conn.write(buf)
- yield(buf) if block
- end
- conn.close
- voidresp
- end
+ voidcmd("TYPE A")
+ conn = transfercmd(cmd)
+ loop do
+ buf = file.gets
+ break if buf == nil
+ if buf[-2, 2] != CRLF
+ buf = buf.chomp + CRLF
+ end
+ conn.write(buf)
+ yield(buf) if block
+ end
+ conn.close
+ voidresp
end
- rescue Errno::EPIPE
- # EPIPE, in this case, means that the data connection was unexpectedly
- # terminated. Rather than just raising EPIPE to the caller, check the
- # response on the control connection. If getresp doesn't raise a more
- # appropriate exception, re-raise the original exception.
- getresp
- raise
end
#
# Retrieves +remotefile+ in binary mode, storing the result in +localfile+.
- # If +localfile+ is nil, returns retrieved data.
# If a block is supplied, it is passed the retrieved data in +blocksize+
# chunks.
#
def getbinaryfile(remotefile, localfile = File.basename(remotefile),
- blocksize = DEFAULT_BLOCKSIZE) # :yield: data
- result = nil
- if localfile
- if @resume
- rest_offset = File.size?(localfile)
- f = open(localfile, "a")
- else
- rest_offset = nil
- f = open(localfile, "w")
- end
- elsif !block_given?
- result = ""
+ blocksize = DEFAULT_BLOCKSIZE, &block) # :yield: data
+ if @resume
+ rest_offset = File.size?(localfile)
+ f = open(localfile, "a")
+ else
+ rest_offset = nil
+ f = open(localfile, "w")
end
begin
- f.binmode if localfile
+ f.binmode
retrbinary("RETR " + remotefile, blocksize, rest_offset) do |data|
- f.write(data) if localfile
- yield(data) if block_given?
- result.concat(data) if result
+ f.write(data)
+ yield(data) if block
end
- return result
ensure
- f.close if localfile
+ f.close
end
end
-
+
#
# Retrieves +remotefile+ in ASCII (text) mode, storing the result in
- # +localfile+.
- # If +localfile+ is nil, returns retrieved data.
- # If a block is supplied, it is passed the retrieved data one
+ # +localfile+. If a block is supplied, it is passed the retrieved data one
# line at a time.
#
- def gettextfile(remotefile, localfile = File.basename(remotefile)) # :yield: line
- result = nil
- if localfile
- f = open(localfile, "w")
- elsif !block_given?
- result = ""
- end
+ def gettextfile(remotefile, localfile = File.basename(remotefile), &block) # :yield: line
+ f = open(localfile, "w")
begin
retrlines("RETR " + remotefile) do |line|
- f.puts(line) if localfile
- yield(line) if block_given?
- result.concat(line + "\n") if result
+ f.puts(line)
+ yield(line) if block
end
- return result
ensure
- f.close if localfile
+ f.close
end
end
@@ -587,13 +533,13 @@ module Net
#
def get(remotefile, localfile = File.basename(remotefile),
blocksize = DEFAULT_BLOCKSIZE, &block) # :yield: data
- if @binary
- getbinaryfile(remotefile, localfile, blocksize, &block)
- else
+ unless @binary
gettextfile(remotefile, localfile, &block)
+ else
+ getbinaryfile(remotefile, localfile, blocksize, &block)
end
end
-
+
#
# Transfers +localfile+ to the server in binary mode, storing the result in
# +remotefile+. If a block is supplied, calls it, passing in the transmitted
@@ -618,7 +564,7 @@ module Net
f.close
end
end
-
+
#
# Transfers +localfile+ to the server in ASCII (text) mode, storing the result
# in +remotefile+. If callback or an associated block is supplied, calls it,
@@ -639,10 +585,10 @@ module Net
#
def put(localfile, remotefile = File.basename(localfile),
blocksize = DEFAULT_BLOCKSIZE, &block)
- if @binary
- putbinaryfile(localfile, remotefile, blocksize, &block)
- else
+ unless @binary
puttextfile(localfile, remotefile, &block)
+ else
+ putbinaryfile(localfile, remotefile, blocksize, &block)
end
end
@@ -653,7 +599,7 @@ module Net
cmd = "ACCT " + account
voidcmd(cmd)
end
-
+
#
# Returns an array of filenames in the remote directory.
#
@@ -668,7 +614,7 @@ module Net
end
return files
end
-
+
#
# Returns an array of file information in the directory (the output is like
# `ls -l`). If a block is given, it iterates through the listing.
@@ -690,7 +636,7 @@ module Net
end
alias ls list
alias dir list
-
+
#
# Renames a file on the server.
#
@@ -701,7 +647,7 @@ module Net
end
voidcmd("RNTO " + toname)
end
-
+
#
# Deletes a file on the server.
#
@@ -715,7 +661,7 @@ module Net
raise FTPReplyError, resp
end
end
-
+
#
# Changes the (remote) directory.
#
@@ -733,22 +679,21 @@ module Net
cmd = "CWD " + dirname
voidcmd(cmd)
end
-
+
#
# Returns the size of the given (remote) filename.
#
def size(filename)
- with_binary(true) do
- resp = sendcmd("SIZE " + filename)
- if resp[0, 3] != "213"
- raise FTPReplyError, resp
- end
- return resp[3..-1].strip.to_i
+ voidcmd("TYPE I")
+ resp = sendcmd("SIZE " + filename)
+ if resp[0, 3] != "213"
+ raise FTPReplyError, resp
end
+ return resp[3..-1].strip.to_i
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.
@@ -758,7 +703,7 @@ module Net
ary = str.scan(MDTM_REGEXP)[0].collect {|i| i.to_i}
return local ? Time.local(*ary) : Time.gm(*ary)
end
-
+
#
# Creates a remote directory.
#
@@ -766,14 +711,14 @@ module Net
resp = sendcmd("MKD " + dirname)
return parse257(resp)
end
-
+
#
# Removes a remote directory.
#
def rmdir(dirname)
voidcmd("RMD " + dirname)
end
-
+
#
# Returns the current remote directory.
#
@@ -782,7 +727,7 @@ module Net
return parse257(resp)
end
alias getdir pwd
-
+
#
# Returns system information.
#
@@ -793,7 +738,7 @@ module Net
end
return resp[4 .. -1]
end
-
+
#
# Aborts the previous command (ABOR command).
#
@@ -807,7 +752,7 @@ module Net
end
return resp
end
-
+
#
# Returns the status (STAT command).
#
@@ -817,7 +762,7 @@ module Net
@sock.send(line, Socket::MSG_OOB)
return getresp
end
-
+
#
# Issues the MDTM command. TODO: more info.
#
@@ -827,7 +772,7 @@ module Net
return resp[3 .. -1].strip
end
end
-
+
#
# Issues the HELP command.
#
@@ -838,7 +783,7 @@ module Net
end
sendcmd(cmd)
end
-
+
#
# Exits the FTP session.
#
@@ -860,7 +805,7 @@ module Net
cmd = "SITE " + arg
voidcmd(cmd)
end
-
+
#
# Closes the connection. Further operations are impossible until you open
# a new connection with #connect.
@@ -868,14 +813,14 @@ module Net
def close
@sock.close if @sock and not @sock.closed?
end
-
+
#
# Returns +true+ iff the connection is closed.
#
def closed?
@sock == nil or @sock.closed?
end
-
+
def parse227(resp)
if resp[0, 3] != "227"
raise FTPReplyError, resp
@@ -894,7 +839,7 @@ module Net
return host, port
end
private :parse227
-
+
def parse228(resp)
if resp[0, 3] != "228"
raise FTPReplyError, resp
@@ -922,11 +867,11 @@ module Net
end
host = v6[0, 8].join(":")
port = (numbers[19].to_i << 8) + numbers[20].to_i
- end
+ end
return host, port
end
private :parse228
-
+
def parse229(resp)
if resp[0, 3] != "229"
raise FTPReplyError, resp
@@ -945,7 +890,7 @@ module Net
return host, port
end
private :parse229
-
+
def parse257(resp)
if resp[0, 3] != "257"
raise FTPReplyError, resp
diff --git a/lib/net/http.rb b/lib/net/http.rb
index d4cbedbda1..7dd1f24d4c 100644
--- a/lib/net/http.rb
+++ b/lib/net/http.rb
@@ -1,29 +1,29 @@
#
# = net/http.rb
#
-# Copyright (c) 1999-2007 Yukihiro Matsumoto
-# Copyright (c) 1999-2007 Minero Aoki
+# Copyright (c) 1999-2006 Yukihiro Matsumoto
+# Copyright (c) 1999-2006 Minero Aoki
# Copyright (c) 2001 GOTOU Yuuzou
-#
+#
# Written and maintained by Minero Aoki <aamine@loveruby.net>.
# HTTPS support added by GOTOU Yuuzou <gotoyuzo@notwork.org>.
#
# This file is derived from "http-access.rb".
#
# Documented by Minero Aoki; converted to RDoc by William Webber.
-#
+#
# This program is free software. You can re-distribute and/or
# modify this program under the same terms of ruby itself ---
# Ruby Distribution License or GNU General Public License.
#
-# See Net::HTTP for an overview and examples.
-#
+# See Net::HTTP for an overview and examples.
+#
# NOTE: You can find Japanese version of this document here:
-# http://www.ruby-lang.org/ja/man/html/net_http.html
-#
+# http://www.ruby-lang.org/ja/man/?cmd=view;name=net%2Fhttp.rb
+#
#--
# $Id$
-#++
+#++
require 'net/protocol'
require 'uri'
@@ -36,29 +36,29 @@ module Net #:nodoc:
# :startdoc:
# == What Is This Library?
- #
+ #
# This library provides your program functions to access WWW
# documents via HTTP, Hyper Text Transfer Protocol version 1.1.
- # For details of HTTP, refer to [RFC2616]
+ # For details of HTTP, refer [RFC2616]
# (http://www.ietf.org/rfc/rfc2616.txt).
- #
+ #
# == Examples
- #
+ #
# === Getting Document From WWW Server
- #
+ #
# Example #1: Simple GET+print
- #
+ #
# require 'net/http'
# Net::HTTP.get_print 'www.example.com', '/index.html'
- #
+ #
# Example #2: Simple GET+print by URL
- #
+ #
# require 'net/http'
# require 'uri'
# Net::HTTP.get_print URI.parse('http://www.example.com/index.html')
- #
+ #
# Example #3: More generic GET+print
- #
+ #
# require 'net/http'
# require 'uri'
#
@@ -69,7 +69,7 @@ module Net #:nodoc:
# puts res.body
#
# Example #4: More generic GET+print
- #
+ #
# require 'net/http'
#
# url = URI.parse('http://www.example.com/index.html')
@@ -78,28 +78,27 @@ module Net #:nodoc:
# http.request(req)
# }
# puts res.body
- #
+ #
# === Posting Form Data
- #
+ #
# require 'net/http'
# require 'uri'
#
# #1: Simple POST
# res = Net::HTTP.post_form(URI.parse('http://www.example.com/search.cgi'),
- # {'q' => 'ruby', 'max' => '50'})
+ # {'q'=>'ruby', 'max'=>'50'})
# puts res.body
#
# #2: POST with basic authentication
# res = Net::HTTP.post_form(URI.parse('http://jack:pass@www.example.com/todo.cgi'),
- # {'from' => '2005-01-01',
- # 'to' => '2005-03-31'})
+ # {'from'=>'2005-01-01', 'to'=>'2005-03-31'})
# puts res.body
#
# #3: Detailed control
# url = URI.parse('http://www.example.com/todo.cgi')
# req = Net::HTTP::Post.new(url.path)
# req.basic_auth 'jack', 'pass'
- # req.set_form_data({'from' => '2005-01-01', 'to' => '2005-03-31'}, ';')
+ # req.set_form_data({'from'=>'2005-01-01', 'to'=>'2005-03-31'}, ';')
# res = Net::HTTP.new(url.host, url.port).start {|http| http.request(req) }
# case res
# when Net::HTTPSuccess, Net::HTTPRedirection
@@ -107,20 +106,15 @@ module Net #:nodoc:
# else
# res.error!
# end
- #
- # #4: Multiple values
- # res = Net::HTTP.post_form(URI.parse('http://www.example.com/search.cgi'),
- # {'q' => ['ruby', 'perl'], 'max' => '50'})
- # puts res.body
- #
+ #
# === Accessing via Proxy
- #
+ #
# Net::HTTP.Proxy creates http proxy class. It has same
# methods of Net::HTTP but its instances always connect to
# proxy, instead of given host.
- #
+ #
# require 'net/http'
- #
+ #
# proxy_addr = 'your.proxy.host'
# proxy_port = 8080
# :
@@ -128,20 +122,20 @@ module Net #:nodoc:
# # always connect to your.proxy.addr:8080
# :
# }
- #
+ #
# Since Net::HTTP.Proxy returns Net::HTTP itself when proxy_addr is nil,
# there's no need to change code if there's proxy or not.
- #
+ #
# There are two additional parameters in Net::HTTP.Proxy which allow to
# specify proxy user name and password:
- #
+ #
# Net::HTTP::Proxy(proxy_addr, proxy_port, proxy_user = nil, proxy_pass = nil)
- #
+ #
# You may use them to work with authorization-enabled proxies:
- #
+ #
# require 'net/http'
# require 'uri'
- #
+ #
# proxy_host = 'your.proxy.host'
# proxy_port = 8080
# uri = URI.parse(ENV['http_proxy'])
@@ -154,16 +148,16 @@ module Net #:nodoc:
#
# Note that net/http never rely on HTTP_PROXY environment variable.
# If you want to use proxy, set it explicitly.
- #
+ #
# === Following Redirection
- #
+ #
# require 'net/http'
# require 'uri'
- #
+ #
# def fetch(uri_str, limit = 10)
- # # You should choose better exception.
+ # # You should choose better exception.
# raise ArgumentError, 'HTTP redirect too deep' if limit == 0
- #
+ #
# response = Net::HTTP.get_response(URI.parse(uri_str))
# case response
# when Net::HTTPSuccess then response
@@ -172,25 +166,25 @@ module Net #:nodoc:
# response.error!
# end
# end
- #
+ #
# print fetch('http://www.ruby-lang.org')
- #
+ #
# Net::HTTPSuccess and Net::HTTPRedirection is a HTTPResponse class.
# All HTTPResponse objects belong to its own response class which
# indicate HTTP result status. For details of response classes,
# see section "HTTP Response Classes".
- #
+ #
# === Basic Authentication
- #
+ #
# require 'net/http'
- #
+ #
# Net::HTTP.start('www.example.com') {|http|
# req = Net::HTTP::Get.new('/secret-page.html')
# req.basic_auth 'account', 'password'
# response = http.request(req)
# print response.body
# }
- #
+ #
# === HTTP Request Classes
#
# Here is HTTP request class hierarchy.
@@ -220,7 +214,7 @@ module Net #:nodoc:
# HTTPUnknownResponse
# HTTPInformation # 1xx
# HTTPContinue # 100
- # HTTPSwitchProtocol # 101
+ # HTTPSwitchProtocl # 101
# HTTPSuccess # 2xx
# HTTPOK # 200
# HTTPCreated # 201
@@ -263,22 +257,22 @@ module Net #:nodoc:
# HTTPServiceUnavailable # 503
# HTTPGatewayTimeOut # 504
# HTTPVersionNotSupported # 505
- #
+ #
# == Switching Net::HTTP versions
- #
+ #
# You can use net/http.rb 1.1 features (bundled with Ruby 1.6)
# by calling HTTP.version_1_1. Calling Net::HTTP.version_1_2
# allows you to use 1.2 features again.
- #
+ #
# # example
# Net::HTTP.start {|http1| ...(http1 has 1.2 features)... }
- #
+ #
# Net::HTTP.version_1_1
# Net::HTTP.start {|http2| ...(http2 has 1.1 features)... }
- #
+ #
# Net::HTTP.version_1_2
# Net::HTTP.start {|http3| ...(http3 has 1.2 features)... }
- #
+ #
# This function is NOT thread-safe.
#
class HTTP < Protocol
@@ -287,13 +281,6 @@ module Net #:nodoc:
Revision = %q$Revision$.split[1]
HTTPVersion = '1.1'
@newimpl = true
- begin
- require 'zlib'
- require 'stringio' #for our purposes (unpacking gzip) lump these together
- HAVE_ZLIB=true
- rescue LoadError
- HAVE_ZLIB=false
- end
# :startdoc:
# Turns on net/http 1.2 (ruby 1.8) features.
@@ -338,7 +325,7 @@ module Net #:nodoc:
#
# Get body from target and output it to +$stdout+. The
# target can either be specified as (+uri+), or as
- # (+host+, +path+, +port+ = 80); so:
+ # (+host+, +path+, +port+ = 80); so:
#
# Net::HTTP.get_print URI.parse('http://www.example.com/index.html')
#
@@ -358,7 +345,7 @@ module Net #:nodoc:
# Send a GET request to the target and return the response
# as a string. The target can either be specified as
# (+uri+), or as (+host+, +path+, +port+ = 80); so:
- #
+ #
# print Net::HTTP.get(URI.parse('http://www.example.com/index.html'))
#
# or:
@@ -372,7 +359,7 @@ module Net #:nodoc:
# Send a GET request to the target and return the response
# as a Net::HTTPResponse object. The target can either be specified as
# (+uri+), or as (+host+, +path+, +port+ = 80); so:
- #
+ #
# res = Net::HTTP.get_response(URI.parse('http://www.example.com/index.html'))
# print res.body
#
@@ -442,9 +429,9 @@ module Net #:nodoc:
BufferedIO
end
- # creates a new Net::HTTP object and opens its TCP connection and
- # HTTP session. If the optional block is given, the newly
- # created Net::HTTP object is passed to it and closed when the
+ # creates a new Net::HTTP object and opens its TCP connection and
+ # HTTP session. If the optional block is given, the newly
+ # created Net::HTTP object is passed to it and closed when the
# block finishes. In this case, the return value of this method
# is the return value of the block. If no block is given, the
# return value of this method is the newly created Net::HTTP object
@@ -474,7 +461,7 @@ module Net #:nodoc:
@address = address
@port = (port || HTTP.default_port)
@curr_http_version = HTTPVersion
- @no_keepalive_server = false
+ @seems_1_0_server = false
@close_on_empty_response = false
@socket = nil
@started = false
@@ -483,14 +470,6 @@ module Net #:nodoc:
@debug_output = nil
@use_ssl = false
@ssl_context = nil
- @enable_post_connection_check = true
- @compression = nil
- @sspi_enabled = false
- if defined?(SSL_ATTRIBUTES)
- SSL_ATTRIBUTES.each do |name|
- instance_variable_set "@#{name}", nil
- end
- end
end
def inspect
@@ -548,7 +527,7 @@ module Net #:nodoc:
end
# Opens TCP connection and HTTP session.
- #
+ #
# When this method is called with block, gives a HTTP object
# to the block and closes the TCP connection / HTTP session
# after the block executed.
@@ -581,17 +560,10 @@ module Net #:nodoc:
s = timeout(@open_timeout) { TCPSocket.open(conn_address(), conn_port()) }
D "opened"
if use_ssl?
- ssl_parameters = Hash.new
- iv_list = instance_variables
- SSL_ATTRIBUTES.each do |name|
- ivname = "@#{name}".intern
- if iv_list.include?(ivname) and
- value = instance_variable_get(ivname)
- ssl_parameters[name] = value
- end
+ unless @ssl_context.verify_mode
+ warn "warning: peer certificate won't be verified in this SSL session"
+ @ssl_context.verify_mode = OpenSSL::SSL::VERIFY_NONE
end
- @ssl_context = OpenSSL::SSL::SSLContext.new
- @ssl_context.set_params(ssl_parameters)
s = OpenSSL::SSL::SSLSocket.new(s, @ssl_context)
s.sync_close = true
end
@@ -655,9 +627,9 @@ module Net #:nodoc:
# Arguments are address/port of proxy host and username/password
# if authorization on proxy server is required.
# You can replace the HTTP class with created proxy class.
- #
+ #
# If ADDRESS is nil, this method returns self (Net::HTTP).
- #
+ #
# # Example
# proxy_class = Net::HTTP::Proxy('proxy.example.com', 8080)
# :
@@ -665,7 +637,7 @@ module Net #:nodoc:
# # connecting proxy.foo.org:8080
# :
# }
- #
+ #
def HTTP.Proxy(p_addr, p_port = nil, p_user = nil, p_pass = nil)
return self unless p_addr
delta = ProxyDelta
@@ -761,18 +733,7 @@ module Net #:nodoc:
public
# Gets data from +path+ on the connected-to host.
- # +initheader+ must be a Hash like { 'Accept' => '*/*', ... },
- # and it defaults to an empty hash.
- # If +initheader+ doesn't have the key 'accept-encoding', then
- # a value of "gzip;q=1.0,deflate;q=0.6,identity;q=0.3" is used,
- # so that gzip compression is used in preference to deflate
- # compression, which is used in preference to no compression.
- # Ruby doesn't have libraries to support the compress (Lempel-Ziv)
- # compression, so that is not supported. The intent of this is
- # to reduce bandwidth by default. If this routine sets up
- # compression, then it does the decompression also, removing
- # the header as well to prevent confusion. Otherwise
- # it leaves the body as it found it.
+ # +header+ must be a Hash like { 'Accept' => '*/*', ... }.
#
# In version 1.1 (ruby 1.6), this method returns a pair of objects,
# a Net::HTTPResponse object and the entity body string.
@@ -787,7 +748,7 @@ module Net #:nodoc:
# +dest+ argument is obsolete.
# It still works but you must not use it.
#
- # In version 1.1, this method might raise an exception for
+ # In version 1.1, this method might raise an exception for
# 3xx (redirect). In this case you can get a HTTPResponse object
# by "anException.response".
#
@@ -798,7 +759,7 @@ module Net #:nodoc:
#
# # version 1.2 (bundled with Ruby 1.8 or later)
# response = http.get('/index.html')
- #
+ #
# # using block
# File.open('result.txt', 'w') {|f|
# http.get('/~foo/') do |str|
@@ -806,33 +767,10 @@ module Net #:nodoc:
# end
# }
#
- def get(path, initheader = {}, dest = nil, &block) # :yield: +body_segment+
+ def get(path, initheader = nil, dest = nil, &block) # :yield: +body_segment+
res = nil
- if HAVE_ZLIB
- unless initheader.keys.any?{|k| k.downcase == "accept-encoding"}
- initheader["accept-encoding"] = "gzip;q=1.0,deflate;q=0.6,identity;q=0.3"
- @compression = true
- end
- end
request(Get.new(path, initheader)) {|r|
- if r.key?("content-encoding") and @compression
- @compression = nil # Clear it till next set.
- the_body = r.read_body dest, &block
- case r["content-encoding"]
- when "gzip"
- r.body= Zlib::GzipReader.new(StringIO.new(the_body)).read
- r.delete("content-encoding")
- when "deflate"
- r.body= Zlib::Inflate.inflate(the_body);
- r.delete("content-encoding")
- when "identity"
- ; # nothing needed
- else
- ; # Don't do anything dramatic, unless we need to later
- end
- else
- r.read_body dest, &block
- end
+ r.read_body dest, &block
res = r
}
unless @newimpl
@@ -845,21 +783,21 @@ module Net #:nodoc:
# Gets only the header from +path+ on the connected-to host.
# +header+ is a Hash like { 'Accept' => '*/*', ... }.
- #
+ #
# This method returns a Net::HTTPResponse object.
- #
- # In version 1.1, this method might raise an exception for
+ #
+ # In version 1.1, this method might raise an exception for
# 3xx (redirect). On the case you can get a HTTPResponse object
# by "anException.response".
# In version 1.2, this method never raises an exception.
- #
+ #
# response = nil
# Net::HTTP.start('some.www.server', 80) {|http|
# response = http.head('/index.html')
# }
# p response['content-type']
#
- def head(path, initheader = nil)
+ def head(path, initheader = nil)
res = request(Head.new(path, initheader))
res.value unless @newimpl
res
@@ -867,11 +805,11 @@ module Net #:nodoc:
# Posts +data+ (must be a String) to +path+. +header+ must be a Hash
# like { 'Accept' => '*/*', ... }.
- #
+ #
# In version 1.1 (ruby 1.6), this method returns a pair of objects, a
# Net::HTTPResponse object and an entity body string.
# In version 1.2 (ruby 1.8), this method returns a Net::HTTPResponse object.
- #
+ #
# If called with a block, yields each fragment of the
# entity body in turn as a string as it are read from
# the socket. Note that in this case, the returned response
@@ -879,18 +817,18 @@ module Net #:nodoc:
#
# +dest+ argument is obsolete.
# It still works but you must not use it.
- #
- # In version 1.1, this method might raise an exception for
+ #
+ # In version 1.1, this method might raise an exception for
# 3xx (redirect). In this case you can get an HTTPResponse object
# by "anException.response".
# In version 1.2, this method never raises exception.
- #
+ #
# # version 1.1
# response, body = http.post('/cgi-bin/search.rb', 'query=foo')
- #
+ #
# # version 1.2
# response = http.post('/cgi-bin/search.rb', 'query=foo')
- #
+ #
# # using block
# File.open('result.txt', 'w') {|f|
# http.post('/cgi-bin/search.rb', 'query=foo') do |str|
@@ -983,21 +921,21 @@ module Net #:nodoc:
# Sends a GET request to the +path+ and gets a response,
# as an HTTPResponse object.
- #
+ #
# When called with a block, yields an HTTPResponse object.
# The body of this response will not have been read yet;
# the caller can process it using HTTPResponse#read_body,
# if desired.
#
# Returns the response.
- #
+ #
# This method never raises Net::* exceptions.
- #
+ #
# response = http.request_get('/index.html')
# # The entity body is already read here.
# p response['content-type']
# puts response.body
- #
+ #
# # using block
# http.request_get('/index.html') {|response|
# p response['content-type']
@@ -1014,9 +952,9 @@ module Net #:nodoc:
# as an HTTPResponse object.
#
# Returns the response.
- #
+ #
# This method never raises Net::* exceptions.
- #
+ #
# response = http.request_head('/index.html')
# p response['content-type']
#
@@ -1026,21 +964,21 @@ module Net #:nodoc:
# Sends a POST request to the +path+ and gets a response,
# as an HTTPResponse object.
- #
+ #
# When called with a block, yields an HTTPResponse object.
# The body of this response will not have been read yet;
# the caller can process it using HTTPResponse#read_body,
# if desired.
#
# Returns the response.
- #
+ #
# This method never raises Net::* exceptions.
- #
+ #
# # example
# response = http.request_post('/cgi-bin/nice.rb', 'datadatadata...')
# p response.status
# puts response.body # body is already read
- #
+ #
# # using block
# http.request_post('/cgi-bin/nice.rb', 'datadatadata...') {|response|
# p response.status
@@ -1068,7 +1006,7 @@ module Net #:nodoc:
# This method also sends DATA string if DATA is given.
#
# Returns a HTTPResponse object.
- #
+ #
# This method never raises Net::* exceptions.
#
# response = http.send_request('GET', '/index.html')
@@ -1082,14 +1020,14 @@ module Net #:nodoc:
# Sends an HTTPRequest object REQUEST to the HTTP server.
# This method also sends DATA string if REQUEST is a post/put request.
# Giving DATA for get/head request causes ArgumentError.
- #
+ #
# When called with a block, yields an HTTPResponse object.
# The body of this response will not have been read yet;
# the caller can process it using HTTPResponse#read_body,
# if desired.
#
# Returns a HTTPResponse object.
- #
+ #
# This method never raises Net::* exceptions.
#
def request(req, body = nil, &block) # :yield: +response+
@@ -1100,34 +1038,34 @@ module Net #:nodoc:
}
end
if proxy_user()
- req.proxy_basic_auth proxy_user(), proxy_pass() unless use_ssl?
- end
- req.set_body_internal body
- res = transport_request(req, &block)
- if sspi_auth?(res)
- sspi_auth(req)
- res = transport_request(req, &block)
+ unless use_ssl?
+ req.proxy_basic_auth proxy_user(), proxy_pass()
+ end
end
- res
- end
- private
-
- def transport_request(req)
+ req.set_body_internal body
begin_transport req
- req.exec @socket, @curr_http_version, edit_path(req.path)
- begin
- res = HTTPResponse.read_new(@socket)
- end while res.kind_of?(HTTPContinue)
- res.reading_body(@socket, req.response_body_permitted?) {
- yield res if block_given?
- }
+ req.exec @socket, @curr_http_version, edit_path(req.path)
+ begin
+ res = HTTPResponse.read_new(@socket)
+ end while res.kind_of?(HTTPContinue)
+ res.reading_body(@socket, req.response_body_permitted?) {
+ yield res if block_given?
+ }
end_transport req, res
+
res
end
+ private
+
def begin_transport(req)
- connect if @socket.closed?
+ if @socket.closed?
+ connect
+ end
+ if @seems_1_0_server
+ req['connection'] ||= 'close'
+ end
if not req.response_body_permitted? and @close_on_empty_response
req['connection'] ||= 'close'
end
@@ -1136,13 +1074,15 @@ module Net #:nodoc:
def end_transport(req, res)
@curr_http_version = res.http_version
- if @socket.closed?
- D 'Conn socket closed'
- elsif not res.body and @close_on_empty_response
+ if not res.body and @close_on_empty_response
D 'Conn close'
@socket.close
elsif keep_alive?(req, res)
D 'Conn keep-alive'
+ if @socket.closed?
+ D 'Conn (but seems 1.0 server)'
+ @seems_1_0_server = true
+ end
else
D 'Conn close'
@socket.close
@@ -1150,40 +1090,13 @@ module Net #:nodoc:
end
def keep_alive?(req, res)
- return false if req.connection_close?
- if @curr_http_version <= '1.0'
- res.connection_keep_alive?
- else # HTTP/1.1 or later
- not res.connection_close?
- end
- end
-
- def sspi_auth?(res)
- return false unless @sspi_enabled
- if res.kind_of?(HTTPProxyAuthenticationRequired) and
- proxy? and res["Proxy-Authenticate"].include?("Negotiate")
- begin
- require 'win32/sspi'
- true
- rescue LoadError
- false
- end
- else
- false
- end
- end
-
- def sspi_auth(req)
- n = Win32::SSPI::NegotiateAuth.new
- req["Proxy-Authorization"] = "Negotiate #{n.get_initial_token}"
- # Some versions of ISA will close the connection if this isn't present.
- req["Connection"] = "Keep-Alive"
- req["Proxy-Connection"] = "Keep-Alive"
- res = transport_request(req)
- authphrase = res["Proxy-Authenticate"] or return res
- req["Proxy-Authorization"] = "Negotiate #{n.complete_authentication(authphrase)}"
- rescue => err
- raise HTTPAuthenticationError.new('HTTP authentication failed', err)
+ return false if /close/i =~ req['connection'].to_s
+ return false if @seems_1_0_server
+ return true if /keep-alive/i =~ res['connection'].to_s
+ return false if /close/i =~ res['connection'].to_s
+ return true if /keep-alive/i =~ res['proxy-connection'].to_s
+ return false if /close/i =~ res['proxy-connection'].to_s
+ (@curr_http_version == '1.1')
end
#
@@ -1421,7 +1334,7 @@ module Net #:nodoc:
raise HTTPHeaderSyntaxError, 'wrong Content-Length format'
len.to_i
end
-
+
def content_length=(len)
unless len
@header.delete 'content-length'
@@ -1431,7 +1344,7 @@ module Net #:nodoc:
end
# Returns "true" if the "transfer-encoding" header is present and
- # set to "chunked". This is an HTTP/1.1 feature, allowing the
+ # 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?
@@ -1472,7 +1385,7 @@ module Net #:nodoc:
return nil unless @header['content-type']
self['Content-Type'].split(';').first.to_s.split('/')[0].to_s.strip
end
-
+
# Returns a content type string such as "html".
# This method returns nil if Content-Type: header field does not exist
# or sub-type is not given (e.g. "Content-Type: text").
@@ -1510,26 +1423,15 @@ module Net #:nodoc:
#
# This method also set Content-Type: header field to
# application/x-www-form-urlencoded.
- #
- # Example:
- # http.form_data = {"q" => "ruby", "lang" => "en"}
- # http.form_data = {"q" => ["ruby", "perl"], "lang" => "en"}
- # http.set_form_data({"q" => "ruby", "lang" => "en"}, ';')
- #
def set_form_data(params, sep = '&')
- self.body = params.map {|k, v| encode_kvpair(k, v) }.flatten.join(sep)
+ self.body = params.map {|k,v| "#{urlencode(k.to_s)}=#{urlencode(v.to_s)}" }.join(sep)
self.content_type = 'application/x-www-form-urlencoded'
end
alias form_data= set_form_data
- def encode_kvpair(k, vs)
- Array(vs).map {|v| "#{urlencode(k)}=#{urlencode(v.to_s)}" }
- end
- private :encode_kvpair
-
def urlencode(str)
- str.dup.force_encoding('ASCII-8BIT').gsub(/[^a-zA-Z0-9_\.\-]/){'%%%02x' % $&.ord}
+ str.gsub(/[^a-zA-Z0-9_\.\-]/n) {|s| sprintf('%%%02x', s[0]) }
end
private :urlencode
@@ -1548,24 +1450,6 @@ module Net #:nodoc:
end
private :basic_encode
- def connection_close?
- tokens(@header['connection']).include?('close') or
- tokens(@header['proxy-connection']).include?('close')
- end
-
- def connection_keep_alive?
- tokens(@header['connection']).include?('keep-alive') or
- tokens(@header['proxy-connection']).include?('keep-alive')
- end
-
- def tokens(vals)
- return [] unless vals
- vals.map {|v| v.split(',') }.flatten\
- .reject {|str| str.strip.empty? }\
- .map {|tok| tok.strip.downcase }
- end
- private :tokens
-
end
@@ -1583,12 +1467,10 @@ module Net #:nodoc:
@method = m
@request_has_body = reqbody
@response_has_body = resbody
- raise ArgumentError, "no HTTP request path given" unless path
raise ArgumentError, "HTTP request path is empty" if path.empty?
@path = path
initialize_http_header initheader
self['Accept'] ||= '*/*'
- self['User-Agent'] ||= 'Ruby'
@body = nil
@body_stream = nil
end
@@ -1651,7 +1533,7 @@ module Net #:nodoc:
private
def send_request_with_body(sock, ver, path, body)
- self.content_length = body.bytesize
+ self.content_length = body.length
delete 'Transfer-Encoding'
supply_default_content_type
write_header sock, ver, path
@@ -1691,14 +1573,14 @@ module Net #:nodoc:
buf << "\r\n"
sock.write buf
end
-
+
end
- #
+ #
# HTTP request class. This class wraps request header and entity path.
# You *must* use its subclass, Net::HTTP::Get, Post, Head.
- #
+ #
class HTTPRequest < HTTPGenericRequest
# Creates HTTP request object.
@@ -1838,17 +1720,17 @@ module Net #:nodoc:
# HTTP response class. This class wraps response header and entity.
# Mixes in the HTTPHeader module, which provides access to response
# header values both via hash-like methods and individual readers.
- # Note that each possible HTTP response code defines its own
+ # Note that each possible HTTP response code defines its own
# HTTPResponse subclass. These are listed below.
# All classes are
# defined under the Net module. Indentation indicates inheritance.
- #
+ #
# xxx HTTPResponse
- #
+ #
# 1xx HTTPInformation
- # 100 HTTPContinue
+ # 100 HTTPContinue
# 101 HTTPSwitchProtocol
- #
+ #
# 2xx HTTPSuccess
# 200 HTTPOK
# 201 HTTPCreated
@@ -1857,7 +1739,7 @@ module Net #:nodoc:
# 204 HTTPNoContent
# 205 HTTPResetContent
# 206 HTTPPartialContent
- #
+ #
# 3xx HTTPRedirection
# 300 HTTPMultipleChoice
# 301 HTTPMovedPermanently
@@ -1866,7 +1748,7 @@ module Net #:nodoc:
# 304 HTTPNotModified
# 305 HTTPUseProxy
# 307 HTTPTemporaryRedirect
- #
+ #
# 4xx HTTPClientError
# 400 HTTPBadRequest
# 401 HTTPUnauthorized
@@ -1886,7 +1768,7 @@ module Net #:nodoc:
# 415 HTTPUnsupportedMediaType
# 416 HTTPRequestedRangeNotSatisfiable
# 417 HTTPExpectationFailed
- #
+ #
# 5xx HTTPServerError
# 500 HTTPInternalServerError
# 501 HTTPNotImplemented
@@ -1894,7 +1776,7 @@ module Net #:nodoc:
# 503 HTTPServiceUnavailable
# 504 HTTPGatewayTimeOut
# 505 HTTPVersionNotSupported
- #
+ #
# xxx HTTPUnknownResponse
#
class HTTPResponse
@@ -2160,7 +2042,7 @@ module Net #:nodoc:
# next is to fix bug in RDoc, where the private inside class << self
# spills out.
- public
+ public
include HTTPHeader
@@ -2193,7 +2075,7 @@ module Net #:nodoc:
# To allow Net::HTTP 1.1 style assignment
# e.g.
# response, body = Net::HTTP.get(....)
- #
+ #
def to_ary
warn "net/http.rb: warning: Net::HTTP v1.1 style assignment found at #{caller(1)[0]}; use `response = http.get(...)' instead." if $VERBOSE
res = self.dup
@@ -2316,12 +2198,6 @@ module Net #:nodoc:
read_body()
end
- # Because it may be necessary to modify the body, Eg, decompression
- # this method facilitates that.
- def body=(value)
- @body = value
- end
-
alias entity body #:nodoc: obsolete
private
diff --git a/lib/net/https.rb b/lib/net/https.rb
index 636ae1be4d..7847c3ffea 100644
--- a/lib/net/https.rb
+++ b/lib/net/https.rb
@@ -17,7 +17,7 @@
== Version
$Id$
-
+
2001-11-06: Contiributed to Ruby/OpenSSL project.
2004-03-06: Some code is merged in to net/http.
@@ -73,7 +73,7 @@ It can be replaced by the following code:
: ca_file, ca_file=((|path|))
Sets path of a CA certification file in PEM format.
- The file can contrain several CA certificates.
+ The file can contrain several CA certificats.
: ca_path, ca_path=((|path|))
Sets path of a CA certification directory containing certifications
@@ -102,35 +102,72 @@ require 'net/http'
require 'openssl'
module Net
+
class HTTP
remove_method :use_ssl?
def use_ssl?
@use_ssl
end
+ # For backward compatibility.
+ alias use_ssl use_ssl?
+
# Turn on/off SSL.
# This flag must be set before starting session.
# If you change use_ssl value after session started,
# a Net::HTTP object raises IOError.
def use_ssl=(flag)
flag = (flag ? true : false)
- if started? and @use_ssl != flag
- raise IOError, "use_ssl value changed, but session already started"
+ raise IOError, "use_ssl value changed, but session already started" \
+ if started? and @use_ssl != flag
+ if flag and not @ssl_context
+ @ssl_context = OpenSSL::SSL::SSLContext.new
end
@use_ssl = flag
end
- SSL_ATTRIBUTES = %w(
- ssl_version key cert ca_file ca_path cert_store ciphers
- verify_mode verify_callback verify_depth ssl_timeout
- )
- attr_accessor(*SSL_ATTRIBUTES)
+ def self.ssl_context_accessor(name)
+ module_eval(<<-End, __FILE__, __LINE__ + 1)
+ def #{name}
+ return nil unless @ssl_context
+ @ssl_context.#{name}
+ end
+
+ def #{name}=(val)
+ @ssl_context ||= OpenSSL::SSL::SSLContext.new
+ @ssl_context.#{name} = val
+ end
+ End
+ end
+
+ ssl_context_accessor :key
+ ssl_context_accessor :cert
+ ssl_context_accessor :ca_file
+ ssl_context_accessor :ca_path
+ ssl_context_accessor :verify_mode
+ ssl_context_accessor :verify_callback
+ ssl_context_accessor :verify_depth
+ ssl_context_accessor :cert_store
+
+ def ssl_timeout
+ return nil unless @ssl_context
+ @ssl_context.timeout
+ end
+
+ def ssl_timeout=(sec)
+ raise ArgumentError, 'Net::HTTP#ssl_timeout= called but use_ssl=false' \
+ unless use_ssl?
+ @ssl_context ||= OpenSSL::SSL::SSLContext.new
+ @ssl_context.timeout = sec
+ end
+
+ # For backward compatibility
+ alias timeout= ssl_timeout=
def peer_cert
- if not use_ssl? or not @socket
- return nil
- end
+ return nil if not use_ssl? or not @socket
@socket.io.peer_cert
end
end
+
end
diff --git a/lib/net/imap.rb b/lib/net/imap.rb
index e67c294464..6162ffa0d0 100644
--- a/lib/net/imap.rb
+++ b/lib/net/imap.rb
@@ -9,14 +9,13 @@
# Documentation: Shugo Maeda, with RDoc conversion and overview by William
# Webber.
#
-# See Net::IMAP for documentation.
+# See Net::IMAP for documentation.
#
require "socket"
require "monitor"
require "digest/md5"
-require "strscan"
begin
require "openssl"
rescue LoadError
@@ -45,12 +44,12 @@ module Net
# read-only access) #examine(). Once the client has successfully
# selected a mailbox, they enter _selected_ state, and that
# mailbox becomes the _current_ mailbox, on which mail-item
- # related commands implicitly operate.
+ # related commands implicitly operate.
#
# Messages have two sorts of identifiers: message sequence
- # numbers, and UIDs.
+ # numbers, and UIDs.
#
- # Message sequence numbers number messages within a mail box
+ # Message sequence numbers number messages within a mail box
# from 1 up to the number of items in the mail box. If new
# message arrives during a session, it receives a sequence
# number equal to the new size of the mail box. If messages
@@ -58,7 +57,7 @@ module Net
# sequence numbers "shuffled down" to fill the gaps.
#
# UIDs, on the other hand, are permanently guaranteed not to
- # identify another message within the same mailbox, even if
+ # identify another message within the same mailbox, even if
# the existing message is deleted. UIDs are required to
# be assigned in ascending (but not necessarily sequential)
# order within a mailbox; this means that if a non-IMAP client
@@ -91,11 +90,11 @@ module Net
# imap.store(message_id, "+FLAGS", [:Deleted])
# end
# imap.expunge
- #
+ #
# == Thread Safety
#
# Net::IMAP supports concurrent threads. For example,
- #
+ #
# imap = Net::IMAP.new("imap.foo.net", "imap2")
# imap.authenticate("cram-md5", "bar", "password")
# imap.select("inbox")
@@ -103,7 +102,7 @@ module Net
# search_result = imap.search(["BODY", "hello"])
# fetch_result = fetch_thread.value
# imap.disconnect
- #
+ #
# This script invokes the FETCH command and the SEARCH command concurrently.
#
# == Errors
@@ -113,9 +112,9 @@ module Net
#
# NO:: the attempted command could not be successfully completed. For
# instance, the username/password used for logging in are incorrect;
- # the selected mailbox does not exists; etc.
+ # the selected mailbox does not exists; etc.
#
- # BAD:: the request from the client does not follow the server's
+ # BAD:: the request from the client does not follow the server's
# understanding of the IMAP protocol. This includes attempting
# commands from the wrong client state; for instance, attempting
# to perform a SEARCH command without having SELECTed a current
@@ -147,8 +146,8 @@ module Net
#
# Finally, a Net::IMAP::DataFormatError is thrown if low-level data
# is found to be in an incorrect format (for instance, when converting
- # between UTF-8 and UTF-16), and Net::IMAP::ResponseParseError is
- # thrown if a server response is non-parseable.
+ # between UTF-8 and UTF-16), and Net::IMAP::ResponseParseError is
+ # thrown if a server response is non-parseable.
#
#
# == References
@@ -274,10 +273,8 @@ module Net
# is the type of authentication this authenticator supports
# (for instance, "LOGIN"). The +authenticator+ is an object
# which defines a process() method to handle authentication with
- # the server. See Net::IMAP::LoginAuthenticator,
- # Net::IMAP::CramMD5Authenticator, and Net::IMAP::DigestMD5Authenticator
- # for examples.
- #
+ # the server. See Net::IMAP::LoginAuthenticator and
+ # Net::IMAP::CramMD5Authenticator for examples.
#
# If +auth_type+ refers to an existing authenticator, it will be
# replaced by the new one.
@@ -288,15 +285,11 @@ module Net
# Disconnects from the server.
def disconnect
begin
- begin
- # try to call SSL::SSLSocket#io.
- @sock.io.shutdown
- rescue NoMethodError
- # @sock is not an SSL::SSLSocket.
- @sock.shutdown
- end
- rescue Errno::ENOTCONN
- # ignore `Errno::ENOTCONN: Socket is not connected' on some platforms.
+ # try to call SSL::SSLSocket#io.
+ @sock.io.shutdown
+ rescue NoMethodError
+ # @sock is not an SSL::SSLSocket.
+ @sock.shutdown
end
@receiver_thread.join
@sock.close
@@ -314,7 +307,7 @@ module Net
#
# Note that the Net::IMAP class does not modify its
# behaviour according to the capabilities of the server;
- # it is up to the user of the class to ensure that
+ # it is up to the user of the class to ensure that
# a certain capability is supported by a server before
# using it.
def capability
@@ -335,27 +328,12 @@ module Net
send_command("LOGOUT")
end
- # Sends a STARTTLS command to start TLS session.
- def starttls(options = {}, verify = true)
- send_command("STARTTLS") do |resp|
- if resp.kind_of?(TaggedResponse) && resp.name == "OK"
- begin
- # for backward compatibility
- certs = options.to_str
- options = create_ssl_params(certs, verify)
- rescue NoMethodError
- end
- start_tls_session(options)
- end
- end
- end
-
# Sends an AUTHENTICATE command to authenticate the client.
# The +auth_type+ parameter is a string that represents
# the authentication mechanism to be used. Currently Net::IMAP
# supports authentication mechanisms:
#
- # LOGIN:: login using cleartext user and password.
+ # LOGIN:: login using cleartext user and password.
# CRAM-MD5:: login with cleartext user and encrypted password
# (see [RFC-2195] for a full description). This
# mechanism requires that the server have the user's
@@ -403,7 +381,7 @@ module Net
end
# Sends a SELECT command to select a +mailbox+ so that messages
- # in the +mailbox+ can be accessed.
+ # in the +mailbox+ can be accessed.
#
# After you have selected a mailbox, you may retrieve the
# number of items in that mailbox from @responses["EXISTS"][-1],
@@ -454,7 +432,7 @@ module Net
# Sends a RENAME command to change the name of the +mailbox+ to
# +newname+.
#
- # A Net::IMAP::NoResponseError is raised if a mailbox with the
+ # A Net::IMAP::NoResponseError is raised if a mailbox with the
# name +mailbox+ cannot be renamed to +newname+ for whatever
# reason; for instance, because +mailbox+ does not exist, or
# because there is already a mailbox with the name +newname+.
@@ -501,8 +479,8 @@ module Net
# imap.create("foo/bar")
# imap.create("foo/baz")
# p imap.list("", "foo/%")
- # #=> [#<Net::IMAP::MailboxList attr=[:Noselect], delim="/", name="foo/">, \\
- # #<Net::IMAP::MailboxList attr=[:Noinferiors, :Marked], delim="/", name="foo/bar">, \\
+ # #=> [#<Net::IMAP::MailboxList attr=[:Noselect], delim="/", name="foo/">, \\
+ # #<Net::IMAP::MailboxList attr=[:Noinferiors, :Marked], delim="/", name="foo/bar">, \\
# #<Net::IMAP::MailboxList attr=[:Noinferiors], delim="/", name="foo/baz">]
def list(refname, mailbox)
synchronize do
@@ -555,7 +533,7 @@ module Net
# then that user will be stripped of any rights to that mailbox.
# The IMAP ACL commands are described in [RFC-2086].
def setacl(mailbox, user, rights)
- if rights.nil?
+ if rights.nil?
send_command("SETACL", mailbox, user, "")
else
send_command("SETACL", mailbox, user, rights)
@@ -574,7 +552,7 @@ module Net
# Sends a LSUB command, and returns a subset of names from the set
# of names that the user has declared as being "active" or
- # "subscribed". +refname+ and +mailbox+ are interpreted as
+ # "subscribed". +refname+ and +mailbox+ are interpreted as
# for #list().
# The return value is an array of +Net::IMAP::MailboxList+.
def lsub(refname, mailbox)
@@ -597,7 +575,7 @@ module Net
# p imap.status("inbox", ["MESSAGES", "RECENT"])
# #=> {"RECENT"=>0, "MESSAGES"=>44}
#
- # A Net::IMAP::NoResponseError is raised if status values
+ # A Net::IMAP::NoResponseError is raised if status values
# for +mailbox+ cannot be returned, for instance because it
# does not exist.
def status(mailbox, attr)
@@ -608,9 +586,9 @@ module Net
end
# Sends a APPEND command to append the +message+ to the end of
- # the +mailbox+. The optional +flags+ argument is an array of
+ # the +mailbox+. The optional +flags+ argument is an array of
# flags to initially passing to the new message. The optional
- # +date_time+ argument specifies the creation time to assign to the
+ # +date_time+ argument specifies the creation time to assign to the
# new message; it defaults to the current time.
# For example:
#
@@ -618,7 +596,7 @@ module Net
# Subject: hello
# From: shugo@ruby-lang.org
# To: shugo@ruby-lang.org
- #
+ #
# hello world
# EOF
#
@@ -637,7 +615,7 @@ module Net
# Sends a CHECK command to request a checkpoint of the currently
# selected mailbox. This performs implementation-specific
- # housekeeping, for instance, reconciling the mailbox's
+ # housekeeping, for instance, reconciling the mailbox's
# in-memory and on-disk state.
def check
send_command("CHECK")
@@ -661,8 +639,8 @@ module Net
# Sends a SEARCH command to search the mailbox for messages that
# match the given searching criteria, and returns message sequence
- # numbers. +keys+ can either be a string holding the entire
- # search string, or a single-dimension array of search keywords and
+ # numbers. +keys+ can either be a string holding the entire
+ # search string, or a single-dimension array of search keywords and
# arguments. The following are some common search criteria;
# see [IMAP] section 6.4.4 for a full list.
#
@@ -686,7 +664,7 @@ module Net
#
# OR <search-key> <search-key>:: "or" two search keys together.
#
- # ON <date>:: messages with an internal date exactly equal to <date>,
+ # ON <date>:: messages with an internal date exactly equal to <date>,
# which has a format similar to 8-Aug-2002.
#
# SINCE <date>:: messages with an internal date on or after <date>.
@@ -694,7 +672,7 @@ module Net
# SUBJECT <string>:: messages with <string> in their subject.
#
# TO <string>:: messages with <string> in their TO field.
- #
+ #
# For example:
#
# p imap.search(["SUBJECT", "hello", "NOT", "NEW"])
@@ -717,8 +695,8 @@ module Net
# The return value is an array of Net::IMAP::FetchData. For example:
#
# p imap.fetch(6..8, "UID")
- # #=> [#<Net::IMAP::FetchData seqno=6, attr={"UID"=>98}>, \\
- # #<Net::IMAP::FetchData seqno=7, attr={"UID"=>99}>, \\
+ # #=> [#<Net::IMAP::FetchData seqno=6, attr={"UID"=>98}>, \\
+ # #<Net::IMAP::FetchData seqno=7, attr={"UID"=>99}>, \\
# #<Net::IMAP::FetchData seqno=8, attr={"UID"=>100}>]
# p imap.fetch(6, "BODY[HEADER.FIELDS (SUBJECT)]")
# #=> [#<Net::IMAP::FetchData seqno=6, attr={"BODY[HEADER.FIELDS (SUBJECT)]"=>"Subject: test\r\n\r\n"}>]
@@ -741,9 +719,9 @@ module Net
end
# Sends a STORE command to alter data associated with messages
- # in the mailbox, in particular their flags. The +set+ parameter
- # is a number or an array of numbers or a Range object. Each number
- # is a message sequence number. +attr+ is the name of a data item
+ # in the mailbox, in particular their flags. The +set+ parameter
+ # is a number or an array of numbers or a Range object. Each number
+ # is a message sequence number. +attr+ is the name of a data item
# to store: 'FLAGS' means to replace the message's flag list
# with the provided one; '+FLAGS' means to add the provided flags;
# and '-FLAGS' means to remove them. +flags+ is a list of flags.
@@ -751,8 +729,8 @@ module Net
# The return value is an array of Net::IMAP::FetchData. For example:
#
# p imap.store(6..8, "+FLAGS", [:Deleted])
- # #=> [#<Net::IMAP::FetchData seqno=6, attr={"FLAGS"=>[:Seen, :Deleted]}>, \\
- # #<Net::IMAP::FetchData seqno=7, attr={"FLAGS"=>[:Seen, :Deleted]}>, \\
+ # #=> [#<Net::IMAP::FetchData seqno=6, attr={"FLAGS"=>[:Seen, :Deleted]}>, \\
+ # #<Net::IMAP::FetchData seqno=7, attr={"FLAGS"=>[:Seen, :Deleted]}>, \\
# #<Net::IMAP::FetchData seqno=8, attr={"FLAGS"=>[:Seen, :Deleted]}>]
def store(set, attr, flags)
return store_internal("STORE", set, attr, flags)
@@ -794,9 +772,9 @@ module Net
return sort_internal("UID SORT", sort_keys, search_keys, charset)
end
- # Adds a response handler. For example, to detect when
+ # Adds a response handler. For example, to detect when
# the server sends us a new EXISTS response (which normally
- # indicates new messages being added to the mail box),
+ # indicates new messages being added to the mail box),
# you could add the following handler after selecting the
# mailbox.
#
@@ -832,7 +810,7 @@ module Net
return thread_internal("THREAD", algorithm, search_keys, charset)
end
- # As for #thread(), but returns unique identifiers instead of
+ # As for #thread(), but returns unique identifiers instead of
# message sequence numbers.
def uid_thread(algorithm, search_keys, charset)
return thread_internal("UID THREAD", algorithm, search_keys, charset)
@@ -856,49 +834,39 @@ module Net
if x > 0
base64.concat("=" * (4 - x))
end
- base64.unpack("m")[0].unpack("n*").pack("U*")
+ u16tou8(base64.unpack("m")[0])
end
- }.force_encoding("UTF-8")
+ }
end
# Encode a string from UTF-8 format to modified UTF-7.
def self.encode_utf7(s)
- return s.gsub(/(&)|([^\x20-\x25\x27-\x7e]+)/u) {
+ return s.gsub(/(&)|([^\x20-\x25\x27-\x7e]+)/n) { |x|
if $1
"&-"
else
- base64 = [$&.unpack("U*").pack("n*")].pack("m")
+ base64 = [u8tou16(x)].pack("m")
"&" + base64.delete("=\n").tr("/", ",") + "-"
end
- }.force_encoding("ASCII-8BIT")
+ }
end
private
CRLF = "\r\n" # :nodoc:
PORT = 143 # :nodoc:
- SSL_PORT = 993 # :nodoc:
@@debug = false
@@authenticators = {}
- # call-seq:
- # Net::IMAP.new(host, options = {})
- #
# Creates a new Net::IMAP object and connects it to the specified
- # +host+.
- #
- # +options+ is an option hash, each key of which is a symbol.
- #
- # The available options are:
- #
- # port:: port number (default value is 143 for imap, or 993 for imaps)
- # 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.
+ # +port+ (143 by default) on the named +host+. If +usessl+ 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. The +certs+ parameter indicates
+ # the path or file containing the CA cert of the server, and the
+ # +verify+ parameter is for the OpenSSL verification callback.
#
# The most common errors are:
#
@@ -908,46 +876,48 @@ module Net
# being dropped by an intervening firewall).
# Errno::ENETUNREACH:: there is no route to that network.
# SocketError:: hostname not known or other socket error.
- # Net::IMAP::ByeResponseError:: we connected to the host, but they
+ # Net::IMAP::ByeResponseError:: we connected to the host, but they
# immediately said goodbye to us.
- def initialize(host, port_or_options = {},
- usessl = false, certs = nil, verify = true)
+ def initialize(host, port = PORT, usessl = false, certs = nil, verify = false)
super()
@host = host
- begin
- options = port_or_options.to_hash
- rescue NoMethodError
- # for backward compatibility
- options = {}
- options[:port] = port_or_options
- if usessl
- options[:ssl] = create_ssl_params(certs, verify)
- end
- end
- @port = options[:port] || (options[:ssl] ? SSL_PORT : PORT)
+ @port = port
@tag_prefix = "RUBY"
@tagno = 0
@parser = ResponseParser.new
- @sock = TCPSocket.open(@host, @port)
- if options[:ssl]
- start_tls_session(options[:ssl])
+ @sock = TCPSocket.open(host, port)
+ if usessl
+ unless defined?(OpenSSL)
+ raise "SSL extension not installed"
+ end
@usessl = true
+
+ # verify the server.
+ context = SSLContext::new()
+ context.ca_file = certs if certs && FileTest::file?(certs)
+ context.ca_path = certs if certs && FileTest::directory?(certs)
+ context.verify_mode = VERIFY_PEER if verify
+ if defined?(VerifyCallbackProc)
+ context.verify_callback = VerifyCallbackProc
+ end
+ @sock = SSLSocket.new(@sock, context)
+ @sock.connect # start ssl session.
+ @sock.post_connection_check(@host) if verify
else
@usessl = false
end
@responses = Hash.new([].freeze)
@tagged_responses = {}
@response_handlers = []
- @tagged_response_arrival = new_cond
- @continuation_request_arrival = new_cond
+ @response_arrival = new_cond
+ @continuation_request = nil
@logout_command_tag = nil
@debug_output_bol = true
- @exception = nil
@greeting = get_response
if @greeting.name == "BYE"
@sock.close
- raise ByeResponseError, @greeting
+ raise ByeResponseError, @greeting.raw_data
end
@client_thread = Thread.current
@@ -958,30 +928,20 @@ module Net
def receive_responses
while true
- synchronize do
- @exception = nil
- end
begin
resp = get_response
- rescue Exception => e
- synchronize do
- @sock.close
- @exception = e
- end
- break
- end
- unless resp
- synchronize do
- @exception = EOFError.new("end of file reached")
- end
+ rescue Exception
+ @sock.close
+ @client_thread.raise($!)
break
end
+ break unless resp
begin
synchronize do
case resp
when TaggedResponse
@tagged_responses[resp.tag] = resp
- @tagged_response_arrival.broadcast
+ @response_arrival.broadcast
if resp.tag == @logout_command_tag
return
end
@@ -993,41 +953,36 @@ module Net
end
if resp.name == "BYE" && @logout_command_tag.nil?
@sock.close
- @exception = ByeResponseError.new(resp)
- break
+ raise ByeResponseError, resp.raw_data
end
when ContinuationRequest
- @continuation_request_arrival.signal
+ @continuation_request = resp
+ @response_arrival.broadcast
end
@response_handlers.each do |handler|
handler.call(resp)
end
end
- rescue Exception => e
- @exception = e
- synchronize do
- @tagged_response_arrival.broadcast
- @continuation_request_arrival.broadcast
- end
+ rescue Exception
+ @client_thread.raise($!)
end
end
- synchronize do
- @tagged_response_arrival.broadcast
- @continuation_request_arrival.broadcast
- end
end
- def get_tagged_response(tag, cmd)
+ def get_tagged_response(tag)
until @tagged_responses.key?(tag)
- raise @exception if @exception
- @tagged_response_arrival.wait
+ @response_arrival.wait
end
+ return pick_up_tagged_response(tag)
+ end
+
+ def pick_up_tagged_response(tag)
resp = @tagged_responses.delete(tag)
case resp.name
when /\A(?:NO)\z/ni
- raise NoResponseError, resp
+ raise NoResponseError, resp.data.text
when /\A(?:BAD)\z/ni
- raise BadResponseError, resp
+ raise BadResponseError, resp.data.text
else
return resp
end
@@ -1062,10 +1017,7 @@ module Net
def send_command(cmd, *args, &block)
synchronize do
- args.each do |i|
- validate_data(i)
- end
- tag = generate_tag
+ tag = Thread.current[:net_imap_tag] = generate_tag
put_string(tag + " " + cmd)
args.each do |i|
put_string(" ")
@@ -1079,7 +1031,7 @@ module Net
add_response_handler(block)
end
begin
- return get_tagged_response(tag, cmd)
+ return get_tagged_response(tag)
ensure
if block
remove_response_handler(block)
@@ -1092,7 +1044,7 @@ module Net
@tagno += 1
return format("%s%04d", @tag_prefix, @tagno)
end
-
+
def put_string(str)
@sock.print(str)
if @@debug
@@ -1108,25 +1060,6 @@ module Net
end
end
- def validate_data(data)
- case data
- when nil
- when String
- when Integer
- if data < 0 || data >= 4294967296
- raise DataFormatError, num.to_s
- end
- when Array
- data.each do |i|
- validate_data(i)
- end
- when Time
- when Symbol
- else
- data.validate
- end
- end
-
def send_data(data)
case data
when nil
@@ -1160,19 +1093,29 @@ module Net
put_string(str)
end
end
-
+
def send_quoted_string(str)
put_string('"' + str.gsub(/["\\]/n, "\\\\\\&") + '"')
end
def send_literal(str)
put_string("{" + str.length.to_s + "}" + CRLF)
- @continuation_request_arrival.wait
- raise @exception if @exception
+ while @continuation_request.nil? &&
+ !@tagged_responses.key?(Thread.current[:net_imap_tag])
+ @response_arrival.wait
+ end
+ if @continuation_request.nil?
+ pick_up_tagged_response(Thread.current[:net_imap_tag])
+ raise ResponseError.new("expected continuation request")
+ end
+ @continuation_request = nil
put_string(str)
end
def send_number_data(num)
+ if num < 0 || num >= 4294967296
+ raise DataFormatError, num.to_s
+ end
put_string(num.to_s)
end
@@ -1281,56 +1224,130 @@ module Net
end
end
- def create_ssl_params(certs = nil, verify = true)
- params = {}
- if certs
- if File.file?(certs)
- params[:ca_file] = certs
- elsif File.directory?(certs)
- params[:ca_path] = certs
+ def self.u16tou8(s)
+ len = s.length
+ if len < 2
+ return ""
+ end
+ buf = ""
+ i = 0
+ while i < len
+ c = s[i] << 8 | s[i + 1]
+ i += 2
+ if c == 0xfeff
+ next
+ elsif c < 0x0080
+ buf.concat(c)
+ elsif c < 0x0800
+ b2 = c & 0x003f
+ b1 = c >> 6
+ buf.concat(b1 | 0xc0)
+ buf.concat(b2 | 0x80)
+ elsif c >= 0xdc00 && c < 0xe000
+ raise DataFormatError, "invalid surrogate detected"
+ elsif c >= 0xd800 && c < 0xdc00
+ if i + 2 > len
+ raise DataFormatError, "invalid surrogate detected"
+ end
+ low = s[i] << 8 | s[i + 1]
+ i += 2
+ if low < 0xdc00 || low > 0xdfff
+ raise DataFormatError, "invalid surrogate detected"
+ end
+ c = (((c & 0x03ff)) << 10 | (low & 0x03ff)) + 0x10000
+ b4 = c & 0x003f
+ b3 = (c >> 6) & 0x003f
+ b2 = (c >> 12) & 0x003f
+ b1 = c >> 18;
+ buf.concat(b1 | 0xf0)
+ buf.concat(b2 | 0x80)
+ buf.concat(b3 | 0x80)
+ buf.concat(b4 | 0x80)
+ else # 0x0800-0xffff
+ b3 = c & 0x003f
+ b2 = (c >> 6) & 0x003f
+ b1 = c >> 12
+ buf.concat(b1 | 0xe0)
+ buf.concat(b2 | 0x80)
+ buf.concat(b3 | 0x80)
+ end
+ end
+ return buf
+ end
+ private_class_method :u16tou8
+
+ def self.u8tou16(s)
+ len = s.length
+ buf = ""
+ i = 0
+ while i < len
+ c = s[i]
+ if (c & 0x80) == 0
+ buf.concat(0x00)
+ buf.concat(c)
+ i += 1
+ elsif (c & 0xe0) == 0xc0 &&
+ len >= 2 &&
+ (s[i + 1] & 0xc0) == 0x80
+ if c == 0xc0 || c == 0xc1
+ raise DataFormatError, format("non-shortest UTF-8 sequence (%02x)", c)
+ end
+ u = ((c & 0x1f) << 6) | (s[i + 1] & 0x3f)
+ buf.concat(u >> 8)
+ buf.concat(u & 0x00ff)
+ i += 2
+ elsif (c & 0xf0) == 0xe0 &&
+ i + 2 < len &&
+ (s[i + 1] & 0xc0) == 0x80 &&
+ (s[i + 2] & 0xc0) == 0x80
+ if c == 0xe0 && s[i + 1] < 0xa0
+ raise DataFormatError, format("non-shortest UTF-8 sequence (%02x)", c)
+ end
+ u = ((c & 0x0f) << 12) | ((s[i + 1] & 0x3f) << 6) | (s[i + 2] & 0x3f)
+ # surrogate chars
+ if u >= 0xd800 && u <= 0xdfff
+ raise DataFormatError, format("none-UTF-16 char detected (%04x)", u)
+ end
+ buf.concat(u >> 8)
+ buf.concat(u & 0x00ff)
+ i += 3
+ elsif (c & 0xf8) == 0xf0 &&
+ i + 3 < len &&
+ (s[i + 1] & 0xc0) == 0x80 &&
+ (s[i + 2] & 0xc0) == 0x80 &&
+ (s[i + 3] & 0xc0) == 0x80
+ if c == 0xf0 && s[i + 1] < 0x90
+ raise DataFormatError, format("non-shortest UTF-8 sequence (%02x)", c)
+ end
+ u = ((c & 0x07) << 18) | ((s[i + 1] & 0x3f) << 12) |
+ ((s[i + 2] & 0x3f) << 6) | (s[i + 3] & 0x3f)
+ if u < 0x10000
+ buf.concat(u >> 8)
+ buf.concat(u & 0x00ff)
+ elsif u < 0x110000
+ high = ((u - 0x10000) >> 10) | 0xd800
+ low = (u & 0x03ff) | 0xdc00
+ buf.concat(high >> 8)
+ buf.concat(high & 0x00ff)
+ buf.concat(low >> 8)
+ buf.concat(low & 0x00ff)
+ else
+ raise DataFormatError, format("none-UTF-16 char detected (%04x)", u)
+ end
+ i += 4
+ else
+ raise DataFormatError, format("illegal UTF-8 sequence (%02x)", c)
end
end
- if verify
- params[:verify_mode] = VERIFY_PEER
- else
- params[:verify_mode] = VERIFY_NONE
- end
- return params
- end
-
- def start_tls_session(params = {})
- unless defined?(OpenSSL)
- raise "SSL extension not installed"
- end
- if @sock.kind_of?(OpenSSL::SSL::SSLSocket)
- raise RuntimeError, "already using SSL"
- end
- begin
- params = params.to_hash
- rescue NoMethodError
- params = {}
- end
- context = SSLContext.new
- context.set_params(params)
- if defined?(VerifyCallbackProc)
- context.verify_callback = VerifyCallbackProc
- end
- @sock = SSLSocket.new(@sock, context)
- @sock.sync_close = true
- @sock.connect
- if context.verify_mode != VERIFY_NONE
- @sock.post_connection_check(@host)
- end
+ return buf
end
+ private_class_method :u8tou16
class RawData # :nodoc:
def send_data(imap)
imap.send(:put_string, @data)
end
- def validate
- end
-
private
def initialize(data)
@@ -1343,9 +1360,6 @@ module Net
imap.send(:put_string, @data)
end
- def validate
- end
-
private
def initialize(data)
@@ -1358,9 +1372,6 @@ module Net
imap.send(:send_quoted_string, @data)
end
- def validate
- end
-
private
def initialize(data)
@@ -1373,9 +1384,6 @@ module Net
imap.send(:send_literal, @data)
end
- def validate
- end
-
private
def initialize(data)
@@ -1388,10 +1396,6 @@ module Net
imap.send(:put_string, format_internal(@data))
end
- def validate
- validate_internal(@data)
- end
-
private
def initialize(data)
@@ -1403,6 +1407,7 @@ module Net
when "*"
return data
when Integer
+ ensure_nz_number(data)
if data == -1
return "*"
else
@@ -1416,23 +1421,6 @@ module Net
when ThreadMember
return data.seqno.to_s +
":" + data.children.collect {|i| format_internal(i).join(",")}
- end
- end
-
- def validate_internal(data)
- case data
- when "*"
- when Integer
- ensure_nz_number(data)
- when Range
- when Array
- data.each do |i|
- validate_internal(i)
- end
- when ThreadMember
- data.children.each do |i|
- validate_internal(i)
- end
else
raise DataFormatError, data.inspect
end
@@ -1448,109 +1436,109 @@ module Net
end
# Net::IMAP::ContinuationRequest represents command continuation requests.
- #
+ #
# The command continuation request response is indicated by a "+" token
# instead of a tag. This form of response indicates that the server is
# ready to accept the continuation of a command from the client. The
# remainder of this response is a line of text.
- #
+ #
# continue_req ::= "+" SPACE (resp_text / base64)
- #
+ #
# ==== Fields:
- #
+ #
# data:: Returns the data (Net::IMAP::ResponseText).
- #
+ #
# raw_data:: Returns the raw data string.
ContinuationRequest = Struct.new(:data, :raw_data)
# Net::IMAP::UntaggedResponse represents untagged responses.
- #
+ #
# Data transmitted by the server to the client and status responses
# that do not indicate command completion are prefixed with the token
# "*", and are called untagged responses.
- #
+ #
# response_data ::= "*" SPACE (resp_cond_state / resp_cond_bye /
# mailbox_data / message_data / capability_data)
- #
+ #
# ==== Fields:
- #
+ #
# name:: Returns the name such as "FLAGS", "LIST", "FETCH"....
- #
+ #
# data:: Returns the data such as an array of flag symbols,
# a ((<Net::IMAP::MailboxList>)) object....
- #
+ #
# raw_data:: Returns the raw data string.
UntaggedResponse = Struct.new(:name, :data, :raw_data)
-
+
# Net::IMAP::TaggedResponse represents tagged responses.
- #
+ #
# The server completion result response indicates the success or
# failure of the operation. It is tagged with the same tag as the
# client command which began the operation.
- #
+ #
# response_tagged ::= tag SPACE resp_cond_state CRLF
- #
+ #
# tag ::= 1*<any ATOM_CHAR except "+">
- #
+ #
# resp_cond_state ::= ("OK" / "NO" / "BAD") SPACE resp_text
- #
+ #
# ==== Fields:
- #
+ #
# tag:: Returns the tag.
- #
+ #
# name:: Returns the name. the name is one of "OK", "NO", "BAD".
- #
+ #
# data:: Returns the data. See ((<Net::IMAP::ResponseText>)).
- #
+ #
# raw_data:: Returns the raw data string.
#
TaggedResponse = Struct.new(:tag, :name, :data, :raw_data)
-
+
# Net::IMAP::ResponseText represents texts of responses.
# The text may be prefixed by the response code.
- #
+ #
# resp_text ::= ["[" resp_text_code "]" SPACE] (text_mime2 / text)
# ;; text SHOULD NOT begin with "[" or "="
- #
+ #
# ==== Fields:
- #
+ #
# code:: Returns the response code. See ((<Net::IMAP::ResponseCode>)).
- #
+ #
# text:: Returns the text.
- #
+ #
ResponseText = Struct.new(:code, :text)
- #
+ #
# Net::IMAP::ResponseCode represents response codes.
- #
+ #
# resp_text_code ::= "ALERT" / "PARSE" /
# "PERMANENTFLAGS" SPACE "(" #(flag / "\*") ")" /
# "READ-ONLY" / "READ-WRITE" / "TRYCREATE" /
# "UIDVALIDITY" SPACE nz_number /
# "UNSEEN" SPACE nz_number /
# atom [SPACE 1*<any TEXT_CHAR except "]">]
- #
+ #
# ==== Fields:
- #
+ #
# name:: Returns the name such as "ALERT", "PERMANENTFLAGS", "UIDVALIDITY"....
- #
+ #
# data:: Returns the data if it exists.
#
ResponseCode = Struct.new(:name, :data)
# Net::IMAP::MailboxList represents contents of the LIST response.
- #
+ #
# mailbox_list ::= "(" #("\Marked" / "\Noinferiors" /
# "\Noselect" / "\Unmarked" / flag_extension) ")"
# SPACE (<"> QUOTED_CHAR <"> / nil) SPACE mailbox
- #
+ #
# ==== Fields:
- #
+ #
# attr:: Returns the name attributes. Each name attribute is a symbol
# capitalized by String#capitalize, such as :Noselect (not :NoSelect).
- #
+ #
# delim:: Returns the hierarchy delimiter
- #
+ #
# name:: Returns the mailbox name.
#
MailboxList = Struct.new(:attr, :delim, :name)
@@ -1559,78 +1547,78 @@ module Net
# This object can also be a response to GETQUOTAROOT. In the syntax
# specification below, the delimiter used with the "#" construct is a
# single space (SPACE).
- #
+ #
# quota_list ::= "(" #quota_resource ")"
- #
+ #
# quota_resource ::= atom SPACE number SPACE number
- #
+ #
# quota_response ::= "QUOTA" SPACE astring SPACE quota_list
- #
+ #
# ==== Fields:
- #
+ #
# mailbox:: The mailbox with the associated quota.
- #
+ #
# usage:: Current storage usage of mailbox.
- #
+ #
# quota:: Quota limit imposed on mailbox.
#
MailboxQuota = Struct.new(:mailbox, :usage, :quota)
# Net::IMAP::MailboxQuotaRoot represents part of the GETQUOTAROOT
# response. (GETQUOTAROOT can also return Net::IMAP::MailboxQuota.)
- #
+ #
# quotaroot_response ::= "QUOTAROOT" SPACE astring *(SPACE astring)
- #
+ #
# ==== Fields:
- #
+ #
# mailbox:: The mailbox with the associated quota.
- #
+ #
# quotaroots:: Zero or more quotaroots that effect the quota on the
# specified mailbox.
#
MailboxQuotaRoot = Struct.new(:mailbox, :quotaroots)
# Net::IMAP::MailboxACLItem represents response from GETACL.
- #
+ #
# acl_data ::= "ACL" SPACE mailbox *(SPACE identifier SPACE rights)
- #
+ #
# identifier ::= astring
- #
+ #
# rights ::= astring
- #
+ #
# ==== Fields:
- #
+ #
# user:: Login name that has certain rights to the mailbox
# that was specified with the getacl command.
- #
+ #
# rights:: The access rights the indicated user has to the
# mailbox.
#
MailboxACLItem = Struct.new(:user, :rights)
# Net::IMAP::StatusData represents contents of the STATUS response.
- #
+ #
# ==== Fields:
- #
+ #
# mailbox:: Returns the mailbox name.
- #
+ #
# attr:: Returns a hash. Each key is one of "MESSAGES", "RECENT", "UIDNEXT",
# "UIDVALIDITY", "UNSEEN". Each value is a number.
- #
+ #
StatusData = Struct.new(:mailbox, :attr)
# Net::IMAP::FetchData represents contents of the FETCH response.
- #
+ #
# ==== Fields:
- #
+ #
# seqno:: Returns the message sequence number.
# (Note: not the unique identifier, even for the UID command response.)
- #
+ #
# attr:: Returns a hash. Each key is a data item name, and each value is
# its value.
- #
+ #
# The current data items are:
- #
+ #
# [BODY]
# A form of BODYSTRUCTURE without extension data.
# [BODY[<section>]<<origin_octet>>]
@@ -1657,67 +1645,67 @@ module Net
# Equivalent to BODY[TEXT].
# [UID]
# A number expressing the unique identifier of the message.
- #
+ #
FetchData = Struct.new(:seqno, :attr)
# Net::IMAP::Envelope represents envelope structures of messages.
- #
+ #
# ==== Fields:
- #
+ #
# date:: Returns a string that represents the date.
- #
+ #
# subject:: Returns a string that represents the subject.
- #
+ #
# from:: Returns an array of Net::IMAP::Address that represents the from.
- #
+ #
# sender:: Returns an array of Net::IMAP::Address that represents the sender.
- #
+ #
# reply_to:: Returns an array of Net::IMAP::Address that represents the reply-to.
- #
+ #
# to:: Returns an array of Net::IMAP::Address that represents the to.
- #
+ #
# cc:: Returns an array of Net::IMAP::Address that represents the cc.
- #
+ #
# bcc:: Returns an array of Net::IMAP::Address that represents the bcc.
- #
+ #
# in_reply_to:: Returns a string that represents the in-reply-to.
- #
+ #
# message_id:: Returns a string that represents the message-id.
- #
+ #
Envelope = Struct.new(:date, :subject, :from, :sender, :reply_to,
:to, :cc, :bcc, :in_reply_to, :message_id)
- #
+ #
# Net::IMAP::Address represents electronic mail addresses.
- #
+ #
# ==== Fields:
- #
+ #
# name:: Returns the phrase from [RFC-822] mailbox.
- #
+ #
# route:: Returns the route from [RFC-822] route-addr.
- #
+ #
# mailbox:: nil indicates end of [RFC-822] group.
# If non-nil and host is nil, returns [RFC-822] group name.
# Otherwise, returns [RFC-822] local-part
- #
+ #
# host:: nil indicates [RFC-822] group syntax.
# Otherwise, returns [RFC-822] domain name.
#
Address = Struct.new(:name, :route, :mailbox, :host)
- #
+ #
# Net::IMAP::ContentDisposition represents Content-Disposition fields.
- #
+ #
# ==== Fields:
- #
+ #
# dsp_type:: Returns the disposition type.
- #
+ #
# param:: Returns a hash that represents parameters of the Content-Disposition
# field.
- #
+ #
ContentDisposition = Struct.new(:dsp_type, :param)
- # Net::IMAP::ThreadMember represents a thread-node returned
+ # Net::IMAP::ThreadMember represents a thread-node returned
# by Net::IMAP#thread
#
# ==== Fields:
@@ -1730,37 +1718,37 @@ module Net
ThreadMember = Struct.new(:seqno, :children)
# Net::IMAP::BodyTypeBasic represents basic body structures of messages.
- #
+ #
# ==== Fields:
- #
+ #
# media_type:: Returns the content media type name as defined in [MIME-IMB].
- #
+ #
# subtype:: Returns the content subtype name as defined in [MIME-IMB].
- #
+ #
# param:: Returns a hash that represents parameters as defined in [MIME-IMB].
- #
+ #
# content_id:: Returns a string giving the content id as defined in [MIME-IMB].
- #
+ #
# description:: Returns a string giving the content description as defined in
# [MIME-IMB].
- #
+ #
# encoding:: Returns a string giving the content transfer encoding as defined in
# [MIME-IMB].
- #
+ #
# size:: Returns a number giving the size of the body in octets.
- #
+ #
# md5:: Returns a string giving the body MD5 value as defined in [MD5].
- #
+ #
# disposition:: Returns a Net::IMAP::ContentDisposition object giving
# the content disposition.
- #
+ #
# language:: Returns a string or an array of strings giving the body
# language value as defined in [LANGUAGE-TAGS].
- #
+ #
# extension:: Returns extension data.
- #
+ #
# multipart?:: Returns false.
- #
+ #
class BodyTypeBasic < Struct.new(:media_type, :subtype,
:param, :content_id,
:description, :encoding, :size,
@@ -1771,7 +1759,7 @@ module Net
end
# Obsolete: use +subtype+ instead. Calling this will
- # generate a warning message to +stderr+, then return
+ # generate a warning message to +stderr+, then return
# the value of +subtype+.
def media_subtype
$stderr.printf("warning: media_subtype is obsolete.\n")
@@ -1781,13 +1769,13 @@ module Net
end
# Net::IMAP::BodyTypeText represents TEXT body structures of messages.
- #
+ #
# ==== Fields:
- #
+ #
# lines:: Returns the size of the body in text lines.
- #
+ #
# And Net::IMAP::BodyTypeText has all fields of Net::IMAP::BodyTypeBasic.
- #
+ #
class BodyTypeText < Struct.new(:media_type, :subtype,
:param, :content_id,
:description, :encoding, :size,
@@ -1799,7 +1787,7 @@ module Net
end
# Obsolete: use +subtype+ instead. Calling this will
- # generate a warning message to +stderr+, then return
+ # generate a warning message to +stderr+, then return
# the value of +subtype+.
def media_subtype
$stderr.printf("warning: media_subtype is obsolete.\n")
@@ -1809,13 +1797,13 @@ module Net
end
# Net::IMAP::BodyTypeMessage represents MESSAGE/RFC822 body structures of messages.
- #
+ #
# ==== Fields:
- #
+ #
# envelope:: Returns a Net::IMAP::Envelope giving the envelope structure.
- #
+ #
# body:: Returns an object giving the body structure.
- #
+ #
# And Net::IMAP::BodyTypeMessage has all methods of Net::IMAP::BodyTypeText.
#
class BodyTypeMessage < Struct.new(:media_type, :subtype,
@@ -1829,7 +1817,7 @@ module Net
end
# Obsolete: use +subtype+ instead. Calling this will
- # generate a warning message to +stderr+, then return
+ # generate a warning message to +stderr+, then return
# the value of +subtype+.
def media_subtype
$stderr.printf("warning: media_subtype is obsolete.\n")
@@ -1838,29 +1826,29 @@ module Net
end
end
- # Net::IMAP::BodyTypeMultipart represents multipart body structures
+ # Net::IMAP::BodyTypeMultipart represents multipart body structures
# of messages.
- #
+ #
# ==== Fields:
- #
+ #
# media_type:: Returns the content media type name as defined in [MIME-IMB].
- #
+ #
# subtype:: Returns the content subtype name as defined in [MIME-IMB].
- #
+ #
# parts:: Returns multiple parts.
- #
+ #
# param:: Returns a hash that represents parameters as defined in [MIME-IMB].
- #
+ #
# disposition:: Returns a Net::IMAP::ContentDisposition object giving
# the content disposition.
- #
+ #
# language:: Returns a string or an array of strings giving the body
# language value as defined in [LANGUAGE-TAGS].
- #
+ #
# extension:: Returns extension data.
- #
+ #
# multipart?:: Returns true.
- #
+ #
class BodyTypeMultipart < Struct.new(:media_type, :subtype,
:parts,
:param, :disposition, :language,
@@ -1870,7 +1858,7 @@ module Net
end
# Obsolete: use +subtype+ instead. Calling this will
- # generate a warning message to +stderr+, then return
+ # generate a warning message to +stderr+, then return
# the value of +subtype+.
def media_subtype
$stderr.printf("warning: media_subtype is obsolete.\n")
@@ -2671,35 +2659,35 @@ module Net
def thread_branch(token)
rootmember = nil
lastmember = nil
-
+
while true
shift_token # ignore first T_LPAR
token = lookahead
-
+
case token.symbol
when T_NUMBER
# new member
newmember = ThreadMember.new(number, [])
if rootmember.nil?
rootmember = newmember
- else
+ else
lastmember.children << newmember
- end
+ end
lastmember = newmember
- when T_SPACE
- # do nothing
+ when T_SPACE
+ # do nothing
when T_LPAR
if rootmember.nil?
# dummy member
lastmember = rootmember = ThreadMember.new(nil, [])
- end
-
+ end
+
lastmember.children << thread_branch(token)
when T_RPAR
- break
- end
+ break
+ end
end
-
+
return rootmember
end
@@ -3119,7 +3107,7 @@ module Net
parse_error("unknown token - %s", $&.dump)
end
else
- parse_error("invalid @lex_state - %s", @lex_state.inspect)
+ parse_error("illegal @lex_state - %s", @lex_state.inspect)
end
end
@@ -3163,22 +3151,6 @@ module Net
end
add_authenticator "LOGIN", LoginAuthenticator
- # Authenticator for the "PLAIN" authentication type. See
- # #authenticate().
- class PlainAuthenticator
- def process(data)
- return "\0#{@user}\0#{@password}"
- end
-
- private
-
- def initialize(user, password)
- @user = user
- @password = password
- end
- end
- add_authenticator "PLAIN", PlainAuthenticator
-
# Authenticator for the "CRAM-MD5" authentication type. See
# #authenticate().
class CramMD5Authenticator
@@ -3202,8 +3174,8 @@ module Net
k_ipad = key + "\0" * (64 - key.length)
k_opad = key + "\0" * (64 - key.length)
for i in 0..63
- k_ipad[i] = (k_ipad[i].ord ^ 0x36).chr
- k_opad[i] = (k_opad[i].ord ^ 0x5c).chr
+ k_ipad[i] ^= 0x36
+ k_opad[i] ^= 0x5c
end
digest = Digest::MD5.digest(k_ipad + text)
@@ -3213,106 +3185,6 @@ module Net
end
add_authenticator "CRAM-MD5", CramMD5Authenticator
- # Authenticator for the "DIGEST-MD5" authentication type. See
- # #authenticate().
- class DigestMD5Authenticator
- def process(challenge)
- case @stage
- when STAGE_ONE
- @stage = STAGE_TWO
- sparams = {}
- c = StringScanner.new(challenge)
- while c.scan(/(?:\s*,)?\s*(\w+)=("(?:[^\\"]+|\\.)*"|[^,]+)\s*/)
- k, v = c[1], c[2]
- if v =~ /^"(.*)"$/
- v = $1
- if v =~ /,/
- v = v.split(',')
- end
- end
- sparams[k] = v
- end
-
- raise DataFormatError, "Bad Challenge: '#{challenge}'" unless c.rest.size == 0
- raise Error, "Server does not support auth (qop = #{sparams['qop'].join(',')})" unless sparams['qop'].include?("auth")
-
- response = {
- :nonce => sparams['nonce'],
- :username => @user,
- :realm => sparams['realm'],
- :cnonce => Digest::MD5.hexdigest("%.15f:%.15f:%d" % [Time.now.to_f, rand, Process.pid.to_s]),
- :'digest-uri' => 'imap/' + sparams['realm'],
- :qop => 'auth',
- :maxbuf => 65535,
- :nc => "%08d" % nc(sparams['nonce']),
- :charset => sparams['charset'],
- }
-
- response[:authzid] = @authname unless @authname.nil?
-
- # now, the real thing
- a0 = Digest::MD5.digest( [ response.values_at(:username, :realm), @password ].join(':') )
-
- a1 = [ a0, response.values_at(:nonce,:cnonce) ].join(':')
- a1 << ':' + response[:authzid] unless response[:authzid].nil?
-
- a2 = "AUTHENTICATE:" + response[:'digest-uri']
- a2 << ":00000000000000000000000000000000" if response[:qop] and response[:qop] =~ /^auth-(?:conf|int)$/
-
- response[:response] = Digest::MD5.hexdigest(
- [
- Digest::MD5.hexdigest(a1),
- response.values_at(:nonce, :nc, :cnonce, :qop),
- Digest::MD5.hexdigest(a2)
- ].join(':')
- )
-
- return response.keys.map {|key| qdval(key.to_s, response[key]) }.join(',')
- when STAGE_TWO
- @stage = nil
- # if at the second stage, return an empty string
- if challenge =~ /rspauth=/
- return ''
- else
- raise ResponseParseError, challenge
- end
- else
- raise ResponseParseError, challenge
- end
- end
-
- def initialize(user, password, authname = nil)
- @user, @password, @authname = user, password, authname
- @nc, @stage = {}, STAGE_ONE
- end
-
- private
-
- STAGE_ONE = :stage_one
- STAGE_TWO = :stage_two
-
- def nc(nonce)
- if @nc.has_key? nonce
- @nc[nonce] = @nc[nonce] + 1
- else
- @nc[nonce] = 1
- end
- return @nc[nonce]
- end
-
- # some responses need quoting
- def qdval(k, v)
- return if k.nil? or v.nil?
- if %w"username authzid realm nonce cnonce digest-uri qop".include? k
- v.gsub!(/([\\"])/, "\\\1")
- return '%s="%s"' % [k, v]
- else
- return '%s=%s' % [k, v]
- end
- end
- end
- add_authenticator "DIGEST-MD5", DigestMD5Authenticator
-
# Superclass of IMAP errors.
class Error < StandardError
end
@@ -3328,16 +3200,6 @@ module Net
# Superclass of all errors used to encapsulate "fail" responses
# from the server.
class ResponseError < Error
-
- # The response that caused this error
- attr_accessor :response
-
- def initialize(response)
- @response = response
-
- super @response.data.text
- end
-
end
# Error raised upon a "NO" response from the server, indicating
@@ -3351,7 +3213,7 @@ module Net
class BadResponseError < ResponseError
end
- # Error raised upon a "BYE" response from the server, indicating
+ # Error raised upon a "BYE" response from the server, indicating
# that the client is not being allowed to login, or has been timed
# out due to inactivity.
class ByeResponseError < ResponseError
@@ -3436,8 +3298,9 @@ EOF
usage
exit(1)
end
-
- imap = Net::IMAP.new($host, :port => $port, :ssl => $ssl)
+ $port ||= $ssl ? 993 : 143
+
+ imap = Net::IMAP.new($host, $port, $ssl)
begin
password = get_password
imap.authenticate($auth, $user, password)
diff --git a/lib/net/pop.rb b/lib/net/pop.rb
index 6a45e3b5f0..9a6a25266f 100644
--- a/lib/net/pop.rb
+++ b/lib/net/pop.rb
@@ -3,20 +3,20 @@
# Copyright (c) 1999-2007 Yukihiro Matsumoto.
#
# Copyright (c) 1999-2007 Minero Aoki.
-#
+#
# Written & maintained by Minero Aoki <aamine@loveruby.net>.
#
# Documented by William Webber and Minero Aoki.
-#
+#
# This program is free software. You can re-distribute and/or
# modify this program under the same terms as Ruby itself,
# Ruby Distribute License.
-#
+#
# NOTE: You can find Japanese version of this document at:
# http://www.ruby-lang.org/ja/man/html/net_pop.html
-#
+#
# $Id$
-#
+#
# See Net::POP3 for documentation.
#
@@ -25,7 +25,7 @@ require 'digest/md5'
require 'timeout'
begin
- require "openssl"
+ require "openssl/ssl"
rescue LoadError
end
@@ -45,25 +45,25 @@ module Net
# = Net::POP3
#
# == What is This Library?
- #
- # This library provides functionality for retrieving
+ #
+ # This library provides functionality for retrieving
# email via POP3, the Post Office Protocol version 3. For details
# of POP3, see [RFC1939] (http://www.ietf.org/rfc/rfc1939.txt).
- #
+ #
# == Examples
- #
- # === Retrieving Messages
- #
- # This example retrieves messages from the server and deletes them
+ #
+ # === Retrieving Messages
+ #
+ # This example retrieves messages from the server and deletes them
# on the server.
#
# Messages are written to files named 'inbox/1', 'inbox/2', ....
# Replace 'pop.example.com' with your POP3 server address, and
# 'YourAccount' and 'YourPassword' with the appropriate account
# details.
- #
+ #
# require 'net/pop'
- #
+ #
# pop = Net::POP3.new('pop.example.com')
# pop.start('YourAccount', 'YourPassword') # (1)
# if pop.mails.empty?
@@ -80,19 +80,19 @@ module Net
# puts "#{pop.mails.size} mails popped."
# end
# pop.finish # (3)
- #
+ #
# 1. Call Net::POP3#start and start POP session.
# 2. Access messages by using POP3#each_mail and/or POP3#mails.
# 3. Close POP session by calling POP3#finish or use the block form of #start.
- #
+ #
# === Shortened Code
- #
+ #
# The example above is very verbose. You can shorten the code by using
# some utility methods. First, the block form of Net::POP3.start can
# be used instead of POP3.new, POP3#start and POP3#finish.
- #
+ #
# require 'net/pop'
- #
+ #
# Net::POP3.start('pop.example.com', 110,
# 'YourAccount', 'YourPassword') do |pop|
# if pop.mails.empty?
@@ -109,11 +109,11 @@ module Net
# puts "#{pop.mails.size} mails popped."
# end
# end
- #
+ #
# POP3#delete_all is an alternative for #each_mail and #delete.
- #
+ #
# require 'net/pop'
- #
+ #
# Net::POP3.start('pop.example.com', 110,
# 'YourAccount', 'YourPassword') do |pop|
# if pop.mails.empty?
@@ -128,11 +128,11 @@ module Net
# end
# end
# end
- #
+ #
# And here is an even shorter example.
- #
+ #
# require 'net/pop'
- #
+ #
# i = 0
# Net::POP3.delete_all('pop.example.com', 110,
# 'YourAccount', 'YourPassword') do |m|
@@ -141,14 +141,14 @@ module Net
# end
# i += 1
# end
- #
+ #
# === Memory Space Issues
- #
+ #
# All the examples above get each message as one big string.
# This example avoids this.
- #
+ #
# require 'net/pop'
- #
+ #
# i = 1
# Net::POP3.delete_all('pop.example.com', 110,
# 'YourAccount', 'YourPassword') do |m|
@@ -159,41 +159,41 @@ module Net
# i += 1
# end
# end
- #
+ #
# === Using APOP
- #
+ #
# The net/pop library supports APOP authentication.
# To use APOP, use the Net::APOP class instead of the Net::POP3 class.
# You can use the utility method, Net::POP3.APOP(). For example:
- #
+ #
# require 'net/pop'
- #
+ #
# # Use APOP authentication if $isapop == true
# 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
- #
+ #
# === Fetch Only Selected Mail Using 'UIDL' POP Command
- #
+ #
# If your POP server provides UIDL functionality,
# you can grab only selected mails from the POP server.
# e.g.
- #
+ #
# def need_pop?( id )
# # determine if we need pop this mail...
# end
- #
+ #
# Net::POP3.start('pop.example.com', 110,
# 'Your account', 'Your password') do |pop|
# pop.mails.select { |m| need_pop?(m.unique_id) }.each do |m|
# do_something(m.pop)
# end
# end
- #
+ #
# The POPMail#unique_id() method returns the unique-id of the message as a
# String. Normally the unique-id is a hash of the message.
- #
+ #
class POP3 < Protocol
Revision = %q$Revision$.split[1]
@@ -210,7 +210,7 @@ module Net
def POP3.default_pop3_port
110
end
-
+
# The default port for POP3S connections, port 995
def POP3.default_pop3s_port
995
@@ -375,7 +375,7 @@ module Net
# Session management
#
- # Creates a new POP3 object and open the connection. Equivalent to
+ # Creates a new POP3 object and open the connection. Equivalent to
#
# Net::POP3.new(address, port, isapop).start(account, password)
#
@@ -396,7 +396,7 @@ module Net
isapop = false, &block) # :yield: pop
new(address, port, isapop).start(account, password, &block)
end
-
+
# Creates a new POP3 object.
#
# +address+ is the hostname or ip address of your POP3 server.
@@ -412,7 +412,7 @@ module Net
@ssl_params = POP3.ssl_params
@port = port
@apop = isapop
-
+
@command = nil
@socket = nil
@started = false
@@ -434,7 +434,7 @@ module Net
def use_ssl?
return !@ssl_params.nil?
end
-
+
# call-seq:
# Net::POP#enable_ssl(params = {})
#
@@ -451,7 +451,7 @@ module Net
@port = port || @port
end
end
-
+
def disable_ssl
@ssl_params = nil
end
@@ -635,7 +635,7 @@ module Net
# Yields each message to the passed-in block in turn.
# Equivalent to:
- #
+ #
# pop3.mails.each do |popmail|
# ....
# end
@@ -683,8 +683,9 @@ module Net
end
def set_all_uids #:nodoc: internal use only (called from POPMail#uidl)
- uidl = command().uidl
- @mails.each {|m| m.uid = uidl[m.number] }
+ command().uidl.each do |num, uid|
+ @mails.find {|m| m.number == num }.uid = uid
+ end
end
def logging(msg)
@@ -742,7 +743,7 @@ module Net
#
# This method fetches the message. If called with a block, the
# message is yielded to the block one chunk at a time. If called
- # without a block, the message is returned as a String. The optional
+ # without a block, the message is returned as a String. The optional
# +dest+ argument will be prepended to the returned String; this
# argument is essentially obsolete.
#
@@ -753,7 +754,7 @@ module Net
# n = 1
# pop.mails.each do |popmail|
# File.open("inbox/#{n}", 'w') do |f|
- # f.write popmail.pop
+ # f.write popmail.pop
# end
# popmail.delete
# n += 1
@@ -792,7 +793,7 @@ module Net
alias all pop #:nodoc: obsolete
alias mail pop #:nodoc: obsolete
- # Fetches the message header and +lines+ lines of body.
+ # Fetches the message header and +lines+ lines of body.
#
# The optional +dest+ argument is obsolete.
#
@@ -804,7 +805,7 @@ module Net
dest
end
- # Fetches the message header.
+ # Fetches the message header.
#
# The optional +dest+ argument is obsolete.
#
@@ -873,8 +874,6 @@ module Net
@apop_stamp = res.slice(/<[!-~]+@[!-~]+>/)
end
- attr_reader :socket
-
def inspect
"#<#{self.class} socket=#{@socket}>"
end
@@ -933,7 +932,7 @@ module Net
@socket.each_message_chunk(&block)
}
end
-
+
def dele(num)
check_response(critical { get_response('DELE %d', num) })
end
diff --git a/lib/net/protocol.rb b/lib/net/protocol.rb
index 2a6cfb4f61..dc23c14dfa 100644
--- a/lib/net/protocol.rb
+++ b/lib/net/protocol.rb
@@ -2,8 +2,8 @@
# = net/protocol.rb
#
#--
-# Copyright (c) 1999-2004 Yukihiro Matsumoto
-# Copyright (c) 1999-2004 Minero Aoki
+# Copyright (c) 1999-2005 Yukihiro Matsumoto
+# Copyright (c) 1999-2005 Minero Aoki
#
# written and maintained by Minero Aoki <aamine@loveruby.net>
#
@@ -121,7 +121,7 @@ module Net # :nodoc:
return rbuf_consume(@rbuf.size)
end
end
-
+
def readline
readuntil("\n").chop
end
@@ -131,23 +131,9 @@ module Net # :nodoc:
BUFSIZE = 1024 * 16
def rbuf_fill
- begin
- @rbuf << @io.read_nonblock(BUFSIZE)
- rescue IO::WaitReadable
- if IO.select([@io], nil, nil, @read_timeout)
- retry
- else
- raise Timeout::Error
- end
- rescue IO::WaitWritable
- # OpenSSL::Buffering#read_nonblock may fail with IO::WaitWritable.
- # http://www.openssl.org/support/faq.html#PROG10
- if IO.select(nil, [@io], nil, @read_timeout)
- retry
- else
- raise Timeout::Error
- end
- end
+ timeout(@read_timeout) {
+ @rbuf << @io.sysread(BUFSIZE)
+ }
end
def rbuf_consume(len)
@@ -216,6 +202,16 @@ module Net # :nodoc:
class InternetMessageIO < BufferedIO #:nodoc: internal use only
+ def InternetMessageIO.old_open(addr, port,
+ open_timeout = nil, read_timeout = nil, debug_output = nil)
+ debug_output << "opening connection to #{addr}...\n" if debug_output
+ s = timeout(open_timeout) { TCPsocket.new(addr, port) }
+ io = new(s)
+ io.read_timeout = read_timeout
+ io.debug_output = debug_output
+ io
+ end
+
def initialize(io)
super
@wbuf = nil
@@ -236,7 +232,7 @@ module Net # :nodoc:
LOG_on()
LOG "read message (#{read_bytes} bytes)"
end
-
+
# *library private* (cannot handle 'break')
def each_list_item
while (str = readuntil("\r\n")) != ".\r\n"
@@ -321,8 +317,8 @@ module Net # :nodoc:
yield
end
else # generic reader
- src.each do |str|
- buf << str
+ src.each do |s|
+ buf << s
yield if buf.size > 1024
end
yield unless buf.empty?
diff --git a/lib/net/smtp.rb b/lib/net/smtp.rb
index 8c50e28dd0..7c9d9388ef 100644
--- a/lib/net/smtp.rb
+++ b/lib/net/smtp.rb
@@ -1,23 +1,23 @@
# = net/smtp.rb
-#
+#
# Copyright (c) 1999-2007 Yukihiro Matsumoto.
#
# Copyright (c) 1999-2007 Minero Aoki.
-#
+#
# Written & maintained by Minero Aoki <aamine@loveruby.net>.
#
# Documented by William Webber and Minero Aoki.
-#
+#
# 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.
-#
+# See Net::SMTP for documentation.
+#
require 'net/protocol'
require 'digest/md5'
@@ -69,103 +69,103 @@ module Net
# = Net::SMTP
#
# == What is This Library?
- #
+ #
# This library provides functionality to send internet
# mail via SMTP, the Simple Mail Transfer Protocol. For details of
# SMTP itself, see [RFC2821] (http://www.ietf.org/rfc/rfc2821.txt).
- #
+ #
# == What is This Library NOT?
- #
+ #
# This library does NOT provide functions to compose internet mails.
# You must create them by yourself. If you want better mail support,
# try RubyMail or TMail. You can get both libraries from RAA.
# (http://www.ruby-lang.org/en/raa.html)
- #
+ #
# FYI: the official documentation on internet mail is: [RFC2822] (http://www.ietf.org/rfc/rfc2822.txt).
- #
+ #
# == Examples
- #
+ #
# === Sending Messages
- #
+ #
# You must open a connection to an SMTP server before sending messages.
- # The first argument is the address of your SMTP server, and the second
- # argument is the port number. Using SMTP.start with a block is the simplest
- # way to do this. This way, the SMTP connection is closed automatically
+ # The first argument is the address of your SMTP server, and the second
+ # argument is the port number. Using SMTP.start with a block is the simplest
+ # way to do this. This way, the SMTP connection is closed automatically
# after the block is executed.
- #
+ #
# require 'net/smtp'
# Net::SMTP.start('your.smtp.server', 25) do |smtp|
# # Use the SMTP object smtp only in this block.
# end
- #
+ #
# Replace 'your.smtp.server' with your SMTP server. Normally
# your system manager or internet provider supplies a server
# for you.
- #
+ #
# Then you can send messages.
- #
+ #
# msgstr = <<END_OF_MESSAGE
# From: Your Name <your@mail.address>
# To: Destination Address <someone@example.com>
# Subject: test message
# Date: Sat, 23 Jun 2001 16:26:43 +0900
# Message-Id: <unique.message.id.string@example.com>
- #
+ #
# This is a test message.
# END_OF_MESSAGE
- #
+ #
# require 'net/smtp'
# Net::SMTP.start('your.smtp.server', 25) do |smtp|
# smtp.send_message msgstr,
# 'your@mail.address',
# 'his_addess@example.com'
# end
- #
+ #
# === Closing the Session
- #
- # You MUST close the SMTP session after sending messages, by calling
+ #
+ # You MUST close the SMTP session after sending messages, by calling
# the #finish method:
- #
+ #
# # using SMTP#finish
# smtp = Net::SMTP.start('your.smtp.server', 25)
# smtp.send_message msgstr, 'from@address', 'to@address'
# smtp.finish
- #
+ #
# You can also use the block form of SMTP.start/SMTP#start. This closes
# the SMTP session automatically:
- #
+ #
# # using block form of SMTP.start
# Net::SMTP.start('your.smtp.server', 25) do |smtp|
# smtp.send_message msgstr, 'from@address', 'to@address'
# end
- #
+ #
# I strongly recommend this scheme. This form is simpler and more robust.
- #
+ #
# === HELO domain
- #
+ #
# In almost all situations, you must provide a third argument
# to SMTP.start/SMTP#start. This is the domain name which you are on
# (the host to send mail from). It is called the "HELO domain".
# The SMTP server will judge whether it should send or reject
# the SMTP session by inspecting the HELO domain.
- #
+ #
# Net::SMTP.start('your.smtp.server', 25,
# 'mail.from.domain') { |smtp| ... }
- #
+ #
# === SMTP Authentication
- #
+ #
# The Net::SMTP class supports three authentication schemes;
# PLAIN, LOGIN and CRAM MD5. (SMTP Authentication: [RFC2554])
- # To use SMTP authentication, pass extra arguments to
+ # To use SMTP authentication, pass extra arguments to
# SMTP.start/SMTP#start.
- #
+ #
# # PLAIN
# Net::SMTP.start('your.smtp.server', 25, 'mail.from.domain',
# 'Your Account', 'Your Password', :plain)
# # LOGIN
# Net::SMTP.start('your.smtp.server', 25, 'mail.from.domain',
# 'Your Account', 'Your Password', :login)
- #
+ #
# # CRAM MD5
# Net::SMTP.start('your.smtp.server', 25, 'mail.from.domain',
# 'Your Account', 'Your Password', :cram_md5)
@@ -196,7 +196,7 @@ module Net
def SMTP.default_ssl_context
OpenSSL::SSL::SSLContext.new
end
-
+
#
# Creates a new Net::SMTP object.
#
@@ -223,7 +223,7 @@ module Net
@starttls = false
@ssl_context = nil
end
-
+
# Provide human-readable stringification of class state.
def inspect
"#<#{self.class} #{@address}:#{@port} started=#{@started}>"
@@ -235,7 +235,7 @@ module Net
end
#
- # Set whether to use ESMTP or not. This should be done before
+ # Set whether to use ESMTP or not. This should be done before
# calling #start. Note that if #start is called in ESMTP mode,
# and the connection fails due to a ProtocolError, the SMTP
# object will automatically switch to plain SMTP mode and
@@ -310,7 +310,7 @@ module Net
end
alias enable_ssl enable_tls
-
+
# Disables SMTP/TLS for this object. Must be called before the
# connection is established to have any effect.
def disable_tls
@@ -336,7 +336,7 @@ module Net
def starttls_auto?
@starttls == :auto
end
-
+
# Enables SMTP/TLS (STARTTLS) for this object.
# +context+ is a OpenSSL::SSL::SSLContext object.
def enable_starttls(context = SMTP.default_ssl_context)
@@ -413,7 +413,7 @@ module Net
# Creates a new Net::SMTP object and connects to the server.
#
# This method is equivalent to:
- #
+ #
# Net::SMTP.new(address, port).start(helo_domain, account, password, authtype)
#
# === Example
@@ -437,7 +437,7 @@ module Net
# +port+ is the port to connect to; it defaults to port 25.
#
# +helo+ is the _HELO_ _domain_ provided by the client to the
- # server (see overview comments); it defaults to 'localhost'.
+ # server (see overview comments); it defaults to 'localhost.localdomain'.
#
# The remaining arguments are used for SMTP authentication, if required
# or desired. +user+ is the account name; +secret+ is your password
@@ -457,7 +457,7 @@ module Net
# * IOError
# * TimeoutError
#
- def SMTP.start(address, port = nil, helo = 'localhost',
+ def SMTP.start(address, port = nil, helo = 'localhost.localdomain',
user = nil, secret = nil, authtype = nil,
&block) # :yield: smtp
new(address, port).start(helo, user, secret, authtype, &block)
@@ -476,33 +476,33 @@ module Net
# +helo+ is the _HELO_ _domain_ that you'll dispatch mails from; see
# the discussion in the overview notes.
#
- # If both of +user+ and +secret+ are given, SMTP authentication
- # will be attempted using the AUTH command. +authtype+ specifies
+ # If both of +user+ and +secret+ are given, SMTP authentication
+ # will be attempted using the AUTH command. +authtype+ specifies
# the type of authentication to attempt; it must be one of
# :login, :plain, and :cram_md5. See the notes on SMTP Authentication
- # in the overview.
+ # in the overview.
#
# === Block Usage
#
# When this methods is called with a block, the newly-started SMTP
# object is yielded to the block, and automatically closed after
- # the block call finishes. Otherwise, it is the caller's
+ # the block call finishes. Otherwise, it is the caller's
# responsibility to close the session when finished.
#
# === Example
#
# This is very similar to the class method SMTP.start.
#
- # require 'net/smtp'
+ # require 'net/smtp'
# smtp = Net::SMTP.new('smtp.mail.server', 25)
# smtp.start(helo_domain, account, password, authtype) do |smtp|
# smtp.send_message msgstr, 'from@example.com', ['dest@example.com']
- # end
+ # end
#
# The primary use of this method (as opposed to SMTP.start)
# is probably to set debugging (#set_debug_output) or ESMTP
# (#esmtp=), which must be done before the session is
- # started.
+ # started.
#
# === Errors
#
@@ -518,7 +518,7 @@ module Net
# * IOError
# * TimeoutError
#
- def start(helo = 'localhost',
+ def start(helo = 'localhost.localdomain',
user = nil, secret = nil, authtype = nil) # :yield: smtp
if block_given?
begin
@@ -548,7 +548,7 @@ module Net
check_auth_method(authtype || DEFAULT_AUTH_TYPE)
check_auth_args user, secret
end
- s = timeout(@open_timeout) { TCPSocket.open(@address, @port) }
+ s = timeout(@open_timeout) { TCPSocket.open(@address, @port) }
logging "Connection opened: #{@address}:#{@port}"
@socket = new_internet_message_io(tls? ? tlsconnect(s) : s)
check_response critical { recv_response() }
@@ -621,7 +621,7 @@ module Net
#
# Sends +msgstr+ as a message. Single CR ("\r") and LF ("\n") found
# in the +msgstr+, are converted into the CR LF pair. You cannot send a
- # binary message with this method. +msgstr+ should include both
+ # binary message with this method. +msgstr+ should include both
# the message headers and body.
#
# +from_addr+ is a String representing the source mail address.
@@ -769,7 +769,7 @@ module Net
"auth_#{type.to_s.downcase}".intern
end
- def check_auth_args(user, secret, authtype = DEFAULT_AUTH_TYPE)
+ def check_auth_args(user, secret)
unless user
raise ArgumentError, 'SMTP-AUTH requested but missing user name'
end
@@ -852,7 +852,7 @@ module Net
# From: john@example.com
# To: betty@example.com
# Subject: I found a bug
- #
+ #
# Check vm.c:58879.
# EndMessage
#
diff --git a/lib/net/telnet.rb b/lib/net/telnet.rb
index 98285a944b..73471c3327 100644
--- a/lib/net/telnet.rb
+++ b/lib/net/telnet.rb
@@ -1,7 +1,7 @@
# = net/telnet.rb - Simple Telnet Client Library
-#
+#
# Author:: Wakou Aoyama <wakou@ruby-lang.org>
-# Documentation:: William Webber and Wakou Aoyama
+# Documentation:: William Webber and Wakou Aoyama
#
# This file holds the class Net::Telnet, which provides client-side
# telnet functionality.
@@ -13,7 +13,7 @@ require "socket"
require "delegate"
require "timeout"
require "English"
-
+
module Net
#
@@ -50,11 +50,11 @@ module Net
# 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;
+ # 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
+ # #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,
@@ -63,21 +63,21 @@ module Net
# 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,
@@ -97,73 +97,73 @@ module Net
# :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
+ 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:
@@ -174,13 +174,13 @@ module Net
# 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
@@ -198,16 +198,16 @@ module Net
#
# The options have the following meanings:
#
- # Host:: the hostname or IP address of the host to connect to, as a String.
+ # 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.
+ # 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
+ # 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
@@ -217,13 +217,13 @@ module Net
# 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.
+ # 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
+ # preceded by '#', sent traffic preceded by '>', and
# received traffic preceded by '<'. By default, not dump log
# is kept.
#
@@ -233,7 +233,7 @@ module Net
# ready to receive a new command. By default, this regular
# expression is /[$%#>] \z/n.
#
- # Telnetmode:: a boolean value, true by default. In telnet mode,
+ # 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()
@@ -255,11 +255,11 @@ module Net
# minutes), but other attempts to read data from the host
# will hand indefinitely if no data is forthcoming.
#
- # Waittime:: the amount of time to wait after seeing what looks like a
+ # 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
+ # 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
@@ -267,12 +267,12 @@ module Net
#
# 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
+ # 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
+ def initialize(options) # :yield: mesg
@options = options
@options["Host"] = "localhost" unless @options.has_key?("Host")
@options["Port"] = 23 unless @options.has_key?("Port")
@@ -280,7 +280,7 @@ module Net
@options["Timeout"] = 10 unless @options.has_key?("Timeout")
@options["Waittime"] = 0 unless @options.has_key?("Waittime")
unless @options.has_key?("Binmode")
- @options["Binmode"] = false
+ @options["Binmode"] = false
else
unless (true == @options["Binmode"] or false == @options["Binmode"])
raise ArgumentError, "Binmode option must be true or false"
@@ -288,7 +288,7 @@ module Net
end
unless @options.has_key?("Telnetmode")
- @options["Telnetmode"] = true
+ @options["Telnetmode"] = true
else
unless (true == @options["Telnetmode"] or false == @options["Telnetmode"])
raise ArgumentError, "Telnetmode option must be true or false"
@@ -374,7 +374,7 @@ module Net
# 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 :sock
+ attr :sock
# Set telnet command interpretation on (+mode+ == true) or off
# (+mode+ == false), or return the current value (+mode+ not
@@ -408,7 +408,7 @@ module Net
def binmode(mode = nil)
case mode
when nil
- @options["Binmode"]
+ @options["Binmode"]
when true, false
@options["Binmode"] = mode
else
@@ -428,7 +428,7 @@ module Net
# Preprocess received data from the host.
#
# Performs newline conversion and detects telnet command sequences.
- # Called automatically by #waitfor(). You should only use this
+ # 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)
@@ -438,9 +438,6 @@ module Net
# 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}]
@@ -494,9 +491,9 @@ module Net
# 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
+ # 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
+ # 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.
#
@@ -510,7 +507,7 @@ module Net
# into a regular expression. Used only if Match and
# Prompt are not specified.
# Timeout:: the number of seconds to wait for data from the host
- # before raising a TimeoutError. If set to false,
+ # before raising a TimeoutError. 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
@@ -527,7 +524,7 @@ module Net
# 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"]
@@ -564,8 +561,8 @@ module Net
@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)
+ if Integer(c.rindex(/#{IAC}#{SE}/no)) <
+ Integer(c.rindex(/#{IAC}#{SB}/no))
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) ||
@@ -622,7 +619,7 @@ module Net
# 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
+ # 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)
@@ -657,7 +654,7 @@ module Net
# 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
+ # 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.
#
@@ -702,7 +699,7 @@ module Net
#
# The username and password can either be provided as two string
# arguments in that order, or as a hash with keys "Name" and
- # "Password".
+ # "Password".
#
# This method looks for the strings "login" and "Password" from the
# host to determine when to send the username and password. If the
diff --git a/lib/observer.rb b/lib/observer.rb
index ee3f01b793..64c7d81351 100644
--- a/lib/observer.rb
+++ b/lib/observer.rb
@@ -7,7 +7,7 @@
#
# The Observer pattern, also known as Publish/Subscribe, provides a simple
# mechanism for one object to inform a set of interested third-party objects
-# when its state changes.
+# when its state changes.
#
# == Mechanism
#
@@ -39,14 +39,14 @@
# contracts are correct, nothing else can warn you.
#
# require "observer"
-#
+#
# class Ticker ### Periodically fetch a stock price.
# include Observable
-#
+#
# def initialize(symbol)
# @symbol = symbol
# end
-#
+#
# def run
# lastPrice = nil
# loop do
@@ -67,14 +67,14 @@
# 60 + rand(80)
# end
# end
-#
+#
# class Warner ### An abstract observer of Ticker objects.
# def initialize(ticker, limit)
# @limit = limit
# ticker.add_observer(self)
# end
# end
-#
+#
# class WarnLow < Warner
# def update(time, price) # callback for observer
# if price < @limit
@@ -82,7 +82,7 @@
# end
# end
# end
-#
+#
# class WarnHigh < Warner
# def update(time, price) # callback for observer
# if price > @limit
@@ -118,15 +118,14 @@ module Observable
#
# Add +observer+ as an observer on this object. +observer+ will now receive
- # notifications. The second optional argument specifies a method to notify
- # updates, of which default value is +update+.
+ # notifications.
#
- def add_observer(observer, func=:update)
- @observer_peers = {} unless defined? @observer_peers
- unless observer.respond_to? func
- raise NoMethodError, "observer does not respond to `#{func.to_s}'"
+ def add_observer(observer)
+ @observer_peers = [] unless defined? @observer_peers
+ unless observer.respond_to? :update
+ raise NoMethodError, "observer needs to respond to `update'"
end
- @observer_peers[observer] = func
+ @observer_peers.push observer
end
#
@@ -182,9 +181,9 @@ module Observable
def notify_observers(*arg)
if defined? @observer_state and @observer_state
if defined? @observer_peers
- @observer_peers.each { |k, v|
- k.send v, *arg
- }
+ for i in @observer_peers.dup
+ i.update(*arg)
+ end
end
@observer_state = false
end
diff --git a/lib/open-uri.rb b/lib/open-uri.rb
index 2a6c544fe6..54b42f336f 100644
--- a/lib/open-uri.rb
+++ b/lib/open-uri.rb
@@ -5,9 +5,6 @@ require 'time'
module Kernel
private
alias open_uri_original_open open # :nodoc:
- class << self
- alias open_uri_original_open open # :nodoc:
- end
# makes possible to open various resources including URIs.
# If the first argument respond to `open' method,
@@ -94,15 +91,9 @@ end
module OpenURI
Options = {
:proxy => true,
- :proxy_http_basic_authentication => true,
:progress_proc => true,
:content_length_proc => true,
:http_basic_authentication => true,
- :read_timeout => true,
- :ssl_ca_cert => nil,
- :ssl_verify_mode => nil,
- :ftp_active_mode => false,
- :redirect => true,
}
def OpenURI.check_options(options) # :nodoc:
@@ -132,11 +123,6 @@ module OpenURI
options ||= {}
OpenURI.check_options(options)
- if /\Arb?(?:\Z|:([^:]+))/ =~ mode
- encoding, = $1,Encoding.find($1) if $1
- mode = nil
- end
-
unless mode == nil ||
mode == 'r' || mode == 'rb' ||
mode == File::RDONLY
@@ -144,7 +130,6 @@ module OpenURI
end
io = open_loop(uri, options)
- io.set_encoding(encoding) if encoding
if block_given?
begin
yield io
@@ -157,40 +142,16 @@ module OpenURI
end
def OpenURI.open_loop(uri, options) # :nodoc:
- proxy_opts = []
- proxy_opts << :proxy_http_basic_authentication if options.include? :proxy_http_basic_authentication
- proxy_opts << :proxy if options.include? :proxy
- proxy_opts.compact!
- if 1 < proxy_opts.length
- raise ArgumentError, "multiple proxy options specified"
- end
- case proxy_opts.first
- when :proxy_http_basic_authentication
- opt_proxy, proxy_user, proxy_pass = options.fetch(:proxy_http_basic_authentication)
- proxy_user = proxy_user.to_str
- proxy_pass = proxy_pass.to_str
- if opt_proxy == true
- raise ArgumentError.new("Invalid authenticated proxy option: #{options[:proxy_http_basic_authentication].inspect}")
- end
- when :proxy
- opt_proxy = options.fetch(:proxy)
- proxy_user = nil
- proxy_pass = nil
- when nil
- opt_proxy = true
- proxy_user = nil
- proxy_pass = nil
- end
- case opt_proxy
+ case opt_proxy = options.fetch(:proxy, true)
when true
- find_proxy = lambda {|u| pxy = u.find_proxy; pxy ? [pxy, nil, nil] : nil}
+ find_proxy = lambda {|u| u.find_proxy}
when nil, false
find_proxy = lambda {|u| nil}
when String
opt_proxy = URI.parse(opt_proxy)
- find_proxy = lambda {|u| [opt_proxy, proxy_user, proxy_pass]}
+ find_proxy = lambda {|u| opt_proxy}
when URI::Generic
- find_proxy = lambda {|u| [opt_proxy, proxy_user, proxy_pass]}
+ find_proxy = lambda {|u| opt_proxy}
else
raise ArgumentError.new("Invalid proxy option: #{opt_proxy}")
end
@@ -209,9 +170,6 @@ module OpenURI
# URI. It is converted to absolute URI using uri as a base URI.
redirect = uri + redirect
end
- if !options.fetch(:redirect, true)
- raise HTTPRedirect.new(buf.io.status.join(' '), buf.io, redirect)
- end
unless OpenURI.redirectable?(uri, redirect)
raise "redirection forbidden: #{uri} -> #{redirect}"
end
@@ -235,9 +193,6 @@ module OpenURI
def OpenURI.redirectable?(uri1, uri2) # :nodoc:
# This test is intended to forbid a redirection from http://... to
# file:///etc/passwd.
- # https to http redirect is also forbidden intentionally.
- # It avoids sending secure cookie or referer by non-secure HTTP protocol.
- # (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(?:http|ftp)\z/i =~ uri2.scheme)
@@ -245,8 +200,7 @@ module OpenURI
def OpenURI.open_http(buf, target, proxy, options) # :nodoc:
if proxy
- proxy_uri, proxy_user, proxy_pass = proxy
- raise "Non-HTTP proxy URI: #{proxy_uri}" if proxy_uri.class != URI::HTTP
+ raise "Non-HTTP proxy URI: #{proxy}" if proxy.class != URI::HTTP
end
if target.userinfo && "1.9.0" <= RUBY_VERSION
@@ -254,53 +208,35 @@ module OpenURI
raise ArgumentError, "userinfo not supported. [RFC3986]"
end
- header = {}
- options.each {|k, v| header[k] = v if String === k }
-
require 'net/http'
klass = Net::HTTP
if URI::HTTP === target
# HTTP or HTTPS
if proxy
- if proxy_user && proxy_pass
- klass = Net::HTTP::Proxy(proxy_uri.host, proxy_uri.port, proxy_user, proxy_pass)
- else
- klass = Net::HTTP::Proxy(proxy_uri.host, proxy_uri.port)
- end
+ klass = Net::HTTP::Proxy(proxy.host, proxy.port)
end
target_host = target.host
target_port = target.port
request_uri = target.request_uri
else
# FTP over HTTP proxy
- target_host = proxy_uri.host
- target_port = proxy_uri.port
+ target_host = proxy.host
+ target_port = proxy.port
request_uri = target.to_s
- if proxy_user && proxy_pass
- header["Proxy-Authorization"] = 'Basic ' + ["#{proxy_user}:#{proxy_pass}"].pack('m').delete("\r\n")
- end
end
http = klass.new(target_host, target_port)
if target.class == URI::HTTPS
require 'net/https'
http.use_ssl = true
- http.verify_mode = options[:ssl_verify_mode] || OpenSSL::SSL::VERIFY_PEER
+ http.verify_mode = OpenSSL::SSL::VERIFY_PEER
store = OpenSSL::X509::Store.new
- if options[:ssl_ca_cert]
- if File.directory? options[:ssl_ca_cert]
- store.add_path options[:ssl_ca_cert]
- else
- store.add_file options[:ssl_ca_cert]
- end
- else
- store.set_default_paths
- end
+ store.set_default_paths
http.cert_store = store
end
- if options.include? :read_timeout
- http.read_timeout = options[:read_timeout]
- end
+
+ header = {}
+ options.each {|k, v| header[k] = v if String === k }
resp = nil
http.start {
@@ -336,12 +272,7 @@ module OpenURI
Net::HTTPFound, # 302
Net::HTTPSeeOther, # 303
Net::HTTPTemporaryRedirect # 307
- begin
- loc_uri = URI.parse(resp['location'])
- rescue URI::InvalidURIError
- raise OpenURI::HTTPError.new(io.status.join(' ') + ' (Invalid Location URI)', io)
- end
- throw :open_uri_redirect, loc_uri
+ throw :open_uri_redirect, URI.parse(resp['location'])
else
raise OpenURI::HTTPError.new(io.status.join(' '), io)
end
@@ -355,14 +286,6 @@ module OpenURI
attr_reader :io
end
- class HTTPRedirect < HTTPError
- def initialize(message, io, uri)
- super(message, io)
- @uri = uri
- end
- attr_reader :uri
- end
-
class Buffer # :nodoc:
def initialize
@io = StringIO.new
@@ -378,14 +301,14 @@ module OpenURI
require 'tempfile'
io = Tempfile.new('open-uri')
io.binmode
- Meta.init io, @io if Meta === @io
+ Meta.init io, @io if @io.respond_to? :meta
io << @io.string
@io = io
end
end
def io
- Meta.init @io unless Meta === @io
+ Meta.init @io unless @io.respond_to? :meta
@io
end
end
@@ -418,29 +341,8 @@ module OpenURI
# The Hash keys are downcased for canonicalization.
attr_reader :meta
- def meta_setup_encoding # :nodoc:
- charset = self.charset
- enc = nil
- if charset
- begin
- enc = Encoding.find(charset)
- rescue ArgumentError
- end
- end
- enc = Encoding::ASCII_8BIT unless enc
- if self.respond_to? :force_encoding
- self.force_encoding(enc)
- elsif self.respond_to? :string
- self.string.force_encoding(enc)
- else # Tempfile
- self.set_encoding enc
- end
- end
-
def meta_add_field(name, value) # :nodoc:
- name = name.downcase
- @meta[name] = value
- meta_setup_encoding if name == 'content-type'
+ @meta[name.downcase] = value
end
# returns a Time which represents Last-Modified field.
@@ -465,7 +367,7 @@ module OpenURI
subtype = $2.downcase
parameters = []
$3.scan(/;#{RE_LWS}?(#{RE_TOKEN})#{RE_LWS}?=#{RE_LWS}?(?:(#{RE_TOKEN})|(#{RE_QUOTED_STRING}))/no) {|att, val, qval|
- val = qval.gsub(/[\r\n\t !#-\[\]-~\x80-\xff]+|(\\[\x00-\x7f])/n) { $1 ? $1[1,1] : $& } if qval
+ val = qval.gsub(/[\r\n\t !#-\[\]-~\x80-\xff]+|(\\[\x00-\x7f])/) { $1 ? $1[1,1] : $& } if qval
parameters << [att.downcase, val]
}
["#{type}/#{subtype}", *parameters]
@@ -548,7 +450,7 @@ module OpenURI
# :proxy => true
# :proxy => false
# :proxy => nil
- #
+ #
# If :proxy option is specified, the value should be String, URI,
# boolean or nil.
# When String or URI is given, it is treated as proxy URI.
@@ -558,21 +460,6 @@ module OpenURI
# When false or nil is given, the environment variables are ignored and
# connection will be made to a server directly.
#
- # [:proxy_http_basic_authentication]
- # Synopsis:
- # :proxy_http_basic_authentication => ["http://proxy.foo.com:8000/", "proxy-user", "proxy-password"]
- # :proxy_http_basic_authentication => [URI.parse("http://proxy.foo.com:8000/"), "proxy-user", "proxy-password"]
- #
- # If :proxy option is specified, the value should be an Array with 3 elements.
- # It should contain a proxy URI, a proxy user name and a proxy password.
- # The proxy URI should be a String, an URI or nil.
- # The proxy user name and password should be a String.
- #
- # If nil is given for the proxy URI, this option is just ignored.
- #
- # If :proxy and :proxy_http_basic_authentication is specified,
- # ArgumentError is raised.
- #
# [:http_basic_authentication]
# Synopsis:
# :http_basic_authentication=>[user, password]
@@ -585,14 +472,14 @@ module OpenURI
# [:content_length_proc]
# Synopsis:
# :content_length_proc => lambda {|content_length| ... }
- #
+ #
# If :content_length_proc option is specified, the option value procedure
# is called before actual transfer is started.
# It takes one argument which is expected content length in bytes.
- #
+ #
# If two or more transfer is done by HTTP redirection, the procedure
# is called only one for a last transfer.
- #
+ #
# When expected content length is unknown, the procedure is called with
# nil.
# It is happen when HTTP response has no Content-Length header.
@@ -624,47 +511,9 @@ module OpenURI
# pbar.set s if pbar
# }) {|f| ... }
#
- # [:read_timeout]
- # Synopsis:
- # :read_timeout=>nil (no timeout)
- # :read_timeout=>10 (10 second)
- #
- # :read_timeout option specifies a timeout of read for http connections.
- #
- # [:ssl_ca_cert]
- # Synopsis:
- # :ssl_ca_cert=>filename
- #
- # :ssl_ca_cert is used to specify CA certificate for SSL.
- # If it is given, default certificates are not used.
- #
- # [:ssl_verify_mode]
- # Synopsis:
- # :ssl_verify_mode=>mode
- #
- # :ssl_verify_mode is used to specify openssl verify mode.
- #
# OpenURI::OpenRead#open returns an IO like object if block is not given.
# Otherwise it yields the IO object and return the value of the block.
# The IO object is extended with OpenURI::Meta.
- #
- # [:ftp_active_mode]
- # Synopsis:
- # :ftp_active_mode=>bool
- #
- # :ftp_active_mode=>true is used to make ftp active mode.
- # Note that the active mode is default in Ruby 1.8 or prior.
- # Ruby 1.9 uses passive mode by default.
- #
- # [:redirect]
- # Synopsis:
- # :redirect=>bool
- #
- # :redirect=>false is used to disable HTTP redirects at all.
- # OpenURI::HTTPRedirect exception raised on redirection.
- # It is true by default.
- # The true means redirections between http and ftp is permitted.
- #
def open(*rest, &block)
OpenURI.open_uri(self, *rest, &block)
end
@@ -801,7 +650,6 @@ module URI
# The access sequence is defined by RFC 1738
ftp = Net::FTP.open(self.host)
- 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 86bd2c6c22..c4dacc9473 100644
--- a/lib/open3.rb
+++ b/lib/open3.rb
@@ -9,710 +9,82 @@
#
#
-# Open3 grants you access to stdin, stdout, stderr and a thread to wait the
-# child process when running another program.
-# You can specify various attributes, redirections, current directory, etc., of
-# the program as Process.spawn.
+# Open3 grants you access to stdin, stdout, and stderr when running another
+# program. Example:
#
-# - Open3.popen3 : pipes for stdin, stdout, stderr
-# - Open3.popen2 : pipes for stdin, stdout
-# - Open3.popen2e : pipes for stdin, merged stdout and stderr
-# - Open3.capture3 : give a string for stdin. get strings for stdout, stderr
-# - Open3.capture2 : give a string for stdin. get a string for stdout
-# - Open3.capture2e : give a string for stdin. get a string for merged stdout and stderr
-# - Open3.pipeline_rw : pipes for first stdin and last stdout of a pipeline
-# - Open3.pipeline_r : pipe for last stdout of a pipeline
-# - Open3.pipeline_w : pipe for first stdin of a pipeline
-# - Open3.pipeline_start : a pipeline
-# - Open3.pipeline : run a pipline and wait
+# require "open3"
+# include Open3
+#
+# stdin, stdout, stderr = popen3('nroff -man')
+#
+# Open3.popen3 can also take a block which will receive stdin, stdout and
+# stderr as parameters. This ensures stdin, stdout and stderr are closed
+# once the block exits. Example:
+#
+# require "open3"
+#
+# Open3.popen3('nroff -man') { |stdin, stdout, stderr| ... }
#
module Open3
-
+ #
# Open stdin, stdout, and stderr streams and start external executable.
- # In addition, a thread for waiting the started process is noticed.
- # The thread has a pid method and thread variable :pid which is the pid of
- # the started process.
- #
- # Block form:
- #
- # Open3.popen3([env,] cmd... [, opts]) {|stdin, stdout, stderr, wait_thr|
- # pid = wait_thr.pid # pid of the started process.
- # ...
- # exit_status = wait_thr.value # Process::Status object returned.
- # }
- #
# Non-block form:
+ #
+ # require 'open3'
#
- # stdin, stdout, stderr, wait_thr = Open3.popen3([env,] cmd... [, opts])
- # pid = wait_thr[:pid] # pid of the started process.
- # ...
- # stdin.close # stdin, stdout and stderr should be closed explicitly in this form.
- # stdout.close
- # stderr.close
- # exit_status = wait_thr.value # Process::Status object returned.
- #
- # The parameters +cmd...+ is passed to Process.spawn.
- # So a commandline string and list of argument strings can be accepted as follows.
- #
- # Open3.popen3("echo a") {|i, o, e, t| ... }
- # Open3.popen3("echo", "a") {|i, o, e, t| ... }
- # Open3.popen3(["echo", "argv0"], "a") {|i, o, e, t| ... }
- #
- # If the last parameter, opts, is a Hash, it is recognized as an option for Process.spawn.
- #
- # Open3.popen3("pwd", :chdir=>"/") {|i,o,e,t|
- # p o.read.chomp #=> "/"
- # }
- #
- # wait_thr.value waits the termination of the process.
- # The block form also waits the process when it returns.
- #
- # Closing stdin, stdout and stderr does not wait the process.
- #
- def popen3(*cmd, &block)
- if Hash === cmd.last
- opts = cmd.pop.dup
- else
- opts = {}
- end
-
- in_r, in_w = IO.pipe
- opts[:in] = in_r
- in_w.sync = true
-
- out_r, out_w = IO.pipe
- opts[:out] = out_w
-
- err_r, err_w = IO.pipe
- opts[:err] = err_w
-
- popen_run(cmd, opts, [in_r, out_w, err_w], [in_w, out_r, err_r], &block)
- end
- module_function :popen3
-
- # Open3.popen2 is similer to Open3.popen3 except it doesn't make a pipe for
- # the standard error stream.
+ # [stdin, stdout, stderr] = Open3.popen3(cmd)
#
# Block form:
#
- # Open3.popen2([env,] cmd... [, opts]) {|stdin, stdout, wait_thr|
- # pid = wait_thr.pid # pid of the started process.
- # ...
- # exit_status = wait_thr.value # Process::Status object returned.
- # }
- #
- # Non-block form:
- #
- # stdin, stdout, wait_thr = Open3.popen2([env,] cmd... [, opts])
- # ...
- # stdin.close # stdin and stdout should be closed explicitly in this form.
- # stdout.close
- #
- # See Process.spawn for the optional hash arguments _env_ and _opts_.
- #
- # Example:
- #
- # Open3.popen2("wc -c") {|i,o,t|
- # i.print "answer to life the universe and everything"
- # i.close
- # p o.gets #=> "42\n"
- # }
- #
- # Open3.popen2("bc -q") {|i,o,t|
- # i.puts "obase=13"
- # i.puts "6 * 9"
- # p o.gets #=> "42\n"
- # }
- #
- # Open3.popen2("dc") {|i,o,t|
- # i.print "42P"
- # i.close
- # p o.read #=> "*"
- # }
- #
- def popen2(*cmd, &block)
- if Hash === cmd.last
- opts = cmd.pop.dup
- else
- opts = {}
- end
-
- in_r, in_w = IO.pipe
- opts[:in] = in_r
- in_w.sync = true
-
- out_r, out_w = IO.pipe
- opts[:out] = out_w
-
- popen_run(cmd, opts, [in_r, out_w], [in_w, out_r], &block)
- end
- module_function :popen2
-
- # Open3.popen2e is similer to Open3.popen3 except it merges
- # the standard output stream and the standard error stream.
- #
- # Block form:
- #
- # Open3.popen2e([env,] cmd... [, opts]) {|stdin, stdout_and_stderr, wait_thr|
- # pid = wait_thr.pid # pid of the started process.
- # ...
- # exit_status = wait_thr.value # Process::Status object returned.
- # }
- #
- # Non-block form:
- #
- # stdin, stdout_and_stderr, wait_thr = Open3.popen2e([env,] cmd... [, opts])
- # ...
- # stdin.close # stdin and stdout_and_stderr should be closed explicitly in this form.
- # stdout_and_stderr.close
- #
- # See Process.spawn for the optional hash arguments _env_ and _opts_.
+ # require 'open3'
#
- # Example:
- # # check gcc warnings
- # source = "foo.c"
- # Open3.popen2e("gcc", "-Wall", source) {|i,oe,t|
- # oe.each {|line|
- # if /warning/ =~ line
- # ...
- # end
- # }
- # }
+ # Open3.popen3(cmd) { |stdin, stdout, stderr| ... }
#
- def popen2e(*cmd, &block)
- if Hash === cmd.last
- opts = cmd.pop.dup
- else
- opts = {}
- end
-
- in_r, in_w = IO.pipe
- opts[:in] = in_r
- in_w.sync = true
-
- out_r, out_w = IO.pipe
- opts[[:out, :err]] = out_w
-
- popen_run(cmd, opts, [in_r, out_w], [in_w, out_r], &block)
- end
- module_function :popen2e
-
- def popen_run(cmd, opts, child_io, parent_io) # :nodoc:
- pid = spawn(*cmd, opts)
- wait_thr = Process.detach(pid)
- child_io.each {|io| io.close }
- result = [*parent_io, wait_thr]
- if defined? yield
- begin
- return yield(*result)
- ensure
- parent_io.each{|io| io.close unless io.closed?}
- wait_thr.join
- end
- end
- result
- end
- module_function :popen_run
- class << self
- private :popen_run
- end
-
- # Open3.capture3 captures the standard output and the standard error of a command.
- #
- # stdout_str, stderr_str, status = Open3.capture3([env,] cmd... [, opts])
- #
- # The arguments env, cmd and opts are passed to Open3.popen3 except
- # opts[:stdin_data] and opts[:stdin_data]. See Process.spawn.
- #
- # If opts[:stdin_data] is specified, it is sent to the command's standard input.
- #
- # If opts[:binmode] is true, internal pipes are set to binary mode.
+ # The parameter +cmd+ is passed directly to Kernel#exec.
#
- # Example:
- #
- # # dot is a command of graphviz.
- # graph = <<'End'
- # digraph g {
- # a -> b
- # }
- # End
- # layouted_graph, dot_log = Open3.capture3("dot -v", :stdin_data=>graph)
- #
- # o, e, s = Open3.capture3("echo a; sort >&2", :stdin_data=>"foo\nbar\nbaz\n")
- # p o #=> "a\n"
- # p e #=> "bar\nbaz\nfoo\n"
- # p s #=> #<Process::Status: pid 32682 exit 0>
- #
- # # generate a thumnail image using the convert command of ImageMagick.
- # # However, if the image stored really in a file,
- # # system("convert", "-thumbnail", "80", "png:#{filename}", "png:-") is better
- # # because memory consumption.
- # # But if the image is stored in a DB or generated by gnuplot Open3.capture2 example,
- # # Open3.capture3 is considerable.
- # #
- # image = File.read("/usr/share/openclipart/png/animals/mammals/sheep-md-v0.1.png", :binmode=>true)
- # thumnail, err, s = Open3.capture3("convert -thumbnail 80 png:- png:-", :stdin_data=>image, :binmode=>true)
- # if s.success?
- # STDOUT.binmode; print thumnail
- # end
- #
- def capture3(*cmd, &block)
- if Hash === cmd.last
- opts = cmd.pop.dup
- else
- opts = {}
- end
+ def popen3(*cmd)
+ pw = IO::pipe # pipe[0] for read, pipe[1] for write
+ pr = IO::pipe
+ pe = IO::pipe
- stdin_data = opts.delete(:stdin_data) || ''
- binmode = opts.delete(:binmode)
+ pid = fork{
+ # child
+ fork{
+ # grandchild
+ pw[1].close
+ STDIN.reopen(pw[0])
+ pw[0].close
- popen3(*cmd, opts) {|i, o, e, t|
- if binmode
- i.binmode
- o.binmode
- e.binmode
- end
- out_reader = Thread.new { o.read }
- err_reader = Thread.new { e.read }
- i.write stdin_data
- i.close
- [out_reader.value, err_reader.value, t.value]
- }
- end
- module_function :capture3
-
- # Open3.capture2 captures the standard output of a command.
- #
- # stdout_str, status = Open3.capture2([env,] cmd... [, opts])
- #
- # The arguments env, cmd and opts are passed to Open3.popen3 except
- # opts[:stdin_data] and opts[:stdin_data]. See Process.spawn.
- #
- # If opts[:stdin_data] is specified, it is sent to the command's standard input.
- #
- # If opts[:binmode] is true, internal pipes are set to binary mode.
- #
- # Example:
- #
- # # factor is a command for integer factorization.
- # o, s = Open3.capture2("factor", :stdin_data=>"42")
- # p o #=> "42: 2 3 7\n"
- #
- # # generate x**2 graph in png using gnuplot.
- # gnuplot_commands = <<"End"
- # set terminal png
- # plot x**2, "-" with lines
- # 1 14
- # 2 1
- # 3 8
- # 4 5
- # e
- # End
- # image, s = Open3.capture2("gnuplot", :stdin_data=>gnuplot_commands, :binmode=>true)
- #
- def capture2(*cmd, &block)
- if Hash === cmd.last
- opts = cmd.pop.dup
- else
- opts = {}
- end
+ pr[0].close
+ STDOUT.reopen(pr[1])
+ pr[1].close
- stdin_data = opts.delete(:stdin_data) || ''
- binmode = opts.delete(:binmode)
+ pe[0].close
+ STDERR.reopen(pe[1])
+ pe[1].close
- popen2(*cmd, opts) {|i, o, t|
- if binmode
- i.binmode
- o.binmode
- end
- out_reader = Thread.new { o.read }
- i.write stdin_data
- i.close
- [out_reader.value, t.value]
+ exec(*cmd)
+ }
+ exit!(0)
}
- end
- module_function :capture2
- # Open3.capture2e captures the standard output and the standard error of a command.
- #
- # stdout_and_stderr_str, status = Open3.capture2e([env,] cmd... [, opts])
- #
- # The arguments env, cmd and opts are passed to Open3.popen3 except
- # opts[:stdin_data] and opts[:stdin_data]. See Process.spawn.
- #
- # If opts[:stdin_data] is specified, it is sent to the command's standard input.
- #
- # If opts[:binmode] is true, internal pipes are set to binary mode.
- #
- # Example:
- #
- # # capture make log
- # make_log, s = Open3.capture2e("make")
- #
- def capture2e(*cmd, &block)
- if Hash === cmd.last
- opts = cmd.pop.dup
- else
- opts = {}
- end
-
- stdin_data = opts.delete(:stdin_data) || ''
- binmode = opts.delete(:binmode)
-
- popen2e(*cmd, opts) {|i, oe, t|
- if binmode
- i.binmode
- oe.binmode
- end
- outerr_reader = Thread.new { oe.read }
- i.write stdin_data
- i.close
- [outerr_reader.value, t.value]
- }
- end
- module_function :capture2e
-
- # Open3.pipeline_rw starts a list of commands as a pipeline with pipes
- # which connects stdin of the first command and stdout of the last command.
- #
- # Open3.pipeline_rw(cmd1, cmd2, ... [, opts]) {|first_stdin, last_stdout, wait_threads|
- # ...
- # }
- #
- # first_stdin, last_stdout, wait_threads = Open3.pipeline_rw(cmd1, cmd2, ... [, opts])
- # ...
- # first_stdin.close
- # last_stdout.close
- #
- # Each cmd is a string or an array.
- # If it is an array, the elements are passed to Process.spawn.
- #
- # cmd:
- # commandline command line string which is passed to a shell
- # [env, commandline, opts] command line string which is passed to a shell
- # [env, cmdname, arg1, ..., opts] command name and one or more arguments (no shell)
- # [env, [cmdname, argv0], arg1, ..., opts] command name and arguments including argv[0] (no shell)
- #
- # Note that env and opts are optional, as Process.spawn.
- #
- # The option to pass Process.spawn is constructed by merging
- # +opts+, the last hash element of the array and
- # specification for the pipe between each commands.
- #
- # Example:
- #
- # Open3.pipeline_rw("tr -dc A-Za-z", "wc -c") {|i,o,ts|
- # i.puts "All persons more than a mile high to leave the court."
- # i.close
- # p o.gets #=> "42\n"
- # }
- #
- # Open3.pipeline_rw("sort", "cat -n") {|stdin, stdout, wait_thrs|
- # stdin.puts "foo"
- # stdin.puts "bar"
- # stdin.puts "baz"
- # 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
-
- in_r, in_w = IO.pipe
- opts[:in] = in_r
- in_w.sync = true
-
- out_r, out_w = IO.pipe
- opts[:out] = out_w
-
- pipeline_run(cmds, opts, [in_r, out_w], [in_w, out_r], &block)
- end
- module_function :pipeline_rw
-
- # Open3.pipeline_r starts a list of commands as a pipeline with a pipe
- # which connects stdout of the last command.
- #
- # Open3.pipeline_r(cmd1, cmd2, ... [, opts]) {|last_stdout, wait_threads|
- # ...
- # }
- #
- # last_stdout, wait_threads = Open3.pipeline_r(cmd1, cmd2, ... [, opts])
- # ...
- # last_stdout.close
- #
- # Each cmd is a string or an array.
- # If it is an array, the elements are passed to Process.spawn.
- #
- # cmd:
- # commandline command line string which is passed to a shell
- # [env, commandline, opts] command line string which is passed to a shell
- # [env, cmdname, arg1, ..., opts] command name and one or more arguments (no shell)
- # [env, [cmdname, argv0], arg1, ..., opts] command name and arguments including argv[0] (no shell)
- #
- # Note that env and opts are optional, as Process.spawn.
- #
- # Example:
- #
- # Open3.pipeline_r("zcat /var/log/apache2/access.log.*.gz",
- # [{"LANG"=>"C"}, "grep", "GET /favicon.ico"],
- # "logresolve") {|r, ts|
- # r.each_line {|line|
- # ...
- # }
- # }
- #
- # Open3.pipeline_r("yes", "head -10") {|r, ts|
- # p r.read #=> "y\ny\ny\ny\ny\ny\ny\ny\ny\ny\n"
- # p ts[0].value #=> #<Process::Status: pid 24910 SIGPIPE (signal 13)>
- # 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
-
- out_r, out_w = IO.pipe
- opts[:out] = out_w
-
- pipeline_run(cmds, opts, [out_w], [out_r], &block)
- end
- module_function :pipeline_r
-
- # Open3.pipeline_w starts a list of commands as a pipeline with a pipe
- # which connects stdin of the first command.
- #
- # Open3.pipeline_w(cmd1, cmd2, ... [, opts]) {|first_stdin, wait_threads|
- # ...
- # }
- #
- # first_stdin, wait_threads = Open3.pipeline_w(cmd1, cmd2, ... [, opts])
- # ...
- # first_stdin.close
- #
- # Each cmd is a string or an array.
- # If it is an array, the elements are passed to Process.spawn.
- #
- # cmd:
- # commandline command line string which is passed to a shell
- # [env, commandline, opts] command line string which is passed to a shell
- # [env, cmdname, arg1, ..., opts] command name and one or more arguments (no shell)
- # [env, [cmdname, argv0], arg1, ..., opts] command name and arguments including argv[0] (no shell)
- #
- # Note that env and opts are optional, as Process.spawn.
- #
- # Example:
- #
- # Open3.pipeline_w("bzip2 -c", :out=>"/tmp/hello.bz2") {|w, ts|
- # w.puts "hello"
- # }
- #
- def pipeline_w(*cmds, &block)
- if Hash === cmds.last
- opts = cmds.pop.dup
- else
- opts = {}
- end
-
- in_r, in_w = IO.pipe
- opts[:in] = in_r
- in_w.sync = true
-
- pipeline_run(cmds, opts, [in_r], [in_w], &block)
- end
- module_function :pipeline_w
-
- # Open3.pipeline_start starts a list of commands as a pipeline.
- # No pipe made for stdin of the first command and
- # stdout of the last command.
- #
- # Open3.pipeline_start(cmd1, cmd2, ... [, opts]) {|wait_threads|
- # ...
- # }
- #
- # wait_threads = Open3.pipeline_start(cmd1, cmd2, ... [, opts])
- # ...
- #
- # Each cmd is a string or an array.
- # If it is an array, the elements are passed to Process.spawn.
- #
- # cmd:
- # commandline command line string which is passed to a shell
- # [env, commandline, opts] command line string which is passed to a shell
- # [env, cmdname, arg1, ..., opts] command name and one or more arguments (no shell)
- # [env, [cmdname, argv0], arg1, ..., opts] command name and arguments including argv[0] (no shell)
- #
- # Note that env and opts are optional, as Process.spawn.
- #
- # Example:
- #
- # # run xeyes in 10 seconds.
- # Open3.pipeline_start("xeyes") {|ts|
- # sleep 10
- # t = ts[0]
- # Process.kill("TERM", t.pid)
- # p t.value #=> #<Process::Status: pid 911 SIGTERM (signal 15)>
- # }
- #
- # # convert pdf to ps and send it to a printer.
- # # collect error message of pdftops and lpr.
- # pdf_file = "paper.pdf"
- # printer = "printer-name"
- # err_r, err_w = IO.pipe
- # Open3.pipeline_start(["pdftops", pdf_file, "-"],
- # ["lpr", "-P#{printer}"],
- # :err=>err_w) {|ts|
- # err_w.close
- # 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
-
- if block
- pipeline_run(cmds, opts, [], [], &block)
- else
- ts, = pipeline_run(cmds, opts, [], [])
- ts
- end
- end
- module_function :pipeline_start
-
- # Open3.pipeline starts a list of commands as a pipeline.
- # It waits the finish of the commands.
- # No pipe made for stdin of the first command and
- # stdout of the last command.
- #
- # status_list = Open3.pipeline(cmd1, cmd2, ... [, opts])
- #
- # Each cmd is a string or an array.
- # If it is an array, the elements are passed to Process.spawn.
- #
- # cmd:
- # commandline command line string which is passed to a shell
- # [env, commandline, opts] command line string which is passed to a shell
- # [env, cmdname, arg1, ..., opts] command name and one or more arguments (no shell)
- # [env, [cmdname, argv0], arg1, ..., opts] command name and arguments including argv[0] (no shell)
- #
- # Note that env and opts are optional, as Process.spawn.
- #
- # Example:
- #
- # fname = "/usr/share/man/man1/ruby.1.gz"
- # p Open3.pipeline(["zcat", fname], "nroff -man", "less")
- # #=> [#<Process::Status: pid 11817 exit 0>,
- # # #<Process::Status: pid 11820 exit 0>,
- # # #<Process::Status: pid 11828 exit 0>]
- #
- # fname = "/usr/share/man/man1/ls.1.gz"
- # Open3.pipeline(["zcat", fname], "nroff -man", "colcrt")
- #
- # # convert PDF to PS and send to a printer by lpr
- # pdf_file = "paper.pdf"
- # printer = "printer-name"
- # Open3.pipeline(["pdftops", pdf_file, "-"],
- # ["lpr", "-P#{printer}"])
- #
- # # count lines
- # Open3.pipeline("sort", "uniq -c", :in=>"names.txt", :out=>"count")
- #
- # # cyclic pipeline
- # r,w = IO.pipe
- # w.print "ibase=14\n10\n"
- # Open3.pipeline("bc", "tee /dev/tty", :in=>r, :out=>w)
- # #=> 14
- # # 18
- # # 22
- # # 30
- # # 42
- # # 58
- # # 78
- # # 106
- # # 202
- #
- def pipeline(*cmds)
- if Hash === cmds.last
- opts = cmds.pop.dup
- else
- opts = {}
- end
-
- pipeline_run(cmds, opts, [], []) {|ts|
- ts.map {|t| t.value }
- }
- end
- module_function :pipeline
-
- def pipeline_run(cmds, pipeline_opts, child_io, parent_io, &block) # :nodoc:
- if cmds.empty?
- raise ArgumentError, "no commands"
- end
-
- opts_base = pipeline_opts.dup
- opts_base.delete :in
- opts_base.delete :out
-
- wait_thrs = []
- r = nil
- cmds.each_with_index {|cmd, i|
- cmd_opts = opts_base.dup
- if String === cmd
- cmd = [cmd]
- else
- cmd_opts.update cmd.pop if Hash === cmd.last
- end
- if i == 0
- if !cmd_opts.include?(:in)
- if pipeline_opts.include?(:in)
- cmd_opts[:in] = pipeline_opts[:in]
- end
- end
- else
- cmd_opts[:in] = r
- end
- if i != cmds.length - 1
- r2, w2 = IO.pipe
- cmd_opts[:out] = w2
- else
- if !cmd_opts.include?(:out)
- if pipeline_opts.include?(:out)
- cmd_opts[:out] = pipeline_opts[:out]
- end
- end
- end
- pid = spawn(*cmd, cmd_opts)
- wait_thrs << Process.detach(pid)
- r.close if r
- w2.close if w2
- r = r2
- }
- result = parent_io + [wait_thrs]
- child_io.each {|io| io.close }
+ pw[0].close
+ pr[1].close
+ pe[1].close
+ Process.waitpid(pid)
+ pi = [pw[1], pr[0], pe[0]]
+ pw[1].sync = true
if defined? yield
begin
- return yield(*result)
+ return yield(*pi)
ensure
- parent_io.each{|io| io.close unless io.closed?}
- wait_thrs.each {|t| t.join }
+ pi.each{|p| p.close unless p.closed?}
end
end
- result
- end
- module_function :pipeline_run
- class << self
- private :pipeline_run
+ pi
end
-
+ module_function :popen3
end
if $0 == __FILE__
diff --git a/lib/optparse.rb b/lib/optparse.rb
index e701363e8b..cfe344f1a0 100644
--- a/lib/optparse.rb
+++ b/lib/optparse.rb
@@ -1,15 +1,15 @@
#
# optparse.rb - command-line option analysis with the OptionParser class.
-#
+#
# Author:: Nobu Nakada
# Documentation:: Nobu Nakada and Gavin Sinclair.
#
-# See OptionParser for documentation.
+# See OptionParser for documentation.
#
-# == Developer Documentation (not for RDoc output)
-#
+# == Developer Documentation (not for RDoc output)
+#
# === Class tree
#
# - OptionParser:: front end
@@ -51,7 +51,7 @@
# solution.
#
# === Features
-#
+#
# 1. The argument specification and the code to handle it are written in the
# same place.
# 2. It can output an option summary; you don't need to maintain this string
@@ -88,12 +88,12 @@
# require 'optparse/time'
# require 'ostruct'
# require 'pp'
-#
+#
# class OptparseExample
-#
+#
# CODES = %w[iso-2022-jp shift_jis euc-jp utf8 binary]
# CODE_ALIASES = { "jis" => "iso-2022-jp", "sjis" => "shift_jis" }
-#
+#
# #
# # Return a structure describing the options.
# #
@@ -106,19 +106,19 @@
# options.encoding = "utf8"
# options.transfer_type = :auto
# options.verbose = false
-#
+#
# opts = OptionParser.new do |opts|
# opts.banner = "Usage: example.rb [options]"
-#
+#
# opts.separator ""
# opts.separator "Specific options:"
-#
+#
# # Mandatory argument.
# opts.on("-r", "--require LIBRARY",
# "Require the LIBRARY before executing your script") do |lib|
# options.library << lib
# end
-#
+#
# # Optional argument; multi-line description.
# opts.on("-i", "--inplace [EXTENSION]",
# "Edit ARGV files in place",
@@ -127,28 +127,28 @@
# options.extension = ext || ''
# options.extension.sub!(/\A\.?(?=.)/, ".") # Ensure extension begins with dot.
# end
-#
+#
# # Cast 'delay' argument to a Float.
# opts.on("--delay N", Float, "Delay N seconds before executing") do |n|
# options.delay = n
# end
-#
+#
# # Cast 'time' argument to a Time object.
# opts.on("-t", "--time [TIME]", Time, "Begin execution at given time") do |time|
# options.time = time
# end
-#
+#
# # Cast to octal integer.
# opts.on("-F", "--irs [OCTAL]", OptionParser::OctalInteger,
# "Specify record separator (default \\0)") do |rs|
# options.record_separator = rs
# end
-#
+#
# # List of arguments.
# opts.on("--list x,y,z", Array, "Example 'list' of arguments") do |list|
# options.list = list
# end
-#
+#
# # 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.
@@ -157,41 +157,41 @@
# " (#{code_list})") do |encoding|
# options.encoding = encoding
# end
-#
+#
# # 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
-#
+#
# # Boolean switch.
# opts.on("-v", "--[no-]verbose", "Run verbosely") do |v|
# options.verbose = v
# end
-#
+#
# 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
-#
+#
# # Another typical switch to print the version.
# opts.on_tail("--version", "Show version") do
# puts OptionParser::Version.join('.')
# exit
# end
# end
-#
+#
# opts.parse!(args)
# options
# end # parse()
-#
+#
# end # class OptparseExample
-#
+#
# options = OptparseExample.parse(ARGV)
# pp options
#
@@ -221,7 +221,7 @@ class OptionParser
def complete(key, icase = false, pat = nil)
pat ||= Regexp.new('\A' + Regexp.quote(key).gsub(/\w+\b/, '\&\w*'),
icase)
- canon, sw, cn = nil
+ canon, sw, k, v, cn = nil
candidates = []
each do |k, *v|
(if Regexp === k
@@ -276,7 +276,7 @@ class OptionParser
# Individual switch class. Not important to the user.
#
# Defined within Switch are several Switch-derived classes: NoArgument,
- # RequiredArgument, etc.
+ # RequiredArgument, etc.
#
class Switch
attr_reader :pattern, :conv, :short, :long, :arg, :desc, :block
@@ -301,8 +301,7 @@ class OptionParser
end
def self.incompatible_argument_styles(arg, t)
- raise(ArgumentError, "#{arg}: incompatible argument styles\n #{self}, #{t}",
- ParseError.filter_backtrace(caller(2)))
+ raise ArgumentError, "#{arg}: incompatible argument styles\n #{self}, #{t}"
end
def self.pattern
@@ -322,10 +321,10 @@ class OptionParser
# argument pattern. Yields when the pattern doesn't match substring.
#
def parse_arg(arg)
- pattern or return nil, [arg]
+ pattern or return nil, arg
unless m = pattern.match(arg)
yield(InvalidArgument, arg)
- return arg, []
+ return arg, nil
end
if String === m
m = [s = m]
@@ -346,11 +345,11 @@ class OptionParser
# conversion. Yields at semi-error condition instead of raising an
# exception.
#
- def conv_arg(arg, val = [])
+ def conv_arg(arg, val = nil)
if conv
val = conv.call(*val)
else
- val = proc {|v| v}.call(*val)
+ val = proc {|val| val}.call(*val)
end
return arg, block, val
end
@@ -369,7 +368,7 @@ class OptionParser
# +indent+:: Prefix string indents all summarized lines.
#
def summarize(sdone = [], ldone = [], width = 1, max = width - 1, indent = "")
- sopts, lopts = [], [], nil
+ sopts, lopts, s = [], [], 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
return if sopts.empty? and lopts.empty? # completely hidden
@@ -384,16 +383,10 @@ class OptionParser
left[-1] << if left[-1].empty? then ' ' * 4 else ', ' end << s
end
- if arg
- left[0] << (left[1] ? arg.sub(/\A(\[?)=/, '\1') + ',' : arg)
- end
- mlen = left.collect {|ss| ss.length}.max.to_i
+ left[0] << arg if arg
+ mlen = left.collect {|s| s.length}.max.to_i
while mlen > width and l = left.shift
- mlen = left.collect {|ss| ss.length}.max.to_i if l.length == mlen
- if l.length < width and (r = right[0]) and !r.empty?
- l = l.to_s.ljust(width) + ' ' + r
- right.shift
- end
+ mlen = left.collect {|s| s.length}.max.to_i if l.length == mlen
yield(indent + l)
end
@@ -413,7 +406,7 @@ class OptionParser
to
end
- def match_nonswitch?(str) # :nodoc:
+ def match_nonswitch?(str) # :nodoc:
@pattern =~ str unless @short or @long
end
@@ -458,7 +451,7 @@ class OptionParser
raise MissingArgument if argv.empty?
arg = argv.shift
end
- conv_arg(*parse_arg(arg, &method(:raise)))
+ conv_arg(*parse_arg(arg) {|*exc| raise(*exc)})
end
end
@@ -511,13 +504,13 @@ class OptionParser
class List
# Map from acceptable argument types to pattern and converter pairs.
attr_reader :atype
-
+
# Map from short style option switches to actual switch objects.
attr_reader :short
-
+
# Map from long style option switches to actual switch objects.
attr_reader :long
-
+
# List of all switches and summary string.
attr_reader :list
@@ -534,10 +527,9 @@ class OptionParser
#
# See OptionParser.accept.
#
- def accept(t, pat = /.*/m, &block)
+ def accept(t, pat = /.*/nm, &block)
if pat
- pat.respond_to?(:match) or
- raise TypeError, "has no `match'", ParseError.filter_backtrace(caller(2))
+ pat.respond_to?(:match) or raise TypeError, "has no `match'"
else
pat = t if t.respond_to?(:match)
end
@@ -563,6 +555,7 @@ class OptionParser
# +nlopts+:: Negated long style options list.
#
def update(sw, sopts, lopts, nsw = nil, nlopts = nil)
+ o = nil
sopts.each {|o| @short[o] = sw} if sopts
lopts.each {|o| @long[o] = sw} if lopts
nlopts.each {|o| @long[o] = nsw} if nsw and nlopts
@@ -574,7 +567,7 @@ class OptionParser
#
# Inserts +switch+ at the head of the list, and associates short, long
# and negated long options. Arguments are:
- #
+ #
# +switch+:: OptionParser::Switch instance to be inserted.
# +short_opts+:: List of short style options.
# +long_opts+:: List of long style options.
@@ -590,7 +583,7 @@ class OptionParser
#
# Appends +switch+ at the tail of the list, and associates short, long
# and negated long options. Arguments are:
- #
+ #
# +switch+:: OptionParser::Switch instance to be inserted.
# +short_opts+:: List of short style options.
# +long_opts+:: List of long style options.
@@ -674,10 +667,9 @@ class OptionParser
# Completion for hash key.
#
def match(key)
- *values = fetch(key) {
+ return key, *fetch(key) {
raise AmbiguousArgument, catch(:ambiguous) {return complete(key)}
}
- return key, *values
end
end
@@ -756,7 +748,7 @@ class OptionParser
# Initializes a new instance and evaluates the optional block in context
# of the instance. Arguments +args+ are passed to #new, see there for
# description of parameters.
- #
+ #
# This method is *deprecated*, its behavior corresponds to the older #new
# method.
#
@@ -1000,14 +992,17 @@ class OptionParser
#
def notwice(obj, prv, msg)
unless !prv or prv == obj
- raise(ArgumentError, "argument #{msg} given twice: #{obj}",
- ParseError.filter_backtrace(caller(2)))
+ begin
+ raise ArgumentError, "argument #{msg} given twice: #{obj}"
+ rescue
+ $@[0, 2] = nil
+ raise
+ end
end
obj
end
private :notwice
- SPLAT_PROC = proc {|*a| a.length <= 1 ? a.first : a}
#
# Creates an OptionParser::Switch from the parameters. The parsed argument
# value is passed to the given block, where it can be processed.
@@ -1049,7 +1044,7 @@ class OptionParser
# There is also a special form which matches character range (not full
# set of regular expression):
# "-[a-z]MANDATORY"
- # "-[a-z][OPTIONAL]"
+ # "-[a-z][OPTIONAL]"
# "-[a-z]"
#
# [Argument style and description:]
@@ -1061,7 +1056,7 @@ class OptionParser
# [Description:]
# Description string for the option.
# "Run verbosely"
- #
+ #
# [Handler:]
# Handler for the parsed argument value. Either give a block or pass a
# Proc or Method as an argument.
@@ -1072,6 +1067,7 @@ class OptionParser
default_style = Switch::NoArgument
default_pattern = nil
klass = nil
+ o = nil
n, q, a = nil
opts.each do |o|
@@ -1086,13 +1082,9 @@ class OptionParser
end
# directly specified pattern(any object possible to match)
- if (!(String === o || Symbol === o)) and o.respond_to?(:match)
+ if !(String === o) and o.respond_to?(:match)
pattern = notwice(o, pattern, 'pattern')
- if pattern.respond_to?(:convert)
- conv = pattern.method(:convert).to_proc
- else
- conv = SPLAT_PROC
- end
+ conv = pattern.method(:convert).to_proc if pattern.respond_to?(:convert)
next
end
@@ -1109,9 +1101,9 @@ class OptionParser
else
raise ArgumentError, "argument pattern given twice"
end
- o.each {|pat, *v| pattern[pat] = v.fetch(0) {pat}}
+ o.each {|(o, *v)| pattern[o] = v.fetch(0) {o}}
when Module
- raise ArgumentError, "unsupported argument type: #{o}", ParseError.filter_backtrace(caller(4))
+ raise ArgumentError, "unsupported argument type: #{o}"
when *ArgumentStyle.keys
style = notwice(ArgumentStyle[o], style, 'style')
when /^--no-([^\[\]=\s]*)(.+)?/
@@ -1176,9 +1168,7 @@ class OptionParser
s = (style || default_style).new(pattern || default_pattern,
conv, sdesc, ldesc, arg, desc, block)
elsif !block
- if style or pattern
- raise ArgumentError, "no switch given", ParseError.filter_backtrace(caller)
- end
+ raise ArgumentError, "no switch given" if style or pattern
s = desc
else
short << pattern
@@ -1259,13 +1249,13 @@ class OptionParser
end
def parse_in_order(argv = default_argv, setter = nil, &nonopt) # :nodoc:
- opt, arg, val, rest = nil
- nonopt ||= proc {|a| throw :terminate, a}
+ opt, arg, sw, val, rest = nil
+ nonopt ||= proc {|arg| throw :terminate, arg}
argv.unshift(arg) if arg = catch(:terminate) {
while arg = argv.shift
case arg
# long option
- when /\A--([^=]*)(?:=(.*))?/m
+ when /\A--([^=]*)(?:=(.*))?/nm
opt, rest = $1, $2
begin
sw, = complete(:long, opt, true)
@@ -1281,7 +1271,7 @@ class OptionParser
end
# short option
- when /\A-(.)((=).*|.+)?/m
+ when /\A-(.)((=).*|.+)?/nm
opt, has_arg, eq, val, rest = $1, $3, $3, $2, $2
begin
sw, = search(:short, opt)
@@ -1304,7 +1294,7 @@ class OptionParser
begin
opt, cb, val = sw.parse(val, argv) {|*exc| raise(*exc) if eq}
raise InvalidOption, arg if has_arg and !eq and arg == "-#{opt}"
- argv.unshift(opt) if opt and (!rest or (opt = opt.sub(/\A-*/, '-')) != '-')
+ argv.unshift(opt) if opt and (opt = opt.sub(/\A-*/, '-')) != '-'
val = cb.call(val) if cb
setter.call(sw.switch_name, val) if setter
rescue ParseError
@@ -1314,8 +1304,7 @@ class OptionParser
# non-option argument
else
catch(:prune) do
- visit(:each_option) do |sw0|
- sw = sw0
+ visit(:each_option) do |sw|
sw.block.call(arg) if Switch === sw and sw.match_nonswitch?(arg)
end
nonopt.call(arg)
@@ -1346,7 +1335,8 @@ class OptionParser
#
def permute!(argv = default_argv)
nonopts = []
- order!(argv, &nonopts.method(:<<))
+ arg = nil
+ order!(argv) {|arg| nonopts << arg}
argv[0, 0] = nonopts
argv
end
@@ -1423,6 +1413,7 @@ class OptionParser
# +block+.
#
def visit(id, *args, &block)
+ el = nil
@stack.reverse_each do |el|
el.send(id, *args, &block)
end
@@ -1455,7 +1446,7 @@ class OptionParser
search(typ, opt) {|sw| return [sw, opt]} # exact match or...
end
raise AmbiguousOption, catch(:ambiguous) {
- visit(:complete, typ, opt, icase, *pat) {|o, *sw| return sw}
+ visit(:complete, typ, opt, icase, *pat) {|opt, *sw| return sw}
raise InvalidOption, opt
}
end
@@ -1508,7 +1499,7 @@ class OptionParser
#
# Any non-empty string, and no conversion.
#
- accept(String, /.+/m) {|s,*|s}
+ accept(String, /.+/nm) {|s,*|s}
#
# Ruby/C-like integer, octal for 0-7 sequence, binary for 0b, hexadecimal
@@ -1575,7 +1566,7 @@ class OptionParser
#
accept(Array) do |s,|
if s
- s = s.split(',').collect {|ss| ss unless ss.empty?}
+ s = s.split(',').collect {|s| s unless s.empty?}
end
s
end
@@ -1621,17 +1612,6 @@ class OptionParser
argv
end
- def self.filter_backtrace(array)
- unless $DEBUG
- array.delete_if(&%r"\A#{Regexp.quote(__FILE__)}:"o.method(:=~))
- end
- array
- end
-
- def set_backtrace(array)
- super(self.class.filter_backtrace(array))
- end
-
def set_option(opt, eq)
if eq
@args[0] = opt
diff --git a/lib/optparse/version.rb b/lib/optparse/version.rb
index 76ed564287..558d9d710b 100644
--- a/lib/optparse/version.rb
+++ b/lib/optparse/version.rb
@@ -1,7 +1,7 @@
# OptionParser internal utility
class << OptionParser
- def show_version(*pkgs)
+ def show_version(*pkg)
progname = ARGV.options.program_name
result = false
show = proc do |klass, cname, version|
@@ -19,14 +19,14 @@ class << OptionParser
puts str
result = true
end
- if pkgs.size == 1 and pkgs[0] == "all"
+ if pkg.size == 1 and pkg[0] == "all"
self.search_const(::Object, /\AV(?:ERSION|ersion)\z/) do |klass, cname, version|
unless cname[1] == ?e and klass.const_defined?(:Version)
show.call(klass, cname.intern, version)
end
end
else
- pkgs.each do |pkg|
+ pkg.each do |pkg|
begin
pkg = pkg.split(/::|\//).inject(::Object) {|m, c| m.const_get(c)}
v = case
@@ -46,8 +46,8 @@ class << OptionParser
result
end
- def each_const(path, base = ::Object)
- path.split(/::|\//).inject(base) do |klass, name|
+ def each_const(path, klass = ::Object)
+ path.split(/::|\//).inject(klass) do |klass, name|
raise NameError, path unless Module === klass
klass.constants.grep(/#{name}/i) do |c|
klass.const_defined?(c) or next
diff --git a/lib/ostruct.rb b/lib/ostruct.rb
index aea0c8e124..6af5bbdac0 100644
--- a/lib/ostruct.rb
+++ b/lib/ostruct.rb
@@ -12,13 +12,13 @@
# OpenStruct allows you to create data objects and set arbitrary attributes.
# For example:
#
-# require 'ostruct'
+# require 'ostruct'
#
# record = OpenStruct.new
# record.name = "John Smith"
# record.age = 70
# record.pension = 300
-#
+#
# puts record.name # -> "John Smith"
# puts record.address # -> nil
#
@@ -41,7 +41,7 @@ class OpenStruct
#
# p data # -> <OpenStruct country="Australia" population=20000000>
#
- # By default, the resulting OpenStruct object will have no attributes.
+ # By default, the resulting OpenStruct object will have no attributes.
#
def initialize(hash=nil)
@table = {}
@@ -53,7 +53,7 @@ class OpenStruct
end
end
- # Duplicate an OpenStruct object members.
+ # Duplicate an OpenStruct object members.
def initialize_copy(orig)
super
@table = @table.dup
@@ -67,35 +67,28 @@ class OpenStruct
@table.each_key{|key| new_ostruct_member(key)}
end
- def modifiable
- begin
- @modifiable = true
- rescue
- raise TypeError, "can't modify frozen #{self.class}", caller(3)
- end
- @table
- end
- protected :modifiable
-
def new_ostruct_member(name)
name = name.to_sym
unless self.respond_to?(name)
- class << self; self; end.class_eval do
- define_method(name) { @table[name] }
- define_method("#{name}=") { |x| modifiable[name] = x }
- end
+ meta = class << self; self; end
+ meta.send(:define_method, name) { @table[name] }
+ meta.send(:define_method, :"#{name}=") { |x| @table[name] = x }
end
- name
end
def method_missing(mid, *args) # :nodoc:
mname = mid.id2name
len = args.length
- if mname.chomp!('=')
+ if mname =~ /=$/
if len != 1
raise ArgumentError, "wrong number of arguments (#{len} for 1)", caller(1)
end
- modifiable[new_ostruct_member(mname)] = args[0]
+ if self.frozen?
+ raise TypeError, "can't modify frozen #{self.class}", caller(1)
+ end
+ mname.chop!
+ self.new_ostruct_member(mname)
+ @table[mname.intern] = args[0]
elsif len == 0
@table[mid]
else
@@ -118,23 +111,25 @@ class OpenStruct
def inspect
str = "#<#{self.class}"
- ids = (Thread.current[InspectKey] ||= [])
- if ids.include?(object_id)
- return str << ' ...>'
- end
-
- ids << object_id
- begin
+ Thread.current[InspectKey] ||= []
+ if Thread.current[InspectKey].include?(self) then
+ str << " ..."
+ else
first = true
for k,v in @table
str << "," unless first
first = false
- str << " #{k}=#{v.inspect}"
+
+ Thread.current[InspectKey] << v
+ begin
+ str << " #{k}=#{v.inspect}"
+ ensure
+ Thread.current[InspectKey].pop
+ end
end
- return str << '>'
- ensure
- ids.pop
end
+
+ str << ">"
end
alias :to_s :inspect
diff --git a/lib/parsearg.rb b/lib/parsearg.rb
new file mode 100644
index 0000000000..cab2dba789
--- /dev/null
+++ b/lib/parsearg.rb
@@ -0,0 +1,87 @@
+#
+# parsearg.rb - parse arguments
+# $Release Version: $
+# $Revision$
+# $Date$
+# by Yasuo OHBA(SHL Japan Inc. Technology Dept.)
+#
+# --
+#
+#
+#
+
+warn "Warning:#{caller[0].sub(/:in `.*'\z/, '')}: parsearg is deprecated after Ruby 1.8.1; use optparse instead"
+
+$RCS_ID=%q$Header$
+
+require "getopts"
+
+def printUsageAndExit()
+ if $USAGE
+ eval($USAGE)
+ end
+ exit()
+end
+
+def setParenthesis(ex, opt, c)
+ if opt != ""
+ ex = sprintf("%s$OPT_%s%s", ex, opt, c)
+ else
+ ex = sprintf("%s%s", ex, c)
+ end
+ return ex
+end
+
+def setOrAnd(ex, opt, c)
+ if opt != ""
+ ex = sprintf("%s$OPT_%s %s%s ", ex, opt, c, c)
+ else
+ ex = sprintf("%s %s%s ", ex, c, c)
+ end
+ return ex
+end
+
+def setExpression(ex, opt, op)
+ if !op
+ ex = sprintf("%s$OPT_%s", ex, opt)
+ return ex
+ end
+ case op.chr
+ when "(", ")"
+ ex = setParenthesis(ex, opt, op.chr)
+ when "|", "&"
+ ex = setOrAnd(ex, opt, op.chr)
+ else
+ return nil
+ end
+ return ex
+end
+
+# parseArgs is obsolete. Use OptionParser instead.
+
+def parseArgs(argc, nopt, single_opts, *opts)
+ if (noOptions = getopts(single_opts, *opts)) == nil
+ printUsageAndExit()
+ end
+ if nopt
+ ex = nil
+ pos = 0
+ for o in nopt.split(/[()|&]/)
+ pos += o.length
+ ex = setExpression(ex, o, nopt[pos])
+ pos += 1
+ end
+ begin
+ if !eval(ex)
+ printUsageAndExit()
+ end
+ rescue
+ print "Format Error!! : \"" + nopt + "\"\t[parseArgs]\n"
+ exit!(-1)
+ end
+ end
+ if ARGV.length < argc
+ printUsageAndExit()
+ end
+ return noOptions
+end
diff --git a/lib/parsedate.rb b/lib/parsedate.rb
new file mode 100644
index 0000000000..b52a79ba47
--- /dev/null
+++ b/lib/parsedate.rb
@@ -0,0 +1,53 @@
+#
+# = parsedate.rb: Parses dates
+#
+# Author:: Tadayoshi Funaba
+# Documentation:: Konrad Meyer
+#
+# ParseDate munches on a date and turns it into an array of values.
+#
+
+#
+# ParseDate converts a date into an array of values.
+# For example:
+#
+# require 'parsedate'
+#
+# ParseDate.parsedate "Tuesday, July 6th, 2007, 18:35:20 UTC"
+# # => [2007, 7, 6, 18, 35, 20, "UTC", 2]
+#
+# The order is of the form [year, month, day of month, hour, minute, second,
+# timezone, day of the week].
+
+require 'date/format'
+
+module ParseDate
+ #
+ # Parse a string representation of a date into values.
+ # For example:
+ #
+ # require 'parsedate'
+ #
+ # ParseDate.parsedate "Tuesday, July 5th, 2007, 18:35:20 UTC"
+ # # => [2007, 7, 5, 18, 35, 20, "UTC", 2]
+ #
+ # The order is of the form [year, month, day of month, hour, minute,
+ # second, timezone, day of week].
+ #
+ # ParseDate.parsedate can also take a second argument, +comp+, which
+ # is a boolean telling the method to compensate for dates with years
+ # expressed as two digits. Example:
+ #
+ # require 'parsedate'
+ #
+ # ParseDate.parsedate "Mon Dec 25 00 06:53:24 UTC", true
+ # # => [2000, 12, 25, 6, 53, 24, "UTC", 1]
+ #
+ def parsedate(str, comp=false)
+ Date._parse(str, comp).
+ values_at(:year, :mon, :mday, :hour, :min, :sec, :zone, :wday)
+ end
+
+ module_function :parsedate
+
+end
diff --git a/lib/pathname.rb b/lib/pathname.rb
index 8af8957c7b..e4ca5489ce 100644
--- a/lib/pathname.rb
+++ b/lib/pathname.rb
@@ -36,27 +36,27 @@
# === Example 1: Using Pathname
#
# require 'pathname'
-# pn = Pathname.new("/usr/bin/ruby")
-# size = pn.size # 27662
-# isdir = pn.directory? # false
-# dir = pn.dirname # Pathname:/usr/bin
-# base = pn.basename # Pathname:ruby
-# dir, base = pn.split # [Pathname:/usr/bin, Pathname:ruby]
-# data = pn.read
-# pn.open { |f| _ }
-# pn.each_line { |line| _ }
+# p = Pathname.new("/usr/bin/ruby")
+# size = p.size # 27662
+# isdir = p.directory? # false
+# dir = p.dirname # Pathname:/usr/bin
+# base = p.basename # Pathname:ruby
+# dir, base = p.split # [Pathname:/usr/bin, Pathname:ruby]
+# data = p.read
+# p.open { |f| _ }
+# p.each_line { |line| _ }
#
# === Example 2: Using standard Ruby
#
-# pn = "/usr/bin/ruby"
-# size = File.size(pn) # 27662
-# isdir = File.directory?(pn) # false
-# dir = File.dirname(pn) # "/usr/bin"
-# base = File.basename(pn) # "ruby"
-# dir, base = File.split(pn) # ["/usr/bin", "ruby"]
-# data = File.read(pn)
-# File.open(pn) { |f| _ }
-# File.foreach(pn) { |line| _ }
+# p = "/usr/bin/ruby"
+# size = File.size(p) # 27662
+# isdir = File.directory?(p) # false
+# dir = File.dirname(p) # "/usr/bin"
+# base = File.basename(p) # "ruby"
+# dir, base = File.split(p) # ["/usr/bin", "ruby"]
+# data = File.read(p)
+# File.open(p) { |f| _ }
+# File.foreach(p) { |line| _ }
#
# === Example 3: Special features
#
@@ -71,14 +71,14 @@
# p5.cleanpath # Pathname:articles
# p5.realpath # Pathname:/home/gavin/articles
# p5.children # [Pathname:/home/gavin/articles/linux, ...]
-#
+#
# == Breakdown of functionality
#
# === Core methods
#
-# These methods are effectively manipulating a String, because that's
-# all a path is. Except for #mountpoint?, #children, #each_child,
-# #realdirpath and #realpath, they don't access the filesystem.
+# These methods are effectively manipulating a String, because that's all a path
+# is. Except for #mountpoint?, #children, and #realpath, they don't access the
+# filesystem.
#
# - +
# - #join
@@ -90,9 +90,7 @@
# - #each_filename
# - #cleanpath
# - #realpath
-# - #realdirpath
# - #children
-# - #each_child
# - #mountpoint?
#
# === File status predicate methods
@@ -167,7 +165,6 @@
# These methods are a facade for IO:
# - #each_line(*args, &block)
# - #read(*args)
-# - #binread(*args)
# - #readlines(*args)
# - #sysopen(*args)
#
@@ -197,13 +194,6 @@ class Pathname
# to_path is implemented so Pathname objects are usable with File.open, etc.
TO_PATH = :to_path
end
-
- SAME_PATHS = if File::FNM_SYSCASE
- proc {|a, b| a.casecmp(b).zero?}
- else
- proc {|a, b| a == b}
- end
-
# :startdoc:
#
@@ -261,44 +251,19 @@ class Pathname
# Return a pathname which is substituted by String#sub.
def sub(pattern, *rest, &block)
- if block
- path = @path.sub(pattern, *rest) {|*args|
- begin
- old = Thread.current[:pathname_sub_matchdata]
- Thread.current[:pathname_sub_matchdata] = $~
- eval("$~ = Thread.current[:pathname_sub_matchdata]", block.binding)
- ensure
- Thread.current[:pathname_sub_matchdata] = old
- end
- yield(*args)
- }
- else
- path = @path.sub(pattern, *rest)
- end
- self.class.new(path)
+ self.class.new(@path.sub(pattern, *rest, &block))
end
if File::ALT_SEPARATOR
- SEPARATOR_LIST = "#{Regexp.quote File::ALT_SEPARATOR}#{Regexp.quote File::SEPARATOR}"
- SEPARATOR_PAT = /[#{SEPARATOR_LIST}]/
+ SEPARATOR_PAT = /[#{Regexp.quote File::ALT_SEPARATOR}#{Regexp.quote File::SEPARATOR}]/
else
- SEPARATOR_LIST = "#{Regexp.quote File::SEPARATOR}"
SEPARATOR_PAT = /#{Regexp.quote File::SEPARATOR}/
end
- # Return a pathname which the extension of the basename is substituted by
- # <i>repl</i>.
- #
- # If self has no extension part, <i>repl</i> is appended.
- def sub_ext(repl)
- ext = File.extname(@path)
- self.class.new(@path.chomp(ext) + repl)
- end
-
# chop_basename(path) -> [pre-basename, basename] or nil
def chop_basename(path)
base = File.basename(path)
- if /\A#{SEPARATOR_PAT}?\z/o =~ base
+ if /\A#{SEPARATOR_PAT}?\z/ =~ base
return nil
else
return path[0, path.rindex(base)], base
@@ -320,7 +285,7 @@ class Pathname
def prepend_prefix(prefix, relpath)
if relpath.empty?
File.dirname(prefix)
- elsif /#{SEPARATOR_PAT}/o =~ prefix
+ elsif /#{SEPARATOR_PAT}/ =~ prefix
prefix = File.dirname(prefix)
prefix = File.join(prefix, "") if File.basename(prefix + 'a') != 'a'
prefix + relpath
@@ -435,7 +400,7 @@ class Pathname
end
private :cleanpath_conservative
- def realpath_rec(prefix, unresolved, h, strict, last = true)
+ def realpath_rec(prefix, unresolved, h)
resolved = []
until unresolved.empty?
n = unresolved.shift
@@ -452,20 +417,14 @@ class Pathname
prefix, *resolved = h[path]
end
else
- begin
- s = File.lstat(path)
- rescue Errno::ENOENT => e
- raise e if strict || !last || !unresolved.empty?
- resolved << n
- break
- end
+ s = File.lstat(path)
if s.symlink?
h[path] = :resolving
link_prefix, link_names = split_names(File.readlink(path))
if link_prefix == ''
- prefix, *resolved = h[path] = realpath_rec(prefix, resolved + link_names, h, strict, unresolved.empty?)
+ prefix, *resolved = h[path] = realpath_rec(prefix, resolved + link_names, h)
else
- prefix, *resolved = h[path] = realpath_rec(link_prefix, link_names, h, strict, unresolved.empty?)
+ prefix, *resolved = h[path] = realpath_rec(link_prefix, link_names, h)
end
else
resolved << n
@@ -478,38 +437,22 @@ class Pathname
end
private :realpath_rec
- def real_path_internal(strict = false)
+ #
+ # Returns a real (absolute) pathname of +self+ in the actual filesystem.
+ # The real pathname doesn't contain symlinks or useless dots.
+ #
+ # No arguments should be given; the old behaviour is *obsoleted*.
+ #
+ def realpath
path = @path
prefix, names = split_names(path)
if prefix == ''
prefix, names2 = split_names(Dir.pwd)
names = names2 + names
end
- prefix, *names = realpath_rec(prefix, names, {}, strict)
+ prefix, *names = realpath_rec(prefix, names, {})
self.class.new(prepend_prefix(prefix, File.join(*names)))
end
- private :real_path_internal
-
- #
- # Returns the real (absolute) pathname of +self+ in the actual
- # filesystem not containing symlinks or useless dots.
- #
- # All components of the pathname must exist when this method is
- # called.
- #
- def realpath
- real_path_internal(true)
- end
-
- #
- # Returns the real (absolute) pathname of +self+ in the actual filesystem.
- # The real pathname doesn't contain symlinks or useless dots.
- #
- # The last component of the real pathname can be nonexistent.
- #
- def realdirpath
- real_path_internal(false)
- end
# #parent returns the parent directory.
#
@@ -563,7 +506,6 @@ class Pathname
# # yields "usr", "bin", and "ruby".
#
def each_filename # :yield: filename
- return to_enum(__method__) unless block_given?
prefix, names = split_names(@path)
names.each {|filename| yield filename }
nil
@@ -634,7 +576,7 @@ class Pathname
# p2 = p1 + "bin/ruby" # Pathname:/usr/bin/ruby
# p3 = p1 + "/etc/passwd" # Pathname:/etc/passwd
#
- # This method doesn't access the file system; it is pure string manipulation.
+ # This method doesn't access the file system; it is pure string manipulation.
#
def +(other)
other = Pathname.new(other) unless Pathname === other
@@ -710,12 +652,12 @@ class Pathname
# filename only.
#
# For example:
- # pn = Pathname("/usr/lib/ruby/1.8")
- # pn.children
+ # p = Pathname("/usr/lib/ruby/1.8")
+ # p.children
# # -> [ Pathname:/usr/lib/ruby/1.8/English.rb,
# Pathname:/usr/lib/ruby/1.8/Env.rb,
# Pathname:/usr/lib/ruby/1.8/abbrev.rb, ... ]
- # pn.children(false)
+ # p.children(false)
# # -> [ Pathname:English.rb, Pathname:Env.rb, Pathname:abbrev.rb, ... ]
#
# Note that the result never contain the entries <tt>.</tt> and <tt>..</tt> in
@@ -737,36 +679,6 @@ class Pathname
result
end
- # Iterates over the children of the directory
- # (files and subdirectories, not recursive).
- # It yields Pathname object for each child.
- # By default, the yielded pathnames will have enough information to access the files.
- # If you set +with_directory+ to +false+, then the returned pathnames will contain the filename only.
- #
- # Pathname("/usr/local").each_child {|f| p f }
- # #=> #<Pathname:/usr/local/share>
- # # #<Pathname:/usr/local/bin>
- # # #<Pathname:/usr/local/games>
- # # #<Pathname:/usr/local/lib>
- # # #<Pathname:/usr/local/include>
- # # #<Pathname:/usr/local/sbin>
- # # #<Pathname:/usr/local/src>
- # # #<Pathname:/usr/local/man>
- #
- # Pathname("/usr/local").each_child(false) {|f| p f }
- # #=> #<Pathname:share>
- # # #<Pathname:bin>
- # # #<Pathname:games>
- # # #<Pathname:lib>
- # # #<Pathname:include>
- # # #<Pathname:sbin>
- # # #<Pathname:src>
- # # #<Pathname:man>
- #
- def each_child(with_directory=true, &b)
- children(with_directory).each(&b)
- end
-
#
# #relative_path_from returns a relative path from the argument to the
# receiver. If +self+ is absolute, the argument must be absolute too. If
@@ -793,12 +705,12 @@ class Pathname
base_prefix, basename = r
base_names.unshift basename if basename != '.'
end
- unless SAME_PATHS[dest_prefix, base_prefix]
+ if dest_prefix != base_prefix
raise ArgumentError, "different prefix: #{dest_prefix.inspect} and #{base_directory.inspect}"
end
while !dest_names.empty? &&
!base_names.empty? &&
- SAME_PATHS[dest_names.first, base_names.first]
+ dest_names.first == base_names.first
dest_names.shift
base_names.shift
end
@@ -826,13 +738,15 @@ class Pathname # * IO *
IO.foreach(@path, *args, &block)
end
- # See <tt>IO.read</tt>. Returns all data from the file, or the first +N+ bytes
- # if specified.
- def read(*args) IO.read(@path, *args) end
+ # Pathname#foreachline is *obsoleted* at 1.8.1. Use #each_line.
+ def foreachline(*args, &block)
+ warn "Pathname#foreachline is obsoleted. Use Pathname#each_line."
+ each_line(*args, &block)
+ end
- # See <tt>IO.binread</tt>. Returns all the bytes from the file, or the first +N+
+ # See <tt>IO.read</tt>. Returns all the bytes from the file, or the first +N+
# if specified.
- def binread(*args) IO.binread(@path, *args) end
+ def read(*args) IO.read(@path, *args) end
# See <tt>IO.readlines</tt>. Returns all the lines from the file.
def readlines(*args) IO.readlines(@path, *args) end
@@ -920,6 +834,20 @@ class Pathname # * File *
# See <tt>File.split</tt>. Returns the #dirname and the #basename in an
# Array.
def split() File.split(@path).map {|f| self.class.new(f) } end
+
+ # Pathname#link is confusing and *obsoleted* because the receiver/argument
+ # order is inverted to corresponding system call.
+ def link(old)
+ warn 'Pathname#link is obsoleted. Use Pathname#make_link.'
+ File.link(old, @path)
+ end
+
+ # Pathname#symlink is confusing and *obsoleted* because the receiver/argument
+ # order is inverted to corresponding system call.
+ def symlink(old)
+ warn 'Pathname#symlink is obsoleted. Use Pathname#make_symlink.'
+ File.symlink(old, @path)
+ end
end
@@ -1001,7 +929,7 @@ end
class Pathname # * Dir *
# See <tt>Dir.glob</tt>. Returns or yields Pathname objects.
- def Pathname.glob(*args) # :yield: pathname
+ def Pathname.glob(*args) # :yield: p
if block_given?
Dir.glob(*args) {|f| yield self.new(f) }
else
@@ -1013,6 +941,18 @@ class Pathname # * Dir *
def Pathname.getwd() self.new(Dir.getwd) end
class << self; alias pwd getwd end
+ # Pathname#chdir is *obsoleted* at 1.8.1.
+ def chdir(&block)
+ warn "Pathname#chdir is obsoleted. Use Dir.chdir."
+ Dir.chdir(@path, &block)
+ end
+
+ # Pathname#chroot is *obsoleted* at 1.8.1.
+ def chroot
+ warn "Pathname#chroot is obsoleted. Use Dir.chroot."
+ Dir.chroot(@path)
+ end
+
# Return the entries (files and subdirectories) in the directory, each as a
# Pathname object.
def entries() Dir.entries(@path).map {|f| self.class.new(f) } end
@@ -1021,10 +961,16 @@ class Pathname # * Dir *
# yields a Pathname object for each entry.
#
# This method has existed since 1.8.1.
- def each_entry(&block) # :yield: pathname
+ def each_entry(&block) # :yield: p
Dir.foreach(@path) {|f| yield self.class.new(f) }
end
+ # Pathname#dir_foreach is *obsoleted* at 1.8.1.
+ def dir_foreach(*args, &block)
+ warn "Pathname#dir_foreach is obsoleted. Use Pathname#each_entry."
+ each_entry(*args, &block)
+ end
+
# See <tt>Dir.mkdir</tt>. Create the referenced directory.
def mkdir(*args) Dir.mkdir(@path, *args) end
@@ -1049,7 +995,7 @@ class Pathname # * Find *
# If +self+ is <tt>.</tt>, yielded pathnames begin with a filename in the
# current directory, not <tt>./</tt>.
#
- def find(&block) # :yield: pathname
+ def find(&block) # :yield: p
require 'find'
if @path == '.'
Find.find(@path) {|f| yield self.class.new(f.sub(%r{\A\./}, '')) }
@@ -1091,10 +1037,18 @@ class Pathname # * mixed *
end
end
alias delete unlink
-end
-class Pathname
- undef =~
+ # This method is *obsoleted* at 1.8.1. Use #each_line or #each_entry.
+ def foreach(*args, &block)
+ warn "Pathname#foreach is obsoleted. Use each_line or each_entry."
+ if FileTest.directory? @path
+ # For polymorphism between Dir.foreach and IO.foreach,
+ # Pathname#foreach doesn't yield Pathname object.
+ Dir.foreach(@path, *args, &block)
+ else
+ IO.foreach(@path, *args, &block)
+ end
+ end
end
module Kernel
diff --git a/lib/ping.rb b/lib/ping.rb
new file mode 100644
index 0000000000..c2966b619c
--- /dev/null
+++ b/lib/ping.rb
@@ -0,0 +1,64 @@
+#
+# = ping.rb: Check a host for upness
+#
+# Author:: Yukihiro Matsumoto
+# Documentation:: Konrad Meyer
+#
+# Performs the function of the basic network testing tool, ping.
+# See: Ping.
+#
+
+require 'timeout'
+require "socket"
+
+#
+# Ping contains routines to test for the reachability of remote hosts.
+# Currently the only routine implemented is pingecho().
+#
+# Ping.pingecho uses a TCP echo (not an ICMP echo) to determine if the
+# remote host is reachable. This is usually adequate to tell that a remote
+# host is available to telnet, ftp, or ssh to.
+#
+# Warning: Ping.pingecho may block for a long time if DNS resolution is
+# slow. Requiring 'resolv-replace' allows non-blocking name resolution.
+#
+# Usage:
+#
+# require 'ping'
+#
+# puts "'jimmy' is alive and kicking" if Ping.pingecho('jimmy', 10)
+#
+module Ping
+
+ #
+ # Return true if we can open a connection to the hostname or IP address
+ # +host+ on port +service+ (which defaults to the "echo" port) waiting up
+ # to +timeout+ seconds.
+ #
+ # Example:
+ #
+ # require 'ping'
+ #
+ # Ping.pingecho "google.com", 10, 80
+ #
+ def pingecho(host, timeout=5, service="echo")
+ begin
+ timeout(timeout) do
+ s = TCPSocket.new(host, service)
+ s.close
+ end
+ rescue Errno::ECONNREFUSED
+ return true
+ rescue Timeout::Error, StandardError
+ return false
+ end
+ return true
+ end
+ module_function :pingecho
+end
+
+if $0 == __FILE__
+ host = ARGV[0]
+ host ||= "localhost"
+ printf("%s alive? - %s\n", host, Ping::pingecho(host, 5))
+end
diff --git a/lib/pp.rb b/lib/pp.rb
index e28875c8e2..14fe62ee95 100644
--- a/lib/pp.rb
+++ b/lib/pp.rb
@@ -1,10 +1,10 @@
# == Pretty-printer for Ruby objects.
-#
+#
# = Which seems better?
-#
+#
# non-pretty-printed output by #p is:
# #<PP:0x81fedf0 @genspace=#<Proc:0x81feda0>, @group_queue=#<PrettyPrint::GroupQueue:0x81fed3c @queue=[[#<PrettyPrint::Group:0x81fed78 @breakables=[], @depth=0, @break=false>], []]>, @buffer=[], @newline="\n", @group_stack=[#<PrettyPrint::Group:0x81fed78 @breakables=[], @depth=0, @break=false>], @buffer_width=0, @indent=0, @maxwidth=79, @output_width=2, @output=#<IO:0x8114ee4>>
-#
+#
# pretty-printed output by #pp is:
# #<PP:0x81fedf0
# @buffer=[],
@@ -22,17 +22,17 @@
# @newline="\n",
# @output=#<IO:0x8114ee4>,
# @output_width=2>
-#
+#
# I like the latter. If you do too, this library is for you.
-#
+#
# = Usage
-#
+#
# pp(obj)
#
# output +obj+ to +$>+ in pretty printed format.
-#
+#
# It returns +nil+.
-#
+#
# = Output Customization
# To define your customized pretty printing function for your classes,
# redefine a method #pretty_print(+pp+) in the class.
@@ -67,10 +67,10 @@ end
class PP < PrettyPrint
# Outputs +obj+ to +out+ in pretty printed format of
# +width+ columns in width.
- #
+ #
# If +out+ is omitted, +$>+ is assumed.
# If +width+ is omitted, 79 is assumed.
- #
+ #
# PP.pp returns +out+.
def PP.pp(obj, out=$>, width=79)
q = PP.new(out, width)
@@ -82,7 +82,7 @@ class PP < PrettyPrint
# Outputs +obj+ to +out+ like PP.pp but with no indent and
# newline.
- #
+ #
# PP.singleline_pp returns +out+.
def PP.singleline_pp(obj, out=$>)
q = SingleLine.new(out)
@@ -105,87 +105,59 @@ class PP < PrettyPrint
end
module PPMethods
- def guard_inspect_key
- if Thread.current[:__recursive_key__] == nil
- Thread.current[:__recursive_key__] = {}
- end
+ InspectKey = :__inspect_key__
- if Thread.current[:__recursive_key__][:inspect] == nil
- Thread.current[:__recursive_key__][:inspect] = {}
+ def guard_inspect_key
+ if Thread.current[InspectKey] == nil
+ Thread.current[InspectKey] = []
end
- save = Thread.current[:__recursive_key__][:inspect]
+ save = Thread.current[InspectKey]
begin
- Thread.current[:__recursive_key__][:inspect] = {}
+ Thread.current[InspectKey] = []
yield
ensure
- Thread.current[:__recursive_key__][:inspect] = save
+ Thread.current[InspectKey] = save
end
end
- def check_inspect_key(id)
- Thread.current[:__recursive_key__] &&
- Thread.current[:__recursive_key__][:inspect] &&
- Thread.current[:__recursive_key__][:inspect].include?(id)
- end
- def push_inspect_key(id)
- Thread.current[:__recursive_key__][:inspect][id] = true
- end
- def pop_inspect_key(id)
- Thread.current[:__recursive_key__][:inspect].delete id
- end
-
# Adds +obj+ to the pretty printing buffer
# using Object#pretty_print or Object#pretty_print_cycle.
- #
+ #
# Object#pretty_print_cycle is used when +obj+ is already
# printed, a.k.a the object reference chain has a cycle.
def pp(obj)
- id = obj.object_id
+ id = obj.__id__
- if check_inspect_key(id)
+ if Thread.current[InspectKey].include? id
group {obj.pretty_print_cycle self}
return
end
begin
- push_inspect_key(id)
+ Thread.current[InspectKey] << id
group {obj.pretty_print self}
ensure
- pop_inspect_key(id) unless PP.sharing_detection
+ Thread.current[InspectKey].pop unless PP.sharing_detection
end
end
# A convenience method which is same as follows:
- #
+ #
# group(1, '#<' + obj.class.name, '>') { ... }
def object_group(obj, &block) # :yield:
group(1, '#<' + obj.class.name, '>', &block)
end
- if 0x100000000.class == Bignum
- # 32bit
- PointerMask = 0xffffffff
- else
- # 64bit
- PointerMask = 0xffffffffffffffff
- end
-
- case Object.new.inspect
- when /\A\#<Object:0x([0-9a-f]+)>\z/
- PointerFormat = "%0#{$1.length}x"
- else
- PointerFormat = "%x"
- end
-
def object_address_group(obj, &block)
- id = PointerFormat % (obj.object_id * 2 & PointerMask)
+ id = "%x" % (obj.__id__ * 2)
+ id.sub!(/\Af(?=[[:xdigit:]]{2}+\z)/, '') if id.sub!(/\A\.\./, '')
group(1, "\#<#{obj.class}:0x#{id}", '>', &block)
end
# A convenience method which is same as follows:
- #
+ #
# text ','
# breakable
def comma_breakable
@@ -195,23 +167,23 @@ class PP < PrettyPrint
# Adds a separated list.
# The list is separated by comma with breakable space, by default.
- #
+ #
# #seplist iterates the +list+ using +iter_method+.
# It yields each object to the block given for #seplist.
# The procedure +separator_proc+ is called between each yields.
- #
+ #
# If the iteration is zero times, +separator_proc+ is not called at all.
- #
+ #
# If +separator_proc+ is nil or not given,
# +lambda { comma_breakable }+ is used.
# If +iter_method+ is not given, :each is used.
- #
+ #
# For example, following 3 code fragments has similar effect.
- #
+ #
# q.seplist([1,2,3]) {|v| xxx v }
- #
- # q.seplist([1,2,3], lambda { q.comma_breakable }, :each) {|v| xxx v }
- #
+ #
+ # q.seplist([1,2,3], lambda { comma_breakable }, :each) {|v| xxx v }
+ #
# xxx 1
# q.comma_breakable
# xxx 2
@@ -275,11 +247,11 @@ class PP < PrettyPrint
# A default pretty printing method for general objects.
# It calls #pretty_print_instance_variables to list instance variables.
- #
+ #
# If +self+ has a customized (redefined) #inspect method,
# the result of self.inspect is used but it obviously has no
# line break hints.
- #
+ #
# This module provides predefined #pretty_print methods for some of
# the most commonly used built-in classes for convenience.
def pretty_print(q)
@@ -302,7 +274,7 @@ class PP < PrettyPrint
end
# Returns a sorted array of instance variable names.
- #
+ #
# This method should return an array of names of instance variables as symbols or strings as:
# +[:@a, :@b]+.
def pretty_print_instance_variables
@@ -311,7 +283,7 @@ class PP < PrettyPrint
# Is #inspect implementation using #pretty_print.
# If you implement #pretty_print, it can be used as follows.
- #
+ #
# alias inspect pretty_print_inspect
#
# However, doing this requires that every class that #inspect is called on
@@ -351,17 +323,13 @@ end
class << ENV
def pretty_print(q)
- h = {}
- ENV.keys.sort.each {|k|
- h[k] = ENV[k]
- }
- q.pp_hash h
+ q.pp_hash self
end
end
class Struct
def pretty_print(q)
- q.group(1, sprintf("#<struct %s", PP.mcall(self, Kernel, :class).name), '>') {
+ q.group(1, '#<struct ' + PP.mcall(self, Kernel, :class).name, '>') {
q.seplist(PP.mcall(self, Struct, :members), lambda { q.text "," }) {|member|
q.breakable
q.text member.to_s
@@ -473,24 +441,10 @@ end
class MatchData
def pretty_print(q)
- nc = []
- self.regexp.named_captures.each {|name, indexes|
- indexes.each {|i| nc[i] = name }
- }
q.object_group(self) {
q.breakable
- q.seplist(0...self.size, lambda { q.breakable }) {|i|
- if i == 0
- q.pp self[i]
- else
- if nc[i]
- q.text nc[i]
- else
- q.pp i
- end
- q.text ':'
- q.pp self[i]
- end
+ q.seplist(1..self.size, lambda { q.breakable }) {|i|
+ q.pp self[i-1]
}
}
end
@@ -515,3 +469,186 @@ end
end
}
}
+
+# :enddoc:
+if __FILE__ == $0
+ require 'test/unit'
+
+ class PPTest < Test::Unit::TestCase
+ def test_list0123_12
+ assert_equal("[0, 1, 2, 3]\n", PP.pp([0,1,2,3], '', 12))
+ end
+
+ def test_list0123_11
+ assert_equal("[0,\n 1,\n 2,\n 3]\n", PP.pp([0,1,2,3], '', 11))
+ end
+
+ OverriddenStruct = Struct.new("OverriddenStruct", :members, :class)
+ def test_struct_override_members # [ruby-core:7865]
+ a = OverriddenStruct.new(1,2)
+ assert_equal("#<struct Struct::OverriddenStruct members=1, class=2>\n", PP.pp(a, ''))
+ end
+
+ def test_redefined_method
+ o = ""
+ def o.method
+ end
+ assert_equal(%(""\n), PP.pp(o, ""))
+ end
+ end
+
+ class HasInspect
+ def initialize(a)
+ @a = a
+ end
+
+ def inspect
+ return "<inspect:#{@a.inspect}>"
+ end
+ end
+
+ class HasPrettyPrint
+ def initialize(a)
+ @a = a
+ end
+
+ def pretty_print(q)
+ q.text "<pretty_print:"
+ q.pp @a
+ q.text ">"
+ end
+ end
+
+ class HasBoth
+ def initialize(a)
+ @a = a
+ end
+
+ def inspect
+ return "<inspect:#{@a.inspect}>"
+ end
+
+ def pretty_print(q)
+ q.text "<pretty_print:"
+ q.pp @a
+ q.text ">"
+ end
+ end
+
+ class PrettyPrintInspect < HasPrettyPrint
+ alias inspect pretty_print_inspect
+ end
+
+ class PrettyPrintInspectWithoutPrettyPrint
+ alias inspect pretty_print_inspect
+ end
+
+ class PPInspectTest < Test::Unit::TestCase
+ def test_hasinspect
+ a = HasInspect.new(1)
+ assert_equal("<inspect:1>\n", PP.pp(a, ''))
+ end
+
+ def test_hasprettyprint
+ a = HasPrettyPrint.new(1)
+ assert_equal("<pretty_print:1>\n", PP.pp(a, ''))
+ end
+
+ def test_hasboth
+ a = HasBoth.new(1)
+ assert_equal("<pretty_print:1>\n", PP.pp(a, ''))
+ end
+
+ def test_pretty_print_inspect
+ a = PrettyPrintInspect.new(1)
+ assert_equal("<pretty_print:1>", a.inspect)
+ a = PrettyPrintInspectWithoutPrettyPrint.new
+ assert_raise(RuntimeError) { a.inspect }
+ end
+
+ def test_proc
+ a = proc {1}
+ assert_equal("#{a.inspect}\n", PP.pp(a, ''))
+ end
+
+ def test_to_s_with_iv
+ a = Object.new
+ def a.to_s() "aaa" end
+ a.instance_eval { @a = nil }
+ result = PP.pp(a, '')
+ assert_equal("#{a.inspect}\n", result)
+ assert_match(/\A#<Object.*>\n\z/m, result)
+ a = 1.0
+ a.instance_eval { @a = nil }
+ result = PP.pp(a, '')
+ assert_equal("#{a.inspect}\n", result)
+ end
+
+ def test_to_s_without_iv
+ a = Object.new
+ def a.to_s() "aaa" end
+ result = PP.pp(a, '')
+ assert_equal("#{a.inspect}\n", result)
+ assert_equal("aaa\n", result)
+ end
+ end
+
+ class PPCycleTest < Test::Unit::TestCase
+ def test_array
+ a = []
+ a << a
+ assert_equal("[[...]]\n", PP.pp(a, ''))
+ assert_equal("#{a.inspect}\n", PP.pp(a, ''))
+ end
+
+ def test_hash
+ a = {}
+ a[0] = a
+ assert_equal("{0=>{...}}\n", PP.pp(a, ''))
+ assert_equal("#{a.inspect}\n", PP.pp(a, ''))
+ end
+
+ S = Struct.new("S", :a, :b)
+ def test_struct
+ a = S.new(1,2)
+ a.b = a
+ assert_equal("#<struct Struct::S a=1, b=#<struct Struct::S:...>>\n", PP.pp(a, ''))
+ assert_equal("#{a.inspect}\n", PP.pp(a, ''))
+ end
+
+ def test_object
+ a = Object.new
+ a.instance_eval {@a = a}
+ assert_equal(a.inspect + "\n", PP.pp(a, ''))
+ end
+
+ def test_anonymous
+ a = Class.new.new
+ assert_equal(a.inspect + "\n", PP.pp(a, ''))
+ end
+
+ def test_withinspect
+ a = []
+ a << HasInspect.new(a)
+ assert_equal("[<inspect:[...]>]\n", PP.pp(a, ''))
+ assert_equal("#{a.inspect}\n", PP.pp(a, ''))
+ end
+
+ def test_share_nil
+ begin
+ PP.sharing_detection = true
+ a = [nil, nil]
+ assert_equal("[nil, nil]\n", PP.pp(a, ''))
+ ensure
+ PP.sharing_detection = false
+ end
+ end
+ end
+
+ class PPSingleLineTest < Test::Unit::TestCase
+ def test_hash
+ assert_equal("{1=>1}", PP.singleline_pp({ 1 => 1}, '')) # [ruby-core:02699]
+ assert_equal("[1#{', 1'*99}]", PP.singleline_pp([1]*100, ''))
+ end
+ end
+end
diff --git a/lib/prettyprint.rb b/lib/prettyprint.rb
index 2c1fff3258..315c422e9e 100644
--- a/lib/prettyprint.rb
+++ b/lib/prettyprint.rb
@@ -1,6 +1,8 @@
+# $Id$
+
# This class implements a pretty printing algorithm. It finds line breaks and
# nice indentations for grouped structure.
-#
+#
# By default, the class assumes that primitive elements are strings and each
# byte in the strings have single column in width. But it can be used for
# other situations by giving suitable arguments for some methods:
@@ -16,28 +18,28 @@
# == Bugs
# * Box based formatting?
# * Other (better) model/algorithm?
-#
+#
# == References
# Christian Lindig, Strictly Pretty, March 2000,
# http://www.st.cs.uni-sb.de/~lindig/papers/#pretty
-#
+#
# Philip Wadler, A prettier printer, March 1998,
# http://homepages.inf.ed.ac.uk/wadler/topics/language-design.html#prettier
-#
+#
# == Author
# Tanaka Akira <akr@m17n.org>
-#
+#
class PrettyPrint
# This is a convenience method which is same as follows:
- #
+ #
# begin
# q = PrettyPrint.new(output, maxwidth, newline, &genspace)
# ...
# q.flush
# output
# end
- #
+ #
def PrettyPrint.format(output='', maxwidth=79, newline="\n", genspace=lambda {|n| ' ' * n})
q = PrettyPrint.new(output, maxwidth, newline, &genspace)
yield q
@@ -375,3 +377,520 @@ class PrettyPrint
end
end
end
+
+if __FILE__ == $0
+ require 'test/unit'
+
+ class WadlerExample < Test::Unit::TestCase # :nodoc:
+ def setup
+ @tree = Tree.new("aaaa", Tree.new("bbbbb", Tree.new("ccc"),
+ Tree.new("dd")),
+ Tree.new("eee"),
+ Tree.new("ffff", Tree.new("gg"),
+ Tree.new("hhh"),
+ Tree.new("ii")))
+ end
+
+ def hello(width)
+ PrettyPrint.format('', width) {|hello|
+ hello.group {
+ hello.group {
+ hello.group {
+ hello.group {
+ hello.text 'hello'
+ hello.breakable; hello.text 'a'
+ }
+ hello.breakable; hello.text 'b'
+ }
+ hello.breakable; hello.text 'c'
+ }
+ hello.breakable; hello.text 'd'
+ }
+ }
+ end
+
+ def test_hello_00_06
+ expected = <<'End'.chomp
+hello
+a
+b
+c
+d
+End
+ assert_equal(expected, hello(0))
+ assert_equal(expected, hello(6))
+ end
+
+ def test_hello_07_08
+ expected = <<'End'.chomp
+hello a
+b
+c
+d
+End
+ assert_equal(expected, hello(7))
+ assert_equal(expected, hello(8))
+ end
+
+ def test_hello_09_10
+ expected = <<'End'.chomp
+hello a b
+c
+d
+End
+ out = hello(9); assert_equal(expected, out)
+ out = hello(10); assert_equal(expected, out)
+ end
+
+ def test_hello_11_12
+ expected = <<'End'.chomp
+hello a b c
+d
+End
+ assert_equal(expected, hello(11))
+ assert_equal(expected, hello(12))
+ end
+
+ def test_hello_13
+ expected = <<'End'.chomp
+hello a b c d
+End
+ assert_equal(expected, hello(13))
+ end
+
+ def tree(width)
+ PrettyPrint.format('', width) {|q| @tree.show(q)}
+ end
+
+ def test_tree_00_19
+ expected = <<'End'.chomp
+aaaa[bbbbb[ccc,
+ dd],
+ eee,
+ ffff[gg,
+ hhh,
+ ii]]
+End
+ assert_equal(expected, tree(0))
+ assert_equal(expected, tree(19))
+ end
+
+ def test_tree_20_22
+ expected = <<'End'.chomp
+aaaa[bbbbb[ccc, dd],
+ eee,
+ ffff[gg,
+ hhh,
+ ii]]
+End
+ assert_equal(expected, tree(20))
+ assert_equal(expected, tree(22))
+ end
+
+ def test_tree_23_43
+ expected = <<'End'.chomp
+aaaa[bbbbb[ccc, dd],
+ eee,
+ ffff[gg, hhh, ii]]
+End
+ assert_equal(expected, tree(23))
+ assert_equal(expected, tree(43))
+ end
+
+ def test_tree_44
+ assert_equal(<<'End'.chomp, tree(44))
+aaaa[bbbbb[ccc, dd], eee, ffff[gg, hhh, ii]]
+End
+ end
+
+ def tree_alt(width)
+ PrettyPrint.format('', width) {|q| @tree.altshow(q)}
+ end
+
+ def test_tree_alt_00_18
+ expected = <<'End'.chomp
+aaaa[
+ bbbbb[
+ ccc,
+ dd
+ ],
+ eee,
+ ffff[
+ gg,
+ hhh,
+ ii
+ ]
+]
+End
+ assert_equal(expected, tree_alt(0))
+ assert_equal(expected, tree_alt(18))
+ end
+
+ def test_tree_alt_19_20
+ expected = <<'End'.chomp
+aaaa[
+ bbbbb[ ccc, dd ],
+ eee,
+ ffff[
+ gg,
+ hhh,
+ ii
+ ]
+]
+End
+ assert_equal(expected, tree_alt(19))
+ assert_equal(expected, tree_alt(20))
+ end
+
+ def test_tree_alt_20_49
+ expected = <<'End'.chomp
+aaaa[
+ bbbbb[ ccc, dd ],
+ eee,
+ ffff[ gg, hhh, ii ]
+]
+End
+ assert_equal(expected, tree_alt(21))
+ assert_equal(expected, tree_alt(49))
+ end
+
+ def test_tree_alt_50
+ expected = <<'End'.chomp
+aaaa[ bbbbb[ ccc, dd ], eee, ffff[ gg, hhh, ii ] ]
+End
+ assert_equal(expected, tree_alt(50))
+ end
+
+ class Tree # :nodoc:
+ def initialize(string, *children)
+ @string = string
+ @children = children
+ end
+
+ def show(q)
+ q.group {
+ q.text @string
+ q.nest(@string.length) {
+ unless @children.empty?
+ q.text '['
+ q.nest(1) {
+ first = true
+ @children.each {|t|
+ if first
+ first = false
+ else
+ q.text ','
+ q.breakable
+ end
+ t.show(q)
+ }
+ }
+ q.text ']'
+ end
+ }
+ }
+ end
+
+ def altshow(q)
+ q.group {
+ q.text @string
+ unless @children.empty?
+ q.text '['
+ q.nest(2) {
+ q.breakable
+ first = true
+ @children.each {|t|
+ if first
+ first = false
+ else
+ q.text ','
+ q.breakable
+ end
+ t.altshow(q)
+ }
+ }
+ q.breakable
+ q.text ']'
+ end
+ }
+ end
+
+ end
+ end
+
+ class StrictPrettyExample < Test::Unit::TestCase # :nodoc:
+ def prog(width)
+ PrettyPrint.format('', width) {|q|
+ q.group {
+ q.group {q.nest(2) {
+ q.text "if"; q.breakable;
+ q.group {
+ q.nest(2) {
+ q.group {q.text "a"; q.breakable; q.text "=="}
+ q.breakable; q.text "b"}}}}
+ q.breakable
+ q.group {q.nest(2) {
+ q.text "then"; q.breakable;
+ q.group {
+ q.nest(2) {
+ q.group {q.text "a"; q.breakable; q.text "<<"}
+ q.breakable; q.text "2"}}}}
+ q.breakable
+ q.group {q.nest(2) {
+ q.text "else"; q.breakable;
+ q.group {
+ q.nest(2) {
+ q.group {q.text "a"; q.breakable; q.text "+"}
+ q.breakable; q.text "b"}}}}}
+ }
+ end
+
+ def test_00_04
+ expected = <<'End'.chomp
+if
+ a
+ ==
+ b
+then
+ a
+ <<
+ 2
+else
+ a
+ +
+ b
+End
+ assert_equal(expected, prog(0))
+ assert_equal(expected, prog(4))
+ end
+
+ def test_05
+ expected = <<'End'.chomp
+if
+ a
+ ==
+ b
+then
+ a
+ <<
+ 2
+else
+ a +
+ b
+End
+ assert_equal(expected, prog(5))
+ end
+
+ def test_06
+ expected = <<'End'.chomp
+if
+ a ==
+ b
+then
+ a <<
+ 2
+else
+ a +
+ b
+End
+ assert_equal(expected, prog(6))
+ end
+
+ def test_07
+ expected = <<'End'.chomp
+if
+ a ==
+ b
+then
+ a <<
+ 2
+else
+ a + b
+End
+ assert_equal(expected, prog(7))
+ end
+
+ def test_08
+ expected = <<'End'.chomp
+if
+ a == b
+then
+ a << 2
+else
+ a + b
+End
+ assert_equal(expected, prog(8))
+ end
+
+ def test_09
+ expected = <<'End'.chomp
+if a == b
+then
+ a << 2
+else
+ a + b
+End
+ assert_equal(expected, prog(9))
+ end
+
+ def test_10
+ expected = <<'End'.chomp
+if a == b
+then
+ a << 2
+else a + b
+End
+ assert_equal(expected, prog(10))
+ end
+
+ def test_11_31
+ expected = <<'End'.chomp
+if a == b
+then a << 2
+else a + b
+End
+ assert_equal(expected, prog(11))
+ assert_equal(expected, prog(15))
+ assert_equal(expected, prog(31))
+ end
+
+ def test_32
+ expected = <<'End'.chomp
+if a == b then a << 2 else a + b
+End
+ assert_equal(expected, prog(32))
+ end
+
+ end
+
+ class TailGroup < Test::Unit::TestCase # :nodoc:
+ def test_1
+ out = PrettyPrint.format('', 10) {|q|
+ q.group {
+ q.group {
+ q.text "abc"
+ q.breakable
+ q.text "def"
+ }
+ q.group {
+ q.text "ghi"
+ q.breakable
+ q.text "jkl"
+ }
+ }
+ }
+ assert_equal("abc defghi\njkl", out)
+ end
+ end
+
+ class NonString < Test::Unit::TestCase # :nodoc:
+ def format(width)
+ PrettyPrint.format([], width, 'newline', lambda {|n| "#{n} spaces"}) {|q|
+ q.text(3, 3)
+ q.breakable(1, 1)
+ q.text(3, 3)
+ }
+ end
+
+ def test_6
+ assert_equal([3, "newline", "0 spaces", 3], format(6))
+ end
+
+ def test_7
+ assert_equal([3, 1, 3], format(7))
+ end
+
+ end
+
+ class Fill < Test::Unit::TestCase # :nodoc:
+ def format(width)
+ PrettyPrint.format('', width) {|q|
+ q.group {
+ q.text 'abc'
+ q.fill_breakable
+ q.text 'def'
+ q.fill_breakable
+ q.text 'ghi'
+ q.fill_breakable
+ q.text 'jkl'
+ q.fill_breakable
+ q.text 'mno'
+ q.fill_breakable
+ q.text 'pqr'
+ q.fill_breakable
+ q.text 'stu'
+ }
+ }
+ end
+
+ def test_00_06
+ expected = <<'End'.chomp
+abc
+def
+ghi
+jkl
+mno
+pqr
+stu
+End
+ assert_equal(expected, format(0))
+ assert_equal(expected, format(6))
+ end
+
+ def test_07_10
+ expected = <<'End'.chomp
+abc def
+ghi jkl
+mno pqr
+stu
+End
+ assert_equal(expected, format(7))
+ assert_equal(expected, format(10))
+ end
+
+ def test_11_14
+ expected = <<'End'.chomp
+abc def ghi
+jkl mno pqr
+stu
+End
+ assert_equal(expected, format(11))
+ assert_equal(expected, format(14))
+ end
+
+ def test_15_18
+ expected = <<'End'.chomp
+abc def ghi jkl
+mno pqr stu
+End
+ assert_equal(expected, format(15))
+ assert_equal(expected, format(18))
+ end
+
+ def test_19_22
+ expected = <<'End'.chomp
+abc def ghi jkl mno
+pqr stu
+End
+ assert_equal(expected, format(19))
+ assert_equal(expected, format(22))
+ end
+
+ def test_23_26
+ expected = <<'End'.chomp
+abc def ghi jkl mno pqr
+stu
+End
+ assert_equal(expected, format(23))
+ assert_equal(expected, format(26))
+ end
+
+ def test_27
+ expected = <<'End'.chomp
+abc def ghi jkl mno pqr stu
+End
+ assert_equal(expected, format(27))
+ end
+
+ end
+end
diff --git a/lib/prime.rb b/lib/prime.rb
deleted file mode 100644
index 68253897ca..0000000000
--- a/lib/prime.rb
+++ /dev/null
@@ -1,468 +0,0 @@
-#
-# = prime.rb
-#
-# Prime numbers and factorization library.
-#
-# Copyright::
-# Copyright (c) 1998-2008 Keiju ISHITSUKA(SHL Japan Inc.)
-# Copyright (c) 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-#
-# Documentation::
-# Yuki Sonoda
-#
-
-require "singleton"
-require "forwardable"
-
-class Integer
- # Re-composes a prime factorization and returns the product.
- #
- # See Prime#int_from_prime_division for more details.
- def Integer.from_prime_division(pd)
- Prime.int_from_prime_division(pd)
- end
-
- # Returns the factorization of +self+.
- #
- # See Prime#prime_division for more details.
- def prime_division(generator = Prime::Generator23.new)
- Prime.prime_division(self, generator)
- end
-
- # Returns true if +self+ is a prime number, false for a composite.
- def prime?
- Prime.prime?(self)
- end
-
- # Iterates the given block over all prime numbers.
- #
- # See +Prime+#each for more details.
- def Integer.each_prime(ubound, &block) # :yields: prime
- Prime.each(ubound, &block)
- end
-end
-
-#
-# The set of all prime numbers.
-#
-# == Example
-# Prime.each(100) do |prime|
-# p prime #=> 2, 3, 5, 7, 11, ...., 97
-# 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+.
-#
-# e.g.
-# Prime.instance.prime?(2) #=> true
-# Prime.prime?(2) #=> true
-#
-# == Generators
-# A "generator" provides an implementation of enumerating pseudo-prime
-# numbers and it remembers the position of enumeration and upper bound.
-# Futhermore, it is a external iterator of prime enumeration which is
-# compatible to an Enumerator.
-#
-# +Prime+::+PseudoPrimeGenerator+ is the base class for generators.
-# There are few implementations of generator.
-#
-# [+Prime+::+EratosthenesGenerator+]
-# Uses eratosthenes's sieve.
-# [+Prime+::+TrialDivisionGenerator+]
-# Uses the trial division method.
-# [+Prime+::+Generator23+]
-# Generates all positive integers which is not divided by 2 nor 3.
-# This sequence is very bad as a pseudo-prime sequence. But this
-# is faster and uses much less memory than other generators. So,
-# it is suitable for factorizing an integer which is not large but
-# has many prime factors. e.g. for Prime#prime? .
-class Prime
- include Enumerable
- @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
- end
- end
-
- # Iterates the given block over all prime numbers.
- #
- # == Parameters
- # +ubound+::
- # Optional. An arbitrary positive number.
- # The upper bound of enumeration. The method enumerates
- # prime numbers infinitely if +ubound+ is nil.
- # +generator+::
- # Optional. An implementation of pseudo-prime generator.
- #
- # == Return value
- # An evaluated value of the given block at the last time.
- # Or an enumerator which is compatible to an +Enumerator+
- # if no block given.
- #
- # == Description
- # Calls +block+ once for each prime number, passing the prime as
- # a parameter.
- #
- # +ubound+::
- # Upper bound of prime numbers. The iterator stops after
- # yields all prime numbers p <= +ubound+.
- #
- # == Note
- # +Prime+.+new+ returns a object extended by +Prime+::+OldCompatibility+
- # in order to compatibility to 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)
- end
-
-
- # Returns true if +value+ is prime, false for a composite.
- #
- # == Parameters
- # +value+:: an arbitrary integer to be checked.
- # +generator+:: optional. A pseudo-prime generator.
- def prime?(value, generator = Prime::Generator23.new)
- value = -value if value < 0
- return false if value < 2
- for num in generator
- q,r = value.divmod num
- return true if q < num
- return false if r == 0
- end
- end
-
- # Re-composes a prime factorization and returns the product.
- #
- # == Parameters
- # +pd+:: Array of pairs of integers. The each internal
- # pair consists of a prime number -- a prime factor --
- # and a natural number -- an exponent.
- #
- # == Example
- # For [[p_1, e_1], [p_2, e_2], ...., [p_n, e_n]], it returns
- # p_1**e_1 * p_2**e_2 * .... * p_n**e_n.
- #
- # Prime.int_from_prime_division([[2,2], [3,1]]) #=> 12
- def int_from_prime_division(pd)
- pd.inject(1){|value, (prime, index)|
- value *= prime**index
- }
- end
-
- # Returns the factorization of +value+.
- #
- # == Parameters
- # +value+:: An arbitrary integer.
- # +generator+:: Optional. A pseudo-prime generator.
- # +generator+.succ must return the next
- # pseudo-prime number in the ascendent
- # order. It must generate all prime numbers,
- # but may generate non prime numbers.
- #
- # === Exceptions
- # +ZeroDivisionError+:: when +value+ is zero.
- #
- # == Example
- # For an arbitrary integer
- # n = p_1**e_1 * p_2**e_2 * .... * p_n**e_n,
- # prime_division(n) returns
- # [[p_1, e_1], [p_2, e_2], ...., [p_n, e_n]].
- #
- # Prime.prime_division(12) #=> [[2,2], [3,1]]
- #
- def prime_division(value, generator= Prime::Generator23.new)
- raise ZeroDivisionError if value == 0
- if value < 0
- value = -value
- pv = [[-1, 1]]
- else
- pv = []
- end
- for prime in generator
- count = 0
- while (value1, mod = value.divmod(prime)
- mod) == 0
- value = value1
- count += 1
- end
- if count != 0
- pv.push [prime, count]
- end
- break if value1 <= prime
- end
- if value > 1
- pv.push [value, 1]
- end
- return pv
- end
-
- # An abstract class for enumerating pseudo-prime numbers.
- #
- # Concrete subclasses should override succ, next, rewind.
- class PseudoPrimeGenerator
- include Enumerable
-
- def initialize(ubound = nil)
- @ubound = ubound
- end
-
- def upper_bound=(ubound)
- @ubound = ubound
- end
- def upper_bound
- @ubound
- end
-
- # returns the next pseudo-prime number, and move the internal
- # position forward.
- #
- # +PseudoPrimeGenerator+#succ raises +NotImplementedError+.
- def succ
- raise NotImplementedError, "need to define `succ'"
- end
-
- # alias of +succ+.
- def next
- raise NotImplementedError, "need to define `next'"
- end
-
- # Rewinds the internal position for enumeration.
- #
- # See +Enumerator+#rewind.
- def rewind
- raise NotImplementedError, "need to define `rewind'"
- end
-
- # Iterates the given block for each prime numbers.
- def each(&block)
- return self.dup unless block
- if @ubound
- last_value = nil
- loop do
- prime = succ
- break last_value if prime > @ubound
- last_value = block.call(prime)
- end
- else
- loop do
- block.call(succ)
- end
- end
- end
-
- # see +Enumerator+#with_index.
- alias with_index each_with_index
-
- # see +Enumerator+#with_object.
- def with_object(obj)
- return enum_for(:with_object) unless block_given?
- each do |prime|
- yield prime, obj
- end
- end
- end
-
- # An implementation of +PseudoPrimeGenerator+.
- #
- # Uses +EratosthenesSieve+.
- class EratosthenesGenerator < PseudoPrimeGenerator
- def initialize
- @last_prime = nil
- end
-
- def succ
- @last_prime = @last_prime ? EratosthenesSieve.instance.next_to(@last_prime) : 2
- end
- def rewind
- initialize
- end
- alias next succ
- end
-
- # An implementation of +PseudoPrimeGenerator+ which uses
- # a prime table generated by trial division.
- class TrialDivisionGenerator<PseudoPrimeGenerator
- def initialize
- @index = -1
- end
-
- def succ
- TrialDivision.instance[@index += 1]
- end
- def rewind
- initialize
- end
- alias next succ
- end
-
- # Generates all integer which are greater than 2 and
- # are not divided by 2 nor 3.
- #
- # This is a pseudo-prime generator, suitable on
- # checking primality of a integer by brute force
- # method.
- class Generator23<PseudoPrimeGenerator
- def initialize
- @prime = 1
- @step = nil
- end
-
- def succ
- loop do
- if (@step)
- @prime += @step
- @step = 6 - @step
- else
- case @prime
- when 1; @prime = 2
- when 2; @prime = 3
- when 3; @prime = 5; @step = 2
- end
- end
- return @prime
- end
- end
- alias next succ
- def rewind
- initialize
- end
- end
-
-
-
-
- # Internal use. An implementation of prime table by trial division method.
- class TrialDivision
- include Singleton
-
- def initialize # :nodoc:
- # These are included as class variables to cache them for later uses. If memory
- # usage is a problem, they can be put in Prime#initialize as instance variables.
-
- # There must be no primes between @primes[-1] and @next_to_check.
- @primes = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101]
- # @next_to_check % 6 must be 1.
- @next_to_check = 103 # @primes[-1] - @primes[-1] % 6 + 7
- @ulticheck_index = 3 # @primes.index(@primes.reverse.find {|n|
- # n < Math.sqrt(@@next_to_check) })
- @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.
- def [](index)
- while index >= @primes.length
- # Only check for prime factors up to the square root of the potential primes,
- # but without the performance hit of an actual square root calculation.
- if @next_to_check + 4 > @ulticheck_next_squared
- @ulticheck_index += 1
- @ulticheck_next_squared = @primes.at(@ulticheck_index + 1) ** 2
- end
- # Only check numbers congruent to one and five, modulo six. All others
-
- # are divisible by two or three. This also allows us to skip checking against
- # two and three.
- @primes.push @next_to_check if @primes[2..@ulticheck_index].find {|prime| @next_to_check % prime == 0 }.nil?
- @next_to_check += 4
- @primes.push @next_to_check if @primes[2..@ulticheck_index].find {|prime| @next_to_check % prime == 0 }.nil?
- @next_to_check += 2
- end
- return @primes[index]
- end
- end
-
- # Internal use. An implementation of eratosthenes's sieve
- class EratosthenesSieve
- include Singleton
-
- def initialize # :nodoc:
- # bitmap for odd prime numbers less than 256.
- # For an arbitrary odd number n, @table[i][j] is 1 when n is prime where i,j = n.divmod(32) .
- @table = [0xcb6e, 0x64b4, 0x129a, 0x816d, 0x4c32, 0x864a, 0x820d, 0x2196]
- end
-
- # returns the least odd prime number which is greater than +n+.
- def next_to(n)
- n = (n-1).div(2)*2+3 # the next odd number of given n
- i,j = n.divmod(32)
- loop do
- extend_table until @table.length > i
- if !@table[i].zero?
- (j...32).step(2) do |k|
- return 32*i+k if !@table[i][k.div(2)].zero?
- end
- end
- i += 1; j = 1
- end
- end
-
- private
- def extend_table
- orig_len = @table.length
- new_len = [orig_len**2, orig_len+256].min
- lbound = orig_len*32
- ubound = new_len*32
- @table.fill(0xFFFF, orig_len...new_len)
- (3..Integer(Math.sqrt(ubound))).step(2) do |p|
- i, j = p.divmod(32)
- next if @table[i][j.div(2)].zero?
-
- start = (lbound.div(2*p)*2+1)*p # odd multiple of p which is greater than or equal to lbound
- (start...ubound).step(2*p) do |n|
- i, j = n.divmod(32)
- @table[i] &= 0xFFFF ^ (1<<(j.div(2)))
- end
- end
- end
- end
-
- # Provides a +Prime+ object with compatibility to Ruby 1.8 when instanciated via +Prime+.+new+.
- module OldCompatibility
- # Returns the next prime number and forwards internal pointer.
- def succ
- @generator.succ
- end
- alias next succ
-
- # Overwrites Prime#each.
- #
- # Iterates the given block over all prime numbers. Note that enumeration starts from
- # the current position of internal pointer, not rewound.
- def each(&block)
- return @generator.dup unless block_given?
- loop do
- yield succ
- end
- end
- end
-end
diff --git a/lib/profile.rb b/lib/profile.rb
index 2aeecce908..104cb205b9 100644
--- a/lib/profile.rb
+++ b/lib/profile.rb
@@ -1,9 +1,5 @@
require 'profiler'
-RubyVM::InstructionSequence.compile_option = {
- :trace_instruction => true,
- :specialized_instruction => false
-}
END {
Profiler__::print_profile(STDERR)
}
diff --git a/lib/profiler.rb b/lib/profiler.rb
index a4b8889093..9762fa1181 100644
--- a/lib/profiler.rb
+++ b/lib/profiler.rb
@@ -34,7 +34,7 @@ module_function
total = Process.times[0] - @@start
if total == 0 then total = 0.01 end
data = @@map.values
- data = data.sort_by{|x| -x[2]}
+ data.sort!{|a,b| b[2] <=> a[2]}
sum = 0
f.printf " %% cumulative self self total\n"
f.printf " time seconds seconds calls ms/call ms/call name\n"
diff --git a/lib/pstore.rb b/lib/pstore.rb
index 0d635c4ac2..ab495d9ed7 100644
--- a/lib/pstore.rb
+++ b/lib/pstore.rb
@@ -3,61 +3,59 @@
# pstore.rb -
# originally by matz
# documentation by Kev Jackson and James Edward Gray II
-# improved by Hongli Lai
#
# See PStore for documentation.
require "fileutils"
require "digest/md5"
-require "thread"
#
# PStore implements a file based persistence mechanism based on a Hash. User
# code can store hierarchies of Ruby objects (values) into the data store file
-# by name (keys). An object hierarchy may be just a single object. User code
+# by name (keys). An object hierarchy may be just a single object. User code
# may later read values back from the data store or even update data, as needed.
-#
+#
# The transactional behavior ensures that any changes succeed or fail together.
# This can be used to ensure that the data store is not left in a transitory
# state, where some values were updated but others were not.
-#
-# Behind the scenes, Ruby objects are stored to the data store file with
-# Marshal. That carries the usual limitations. Proc objects cannot be
+#
+# Behind the scenes, Ruby objects are stored to the data store file with
+# Marshal. That carries the usual limitations. Proc objects cannot be
# marshalled, for example.
#
# == Usage example:
-#
+#
# require "pstore"
-#
+#
# # a mock wiki object...
# class WikiPage
# def initialize( page_name, author, contents )
# @page_name = page_name
# @revisions = Array.new
-#
+#
# add_revision(author, contents)
# end
-#
+#
# attr_reader :page_name
-#
+#
# def add_revision( author, contents )
# @revisions << { :created => Time.now,
# :author => author,
# :contents => contents }
# end
-#
+#
# def wiki_page_references
# [@page_name] + @revisions.last[:contents].scan(/\b(?:[A-Z]+[a-z]+){2,}/)
# end
-#
+#
# # ...
# end
-#
+#
# # create a new page...
# home_page = WikiPage.new( "HomePage", "James Edward Gray II",
# "A page about the JoysOfDocumentation..." )
-#
+#
# # then we want to update page data and the index together, or not at all...
# wiki = PStore.new("wiki_pages.pstore")
# wiki.transaction do # begin transaction; do all of this or none of it
@@ -68,9 +66,9 @@ require "thread"
# # update wiki index...
# wiki[:wiki_index].push(*home_page.wiki_page_references)
# end # commit changes to wiki data store file
-#
+#
# ### Some time later... ###
-#
+#
# # read wiki data...
# wiki.transaction(true) do # begin read-only transaction, no changes allowed
# wiki.roots.each do |data_root_name|
@@ -79,20 +77,6 @@ require "thread"
# end
# end
#
-# == Transaction modes
-#
-# By default, file integrity is only ensured as long as the operating system
-# (and the underlying hardware) doesn't raise any unexpected I/O errors. If an
-# I/O error occurs while PStore is writing to its file, then the file will
-# become corrupted.
-#
-# You can prevent this by setting <em>pstore.ultra_safe = true</em>.
-# However, this results in a minor performance loss, and only works on platforms
-# that support atomic file renames. Please consult the documentation for
-# +ultra_safe+ for details.
-#
-# Needless to say, if you're storing valuable data with PStore, then you should
-# backup the PStore files from time to time.
class PStore
binmode = defined?(File::BINARY) ? File::BINARY : 0
RDWR_ACCESS = File::RDWR | File::CREAT | binmode
@@ -103,23 +87,11 @@ class PStore
class Error < StandardError
end
- # Whether PStore should do its best to prevent file corruptions, even when under
- # unlikely-to-occur error conditions such as out-of-space conditions and other
- # unusual OS filesystem errors. Setting this flag comes at the price in the form
- # of a performance loss.
- #
- # This flag only has effect on platforms on which file renames are atomic (e.g.
- # all POSIX platforms: Linux, MacOS X, FreeBSD, etc). The default value is false.
- attr_accessor :ultra_safe
-
- #
- # To construct a PStore object, pass in the _file_ path where you would like
+ #
+ # To construct a PStore object, pass in the _file_ path where you would like
# the data to be stored.
- #
- # PStore objects are always reentrant. But if _thread_safe_ is set to true,
- # then it will become thread-safe at the cost of a minor performance hit.
- #
- def initialize(file, thread_safe = false)
+ #
+ def initialize(file)
dir = File::dirname(file)
unless File::directory? dir
raise PStore::Error, format("directory %s does not exist", dir)
@@ -130,22 +102,16 @@ class PStore
@transaction = false
@filename = file
@abort = false
- @ultra_safe = false
- if @thread_safe
- @lock = Mutex.new
- else
- @lock = DummyMutex.new
- end
end
# Raises PStore::Error if the calling code is not in a PStore#transaction.
def in_transaction
raise PStore::Error, "not in transaction" unless @transaction
end
- #
+ #
# Raises PStore::Error if the calling code is not in a PStore#transaction or
# if the code is in a read-only PStore#transaction.
- #
+ #
def in_transaction_wr()
in_transaction()
raise PStore::Error, "in read-only transaction" if @rdonly
@@ -153,9 +119,9 @@ class PStore
private :in_transaction, :in_transaction_wr
#
- # Retrieves a value from the PStore file data, by _name_. The hierarchy of
+ # Retrieves a value from the PStore file data, by _name_. The hierarchy of
# Ruby objects stored under that root _name_ will be returned.
- #
+ #
# *WARNING*: This method is only valid in a PStore#transaction. It will
# raise PStore::Error if called at any other time.
#
@@ -164,22 +130,22 @@ class PStore
@table[name]
end
#
- # This method is just like PStore#[], save that you may also provide a
- # _default_ value for the object. In the event the specified _name_ is not
- # found in the data store, your _default_ will be returned instead. If you do
- # not specify a default, PStore::Error will be raised if the object is not
+ # This method is just like PStore#[], save that you may also provide a
+ # _default_ value for the object. In the event the specified _name_ is not
+ # found in the data store, your _default_ will be returned instead. If you do
+ # not specify a default, PStore::Error will be raised if the object is not
# found.
- #
+ #
# *WARNING*: This method is only valid in a PStore#transaction. It will
# raise PStore::Error if called at any other time.
#
def fetch(name, default=PStore::Error)
in_transaction
unless @table.key? name
- if default == PStore::Error
- raise PStore::Error, format("undefined root name `%s'", name)
+ if default==PStore::Error
+ raise PStore::Error, format("undefined root name `%s'", name)
else
- return default
+ return default
end
end
@table[name]
@@ -188,11 +154,11 @@ class PStore
# Stores an individual Ruby object or a hierarchy of Ruby objects in the data
# store file under the root _name_. Assigning to a _name_ already in the data
# store clobbers the old data.
- #
+ #
# == Example:
- #
+ #
# require "pstore"
- #
+ #
# store = PStore.new("data_file.pstore")
# store.transaction do # begin transaction
# # load some data into the store...
@@ -200,7 +166,7 @@ class PStore
# store[:obj_heirarchy] = { "Kev Jackson" => ["rational.rb", "pstore.rb"],
# "James Gray" => ["erb.rb", "pstore.rb"] }
# end # commit changes to data store file
- #
+ #
# *WARNING*: This method is only valid in a PStore#transaction and it cannot
# be read-only. It will raise PStore::Error if called at any other time.
#
@@ -210,7 +176,7 @@ class PStore
end
#
# Removes an object hierarchy from the data store, by _name_.
- #
+ #
# *WARNING*: This method is only valid in a PStore#transaction and it cannot
# be read-only. It will raise PStore::Error if called at any other time.
#
@@ -221,7 +187,7 @@ class PStore
#
# Returns the names of all object hierarchies currently in the store.
- #
+ #
# *WARNING*: This method is only valid in a PStore#transaction. It will
# raise PStore::Error if called at any other time.
#
@@ -231,7 +197,7 @@ class PStore
end
#
# Returns true if the supplied _name_ is currently in the data store.
- #
+ #
# *WARNING*: This method is only valid in a PStore#transaction. It will
# raise PStore::Error if called at any other time.
#
@@ -247,22 +213,22 @@ class PStore
#
# Ends the current PStore#transaction, committing any changes to the data
# store immediately.
- #
+ #
# == Example:
- #
+ #
# require "pstore"
- #
+ #
# store = PStore.new("data_file.pstore")
# store.transaction do # begin transaction
# # load some data into the store...
# store[:one] = 1
# store[:two] = 2
- #
+ #
# store.commit # end transaction here, committing changes
- #
+ #
# store[:three] = 3 # this change is never reached
# end
- #
+ #
# *WARNING*: This method is only valid in a PStore#transaction. It will
# raise PStore::Error if called at any other time.
#
@@ -274,21 +240,21 @@ class PStore
#
# Ends the current PStore#transaction, discarding any changes to the data
# store.
- #
+ #
# == Example:
- #
+ #
# require "pstore"
- #
+ #
# store = PStore.new("data_file.pstore")
# store.transaction do # begin transaction
# store[:one] = 1 # this change is not applied, see below...
# store[:two] = 2 # this change is not applied, see below...
- #
+ #
# store.abort # end transaction here, discard all changes
- #
+ #
# store[:three] = 3 # this change is never reached
# end
- #
+ #
# *WARNING*: This method is only valid in a PStore#transaction. It will
# raise PStore::Error if called at any other time.
#
@@ -300,223 +266,109 @@ class PStore
#
# Opens a new transaction for the data store. Code executed inside a block
- # passed to this method may read and write data to and from the data store
+ # passed to this method may read and write data to and from the data store
# file.
- #
+ #
# At the end of the block, changes are committed to the data store
- # automatically. You may exit the transaction early with a call to either
+ # automatically. You may exit the transaction early with a call to either
# PStore#commit or PStore#abort. See those methods for details about how
- # changes are handled. Raising an uncaught Exception in the block is
+ # changes are handled. Raising an uncaught Exception in the block is
# equivalent to calling PStore#abort.
- #
+ #
# If _read_only_ is set to +true+, you will only be allowed to read from the
# data store during the transaction and any attempts to change the data will
# raise a PStore::Error.
- #
+ #
# Note that PStore does not support nested transactions.
#
- def transaction(read_only = false, &block) # :yields: pstore
- value = nil
+ def transaction(read_only=false) # :yields: pstore
raise PStore::Error, "nested transaction" if @transaction
- @lock.synchronize do
+ begin
@rdonly = read_only
- @transaction = true
@abort = false
- file = open_and_lock_file(@filename, read_only)
- if file
- begin
- @table, checksum, original_data_size = load_data(file, read_only)
-
- catch(:pstore_abort_transaction) do
- value = yield(self)
- end
-
- if !@abort && !read_only
- save_data(checksum, original_data_size, file)
- end
- ensure
- file.close if !file.closed?
- end
+ @transaction = true
+ value = nil
+ new_file = @filename + ".new"
+
+ content = nil
+ unless read_only
+ file = File.open(@filename, RDWR_ACCESS)
+ file.flock(File::LOCK_EX)
+ commit_new(file) if FileTest.exist?(new_file)
+ content = file.read()
else
- # This can only occur if read_only == true.
- @table = {}
- catch(:pstore_abort_transaction) do
- value = yield(self)
- end
- end
- end
- value
- ensure
- @transaction = false
- end
-
- private
- # Constant for relieving Ruby's garbage collector.
- EMPTY_STRING = ""
- EMPTY_MARSHAL_DATA = Marshal.dump({})
- EMPTY_MARSHAL_CHECKSUM = Digest::MD5.digest(EMPTY_MARSHAL_DATA)
-
- class DummyMutex
- def synchronize
- yield
- end
- end
-
- #
- # Open the specified filename (either in read-only mode or in
- # read-write mode) and lock it for reading or writing.
- #
- # The opened File object will be returned. If _read_only_ is true,
- # and the file does not exist, then nil will be returned.
- #
- # All exceptions are propagated.
- #
- def open_and_lock_file(filename, read_only)
- if read_only
- begin
- file = File.new(filename, RD_ACCESS)
begin
+ file = File.open(@filename, RD_ACCESS)
file.flock(File::LOCK_SH)
- return file
- rescue
- file.close
- raise
+ content = (File.open(new_file, RD_ACCESS) {|n| n.read} rescue file.read())
+ rescue Errno::ENOENT
+ content = ""
end
- rescue Errno::ENOENT
- return nil
end
- else
- file = File.new(filename, RDWR_ACCESS)
- file.flock(File::LOCK_EX)
- return file
- end
- end
- # 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, an MD5 checksum of the data, and the size of the data.
- def load_data(file, read_only)
- if read_only
- begin
- table = load(file)
- if !table.is_a?(Hash)
- raise Error, "PStore file seems to be corrupted."
+ if content != ""
+ @table = load(content)
+ if !read_only
+ size = content.size
+ md5 = Digest::MD5.digest(content)
end
- rescue EOFError
- # This seems to be a newly-created file.
- table = {}
- end
- table
- else
- data = file.read
- if data.empty?
- # This seems to be a newly-created file.
- table = {}
- checksum = empty_marshal_checksum
- size = empty_marshal_data.size
else
- table = load(data)
- checksum = Digest::MD5.digest(data)
- size = data.size
- if !table.is_a?(Hash)
- raise Error, "PStore file seems to be corrupted."
- end
+ @table = {}
end
- data.replace(EMPTY_STRING)
- [table, checksum, size]
- end
- end
+ content = nil # unreference huge data
- def on_windows?
- is_windows = RUBY_PLATFORM =~ /mswin/ ||
- RUBY_PLATFORM =~ /mingw/ ||
- RUBY_PLATFORM =~ /bccwin/ ||
- RUBY_PLATFORM =~ /wince/
- self.class.__send__(:define_method, :on_windows?) do
- is_windows
- end
- is_windows
- end
-
- # Check whether Marshal.dump supports the 'canonical' option. This option
- # makes sure that Marshal.dump always dumps data structures in the same order.
- # This is important because otherwise, the checksums that we generate may differ.
- def marshal_dump_supports_canonical_option?
- begin
- Marshal.dump(nil, -1, true)
- result = true
- rescue
- result = false
- end
- self.class.__send__(:define_method, :marshal_dump_supports_canonical_option?) do
- result
- end
- result
- end
-
- def save_data(original_checksum, original_file_size, file)
- # We only want to save the new data if the size or checksum has changed.
- # This results in less filesystem calls, which is good for performance.
- if marshal_dump_supports_canonical_option?
- new_data = Marshal.dump(@table, -1, true)
- else
- new_data = dump(@table)
- end
- new_checksum = Digest::MD5.digest(new_data)
-
- if new_data.size != original_file_size || new_checksum != original_checksum
- if @ultra_safe && !on_windows?
- # Windows doesn't support atomic file renames.
- save_data_with_atomic_file_rename_strategy(new_data, file)
- else
- save_data_with_fast_strategy(new_data, file)
+ begin
+ catch(:pstore_abort_transaction) do
+ value = yield(self)
+ end
+ rescue Exception
+ @abort = true
+ raise
+ ensure
+ if !read_only and !@abort
+ tmp_file = @filename + ".tmp"
+ content = dump(@table)
+ if !md5 || size != content.size || md5 != Digest::MD5.digest(content)
+ File.open(tmp_file, WR_ACCESS) {|t| t.write(content)}
+ File.rename(tmp_file, new_file)
+ commit_new(file)
+ end
+ content = nil # unreference huge data
+ end
end
- end
-
- new_data.replace(EMPTY_STRING)
- end
-
- 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)
- begin
- temp_file.flock(File::LOCK_EX)
- temp_file.write(data)
- temp_file.flush
- File.rename(temp_filename, @filename)
- rescue
- File.unlink(temp_file) rescue nil
- raise
ensure
- temp_file.close
+ @table = nil
+ @transaction = false
+ file.close if file
end
+ value
end
- def save_data_with_fast_strategy(data, file)
- file.rewind
- file.truncate(0)
- file.write(data)
- end
-
-
- # This method is just a wrapped around Marshal.dump
- # to allow subclass overriding used in YAML::Store.
+ # This method is just a wrapped around Marshal.dump.
def dump(table) # :nodoc:
Marshal::dump(table)
end
# This method is just a wrapped around Marshal.load.
- # to allow subclass overriding used in YAML::Store.
def load(content) # :nodoc:
Marshal::load(content)
end
- def empty_marshal_data
- EMPTY_MARSHAL_DATA
+ # This method is just a wrapped around Marshal.load.
+ def load_file(file) # :nodoc:
+ Marshal::load(file)
end
- def empty_marshal_checksum
- EMPTY_MARSHAL_CHECKSUM
+
+ private
+ # Commits changes to the data store file.
+ def commit_new(f)
+ f.truncate(0)
+ f.rewind
+ new_file = @filename + ".new"
+ File.open(new_file, RD_ACCESS) do |nf|
+ FileUtils.copy_stream(nf, f)
+ end
+ File.unlink(new_file)
end
end
diff --git a/lib/racc/parser.rb b/lib/racc/parser.rb
index fc9b390d59..a7408dd00a 100644
--- a/lib/racc/parser.rb
+++ b/lib/racc/parser.rb
@@ -159,6 +159,7 @@ module Racc
reduce_n, use_result, * = arg
_racc_init_sysvars
+ tok = nil
act = nil
i = nil
nerr = 0
@@ -188,7 +189,7 @@ module Racc
;
end
- while not(i = action_pointer[@racc_state[-1]]) or
+ while not (i = action_pointer[@racc_state[-1]]) or
not @racc_read_next or
@racc_t == 0 # $
unless i and i += @racc_t and
@@ -388,7 +389,7 @@ module Racc
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/rake.rb b/lib/rake.rb
deleted file mode 100644
index c288e80b00..0000000000
--- a/lib/rake.rb
+++ /dev/null
@@ -1,2471 +0,0 @@
-#--
-
-# Copyright 2003, 2004, 2005, 2006, 2007, 2008 by Jim Weirich (jim@weirichhouse.org)
-#
-# 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.
-#++
-#
-# = Rake -- Ruby Make
-#
-# This is the main file for the Rake application. Normally it is referenced
-# as a library via a require statement, but it can be distributed
-# independently as an application.
-
-RAKEVERSION = '0.8.4'
-
-require 'rbconfig'
-require 'fileutils'
-require 'singleton'
-require 'monitor'
-require 'optparse'
-require 'ostruct'
-
-require 'rake/win32'
-
-######################################################################
-# Rake extensions to Module.
-#
-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)
- if method_defined?(method)
- $stderr.puts "WARNING: Possible conflict with Rake extension: #{self}##{method} already exists"
- else
- yield
- end
- end
-end # module Module
-
-
-######################################################################
-# User defined methods to be added to String.
-#
-class String
- rake_extension("ext") do
- # Replace the file extension with +newext+. If there is no extension on
- # the string, append the new extension to the end. If the new extension
- # is not given, or is the empty string, remove any existing extension.
- #
- # +ext+ is a user added method for the String class.
- def ext(newext='')
- return self.dup if ['.', '..'].include? self
- if newext != ''
- newext = (newext =~ /^\./) ? newext : ("." + newext)
- end
- self.chomp(File.extname(self)) << newext
- end
- end
-
- rake_extension("pathmap") do
- # Explode a path into individual components. Used by +pathmap+.
- 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.
- 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
-
- # Preform the pathmap replacement operations on the given path. The
- # patterns take the form 'pat1,rep1;pat2,rep2...'.
- 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:
- #
- # * <b>%p</b> -- The complete path.
- # * <b>%f</b> -- The base file name of the path, with its file extension,
- # but without any directories.
- # * <b>%n</b> -- The file name of the path without its file extension.
- # * <b>%d</b> -- The directory list of the path.
- # * <b>%x</b> -- The file extension of the path. An empty string if there
- # is no extension.
- # * <b>%X</b> -- Everything *but* the file extension.
- # * <b>%s</b> -- The alternate file separater if defined, otherwise use
- # the standard file separator.
- # * <b>%%</b> -- A percent sign.
- #
- # The %d 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 %d, %p, %f, %n, %x, and %X operators can take a
- # pattern/replacement argument to perform simple string substititions on a
- # particular part of the path. The pattern and replacement are speparated
- # 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"). Muliple 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,bin}X.class")
- #
- # returns:
- #
- # "bin/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"
- #
- 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, '.*')
- 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 # class String
-
-##############################################################################
-module Rake
-
- # Errors -----------------------------------------------------------
-
- # Error indicating an ill-formed task declaration.
- class TaskArgumentError < ArgumentError
- end
-
- # 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
-
- # --------------------------------------------------------------------------
- # Rake module singleton methods.
- #
- class << self
- # Current Rake Application
- def application
- @application ||= Rake::Application.new
- end
-
- # Set the current Rake application object.
- def application=(app)
- @application = app
- end
-
- # Return the original directory where the Rake application was started.
- def original_dir
- application.original_dir
- end
-
- end
-
- # ##########################################################################
- # Mixin for creating easily cloned objects.
- #
- module Cloneable
- # Clone an object by making a new object and setting all the instance
- # variables to the same values.
- def dup
- sibling = self.class.new
- instance_variables.each do |ivar|
- value = self.instance_variable_get(ivar)
- new_value = value.clone rescue value
- sibling.instance_variable_set(ivar, new_value)
- end
- sibling.taint if tainted?
- sibling
- end
-
- def clone
- sibling = dup
- sibling.freeze if frozen?
- sibling
- end
- end
-
- ####################################################################
- # TaskAguments manage the arguments passed to a task.
- #
- class TaskArguments
- include Enumerable
-
- attr_reader :names
-
- # Create a TaskArgument object with a list of named arguments
- # (given by :names) and a set of associated values (given by
- # :values). :parent is the parent argument object.
- def initialize(names, values, parent=nil)
- @names = names
- @parent = parent
- @hash = {}
- names.each_with_index { |name, i|
- @hash[name.to_sym] = values[i] unless values[i].nil?
- }
- end
-
- # Create a new argument scope using the prerequisite argument
- # names.
- def new_scope(names)
- values = names.collect { |n| self[n] }
- self.class.new(names, values, 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
-
- def each(&block)
- @hash.each(&block)
- end
-
- def method_missing(sym, *args, &block)
- lookup(sym.to_sym)
- end
-
- def to_hash
- @hash
- end
-
- def to_s
- @hash.inspect
- end
-
- def inspect
- to_s
- end
-
- protected
-
- def lookup(name)
- if @hash.has_key?(name)
- @hash[name]
- elsif ENV.has_key?(name.to_s)
- ENV[name.to_s]
- elsif ENV.has_key?(name.to_s.upcase)
- ENV[name.to_s.upcase]
- elsif @parent
- @parent.lookup(name)
- end
- end
- end
-
- EMPTY_TASK_ARGS = TaskArguments.new([], [])
-
- ####################################################################
- # InvocationChain tracks the chain of task invocations to detect
- # circular dependencies.
- class InvocationChain
- def initialize(value, tail)
- @value = value
- @tail = tail
- end
-
- def member?(obj)
- @value == obj || @tail.member?(obj)
- end
-
- def append(value)
- if member?(value)
- fail RuntimeError, "Circular dependency detected: #{to_s} => #{value}"
- end
- self.class.new(value, self)
- end
-
- def to_s
- "#{prefix}#{@value}"
- end
-
- def self.append(value, chain)
- chain.append(value)
- end
-
- private
-
- def prefix
- "#{@tail.to_s} => "
- end
-
- class EmptyInvocationChain
- def member?(obj)
- false
- end
- def append(value)
- InvocationChain.new(value, self)
- end
- def to_s
- "TOP"
- end
- end
-
- EMPTY = EmptyInvocationChain.new
-
- end # class InvocationChain
-
-end # module Rake
-
-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
-
- # Comment for this task. Restricted to a single line of no more than 50
- # characters.
- attr_reader :comment
-
- # Full text of the (possibly multi-line) comment.
- attr_reader :full_comment
-
- # Array of nested namespaces names used for task lookup by this task.
- attr_reader :scope
-
- # Return task name
- def to_s
- name
- end
-
- def inspect
- "<#{self.class} #{name} => [#{prerequisites.join(', ')}]>"
- end
-
- # List of sources for task.
- attr_writer :sources
- def sources
- @sources ||= []
- end
-
- # First source from a rule (nil if no sources)
- def source
- @sources.first if defined?(@sources)
- 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
- @full_comment = nil
- @comment = nil
- @lock = Monitor.new
- @application = app
- @scope = app.current_scope
- @arg_names = nil
- 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
- 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
-
- # Invoke the task if it is needed. Prerequites 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
- puts "** 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
- end
- protected :invoke_with_call_chain
-
- # Invoke all the prerequisites of a task.
- def invoke_prerequisites(task_args, invocation_chain) # :nodoc:
- @prerequisites.each { |n|
- prereq = application[n, @scope]
- prereq_args = task_args.new_scope(prereq.arg_names)
- prereq.invoke_with_call_chain(prereq_args, invocation_chain)
- }
- 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
- puts "** Execute (dry run) #{name}"
- return
- end
- if application.options.trace
- puts "** Execute #{name}"
- end
- 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
- @prerequisites.collect { |p| application[p].timestamp }.max || 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 if ! description
- comment = description.strip
- add_comment(comment) if comment && ! comment.empty?
- end
-
- # Writing to the comment attribute is the same as adding a description.
- def comment=(description)
- add_description(description)
- end
-
- # Add a comment to the task. If a comment alread exists, separate
- # the new comment with " / ".
- def add_comment(comment)
- if @full_comment
- @full_comment << " / "
- else
- @full_comment = ''
- end
- @full_comment << comment
- if @full_comment =~ /\A([^.]+?\.)( |$)/
- @comment = $1
- else
- @comment = @full_comment
- end
- end
- private :add_comment
-
- # 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 = @prerequisites.collect {|name| application[name]}
- prereqs.sort! {|a,b| a.timestamp <=> b.timestamp}
- prereqs.each do |p|
- result << "--#{p.name} (#{p.timestamp})\n"
- end
- latest_prereq = @prerequisites.collect{|n| application[n].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(':')
- end
-
- end # class << Rake::Task
- end # class Rake::Task
-
-
- # #########################################################################
- # 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)
- end
-
- # Time stamp for file task.
- def timestamp
- if File.exist?(name)
- File.mtime(name.to_s)
- else
- Rake::EARLY
- end
- end
-
- private
-
- # Are there any prerequisites with a later time than the given time stamp?
- def out_of_date?(stamp)
- @prerequisites.any? { |n| application[n].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)
- task_name
- end
- end
- end # class Rake::FileTask
-
- # #########################################################################
- # 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
-
- # #########################################################################
- # Same as a regular task, but the immediate prerequisites are done in
- # parallel using Ruby threads.
- #
- class MultiTask < Task
- private
- def invoke_prerequisites(args, invocation_chain)
- threads = @prerequisites.collect { |p|
- Thread.new(p) { |r| application[r].invoke_with_call_chain(args, invocation_chain) }
- }
- threads.each { |t| t.join }
- end
- end
-end # module Rake
-
-# ###########################################################################
-# Task Definition Functions ...
-
-# Declare a basic task.
-#
-# Example:
-# task :clobber => [:clean] do
-# rm_rf "html"
-# end
-#
-def task(*args, &block)
- 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)
- 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(dir)
- Rake.each_dir_parent(dir) do |d|
- file_create d do |t|
- mkdir_p t.name if ! File.exist?(t.name)
- end
- end
-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 => [:deploy_gem, :deploy_rdoc]
-#
-def multitask(args, &block)
- 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.
-#
-# E.g.
-#
-# ns = namespace "nested" do
-# task :run
-# end
-# task_run = ns[:run] # find :run in the given namespace.
-#
-def namespace(name=nil, &block)
- 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)
- Rake::Task.create_rule(*args, &block)
-end
-
-# Describe the next rake task.
-#
-# Example:
-# desc "Run the Unit Tests"
-# task :test => [:build]
-# runtests
-# end
-#
-def desc(description)
- 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)
- fns.each do |fn|
- Rake.application.add_import(fn)
- end
-end
-
-# ###########################################################################
-# This a FileUtils extension that defines several additional commands to be
-# added to the FileUtils utility functions.
-#
-module FileUtils
- RUBY = File.join(RbConfig::CONFIG['bindir'], RbConfig::CONFIG['ruby_install_name']).
- 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 not run with the shell (same semantics as Kernel::exec and
- # Kernel::system).
- #
- # Example:
- # 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 : {}
- unless block_given?
- show_command = cmd.join(" ")
- show_command = show_command[0,42] + "..."
- # TODO code application logic heref show_command.length > 45
- block = lambda { |ok, status|
- ok or fail "Command failed with status (#{status.exitstatus}): [#{show_command}]"
- }
- end
- if RakeFileUtils.verbose_flag == :default
- options[:verbose] = true
- else
- options[:verbose] ||= RakeFileUtils.verbose_flag
- end
- options[:noop] ||= RakeFileUtils.nowrite_flag
- rake_check_options options, :noop, :verbose
- rake_output_message cmd.join(" ") if options[:verbose]
- unless options[:noop]
- res = rake_system(*cmd)
- block.call(res, $?)
- end
- end
-
- def rake_system(*cmd)
- 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 then
- 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)
- unless LN_SUPPORTED[0]
- cp(*args)
- else
- begin
- ln(*args)
- rescue StandardError, NotImplementedError => ex
- 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
-
-# ###########################################################################
-# RakeFileUtils provides a custom version of the FileUtils methods that
-# respond to the <tt>verbose</tt> and <tt>nowrite</tt> commands.
-#
-module RakeFileUtils
- include FileUtils
-
- class << self
- attr_accessor :verbose_flag, :nowrite_flag
- end
- RakeFileUtils.verbose_flag = :default
- RakeFileUtils.nowrite_flag = false
-
- $fileutils_verbose = true
- $fileutils_nowrite = false
-
- FileUtils::OPT_TABLE.each do |name, opts|
- default_options = []
- if opts.include?(:verbose) || opts.include?("verbose")
- default_options << ':verbose => RakeFileUtils.verbose_flag'
- end
- if opts.include?(:noop) || opts.include?("noop")
- default_options << ':noop => RakeFileUtils.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 = RakeFileUtils.verbose_flag
- RakeFileUtils.verbose_flag = value unless value.nil?
- if block_given?
- begin
- yield
- ensure
- RakeFileUtils.verbose_flag = oldvalue
- end
- end
- RakeFileUtils.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 = RakeFileUtils.nowrite_flag
- RakeFileUtils.nowrite_flag = value unless value.nil?
- if block_given?
- begin
- yield
- ensure
- RakeFileUtils.nowrite_flag = oldvalue
- end
- end
- oldvalue
- end
-
- # Use this function to prevent protentially 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 RakeFileUtils.nowrite_flag
- 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
- private :rake_merge_option
-
- # Send the message to the default rake output (which is $stderr).
- def rake_output_message(message)
- $stderr.puts(message)
- end
- private :rake_output_message
-
- # 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
- private :rake_check_options
-
- extend self
-end
-
-# ###########################################################################
-# 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 RakeFileUtils
-private(*FileUtils.instance_methods(false))
-private(*RakeFileUtils.instance_methods(false))
-
-######################################################################
-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[to_a 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).collect{ |s| s.to_s }.sort.uniq
-
- # Now do the delegation.
- DELEGATING_METHODS.each_with_index do |sym, i|
- if SPECIAL_RETURN.include?(sym)
- class_eval <<-END, __FILE__, __LINE__+1
- def #{sym}(*args, &block)
- resolve
- result = @items.send(:#{sym}, *args, &block)
- FileList.new.import(result)
- end
- END
- else
- class_eval <<-END, __FILE__, __LINE__+1
- def #{sym}(*args, &block)
- resolve
- result = @items.send(:#{sym}, *args, &block)
- result.object_id == @items.object_id ? self : result
- end
- END
- 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
- @exclude_re = nil
- @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 << 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 << pat
- end
- if block_given?
- @exclude_procs << block
- end
- resolve_exclude if ! @pending
- self
- end
-
-
- # Clear all the exclude patterns so that we exclude nothing.
- def clear_exclude
- @exclude_patterns = []
- @exclude_procs = []
- calculate_exclude_regexp if ! @pending
- self
- end
-
- # Define 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
-
- # 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 calculate_exclude_regexp
- ignores = []
- @exclude_patterns.each do |pat|
- case pat
- when Regexp
- ignores << pat
- when /[*?]/
- Dir[pat].each do |p| ignores << p end
- else
- ignores << Regexp.quote(pat)
- end
- end
- if ignores.empty?
- @exclude_re = /^$/
- else
- re_str = ignores.collect { |p| "(" + p.to_s + ")" }.join("|")
- @exclude_re = Regexp.new(re_str)
- end
- end
-
- def resolve_add(fn)
- case fn
- when %r{[*?\[\{]}
- add_matching(fn)
- else
- self << fn
- end
- end
- private :resolve_add
-
- def resolve_exclude
- calculate_exclude_regexp
- reject! { |fn| exclude?(fn) }
- self
- end
- private :resolve_exclude
-
- # Return a new FileList with the results of running +sub+ against each
- # element of the oringal 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 oringal 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 file list 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 emac style file:linenumber:line message will be printed to
- # standard out.
- def egrep(pattern, *opt)
- each do |fn|
- open(fn, "rb", *opt) do |inf|
- count = 0
- inf.each do |line|
- count += 1
- if pattern.match(line)
- if block_given?
- yield fn, count, line
- else
- puts "#{fn}:#{count}:#{line}"
- end
- end
- end
- end
- end
- 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)
- Dir[pattern].each do |fn|
- self << fn unless exclude?(fn)
- end
- end
- private :add_matching
-
- # Should the given file name be excluded?
- def exclude?(fn)
- calculate_exclude_regexp unless @exclude_re
- fn =~ @exclude_re || @exclude_procs.any? { |p| p.call(fn) }
- end
-
- DEFAULT_IGNORE_PATTERNS = [
- /(^|[\/\\])CVS([\/\\]|$)/,
- /(^|[\/\\])\.svn([\/\\]|$)/,
- /\.bak$/,
- /~$/
- ]
- DEFAULT_IGNORE_PROCS = [
- proc { |fn| fn =~ /(^|[\/\\])core$/ && ! File.directory?(fn) }
- ]
-# @exclude_patterns = DEFAULT_IGNORE_PATTERNS.dup
-
- def import(array)
- @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
- end
- end # FileList
-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
- end
-end # module Rake
-
-# Alias FileList to be available at the top level.
-FileList = Rake::FileList
-
-# ###########################################################################
-module Rake
-
- # Default Rakefile loader used by +import+.
- class DefaultLoader
- def load(fn)
- Kernel.load(File.expand_path(fn))
- end
- end
-
- # EarlyTime is a fake timestamp that occurs _before_ any other time value.
- class EarlyTime
- include Comparable
- include Singleton
-
- def <=>(other)
- -1
- end
-
- def to_s
- "<EARLY TIME>"
- end
- end
-
- EARLY = EarlyTime.instance
-end # module Rake
-
-# ###########################################################################
-# Extensions to time to allow comparisons with an early time class.
-#
-class Time
- alias rake_original_time_compare :<=>
- def <=>(other)
- if Rake::EarlyTime === other
- - other.<=>(self)
- else
- rake_original_time_compare(other)
- end
- end
-end # class Time
-
-module Rake
-
- ####################################################################
- # The NameSpace class will lookup task names in the the scope
- # defined by a +namespace+ command.
- #
- class 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
-
- # Return the list of tasks defined in this and nested namespaces.
- def tasks
- @task_manager.tasks_in_scope(@scope)
- end
- end # NameSpace
-
-
- ####################################################################
- # The TaskManager module is a mixin for managing tasks.
- module TaskManager
- # Track the last comment made in the Rakefile.
- attr_accessor :last_description
- alias :last_comment :last_description # Backwards compatibility
-
- def initialize
- super
- @tasks = Hash.new
- @rules = Array.new
- @scope = Array.new
- @last_description = nil
- end
-
- def create_rule(*args, &block)
- pattern, arg_names, deps = resolve_args(args)
- pattern = Regexp.new(Regexp.quote(pattern) + '$') if String === pattern
- @rules << [pattern, deps, block]
- end
-
- def define_task(task_class, *args, &block)
- task_name, arg_names, deps = resolve_args(args)
- task_name = task_class.scope_name(@scope, task_name)
- deps = [deps] unless deps.respond_to?(:to_ary)
- deps = deps.collect {|d| d.to_s }
- task = intern(task_class, task_name)
- task.set_arg_names(arg_names) unless arg_names.empty?
- task.add_description(@last_description)
- @last_description = nil
- task.enhance(deps, &block)
- task
- 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)
- 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]
- # task :t, :a (deprecated)
- #
- 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]
- # task :t, :needs => [:d] (deprecated)
- # task :t, :a, :needs => [:d] (deprecated)
- #
- 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
- elsif key == :needs
- task_name = args.shift
- arg_names = args
- 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, extensions, block|
- if md = pattern.match(task_name)
- task = attempt_rule(task_name, 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.join(":")
- 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 = []
- task_name = task_name.sub(/^rake:/, '')
- elsif task_name =~ /^(\^+)/
- scopes = initial_scope[0, initial_scope.size - $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)
- n = scope.size
- while n >= 0
- tn = (scope[0,n] + [name]).join(':')
- task = @tasks[tn]
- return task if task
- n -= 1
- end
- nil
- end
- private :lookup_in_scope
-
- # Return the list of scope names currently active in the task
- # manager.
- def current_scope
- @scope.dup
- 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.push(name)
- ns = NameSpace.new(self, @scope)
- yield(ns)
- ns
- ensure
- @scope.pop
- end
-
- private
-
- # Generate an anonymous namespace name.
- def generate_name
- @seed ||= 0
- @seed += 1
- "_anon_#{@seed}"
- end
-
- def trace_rule(level, message)
- 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, extensions, block, level)
- sources = make_sources(task_name, extensions)
- prereqs = sources.collect { |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 => 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)
- extensions.collect { |ext|
- case ext
- when /%/
- task_name.pathmap(ext)
- when %r{/}
- ext
- when /^\./
- task_name.ext(ext)
- when String
- ext
- when Proc
- 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
- }.flatten
- end
-
- end # TaskManager
-
- ######################################################################
- # Rake main application object. When invoking +rake+ from the
- # command line, a Rake::Application object is created and run.
- #
- class Application
- include TaskManager
-
- # 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
-
- # 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?
- 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 (+run_tasks+).
- #
- # If you wish to build a custom rake command, you should call +init+ on your
- # application. The define any tasks. Finally, call +top_level+ to run your top
- # level tasks.
- def run
- standard_exception_handling do
- init
- load_rakefile
- top_level
- end
- end
-
- # Initialize the command line parameters and app name.
- def init(app_name='rake')
- standard_exception_handling do
- @name = app_name
- handle_options
- collect_tasks
- end
- end
-
- # Find the rakefile and then load it and any pending imports.
- def load_rakefile
- standard_exception_handling do
- raw_load_rakefile
- end
- end
-
- # Run the top level tasks of a Rake application.
- def top_level
- standard_exception_handling 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
-
- # 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
-
- # private ----------------------------------------------------------------
-
- def invoke_task(task_string)
- name, args = parse_task_string(task_string)
- t = self[name]
- t.invoke(*args)
- end
-
- def parse_task_string(string)
- if string =~ /^([^\[]+)(\[(.*)\])$/
- name = $1
- args = $3.split(/\s*,\s*/)
- else
- name = string
- args = []
- end
- [name, args]
- end
-
- # Provide standard execption handling for the given block.
- def standard_exception_handling
- begin
- yield
- rescue SystemExit => ex
- # Exit silently with current status
- raise
- rescue OptionParser::InvalidOption => ex
- # Exit silently
- exit(false)
- rescue Exception => ex
- # Exit with error message
- $stderr.puts "#{name} aborted!"
- $stderr.puts ex.message
- if options.trace
- $stderr.puts ex.backtrace.join("\n")
- else
- $stderr.puts ex.backtrace.find {|str| str =~ /#{@rakefile}/ } || ""
- $stderr.puts "(See full trace by running task with --trace)"
- end
- exit(false)
- end
- end
-
- # 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
- @rakefiles.each do |fn|
- if File.exist?(fn)
- others = Dir.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?
- @tty_output
- end
-
- # Override the detected TTY output state (mostly for testing)
- def tty_output=( tty_output_state )
- @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?
- tty_output? || ENV['RAKE_COLUMNS']
- end
-
- # Display the tasks and comments.
- def display_tasks_and_comments
- displayable_tasks = tasks.select { |t|
- t.comment && t.name =~ options.show_task_pattern
- }
- if options.full_description
- displayable_tasks.each do |t|
- puts "#{name} #{t.name_with_args}"
- t.full_comment.split("\n").each do |line|
- puts " #{line}"
- end
- puts
- end
- else
- width = displayable_tasks.collect { |t| t.name_with_args.length }.max || 10
- max_column = truncate_output? ? terminal_width - name.size - width - 7 : nil
- 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
- end
- end
-
- def terminal_width
- if ENV['RAKE_COLUMNS']
- result = ENV['RAKE_COLUMNS'].to_i
- else
- result = unix? ? dynamic_width : 80
- end
- (result < 10) ? 80 : result
- rescue
- 80
- end
-
- # Calculate the dynamic width of the
- def dynamic_width
- @dynamic_width ||= (dynamic_width_stty.nonzero? || dynamic_width_tput)
- end
-
- def dynamic_width_stty
- %x{stty size 2>/dev/null}.split[1].to_i
- end
-
- def dynamic_width_tput
- %x{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 windows?
- Win32.windows?
- end
-
- def truncate(string, width)
- if string.length <= width
- string
- else
- ( string[0, width-3] || "" ) + "..."
- end
- end
-
- # Display the tasks and prerequisites
- def display_prerequisites
- tasks.each do |t|
- puts "#{name} #{t.name}"
- t.prerequisites.each { |pre| puts " #{pre}" }
- end
- end
-
- # A list of all the standard options used in rake, suitable for
- # passing to OptionParser.
- def standard_rake_options
- [
- ['--classic-namespace', '-C', "Put Task and FileTask in the top level namespace",
- lambda { |value|
- require 'rake/classic_namespace'
- options.classic_namespace = true
- }
- ],
- ['--describe', '-D [PATTERN]', "Describe the tasks (matching optional PATTERN), then exit.",
- lambda { |value|
- options.show_tasks = true
- options.full_description = true
- options.show_task_pattern = Regexp.new(value || '')
- }
- ],
- ['--dry-run', '-n', "Do a dry run without executing actions.",
- lambda { |value|
- verbose(true)
- nowrite(true)
- options.dryrun = true
- options.trace = true
- }
- ],
- ['--execute', '-e CODE', "Execute some Ruby code and exit.",
- lambda { |value|
- eval(value)
- exit
- }
- ],
- ['--execute-print', '-p CODE', "Execute some Ruby code, print the result, then exit.",
- lambda { |value|
- puts eval(value)
- exit
- }
- ],
- ['--execute-continue', '-E CODE',
- "Execute some Ruby code, then continue with normal task processing.",
- lambda { |value| eval(value) }
- ],
- ['--libdir', '-I LIBDIR', "Include LIBDIR in the search path for required modules.",
- lambda { |value| $:.push(value) }
- ],
- ['--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| verbose(false) }
- ],
- ['--rakefile', '-f [FILE]', "Use FILE as the rakefile.",
- lambda { |value|
- value ||= ''
- @rakefiles.clear
- @rakefiles << value
- }
- ],
- ['--rakelibdir', '--rakelib', '-R RAKELIBDIR',
- "Auto-import any .rake files in RAKELIBDIR. (default is 'rakelib')",
- lambda { |value| options.rakelib = value.split(':') }
- ],
- ['--require', '-r MODULE', "Require MODULE before executing rakefile.",
- lambda { |value|
- begin
- require value
- rescue LoadError => ex
- begin
- rake_require value
- rescue LoadError => ex2
- raise ex
- end
- end
- }
- ],
- ['--rules', "Trace the rules resolution.",
- lambda { |value| options.trace_rules = true }
- ],
- ['--no-search', '--nosearch', '-N', "Do not search parent directories for the Rakefile.",
- lambda { |value| options.nosearch = true }
- ],
- ['--silent', '-s', "Like --quiet, but also suppresses the 'in directory' announcement.",
- lambda { |value|
- verbose(false)
- options.silent = true
- }
- ],
- ['--system', '-g',
- "Using system wide (global) rakefiles (usually '~/.rake/*.rake').",
- lambda { |value| options.load_system = true }
- ],
- ['--no-system', '--nosystem', '-G',
- "Use standard project Rakefile search paths, ignore system wide rakefiles.",
- lambda { |value| options.ignore_system = true }
- ],
- ['--tasks', '-T [PATTERN]', "Display the tasks (matching optional PATTERN) with descriptions, then exit.",
- lambda { |value|
- options.show_tasks = true
- options.show_task_pattern = Regexp.new(value || '')
- options.full_description = false
- }
- ],
- ['--trace', '-t', "Turn on invoke/execute tracing, enable full backtrace.",
- lambda { |value|
- options.trace = true
- verbose(true)
- }
- ],
- ['--verbose', '-v', "Log message to standard output.",
- lambda { |value| verbose(true) }
- ],
- ['--version', '-V', "Display the program version.",
- lambda { |value|
- puts "rake, version #{RAKEVERSION}"
- exit
- }
- ]
- ]
- end
-
- # Read and handle the command line options.
- def handle_options
- options.rakelib = ['rakelib']
-
- OptionParser.new do |opts|
- opts.banner = "rake [-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) }
- end.parse!
-
- # If class namespaces are requested, set the global options
- # according to the values in the options structure.
- if options.classic_namespace
- $show_tasks = options.show_tasks
- $show_prereqs = options.show_prereqs
- $trace = options.trace
- $dryrun = options.dryrun
- $silent = options.silent
- end
- 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=$")
- return false if loaded.include?(file_name)
- paths.each do |path|
- fn = file_name + ".rake"
- full_path = File.join(path, fn)
- if File.exist?(full_path)
- load full_path
- loaded << fn
- return true
- end
- end
- fail LoadError, "Can't find #{file_name}"
- end
-
- def find_rakefile_location
- here = Dir.pwd
- while ! (fn = have_rakefile)
- Dir.chdir("..")
- if Dir.pwd == here || options.nosearch
- return nil
- end
- here = Dir.pwd
- end
- [fn, here]
- ensure
- Dir.chdir(Rake.original_dir)
- 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)
- puts "(in #{Dir.pwd})" unless options.silent
- 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)
- puts "(in #{Dir.pwd})" unless options.silent
- $rakefile = @rakefile if options.classic_namespace
- load 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)
- Dir[path.gsub("\\", '/')].each(&block)
- end
- private :glob
-
- # The directory path containing the system wide rakefiles.
- def system_dir
- @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.expand_path('.rake', '~')
- end
- end
- private :standard_system_dir
-
- # Collect the list of tasks on the command line. If no tasks are
- # given, return a list containing only the default task.
- # Environmental assignments are processed at this time as well.
- def collect_tasks
- @top_level_tasks = []
- ARGV.each do |arg|
- if arg =~ /^(\w+)=(.*)$/
- ENV[$1] = $2
- else
- @top_level_tasks << arg unless arg =~ /^-/
- end
- end
- @top_level_tasks.push("default") if @top_level_tasks.size == 0
- end
-
- # Add a file to the list of files to be imported.
- def add_import(fn)
- @pending_imports << fn
- end
-
- # Load the pending list of imported files.
- def load_imports
- while fn = @pending_imports.shift
- next if @imported.member?(fn)
- if fn_task = lookup(fn)
- fn_task.invoke
- end
- ext = File.extname(fn)
- loader = @loaders[ext] || @default_loader
- loader.load(fn)
- @imported << fn
- end
- end
-
- # Warn about deprecated use of top level constant names.
- def const_warning(const_name)
- @const_warning ||= false
- if ! @const_warning
- $stderr.puts %{WARNING: Deprecated reference to top-level constant '#{const_name}' } +
- %{found at: #{rakefile_location}} # '
- $stderr.puts %{ Use --classic-namespace on rake command}
- $stderr.puts %{ or 'require "rake/classic_namespace"' in Rakefile}
- end
- @const_warning = true
- end
-
- def rakefile_location
- begin
- fail
- rescue RuntimeError => ex
- ex.backtrace.find {|str| str =~ /#{@rakefile}/ } || ""
- end
- end
- end
-end
-
-
-class Module
- # Rename the original handler to make it available.
- alias :rake_original_const_missing :const_missing
-
- # Check for deprecated uses of top level (i.e. in Object) uses of
- # Rake class names. If someone tries to reference the constant
- # name, display a warning and return the proper object. Using the
- # --classic-namespace command line option will define these
- # constants in Object and avoid this handler.
- def const_missing(const_name)
- case const_name
- when :Task
- Rake.application.const_warning(const_name)
- Rake::Task
- when :FileTask
- Rake.application.const_warning(const_name)
- Rake::FileTask
- when :FileCreationTask
- Rake.application.const_warning(const_name)
- Rake::FileCreationTask
- when :RakeApp
- Rake.application.const_warning(const_name)
- Rake::Application
- else
- rake_original_const_missing(const_name)
- end
- end
-end
diff --git a/lib/rake/classic_namespace.rb b/lib/rake/classic_namespace.rb
deleted file mode 100644
index feb7569966..0000000000
--- a/lib/rake/classic_namespace.rb
+++ /dev/null
@@ -1,8 +0,0 @@
-# The following classes used to be in the top level namespace.
-# Loading this file enables compatibility with older Rakefile that
-# referenced Task from the top level.
-
-Task = Rake::Task
-FileTask = Rake::FileTask
-FileCreationTask = Rake::FileCreationTask
-RakeApp = Rake::Application
diff --git a/lib/rake/clean.rb b/lib/rake/clean.rb
deleted file mode 100644
index 62f27d5751..0000000000
--- a/lib/rake/clean.rb
+++ /dev/null
@@ -1,31 +0,0 @@
-# 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'
-
-CLEAN = Rake::FileList["**/*~", "**/*.bak", "**/core"]
-CLEAN.clear_exclude.exclude { |fn|
- fn.pathmap("%f") == 'core' && File.directory?(fn)
-}
-
-desc "Remove any temporary products."
-task :clean do
- CLEAN.each { |fn| rm_r fn rescue nil }
-end
-
-CLOBBER = Rake::FileList.new
-
-desc "Remove any generated file."
-task :clobber => [:clean] do
- CLOBBER.each { |fn| rm_r fn rescue nil }
-end
diff --git a/lib/rake/gempackagetask.rb b/lib/rake/gempackagetask.rb
deleted file mode 100644
index 3a99ff2b87..0000000000
--- a/lib/rake/gempackagetask.rb
+++ /dev/null
@@ -1,95 +0,0 @@
-# Define a package task library to aid in the definition of GEM
-# packages.
-
-require 'rubygems'
-require 'rake'
-require 'rake/packagetask'
-require 'rubygems/user_interaction'
-require 'rubygems/builder'
-
-module Rake
-
- # Create a package based upon a Gem spec. Gem packages, as well as
- # zip files and tar/gzipped packages can be produced by this task.
- #
- # In addition to the Rake targets generated by PackageTask, a
- # GemPackageTask will also generate the following tasks:
- #
- # [<b>"<em>package_dir</em>/<em>name</em>-<em>version</em>.gem"</b>]
- # Create a Ruby GEM package with the given name and version.
- #
- # Example using a Ruby GEM spec:
- #
- # require 'rubygems'
- #
- # spec = Gem::Specification.new do |s|
- # s.platform = Gem::Platform::RUBY
- # s.summary = "Ruby based make-like utility."
- # s.name = 'rake'
- # s.version = PKG_VERSION
- # s.requirements << 'none'
- # s.require_path = 'lib'
- # s.autorequire = 'rake'
- # s.files = PKG_FILES
- # s.description = <<EOF
- # Rake is a Make-like program implemented in Ruby. Tasks
- # and dependencies are specified in standard Ruby syntax.
- # EOF
- # end
- #
- # Rake::GemPackageTask.new(spec) do |pkg|
- # pkg.need_zip = true
- # pkg.need_tar = true
- # end
- #
- class GemPackageTask < PackageTask
- # Ruby GEM spec containing the metadata for this package. The
- # name, version and package_files are automatically determined
- # from the GEM spec and don't need to be explicitly provided.
- attr_accessor :gem_spec
-
- # Create a GEM Package task library. Automatically define the gem
- # if a block is given. If no block is supplied, then +define+
- # needs to be called to define the task.
- def initialize(gem_spec)
- init(gem_spec)
- yield self if block_given?
- define if block_given?
- end
-
- # Initialization tasks without the "yield self" or define
- # operations.
- def init(gem)
- super(gem.name, gem.version)
- @gem_spec = gem
- @package_files += gem_spec.files if gem_spec.files
- end
-
- # Create the Rake tasks and actions specified by this
- # GemPackageTask. (+define+ is automatically called if a block is
- # given to +new+).
- def define
- super
- task :package => [:gem]
- desc "Build the gem file #{gem_file}"
- task :gem => ["#{package_dir}/#{gem_file}"]
- file "#{package_dir}/#{gem_file}" => [package_dir] + @gem_spec.files do
- when_writing("Creating GEM") {
- Gem::Builder.new(gem_spec).build
- verbose(true) {
- mv gem_file, "#{package_dir}/#{gem_file}"
- }
- }
- end
- end
-
- def gem_file
- if @gem_spec.platform == Gem::Platform::RUBY
- "#{package_name}.gem"
- else
- "#{package_name}-#{@gem_spec.platform}.gem"
- end
- end
-
- end
-end
diff --git a/lib/rake/loaders/makefile.rb b/lib/rake/loaders/makefile.rb
deleted file mode 100644
index c77d428596..0000000000
--- a/lib/rake/loaders/makefile.rb
+++ /dev/null
@@ -1,38 +0,0 @@
-module Rake
-
- # Makefile loader to be used with the import file loader.
- class MakefileLoader
- SPACE_MARK = "\0"
-
- # Load the makefile dependencies in +fn+.
- def load(fn)
- lines = open(fn) {|mf| mf.read}
- 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
- 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/packagetask.rb b/lib/rake/packagetask.rb
deleted file mode 100644
index de14fc77d8..0000000000
--- a/lib/rake/packagetask.rb
+++ /dev/null
@@ -1,182 +0,0 @@
-# Define a package task libarary 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:
- #
- # [<b>:package</b>]
- # Create all the requested package files.
- #
- # [<b>:clobber_package</b>]
- # Delete all the package files. This target is automatically
- # added to the main clobber target.
- #
- # [<b>:repackage</b>]
- # Rebuild the package files from scratch, even if they are not out
- # of date.
- #
- # [<b>"<em>package_dir</em>/<em>name</em>-<em>version</em>.tgz"</b>]
- # Create a gzipped tar package (if <em>need_tar</em> is true).
- #
- # [<b>"<em>package_dir</em>/<em>name</em>-<em>version</em>.tar.gz"</b>]
- # Create a gzipped tar package (if <em>need_tar_gz</em> is true).
- #
- # [<b>"<em>package_dir</em>/<em>name</em>-<em>version</em>.tar.bz2"</b>]
- # Create a bzip2'd tar package (if <em>need_tar_bz2</em> is true).
- #
- # [<b>"<em>package_dir</em>/<em>name</em>-<em>version</em>.zip"</b>]
- # 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.
- def initialize(name=nil, version=nil)
- init(name, version)
- yield self if block_given?
- define unless name.nil?
- end
-
- # Initialization that bypasses the "yield self" and "define" step.
- def init(name, version)
- @name = name
- @version = version
- @package_files = Rake::FileList.new
- @package_dir = 'pkg'
- @need_tar = false
- @need_tar_gz = false
- @need_tar_bz2 = false
- @need_zip = false
- @tar_command = 'tar'
- @zip_command = 'zip'
- end
-
- # Create the tasks defined by this task library.
- def define
- fail "Version required (or :noversion)" if @version.nil?
- @version = nil if :noversion == @version
-
- desc "Build all the packages"
- task :package
-
- desc "Force a rebuild of the package files"
- task :repackage => [:clobber_package, :package]
-
- desc "Remove package products"
- task :clobber_package do
- rm_r package_dir rescue nil
- end
-
- task :clobber => [:clobber_package]
-
- [
- [need_tar, tgz_file, "z"],
- [need_tar_gz, tar_gz_file, "z"],
- [need_tar_bz2, tar_bz2_file, "j"]
- ].each do |(need, file, flag)|
- if need
- task :package => ["#{package_dir}/#{file}"]
- file "#{package_dir}/#{file}" => [package_dir_path] + package_files do
- chdir(package_dir) do
- sh %{#{@tar_command} #{flag}cvf #{file} #{package_name}}
- end
- end
- end
- end
-
- if need_zip
- task :package => ["#{package_dir}/#{zip_file}"]
- file "#{package_dir}/#{zip_file}" => [package_dir_path] + package_files do
- chdir(package_dir) do
- sh %{#{@zip_command} -r #{zip_file} #{package_name}}
- end
- end
- end
-
- directory package_dir
-
- file package_dir_path => @package_files do
- mkdir_p package_dir rescue nil
- @package_files.each do |fn|
- f = File.join(package_dir_path, fn)
- fdir = File.dirname(f)
- mkdir_p(fdir) if !File.exist?(fdir)
- if File.directory?(fn)
- mkdir_p(f)
- else
- rm_f f
- safe_ln(fn, f)
- end
- end
- end
- self
- end
-
- def package_name
- @version ? "#{@name}-#{@version}" : @name
- end
-
- def package_dir_path
- "#{package_dir}/#{package_name}"
- end
-
- def tgz_file
- "#{package_name}.tgz"
- end
-
- def tar_gz_file
- "#{package_name}.tar.gz"
- end
-
- def tar_bz2_file
- "#{package_name}.tar.bz2"
- end
-
- def zip_file
- "#{package_name}.zip"
- end
- end
-
-end
diff --git a/lib/rake/rake_test_loader.rb b/lib/rake/rake_test_loader.rb
deleted file mode 100644
index 8d7dad3c94..0000000000
--- a/lib/rake/rake_test_loader.rb
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/usr/bin/env ruby
-
-# Load the test files from the command line.
-
-ARGV.each { |f| load f unless f =~ /^-/ }
diff --git a/lib/rake/rdoctask.rb b/lib/rake/rdoctask.rb
deleted file mode 100644
index de020f4d87..0000000000
--- a/lib/rake/rdoctask.rb
+++ /dev/null
@@ -1,207 +0,0 @@
-require 'rake'
-require 'rake/tasklib'
-
-module Rake
-
- # Create a documentation task that will generate the RDoc files for
- # a project.
- #
- # The RDocTask will create the following targets:
- #
- # [<b>:<em>rdoc</em></b>]
- # Main task for this RDOC task.
- #
- # [<b>:clobber_<em>rdoc</em></b>]
- # Delete all the rdoc files. This target is automatically
- # added to the main clobber target.
- #
- # [<b>:re<em>rdoc</em></b>]
- # Rebuild the rdoc files from scratch, even if they are not out
- # of date.
- #
- # Simple example:
- #
- # Rake::RDocTask.new do |rd|
- # rd.main = "README.rdoc"
- # rd.rdoc_files.include("README.rdoc", "lib/**/*.rb")
- # end
- #
- # The +rd+ object passed to the block is an RDocTask object. See the
- # attributes list for the RDocTask class for available customization options.
- #
- # == Specifying different task names
- #
- # You may wish to give the task a different name, such as if you are
- # generating two sets of documentation. For instance, if you want to have a
- # development set of documentation including private methods:
- #
- # Rake::RDocTask.new(:rdoc_dev) do |rd|
- # rd.main = "README.doc"
- # rd.rdoc_files.include("README.rdoc", "lib/**/*.rb")
- # rd.options << "--all"
- # end
- #
- # The tasks would then be named :<em>rdoc_dev</em>, :clobber_<em>rdoc_dev</em>, and
- # :re<em>rdoc_dev</em>.
- #
- # If you wish to have completely different task names, then pass a Hash as
- # first argument. With the <tt>:rdoc</tt>, <tt>:clobber_rdoc</tt> and
- # <tt>:rerdoc</tt> options, you can customize the task names to your liking.
- # For example:
- #
- # Rake::RDocTask.new(:rdoc => "rdoc", :clobber_rdoc => "rdoc:clean", :rerdoc => "rdoc:force")
- #
- # This will create the tasks <tt>:rdoc</tt>, <tt>:rdoc_clean</tt> and
- # <tt>:rdoc:force</tt>.
- #
- class RDocTask < TaskLib
- # Name of the main, top level task. (default is :rdoc)
- attr_accessor :name
-
- # Name of directory to receive the html output files. (default is "html")
- attr_accessor :rdoc_dir
-
- # Title of RDoc documentation. (defaults to rdoc's default)
- attr_accessor :title
-
- # Name of file to be used as the main, top level file of the
- # RDoc. (default is none)
- attr_accessor :main
-
- # Name of template to be used by rdoc. (defaults to rdoc's default)
- attr_accessor :template
-
- # List of files to be included in the rdoc generation. (default is [])
- attr_accessor :rdoc_files
-
- # Additional list of options to be passed rdoc. (default is [])
- attr_accessor :options
-
- # Whether to run the rdoc process as an external shell (default is false)
- attr_accessor :external
-
- attr_accessor :inline_source
-
- # Create an RDoc task with the given name. See the RDocTask class overview
- # for documentation.
- def initialize(name = :rdoc) # :yield: self
- if name.is_a?(Hash)
- invalid_options = name.keys.map { |k| k.to_sym } - [:rdoc, :clobber_rdoc, :rerdoc]
- if !invalid_options.empty?
- raise ArgumentError, "Invalid option(s) passed to RDocTask.new: #{invalid_options.join(", ")}"
- end
- end
-
- @name = name
- @rdoc_files = Rake::FileList.new
- @rdoc_dir = 'html'
- @main = nil
- @title = nil
- @template = nil
- @external = false
- @inline_source = true
- @options = []
- yield self if block_given?
- define
- end
-
- # Create the tasks defined by this task lib.
- def define
- if rdoc_task_name != "rdoc"
- desc "Build the RDOC HTML Files"
- else
- desc "Build the #{rdoc_task_name} HTML Files"
- end
- task rdoc_task_name
-
- desc "Force a rebuild of the RDOC files"
- task rerdoc_task_name => [clobber_task_name, rdoc_task_name]
-
- desc "Remove rdoc products"
- task clobber_task_name do
- rm_r rdoc_dir rescue nil
- end
-
- task :clobber => [clobber_task_name]
-
- directory @rdoc_dir
- task rdoc_task_name => [rdoc_target]
- file rdoc_target => @rdoc_files + [Rake.application.rakefile] do
- rm_r @rdoc_dir rescue nil
- @before_running_rdoc.call if @before_running_rdoc
- args = option_list + @rdoc_files
- if @external
- argstring = args.join(' ')
- sh %{ruby -Ivendor vender/rd #{argstring}}
- else
- require 'rdoc/rdoc'
- RDoc::RDoc.new.document(args)
- end
- end
- self
- end
-
- def option_list
- result = @options.dup
- result << "-o" << @rdoc_dir
- result << "--main" << quote(main) if main
- result << "--title" << quote(title) if title
- result << "-T" << quote(template) if template
- result << "--inline-source" if inline_source && !@options.include?("--inline-source") && !@options.include?("-S")
- result
- end
-
- def quote(str)
- if @external
- "'#{str}'"
- else
- str
- end
- end
-
- def option_string
- option_list.join(' ')
- end
-
- # The block passed to this method will be called just before running the
- # RDoc generator. It is allowed to modify RDocTask attributes inside the
- # block.
- def before_running_rdoc(&block)
- @before_running_rdoc = block
- end
-
- private
-
- def rdoc_target
- "#{rdoc_dir}/index.html"
- end
-
- def rdoc_task_name
- case name
- when Hash
- (name[:rdoc] || "rdoc").to_s
- else
- name.to_s
- end
- end
-
- def clobber_task_name
- case name
- when Hash
- (name[:clobber_rdoc] || "clobber_rdoc").to_s
- else
- "clobber_#{name}"
- end
- end
-
- def rerdoc_task_name
- case name
- when Hash
- (name[:rerdoc] || "rerdoc").to_s
- else
- "re#{name}"
- end
- end
-
- end
-end
diff --git a/lib/rake/runtest.rb b/lib/rake/runtest.rb
deleted file mode 100644
index f6928d57b8..0000000000
--- a/lib/rake/runtest.rb
+++ /dev/null
@@ -1,21 +0,0 @@
-require 'test/unit'
-require 'test/unit/assertions'
-
-module Rake
- include Test::Unit::Assertions
-
- def run_tests(pattern='test/test*.rb', log_enabled=false)
- Dir["#{pattern}"].each { |fn|
- puts fn if log_enabled
- begin
- load fn
- rescue Exception => ex
- puts "Error in #{fn}: #{ex.message}"
- puts ex.backtrace
- assert false
- end
- }
- end
-
- extend self
-end
diff --git a/lib/rake/tasklib.rb b/lib/rake/tasklib.rb
deleted file mode 100644
index a5a4494369..0000000000
--- a/lib/rake/tasklib.rb
+++ /dev/null
@@ -1,21 +0,0 @@
-require 'rake'
-
-module Rake
-
- # Base class for Task Libraries.
- class TaskLib
- include Cloneable
-
- # 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.
- 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
deleted file mode 100644
index 3444012500..0000000000
--- a/lib/rake/testtask.rb
+++ /dev/null
@@ -1,159 +0,0 @@
-# Define a task library for running unit tests.
-
-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
-
- # 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 = []
- 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
- lib_path = @libs.collect {|path| "-I#{File.expand_path(path)}"}
- desc "Run tests" + (@name==:test ? "" : " for #{@name}")
- task @name do
- run_code = ''
- RakeFileUtils.verbose(@verbose) do
- run_code =
- case @loader
- when :direct
- "-e 'ARGV.each{|f| load f}'"
- when :testrb
- "-S testrb #{fix}"
- when :rake
- rake_loader
- end
- @ruby_opts.unshift( *lib_path )
- @ruby_opts.unshift( "-w" ) if @warning
- ruby @ruby_opts.join(" ") +
- " \"#{run_code}\" " +
- file_list.collect { |fn| "\"#{fn}\"" }.join(' ') +
- " #{option_list}"
- end
- end
- self
- end
-
- def option_list # :nodoc:
- ENV['TESTOPTS'] || @options || ""
- end
-
- def file_list # :nodoc:
- if ENV['TEST']
- FileList[ ENV['TEST'] ]
- else
- result = []
- result += @test_files.to_a if @test_files
- result += FileList[ @pattern ].to_a if @pattern
- FileList[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 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
-
- end
-end
diff --git a/lib/rake/win32.rb b/lib/rake/win32.rb
deleted file mode 100644
index 96f66d6957..0000000000
--- a/lib/rake/win32.rb
+++ /dev/null
@@ -1,34 +0,0 @@
-module Rake
-
- # Win 32 interface methods for Rake. Windows specific functionality
- # will be placed here to collect that knowledge in one spot.
- module Win32
- class << self
- # True if running on a windows system.
- def windows?
- # assume other DOSish systems are extinct.
- File::ALT_SEPARATOR == '\\'
- end
- end
-
- class << self
- # The standard directory containing system wide rake files on
- # Win 32 systems. Try the following environment variables (in
- # order):
- #
- # * APPDATA
- # * HOME
- # * HOMEDRIVE + HOMEPATH
- # * USERPROFILE
- #
- # If the above are not defined, retruns the personal folder.
- def win32_system_dir #:nodoc:
- win32_shared_path = ENV['APPDATA']
- if !win32_shared_path or win32_shared_path.empty?
- win32_shared_path = '~'
- end
- File.expand_path('Rake', win32_shared_path)
- end
- end if windows?
- end
-end
diff --git a/lib/rational.rb b/lib/rational.rb
index 68eec47a58..69a3b76bf1 100644
--- a/lib/rational.rb
+++ b/lib/rational.rb
@@ -1,21 +1,564 @@
-# :enddoc:
+#
+# rational.rb -
+# $Release Version: 0.5 $
+# $Revision: 1.7 $
+# $Date: 1999/08/24 12:49:28 $
+# by Keiju ISHITSUKA(SHL Japan Inc.)
+#
+# Documentation by Kevin Jackson and Gavin Sinclair.
+#
+# When you <tt>require 'rational'</tt>, all interactions between numbers
+# potentially return a rational result. For example:
+#
+# 1.quo(2) # -> 0.5
+# require 'rational'
+# 1.quo(2) # -> Rational(1,2)
+#
+# See Rational for full documentation.
+#
+
+
+#
+# Creates a Rational number (i.e. a fraction). +a+ and +b+ should be Integers:
+#
+# Rational(1,3) # -> 1/3
+#
+# Note: trying to construct a Rational with floating point or real values
+# produces errors:
+#
+# Rational(1.1, 2.3) # -> NoMethodError
+#
+def Rational(a, b = 1)
+ if a.kind_of?(Rational) && b == 1
+ a
+ else
+ Rational.reduce(a, b)
+ end
+end
+
+#
+# Rational implements a rational class for numbers.
+#
+# <em>A rational number is a number that can be expressed as a fraction p/q
+# where p and q are integers and q != 0. A rational number p/q is said to have
+# numerator p and denominator q. Numbers that are not rational are called
+# irrational numbers.</em> (http://mathworld.wolfram.com/RationalNumber.html)
+#
+# To create a Rational Number:
+# Rational(a,b) # -> a/b
+# Rational.new!(a,b) # -> a/b
+#
+# Examples:
+# Rational(5,6) # -> 5/6
+# Rational(5) # -> 5/1
+#
+# Rational numbers are reduced to their lowest terms:
+# Rational(6,10) # -> 3/5
+#
+# But not if you use the unusual method "new!":
+# Rational.new!(6,10) # -> 6/10
+#
+# Division by zero is obviously not allowed:
+# Rational(3,0) # -> ZeroDivisionError
+#
+class Rational < Numeric
+ @RCS_ID='-$Id: rational.rb,v 1.7 1999/08/24 12:49:28 keiju Exp keiju $-'
+
+ #
+ # Reduces the given numerator and denominator to their lowest terms. Use
+ # Rational() instead.
+ #
+ def Rational.reduce(num, den = 1)
+ raise ZeroDivisionError, "denominator is zero" if den == 0
+
+ if den < 0
+ num = -num
+ den = -den
+ end
+ gcd = num.gcd(den)
+ num = num.div(gcd)
+ den = den.div(gcd)
+ if den == 1 && defined?(Unify)
+ num
+ else
+ new!(num, den)
+ end
+ end
+
+ #
+ # Implements the constructor. This method does not reduce to lowest terms or
+ # check for division by zero. Therefore #Rational() should be preferred in
+ # normal use.
+ #
+ def Rational.new!(num, den = 1)
+ new(num, den)
+ end
+
+ private_class_method :new
+
+ #
+ # This method is actually private.
+ #
+ def initialize(num, den)
+ if den < 0
+ num = -num
+ den = -den
+ end
+ if num.kind_of?(Integer) and den.kind_of?(Integer)
+ @numerator = num
+ @denominator = den
+ else
+ @numerator = num.to_i
+ @denominator = den.to_i
+ end
+ end
+
+ #
+ # Returns the addition of this value and +a+.
+ #
+ # Examples:
+ # r = Rational(3,4) # -> Rational(3,4)
+ # r + 1 # -> Rational(7,4)
+ # r + 0.5 # -> 1.25
+ #
+ def + (a)
+ if a.kind_of?(Rational)
+ num = @numerator * a.denominator
+ num_a = a.numerator * @denominator
+ Rational(num + num_a, @denominator * a.denominator)
+ elsif a.kind_of?(Integer)
+ self + Rational.new!(a, 1)
+ elsif a.kind_of?(Float)
+ Float(self) + a
+ else
+ x, y = a.coerce(self)
+ x + y
+ end
+ end
+
+ #
+ # Returns the difference of this value and +a+.
+ # subtracted.
+ #
+ # Examples:
+ # r = Rational(3,4) # -> Rational(3,4)
+ # r - 1 # -> Rational(-1,4)
+ # r - 0.5 # -> 0.25
+ #
+ def - (a)
+ if a.kind_of?(Rational)
+ num = @numerator * a.denominator
+ num_a = a.numerator * @denominator
+ Rational(num - num_a, @denominator*a.denominator)
+ elsif a.kind_of?(Integer)
+ self - Rational.new!(a, 1)
+ elsif a.kind_of?(Float)
+ Float(self) - a
+ else
+ x, y = a.coerce(self)
+ x - y
+ end
+ end
+
+ #
+ # Returns the product of this value and +a+.
+ #
+ # Examples:
+ # r = Rational(3,4) # -> Rational(3,4)
+ # r * 2 # -> Rational(3,2)
+ # r * 4 # -> Rational(3,1)
+ # r * 0.5 # -> 0.375
+ # r * Rational(1,2) # -> Rational(3,8)
+ #
+ def * (a)
+ if a.kind_of?(Rational)
+ num = @numerator * a.numerator
+ den = @denominator * a.denominator
+ Rational(num, den)
+ elsif a.kind_of?(Integer)
+ self * Rational.new!(a, 1)
+ elsif a.kind_of?(Float)
+ Float(self) * a
+ else
+ x, y = a.coerce(self)
+ x * y
+ end
+ end
+
+ #
+ # Returns the quotient of this value and +a+.
+ # r = Rational(3,4) # -> Rational(3,4)
+ # r / 2 # -> Rational(3,8)
+ # r / 2.0 # -> 0.375
+ # r / Rational(1,2) # -> Rational(3,2)
+ #
+ def / (a)
+ if a.kind_of?(Rational)
+ num = @numerator * a.denominator
+ den = @denominator * a.numerator
+ Rational(num, den)
+ elsif a.kind_of?(Integer)
+ raise ZeroDivisionError, "division by zero" if a == 0
+ self / Rational.new!(a, 1)
+ elsif a.kind_of?(Float)
+ Float(self) / a
+ else
+ x, y = a.coerce(self)
+ x / y
+ end
+ end
+
+ #
+ # Returns this value raised to the given power.
+ #
+ # Examples:
+ # r = Rational(3,4) # -> Rational(3,4)
+ # r ** 2 # -> Rational(9,16)
+ # r ** 2.0 # -> 0.5625
+ # r ** Rational(1,2) # -> 0.866025403784439
+ #
+ def ** (other)
+ if other.kind_of?(Rational)
+ Float(self) ** other
+ elsif other.kind_of?(Integer)
+ if other > 0
+ num = @numerator ** other
+ den = @denominator ** other
+ elsif other < 0
+ num = @denominator ** -other
+ den = @numerator ** -other
+ elsif other == 0
+ num = 1
+ den = 1
+ end
+ Rational.new!(num, den)
+ elsif other.kind_of?(Float)
+ Float(self) ** other
+ else
+ x, y = other.coerce(self)
+ x ** y
+ end
+ end
+
+ def div(other)
+ (self / other).floor
+ end
+
+ #
+ # Returns the remainder when this value is divided by +other+.
+ #
+ # Examples:
+ # r = Rational(7,4) # -> Rational(7,4)
+ # r % Rational(1,2) # -> Rational(1,4)
+ # r % 1 # -> Rational(3,4)
+ # r % Rational(1,7) # -> Rational(1,28)
+ # r % 0.26 # -> 0.19
+ #
+ def % (other)
+ value = (self / other).floor
+ return self - other * value
+ end
+
+ #
+ # Returns the quotient _and_ remainder.
+ #
+ # Examples:
+ # r = Rational(7,4) # -> Rational(7,4)
+ # r.divmod Rational(1,2) # -> [3, Rational(1,4)]
+ #
+ def divmod(other)
+ value = (self / other).floor
+ return value, self - other * value
+ end
+
+ #
+ # Returns the absolute value.
+ #
+ def abs
+ if @numerator > 0
+ self
+ else
+ Rational.new!(-@numerator, @denominator)
+ end
+ end
+
+ #
+ # Returns +true+ iff this value is numerically equal to +other+.
+ #
+ # But beware:
+ # Rational(1,2) == Rational(4,8) # -> true
+ # Rational(1,2) == Rational.new!(4,8) # -> false
+ #
+ # Don't use Rational.new!
+ #
+ def == (other)
+ if other.kind_of?(Rational)
+ @numerator == other.numerator and @denominator == other.denominator
+ elsif other.kind_of?(Integer)
+ self == Rational.new!(other, 1)
+ elsif other.kind_of?(Float)
+ Float(self) == other
+ else
+ other == self
+ end
+ end
+
+ #
+ # Standard comparison operator.
+ #
+ def <=> (other)
+ if other.kind_of?(Rational)
+ num = @numerator * other.denominator
+ num_a = other.numerator * @denominator
+ v = num - num_a
+ if v > 0
+ return 1
+ elsif v < 0
+ return -1
+ else
+ return 0
+ end
+ elsif other.kind_of?(Integer)
+ return self <=> Rational.new!(other, 1)
+ elsif other.kind_of?(Float)
+ return Float(self) <=> other
+ elsif defined? other.coerce
+ x, y = other.coerce(self)
+ return x <=> y
+ else
+ return nil
+ end
+ end
+
+ def coerce(other)
+ if other.kind_of?(Float)
+ return other, self.to_f
+ elsif other.kind_of?(Integer)
+ return Rational.new!(other, 1), self
+ else
+ super
+ end
+ end
+
+ #
+ # Converts the rational to an Integer. Not the _nearest_ integer, the
+ # truncated integer. Study the following example carefully:
+ # Rational(+7,4).to_i # -> 1
+ # Rational(-7,4).to_i # -> -1
+ # (-1.75).to_i # -> -1
+ #
+ # In other words:
+ # Rational(-7,4) == -1.75 # -> true
+ # Rational(-7,4).to_i == (-1.75).to_i # -> true
+ #
+
+
+ def floor()
+ @numerator.div(@denominator)
+ end
+
+ def ceil()
+ -((-@numerator).div(@denominator))
+ end
+
+ def truncate()
+ if @numerator < 0
+ return -((-@numerator).div(@denominator))
+ end
+ @numerator.div(@denominator)
+ end
+
+ alias_method :to_i, :truncate
+
+ def round()
+ if @numerator < 0
+ num = -@numerator
+ num = num * 2 + @denominator
+ den = @denominator * 2
+ -(num.div(den))
+ else
+ num = @numerator * 2 + @denominator
+ den = @denominator * 2
+ num.div(den)
+ end
+ end
+
+ #
+ # Converts the rational to a Float.
+ #
+ def to_f
+ @numerator.to_f/@denominator.to_f
+ end
+
+ #
+ # Returns a string representation of the rational number.
+ #
+ # Example:
+ # Rational(3,4).to_s # "3/4"
+ # Rational(8).to_s # "8"
+ #
+ def to_s
+ if @denominator == 1
+ @numerator.to_s
+ else
+ @numerator.to_s+"/"+@denominator.to_s
+ end
+ end
+
+ #
+ # Returns +self+.
+ #
+ def to_r
+ self
+ end
+
+ #
+ # Returns a reconstructable string representation:
+ #
+ # Rational(5,8).inspect # -> "Rational(5, 8)"
+ #
+ def inspect
+ sprintf("Rational(%s, %s)", @numerator.inspect, @denominator.inspect)
+ end
+
+ #
+ # Returns a hash code for the object.
+ #
+ def hash
+ @numerator.hash ^ @denominator.hash
+ end
+
+ attr :numerator
+ attr :denominator
+
+ private :initialize
+end
+
+class Integer
+ #
+ # In an integer, the value _is_ the numerator of its rational equivalent.
+ # Therefore, this method returns +self+.
+ #
+ def numerator
+ self
+ end
+
+ #
+ # In an integer, the denominator is 1. Therefore, this method returns 1.
+ #
+ def denominator
+ 1
+ end
+
+ #
+ # Returns a Rational representation of this integer.
+ #
+ def to_r
+ Rational(self, 1)
+ end
+
+ #
+ # Returns the <em>greatest common denominator</em> of the two numbers (+self+
+ # and +n+).
+ #
+ # Examples:
+ # 72.gcd 168 # -> 24
+ # 19.gcd 36 # -> 1
+ #
+ # The result is positive, no matter the sign of the arguments.
+ #
+ def gcd(other)
+ min = self.abs
+ max = other.abs
+ while min > 0
+ tmp = min
+ min = max % min
+ max = tmp
+ end
+ max
+ end
+
+ #
+ # Returns the <em>lowest common multiple</em> (LCM) of the two arguments
+ # (+self+ and +other+).
+ #
+ # Examples:
+ # 6.lcm 7 # -> 42
+ # 6.lcm 9 # -> 18
+ #
+ def lcm(other)
+ if self.zero? or other.zero?
+ 0
+ else
+ (self.div(self.gcd(other)) * other).abs
+ end
+ end
+
+ #
+ # Returns the GCD _and_ the LCM (see #gcd and #lcm) of the two arguments
+ # (+self+ and +other+). This is more efficient than calculating them
+ # separately.
+ #
+ # Example:
+ # 6.gcdlcm 9 # -> [3, 18]
+ #
+ def gcdlcm(other)
+ gcd = self.gcd(other)
+ if self.zero? or other.zero?
+ [gcd, 0]
+ else
+ [gcd, (self.div(gcd) * other).abs]
+ end
+ end
+end
class Fixnum
+ remove_method :quo
- alias quof fdiv
+ # If Rational is defined, returns a Rational number instead of a Float.
+ def quo(other)
+ Rational.new!(self, 1) / other
+ end
alias rdiv quo
- alias power! ** unless defined?(0.power!)
- alias rpower **
+ # Returns a Rational number if the result is in fact rational (i.e. +other+ < 0).
+ def rpower (other)
+ if other >= 0
+ self.power!(other)
+ else
+ Rational.new!(self, 1)**other
+ end
+ end
end
class Bignum
+ remove_method :quo
- alias quof fdiv
+ # If Rational is defined, returns a Rational number instead of a Float.
+ def quo(other)
+ Rational.new!(self, 1) / other
+ end
alias rdiv quo
- alias power! ** unless defined?(0.power!)
- alias rpower **
+ # Returns a Rational number if the result is in fact rational (i.e. +other+ < 0).
+ def rpower (other)
+ if other >= 0
+ self.power!(other)
+ else
+ Rational.new!(self, 1)**other
+ end
+ end
+
+end
+unless defined? 1.power!
+ class Fixnum
+ alias power! **
+ alias ** rpower
+ end
+ class Bignum
+ alias power! **
+ alias ** rpower
+ end
end
diff --git a/lib/rbconfig/datadir.rb b/lib/rbconfig/datadir.rb
deleted file mode 100644
index 554b7fead7..0000000000
--- a/lib/rbconfig/datadir.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-#--
-# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
-# All rights reserved.
-# See LICENSE.txt for permissions.
-#++
-
-module RbConfig
-
- ##
- # Return the path to the data directory associated with the given package
- # name. Normally this is just
- # "#{RbConfig::CONFIG['datadir']}/#{package_name}", but may be modified by
- # packages like RubyGems to handle versioned data directories.
-
- def self.datadir(package_name)
- File.join(CONFIG['datadir'], package_name)
- end unless RbConfig.respond_to?(:datadir)
-
-end
-
diff --git a/lib/rdoc.rb b/lib/rdoc.rb
deleted file mode 100644
index 043d3420be..0000000000
--- a/lib/rdoc.rb
+++ /dev/null
@@ -1,395 +0,0 @@
-$DEBUG_RDOC = nil
-
-##
-# = \RDoc - Ruby Documentation System
-#
-# This package contains RDoc and RDoc::Markup. RDoc is an application that
-# produces documentation for one or more Ruby source files. It works similarly
-# to JavaDoc, parsing the source, and extracting the definition for classes,
-# modules, and methods (along with includes and requires). It associates with
-# these optional documentation contained in the immediately preceding comment
-# block, and then renders the result using a pluggable output formatter.
-# RDoc::Markup is a library that converts plain text into various output
-# formats. The markup library is used to interpret the comment blocks that
-# RDoc uses to document methods, classes, and so on.
-#
-# == Roadmap
-#
-# * If you want to use RDoc to create documentation for your Ruby source files,
-# read on.
-# * If you want to include extensions written in C, see RDoc::Parser::C
-# * If you want to drive RDoc programmatically, see RDoc::RDoc.
-# * If you want to use the library to format text blocks into HTML, have a look
-# at RDoc::Markup.
-# * If you want to try writing your own HTML output template, see
-# RDoc::Generator::HTML
-#
-# == Summary
-#
-# Once installed, you can create documentation using the +rdoc+ command
-#
-# % rdoc [options] [names...]
-#
-# For an up-to-date option summary, type
-# % rdoc --help
-#
-# A typical use might be to generate documentation for a package of Ruby
-# source (such as RDoc itself).
-#
-# % rdoc
-#
-# This command generates documentation for all the Ruby and C source
-# files in and below the current directory. These will be stored in a
-# documentation tree starting in the subdirectory +doc+.
-#
-# You can make this slightly more useful for your readers by having the
-# index page contain the documentation for the primary file. In our
-# case, we could type
-#
-# % rdoc --main rdoc.rb
-#
-# You'll find information on the various formatting tricks you can use
-# in comment blocks in the documentation this generates.
-#
-# RDoc uses file extensions to determine how to process each file. File names
-# ending +.rb+ and +.rbw+ are assumed to be Ruby source. Files
-# ending +.c+ are parsed as C files. All other files are assumed to
-# contain just Markup-style markup (with or without leading '#' comment
-# markers). If directory names are passed to RDoc, they are scanned
-# recursively for C and Ruby source files only.
-#
-# == \Options
-# rdoc can be passed a variety of command-line options. In addition,
-# options can be specified via the +RDOCOPT+ environment variable, which
-# functions similarly to the +RUBYOPT+ environment variable.
-#
-# % export RDOCOPT="-S"
-#
-# will make rdoc default to inline method source code. Command-line options
-# always will override those in +RDOCOPT+.
-#
-# Run
-#
-# % rdoc --help
-#
-# for full details on rdoc's options.
-#
-# Here are some of the most commonly used options.
-# [-d, --diagram]
-# Generate diagrams showing modules and
-# classes. You need dot V1.8.6 or later to
-# use the --diagram option correctly. Dot is
-# available from http://graphviz.org
-#
-# [-S, --inline-source]
-# Show method source code inline, rather than via a popup link.
-#
-# [-T, --template=NAME]
-# Set the template used when generating output.
-#
-# == Documenting Source Code
-#
-# Comment blocks can be written fairly naturally, either using +#+ on
-# successive lines of the comment, or by including the comment in
-# a =begin/=end block. If you use the latter form, the =begin line must be
-# flagged with an RDoc tag:
-#
-# =begin rdoc
-# Documentation to be processed by RDoc.
-#
-# ...
-# =end
-#
-# RDoc stops processing comments if it finds a comment line containing
-# a <tt>--</tt>. This can be used to separate external from internal
-# comments, or to stop a comment being associated with a method, class, or
-# module. Commenting can be turned back on with a line that starts with a
-# <tt>++</tt>.
-#
-# ##
-# # Extract the age and calculate the date-of-birth.
-# #--
-# # FIXME: fails if the birthday falls on February 29th
-# #++
-# # The DOB is returned as a Time object.
-#
-# def get_dob(person)
-# # ...
-# end
-#
-# Names of classes, files, and any method names containing an
-# underscore or preceded by a hash character are automatically hyperlinked
-# from comment text to their description.
-#
-# Method parameter lists are extracted and displayed with the method
-# description. If a method calls +yield+, then the parameters passed to yield
-# will also be displayed:
-#
-# def fred
-# ...
-# yield line, address
-#
-# This will get documented as:
-#
-# fred() { |line, address| ... }
-#
-# You can override this using a comment containing ':yields: ...' immediately
-# after the method definition
-#
-# def fred # :yields: index, position
-# # ...
-#
-# yield line, address
-#
-# which will get documented as
-#
-# fred() { |index, position| ... }
-#
-# +:yields:+ is an example of a documentation directive. These appear
-# immediately after the start of the document element they are modifying.
-#
-# == \Markup
-#
-# * The markup engine looks for a document's natural left margin. This is
-# used as the initial margin for the document.
-#
-# * Consecutive lines starting at this margin are considered to be a
-# paragraph.
-#
-# * If a paragraph starts with a "*", "-", or with "<digit>.", then it is
-# taken to be the start of a list. The margin in increased to be the first
-# non-space following the list start flag. Subsequent lines should be
-# indented to this new margin until the list ends. For example:
-#
-# * this is a list with three paragraphs in
-# the first item. This is the first paragraph.
-#
-# And this is the second paragraph.
-#
-# 1. This is an indented, numbered list.
-# 2. This is the second item in that list
-#
-# This is the third conventional paragraph in the
-# first list item.
-#
-# * This is the second item in the original list
-#
-# * You can also construct labeled lists, sometimes called description
-# or definition lists. Do this by putting the label in square brackets
-# and indenting the list body:
-#
-# [cat] a small furry mammal
-# that seems to sleep a lot
-#
-# [ant] a little insect that is known
-# to enjoy picnics
-#
-# A minor variation on labeled lists uses two colons to separate the
-# label from the list body:
-#
-# cat:: a small furry mammal
-# that seems to sleep a lot
-#
-# ant:: a little insect that is known
-# to enjoy picnics
-#
-# This latter style guarantees that the list bodies' left margins are
-# aligned: think of them as a two column table.
-#
-# * Any line that starts to the right of the current margin is treated
-# as verbatim text. This is useful for code listings. The example of a
-# list above is also verbatim text.
-#
-# * A line starting with an equals sign (=) is treated as a
-# heading. Level one headings have one equals sign, level two headings
-# have two,and so on.
-#
-# * A line starting with three or more hyphens (at the current indent)
-# generates a horizontal rule. The more hyphens, the thicker the rule
-# (within reason, and if supported by the output device)
-#
-# * You can use markup within text (except verbatim) to change the
-# appearance of parts of that text. Out of the box, RDoc::Markup
-# supports word-based and general markup.
-#
-# Word-based markup uses flag characters around individual words:
-#
-# [\*word*] displays word in a *bold* font
-# [\_word_] displays word in an _emphasized_ font
-# [\+word+] displays word in a +code+ font
-#
-# General markup affects text between a start delimiter and and end
-# delimiter. Not surprisingly, these delimiters look like HTML markup.
-#
-# [\<b>text...</b>] displays word in a *bold* font
-# [\<em>text...</em>] displays word in an _emphasized_ font
-# [\\<i>text...</i>] displays word in an <i>italicized</i> font
-# [\<tt>text...</tt>] displays word in a +code+ font
-#
-# Unlike conventional Wiki markup, general markup can cross line
-# boundaries. You can turn off the interpretation of markup by
-# preceding the first character with a backslash. This only works for
-# simple markup, not HTML-style markup.
-#
-# * Hyperlinks to the web starting http:, mailto:, ftp:, or www. are
-# recognized. An HTTP url that references an external image file is
-# converted into an inline <IMG..>. Hyperlinks starting 'link:' are
-# assumed to refer to local files whose path is relative to the --op
-# directory.
-#
-# Hyperlinks can also be of the form <tt>label</tt>[url], in which
-# case the label is used in the displayed text, and +url+ is
-# used as the target. If +label+ contains multiple words,
-# put it in braces: <em>{multi word label}[</em>url<em>]</em>.
-#
-# == Directives
-#
-# [+:nodoc:+ / +:nodoc:+ all]
-# This directive prevents documentation for the element from
-# being generated. For classes and modules, the methods, aliases,
-# constants, and attributes directly within the affected class or
-# module also will be omitted. By default, though, modules and
-# classes within that class of module _will_ be documented. This is
-# turned off by adding the +all+ modifier.
-#
-# module MyModule # :nodoc:
-# class Input
-# end
-# end
-#
-# module OtherModule # :nodoc: all
-# class Output
-# end
-# end
-#
-# In the above code, only class <tt>MyModule::Input</tt> will be documented.
-# The +:nodoc:+ directive is global across all files for the class or module
-# to which it applies, so use +:stopdoc:+/+:startdoc:+ to suppress
-# documentation only for a particular set of methods, etc.
-#
-# [+:doc:+]
-# Forces a method or attribute to be documented even if it wouldn't be
-# otherwise. Useful if, for example, you want to include documentation of a
-# particular private method.
-#
-# [+:notnew:+]
-# Only applicable to the +initialize+ instance method. Normally RDoc
-# assumes that the documentation and parameters for +initialize+ are
-# actually for the +new+ method, and so fakes out a +new+ for the class.
-# The +:notnew:+ modifier stops this. Remember that +initialize+ is private,
-# so you won't see the documentation unless you use the +-a+ command line
-# option.
-#
-# Comment blocks can contain other directives:
-#
-# [<tt>:section: title</tt>]
-# Starts a new section in the output. The title following +:section:+ is
-# used as the section heading, and the remainder of the comment containing
-# the section is used as introductory text. Subsequent methods, aliases,
-# attributes, and classes will be documented in this section. A :section:
-# comment block may have one or more lines before the :section: directive.
-# These will be removed, and any identical lines at the end of the block are
-# also removed. This allows you to add visual cues such as:
-#
-# # ----------------------------------------
-# # :section: My Section
-# # This is the section that I wrote.
-# # See it glisten in the noon-day sun.
-# # ----------------------------------------
-#
-# [+:call-seq:+]
-# Lines up to the next blank line in the comment are treated as the method's
-# calling sequence, overriding the default parsing of method parameters and
-# yield arguments.
-#
-# [+:include:+ _filename_]
-# \Include the contents of the named file at this point. The file will be
-# searched for in the directories listed by the +--include+ option, or in
-# the current directory by default. The contents of the file will be
-# shifted to have the same indentation as the ':' at the start of
-# the :include: directive.
-#
-# [+:title:+ _text_]
-# Sets the title for the document. Equivalent to the <tt>--title</tt>
-# command line parameter. (The command line parameter overrides any :title:
-# directive in the source).
-#
-# [+:enddoc:+]
-# Document nothing further at the current level.
-#
-# [+:main:+ _name_]
-# Equivalent to the <tt>--main</tt> command line parameter.
-#
-# [+:stopdoc:+ / +:startdoc:+]
-# Stop and start adding new documentation elements to the current container.
-# For example, if a class has a number of constants that you don't want to
-# document, put a +:stopdoc:+ before the first, and a +:startdoc:+ after the
-# last. If you don't specify a +:startdoc:+ by the end of the container,
-# disables documentation for the entire class or module.
-#
-# == Other stuff
-#
-# RDoc is currently being maintained by Eric Hodel <drbrain@segment7.net>
-#
-# Dave Thomas <dave@pragmaticprogrammer.com> is the original author of RDoc.
-#
-# == Credits
-#
-# * The Ruby parser in rdoc/parse.rb is based heavily on the outstanding
-# work of Keiju ISHITSUKA of Nippon Rational Inc, who produced the Ruby
-# parser for irb and the rtags package.
-#
-# * Code to diagram classes and modules was written by Sergey A Yanovitsky
-# (Jah) of Enticla.
-#
-# * Charset patch from MoonWolf.
-#
-# * Rich Kilmer wrote the kilmer.rb output template.
-#
-# * Dan Brickley led the design of the RDF format.
-#
-# == License
-#
-# RDoc is Copyright (c) 2001-2003 Dave Thomas, The Pragmatic Programmers. It
-# is free software, and may be redistributed under the terms specified
-# in the README file of the Ruby distribution.
-#
-# == Warranty
-#
-# This software is provided "as is" and without any express or implied
-# warranties, including, without limitation, the implied warranties of
-# merchantibility and fitness for a particular purpose.
-
-module RDoc
-
- ##
- # Exception thrown by any rdoc error.
-
- class Error < RuntimeError; end
-
- RDocError = Error # :nodoc:
-
- ##
- # RDoc version you are using
-
- VERSION = "2.2.2"
-
- ##
- # Name of the dotfile that contains the description of files to be processed
- # in the current directory
-
- DOT_DOC_FILENAME = ".document"
-
- GENERAL_MODIFIERS = %w[nodoc].freeze
-
- CLASS_MODIFIERS = GENERAL_MODIFIERS
-
- ATTR_MODIFIERS = GENERAL_MODIFIERS
-
- CONSTANT_MODIFIERS = GENERAL_MODIFIERS
-
- METHOD_MODIFIERS = GENERAL_MODIFIERS +
- %w[arg args yield yields notnew not-new not_new doc]
-
-end
-
diff --git a/lib/rdoc/README b/lib/rdoc/README
index f183c61f8d..89ea0fbd3f 100644
--- a/lib/rdoc/README
+++ b/lib/rdoc/README
@@ -1,34 +1,38 @@
= RDOC - Ruby Documentation System
-This package contains RDoc and RDoc::Markup. RDoc is an application that
-produces documentation for one or more Ruby source files. We work similarly to
-JavaDoc, parsing the source, and extracting the definition for classes,
-modules, and methods (along with includes and requires). We associate with
-these optional documentation contained in the immediately preceding comment
-block, and then render the result using a pluggable output formatter.
-RDoc::Markup is a library that converts plain text into various output formats.
-The markup library is used to interpret the comment blocks that RDoc uses to
-document methods, classes, and so on.
+This package contains Rdoc and SimpleMarkup. Rdoc is an application
+that produces documentation for one or more Ruby source files. We work
+similarly to JavaDoc, parsing the source, and extracting the
+definition for classes, modules, and methods (along with includes and
+requires). We associate with these optional documentation contained
+in the immediately preceding comment block, and then render the result
+using a pluggable output formatter. (Currently, HTML is the only
+supported format. Markup is a library that converts plain text into
+various output formats. The Markup library is used to interpret the
+comment blocks that Rdoc uses to document methods, classes, and so on.
+
+This library contains two packages, rdoc itself and a text markup
+library, 'markup'.
== Roadmap
-* If you want to use RDoc to create documentation for your Ruby source files,
- read on.
-* If you want to include extensions written in C, see RDoc::C_Parser
-* For information on the various markups available in comment blocks, see
- RDoc::Markup.
-* If you want to drive RDoc programmatically, see RDoc::RDoc.
-* If you want to use the library to format text blocks into HTML, have a look
- at RDoc::Markup.
+* If you want to use Rdoc to create documentation for your Ruby source
+ files, read on.
+* If you want to include extensions written in C, see rdoc/parsers/parse_c.rb.
+* For information on the various markups available in comment
+ blocks, see markup/simple_markup.rb.
+* If you want to drive Rdoc programatically, see RDoc::RDoc.
+* If you want to use the library to format text blocks into HTML,
+ have a look at SM::SimpleMarkup.
* If you want to try writing your own HTML output template, see
- RDoc::Generator::HTML
+ RDoc::Page.
== Summary
Once installed, you can create documentation using the 'rdoc' command
(the command is 'rdoc.bat' under Windows)
- % rdoc [options] [names...]
+ % rdoc [options] [names...]
Type "rdoc --help" for an up-to-date option summary.
@@ -38,195 +42,448 @@ source (such as rdoc itself).
% rdoc
This command generates documentation for all the Ruby and C source
-files in and below the current directory. These will be stored in a
+files in and below the current directory. These will be stored in a
documentation tree starting in the subdirectory 'doc'.
You can make this slightly more useful for your readers by having the
-index page contain the documentation for the primary file. In our
+index page contain the documentation for the primary file. In our
case, we could type
- % rdoc --main rdoc.rb
+ % rdoc --main rdoc/rdoc.rb
You'll find information on the various formatting tricks you can use
in comment blocks in the documentation this generates.
-RDoc uses file extensions to determine how to process each file. File names
-ending +.rb+ and <tt>.rbw</tt> are assumed to be Ruby source. Files
-ending +.c+ are parsed as C files. All other files are assumed to
-contain just Markup-style markup (with or without leading '#' comment markers).
-If directory names are passed to RDoc, they are scanned recursively for C and
-Ruby source files only.
+RDoc uses file extensions to determine how to process each file. File
+names ending <tt>.rb</tt> and <tt>.rbw</tt> are assumed to be Ruby
+source. Files ending <tt>.c</tt> are parsed as C files. All other
+files are assumed to contain just SimpleMarkup-style markup (with or
+without leading '#' comment markers). If directory names are passed to
+RDoc, they are scanned recursively for C and Ruby source files only.
-= Markup
-
-For information on how to make lists, hyperlinks, & etc. with RDoc, see
-RDoc::Markup.
-
-Comment blocks can be written fairly naturally, either using '#' on successive
-lines of the comment, or by including the comment in an =begin/=end block. If
-you use the latter form, the =begin line must be flagged with an RDoc tag:
+== Credits
- =begin rdoc
- Documentation to be processed by RDoc.
-
- ...
- =end
+* The Ruby parser in rdoc/parse.rb is based heavily on the outstanding
+ work of Keiju ISHITSUKA of Nippon Rational Inc, who produced the Ruby
+ parser for irb and the rtags package.
-RDoc stops processing comments if it finds a comment line containing '+#--+'.
-This can be used to separate external from internal comments, or to stop a
-comment being associated with a method, class, or module. Commenting can be
-turned back on with a line that starts '+#+++'.
-
- ##
- # Extract the age and calculate the date-of-birth.
- #--
- # FIXME: fails if the birthday falls on February 29th
- #++
- # The DOB is returned as a Time object.
-
- def get_dob(person)
- # ...
- end
+* Code to diagram classes and modules was written by Sergey A Yanovitsky
+ (Jah) of Enticla.
-Names of classes, source files, and any method names containing an underscore
-or preceded by a hash character are automatically hyperlinked from comment text
-to their description.
+* Charset patch from MoonWolf.
-Method parameter lists are extracted and displayed with the method description.
-If a method calls +yield+, then the parameters passed to yield will also be
-displayed:
+* Rich Kilmer wrote the kilmer.rb output template.
- def fred
- ...
- yield line, address
+* Dan Brickley led the design of the RDF format.
-This will get documented as:
+== License
- fred() { |line, address| ... }
+RDoc is Copyright (c) 2001-2003 Dave Thomas, The Pragmatic Programmers. It
+is free software, and may be redistributed under the terms specified
+in the README file of the Ruby distribution.
-You can override this using a comment containing ':yields: ...' immediately
-after the method definition
+= Usage
- def fred # :yields: index, position
- # ...
-
- yield line, address
+RDoc is invoked from the command line using:
-which will get documented as
+ % rdoc <options> [name...]
- fred() { |index, position| ... }
+Files are parsed, and the information they contain collected, before
+any output is produced. This allows cross references between all files
+to be resolved. If a name is a directory, it is traversed. If no
+names are specified, all Ruby files in the current directory (and
+subdirectories) are processed.
-+:yields:+ is an example of a documentation directive. These appear immediately
-after the start of the document element they are modifying.
+Options are:
-== Directives
+[<tt>--accessor</tt> <i>name[,name...]</i>]
+ specifies the name(s) of additional methods that should be treated
+ as if they were <tt>attr_</tt><i>xxx</i> methods. Specifying
+ "--accessor db_opt" means lines such as
-[+:nodoc:+ / +:nodoc:+ all]
- Don't include this element in the documentation. For classes
- and modules, the methods, aliases, constants, and attributes
- directly within the affected class or module will also be
- omitted. By default, though, modules and classes within that
- class of module _will_ be documented. This is turned off by
- adding the +all+ modifier.
-
- module MyModule # :nodoc:
- class Input
- end
- end
-
- module OtherModule # :nodoc: all
- class Output
- end
- end
+ db_opt :name, :age
- In the above code, only class +MyModule::Input+ will be documented.
-
-[+:doc:+]
- Force a method or attribute to be documented even if it wouldn't otherwise
- be. Useful if, for example, you want to include documentation of a
- particular private method.
-
-[+:notnew:+]
- Only applicable to the +initialize+ instance method. Normally RDoc assumes
- that the documentation and parameters for #initialize are actually for the
- ::new method, and so fakes out a ::new for the class. The :notnew: modifier
- stops this. Remember that #initialize is protected, so you won't see the
- documentation unless you use the -a command line option.
-
-Comment blocks can contain other directives:
-
-[+:section: title+]
- Starts a new section in the output. The title following +:section:+ is used
- as the section heading, and the remainder of the comment containing the
- section is used as introductory text. Subsequent methods, aliases,
- attributes, and classes will be documented in this section. A :section:
- comment block may have one or more lines before the :section: directive.
- These will be removed, and any identical lines at the end of the block are
- also removed. This allows you to add visual cues such as:
-
- # ----------------------------------------
- # :section: My Section
- # This is the section that I wrote.
- # See it glisten in the noon-day sun.
- # ----------------------------------------
-
-[+:call-seq:+]
- Lines up to the next blank line in the comment are treated as the method's
- calling sequence, overriding the default parsing of method parameters and
- yield arguments.
-
-[+:include:+ _filename_]
- Include the contents of the named file at this point. The file will be
- searched for in the directories listed by the +--include+ option, or in the
- current directory by default. The contents of the file will be shifted to
- have the same indentation as the ':' at the start of the :include: directive.
-
-[+:title:+ _text_]
- Sets the title for the document. Equivalent to the --title command line
- parameter. (The command line parameter overrides any :title: directive in
- the source).
-
-[+:enddoc:+]
- Document nothing further at the current level.
-
-[+:main:+ _name_]
- Equivalent to the --main command line parameter.
-
-[+:stopdoc:+ / +:startdoc:+]
- Stop and start adding new documentation elements to the current container.
- For example, if a class has a number of constants that you don't want to
- document, put a +:stopdoc:+ before the first, and a +:startdoc:+ after the
- last. If you don't specify a +:startdoc:+ by the end of the container,
- disables documentation for the entire class or module.
+ will get parsed and displayed in the documentation. Each name may have an
+ optional "=flagtext" appended, in which case the given flagtext will appear
+ where (for example) the 'rw' appears for attr_accessor.
+
+[<tt>--all</tt>]
+ include protected and private methods in the output (by default
+ only public methods are included)
+
+[<tt>--charset</tt> _charset_]
+ Set the character set for the generated HTML.
+
+[<tt>--diagram</tt>]
+ include diagrams showing modules and classes. This is currently
+ an experimental feature, and may not be supported by all output
+ templates. You need dot V1.8.6 or later to use the --diagram
+ option correctly (http://www.research.att.com/sw/tools/graphviz/).
+
+[<tt>--exclude</tt> <i>pattern</i>]
+ exclude files and directories matching this pattern from processing
+
+[<tt>--extension</tt> <i>new=old</i>]
+ treat files ending <i>.new</i> as if they ended
+ <i>.old</i>. Saying '--extension cgi=rb' causes RDoc to treat .cgi
+ files as Ruby source.
+
+[<tt>fileboxes</tt>]
+ Classes are put in boxes which represents files, where these
+ classes reside. Classes shared between more than one file are
+ shown with list of files that sharing them. Silently discarded if
+ --diagram is not given Experimental.
+
+[<tt>--fmt</tt> _fmt_]
+ generate output in a particular format.
+
+[<tt>--help</tt>]
+ generate a usage summary.
+
+[<tt>--help-output</tt>]
+ explain the various output options.
+
+[<tt>--image-format</tt> <i>gif/png/jpg/jpeg</i>]
+ sets output image format for diagrams. Can be png, gif, jpeg,
+ jpg. If this option is omitted, png is used. Requires --diagram.
+
+[<tt>--include</tt> <i>dir,...</i>]
+ specify one or more directories to be searched when satisfying
+ :+include+: directives. Multiple <tt>--include</tt> options may be
+ given. The directory containing the file currently being processed
+ is always searched.
+
+[<tt>--inline-source</tt>]
+ By default, the source code of methods is shown in a popup. With
+ this option, it's displayed inline.
+
+[<tt>line-numbers</tt>]
+ include line numbers in the source code
+
+[<tt>--main</tt> _name_]
+ the class of module _name_ will appear on the index page. If you
+ want to set a particular file as a main page (a README, for
+ example) simply specifiy its name as the first on the command
+ line.
+
+[<tt>--merge</tt>]
+ when generating _ri_ output, if classes being processed already
+ exist in the destination directory, merge in the current details
+ rather than overwrite them.
+
+[<tt>--one-file</tt>]
+ place all the output into a single file
+
+[<tt>--op</tt> _dir_]
+ set the output directory to _dir_ (the default is the directory
+ "doc")
+
+[<tt>--op-name</tt> _name_]
+ set the name of the output. Has no effect for HTML.
+ "doc")
+
+[<tt>--opname</tt> _name_]
+ set the output name (has no effect for HTML).
+
+[<tt>--promiscuous</tt>]
+ If a module or class is defined in more than one source file, and
+ you click on a particular file's name in the top navigation pane,
+ RDoc will normally only show you the inner classes and modules of
+ that class that are defined in the particular file. Using this
+ option makes it show all classes and modules defined in the class,
+ regardless of the file they were defined in.
+
+[<tt>--quiet</tt>]
+ do not display progress messages
+
+[<tt>--ri</tt>, <tt>--ri-site</tt>, _and_ <tt>--ri-system</tt>]
+ generate output than can be read by the _ri_ command-line tool.
+ By default --ri places its output in ~/.rdoc, --ri-site in
+ $datadir/ri/<ver>/site, and --ri-system in
+ $datadir/ri/<ver>/system. All can be overridden with a subsequent
+ --op option. All default directories are in ri's default search
+ path.
+
+[<tt>--show-hash</tt>]
+ A name of the form #name in a comment is a possible hyperlink to
+ an instance method name. When displayed, the '#' is removed unless
+ this option is specified
+
+[<tt>--style</tt> <i>stylesheet url</i>]
+ specifies the URL of an external stylesheet to use (rather than
+ generating one of our own)
+
+[<tt>tab-width</tt> _n_]
+ set the width of tab characters (default 8)
+
+[<tt>--template</tt> <i>name</i>]
+ specify an alternate template to use when generating output (the
+ default is 'standard'). This template should be in a directory
+ accessible via $: as rdoc/generators/xxxx_template, where 'xxxx'
+ depends on the output formatter.
+
+[<tt>--version</tt>]
+ display RDoc's version
+
+[<tt>--webcvs</tt> _url_]
+ Specify a URL for linking to a web frontend to CVS. If the URL
+ contains a '\%s', the name of the current file will be
+ substituted; if the URL doesn't contain a '\%s', the filename will
+ be appended to it.
+
+= Example
-= Other stuff
-
-Author:: Dave Thomas <dave@pragmaticprogrammer.com>
+A typical small Ruby program commented using RDoc might be as follows. You
+can see the formatted result in EXAMPLE.rb and Anagram.
-== Credits
+ :include: EXAMPLE.rb
-* The Ruby parser in rdoc/parse.rb is based heavily on the outstanding
- work of Keiju ISHITSUKA of Nippon Rational Inc, who produced the Ruby
- parser for irb and the rtags package.
+= Markup
-* Code to diagram classes and modules was written by Sergey A Yanovitsky
- (Jah) of Enticla.
+Comment blocks can be written fairly naturally, either using '#' on
+successive lines of the comment, or by including the comment in
+an =begin/=end block. If you use the latter form, the =begin line
+must be flagged with an RDoc tag:
-* Charset patch from MoonWolf.
+ =begin rdoc
+ Documentation to
+ be processed by RDoc.
+ =end
-* Rich Kilmer wrote the kilmer.rb output template.
+Paragraphs are lines that share the left margin. Text indented past
+this margin are formatted verbatim.
+
+1. Lists are typed as indented paragraphs with:
+ * a '*' or '-' (for bullet lists)
+ * a digit followed by a period for
+ numbered lists
+ * an upper or lower case letter followed
+ by a period for alpha lists.
-* Dan Brickley led the design of the RDF format.
+ For example, the input that produced the above paragraph looked like
+ 1. Lists are typed as indented
+ paragraphs with:
+ * a '*' or '-' (for bullet lists)
+ * a digit followed by a period for
+ numbered lists
+ * an upper or lower case letter followed
+ by a period for alpha lists.
+
+2. Labeled lists (sometimes called description
+ lists) are typed using square brackets for the label.
+ [cat] small domestic animal
+ [+cat+] command to copy standard input
+
+3. Labeled lists may also be produced by putting a double colon
+ after the label. This sets the result in tabular form, so the
+ descriptions all line up. This was used to create the 'author'
+ block at the bottom of this description.
+ cat:: small domestic animal
+ +cat+:: command to copy standard input
+
+ For both kinds of labeled lists, if the body text starts on the same
+ line as the label, then the start of that text determines the block
+ indent for the rest of the body. The text may also start on the line
+ following the label, indented from the start of the label. This is
+ often preferable if the label is long. Both the following are
+ valid labeled list entries:
+
+ <tt>--output</tt> <i>name [, name]</i>::
+ specify the name of one or more output files. If multiple
+ files are present, the first is used as the index.
+
+ <tt>--quiet:</tt>:: do not output the names, sizes, byte counts,
+ index areas, or bit ratios of units as
+ they are processed.
+
+4. Headings are entered using equals signs
+
+ = Level One Heading
+ == Level Two Heading
+ and so on
+
+5. Rules (horizontal lines) are entered using three or
+ more hyphens.
+
+6. Non-verbatim text can be marked up:
+
+ _italic_:: \_word_ or \<em>text</em>
+ *bold*:: \*word* or \<b>text</b>
+ +typewriter+:: \+word+ or \<tt>text</tt>
+
+ The first form only works around 'words', where a word is a
+ sequence of upper and lower case letters and underscores. Putting a
+ backslash before inline markup stops it being interpreted, which is
+ how I created the table above:
+
+ _italic_:: \_word_ or \<em>text</em>
+ *bold*:: \*word* or \<b>text</b>
+ +typewriter+:: \+word+ or \<tt>text</tt>
+
+7. Names of classes, source files, and any method names
+ containing an underscore or preceded by a hash
+ character are automatically hyperlinked from
+ comment text to their description.
+
+8. Hyperlinks to the web starting http:, mailto:, ftp:, or www. are
+ recognized. An HTTP url that references an external image file is
+ converted into an inline <IMG..>. Hyperlinks starting 'link:' are
+ assumed to refer to local files whose path is relative to the --op
+ directory.
+
+ Hyperlinks can also be of the form <tt>label</tt>[url], in which
+ case the label is used in the displayed text, and <tt>url</tt> is
+ used as the target. If <tt>label</tt> contains multiple words,
+ put it in braces: <em>{multi word label}[</em>url<em>]</em>.
+
+9. Method parameter lists are extracted and displayed with
+ the method description. If a method calls +yield+, then
+ the parameters passed to yield will also be displayed:
+
+ def fred
+ ...
+ yield line, address
+
+ This will get documented as
+
+ fred() { |line, address| ... }
+
+ You can override this using a comment containing
+ ':yields: ...' immediately after the method definition
+
+ def fred # :yields: index, position
+ ...
+ yield line, address
+
+ which will get documented as
+
+ fred() { |index, position| ... }
+
+
+10. ':yields:' is an example of a documentation modifier. These appear
+ immediately after the start of the document element they are modifying.
+ Other modifiers include
+
+ [<tt>:nodoc:</tt><i>[all]</i>]
+ don't include this element in the documentation. For classes
+ and modules, the methods, aliases, constants, and attributes
+ directly within the affected class or module will also be
+ omitted. By default, though, modules and classes within that
+ class of module _will_ be documented. This is turned off by
+ adding the +all+ modifier.
+
+ module SM #:nodoc:
+ class Input
+ end
+ end
+ module Markup #:nodoc: all
+ class Output
+ end
+ end
+
+ In the above code, only class <tt>SM::Input</tt> will be
+ documented.
+
+ [<tt>:doc:</tt>]
+ force a method or attribute to be documented even if it
+ wouldn't otherwise be. Useful if, for example, you want to
+ include documentation of a particular private method.
+
+ [<tt>:notnew:</tt>]
+ only applicable to the +initialize+ instance method. Normally
+ RDoc assumes that the documentation and parameters for
+ #initialize are actually for the ::new method, and so fakes
+ out a ::new for the class. THe :notnew: modifier stops
+ this. Remember that #initialize is protected, so you won't
+ see the documentation unless you use the -a command line
+ option.
+
+
+11. RDoc stops processing comments if it finds a comment
+ line containing '<tt>#--</tt>'. This can be used to
+ separate external from internal comments, or
+ to stop a comment being associated with a method,
+ class, or module. Commenting can be turned back on with
+ a line that starts '<tt>#++</tt>'.
+
+ # Extract the age and calculate the
+ # date-of-birth.
+ #--
+ # FIXME: fails if the birthday falls on
+ # February 29th
+ #++
+ # The DOB is returned as a Time object.
+
+ def get_dob(person)
+ ...
+
+12. Comment blocks can contain other directives:
+
+ [<tt>:section: title</tt>]
+ Starts a new section in the output. The title following
+ <tt>:section:</tt> is used as the section heading, and the
+ remainder of the comment containing the section is used as
+ introductory text. Subsequent methods, aliases, attributes,
+ and classes will be documented in this section. A :section:
+ comment block may have one or more lines before the :section:
+ directive. These will be removed, and any identical lines at
+ the end of the block are also removed. This allows you to add
+ visual cues such as
+
+ # ----------------------------------------
+ # :section: My Section
+ # This is the section that I wrote.
+ # See it glisten in the noon-day sun.
+ # ----------------------------------------
+
+ [<tt>call-seq:</tt>]
+ lines up to the next blank line in the comment are treated as
+ the method's calling sequence, overriding the
+ default parsing of method parameters and yield arguments.
+
+ [<tt>:include:</tt><i>filename</i>]
+ include the contents of the named file at this point. The
+ file will be searched for in the directories listed by
+ the <tt>--include</tt> option, or in the current
+ directory by default. The contents of the file will be
+ shifted to have the same indentation as the ':' at the
+ start of the :include: directive.
+
+ [<tt>:title:</tt><i>text</i>]
+ Sets the title for the document. Equivalent to the --title command
+ line parameter. (The command line parameter overrides any :title:
+ directive in the source).
+
+ [<tt>:enddoc:</tt>]
+ Document nothing further at the current level.
+
+ [<tt>:main:</tt><i>name</i>]
+ Equivalent to the --main command line parameter.
+
+ [<tt>:stopdoc: / :startdoc:</tt>]
+ Stop and start adding new documentation elements to the
+ current container. For example, if a class has a number of
+ constants that you don't want to document, put a
+ <tt>:stopdoc:</tt> before the first, and a
+ <tt>:startdoc:</tt> after the last. If you don't specifiy a
+ <tt>:startdoc:</tt> by the end of the container, disables
+ documentation for the entire class or module.
+
+
+---
+
+See also markup/simple_markup.rb.
-== License
+= Other stuff
-RDoc is Copyright (c) 2001-2003 Dave Thomas, The Pragmatic Programmers. It
-is free software, and may be redistributed under the terms specified
-in the README file of the Ruby distribution.
+Author:: Dave Thomas <dave@pragmaticprogrammer.com>
+Requires:: Ruby 1.8.1 or later
+License:: Copyright (c) 2001-2003 Dave Thomas.
+ Released under the same license as Ruby.
== Warranty
-This software is provided "as is" and without any express or implied
-warranties, including, without limitation, the implied warranties of
-merchantibility and fitness for a particular purpose.
-
+This software is provided "as is" and without any express or
+implied warranties, including, without limitation, the implied
+warranties of merchantibility and fitness for a particular
+purpose.
diff --git a/lib/rdoc/code_objects.rb b/lib/rdoc/code_objects.rb
index 3fdd86314d..d6c4f1bdb9 100644
--- a/lib/rdoc/code_objects.rb
+++ b/lib/rdoc/code_objects.rb
@@ -5,10 +5,10 @@ require 'rdoc/tokenstream'
module RDoc
- ##
- # We contain the common stuff for contexts (which are containers) and other
- # elements (methods, attributes and so on)
+ # We contain the common stuff for contexts (which are containers)
+ # and other elements (methods, attributes and so on)
+ #
class CodeObject
attr_accessor :parent
@@ -31,13 +31,6 @@ module RDoc
attr_reader :document_self
- def initialize
- @document_self = true
- @document_children = true
- @force_documentation = false
- @done_documenting = false
- end
-
def document_self=(val)
@document_self = val
if !val
@@ -71,14 +64,6 @@ module RDoc
# Do we _force_ documentation, even is we wouldn't normally show the entity
attr_accessor :force_documentation
- def parent_file_name
- @parent ? @parent.file_base_name : '(unknown)'
- end
-
- def parent_name
- @parent ? @parent.name : '(unknown)'
- end
-
# Default callbacks to nothing, but this is overridden for classes
# and modules
def remove_classes_and_modules
@@ -87,10 +72,18 @@ module RDoc
def remove_methods_etc
end
+ def initialize
+ @document_self = true
+ @document_children = true
+ @force_documentation = false
+ @done_documenting = false
+ end
+
# Access the code object's comment
attr_reader :comment
- # Update the comment, but don't overwrite a real comment with an empty one
+ # Update the comment, but don't overwrite a real comment
+ # with an empty one
def comment=(comment)
@comment = comment unless comment.empty?
end
@@ -101,7 +94,7 @@ module RDoc
# those directives. Wehn a comment is assigned, we then extract
# out any matching directives and update our object
- def self.attr_overridable(name, *aliases)
+ def CodeObject.attr_overridable(name, *aliases)
@overridables ||= {}
attr_accessor name
@@ -114,24 +107,15 @@ module RDoc
end
- ##
- # A Context is something that can hold modules, classes, methods,
- # attributes, aliases, requires, and includes. Classes, modules, and files
- # are all Contexts.
+ # A Context is something that can hold modules, classes, methods,
+ # attributes, aliases, requires, and includes. Classes, modules, and
+ # files are all Contexts.
class Context < CodeObject
+ attr_reader :name, :method_list, :attributes, :aliases, :constants
+ attr_reader :requires, :includes, :in_files, :visibility
- attr_reader :aliases
- attr_reader :attributes
- attr_reader :constants
- attr_reader :current_section
- attr_reader :in_files
- attr_reader :includes
- attr_reader :method_list
- attr_reader :name
- attr_reader :requires
- attr_reader :sections
- attr_reader :visibility
+ attr_reader :sections
class Section
attr_reader :title, :comment, :sequence
@@ -142,26 +126,15 @@ module RDoc
@title = title
@@sequence.succ!
@sequence = @@sequence.dup
- @comment = nil
set_comment(comment)
end
- def ==(other)
- self.class === other and @sequence == other.sequence
- end
-
- def inspect
- "#<%s:0x%x %s %p>" % [
- self.class, object_id,
- @sequence, title
- ]
- end
+ private
- ##
- # Set the comment for this section from the original comment block If
- # the first line contains :section:, strip it and use the rest.
- # Otherwise remove lines up to the line containing :section:, and look
- # for those lines again at the end and remove them. This lets us write
+ # Set the comment for this section from the original comment block
+ # If the first line contains :section:, strip it and use the rest. Otherwise
+ # remove lines up to the line containing :section:, and look for
+ # those lines again at the end and remove them. This lets us write
#
# # ---------------------
# # :SECTION: The title
@@ -171,10 +144,9 @@ module RDoc
def set_comment(comment)
return unless comment
- if comment =~ /^#[ \t]*:section:.*\n/
+ if comment =~ /^.*?:section:.*$/
start = $`
rest = $'
-
if start.empty?
@comment = rest
else
@@ -185,13 +157,13 @@ module RDoc
end
@comment = nil if @comment.empty?
end
-
end
+
def initialize
- super
+ super()
- @in_files = []
+ @in_files = []
@name ||= "unknown"
@comment ||= ""
@@ -205,53 +177,29 @@ module RDoc
initialize_classes_and_modules
end
- ##
# map the class hash to an array externally
-
def classes
@classes.values
end
- ##
# map the module hash to an array externally
-
def modules
@modules.values
end
- ##
- # return the classes Hash (only to be used internally)
-
- def classes_hash
- @classes
- end
- protected :classes_hash
-
- ##
- # return the modules Hash (only to be used internally)
-
- def modules_hash
- @modules
- end
- protected :modules_hash
-
- ##
# Change the default visibility for new methods
-
def ongoing_visibility=(vis)
@visibility = vis
end
- ##
- # Yields Method and Attr entries matching the list of names in +methods+.
- # Attributes are only returned when +singleton+ is false.
+ # Given an array +methods+ of method names, set the
+ # visibility of the corresponding AnyMethod object
- def methods_matching(methods, singleton = false)
+ def set_visibility_for(methods, vis, singleton=false)
count = 0
-
@method_list.each do |m|
- if methods.include? m.name and m.singleton == singleton then
- yield m
+ if methods.include?(m.name) && m.singleton == singleton
+ m.visibility = vis
count += 1
end
end
@@ -261,23 +209,14 @@ module RDoc
# perhaps we need to look at attributes
@attributes.each do |a|
- yield a if methods.include? a.name
- end
- end
-
- ##
- # Given an array +methods+ of method names, set the visibility of the
- # corresponding AnyMethod object
-
- def set_visibility_for(methods, vis, singleton = false)
- methods_matching methods, singleton do |m|
- m.visibility = vis
+ if methods.include?(a.name)
+ a.visibility = vis
+ count += 1
+ end
end
end
- ##
# Record the file that we happen to find it in
-
def record_location(toplevel)
@in_files << toplevel unless @in_files.include?(toplevel)
end
@@ -288,24 +227,7 @@ module RDoc
end
def add_class(class_type, name, superclass)
- klass = add_class_or_module @classes, class_type, name, superclass
-
- #
- # If the parser encounters Container::Item before encountering
- # Container, then it assumes that Container is a module. This
- # may not be the case, so remove Container from the module list
- # if present and transfer any contained classes and modules to
- # the new class.
- #
- mod = @modules.delete(name)
-
- if mod then
- klass.classes_hash.update(mod.classes_hash)
- klass.modules_hash.update(mod.modules_hash)
- klass.method_list.concat(mod.method_list)
- end
-
- return klass
+ add_class_or_module(@classes, class_type, name, superclass)
end
def add_module(class_type, name)
@@ -313,46 +235,28 @@ module RDoc
end
def add_method(a_method)
+ puts "Adding #@visibility method #{a_method.name} to #@name" if $DEBUG
a_method.visibility = @visibility
add_to(@method_list, a_method)
-
- unmatched_alias_list = @unmatched_alias_lists[a_method.name]
- if unmatched_alias_list then
- unmatched_alias_list.each do |unmatched_alias|
- add_alias_impl unmatched_alias, a_method
- @aliases.delete unmatched_alias
- end
-
- @unmatched_alias_lists.delete a_method.name
- end
end
def add_attribute(an_attribute)
add_to(@attributes, an_attribute)
end
- def add_alias_impl(an_alias, meth)
- new_meth = AnyMethod.new(an_alias.text, an_alias.new_name)
- new_meth.is_alias_for = meth
- new_meth.singleton = meth.singleton
- new_meth.params = meth.params
- new_meth.comment = "Alias for \##{meth.name}"
- meth.add_alias(new_meth)
- add_method(new_meth)
- end
-
def add_alias(an_alias)
meth = find_instance_method_named(an_alias.old_name)
-
- if meth then
- add_alias_impl(an_alias, meth)
+ if meth
+ new_meth = AnyMethod.new(an_alias.text, an_alias.new_name)
+ new_meth.is_alias_for = meth
+ new_meth.singleton = meth.singleton
+ new_meth.params = meth.params
+ new_meth.comment = "Alias for \##{meth.name}"
+ meth.add_alias(new_meth)
+ add_method(new_meth)
else
add_to(@aliases, an_alias)
- unmatched_alias_list = @unmatched_alias_lists[an_alias.old_name] ||= []
- unmatched_alias_list.push(an_alias)
end
-
- an_alias
end
def add_include(an_include)
@@ -365,21 +269,20 @@ module RDoc
# Requires always get added to the top-level (file) context
def add_require(a_require)
- if TopLevel === self then
- add_to @requires, a_require
+ if self.kind_of? TopLevel
+ add_to(@requires, a_require)
else
- parent.add_require a_require
+ parent.add_require(a_require)
end
end
def add_class_or_module(collection, class_type, name, superclass=nil)
cls = collection[name]
-
- if cls then
- cls.superclass = superclass unless cls.module?
- puts "Reusing class/module #{name}" if $DEBUG_RDOC
+ if cls
+ puts "Reusing class/module #{name}" if $DEBUG
else
cls = class_type.new(name, superclass)
+ puts "Adding class/module #{name} to #@name" if $DEBUG
# collection[name] = cls if @document_self && !@done_documenting
collection[name] = cls if !@done_documenting
cls.parent = self
@@ -389,7 +292,7 @@ module RDoc
end
def add_to(array, thing)
- array << thing if @document_self and not @done_documenting
+ array << thing if @document_self && !@done_documenting
thing.parent = self
thing.section = @current_section
end
@@ -409,10 +312,6 @@ module RDoc
@requires = []
@includes = []
@constants = []
-
- # This Hash maps a method name to a list of unmatched
- # aliases (aliases of a method not yet encountered).
- @unmatched_alias_lists = {}
end
# and remove classes and modules when we see a :nodoc: all
@@ -427,12 +326,9 @@ module RDoc
# Find a named module
def find_module_named(name)
- # First check the enclosed modules, then check the module itself,
- # then check the enclosing modules (this mirrors the check done by
- # the Ruby parser)
+ return self if self.name == name
res = @modules[name] || @classes[name]
return res if res
- return self if self.name == name
find_enclosing_module_named(name)
end
@@ -453,7 +349,7 @@ module RDoc
@method_list.each {|m| yield m}
end
- def each_attribute
+ def each_attribute
@attributes.each {|a| yield a}
end
@@ -475,31 +371,26 @@ module RDoc
name <=> other.name
end
- ##
- # Look up +symbol+. If +method+ is non-nil, then we assume the symbol
- # references a module that contains that method.
-
- def find_symbol(symbol, method = nil)
+ # Look up the given symbol. If method is non-nil, then
+ # we assume the symbol references a module that
+ # contains that method
+ def find_symbol(symbol, method=nil)
result = nil
-
case symbol
- when /^::(.*)/ then
+ when /^::(.*)/
result = toplevel.find_symbol($1)
- when /::/ then
+ when /::/
modules = symbol.split(/::/)
-
- unless modules.empty? then
+ unless modules.empty?
module_name = modules.shift
result = find_module_named(module_name)
-
- if result then
- modules.each do |name|
- result = result.find_module_named(name)
+ if result
+ modules.each do |module_name|
+ result = result.find_module_named(module_name)
break unless result
end
end
end
-
else
# if a method is specified, then we're definitely looking for
# a module, otherwise it could be any symbol
@@ -517,21 +408,22 @@ module RDoc
end
end
end
-
- if result and method then
- fail unless result.respond_to? :find_local_symbol
+ if result && method
+ if !result.respond_to?(:find_local_symbol)
+ p result.name
+ p method
+ fail
+ end
result = result.find_local_symbol(method)
end
-
result
end
-
+
def find_local_symbol(symbol)
res = find_method_named(symbol) ||
find_constant_named(symbol) ||
find_attribute_named(symbol) ||
- find_module_named(symbol) ||
- find_file_named(symbol)
+ find_module_named(symbol)
end
# Handle sections
@@ -562,17 +454,10 @@ module RDoc
def find_attribute_named(name)
@attributes.find {|m| m.name == name}
end
-
- ##
- # Find a named file, or return nil
-
- def find_file_named(name)
- toplevel.class.find_file_named(name)
- end
-
+
end
- ##
+
# A TopLevel context is a source file
class TopLevel < Context
@@ -580,94 +465,68 @@ module RDoc
attr_accessor :file_relative_name
attr_accessor :file_absolute_name
attr_accessor :diagram
-
+
@@all_classes = {}
@@all_modules = {}
- @@all_files = {}
- def self.reset
+ def TopLevel::reset
@@all_classes = {}
@@all_modules = {}
- @@all_files = {}
end
def initialize(file_name)
super()
@name = "TopLevel"
- @file_relative_name = file_name
- @file_absolute_name = file_name
- @file_stat = File.stat(file_name)
- @diagram = nil
- @@all_files[file_name] = self
- end
-
- def file_base_name
- File.basename @file_absolute_name
+ @file_relative_name = file_name
+ @file_absolute_name = file_name
+ @file_stat = File.stat(file_name)
+ @diagram = nil
end
def full_name
nil
end
- ##
- # Adding a class or module to a TopLevel is special, as we only want one
- # copy of a particular top-level class. For example, if both file A and
- # file B implement class C, we only want one ClassModule object for C.
- # This code arranges to share classes and modules between files.
+ # Adding a class or module to a TopLevel is special, as we only
+ # want one copy of a particular top-level class. For example,
+ # if both file A and file B implement class C, we only want one
+ # ClassModule object for C. This code arranges to share
+ # classes and modules between files.
def add_class_or_module(collection, class_type, name, superclass)
cls = collection[name]
-
- if cls then
- cls.superclass = superclass unless cls.module?
- puts "Reusing class/module #{cls.full_name}" if $DEBUG_RDOC
+ if cls
+ puts "Reusing class/module #{name}" if $DEBUG
else
- if class_type == NormalModule then
+ if class_type == NormalModule
all = @@all_modules
else
all = @@all_classes
end
-
cls = all[name]
-
- if !cls then
- cls = class_type.new name, superclass
- all[name] = cls unless @done_documenting
- else
- # If the class has been encountered already, check that its
- # superclass has been set (it may not have been, depending on
- # the context in which it was encountered).
- if class_type == NormalClass
- if !cls.superclass then
- cls.superclass = superclass
- end
- end
+ if !cls
+ cls = class_type.new(name, superclass)
+ all[name] = cls unless @done_documenting
end
-
+ puts "Adding class/module #{name} to #@name" if $DEBUG
collection[name] = cls unless @done_documenting
-
cls.parent = self
end
-
cls
end
- def self.all_classes_and_modules
+ def TopLevel.all_classes_and_modules
@@all_classes.values + @@all_modules.values
end
- def self.find_class_named(name)
+ def TopLevel.find_class_named(name)
@@all_classes.each_value do |c|
- res = c.find_class_named(name)
+ res = c.find_class_named(name)
return res if res
end
nil
end
- def self.find_file_named(name)
- @@all_files[name]
- end
-
def find_local_symbol(symbol)
find_class_or_module_named(symbol) || super
end
@@ -678,30 +537,20 @@ module RDoc
nil
end
- ##
# Find a named module
-
def find_module_named(name)
find_class_or_module_named(name) || find_enclosing_module_named(name)
end
- def inspect
- "#<%s:0x%x %p modules: %p classes: %p>" % [
- self.class, object_id,
- file_base_name,
- @modules.map { |n,m| m },
- @classes.map { |n,c| c }
- ]
- end
end
- ##
- # ClassModule is the base class for objects representing either a class or a
- # module.
+ # ClassModule is the base class for objects representing either a
+ # class or a module.
class ClassModule < Context
+ attr_reader :superclass
attr_accessor :diagram
def initialize(name, superclass = nil)
@@ -712,15 +561,7 @@ module RDoc
super()
end
- def find_class_named(name)
- return self if full_name == name
- @classes.each_value {|c| return c if c.find_class_named(name) }
- nil
- end
-
- ##
# Return the fully qualified name of this class or module
-
def full_name
if @parent && @parent.full_name
@parent.full_name + "::" + @name
@@ -734,123 +575,62 @@ module RDoc
File.join(prefix, *path) + ".html"
end
- ##
- # Does this object represent a module?
-
- def module?
+ # Return +true+ if this object represents a module
+ def is_module?
false
end
- ##
- # Get the superclass of this class. Attempts to retrieve the superclass'
- # real name by following module nesting.
-
- def superclass
- raise NoMethodError, "#{full_name} is a module" if module?
-
- scope = self
-
- begin
- superclass = scope.classes.find { |c| c.name == @superclass }
-
- return superclass.full_name if superclass
- scope = scope.parent
- end until scope.nil? or TopLevel === scope
-
- @superclass
- end
-
- ##
- # Set the superclass of this class
-
- def superclass=(superclass)
- raise NoMethodError, "#{full_name} is a module" if module?
-
- if @superclass.nil? or @superclass == 'Object' then
- @superclass = superclass
- end
- end
-
+ # to_s is simply for debugging
def to_s
- "#{self.class}: #{@name} #{@comment} #{super}"
+ res = self.class.name + ": " + @name
+ res << @comment.to_s
+ res << super
+ res
end
+ def find_class_named(name)
+ return self if full_name == name
+ @classes.each_value {|c| return c if c.find_class_named(name) }
+ nil
+ end
end
- ##
# Anonymous classes
-
class AnonClass < ClassModule
end
- ##
# Normal classes
-
class NormalClass < ClassModule
-
- def inspect
- superclass = @superclass ? " < #{@superclass}" : nil
- "<%s:0x%x class %s%s includes: %p attributes: %p methods: %p aliases: %p>" % [
- self.class, object_id,
- @name, superclass, @includes, @attributes, @method_list, @aliases
- ]
- end
-
end
- ##
# Singleton classes
-
class SingleClass < ClassModule
end
- ##
# Module
-
class NormalModule < ClassModule
-
- def comment=(comment)
- return if comment.empty?
- comment = @comment << "# ---\n" << comment unless @comment.empty?
-
- super
- end
-
- def inspect
- "#<%s:0x%x module %s includes: %p attributes: %p methods: %p aliases: %p>" % [
- self.class, object_id,
- @name, @includes, @attributes, @method_list, @aliases
- ]
- end
-
- def module?
+ def is_module?
true
end
-
end
- ##
+
# AnyMethod is the base class for objects representing methods
class AnyMethod < CodeObject
-
attr_accessor :name
attr_accessor :visibility
attr_accessor :block_params
attr_accessor :dont_rename_initialize
attr_accessor :singleton
- attr_reader :text
-
- # list of other names for this method
- attr_reader :aliases
-
- # method we're aliasing
- attr_accessor :is_alias_for
+ attr_reader :aliases # list of other names for this method
+ attr_accessor :is_alias_for # or a method we're aliasing
attr_overridable :params, :param, :parameters, :parameter
attr_accessor :call_seq
+
include TokenStream
def initialize(text, name)
@@ -871,71 +651,45 @@ module RDoc
@name <=> other.name
end
- def add_alias(method)
- @aliases << method
- end
-
- def inspect
- alias_for = @is_alias_for ? " (alias for #{@is_alias_for.name})" : nil
- "#<%s:0x%x %s%s%s (%s)%s>" % [
- self.class, object_id,
- parent_name,
- singleton ? '::' : '#',
- name,
- visibility,
- alias_for,
- ]
+ def to_s
+ res = self.class.name + ": " + @name + " (" + @text + ")\n"
+ res << @comment.to_s
+ res
end
def param_seq
- params = params.gsub(/\s*\#.*/, '')
- params = params.tr("\n", " ").squeeze(" ")
- params = "(#{params})" unless p[0] == ?(
+ p = params.gsub(/\s*\#.*/, '')
+ p = p.tr("\n", " ").squeeze(" ")
+ p = "(" + p + ")" unless p[0] == ?(
- if block = block_params then # yes, =
- # If this method has explicit block parameters, remove any explicit
- # &block
- params.sub!(/,?\s*&\w+/)
+ if (block = block_params)
+ # If this method has explicit block parameters, remove any
+ # explicit &block
+$stderr.puts p
+ p.sub!(/,?\s*&\w+/)
+$stderr.puts p
block.gsub!(/\s*\#.*/, '')
block = block.tr("\n", " ").squeeze(" ")
if block[0] == ?(
block.sub!(/^\(/, '').sub!(/\)/, '')
end
- params << " { |#{block}| ... }"
+ p << " {|#{block}| ...}"
end
-
- params
+ p
end
- def to_s
- res = self.class.name + ": " + @name + " (" + @text + ")\n"
- res << @comment.to_s
- res
+ def add_alias(method)
+ @aliases << method
end
-
- end
-
- ##
- # GhostMethod represents a method referenced only by a comment
-
- class GhostMethod < AnyMethod
end
- ##
- # MetaMethod represents a meta-programmed method
-
- class MetaMethod < AnyMethod
- end
-
- ##
- # Represent an alias, which is an old_name/ new_name pair associated with a
- # particular context
+ # Represent an alias, which is an old_name/ new_name pair associated
+ # with a particular context
class Alias < CodeObject
-
attr_accessor :text, :old_name, :new_name, :comment
-
+
def initialize(text, old_name, new_name, comment)
super()
@text = text
@@ -944,22 +698,12 @@ module RDoc
self.comment = comment
end
- def inspect
- "#<%s:0x%x %s.alias_method %s, %s>" % [
- self.class, object_id,
- parent.name, @old_name, @new_name,
- ]
- end
-
def to_s
"alias: #{self.old_name} -> #{self.new_name}\n#{self.comment}"
end
-
end
- ##
# Represent a constant
-
class Constant < CodeObject
attr_accessor :name, :value
@@ -971,9 +715,7 @@ module RDoc
end
end
- ##
# Represent attributes
-
class Attr < CodeObject
attr_accessor :text, :name, :rw, :visibility
@@ -986,33 +728,16 @@ module RDoc
self.comment = comment
end
- def <=>(other)
- self.name <=> other.name
- end
-
- def inspect
- attr = case rw
- when 'RW' then :attr_accessor
- when 'R' then :attr_reader
- when 'W' then :attr_writer
- else
- " (#{rw})"
- end
-
- "#<%s:0x%x %s.%s :%s>" % [
- self.class, object_id,
- parent_name, attr, @name,
- ]
- end
-
def to_s
"attr: #{self.name} #{self.rw}\n#{self.comment}"
end
+ def <=>(other)
+ self.name <=> other.name
+ end
end
- ##
- # A required file
+ # a required file
class Require < CodeObject
attr_accessor :name
@@ -1023,37 +748,16 @@ module RDoc
self.comment = comment
end
- def inspect
- "#<%s:0x%x require '%s' in %s>" % [
- self.class,
- object_id,
- @name,
- parent_file_name,
- ]
- end
-
end
- ##
- # An included module
-
+ # an included module
class Include < CodeObject
-
attr_accessor :name
def initialize(name, comment)
super()
@name = name
self.comment = comment
-
- end
-
- def inspect
- "#<%s:0x%x %s.include %s>" % [
- self.class,
- object_id,
- parent_name, @name,
- ]
end
end
diff --git a/lib/rdoc/diagram.rb b/lib/rdoc/diagram.rb
index d308d36dee..9fdc49c02e 100644
--- a/lib/rdoc/diagram.rb
+++ b/lib/rdoc/diagram.rb
@@ -4,11 +4,11 @@
# You must have the V1.7 or later in your path
# http://www.research.att.com/sw/tools/graphviz/
-require 'rdoc/dot'
+require "rdoc/dot/dot"
+require 'rdoc/options'
module RDoc
- ##
# Draw a set of diagrams representing the modules and classes in the
# system. We draw one diagram for each file, and one for each toplevel
# class or module. This means there will be overlap. However, it also
@@ -30,22 +30,20 @@ module RDoc
DOT_PATH = "dot"
- ##
- # Pass in the set of top level objects. The method also creates the
- # subdirectory to hold the images
+ # Pass in the set of top level objects. The method also creates
+ # the subdirectory to hold the images
def initialize(info, options)
@info = info
@options = options
@counter = 0
- FileUtils.mkdir_p(DOT_PATH)
+ File.makedirs(DOT_PATH)
@diagram_cache = {}
end
- ##
- # Draw the diagrams. We traverse the files, drawing a diagram for each. We
- # also traverse each top-level class and module in that file drawing a
- # diagram for these too.
+ # Draw the diagrams. We traverse the files, drawing a diagram for
+ # each. We also traverse each top-level class and module in that
+ # file drawing a diagram for these too.
def draw
unless @options.quiet
@@ -57,26 +55,26 @@ module RDoc
@done_modules = {}
@local_names = find_names(i)
@global_names = []
- @global_graph = graph = DOT::Digraph.new('name' => 'TopLevel',
- 'fontname' => FONT,
- 'fontsize' => '8',
- 'bgcolor' => 'lightcyan1',
- 'compound' => 'true')
-
+ @global_graph = graph = DOT::DOTDigraph.new('name' => 'TopLevel',
+ 'fontname' => FONT,
+ 'fontsize' => '8',
+ 'bgcolor' => 'lightcyan1',
+ 'compound' => 'true')
+
# it's a little hack %) i'm too lazy to create a separate class
# for default node
- graph << DOT::Node.new('name' => 'node',
- 'fontname' => FONT,
- 'color' => 'black',
- 'fontsize' => 8)
-
+ graph << DOT::DOTNode.new('name' => 'node',
+ 'fontname' => FONT,
+ 'color' => 'black',
+ 'fontsize' => 8)
+
i.modules.each do |mod|
draw_module(mod, graph, true, i.file_relative_name)
end
add_classes(i, graph, i.file_relative_name)
i.diagram = convert_to_png("f_#{file_count}", graph)
-
+
# now go through and document each top level class and
# module independently
i.modules.each_with_index do |mod, count|
@@ -84,25 +82,27 @@ module RDoc
@local_names = find_names(mod)
@global_names = []
- @global_graph = graph = DOT::Digraph.new('name' => 'TopLevel',
- 'fontname' => FONT,
- 'fontsize' => '8',
- 'bgcolor' => 'lightcyan1',
- 'compound' => 'true')
+ @global_graph = graph = DOT::DOTDigraph.new('name' => 'TopLevel',
+ 'fontname' => FONT,
+ 'fontsize' => '8',
+ 'bgcolor' => 'lightcyan1',
+ 'compound' => 'true')
- graph << DOT::Node.new('name' => 'node',
- 'fontname' => FONT,
- 'color' => 'black',
- 'fontsize' => 8)
+ graph << DOT::DOTNode.new('name' => 'node',
+ 'fontname' => FONT,
+ 'color' => 'black',
+ 'fontsize' => 8)
draw_module(mod, graph, true)
- mod.diagram = convert_to_png("m_#{file_count}_#{count}",
- graph)
+ mod.diagram = convert_to_png("m_#{file_count}_#{count}",
+ graph)
end
end
$stderr.puts unless @options.quiet
end
+ #######
private
+ #######
def find_names(mod)
return [mod.full_name] + mod.classes.collect{|cl| cl.full_name} +
@@ -127,39 +127,39 @@ module RDoc
@counter += 1
url = mod.http_url("classes")
- m = DOT::Subgraph.new('name' => "cluster_#{mod.full_name.gsub( /:/,'_' )}",
- 'label' => mod.name,
- 'fontname' => FONT,
- 'color' => 'blue',
- 'style' => 'filled',
- 'URL' => %{"#{url}"},
- 'fillcolor' => toplevel ? 'palegreen1' : 'palegreen3')
-
+ m = DOT::DOTSubgraph.new('name' => "cluster_#{mod.full_name.gsub( /:/,'_' )}",
+ 'label' => mod.name,
+ 'fontname' => FONT,
+ 'color' => 'blue',
+ 'style' => 'filled',
+ 'URL' => %{"#{url}"},
+ 'fillcolor' => toplevel ? 'palegreen1' : 'palegreen3')
+
@done_modules[mod.full_name] = m
add_classes(mod, m, file)
graph << m
unless mod.includes.empty?
- mod.includes.each do |inc|
- m_full_name = find_full_name(inc.name, mod)
+ mod.includes.each do |m|
+ m_full_name = find_full_name(m.name, mod)
if @local_names.include?(m_full_name)
- @global_graph << DOT::Edge.new('from' => "#{m_full_name.gsub( /:/,'_' )}",
- 'to' => "#{mod.full_name.gsub( /:/,'_' )}",
- 'ltail' => "cluster_#{m_full_name.gsub( /:/,'_' )}",
- 'lhead' => "cluster_#{mod.full_name.gsub( /:/,'_' )}")
+ @global_graph << DOT::DOTEdge.new('from' => "#{m_full_name.gsub( /:/,'_' )}",
+ 'to' => "#{mod.full_name.gsub( /:/,'_' )}",
+ 'ltail' => "cluster_#{m_full_name.gsub( /:/,'_' )}",
+ 'lhead' => "cluster_#{mod.full_name.gsub( /:/,'_' )}")
else
unless @global_names.include?(m_full_name)
path = m_full_name.split("::")
url = File.join('classes', *path) + ".html"
- @global_graph << DOT::Node.new('name' => "#{m_full_name.gsub( /:/,'_' )}",
- 'shape' => 'box',
- 'label' => "#{m_full_name}",
- 'URL' => %{"#{url}"})
+ @global_graph << DOT::DOTNode.new('name' => "#{m_full_name.gsub( /:/,'_' )}",
+ 'shape' => 'box',
+ 'label' => "#{m_full_name}",
+ 'URL' => %{"#{url}"})
@global_names << m_full_name
end
- @global_graph << DOT::Edge.new('from' => "#{m_full_name.gsub( /:/,'_' )}",
- 'to' => "#{mod.full_name.gsub( /:/,'_' )}",
- 'lhead' => "cluster_#{mod.full_name.gsub( /:/,'_' )}")
+ @global_graph << DOT::DOTEdge.new('from' => "#{m_full_name.gsub( /:/,'_' )}",
+ 'to' => "#{mod.full_name.gsub( /:/,'_' )}",
+ 'lhead' => "cluster_#{mod.full_name.gsub( /:/,'_' )}")
end
end
end
@@ -167,28 +167,27 @@ module RDoc
def add_classes(container, graph, file = nil )
- use_fileboxes = @options.fileboxes
+ use_fileboxes = Options.instance.fileboxes
files = {}
# create dummy node (needed if empty and for module includes)
if container.full_name
- graph << DOT::Node.new('name' => "#{container.full_name.gsub( /:/,'_' )}",
- 'label' => "",
- 'width' => (container.classes.empty? and
- container.modules.empty?) ?
- '0.75' : '0.01',
- 'height' => '0.01',
- 'shape' => 'plaintext')
+ graph << DOT::DOTNode.new('name' => "#{container.full_name.gsub( /:/,'_' )}",
+ 'label' => "",
+ 'width' => (container.classes.empty? and
+ container.modules.empty?) ?
+ '0.75' : '0.01',
+ 'height' => '0.01',
+ 'shape' => 'plaintext')
end
-
container.classes.each_with_index do |cl, cl_index|
last_file = cl.in_files[-1].file_relative_name
if use_fileboxes && !files.include?(last_file)
@counter += 1
files[last_file] =
- DOT::Subgraph.new('name' => "cluster_#{@counter}",
+ DOT::DOTSubgraph.new('name' => "cluster_#{@counter}",
'label' => "#{last_file}",
'fontname' => FONT,
'color'=>
@@ -198,16 +197,16 @@ module RDoc
next if cl.name == 'Object' || cl.name[0,2] == "<<"
url = cl.http_url("classes")
-
+
label = cl.name.dup
if use_fileboxes && cl.in_files.length > 1
- label << '\n[' +
+ label << '\n[' +
cl.in_files.collect {|i|
- i.file_relative_name
+ i.file_relative_name
}.sort.join( '\n' ) +
']'
- end
-
+ end
+
attrs = {
'name' => "#{cl.full_name.gsub( /:/, '_' )}",
'fontcolor' => 'black',
@@ -218,41 +217,41 @@ module RDoc
'URL' => %{"#{url}"}
}
- c = DOT::Node.new(attrs)
-
+ c = DOT::DOTNode.new(attrs)
+
if use_fileboxes
- files[last_file].push c
+ files[last_file].push c
else
graph << c
end
end
-
+
if use_fileboxes
files.each_value do |val|
graph << val
end
end
-
+
unless container.classes.empty?
container.classes.each_with_index do |cl, cl_index|
cl.includes.each do |m|
m_full_name = find_full_name(m.name, cl)
if @local_names.include?(m_full_name)
- @global_graph << DOT::Edge.new('from' => "#{m_full_name.gsub( /:/,'_' )}",
- 'to' => "#{cl.full_name.gsub( /:/,'_' )}",
- 'ltail' => "cluster_#{m_full_name.gsub( /:/,'_' )}")
+ @global_graph << DOT::DOTEdge.new('from' => "#{m_full_name.gsub( /:/,'_' )}",
+ 'to' => "#{cl.full_name.gsub( /:/,'_' )}",
+ 'ltail' => "cluster_#{m_full_name.gsub( /:/,'_' )}")
else
unless @global_names.include?(m_full_name)
path = m_full_name.split("::")
url = File.join('classes', *path) + ".html"
- @global_graph << DOT::Node.new('name' => "#{m_full_name.gsub( /:/,'_' )}",
- 'shape' => 'box',
- 'label' => "#{m_full_name}",
- 'URL' => %{"#{url}"})
+ @global_graph << DOT::DOTNode.new('name' => "#{m_full_name.gsub( /:/,'_' )}",
+ 'shape' => 'box',
+ 'label' => "#{m_full_name}",
+ 'URL' => %{"#{url}"})
@global_names << m_full_name
end
- @global_graph << DOT::Edge.new('from' => "#{m_full_name.gsub( /:/,'_' )}",
- 'to' => "#{cl.full_name.gsub( /:/, '_')}")
+ @global_graph << DOT::DOTEdge.new('from' => "#{m_full_name.gsub( /:/,'_' )}",
+ 'to' => "#{cl.full_name.gsub( /:/, '_')}")
end
end
@@ -262,26 +261,27 @@ module RDoc
unless @local_names.include?(sclass_full_name) or @global_names.include?(sclass_full_name)
path = sclass_full_name.split("::")
url = File.join('classes', *path) + ".html"
- @global_graph << DOT::Node.new('name' => "#{sclass_full_name.gsub( /:/, '_' )}",
- 'label' => sclass_full_name,
- 'URL' => %{"#{url}"})
+ @global_graph << DOT::DOTNode.new(
+ 'name' => "#{sclass_full_name.gsub( /:/, '_' )}",
+ 'label' => sclass_full_name,
+ 'URL' => %{"#{url}"})
@global_names << sclass_full_name
end
- @global_graph << DOT::Edge.new('from' => "#{sclass_full_name.gsub( /:/,'_' )}",
- 'to' => "#{cl.full_name.gsub( /:/, '_')}")
+ @global_graph << DOT::DOTEdge.new('from' => "#{sclass_full_name.gsub( /:/,'_' )}",
+ 'to' => "#{cl.full_name.gsub( /:/, '_')}")
end
end
container.modules.each do |submod|
draw_module(submod, graph)
end
-
+
end
def convert_to_png(file_base, graph)
str = graph.to_s
return @diagram_cache[str] if @diagram_cache[str]
- op_type = @options.image_format
+ op_type = Options.instance.image_format
dotfile = File.join(DOT_PATH, file_base)
src = dotfile + ".dot"
dot = dotfile + "." + op_type
@@ -294,7 +294,7 @@ module RDoc
File.open(src, 'w+' ) do |f|
f << str << "\n"
end
-
+
system "dot", "-T#{op_type}", src, "-o", dot
# Now construct the imagemap wrapper around
@@ -305,36 +305,31 @@ module RDoc
return ret
end
- ##
- # Extract the client-side image map from dot, and use it to generate the
- # imagemap proper. Return the whole <map>..<img> combination, suitable for
- # inclusion on the page
+ # Extract the client-side image map from dot, and use it
+ # to generate the imagemap proper. Return the whole
+ # <map>..<img> combination, suitable for inclusion on
+ # the page
def wrap_in_image_map(src, dot)
- res = ""
+ res = %{<map id="map" name="map">\n}
dot_map = `dot -Tismap #{src}`
-
- if(!dot_map.empty?)
- res << %{<map id="map" name="map">\n}
- dot_map.split($/).each do |area|
- unless area =~ /^rectangle \((\d+),(\d+)\) \((\d+),(\d+)\) ([\/\w.]+)\s*(.*)/
- $stderr.puts "Unexpected output from dot:\n#{area}"
- return nil
- end
-
- xs, ys = [$1.to_i, $3.to_i], [$2.to_i, $4.to_i]
- url, area_name = $5, $6
-
- res << %{ <area shape="rect" coords="#{xs.min},#{ys.min},#{xs.max},#{ys.max}" }
- res << %{ href="#{url}" alt="#{area_name}" />\n}
+ dot_map.each do |area|
+ unless area =~ /^rectangle \((\d+),(\d+)\) \((\d+),(\d+)\) ([\/\w.]+)\s*(.*)/
+ $stderr.puts "Unexpected output from dot:\n#{area}"
+ return nil
end
- res << "</map>\n"
- end
+
+ xs, ys = [$1.to_i, $3.to_i], [$2.to_i, $4.to_i]
+ url, area_name = $5, $6
- res << %{<img src="#{dot}" usemap="#map" alt="#{dot}" />}
+ res << %{ <area shape="rect" coords="#{xs.min},#{ys.min},#{xs.max},#{ys.max}" }
+ res << %{ href="#{url}" alt="#{area_name}" />\n}
+ end
+ res << "</map>\n"
+# map_file = src.sub(/.dot/, '.map')
+# system("dot -Timap #{src} -o #{map_file}")
+ res << %{<img src="#{dot}" usemap="#map" border="0" alt="#{dot}">}
return res
end
-
end
-
end
diff --git a/lib/rdoc/dot.rb b/lib/rdoc/dot.rb
deleted file mode 100644
index fbd2cfba02..0000000000
--- a/lib/rdoc/dot.rb
+++ /dev/null
@@ -1,249 +0,0 @@
-module RDoc; end
-
-module RDoc::DOT
-
- TAB = ' '
- TAB2 = TAB * 2
-
- # options for node declaration
- NODE_OPTS = [
- 'bgcolor',
- 'color',
- 'fontcolor',
- 'fontname',
- 'fontsize',
- 'height',
- 'width',
- 'label',
- 'layer',
- 'rank',
- 'shape',
- 'shapefile',
- 'style',
- 'URL',
- ]
-
- # options for edge declaration
- EDGE_OPTS = [
- 'color',
- 'decorate',
- 'dir',
- 'fontcolor',
- 'fontname',
- 'fontsize',
- 'id',
- 'label',
- 'layer',
- 'lhead',
- 'ltail',
- 'minlen',
- 'style',
- 'weight'
- ]
-
- # options for graph declaration
- GRAPH_OPTS = [
- 'bgcolor',
- 'center',
- 'clusterrank',
- 'color',
- 'compound',
- 'concentrate',
- 'fillcolor',
- 'fontcolor',
- 'fontname',
- 'fontsize',
- 'label',
- 'layerseq',
- 'margin',
- 'mclimit',
- 'nodesep',
- 'nslimit',
- 'ordering',
- 'orientation',
- 'page',
- 'rank',
- 'rankdir',
- 'ranksep',
- 'ratio',
- 'size',
- 'style',
- 'URL'
- ]
-
- # a root class for any element in dot notation
- class SimpleElement
- attr_accessor :name
-
- def initialize( params = {} )
- @label = params['name'] ? params['name'] : ''
- end
-
- def to_s
- @name
- end
- end
-
- # an element that has options ( node, edge or graph )
- class Element < SimpleElement
- #attr_reader :parent
- attr_accessor :name, :options
-
- def initialize( params = {}, option_list = [] )
- super( params )
- @name = params['name'] ? params['name'] : nil
- @parent = params['parent'] ? params['parent'] : nil
- @options = {}
- option_list.each{ |i|
- @options[i] = params[i] if params[i]
- }
- @options['label'] ||= @name if @name != 'node'
- end
-
- def each_option
- @options.each{ |i| yield i }
- end
-
- def each_option_pair
- @options.each_pair{ |key, val| yield key, val }
- end
-
- #def parent=( thing )
- # @parent.delete( self ) if defined?( @parent ) and @parent
- # @parent = thing
- #end
- end
-
-
- # this is used when we build nodes that have shape=record
- # ports don't have options :)
- class Port < SimpleElement
- attr_accessor :label
-
- def initialize( params = {} )
- super( params )
- @name = params['label'] ? params['label'] : ''
- end
- def to_s
- ( @name && @name != "" ? "<#{@name}>" : "" ) + "#{@label}"
- end
- end
-
- # node element
- class Node < Element
-
- def initialize( params = {}, option_list = NODE_OPTS )
- super( params, option_list )
- @ports = params['ports'] ? params['ports'] : []
- end
-
- def each_port
- @ports.each{ |i| yield i }
- end
-
- def << ( thing )
- @ports << thing
- end
-
- def push ( thing )
- @ports.push( thing )
- end
-
- def pop
- @ports.pop
- end
-
- def to_s( t = '' )
-
- label = @options['shape'] != 'record' && @ports.length == 0 ?
- @options['label'] ?
- t + TAB + "label = \"#{@options['label']}\"\n" :
- '' :
- t + TAB + 'label = "' + " \\\n" +
- t + TAB2 + "#{@options['label']}| \\\n" +
- @ports.collect{ |i|
- t + TAB2 + i.to_s
- }.join( "| \\\n" ) + " \\\n" +
- t + TAB + '"' + "\n"
-
- t + "#{@name} [\n" +
- @options.to_a.collect{ |i|
- i[1] && i[0] != 'label' ?
- t + TAB + "#{i[0]} = #{i[1]}" : nil
- }.compact.join( ",\n" ) + ( label != '' ? ",\n" : "\n" ) +
- label +
- t + "]\n"
- end
- end
-
- # subgraph element is the same to graph, but has another header in dot
- # notation
- class Subgraph < Element
-
- def initialize( params = {}, option_list = GRAPH_OPTS )
- super( params, option_list )
- @nodes = params['nodes'] ? params['nodes'] : []
- @dot_string = 'subgraph'
- end
-
- def each_node
- @nodes.each{ |i| yield i }
- end
-
- def << ( thing )
- @nodes << thing
- end
-
- def push( thing )
- @nodes.push( thing )
- end
-
- def pop
- @nodes.pop
- end
-
- def to_s( t = '' )
- hdr = t + "#{@dot_string} #{@name} {\n"
-
- options = @options.to_a.collect{ |name, val|
- val && name != 'label' ?
- t + TAB + "#{name} = #{val}" :
- name ? t + TAB + "#{name} = \"#{val}\"" : nil
- }.compact.join( "\n" ) + "\n"
-
- nodes = @nodes.collect{ |i|
- i.to_s( t + TAB )
- }.join( "\n" ) + "\n"
- hdr + options + nodes + t + "}\n"
- end
- end
-
- # this is graph
- class Digraph < Subgraph
- def initialize( params = {}, option_list = GRAPH_OPTS )
- super( params, option_list )
- @dot_string = 'digraph'
- end
- end
-
- # this is edge
- class Edge < Element
- attr_accessor :from, :to
- def initialize( params = {}, option_list = EDGE_OPTS )
- super( params, option_list )
- @from = params['from'] ? params['from'] : nil
- @to = params['to'] ? params['to'] : nil
- end
-
- def to_s( t = '' )
- t + "#{@from} -> #{to} [\n" +
- @options.to_a.collect{ |i|
- i[1] && i[0] != 'label' ?
- t + TAB + "#{i[0]} = #{i[1]}" :
- i[1] ? t + TAB + "#{i[0]} = \"#{i[1]}\"" : nil
- }.compact.join( "\n" ) + "\n" + t + "]\n"
- end
- end
-
-end
-
diff --git a/lib/rdoc/dot/dot.rb b/lib/rdoc/dot/dot.rb
new file mode 100644
index 0000000000..6dbb7cb237
--- /dev/null
+++ b/lib/rdoc/dot/dot.rb
@@ -0,0 +1,255 @@
+module DOT
+
+ # these glogal vars are used to make nice graph source
+ $tab = ' '
+ $tab2 = $tab * 2
+
+ # if we don't like 4 spaces, we can change it any time
+ def change_tab( t )
+ $tab = t
+ $tab2 = t * 2
+ end
+
+ # options for node declaration
+ NODE_OPTS = [
+ 'bgcolor',
+ 'color',
+ 'fontcolor',
+ 'fontname',
+ 'fontsize',
+ 'height',
+ 'width',
+ 'label',
+ 'layer',
+ 'rank',
+ 'shape',
+ 'shapefile',
+ 'style',
+ 'URL',
+ ]
+
+ # options for edge declaration
+ EDGE_OPTS = [
+ 'color',
+ 'decorate',
+ 'dir',
+ 'fontcolor',
+ 'fontname',
+ 'fontsize',
+ 'id',
+ 'label',
+ 'layer',
+ 'lhead',
+ 'ltail',
+ 'minlen',
+ 'style',
+ 'weight'
+ ]
+
+ # options for graph declaration
+ GRAPH_OPTS = [
+ 'bgcolor',
+ 'center',
+ 'clusterrank',
+ 'color',
+ 'compound',
+ 'concentrate',
+ 'fillcolor',
+ 'fontcolor',
+ 'fontname',
+ 'fontsize',
+ 'label',
+ 'layerseq',
+ 'margin',
+ 'mclimit',
+ 'nodesep',
+ 'nslimit',
+ 'ordering',
+ 'orientation',
+ 'page',
+ 'rank',
+ 'rankdir',
+ 'ranksep',
+ 'ratio',
+ 'size',
+ 'style',
+ 'URL'
+ ]
+
+ # a root class for any element in dot notation
+ class DOTSimpleElement
+ attr_accessor :name
+
+ def initialize( params = {} )
+ @label = params['name'] ? params['name'] : ''
+ end
+
+ def to_s
+ @name
+ end
+ end
+
+ # an element that has options ( node, edge or graph )
+ class DOTElement < DOTSimpleElement
+ #attr_reader :parent
+ attr_accessor :name, :options
+
+ def initialize( params = {}, option_list = [] )
+ super( params )
+ @name = params['name'] ? params['name'] : nil
+ @parent = params['parent'] ? params['parent'] : nil
+ @options = {}
+ option_list.each{ |i|
+ @options[i] = params[i] if params[i]
+ }
+ @options['label'] ||= @name if @name != 'node'
+ end
+
+ def each_option
+ @options.each{ |i| yield i }
+ end
+
+ def each_option_pair
+ @options.each_pair{ |key, val| yield key, val }
+ end
+
+ #def parent=( thing )
+ # @parent.delete( self ) if defined?( @parent ) and @parent
+ # @parent = thing
+ #end
+ end
+
+
+ # this is used when we build nodes that have shape=record
+ # ports don't have options :)
+ class DOTPort < DOTSimpleElement
+ attr_accessor :label
+
+ def initialize( params = {} )
+ super( params )
+ @name = params['label'] ? params['label'] : ''
+ end
+ def to_s
+ ( @name && @name != "" ? "<#{@name}>" : "" ) + "#{@label}"
+ end
+ end
+
+ # node element
+ class DOTNode < DOTElement
+
+ def initialize( params = {}, option_list = NODE_OPTS )
+ super( params, option_list )
+ @ports = params['ports'] ? params['ports'] : []
+ end
+
+ def each_port
+ @ports.each{ |i| yield i }
+ end
+
+ def << ( thing )
+ @ports << thing
+ end
+
+ def push ( thing )
+ @ports.push( thing )
+ end
+
+ def pop
+ @ports.pop
+ end
+
+ def to_s( t = '' )
+
+ label = @options['shape'] != 'record' && @ports.length == 0 ?
+ @options['label'] ?
+ t + $tab + "label = \"#{@options['label']}\"\n" :
+ '' :
+ t + $tab + 'label = "' + " \\\n" +
+ t + $tab2 + "#{@options['label']}| \\\n" +
+ @ports.collect{ |i|
+ t + $tab2 + i.to_s
+ }.join( "| \\\n" ) + " \\\n" +
+ t + $tab + '"' + "\n"
+
+ t + "#{@name} [\n" +
+ @options.to_a.collect{ |i|
+ i[1] && i[0] != 'label' ?
+ t + $tab + "#{i[0]} = #{i[1]}" : nil
+ }.compact.join( ",\n" ) + ( label != '' ? ",\n" : "\n" ) +
+ label +
+ t + "]\n"
+ end
+ end
+
+ # subgraph element is the same to graph, but has another header in dot
+ # notation
+ class DOTSubgraph < DOTElement
+
+ def initialize( params = {}, option_list = GRAPH_OPTS )
+ super( params, option_list )
+ @nodes = params['nodes'] ? params['nodes'] : []
+ @dot_string = 'subgraph'
+ end
+
+ def each_node
+ @nodes.each{ |i| yield i }
+ end
+
+ def << ( thing )
+ @nodes << thing
+ end
+
+ def push( thing )
+ @nodes.push( thing )
+ end
+
+ def pop
+ @nodes.pop
+ end
+
+ def to_s( t = '' )
+ hdr = t + "#{@dot_string} #{@name} {\n"
+
+ options = @options.to_a.collect{ |name, val|
+ val && name != 'label' ?
+ t + $tab + "#{name} = #{val}" :
+ name ? t + $tab + "#{name} = \"#{val}\"" : nil
+ }.compact.join( "\n" ) + "\n"
+
+ nodes = @nodes.collect{ |i|
+ i.to_s( t + $tab )
+ }.join( "\n" ) + "\n"
+ hdr + options + nodes + t + "}\n"
+ end
+ end
+
+ # this is graph
+ class DOTDigraph < DOTSubgraph
+ def initialize( params = {}, option_list = GRAPH_OPTS )
+ super( params, option_list )
+ @dot_string = 'digraph'
+ end
+ end
+
+ # this is edge
+ class DOTEdge < DOTElement
+ attr_accessor :from, :to
+ def initialize( params = {}, option_list = EDGE_OPTS )
+ super( params, option_list )
+ @from = params['from'] ? params['from'] : nil
+ @to = params['to'] ? params['to'] : nil
+ end
+
+ def to_s( t = '' )
+ t + "#{@from} -> #{to} [\n" +
+ @options.to_a.collect{ |i|
+ i[1] && i[0] != 'label' ?
+ t + $tab + "#{i[0]} = #{i[1]}" :
+ i[1] ? t + $tab + "#{i[0]} = \"#{i[1]}\"" : nil
+ }.compact.join( "\n" ) + "\n" + t + "]\n"
+ end
+ end
+end
+
+
+
diff --git a/lib/rdoc/generator.rb b/lib/rdoc/generator.rb
deleted file mode 100644
index 86196b4cf6..0000000000
--- a/lib/rdoc/generator.rb
+++ /dev/null
@@ -1,1082 +0,0 @@
-require 'cgi'
-require 'rdoc'
-require 'rdoc/options'
-require 'rdoc/markup/to_html_crossref'
-require 'rdoc/template'
-
-module RDoc::Generator
-
- ##
- # Name of sub-directory that holds file descriptions
-
- FILE_DIR = "files"
-
- ##
- # Name of sub-directory that holds class descriptions
-
- CLASS_DIR = "classes"
-
- ##
- # Name of the RDoc CSS file
-
- CSS_NAME = "rdoc-style.css"
-
- ##
- # Build a hash of all items that can be cross-referenced. This is used when
- # we output required and included names: if the names appear in this hash,
- # we can generate an html cross reference to the appropriate description.
- # We also use this when parsing comment blocks: any decorated words matching
- # an entry in this list are hyperlinked.
-
- class AllReferences
- @@refs = {}
-
- def AllReferences::reset
- @@refs = {}
- end
-
- def AllReferences.add(name, html_class)
- @@refs[name] = html_class
- end
-
- def AllReferences.[](name)
- @@refs[name]
- end
-
- def AllReferences.keys
- @@refs.keys
- end
- end
-
- ##
- # Handle common markup tasks for the various Context subclasses
-
- module MarkUp
-
- ##
- # Convert a string in markup format into HTML.
-
- def markup(str, remove_para = false)
- return '' unless str
-
- # Convert leading comment markers to spaces, but only if all non-blank
- # lines have them
- if str =~ /^(?>\s*)[^\#]/ then
- content = str
- else
- content = str.gsub(/^\s*(#+)/) { $1.tr '#', ' ' }
- end
-
- res = formatter.convert content
-
- if remove_para then
- res.sub!(/^<p>/, '')
- res.sub!(/<\/p>$/, '')
- end
-
- res
- end
-
- ##
- # Qualify a stylesheet URL; if if +css_name+ does not begin with '/' or
- # 'http[s]://', prepend a prefix relative to +path+. Otherwise, return it
- # unmodified.
-
- def style_url(path, css_name=nil)
-# $stderr.puts "style_url( #{path.inspect}, #{css_name.inspect} )"
- css_name ||= CSS_NAME
- if %r{^(https?:/)?/} =~ css_name
- css_name
- else
- RDoc::Markup::ToHtml.gen_relative_url path, css_name
- end
- end
-
- ##
- # Build a webcvs URL with the given 'url' argument. URLs with a '%s' in them
- # get the file's path sprintfed into them; otherwise they're just catenated
- # together.
-
- def cvs_url(url, full_path)
- if /%s/ =~ url
- return sprintf( url, full_path )
- else
- return url + full_path
- end
- end
-
- end
-
- ##
- # A Context is built by the parser to represent a container: contexts hold
- # classes, modules, methods, require lists and include lists. ClassModule
- # and TopLevel are the context objects we process here
-
- class Context
-
- include MarkUp
-
- attr_reader :context
-
- ##
- # Generate:
- #
- # * a list of RDoc::Generator::File objects for each TopLevel object
- # * a list of RDoc::Generator::Class objects for each first level class or
- # module in the TopLevel objects
- # * a complete list of all hyperlinkable terms (file, class, module, and
- # method names)
-
- def self.build_indices(toplevels, options)
- files = []
- classes = []
-
- toplevels.each do |toplevel|
- files << RDoc::Generator::File.new(toplevel, options,
- RDoc::Generator::FILE_DIR)
- end
-
- RDoc::TopLevel.all_classes_and_modules.each do |cls|
- build_class_list(classes, options, cls, files[0],
- RDoc::Generator::CLASS_DIR)
- end
-
- return files, classes
- end
-
- def self.build_class_list(classes, options, from, html_file, class_dir)
- classes << RDoc::Generator::Class.new(from, html_file, class_dir, options)
-
- from.each_classmodule do |mod|
- build_class_list(classes, options, mod, html_file, class_dir)
- end
- end
-
- def initialize(context, options)
- @context = context
- @options = options
-
- # HACK ugly
- @template = options.template_class
- end
-
- def formatter
- @formatter ||= @options.formatter ||
- RDoc::Markup::ToHtmlCrossref.new(path, self, @options.show_hash)
- end
-
- ##
- # convenience method to build a hyperlink
-
- def href(link, cls, name)
- %{<a href="#{link}" class="#{cls}">#{name}</a>} #"
- end
-
- ##
- # Returns a reference to outselves to be used as an href= the form depends
- # on whether we're all in one file or in multiple files
-
- def as_href(from_path)
- if @options.all_one_file
- "#" + path
- else
- RDoc::Markup::ToHtml.gen_relative_url from_path, path
- end
- end
-
- ##
- # Create a list of Method objects for each method in the corresponding
- # context object. If the @options.show_all variable is set (corresponding
- # to the <tt>--all</tt> option, we include all methods, otherwise just the
- # public ones.
-
- def collect_methods
- list = @context.method_list
-
- unless @options.show_all then
- list = list.select do |m|
- m.visibility == :public or
- m.visibility == :protected or
- m.force_documentation
- end
- end
-
- @methods = list.collect do |m|
- RDoc::Generator::Method.new m, self, @options
- end
- end
-
- ##
- # Build a summary list of all the methods in this context
-
- def build_method_summary_list(path_prefix = "")
- collect_methods unless @methods
-
- @methods.sort.map do |meth|
- {
- "name" => CGI.escapeHTML(meth.name),
- "aref" => "##{meth.aref}"
- }
- end
- end
-
- ##
- # Build a list of aliases for which we couldn't find a
- # corresponding method
-
- def build_alias_summary_list(section)
- @context.aliases.map do |al|
- next unless al.section == section
-
- res = {
- 'old_name' => al.old_name,
- 'new_name' => al.new_name,
- }
-
- if al.comment and not al.comment.empty? then
- res['desc'] = markup al.comment, true
- end
-
- res
- end.compact
- end
-
- ##
- # Build a list of constants
-
- def build_constants_summary_list(section)
- @context.constants.map do |co|
- next unless co.section == section
-
- res = {
- 'name' => co.name,
- 'value' => CGI.escapeHTML(co.value)
- }
-
- if co.comment and not co.comment.empty? then
- res['desc'] = markup co.comment, true
- end
-
- res
- end.compact
- end
-
- def build_requires_list(context)
- potentially_referenced_list(context.requires) {|fn| [fn + ".rb"] }
- end
-
- def build_include_list(context)
- potentially_referenced_list(context.includes)
- end
-
- ##
- # Build a list from an array of Context items. Look up each in the
- # AllReferences hash: if we find a corresponding entry, we generate a
- # hyperlink to it, otherwise just output the name. However, some names
- # potentially need massaging. For example, you may require a Ruby file
- # without the .rb extension, but the file names we know about may have it.
- # To deal with this, we pass in a block which performs the massaging,
- # returning an array of alternative names to match
-
- def potentially_referenced_list(array)
- res = []
- array.each do |i|
- ref = AllReferences[i.name]
-# if !ref
-# container = @context.parent
-# while !ref && container
-# name = container.name + "::" + i.name
-# ref = AllReferences[name]
-# container = container.parent
-# end
-# end
-
- ref = @context.find_symbol(i.name)
- ref = ref.viewer if ref
-
- if !ref && block_given?
- possibles = yield(i.name)
- while !ref and !possibles.empty?
- ref = AllReferences[possibles.shift]
- end
- end
- h_name = CGI.escapeHTML(i.name)
- if ref and ref.document_self
- path = url(ref.path)
- res << { "name" => h_name, "aref" => path }
- else
- res << { "name" => h_name }
- end
- end
- res
- end
-
- ##
- # Build an array of arrays of method details. The outer array has up
- # to six entries, public, private, and protected for both class
- # methods, the other for instance methods. The inner arrays contain
- # a hash for each method
-
- def build_method_detail_list(section)
- outer = []
-
- methods = @methods.sort.select do |m|
- m.document_self and m.section == section
- end
-
- for singleton in [true, false]
- for vis in [ :public, :protected, :private ]
- res = []
- methods.each do |m|
- next unless m.visibility == vis and m.singleton == singleton
-
- row = {}
-
- if m.call_seq then
- row["callseq"] = m.call_seq.gsub(/->/, '&rarr;')
- else
- row["name"] = CGI.escapeHTML(m.name)
- row["params"] = m.params
- end
-
- desc = m.description.strip
- row["m_desc"] = desc unless desc.empty?
- row["aref"] = m.aref
- row["visibility"] = m.visibility.to_s
-
- alias_names = []
-
- m.aliases.each do |other|
- if other.viewer then # won't be if the alias is private
- alias_names << {
- 'name' => other.name,
- 'aref' => other.viewer.as_href(path)
- }
- end
- end
-
- row["aka"] = alias_names unless alias_names.empty?
-
- if @options.inline_source then
- code = m.source_code
- row["sourcecode"] = code if code
- else
- code = m.src_url
- if code then
- row["codeurl"] = code
- row["imgurl"] = m.img_url
- end
- end
-
- res << row
- end
-
- if res.size > 0 then
- outer << {
- "type" => vis.to_s.capitalize,
- "category" => singleton ? "Class" : "Instance",
- "methods" => res
- }
- end
- end
- end
-
- outer
- end
-
- ##
- # Build the structured list of classes and modules contained
- # in this context.
-
- def build_class_list(level, from, section, infile=nil)
- prefix = '&nbsp;&nbsp;::' * level;
- res = ''
-
- from.modules.sort.each do |mod|
- next unless mod.section == section
- next if infile && !mod.defined_in?(infile)
- if mod.document_self
- res <<
- prefix <<
- 'Module ' <<
- href(url(mod.viewer.path), 'link', mod.full_name) <<
- "<br />\n" <<
- build_class_list(level + 1, mod, section, infile)
- end
- end
-
- from.classes.sort.each do |cls|
- next unless cls.section == section
- next if infile and not cls.defined_in?(infile)
-
- if cls.document_self
- res <<
- prefix <<
- 'Class ' <<
- href(url(cls.viewer.path), 'link', cls.full_name) <<
- "<br />\n" <<
- build_class_list(level + 1, cls, section, infile)
- end
- end
-
- res
- end
-
- def url(target)
- RDoc::Markup::ToHtml.gen_relative_url path, target
- end
-
- def aref_to(target)
- if @options.all_one_file
- "#" + target
- else
- url(target)
- end
- end
-
- def document_self
- @context.document_self
- end
-
- def diagram_reference(diagram)
- res = diagram.gsub(/((?:src|href)=")(.*?)"/) {
- $1 + url($2) + '"'
- }
- res
- end
-
- ##
- # Find a symbol in ourselves or our parent
-
- def find_symbol(symbol, method=nil)
- res = @context.find_symbol(symbol, method)
- if res
- res = res.viewer
- end
- res
- end
-
- ##
- # create table of contents if we contain sections
-
- def add_table_of_sections
- toc = []
- @context.sections.each do |section|
- if section.title then
- toc << {
- 'secname' => section.title,
- 'href' => section.sequence
- }
- end
- end
-
- @values['toc'] = toc unless toc.empty?
- end
-
- end
-
- ##
- # Wrap a ClassModule context
-
- class Class < Context
-
- attr_reader :methods
- attr_reader :path
- attr_reader :values
-
- def initialize(context, html_file, prefix, options)
- super context, options
-
- @html_file = html_file
- @html_class = self
- @is_module = context.module?
- @values = {}
-
- context.viewer = self
-
- if options.all_one_file
- @path = context.full_name
- else
- @path = http_url(context.full_name, prefix)
- end
-
- collect_methods
-
- AllReferences.add(name, self)
- end
-
- ##
- # Returns the relative file name to store this class in, which is also its
- # url
-
- def http_url(full_name, prefix)
- path = full_name.dup
-
- path.gsub!(/<<\s*(\w*)/, 'from-\1') if path['<<']
-
- ::File.join(prefix, path.split("::")) + ".html"
- end
-
- def name
- @context.full_name
- end
-
- def parent_name
- @context.parent.full_name
- end
-
- def index_name
- name
- end
-
- def write_on(f, file_list, class_list, method_list, overrides = {})
- value_hash
-
- @values['file_list'] = file_list
- @values['class_list'] = class_list
- @values['method_list'] = method_list
-
- @values.update overrides
-
- template = RDoc::TemplatePage.new(@template::BODY,
- @template::CLASS_PAGE,
- @template::METHOD_LIST)
-
- template.write_html_on(f, @values)
- end
-
- def value_hash
- class_attribute_values
- add_table_of_sections
-
- @values["charset"] = @options.charset
- @values["style_url"] = style_url(path, @options.css)
-
- d = markup(@context.comment)
- @values["description"] = d unless d.empty?
-
- ml = build_method_summary_list @path
- @values["methods"] = ml unless ml.empty?
-
- il = build_include_list @context
- @values["includes"] = il unless il.empty?
-
- @values["sections"] = @context.sections.map do |section|
- secdata = {
- "sectitle" => section.title,
- "secsequence" => section.sequence,
- "seccomment" => markup(section.comment),
- }
-
- al = build_alias_summary_list section
- secdata["aliases"] = al unless al.empty?
-
- co = build_constants_summary_list section
- secdata["constants"] = co unless co.empty?
-
- al = build_attribute_list section
- secdata["attributes"] = al unless al.empty?
-
- cl = build_class_list 0, @context, section
- secdata["classlist"] = cl unless cl.empty?
-
- mdl = build_method_detail_list section
- secdata["method_list"] = mdl unless mdl.empty?
-
- secdata
- end
-
- @values
- end
-
- def build_attribute_list(section)
- @context.attributes.sort.map do |att|
- next unless att.section == section
-
- if att.visibility == :public or att.visibility == :protected or
- @options.show_all then
-
- entry = {
- "name" => CGI.escapeHTML(att.name),
- "rw" => att.rw,
- "a_desc" => markup(att.comment, true)
- }
-
- unless att.visibility == :public or att.visibility == :protected then
- entry["rw"] << "-"
- end
-
- entry
- end
- end.compact
- end
-
- def class_attribute_values
- h_name = CGI.escapeHTML(name)
-
- @values["href"] = @path
- @values["classmod"] = @is_module ? "Module" : "Class"
- @values["title"] = "#{@values['classmod']}: #{h_name} [#{@options.title}]"
-
- c = @context
- c = c.parent while c and not c.diagram
-
- if c and c.diagram then
- @values["diagram"] = diagram_reference(c.diagram)
- end
-
- @values["full_name"] = h_name
-
- if not @context.module? and @context.superclass then
- parent_class = @context.superclass
- @values["parent"] = CGI.escapeHTML(parent_class)
-
- if parent_name
- lookup = parent_name + "::" + parent_class
- else
- lookup = parent_class
- end
-
- parent_url = AllReferences[lookup] || AllReferences[parent_class]
-
- if parent_url and parent_url.document_self
- @values["par_url"] = aref_to(parent_url.path)
- end
- end
-
- files = []
- @context.in_files.each do |f|
- res = {}
- full_path = CGI.escapeHTML(f.file_absolute_name)
-
- res["full_path"] = full_path
- res["full_path_url"] = aref_to(f.viewer.path) if f.document_self
-
- if @options.webcvs
- res["cvsurl"] = cvs_url( @options.webcvs, full_path )
- end
-
- files << res
- end
-
- @values['infiles'] = files
- end
-
- def <=>(other)
- self.name <=> other.name
- end
-
- end
-
- ##
- # Handles the mapping of a file's information to HTML. In reality, a file
- # corresponds to a +TopLevel+ object, containing modules, classes, and
- # top-level methods. In theory it _could_ contain attributes and aliases,
- # but we ignore these for now.
-
- class File < Context
-
- attr_reader :path
- attr_reader :name
- attr_reader :values
-
- def initialize(context, options, file_dir)
- super context, options
-
- @values = {}
-
- if options.all_one_file
- @path = filename_to_label
- else
- @path = http_url(file_dir)
- end
-
- @name = @context.file_relative_name
-
- collect_methods
- AllReferences.add(name, self)
- context.viewer = self
- end
-
- def http_url(file_dir)
- ::File.join file_dir, "#{@context.file_relative_name.tr '.', '_'}.html"
- end
-
- def filename_to_label
- @context.file_relative_name.gsub(/%|\/|\?|\#/) do
- ('%%%x' % $&[0]).unpack('C')
- end
- end
-
- def index_name
- name
- end
-
- def parent_name
- nil
- end
-
- def value_hash
- file_attribute_values
- add_table_of_sections
-
- @values["charset"] = @options.charset
- @values["href"] = path
- @values["style_url"] = style_url(path, @options.css)
-
- if @context.comment
- d = markup(@context.comment)
- @values["description"] = d if d.size > 0
- end
-
- ml = build_method_summary_list
- @values["methods"] = ml unless ml.empty?
-
- il = build_include_list(@context)
- @values["includes"] = il unless il.empty?
-
- rl = build_requires_list(@context)
- @values["requires"] = rl unless rl.empty?
-
- if @options.promiscuous
- file_context = nil
- else
- file_context = @context
- end
-
-
- @values["sections"] = @context.sections.map do |section|
-
- secdata = {
- "sectitle" => section.title,
- "secsequence" => section.sequence,
- "seccomment" => markup(section.comment)
- }
-
- cl = build_class_list(0, @context, section, file_context)
- secdata["classlist"] = cl unless cl.empty?
-
- mdl = build_method_detail_list(section)
- secdata["method_list"] = mdl unless mdl.empty?
-
- al = build_alias_summary_list(section)
- secdata["aliases"] = al unless al.empty?
-
- co = build_constants_summary_list(section)
- secdata["constants"] = co unless co.empty?
-
- secdata
- end
-
- @values
- end
-
- def write_on(f, file_list, class_list, method_list, overrides = {})
- value_hash
-
- @values['file_list'] = file_list
- @values['class_list'] = class_list
- @values['method_list'] = method_list
-
- @values.update overrides
-
- template = RDoc::TemplatePage.new(@template::BODY,
- @template::FILE_PAGE,
- @template::METHOD_LIST)
-
- template.write_html_on(f, @values)
- end
-
- def file_attribute_values
- full_path = @context.file_absolute_name
- short_name = ::File.basename full_path
-
- @values["title"] = CGI.escapeHTML("File: #{short_name} [#{@options.title}]")
-
- if @context.diagram then
- @values["diagram"] = diagram_reference(@context.diagram)
- end
-
- @values["short_name"] = CGI.escapeHTML(short_name)
- @values["full_path"] = CGI.escapeHTML(full_path)
- @values["dtm_modified"] = @context.file_stat.mtime.to_s
-
- if @options.webcvs then
- @values["cvsurl"] = cvs_url @options.webcvs, @values["full_path"]
- end
- end
-
- def <=>(other)
- self.name <=> other.name
- end
-
- end
-
- class Method
-
- include MarkUp
-
- attr_reader :context
- attr_reader :src_url
- attr_reader :img_url
- attr_reader :source_code
-
- def self.all_methods
- @@all_methods
- end
-
- def self.reset
- @@all_methods = []
- @@seq = "M000000"
- end
-
- # Initialize the class variables.
- self.reset
-
- def initialize(context, html_class, options)
- # TODO: rethink the class hierarchy here...
- @context = context
- @html_class = html_class
- @options = options
-
- @@seq = @@seq.succ
- @seq = @@seq
-
- # HACK ugly
- @template = options.template_class
-
- @@all_methods << self
-
- context.viewer = self
-
- if (ts = @context.token_stream)
- @source_code = markup_code(ts)
- unless @options.inline_source
- @src_url = create_source_code_file(@source_code)
- @img_url = RDoc::Markup::ToHtml.gen_relative_url path, 'source.png'
- end
- end
-
- AllReferences.add(name, self)
- end
-
- ##
- # Returns a reference to outselves to be used as an href= the form depends
- # on whether we're all in one file or in multiple files
-
- def as_href(from_path)
- if @options.all_one_file
- "#" + path
- else
- RDoc::Markup::ToHtml.gen_relative_url from_path, path
- end
- end
-
- def formatter
- @formatter ||= @options.formatter ||
- RDoc::Markup::ToHtmlCrossref.new(path, self, @options.show_hash)
- end
-
- def inspect
- alias_for = if @context.is_alias_for then
- " (alias_for #{@context.is_alias_for})"
- else
- nil
- end
-
- "#<%s:0x%x %s%s%s (%s)%s>" % [
- self.class, object_id,
- @context.parent.name,
- @context.singleton ? '::' : '#',
- name,
- @context.visibility,
- alias_for
- ]
- end
-
- def name
- @context.name
- end
-
- def section
- @context.section
- end
-
- def index_name
- "#{@context.name} (#{@html_class.name})"
- end
-
- def parent_name
- if @context.parent.parent
- @context.parent.parent.full_name
- else
- nil
- end
- end
-
- def aref
- @seq
- end
-
- def path
- if @options.all_one_file
- aref
- else
- @html_class.path + "#" + aref
- end
- end
-
- def description
- markup(@context.comment)
- end
-
- def visibility
- @context.visibility
- end
-
- def singleton
- @context.singleton
- end
-
- def call_seq
- cs = @context.call_seq
- if cs
- cs.gsub(/\n/, "<br />\n")
- else
- nil
- end
- end
-
- def params
- # params coming from a call-seq in 'C' will start with the
- # method name
- params = @context.params
- if params !~ /^\w/
- params = @context.params.gsub(/\s*\#.*/, '')
- params = params.tr("\n", " ").squeeze(" ")
- params = "(" + params + ")" unless params[0] == ?(
-
- if (block = @context.block_params)
- # If this method has explicit block parameters, remove any
- # explicit &block
-
- params.sub!(/,?\s*&\w+/, '')
-
- block.gsub!(/\s*\#.*/, '')
- block = block.tr("\n", " ").squeeze(" ")
- if block[0] == ?(
- block.sub!(/^\(/, '').sub!(/\)/, '')
- end
- params << " {|#{block.strip}| ...}"
- end
- end
- CGI.escapeHTML(params)
- end
-
- def create_source_code_file(code_body)
- meth_path = @html_class.path.sub(/\.html$/, '.src')
- FileUtils.mkdir_p(meth_path)
- file_path = ::File.join meth_path, "#{@seq}.html"
-
- template = RDoc::TemplatePage.new(@template::SRC_PAGE)
-
- open file_path, 'w' do |f|
- values = {
- 'title' => CGI.escapeHTML(index_name),
- 'code' => code_body,
- 'style_url' => style_url(file_path, @options.css),
- 'charset' => @options.charset
- }
- template.write_html_on(f, values)
- end
-
- RDoc::Markup::ToHtml.gen_relative_url path, file_path
- end
-
- def <=>(other)
- @context <=> other.context
- end
-
- ##
- # Given a sequence of source tokens, mark up the source code
- # to make it look purty.
-
- def markup_code(tokens)
- src = ""
- tokens.each do |t|
- next unless t
-# style = STYLE_MAP[t.class]
- style = case t
- when RDoc::RubyToken::TkCONSTANT then "ruby-constant"
- when RDoc::RubyToken::TkKW then "ruby-keyword kw"
- when RDoc::RubyToken::TkIVAR then "ruby-ivar"
- when RDoc::RubyToken::TkOp then "ruby-operator"
- when RDoc::RubyToken::TkId then "ruby-identifier"
- when RDoc::RubyToken::TkNode then "ruby-node"
- when RDoc::RubyToken::TkCOMMENT then "ruby-comment cmt"
- when RDoc::RubyToken::TkREGEXP then "ruby-regexp re"
- when RDoc::RubyToken::TkSTRING then "ruby-value str"
- when RDoc::RubyToken::TkVal then "ruby-value"
- else
- nil
- end
-
- text = CGI.escapeHTML(t.text)
-
- if style
- src << "<span class=\"#{style}\">#{text}</span>"
- else
- src << text
- end
- end
-
- add_line_numbers(src) if @options.include_line_numbers
- src
- end
-
- ##
- # We rely on the fact that the first line of a source code listing has
- # # File xxxxx, line dddd
-
- def add_line_numbers(src)
- if src =~ /\A.*, line (\d+)/
- first = $1.to_i - 1
- last = first + src.count("\n")
- size = last.to_s.length
- fmt = "%#{size}d: "
- is_first_line = true
- line_num = first
- src.gsub!(/^/) do
- if is_first_line then
- is_first_line = false
- res = " " * (size+2)
- else
- res = sprintf(fmt, line_num)
- end
-
- line_num += 1
- res
- end
- end
- end
-
- def document_self
- @context.document_self
- end
-
- def aliases
- @context.aliases
- end
-
- def find_symbol(symbol, method=nil)
- res = @context.parent.find_symbol(symbol, method)
- if res
- res = res.viewer
- end
- res
- end
-
- end
-
-end
-
diff --git a/lib/rdoc/generator/chm.rb b/lib/rdoc/generator/chm.rb
deleted file mode 100644
index 7537365842..0000000000
--- a/lib/rdoc/generator/chm.rb
+++ /dev/null
@@ -1,113 +0,0 @@
-require 'rdoc/generator/html'
-
-class RDoc::Generator::CHM < RDoc::Generator::HTML
-
- HHC_PATH = "c:/Program Files/HTML Help Workshop/hhc.exe"
-
- ##
- # Standard generator factory
-
- def self.for(options)
- new(options)
- end
-
- def initialize(*args)
- super
- @op_name = @options.op_name || "rdoc"
- check_for_html_help_workshop
- end
-
- def check_for_html_help_workshop
- stat = File.stat(HHC_PATH)
- rescue
- $stderr <<
- "\n.chm output generation requires that Microsoft's Html Help\n" <<
- "Workshop is installed. RDoc looks for it in:\n\n " <<
- HHC_PATH <<
- "\n\nYou can download a copy for free from:\n\n" <<
- " http://msdn.microsoft.com/library/default.asp?" <<
- "url=/library/en-us/htmlhelp/html/hwMicrosoftHTMLHelpDownloads.asp\n\n"
- end
-
- ##
- # Generate the html as normal, then wrap it in a help project
-
- def generate(info)
- super
- @project_name = @op_name + ".hhp"
- create_help_project
- end
-
- ##
- # The project contains the project file, a table of contents and an index
-
- def create_help_project
- create_project_file
- create_contents_and_index
- compile_project
- end
-
- ##
- # The project file links together all the various
- # files that go to make up the help.
-
- def create_project_file
- template = RDoc::TemplatePage.new @template::HPP_FILE
- values = { "title" => @options.title, "opname" => @op_name }
- files = []
- @files.each do |f|
- files << { "html_file_name" => f.path }
- end
-
- values['all_html_files'] = files
-
- File.open(@project_name, "w") do |f|
- template.write_html_on(f, values)
- end
- end
-
- ##
- # The contents is a list of all files and modules.
- # For each we include as sub-entries the list
- # of methods they contain. As we build the contents
- # we also build an index file
-
- def create_contents_and_index
- contents = []
- index = []
-
- (@files+@classes).sort.each do |entry|
- content_entry = { "c_name" => entry.name, "ref" => entry.path }
- index << { "name" => entry.name, "aref" => entry.path }
-
- internals = []
-
- methods = entry.build_method_summary_list(entry.path)
-
- content_entry["methods"] = methods unless methods.empty?
- contents << content_entry
- index.concat methods
- end
-
- values = { "contents" => contents }
- template = RDoc::TemplatePage.new @template::CONTENTS
- File.open("contents.hhc", "w") do |f|
- template.write_html_on(f, values)
- end
-
- values = { "index" => index }
- template = RDoc::TemplatePage.new @template::CHM_INDEX
- File.open("index.hhk", "w") do |f|
- template.write_html_on(f, values)
- end
- end
-
- ##
- # Invoke the windows help compiler to compiler the project
-
- def compile_project
- system(HHC_PATH, @project_name)
- end
-
-end
-
diff --git a/lib/rdoc/generator/chm/chm.rb b/lib/rdoc/generator/chm/chm.rb
deleted file mode 100644
index c362318d91..0000000000
--- a/lib/rdoc/generator/chm/chm.rb
+++ /dev/null
@@ -1,100 +0,0 @@
-require 'rdoc/generator/chm'
-require 'rdoc/generator/html/html'
-
-module RDoc::Generator::CHM::CHM
-
- HTML = RDoc::Generator::HTML::HTML
-
- INDEX = HTML::INDEX
-
- STYLE = HTML::STYLE
-
- CLASS_INDEX = HTML::CLASS_INDEX
- CLASS_PAGE = HTML::CLASS_PAGE
- FILE_INDEX = HTML::FILE_INDEX
- FILE_PAGE = HTML::FILE_PAGE
- METHOD_INDEX = HTML::METHOD_INDEX
- METHOD_LIST = HTML::METHOD_LIST
-
- FR_INDEX_BODY = HTML::FR_INDEX_BODY
-
- # This is a nasty little hack, but hhc doesn't support the <?xml tag, so...
- BODY = HTML::BODY.sub!(/<\?xml.*\?>/, '')
- SRC_PAGE = HTML::SRC_PAGE.sub!(/<\?xml.*\?>/, '')
-
- HPP_FILE = <<-EOF
-[OPTIONS]
-Auto Index = Yes
-Compatibility=1.1 or later
-Compiled file=<%= values["opname"] %>.chm
-Contents file=contents.hhc
-Full-text search=Yes
-Index file=index.hhk
-Language=0x409 English(United States)
-Title=<%= values["title"] %>
-
-[FILES]
-<% values["all_html_files"].each do |all_html_files| %>
-<%= all_html_files["html_file_name"] %>
-<% end # values["all_html_files"] %>
- EOF
-
- CONTENTS = <<-EOF
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<HTML>
-<HEAD>
-<meta name="GENERATOR" content="Microsoft&reg; HTML Help Workshop 4.1">
-<!-- Sitemap 1.0 -->
-</HEAD><BODY>
-<OBJECT type="text/site properties">
- <param name="Foreground" value="0x80">
- <param name="Window Styles" value="0x800025">
- <param name="ImageType" value="Folder">
-</OBJECT>
-<UL>
-<% values["contents"].each do |contents| %>
- <LI> <OBJECT type="text/sitemap">
- <param name="Name" value="<%= contents["c_name"] %>">
- <param name="Local" value="<%= contents["ref"] %>">
- </OBJECT>
-<% if contents["methods"] then %>
-<ul>
-<% contents["methods"].each do |methods| %>
- <LI> <OBJECT type="text/sitemap">
- <param name="Name" value="<%= methods["name"] %>">
- <param name="Local" value="<%= methods["aref"] %>">
- </OBJECT>
-<% end # contents["methods"] %>
-</ul>
-<% end %>
- </LI>
-<% end # values["contents"] %>
-</UL>
-</BODY></HTML>
- EOF
-
- CHM_INDEX = <<-EOF
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<HTML>
-<HEAD>
-<meta name="GENERATOR" content="Microsoft&reg; HTML Help Workshop 4.1">
-<!-- Sitemap 1.0 -->
-</HEAD><BODY>
-<OBJECT type="text/site properties">
- <param name="Foreground" value="0x80">
- <param name="Window Styles" value="0x800025">
- <param name="ImageType" value="Folder">
-</OBJECT>
-<UL>
-<% values["index"].each do |index| %>
- <LI> <OBJECT type="text/sitemap">
- <param name="Name" value="<%= index["name"] %>">
- <param name="Local" value="<%= index["aref"] %>">
- </OBJECT>
-<% end # values["index"] %>
-</UL>
-</BODY></HTML>
- EOF
-
-end
-
diff --git a/lib/rdoc/generator/html.rb b/lib/rdoc/generator/html.rb
deleted file mode 100644
index 60e0c175fe..0000000000
--- a/lib/rdoc/generator/html.rb
+++ /dev/null
@@ -1,445 +0,0 @@
-require 'fileutils'
-
-require 'rdoc/generator'
-require 'rdoc/markup/to_html'
-
-##
-# We're responsible for generating all the HTML files from the object tree
-# defined in code_objects.rb. We generate:
-#
-# [files] an html file for each input file given. These
-# input files appear as objects of class
-# TopLevel
-#
-# [classes] an html file for each class or module encountered.
-# These classes are not grouped by file: if a file
-# contains four classes, we'll generate an html
-# file for the file itself, and four html files
-# for the individual classes.
-#
-# [indices] we generate three indices for files, classes,
-# and methods. These are displayed in a browser
-# like window with three index panes across the
-# top and the selected description below
-#
-# Method descriptions appear in whatever entity (file, class, or module) that
-# contains them.
-#
-# We generate files in a structure below a specified subdirectory, normally
-# +doc+.
-#
-# opdir
-# |
-# |___ files
-# | |__ per file summaries
-# |
-# |___ classes
-# |__ per class/module descriptions
-#
-# HTML is generated using the Template class.
-
-class RDoc::Generator::HTML
-
- include RDoc::Generator::MarkUp
-
- ##
- # Generator may need to return specific subclasses depending on the
- # options they are passed. Because of this we create them using a factory
-
- def self.for(options)
- RDoc::Generator::AllReferences.reset
- RDoc::Generator::Method.reset
-
- if options.all_one_file
- RDoc::Generator::HTMLInOne.new options
- else
- new options
- end
- end
-
- class << self
- protected :new
- end
-
- ##
- # Set up a new HTML generator. Basically all we do here is load up the
- # correct output temlate
-
- def initialize(options) #:not-new:
- @options = options
- load_html_template
- end
-
- ##
- # Build the initial indices and output objects
- # based on an array of TopLevel objects containing
- # the extracted information.
-
- def generate(toplevels)
- @toplevels = toplevels
- @files = []
- @classes = []
-
- write_style_sheet
- gen_sub_directories
- build_indices
- generate_html
- end
-
- private
-
- ##
- # Load up the HTML template specified in the options.
- # If the template name contains a slash, use it literally
-
- def load_html_template
- #
- # If the template is not a path, first look for it
- # in rdoc's HTML template directory. Perhaps this behavior should
- # be reversed (first try to include the template and, only if that
- # fails, try to include it in the default template directory).
- # One danger with reversing the behavior, however, is that
- # if something like require 'html' could load up an
- # unrelated file in the standard library or in a gem.
- #
- template = @options.template
-
- unless template =~ %r{/|\\} then
- template = File.join('rdoc', 'generator', @options.generator.key,
- template)
- end
-
- begin
- require template
-
- @template = self.class.const_get @options.template.upcase
- @options.template_class = @template
- rescue LoadError => e
- #
- # The template did not exist in the default template directory, so
- # see if require can find the template elsewhere (in a gem, for
- # instance).
- #
- if(e.message[template] && template != @options.template)
- template = @options.template
- retry
- end
-
- $stderr.puts "Could not find HTML template '#{template}': #{e.message}"
- exit 99
- end
- end
-
- ##
- # Write out the style sheet used by the main frames
-
- def write_style_sheet
- return unless @template.constants.include? :STYLE or
- @template.constants.include? 'STYLE'
-
- template = RDoc::TemplatePage.new @template::STYLE
-
- unless @options.css then
- open RDoc::Generator::CSS_NAME, 'w' do |f|
- values = {}
-
- if @template.constants.include? :FONTS or
- @template.constants.include? 'FONTS' then
- values["fonts"] = @template::FONTS
- end
-
- template.write_html_on(f, values)
- end
- end
- end
-
- ##
- # See the comments at the top for a description of the directory structure
-
- def gen_sub_directories
- FileUtils.mkdir_p RDoc::Generator::FILE_DIR
- FileUtils.mkdir_p RDoc::Generator::CLASS_DIR
- rescue
- $stderr.puts $!.message
- exit 1
- end
-
- def build_indices
- @files, @classes = RDoc::Generator::Context.build_indices(@toplevels,
- @options)
- end
-
- ##
- # Generate all the HTML
-
- def generate_html
- @main_url = main_url
-
- # the individual descriptions for files and classes
- gen_into(@files)
- gen_into(@classes)
-
- # and the index files
- gen_file_index
- gen_class_index
- gen_method_index
- gen_main_index
-
- # this method is defined in the template file
- values = {
- 'title_suffix' => CGI.escapeHTML("[#{@options.title}]"),
- 'charset' => @options.charset,
- 'style_url' => style_url('', @options.css),
- }
-
- @template.write_extra_pages(values) if @template.respond_to?(:write_extra_pages)
- end
-
- def gen_into(list)
- #
- # The file, class, and method lists technically should be regenerated
- # for every output file, in order that the relative links be correct
- # (we are worried here about frameless templates, which need this
- # information for every generated page). Doing this is a bit slow,
- # however. For a medium-sized gem, this increased rdoc's runtime by
- # about 5% (using the 'time' command-line utility). While this is not
- # necessarily a problem, I do not want to pessimize rdoc for large
- # projects, however, and so we only regenerate the lists when the
- # directory of the output file changes, which seems like a reasonable
- # optimization.
- #
- file_list = {}
- class_list = {}
- method_list = {}
- prev_op_dir = nil
-
- list.each do |item|
- next unless item.document_self
-
- op_file = item.path
- op_dir = File.dirname(op_file)
-
- if(op_dir != prev_op_dir)
- file_list = index_to_links op_file, @files
- class_list = index_to_links op_file, @classes
- method_list = index_to_links op_file, RDoc::Generator::Method.all_methods
- end
- prev_op_dir = op_dir
-
- FileUtils.mkdir_p op_dir
-
- open op_file, 'w' do |io|
- item.write_on io, file_list, class_list, method_list
- end
- end
- end
-
- def gen_file_index
- gen_an_index @files, 'Files', @template::FILE_INDEX, "fr_file_index.html"
- end
-
- def gen_class_index
- gen_an_index(@classes, 'Classes', @template::CLASS_INDEX,
- "fr_class_index.html")
- end
-
- def gen_method_index
- gen_an_index(RDoc::Generator::Method.all_methods, 'Methods',
- @template::METHOD_INDEX, "fr_method_index.html")
- end
-
- def gen_an_index(collection, title, template, filename)
- template = RDoc::TemplatePage.new @template::FR_INDEX_BODY, template
- res = []
- collection.sort.each do |f|
- if f.document_self
- res << { "href" => f.path, "name" => f.index_name }
- end
- end
-
- values = {
- "entries" => res,
- 'title' => CGI.escapeHTML("#{title} [#{@options.title}]"),
- 'list_title' => CGI.escapeHTML(title),
- 'index_url' => @main_url,
- 'charset' => @options.charset,
- 'style_url' => style_url('', @options.css),
- }
-
- open filename, 'w' do |f|
- template.write_html_on(f, values)
- end
- end
-
- ##
- # The main index page is mostly a template frameset, but includes the
- # initial page. If the <tt>--main</tt> option was given, we use this as
- # our main page, otherwise we use the first file specified on the command
- # line.
-
- def gen_main_index
- if @template.const_defined? :FRAMELESS then
- #
- # If we're using a template without frames, then just redirect
- # to it from index.html.
- #
- # One alternative to this, expanding the main page's template into
- # index.html, is tricky because the relative URLs will be different
- # (since index.html is located in at the site's root,
- # rather than within a files or a classes subdirectory).
- #
- open 'index.html', 'w' do |f|
- f.puts(%{<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">})
- f.puts(%{<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
- lang="en">})
- f.puts(%{<head>})
- f.puts(%{<title>#{CGI.escapeHTML(@options.title)}</title>})
- f.puts(%{<meta http-equiv="refresh" content="0; url=#{@main_url}" />})
- f.puts(%{</head>})
- f.puts(%{<body></body>})
- f.puts(%{</html>})
- end
- else
- main = RDoc::TemplatePage.new @template::INDEX
-
- open 'index.html', 'w' do |f|
- style_url = style_url '', @options.css
-
- classes = @classes.sort.map { |klass| klass.value_hash }
-
- values = {
- 'initial_page' => @main_url,
- 'style_url' => style_url('', @options.css),
- 'title' => CGI.escapeHTML(@options.title),
- 'charset' => @options.charset,
- 'classes' => classes,
- }
-
- values['inline_source'] = @options.inline_source
-
- main.write_html_on f, values
- end
- end
- end
-
- def index_to_links(output_path, collection)
- collection.sort.map do |f|
- next unless f.document_self
- { "href" => RDoc::Markup::ToHtml.gen_relative_url(output_path, f.path),
- "name" => f.index_name }
- end.compact
- end
-
- ##
- # Returns the url of the main page
-
- def main_url
- main_page = @options.main_page
-
- #
- # If a main page has been specified (--main), then search for it
- # in the AllReferences array. This allows either files or classes
- # to be used for the main page.
- #
- if main_page then
- main_page_ref = RDoc::Generator::AllReferences[main_page]
-
- if main_page_ref then
- return main_page_ref.path
- else
- $stderr.puts "Could not find main page #{main_page}"
- end
- end
-
- #
- # No main page has been specified, so just use the README.
- #
- @files.each do |file|
- if file.name =~ /^README/ then
- return file.path
- end
- end
-
- #
- # There's no README (shame! shame!). Just use the first file
- # that will be documented.
- #
- @files.each do |file|
- if file.document_self then
- return file.path
- end
- end
-
- #
- # There are no files to be documented... Something seems very wrong.
- #
- raise RDoc::Error, "Couldn't find anything to document (perhaps :stopdoc: has been used in all classes)!"
- end
- private :main_url
-
-end
-
-class RDoc::Generator::HTMLInOne < RDoc::Generator::HTML
-
- def initialize(*args)
- super
- end
-
- ##
- # Build the initial indices and output objects
- # based on an array of TopLevel objects containing
- # the extracted information.
-
- def generate(info)
- @toplevels = info
- @hyperlinks = {}
-
- build_indices
- generate_xml
- end
-
- ##
- # Generate:
- #
- # * a list of RDoc::Generator::File objects for each TopLevel object.
- # * a list of RDoc::Generator::Class objects for each first level
- # class or module in the TopLevel objects
- # * a complete list of all hyperlinkable terms (file,
- # class, module, and method names)
-
- def build_indices
- @files, @classes = RDoc::Generator::Context.build_indices(@toplevels,
- @options)
- end
-
- ##
- # Generate all the HTML. For the one-file case, we generate
- # all the information in to one big hash
-
- def generate_xml
- values = {
- 'charset' => @options.charset,
- 'files' => gen_into(@files),
- 'classes' => gen_into(@classes),
- 'title' => CGI.escapeHTML(@options.title),
- }
-
- template = RDoc::TemplatePage.new @template::ONE_PAGE
-
- if @options.op_name
- opfile = open @options.op_name, 'w'
- else
- opfile = $stdout
- end
- template.write_html_on(opfile, values)
- end
-
- def gen_into(list)
- res = []
- list.each do |item|
- res << item.value_hash
- end
- res
- end
-end
diff --git a/lib/rdoc/generator/html/common.rb b/lib/rdoc/generator/html/common.rb
deleted file mode 100644
index b25f009a72..0000000000
--- a/lib/rdoc/generator/html/common.rb
+++ /dev/null
@@ -1,24 +0,0 @@
-#
-# The templates require further refactoring. In particular,
-# * Some kind of HTML generation library should be used.
-#
-# Also, all of the templates require some TLC from a designer.
-#
-# Right now, this file contains some constants that are used by all
-# of the templates.
-#
-module RDoc::Generator::HTML::Common
- XHTML_STRICT_PREAMBLE = <<-EOF
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
-"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-EOF
-
- XHTML_FRAME_PREAMBLE = <<-EOF
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
-"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
-EOF
-
- HTML_ELEMENT = <<-EOF
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-EOF
-end
diff --git a/lib/rdoc/generator/html/frameless.rb b/lib/rdoc/generator/html/frameless.rb
deleted file mode 100644
index 0375fee313..0000000000
--- a/lib/rdoc/generator/html/frameless.rb
+++ /dev/null
@@ -1,92 +0,0 @@
-require 'rdoc/generator/html/html'
-
-##
-# = CSS2 RDoc HTML template
-#
-# This is a template for RDoc that uses XHTML 1.0 Strict and dictates a
-# bit more of the appearance of the output to cascading stylesheets than the
-# default. It was designed for clean inline code display, and uses DHTMl to
-# toggle the visbility of each method's source with each click on the '[source]'
-# link.
-#
-# Frameless basically is the html template without frames.
-#
-# == Authors
-#
-# * Michael Granger <ged@FaerieMUD.org>
-#
-# Copyright (c) 2002, 2003 The FaerieMUD Consortium. Some rights reserved.
-#
-# This work is licensed under the Creative Commons Attribution License. To view
-# a copy of this license, visit http://creativecommons.org/licenses/by/1.0/ or
-# send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California
-# 94305, USA.
-
-module RDoc::Generator::HTML::FRAMELESS
-
- FRAMELESS = true
-
- FONTS = RDoc::Generator::HTML::HTML::FONTS
-
- STYLE = RDoc::Generator::HTML::HTML::STYLE
-
- HEADER = RDoc::Generator::HTML::HTML::HEADER
-
- FOOTER = <<-EOF
- <div id="popupmenu" class="index">
- <br />
- <h1 class="index-entries section-bar">Files</h1>
- <ul>
-<% values["file_list"].each do |file| %>
- <li><a href="<%= file["href"] %>"><%= file["name"] %></a></li>
-<% end %>
- </ul>
-
- <br />
- <h1 class="index-entries section-bar">Classes</h1>
- <ul>
-<% values["class_list"].each do |klass| %>
- <li><a href="<%= klass["href"] %>"><%= klass["name"] %></a></li>
-<% end %>
- </ul>
-
- <br />
- <h1 class="index-entries section-bar">Methods</h1>
- <ul>
-<% values["method_list"].each do |method| %>
- <li><a href="<%= method["href"] %>"><%= method["name"] %></a></li>
-<% end %>
- </ul>
- </div>
-</body>
-</html>
- EOF
-
- FILE_PAGE = RDoc::Generator::HTML::HTML::FILE_PAGE
-
- CLASS_PAGE = RDoc::Generator::HTML::HTML::CLASS_PAGE
-
- METHOD_LIST = RDoc::Generator::HTML::HTML::METHOD_LIST
-
- BODY = HEADER + %{
-
-<%= template_include %> <!-- banner header -->
-
- <div id="bodyContent">
-
-} + METHOD_LIST + %{
-
- </div>
-
-} + FOOTER
-
- SRC_PAGE = RDoc::Generator::HTML::HTML::SRC_PAGE
-
- FR_INDEX_BODY = RDoc::Generator::HTML::HTML::FR_INDEX_BODY
-
- FILE_INDEX = RDoc::Generator::HTML::HTML::FILE_INDEX
-
- CLASS_INDEX = RDoc::Generator::HTML::HTML::CLASS_INDEX
-
- METHOD_INDEX = RDoc::Generator::HTML::HTML::METHOD_INDEX
-end
diff --git a/lib/rdoc/generator/html/hefss.rb b/lib/rdoc/generator/html/hefss.rb
deleted file mode 100644
index 01425a4556..0000000000
--- a/lib/rdoc/generator/html/hefss.rb
+++ /dev/null
@@ -1,150 +0,0 @@
-require 'rdoc/generator/html'
-require 'rdoc/generator/html/kilmerfactory'
-
-module RDoc::Generator::HTML::HEFSS
-
- FONTS = "Verdana, Arial, Helvetica, sans-serif"
-
- CENTRAL_STYLE = <<-EOF
-body,p { font-family: <%= values["fonts"] %>;
- color: #000040; background: #BBBBBB;
-}
-
-td { font-family: <%= values["fonts"] %>;
- color: #000040;
-}
-
-.attr-rw { font-size: small; color: #444488 }
-
-.title-row {color: #eeeeff;
- background: #BBBBDD;
-}
-
-.big-title-font { color: white;
- font-family: <%= values["fonts"] %>;
- font-size: large;
- height: 50px}
-
-.small-title-font { color: purple;
- font-family: <%= values["fonts"] %>;
- font-size: small; }
-
-.aqua { color: purple }
-
-#diagram img {
- border: 0;
-}
-
-.method-name, attr-name {
- font-family: monospace; font-weight: bold;
-}
-
-.tablesubtitle {
- width: 100%;
- margin-top: 1ex;
- margin-bottom: .5ex;
- padding: 5px 0px 5px 20px;
- font-size: large;
- color: purple;
- background: #BBBBCC;
-}
-
-.tablesubsubtitle {
- width: 100%;
- margin-top: 1ex;
- margin-bottom: .5ex;
- padding: 5px 0px 5px 20px;
- font-size: medium;
- color: white;
- background: #BBBBCC;
-}
-
-.name-list {
- font-family: monospace;
- margin-left: 40px;
- margin-bottom: 2ex;
- line-height: 140%;
-}
-
-.description {
- margin-left: 40px;
- margin-bottom: 2ex;
- line-height: 140%;
-}
-
-.methodtitle {
- font-size: medium;
- text_decoration: none;
- padding: 3px 3px 3px 20px;
- color: #0000AA;
-}
-
-.ruby-comment { color: green; font-style: italic }
-.ruby-constant { color: #4433aa; font-weight: bold; }
-.ruby-identifier { color: #222222; }
-.ruby-ivar { color: #2233dd; }
-.ruby-keyword { color: #3333FF; font-weight: bold }
-.ruby-node { color: #777777; }
-.ruby-operator { color: #111111; }
-.ruby-regexp { color: #662222; }
-.ruby-value { color: #662222; font-style: italic }
-
-.srcbut { float: right }
- EOF
-
- INDEX_STYLE = <<-EOF
-body {
- background-color: #bbbbbb;
- font-family: #{FONTS};
- font-size: 11px;
- font-style: normal;
- line-height: 14px;
- color: #000040;
-}
-
-div.banner {
- background: #bbbbcc;
- color: white;
- padding: 1;
- margin: 0;
- font-size: 90%;
- font-weight: bold;
- line-height: 1.1;
- text-align: center;
- width: 100%;
-}
-EOF
-
- FACTORY = RDoc::Generator::HTML::
- KilmerFactory.new(:central_css => CENTRAL_STYLE,
- :index_css => INDEX_STYLE,
- :method_list_heading => "Subroutines and Functions",
- :class_and_module_list_heading => "Classes and Modules",
- :attribute_list_heading => "Arguments")
-
- STYLE = FACTORY.get_STYLE()
-
- METHOD_LIST = FACTORY.get_METHOD_LIST()
-
- BODY = FACTORY.get_BODY()
-
- FILE_PAGE = FACTORY.get_FILE_PAGE()
-
- CLASS_PAGE = FACTORY.get_CLASS_PAGE()
-
- SRC_PAGE = FACTORY.get_SRC_PAGE()
-
- FR_INDEX_BODY = FACTORY.get_FR_INDEX_BODY()
-
- FILE_INDEX = FACTORY.get_FILE_INDEX()
-
- CLASS_INDEX = FACTORY.get_CLASS_INDEX()
-
- METHOD_INDEX = FACTORY.get_METHOD_INDEX()
-
- INDEX = FACTORY.get_INDEX()
-
- def self.write_extra_pages(values)
- FACTORY.write_extra_pages(values)
- end
-end
diff --git a/lib/rdoc/generator/html/html.rb b/lib/rdoc/generator/html/html.rb
deleted file mode 100644
index 5e5b4d5531..0000000000
--- a/lib/rdoc/generator/html/html.rb
+++ /dev/null
@@ -1,769 +0,0 @@
-require 'rdoc/generator/html'
-require 'rdoc/generator/html/common'
-
-##
-# = CSS2 RDoc HTML template
-#
-# This is a template for RDoc that uses XHTML 1.0 Strict and dictates a
-# bit more of the appearance of the output to cascading stylesheets than the
-# default. It was designed for clean inline code display, and uses DHTMl to
-# toggle the visibility of each method's source with each click on the
-# '[source]' link.
-#
-# This template *also* forms the basis of the frameless template.
-#
-# == Authors
-#
-# * Michael Granger <ged@FaerieMUD.org>
-#
-# Copyright (c) 2002, 2003 The FaerieMUD Consortium. Some rights reserved.
-#
-# This work is licensed under the Creative Commons Attribution License. To
-# view a copy of this license, visit
-# http://creativecommons.org/licenses/by/1.0/ or send a letter to Creative
-# Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
-
-module RDoc::Generator::HTML::HTML
-
- include RDoc::Generator::HTML::Common
-
- FONTS = "Verdana,Arial,Helvetica,sans-serif"
-
- STYLE = <<-EOF
-body {
- font-family: #{FONTS};
- font-size: 90%;
- margin: 0;
- margin-left: 40px;
- padding: 0;
- background: white;
- color: black;
-}
-
-h1, h2, h3, h4 {
- margin: 0;
- background: transparent;
-}
-
-h1 {
- font-size: 150%;
-}
-
-h2,h3,h4 {
- margin-top: 1em;
-}
-
-:link, :visited {
- background: #eef;
- color: #039;
- text-decoration: none;
-}
-
-:link:hover, :visited:hover {
- background: #039;
- color: #eef;
-}
-
-/* Override the base stylesheet's Anchor inside a table cell */
-td > :link, td > :visited {
- background: transparent;
- color: #039;
- text-decoration: none;
-}
-
-/* and inside a section title */
-.section-title > :link, .section-title > :visited {
- background: transparent;
- color: #eee;
- text-decoration: none;
-}
-
-/* === Structural elements =================================== */
-
-.index {
- margin: 0;
- margin-left: -40px;
- padding: 0;
- font-size: 90%;
-}
-
-.index :link, .index :visited {
- margin-left: 0.7em;
-}
-
-.index .section-bar {
- margin-left: 0px;
- padding-left: 0.7em;
- background: #ccc;
- font-size: small;
-}
-
-#classHeader, #fileHeader {
- width: auto;
- color: white;
- padding: 0.5em 1.5em 0.5em 1.5em;
- margin: 0;
- margin-left: -40px;
- border-bottom: 3px solid #006;
-}
-
-#classHeader :link, #fileHeader :link,
-#classHeader :visited, #fileHeader :visited {
- background: inherit;
- color: white;
-}
-
-#classHeader td, #fileHeader td {
- background: inherit;
- color: white;
-}
-
-#fileHeader {
- background: #057;
-}
-
-#classHeader {
- background: #048;
-}
-
-.class-name-in-header {
- font-size: 180%;
- font-weight: bold;
-}
-
-#bodyContent {
- padding: 0 1.5em 0 1.5em;
-}
-
-#description {
- padding: 0.5em 1.5em;
- background: #efefef;
- border: 1px dotted #999;
-}
-
-#description h1, #description h2, #description h3,
-#description h4, #description h5, #description h6 {
- color: #125;
- background: transparent;
-}
-
-#validator-badges {
- text-align: center;
-}
-
-#validator-badges img {
- border: 0;
-}
-
-#copyright {
- color: #333;
- background: #efefef;
- font: 0.75em sans-serif;
- margin-top: 5em;
- margin-bottom: 0;
- padding: 0.5em 2em;
-}
-
-/* === Classes =================================== */
-
-table.header-table {
- color: white;
- font-size: small;
-}
-
-.type-note {
- font-size: small;
- color: #dedede;
-}
-
-.section-bar {
- color: #333;
- border-bottom: 1px solid #999;
- margin-left: -20px;
-}
-
-.section-title {
- background: #79a;
- color: #eee;
- padding: 3px;
- margin-top: 2em;
- margin-left: -30px;
- border: 1px solid #999;
-}
-
-.top-aligned-row {
- vertical-align: top
-}
-
-.bottom-aligned-row {
- vertical-align: bottom
-}
-
-#diagram img {
- border: 0;
-}
-
-/* --- Context section classes ----------------------- */
-
-.context-row { }
-
-.context-item-name {
- font-family: monospace;
- font-weight: bold;
- color: black;
-}
-
-.context-item-value {
- font-size: small;
- color: #448;
-}
-
-.context-item-desc {
- color: #333;
- padding-left: 2em;
-}
-
-/* --- Method classes -------------------------- */
-
-.method-detail {
- background: #efefef;
- padding: 0;
- margin-top: 0.5em;
- margin-bottom: 1em;
- border: 1px dotted #ccc;
-}
-
-.method-heading {
- color: black;
- background: #ccc;
- border-bottom: 1px solid #666;
- padding: 0.2em 0.5em 0 0.5em;
-}
-
-.method-signature {
- color: black;
- background: inherit;
-}
-
-.method-name {
- font-weight: bold;
-}
-
-.method-args {
- font-style: italic;
-}
-
-.method-description {
- padding: 0 0.5em 0 0.5em;
-}
-
-/* --- Source code sections -------------------- */
-
-:link.source-toggle, :visited.source-toggle {
- font-size: 90%;
-}
-
-div.method-source-code {
- background: #262626;
- color: #ffdead;
- margin: 1em;
- padding: 0.5em;
- border: 1px dashed #999;
- overflow: auto;
-}
-
-div.method-source-code pre {
- color: #ffdead;
-}
-
-/* --- Ruby keyword styles --------------------- */
-
-.standalone-code {
- background: #221111;
- color: #ffdead;
- overflow: auto;
-}
-
-.ruby-constant {
- color: #7fffd4;
- background: transparent;
-}
-
-.ruby-keyword {
- color: #00ffff;
- background: transparent;
-}
-
-.ruby-ivar {
- color: #eedd82;
- background: transparent;
-}
-
-.ruby-operator {
- color: #00ffee;
- background: transparent;
-}
-
-.ruby-identifier {
- color: #ffdead;
- background: transparent;
-}
-
-.ruby-node {
- color: #ffa07a;
- background: transparent;
-}
-
-.ruby-comment {
- color: #b22222;
- font-weight: bold;
- background: transparent;
-}
-
-.ruby-regexp {
- color: #ffa07a;
- background: transparent;
-}
-
-.ruby-value {
- color: #7fffd4;
- background: transparent;
-}
-EOF
-
-
-#####################################################################
-### H E A D E R T E M P L A T E
-#####################################################################
-
- HEADER = XHTML_STRICT_PREAMBLE + HTML_ELEMENT + <<-EOF
-<head>
- <title><%= values["title"] %></title>
- <meta http-equiv="Content-Type" content="text/html; charset=<%= values["charset"] %>" />
- <meta http-equiv="Content-Script-Type" content="text/javascript" />
- <link rel="stylesheet" href="<%= values["style_url"] %>" type="text/css" media="screen" />
- <script type="text/javascript">
- // <![CDATA[
-
- function popupCode( url ) {
- window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
- }
-
- function toggleCode( id ) {
- if ( document.getElementById )
- elem = document.getElementById( id );
- else if ( document.all )
- elem = eval( "document.all." + id );
- else
- return false;
-
- elemStyle = elem.style;
-
- if ( elemStyle.display != "block" ) {
- elemStyle.display = "block"
- } else {
- elemStyle.display = "none"
- }
-
- return true;
- }
-
- // Make codeblocks hidden by default
- document.writeln( "<style type=\\"text/css\\">div.method-source-code { display: none }<\\/style>" )
-
- // ]]>
- </script>
-
-</head>
-<body>
-EOF
-
-#####################################################################
-### F O O T E R T E M P L A T E
-#####################################################################
-
- FOOTER = <<-EOF
-<div id="validator-badges">
- <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
-</div>
-
-</body>
-</html>
- EOF
-
-
-#####################################################################
-### F I L E P A G E H E A D E R T E M P L A T E
-#####################################################################
-
- FILE_PAGE = <<-EOF
- <div id="fileHeader">
- <h1><%= values["short_name"] %></h1>
- <table class="header-table">
- <tr class="top-aligned-row">
- <td><strong>Path:</strong></td>
- <td><%= values["full_path"] %>
-<% if values["cvsurl"] then %>
- &nbsp;(<a href="<%= values["cvsurl"] %>"><acronym title="Concurrent Versioning System">CVS</acronym></a>)
-<% end %>
- </td>
- </tr>
- <tr class="top-aligned-row">
- <td><strong>Last Update:</strong></td>
- <td><%= values["dtm_modified"] %></td>
- </tr>
- </table>
- </div>
- EOF
-
-#####################################################################
-### C L A S S P A G E H E A D E R T E M P L A T E
-#####################################################################
-
- CLASS_PAGE = <<-EOF
- <div id="classHeader">
- <table class="header-table">
- <tr class="top-aligned-row">
- <td><strong><%= values["classmod"] %></strong></td>
- <td class="class-name-in-header"><%= values["full_name"] %></td>
- </tr>
- <tr class="top-aligned-row">
- <td><strong>In:</strong></td>
- <td>
-<% values["infiles"].each do |infiles| %>
-<% if infiles["full_path_url"] then %>
- <a href="<%= infiles["full_path_url"] %>">
-<% end %>
- <%= infiles["full_path"] %>
-<% if infiles["full_path_url"] then %>
- </a>
-<% end %>
-<% if infiles["cvsurl"] then %>
- &nbsp;(<a href="<%= infiles["cvsurl"] %>"><acronym title="Concurrent Versioning System">CVS</acronym></a>)
-<% end %>
- <br />
-<% end %><%# values["infiles"] %>
- </td>
- </tr>
-
-<% if values["parent"] then %>
- <tr class="top-aligned-row">
- <td><strong>Parent:</strong></td>
- <td>
-<% if values["par_url"] then %>
- <a href="<%= values["par_url"] %>">
-<% end %>
- <%= values["parent"] %>
-<% if values["par_url"] then %>
- </a>
-<% end %>
- </td>
- </tr>
-<% end %>
- </table>
- </div>
- EOF
-
-#####################################################################
-### M E T H O D L I S T T E M P L A T E
-#####################################################################
-
- METHOD_LIST = <<-EOF
- <div id="contextContent">
-<% if values["diagram"] then %>
- <div id="diagram">
- <%= values["diagram"] %>
- </div>
-<% end
-
- if values["description"] then %>
- <div id="description">
- <%= values["description"] %>
- </div>
-<% end
-
- if values["requires"] then %>
- <div id="requires-list">
- <h3 class="section-bar">Required files</h3>
-
- <div class="name-list">
-<% values["requires"].each do |requires| %>
- <%= href requires["aref"], requires["name"] %>&nbsp;&nbsp;
-<% end %><%# values["requires"] %>
- </div>
- </div>
-<% end
-
- if values["toc"] then %>
- <div id="contents-list">
- <h3 class="section-bar">Contents</h3>
- <ul>
-<% values["toc"].each do |toc| %>
- <li><a href="#<%= toc["href"] %>"><%= toc["secname"] %></a></li>
-<% end %><%# values["toc"] %>
- </ul>
-<% end %>
- </div>
-
-<% if values["methods"] then %>
- <div id="method-list">
- <h3 class="section-bar">Methods</h3>
-
- <div class="name-list">
-<% values["methods"].each do |methods| %>
- <%= href methods["aref"], methods["name"] %>&nbsp;&nbsp;
-<% end %><%# values["methods"] %>
- </div>
- </div>
-<% end %>
- </div>
-
- <!-- if includes -->
-<% if values["includes"] then %>
- <div id="includes">
- <h3 class="section-bar">Included Modules</h3>
-
- <div id="includes-list">
-<% values["includes"].each do |includes| %>
- <span class="include-name"><%= href includes["aref"], includes["name"] %></span>
-<% end %><%# values["includes"] %>
- </div>
- </div>
-<% end
-
- values["sections"].each do |sections| %>
- <div id="section">
-<% if sections["sectitle"] then %>
- <h2 class="section-title"><a name="<%= sections["secsequence"] %>"><%= sections["sectitle"] %></a></h2>
-<% if sections["seccomment"] then %>
- <div class="section-comment">
- <%= sections["seccomment"] %>
- </div>
-<% end
- end
-
- if sections["classlist"] then %>
- <div id="class-list">
- <h3 class="section-bar">Classes and Modules</h3>
-
- <%= sections["classlist"] %>
- </div>
-<% end
-
- if sections["constants"] then %>
- <div id="constants-list">
- <h3 class="section-bar">Constants</h3>
-
- <div class="name-list">
- <table summary="Constants">
-<% sections["constants"].each do |constants| %>
- <tr class="top-aligned-row context-row">
- <td class="context-item-name"><%= constants["name"] %></td>
- <td>=</td>
- <td class="context-item-value"><%= constants["value"] %></td>
-<% if constants["desc"] then %>
- <td>&nbsp;</td>
- <td class="context-item-desc"><%= constants["desc"] %></td>
-<% end %>
- </tr>
-<% end %><%# sections["constants"] %>
- </table>
- </div>
- </div>
-<% end
-
- if sections["aliases"] then %>
- <div id="aliases-list">
- <h3 class="section-bar">External Aliases</h3>
-
- <div class="name-list">
- <table summary="aliases">
-<% sections["aliases"].each do |aliases| %>
- <tr class="top-aligned-row context-row">
- <td class="context-item-name"><%= aliases["old_name"] %></td>
- <td>-&gt;</td>
- <td class="context-item-value"><%= aliases["new_name"] %></td>
- </tr>
-<% if aliases["desc"] then %>
- <tr class="top-aligned-row context-row">
- <td>&nbsp;</td>
- <td colspan="2" class="context-item-desc"><%= aliases["desc"] %></td>
- </tr>
-<% end
- end %><%# sections["aliases"] %>
- </table>
- </div>
- </div>
-<% end %>
-
-<% if sections["attributes"] then %>
- <div id="attribute-list">
- <h3 class="section-bar">Attributes</h3>
-
- <div class="name-list">
- <table>
-<% sections["attributes"].each do |attribute| %>
- <tr class="top-aligned-row context-row">
- <td class="context-item-name"><%= attribute["name"] %></td>
-<% if attribute["rw"] then %>
- <td class="context-item-value">&nbsp;[<%= attribute["rw"] %>]&nbsp;</td>
-<% end
- unless attribute["rw"] then %>
- <td class="context-item-value">&nbsp;&nbsp;</td>
-<% end %>
- <td class="context-item-desc"><%= attribute["a_desc"] %></td>
- </tr>
-<% end %><%# sections["attributes"] %>
- </table>
- </div>
- </div>
-<% end %>
-
- <!-- if method_list -->
-<% if sections["method_list"] then %>
- <div id="methods">
-<% sections["method_list"].each do |method_list|
- if method_list["methods"] then %>
- <h3 class="section-bar"><%= method_list["type"] %> <%= method_list["category"] %> methods</h3>
-
-<% method_list["methods"].each do |methods| %>
- <div id="method-<%= methods["aref"] %>" class="method-detail">
- <a name="<%= methods["aref"] %>"></a>
-
- <div class="method-heading">
-<% if methods["codeurl"] then %>
- <a href="<%= methods["codeurl"] %>" target="Code" class="method-signature"
- onclick="popupCode('<%= methods["codeurl"] %>');return false;">
-<% end
- if methods["sourcecode"] then %>
- <a href="#<%= methods["aref"] %>" class="method-signature">
-<% end
- if methods["callseq"] then %>
- <span class="method-name"><%= methods["callseq"] %></span>
-<% end
- unless methods["callseq"] then %>
- <span class="method-name"><%= methods["name"] %></span><span class="method-args"><%= methods["params"] %></span>
-<% end
- if methods["codeurl"] then %>
- </a>
-<% end
- if methods["sourcecode"] then %>
- </a>
-<% end %>
- </div>
-
- <div class="method-description">
-<% if methods["m_desc"] then %>
- <%= methods["m_desc"] %>
-<% end
- if methods["sourcecode"] then %>
- <p><a class="source-toggle" href="#"
- onclick="toggleCode('<%= methods["aref"] %>-source');return false;">[Source]</a></p>
- <div class="method-source-code" id="<%= methods["aref"] %>-source">
-<pre>
-<%= methods["sourcecode"] %>
-</pre>
- </div>
-<% end %>
- </div>
- </div>
-
-<% end %><%# method_list["methods"] %><%
- end
- end %><%# sections["method_list"] %>
-
- </div>
-<% end %>
-<% end %><%# values["sections"] %>
- EOF
-
-#####################################################################
-### B O D Y T E M P L A T E
-#####################################################################
-
- BODY = HEADER + %{
-
-<%= template_include %> <!-- banner header -->
-
- <div id="bodyContent">
-
-} + METHOD_LIST + %{
-
- </div>
-
-} + FOOTER
-
-#####################################################################
-### S O U R C E C O D E T E M P L A T E
-#####################################################################
-
- SRC_PAGE = XHTML_STRICT_PREAMBLE + HTML_ELEMENT + <<-EOF
-<head>
- <title><%= values["title"] %></title>
- <meta http-equiv="Content-Type" content="text/html; charset=<%= values["charset"] %>" />
- <link rel="stylesheet" href="<%= values["style_url"] %>" type="text/css" media="screen" />
-</head>
-<body class="standalone-code">
- <pre><%= values["code"] %></pre>
-</body>
-</html>
- EOF
-
-
-#####################################################################
-### I N D E X F I L E T E M P L A T E S
-#####################################################################
-
- FR_INDEX_BODY = %{<%= template_include %>}
-
- FILE_INDEX = XHTML_STRICT_PREAMBLE + HTML_ELEMENT + <<-EOF
-<!--
-
- <%= values["title"] %>
-
- -->
-<head>
- <title><%= values["title"] %></title>
- <meta http-equiv="Content-Type" content="text/html; charset=<%= values["charset"] %>" />
- <link rel="stylesheet" href="<%= values["style_url"] %>" type="text/css" />
- <base target="docwin" />
-</head>
-<body>
-<div class="index">
- <h1 class="section-bar"><%= values["list_title"] %></h1>
- <div id="index-entries">
-<% values["entries"].each do |entries| %>
- <a href="<%= entries["href"] %>"><%= entries["name"] %></a><br />
-<% end %><%# values["entries"] %>
- </div>
-</div>
-</body>
-</html>
- EOF
-
- CLASS_INDEX = FILE_INDEX
- METHOD_INDEX = FILE_INDEX
-
- INDEX = XHTML_FRAME_PREAMBLE + HTML_ELEMENT + <<-EOF
-<!--
-
- <%= values["title"] %>
-
- -->
-<head>
- <title><%= values["title"] %></title>
- <meta http-equiv="Content-Type" content="text/html; charset=<%= values["charset"] %>" />
-</head>
-<frameset rows="20%, 80%">
- <frameset cols="25%,35%,45%">
- <frame src="fr_file_index.html" title="Files" name="Files" />
- <frame src="fr_class_index.html" name="Classes" />
- <frame src="fr_method_index.html" name="Methods" />
- </frameset>
- <frame src="<%= values["initial_page"] %>" name="docwin" />
-</frameset>
-</html>
- EOF
-
-end
-
diff --git a/lib/rdoc/generator/html/kilmer.rb b/lib/rdoc/generator/html/kilmer.rb
deleted file mode 100644
index 233a9259a2..0000000000
--- a/lib/rdoc/generator/html/kilmer.rb
+++ /dev/null
@@ -1,151 +0,0 @@
-require 'rdoc/generator/html'
-require 'rdoc/generator/html/kilmerfactory'
-
-module RDoc::Generator::HTML::KILMER
-
- FONTS = "Verdana, Arial, Helvetica, sans-serif"
-
- CENTRAL_STYLE = <<-EOF
-body,td,p { font-family: <%= values["fonts"] %>;
- color: #000040;
-}
-
-.attr-rw { font-size: xx-small; color: #444488 }
-
-.title-row { background-color: #CCCCFF;
- color: #000010;
-}
-
-.big-title-font {
- color: black;
- font-weight: bold;
- font-family: <%= values["fonts"] %>;
- font-size: large;
- height: 60px;
- padding: 10px 3px 10px 3px;
-}
-
-.small-title-font { color: black;
- font-family: <%= values["fonts"] %>;
- font-size:10; }
-
-.aqua { color: black }
-
-#diagram img {
- border: 0;
-}
-
-.method-name, .attr-name {
- font-family: font-family: <%= values["fonts"] %>;
- font-weight: bold;
- font-size: small;
- margin-left: 20px;
- color: #000033;
-}
-
-.tablesubtitle, .tablesubsubtitle {
- width: 100%;
- margin-top: 1ex;
- margin-bottom: .5ex;
- padding: 5px 0px 5px 3px;
- font-size: large;
- color: black;
- background-color: #CCCCFF;
- border: thin;
-}
-
-.name-list {
- margin-left: 5px;
- margin-bottom: 2ex;
- line-height: 105%;
-}
-
-.description {
- margin-left: 5px;
- margin-bottom: 2ex;
- line-height: 105%;
- font-size: small;
-}
-
-.methodtitle {
- font-size: small;
- font-weight: bold;
- text-decoration: none;
- color: #000033;
- background: #ccc;
-}
-
-.srclink {
- font-size: small;
- font-weight: bold;
- text-decoration: none;
- color: #0000DD;
- background-color: white;
-}
-
-.srcbut { float: right }
-
-.ruby-comment { color: green; font-style: italic }
-.ruby-constant { color: #4433aa; font-weight: bold; }
-.ruby-identifier { color: #222222; }
-.ruby-ivar { color: #2233dd; }
-.ruby-keyword { color: #3333FF; font-weight: bold }
-.ruby-node { color: #777777; }
-.ruby-operator { color: #111111; }
-.ruby-regexp { color: #662222; }
-.ruby-value { color: #662222; font-style: italic }
- EOF
-
- INDEX_STYLE = <<-EOF
-body {
- background-color: #ddddff;
- font-family: #{FONTS};
- font-size: 11px;
- font-style: normal;
- line-height: 14px;
- color: #000040;
-}
-
-div.banner {
- background: #0000aa;
- color: white;
- padding: 1;
- margin: 0;
- font-size: 90%;
- font-weight: bold;
- line-height: 1.1;
- text-align: center;
- width: 100%;
-}
-EOF
-
- FACTORY = RDoc::Generator::HTML::
- KilmerFactory.new(:central_css => CENTRAL_STYLE,
- :index_css => INDEX_STYLE)
-
- STYLE = FACTORY.get_STYLE()
-
- METHOD_LIST = FACTORY.get_METHOD_LIST()
-
- BODY = FACTORY.get_BODY()
-
- FILE_PAGE = FACTORY.get_FILE_PAGE()
-
- CLASS_PAGE = FACTORY.get_CLASS_PAGE()
-
- SRC_PAGE = FACTORY.get_SRC_PAGE()
-
- FR_INDEX_BODY = FACTORY.get_FR_INDEX_BODY()
-
- FILE_INDEX = FACTORY.get_FILE_INDEX()
-
- CLASS_INDEX = FACTORY.get_CLASS_INDEX()
-
- METHOD_INDEX = FACTORY.get_METHOD_INDEX()
-
- INDEX = FACTORY.get_INDEX()
-
- def self.write_extra_pages(values)
- FACTORY.write_extra_pages(values)
- end
-end
diff --git a/lib/rdoc/generator/html/kilmerfactory.rb b/lib/rdoc/generator/html/kilmerfactory.rb
deleted file mode 100644
index 1407840839..0000000000
--- a/lib/rdoc/generator/html/kilmerfactory.rb
+++ /dev/null
@@ -1,427 +0,0 @@
-require 'rdoc/generator/html'
-require 'rdoc/generator/html/common'
-
-#
-# This class generates Kilmer-style templates. Right now,
-# rdoc is shipped with two such templates:
-# * kilmer
-# * hefss
-#
-# Kilmer-style templates use frames. The left side of the page has
-# three frames stacked on top of each other: one lists
-# files, one lists classes, and one lists methods. If source code
-# is not inlined, an additional frame runs across the bottom of
-# the page and will be used to display method source code.
-# The central (and largest frame) display class and file
-# pages.
-#
-# The constructor of this class accepts a Hash containing stylistic
-# attributes. Then, a get_BLAH instance method of this class returns a
-# value for the template's BLAH constant. get_BODY, for instance, returns
-# the value of the template's BODY constant.
-#
-class RDoc::Generator::HTML::KilmerFactory
-
- include RDoc::Generator::HTML::Common
-
- #
- # The contents of the stylesheet that should be used for the
- # central frame (for the class and file pages).
- #
- # This must be specified in the Hash passed to the constructor.
- #
- attr_reader :central_css
-
- #
- # The contents of the stylesheet that should be used for the
- # index pages.
- #
- # This must be specified in the Hash passed to the constructor.
- #
- attr_reader :index_css
-
- #
- # The heading that should be displayed before listing methods.
- #
- # If not supplied, this defaults to "Methods".
- #
- attr_reader :method_list_heading
-
- #
- # The heading that should be displayed before listing classes and
- # modules.
- #
- # If not supplied, this defaults to "Classes and Modules".
- #
- attr_reader :class_and_module_list_heading
-
- #
- # The heading that should be displayed before listing attributes.
- #
- # If not supplied, this defaults to "Attributes".
- #
- attr_reader :attribute_list_heading
-
- #
- # ====Description:
- # This method constructs a KilmerFactory instance, which
- # can be used to build Kilmer-style template classes.
- # The +style_attributes+ argument is a Hash that contains the
- # values of the classes attributes (Symbols mapped to Strings).
- #
- # ====Parameters:
- # [style_attributes]
- # A Hash describing the appearance of the Kilmer-style.
- #
- def initialize(style_attributes)
- @central_css = style_attributes[:central_css]
- if(!@central_css)
- raise ArgumentError, "did not specify a value for :central_css"
- end
-
- @index_css = style_attributes[:index_css]
- if(!@index_css)
- raise ArgumentError, "did not specify a value for :index_css"
- end
-
- @method_list_heading = style_attributes[:method_list_heading]
- if(!@method_list_heading)
- @method_list_heading = "Methods"
- end
-
- @class_and_module_list_heading = style_attributes[:class_and_module_list_heading]
- if(!@class_and_module_list_heading)
- @class_and_module_list_heading = "Classes and Modules"
- end
-
- @attribute_list_heading = style_attributes[:attribute_list_heading]
- if(!@attribute_list_heading)
- @attribute_list_heading = "Attributes"
- end
- end
-
- def get_STYLE
- return @central_css
- end
-
- def get_METHOD_LIST
- return %{
-<% if values["diagram"] then %>
-<div id="diagram">
-<table width="100%"><tr><td align="center">
-<%= values["diagram"] %>
-</td></tr></table>
-</div>
-<% end %>
-
-<% if values["description"] then %>
-<div class="description"><%= values["description"] %></div>
-<% end %>
-
-<% if values["requires"] then %>
-<table cellpadding="5" width="100%">
-<tr><td class="tablesubtitle">Required files</td></tr>
-</table><br />
-<div class="name-list">
-<% values["requires"].each do |requires| %>
-<%= href requires["aref"], requires["name"] %>
-<% end %><%# values["requires"] %>
-</div>
-<% end %>
-
-<% if values["methods"] then %>
-<table cellpadding="5" width="100%">
-<tr><td class="tablesubtitle">#{@method_list_heading}</td></tr>
-</table><br />
-<div class="name-list">
-<% values["methods"].each do |methods| %>
-<%= href methods["aref"], methods["name"] %>,
-<% end %><%# values["methods"] %>
-</div>
-<% end %>
-
-<% if values["includes"] then %>
-<div class="tablesubsubtitle">Included modules</div><br />
-<div class="name-list">
-<% values["includes"].each do |includes| %>
- <span class="method-name"><%= href includes["aref"], includes["name"] %></span>
-<% end %><%# values["includes"] %>
-</div>
-<% end %>
-
-<% values["sections"].each do |sections| %>
- <div id="section">
-<% if sections["sectitle"] then %>
- <h2 class="section-title"><a name="<%= sections["secsequence"] %>"><%= sections["sectitle"] %></a></h2>
-<% if sections["seccomment"] then %>
- <div class="section-comment">
- <%= sections["seccomment"] %>
- </div>
-<% end %>
-<% end %>
-<% if sections["attributes"] then %>
-<table cellpadding="5" width="100%">
-<tr><td class="tablesubtitle">#{@attribute_list_heading}</td></tr>
-</table><br />
-<table cellspacing="5">
-<% sections["attributes"].each do |attributes| %>
- <tr valign="top">
-<% if attributes["rw"] then %>
- <td align="center" class="attr-rw">&nbsp;[<%= attributes["rw"] %>]&nbsp;</td>
-<% end %>
-<% unless attributes["rw"] then %>
- <td></td>
-<% end %>
- <td class="attr-name"><%= attributes["name"] %></td>
- <td><%= attributes["a_desc"] %></td>
- </tr>
-<% end %><%# sections["attributes"] %>
-</table>
-<% end %>
-
-<% if sections["classlist"] then %>
-<table cellpadding="5" width="100%">
-<tr><td class="tablesubtitle">#{@class_and_module_list_heading}</td></tr>
-</table><br />
-<%= sections["classlist"] %><br />
-<% end %>
-
-<% if sections["method_list"] then %>
-<% sections["method_list"].each do |method_list| %>
-<% if method_list["methods"] then %>
-<table cellpadding="5" width="100%">
-<tr><td class="tablesubtitle"><%= method_list["type"] %> <%= method_list["category"] %> methods</td></tr>
-</table>
-<% method_list["methods"].each do |methods| %>
-<table width="100%" cellspacing="0" cellpadding="5" border="0">
-<tr><td class="methodtitle">
-<a name="<%= methods["aref"] %>">
-<% if methods["callseq"] then %>
-<b><%= methods["callseq"] %></b>
-<% end %>
-<% unless methods["callseq"] then %>
- <b><%= methods["name"] %></b><%= methods["params"] %>
-<% end %>
-</a>
-<% if methods["codeurl"] then %>
-<a href="<%= methods["codeurl"] %>" target="source" class="srclink">src</a>
-<% end %>
-</td></tr>
-</table>
-<% if methods["m_desc"] then %>
-<div class="description">
-<%= methods["m_desc"] %>
-</div>
-<% end %>
-<% if methods["aka"] then %>
-<div class="aka">
-This method is also aliased as
-<% methods["aka"].each do |aka| %>
-<a href="<%= methods["aref"] %>"><%= methods["name"] %></a>
-<% end %><%# methods["aka"] %>
-</div>
-<% end %>
-<% if methods["sourcecode"] then %>
-<pre class="source">
-<%= methods["sourcecode"] %>
-</pre>
-<% end %>
-<% end %><%# method_list["methods"] %>
-<% end %>
-<% end %><%# sections["method_list"] %>
-<% end %>
-
-<% end %><%# values["sections"] %>
-</div>
-}
- end
-
- def get_BODY
- return XHTML_STRICT_PREAMBLE + HTML_ELEMENT + %{
-<head>
- <title><%= values["title"] %></title>
- <meta http-equiv="Content-Type" content="text/html; charset=<%= values["charset"] %>" />
- <link rel="stylesheet" href="<%= values["style_url"] %>" type="text/css" media="screen" />
- <script type="text/javascript">
- <!--
- function popCode(url) {
- parent.frames.source.location = url
- }
- //-->
- </script>
-</head>
-<body>
-<div class="bodyContent">
-<%= template_include %> <!-- banner header -->
-
-#{get_METHOD_LIST()}
-</div>
-</body>
-</html>
-}
- end
-
-def get_FILE_PAGE
- return %{
-<table width="100%">
- <tr class="title-row">
- <td><table width="100%"><tr>
- <td class="big-title-font" colspan="2">File<br /><%= values["short_name"] %></td>
- <td align="right"><table cellspacing="0" cellpadding="2">
- <tr>
- <td class="small-title-font">Path:</td>
- <td class="small-title-font"><%= values["full_path"] %>
-<% if values["cvsurl"] then %>
- &nbsp;(<a href="<%= values["cvsurl"] %>"><acronym title="Concurrent Versioning System">CVS</acronym></a>)
-<% end %>
- </td>
- </tr>
- <tr>
- <td class="small-title-font">Modified:</td>
- <td class="small-title-font"><%= values["dtm_modified"] %></td>
- </tr>
- </table>
- </td></tr></table></td>
- </tr>
-</table><br />
-}
-end
-
-def get_CLASS_PAGE
- return %{
-<table width="100%" border="0" cellspacing="0">
- <tr class="title-row">
- <td class="big-title-font">
- <%= values["classmod"] %><br /><%= values["full_name"] %>
- </td>
- <td align="right">
- <table cellspacing="0" cellpadding="2">
- <tr valign="top">
- <td class="small-title-font">In:</td>
- <td class="small-title-font">
-<% values["infiles"].each do |infiles| %>
-<%= href infiles["full_path_url"], infiles["full_path"] %>
-<% if infiles["cvsurl"] then %>
-&nbsp;(<a href="<%= infiles["cvsurl"] %>"><acronym title="Concurrent Versioning System">CVS</acronym></a>)
-<% end %>
-<% end %><%# values["infiles"] %>
- </td>
- </tr>
-<% if values["parent"] then %>
- <tr>
- <td class="small-title-font">Parent:</td>
- <td class="small-title-font">
-<% if values["par_url"] then %>
- <a href="<%= values["par_url"] %>" class="cyan">
-<% end %>
-<%= values["parent"] %>
-<% if values["par_url"] then %>
- </a>
-<% end %>
- </td>
- </tr>
-<% end %>
- </table>
- </td>
- </tr>
-</table><br />
-}
-end
-
-def get_SRC_PAGE
- return XHTML_STRICT_PREAMBLE + HTML_ELEMENT + %{
-<head><title><%= values["title"] %></title>
-<meta http-equiv="Content-Type" content="text/html; charset=<%= values["charset"] %>" />
-<link rel="stylesheet" href="<%= values["style_url"] %>" type="text/css" media="screen" />
-</head>
-<body>
-<pre><%= values["code"] %></pre>
-</body>
-</html>
-}
-end
-
-def get_FR_INDEX_BODY
- return %{<%= template_include %>}
-end
-
-def get_FILE_INDEX
- return XHTML_STRICT_PREAMBLE + HTML_ELEMENT + %{
-<head>
-<title><%= values["title"] %></title>
-<meta http-equiv="Content-Type" content="text/html; charset=<%= values["charset"] %>" />
-<style type="text/css">
-<!--
-#{@index_css}
--->
-</style>
-<base target="docwin" />
-</head>
-<body>
-<div class="index">
-<div class="banner"><%= values["list_title"] %></div>
-<% values["entries"].each do |entries| %>
-<a href="<%= entries["href"] %>"><%= entries["name"] %></a><br />
-<% end %><%# values["entries"] %>
-</div>
-</body></html>
-}
-end
-
-def get_CLASS_INDEX
- return get_FILE_INDEX
-end
-
-def get_METHOD_INDEX
- return get_FILE_INDEX
-end
-
-def get_INDEX
- return XHTML_FRAME_PREAMBLE + HTML_ELEMENT + %{
-<head>
- <title><%= values["title"] %></title>
- <meta http-equiv="Content-Type" content="text/html; charset=<%= values["charset"] %>" />
-</head>
-
-<frameset cols="20%,*">
- <frameset rows="15%,35%,50%">
- <frame src="fr_file_index.html" title="Files" name="Files" />
- <frame src="fr_class_index.html" name="Classes" />
- <frame src="fr_method_index.html" name="Methods" />
- </frameset>
-<% if values["inline_source"] then %>
- <frame src="<%= values["initial_page"] %>" name="docwin" />
-<% end %>
-<% unless values["inline_source"] then %>
- <frameset rows="80%,20%">
- <frame src="<%= values["initial_page"] %>" name="docwin" />
- <frame src="blank.html" name="source" />
- </frameset>
-<% end %>
-</frameset>
-
-</html>
-}
-end
-
-def get_BLANK
- # This will be displayed in the source code frame before
- # any source code has been selected.
- return XHTML_STRICT_PREAMBLE + HTML_ELEMENT + %{
-<head>
- <title>Source Code Frame <%= values["title_suffix"] %></title>
- <meta http-equiv="Content-Type" content="text/html; charset=<%= values["charset"] %>" />
- <link rel="stylesheet" href="<%= values["style_url"] %>" type="text/css" media="screen" />
-</head>
-<body>
-</body>
-</html>
-}
-end
-
-def write_extra_pages(values)
- template = RDoc::TemplatePage.new(get_BLANK())
- File.open("blank.html", "w") { |f| template.write_html_on(f, values) }
-end
-
-end
diff --git a/lib/rdoc/generator/html/one_page_html.rb b/lib/rdoc/generator/html/one_page_html.rb
deleted file mode 100644
index 5bae2f34f7..0000000000
--- a/lib/rdoc/generator/html/one_page_html.rb
+++ /dev/null
@@ -1,122 +0,0 @@
-require 'rdoc/generator/html'
-require 'rdoc/generator/html/common'
-
-module RDoc::Generator::HTML::ONE_PAGE_HTML
-
- include RDoc::Generator::HTML::Common
-
- CONTENTS_XML = <<-EOF
-<% if defined? classes and classes["description"] then %>
-<%= classes["description"] %>
-<% end %>
-
-<% if defined? files and files["requires"] then %>
-<h4>Requires:</h4>
-<ul>
-<% files["requires"].each do |requires| %>
-<% if requires["aref"] then %>
-<li><a href="<%= requires["aref"] %>"><%= requires["name"] %></a></li>
-<% end %>
-<% unless requires["aref"] then %>
-<li><%= requires["name"] %></li>
-<% end %>
-<% end %><%# files["requires"] %>
-</ul>
-<% end %>
-
-<% if defined? classes and classes["includes"] then %>
-<h4>Includes</h4>
-<ul>
-<% classes["includes"].each do |includes| %>
-<% if includes["aref"] then %>
-<li><a href="<%= includes["aref"] %>"><%= includes["name"] %></a></li>
-<% end %>
-<% unless includes["aref"] then %>
-<li><%= includes["name"] %></li>
-<% end %>
-<% end %><%# classes["includes"] %>
-</ul>
-<% end %>
-
-<% if defined? classes and classes["sections"] then %>
-<% classes["sections"].each do |sections| %>
-<% if sections["attributes"] then %>
-<h4>Attributes</h4>
-<table>
-<% sections["attributes"].each do |attributes| %>
-<tr><td><%= attributes["name"] %></td><td><%= attributes["rw"] %></td><td><%= attributes["a_desc"] %></td></tr>
-<% end %><%# sections["attributes"] %>
-</table>
-<% end %>
-
-<% if sections["method_list"] then %>
-<h3>Methods</h3>
-<% sections["method_list"].each do |method_list| %>
-<% if method_list["methods"] then %>
-<% method_list["methods"].each do |methods| %>
-<h4><%= methods["type"] %> <%= methods["category"] %> method:
-<% if methods["callseq"] then %>
-<a name="<%= methods["aref"] %>"><%= methods["callseq"] %></a>
-<% end %>
-<% unless methods["callseq"] then %>
-<a name="<%= methods["aref"] %>"><%= methods["name"] %><%= methods["params"] %></a></h4>
-<% end %>
-
-<% if methods["m_desc"] then %>
-<%= methods["m_desc"] %>
-<% end %>
-
-<% if methods["sourcecode"] then %>
-<blockquote><pre>
-<%= methods["sourcecode"] %>
-</pre></blockquote>
-<% end %>
-<% end %><%# method_list["methods"] %>
-<% end %>
-<% end %><%# sections["method_list"] %>
-<% end %>
-<% end %><%# classes["sections"] %>
-<% end %>
- EOF
-
- ONE_PAGE = XHTML_STRICT_PREAMBLE + HTML_ELEMENT + %{
-<head>
- <title><%= values["title"] %></title>
- <meta http-equiv="Content-Type" content="text/html; charset=<%= values["charset"] %>" />
-</head>
-<body>
-<% values["files"].each do |files| %>
-<h2>File: <a name="<%= files["href"] %>"><%= files["short_name"] %></a></h2>
-<table>
- <tr><td>Path:</td><td><%= files["full_path"] %></td></tr>
- <tr><td>Modified:</td><td><%= files["dtm_modified"] %></td></tr>
-</table>
-} + CONTENTS_XML + %{
-<% end %><%# values["files"] %>
-
-<% if values["classes"] then %>
-<h2>Classes</h2>
-<% values["classes"].each do |classes| %>
-<% if classes["parent"] then %>
-<h3><%= classes["classmod"] %> <a name="<%= classes["href"] %>"><%= classes["full_name"] %></a> &lt; <%= href classes["par_url"], classes["parent"] %></h3>
-<% end %>
-<% unless classes["parent"] then %>
-<h3><%= classes["classmod"] %> <%= classes["full_name"] %></h3>
-<% end %>
-
-<% if classes["infiles"] then %>
-(in files
-<% classes["infiles"].each do |infiles| %>
-<%= href infiles["full_path_url"], infiles["full_path"] %>
-<% end %><%# classes["infiles"] %>
-)
-<% end %>
-} + CONTENTS_XML + %{
-<% end %><%# values["classes"] %>
-<% end %>
-</body>
-</html>
-}
-
-end
-
diff --git a/lib/rdoc/generator/ri.rb b/lib/rdoc/generator/ri.rb
deleted file mode 100644
index 6b7a5932f8..0000000000
--- a/lib/rdoc/generator/ri.rb
+++ /dev/null
@@ -1,226 +0,0 @@
-require 'rdoc/generator'
-require 'rdoc/markup/to_flow'
-
-require 'rdoc/ri/cache'
-require 'rdoc/ri/reader'
-require 'rdoc/ri/writer'
-require 'rdoc/ri/descriptions'
-
-class RDoc::Generator::RI
-
- ##
- # Generator may need to return specific subclasses depending on the
- # options they are passed. Because of this we create them using a factory
-
- def self.for(options)
- new(options)
- end
-
- ##
- # Set up a new ri generator
-
- def initialize(options) #:not-new:
- @options = options
- @ri_writer = RDoc::RI::Writer.new "."
- @markup = RDoc::Markup.new
- @to_flow = RDoc::Markup::ToFlow.new
-
- @generated = {}
- end
-
- ##
- # Build the initial indices and output objects based on an array of
- # TopLevel objects containing the extracted information.
-
- def generate(toplevels)
- RDoc::TopLevel.all_classes_and_modules.each do |cls|
- process_class cls
- end
- end
-
- def process_class(from_class)
- generate_class_info(from_class)
-
- # now recurse into this class' constituent classes
- from_class.each_classmodule do |mod|
- process_class(mod)
- end
- end
-
- def generate_class_info(cls)
- case cls
- when RDoc::NormalModule then
- cls_desc = RDoc::RI::ModuleDescription.new
- else
- cls_desc = RDoc::RI::ClassDescription.new
- cls_desc.superclass = cls.superclass
- end
-
- cls_desc.name = cls.name
- cls_desc.full_name = cls.full_name
- cls_desc.comment = markup(cls.comment)
-
- cls_desc.attributes = cls.attributes.sort.map do |a|
- RDoc::RI::Attribute.new(a.name, a.rw, markup(a.comment))
- end
-
- cls_desc.constants = cls.constants.map do |c|
- RDoc::RI::Constant.new(c.name, c.value, markup(c.comment))
- end
-
- cls_desc.includes = cls.includes.map do |i|
- RDoc::RI::IncludedModule.new(i.name)
- end
-
- class_methods, instance_methods = method_list(cls)
-
- cls_desc.class_methods = class_methods.map do |m|
- RDoc::RI::MethodSummary.new(m.name)
- end
-
- cls_desc.instance_methods = instance_methods.map do |m|
- RDoc::RI::MethodSummary.new(m.name)
- end
-
- update_or_replace(cls_desc)
-
- class_methods.each do |m|
- generate_method_info(cls_desc, m)
- end
-
- instance_methods.each do |m|
- generate_method_info(cls_desc, m)
- end
- end
-
- def generate_method_info(cls_desc, method)
- meth_desc = RDoc::RI::MethodDescription.new
- meth_desc.name = method.name
- meth_desc.full_name = cls_desc.full_name
- if method.singleton
- meth_desc.full_name += "::"
- else
- meth_desc.full_name += "#"
- end
- meth_desc.full_name << method.name
-
- meth_desc.comment = markup(method.comment)
- meth_desc.params = params_of(method)
- meth_desc.visibility = method.visibility.to_s
- meth_desc.is_singleton = method.singleton
- meth_desc.block_params = method.block_params
-
- meth_desc.aliases = method.aliases.map do |a|
- RDoc::RI::AliasName.new(a.name)
- end
-
- @ri_writer.add_method(cls_desc, meth_desc)
- end
-
- private
-
- ##
- # Returns a list of class and instance methods that we'll be documenting
-
- def method_list(cls)
- list = cls.method_list
- unless @options.show_all
- list = list.find_all do |m|
- m.visibility == :public || m.visibility == :protected || m.force_documentation
- end
- end
-
- c = []
- i = []
- list.sort.each do |m|
- if m.singleton
- c << m
- else
- i << m
- end
- end
- return c,i
- end
-
- def params_of(method)
- if method.call_seq
- method.call_seq
- else
- params = method.params || ""
-
- p = params.gsub(/\s*\#.*/, '')
- p = p.tr("\n", " ").squeeze(" ")
- p = "(" + p + ")" unless p[0] == ?(
-
- if (block = method.block_params)
- block.gsub!(/\s*\#.*/, '')
- block = block.tr("\n", " ").squeeze(" ")
- if block[0] == ?(
- block.sub!(/^\(/, '').sub!(/\)/, '')
- end
- p << " {|#{block.strip}| ...}"
- end
- p
- end
- end
-
- def markup(comment)
- return nil if !comment || comment.empty?
-
- # Convert leading comment markers to spaces, but only
- # if all non-blank lines have them
-
- if comment =~ /^(?>\s*)[^\#]/
- content = comment
- else
- content = comment.gsub(/^\s*(#+)/) { $1.tr('#',' ') }
- end
- @markup.convert(content, @to_flow)
- end
-
- ##
- # By default we replace existing classes with the same name. If the
- # --merge option was given, we instead merge this definition into an
- # existing class. We add our methods, aliases, etc to that class, but do
- # not change the class's description.
-
- def update_or_replace(cls_desc)
- old_cls = nil
-
- if @options.merge
- rdr = RDoc::RI::Reader.new RDoc::RI::Cache.new(@options.op_dir)
-
- namespace = rdr.top_level_namespace
- namespace = rdr.lookup_namespace_in(cls_desc.name, namespace)
- if namespace.empty?
- $stderr.puts "You asked me to merge this source into existing "
- $stderr.puts "documentation. This file references a class or "
- $stderr.puts "module called #{cls_desc.name} which I don't"
- $stderr.puts "have existing documentation for."
- $stderr.puts
- $stderr.puts "Perhaps you need to generate its documentation first"
- exit 1
- else
- old_cls = namespace[0]
- end
- end
-
- prev_cls = @generated[cls_desc.full_name]
-
- if old_cls and not prev_cls then
- old_desc = rdr.get_class old_cls
- cls_desc.merge_in old_desc
- end
-
- if prev_cls then
- cls_desc.merge_in prev_cls
- end
-
- @generated[cls_desc.full_name] = cls_desc
-
- @ri_writer.remove_class cls_desc
- @ri_writer.add_class cls_desc
- end
-
-end
-
diff --git a/lib/rdoc/generator/texinfo.rb b/lib/rdoc/generator/texinfo.rb
deleted file mode 100644
index 99a1452f21..0000000000
--- a/lib/rdoc/generator/texinfo.rb
+++ /dev/null
@@ -1,81 +0,0 @@
-require 'rdoc/rdoc'
-require 'rdoc/generator'
-require 'rdoc/markup/to_texinfo'
-
-module RDoc
- module Generator
- # This generates Texinfo files for viewing with GNU Info or Emacs
- # from RDoc extracted from Ruby source files.
- class TEXINFO
- # What should the .info file be named by default?
- DEFAULT_INFO_FILENAME = 'rdoc.info'
-
- include Generator::MarkUp
-
- # Accept some options
- def initialize(options)
- @options = options
- @options.inline_source = true
- @options.op_name ||= 'rdoc.texinfo'
- @options.formatter = ::RDoc::Markup::ToTexInfo.new
- end
-
- # Generate the +texinfo+ files
- def generate(toplevels)
- @toplevels = toplevels
- @files, @classes = ::RDoc::Generator::Context.build_indices(@toplevels,
- @options)
-
- (@files + @classes).each { |x| x.value_hash }
-
- open(@options.op_name, 'w') do |f|
- f.puts TexinfoTemplate.new('files' => @files,
- 'classes' => @classes,
- 'filename' => @options.op_name.gsub(/texinfo/, 'info'),
- 'title' => @options.title).render
- end
- # TODO: create info files and install?
- end
-
- class << self
- # Factory? We don't need no stinkin' factory!
- alias_method :for, :new
- end
- end
-
- # Basically just a wrapper around ERB.
- # Should probably use RDoc::TemplatePage instead
- class TexinfoTemplate
- BASE_DIR = ::File.expand_path(::File.dirname(__FILE__)) # have to calculate this when the file's loaded.
-
- def initialize(values, file = 'texinfo.erb')
- @v, @file = [values, file]
- end
-
- def template
- ::File.read(::File.join(BASE_DIR, 'texinfo', @file))
- end
-
- # Go!
- def render
- ERB.new(template).result binding
- end
-
- def href(location, text)
- text # TODO: how does texinfo do hyperlinks?
- end
-
- def target(name, text)
- text # TODO: how do hyperlink targets work?
- end
-
- # TODO: this is probably implemented elsewhere?
- def method_prefix(section)
- { 'Class' => '.',
- 'Module' => '::',
- 'Instance' => '#',
- }[section['category']]
- end
- end
- end
-end
diff --git a/lib/rdoc/generator/texinfo/class.texinfo.erb b/lib/rdoc/generator/texinfo/class.texinfo.erb
deleted file mode 100644
index 74ecc59f7d..0000000000
--- a/lib/rdoc/generator/texinfo/class.texinfo.erb
+++ /dev/null
@@ -1,44 +0,0 @@
-@node <%= @v['class']['full_name'].gsub(/::/, '-') %>
-@chapter <%= @v['class']["classmod"] %> <%= @v['class']['full_name'] %>
-
-<% if @v['class']["parent"] and @v['class']['par_url'] %>
-Inherits <%= href @v['class']["par_url"], @v['class']["parent"] %><% end %>
-
-<%= @v['class']["description"] %>
-
-<% if @v['class']["includes"] %>
-Includes
-<% @v['class']["includes"].each do |include| %>
-* <%= href include["aref"], include["name"] %>
-<% end # @v['class']["includes"] %>
-<% end %>
-
-<% if @v['class']["sections"] %>
-<% @v['class']["sections"].each do |section| %>
-<% if section["attributes"] %>
-Attributes
-<% section["attributes"].each do |attributes| %>
-* <%= attributes["name"] %> <%= attributes["rw"] %> <%= attributes["a_desc"] %>
-<% end # section["attributes"] %>
-<% end %>
-<% end %>
-
-<% @v['class']["sections"].each do |section| %>
-<% if section["method_list"] %>
-Methods
-@menu
-<% section["method_list"].each_with_index do |method_list, i| %>
-<%= i %>
-<% (method_list["methods"] || []).each do |method| %>
-* <%= @v['class']['full_name'].gsub(/::/, '-') %><%= method_prefix method_list %><%= method['name'] %>::<% end %>
-<% end %>
-@end menu
-
-<% section["method_list"].each do |method_list| %>
-<% (method_list["methods"] || []).uniq.each do |method| %>
-<%= TexinfoTemplate.new(@v.merge({'method' => method, 'list' => method_list}),
- 'method.texinfo.erb').render %><% end %>
-<% end %>
-<% end # if section["method_list"] %>
-<% end # @v['class']["sections"] %>
-<% end %>
diff --git a/lib/rdoc/generator/texinfo/file.texinfo.erb b/lib/rdoc/generator/texinfo/file.texinfo.erb
deleted file mode 100644
index b619b94bd2..0000000000
--- a/lib/rdoc/generator/texinfo/file.texinfo.erb
+++ /dev/null
@@ -1,6 +0,0 @@
-<% if false %>
-<h2>File: <%= @v['file']["short_name"] %></h2>
-Path: <%= @v['file']["full_path"] %>
-
-<%= TexinfoTemplate.new(@v, 'content.texinfo.erb').render %>
-<% end %>
diff --git a/lib/rdoc/generator/texinfo/method.texinfo.erb b/lib/rdoc/generator/texinfo/method.texinfo.erb
deleted file mode 100644
index f5c2b73a4b..0000000000
--- a/lib/rdoc/generator/texinfo/method.texinfo.erb
+++ /dev/null
@@ -1,6 +0,0 @@
-@node <%= @v['class']['full_name'].gsub(/::/, '-') %><%= method_prefix @v['list'] %><%= @v['method']['name'] %>
-@section <%= @v['class']["classmod"] %> <%= @v['class']['full_name'] %><%= method_prefix @v['list'] %><%= @v['method']['name'] %>
-<%= @v['method']["type"] %> <%= @v['method']["category"] %> method:
-<%= target @v['method']["aref"], @v['method']['callseq'] ||
- @v['method']["name"] + @v['method']["params"] %>
-<%= @v['method']["m_desc"] %>
diff --git a/lib/rdoc/generator/texinfo/texinfo.erb b/lib/rdoc/generator/texinfo/texinfo.erb
deleted file mode 100644
index 235f63d73c..0000000000
--- a/lib/rdoc/generator/texinfo/texinfo.erb
+++ /dev/null
@@ -1,28 +0,0 @@
-\input texinfo @c -*-texinfo-*-
-@c %**start of header
-@setfilename <%= @v['filename'] %>
-@settitle <%= @v['title'] %>
-@c %**end of header
-
-@contents @c TODO: whitespace is a mess... =\
-
-@ifnottex
-@node Top
-
-@top <%= @v['title'] %>
-@end ifnottex
-
-<% if @f = @v['files'].detect { |f| f.name =~ /Readme/i } %>
-<%= @f.values['description'] %><% end %>
-
-@menu
-<% @v['classes'].each do |klass| %>
-* <%= klass.name.gsub(/::/, '-') %>::<% end %>
-@c TODO: add files
-@end menu
-
-<% (@v['classes'] || []).each_with_index do |klass, i| %>
-<%= TexinfoTemplate.new(@v.merge('class' => klass.values),
- 'class.texinfo.erb').render %><% end %>
-
-@bye
diff --git a/lib/rdoc/generator/xml.rb b/lib/rdoc/generator/xml.rb
deleted file mode 100644
index 0d4c5a7ea1..0000000000
--- a/lib/rdoc/generator/xml.rb
+++ /dev/null
@@ -1,117 +0,0 @@
-require 'rdoc/generator/html'
-
-##
-# Generate XML output as one big file
-
-class RDoc::Generator::XML < RDoc::Generator::HTML
-
- ##
- # Standard generator factory
-
- def self.for(options)
- new(options)
- end
-
- def initialize(*args)
- super
- end
-
- ##
- # Build the initial indices and output objects
- # based on an array of TopLevel objects containing
- # the extracted information.
-
- def generate(info)
- @info = info
- @files = []
- @classes = []
- @hyperlinks = {}
-
- build_indices
- generate_xml
- end
-
- ##
- # Generate:
- #
- # * a list of File objects for each TopLevel object.
- # * a list of Class objects for each first level
- # class or module in the TopLevel objects
- # * a complete list of all hyperlinkable terms (file,
- # class, module, and method names)
-
- def build_indices
- @info.each do |toplevel|
- @files << RDoc::Generator::File.new(toplevel, @options, RDoc::Generator::FILE_DIR)
- end
-
- RDoc::TopLevel.all_classes_and_modules.each do |cls|
- build_class_list(cls, @files[0], RDoc::Generator::CLASS_DIR)
- end
- end
-
- def build_class_list(from, html_file, class_dir)
- @classes << RDoc::Generator::Class.new(from, html_file, class_dir, @options)
- from.each_classmodule do |mod|
- build_class_list(mod, html_file, class_dir)
- end
- end
-
- ##
- # Generate all the HTML. For the one-file case, we generate
- # all the information in to one big hash
-
- def generate_xml
- values = {
- 'charset' => @options.charset,
- 'files' => gen_into(@files),
- 'classes' => gen_into(@classes)
- }
-
- template = RDoc::TemplatePage.new @template::ONE_PAGE
-
- if @options.op_name
- opfile = File.open(@options.op_name, "w")
- else
- opfile = $stdout
- end
- template.write_html_on(opfile, values)
- end
-
- def gen_into(list)
- res = []
- list.each do |item|
- res << item.value_hash
- end
- res
- end
-
- def gen_file_index
- gen_an_index(@files, 'Files')
- end
-
- def gen_class_index
- gen_an_index(@classes, 'Classes')
- end
-
- def gen_method_index
- gen_an_index(RDoc::Generator::HtmlMethod.all_methods, 'Methods')
- end
-
- def gen_an_index(collection, title)
- res = []
- collection.sort.each do |f|
- if f.document_self
- res << { "href" => f.path, "name" => f.index_name }
- end
- end
-
- return {
- "entries" => res,
- 'list_title' => title,
- 'index_url' => main_url,
- }
- end
-
-end
-
diff --git a/lib/rdoc/generator/xml/rdf.rb b/lib/rdoc/generator/xml/rdf.rb
deleted file mode 100644
index 7b15c69a18..0000000000
--- a/lib/rdoc/generator/xml/rdf.rb
+++ /dev/null
@@ -1,113 +0,0 @@
-require 'rdoc/generator/xml'
-
-module RDoc::Generator::XML::RDF
-
- CONTENTS_RDF = <<-EOF
-<% if defined? classes and classes["description"] then %>
- <description rd:parseType="Literal">
-<%= classes["description"] %>
- </description>
-<% end %>
-
-<% if defined? files and files["requires"] then %>
-<% files["requires"].each do |requires| %>
- <rd:required-file rd:name="<%= requires["name"] %>" />
-<% end # files["requires"] %>
-<% end %>
-
-<% if defined? classes and classes["includes"] then %>
- <IncludedModuleList>
-<% classes["includes"].each do |includes| %>
- <included-module rd:name="<%= includes["name"] %>" />
-<% end # includes["includes"] %>
- </IncludedModuleList>
-<% end %>
-
-<% if defined? classes and classes["sections"] then %>
-<% classes["sections"].each do |sections| %>
-<% if sections["attributes"] then %>
-<% sections["attributes"].each do |attributes| %>
- <contents>
- <Attribute rd:name="<%= attributes["name"] %>">
-<% if attributes["rw"] then %>
- <attribute-rw><%= attributes["rw"] %></attribute-rw>
-<% end %>
- <description rdf:parseType="Literal"><%= attributes["a_desc"] %></description>
- </Attribute>
- </contents>
-<% end # sections["attributes"] %>
-<% end %>
-
-<% if sections["method_list"] then %>
-<% sections["method_list"].each do |method_list| %>
-<% if method_list["methods"] then %>
-<% method_list["methods"].each do |methods| %>
- <contents>
- <Method rd:name="<%= methods["name"] %>" rd:visibility="<%= methods["type"] %>"
- rd:category="<%= methods["category"] %>" rd:id="<%= methods["aref"] %>">
- <parameters><%= methods["params"] %></parameters>
-<% if methods["m_desc"] then %>
- <description rdf:parseType="Literal">
-<%= methods["m_desc"] %>
- </description>
-<% end %>
-<% if methods["sourcecode"] then %>
- <source-code-listing rdf:parseType="Literal">
-<%= methods["sourcecode"] %>
- </source-code-listing>
-<% end %>
- </Method>
- </contents>
-<% end # method_list["methods"] %>
-<% end %>
-<% end # sections["method_list"] %>
-<% end %>
- <!-- end method list -->
-<% end # classes["sections"] %>
-<% end %>
- EOF
-
-########################################################################
-
- ONE_PAGE = %{<?xml version="1.0" encoding="utf-8"?>
-<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns="http://pragprog.com/rdoc/rdoc.rdf#"
- xmlns:rd="http://pragprog.com/rdoc/rdoc.rdf#">
-
-<!-- RDoc -->
-<% values["files"].each do |files| %>
- <rd:File rd:name="<%= files["short_name"] %>" rd:id="<%= files["href"] %>">
- <path><%= files["full_path"] %></path>
- <dtm-modified><%= files["dtm_modified"] %></dtm-modified>
-} + CONTENTS_RDF + %{
- </rd:File>
-<% end # values["files"] %>
-<% values["classes"].each do |classes| %>
- <<%= values["classmod"] %> rd:name="<%= classes["full_name"] %>" rd:id="<%= classes["full_name"] %>">
- <classmod-info>
-<% if classes["infiles"] then %>
- <InFiles>
-<% classes["infiles"].each do |infiles| %>
- <infile>
- <File rd:name="<%= infiles["full_path"] %>"
-<% if infiles["full_path_url"] then %>
- rdf:about="<%= infiles["full_path_url"] %>"
-<% end %>
- />
- </infile>
-<% end # classes["infiles"] %>
- </InFiles>
-<% end %>
-<% if classes["parent"] then %>
- <superclass><%= href classes["par_url"], classes["parent"] %></superclass>
-<% end %>
- </classmod-info>
-} + CONTENTS_RDF + %{
- </<%= classes["classmod"] %>>
-<% end # values["classes"] %>
-<!-- /RDoc -->
-</rdf:RDF>
-}
-
-end
-
diff --git a/lib/rdoc/generator/xml/xml.rb b/lib/rdoc/generator/xml/xml.rb
deleted file mode 100644
index 4b54e7350f..0000000000
--- a/lib/rdoc/generator/xml/xml.rb
+++ /dev/null
@@ -1,123 +0,0 @@
-require 'rdoc/generator/xml'
-
-module RDoc::Generator::XML::XML
-
- CONTENTS_XML = <<-EOF
-<% if defined? classes and classes["description"] then %>
- <description>
-<%= classes["description"] %>
- </description>
-<% end %>
- <contents>
-<% if defined? files and files["requires"] then %>
- <required-file-list>
-<% files["requires"].each do |requires| %>
- <required-file name="<%= requires["name"] %>"
-<% if requires["aref"] then %>
- href="<%= requires["aref"] %>"
-<% end %>
- />
-<% end %><%# files["requires"] %>
- </required-file-list>
-<% end %>
-<% if defined? classes and classes["sections"] then %>
-<% classes["sections"].each do |sections| %>
-<% if sections["constants"] then %>
- <constant-list>
-<% sections["constants"].each do |constant| %>
- <constant name="<%= constant["name"] %>">
-<% if constant["value"] then %>
- <value><%= constant["value"] %></value>
-<% end %>
- <description><%= constant["a_desc"] %></description>
- </constant>
-<% end %><%# sections["constants"] %>
- </constant-list>
-<% end %>
-<% if sections["attributes"] then %>
- <attribute-list>
-<% sections["attributes"].each do |attributes| %>
- <attribute name="<%= attributes["name"] %>">
-<% if attributes["rw"] then %>
- <attribute-rw><%= attributes["rw"] %></attribute-rw>
-<% end %>
- <description><%= attributes["a_desc"] %></description>
- </attribute>
-<% end %><%# sections["attributes"] %>
- </attribute-list>
-<% end %>
-<% if sections["method_list"] then %>
- <method-list>
-<% sections["method_list"].each do |method_list| %>
-<% if method_list["methods"] then %>
-<% method_list["methods"].each do |methods| %>
- <method name="<%= methods["name"] %>" type="<%= methods["type"] %>" category="<%= methods["category"] %>" id="<%= methods["aref"] %>">
- <parameters><%= methods["params"] %></parameters>
-<% if methods["m_desc"] then %>
- <description>
-<%= methods["m_desc"] %>
- </description>
-<% end %>
-<% if methods["sourcecode"] then %>
- <source-code-listing>
-<%= methods["sourcecode"] %>
- </source-code-listing>
-<% end %>
- </method>
-<% end %><%# method_list["methods"] %>
-<% end %>
-<% end %><%# sections["method_list"] %>
- </method-list>
-<% end %>
-<% end %><%# classes["sections"] %>
-<% end %>
-<% if defined? classes and classes["includes"] then %>
- <included-module-list>
-<% classes["includes"].each do |includes| %>
- <included-module name="<%= includes["name"] %>"
-<% if includes["aref"] then %>
- href="<%= includes["aref"] %>"
-<% end %>
- />
-<% end %><%# classes["includes"] %>
- </included-module-list>
-<% end %>
- </contents>
- EOF
-
- ONE_PAGE = %{<?xml version="1.0" encoding="utf-8"?>
-<rdoc>
-<file-list>
-<% values["files"].each do |files| %>
- <file name="<%= files["short_name"] %>" id="<%= files["href"] %>">
- <file-info>
- <path><%= files["full_path"] %></path>
- <dtm-modified><%= files["dtm_modified"] %></dtm-modified>
- </file-info>
-} + CONTENTS_XML + %{
- </file>
-<% end %><%# values["files"] %>
-</file-list>
-<class-module-list>
-<% values["classes"].each do |classes| %>
- <<%= classes["classmod"] %> name="<%= classes["full_name"] %>" id="<%= classes["full_name"] %>">
- <classmod-info>
-<% if classes["infiles"] then %>
- <infiles>
-<% classes["infiles"].each do |infiles| %>
- <infile><%= href infiles["full_path_url"], infiles["full_path"] %></infile>
-<% end %><%# classes["infiles"] %>
- </infiles>
-<% end %>
-<% if classes["parent"] then %>
- <superclass><%= href classes["par_url"], classes["parent"] %></superclass>
-<% end %>
- </classmod-info>
-} + CONTENTS_XML + %{
- </<%= classes["classmod"] %>>
-<% end %><%# values["classes"] %>
-</class-module-list>
-</rdoc>
-}
-
-end
diff --git a/lib/rdoc/generators/chm_generator.rb b/lib/rdoc/generators/chm_generator.rb
new file mode 100644
index 0000000000..51eeda8dd1
--- /dev/null
+++ b/lib/rdoc/generators/chm_generator.rb
@@ -0,0 +1,112 @@
+require 'rdoc/generators/html_generator'
+
+module Generators
+
+ class CHMGenerator < HTMLGenerator
+
+ HHC_PATH = "c:/Program Files/HTML Help Workshop/hhc.exe"
+
+ # Standard generator factory
+ def CHMGenerator.for(options)
+ CHMGenerator.new(options)
+ end
+
+
+ def initialize(*args)
+ super
+ @op_name = @options.op_name || "rdoc"
+ check_for_html_help_workshop
+ end
+
+ def check_for_html_help_workshop
+ stat = File.stat(HHC_PATH)
+ rescue
+ $stderr <<
+ "\n.chm output generation requires that Microsoft's Html Help\n" <<
+ "Workshop is installed. RDoc looks for it in:\n\n " <<
+ HHC_PATH <<
+ "\n\nYou can download a copy for free from:\n\n" <<
+ " http://msdn.microsoft.com/library/default.asp?" <<
+ "url=/library/en-us/htmlhelp/html/hwMicrosoftHTMLHelpDownloads.asp\n\n"
+
+ exit 99
+ end
+
+ # Generate the html as normal, then wrap it
+ # in a help project
+ def generate(info)
+ super
+ @project_name = @op_name + ".hhp"
+ create_help_project
+ end
+
+ # The project contains the project file, a table of contents
+ # and an index
+ def create_help_project
+ create_project_file
+ create_contents_and_index
+ compile_project
+ end
+
+ # The project file links together all the various
+ # files that go to make up the help.
+
+ def create_project_file
+ template = TemplatePage.new(RDoc::Page::HPP_FILE)
+ values = { "title" => @options.title, "opname" => @op_name }
+ files = []
+ @files.each do |f|
+ files << { "html_file_name" => f.path }
+ end
+
+ values['all_html_files'] = files
+
+ File.open(@project_name, "w") do |f|
+ template.write_html_on(f, values)
+ end
+ end
+
+ # The contents is a list of all files and modules.
+ # For each we include as sub-entries the list
+ # of methods they contain. As we build the contents
+ # we also build an index file
+
+ def create_contents_and_index
+ contents = []
+ index = []
+
+ (@files+@classes).sort.each do |entry|
+ content_entry = { "c_name" => entry.name, "ref" => entry.path }
+ index << { "name" => entry.name, "aref" => entry.path }
+
+ internals = []
+
+ methods = entry.build_method_summary_list(entry.path)
+
+ content_entry["methods"] = methods unless methods.empty?
+ contents << content_entry
+ index.concat methods
+ end
+
+ values = { "contents" => contents }
+ template = TemplatePage.new(RDoc::Page::CONTENTS)
+ File.open("contents.hhc", "w") do |f|
+ template.write_html_on(f, values)
+ end
+
+ values = { "index" => index }
+ template = TemplatePage.new(RDoc::Page::CHM_INDEX)
+ File.open("index.hhk", "w") do |f|
+ template.write_html_on(f, values)
+ end
+ end
+
+ # Invoke the windows help compiler to compiler the project
+ def compile_project
+ system(HHC_PATH, @project_name)
+ end
+
+ end
+
+
+end
diff --git a/lib/rdoc/generators/html_generator.rb b/lib/rdoc/generators/html_generator.rb
new file mode 100644
index 0000000000..1f9b808e8d
--- /dev/null
+++ b/lib/rdoc/generators/html_generator.rb
@@ -0,0 +1,1509 @@
+# We're responsible for generating all the HTML files
+# from the object tree defined in code_objects.rb. We
+# generate:
+#
+# [files] an html file for each input file given. These
+# input files appear as objects of class
+# TopLevel
+#
+# [classes] an html file for each class or module encountered.
+# These classes are not grouped by file: if a file
+# contains four classes, we'll generate an html
+# file for the file itself, and four html files
+# for the individual classes.
+#
+# [indices] we generate three indices for files, classes,
+# and methods. These are displayed in a browser
+# like window with three index panes across the
+# top and the selected description below
+#
+# Method descriptions appear in whatever entity (file, class,
+# or module) that contains them.
+#
+# We generate files in a structure below a specified subdirectory,
+# normally +doc+.
+#
+# opdir
+# |
+# |___ files
+# | |__ per file summaries
+# |
+# |___ classes
+# |__ per class/module descriptions
+#
+# HTML is generated using the Template class.
+#
+
+require 'ftools'
+
+require 'rdoc/options'
+require 'rdoc/template'
+require 'rdoc/markup/simple_markup'
+require 'rdoc/markup/simple_markup/to_html'
+require 'cgi'
+
+module Generators
+
+ # Name of sub-direcories that hold file and class/module descriptions
+
+ FILE_DIR = "files"
+ CLASS_DIR = "classes"
+ CSS_NAME = "rdoc-style.css"
+
+
+ ##
+ # Build a hash of all items that can be cross-referenced.
+ # This is used when we output required and included names:
+ # if the names appear in this hash, we can generate
+ # an html cross reference to the appropriate description.
+ # We also use this when parsing comment blocks: any decorated
+ # words matching an entry in this list are hyperlinked.
+
+ class AllReferences
+ @@refs = {}
+
+ def AllReferences::reset
+ @@refs = {}
+ end
+
+ def AllReferences.add(name, html_class)
+ @@refs[name] = html_class
+ end
+
+ def AllReferences.[](name)
+ @@refs[name]
+ end
+
+ def AllReferences.keys
+ @@refs.keys
+ end
+ end
+
+
+ ##
+ # Subclass of the SM::ToHtml class that supports looking
+ # up words in the AllReferences list. Those that are
+ # found (like AllReferences in this comment) will
+ # be hyperlinked
+
+ class HyperlinkHtml < SM::ToHtml
+ # We need to record the html path of our caller so we can generate
+ # correct relative paths for any hyperlinks that we find
+ def initialize(from_path, context)
+ super()
+ @from_path = from_path
+
+ @parent_name = context.parent_name
+ @parent_name += "::" if @parent_name
+ @context = context
+ end
+
+ # We're invoked when any text matches the CROSSREF pattern
+ # (defined in MarkUp). If we fine the corresponding reference,
+ # generate a hyperlink. If the name we're looking for contains
+ # no punctuation, we look for it up the module/class chain. For
+ # example, HyperlinkHtml is found, even without the Generators::
+ # prefix, because we look for it in module Generators first.
+
+ def handle_special_CROSSREF(special)
+ name = special.text
+ if name[0,1] == '#'
+ lookup = name[1..-1]
+ name = lookup unless Options.instance.show_hash
+ else
+ lookup = name
+ end
+
+ # Find class, module, or method in class or module.
+ if /([A-Z]\w*)[.\#](\w+[!?=]?)/ =~ lookup
+ container = $1
+ method = $2
+ ref = @context.find_symbol(container, method)
+ elsif /([A-Za-z]\w*)[.\#](\w+(\([\.\w+\*\/\+\-\=\<\>]+\))?)/ =~ lookup
+ container = $1
+ method = $2
+ ref = @context.find_symbol(container, method)
+ else
+ ref = @context.find_symbol(lookup)
+ end
+
+ if ref and ref.document_self
+ "<a href=\"#{ref.as_href(@from_path)}\">#{name}</a>"
+ else
+ name
+ end
+ end
+
+
+ # Generate a hyperlink for url, labeled with text. Handle the
+ # special cases for img: and link: described under handle_special_HYPEDLINK
+ def gen_url(url, text)
+ if url =~ /([A-Za-z]+):(.*)/
+ type = $1
+ path = $2
+ else
+ type = "http"
+ path = url
+ url = "http://#{url}"
+ end
+
+ if type == "link"
+ if path[0,1] == '#' # is this meaningful?
+ url = path
+ else
+ url = HTMLGenerator.gen_url(@from_path, path)
+ end
+ end
+
+ if (type == "http" || type == "link") &&
+ url =~ /\.(gif|png|jpg|jpeg|bmp)$/
+
+ "<img src=\"#{url}\" />"
+ else
+ "<a href=\"#{url}\">#{text.sub(%r{^#{type}:/*}, '')}</a>"
+ end
+ end
+
+ # And we're invoked with a potential external hyperlink mailto:
+ # just gets inserted. http: links are checked to see if they
+ # reference an image. If so, that image gets inserted using an
+ # <img> tag. Otherwise a conventional <a href> is used. We also
+ # support a special type of hyperlink, link:, which is a reference
+ # to a local file whose path is relative to the --op directory.
+
+ def handle_special_HYPERLINK(special)
+ url = special.text
+ gen_url(url, url)
+ end
+
+ # HEre's a hypedlink where the label is different to the URL
+ # <label>[url]
+ #
+
+ def handle_special_TIDYLINK(special)
+ text = special.text
+# unless text =~ /(\S+)\[(.*?)\]/
+ unless text =~ /\{(.*?)\}\[(.*?)\]/ or text =~ /(\S+)\[(.*?)\]/
+ return text
+ end
+ label = $1
+ url = $2
+ gen_url(url, label)
+ end
+
+ end
+
+
+
+ #####################################################################
+ #
+ # Handle common markup tasks for the various Html classes
+ #
+
+ module MarkUp
+
+ # Convert a string in markup format into HTML. We keep a cached
+ # SimpleMarkup object lying around after the first time we're
+ # called per object.
+
+ def markup(str, remove_para=false)
+ return '' unless str
+ unless defined? @markup
+ @markup = SM::SimpleMarkup.new
+
+ # class names, variable names, or instance variables
+ @markup.add_special(/(
+ \w+(::\w+)*[.\#]\w+(\([\.\w+\*\/\+\-\=\<\>]+\))? # A::B.meth(**) (for operator in Fortran95)
+ | \#\w+(\([.\w\*\/\+\-\=\<\>]+\))? # meth(**) (for operator in Fortran95)
+ | \b([A-Z]\w*(::\w+)*[.\#]\w+) # A::B.meth
+ | \b([A-Z]\w+(::\w+)*) # A::B..
+ | \#\w+[!?=]? # #meth_name
+ | \b\w+([_\/\.]+\w+)*[!?=]? # meth_name
+ )/x,
+ :CROSSREF)
+
+ # external hyperlinks
+ @markup.add_special(/((link:|https?:|mailto:|ftp:|www\.)\S+\w)/, :HYPERLINK)
+
+ # and links of the form <text>[<url>]
+ @markup.add_special(/(((\{.*?\})|\b\S+?)\[\S+?\.\S+?\])/, :TIDYLINK)
+# @markup.add_special(/\b(\S+?\[\S+?\.\S+?\])/, :TIDYLINK)
+
+ end
+ unless defined? @html_formatter
+ @html_formatter = HyperlinkHtml.new(self.path, self)
+ end
+
+ # Convert leading comment markers to spaces, but only
+ # if all non-blank lines have them
+
+ if str =~ /^(?>\s*)[^\#]/
+ content = str
+ else
+ content = str.gsub(/^\s*(#+)/) { $1.tr('#',' ') }
+ end
+
+ res = @markup.convert(content, @html_formatter)
+ if remove_para
+ res.sub!(/^<p>/, '')
+ res.sub!(/<\/p>$/, '')
+ end
+ res
+ end
+
+ # Qualify a stylesheet URL; if if +css_name+ does not begin with '/' or
+ # 'http[s]://', prepend a prefix relative to +path+. Otherwise, return it
+ # unmodified.
+
+ def style_url(path, css_name=nil)
+# $stderr.puts "style_url( #{path.inspect}, #{css_name.inspect} )"
+ css_name ||= CSS_NAME
+ if %r{^(https?:/)?/} =~ css_name
+ return css_name
+ else
+ return HTMLGenerator.gen_url(path, css_name)
+ end
+ end
+
+ # Build a webcvs URL with the given 'url' argument. URLs with a '%s' in them
+ # get the file's path sprintfed into them; otherwise they're just catenated
+ # together.
+
+ def cvs_url(url, full_path)
+ if /%s/ =~ url
+ return sprintf( url, full_path )
+ else
+ return url + full_path
+ end
+ end
+ end
+
+
+ #####################################################################
+ #
+ # A Context is built by the parser to represent a container: contexts
+ # hold classes, modules, methods, require lists and include lists.
+ # ClassModule and TopLevel are the context objects we process here
+ #
+ class ContextUser
+
+ include MarkUp
+
+ attr_reader :context
+
+ def initialize(context, options)
+ @context = context
+ @options = options
+ end
+
+ # convenience method to build a hyperlink
+ def href(link, cls, name)
+ %{<a href="#{link}" class="#{cls}">#{name}</a>} #"
+ end
+
+ # return a reference to outselves to be used as an href=
+ # the form depends on whether we're all in one file
+ # or in multiple files
+
+ def as_href(from_path)
+ if @options.all_one_file
+ "#" + path
+ else
+ HTMLGenerator.gen_url(from_path, path)
+ end
+ end
+
+ # Create a list of HtmlMethod objects for each method
+ # in the corresponding context object. If the @options.show_all
+ # variable is set (corresponding to the <tt>--all</tt> option,
+ # we include all methods, otherwise just the public ones.
+
+ def collect_methods
+ list = @context.method_list
+ unless @options.show_all
+ list = list.find_all {|m| m.visibility == :public || m.visibility == :protected || m.force_documentation }
+ end
+ @methods = list.collect {|m| HtmlMethod.new(m, self, @options) }
+ end
+
+ # Build a summary list of all the methods in this context
+ def build_method_summary_list(path_prefix="")
+ collect_methods unless @methods
+ meths = @methods.sort
+ res = []
+ meths.each do |meth|
+ res << {
+ "name" => CGI.escapeHTML(meth.name),
+ "aref" => "#{path_prefix}\##{meth.aref}"
+ }
+ end
+ res
+ end
+
+
+ # Build a list of aliases for which we couldn't find a
+ # corresponding method
+ def build_alias_summary_list(section)
+ values = []
+ @context.aliases.each do |al|
+ next unless al.section == section
+ res = {
+ 'old_name' => al.old_name,
+ 'new_name' => al.new_name,
+ }
+ if al.comment && !al.comment.empty?
+ res['desc'] = markup(al.comment, true)
+ end
+ values << res
+ end
+ values
+ end
+
+ # Build a list of constants
+ def build_constants_summary_list(section)
+ values = []
+ @context.constants.each do |co|
+ next unless co.section == section
+ res = {
+ 'name' => co.name,
+ 'value' => CGI.escapeHTML(co.value)
+ }
+ res['desc'] = markup(co.comment, true) if co.comment && !co.comment.empty?
+ values << res
+ end
+ values
+ end
+
+ def build_requires_list(context)
+ potentially_referenced_list(context.requires) {|fn| [fn + ".rb"] }
+ end
+
+ def build_include_list(context)
+ potentially_referenced_list(context.includes)
+ end
+
+ # Build a list from an array of <i>Htmlxxx</i> items. Look up each
+ # in the AllReferences hash: if we find a corresponding entry,
+ # we generate a hyperlink to it, otherwise just output the name.
+ # However, some names potentially need massaging. For example,
+ # you may require a Ruby file without the .rb extension,
+ # but the file names we know about may have it. To deal with
+ # this, we pass in a block which performs the massaging,
+ # returning an array of alternative names to match
+
+ def potentially_referenced_list(array)
+ res = []
+ array.each do |i|
+ ref = AllReferences[i.name]
+# if !ref
+# container = @context.parent
+# while !ref && container
+# name = container.name + "::" + i.name
+# ref = AllReferences[name]
+# container = container.parent
+# end
+# end
+
+ ref = @context.find_symbol(i.name)
+ ref = ref.viewer if ref
+
+ if !ref && block_given?
+ possibles = yield(i.name)
+ while !ref and !possibles.empty?
+ ref = AllReferences[possibles.shift]
+ end
+ end
+ h_name = CGI.escapeHTML(i.name)
+ if ref and ref.document_self
+ path = url(ref.path)
+ res << { "name" => h_name, "aref" => path }
+ else
+ res << { "name" => h_name }
+ end
+ end
+ res
+ end
+
+ # Build an array of arrays of method details. The outer array has up
+ # to six entries, public, private, and protected for both class
+ # methods, the other for instance methods. The inner arrays contain
+ # a hash for each method
+
+ def build_method_detail_list(section)
+ outer = []
+
+ methods = @methods.sort
+ for singleton in [true, false]
+ for vis in [ :public, :protected, :private ]
+ res = []
+ methods.each do |m|
+ if m.section == section and
+ m.document_self and
+ m.visibility == vis and
+ m.singleton == singleton
+ row = {}
+ if m.call_seq
+ row["callseq"] = m.call_seq.gsub(/->/, '&rarr;')
+ else
+ row["name"] = CGI.escapeHTML(m.name)
+ row["params"] = m.params
+ end
+ desc = m.description.strip
+ row["m_desc"] = desc unless desc.empty?
+ row["aref"] = m.aref
+ row["visibility"] = m.visibility.to_s
+
+ alias_names = []
+ m.aliases.each do |other|
+ if other.viewer # won't be if the alias is private
+ alias_names << {
+ 'name' => other.name,
+ 'aref' => other.viewer.as_href(path)
+ }
+ end
+ end
+ unless alias_names.empty?
+ row["aka"] = alias_names
+ end
+
+ if @options.inline_source
+ code = m.source_code
+ row["sourcecode"] = code if code
+ else
+ code = m.src_url
+ if code
+ row["codeurl"] = code
+ row["imgurl"] = m.img_url
+ end
+ end
+ res << row
+ end
+ end
+ if res.size > 0
+ outer << {
+ "type" => vis.to_s.capitalize,
+ "category" => singleton ? "Class" : "Instance",
+ "methods" => res
+ }
+ end
+ end
+ end
+ outer
+ end
+
+ # Build the structured list of classes and modules contained
+ # in this context.
+
+ def build_class_list(level, from, section, infile=nil)
+ res = ""
+ prefix = "&nbsp;&nbsp;::" * level;
+
+ from.modules.sort.each do |mod|
+ next unless mod.section == section
+ next if infile && !mod.defined_in?(infile)
+ if mod.document_self
+ res <<
+ prefix <<
+ "Module " <<
+ href(url(mod.viewer.path), "link", mod.full_name) <<
+ "<br />\n" <<
+ build_class_list(level + 1, mod, section, infile)
+ end
+ end
+
+ from.classes.sort.each do |cls|
+ next unless cls.section == section
+ next if infile && !cls.defined_in?(infile)
+ if cls.document_self
+ res <<
+ prefix <<
+ "Class " <<
+ href(url(cls.viewer.path), "link", cls.full_name) <<
+ "<br />\n" <<
+ build_class_list(level + 1, cls, section, infile)
+ end
+ end
+
+ res
+ end
+
+ def url(target)
+ HTMLGenerator.gen_url(path, target)
+ end
+
+ def aref_to(target)
+ if @options.all_one_file
+ "#" + target
+ else
+ url(target)
+ end
+ end
+
+ def document_self
+ @context.document_self
+ end
+
+ def diagram_reference(diagram)
+ res = diagram.gsub(/((?:src|href)=")(.*?)"/) {
+ $1 + url($2) + '"'
+ }
+ res
+ end
+
+
+ # Find a symbol in ourselves or our parent
+ def find_symbol(symbol, method=nil)
+ res = @context.find_symbol(symbol, method)
+ if res
+ res = res.viewer
+ end
+ res
+ end
+
+ # create table of contents if we contain sections
+
+ def add_table_of_sections
+ toc = []
+ @context.sections.each do |section|
+ if section.title
+ toc << {
+ 'secname' => section.title,
+ 'href' => section.sequence
+ }
+ end
+ end
+
+ @values['toc'] = toc unless toc.empty?
+ end
+
+
+ end
+
+ #####################################################################
+ #
+ # Wrap a ClassModule context
+
+ class HtmlClass < ContextUser
+
+ attr_reader :path
+
+ def initialize(context, html_file, prefix, options)
+ super(context, options)
+
+ @html_file = html_file
+ @is_module = context.is_module?
+ @values = {}
+
+ context.viewer = self
+
+ if options.all_one_file
+ @path = context.full_name
+ else
+ @path = http_url(context.full_name, prefix)
+ end
+
+ collect_methods
+
+ AllReferences.add(name, self)
+ end
+
+ # return the relative file name to store this class in,
+ # which is also its url
+ def http_url(full_name, prefix)
+ path = full_name.dup
+ if path['<<']
+ path.gsub!(/<<\s*(\w*)/) { "from-#$1" }
+ end
+ File.join(prefix, path.split("::")) + ".html"
+ end
+
+
+ def name
+ @context.full_name
+ end
+
+ def parent_name
+ @context.parent.full_name
+ end
+
+ def index_name
+ name
+ end
+
+ def write_on(f)
+ value_hash
+ template = TemplatePage.new(RDoc::Page::BODY,
+ RDoc::Page::CLASS_PAGE,
+ RDoc::Page::METHOD_LIST)
+ template.write_html_on(f, @values)
+ end
+
+ def value_hash
+ class_attribute_values
+ add_table_of_sections
+
+ @values["charset"] = @options.charset
+ @values["style_url"] = style_url(path, @options.css)
+
+ d = markup(@context.comment)
+ @values["description"] = d unless d.empty?
+
+ ml = build_method_summary_list
+ @values["methods"] = ml unless ml.empty?
+
+ il = build_include_list(@context)
+ @values["includes"] = il unless il.empty?
+
+ @values["sections"] = @context.sections.map do |section|
+
+ secdata = {
+ "sectitle" => section.title,
+ "secsequence" => section.sequence,
+ "seccomment" => markup(section.comment)
+ }
+
+ al = build_alias_summary_list(section)
+ secdata["aliases"] = al unless al.empty?
+
+ co = build_constants_summary_list(section)
+ secdata["constants"] = co unless co.empty?
+
+ al = build_attribute_list(section)
+ secdata["attributes"] = al unless al.empty?
+
+ cl = build_class_list(0, @context, section)
+ secdata["classlist"] = cl unless cl.empty?
+
+ mdl = build_method_detail_list(section)
+ secdata["method_list"] = mdl unless mdl.empty?
+
+ secdata
+ end
+
+ @values
+ end
+
+ def build_attribute_list(section)
+ atts = @context.attributes.sort
+ res = []
+ atts.each do |att|
+ next unless att.section == section
+ if att.visibility == :public || att.visibility == :protected || @options.show_all
+ entry = {
+ "name" => CGI.escapeHTML(att.name),
+ "rw" => att.rw,
+ "a_desc" => markup(att.comment, true)
+ }
+ unless att.visibility == :public || att.visibility == :protected
+ entry["rw"] << "-"
+ end
+ res << entry
+ end
+ end
+ res
+ end
+
+ def class_attribute_values
+ h_name = CGI.escapeHTML(name)
+
+ @values["classmod"] = @is_module ? "Module" : "Class"
+ @values["title"] = "#{@values['classmod']}: #{h_name}"
+
+ c = @context
+ c = c.parent while c and !c.diagram
+ if c && c.diagram
+ @values["diagram"] = diagram_reference(c.diagram)
+ end
+
+ @values["full_name"] = h_name
+
+ parent_class = @context.superclass
+
+ if parent_class
+ @values["parent"] = CGI.escapeHTML(parent_class)
+
+ if parent_name
+ lookup = parent_name + "::" + parent_class
+ else
+ lookup = parent_class
+ end
+
+ parent_url = AllReferences[lookup] || AllReferences[parent_class]
+
+ if parent_url and parent_url.document_self
+ @values["par_url"] = aref_to(parent_url.path)
+ end
+ end
+
+ files = []
+ @context.in_files.each do |f|
+ res = {}
+ full_path = CGI.escapeHTML(f.file_absolute_name)
+
+ res["full_path"] = full_path
+ res["full_path_url"] = aref_to(f.viewer.path) if f.document_self
+
+ if @options.webcvs
+ res["cvsurl"] = cvs_url( @options.webcvs, full_path )
+ end
+
+ files << res
+ end
+
+ @values['infiles'] = files
+ end
+
+ def <=>(other)
+ self.name <=> other.name
+ end
+
+ end
+
+ #####################################################################
+ #
+ # Handles the mapping of a file's information to HTML. In reality,
+ # a file corresponds to a +TopLevel+ object, containing modules,
+ # classes, and top-level methods. In theory it _could_ contain
+ # attributes and aliases, but we ignore these for now.
+
+ class HtmlFile < ContextUser
+
+ attr_reader :path
+ attr_reader :name
+
+ def initialize(context, options, file_dir)
+ super(context, options)
+
+ @values = {}
+
+ if options.all_one_file
+ @path = filename_to_label
+ else
+ @path = http_url(file_dir)
+ end
+
+ @name = @context.file_relative_name
+
+ collect_methods
+ AllReferences.add(name, self)
+ context.viewer = self
+ end
+
+ def http_url(file_dir)
+ File.join(file_dir, @context.file_relative_name.tr('.', '_')) +
+ ".html"
+ end
+
+ def filename_to_label
+ @context.file_relative_name.gsub(/%|\/|\?|\#/) {|s| '%' + ("%x" % s[0]) }
+ end
+
+ def index_name
+ name
+ end
+
+ def parent_name
+ nil
+ end
+
+ def value_hash
+ file_attribute_values
+ add_table_of_sections
+
+ @values["charset"] = @options.charset
+ @values["href"] = path
+ @values["style_url"] = style_url(path, @options.css)
+
+ if @context.comment
+ d = markup(@context.comment)
+ @values["description"] = d if d.size > 0
+ end
+
+ ml = build_method_summary_list
+ @values["methods"] = ml unless ml.empty?
+
+ il = build_include_list(@context)
+ @values["includes"] = il unless il.empty?
+
+ rl = build_requires_list(@context)
+ @values["requires"] = rl unless rl.empty?
+
+ if @options.promiscuous
+ file_context = nil
+ else
+ file_context = @context
+ end
+
+
+ @values["sections"] = @context.sections.map do |section|
+
+ secdata = {
+ "sectitle" => section.title,
+ "secsequence" => section.sequence,
+ "seccomment" => markup(section.comment)
+ }
+
+ cl = build_class_list(0, @context, section, file_context)
+ @values["classlist"] = cl unless cl.empty?
+
+ mdl = build_method_detail_list(section)
+ secdata["method_list"] = mdl unless mdl.empty?
+
+ al = build_alias_summary_list(section)
+ secdata["aliases"] = al unless al.empty?
+
+ co = build_constants_summary_list(section)
+ @values["constants"] = co unless co.empty?
+
+ secdata
+ end
+
+ @values
+ end
+
+ def write_on(f)
+ value_hash
+ template = TemplatePage.new(RDoc::Page::BODY,
+ RDoc::Page::FILE_PAGE,
+ RDoc::Page::METHOD_LIST)
+ template.write_html_on(f, @values)
+ end
+
+ def file_attribute_values
+ full_path = @context.file_absolute_name
+ short_name = File.basename(full_path)
+
+ @values["title"] = CGI.escapeHTML("File: #{short_name}")
+
+ if @context.diagram
+ @values["diagram"] = diagram_reference(@context.diagram)
+ end
+
+ @values["short_name"] = CGI.escapeHTML(short_name)
+ @values["full_path"] = CGI.escapeHTML(full_path)
+ @values["dtm_modified"] = @context.file_stat.mtime.to_s
+
+ if @options.webcvs
+ @values["cvsurl"] = cvs_url( @options.webcvs, @values["full_path"] )
+ end
+ end
+
+ def <=>(other)
+ self.name <=> other.name
+ end
+ end
+
+ #####################################################################
+
+ class HtmlMethod
+ include MarkUp
+
+ attr_reader :context
+ attr_reader :src_url
+ attr_reader :img_url
+ attr_reader :source_code
+
+ @@seq = "M000000"
+
+ @@all_methods = []
+
+ def HtmlMethod::reset
+ @@all_methods = []
+ end
+
+ def initialize(context, html_class, options)
+ @context = context
+ @html_class = html_class
+ @options = options
+ @@seq = @@seq.succ
+ @seq = @@seq
+ @@all_methods << self
+
+ context.viewer = self
+
+ if (ts = @context.token_stream)
+ @source_code = markup_code(ts)
+ unless @options.inline_source
+ @src_url = create_source_code_file(@source_code)
+ @img_url = HTMLGenerator.gen_url(path, 'source.png')
+ end
+ end
+
+ AllReferences.add(name, self)
+ end
+
+ # return a reference to outselves to be used as an href=
+ # the form depends on whether we're all in one file
+ # or in multiple files
+
+ def as_href(from_path)
+ if @options.all_one_file
+ "#" + path
+ else
+ HTMLGenerator.gen_url(from_path, path)
+ end
+ end
+
+ def name
+ @context.name
+ end
+
+ def section
+ @context.section
+ end
+
+ def index_name
+ "#{@context.name} (#{@html_class.name})"
+ end
+
+ def parent_name
+ if @context.parent.parent
+ @context.parent.parent.full_name
+ else
+ nil
+ end
+ end
+
+ def aref
+ @seq
+ end
+
+ def path
+ if @options.all_one_file
+ aref
+ else
+ @html_class.path + "#" + aref
+ end
+ end
+
+ def description
+ markup(@context.comment)
+ end
+
+ def visibility
+ @context.visibility
+ end
+
+ def singleton
+ @context.singleton
+ end
+
+ def call_seq
+ cs = @context.call_seq
+ if cs
+ cs.gsub(/\n/, "<br />\n")
+ else
+ nil
+ end
+ end
+
+ def params
+ # params coming from a call-seq in 'C' will start with the
+ # method name
+ p = @context.params
+ if p !~ /^\w/
+ p = @context.params.gsub(/\s*\#.*/, '')
+ p = p.tr("\n", " ").squeeze(" ")
+ p = "(" + p + ")" unless p[0] == ?(
+
+ if (block = @context.block_params)
+ # If this method has explicit block parameters, remove any
+ # explicit &block
+
+ p.sub!(/,?\s*&\w+/, '')
+
+ block.gsub!(/\s*\#.*/, '')
+ block = block.tr("\n", " ").squeeze(" ")
+ if block[0] == ?(
+ block.sub!(/^\(/, '').sub!(/\)/, '')
+ end
+ p << " {|#{block.strip}| ...}"
+ end
+ end
+ CGI.escapeHTML(p)
+ end
+
+ def create_source_code_file(code_body)
+ meth_path = @html_class.path.sub(/\.html$/, '.src')
+ File.makedirs(meth_path)
+ file_path = File.join(meth_path, @seq) + ".html"
+
+ template = TemplatePage.new(RDoc::Page::SRC_PAGE)
+ File.open(file_path, "w") do |f|
+ values = {
+ 'title' => CGI.escapeHTML(index_name),
+ 'code' => code_body,
+ 'style_url' => style_url(file_path, @options.css),
+ 'charset' => @options.charset
+ }
+ template.write_html_on(f, values)
+ end
+ HTMLGenerator.gen_url(path, file_path)
+ end
+
+ def HtmlMethod.all_methods
+ @@all_methods
+ end
+
+ def <=>(other)
+ @context <=> other.context
+ end
+
+ ##
+ # Given a sequence of source tokens, mark up the source code
+ # to make it look purty.
+
+
+ def markup_code(tokens)
+ src = ""
+ tokens.each do |t|
+ next unless t
+ # p t.class
+# style = STYLE_MAP[t.class]
+ style = case t
+ when RubyToken::TkCONSTANT then "ruby-constant"
+ when RubyToken::TkKW then "ruby-keyword kw"
+ when RubyToken::TkIVAR then "ruby-ivar"
+ when RubyToken::TkOp then "ruby-operator"
+ when RubyToken::TkId then "ruby-identifier"
+ when RubyToken::TkNode then "ruby-node"
+ when RubyToken::TkCOMMENT then "ruby-comment cmt"
+ when RubyToken::TkREGEXP then "ruby-regexp re"
+ when RubyToken::TkSTRING then "ruby-value str"
+ when RubyToken::TkVal then "ruby-value"
+ else
+ nil
+ end
+
+ text = CGI.escapeHTML(t.text)
+
+ if style
+ src << "<span class=\"#{style}\">#{text}</span>"
+ else
+ src << text
+ end
+ end
+
+ add_line_numbers(src) if Options.instance.include_line_numbers
+ src
+ end
+
+ # we rely on the fact that the first line of a source code
+ # listing has
+ # # File xxxxx, line dddd
+
+ def add_line_numbers(src)
+ if src =~ /\A.*, line (\d+)/
+ first = $1.to_i - 1
+ last = first + src.count("\n")
+ size = last.to_s.length
+ real_fmt = "%#{size}d: "
+ fmt = " " * (size+2)
+ src.gsub!(/^/) do
+ res = sprintf(fmt, first)
+ first += 1
+ fmt = real_fmt
+ res
+ end
+ end
+ end
+
+ def document_self
+ @context.document_self
+ end
+
+ def aliases
+ @context.aliases
+ end
+
+ def find_symbol(symbol, method=nil)
+ res = @context.parent.find_symbol(symbol, method)
+ if res
+ res = res.viewer
+ end
+ res
+ end
+ end
+
+ #####################################################################
+
+ class HTMLGenerator
+
+ include MarkUp
+
+ ##
+ # convert a target url to one that is relative to a given
+ # path
+
+ def HTMLGenerator.gen_url(path, target)
+ from = File.dirname(path)
+ to, to_file = File.split(target)
+
+ from = from.split("/")
+ to = to.split("/")
+
+ while from.size > 0 and to.size > 0 and from[0] == to[0]
+ from.shift
+ to.shift
+ end
+
+ from.fill("..")
+ from.concat(to)
+ from << to_file
+ File.join(*from)
+ end
+
+ # Generators may need to return specific subclasses depending
+ # on the options they are passed. Because of this
+ # we create them using a factory
+
+ def HTMLGenerator.for(options)
+ AllReferences::reset
+ HtmlMethod::reset
+
+ if options.all_one_file
+ HTMLGeneratorInOne.new(options)
+ else
+ HTMLGenerator.new(options)
+ end
+ end
+
+ class <<self
+ protected :new
+ end
+
+ # Set up a new HTML generator. Basically all we do here is load
+ # up the correct output temlate
+
+ def initialize(options) #:not-new:
+ @options = options
+ load_html_template
+ end
+
+
+ ##
+ # Build the initial indices and output objects
+ # based on an array of TopLevel objects containing
+ # the extracted information.
+
+ def generate(toplevels)
+ @toplevels = toplevels
+ @files = []
+ @classes = []
+
+ write_style_sheet
+ gen_sub_directories()
+ build_indices
+ generate_html
+ end
+
+ private
+
+ ##
+ # Load up the HTML template specified in the options.
+ # If the template name contains a slash, use it literally
+ #
+ def load_html_template
+ template = @options.template
+ unless template =~ %r{/|\\}
+ template = File.join("rdoc/generators/template",
+ @options.generator.key, template)
+ end
+ require template
+ extend RDoc::Page
+ rescue LoadError
+ $stderr.puts "Could not find HTML template '#{template}'"
+ exit 99
+ end
+
+ ##
+ # Write out the style sheet used by the main frames
+ #
+
+ def write_style_sheet
+ template = TemplatePage.new(RDoc::Page::STYLE)
+ unless @options.css
+ File.open(CSS_NAME, "w") do |f|
+ values = { "fonts" => RDoc::Page::FONTS }
+ template.write_html_on(f, values)
+ end
+ end
+ end
+
+ ##
+ # See the comments at the top for a description of the
+ # directory structure
+
+ def gen_sub_directories
+ File.makedirs(FILE_DIR, CLASS_DIR)
+ rescue
+ $stderr.puts $!.message
+ exit 1
+ end
+
+ ##
+ # Generate:
+ #
+ # * a list of HtmlFile objects for each TopLevel object.
+ # * a list of HtmlClass objects for each first level
+ # class or module in the TopLevel objects
+ # * a complete list of all hyperlinkable terms (file,
+ # class, module, and method names)
+
+ def build_indices
+
+ @toplevels.each do |toplevel|
+ @files << HtmlFile.new(toplevel, @options, FILE_DIR)
+ end
+
+ RDoc::TopLevel.all_classes_and_modules.each do |cls|
+ build_class_list(cls, @files[0], CLASS_DIR)
+ end
+ end
+
+ def build_class_list(from, html_file, class_dir)
+ @classes << HtmlClass.new(from, html_file, class_dir, @options)
+ from.each_classmodule do |mod|
+ build_class_list(mod, html_file, class_dir)
+ end
+ end
+
+ ##
+ # Generate all the HTML
+ #
+ def generate_html
+ # the individual descriptions for files and classes
+ gen_into(@files)
+ gen_into(@classes)
+ # and the index files
+ gen_file_index
+ gen_class_index
+ gen_method_index
+ gen_main_index
+
+ # this method is defined in the template file
+ write_extra_pages if defined? write_extra_pages
+ end
+
+ def gen_into(list)
+ list.each do |item|
+ if item.document_self
+ op_file = item.path
+ File.makedirs(File.dirname(op_file))
+ File.open(op_file, "w") { |file| item.write_on(file) }
+ end
+ end
+
+ end
+
+ def gen_file_index
+ gen_an_index(@files, 'Files',
+ RDoc::Page::FILE_INDEX,
+ "fr_file_index.html")
+ end
+
+ def gen_class_index
+ gen_an_index(@classes, 'Classes',
+ RDoc::Page::CLASS_INDEX,
+ "fr_class_index.html")
+ end
+
+ def gen_method_index
+ gen_an_index(HtmlMethod.all_methods, 'Methods',
+ RDoc::Page::METHOD_INDEX,
+ "fr_method_index.html")
+ end
+
+
+ def gen_an_index(collection, title, template, filename)
+ template = TemplatePage.new(RDoc::Page::FR_INDEX_BODY, template)
+ res = []
+ collection.sort.each do |f|
+ if f.document_self
+ res << { "href" => f.path, "name" => f.index_name }
+ end
+ end
+
+ values = {
+ "entries" => res,
+ 'list_title' => CGI.escapeHTML(title),
+ 'index_url' => main_url,
+ 'charset' => @options.charset,
+ 'style_url' => style_url('', @options.css),
+ }
+
+ File.open(filename, "w") do |f|
+ template.write_html_on(f, values)
+ end
+ end
+
+ # The main index page is mostly a template frameset, but includes
+ # the initial page. If the <tt>--main</tt> option was given,
+ # we use this as our main page, otherwise we use the
+ # first file specified on the command line.
+
+ def gen_main_index
+ template = TemplatePage.new(RDoc::Page::INDEX)
+ File.open("index.html", "w") do |f|
+ values = {
+ "initial_page" => main_url,
+ 'title' => CGI.escapeHTML(@options.title),
+ 'charset' => @options.charset
+ }
+ if @options.inline_source
+ values['inline_source'] = true
+ end
+ template.write_html_on(f, values)
+ end
+ end
+
+ # return the url of the main page
+ def main_url
+ main_page = @options.main_page
+ ref = nil
+ if main_page
+ ref = AllReferences[main_page]
+ if ref
+ ref = ref.path
+ else
+ $stderr.puts "Could not find main page #{main_page}"
+ end
+ end
+
+ unless ref
+ for file in @files
+ if file.document_self
+ ref = file.path
+ break
+ end
+ end
+ end
+
+ unless ref
+ $stderr.puts "Couldn't find anything to document"
+ $stderr.puts "Perhaps you've used :stopdoc: in all classes"
+ exit(1)
+ end
+
+ ref
+ end
+
+
+ end
+
+
+ ######################################################################
+
+
+ class HTMLGeneratorInOne < HTMLGenerator
+
+ def initialize(*args)
+ super
+ end
+
+ ##
+ # Build the initial indices and output objects
+ # based on an array of TopLevel objects containing
+ # the extracted information.
+
+ def generate(info)
+ @toplevels = info
+ @files = []
+ @classes = []
+ @hyperlinks = {}
+
+ build_indices
+ generate_xml
+ end
+
+
+ ##
+ # Generate:
+ #
+ # * a list of HtmlFile objects for each TopLevel object.
+ # * a list of HtmlClass objects for each first level
+ # class or module in the TopLevel objects
+ # * a complete list of all hyperlinkable terms (file,
+ # class, module, and method names)
+
+ def build_indices
+
+ @toplevels.each do |toplevel|
+ @files << HtmlFile.new(toplevel, @options, FILE_DIR)
+ end
+
+ RDoc::TopLevel.all_classes_and_modules.each do |cls|
+ build_class_list(cls, @files[0], CLASS_DIR)
+ end
+ end
+
+ def build_class_list(from, html_file, class_dir)
+ @classes << HtmlClass.new(from, html_file, class_dir, @options)
+ from.each_classmodule do |mod|
+ build_class_list(mod, html_file, class_dir)
+ end
+ end
+
+ ##
+ # Generate all the HTML. For the one-file case, we generate
+ # all the information in to one big hash
+ #
+ def generate_xml
+ values = {
+ 'charset' => @options.charset,
+ 'files' => gen_into(@files),
+ 'classes' => gen_into(@classes),
+ 'title' => CGI.escapeHTML(@options.title),
+ }
+
+ # this method is defined in the template file
+ write_extra_pages if defined? write_extra_pages
+
+ template = TemplatePage.new(RDoc::Page::ONE_PAGE)
+
+ if @options.op_name
+ opfile = File.open(@options.op_name, "w")
+ else
+ opfile = $stdout
+ end
+ template.write_html_on(opfile, values)
+ end
+
+ def gen_into(list)
+ res = []
+ list.each do |item|
+ res << item.value_hash
+ end
+ res
+ end
+
+ def gen_file_index
+ gen_an_index(@files, 'Files')
+ end
+
+ def gen_class_index
+ gen_an_index(@classes, 'Classes')
+ end
+
+ def gen_method_index
+ gen_an_index(HtmlMethod.all_methods, 'Methods')
+ end
+
+
+ def gen_an_index(collection, title)
+ res = []
+ collection.sort.each do |f|
+ if f.document_self
+ res << { "href" => f.path, "name" => f.index_name }
+ end
+ end
+
+ return {
+ "entries" => res,
+ 'list_title' => title,
+ 'index_url' => main_url,
+ }
+ end
+
+ end
+end
diff --git a/lib/rdoc/generators/ri_generator.rb b/lib/rdoc/generators/ri_generator.rb
new file mode 100644
index 0000000000..c7d0bbd8f0
--- /dev/null
+++ b/lib/rdoc/generators/ri_generator.rb
@@ -0,0 +1,268 @@
+# We're responsible for generating all the HTML files
+# from the object tree defined in code_objects.rb. We
+# generate:
+#
+# [files] an html file for each input file given. These
+# input files appear as objects of class
+# TopLevel
+#
+# [classes] an html file for each class or module encountered.
+# These classes are not grouped by file: if a file
+# contains four classes, we'll generate an html
+# file for the file itself, and four html files
+# for the individual classes.
+#
+# [indices] we generate three indices for files, classes,
+# and methods. These are displayed in a browser
+# like window with three index panes across the
+# top and the selected description below
+#
+# Method descriptions appear in whatever entity (file, class,
+# or module) that contains them.
+#
+# We generate files in a structure below a specified subdirectory,
+# normally +doc+.
+#
+# opdir
+# |
+# |___ files
+# | |__ per file summaries
+# |
+# |___ classes
+# |__ per class/module descriptions
+#
+# HTML is generated using the Template class.
+#
+
+require 'ftools'
+
+require 'rdoc/options'
+require 'rdoc/template'
+require 'rdoc/markup/simple_markup'
+require 'rdoc/markup/simple_markup/to_flow'
+require 'cgi'
+
+require 'rdoc/ri/ri_cache'
+require 'rdoc/ri/ri_reader'
+require 'rdoc/ri/ri_writer'
+require 'rdoc/ri/ri_descriptions'
+
+module Generators
+
+
+ class RIGenerator
+
+ # Generators may need to return specific subclasses depending
+ # on the options they are passed. Because of this
+ # we create them using a factory
+
+ def RIGenerator.for(options)
+ new(options)
+ end
+
+ class <<self
+ protected :new
+ end
+
+ # Set up a new HTML generator. Basically all we do here is load
+ # up the correct output temlate
+
+ def initialize(options) #:not-new:
+ @options = options
+ @ri_writer = RI::RiWriter.new(".")
+ @markup = SM::SimpleMarkup.new
+ @to_flow = SM::ToFlow.new
+ end
+
+
+ ##
+ # Build the initial indices and output objects
+ # based on an array of TopLevel objects containing
+ # the extracted information.
+
+ def generate(toplevels)
+ RDoc::TopLevel.all_classes_and_modules.each do |cls|
+ process_class(cls)
+ end
+ end
+
+ def process_class(from_class)
+ generate_class_info(from_class)
+
+ # now recure into this classes constituent classess
+ from_class.each_classmodule do |mod|
+ process_class(mod)
+ end
+ end
+
+ def generate_class_info(cls)
+ if cls === RDoc::NormalModule
+ cls_desc = RI::ModuleDescription.new
+ else
+ cls_desc = RI::ClassDescription.new
+ cls_desc.superclass = cls.superclass
+ end
+ cls_desc.name = cls.name
+ cls_desc.full_name = cls.full_name
+ cls_desc.comment = markup(cls.comment)
+
+ cls_desc.attributes =cls.attributes.sort.map do |a|
+ RI::Attribute.new(a.name, a.rw, markup(a.comment))
+ end
+
+ cls_desc.constants = cls.constants.map do |c|
+ RI::Constant.new(c.name, c.value, markup(c.comment))
+ end
+
+ cls_desc.includes = cls.includes.map do |i|
+ RI::IncludedModule.new(i.name)
+ end
+
+ class_methods, instance_methods = method_list(cls)
+
+ cls_desc.class_methods = class_methods.map do |m|
+ RI::MethodSummary.new(m.name)
+ end
+ cls_desc.instance_methods = instance_methods.map do |m|
+ RI::MethodSummary.new(m.name)
+ end
+
+ update_or_replace(cls_desc)
+
+ class_methods.each do |m|
+ generate_method_info(cls_desc, m)
+ end
+
+ instance_methods.each do |m|
+ generate_method_info(cls_desc, m)
+ end
+ end
+
+
+ def generate_method_info(cls_desc, method)
+ meth_desc = RI::MethodDescription.new
+ meth_desc.name = method.name
+ meth_desc.full_name = cls_desc.full_name
+ if method.singleton
+ meth_desc.full_name += "::"
+ else
+ meth_desc.full_name += "#"
+ end
+ meth_desc.full_name << method.name
+
+ meth_desc.comment = markup(method.comment)
+ meth_desc.params = params_of(method)
+ meth_desc.visibility = method.visibility.to_s
+ meth_desc.is_singleton = method.singleton
+ meth_desc.block_params = method.block_params
+
+ meth_desc.aliases = method.aliases.map do |a|
+ RI::AliasName.new(a.name)
+ end
+
+ @ri_writer.add_method(cls_desc, meth_desc)
+ end
+
+ private
+
+ # return a list of class and instance methods that we'll be
+ # documenting
+
+ def method_list(cls)
+ list = cls.method_list
+ unless @options.show_all
+ list = list.find_all do |m|
+ m.visibility == :public || m.visibility == :protected || m.force_documentation
+ end
+ end
+
+ c = []
+ i = []
+ list.sort.each do |m|
+ if m.singleton
+ c << m
+ else
+ i << m
+ end
+ end
+ return c,i
+ end
+
+ def params_of(method)
+ if method.call_seq
+ method.call_seq
+ else
+ params = method.params || ""
+
+ p = params.gsub(/\s*\#.*/, '')
+ p = p.tr("\n", " ").squeeze(" ")
+ p = "(" + p + ")" unless p[0] == ?(
+
+ if (block = method.block_params)
+ block.gsub!(/\s*\#.*/, '')
+ block = block.tr("\n", " ").squeeze(" ")
+ if block[0] == ?(
+ block.sub!(/^\(/, '').sub!(/\)/, '')
+ end
+ p << " {|#{block.strip}| ...}"
+ end
+ p
+ end
+ end
+
+ def markup(comment)
+ return nil if !comment || comment.empty?
+
+ # Convert leading comment markers to spaces, but only
+ # if all non-blank lines have them
+
+ if comment =~ /^(?>\s*)[^\#]/
+ content = comment
+ else
+ content = comment.gsub(/^\s*(#+)/) { $1.tr('#',' ') }
+ end
+ @markup.convert(content, @to_flow)
+ end
+
+
+ # By default we replace existing classes with the
+ # same name. If the --merge option was given, we instead
+ # merge this definition into an existing class. We add
+ # our methods, aliases, etc to that class, but do not
+ # change the class's description.
+
+ def update_or_replace(cls_desc)
+ old_cls = nil
+
+ if @options.merge
+ rdr = RI::RiReader.new(RI::RiCache.new(@options.op_dir))
+
+ namespace = rdr.top_level_namespace
+ namespace = rdr.lookup_namespace_in(cls_desc.name, namespace)
+ if namespace.empty?
+ $stderr.puts "You asked me to merge this source into existing "
+ $stderr.puts "documentation. This file references a class or "
+ $stderr.puts "module called #{cls_desc.name} which I don't"
+ $stderr.puts "have existing documentation for."
+ $stderr.puts
+ $stderr.puts "Perhaps you need to generate its documentation first"
+ exit 1
+ else
+ old_cls = namespace[0]
+ end
+ end
+
+ if old_cls.nil?
+ # no merge: simply overwrite
+ @ri_writer.remove_class(cls_desc)
+ @ri_writer.add_class(cls_desc)
+ else
+ # existing class: merge in
+ old_desc = rdr.get_class(old_cls)
+
+ old_desc.merge_in(cls_desc)
+ @ri_writer.add_class(old_desc)
+ end
+ end
+ end
+end
diff --git a/lib/rdoc/generators/template/chm/chm.rb b/lib/rdoc/generators/template/chm/chm.rb
new file mode 100644
index 0000000000..4a89c26520
--- /dev/null
+++ b/lib/rdoc/generators/template/chm/chm.rb
@@ -0,0 +1,87 @@
+module RDoc
+module Page
+
+require "rdoc/generators/template/html/html"
+
+# This is a nasty little hack, but hhc doesn't support the <?xml
+# tag, so...
+
+BODY.sub!(/<\?xml.*\?>/, '')
+SRC_PAGE.sub!(/<\?xml.*\?>/, '')
+
+HPP_FILE = %{
+[OPTIONS]
+Auto Index = Yes
+Compatibility=1.1 or later
+Compiled file=%opname%.chm
+Contents file=contents.hhc
+Full-text search=Yes
+Index file=index.hhk
+Language=0x409 English(United States)
+Title=%title%
+
+[FILES]
+START:all_html_files
+%html_file_name%
+END:all_html_files
+}
+
+CONTENTS = %{
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<HTML>
+<HEAD>
+<meta name="GENERATOR" content="Microsoft&reg; HTML Help Workshop 4.1">
+<!-- Sitemap 1.0 -->
+</HEAD><BODY>
+<OBJECT type="text/site properties">
+ <param name="Foreground" value="0x80">
+ <param name="Window Styles" value="0x800025">
+ <param name="ImageType" value="Folder">
+</OBJECT>
+<UL>
+START:contents
+ <LI> <OBJECT type="text/sitemap">
+ <param name="Name" value="%c_name%">
+ <param name="Local" value="%ref%">
+ </OBJECT>
+IF:methods
+<ul>
+START:methods
+ <LI> <OBJECT type="text/sitemap">
+ <param name="Name" value="%name%">
+ <param name="Local" value="%aref%">
+ </OBJECT>
+END:methods
+</ul>
+ENDIF:methods
+ </LI>
+END:contents
+</UL>
+</BODY></HTML>
+}
+
+
+CHM_INDEX = %{
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<HTML>
+<HEAD>
+<meta name="GENERATOR" content="Microsoft&reg; HTML Help Workshop 4.1">
+<!-- Sitemap 1.0 -->
+</HEAD><BODY>
+<OBJECT type="text/site properties">
+ <param name="Foreground" value="0x80">
+ <param name="Window Styles" value="0x800025">
+ <param name="ImageType" value="Folder">
+</OBJECT>
+<UL>
+START:index
+ <LI> <OBJECT type="text/sitemap">
+ <param name="Name" value="%name%">
+ <param name="Local" value="%aref%">
+ </OBJECT>
+END:index
+</UL>
+</BODY></HTML>
+}
+end
+end
diff --git a/lib/rdoc/generators/template/html/hefss.rb b/lib/rdoc/generators/template/html/hefss.rb
new file mode 100644
index 0000000000..e68ca85823
--- /dev/null
+++ b/lib/rdoc/generators/template/html/hefss.rb
@@ -0,0 +1,418 @@
+module RDoc
+module Page
+
+
+FONTS = "Verdana, Arial, Helvetica, sans-serif"
+
+STYLE = %{
+body,p { font-family: Verdana, Arial, Helvetica, sans-serif;
+ color: #000040; background: #BBBBBB;
+}
+
+td { font-family: Verdana, Arial, Helvetica, sans-serif;
+ color: #000040;
+}
+
+.attr-rw { font-size: small; color: #444488 }
+
+.title-row {color: #eeeeff;
+ background: #BBBBDD;
+}
+
+.big-title-font { color: white;
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-size: large;
+ height: 50px}
+
+.small-title-font { color: purple;
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-size: small; }
+
+.aqua { color: purple }
+
+.method-name, attr-name {
+ font-family: monospace; font-weight: bold;
+}
+
+.tablesubtitle {
+ width: 100%;
+ margin-top: 1ex;
+ margin-bottom: .5ex;
+ padding: 5px 0px 5px 20px;
+ font-size: large;
+ color: purple;
+ background: #BBBBCC;
+}
+
+.tablesubsubtitle {
+ width: 100%;
+ margin-top: 1ex;
+ margin-bottom: .5ex;
+ padding: 5px 0px 5px 20px;
+ font-size: medium;
+ color: white;
+ background: #BBBBCC;
+}
+
+.name-list {
+ font-family: monospace;
+ margin-left: 40px;
+ margin-bottom: 2ex;
+ line-height: 140%;
+}
+
+.description {
+ margin-left: 40px;
+ margin-bottom: 2ex;
+ line-height: 140%;
+}
+
+.methodtitle {
+ font-size: medium;
+ text_decoration: none;
+ padding: 3px 3px 3px 20px;
+ color: #0000AA;
+}
+
+.column-title {
+ font-size: medium;
+ font-weight: bold;
+ text_decoration: none;
+ padding: 3px 3px 3px 20px;
+ color: #3333CC;
+ }
+
+.variable-name {
+ font-family: monospace;
+ font-size: medium;
+ text_decoration: none;
+ padding: 3px 3px 3px 20px;
+ color: #0000AA;
+}
+
+.row-name {
+ font-size: medium;
+ font-weight: medium;
+ font-family: monospace;
+ text_decoration: none;
+ padding: 3px 3px 3px 20px;
+}
+
+.paramsig {
+ font-size: small;
+}
+
+.srcbut { float: right }
+
+}
+
+
+############################################################################
+
+
+BODY = %{
+<html><head>
+ <title>%title%</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=%charset%">
+ <link rel="stylesheet" href="%style_url%" type="text/css" media="screen" />
+ <script type="text/javascript" language="JavaScript">
+ <!--
+ function popCode(url) {
+ parent.frames.source.location = url
+ }
+ //-->
+ </script>
+</head>
+<body bgcolor="#BBBBBB">
+
+!INCLUDE! <!-- banner header -->
+
+IF:diagram
+<table width="100%"><tr><td align="center">
+%diagram%
+</td></tr></table>
+ENDIF:diagram
+
+IF:description
+<div class="description">%description%</div>
+ENDIF:description
+
+IF:requires
+<table cellpadding="5" width="100%">
+<tr><td class="tablesubtitle">Required files</td></tr>
+</table><br />
+<div class="name-list">
+START:requires
+HREF:aref:name:
+END:requires
+ENDIF:requires
+</div>
+
+IF:methods
+<table cellpadding="5" width="100%">
+<tr><td class="tablesubtitle">Subroutines and Functions</td></tr>
+</table><br />
+<div class="name-list">
+START:methods
+HREF:aref:name:,
+END:methods
+</div>
+ENDIF:methods
+
+IF:attributes
+<table cellpadding="5" width="100%">
+<tr><td class="tablesubtitle">Arguments</td></tr>
+</table><br />
+<table cellspacing="5">
+START:attributes
+ <tr valign="top">
+IF:rw
+ <td align="center" class="attr-rw">&nbsp;[%rw%]&nbsp;</td>
+ENDIF:rw
+IFNOT:rw
+ <td></td>
+ENDIF:rw
+ <td class="attr-name">%name%</td>
+ <td>%a_desc%</td>
+ </tr>
+END:attributes
+</table>
+ENDIF:attributes
+
+IF:classlist
+<table cellpadding="5" width="100%">
+<tr><td class="tablesubtitle">Modules</td></tr>
+</table><br />
+%classlist%<br />
+ENDIF:classlist
+
+ !INCLUDE! <!-- method descriptions -->
+
+</body>
+</html>
+}
+
+###############################################################################
+
+FILE_PAGE = <<_FILE_PAGE_
+<table width="100%">
+ <tr class="title-row">
+ <td><table width="100%"><tr>
+ <td class="big-title-font" colspan="2"><font size="-3"><b>File</b><br /></font>%short_name%</td>
+ <td align="right"><table cellspacing="0" cellpadding="2">
+ <tr>
+ <td class="small-title-font">Path:</td>
+ <td class="small-title-font">%full_path%
+IF:cvsurl
+ &nbsp;(<a href="%cvsurl%"><acronym title="Concurrent Versioning System">CVS</acronym></a>)
+ENDIF:cvsurl
+ </td>
+ </tr>
+ <tr>
+ <td class="small-title-font">Modified:</td>
+ <td class="small-title-font">%dtm_modified%</td>
+ </tr>
+ </table>
+ </td></tr></table></td>
+ </tr>
+</table><br />
+_FILE_PAGE_
+
+###################################################################
+
+CLASS_PAGE = %{
+<table width="100%" border="0" cellspacing="0">
+ <tr class="title-row">
+ <td class="big-title-font">
+ <font size="-3"><b>%classmod%</b><br /></font>%full_name%
+ </td>
+ <td align="right">
+ <table cellspacing="0" cellpadding="2">
+ <tr valign="top">
+ <td class="small-title-font">In:</td>
+ <td class="small-title-font">
+START:infiles
+HREF:full_path_url:full_path:
+IF:cvsurl
+&nbsp;(<a href="%cvsurl%"><acronym title="Concurrent Versioning System">CVS</acronym></a>)
+ENDIF:cvsurl
+END:infiles
+ </td>
+ </tr>
+IF:parent
+ <tr>
+ <td class="small-title-font">Parent:</td>
+ <td class="small-title-font">
+IF:par_url
+ <a href="%par_url%" class="cyan">
+ENDIF:par_url
+%parent%
+IF:par_url
+ </a>
+ENDIF:par_url
+ </td>
+ </tr>
+ENDIF:parent
+ </table>
+ </td>
+ </tr>
+</table><br />
+}
+
+###################################################################
+
+METHOD_LIST = %{
+IF:includes
+<div class="tablesubsubtitle">Uses</div><br />
+<div class="name-list">
+START:includes
+ <span class="method-name">HREF:aref:name:</span>
+END:includes
+</div>
+ENDIF:includes
+
+IF:method_list
+START:method_list
+IF:methods
+<table cellpadding="5" width="100%">
+<tr><td class="tablesubtitle">%type% %category% methods</td></tr>
+</table>
+START:methods
+<table width="100%" cellspacing="0" cellpadding="5" border="0">
+<tr><td class="methodtitle">
+<a name="%aref%">
+<b>%name%</b>%params%
+IF:codeurl
+<a href="%codeurl%" target="source" class="srclink">src</a>
+ENDIF:codeurl
+</a></td></tr>
+</table>
+IF:m_desc
+<div class="description">
+%m_desc%
+</div>
+ENDIF:m_desc
+END:methods
+ENDIF:methods
+END:method_list
+ENDIF:method_list
+}
+
+=begin
+=end
+
+########################## Source code ##########################
+
+SRC_PAGE = %{
+<html>
+<head><title>%title%</title>
+<meta http-equiv="Content-Type" content="text/html; charset=%charset%">
+<style type="text/css">
+ .kw { color: #3333FF; font-weight: bold }
+ .cmt { color: green; font-style: italic }
+ .str { color: #662222; font-style: italic }
+ .re { color: #662222; }
+.ruby-comment { color: green; font-style: italic }
+.ruby-constant { color: #4433aa; font-weight: bold; }
+.ruby-identifier { color: #222222; }
+.ruby-ivar { color: #2233dd; }
+.ruby-keyword { color: #3333FF; font-weight: bold }
+.ruby-node { color: #777777; }
+.ruby-operator { color: #111111; }
+.ruby-regexp { color: #662222; }
+.ruby-value { color: #662222; font-style: italic }
+</style>
+</head>
+<body bgcolor="#BBBBBB">
+<pre>%code%</pre>
+</body>
+</html>
+}
+
+########################## Index ################################
+
+FR_INDEX_BODY = %{
+!INCLUDE!
+}
+
+FILE_INDEX = %{
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=%charset%">
+<style type="text/css">
+<!--
+ body {
+background-color: #bbbbbb;
+ font-family: #{FONTS};
+ font-size: 11px;
+ font-style: normal;
+ line-height: 14px;
+ color: #000040;
+ }
+div.banner {
+ background: #bbbbcc;
+ color: white;
+ padding: 1;
+ margin: 0;
+ font-size: 90%;
+ font-weight: bold;
+ line-height: 1.1;
+ text-align: center;
+ width: 100%;
+}
+
+-->
+</style>
+<base target="docwin">
+</head>
+<body>
+<div class="banner">%list_title%</div>
+START:entries
+<a href="%href%">%name%</a><br />
+END:entries
+</body></html>
+}
+
+CLASS_INDEX = FILE_INDEX
+METHOD_INDEX = FILE_INDEX
+
+INDEX = %{
+<html>
+<head>
+ <title>%title%</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=%charset%">
+</head>
+
+<frameset cols="20%,*">
+ <frameset rows="15%,35%,50%">
+ <frame src="fr_file_index.html" title="Files" name="Files">
+ <frame src="fr_class_index.html" name="Modules">
+ <frame src="fr_method_index.html" name="Subroutines and Functions">
+ </frameset>
+ <frameset rows="80%,20%">
+ <frame src="%initial_page%" name="docwin">
+ <frame src="blank.html" name="source">
+ </frameset>
+ <noframes>
+ <body bgcolor="#BBBBBB">
+ Click <a href="html/index.html">here</a> for a non-frames
+ version of this page.
+ </body>
+ </noframes>
+</frameset>
+
+</html>
+}
+
+# and a blank page to use as a target
+BLANK = %{
+<html><body bgcolor="#BBBBBB"></body></html>
+}
+
+def write_extra_pages
+ template = TemplatePage.new(BLANK)
+ File.open("blank.html", "w") { |f| template.write_html_on(f, {}) }
+end
+
+end
+end
diff --git a/lib/rdoc/generators/template/html/html.rb b/lib/rdoc/generators/template/html/html.rb
new file mode 100644
index 0000000000..7f9e599465
--- /dev/null
+++ b/lib/rdoc/generators/template/html/html.rb
@@ -0,0 +1,711 @@
+#
+# = CSS2 RDoc HTML template
+#
+# This is a template for RDoc that uses XHTML 1.0 Transitional and dictates a
+# bit more of the appearance of the output to cascading stylesheets than the
+# default. It was designed for clean inline code display, and uses DHTMl to
+# toggle the visbility of each method's source with each click on the '[source]'
+# link.
+#
+# == Authors
+#
+# * Michael Granger <ged@FaerieMUD.org>
+#
+# Copyright (c) 2002, 2003 The FaerieMUD Consortium. Some rights reserved.
+#
+# This work is licensed under the Creative Commons Attribution License. To view
+# a copy of this license, visit http://creativecommons.org/licenses/by/1.0/ or
+# send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California
+# 94305, USA.
+#
+
+module RDoc
+ module Page
+
+ FONTS = "Verdana,Arial,Helvetica,sans-serif"
+
+STYLE = %{
+body {
+ font-family: Verdana,Arial,Helvetica,sans-serif;
+ font-size: 90%;
+ margin: 0;
+ margin-left: 40px;
+ padding: 0;
+ background: white;
+}
+
+h1,h2,h3,h4 { margin: 0; color: #efefef; background: transparent; }
+h1 { font-size: 150%; }
+h2,h3,h4 { margin-top: 1em; }
+
+a { background: #eef; color: #039; text-decoration: none; }
+a:hover { background: #039; color: #eef; }
+
+/* Override the base stylesheet's Anchor inside a table cell */
+td > a {
+ background: transparent;
+ color: #039;
+ text-decoration: none;
+}
+
+/* and inside a section title */
+.section-title > a {
+ background: transparent;
+ color: #eee;
+ text-decoration: none;
+}
+
+/* === Structural elements =================================== */
+
+div#index {
+ margin: 0;
+ margin-left: -40px;
+ padding: 0;
+ font-size: 90%;
+}
+
+
+div#index a {
+ margin-left: 0.7em;
+}
+
+div#index .section-bar {
+ margin-left: 0px;
+ padding-left: 0.7em;
+ background: #ccc;
+ font-size: small;
+}
+
+
+div#classHeader, div#fileHeader {
+ width: auto;
+ color: white;
+ padding: 0.5em 1.5em 0.5em 1.5em;
+ margin: 0;
+ margin-left: -40px;
+ border-bottom: 3px solid #006;
+}
+
+div#classHeader a, div#fileHeader a {
+ background: inherit;
+ color: white;
+}
+
+div#classHeader td, div#fileHeader td {
+ background: inherit;
+ color: white;
+}
+
+
+div#fileHeader {
+ background: #057;
+}
+
+div#classHeader {
+ background: #048;
+}
+
+
+.class-name-in-header {
+ font-size: 180%;
+ font-weight: bold;
+}
+
+
+div#bodyContent {
+ padding: 0 1.5em 0 1.5em;
+}
+
+div#description {
+ padding: 0.5em 1.5em;
+ background: #efefef;
+ border: 1px dotted #999;
+}
+
+div#description h1,h2,h3,h4,h5,h6 {
+ color: #125;;
+ background: transparent;
+}
+
+div#validator-badges {
+ text-align: center;
+}
+div#validator-badges img { border: 0; }
+
+div#copyright {
+ color: #333;
+ background: #efefef;
+ font: 0.75em sans-serif;
+ margin-top: 5em;
+ margin-bottom: 0;
+ padding: 0.5em 2em;
+}
+
+
+/* === Classes =================================== */
+
+table.header-table {
+ color: white;
+ font-size: small;
+}
+
+.type-note {
+ font-size: small;
+ color: #DEDEDE;
+}
+
+.xxsection-bar {
+ background: #eee;
+ color: #333;
+ padding: 3px;
+}
+
+.section-bar {
+ color: #333;
+ border-bottom: 1px solid #999;
+ margin-left: -20px;
+}
+
+
+.section-title {
+ background: #79a;
+ color: #eee;
+ padding: 3px;
+ margin-top: 2em;
+ margin-left: -30px;
+ border: 1px solid #999;
+}
+
+.top-aligned-row { vertical-align: top }
+.bottom-aligned-row { vertical-align: bottom }
+
+/* --- Context section classes ----------------------- */
+
+.context-row { }
+.context-item-name { font-family: monospace; font-weight: bold; color: black; }
+.context-item-value { font-size: small; color: #448; }
+.context-item-desc { color: #333; padding-left: 2em; }
+
+/* --- Method classes -------------------------- */
+.method-detail {
+ background: #efefef;
+ padding: 0;
+ margin-top: 0.5em;
+ margin-bottom: 1em;
+ border: 1px dotted #ccc;
+}
+.method-heading {
+ color: black;
+ background: #ccc;
+ border-bottom: 1px solid #666;
+ padding: 0.2em 0.5em 0 0.5em;
+}
+.method-signature { color: black; background: inherit; }
+.method-name { font-weight: bold; }
+.method-args { font-style: italic; }
+.method-description { padding: 0 0.5em 0 0.5em; }
+
+/* --- Source code sections -------------------- */
+
+a.source-toggle { font-size: 90%; }
+div.method-source-code {
+ background: #262626;
+ color: #ffdead;
+ margin: 1em;
+ padding: 0.5em;
+ border: 1px dashed #999;
+ overflow: hidden;
+}
+
+div.method-source-code pre { color: #ffdead; overflow: hidden; }
+
+/* --- Ruby keyword styles --------------------- */
+
+.standalone-code { background: #221111; color: #ffdead; overflow: hidden; }
+
+.ruby-constant { color: #7fffd4; background: transparent; }
+.ruby-keyword { color: #00ffff; background: transparent; }
+.ruby-ivar { color: #eedd82; background: transparent; }
+.ruby-operator { color: #00ffee; background: transparent; }
+.ruby-identifier { color: #ffdead; background: transparent; }
+.ruby-node { color: #ffa07a; background: transparent; }
+.ruby-comment { color: #b22222; font-weight: bold; background: transparent; }
+.ruby-regexp { color: #ffa07a; background: transparent; }
+.ruby-value { color: #7fffd4; background: transparent; }
+}
+
+
+#####################################################################
+### H E A D E R T E M P L A T E
+#####################################################################
+
+XHTML_PREAMBLE = %{<?xml version="1.0" encoding="%charset%"?>
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+}
+
+HEADER = XHTML_PREAMBLE + %{
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+ <title>%title%</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=%charset%" />
+ <meta http-equiv="Content-Script-Type" content="text/javascript" />
+ <link rel="stylesheet" href="%style_url%" type="text/css" media="screen" />
+ <script type="text/javascript">
+ // <![CDATA[
+
+ function popupCode( url ) {
+ window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+ }
+
+ function toggleCode( id ) {
+ if ( document.getElementById )
+ elem = document.getElementById( id );
+ else if ( document.all )
+ elem = eval( "document.all." + id );
+ else
+ return false;
+
+ elemStyle = elem.style;
+
+ if ( elemStyle.display != "block" ) {
+ elemStyle.display = "block"
+ } else {
+ elemStyle.display = "none"
+ }
+
+ return true;
+ }
+
+ // Make codeblocks hidden by default
+ document.writeln( "<style type=\\"text/css\\">div.method-source-code { display: none }</style>" )
+
+ // ]]>
+ </script>
+
+</head>
+<body>
+}
+
+
+#####################################################################
+### C O N T E X T C O N T E N T T E M P L A T E
+#####################################################################
+
+CONTEXT_CONTENT = %{
+}
+
+
+#####################################################################
+### F O O T E R T E M P L A T E
+#####################################################################
+FOOTER = %{
+<div id="validator-badges">
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
+}
+
+
+#####################################################################
+### F I L E P A G E H E A D E R T E M P L A T E
+#####################################################################
+
+FILE_PAGE = %{
+ <div id="fileHeader">
+ <h1>%short_name%</h1>
+ <table class="header-table">
+ <tr class="top-aligned-row">
+ <td><strong>Path:</strong></td>
+ <td>%full_path%
+IF:cvsurl
+ &nbsp;(<a href="%cvsurl%"><acronym title="Concurrent Versioning System">CVS</acronym></a>)
+ENDIF:cvsurl
+ </td>
+ </tr>
+ <tr class="top-aligned-row">
+ <td><strong>Last Update:</strong></td>
+ <td>%dtm_modified%</td>
+ </tr>
+ </table>
+ </div>
+}
+
+
+#####################################################################
+### C L A S S P A G E H E A D E R T E M P L A T E
+#####################################################################
+
+CLASS_PAGE = %{
+ <div id="classHeader">
+ <table class="header-table">
+ <tr class="top-aligned-row">
+ <td><strong>%classmod%</strong></td>
+ <td class="class-name-in-header">%full_name%</td>
+ </tr>
+ <tr class="top-aligned-row">
+ <td><strong>In:</strong></td>
+ <td>
+START:infiles
+IF:full_path_url
+ <a href="%full_path_url%">
+ENDIF:full_path_url
+ %full_path%
+IF:full_path_url
+ </a>
+ENDIF:full_path_url
+IF:cvsurl
+ &nbsp;(<a href="%cvsurl%"><acronym title="Concurrent Versioning System">CVS</acronym></a>)
+ENDIF:cvsurl
+ <br />
+END:infiles
+ </td>
+ </tr>
+
+IF:parent
+ <tr class="top-aligned-row">
+ <td><strong>Parent:</strong></td>
+ <td>
+IF:par_url
+ <a href="%par_url%">
+ENDIF:par_url
+ %parent%
+IF:par_url
+ </a>
+ENDIF:par_url
+ </td>
+ </tr>
+ENDIF:parent
+ </table>
+ </div>
+}
+
+
+#####################################################################
+### M E T H O D L I S T T E M P L A T E
+#####################################################################
+
+METHOD_LIST = %{
+
+ <div id="contextContent">
+IF:diagram
+ <div id="diagram">
+ %diagram%
+ </div>
+ENDIF:diagram
+
+IF:description
+ <div id="description">
+ %description%
+ </div>
+ENDIF:description
+
+IF:requires
+ <div id="requires-list">
+ <h3 class="section-bar">Required files</h3>
+
+ <div class="name-list">
+START:requires
+ HREF:aref:name:&nbsp;&nbsp;
+END:requires
+ </div>
+ </div>
+ENDIF:requires
+
+IF:toc
+ <div id="contents-list">
+ <h3 class="section-bar">Contents</h3>
+ <ul>
+START:toc
+ <li><a href="#%href%">%secname%</a></li>
+END:toc
+ </ul>
+ENDIF:toc
+ </div>
+
+IF:methods
+ <div id="method-list">
+ <h3 class="section-bar">Methods</h3>
+
+ <div class="name-list">
+START:methods
+ HREF:aref:name:&nbsp;&nbsp;
+END:methods
+ </div>
+ </div>
+ENDIF:methods
+
+ </div>
+
+
+ <!-- if includes -->
+IF:includes
+ <div id="includes">
+ <h3 class="section-bar">Included Modules</h3>
+
+ <div id="includes-list">
+START:includes
+ <span class="include-name">HREF:aref:name:</span>
+END:includes
+ </div>
+ </div>
+ENDIF:includes
+
+START:sections
+ <div id="section">
+IF:sectitle
+ <h2 class="section-title"><a name="%secsequence%">%sectitle%</a></h2>
+IF:seccomment
+ <div class="section-comment">
+ %seccomment%
+ </div>
+ENDIF:seccomment
+ENDIF:sectitle
+
+IF:classlist
+ <div id="class-list">
+ <h3 class="section-bar">Classes and Modules</h3>
+
+ %classlist%
+ </div>
+ENDIF:classlist
+
+IF:constants
+ <div id="constants-list">
+ <h3 class="section-bar">Constants</h3>
+
+ <div class="name-list">
+ <table summary="Constants">
+START:constants
+ <tr class="top-aligned-row context-row">
+ <td class="context-item-name">%name%</td>
+ <td>=</td>
+ <td class="context-item-value">%value%</td>
+IF:desc
+ <td width="3em">&nbsp;</td>
+ <td class="context-item-desc">%desc%</td>
+ENDIF:desc
+ </tr>
+END:constants
+ </table>
+ </div>
+ </div>
+ENDIF:constants
+
+IF:aliases
+ <div id="aliases-list">
+ <h3 class="section-bar">External Aliases</h3>
+
+ <div class="name-list">
+ <table summary="aliases">
+START:aliases
+ <tr class="top-aligned-row context-row">
+ <td class="context-item-name">%old_name%</td>
+ <td>-&gt;</td>
+ <td class="context-item-value">%new_name%</td>
+ </tr>
+IF:desc
+ <tr class="top-aligned-row context-row">
+ <td>&nbsp;</td>
+ <td colspan="2" class="context-item-desc">%desc%</td>
+ </tr>
+ENDIF:desc
+END:aliases
+ </table>
+ </div>
+ </div>
+ENDIF:aliases
+
+
+IF:attributes
+ <div id="attribute-list">
+ <h3 class="section-bar">Attributes</h3>
+
+ <div class="name-list">
+ <table>
+START:attributes
+ <tr class="top-aligned-row context-row">
+ <td class="context-item-name">%name%</td>
+IF:rw
+ <td class="context-item-value">&nbsp;[%rw%]&nbsp;</td>
+ENDIF:rw
+IFNOT:rw
+ <td class="context-item-value">&nbsp;&nbsp;</td>
+ENDIF:rw
+ <td class="context-item-desc">%a_desc%</td>
+ </tr>
+END:attributes
+ </table>
+ </div>
+ </div>
+ENDIF:attributes
+
+
+
+ <!-- if method_list -->
+IF:method_list
+ <div id="methods">
+START:method_list
+IF:methods
+ <h3 class="section-bar">%type% %category% methods</h3>
+
+START:methods
+ <div id="method-%aref%" class="method-detail">
+ <a name="%aref%"></a>
+
+ <div class="method-heading">
+IF:codeurl
+ <a href="%codeurl%" target="Code" class="method-signature"
+ onclick="popupCode('%codeurl%');return false;">
+ENDIF:codeurl
+IF:sourcecode
+ <a href="#%aref%" class="method-signature">
+ENDIF:sourcecode
+IF:callseq
+ <span class="method-name">%callseq%</span>
+ENDIF:callseq
+IFNOT:callseq
+ <span class="method-name">%name%</span><span class="method-args">%params%</span>
+ENDIF:callseq
+IF:codeurl
+ </a>
+ENDIF:codeurl
+IF:sourcecode
+ </a>
+ENDIF:sourcecode
+ </div>
+
+ <div class="method-description">
+IF:m_desc
+ %m_desc%
+ENDIF:m_desc
+IF:sourcecode
+ <p><a class="source-toggle" href="#"
+ onclick="toggleCode('%aref%-source');return false;">[Source]</a></p>
+ <div class="method-source-code" id="%aref%-source">
+<pre>
+%sourcecode%
+</pre>
+ </div>
+ENDIF:sourcecode
+ </div>
+ </div>
+
+END:methods
+ENDIF:methods
+END:method_list
+
+ </div>
+ENDIF:method_list
+END:sections
+}
+
+
+#####################################################################
+### B O D Y T E M P L A T E
+#####################################################################
+
+BODY = HEADER + %{
+
+!INCLUDE! <!-- banner header -->
+
+ <div id="bodyContent">
+
+} + METHOD_LIST + %{
+
+ </div>
+
+} + FOOTER
+
+
+
+#####################################################################
+### S O U R C E C O D E T E M P L A T E
+#####################################################################
+
+SRC_PAGE = XHTML_PREAMBLE + %{
+<html>
+<head>
+ <title>%title%</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=%charset%" />
+ <link rel="stylesheet" href="%style_url%" type="text/css" media="screen" />
+</head>
+<body class="standalone-code">
+ <pre>%code%</pre>
+</body>
+</html>
+}
+
+
+#####################################################################
+### I N D E X F I L E T E M P L A T E S
+#####################################################################
+
+FR_INDEX_BODY = %{
+!INCLUDE!
+}
+
+FILE_INDEX = XHTML_PREAMBLE + %{
+<!--
+
+ %list_title%
+
+ -->
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+ <title>%list_title%</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=%charset%" />
+ <link rel="stylesheet" href="%style_url%" type="text/css" />
+ <base target="docwin" />
+</head>
+<body>
+<div id="index">
+ <h1 class="section-bar">%list_title%</h1>
+ <div id="index-entries">
+START:entries
+ <a href="%href%">%name%</a><br />
+END:entries
+ </div>
+</div>
+</body>
+</html>
+}
+
+CLASS_INDEX = FILE_INDEX
+METHOD_INDEX = FILE_INDEX
+
+INDEX = %{<?xml version="1.0" encoding="%charset%"?>
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
+
+<!--
+
+ %title%
+
+ -->
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+ <title>%title%</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=%charset%" />
+</head>
+<frameset rows="20%, 80%">
+ <frameset cols="25%,35%,45%">
+ <frame src="fr_file_index.html" title="Files" name="Files" />
+ <frame src="fr_class_index.html" name="Classes" />
+ <frame src="fr_method_index.html" name="Methods" />
+ </frameset>
+ <frame src="%initial_page%" name="docwin" />
+</frameset>
+</html>
+}
+
+
+
+ end # module Page
+end # class RDoc
+
+require 'rdoc/generators/template/html/one_page_html'
diff --git a/lib/rdoc/generators/template/html/kilmer.rb b/lib/rdoc/generators/template/html/kilmer.rb
new file mode 100644
index 0000000000..55071fc026
--- /dev/null
+++ b/lib/rdoc/generators/template/html/kilmer.rb
@@ -0,0 +1,435 @@
+module RDoc
+module Page
+
+
+FONTS = "Verdana, Arial, Helvetica, sans-serif"
+
+STYLE = %{
+body,td,p { font-family: %fonts%;
+ color: #000040;
+}
+
+.attr-rw { font-size: xx-small; color: #444488 }
+
+.title-row { background-color: #CCCCFF;
+ color: #000010;
+}
+
+.big-title-font {
+ color: black;
+ font-weight: bold;
+ font-family: %fonts%;
+ font-size: large;
+ height: 60px;
+ padding: 10px 3px 10px 3px;
+}
+
+.small-title-font { color: black;
+ font-family: %fonts%;
+ font-size:10; }
+
+.aqua { color: black }
+
+.method-name, .attr-name {
+ font-family: font-family: %fonts%;
+ font-weight: bold;
+ font-size: small;
+ margin-left: 20px;
+ color: #000033;
+}
+
+.tablesubtitle, .tablesubsubtitle {
+ width: 100%;
+ margin-top: 1ex;
+ margin-bottom: .5ex;
+ padding: 5px 0px 5px 3px;
+ font-size: large;
+ color: black;
+ background-color: #CCCCFF;
+ border: thin;
+}
+
+.name-list {
+ margin-left: 5px;
+ margin-bottom: 2ex;
+ line-height: 105%;
+}
+
+.description {
+ margin-left: 5px;
+ margin-bottom: 2ex;
+ line-height: 105%;
+ font-size: small;
+}
+
+.methodtitle {
+ font-size: small;
+ font-weight: bold;
+ text-decoration: none;
+ color: #000033;
+ background-color: white;
+}
+
+.srclink {
+ font-size: small;
+ font-weight: bold;
+ text-decoration: none;
+ color: #0000DD;
+ background-color: white;
+}
+
+.paramsig {
+ font-size: small;
+}
+
+.srcbut { float: right }
+
+}
+
+
+############################################################################
+
+
+BODY = %{
+<html><head>
+ <title>%title%</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=%charset%">
+ <link rel="stylesheet" href="%style_url%" type="text/css" media="screen" />
+ <script type="text/javascript" language="JavaScript">
+ <!--
+ function popCode(url) {
+ parent.frames.source.location = url
+ }
+ //-->
+ </script>
+</head>
+<body bgcolor="white">
+
+!INCLUDE! <!-- banner header -->
+
+IF:diagram
+<table width="100%"><tr><td align="center">
+%diagram%
+</td></tr></table>
+ENDIF:diagram
+
+IF:description
+<div class="description">%description%</div>
+ENDIF:description
+
+IF:requires
+<table cellpadding="5" width="100%">
+<tr><td class="tablesubtitle">Required files</td></tr>
+</table><br />
+<div class="name-list">
+START:requires
+HREF:aref:name:
+END:requires
+ENDIF:requires
+</div>
+
+IF:methods
+<table cellpadding="5" width="100%">
+<tr><td class="tablesubtitle">Methods</td></tr>
+</table><br />
+<div class="name-list">
+START:methods
+HREF:aref:name:,
+END:methods
+</div>
+ENDIF:methods
+
+
+START:sections
+ <div id="section">
+IF:sectitle
+ <h2 class="section-title"><a name="%secsequence%">%sectitle%</a></h2>
+IF:seccomment
+ <div class="section-comment">
+ %seccomment%
+ </div>
+ENDIF:seccomment
+ENDIF:sectitle
+
+IF:attributes
+<table cellpadding="5" width="100%">
+<tr><td class="tablesubtitle">Attributes</td></tr>
+</table><br />
+<table cellspacing="5">
+START:attributes
+ <tr valign="top">
+IF:rw
+ <td align="center" class="attr-rw">&nbsp;[%rw%]&nbsp;</td>
+ENDIF:rw
+IFNOT:rw
+ <td></td>
+ENDIF:rw
+ <td class="attr-name">%name%</td>
+ <td>%a_desc%</td>
+ </tr>
+END:attributes
+</table>
+ENDIF:attributes
+
+IF:classlist
+<table cellpadding="5" width="100%">
+<tr><td class="tablesubtitle">Classes and Modules</td></tr>
+</table><br />
+%classlist%<br />
+ENDIF:classlist
+
+ !INCLUDE! <!-- method descriptions -->
+
+END:sections
+
+</body>
+</html>
+}
+
+###############################################################################
+
+FILE_PAGE = <<_FILE_PAGE_
+<table width="100%">
+ <tr class="title-row">
+ <td><table width="100%"><tr>
+ <td class="big-title-font" colspan="2"><font size="-3"><b>File</b><br /></font>%short_name%</td>
+ <td align="right"><table cellspacing="0" cellpadding="2">
+ <tr>
+ <td class="small-title-font">Path:</td>
+ <td class="small-title-font">%full_path%
+IF:cvsurl
+ &nbsp;(<a href="%cvsurl%"><acronym title="Concurrent Versioning System">CVS</acronym></a>)
+ENDIF:cvsurl
+ </td>
+ </tr>
+ <tr>
+ <td class="small-title-font">Modified:</td>
+ <td class="small-title-font">%dtm_modified%</td>
+ </tr>
+ </table>
+ </td></tr></table></td>
+ </tr>
+</table><br />
+_FILE_PAGE_
+
+###################################################################
+
+CLASS_PAGE = %{
+<table width="100%" border="0" cellspacing="0">
+ <tr class="title-row">
+ <td class="big-title-font">
+ <font size="-3"><b>%classmod%</b><br /></font>%full_name%
+ </td>
+ <td align="right">
+ <table cellspacing="0" cellpadding="2">
+ <tr valign="top">
+ <td class="small-title-font">In:</td>
+ <td class="small-title-font">
+START:infiles
+HREF:full_path_url:full_path:
+IF:cvsurl
+&nbsp;(<a href="%cvsurl%"><acronym title="Concurrent Versioning System">CVS</acronym></a>)
+ENDIF:cvsurl
+END:infiles
+ </td>
+ </tr>
+IF:parent
+ <tr>
+ <td class="small-title-font">Parent:</td>
+ <td class="small-title-font">
+IF:par_url
+ <a href="%par_url%" class="cyan">
+ENDIF:par_url
+%parent%
+IF:par_url
+ </a>
+ENDIF:par_url
+ </td>
+ </tr>
+ENDIF:parent
+ </table>
+ </td>
+ </tr>
+</table><br />
+}
+
+###################################################################
+
+METHOD_LIST = %{
+IF:includes
+<div class="tablesubsubtitle">Included modules</div><br />
+<div class="name-list">
+START:includes
+ <span class="method-name">HREF:aref:name:</span>
+END:includes
+</div>
+ENDIF:includes
+
+IF:method_list
+START:method_list
+IF:methods
+<table cellpadding=5 width="100%">
+<tr><td class="tablesubtitle">%type% %category% methods</td></tr>
+</table>
+START:methods
+<table width="100%" cellspacing="0" cellpadding="5" border="0">
+<tr><td class="methodtitle">
+<a name="%aref%">
+IF:callseq
+<b>%callseq%</b>
+ENDIF:callseq
+IFNOT:callseq
+ <b>%name%</b>%params%
+ENDIF:callseq
+IF:codeurl
+<a href="%codeurl%" target="source" class="srclink">src</a>
+ENDIF:codeurl
+</a></td></tr>
+</table>
+IF:m_desc
+<div class="description">
+%m_desc%
+</div>
+ENDIF:m_desc
+IF:aka
+<div class="aka">
+This method is also aliased as
+START:aka
+<a href="%aref%">%name%</a>
+END:aka
+</div>
+ENDIF:aka
+IF:sourcecode
+<pre class="source">
+%sourcecode%
+</pre>
+ENDIF:sourcecode
+END:methods
+ENDIF:methods
+END:method_list
+ENDIF:method_list
+}
+
+=begin
+=end
+
+########################## Source code ##########################
+
+SRC_PAGE = %{
+<html>
+<head><title>%title%</title>
+<meta http-equiv="Content-Type" content="text/html; charset=%charset%">
+<style type="text/css">
+.ruby-comment { color: green; font-style: italic }
+.ruby-constant { color: #4433aa; font-weight: bold; }
+.ruby-identifier { color: #222222; }
+.ruby-ivar { color: #2233dd; }
+.ruby-keyword { color: #3333FF; font-weight: bold }
+.ruby-node { color: #777777; }
+.ruby-operator { color: #111111; }
+.ruby-regexp { color: #662222; }
+.ruby-value { color: #662222; font-style: italic }
+ .kw { color: #3333FF; font-weight: bold }
+ .cmt { color: green; font-style: italic }
+ .str { color: #662222; font-style: italic }
+ .re { color: #662222; }
+</style>
+</head>
+<body bgcolor="white">
+<pre>%code%</pre>
+</body>
+</html>
+}
+
+########################## Index ################################
+
+FR_INDEX_BODY = %{
+!INCLUDE!
+}
+
+FILE_INDEX = %{
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=%charset%">
+<style>
+<!--
+ body {
+background-color: #ddddff;
+ font-family: #{FONTS};
+ font-size: 11px;
+ font-style: normal;
+ line-height: 14px;
+ color: #000040;
+ }
+div.banner {
+ background: #0000aa;
+ color: white;
+ padding: 1;
+ margin: 0;
+ font-size: 90%;
+ font-weight: bold;
+ line-height: 1.1;
+ text-align: center;
+ width: 100%;
+}
+
+-->
+</style>
+<base target="docwin">
+</head>
+<body>
+<div class="banner">%list_title%</div>
+START:entries
+<a href="%href%">%name%</a><br />
+END:entries
+</body></html>
+}
+
+CLASS_INDEX = FILE_INDEX
+METHOD_INDEX = FILE_INDEX
+
+INDEX = %{
+<html>
+<head>
+ <title>%title%</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=%charset%">
+</head>
+
+<frameset cols="20%,*">
+ <frameset rows="15%,35%,50%">
+ <frame src="fr_file_index.html" title="Files" name="Files">
+ <frame src="fr_class_index.html" name="Classes">
+ <frame src="fr_method_index.html" name="Methods">
+ </frameset>
+IF:inline_source
+ <frame src="%initial_page%" name="docwin">
+ENDIF:inline_source
+IFNOT:inline_source
+ <frameset rows="80%,20%">
+ <frame src="%initial_page%" name="docwin">
+ <frame src="blank.html" name="source">
+ </frameset>
+ENDIF:inline_source
+ <noframes>
+ <body bgcolor="white">
+ Click <a href="html/index.html">here</a> for a non-frames
+ version of this page.
+ </body>
+ </noframes>
+</frameset>
+
+</html>
+}
+
+# and a blank page to use as a target
+BLANK = %{
+<html><body bgcolor="white"></body></html>
+}
+
+def write_extra_pages
+ template = TemplatePage.new(BLANK)
+ File.open("blank.html", "w") { |f| template.write_html_on(f, {}) }
+end
+
+end
+end
diff --git a/lib/rdoc/generators/template/html/old_html.rb b/lib/rdoc/generators/template/html/old_html.rb
new file mode 100644
index 0000000000..ca66302a08
--- /dev/null
+++ b/lib/rdoc/generators/template/html/old_html.rb
@@ -0,0 +1,728 @@
+module RDoc
+
+# This is how you define the HTML that RDoc generates. Simply create
+# a file in rdoc/generators/html_templates that creates the
+# module RDoc::Page and populate it as described below. Then invoke
+# rdoc using the --template <name of your file> option, and
+# your template will be used.
+#
+# The constants defining pages use a simple templating system:
+#
+# * The templating system is passed a hash. Keys in the hash correspond
+# to tags on this page. The tag %abc% is looked up in the hash,
+# and is replaced by the corresponding hash value.
+#
+# * Some tags are optional. You can detect this using IF/ENDIF
+#
+# IF: title
+# The value of title is %title%
+# ENDIF: title
+#
+# * Some entries in the hash have values that are arrays, where each
+# entry in the array is itself a hash. These are used to generate
+# lists using the START: construct. For example, given a hash
+# containing
+#
+# { 'people' => [ { 'name' => 'Fred', 'age' => '12' },
+# { 'name' => 'Mary', 'age' => '21' } ]
+#
+# You could generate a simple table using
+#
+# <table>
+# START:people
+# <tr><td>%name%<td>%age%</tr>
+# END:people
+# </table>
+#
+# These lists can be nested to an arbitrary depth
+#
+# * the construct HREF:url:name: generates <a href="%url%">%name%</a>
+# if +url+ is defined in the hash, or %name% otherwise.
+#
+#
+# Your file must contain the following constants
+#
+# [*FONTS*] a list of fonts to be used
+# [*STYLE*] a CSS section (without the <style> or comments). This is
+# used to generate a style.css file
+#
+# [*BODY*]
+# The main body of all non-index RDoc pages. BODY will contain
+# two !INCLUDE!s. The first is used to include a document-type
+# specific header (FILE_PAGE or CLASS_PAGE). The second include
+# is for the method list (METHOD_LIST). THe body is passed:
+#
+# %title%::
+# the page's title
+#
+# %style_url%::
+# the url of a style sheet for this page
+#
+# %diagram%::
+# the optional URL of a diagram for this page
+#
+# %description%::
+# a (potentially multi-paragraph) string containing the
+# description for th file/class/module.
+#
+# %requires%::
+# an optional list of %aref%/%name% pairs, one for each module
+# required by this file.
+#
+# %methods%::
+# an optional list of %aref%/%name%, one for each method
+# documented on this page. This is intended to be an index.
+#
+# %attributes%::
+# An optional list. For each attribute it contains:
+# %name%:: the attribute name
+# %rw%:: r/o, w/o, or r/w
+# %a_desc%:: description of the attribute
+#
+# %classlist%::
+# An optional string containing an already-formatted list of
+# classes and modules documented in this file
+#
+# For FILE_PAGE entries, the body will be passed
+#
+# %short_name%::
+# The name of the file
+#
+# %full_path%::
+# The full path to the file
+#
+# %dtm_modified%::
+# The date/time the file was last changed
+#
+# For class and module pages, the body will be passed
+#
+# %classmod%::
+# The name of the class or module
+#
+# %files%::
+# A list. For each file this class is defined in, it contains:
+# %full_path_url%:: an (optional) URL of the RDoc page
+# for this file
+# %full_path%:: the name of the file
+#
+# %par_url%::
+# The (optional) URL of the RDoc page documenting this class's
+# parent class
+#
+# %parent%::
+# The name of this class's parent.
+#
+# For both files and classes, the body is passed the following information
+# on includes and methods:
+#
+# %includes%::
+# Optional list of included modules. For each, it receives
+# %aref%:: optional URL to RDoc page for the module
+# %name%:: the name of the module
+#
+# %method_list%::
+# Optional list of methods of a particular class and category.
+#
+# Each method list entry contains:
+#
+# %type%:: public/private/protected
+# %category%:: instance/class
+# %methods%:: a list of method descriptions
+#
+# Each method description contains:
+#
+# %aref%:: a target aref, used when referencing this method
+# description. You should code this as <a name="%aref%">
+# %codeurl%:: the optional URL to the page containing this method's
+# source code.
+# %name%:: the method's name
+# %params%:: the method's parameters
+# %callseq%:: a full calling sequence
+# %m_desc%:: the (potentially multi-paragraph) description of
+# this method.
+#
+# [*CLASS_PAGE*]
+# Header for pages documenting classes and modules. See
+# BODY above for the available parameters.
+#
+# [*FILE_PAGE*]
+# Header for pages documenting files. See
+# BODY above for the available parameters.
+#
+# [*METHOD_LIST*]
+# Controls the display of the listing of methods. See BODY for
+# parameters.
+#
+# [*INDEX*]
+# The top-level index page. For a browser-like environment
+# define a frame set that includes the file, class, and
+# method indices. Passed
+# %title%:: title of page
+# %initial_page% :: url of initial page to display
+#
+# [*CLASS_INDEX*]
+# Individual files for the three indexes. Passed:
+# %index_url%:: URL of main index page
+# %entries%:: List of
+# %name%:: name of an index entry
+# %href%:: url of corresponding page
+# [*METHOD_INDEX*]
+# Same as CLASS_INDEX for methods
+#
+# [*FILE_INDEX*]
+# Same as CLASS_INDEX for methods
+#
+# [*FR_INDEX_BODY*]
+# A wrapper around CLASS_INDEX, METHOD_INDEX, and FILE_INDEX.
+# If those index strings contain the complete HTML for the
+# output, then FR_INDEX_BODY can simply be !INCLUDE!
+#
+# [*SRC_PAGE*]
+# Page used to display source code. Passed %title% and %code%,
+# the latter being a multi-line string of code.
+
+module Page
+
+FONTS = "Verdana, Arial, Helvetica, sans-serif"
+
+STYLE = %{
+body,td,p { font-family: %fonts%;
+ color: #000040;
+}
+
+.attr-rw { font-size: x-small; color: #444488 }
+
+.title-row { background: #0000aa;
+ color: #eeeeff;
+}
+
+.big-title-font { color: white;
+ font-family: %fonts%;
+ font-size: large;
+ height: 50px}
+
+.small-title-font { color: aqua;
+ font-family: %fonts%;
+ font-size: xx-small; }
+
+.aqua { color: aqua }
+
+.method-name, attr-name {
+ font-family: monospace; font-weight: bold;
+}
+
+.tablesubtitle, .tablesubsubtitle {
+ width: 100%;
+ margin-top: 1ex;
+ margin-bottom: .5ex;
+ padding: 5px 0px 5px 20px;
+ font-size: large;
+ color: aqua;
+ background: #3333cc;
+}
+
+.name-list {
+ font-family: monospace;
+ margin-left: 40px;
+ margin-bottom: 2ex;
+ line-height: 140%;
+}
+
+.description {
+ margin-left: 40px;
+ margin-top: -2ex;
+ margin-bottom: 2ex;
+}
+
+.description p {
+ line-height: 140%;
+}
+
+.aka {
+ margin-left: 40px;
+ margin-bottom: 2ex;
+ line-height: 100%;
+ font-size: small;
+ color: #808080;
+}
+
+.methodtitle {
+ font-size: medium;
+ text-decoration: none;
+ color: #0000AA;
+ background: white;
+}
+
+.paramsig {
+ font-size: small;
+}
+
+.srcbut { float: right }
+
+pre { font-size: 1.2em; }
+tt { font-size: 1.2em; }
+
+pre.source {
+ border-style: groove;
+ background-color: #ddddff;
+ margin-left: 40px;
+ padding: 1em 0em 1em 2em;
+}
+
+.classlist {
+ margin-left: 40px;
+ margin-bottom: 2ex;
+ line-height: 140%;
+}
+
+li {
+ display: list-item;
+ margin-top: .6em;
+}
+
+.ruby-comment { color: green; font-style: italic }
+.ruby-constant { color: #4433aa; font-weight: bold; }
+.ruby-identifier { color: #222222; }
+.ruby-ivar { color: #2233dd; }
+.ruby-keyword { color: #3333FF; font-weight: bold }
+.ruby-node { color: #777777; }
+.ruby-operator { color: #111111; }
+.ruby-regexp { color: #662222; }
+.ruby-value { color: #662222; font-style: italic }
+
+}
+
+
+############################################################################
+
+
+HEADER = %{
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+ <title>%title%</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=%charset%" />
+ <link rel=StyleSheet href="%style_url%" type="text/css" media="screen" />
+ <script type="text/javascript" language="JavaScript">
+ <!--
+ function popCode(url) {
+ window.open(url, "Code",
+ "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+ }
+ //-->
+ </script>
+</head>
+}
+
+
+###################################################################
+
+METHOD_LIST = %{
+IF:includes
+<table summary="Included modules" cellpadding="5" width="100%">
+<tr><td class="tablesubtitle">Included modules</td></tr>
+</table>
+<div class="name-list">
+START:includes
+ <span class="method-name">HREF:aref:name:</span>
+END:includes
+</div>
+ENDIF:includes
+
+IF:method_list
+START:method_list
+IF:methods
+<table summary="Method list" cellpadding="5" width="100%">
+<tr><td class="tablesubtitle">%type% %category% methods</td></tr>
+</table>
+START:methods
+<table summary="method" width="100%" cellspacing="0" cellpadding="5" border="0">
+<tr><td class="methodtitle">
+<a name="%aref%"></a>
+IF:codeurl
+<a href="%codeurl%" target="Code" class="methodtitle"
+ onClick="popCode('%codeurl%');return false;">
+ENDIF:codeurl
+IF:callseq
+<b>%callseq%</b>
+ENDIF:callseq
+IFNOT:callseq
+<b>%name%</b>%params%
+ENDIF:callseq
+IF:codeurl
+</a>
+ENDIF:codeurl
+</td></tr>
+</table>
+IF:m_desc
+<div class="description">
+%m_desc%
+</div>
+ENDIF:m_desc
+IF:aka
+<div class="aka">
+This method is also aliased as
+START:aka
+<a href="%aref%">%name%</a>
+END:aka
+</div>
+ENDIF:aka
+IF:sourcecode
+<pre class="source">
+%sourcecode%
+</pre>
+ENDIF:sourcecode
+END:methods
+ENDIF:methods
+END:method_list
+ENDIF:method_list
+}
+
+###################################################################
+
+CONTEXT_CONTENT = %{
+IF:diagram
+<table summary="Diagram of classes and modules" width="100%">
+<tr><td align="center">
+%diagram%
+</td></tr></table>
+ENDIF:diagram
+
+
+IF:description
+<div class="description">%description%</div>
+ENDIF:description
+
+IF:requires
+<table summary="Requires" cellpadding="5" width="100%">
+<tr><td class="tablesubtitle">Required files</td></tr>
+</table>
+<div class="name-list">
+START:requires
+HREF:aref:name:&nbsp; &nbsp;
+END:requires
+</div>
+ENDIF:requires
+
+IF:methods
+<table summary="Methods" cellpadding="5" width="100%">
+<tr><td class="tablesubtitle">Methods</td></tr>
+</table>
+<div class="name-list">
+START:methods
+HREF:aref:name:&nbsp; &nbsp;
+END:methods
+</div>
+ENDIF:methods
+
+IF:constants
+<table summary="Constants" cellpadding="5" width="100%">
+<tr><td class="tablesubtitle">Constants</td></tr>
+</table>
+<table cellpadding="5">
+START:constants
+<tr valign="top"><td>%name%</td><td>=</td><td>%value%</td></tr>
+IF:desc
+<tr><td></td><td></td><td>%desc%</td></tr>
+ENDIF:desc
+END:constants
+</table>
+ENDIF:constants
+
+IF:aliases
+<table summary="Aliases" cellpadding="5" width="100%">
+<tr><td class="tablesubtitle">External Aliases</td></tr>
+</table>
+<div class="name-list">
+START:aliases
+%old_name% -> %new_name%<br />
+END:aliases
+</div>
+ENDIF:aliases
+
+IF:attributes
+<table summary="Attributes" cellpadding="5" width="100%">
+<tr><td class="tablesubtitle">Attributes</td></tr>
+</table>
+<table summary="Attribute details" cellspacing="5">
+START:attributes
+ <tr valign="top">
+ <td class="attr-name">%name%</td>
+IF:rw
+ <td align="center" class="attr-rw">&nbsp;[%rw%]&nbsp;</td>
+ENDIF:rw
+IFNOT:rw
+ <td></td>
+ENDIF:rw
+ <td>%a_desc%</td>
+ </tr>
+END:attributes
+</table>
+ENDIF:attributes
+
+IF:classlist
+<table summary="List of classes" cellpadding="5" width="100%">
+<tr><td class="tablesubtitle">Classes and Modules</td></tr>
+</table>
+<div class="classlist">
+%classlist%
+</div>
+ENDIF:classlist
+}
+
+###############################################################################
+
+BODY = HEADER + %{
+<body bgcolor="white">
+!INCLUDE! <!-- banner header -->
+} +
+CONTEXT_CONTENT + METHOD_LIST +
+%{
+</body>
+</html>
+}
+
+
+###############################################################################
+
+FILE_PAGE = <<_FILE_PAGE_
+<table summary="Information on file" width="100%">
+ <tr class="title-row">
+ <td><table summary="layout" width="100%"><tr>
+ <td class="big-title-font" colspan="2">%short_name%</td>
+ <td align="right"><table summary="layout" cellspacing="0" cellpadding="2">
+ <tr>
+ <td class="small-title-font">Path:</td>
+ <td class="small-title-font">%full_path%
+IF:cvsurl
+ &nbsp;(<a href="%cvsurl%"><acronym title="Concurrent Versioning System">CVS</acronym></a>)
+ENDIF:cvsurl
+ </td>
+ </tr>
+ <tr>
+ <td class="small-title-font">Modified:</td>
+ <td class="small-title-font">%dtm_modified%</td>
+ </tr>
+ </table>
+ </td></tr></table></td>
+ </tr>
+</table>
+_FILE_PAGE_
+
+###################################################################
+
+CLASS_PAGE = %{
+<table summary="Information on class" width="100%" border="0" cellspacing="0">
+ <tr class="title-row">
+ <td class="big-title-font">
+ <sup><font color="aqua">%classmod%</font></sup> %full_name%
+ </td>
+ <td align="right">
+ <table summary="layout" cellspacing="0" cellpadding="2">
+ <tr valign="top">
+ <td class="small-title-font">In:</td>
+ <td class="small-title-font">
+START:infiles
+IF:full_path_url
+ <a href="%full_path_url%" class="aqua">
+ENDIF:full_path_url
+%full_path%
+IF:full_path_url
+ </a>
+ENDIF:full_path_url
+IF:cvsurl
+ &nbsp;(<a href="%cvsurl%"><acronym title="Concurrent Versioning System">CVS</acronym></a>)
+ENDIF:cvsurl
+<br />
+END:infiles
+ </td>
+ </tr>
+IF:parent
+ <tr>
+ <td class="small-title-font">Parent:</td>
+ <td class="small-title-font">
+IF:par_url
+ <a href="%par_url%" class="aqua">
+ENDIF:par_url
+%parent%
+IF:par_url
+ </a>
+ENDIF:par_url
+ </td>
+ </tr>
+ENDIF:parent
+ </table>
+ </td>
+ </tr>
+</table>
+}
+
+=begin
+=end
+
+########################## Source code ##########################
+
+SRC_PAGE = %{
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=%charset%">
+<title>%title%</title>
+<link rel="stylesheet" href="%style_url%" type="text/css" media="screen" />
+</head>
+<body bgcolor="white">
+<pre>%code%</pre>
+</body>
+</html>
+}
+
+########################## Index ################################
+
+FR_INDEX_BODY = %{
+!INCLUDE!
+}
+
+FILE_INDEX = %{
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=%charset%">
+<title>%list_title%</title>
+<style type="text/css">
+<!--
+ body {
+background-color: #ddddff;
+ font-family: #{FONTS};
+ font-size: 11px;
+ font-style: normal;
+ line-height: 14px;
+ color: #000040;
+ }
+div.banner {
+ background: #0000aa;
+ color: white;
+ padding: 1;
+ margin: 0;
+ font-size: 90%;
+ font-weight: bold;
+ line-height: 1.1;
+ text-align: center;
+ width: 100%;
+}
+
+A.xx { color: white; font-weight: bold; }
+-->
+</style>
+<base target="docwin">
+</head>
+<body>
+<div class="banner"><a href="%index_url%" class="xx">%list_title%</a></div>
+START:entries
+<a href="%href%">%name%</a><br />
+END:entries
+</body></html>
+}
+
+CLASS_INDEX = FILE_INDEX
+METHOD_INDEX = FILE_INDEX
+
+INDEX = %{
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=%charset%">
+<title>%title%</title></head>
+
+<frameset rows="20%, 80%">
+ <frameset cols="25%,35%,45%">
+ <frame src="fr_file_index.html" title="Files" name="Files">
+ <frame src="fr_class_index.html" name="Classes">
+ <frame src="fr_method_index.html" name="Methods">
+ </frameset>
+ <frame src="%initial_page%" name="docwin">
+ <noframes>
+ <body bgcolor="white">
+ Sorry, RDoc currently only generates HTML using frames.
+ </body>
+ </noframes>
+</frameset>
+
+</html>
+}
+
+######################################################################
+#
+# The following is used for the -1 option
+#
+
+CONTENTS_XML = %{
+IF:description
+%description%
+ENDIF:description
+
+IF:requires
+<h4>Requires:</h4>
+<ul>
+START:requires
+IF:aref
+<li><a href="%aref%">%name%</a></li>
+ENDIF:aref
+IFNOT:aref
+<li>%name%</li>
+ENDIF:aref
+END:requires
+</ul>
+ENDIF:requires
+
+IF:attributes
+<h4>Attributes</h4>
+<table>
+START:attributes
+<tr><td>%name%</td><td>%rw%</td><td>%a_desc%</td></tr>
+END:attributes
+</table>
+ENDIF:attributes
+
+IF:includes
+<h4>Includes</h4>
+<ul>
+START:includes
+IF:aref
+<li><a href="%aref%">%name%</a></li>
+ENDIF:aref
+IFNOT:aref
+<li>%name%</li>
+ENDIF:aref
+END:includes
+</ul>
+ENDIF:includes
+
+IF:method_list
+<h3>Methods</h3>
+START:method_list
+IF:methods
+START:methods
+<h4>%type% %category% method: <a name="%aref%">%name%%params%</a></h4>
+
+IF:m_desc
+%m_desc%
+ENDIF:m_desc
+
+IF:sourcecode
+<blockquote><pre>
+%sourcecode%
+</pre></blockquote>
+ENDIF:sourcecode
+END:methods
+ENDIF:methods
+END:method_list
+ENDIF:method_list
+}
+
+
+end
+end
+
+require 'rdoc/generators/template/html/one_page_html'
diff --git a/lib/rdoc/generators/template/html/one_page_html.rb b/lib/rdoc/generators/template/html/one_page_html.rb
new file mode 100644
index 0000000000..19441f4725
--- /dev/null
+++ b/lib/rdoc/generators/template/html/one_page_html.rb
@@ -0,0 +1,122 @@
+module RDoc
+module Page
+######################################################################
+#
+# The following is used for the -1 option
+#
+
+CONTENTS_XML = %{
+IF:description
+%description%
+ENDIF:description
+
+IF:requires
+<h4>Requires:</h4>
+<ul>
+START:requires
+IF:aref
+<li><a href="%aref%">%name%</a></li>
+ENDIF:aref
+IFNOT:aref
+<li>%name%</li>
+ENDIF:aref
+END:requires
+</ul>
+ENDIF:requires
+
+IF:attributes
+<h4>Attributes</h4>
+<table>
+START:attributes
+<tr><td>%name%</td><td>%rw%</td><td>%a_desc%</td></tr>
+END:attributes
+</table>
+ENDIF:attributes
+
+IF:includes
+<h4>Includes</h4>
+<ul>
+START:includes
+IF:aref
+<li><a href="%aref%">%name%</a></li>
+ENDIF:aref
+IFNOT:aref
+<li>%name%</li>
+ENDIF:aref
+END:includes
+</ul>
+ENDIF:includes
+
+IF:method_list
+<h3>Methods</h3>
+START:method_list
+IF:methods
+START:methods
+<h4>%type% %category% method:
+IF:callseq
+<a name="%aref%">%callseq%</a>
+ENDIF:callseq
+IFNOT:callseq
+<a name="%aref%">%name%%params%</a></h4>
+ENDIF:callseq
+
+IF:m_desc
+%m_desc%
+ENDIF:m_desc
+
+IF:sourcecode
+<blockquote><pre>
+%sourcecode%
+</pre></blockquote>
+ENDIF:sourcecode
+END:methods
+ENDIF:methods
+END:method_list
+ENDIF:method_list
+}
+
+########################################################################
+
+ONE_PAGE = %{
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+ <title>%title%</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=%charset%" />
+</head>
+<body>
+START:files
+<h2>File: %short_name%</h2>
+<table>
+ <tr><td>Path:</td><td>%full_path%</td></tr>
+ <tr><td>Modified:</td><td>%dtm_modified%</td></tr>
+</table>
+} + CONTENTS_XML + %{
+END:files
+
+IF:classes
+<h2>Classes</h2>
+START:classes
+IF:parent
+<h3>%classmod% %full_name% &lt; HREF:par_url:parent:</h3>
+ENDIF:parent
+IFNOT:parent
+<h3>%classmod% %full_name%</h3>
+ENDIF:parent
+
+IF:infiles
+(in files
+START:infiles
+HREF:full_path_url:full_path:
+END:infiles
+)
+ENDIF:infiles
+} + CONTENTS_XML + %{
+END:classes
+ENDIF:classes
+</body>
+</html>
+}
+
+end
+end
diff --git a/lib/rdoc/generators/template/xml/rdf.rb b/lib/rdoc/generators/template/xml/rdf.rb
new file mode 100644
index 0000000000..1545d81a2f
--- /dev/null
+++ b/lib/rdoc/generators/template/xml/rdf.rb
@@ -0,0 +1,112 @@
+module RDoc
+module Page
+
+
+
+CONTENTS_RDF = %{
+IF:description
+ <description rd:parseType="Literal">
+%description%
+ </description>
+ENDIF:description
+
+IF:requires
+START:requires
+ <rd:required-file rd:name="%name%" />
+END:requires
+ENDIF:requires
+
+IF:attributes
+START:attributes
+ <contents>
+ <Attribute rd:name="%name%">
+IF:rw
+ <attribute-rw>%rw%</attribute-rw>
+ENDIF:rw
+ <description rdf:parseType="Literal">%a_desc%</description>
+ </Attribute>
+ </contents>
+END:attributes
+ENDIF:attributes
+
+IF:includes
+ <IncludedModuleList>
+START:includes
+ <included-module rd:name="%name%" />
+END:includes
+ </IncludedModuleList>
+ENDIF:includes
+
+IF:method_list
+START:method_list
+IF:methods
+START:methods
+ <contents>
+ <Method rd:name="%name%" rd:visibility="%type%"
+ rd:category="%category%" rd:id="%aref%">
+ <parameters>%params%</parameters>
+IF:m_desc
+ <description rdf:parseType="Literal">
+%m_desc%
+ </description>
+ENDIF:m_desc
+IF:sourcecode
+ <source-code-listing rdf:parseType="Literal">
+%sourcecode%
+ </source-code-listing>
+ENDIF:sourcecode
+ </Method>
+ </contents>
+END:methods
+ENDIF:methods
+END:method_list
+ENDIF:method_list
+ <!-- end method list -->
+}
+
+########################################################################
+
+ONE_PAGE = %{<?xml version="1.0" encoding="utf-8"?>
+<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns="http://pragprog.com/rdoc/rdoc.rdf#"
+ xmlns:rd="http://pragprog.com/rdoc/rdoc.rdf#">
+
+<!-- RDoc -->
+START:files
+ <rd:File rd:name="%short_name%" rd:id="%href%">
+ <path>%full_path%</path>
+ <dtm-modified>%dtm_modified%</dtm-modified>
+} + CONTENTS_RDF + %{
+ </rd:File>
+END:files
+START:classes
+ <%classmod% rd:name="%full_name%" rd:id="%full_name%">
+ <classmod-info>
+IF:infiles
+ <InFiles>
+START:infiles
+ <infile>
+ <File rd:name="%full_path%"
+IF:full_path_url
+ rdf:about="%full_path_url%"
+ENDIF:full_path_url
+ />
+ </infile>
+END:infiles
+ </InFiles>
+ENDIF:infiles
+IF:parent
+ <superclass>HREF:par_url:parent:</superclass>
+ENDIF:parent
+ </classmod-info>
+} + CONTENTS_RDF + %{
+ </%classmod%>
+END:classes
+<!-- /RDoc -->
+</rdf:RDF>
+}
+
+
+end
+end
+
diff --git a/lib/rdoc/generators/template/xml/xml.rb b/lib/rdoc/generators/template/xml/xml.rb
new file mode 100644
index 0000000000..4a0c8c9ac4
--- /dev/null
+++ b/lib/rdoc/generators/template/xml/xml.rb
@@ -0,0 +1,112 @@
+module RDoc
+module Page
+
+
+
+CONTENTS_XML = %{
+IF:description
+ <description>
+%description%
+ </description>
+ENDIF:description
+ <contents>
+IF:requires
+ <required-file-list>
+START:requires
+ <required-file name="%name%"
+IF:aref
+ href="%aref%"
+ENDIF:aref
+ />
+END:requires
+ </required-file-list>
+ENDIF:requires
+IF:attributes
+ <attribute-list>
+START:attributes
+ <attribute name="%name%">
+IF:rw
+ <attribute-rw>%rw%</attribute-rw>
+ENDIF:rw
+ <description>%a_desc%</description>
+ </attribute>
+END:attributes
+ </attribute-list>
+ENDIF:attributes
+IF:includes
+ <included-module-list>
+START:includes
+ <included-module name="%name%"
+IF:aref
+ href="%aref%"
+ENDIF:aref
+ />
+END:includes
+ </included-module-list>
+ENDIF:includes
+IF:method_list
+ <method-list>
+START:method_list
+IF:methods
+START:methods
+ <method name="%name%" type="%type%" category="%category%" id="%aref%">
+ <parameters>%params%</parameters>
+IF:m_desc
+ <description>
+%m_desc%
+ </description>
+ENDIF:m_desc
+IF:sourcecode
+ <source-code-listing>
+%sourcecode%
+ </source-code-listing>
+ENDIF:sourcecode
+ </method>
+END:methods
+ENDIF:methods
+END:method_list
+ </method-list>
+ENDIF:method_list
+ </contents>
+}
+
+########################################################################
+
+ONE_PAGE = %{<?xml version="1.0" encoding="utf-8"?>
+<rdoc>
+<file-list>
+START:files
+ <file name="%short_name%" id="%href%">
+ <file-info>
+ <path>%full_path%</path>
+ <dtm-modified>%dtm_modified%</dtm-modified>
+ </file-info>
+} + CONTENTS_XML + %{
+ </file>
+END:files
+</file-list>
+<class-module-list>
+START:classes
+ <%classmod% name="%full_name%" id="%full_name%">
+ <classmod-info>
+IF:infiles
+ <infiles>
+START:infiles
+ <infile>HREF:full_path_url:full_path:</infile>
+END:infiles
+ </infiles>
+ENDIF:infiles
+IF:parent
+ <superclass>HREF:par_url:parent:</superclass>
+ENDIF:parent
+ </classmod-info>
+} + CONTENTS_XML + %{
+ </%classmod%>
+END:classes
+</class-module-list>
+</rdoc>
+}
+
+
+end
+end
diff --git a/lib/rdoc/generators/xml_generator.rb b/lib/rdoc/generators/xml_generator.rb
new file mode 100644
index 0000000000..8c1a76d62b
--- /dev/null
+++ b/lib/rdoc/generators/xml_generator.rb
@@ -0,0 +1,130 @@
+
+require 'ftools'
+
+require 'rdoc/options'
+require 'rdoc/markup/simple_markup'
+require 'rdoc/markup/simple_markup/to_html'
+require 'rdoc/generators/html_generator'
+
+module Generators
+
+ # Generate XML output as one big file
+
+ class XMLGenerator < HTMLGenerator
+
+ # Standard generator factory
+ def XMLGenerator.for(options)
+ XMLGenerator.new(options)
+ end
+
+
+ def initialize(*args)
+ super
+ end
+
+ ##
+ # Build the initial indices and output objects
+ # based on an array of TopLevel objects containing
+ # the extracted information.
+
+ def generate(info)
+ @info = info
+ @files = []
+ @classes = []
+ @hyperlinks = {}
+
+ build_indices
+ generate_xml
+ end
+
+
+ ##
+ # Generate:
+ #
+ # * a list of HtmlFile objects for each TopLevel object.
+ # * a list of HtmlClass objects for each first level
+ # class or module in the TopLevel objects
+ # * a complete list of all hyperlinkable terms (file,
+ # class, module, and method names)
+
+ def build_indices
+
+ @info.each do |toplevel|
+ @files << HtmlFile.new(toplevel, @options, FILE_DIR)
+ end
+
+ RDoc::TopLevel.all_classes_and_modules.each do |cls|
+ build_class_list(cls, @files[0], CLASS_DIR)
+ end
+ end
+
+ def build_class_list(from, html_file, class_dir)
+ @classes << HtmlClass.new(from, html_file, class_dir, @options)
+ from.each_classmodule do |mod|
+ build_class_list(mod, html_file, class_dir)
+ end
+ end
+
+ ##
+ # Generate all the HTML. For the one-file case, we generate
+ # all the information in to one big hash
+ #
+ def generate_xml
+ values = {
+ 'charset' => @options.charset,
+ 'files' => gen_into(@files),
+ 'classes' => gen_into(@classes)
+ }
+
+ # this method is defined in the template file
+ write_extra_pages if defined? write_extra_pages
+
+ template = TemplatePage.new(RDoc::Page::ONE_PAGE)
+
+ if @options.op_name
+ opfile = File.open(@options.op_name, "w")
+ else
+ opfile = $stdout
+ end
+ template.write_html_on(opfile, values)
+ end
+
+ def gen_into(list)
+ res = []
+ list.each do |item|
+ res << item.value_hash
+ end
+ res
+ end
+
+ def gen_file_index
+ gen_an_index(@files, 'Files')
+ end
+
+ def gen_class_index
+ gen_an_index(@classes, 'Classes')
+ end
+
+ def gen_method_index
+ gen_an_index(HtmlMethod.all_methods, 'Methods')
+ end
+
+
+ def gen_an_index(collection, title)
+ res = []
+ collection.sort.each do |f|
+ if f.document_self
+ res << { "href" => f.path, "name" => f.index_name }
+ end
+ end
+
+ return {
+ "entries" => res,
+ 'list_title' => title,
+ 'index_url' => main_url,
+ }
+ end
+
+ end
+
+end
diff --git a/lib/rdoc/known_classes.rb b/lib/rdoc/known_classes.rb
deleted file mode 100644
index dbb1802f5a..0000000000
--- a/lib/rdoc/known_classes.rb
+++ /dev/null
@@ -1,68 +0,0 @@
-module RDoc
-
- ##
- # Ruby's built-in classes, modules and exceptions
-
- KNOWN_CLASSES = {
- "rb_cArray" => "Array",
- "rb_cBignum" => "Bignum",
- "rb_cClass" => "Class",
- "rb_cData" => "Data",
- "rb_cDir" => "Dir",
- "rb_cFalseClass" => "FalseClass",
- "rb_cFile" => "File",
- "rb_cFixnum" => "Fixnum",
- "rb_cFloat" => "Float",
- "rb_cHash" => "Hash",
- "rb_cIO" => "IO",
- "rb_cInteger" => "Integer",
- "rb_cModule" => "Module",
- "rb_cNilClass" => "NilClass",
- "rb_cNumeric" => "Numeric",
- "rb_cObject" => "Object",
- "rb_cProc" => "Proc",
- "rb_cRange" => "Range",
- "rb_cRegexp" => "Regexp",
- "rb_cRubyVM" => "RubyVM",
- "rb_cString" => "String",
- "rb_cStruct" => "Struct",
- "rb_cSymbol" => "Symbol",
- "rb_cThread" => "Thread",
- "rb_cTime" => "Time",
- "rb_cTrueClass" => "TrueClass",
-
- "rb_eArgError" => "ArgError",
- "rb_eEOFError" => "EOFError",
- "rb_eException" => "Exception",
- "rb_eFatal" => "Fatal",
- "rb_eFloatDomainError" => "FloatDomainError",
- "rb_eIOError" => "IOError",
- "rb_eIndexError" => "IndexError",
- "rb_eInterrupt" => "Interrupt",
- "rb_eLoadError" => "LoadError",
- "rb_eNameError" => "NameError",
- "rb_eNoMemError" => "NoMemError",
- "rb_eNotImpError" => "NotImpError",
- "rb_eRangeError" => "RangeError",
- "rb_eRuntimeError" => "RuntimeError",
- "rb_eScriptError" => "ScriptError",
- "rb_eSecurityError" => "SecurityError",
- "rb_eSignal" => "Signal",
- "rb_eStandardError" => "StandardError",
- "rb_eSyntaxError" => "SyntaxError",
- "rb_eSystemCallError" => "SystemCallError",
- "rb_eSystemExit" => "SystemExit",
- "rb_eTypeError" => "TypeError",
- "rb_eZeroDivError" => "ZeroDivError",
-
- "rb_mComparable" => "Comparable",
- "rb_mEnumerable" => "Enumerable",
- "rb_mErrno" => "Errno",
- "rb_mFileTest" => "FileTest",
- "rb_mGC" => "GC",
- "rb_mKernel" => "Kernel",
- "rb_mMath" => "Math",
- "rb_mProcess" => "Process"
- }
-
-end
diff --git a/lib/rdoc/markup.rb b/lib/rdoc/markup.rb
deleted file mode 100644
index a584a79b75..0000000000
--- a/lib/rdoc/markup.rb
+++ /dev/null
@@ -1,378 +0,0 @@
-require 'rdoc'
-
-##
-# RDoc::Markup parses plain text documents and attempts to decompose them into
-# their constituent parts. Some of these parts are high-level: paragraphs,
-# chunks of verbatim text, list entries and the like. Other parts happen at
-# the character level: a piece of bold text, a word in code font. This markup
-# is similar in spirit to that used on WikiWiki webs, where folks create web
-# pages using a simple set of formatting rules.
-#
-# RDoc::Markup itself does no output formatting: this is left to a different
-# set of classes.
-#
-# RDoc::Markup is extendable at runtime: you can add \new markup elements to
-# be recognised in the documents that RDoc::Markup parses.
-#
-# RDoc::Markup is intended to be the basis for a family of tools which share
-# the common requirement that simple, plain-text should be rendered in a
-# variety of different output formats and media. It is envisaged that
-# RDoc::Markup could be the basis for formatting RDoc style comment blocks,
-# Wiki entries, and online FAQs.
-#
-# == Synopsis
-#
-# This code converts +input_string+ to HTML. The conversion takes place in
-# the +convert+ method, so you can use the same RDoc::Markup converter to
-# convert multiple input strings.
-#
-# require 'rdoc/markup/to_html'
-#
-# h = RDoc::Markup::ToHtml.new
-#
-# puts h.convert(input_string)
-#
-# You can extend the RDoc::Markup parser to recognise new markup
-# sequences, and to add special processing for text that matches a
-# regular expression. Here we make WikiWords significant to the parser,
-# and also make the sequences {word} and \<no>text...</no> signify
-# strike-through text. When then subclass the HTML output class to deal
-# with these:
-#
-# require 'rdoc/markup'
-# require 'rdoc/markup/to_html'
-#
-# class WikiHtml < RDoc::Markup::ToHtml
-# def handle_special_WIKIWORD(special)
-# "<font color=red>" + special.text + "</font>"
-# end
-# end
-#
-# m = RDoc::Markup.new
-# m.add_word_pair("{", "}", :STRIKE)
-# m.add_html("no", :STRIKE)
-#
-# m.add_special(/\b([A-Z][a-z]+[A-Z]\w+)/, :WIKIWORD)
-#
-# wh = WikiHtml.new
-# wh.add_tag(:STRIKE, "<strike>", "</strike>")
-#
-# puts "<body>#{wh.convert ARGF.read}</body>"
-#
-#--
-# Author:: Dave Thomas, dave@pragmaticprogrammer.com
-# License:: Ruby license
-
-class RDoc::Markup
-
- SPACE = ?\s
-
- # List entries look like:
- # * text
- # 1. text
- # [label] text
- # label:: text
- #
- # Flag it as a list entry, and work out the indent for subsequent lines
-
- SIMPLE_LIST_RE = /^(
- ( \* (?# bullet)
- |- (?# bullet)
- |\d+\. (?# numbered )
- |[A-Za-z]\. (?# alphabetically numbered )
- )
- \s+
- )\S/x
-
- LABEL_LIST_RE = /^(
- ( \[.*?\] (?# labeled )
- |\S.*:: (?# note )
- )(?:\s+|$)
- )/x
-
- ##
- # Take a block of text and use various heuristics to determine it's
- # structure (paragraphs, lists, and so on). Invoke an event handler as we
- # identify significant chunks.
-
- def initialize
- @am = RDoc::Markup::AttributeManager.new
- @output = nil
- end
-
- ##
- # Add to the sequences used to add formatting to an individual word (such
- # as *bold*). Matching entries will generate attributes that the output
- # formatters can recognize by their +name+.
-
- def add_word_pair(start, stop, name)
- @am.add_word_pair(start, stop, name)
- end
-
- ##
- # Add to the sequences recognized as general markup.
-
- def add_html(tag, name)
- @am.add_html(tag, name)
- end
-
- ##
- # Add to other inline sequences. For example, we could add WikiWords using
- # something like:
- #
- # parser.add_special(/\b([A-Z][a-z]+[A-Z]\w+)/, :WIKIWORD)
- #
- # Each wiki word will be presented to the output formatter via the
- # accept_special method.
-
- def add_special(pattern, name)
- @am.add_special(pattern, name)
- end
-
- ##
- # We take a string, split it into lines, work out the type of each line,
- # and from there deduce groups of lines (for example all lines in a
- # paragraph). We then invoke the output formatter using a Visitor to
- # display the result.
-
- def convert(str, op)
- lines = str.split(/\r?\n/).map { |line| Line.new line }
- @lines = Lines.new lines
-
- return "" if @lines.empty?
- @lines.normalize
- assign_types_to_lines
- group = group_lines
- # call the output formatter to handle the result
- #group.each { |line| p line }
- group.accept @am, op
- end
-
- private
-
- ##
- # Look through the text at line indentation. We flag each line as being
- # Blank, a paragraph, a list element, or verbatim text.
-
- def assign_types_to_lines(margin = 0, level = 0)
- while line = @lines.next
- if line.blank? then
- line.stamp :BLANK, level
- next
- end
-
- # if a line contains non-blanks before the margin, then it must belong
- # to an outer level
-
- text = line.text
-
- for i in 0...margin
- if text[i] != SPACE
- @lines.unget
- return
- end
- end
-
- active_line = text[margin..-1]
-
- # Rules (horizontal lines) look like
- #
- # --- (three or more hyphens)
- #
- # The more hyphens, the thicker the rule
- #
-
- if /^(---+)\s*$/ =~ active_line
- line.stamp :RULE, level, $1.length-2
- next
- end
-
- # Then look for list entries. First the ones that have to have
- # text following them (* xxx, - xxx, and dd. xxx)
-
- if SIMPLE_LIST_RE =~ active_line
- offset = margin + $1.length
- prefix = $2
- prefix_length = prefix.length
-
- flag = case prefix
- when "*","-" then :BULLET
- when /^\d/ then :NUMBER
- when /^[A-Z]/ then :UPPERALPHA
- when /^[a-z]/ then :LOWERALPHA
- else raise "Invalid List Type: #{self.inspect}"
- end
-
- line.stamp :LIST, level+1, prefix, flag
- text[margin, prefix_length] = " " * prefix_length
- assign_types_to_lines(offset, level + 1)
- next
- end
-
- if LABEL_LIST_RE =~ active_line
- offset = margin + $1.length
- prefix = $2
- prefix_length = prefix.length
-
- next if handled_labeled_list(line, level, margin, offset, prefix)
- end
-
- # Headings look like
- # = Main heading
- # == Second level
- # === Third
- #
- # Headings reset the level to 0
-
- if active_line[0] == ?= and active_line =~ /^(=+)\s*(.*)/
- prefix_length = $1.length
- prefix_length = 6 if prefix_length > 6
- line.stamp :HEADING, 0, prefix_length
- line.strip_leading(margin + prefix_length)
- next
- end
-
- # If the character's a space, then we have verbatim text,
- # otherwise
-
- if active_line[0] == SPACE
- line.strip_leading(margin) if margin > 0
- line.stamp :VERBATIM, level
- else
- line.stamp :PARAGRAPH, level
- end
- end
- end
-
- ##
- # Handle labeled list entries, We have a special case to deal with.
- # Because the labels can be long, they force the remaining block of text
- # over the to right:
- #
- # this is a long label that I wrote:: and here is the
- # block of text with
- # a silly margin
- #
- # So we allow the special case. If the label is followed by nothing, and
- # if the following line is indented, then we take the indent of that line
- # as the new margin.
- #
- # this is a long label that I wrote::
- # here is a more reasonably indented block which
- # will be attached to the label.
- #
-
- def handled_labeled_list(line, level, margin, offset, prefix)
- prefix_length = prefix.length
- text = line.text
- flag = nil
-
- case prefix
- when /^\[/ then
- flag = :LABELED
- prefix = prefix[1, prefix.length-2]
- when /:$/ then
- flag = :NOTE
- prefix.chop!
- else
- raise "Invalid List Type: #{self.inspect}"
- end
-
- # body is on the next line
- if text.length <= offset then
- original_line = line
- line = @lines.next
- return false unless line
- text = line.text
-
- for i in 0..margin
- if text[i] != SPACE
- @lines.unget
- return false
- end
- end
-
- i = margin
- i += 1 while text[i] == SPACE
-
- if i >= text.length then
- @lines.unget
- return false
- else
- offset = i
- prefix_length = 0
-
- if text[offset..-1] =~ SIMPLE_LIST_RE then
- @lines.unget
- line = original_line
- line.text = ''
- else
- @lines.delete original_line
- end
- end
- end
-
- line.stamp :LIST, level+1, prefix, flag
- text[margin, prefix_length] = " " * prefix_length
- assign_types_to_lines(offset, level + 1)
- return true
- end
-
- ##
- # Return a block consisting of fragments which are paragraphs, list
- # entries or verbatim text. We merge consecutive lines of the same type
- # and level together. We are also slightly tricky with lists: the lines
- # following a list introduction look like paragraph lines at the next
- # level, and we remap them into list entries instead.
-
- def group_lines
- @lines.rewind
-
- in_list = false
- wanted_type = wanted_level = nil
-
- block = LineCollection.new
- group = nil
-
- while line = @lines.next
- if line.level == wanted_level and line.type == wanted_type
- group.add_text(line.text)
- else
- group = block.fragment_for(line)
- block.add(group)
-
- if line.type == :LIST
- wanted_type = :PARAGRAPH
- else
- wanted_type = line.type
- end
-
- wanted_level = line.type == :HEADING ? line.param : line.level
- end
- end
-
- block.normalize
- block
- end
-
- ##
- # For debugging, we allow access to our line contents as text.
-
- def content
- @lines.as_text
- end
- public :content
-
- ##
- # For debugging, return the list of line types.
-
- def get_line_types
- @lines.line_types
- end
- public :get_line_types
-
-end
-
-require 'rdoc/markup/fragments'
-require 'rdoc/markup/inline'
-require 'rdoc/markup/lines'
diff --git a/lib/rdoc/markup/.document b/lib/rdoc/markup/.document
new file mode 100644
index 0000000000..3cf4f21bd7
--- /dev/null
+++ b/lib/rdoc/markup/.document
@@ -0,0 +1,2 @@
+simple_markup
+simple_markup.rb
diff --git a/lib/rdoc/markup/attribute_manager.rb b/lib/rdoc/markup/attribute_manager.rb
deleted file mode 100644
index d13b79376c..0000000000
--- a/lib/rdoc/markup/attribute_manager.rb
+++ /dev/null
@@ -1,265 +0,0 @@
-require 'rdoc/markup/inline'
-
-class RDoc::Markup::AttributeManager
-
- NULL = "\000".freeze
-
- ##
- # We work by substituting non-printing characters in to the text. For now
- # I'm assuming that I can substitute a character in the range 0..8 for a 7
- # bit character without damaging the encoded string, but this might be
- # optimistic
-
- A_PROTECT = 004
- PROTECT_ATTR = A_PROTECT.chr
-
- ##
- # This maps delimiters that occur around words (such as *bold* or +tt+)
- # where the start and end delimiters and the same. This lets us optimize
- # the regexp
-
- MATCHING_WORD_PAIRS = {}
-
- ##
- # And this is used when the delimiters aren't the same. In this case the
- # hash maps a pattern to the attribute character
-
- WORD_PAIR_MAP = {}
-
- ##
- # This maps HTML tags to the corresponding attribute char
-
- HTML_TAGS = {}
-
- ##
- # And this maps _special_ sequences to a name. A special sequence is
- # something like a WikiWord
-
- SPECIAL = {}
-
- ##
- # Return an attribute object with the given turn_on and turn_off bits set
-
- def attribute(turn_on, turn_off)
- RDoc::Markup::AttrChanger.new turn_on, turn_off
- end
-
- def change_attribute(current, new)
- diff = current ^ new
- attribute(new & diff, current & diff)
- end
-
- def changed_attribute_by_name(current_set, new_set)
- current = new = 0
- current_set.each do |name|
- current |= RDoc::Markup::Attribute.bitmap_for(name)
- end
-
- new_set.each do |name|
- new |= RDoc::Markup::Attribute.bitmap_for(name)
- end
-
- change_attribute(current, new)
- end
-
- def copy_string(start_pos, end_pos)
- res = @str[start_pos...end_pos]
- res.gsub!(/\000/, '')
- res
- end
-
- ##
- # Map attributes like <b>text</b>to the sequence
- # \001\002<char>\001\003<char>, where <char> is a per-attribute specific
- # character
-
- def convert_attrs(str, attrs)
- # first do matching ones
- tags = MATCHING_WORD_PAIRS.keys.join("")
-
- re = /(^|\W)([#{tags}])([#:\\]?[\w.\/-]+?\S?)\2(\W|$)/
-
- 1 while str.gsub!(re) do
- attr = MATCHING_WORD_PAIRS[$2]
- attrs.set_attrs($`.length + $1.length + $2.length, $3.length, attr)
- $1 + NULL * $2.length + $3 + NULL * $2.length + $4
- end
-
- # then non-matching
- unless WORD_PAIR_MAP.empty? then
- WORD_PAIR_MAP.each do |regexp, attr|
- str.gsub!(regexp) {
- attrs.set_attrs($`.length + $1.length, $2.length, attr)
- NULL * $1.length + $2 + NULL * $3.length
- }
- end
- end
- end
-
- def convert_html(str, attrs)
- tags = HTML_TAGS.keys.join '|'
-
- 1 while str.gsub!(/<(#{tags})>(.*?)<\/\1>/i) {
- attr = HTML_TAGS[$1.downcase]
- html_length = $1.length + 2
- seq = NULL * html_length
- attrs.set_attrs($`.length + html_length, $2.length, attr)
- seq + $2 + seq + NULL
- }
- end
-
- def convert_specials(str, attrs)
- unless SPECIAL.empty?
- SPECIAL.each do |regexp, attr|
- str.scan(regexp) do
- attrs.set_attrs($`.length, $&.length,
- attr | RDoc::Markup::Attribute::SPECIAL)
- end
- end
- end
- end
-
- ##
- # A \ in front of a character that would normally be processed turns off
- # processing. We do this by turning \< into <#{PROTECT}
-
- PROTECTABLE = %w[<\\]
-
- def mask_protected_sequences
- protect_pattern = Regexp.new("\\\\([#{Regexp.escape(PROTECTABLE.join(''))}])")
- @str.gsub!(protect_pattern, "\\1#{PROTECT_ATTR}")
- end
-
- def unmask_protected_sequences
- @str.gsub!(/(.)#{PROTECT_ATTR}/, "\\1\000")
- end
-
- def initialize
- add_word_pair("*", "*", :BOLD)
- add_word_pair("_", "_", :EM)
- add_word_pair("+", "+", :TT)
-
- add_html("em", :EM)
- add_html("i", :EM)
- add_html("b", :BOLD)
- add_html("tt", :TT)
- add_html("code", :TT)
- end
-
- def add_word_pair(start, stop, name)
- raise ArgumentError, "Word flags may not start with '<'" if
- start[0,1] == '<'
-
- bitmap = RDoc::Markup::Attribute.bitmap_for name
-
- if start == stop then
- MATCHING_WORD_PAIRS[start] = bitmap
- else
- pattern = /(#{Regexp.escape start})(\S+)(#{Regexp.escape stop})/
- WORD_PAIR_MAP[pattern] = bitmap
- end
-
- PROTECTABLE << start[0,1]
- PROTECTABLE.uniq!
- end
-
- def add_html(tag, name)
- HTML_TAGS[tag.downcase] = RDoc::Markup::Attribute.bitmap_for name
- end
-
- def add_special(pattern, name)
- SPECIAL[pattern] = RDoc::Markup::Attribute.bitmap_for name
- end
-
- def flow(str)
- @str = str
-
- mask_protected_sequences
-
- @attrs = RDoc::Markup::AttrSpan.new @str.length
-
- convert_attrs(@str, @attrs)
- convert_html(@str, @attrs)
- convert_specials(str, @attrs)
-
- unmask_protected_sequences
-
- return split_into_flow
- end
-
- def display_attributes
- puts
- puts @str.tr(NULL, "!")
- bit = 1
- 16.times do |bno|
- line = ""
- @str.length.times do |i|
- if (@attrs[i] & bit) == 0
- line << " "
- else
- if bno.zero?
- line << "S"
- else
- line << ("%d" % (bno+1))
- end
- end
- end
- puts(line) unless line =~ /^ *$/
- bit <<= 1
- end
- end
-
- def split_into_flow
- res = []
- current_attr = 0
- str = ""
-
- str_len = @str.length
-
- # skip leading invisible text
- i = 0
- i += 1 while i < str_len and @str[i].chr == "\0"
- start_pos = i
-
- # then scan the string, chunking it on attribute changes
- while i < str_len
- new_attr = @attrs[i]
- if new_attr != current_attr
- if i > start_pos
- res << copy_string(start_pos, i)
- start_pos = i
- end
-
- res << change_attribute(current_attr, new_attr)
- current_attr = new_attr
-
- if (current_attr & RDoc::Markup::Attribute::SPECIAL) != 0 then
- i += 1 while
- i < str_len and (@attrs[i] & RDoc::Markup::Attribute::SPECIAL) != 0
-
- res << RDoc::Markup::Special.new(current_attr,
- copy_string(start_pos, i))
- start_pos = i
- next
- end
- end
-
- # move on, skipping any invisible characters
- begin
- i += 1
- end while i < str_len and @str[i].chr == "\0"
- end
-
- # tidy up trailing text
- if start_pos < str_len
- res << copy_string(start_pos, str_len)
- end
-
- # and reset to all attributes off
- res << change_attribute(current_attr, 0) if current_attr != 0
-
- return res
- end
-
-end
-
diff --git a/lib/rdoc/markup/formatter.rb b/lib/rdoc/markup/formatter.rb
deleted file mode 100644
index 14cbae59f9..0000000000
--- a/lib/rdoc/markup/formatter.rb
+++ /dev/null
@@ -1,14 +0,0 @@
-require 'rdoc/markup'
-
-class RDoc::Markup::Formatter
-
- def initialize
- @markup = RDoc::Markup.new
- end
-
- def convert(content)
- @markup.convert content, self
- end
-
-end
-
diff --git a/lib/rdoc/markup/fragments.rb b/lib/rdoc/markup/fragments.rb
deleted file mode 100644
index 0031b809b4..0000000000
--- a/lib/rdoc/markup/fragments.rb
+++ /dev/null
@@ -1,337 +0,0 @@
-require 'rdoc/markup'
-require 'rdoc/markup/lines'
-
-class RDoc::Markup
-
- ##
- # A Fragment is a chunk of text, subclassed as a paragraph, a list
- # entry, or verbatim text.
-
- class Fragment
- attr_reader :level, :param, :txt
- attr_accessor :type
-
- ##
- # This is a simple factory system that lets us associate fragement
- # types (a string) with a subclass of fragment
-
- TYPE_MAP = {}
-
- def self.type_name(name)
- TYPE_MAP[name] = self
- end
-
- def self.for(line)
- klass = TYPE_MAP[line.type] ||
- raise("Unknown line type: '#{line.type.inspect}:' '#{line.text}'")
- return klass.new(line.level, line.param, line.flag, line.text)
- end
-
- def initialize(level, param, type, txt)
- @level = level
- @param = param
- @type = type
- @txt = ""
- add_text(txt) if txt
- end
-
- def add_text(txt)
- @txt << " " if @txt.length > 0
- @txt << txt.tr_s("\n ", " ").strip
- end
-
- def to_s
- "L#@level: #{self.class.name.split('::')[-1]}\n#@txt"
- end
-
- end
-
- ##
- # A paragraph is a fragment which gets wrapped to fit. We remove all
- # newlines when we're created, and have them put back on output.
-
- class Paragraph < Fragment
- type_name :PARAGRAPH
- end
-
- class BlankLine < Paragraph
- type_name :BLANK
- end
-
- class Heading < Paragraph
- type_name :HEADING
-
- def head_level
- @param.to_i
- end
- end
-
- ##
- # A List is a fragment with some kind of label
-
- class ListBase < Paragraph
- LIST_TYPES = [
- :BULLET,
- :NUMBER,
- :UPPERALPHA,
- :LOWERALPHA,
- :LABELED,
- :NOTE,
- ]
- end
-
- class ListItem < ListBase
- type_name :LIST
-
- def to_s
- text = if [:NOTE, :LABELED].include? type then
- "#{@param}: #{@txt}"
- else
- @txt
- end
-
- "L#@level: #{type} #{self.class.name.split('::')[-1]}\n#{text}"
- end
-
- end
-
- class ListStart < ListBase
- def initialize(level, param, type)
- super(level, param, type, nil)
- end
- end
-
- class ListEnd < ListBase
- def initialize(level, type)
- super(level, "", type, nil)
- end
- end
-
- ##
- # Verbatim code contains lines that don't get wrapped.
-
- class Verbatim < Fragment
- type_name :VERBATIM
-
- def add_text(txt)
- @txt << txt.chomp << "\n"
- end
-
- end
-
- ##
- # A horizontal rule
-
- class Rule < Fragment
- type_name :RULE
- end
-
- ##
- # Collect groups of lines together. Each group will end up containing a flow
- # of text.
-
- class LineCollection
-
- def initialize
- @fragments = []
- end
-
- def add(fragment)
- @fragments << fragment
- end
-
- def each(&b)
- @fragments.each(&b)
- end
-
- def to_a # :nodoc:
- @fragments.map {|fragment| fragment.to_s}
- end
-
- ##
- # Factory for different fragment types
-
- def fragment_for(*args)
- Fragment.for(*args)
- end
-
- ##
- # Tidy up at the end
-
- def normalize
- change_verbatim_blank_lines
- add_list_start_and_ends
- add_list_breaks
- tidy_blank_lines
- end
-
- def to_s
- @fragments.join("\n----\n")
- end
-
- def accept(am, visitor)
- visitor.start_accepting
-
- @fragments.each do |fragment|
- case fragment
- when Verbatim
- visitor.accept_verbatim(am, fragment)
- when Rule
- visitor.accept_rule(am, fragment)
- when ListStart
- visitor.accept_list_start(am, fragment)
- when ListEnd
- visitor.accept_list_end(am, fragment)
- when ListItem
- visitor.accept_list_item(am, fragment)
- when BlankLine
- visitor.accept_blank_line(am, fragment)
- when Heading
- visitor.accept_heading(am, fragment)
- when Paragraph
- visitor.accept_paragraph(am, fragment)
- end
- end
-
- visitor.end_accepting
- end
-
- private
-
- # If you have:
- #
- # normal paragraph text.
- #
- # this is code
- #
- # and more code
- #
- # You'll end up with the fragments Paragraph, BlankLine, Verbatim,
- # BlankLine, Verbatim, BlankLine, etc.
- #
- # The BlankLine in the middle of the verbatim chunk needs to be changed to
- # a real verbatim newline, and the two verbatim blocks merged
-
- def change_verbatim_blank_lines
- frag_block = nil
- blank_count = 0
- @fragments.each_with_index do |frag, i|
- if frag_block.nil?
- frag_block = frag if Verbatim === frag
- else
- case frag
- when Verbatim
- blank_count.times { frag_block.add_text("\n") }
- blank_count = 0
- frag_block.add_text(frag.txt)
- @fragments[i] = nil # remove out current fragment
- when BlankLine
- if frag_block
- blank_count += 1
- @fragments[i] = nil
- end
- else
- frag_block = nil
- blank_count = 0
- end
- end
- end
- @fragments.compact!
- end
-
- ##
- # List nesting is implicit given the level of indentation. Make it
- # explicit, just to make life a tad easier for the output processors
-
- def add_list_start_and_ends
- level = 0
- res = []
- type_stack = []
-
- @fragments.each do |fragment|
- # $stderr.puts "#{level} : #{fragment.class.name} : #{fragment.level}"
- new_level = fragment.level
- while (level < new_level)
- level += 1
- type = fragment.type
- res << ListStart.new(level, fragment.param, type) if type
- type_stack.push type
- # $stderr.puts "Start: #{level}"
- end
-
- while level > new_level
- type = type_stack.pop
- res << ListEnd.new(level, type) if type
- level -= 1
- # $stderr.puts "End: #{level}, #{type}"
- end
-
- res << fragment
- level = fragment.level
- end
- level.downto(1) do |i|
- type = type_stack.pop
- res << ListEnd.new(i, type) if type
- end
-
- @fragments = res
- end
-
- ##
- # Inserts start/ends between list entries at the same level that have
- # different element types
-
- def add_list_breaks
- res = @fragments
-
- @fragments = []
- list_stack = []
-
- res.each do |fragment|
- case fragment
- when ListStart
- list_stack.push fragment
- when ListEnd
- start = list_stack.pop
- fragment.type = start.type
- when ListItem
- l = list_stack.last
- if fragment.type != l.type
- @fragments << ListEnd.new(l.level, l.type)
- start = ListStart.new(l.level, fragment.param, fragment.type)
- @fragments << start
- list_stack.pop
- list_stack.push start
- end
- else
- ;
- end
- @fragments << fragment
- end
- end
-
- ##
- # Tidy up the blank lines:
- # * change Blank/ListEnd into ListEnd/Blank
- # * remove blank lines at the front
-
- def tidy_blank_lines
- (@fragments.size - 1).times do |i|
- if BlankLine === @fragments[i] and ListEnd === @fragments[i+1] then
- @fragments[i], @fragments[i+1] = @fragments[i+1], @fragments[i]
- end
- end
-
- # remove leading blanks
- @fragments.each_with_index do |f, i|
- break unless f.kind_of? BlankLine
- @fragments[i] = nil
- end
-
- @fragments.compact!
- end
-
- end
-
-end
-
diff --git a/lib/rdoc/markup/inline.rb b/lib/rdoc/markup/inline.rb
deleted file mode 100644
index 46c9b5822c..0000000000
--- a/lib/rdoc/markup/inline.rb
+++ /dev/null
@@ -1,101 +0,0 @@
-require 'rdoc/markup'
-
-class RDoc::Markup
-
- ##
- # We manage a set of attributes. Each attribute has a symbol name and a bit
- # value.
-
- class Attribute
- SPECIAL = 1
-
- @@name_to_bitmap = { :_SPECIAL_ => SPECIAL }
- @@next_bitmap = 2
-
- def self.bitmap_for(name)
- bitmap = @@name_to_bitmap[name]
- unless bitmap then
- bitmap = @@next_bitmap
- @@next_bitmap <<= 1
- @@name_to_bitmap[name] = bitmap
- end
- bitmap
- end
-
- def self.as_string(bitmap)
- return "none" if bitmap.zero?
- res = []
- @@name_to_bitmap.each do |name, bit|
- res << name if (bitmap & bit) != 0
- end
- res.join(",")
- end
-
- def self.each_name_of(bitmap)
- @@name_to_bitmap.each do |name, bit|
- next if bit == SPECIAL
- yield name.to_s if (bitmap & bit) != 0
- end
- end
- end
-
- AttrChanger = Struct.new(:turn_on, :turn_off)
-
- ##
- # An AttrChanger records a change in attributes. It contains a bitmap of the
- # attributes to turn on, and a bitmap of those to turn off.
-
- class AttrChanger
- def to_s
- "Attr: +#{Attribute.as_string(turn_on)}/-#{Attribute.as_string(turn_on)}"
- end
- end
-
- ##
- # An array of attributes which parallels the characters in a string.
-
- class AttrSpan
- def initialize(length)
- @attrs = Array.new(length, 0)
- end
-
- def set_attrs(start, length, bits)
- for i in start ... (start+length)
- @attrs[i] |= bits
- end
- end
-
- def [](n)
- @attrs[n]
- end
- end
-
- ##
- # Hold details of a special sequence
-
- class Special
- attr_reader :type
- attr_accessor :text
-
- def initialize(type, text)
- @type, @text = type, text
- end
-
- def ==(o)
- self.text == o.text && self.type == o.type
- end
-
- def inspect
- "#<RDoc::Markup::Special:0x%x @type=%p, name=%p @text=%p>" % [
- object_id, @type, RDoc::Markup::Attribute.as_string(type), text.dump]
- end
-
- def to_s
- "Special: type=#{type}, name=#{RDoc::Markup::Attribute.as_string type}, text=#{text.dump}"
- end
-
- end
-
-end
-
-require 'rdoc/markup/attribute_manager'
diff --git a/lib/rdoc/markup/lines.rb b/lib/rdoc/markup/lines.rb
deleted file mode 100644
index 069492122f..0000000000
--- a/lib/rdoc/markup/lines.rb
+++ /dev/null
@@ -1,152 +0,0 @@
-class RDoc::Markup
-
- ##
- # We store the lines we're working on as objects of class Line. These
- # contain the text of the line, along with a flag indicating the line type,
- # and an indentation level.
-
- class Line
- INFINITY = 9999
-
- LINE_TYPES = [
- :BLANK,
- :HEADING,
- :LIST,
- :PARAGRAPH,
- :RULE,
- :VERBATIM,
- ]
-
- # line type
- attr_accessor :type
-
- # The indentation nesting level
- attr_accessor :level
-
- # The contents
- attr_accessor :text
-
- # A prefix or parameter. For LIST lines, this is
- # the text that introduced the list item (the label)
- attr_accessor :param
-
- # A flag. For list lines, this is the type of the list
- attr_accessor :flag
-
- # the number of leading spaces
- attr_accessor :leading_spaces
-
- # true if this line has been deleted from the list of lines
- attr_accessor :deleted
-
- def initialize(text)
- @text = text.dup
- @deleted = false
-
- # expand tabs
- 1 while @text.gsub!(/\t+/) { ' ' * (8*$&.length - $`.length % 8)} && $~ #`
-
- # Strip trailing whitespace
- @text.sub!(/\s+$/, '')
-
- # and look for leading whitespace
- if @text.length > 0
- @text =~ /^(\s*)/
- @leading_spaces = $1.length
- else
- @leading_spaces = INFINITY
- end
- end
-
- # Return true if this line is blank
- def blank?
- @text.empty?
- end
-
- # stamp a line with a type, a level, a prefix, and a flag
- def stamp(type, level, param="", flag=nil)
- @type, @level, @param, @flag = type, level, param, flag
- end
-
- ##
- # Strip off the leading margin
-
- def strip_leading(size)
- if @text.size > size
- @text[0,size] = ""
- else
- @text = ""
- end
- end
-
- def to_s
- "#@type#@level: #@text"
- end
- end
-
- ##
- # A container for all the lines.
-
- class Lines
-
- include Enumerable
-
- attr_reader :lines # :nodoc:
-
- def initialize(lines)
- @lines = lines
- rewind
- end
-
- def empty?
- @lines.size.zero?
- end
-
- def each
- @lines.each do |line|
- yield line unless line.deleted
- end
- end
-
-# def [](index)
-# @lines[index]
-# end
-
- def rewind
- @nextline = 0
- end
-
- def next
- begin
- res = @lines[@nextline]
- @nextline += 1 if @nextline < @lines.size
- end while res and res.deleted and @nextline < @lines.size
- res
- end
-
- def unget
- @nextline -= 1
- end
-
- def delete(a_line)
- a_line.deleted = true
- end
-
- def normalize
- margin = @lines.collect{|l| l.leading_spaces}.min
- margin = 0 if margin == :INFINITY
- @lines.each {|line| line.strip_leading(margin) } if margin > 0
- end
-
- def as_text
- @lines.map {|l| l.text}.join("\n")
- end
-
- def line_types
- @lines.map {|l| l.type }
- end
-
- end
-
-end
-
diff --git a/lib/rdoc/markup/preprocess.rb b/lib/rdoc/markup/preprocess.rb
deleted file mode 100644
index 00dd4be4ad..0000000000
--- a/lib/rdoc/markup/preprocess.rb
+++ /dev/null
@@ -1,75 +0,0 @@
-require 'rdoc/markup'
-
-##
-# Handle common directives that can occur in a block of text:
-#
-# : include : filename
-
-class RDoc::Markup::PreProcess
-
- def initialize(input_file_name, include_path)
- @input_file_name = input_file_name
- @include_path = include_path
- end
-
- ##
- # Look for common options in a chunk of text. Options that we don't handle
- # are yielded to the caller.
-
- def handle(text)
- text.gsub!(/^([ \t]*#?[ \t]*):(\w+):([ \t]*)(.+)?\n/) do
- next $& if $3.empty? and $4 and $4[0, 1] == ':'
-
- prefix = $1
- directive = $2.downcase
- param = $4
-
- case directive
- when 'include' then
- filename = param.split[0]
- include_file filename, prefix
-
- else
- result = yield directive, param
- result = "#{prefix}:#{directive}: #{param}\n" unless result
- result
- end
- end
- end
-
- private
-
- ##
- # Include a file, indenting it correctly.
-
- def include_file(name, indent)
- if full_name = find_include_file(name) then
- content = File.open(full_name) {|f| f.read}
- # strip leading '#'s, but only if all lines start with them
- if content =~ /^[^#]/
- content.gsub(/^/, indent)
- else
- content.gsub(/^#?/, indent)
- end
- else
- $stderr.puts "Couldn't find file to include: '#{name}'"
- ''
- end
- end
-
- ##
- # Look for the given file in the directory containing the current file,
- # and then in each of the directories specified in the RDOC_INCLUDE path
-
- def find_include_file(name)
- to_search = [ File.dirname(@input_file_name) ].concat @include_path
- to_search.each do |dir|
- full_name = File.join(dir, name)
- stat = File.stat(full_name) rescue next
- return full_name if stat.readable?
- end
- nil
- end
-
-end
-
diff --git a/lib/rdoc/markup/sample/rdoc2latex.rb b/lib/rdoc/markup/sample/rdoc2latex.rb
new file mode 100644
index 0000000000..26563b75da
--- /dev/null
+++ b/lib/rdoc/markup/sample/rdoc2latex.rb
@@ -0,0 +1,16 @@
+#!/usr/local/bin/ruby
+# Illustration of a script to convert an RDoc-style file to a LaTeX
+# document
+
+require 'rdoc/markup/simple_markup'
+require 'rdoc/markup/simple_markup/to_latex'
+
+p = SM::SimpleMarkup.new
+h = SM::ToLaTeX.new
+
+#puts "\\documentclass{report}"
+#puts "\\usepackage{tabularx}"
+#puts "\\usepackage{parskip}"
+#puts "\\begin{document}"
+puts p.convert(ARGF.read, h)
+#puts "\\end{document}"
diff --git a/lib/rdoc/markup/sample/sample.rb b/lib/rdoc/markup/sample/sample.rb
new file mode 100644
index 0000000000..a375b54564
--- /dev/null
+++ b/lib/rdoc/markup/sample/sample.rb
@@ -0,0 +1,42 @@
+# This program illustrates the basic use of the SimpleMarkup
+# class. It extracts the first comment block from the
+# simple_markup.rb file and converts it into HTML on
+# standard output. Run it using
+#
+# % ruby sample.rb
+#
+# You should be in the sample/ directory when you do this,
+# as it hardwires the path to the files it needs to require.
+# This isn't necessary in the code you write once you've
+# installed the package.
+#
+# For a better way of formatting code comment blocks (and more)
+# see the rdoc package.
+#
+
+$:.unshift "../../.."
+
+require 'rdoc/markup/simple_markup'
+require 'rdoc/markup/simple_markup/to_html'
+
+# Extract the comment block from the source file
+
+input_string = ""
+
+File.foreach("../simple_markup.rb") do |line|
+ break unless line.gsub!(/^\# ?/, '')
+ input_string << line
+end
+
+# Create a markup object
+markup = SM::SimpleMarkup.new
+
+# Attach it to an HTML formatter
+h = SM::ToHtml.new
+
+# And convert out comment block to html. Wrap it a body
+# tag pair to let browsers view it
+
+puts "<html><body>"
+puts markup.convert(input_string, h)
+puts "</body></html>"
diff --git a/lib/rdoc/markup/simple_markup.rb b/lib/rdoc/markup/simple_markup.rb
new file mode 100644
index 0000000000..8193ca02d4
--- /dev/null
+++ b/lib/rdoc/markup/simple_markup.rb
@@ -0,0 +1,476 @@
+# = Introduction
+#
+# SimpleMarkup parses plain text documents and attempts to decompose
+# them into their constituent parts. Some of these parts are high-level:
+# paragraphs, chunks of verbatim text, list entries and the like. Other
+# parts happen at the character level: a piece of bold text, a word in
+# code font. This markup is similar in spirit to that used on WikiWiki
+# webs, where folks create web pages using a simple set of formatting
+# rules.
+#
+# SimpleMarkup itself does no output formatting: this is left to a
+# different set of classes.
+#
+# SimpleMarkup is extendable at runtime: you can add new markup
+# elements to be recognised in the documents that SimpleMarkup parses.
+#
+# SimpleMarkup is intended to be the basis for a family of tools which
+# share the common requirement that simple, plain-text should be
+# rendered in a variety of different output formats and media. It is
+# envisaged that SimpleMarkup could be the basis for formating RDoc
+# style comment blocks, Wiki entries, and online FAQs.
+#
+# = Basic Formatting
+#
+# * SimpleMarkup looks for a document's natural left margin. This is
+# used as the initial margin for the document.
+#
+# * Consecutive lines starting at this margin are considered to be a
+# paragraph.
+#
+# * If a paragraph starts with a "*", "-", or with "<digit>.", then it is
+# taken to be the start of a list. The margin in increased to be the
+# first non-space following the list start flag. Subsequent lines
+# should be indented to this new margin until the list ends. For
+# example:
+#
+# * this is a list with three paragraphs in
+# the first item. This is the first paragraph.
+#
+# And this is the second paragraph.
+#
+# 1. This is an indented, numbered list.
+# 2. This is the second item in that list
+#
+# This is the third conventional paragraph in the
+# first list item.
+#
+# * This is the second item in the original list
+#
+# * You can also construct labeled lists, sometimes called description
+# or definition lists. Do this by putting the label in square brackets
+# and indenting the list body:
+#
+# [cat] a small furry mammal
+# that seems to sleep a lot
+#
+# [ant] a little insect that is known
+# to enjoy picnics
+#
+# A minor variation on labeled lists uses two colons to separate the
+# label from the list body:
+#
+# cat:: a small furry mammal
+# that seems to sleep a lot
+#
+# ant:: a little insect that is known
+# to enjoy picnics
+#
+# This latter style guarantees that the list bodies' left margins are
+# aligned: think of them as a two column table.
+#
+# * Any line that starts to the right of the current margin is treated
+# as verbatim text. This is useful for code listings. The example of a
+# list above is also verbatim text.
+#
+# * A line starting with an equals sign (=) is treated as a
+# heading. Level one headings have one equals sign, level two headings
+# have two,and so on.
+#
+# * A line starting with three or more hyphens (at the current indent)
+# generates a horizontal rule. THe more hyphens, the thicker the rule
+# (within reason, and if supported by the output device)
+#
+# * You can use markup within text (except verbatim) to change the
+# appearance of parts of that text. Out of the box, SimpleMarkup
+# supports word-based and general markup.
+#
+# Word-based markup uses flag characters around individual words:
+#
+# [\*word*] displays word in a *bold* font
+# [\_word_] displays word in an _emphasized_ font
+# [\+word+] displays word in a +code+ font
+#
+# General markup affects text between a start delimiter and and end
+# delimiter. Not surprisingly, these delimiters look like HTML markup.
+#
+# [\<b>text...</b>] displays word in a *bold* font
+# [\<em>text...</em>] displays word in an _emphasized_ font
+# [\<i>text...</i>] displays word in an _emphasized_ font
+# [\<tt>text...</tt>] displays word in a +code+ font
+#
+# Unlike conventional Wiki markup, general markup can cross line
+# boundaries. You can turn off the interpretation of markup by
+# preceding the first character with a backslash, so \\\<b>bold
+# text</b> and \\\*bold* produce \<b>bold text</b> and \*bold
+# respectively.
+#
+# = Using SimpleMarkup
+#
+# For information on using SimpleMarkup programatically,
+# see SM::SimpleMarkup.
+#
+# Author:: Dave Thomas, dave@pragmaticprogrammer.com
+# Version:: 0.0
+# License:: Ruby license
+
+
+
+require 'rdoc/markup/simple_markup/fragments'
+require 'rdoc/markup/simple_markup/lines.rb'
+
+module SM #:nodoc:
+
+ # == Synopsis
+ #
+ # This code converts <tt>input_string</tt>, which is in the format
+ # described in markup/simple_markup.rb, to HTML. The conversion
+ # takes place in the +convert+ method, so you can use the same
+ # SimpleMarkup object to convert multiple input strings.
+ #
+ # require 'rdoc/markup/simple_markup'
+ # require 'rdoc/markup/simple_markup/to_html'
+ #
+ # p = SM::SimpleMarkup.new
+ # h = SM::ToHtml.new
+ #
+ # puts p.convert(input_string, h)
+ #
+ # You can extend the SimpleMarkup parser to recognise new markup
+ # sequences, and to add special processing for text that matches a
+ # regular epxression. Here we make WikiWords significant to the parser,
+ # and also make the sequences {word} and \<no>text...</no> signify
+ # strike-through text. When then subclass the HTML output class to deal
+ # with these:
+ #
+ # require 'rdoc/markup/simple_markup'
+ # require 'rdoc/markup/simple_markup/to_html'
+ #
+ # class WikiHtml < SM::ToHtml
+ # def handle_special_WIKIWORD(special)
+ # "<font color=red>" + special.text + "</font>"
+ # end
+ # end
+ #
+ # p = SM::SimpleMarkup.new
+ # p.add_word_pair("{", "}", :STRIKE)
+ # p.add_html("no", :STRIKE)
+ #
+ # p.add_special(/\b([A-Z][a-z]+[A-Z]\w+)/, :WIKIWORD)
+ #
+ # h = WikiHtml.new
+ # h.add_tag(:STRIKE, "<strike>", "</strike>")
+ #
+ # puts "<body>" + p.convert(ARGF.read, h) + "</body>"
+ #
+ # == Output Formatters
+ #
+ # _missing_
+ #
+ #
+
+ class SimpleMarkup
+
+ SPACE = ?\s
+
+ # List entries look like:
+ # * text
+ # 1. text
+ # [label] text
+ # label:: text
+ #
+ # Flag it as a list entry, and
+ # work out the indent for subsequent lines
+
+ SIMPLE_LIST_RE = /^(
+ ( \* (?# bullet)
+ |- (?# bullet)
+ |\d+\. (?# numbered )
+ |[A-Za-z]\. (?# alphabetically numbered )
+ )
+ \s+
+ )\S/x
+
+ LABEL_LIST_RE = /^(
+ ( \[.*?\] (?# labeled )
+ |\S.*:: (?# note )
+ )(?:\s+|$)
+ )/x
+
+
+ ##
+ # take a block of text and use various heuristics to determine
+ # it's structure (paragraphs, lists, and so on). Invoke an
+ # event handler as we identify significant chunks.
+ #
+
+ def initialize
+ @am = AttributeManager.new
+ @output = nil
+ end
+
+ ##
+ # Add to the sequences used to add formatting to an individual word
+ # (such as *bold*). Matching entries will generate attibutes
+ # that the output formatters can recognize by their +name+
+
+ def add_word_pair(start, stop, name)
+ @am.add_word_pair(start, stop, name)
+ end
+
+ ##
+ # Add to the sequences recognized as general markup
+ #
+
+ def add_html(tag, name)
+ @am.add_html(tag, name)
+ end
+
+ ##
+ # Add to other inline sequences. For example, we could add
+ # WikiWords using something like:
+ #
+ # parser.add_special(/\b([A-Z][a-z]+[A-Z]\w+)/, :WIKIWORD)
+ #
+ # Each wiki word will be presented to the output formatter
+ # via the accept_special method
+ #
+
+ def add_special(pattern, name)
+ @am.add_special(pattern, name)
+ end
+
+
+ # We take a string, split it into lines, work out the type of
+ # each line, and from there deduce groups of lines (for example
+ # all lines in a paragraph). We then invoke the output formatter
+ # using a Visitor to display the result
+
+ def convert(str, op)
+ @lines = Lines.new(str.split(/\r?\n/).collect { |aLine|
+ Line.new(aLine) })
+ return "" if @lines.empty?
+ @lines.normalize
+ assign_types_to_lines
+ group = group_lines
+ # call the output formatter to handle the result
+ # group.to_a.each {|i| p i}
+ group.accept(@am, op)
+ end
+
+
+ #######
+ private
+ #######
+
+
+ ##
+ # Look through the text at line indentation. We flag each line as being
+ # Blank, a paragraph, a list element, or verbatim text
+ #
+
+ def assign_types_to_lines(margin = 0, level = 0)
+
+ while line = @lines.next
+ if line.isBlank?
+ line.stamp(Line::BLANK, level)
+ next
+ end
+
+ # if a line contains non-blanks before the margin, then it must belong
+ # to an outer level
+
+ text = line.text
+
+ for i in 0...margin
+ if text[i] != SPACE
+ @lines.unget
+ return
+ end
+ end
+
+ active_line = text[margin..-1]
+
+ # Rules (horizontal lines) look like
+ #
+ # --- (three or more hyphens)
+ #
+ # The more hyphens, the thicker the rule
+ #
+
+ if /^(---+)\s*$/ =~ active_line
+ line.stamp(Line::RULE, level, $1.length-2)
+ next
+ end
+
+ # Then look for list entries. First the ones that have to have
+ # text following them (* xxx, - xxx, and dd. xxx)
+
+ if SIMPLE_LIST_RE =~ active_line
+
+ offset = margin + $1.length
+ prefix = $2
+ prefix_length = prefix.length
+
+ flag = case prefix
+ when "*","-" then ListBase::BULLET
+ when /^\d/ then ListBase::NUMBER
+ when /^[A-Z]/ then ListBase::UPPERALPHA
+ when /^[a-z]/ then ListBase::LOWERALPHA
+ else raise "Invalid List Type: #{self.inspect}"
+ end
+
+ line.stamp(Line::LIST, level+1, prefix, flag)
+ text[margin, prefix_length] = " " * prefix_length
+ assign_types_to_lines(offset, level + 1)
+ next
+ end
+
+
+ if LABEL_LIST_RE =~ active_line
+ offset = margin + $1.length
+ prefix = $2
+ prefix_length = prefix.length
+
+ next if handled_labeled_list(line, level, margin, offset, prefix)
+ end
+
+ # Headings look like
+ # = Main heading
+ # == Second level
+ # === Third
+ #
+ # Headings reset the level to 0
+
+ if active_line[0] == ?= and active_line =~ /^(=+)\s*(.*)/
+ prefix_length = $1.length
+ prefix_length = 6 if prefix_length > 6
+ line.stamp(Line::HEADING, 0, prefix_length)
+ line.strip_leading(margin + prefix_length)
+ next
+ end
+
+ # If the character's a space, then we have verbatim text,
+ # otherwise
+
+ if active_line[0] == SPACE
+ line.strip_leading(margin) if margin > 0
+ line.stamp(Line::VERBATIM, level)
+ else
+ line.stamp(Line::PARAGRAPH, level)
+ end
+ end
+ end
+
+ # Handle labeled list entries, We have a special case
+ # to deal with. Because the labels can be long, they force
+ # the remaining block of text over the to right:
+ #
+ # this is a long label that I wrote:: and here is the
+ # block of text with
+ # a silly margin
+ #
+ # So we allow the special case. If the label is followed
+ # by nothing, and if the following line is indented, then
+ # we take the indent of that line as the new margin
+ #
+ # this is a long label that I wrote::
+ # here is a more reasonably indented block which
+ # will ab attached to the label.
+ #
+
+ def handled_labeled_list(line, level, margin, offset, prefix)
+ prefix_length = prefix.length
+ text = line.text
+ flag = nil
+ case prefix
+ when /^\[/
+ flag = ListBase::LABELED
+ prefix = prefix[1, prefix.length-2]
+ when /:$/
+ flag = ListBase::NOTE
+ prefix.chop!
+ else raise "Invalid List Type: #{self.inspect}"
+ end
+
+ # body is on the next line
+
+ if text.length <= offset
+ original_line = line
+ line = @lines.next
+ return(false) unless line
+ text = line.text
+
+ for i in 0..margin
+ if text[i] != SPACE
+ @lines.unget
+ return false
+ end
+ end
+ i = margin
+ i += 1 while text[i] == SPACE
+ if i >= text.length
+ @lines.unget
+ return false
+ else
+ offset = i
+ prefix_length = 0
+ @lines.delete(original_line)
+ end
+ end
+
+ line.stamp(Line::LIST, level+1, prefix, flag)
+ text[margin, prefix_length] = " " * prefix_length
+ assign_types_to_lines(offset, level + 1)
+ return true
+ end
+
+ # Return a block consisting of fragments which are
+ # paragraphs, list entries or verbatim text. We merge consecutive
+ # lines of the same type and level together. We are also slightly
+ # tricky with lists: the lines following a list introduction
+ # look like paragraph lines at the next level, and we remap them
+ # into list entries instead
+
+ def group_lines
+ @lines.rewind
+
+ inList = false
+ wantedType = wantedLevel = nil
+
+ block = LineCollection.new
+ group = nil
+
+ while line = @lines.next
+ if line.level == wantedLevel and line.type == wantedType
+ group.add_text(line.text)
+ else
+ group = block.fragment_for(line)
+ block.add(group)
+ if line.type == Line::LIST
+ wantedType = Line::PARAGRAPH
+ else
+ wantedType = line.type
+ end
+ wantedLevel = line.type == Line::HEADING ? line.param : line.level
+ end
+ end
+
+ block.normalize
+ block
+ end
+
+ ## for debugging, we allow access to our line contents as text
+ def content
+ @lines.as_text
+ end
+ public :content
+
+ ## for debugging, return the list of line types
+ def get_line_types
+ @lines.line_types
+ end
+ public :get_line_types
+ end
+
+end
diff --git a/lib/rdoc/markup/simple_markup/fragments.rb b/lib/rdoc/markup/simple_markup/fragments.rb
new file mode 100644
index 0000000000..6ca06382ab
--- /dev/null
+++ b/lib/rdoc/markup/simple_markup/fragments.rb
@@ -0,0 +1,328 @@
+require 'rdoc/markup/simple_markup/lines.rb'
+#require 'rdoc/markup/simple_markup/to_flow.rb'
+
+module SM
+
+ ##
+ # A Fragment is a chunk of text, subclassed as a paragraph, a list
+ # entry, or verbatim text
+
+ class Fragment
+ attr_reader :level, :param, :txt
+ attr_accessor :type
+
+ def initialize(level, param, type, txt)
+ @level = level
+ @param = param
+ @type = type
+ @txt = ""
+ add_text(txt) if txt
+ end
+
+ def add_text(txt)
+ @txt << " " if @txt.length > 0
+ @txt << txt.tr_s("\n ", " ").strip
+ end
+
+ def to_s
+ "L#@level: #{self.class.name.split('::')[-1]}\n#@txt"
+ end
+
+ ######
+ # This is a simple factory system that lets us associate fragement
+ # types (a string) with a subclass of fragment
+
+ TYPE_MAP = {}
+
+ def Fragment.type_name(name)
+ TYPE_MAP[name] = self
+ end
+
+ def Fragment.for(line)
+ klass = TYPE_MAP[line.type] ||
+ raise("Unknown line type: '#{line.type.inspect}:' '#{line.text}'")
+ return klass.new(line.level, line.param, line.flag, line.text)
+ end
+ end
+
+ ##
+ # A paragraph is a fragment which gets wrapped to fit. We remove all
+ # newlines when we're created, and have them put back on output
+
+ class Paragraph < Fragment
+ type_name Line::PARAGRAPH
+ end
+
+ class BlankLine < Paragraph
+ type_name Line::BLANK
+ end
+
+ class Heading < Paragraph
+ type_name Line::HEADING
+
+ def head_level
+ @param.to_i
+ end
+ end
+
+ ##
+ # A List is a fragment with some kind of label
+ #
+
+ class ListBase < Paragraph
+ # List types
+ BULLET = :BULLET
+ NUMBER = :NUMBER
+ UPPERALPHA = :UPPERALPHA
+ LOWERALPHA = :LOWERALPHA
+ LABELED = :LABELED
+ NOTE = :NOTE
+ end
+
+ class ListItem < ListBase
+ type_name Line::LIST
+
+ # def label
+ # am = AttributeManager.new(@param)
+ # am.flow
+ # end
+ end
+
+ class ListStart < ListBase
+ def initialize(level, param, type)
+ super(level, param, type, nil)
+ end
+ end
+
+ class ListEnd < ListBase
+ def initialize(level, type)
+ super(level, "", type, nil)
+ end
+ end
+
+ ##
+ # Verbatim code contains lines that don't get wrapped.
+
+ class Verbatim < Fragment
+ type_name Line::VERBATIM
+
+ def add_text(txt)
+ @txt << txt.chomp << "\n"
+ end
+
+ end
+
+ ##
+ # A horizontal rule
+ class Rule < Fragment
+ type_name Line::RULE
+ end
+
+
+ # Collect groups of lines together. Each group
+ # will end up containing a flow of text
+
+ class LineCollection
+
+ def initialize
+ @fragments = []
+ end
+
+ def add(fragment)
+ @fragments << fragment
+ end
+
+ def each(&b)
+ @fragments.each(&b)
+ end
+
+ # For testing
+ def to_a
+ @fragments.map {|fragment| fragment.to_s}
+ end
+
+ # Factory for different fragment types
+ def fragment_for(*args)
+ Fragment.for(*args)
+ end
+
+ # tidy up at the end
+ def normalize
+ change_verbatim_blank_lines
+ add_list_start_and_ends
+ add_list_breaks
+ tidy_blank_lines
+ end
+
+ def to_s
+ @fragments.join("\n----\n")
+ end
+
+ def accept(am, visitor)
+
+ visitor.start_accepting
+
+ @fragments.each do |fragment|
+ case fragment
+ when Verbatim
+ visitor.accept_verbatim(am, fragment)
+ when Rule
+ visitor.accept_rule(am, fragment)
+ when ListStart
+ visitor.accept_list_start(am, fragment)
+ when ListEnd
+ visitor.accept_list_end(am, fragment)
+ when ListItem
+ visitor.accept_list_item(am, fragment)
+ when BlankLine
+ visitor.accept_blank_line(am, fragment)
+ when Heading
+ visitor.accept_heading(am, fragment)
+ when Paragraph
+ visitor.accept_paragraph(am, fragment)
+ end
+ end
+
+ visitor.end_accepting
+ end
+ #######
+ private
+ #######
+
+ # If you have:
+ #
+ # normal paragraph text.
+ #
+ # this is code
+ #
+ # and more code
+ #
+ # You'll end up with the fragments Paragraph, BlankLine,
+ # Verbatim, BlankLine, Verbatim, BlankLine, etc
+ #
+ # The BlankLine in the middle of the verbatim chunk needs to
+ # be changed to a real verbatim newline, and the two
+ # verbatim blocks merged
+ #
+ #
+ def change_verbatim_blank_lines
+ frag_block = nil
+ blank_count = 0
+ @fragments.each_with_index do |frag, i|
+ if frag_block.nil?
+ frag_block = frag if Verbatim === frag
+ else
+ case frag
+ when Verbatim
+ blank_count.times { frag_block.add_text("\n") }
+ blank_count = 0
+ frag_block.add_text(frag.txt)
+ @fragments[i] = nil # remove out current fragment
+ when BlankLine
+ if frag_block
+ blank_count += 1
+ @fragments[i] = nil
+ end
+ else
+ frag_block = nil
+ blank_count = 0
+ end
+ end
+ end
+ @fragments.compact!
+ end
+
+ # List nesting is implicit given the level of
+ # Make it explicit, just to make life a tad
+ # easier for the output processors
+
+ def add_list_start_and_ends
+ level = 0
+ res = []
+ type_stack = []
+
+ @fragments.each do |fragment|
+ # $stderr.puts "#{level} : #{fragment.class.name} : #{fragment.level}"
+ new_level = fragment.level
+ while (level < new_level)
+ level += 1
+ type = fragment.type
+ res << ListStart.new(level, fragment.param, type) if type
+ type_stack.push type
+ # $stderr.puts "Start: #{level}"
+ end
+
+ while level > new_level
+ type = type_stack.pop
+ res << ListEnd.new(level, type) if type
+ level -= 1
+ # $stderr.puts "End: #{level}, #{type}"
+ end
+
+ res << fragment
+ level = fragment.level
+ end
+ level.downto(1) do |i|
+ type = type_stack.pop
+ res << ListEnd.new(i, type) if type
+ end
+
+ @fragments = res
+ end
+
+ # now insert start/ends between list entries at the
+ # same level that have different element types
+
+ def add_list_breaks
+ res = @fragments
+
+ @fragments = []
+ list_stack = []
+
+ res.each do |fragment|
+ case fragment
+ when ListStart
+ list_stack.push fragment
+ when ListEnd
+ start = list_stack.pop
+ fragment.type = start.type
+ when ListItem
+ l = list_stack.last
+ if fragment.type != l.type
+ @fragments << ListEnd.new(l.level, l.type)
+ start = ListStart.new(l.level, fragment.param, fragment.type)
+ @fragments << start
+ list_stack.pop
+ list_stack.push start
+ end
+ else
+ ;
+ end
+ @fragments << fragment
+ end
+ end
+
+ # Finally tidy up the blank lines:
+ # * change Blank/ListEnd into ListEnd/Blank
+ # * remove blank lines at the front
+
+ def tidy_blank_lines
+ (@fragments.size - 1).times do |i|
+ if @fragments[i].kind_of?(BlankLine) and
+ @fragments[i+1].kind_of?(ListEnd)
+ @fragments[i], @fragments[i+1] = @fragments[i+1], @fragments[i]
+ end
+ end
+
+ # remove leading blanks
+ @fragments.each_with_index do |f, i|
+ break unless f.kind_of? BlankLine
+ @fragments[i] = nil
+ end
+
+ @fragments.compact!
+ end
+
+ end
+
+end
diff --git a/lib/rdoc/markup/simple_markup/inline.rb b/lib/rdoc/markup/simple_markup/inline.rb
new file mode 100644
index 0000000000..d54fe1e667
--- /dev/null
+++ b/lib/rdoc/markup/simple_markup/inline.rb
@@ -0,0 +1,340 @@
+module SM
+
+ # We manage a set of attributes. Each attribute has a symbol name
+ # and a bit value
+
+ class Attribute
+ SPECIAL = 1
+
+ @@name_to_bitmap = { :_SPECIAL_ => SPECIAL }
+ @@next_bitmap = 2
+
+ def Attribute.bitmap_for(name)
+ bitmap = @@name_to_bitmap[name]
+ if !bitmap
+ bitmap = @@next_bitmap
+ @@next_bitmap <<= 1
+ @@name_to_bitmap[name] = bitmap
+ end
+ bitmap
+ end
+
+ def Attribute.as_string(bitmap)
+ return "none" if bitmap.zero?
+ res = []
+ @@name_to_bitmap.each do |name, bit|
+ res << name if (bitmap & bit) != 0
+ end
+ res.join(",")
+ end
+
+ def Attribute.each_name_of(bitmap)
+ @@name_to_bitmap.each do |name, bit|
+ next if bit == SPECIAL
+ yield name.to_s if (bitmap & bit) != 0
+ end
+ end
+ end
+
+
+ # An AttrChanger records a change in attributes. It contains
+ # a bitmap of the attributes to turn on, and a bitmap of those to
+ # turn off
+
+ AttrChanger = Struct.new(:turn_on, :turn_off)
+ class AttrChanger
+ def to_s
+ "Attr: +#{Attribute.as_string(@turn_on)}/-#{Attribute.as_string(@turn_on)}"
+ end
+ end
+
+ # An array of attributes which parallels the characters in a string
+ class AttrSpan
+ def initialize(length)
+ @attrs = Array.new(length, 0)
+ end
+
+ def set_attrs(start, length, bits)
+ for i in start ... (start+length)
+ @attrs[i] |= bits
+ end
+ end
+
+ def [](n)
+ @attrs[n]
+ end
+ end
+
+ ##
+ # Hold details of a special sequence
+
+ class Special
+ attr_reader :type
+ attr_accessor :text
+
+ def initialize(type, text)
+ @type, @text = type, text
+ end
+
+ def ==(o)
+ self.text == o.text && self.type == o.type
+ end
+
+ def to_s
+ "Special: type=#{type}, text=#{text.dump}"
+ end
+ end
+
+ class AttributeManager
+
+ NULL = "\000".freeze
+
+ ##
+ # We work by substituting non-printing characters in to the
+ # text. For now I'm assuming that I can substitute
+ # a character in the range 0..8 for a 7 bit character
+ # without damaging the encoded string, but this might
+ # be optimistic
+ #
+
+ A_PROTECT = 004
+ PROTECT_ATTR = A_PROTECT.chr
+
+ # This maps delimiters that occur around words (such as
+ # *bold* or +tt+) where the start and end delimiters
+ # and the same. This lets us optimize the regexp
+ MATCHING_WORD_PAIRS = {}
+
+ # And this is used when the delimiters aren't the same. In this
+ # case the hash maps a pattern to the attribute character
+ WORD_PAIR_MAP = {}
+
+ # This maps HTML tags to the corresponding attribute char
+ HTML_TAGS = {}
+
+ # And this maps _special_ sequences to a name. A special sequence
+ # is something like a WikiWord
+ SPECIAL = {}
+
+ # Return an attribute object with the given turn_on
+ # and turn_off bits set
+
+ def attribute(turn_on, turn_off)
+ AttrChanger.new(turn_on, turn_off)
+ end
+
+
+ def change_attribute(current, new)
+ diff = current ^ new
+ attribute(new & diff, current & diff)
+ end
+
+ def changed_attribute_by_name(current_set, new_set)
+ current = new = 0
+ current_set.each {|name| current |= Attribute.bitmap_for(name) }
+ new_set.each {|name| new |= Attribute.bitmap_for(name) }
+ change_attribute(current, new)
+ end
+
+ def copy_string(start_pos, end_pos)
+ res = @str[start_pos...end_pos]
+ res.gsub!(/\000/, '')
+ res
+ end
+
+ # Map attributes like <b>text</b>to the sequence \001\002<char>\001\003<char>,
+ # where <char> is a per-attribute specific character
+
+ def convert_attrs(str, attrs)
+ # first do matching ones
+ tags = MATCHING_WORD_PAIRS.keys.join("")
+ re = "(^|\\W)([#{tags}])([A-Za-z_]+?)\\2(\\W|\$)"
+# re = "(^|\\W)([#{tags}])(\\S+?)\\2(\\W|\$)"
+ 1 while str.gsub!(Regexp.new(re)) {
+ attr = MATCHING_WORD_PAIRS[$2];
+ attrs.set_attrs($`.length + $1.length + $2.length, $3.length, attr)
+ $1 + NULL*$2.length + $3 + NULL*$2.length + $4
+ }
+
+ # then non-matching
+ unless WORD_PAIR_MAP.empty?
+ WORD_PAIR_MAP.each do |regexp, attr|
+ str.gsub!(regexp) {
+ attrs.set_attrs($`.length + $1.length, $2.length, attr)
+ NULL*$1.length + $2 + NULL*$3.length
+ }
+ end
+ end
+ end
+
+ def convert_html(str, attrs)
+ tags = HTML_TAGS.keys.join("|")
+ re = "<(#{tags})>(.*?)</\\1>"
+ 1 while str.gsub!(Regexp.new(re, Regexp::IGNORECASE)) {
+ attr = HTML_TAGS[$1.downcase]
+ html_length = $1.length + 2
+ seq = NULL * html_length
+ attrs.set_attrs($`.length + html_length, $2.length, attr)
+ seq + $2 + seq + NULL
+ }
+ end
+
+ def convert_specials(str, attrs)
+ unless SPECIAL.empty?
+ SPECIAL.each do |regexp, attr|
+ str.scan(regexp) do
+ attrs.set_attrs($`.length, $&.length, attr | Attribute::SPECIAL)
+ end
+ end
+ end
+ end
+
+ # A \ in front of a character that would normally be
+ # processed turns off processing. We do this by turning
+ # \< into <#{PROTECT}
+
+ PROTECTABLE = [ "<" << "\\" ] #"
+
+
+ def mask_protected_sequences
+ protect_pattern = Regexp.new("\\\\([#{Regexp.escape(PROTECTABLE.join(''))}])")
+ @str.gsub!(protect_pattern, "\\1#{PROTECT_ATTR}")
+ end
+
+ def unmask_protected_sequences
+ @str.gsub!(/(.)#{PROTECT_ATTR}/, "\\1\000")
+ end
+
+ def initialize
+ add_word_pair("*", "*", :BOLD)
+ add_word_pair("_", "_", :EM)
+ add_word_pair("+", "+", :TT)
+
+ add_html("em", :EM)
+ add_html("i", :EM)
+ add_html("b", :BOLD)
+ add_html("tt", :TT)
+ add_html("code", :TT)
+
+ add_special(/<!--(.*?)-->/, :COMMENT)
+ end
+
+ def add_word_pair(start, stop, name)
+ raise "Word flags may not start '<'" if start[0] == ?<
+ bitmap = Attribute.bitmap_for(name)
+ if start == stop
+ MATCHING_WORD_PAIRS[start] = bitmap
+ else
+ pattern = Regexp.new("(" + Regexp.escape(start) + ")" +
+# "([A-Za-z]+)" +
+ "(\\S+)" +
+ "(" + Regexp.escape(stop) +")")
+ WORD_PAIR_MAP[pattern] = bitmap
+ end
+ PROTECTABLE << start[0,1]
+ PROTECTABLE.uniq!
+ end
+
+ def add_html(tag, name)
+ HTML_TAGS[tag.downcase] = Attribute.bitmap_for(name)
+ end
+
+ def add_special(pattern, name)
+ SPECIAL[pattern] = Attribute.bitmap_for(name)
+ end
+
+ def flow(str)
+ @str = str
+
+ puts("Before flow, str='#{@str.dump}'") if $DEBUG
+ mask_protected_sequences
+
+ @attrs = AttrSpan.new(@str.length)
+
+ puts("After protecting, str='#{@str.dump}'") if $DEBUG
+ convert_attrs(@str, @attrs)
+ convert_html(@str, @attrs)
+ convert_specials(str, @attrs)
+ unmask_protected_sequences
+ puts("After flow, str='#{@str.dump}'") if $DEBUG
+ return split_into_flow
+ end
+
+ def display_attributes
+ puts
+ puts @str.tr(NULL, "!")
+ bit = 1
+ 16.times do |bno|
+ line = ""
+ @str.length.times do |i|
+ if (@attrs[i] & bit) == 0
+ line << " "
+ else
+ if bno.zero?
+ line << "S"
+ else
+ line << ("%d" % (bno+1))
+ end
+ end
+ end
+ puts(line) unless line =~ /^ *$/
+ bit <<= 1
+ end
+ end
+
+ def split_into_flow
+
+ display_attributes if $DEBUG
+
+ res = []
+ current_attr = 0
+ str = ""
+
+
+ str_len = @str.length
+
+ # skip leading invisible text
+ i = 0
+ i += 1 while i < str_len and @str[i].zero?
+ start_pos = i
+
+ # then scan the string, chunking it on attribute changes
+ while i < str_len
+ new_attr = @attrs[i]
+ if new_attr != current_attr
+ if i > start_pos
+ res << copy_string(start_pos, i)
+ start_pos = i
+ end
+
+ res << change_attribute(current_attr, new_attr)
+ current_attr = new_attr
+
+ if (current_attr & Attribute::SPECIAL) != 0
+ i += 1 while i < str_len and (@attrs[i] & Attribute::SPECIAL) != 0
+ res << Special.new(current_attr, copy_string(start_pos, i))
+ start_pos = i
+ next
+ end
+ end
+
+ # move on, skipping any invisible characters
+ begin
+ i += 1
+ end while i < str_len and @str[i].zero?
+ end
+
+ # tidy up trailing text
+ if start_pos < str_len
+ res << copy_string(start_pos, str_len)
+ end
+
+ # and reset to all attributes off
+ res << change_attribute(current_attr, 0) if current_attr != 0
+
+ return res
+ end
+
+ end
+
+end
diff --git a/lib/rdoc/markup/simple_markup/lines.rb b/lib/rdoc/markup/simple_markup/lines.rb
new file mode 100644
index 0000000000..4e294f27dc
--- /dev/null
+++ b/lib/rdoc/markup/simple_markup/lines.rb
@@ -0,0 +1,151 @@
+##########################################################################
+#
+# We store the lines we're working on as objects of class Line.
+# These contain the text of the line, along with a flag indicating the
+# line type, and an indentation level
+
+module SM
+
+ class Line
+ INFINITY = 9999
+
+ BLANK = :BLANK
+ HEADING = :HEADING
+ LIST = :LIST
+ RULE = :RULE
+ PARAGRAPH = :PARAGRAPH
+ VERBATIM = :VERBATIM
+
+ # line type
+ attr_accessor :type
+
+ # The indentation nesting level
+ attr_accessor :level
+
+ # The contents
+ attr_accessor :text
+
+ # A prefix or parameter. For LIST lines, this is
+ # the text that introduced the list item (the label)
+ attr_accessor :param
+
+ # A flag. For list lines, this is the type of the list
+ attr_accessor :flag
+
+ # the number of leading spaces
+ attr_accessor :leading_spaces
+
+ # true if this line has been deleted from the list of lines
+ attr_accessor :deleted
+
+
+ def initialize(text)
+ @text = text.dup
+ @deleted = false
+
+ # expand tabs
+ 1 while @text.gsub!(/\t+/) { ' ' * (8*$&.length - $`.length % 8)} && $~ #`
+
+ # Strip trailing whitespace
+ @text.sub!(/\s+$/, '')
+
+ # and look for leading whitespace
+ if @text.length > 0
+ @text =~ /^(\s*)/
+ @leading_spaces = $1.length
+ else
+ @leading_spaces = INFINITY
+ end
+ end
+
+ # Return true if this line is blank
+ def isBlank?
+ @text.length.zero?
+ end
+
+ # stamp a line with a type, a level, a prefix, and a flag
+ def stamp(type, level, param="", flag=nil)
+ @type, @level, @param, @flag = type, level, param, flag
+ end
+
+ ##
+ # Strip off the leading margin
+ #
+
+ def strip_leading(size)
+ if @text.size > size
+ @text[0,size] = ""
+ else
+ @text = ""
+ end
+ end
+
+ def to_s
+ "#@type#@level: #@text"
+ end
+ end
+
+ ###############################################################################
+ #
+ # A container for all the lines
+ #
+
+ class Lines
+ include Enumerable
+
+ attr_reader :lines # for debugging
+
+ def initialize(lines)
+ @lines = lines
+ rewind
+ end
+
+ def empty?
+ @lines.size.zero?
+ end
+
+ def each
+ @lines.each do |line|
+ yield line unless line.deleted
+ end
+ end
+
+# def [](index)
+# @lines[index]
+# end
+
+ def rewind
+ @nextline = 0
+ end
+
+ def next
+ begin
+ res = @lines[@nextline]
+ @nextline += 1 if @nextline < @lines.size
+ end while res and res.deleted and @nextline < @lines.size
+ res
+ end
+
+ def unget
+ @nextline -= 1
+ end
+
+ def delete(a_line)
+ a_line.deleted = true
+ end
+
+ def normalize
+ margin = @lines.collect{|l| l.leading_spaces}.min
+ margin = 0 if margin == Line::INFINITY
+ @lines.each {|line| line.strip_leading(margin) } if margin > 0
+ end
+
+ def as_text
+ @lines.map {|l| l.text}.join("\n")
+ end
+
+ def line_types
+ @lines.map {|l| l.type }
+ end
+ end
+end
diff --git a/lib/rdoc/markup/simple_markup/preprocess.rb b/lib/rdoc/markup/simple_markup/preprocess.rb
new file mode 100644
index 0000000000..101c9bdeb1
--- /dev/null
+++ b/lib/rdoc/markup/simple_markup/preprocess.rb
@@ -0,0 +1,73 @@
+module SM
+
+ ##
+ # Handle common directives that can occur in a block of text:
+ #
+ # : include : filename
+ #
+
+ class PreProcess
+
+ def initialize(input_file_name, include_path)
+ @input_file_name = input_file_name
+ @include_path = include_path
+ end
+
+ # Look for common options in a chunk of text. Options that
+ # we don't handle are passed back to our caller
+ # as |directive, param|
+
+ def handle(text)
+ text.gsub!(/^([ \t#]*):(\w+):\s*(.+)?\n/) do
+ prefix = $1
+ directive = $2.downcase
+ param = $3
+
+ case directive
+ when "include"
+ filename = param.split[0]
+ include_file(filename, prefix)
+
+ else
+ yield(directive, param)
+ end
+ end
+ end
+
+ #######
+ private
+ #######
+
+ # Include a file, indenting it correctly
+
+ def include_file(name, indent)
+ if (full_name = find_include_file(name))
+ content = File.open(full_name) {|f| f.read}
+ # strip leading '#'s, but only if all lines start with them
+ if content =~ /^[^#]/
+ content.gsub(/^/, indent)
+ else
+ content.gsub(/^#?/, indent)
+ end
+ else
+ $stderr.puts "Couldn't find file to include: '#{name}'"
+ ''
+ end
+ end
+
+ # Look for the given file in the directory containing the current
+ # file, and then in each of the directories specified in the
+ # RDOC_INCLUDE path
+
+ def find_include_file(name)
+ to_search = [ File.dirname(@input_file_name) ].concat @include_path
+ to_search.each do |dir|
+ full_name = File.join(dir, name)
+ stat = File.stat(full_name) rescue next
+ return full_name if stat.readable?
+ end
+ nil
+ end
+
+ end
+end
diff --git a/lib/rdoc/markup/simple_markup/to_flow.rb b/lib/rdoc/markup/simple_markup/to_flow.rb
new file mode 100644
index 0000000000..048e71abce
--- /dev/null
+++ b/lib/rdoc/markup/simple_markup/to_flow.rb
@@ -0,0 +1,188 @@
+require 'rdoc/markup/simple_markup/fragments'
+require 'rdoc/markup/simple_markup/inline'
+require 'cgi'
+
+module SM
+
+ module Flow
+ P = Struct.new(:body)
+ VERB = Struct.new(:body)
+ RULE = Struct.new(:width)
+ class LIST
+ attr_reader :type, :contents
+ def initialize(type)
+ @type = type
+ @contents = []
+ end
+ def <<(stuff)
+ @contents << stuff
+ end
+ end
+ LI = Struct.new(:label, :body)
+ H = Struct.new(:level, :text)
+ end
+
+ class ToFlow
+ LIST_TYPE_TO_HTML = {
+ SM::ListBase::BULLET => [ "<ul>", "</ul>" ],
+ SM::ListBase::NUMBER => [ "<ol>", "</ol>" ],
+ SM::ListBase::UPPERALPHA => [ "<ol>", "</ol>" ],
+ SM::ListBase::LOWERALPHA => [ "<ol>", "</ol>" ],
+ SM::ListBase::LABELED => [ "<dl>", "</dl>" ],
+ SM::ListBase::NOTE => [ "<table>", "</table>" ],
+ }
+
+ InlineTag = Struct.new(:bit, :on, :off)
+
+ def initialize
+ init_tags
+ end
+
+ ##
+ # Set up the standard mapping of attributes to HTML tags
+ #
+ def init_tags
+ @attr_tags = [
+ InlineTag.new(SM::Attribute.bitmap_for(:BOLD), "<b>", "</b>"),
+ InlineTag.new(SM::Attribute.bitmap_for(:TT), "<tt>", "</tt>"),
+ InlineTag.new(SM::Attribute.bitmap_for(:EM), "<em>", "</em>"),
+ ]
+ end
+
+ ##
+ # Add a new set of HTML tags for an attribute. We allow
+ # separate start and end tags for flexibility
+ #
+ def add_tag(name, start, stop)
+ @attr_tags << InlineTag.new(SM::Attribute.bitmap_for(name), start, stop)
+ end
+
+ ##
+ # Given an HTML tag, decorate it with class information
+ # and the like if required. This is a no-op in the base
+ # class, but is overridden in HTML output classes that
+ # implement style sheets
+
+ def annotate(tag)
+ tag
+ end
+
+ ##
+ # Here's the client side of the visitor pattern
+
+ def start_accepting
+ @res = []
+ @list_stack = []
+ end
+
+ def end_accepting
+ @res
+ end
+
+ def accept_paragraph(am, fragment)
+ @res << Flow::P.new((convert_flow(am.flow(fragment.txt))))
+ end
+
+ def accept_verbatim(am, fragment)
+ @res << Flow::VERB.new((convert_flow(am.flow(fragment.txt))))
+ end
+
+ def accept_rule(am, fragment)
+ size = fragment.param
+ size = 10 if size > 10
+ @res << Flow::RULE.new(size)
+ end
+
+ def accept_list_start(am, fragment)
+ @list_stack.push(@res)
+ list = Flow::LIST.new(fragment.type)
+ @res << list
+ @res = list
+ end
+
+ def accept_list_end(am, fragment)
+ @res = @list_stack.pop
+ end
+
+ def accept_list_item(am, fragment)
+ @res << Flow::LI.new(fragment.param, convert_flow(am.flow(fragment.txt)))
+ end
+
+ def accept_blank_line(am, fragment)
+ # @res << annotate("<p />") << "\n"
+ end
+
+ def accept_heading(am, fragment)
+ @res << Flow::H.new(fragment.head_level, convert_flow(am.flow(fragment.txt)))
+ end
+
+
+ #######################################################################
+
+ private
+
+ #######################################################################
+
+ def on_tags(res, item)
+ attr_mask = item.turn_on
+ return if attr_mask.zero?
+
+ @attr_tags.each do |tag|
+ if attr_mask & tag.bit != 0
+ res << annotate(tag.on)
+ end
+ end
+ end
+
+ def off_tags(res, item)
+ attr_mask = item.turn_off
+ return if attr_mask.zero?
+
+ @attr_tags.reverse_each do |tag|
+ if attr_mask & tag.bit != 0
+ res << annotate(tag.off)
+ end
+ end
+ end
+
+ def convert_flow(flow)
+ res = ""
+ flow.each do |item|
+ case item
+ when String
+ res << convert_string(item)
+ when AttrChanger
+ off_tags(res, item)
+ on_tags(res, item)
+ when Special
+ res << convert_special(item)
+ else
+ raise "Unknown flow element: #{item.inspect}"
+ end
+ end
+ res
+ end
+
+ # some of these patterns are taken from SmartyPants...
+
+ def convert_string(item)
+ CGI.escapeHTML(item)
+ end
+
+ def convert_special(special)
+ handled = false
+ Attribute.each_name_of(special.type) do |name|
+ method_name = "handle_special_#{name}"
+ if self.respond_to? method_name
+ special.text = send(method_name, special)
+ handled = true
+ end
+ end
+ raise "Unhandled special: #{special}" unless handled
+ special.text
+ end
+
+
+ end
+
+end
diff --git a/lib/rdoc/markup/simple_markup/to_html.rb b/lib/rdoc/markup/simple_markup/to_html.rb
new file mode 100644
index 0000000000..26b5f4ce70
--- /dev/null
+++ b/lib/rdoc/markup/simple_markup/to_html.rb
@@ -0,0 +1,289 @@
+require 'rdoc/markup/simple_markup/fragments'
+require 'rdoc/markup/simple_markup/inline'
+
+require 'cgi'
+
+module SM
+
+ class ToHtml
+
+ LIST_TYPE_TO_HTML = {
+ ListBase::BULLET => [ "<ul>", "</ul>" ],
+ ListBase::NUMBER => [ "<ol>", "</ol>" ],
+ ListBase::UPPERALPHA => [ "<ol>", "</ol>" ],
+ ListBase::LOWERALPHA => [ "<ol>", "</ol>" ],
+ ListBase::LABELED => [ "<dl>", "</dl>" ],
+ ListBase::NOTE => [ "<table>", "</table>" ],
+ }
+
+ InlineTag = Struct.new(:bit, :on, :off)
+
+ def initialize
+ init_tags
+ end
+
+ ##
+ # Set up the standard mapping of attributes to HTML tags
+ #
+ def init_tags
+ @attr_tags = [
+ InlineTag.new(SM::Attribute.bitmap_for(:BOLD), "<b>", "</b>"),
+ InlineTag.new(SM::Attribute.bitmap_for(:TT), "<tt>", "</tt>"),
+ InlineTag.new(SM::Attribute.bitmap_for(:EM), "<em>", "</em>"),
+ ]
+ end
+
+ ##
+ # Add a new set of HTML tags for an attribute. We allow
+ # separate start and end tags for flexibility
+ #
+ def add_tag(name, start, stop)
+ @attr_tags << InlineTag.new(SM::Attribute.bitmap_for(name), start, stop)
+ end
+
+ ##
+ # Given an HTML tag, decorate it with class information
+ # and the like if required. This is a no-op in the base
+ # class, but is overridden in HTML output classes that
+ # implement style sheets
+
+ def annotate(tag)
+ tag
+ end
+
+ ##
+ # Here's the client side of the visitor pattern
+
+ def start_accepting
+ @res = ""
+ @in_list_entry = []
+ end
+
+ def end_accepting
+ @res
+ end
+
+ def accept_paragraph(am, fragment)
+ @res << annotate("<p>") + "\n"
+ @res << wrap(convert_flow(am.flow(fragment.txt)))
+ @res << annotate("</p>") + "\n"
+ end
+
+ def accept_verbatim(am, fragment)
+ @res << annotate("<pre>") + "\n"
+ @res << CGI.escapeHTML(fragment.txt)
+ @res << annotate("</pre>") << "\n"
+ end
+
+ def accept_rule(am, fragment)
+ size = fragment.param
+ size = 10 if size > 10
+ @res << "<hr size=\"#{size}\"></hr>"
+ end
+
+ def accept_list_start(am, fragment)
+ @res << html_list_name(fragment.type, true) <<"\n"
+ @in_list_entry.push false
+ end
+
+ def accept_list_end(am, fragment)
+ if tag = @in_list_entry.pop
+ @res << annotate(tag) << "\n"
+ end
+ @res << html_list_name(fragment.type, false) <<"\n"
+ end
+
+ def accept_list_item(am, fragment)
+ if tag = @in_list_entry.last
+ @res << annotate(tag) << "\n"
+ end
+ @res << list_item_start(am, fragment)
+ @res << wrap(convert_flow(am.flow(fragment.txt))) << "\n"
+ @in_list_entry[-1] = list_end_for(fragment.type)
+ end
+
+ def accept_blank_line(am, fragment)
+ # @res << annotate("<p />") << "\n"
+ end
+
+ def accept_heading(am, fragment)
+ @res << convert_heading(fragment.head_level, am.flow(fragment.txt))
+ end
+
+ # This is a higher speed (if messier) version of wrap
+
+ def wrap(txt, line_len = 76)
+ res = ""
+ sp = 0
+ ep = txt.length
+ while sp < ep
+ # scan back for a space
+ p = sp + line_len - 1
+ if p >= ep
+ p = ep
+ else
+ while p > sp and txt[p] != ?\s
+ p -= 1
+ end
+ if p <= sp
+ p = sp + line_len
+ while p < ep and txt[p] != ?\s
+ p += 1
+ end
+ end
+ end
+ res << txt[sp...p] << "\n"
+ sp = p
+ sp += 1 while sp < ep and txt[sp] == ?\s
+ end
+ res
+ end
+
+ #######################################################################
+
+ private
+
+ #######################################################################
+
+ def on_tags(res, item)
+ attr_mask = item.turn_on
+ return if attr_mask.zero?
+
+ @attr_tags.each do |tag|
+ if attr_mask & tag.bit != 0
+ res << annotate(tag.on)
+ end
+ end
+ end
+
+ def off_tags(res, item)
+ attr_mask = item.turn_off
+ return if attr_mask.zero?
+
+ @attr_tags.reverse_each do |tag|
+ if attr_mask & tag.bit != 0
+ res << annotate(tag.off)
+ end
+ end
+ end
+
+ def convert_flow(flow)
+ res = ""
+ flow.each do |item|
+ case item
+ when String
+ res << convert_string(item)
+ when AttrChanger
+ off_tags(res, item)
+ on_tags(res, item)
+ when Special
+ res << convert_special(item)
+ else
+ raise "Unknown flow element: #{item.inspect}"
+ end
+ end
+ res
+ end
+
+ # some of these patterns are taken from SmartyPants...
+
+ def convert_string(item)
+ CGI.escapeHTML(item).
+
+
+ # convert -- to em-dash, (-- to en-dash)
+ gsub(/---?/, '&#8212;'). #gsub(/--/, '&#8211;').
+
+ # convert ... to elipsis (and make sure .... becomes .<elipsis>)
+ gsub(/\.\.\.\./, '.&#8230;').gsub(/\.\.\./, '&#8230;').
+
+ # convert single closing quote
+ gsub(%r{([^ \t\r\n\[\{\(])\'}) { "#$1&#8217;" }.
+ gsub(%r{\'(?=\W|s\b)}) { "&#8217;" }.
+
+ # convert single opening quote
+ gsub(/'/, '&#8216;').
+
+ # convert double closing quote
+ gsub(%r{([^ \t\r\n\[\{\(])\'(?=\W)}) { "#$1&#8221;" }.
+
+ # convert double opening quote
+ gsub(/'/, '&#8220;').
+
+ # convert copyright
+ gsub(/\(c\)/, '&#169;').
+
+ # convert and registered trademark
+ gsub(/\(r\)/, '&#174;')
+
+ end
+
+ def convert_special(special)
+ handled = false
+ Attribute.each_name_of(special.type) do |name|
+ method_name = "handle_special_#{name}"
+ if self.respond_to? method_name
+ special.text = send(method_name, special)
+ handled = true
+ end
+ end
+ raise "Unhandled special: #{special}" unless handled
+ special.text
+ end
+
+ def convert_heading(level, flow)
+ res =
+ annotate("<h#{level}>") +
+ convert_flow(flow) +
+ annotate("</h#{level}>\n")
+ end
+
+ def html_list_name(list_type, is_open_tag)
+ tags = LIST_TYPE_TO_HTML[list_type] || raise("Invalid list type: #{list_type.inspect}")
+ annotate(tags[ is_open_tag ? 0 : 1])
+ end
+
+ def list_item_start(am, fragment)
+ case fragment.type
+ when ListBase::BULLET, ListBase::NUMBER
+ annotate("<li>")
+
+ when ListBase::UPPERALPHA
+ annotate("<li type=\"A\">")
+
+ when ListBase::LOWERALPHA
+ annotate("<li type=\"a\">")
+
+ when ListBase::LABELED
+ annotate("<dt>") +
+ convert_flow(am.flow(fragment.param)) +
+ annotate("</dt>") +
+ annotate("<dd>")
+
+ when ListBase::NOTE
+ annotate("<tr>") +
+ annotate("<td valign=\"top\">") +
+ convert_flow(am.flow(fragment.param)) +
+ annotate("</td>") +
+ annotate("<td>")
+ else
+ raise "Invalid list type"
+ end
+ end
+
+ def list_end_for(fragment_type)
+ case fragment_type
+ when ListBase::BULLET, ListBase::NUMBER, ListBase::UPPERALPHA, ListBase::LOWERALPHA
+ "</li>"
+ when ListBase::LABELED
+ "</dd>"
+ when ListBase::NOTE
+ "</td></tr>"
+ else
+ raise "Invalid list type"
+ end
+ end
+
+ end
+
+end
diff --git a/lib/rdoc/markup/simple_markup/to_latex.rb b/lib/rdoc/markup/simple_markup/to_latex.rb
new file mode 100644
index 0000000000..6c16278652
--- /dev/null
+++ b/lib/rdoc/markup/simple_markup/to_latex.rb
@@ -0,0 +1,333 @@
+require 'rdoc/markup/simple_markup/fragments'
+require 'rdoc/markup/simple_markup/inline'
+
+require 'cgi'
+
+module SM
+
+ # Convert SimpleMarkup to basic LaTeX report format
+
+ class ToLaTeX
+
+ BS = "\020" # \
+ OB = "\021" # {
+ CB = "\022" # }
+ DL = "\023" # Dollar
+
+ BACKSLASH = "#{BS}symbol#{OB}92#{CB}"
+ HAT = "#{BS}symbol#{OB}94#{CB}"
+ BACKQUOTE = "#{BS}symbol#{OB}0#{CB}"
+ TILDE = "#{DL}#{BS}sim#{DL}"
+ LESSTHAN = "#{DL}<#{DL}"
+ GREATERTHAN = "#{DL}>#{DL}"
+
+ def self.l(str)
+ str.tr('\\', BS).tr('{', OB).tr('}', CB).tr('$', DL)
+ end
+
+ def l(arg)
+ SM::ToLaTeX.l(arg)
+ end
+
+ LIST_TYPE_TO_LATEX = {
+ ListBase::BULLET => [ l("\\begin{itemize}"), l("\\end{itemize}") ],
+ ListBase::NUMBER => [ l("\\begin{enumerate}"), l("\\end{enumerate}"), "\\arabic" ],
+ ListBase::UPPERALPHA => [ l("\\begin{enumerate}"), l("\\end{enumerate}"), "\\Alph" ],
+ ListBase::LOWERALPHA => [ l("\\begin{enumerate}"), l("\\end{enumerate}"), "\\alph" ],
+ ListBase::LABELED => [ l("\\begin{description}"), l("\\end{description}") ],
+ ListBase::NOTE => [
+ l("\\begin{tabularx}{\\linewidth}{@{} l X @{}}"),
+ l("\\end{tabularx}") ],
+ }
+
+ InlineTag = Struct.new(:bit, :on, :off)
+
+ def initialize
+ init_tags
+ @list_depth = 0
+ @prev_list_types = []
+ end
+
+ ##
+ # Set up the standard mapping of attributes to LaTeX
+ #
+ def init_tags
+ @attr_tags = [
+ InlineTag.new(SM::Attribute.bitmap_for(:BOLD), l("\\textbf{"), l("}")),
+ InlineTag.new(SM::Attribute.bitmap_for(:TT), l("\\texttt{"), l("}")),
+ InlineTag.new(SM::Attribute.bitmap_for(:EM), l("\\emph{"), l("}")),
+ ]
+ end
+
+ ##
+ # Escape a LaTeX string
+ def escape(str)
+# $stderr.print "FE: ", str
+ s = str.
+# sub(/\s+$/, '').
+ gsub(/([_\${}&%#])/, "#{BS}\\1").
+ gsub(/\\/, BACKSLASH).
+ gsub(/\^/, HAT).
+ gsub(/~/, TILDE).
+ gsub(/</, LESSTHAN).
+ gsub(/>/, GREATERTHAN).
+ gsub(/,,/, ",{},").
+ gsub(/\`/, BACKQUOTE)
+# $stderr.print "-> ", s, "\n"
+ s
+ end
+
+ ##
+ # Add a new set of LaTeX tags for an attribute. We allow
+ # separate start and end tags for flexibility
+ #
+ def add_tag(name, start, stop)
+ @attr_tags << InlineTag.new(SM::Attribute.bitmap_for(name), start, stop)
+ end
+
+
+ ##
+ # Here's the client side of the visitor pattern
+
+ def start_accepting
+ @res = ""
+ @in_list_entry = []
+ end
+
+ def end_accepting
+ @res.tr(BS, '\\').tr(OB, '{').tr(CB, '}').tr(DL, '$')
+ end
+
+ def accept_paragraph(am, fragment)
+ @res << wrap(convert_flow(am.flow(fragment.txt)))
+ @res << "\n"
+ end
+
+ def accept_verbatim(am, fragment)
+ @res << "\n\\begin{code}\n"
+ @res << fragment.txt.sub(/[\n\s]+\Z/, '')
+ @res << "\n\\end{code}\n\n"
+ end
+
+ def accept_rule(am, fragment)
+ size = fragment.param
+ size = 10 if size > 10
+ @res << "\n\n\\rule{\\linewidth}{#{size}pt}\n\n"
+ end
+
+ def accept_list_start(am, fragment)
+ @res << list_name(fragment.type, true) <<"\n"
+ @in_list_entry.push false
+ end
+
+ def accept_list_end(am, fragment)
+ if tag = @in_list_entry.pop
+ @res << tag << "\n"
+ end
+ @res << list_name(fragment.type, false) <<"\n"
+ end
+
+ def accept_list_item(am, fragment)
+ if tag = @in_list_entry.last
+ @res << tag << "\n"
+ end
+ @res << list_item_start(am, fragment)
+ @res << wrap(convert_flow(am.flow(fragment.txt))) << "\n"
+ @in_list_entry[-1] = list_end_for(fragment.type)
+ end
+
+ def accept_blank_line(am, fragment)
+ # @res << "\n"
+ end
+
+ def accept_heading(am, fragment)
+ @res << convert_heading(fragment.head_level, am.flow(fragment.txt))
+ end
+
+ # This is a higher speed (if messier) version of wrap
+
+ def wrap(txt, line_len = 76)
+ res = ""
+ sp = 0
+ ep = txt.length
+ while sp < ep
+ # scan back for a space
+ p = sp + line_len - 1
+ if p >= ep
+ p = ep
+ else
+ while p > sp and txt[p] != ?\s
+ p -= 1
+ end
+ if p <= sp
+ p = sp + line_len
+ while p < ep and txt[p] != ?\s
+ p += 1
+ end
+ end
+ end
+ res << txt[sp...p] << "\n"
+ sp = p
+ sp += 1 while sp < ep and txt[sp] == ?\s
+ end
+ res
+ end
+
+ #######################################################################
+
+ private
+
+ #######################################################################
+
+ def on_tags(res, item)
+ attr_mask = item.turn_on
+ return if attr_mask.zero?
+
+ @attr_tags.each do |tag|
+ if attr_mask & tag.bit != 0
+ res << tag.on
+ end
+ end
+ end
+
+ def off_tags(res, item)
+ attr_mask = item.turn_off
+ return if attr_mask.zero?
+
+ @attr_tags.reverse_each do |tag|
+ if attr_mask & tag.bit != 0
+ res << tag.off
+ end
+ end
+ end
+
+ def convert_flow(flow)
+ res = ""
+ flow.each do |item|
+ case item
+ when String
+# $stderr.puts "Converting '#{item}'"
+ res << convert_string(item)
+ when AttrChanger
+ off_tags(res, item)
+ on_tags(res, item)
+ when Special
+ res << convert_special(item)
+ else
+ raise "Unknown flow element: #{item.inspect}"
+ end
+ end
+ res
+ end
+
+ # some of these patterns are taken from SmartyPants...
+
+ def convert_string(item)
+
+ escape(item).
+
+
+ # convert ... to elipsis (and make sure .... becomes .<elipsis>)
+ gsub(/\.\.\.\./, '.\ldots{}').gsub(/\.\.\./, '\ldots{}').
+
+ # convert single closing quote
+ gsub(%r{([^ \t\r\n\[\{\(])\'}) { "#$1'" }.
+ gsub(%r{\'(?=\W|s\b)}) { "'" }.
+
+ # convert single opening quote
+ gsub(/'/, '`').
+
+ # convert double closing quote
+ gsub(%r{([^ \t\r\n\[\{\(])\"(?=\W)}) { "#$1''" }.
+
+ # convert double opening quote
+ gsub(/"/, "``").
+
+ # convert copyright
+ gsub(/\(c\)/, '\copyright{}')
+
+ end
+
+ def convert_special(special)
+ handled = false
+ Attribute.each_name_of(special.type) do |name|
+ method_name = "handle_special_#{name}"
+ if self.respond_to? method_name
+ special.text = send(method_name, special)
+ handled = true
+ end
+ end
+ raise "Unhandled special: #{special}" unless handled
+ special.text
+ end
+
+ def convert_heading(level, flow)
+ res =
+ case level
+ when 1 then "\\chapter{"
+ when 2 then "\\section{"
+ when 3 then "\\subsection{"
+ when 4 then "\\subsubsection{"
+ else "\\paragraph{"
+ end +
+ convert_flow(flow) +
+ "}\n"
+ end
+
+ def list_name(list_type, is_open_tag)
+ tags = LIST_TYPE_TO_LATEX[list_type] || raise("Invalid list type: #{list_type.inspect}")
+ if tags[2] # enumerate
+ if is_open_tag
+ @list_depth += 1
+ if @prev_list_types[@list_depth] != tags[2]
+ case @list_depth
+ when 1
+ roman = "i"
+ when 2
+ roman = "ii"
+ when 3
+ roman = "iii"
+ when 4
+ roman = "iv"
+ else
+ raise("Too deep list: level #{@list_depth}")
+ end
+ @prev_list_types[@list_depth] = tags[2]
+ return l("\\renewcommand{\\labelenum#{roman}}{#{tags[2]}{enum#{roman}}}") + "\n" + tags[0]
+ end
+ else
+ @list_depth -= 1
+ end
+ end
+ tags[ is_open_tag ? 0 : 1]
+ end
+
+ def list_item_start(am, fragment)
+ case fragment.type
+ when ListBase::BULLET, ListBase::NUMBER, ListBase::UPPERALPHA, ListBase::LOWERALPHA
+ "\\item "
+
+ when ListBase::LABELED
+ "\\item[" + convert_flow(am.flow(fragment.param)) + "] "
+
+ when ListBase::NOTE
+ convert_flow(am.flow(fragment.param)) + " & "
+ else
+ raise "Invalid list type"
+ end
+ end
+
+ def list_end_for(fragment_type)
+ case fragment_type
+ when ListBase::BULLET, ListBase::NUMBER, ListBase::UPPERALPHA, ListBase::LOWERALPHA, ListBase::LABELED
+ ""
+ when ListBase::NOTE
+ "\\\\\n"
+ else
+ raise "Invalid list type"
+ end
+ end
+
+ end
+
+end
diff --git a/lib/rdoc/markup/test/AllTests.rb b/lib/rdoc/markup/test/AllTests.rb
new file mode 100644
index 0000000000..b9c8c9dfcc
--- /dev/null
+++ b/lib/rdoc/markup/test/AllTests.rb
@@ -0,0 +1,2 @@
+require 'TestParse.rb'
+require 'TestInline.rb'
diff --git a/lib/rdoc/markup/test/TestInline.rb b/lib/rdoc/markup/test/TestInline.rb
new file mode 100644
index 0000000000..a067d4c24c
--- /dev/null
+++ b/lib/rdoc/markup/test/TestInline.rb
@@ -0,0 +1,154 @@
+require "test/unit"
+
+$:.unshift "../../.."
+
+require "rdoc/markup/simple_markup/inline"
+
+class TestInline < Test::Unit::TestCase
+
+
+ def setup
+ @am = SM::AttributeManager.new
+
+ @bold_on = @am.changed_attribute_by_name([], [:BOLD])
+ @bold_off = @am.changed_attribute_by_name([:BOLD], [])
+
+ @tt_on = @am.changed_attribute_by_name([], [:TT])
+ @tt_off = @am.changed_attribute_by_name([:TT], [])
+
+ @em_on = @am.changed_attribute_by_name([], [:EM])
+ @em_off = @am.changed_attribute_by_name([:EM], [])
+
+ @bold_em_on = @am.changed_attribute_by_name([], [:BOLD] | [:EM])
+ @bold_em_off = @am.changed_attribute_by_name([:BOLD] | [:EM], [])
+
+ @em_then_bold = @am.changed_attribute_by_name([:EM], [:EM] | [:BOLD])
+
+ @em_to_bold = @am.changed_attribute_by_name([:EM], [:BOLD])
+
+ @am.add_word_pair("{", "}", :WOMBAT)
+ @wombat_on = @am.changed_attribute_by_name([], [:WOMBAT])
+ @wombat_off = @am.changed_attribute_by_name([:WOMBAT], [])
+ end
+
+ def crossref(text)
+ [ @am.changed_attribute_by_name([], [:CROSSREF] | [:_SPECIAL_]),
+ SM::Special.new(33, text),
+ @am.changed_attribute_by_name([:CROSSREF] | [:_SPECIAL_], [])
+ ]
+ end
+
+ def test_special
+ # class names, variable names, file names, or instance variables
+ @am.add_special(/(
+ \b([A-Z]\w+(::\w+)*)
+ | \#\w+[!?=]?
+ | \b\w+([_\/\.]+\w+)+[!?=]?
+ )/x,
+ :CROSSREF)
+
+ assert_equal(["cat"], @am.flow("cat"))
+
+ assert_equal(["cat ", crossref("#fred"), " dog"].flatten,
+ @am.flow("cat #fred dog"))
+
+ assert_equal([crossref("#fred"), " dog"].flatten,
+ @am.flow("#fred dog"))
+
+ assert_equal(["cat ", crossref("#fred")].flatten, @am.flow("cat #fred"))
+ end
+
+ def test_basic
+ assert_equal(["cat"], @am.flow("cat"))
+
+ assert_equal(["cat ", @bold_on, "and", @bold_off, " dog"],
+ @am.flow("cat *and* dog"))
+
+ assert_equal(["cat ", @bold_on, "AND", @bold_off, " dog"],
+ @am.flow("cat *AND* dog"))
+
+ assert_equal(["cat ", @em_on, "And", @em_off, " dog"],
+ @am.flow("cat _And_ dog"))
+
+ assert_equal(["cat *and dog*"], @am.flow("cat *and dog*"))
+
+ assert_equal(["*cat and* dog"], @am.flow("*cat and* dog"))
+
+ assert_equal(["cat *and ", @bold_on, "dog", @bold_off],
+ @am.flow("cat *and *dog*"))
+
+ assert_equal(["cat ", @em_on, "and", @em_off, " dog"],
+ @am.flow("cat _and_ dog"))
+
+ assert_equal(["cat_and_dog"],
+ @am.flow("cat_and_dog"))
+
+ assert_equal(["cat ", @tt_on, "and", @tt_off, " dog"],
+ @am.flow("cat +and+ dog"))
+
+ assert_equal(["cat ", @bold_on, "a_b_c", @bold_off, " dog"],
+ @am.flow("cat *a_b_c* dog"))
+
+ assert_equal(["cat __ dog"],
+ @am.flow("cat __ dog"))
+
+ assert_equal(["cat ", @em_on, "_", @em_off, " dog"],
+ @am.flow("cat ___ dog"))
+
+ end
+
+ def test_combined
+ assert_equal(["cat ", @em_on, "and", @em_off, " ", @bold_on, "dog", @bold_off],
+ @am.flow("cat _and_ *dog*"))
+
+ assert_equal(["cat ", @em_on, "a__nd", @em_off, " ", @bold_on, "dog", @bold_off],
+ @am.flow("cat _a__nd_ *dog*"))
+ end
+
+ def test_html_like
+ assert_equal(["cat ", @tt_on, "dog", @tt_off], @am.flow("cat <tt>dog</Tt>"))
+
+ assert_equal(["cat ", @em_on, "and", @em_off, " ", @bold_on, "dog", @bold_off],
+ @am.flow("cat <i>and</i> <B>dog</b>"))
+
+ assert_equal(["cat ", @em_on, "and ", @em_then_bold, "dog", @bold_em_off],
+ @am.flow("cat <i>and <B>dog</B></I>"))
+
+ assert_equal(["cat ", @em_on, "and ", @em_to_bold, "dog", @bold_off],
+ @am.flow("cat <i>and </i><b>dog</b>"))
+
+ assert_equal(["cat ", @em_on, "and ", @em_to_bold, "dog", @bold_off],
+ @am.flow("cat <i>and <b></i>dog</b>"))
+
+ assert_equal([@tt_on, "cat", @tt_off, " ", @em_on, "and ", @em_to_bold, "dog", @bold_off],
+ @am.flow("<tt>cat</tt> <i>and <b></i>dog</b>"))
+
+ assert_equal(["cat ", @em_on, "and ", @em_then_bold, "dog", @bold_em_off],
+ @am.flow("cat <i>and <b>dog</b></i>"))
+
+ assert_equal(["cat ", @bold_em_on, "and", @bold_em_off, " dog"],
+ @am.flow("cat <i><b>and</b></i> dog"))
+
+
+ end
+
+ def test_protect
+ assert_equal(['cat \\ dog'], @am.flow('cat \\ dog'))
+
+ assert_equal(["cat <tt>dog</Tt>"], @am.flow("cat \\<tt>dog</Tt>"))
+
+ assert_equal(["cat ", @em_on, "and", @em_off, " <B>dog</b>"],
+ @am.flow("cat <i>and</i> \\<B>dog</b>"))
+
+ assert_equal(["*word* or <b>text</b>"], @am.flow("\\*word* or \\<b>text</b>"))
+
+ assert_equal(["_cat_", @em_on, "dog", @em_off],
+ @am.flow("\\_cat_<i>dog</i>"))
+ end
+
+ def test_adding
+ assert_equal(["cat ", @wombat_on, "and", @wombat_off, " dog" ],
+ @am.flow("cat {and} dog"))
+# assert_equal(["cat {and} dog" ], @am.flow("cat \\{and} dog"))
+ end
+end
diff --git a/lib/rdoc/markup/test/TestParse.rb b/lib/rdoc/markup/test/TestParse.rb
new file mode 100644
index 0000000000..3ec541ce7a
--- /dev/null
+++ b/lib/rdoc/markup/test/TestParse.rb
@@ -0,0 +1,503 @@
+require 'test/unit'
+
+$:.unshift "../../.."
+
+require 'rdoc/markup/simple_markup'
+
+include SM
+
+class TestParse < Test::Unit::TestCase
+
+ class MockOutput
+ def start_accepting
+ @res = []
+ end
+
+ def end_accepting
+ @res
+ end
+
+ def accept_paragraph(am, fragment)
+ @res << fragment.to_s
+ end
+
+ def accept_verbatim(am, fragment)
+ @res << fragment.to_s
+ end
+
+ def accept_list_start(am, fragment)
+ @res << fragment.to_s
+ end
+
+ def accept_list_end(am, fragment)
+ @res << fragment.to_s
+ end
+
+ def accept_list_item(am, fragment)
+ @res << fragment.to_s
+ end
+
+ def accept_blank_line(am, fragment)
+ @res << fragment.to_s
+ end
+
+ def accept_heading(am, fragment)
+ @res << fragment.to_s
+ end
+
+ def accept_rule(am, fragment)
+ @res << fragment.to_s
+ end
+
+ end
+
+ def basic_conv(str)
+ sm = SimpleMarkup.new
+ mock = MockOutput.new
+ sm.convert(str, mock)
+ sm.content
+ end
+
+ def line_types(str, expected)
+ p = SimpleMarkup.new
+ mock = MockOutput.new
+ p.convert(str, mock)
+ assert_equal(expected, p.get_line_types.map{|type| type.to_s[0,1]}.join(''))
+ end
+
+ def line_groups(str, expected)
+ p = SimpleMarkup.new
+ mock = MockOutput.new
+
+ block = p.convert(str, mock)
+
+ if block != expected
+ rows = (0...([expected.size, block.size].max)).collect{|i|
+ [expected[i]||"nil", block[i]||"nil"]
+ }
+ printf "\n\n%35s %35s\n", "Expected", "Got"
+ rows.each {|e,g| printf "%35s %35s\n", e.dump, g.dump }
+ end
+
+ assert_equal(expected, block)
+ end
+
+ def test_tabs
+ str = "hello\n dave"
+ assert_equal(str, basic_conv(str))
+ str = "hello\n\tdave"
+ assert_equal("hello\n dave", basic_conv(str))
+ str = "hello\n \tdave"
+ assert_equal("hello\n dave", basic_conv(str))
+ str = "hello\n \tdave"
+ assert_equal("hello\n dave", basic_conv(str))
+ str = "hello\n \tdave"
+ assert_equal("hello\n dave", basic_conv(str))
+ str = "hello\n \tdave"
+ assert_equal("hello\n dave", basic_conv(str))
+ str = "hello\n \tdave"
+ assert_equal("hello\n dave", basic_conv(str))
+ str = "hello\n \tdave"
+ assert_equal("hello\n dave", basic_conv(str))
+ str = "hello\n \tdave"
+ assert_equal("hello\n dave", basic_conv(str))
+ str = "hello\n \tdave"
+ assert_equal("hello\n dave", basic_conv(str))
+ str = ".\t\t."
+ assert_equal(". .", basic_conv(str))
+ end
+
+ def test_whitespace
+ assert_equal("hello", basic_conv("hello"))
+ assert_equal("hello", basic_conv(" hello "))
+ assert_equal("hello", basic_conv(" \t \t hello\t\t"))
+
+ assert_equal("1\n 2\n 3", basic_conv("1\n 2\n 3"))
+ assert_equal("1\n 2\n 3", basic_conv(" 1\n 2\n 3"))
+
+ assert_equal("1\n 2\n 3\n1\n 2", basic_conv("1\n 2\n 3\n1\n 2"))
+ assert_equal("1\n 2\n 3\n1\n 2", basic_conv(" 1\n 2\n 3\n 1\n 2"))
+
+ assert_equal("1\n 2\n\n 3", basic_conv(" 1\n 2\n\n 3"))
+ end
+
+ def test_types
+ str = "now is the time"
+ line_types(str, 'P')
+
+ str = "now is the time\nfor all good men"
+ line_types(str, 'PP')
+
+ str = "now is the time\n code\nfor all good men"
+ line_types(str, 'PVP')
+
+ str = "now is the time\n code\n more code\nfor all good men"
+ line_types(str, 'PVVP')
+
+ str = "now is\n---\nthe time"
+ line_types(str, 'PRP')
+
+ str = %{\
+ now is
+ * l1
+ * l2
+ the time}
+ line_types(str, 'PLLP')
+
+ str = %{\
+ now is
+ * l1
+ l1+
+ * l2
+ the time}
+ line_types(str, 'PLPLP')
+
+ str = %{\
+ now is
+ * l1
+ * l1.1
+ * l2
+ the time}
+ line_types(str, 'PLLLP')
+
+ str = %{\
+ now is
+ * l1
+ * l1.1
+ text
+ code
+ code
+
+ text
+ * l2
+ the time}
+ line_types(str, 'PLLPVVBPLP')
+
+ str = %{\
+ now is
+ 1. l1
+ * l1.1
+ 2. l2
+ the time}
+ line_types(str, 'PLLLP')
+
+ str = %{\
+ now is
+ [cat] l1
+ * l1.1
+ [dog] l2
+ the time}
+ line_types(str, 'PLLLP')
+
+ str = %{\
+ now is
+ [cat] l1
+ continuation
+ [dog] l2
+ the time}
+ line_types(str, 'PLPLP')
+ end
+
+ def test_groups
+ str = "now is the time"
+ line_groups(str, ["L0: Paragraph\nnow is the time"] )
+
+ str = "now is the time\nfor all good men"
+ line_groups(str, ["L0: Paragraph\nnow is the time for all good men"] )
+
+ str = %{\
+ now is the time
+ code _line_ here
+ for all good men}
+
+ line_groups(str,
+ [ "L0: Paragraph\nnow is the time",
+ "L0: Verbatim\n code _line_ here\n",
+ "L0: Paragraph\nfor all good men"
+ ] )
+
+ str = "now is the time\n code\n more code\nfor all good men"
+ line_groups(str,
+ [ "L0: Paragraph\nnow is the time",
+ "L0: Verbatim\n code\n more code\n",
+ "L0: Paragraph\nfor all good men"
+ ] )
+
+ str = %{\
+ now is
+ * l1
+ * l2
+ the time}
+ line_groups(str,
+ [ "L0: Paragraph\nnow is",
+ "L1: ListStart\n",
+ "L1: ListItem\nl1",
+ "L1: ListItem\nl2",
+ "L1: ListEnd\n",
+ "L0: Paragraph\nthe time"
+ ])
+
+ str = %{\
+ now is
+ * l1
+ l1+
+ * l2
+ the time}
+ line_groups(str,
+ [ "L0: Paragraph\nnow is",
+ "L1: ListStart\n",
+ "L1: ListItem\nl1 l1+",
+ "L1: ListItem\nl2",
+ "L1: ListEnd\n",
+ "L0: Paragraph\nthe time"
+ ])
+
+ str = %{\
+ now is
+ * l1
+ * l1.1
+ * l2
+ the time}
+ line_groups(str,
+ [ "L0: Paragraph\nnow is",
+ "L1: ListStart\n",
+ "L1: ListItem\nl1",
+ "L2: ListStart\n",
+ "L2: ListItem\nl1.1",
+ "L2: ListEnd\n",
+ "L1: ListItem\nl2",
+ "L1: ListEnd\n",
+ "L0: Paragraph\nthe time"
+ ])
+
+
+ str = %{\
+ now is
+ * l1
+ * l1.1
+ text
+ code
+ code
+
+ text
+ * l2
+ the time}
+ line_groups(str,
+ [ "L0: Paragraph\nnow is",
+ "L1: ListStart\n",
+ "L1: ListItem\nl1",
+ "L2: ListStart\n",
+ "L2: ListItem\nl1.1 text",
+ "L2: Verbatim\n code\n code\n",
+ "L2: Paragraph\ntext",
+ "L2: ListEnd\n",
+ "L1: ListItem\nl2",
+ "L1: ListEnd\n",
+ "L0: Paragraph\nthe time"
+ ])
+
+
+ str = %{\
+ now is
+ 1. l1
+ * l1.1
+ 2. l2
+ the time}
+ line_groups(str,
+ [ "L0: Paragraph\nnow is",
+ "L1: ListStart\n",
+ "L1: ListItem\nl1",
+ "L2: ListStart\n",
+ "L2: ListItem\nl1.1",
+ "L2: ListEnd\n",
+ "L1: ListItem\nl2",
+ "L1: ListEnd\n",
+ "L0: Paragraph\nthe time"
+ ])
+
+ str = %{\
+ now is
+ [cat] l1
+ * l1.1
+ [dog] l2
+ the time}
+ line_groups(str,
+ [ "L0: Paragraph\nnow is",
+ "L1: ListStart\n",
+ "L1: ListItem\nl1",
+ "L2: ListStart\n",
+ "L2: ListItem\nl1.1",
+ "L2: ListEnd\n",
+ "L1: ListItem\nl2",
+ "L1: ListEnd\n",
+ "L0: Paragraph\nthe time"
+ ])
+
+ str = %{\
+ now is
+ [cat] l1
+ continuation
+ [dog] l2
+ the time}
+ line_groups(str,
+ [ "L0: Paragraph\nnow is",
+ "L1: ListStart\n",
+ "L1: ListItem\nl1 continuation",
+ "L1: ListItem\nl2",
+ "L1: ListEnd\n",
+ "L0: Paragraph\nthe time"
+ ])
+
+
+ end
+
+ def test_verbatim_merge
+ str = %{\
+ now is
+ code
+ the time}
+
+ line_groups(str,
+ [ "L0: Paragraph\nnow is",
+ "L0: Verbatim\n code\n",
+ "L0: Paragraph\nthe time"
+ ])
+
+
+ str = %{\
+ now is
+ code
+ code1
+ the time}
+
+ line_groups(str,
+ [ "L0: Paragraph\nnow is",
+ "L0: Verbatim\n code\n code1\n",
+ "L0: Paragraph\nthe time"
+ ])
+
+
+ str = %{\
+ now is
+ code
+
+ code1
+ the time}
+
+ line_groups(str,
+ [ "L0: Paragraph\nnow is",
+ "L0: Verbatim\n code\n\n code1\n",
+ "L0: Paragraph\nthe time"
+ ])
+
+
+ str = %{\
+ now is
+ code
+
+ code1
+
+ the time}
+
+ line_groups(str,
+ [ "L0: Paragraph\nnow is",
+ "L0: Verbatim\n code\n\n code1\n",
+ "L0: Paragraph\nthe time"
+ ])
+
+
+ str = %{\
+ now is
+ code
+
+ code1
+
+ code2
+ the time}
+
+ line_groups(str,
+ [ "L0: Paragraph\nnow is",
+ "L0: Verbatim\n code\n\n code1\n\n code2\n",
+ "L0: Paragraph\nthe time"
+ ])
+
+
+ # Folds multiple blank lines
+ str = %{\
+ now is
+ code
+
+
+ code1
+
+ the time}
+
+ line_groups(str,
+ [ "L0: Paragraph\nnow is",
+ "L0: Verbatim\n code\n\n code1\n",
+ "L0: Paragraph\nthe time"
+ ])
+
+
+ end
+
+ def test_list_split
+ str = %{\
+ now is
+ * l1
+ 1. n1
+ 2. n2
+ * l2
+ the time}
+ line_groups(str,
+ [ "L0: Paragraph\nnow is",
+ "L1: ListStart\n",
+ "L1: ListItem\nl1",
+ "L1: ListEnd\n",
+ "L1: ListStart\n",
+ "L1: ListItem\nn1",
+ "L1: ListItem\nn2",
+ "L1: ListEnd\n",
+ "L1: ListStart\n",
+ "L1: ListItem\nl2",
+ "L1: ListEnd\n",
+ "L0: Paragraph\nthe time"
+ ])
+
+ end
+
+
+ def test_headings
+ str = "= heading one"
+ line_groups(str,
+ [ "L0: Heading\nheading one"
+ ])
+
+ str = "=== heading three"
+ line_groups(str,
+ [ "L0: Heading\nheading three"
+ ])
+
+ str = "text\n === heading three"
+ line_groups(str,
+ [ "L0: Paragraph\ntext",
+ "L0: Verbatim\n === heading three\n"
+ ])
+
+ str = "text\n code\n === heading three"
+ line_groups(str,
+ [ "L0: Paragraph\ntext",
+ "L0: Verbatim\n code\n === heading three\n"
+ ])
+
+ str = "text\n code\n=== heading three"
+ line_groups(str,
+ [ "L0: Paragraph\ntext",
+ "L0: Verbatim\n code\n",
+ "L0: Heading\nheading three"
+ ])
+
+ end
+
+
+end
diff --git a/lib/rdoc/markup/to_flow.rb b/lib/rdoc/markup/to_flow.rb
deleted file mode 100644
index 3d87b3e9c3..0000000000
--- a/lib/rdoc/markup/to_flow.rb
+++ /dev/null
@@ -1,185 +0,0 @@
-require 'rdoc/markup/formatter'
-require 'rdoc/markup/fragments'
-require 'rdoc/markup/inline'
-require 'cgi'
-
-class RDoc::Markup
-
- module Flow
- P = Struct.new(:body)
- VERB = Struct.new(:body)
- RULE = Struct.new(:width)
- class LIST
- attr_reader :type, :contents
- def initialize(type)
- @type = type
- @contents = []
- end
- def <<(stuff)
- @contents << stuff
- end
- end
- LI = Struct.new(:label, :body)
- H = Struct.new(:level, :text)
- end
-
- class ToFlow < RDoc::Markup::Formatter
- LIST_TYPE_TO_HTML = {
- :BULLET => [ "<ul>", "</ul>" ],
- :NUMBER => [ "<ol>", "</ol>" ],
- :UPPERALPHA => [ "<ol>", "</ol>" ],
- :LOWERALPHA => [ "<ol>", "</ol>" ],
- :LABELED => [ "<dl>", "</dl>" ],
- :NOTE => [ "<table>", "</table>" ],
- }
-
- InlineTag = Struct.new(:bit, :on, :off)
-
- def initialize
- super
-
- init_tags
- end
-
- ##
- # Set up the standard mapping of attributes to HTML tags
-
- def init_tags
- @attr_tags = [
- InlineTag.new(RDoc::Markup::Attribute.bitmap_for(:BOLD), "<b>", "</b>"),
- InlineTag.new(RDoc::Markup::Attribute.bitmap_for(:TT), "<tt>", "</tt>"),
- InlineTag.new(RDoc::Markup::Attribute.bitmap_for(:EM), "<em>", "</em>"),
- ]
- end
-
- ##
- # Add a new set of HTML tags for an attribute. We allow separate start and
- # end tags for flexibility
-
- def add_tag(name, start, stop)
- @attr_tags << InlineTag.new(RDoc::Markup::Attribute.bitmap_for(name), start, stop)
- end
-
- ##
- # Given an HTML tag, decorate it with class information and the like if
- # required. This is a no-op in the base class, but is overridden in HTML
- # output classes that implement style sheets
-
- def annotate(tag)
- tag
- end
-
- ##
- # Here's the client side of the visitor pattern
-
- def start_accepting
- @res = []
- @list_stack = []
- end
-
- def end_accepting
- @res
- end
-
- def accept_paragraph(am, fragment)
- @res << Flow::P.new((convert_flow(am.flow(fragment.txt))))
- end
-
- def accept_verbatim(am, fragment)
- @res << Flow::VERB.new((convert_flow(am.flow(fragment.txt))))
- end
-
- def accept_rule(am, fragment)
- size = fragment.param
- size = 10 if size > 10
- @res << Flow::RULE.new(size)
- end
-
- def accept_list_start(am, fragment)
- @list_stack.push(@res)
- list = Flow::LIST.new(fragment.type)
- @res << list
- @res = list
- end
-
- def accept_list_end(am, fragment)
- @res = @list_stack.pop
- end
-
- def accept_list_item(am, fragment)
- @res << Flow::LI.new(fragment.param, convert_flow(am.flow(fragment.txt)))
- end
-
- def accept_blank_line(am, fragment)
- # @res << annotate("<p />") << "\n"
- end
-
- def accept_heading(am, fragment)
- @res << Flow::H.new(fragment.head_level, convert_flow(am.flow(fragment.txt)))
- end
-
- private
-
- def on_tags(res, item)
- attr_mask = item.turn_on
- return if attr_mask.zero?
-
- @attr_tags.each do |tag|
- if attr_mask & tag.bit != 0
- res << annotate(tag.on)
- end
- end
- end
-
- def off_tags(res, item)
- attr_mask = item.turn_off
- return if attr_mask.zero?
-
- @attr_tags.reverse_each do |tag|
- if attr_mask & tag.bit != 0
- res << annotate(tag.off)
- end
- end
- end
-
- def convert_flow(flow)
- res = ""
- flow.each do |item|
- case item
- when String
- res << convert_string(item)
- when AttrChanger
- off_tags(res, item)
- on_tags(res, item)
- when Special
- res << convert_special(item)
- else
- raise "Unknown flow element: #{item.inspect}"
- end
- end
- res
- end
-
- def convert_string(item)
- CGI.escapeHTML(item)
- end
-
- def convert_special(special)
- handled = false
- Attribute.each_name_of(special.type) do |name|
- method_name = "handle_special_#{name}"
- if self.respond_to? method_name
- special.text = send(method_name, special)
- handled = true
- end
- end
-
- raise "Unhandled special: #{special}" unless handled
-
- special.text
- end
-
- end
-
-end
-
diff --git a/lib/rdoc/markup/to_html.rb b/lib/rdoc/markup/to_html.rb
deleted file mode 100644
index 0165042d84..0000000000
--- a/lib/rdoc/markup/to_html.rb
+++ /dev/null
@@ -1,403 +0,0 @@
-require 'rdoc/markup/formatter'
-require 'rdoc/markup/fragments'
-require 'rdoc/markup/inline'
-
-require 'cgi'
-
-class RDoc::Markup::ToHtml < RDoc::Markup::Formatter
-
- LIST_TYPE_TO_HTML = {
- :BULLET => %w[<ul> </ul>],
- :NUMBER => %w[<ol> </ol>],
- :UPPERALPHA => %w[<ol> </ol>],
- :LOWERALPHA => %w[<ol> </ol>],
- :LABELED => %w[<dl> </dl>],
- :NOTE => %w[<table> </table>],
- }
-
- InlineTag = Struct.new(:bit, :on, :off)
-
- def initialize
- super
-
- # @in_tt - tt nested levels count
- # @tt_bit - cache
- @in_tt = 0
- @tt_bit = RDoc::Markup::Attribute.bitmap_for :TT
-
- # external hyperlinks
- @markup.add_special(/((link:|https?:|mailto:|ftp:|www\.)\S+\w)/, :HYPERLINK)
-
- # and links of the form <text>[<url>]
- @markup.add_special(/(((\{.*?\})|\b\S+?)\[\S+?\.\S+?\])/, :TIDYLINK)
-
- init_tags
- end
-
- ##
- # Converts a target url to one that is relative to a given path
-
- def self.gen_relative_url(path, target)
- from = File.dirname path
- to, to_file = File.split target
-
- from = from.split "/"
- to = to.split "/"
-
- while from.size > 0 and to.size > 0 and from[0] == to[0] do
- from.shift
- to.shift
- end
-
- from.fill ".."
- from.concat to
- from << to_file
- File.join(*from)
- end
-
- ##
- # Generate a hyperlink for url, labeled with text. Handle the
- # special cases for img: and link: described under handle_special_HYPERLINK
-
- def gen_url(url, text)
- if url =~ /([A-Za-z]+):(.*)/ then
- type = $1
- path = $2
- else
- type = "http"
- path = url
- url = "http://#{url}"
- end
-
- if type == "link" then
- url = if path[0, 1] == '#' then # is this meaningful?
- path
- else
- self.class.gen_relative_url @from_path, path
- end
- end
-
- if (type == "http" or type == "link") and
- url =~ /\.(gif|png|jpg|jpeg|bmp)$/ then
- "<img src=\"#{url}\" />"
- else
- "<a href=\"#{url}\">#{text.sub(%r{^#{type}:/*}, '')}</a>"
- end
- end
-
- ##
- # And we're invoked with a potential external hyperlink mailto:
- # just gets inserted. http: links are checked to see if they
- # reference an image. If so, that image gets inserted using an
- # <img> tag. Otherwise a conventional <a href> is used. We also
- # support a special type of hyperlink, link:, which is a reference
- # to a local file whose path is relative to the --op directory.
-
- def handle_special_HYPERLINK(special)
- url = special.text
- gen_url url, url
- end
-
- ##
- # Here's a hypedlink where the label is different to the URL
- # <label>[url] or {long label}[url]
-
- def handle_special_TIDYLINK(special)
- text = special.text
-
- return text unless text =~ /\{(.*?)\}\[(.*?)\]/ or text =~ /(\S+)\[(.*?)\]/
-
- label = $1
- url = $2
- gen_url url, label
- end
-
- ##
- # are we currently inside <tt> tags?
-
- def in_tt?
- @in_tt > 0
- end
-
- ##
- # is +tag+ a <tt> tag?
-
- def tt?(tag)
- tag.bit == @tt_bit
- end
-
- ##
- # Set up the standard mapping of attributes to HTML tags
-
- def init_tags
- @attr_tags = [
- InlineTag.new(RDoc::Markup::Attribute.bitmap_for(:BOLD), "<b>", "</b>"),
- InlineTag.new(RDoc::Markup::Attribute.bitmap_for(:TT), "<tt>", "</tt>"),
- InlineTag.new(RDoc::Markup::Attribute.bitmap_for(:EM), "<em>", "</em>"),
- ]
- end
-
- ##
- # Add a new set of HTML tags for an attribute. We allow separate start and
- # end tags for flexibility.
-
- def add_tag(name, start, stop)
- @attr_tags << InlineTag.new(RDoc::Markup::Attribute.bitmap_for(name), start, stop)
- end
-
- ##
- # Given an HTML tag, decorate it with class information and the like if
- # required. This is a no-op in the base class, but is overridden in HTML
- # output classes that implement style sheets.
-
- def annotate(tag)
- tag
- end
-
- ##
- # Here's the client side of the visitor pattern
-
- def start_accepting
- @res = ""
- @in_list_entry = []
- end
-
- def end_accepting
- @res
- end
-
- def accept_paragraph(am, fragment)
- @res << annotate("<p>") + "\n"
- @res << wrap(convert_flow(am.flow(fragment.txt)))
- @res << annotate("</p>") + "\n"
- end
-
- def accept_verbatim(am, fragment)
- @res << annotate("<pre>") + "\n"
- @res << CGI.escapeHTML(fragment.txt)
- @res << annotate("</pre>") << "\n"
- end
-
- def accept_rule(am, fragment)
- size = fragment.param
- size = 10 if size > 10
- @res << "<hr size=\"#{size}\"></hr>"
- end
-
- def accept_list_start(am, fragment)
- @res << html_list_name(fragment.type, true) << "\n"
- @in_list_entry.push false
- end
-
- def accept_list_end(am, fragment)
- if tag = @in_list_entry.pop
- @res << annotate(tag) << "\n"
- end
- @res << html_list_name(fragment.type, false) << "\n"
- end
-
- def accept_list_item(am, fragment)
- if tag = @in_list_entry.last
- @res << annotate(tag) << "\n"
- end
-
- @res << list_item_start(am, fragment)
-
- @res << wrap(convert_flow(am.flow(fragment.txt))) << "\n"
-
- @in_list_entry[-1] = list_end_for(fragment.type)
- end
-
- def accept_blank_line(am, fragment)
- # @res << annotate("<p />") << "\n"
- end
-
- def accept_heading(am, fragment)
- @res << convert_heading(fragment.head_level, am.flow(fragment.txt))
- end
-
- ##
- # This is a higher speed (if messier) version of wrap
-
- def wrap(txt, line_len = 76)
- res = ""
- sp = 0
- ep = txt.length
- while sp < ep
- # scan back for a space
- p = sp + line_len - 1
- if p >= ep
- p = ep
- else
- while p > sp and txt[p] != ?\s
- p -= 1
- end
- if p <= sp
- p = sp + line_len
- while p < ep and txt[p] != ?\s
- p += 1
- end
- end
- end
- res << txt[sp...p] << "\n"
- sp = p
- sp += 1 while sp < ep and txt[sp] == ?\s
- end
- res
- end
-
- private
-
- def on_tags(res, item)
- attr_mask = item.turn_on
- return if attr_mask.zero?
-
- @attr_tags.each do |tag|
- if attr_mask & tag.bit != 0
- res << annotate(tag.on)
- @in_tt += 1 if tt?(tag)
- end
- end
- end
-
- def off_tags(res, item)
- attr_mask = item.turn_off
- return if attr_mask.zero?
-
- @attr_tags.reverse_each do |tag|
- if attr_mask & tag.bit != 0
- @in_tt -= 1 if tt?(tag)
- res << annotate(tag.off)
- end
- end
- end
-
- def convert_flow(flow)
- res = ""
-
- flow.each do |item|
- case item
- when String
- res << convert_string(item)
- when RDoc::Markup::AttrChanger
- off_tags(res, item)
- on_tags(res, item)
- when RDoc::Markup::Special
- res << convert_special(item)
- else
- raise "Unknown flow element: #{item.inspect}"
- end
- end
-
- res
- end
-
- def convert_string(item)
- in_tt? ? convert_string_simple(item) : convert_string_fancy(item)
- end
-
- def convert_string_simple(item)
- CGI.escapeHTML item
- end
-
- ##
- # some of these patterns are taken from SmartyPants...
-
- def convert_string_fancy(item)
- # convert ampersand before doing anything else
- item.gsub(/&/, '&amp;').
-
- # convert -- to em-dash, (-- to en-dash)
- gsub(/---?/, '&#8212;'). #gsub(/--/, '&#8211;').
-
- # convert ... to elipsis (and make sure .... becomes .<elipsis>)
- gsub(/\.\.\.\./, '.&#8230;').gsub(/\.\.\./, '&#8230;').
-
- # convert single closing quote
- gsub(%r{([^ \t\r\n\[\{\(])\'}, '\1&#8217;'). # }
- gsub(%r{\'(?=\W|s\b)}, '&#8217;').
-
- # convert single opening quote
- gsub(/'/, '&#8216;').
-
- # convert double closing quote
- gsub(%r{([^ \t\r\n\[\{\(])\"(?=\W)}, '\1&#8221;'). # }
-
- # convert double opening quote
- gsub(/"/, '&#8220;').
-
- # convert copyright
- gsub(/\(c\)/, '&#169;').
-
- # convert registered trademark
- gsub(/\(r\)/, '&#174;')
- end
-
- def convert_special(special)
- handled = false
- RDoc::Markup::Attribute.each_name_of(special.type) do |name|
- method_name = "handle_special_#{name}"
- if self.respond_to? method_name
- special.text = send(method_name, special)
- handled = true
- end
- end
- raise "Unhandled special: #{special}" unless handled
- special.text
- end
-
- def convert_heading(level, flow)
- res =
- annotate("<h#{level}>") +
- convert_flow(flow) +
- annotate("</h#{level}>\n")
- end
-
- def html_list_name(list_type, is_open_tag)
- tags = LIST_TYPE_TO_HTML[list_type] || raise("Invalid list type: #{list_type.inspect}")
- annotate(tags[ is_open_tag ? 0 : 1])
- end
-
- def list_item_start(am, fragment)
- case fragment.type
- when :BULLET, :NUMBER then
- annotate("<li>")
-
- when :UPPERALPHA then
- annotate("<li type=\"A\">")
-
- when :LOWERALPHA then
- annotate("<li type=\"a\">")
-
- when :LABELED then
- annotate("<dt>") +
- convert_flow(am.flow(fragment.param)) +
- annotate("</dt>") +
- annotate("<dd>")
-
- when :NOTE then
- annotate("<tr>") +
- annotate("<td valign=\"top\">") +
- convert_flow(am.flow(fragment.param)) +
- annotate("</td>") +
- annotate("<td>")
- else
- raise "Invalid list type"
- end
- end
-
- def list_end_for(fragment_type)
- case fragment_type
- when :BULLET, :NUMBER, :UPPERALPHA, :LOWERALPHA then
- "</li>"
- when :LABELED then
- "</dd>"
- when :NOTE then
- "</td></tr>"
- else
- raise "Invalid list type"
- end
- end
-
-end
-
diff --git a/lib/rdoc/markup/to_html_crossref.rb b/lib/rdoc/markup/to_html_crossref.rb
deleted file mode 100644
index e73fbf5c8f..0000000000
--- a/lib/rdoc/markup/to_html_crossref.rb
+++ /dev/null
@@ -1,148 +0,0 @@
-require 'rdoc/markup/to_html'
-
-##
-# Subclass of the RDoc::Markup::ToHtml class that supports looking up words in
-# the AllReferences list. Those that are found (like AllReferences in this
-# comment) will be hyperlinked
-
-class RDoc::Markup::ToHtmlCrossref < RDoc::Markup::ToHtml
-
- attr_accessor :context
-
- # Regular expressions to match class and method references.
- #
- # 1.) There can be a '\' in front of text to suppress
- # any cross-references (note, however, that the single '\'
- # is written as '\\\\' in order to escape it twice, once
- # in the Ruby String literal and once in the regexp).
- # 2.) There can be a '::' in front of class names to reference
- # from the top-level namespace.
- # 3.) The method can be followed by parenthesis,
- # which may or may not have things inside (this
- # apparently is allowed for Fortran 95, but I also think that this
- # is a good idea for Ruby, as it is very reasonable to want to
- # reference a call with arguments).
- #
- # NOTE: In order to support Fortran 95 properly, the [A-Z] below
- # should be changed to [A-Za-z]. This slows down rdoc significantly,
- # however, and the Fortran 95 support is broken in any case due to
- # the return in handle_special_CROSSREF if the token consists
- # entirely of lowercase letters.
- #
- # The markup/cross-referencing engine needs a rewrite for
- # Fortran 95 to be supported properly.
- CLASS_REGEXP_STR = '\\\\?((?:\:{2})?[A-Z]\w*(?:\:\:\w+)*)'
- METHOD_REGEXP_STR = '(\w+[!?=]?)(?:\([\.\w+\*\/\+\-\=\<\>]*\))?'
-
- # Regular expressions matching text that should potentially have
- # cross-reference links generated are passed to add_special.
- # Note that these expressions are meant to pick up text for which
- # cross-references have been suppressed, since the suppression
- # characters are removed by the code that is triggered.
- CROSSREF_REGEXP = /(
- # A::B::C.meth
- #{CLASS_REGEXP_STR}[\.\#]#{METHOD_REGEXP_STR}
-
- # Stand-alone method (proceeded by a #)
- | \\?\##{METHOD_REGEXP_STR}
-
- # A::B::C
- # The stuff after CLASS_REGEXP_STR is a
- # nasty hack. CLASS_REGEXP_STR unfortunately matches
- # words like dog and cat (these are legal "class"
- # names in Fortran 95). When a word is flagged as a
- # potential cross-reference, limitations in the markup
- # engine suppress other processing, such as typesetting.
- # This is particularly noticeable for contractions.
- # In order that words like "can't" not
- # be flagged as potential cross-references, only
- # flag potential class cross-references if the character
- # after the cross-referece is a space or sentence
- # punctuation.
- | #{CLASS_REGEXP_STR}(?=[\s\)\.\?\!\,\;]|\z)
-
- # Things that look like filenames
- # The key thing is that there must be at least
- # one special character (period, slash, or
- # underscore).
- | [\/\w]+[_\/\.][\w\/\.]+
-
- # Things that have markup suppressed
- | \\[^\s]
- )/x
-
- ##
- # We need to record the html path of our caller so we can generate
- # correct relative paths for any hyperlinks that we find
-
- def initialize(from_path, context, show_hash)
- raise ArgumentError, 'from_path cannot be nil' if from_path.nil?
- super()
-
- @markup.add_special(CROSSREF_REGEXP, :CROSSREF)
-
- @from_path = from_path
- @context = context
- @show_hash = show_hash
-
- @seen = {}
- end
-
- ##
- # We're invoked when any text matches the CROSSREF pattern
- # (defined in MarkUp). If we fine the corresponding reference,
- # generate a hyperlink. If the name we're looking for contains
- # no punctuation, we look for it up the module/class chain. For
- # example, HyperlinkHtml is found, even without the Generator::
- # prefix, because we look for it in module Generator first.
-
- def handle_special_CROSSREF(special)
- name = special.text
-
- # This ensures that words entirely consisting of lowercase letters will
- # not have cross-references generated (to suppress lots of
- # erroneous cross-references to "new" in text, for instance)
- return name if name =~ /\A[a-z]*\z/
-
- return @seen[name] if @seen.include? name
-
- if name[0, 1] == '#' then
- lookup = name[1..-1]
- name = lookup unless @show_hash
- else
- lookup = name
- end
-
-
- # Find class, module, or method in class or module.
- #
- # Do not, however, use an if/elsif/else chain to do so. Instead, test
- # each possible pattern until one matches. The reason for this is that a
- # string like "YAML.txt" could be the txt() class method of class YAML (in
- # which case it would match the first pattern, which splits the string
- # into container and method components and looks up both) or a filename
- # (in which case it would match the last pattern, which just checks
- # whether the string as a whole is a known symbol).
-
- if /#{CLASS_REGEXP_STR}[\.\#]#{METHOD_REGEXP_STR}/ =~ lookup then
- container = $1
- method = $2
- ref = @context.find_symbol container, method
- end
-
- ref = @context.find_symbol lookup unless ref
-
- out = if lookup =~ /^\\/ then
- $'
- elsif ref and ref.document_self then
- "<a href=\"#{ref.as_href(@from_path)}\">#{name}</a>"
- else
- name
- end
-
- @seen[name] = out
-
- out
- end
-
-end
diff --git a/lib/rdoc/markup/to_latex.rb b/lib/rdoc/markup/to_latex.rb
deleted file mode 100644
index bbf958f2ed..0000000000
--- a/lib/rdoc/markup/to_latex.rb
+++ /dev/null
@@ -1,328 +0,0 @@
-require 'rdoc/markup/formatter'
-require 'rdoc/markup/fragments'
-require 'rdoc/markup/inline'
-
-require 'cgi'
-
-##
-# Convert SimpleMarkup to basic LaTeX report format.
-
-class RDoc::Markup::ToLaTeX < RDoc::Markup::Formatter
-
- BS = "\020" # \
- OB = "\021" # {
- CB = "\022" # }
- DL = "\023" # Dollar
-
- BACKSLASH = "#{BS}symbol#{OB}92#{CB}"
- HAT = "#{BS}symbol#{OB}94#{CB}"
- BACKQUOTE = "#{BS}symbol#{OB}0#{CB}"
- TILDE = "#{DL}#{BS}sim#{DL}"
- LESSTHAN = "#{DL}<#{DL}"
- GREATERTHAN = "#{DL}>#{DL}"
-
- def self.l(str)
- str.tr('\\', BS).tr('{', OB).tr('}', CB).tr('$', DL)
- end
-
- def l(arg)
- RDoc::Markup::ToLaTeX.l(arg)
- end
-
- LIST_TYPE_TO_LATEX = {
- :BULLET => [ l("\\begin{itemize}"), l("\\end{itemize}") ],
- :NUMBER => [ l("\\begin{enumerate}"), l("\\end{enumerate}"), "\\arabic" ],
- :UPPERALPHA => [ l("\\begin{enumerate}"), l("\\end{enumerate}"), "\\Alph" ],
- :LOWERALPHA => [ l("\\begin{enumerate}"), l("\\end{enumerate}"), "\\alph" ],
- :LABELED => [ l("\\begin{description}"), l("\\end{description}") ],
- :NOTE => [
- l("\\begin{tabularx}{\\linewidth}{@{} l X @{}}"),
- l("\\end{tabularx}") ],
- }
-
- InlineTag = Struct.new(:bit, :on, :off)
-
- def initialize
- init_tags
- @list_depth = 0
- @prev_list_types = []
- end
-
- ##
- # Set up the standard mapping of attributes to LaTeX
-
- def init_tags
- @attr_tags = [
- InlineTag.new(RDoc::Markup::Attribute.bitmap_for(:BOLD), l("\\textbf{"), l("}")),
- InlineTag.new(RDoc::Markup::Attribute.bitmap_for(:TT), l("\\texttt{"), l("}")),
- InlineTag.new(RDoc::Markup::Attribute.bitmap_for(:EM), l("\\emph{"), l("}")),
- ]
- end
-
- ##
- # Escape a LaTeX string
-
- def escape(str)
- $stderr.print "FE: ", str if $DEBUG_RDOC
- s = str.
- sub(/\s+$/, '').
- gsub(/([_\${}&%#])/, "#{BS}\\1").
- gsub(/\\/, BACKSLASH).
- gsub(/\^/, HAT).
- gsub(/~/, TILDE).
- gsub(/</, LESSTHAN).
- gsub(/>/, GREATERTHAN).
- gsub(/,,/, ",{},").
- gsub(/\`/, BACKQUOTE)
- $stderr.print "-> ", s, "\n" if $DEBUG_RDOC
- s
- end
-
- ##
- # Add a new set of LaTeX tags for an attribute. We allow
- # separate start and end tags for flexibility
-
- def add_tag(name, start, stop)
- @attr_tags << InlineTag.new(RDoc::Markup::Attribute.bitmap_for(name), start, stop)
- end
-
- ##
- # Here's the client side of the visitor pattern
-
- def start_accepting
- @res = ""
- @in_list_entry = []
- end
-
- def end_accepting
- @res.tr(BS, '\\').tr(OB, '{').tr(CB, '}').tr(DL, '$')
- end
-
- def accept_paragraph(am, fragment)
- @res << wrap(convert_flow(am.flow(fragment.txt)))
- @res << "\n"
- end
-
- def accept_verbatim(am, fragment)
- @res << "\n\\begin{code}\n"
- @res << fragment.txt.sub(/[\n\s]+\Z/, '')
- @res << "\n\\end{code}\n\n"
- end
-
- def accept_rule(am, fragment)
- size = fragment.param
- size = 10 if size > 10
- @res << "\n\n\\rule{\\linewidth}{#{size}pt}\n\n"
- end
-
- def accept_list_start(am, fragment)
- @res << list_name(fragment.type, true) << "\n"
- @in_list_entry.push false
- end
-
- def accept_list_end(am, fragment)
- if tag = @in_list_entry.pop
- @res << tag << "\n"
- end
- @res << list_name(fragment.type, false) << "\n"
- end
-
- def accept_list_item(am, fragment)
- if tag = @in_list_entry.last
- @res << tag << "\n"
- end
- @res << list_item_start(am, fragment)
- @res << wrap(convert_flow(am.flow(fragment.txt))) << "\n"
- @in_list_entry[-1] = list_end_for(fragment.type)
- end
-
- def accept_blank_line(am, fragment)
- # @res << "\n"
- end
-
- def accept_heading(am, fragment)
- @res << convert_heading(fragment.head_level, am.flow(fragment.txt))
- end
-
- ##
- # This is a higher speed (if messier) version of wrap
-
- def wrap(txt, line_len = 76)
- res = ""
- sp = 0
- ep = txt.length
- while sp < ep
- # scan back for a space
- p = sp + line_len - 1
- if p >= ep
- p = ep
- else
- while p > sp and txt[p] != ?\s
- p -= 1
- end
- if p <= sp
- p = sp + line_len
- while p < ep and txt[p] != ?\s
- p += 1
- end
- end
- end
- res << txt[sp...p] << "\n"
- sp = p
- sp += 1 while sp < ep and txt[sp] == ?\s
- end
- res
- end
-
- private
-
- def on_tags(res, item)
- attr_mask = item.turn_on
- return if attr_mask.zero?
-
- @attr_tags.each do |tag|
- if attr_mask & tag.bit != 0
- res << tag.on
- end
- end
- end
-
- def off_tags(res, item)
- attr_mask = item.turn_off
- return if attr_mask.zero?
-
- @attr_tags.reverse_each do |tag|
- if attr_mask & tag.bit != 0
- res << tag.off
- end
- end
- end
-
- def convert_flow(flow)
- res = ""
- flow.each do |item|
- case item
- when String
- $stderr.puts "Converting '#{item}'" if $DEBUG_RDOC
- res << convert_string(item)
- when AttrChanger
- off_tags(res, item)
- on_tags(res, item)
- when Special
- res << convert_special(item)
- else
- raise "Unknown flow element: #{item.inspect}"
- end
- end
- res
- end
-
- ##
- # some of these patterns are taken from SmartyPants...
-
- def convert_string(item)
- escape(item).
-
- # convert ... to elipsis (and make sure .... becomes .<elipsis>)
- gsub(/\.\.\.\./, '.\ldots{}').gsub(/\.\.\./, '\ldots{}').
-
- # convert single closing quote
- gsub(%r{([^ \t\r\n\[\{\(])\'}, '\1\'').
- gsub(%r{\'(?=\W|s\b)}, "'" ).
-
- # convert single opening quote
- gsub(/'/, '`').
-
- # convert double closing quote
- gsub(%r{([^ \t\r\n\[\{\(])\"(?=\W)}, "\\1''").
-
- # convert double opening quote
- gsub(/"/, "``").
-
- # convert copyright
- gsub(/\(c\)/, '\copyright{}')
-
- end
-
- def convert_special(special)
- handled = false
- Attribute.each_name_of(special.type) do |name|
- method_name = "handle_special_#{name}"
- if self.respond_to? method_name
- special.text = send(method_name, special)
- handled = true
- end
- end
- raise "Unhandled special: #{special}" unless handled
- special.text
- end
-
- def convert_heading(level, flow)
- res =
- case level
- when 1 then "\\chapter{"
- when 2 then "\\section{"
- when 3 then "\\subsection{"
- when 4 then "\\subsubsection{"
- else "\\paragraph{"
- end +
- convert_flow(flow) +
- "}\n"
- end
-
- def list_name(list_type, is_open_tag)
- tags = LIST_TYPE_TO_LATEX[list_type] || raise("Invalid list type: #{list_type.inspect}")
- if tags[2] # enumerate
- if is_open_tag
- @list_depth += 1
- if @prev_list_types[@list_depth] != tags[2]
- case @list_depth
- when 1
- roman = "i"
- when 2
- roman = "ii"
- when 3
- roman = "iii"
- when 4
- roman = "iv"
- else
- raise("Too deep list: level #{@list_depth}")
- end
- @prev_list_types[@list_depth] = tags[2]
- return l("\\renewcommand{\\labelenum#{roman}}{#{tags[2]}{enum#{roman}}}") + "\n" + tags[0]
- end
- else
- @list_depth -= 1
- end
- end
- tags[ is_open_tag ? 0 : 1]
- end
-
- def list_item_start(am, fragment)
- case fragment.type
- when :BULLET, :NUMBER, :UPPERALPHA, :LOWERALPHA then
- "\\item "
-
- when :LABELED then
- "\\item[" + convert_flow(am.flow(fragment.param)) + "] "
-
- when :NOTE then
- convert_flow(am.flow(fragment.param)) + " & "
- else
- raise "Invalid list type"
- end
- end
-
- def list_end_for(fragment_type)
- case fragment_type
- when :BULLET, :NUMBER, :UPPERALPHA, :LOWERALPHA, :LABELED then
- ""
- when :NOTE
- "\\\\\n"
- else
- raise "Invalid list type"
- end
- end
-
-end
-
diff --git a/lib/rdoc/markup/to_test.rb b/lib/rdoc/markup/to_test.rb
deleted file mode 100644
index ce6aff6e9a..0000000000
--- a/lib/rdoc/markup/to_test.rb
+++ /dev/null
@@ -1,50 +0,0 @@
-require 'rdoc/markup'
-require 'rdoc/markup/formatter'
-
-##
-# This Markup outputter is used for testing purposes.
-
-class RDoc::Markup::ToTest < RDoc::Markup::Formatter
-
- def start_accepting
- @res = []
- end
-
- def end_accepting
- @res
- end
-
- def accept_paragraph(am, fragment)
- @res << fragment.to_s
- end
-
- def accept_verbatim(am, fragment)
- @res << fragment.to_s
- end
-
- def accept_list_start(am, fragment)
- @res << fragment.to_s
- end
-
- def accept_list_end(am, fragment)
- @res << fragment.to_s
- end
-
- def accept_list_item(am, fragment)
- @res << fragment.to_s
- end
-
- def accept_blank_line(am, fragment)
- @res << fragment.to_s
- end
-
- def accept_heading(am, fragment)
- @res << fragment.to_s
- end
-
- def accept_rule(am, fragment)
- @res << fragment.to_s
- end
-
-end
-
diff --git a/lib/rdoc/markup/to_texinfo.rb b/lib/rdoc/markup/to_texinfo.rb
deleted file mode 100644
index 65a1608c4d..0000000000
--- a/lib/rdoc/markup/to_texinfo.rb
+++ /dev/null
@@ -1,69 +0,0 @@
-require 'rdoc/markup/formatter'
-require 'rdoc/markup/fragments'
-require 'rdoc/markup/inline'
-
-require 'rdoc/markup'
-require 'rdoc/markup/formatter'
-
-##
-# Convert SimpleMarkup to basic TexInfo format
-#
-# TODO: WTF is AttributeManager for?
-#
-class RDoc::Markup::ToTexInfo < RDoc::Markup::Formatter
-
- def start_accepting
- @text = []
- end
-
- def end_accepting
- @text.join("\n")
- end
-
- def accept_paragraph(attributes, text)
- @text << format(text)
- end
-
- def accept_verbatim(attributes, text)
- @text << "@verb{|#{format(text)}|}"
- end
-
- def accept_heading(attributes, text)
- heading = ['@majorheading', '@chapheading'][text.head_level - 1] || '@heading'
- @text << "#{heading} #{format(text)}"
- end
-
- def accept_list_start(attributes, text)
- @text << '@itemize @bullet'
- end
-
- def accept_list_end(attributes, text)
- @text << '@end itemize'
- end
-
- def accept_list_item(attributes, text)
- @text << "@item\n#{format(text)}"
- end
-
- def accept_blank_line(attributes, text)
- @text << "\n"
- end
-
- def accept_rule(attributes, text)
- @text << '-----'
- end
-
- def format(text)
- text.txt.
- gsub(/@/, "@@").
- gsub(/\{/, "@{").
- gsub(/\}/, "@}").
- # gsub(/,/, "@,"). # technically only required in cross-refs
- gsub(/\+([\w]+)\+/, "@code{\\1}").
- gsub(/\<tt\>([^<]+)\<\/tt\>/, "@code{\\1}").
- gsub(/\*([\w]+)\*/, "@strong{\\1}").
- gsub(/\<b\>([^<]+)\<\/b\>/, "@strong{\\1}").
- gsub(/_([\w]+)_/, "@emph{\\1}").
- gsub(/\<em\>([^<]+)\<\/em\>/, "@emph{\\1}")
- end
-end
diff --git a/lib/rdoc/options.rb b/lib/rdoc/options.rb
index 2b069f4265..7e35abdb0b 100644
--- a/lib/rdoc/options.rb
+++ b/lib/rdoc/options.rb
@@ -1,617 +1,561 @@
# We handle the parsing of options, and subsequently as a singleton
# object to be queried for option values
-require "rdoc/ri/paths"
-require 'optparse'
+require "rdoc/ri/ri_paths"
-class RDoc::Options
+class Options
- ##
- # Should the output be placed into a single file
+ require 'singleton'
+ require 'getoptlong'
- attr_reader :all_one_file
-
- ##
- # Character-set
-
- attr_reader :charset
-
- ##
- # URL of stylesheet
-
- attr_reader :css
-
- ##
- # Should diagrams be drawn
-
- attr_reader :diagram
-
- ##
- # Files matching this pattern will be excluded
+ include Singleton
+ # files matching this pattern will be excluded
attr_accessor :exclude
- ##
- # Additional attr_... style method flags
-
- attr_reader :extra_accessor_flags
-
- ##
- # Pattern for additional attr_... style methods
-
- attr_accessor :extra_accessors
-
- ##
- # Should we draw fileboxes in diagrams
-
- attr_reader :fileboxes
-
- ##
- # The list of files to be processed
-
- attr_accessor :files
-
- ##
- # Scan newer sources than the flag file if true.
-
- attr_reader :force_update
-
- ##
- # Description of the output generator (set with the <tt>-fmt</tt> option)
-
- attr_accessor :generator
-
- ##
- # Formatter to mark up text with
-
- attr_accessor :formatter
-
- ##
- # image format for diagrams
-
- attr_reader :image_format
-
- ##
- # Include line numbers in the source listings
-
- attr_reader :include_line_numbers
-
- ##
- # Should source code be included inline, or displayed in a popup
-
- attr_accessor :inline_source
-
- ##
- # Name of the file, class or module to display in the initial index page (if
- # not specified the first file we encounter is used)
+ # the name of the output directory
+ attr_accessor :op_dir
+
+ # the name to use for the output
+ attr_reader :op_name
+ # include private and protected methods in the
+ # output
+ attr_accessor :show_all
+
+ # name of the file, class or module to display in
+ # the initial index page (if not specified
+ # the first file we encounter is used)
attr_accessor :main_page
- ##
- # Merge into classes of the same name when generating ri
-
+ # merge into classes of the name name when generating ri
attr_reader :merge
- ##
- # The name of the output directory
-
- attr_accessor :op_dir
-
- ##
- # The name to use for the output
-
- attr_accessor :op_name
-
- ##
- # Are we promiscuous about showing module contents across multiple files
+ # Don't display progress as we process the files
+ attr_reader :quiet
- attr_reader :promiscuous
+ # description of the output generator (set with the <tt>-fmt</tt>
+ # option
+ attr_accessor :generator
- ##
- # Array of directories to search for files to satisfy an :include:
+ # and the list of files to be processed
+ attr_reader :files
+ # array of directories to search for files to satisfy an :include:
attr_reader :rdoc_include
- ##
- # Include private and protected methods in the output
-
- attr_accessor :show_all
-
- ##
- # Include the '#' at the front of hyperlinked instance method names
+ # title to be used out the output
+ #attr_writer :title
- attr_reader :show_hash
-
- ##
- # The number of columns in a tab
-
- attr_reader :tab_width
-
- ##
# template to be used when generating output
-
attr_reader :template
- ##
- # Template class for file generation
- #--
- # HACK around dependencies in lib/rdoc/generator/html.rb
-
- attr_accessor :template_class # :nodoc:
+ # should diagrams be drawn
+ attr_reader :diagram
- ##
- # Documentation title
+ # should we draw fileboxes in diagrams
+ attr_reader :fileboxes
- attr_reader :title
+ # include the '#' at the front of hyperlinked instance method names
+ attr_reader :show_hash
- ##
- # Verbosity, zero means quiet
+ # image format for diagrams
+ attr_reader :image_format
- attr_accessor :verbosity
+ # character-set
+ attr_reader :charset
- ##
- # URL of web cvs frontend
+ # should source code be included inline, or displayed in a popup
+ attr_reader :inline_source
- attr_reader :webcvs
+ # should the output be placed into a single file
+ attr_reader :all_one_file
- def initialize(generators = {}) # :nodoc:
- @op_dir = "doc"
- @op_name = nil
- @show_all = false
- @main_page = nil
- @merge = false
- @exclude = []
- @generators = generators
- @generator_name = 'html'
- @generator = @generators[@generator_name]
- @rdoc_include = []
- @title = nil
- @template = nil
- @template_class = nil
- @diagram = false
- @fileboxes = false
- @show_hash = false
- @image_format = 'png'
- @inline_source = false
- @all_one_file = false
- @tab_width = 8
- @include_line_numbers = false
- @extra_accessor_flags = {}
- @promiscuous = false
- @force_update = false
- @verbosity = 1
-
- @css = nil
- @webcvs = nil
-
- @charset = 'utf-8'
- end
+ # the number of columns in a tab
+ attr_reader :tab_width
- ##
- # Parse command line options.
-
- def parse(argv)
- accessors = []
-
- opts = OptionParser.new do |opt|
- opt.program_name = File.basename $0
- opt.version = RDoc::VERSION
- opt.release = nil
- opt.summary_indent = ' ' * 4
- opt.banner = <<-EOF
-Usage: #{opt.program_name} [options] [names...]
-
- Files are parsed, and the information they contain collected, before any
- output is produced. This allows cross references between all files to be
- resolved. If a name is a directory, it is traversed. If no names are
- specified, all Ruby files in the current directory (and subdirectories) are
- processed.
-
- How RDoc generates output depends on the output formatter being used, and on
- the options you give.
-
- - HTML output is normally produced into a number of separate files
- (one per class, module, and file, along with various indices).
- These files will appear in the directory given by the --op
- option (doc/ by default).
-
- - XML output by default is written to standard output. If a
- --opname option is given, the output will instead be written
- to a file with that name in the output directory.
-
- - .chm files (Windows help files) are written in the --op directory.
- If an --opname parameter is present, that name is used, otherwise
- the file will be called rdoc.chm.
- EOF
-
- opt.separator nil
- opt.separator "Options:"
- opt.separator nil
-
- opt.on("--accessor=ACCESSORS", "-A", Array,
- "A comma separated list of additional class",
- "methods that should be treated like",
- "'attr_reader' and friends.",
- " ",
- "Option may be repeated.",
- " ",
- "Each accessorname may have '=text'",
- "appended, in which case that text appears",
- "where the r/w/rw appears for normal.",
- "accessors") do |value|
- value.each do |accessor|
- if accessor =~ /^(\w+)(=(.*))?$/
- accessors << $1
- @extra_accessor_flags[$1] = $3
- end
- end
- end
+ # include line numbers in the source listings
+ attr_reader :include_line_numbers
- opt.separator nil
+ # pattern for additional attr_... style methods
+ attr_reader :extra_accessors
+ attr_reader :extra_accessor_flags
- opt.on("--all", "-a",
- "Include all methods (not just public) in",
- "the output.") do |value|
- @show_all = value
- end
+ # URL of stylesheet
+ attr_reader :css
- opt.separator nil
+ # URL of web cvs frontend
+ attr_reader :webcvs
- opt.on("--charset=CHARSET", "-c",
- "Specifies the output HTML character-set.") do |value|
- @charset = value
- end
+ # Are we promiscuous about showing module contents across
+ # multiple files
+ attr_reader :promiscuous
- opt.separator nil
+ # scan newer sources than the flag file if true.
+ attr_reader :force_update
- opt.on("--debug", "-D",
- "Displays lots on internal stuff.") do |value|
- $DEBUG_RDOC = value
+ module OptionList
+
+ OPTION_LIST = [
+ [ "--accessor", "-A", "accessorname[,..]",
+ "comma separated list of additional class methods\n" +
+ "that should be treated like 'attr_reader' and\n" +
+ "friends. Option may be repeated. Each accessorname\n" +
+ "may have '=text' appended, in which case that text\n" +
+ "appears where the r/w/rw appears for normal accessors."],
+
+ [ "--all", "-a", nil,
+ "include all methods (not just public)\nin the output" ],
+
+ [ "--charset", "-c", "charset",
+ "specifies HTML character-set" ],
+
+ [ "--debug", "-D", nil,
+ "displays lots on internal stuff" ],
+
+ [ "--diagram", "-d", nil,
+ "Generate diagrams showing modules and classes.\n" +
+ "You need dot V1.8.6 or later to use the --diagram\n" +
+ "option correctly. Dot is available from\n"+
+ "http://www.research.att.com/sw/tools/graphviz/" ],
+
+ [ "--exclude", "-x", "pattern",
+ "do not process files or directories matching\n" +
+ "pattern. Files given explicitly on the command\n" +
+ "line will never be excluded." ],
+
+ [ "--extension", "-E", "new=old",
+ "Treat files ending with .new as if they ended with\n" +
+ ".old. Using '-E cgi=rb' will cause xxx.cgi to be\n" +
+ "parsed as a Ruby file"],
+
+ [ "--fileboxes", "-F", nil,
+ "classes are put in boxes which represents\n" +
+ "files, where these classes reside. Classes\n" +
+ "shared between more than one file are\n" +
+ "shown with list of files that sharing them.\n" +
+ "Silently discarded if --diagram is not given\n" +
+ "Experimental." ],
+
+ [ "--force-update", "-U", nil,
+ "forces to scan all sources even if newer than\n" +
+ "the flag file." ],
+
+ [ "--fmt", "-f", "format name",
+ "set the output formatter (see below)" ],
+
+ [ "--help", "-h", nil,
+ "you're looking at it" ],
+
+ [ "--help-output", "-O", nil,
+ "explain the various output options" ],
+
+ [ "--image-format", "-I", "gif/png/jpg/jpeg",
+ "Sets output image format for diagrams. Can\n" +
+ "be png, gif, jpeg, jpg. If this option is\n" +
+ "omitted, png is used. Requires --diagram." ],
+
+ [ "--include", "-i", "dir[,dir...]",
+ "set (or add to) the list of directories\n" +
+ "to be searched when satisfying :include:\n" +
+ "requests. Can be used more than once." ],
+
+ [ "--inline-source", "-S", nil,
+ "Show method source code inline, rather\n" +
+ "than via a popup link" ],
+
+ [ "--line-numbers", "-N", nil,
+ "Include line numbers in the source code" ],
+
+ [ "--main", "-m", "name",
+ "'name' will be the initial page displayed" ],
+
+ [ "--merge", "-M", nil,
+ "when creating ri output, merge processed classes\n" +
+ "into previously documented classes of the name name"],
+
+ [ "--one-file", "-1", nil,
+ "put all the output into a single file" ],
+
+ [ "--op", "-o", "dir",
+ "set the output directory" ],
+
+ [ "--opname", "-n", "name",
+ "Set the 'name' of the output. Has no\n" +
+ "effect for HTML." ],
+
+ [ "--promiscuous", "-p", nil,
+ "When documenting a file that contains a module\n" +
+ "or class also defined in other files, show\n" +
+ "all stuff for that module/class in each files\n" +
+ "page. By default, only show stuff defined in\n" +
+ "that particular file." ],
+
+ [ "--quiet", "-q", nil,
+ "don't show progress as we parse" ],
+
+ [ "--ri", "-r", nil,
+ "generate output for use by 'ri.' The files are\n" +
+ "stored in the '.rdoc' directory under your home\n"+
+ "directory unless overridden by a subsequent\n" +
+ "--op parameter, so no special privileges are needed." ],
+
+ [ "--ri-site", "-R", nil,
+ "generate output for use by 'ri.' The files are\n" +
+ "stored in a site-wide directory, making them accessible\n"+
+ "to others, so special privileges are needed." ],
+
+ [ "--ri-system", "-Y", nil,
+ "generate output for use by 'ri.' The files are\n" +
+ "stored in a system-level directory, making them accessible\n"+
+ "to others, so special privileges are needed. This option\n"+
+ "is intended to be used during Ruby installations" ],
+
+ [ "--show-hash", "-H", nil,
+ "A name of the form #name in a comment\n" +
+ "is a possible hyperlink to an instance\n" +
+ "method name. When displayed, the '#' is\n" +
+ "removed unless this option is specified" ],
+
+ [ "--style", "-s", "stylesheet url",
+ "specifies the URL of a separate stylesheet." ],
+
+ [ "--tab-width", "-w", "n",
+ "Set the width of tab characters (default 8)"],
+
+ [ "--template", "-T", "template name",
+ "Set the template used when generating output" ],
+
+ [ "--title", "-t", "text",
+ "Set 'txt' as the title for the output" ],
+
+ [ "--version", "-v", nil,
+ "display RDoc's version" ],
+
+ [ "--webcvs", "-W", "url",
+ "Specify a URL for linking to a web frontend\n" +
+ "to CVS. If the URL contains a '\%s', the\n" +
+ "name of the current file will be substituted;\n" +
+ "if the URL doesn't contain a '\%s', the\n" +
+ "filename will be appended to it." ],
+ ]
+
+ def OptionList.options
+ OPTION_LIST.map do |long, short, arg,|
+ [ long,
+ short,
+ arg ? GetoptLong::REQUIRED_ARGUMENT : GetoptLong::NO_ARGUMENT
+ ]
end
+ end
- opt.separator nil
-
- opt.on("--diagram", "-d",
- "Generate diagrams showing modules and",
- "classes. You need dot V1.8.6 or later to",
- "use the --diagram option correctly. Dot is",
- "available from http://graphviz.org") do |value|
- check_diagram
- @diagram = true
- end
- opt.separator nil
+ def OptionList.strip_output(text)
+ text =~ /^\s+/
+ leading_spaces = $&
+ text.gsub!(/^#{leading_spaces}/, '')
+ $stdout.puts text
+ end
- opt.on("--exclude=PATTERN", "-x", Regexp,
- "Do not process files or directories",
- "matching PATTERN.") do |value|
- @exclude << value
- end
- opt.separator nil
+ # Show an error and exit
- opt.on("--extension=NEW=OLD", "-E",
- "Treat files ending with .new as if they",
- "ended with .old. Using '-E cgi=rb' will",
- "cause xxx.cgi to be parsed as a Ruby file.") do |value|
- new, old = value.split(/=/, 2)
+ def OptionList.error(msg)
+ $stderr.puts
+ $stderr.puts msg
+ $stderr.puts "\nFor help on options, try 'rdoc --help'\n\n"
+ exit 1
+ end
- unless new and old then
- raise OptionParser::InvalidArgument, "Invalid parameter to '-E'"
+ # Show usage and exit
+
+ def OptionList.usage(generator_names)
+
+ puts
+ puts(VERSION_STRING)
+ puts
+
+ name = File.basename($0)
+ OptionList.strip_output(<<-EOT)
+ Usage:
+
+ #{name} [options] [names...]
+
+ Files are parsed, and the information they contain
+ collected, before any output is produced. This allows cross
+ references between all files to be resolved. If a name is a
+ directory, it is traversed. If no names are specified, all
+ Ruby files in the current directory (and subdirectories) are
+ processed.
+
+ Options:
+
+ EOT
+
+ OPTION_LIST.each do |long, short, arg, desc|
+ opt = sprintf("%20s", "#{long}, #{short}")
+ oparg = sprintf("%-7s", arg)
+ print "#{opt} #{oparg}"
+ desc = desc.split("\n")
+ if arg.nil? || arg.length < 7
+ puts desc.shift
+ else
+ puts
end
-
- unless RDoc::ParserFactory.alias_extension old, new then
- raise OptionParser::InvalidArgument, "Unknown extension .#{old} to -E"
+ desc.each do |line|
+ puts(" "*28 + line)
end
+ puts
end
- opt.separator nil
-
- opt.on("--fileboxes", "-F",
- "Classes are put in boxes which represents",
- "files, where these classes reside. Classes",
- "shared between more than one file are",
- "shown with list of files that are sharing",
- "them. Silently discarded if --diagram is",
- "not given.") do |value|
- @fileboxes = value
- end
-
- opt.separator nil
+ puts "\nAvailable output formatters: " +
+ generator_names.sort.join(', ') + "\n\n"
- opt.on("--force-update", "-U",
- "Forces rdoc to scan all sources even if",
- "newer than the flag file.") do |value|
- @force_update = value
- end
-
- opt.separator nil
-
- opt.on("--fmt=FORMAT", "--format=FORMAT", "-f", @generators.keys,
- "Set the output formatter.") do |value|
- @generator_name = value.downcase
- setup_generator
- end
-
- opt.separator nil
-
- image_formats = %w[gif png jpg jpeg]
- opt.on("--image-format=FORMAT", "-I", image_formats,
- "Sets output image format for diagrams. Can",
- "be #{image_formats.join ', '}. If this option",
- "is omitted, png is used. Requires",
- "diagrams.") do |value|
- @image_format = value
- end
-
- opt.separator nil
-
- opt.on("--include=DIRECTORIES", "-i", Array,
- "set (or add to) the list of directories to",
- "be searched when satisfying :include:",
- "requests. Can be used more than once.") do |value|
- @rdoc_include.concat value.map { |dir| dir.strip }
- end
+ puts "For information on where the output goes, use\n\n"
+ puts " rdoc --help-output\n\n"
- opt.separator nil
-
- opt.on("--inline-source", "-S",
- "Show method source code inline, rather than",
- "via a popup link.") do |value|
- @inline_source = value
- end
-
- opt.separator nil
-
- opt.on("--line-numbers", "-N",
- "Include line numbers in the source code.") do |value|
- @include_line_numbers = value
- end
-
- opt.separator nil
-
- opt.on("--main=NAME", "-m",
- "NAME will be the initial page displayed.") do |value|
- @main_page = value
- end
-
- opt.separator nil
-
- opt.on("--merge", "-M",
- "When creating ri output, merge previously",
- "processed classes into previously",
- "documented classes of the same name.") do |value|
- @merge = value
- end
-
- opt.separator nil
-
- opt.on("--one-file", "-1",
- "Put all the output into a single file.") do |value|
- @all_one_file = value
- @inline_source = value if value
- @template = 'one_page_html'
- end
-
- opt.separator nil
+ exit 0
+ end
- opt.on("--op=DIR", "-o",
- "Set the output directory.") do |value|
- @op_dir = value
- end
+ def OptionList.help_output
+ OptionList.strip_output(<<-EOT)
+ How RDoc generates output depends on the output formatter being
+ used, and on the options you give.
- opt.separator nil
+ - HTML output is normally produced into a number of separate files
+ (one per class, module, and file, along with various indices).
+ These files will appear in the directory given by the --op
+ option (doc/ by default).
- opt.on("--opname=NAME", "-n",
- "Set the NAME of the output. Has no effect",
- "for HTML.") do |value|
- @op_name = value
- end
+ - XML output by default is written to standard output. If a
+ --opname option is given, the output will instead be written
+ to a file with that name in the output directory.
- opt.separator nil
-
- opt.on("--promiscuous", "-p",
- "When documenting a file that contains a",
- "module or class also defined in other",
- "files, show all stuff for that module or",
- "class in each files page. By default, only",
- "show stuff defined in that particular file.") do |value|
- @promiscuous = value
- end
+ - .chm files (Windows help files) are written in the --op directory.
+ If an --opname parameter is present, that name is used, otherwise
+ the file will be called rdoc.chm.
- opt.separator nil
+ For information on other RDoc options, use "rdoc --help".
+ EOT
+ exit 0
+ end
+ end
- opt.on("--quiet", "-q",
- "Don't show progress as we parse.") do |value|
- @verbosity = 0
- end
+ # Parse command line options. We're passed a hash containing
+ # output generators, keyed by the generator name
+
+ def parse(argv, generators)
+ old_argv = ARGV.dup
+ begin
+ ARGV.replace(argv)
+ @op_dir = "doc"
+ @op_name = nil
+ @show_all = false
+ @main_page = nil
+ @marge = false
+ @exclude = []
+ @quiet = false
+ @generator_name = 'html'
+ @generator = generators[@generator_name]
+ @rdoc_include = []
+ @title = nil
+ @template = nil
+ @diagram = false
+ @fileboxes = false
+ @show_hash = false
+ @image_format = 'png'
+ @inline_source = false
+ @all_one_file = false
+ @tab_width = 8
+ @include_line_numbers = false
+ @extra_accessor_flags = {}
+ @promiscuous = false
+ @force_update = false
+
+ @css = nil
+ @webcvs = nil
+
+ @charset = case $KCODE
+ when /^S/i
+ 'Shift_JIS'
+ when /^E/i
+ 'EUC-JP'
+ else
+ 'iso-8859-1'
+ end
+
+ accessors = []
+
+ go = GetoptLong.new(*OptionList.options)
+ go.quiet = true
+
+ go.each do |opt, arg|
+ case opt
+ when "--all" then @show_all = true
+ when "--charset" then @charset = arg
+ when "--debug" then $DEBUG = true
+ when "--exclude" then @exclude << Regexp.new(arg)
+ when "--inline-source" then @inline_source = true
+ when "--line-numbers" then @include_line_numbers = true
+ when "--main" then @main_page = arg
+ when "--merge" then @merge = true
+ when "--one-file" then @all_one_file = @inline_source = true
+ when "--op" then @op_dir = arg
+ when "--opname" then @op_name = arg
+ when "--promiscuous" then @promiscuous = true
+ when "--quiet" then @quiet = true
+ when "--show-hash" then @show_hash = true
+ when "--style" then @css = arg
+ when "--template" then @template = arg
+ when "--title" then @title = arg
+ when "--webcvs" then @webcvs = arg
+
+ when "--accessor"
+ arg.split(/,/).each do |accessor|
+ if accessor =~ /^(\w+)(=(.*))?$/
+ accessors << $1
+ @extra_accessor_flags[$1] = $3
+ end
+ end
- opt.on("--verbose", "-v",
- "Display extra progress as we parse.") do |value|
- @verbosity = 2
- end
+ when "--diagram"
+ check_diagram
+ @diagram = true
+ when "--fileboxes"
+ @fileboxes = true if @diagram
- opt.separator nil
+ when "--fmt"
+ @generator_name = arg.downcase
+ setup_generator(generators)
- opt.on("--ri", "-r",
- "Generate output for use by `ri`. The files",
- "are stored in the '.rdoc' directory under",
- "your home directory unless overridden by a",
- "subsequent --op parameter, so no special",
- "privileges are needed.") do |value|
- @generator_name = "ri"
- @op_dir = RDoc::RI::Paths::HOMEDIR
- setup_generator
- end
+ when "--help"
+ OptionList.usage(generators.keys)
- opt.separator nil
+ when "--help-output"
+ OptionList.help_output
- opt.on("--ri-site", "-R",
- "Generate output for use by `ri`. The files",
- "are stored in a site-wide directory,",
- "making them accessible to others, so",
- "special privileges are needed.") do |value|
- @generator_name = "ri"
- @op_dir = RDoc::RI::Paths::SITEDIR
- setup_generator
- end
+ when "--image-format"
+ if ['gif', 'png', 'jpeg', 'jpg'].include?(arg)
+ @image_format = arg
+ else
+ raise GetoptLong::InvalidOption.new("unknown image format: #{arg}")
+ end
- opt.separator nil
-
- opt.on("--ri-system", "-Y",
- "Generate output for use by `ri`. The files",
- "are stored in a site-wide directory,",
- "making them accessible to others, so",
- "special privileges are needed. This",
- "option is intended to be used during Ruby",
- "installation.") do |value|
- @generator_name = "ri"
- @op_dir = RDoc::RI::Paths::SYSDIR
- setup_generator
- end
+ when "--include"
+ @rdoc_include.concat arg.split(/\s*,\s*/)
+
+ when "--ri", "--ri-site", "--ri-system"
+ @generator_name = "ri"
+ @op_dir = case opt
+ when "--ri" then RI::Paths::HOMEDIR
+ when "--ri-site" then RI::Paths::SITEDIR
+ when "--ri-system" then RI::Paths::SYSDIR
+ else fail opt
+ end
+ setup_generator(generators)
+
+ when "--tab-width"
+ begin
+ @tab_width = Integer(arg)
+ rescue
+ $stderr.puts "Invalid tab width: '#{arg}'"
+ exit 1
+ end
- opt.separator nil
+ when "--extension"
+ new, old = arg.split(/=/, 2)
+ OptionList.error("Invalid parameter to '-E'") unless new && old
+ unless RDoc::ParserFactory.alias_extension(old, new)
+ OptionList.error("Unknown extension .#{old} to -E")
+ end
- opt.on("--show-hash", "-H",
- "A name of the form #name in a comment is a",
- "possible hyperlink to an instance method",
- "name. When displayed, the '#' is removed",
- "unless this option is specified.") do |value|
- @show_hash = value
- end
+ when "--force-update"
+ @force_update = true
- opt.separator nil
+ when "--version"
+ puts VERSION_STRING
+ exit
+ end
- opt.on("--style=URL", "-s",
- "Specifies the URL of a separate stylesheet.") do |value|
- @css = value
end
- opt.separator nil
-
- opt.on("--tab-width=WIDTH", "-w", OptionParser::DecimalInteger,
- "Set the width of tab characters.") do |value|
- @tab_width = value
- end
+ @files = ARGV.dup
- opt.separator nil
+ @rdoc_include << "." if @rdoc_include.empty?
- opt.on("--template=NAME", "-T",
- "Set the template used when generating",
- "output.") do |value|
- @template = value
+ if @exclude.empty?
+ @exclude = nil
+ else
+ @exclude = Regexp.new(@exclude.join("|"))
end
- opt.separator nil
+ check_files
- opt.on("--title=TITLE", "-t",
- "Set TITLE as the title for HTML output.") do |value|
- @title = value
- end
+ # If no template was specified, use the default
+ # template for the output formatter
- opt.separator nil
+ @template ||= @generator_name
- opt.on("--webcvs=URL", "-W",
- "Specify a URL for linking to a web frontend",
- "to CVS. If the URL contains a '\%s', the",
- "name of the current file will be",
- "substituted; if the URL doesn't contain a",
- "'\%s', the filename will be appended to it.") do |value|
- @webcvs = value
+ # Generate a regexp from the accessors
+ unless accessors.empty?
+ re = '^(' + accessors.map{|a| Regexp.quote(a)}.join('|') + ')$'
+ @extra_accessors = Regexp.new(re)
end
- end
-
- argv.insert(0, *ENV['RDOCOPT'].split) if ENV['RDOCOPT']
-
- opts.parse! argv
- @files = argv.dup
+ rescue GetoptLong::InvalidOption, GetoptLong::MissingArgument => error
+ OptionList.error(error.message)
- @rdoc_include << "." if @rdoc_include.empty?
-
- if @exclude.empty? then
- @exclude = nil
- else
- @exclude = Regexp.new(@exclude.join("|"))
+ ensure
+ ARGV.replace(old_argv)
end
+ end
- check_files
-
- # If no template was specified, use the default template for the output
- # formatter
-
- @template ||= @generator_name
- # Generate a regexp from the accessors
- unless accessors.empty? then
- re = '^(' + accessors.map { |a| Regexp.quote a }.join('|') + ')$'
- @extra_accessors = Regexp.new re
- end
-
- rescue OptionParser::InvalidArgument, OptionParser::InvalidOption => e
- puts opts
- puts
- puts e
- exit 1
+ def title
+ @title ||= "RDoc Documentation"
end
-
- ##
- # Set the title, but only if not already set. This means that a title set
- # from the command line trumps one set in a source file
+
+ # Set the title, but only if not already set. This means that a title set from
+ # the command line trumps one set in a source file
def title=(string)
@title ||= string
end
- ##
- # Don't display progress as we process the files
-
- def quiet
- @verbosity.zero?
- end
-
- def quiet=(bool)
- @verbosity = bool ? 0 : 1
- end
private
- ##
# Set up an output generator for the format in @generator_name
-
- def setup_generator
- @generator = @generators[@generator_name]
-
- unless @generator then
- raise OptionParser::InvalidArgument, "Invalid output formatter"
+ def setup_generator(generators)
+ @generator = generators[@generator_name]
+ if !@generator
+ OptionList.error("Invalid output formatter")
end
-
- if @generator_name == "xml" then
+
+ if @generator_name == "xml"
@all_one_file = true
@inline_source = true
end
end
- # Check that the right version of 'dot' is available. Unfortunately this
- # doesn't work correctly under Windows NT, so we'll bypass the test under
- # Windows.
+ # Check that the right version of 'dot' is available.
+ # Unfortuately this doesn't work correctly under Windows NT,
+ # so we'll bypass the test under Windows
def check_diagram
return if RUBY_PLATFORM =~ /mswin|cygwin|mingw|bccwin/
ok = false
ver = nil
-
- IO.popen "dot -V 2>&1" do |io|
+ IO.popen("dot -V 2>&1") do |io|
ver = io.read
- if ver =~ /dot.+version(?:\s+gviz)?\s+(\d+)\.(\d+)/ then
+ if ver =~ /dot.+version(?:\s+gviz)?\s+(\d+)\.(\d+)/
ok = ($1.to_i > 1) || ($1.to_i == 1 && $2.to_i >= 8)
end
end
-
- unless ok then
- if ver =~ /^dot.+version/ then
+ unless ok
+ if ver =~ /^dot.+version/
$stderr.puts "Warning: You may need dot V1.8.6 or later to use\n",
"the --diagram option correctly. You have:\n\n ",
ver,
@@ -621,18 +565,22 @@ Usage: #{opt.program_name} [options] [names...]
"(see http://www.research.att.com/sw/tools/graphviz/)\n\n"
exit
end
+# exit
end
end
-
- ##
+
# Check that the files on the command line exist
-
+
def check_files
@files.each do |f|
- stat = File.stat f
- raise RDoc::Error, "file '#{f}' not readable" unless stat.readable?
+ stat = File.stat f rescue error("File not found: #{f}")
+ error("File '#{f}' not readable") unless stat.readable?
end
end
-end
+ def error(str)
+ $stderr.puts str
+ exit(1)
+ end
+end
diff --git a/lib/rdoc/parser.rb b/lib/rdoc/parser.rb
deleted file mode 100644
index bb7e0c7d81..0000000000
--- a/lib/rdoc/parser.rb
+++ /dev/null
@@ -1,136 +0,0 @@
-require 'rdoc'
-require 'rdoc/code_objects'
-require 'rdoc/markup/preprocess'
-require 'rdoc/stats'
-
-##
-# A parser is simple a class that implements
-#
-# #initialize(file_name, body, options)
-#
-# and
-#
-# #scan
-#
-# The initialize method takes a file name to be used, the body of the file,
-# and an RDoc::Options object. The scan method is then called to return an
-# appropriately parsed TopLevel code object.
-#
-# The ParseFactory is used to redirect to the correct parser given a
-# filename extension. This magic works because individual parsers have to
-# register themselves with us as they are loaded in. The do this using the
-# following incantation
-#
-# require "rdoc/parser"
-#
-# class RDoc::Parser::Xyz < RDoc::Parser
-# parse_files_matching /\.xyz$/ # <<<<
-#
-# def initialize(file_name, body, options)
-# ...
-# end
-#
-# def scan
-# ...
-# end
-# end
-#
-# Just to make life interesting, if we suspect a plain text file, we also
-# look for a shebang line just in case it's a potential shell script
-
-class RDoc::Parser
-
- @parsers = []
-
- class << self
- attr_reader :parsers
- end
-
- ##
- # Alias an extension to another extension. After this call, files ending
- # "new_ext" will be parsed using the same parser as "old_ext"
-
- def self.alias_extension(old_ext, new_ext)
- old_ext = old_ext.sub(/^\.(.*)/, '\1')
- new_ext = new_ext.sub(/^\.(.*)/, '\1')
-
- parser = can_parse "xxx.#{old_ext}"
- return false unless parser
-
- RDoc::Parser.parsers.unshift [/\.#{new_ext}$/, parser]
-
- true
- end
-
- ##
- # Return _true_ if the +file+ seems like binary.
-
- def self.binary?(file)
- s = File.read(file, 1024)
- s.count("^ -~\t\r\n").fdiv(s.size) > 0.3 || s.index("\x00") unless s.empty?
- end
- private_class_method :binary?
-
- ##
- # Return a parser that can handle a particular extension
-
- def self.can_parse(file_name)
- parser = RDoc::Parser.parsers.find { |regexp,| regexp =~ file_name }.last
-
- #
- # The default parser should *NOT* parse binary files.
- #
- if parser == RDoc::Parser::Simple then
- if binary? file_name then
- return nil
- end
- end
-
- return parser
- end
-
- ##
- # Find the correct parser for a particular file name. Return a SimpleParser
- # for ones that we don't know
-
- def self.for(top_level, file_name, body, options, stats)
- # If no extension, look for shebang
- if file_name !~ /\.\w+$/ && body =~ %r{\A#!(.+)} then
- shebang = $1
- case shebang
- when %r{env\s+ruby}, %r{/ruby}
- file_name = "dummy.rb"
- end
- end
-
- parser = can_parse file_name
-
- #
- # This method must return a parser.
- #
- if !parser then
- parser = RDoc::Parser::Simple
- end
-
- parser.new top_level, file_name, body, options, stats
- end
-
- ##
- # Record which file types this parser can understand.
-
- def self.parse_files_matching(regexp)
- RDoc::Parser.parsers.unshift [regexp, self]
- end
-
- def initialize(top_level, file_name, content, options, stats)
- @top_level = top_level
- @file_name = file_name
- @content = content
- @options = options
- @stats = stats
- end
-
-end
-
-require 'rdoc/parser/simple'
-
diff --git a/lib/rdoc/parser/c.rb b/lib/rdoc/parser/c.rb
deleted file mode 100644
index c3fb5e5b19..0000000000
--- a/lib/rdoc/parser/c.rb
+++ /dev/null
@@ -1,661 +0,0 @@
-require 'rdoc/parser'
-require 'rdoc/parser/ruby'
-require 'rdoc/known_classes'
-
-##
-# We attempt to parse C extension files. Basically we look for
-# the standard patterns that you find in extensions: <tt>rb_define_class,
-# rb_define_method</tt> and so on. We also try to find the corresponding
-# C source for the methods and extract comments, but if we fail
-# we don't worry too much.
-#
-# The comments associated with a Ruby method are extracted from the C
-# comment block associated with the routine that _implements_ that
-# method, that is to say the method whose name is given in the
-# <tt>rb_define_method</tt> call. For example, you might write:
-#
-# /*
-# * Returns a new array that is a one-dimensional flattening of this
-# * array (recursively). That is, for every element that is an array,
-# * extract its elements into the new array.
-# *
-# * s = [ 1, 2, 3 ] #=> [1, 2, 3]
-# * t = [ 4, 5, 6, [7, 8] ] #=> [4, 5, 6, [7, 8]]
-# * a = [ s, t, 9, 10 ] #=> [[1, 2, 3], [4, 5, 6, [7, 8]], 9, 10]
-# * a.flatten #=> [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
-# */
-# static VALUE
-# rb_ary_flatten(ary)
-# VALUE ary;
-# {
-# ary = rb_obj_dup(ary);
-# rb_ary_flatten_bang(ary);
-# return ary;
-# }
-#
-# ...
-#
-# void
-# Init_Array()
-# {
-# ...
-# rb_define_method(rb_cArray, "flatten", rb_ary_flatten, 0);
-#
-# Here RDoc will determine from the rb_define_method line that there's a
-# method called "flatten" in class Array, and will look for the implementation
-# in the method rb_ary_flatten. It will then use the comment from that
-# method in the HTML output. This method must be in the same source file
-# as the rb_define_method.
-#
-# C classes can be diagrammed (see /tc/dl/ruby/ruby/error.c), and RDoc
-# integrates C and Ruby source into one tree
-#
-# The comment blocks may include special directives:
-#
-# [Document-class: <i>name</i>]
-# This comment block is documentation for the given class. Use this
-# when the <tt>Init_xxx</tt> method is not named after the class.
-#
-# [Document-method: <i>name</i>]
-# This comment documents the named method. Use when RDoc cannot
-# automatically find the method from it's declaration
-#
-# [call-seq: <i>text up to an empty line</i>]
-# Because C source doesn't give descripive names to Ruby-level parameters,
-# you need to document the calling sequence explicitly
-#
-# In addition, RDoc assumes by default that the C method implementing a
-# Ruby function is in the same source file as the rb_define_method call.
-# If this isn't the case, add the comment:
-#
-# rb_define_method(....); // in: filename
-#
-# As an example, we might have an extension that defines multiple classes
-# in its Init_xxx method. We could document them using
-#
-# /*
-# * Document-class: MyClass
-# *
-# * Encapsulate the writing and reading of the configuration
-# * file. ...
-# */
-#
-# /*
-# * Document-method: read_value
-# *
-# * call-seq:
-# * cfg.read_value(key) -> value
-# * cfg.read_value(key} { |key| } -> value
-# *
-# * Return the value corresponding to +key+ from the configuration.
-# * In the second form, if the key isn't found, invoke the
-# * block and return its value.
-# */
-
-class RDoc::Parser::C < RDoc::Parser
-
- parse_files_matching(/\.(?:([CcHh])\1?|c([+xp])\2|y)\z/)
-
- @@enclosure_classes = {}
- @@known_bodies = {}
-
- ##
- # Prepare to parse a C file
-
- def initialize(top_level, file_name, content, options, stats)
- super
-
- @known_classes = RDoc::KNOWN_CLASSES.dup
- @content = handle_tab_width handle_ifdefs_in(@content)
- @classes = Hash.new
- @file_dir = File.dirname(@file_name)
- end
-
- def do_aliases
- @content.scan(%r{rb_define_alias\s*\(\s*(\w+),\s*"([^"]+)",\s*"([^"]+)"\s*\)}m) do
- |var_name, new_name, old_name|
- class_name = @known_classes[var_name] || var_name
- class_obj = find_class(var_name, class_name)
-
- as = class_obj.add_alias RDoc::Alias.new("", old_name, new_name, "")
-
- @stats.add_alias as
- end
- end
-
- def do_classes
- @content.scan(/(\w+)\s* = \s*rb_define_module\s*\(\s*"(\w+)"\s*\)/mx) do
- |var_name, class_name|
- handle_class_module(var_name, "module", class_name, nil, nil)
- end
-
- # The '.' lets us handle SWIG-generated files
- @content.scan(/([\w\.]+)\s* = \s*rb_define_class\s*
- \(
- \s*"(\w+)",
- \s*(\w+)\s*
- \)/mx) do |var_name, class_name, parent|
- handle_class_module(var_name, "class", class_name, parent, nil)
- end
-
- @content.scan(/(\w+)\s*=\s*boot_defclass\s*\(\s*"(\w+?)",\s*(\w+?)\s*\)/) do
- |var_name, class_name, parent|
- parent = nil if parent == "0"
- handle_class_module(var_name, "class", class_name, parent, nil)
- end
-
- @content.scan(/(\w+)\s* = \s*rb_define_module_under\s*
- \(
- \s*(\w+),
- \s*"(\w+)"
- \s*\)/mx) do |var_name, in_module, class_name|
- handle_class_module(var_name, "module", class_name, nil, in_module)
- end
-
- @content.scan(/([\w\.]+)\s* = \s*rb_define_class_under\s*
- \(
- \s*(\w+),
- \s*"(\w+)",
- \s*([\w\*\s\(\)\.\->]+)\s* # for SWIG
- \s*\)/mx) do |var_name, in_module, class_name, parent|
- handle_class_module(var_name, "class", class_name, parent, in_module)
- end
- end
-
- def do_constants
- @content.scan(%r{\Wrb_define_
- (
- variable |
- readonly_variable |
- const |
- global_const |
- )
- \s*\(
- (?:\s*(\w+),)?
- \s*"(\w+)",
- \s*(.*?)\s*\)\s*;
- }xm) do |type, var_name, const_name, definition|
- var_name = "rb_cObject" if !var_name or var_name == "rb_mKernel"
- handle_constants(type, var_name, const_name, definition)
- end
- end
-
- ##
- # Look for includes of the form:
- #
- # rb_include_module(rb_cArray, rb_mEnumerable);
-
- def do_includes
- @content.scan(/rb_include_module\s*\(\s*(\w+?),\s*(\w+?)\s*\)/) do |c,m|
- if cls = @classes[c]
- m = @known_classes[m] || m
- cls.add_include RDoc::Include.new(m, "")
- end
- end
- end
-
- def do_methods
- @content.scan(%r{rb_define_
- (
- singleton_method |
- method |
- module_function |
- private_method
- )
- \s*\(\s*([\w\.]+),
- \s*"([^"]+)",
- \s*(?:RUBY_METHOD_FUNC\(|VALUEFUNC\()?(\w+)\)?,
- \s*(-?\w+)\s*\)
- (?:;\s*/[*/]\s+in\s+(\w+?\.[cy]))?
- }xm) do
- |type, var_name, meth_name, meth_body, param_count, source_file|
-
- # Ignore top-object and weird struct.c dynamic stuff
- next if var_name == "ruby_top_self"
- next if var_name == "nstr"
- next if var_name == "envtbl"
- next if var_name == "argf" # it'd be nice to handle this one
-
- var_name = "rb_cObject" if var_name == "rb_mKernel"
- handle_method(type, var_name, meth_name,
- meth_body, param_count, source_file)
- end
-
- @content.scan(%r{rb_define_attr\(
- \s*([\w\.]+),
- \s*"([^"]+)",
- \s*(\d+),
- \s*(\d+)\s*\);
- }xm) do |var_name, attr_name, attr_reader, attr_writer|
- #var_name = "rb_cObject" if var_name == "rb_mKernel"
- handle_attr(var_name, attr_name,
- attr_reader.to_i != 0,
- attr_writer.to_i != 0)
- end
-
- @content.scan(%r{rb_define_global_function\s*\(
- \s*"([^"]+)",
- \s*(?:RUBY_METHOD_FUNC\(|VALUEFUNC\()?(\w+)\)?,
- \s*(-?\w+)\s*\)
- (?:;\s*/[*/]\s+in\s+(\w+?\.[cy]))?
- }xm) do |meth_name, meth_body, param_count, source_file|
- handle_method("method", "rb_mKernel", meth_name,
- meth_body, param_count, source_file)
- end
-
- @content.scan(/define_filetest_function\s*\(
- \s*"([^"]+)",
- \s*(?:RUBY_METHOD_FUNC\(|VALUEFUNC\()?(\w+)\)?,
- \s*(-?\w+)\s*\)/xm) do
- |meth_name, meth_body, param_count|
-
- handle_method("method", "rb_mFileTest", meth_name, meth_body, param_count)
- handle_method("singleton_method", "rb_cFile", meth_name, meth_body, param_count)
- end
- end
-
- def find_attr_comment(attr_name)
- if @content =~ %r{((?>/\*.*?\*/\s+))
- rb_define_attr\((?:\s*(\w+),)?\s*"#{attr_name}"\s*,.*?\)\s*;}xmi
- $1
- elsif @content =~ %r{Document-attr:\s#{attr_name}\s*?\n((?>.*?\*/))}m
- $1
- else
- ''
- end
- end
-
- ##
- # Find the C code corresponding to a Ruby method
-
- def find_body(class_name, meth_name, meth_obj, body, quiet = false)
- case body
- when %r"((?>/\*.*?\*/\s*))(?:(?:static|SWIGINTERN)\s+)?(?:intern\s+)?VALUE\s+#{meth_name}
- \s*(\([^)]*\))([^;]|$)"xm
- comment, params = $1, $2
- body_text = $&
-
- remove_private_comments(comment) if comment
-
- # see if we can find the whole body
-
- re = Regexp.escape(body_text) + '[^(]*^\{.*?^\}'
- body_text = $& if /#{re}/m =~ body
-
- # The comment block may have been overridden with a 'Document-method'
- # block. This happens in the interpreter when multiple methods are
- # vectored through to the same C method but those methods are logically
- # distinct (for example Kernel.hash and Kernel.object_id share the same
- # implementation
-
- override_comment = find_override_comment(class_name, meth_obj.name)
- comment = override_comment if override_comment
-
- find_modifiers(comment, meth_obj) if comment
-
-# meth_obj.params = params
- meth_obj.start_collecting_tokens
- meth_obj.add_token(RDoc::RubyToken::Token.new(1,1).set_text(body_text))
- meth_obj.comment = mangle_comment(comment)
- when %r{((?>/\*.*?\*/\s*))^\s*\#\s*define\s+#{meth_name}\s+(\w+)}m
- comment = $1
- find_body(class_name, $2, meth_obj, body, true)
- find_modifiers(comment, meth_obj)
- meth_obj.comment = mangle_comment(comment) + meth_obj.comment
- when %r{^\s*\#\s*define\s+#{meth_name}\s+(\w+)}m
- unless find_body(class_name, $1, meth_obj, body, true)
- warn "No definition for #{meth_name}" unless @options.quiet
- return false
- end
- else
-
- # No body, but might still have an override comment
- comment = find_override_comment(class_name, meth_obj.name)
-
- if comment
- find_modifiers(comment, meth_obj)
- meth_obj.comment = mangle_comment(comment)
- else
- warn "No definition for #{meth_name}" unless @options.quiet
- return false
- end
- end
- true
- end
-
- def find_class(raw_name, name)
- unless @classes[raw_name]
- if raw_name =~ /^rb_m/
- container = @top_level.add_module RDoc::NormalModule, name
- else
- container = @top_level.add_class RDoc::NormalClass, name, nil
- end
-
- container.record_location @top_level
- @classes[raw_name] = container
- end
- @classes[raw_name]
- end
-
- ##
- # Look for class or module documentation above Init_+class_name+(void),
- # in a Document-class +class_name+ (or module) comment or above an
- # rb_define_class (or module). If a comment is supplied above a matching
- # Init_ and a rb_define_class the Init_ comment is used.
- #
- # /*
- # * This is a comment for Foo
- # */
- # Init_Foo(void) {
- # VALUE cFoo = rb_define_class("Foo", rb_cObject);
- # }
- #
- # /*
- # * Document-class: Foo
- # * This is a comment for Foo
- # */
- # Init_foo(void) {
- # VALUE cFoo = rb_define_class("Foo", rb_cObject);
- # }
- #
- # /*
- # * This is a comment for Foo
- # */
- # VALUE cFoo = rb_define_class("Foo", rb_cObject);
-
- def find_class_comment(class_name, class_meth)
- comment = nil
- if @content =~ %r{((?>/\*.*?\*/\s+))
- (static\s+)?void\s+Init_#{class_name}\s*(?:_\(\s*)?\(\s*(?:void\s*)\)}xmi then
- comment = $1
- elsif @content =~ %r{Document-(?:class|module):\s#{class_name}\s*?(?:<\s+[:,\w]+)?\n((?>.*?\*/))}m
- comment = $1
- else
- if @content =~ /rb_define_(class|module)/m then
- class_name = class_name.split("::").last
- comments = []
- @content.split(/(\/\*.*?\*\/)\s*?\n/m).each_with_index do |chunk, index|
- comments[index] = chunk
- if chunk =~ /rb_define_(class|module).*?"(#{class_name})"/m then
- comment = comments[index-1]
- break
- end
- end
- end
- end
- class_meth.comment = mangle_comment(comment) if comment
- end
-
- ##
- # Finds a comment matching +type+ and +const_name+ either above the
- # comment or in the matching Document- section.
-
- def find_const_comment(type, const_name)
- if @content =~ %r{((?>^\s*/\*.*?\*/\s+))
- rb_define_#{type}\((?:\s*(\w+),)?\s*"#{const_name}"\s*,.*?\)\s*;}xmi
- $1
- elsif @content =~ %r{Document-(?:const|global|variable):\s#{const_name}\s*?\n((?>.*?\*/))}m
- $1
- else
- ''
- end
- end
-
- ##
- # If the comment block contains a section that looks like:
- #
- # call-seq:
- # Array.new
- # Array.new(10)
- #
- # use it for the parameters.
-
- def find_modifiers(comment, meth_obj)
- if comment.sub!(/:nodoc:\s*^\s*\*?\s*$/m, '') or
- comment.sub!(/\A\/\*\s*:nodoc:\s*\*\/\Z/, '')
- meth_obj.document_self = false
- end
- if comment.sub!(/call-seq:(.*?)^\s*\*?\s*$/m, '') or
- comment.sub!(/\A\/\*\s*call-seq:(.*?)\*\/\Z/, '')
- seq = $1
- seq.gsub!(/^\s*\*\s*/, '')
- meth_obj.call_seq = seq
- end
- end
-
- def find_override_comment(class_name, meth_name)
- name = Regexp.escape(meth_name)
- if @content =~ %r{Document-method:\s+#{class_name}(?:\.|::|#)#{name}\s*?\n((?>.*?\*/))}m then
- $1
- elsif @content =~ %r{Document-method:\s#{name}\s*?\n((?>.*?\*/))}m then
- $1
- end
- end
-
- def handle_attr(var_name, attr_name, reader, writer)
- rw = ''
- if reader
- #@stats.num_methods += 1
- rw << 'R'
- end
- if writer
- #@stats.num_methods += 1
- rw << 'W'
- end
-
- class_name = @known_classes[var_name]
-
- return unless class_name
-
- class_obj = find_class(var_name, class_name)
-
- if class_obj
- comment = find_attr_comment(attr_name)
- unless comment.empty?
- comment = mangle_comment(comment)
- end
- att = RDoc::Attr.new '', attr_name, rw, comment
- class_obj.add_attribute(att)
- end
- end
-
- def handle_class_module(var_name, class_mod, class_name, parent, in_module)
- parent_name = @known_classes[parent] || parent
-
- if in_module
- enclosure = @classes[in_module] || @@enclosure_classes[in_module]
- unless enclosure
- if enclosure = @known_classes[in_module]
- handle_class_module(in_module, (/^rb_m/ =~ in_module ? "module" : "class"),
- enclosure, nil, nil)
- enclosure = @classes[in_module]
- end
- end
- unless enclosure
- warn("Enclosing class/module '#{in_module}' for " +
- "#{class_mod} #{class_name} not known")
- return
- end
- else
- enclosure = @top_level
- end
-
- if class_mod == "class" then
- full_name = enclosure.full_name.to_s + "::#{class_name}"
- if @content =~ %r{Document-class:\s+#{full_name}\s*<\s+([:,\w]+)} then
- parent_name = $1
- end
- cm = enclosure.add_class RDoc::NormalClass, class_name, parent_name
- @stats.add_class cm
- else
- cm = enclosure.add_module RDoc::NormalModule, class_name
- @stats.add_module cm
- end
-
- cm.record_location(enclosure.toplevel)
-
- find_class_comment(cm.full_name, cm)
- @classes[var_name] = cm
- @@enclosure_classes[var_name] = cm
- @known_classes[var_name] = cm.full_name
- end
-
- ##
- # Adds constant comments. By providing some_value: at the start ofthe
- # comment you can override the C value of the comment to give a friendly
- # definition.
- #
- # /* 300: The perfect score in bowling */
- # rb_define_const(cFoo, "PERFECT", INT2FIX(300);
- #
- # Will override +INT2FIX(300)+ with the value +300+ in the output RDoc.
- # Values may include quotes and escaped colons (\:).
-
- def handle_constants(type, var_name, const_name, definition)
- #@stats.num_constants += 1
- class_name = @known_classes[var_name]
-
- return unless class_name
-
- class_obj = find_class(var_name, class_name)
-
- unless class_obj
- warn("Enclosing class/module '#{const_name}' for not known")
- return
- end
-
- comment = find_const_comment(type, const_name)
-
- # In the case of rb_define_const, the definition and comment are in
- # "/* definition: comment */" form. The literal ':' and '\' characters
- # can be escaped with a backslash.
- if type.downcase == 'const' then
- elements = mangle_comment(comment).split(':')
- if elements.nil? or elements.empty? then
- con = RDoc::Constant.new(const_name, definition,
- mangle_comment(comment))
- else
- new_definition = elements[0..-2].join(':')
- if new_definition.empty? then # Default to literal C definition
- new_definition = definition
- else
- new_definition.gsub!("\:", ":")
- new_definition.gsub!("\\", '\\')
- end
- new_definition.sub!(/\A(\s+)/, '')
- new_comment = $1.nil? ? elements.last : "#{$1}#{elements.last.lstrip}"
- con = RDoc::Constant.new(const_name, new_definition,
- mangle_comment(new_comment))
- end
- else
- con = RDoc::Constant.new const_name, definition, mangle_comment(comment)
- end
-
- class_obj.add_constant(con)
- end
-
- ##
- # Removes #ifdefs that would otherwise confuse us
-
- def handle_ifdefs_in(body)
- body.gsub(/^#ifdef HAVE_PROTOTYPES.*?#else.*?\n(.*?)#endif.*?\n/m, '\1')
- end
-
- def handle_method(type, var_name, meth_name, meth_body, param_count,
- source_file = nil)
- class_name = @known_classes[var_name]
-
- return unless class_name
-
- class_obj = find_class var_name, class_name
-
- if class_obj then
- if meth_name == "initialize" then
- meth_name = "new"
- type = "singleton_method"
- end
-
- meth_obj = RDoc::AnyMethod.new '', meth_name
- meth_obj.singleton = %w[singleton_method module_function].include? type
-
- p_count = (Integer(param_count) rescue -1)
-
- if p_count < 0
- meth_obj.params = "(...)"
- elsif p_count == 0
- meth_obj.params = "()"
- else
- meth_obj.params = "(" + (1..p_count).map{|i| "p#{i}"}.join(", ") + ")"
- end
-
- if source_file then
- file_name = File.join(@file_dir, source_file)
- body = (@@known_bodies[source_file] ||= File.read(file_name))
- else
- body = @content
- end
-
- if find_body(class_name, meth_body, meth_obj, body) and meth_obj.document_self then
- class_obj.add_method meth_obj
- @stats.add_method meth_obj
- end
- end
- end
-
- def handle_tab_width(body)
- if /\t/ =~ body
- tab_width = @options.tab_width
- body.split(/\n/).map do |line|
- 1 while line.gsub!(/\t+/) { ' ' * (tab_width*$&.length - $`.length % tab_width)} && $~ #`
- line
- end .join("\n")
- else
- body
- end
- end
-
- ##
- # Remove the /*'s and leading asterisks from C comments
-
- def mangle_comment(comment)
- comment.sub!(%r{/\*+}) { " " * $&.length }
- comment.sub!(%r{\*+/}) { " " * $&.length }
- comment.gsub!(/^[ \t]*\*/m) { " " * $&.length }
- comment
- end
-
- ##
- # Removes lines that are commented out that might otherwise get picked up
- # when scanning for classes and methods
-
- def remove_commented_out_lines
- @content.gsub!(%r{//.*rb_define_}, '//')
- end
-
- def remove_private_comments(comment)
- comment.gsub!(/\/?\*--\n(.*?)\/?\*\+\+/m, '')
- comment.sub!(/\/?\*--\n.*/m, '')
- end
-
- ##
- # Extract the classes/modules and methods from a C file and return the
- # corresponding top-level object
-
- def scan
- remove_commented_out_lines
- do_classes
- do_constants
- do_methods
- do_includes
- do_aliases
- @top_level
- end
-
- def warn(msg)
- $stderr.puts
- $stderr.puts msg
- $stderr.flush
- end
-
-end
-
diff --git a/lib/rdoc/parser/f95.rb b/lib/rdoc/parser/f95.rb
deleted file mode 100644
index 0959db4936..0000000000
--- a/lib/rdoc/parser/f95.rb
+++ /dev/null
@@ -1,1835 +0,0 @@
-require 'rdoc/parser'
-
-##
-# = Fortran95 RDoc Parser
-#
-# == Overview
-#
-# This parser parses Fortran95 files with suffixes "f90", "F90", "f95" and
-# "F95". Fortran95 files are expected to be conformed to Fortran95 standards.
-#
-# == Rules
-#
-# Fundamental rules are same as that of the Ruby parser. But comment markers
-# are '!' not '#'.
-#
-# === Correspondence between RDoc documentation and Fortran95 programs
-#
-# F95 parses main programs, modules, subroutines, functions, derived-types,
-# public variables, public constants, defined operators and defined
-# assignments. These components are described in items of RDoc documentation,
-# as follows.
-#
-# Files :: Files (same as Ruby)
-# Classes:: Modules
-# Methods:: Subroutines, functions, variables, constants, derived-types,
-# defined operators, defined assignments
-# Required files:: Files in which imported modules, external subroutines and
-# external functions are defined.
-# Included Modules:: List of imported modules
-# Attributes:: List of derived-types, List of imported modules all of whose
-# components are published again
-#
-# Components listed in 'Methods' (subroutines, functions, ...) defined in
-# modules are described in the item of 'Classes'. On the other hand,
-# components defined in main programs or as external procedures are described
-# in the item of 'Files'.
-#
-# === Components parsed by default
-#
-# By default, documentation on public components (subroutines, functions,
-# variables, constants, derived-types, defined operators, defined assignments)
-# are generated.
-#
-# With "--all" option, documentation on all components are generated (almost
-# same as the Ruby parser).
-#
-# === Information parsed automatically
-#
-# The following information is automatically parsed.
-#
-# * Types of arguments
-# * Types of variables and constants
-# * Types of variables in the derived types, and initial values
-# * NAMELISTs and types of variables in them, and initial values
-#
-# Aliases by interface statement are described in the item of 'Methods'.
-#
-# Components which are imported from other modules and published again are
-# described in the item of 'Methods'.
-#
-# === Format of comment blocks
-#
-# Comment blocks should be written as follows.
-#
-# Comment blocks are considered to be ended when the line without '!' appears.
-#
-# The indentation is not necessary.
-#
-# ! (Top of file)
-# !
-# ! Comment blocks for the files.
-# !
-# !--
-# ! The comment described in the part enclosed by
-# ! "!--" and "!++" is ignored.
-# !++
-# !
-# module hogehoge
-# !
-# ! Comment blocks for the modules (or the programs).
-# !
-#
-# private
-#
-# logical :: a ! a private variable
-# real, public :: b ! a public variable
-# integer, parameter :: c = 0 ! a public constant
-#
-# public :: c
-# public :: MULTI_ARRAY
-# public :: hoge, foo
-#
-# type MULTI_ARRAY
-# !
-# ! Comment blocks for the derived-types.
-# !
-# real, pointer :: var(:) =>null() ! Comments block for the variables.
-# integer :: num = 0
-# end type MULTI_ARRAY
-#
-# contains
-#
-# subroutine hoge( in, & ! Comment blocks between continuation lines are ignored.
-# & out )
-# !
-# ! Comment blocks for the subroutines or functions
-# !
-# character(*),intent(in):: in ! Comment blocks for the arguments.
-# character(*),intent(out),allocatable,target :: in
-# ! Comment blocks can be
-# ! written under Fortran statements.
-#
-# character(32) :: file ! This comment parsed as a variable in below NAMELIST.
-# integer :: id
-#
-# namelist /varinfo_nml/ file, id
-# !
-# ! Comment blocks for the NAMELISTs.
-# ! Information about variables are described above.
-# !
-#
-# ....
-#
-# end subroutine hoge
-#
-# integer function foo( in )
-# !
-# ! This part is considered as comment block.
-#
-# ! Comment blocks under blank lines are ignored.
-# !
-# integer, intent(in):: inA ! This part is considered as comment block.
-#
-# ! This part is ignored.
-#
-# end function foo
-#
-# subroutine hide( in, &
-# & out ) !:nodoc:
-# !
-# ! If "!:nodoc:" is described at end-of-line in subroutine
-# ! statement as above, the subroutine is ignored.
-# ! This assignment can be used to modules, subroutines,
-# ! functions, variables, constants, derived-types,
-# ! defined operators, defined assignments,
-# ! list of imported modules ("use" statement).
-# !
-#
-# ....
-#
-# end subroutine hide
-#
-# end module hogehoge
-
-class RDoc::Parser::F95 < RDoc::Parser
-
- parse_files_matching(/\.((f|F)9(0|5)|F)$/)
-
- class Token
-
- NO_TEXT = "??".freeze
-
- def initialize(line_no, char_no)
- @line_no = line_no
- @char_no = char_no
- @text = NO_TEXT
- end
- # Because we're used in contexts that expect to return a token,
- # we set the text string and then return ourselves
- def set_text(text)
- @text = text
- self
- end
-
- attr_reader :line_no, :char_no, :text
-
- end
-
- @@external_aliases = []
- @@public_methods = []
-
- ##
- # "false":: Comments are below source code
- # "true" :: Comments are upper source code
-
- COMMENTS_ARE_UPPER = false
-
- ##
- # Internal alias message
-
- INTERNAL_ALIAS_MES = "Alias for"
-
- ##
- # External alias message
-
- EXTERNAL_ALIAS_MES = "The entity is"
-
- ##
- # Define code constructs
-
- def scan
- # remove private comment
- remaining_code = remove_private_comments(@content)
-
- # continuation lines are united to one line
- remaining_code = united_to_one_line(remaining_code)
-
- # semicolons are replaced to line feed
- remaining_code = semicolon_to_linefeed(remaining_code)
-
- # collect comment for file entity
- whole_comment, remaining_code = collect_first_comment(remaining_code)
- @top_level.comment = whole_comment
-
- # String "remaining_code" is converted to Array "remaining_lines"
- remaining_lines = remaining_code.split("\n")
-
- # "module" or "program" parts are parsed (new)
- #
- level_depth = 0
- block_searching_flag = nil
- block_searching_lines = []
- pre_comment = []
- module_program_trailing = ""
- module_program_name = ""
- other_block_level_depth = 0
- other_block_searching_flag = nil
- remaining_lines.collect!{|line|
- if !block_searching_flag && !other_block_searching_flag
- if line =~ /^\s*?module\s+(\w+)\s*?(!.*?)?$/i
- block_searching_flag = :module
- block_searching_lines << line
- module_program_name = $1
- module_program_trailing = find_comments($2)
- next false
- elsif line =~ /^\s*?program\s+(\w+)\s*?(!.*?)?$/i ||
- line =~ /^\s*?\w/ && !block_start?(line)
- block_searching_flag = :program
- block_searching_lines << line
- module_program_name = $1 || ""
- module_program_trailing = find_comments($2)
- next false
-
- elsif block_start?(line)
- other_block_searching_flag = true
- next line
-
- elsif line =~ /^\s*?!\s?(.*)/
- pre_comment << line
- next line
- else
- pre_comment = []
- next line
- end
- elsif other_block_searching_flag
- other_block_level_depth += 1 if block_start?(line)
- other_block_level_depth -= 1 if block_end?(line)
- if other_block_level_depth < 0
- other_block_level_depth = 0
- other_block_searching_flag = nil
- end
- next line
- end
-
- block_searching_lines << line
- level_depth += 1 if block_start?(line)
- level_depth -= 1 if block_end?(line)
- if level_depth >= 0
- next false
- end
-
- # "module_program_code" is formatted.
- # ":nodoc:" flag is checked.
- #
- module_program_code = block_searching_lines.join("\n")
- module_program_code = remove_empty_head_lines(module_program_code)
- if module_program_trailing =~ /^:nodoc:/
- # next loop to search next block
- level_depth = 0
- block_searching_flag = false
- block_searching_lines = []
- pre_comment = []
- next false
- end
-
- # NormalClass is created, and added to @top_level
- #
- if block_searching_flag == :module
- module_name = module_program_name
- module_code = module_program_code
- module_trailing = module_program_trailing
-
- f9x_module = @top_level.add_module NormalClass, module_name
- f9x_module.record_location @top_level
-
- @stats.add_module f9x_module
-
- f9x_comment = COMMENTS_ARE_UPPER ?
- find_comments(pre_comment.join("\n")) + "\n" + module_trailing :
- module_trailing + "\n" + find_comments(module_code.sub(/^.*$\n/i, ''))
- f9x_module.comment = f9x_comment
- parse_program_or_module(f9x_module, module_code)
-
- TopLevel.all_files.each do |name, toplevel|
- if toplevel.include_includes?(module_name, @options.ignore_case)
- if !toplevel.include_requires?(@file_name, @options.ignore_case)
- toplevel.add_require(Require.new(@file_name, ""))
- end
- end
- toplevel.each_classmodule{|m|
- if m.include_includes?(module_name, @options.ignore_case)
- if !m.include_requires?(@file_name, @options.ignore_case)
- m.add_require(Require.new(@file_name, ""))
- end
- end
- }
- end
- elsif block_searching_flag == :program
- program_name = module_program_name
- program_code = module_program_code
- program_trailing = module_program_trailing
- # progress "p" # HACK what stats thingy does this correspond to?
- program_comment = COMMENTS_ARE_UPPER ?
- find_comments(pre_comment.join("\n")) + "\n" + program_trailing :
- program_trailing + "\n" + find_comments(program_code.sub(/^.*$\n/i, ''))
- program_comment = "\n\n= <i>Program</i> <tt>#{program_name}</tt>\n\n" \
- + program_comment
- @top_level.comment << program_comment
- parse_program_or_module(@top_level, program_code, :private)
- end
-
- # next loop to search next block
- level_depth = 0
- block_searching_flag = false
- block_searching_lines = []
- pre_comment = []
- next false
- }
-
- remaining_lines.delete_if{ |line|
- line == false
- }
-
- # External subprograms and functions are parsed
- #
- parse_program_or_module(@top_level, remaining_lines.join("\n"),
- :public, true)
-
- @top_level
- end # End of scan
-
- private
-
- def parse_program_or_module(container, code,
- visibility=:public, external=nil)
- return unless container
- return unless code
- remaining_lines = code.split("\n")
- remaining_code = "#{code}"
-
- #
- # Parse variables before "contains" in module
- #
- level_depth = 0
- before_contains_lines = []
- before_contains_code = nil
- before_contains_flag = nil
- remaining_lines.each{ |line|
- if !before_contains_flag
- if line =~ /^\s*?module\s+\w+\s*?(!.*?)?$/i
- before_contains_flag = true
- end
- else
- break if line =~ /^\s*?contains\s*?(!.*?)?$/i
- level_depth += 1 if block_start?(line)
- level_depth -= 1 if block_end?(line)
- break if level_depth < 0
- before_contains_lines << line
- end
- }
- before_contains_code = before_contains_lines.join("\n")
- if before_contains_code
- before_contains_code.gsub!(/^\s*?interface\s+.*?\s+end\s+interface.*?$/im, "")
- before_contains_code.gsub!(/^\s*?type[\s\,]+.*?\s+end\s+type.*?$/im, "")
- end
-
- #
- # Parse global "use"
- #
- use_check_code = "#{before_contains_code}"
- cascaded_modules_list = []
- while use_check_code =~ /^\s*?use\s+(\w+)(.*?)(!.*?)?$/i
- use_check_code = $~.pre_match
- use_check_code << $~.post_match
- used_mod_name = $1.strip.chomp
- used_list = $2 || ""
- used_trailing = $3 || ""
- next if used_trailing =~ /!:nodoc:/
- if !container.include_includes?(used_mod_name, @options.ignore_case)
- # progress "." # HACK what stats thingy does this correspond to?
- container.add_include Include.new(used_mod_name, "")
- end
- if ! (used_list =~ /\,\s*?only\s*?:/i )
- cascaded_modules_list << "\#" + used_mod_name
- end
- end
-
- #
- # Parse public and private, and store information.
- # This information is used when "add_method" and
- # "set_visibility_for" are called.
- #
- visibility_default, visibility_info =
- parse_visibility(remaining_lines.join("\n"), visibility, container)
- @@public_methods.concat visibility_info
- if visibility_default == :public
- if !cascaded_modules_list.empty?
- cascaded_modules =
- Attr.new("Cascaded Modules",
- "Imported modules all of whose components are published again",
- "",
- cascaded_modules_list.join(", "))
- container.add_attribute(cascaded_modules)
- end
- end
-
- #
- # Check rename elements
- #
- use_check_code = "#{before_contains_code}"
- while use_check_code =~ /^\s*?use\s+(\w+)\s*?\,(.+)$/i
- use_check_code = $~.pre_match
- use_check_code << $~.post_match
- used_mod_name = $1.strip.chomp
- used_elements = $2.sub(/\s*?only\s*?:\s*?/i, '')
- used_elements.split(",").each{ |used|
- if /\s*?(\w+)\s*?=>\s*?(\w+)\s*?/ =~ used
- local = $1
- org = $2
- @@public_methods.collect!{ |pub_meth|
- if local == pub_meth["name"] ||
- local.upcase == pub_meth["name"].upcase &&
- @options.ignore_case
- pub_meth["name"] = org
- pub_meth["local_name"] = local
- end
- pub_meth
- }
- end
- }
- end
-
- #
- # Parse private "use"
- #
- use_check_code = remaining_lines.join("\n")
- while use_check_code =~ /^\s*?use\s+(\w+)(.*?)(!.*?)?$/i
- use_check_code = $~.pre_match
- use_check_code << $~.post_match
- used_mod_name = $1.strip.chomp
- used_trailing = $3 || ""
- next if used_trailing =~ /!:nodoc:/
- if !container.include_includes?(used_mod_name, @options.ignore_case)
- # progress "." # HACK what stats thingy does this correspond to?
- container.add_include Include.new(used_mod_name, "")
- end
- end
-
- container.each_includes{ |inc|
- TopLevel.all_files.each do |name, toplevel|
- indicated_mod = toplevel.find_symbol(inc.name,
- nil, @options.ignore_case)
- if indicated_mod
- indicated_name = indicated_mod.parent.file_relative_name
- if !container.include_requires?(indicated_name, @options.ignore_case)
- container.add_require(Require.new(indicated_name, ""))
- end
- break
- end
- end
- }
-
- #
- # Parse derived-types definitions
- #
- derived_types_comment = ""
- remaining_code = remaining_lines.join("\n")
- while remaining_code =~ /^\s*?
- type[\s\,]+(public|private)?\s*?(::)?\s*?
- (\w+)\s*?(!.*?)?$
- (.*?)
- ^\s*?end\s+type.*?$
- /imx
- remaining_code = $~.pre_match
- remaining_code << $~.post_match
- typename = $3.chomp.strip
- type_elements = $5 || ""
- type_code = remove_empty_head_lines($&)
- type_trailing = find_comments($4)
- next if type_trailing =~ /^:nodoc:/
- type_visibility = $1
- type_comment = COMMENTS_ARE_UPPER ?
- find_comments($~.pre_match) + "\n" + type_trailing :
- type_trailing + "\n" + find_comments(type_code.sub(/^.*$\n/i, ''))
- type_element_visibility_public = true
- type_code.split("\n").each{ |line|
- if /^\s*?private\s*?$/ =~ line
- type_element_visibility_public = nil
- break
- end
- } if type_code
-
- args_comment = ""
- type_args_info = nil
-
- if @options.show_all
- args_comment = find_arguments(nil, type_code, true)
- else
- type_public_args_list = []
- type_args_info = definition_info(type_code)
- type_args_info.each{ |arg|
- arg_is_public = type_element_visibility_public
- arg_is_public = true if arg.include_attr?("public")
- arg_is_public = nil if arg.include_attr?("private")
- type_public_args_list << arg.varname if arg_is_public
- }
- args_comment = find_arguments(type_public_args_list, type_code)
- end
-
- type = AnyMethod.new("type #{typename}", typename)
- type.singleton = false
- type.params = ""
- type.comment = "<b><em> Derived Type </em></b> :: <tt></tt>\n"
- type.comment << args_comment if args_comment
- type.comment << type_comment if type_comment
-
- @stats.add_method type
-
- container.add_method type
-
- set_visibility(container, typename, visibility_default, @@public_methods)
-
- if type_visibility
- type_visibility.gsub!(/\s/,'')
- type_visibility.gsub!(/\,/,'')
- type_visibility.gsub!(/:/,'')
- type_visibility.downcase!
- if type_visibility == "public"
- container.set_visibility_for([typename], :public)
- elsif type_visibility == "private"
- container.set_visibility_for([typename], :private)
- end
- end
-
- check_public_methods(type, container.name)
-
- if @options.show_all
- derived_types_comment << ", " unless derived_types_comment.empty?
- derived_types_comment << typename
- else
- if type.visibility == :public
- derived_types_comment << ", " unless derived_types_comment.empty?
- derived_types_comment << typename
- end
- end
-
- end
-
- if !derived_types_comment.empty?
- derived_types_table =
- Attr.new("Derived Types", "Derived_Types", "",
- derived_types_comment)
- container.add_attribute(derived_types_table)
- end
-
- #
- # move interface scope
- #
- interface_code = ""
- while remaining_code =~ /^\s*?
- interface(
- \s+\w+ |
- \s+operator\s*?\(.*?\) |
- \s+assignment\s*?\(\s*?=\s*?\)
- )?\s*?$
- (.*?)
- ^\s*?end\s+interface.*?$
- /imx
- interface_code << remove_empty_head_lines($&) + "\n"
- remaining_code = $~.pre_match
- remaining_code << $~.post_match
- end
-
- #
- # Parse global constants or variables in modules
- #
- const_var_defs = definition_info(before_contains_code)
- const_var_defs.each{|defitem|
- next if defitem.nodoc
- const_or_var_type = "Variable"
- const_or_var_progress = "v"
- if defitem.include_attr?("parameter")
- const_or_var_type = "Constant"
- const_or_var_progress = "c"
- end
- const_or_var = AnyMethod.new(const_or_var_type, defitem.varname)
- const_or_var.singleton = false
- const_or_var.params = ""
- self_comment = find_arguments([defitem.varname], before_contains_code)
- const_or_var.comment = "<b><em>" + const_or_var_type + "</em></b> :: <tt></tt>\n"
- const_or_var.comment << self_comment if self_comment
-
- @stats.add_method const_or_var_progress
-
- container.add_method const_or_var
-
- set_visibility(container, defitem.varname, visibility_default, @@public_methods)
-
- if defitem.include_attr?("public")
- container.set_visibility_for([defitem.varname], :public)
- elsif defitem.include_attr?("private")
- container.set_visibility_for([defitem.varname], :private)
- end
-
- check_public_methods(const_or_var, container.name)
-
- } if const_var_defs
-
- remaining_lines = remaining_code.split("\n")
-
- # "subroutine" or "function" parts are parsed (new)
- #
- level_depth = 0
- block_searching_flag = nil
- block_searching_lines = []
- pre_comment = []
- procedure_trailing = ""
- procedure_name = ""
- procedure_params = ""
- procedure_prefix = ""
- procedure_result_arg = ""
- procedure_type = ""
- contains_lines = []
- contains_flag = nil
- remaining_lines.collect!{|line|
- if !block_searching_flag
- # subroutine
- if line =~ /^\s*?
- (recursive|pure|elemental)?\s*?
- subroutine\s+(\w+)\s*?(\(.*?\))?\s*?(!.*?)?$
- /ix
- block_searching_flag = :subroutine
- block_searching_lines << line
-
- procedure_name = $2.chomp.strip
- procedure_params = $3 || ""
- procedure_prefix = $1 || ""
- procedure_trailing = $4 || "!"
- next false
-
- # function
- elsif line =~ /^\s*?
- (recursive|pure|elemental)?\s*?
- (
- character\s*?(\([\w\s\=\(\)\*]+?\))?\s+
- | type\s*?\([\w\s]+?\)\s+
- | integer\s*?(\([\w\s\=\(\)\*]+?\))?\s+
- | real\s*?(\([\w\s\=\(\)\*]+?\))?\s+
- | double\s+precision\s+
- | logical\s*?(\([\w\s\=\(\)\*]+?\))?\s+
- | complex\s*?(\([\w\s\=\(\)\*]+?\))?\s+
- )?
- function\s+(\w+)\s*?
- (\(.*?\))?(\s+result\((.*?)\))?\s*?(!.*?)?$
- /ix
- block_searching_flag = :function
- block_searching_lines << line
-
- procedure_prefix = $1 || ""
- procedure_type = $2 ? $2.chomp.strip : nil
- procedure_name = $8.chomp.strip
- procedure_params = $9 || ""
- procedure_result_arg = $11 ? $11.chomp.strip : procedure_name
- procedure_trailing = $12 || "!"
- next false
- elsif line =~ /^\s*?!\s?(.*)/
- pre_comment << line
- next line
- else
- pre_comment = []
- next line
- end
- end
- contains_flag = true if line =~ /^\s*?contains\s*?(!.*?)?$/
- block_searching_lines << line
- contains_lines << line if contains_flag
-
- level_depth += 1 if block_start?(line)
- level_depth -= 1 if block_end?(line)
- if level_depth >= 0
- next false
- end
-
- # "procedure_code" is formatted.
- # ":nodoc:" flag is checked.
- #
- procedure_code = block_searching_lines.join("\n")
- procedure_code = remove_empty_head_lines(procedure_code)
- if procedure_trailing =~ /^!:nodoc:/
- # next loop to search next block
- level_depth = 0
- block_searching_flag = nil
- block_searching_lines = []
- pre_comment = []
- procedure_trailing = ""
- procedure_name = ""
- procedure_params = ""
- procedure_prefix = ""
- procedure_result_arg = ""
- procedure_type = ""
- contains_lines = []
- contains_flag = nil
- next false
- end
-
- # AnyMethod is created, and added to container
- #
- subroutine_function = nil
- if block_searching_flag == :subroutine
- subroutine_prefix = procedure_prefix
- subroutine_name = procedure_name
- subroutine_params = procedure_params
- subroutine_trailing = procedure_trailing
- subroutine_code = procedure_code
-
- subroutine_comment = COMMENTS_ARE_UPPER ?
- pre_comment.join("\n") + "\n" + subroutine_trailing :
- subroutine_trailing + "\n" + subroutine_code.sub(/^.*$\n/i, '')
- subroutine = AnyMethod.new("subroutine", subroutine_name)
- parse_subprogram(subroutine, subroutine_params,
- subroutine_comment, subroutine_code,
- before_contains_code, nil, subroutine_prefix)
-
- @stats.add_method subroutine
-
- container.add_method subroutine
- subroutine_function = subroutine
-
- elsif block_searching_flag == :function
- function_prefix = procedure_prefix
- function_type = procedure_type
- function_name = procedure_name
- function_params_org = procedure_params
- function_result_arg = procedure_result_arg
- function_trailing = procedure_trailing
- function_code_org = procedure_code
-
- function_comment = COMMENTS_ARE_UPPER ?
- pre_comment.join("\n") + "\n" + function_trailing :
- function_trailing + "\n " + function_code_org.sub(/^.*$\n/i, '')
-
- function_code = "#{function_code_org}"
- if function_type
- function_code << "\n" + function_type + " :: " + function_result_arg
- end
-
- function_params =
- function_params_org.sub(/^\(/, "\(#{function_result_arg}, ")
-
- function = AnyMethod.new("function", function_name)
- parse_subprogram(function, function_params,
- function_comment, function_code,
- before_contains_code, true, function_prefix)
-
- # Specific modification due to function
- function.params.sub!(/\(\s*?#{function_result_arg}\s*?,\s*?/, "\( ")
- function.params << " result(" + function_result_arg + ")"
- function.start_collecting_tokens
- function.add_token Token.new(1,1).set_text(function_code_org)
-
- @stats.add_method function
-
- container.add_method function
- subroutine_function = function
-
- end
-
- # The visibility of procedure is specified
- #
- set_visibility(container, procedure_name,
- visibility_default, @@public_methods)
-
- # The alias for this procedure from external modules
- #
- check_external_aliases(procedure_name,
- subroutine_function.params,
- subroutine_function.comment, subroutine_function) if external
- check_public_methods(subroutine_function, container.name)
-
-
- # contains_lines are parsed as private procedures
- if contains_flag
- parse_program_or_module(container,
- contains_lines.join("\n"), :private)
- end
-
- # next loop to search next block
- level_depth = 0
- block_searching_flag = nil
- block_searching_lines = []
- pre_comment = []
- procedure_trailing = ""
- procedure_name = ""
- procedure_params = ""
- procedure_prefix = ""
- procedure_result_arg = ""
- contains_lines = []
- contains_flag = nil
- next false
- } # End of remaining_lines.collect!{|line|
-
- # Array remains_lines is converted to String remains_code again
- #
- remaining_code = remaining_lines.join("\n")
-
- #
- # Parse interface
- #
- interface_scope = false
- generic_name = ""
- interface_code.split("\n").each{ |line|
- if /^\s*?
- interface(
- \s+\w+|
- \s+operator\s*?\(.*?\)|
- \s+assignment\s*?\(\s*?=\s*?\)
- )?
- \s*?(!.*?)?$
- /ix =~ line
- generic_name = $1 ? $1.strip.chomp : nil
- interface_trailing = $2 || "!"
- interface_scope = true
- interface_scope = false if interface_trailing =~ /!:nodoc:/
-# if generic_name =~ /operator\s*?\((.*?)\)/i
-# operator_name = $1
-# if operator_name && !operator_name.empty?
-# generic_name = "#{operator_name}"
-# end
-# end
-# if generic_name =~ /assignment\s*?\((.*?)\)/i
-# assignment_name = $1
-# if assignment_name && !assignment_name.empty?
-# generic_name = "#{assignment_name}"
-# end
-# end
- end
- if /^\s*?end\s+interface/i =~ line
- interface_scope = false
- generic_name = nil
- end
- # internal alias
- if interface_scope && /^\s*?module\s+procedure\s+(.*?)(!.*?)?$/i =~ line
- procedures = $1.strip.chomp
- procedures_trailing = $2 || "!"
- next if procedures_trailing =~ /!:nodoc:/
- procedures.split(",").each{ |proc|
- proc.strip!
- proc.chomp!
- next if generic_name == proc || !generic_name
- old_meth = container.find_symbol(proc, nil, @options.ignore_case)
- next if !old_meth
- nolink = old_meth.visibility == :private ? true : nil
- nolink = nil if @options.show_all
- new_meth =
- initialize_external_method(generic_name, proc,
- old_meth.params, nil,
- old_meth.comment,
- old_meth.clone.token_stream[0].text,
- true, nolink)
- new_meth.singleton = old_meth.singleton
-
- @stats.add_method new_meth
-
- container.add_method new_meth
-
- set_visibility(container, generic_name, visibility_default, @@public_methods)
-
- check_public_methods(new_meth, container.name)
-
- }
- end
-
- # external aliases
- if interface_scope
- # subroutine
- proc = nil
- params = nil
- procedures_trailing = nil
- if line =~ /^\s*?
- (recursive|pure|elemental)?\s*?
- subroutine\s+(\w+)\s*?(\(.*?\))?\s*?(!.*?)?$
- /ix
- proc = $2.chomp.strip
- generic_name = proc unless generic_name
- params = $3 || ""
- procedures_trailing = $4 || "!"
-
- # function
- elsif line =~ /^\s*?
- (recursive|pure|elemental)?\s*?
- (
- character\s*?(\([\w\s\=\(\)\*]+?\))?\s+
- | type\s*?\([\w\s]+?\)\s+
- | integer\s*?(\([\w\s\=\(\)\*]+?\))?\s+
- | real\s*?(\([\w\s\=\(\)\*]+?\))?\s+
- | double\s+precision\s+
- | logical\s*?(\([\w\s\=\(\)\*]+?\))?\s+
- | complex\s*?(\([\w\s\=\(\)\*]+?\))?\s+
- )?
- function\s+(\w+)\s*?
- (\(.*?\))?(\s+result\((.*?)\))?\s*?(!.*?)?$
- /ix
- proc = $8.chomp.strip
- generic_name = proc unless generic_name
- params = $9 || ""
- procedures_trailing = $12 || "!"
- else
- next
- end
- next if procedures_trailing =~ /!:nodoc:/
- indicated_method = nil
- indicated_file = nil
- TopLevel.all_files.each do |name, toplevel|
- indicated_method = toplevel.find_local_symbol(proc, @options.ignore_case)
- indicated_file = name
- break if indicated_method
- end
-
- if indicated_method
- external_method =
- initialize_external_method(generic_name, proc,
- indicated_method.params,
- indicated_file,
- indicated_method.comment)
-
- @stats.add_method external_method
-
- container.add_method external_method
- set_visibility(container, generic_name, visibility_default, @@public_methods)
- if !container.include_requires?(indicated_file, @options.ignore_case)
- container.add_require(Require.new(indicated_file, ""))
- end
- check_public_methods(external_method, container.name)
-
- else
- @@external_aliases << {
- "new_name" => generic_name,
- "old_name" => proc,
- "file_or_module" => container,
- "visibility" => find_visibility(container, generic_name, @@public_methods) || visibility_default
- }
- end
- end
-
- } if interface_code # End of interface_code.split("\n").each ...
-
- #
- # Already imported methods are removed from @@public_methods.
- # Remainders are assumed to be imported from other modules.
- #
- @@public_methods.delete_if{ |method| method["entity_is_discovered"]}
-
- @@public_methods.each{ |pub_meth|
- next unless pub_meth["file_or_module"].name == container.name
- pub_meth["used_modules"].each{ |used_mod|
- TopLevel.all_classes_and_modules.each{ |modules|
- if modules.name == used_mod ||
- modules.name.upcase == used_mod.upcase &&
- @options.ignore_case
- modules.method_list.each{ |meth|
- if meth.name == pub_meth["name"] ||
- meth.name.upcase == pub_meth["name"].upcase &&
- @options.ignore_case
- new_meth = initialize_public_method(meth,
- modules.name)
- if pub_meth["local_name"]
- new_meth.name = pub_meth["local_name"]
- end
-
- @stats.add_method new_meth
-
- container.add_method new_meth
- end
- }
- end
- }
- }
- }
-
- container
- end # End of parse_program_or_module
-
- ##
- # Parse arguments, comment, code of subroutine and function. Return
- # AnyMethod object.
-
- def parse_subprogram(subprogram, params, comment, code,
- before_contains=nil, function=nil, prefix=nil)
- subprogram.singleton = false
- prefix = "" if !prefix
- arguments = params.sub(/\(/, "").sub(/\)/, "").split(",") if params
- args_comment, params_opt =
- find_arguments(arguments, code.sub(/^s*?contains\s*?(!.*?)?$.*/im, ""),
- nil, nil, true)
- params_opt = "( " + params_opt + " ) " if params_opt
- subprogram.params = params_opt || ""
- namelist_comment = find_namelists(code, before_contains)
-
- block_comment = find_comments comment
- if function
- subprogram.comment = "<b><em> Function </em></b> :: <em>#{prefix}</em>\n"
- else
- subprogram.comment = "<b><em> Subroutine </em></b> :: <em>#{prefix}</em>\n"
- end
- subprogram.comment << args_comment if args_comment
- subprogram.comment << block_comment if block_comment
- subprogram.comment << namelist_comment if namelist_comment
-
- # For output source code
- subprogram.start_collecting_tokens
- subprogram.add_token Token.new(1,1).set_text(code)
-
- subprogram
- end
-
- ##
- # Collect comment for file entity
-
- def collect_first_comment(body)
- comment = ""
- not_comment = ""
- comment_start = false
- comment_end = false
- body.split("\n").each{ |line|
- if comment_end
- not_comment << line
- not_comment << "\n"
- elsif /^\s*?!\s?(.*)$/i =~ line
- comment_start = true
- comment << $1
- comment << "\n"
- elsif /^\s*?$/i =~ line
- comment_end = true if comment_start && COMMENTS_ARE_UPPER
- else
- comment_end = true
- not_comment << line
- not_comment << "\n"
- end
- }
- return comment, not_comment
- end
-
-
- ##
- # Return comments of definitions of arguments
- #
- # If "all" argument is true, information of all arguments are returned.
- #
- # If "modified_params" is true, list of arguments are decorated, for
- # example, optional arguments are parenthetic as "[arg]".
-
- def find_arguments(args, text, all=nil, indent=nil, modified_params=nil)
- return unless args || all
- indent = "" unless indent
- args = ["all"] if all
- params = "" if modified_params
- comma = ""
- return unless text
- args_rdocforms = "\n"
- remaining_lines = "#{text}"
- definitions = definition_info(remaining_lines)
- args.each{ |arg|
- arg.strip!
- arg.chomp!
- definitions.each { |defitem|
- if arg == defitem.varname.strip.chomp || all
- args_rdocforms << <<-"EOF"
-
-#{indent}<tt><b>#{defitem.varname.chomp.strip}#{defitem.arraysuffix}</b> #{defitem.inivalue}</tt> ::
-#{indent} <tt>#{defitem.types.chomp.strip}</tt>
-EOF
- if !defitem.comment.chomp.strip.empty?
- comment = ""
- defitem.comment.split("\n").each{ |line|
- comment << " " + line + "\n"
- }
- args_rdocforms << <<-"EOF"
-
-#{indent} <tt></tt> ::
-#{indent} <tt></tt>
-#{indent} #{comment.chomp.strip}
-EOF
- end
-
- if modified_params
- if defitem.include_attr?("optional")
- params << "#{comma}[#{arg}]"
- else
- params << "#{comma}#{arg}"
- end
- comma = ", "
- end
- end
- }
- }
- if modified_params
- return args_rdocforms, params
- else
- return args_rdocforms
- end
- end
-
- ##
- # Return comments of definitions of namelists
-
- def find_namelists(text, before_contains=nil)
- return nil if !text
- result = ""
- lines = "#{text}"
- before_contains = "" if !before_contains
- while lines =~ /^\s*?namelist\s+\/\s*?(\w+)\s*?\/([\s\w\,]+)$/i
- lines = $~.post_match
- nml_comment = COMMENTS_ARE_UPPER ?
- find_comments($~.pre_match) : find_comments($~.post_match)
- nml_name = $1
- nml_args = $2.split(",")
- result << "\n\n=== NAMELIST <tt><b>" + nml_name + "</tt></b>\n\n"
- result << nml_comment + "\n" if nml_comment
- if lines.split("\n")[0] =~ /^\//i
- lines = "namelist " + lines
- end
- result << find_arguments(nml_args, "#{text}" + "\n" + before_contains)
- end
- return result
- end
-
- ##
- # Comments just after module or subprogram, or arguments are returned. If
- # "COMMENTS_ARE_UPPER" is true, comments just before modules or subprograms
- # are returnd
-
- def find_comments text
- return "" unless text
- lines = text.split("\n")
- lines.reverse! if COMMENTS_ARE_UPPER
- comment_block = Array.new
- lines.each do |line|
- break if line =~ /^\s*?\w/ || line =~ /^\s*?$/
- if COMMENTS_ARE_UPPER
- comment_block.unshift line.sub(/^\s*?!\s?/,"")
- else
- comment_block.push line.sub(/^\s*?!\s?/,"")
- end
- end
- nice_lines = comment_block.join("\n").split "\n\s*?\n"
- nice_lines[0] ||= ""
- nice_lines.shift
- end
-
- ##
- # Create method for internal alias
-
- def initialize_public_method(method, parent)
- return if !method || !parent
-
- new_meth = AnyMethod.new("External Alias for module", method.name)
- new_meth.singleton = method.singleton
- new_meth.params = method.params.clone
- new_meth.comment = remove_trailing_alias(method.comment.clone)
- new_meth.comment << "\n\n#{EXTERNAL_ALIAS_MES} #{parent.strip.chomp}\##{method.name}"
-
- return new_meth
- end
-
- ##
- # Create method for external alias
- #
- # If argument "internal" is true, file is ignored.
-
- def initialize_external_method(new, old, params, file, comment, token=nil,
- internal=nil, nolink=nil)
- return nil unless new || old
-
- if internal
- external_alias_header = "#{INTERNAL_ALIAS_MES} "
- external_alias_text = external_alias_header + old
- elsif file
- external_alias_header = "#{EXTERNAL_ALIAS_MES} "
- external_alias_text = external_alias_header + file + "#" + old
- else
- return nil
- end
- external_meth = AnyMethod.new(external_alias_text, new)
- external_meth.singleton = false
- external_meth.params = params
- external_comment = remove_trailing_alias(comment) + "\n\n" if comment
- external_meth.comment = external_comment || ""
- if nolink && token
- external_meth.start_collecting_tokens
- external_meth.add_token Token.new(1,1).set_text(token)
- else
- external_meth.comment << external_alias_text
- end
-
- return external_meth
- end
-
- ##
- # Parse visibility
-
- def parse_visibility(code, default, container)
- result = []
- visibility_default = default || :public
-
- used_modules = []
- container.includes.each{|i| used_modules << i.name} if container
-
- remaining_code = code.gsub(/^\s*?type[\s\,]+.*?\s+end\s+type.*?$/im, "")
- remaining_code.split("\n").each{ |line|
- if /^\s*?private\s*?$/ =~ line
- visibility_default = :private
- break
- end
- } if remaining_code
-
- remaining_code.split("\n").each{ |line|
- if /^\s*?private\s*?(::)?\s+(.*)\s*?(!.*?)?/i =~ line
- methods = $2.sub(/!.*$/, '')
- methods.split(",").each{ |meth|
- meth.sub!(/!.*$/, '')
- meth.gsub!(/:/, '')
- result << {
- "name" => meth.chomp.strip,
- "visibility" => :private,
- "used_modules" => used_modules.clone,
- "file_or_module" => container,
- "entity_is_discovered" => nil,
- "local_name" => nil
- }
- }
- elsif /^\s*?public\s*?(::)?\s+(.*)\s*?(!.*?)?/i =~ line
- methods = $2.sub(/!.*$/, '')
- methods.split(",").each{ |meth|
- meth.sub!(/!.*$/, '')
- meth.gsub!(/:/, '')
- result << {
- "name" => meth.chomp.strip,
- "visibility" => :public,
- "used_modules" => used_modules.clone,
- "file_or_module" => container,
- "entity_is_discovered" => nil,
- "local_name" => nil
- }
- }
- end
- } if remaining_code
-
- if container
- result.each{ |vis_info|
- vis_info["parent"] = container.name
- }
- end
-
- return visibility_default, result
- end
-
- ##
- # Set visibility
- #
- # "subname" element of "visibility_info" is deleted.
-
- def set_visibility(container, subname, visibility_default, visibility_info)
- return unless container || subname || visibility_default || visibility_info
- not_found = true
- visibility_info.collect!{ |info|
- if info["name"] == subname ||
- @options.ignore_case && info["name"].upcase == subname.upcase
- if info["file_or_module"].name == container.name
- container.set_visibility_for([subname], info["visibility"])
- info["entity_is_discovered"] = true
- not_found = false
- end
- end
- info
- }
- if not_found
- return container.set_visibility_for([subname], visibility_default)
- else
- return container
- end
- end
-
- ##
- # Find visibility
-
- def find_visibility(container, subname, visibility_info)
- return nil if !subname || !visibility_info
- visibility_info.each{ |info|
- if info["name"] == subname ||
- @options.ignore_case && info["name"].upcase == subname.upcase
- if info["parent"] == container.name
- return info["visibility"]
- end
- end
- }
- return nil
- end
-
- ##
- # Check external aliases
-
- def check_external_aliases(subname, params, comment, test=nil)
- @@external_aliases.each{ |alias_item|
- if subname == alias_item["old_name"] ||
- subname.upcase == alias_item["old_name"].upcase &&
- @options.ignore_case
-
- new_meth = initialize_external_method(alias_item["new_name"],
- subname, params, @file_name,
- comment)
- new_meth.visibility = alias_item["visibility"]
-
- @stats.add_method new_meth
-
- alias_item["file_or_module"].add_method(new_meth)
-
- if !alias_item["file_or_module"].include_requires?(@file_name, @options.ignore_case)
- alias_item["file_or_module"].add_require(Require.new(@file_name, ""))
- end
- end
- }
- end
-
- ##
- # Check public_methods
-
- def check_public_methods(method, parent)
- return if !method || !parent
- @@public_methods.each{ |alias_item|
- parent_is_used_module = nil
- alias_item["used_modules"].each{ |used_module|
- if used_module == parent ||
- used_module.upcase == parent.upcase &&
- @options.ignore_case
- parent_is_used_module = true
- end
- }
- next if !parent_is_used_module
-
- if method.name == alias_item["name"] ||
- method.name.upcase == alias_item["name"].upcase &&
- @options.ignore_case
-
- new_meth = initialize_public_method(method, parent)
- if alias_item["local_name"]
- new_meth.name = alias_item["local_name"]
- end
-
- @stats.add_method new_meth
-
- alias_item["file_or_module"].add_method new_meth
- end
- }
- end
-
- ##
- # Continuous lines are united.
- #
- # Comments in continuous lines are removed.
-
- def united_to_one_line(f90src)
- return "" unless f90src
- lines = f90src.split("\n")
- previous_continuing = false
- now_continuing = false
- body = ""
- lines.each{ |line|
- words = line.split("")
- next if words.empty? && previous_continuing
- commentout = false
- brank_flag = true ; brank_char = ""
- squote = false ; dquote = false
- ignore = false
- words.collect! { |char|
- if previous_continuing && brank_flag
- now_continuing = true
- ignore = true
- case char
- when "!" ; break
- when " " ; brank_char << char ; next ""
- when "&"
- brank_flag = false
- now_continuing = false
- next ""
- else
- brank_flag = false
- now_continuing = false
- ignore = false
- next brank_char + char
- end
- end
- ignore = false
-
- if now_continuing
- next ""
- elsif !(squote) && !(dquote) && !(commentout)
- case char
- when "!" ; commentout = true ; next char
- when "\""; dquote = true ; next char
- when "\'"; squote = true ; next char
- when "&" ; now_continuing = true ; next ""
- else next char
- end
- elsif commentout
- next char
- elsif squote
- case char
- when "\'"; squote = false ; next char
- else next char
- end
- elsif dquote
- case char
- when "\""; dquote = false ; next char
- else next char
- end
- end
- }
- if !ignore && !previous_continuing || !brank_flag
- if previous_continuing
- body << words.join("")
- else
- body << "\n" + words.join("")
- end
- end
- previous_continuing = now_continuing ? true : nil
- now_continuing = nil
- }
- return body
- end
-
-
- ##
- # Continuous line checker
-
- def continuous_line?(line)
- continuous = false
- if /&\s*?(!.*)?$/ =~ line
- continuous = true
- if comment_out?($~.pre_match)
- continuous = false
- end
- end
- return continuous
- end
-
- ##
- # Comment out checker
-
- def comment_out?(line)
- return nil unless line
- commentout = false
- squote = false ; dquote = false
- line.split("").each { |char|
- if !(squote) && !(dquote)
- case char
- when "!" ; commentout = true ; break
- when "\""; dquote = true
- when "\'"; squote = true
- else next
- end
- elsif squote
- case char
- when "\'"; squote = false
- else next
- end
- elsif dquote
- case char
- when "\""; dquote = false
- else next
- end
- end
- }
- return commentout
- end
-
- ##
- # Semicolons are replaced to line feed.
-
- def semicolon_to_linefeed(text)
- return "" unless text
- lines = text.split("\n")
- lines.collect!{ |line|
- words = line.split("")
- commentout = false
- squote = false ; dquote = false
- words.collect! { |char|
- if !(squote) && !(dquote) && !(commentout)
- case char
- when "!" ; commentout = true ; next char
- when "\""; dquote = true ; next char
- when "\'"; squote = true ; next char
- when ";" ; "\n"
- else next char
- end
- elsif commentout
- next char
- elsif squote
- case char
- when "\'"; squote = false ; next char
- else next char
- end
- elsif dquote
- case char
- when "\""; dquote = false ; next char
- else next char
- end
- end
- }
- words.join("")
- }
- return lines.join("\n")
- end
-
- ##
- # Which "line" is start of block (module, program, block data, subroutine,
- # function) statement ?
-
- def block_start?(line)
- return nil if !line
-
- if line =~ /^\s*?module\s+(\w+)\s*?(!.*?)?$/i ||
- line =~ /^\s*?program\s+(\w+)\s*?(!.*?)?$/i ||
- line =~ /^\s*?block\s+data(\s+\w+)?\s*?(!.*?)?$/i ||
- line =~ \
- /^\s*?
- (recursive|pure|elemental)?\s*?
- subroutine\s+(\w+)\s*?(\(.*?\))?\s*?(!.*?)?$
- /ix ||
- line =~ \
- /^\s*?
- (recursive|pure|elemental)?\s*?
- (
- character\s*?(\([\w\s\=\(\)\*]+?\))?\s+
- | type\s*?\([\w\s]+?\)\s+
- | integer\s*?(\([\w\s\=\(\)\*]+?\))?\s+
- | real\s*?(\([\w\s\=\(\)\*]+?\))?\s+
- | double\s+precision\s+
- | logical\s*?(\([\w\s\=\(\)\*]+?\))?\s+
- | complex\s*?(\([\w\s\=\(\)\*]+?\))?\s+
- )?
- function\s+(\w+)\s*?
- (\(.*?\))?(\s+result\((.*?)\))?\s*?(!.*?)?$
- /ix
- return true
- end
-
- return nil
- end
-
- ##
- # Which "line" is end of block (module, program, block data, subroutine,
- # function) statement ?
-
- def block_end?(line)
- return nil if !line
-
- if line =~ /^\s*?end\s*?(!.*?)?$/i ||
- line =~ /^\s*?end\s+module(\s+\w+)?\s*?(!.*?)?$/i ||
- line =~ /^\s*?end\s+program(\s+\w+)?\s*?(!.*?)?$/i ||
- line =~ /^\s*?end\s+block\s+data(\s+\w+)?\s*?(!.*?)?$/i ||
- line =~ /^\s*?end\s+subroutine(\s+\w+)?\s*?(!.*?)?$/i ||
- line =~ /^\s*?end\s+function(\s+\w+)?\s*?(!.*?)?$/i
- return true
- end
-
- return nil
- end
-
- ##
- # Remove "Alias for" in end of comments
-
- def remove_trailing_alias(text)
- return "" if !text
- lines = text.split("\n").reverse
- comment_block = Array.new
- checked = false
- lines.each do |line|
- if !checked
- if /^\s?#{INTERNAL_ALIAS_MES}/ =~ line ||
- /^\s?#{EXTERNAL_ALIAS_MES}/ =~ line
- checked = true
- next
- end
- end
- comment_block.unshift line
- end
- nice_lines = comment_block.join("\n")
- nice_lines ||= ""
- return nice_lines
- end
-
- ##
- # Empty lines in header are removed
-
- def remove_empty_head_lines(text)
- return "" unless text
- lines = text.split("\n")
- header = true
- lines.delete_if{ |line|
- header = false if /\S/ =~ line
- header && /^\s*?$/ =~ line
- }
- lines.join("\n")
- end
-
- ##
- # header marker "=", "==", ... are removed
-
- def remove_header_marker(text)
- return text.gsub(/^\s?(=+)/, '<tt></tt>\1')
- end
-
- def remove_private_comments(body)
- body.gsub!(/^\s*!--\s*?$.*?^\s*!\+\+\s*?$/m, '')
- return body
- end
-
- ##
- # Information of arguments of subroutines and functions in Fortran95
-
- class Fortran95Definition
-
- # Name of variable
- #
- attr_reader :varname
-
- # Types of variable
- #
- attr_reader :types
-
- # Initial Value
- #
- attr_reader :inivalue
-
- # Suffix of array
- #
- attr_reader :arraysuffix
-
- # Comments
- #
- attr_accessor :comment
-
- # Flag of non documentation
- #
- attr_accessor :nodoc
-
- def initialize(varname, types, inivalue, arraysuffix, comment,
- nodoc=false)
- @varname = varname
- @types = types
- @inivalue = inivalue
- @arraysuffix = arraysuffix
- @comment = comment
- @nodoc = nodoc
- end
-
- def to_s
- return <<-EOF
-<Fortran95Definition:
-varname=#{@varname}, types=#{types},
-inivalue=#{@inivalue}, arraysuffix=#{@arraysuffix}, nodoc=#{@nodoc},
-comment=
-#{@comment}
->
-EOF
- end
-
- #
- # If attr is included, true is returned
- #
- def include_attr?(attr)
- return if !attr
- @types.split(",").each{ |type|
- return true if type.strip.chomp.upcase == attr.strip.chomp.upcase
- }
- return nil
- end
-
- end # End of Fortran95Definition
-
- ##
- # Parse string argument "text", and Return Array of Fortran95Definition
- # object
-
- def definition_info(text)
- return nil unless text
- lines = "#{text}"
- defs = Array.new
- comment = ""
- trailing_comment = ""
- under_comment_valid = false
- lines.split("\n").each{ |line|
- if /^\s*?!\s?(.*)/ =~ line
- if COMMENTS_ARE_UPPER
- comment << remove_header_marker($1)
- comment << "\n"
- elsif defs[-1] && under_comment_valid
- defs[-1].comment << "\n"
- defs[-1].comment << remove_header_marker($1)
- end
- next
- elsif /^\s*?$/ =~ line
- comment = ""
- under_comment_valid = false
- next
- end
- type = ""
- characters = ""
- if line =~ /^\s*?
- (
- character\s*?(\([\w\s\=\(\)\*]+?\))?[\s\,]*
- | type\s*?\([\w\s]+?\)[\s\,]*
- | integer\s*?(\([\w\s\=\(\)\*]+?\))?[\s\,]*
- | real\s*?(\([\w\s\=\(\)\*]+?\))?[\s\,]*
- | double\s+precision[\s\,]*
- | logical\s*?(\([\w\s\=\(\)\*]+?\))?[\s\,]*
- | complex\s*?(\([\w\s\=\(\)\*]+?\))?[\s\,]*
- )
- (.*?::)?
- (.+)$
- /ix
- characters = $8
- type = $1
- type << $7.gsub(/::/, '').gsub(/^\s*?\,/, '') if $7
- else
- under_comment_valid = false
- next
- end
- squote = false ; dquote = false ; bracket = 0
- iniflag = false; commentflag = false
- varname = "" ; arraysuffix = "" ; inivalue = ""
- start_pos = defs.size
- characters.split("").each { |char|
- if !(squote) && !(dquote) && bracket <= 0 && !(iniflag) && !(commentflag)
- case char
- when "!" ; commentflag = true
- when "(" ; bracket += 1 ; arraysuffix = char
- when "\""; dquote = true
- when "\'"; squote = true
- when "=" ; iniflag = true ; inivalue << char
- when ","
- defs << Fortran95Definition.new(varname, type, inivalue, arraysuffix, comment)
- varname = "" ; arraysuffix = "" ; inivalue = ""
- under_comment_valid = true
- when " " ; next
- else ; varname << char
- end
- elsif commentflag
- comment << remove_header_marker(char)
- trailing_comment << remove_header_marker(char)
- elsif iniflag
- if dquote
- case char
- when "\"" ; dquote = false ; inivalue << char
- else ; inivalue << char
- end
- elsif squote
- case char
- when "\'" ; squote = false ; inivalue << char
- else ; inivalue << char
- end
- elsif bracket > 0
- case char
- when "(" ; bracket += 1 ; inivalue << char
- when ")" ; bracket -= 1 ; inivalue << char
- else ; inivalue << char
- end
- else
- case char
- when ","
- defs << Fortran95Definition.new(varname, type, inivalue, arraysuffix, comment)
- varname = "" ; arraysuffix = "" ; inivalue = ""
- iniflag = false
- under_comment_valid = true
- when "(" ; bracket += 1 ; inivalue << char
- when "\""; dquote = true ; inivalue << char
- when "\'"; squote = true ; inivalue << char
- when "!" ; commentflag = true
- else ; inivalue << char
- end
- end
- elsif !(squote) && !(dquote) && bracket > 0
- case char
- when "(" ; bracket += 1 ; arraysuffix << char
- when ")" ; bracket -= 1 ; arraysuffix << char
- else ; arraysuffix << char
- end
- elsif squote
- case char
- when "\'"; squote = false ; inivalue << char
- else ; inivalue << char
- end
- elsif dquote
- case char
- when "\""; dquote = false ; inivalue << char
- else ; inivalue << char
- end
- end
- }
- defs << Fortran95Definition.new(varname, type, inivalue, arraysuffix, comment)
- if trailing_comment =~ /^:nodoc:/
- defs[start_pos..-1].collect!{ |defitem|
- defitem.nodoc = true
- }
- end
- varname = "" ; arraysuffix = "" ; inivalue = ""
- comment = ""
- under_comment_valid = true
- trailing_comment = ""
- }
- return defs
- end
-
-end
-
diff --git a/lib/rdoc/parser/perl.rb b/lib/rdoc/parser/perl.rb
deleted file mode 100644
index 0023a013a6..0000000000
--- a/lib/rdoc/parser/perl.rb
+++ /dev/null
@@ -1,165 +0,0 @@
-require 'rdoc/parser'
-
-##
-#
-# This is an attamept to write a basic parser for Perl's
-# POD (Plain old Documentation) format. Ruby code must
-# co-exist with Perl, and some tasks are easier in Perl
-# than Ruby because of existing libraries.
-#
-# One difficult is that Perl POD has no means of identifying
-# the classes (packages) and methods (subs) with which it
-# is associated, it is more like literate programming in so
-# far as it just happens to be in the same place as the code,
-# but need not be.
-#
-# We would like to support all the markup the POD provides
-# so that it will convert happily to HTML. At the moment
-# I don't think I can do that: time constraints.
-#
-
-class RDoc::Parser::PerlPOD < RDoc::Parser
-
- parse_files_matching(/.p[lm]$/)
-
- ##
- # Prepare to parse a perl file
-
- def initialize(top_level, file_name, content, options, stats)
- super
-
- preprocess = RDoc::Markup::PreProcess.new @file_name, @options.rdoc_include
-
- preprocess.handle @content do |directive, param|
- warn "Unrecognized directive '#{directive}' in #{@file_name}"
- end
- end
-
- ##
- # Extract the Pod(-like) comments from the code.
- # At its most basic there will ne no need to distinguish
- # between the different types of header, etc.
- #
- # This uses a simple finite state machine, in a very
- # procedural pattern. I could "replace case with polymorphism"
- # but I think it would obscure the intent, scatter the
- # code all over tha place. This machine is necessary
- # because POD requires that directives be preceded by
- # blank lines, so reading line by line is necessary,
- # and preserving state about what is seen is necesary.
-
- def scan
-
- @top_level.comment ||= ""
- state=:code_blank
- line_number = 0
- line = nil
-
- # This started out as a really long nested case statement,
- # which also led to repetitive code. I'd like to avoid that
- # so I'm using a "table" instead.
-
- # Firstly we need some procs to do the transition and processing
- # work. Because these are procs they are closures, and they can
- # use variables in the local scope.
- #
- # First, the "nothing to see here" stuff.
- code_noop = lambda do
- if line =~ /^\s+$/
- state = :code_blank
- end
- end
-
- pod_noop = lambda do
- if line =~ /^\s+$/
- state = :pod_blank
- end
- @top_level.comment += filter(line)
- end
-
- begin_noop = lambda do
- if line =~ /^\s+$/
- state = :begin_blank
- end
- @top_level.comment += filter(line)
- end
-
- # Now for the blocks that process code and comments...
-
- transit_to_pod = lambda do
- case line
- when /^=(?:pod|head\d+)/
- state = :pod_no_blank
- @top_level.comment += filter(line)
- when /^=over/
- state = :over_no_blank
- @top_level.comment += filter(line)
- when /^=(?:begin|for)/
- state = :begin_no_blank
- end
- end
-
- process_pod = lambda do
- case line
- when /^\s*$/
- state = :pod_blank
- @top_level.comment += filter(line)
- when /^=cut/
- state = :code_no_blank
- when /^=end/
- $stderr.puts "'=end' unexpected at #{line_number} in #{@file_name}"
- else
- @top_level.comment += filter(line)
- end
- end
-
-
- process_begin = lambda do
- case line
- when /^\s*$/
- state = :begin_blank
- @top_level.comment += filter(line)
- when /^=end/
- state = :code_no_blank
- when /^=cut/
- $stderr.puts "'=cut' unexpected at #{line_number} in #{@file_name}"
- else
- @top_level.comment += filter(line)
- end
-
- end
-
-
- transitions = { :code_no_blank => code_noop,
- :code_blank => transit_to_pod,
- :pod_no_blank => pod_noop,
- :pod_blank => process_pod,
- :begin_no_blank => begin_noop,
- :begin_blank => process_begin}
- @content.each_line do |l|
- line = l
- line_number += 1
- transitions[state].call
- end # each line
-
- @top_level
- end
-
- # Filter the perl markup that does the same as the rdoc
- # filtering. Only basic for now. Will probably need a
- # proper parser to cope with C<<...>> etc
- def filter(comment)
- return '' if comment =~ /^=pod\s*$/
- comment.gsub!(/^=pod/, '==')
- comment.gsub!(/^=head(\d+)/) do
- "=" * $1.to_i
- end
- comment.gsub!(/=item/, '');
- comment.gsub!(/C<(.*?)>/, '<tt>\1</tt>');
- comment.gsub!(/I<(.*?)>/, '<i>\1</i>');
- comment.gsub!(/B<(.*?)>/, '<b>\1</b>');
- comment
- end
-
-end
-
diff --git a/lib/rdoc/parser/ruby.rb b/lib/rdoc/parser/ruby.rb
deleted file mode 100644
index cf6c1ad221..0000000000
--- a/lib/rdoc/parser/ruby.rb
+++ /dev/null
@@ -1,2829 +0,0 @@
-##
-# This file contains stuff stolen outright from:
-#
-# rtags.rb -
-# ruby-lex.rb - ruby lexcal analyzer
-# ruby-token.rb - ruby tokens
-# by Keiju ISHITSUKA (Nippon Rational Inc.)
-#
-
-require 'e2mmap'
-require 'irb/slex'
-
-require 'rdoc/code_objects'
-require 'rdoc/tokenstream'
-require 'rdoc/markup/preprocess'
-require 'rdoc/parser'
-
-$TOKEN_DEBUG ||= nil
-#$TOKEN_DEBUG = $DEBUG_RDOC
-
-##
-# Definitions of all tokens involved in the lexical analysis
-
-module RDoc::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
- NO_TEXT = "??".freeze
-
- attr_accessor :text
- attr_reader :line_no
- attr_reader :char_no
-
- def initialize(line_no, char_no)
- @line_no = line_no
- @char_no = char_no
- @text = NO_TEXT
- end
-
- def ==(other)
- self.class == other.class and
- other.line_no == @line_no and
- other.char_no == @char_no and
- other.text == @text
- end
-
- ##
- # Because we're used in contexts that expect to return a token, we set the
- # text string and then return ourselves
-
- def set_text(text)
- @text = text
- self
- end
-
- end
-
- class TkNode < Token
- attr :node
- end
-
- class TkId < Token
- def initialize(line_no, char_no, name)
- super(line_no, char_no)
- @name = name
- end
- attr :name
- end
-
- class TkKW < TkId
- end
-
- class TkVal < Token
- def initialize(line_no, char_no, value = nil)
- super(line_no, char_no)
- set_text(value)
- end
- end
-
- class TkOp < Token
- def name
- self.class.op_name
- end
- end
-
- class TkOPASGN < TkOp
- def initialize(line_no, char_no, op)
- super(line_no, char_no)
- op = TkReading2Token[op] unless Symbol === op
- @op = op
- end
- attr :op
- end
-
- class TkUnknownChar < Token
- def initialize(line_no, char_no, id)
- super(line_no, char_no)
- @name = char_no.chr
- end
- attr :name
- end
-
- class TkError < Token
- end
-
- def set_token_position(line, char)
- @prev_line_no = line
- @prev_char_no = char
- end
-
- def Token(token, value = nil)
- tk = nil
- case token
- when String, Symbol
- source = String === token ? TkReading2Token : TkSymbol2Token
- raise TkReading2TokenNoKey, token if (tk = source[token]).nil?
- tk = Token(tk[0], value)
- else
- tk = if (token.ancestors & [TkId, TkVal, TkOPASGN, TkUnknownChar]).empty?
- token.new(@prev_line_no, @prev_char_no)
- else
- token.new(@prev_line_no, @prev_char_no, value)
- end
- end
- tk
- end
-
- TokenDefinitions = [
- [:TkCLASS, TkKW, "class", EXPR_CLASS],
- [:TkMODULE, TkKW, "module", EXPR_CLASS],
- [:TkDEF, TkKW, "def", EXPR_FNAME],
- [:TkUNDEF, TkKW, "undef", EXPR_FNAME],
- [:TkBEGIN, TkKW, "begin", EXPR_BEG],
- [:TkRESCUE, TkKW, "rescue", EXPR_MID],
- [:TkENSURE, TkKW, "ensure", EXPR_BEG],
- [:TkEND, TkKW, "end", EXPR_END],
- [:TkIF, TkKW, "if", EXPR_BEG, :TkIF_MOD],
- [:TkUNLESS, TkKW, "unless", EXPR_BEG, :TkUNLESS_MOD],
- [:TkTHEN, TkKW, "then", EXPR_BEG],
- [:TkELSIF, TkKW, "elsif", EXPR_BEG],
- [:TkELSE, TkKW, "else", EXPR_BEG],
- [:TkCASE, TkKW, "case", EXPR_BEG],
- [:TkWHEN, TkKW, "when", EXPR_BEG],
- [:TkWHILE, TkKW, "while", EXPR_BEG, :TkWHILE_MOD],
- [:TkUNTIL, TkKW, "until", EXPR_BEG, :TkUNTIL_MOD],
- [:TkFOR, TkKW, "for", EXPR_BEG],
- [:TkBREAK, TkKW, "break", EXPR_END],
- [:TkNEXT, TkKW, "next", EXPR_END],
- [:TkREDO, TkKW, "redo", EXPR_END],
- [:TkRETRY, TkKW, "retry", EXPR_END],
- [:TkIN, TkKW, "in", EXPR_BEG],
- [:TkDO, TkKW, "do", EXPR_BEG],
- [:TkRETURN, TkKW, "return", EXPR_MID],
- [:TkYIELD, TkKW, "yield", EXPR_END],
- [:TkSUPER, TkKW, "super", EXPR_END],
- [:TkSELF, TkKW, "self", EXPR_END],
- [:TkNIL, TkKW, "nil", EXPR_END],
- [:TkTRUE, TkKW, "true", EXPR_END],
- [:TkFALSE, TkKW, "false", EXPR_END],
- [:TkAND, TkKW, "and", EXPR_BEG],
- [:TkOR, TkKW, "or", EXPR_BEG],
- [:TkNOT, TkKW, "not", EXPR_BEG],
- [:TkIF_MOD, TkKW],
- [:TkUNLESS_MOD, TkKW],
- [:TkWHILE_MOD, TkKW],
- [:TkUNTIL_MOD, TkKW],
- [:TkALIAS, TkKW, "alias", EXPR_FNAME],
- [:TkDEFINED, TkKW, "defined?", EXPR_END],
- [:TklBEGIN, TkKW, "BEGIN", EXPR_END],
- [:TklEND, TkKW, "END", EXPR_END],
- [:Tk__LINE__, TkKW, "__LINE__", EXPR_END],
- [:Tk__FILE__, TkKW, "__FILE__", EXPR_END],
-
- [:TkIDENTIFIER, TkId],
- [:TkFID, TkId],
- [:TkGVAR, TkId],
- [:TkIVAR, TkId],
- [:TkCONSTANT, TkId],
-
- [:TkINTEGER, TkVal],
- [:TkFLOAT, TkVal],
- [:TkSTRING, TkVal],
- [:TkXSTRING, TkVal],
- [:TkREGEXP, TkVal],
- [:TkCOMMENT, TkVal],
-
- [:TkDSTRING, TkNode],
- [:TkDXSTRING, TkNode],
- [:TkDREGEXP, TkNode],
- [:TkNTH_REF, TkId],
- [:TkBACK_REF, TkId],
-
- [:TkUPLUS, TkOp, "+@"],
- [:TkUMINUS, TkOp, "-@"],
- [:TkPOW, TkOp, "**"],
- [:TkCMP, TkOp, "<=>"],
- [:TkEQ, TkOp, "=="],
- [:TkEQQ, TkOp, "==="],
- [:TkNEQ, TkOp, "!="],
- [:TkGEQ, TkOp, ">="],
- [:TkLEQ, TkOp, "<="],
- [:TkANDOP, TkOp, "&&"],
- [:TkOROP, TkOp, "||"],
- [:TkMATCH, TkOp, "=~"],
- [:TkNMATCH, TkOp, "!~"],
- [:TkDOT2, TkOp, ".."],
- [:TkDOT3, TkOp, "..."],
- [:TkAREF, TkOp, "[]"],
- [:TkASET, TkOp, "[]="],
- [:TkLSHFT, TkOp, "<<"],
- [:TkRSHFT, TkOp, ">>"],
- [:TkCOLON2, TkOp],
- [:TkCOLON3, TkOp],
-# [:OPASGN, TkOp], # +=, -= etc. #
- [:TkASSOC, TkOp, "=>"],
- [:TkQUESTION, TkOp, "?"], #?
- [:TkCOLON, TkOp, ":"], #:
-
- [:TkfLPAREN], # func( #
- [:TkfLBRACK], # func[ #
- [:TkfLBRACE], # func{ #
- [:TkSTAR], # *arg
- [:TkAMPER], # &arg #
- [:TkSYMBOL, TkId], # :SYMBOL
- [:TkSYMBEG, TkId],
- [: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, ";"],
-
- [:TkRD_COMMENT],
- [:TkSPACE],
- [:TkNL],
- [:TkEND_OF_SCRIPT],
-
- [:TkBACKSLASH, TkUnknownChar, "\\"],
- [:TkAT, TkUnknownChar, "@"],
- [:TkDOLLAR, TkUnknownChar, "\$"], #"
- ]
-
- # {reading => token_class}
- # {reading => [token_class, *opt]}
- TkReading2Token = {}
- TkSymbol2Token = {}
-
- def self.def_token(token_n, super_token = Token, reading = nil, *opts)
- token_n = token_n.id2name unless String === token_n
-
- fail AlreadyDefinedToken, token_n if const_defined?(token_n)
-
- token_c = Class.new super_token
- const_set token_n, token_c
-# token_c.inspect
-
- if reading
- if TkReading2Token[reading]
- 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
-
- if token_c <= TkOp
- token_c.class_eval %{
- def self.op_name; "#{reading}"; end
- }
- end
- end
-
- for defs in TokenDefinitions
- def_token(*defs)
- end
-
- NEWLINE_TOKEN = TkNL.new(0,0)
- NEWLINE_TOKEN.set_text("\n")
-
-end
-
-##
-# Lexical analyzer for Ruby source
-
-class RDoc::RubyLex
-
- ##
- # Read an input stream character by character. We allow for unlimited
- # ungetting of characters just read.
- #
- # We simplify the implementation greatly by reading the entire input
- # into a buffer initially, and then simply traversing it using
- # pointers.
- #
- # We also have to allow for the <i>here document diversion</i>. This
- # little gem comes about when the lexer encounters a here
- # document. At this point we effectively need to split the input
- # stream into two parts: one to read the body of the here document,
- # the other to read the rest of the input line where the here
- # document was initially encountered. For example, we might have
- #
- # do_something(<<-A, <<-B)
- # stuff
- # for
- # A
- # stuff
- # for
- # B
- #
- # When the lexer encounters the <<A, it reads until the end of the
- # line, and keeps it around for later. It then reads the body of the
- # here document. Once complete, it needs to read the rest of the
- # original line, but then skip the here document body.
- #
-
- class BufferedReader
-
- attr_reader :line_num
-
- def initialize(content, options)
- @options = options
-
- if /\t/ =~ content
- tab_width = @options.tab_width
- content = content.split(/\n/).map do |line|
- 1 while line.gsub!(/\t+/) { ' ' * (tab_width*$&.length - $`.length % tab_width)} && $~ #`
- line
- end .join("\n")
- end
- @content = content
- @content << "\n" unless @content[-1,1] == "\n"
- @size = @content.size
- @offset = 0
- @hwm = 0
- @line_num = 1
- @read_back_offset = 0
- @last_newline = 0
- @newline_pending = false
- end
-
- def column
- @offset - @last_newline
- end
-
- def getc
- return nil if @offset >= @size
- ch = @content[@offset, 1]
-
- @offset += 1
- @hwm = @offset if @hwm < @offset
-
- if @newline_pending
- @line_num += 1
- @last_newline = @offset - 1
- @newline_pending = false
- end
-
- if ch == "\n"
- @newline_pending = true
- end
- ch
- end
-
- def getc_already_read
- getc
- end
-
- def ungetc(ch)
- raise "unget past beginning of file" if @offset <= 0
- @offset -= 1
- if @content[@offset] == ?\n
- @newline_pending = false
- end
- end
-
- def get_read
- res = @content[@read_back_offset...@offset]
- @read_back_offset = @offset
- res
- end
-
- def peek(at)
- pos = @offset + at
- if pos >= @size
- nil
- else
- @content[pos, 1]
- end
- end
-
- def peek_equal(str)
- @content[@offset, str.length] == str
- end
-
- def divert_read_from(reserve)
- @content[@offset, 0] = reserve
- @size = @content.size
- end
- end
-
- # end of nested class BufferedReader
-
- 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")
-
- include RDoc::RubyToken
- include IRB
-
- attr_reader :continue
- attr_reader :lex_state
-
- def self.debug?
- false
- end
-
- def initialize(content, options)
- lex_init
-
- @options = options
-
- @reader = BufferedReader.new content, @options
-
- @exp_line_no = @line_no = 1
- @base_char_no = 0
- @indent = 0
-
- @ltype = nil
- @quoted = nil
- @lex_state = EXPR_BEG
- @space_seen = false
-
- @continue = false
- @line = ""
-
- @skip_space = false
- @read_auto_clean_up = false
- @exception_on_syntax_error = true
- end
-
- attr_accessor :skip_space
- attr_accessor :read_auto_clean_up
- attr_accessor :exception_on_syntax_error
- attr_reader :indent
-
- # io functions
- def line_no
- @reader.line_num
- end
-
- def char_no
- @reader.column
- end
-
- def get_read
- @reader.get_read
- end
-
- def getc
- @reader.getc
- end
-
- def getc_of_rests
- @reader.getc_already_read
- end
-
- def gets
- c = getc or return
- l = ""
- begin
- l.concat c unless c == "\r"
- break if c == "\n"
- end while c = getc
- l
- end
-
-
- def ungetc(c = nil)
- @reader.ungetc(c)
- end
-
- def peek_equal?(str)
- @reader.peek_equal(str)
- end
-
- def peek(i = 0)
- @reader.peek(i)
- end
-
- def lex
- until (TkNL === (tk = token) or TkEND_OF_SCRIPT === tk) and
- not @continue or tk.nil?
- end
-
- line = get_read
-
- if line == "" and TkEND_OF_SCRIPT === tk or tk.nil? then
- nil
- else
- line
- end
- end
-
- def token
- set_token_position(line_no, char_no)
- begin
- begin
- tk = @OP.match(self)
- @space_seen = TkSPACE === tk
- rescue SyntaxError => e
- raise RDoc::Error, "syntax error: #{e.message}" if
- @exception_on_syntax_error
-
- tk = TkError.new(line_no, char_no)
- end
- end while @skip_space and TkSPACE === tk
- if @read_auto_clean_up
- get_read
- end
-# throw :eof unless tk
- tk
- end
-
- ENINDENT_CLAUSE = [
- "case", "class", "def", "do", "for", "if",
- "module", "unless", "until", "while", "begin" #, "when"
- ]
- DEINDENT_CLAUSE = ["end" #, "when"
- ]
-
- PERCENT_LTYPE = {
- "q" => "\'",
- "Q" => "\"",
- "x" => "\`",
- "r" => "/",
- "w" => "]"
- }
-
- PERCENT_PAREN = {
- "{" => "}",
- "[" => "]",
- "<" => ">",
- "(" => ")"
- }
-
- Ltype2Token = {
- "\'" => TkSTRING,
- "\"" => TkSTRING,
- "\`" => TkXSTRING,
- "/" => TkREGEXP,
- "]" => TkDSTRING
- }
- Ltype2Token.default = TkSTRING
-
- DLtype2Token = {
- "\"" => TkDSTRING,
- "\`" => TkDXSTRING,
- "/" => TkDREGEXP,
- }
-
- def lex_init()
- @OP = IRB::SLex.new
- @OP.def_rules("\0", "\004", "\032") do |chars, io|
- Token(TkEND_OF_SCRIPT).set_text(chars)
- end
-
- @OP.def_rules(" ", "\t", "\f", "\r", "\13") do |chars, io|
- @space_seen = TRUE
- while (ch = getc) =~ /[ \t\f\r\13]/
- chars << ch
- end
- ungetc
- Token(TkSPACE).set_text(chars)
- end
-
- @OP.def_rule("#") do
- |op, io|
- identify_comment
- end
-
- @OP.def_rule("=begin", proc{@prev_char_no == 0 && peek(0) =~ /\s/}) do
- |op, io|
- str = op
- @ltype = "="
-
-
- begin
- line = ""
- begin
- ch = getc
- line << ch
- end until ch == "\n"
- str << line
- end until line =~ /^=end/
-
- ungetc
-
- @ltype = nil
-
- if str =~ /\A=begin\s+rdoc/i
- str.sub!(/\A=begin.*\n/, '')
- str.sub!(/^=end.*/m, '')
- Token(TkCOMMENT).set_text(str)
- else
- Token(TkRD_COMMENT)#.set_text(str)
- end
- end
-
- @OP.def_rule("\n") do
- print "\\n\n" if RDoc::RubyLex.debug?
- case @lex_state
- when EXPR_BEG, EXPR_FNAME, EXPR_DOT
- @continue = TRUE
- else
- @continue = FALSE
- @lex_state = EXPR_BEG
- end
- Token(TkNL).set_text("\n")
- end
-
- @OP.def_rules("*", "**",
- "!", "!=", "!~",
- "=", "==", "===",
- "=~", "<=>",
- "<", "<=",
- ">", ">=", ">>") do
- |op, io|
- @lex_state = EXPR_BEG
- Token(op).set_text(op)
- end
-
- @OP.def_rules("<<") do
- |op, io|
- tk = nil
- if @lex_state != EXPR_END && @lex_state != EXPR_CLASS &&
- (@lex_state != EXPR_ARG || @space_seen)
- c = peek(0)
- if /[-\w_\"\'\`]/ =~ c
- tk = identify_here_document
- end
- end
- if !tk
- @lex_state = EXPR_BEG
- tk = Token(op).set_text(op)
- end
- tk
- end
-
- @OP.def_rules("'", '"') do
- |op, io|
- identify_string(op)
- end
-
- @OP.def_rules("`") do
- |op, io|
- if @lex_state == EXPR_FNAME
- Token(op).set_text(op)
- else
- identify_string(op)
- end
- end
-
- @OP.def_rules('?') do
- |op, io|
- if @lex_state == EXPR_END
- @lex_state = EXPR_BEG
- Token(TkQUESTION).set_text(op)
- else
- ch = getc
- if @lex_state == EXPR_ARG && ch !~ /\s/
- ungetc
- @lex_state = EXPR_BEG
- Token(TkQUESTION).set_text(op)
- else
- str = op
- str << ch
- if (ch == '\\') #'
- str << read_escape
- end
- @lex_state = EXPR_END
- Token(TkINTEGER).set_text(str)
- end
- end
- end
-
- @OP.def_rules("&", "&&", "|", "||") do
- |op, io|
- @lex_state = EXPR_BEG
- Token(op).set_text(op)
- end
-
- @OP.def_rules("+=", "-=", "*=", "**=",
- "&=", "|=", "^=", "<<=", ">>=", "||=", "&&=") do
- |op, io|
- @lex_state = EXPR_BEG
- op =~ /^(.*)=$/
- Token(TkOPASGN, $1).set_text(op)
- end
-
- @OP.def_rule("+@", proc{@lex_state == EXPR_FNAME}) do |op, io|
- Token(TkUPLUS).set_text(op)
- end
-
- @OP.def_rule("-@", proc{@lex_state == EXPR_FNAME}) do |op, io|
- Token(TkUMINUS).set_text(op)
- end
-
- @OP.def_rules("+", "-") do
- |op, io|
- catch(:RET) do
- if @lex_state == EXPR_ARG
- if @space_seen and peek(0) =~ /[0-9]/
- throw :RET, identify_number(op)
- else
- @lex_state = EXPR_BEG
- end
- elsif @lex_state != EXPR_END and peek(0) =~ /[0-9]/
- throw :RET, identify_number(op)
- else
- @lex_state = EXPR_BEG
- end
- Token(op).set_text(op)
- end
- end
-
- @OP.def_rule(".") do
- @lex_state = EXPR_BEG
- if peek(0) =~ /[0-9]/
- ungetc
- identify_number("")
- else
- # for obj.if
- @lex_state = EXPR_DOT
- Token(TkDOT).set_text(".")
- end
- end
-
- @OP.def_rules("..", "...") do
- |op, io|
- @lex_state = EXPR_BEG
- Token(op).set_text(op)
- end
-
- lex_int2
- end
-
- def lex_int2
- @OP.def_rules("]", "}", ")") do
- |op, io|
- @lex_state = EXPR_END
- @indent -= 1
- Token(op).set_text(op)
- end
-
- @OP.def_rule(":") do
- if @lex_state == EXPR_END || peek(0) =~ /\s/
- @lex_state = EXPR_BEG
- tk = Token(TkCOLON)
- else
- @lex_state = EXPR_FNAME
- tk = Token(TkSYMBEG)
- end
- tk.set_text(":")
- end
-
- @OP.def_rule("::") do
- if @lex_state == EXPR_BEG or @lex_state == EXPR_ARG && @space_seen
- @lex_state = EXPR_BEG
- tk = Token(TkCOLON3)
- else
- @lex_state = EXPR_DOT
- tk = Token(TkCOLON2)
- end
- tk.set_text("::")
- 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, :/).set_text("/=") #")
- elsif @lex_state == EXPR_ARG and @space_seen and peek(0) !~ /\s/
- identify_string(op)
- else
- @lex_state = EXPR_BEG
- Token("/").set_text(op)
- end
- end
-
- @OP.def_rules("^") do
- @lex_state = EXPR_BEG
- Token("^").set_text("^")
- end
-
- @OP.def_rules(",", ";") do
- |op, io|
- @lex_state = EXPR_BEG
- Token(op).set_text(op)
- end
-
- @OP.def_rule("~") do
- @lex_state = EXPR_BEG
- Token("~").set_text("~")
- end
-
- @OP.def_rule("~@", proc{@lex_state = EXPR_FNAME}) do
- @lex_state = EXPR_BEG
- Token("~").set_text("~@")
- end
-
- @OP.def_rule("(") do
- @indent += 1
- if @lex_state == EXPR_BEG || @lex_state == EXPR_MID
- @lex_state = EXPR_BEG
- tk = Token(TkfLPAREN)
- else
- @lex_state = EXPR_BEG
- tk = Token(TkLPAREN)
- end
- tk.set_text("(")
- end
-
- @OP.def_rule("[]", proc{@lex_state == EXPR_FNAME}) do
- Token("[]").set_text("[]")
- end
-
- @OP.def_rule("[]=", proc{@lex_state == EXPR_FNAME}) do
- Token("[]=").set_text("[]=")
- end
-
- @OP.def_rule("[") do
- @indent += 1
- if @lex_state == EXPR_FNAME
- t = Token(TkfLBRACK)
- else
- if @lex_state == EXPR_BEG || @lex_state == EXPR_MID
- t = Token(TkLBRACK)
- elsif @lex_state == EXPR_ARG && @space_seen
- t = Token(TkLBRACK)
- else
- t = Token(TkfLBRACK)
- end
- @lex_state = EXPR_BEG
- end
- t.set_text("[")
- end
-
- @OP.def_rule("{") do
- @indent += 1
- if @lex_state != EXPR_END && @lex_state != EXPR_ARG
- t = Token(TkLBRACE)
- else
- t = Token(TkfLBRACE)
- end
- @lex_state = EXPR_BEG
- t.set_text("{")
- end
-
- @OP.def_rule('\\') do #'
- if getc == "\n"
- @space_seen = true
- @continue = true
- Token(TkSPACE).set_text("\\\n")
- else
- ungetc
- Token("\\").set_text("\\") #"
- 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, "%").set_text("%=")
- elsif @lex_state == EXPR_ARG and @space_seen and peek(0) !~ /\s/
- identify_quotation('%')
- else
- @lex_state = EXPR_BEG
- Token("%").set_text("%")
- end
- end
-
- @OP.def_rule('$') do #'
- identify_gvar
- end
-
- @OP.def_rule('@') do
- if peek(0) =~ /[@\w_]/
- ungetc
- identify_identifier
- else
- Token("@").set_text("@")
- end
- end
-
- @OP.def_rule("__END__", proc{@prev_char_no == 0 && peek(0) =~ /[\r\n]/}) do
- throw :eof
- end
-
- @OP.def_rule("") do
- |op, io|
- printf "MATCH: start %s: %s\n", op, io.inspect if RDoc::RubyLex.debug?
- if peek(0) =~ /[0-9]/
- t = identify_number("")
- elsif peek(0) =~ /[\w_]/
- t = identify_identifier
- end
- printf "MATCH: end %s: %s\n", op, io.inspect if RDoc::RubyLex.debug?
- t
- end
- end
-
- def identify_gvar
- @lex_state = EXPR_END
- str = "$"
-
- tk = case ch = getc
- when /[~_*$?!@\/\\;,=:<>".]/ #"
- str << ch
- Token(TkGVAR, str)
-
- when "-"
- str << "-" << getc
- Token(TkGVAR, str)
-
- when "&", "`", "'", "+"
- str << ch
- Token(TkBACK_REF, str)
-
- when /[1-9]/
- str << ch
- while (ch = getc) =~ /[0-9]/
- str << ch
- end
- ungetc
- Token(TkNTH_REF)
- when /\w/
- ungetc
- ungetc
- return identify_identifier
- else
- ungetc
- Token("$")
- end
- tk.set_text(str)
- end
-
- def identify_identifier
- token = ""
- token.concat getc if peek(0) =~ /[$@]/
- token.concat getc if peek(0) == "@"
-
- while (ch = getc) =~ /\w|_/
- print ":", ch, ":" if RDoc::RubyLex.debug?
- token.concat ch
- end
- ungetc
-
- if ch == "!" or ch == "?"
- token.concat getc
- end
- # fix token
-
- # $stderr.puts "identifier - #{token}, state = #@lex_state"
-
- case token
- when /^\$/
- return Token(TkGVAR, token).set_text(token)
- when /^\@/
- @lex_state = EXPR_END
- return Token(TkIVAR, token).set_text(token)
- end
-
- if @lex_state != EXPR_DOT
- print token, "\n" if RDoc::RubyLex.debug?
-
- token_c, *trans = TkReading2Token[token]
- if token_c
- # reserved word?
-
- if (@lex_state != EXPR_BEG &&
- @lex_state != EXPR_FNAME &&
- trans[1])
- # modifiers
- token_c = TkSymbol2Token[trans[1]]
- @lex_state = trans[0]
- else
- if @lex_state != EXPR_FNAME
- if ENINDENT_CLAUSE.include?(token)
- @indent += 1
- elsif DEINDENT_CLAUSE.include?(token)
- @indent -= 1
- end
- @lex_state = trans[0]
- else
- @lex_state = EXPR_END
- end
- end
- return Token(token_c, token).set_text(token)
- end
- end
-
- if @lex_state == EXPR_FNAME
- @lex_state = EXPR_END
- if peek(0) == '='
- token.concat getc
- end
- elsif @lex_state == EXPR_BEG || @lex_state == EXPR_DOT
- @lex_state = EXPR_ARG
- else
- @lex_state = EXPR_END
- end
-
- if token[0, 1] =~ /[A-Z]/
- return Token(TkCONSTANT, token).set_text(token)
- elsif token[token.size - 1, 1] =~ /[!?]/
- return Token(TkFID, token).set_text(token)
- else
- return Token(TkIDENTIFIER, token).set_text(token)
- end
- end
-
- 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 << ch
- if ch == "\\" #"
- ch = getc
- reserve << ch
- elsif ch == "\n"
- break
- end
- end
-
- str = ""
- while (l = gets)
- l.chomp!
- l.strip! if indent
- break if l == quoted
- str << l.chomp << "\n"
- end
-
- @reader.divert_read_from(reserve)
-
- @ltype = ltback
- @lex_state = EXPR_END
- Token(Ltype2Token[lt], str).set_text(str.dump)
- end
-
- def identify_quotation(initial_char)
- ch = getc
- if lt = PERCENT_LTYPE[ch]
- initial_char += ch
- ch = getc
- elsif ch =~ /\W/
- lt = "\""
- else
- fail SyntaxError, "unknown type of %string ('#{ch}')"
- end
-# if ch !~ /\W/
-# ungetc
-# next
-# end
- #@ltype = lt
- @quoted = ch unless @quoted = PERCENT_PAREN[ch]
- identify_string(lt, @quoted, ch, initial_char)
- end
-
- def identify_number(start)
- str = start.dup
-
- if start == "+" or start == "-" or start == ""
- start = getc
- str << start
- end
-
- @lex_state = EXPR_END
-
- if start == "0"
- if peek(0) == "x"
- ch = getc
- str << ch
- match = /[0-9a-f_]/
- else
- match = /[0-7_]/
- end
- while ch = getc
- if ch !~ match
- ungetc
- break
- else
- str << ch
- end
- end
- return Token(TkINTEGER).set_text(str)
- end
-
- type = TkINTEGER
- allow_point = TRUE
- allow_e = TRUE
- while ch = getc
- case ch
- when /[0-9_]/
- str << ch
-
- when allow_point && "."
- type = TkFLOAT
- if peek(0) !~ /[0-9]/
- ungetc
- break
- end
- str << ch
- allow_point = false
-
- when allow_e && "e", allow_e && "E"
- str << ch
- type = TkFLOAT
- if peek(0) =~ /[+-]/
- str << getc
- end
- allow_e = false
- allow_point = false
- else
- ungetc
- break
- end
- end
- Token(type).set_text(str)
- end
-
- def identify_string(ltype, quoted = ltype, opener=nil, initial_char = nil)
- @ltype = ltype
- @quoted = quoted
- subtype = nil
-
- str = ""
- str << initial_char if initial_char
- str << (opener||quoted)
-
- nest = 0
- begin
- while ch = getc
- str << ch
- if @quoted == ch
- if nest == 0
- break
- else
- nest -= 1
- end
- elsif opener == ch
- nest += 1
- elsif @ltype != "'" && @ltype != "]" and ch == "#"
- ch = getc
- if ch == "{"
- subtype = true
- str << ch << skip_inner_expression
- else
- ungetc(ch)
- end
- elsif ch == '\\' #'
- str << read_escape
- end
- end
- if @ltype == "/"
- if peek(0) =~ /i|o|n|e|s/
- str << getc
- end
- end
- if subtype
- Token(DLtype2Token[ltype], str)
- else
- Token(Ltype2Token[ltype], str)
- end.set_text(str)
- ensure
- @ltype = nil
- @quoted = nil
- @lex_state = EXPR_END
- end
- end
-
- def skip_inner_expression
- res = ""
- nest = 0
- while (ch = getc)
- res << ch
- if ch == '}'
- break if nest.zero?
- nest -= 1
- elsif ch == '{'
- nest += 1
- end
- end
- res
- end
-
- def identify_comment
- @ltype = "#"
- comment = "#"
- while ch = getc
- if ch == "\\"
- ch = getc
- if ch == "\n"
- ch = " "
- else
- comment << "\\"
- end
- else
- if ch == "\n"
- @ltype = nil
- ungetc
- break
- end
- end
- comment << ch
- end
- return Token(TkCOMMENT).set_text(comment)
- end
-
- def read_escape
- res = ""
- case ch = getc
- when /[0-7]/
- ungetc ch
- 3.times do
- case ch = getc
- when /[0-7]/
- when nil
- break
- else
- ungetc
- break
- end
- res << ch
- end
-
- when "x"
- res << ch
- 2.times do
- case ch = getc
- when /[0-9a-fA-F]/
- when nil
- break
- else
- ungetc
- break
- end
- res << ch
- end
-
- when "M"
- res << ch
- if (ch = getc) != '-'
- ungetc
- else
- res << ch
- if (ch = getc) == "\\" #"
- res << ch
- res << read_escape
- else
- res << ch
- end
- end
-
- when "C", "c" #, "^"
- res << ch
- if ch == "C" and (ch = getc) != "-"
- ungetc
- else
- res << ch
- if (ch = getc) == "\\" #"
- res << ch
- res << read_escape
- else
- res << ch
- end
- end
- else
- res << ch
- end
- res
- end
-end
-
-##
-# Extracts code elements from a source file returning a TopLevel object
-# containing the constituent file elements.
-#
-# This file is based on rtags
-#
-# RubyParser understands how to document:
-# * classes
-# * modules
-# * methods
-# * constants
-# * aliases
-# * private, public, protected
-# * private_class_function, public_class_function
-# * module_function
-# * attr, attr_reader, attr_writer, attr_accessor
-# * extra accessors given on the command line
-# * metaprogrammed methods
-# * require
-# * include
-#
-# == Method Arguments
-#
-#--
-# NOTE: I don't think this works, needs tests, remove the paragraph following
-# this block when known to work
-#
-# The parser extracts the arguments from the method definition. You can
-# override this with a custom argument definition using the :args: directive:
-#
-# ##
-# # This method tries over and over until it is tired
-#
-# def go_go_go(thing_to_try, tries = 10) # :args: thing_to_try
-# puts thing_to_try
-# go_go_go thing_to_try, tries - 1
-# end
-#
-# If you have a more-complex set of overrides you can use the :call-seq:
-# directive:
-#++
-#
-# The parser extracts the arguments from the method definition. You can
-# override this with a custom argument definition using the :call-seq:
-# directive:
-#
-# ##
-# # This method can be called with a range or an offset and length
-# #
-# # :call-seq:
-# # my_method(Range)
-# # my_method(offset, length)
-#
-# def my_method(*args)
-# end
-#
-# The parser extracts +yield+ expressions from method bodies to gather the
-# yielded argument names. If your method manually calls a block instead of
-# yielding or you want to override the discovered argument names use
-# the :yields: directive:
-#
-# ##
-# # My method is awesome
-#
-# def my_method(&block) # :yields: happy, times
-# block.call 1, 2
-# end
-#
-# == Metaprogrammed Methods
-#
-# To pick up a metaprogrammed method, the parser looks for a comment starting
-# with '##' before an identifier:
-#
-# ##
-# # This is a meta-programmed method!
-#
-# add_my_method :meta_method, :arg1, :arg2
-#
-# The parser looks at the token after the identifier to determine the name, in
-# this example, :meta_method. If a name cannot be found, a warning is printed
-# and 'unknown is used.
-#
-# You can force the name of a method using the :method: directive:
-#
-# ##
-# # :method: woo_hoo!
-#
-# By default, meta-methods are instance methods. To indicate that a method is
-# a singleton method instead use the :singleton-method: directive:
-#
-# ##
-# # :singleton-method:
-#
-# You can also use the :singleton-method: directive with a name:
-#
-# ##
-# # :singleton-method: woo_hoo!
-#
-# == Hidden methods
-#
-# You can provide documentation for methods that don't appear using
-# the :method: and :singleton-method: directives:
-#
-# ##
-# # :method: ghost_method
-# # There is a method here, but you can't see it!
-#
-# ##
-# # this is a comment for a regular method
-#
-# def regular_method() end
-#
-# Note that by default, the :method: directive will be ignored if there is a
-# standard rdocable item following it.
-
-class RDoc::Parser::Ruby < RDoc::Parser
-
- parse_files_matching(/\.rbw?$/)
-
- include RDoc::RubyToken
- include RDoc::TokenStream
-
- NORMAL = "::"
- SINGLE = "<<"
-
- def initialize(top_level, file_name, content, options, stats)
- super
-
- @size = 0
- @token_listeners = nil
- @scanner = RDoc::RubyLex.new content, @options
- @scanner.exception_on_syntax_error = false
-
- reset
- end
-
- def add_token_listener(obj)
- @token_listeners ||= []
- @token_listeners << obj
- end
-
- ##
- # Look for the first comment in a file that isn't a shebang line.
-
- def collect_first_comment
- skip_tkspace
- res = ''
- first_line = true
-
- tk = get_tk
-
- while TkCOMMENT === tk
- if first_line and tk.text =~ /\A#!/ then
- skip_tkspace
- tk = get_tk
- elsif first_line and tk.text =~ /\A#\s*-\*-/ then
- first_line = false
- skip_tkspace
- tk = get_tk
- else
- first_line = false
- res << tk.text << "\n"
- tk = get_tk
-
- if TkNL === tk then
- skip_tkspace false
- tk = get_tk
- end
- end
- end
-
- unget_tk tk
-
- res
- end
-
- def error(msg)
- msg = make_message msg
- $stderr.puts msg
- exit(1)
- end
-
- ##
- # Look for a 'call-seq' in the comment, and override the normal parameter
- # stuff
-
- def extract_call_seq(comment, meth)
- if comment.sub!(/:?call-seq:(.*?)^\s*\#?\s*$/m, '') then
- seq = $1
- seq.gsub!(/^\s*\#\s*/, '')
- meth.call_seq = seq
- end
-
- meth
- end
-
- def get_bool
- skip_tkspace
- tk = get_tk
- case tk
- when TkTRUE
- true
- when TkFALSE, TkNIL
- false
- else
- unget_tk tk
- true
- end
- end
-
- ##
- # Look for the name of a class of module (optionally with a leading :: or
- # with :: separated named) and return the ultimate name and container
-
- def get_class_or_module(container)
- skip_tkspace
- name_t = get_tk
-
- # class ::A -> A is in the top level
- if TkCOLON2 === name_t then
- name_t = get_tk
- container = @top_level
- end
-
- skip_tkspace(false)
-
- while TkCOLON2 === peek_tk do
- prev_container = container
- container = container.find_module_named(name_t.name)
- if !container
-# warn("Couldn't find module #{name_t.name}")
- container = prev_container.add_module RDoc::NormalModule, name_t.name
- end
- get_tk
- name_t = get_tk
- end
- skip_tkspace(false)
- return [container, name_t]
- end
-
- ##
- # Return a superclass, which can be either a constant of an expression
-
- def get_class_specification
- tk = get_tk
- return "self" if TkSELF === tk
-
- res = ""
- while TkCOLON2 === tk or TkCOLON3 === tk or TkCONSTANT === tk do
- res += tk.text
- tk = get_tk
- end
-
- unget_tk(tk)
- skip_tkspace(false)
-
- get_tkread # empty out read buffer
-
- tk = get_tk
-
- case tk
- when TkNL, TkCOMMENT, TkSEMICOLON then
- unget_tk(tk)
- return res
- end
-
- res += parse_call_parameters(tk)
- res
- end
-
- ##
- # Parse a constant, which might be qualified by one or more class or module
- # names
-
- def get_constant
- res = ""
- skip_tkspace(false)
- tk = get_tk
-
- while TkCOLON2 === tk or TkCOLON3 === tk or TkCONSTANT === tk do
- res += tk.text
- tk = get_tk
- end
-
-# if res.empty?
-# warn("Unexpected token #{tk} in constant")
-# end
- unget_tk(tk)
- res
- end
-
- ##
- # Get a constant that may be surrounded by parens
-
- def get_constant_with_optional_parens
- skip_tkspace(false)
- nest = 0
- while TkLPAREN === (tk = peek_tk) or TkfLPAREN === tk do
- get_tk
- skip_tkspace(true)
- nest += 1
- end
-
- name = get_constant
-
- while nest > 0
- skip_tkspace(true)
- tk = get_tk
- nest -= 1 if TkRPAREN === tk
- end
- name
- end
-
- def get_symbol_or_name
- tk = get_tk
- case tk
- when TkSYMBOL
- tk.text.sub(/^:/, '')
- when TkId, TkOp
- tk.name
- when TkSTRING
- tk.text
- else
- raise "Name or symbol expected (got #{tk})"
- end
- end
-
- def get_tk
- tk = nil
- if @tokens.empty?
- tk = @scanner.token
- @read.push @scanner.get_read
- puts "get_tk1 => #{tk.inspect}" if $TOKEN_DEBUG
- else
- @read.push @unget_read.shift
- tk = @tokens.shift
- puts "get_tk2 => #{tk.inspect}" if $TOKEN_DEBUG
- end
-
- if TkSYMBEG === tk then
- set_token_position(tk.line_no, tk.char_no)
- tk1 = get_tk
- if TkId === tk1 or TkOp === tk1 or TkSTRING === tk1 then
- if tk1.respond_to?(:name)
- tk = Token(TkSYMBOL).set_text(":" + tk1.name)
- else
- tk = Token(TkSYMBOL).set_text(":" + tk1.text)
- end
- # remove the identifier we just read (we're about to
- # replace it with a symbol)
- @token_listeners.each do |obj|
- obj.pop_token
- end if @token_listeners
- else
- warn("':' not followed by identifier or operator")
- tk = tk1
- end
- end
-
- # inform any listeners of our shiny new token
- @token_listeners.each do |obj|
- obj.add_token(tk)
- end if @token_listeners
-
- tk
- end
-
- def get_tkread
- read = @read.join("")
- @read = []
- read
- end
-
- ##
- # Look for directives in a normal comment block:
- #
- # #-- - don't display comment from this point forward
- #
- # This routine modifies it's parameter
-
- def look_for_directives_in(context, comment)
- preprocess = RDoc::Markup::PreProcess.new(@file_name,
- @options.rdoc_include)
-
- preprocess.handle(comment) do |directive, param|
- case directive
- when 'enddoc' then
- throw :enddoc
- when 'main' then
- @options.main_page = param
- ''
- when 'method', 'singleton-method' then
- false # ignore
- when 'section' then
- context.set_current_section(param, comment)
- comment.replace ''
- break
- when 'startdoc' then
- context.start_doc
- context.force_documentation = true
- ''
- when 'stopdoc' then
- context.stop_doc
- ''
- when 'title' then
- @options.title = param
- ''
- else
- warn "Unrecognized directive '#{directive}'"
- false
- end
- end
-
- remove_private_comments(comment)
- end
-
- def make_message(msg)
- prefix = "\n" + @file_name + ":"
- if @scanner
- prefix << "#{@scanner.line_no}:#{@scanner.char_no}: "
- end
- return prefix + msg
- end
-
- def parse_attr(context, single, tk, comment)
- args = parse_symbol_arg(1)
- if args.size > 0
- name = args[0]
- rw = "R"
- skip_tkspace(false)
- tk = get_tk
- if TkCOMMA === tk then
- rw = "RW" if get_bool
- else
- unget_tk tk
- end
- att = RDoc::Attr.new get_tkread, name, rw, comment
- read_documentation_modifiers att, RDoc::ATTR_MODIFIERS
- if att.document_self
- context.add_attribute(att)
- end
- else
- warn("'attr' ignored - looks like a variable")
- end
- end
-
- def parse_attr_accessor(context, single, tk, comment)
- args = parse_symbol_arg
- read = get_tkread
- rw = "?"
-
- # If nodoc is given, don't document any of them
-
- tmp = RDoc::CodeObject.new
- read_documentation_modifiers tmp, RDoc::ATTR_MODIFIERS
- return unless tmp.document_self
-
- case tk.name
- when "attr_reader" then rw = "R"
- when "attr_writer" then rw = "W"
- when "attr_accessor" then rw = "RW"
- else
- rw = @options.extra_accessor_flags[tk.name]
- rw = '?' if rw.nil?
- end
-
- for name in args
- att = RDoc::Attr.new get_tkread, name, rw, comment
- context.add_attribute att
- end
- end
-
- def parse_alias(context, single, tk, comment)
- skip_tkspace
- if TkLPAREN === peek_tk then
- get_tk
- skip_tkspace
- end
- new_name = get_symbol_or_name
- @scanner.instance_eval{@lex_state = EXPR_FNAME}
- skip_tkspace
- if TkCOMMA === peek_tk then
- get_tk
- skip_tkspace
- end
- old_name = get_symbol_or_name
-
- al = RDoc::Alias.new get_tkread, old_name, new_name, comment
- read_documentation_modifiers al, RDoc::ATTR_MODIFIERS
- if al.document_self
- context.add_alias(al)
- end
- end
-
- def parse_call_parameters(tk)
- end_token = case tk
- when TkLPAREN, TkfLPAREN
- TkRPAREN
- when TkRPAREN
- return ""
- else
- TkNL
- end
- nest = 0
-
- loop do
- case tk
- when TkSEMICOLON
- break
- when TkLPAREN, TkfLPAREN
- nest += 1
- when end_token
- if end_token == TkRPAREN
- nest -= 1
- break if @scanner.lex_state == EXPR_END and nest <= 0
- else
- break unless @scanner.continue
- end
- when TkCOMMENT
- unget_tk(tk)
- break
- end
- tk = get_tk
- end
- res = get_tkread.tr("\n", " ").strip
- res = "" if res == ";"
- res
- end
-
- def parse_class(container, single, tk, comment)
- container, name_t = get_class_or_module(container)
-
- case name_t
- when TkCONSTANT
- name = name_t.name
- superclass = "Object"
-
- if TkLT === peek_tk then
- get_tk
- skip_tkspace(true)
- superclass = get_class_specification
- superclass = "<unknown>" if superclass.empty?
- end
-
- cls_type = single == SINGLE ? RDoc::SingleClass : RDoc::NormalClass
- cls = container.add_class cls_type, name, superclass
-
- @stats.add_class cls
-
- read_documentation_modifiers cls, RDoc::CLASS_MODIFIERS
- cls.record_location @top_level
-
- parse_statements cls
- cls.comment = comment
-
- when TkLSHFT
- case name = get_class_specification
- when "self", container.name
- parse_statements(container, SINGLE)
- else
- other = RDoc::TopLevel.find_class_named(name)
- unless other
- # other = @top_level.add_class(NormalClass, name, nil)
- # other.record_location(@top_level)
- # other.comment = comment
- other = RDoc::NormalClass.new "Dummy", nil
- end
-
- @stats.add_class other
-
- read_documentation_modifiers other, RDoc::CLASS_MODIFIERS
- parse_statements(other, SINGLE)
- end
-
- else
- warn("Expected class name or '<<'. Got #{name_t.class}: #{name_t.text.inspect}")
- end
- end
-
- def parse_constant(container, single, tk, comment)
- name = tk.name
- skip_tkspace(false)
- eq_tk = get_tk
-
- unless TkASSIGN === eq_tk then
- unget_tk(eq_tk)
- return
- end
-
-
- nest = 0
- get_tkread
-
- tk = get_tk
- if TkGT === tk then
- unget_tk(tk)
- unget_tk(eq_tk)
- return
- end
-
- loop do
- case tk
- when TkSEMICOLON
- break
- when TkLPAREN, TkfLPAREN, TkLBRACE, TkLBRACK, TkDO
- nest += 1
- when TkRPAREN, TkRBRACE, TkRBRACK, TkEND
- nest -= 1
- when TkCOMMENT
- if nest <= 0 && @scanner.lex_state == EXPR_END
- unget_tk(tk)
- break
- end
- when TkNL
- if (nest <= 0) && ((@scanner.lex_state == EXPR_END) || (!@scanner.continue))
- unget_tk(tk)
- break
- end
- end
- tk = get_tk
- end
-
- res = get_tkread.tr("\n", " ").strip
- res = "" if res == ";"
-
- con = RDoc::Constant.new name, res, comment
- read_documentation_modifiers con, RDoc::CONSTANT_MODIFIERS
-
- if con.document_self
- container.add_constant(con)
- end
- end
-
- def parse_comment(container, tk, comment)
- line_no = tk.line_no
- column = tk.char_no
-
- singleton = !!comment.sub!(/(^# +:?)(singleton-)(method:)/, '\1\3')
-
- if comment.sub!(/^# +:?method: *(\S*).*?\n/i, '') then
- name = $1 unless $1.empty?
- else
- return nil
- end
-
- meth = RDoc::GhostMethod.new get_tkread, name
- meth.singleton = singleton
-
- @stats.add_method meth
-
- meth.start_collecting_tokens
- indent = TkSPACE.new 1, 1
- indent.set_text " " * column
-
- position_comment = TkCOMMENT.new(line_no, 1, "# File #{@top_level.file_absolute_name}, line #{line_no}")
- meth.add_tokens [position_comment, NEWLINE_TOKEN, indent]
-
- meth.params = ''
-
- extract_call_seq comment, meth
-
- container.add_method meth if meth.document_self
-
- meth.comment = comment
- end
-
- def parse_include(context, comment)
- loop do
- skip_tkspace_comment
-
- name = get_constant_with_optional_parens
- context.add_include RDoc::Include.new(name, comment) unless name.empty?
-
- return unless TkCOMMA === peek_tk
- get_tk
- end
- end
-
- ##
- # Parses a meta-programmed method
-
- def parse_meta_method(container, single, tk, comment)
- line_no = tk.line_no
- column = tk.char_no
-
- start_collecting_tokens
- add_token tk
- add_token_listener self
-
- skip_tkspace false
-
- singleton = !!comment.sub!(/(^# +:?)(singleton-)(method:)/, '\1\3')
-
- if comment.sub!(/^# +:?method: *(\S*).*?\n/i, '') then
- name = $1 unless $1.empty?
- end
-
- if name.nil? then
- name_t = get_tk
- case name_t
- when TkSYMBOL then
- name = name_t.text[1..-1]
- when TkSTRING then
- name = name_t.text[1..-2]
- else
- warn "#{container.top_level.file_relative_name}:#{name_t.line_no} unknown name token #{name_t.inspect} for meta-method"
- name = 'unknown'
- end
- end
-
- meth = RDoc::MetaMethod.new get_tkread, name
- meth.singleton = singleton
-
- @stats.add_method meth
-
- remove_token_listener self
-
- meth.start_collecting_tokens
- indent = TkSPACE.new 1, 1
- indent.set_text " " * column
-
- position_comment = TkCOMMENT.new(line_no, 1, "# File #{@top_level.file_absolute_name}, line #{line_no}")
- meth.add_tokens [position_comment, NEWLINE_TOKEN, indent]
- meth.add_tokens @token_stream
-
- add_token_listener meth
-
- meth.params = ''
-
- extract_call_seq comment, meth
-
- container.add_method meth if meth.document_self
-
- last_tk = tk
-
- while tk = get_tk do
- case tk
- when TkSEMICOLON then
- break
- when TkNL then
- break unless last_tk and TkCOMMA === last_tk
- when TkSPACE then
- # expression continues
- else
- last_tk = tk
- end
- end
-
- remove_token_listener meth
-
- meth.comment = comment
- end
-
- ##
- # Parses a method
-
- def parse_method(container, single, tk, comment)
- line_no = tk.line_no
- column = tk.char_no
-
- start_collecting_tokens
- add_token(tk)
- add_token_listener(self)
-
- @scanner.instance_eval do @lex_state = EXPR_FNAME end
-
- skip_tkspace(false)
- name_t = get_tk
- back_tk = skip_tkspace
- meth = nil
- added_container = false
-
- dot = get_tk
- if TkDOT === dot or TkCOLON2 === dot then
- @scanner.instance_eval do @lex_state = EXPR_FNAME end
- skip_tkspace
- name_t2 = get_tk
-
- case name_t
- when TkSELF then
- name = name_t2.name
- when TkCONSTANT then
- name = name_t2.name
- prev_container = container
- container = container.find_module_named(name_t.name)
- unless container then
- added_container = true
- obj = name_t.name.split("::").inject(Object) do |state, item|
- state.const_get(item)
- end rescue nil
-
- type = obj.class == Class ? RDoc::NormalClass : RDoc::NormalModule
-
- unless [Class, Module].include?(obj.class) then
- warn("Couldn't find #{name_t.name}. Assuming it's a module")
- end
-
- if type == RDoc::NormalClass then
- container = prev_container.add_class(type, name_t.name, obj.superclass.name)
- else
- container = prev_container.add_module(type, name_t.name)
- end
-
- container.record_location @top_level
- end
- else
- # warn("Unexpected token '#{name_t2.inspect}'")
- # break
- skip_method(container)
- return
- end
-
- meth = RDoc::AnyMethod.new(get_tkread, name)
- meth.singleton = true
- else
- unget_tk dot
- back_tk.reverse_each do |token|
- unget_tk token
- end
- name = name_t.name
-
- meth = RDoc::AnyMethod.new get_tkread, name
- meth.singleton = (single == SINGLE)
- end
-
- @stats.add_method meth
-
- remove_token_listener self
-
- meth.start_collecting_tokens
- indent = TkSPACE.new 1, 1
- indent.set_text " " * column
-
- token = TkCOMMENT.new(line_no, 1, "# File #{@top_level.file_absolute_name}, line #{line_no}")
- meth.add_tokens [token, NEWLINE_TOKEN, indent]
- meth.add_tokens @token_stream
-
- add_token_listener meth
-
- @scanner.instance_eval do @continue = false end
- parse_method_parameters meth
-
- if meth.document_self then
- container.add_method meth
- elsif added_container then
- container.document_self = false
- end
-
- # Having now read the method parameters and documentation modifiers, we
- # now know whether we have to rename #initialize to ::new
-
- if name == "initialize" && !meth.singleton then
- if meth.dont_rename_initialize then
- meth.visibility = :protected
- else
- meth.singleton = true
- meth.name = "new"
- meth.visibility = :public
- end
- end
-
- parse_statements(container, single, meth)
-
- remove_token_listener(meth)
-
- extract_call_seq comment, meth
-
- meth.comment = comment
- end
-
- def parse_method_or_yield_parameters(method = nil,
- modifiers = RDoc::METHOD_MODIFIERS)
- skip_tkspace(false)
- tk = get_tk
-
- # Little hack going on here. In the statement
- # f = 2*(1+yield)
- # We see the RPAREN as the next token, so we need
- # to exit early. This still won't catch all cases
- # (such as "a = yield + 1"
- end_token = case tk
- when TkLPAREN, TkfLPAREN
- TkRPAREN
- when TkRPAREN
- return ""
- else
- TkNL
- end
- nest = 0
-
- loop do
- case tk
- when TkSEMICOLON
- break
- when TkLBRACE
- nest += 1
- when TkRBRACE
- # we might have a.each {|i| yield i }
- unget_tk(tk) if nest.zero?
- nest -= 1
- break if nest <= 0
- when TkLPAREN, TkfLPAREN
- nest += 1
- when end_token
- if end_token == TkRPAREN
- nest -= 1
- break if @scanner.lex_state == EXPR_END and nest <= 0
- else
- break unless @scanner.continue
- end
- when method && method.block_params.nil? && TkCOMMENT
- unget_tk(tk)
- read_documentation_modifiers(method, modifiers)
- end
- tk = get_tk
- end
- res = get_tkread.tr("\n", " ").strip
- res = "" if res == ";"
- res
- end
-
- ##
- # Capture the method's parameters. Along the way, look for a comment
- # containing:
- #
- # # yields: ....
- #
- # and add this as the block_params for the method
-
- def parse_method_parameters(method)
- res = parse_method_or_yield_parameters(method)
- res = "(" + res + ")" unless res[0] == ?(
- method.params = res unless method.params
- if method.block_params.nil?
- skip_tkspace(false)
- read_documentation_modifiers method, RDoc::METHOD_MODIFIERS
- end
- end
-
- def parse_module(container, single, tk, comment)
- container, name_t = get_class_or_module(container)
-
- name = name_t.name
-
- mod = container.add_module RDoc::NormalModule, name
- mod.record_location @top_level
-
- @stats.add_module mod
-
- read_documentation_modifiers mod, RDoc::CLASS_MODIFIERS
- parse_statements(mod)
- mod.comment = comment
- end
-
- def parse_require(context, comment)
- skip_tkspace_comment
- tk = get_tk
- if TkLPAREN === tk then
- skip_tkspace_comment
- tk = get_tk
- end
-
- name = nil
- case tk
- when TkSTRING
- name = tk.text
- # when TkCONSTANT, TkIDENTIFIER, TkIVAR, TkGVAR
- # name = tk.name
- when TkDSTRING
- warn "Skipping require of dynamic string: #{tk.text}"
- # else
- # warn "'require' used as variable"
- end
- if name
- context.add_require RDoc::Require.new(name, comment)
- else
- unget_tk(tk)
- end
- end
-
- def parse_statements(container, single = NORMAL, current_method = nil,
- comment = '')
- nest = 1
- save_visibility = container.visibility
-
- non_comment_seen = true
-
- while tk = get_tk do
- keep_comment = false
-
- non_comment_seen = true unless TkCOMMENT === tk
-
- case tk
- when TkNL then
- skip_tkspace true # Skip blanks and newlines
- tk = get_tk
-
- if TkCOMMENT === tk then
- if non_comment_seen then
- # Look for RDoc in a comment about to be thrown away
- parse_comment container, tk, comment unless comment.empty?
-
- comment = ''
- non_comment_seen = false
- end
-
- while TkCOMMENT === tk do
- comment << tk.text << "\n"
- tk = get_tk # this is the newline
- skip_tkspace(false) # leading spaces
- tk = get_tk
- end
-
- unless comment.empty? then
- look_for_directives_in container, comment
-
- if container.done_documenting then
- container.ongoing_visibility = save_visibility
- end
- end
-
- keep_comment = true
- else
- non_comment_seen = true
- end
-
- unget_tk tk
- keep_comment = true
-
- when TkCLASS then
- if container.document_children then
- parse_class container, single, tk, comment
- else
- nest += 1
- end
-
- when TkMODULE then
- if container.document_children then
- parse_module container, single, tk, comment
- else
- nest += 1
- end
-
- when TkDEF then
- if container.document_self then
- parse_method container, single, tk, comment
- else
- nest += 1
- end
-
- when TkCONSTANT then
- if container.document_self then
- parse_constant container, single, tk, comment
- end
-
- when TkALIAS then
- if container.document_self then
- parse_alias container, single, tk, comment
- end
-
- when TkYIELD then
- if current_method.nil? then
- warn "Warning: yield outside of method" if container.document_self
- else
- parse_yield container, single, tk, current_method
- end
-
- # Until and While can have a 'do', which shouldn't increase the nesting.
- # We can't solve the general case, but we can handle most occurrences by
- # ignoring a do at the end of a line.
-
- when TkUNTIL, TkWHILE then
- nest += 1
- skip_optional_do_after_expression
-
- # 'for' is trickier
- when TkFOR then
- nest += 1
- skip_for_variable
- skip_optional_do_after_expression
-
- when TkCASE, TkDO, TkIF, TkUNLESS, TkBEGIN then
- nest += 1
-
- when TkIDENTIFIER then
- if nest == 1 and current_method.nil? then
- case tk.name
- when 'private', 'protected', 'public', 'private_class_method',
- 'public_class_method', 'module_function' then
- parse_visibility container, single, tk
- keep_comment = true
- when 'attr' then
- parse_attr container, single, tk, comment
- when /^attr_(reader|writer|accessor)$/, @options.extra_accessors then
- parse_attr_accessor container, single, tk, comment
- when 'alias_method' then
- if container.document_self then
- parse_alias container, single, tk, comment
- end
- else
- if container.document_self and comment =~ /\A#\#$/ then
- parse_meta_method container, single, tk, comment
- end
- end
- end
-
- case tk.name
- when "require" then
- parse_require container, comment
- when "include" then
- parse_include container, comment
- end
-
- when TkEND then
- nest -= 1
- if nest == 0 then
- read_documentation_modifiers container, RDoc::CLASS_MODIFIERS
- container.ongoing_visibility = save_visibility
- return
- end
-
- end
-
- comment = '' unless keep_comment
-
- begin
- get_tkread
- skip_tkspace(false)
- end while peek_tk == TkNL
- end
- end
-
- def parse_symbol_arg(no = nil)
- args = []
- skip_tkspace_comment
- case tk = get_tk
- when TkLPAREN
- loop do
- skip_tkspace_comment
- if tk1 = parse_symbol_in_arg
- args.push tk1
- break if no and args.size >= no
- end
-
- skip_tkspace_comment
- case tk2 = get_tk
- when TkRPAREN
- break
- when TkCOMMA
- else
- warn("unexpected token: '#{tk2.inspect}'") if $DEBUG_RDOC
- break
- end
- end
- else
- unget_tk tk
- if tk = parse_symbol_in_arg
- args.push tk
- return args if no and args.size >= no
- end
-
- loop do
- skip_tkspace(false)
-
- tk1 = get_tk
- unless TkCOMMA === tk1 then
- unget_tk tk1
- break
- end
-
- skip_tkspace_comment
- if tk = parse_symbol_in_arg
- args.push tk
- break if no and args.size >= no
- end
- end
- end
- args
- end
-
- def parse_symbol_in_arg
- case tk = get_tk
- when TkSYMBOL
- tk.text.sub(/^:/, '')
- when TkSTRING
- eval @read[-1]
- else
- warn("Expected symbol or string, got #{tk.inspect}") if $DEBUG_RDOC
- nil
- end
- end
-
- def parse_toplevel_statements(container)
- comment = collect_first_comment
- look_for_directives_in(container, comment)
- container.comment = comment unless comment.empty?
- parse_statements container, NORMAL, nil, comment
- end
-
- def parse_visibility(container, single, tk)
- singleton = (single == SINGLE)
-
- vis_type = tk.name
-
- vis = case vis_type
- when 'private' then :private
- when 'protected' then :protected
- when 'public' then :public
- when 'private_class_method' then
- singleton = true
- :private
- when 'public_class_method' then
- singleton = true
- :public
- when 'module_function' then
- singleton = true
- :public
- else
- raise "Invalid visibility: #{tk.name}"
- end
-
- skip_tkspace_comment false
-
- case peek_tk
- # Ryan Davis suggested the extension to ignore modifiers, because he
- # often writes
- #
- # protected unless $TESTING
- #
- when TkNL, TkUNLESS_MOD, TkIF_MOD, TkSEMICOLON then
- container.ongoing_visibility = vis
- else
- if vis_type == 'module_function' then
- args = parse_symbol_arg
- container.set_visibility_for args, :private, false
-
- module_functions = []
-
- container.methods_matching args do |m|
- s_m = m.dup
- s_m.singleton = true if RDoc::AnyMethod === s_m
- s_m.visibility = :public
- module_functions << s_m
- end
-
- module_functions.each do |s_m|
- case s_m
- when RDoc::AnyMethod then
- container.add_method s_m
- when RDoc::Attr then
- container.add_attribute s_m
- end
- end
- else
- args = parse_symbol_arg
- container.set_visibility_for args, vis, singleton
- end
- end
- end
-
- def parse_yield_parameters
- parse_method_or_yield_parameters
- end
-
- def parse_yield(context, single, tk, method)
- if method.block_params.nil?
- get_tkread
- @scanner.instance_eval{@continue = false}
- method.block_params = parse_yield_parameters
- end
- end
-
- def peek_read
- @read.join('')
- end
-
- ##
- # Peek at the next token, but don't remove it from the stream
-
- def peek_tk
- unget_tk(tk = get_tk)
- tk
- end
-
- ##
- # Directives are modifier comments that can appear after class, module, or
- # method names. For example:
- #
- # def fred # :yields: a, b
- #
- # or:
- #
- # class MyClass # :nodoc:
- #
- # We return the directive name and any parameters as a two element array
-
- def read_directive(allowed)
- tk = get_tk
- result = nil
- if TkCOMMENT === tk
- if tk.text =~ /\s*:?(\w+):\s*(.*)/
- directive = $1.downcase
- if allowed.include?(directive)
- result = [directive, $2]
- end
- end
- else
- unget_tk(tk)
- end
- result
- end
-
- def read_documentation_modifiers(context, allow)
- dir = read_directive(allow)
-
- case dir[0]
- when "notnew", "not_new", "not-new" then
- context.dont_rename_initialize = true
-
- when "nodoc" then
- context.document_self = false
- if dir[1].downcase == "all"
- context.document_children = false
- end
-
- when "doc" then
- context.document_self = true
- context.force_documentation = true
-
- when "yield", "yields" then
- unless context.params.nil?
- context.params.sub!(/(,|)\s*&\w+/,'') # remove parameter &proc
- end
-
- context.block_params = dir[1]
-
- when "arg", "args" then
- context.params = dir[1]
- end if dir
- end
-
- def remove_private_comments(comment)
- comment.gsub!(/^#--\n.*?^#\+\+/m, '')
- comment.sub!(/^#--\n.*/m, '')
- end
-
- def remove_token_listener(obj)
- @token_listeners.delete(obj)
- end
-
- def reset
- @tokens = []
- @unget_read = []
- @read = []
- end
-
- def scan
- reset
-
- catch(:eof) do
- catch(:enddoc) do
- begin
- parse_toplevel_statements(@top_level)
- rescue Exception => e
- $stderr.puts <<-EOF
-
-
-RDoc failure in #{@file_name} at or around line #{@scanner.line_no} column
-#{@scanner.char_no}
-
-Before reporting this, could you check that the file you're documenting
-compiles cleanly--RDoc is not a full Ruby parser, and gets confused easily if
-fed invalid programs.
-
-The internal error was:
-
- EOF
-
- e.set_backtrace(e.backtrace[0,4])
- raise
- end
- end
- end
-
- @top_level
- end
-
- ##
- # while, until, and for have an optional do
-
- def skip_optional_do_after_expression
- skip_tkspace(false)
- tk = get_tk
- case tk
- when TkLPAREN, TkfLPAREN
- end_token = TkRPAREN
- else
- end_token = TkNL
- end
-
- nest = 0
- @scanner.instance_eval{@continue = false}
-
- loop do
- case tk
- when TkSEMICOLON
- break
- when TkLPAREN, TkfLPAREN
- nest += 1
- when TkDO
- break if nest.zero?
- when end_token
- if end_token == TkRPAREN
- nest -= 1
- break if @scanner.lex_state == EXPR_END and nest.zero?
- else
- break unless @scanner.continue
- end
- end
- tk = get_tk
- end
- skip_tkspace(false)
-
- get_tk if TkDO === peek_tk
- end
-
- ##
- # skip the var [in] part of a 'for' statement
-
- def skip_for_variable
- skip_tkspace(false)
- tk = get_tk
- skip_tkspace(false)
- tk = get_tk
- unget_tk(tk) unless TkIN === tk
- end
-
- def skip_method(container)
- meth = RDoc::AnyMethod.new "", "anon"
- parse_method_parameters(meth)
- parse_statements(container, false, meth)
- end
-
- ##
- # Skip spaces
-
- def skip_tkspace(skip_nl = true)
- tokens = []
-
- while TkSPACE === (tk = get_tk) or (skip_nl and TkNL === tk) do
- tokens.push tk
- end
-
- unget_tk(tk)
- tokens
- end
-
- ##
- # Skip spaces until a comment is found
-
- def skip_tkspace_comment(skip_nl = true)
- loop do
- skip_tkspace(skip_nl)
- return unless TkCOMMENT === peek_tk
- get_tk
- end
- end
-
- def unget_tk(tk)
- @tokens.unshift tk
- @unget_read.unshift @read.pop
-
- # Remove this token from any listeners
- @token_listeners.each do |obj|
- obj.pop_token
- end if @token_listeners
- end
-
- def warn(msg)
- return if @options.quiet
- msg = make_message msg
- $stderr.puts msg
- end
-
-end
-
diff --git a/lib/rdoc/parser/simple.rb b/lib/rdoc/parser/simple.rb
deleted file mode 100644
index cdfe686718..0000000000
--- a/lib/rdoc/parser/simple.rb
+++ /dev/null
@@ -1,38 +0,0 @@
-require 'rdoc/parser'
-
-##
-# Parse a non-source file. We basically take the whole thing as one big
-# comment. If the first character in the file is '#', we strip leading pound
-# signs.
-
-class RDoc::Parser::Simple < RDoc::Parser
-
- parse_files_matching(//)
-
- ##
- # Prepare to parse a plain file
-
- def initialize(top_level, file_name, content, options, stats)
- super
-
- preprocess = RDoc::Markup::PreProcess.new @file_name, @options.rdoc_include
-
- preprocess.handle @content do |directive, param|
- warn "Unrecognized directive '#{directive}' in #{@file_name}"
- end
- end
-
- ##
- # Extract the file contents and attach them to the toplevel as a comment
-
- def scan
- @top_level.comment = remove_private_comments(@content)
- @top_level
- end
-
- def remove_private_comments(comment)
- comment.gsub(/^--\n.*?^\+\+/m, '').sub(/^--\n.*/m, '')
- end
-
-end
-
diff --git a/lib/rdoc/parsers/parse_c.rb b/lib/rdoc/parsers/parse_c.rb
new file mode 100644
index 0000000000..7eefa29706
--- /dev/null
+++ b/lib/rdoc/parsers/parse_c.rb
@@ -0,0 +1,773 @@
+# Classes and modules built in to the interpreter. We need
+# these to define superclasses of user objects
+
+require "rdoc/code_objects"
+require "rdoc/parsers/parserfactory"
+require "rdoc/options"
+require "rdoc/rdoc"
+
+module RDoc
+
+ ##
+ # Ruby's built-in classes.
+
+ KNOWN_CLASSES = {
+ "rb_cObject" => "Object",
+ "rb_cArray" => "Array",
+ "rb_cBignum" => "Bignum",
+ "rb_cClass" => "Class",
+ "rb_cDir" => "Dir",
+ "rb_cData" => "Data",
+ "rb_cFalseClass" => "FalseClass",
+ "rb_cFile" => "File",
+ "rb_cFixnum" => "Fixnum",
+ "rb_cFloat" => "Float",
+ "rb_cHash" => "Hash",
+ "rb_cInteger" => "Integer",
+ "rb_cIO" => "IO",
+ "rb_cModule" => "Module",
+ "rb_cNilClass" => "NilClass",
+ "rb_cNumeric" => "Numeric",
+ "rb_cProc" => "Proc",
+ "rb_cRange" => "Range",
+ "rb_cRegexp" => "Regexp",
+ "rb_cString" => "String",
+ "rb_cSymbol" => "Symbol",
+ "rb_cThread" => "Thread",
+ "rb_cTime" => "Time",
+ "rb_cTrueClass" => "TrueClass",
+ "rb_cStruct" => "Struct",
+ "rb_eException" => "Exception",
+ "rb_eStandardError" => "StandardError",
+ "rb_eSystemExit" => "SystemExit",
+ "rb_eInterrupt" => "Interrupt",
+ "rb_eSignal" => "Signal",
+ "rb_eFatal" => "Fatal",
+ "rb_eArgError" => "ArgError",
+ "rb_eEOFError" => "EOFError",
+ "rb_eIndexError" => "IndexError",
+ "rb_eRangeError" => "RangeError",
+ "rb_eIOError" => "IOError",
+ "rb_eRuntimeError" => "RuntimeError",
+ "rb_eSecurityError" => "SecurityError",
+ "rb_eSystemCallError" => "SystemCallError",
+ "rb_eTypeError" => "TypeError",
+ "rb_eZeroDivError" => "ZeroDivError",
+ "rb_eNotImpError" => "NotImpError",
+ "rb_eNoMemError" => "NoMemError",
+ "rb_eFloatDomainError" => "FloatDomainError",
+ "rb_eScriptError" => "ScriptError",
+ "rb_eNameError" => "NameError",
+ "rb_eSyntaxError" => "SyntaxError",
+ "rb_eLoadError" => "LoadError",
+
+ "rb_mKernel" => "Kernel",
+ "rb_mComparable" => "Comparable",
+ "rb_mEnumerable" => "Enumerable",
+ "rb_mPrecision" => "Precision",
+ "rb_mErrno" => "Errno",
+ "rb_mFileTest" => "FileTest",
+ "rb_mGC" => "GC",
+ "rb_mMath" => "Math",
+ "rb_mProcess" => "Process"
+ }
+
+ ##
+ # We attempt to parse C extension files. Basically we look for
+ # the standard patterns that you find in extensions: <tt>rb_define_class,
+ # rb_define_method</tt> and so on. We also try to find the corresponding
+ # C source for the methods and extract comments, but if we fail
+ # we don't worry too much.
+ #
+ # The comments associated with a Ruby method are extracted from the C
+ # comment block associated with the routine that _implements_ that
+ # method, that is to say the method whose name is given in the
+ # <tt>rb_define_method</tt> call. For example, you might write:
+ #
+ # /*
+ # * Returns a new array that is a one-dimensional flattening of this
+ # * array (recursively). That is, for every element that is an array,
+ # * extract its elements into the new array.
+ # *
+ # * s = [ 1, 2, 3 ] #=> [1, 2, 3]
+ # * t = [ 4, 5, 6, [7, 8] ] #=> [4, 5, 6, [7, 8]]
+ # * a = [ s, t, 9, 10 ] #=> [[1, 2, 3], [4, 5, 6, [7, 8]], 9, 10]
+ # * a.flatten #=> [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
+ # */
+ # static VALUE
+ # rb_ary_flatten(ary)
+ # VALUE ary;
+ # {
+ # ary = rb_obj_dup(ary);
+ # rb_ary_flatten_bang(ary);
+ # return ary;
+ # }
+ #
+ # ...
+ #
+ # void
+ # Init_Array()
+ # {
+ # ...
+ # rb_define_method(rb_cArray, "flatten", rb_ary_flatten, 0);
+ #
+ # Here RDoc will determine from the rb_define_method line that there's a
+ # method called "flatten" in class Array, and will look for the implementation
+ # in the method rb_ary_flatten. It will then use the comment from that
+ # method in the HTML output. This method must be in the same source file
+ # as the rb_define_method.
+ #
+ # C classes can be diagrammed (see /tc/dl/ruby/ruby/error.c), and RDoc
+ # integrates C and Ruby source into one tree
+ #
+ # The comment blocks may include special directives:
+ #
+ # [Document-class: <i>name</i>]
+ # This comment block is documentation for the given class. Use this
+ # when the <tt>Init_xxx</tt> method is not named after the class.
+ #
+ # [Document-method: <i>name</i>]
+ # This comment documents the named method. Use when RDoc cannot
+ # automatically find the method from it's declaration
+ #
+ # [call-seq: <i>text up to an empty line</i>]
+ # Because C source doesn't give descriptive names to Ruby-level parameters,
+ # you need to document the calling sequence explicitly
+ #
+ # In addition, RDoc assumes by default that the C method implementing a
+ # Ruby function is in the same source file as the rb_define_method call.
+ # If this isn't the case, add the comment
+ #
+ # rb_define_method(....); // in: filename
+ #
+ # As an example, we might have an extension that defines multiple classes
+ # in its Init_xxx method. We could document them using
+ #
+ #
+ # /*
+ # * Document-class: MyClass
+ # *
+ # * Encapsulate the writing and reading of the configuration
+ # * file. ...
+ # */
+ #
+ # /*
+ # * Document-method: read_value
+ # *
+ # * call-seq:
+ # * cfg.read_value(key) -> value
+ # * cfg.read_value(key} { |key| } -> value
+ # *
+ # * Return the value corresponding to +key+ from the configuration.
+ # * In the second form, if the key isn't found, invoke the
+ # * block and return its value.
+ # */
+ #
+
+ class C_Parser
+
+ attr_accessor :progress
+
+ extend ParserFactory
+ parse_files_matching(/\.(?:([CcHh])\1?|c([+xp])\2|y)\z/)
+
+ @@known_bodies = {}
+
+ # prepare to parse a C file
+ def initialize(top_level, file_name, body, options, stats)
+ @known_classes = KNOWN_CLASSES.dup
+ @body = handle_tab_width(handle_ifdefs_in(body))
+ @options = options
+ @stats = stats
+ @top_level = top_level
+ @classes = Hash.new
+ @file_dir = File.dirname(file_name)
+ @progress = $stderr unless options.quiet
+ end
+
+ # Extract the classes/modules and methods from a C file
+ # and return the corresponding top-level object
+ def scan
+ remove_commented_out_lines
+ do_classes
+ do_constants
+ do_methods
+ do_includes
+ do_aliases
+ @top_level
+ end
+
+ #######
+ private
+ #######
+
+ def progress(char)
+ unless @options.quiet
+ @progress.print(char)
+ @progress.flush
+ end
+ end
+
+ def warn(msg)
+ $stderr.puts
+ $stderr.puts msg
+ $stderr.flush
+ end
+
+ def remove_private_comments(comment)
+ comment.gsub!(/\/?\*--(.*?)\/?\*\+\+/m, '')
+ comment.sub!(/\/?\*--.*/m, '')
+ end
+
+ ##
+ # removes lines that are commented out that might otherwise get picked up
+ # when scanning for classes and methods
+
+ def remove_commented_out_lines
+ @body.gsub!(%r{//.*rb_define_}, '//')
+ end
+
+ def handle_class_module(var_name, class_mod, class_name, parent, in_module)
+ progress(class_mod[0, 1])
+
+ parent_name = @known_classes[parent] || parent
+
+ if in_module
+ enclosure = @classes[in_module]
+ unless enclosure
+ if enclosure = @known_classes[in_module]
+ handle_class_module(in_module, (/^rb_m/ =~ in_module ? "module" : "class"),
+ enclosure, nil, nil)
+ enclosure = @classes[in_module]
+ end
+ end
+ unless enclosure
+ warn("Enclosing class/module '#{in_module}' for " +
+ "#{class_mod} #{class_name} not known")
+ return
+ end
+ else
+ enclosure = @top_level
+ end
+
+ if class_mod == "class"
+ cm = enclosure.add_class(NormalClass, class_name, parent_name)
+ @stats.num_classes += 1
+ else
+ cm = enclosure.add_module(NormalModule, class_name)
+ @stats.num_modules += 1
+ end
+ cm.record_location(enclosure.toplevel)
+
+ find_class_comment(cm.full_name, cm)
+ @classes[var_name] = cm
+ @known_classes[var_name] = cm.full_name
+ end
+
+ ##
+ # Look for class or module documentation above Init_+class_name+(void),
+ # in a Document-class +class_name+ (or module) comment or above an
+ # rb_define_class (or module). If a comment is supplied above a matching
+ # Init_ and a rb_define_class the Init_ comment is used.
+ #
+ # /*
+ # * This is a comment for Foo
+ # */
+ # Init_Foo(void) {
+ # VALUE cFoo = rb_define_class("Foo", rb_cObject);
+ # }
+ #
+ # /*
+ # * Document-class: Foo
+ # * This is a comment for Foo
+ # */
+ # Init_foo(void) {
+ # VALUE cFoo = rb_define_class("Foo", rb_cObject);
+ # }
+ #
+ # /*
+ # * This is a comment for Foo
+ # */
+ # VALUE cFoo = rb_define_class("Foo", rb_cObject);
+
+ def find_class_comment(class_name, class_meth)
+ comment = nil
+ if @body =~ %r{((?>/\*.*?\*/\s+))
+ (static\s+)?void\s+Init_#{class_name}\s*(?:_\(\s*)?\(\s*(?:void\s*)?\)}xmi
+ comment = $1
+ elsif @body =~ %r{Document-(class|module):\s#{class_name}\s*?\n((?>.*?\*/))}m
+ comment = $2
+ else
+ if @body =~ /rb_define_(class|module)/m then
+ class_name = class_name.split("::").last
+ comments = []
+ @body.split(/(\/\*.*?\*\/)\s*?\n/m).each_with_index do |chunk, index|
+ comments[index] = chunk
+ if chunk =~ /rb_define_(class|module).*?"(#{class_name})"/m then
+ comment = comments[index-1]
+ break
+ end
+ end
+ end
+ end
+ class_meth.comment = mangle_comment(comment) if comment
+ end
+
+ ############################################################
+
+ def do_classes
+ @body.scan(/(\w+)\s* = \s*rb_define_module\s*\(\s*"(\w+)"\s*\)/mx) do
+ |var_name, class_name|
+ handle_class_module(var_name, "module", class_name, nil, nil)
+ end
+
+ # The '.' lets us handle SWIG-generated files
+ @body.scan(/([\w\.]+)\s* = \s*rb_define_class\s*
+ \(
+ \s*"(\w+)",
+ \s*(\w+)\s*
+ \)/mx) do
+
+ |var_name, class_name, parent|
+ handle_class_module(var_name, "class", class_name, parent, nil)
+ end
+
+ @body.scan(/(\w+)\s*=\s*boot_defclass\s*\(\s*"(\w+?)",\s*(\w+?)\s*\)/) do
+ |var_name, class_name, parent|
+ parent = nil if parent == "0"
+ handle_class_module(var_name, "class", class_name, parent, nil)
+ end
+
+ @body.scan(/(\w+)\s* = \s*rb_define_module_under\s*
+ \(
+ \s*(\w+),
+ \s*"(\w+)"
+ \s*\)/mx) do
+
+ |var_name, in_module, class_name|
+ handle_class_module(var_name, "module", class_name, nil, in_module)
+ end
+
+ @body.scan(/([\w\.]+)\s* = \s*rb_define_class_under\s*
+ \(
+ \s*(\w+),
+ \s*"(\w+)",
+ \s*(\w+)\s*
+ \s*\)/mx) do
+
+ |var_name, in_module, class_name, parent|
+ handle_class_module(var_name, "class", class_name, parent, in_module)
+ end
+
+ end
+
+ ###########################################################
+
+ def do_constants
+ @body.scan(%r{\Wrb_define_
+ (
+ variable |
+ readonly_variable |
+ const |
+ global_const |
+ )
+ \s*\(
+ (?:\s*(\w+),)?
+ \s*"(\w+)",
+ \s*(.*?)\s*\)\s*;
+ }xm) do
+
+ |type, var_name, const_name, definition|
+ var_name = "rb_cObject" if !var_name or var_name == "rb_mKernel"
+ handle_constants(type, var_name, const_name, definition)
+ end
+ end
+
+ ############################################################
+
+ def do_methods
+
+ @body.scan(%r{rb_define_
+ (
+ singleton_method |
+ method |
+ module_function |
+ private_method
+ )
+ \s*\(\s*([\w\.]+),
+ \s*"([^"]+)",
+ \s*(?:RUBY_METHOD_FUNC\(|VALUEFUNC\()?(\w+)\)?,
+ \s*(-?\w+)\s*\)
+ (?:;\s*/[*/]\s+in\s+(\w+?\.[cy]))?
+ }xm) do
+ |type, var_name, meth_name, meth_body, param_count, source_file|
+ #"
+
+ # Ignore top-object and weird struct.c dynamic stuff
+ next if var_name == "ruby_top_self"
+ next if var_name == "nstr"
+ next if var_name == "envtbl"
+ next if var_name == "argf" # it'd be nice to handle this one
+
+ var_name = "rb_cObject" if var_name == "rb_mKernel"
+ handle_method(type, var_name, meth_name,
+ meth_body, param_count, source_file)
+ end
+
+ @body.scan(%r{rb_define_attr\(
+ \s*([\w\.]+),
+ \s*"([^"]+)",
+ \s*(\d+),
+ \s*(\d+)\s*\);
+ }xm) do #"
+ |var_name, attr_name, attr_reader, attr_writer|
+
+ #var_name = "rb_cObject" if var_name == "rb_mKernel"
+ handle_attr(var_name, attr_name,
+ attr_reader.to_i != 0,
+ attr_writer.to_i != 0)
+ end
+
+ @body.scan(%r{rb_define_global_function\s*\(
+ \s*"([^"]+)",
+ \s*(?:RUBY_METHOD_FUNC\(|VALUEFUNC\()?(\w+)\)?,
+ \s*(-?\w+)\s*\)
+ (?:;\s*/[*/]\s+in\s+(\w+?\.[cy]))?
+ }xm) do #"
+ |meth_name, meth_body, param_count, source_file|
+ handle_method("method", "rb_mKernel", meth_name,
+ meth_body, param_count, source_file)
+ end
+
+ @body.scan(/define_filetest_function\s*\(
+ \s*"([^"]+)",
+ \s*(?:RUBY_METHOD_FUNC\(|VALUEFUNC\()?(\w+)\)?,
+ \s*(-?\w+)\s*\)/xm) do #"
+ |meth_name, meth_body, param_count|
+
+ handle_method("method", "rb_mFileTest", meth_name, meth_body, param_count)
+ handle_method("singleton_method", "rb_cFile", meth_name, meth_body, param_count)
+ end
+ end
+
+ ############################################################
+
+ def do_aliases
+ @body.scan(%r{rb_define_alias\s*\(\s*(\w+),\s*"([^"]+)",\s*"([^"]+)"\s*\)}m) do
+ |var_name, new_name, old_name|
+ @stats.num_methods += 1
+ class_name = @known_classes[var_name] || var_name
+ class_obj = find_class(var_name, class_name)
+
+ class_obj.add_alias(Alias.new("", old_name, new_name, ""))
+ end
+ end
+
+ ##
+ # Adds constant comments. By providing some_value: at the start ofthe
+ # comment you can override the C value of the comment to give a friendly
+ # definition.
+ #
+ # /* 300: The perfect score in bowling */
+ # rb_define_const(cFoo, "PERFECT", INT2FIX(300);
+ #
+ # Will override +INT2FIX(300)+ with the value +300+ in the output RDoc.
+ # Values may include quotes and escaped colons (\:).
+
+ def handle_constants(type, var_name, const_name, definition)
+ #@stats.num_constants += 1
+ class_name = @known_classes[var_name]
+
+ return unless class_name
+
+ class_obj = find_class(var_name, class_name)
+
+ unless class_obj
+ warn("Enclosing class/module '#{const_name}' for not known")
+ return
+ end
+
+ comment = find_const_comment(type, const_name)
+
+ # In the case of rb_define_const, the definition and comment are in
+ # "/* definition: comment */" form. The literal ':' and '\' characters
+ # can be escaped with a backslash.
+ if type.downcase == 'const' then
+ elements = mangle_comment(comment).split(':')
+ if elements.nil? or elements.empty? then
+ con = Constant.new(const_name, definition, mangle_comment(comment))
+ else
+ new_definition = elements[0..-2].join(':')
+ if new_definition.empty? then # Default to literal C definition
+ new_definition = definition
+ else
+ new_definition.gsub!("\:", ":")
+ new_definition.gsub!("\\", '\\')
+ end
+ new_definition.sub!(/\A(\s+)/, '')
+ new_comment = $1.nil? ? elements.last : "#{$1}#{elements.last.lstrip}"
+ con = Constant.new(const_name, new_definition,
+ mangle_comment(new_comment))
+ end
+ else
+ con = Constant.new(const_name, definition, mangle_comment(comment))
+ end
+
+ class_obj.add_constant(con)
+ end
+
+ ##
+ # Finds a comment matching +type+ and +const_name+ either above the
+ # comment or in the matching Document- section.
+
+ def find_const_comment(type, const_name)
+ if @body =~ %r{((?>^\s*/\*.*?\*/\s+))
+ rb_define_#{type}\((?:\s*(\w+),)?\s*"#{const_name}"\s*,.*?\)\s*;}xmi
+ $1
+ elsif @body =~ %r{Document-(?:const|global|variable):\s#{const_name}\s*?\n((?>.*?\*/))}m
+ $1
+ else
+ ''
+ end
+ end
+
+ ###########################################################
+
+ def handle_attr(var_name, attr_name, reader, writer)
+ rw = ''
+ if reader
+ #@stats.num_methods += 1
+ rw << 'R'
+ end
+ if writer
+ #@stats.num_methods += 1
+ rw << 'W'
+ end
+
+ class_name = @known_classes[var_name]
+
+ return unless class_name
+
+ class_obj = find_class(var_name, class_name)
+
+ if class_obj
+ comment = find_attr_comment(attr_name)
+ unless comment.empty?
+ comment = mangle_comment(comment)
+ end
+ att = Attr.new('', attr_name, rw, comment)
+ class_obj.add_attribute(att)
+ end
+
+ end
+
+ ###########################################################
+
+ def find_attr_comment(attr_name)
+ if @body =~ %r{((?>/\*.*?\*/\s+))
+ rb_define_attr\((?:\s*(\w+),)?\s*"#{attr_name}"\s*,.*?\)\s*;}xmi
+ $1
+ elsif @body =~ %r{Document-attr:\s#{attr_name}\s*?\n((?>.*?\*/))}m
+ $1
+ else
+ ''
+ end
+ end
+
+ ###########################################################
+
+ def handle_method(type, var_name, meth_name,
+ meth_body, param_count, source_file = nil)
+ progress(".")
+
+ @stats.num_methods += 1
+ class_name = @known_classes[var_name]
+
+ return unless class_name
+
+ class_obj = find_class(var_name, class_name)
+
+ if class_obj
+ if meth_name == "initialize"
+ meth_name = "new"
+ type = "singleton_method"
+ end
+ meth_obj = AnyMethod.new("", meth_name)
+ meth_obj.singleton =
+ %w{singleton_method module_function}.include?(type)
+
+ p_count = (Integer(param_count) rescue -1)
+
+ if p_count < 0
+ meth_obj.params = "(...)"
+ elsif p_count == 0
+ meth_obj.params = "()"
+ else
+ meth_obj.params = "(" +
+ (1..p_count).map{|i| "p#{i}"}.join(", ") +
+ ")"
+ end
+
+ if source_file
+ file_name = File.join(@file_dir, source_file)
+ body = (@@known_bodies[source_file] ||= File.read(file_name))
+ else
+ body = @body
+ end
+ if find_body(meth_body, meth_obj, body) and meth_obj.document_self
+ class_obj.add_method(meth_obj)
+ end
+ end
+ end
+
+ ############################################################
+
+ # Find the C code corresponding to a Ruby method
+ def find_body(meth_name, meth_obj, body, quiet = false)
+ case body
+ when %r{((?>/\*.*?\*/\s*))(?:static\s+)?VALUE\s+#{meth_name}
+ \s*(\(.*?\)).*?^}xm
+ comment, params = $1, $2
+ body_text = $&
+
+ remove_private_comments(comment) if comment
+
+ # see if we can find the whole body
+
+ re = Regexp.escape(body_text) + '[^(]*^\{.*?^\}'
+ if Regexp.new(re, Regexp::MULTILINE).match(body)
+ body_text = $&
+ end
+
+ # The comment block may have been overridden with a
+ # 'Document-method' block. This happens in the interpreter
+ # when multiple methods are vectored through to the same
+ # C method but those methods are logically distinct (for
+ # example Kernel.hash and Kernel.object_id share the same
+ # implementation
+
+ override_comment = find_override_comment(meth_obj.name)
+ comment = override_comment if override_comment
+
+ find_modifiers(comment, meth_obj) if comment
+
+# meth_obj.params = params
+ meth_obj.start_collecting_tokens
+ meth_obj.add_token(RubyToken::Token.new(1,1).set_text(body_text))
+ meth_obj.comment = mangle_comment(comment)
+ when %r{((?>/\*.*?\*/\s*))^\s*\#\s*define\s+#{meth_name}\s+(\w+)}m
+ comment = $1
+ find_body($2, meth_obj, body, true)
+ find_modifiers(comment, meth_obj)
+ meth_obj.comment = mangle_comment(comment) + meth_obj.comment
+ when %r{^\s*\#\s*define\s+#{meth_name}\s+(\w+)}m
+ unless find_body($1, meth_obj, body, true)
+ warn "No definition for #{meth_name}" unless quiet
+ return false
+ end
+ else
+
+ # No body, but might still have an override comment
+ comment = find_override_comment(meth_obj.name)
+
+ if comment
+ find_modifiers(comment, meth_obj)
+ meth_obj.comment = mangle_comment(comment)
+ else
+ warn "No definition for #{meth_name}" unless quiet
+ return false
+ end
+ end
+ true
+ end
+
+
+ ##
+ # If the comment block contains a section that looks like:
+ #
+ # call-seq:
+ # Array.new
+ # Array.new(10)
+ #
+ # use it for the parameters.
+
+ def find_modifiers(comment, meth_obj)
+ if comment.sub!(/:nodoc:\s*^\s*\*?\s*$/m, '') or
+ comment.sub!(/\A\/\*\s*:nodoc:\s*\*\/\Z/, '')
+ meth_obj.document_self = false
+ end
+ if comment.sub!(/call-seq:(.*?)^\s*\*?\s*$/m, '') or
+ comment.sub!(/\A\/\*\s*call-seq:(.*?)\*\/\Z/, '')
+ seq = $1
+ seq.gsub!(/^\s*\*\s*/, '')
+ meth_obj.call_seq = seq
+ end
+ end
+
+ ############################################################
+
+ def find_override_comment(meth_name)
+ name = Regexp.escape(meth_name)
+ if @body =~ %r{Document-method:\s#{name}\s*?\n((?>.*?\*/))}m
+ $1
+ end
+ end
+
+ ##
+ # Look for includes of the form:
+ #
+ # rb_include_module(rb_cArray, rb_mEnumerable);
+
+ def do_includes
+ @body.scan(/rb_include_module\s*\(\s*(\w+?),\s*(\w+?)\s*\)/) do |c,m|
+ if cls = @classes[c]
+ m = @known_classes[m] || m
+ cls.add_include(Include.new(m, ""))
+ end
+ end
+ end
+
+ ##
+ # Remove the /*'s and leading asterisks from C comments
+
+ def mangle_comment(comment)
+ comment.sub!(%r{/\*+}) { " " * $&.length }
+ comment.sub!(%r{\*+/}) { " " * $&.length }
+ comment.gsub!(/^[ \t]*\*/m) { " " * $&.length }
+ comment
+ end
+
+ def find_class(raw_name, name)
+ unless @classes[raw_name]
+ if raw_name =~ /^rb_m/
+ @classes[raw_name] = @top_level.add_module(NormalModule, name)
+ else
+ @classes[raw_name] = @top_level.add_class(NormalClass, name, nil)
+ end
+ end
+ @classes[raw_name]
+ end
+
+ def handle_tab_width(body)
+ if /\t/ =~ body
+ tab_width = Options.instance.tab_width
+ body.split(/\n/).map do |line|
+ 1 while line.gsub!(/\t+/) { ' ' * (tab_width*$&.length - $`.length % tab_width)} && $~ #`
+ line
+ end .join("\n")
+ else
+ body
+ end
+ end
+
+ ##
+ # Removes #ifdefs that would otherwise confuse us
+
+ def handle_ifdefs_in(body)
+ body.gsub(/^#ifdef HAVE_PROTOTYPES.*?#else.*?\n(.*?)#endif.*?\n/m) { $1 }
+ end
+
+ end
+
+end
+
diff --git a/lib/rdoc/parsers/parse_f95.rb b/lib/rdoc/parsers/parse_f95.rb
new file mode 100644
index 0000000000..f1a1ae4d4b
--- /dev/null
+++ b/lib/rdoc/parsers/parse_f95.rb
@@ -0,0 +1,1841 @@
+#= parse_f95.rb - Fortran95 Parser
+#
+#== Overview
+#
+#"parse_f95.rb" parses Fortran95 files with suffixes "f90", "F90", "f95"
+#and "F95". Fortran95 files are expected to be conformed to Fortran95
+#standards.
+#
+#== Rules
+#
+#Fundamental rules are same as that of the Ruby parser.
+#But comment markers are '!' not '#'.
+#
+#=== Correspondence between RDoc documentation and Fortran95 programs
+#
+#"parse_f95.rb" parses main programs, modules, subroutines, functions,
+#derived-types, public variables, public constants,
+#defined operators and defined assignments.
+#These components are described in items of RDoc documentation, as follows.
+#
+#Files :: Files (same as Ruby)
+#Classes :: Modules
+#Methods :: Subroutines, functions, variables, constants, derived-types, defined operators, defined assignments
+#Required files :: Files in which imported modules, external subroutines and external functions are defined.
+#Included Modules :: List of imported modules
+#Attributes :: List of derived-types, List of imported modules all of whose components are published again
+#
+#Components listed in 'Methods' (subroutines, functions, ...)
+#defined in modules are described in the item of 'Classes'.
+#On the other hand, components defined in main programs or
+#as external procedures are described in the item of 'Files'.
+#
+#=== Components parsed by default
+#
+#By default, documentation on public components (subroutines, functions,
+#variables, constants, derived-types, defined operators,
+#defined assignments) are generated.
+#With "--all" option, documentation on all components
+#are generated (almost same as the Ruby parser).
+#
+#=== Information parsed automatically
+#
+#The following information is automatically parsed.
+#
+#* Types of arguments
+#* Types of variables and constants
+#* Types of variables in the derived types, and initial values
+#* NAMELISTs and types of variables in them, and initial values
+#
+#Aliases by interface statement are described in the item of 'Methods'.
+#
+#Components which are imported from other modules and published again
+#are described in the item of 'Methods'.
+#
+#=== Format of comment blocks
+#
+#Comment blocks should be written as follows.
+#Comment blocks are considered to be ended when the line without '!'
+#appears.
+#The indentation is not necessary.
+#
+# ! (Top of file)
+# !
+# ! Comment blocks for the files.
+# !
+# !--
+# ! The comment described in the part enclosed by
+# ! "!--" and "!++" is ignored.
+# !++
+# !
+# module hogehoge
+# !
+# ! Comment blocks for the modules (or the programs).
+# !
+#
+# private
+#
+# logical :: a ! a private variable
+# real, public :: b ! a public variable
+# integer, parameter :: c = 0 ! a public constant
+#
+# public :: c
+# public :: MULTI_ARRAY
+# public :: hoge, foo
+#
+# type MULTI_ARRAY
+# !
+# ! Comment blocks for the derived-types.
+# !
+# real, pointer :: var(:) =>null() ! Comments block for the variables.
+# integer :: num = 0
+# end type MULTI_ARRAY
+#
+# contains
+#
+# subroutine hoge( in, & ! Comment blocks between continuation lines are ignored.
+# & out )
+# !
+# ! Comment blocks for the subroutines or functions
+# !
+# character(*),intent(in):: in ! Comment blocks for the arguments.
+# character(*),intent(out),allocatable,target :: in
+# ! Comment blocks can be
+# ! written under Fortran statements.
+#
+# character(32) :: file ! This comment parsed as a variable in below NAMELIST.
+# integer :: id
+#
+# namelist /varinfo_nml/ file, id
+# !
+# ! Comment blocks for the NAMELISTs.
+# ! Information about variables are described above.
+# !
+#
+# ....
+#
+# end subroutine hoge
+#
+# integer function foo( in )
+# !
+# ! This part is considered as comment block.
+#
+# ! Comment blocks under blank lines are ignored.
+# !
+# integer, intent(in):: inA ! This part is considered as comment block.
+#
+# ! This part is ignored.
+#
+# end function foo
+#
+# subroutine hide( in, &
+# & out ) !:nodoc:
+# !
+# ! If "!:nodoc:" is described at end-of-line in subroutine
+# ! statement as above, the subroutine is ignored.
+# ! This assignment can be used to modules, subroutines,
+# ! functions, variables, constants, derived-types,
+# ! defined operators, defined assignments,
+# ! list of imported modules ("use" statement).
+# !
+#
+# ....
+#
+# end subroutine hide
+#
+# end module hogehoge
+#
+
+
+require "rdoc/code_objects"
+
+module RDoc
+
+ class Token
+
+ NO_TEXT = "??".freeze
+
+ def initialize(line_no, char_no)
+ @line_no = line_no
+ @char_no = char_no
+ @text = NO_TEXT
+ end
+ # Because we're used in contexts that expect to return a token,
+ # we set the text string and then return ourselves
+ def set_text(text)
+ @text = text
+ self
+ end
+
+ attr_reader :line_no, :char_no, :text
+
+ end
+
+ # See rdoc/parsers/parse_f95.rb
+
+ class Fortran95parser
+
+ extend ParserFactory
+ parse_files_matching(/\.((f|F)9(0|5)|F)$/)
+
+ @@external_aliases = []
+ @@public_methods = []
+
+ # "false":: Comments are below source code
+ # "true" :: Comments are upper source code
+ COMMENTS_ARE_UPPER = false
+
+ # Internal alias message
+ INTERNAL_ALIAS_MES = "Alias for"
+
+ # External alias message
+ EXTERNAL_ALIAS_MES = "The entity is"
+
+ # prepare to parse a Fortran 95 file
+ def initialize(top_level, file_name, body, options, stats)
+ @body = body
+ @stats = stats
+ @file_name = file_name
+ @options = options
+ @top_level = top_level
+ @progress = $stderr unless options.quiet
+ end
+
+ # define code constructs
+ def scan
+
+ # remove private comment
+ remaining_code = remove_private_comments(@body)
+
+ # continuation lines are united to one line
+ remaining_code = united_to_one_line(remaining_code)
+
+ # semicolons are replaced to line feed
+ remaining_code = semicolon_to_linefeed(remaining_code)
+
+ # collect comment for file entity
+ whole_comment, remaining_code = collect_first_comment(remaining_code)
+ @top_level.comment = whole_comment
+
+ # String "remaining_code" is converted to Array "remaining_lines"
+ remaining_lines = remaining_code.split("\n")
+
+ # "module" or "program" parts are parsed (new)
+ #
+ level_depth = 0
+ block_searching_flag = nil
+ block_searching_lines = []
+ pre_comment = []
+ module_program_trailing = ""
+ module_program_name = ""
+ other_block_level_depth = 0
+ other_block_searching_flag = nil
+ remaining_lines.collect!{|line|
+ if !block_searching_flag && !other_block_searching_flag
+ if line =~ /^\s*?module\s+(\w+)\s*?(!.*?)?$/i
+ block_searching_flag = :module
+ block_searching_lines << line
+ module_program_name = $1
+ module_program_trailing = find_comments($2)
+ next false
+ elsif line =~ /^\s*?program\s+(\w+)\s*?(!.*?)?$/i ||
+ line =~ /^\s*?\w/ && !block_start?(line)
+ block_searching_flag = :program
+ block_searching_lines << line
+ module_program_name = $1 || ""
+ module_program_trailing = find_comments($2)
+ next false
+
+ elsif block_start?(line)
+ other_block_searching_flag = true
+ next line
+
+ elsif line =~ /^\s*?!\s?(.*)/
+ pre_comment << line
+ next line
+ else
+ pre_comment = []
+ next line
+ end
+ elsif other_block_searching_flag
+ other_block_level_depth += 1 if block_start?(line)
+ other_block_level_depth -= 1 if block_end?(line)
+ if other_block_level_depth < 0
+ other_block_level_depth = 0
+ other_block_searching_flag = nil
+ end
+ next line
+ end
+
+ block_searching_lines << line
+ level_depth += 1 if block_start?(line)
+ level_depth -= 1 if block_end?(line)
+ if level_depth >= 0
+ next false
+ end
+
+ # "module_program_code" is formatted.
+ # ":nodoc:" flag is checked.
+ #
+ module_program_code = block_searching_lines.join("\n")
+ module_program_code = remove_empty_head_lines(module_program_code)
+ if module_program_trailing =~ /^:nodoc:/
+ # next loop to search next block
+ level_depth = 0
+ block_searching_flag = false
+ block_searching_lines = []
+ pre_comment = []
+ next false
+ end
+
+ # NormalClass is created, and added to @top_level
+ #
+ if block_searching_flag == :module
+ module_name = module_program_name
+ module_code = module_program_code
+ module_trailing = module_program_trailing
+ progress "m"
+ @stats.num_modules += 1
+ f9x_module = @top_level.add_module NormalClass, module_name
+ f9x_module.record_location @top_level
+
+ f9x_comment = COMMENTS_ARE_UPPER ?
+ find_comments(pre_comment.join("\n")) + "\n" + module_trailing :
+ module_trailing + "\n" + find_comments(module_code.sub(/^.*$\n/i, ''))
+ f9x_module.comment = f9x_comment
+ parse_program_or_module(f9x_module, module_code)
+
+ TopLevel.all_files.each do |name, toplevel|
+ if toplevel.include_includes?(module_name, @options.ignore_case)
+ if !toplevel.include_requires?(@file_name, @options.ignore_case)
+ toplevel.add_require(Require.new(@file_name, ""))
+ end
+ end
+ toplevel.each_classmodule{|m|
+ if m.include_includes?(module_name, @options.ignore_case)
+ if !m.include_requires?(@file_name, @options.ignore_case)
+ m.add_require(Require.new(@file_name, ""))
+ end
+ end
+ }
+ end
+ elsif block_searching_flag == :program
+ program_name = module_program_name
+ program_code = module_program_code
+ program_trailing = module_program_trailing
+ progress "p"
+ program_comment = COMMENTS_ARE_UPPER ?
+ find_comments(pre_comment.join("\n")) + "\n" + program_trailing :
+ program_trailing + "\n" + find_comments(program_code.sub(/^.*$\n/i, ''))
+ program_comment = "\n\n= <i>Program</i> <tt>#{program_name}</tt>\n\n" \
+ + program_comment
+ @top_level.comment << program_comment
+ parse_program_or_module(@top_level, program_code, :private)
+ end
+
+ # next loop to search next block
+ level_depth = 0
+ block_searching_flag = false
+ block_searching_lines = []
+ pre_comment = []
+ next false
+ }
+
+ remaining_lines.delete_if{ |line|
+ line == false
+ }
+
+ # External subprograms and functions are parsed
+ #
+ parse_program_or_module(@top_level, remaining_lines.join("\n"),
+ :public, true)
+
+ @top_level
+ end # End of scan
+
+ private
+
+ def parse_program_or_module(container, code,
+ visibility=:public, external=nil)
+ return unless container
+ return unless code
+ remaining_lines = code.split("\n")
+ remaining_code = "#{code}"
+
+ #
+ # Parse variables before "contains" in module
+ #
+ level_depth = 0
+ before_contains_lines = []
+ before_contains_code = nil
+ before_contains_flag = nil
+ remaining_lines.each{ |line|
+ if !before_contains_flag
+ if line =~ /^\s*?module\s+\w+\s*?(!.*?)?$/i
+ before_contains_flag = true
+ end
+ else
+ break if line =~ /^\s*?contains\s*?(!.*?)?$/i
+ level_depth += 1 if block_start?(line)
+ level_depth -= 1 if block_end?(line)
+ break if level_depth < 0
+ before_contains_lines << line
+ end
+ }
+ before_contains_code = before_contains_lines.join("\n")
+ if before_contains_code
+ before_contains_code.gsub!(/^\s*?interface\s+.*?\s+end\s+interface.*?$/im, "")
+ before_contains_code.gsub!(/^\s*?type[\s\,]+.*?\s+end\s+type.*?$/im, "")
+ end
+
+ #
+ # Parse global "use"
+ #
+ use_check_code = "#{before_contains_code}"
+ cascaded_modules_list = []
+ while use_check_code =~ /^\s*?use\s+(\w+)(.*?)(!.*?)?$/i
+ use_check_code = $~.pre_match
+ use_check_code << $~.post_match
+ used_mod_name = $1.strip.chomp
+ used_list = $2 || ""
+ used_trailing = $3 || ""
+ next if used_trailing =~ /!:nodoc:/
+ if !container.include_includes?(used_mod_name, @options.ignore_case)
+ progress "."
+ container.add_include Include.new(used_mod_name, "")
+ end
+ if ! (used_list =~ /\,\s*?only\s*?:/i )
+ cascaded_modules_list << "\#" + used_mod_name
+ end
+ end
+
+ #
+ # Parse public and private, and store information.
+ # This information is used when "add_method" and
+ # "set_visibility_for" are called.
+ #
+ visibility_default, visibility_info =
+ parse_visibility(remaining_lines.join("\n"), visibility, container)
+ @@public_methods.concat visibility_info
+ if visibility_default == :public
+ if !cascaded_modules_list.empty?
+ cascaded_modules =
+ Attr.new("Cascaded Modules",
+ "Imported modules all of whose components are published again",
+ "",
+ cascaded_modules_list.join(", "))
+ container.add_attribute(cascaded_modules)
+ end
+ end
+
+ #
+ # Check rename elements
+ #
+ use_check_code = "#{before_contains_code}"
+ while use_check_code =~ /^\s*?use\s+(\w+)\s*?\,(.+)$/i
+ use_check_code = $~.pre_match
+ use_check_code << $~.post_match
+ used_mod_name = $1.strip.chomp
+ used_elements = $2.sub(/\s*?only\s*?:\s*?/i, '')
+ used_elements.split(",").each{ |used|
+ if /\s*?(\w+)\s*?=>\s*?(\w+)\s*?/ =~ used
+ local = $1
+ org = $2
+ @@public_methods.collect!{ |pub_meth|
+ if local == pub_meth["name"] ||
+ local.upcase == pub_meth["name"].upcase &&
+ @options.ignore_case
+ pub_meth["name"] = org
+ pub_meth["local_name"] = local
+ end
+ pub_meth
+ }
+ end
+ }
+ end
+
+ #
+ # Parse private "use"
+ #
+ use_check_code = remaining_lines.join("\n")
+ while use_check_code =~ /^\s*?use\s+(\w+)(.*?)(!.*?)?$/i
+ use_check_code = $~.pre_match
+ use_check_code << $~.post_match
+ used_mod_name = $1.strip.chomp
+ used_trailing = $3 || ""
+ next if used_trailing =~ /!:nodoc:/
+ if !container.include_includes?(used_mod_name, @options.ignore_case)
+ progress "."
+ container.add_include Include.new(used_mod_name, "")
+ end
+ end
+
+ container.each_includes{ |inc|
+ TopLevel.all_files.each do |name, toplevel|
+ indicated_mod = toplevel.find_symbol(inc.name,
+ nil, @options.ignore_case)
+ if indicated_mod
+ indicated_name = indicated_mod.parent.file_relative_name
+ if !container.include_requires?(indicated_name, @options.ignore_case)
+ container.add_require(Require.new(indicated_name, ""))
+ end
+ break
+ end
+ end
+ }
+
+ #
+ # Parse derived-types definitions
+ #
+ derived_types_comment = ""
+ remaining_code = remaining_lines.join("\n")
+ while remaining_code =~ /^\s*?
+ type[\s\,]+(public|private)?\s*?(::)?\s*?
+ (\w+)\s*?(!.*?)?$
+ (.*?)
+ ^\s*?end\s+type.*?$
+ /imx
+ remaining_code = $~.pre_match
+ remaining_code << $~.post_match
+ typename = $3.chomp.strip
+ type_elements = $5 || ""
+ type_code = remove_empty_head_lines($&)
+ type_trailing = find_comments($4)
+ next if type_trailing =~ /^:nodoc:/
+ type_visibility = $1
+ type_comment = COMMENTS_ARE_UPPER ?
+ find_comments($~.pre_match) + "\n" + type_trailing :
+ type_trailing + "\n" + find_comments(type_code.sub(/^.*$\n/i, ''))
+ type_element_visibility_public = true
+ type_code.split("\n").each{ |line|
+ if /^\s*?private\s*?$/ =~ line
+ type_element_visibility_public = nil
+ break
+ end
+ } if type_code
+
+ args_comment = ""
+ type_args_info = nil
+
+ if @options.show_all
+ args_comment = find_arguments(nil, type_code, true)
+ else
+ type_public_args_list = []
+ type_args_info = definition_info(type_code)
+ type_args_info.each{ |arg|
+ arg_is_public = type_element_visibility_public
+ arg_is_public = true if arg.include_attr?("public")
+ arg_is_public = nil if arg.include_attr?("private")
+ type_public_args_list << arg.varname if arg_is_public
+ }
+ args_comment = find_arguments(type_public_args_list, type_code)
+ end
+
+ type = AnyMethod.new("type #{typename}", typename)
+ type.singleton = false
+ type.params = ""
+ type.comment = "<b><em> Derived Type </em></b> :: <tt></tt>\n"
+ type.comment << args_comment if args_comment
+ type.comment << type_comment if type_comment
+ progress "t"
+ @stats.num_methods += 1
+ container.add_method type
+
+ set_visibility(container, typename, visibility_default, @@public_methods)
+
+ if type_visibility
+ type_visibility.gsub!(/\s/,'')
+ type_visibility.gsub!(/\,/,'')
+ type_visibility.gsub!(/:/,'')
+ type_visibility.downcase!
+ if type_visibility == "public"
+ container.set_visibility_for([typename], :public)
+ elsif type_visibility == "private"
+ container.set_visibility_for([typename], :private)
+ end
+ end
+
+ check_public_methods(type, container.name)
+
+ if @options.show_all
+ derived_types_comment << ", " unless derived_types_comment.empty?
+ derived_types_comment << typename
+ else
+ if type.visibility == :public
+ derived_types_comment << ", " unless derived_types_comment.empty?
+ derived_types_comment << typename
+ end
+ end
+
+ end
+
+ if !derived_types_comment.empty?
+ derived_types_table =
+ Attr.new("Derived Types", "Derived_Types", "",
+ derived_types_comment)
+ container.add_attribute(derived_types_table)
+ end
+
+ #
+ # move interface scope
+ #
+ interface_code = ""
+ while remaining_code =~ /^\s*?
+ interface(
+ \s+\w+ |
+ \s+operator\s*?\(.*?\) |
+ \s+assignment\s*?\(\s*?=\s*?\)
+ )?\s*?$
+ (.*?)
+ ^\s*?end\s+interface.*?$
+ /imx
+ interface_code << remove_empty_head_lines($&) + "\n"
+ remaining_code = $~.pre_match
+ remaining_code << $~.post_match
+ end
+
+ #
+ # Parse global constants or variables in modules
+ #
+ const_var_defs = definition_info(before_contains_code)
+ const_var_defs.each{|defitem|
+ next if defitem.nodoc
+ const_or_var_type = "Variable"
+ const_or_var_progress = "v"
+ if defitem.include_attr?("parameter")
+ const_or_var_type = "Constant"
+ const_or_var_progress = "c"
+ end
+ const_or_var = AnyMethod.new(const_or_var_type, defitem.varname)
+ const_or_var.singleton = false
+ const_or_var.params = ""
+ self_comment = find_arguments([defitem.varname], before_contains_code)
+ const_or_var.comment = "<b><em>" + const_or_var_type + "</em></b> :: <tt></tt>\n"
+ const_or_var.comment << self_comment if self_comment
+ progress const_or_var_progress
+ @stats.num_methods += 1
+ container.add_method const_or_var
+
+ set_visibility(container, defitem.varname, visibility_default, @@public_methods)
+
+ if defitem.include_attr?("public")
+ container.set_visibility_for([defitem.varname], :public)
+ elsif defitem.include_attr?("private")
+ container.set_visibility_for([defitem.varname], :private)
+ end
+
+ check_public_methods(const_or_var, container.name)
+
+ } if const_var_defs
+
+ remaining_lines = remaining_code.split("\n")
+
+ # "subroutine" or "function" parts are parsed (new)
+ #
+ level_depth = 0
+ block_searching_flag = nil
+ block_searching_lines = []
+ pre_comment = []
+ procedure_trailing = ""
+ procedure_name = ""
+ procedure_params = ""
+ procedure_prefix = ""
+ procedure_result_arg = ""
+ procedure_type = ""
+ contains_lines = []
+ contains_flag = nil
+ remaining_lines.collect!{|line|
+ if !block_searching_flag
+ # subroutine
+ if line =~ /^\s*?
+ (recursive|pure|elemental)?\s*?
+ subroutine\s+(\w+)\s*?(\(.*?\))?\s*?(!.*?)?$
+ /ix
+ block_searching_flag = :subroutine
+ block_searching_lines << line
+
+ procedure_name = $2.chomp.strip
+ procedure_params = $3 || ""
+ procedure_prefix = $1 || ""
+ procedure_trailing = $4 || "!"
+ next false
+
+ # function
+ elsif line =~ /^\s*?
+ (recursive|pure|elemental)?\s*?
+ (
+ character\s*?(\([\w\s\=\(\)\*]+?\))?\s+
+ | type\s*?\([\w\s]+?\)\s+
+ | integer\s*?(\([\w\s\=\(\)\*]+?\))?\s+
+ | real\s*?(\([\w\s\=\(\)\*]+?\))?\s+
+ | double\s+precision\s+
+ | logical\s*?(\([\w\s\=\(\)\*]+?\))?\s+
+ | complex\s*?(\([\w\s\=\(\)\*]+?\))?\s+
+ )?
+ function\s+(\w+)\s*?
+ (\(.*?\))?(\s+result\((.*?)\))?\s*?(!.*?)?$
+ /ix
+ block_searching_flag = :function
+ block_searching_lines << line
+
+ procedure_prefix = $1 || ""
+ procedure_type = $2 ? $2.chomp.strip : nil
+ procedure_name = $8.chomp.strip
+ procedure_params = $9 || ""
+ procedure_result_arg = $11 ? $11.chomp.strip : procedure_name
+ procedure_trailing = $12 || "!"
+ next false
+ elsif line =~ /^\s*?!\s?(.*)/
+ pre_comment << line
+ next line
+ else
+ pre_comment = []
+ next line
+ end
+ end
+ contains_flag = true if line =~ /^\s*?contains\s*?(!.*?)?$/
+ block_searching_lines << line
+ contains_lines << line if contains_flag
+
+ level_depth += 1 if block_start?(line)
+ level_depth -= 1 if block_end?(line)
+ if level_depth >= 0
+ next false
+ end
+
+ # "procedure_code" is formatted.
+ # ":nodoc:" flag is checked.
+ #
+ procedure_code = block_searching_lines.join("\n")
+ procedure_code = remove_empty_head_lines(procedure_code)
+ if procedure_trailing =~ /^!:nodoc:/
+ # next loop to search next block
+ level_depth = 0
+ block_searching_flag = nil
+ block_searching_lines = []
+ pre_comment = []
+ procedure_trailing = ""
+ procedure_name = ""
+ procedure_params = ""
+ procedure_prefix = ""
+ procedure_result_arg = ""
+ procedure_type = ""
+ contains_lines = []
+ contains_flag = nil
+ next false
+ end
+
+ # AnyMethod is created, and added to container
+ #
+ subroutine_function = nil
+ if block_searching_flag == :subroutine
+ subroutine_prefix = procedure_prefix
+ subroutine_name = procedure_name
+ subroutine_params = procedure_params
+ subroutine_trailing = procedure_trailing
+ subroutine_code = procedure_code
+
+ subroutine_comment = COMMENTS_ARE_UPPER ?
+ pre_comment.join("\n") + "\n" + subroutine_trailing :
+ subroutine_trailing + "\n" + subroutine_code.sub(/^.*$\n/i, '')
+ subroutine = AnyMethod.new("subroutine", subroutine_name)
+ parse_subprogram(subroutine, subroutine_params,
+ subroutine_comment, subroutine_code,
+ before_contains_code, nil, subroutine_prefix)
+ progress "s"
+ @stats.num_methods += 1
+ container.add_method subroutine
+ subroutine_function = subroutine
+
+ elsif block_searching_flag == :function
+ function_prefix = procedure_prefix
+ function_type = procedure_type
+ function_name = procedure_name
+ function_params_org = procedure_params
+ function_result_arg = procedure_result_arg
+ function_trailing = procedure_trailing
+ function_code_org = procedure_code
+
+ function_comment = COMMENTS_ARE_UPPER ?
+ pre_comment.join("\n") + "\n" + function_trailing :
+ function_trailing + "\n " + function_code_org.sub(/^.*$\n/i, '')
+
+ function_code = "#{function_code_org}"
+ if function_type
+ function_code << "\n" + function_type + " :: " + function_result_arg
+ end
+
+ function_params =
+ function_params_org.sub(/^\(/, "\(#{function_result_arg}, ")
+
+ function = AnyMethod.new("function", function_name)
+ parse_subprogram(function, function_params,
+ function_comment, function_code,
+ before_contains_code, true, function_prefix)
+
+ # Specific modification due to function
+ function.params.sub!(/\(\s*?#{function_result_arg}\s*?,\s*?/, "\( ")
+ function.params << " result(" + function_result_arg + ")"
+ function.start_collecting_tokens
+ function.add_token Token.new(1,1).set_text(function_code_org)
+
+ progress "f"
+ @stats.num_methods += 1
+ container.add_method function
+ subroutine_function = function
+
+ end
+
+ # The visibility of procedure is specified
+ #
+ set_visibility(container, procedure_name,
+ visibility_default, @@public_methods)
+
+ # The alias for this procedure from external modules
+ #
+ check_external_aliases(procedure_name,
+ subroutine_function.params,
+ subroutine_function.comment, subroutine_function) if external
+ check_public_methods(subroutine_function, container.name)
+
+
+ # contains_lines are parsed as private procedures
+ if contains_flag
+ parse_program_or_module(container,
+ contains_lines.join("\n"), :private)
+ end
+
+ # next loop to search next block
+ level_depth = 0
+ block_searching_flag = nil
+ block_searching_lines = []
+ pre_comment = []
+ procedure_trailing = ""
+ procedure_name = ""
+ procedure_params = ""
+ procedure_prefix = ""
+ procedure_result_arg = ""
+ contains_lines = []
+ contains_flag = nil
+ next false
+ } # End of remaining_lines.collect!{|line|
+
+ # Array remains_lines is converted to String remains_code again
+ #
+ remaining_code = remaining_lines.join("\n")
+
+ #
+ # Parse interface
+ #
+ interface_scope = false
+ generic_name = ""
+ interface_code.split("\n").each{ |line|
+ if /^\s*?
+ interface(
+ \s+\w+|
+ \s+operator\s*?\(.*?\)|
+ \s+assignment\s*?\(\s*?=\s*?\)
+ )?
+ \s*?(!.*?)?$
+ /ix =~ line
+ generic_name = $1 ? $1.strip.chomp : nil
+ interface_trailing = $2 || "!"
+ interface_scope = true
+ interface_scope = false if interface_trailing =~ /!:nodoc:/
+# if generic_name =~ /operator\s*?\((.*?)\)/i
+# operator_name = $1
+# if operator_name && !operator_name.empty?
+# generic_name = "#{operator_name}"
+# end
+# end
+# if generic_name =~ /assignment\s*?\((.*?)\)/i
+# assignment_name = $1
+# if assignment_name && !assignment_name.empty?
+# generic_name = "#{assignment_name}"
+# end
+# end
+ end
+ if /^\s*?end\s+interface/i =~ line
+ interface_scope = false
+ generic_name = nil
+ end
+ # internal alias
+ if interface_scope && /^\s*?module\s+procedure\s+(.*?)(!.*?)?$/i =~ line
+ procedures = $1.strip.chomp
+ procedures_trailing = $2 || "!"
+ next if procedures_trailing =~ /!:nodoc:/
+ procedures.split(",").each{ |proc|
+ proc.strip!
+ proc.chomp!
+ next if generic_name == proc || !generic_name
+ old_meth = container.find_symbol(proc, nil, @options.ignore_case)
+ next if !old_meth
+ nolink = old_meth.visibility == :private ? true : nil
+ nolink = nil if @options.show_all
+ new_meth =
+ initialize_external_method(generic_name, proc,
+ old_meth.params, nil,
+ old_meth.comment,
+ old_meth.clone.token_stream[0].text,
+ true, nolink)
+ new_meth.singleton = old_meth.singleton
+
+ progress "i"
+ @stats.num_methods += 1
+ container.add_method new_meth
+
+ set_visibility(container, generic_name, visibility_default, @@public_methods)
+
+ check_public_methods(new_meth, container.name)
+
+ }
+ end
+
+ # external aliases
+ if interface_scope
+ # subroutine
+ proc = nil
+ params = nil
+ procedures_trailing = nil
+ if line =~ /^\s*?
+ (recursive|pure|elemental)?\s*?
+ subroutine\s+(\w+)\s*?(\(.*?\))?\s*?(!.*?)?$
+ /ix
+ proc = $2.chomp.strip
+ generic_name = proc unless generic_name
+ params = $3 || ""
+ procedures_trailing = $4 || "!"
+
+ # function
+ elsif line =~ /^\s*?
+ (recursive|pure|elemental)?\s*?
+ (
+ character\s*?(\([\w\s\=\(\)\*]+?\))?\s+
+ | type\s*?\([\w\s]+?\)\s+
+ | integer\s*?(\([\w\s\=\(\)\*]+?\))?\s+
+ | real\s*?(\([\w\s\=\(\)\*]+?\))?\s+
+ | double\s+precision\s+
+ | logical\s*?(\([\w\s\=\(\)\*]+?\))?\s+
+ | complex\s*?(\([\w\s\=\(\)\*]+?\))?\s+
+ )?
+ function\s+(\w+)\s*?
+ (\(.*?\))?(\s+result\((.*?)\))?\s*?(!.*?)?$
+ /ix
+ proc = $8.chomp.strip
+ generic_name = proc unless generic_name
+ params = $9 || ""
+ procedures_trailing = $12 || "!"
+ else
+ next
+ end
+ next if procedures_trailing =~ /!:nodoc:/
+ indicated_method = nil
+ indicated_file = nil
+ TopLevel.all_files.each do |name, toplevel|
+ indicated_method = toplevel.find_local_symbol(proc, @options.ignore_case)
+ indicated_file = name
+ break if indicated_method
+ end
+
+ if indicated_method
+ external_method =
+ initialize_external_method(generic_name, proc,
+ indicated_method.params,
+ indicated_file,
+ indicated_method.comment)
+
+ progress "e"
+ @stats.num_methods += 1
+ container.add_method external_method
+ set_visibility(container, generic_name, visibility_default, @@public_methods)
+ if !container.include_requires?(indicated_file, @options.ignore_case)
+ container.add_require(Require.new(indicated_file, ""))
+ end
+ check_public_methods(external_method, container.name)
+
+ else
+ @@external_aliases << {
+ "new_name" => generic_name,
+ "old_name" => proc,
+ "file_or_module" => container,
+ "visibility" => find_visibility(container, generic_name, @@public_methods) || visibility_default
+ }
+ end
+ end
+
+ } if interface_code # End of interface_code.split("\n").each ...
+
+ #
+ # Already imported methods are removed from @@public_methods.
+ # Remainders are assumed to be imported from other modules.
+ #
+ @@public_methods.delete_if{ |method| method["entity_is_discovered"]}
+
+ @@public_methods.each{ |pub_meth|
+ next unless pub_meth["file_or_module"].name == container.name
+ pub_meth["used_modules"].each{ |used_mod|
+ TopLevel.all_classes_and_modules.each{ |modules|
+ if modules.name == used_mod ||
+ modules.name.upcase == used_mod.upcase &&
+ @options.ignore_case
+ modules.method_list.each{ |meth|
+ if meth.name == pub_meth["name"] ||
+ meth.name.upcase == pub_meth["name"].upcase &&
+ @options.ignore_case
+ new_meth = initialize_public_method(meth,
+ modules.name)
+ if pub_meth["local_name"]
+ new_meth.name = pub_meth["local_name"]
+ end
+ progress "e"
+ @stats.num_methods += 1
+ container.add_method new_meth
+ end
+ }
+ end
+ }
+ }
+ }
+
+ container
+ end # End of parse_program_or_module
+
+ #
+ # Parse arguments, comment, code of subroutine and function.
+ # Return AnyMethod object.
+ #
+ def parse_subprogram(subprogram, params, comment, code,
+ before_contains=nil, function=nil, prefix=nil)
+ subprogram.singleton = false
+ prefix = "" if !prefix
+ arguments = params.sub(/\(/, "").sub(/\)/, "").split(",") if params
+ args_comment, params_opt =
+ find_arguments(arguments, code.sub(/^s*?contains\s*?(!.*?)?$.*/im, ""),
+ nil, nil, true)
+ params_opt = "( " + params_opt + " ) " if params_opt
+ subprogram.params = params_opt || ""
+ namelist_comment = find_namelists(code, before_contains)
+
+ block_comment = find_comments comment
+ if function
+ subprogram.comment = "<b><em> Function </em></b> :: <em>#{prefix}</em>\n"
+ else
+ subprogram.comment = "<b><em> Subroutine </em></b> :: <em>#{prefix}</em>\n"
+ end
+ subprogram.comment << args_comment if args_comment
+ subprogram.comment << block_comment if block_comment
+ subprogram.comment << namelist_comment if namelist_comment
+
+ # For output source code
+ subprogram.start_collecting_tokens
+ subprogram.add_token Token.new(1,1).set_text(code)
+
+ subprogram
+ end
+
+ #
+ # Collect comment for file entity
+ #
+ def collect_first_comment(body)
+ comment = ""
+ not_comment = ""
+ comment_start = false
+ comment_end = false
+ body.split("\n").each{ |line|
+ if comment_end
+ not_comment << line
+ not_comment << "\n"
+ elsif /^\s*?!\s?(.*)$/i =~ line
+ comment_start = true
+ comment << $1
+ comment << "\n"
+ elsif /^\s*?$/i =~ line
+ comment_end = true if comment_start && COMMENTS_ARE_UPPER
+ else
+ comment_end = true
+ not_comment << line
+ not_comment << "\n"
+ end
+ }
+ return comment, not_comment
+ end
+
+
+ # Return comments of definitions of arguments
+ #
+ # If "all" argument is true, information of all arguments are returned.
+ # If "modified_params" is true, list of arguments are decorated,
+ # for example, optional arguments are parenthetic as "[arg]".
+ #
+ def find_arguments(args, text, all=nil, indent=nil, modified_params=nil)
+ return unless args || all
+ indent = "" unless indent
+ args = ["all"] if all
+ params = "" if modified_params
+ comma = ""
+ return unless text
+ args_rdocforms = "\n"
+ remaining_lines = "#{text}"
+ definitions = definition_info(remaining_lines)
+ args.each{ |arg|
+ arg.strip!
+ arg.chomp!
+ definitions.each { |defitem|
+ if arg == defitem.varname.strip.chomp || all
+ args_rdocforms << <<-"EOF"
+
+#{indent}<tt><b>#{defitem.varname.chomp.strip}#{defitem.arraysuffix}</b> #{defitem.inivalue}</tt> ::
+#{indent} <tt>#{defitem.types.chomp.strip}</tt>
+EOF
+ if !defitem.comment.chomp.strip.empty?
+ comment = ""
+ defitem.comment.split("\n").each{ |line|
+ comment << " " + line + "\n"
+ }
+ args_rdocforms << <<-"EOF"
+
+#{indent} <tt></tt> ::
+#{indent} <tt></tt>
+#{indent} #{comment.chomp.strip}
+EOF
+ end
+
+ if modified_params
+ if defitem.include_attr?("optional")
+ params << "#{comma}[#{arg}]"
+ else
+ params << "#{comma}#{arg}"
+ end
+ comma = ", "
+ end
+ end
+ }
+ }
+ if modified_params
+ return args_rdocforms, params
+ else
+ return args_rdocforms
+ end
+ end
+
+ # Return comments of definitions of namelists
+ #
+ def find_namelists(text, before_contains=nil)
+ return nil if !text
+ result = ""
+ lines = "#{text}"
+ before_contains = "" if !before_contains
+ while lines =~ /^\s*?namelist\s+\/\s*?(\w+)\s*?\/([\s\w\,]+)$/i
+ lines = $~.post_match
+ nml_comment = COMMENTS_ARE_UPPER ?
+ find_comments($~.pre_match) : find_comments($~.post_match)
+ nml_name = $1
+ nml_args = $2.split(",")
+ result << "\n\n=== NAMELIST <tt><b>" + nml_name + "</tt></b>\n\n"
+ result << nml_comment + "\n" if nml_comment
+ if lines.split("\n")[0] =~ /^\//i
+ lines = "namelist " + lines
+ end
+ result << find_arguments(nml_args, "#{text}" + "\n" + before_contains)
+ end
+ return result
+ end
+
+ #
+ # Comments just after module or subprogram, or arguments are
+ # returned. If "COMMENTS_ARE_UPPER" is true, comments just before
+ # modules or subprograms are returned
+ #
+ def find_comments text
+ return "" unless text
+ lines = text.split("\n")
+ lines.reverse! if COMMENTS_ARE_UPPER
+ comment_block = Array.new
+ lines.each do |line|
+ break if line =~ /^\s*?\w/ || line =~ /^\s*?$/
+ if COMMENTS_ARE_UPPER
+ comment_block.unshift line.sub(/^\s*?!\s?/,"")
+ else
+ comment_block.push line.sub(/^\s*?!\s?/,"")
+ end
+ end
+ nice_lines = comment_block.join("\n").split "\n\s*?\n"
+ nice_lines[0] ||= ""
+ nice_lines.shift
+ end
+
+ def progress(char)
+ unless @options.quiet
+ @progress.print(char)
+ @progress.flush
+ end
+ end
+
+ #
+ # Create method for internal alias
+ #
+ def initialize_public_method(method, parent)
+ return if !method || !parent
+
+ new_meth = AnyMethod.new("External Alias for module", method.name)
+ new_meth.singleton = method.singleton
+ new_meth.params = method.params.clone
+ new_meth.comment = remove_trailing_alias(method.comment.clone)
+ new_meth.comment << "\n\n#{EXTERNAL_ALIAS_MES} #{parent.strip.chomp}\##{method.name}"
+
+ return new_meth
+ end
+
+ #
+ # Create method for external alias
+ #
+ # If argument "internal" is true, file is ignored.
+ #
+ def initialize_external_method(new, old, params, file, comment, token=nil,
+ internal=nil, nolink=nil)
+ return nil unless new || old
+
+ if internal
+ external_alias_header = "#{INTERNAL_ALIAS_MES} "
+ external_alias_text = external_alias_header + old
+ elsif file
+ external_alias_header = "#{EXTERNAL_ALIAS_MES} "
+ external_alias_text = external_alias_header + file + "#" + old
+ else
+ return nil
+ end
+ external_meth = AnyMethod.new(external_alias_text, new)
+ external_meth.singleton = false
+ external_meth.params = params
+ external_comment = remove_trailing_alias(comment) + "\n\n" if comment
+ external_meth.comment = external_comment || ""
+ if nolink && token
+ external_meth.start_collecting_tokens
+ external_meth.add_token Token.new(1,1).set_text(token)
+ else
+ external_meth.comment << external_alias_text
+ end
+
+ return external_meth
+ end
+
+
+
+ #
+ # Parse visibility
+ #
+ def parse_visibility(code, default, container)
+ result = []
+ visibility_default = default || :public
+
+ used_modules = []
+ container.includes.each{|i| used_modules << i.name} if container
+
+ remaining_code = code.gsub(/^\s*?type[\s\,]+.*?\s+end\s+type.*?$/im, "")
+ remaining_code.split("\n").each{ |line|
+ if /^\s*?private\s*?$/ =~ line
+ visibility_default = :private
+ break
+ end
+ } if remaining_code
+
+ remaining_code.split("\n").each{ |line|
+ if /^\s*?private\s*?(::)?\s+(.*)\s*?(!.*?)?/i =~ line
+ methods = $2.sub(/!.*$/, '')
+ methods.split(",").each{ |meth|
+ meth.sub!(/!.*$/, '')
+ meth.gsub!(/:/, '')
+ result << {
+ "name" => meth.chomp.strip,
+ "visibility" => :private,
+ "used_modules" => used_modules.clone,
+ "file_or_module" => container,
+ "entity_is_discovered" => nil,
+ "local_name" => nil
+ }
+ }
+ elsif /^\s*?public\s*?(::)?\s+(.*)\s*?(!.*?)?/i =~ line
+ methods = $2.sub(/!.*$/, '')
+ methods.split(",").each{ |meth|
+ meth.sub!(/!.*$/, '')
+ meth.gsub!(/:/, '')
+ result << {
+ "name" => meth.chomp.strip,
+ "visibility" => :public,
+ "used_modules" => used_modules.clone,
+ "file_or_module" => container,
+ "entity_is_discovered" => nil,
+ "local_name" => nil
+ }
+ }
+ end
+ } if remaining_code
+
+ if container
+ result.each{ |vis_info|
+ vis_info["parent"] = container.name
+ }
+ end
+
+ return visibility_default, result
+ end
+
+ #
+ # Set visibility
+ #
+ # "subname" element of "visibility_info" is deleted.
+ #
+ def set_visibility(container, subname, visibility_default, visibility_info)
+ return unless container || subname || visibility_default || visibility_info
+ not_found = true
+ visibility_info.collect!{ |info|
+ if info["name"] == subname ||
+ @options.ignore_case && info["name"].upcase == subname.upcase
+ if info["file_or_module"].name == container.name
+ container.set_visibility_for([subname], info["visibility"])
+ info["entity_is_discovered"] = true
+ not_found = false
+ end
+ end
+ info
+ }
+ if not_found
+ return container.set_visibility_for([subname], visibility_default)
+ else
+ return container
+ end
+ end
+
+ #
+ # Find visibility
+ #
+ def find_visibility(container, subname, visibility_info)
+ return nil if !subname || !visibility_info
+ visibility_info.each{ |info|
+ if info["name"] == subname ||
+ @options.ignore_case && info["name"].upcase == subname.upcase
+ if info["parent"] == container.name
+ return info["visibility"]
+ end
+ end
+ }
+ return nil
+ end
+
+ #
+ # Check external aliases
+ #
+ def check_external_aliases(subname, params, comment, test=nil)
+ @@external_aliases.each{ |alias_item|
+ if subname == alias_item["old_name"] ||
+ subname.upcase == alias_item["old_name"].upcase &&
+ @options.ignore_case
+
+ new_meth = initialize_external_method(alias_item["new_name"],
+ subname, params, @file_name,
+ comment)
+ new_meth.visibility = alias_item["visibility"]
+
+ progress "e"
+ @stats.num_methods += 1
+ alias_item["file_or_module"].add_method(new_meth)
+
+ if !alias_item["file_or_module"].include_requires?(@file_name, @options.ignore_case)
+ alias_item["file_or_module"].add_require(Require.new(@file_name, ""))
+ end
+ end
+ }
+ end
+
+ #
+ # Check public_methods
+ #
+ def check_public_methods(method, parent)
+ return if !method || !parent
+ @@public_methods.each{ |alias_item|
+ parent_is_used_module = nil
+ alias_item["used_modules"].each{ |used_module|
+ if used_module == parent ||
+ used_module.upcase == parent.upcase &&
+ @options.ignore_case
+ parent_is_used_module = true
+ end
+ }
+ next if !parent_is_used_module
+
+ if method.name == alias_item["name"] ||
+ method.name.upcase == alias_item["name"].upcase &&
+ @options.ignore_case
+
+ new_meth = initialize_public_method(method, parent)
+ if alias_item["local_name"]
+ new_meth.name = alias_item["local_name"]
+ end
+
+ progress "e"
+ @stats.num_methods += 1
+ alias_item["file_or_module"].add_method new_meth
+ end
+ }
+ end
+
+ #
+ # Continuous lines are united.
+ #
+ # Comments in continuous lines are removed.
+ #
+ def united_to_one_line(f90src)
+ return "" unless f90src
+ lines = f90src.split("\n")
+ previous_continuing = false
+ now_continuing = false
+ body = ""
+ lines.each{ |line|
+ words = line.split("")
+ next if words.empty? && previous_continuing
+ commentout = false
+ brank_flag = true ; brank_char = ""
+ squote = false ; dquote = false
+ ignore = false
+ words.collect! { |char|
+ if previous_continuing && brank_flag
+ now_continuing = true
+ ignore = true
+ case char
+ when "!" ; break
+ when " " ; brank_char << char ; next ""
+ when "&"
+ brank_flag = false
+ now_continuing = false
+ next ""
+ else
+ brank_flag = false
+ now_continuing = false
+ ignore = false
+ next brank_char + char
+ end
+ end
+ ignore = false
+
+ if now_continuing
+ next ""
+ elsif !(squote) && !(dquote) && !(commentout)
+ case char
+ when "!" ; commentout = true ; next char
+ when "\""; dquote = true ; next char
+ when "\'"; squote = true ; next char
+ when "&" ; now_continuing = true ; next ""
+ else next char
+ end
+ elsif commentout
+ next char
+ elsif squote
+ case char
+ when "\'"; squote = false ; next char
+ else next char
+ end
+ elsif dquote
+ case char
+ when "\""; dquote = false ; next char
+ else next char
+ end
+ end
+ }
+ if !ignore && !previous_continuing || !brank_flag
+ if previous_continuing
+ body << words.join("")
+ else
+ body << "\n" + words.join("")
+ end
+ end
+ previous_continuing = now_continuing ? true : nil
+ now_continuing = nil
+ }
+ return body
+ end
+
+
+ #
+ # Continuous line checker
+ #
+ def continuous_line?(line)
+ continuous = false
+ if /&\s*?(!.*)?$/ =~ line
+ continuous = true
+ if comment_out?($~.pre_match)
+ continuous = false
+ end
+ end
+ return continuous
+ end
+
+ #
+ # Comment out checker
+ #
+ def comment_out?(line)
+ return nil unless line
+ commentout = false
+ squote = false ; dquote = false
+ line.split("").each { |char|
+ if !(squote) && !(dquote)
+ case char
+ when "!" ; commentout = true ; break
+ when "\""; dquote = true
+ when "\'"; squote = true
+ else next
+ end
+ elsif squote
+ case char
+ when "\'"; squote = false
+ else next
+ end
+ elsif dquote
+ case char
+ when "\""; dquote = false
+ else next
+ end
+ end
+ }
+ return commentout
+ end
+
+ #
+ # Semicolons are replaced to line feed.
+ #
+ def semicolon_to_linefeed(text)
+ return "" unless text
+ lines = text.split("\n")
+ lines.collect!{ |line|
+ words = line.split("")
+ commentout = false
+ squote = false ; dquote = false
+ words.collect! { |char|
+ if !(squote) && !(dquote) && !(commentout)
+ case char
+ when "!" ; commentout = true ; next char
+ when "\""; dquote = true ; next char
+ when "\'"; squote = true ; next char
+ when ";" ; "\n"
+ else next char
+ end
+ elsif commentout
+ next char
+ elsif squote
+ case char
+ when "\'"; squote = false ; next char
+ else next char
+ end
+ elsif dquote
+ case char
+ when "\""; dquote = false ; next char
+ else next char
+ end
+ end
+ }
+ words.join("")
+ }
+ return lines.join("\n")
+ end
+
+ #
+ # Which "line" is start of block (module, program, block data,
+ # subroutine, function) statement ?
+ #
+ def block_start?(line)
+ return nil if !line
+
+ if line =~ /^\s*?module\s+(\w+)\s*?(!.*?)?$/i ||
+ line =~ /^\s*?program\s+(\w+)\s*?(!.*?)?$/i ||
+ line =~ /^\s*?block\s+data(\s+\w+)?\s*?(!.*?)?$/i ||
+ line =~ \
+ /^\s*?
+ (recursive|pure|elemental)?\s*?
+ subroutine\s+(\w+)\s*?(\(.*?\))?\s*?(!.*?)?$
+ /ix ||
+ line =~ \
+ /^\s*?
+ (recursive|pure|elemental)?\s*?
+ (
+ character\s*?(\([\w\s\=\(\)\*]+?\))?\s+
+ | type\s*?\([\w\s]+?\)\s+
+ | integer\s*?(\([\w\s\=\(\)\*]+?\))?\s+
+ | real\s*?(\([\w\s\=\(\)\*]+?\))?\s+
+ | double\s+precision\s+
+ | logical\s*?(\([\w\s\=\(\)\*]+?\))?\s+
+ | complex\s*?(\([\w\s\=\(\)\*]+?\))?\s+
+ )?
+ function\s+(\w+)\s*?
+ (\(.*?\))?(\s+result\((.*?)\))?\s*?(!.*?)?$
+ /ix
+ return true
+ end
+
+ return nil
+ end
+
+ #
+ # Which "line" is end of block (module, program, block data,
+ # subroutine, function) statement ?
+ #
+ def block_end?(line)
+ return nil if !line
+
+ if line =~ /^\s*?end\s*?(!.*?)?$/i ||
+ line =~ /^\s*?end\s+module(\s+\w+)?\s*?(!.*?)?$/i ||
+ line =~ /^\s*?end\s+program(\s+\w+)?\s*?(!.*?)?$/i ||
+ line =~ /^\s*?end\s+block\s+data(\s+\w+)?\s*?(!.*?)?$/i ||
+ line =~ /^\s*?end\s+subroutine(\s+\w+)?\s*?(!.*?)?$/i ||
+ line =~ /^\s*?end\s+function(\s+\w+)?\s*?(!.*?)?$/i
+ return true
+ end
+
+ return nil
+ end
+
+ #
+ # Remove "Alias for" in end of comments
+ #
+ def remove_trailing_alias(text)
+ return "" if !text
+ lines = text.split("\n").reverse
+ comment_block = Array.new
+ checked = false
+ lines.each do |line|
+ if !checked
+ if /^\s?#{INTERNAL_ALIAS_MES}/ =~ line ||
+ /^\s?#{EXTERNAL_ALIAS_MES}/ =~ line
+ checked = true
+ next
+ end
+ end
+ comment_block.unshift line
+ end
+ nice_lines = comment_block.join("\n")
+ nice_lines ||= ""
+ return nice_lines
+ end
+
+ # Empty lines in header are removed
+ def remove_empty_head_lines(text)
+ return "" unless text
+ lines = text.split("\n")
+ header = true
+ lines.delete_if{ |line|
+ header = false if /\S/ =~ line
+ header && /^\s*?$/ =~ line
+ }
+ lines.join("\n")
+ end
+
+
+ # header marker "=", "==", ... are removed
+ def remove_header_marker(text)
+ return text.gsub(/^\s?(=+)/, '<tt></tt>\1')
+ end
+
+ def remove_private_comments(body)
+ body.gsub!(/^\s*!--\s*?$.*?^\s*!\+\+\s*?$/m, '')
+ return body
+ end
+
+
+ #
+ # Information of arguments of subroutines and functions in Fortran95
+ #
+ class Fortran95Definition
+
+ # Name of variable
+ #
+ attr_reader :varname
+
+ # Types of variable
+ #
+ attr_reader :types
+
+ # Initial Value
+ #
+ attr_reader :inivalue
+
+ # Suffix of array
+ #
+ attr_reader :arraysuffix
+
+ # Comments
+ #
+ attr_accessor :comment
+
+ # Flag of non documentation
+ #
+ attr_accessor :nodoc
+
+ def initialize(varname, types, inivalue, arraysuffix, comment,
+ nodoc=false)
+ @varname = varname
+ @types = types
+ @inivalue = inivalue
+ @arraysuffix = arraysuffix
+ @comment = comment
+ @nodoc = nodoc
+ end
+
+ def to_s
+ return <<-EOF
+<Fortran95Definition:
+ varname=#{@varname}, types=#{types},
+ inivalue=#{@inivalue}, arraysuffix=#{@arraysuffix}, nodoc=#{@nodoc},
+ comment=
+#{@comment}
+>
+EOF
+ end
+
+ #
+ # If attr is included, true is returned
+ #
+ def include_attr?(attr)
+ return if !attr
+ @types.split(",").each{ |type|
+ return true if type.strip.chomp.upcase == attr.strip.chomp.upcase
+ }
+ return nil
+ end
+
+ end # End of Fortran95Definition
+
+ #
+ # Parse string argument "text", and Return Array of
+ # Fortran95Definition object
+ #
+ def definition_info(text)
+ return nil unless text
+ lines = "#{text}"
+ defs = Array.new
+ comment = ""
+ trailing_comment = ""
+ under_comment_valid = false
+ lines.split("\n").each{ |line|
+ if /^\s*?!\s?(.*)/ =~ line
+ if COMMENTS_ARE_UPPER
+ comment << remove_header_marker($1)
+ comment << "\n"
+ elsif defs[-1] && under_comment_valid
+ defs[-1].comment << "\n"
+ defs[-1].comment << remove_header_marker($1)
+ end
+ next
+ elsif /^\s*?$/ =~ line
+ comment = ""
+ under_comment_valid = false
+ next
+ end
+ type = ""
+ characters = ""
+ if line =~ /^\s*?
+ (
+ character\s*?(\([\w\s\=\(\)\*]+?\))?[\s\,]*
+ | type\s*?\([\w\s]+?\)[\s\,]*
+ | integer\s*?(\([\w\s\=\(\)\*]+?\))?[\s\,]*
+ | real\s*?(\([\w\s\=\(\)\*]+?\))?[\s\,]*
+ | double\s+precision[\s\,]*
+ | logical\s*?(\([\w\s\=\(\)\*]+?\))?[\s\,]*
+ | complex\s*?(\([\w\s\=\(\)\*]+?\))?[\s\,]*
+ )
+ (.*?::)?
+ (.+)$
+ /ix
+ characters = $8
+ type = $1
+ type << $7.gsub(/::/, '').gsub(/^\s*?\,/, '') if $7
+ else
+ under_comment_valid = false
+ next
+ end
+ squote = false ; dquote = false ; bracket = 0
+ iniflag = false; commentflag = false
+ varname = "" ; arraysuffix = "" ; inivalue = ""
+ start_pos = defs.size
+ characters.split("").each { |char|
+ if !(squote) && !(dquote) && bracket <= 0 && !(iniflag) && !(commentflag)
+ case char
+ when "!" ; commentflag = true
+ when "(" ; bracket += 1 ; arraysuffix = char
+ when "\""; dquote = true
+ when "\'"; squote = true
+ when "=" ; iniflag = true ; inivalue << char
+ when ","
+ defs << Fortran95Definition.new(varname, type, inivalue, arraysuffix, comment)
+ varname = "" ; arraysuffix = "" ; inivalue = ""
+ under_comment_valid = true
+ when " " ; next
+ else ; varname << char
+ end
+ elsif commentflag
+ comment << remove_header_marker(char)
+ trailing_comment << remove_header_marker(char)
+ elsif iniflag
+ if dquote
+ case char
+ when "\"" ; dquote = false ; inivalue << char
+ else ; inivalue << char
+ end
+ elsif squote
+ case char
+ when "\'" ; squote = false ; inivalue << char
+ else ; inivalue << char
+ end
+ elsif bracket > 0
+ case char
+ when "(" ; bracket += 1 ; inivalue << char
+ when ")" ; bracket -= 1 ; inivalue << char
+ else ; inivalue << char
+ end
+ else
+ case char
+ when ","
+ defs << Fortran95Definition.new(varname, type, inivalue, arraysuffix, comment)
+ varname = "" ; arraysuffix = "" ; inivalue = ""
+ iniflag = false
+ under_comment_valid = true
+ when "(" ; bracket += 1 ; inivalue << char
+ when "\""; dquote = true ; inivalue << char
+ when "\'"; squote = true ; inivalue << char
+ when "!" ; commentflag = true
+ else ; inivalue << char
+ end
+ end
+ elsif !(squote) && !(dquote) && bracket > 0
+ case char
+ when "(" ; bracket += 1 ; arraysuffix << char
+ when ")" ; bracket -= 1 ; arraysuffix << char
+ else ; arraysuffix << char
+ end
+ elsif squote
+ case char
+ when "\'"; squote = false ; inivalue << char
+ else ; inivalue << char
+ end
+ elsif dquote
+ case char
+ when "\""; dquote = false ; inivalue << char
+ else ; inivalue << char
+ end
+ end
+ }
+ defs << Fortran95Definition.new(varname, type, inivalue, arraysuffix, comment)
+ if trailing_comment =~ /^:nodoc:/
+ defs[start_pos..-1].collect!{ |defitem|
+ defitem.nodoc = true
+ }
+ end
+ varname = "" ; arraysuffix = "" ; inivalue = ""
+ comment = ""
+ under_comment_valid = true
+ trailing_comment = ""
+ }
+ return defs
+ end
+
+
+ end # class Fortran95parser
+
+end # module RDoc
diff --git a/lib/rdoc/parsers/parse_rb.rb b/lib/rdoc/parsers/parse_rb.rb
new file mode 100644
index 0000000000..750c483c15
--- /dev/null
+++ b/lib/rdoc/parsers/parse_rb.rb
@@ -0,0 +1,2609 @@
+#!/usr/local/bin/ruby
+
+# Parse a Ruby source file, building a set of objects
+# representing the modules, classes, methods,
+# requires, and includes we find (these classes
+# are defined in code_objects.rb).
+
+# This file contains stuff stolen outright from:
+#
+# rtags.rb -
+# ruby-lex.rb - ruby lexcal analizer
+# ruby-token.rb - ruby tokens
+# by Keiju ISHITSUKA (Nippon Rational Inc.)
+#
+
+require "e2mmap"
+require "irb/slex"
+
+require "rdoc/code_objects"
+require "rdoc/tokenstream"
+
+require "rdoc/markup/simple_markup/preprocess"
+
+require "rdoc/parsers/parserfactory"
+
+$TOKEN_DEBUG = $DEBUG
+
+# Definitions of all tokens involved in the lexical analysis
+
+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
+ NO_TEXT = "??".freeze
+ attr :text
+
+ def initialize(line_no, char_no)
+ @line_no = line_no
+ @char_no = char_no
+ @text = NO_TEXT
+ end
+
+ # Because we're used in contexts that expect to return a token,
+ # we set the text string and then return ourselves
+ def set_text(text)
+ @text = text
+ self
+ end
+
+ attr_reader :line_no, :char_no, :text
+ end
+
+ class TkNode < Token
+ attr :node
+ end
+
+ class TkId < Token
+ def initialize(line_no, char_no, name)
+ super(line_no, char_no)
+ @name = name
+ end
+ attr :name
+ end
+
+ class TkKW < TkId
+ end
+
+ class TkVal < Token
+ def initialize(line_no, char_no, value = nil)
+ super(line_no, char_no)
+ set_text(value)
+ end
+ end
+
+ class TkOp < Token
+ def name
+ self.class.op_name
+ end
+ end
+
+ class TkOPASGN < TkOp
+ def initialize(line_no, char_no, op)
+ super(line_no, char_no)
+ op = TkReading2Token[op] unless op.kind_of?(Symbol)
+ @op = op
+ end
+ attr :op
+ end
+
+ class TkUnknownChar < Token
+ def initialize(line_no, char_no, id)
+ super(line_no, char_no)
+ @name = char_no.chr
+ end
+ attr :name
+ end
+
+ class TkError < Token
+ end
+
+ def set_token_position(line, char)
+ @prev_line_no = line
+ @prev_char_no = char
+ end
+
+ def Token(token, value = nil)
+ tk = nil
+ case token
+ when String, Symbol
+ source = token.kind_of?(String) ? TkReading2Token : TkSymbol2Token
+ if (tk = source[token]).nil?
+ IRB.fail TkReading2TokenNoKey, token
+ end
+ tk = Token(tk[0], value)
+ else
+ tk = if (token.ancestors & [TkId, TkVal, TkOPASGN, TkUnknownChar]).empty?
+ token.new(@prev_line_no, @prev_char_no)
+ else
+ token.new(@prev_line_no, @prev_char_no, value)
+ end
+ end
+ tk
+ end
+
+ TokenDefinitions = [
+ [:TkCLASS, TkKW, "class", EXPR_CLASS],
+ [:TkMODULE, TkKW, "module", EXPR_BEG],
+ [:TkDEF, TkKW, "def", EXPR_FNAME],
+ [:TkUNDEF, TkKW, "undef", EXPR_FNAME],
+ [:TkBEGIN, TkKW, "begin", EXPR_BEG],
+ [:TkRESCUE, TkKW, "rescue", EXPR_MID],
+ [:TkENSURE, TkKW, "ensure", EXPR_BEG],
+ [:TkEND, TkKW, "end", EXPR_END],
+ [:TkIF, TkKW, "if", EXPR_BEG, :TkIF_MOD],
+ [:TkUNLESS, TkKW, "unless", EXPR_BEG, :TkUNLESS_MOD],
+ [:TkTHEN, TkKW, "then", EXPR_BEG],
+ [:TkELSIF, TkKW, "elsif", EXPR_BEG],
+ [:TkELSE, TkKW, "else", EXPR_BEG],
+ [:TkCASE, TkKW, "case", EXPR_BEG],
+ [:TkWHEN, TkKW, "when", EXPR_BEG],
+ [:TkWHILE, TkKW, "while", EXPR_BEG, :TkWHILE_MOD],
+ [:TkUNTIL, TkKW, "until", EXPR_BEG, :TkUNTIL_MOD],
+ [:TkFOR, TkKW, "for", EXPR_BEG],
+ [:TkBREAK, TkKW, "break", EXPR_END],
+ [:TkNEXT, TkKW, "next", EXPR_END],
+ [:TkREDO, TkKW, "redo", EXPR_END],
+ [:TkRETRY, TkKW, "retry", EXPR_END],
+ [:TkIN, TkKW, "in", EXPR_BEG],
+ [:TkDO, TkKW, "do", EXPR_BEG],
+ [:TkRETURN, TkKW, "return", EXPR_MID],
+ [:TkYIELD, TkKW, "yield", EXPR_END],
+ [:TkSUPER, TkKW, "super", EXPR_END],
+ [:TkSELF, TkKW, "self", EXPR_END],
+ [:TkNIL, TkKW, "nil", EXPR_END],
+ [:TkTRUE, TkKW, "true", EXPR_END],
+ [:TkFALSE, TkKW, "false", EXPR_END],
+ [:TkAND, TkKW, "and", EXPR_BEG],
+ [:TkOR, TkKW, "or", EXPR_BEG],
+ [:TkNOT, TkKW, "not", EXPR_BEG],
+ [:TkIF_MOD, TkKW],
+ [:TkUNLESS_MOD, TkKW],
+ [:TkWHILE_MOD, TkKW],
+ [:TkUNTIL_MOD, TkKW],
+ [:TkALIAS, TkKW, "alias", EXPR_FNAME],
+ [:TkDEFINED, TkKW, "defined?", EXPR_END],
+ [:TklBEGIN, TkKW, "BEGIN", EXPR_END],
+ [:TklEND, TkKW, "END", EXPR_END],
+ [:Tk__LINE__, TkKW, "__LINE__", EXPR_END],
+ [:Tk__FILE__, TkKW, "__FILE__", EXPR_END],
+
+ [:TkIDENTIFIER, TkId],
+ [:TkFID, TkId],
+ [:TkGVAR, TkId],
+ [:TkIVAR, TkId],
+ [:TkCONSTANT, TkId],
+
+ [:TkINTEGER, TkVal],
+ [:TkFLOAT, TkVal],
+ [:TkSTRING, TkVal],
+ [:TkXSTRING, TkVal],
+ [:TkREGEXP, TkVal],
+ [:TkCOMMENT, TkVal],
+
+ [:TkDSTRING, TkNode],
+ [:TkDXSTRING, TkNode],
+ [:TkDREGEXP, TkNode],
+ [:TkNTH_REF, TkId],
+ [:TkBACK_REF, TkId],
+
+ [:TkUPLUS, TkOp, "+@"],
+ [:TkUMINUS, TkOp, "-@"],
+ [:TkPOW, TkOp, "**"],
+ [:TkCMP, TkOp, "<=>"],
+ [:TkEQ, TkOp, "=="],
+ [:TkEQQ, TkOp, "==="],
+ [:TkNEQ, TkOp, "!="],
+ [:TkGEQ, TkOp, ">="],
+ [:TkLEQ, TkOp, "<="],
+ [:TkANDOP, TkOp, "&&"],
+ [:TkOROP, TkOp, "||"],
+ [:TkMATCH, TkOp, "=~"],
+ [:TkNMATCH, TkOp, "!~"],
+ [:TkDOT2, TkOp, ".."],
+ [:TkDOT3, TkOp, "..."],
+ [:TkAREF, TkOp, "[]"],
+ [:TkASET, TkOp, "[]="],
+ [:TkLSHFT, TkOp, "<<"],
+ [:TkRSHFT, TkOp, ">>"],
+ [:TkCOLON2, TkOp],
+ [:TkCOLON3, TkOp],
+# [:OPASGN, TkOp], # +=, -= etc. #
+ [:TkASSOC, TkOp, "=>"],
+ [:TkQUESTION, TkOp, "?"], #?
+ [:TkCOLON, TkOp, ":"], #:
+
+ [:TkfLPAREN], # func( #
+ [:TkfLBRACK], # func[ #
+ [:TkfLBRACE], # func{ #
+ [:TkSTAR], # *arg
+ [:TkAMPER], # &arg #
+ [:TkSYMBOL, TkId], # :SYMBOL
+ [:TkSYMBEG, TkId],
+ [: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, ";"],
+
+ [: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 unless token_n.kind_of?(String)
+ if RubyToken.const_defined?(token_n)
+ IRB.fail AlreadyDefinedToken, token_n
+ end
+
+ token_c = Class.new super_token
+ RubyToken.const_set token_n, token_c
+# token_c.inspect
+
+ 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
+
+ if token_c <= TkOp
+ token_c.class_eval %{
+ def self.op_name; "#{reading}"; end
+ }
+ end
+ end
+
+ for defs in TokenDefinitions
+ def_token(*defs)
+ end
+
+ NEWLINE_TOKEN = TkNL.new(0,0)
+ NEWLINE_TOKEN.set_text("\n")
+
+end
+
+
+
+# Lexical analyzer for Ruby source
+
+class RubyLex
+
+ ######################################################################
+ #
+ # Read an input stream character by character. We allow for unlimited
+ # ungetting of characters just read.
+ #
+ # We simplify the implementation greatly by reading the entire input
+ # into a buffer initially, and then simply traversing it using
+ # pointers.
+ #
+ # We also have to allow for the <i>here document diversion</i>. This
+ # little gem comes about when the lexer encounters a here
+ # document. At this point we effectively need to split the input
+ # stream into two parts: one to read the body of the here document,
+ # the other to read the rest of the input line where the here
+ # document was initially encountered. For example, we might have
+ #
+ # do_something(<<-A, <<-B)
+ # stuff
+ # for
+ # A
+ # stuff
+ # for
+ # B
+ #
+ # When the lexer encounters the <<A, it reads until the end of the
+ # line, and keeps it around for later. It then reads the body of the
+ # here document. Once complete, it needs to read the rest of the
+ # original line, but then skip the here document body.
+ #
+
+ class BufferedReader
+
+ attr_reader :line_num
+
+ def initialize(content)
+ if /\t/ =~ content
+ tab_width = Options.instance.tab_width
+ content = content.split(/\n/).map do |line|
+ 1 while line.gsub!(/\t+/) { ' ' * (tab_width*$&.length - $`.length % tab_width)} && $~ #`
+ line
+ end .join("\n")
+ end
+ @content = content
+ @content << "\n" unless @content[-1,1] == "\n"
+ @size = @content.size
+ @offset = 0
+ @hwm = 0
+ @line_num = 1
+ @read_back_offset = 0
+ @last_newline = 0
+ @newline_pending = false
+ end
+
+ def column
+ @offset - @last_newline
+ end
+
+ def getc
+ return nil if @offset >= @size
+ ch = @content[@offset, 1]
+
+ @offset += 1
+ @hwm = @offset if @hwm < @offset
+
+ if @newline_pending
+ @line_num += 1
+ @last_newline = @offset - 1
+ @newline_pending = false
+ end
+
+ if ch == "\n"
+ @newline_pending = true
+ end
+ ch
+ end
+
+ def getc_already_read
+ getc
+ end
+
+ def ungetc(ch)
+ raise "unget past beginning of file" if @offset <= 0
+ @offset -= 1
+ if @content[@offset] == ?\n
+ @newline_pending = false
+ end
+ end
+
+ def get_read
+ res = @content[@read_back_offset...@offset]
+ @read_back_offset = @offset
+ res
+ end
+
+ def peek(at)
+ pos = @offset + at
+ if pos >= @size
+ nil
+ else
+ @content[pos, 1]
+ end
+ end
+
+ def peek_equal(str)
+ @content[@offset, str.length] == str
+ end
+
+ def divert_read_from(reserve)
+ @content[@offset, 0] = reserve
+ @size = @content.size
+ end
+ end
+
+ # end of nested class BufferedReader
+
+ 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")
+
+ include RubyToken
+ include IRB
+
+ attr_reader :continue
+ attr_reader :lex_state
+
+ def RubyLex.debug?
+ false
+ end
+
+ def initialize(content)
+ lex_init
+
+ @reader = BufferedReader.new(content)
+
+ @exp_line_no = @line_no = 1
+ @base_char_no = 0
+ @indent = 0
+
+ @ltype = nil
+ @quoted = nil
+ @lex_state = EXPR_BEG
+ @space_seen = false
+
+ @continue = false
+ @line = ""
+
+ @skip_space = false
+ @read_auto_clean_up = false
+ @exception_on_syntax_error = true
+ end
+
+ attr :skip_space, true
+ attr :read_auto_clean_up, true
+ attr :exception_on_syntax_error, true
+
+ attr :indent
+
+ # io functions
+ def line_no
+ @reader.line_num
+ end
+
+ def char_no
+ @reader.column
+ end
+
+ def get_read
+ @reader.get_read
+ end
+
+ def getc
+ @reader.getc
+ end
+
+ def getc_of_rests
+ @reader.getc_already_read
+ end
+
+ def gets
+ c = getc or return
+ l = ""
+ begin
+ l.concat c unless c == "\r"
+ break if c == "\n"
+ end while c = getc
+ l
+ end
+
+
+ def ungetc(c = nil)
+ @reader.ungetc(c)
+ end
+
+ def peek_equal?(str)
+ @reader.peek_equal(str)
+ end
+
+ def peek(i = 0)
+ @reader.peek(i)
+ end
+
+ def lex
+ until (((tk = token).kind_of?(TkNL) || tk.kind_of?(TkEND_OF_SCRIPT)) &&
+ !@continue or
+ tk.nil?)
+ end
+ line = get_read
+
+ if line == "" and tk.kind_of?(TkEND_OF_SCRIPT) || tk.nil?
+ nil
+ else
+ line
+ end
+ end
+
+ def token
+ set_token_position(line_no, char_no)
+ begin
+ begin
+ tk = @OP.match(self)
+ @space_seen = tk.kind_of?(TkSPACE)
+ rescue SyntaxError
+ abort if @exception_on_syntax_error
+ tk = TkError.new(line_no, char_no)
+ end
+ end while @skip_space and tk.kind_of?(TkSPACE)
+ if @read_auto_clean_up
+ get_read
+ end
+# throw :eof unless tk
+ p tk if $DEBUG
+ tk
+ end
+
+ ENINDENT_CLAUSE = [
+ "case", "class", "def", "do", "for", "if",
+ "module", "unless", "until", "while", "begin" #, "when"
+ ]
+ DEINDENT_CLAUSE = ["end" #, "when"
+ ]
+
+ PERCENT_LTYPE = {
+ "q" => "\'",
+ "Q" => "\"",
+ "x" => "\`",
+ "r" => "/",
+ "w" => "]"
+ }
+
+ PERCENT_PAREN = {
+ "{" => "}",
+ "[" => "]",
+ "<" => ">",
+ "(" => ")"
+ }
+
+ Ltype2Token = {
+ "\'" => TkSTRING,
+ "\"" => TkSTRING,
+ "\`" => TkXSTRING,
+ "/" => TkREGEXP,
+ "]" => TkDSTRING
+ }
+ Ltype2Token.default = TkSTRING
+
+ DLtype2Token = {
+ "\"" => TkDSTRING,
+ "\`" => TkDXSTRING,
+ "/" => TkDREGEXP,
+ }
+
+ def lex_init()
+ @OP = SLex.new
+ @OP.def_rules("\0", "\004", "\032") do |chars, io|
+ Token(TkEND_OF_SCRIPT).set_text(chars)
+ end
+
+ @OP.def_rules(" ", "\t", "\f", "\r", "\13") do |chars, io|
+ @space_seen = TRUE
+ while (ch = getc) =~ /[ \t\f\r\13]/
+ chars << ch
+ end
+ ungetc
+ Token(TkSPACE).set_text(chars)
+ end
+
+ @OP.def_rule("#") do
+ |op, io|
+ identify_comment
+ end
+
+ @OP.def_rule("=begin", proc{@prev_char_no == 0 && peek(0) =~ /\s/}) do
+ |op, io|
+ str = op
+ @ltype = "="
+
+
+ begin
+ line = ""
+ begin
+ ch = getc
+ line << ch
+ end until ch == "\n"
+ str << line
+ end until line =~ /^=end/
+
+ ungetc
+
+ @ltype = nil
+
+ if str =~ /\A=begin\s+rdoc/i
+ str.sub!(/\A=begin.*\n/, '')
+ str.sub!(/^=end.*/m, '')
+ Token(TkCOMMENT).set_text(str)
+ else
+ Token(TkRD_COMMENT)#.set_text(str)
+ end
+ end
+
+ @OP.def_rule("\n") do
+ print "\\n\n" if RubyLex.debug?
+ case @lex_state
+ when EXPR_BEG, EXPR_FNAME, EXPR_DOT
+ @continue = TRUE
+ else
+ @continue = FALSE
+ @lex_state = EXPR_BEG
+ end
+ Token(TkNL).set_text("\n")
+ end
+
+ @OP.def_rules("*", "**",
+ "!", "!=", "!~",
+ "=", "==", "===",
+ "=~", "<=>",
+ "<", "<=",
+ ">", ">=", ">>") do
+ |op, io|
+ @lex_state = EXPR_BEG
+ Token(op).set_text(op)
+ end
+
+ @OP.def_rules("<<") do
+ |op, io|
+ tk = nil
+ if @lex_state != EXPR_END && @lex_state != EXPR_CLASS &&
+ (@lex_state != EXPR_ARG || @space_seen)
+ c = peek(0)
+ if /[-\w_\"\'\`]/ =~ c
+ tk = identify_here_document
+ end
+ end
+ if !tk
+ @lex_state = EXPR_BEG
+ tk = Token(op).set_text(op)
+ end
+ tk
+ end
+
+ @OP.def_rules("'", '"') do
+ |op, io|
+ identify_string(op)
+ end
+
+ @OP.def_rules("`") do
+ |op, io|
+ if @lex_state == EXPR_FNAME
+ Token(op).set_text(op)
+ else
+ identify_string(op)
+ end
+ end
+
+ @OP.def_rules('?') do
+ |op, io|
+ if @lex_state == EXPR_END
+ @lex_state = EXPR_BEG
+ Token(TkQUESTION).set_text(op)
+ else
+ ch = getc
+ if @lex_state == EXPR_ARG && ch !~ /\s/
+ ungetc
+ @lex_state = EXPR_BEG;
+ Token(TkQUESTION).set_text(op)
+ else
+ str = op
+ str << ch
+ if (ch == '\\') #'
+ str << read_escape
+ end
+ @lex_state = EXPR_END
+ Token(TkINTEGER).set_text(str)
+ end
+ end
+ end
+
+ @OP.def_rules("&", "&&", "|", "||") do
+ |op, io|
+ @lex_state = EXPR_BEG
+ Token(op).set_text(op)
+ end
+
+ @OP.def_rules("+=", "-=", "*=", "**=",
+ "&=", "|=", "^=", "<<=", ">>=", "||=", "&&=") do
+ |op, io|
+ @lex_state = EXPR_BEG
+ op =~ /^(.*)=$/
+ Token(TkOPASGN, $1).set_text(op)
+ end
+
+ @OP.def_rule("+@", proc{@lex_state == EXPR_FNAME}) do |op, io|
+ Token(TkUPLUS).set_text(op)
+ end
+
+ @OP.def_rule("-@", proc{@lex_state == EXPR_FNAME}) do |op, io|
+ Token(TkUMINUS).set_text(op)
+ end
+
+ @OP.def_rules("+", "-") do
+ |op, io|
+ catch(:RET) do
+ if @lex_state == EXPR_ARG
+ if @space_seen and peek(0) =~ /[0-9]/
+ throw :RET, identify_number(op)
+ else
+ @lex_state = EXPR_BEG
+ end
+ elsif @lex_state != EXPR_END and peek(0) =~ /[0-9]/
+ throw :RET, identify_number(op)
+ else
+ @lex_state = EXPR_BEG
+ end
+ Token(op).set_text(op)
+ end
+ end
+
+ @OP.def_rule(".") do
+ @lex_state = EXPR_BEG
+ if peek(0) =~ /[0-9]/
+ ungetc
+ identify_number("")
+ else
+ # for obj.if
+ @lex_state = EXPR_DOT
+ Token(TkDOT).set_text(".")
+ end
+ end
+
+ @OP.def_rules("..", "...") do
+ |op, io|
+ @lex_state = EXPR_BEG
+ Token(op).set_text(op)
+ end
+
+ lex_int2
+ end
+
+ def lex_int2
+ @OP.def_rules("]", "}", ")") do
+ |op, io|
+ @lex_state = EXPR_END
+ @indent -= 1
+ Token(op).set_text(op)
+ end
+
+ @OP.def_rule(":") do
+ if @lex_state == EXPR_END || peek(0) =~ /\s/
+ @lex_state = EXPR_BEG
+ tk = Token(TkCOLON)
+ else
+ @lex_state = EXPR_FNAME;
+ tk = Token(TkSYMBEG)
+ end
+ tk.set_text(":")
+ end
+
+ @OP.def_rule("::") do
+# p @lex_state.id2name, @space_seen
+ if @lex_state == EXPR_BEG or @lex_state == EXPR_ARG && @space_seen
+ @lex_state = EXPR_BEG
+ tk = Token(TkCOLON3)
+ else
+ @lex_state = EXPR_DOT
+ tk = Token(TkCOLON2)
+ end
+ tk.set_text("::")
+ 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, :/).set_text("/=") #")
+ elsif @lex_state == EXPR_ARG and @space_seen and peek(0) !~ /\s/
+ identify_string(op)
+ else
+ @lex_state = EXPR_BEG
+ Token("/").set_text(op)
+ end
+ end
+
+ @OP.def_rules("^") do
+ @lex_state = EXPR_BEG
+ Token("^").set_text("^")
+ end
+
+ # @OP.def_rules("^=") do
+ # @lex_state = EXPR_BEG
+ # Token(TkOPASGN, :^)
+ # end
+
+ @OP.def_rules(",", ";") do
+ |op, io|
+ @lex_state = EXPR_BEG
+ Token(op).set_text(op)
+ end
+
+ @OP.def_rule("~") do
+ @lex_state = EXPR_BEG
+ Token("~").set_text("~")
+ end
+
+ @OP.def_rule("~@", proc{@lex_state = EXPR_FNAME}) do
+ @lex_state = EXPR_BEG
+ Token("~").set_text("~@")
+ end
+
+ @OP.def_rule("(") do
+ @indent += 1
+ if @lex_state == EXPR_BEG || @lex_state == EXPR_MID
+ @lex_state = EXPR_BEG
+ tk = Token(TkfLPAREN)
+ else
+ @lex_state = EXPR_BEG
+ tk = Token(TkLPAREN)
+ end
+ tk.set_text("(")
+ end
+
+ @OP.def_rule("[]", proc{@lex_state == EXPR_FNAME}) do
+ Token("[]").set_text("[]")
+ end
+
+ @OP.def_rule("[]=", proc{@lex_state == EXPR_FNAME}) do
+ Token("[]=").set_text("[]=")
+ end
+
+ @OP.def_rule("[") do
+ @indent += 1
+ if @lex_state == EXPR_FNAME
+ t = Token(TkfLBRACK)
+ else
+ if @lex_state == EXPR_BEG || @lex_state == EXPR_MID
+ t = Token(TkLBRACK)
+ elsif @lex_state == EXPR_ARG && @space_seen
+ t = Token(TkLBRACK)
+ else
+ t = Token(TkfLBRACK)
+ end
+ @lex_state = EXPR_BEG
+ end
+ t.set_text("[")
+ end
+
+ @OP.def_rule("{") do
+ @indent += 1
+ if @lex_state != EXPR_END && @lex_state != EXPR_ARG
+ t = Token(TkLBRACE)
+ else
+ t = Token(TkfLBRACE)
+ end
+ @lex_state = EXPR_BEG
+ t.set_text("{")
+ end
+
+ @OP.def_rule('\\') do #'
+ if getc == "\n"
+ @space_seen = true
+ @continue = true
+ Token(TkSPACE).set_text("\\\n")
+ else
+ ungetc
+ Token("\\").set_text("\\") #"
+ 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, "%").set_text("%=")
+ elsif @lex_state == EXPR_ARG and @space_seen and peek(0) !~ /\s/
+ identify_quotation('%')
+ else
+ @lex_state = EXPR_BEG
+ Token("%").set_text("%")
+ end
+ end
+
+ @OP.def_rule('$') do #'
+ identify_gvar
+ end
+
+ @OP.def_rule('@') do
+ if peek(0) =~ /[@\w_]/
+ ungetc
+ identify_identifier
+ else
+ Token("@").set_text("@")
+ end
+ end
+
+ # @OP.def_rule("def", proc{|op, io| /\s/ =~ io.peek(0)}) do
+ # |op, io|
+ # @indent += 1
+ # @lex_state = EXPR_FNAME
+ # # @lex_state = EXPR_END
+ # # until @rests[0] == "\n" or @rests[0] == ";"
+ # # rests.shift
+ # # end
+ # end
+
+ @OP.def_rule("__END__", proc{@prev_char_no == 0 && peek(0) =~ /[\r\n]/}) do
+ throw :eof
+ 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) =~ /[\w_]/
+ 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
+ str = "$"
+
+ tk = case ch = getc
+ when /[~_*$?!@\/\\;,=:<>".]/ #"
+ str << ch
+ Token(TkGVAR, str)
+
+ when "-"
+ str << "-" << getc
+ Token(TkGVAR, str)
+
+ when "&", "`", "'", "+"
+ str << ch
+ Token(TkBACK_REF, str)
+
+ when /[1-9]/
+ str << ch
+ while (ch = getc) =~ /[0-9]/
+ str << ch
+ end
+ ungetc
+ Token(TkNTH_REF)
+ when /\w/
+ ungetc
+ ungetc
+ return identify_identifier
+ else
+ ungetc
+ Token("$")
+ end
+ tk.set_text(str)
+ end
+
+ def identify_identifier
+ token = ""
+ token.concat getc if peek(0) =~ /[$@]/
+ token.concat getc if peek(0) == "@"
+
+ while (ch = getc) =~ /\w|_/
+ print ":", ch, ":" if RubyLex.debug?
+ token.concat ch
+ end
+ ungetc
+
+ if ch == "!" or ch == "?"
+ token.concat getc
+ end
+ # fix token
+
+ # $stderr.puts "identifier - #{token}, state = #@lex_state"
+
+ case token
+ when /^\$/
+ return Token(TkGVAR, token).set_text(token)
+ when /^\@/
+ @lex_state = EXPR_END
+ return Token(TkIVAR, token).set_text(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)
+ @indent += 1
+ elsif DEINDENT_CLAUSE.include?(token)
+ @indent -= 1
+ end
+ @lex_state = trans[0]
+ else
+ @lex_state = EXPR_END
+ end
+ end
+ return Token(token_c, token).set_text(token)
+ end
+ end
+
+ if @lex_state == EXPR_FNAME
+ @lex_state = EXPR_END
+ if peek(0) == '='
+ token.concat getc
+ end
+ elsif @lex_state == EXPR_BEG || @lex_state == EXPR_DOT
+ @lex_state = EXPR_ARG
+ else
+ @lex_state = EXPR_END
+ end
+
+ if token[0, 1] =~ /[A-Z]/
+ return Token(TkCONSTANT, token).set_text(token)
+ elsif token[token.size - 1, 1] =~ /[!?]/
+ return Token(TkFID, token).set_text(token)
+ else
+ return Token(TkIDENTIFIER, token).set_text(token)
+ end
+ end
+
+ 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 << ch
+ if ch == "\\" #"
+ ch = getc
+ reserve << ch
+ elsif ch == "\n"
+ break
+ end
+ end
+
+ str = ""
+ while (l = gets)
+ l.chomp!
+ l.strip! if indent
+ break if l == quoted
+ str << l.chomp << "\n"
+ end
+
+ @reader.divert_read_from(reserve)
+
+ @ltype = ltback
+ @lex_state = EXPR_END
+ Token(Ltype2Token[lt], str).set_text(str.dump)
+ end
+
+ def identify_quotation(initial_char)
+ ch = getc
+ if lt = PERCENT_LTYPE[ch]
+ initial_char += ch
+ ch = getc
+ elsif ch =~ /\W/
+ lt = "\""
+ else
+ RubyLex.fail SyntaxError, "unknown type of %string ('#{ch}')"
+ end
+# if ch !~ /\W/
+# ungetc
+# next
+# end
+ #@ltype = lt
+ @quoted = ch unless @quoted = PERCENT_PAREN[ch]
+ identify_string(lt, @quoted, ch, initial_char)
+ end
+
+ def identify_number(start)
+ str = start.dup
+
+ if start == "+" or start == "-" or start == ""
+ start = getc
+ str << start
+ end
+
+ @lex_state = EXPR_END
+
+ if start == "0"
+ if peek(0) == "x"
+ ch = getc
+ str << ch
+ match = /[0-9a-f_]/
+ else
+ match = /[0-7_]/
+ end
+ while ch = getc
+ if ch !~ match
+ ungetc
+ break
+ else
+ str << ch
+ end
+ end
+ return Token(TkINTEGER).set_text(str)
+ end
+
+ type = TkINTEGER
+ allow_point = TRUE
+ allow_e = TRUE
+ while ch = getc
+ case ch
+ when /[0-9_]/
+ str << ch
+
+ when allow_point && "."
+ type = TkFLOAT
+ if peek(0) !~ /[0-9]/
+ ungetc
+ break
+ end
+ str << ch
+ allow_point = false
+
+ when allow_e && "e", allow_e && "E"
+ str << ch
+ type = TkFLOAT
+ if peek(0) =~ /[+-]/
+ str << getc
+ end
+ allow_e = false
+ allow_point = false
+ else
+ ungetc
+ break
+ end
+ end
+ Token(type).set_text(str)
+ end
+
+ def identify_string(ltype, quoted = ltype, opener=nil, initial_char = nil)
+ @ltype = ltype
+ @quoted = quoted
+ subtype = nil
+
+ str = ""
+ str << initial_char if initial_char
+ str << (opener||quoted)
+
+ nest = 0
+ begin
+ while ch = getc
+ str << ch
+ if @quoted == ch
+ if nest == 0
+ break
+ else
+ nest -= 1
+ end
+ elsif opener == ch
+ nest += 1
+ elsif @ltype != "'" && @ltype != "]" and ch == "#"
+ ch = getc
+ if ch == "{"
+ subtype = true
+ str << ch << skip_inner_expression
+ else
+ ungetc(ch)
+ end
+ elsif ch == '\\' #'
+ str << read_escape
+ end
+ end
+ if @ltype == "/"
+ if peek(0) =~ /i|o|n|e|s/
+ str << getc
+ end
+ end
+ if subtype
+ Token(DLtype2Token[ltype], str)
+ else
+ Token(Ltype2Token[ltype], str)
+ end.set_text(str)
+ ensure
+ @ltype = nil
+ @quoted = nil
+ @lex_state = EXPR_END
+ end
+ end
+
+ def skip_inner_expression
+ res = ""
+ nest = 0
+ while (ch = getc)
+ res << ch
+ if ch == '}'
+ break if nest.zero?
+ nest -= 1
+ elsif ch == '{'
+ nest += 1
+ end
+ end
+ res
+ end
+
+ def identify_comment
+ @ltype = "#"
+ comment = "#"
+ while ch = getc
+ if ch == "\\"
+ ch = getc
+ if ch == "\n"
+ ch = " "
+ else
+ comment << "\\"
+ end
+ else
+ if ch == "\n"
+ @ltype = nil
+ ungetc
+ break
+ end
+ end
+ comment << ch
+ end
+ return Token(TkCOMMENT).set_text(comment)
+ end
+
+ def read_escape
+ res = ""
+ case ch = getc
+ when /[0-7]/
+ ungetc ch
+ 3.times do
+ case ch = getc
+ when /[0-7]/
+ when nil
+ break
+ else
+ ungetc
+ break
+ end
+ res << ch
+ end
+
+ when "x"
+ res << ch
+ 2.times do
+ case ch = getc
+ when /[0-9a-fA-F]/
+ when nil
+ break
+ else
+ ungetc
+ break
+ end
+ res << ch
+ end
+
+ when "M"
+ res << ch
+ if (ch = getc) != '-'
+ ungetc
+ else
+ res << ch
+ if (ch = getc) == "\\" #"
+ res << ch
+ res << read_escape
+ else
+ res << ch
+ end
+ end
+
+ when "C", "c" #, "^"
+ res << ch
+ if ch == "C" and (ch = getc) != "-"
+ ungetc
+ else
+ res << ch
+ if (ch = getc) == "\\" #"
+ res << ch
+ res << read_escape
+ else
+ res << ch
+ end
+ end
+ else
+ res << ch
+ end
+ res
+ end
+end
+
+
+
+# Extract code elements from a source file, returning a TopLevel
+# object containing the constituent file elements.
+#
+# This file is based on rtags
+
+module RDoc
+
+ GENERAL_MODIFIERS = [ 'nodoc' ].freeze
+
+ CLASS_MODIFIERS = GENERAL_MODIFIERS
+
+ ATTR_MODIFIERS = GENERAL_MODIFIERS
+
+ CONSTANT_MODIFIERS = GENERAL_MODIFIERS
+
+ METHOD_MODIFIERS = GENERAL_MODIFIERS +
+ [ 'arg', 'args', 'yield', 'yields', 'notnew', 'not-new', 'not_new', 'doc' ]
+
+
+ class RubyParser
+ include RubyToken
+ include TokenStream
+
+ extend ParserFactory
+
+ parse_files_matching(/\.rbw?$/)
+
+
+ def initialize(top_level, file_name, content, options, stats)
+ @options = options
+ @stats = stats
+ @size = 0
+ @token_listeners = nil
+ @input_file_name = file_name
+ @scanner = RubyLex.new(content)
+ @scanner.exception_on_syntax_error = false
+ @top_level = top_level
+ @progress = $stderr unless options.quiet
+ end
+
+ def scan
+ @tokens = []
+ @unget_read = []
+ @read = []
+ catch(:eof) do
+ catch(:enddoc) do
+ begin
+ parse_toplevel_statements(@top_level)
+ rescue Exception => e
+ $stderr.puts "\n\n"
+ $stderr.puts "RDoc failure in #@input_file_name at or around " +
+ "line #{@scanner.line_no} column #{@scanner.char_no}"
+ $stderr.puts
+ $stderr.puts "Before reporting this, could you check that the file"
+ $stderr.puts "you're documenting compiles cleanly--RDoc is not a"
+ $stderr.puts "full Ruby parser, and gets confused easily if fed"
+ $stderr.puts "invalid programs."
+ $stderr.puts
+ $stderr.puts "The internal error was:\n\n"
+
+ e.set_backtrace(e.backtrace[0,4])
+ raise
+ end
+ end
+ end
+ @top_level
+ end
+
+ private
+
+ def make_message(msg)
+ prefix = "\n" + @input_file_name + ":"
+ if @scanner
+ prefix << "#{@scanner.line_no}:#{@scanner.char_no}: "
+ end
+ return prefix + msg
+ end
+
+ def warn(msg)
+ return if @options.quiet
+ msg = make_message msg
+ $stderr.puts msg
+ end
+
+ def error(msg)
+ msg = make_message msg
+ $stderr.puts msg
+ exit(1)
+ end
+
+ def progress(char)
+ unless @options.quiet
+ @progress.print(char)
+ @progress.flush
+ end
+ end
+
+ def add_token_listener(obj)
+ @token_listeners ||= []
+ @token_listeners << obj
+ end
+
+ def remove_token_listener(obj)
+ @token_listeners.delete(obj)
+ end
+
+ def get_tk
+ tk = nil
+ if @tokens.empty?
+ tk = @scanner.token
+ @read.push @scanner.get_read
+ puts "get_tk1 => #{tk.inspect}" if $TOKEN_DEBUG
+ else
+ @read.push @unget_read.shift
+ tk = @tokens.shift
+ puts "get_tk2 => #{tk.inspect}" if $TOKEN_DEBUG
+ end
+
+ if tk.kind_of?(TkSYMBEG)
+ set_token_position(tk.line_no, tk.char_no)
+ tk1 = get_tk
+ if tk1.kind_of?(TkId) || tk1.kind_of?(TkOp)
+ tk = Token(TkSYMBOL).set_text(":" + tk1.name)
+ # remove the identifier we just read (we're about to
+ # replace it with a symbol)
+ @token_listeners.each do |obj|
+ obj.pop_token
+ end if @token_listeners
+ else
+ warn("':' not followed by identifier or operator")
+ tk = tk1
+ end
+ end
+
+ # inform any listeners of our shiny new token
+ @token_listeners.each do |obj|
+ obj.add_token(tk)
+ end if @token_listeners
+
+ tk
+ end
+
+ def peek_tk
+ unget_tk(tk = get_tk)
+ tk
+ end
+
+ def unget_tk(tk)
+ @tokens.unshift tk
+ @unget_read.unshift @read.pop
+
+ # Remove this token from any listeners
+ @token_listeners.each do |obj|
+ obj.pop_token
+ end if @token_listeners
+ end
+
+ def skip_tkspace(skip_nl = true)
+ tokens = []
+ while ((tk = get_tk).kind_of?(TkSPACE) ||
+ (skip_nl && tk.kind_of?(TkNL)))
+ tokens.push tk
+ end
+ unget_tk(tk)
+ tokens
+ end
+
+ def get_tkread
+ read = @read.join("")
+ @read = []
+ read
+ end
+
+ def peek_read
+ @read.join('')
+ end
+
+ NORMAL = "::"
+ SINGLE = "<<"
+
+ # Look for the first comment in a file that isn't
+ # a shebang line.
+
+ def collect_first_comment
+ skip_tkspace
+ res = ''
+ first_line = true
+
+ tk = get_tk
+ while tk.kind_of?(TkCOMMENT)
+ if first_line && /\A#!/ =~ tk.text
+ skip_tkspace
+ tk = get_tk
+ elsif first_line && /\A#\s*-\*-/ =~ tk.text
+ first_line = false
+ skip_tkspace
+ tk = get_tk
+ else
+ first_line = false
+ res << tk.text << "\n"
+ tk = get_tk
+ if tk.kind_of? TkNL
+ skip_tkspace(false)
+ tk = get_tk
+ end
+ end
+ end
+ unget_tk(tk)
+ res
+ end
+
+ def parse_toplevel_statements(container)
+ comment = collect_first_comment
+ look_for_directives_in(container, comment)
+ container.comment = comment unless comment.empty?
+ parse_statements(container, NORMAL, nil, comment)
+ end
+
+ def parse_statements(container, single=NORMAL, current_method=nil, comment='')
+ nest = 1
+ save_visibility = container.visibility
+
+# if container.kind_of?(TopLevel)
+# else
+# comment = ''
+# end
+
+ non_comment_seen = true
+
+ while tk = get_tk
+
+ keep_comment = false
+
+ non_comment_seen = true unless tk.kind_of?(TkCOMMENT)
+
+ case tk
+
+ when TkNL
+ skip_tkspace(true) # Skip blanks and newlines
+ tk = get_tk
+ if tk.kind_of?(TkCOMMENT)
+ if non_comment_seen
+ comment = ''
+ non_comment_seen = false
+ end
+ while tk.kind_of?(TkCOMMENT)
+ comment << tk.text << "\n"
+ tk = get_tk # this is the newline
+ skip_tkspace(false) # leading spaces
+ tk = get_tk
+ end
+ unless comment.empty?
+ look_for_directives_in(container, comment)
+ if container.done_documenting
+ container.ongoing_visibility = save_visibility
+# return
+ end
+ end
+ keep_comment = true
+ else
+ non_comment_seen = true
+ end
+ unget_tk(tk)
+ keep_comment = true
+
+
+ when TkCLASS
+ if container.document_children
+ parse_class(container, single, tk, comment)
+ else
+ nest += 1
+ end
+
+ when TkMODULE
+ if container.document_children
+ parse_module(container, single, tk, comment)
+ else
+ nest += 1
+ end
+
+ when TkDEF
+ if container.document_self
+ parse_method(container, single, tk, comment)
+ else
+ nest += 1
+ end
+
+ when TkCONSTANT
+ if container.document_self
+ parse_constant(container, single, tk, comment)
+ end
+
+ when TkALIAS
+ if container.document_self
+ parse_alias(container, single, tk, comment)
+ end
+
+ when TkYIELD
+ if current_method.nil?
+ warn("Warning: yield outside of method") if container.document_self
+ else
+ parse_yield(container, single, tk, current_method)
+ end
+
+ # Until and While can have a 'do', which shouldn't increas
+ # the nesting. We can't solve the general case, but we can
+ # handle most occurrences by ignoring a do at the end of a line
+
+ when TkUNTIL, TkWHILE
+ nest += 1
+ puts "FOUND #{tk.class} in #{container.name}, nest = #{nest}, " +
+ "line #{tk.line_no}" if $DEBUG
+ skip_optional_do_after_expression
+
+ # 'for' is trickier
+ when TkFOR
+ nest += 1
+ puts "FOUND #{tk.class} in #{container.name}, nest = #{nest}, " +
+ "line #{tk.line_no}" if $DEBUG
+ skip_for_variable
+ skip_optional_do_after_expression
+
+ when TkCASE, TkDO, TkIF, TkUNLESS, TkBEGIN
+ nest += 1
+ puts "Found #{tk.class} in #{container.name}, nest = #{nest}, " +
+ "line #{tk.line_no}" if $DEBUG
+
+ when TkIDENTIFIER
+ if nest == 1 and current_method.nil?
+ case tk.name
+ when "private", "protected", "public",
+ "private_class_method", "public_class_method"
+ parse_visibility(container, single, tk)
+ keep_comment = true
+ when "attr"
+ parse_attr(container, single, tk, comment)
+ when /^attr_(reader|writer|accessor)$/, @options.extra_accessors
+ parse_attr_accessor(container, single, tk, comment)
+ when "alias_method"
+ if container.document_self
+ parse_alias(container, single, tk, comment)
+ end
+ end
+ end
+
+ case tk.name
+ when "require"
+ parse_require(container, comment)
+ when "include"
+ parse_include(container, comment)
+ end
+
+
+ when TkEND
+ nest -= 1
+ puts "Found 'end' in #{container.name}, nest = #{nest}, line #{tk.line_no}" if $DEBUG
+ puts "Method = #{current_method.name}" if $DEBUG and current_method
+ if nest == 0
+ read_documentation_modifiers(container, CLASS_MODIFIERS)
+ container.ongoing_visibility = save_visibility
+ return
+ end
+
+ end
+
+ comment = '' unless keep_comment
+ begin
+ get_tkread
+ skip_tkspace(false)
+ end while peek_tk == TkNL
+
+ end
+ end
+
+ def parse_class(container, single, tk, comment, &block)
+ progress("c")
+
+ @stats.num_classes += 1
+
+ container, name_t = get_class_or_module(container)
+
+ case name_t
+ when TkCONSTANT
+ name = name_t.name
+ superclass = "Object"
+
+ if peek_tk.kind_of?(TkLT)
+ get_tk
+ skip_tkspace(true)
+ superclass = get_class_specification
+ superclass = "<unknown>" if superclass.empty?
+ end
+
+ if single == SINGLE
+ cls_type = SingleClass
+ else
+ cls_type = NormalClass
+ end
+
+ cls = container.add_class(cls_type, name, superclass)
+ read_documentation_modifiers(cls, CLASS_MODIFIERS)
+ cls.record_location(@top_level)
+ parse_statements(cls)
+ cls.comment = comment
+
+ when TkLSHFT
+ case name = get_class_specification
+ when "self", container.name
+ parse_statements(container, SINGLE, &block)
+ else
+ other = TopLevel.find_class_named(name)
+ unless other
+# other = @top_level.add_class(NormalClass, name, nil)
+# other.record_location(@top_level)
+# other.comment = comment
+ other = NormalClass.new("Dummy", nil)
+ end
+ read_documentation_modifiers(other, CLASS_MODIFIERS)
+ parse_statements(other, SINGLE, &block)
+ end
+
+ else
+ warn("Expected class name or '<<'. Got #{name_t.class}: #{name_t.text.inspect}")
+ end
+ end
+
+ def parse_module(container, single, tk, comment)
+ progress("m")
+ @stats.num_modules += 1
+ container, name_t = get_class_or_module(container)
+# skip_tkspace
+ name = name_t.name
+ mod = container.add_module(NormalModule, name)
+ mod.record_location(@top_level)
+ read_documentation_modifiers(mod, CLASS_MODIFIERS)
+ parse_statements(mod)
+ mod.comment = comment
+ end
+
+ # Look for the name of a class of module (optionally with a leading :: or
+ # with :: separated named) and return the ultimate name and container
+
+ def get_class_or_module(container)
+ skip_tkspace
+ name_t = get_tk
+
+ # class ::A -> A is in the top level
+ if name_t.kind_of?(TkCOLON2)
+ name_t = get_tk
+ container = @top_level
+ end
+
+ skip_tkspace(false)
+
+ while peek_tk.kind_of?(TkCOLON2)
+ prev_container = container
+ container = container.find_module_named(name_t.name)
+ if !container
+# warn("Couldn't find module #{name_t.name}")
+ container = prev_container.add_module(NormalModule, name_t.name)
+ end
+ get_tk
+ name_t = get_tk
+ end
+ skip_tkspace(false)
+ return [container, name_t]
+ end
+
+ def parse_constant(container, single, tk, comment)
+ name = tk.name
+ skip_tkspace(false)
+ eq_tk = get_tk
+
+ unless eq_tk.kind_of?(TkASSIGN)
+ unget_tk(eq_tk)
+ return
+ end
+
+
+ nest = 0
+ get_tkread
+
+ tk = get_tk
+ if tk.kind_of? TkGT
+ unget_tk(tk)
+ unget_tk(eq_tk)
+ return
+ end
+
+ loop do
+ puts("Param: #{tk}, #{@scanner.continue} " +
+ "#{@scanner.lex_state} #{nest}") if $DEBUG
+
+ case tk
+ when TkSEMICOLON
+ break
+ when TkLPAREN, TkfLPAREN
+ nest += 1
+ when TkRPAREN
+ nest -= 1
+ when TkCOMMENT
+ if nest <= 0 && @scanner.lex_state == EXPR_END
+ unget_tk(tk)
+ break
+ end
+ when TkNL
+ if (@scanner.lex_state == EXPR_END and nest <= 0) || !@scanner.continue
+ unget_tk(tk)
+ break
+ end
+ end
+ tk = get_tk
+ end
+
+ res = get_tkread.tr("\n", " ").strip
+ res = "" if res == ";"
+ con = Constant.new(name, res, comment)
+ read_documentation_modifiers(con, CONSTANT_MODIFIERS)
+ if con.document_self
+ container.add_constant(con)
+ end
+ end
+
+ def parse_method(container, single, tk, comment)
+ progress(".")
+ @stats.num_methods += 1
+ line_no = tk.line_no
+ column = tk.char_no
+
+ start_collecting_tokens
+ add_token(tk)
+ add_token_listener(self)
+
+ @scanner.instance_eval{@lex_state = EXPR_FNAME}
+ skip_tkspace(false)
+ name_t = get_tk
+ back_tk = skip_tkspace
+ meth = nil
+ added_container = false
+
+ dot = get_tk
+ if dot.kind_of?(TkDOT) or dot.kind_of?(TkCOLON2)
+ @scanner.instance_eval{@lex_state = EXPR_FNAME}
+ skip_tkspace
+ name_t2 = get_tk
+ case name_t
+ when TkSELF
+ name = name_t2.name
+ when TkCONSTANT
+ name = name_t2.name
+ prev_container = container
+ container = container.find_module_named(name_t.name)
+ if !container
+ added_container = true
+ obj = name_t.name.split("::").inject(Object) do |state, item|
+ state.const_get(item)
+ end rescue nil
+
+ type = obj.class == Class ? NormalClass : NormalModule
+ if not [Class, Module].include?(obj.class)
+ warn("Couldn't find #{name_t.name}. Assuming it's a module")
+ end
+
+ if type == NormalClass then
+ container = prev_container.add_class(type, name_t.name, obj.superclass.name)
+ else
+ container = prev_container.add_module(type, name_t.name)
+ end
+ end
+ else
+ # warn("Unexpected token '#{name_t2.inspect}'")
+ # break
+ skip_method(container)
+ return
+ end
+ meth = AnyMethod.new(get_tkread, name)
+ meth.singleton = true
+ else
+ unget_tk dot
+ back_tk.reverse_each do
+ |tk|
+ unget_tk tk
+ end
+ name = name_t.name
+
+ meth = AnyMethod.new(get_tkread, name)
+ meth.singleton = (single == SINGLE)
+ end
+
+ remove_token_listener(self)
+
+ meth.start_collecting_tokens
+ indent = TkSPACE.new(1,1)
+ indent.set_text(" " * column)
+
+ meth.add_tokens([TkCOMMENT.new(line_no,
+ 1,
+ "# File #{@top_level.file_absolute_name}, line #{line_no}"),
+ NEWLINE_TOKEN,
+ indent])
+
+ meth.add_tokens(@token_stream)
+
+ add_token_listener(meth)
+
+ @scanner.instance_eval{@continue = false}
+ parse_method_parameters(meth)
+
+ if meth.document_self
+ container.add_method(meth)
+ elsif added_container
+ container.document_self = false
+ end
+
+ # Having now read the method parameters and documentation modifiers, we
+ # now know whether we have to rename #initialize to ::new
+
+ if name == "initialize" && !meth.singleton
+ if meth.dont_rename_initialize
+ meth.visibility = :protected
+ else
+ meth.singleton = true
+ meth.name = "new"
+ meth.visibility = :public
+ end
+ end
+
+ parse_statements(container, single, meth)
+
+ remove_token_listener(meth)
+
+ # Look for a 'call-seq' in the comment, and override the
+ # normal parameter stuff
+
+ if comment.sub!(/:?call-seq:(.*?)^\s*\#?\s*$/m, '')
+ seq = $1
+ seq.gsub!(/^\s*\#\s*/, '')
+ meth.call_seq = seq
+ end
+
+ meth.comment = comment
+
+ end
+
+ def skip_method(container)
+ meth = AnyMethod.new("", "anon")
+ parse_method_parameters(meth)
+ parse_statements(container, false, meth)
+ end
+
+ # Capture the method's parameters. Along the way,
+ # look for a comment containing
+ #
+ # # yields: ....
+ #
+ # and add this as the block_params for the method
+
+ def parse_method_parameters(method)
+ res = parse_method_or_yield_parameters(method)
+ res = "(" + res + ")" unless res[0] == ?(
+ method.params = res unless method.params
+ if method.block_params.nil?
+ skip_tkspace(false)
+ read_documentation_modifiers(method, METHOD_MODIFIERS)
+ end
+ end
+
+ def parse_method_or_yield_parameters(method=nil, modifiers=METHOD_MODIFIERS)
+ skip_tkspace(false)
+ tk = get_tk
+
+ # Little hack going on here. In the statement
+ # f = 2*(1+yield)
+ # We see the RPAREN as the next token, so we need
+ # to exit early. This still won't catch all cases
+ # (such as "a = yield + 1"
+ end_token = case tk
+ when TkLPAREN, TkfLPAREN
+ TkRPAREN
+ when TkRPAREN
+ return ""
+ else
+ TkNL
+ end
+ nest = 0
+
+ loop do
+ puts("Param: #{tk.inspect}, #{@scanner.continue} " +
+ "#{@scanner.lex_state} #{nest}") if $DEBUG
+ case tk
+ when TkSEMICOLON
+ break
+ when TkLBRACE
+ nest += 1
+ when TkRBRACE
+ # we might have a.each {|i| yield i }
+ unget_tk(tk) if nest.zero?
+ nest -= 1
+ break if nest <= 0
+ when TkLPAREN, TkfLPAREN
+ nest += 1
+ when end_token
+ if end_token == TkRPAREN
+ nest -= 1
+ break if @scanner.lex_state == EXPR_END and nest <= 0
+ else
+ break unless @scanner.continue
+ end
+ when method && method.block_params.nil? && TkCOMMENT
+ unget_tk(tk)
+ read_documentation_modifiers(method, modifiers)
+ end
+ tk = get_tk
+ end
+ res = get_tkread.tr("\n", " ").strip
+ res = "" if res == ";"
+ res
+ end
+
+ # skip the var [in] part of a 'for' statement
+ def skip_for_variable
+ skip_tkspace(false)
+ tk = get_tk
+ skip_tkspace(false)
+ tk = get_tk
+ unget_tk(tk) unless tk.kind_of?(TkIN)
+ end
+
+ # while, until, and for have an optional
+ def skip_optional_do_after_expression
+ skip_tkspace(false)
+ tk = get_tk
+ case tk
+ when TkLPAREN, TkfLPAREN
+ end_token = TkRPAREN
+ else
+ end_token = TkNL
+ end
+
+ nest = 0
+ @scanner.instance_eval{@continue = false}
+
+ loop do
+ puts("\nWhile: #{tk}, #{@scanner.continue} " +
+ "#{@scanner.lex_state} #{nest}") if $DEBUG
+ case tk
+ when TkSEMICOLON
+ break
+ when TkLPAREN, TkfLPAREN
+ nest += 1
+ when TkDO
+ break if nest.zero?
+ when end_token
+ if end_token == TkRPAREN
+ nest -= 1
+ break if @scanner.lex_state == EXPR_END and nest.zero?
+ else
+ break unless @scanner.continue
+ end
+ end
+ tk = get_tk
+ end
+ skip_tkspace(false)
+ if peek_tk.kind_of? TkDO
+ get_tk
+ end
+ end
+
+ # Return a superclass, which can be either a constant
+ # of an expression
+
+ def get_class_specification
+ tk = get_tk
+ return "self" if tk.kind_of?(TkSELF)
+
+ res = ""
+ while tk.kind_of?(TkCOLON2) ||
+ tk.kind_of?(TkCOLON3) ||
+ tk.kind_of?(TkCONSTANT)
+
+ res += tk.text
+ tk = get_tk
+ end
+
+ unget_tk(tk)
+ skip_tkspace(false)
+
+ get_tkread # empty out read buffer
+
+ tk = get_tk
+
+ case tk
+ when TkNL, TkCOMMENT, TkSEMICOLON
+ unget_tk(tk)
+ return res
+ end
+
+ res += parse_call_parameters(tk)
+ res
+ end
+
+ def parse_call_parameters(tk)
+
+ end_token = case tk
+ when TkLPAREN, TkfLPAREN
+ TkRPAREN
+ when TkRPAREN
+ return ""
+ else
+ TkNL
+ end
+ nest = 0
+
+ loop do
+ puts("Call param: #{tk}, #{@scanner.continue} " +
+ "#{@scanner.lex_state} #{nest}") if $DEBUG
+ case tk
+ when TkSEMICOLON
+ break
+ when TkLPAREN, TkfLPAREN
+ nest += 1
+ when end_token
+ if end_token == TkRPAREN
+ nest -= 1
+ break if @scanner.lex_state == EXPR_END and nest <= 0
+ else
+ break unless @scanner.continue
+ end
+ when TkCOMMENT
+ unget_tk(tk)
+ break
+ end
+ tk = get_tk
+ end
+ res = get_tkread.tr("\n", " ").strip
+ res = "" if res == ";"
+ res
+ end
+
+
+ # Parse a constant, which might be qualified by
+ # one or more class or module names
+
+ def get_constant
+ res = ""
+ skip_tkspace(false)
+ tk = get_tk
+
+ while tk.kind_of?(TkCOLON2) ||
+ tk.kind_of?(TkCOLON3) ||
+ tk.kind_of?(TkCONSTANT)
+
+ res += tk.text
+ tk = get_tk
+ end
+
+# if res.empty?
+# warn("Unexpected token #{tk} in constant")
+# end
+ unget_tk(tk)
+ res
+ end
+
+ # Get a constant that may be surrounded by parens
+
+ def get_constant_with_optional_parens
+ skip_tkspace(false)
+ nest = 0
+ while (tk = peek_tk).kind_of?(TkLPAREN) || tk.kind_of?(TkfLPAREN)
+ get_tk
+ skip_tkspace(true)
+ nest += 1
+ end
+
+ name = get_constant
+
+ while nest > 0
+ skip_tkspace(true)
+ tk = get_tk
+ nest -= 1 if tk.kind_of?(TkRPAREN)
+ end
+ name
+ end
+
+ # Directives are modifier comments that can appear after class, module,
+ # or method names. For example
+ #
+ # def fred # :yields: a, b
+ #
+ # or
+ #
+ # class SM # :nodoc:
+ #
+ # we return the directive name and any parameters as a two element array
+
+ def read_directive(allowed)
+ tk = get_tk
+ puts "directive: #{tk.inspect}" if $DEBUG
+ result = nil
+ if tk.kind_of?(TkCOMMENT)
+ if tk.text =~ /\s*:?(\w+):\s*(.*)/
+ directive = $1.downcase
+ if allowed.include?(directive)
+ result = [directive, $2]
+ end
+ end
+ else
+ unget_tk(tk)
+ end
+ result
+ end
+
+
+ def read_documentation_modifiers(context, allow)
+ dir = read_directive(allow)
+
+ case dir[0]
+
+ when "notnew", "not_new", "not-new"
+ context.dont_rename_initialize = true
+
+ when "nodoc"
+ context.document_self = false
+ if dir[1].downcase == "all"
+ context.document_children = false
+ end
+
+ when "doc"
+ context.document_self = true
+ context.force_documentation = true
+
+ when "yield", "yields"
+ unless context.params.nil?
+ context.params.sub!(/(,|)\s*&\w+/,'') # remove parameter &proc
+ end
+ context.block_params = dir[1]
+
+ when "arg", "args"
+ context.params = dir[1]
+ end if dir
+ end
+
+
+ # Look for directives in a normal comment block:
+ #
+ # #-- - don't display comment from this point forward
+ #
+ #
+ # This routine modifies it's parameter
+
+ def look_for_directives_in(context, comment)
+
+ preprocess = SM::PreProcess.new(@input_file_name,
+ @options.rdoc_include)
+
+ preprocess.handle(comment) do |directive, param|
+ case directive
+ when "stopdoc"
+ context.stop_doc
+ ""
+ when "startdoc"
+ context.start_doc
+ context.force_documentation = true
+ ""
+
+ when "enddoc"
+ #context.done_documenting = true
+ #""
+ throw :enddoc
+
+ when "main"
+ options = Options.instance
+ options.main_page = param
+ ""
+
+ when "title"
+ options = Options.instance
+ options.title = param
+ ""
+
+ when "section"
+ context.set_current_section(param, comment)
+ comment.replace("") # 1.8 doesn't support #clear
+ break
+ else
+ warn "Unrecognized directive '#{directive}'"
+ break
+ end
+ end
+
+ remove_private_comments(comment)
+ end
+
+ def remove_private_comments(comment)
+ comment.gsub!(/^#--.*?^#\+\+/m, '')
+ comment.sub!(/^#--.*/m, '')
+ end
+
+
+
+ def get_symbol_or_name
+ tk = get_tk
+ case tk
+ when TkSYMBOL
+ tk.text.sub(/^:/, '')
+ when TkId, TkOp
+ tk.name
+ when TkSTRING
+ tk.text
+ else
+ raise "Name or symbol expected (got #{tk})"
+ end
+ end
+
+ def parse_alias(context, single, tk, comment)
+ skip_tkspace
+ if (peek_tk.kind_of? TkLPAREN)
+ get_tk
+ skip_tkspace
+ end
+ new_name = get_symbol_or_name
+ @scanner.instance_eval{@lex_state = EXPR_FNAME}
+ skip_tkspace
+ if (peek_tk.kind_of? TkCOMMA)
+ get_tk
+ skip_tkspace
+ end
+ old_name = get_symbol_or_name
+
+ al = Alias.new(get_tkread, old_name, new_name, comment)
+ read_documentation_modifiers(al, ATTR_MODIFIERS)
+ if al.document_self
+ context.add_alias(al)
+ end
+ end
+
+ def parse_yield_parameters
+ parse_method_or_yield_parameters
+ end
+
+ def parse_yield(context, single, tk, method)
+ if method.block_params.nil?
+ get_tkread
+ @scanner.instance_eval{@continue = false}
+ method.block_params = parse_yield_parameters
+ end
+ end
+
+ def parse_require(context, comment)
+ skip_tkspace_comment
+ tk = get_tk
+ if tk.kind_of? TkLPAREN
+ skip_tkspace_comment
+ tk = get_tk
+ end
+
+ name = nil
+ case tk
+ when TkSTRING
+ name = tk.text
+# when TkCONSTANT, TkIDENTIFIER, TkIVAR, TkGVAR
+# name = tk.name
+ when TkDSTRING
+ warn "Skipping require of dynamic string: #{tk.text}"
+ # else
+ # warn "'require' used as variable"
+ end
+ if name
+ context.add_require(Require.new(name, comment))
+ else
+ unget_tk(tk)
+ end
+ end
+
+ def parse_include(context, comment)
+ loop do
+ skip_tkspace_comment
+ name = get_constant_with_optional_parens
+ unless name.empty?
+ context.add_include(Include.new(name, comment))
+ end
+ return unless peek_tk.kind_of?(TkCOMMA)
+ get_tk
+ end
+ end
+
+ def get_bool
+ skip_tkspace
+ tk = get_tk
+ case tk
+ when TkTRUE
+ true
+ when TkFALSE, TkNIL
+ false
+ else
+ unget_tk tk
+ true
+ end
+ end
+
+ def parse_attr(context, single, tk, comment)
+ args = parse_symbol_arg(1)
+ if args.size > 0
+ name = args[0]
+ rw = "R"
+ skip_tkspace(false)
+ tk = get_tk
+ if tk.kind_of? TkCOMMA
+ rw = "RW" if get_bool
+ else
+ unget_tk tk
+ end
+ att = Attr.new(get_tkread, name, rw, comment)
+ read_documentation_modifiers(att, ATTR_MODIFIERS)
+ if att.document_self
+ context.add_attribute(att)
+ end
+ else
+ warn("'attr' ignored - looks like a variable")
+ end
+
+ end
+
+ def parse_visibility(container, single, tk)
+ singleton = (single == SINGLE)
+ vis = case tk.name
+ when "private" then :private
+ when "protected" then :protected
+ when "public" then :public
+ when "private_class_method"
+ singleton = true
+ :private
+ when "public_class_method"
+ singleton = true
+ :public
+ else raise "Invalid visibility: #{tk.name}"
+ end
+
+ skip_tkspace_comment(false)
+ case peek_tk
+ # Ryan Davis suggested the extension to ignore modifiers, because he
+ # often writes
+ #
+ # protected unless $TESTING
+ #
+ when TkNL, TkUNLESS_MOD, TkIF_MOD
+# error("Missing argument") if singleton
+ container.ongoing_visibility = vis
+ else
+ args = parse_symbol_arg
+ container.set_visibility_for(args, vis, singleton)
+ end
+ end
+
+ def parse_attr_accessor(context, single, tk, comment)
+ args = parse_symbol_arg
+ read = get_tkread
+ rw = "?"
+
+ # If nodoc is given, don't document any of them
+
+ tmp = CodeObject.new
+ read_documentation_modifiers(tmp, ATTR_MODIFIERS)
+ return unless tmp.document_self
+
+ case tk.name
+ when "attr_reader" then rw = "R"
+ when "attr_writer" then rw = "W"
+ when "attr_accessor" then rw = "RW"
+ else
+ rw = @options.extra_accessor_flags[tk.name]
+ end
+
+ for name in args
+ att = Attr.new(get_tkread, name, rw, comment)
+ context.add_attribute(att)
+ end
+ end
+
+ def skip_tkspace_comment(skip_nl = true)
+ loop do
+ skip_tkspace(skip_nl)
+ return unless peek_tk.kind_of? TkCOMMENT
+ get_tk
+ end
+ end
+
+ def parse_symbol_arg(no = nil)
+
+ args = []
+ skip_tkspace_comment
+ case tk = get_tk
+ when TkLPAREN
+ loop do
+ skip_tkspace_comment
+ if tk1 = parse_symbol_in_arg
+ args.push tk1
+ break if no and args.size >= no
+ end
+
+ skip_tkspace_comment
+ case tk2 = get_tk
+ when TkRPAREN
+ break
+ when TkCOMMA
+ else
+ warn("unexpected token: '#{tk2.inspect}'") if $DEBUG
+ break
+ end
+ end
+ else
+ unget_tk tk
+ if tk = parse_symbol_in_arg
+ args.push tk
+ return args if no and args.size >= no
+ end
+
+ loop do
+# skip_tkspace_comment(false)
+ skip_tkspace(false)
+
+ tk1 = get_tk
+ unless tk1.kind_of?(TkCOMMA)
+ unget_tk tk1
+ break
+ end
+
+ skip_tkspace_comment
+ if tk = parse_symbol_in_arg
+ args.push tk
+ break if no and args.size >= no
+ end
+ end
+ end
+ args
+ end
+
+ def parse_symbol_in_arg
+ case tk = get_tk
+ when TkSYMBOL
+ tk.text.sub(/^:/, '')
+ when TkSTRING
+ eval @read[-1]
+ else
+ warn("Expected symbol or string, got #{tk.inspect}") if $DEBUG
+ nil
+ end
+ end
+ end
+
+end
diff --git a/lib/rdoc/parsers/parse_simple.rb b/lib/rdoc/parsers/parse_simple.rb
new file mode 100644
index 0000000000..3f1a546964
--- /dev/null
+++ b/lib/rdoc/parsers/parse_simple.rb
@@ -0,0 +1,41 @@
+# Parse a non-source file. We basically take the whole thing
+# as one big comment. If the first character in the file
+# is '#', we strip leading pound signs.
+
+
+require "rdoc/code_objects"
+require "rdoc/markup/simple_markup/preprocess"
+
+module RDoc
+ # See rdoc/parsers/parse_c.rb
+
+ class SimpleParser
+
+ # prepare to parse a plain file
+ def initialize(top_level, file_name, body, options, stats)
+
+ preprocess = SM::PreProcess.new(file_name, options.rdoc_include)
+
+ preprocess.handle(body) do |directive, param|
+ $stderr.puts "Unrecognized directive '#{directive}' in #{file_name}"
+ end
+
+ @body = body
+ @options = options
+ @top_level = top_level
+ end
+
+ # Extract the file contents and attach them to the toplevel as a
+ # comment
+
+ def scan
+ # @body.gsub(/^(\s\n)+/, '')
+ @top_level.comment = remove_private_comments(@body)
+ @top_level
+ end
+
+ def remove_private_comments(comment)
+ comment.gsub(/^--.*?^\+\+/m, '').sub(/^--.*/m, '')
+ end
+ end
+end
diff --git a/lib/rdoc/parsers/parserfactory.rb b/lib/rdoc/parsers/parserfactory.rb
new file mode 100644
index 0000000000..00a82cf4b1
--- /dev/null
+++ b/lib/rdoc/parsers/parserfactory.rb
@@ -0,0 +1,99 @@
+require "rdoc/parsers/parse_simple"
+
+module RDoc
+
+ # A parser is simple a class that implements
+ #
+ # #initialize(file_name, body, options)
+ #
+ # and
+ #
+ # #scan
+ #
+ # The initialize method takes a file name to be used, the body of the
+ # file, and an RDoc::Options object. The scan method is then called
+ # to return an appropriately parsed TopLevel code object.
+ #
+ # The ParseFactory is used to redirect to the correct parser given a filename
+ # extension. This magic works because individual parsers have to register
+ # themselves with us as they are loaded in. The do this using the following
+ # incantation
+ #
+ #
+ # require "rdoc/parsers/parsefactory"
+ #
+ # module RDoc
+ #
+ # class XyzParser
+ # extend ParseFactory <<<<
+ # parse_files_matching /\.xyz$/ <<<<
+ #
+ # def initialize(file_name, body, options)
+ # ...
+ # end
+ #
+ # def scan
+ # ...
+ # end
+ # end
+ # end
+ #
+ # Just to make life interesting, if we suspect a plain text file, we
+ # also look for a shebang line just in case it's a potential
+ # shell script
+
+
+
+ module ParserFactory
+
+ @@parsers = []
+
+ Parsers = Struct.new(:regexp, :parser)
+
+ # Record the fact that a particular class parses files that
+ # match a given extension
+
+ def parse_files_matching(regexp)
+ @@parsers.unshift Parsers.new(regexp, self)
+ end
+
+ # Return a parser that can handle a particular extension
+
+ def ParserFactory.can_parse(file_name)
+ @@parsers.find {|p| p.regexp.match(file_name) }
+ end
+
+ # Alias an extension to another extension. After this call,
+ # files ending "new_ext" will be parsed using the same parser
+ # as "old_ext"
+
+ def ParserFactory.alias_extension(old_ext, new_ext)
+ parser = ParserFactory.can_parse("xxx.#{old_ext}")
+ return false unless parser
+ @@parsers.unshift Parsers.new(Regexp.new("\\.#{new_ext}$"), parser.parser)
+ true
+ end
+
+ # Find the correct parser for a particular file name. Return a
+ # SimpleParser for ones that we don't know
+
+ def ParserFactory.parser_for(top_level, file_name, body, options, stats)
+ # If no extension, look for shebang
+ if file_name !~ /\.\w+$/ && body =~ %r{\A#!(.+)}
+ shebang = $1
+ case shebang
+ when %r{env\s+ruby}, %r{/ruby}
+ file_name = "dummy.rb"
+ end
+ end
+ parser_description = can_parse(file_name)
+ if parser_description
+ parser = parser_description.parser
+ else
+ parser = SimpleParser
+ end
+
+ parser.new(top_level, file_name, body, options, stats)
+ end
+ end
+end
diff --git a/lib/rdoc/rdoc.rb b/lib/rdoc/rdoc.rb
index ce1cb1a93f..91f5611196 100644
--- a/lib/rdoc/rdoc.rb
+++ b/lib/rdoc/rdoc.rb
@@ -1,86 +1,117 @@
-require 'rdoc'
+# See README.
+#
+
-require 'rdoc/parser'
+VERSION_STRING = %{RDoc V1.0.1 - 20041108}
-# Simple must come first
-require 'rdoc/parser/simple'
-require 'rdoc/parser/ruby'
-require 'rdoc/parser/c'
-require 'rdoc/parser/f95'
-require 'rdoc/parser/perl'
-require 'rdoc/stats'
+require 'rdoc/parsers/parse_rb.rb'
+require 'rdoc/parsers/parse_c.rb'
+require 'rdoc/parsers/parse_f95.rb'
+
+require 'rdoc/parsers/parse_simple.rb'
require 'rdoc/options'
require 'rdoc/diagram'
require 'find'
-require 'fileutils'
+require 'ftools'
require 'time'
+# We put rdoc stuff in the RDoc module to avoid namespace
+# clutter.
+#
+# ToDo: This isn't universally true.
+#
+# :include: README
+
module RDoc
- ##
- # Encapsulate the production of rdoc documentation. Basically you can use
- # this as you would invoke rdoc from the command line:
- #
- # rdoc = RDoc::RDoc.new
- # rdoc.document(args)
- #
- # Where +args+ is an array of strings, each corresponding to an argument
- # you'd give rdoc on the command line. See rdoc/rdoc.rb for details.
+ # Name of the dotfile that contains the description of files to be
+ # processed in the current directory
+ DOT_DOC_FILENAME = ".document"
- class RDoc
+ # Simple stats collector
+ class Stats
+ attr_accessor :num_files, :num_classes, :num_modules, :num_methods
+ def initialize
+ @num_files = @num_classes = @num_modules = @num_methods = 0
+ @start = Time.now
+ end
+ def print
+ puts "Files: #@num_files"
+ puts "Classes: #@num_classes"
+ puts "Modules: #@num_modules"
+ puts "Methods: #@num_methods"
+ puts "Elapsed: " + sprintf("%0.3fs", Time.now - @start)
+ end
+ end
- Generator = Struct.new(:file_name, :class_name, :key)
- ##
- # Accessor for statistics. Available after each call to parse_files
+ # Exception thrown by any rdoc error. Only the #message part is
+ # of use externally.
- attr_reader :stats
+ class RDocError < Exception
+ end
- ##
- # This is the list of output generator that we support
+ # Encapsulate the production of rdoc documentation. Basically
+ # you can use this as you would invoke rdoc from the command
+ # line:
+ #
+ # rdoc = RDoc::RDoc.new
+ # rdoc.document(args)
+ #
+ # where _args_ is an array of strings, each corresponding to
+ # an argument you'd give rdoc on the command line. See rdoc/rdoc.rb
+ # for details.
+
+ class RDoc
+ ##
+ # This is the list of output generators that we
+ # support
+
+ Generator = Struct.new(:file_name, :class_name, :key)
+
GENERATORS = {}
-
- $LOAD_PATH.collect do |d|
- File.expand_path d
- end.find_all do |d|
- File.directory? "#{d}/rdoc/generator"
- end.each do |dir|
- Dir.entries("#{dir}/rdoc/generator").each do |gen|
- next unless /(\w+)\.rb$/ =~ gen
+ $:.collect {|d|
+ File::expand_path(d)
+ }.find_all {|d|
+ File::directory?("#{d}/rdoc/generators")
+ }.each {|dir|
+ Dir::entries("#{dir}/rdoc/generators").each {|gen|
+ next unless /(\w+)_generator.rb$/ =~ gen
type = $1
unless GENERATORS.has_key? type
- GENERATORS[type] = Generator.new("rdoc/generator/#{gen}",
- "#{type.upcase}".intern,
+ GENERATORS[type] = Generator.new("rdoc/generators/#{gen}",
+ "#{type.upcase}Generator".intern,
type)
end
- end
- end
+ }
+ }
- def initialize
- @stats = nil
- end
+ #######
+ private
+ #######
##
# Report an error message and exit
-
+
def error(msg)
- raise ::RDoc::Error, msg
+ raise RDocError.new(msg)
end
-
+
##
- # Create an output dir if it doesn't exist. If it does exist, but doesn't
- # contain the flag file <tt>created.rid</tt> then we refuse to use it, as
- # we may clobber some manually generated documentation
-
+ # Create an output dir if it doesn't exist. If it does
+ # exist, but doesn't contain the flag file <tt>created.rid</tt>
+ # then we refuse to use it, as we may clobber some
+ # manually generated documentation
+
def setup_output_dir(op_dir, force)
flag_file = output_flag_file(op_dir)
if File.exist?(op_dir)
unless File.directory?(op_dir)
- error "'#{op_dir}' exists, and is not a directory"
+ error "'#{op_dir}' exists, and is not a directory"
end
begin
created = File.read(flag_file)
@@ -94,30 +125,24 @@ module RDoc
last = (Time.parse(created) unless force rescue nil)
end
else
- FileUtils.mkdir_p(op_dir)
+ File.makedirs(op_dir)
end
last
end
- ##
# Update the flag file in an output directory.
-
def update_output_dir(op_dir, time)
File.open(output_flag_file(op_dir), "w") {|f| f.puts time.rfc2822 }
end
- ##
# Return the path name of the flag file in an output directory.
-
def output_flag_file(op_dir)
File.join(op_dir, "created.rid")
end
- ##
- # The .document file contains a list of file and directory name patterns,
- # representing candidates for documentation. It may also contain comments
- # (starting with '#')
-
+ # The .document file contains a list of file and directory name
+ # patterns, representing candidates for documentation. It may
+ # also contain comments (starting with '#')
def parse_dot_doc_file(in_dir, filename, options)
# read and strip comments
patterns = File.read(filename).gsub(/#.*/, '')
@@ -131,20 +156,20 @@ module RDoc
result
end
- ##
- # Given a list of files and directories, create a list of all the Ruby
- # files they contain.
+
+ # Given a list of files and directories, create a list
+ # of all the Ruby files they contain.
#
- # If +force_doc+ is true we always add the given files, if false, only
- # add files that we guarantee we can parse. It is true when looking at
- # files given on the command line, false when recursing through
- # subdirectories.
+ # If +force_doc+ is true, we always add the given files.
+ # If false, only add files that we guarantee we can parse
+ # It is true when looking at files given on the command line,
+ # false when recursing through subdirectories.
+ #
+ # The effect of this is that if you want a file with a non-
+ # standard extension parsed, you must name it explicity.
#
- # The effect of this is that if you want a file with a non-standard
- # extension parsed, you must name it explicitly.
- def normalized_file_list(options, relative_files, force_doc = false,
- exclude_pattern = nil)
+ def normalized_file_list(options, relative_files, force_doc = false, exclude_pattern=nil)
file_list = []
relative_files.each do |rel_file_name|
@@ -153,10 +178,7 @@ module RDoc
case type = stat.ftype
when "file"
next if @last_created and stat.mtime < @last_created
-
- if force_doc or ::RDoc::Parser.can_parse(rel_file_name) then
- file_list << rel_file_name.sub(/^\.\//, '')
- end
+ file_list << rel_file_name.sub(/^\.\//, '') if force_doc || ParserFactory.can_parse(rel_file_name)
when "directory"
next if rel_file_name == "CVS" || rel_file_name == ".svn"
dot_doc = File.join(rel_file_name, DOT_DOC_FILENAME)
@@ -166,124 +188,107 @@ module RDoc
file_list.concat(list_files_in_directory(rel_file_name, options))
end
else
- raise RDoc::Error, "I can't deal with a #{type} #{rel_file_name}"
+ raise RDocError.new("I can't deal with a #{type} #{rel_file_name}")
end
end
-
file_list
end
- ##
- # Return a list of the files to be processed in a directory. We know that
- # this directory doesn't have a .document file, so we're looking for real
- # files. However we may well contain subdirectories which must be tested
- # for .document files.
-
+ # Return a list of the files to be processed in
+ # a directory. We know that this directory doesn't have
+ # a .document file, so we're looking for real files. However
+ # we may well contain subdirectories which must
+ # be tested for .document files
def list_files_in_directory(dir, options)
- files = Dir.glob File.join(dir, "*")
-
- normalized_file_list options, files, false, options.exclude
+ normalized_file_list(options, Dir.glob(File.join(dir, "*")), false, options.exclude)
end
- ##
- # Parse each file on the command line, recursively entering directories.
+
+ # Parse each file on the command line, recursively entering
+ # directories
def parse_files(options)
- @stats = Stats.new options.verbosity
+
+ file_info = []
files = options.files
files = ["."] if files.empty?
- file_list = normalized_file_list(options, files, true, options.exclude)
-
- return [] if file_list.empty?
-
- file_info = []
-
- file_list.each do |filename|
- @stats.add_file filename
+ file_list = normalized_file_list(options, files, true)
- content = if RUBY_VERSION >= '1.9' then
- File.open(filename, "r:ascii-8bit") { |f| f.read }
- else
- File.read filename
- end
-
- if defined? Encoding then
- if /coding:\s*(\S+)/ =~ content[/\A(?:.*\n){0,2}/]
- if enc = ::Encoding.find($1)
- content.force_encoding(enc)
- end
- end
- end
-
- top_level = ::RDoc::TopLevel.new filename
-
- parser = ::RDoc::Parser.for top_level, filename, content, options,
- @stats
+ file_list.each do |fn|
+ $stderr.printf("\n%35s: ", File.basename(fn)) unless options.quiet
+
+ content = File.open(fn, "r") {|f| f.read}
+ top_level = TopLevel.new(fn)
+ parser = ParserFactory.parser_for(top_level, fn, content, options, @stats)
file_info << parser.scan
+ @stats.num_files += 1
end
file_info
end
- ##
- # Format up one or more files according to the given arguments.
+
+ public
+
+ ###################################################################
#
- # For simplicity, _argv_ is an array of strings, equivalent to the strings
- # that would be passed on the command line. (This isn't a coincidence, as
- # we _do_ pass in ARGV when running interactively). For a list of options,
- # see rdoc/rdoc.rb. By default, output will be stored in a directory
- # called +doc+ below the current directory, so make sure you're somewhere
- # writable before invoking.
+ # Format up one or more files according to the given arguments.
+ # For simplicity, _argv_ is an array of strings, equivalent to the
+ # strings that would be passed on the command line. (This isn't a
+ # coincidence, as we _do_ pass in ARGV when running
+ # interactively). For a list of options, see rdoc/rdoc.rb. By
+ # default, output will be stored in a directory called +doc+ below
+ # the current directory, so make sure you're somewhere writable
+ # before invoking.
#
- # Throws: RDoc::Error on error
+ # Throws: RDocError on error
def document(argv)
+
TopLevel::reset
- @options = Options.new GENERATORS
- @options.parse argv
+ @stats = Stats.new
- @last_created = nil
+ options = Options.instance
+ options.parse(argv, GENERATORS)
- unless @options.all_one_file then
- @last_created = setup_output_dir @options.op_dir, @options.force_update
+ @last_created = nil
+ unless options.all_one_file
+ @last_created = setup_output_dir(options.op_dir, options.force_update)
end
-
start_time = Time.now
- file_info = parse_files @options
-
- @options.title = "RDoc Documentation"
+ file_info = parse_files(options)
if file_info.empty?
- $stderr.puts "\nNo newer files." unless @options.quiet
+ $stderr.puts "\nNo newer files." unless options.quiet
else
- @gen = @options.generator
+ gen = options.generator
- $stderr.puts "\nGenerating #{@gen.key.upcase}..." unless @options.quiet
+ $stderr.puts "\nGenerating #{gen.key.upcase}..." unless options.quiet
- require @gen.file_name
+ require gen.file_name
- gen_class = ::RDoc::Generator.const_get @gen.class_name
- @gen = gen_class.for @options
+ gen_class = Generators.const_get(gen.class_name)
+ gen = gen_class.for(options)
pwd = Dir.pwd
- Dir.chdir @options.op_dir unless @options.all_one_file
+ Dir.chdir(options.op_dir) unless options.all_one_file
begin
- Diagram.new(file_info, @options).draw if @options.diagram
- @gen.generate(file_info)
+ Diagram.new(file_info, options).draw if options.diagram
+ gen.generate(file_info)
update_output_dir(".", start_time)
ensure
Dir.chdir(pwd)
end
end
- unless @options.quiet
+ unless options.quiet
puts
@stats.print
end
diff --git a/lib/rdoc/ri.rb b/lib/rdoc/ri.rb
deleted file mode 100644
index a3a858e673..0000000000
--- a/lib/rdoc/ri.rb
+++ /dev/null
@@ -1,8 +0,0 @@
-require 'rdoc'
-
-module RDoc::RI
-
- class Error < RDoc::Error; end
-
-end
-
diff --git a/lib/rdoc/ri/cache.rb b/lib/rdoc/ri/cache.rb
deleted file mode 100644
index 06177a00de..0000000000
--- a/lib/rdoc/ri/cache.rb
+++ /dev/null
@@ -1,187 +0,0 @@
-require 'rdoc/ri'
-
-class RDoc::RI::ClassEntry
-
- attr_reader :name
- attr_reader :path_names
-
- def initialize(path_name, name, in_class)
- @path_names = [ path_name ]
- @name = name
- @in_class = in_class
- @class_methods = []
- @instance_methods = []
- @inferior_classes = []
- end
-
- # We found this class in more than one place, so add
- # in the name from there.
- def add_path(path)
- @path_names << path
- end
-
- # read in our methods and any classes
- # and modules in our namespace. Methods are
- # stored in files called name-c|i.yaml,
- # where the 'name' portion is the external
- # form of the method name and the c|i is a class|instance
- # flag
-
- def load_from(dir)
- Dir.foreach(dir) do |name|
- next if name =~ /^\./
-
- # convert from external to internal form, and
- # extract the instance/class flag
-
- if name =~ /^(.*?)-(c|i).yaml$/
- external_name = $1
- is_class_method = $2 == "c"
- internal_name = RDoc::RI::Writer.external_to_internal(external_name)
- list = is_class_method ? @class_methods : @instance_methods
- path = File.join(dir, name)
- list << RDoc::RI::MethodEntry.new(path, internal_name, is_class_method, self)
- else
- full_name = File.join(dir, name)
- if File.directory?(full_name)
- inf_class = @inferior_classes.find {|c| c.name == name }
- if inf_class
- inf_class.add_path(full_name)
- else
- inf_class = RDoc::RI::ClassEntry.new(full_name, name, self)
- @inferior_classes << inf_class
- end
- inf_class.load_from(full_name)
- end
- end
- end
- end
-
- # Return a list of any classes or modules that we contain
- # that match a given string
-
- def contained_modules_matching(name)
- @inferior_classes.find_all {|c| c.name[name]}
- end
-
- def classes_and_modules
- @inferior_classes
- end
-
- # Return an exact match to a particular name
- def contained_class_named(name)
- @inferior_classes.find {|c| c.name == name}
- end
-
- # return the list of local methods matching name
- # We're split into two because we need distinct behavior
- # when called from the _toplevel_
- def methods_matching(name, is_class_method)
- local_methods_matching(name, is_class_method)
- end
-
- # Find methods matching 'name' in ourselves and in
- # any classes we contain
- def recursively_find_methods_matching(name, is_class_method)
- res = local_methods_matching(name, is_class_method)
- @inferior_classes.each do |c|
- res.concat(c.recursively_find_methods_matching(name, is_class_method))
- end
- res
- end
-
-
- # Return our full name
- def full_name
- res = @in_class.full_name
- res << "::" unless res.empty?
- res << @name
- end
-
- # Return a list of all out method names
- def all_method_names
- res = @class_methods.map {|m| m.full_name }
- @instance_methods.each {|m| res << m.full_name}
- res
- end
-
- private
-
- # Return a list of all our methods matching a given string.
- # Is +is_class_methods+ if 'nil', we don't care if the method
- # is a class method or not, otherwise we only return
- # those methods that match
- def local_methods_matching(name, is_class_method)
-
- list = case is_class_method
- when nil then @class_methods + @instance_methods
- when true then @class_methods
- when false then @instance_methods
- else fail "Unknown is_class_method: #{is_class_method.inspect}"
- end
-
- list.find_all {|m| m.name; m.name[name]}
- end
-end
-
-##
-# A TopLevelEntry is like a class entry, but when asked to search for methods
-# searches all classes, not just itself
-
-class RDoc::RI::TopLevelEntry < RDoc::RI::ClassEntry
- def methods_matching(name, is_class_method)
- res = recursively_find_methods_matching(name, is_class_method)
- end
-
- def full_name
- ""
- end
-
- def module_named(name)
-
- end
-
-end
-
-class RDoc::RI::MethodEntry
- attr_reader :name
- attr_reader :path_name
-
- def initialize(path_name, name, is_class_method, in_class)
- @path_name = path_name
- @name = name
- @is_class_method = is_class_method
- @in_class = in_class
- end
-
- def full_name
- res = @in_class.full_name
- unless res.empty?
- if @is_class_method
- res << "::"
- else
- res << "#"
- end
- end
- res << @name
- end
-end
-
-##
-# We represent everything known about all 'ri' files accessible to this program
-
-class RDoc::RI::Cache
-
- attr_reader :toplevel
-
- def initialize(dirs)
- # At the top level we have a dummy module holding the
- # overall namespace
- @toplevel = RDoc::RI::TopLevelEntry.new('', '::', nil)
-
- dirs.each do |dir|
- @toplevel.load_from(dir)
- end
- end
-
-end
diff --git a/lib/rdoc/ri/descriptions.rb b/lib/rdoc/ri/descriptions.rb
deleted file mode 100644
index 467b7de2a9..0000000000
--- a/lib/rdoc/ri/descriptions.rb
+++ /dev/null
@@ -1,156 +0,0 @@
-require 'yaml'
-require 'rdoc/markup/fragments'
-require 'rdoc/ri'
-
-##
-# Descriptions are created by RDoc (in ri_generator) and written out in
-# serialized form into the documentation tree. ri then reads these to generate
-# the documentation
-
-class RDoc::RI::NamedThing
- attr_reader :name
- def initialize(name)
- @name = name
- end
-
- def <=>(other)
- @name <=> other.name
- end
-
- def hash
- @name.hash
- end
-
- def eql?(other)
- @name.eql?(other)
- end
-end
-
-class RDoc::RI::AliasName < RDoc::RI::NamedThing; end
-
-class RDoc::RI::Attribute < RDoc::RI::NamedThing
- attr_reader :rw, :comment
-
- def initialize(name, rw, comment)
- super(name)
- @rw = rw
- @comment = comment
- end
-end
-
-class RDoc::RI::Constant < RDoc::RI::NamedThing
- attr_reader :value, :comment
-
- def initialize(name, value, comment)
- super(name)
- @value = value
- @comment = comment
- end
-end
-
-class RDoc::RI::IncludedModule < RDoc::RI::NamedThing; end
-
-class RDoc::RI::MethodSummary < RDoc::RI::NamedThing
- def initialize(name="")
- super
- end
-end
-
-class RDoc::RI::Description
- attr_accessor :name
- attr_accessor :full_name
- attr_accessor :comment
-
- def serialize
- self.to_yaml
- end
-
- def self.deserialize(from)
- YAML.load(from)
- end
-
- def <=>(other)
- @name <=> other.name
- end
-end
-
-class RDoc::RI::ModuleDescription < RDoc::RI::Description
-
- attr_accessor :class_methods
- attr_accessor :class_method_extensions
- attr_accessor :instance_methods
- attr_accessor :instance_method_extensions
- attr_accessor :attributes
- attr_accessor :constants
- attr_accessor :includes
-
- # merge in another class description into this one
- def merge_in(old)
- merge(@class_methods, old.class_methods)
- merge(@instance_methods, old.instance_methods)
- merge(@attributes, old.attributes)
- merge(@constants, old.constants)
- merge(@includes, old.includes)
- if @comment.nil? || @comment.empty?
- @comment = old.comment
- else
- unless old.comment.nil? or old.comment.empty? then
- if @comment.nil? or @comment.empty? then
- @comment = old.comment
- else
- @comment << RDoc::Markup::Flow::RULE.new
- @comment.concat old.comment
- end
- end
- end
- end
-
- def display_name
- "Module"
- end
-
- # the 'ClassDescription' subclass overrides this
- # to format up the name of a parent
- def superclass_string
- nil
- end
-
- private
-
- def merge(into, from)
- names = {}
- into.each {|i| names[i.name] = i }
- from.each {|i| names[i.name] = i }
- into.replace(names.keys.sort.map {|n| names[n]})
- end
-end
-
-class RDoc::RI::ClassDescription < RDoc::RI::ModuleDescription
- attr_accessor :superclass
-
- def display_name
- "Class"
- end
-
- def superclass_string
- if @superclass && @superclass != "Object"
- @superclass
- else
- nil
- end
- end
-end
-
-class RDoc::RI::MethodDescription < RDoc::RI::Description
-
- attr_accessor :is_class_method
- attr_accessor :visibility
- attr_accessor :block_params
- attr_accessor :is_singleton
- attr_accessor :aliases
- attr_accessor :is_alias_for
- attr_accessor :params
- attr_accessor :source_path
-
-end
-
diff --git a/lib/rdoc/ri/display.rb b/lib/rdoc/ri/display.rb
deleted file mode 100644
index f6b647fbc1..0000000000
--- a/lib/rdoc/ri/display.rb
+++ /dev/null
@@ -1,392 +0,0 @@
-require 'rdoc/ri'
-
-# readline support might not be present, so be careful
-# when requiring it.
-begin
- require('readline')
- require('abbrev')
- CAN_USE_READLINE = true # HACK use an RDoc namespace constant
-rescue LoadError
- CAN_USE_READLINE = false
-end
-
-##
-# This is a kind of 'flag' module. If you want to write your own 'ri' display
-# module (perhaps because you're writing an IDE), you write a class which
-# implements the various 'display' methods in RDoc::RI::DefaultDisplay, and
-# include the RDoc::RI::Display module in that class.
-#
-# To access your class from the command line, you can do
-#
-# ruby -r <your source file> ../ri ....
-
-module RDoc::RI::Display
-
- @@display_class = nil
-
- def self.append_features(display_class)
- @@display_class = display_class
- end
-
- def self.new(*args)
- @@display_class.new(*args)
- end
-
-end
-
-##
-# A paging display module. Uses the RDoc::RI::Formatter class to do the actual
-# presentation.
-
-class RDoc::RI::DefaultDisplay
-
- include RDoc::RI::Display
-
- def initialize(formatter, width, use_stdout, output = $stdout)
- @use_stdout = use_stdout
- @formatter = formatter.new output, width, " "
- end
-
- ##
- # Display information about +klass+. Fetches additional information from
- # +ri_reader+ as necessary.
-
- def display_class_info(klass)
- page do
- superclass = klass.superclass
-
- if superclass
- superclass = " < " + superclass
- else
- superclass = ""
- end
-
- @formatter.draw_line(klass.display_name + ": " +
- klass.full_name + superclass)
-
- display_flow(klass.comment)
- @formatter.draw_line
-
- unless klass.includes.empty?
- @formatter.blankline
- @formatter.display_heading("Includes:", 2, "")
- incs = []
-
- klass.includes.each do |inc|
- incs << inc.name
- end
-
- @formatter.wrap(incs.sort.join(', '))
- end
-
- unless klass.constants.empty?
- @formatter.blankline
- @formatter.display_heading("Constants:", 2, "")
-
- constants = klass.constants.sort_by { |constant| constant.name }
-
- constants.each do |constant|
- @formatter.wrap "#{constant.name} = #{constant.value}"
- if constant.comment then
- @formatter.indent do
- @formatter.display_flow constant.comment
- end
- else
- @formatter.break_to_newline
- end
- end
- end
-
- unless klass.attributes.empty? then
- @formatter.blankline
- @formatter.display_heading 'Attributes:', 2, ''
-
- attributes = klass.attributes.sort_by { |attribute| attribute.name }
-
- attributes.each do |attribute|
- if attribute.comment then
- @formatter.wrap "#{attribute.name} (#{attribute.rw}):"
- @formatter.indent do
- @formatter.display_flow attribute.comment
- end
- else
- @formatter.wrap "#{attribute.name} (#{attribute.rw})"
- @formatter.break_to_newline
- end
- end
- end
-
- return display_class_method_list(klass)
- end
- end
-
- ##
- # Given a Hash mapping a class' methods to method types (returned by
- # display_class_method_list), this method allows the user to
- # choose one of the methods.
-
- def get_class_method_choice(method_map)
- if CAN_USE_READLINE
- # prepare abbreviations for tab completion
- abbreviations = method_map.keys.abbrev
- Readline.completion_proc = proc do |string|
- abbreviations.values.uniq.grep(/^#{string}/)
- end
- end
-
- @formatter.raw_print_line "\nEnter the method name you want.\n"
- @formatter.raw_print_line "Class methods can be preceeded by '::' and instance methods by '#'.\n"
-
- if CAN_USE_READLINE
- @formatter.raw_print_line "You can use tab to autocomplete.\n"
- @formatter.raw_print_line "Enter a blank line to exit.\n"
-
- choice_string = Readline.readline(">> ").strip
- else
- @formatter.raw_print_line "Enter a blank line to exit.\n"
- @formatter.raw_print_line ">> "
- choice_string = $stdin.gets.strip
- end
-
- if choice_string == ''
- return nil
- else
- class_or_instance = method_map[choice_string]
-
- if class_or_instance
- # If the user's choice is not preceeded by a '::' or a '#', figure
- # out whether they want a class or an instance method and decorate
- # the choice appropriately.
- if(choice_string =~ /^[a-zA-Z]/)
- if(class_or_instance == :class)
- choice_string = "::#{choice_string}"
- else
- choice_string = "##{choice_string}"
- end
- end
-
- return choice_string
- else
- @formatter.raw_print_line "No method matched '#{choice_string}'.\n"
- return nil
- end
- end
- end
-
-
- ##
- # Display methods on +klass+
- # Returns a hash mapping method name to method contents (HACK?)
-
- def display_class_method_list(klass)
- method_map = {}
-
- class_data = [
- :class_methods,
- :class_method_extensions,
- :instance_methods,
- :instance_method_extensions,
- ]
-
- class_data.each do |data_type|
- data = klass.send data_type
-
- unless data.nil? or data.empty? then
- @formatter.blankline
-
- heading = data_type.to_s.split('_').join(' ').capitalize << ':'
- @formatter.display_heading heading, 2, ''
-
- method_names = []
- data.each do |item|
- method_names << item.name
-
- if(data_type == :class_methods ||
- data_type == :class_method_extensions) then
- method_map["::#{item.name}"] = :class
- method_map[item.name] = :class
- else
- #
- # Since we iterate over instance methods after class methods,
- # an instance method always will overwrite the unqualified
- # class method entry for a class method of the same name.
- #
- method_map["##{item.name}"] = :instance
- method_map[item.name] = :instance
- end
- end
- method_names.sort!
-
- @formatter.wrap method_names.join(', ')
- end
- end
-
- method_map
- end
- private :display_class_method_list
-
- ##
- # Display an Array of RDoc::Markup::Flow objects, +flow+.
-
- def display_flow(flow)
- if flow and not flow.empty? then
- @formatter.display_flow flow
- else
- @formatter.wrap '[no description]'
- end
- end
-
- ##
- # Display information about +method+.
-
- def display_method_info(method)
- page do
- @formatter.draw_line(method.full_name)
- display_params(method)
-
- @formatter.draw_line
- display_flow(method.comment)
-
- if method.aliases and not method.aliases.empty? then
- @formatter.blankline
- aka = "(also known as #{method.aliases.map { |a| a.name }.join(', ')})"
- @formatter.wrap aka
- end
- end
- end
-
- ##
- # Display the list of +methods+.
-
- def display_method_list(methods)
- page do
- @formatter.wrap "More than one method matched your request. You can refine your search by asking for information on one of:"
- @formatter.blankline
-
- methods.each do |method|
- @formatter.raw_print_line "#{method.full_name} [#{method.source_path}]\n"
- end
- end
- end
-
- ##
- # Display a list of +methods+ and allow the user to select one of them.
-
- def display_method_list_choice(methods)
- page do
- @formatter.wrap "More than one method matched your request. Please choose one of the possible matches."
- @formatter.blankline
-
- methods.each_with_index do |method, index|
- @formatter.raw_print_line "%3d %s [%s]\n" % [index + 1, method.full_name, method.source_path]
- end
-
- @formatter.raw_print_line ">> "
-
- choice = $stdin.gets.strip!
-
- if(choice == '')
- return
- end
-
- choice = choice.to_i
-
- if ((choice == 0) || (choice > methods.size)) then
- @formatter.raw_print_line "Invalid choice!\n"
- else
- method = methods[choice - 1]
- display_method_info(method)
- end
- end
- end
-
- ##
- # Display the params for +method+.
-
- def display_params(method)
- params = method.params
-
- if params[0,1] == "(" then
- if method.is_singleton
- params = method.full_name + params
- else
- params = method.name + params
- end
- end
-
- params.split(/\n/).each do |param|
- @formatter.wrap param
- @formatter.break_to_newline
- end
-
- @formatter.blankline
- @formatter.wrap("From #{method.source_path}")
- end
-
- ##
- # List the classes in +classes+.
-
- def list_known_classes(classes)
- if classes.empty?
- warn_no_database
- else
- page do
- @formatter.draw_line "Known classes and modules"
- @formatter.blankline
-
- @formatter.wrap classes.sort.join(', ')
- end
- end
- end
-
- ##
- # Paginates output through a pager program.
-
- def page
- if pager = setup_pager then
- begin
- orig_output = @formatter.output
- @formatter.output = pager
- yield
- ensure
- @formatter.output = orig_output
- pager.close
- end
- else
- yield
- end
- rescue Errno::EPIPE
- end
-
- ##
- # Sets up a pager program to pass output through.
-
- def setup_pager
- unless @use_stdout then
- for pager in [ ENV['PAGER'], "less", "more", 'pager' ].compact.uniq
- return IO.popen(pager, "w") rescue nil
- end
- @use_stdout = true
- nil
- end
- end
-
- ##
- # Displays a message that describes how to build RI data.
-
- def warn_no_database
- output = @formatter.output
-
- output.puts "No ri data found"
- output.puts
- output.puts "If you've installed Ruby yourself, you need to generate documentation using:"
- output.puts
- output.puts " make install-doc"
- output.puts
- output.puts "from the same place you ran `make` to build ruby."
- output.puts
- output.puts "If you installed Ruby from a packaging system, then you may need to"
- output.puts "install an additional package, or ask the packager to enable ri generation."
- end
-
-end
diff --git a/lib/rdoc/ri/driver.rb b/lib/rdoc/ri/driver.rb
deleted file mode 100644
index 89534a5972..0000000000
--- a/lib/rdoc/ri/driver.rb
+++ /dev/null
@@ -1,669 +0,0 @@
-require 'optparse'
-require 'yaml'
-
-require 'rdoc/ri'
-require 'rdoc/ri/paths'
-require 'rdoc/ri/formatter'
-require 'rdoc/ri/display'
-require 'fileutils'
-require 'rdoc/markup'
-require 'rdoc/markup/to_flow'
-
-class RDoc::RI::Driver
-
- #
- # This class offers both Hash and OpenStruct functionality.
- # We convert from the Core Hash to this before calling any of
- # the display methods, in order to give the display methods
- # a cleaner API for accessing the data.
- #
- class OpenStructHash < Hash
- #
- # This method converts from a Hash to an OpenStructHash.
- #
- def self.convert(object)
- case object
- when Hash then
- new_hash = new # Convert Hash -> OpenStructHash
-
- object.each do |key, value|
- new_hash[key] = convert(value)
- end
-
- new_hash
- when Array then
- object.map do |element|
- convert(element)
- end
- else
- object
- end
- end
-
- def merge_enums(other)
- other.each do |k, v|
- if self[k] then
- case v
- when Array then
- # HACK dunno
- if String === self[k] and self[k].empty? then
- self[k] = v
- else
- self[k] += v
- end
- when Hash then
- self[k].update v
- else
- # do nothing
- end
- else
- self[k] = v
- end
- end
- end
-
- def method_missing method, *args
- self[method.to_s]
- end
- end
-
- class Error < RDoc::RI::Error; end
-
- class NotFoundError < Error
- def message
- "Nothing known about #{super}"
- end
- end
-
- attr_accessor :homepath # :nodoc:
-
- def self.default_options
- options = {}
- options[:use_stdout] = !$stdout.tty?
- options[:width] = 72
- options[:formatter] = RDoc::RI::Formatter.for 'plain'
- options[:interactive] = false
- options[:use_cache] = true
-
- # By default all standard paths are used.
- options[:use_system] = true
- options[:use_site] = true
- options[:use_home] = true
- options[:use_gems] = true
- options[:extra_doc_dirs] = []
-
- return options
- end
-
- def self.process_args(argv)
- options = default_options
-
- opts = OptionParser.new do |opt|
- opt.program_name = File.basename $0
- opt.version = RDoc::VERSION
- opt.release = nil
- opt.summary_indent = ' ' * 4
-
- directories = [
- RDoc::RI::Paths::SYSDIR,
- RDoc::RI::Paths::SITEDIR,
- RDoc::RI::Paths::HOMEDIR
- ]
-
- if RDoc::RI::Paths::GEMDIRS then
- Gem.path.each do |dir|
- directories << "#{dir}/doc/*/ri"
- end
- end
-
- opt.banner = <<-EOT
-Usage: #{opt.program_name} [options] [names...]
-
-Where name can be:
-
- Class | Class::method | Class#method | Class.method | method
-
-All class names may be abbreviated to their minimum unambiguous form. If a name
-is ambiguous, all valid options will be listed.
-
-The form '.' method matches either class or instance methods, while #method
-matches only instance and ::method matches only class methods.
-
-For example:
-
- #{opt.program_name} Fil
- #{opt.program_name} File
- #{opt.program_name} File.new
- #{opt.program_name} zip
-
-Note that shell quoting may be required for method names containing
-punctuation:
-
- #{opt.program_name} 'Array.[]'
- #{opt.program_name} compact\\!
-
-By default ri searches for documentation in the following directories:
-
- #{directories.join "\n "}
-
-Specifying the --system, --site, --home, --gems or --doc-dir options will
-limit ri to searching only the specified directories.
-
-Options may also be set in the 'RI' environment variable.
- EOT
-
- opt.separator nil
- opt.separator "Options:"
- opt.separator nil
-
- opt.on("--fmt=FORMAT", "--format=FORMAT", "-f",
- RDoc::RI::Formatter::FORMATTERS.keys,
- "Format to use when displaying output:",
- " #{RDoc::RI::Formatter.list}",
- "Use 'bs' (backspace) with most pager",
- "programs. To use ANSI, either disable the",
- "pager or tell the pager to allow control",
- "characters.") do |value|
- options[:formatter] = RDoc::RI::Formatter.for value
- end
-
- opt.separator nil
-
- opt.on("--doc-dir=DIRNAME", "-d", Array,
- "List of directories from which to source",
- "documentation in addition to the standard",
- "directories. May be repeated.") do |value|
- value.each do |dir|
- unless File.directory? dir then
- raise OptionParser::InvalidArgument, "#{dir} is not a directory"
- end
-
- options[:extra_doc_dirs] << File.expand_path(dir)
- end
- end
-
- opt.separator nil
-
- opt.on("--[no-]use-cache",
- "Whether or not to use ri's cache.",
- "True by default.") do |value|
- options[:use_cache] = value
- end
-
- opt.separator nil
-
- opt.on("--no-standard-docs",
- "Do not include documentation from",
- "the Ruby standard library, site_lib,",
- "installed gems, or ~/.rdoc.",
- "Equivalent to specifying",
- "the options --no-system, --no-site, --no-gems,",
- "and --no-home") do
- options[:use_system] = false
- options[:use_site] = false
- options[:use_gems] = false
- options[:use_home] = false
- end
-
- opt.separator nil
-
- opt.on("--[no-]system",
- "Include documentation from Ruby's standard",
- "library. Defaults to true.") do |value|
- options[:use_system] = value
- end
-
- opt.separator nil
-
- opt.on("--[no-]site",
- "Include documentation from libraries",
- "installed in site_lib.",
- "Defaults to true.") do |value|
- options[:use_site] = value
- end
-
- opt.separator nil
-
- opt.on("--[no-]gems",
- "Include documentation from RubyGems.",
- "Defaults to true.") do |value|
- options[:use_gems] = value
- end
-
- opt.separator nil
-
- opt.on("--[no-]home",
- "Include documentation stored in ~/.rdoc.",
- "Defaults to true.") do |value|
- options[:use_home] = value
- end
-
- opt.separator nil
-
- opt.on("--list-doc-dirs",
- "List the directories from which ri will",
- "source documentation on stdout and exit.") do
- options[:list_doc_dirs] = true
- end
-
- opt.separator nil
-
- opt.on("--no-pager", "-T",
- "Send output directly to stdout,",
- "rather than to a pager.") do
- options[:use_stdout] = true
- end
-
- opt.on("--interactive", "-i",
- "This makes ri go into interactive mode.",
- "When ri is in interactive mode it will",
- "allow the user to disambiguate lists of",
- "methods in case multiple methods match",
- "against a method search string. It also",
- "will allow the user to enter in a method",
- "name (with auto-completion, if readline",
- "is supported) when viewing a class.") do
- options[:interactive] = true
- end
-
- opt.separator nil
-
- opt.on("--width=WIDTH", "-w", OptionParser::DecimalInteger,
- "Set the width of the output.") do |value|
- options[:width] = value
- end
- end
-
- argv = ENV['RI'].to_s.split.concat argv
-
- opts.parse! argv
-
- options[:names] = argv
-
- options[:formatter] ||= RDoc::RI::Formatter.for('plain')
- options[:use_stdout] ||= !$stdout.tty?
- options[:use_stdout] ||= options[:interactive]
- options[:width] ||= 72
-
- options
-
- rescue OptionParser::InvalidArgument, OptionParser::InvalidOption => e
- puts opts
- puts
- puts e
- exit 1
- end
-
- def self.run(argv = ARGV)
- options = process_args argv
- ri = new options
- ri.run
- end
-
- def initialize(initial_options={})
- options = self.class.default_options.update(initial_options)
-
- @names = options[:names]
- @class_cache_name = 'classes'
-
- @doc_dirs = RDoc::RI::Paths.path(options[:use_system],
- options[:use_site],
- options[:use_home],
- options[:use_gems],
- options[:extra_doc_dirs])
-
- @homepath = RDoc::RI::Paths.raw_path(false, false, true, false).first
- @homepath = @homepath.sub(/\.rdoc/, '.ri')
- @sys_dir = RDoc::RI::Paths.raw_path(true, false, false, false).first
- @list_doc_dirs = options[:list_doc_dirs]
-
- FileUtils.mkdir_p cache_file_path unless File.directory? cache_file_path
- @cache_doc_dirs_path = File.join cache_file_path, ".doc_dirs"
-
- @use_cache = options[:use_cache]
- @class_cache = nil
-
- @interactive = options[:interactive]
- @display = RDoc::RI::DefaultDisplay.new(options[:formatter],
- options[:width],
- options[:use_stdout])
- end
-
- def class_cache
- return @class_cache if @class_cache
-
- # Get the documentation directories used to make the cache in order to see
- # whether the cache is valid for the current ri instantiation.
- if(File.readable?(@cache_doc_dirs_path))
- cache_doc_dirs = IO.read(@cache_doc_dirs_path).split("\n")
- else
- cache_doc_dirs = []
- end
-
- newest = map_dirs('created.rid') do |f|
- File.mtime f if test ?f, f
- end.max
-
- # An up to date cache file must have been created more recently than
- # the last modification of any of the documentation directories. It also
- # must have been created with the same documentation directories
- # as those from which ri currently is sourcing documentation.
- up_to_date = (File.exist?(class_cache_file_path) and
- newest and newest < File.mtime(class_cache_file_path) and
- (cache_doc_dirs == @doc_dirs))
-
- if up_to_date and @use_cache then
- open class_cache_file_path, 'rb' do |fp|
- begin
- @class_cache = Marshal.load fp.read
- rescue
- #
- # This shouldn't be necessary, since the up_to_date logic above
- # should force the cache to be recreated when a new version of
- # rdoc is installed. This seems like a worthwhile enhancement
- # to ri's robustness, however.
- #
- $stderr.puts "Error reading the class cache; recreating the class cache!"
- @class_cache = create_class_cache
- end
- end
- else
- @class_cache = create_class_cache
- end
-
- @class_cache
- end
-
- def create_class_cache
- class_cache = OpenStructHash.new
-
- if(@use_cache)
- # Dump the documentation directories to a file in the cache, so that
- # we only will use the cache for future instantiations with identical
- # documentation directories.
- File.open @cache_doc_dirs_path, "wb" do |fp|
- fp << @doc_dirs.join("\n")
- end
- end
-
- classes = map_dirs('**/cdesc*.yaml') { |f| Dir[f] }
- warn "Updating class cache with #{classes.size} classes..."
- populate_class_cache class_cache, classes
-
- write_cache class_cache, class_cache_file_path
-
- class_cache
- end
-
- def populate_class_cache(class_cache, classes, extension = false)
- classes.each do |cdesc|
- desc = read_yaml cdesc
- klassname = desc["full_name"]
-
- unless class_cache.has_key? klassname then
- desc["display_name"] = "Class"
- desc["sources"] = [cdesc]
- desc["instance_method_extensions"] = []
- desc["class_method_extensions"] = []
- class_cache[klassname] = desc
- else
- klass = class_cache[klassname]
-
- if extension then
- desc["instance_method_extensions"] = desc.delete "instance_methods"
- desc["class_method_extensions"] = desc.delete "class_methods"
- end
-
- klass.merge_enums desc
- klass["sources"] << cdesc
- end
- end
- end
-
- def class_cache_file_path
- File.join cache_file_path, @class_cache_name
- end
-
- def cache_file_for(klassname)
- File.join cache_file_path, klassname.gsub(/:+/, "-")
- end
-
- def cache_file_path
- File.join @homepath, 'cache'
- end
-
- def display_class(name)
- klass = class_cache[name]
- @display.display_class_info klass
- end
-
- def display_method(method)
- @display.display_method_info method
- end
-
- def get_info_for(arg)
- @names = [arg]
- run
- end
-
- def load_cache_for(klassname)
- path = cache_file_for klassname
-
- cache = nil
-
- if File.exist? path and
- File.mtime(path) >= File.mtime(class_cache_file_path) and
- @use_cache then
- open path, 'rb' do |fp|
- begin
- cache = Marshal.load fp.read
- rescue
- #
- # The cache somehow is bad. Recreate the cache.
- #
- $stderr.puts "Error reading the cache for #{klassname}; recreating the cache!"
- cache = create_cache_for klassname, path
- end
- end
- else
- cache = create_cache_for klassname, path
- end
-
- cache
- end
-
- def create_cache_for(klassname, path)
- klass = class_cache[klassname]
- return nil unless klass
-
- method_files = klass["sources"]
- cache = OpenStructHash.new
-
- method_files.each do |f|
- system_file = f.index(@sys_dir) == 0
- Dir[File.join(File.dirname(f), "*")].each do |yaml|
- next unless yaml =~ /yaml$/
- next if yaml =~ /cdesc-[^\/]+yaml$/
-
- method = read_yaml yaml
-
- if system_file then
- method["source_path"] = "Ruby #{RDoc::RI::Paths::VERSION}"
- else
- if(f =~ %r%gems/[\d.]+/doc/([^/]+)%) then
- ext_path = "gem #{$1}"
- else
- ext_path = f
- end
-
- method["source_path"] = ext_path
- end
-
- name = method["full_name"]
- cache[name] = method
- end
- end
-
- write_cache cache, path
- end
-
- ##
- # Finds the next ancestor of +orig_klass+ after +klass+.
-
- def lookup_ancestor(klass, orig_klass)
- # This is a bit hacky, but ri will go into an infinite
- # loop otherwise, since Object has an Object ancestor
- # for some reason. Depending on the documentation state, I've seen
- # Kernel as an ancestor of Object and not as an ancestor of Object.
- if ((orig_klass == "Object") &&
- ((klass == "Kernel") || (klass == "Object")))
- return nil
- end
-
- cache = class_cache[orig_klass]
-
- return nil unless cache
-
- ancestors = [orig_klass]
- ancestors.push(*cache.includes.map { |inc| inc['name'] })
- ancestors << cache.superclass
-
- ancestor_index = ancestors.index(klass)
-
- if ancestor_index
- ancestor = ancestors[ancestors.index(klass) + 1]
- return ancestor if ancestor
- end
-
- lookup_ancestor klass, cache.superclass
- end
-
- ##
- # Finds the method
-
- def lookup_method(name, klass)
- cache = load_cache_for klass
- return nil unless cache
-
- method = cache[name.gsub('.', '#')]
- method = cache[name.gsub('.', '::')] unless method
- method
- end
-
- def map_dirs(file_name)
- @doc_dirs.map { |dir| yield File.join(dir, file_name) }.flatten.compact
- end
-
- ##
- # Extract the class and method name parts from +name+ like Foo::Bar#baz
-
- def parse_name(name)
- parts = name.split(/(::|\#|\.)/)
-
- if parts[-2] != '::' or parts.last !~ /^[A-Z]/ then
- meth = parts.pop
- parts.pop
- end
-
- klass = parts.join
-
- [klass, meth]
- end
-
- def read_yaml(path)
- data = File.read path
-
- # Necessary to be backward-compatible with documentation generated
- # by earliar RDoc versions.
- data = data.gsub(/ \!ruby\/(object|struct):(RDoc::RI|RI).*/, '')
- data = data.gsub(/ \!ruby\/(object|struct):SM::(\S+)/,
- ' !ruby/\1:RDoc::Markup::\2')
- OpenStructHash.convert(YAML.load(data))
- end
-
- def run
- if(@list_doc_dirs)
- puts @doc_dirs.join("\n")
- elsif @names.empty? then
- @display.list_known_classes class_cache.keys.sort
- else
- @names.each do |name|
- if class_cache.key? name then
- method_map = display_class name
- if(@interactive)
- method_name = @display.get_class_method_choice(method_map)
-
- if(method_name != nil)
- method = lookup_method "#{name}#{method_name}", name
- display_method method
- end
- end
- elsif name =~ /::|\#|\./ then
- klass, = parse_name name
-
- orig_klass = klass
- orig_name = name
-
- loop do
- method = lookup_method name, klass
-
- break method if method
-
- ancestor = lookup_ancestor klass, orig_klass
-
- break unless ancestor
-
- name = name.sub klass, ancestor
- klass = ancestor
- end
-
- raise NotFoundError, orig_name unless method
-
- display_method method
- else
- methods = select_methods(/#{name}/)
-
- if methods.size == 0
- raise NotFoundError, name
- elsif methods.size == 1
- display_method methods[0]
- else
- if(@interactive)
- @display.display_method_list_choice methods
- else
- @display.display_method_list methods
- end
- end
- end
- end
- end
- rescue NotFoundError => e
- abort e.message
- end
-
- def select_methods(pattern)
- methods = []
- class_cache.keys.sort.each do |klass|
- class_cache[klass]["instance_methods"].map{|h|h["name"]}.grep(pattern) do |name|
- method = load_cache_for(klass)[klass+'#'+name]
- methods << method if method
- end
- class_cache[klass]["class_methods"].map{|h|h["name"]}.grep(pattern) do |name|
- method = load_cache_for(klass)[klass+'::'+name]
- methods << method if method
- end
- end
- methods
- end
-
- def write_cache(cache, path)
- if(@use_cache)
- File.open path, "wb" do |cache_file|
- Marshal.dump cache, cache_file
- end
- end
-
- cache
- end
-
-end
diff --git a/lib/rdoc/ri/formatter.rb b/lib/rdoc/ri/formatter.rb
deleted file mode 100644
index 258907d141..0000000000
--- a/lib/rdoc/ri/formatter.rb
+++ /dev/null
@@ -1,616 +0,0 @@
-require 'rdoc/ri'
-require 'rdoc/markup'
-
-class RDoc::RI::Formatter
-
- attr_writer :indent
- attr_accessor :output
-
- FORMATTERS = { }
-
- def self.for(name)
- FORMATTERS[name.downcase]
- end
-
- def self.list
- FORMATTERS.keys.sort.join ", "
- end
-
- def initialize(output, width, indent)
- @output = output
- @width = width
- @indent = indent
- @original_indent = indent.dup
- end
-
- def draw_line(label=nil)
- len = @width
- len -= (label.size + 1) if label
-
- if len > 0 then
- @output.print '-' * len
- if label
- @output.print ' '
- bold_print label
- end
-
- @output.puts
- else
- @output.print '-' * @width
- @output.puts
-
- @output.puts label
- end
- end
-
- def indent
- return @indent unless block_given?
-
- begin
- indent = @indent.dup
- @indent += @original_indent
- yield
- ensure
- @indent = indent
- end
- end
-
- def wrap(txt, prefix=@indent, linelen=@width)
- return unless txt && !txt.empty?
-
- work = conv_markup(txt)
- textLen = linelen - prefix.length
- patt = Regexp.new("^(.{0,#{textLen}})[ \n]")
- next_prefix = prefix.tr("^ ", " ")
-
- res = []
-
- while work.length > textLen
- if work =~ patt
- res << $1
- work.slice!(0, $&.length)
- else
- res << work.slice!(0, textLen)
- end
- end
- res << work if work.length.nonzero?
- @output.puts(prefix + res.join("\n" + next_prefix))
- end
-
- def blankline
- @output.puts
- end
-
- ##
- # Called when we want to ensure a new 'wrap' starts on a newline. Only
- # needed for HtmlFormatter, because the rest do their own line breaking.
-
- def break_to_newline
- end
-
- def bold_print(txt)
- @output.print txt
- end
-
- def raw_print_line(txt)
- @output.print txt
- end
-
- ##
- # Convert HTML entities back to ASCII
-
- def conv_html(txt)
- txt = txt.gsub(/&gt;/, '>')
- txt.gsub!(/&lt;/, '<')
- txt.gsub!(/&quot;/, '"')
- txt.gsub!(/&amp;/, '&')
- txt
- end
-
- ##
- # Convert markup into display form
-
- def conv_markup(txt)
- txt = txt.gsub(%r{<tt>(.*?)</tt>}, '+\1+')
- txt.gsub!(%r{<code>(.*?)</code>}, '+\1+')
- txt.gsub!(%r{<b>(.*?)</b>}, '*\1*')
- txt.gsub!(%r{<em>(.*?)</em>}, '_\1_')
- txt
- end
-
- def display_list(list)
- case list.type
- when :BULLET
- prefixer = proc { |ignored| @indent + "* " }
-
- when :NUMBER, :UPPERALPHA, :LOWERALPHA then
- start = case list.type
- when :NUMBER then 1
- when :UPPERALPHA then 'A'
- when :LOWERALPHA then 'a'
- end
-
- prefixer = proc do |ignored|
- res = @indent + "#{start}.".ljust(4)
- start = start.succ
- res
- end
-
- when :LABELED, :NOTE then
- longest = 0
-
- list.contents.each do |item|
- if RDoc::Markup::Flow::LI === item and item.label.length > longest then
- longest = item.label.length
- end
- end
-
- longest += 1
-
- prefixer = proc { |li| @indent + li.label.ljust(longest) }
-
- else
- raise ArgumentError, "unknown list type #{list.type}"
- end
-
- list.contents.each do |item|
- if RDoc::Markup::Flow::LI === item then
- prefix = prefixer.call item
- display_flow_item item, prefix
- else
- display_flow_item item
- end
- end
- end
-
- def display_flow_item(item, prefix = @indent)
- case item
- when RDoc::Markup::Flow::P, RDoc::Markup::Flow::LI
- wrap(conv_html(item.body), prefix)
- blankline
-
- when RDoc::Markup::Flow::LIST
- display_list(item)
-
- when RDoc::Markup::Flow::VERB
- display_verbatim_flow_item(item, @indent)
-
- when RDoc::Markup::Flow::H
- display_heading(conv_html(item.text), item.level, @indent)
-
- when RDoc::Markup::Flow::RULE
- draw_line
-
- else
- raise RDoc::Error, "Unknown flow element: #{item.class}"
- end
- end
-
- def display_verbatim_flow_item(item, prefix=@indent)
- item.body.split(/\n/).each do |line|
- @output.print @indent, conv_html(line), "\n"
- end
- blankline
- end
-
- def display_heading(text, level, indent)
- text = strip_attributes text
-
- case level
- when 1 then
- ul = "=" * text.length
- @output.puts
- @output.puts text.upcase
- @output.puts ul
-
- when 2 then
- ul = "-" * text.length
- @output.puts
- @output.puts text
- @output.puts ul
- else
- @output.print indent, text, "\n"
- end
-
- @output.puts
- end
-
- def display_flow(flow)
- flow.each do |f|
- display_flow_item(f)
- end
- end
-
- def strip_attributes(text)
- text.gsub(/(<\/?(?:b|code|em|i|tt)>)/, '')
- end
-
-end
-
-##
-# Handle text with attributes. We're a base class: there are different
-# presentation classes (one, for example, uses overstrikes to handle bold and
-# underlining, while another using ANSI escape sequences.
-
-class RDoc::RI::AttributeFormatter < RDoc::RI::Formatter
-
- BOLD = 1
- ITALIC = 2
- CODE = 4
-
- ATTR_MAP = {
- "b" => BOLD,
- "code" => CODE,
- "em" => ITALIC,
- "i" => ITALIC,
- "tt" => CODE
- }
-
- AttrChar = Struct.new :char, :attr
-
- class AttributeString
- attr_reader :txt
-
- def initialize
- @txt = []
- @optr = 0
- end
-
- def <<(char)
- @txt << char
- end
-
- def empty?
- @optr >= @txt.length
- end
-
- # accept non space, then all following spaces
- def next_word
- start = @optr
- len = @txt.length
-
- while @optr < len && @txt[@optr].char != " "
- @optr += 1
- end
-
- while @optr < len && @txt[@optr].char == " "
- @optr += 1
- end
-
- @txt[start...@optr]
- end
- end
-
- ##
- # Overrides base class. Looks for <tt>...</tt> etc sequences and generates
- # an array of AttrChars. This array is then used as the basis for the
- # split.
-
- def wrap(txt, prefix=@indent, linelen=@width)
- return unless txt && !txt.empty?
-
- txt = add_attributes_to(txt)
- next_prefix = prefix.tr("^ ", " ")
- linelen -= prefix.size
-
- line = []
-
- until txt.empty?
- word = txt.next_word
- if word.size + line.size > linelen
- write_attribute_text(prefix, line)
- prefix = next_prefix
- line = []
- end
- line.concat(word)
- end
-
- write_attribute_text(prefix, line) if line.length > 0
- end
-
- protected
-
- def write_attribute_text(prefix, line)
- @output.print prefix
- line.each do |achar|
- @output.print achar.char
- end
- @output.puts
- end
-
- def bold_print(txt)
- @output.print txt
- end
-
- private
-
- def add_attributes_to(txt)
- tokens = txt.split(%r{(</?(?:b|code|em|i|tt)>)})
- text = AttributeString.new
- attributes = 0
- tokens.each do |tok|
- case tok
- when %r{^</(\w+)>$} then attributes &= ~(ATTR_MAP[$1]||0)
- when %r{^<(\w+)>$} then attributes |= (ATTR_MAP[$1]||0)
- else
- tok.split(//).each {|ch| text << AttrChar.new(ch, attributes)}
- end
- end
- text
- end
-
-end
-
-##
-# This formatter generates overstrike-style formatting, which works with
-# pagers such as man and less.
-
-class RDoc::RI::OverstrikeFormatter < RDoc::RI::AttributeFormatter
-
- BS = "\C-h"
-
- def write_attribute_text(prefix, line)
- @output.print prefix
-
- line.each do |achar|
- attr = achar.attr
- @output.print "_", BS if (attr & (ITALIC + CODE)) != 0
- @output.print achar.char, BS if (attr & BOLD) != 0
- @output.print achar.char
- end
-
- @output.puts
- end
-
- ##
- # Draw a string in bold
-
- def bold_print(text)
- text.split(//).each do |ch|
- @output.print ch, BS, ch
- end
- end
-
-end
-
-##
-# This formatter uses ANSI escape sequences to colorize stuff works with
-# pagers such as man and less.
-
-class RDoc::RI::AnsiFormatter < RDoc::RI::AttributeFormatter
-
- def initialize(*args)
- super
- @output.print "\033[0m"
- end
-
- def write_attribute_text(prefix, line)
- @output.print prefix
- curr_attr = 0
- line.each do |achar|
- attr = achar.attr
- if achar.attr != curr_attr
- update_attributes(achar.attr)
- curr_attr = achar.attr
- end
- @output.print achar.char
- end
- update_attributes(0) unless curr_attr.zero?
- @output.puts
- end
-
- def bold_print(txt)
- @output.print "\033[1m#{txt}\033[m"
- end
-
- HEADINGS = {
- 1 => ["\033[1;32m", "\033[m"],
- 2 => ["\033[4;32m", "\033[m"],
- 3 => ["\033[32m", "\033[m"],
- }
-
- def display_heading(text, level, indent)
- level = 3 if level > 3
- heading = HEADINGS[level]
- @output.print indent
- @output.print heading[0]
- @output.print strip_attributes(text)
- @output.puts heading[1]
- end
-
- private
-
- ATTR_MAP = {
- BOLD => "1",
- ITALIC => "33",
- CODE => "36"
- }
-
- def update_attributes(attr)
- str = "\033["
- for quality in [ BOLD, ITALIC, CODE]
- unless (attr & quality).zero?
- str << ATTR_MAP[quality]
- end
- end
- @output.print str, "m"
- end
-
-end
-
-##
-# This formatter uses HTML.
-
-class RDoc::RI::HtmlFormatter < RDoc::RI::AttributeFormatter
-
- def write_attribute_text(prefix, line)
- curr_attr = 0
- line.each do |achar|
- attr = achar.attr
- if achar.attr != curr_attr
- update_attributes(curr_attr, achar.attr)
- curr_attr = achar.attr
- end
- @output.print(escape(achar.char))
- end
- update_attributes(curr_attr, 0) unless curr_attr.zero?
- end
-
- def draw_line(label=nil)
- if label != nil
- bold_print(label)
- end
- @output.puts("<hr>")
- end
-
- def bold_print(txt)
- tag("b") { txt }
- end
-
- def blankline()
- @output.puts("<p>")
- end
-
- def break_to_newline
- @output.puts("<br>")
- end
-
- def display_heading(text, level, indent)
- level = 4 if level > 4
- tag("h#{level}") { text }
- @output.puts
- end
-
- def display_list(list)
- case list.type
- when :BULLET then
- list_type = "ul"
- prefixer = proc { |ignored| "<li>" }
-
- when :NUMBER, :UPPERALPHA, :LOWERALPHA then
- list_type = "ol"
- prefixer = proc { |ignored| "<li>" }
-
- when :LABELED then
- list_type = "dl"
- prefixer = proc do |li|
- "<dt><b>" + escape(li.label) + "</b><dd>"
- end
-
- when :NOTE then
- list_type = "table"
- prefixer = proc do |li|
- %{<tr valign="top"><td>#{li.label.gsub(/ /, '&nbsp;')}</td><td>}
- end
- else
- fail "unknown list type"
- end
-
- @output.print "<#{list_type}>"
- list.contents.each do |item|
- if item.kind_of? RDoc::Markup::Flow::LI
- prefix = prefixer.call(item)
- @output.print prefix
- display_flow_item(item, prefix)
- else
- display_flow_item(item)
- end
- end
- @output.print "</#{list_type}>"
- end
-
- def display_verbatim_flow_item(item, prefix=@indent)
- @output.print("<pre>")
- item.body.split(/\n/).each do |line|
- @output.puts conv_html(line)
- end
- @output.puts("</pre>")
- end
-
- private
-
- ATTR_MAP = {
- BOLD => "b>",
- ITALIC => "i>",
- CODE => "tt>"
- }
-
- def update_attributes(current, wanted)
- str = ""
- # first turn off unwanted ones
- off = current & ~wanted
- for quality in [ BOLD, ITALIC, CODE]
- if (off & quality) > 0
- str << "</" + ATTR_MAP[quality]
- end
- end
-
- # now turn on wanted
- for quality in [ BOLD, ITALIC, CODE]
- unless (wanted & quality).zero?
- str << "<" << ATTR_MAP[quality]
- end
- end
- @output.print str
- end
-
- def tag(code)
- @output.print("<#{code}>")
- @output.print(yield)
- @output.print("</#{code}>")
- end
-
- def escape(str)
- str = str.gsub(/&/n, '&amp;')
- str.gsub!(/\"/n, '&quot;')
- str.gsub!(/>/n, '&gt;')
- str.gsub!(/</n, '&lt;')
- str
- end
-
-end
-
-##
-# This formatter reduces extra lines for a simpler output. It improves way
-# output looks for tools like IRC bots.
-
-class RDoc::RI::SimpleFormatter < RDoc::RI::Formatter
-
- ##
- # No extra blank lines
-
- def blankline
- end
-
- ##
- # Display labels only, no lines
-
- def draw_line(label=nil)
- unless label.nil? then
- bold_print(label)
- @output.puts
- end
- end
-
- ##
- # Place heading level indicators inline with heading.
-
- def display_heading(text, level, indent)
- text = strip_attributes(text)
- case level
- when 1
- @output.puts "= " + text.upcase
- when 2
- @output.puts "-- " + text
- else
- @output.print indent, text, "\n"
- end
- end
-
-end
-
-RDoc::RI::Formatter::FORMATTERS['plain'] = RDoc::RI::Formatter
-RDoc::RI::Formatter::FORMATTERS['simple'] = RDoc::RI::SimpleFormatter
-RDoc::RI::Formatter::FORMATTERS['bs'] = RDoc::RI::OverstrikeFormatter
-RDoc::RI::Formatter::FORMATTERS['ansi'] = RDoc::RI::AnsiFormatter
-RDoc::RI::Formatter::FORMATTERS['html'] = RDoc::RI::HtmlFormatter
diff --git a/lib/rdoc/ri/paths.rb b/lib/rdoc/ri/paths.rb
deleted file mode 100644
index bce71b46f0..0000000000
--- a/lib/rdoc/ri/paths.rb
+++ /dev/null
@@ -1,105 +0,0 @@
-require 'rdoc/ri'
-
-##
-# Encapsulate all the strangeness to do with finding out where to find RDoc
-# files
-#
-# We basically deal with three directories:
-#
-# 1. The 'system' documentation directory, which holds the documentation
-# distributed with Ruby, and which is managed by the Ruby install process
-# 2. The 'site' directory, which contains site-wide documentation added
-# locally.
-# 3. The 'user' documentation directory, stored under the user's own home
-# directory.
-#
-# There's contention about all this, but for now:
-#
-# system:: $datadir/ri/<ver>/system/...
-# site:: $datadir/ri/<ver>/site/...
-# user:: ~/.rdoc
-
-module RDoc::RI::Paths
-
- #:stopdoc:
- require 'rbconfig'
-
- DOC_DIR = "doc/rdoc"
-
- VERSION = RbConfig::CONFIG['ruby_version']
-
- if VERSION > '1.9.1'
- if m = /ruby/.match(RbConfig::CONFIG['RUBY_INSTALL_NAME'])
- m = [m.pre_match, m.post_match]
- else
- m = [""] * 2
- end
- ri = "#{m[0]}ri#{m[1]}"
- rdoc = "#{m[0]}rdoc#{m[1]}"
- base = File.join(RbConfig::CONFIG['datadir'], ri, VERSION)
- else
- if m = /ruby/.match(RbConfig::CONFIG['RUBY_BASE_NAME'])
- m = [m.pre_match, m.post_match]
- else
- m = [""] * 2
- end
- ri = "#{m[0]}ri#{m[1]}"
- rdoc = "#{m[0]}rdoc#{m[1]}"
- base = File.join(RbConfig::CONFIG['ridir'], VERSION)
- end
- SYSDIR = File.join(base, "system")
- SITEDIR = File.join(base, "site")
- HOMEDIR = (File.expand_path("~/.#{rdoc}") rescue nil)
-
- begin
- require 'rubygems' unless defined?(Gem) and defined?(Gem::Enable) and
- Gem::Enable
-
- # HACK dup'd from Gem.latest_partials and friends
- all_paths = []
-
- all_paths = Gem.path.map do |dir|
- Dir[File.join(dir, 'doc', '*', 'ri')]
- end.flatten
-
- ri_paths = {}
-
- all_paths.each do |dir|
- base = File.basename File.dirname(dir)
- if base =~ /(.*)-((\d+\.)*\d+)/ then
- name, version = $1, $2
- ver = Gem::Version.new version
- if ri_paths[name].nil? or ver > ri_paths[name][0] then
- ri_paths[name] = [ver, dir]
- end
- end
- end
-
- GEMDIRS = ri_paths.map { |k,v| v.last }.sort
- rescue LoadError
- GEMDIRS = []
- end
-
- # Returns the selected documentation directories as an Array, or PATH if no
- # overriding directories were given.
-
- def self.path(use_system, use_site, use_home, use_gems, *extra_dirs)
- path = raw_path(use_system, use_site, use_home, use_gems, *extra_dirs)
- return path.select { |directory| File.directory? directory }
- end
-
- # Returns the selected documentation directories including nonexistent
- # directories. Used to print out what paths were searched if no ri was
- # found.
-
- def self.raw_path(use_system, use_site, use_home, use_gems, *extra_dirs)
- path = []
- path << extra_dirs unless extra_dirs.empty?
- path << SYSDIR if use_system
- path << SITEDIR if use_site
- path << HOMEDIR if use_home
- path << GEMDIRS if use_gems
-
- return path.flatten.compact
- end
-end
diff --git a/lib/rdoc/ri/reader.rb b/lib/rdoc/ri/reader.rb
deleted file mode 100644
index de3c8d9afa..0000000000
--- a/lib/rdoc/ri/reader.rb
+++ /dev/null
@@ -1,106 +0,0 @@
-require 'rdoc/ri'
-require 'rdoc/ri/descriptions'
-require 'rdoc/ri/writer'
-require 'rdoc/markup/to_flow'
-
-class RDoc::RI::Reader
-
- def initialize(ri_cache)
- @cache = ri_cache
- end
-
- def top_level_namespace
- [ @cache.toplevel ]
- end
-
- def lookup_namespace_in(target, namespaces)
- result = []
- for n in namespaces
- result.concat(n.contained_modules_matching(target))
- end
- result
- end
-
- def find_class_by_name(full_name)
- names = full_name.split(/::/)
- ns = @cache.toplevel
- for name in names
- ns = ns.contained_class_named(name)
- return nil if ns.nil?
- end
- get_class(ns)
- end
-
- def find_methods(name, is_class_method, namespaces)
- result = []
- namespaces.each do |ns|
- result.concat ns.methods_matching(name, is_class_method)
- end
- result
- end
-
- ##
- # Return the MethodDescription for a given MethodEntry by deserializing the
- # YAML
-
- def get_method(method_entry)
- path = method_entry.path_name
- File.open(path) { |f| RDoc::RI::Description.deserialize(f) }
- end
-
- ##
- # Return a class description
-
- def get_class(class_entry)
- result = nil
- for path in class_entry.path_names
- path = RDoc::RI::Writer.class_desc_path(path, class_entry)
- desc = File.open(path) {|f| RDoc::RI::Description.deserialize(f) }
- if result
- result.merge_in(desc)
- else
- result = desc
- end
- end
- result
- end
-
- ##
- # Return the names of all classes and modules
-
- def full_class_names
- res = []
- find_classes_in(res, @cache.toplevel)
- end
-
- ##
- # Return a list of all classes, modules, and methods
-
- def all_names
- res = []
- find_names_in(res, @cache.toplevel)
- end
-
- private
-
- def find_classes_in(res, klass)
- classes = klass.classes_and_modules
- for c in classes
- res << c.full_name
- find_classes_in(res, c)
- end
- res
- end
-
- def find_names_in(res, klass)
- classes = klass.classes_and_modules
- for c in classes
- res << c.full_name
- res.concat c.all_method_names
- find_names_in(res, c)
- end
- res
- end
-
-end
-
diff --git a/lib/rdoc/ri/ri_cache.rb b/lib/rdoc/ri/ri_cache.rb
new file mode 100644
index 0000000000..1844ac969e
--- /dev/null
+++ b/lib/rdoc/ri/ri_cache.rb
@@ -0,0 +1,187 @@
+module RI
+
+ class ClassEntry
+
+ attr_reader :name
+ attr_reader :path_names
+
+ def initialize(path_name, name, in_class)
+ @path_names = [ path_name ]
+ @name = name
+ @in_class = in_class
+ @class_methods = []
+ @instance_methods = []
+ @inferior_classes = []
+ end
+
+ # We found this class in more tha one place, so add
+ # in the name from there.
+ def add_path(path)
+ @path_names << path
+ end
+
+ # read in our methods and any classes
+ # and modules in our namespace. Methods are
+ # stored in files called name-c|i.yaml,
+ # where the 'name' portion is the external
+ # form of the method name and the c|i is a class|instance
+ # flag
+
+ def load_from(dir)
+ Dir.foreach(dir) do |name|
+ next if name =~ /^\./
+
+ # convert from external to internal form, and
+ # extract the instance/class flag
+
+ if name =~ /^(.*?)-(c|i).yaml$/
+ external_name = $1
+ is_class_method = $2 == "c"
+ internal_name = RiWriter.external_to_internal(external_name)
+ list = is_class_method ? @class_methods : @instance_methods
+ path = File.join(dir, name)
+ list << MethodEntry.new(path, internal_name, is_class_method, self)
+ else
+ full_name = File.join(dir, name)
+ if File.directory?(full_name)
+ inf_class = @inferior_classes.find {|c| c.name == name }
+ if inf_class
+ inf_class.add_path(full_name)
+ else
+ inf_class = ClassEntry.new(full_name, name, self)
+ @inferior_classes << inf_class
+ end
+ inf_class.load_from(full_name)
+ end
+ end
+ end
+ end
+
+ # Return a list of any classes or modules that we contain
+ # that match a given string
+
+ def contained_modules_matching(name)
+ @inferior_classes.find_all {|c| c.name[name]}
+ end
+
+ def classes_and_modules
+ @inferior_classes
+ end
+
+ # Return an exact match to a particular name
+ def contained_class_named(name)
+ @inferior_classes.find {|c| c.name == name}
+ end
+
+ # return the list of local methods matching name
+ # We're split into two because we need distinct behavior
+ # when called from the _toplevel_
+ def methods_matching(name, is_class_method)
+ local_methods_matching(name, is_class_method)
+ end
+
+ # Find methods matching 'name' in ourselves and in
+ # any classes we contain
+ def recursively_find_methods_matching(name, is_class_method)
+ res = local_methods_matching(name, is_class_method)
+ @inferior_classes.each do |c|
+ res.concat(c.recursively_find_methods_matching(name, is_class_method))
+ end
+ res
+ end
+
+
+ # Return our full name
+ def full_name
+ res = @in_class.full_name
+ res << "::" unless res.empty?
+ res << @name
+ end
+
+ # Return a list of all out method names
+ def all_method_names
+ res = @class_methods.map {|m| m.full_name }
+ @instance_methods.each {|m| res << m.full_name}
+ res
+ end
+
+ private
+
+ # Return a list of all our methods matching a given string.
+ # Is +is_class_methods+ if 'nil', we don't care if the method
+ # is a class method or not, otherwise we only return
+ # those methods that match
+ def local_methods_matching(name, is_class_method)
+
+ list = case is_class_method
+ when nil then @class_methods + @instance_methods
+ when true then @class_methods
+ when false then @instance_methods
+ else fail "Unknown is_class_method: #{is_class_method.inspect}"
+ end
+
+ list.find_all {|m| m.name; m.name[name]}
+ end
+ end
+
+ # A TopLevelEntry is like a class entry, but when asked to search
+ # for methods searches all classes, not just itself
+
+ class TopLevelEntry < ClassEntry
+ def methods_matching(name, is_class_method)
+ res = recursively_find_methods_matching(name, is_class_method)
+ end
+
+ def full_name
+ ""
+ end
+
+ def module_named(name)
+
+ end
+
+ end
+
+ class MethodEntry
+ attr_reader :name
+ attr_reader :path_name
+
+ def initialize(path_name, name, is_class_method, in_class)
+ @path_name = path_name
+ @name = name
+ @is_class_method = is_class_method
+ @in_class = in_class
+ end
+
+ def full_name
+ res = @in_class.full_name
+ unless res.empty?
+ if @is_class_method
+ res << "::"
+ else
+ res << "#"
+ end
+ end
+ res << @name
+ end
+ end
+
+ # We represent everything know about all 'ri' files
+ # accessible to this program
+
+ class RiCache
+
+ attr_reader :toplevel
+
+ def initialize(dirs)
+ # At the top level we have a dummy module holding the
+ # overall namespace
+ @toplevel = TopLevelEntry.new('', '::', nil)
+
+ dirs.each do |dir|
+ @toplevel.load_from(dir)
+ end
+ end
+
+ end
+end
diff --git a/lib/rdoc/ri/ri_descriptions.rb b/lib/rdoc/ri/ri_descriptions.rb
new file mode 100644
index 0000000000..e5ea9f2fbf
--- /dev/null
+++ b/lib/rdoc/ri/ri_descriptions.rb
@@ -0,0 +1,154 @@
+require 'yaml'
+require 'rdoc/markup/simple_markup/fragments'
+
+# Descriptions are created by RDoc (in ri_generator) and
+# written out in serialized form into the documentation
+# tree. ri then reads these to generate the documentation
+
+module RI
+ class NamedThing
+ attr_reader :name
+ def initialize(name)
+ @name = name
+ end
+ def <=>(other)
+ @name <=> other.name
+ end
+
+ def hash
+ @name.hash
+ end
+
+ def eql?(other)
+ @name.eql?(other)
+ end
+ end
+
+# Alias = Struct.new(:old_name, :new_name)
+
+ class AliasName < NamedThing
+ end
+
+ class Attribute < NamedThing
+ attr_reader :rw, :comment
+ def initialize(name, rw, comment)
+ super(name)
+ @rw = rw
+ @comment = comment
+ end
+ end
+
+ class Constant < NamedThing
+ attr_reader :value, :comment
+ def initialize(name, value, comment)
+ super(name)
+ @value = value
+ @comment = comment
+ end
+ end
+
+ class IncludedModule < NamedThing
+ end
+
+
+ class MethodSummary < NamedThing
+ def initialize(name="")
+ super
+ end
+ end
+
+
+
+ class Description
+ attr_accessor :name
+ attr_accessor :full_name
+ attr_accessor :comment
+
+ def serialize
+ self.to_yaml
+ end
+
+ def Description.deserialize(from)
+ YAML.load(from)
+ end
+
+ def <=>(other)
+ @name <=> other.name
+ end
+ end
+
+ class ModuleDescription < Description
+
+ attr_accessor :class_methods
+ attr_accessor :instance_methods
+ attr_accessor :attributes
+ attr_accessor :constants
+ attr_accessor :includes
+
+ # merge in another class desscription into this one
+ def merge_in(old)
+ merge(@class_methods, old.class_methods)
+ merge(@instance_methods, old.instance_methods)
+ merge(@attributes, old.attributes)
+ merge(@constants, old.constants)
+ merge(@includes, old.includes)
+ if @comment.nil? || @comment.empty?
+ @comment = old.comment
+ else
+ unless old.comment.nil? or old.comment.empty? then
+ @comment << SM::Flow::RULE.new
+ @comment.concat old.comment
+ end
+ end
+ end
+
+ def display_name
+ "Module"
+ end
+
+ # the 'ClassDescription' subclass overrides this
+ # to format up the name of a parent
+ def superclass_string
+ nil
+ end
+
+ private
+
+ def merge(into, from)
+ names = {}
+ into.each {|i| names[i.name] = i }
+ from.each {|i| names[i.name] = i }
+ into.replace(names.keys.sort.map {|n| names[n]})
+ end
+ end
+
+ class ClassDescription < ModuleDescription
+ attr_accessor :superclass
+
+ def display_name
+ "Class"
+ end
+
+ def superclass_string
+ if @superclass && @superclass != "Object"
+ @superclass
+ else
+ nil
+ end
+ end
+ end
+
+
+ class MethodDescription < Description
+
+ attr_accessor :is_class_method
+ attr_accessor :visibility
+ attr_accessor :block_params
+ attr_accessor :is_singleton
+ attr_accessor :aliases
+ attr_accessor :is_alias_for
+ attr_accessor :params
+
+ end
+
+end
diff --git a/lib/rdoc/ri/ri_display.rb b/lib/rdoc/ri/ri_display.rb
new file mode 100644
index 0000000000..67962fc2c1
--- /dev/null
+++ b/lib/rdoc/ri/ri_display.rb
@@ -0,0 +1,255 @@
+require 'rdoc/ri/ri_util'
+require 'rdoc/ri/ri_formatter'
+require 'rdoc/ri/ri_options'
+
+
+# This is a kind of 'flag' module. If you want to write your
+# own 'ri' display module (perhaps because you'r writing
+# an IDE or somesuch beast), you simply write a class
+# which implements the various 'display' methods in 'DefaultDisplay',
+# and include the 'RiDisplay' module in that class.
+#
+# To access your class from the command line, you can do
+#
+# ruby -r <your source file> ../ri ....
+#
+# If folks _really_ want to do this from the command line,
+# I'll build an option in
+
+module RiDisplay
+ @@display_class = nil
+
+ def RiDisplay.append_features(display_class)
+ @@display_class = display_class
+ end
+
+ def RiDisplay.new(*args)
+ @@display_class.new(*args)
+ end
+end
+
+######################################################################
+#
+# A paging display module. Uses the ri_formatter class to do the
+# actual presentation
+#
+
+class DefaultDisplay
+
+ include RiDisplay
+
+ def initialize(options)
+ @options = options
+ @formatter = @options.formatter.new(@options, " ")
+ end
+
+
+ ######################################################################
+
+ def display_usage
+ page do
+ RI::Options::OptionList.usage(short_form=true)
+ end
+ end
+
+
+ ######################################################################
+
+ def display_method_info(method)
+ page do
+ @formatter.draw_line(method.full_name)
+ display_params(method)
+ @formatter.draw_line
+ display_flow(method.comment)
+ if method.aliases && !method.aliases.empty?
+ @formatter.blankline
+ aka = "(also known as "
+ aka << method.aliases.map {|a| a.name }.join(", ")
+ aka << ")"
+ @formatter.wrap(aka)
+ end
+ end
+ end
+
+ ######################################################################
+
+ def display_class_info(klass, ri_reader)
+ page do
+ superclass = klass.superclass_string
+
+ if superclass
+ superclass = " < " + superclass
+ else
+ superclass = ""
+ end
+
+ @formatter.draw_line(klass.display_name + ": " +
+ klass.full_name + superclass)
+
+ display_flow(klass.comment)
+ @formatter.draw_line
+
+ unless klass.includes.empty?
+ @formatter.blankline
+ @formatter.display_heading("Includes:", 2, "")
+ incs = []
+ klass.includes.each do |inc|
+ inc_desc = ri_reader.find_class_by_name(inc.name)
+ if inc_desc
+ str = inc.name + "("
+ str << inc_desc.instance_methods.map{|m| m.name}.join(", ")
+ str << ")"
+ incs << str
+ else
+ incs << inc.name
+ end
+ end
+ @formatter.wrap(incs.sort.join(', '))
+ end
+
+ unless klass.constants.empty?
+ @formatter.blankline
+ @formatter.display_heading("Constants:", 2, "")
+ len = 0
+ klass.constants.each { |c| len = c.name.length if c.name.length > len }
+ len += 2
+ klass.constants.each do |c|
+ @formatter.wrap(c.value,
+ @formatter.indent+((c.name+":").ljust(len)))
+ end
+ end
+
+ unless klass.class_methods.empty?
+ @formatter.blankline
+ @formatter.display_heading("Class methods:", 2, "")
+ @formatter.wrap(klass.class_methods.map{|m| m.name}.sort.join(', '))
+ end
+
+ unless klass.instance_methods.empty?
+ @formatter.blankline
+ @formatter.display_heading("Instance methods:", 2, "")
+ @formatter.wrap(klass.instance_methods.map{|m| m.name}.sort.join(', '))
+ end
+
+ unless klass.attributes.empty?
+ @formatter.blankline
+ @formatter.wrap("Attributes:", "")
+ @formatter.wrap(klass.attributes.map{|a| a.name}.sort.join(', '))
+ end
+ end
+ end
+
+ ######################################################################
+
+ # Display a list of method names
+
+ def display_method_list(methods)
+ page do
+ puts "More than one method matched your request. You can refine"
+ puts "your search by asking for information on one of:\n\n"
+ @formatter.wrap(methods.map {|m| m.full_name} .join(", "))
+ end
+ end
+
+ ######################################################################
+
+ def display_class_list(namespaces)
+ page do
+ puts "More than one class or module matched your request. You can refine"
+ puts "your search by asking for information on one of:\n\n"
+ @formatter.wrap(namespaces.map {|m| m.full_name}.join(", "))
+ end
+ end
+
+ ######################################################################
+
+ def list_known_classes(classes)
+ if classes.empty?
+ warn_no_database
+ else
+ page do
+ @formatter.draw_line("Known classes and modules")
+ @formatter.blankline
+ @formatter.wrap(classes.sort.join(", "))
+ end
+ end
+ end
+
+ ######################################################################
+
+ def list_known_names(names)
+ if names.empty?
+ warn_no_database
+ else
+ page do
+ names.each {|n| @formatter.raw_print_line(n)}
+ end
+ end
+ end
+
+ ######################################################################
+
+ private
+
+ ######################################################################
+
+ def page
+ return yield unless pager = setup_pager
+ begin
+ save_stdout = STDOUT.clone
+ STDOUT.reopen(pager)
+ yield
+ ensure
+ STDOUT.reopen(save_stdout)
+ save_stdout.close
+ pager.close
+ end
+ end
+
+ ######################################################################
+
+ def setup_pager
+ unless @options.use_stdout
+ for pager in [ ENV['PAGER'], "less", "more", 'pager' ].compact.uniq
+ return IO.popen(pager, "w") rescue nil
+ end
+ @options.use_stdout = true
+ nil
+ end
+ end
+
+ ######################################################################
+
+ def display_params(method)
+
+ params = method.params
+
+ if params[0,1] == "("
+ if method.is_singleton
+ params = method.full_name + params
+ else
+ params = method.name + params
+ end
+ end
+ params.split(/\n/).each do |p|
+ @formatter.wrap(p)
+ @formatter.break_to_newline
+ end
+ end
+ ######################################################################
+
+ def display_flow(flow)
+ if !flow || flow.empty?
+ @formatter.wrap("(no description...)")
+ else
+ @formatter.display_flow(flow)
+ end
+ end
+
+ ######################################################################
+
+ def warn_no_database
+ puts "Before using ri, you need to generate documentation"
+ puts "using 'rdoc' with the --ri option"
+ end
+end # class RiDisplay
diff --git a/lib/rdoc/ri/ri_driver.rb b/lib/rdoc/ri/ri_driver.rb
new file mode 100644
index 0000000000..a00f20ee3b
--- /dev/null
+++ b/lib/rdoc/ri/ri_driver.rb
@@ -0,0 +1,143 @@
+require 'rdoc/ri/ri_paths'
+require 'rdoc/usage'
+require 'rdoc/ri/ri_cache'
+require 'rdoc/ri/ri_util'
+require 'rdoc/ri/ri_reader'
+require 'rdoc/ri/ri_formatter'
+require 'rdoc/ri/ri_options'
+
+
+######################################################################
+
+class RiDriver
+
+ def initialize
+ @options = RI::Options.instance
+
+ args = ARGV
+ if ENV["RI"]
+ args = ENV["RI"].split.concat(ARGV)
+ end
+
+ @options.parse(args)
+
+ path = @options.path
+ report_missing_documentation @options.raw_path if path.empty?
+
+ @ri_reader = RI::RiReader.new(RI::RiCache.new(path))
+ @display = @options.displayer
+ end
+
+ # Couldn't find documentation in +path+, so tell the user what to do
+
+ def report_missing_documentation(path)
+ STDERR.puts "No ri documentation found in:"
+ path.each do |d|
+ STDERR.puts " #{d}"
+ end
+ STDERR.puts "\nWas rdoc run to create documentation?\n\n"
+ RDoc::usage("Installing Documentation")
+ end
+
+ ######################################################################
+
+ # If the list of matching methods contains exactly one entry, or
+ # if it contains an entry that exactly matches the requested method,
+ # then display that entry, otherwise display the list of
+ # matching method names
+
+ def report_method_stuff(requested_method_name, methods)
+ if methods.size == 1
+ method = @ri_reader.get_method(methods[0])
+ @display.display_method_info(method)
+ else
+ entries = methods.find_all {|m| m.name == requested_method_name}
+ if entries.size == 1
+ method = @ri_reader.get_method(entries[0])
+ @display.display_method_info(method)
+ else
+ @display.display_method_list(methods)
+ end
+ end
+ end
+
+ ######################################################################
+
+ def report_class_stuff(namespaces)
+ if namespaces.size == 1
+ klass = @ri_reader.get_class(namespaces[0])
+ @display.display_class_info(klass, @ri_reader)
+ else
+# entries = namespaces.find_all {|m| m.full_name == requested_class_name}
+# if entries.size == 1
+# klass = @ri_reader.get_class(entries[0])
+# @display.display_class_info(klass, @ri_reader)
+# else
+ @display.display_class_list(namespaces)
+# end
+ end
+ end
+
+ ######################################################################
+
+
+ def get_info_for(arg)
+ desc = NameDescriptor.new(arg)
+
+ namespaces = @ri_reader.top_level_namespace
+
+ for class_name in desc.class_names
+ namespaces = @ri_reader.lookup_namespace_in(class_name, namespaces)
+ if namespaces.empty?
+ raise RiError.new("Nothing known about #{arg}")
+ end
+ end
+
+ # at this point, if we have multiple possible namespaces, but one
+ # is an exact match for our requested class, prune down to just it
+
+ full_class_name = desc.full_class_name
+ entries = namespaces.find_all {|m| m.full_name == full_class_name}
+ namespaces = entries if entries.size == 1
+
+ if desc.method_name.nil?
+ report_class_stuff(namespaces)
+ else
+ methods = @ri_reader.find_methods(desc.method_name,
+ desc.is_class_method,
+ namespaces)
+
+ if methods.empty?
+ raise RiError.new("Nothing known about #{arg}")
+ else
+ report_method_stuff(desc.method_name, methods)
+ end
+ end
+ end
+
+ ######################################################################
+
+ def process_args
+ if @options.list_classes
+ classes = @ri_reader.full_class_names
+ @display.list_known_classes(classes)
+ elsif @options.list_names
+ names = @ri_reader.all_names
+ @display.list_known_names(names)
+ else
+ if ARGV.size.zero?
+ @display.display_usage
+ else
+ begin
+ ARGV.each do |arg|
+ get_info_for(arg)
+ end
+ rescue RiError => e
+ STDERR.puts(e.message)
+ exit(1)
+ end
+ end
+ end
+ end
+
+end # class RiDriver
diff --git a/lib/rdoc/ri/ri_formatter.rb b/lib/rdoc/ri/ri_formatter.rb
new file mode 100644
index 0000000000..34eb561ca3
--- /dev/null
+++ b/lib/rdoc/ri/ri_formatter.rb
@@ -0,0 +1,672 @@
+module RI
+ class TextFormatter
+
+ attr_reader :indent
+
+ def initialize(options, indent)
+ @options = options
+ @width = options.width
+ @indent = indent
+ end
+
+
+ ######################################################################
+
+ def draw_line(label=nil)
+ len = @width
+ len -= (label.size+1) if label
+ print "-"*len
+ if label
+ print(" ")
+ bold_print(label)
+ end
+ puts
+ end
+
+ ######################################################################
+
+ def wrap(txt, prefix=@indent, linelen=@width)
+ return unless txt && !txt.empty?
+ work = conv_markup(txt)
+ textLen = linelen - prefix.length
+ patt = Regexp.new("^(.{0,#{textLen}})[ \n]")
+ next_prefix = prefix.tr("^ ", " ")
+
+ res = []
+
+ while work.length > textLen
+ if work =~ patt
+ res << $1
+ work.slice!(0, $&.length)
+ else
+ res << work.slice!(0, textLen)
+ end
+ end
+ res << work if work.length.nonzero?
+ puts(prefix + res.join("\n" + next_prefix))
+ end
+
+ ######################################################################
+
+ def blankline
+ puts
+ end
+
+ ######################################################################
+
+ # called when we want to ensure a nbew 'wrap' starts on a newline
+ # Only needed for HtmlFormatter, because the rest do their
+ # own line breaking
+
+ def break_to_newline
+ end
+
+ ######################################################################
+
+ def bold_print(txt)
+ print txt
+ end
+
+ ######################################################################
+
+ def raw_print_line(txt)
+ puts txt
+ end
+
+ ######################################################################
+
+ # convert HTML entities back to ASCII
+ def conv_html(txt)
+ txt.
+ gsub(/&gt;/, '>').
+ gsub(/&lt;/, '<').
+ gsub(/&quot;/, '"').
+ gsub(/&amp;/, '&')
+
+ end
+
+ # convert markup into display form
+ def conv_markup(txt)
+ txt.
+ gsub(%r{<tt>(.*?)</tt>}) { "+#$1+" } .
+ gsub(%r{<code>(.*?)</code>}) { "+#$1+" } .
+ gsub(%r{<b>(.*?)</b>}) { "*#$1*" } .
+ gsub(%r{<em>(.*?)</em>}) { "_#$1_" }
+ end
+
+ ######################################################################
+
+ def display_list(list)
+ case list.type
+
+ when SM::ListBase::BULLET
+ prefixer = proc { |ignored| @indent + "* " }
+
+ when SM::ListBase::NUMBER,
+ SM::ListBase::UPPERALPHA,
+ SM::ListBase::LOWERALPHA
+
+ start = case list.type
+ when SM::ListBase::NUMBER then 1
+ when SM::ListBase::UPPERALPHA then 'A'
+ when SM::ListBase::LOWERALPHA then 'a'
+ end
+ prefixer = proc do |ignored|
+ res = @indent + "#{start}.".ljust(4)
+ start = start.succ
+ res
+ end
+
+ when SM::ListBase::LABELED
+ prefixer = proc do |li|
+ li.label
+ end
+
+ when SM::ListBase::NOTE
+ longest = 0
+ list.contents.each do |item|
+ if item.kind_of?(SM::Flow::LI) && item.label.length > longest
+ longest = item.label.length
+ end
+ end
+
+ prefixer = proc do |li|
+ @indent + li.label.ljust(longest+1)
+ end
+
+ else
+ fail "unknown list type"
+
+ end
+
+ list.contents.each do |item|
+ if item.kind_of? SM::Flow::LI
+ prefix = prefixer.call(item)
+ display_flow_item(item, prefix)
+ else
+ display_flow_item(item)
+ end
+ end
+ end
+
+ ######################################################################
+
+ def display_flow_item(item, prefix=@indent)
+ case item
+ when SM::Flow::P, SM::Flow::LI
+ wrap(conv_html(item.body), prefix)
+ blankline
+
+ when SM::Flow::LIST
+ display_list(item)
+
+ when SM::Flow::VERB
+ display_verbatim_flow_item(item, @indent)
+
+ when SM::Flow::H
+ display_heading(conv_html(item.text), item.level, @indent)
+
+ when SM::Flow::RULE
+ draw_line
+
+ else
+ fail "Unknown flow element: #{item.class}"
+ end
+ end
+
+ ######################################################################
+
+ def display_verbatim_flow_item(item, prefix=@indent)
+ item.body.split(/\n/).each do |line|
+ print @indent, conv_html(line), "\n"
+ end
+ blankline
+ end
+
+ ######################################################################
+
+ def display_heading(text, level, indent)
+ text = strip_attributes(text)
+ case level
+ when 1
+ ul = "=" * text.length
+ puts
+ puts text.upcase
+ puts ul
+# puts
+
+ when 2
+ ul = "-" * text.length
+ puts
+ puts text
+ puts ul
+# puts
+ else
+ print indent, text, "\n"
+ end
+ end
+
+
+ def display_flow(flow)
+ flow.each do |f|
+ display_flow_item(f)
+ end
+ end
+
+ def strip_attributes(txt)
+ tokens = txt.split(%r{(</?(?:b|code|em|i|tt)>)})
+ text = []
+ attributes = 0
+ tokens.each do |tok|
+ case tok
+ when %r{^</(\w+)>$}, %r{^<(\w+)>$}
+ ;
+ else
+ text << tok
+ end
+ end
+ text.join
+ end
+
+
+ end
+
+
+ ######################################################################
+ # Handle text with attributes. We're a base class: there are
+ # different presentation classes (one, for example, uses overstrikes
+ # to handle bold and underlining, while another using ANSI escape
+ # sequences
+
+ class AttributeFormatter < TextFormatter
+
+ BOLD = 1
+ ITALIC = 2
+ CODE = 4
+
+ ATTR_MAP = {
+ "b" => BOLD,
+ "code" => CODE,
+ "em" => ITALIC,
+ "i" => ITALIC,
+ "tt" => CODE
+ }
+
+ # TODO: struct?
+ class AttrChar
+ attr_reader :char
+ attr_reader :attr
+
+ def initialize(char, attr)
+ @char = char
+ @attr = attr
+ end
+ end
+
+
+ class AttributeString
+ attr_reader :txt
+
+ def initialize
+ @txt = []
+ @optr = 0
+ end
+
+ def <<(char)
+ @txt << char
+ end
+
+ def empty?
+ @optr >= @txt.length
+ end
+
+ # accept non space, then all following spaces
+ def next_word
+ start = @optr
+ len = @txt.length
+
+ while @optr < len && @txt[@optr].char != " "
+ @optr += 1
+ end
+
+ while @optr < len && @txt[@optr].char == " "
+ @optr += 1
+ end
+
+ @txt[start...@optr]
+ end
+ end
+
+ ######################################################################
+ # overrides base class. Looks for <tt>...</tt> etc sequences
+ # and generates an array of AttrChars. This array is then used
+ # as the basis for the split
+
+ def wrap(txt, prefix=@indent, linelen=@width)
+ return unless txt && !txt.empty?
+
+ txt = add_attributes_to(txt)
+ next_prefix = prefix.tr("^ ", " ")
+ linelen -= prefix.size
+
+ line = []
+
+ until txt.empty?
+ word = txt.next_word
+ if word.size + line.size > linelen
+ write_attribute_text(prefix, line)
+ prefix = next_prefix
+ line = []
+ end
+ line.concat(word)
+ end
+
+ write_attribute_text(prefix, line) if line.length > 0
+ end
+
+ protected
+
+ # overridden in specific formatters
+
+ def write_attribute_text(prefix, line)
+ print prefix
+ line.each do |achar|
+ print achar.char
+ end
+ puts
+ end
+
+ # again, overridden
+
+ def bold_print(txt)
+ print txt
+ end
+
+ private
+
+ def add_attributes_to(txt)
+ tokens = txt.split(%r{(</?(?:b|code|em|i|tt)>)})
+ text = AttributeString.new
+ attributes = 0
+ tokens.each do |tok|
+ case tok
+ when %r{^</(\w+)>$} then attributes &= ~(ATTR_MAP[$1]||0)
+ when %r{^<(\w+)>$} then attributes |= (ATTR_MAP[$1]||0)
+ else
+ tok.split(//).each {|ch| text << AttrChar.new(ch, attributes)}
+ end
+ end
+ text
+ end
+
+ end
+
+
+ ##################################################
+
+ # This formatter generates overstrike-style formatting, which
+ # works with pagers such as man and less.
+
+ class OverstrikeFormatter < AttributeFormatter
+
+ BS = "\C-h"
+
+ def write_attribute_text(prefix, line)
+ print prefix
+ line.each do |achar|
+ attr = achar.attr
+ if (attr & (ITALIC+CODE)) != 0
+ print "_", BS
+ end
+ if (attr & BOLD) != 0
+ print achar.char, BS
+ end
+ print achar.char
+ end
+ puts
+ end
+
+ # draw a string in bold
+ def bold_print(text)
+ text.split(//).each do |ch|
+ print ch, BS, ch
+ end
+ end
+ end
+
+ ##################################################
+
+ # This formatter uses ANSI escape sequences
+ # to colorize stuff
+ # works with pages such as man and less.
+
+ class AnsiFormatter < AttributeFormatter
+
+ def initialize(*args)
+ print "\033[0m"
+ super
+ end
+
+ def write_attribute_text(prefix, line)
+ print prefix
+ curr_attr = 0
+ line.each do |achar|
+ attr = achar.attr
+ if achar.attr != curr_attr
+ update_attributes(achar.attr)
+ curr_attr = achar.attr
+ end
+ print achar.char
+ end
+ update_attributes(0) unless curr_attr.zero?
+ puts
+ end
+
+
+ def bold_print(txt)
+ print "\033[1m#{txt}\033[m"
+ end
+
+ HEADINGS = {
+ 1 => [ "\033[1;32m", "\033[m" ] ,
+ 2 => ["\033[4;32m", "\033[m" ],
+ 3 => ["\033[32m", "\033[m" ]
+ }
+
+ def display_heading(text, level, indent)
+ level = 3 if level > 3
+ heading = HEADINGS[level]
+ print indent
+ print heading[0]
+ print strip_attributes(text)
+ puts heading[1]
+ end
+
+ private
+
+ ATTR_MAP = {
+ BOLD => "1",
+ ITALIC => "33",
+ CODE => "36"
+ }
+
+ def update_attributes(attr)
+ str = "\033["
+ for quality in [ BOLD, ITALIC, CODE]
+ unless (attr & quality).zero?
+ str << ATTR_MAP[quality]
+ end
+ end
+ print str, "m"
+ end
+ end
+
+ ##################################################
+
+ # This formatter uses HTML.
+
+ class HtmlFormatter < AttributeFormatter
+
+ def initialize(*args)
+ super
+ end
+
+ def write_attribute_text(prefix, line)
+ curr_attr = 0
+ line.each do |achar|
+ attr = achar.attr
+ if achar.attr != curr_attr
+ update_attributes(curr_attr, achar.attr)
+ curr_attr = achar.attr
+ end
+ print(escape(achar.char))
+ end
+ update_attributes(curr_attr, 0) unless curr_attr.zero?
+ end
+
+ def draw_line(label=nil)
+ if label != nil
+ bold_print(label)
+ end
+ puts("<hr>")
+ end
+
+ def bold_print(txt)
+ tag("b") { txt }
+ end
+
+ def blankline()
+ puts("<p>")
+ end
+
+ def break_to_newline
+ puts("<br>")
+ end
+
+ def display_heading(text, level, indent)
+ level = 4 if level > 4
+ tag("h#{level}") { text }
+ puts
+ end
+
+ ######################################################################
+
+ def display_list(list)
+
+ case list.type
+ when SM::ListBase::BULLET
+ list_type = "ul"
+ prefixer = proc { |ignored| "<li>" }
+
+ when SM::ListBase::NUMBER,
+ SM::ListBase::UPPERALPHA,
+ SM::ListBase::LOWERALPHA
+ list_type = "ol"
+ prefixer = proc { |ignored| "<li>" }
+
+ when SM::ListBase::LABELED
+ list_type = "dl"
+ prefixer = proc do |li|
+ "<dt><b>" + escape(li.label) + "</b><dd>"
+ end
+
+ when SM::ListBase::NOTE
+ list_type = "table"
+ prefixer = proc do |li|
+ %{<tr valign="top"><td>#{li.label.gsub(/ /, '&nbsp;')}</td><td>}
+ end
+ else
+ fail "unknown list type"
+ end
+
+ print "<#{list_type}>"
+ list.contents.each do |item|
+ if item.kind_of? SM::Flow::LI
+ prefix = prefixer.call(item)
+ print prefix
+ display_flow_item(item, prefix)
+ else
+ display_flow_item(item)
+ end
+ end
+ print "</#{list_type}>"
+ end
+
+ def display_verbatim_flow_item(item, prefix=@indent)
+ print("<pre>")
+ puts item.body
+ puts("</pre>")
+ end
+
+ private
+
+ ATTR_MAP = {
+ BOLD => "b>",
+ ITALIC => "i>",
+ CODE => "tt>"
+ }
+
+ def update_attributes(current, wanted)
+ str = ""
+ # first turn off unwanted ones
+ off = current & ~wanted
+ for quality in [ BOLD, ITALIC, CODE]
+ if (off & quality) > 0
+ str << "</" + ATTR_MAP[quality]
+ end
+ end
+
+ # now turn on wanted
+ for quality in [ BOLD, ITALIC, CODE]
+ unless (wanted & quality).zero?
+ str << "<" << ATTR_MAP[quality]
+ end
+ end
+ print str
+ end
+
+ def tag(code)
+ print("<#{code}>")
+ print(yield)
+ print("</#{code}>")
+ end
+
+ def escape(str)
+ str.
+ gsub(/&/n, '&amp;').
+ gsub(/\"/n, '&quot;').
+ gsub(/>/n, '&gt;').
+ gsub(/</n, '&lt;')
+ end
+
+ end
+
+ ##################################################
+
+ # This formatter reduces extra lines for a simpler output.
+ # It improves way output looks for tools like IRC bots.
+
+ class SimpleFormatter < TextFormatter
+
+ ######################################################################
+
+ # No extra blank lines
+
+ def blankline
+ end
+
+ ######################################################################
+
+ # Display labels only, no lines
+
+ def draw_line(label=nil)
+ unless label.nil? then
+ bold_print(label)
+ puts
+ end
+ end
+
+ ######################################################################
+
+ # Place heading level indicators inline with heading.
+
+ def display_heading(text, level, indent)
+ text = strip_attributes(text)
+ case level
+ when 1
+ puts "= " + text.upcase
+ when 2
+ puts "-- " + text
+ else
+ print indent, text, "\n"
+ end
+ end
+
+ end
+
+
+ # Finally, fill in the list of known formatters
+
+ class TextFormatter
+
+ FORMATTERS = {
+ "ansi" => AnsiFormatter,
+ "bs" => OverstrikeFormatter,
+ "html" => HtmlFormatter,
+ "plain" => TextFormatter,
+ "simple" => SimpleFormatter,
+ }
+
+ def TextFormatter.list
+ FORMATTERS.keys.sort.join(", ")
+ end
+
+ def TextFormatter.for(name)
+ FORMATTERS[name.downcase]
+ end
+
+ end
+
+end
+
+
diff --git a/lib/rdoc/ri/ri_options.rb b/lib/rdoc/ri/ri_options.rb
new file mode 100644
index 0000000000..179ef96cea
--- /dev/null
+++ b/lib/rdoc/ri/ri_options.rb
@@ -0,0 +1,319 @@
+# We handle the parsing of options, and subsequently as a singleton
+# object to be queried for option values
+
+module RI
+
+ require 'rdoc/ri/ri_paths'
+ require 'rdoc/ri/ri_display'
+
+ VERSION_STRING = "ri v1.0.1 - 20041108"
+
+ class Options
+
+ require 'singleton'
+ require 'getoptlong'
+
+ include Singleton
+
+ # No not use a pager. Writable, because ri sets it if it
+ # can't find a pager
+ attr_accessor :use_stdout
+
+ # should we just display a class list and exit
+ attr_reader :list_classes
+
+ # should we display a list of all names
+ attr_reader :list_names
+
+ # The width of the output line
+ attr_reader :width
+
+ # the formatting we apply to the output
+ attr_reader :formatter
+
+ # the directory we search for original documentation
+ attr_reader :doc_dir
+
+ module OptionList
+
+ OPTION_LIST = [
+ [ "--help", "-h", nil,
+ "you're looking at it" ],
+
+ [ "--classes", "-c", nil,
+ "Display the names of classes and modules we\n" +
+ "know about"],
+
+ [ "--doc-dir", "-d", "<dirname>",
+ "A directory to search for documentation. If not\n" +
+ "specified, we search the standard rdoc/ri directories.\n" +
+ "May be repeated."],
+
+ [ "--system", nil, nil,
+ "Include documentation from Ruby's standard library:\n " +
+ RI::Paths::SYSDIR ],
+
+ [ "--site", nil, nil,
+ "Include documentation from libraries installed in site_lib:\n " +
+ RI::Paths::SITEDIR ],
+
+ [ "--home", nil, nil,
+ "Include documentation stored in ~/.rdoc:\n " +
+ (RI::Paths::HOMEDIR || "No ~/.rdoc found") ],
+
+ [ "--gems", nil, nil,
+ "Include documentation from RubyGems:\n" +
+ (RI::Paths::GEMDIRS ?
+ Gem.path.map { |dir| " #{dir}/doc/*/ri" }.join("\n") :
+ "No Rubygems ri found.") ],
+
+ [ "--format", "-f", "<name>",
+ "Format to use when displaying output:\n" +
+ " " + RI::TextFormatter.list + "\n" +
+ "Use 'bs' (backspace) with most pager programs.\n" +
+ "To use ANSI, either also use the -T option, or\n" +
+ "tell your pager to allow control characters\n" +
+ "(for example using the -R option to less)"],
+
+ [ "--list-names", "-l", nil,
+ "List all the names known to RDoc, one per line"
+ ],
+
+ [ "--no-pager", "-T", nil,
+ "Send output directly to stdout."
+ ],
+
+ [ "--width", "-w", "output width",
+ "Set the width of the output" ],
+
+ [ "--version", "-v", nil,
+ "Display the version of ri"
+ ],
+
+ ]
+
+ def OptionList.options
+ OPTION_LIST.map do |long, short, arg,|
+ option = []
+ option << long
+ option << short unless short.nil?
+ option << (arg ? GetoptLong::REQUIRED_ARGUMENT :
+ GetoptLong::NO_ARGUMENT)
+ option
+ end
+ end
+
+
+ def OptionList.strip_output(text)
+ text =~ /^\s+/
+ leading_spaces = $&
+ text.gsub!(/^#{leading_spaces}/, '')
+ $stdout.puts text
+ end
+
+
+ # Show an error and exit
+
+ def OptionList.error(msg)
+ $stderr.puts
+ $stderr.puts msg
+ name = File.basename $PROGRAM_NAME
+ $stderr.puts "\nFor help on options, try '#{name} --help'\n\n"
+ exit 1
+ end
+
+ # Show usage and exit
+
+ def OptionList.usage(short_form=false)
+
+ puts
+ puts(RI::VERSION_STRING)
+ puts
+
+ name = File.basename($0)
+
+ directories = [
+ RI::Paths::SYSDIR,
+ RI::Paths::SITEDIR,
+ RI::Paths::HOMEDIR
+ ]
+
+ if RI::Paths::GEMDIRS then
+ Gem.path.each do |dir|
+ directories << "#{dir}/doc/*/ri"
+ end
+ end
+
+ directories = directories.join("\n ")
+
+ OptionList.strip_output(<<-EOT)
+ Usage:
+
+ #{name} [options] [names...]
+
+ Display information on Ruby classes, modules, and methods.
+ Give the names of classes or methods to see their documentation.
+ Partial names may be given: if the names match more than
+ one entity, a list will be shown, otherwise details on
+ that entity will be displayed.
+
+ Nested classes and modules can be specified using the normal
+ Name::Name notation, and instance methods can be distinguished
+ from class methods using "." (or "#") instead of "::".
+
+ For example:
+
+ #{name} File
+ #{name} File.new
+ #{name} F.n
+ #{name} zip
+
+ Note that shell quoting may be required for method names
+ containing punctuation:
+
+ #{name} 'Array.[]'
+ #{name} compact\\!
+
+ By default ri searches for documentation in the following
+ directories:
+
+ #{directories}
+
+ Specifying the --system, --site, --home, --gems or --doc-dir
+ options will limit ri to searching only the specified
+ directories.
+
+ EOT
+
+ if short_form
+ puts "For help on options, type '#{name} -h'"
+ puts "For a list of classes I know about, type '#{name} -c'"
+ else
+ puts "Options:\n\n"
+ OPTION_LIST.each do|long, short, arg, desc|
+ opt = ''
+ opt << (short ? sprintf("%15s", "#{long}, #{short}") :
+ sprintf("%15s", long))
+ if arg
+ opt << " " << arg
+ end
+ print opt
+ desc = desc.split("\n")
+ if opt.size < 17
+ print " "*(18-opt.size)
+ puts desc.shift
+ else
+ puts
+ end
+ desc.each do |line|
+ puts(" "*18 + line)
+ end
+ puts
+ end
+ puts "Options may also be passed in the 'RI' environment variable"
+ exit 0
+ end
+ end
+ end
+
+ # Show the version and exit
+ def show_version
+ puts VERSION_STRING
+ exit(0)
+ end
+
+ def initialize
+ @use_stdout = !STDOUT.tty?
+ @width = 72
+ @formatter = RI::TextFormatter.for("plain")
+ @list_classes = false
+ @list_names = false
+
+ # By default all paths are used. If any of these are true, only those
+ # directories are used.
+ @use_system = false
+ @use_site = false
+ @use_home = false
+ @use_gems = false
+ @doc_dirs = []
+ end
+
+ # Parse command line options.
+
+ def parse(args)
+
+ old_argv = ARGV.dup
+
+ ARGV.replace(args)
+
+ begin
+
+ go = GetoptLong.new(*OptionList.options)
+ go.quiet = true
+
+ go.each do |opt, arg|
+ case opt
+ when "--help" then OptionList.usage
+ when "--version" then show_version
+ when "--list-names" then @list_names = true
+ when "--no-pager" then @use_stdout = true
+ when "--classes" then @list_classes = true
+
+ when "--system" then @use_system = true
+ when "--site" then @use_site = true
+ when "--home" then @use_home = true
+ when "--gems" then @use_gems = true
+
+ when "--doc-dir"
+ if File.directory?(arg)
+ @doc_dirs << arg
+ else
+ $stderr.puts "Invalid directory: #{arg}"
+ exit 1
+ end
+
+ when "--format"
+ @formatter = RI::TextFormatter.for(arg)
+ unless @formatter
+ $stderr.print "Invalid formatter (should be one of "
+ $stderr.puts RI::TextFormatter.list + ")"
+ exit 1
+ end
+ when "--width"
+ begin
+ @width = Integer(arg)
+ rescue
+ $stderr.puts "Invalid width: '#{arg}'"
+ exit 1
+ end
+ end
+ end
+
+ rescue GetoptLong::InvalidOption, GetoptLong::MissingArgument => error
+ OptionList.error(error.message)
+
+ end
+ end
+
+ # Return the selected documentation directories.
+
+ def path
+ RI::Paths.path(@use_system, @use_site, @use_home, @use_gems, *@doc_dirs)
+ end
+
+ def raw_path
+ RI::Paths.raw_path(@use_system, @use_site, @use_home, @use_gems,
+ *@doc_dirs)
+ end
+
+ # Return an instance of the displayer (the thing that actually writes
+ # the information). This allows us to load in new displayer classes
+ # at runtime (for example to help with IDE integration)
+
+ def displayer
+ ::RiDisplay.new(self)
+ end
+ end
+
+end
+
diff --git a/lib/rdoc/ri/ri_paths.rb b/lib/rdoc/ri/ri_paths.rb
new file mode 100644
index 0000000000..9768f12b7d
--- /dev/null
+++ b/lib/rdoc/ri/ri_paths.rb
@@ -0,0 +1,101 @@
+module RI
+
+ # Encapsulate all the strangeness to do with finding out
+ # where to find RDoc files
+ #
+ # We basically deal with three directories:
+ #
+ # 1. The 'system' documentation directory, which holds
+ # the documentation distributed with Ruby, and which
+ # is managed by the Ruby install process
+ # 2. The 'site' directory, which contains site-wide
+ # documentation added locally.
+ # 3. The 'user' documentation directory, stored under the
+ # user's own home directory.
+ #
+ # There's contention about all this, but for now:
+ #
+ # system:: $datadir/ri/<ver>/system/...
+ # site:: $datadir/ri/<ver>/site/...
+ # user:: ~/.rdoc
+
+ module Paths
+
+ #:stopdoc:
+ require 'rbconfig'
+
+ DOC_DIR = "doc/rdoc"
+
+ version = Config::CONFIG['ruby_version']
+
+ base = File.join(Config::CONFIG['datadir'], "ri", version)
+ SYSDIR = File.join(base, "system")
+ SITEDIR = File.join(base, "site")
+ homedir = ENV['HOME'] || ENV['USERPROFILE'] || ENV['HOMEPATH']
+
+ if homedir
+ HOMEDIR = File.join(homedir, ".rdoc")
+ else
+ HOMEDIR = nil
+ end
+
+ # This is the search path for 'ri'
+ PATH = [ SYSDIR, SITEDIR, HOMEDIR ].find_all {|p| p && File.directory?(p)}
+
+ begin
+ require 'rubygems'
+
+ # HACK dup'd from Gem.latest_partials and friends
+ all_paths = []
+
+ all_paths = Gem.path.map do |dir|
+ Dir[File.join(dir, 'doc', '*', 'ri')]
+ end.flatten
+
+ ri_paths = {}
+
+ all_paths.each do |dir|
+ base = File.basename File.dirname(dir)
+ if base =~ /(.*)-((\d+\.)*\d+)/ then
+ name, version = $1, $2
+ ver = Gem::Version.new version
+ if ri_paths[name].nil? or ver > ri_paths[name][0] then
+ ri_paths[name] = [ver, dir]
+ end
+ end
+ end
+
+ GEMDIRS = ri_paths.map { |k,v| v.last }.sort
+ GEMDIRS.each { |dir| RI::Paths::PATH << dir }
+ rescue LoadError
+ GEMDIRS = nil
+ end
+
+ # Returns the selected documentation directories as an Array, or PATH if no
+ # overriding directories were given.
+
+ def self.path(use_system, use_site, use_home, use_gems, *extra_dirs)
+ path = raw_path(use_system, use_site, use_home, use_gems, *extra_dirs)
+ return path.select { |directory| File.directory? directory }
+ end
+
+ # Returns the selected documentation directories including nonexistent
+ # directories. Used to print out what paths were searched if no ri was
+ # found.
+
+ def self.raw_path(use_system, use_site, use_home, use_gems, *extra_dirs)
+ return PATH unless use_system or use_site or use_home or use_gems or
+ not extra_dirs.empty?
+
+ path = []
+ path << extra_dirs unless extra_dirs.empty?
+ path << RI::Paths::SYSDIR if use_system
+ path << RI::Paths::SITEDIR if use_site
+ path << RI::Paths::HOMEDIR if use_home
+ path << RI::Paths::GEMDIRS if use_gems
+
+ return path.flatten.compact
+ end
+
+ end
+end
diff --git a/lib/rdoc/ri/ri_reader.rb b/lib/rdoc/ri/ri_reader.rb
new file mode 100644
index 0000000000..fb2c373e38
--- /dev/null
+++ b/lib/rdoc/ri/ri_reader.rb
@@ -0,0 +1,100 @@
+require 'rdoc/ri/ri_descriptions'
+require 'rdoc/ri/ri_writer'
+require 'rdoc/markup/simple_markup/to_flow'
+
+module RI
+ class RiReader
+
+ def initialize(ri_cache)
+ @cache = ri_cache
+ end
+
+ def top_level_namespace
+ [ @cache.toplevel ]
+ end
+
+ def lookup_namespace_in(target, namespaces)
+ result = []
+ for n in namespaces
+ result.concat(n.contained_modules_matching(target))
+ end
+ result
+ end
+
+ def find_class_by_name(full_name)
+ names = full_name.split(/::/)
+ ns = @cache.toplevel
+ for name in names
+ ns = ns.contained_class_named(name)
+ return nil if ns.nil?
+ end
+ get_class(ns)
+ end
+
+ def find_methods(name, is_class_method, namespaces)
+ result = []
+ namespaces.each do |ns|
+ result.concat ns.methods_matching(name, is_class_method)
+ end
+ result
+ end
+
+ # return the MethodDescription for a given MethodEntry
+ # by deserializing the YAML
+ def get_method(method_entry)
+ path = method_entry.path_name
+ File.open(path) { |f| RI::Description.deserialize(f) }
+ end
+
+ # Return a class description
+ def get_class(class_entry)
+ result = nil
+ for path in class_entry.path_names
+ path = RiWriter.class_desc_path(path, class_entry)
+ desc = File.open(path) {|f| RI::Description.deserialize(f) }
+ if result
+ result.merge_in(desc)
+ else
+ result = desc
+ end
+ end
+ result
+ end
+
+ # return the names of all classes and modules
+ def full_class_names
+ res = []
+ find_classes_in(res, @cache.toplevel)
+ end
+
+ # return a list of all classes, modules, and methods
+ def all_names
+ res = []
+ find_names_in(res, @cache.toplevel)
+ end
+
+ # ----
+ private
+ # ----
+
+ def find_classes_in(res, klass)
+ classes = klass.classes_and_modules
+ for c in classes
+ res << c.full_name
+ find_classes_in(res, c)
+ end
+ res
+ end
+
+ def find_names_in(res, klass)
+ classes = klass.classes_and_modules
+ for c in classes
+ res << c.full_name
+ res.concat c.all_method_names
+ find_names_in(res, c)
+ end
+ res
+ end
+
+ end
+end
diff --git a/lib/rdoc/ri/ri_util.rb b/lib/rdoc/ri/ri_util.rb
new file mode 100644
index 0000000000..8a01255897
--- /dev/null
+++ b/lib/rdoc/ri/ri_util.rb
@@ -0,0 +1,75 @@
+######################################################################
+
+class RiError < Exception; end
+#
+# Break argument into its constituent class or module names, an
+# optional method type, and a method name
+
+class NameDescriptor
+
+ attr_reader :class_names
+ attr_reader :method_name
+
+ # true and false have the obvious meaning. nil means we don't care
+ attr_reader :is_class_method
+
+ # arg may be
+ # 1. a class or module name (optionally qualified with other class
+ # or module names (Kernel, File::Stat etc)
+ # 2. a method name
+ # 3. a method name qualified by a optionally fully qualified class
+ # or module name
+ #
+ # We're fairly casual about delimiters: folks can say Kernel::puts,
+ # Kernel.puts, or Kernel\#puts for example. There's one exception:
+ # if you say IO::read, we look for a class method, but if you
+ # say IO.read, we look for an instance method
+
+ def initialize(arg)
+ @class_names = []
+ separator = nil
+
+ tokens = arg.split(/(\.|::|#)/)
+
+ # Skip leading '::', '#' or '.', but remember it might
+ # be a method name qualifier
+ separator = tokens.shift if tokens[0] =~ /^(\.|::|#)/
+
+ # Skip leading '::', but remember we potentially have an inst
+
+ # leading stuff must be class names
+
+ while tokens[0] =~ /^[A-Z]/
+ @class_names << tokens.shift
+ unless tokens.empty?
+ separator = tokens.shift
+ break unless separator == "::"
+ end
+ end
+
+ # Now must have a single token, the method name, or an empty
+ # array
+ unless tokens.empty?
+ @method_name = tokens.shift
+ # We may now have a trailing !, ?, or = to roll into
+ # the method name
+ if !tokens.empty? && tokens[0] =~ /^[!?=]$/
+ @method_name << tokens.shift
+ end
+
+ if @method_name =~ /::|\.|#/ or !tokens.empty?
+ raise RiError.new("Bad argument: #{arg}")
+ end
+ if separator && separator != '.'
+ @is_class_method = separator == "::"
+ end
+ end
+ end
+
+ # Return the full class name (with '::' between the components)
+ # or "" if there's no class name
+
+ def full_class_name
+ @class_names.join("::")
+ end
+end
diff --git a/lib/rdoc/ri/ri_writer.rb b/lib/rdoc/ri/ri_writer.rb
new file mode 100644
index 0000000000..78c68e8409
--- /dev/null
+++ b/lib/rdoc/ri/ri_writer.rb
@@ -0,0 +1,62 @@
+require 'fileutils'
+
+module RI
+ class RiWriter
+
+ def RiWriter.class_desc_path(dir, class_desc)
+ File.join(dir, "cdesc-" + class_desc.name + ".yaml")
+ end
+
+
+ # Convert a name from internal form (containing punctuation)
+ # to an external form (where punctuation is replaced
+ # by %xx)
+
+ def RiWriter.internal_to_external(name)
+ name.gsub(/\W/) { sprintf("%%%02x", $&[0]) }
+ end
+
+ # And the reverse operation
+ def RiWriter.external_to_internal(name)
+ name.gsub(/%([0-9a-f]{2,2})/) { $1.to_i(16).chr }
+ end
+
+ def initialize(base_dir)
+ @base_dir = base_dir
+ end
+
+ def remove_class(class_desc)
+ FileUtils.rm_rf(path_to_dir(class_desc.full_name))
+ end
+
+ def add_class(class_desc)
+ dir = path_to_dir(class_desc.full_name)
+ FileUtils.mkdir_p(dir)
+ class_file_name = RiWriter.class_desc_path(dir, class_desc)
+ File.open(class_file_name, "w") do |f|
+ f.write(class_desc.serialize)
+ end
+ end
+
+ def add_method(class_desc, method_desc)
+ dir = path_to_dir(class_desc.full_name)
+ file_name = RiWriter.internal_to_external(method_desc.name)
+ meth_file_name = File.join(dir, file_name)
+ if method_desc.is_singleton
+ meth_file_name += "-c.yaml"
+ else
+ meth_file_name += "-i.yaml"
+ end
+
+ File.open(meth_file_name, "w") do |f|
+ f.write(method_desc.serialize)
+ end
+ end
+
+ private
+
+ def path_to_dir(class_name)
+ File.join(@base_dir, *class_name.split('::'))
+ end
+ end
+end
diff --git a/lib/rdoc/ri/util.rb b/lib/rdoc/ri/util.rb
deleted file mode 100644
index 51cf881bdd..0000000000
--- a/lib/rdoc/ri/util.rb
+++ /dev/null
@@ -1,79 +0,0 @@
-require 'rdoc/ri'
-
-##
-# Break argument into its constituent class or module names, an
-# optional method type, and a method name
-
-class RDoc::RI::NameDescriptor
-
- attr_reader :class_names
- attr_reader :method_name
-
- ##
- # true and false have the obvious meaning. nil means we don't care
-
- attr_reader :is_class_method
-
- ##
- # +arg+ may be
- #
- # 1. A class or module name (optionally qualified with other class or module
- # names (Kernel, File::Stat etc)
- # 2. A method name
- # 3. A method name qualified by a optionally fully qualified class or module
- # name
- #
- # We're fairly casual about delimiters: folks can say Kernel::puts,
- # Kernel.puts, or Kernel\#puts for example. There's one exception: if you
- # say IO::read, we look for a class method, but if you say IO.read, we look
- # for an instance method
-
- def initialize(arg)
- @class_names = []
- separator = nil
-
- tokens = arg.split(/(\.|::|#)/)
-
- # Skip leading '::', '#' or '.', but remember it might
- # be a method name qualifier
- separator = tokens.shift if tokens[0] =~ /^(\.|::|#)/
-
- # Skip leading '::', but remember we potentially have an inst
-
- # leading stuff must be class names
-
- while tokens[0] =~ /^[A-Z]/
- @class_names << tokens.shift
- unless tokens.empty?
- separator = tokens.shift
- break unless separator == "::"
- end
- end
-
- # Now must have a single token, the method name, or an empty array
- unless tokens.empty?
- @method_name = tokens.shift
- # We may now have a trailing !, ?, or = to roll into
- # the method name
- if !tokens.empty? && tokens[0] =~ /^[!?=]$/
- @method_name << tokens.shift
- end
-
- if @method_name =~ /::|\.|#/ or !tokens.empty?
- raise RDoc::RI::Error.new("Bad argument: #{arg}")
- end
- if separator && separator != '.'
- @is_class_method = separator == "::"
- end
- end
- end
-
- # Return the full class name (with '::' between the components) or "" if
- # there's no class name
-
- def full_class_name
- @class_names.join("::")
- end
-
-end
-
diff --git a/lib/rdoc/ri/writer.rb b/lib/rdoc/ri/writer.rb
deleted file mode 100644
index 92aaa1c2da..0000000000
--- a/lib/rdoc/ri/writer.rb
+++ /dev/null
@@ -1,68 +0,0 @@
-require 'fileutils'
-require 'rdoc/ri'
-
-class RDoc::RI::Writer
-
- def self.class_desc_path(dir, class_desc)
- File.join(dir, "cdesc-" + class_desc.name + ".yaml")
- end
-
- ##
- # Convert a name from internal form (containing punctuation) to an external
- # form (where punctuation is replaced by %xx)
-
- def self.internal_to_external(name)
- if ''.respond_to? :ord then
- name.gsub(/\W/) { "%%%02x" % $&[0].ord }
- else
- name.gsub(/\W/) { "%%%02x" % $&[0] }
- end
- end
-
- ##
- # And the reverse operation
-
- def self.external_to_internal(name)
- name.gsub(/%([0-9a-f]{2,2})/) { $1.to_i(16).chr }
- end
-
- def initialize(base_dir)
- @base_dir = base_dir
- end
-
- def remove_class(class_desc)
- FileUtils.rm_rf(path_to_dir(class_desc.full_name))
- end
-
- def add_class(class_desc)
- dir = path_to_dir(class_desc.full_name)
- FileUtils.mkdir_p(dir)
- class_file_name = self.class.class_desc_path(dir, class_desc)
- File.open(class_file_name, "w") do |f|
- f.write(class_desc.serialize)
- end
- end
-
- def add_method(class_desc, method_desc)
- dir = path_to_dir(class_desc.full_name)
- file_name = self.class.internal_to_external(method_desc.name)
- meth_file_name = File.join(dir, file_name)
- if method_desc.is_singleton
- meth_file_name += "-c.yaml"
- else
- meth_file_name += "-i.yaml"
- end
-
- File.open(meth_file_name, "w") do |f|
- f.write(method_desc.serialize)
- end
- end
-
- private
-
- def path_to_dir(class_name)
- File.join(@base_dir, *class_name.split('::'))
- end
-
-end
-
diff --git a/lib/rdoc/stats.rb b/lib/rdoc/stats.rb
deleted file mode 100644
index e18e3c23d7..0000000000
--- a/lib/rdoc/stats.rb
+++ /dev/null
@@ -1,115 +0,0 @@
-require 'rdoc'
-
-##
-# Simple stats collector
-
-class RDoc::Stats
-
- attr_reader :num_classes
- attr_reader :num_files
- attr_reader :num_methods
- attr_reader :num_modules
-
- def initialize(verbosity = 1)
- @num_classes = 0
- @num_files = 0
- @num_methods = 0
- @num_modules = 0
-
- @start = Time.now
-
- @display = case verbosity
- when 0 then Quiet.new
- when 1 then Normal.new
- else Verbose.new
- end
- end
-
- def add_alias(as)
- @display.print_alias as
- @num_methods += 1
- end
-
- def add_class(klass)
- @display.print_class klass
- @num_classes += 1
- end
-
- def add_file(file)
- @display.print_file file
- @num_files += 1
- end
-
- def add_method(method)
- @display.print_method method
- @num_methods += 1
- end
-
- def add_module(mod)
- @display.print_module mod
- @num_modules += 1
- end
-
- def print
- puts "Files: #@num_files"
- puts "Classes: #@num_classes"
- puts "Modules: #@num_modules"
- puts "Methods: #@num_methods"
- puts "Elapsed: " + sprintf("%0.1fs", Time.now - @start)
- end
-
- class Quiet
- def print_alias(*) end
- def print_class(*) end
- def print_file(*) end
- def print_method(*) end
- def print_module(*) end
- end
-
- class Normal
- def print_alias(as)
- print 'a'
- end
-
- def print_class(klass)
- print 'C'
- end
-
- def print_file(file)
- print "\n#{file}: "
- end
-
- def print_method(method)
- print 'm'
- end
-
- def print_module(mod)
- print 'M'
- end
- end
-
- class Verbose
- def print_alias(as)
- puts "\t\talias #{as.new_name} #{as.old_name}"
- end
-
- def print_class(klass)
- puts "\tclass #{klass.full_name}"
- end
-
- def print_file(file)
- puts file
- end
-
- def print_method(method)
- puts "\t\t#{method.singleton ? '::' : '#'}#{method.name}"
- end
-
- def print_module(mod)
- puts "\tmodule #{mod.full_name}"
- end
- end
-
-end
-
-
diff --git a/lib/rdoc/template.rb b/lib/rdoc/template.rb
index 53d0e3ce68..469e10fb4b 100644
--- a/lib/rdoc/template.rb
+++ b/lib/rdoc/template.rb
@@ -1,63 +1,233 @@
-require 'erb'
-
-module RDoc; end
-
-##
-# An ERb wrapper that allows nesting of one ERb template inside another.
+# Cheap-n-cheerful HTML page template system. You create a
+# template containing:
+#
+# * variable names between percent signs (<tt>%fred%</tt>)
+# * blocks of repeating stuff:
+#
+# START:key
+# ... stuff
+# END:key
+#
+# You feed the code a hash. For simple variables, the values
+# are resolved directly from the hash. For blocks, the hash entry
+# corresponding to +key+ will be an array of hashes. The block will
+# be generated once for each entry. Blocks can be nested arbitrarily
+# deeply.
+#
+# The template may also contain
+#
+# IF:key
+# ... stuff
+# ENDIF:key
#
-# This TemplatePage operates similarly to RDoc 1.x's TemplatePage, but uses
-# ERb instead of a custom template language.
+# _stuff_ will only be included in the output if the corresponding
+# key is set in the value hash.
#
-# Converting from a RDoc 1.x template to an RDoc 2.x template is fairly easy.
+# Usage: Given a set of templates <tt>T1, T2,</tt> etc
#
-# * %blah% becomes <%= values["blah"] %>
-# * !INCLUDE! becomes <%= template_include %>
-# * HREF:aref:name becomes <%= href values["aref"], values["name"] %>
-# * IF:blah becomes <% if values["blah"] then %>
-# * IFNOT:blah becomes <% unless values["blah"] then %>
-# * ENDIF:blah becomes <% end %>
-# * START:blah becomes <% values["blah"].each do |blah| %>
-# * END:blah becomes <% end %>
+# values = { "name" => "Dave", state => "TX" }
#
-# To make nested loops easier to convert, start by converting START statements
-# to:
+# t = TemplatePage.new(T1, T2, T3)
+# File.open(name, "w") {|f| t.write_html_on(f, values)}
+# or
+# res = ''
+# t.write_html_on(res, values)
#
-# <% values["blah"].each do |blah| $stderr.puts blah.keys %>
#
-# So you can see what is being used inside which loop.
-class RDoc::TemplatePage
+class TemplatePage
- ##
- # Create a new TemplatePage that will use +templates+.
+ ##########
+ # A context holds a stack of key/value pairs (like a symbol
+ # table). When asked to resolve a key, it first searches the top of
+ # the stack, then the next level, and so on until it finds a match
+ # (or runs out of entries)
- def initialize(*templates)
- @templates = templates
+ class Context
+ def initialize
+ @stack = []
+ end
+
+ def push(hash)
+ @stack.push(hash)
+ end
+
+ def pop
+ @stack.pop
+ end
+
+ # Find a scalar value, throwing an exception if not found. This
+ # method is used when substituting the %xxx% constructs
+
+ def find_scalar(key)
+ @stack.reverse_each do |level|
+ if val = level[key]
+ return val unless val.kind_of? Array
+ end
+ end
+ raise "Template error: can't find variable '#{key}'"
+ end
+
+ # Lookup any key in the stack of hashes
+
+ def lookup(key)
+ @stack.reverse_each do |level|
+ val = level[key]
+ return val if val
+ end
+ nil
+ end
end
- ##
- # Returns "<a href=\"#{ref}\">#{name}</a>"
+ #########
+ # Simple class to read lines out of a string
- def href(ref, name)
- if ref then
- "<a href=\"#{ref}\">#{name}</a>"
- else
- name
+ class LineReader
+ # we're initialized with an array of lines
+ def initialize(lines)
+ @lines = lines
+ end
+
+ # read the next line
+ def read
+ @lines.shift
+ end
+
+ # Return a list of lines up to the line that matches
+ # a pattern. That last line is discarded.
+ def read_up_to(pattern)
+ res = []
+ while line = read
+ if pattern.match(line)
+ return LineReader.new(res)
+ else
+ res << line
+ end
+ end
+ raise "Missing end tag in template: #{pattern.source}"
+ end
+
+ # Return a copy of ourselves that can be modified without
+ # affecting us
+ def dup
+ LineReader.new(@lines.dup)
end
end
- ##
- # Process the template using +values+, writing the result to +io+.
- def write_html_on(io, values)
- b = binding
- template_include = ""
- @templates.reverse_each do |template|
- template_include = ERB.new(template).result b
+ # +templates+ is an array of strings containing the templates.
+ # We start at the first, and substitute in subsequent ones
+ # where the string <tt>!INCLUDE!</tt> occurs. For example,
+ # we could have the overall page template containing
+ #
+ # <html><body>
+ # <h1>Master</h1>
+ # !INCLUDE!
+ # </bost></html>
+ #
+ # and substitute subpages in to it by passing [master, sub_page].
+ # This gives us a cheap way of framing pages
+
+ def initialize(*templates)
+ result = "!INCLUDE!"
+ templates.each do |content|
+ result.sub!(/!INCLUDE!/, content)
end
+ @lines = LineReader.new(result.split($/))
+ end
+
+ # Render the templates into HTML, storing the result on +op+
+ # using the method <tt><<</tt>. The <tt>value_hash</tt> contains
+ # key/value pairs used to drive the substitution (as described above)
+
+ def write_html_on(op, value_hash)
+ @context = Context.new
+ op << substitute_into(@lines, value_hash).tr("\000", '\\')
+ end
+
+
+ # Substitute a set of key/value pairs into the given template.
+ # Keys with scalar values have them substituted directly into
+ # the page. Those with array values invoke <tt>substitute_array</tt>
+ # (below), which examples a block of the template once for each
+ # row in the array.
+ #
+ # This routine also copes with the <tt>IF:</tt>_key_ directive,
+ # removing chunks of the template if the corresponding key
+ # does not appear in the hash, and the START: directive, which
+ # loops its contents for each value in an array
+
+ def substitute_into(lines, values)
+ @context.push(values)
+ skip_to = nil
+ result = []
+
+ while line = lines.read
+
+ case line
+
+ when /^IF:(\w+)/
+ lines.read_up_to(/^ENDIF:#$1/) unless @context.lookup($1)
+
+ when /^IFNOT:(\w+)/
+ lines.read_up_to(/^ENDIF:#$1/) if @context.lookup($1)
+
+ when /^ENDIF:/
+ ;
+
+ when /^START:(\w+)/
+ tag = $1
+ body = lines.read_up_to(/^END:#{tag}/)
+ inner_values = @context.lookup(tag)
+ raise "unknown tag: #{tag}" unless inner_values
+ raise "not array: #{tag}" unless inner_values.kind_of?(Array)
+ inner_values.each do |vals|
+ result << substitute_into(body.dup, vals)
+ end
+ else
+ result << expand_line(line.dup)
+ end
+ end
+
+ @context.pop
+
+ result.join("\n")
+ end
+
+ # Given an individual line, we look for %xxx% constructs and
+ # HREF:ref:name: constructs, substituting for each.
+
+ def expand_line(line)
+ # Generate a cross reference if a reference is given,
+ # otherwise just fill in the name part
+
+ line.gsub!(/HREF:(\w+?):(\w+?):/) {
+ ref = @context.lookup($1)
+ name = @context.find_scalar($2)
+
+ if ref and !ref.kind_of?(Array)
+ "<a href=\"#{ref}\">#{name}</a>"
+ else
+ name
+ end
+ }
+
+ # Substitute in values for %xxx% constructs. This is made complex
+ # because the replacement string may contain characters that are
+ # meaningful to the regexp (like \1)
+
+ line = line.gsub(/%([a-zA-Z]\w*)%/) {
+ val = @context.find_scalar($1)
+ val.tr('\\', "\000")
+ }
+
- io.write template_include
+ line
+ rescue Exception => e
+ $stderr.puts "Error in template: #{e}"
+ $stderr.puts "Original line: #{line}"
+ exit
end
end
diff --git a/lib/rdoc/tokenstream.rb b/lib/rdoc/tokenstream.rb
index 0a1eb9130b..0a0720d8a9 100644
--- a/lib/rdoc/tokenstream.rb
+++ b/lib/rdoc/tokenstream.rb
@@ -1,14 +1,11 @@
-module RDoc; end
-
-##
-# A TokenStream is a list of tokens, gathered during the parse of some entity
-# (say a method). Entities populate these streams by being registered with the
-# lexer. Any class can collect tokens by including TokenStream. From the
-# outside, you use such an object by calling the start_collecting_tokens
-# method, followed by calls to add_token and pop_token.
-
-module RDoc::TokenStream
-
+# A TokenStream is a list of tokens, gathered during the parse
+# of some entity (say a method). Entities populate these streams
+# by being registered with the lexer. Any class can collect tokens
+# by including TokenStream. From the outside, you use such an object
+# by calling the start_collecting_tokens method, followed by calls
+# to add_token and pop_token
+
+module TokenStream
def token_stream
@token_stream
end
@@ -16,18 +13,13 @@ module RDoc::TokenStream
def start_collecting_tokens
@token_stream = []
end
-
def add_token(tk)
@token_stream << tk
end
-
def add_tokens(tks)
tks.each {|tk| add_token(tk)}
end
-
def pop_token
@token_stream.pop
end
-
end
-
diff --git a/lib/rdoc/usage.rb b/lib/rdoc/usage.rb
new file mode 100644
index 0000000000..def516b3d7
--- /dev/null
+++ b/lib/rdoc/usage.rb
@@ -0,0 +1,210 @@
+# = Synopsis
+#
+# This library allows command-line tools to encapsulate their usage
+# as a comment at the top of the main file. Calling <tt>RDoc::usage</tt>
+# then displays some or all of that comment, and optionally exits
+# the program with an exit status. We always look for the comment
+# in the main program file, so it is safe to call this method
+# from anywhere in the executing program.
+#
+# = Usage
+#
+# RDoc::usage( [ exit_status ], [ section, ...])
+# RDoc::usage_no_exit( [ section, ...])
+#
+# where:
+#
+# exit_status::
+# the integer exit code (default zero). RDoc::usage will exit
+# the calling program with this status.
+#
+# section::
+# an optional list of section names. If specified, only the
+# sections with the given names as headings will be output.
+# For example, this section is named 'Usage', and the next
+# section is named 'Examples'. The section names are case
+# insensitive.
+#
+# = Examples
+#
+# # Comment block describing usage
+# # with (optional) section headings
+# # . . .
+#
+# require 'rdoc/usage'
+#
+# # Display all usage and exit with a status of 0
+#
+# RDoc::usage
+#
+# # Display all usage and exit with a status of 99
+#
+# RDoc::usage(99)
+#
+# # Display usage in the 'Summary' section only, then
+# # exit with a status of 99
+#
+# RDoc::usage(99, 'Summary')
+#
+# # Display information in the Author and Copyright
+# # sections, then exit 0.
+#
+# RDoc::usage('Author', 'Copyright')
+#
+# # Display information in the Author and Copyright
+# # sections, but don't exit
+#
+# RDoc::usage_no_exit('Author', 'Copyright')
+#
+# = Author
+#
+# Dave Thomas, The Pragmatic Programmers, LLC
+#
+# = Copyright
+#
+# Copyright (c) 2004 Dave Thomas.
+# Licensed under the same terms as Ruby
+#
+
+require 'rdoc/markup/simple_markup'
+require 'rdoc/markup/simple_markup/to_flow'
+require 'rdoc/ri/ri_formatter'
+require 'rdoc/ri/ri_options'
+
+module RDoc
+
+ # Display usage information from the comment at the top of
+ # the file. String arguments identify specific sections of the
+ # comment to display. An optional integer first argument
+ # specifies the exit status (defaults to 0)
+
+ def RDoc.usage(*args)
+ exit_code = 0
+
+ if args.size > 0
+ status = args[0]
+ if status.respond_to?(:to_int)
+ exit_code = status.to_int
+ args.shift
+ end
+ end
+
+ # display the usage and exit with the given code
+ usage_no_exit(*args)
+ exit(exit_code)
+ end
+
+ # Display usage
+ def RDoc.usage_no_exit(*args)
+ main_program_file = caller[-1].sub(/:\d+$/, '')
+ comment = File.open(main_program_file) do |file|
+ find_comment(file)
+ end
+
+ comment = comment.gsub(/^\s*#/, '')
+
+ markup = SM::SimpleMarkup.new
+ flow_convertor = SM::ToFlow.new
+
+ flow = markup.convert(comment, flow_convertor)
+
+ format = "plain"
+
+ unless args.empty?
+ flow = extract_sections(flow, args)
+ end
+
+ options = RI::Options.instance
+ if args = ENV["RI"]
+ options.parse(args.split)
+ end
+ formatter = options.formatter.new(options, "")
+ formatter.display_flow(flow)
+ end
+
+ ######################################################################
+
+ private
+
+ # Find the first comment in the file (that isn't a shebang line)
+ # If the file doesn't start with a comment, report the fact
+ # and return empty string
+
+ def RDoc.gets(file)
+ if (line = file.gets) && (line =~ /^#!/) # shebang
+ throw :exit, find_comment(file)
+ else
+ line
+ end
+ end
+
+ def RDoc.find_comment(file)
+ catch(:exit) do
+ # skip leading blank lines
+ 0 while (line = gets(file)) && (line =~ /^\s*$/)
+
+ comment = []
+ while line && line =~ /^\s*#/
+ comment << line
+ line = gets(file)
+ end
+
+ 0 while line && (line = gets(file))
+ return no_comment if comment.empty?
+ return comment.join
+ end
+ end
+
+
+ #####
+ # Given an array of flow items and an array of section names, extract those
+ # sections from the flow which have headings corresponding to
+ # a section name in the list. Return them in the order
+ # of names in the +sections+ array.
+
+ def RDoc.extract_sections(flow, sections)
+ result = []
+ sections.each do |name|
+ name = name.downcase
+ copy_upto_level = nil
+
+ flow.each do |item|
+ case item
+ when SM::Flow::H
+ if copy_upto_level && item.level >= copy_upto_level
+ copy_upto_level = nil
+ else
+ if item.text.downcase == name
+ result << item
+ copy_upto_level = item.level
+ end
+ end
+ else
+ if copy_upto_level
+ result << item
+ end
+ end
+ end
+ end
+ if result.empty?
+ puts "Note to developer: requested section(s) [#{sections.join(', ')}] " +
+ "not found"
+ result = flow
+ end
+ result
+ end
+
+ #####
+ # Report the fact that no doc comment count be found
+ def RDoc.no_comment
+ $stderr.puts "No usage information available for this program"
+ ""
+ end
+end
+
+
+if $0 == __FILE__
+
+ RDoc::usage(*ARGV)
+
+end
diff --git a/lib/readbytes.rb b/lib/readbytes.rb
new file mode 100644
index 0000000000..ebb5fc0bd4
--- /dev/null
+++ b/lib/readbytes.rb
@@ -0,0 +1,41 @@
+# TruncatedDataError is raised when IO#readbytes fails to read enough data.
+
+class TruncatedDataError<IOError
+ def initialize(mesg, data) # :nodoc:
+ @data = data
+ super(mesg)
+ end
+
+ # The read portion of an IO#readbytes attempt.
+ attr_reader :data
+end
+
+class IO
+ # Reads exactly +n+ bytes.
+ #
+ # If the data read is nil an EOFError is raised.
+ #
+ # If the data read is too short a TruncatedDataError is raised and the read
+ # data is obtainable via its #data method.
+ def readbytes(n)
+ str = read(n)
+ if str == nil
+ raise EOFError, "End of file reached"
+ end
+ if str.size < n
+ raise TruncatedDataError.new("data truncated", str)
+ end
+ str
+ end
+end
+
+if __FILE__ == $0
+ begin
+ loop do
+ print STDIN.readbytes(6)
+ end
+ rescue TruncatedDataError
+ p $!.data
+ raise
+ end
+end
diff --git a/lib/resolv.rb b/lib/resolv.rb
index ed8859d3c4..1c03f0c003 100644
--- a/lib/resolv.rb
+++ b/lib/resolv.rb
@@ -13,24 +13,24 @@ end
# interpreter.
#
# See also resolv-replace.rb to replace the libc resolver with # Resolv.
-#
+#
# Resolv can look up various DNS resources using the DNS module directly.
-#
+#
# Examples:
-#
+#
# p Resolv.getaddress "www.ruby-lang.org"
# p Resolv.getname "210.251.121.214"
-#
+#
# Resolv::DNS.open do |dns|
# ress = dns.getresources "www.ruby-lang.org", Resolv::DNS::Resource::IN::A
# p ress.map { |r| r.address }
# ress = dns.getresources "ruby-lang.org", Resolv::DNS::Resource::IN::MX
# p ress.map { |r| [r.exchange.to_s, r.preference] }
# end
-#
-#
+#
+#
# == Bugs
-#
+#
# * NIS is not supported.
# * /etc/nsswitch.conf is not supported.
@@ -38,14 +38,14 @@ class Resolv
##
# Looks up the first IP address for +name+.
-
+
def self.getaddress(name)
DefaultResolver.getaddress(name)
end
##
# Looks up all IP address for +name+.
-
+
def self.getaddresses(name)
DefaultResolver.getaddresses(name)
end
@@ -87,7 +87,7 @@ class Resolv
##
# Looks up the first IP address for +name+.
-
+
def getaddress(name)
each_address(name) {|address| return address}
raise ResolvError.new("no address for #{name}")
@@ -95,7 +95,7 @@ class Resolv
##
# Looks up all IP address for +name+.
-
+
def getaddresses(name)
ret = []
each_address(name) {|address| ret << address}
@@ -162,10 +162,10 @@ class Resolv
class ResolvTimeout < TimeoutError; end
##
- # Resolv::Hosts is a hostname resolver that uses the system hosts file.
+ # DNS::Hosts is a hostname resolver that uses the system hosts file.
class Hosts
- if /mswin|mingw|bccwin/ =~ RUBY_PLATFORM
+ if /mswin32|mingw|bccwin/ =~ RUBY_PLATFORM
require 'win32/resolv'
DefaultFileName = Win32::Resolv.get_hosts_path
else
@@ -173,7 +173,7 @@ class Resolv
end
##
- # Creates a new Resolv::Hosts, using +filename+ for its data source.
+ # Creates a new DNS::Hosts, using +filename+ for its data source.
def initialize(filename = DefaultFileName)
@filename = filename
@@ -290,6 +290,11 @@ class Resolv
UDPSize = 512
##
+ # Group of DNS resolver threads (obsolete)
+
+ DNSThreadGroup = ThreadGroup.new
+
+ ##
# Creates a new DNS resolver. See Resolv::DNS.new for argument details.
#
# Yields the created DNS resolver to the block, if given, otherwise
@@ -309,7 +314,7 @@ class Resolv
# Creates a new DNS resolver.
#
# +config_info+ can be:
- #
+ #
# nil:: Uses /etc/resolv.conf.
# String:: Path to a file using /etc/resolv.conf's format.
# Hash:: Must contain :nameserver, :search and :ndots keys.
@@ -379,20 +384,8 @@ class Resolv
def each_address(name)
each_resource(name, Resource::IN::A) {|resource| yield resource.address}
- if use_ipv6?
- each_resource(name, Resource::IN::AAAA) {|resource| yield resource.address}
- end
- end
-
- def use_ipv6?
- begin
- list = Socket.ip_address_list
- rescue NotImplementedError
- return true
- end
- list.any? {|a| a.ipv6? && !a.ipv6_loopback? && !a.ipv6_linklocal? }
+ each_resource(name, Resource::IN::AAAA) {|resource| yield resource.address}
end
- private :use_ipv6?
##
# Gets the hostname for +address+ from the DNS resolver.
@@ -469,7 +462,7 @@ class Resolv
##
# Looks up all +typeclass+ DNS resources for +name+. See #getresource for
# argument details.
-
+
def getresources(name, typeclass)
ret = []
each_resource(name, typeclass) {|resource| ret << resource}
@@ -479,7 +472,7 @@ class Resolv
##
# Iterates over all +typeclass+ DNS resources for +name+. See
# #getresource for argument details.
-
+
def each_resource(name, typeclass, &proc)
lazy_initialize
requester = make_requester
@@ -581,7 +574,7 @@ class Resolv
h = (RequestID[[host, port]] ||= {})
begin
id = rangerand(0x0000..0xffff)
- end while h[id]
+ end while h[id]
h[id] = true
}
id
@@ -829,7 +822,7 @@ class Resolv
if File.exist? filename
config_hash = Config.parse_resolv_conf(filename)
else
- if /mswin|cygwin|mingw|bccwin/ =~ RUBY_PLATFORM
+ if /mswin32|cygwin|mingw|bccwin/ =~ RUBY_PLATFORM
require 'win32/resolv'
search, nameserver = Win32::Resolv.get_resolv_info
config_hash = {}
@@ -1049,7 +1042,7 @@ class Resolv
# A representation of a DNS name.
class Name
-
+
##
# Creates a new DNS name from +arg+. +arg+ can be:
#
@@ -1383,7 +1376,6 @@ class Resolv
def get_unpack(template)
len = 0
template.each_byte {|byte|
- byte = "%c" % byte
case byte
when ?c, ?C
len += 1
@@ -1402,7 +1394,7 @@ class Resolv
end
def get_string
- len = @data[@index].ord
+ len = @data[@index]
raise DecodeError.new("limit exceeded") if @limit < @index + 1 + len
d = @data[@index + 1, len]
@index += 1 + len
@@ -1425,7 +1417,7 @@ class Resolv
limit = @index if !limit || @index < limit
d = []
while true
- case @data[@index].ord
+ case @data[@index]
when 0
@index += 1
return d
@@ -1460,9 +1452,7 @@ class Resolv
name = self.get_name
type, klass, ttl = self.get_unpack('nnN')
typeclass = Resource.get_class(type, klass)
- res = self.get_length16 { typeclass.decode_rdata self }
- res.instance_variable_set :@ttl, ttl
- return name, ttl, res
+ return name, ttl, self.get_length16 {typeclass.decode_rdata(self)}
end
end
end
@@ -1472,11 +1462,11 @@ class Resolv
class Query
def encode_rdata(msg) # :nodoc:
- raise EncodeError.new("#{self.class} is query.")
+ raise EncodeError.new("#{self.class} is query.")
end
def self.decode_rdata(msg) # :nodoc:
- raise DecodeError.new("#{self.class} is query.")
+ raise DecodeError.new("#{self.class} is query.")
end
end
@@ -1501,16 +1491,10 @@ class Resolv
end
def ==(other) # :nodoc:
- return false unless self.class == other.class
- s_ivars = self.instance_variables
- s_ivars.sort!
- s_ivars.delete "@ttl"
- o_ivars = other.instance_variables
- o_ivars.sort!
- o_ivars.delete "@ttl"
- return s_ivars == o_ivars &&
- s_ivars.collect {|name| self.instance_variable_get name} ==
- o_ivars.collect {|name| other.instance_variable_get name}
+ return self.class == other.class &&
+ self.instance_variables == other.instance_variables &&
+ self.instance_variables.collect {|name| self.instance_eval name} ==
+ other.instance_variables.collect {|name| other.instance_eval name}
end
def eql?(other) # :nodoc:
@@ -1519,10 +1503,8 @@ class Resolv
def hash # :nodoc:
h = 0
- vars = self.instance_variables
- vars.delete "@ttl"
- vars.each {|name|
- h ^= self.instance_variable_get(name).hash
+ self.instance_variables.each {|name|
+ h ^= self.instance_eval("#{name}.hash")
}
return h
end
@@ -1951,7 +1933,7 @@ class Resolv
def initialize(address)
@address = IPv6.create(address)
end
-
+
##
# The Resolv::IPv6 address for this AAAA.
@@ -1968,7 +1950,7 @@ class Resolv
##
# SRV resource record defined in RFC 2782
- #
+ #
# These records identify the hostname and port that a service is
# available at.
diff --git a/lib/rexml/attlistdecl.rb b/lib/rexml/attlistdecl.rb
index ec4e6c3b8d..ef4721b5ce 100644
--- a/lib/rexml/attlistdecl.rb
+++ b/lib/rexml/attlistdecl.rb
@@ -3,60 +3,60 @@ require 'rexml/child'
require 'rexml/source'
module REXML
- # This class needs:
- # * Documentation
- # * Work! Not all types of attlists are intelligently parsed, so we just
- # spew back out what we get in. This works, but it would be better if
- # we formatted the output ourselves.
- #
- # AttlistDecls provide *just* enough support to allow namespace
- # declarations. If you need some sort of generalized support, or have an
- # interesting idea about how to map the hideous, terrible design of DTD
- # AttlistDecls onto an intuitive Ruby interface, let me know. I'm desperate
- # for anything to make DTDs more palateable.
- class AttlistDecl < Child
- include Enumerable
-
- # What is this? Got me.
- attr_reader :element_name
-
- # Create an AttlistDecl, pulling the information from a Source. Notice
- # that this isn't very convenient; to create an AttlistDecl, you basically
- # have to format it yourself, and then have the initializer parse it.
- # Sorry, but for the forseeable future, DTD support in REXML is pretty
- # weak on convenience. Have I mentioned how much I hate DTDs?
- def initialize(source)
- super()
- if (source.kind_of? Array)
- @element_name, @pairs, @contents = *source
- end
- end
-
- # Access the attlist attribute/value pairs.
- # value = attlist_decl[ attribute_name ]
- def [](key)
- @pairs[key]
- end
-
- # Whether an attlist declaration includes the given attribute definition
- # if attlist_decl.include? "xmlns:foobar"
- def include?(key)
- @pairs.keys.include? key
- end
-
- # Iterate over the key/value pairs:
- # attlist_decl.each { |attribute_name, attribute_value| ... }
- def each(&block)
- @pairs.each(&block)
- end
-
- # Write out exactly what we got in.
- def write out, indent=-1
- out << @contents
- end
-
- def node_type
- :attlistdecl
- end
- end
+ # This class needs:
+ # * Documentation
+ # * Work! Not all types of attlists are intelligently parsed, so we just
+ # spew back out what we get in. This works, but it would be better if
+ # we formatted the output ourselves.
+ #
+ # AttlistDecls provide *just* enough support to allow namespace
+ # declarations. If you need some sort of generalized support, or have an
+ # interesting idea about how to map the hideous, terrible design of DTD
+ # AttlistDecls onto an intuitive Ruby interface, let me know. I'm desperate
+ # for anything to make DTDs more palateable.
+ class AttlistDecl < Child
+ include Enumerable
+
+ # What is this? Got me.
+ attr_reader :element_name
+
+ # Create an AttlistDecl, pulling the information from a Source. Notice
+ # that this isn't very convenient; to create an AttlistDecl, you basically
+ # have to format it yourself, and then have the initializer parse it.
+ # Sorry, but for the forseeable future, DTD support in REXML is pretty
+ # weak on convenience. Have I mentioned how much I hate DTDs?
+ def initialize(source)
+ super()
+ if (source.kind_of? Array)
+ @element_name, @pairs, @contents = *source
+ end
+ end
+
+ # Access the attlist attribute/value pairs.
+ # value = attlist_decl[ attribute_name ]
+ def [](key)
+ @pairs[key]
+ end
+
+ # Whether an attlist declaration includes the given attribute definition
+ # if attlist_decl.include? "xmlns:foobar"
+ def include?(key)
+ @pairs.keys.include? key
+ end
+
+ # Iterate over the key/value pairs:
+ # attlist_decl.each { |attribute_name, attribute_value| ... }
+ def each(&block)
+ @pairs.each(&block)
+ end
+
+ # Write out exactly what we got in.
+ def write out, indent=-1
+ out << @contents
+ end
+
+ def node_type
+ :attlistdecl
+ end
+ end
end
diff --git a/lib/rexml/attribute.rb b/lib/rexml/attribute.rb
index 28a5923608..89c1ada36c 100644
--- a/lib/rexml/attribute.rb
+++ b/lib/rexml/attribute.rb
@@ -2,171 +2,168 @@ require "rexml/namespace"
require 'rexml/text'
module REXML
- # Defines an Element Attribute; IE, a attribute=value pair, as in:
- # <element attribute="value"/>. Attributes can be in their own
- # namespaces. General users of REXML will not interact with the
- # Attribute class much.
- class Attribute
- include Node
- include Namespace
-
- # The element to which this attribute belongs
- attr_reader :element
- # The normalized value of this attribute. That is, the attribute with
- # entities intact.
- attr_writer :normalized
- PATTERN = /\s*(#{NAME_STR})\s*=\s*(["'])(.*?)\2/um
-
- NEEDS_A_SECOND_CHECK = /(<|&((#{Entity::NAME});|(#0*((?:\d+)|(?:x[a-fA-F0-9]+)));)?)/um
-
- # Constructor.
+ # Defines an Element Attribute; IE, a attribute=value pair, as in:
+ # <element attribute="value"/>. Attributes can be in their own
+ # namespaces. General users of REXML will not interact with the
+ # Attribute class much.
+ class Attribute
+ include Node
+ include Namespace
+
+ # The element to which this attribute belongs
+ attr_reader :element
+ # The normalized value of this attribute. That is, the attribute with
+ # entities intact.
+ attr_writer :normalized
+ PATTERN = /\s*(#{NAME_STR})\s*=\s*(["'])(.*?)\2/um
+
+ # Constructor.
# FIXME: The parser doesn't catch illegal characters in attributes
#
- # first::
+ # first::
# Either: an Attribute, which this new attribute will become a
# clone of; or a String, which is the name of this attribute
# second::
# If +first+ is an Attribute, then this may be an Element, or nil.
# If nil, then the Element parent of this attribute is the parent
- # of the +first+ Attribute. If the first argument is a String,
- # then this must also be a String, and is the content of the attribute.
+ # of the +first+ Attribute. If the first argument is a String,
+ # then this must also be a String, and is the content of the attribute.
# If this is the content, it must be fully normalized (contain no
# illegal characters).
# parent::
- # Ignored unless +first+ is a String; otherwise, may be the Element
+ # Ignored unless +first+ is a String; otherwise, may be the Element
# parent of this attribute, or nil.
#
- #
- # Attribute.new( attribute_to_clone )
- # Attribute.new( attribute_to_clone, parent_element )
- # Attribute.new( "attr", "attr_value" )
- # Attribute.new( "attr", "attr_value", parent_element )
- def initialize( first, second=nil, parent=nil )
- @normalized = @unnormalized = @element = nil
- if first.kind_of? Attribute
- self.name = first.expanded_name
- @unnormalized = first.value
- if second.kind_of? Element
- @element = second
- else
- @element = first.element
- end
- elsif first.kind_of? String
- @element = parent
- self.name = first
- @normalized = second.to_s
- else
- raise "illegal argument #{first.class.name} to Attribute constructor"
- end
- end
-
- # Returns the namespace of the attribute.
- #
- # e = Element.new( "elns:myelement" )
- # e.add_attribute( "nsa:a", "aval" )
- # e.add_attribute( "b", "bval" )
- # e.attributes.get_attribute( "a" ).prefix # -> "nsa"
- # e.attributes.get_attribute( "b" ).prefix # -> "elns"
- # a = Attribute.new( "x", "y" )
- # a.prefix # -> ""
- def prefix
- pf = super
- if pf == ""
- pf = @element.prefix if @element
- end
- pf
- end
-
- # Returns the namespace URL, if defined, or nil otherwise
- #
- # e = Element.new("el")
- # e.add_attributes({"xmlns:ns", "http://url"})
- # e.namespace( "ns" ) # -> "http://url"
- def namespace arg=nil
- arg = prefix if arg.nil?
- @element.namespace arg
- end
-
- # Returns true if other is an Attribute and has the same name and value,
- # false otherwise.
- def ==( other )
- other.kind_of?(Attribute) and other.name==name and other.value==value
- end
-
- # Creates (and returns) a hash from both the name and value
- def hash
- name.hash + value.hash
- end
-
- # Returns this attribute out as XML source, expanding the name
- #
- # a = Attribute.new( "x", "y" )
- # a.to_string # -> "x='y'"
- # b = Attribute.new( "ns:x", "y" )
- # b.to_string # -> "ns:x='y'"
- def to_string
- if @element and @element.context and @element.context[:attribute_quote] == :quote
- %Q^#@expanded_name="#{to_s().gsub(/"/, '&quote;')}"^
- else
- "#@expanded_name='#{to_s().gsub(/'/, '&apos;')}'"
- end
- end
-
- def doctype
- if @element
- doc = @element.document
- doctype = doc.doctype if doc
- end
- end
-
- # Returns the attribute value, with entities replaced
- def to_s
- return @normalized if @normalized
-
- @normalized = Text::normalize( @unnormalized, doctype )
- @unnormalized = nil
+ #
+ # Attribute.new( attribute_to_clone )
+ # Attribute.new( attribute_to_clone, parent_element )
+ # Attribute.new( "attr", "attr_value" )
+ # Attribute.new( "attr", "attr_value", parent_element )
+ def initialize( first, second=nil, parent=nil )
+ @normalized = @unnormalized = @element = nil
+ if first.kind_of? Attribute
+ self.name = first.expanded_name
+ @unnormalized = first.value
+ if second.kind_of? Element
+ @element = second
+ else
+ @element = first.element
+ end
+ elsif first.kind_of? String
+ @element = parent
+ self.name = first
+ @normalized = second.to_s
+ else
+ raise "illegal argument #{first.class.name} to Attribute constructor"
+ end
+ end
+
+ # Returns the namespace of the attribute.
+ #
+ # e = Element.new( "elns:myelement" )
+ # e.add_attribute( "nsa:a", "aval" )
+ # e.add_attribute( "b", "bval" )
+ # e.attributes.get_attribute( "a" ).prefix # -> "nsa"
+ # e.attributes.get_attribute( "b" ).prefix # -> "elns"
+ # a = Attribute.new( "x", "y" )
+ # a.prefix # -> ""
+ def prefix
+ pf = super
+ if pf == ""
+ pf = @element.prefix if @element
+ end
+ pf
+ end
+
+ # Returns the namespace URL, if defined, or nil otherwise
+ #
+ # e = Element.new("el")
+ # e.add_attributes({"xmlns:ns", "http://url"})
+ # e.namespace( "ns" ) # -> "http://url"
+ def namespace arg=nil
+ arg = prefix if arg.nil?
+ @element.namespace arg
+ end
+
+ # Returns true if other is an Attribute and has the same name and value,
+ # false otherwise.
+ def ==( other )
+ other.kind_of?(Attribute) and other.name==name and other.value==value
+ end
+
+ # Creates (and returns) a hash from both the name and value
+ def hash
+ name.hash + value.hash
+ end
+
+ # Returns this attribute out as XML source, expanding the name
+ #
+ # a = Attribute.new( "x", "y" )
+ # a.to_string # -> "x='y'"
+ # b = Attribute.new( "ns:x", "y" )
+ # b.to_string # -> "ns:x='y'"
+ def to_string
+ if @element and @element.context and @element.context[:attribute_quote] == :quote
+ %Q^#@expanded_name="#{to_s().gsub(/"/, '&quote;')}"^
+ else
+ "#@expanded_name='#{to_s().gsub(/'/, '&apos;')}'"
+ end
+ end
+
+ # Returns the attribute value, with entities replaced
+ def to_s
+ return @normalized if @normalized
+
+ doctype = nil
+ if @element
+ doc = @element.document
+ doctype = doc.doctype if doc
+ end
+
+ @normalized = Text::normalize( @unnormalized, doctype )
+ @unnormalized = nil
@normalized
- end
-
- # Returns the UNNORMALIZED value of this attribute. That is, entities
- # have been expanded to their values
- def value
- return @unnormalized if @unnormalized
- @unnormalized = Text::unnormalize( @normalized, doctype )
- @normalized = nil
+ end
+
+ # Returns the UNNORMALIZED value of this attribute. That is, entities
+ # have been expanded to their values
+ def value
+ return @unnormalized if @unnormalized
+ doctype = nil
+ if @element
+ doc = @element.document
+ doctype = doc.doctype if doc
+ end
+ @unnormalized = Text::unnormalize( @normalized, doctype )
+ @normalized = nil
@unnormalized
- end
-
- # Returns a copy of this attribute
- def clone
- Attribute.new self
- end
-
- # Sets the element of which this object is an attribute. Normally, this
- # is not directly called.
- #
- # Returns this attribute
- def element=( element )
- @element = element
-
- if @normalized
- Text.check( @normalized, NEEDS_A_SECOND_CHECK, doctype )
- end
-
- self
- end
-
- # Removes this Attribute from the tree, and returns true if successfull
- #
- # This method is usually not called directly.
- def remove
- @element.attributes.delete self.name unless @element.nil?
- end
-
- # Writes this attribute (EG, puts 'key="value"' to the output)
- def write( output, indent=-1 )
- output << to_string
- end
+ end
+
+ # Returns a copy of this attribute
+ def clone
+ Attribute.new self
+ end
+
+ # Sets the element of which this object is an attribute. Normally, this
+ # is not directly called.
+ #
+ # Returns this attribute
+ def element=( element )
+ @element = element
+ self
+ end
+
+ # Removes this Attribute from the tree, and returns true if successfull
+ #
+ # This method is usually not called directly.
+ def remove
+ @element.attributes.delete self.name unless @element.nil?
+ end
+
+ # Writes this attribute (EG, puts 'key="value"' to the output)
+ def write( output, indent=-1 )
+ output << to_string
+ end
def node_type
:attribute
@@ -183,6 +180,6 @@ module REXML
path += "/@#{self.expanded_name}"
return path
end
- end
+ end
end
#vim:ts=2 sw=2 noexpandtab:
diff --git a/lib/rexml/cdata.rb b/lib/rexml/cdata.rb
index e1235d60f8..efcb71160a 100644
--- a/lib/rexml/cdata.rb
+++ b/lib/rexml/cdata.rb
@@ -1,39 +1,39 @@
require "rexml/text"
module REXML
- class CData < Text
- START = '<![CDATA['
- STOP = ']]>'
- ILLEGAL = /(\]\]>)/
+ class CData < Text
+ START = '<![CDATA['
+ STOP = ']]>'
+ ILLEGAL = /(\]\]>)/
- # Constructor. CData is data between <![CDATA[ ... ]]>
- #
- # _Examples_
- # CData.new( source )
- # CData.new( "Here is some CDATA" )
- # CData.new( "Some unprocessed data", respect_whitespace_TF, parent_element )
- def initialize( first, whitespace=true, parent=nil )
- super( first, whitespace, parent, false, true, ILLEGAL )
- end
+ # Constructor. CData is data between <![CDATA[ ... ]]>
+ #
+ # _Examples_
+ # CData.new( source )
+ # CData.new( "Here is some CDATA" )
+ # CData.new( "Some unprocessed data", respect_whitespace_TF, parent_element )
+ def initialize( first, whitespace=true, parent=nil )
+ super( first, whitespace, parent, true, true, ILLEGAL )
+ end
- # Make a copy of this object
- #
- # _Examples_
- # c = CData.new( "Some text" )
- # d = c.clone
- # d.to_s # -> "Some text"
- def clone
- CData.new self
- end
+ # Make a copy of this object
+ #
+ # _Examples_
+ # c = CData.new( "Some text" )
+ # d = c.clone
+ # d.to_s # -> "Some text"
+ def clone
+ CData.new self
+ end
- # Returns the content of this CData object
- #
- # _Examples_
- # c = CData.new( "Some text" )
- # c.to_s # -> "Some text"
- def to_s
- @string
- end
+ # Returns the content of this CData object
+ #
+ # _Examples_
+ # c = CData.new( "Some text" )
+ # c.to_s # -> "Some text"
+ def to_s
+ @string
+ end
def value
@string
@@ -42,26 +42,26 @@ module REXML
# == DEPRECATED
# See the rexml/formatters package
#
- # Generates XML output of this object
- #
- # output::
- # Where to write the string. Defaults to $stdout
- # indent::
+ # Generates XML output of this object
+ #
+ # output::
+ # Where to write the string. Defaults to $stdout
+ # indent::
# The amount to indent this node by
- # transitive::
+ # transitive::
# Ignored
- # ie_hack::
+ # ie_hack::
# Ignored
- #
- # _Examples_
- # c = CData.new( " Some text " )
- # c.write( $stdout ) #-> <![CDATA[ Some text ]]>
- def write( output=$stdout, indent=-1, transitive=false, ie_hack=false )
+ #
+ # _Examples_
+ # c = CData.new( " Some text " )
+ # c.write( $stdout ) #-> <![CDATA[ Some text ]]>
+ def write( output=$stdout, indent=-1, transitive=false, ie_hack=false )
Kernel.warn( "#{self.class.name}.write is deprecated" )
- indent( output, indent )
- output << START
- output << @string
- output << STOP
- end
- end
+ indent( output, indent )
+ output << START
+ output << @string
+ output << STOP
+ end
+ end
end
diff --git a/lib/rexml/child.rb b/lib/rexml/child.rb
index fd59d7283a..6d3c9df5e6 100644
--- a/lib/rexml/child.rb
+++ b/lib/rexml/child.rb
@@ -1,96 +1,96 @@
require "rexml/node"
module REXML
- ##
- # A Child object is something contained by a parent, and this class
- # contains methods to support that. Most user code will not use this
- # class directly.
- class Child
- include Node
- attr_reader :parent # The Parent of this object
+ ##
+ # A Child object is something contained by a parent, and this class
+ # contains methods to support that. Most user code will not use this
+ # class directly.
+ class Child
+ include Node
+ attr_reader :parent # The Parent of this object
- # Constructor. Any inheritors of this class should call super to make
- # sure this method is called.
- # parent::
- # if supplied, the parent of this child will be set to the
- # supplied value, and self will be added to the parent
- def initialize( parent = nil )
- @parent = nil
- # Declare @parent, but don't define it. The next line sets the
- # parent.
- parent.add( self ) if parent
- end
+ # Constructor. Any inheritors of this class should call super to make
+ # sure this method is called.
+ # parent::
+ # if supplied, the parent of this child will be set to the
+ # supplied value, and self will be added to the parent
+ def initialize( parent = nil )
+ @parent = nil
+ # Declare @parent, but don't define it. The next line sets the
+ # parent.
+ parent.add( self ) if parent
+ end
- # Replaces this object with another object. Basically, calls
- # Parent.replace_child
- #
- # Returns:: self
- def replace_with( child )
- @parent.replace_child( self, child )
- self
- end
+ # Replaces this object with another object. Basically, calls
+ # Parent.replace_child
+ #
+ # Returns:: self
+ def replace_with( child )
+ @parent.replace_child( self, child )
+ self
+ end
- # Removes this child from the parent.
- #
- # Returns:: self
- def remove
- unless @parent.nil?
- @parent.delete self
- end
- self
- end
+ # Removes this child from the parent.
+ #
+ # Returns:: self
+ def remove
+ unless @parent.nil?
+ @parent.delete self
+ end
+ self
+ end
- # Sets the parent of this child to the supplied argument.
- #
- # other::
- # Must be a Parent object. If this object is the same object as the
- # existing parent of this child, no action is taken. Otherwise, this
- # child is removed from the current parent (if one exists), and is added
- # to the new parent.
- # Returns:: The parent added
- def parent=( other )
- return @parent if @parent == other
- @parent.delete self if defined? @parent and @parent
- @parent = other
- end
+ # Sets the parent of this child to the supplied argument.
+ #
+ # other::
+ # Must be a Parent object. If this object is the same object as the
+ # existing parent of this child, no action is taken. Otherwise, this
+ # child is removed from the current parent (if one exists), and is added
+ # to the new parent.
+ # Returns:: The parent added
+ def parent=( other )
+ return @parent if @parent == other
+ @parent.delete self if defined? @parent and @parent
+ @parent = other
+ end
- alias :next_sibling :next_sibling_node
- alias :previous_sibling :previous_sibling_node
+ alias :next_sibling :next_sibling_node
+ alias :previous_sibling :previous_sibling_node
- # Sets the next sibling of this child. This can be used to insert a child
- # after some other child.
- # a = Element.new("a")
- # b = a.add_element("b")
- # c = Element.new("c")
- # b.next_sibling = c
- # # => <a><b/><c/></a>
- def next_sibling=( other )
- parent.insert_after self, other
- end
+ # Sets the next sibling of this child. This can be used to insert a child
+ # after some other child.
+ # a = Element.new("a")
+ # b = a.add_element("b")
+ # c = Element.new("c")
+ # b.next_sibling = c
+ # # => <a><b/><c/></a>
+ def next_sibling=( other )
+ parent.insert_after self, other
+ end
- # Sets the previous sibling of this child. This can be used to insert a
- # child before some other child.
- # a = Element.new("a")
- # b = a.add_element("b")
- # c = Element.new("c")
- # b.previous_sibling = c
- # # => <a><b/><c/></a>
- def previous_sibling=(other)
- parent.insert_before self, other
- end
+ # Sets the previous sibling of this child. This can be used to insert a
+ # child before some other child.
+ # a = Element.new("a")
+ # b = a.add_element("b")
+ # c = Element.new("c")
+ # b.previous_sibling = c
+ # # => <a><b/><c/></a>
+ def previous_sibling=(other)
+ parent.insert_before self, other
+ end
- # Returns:: the document this child belongs to, or nil if this child
- # belongs to no document
- def document
- return parent.document unless parent.nil?
- nil
- end
+ # Returns:: the document this child belongs to, or nil if this child
+ # belongs to no document
+ def document
+ return parent.document unless parent.nil?
+ nil
+ end
- # This doesn't yet handle encodings
- def bytes
- encoding = document.encoding
+ # This doesn't yet handle encodings
+ def bytes
+ encoding = document.encoding
- to_s
- end
- end
+ to_s
+ end
+ end
end
diff --git a/lib/rexml/comment.rb b/lib/rexml/comment.rb
index e401090376..2b9b4b89c9 100644
--- a/lib/rexml/comment.rb
+++ b/lib/rexml/comment.rb
@@ -1,80 +1,80 @@
require "rexml/child"
module REXML
- ##
- # Represents an XML comment; that is, text between \<!-- ... -->
- class Comment < Child
- include Comparable
- START = "<!--"
- STOP = "-->"
+ ##
+ # Represents an XML comment; that is, text between \<!-- ... -->
+ class Comment < Child
+ include Comparable
+ START = "<!--"
+ STOP = "-->"
- # The content text
+ # The content text
- attr_accessor :string
+ attr_accessor :string
- ##
- # Constructor. The first argument can be one of three types:
- # @param first If String, the contents of this comment are set to the
- # argument. If Comment, the argument is duplicated. If
- # Source, the argument is scanned for a comment.
- # @param second If the first argument is a Source, this argument
- # should be nil, not supplied, or a Parent to be set as the parent
- # of this object
- def initialize( first, second = nil )
- #puts "IN COMMENT CONSTRUCTOR; SECOND IS #{second.type}"
- super(second)
- if first.kind_of? String
- @string = first
- elsif first.kind_of? Comment
- @string = first.string
- end
- end
+ ##
+ # Constructor. The first argument can be one of three types:
+ # @param first If String, the contents of this comment are set to the
+ # argument. If Comment, the argument is duplicated. If
+ # Source, the argument is scanned for a comment.
+ # @param second If the first argument is a Source, this argument
+ # should be nil, not supplied, or a Parent to be set as the parent
+ # of this object
+ def initialize( first, second = nil )
+ #puts "IN COMMENT CONSTRUCTOR; SECOND IS #{second.type}"
+ super(second)
+ if first.kind_of? String
+ @string = first
+ elsif first.kind_of? Comment
+ @string = first.string
+ end
+ end
- def clone
- Comment.new self
- end
+ def clone
+ Comment.new self
+ end
# == DEPRECATED
# See REXML::Formatters
#
- # output::
- # Where to write the string
- # indent::
- # An integer. If -1, no indenting will be used; otherwise, the
- # indentation will be this number of spaces, and children will be
- # indented an additional amount.
- # transitive::
- # Ignored by this class. The contents of comments are never modified.
- # ie_hack::
- # Needed for conformity to the child API, but not used by this class.
- def write( output, indent=-1, transitive=false, ie_hack=false )
+ # output::
+ # Where to write the string
+ # indent::
+ # An integer. If -1, no indenting will be used; otherwise, the
+ # indentation will be this number of spaces, and children will be
+ # indented an additional amount.
+ # transitive::
+ # Ignored by this class. The contents of comments are never modified.
+ # ie_hack::
+ # Needed for conformity to the child API, but not used by this class.
+ def write( output, indent=-1, transitive=false, ie_hack=false )
Kernel.warn("Comment.write is deprecated. See REXML::Formatters")
- indent( output, indent )
- output << START
- output << @string
- output << STOP
- end
+ indent( output, indent )
+ output << START
+ output << @string
+ output << STOP
+ end
- alias :to_s :string
+ alias :to_s :string
- ##
- # Compares this Comment to another; the contents of the comment are used
- # in the comparison.
- def <=>(other)
- other.to_s <=> @string
- end
+ ##
+ # Compares this Comment to another; the contents of the comment are used
+ # in the comparison.
+ def <=>(other)
+ other.to_s <=> @string
+ end
- ##
- # Compares this Comment to another; the contents of the comment are used
- # in the comparison.
- def ==( other )
- other.kind_of? Comment and
- (other <=> self) == 0
- end
+ ##
+ # Compares this Comment to another; the contents of the comment are used
+ # in the comparison.
+ def ==( other )
+ other.kind_of? Comment and
+ (other <=> self) == 0
+ end
def node_type
:comment
end
- end
+ end
end
#vim:ts=2 sw=2 noexpandtab:
diff --git a/lib/rexml/doctype.rb b/lib/rexml/doctype.rb
index 1a946a1587..05cd4ab331 100644
--- a/lib/rexml/doctype.rb
+++ b/lib/rexml/doctype.rb
@@ -15,11 +15,11 @@ module REXML
STOP = ">"
SYSTEM = "SYSTEM"
PUBLIC = "PUBLIC"
- DEFAULT_ENTITIES = {
- 'gt'=>EntityConst::GT,
- 'lt'=>EntityConst::LT,
- 'quot'=>EntityConst::QUOT,
- "apos"=>EntityConst::APOS
+ DEFAULT_ENTITIES = {
+ 'gt'=>EntityConst::GT,
+ 'lt'=>EntityConst::LT,
+ 'quot'=>EntityConst::QUOT,
+ "apos"=>EntityConst::APOS
}
# name is the name of the doctype
@@ -33,7 +33,7 @@ module REXML
# dt = DocType.new( doctype_to_clone )
# # Incomplete. Shallow clone of doctype
#
- # +Note+ that the constructor:
+ # +Note+ that the constructor:
#
# Doctype.new( Source.new( "<!DOCTYPE foo 'bar'>" ) )
#
@@ -117,6 +117,7 @@ module REXML
unless @children.empty?
next_indent = indent + 1
output << ' ['
+ child = nil # speed
@children.each { |child|
output << "\n"
f.write( child, output )
@@ -139,8 +140,8 @@ module REXML
@entities = DEFAULT_ENTITIES.clone if @entities == DEFAULT_ENTITIES
@entities[ child.name ] = child if child.kind_of? Entity
end
-
- # This method retrieves the public identifier identifying the document's
+
+ # This method retrieves the public identifier identifying the document's
# DTD.
#
# Method contributed by Henrik Martensson
@@ -152,7 +153,7 @@ module REXML
strip_quotes(@long_name)
end
end
-
+
# This method retrieves the system identifier identifying the document's DTD
#
# Method contributed by Henrik Martensson
@@ -164,16 +165,16 @@ module REXML
@uri.kind_of?(String) ? strip_quotes(@uri) : nil
end
end
-
+
# This method returns a list of notations that have been declared in the
- # _internal_ DTD subset. Notations in the external DTD subset are not
+ # _internal_ DTD subset. Notations in the external DTD subset are not
# listed.
#
# Method contributed by Henrik Martensson
def notations
children().select {|node| node.kind_of?(REXML::NotationDecl)}
end
-
+
# Retrieves a named notation. Only notations declared in the internal
# DTD subset can be retrieved.
#
@@ -183,12 +184,12 @@ module REXML
notation_decl.name == name
}
end
-
+
private
-
+
# Method contributed by Henrik Martensson
def strip_quotes(quoted_string)
- quoted_string =~ /^[\'\"].*[\'\"]$/ ?
+ quoted_string =~ /^[\'\"].*[\´\"]$/ ?
quoted_string[1, quoted_string.length-2] :
quoted_string
end
@@ -217,7 +218,7 @@ module REXML
output << to_s
end
end
-
+
public
class ElementDecl < Declaration
def initialize( src )
@@ -250,7 +251,7 @@ module REXML
def to_s
"<!NOTATION #@name #@middle#{
- @public ? ' ' + public.inspect : ''
+ @public ? ' ' + public.inspect : ''
}#{
@system ? ' ' +@system.inspect : ''
}>"
@@ -259,7 +260,7 @@ module REXML
def write( output, indent=-1 )
output << to_s
end
-
+
# This method retrieves the name of the notation.
#
# Method contributed by Henrik Martensson
diff --git a/lib/rexml/document.rb b/lib/rexml/document.rb
index 0fde6df1a1..3d1300a06b 100644
--- a/lib/rexml/document.rb
+++ b/lib/rexml/document.rb
@@ -16,64 +16,64 @@ module REXML
# Document has a single child that can be accessed by root().
# Note that if you want to have an XML declaration written for a document
# you create, you must add one; REXML documents do not write a default
- # declaration for you. See |DECLARATION| and |write|.
- class Document < Element
- # A convenient default XML declaration. If you want an XML declaration,
- # the easiest way to add one is mydoc << Document::DECLARATION
+ # declaration for you. See |DECLARATION| and |write|.
+ class Document < Element
+ # A convenient default XML declaration. If you want an XML declaration,
+ # the easiest way to add one is mydoc << Document::DECLARATION
# +DEPRECATED+
# Use: mydoc << XMLDecl.default
- DECLARATION = XMLDecl.default
-
- # Constructor
- # @param source if supplied, must be a Document, String, or IO.
- # Documents have their context and Element attributes cloned.
- # Strings are expected to be valid XML documents. IOs are expected
- # to be sources of valid XML documents.
- # @param context if supplied, contains the context of the document;
- # this should be a Hash.
- def initialize( source = nil, context = {} )
+ DECLARATION = XMLDecl.default
+
+ # Constructor
+ # @param source if supplied, must be a Document, String, or IO.
+ # Documents have their context and Element attributes cloned.
+ # Strings are expected to be valid XML documents. IOs are expected
+ # to be sources of valid XML documents.
+ # @param context if supplied, contains the context of the document;
+ # this should be a Hash.
+ def initialize( source = nil, context = {} )
@entity_expansion_count = 0
- super()
- @context = context
- return if source.nil?
- if source.kind_of? Document
- @context = source.context
- super source
- else
- build( source )
- end
- end
+ super()
+ @context = context
+ return if source.nil?
+ if source.kind_of? Document
+ @context = source.context
+ super source
+ else
+ build( source )
+ end
+ end
def node_type
:document
end
- # Should be obvious
- def clone
- Document.new self
- end
+ # Should be obvious
+ def clone
+ Document.new self
+ end
- # According to the XML spec, a root node has no expanded name
- def expanded_name
- ''
- #d = doc_type
- #d ? d.name : "UNDEFINED"
- end
+ # According to the XML spec, a root node has no expanded name
+ def expanded_name
+ ''
+ #d = doc_type
+ #d ? d.name : "UNDEFINED"
+ end
- alias :name :expanded_name
+ alias :name :expanded_name
- # We override this, because XMLDecls and DocTypes must go at the start
- # of the document
- def add( child )
- if child.kind_of? XMLDecl
- @children.unshift child
+ # We override this, because XMLDecls and DocTypes must go at the start
+ # of the document
+ def add( child )
+ if child.kind_of? XMLDecl
+ @children.unshift child
child.parent = self
- elsif child.kind_of? DocType
- # Find first Element or DocType node and insert the decl right
+ elsif child.kind_of? DocType
+ # Find first Element or DocType node and insert the decl right
# before it. If there is no such node, just insert the child at the
# end. If there is a child and it is an DocType, then replace it.
insert_before_index = 0
- @children.find { |x|
+ @children.find { |x|
insert_before_index += 1
x.kind_of?(Element) || x.kind_of?(DocType)
}
@@ -86,60 +86,60 @@ module REXML
else # Insert at end of list
@children[insert_before_index] = child
end
- child.parent = self
- else
- rv = super
- raise "attempted adding second root element to document" if @elements.size > 1
- rv
- end
- end
- alias :<< :add
-
- def add_element(arg=nil, arg2=nil)
- rv = super
- raise "attempted adding second root element to document" if @elements.size > 1
- rv
- end
-
- # @return the root Element of the document, or nil if this document
- # has no children.
- def root
+ child.parent = self
+ else
+ rv = super
+ raise "attempted adding second root element to document" if @elements.size > 1
+ rv
+ end
+ end
+ alias :<< :add
+
+ def add_element(arg=nil, arg2=nil)
+ rv = super
+ raise "attempted adding second root element to document" if @elements.size > 1
+ rv
+ end
+
+ # @return the root Element of the document, or nil if this document
+ # has no children.
+ def root
elements[1]
#self
#@children.find { |item| item.kind_of? Element }
- end
-
- # @return the DocType child of the document, if one exists,
- # and nil otherwise.
- def doctype
- @children.find { |item| item.kind_of? DocType }
- end
-
- # @return the XMLDecl of this document; if no XMLDecl has been
- # set, the default declaration is returned.
- def xml_decl
- rv = @children[0]
+ end
+
+ # @return the DocType child of the document, if one exists,
+ # and nil otherwise.
+ def doctype
+ @children.find { |item| item.kind_of? DocType }
+ end
+
+ # @return the XMLDecl of this document; if no XMLDecl has been
+ # set, the default declaration is returned.
+ def xml_decl
+ rv = @children[0]
return rv if rv.kind_of? XMLDecl
rv = @children.unshift(XMLDecl.default)[0]
- end
-
- # @return the XMLDecl version of this document as a String.
- # If no XMLDecl has been set, returns the default version.
- def version
- xml_decl().version
- end
-
- # @return the XMLDecl encoding of this document as a String.
- # If no XMLDecl has been set, returns the default encoding.
- def encoding
- xml_decl().encoding
- end
-
- # @return the XMLDecl standalone value of this document as a String.
- # If no XMLDecl has been set, returns the default setting.
- def stand_alone?
- xml_decl().stand_alone?
- end
+ end
+
+ # @return the XMLDecl version of this document as a String.
+ # If no XMLDecl has been set, returns the default version.
+ def version
+ xml_decl().version
+ end
+
+ # @return the XMLDecl encoding of this document as a String.
+ # If no XMLDecl has been set, returns the default encoding.
+ def encoding
+ xml_decl().encoding
+ end
+
+ # @return the XMLDecl standalone value of this document as a String.
+ # If no XMLDecl has been set, returns the default setting.
+ def stand_alone?
+ xml_decl().stand_alone?
+ end
# Write the XML tree out, optionally with indent. This writes out the
# entire XML document, including XML declarations, doctype declarations,
@@ -167,9 +167,9 @@ module REXML
# indent::
# An integer. If -1, no indenting will be used; otherwise, the
# indentation will be twice this number of spaces, and children will be
- # indented an additional amount. For a value of 3, every item will be
+ # indented an additional amount. For a value of 3, every item will be
# indented 3 more levels, or 6 more spaces (2 * 3). Defaults to -1
- # transitive::
+ # trans::
# If transitive is true and indent is >= 0, then the output will be
# pretty-printed in such a way that the added whitespace does not affect
# the absolute *value* of the document -- that is, it leaves the value
@@ -178,15 +178,14 @@ module REXML
# Internet Explorer is the worst piece of crap to have ever been
# written, with the possible exception of Windows itself. Since IE is
# unable to parse proper XML, we have to provide a hack to generate XML
- # that IE's limited abilities can handle. This hack inserts a space
+ # that IE's limited abilities can handle. This hack inserts a space
# before the /> on empty tags. Defaults to false
- def write( output=$stdout, indent=-1, transitive=false, ie_hack=false )
+ def write( output=$stdout, indent=-1, trans=false, ie_hack=false )
if xml_decl.encoding != "UTF-8" && !output.kind_of?(Output)
output = Output.new( output, xml_decl.encoding )
end
formatter = if indent > -1
- if transitive
- require "rexml/formatters/transitive"
+ if trans
REXML::Formatters::Transitive.new( indent, ie_hack )
else
REXML::Formatters::Pretty.new( indent, ie_hack )
@@ -195,12 +194,12 @@ module REXML
REXML::Formatters::Default.new( ie_hack )
end
formatter.write( self, output )
- end
-
+ end
- def Document::parse_stream( source, listener )
- Parsers::StreamParser.new( source, listener ).parse
- end
+
+ def Document::parse_stream( source, listener )
+ Parsers::StreamParser.new( source, listener ).parse
+ end
@@entity_expansion_limit = 10_000
@@ -215,7 +214,7 @@ module REXML
end
attr_reader :entity_expansion_count
-
+
def record_entity_expansion
@entity_expansion_count += 1
if @entity_expansion_count > @@entity_expansion_limit
@@ -223,9 +222,9 @@ module REXML
end
end
- private
- def build( source )
+ private
+ def build( source )
Parsers::TreeParser.new( source, self ).parse
- end
- end
+ end
+ end
end
diff --git a/lib/rexml/dtd/attlistdecl.rb b/lib/rexml/dtd/attlistdecl.rb
index 25955ee274..e176bb0749 100644
--- a/lib/rexml/dtd/attlistdecl.rb
+++ b/lib/rexml/dtd/attlistdecl.rb
@@ -1,10 +1,10 @@
require "rexml/child"
module REXML
- module DTD
- class AttlistDecl < Child
- START = "<!ATTLIST"
- START_RE = /^\s*#{START}/um
- PATTERN_RE = /\s*(#{START}.*?>)/um
- end
- end
+ module DTD
+ class AttlistDecl < Child
+ START = "<!ATTLIST"
+ START_RE = /^\s*#{START}/um
+ PATTERN_RE = /\s*(#{START}.*?>)/um
+ end
+ end
end
diff --git a/lib/rexml/dtd/dtd.rb b/lib/rexml/dtd/dtd.rb
index 966e39ea57..4f735d4812 100644
--- a/lib/rexml/dtd/dtd.rb
+++ b/lib/rexml/dtd/dtd.rb
@@ -6,46 +6,46 @@ require "rexml/dtd/attlistdecl"
require "rexml/parent"
module REXML
- module DTD
- class Parser
- def Parser.parse( input )
- case input
- when String
- parse_helper input
- when File
- parse_helper input.read
- end
- end
+ module DTD
+ class Parser
+ def Parser.parse( input )
+ case input
+ when String
+ parse_helper input
+ when File
+ parse_helper input.read
+ end
+ end
- # Takes a String and parses it out
- def Parser.parse_helper( input )
- contents = Parent.new
- while input.size > 0
- case input
- when ElementDecl.PATTERN_RE
- match = $&
- source = $'
- contents << ElementDecl.new( match )
- when AttlistDecl.PATTERN_RE
- matchdata = $~
- source = $'
- contents << AttlistDecl.new( matchdata )
- when EntityDecl.PATTERN_RE
- matchdata = $~
- source = $'
- contents << EntityDecl.new( matchdata )
- when Comment.PATTERN_RE
- matchdata = $~
- source = $'
- contents << Comment.new( matchdata )
- when NotationDecl.PATTERN_RE
- matchdata = $~
- source = $'
- contents << NotationDecl.new( matchdata )
- end
- end
- contents
- end
- end
- end
+ # Takes a String and parses it out
+ def Parser.parse_helper( input )
+ contents = Parent.new
+ while input.size > 0
+ case input
+ when ElementDecl.PATTERN_RE
+ match = $&
+ source = $'
+ contents << ElementDecl.new( match )
+ when AttlistDecl.PATTERN_RE
+ matchdata = $~
+ source = $'
+ contents << AttlistDecl.new( matchdata )
+ when EntityDecl.PATTERN_RE
+ matchdata = $~
+ source = $'
+ contents << EntityDecl.new( matchdata )
+ when Comment.PATTERN_RE
+ matchdata = $~
+ source = $'
+ contents << Comment.new( matchdata )
+ when NotationDecl.PATTERN_RE
+ matchdata = $~
+ source = $'
+ contents << NotationDecl.new( matchdata )
+ end
+ end
+ contents
+ end
+ end
+ end
end
diff --git a/lib/rexml/dtd/elementdecl.rb b/lib/rexml/dtd/elementdecl.rb
index a0bf641300..c4e620f389 100644
--- a/lib/rexml/dtd/elementdecl.rb
+++ b/lib/rexml/dtd/elementdecl.rb
@@ -1,17 +1,17 @@
require "rexml/child"
module REXML
- module DTD
- class ElementDecl < Child
- START = "<!ELEMENT"
- START_RE = /^\s*#{START}/um
- PATTERN_RE = /^\s*(#{START}.*?)>/um
- PATTERN_RE = /^\s*#{START}\s+((?:[:\w_][-\.\w_]*:)?[-!\*\.\w_]*)(.*?)>/
- #\s*((((["']).*?\5)|[^\/'">]*)*?)(\/)?>/um, true)
+ module DTD
+ class ElementDecl < Child
+ START = "<!ELEMENT"
+ START_RE = /^\s*#{START}/um
+ PATTERN_RE = /^\s*(#{START}.*?)>/um
+ PATTERN_RE = /^\s*#{START}\s+((?:[:\w_][-\.\w_]*:)?[-!\*\.\w_]*)(.*?)>/
+ #\s*((((["']).*?\5)|[^\/'">]*)*?)(\/)?>/um, true)
- def initialize match
- @name = match[1]
- @rest = match[2]
- end
- end
- end
+ def initialize match
+ @name = match[1]
+ @rest = match[2]
+ end
+ end
+ end
end
diff --git a/lib/rexml/dtd/entitydecl.rb b/lib/rexml/dtd/entitydecl.rb
index a9286b2b90..a5f1520f2b 100644
--- a/lib/rexml/dtd/entitydecl.rb
+++ b/lib/rexml/dtd/entitydecl.rb
@@ -1,56 +1,56 @@
require "rexml/child"
module REXML
- module DTD
- class EntityDecl < Child
- START = "<!ENTITY"
- START_RE = /^\s*#{START}/um
- PUBLIC = /^\s*#{START}\s+(?:%\s+)?(\w+)\s+PUBLIC\s+((["']).*?\3)\s+((["']).*?\5)\s*>/um
- SYSTEM = /^\s*#{START}\s+(?:%\s+)?(\w+)\s+SYSTEM\s+((["']).*?\3)(?:\s+NDATA\s+\w+)?\s*>/um
- PLAIN = /^\s*#{START}\s+(\w+)\s+((["']).*?\3)\s*>/um
- PERCENT = /^\s*#{START}\s+%\s+(\w+)\s+((["']).*?\3)\s*>/um
- # <!ENTITY name SYSTEM "...">
- # <!ENTITY name "...">
- def initialize src
- super()
- md = nil
- if src.match( PUBLIC )
- md = src.match( PUBLIC, true )
- @middle = "PUBLIC"
- @content = "#{md[2]} #{md[4]}"
- elsif src.match( SYSTEM )
- md = src.match( SYSTEM, true )
- @middle = "SYSTEM"
- @content = md[2]
- elsif src.match( PLAIN )
- md = src.match( PLAIN, true )
- @middle = ""
- @content = md[2]
- elsif src.match( PERCENT )
- md = src.match( PERCENT, true )
- @middle = ""
- @content = md[2]
- end
- raise ParseException.new("failed Entity match", src) if md.nil?
- @name = md[1]
- end
+ module DTD
+ class EntityDecl < Child
+ START = "<!ENTITY"
+ START_RE = /^\s*#{START}/um
+ PUBLIC = /^\s*#{START}\s+(?:%\s+)?(\w+)\s+PUBLIC\s+((["']).*?\3)\s+((["']).*?\5)\s*>/um
+ SYSTEM = /^\s*#{START}\s+(?:%\s+)?(\w+)\s+SYSTEM\s+((["']).*?\3)(?:\s+NDATA\s+\w+)?\s*>/um
+ PLAIN = /^\s*#{START}\s+(\w+)\s+((["']).*?\3)\s*>/um
+ PERCENT = /^\s*#{START}\s+%\s+(\w+)\s+((["']).*?\3)\s*>/um
+ # <!ENTITY name SYSTEM "...">
+ # <!ENTITY name "...">
+ def initialize src
+ super()
+ md = nil
+ if src.match( PUBLIC )
+ md = src.match( PUBLIC, true )
+ @middle = "PUBLIC"
+ @content = "#{md[2]} #{md[4]}"
+ elsif src.match( SYSTEM )
+ md = src.match( SYSTEM, true )
+ @middle = "SYSTEM"
+ @content = md[2]
+ elsif src.match( PLAIN )
+ md = src.match( PLAIN, true )
+ @middle = ""
+ @content = md[2]
+ elsif src.match( PERCENT )
+ md = src.match( PERCENT, true )
+ @middle = ""
+ @content = md[2]
+ end
+ raise ParseException.new("failed Entity match", src) if md.nil?
+ @name = md[1]
+ end
- def to_s
- rv = "<!ENTITY #@name "
- rv << "#@middle " if @middle.size > 0
- rv << @content
- rv
- end
+ def to_s
+ rv = "<!ENTITY #@name "
+ rv << "#@middle " if @middle.size > 0
+ rv << @content
+ rv
+ end
- def write( output, indent )
+ def write( output, indent )
indent( output, indent )
- output << to_s
- end
+ output << to_s
+ end
- def EntityDecl.parse_source source, listener
- md = source.match( PATTERN_RE, true )
- thing = md[0].squeeze(" \t\n\r")
- listener.send inspect.downcase, thing
- end
- end
- end
+ def EntityDecl.parse_source source, listener
+ md = source.match( PATTERN_RE, true )
+ thing = md[0].squeeze(" \t\n\r")
+ listener.send inspect.downcase, thing
+ end
+ end
+ end
end
diff --git a/lib/rexml/dtd/notationdecl.rb b/lib/rexml/dtd/notationdecl.rb
index 17d1b9ef29..a47ff8f24b 100644
--- a/lib/rexml/dtd/notationdecl.rb
+++ b/lib/rexml/dtd/notationdecl.rb
@@ -1,39 +1,39 @@
require "rexml/child"
module REXML
- module DTD
- class NotationDecl < Child
- START = "<!NOTATION"
- START_RE = /^\s*#{START}/um
- PUBLIC = /^\s*#{START}\s+(\w[\w-]*)\s+(PUBLIC)\s+((["']).*?\4)\s*>/um
- SYSTEM = /^\s*#{START}\s+(\w[\w-]*)\s+(SYSTEM)\s+((["']).*?\4)\s*>/um
- def initialize src
- super()
- if src.match( PUBLIC )
- md = src.match( PUBLIC, true )
- elsif src.match( SYSTEM )
- md = src.match( SYSTEM, true )
- else
- raise ParseException.new( "error parsing notation: no matching pattern", src )
- end
- @name = md[1]
- @middle = md[2]
- @rest = md[3]
- end
+ module DTD
+ class NotationDecl < Child
+ START = "<!NOTATION"
+ START_RE = /^\s*#{START}/um
+ PUBLIC = /^\s*#{START}\s+(\w[\w-]*)\s+(PUBLIC)\s+((["']).*?\4)\s*>/um
+ SYSTEM = /^\s*#{START}\s+(\w[\w-]*)\s+(SYSTEM)\s+((["']).*?\4)\s*>/um
+ def initialize src
+ super()
+ if src.match( PUBLIC )
+ md = src.match( PUBLIC, true )
+ elsif src.match( SYSTEM )
+ md = src.match( SYSTEM, true )
+ else
+ raise ParseException.new( "error parsing notation: no matching pattern", src )
+ end
+ @name = md[1]
+ @middle = md[2]
+ @rest = md[3]
+ end
- def to_s
- "<!NOTATION #@name #@middle #@rest>"
- end
+ def to_s
+ "<!NOTATION #@name #@middle #@rest>"
+ end
- def write( output, indent )
+ def write( output, indent )
indent( output, indent )
- output << to_s
- end
+ output << to_s
+ end
- def NotationDecl.parse_source source, listener
- md = source.match( PATTERN_RE, true )
- thing = md[0].squeeze(" \t\n\r")
- listener.send inspect.downcase, thing
- end
- end
- end
+ def NotationDecl.parse_source source, listener
+ md = source.match( PATTERN_RE, true )
+ thing = md[0].squeeze(" \t\n\r")
+ listener.send inspect.downcase, thing
+ end
+ end
+ end
end
diff --git a/lib/rexml/element.rb b/lib/rexml/element.rb
index 7a3abc65e5..3db87c6126 100644
--- a/lib/rexml/element.rb
+++ b/lib/rexml/element.rb
@@ -30,13 +30,13 @@ module REXML
attr_accessor :context
# Constructor
- # arg::
+ # arg::
# if not supplied, will be set to the default value.
# If a String, the name of this object will be set to the argument.
- # If an Element, the object will be shallowly cloned; name,
+ # If an Element, the object will be shallowly cloned; name,
# attributes, and namespaces will be copied. Children will +not+ be
# copied.
- # parent::
+ # parent::
# if supplied, must be a Parent, and will be used as
# the parent of this object.
# context::
@@ -97,7 +97,7 @@ module REXML
self.class.new self
end
- # Evaluates to the root node of the document that this element
+ # Evaluates to the root node of the document that this element
# belongs to. If this element doesn't belong to a document, but does
# belong to another Element, the parent's root will be returned, until the
# earliest ancestor is found.
@@ -137,8 +137,8 @@ module REXML
# is the case if:
# 1. Neither :+respect_whitespace+ nor :+compress_whitespace+ has any value
# 2. The context has :+respect_whitespace+ set to :+all+ or
- # an array containing the name of this element, and
- # :+compress_whitespace+ isn't set to :+all+ or an array containing the
+ # an array containing the name of this element, and
+ # :+compress_whitespace+ isn't set to :+all+ or an array containing the
# name of this element.
# The evaluation is tested against +expanded_name+, and so is namespace
# sensitive.
@@ -162,7 +162,7 @@ module REXML
@ignore_whitespace_nodes = false
if @context
if @context[:ignore_whitespace_nodes]
- @ignore_whitespace_nodes =
+ @ignore_whitespace_nodes =
(@context[:ignore_whitespace_nodes] == :all or
@context[:ignore_whitespace_nodes].include? expanded_name)
end
@@ -206,13 +206,13 @@ module REXML
return namespaces
end
- # Evalutas to the URI for a prefix, or the empty string if no such
+ # Evalutas to the URI for a prefix, or the empty string if no such
# namespace is declared for this element. Evaluates recursively for
# ancestors. Returns the default namespace, if there is one.
- # prefix::
+ # prefix::
# the prefix to search for. If not supplied, returns the default
# namespace if one exists
- # Returns::
+ # Returns::
# the namespace URI as a String, or nil if no such namespace
# exists. If the namespace is undefined, returns an empty string
# doc = Document.new("<a xmlns='1' xmlns:y='2'><b/><c xmlns:z='3'/></a>")
@@ -235,10 +235,10 @@ module REXML
end
# Adds a namespace to this element.
- # prefix::
+ # prefix::
# the prefix string, or the namespace URI if +uri+ is not
# supplied
- # uri::
+ # uri::
# the namespace URI. May be nil, in which +prefix+ is used as
# the URI
# Evaluates to: this Element
@@ -280,12 +280,12 @@ module REXML
# Adds a child to this element, optionally setting attributes in
# the element.
- # element::
+ # element::
# optional. If Element, the element is added.
# Otherwise, a new Element is constructed with the argument (see
# Element.initialize).
- # attrs::
- # If supplied, must be a Hash containing String name,value
+ # attrs::
+ # If supplied, must be a Hash containing String name,value
# pairs, which will be used to set the attributes of the new Element.
# Returns:: the Element that was added
# el = doc.add_element 'my-tag'
@@ -296,15 +296,15 @@ module REXML
raise "First argument must be either an element name, or an Element object" if element.nil?
el = @elements.add(element)
attrs.each do |key, value|
- el.attributes[key]=value
+ el.attributes[key]=Attribute.new(key,value,self)
end if attrs.kind_of? Hash
el
end
# Deletes a child element.
- # element::
- # Must be an +Element+, +String+, or +Integer+. If Element,
- # the element is removed. If String, the element is found (via XPath)
+ # element::
+ # Must be an +Element+, +String+, or +Integer+. If Element,
+ # the element is removed. If String, the element is found (via XPath)
# and removed. <em>This means that any parent can remove any
# descendant.<em> If Integer, the Element indexed by that number will be
# removed.
@@ -327,14 +327,14 @@ module REXML
# Iterates through the child elements, yielding for each Element that
# has a particular attribute set.
- # key::
+ # key::
# the name of the attribute to search for
- # value::
+ # value::
# the value of the attribute
- # max::
- # (optional) causes this method to return after yielding
+ # max::
+ # (optional) causes this method to return after yielding
# for this number of matching children
- # name::
+ # name::
# (optional) if supplied, this is an XPath that filters
# the children to check.
#
@@ -348,7 +348,7 @@ module REXML
# # Yields d
# doc.root.each_element_with_attribute( 'id', '1', 0, 'd' ) {|e| p e}
def each_element_with_attribute( key, value=nil, max=0, name=nil, &block ) # :yields: Element
- each_with_something( proc {|child|
+ each_with_something( proc {|child|
if value.nil?
child.attributes[key] != nil
else
@@ -359,13 +359,13 @@ module REXML
# Iterates through the children, yielding for each Element that
# has a particular text set.
- # text::
+ # text::
# the text to search for. If nil, or not supplied, will iterate
# over all +Element+ children that contain at least one +Text+ node.
- # max::
+ # max::
# (optional) causes this method to return after yielding
# for this number of matching children
- # name::
+ # name::
# (optional) if supplied, this is an XPath that filters
# the children to check.
#
@@ -379,7 +379,7 @@ module REXML
# # Yields d
# doc.each_element_with_text(nil, 0, 'd'){|e|p e}
def each_element_with_text( text=nil, max=0, name=nil, &block ) # :yields: Element
- each_with_something( proc {|child|
+ each_with_something( proc {|child|
if text.nil?
child.has_text?
else
@@ -408,7 +408,7 @@ module REXML
# doc.root.elements['c'].next_element #-> nil
def next_element
element = next_sibling
- element = element.next_sibling until element.nil? or element.kind_of? Element
+ element = element.next_sibling until element.nil? or element.kind_of? Element
return element
end
@@ -477,7 +477,7 @@ module REXML
# this method with a nil argument. In this case, the next Text
# child becomes the first Text child. In no case is the order of
# any siblings disturbed.
- # text::
+ # text::
# If a String, a new Text child is created and added to
# this Element as the first Text child. If Text, the text is set
# as the first Child element. If nil, then any existing first Text
@@ -520,7 +520,7 @@ module REXML
# Note that at the end of this example, the branch has <b>3</b> nodes; the 'e'
# element and <b>2</b> Text node children.
def add_text( text )
- if text.kind_of? String
+ if text.kind_of? String
if @children[-1].kind_of? Text
@children[-1] << text
return
@@ -552,25 +552,9 @@ module REXML
def attribute( name, namespace=nil )
prefix = nil
- if namespaces.respond_to? :key
- prefix = namespaces.key(namespace) if namespace
- else
- prefix = namespaces.index(namespace) if namespace
- end
+ prefix = namespaces.index(namespace) if namespace
prefix = nil if prefix == 'xmlns'
-
- ret_val =
- attributes.get_attribute( "#{prefix ? prefix + ':' : ''}#{name}" )
-
- return ret_val unless ret_val.nil?
- return nil if prefix.nil?
-
- # now check that prefix'es namespace is not the same as the
- # default namespace
- return nil unless ( namespaces[ prefix ] == namespaces[ 'xmlns' ] )
-
- attributes.get_attribute( name )
-
+ attributes.get_attribute( "#{prefix ? prefix + ':' : ''}#{name}" )
end
# Evaluates to +true+ if this element has any attributes set, false
@@ -586,7 +570,7 @@ module REXML
# the attribute is added to the list of Element attributes. If String,
# the argument is used as the name of the new attribute, and the value
# parameter must be supplied.
- # value::
+ # value::
# Required if +key+ is a String, and ignored if the first argument is
# an Attribute. This is a String, and is used as the value
# of the new Attribute. This should be the unnormalized value of the
@@ -621,7 +605,7 @@ module REXML
# either an Attribute or a String. In either case, the
# attribute is found by matching the attribute name to the argument,
# and then removed. If no attribute is found, no action is taken.
- # Returns::
+ # Returns::
# the attribute removed, or nil if this Element did not contain
# a matching attribute
# e = Element.new('E')
@@ -638,7 +622,7 @@ module REXML
# Other Utilities #
#################################################
- # Get an array of all CData children.
+ # Get an array of all CData children.
# IMMUTABLE
def cdatas
find_all { |child| child.kind_of? CData }.freeze
@@ -681,17 +665,16 @@ module REXML
# Internet Explorer is the worst piece of crap to have ever been
# written, with the possible exception of Windows itself. Since IE is
# unable to parse proper XML, we have to provide a hack to generate XML
- # that IE's limited abilities can handle. This hack inserts a space
+ # that IE's limited abilities can handle. This hack inserts a space
# before the /> on empty tags. Defaults to false
#
# out = ''
# doc.write( out ) #-> doc is written to the string 'out'
# doc.write( $stdout ) #-> doc written to the console
- def write(output=$stdout, indent=-1, transitive=false, ie_hack=false)
+ def write(writer=$stdout, indent=-1, transitive=false, ie_hack=false)
Kernel.warn("#{self.class.name}.write is deprecated. See REXML::Formatters")
formatter = if indent > -1
if transitive
- require "rexml/formatters/transitive"
REXML::Formatters::Transitive.new( indent, ie_hack )
else
REXML::Formatters::Pretty.new( indent, ie_hack )
@@ -707,8 +690,8 @@ module REXML
def __to_xpath_helper node
rv = node.expanded_name.clone
if node.parent
- results = node.parent.find_all {|n|
- n.kind_of?(REXML::Element) and n.expanded_name == node.expanded_name
+ results = node.parent.find_all {|n|
+ n.kind_of?(REXML::Element) and n.expanded_name == node.expanded_name
}
if results.length > 1
idx = results.index( node )
@@ -721,6 +704,7 @@ module REXML
# A private helper method
def each_with_something( test, max=0, name=nil )
num = 0
+ child=nil
@elements.each( name ){ |child|
yield child if test.call(child) and num += 1
return if max>0 and num == max
@@ -734,7 +718,7 @@ module REXML
# A class which provides filtering of children for Elements, and
# XPath search support. You are expected to only encounter this class as
- # the <tt>element.elements</tt> object. Therefore, you are
+ # the <tt>element.elements</tt> object. Therefore, you are
# _not_ expected to instantiate this yourself.
class Elements
include Enumerable
@@ -746,7 +730,7 @@ module REXML
# Fetches a child element. Filters only Element children, regardless of
# the XPath match.
- # index::
+ # index::
# the search parameter. This is either an Integer, which
# will be used to find the index'th child Element, or an XPath,
# which will be used to search for the Element. <em>Because
@@ -756,7 +740,7 @@ module REXML
# child element is at index 1, not 0, and the +n+th element is at index
# +n+, not <tt>n-1</tt>. This is because XPath indexes element children
# starting from 1, not 0, and the indexes should be the same.
- # name::
+ # name::
# optional, and only used in the first argument is an
# Integer. In that case, the index'th child Element that has the
# supplied name will be returned. Note again that the indexes start at 1.
@@ -770,14 +754,15 @@ module REXML
raise "index (#{index}) must be >= 1" if index < 1
name = literalize(name) if name
num = 0
+ child = nil
@element.find { |child|
child.kind_of? Element and
- (name.nil? ? true : child.has_name?( name )) and
+ (name.nil? ? true : child.has_name?( name )) and
(num += 1) == index
}
else
return XPath::first( @element, index )
- #{ |element|
+ #{ |element|
# return element if element.kind_of? Element
#}
#return nil
@@ -787,7 +772,7 @@ module REXML
# Sets an element, replacing any previous matching element. If no
# existing element is found ,the element is added.
# index:: Used to find a matching element to replace. See []().
- # element::
+ # element::
# The element to replace the existing element with
# the previous element
# Returns:: nil if no previous element was found.
@@ -812,12 +797,12 @@ module REXML
@element.find{ |child| child.kind_of? Element}.nil?
end
- # Returns the index of the supplied child (starting at 1), or -1 if
+ # Returns the index of the supplied child (starting at 1), or -1 if
# the element is not a child
# element:: an +Element+ child
def index element
rv = 0
- found = @element.find do |child|
+ found = @element.find do |child|
child.kind_of? Element and
(rv += 1) and
child == element
@@ -827,7 +812,7 @@ module REXML
end
# Deletes a child Element
- # element::
+ # element::
# Either an Element, which is removed directly; an
# xpath, where the first matching child is removed; or an Integer,
# where the n'th Element is removed.
@@ -854,7 +839,7 @@ module REXML
# deleted = doc.elements.delete_all 'a/c' #-> [<c/>, <c/>, <c/>, <c/>]
def delete_all( xpath )
rv = []
- XPath::each( @element, xpath) {|element|
+ XPath::each( @element, xpath) {|element|
rv << element if element.kind_of? Element
}
rv.each do |element|
@@ -865,7 +850,7 @@ module REXML
end
# Adds an element
- # element::
+ # element::
# if supplied, is either an Element, String, or
# Source (see Element.initialize). If not supplied or nil, a
# new, default Element will be constructed
@@ -890,8 +875,8 @@ module REXML
# Iterates through all of the child Elements, optionally filtering
# them by a given XPath
- # xpath::
- # optional. If supplied, this is a String XPath, and is used to
+ # xpath::
+ # optional. If supplied, this is a String XPath, and is used to
# filter the children, so that only matching children are yielded. Note
# that XPaths are automatically filtered for Elements, so that
# non-Element children will not be yielded
@@ -908,8 +893,8 @@ module REXML
def collect( xpath=nil, &block )
collection = []
- XPath::each( @element, xpath ) {|e|
- collection << yield(e) if e.kind_of?(Element)
+ XPath::each( @element, xpath ) {|e|
+ collection << yield(e) if e.kind_of?(Element)
}
collection
end
@@ -944,7 +929,7 @@ module REXML
# supplied XPath matches non-Element children.
# doc = Document.new '<a>sean<b/>elliott<c/></a>'
# doc.root.elements.to_a #-> [ <b/>, <c/> ]
- # doc.root.elements.to_a("child::node()") #-> [ <b/>, <c/> ]
+ # doc.root.elements.to_a("child::node()") #-> [ <b/>, <c/> ]
# XPath.match(doc.root, "child::node()") #-> [ sean, <b/>, elliott, <c/> ]
def to_a( xpath=nil )
rv = XPath.match( @element, xpath )
@@ -964,7 +949,7 @@ module REXML
# ATTRIBUTES #
########################################################################
- # A class that defines the set of Attributes of an Element and provides
+ # A class that defines the set of Attributes of an Element and provides
# operations for accessing elements in that set.
class Attributes < Hash
# Constructor
@@ -976,11 +961,11 @@ module REXML
# Fetches an attribute value. If you want to get the Attribute itself,
# use get_attribute()
# name:: an XPath attribute name. Namespaces are relevant here.
- # Returns::
+ # Returns::
# the String value of the matching attribute, or +nil+ if no
# matching attribute was found. This is the unnormalized value
# (with entities expanded).
- #
+ #
# doc = Document.new "<a foo:att='1' bar:att='2' att='&lt;'/>"
# doc.root.attributes['att'] #-> '<'
# doc.root.attributes['bar:att'] #-> '2'
@@ -1006,7 +991,7 @@ module REXML
# Iterates over the attributes of an Element. Yields actual Attribute
# nodes, not String values.
- #
+ #
# doc = Document.new '<a x="1" y="2"/>'
# doc.root.attributes.each_attribute {|attr|
# p attr.expanded_name+" => "+attr.value
@@ -1028,12 +1013,12 @@ module REXML
# doc.root.attributes.each {|name, value| p name+" => "+value }
def each
each_attribute do |attr|
- yield [attr.expanded_name, attr.value]
+ yield attr.expanded_name, attr.value
end
end
# Fetches an attribute
- # name::
+ # name::
# the name by which to search for the attribute. Can be a
# <tt>prefix:name</tt> namespace name.
# Returns:: The first matching attribute, or nil if there was none. This
@@ -1077,10 +1062,10 @@ module REXML
# Sets an attribute, overwriting any existing attribute value by the
# same name. Namespace is significant.
# name:: the name of the attribute
- # value::
+ # value::
# (optional) If supplied, the value of the attribute. If
# nil, any existing matching attribute is deleted.
- # Returns::
+ # Returns::
# Owning element
# doc = Document.new "<a x:foo='1' foo='3'/>"
# doc.root.attributes['y:foo'] = '2'
@@ -1109,13 +1094,13 @@ module REXML
old_attr[value.prefix] = value
elsif old_attr.prefix != value.prefix
# Check for conflicting namespaces
- raise ParseException.new(
+ raise ParseException.new(
"Namespace conflict in adding attribute \"#{value.name}\": "+
"Prefix \"#{old_attr.prefix}\" = "+
"\"#{@element.namespace(old_attr.prefix)}\" and prefix "+
- "\"#{value.prefix}\" = \"#{@element.namespace(value.prefix)}\"") if
+ "\"#{value.prefix}\" = \"#{@element.namespace(value.prefix)}\"") if
value.prefix != "xmlns" and old_attr.prefix != "xmlns" and
- @element.namespace( old_attr.prefix ) ==
+ @element.namespace( old_attr.prefix ) ==
@element.namespace( value.prefix )
store value.name, { old_attr.prefix => old_attr,
value.prefix => value }
@@ -1125,7 +1110,7 @@ module REXML
return @element
end
- # Returns an array of Strings containing all of the prefixes declared
+ # Returns an array of Strings containing all of the prefixes declared
# by this set of # attributes. The array does not include the default
# namespace declaration, if one exists.
# doc = Document.new("<a xmlns='foo' xmlns:x='bar' xmlns:y='twee' "+
@@ -1164,7 +1149,7 @@ module REXML
end
# Removes an attribute
- # attribute::
+ # attribute::
# either a String, which is the name of the attribute to remove --
# namespaces are significant here -- or the attribute to remove.
# Returns:: the owning element
@@ -1212,12 +1197,12 @@ module REXML
alias :<< :add
# Deletes all attributes matching a name. Namespaces are significant.
- # name::
+ # name::
# A String; all attributes that match this path will be removed
# Returns:: an Array of the Attributes that were removed
def delete_all( name )
rv = []
- each_attribute { |attribute|
+ each_attribute { |attribute|
rv << attribute if attribute.expanded_name == name
}
rv.each{ |attr| attr.remove }
@@ -1227,20 +1212,16 @@ module REXML
# The +get_attribute_ns+ method retrieves a method by its namespace
# and name. Thus it is possible to reliably identify an attribute
# even if an XML processor has changed the prefix.
- #
+ #
# Method contributed by Henrik Martensson
def get_attribute_ns(namespace, name)
- result = nil
each_attribute() { |attribute|
if name == attribute.name &&
- namespace == attribute.namespace() &&
- ( !namespace.empty? || !attribute.fully_expanded_name.index(':') )
- # foo will match xmlns:foo, but only if foo isn't also an attribute
- result = attribute if !result or !namespace.empty? or
- !attribute.fully_expanded_name.index(':')
+ namespace == attribute.namespace()
+ return attribute
end
}
- result
+ nil
end
end
end
diff --git a/lib/rexml/encoding.rb b/lib/rexml/encoding.rb
index 3feffb80f4..a01763be99 100644
--- a/lib/rexml/encoding.rb
+++ b/lib/rexml/encoding.rb
@@ -29,7 +29,7 @@ module REXML
if enc and enc != UTF_8
@encoding = enc
raise ArgumentError, "Bad encoding name #@encoding" unless @encoding =~ /^[\w-]+$/
- @encoding.untaint
+ @encoding.untaint
begin
require 'rexml/encodings/ICONV.rb'
Encoding.apply(self, "ICONV")
@@ -56,14 +56,14 @@ module REXML
def check_encoding str
# We have to recognize UTF-16, LSB UTF-16, and UTF-8
- if str[0,2] == "\xfe\xff"
+ if str[0] == 0xfe && str[1] == 0xff
str[0,2] = ""
return UTF_16
- elsif str[0,2] == "\xff\xfe"
+ elsif str[0] == 0xff && str[1] == 0xfe
str[0,2] = ""
return UNILE
end
- str =~ /^\s*<\?xml\s+version\s*=\s*(['"]).*?\1\s+encoding\s*=\s*(["'])(.*?)\2/m
+ str =~ /^\s*<\?xml\s+version\s*=\s*(['"]).*?\1\s+encoding\s*=\s*(["'])(.*?)\2/um
return $3.upcase if $3
return UTF_8
end
diff --git a/lib/rexml/encodings/CP-1252.rb b/lib/rexml/encodings/CP-1252.rb
index 587c5bdd68..8675f9ff98 100644
--- a/lib/rexml/encodings/CP-1252.rb
+++ b/lib/rexml/encodings/CP-1252.rb
@@ -3,12 +3,12 @@
#
module REXML
module Encoding
- register( "CP-1252" ) do |o|
- class << o
- alias encode encode_cp1252
- alias decode decode_cp1252
- end
- end
+ register( "CP-1252" ) do |o|
+ class << o
+ alias encode encode_cp1252
+ alias decode decode_cp1252
+ end
+ end
# Convert from UTF-8
def encode_cp1252(content)
@@ -58,7 +58,7 @@ module REXML
end
array_enc.pack('C*')
end
-
+
# Convert to UTF-8
def decode_cp1252(str)
array_latin9 = str.unpack('C*')
diff --git a/lib/rexml/encodings/ISO-8859-15.rb b/lib/rexml/encodings/ISO-8859-15.rb
index 08a19cb755..8dea0d38a4 100644
--- a/lib/rexml/encodings/ISO-8859-15.rb
+++ b/lib/rexml/encodings/ISO-8859-15.rb
@@ -3,10 +3,10 @@
#
module REXML
module Encoding
- register("ISO-8859-15") do |o|
- alias encode to_iso_8859_15
+ register("ISO-8859-15") do |o|
+ alias encode to_iso_8859_15
alias decode from_iso_8859_15
- end
+ end
# Convert from UTF-8
def to_iso_8859_15(content)
@@ -46,7 +46,7 @@ module REXML
end
array_enc.pack('C*')
end
-
+
# Convert to UTF-8
def from_iso_8859_15(str)
array_latin9 = str.unpack('C*')
diff --git a/lib/rexml/encodings/UNILE.rb b/lib/rexml/encodings/UNILE.rb
index 1a18f0c932..d054140c40 100644
--- a/lib/rexml/encodings/UNILE.rb
+++ b/lib/rexml/encodings/UNILE.rb
@@ -18,7 +18,7 @@ module REXML
def decode_unile(str)
array_enc=str.unpack('C*')
array_utf8 = []
- 0.step(array_enc.size-1, 2){|i|
+ 0.step(array_enc.size-1, 2){|i|
array_utf8 << (array_enc.at(i) + array_enc.at(i+1)*0x100)
}
array_utf8.pack('U*')
diff --git a/lib/rexml/encodings/UTF-16.rb b/lib/rexml/encodings/UTF-16.rb
index 2ec058eed5..007c493d9c 100644
--- a/lib/rexml/encodings/UTF-16.rb
+++ b/lib/rexml/encodings/UTF-16.rb
@@ -19,7 +19,7 @@ module REXML
str = str[2..-1] if /^\376\377/n =~ str
array_enc=str.unpack('C*')
array_utf8 = []
- 0.step(array_enc.size-1, 2){|i|
+ 0.step(array_enc.size-1, 2){|i|
array_utf8 << (array_enc.at(i+1) + array_enc.at(i)*0x100)
}
array_utf8.pack('U*')
diff --git a/lib/rexml/entity.rb b/lib/rexml/entity.rb
index 5e3edf4eeb..7e9b4e5e1a 100644
--- a/lib/rexml/entity.rb
+++ b/lib/rexml/entity.rb
@@ -3,164 +3,164 @@ require 'rexml/source'
require 'rexml/xmltokens'
module REXML
- # God, I hate DTDs. I really do. Why this idiot standard still
- # plagues us is beyond me.
- class Entity < Child
- include XMLTokens
- PUBIDCHAR = "\x20\x0D\x0Aa-zA-Z0-9\\-()+,./:=?;!*@$_%#"
- SYSTEMLITERAL = %Q{((?:"[^"]*")|(?:'[^']*'))}
- PUBIDLITERAL = %Q{("[#{PUBIDCHAR}']*"|'[#{PUBIDCHAR}]*')}
- EXTERNALID = "(?:(?:(SYSTEM)\\s+#{SYSTEMLITERAL})|(?:(PUBLIC)\\s+#{PUBIDLITERAL}\\s+#{SYSTEMLITERAL}))"
- NDATADECL = "\\s+NDATA\\s+#{NAME}"
- PEREFERENCE = "%#{NAME};"
- ENTITYVALUE = %Q{((?:"(?:[^%&"]|#{PEREFERENCE}|#{REFERENCE})*")|(?:'([^%&']|#{PEREFERENCE}|#{REFERENCE})*'))}
- PEDEF = "(?:#{ENTITYVALUE}|#{EXTERNALID})"
- ENTITYDEF = "(?:#{ENTITYVALUE}|(?:#{EXTERNALID}(#{NDATADECL})?))"
- PEDECL = "<!ENTITY\\s+(%)\\s+#{NAME}\\s+#{PEDEF}\\s*>"
- GEDECL = "<!ENTITY\\s+#{NAME}\\s+#{ENTITYDEF}\\s*>"
- ENTITYDECL = /\s*(?:#{GEDECL})|(?:#{PEDECL})/um
+ # God, I hate DTDs. I really do. Why this idiot standard still
+ # plagues us is beyond me.
+ class Entity < Child
+ include XMLTokens
+ PUBIDCHAR = "\x20\x0D\x0Aa-zA-Z0-9\\-()+,./:=?;!*@$_%#"
+ SYSTEMLITERAL = %Q{((?:"[^"]*")|(?:'[^']*'))}
+ PUBIDLITERAL = %Q{("[#{PUBIDCHAR}']*"|'[#{PUBIDCHAR}]*')}
+ EXTERNALID = "(?:(?:(SYSTEM)\\s+#{SYSTEMLITERAL})|(?:(PUBLIC)\\s+#{PUBIDLITERAL}\\s+#{SYSTEMLITERAL}))"
+ NDATADECL = "\\s+NDATA\\s+#{NAME}"
+ PEREFERENCE = "%#{NAME};"
+ ENTITYVALUE = %Q{((?:"(?:[^%&"]|#{PEREFERENCE}|#{REFERENCE})*")|(?:'([^%&']|#{PEREFERENCE}|#{REFERENCE})*'))}
+ PEDEF = "(?:#{ENTITYVALUE}|#{EXTERNALID})"
+ ENTITYDEF = "(?:#{ENTITYVALUE}|(?:#{EXTERNALID}(#{NDATADECL})?))"
+ PEDECL = "<!ENTITY\\s+(%)\\s+#{NAME}\\s+#{PEDEF}\\s*>"
+ GEDECL = "<!ENTITY\\s+#{NAME}\\s+#{ENTITYDEF}\\s*>"
+ ENTITYDECL = /\s*(?:#{GEDECL})|(?:#{PEDECL})/um
- attr_reader :name, :external, :ref, :ndata, :pubid
+ attr_reader :name, :external, :ref, :ndata, :pubid
- # Create a new entity. Simple entities can be constructed by passing a
- # name, value to the constructor; this creates a generic, plain entity
- # reference. For anything more complicated, you have to pass a Source to
- # the constructor with the entity definiton, or use the accessor methods.
- # +WARNING+: There is no validation of entity state except when the entity
- # is read from a stream. If you start poking around with the accessors,
- # you can easily create a non-conformant Entity. The best thing to do is
- # dump the stupid DTDs and use XMLSchema instead.
- #
- # e = Entity.new( 'amp', '&' )
- def initialize stream, value=nil, parent=nil, reference=false
- super(parent)
- @ndata = @pubid = @value = @external = nil
- if stream.kind_of? Array
- @name = stream[1]
- if stream[-1] == '%'
- @reference = true
- stream.pop
- else
- @reference = false
- end
- if stream[2] =~ /SYSTEM|PUBLIC/
- @external = stream[2]
- if @external == 'SYSTEM'
- @ref = stream[3]
- @ndata = stream[4] if stream.size == 5
- else
- @pubid = stream[3]
- @ref = stream[4]
- end
- else
- @value = stream[2]
- end
- else
- @reference = reference
- @external = nil
- @name = stream
- @value = value
- end
- end
+ # Create a new entity. Simple entities can be constructed by passing a
+ # name, value to the constructor; this creates a generic, plain entity
+ # reference. For anything more complicated, you have to pass a Source to
+ # the constructor with the entity definiton, or use the accessor methods.
+ # +WARNING+: There is no validation of entity state except when the entity
+ # is read from a stream. If you start poking around with the accessors,
+ # you can easily create a non-conformant Entity. The best thing to do is
+ # dump the stupid DTDs and use XMLSchema instead.
+ #
+ # e = Entity.new( 'amp', '&' )
+ def initialize stream, value=nil, parent=nil, reference=false
+ super(parent)
+ @ndata = @pubid = @value = @external = nil
+ if stream.kind_of? Array
+ @name = stream[1]
+ if stream[-1] == '%'
+ @reference = true
+ stream.pop
+ else
+ @reference = false
+ end
+ if stream[2] =~ /SYSTEM|PUBLIC/
+ @external = stream[2]
+ if @external == 'SYSTEM'
+ @ref = stream[3]
+ @ndata = stream[4] if stream.size == 5
+ else
+ @pubid = stream[3]
+ @ref = stream[4]
+ end
+ else
+ @value = stream[2]
+ end
+ else
+ @reference = reference
+ @external = nil
+ @name = stream
+ @value = value
+ end
+ end
- # Evaluates whether the given string matchs an entity definition,
- # returning true if so, and false otherwise.
- def Entity::matches? string
- (ENTITYDECL =~ string) == 0
- end
+ # Evaluates whether the given string matchs an entity definition,
+ # returning true if so, and false otherwise.
+ def Entity::matches? string
+ (ENTITYDECL =~ string) == 0
+ end
- # Evaluates to the unnormalized value of this entity; that is, replacing
- # all entities -- both %ent; and &ent; entities. This differs from
- # +value()+ in that +value+ only replaces %ent; entities.
- def unnormalized
- document.record_entity_expansion unless document.nil?
- v = value()
- return nil if v.nil?
- @unnormalized = Text::unnormalize(v, parent)
- @unnormalized
- end
+ # Evaluates to the unnormalized value of this entity; that is, replacing
+ # all entities -- both %ent; and &ent; entities. This differs from
+ # +value()+ in that +value+ only replaces %ent; entities.
+ def unnormalized
+ document.record_entity_expansion unless document.nil?
+ v = value()
+ return nil if v.nil?
+ @unnormalized = Text::unnormalize(v, parent)
+ @unnormalized
+ end
- #once :unnormalized
+ #once :unnormalized
- # Returns the value of this entity unprocessed -- raw. This is the
- # normalized value; that is, with all %ent; and &ent; entities intact
- def normalized
- @value
- end
+ # Returns the value of this entity unprocessed -- raw. This is the
+ # normalized value; that is, with all %ent; and &ent; entities intact
+ def normalized
+ @value
+ end
- # Write out a fully formed, correct entity definition (assuming the Entity
- # object itself is valid.)
+ # Write out a fully formed, correct entity definition (assuming the Entity
+ # object itself is valid.)
#
# out::
# An object implementing <TT>&lt;&lt;<TT> to which the entity will be
# output
# indent::
# *DEPRECATED* and ignored
- def write out, indent=-1
- out << '<!ENTITY '
- out << '% ' if @reference
- out << @name
- out << ' '
- if @external
- out << @external << ' '
- if @pubid
- q = @pubid.include?('"')?"'":'"'
- out << q << @pubid << q << ' '
- end
- q = @ref.include?('"')?"'":'"'
- out << q << @ref << q
- out << ' NDATA ' << @ndata if @ndata
- else
- q = @value.include?('"')?"'":'"'
- out << q << @value << q
- end
- out << '>'
- end
+ def write out, indent=-1
+ out << '<!ENTITY '
+ out << '% ' if @reference
+ out << @name
+ out << ' '
+ if @external
+ out << @external << ' '
+ if @pubid
+ q = @pubid.include?('"')?"'":'"'
+ out << q << @pubid << q << ' '
+ end
+ q = @ref.include?('"')?"'":'"'
+ out << q << @ref << q
+ out << ' NDATA ' << @ndata if @ndata
+ else
+ q = @value.include?('"')?"'":'"'
+ out << q << @value << q
+ end
+ out << '>'
+ end
- # Returns this entity as a string. See write().
- def to_s
- rv = ''
- write rv
- rv
- end
+ # Returns this entity as a string. See write().
+ def to_s
+ rv = ''
+ write rv
+ rv
+ end
- PEREFERENCE_RE = /#{PEREFERENCE}/um
- # Returns the value of this entity. At the moment, only internal entities
- # are processed. If the value contains internal references (IE,
- # %blah;), those are replaced with their values. IE, if the doctype
- # contains:
- # <!ENTITY % foo "bar">
- # <!ENTITY yada "nanoo %foo; nanoo>
- # then:
- # doctype.entity('yada').value #-> "nanoo bar nanoo"
- def value
- if @value
- matches = @value.scan(PEREFERENCE_RE)
- rv = @value.clone
- if @parent
- matches.each do |entity_reference|
- entity_value = @parent.entity( entity_reference[0] )
- rv.gsub!( /%#{entity_reference.join};/um, entity_value )
- end
- end
- return rv
- end
- nil
- end
- end
+ PEREFERENCE_RE = /#{PEREFERENCE}/um
+ # Returns the value of this entity. At the moment, only internal entities
+ # are processed. If the value contains internal references (IE,
+ # %blah;), those are replaced with their values. IE, if the doctype
+ # contains:
+ # <!ENTITY % foo "bar">
+ # <!ENTITY yada "nanoo %foo; nanoo>
+ # then:
+ # doctype.entity('yada').value #-> "nanoo bar nanoo"
+ def value
+ if @value
+ matches = @value.scan(PEREFERENCE_RE)
+ rv = @value.clone
+ if @parent
+ matches.each do |entity_reference|
+ entity_value = @parent.entity( entity_reference[0] )
+ rv.gsub!( /%#{entity_reference};/um, entity_value )
+ end
+ end
+ return rv
+ end
+ nil
+ end
+ end
- # This is a set of entity constants -- the ones defined in the XML
- # specification. These are +gt+, +lt+, +amp+, +quot+ and +apos+.
- module EntityConst
- # +>+
- GT = Entity.new( 'gt', '>' )
- # +<+
- LT = Entity.new( 'lt', '<' )
- # +&+
- AMP = Entity.new( 'amp', '&' )
- # +"+
- QUOT = Entity.new( 'quot', '"' )
- # +'+
- APOS = Entity.new( 'apos', "'" )
- end
+ # This is a set of entity constants -- the ones defined in the XML
+ # specification. These are +gt+, +lt+, +amp+, +quot+ and +apos+.
+ module EntityConst
+ # +>+
+ GT = Entity.new( 'gt', '>' )
+ # +<+
+ LT = Entity.new( 'lt', '<' )
+ # +&+
+ AMP = Entity.new( 'amp', '&' )
+ # +"+
+ QUOT = Entity.new( 'quot', '"' )
+ # +'+
+ APOS = Entity.new( 'apos', "'" )
+ end
end
diff --git a/lib/rexml/formatters/default.rb b/lib/rexml/formatters/default.rb
index 56a1d93783..77381bdf84 100644
--- a/lib/rexml/formatters/default.rb
+++ b/lib/rexml/formatters/default.rb
@@ -21,7 +21,7 @@ module REXML
def write( node, output )
case node
- when Document
+ when Document
if node.xml_decl.encoding != "UTF-8" && !output.kind_of?(Output)
output = Output.new( output, node.xml_decl.encoding )
end
@@ -63,14 +63,14 @@ module REXML
def write_element( node, output )
output << "<#{node.expanded_name}"
- node.attributes.to_a.sort_by {|attr| attr.name}.each do |attr|
+ node.attributes.each_attribute do |attr|
output << " "
attr.write( output )
end unless node.attributes.empty?
if node.children.empty?
output << " " if @ie_hack
- output << "/"
+ output << "/"
else
output << ">"
node.children.each { |child|
diff --git a/lib/rexml/formatters/pretty.rb b/lib/rexml/formatters/pretty.rb
index 17d217d1dc..dd03626a21 100644
--- a/lib/rexml/formatters/pretty.rb
+++ b/lib/rexml/formatters/pretty.rb
@@ -31,7 +31,6 @@ module REXML
@level = 0
@ie_hack = ie_hack
@width = 80
- @compact = false
end
protected
@@ -48,7 +47,7 @@ module REXML
if @ie_hack
output << " "
end
- output << "/"
+ output << "/"
else
output << ">"
# If compact and all children are text, and if the formatted output
diff --git a/lib/rexml/formatters/transitive.rb b/lib/rexml/formatters/transitive.rb
index 3a52e03f01..1d80f21fbb 100644
--- a/lib/rexml/formatters/transitive.rb
+++ b/lib/rexml/formatters/transitive.rb
@@ -12,10 +12,9 @@ module REXML
# formatted. Since this formatter does not alter whitespace nodes, the
# results of formatting already formatted XML will be odd.
class Transitive < Default
- def initialize( indentation=2, ie_hack=false )
+ def initialize( indentation=2 )
@indentation = indentation
@level = 0
- @ie_hack = ie_hack
end
protected
@@ -30,8 +29,7 @@ module REXML
output << "\n"
output << ' '*@level
if node.children.empty?
- output << " " if @ie_hack
- output << "/"
+ output << "/"
else
output << ">"
# If compact and all children are text, and if the formatted output
diff --git a/lib/rexml/functions.rb b/lib/rexml/functions.rb
index 2d30e5fe92..fefc9ef940 100644
--- a/lib/rexml/functions.rb
+++ b/lib/rexml/functions.rb
@@ -48,7 +48,7 @@ module REXML
# UNTESTED
def Functions::local_name( node_set=nil )
get_namespace( node_set ) do |node|
- return node.local_name
+ return node.local_name
end
end
@@ -57,7 +57,7 @@ module REXML
end
def Functions::name( node_set=nil )
- get_namespace( node_set ) do |node|
+ get_namespace( node_set ) do |node|
node.expanded_name
end
end
@@ -66,7 +66,7 @@ module REXML
def Functions::get_namespace( node_set = nil )
if node_set == nil
yield @@context[:node] if defined? @@context[:node].namespace
- else
+ else
if node_set.respond_to? :each
node_set.each { |node| yield node if defined? node.namespace }
elsif node_set.respond_to? :namespace
@@ -81,15 +81,15 @@ module REXML
#
# A number is converted to a string as follows
#
- # NaN is converted to the string NaN
+ # NaN is converted to the string NaN
#
- # positive zero is converted to the string 0
+ # positive zero is converted to the string 0
#
- # negative zero is converted to the string 0
+ # negative zero is converted to the string 0
#
- # positive infinity is converted to the string Infinity
+ # positive infinity is converted to the string Infinity
#
- # negative infinity is converted to the string -Infinity
+ # negative infinity is converted to the string -Infinity
#
# if the number is an integer, the number is represented in decimal form
# as a Number with no decimal point and no leading zeros, preceded by a
@@ -156,7 +156,7 @@ module REXML
string(string).include?(string(test))
end
- # Kouhei fixed this
+ # Kouhei fixed this
def Functions::substring_before( string, test )
ruby_string = string(string)
ruby_index = ruby_string.index(string(test))
@@ -166,7 +166,7 @@ module REXML
ruby_string[ 0...ruby_index ]
end
end
-
+
# Kouhei fixed this too
def Functions::substring_after( string, test )
ruby_string = string(string)
@@ -175,11 +175,11 @@ module REXML
""
end
- # Take equal portions of Mike Stok and Sean Russell; mix
+ # Take equal portions of Mike Stok and Sean Russell; mix
# vigorously, and pour into a tall, chilled glass. Serves 10,000.
def Functions::substring( string, start, length=nil )
ruby_string = string(string)
- ruby_length = if length.nil?
+ ruby_length = if length.nil?
ruby_string.length.to_f
else
number(length)
@@ -188,15 +188,15 @@ module REXML
# Handle the special cases
return '' if (
- ruby_length.nan? or
+ ruby_length.nan? or
ruby_start.nan? or
ruby_start.infinite?
)
infinite_length = ruby_length.infinite? == 1
ruby_length = ruby_string.length if infinite_length
-
- # Now, get the bounds. The XPath bounds are 1..length; the ruby bounds
+
+ # Now, get the bounds. The XPath bounds are 1..length; the ruby bounds
# are 0..length. Therefore, we have to offset the bounds by one.
ruby_start = ruby_start.round - 1
ruby_length = ruby_length.round
@@ -247,7 +247,7 @@ module REXML
0.upto(from.length - 1) { |pos|
from_char = from[pos]
unless map.has_key? from_char
- map[from_char] =
+ map[from_char] =
if pos < to.length
to[pos]
else
@@ -256,15 +256,9 @@ module REXML
end
}
- if ''.respond_to? :chars
- string(string).chars.collect { |c|
- if map.has_key? c then map[c] else c end
- }.compact.join
- else
- string(string).unpack('U*').collect { |c|
- if map.has_key? c then map[c] else c end
- }.compact.pack('U*')
- end
+ string(string).unpack('U*').collect { |c|
+ if map.has_key? c then map[c] else c end
+ }.compact.pack('U*')
end
# UNTESTED
@@ -359,7 +353,7 @@ module REXML
nodes = [nodes] unless nodes.kind_of? Array
nodes.inject(0) { |r,n| r += number(string(n)) }
end
-
+
def Functions::floor( number )
number(number).floor
end
diff --git a/lib/rexml/instruction.rb b/lib/rexml/instruction.rb
index f8b734a5b5..c16b894b4a 100644
--- a/lib/rexml/instruction.rb
+++ b/lib/rexml/instruction.rb
@@ -2,62 +2,62 @@ require "rexml/child"
require "rexml/source"
module REXML
- # Represents an XML Instruction; IE, <? ... ?>
- # TODO: Add parent arg (3rd arg) to constructor
- class Instruction < Child
- START = '<\?'
- STOP = '\?>'
+ # Represents an XML Instruction; IE, <? ... ?>
+ # TODO: Add parent arg (3rd arg) to constructor
+ class Instruction < Child
+ START = '<\?'
+ STOP = '\?>'
- # target is the "name" of the Instruction; IE, the "tag" in <?tag ...?>
- # content is everything else.
- attr_accessor :target, :content
+ # target is the "name" of the Instruction; IE, the "tag" in <?tag ...?>
+ # content is everything else.
+ attr_accessor :target, :content
- # Constructs a new Instruction
- # @param target can be one of a number of things. If String, then
- # the target of this instruction is set to this. If an Instruction,
- # then the Instruction is shallowly cloned (target and content are
- # copied). If a Source, then the source is scanned and parsed for
- # an Instruction declaration.
- # @param content Must be either a String, or a Parent. Can only
- # be a Parent if the target argument is a Source. Otherwise, this
- # String is set as the content of this instruction.
- def initialize(target, content=nil)
- if target.kind_of? String
- super()
- @target = target
- @content = content
- elsif target.kind_of? Instruction
- super(content)
- @target = target.target
- @content = target.content
- end
- @content.strip! if @content
- end
-
- def clone
- Instruction.new self
- end
+ # Constructs a new Instruction
+ # @param target can be one of a number of things. If String, then
+ # the target of this instruction is set to this. If an Instruction,
+ # then the Instruction is shallowly cloned (target and content are
+ # copied). If a Source, then the source is scanned and parsed for
+ # an Instruction declaration.
+ # @param content Must be either a String, or a Parent. Can only
+ # be a Parent if the target argument is a Source. Otherwise, this
+ # String is set as the content of this instruction.
+ def initialize(target, content=nil)
+ if target.kind_of? String
+ super()
+ @target = target
+ @content = content
+ elsif target.kind_of? Instruction
+ super(content)
+ @target = target.target
+ @content = target.content
+ end
+ @content.strip! if @content
+ end
+ def clone
+ Instruction.new self
+ end
+
# == DEPRECATED
# See the rexml/formatters package
#
- def write writer, indent=-1, transitive=false, ie_hack=false
+ def write writer, indent=-1, transitive=false, ie_hack=false
Kernel.warn( "#{self.class.name}.write is deprecated" )
- indent(writer, indent)
- writer << START.sub(/\\/u, '')
- writer << @target
- writer << ' '
- writer << @content
- writer << STOP.sub(/\\/u, '')
- end
+ indent(writer, indent)
+ writer << START.sub(/\\/u, '')
+ writer << @target
+ writer << ' '
+ writer << @content
+ writer << STOP.sub(/\\/u, '')
+ end
- # @return true if other is an Instruction, and the content and target
- # of the other matches the target and content of this object.
- def ==( other )
- other.kind_of? Instruction and
- other.target == @target and
- other.content == @content
- end
+ # @return true if other is an Instruction, and the content and target
+ # of the other matches the target and content of this object.
+ def ==( other )
+ other.kind_of? Instruction and
+ other.target == @target and
+ other.content == @content
+ end
def node_type
:processing_instruction
@@ -66,5 +66,5 @@ module REXML
def inspect
"<?p-i #{target} ...?>"
end
- end
+ end
end
diff --git a/lib/rexml/light/node.rb b/lib/rexml/light/node.rb
index 9c90148c05..943ec5f1a0 100644
--- a/lib/rexml/light/node.rb
+++ b/lib/rexml/light/node.rb
@@ -2,195 +2,195 @@ require 'rexml/xmltokens'
require 'rexml/light/node'
# [ :element, parent, name, attributes, children* ]
- # a = Node.new
- # a << "B" # => <a>B</a>
- # a.b # => <a>B<b/></a>
- # a.b[1] # => <a>B<b/><b/><a>
- # a.b[1]["x"] = "y" # => <a>B<b/><b x="y"/></a>
- # a.b[0].c # => <a>B<b><c/></b><b x="y"/></a>
- # a.b.c << "D" # => <a>B<b><c>D</c></b><b x="y"/></a>
+ # a = Node.new
+ # a << "B" # => <a>B</a>
+ # a.b # => <a>B<b/></a>
+ # a.b[1] # => <a>B<b/><b/><a>
+ # a.b[1]["x"] = "y" # => <a>B<b/><b x="y"/></a>
+ # a.b[0].c # => <a>B<b><c/></b><b x="y"/></a>
+ # a.b.c << "D" # => <a>B<b><c>D</c></b><b x="y"/></a>
module REXML
- module Light
- # Represents a tagged XML element. Elements are characterized by
- # having children, attributes, and names, and can themselves be
- # children.
- class Node
- NAMESPLIT = /^(?:(#{XMLTokens::NCNAME_STR}):)?(#{XMLTokens::NCNAME_STR})/u
- PARENTS = [ :element, :document, :doctype ]
- # Create a new element.
- def initialize node=nil
- @node = node
- if node.kind_of? String
- node = [ :text, node ]
- elsif node.nil?
- node = [ :document, nil, nil ]
- elsif node[0] == :start_element
- node[0] = :element
- elsif node[0] == :start_doctype
- node[0] = :doctype
- elsif node[0] == :start_document
- node[0] = :document
- end
- end
-
- def size
- if PARENTS.include? @node[0]
- @node[-1].size
- else
- 0
- end
- end
-
- def each( &block )
- size.times { |x| yield( at(x+4) ) }
- end
-
- def name
- at(2)
- end
-
- def name=( name_str, ns=nil )
- pfx = ''
- pfx = "#{prefix(ns)}:" if ns
- _old_put(2, "#{pfx}#{name_str}")
- end
-
- def parent=( node )
- _old_put(1,node)
- end
-
- def local_name
- namesplit
- @name
- end
-
- def local_name=( name_str )
- _old_put( 1, "#@prefix:#{name_str}" )
- end
-
- def prefix( namespace=nil )
- prefix_of( self, namespace )
- end
-
- def namespace( prefix=prefix() )
- namespace_of( self, prefix )
- end
-
- def namespace=( namespace )
- @prefix = prefix( namespace )
- pfx = ''
- pfx = "#@prefix:" if @prefix.size > 0
- _old_put(1, "#{pfx}#@name")
- end
-
- def []( reference, ns=nil )
- if reference.kind_of? String
- pfx = ''
- pfx = "#{prefix(ns)}:" if ns
- at(3)["#{pfx}#{reference}"]
- elsif reference.kind_of? Range
- _old_get( Range.new(4+reference.begin, reference.end, reference.exclude_end?) )
- else
- _old_get( 4+reference )
- end
- end
-
- def =~( path )
- XPath.match( self, path )
- end
-
- # Doesn't handle namespaces yet
- def []=( reference, ns, value=nil )
- if reference.kind_of? String
- value = ns unless value
- at( 3 )[reference] = value
- elsif reference.kind_of? Range
- _old_put( Range.new(3+reference.begin, reference.end, reference.exclude_end?), ns )
- else
- if value
- _old_put( 4+reference, ns, value )
- else
- _old_put( 4+reference, ns )
- end
- end
- end
-
- # Append a child to this element, optionally under a provided namespace.
- # The namespace argument is ignored if the element argument is an Element
- # object. Otherwise, the element argument is a string, the namespace (if
- # provided) is the namespace the element is created in.
- def << element
- if node_type() == :text
- at(-1) << element
- else
- newnode = Node.new( element )
- newnode.parent = self
- self.push( newnode )
- end
- at(-1)
- end
-
- def node_type
- _old_get(0)
- end
-
- def text=( foo )
- replace = at(4).kind_of?(String)? 1 : 0
- self._old_put(4,replace, normalizefoo)
- end
-
- def root
- context = self
- context = context.at(1) while context.at(1)
- end
-
- def has_name?( name, namespace = '' )
- at(3) == name and namespace() == namespace
- end
-
- def children
- self
- end
-
- def parent
- at(1)
- end
-
- def to_s
-
- end
-
- private
-
- def namesplit
- return if @name.defined?
- at(2) =~ NAMESPLIT
- @prefix = '' || $1
- @name = $2
- end
-
- def namespace_of( node, prefix=nil )
- if not prefix
- name = at(2)
- name =~ NAMESPLIT
- prefix = $1
- end
- to_find = 'xmlns'
- to_find = "xmlns:#{prefix}" if not prefix.nil?
- ns = at(3)[ to_find ]
- ns ? ns : namespace_of( @node[0], prefix )
- end
-
- def prefix_of( node, namespace=nil )
- if not namespace
- name = node.name
- name =~ NAMESPLIT
- $1
- else
- ns = at(3).find { |k,v| v == namespace }
- ns ? ns : prefix_of( node.parent, namespace )
- end
- end
- end
- end
+ module Light
+ # Represents a tagged XML element. Elements are characterized by
+ # having children, attributes, and names, and can themselves be
+ # children.
+ class Node
+ NAMESPLIT = /^(?:(#{XMLTokens::NCNAME_STR}):)?(#{XMLTokens::NCNAME_STR})/u
+ PARENTS = [ :element, :document, :doctype ]
+ # Create a new element.
+ def initialize node=nil
+ @node = node
+ if node.kind_of? String
+ node = [ :text, node ]
+ elsif node.nil?
+ node = [ :document, nil, nil ]
+ elsif node[0] == :start_element
+ node[0] = :element
+ elsif node[0] == :start_doctype
+ node[0] = :doctype
+ elsif node[0] == :start_document
+ node[0] = :document
+ end
+ end
+
+ def size
+ if PARENTS.include? @node[0]
+ @node[-1].size
+ else
+ 0
+ end
+ end
+
+ def each( &block )
+ size.times { |x| yield( at(x+4) ) }
+ end
+
+ def name
+ at(2)
+ end
+
+ def name=( name_str, ns=nil )
+ pfx = ''
+ pfx = "#{prefix(ns)}:" if ns
+ _old_put(2, "#{pfx}#{name_str}")
+ end
+
+ def parent=( node )
+ _old_put(1,node)
+ end
+
+ def local_name
+ namesplit
+ @name
+ end
+
+ def local_name=( name_str )
+ _old_put( 1, "#@prefix:#{name_str}" )
+ end
+
+ def prefix( namespace=nil )
+ prefix_of( self, namespace )
+ end
+
+ def namespace( prefix=prefix() )
+ namespace_of( self, prefix )
+ end
+
+ def namespace=( namespace )
+ @prefix = prefix( namespace )
+ pfx = ''
+ pfx = "#@prefix:" if @prefix.size > 0
+ _old_put(1, "#{pfx}#@name")
+ end
+
+ def []( reference, ns=nil )
+ if reference.kind_of? String
+ pfx = ''
+ pfx = "#{prefix(ns)}:" if ns
+ at(3)["#{pfx}#{reference}"]
+ elsif reference.kind_of? Range
+ _old_get( Range.new(4+reference.begin, reference.end, reference.exclude_end?) )
+ else
+ _old_get( 4+reference )
+ end
+ end
+
+ def =~( path )
+ XPath.match( self, path )
+ end
+
+ # Doesn't handle namespaces yet
+ def []=( reference, ns, value=nil )
+ if reference.kind_of? String
+ value = ns unless value
+ at( 3 )[reference] = value
+ elsif reference.kind_of? Range
+ _old_put( Range.new(3+reference.begin, reference.end, reference.exclude_end?), ns )
+ else
+ if value
+ _old_put( 4+reference, ns, value )
+ else
+ _old_put( 4+reference, ns )
+ end
+ end
+ end
+
+ # Append a child to this element, optionally under a provided namespace.
+ # The namespace argument is ignored if the element argument is an Element
+ # object. Otherwise, the element argument is a string, the namespace (if
+ # provided) is the namespace the element is created in.
+ def << element
+ if node_type() == :text
+ at(-1) << element
+ else
+ newnode = Node.new( element )
+ newnode.parent = self
+ self.push( newnode )
+ end
+ at(-1)
+ end
+
+ def node_type
+ _old_get(0)
+ end
+
+ def text=( foo )
+ replace = at(4).kind_of?(String)? 1 : 0
+ self._old_put(4,replace, normalizefoo)
+ end
+
+ def root
+ context = self
+ context = context.at(1) while context.at(1)
+ end
+
+ def has_name?( name, namespace = '' )
+ at(3) == name and namespace() == namespace
+ end
+
+ def children
+ self
+ end
+
+ def parent
+ at(1)
+ end
+
+ def to_s
+
+ end
+
+ private
+
+ def namesplit
+ return if @name.defined?
+ at(2) =~ NAMESPLIT
+ @prefix = '' || $1
+ @name = $2
+ end
+
+ def namespace_of( node, prefix=nil )
+ if not prefix
+ name = at(2)
+ name =~ NAMESPLIT
+ prefix = $1
+ end
+ to_find = 'xmlns'
+ to_find = "xmlns:#{prefix}" if not prefix.nil?
+ ns = at(3)[ to_find ]
+ ns ? ns : namespace_of( @node[0], prefix )
+ end
+
+ def prefix_of( node, namespace=nil )
+ if not namespace
+ name = node.name
+ name =~ NAMESPLIT
+ $1
+ else
+ ns = at(3).find { |k,v| v == namespace }
+ ns ? ns : prefix_of( node.parent, namespace )
+ end
+ end
+ end
+ end
end
diff --git a/lib/rexml/namespace.rb b/lib/rexml/namespace.rb
index aeb339ee83..3e8790580b 100644
--- a/lib/rexml/namespace.rb
+++ b/lib/rexml/namespace.rb
@@ -1,47 +1,47 @@
require 'rexml/xmltokens'
module REXML
- # Adds named attributes to an object.
- module Namespace
- # The name of the object, valid if set
- attr_reader :name, :expanded_name
- # The expanded name of the object, valid if name is set
- attr_accessor :prefix
- include XMLTokens
- NAMESPLIT = /^(?:(#{NCNAME_STR}):)?(#{NCNAME_STR})/u
+ # Adds named attributes to an object.
+ module Namespace
+ # The name of the object, valid if set
+ attr_reader :name, :expanded_name
+ # The expanded name of the object, valid if name is set
+ attr_accessor :prefix
+ include XMLTokens
+ NAMESPLIT = /^(?:(#{NCNAME_STR}):)?(#{NCNAME_STR})/u
- # Sets the name and the expanded name
- def name=( name )
- @expanded_name = name
- name =~ NAMESPLIT
- if $1
- @prefix = $1
- else
- @prefix = ""
- @namespace = ""
- end
- @name = $2
- end
+ # Sets the name and the expanded name
+ def name=( name )
+ @expanded_name = name
+ name =~ NAMESPLIT
+ if $1
+ @prefix = $1
+ else
+ @prefix = ""
+ @namespace = ""
+ end
+ @name = $2
+ end
- # Compares names optionally WITH namespaces
- def has_name?( other, ns=nil )
- if ns
- return (namespace() == ns and name() == other)
- elsif other.include? ":"
- return fully_expanded_name == other
- else
- return name == other
- end
- end
+ # Compares names optionally WITH namespaces
+ def has_name?( other, ns=nil )
+ if ns
+ return (namespace() == ns and name() == other)
+ elsif other.include? ":"
+ return fully_expanded_name == other
+ else
+ return name == other
+ end
+ end
- alias :local_name :name
+ alias :local_name :name
- # Fully expand the name, even if the prefix wasn't specified in the
- # source file.
- def fully_expanded_name
- ns = prefix
- return "#{ns}:#@name" if ns.size > 0
- return @name
- end
- end
+ # Fully expand the name, even if the prefix wasn't specified in the
+ # source file.
+ def fully_expanded_name
+ ns = prefix
+ return "#{ns}:#@name" if ns.size > 0
+ return @name
+ end
+ end
end
diff --git a/lib/rexml/node.rb b/lib/rexml/node.rb
index 85457f1ad0..d5e8456e53 100644
--- a/lib/rexml/node.rb
+++ b/lib/rexml/node.rb
@@ -3,27 +3,27 @@ require "rexml/formatters/pretty"
require "rexml/formatters/default"
module REXML
- # Represents a node in the tree. Nodes are never encountered except as
- # superclasses of other objects. Nodes have siblings.
- module Node
- # @return the next sibling (nil if unset)
- def next_sibling_node
- return nil if @parent.nil?
- @parent[ @parent.index(self) + 1 ]
- end
+ # Represents a node in the tree. Nodes are never encountered except as
+ # superclasses of other objects. Nodes have siblings.
+ module Node
+ # @return the next sibling (nil if unset)
+ def next_sibling_node
+ return nil if @parent.nil?
+ @parent[ @parent.index(self) + 1 ]
+ end
- # @return the previous sibling (nil if unset)
- def previous_sibling_node
- return nil if @parent.nil?
- ind = @parent.index(self)
- return nil if ind == 0
- @parent[ ind - 1 ]
- end
+ # @return the previous sibling (nil if unset)
+ def previous_sibling_node
+ return nil if @parent.nil?
+ ind = @parent.index(self)
+ return nil if ind == 0
+ @parent[ ind - 1 ]
+ end
# indent::
# *DEPRECATED* This parameter is now ignored. See the formatters in the
# REXML::Formatters package for changing the output style.
- def to_s indent=nil
+ def to_s indent=nil
unless indent.nil?
Kernel.warn( "#{self.class.name}.to_s(indent) parameter is deprecated" )
f = REXML::Formatters::Pretty.new( indent )
@@ -33,33 +33,33 @@ module REXML
f.write( self, rv = "" )
end
return rv
- end
+ end
- def indent to, ind
+ def indent to, ind
if @parent and @parent.context and not @parent.context[:indentstyle].nil? then
indentstyle = @parent.context[:indentstyle]
else
indentstyle = ' '
end
to << indentstyle*ind unless ind<1
- end
+ end
- def parent?
- false;
- end
+ def parent?
+ false;
+ end
- # Visit all subnodes of +self+ recursively
- def each_recursive(&block) # :yields: node
- self.elements.each {|node|
- block.call(node)
- node.each_recursive(&block)
- }
- end
+ # Visit all subnodes of +self+ recursively
+ def each_recursive(&block) # :yields: node
+ self.elements.each {|node|
+ block.call(node)
+ node.each_recursive(&block)
+ }
+ end
- # Find (and return) first subnode (recursively) for which the block
+ # Find (and return) first subnode (recursively) for which the block
# evaluates to true. Returns +nil+ if none was found.
- def find_first_recursive(&block) # :yields: node
+ def find_first_recursive(&block) # :yields: node
each_recursive {|node|
return node if block.call(node)
}
@@ -71,5 +71,5 @@ module REXML
def index_in_parent
parent.index(self)+1
end
- end
+ end
end
diff --git a/lib/rexml/output.rb b/lib/rexml/output.rb
index b7f17b9dff..be4d23d42d 100644
--- a/lib/rexml/output.rb
+++ b/lib/rexml/output.rb
@@ -1,24 +1,24 @@
require 'rexml/encoding'
module REXML
- class Output
- include Encoding
-
+ class Output
+ include Encoding
+
attr_reader :encoding
- def initialize real_IO, encd="iso-8859-1"
- @output = real_IO
- self.encoding = encd
+ def initialize real_IO, encd="iso-8859-1"
+ @output = real_IO
+ self.encoding = encd
- @to_utf = encd == UTF_8 ? false : true
- end
+ @to_utf = encd == UTF_8 ? false : true
+ end
- def <<( content )
- @output << (@to_utf ? self.encode(content) : content)
- end
+ def <<( content )
+ @output << (@to_utf ? self.encode(content) : content)
+ end
def to_s
"Output[#{encoding}]"
end
- end
+ end
end
diff --git a/lib/rexml/parent.rb b/lib/rexml/parent.rb
index 7ed1761654..a20aaaef6b 100644
--- a/lib/rexml/parent.rb
+++ b/lib/rexml/parent.rb
@@ -6,14 +6,14 @@ module REXML
# object.
class Parent < Child
include Enumerable
-
+
# Constructor
# @param parent if supplied, will be set as the parent of this object
def initialize parent=nil
super(parent)
@children = []
end
-
+
def add( object )
#puts "PARENT GOTS #{size} CHILDREN"
object.parent = self
@@ -21,47 +21,47 @@ module REXML
#puts "PARENT NOW GOTS #{size} CHILDREN"
object
end
-
+
alias :push :add
alias :<< :push
-
+
def unshift( object )
object.parent = self
@children.unshift object
end
-
+
def delete( object )
found = false
@children.delete_if {|c| c.equal?(object) and found = true }
object.parent = nil if found
end
-
+
def each(&block)
@children.each(&block)
end
-
+
def delete_if( &block )
@children.delete_if(&block)
end
-
+
def delete_at( index )
@children.delete_at index
end
-
+
def each_index( &block )
@children.each_index(&block)
end
-
+
# Fetches a child at a given index
# @param index the Integer index of the child to fetch
def []( index )
@children[index]
end
-
+
alias :each_child :each
-
-
-
+
+
+
# Set an index entry. See Array.[]=
# @param index the index of the element to set
# @param opt either the object to set, or an Integer length
@@ -71,7 +71,7 @@ module REXML
args[-1].parent = self
@children[*args[0..-2]] = args[-1]
end
-
+
# Inserts an child before another child
# @param child1 this is either an xpath or an Element. If an Element,
# child2 will be inserted before child1 in the child list of the parent.
@@ -91,7 +91,7 @@ module REXML
end
self
end
-
+
# Inserts an child after another child
# @param child1 this is either an xpath or an Element. If an Element,
# child2 will be inserted after child1 in the child list of the parent.
@@ -111,11 +111,11 @@ module REXML
end
self
end
-
+
def to_a
@children.dup
end
-
+
# Fetches the index of a given child
# @param child the child to get the index of
# @return the index of the child, or nil if the object is not a child
@@ -125,24 +125,24 @@ module REXML
@children.find { |i| count += 1 ; i.hash == child.hash }
count
end
-
+
# @return the number of children of this parent
def size
@children.size
end
-
+
alias :length :size
-
+
# Replaces one child with another, making sure the nodelist is correct
# @param to_replace the child to replace (must be a Child)
- # @param replacement the child to insert into the nodelist (must be a
+ # @param replacement the child to insert into the nodelist (must be a
# Child)
def replace_child( to_replace, replacement )
@children.map! {|c| c.equal?( to_replace ) ? replacement : c }
to_replace.parent = nil
replacement.parent = self
end
-
+
# Deeply clones this object. This creates a complete duplicate of this
# Parent, including all descendants.
def deep_clone
@@ -156,9 +156,9 @@ module REXML
end
cl
end
-
+
alias :children :to_a
-
+
def parent?
true
end
diff --git a/lib/rexml/parseexception.rb b/lib/rexml/parseexception.rb
index 0481f72818..feb7a7e638 100644
--- a/lib/rexml/parseexception.rb
+++ b/lib/rexml/parseexception.rb
@@ -30,7 +30,7 @@ module REXML
err << "Last 80 unconsumed characters:\n"
err << @source.buffer[0..80].gsub(/\n/, ' ')
end
-
+
err
end
@@ -40,12 +40,12 @@ module REXML
end
def line
- @source.current_line[2] if @source and defined? @source.current_line and
+ @source.current_line[2] if @source and defined? @source.current_line and
@source.current_line
end
def context
@source.current_line
end
- end
+ end
end
diff --git a/lib/rexml/parsers/baseparser.rb b/lib/rexml/parsers/baseparser.rb
index 2f758265bb..fc2354a67f 100644
--- a/lib/rexml/parsers/baseparser.rb
+++ b/lib/rexml/parsers/baseparser.rb
@@ -25,20 +25,7 @@ module REXML
#
# Nat Price gave me some good ideas for the API.
class BaseParser
- if String.method_defined? :encode
- # Oniguruma / POSIX [understands unicode]
- LETTER = '[[:alpha:]]'
- DIGIT = '[[:digit:]]'
- else
- # Ruby < 1.9 [doesn't understand unicode]
- LETTER = 'a-zA-Z'
- DIGIT = '\d'
- end
-
- COMBININGCHAR = '' # TODO
- EXTENDER = '' # TODO
-
- NCNAME_STR= "[#{LETTER}_:][-#{LETTER}#{DIGIT}._:#{COMBININGCHAR}#{EXTENDER}]*"
+ NCNAME_STR= '[\w:][\-\w\d.]*'
NAME_STR= "(?:(#{NCNAME_STR}):)?(#{NCNAME_STR})"
UNAME_STR= "(?:#{NCNAME_STR}:)?#{NCNAME_STR}"
@@ -46,7 +33,7 @@ module REXML
NAME = "([\\w:]#{NAMECHAR}*)"
NMTOKEN = "(?:#{NAMECHAR})+"
NMTOKENS = "#{NMTOKEN}(\\s+#{NMTOKEN})*"
- REFERENCE = "&(?:#{NAME};|#\\d+;|#x[0-9a-fA-F]+;)"
+ REFERENCE = "(?:&#{NAME};|&#\\d+;|&#x[0-9a-fA-F]+;)"
REFERENCE_RE = /#{REFERENCE}/
DOCTYPE_START = /\A\s*<!DOCTYPE\s/um
@@ -105,11 +92,11 @@ module REXML
EREFERENCE = /&(?!#{NAME};)/
- DEFAULT_ENTITIES = {
- 'gt' => [/&gt;/, '&gt;', '>', />/],
- 'lt' => [/&lt;/, '&lt;', '<', /</],
- 'quot' => [/&quot;/, '&quot;', '"', /"/],
- "apos" => [/&apos;/, "&apos;", "'", /'/]
+ DEFAULT_ENTITIES = {
+ 'gt' => [/&gt;/, '&gt;', '>', />/],
+ 'lt' => [/&lt;/, '&lt;', '<', /</],
+ 'quot' => [/&quot;/, '&quot;', '"', /"/],
+ "apos" => [/&apos;/, "&apos;", "'", /'/]
}
@@ -180,9 +167,9 @@ module REXML
# Peek at the +depth+ event in the stack. The first element on the stack
# is at depth 0. If +depth+ is -1, will parse to the end of the input
# stream and return the last event, which is always :end_document.
- # Be aware that this causes the stream to be parsed up to the +depth+
- # event, so you can effectively pre-parse the entire document (pull the
- # entire thing into memory) using this method.
+ # Be aware that this causes the stream to be parsed up to the +depth+
+ # event, so you can effectively pre-parse the entire document (pull the
+ # entire thing into memory) using this method.
def peek depth=0
raise %Q[Illegal argument "#{depth}"] if depth < -1
temp = []
@@ -255,17 +242,12 @@ module REXML
@document_status = :after_doctype
@source.read if @source.buffer.size<2
md = @source.match(/\s*/um, true)
- if @source.encoding == "UTF-8"
- if @source.buffer.respond_to? :force_encoding
- @source.buffer.force_encoding(Encoding::UTF_8)
- end
- end
end
end
if @document_status == :in_doctype
md = @source.match(/\s*(.*?>)/um)
case md[1]
- when SYSTEMENTITY
+ when SYSTEMENTITY
match = @source.match( SYSTEMENTITY, true )[1]
return [ :externalentity, match ]
@@ -344,7 +326,7 @@ module REXML
#md = @source.match_to_consume( '>', CLOSE_MATCH)
md = @source.match( CLOSE_MATCH, true )
raise REXML::ParseException.new( "Missing end tag for "+
- "'#{last_tag}' (got \"#{md[1]}\")",
+ "'#{last_tag}' (got \"#{md[1]}\")",
@source) unless last_tag == md[1]
return [ :end_element, last_tag ]
elsif @source.buffer[1] == ?!
@@ -353,12 +335,6 @@ module REXML
raise REXML::ParseException.new("Malformed node", @source) unless md
if md[0][2] == ?-
md = @source.match( COMMENT_PATTERN, true )
-
- case md[1]
- when /--/, /-$/
- raise REXML::ParseException.new("Malformed comment", @source)
- end
-
return [ :comment, md[1] ] if md
else
md = @source.match( CDATA_PATTERN, true )
@@ -377,7 +353,7 @@ module REXML
unless md
# Check for missing attribute quotes
raise REXML::ParseException.new("missing attribute quote", @source) if @source.match(MISSING_ATTRIBUTE_QUOTES )
- raise REXML::ParseException.new("malformed XML: missing tag start", @source)
+ raise REXML::ParseException.new("malformed XML: missing tag start", @source)
end
attributes = {}
prefixes = Set.new
@@ -386,7 +362,7 @@ module REXML
if md[4].size > 0
attrs = md[4].scan( ATTRIBUTE_PATTERN )
raise REXML::ParseException.new( "error parsing attributes: [#{attrs.join ', '}], excess = \"#$'\"", @source) if $' and $'.strip.size > 0
- attrs.each { |a,b,c,d,e|
+ attrs.each { |a,b,c,d,e|
if b == "xmlns"
if c == "xml"
if d != "http://www.w3.org/XML/1998/namespace"
@@ -403,16 +379,10 @@ module REXML
elsif b
prefixes << b unless b == "xml"
end
-
- if attributes.has_key? a
- msg = "Duplicate attribute #{a.inspect}"
- raise REXML::ParseException.new( msg, @source, self)
- end
-
- attributes[a] = e
+ attributes[a] = e
}
end
-
+
# Verify that all of the prefixes have been defined
for prefix in prefixes
unless @nsstack.find{|k| k.member?(prefix)}
@@ -466,7 +436,7 @@ module REXML
# Doing it like this rather than in a loop improves the speed
copy.gsub!( EREFERENCE, '&amp;' )
entities.each do |key, value|
- copy.gsub!( value, "&#{key};" ) unless entity_filter and
+ copy.gsub!( value, "&#{key};" ) unless entity_filter and
entity_filter.include?(entity)
end if entities
copy.gsub!( EREFERENCE, '&amp;' )
@@ -482,7 +452,7 @@ module REXML
rv.gsub!( /\r\n?/, "\n" )
matches = rv.scan( REFERENCE_RE )
return rv if matches.size == 0
- rv.gsub!( /&#0*((?:\d+)|(?:x[a-fA-F0-9]+));/ ) {
+ rv.gsub!( /&#0*((?:\d+)|(?:x[a-fA-F0-9]+));/ ) {|m|
m=$1
m = "0#{m}" if m[0] == ?x
[Integer(m)].pack('U*')
@@ -495,12 +465,15 @@ module REXML
if entity_value
re = /&#{entity_reference};/
rv.gsub!( re, entity_value )
- else
- er = DEFAULT_ENTITIES[entity_reference]
- rv.gsub!( er[0], er[2] ) if er
end
end
end
+ matches.each do |entity_reference|
+ unless filter and filter.include?(entity_reference)
+ er = DEFAULT_ENTITIES[entity_reference]
+ rv.gsub!( er[0], er[2] ) if er
+ end
+ end
rv.gsub!( /&amp;/, '&' )
end
rv
diff --git a/lib/rexml/parsers/lightparser.rb b/lib/rexml/parsers/lightparser.rb
index ca9692c449..0f35034993 100644
--- a/lib/rexml/parsers/lightparser.rb
+++ b/lib/rexml/parsers/lightparser.rb
@@ -3,12 +3,12 @@ require 'rexml/parsers/baseparser'
require 'rexml/light/node'
module REXML
- module Parsers
- class LightParser
- def initialize stream
- @stream = stream
- @parser = REXML::Parsers::BaseParser.new( stream )
- end
+ module Parsers
+ class LightParser
+ def initialize stream
+ @stream = stream
+ @parser = REXML::Parsers::BaseParser.new( stream )
+ end
def add_listener( listener )
@parser.add_listener( listener )
@@ -19,40 +19,42 @@ module REXML
@parser.stream = @stream
end
- def parse
- root = context = [ :document ]
- while true
- event = @parser.pull
- case event[0]
- when :end_document
- break
- when :start_element, :start_doctype
- new_node = event
- context << new_node
- new_node[1,0] = [context]
- context = new_node
- when :end_element, :end_doctype
- context = context[1]
- else
- new_node = event
- context << new_node
- new_node[1,0] = [context]
- end
- end
- root
- end
- end
+ def parse
+ root = context = [ :document ]
+ while true
+ event = @parser.pull
+ case event[0]
+ when :end_document
+ break
+ when :end_doctype
+ context = context[1]
+ when :start_element, :start_doctype
+ new_node = event
+ context << new_node
+ new_node[1,0] = [context]
+ context = new_node
+ when :end_element, :end_doctype
+ context = context[1]
+ else
+ new_node = event
+ context << new_node
+ new_node[1,0] = [context]
+ end
+ end
+ root
+ end
+ end
- # An element is an array. The array contains:
- # 0 The parent element
- # 1 The tag name
- # 2 A hash of attributes
- # 3..-1 The child elements
- # An element is an array of size > 3
- # Text is a String
- # PIs are [ :processing_instruction, target, data ]
- # Comments are [ :comment, data ]
- # DocTypes are DocType structs
- # The root is an array with XMLDecls, Text, DocType, Array, Text
- end
+ # An element is an array. The array contains:
+ # 0 The parent element
+ # 1 The tag name
+ # 2 A hash of attributes
+ # 3..-1 The child elements
+ # An element is an array of size > 3
+ # Text is a String
+ # PIs are [ :processing_instruction, target, data ]
+ # Comments are [ :comment, data ]
+ # DocTypes are DocType structs
+ # The root is an array with XMLDecls, Text, DocType, Array, Text
+ end
end
diff --git a/lib/rexml/parsers/pullparser.rb b/lib/rexml/parsers/pullparser.rb
index 68a4ff7eae..36dc7160c3 100644
--- a/lib/rexml/parsers/pullparser.rb
+++ b/lib/rexml/parsers/pullparser.rb
@@ -68,7 +68,7 @@ module REXML
event = @parser.pull
case event[0]
when :entitydecl
- @entities[ event[1] ] =
+ @entities[ event[1] ] =
event[2] unless event[2] =~ /PUBLIC|SYSTEM/
when :text
unnormalized = @parser.unnormalize( event[1], @entities )
diff --git a/lib/rexml/parsers/sax2parser.rb b/lib/rexml/parsers/sax2parser.rb
index d0f0c5155e..e402eb7747 100644
--- a/lib/rexml/parsers/sax2parser.rb
+++ b/lib/rexml/parsers/sax2parser.rb
@@ -4,171 +4,162 @@ require 'rexml/namespace'
require 'rexml/text'
module REXML
- module Parsers
+ module Parsers
# SAX2Parser
- class SAX2Parser
- def initialize source
- @parser = BaseParser.new(source)
- @listeners = []
- @procs = []
- @namespace_stack = []
- @has_listeners = false
- @tag_stack = []
+ class SAX2Parser
+ def initialize source
+ @parser = BaseParser.new(source)
+ @listeners = []
+ @procs = []
+ @namespace_stack = []
+ @has_listeners = false
+ @tag_stack = []
@entities = {}
- end
+ end
def source
@parser.source
end
-
+
def add_listener( listener )
@parser.add_listener( listener )
end
- # Listen arguments:
- #
- # Symbol, Array, Block
- # Listen to Symbol events on Array elements
- # Symbol, Block
- # Listen to Symbol events
- # Array, Listener
- # Listen to all events on Array elements
- # Array, Block
- # Listen to :start_element events on Array elements
- # Listener
- # Listen to All events
- #
- # Symbol can be one of: :start_element, :end_element,
- # :start_prefix_mapping, :end_prefix_mapping, :characters,
- # :processing_instruction, :doctype, :attlistdecl, :elementdecl,
- # :entitydecl, :notationdecl, :cdata, :xmldecl, :comment
+ # Listen arguments:
+ #
+ # Symbol, Array, Block
+ # Listen to Symbol events on Array elements
+ # Symbol, Block
+ # Listen to Symbol events
+ # Array, Listener
+ # Listen to all events on Array elements
+ # Array, Block
+ # Listen to :start_element events on Array elements
+ # Listener
+ # Listen to All events
+ #
+ # Symbol can be one of: :start_element, :end_element,
+ # :start_prefix_mapping, :end_prefix_mapping, :characters,
+ # :processing_instruction, :doctype, :attlistdecl, :elementdecl,
+ # :entitydecl, :notationdecl, :cdata, :xmldecl, :comment
#
# There is an additional symbol that can be listened for: :progress.
- # This will be called for every event generated, passing in the current
+ # This will be called for every event generated, passing in the current
# stream position.
- #
- # Array contains regular expressions or strings which will be matched
- # against fully qualified element names.
- #
- # Listener must implement the methods in SAX2Listener
- #
- # Block will be passed the same arguments as a SAX2Listener method would
- # be, where the method name is the same as the matched Symbol.
- # See the SAX2Listener for more information.
- def listen( *args, &blok )
- if args[0].kind_of? Symbol
- if args.size == 2
- args[1].each { |match| @procs << [args[0], match, blok] }
- else
- add( [args[0], nil, blok] )
- end
- elsif args[0].kind_of? Array
- if args.size == 2
- args[0].each { |match| add( [nil, match, args[1]] ) }
- else
- args[0].each { |match| add( [ :start_element, match, blok ] ) }
- end
- else
- add([nil, nil, args[0]])
- end
- end
-
- def deafen( listener=nil, &blok )
- if listener
- @listeners.delete_if {|item| item[-1] == listener }
- @has_listeners = false if @listeners.size == 0
- else
- @procs.delete_if {|item| item[-1] == blok }
- end
- end
-
- def parse
- @procs.each { |sym,match,block| block.call if sym == :start_document }
- @listeners.each { |sym,match,block|
- block.start_document if sym == :start_document or sym.nil?
- }
- root = context = []
- while true
- event = @parser.pull
- case event[0]
- when :end_document
- handle( :end_document )
- break
+ #
+ # Array contains regular expressions or strings which will be matched
+ # against fully qualified element names.
+ #
+ # Listener must implement the methods in SAX2Listener
+ #
+ # Block will be passed the same arguments as a SAX2Listener method would
+ # be, where the method name is the same as the matched Symbol.
+ # See the SAX2Listener for more information.
+ def listen( *args, &blok )
+ if args[0].kind_of? Symbol
+ if args.size == 2
+ args[1].each { |match| @procs << [args[0], match, blok] }
+ else
+ add( [args[0], nil, blok] )
+ end
+ elsif args[0].kind_of? Array
+ if args.size == 2
+ args[0].each { |match| add( [nil, match, args[1]] ) }
+ else
+ args[0].each { |match| add( [ :start_element, match, blok ] ) }
+ end
+ else
+ add([nil, nil, args[0]])
+ end
+ end
+
+ def deafen( listener=nil, &blok )
+ if listener
+ @listeners.delete_if {|item| item[-1] == listener }
+ @has_listeners = false if @listeners.size == 0
+ else
+ @procs.delete_if {|item| item[-1] == blok }
+ end
+ end
+
+ def parse
+ @procs.each { |sym,match,block| block.call if sym == :start_document }
+ @listeners.each { |sym,match,block|
+ block.start_document if sym == :start_document or sym.nil?
+ }
+ root = context = []
+ while true
+ event = @parser.pull
+ case event[0]
+ when :end_document
+ handle( :end_document )
+ break
when :start_doctype
handle( :doctype, *event[1..-1])
- when :end_doctype
- context = context[1]
- when :start_element
- @tag_stack.push(event[1])
- # find the observers for namespaces
- procs = get_procs( :start_prefix_mapping, event[1] )
- listeners = get_listeners( :start_prefix_mapping, event[1] )
- if procs or listeners
- # break out the namespace declarations
- # The attributes live in event[2]
- event[2].each {|n, v| event[2][n] = @parser.normalize(v)}
- nsdecl = event[2].find_all { |n, value| n =~ /^xmlns(:|$)/ }
- nsdecl.collect! { |n, value| [ n[6..-1], value ] }
- @namespace_stack.push({})
- nsdecl.each do |n,v|
- @namespace_stack[-1][n] = v
- # notify observers of namespaces
- procs.each { |ob| ob.call( n, v ) } if procs
- listeners.each { |ob| ob.start_prefix_mapping(n, v) } if listeners
- end
- end
- event[1] =~ Namespace::NAMESPLIT
- prefix = $1
- local = $2
- uri = get_namespace(prefix)
- # find the observers for start_element
- procs = get_procs( :start_element, event[1] )
- listeners = get_listeners( :start_element, event[1] )
- # notify observers
- procs.each { |ob| ob.call( uri, local, event[1], event[2] ) } if procs
- listeners.each { |ob|
- ob.start_element( uri, local, event[1], event[2] )
- } if listeners
- when :end_element
- @tag_stack.pop
- event[1] =~ Namespace::NAMESPLIT
- prefix = $1
- local = $2
- uri = get_namespace(prefix)
- # find the observers for start_element
- procs = get_procs( :end_element, event[1] )
- listeners = get_listeners( :end_element, event[1] )
- # notify observers
- procs.each { |ob| ob.call( uri, local, event[1] ) } if procs
- listeners.each { |ob|
- ob.end_element( uri, local, event[1] )
- } if listeners
+ when :end_doctype
+ context = context[1]
+ when :start_element
+ @tag_stack.push(event[1])
+ # find the observers for namespaces
+ procs = get_procs( :start_prefix_mapping, event[1] )
+ listeners = get_listeners( :start_prefix_mapping, event[1] )
+ if procs or listeners
+ # break out the namespace declarations
+ # The attributes live in event[2]
+ event[2].each {|n, v| event[2][n] = @parser.normalize(v)}
+ nsdecl = event[2].find_all { |n, value| n =~ /^xmlns(:|$)/ }
+ nsdecl.collect! { |n, value| [ n[6..-1], value ] }
+ @namespace_stack.push({})
+ nsdecl.each do |n,v|
+ @namespace_stack[-1][n] = v
+ # notify observers of namespaces
+ procs.each { |ob| ob.call( n, v ) } if procs
+ listeners.each { |ob| ob.start_prefix_mapping(n, v) } if listeners
+ end
+ end
+ event[1] =~ Namespace::NAMESPLIT
+ prefix = $1
+ local = $2
+ uri = get_namespace(prefix)
+ # find the observers for start_element
+ procs = get_procs( :start_element, event[1] )
+ listeners = get_listeners( :start_element, event[1] )
+ # notify observers
+ procs.each { |ob| ob.call( uri, local, event[1], event[2] ) } if procs
+ listeners.each { |ob|
+ ob.start_element( uri, local, event[1], event[2] )
+ } if listeners
+ when :end_element
+ @tag_stack.pop
+ event[1] =~ Namespace::NAMESPLIT
+ prefix = $1
+ local = $2
+ uri = get_namespace(prefix)
+ # find the observers for start_element
+ procs = get_procs( :end_element, event[1] )
+ listeners = get_listeners( :end_element, event[1] )
+ # notify observers
+ procs.each { |ob| ob.call( uri, local, event[1] ) } if procs
+ listeners.each { |ob|
+ ob.end_element( uri, local, event[1] )
+ } if listeners
- namespace_mapping = @namespace_stack.pop
- # find the observers for namespaces
- procs = get_procs( :end_prefix_mapping, event[1] )
- listeners = get_listeners( :end_prefix_mapping, event[1] )
- if procs or listeners
- namespace_mapping.each do |ns_prefix, ns_uri|
- # notify observers of namespaces
- procs.each { |ob| ob.call( ns_prefix ) } if procs
- listeners.each { |ob| ob.end_prefix_mapping(ns_prefix) } if listeners
- end
- end
- when :text
+ namespace_mapping = @namespace_stack.pop
+ # find the observers for namespaces
+ procs = get_procs( :end_prefix_mapping, event[1] )
+ listeners = get_listeners( :end_prefix_mapping, event[1] )
+ if procs or listeners
+ namespace_mapping.each do |prefix, uri|
+ # notify observers of namespaces
+ procs.each { |ob| ob.call( prefix ) } if procs
+ listeners.each { |ob| ob.end_prefix_mapping(prefix) } if listeners
+ end
+ end
+ when :text
#normalized = @parser.normalize( event[1] )
#handle( :characters, normalized )
copy = event[1].clone
-
- esub = proc { |match|
- if @entities.has_key?($1)
- @entities[$1].gsub(Text::REFERENCE, &esub)
- else
- match
- end
- }
-
- copy.gsub!( Text::REFERENCE, &esub )
+ @entities.each { |key, value| copy = copy.gsub("&#{key};", value) }
copy.gsub!( Text::NUMERICENTITY ) {|m|
m=$1
m = "0#{m}" if m[0] == ?x
@@ -177,71 +168,71 @@ module REXML
handle( :characters, copy )
when :entitydecl
@entities[ event[1] ] = event[2] if event.size == 3
- handle( *event )
- when :processing_instruction, :comment, :attlistdecl,
- :elementdecl, :cdata, :notationdecl, :xmldecl
- handle( *event )
- end
+ handle( *event )
+ when :processing_instruction, :comment, :attlistdecl,
+ :elementdecl, :cdata, :notationdecl, :xmldecl
+ handle( *event )
+ end
handle( :progress, @parser.position )
- end
- end
+ end
+ end
- private
- def handle( symbol, *arguments )
- tag = @tag_stack[-1]
- procs = get_procs( symbol, tag )
- listeners = get_listeners( symbol, tag )
- # notify observers
- procs.each { |ob| ob.call( *arguments ) } if procs
- listeners.each { |l|
- l.send( symbol.to_s, *arguments )
- } if listeners
- end
+ private
+ def handle( symbol, *arguments )
+ tag = @tag_stack[-1]
+ procs = get_procs( symbol, tag )
+ listeners = get_listeners( symbol, tag )
+ # notify observers
+ procs.each { |ob| ob.call( *arguments ) } if procs
+ listeners.each { |l|
+ l.send( symbol.to_s, *arguments )
+ } if listeners
+ end
- # The following methods are duplicates, but it is faster than using
- # a helper
- def get_procs( symbol, name )
- return nil if @procs.size == 0
- @procs.find_all do |sym, match, block|
+ # The following methods are duplicates, but it is faster than using
+ # a helper
+ def get_procs( symbol, name )
+ return nil if @procs.size == 0
+ @procs.find_all do |sym, match, block|
#puts sym.inspect+"=="+symbol.inspect+ "\t"+match.inspect+"=="+name.inspect+ "\t"+( (sym.nil? or symbol == sym) and ((name.nil? and match.nil?) or match.nil? or ( (name == match) or (match.kind_of? Regexp and name =~ match)))).to_s
- (
- (sym.nil? or symbol == sym) and
- ((name.nil? and match.nil?) or match.nil? or (
- (name == match) or
- (match.kind_of? Regexp and name =~ match)
- )
- )
- )
- end.collect{|x| x[-1]}
- end
- def get_listeners( symbol, name )
- return nil if @listeners.size == 0
- @listeners.find_all do |sym, match, block|
- (
- (sym.nil? or symbol == sym) and
- ((name.nil? and match.nil?) or match.nil? or (
- (name == match) or
- (match.kind_of? Regexp and name =~ match)
- )
- )
- )
- end.collect{|x| x[-1]}
- end
+ (
+ (sym.nil? or symbol == sym) and
+ ((name.nil? and match.nil?) or match.nil? or (
+ (name == match) or
+ (match.kind_of? Regexp and name =~ match)
+ )
+ )
+ )
+ end.collect{|x| x[-1]}
+ end
+ def get_listeners( symbol, name )
+ return nil if @listeners.size == 0
+ @listeners.find_all do |sym, match, block|
+ (
+ (sym.nil? or symbol == sym) and
+ ((name.nil? and match.nil?) or match.nil? or (
+ (name == match) or
+ (match.kind_of? Regexp and name =~ match)
+ )
+ )
+ )
+ end.collect{|x| x[-1]}
+ end
- def add( pair )
- if pair[-1].respond_to? :call
- @procs << pair unless @procs.include? pair
- else
- @listeners << pair unless @listeners.include? pair
- @has_listeners = true
- end
- end
+ def add( pair )
+ if pair[-1].respond_to? :call
+ @procs << pair unless @procs.include? pair
+ else
+ @listeners << pair unless @listeners.include? pair
+ @has_listeners = true
+ end
+ end
- def get_namespace( prefix )
+ def get_namespace( prefix )
uris = (@namespace_stack.find_all { |ns| not ns[prefix].nil? }) ||
- (@namespace_stack.find { |ns| not ns[nil].nil? })
- uris[-1][prefix] unless uris.nil? or 0 == uris.size
- end
- end
- end
+ (@namespace_stack.find { |ns| not ns[nil].nil? })
+ uris[-1][prefix] unless uris.nil? or 0 == uris.size
+ end
+ end
+ end
end
diff --git a/lib/rexml/parsers/streamparser.rb b/lib/rexml/parsers/streamparser.rb
index 073fcc2c21..256d0f611c 100644
--- a/lib/rexml/parsers/streamparser.rb
+++ b/lib/rexml/parsers/streamparser.rb
@@ -5,11 +5,11 @@ module REXML
@listener = listener
@parser = BaseParser.new( source )
end
-
+
def add_listener( listener )
@parser.add_listener( listener )
end
-
+
def parse
# entity string
while true
diff --git a/lib/rexml/parsers/treeparser.rb b/lib/rexml/parsers/treeparser.rb
index 7f618cb319..5c3e142ea7 100644
--- a/lib/rexml/parsers/treeparser.rb
+++ b/lib/rexml/parsers/treeparser.rb
@@ -30,10 +30,7 @@ module REXML
return
when :start_element
tag_stack.push(event[1])
- el = @build_context = @build_context.add_element( event[1] )
- event[2].each do |key, value|
- el.attributes[key]=Attribute.new(key,value,self)
- end
+ el = @build_context = @build_context.add_element( event[1], event[2] )
when :end_element
tag_stack.pop
@build_context = @build_context.parent
@@ -42,8 +39,8 @@ module REXML
if @build_context[-1].instance_of? Text
@build_context[-1] << event[1]
else
- @build_context.add(
- Text.new(event[1], @build_context.whitespace, nil, true)
+ @build_context.add(
+ Text.new(event[1], @build_context.whitespace, nil, true)
) unless (
@build_context.ignore_whitespace_nodes and
event[1].strip.size==0
diff --git a/lib/rexml/parsers/ultralightparser.rb b/lib/rexml/parsers/ultralightparser.rb
index 96c55d837e..adc4af18e2 100644
--- a/lib/rexml/parsers/ultralightparser.rb
+++ b/lib/rexml/parsers/ultralightparser.rb
@@ -2,12 +2,12 @@ require 'rexml/parsers/streamparser'
require 'rexml/parsers/baseparser'
module REXML
- module Parsers
- class UltraLightParser
- def initialize stream
- @stream = stream
- @parser = REXML::Parsers::BaseParser.new( stream )
- end
+ module Parsers
+ class UltraLightParser
+ def initialize stream
+ @stream = stream
+ @parser = REXML::Parsers::BaseParser.new( stream )
+ end
def add_listener( listener )
@parser.add_listener( listener )
@@ -18,39 +18,39 @@ module REXML
@parser.stream = @stream
end
- def parse
- root = context = []
- while true
- event = @parser.pull
- case event[0]
- when :end_document
- break
- when :end_doctype
- context = context[1]
- when :start_element, :doctype
- context << event
- event[1,0] = [context]
- context = event
- when :end_element
- context = context[1]
- else
- context << event
- end
- end
- root
- end
- end
+ def parse
+ root = context = []
+ while true
+ event = @parser.pull
+ case event[0]
+ when :end_document
+ break
+ when :end_doctype
+ context = context[1]
+ when :start_element, :doctype
+ context << event
+ event[1,0] = [context]
+ context = event
+ when :end_element
+ context = context[1]
+ else
+ context << event
+ end
+ end
+ root
+ end
+ end
- # An element is an array. The array contains:
- # 0 The parent element
- # 1 The tag name
- # 2 A hash of attributes
- # 3..-1 The child elements
- # An element is an array of size > 3
- # Text is a String
- # PIs are [ :processing_instruction, target, data ]
- # Comments are [ :comment, data ]
- # DocTypes are DocType structs
- # The root is an array with XMLDecls, Text, DocType, Array, Text
- end
+ # An element is an array. The array contains:
+ # 0 The parent element
+ # 1 The tag name
+ # 2 A hash of attributes
+ # 3..-1 The child elements
+ # An element is an array of size > 3
+ # Text is a String
+ # PIs are [ :processing_instruction, target, data ]
+ # Comments are [ :comment, data ]
+ # DocTypes are DocType structs
+ # The root is an array with XMLDecls, Text, DocType, Array, Text
+ end
end
diff --git a/lib/rexml/parsers/xpathparser.rb b/lib/rexml/parsers/xpathparser.rb
index aafa72ab9e..de2530e347 100644
--- a/lib/rexml/parsers/xpathparser.rb
+++ b/lib/rexml/parsers/xpathparser.rb
@@ -39,10 +39,10 @@ module REXML
case op
when :node
when :attribute
- string << "/" if string.size > 0
- string << "@"
+ string << "/" if string.size > 0
+ string << "@"
when :child
- string << "/" if string.size > 0
+ string << "/" if string.size > 0
when :descendant_or_self
string << "/"
when :self
@@ -51,10 +51,10 @@ module REXML
string << ".."
when :any
string << "*"
- when :text
- string << "text()"
- when :following, :following_sibling,
- :ancestor, :ancestor_or_self, :descendant,
+ when :text
+ string << "text()"
+ when :following, :following_sibling,
+ :ancestor, :ancestor_or_self, :descendant,
:namespace, :preceding, :preceding_sibling
string << "/" unless string.size == 0
string << op.to_s.tr("_", "-")
@@ -70,13 +70,13 @@ module REXML
string << ']'
when :document
document = true
- when :function
- string << path.shift
- string << "( "
- string << predicate_to_string( path.shift[0] ) {|x| abbreviate( x )}
- string << " )"
- when :literal
- string << %Q{ "#{path.shift}" }
+ when :function
+ string << path.shift
+ string << "( "
+ string << predicate_to_string( path.shift[0] ) {|x| abbreviate( x )}
+ string << " )"
+ when :literal
+ string << %Q{ "#{path.shift}" }
else
string << "/" unless string.size == 0
string << "UNKNOWN("
@@ -84,7 +84,7 @@ module REXML
string << ")"
end
end
- string = "/"+string if document
+ string = "/"+string if document
return string
end
@@ -97,7 +97,7 @@ module REXML
case op
when :node
string << "node()"
- when :attribute, :child, :following, :following_sibling,
+ when :attribute, :child, :following, :following_sibling,
:ancestor, :ancestor_or_self, :descendant, :descendant_or_self,
:namespace, :preceding, :preceding_sibling, :self, :parent
string << "/" unless string.size == 0
@@ -249,7 +249,7 @@ module REXML
parsed.concat(n)
end
-
+
if path.size > 0
if path[0] == ?/
if path[1] == ?/
@@ -332,12 +332,12 @@ module REXML
predicates << expr[1..-2] if expr
end
#puts "PREDICATES = #{predicates.inspect}"
- predicates.each{ |pred|
- #puts "ORING #{pred}"
+ predicates.each{ |expr|
+ #puts "ORING #{expr}"
preds = []
parsed << :predicate
parsed << preds
- OrExpr(pred, preds)
+ OrExpr(expr, preds)
}
#puts "PREDICATES = #{predicates.inspect}"
path
@@ -600,13 +600,13 @@ module REXML
#puts "LITERAL or NUMBER: #$1"
varname = $1.nil? ? $2 : $1
path = $'
- parsed << :literal
+ parsed << :literal
parsed << (varname.include?('.') ? varname.to_f : varname.to_i)
when LITERAL
#puts "LITERAL or NUMBER: #$1"
varname = $1.nil? ? $2 : $1
path = $'
- parsed << :literal
+ parsed << :literal
parsed << varname
when /^\(/ #/
path, contents = get_group(path)
@@ -649,43 +649,43 @@ module REXML
return nil unless depth==0
[string[ind..-1], string[0..ind-1]]
end
-
+
def parse_args( string )
arguments = []
ind = 0
- inquot = false
- inapos = false
+ inquot = false
+ inapos = false
depth = 1
begin
case string[ind]
when ?"
- inquot = !inquot unless inapos
+ inquot = !inquot unless inapos
when ?'
- inapos = !inapos unless inquot
+ inapos = !inapos unless inquot
else
- unless inquot or inapos
- case string[ind]
- when ?(
- depth += 1
+ unless inquot or inapos
+ case string[ind]
+ when ?(
+ depth += 1
if depth == 1
- string = string[1..-1]
- ind -= 1
- end
- when ?)
- depth -= 1
- if depth == 0
- s = string[0,ind].strip
- arguments << s unless s == ""
- string = string[ind+1..-1]
+ string = string[1..-1]
+ ind -= 1
end
- when ?,
- if depth == 1
- s = string[0,ind].strip
- arguments << s unless s == ""
- string = string[ind+1..-1]
- ind = -1
- end
- end
+ when ?)
+ depth -= 1
+ if depth == 0
+ s = string[0,ind].strip
+ arguments << s unless s == ""
+ string = string[ind+1..-1]
+ end
+ when ?,
+ if depth == 1
+ s = string[0,ind].strip
+ arguments << s unless s == ""
+ string = string[ind+1..-1]
+ ind = -1
+ end
+ end
end
end
ind += 1
diff --git a/lib/rexml/quickpath.rb b/lib/rexml/quickpath.rb
index 95fc72b7c2..c099db8579 100644
--- a/lib/rexml/quickpath.rb
+++ b/lib/rexml/quickpath.rb
@@ -2,262 +2,265 @@ require 'rexml/functions'
require 'rexml/xmltokens'
module REXML
- class QuickPath
- include Functions
- include XMLTokens
+ class QuickPath
+ include Functions
+ include XMLTokens
- EMPTY_HASH = {}
+ EMPTY_HASH = {}
- def QuickPath::first element, path, namespaces=EMPTY_HASH
- match(element, path, namespaces)[0]
- end
+ def QuickPath::first element, path, namespaces=EMPTY_HASH
+ match(element, path, namespaces)[0]
+ end
- def QuickPath::each element, path, namespaces=EMPTY_HASH, &block
- path = "*" unless path
- match(element, path, namespaces).each( &block )
- end
+ def QuickPath::each element, path, namespaces=EMPTY_HASH, &block
+ path = "*" unless path
+ match(element, path, namespaces).each( &block )
+ end
- def QuickPath::match element, path, namespaces=EMPTY_HASH
- raise "nil is not a valid xpath" unless path
- results = nil
- Functions::namespace_context = namespaces
- case path
- when /^\/([^\/]|$)/u
- # match on root
- path = path[1..-1]
- return [element.root.parent] if path == ''
- results = filter([element.root], path)
- when /^[-\w]*::/u
- results = filter([element], path)
- when /^\*/u
- results = filter(element.to_a, path)
- when /^[\[!\w:]/u
- # match on child
- matches = []
- children = element.to_a
- results = filter(children, path)
- else
- results = filter([element], path)
- end
- return results
- end
+ def QuickPath::match element, path, namespaces=EMPTY_HASH
+ raise "nil is not a valid xpath" unless path
+ results = nil
+ Functions::namespace_context = namespaces
+ case path
+ when /^\/([^\/]|$)/u
+ # match on root
+ path = path[1..-1]
+ return [element.root.parent] if path == ''
+ results = filter([element.root], path)
+ when /^[-\w]*::/u
+ results = filter([element], path)
+ when /^\*/u
+ results = filter(element.to_a, path)
+ when /^[\[!\w:]/u
+ # match on child
+ matches = []
+ children = element.to_a
+ results = filter(children, path)
+ else
+ results = filter([element], path)
+ end
+ return results
+ end
- # Given an array of nodes it filters the array based on the path. The
- # result is that when this method returns, the array will contain elements
- # which match the path
- def QuickPath::filter elements, path
- return elements if path.nil? or path == '' or elements.size == 0
- case path
- when /^\/\//u # Descendant
- return axe( elements, "descendant-or-self", $' )
- when /^\/?\b(\w[-\w]*)\b::/u # Axe
- axe_name = $1
- rest = $'
- return axe( elements, $1, $' )
- when /^\/(?=\b([:!\w][-\.\w]*:)?[-!\*\.\w]*\b([^:(]|$)|\*)/u # Child
- rest = $'
- results = []
- elements.each do |element|
- results |= filter( element.to_a, rest )
- end
- return results
- when /^\/?(\w[-\w]*)\(/u # / Function
- return function( elements, $1, $' )
- when Namespace::NAMESPLIT # Element name
- name = $2
- ns = $1
- rest = $'
- elements.delete_if do |element|
- !(element.kind_of? Element and
- (element.expanded_name == name or
- (element.name == name and
- element.namespace == Functions.namespace_context[ns])))
- end
- return filter( elements, rest )
- when /^\/\[/u
- matches = []
- elements.each do |element|
- matches |= predicate( element.to_a, path[1..-1] ) if element.kind_of? Element
- end
- return matches
- when /^\[/u # Predicate
- return predicate( elements, path )
- when /^\/?\.\.\./u # Ancestor
- return axe( elements, "ancestor", $' )
- when /^\/?\.\./u # Parent
- return filter( elements.collect{|e|e.parent}, $' )
- when /^\/?\./u # Self
- return filter( elements, $' )
- when /^\*/u # Any
- results = []
- elements.each do |element|
- results |= filter( [element], $' ) if element.kind_of? Element
- #if element.kind_of? Element
- # children = element.to_a
- # children.delete_if { |child| !child.kind_of?(Element) }
- # results |= filter( children, $' )
- #end
- end
- return results
- end
- return []
- end
+ # Given an array of nodes it filters the array based on the path. The
+ # result is that when this method returns, the array will contain elements
+ # which match the path
+ def QuickPath::filter elements, path
+ return elements if path.nil? or path == '' or elements.size == 0
+ case path
+ when /^\/\//u # Descendant
+ return axe( elements, "descendant-or-self", $' )
+ when /^\/?\b(\w[-\w]*)\b::/u # Axe
+ axe_name = $1
+ rest = $'
+ return axe( elements, $1, $' )
+ when /^\/(?=\b([:!\w][-\.\w]*:)?[-!\*\.\w]*\b([^:(]|$)|\*)/u # Child
+ rest = $'
+ results = []
+ elements.each do |element|
+ results |= filter( element.to_a, rest )
+ end
+ return results
+ when /^\/?(\w[-\w]*)\(/u # / Function
+ return function( elements, $1, $' )
+ when Namespace::NAMESPLIT # Element name
+ name = $2
+ ns = $1
+ rest = $'
+ elements.delete_if do |element|
+ !(element.kind_of? Element and
+ (element.expanded_name == name or
+ (element.name == name and
+ element.namespace == Functions.namespace_context[ns])))
+ end
+ return filter( elements, rest )
+ when /^\/\[/u
+ matches = []
+ elements.each do |element|
+ matches |= predicate( element.to_a, path[1..-1] ) if element.kind_of? Element
+ end
+ return matches
+ when /^\[/u # Predicate
+ return predicate( elements, path )
+ when /^\/?\.\.\./u # Ancestor
+ return axe( elements, "ancestor", $' )
+ when /^\/?\.\./u # Parent
+ return filter( elements.collect{|e|e.parent}, $' )
+ when /^\/?\./u # Self
+ return filter( elements, $' )
+ when /^\*/u # Any
+ results = []
+ elements.each do |element|
+ results |= filter( [element], $' ) if element.kind_of? Element
+ #if element.kind_of? Element
+ # children = element.to_a
+ # children.delete_if { |child| !child.kind_of?(Element) }
+ # results |= filter( children, $' )
+ #end
+ end
+ return results
+ end
+ return []
+ end
- def QuickPath::axe( elements, axe_name, rest )
- matches = []
- matches = filter( elements.dup, rest ) if axe_name =~ /-or-self$/u
- case axe_name
- when /^descendant/u
- elements.each do |element|
- matches |= filter( element.to_a, "descendant-or-self::#{rest}" ) if element.kind_of? Element
- end
- when /^ancestor/u
- elements.each do |element|
- while element.parent
- matches << element.parent
- element = element.parent
- end
- end
- matches = filter( matches, rest )
- when "self"
- matches = filter( elements, rest )
- when "child"
- elements.each do |element|
- matches |= filter( element.to_a, rest ) if element.kind_of? Element
- end
- when "attribute"
- elements.each do |element|
- matches << element.attributes[ rest ] if element.kind_of? Element
- end
- when "parent"
- matches = filter(elements.collect{|element| element.parent}.uniq, rest)
- when "following-sibling"
- matches = filter(elements.collect{|element| element.next_sibling}.uniq,
- rest)
- when "previous-sibling"
- matches = filter(elements.collect{|element|
- element.previous_sibling}.uniq, rest )
- end
- return matches.uniq
- end
+ def QuickPath::axe( elements, axe_name, rest )
+ matches = []
+ matches = filter( elements.dup, rest ) if axe_name =~ /-or-self$/u
+ case axe_name
+ when /^descendant/u
+ elements.each do |element|
+ matches |= filter( element.to_a, "descendant-or-self::#{rest}" ) if element.kind_of? Element
+ end
+ when /^ancestor/u
+ elements.each do |element|
+ while element.parent
+ matches << element.parent
+ element = element.parent
+ end
+ end
+ matches = filter( matches, rest )
+ when "self"
+ matches = filter( elements, rest )
+ when "child"
+ elements.each do |element|
+ matches |= filter( element.to_a, rest ) if element.kind_of? Element
+ end
+ when "attribute"
+ elements.each do |element|
+ matches << element.attributes[ rest ] if element.kind_of? Element
+ end
+ when "parent"
+ matches = filter(elements.collect{|element| element.parent}.uniq, rest)
+ when "following-sibling"
+ matches = filter(elements.collect{|element| element.next_sibling}.uniq,
+ rest)
+ when "previous-sibling"
+ matches = filter(elements.collect{|element|
+ element.previous_sibling}.uniq, rest )
+ end
+ return matches.uniq
+ end
- # A predicate filters a node-set with respect to an axis to produce a
- # new node-set. For each node in the node-set to be filtered, the
- # PredicateExpr is evaluated with that node as the context node, with
- # the number of nodes in the node-set as the context size, and with the
- # proximity position of the node in the node-set with respect to the
- # axis as the context position; if PredicateExpr evaluates to true for
- # that node, the node is included in the new node-set; otherwise, it is
- # not included.
- #
- # A PredicateExpr is evaluated by evaluating the Expr and converting
- # the result to a boolean. If the result is a number, the result will
- # be converted to true if the number is equal to the context position
- # and will be converted to false otherwise; if the result is not a
- # number, then the result will be converted as if by a call to the
- # boolean function. Thus a location path para[3] is equivalent to
- # para[position()=3].
- def QuickPath::predicate( elements, path )
- ind = 1
- bcount = 1
- while bcount > 0
- bcount += 1 if path[ind] == ?[
- bcount -= 1 if path[ind] == ?]
- ind += 1
- end
- ind -= 1
- predicate = path[1..ind-1]
- rest = path[ind+1..-1]
+ # A predicate filters a node-set with respect to an axis to produce a
+ # new node-set. For each node in the node-set to be filtered, the
+ # PredicateExpr is evaluated with that node as the context node, with
+ # the number of nodes in the node-set as the context size, and with the
+ # proximity position of the node in the node-set with respect to the
+ # axis as the context position; if PredicateExpr evaluates to true for
+ # that node, the node is included in the new node-set; otherwise, it is
+ # not included.
+ #
+ # A PredicateExpr is evaluated by evaluating the Expr and converting
+ # the result to a boolean. If the result is a number, the result will
+ # be converted to true if the number is equal to the context position
+ # and will be converted to false otherwise; if the result is not a
+ # number, then the result will be converted as if by a call to the
+ # boolean function. Thus a location path para[3] is equivalent to
+ # para[position()=3].
+ def QuickPath::predicate( elements, path )
+ ind = 1
+ bcount = 1
+ while bcount > 0
+ bcount += 1 if path[ind] == ?[
+ bcount -= 1 if path[ind] == ?]
+ ind += 1
+ end
+ ind -= 1
+ predicate = path[1..ind-1]
+ rest = path[ind+1..-1]
- # have to change 'a [=<>] b [=<>] c' into 'a [=<>] b and b [=<>] c'
- predicate.gsub!( /([^\s(and)(or)<>=]+)\s*([<>=])\s*([^\s(and)(or)<>=]+)\s*([<>=])\s*([^\s(and)(or)<>=]+)/u,
- '\1 \2 \3 and \3 \4 \5' )
- # Let's do some Ruby trickery to avoid some work:
- predicate.gsub!( /&/u, "&&" )
- predicate.gsub!( /=/u, "==" )
- predicate.gsub!( /@(\w[-\w.]*)/u, 'attribute("\1")' )
- predicate.gsub!( /\bmod\b/u, "%" )
- predicate.gsub!( /\b(\w[-\w.]*\()/u ) {
- fname = $1
- fname.gsub( /-/u, "_" )
- }
+ # have to change 'a [=<>] b [=<>] c' into 'a [=<>] b and b [=<>] c'
+ predicate.gsub!( /([^\s(and)(or)<>=]+)\s*([<>=])\s*([^\s(and)(or)<>=]+)\s*([<>=])\s*([^\s(and)(or)<>=]+)/u ) {
+ "#$1 #$2 #$3 and #$3 #$4 #$5"
+ }
+ # Let's do some Ruby trickery to avoid some work:
+ predicate.gsub!( /&/u, "&&" )
+ predicate.gsub!( /=/u, "==" )
+ predicate.gsub!( /@(\w[-\w.]*)/u ) {
+ "attribute(\"#$1\")"
+ }
+ predicate.gsub!( /\bmod\b/u, "%" )
+ predicate.gsub!( /\b(\w[-\w.]*\()/u ) {
+ fname = $1
+ fname.gsub( /-/u, "_" )
+ }
+
+ Functions.pair = [ 0, elements.size ]
+ results = []
+ elements.each do |element|
+ Functions.pair[0] += 1
+ Functions.node = element
+ res = eval( predicate )
+ case res
+ when true
+ results << element
+ when Fixnum
+ results << element if Functions.pair[0] == res
+ when String
+ results << element
+ end
+ end
+ return filter( results, rest )
+ end
- Functions.pair = [ 0, elements.size ]
- results = []
- elements.each do |element|
- Functions.pair[0] += 1
- Functions.node = element
- res = eval( predicate )
- case res
- when true
- results << element
- when Fixnum
- results << element if Functions.pair[0] == res
- when String
- results << element
- end
- end
- return filter( results, rest )
- end
+ def QuickPath::attribute( name )
+ return Functions.node.attributes[name] if Functions.node.kind_of? Element
+ end
- def QuickPath::attribute( name )
- return Functions.node.attributes[name] if Functions.node.kind_of? Element
- end
+ def QuickPath::name()
+ return Functions.node.name if Functions.node.kind_of? Element
+ end
- def QuickPath::name()
- return Functions.node.name if Functions.node.kind_of? Element
- end
+ def QuickPath::method_missing( id, *args )
+ begin
+ Functions.send( id.id2name, *args )
+ rescue Exception
+ raise "METHOD: #{id.id2name}(#{args.join ', '})\n#{$!.message}"
+ end
+ end
- def QuickPath::method_missing( id, *args )
- begin
- Functions.send( id.id2name, *args )
- rescue Exception
- raise "METHOD: #{id.id2name}(#{args.join ', '})\n#{$!.message}"
- end
- end
+ def QuickPath::function( elements, fname, rest )
+ args = parse_args( elements, rest )
+ Functions.pair = [0, elements.size]
+ results = []
+ elements.each do |element|
+ Functions.pair[0] += 1
+ Functions.node = element
+ res = Functions.send( fname, *args )
+ case res
+ when true
+ results << element
+ when Fixnum
+ results << element if Functions.pair[0] == res
+ end
+ end
+ return results
+ end
- def QuickPath::function( elements, fname, rest )
- args = parse_args( elements, rest )
- Functions.pair = [0, elements.size]
- results = []
- elements.each do |element|
- Functions.pair[0] += 1
- Functions.node = element
- res = Functions.send( fname, *args )
- case res
- when true
- results << element
- when Fixnum
- results << element if Functions.pair[0] == res
- end
- end
- return results
- end
-
- def QuickPath::parse_args( element, string )
- # /.*?(?:\)|,)/
- arguments = []
- buffer = ""
- while string and string != ""
- c = string[0]
- string.sub!(/^./u, "")
- case c
- when ?,
- # if depth = 1, then we start a new argument
- arguments << evaluate( buffer )
- #arguments << evaluate( string[0..count] )
- when ?(
- # start a new method call
- function( element, buffer, string )
- buffer = ""
- when ?)
- # close the method call and return arguments
- return arguments
- else
- buffer << c
- end
- end
- ""
- end
- end
+ def QuickPath::parse_args( element, string )
+ # /.*?(?:\)|,)/
+ arguments = []
+ buffer = ""
+ while string and string != ""
+ c = string[0]
+ string.sub!(/^./u, "")
+ case c
+ when ?,
+ # if depth = 1, then we start a new argument
+ arguments << evaluate( buffer )
+ #arguments << evaluate( string[0..count] )
+ when ?(
+ # start a new method call
+ function( element, buffer, string )
+ buffer = ""
+ when ?)
+ # close the method call and return arguments
+ return arguments
+ else
+ buffer << c
+ end
+ end
+ ""
+ end
+ end
end
diff --git a/lib/rexml/rexml.rb b/lib/rexml/rexml.rb
index ab2f44561b..95bc2a7f6d 100644
--- a/lib/rexml/rexml.rb
+++ b/lib/rexml/rexml.rb
@@ -5,25 +5,26 @@
# non-validating[http://www.w3.org/TR/2004/REC-xml-20040204/#sec-conformance]
# toolkit with an intuitive API. REXML passes 100% of the non-validating Oasis
# tests[http://www.oasis-open.org/committees/xml-conformance/xml-test-suite.shtml],
-# and provides tree, stream, SAX2, pull, and lightweight APIs. REXML also
-# includes a full XPath[http://www.w3c.org/tr/xpath] 1.0 implementation. Since
+# and provides tree, stream, SAX2, pull, and lightweight APIs. REXML also
+# includes a full XPath[http://www.w3c.org/tr/xpath] 1.0 implementation. Since
# Ruby 1.8, REXML is included in the standard Ruby distribution.
#
# Main page:: http://www.germane-software.com/software/rexml
# Author:: Sean Russell <serATgermaneHYPHENsoftwareDOTcom>
-# Date:: 2008/019
-# Version:: 3.1.7.3
-#
+# Version:: 3.1.7.2
+# Date:: 2007/275
+# Revision:: $Revision$
+#
# This API documentation can be downloaded from the REXML home page, or can
# be accessed online[http://www.germane-software.com/software/rexml_doc]
#
# A tutorial is available in the REXML distribution in docs/tutorial.html,
-# or can be accessed
+# or can be accessed
# online[http://www.germane-software.com/software/rexml/docs/tutorial.html]
module REXML
- COPYRIGHT = "Copyright © 2001-2008 Sean Russell <ser@germane-software.com>"
- DATE = "2008/019"
+ COPYRIGHT = "Copyright \xC2\xA9 2001-2006 Sean Russell <ser@germane-software.com>"
VERSION = "3.1.7.3"
+ DATE = "2007/275"
REVISION = "$Revision$".gsub(/\$Revision:|\$/,'').strip
Copyright = COPYRIGHT
diff --git a/lib/rexml/sax2listener.rb b/lib/rexml/sax2listener.rb
index 6830e4483a..8db1389d06 100644
--- a/lib/rexml/sax2listener.rb
+++ b/lib/rexml/sax2listener.rb
@@ -1,97 +1,97 @@
module REXML
- # A template for stream parser listeners.
- # Note that the declarations (attlistdecl, elementdecl, etc) are trivially
- # processed; REXML doesn't yet handle doctype entity declarations, so you
- # have to parse them out yourself.
- # === Missing methods from SAX2
- # ignorable_whitespace
- # === Methods extending SAX2
- # +WARNING+
- # These methods are certainly going to change, until DTDs are fully
- # supported. Be aware of this.
- # start_document
- # end_document
- # doctype
- # elementdecl
- # attlistdecl
- # entitydecl
- # notationdecl
- # cdata
- # xmldecl
- # comment
- module SAX2Listener
- def start_document
- end
- def end_document
- end
- def start_prefix_mapping prefix, uri
- end
- def end_prefix_mapping prefix
- end
- def start_element uri, localname, qname, attributes
- end
- def end_element uri, localname, qname
- end
- def characters text
- end
- def processing_instruction target, data
- end
- # Handles a doctype declaration. Any attributes of the doctype which are
- # not supplied will be nil. # EG, <!DOCTYPE me PUBLIC "foo" "bar">
- # @p name the name of the doctype; EG, "me"
- # @p pub_sys "PUBLIC", "SYSTEM", or nil. EG, "PUBLIC"
- # @p long_name the supplied long name, or nil. EG, "foo"
- # @p uri the uri of the doctype, or nil. EG, "bar"
- def doctype name, pub_sys, long_name, uri
- end
- # If a doctype includes an ATTLIST declaration, it will cause this
- # method to be called. The content is the declaration itself, unparsed.
- # EG, <!ATTLIST el attr CDATA #REQUIRED> will come to this method as "el
- # attr CDATA #REQUIRED". This is the same for all of the .*decl
- # methods.
- def attlistdecl(element, pairs, contents)
- end
- # <!ELEMENT ...>
- def elementdecl content
- end
- # <!ENTITY ...>
- # The argument passed to this method is an array of the entity
- # declaration. It can be in a number of formats, but in general it
- # returns (example, result):
- # <!ENTITY % YN '"Yes"'>
- # ["%", "YN", "'\"Yes\"'", "\""]
- # <!ENTITY % YN 'Yes'>
- # ["%", "YN", "'Yes'", "s"]
- # <!ENTITY WhatHeSaid "He said %YN;">
- # ["WhatHeSaid", "\"He said %YN;\"", "YN"]
- # <!ENTITY open-hatch SYSTEM "http://www.textuality.com/boilerplate/OpenHatch.xml">
- # ["open-hatch", "SYSTEM", "\"http://www.textuality.com/boilerplate/OpenHatch.xml\""]
- # <!ENTITY open-hatch PUBLIC "-//Textuality//TEXT Standard open-hatch boilerplate//EN" "http://www.textuality.com/boilerplate/OpenHatch.xml">
- # ["open-hatch", "PUBLIC", "\"-//Textuality//TEXT Standard open-hatch boilerplate//EN\"", "\"http://www.textuality.com/boilerplate/OpenHatch.xml\""]
- # <!ENTITY hatch-pic SYSTEM "../grafix/OpenHatch.gif" NDATA gif>
- # ["hatch-pic", "SYSTEM", "\"../grafix/OpenHatch.gif\"", "\n\t\t\t\t\t\t\tNDATA gif", "gif"]
- def entitydecl name, decl
- end
- # <!NOTATION ...>
- def notationdecl content
- end
- # Called when <![CDATA[ ... ]]> is encountered in a document.
- # @p content "..."
- def cdata content
- end
- # Called when an XML PI is encountered in the document.
- # EG: <?xml version="1.0" encoding="utf"?>
- # @p version the version attribute value. EG, "1.0"
- # @p encoding the encoding attribute value, or nil. EG, "utf"
- # @p standalone the standalone attribute value, or nil. EG, nil
+ # A template for stream parser listeners.
+ # Note that the declarations (attlistdecl, elementdecl, etc) are trivially
+ # processed; REXML doesn't yet handle doctype entity declarations, so you
+ # have to parse them out yourself.
+ # === Missing methods from SAX2
+ # ignorable_whitespace
+ # === Methods extending SAX2
+ # +WARNING+
+ # These methods are certainly going to change, until DTDs are fully
+ # supported. Be aware of this.
+ # start_document
+ # end_document
+ # doctype
+ # elementdecl
+ # attlistdecl
+ # entitydecl
+ # notationdecl
+ # cdata
+ # xmldecl
+ # comment
+ module SAX2Listener
+ def start_document
+ end
+ def end_document
+ end
+ def start_prefix_mapping prefix, uri
+ end
+ def end_prefix_mapping prefix
+ end
+ def start_element uri, localname, qname, attributes
+ end
+ def end_element uri, localname, qname
+ end
+ def characters text
+ end
+ def processing_instruction target, data
+ end
+ # Handles a doctype declaration. Any attributes of the doctype which are
+ # not supplied will be nil. # EG, <!DOCTYPE me PUBLIC "foo" "bar">
+ # @p name the name of the doctype; EG, "me"
+ # @p pub_sys "PUBLIC", "SYSTEM", or nil. EG, "PUBLIC"
+ # @p long_name the supplied long name, or nil. EG, "foo"
+ # @p uri the uri of the doctype, or nil. EG, "bar"
+ def doctype name, pub_sys, long_name, uri
+ end
+ # If a doctype includes an ATTLIST declaration, it will cause this
+ # method to be called. The content is the declaration itself, unparsed.
+ # EG, <!ATTLIST el attr CDATA #REQUIRED> will come to this method as "el
+ # attr CDATA #REQUIRED". This is the same for all of the .*decl
+ # methods.
+ def attlistdecl(element, pairs, contents)
+ end
+ # <!ELEMENT ...>
+ def elementdecl content
+ end
+ # <!ENTITY ...>
+ # The argument passed to this method is an array of the entity
+ # declaration. It can be in a number of formats, but in general it
+ # returns (example, result):
+ # <!ENTITY % YN '"Yes"'>
+ # ["%", "YN", "'\"Yes\"'", "\""]
+ # <!ENTITY % YN 'Yes'>
+ # ["%", "YN", "'Yes'", "s"]
+ # <!ENTITY WhatHeSaid "He said %YN;">
+ # ["WhatHeSaid", "\"He said %YN;\"", "YN"]
+ # <!ENTITY open-hatch SYSTEM "http://www.textuality.com/boilerplate/OpenHatch.xml">
+ # ["open-hatch", "SYSTEM", "\"http://www.textuality.com/boilerplate/OpenHatch.xml\""]
+ # <!ENTITY open-hatch PUBLIC "-//Textuality//TEXT Standard open-hatch boilerplate//EN" "http://www.textuality.com/boilerplate/OpenHatch.xml">
+ # ["open-hatch", "PUBLIC", "\"-//Textuality//TEXT Standard open-hatch boilerplate//EN\"", "\"http://www.textuality.com/boilerplate/OpenHatch.xml\""]
+ # <!ENTITY hatch-pic SYSTEM "../grafix/OpenHatch.gif" NDATA gif>
+ # ["hatch-pic", "SYSTEM", "\"../grafix/OpenHatch.gif\"", "\n\t\t\t\t\t\t\tNDATA gif", "gif"]
+ def entitydecl name, decl
+ end
+ # <!NOTATION ...>
+ def notationdecl content
+ end
+ # Called when <![CDATA[ ... ]]> is encountered in a document.
+ # @p content "..."
+ def cdata content
+ end
+ # Called when an XML PI is encountered in the document.
+ # EG: <?xml version="1.0" encoding="utf"?>
+ # @p version the version attribute value. EG, "1.0"
+ # @p encoding the encoding attribute value, or nil. EG, "utf"
+ # @p standalone the standalone attribute value, or nil. EG, nil
# @p spaced the declaration is followed by a line break
- def xmldecl version, encoding, standalone
- end
- # Called when a comment is encountered.
- # @p comment The content of the comment
- def comment comment
- end
+ def xmldecl version, encoding, standalone
+ end
+ # Called when a comment is encountered.
+ # @p comment The content of the comment
+ def comment comment
+ end
def progress position
end
- end
+ end
end
diff --git a/lib/rexml/source.rb b/lib/rexml/source.rb
index 3f6d4ffa26..ce7a2c98b0 100644
--- a/lib/rexml/source.rb
+++ b/lib/rexml/source.rb
@@ -7,14 +7,13 @@ module REXML
# @param arg Either a String, or an IO
# @return a Source, or nil if a bad argument was given
def SourceFactory::create_from(arg)
- if arg.respond_to? :read and
- arg.respond_to? :readline and
- arg.respond_to? :nil? and
- arg.respond_to? :eof?
+ if arg.kind_of? String
+ Source.new(arg)
+ elsif arg.respond_to? :read and
+ arg.respond_to? :readline and
+ arg.respond_to? :nil? and
+ arg.respond_to? :eof?
IOSource.new(arg)
- elsif arg.respond_to? :to_str
- require 'stringio'
- IOSource.new(StringIO.new(arg))
elsif arg.kind_of? Source
arg
else
@@ -59,9 +58,6 @@ module REXML
@to_utf = true
else
@to_utf = false
- if @buffer.respond_to? :force_encoding
- @buffer.force_encoding Encoding::UTF_8
- end
end
end
@@ -69,9 +65,9 @@ module REXML
# usual scan() method. For one thing, the pattern argument has some
# requirements; for another, the source can be consumed. You can easily
# confuse this method. Originally, the patterns were easier
- # to construct and this method more robust, because this method
- # generated search regexes on the fly; however, this was
- # computationally expensive and slowed down the entire REXML package
+ # to construct and this method more robust, because this method
+ # generated search regexes on the fly; however, this was
+ # computationally expensive and slowed down the entire REXML package
# considerably, since this is by far the most commonly called method.
# @param pattern must be a Regexp, and must be in the form of
# /^\s*(#{your pattern, with no groups})(.*)/. The first group
@@ -147,21 +143,21 @@ module REXML
# the XML spec. If there is one, we can determine the encoding from
# it.
@buffer = ""
- str = @source.read( 2 ) || ''
+ str = @source.read( 2 )
if encoding
self.encoding = encoding
- elsif str[0,2] == "\xfe\xff"
+ elsif 0xfe == str[0] && 0xff == str[1]
@line_break = "\000>"
- elsif str[0,2] == "\xff\xfe"
+ elsif 0xff == str[0] && 0xfe == str[1]
@line_break = ">\000"
- elsif str[0,2] == "\xef\xbb"
+ elsif 0xef == str[0] && 0xbb == str[1]
str += @source.read(1)
- str = '' if (str[2,1] == "\xBF")
+ str = '' if (0xbf == str[2])
@line_break = ">"
else
@line_break = ">"
end
- super( @source.eof? ? str : str+@source.readline( @line_break ) )
+ super str+@source.readline( @line_break )
end
def scan(pattern, cons=false)
@@ -194,11 +190,8 @@ module REXML
def read
begin
str = @source.readline(@line_break)
- str = decode(str) if @to_utf and str
+ str = decode(str) if @to_utf and str
@buffer << str
- if not @to_utf and @buffer.respond_to? :force_encoding
- @buffer.force_encoding Encoding::UTF_8
- end
rescue Exception, NameError
@source = nil
end
@@ -225,13 +218,13 @@ module REXML
rv.taint
rv
end
-
+
def empty?
super and ( @source.nil? || @source.eof? )
end
def position
- @er_source.pos rescue 0
+ @er_source.stat.pipe? ? 0 : @er_source.pos
end
# @return the current line in the source
diff --git a/lib/rexml/streamlistener.rb b/lib/rexml/streamlistener.rb
index 619c529578..6f401125b5 100644
--- a/lib/rexml/streamlistener.rb
+++ b/lib/rexml/streamlistener.rb
@@ -1,92 +1,92 @@
module REXML
- # A template for stream parser listeners.
- # Note that the declarations (attlistdecl, elementdecl, etc) are trivially
- # processed; REXML doesn't yet handle doctype entity declarations, so you
- # have to parse them out yourself.
- module StreamListener
- # Called when a tag is encountered.
- # @p name the tag name
- # @p attrs an array of arrays of attribute/value pairs, suitable for
- # use with assoc or rassoc. IE, <tag attr1="value1" attr2="value2">
- # will result in
- # tag_start( "tag", # [["attr1","value1"],["attr2","value2"]])
- def tag_start name, attrs
- end
- # Called when the end tag is reached. In the case of <tag/>, tag_end
- # will be called immidiately after tag_start
- # @p the name of the tag
- def tag_end name
- end
- # Called when text is encountered in the document
- # @p text the text content.
- def text text
- end
- # Called when an instruction is encountered. EG: <?xsl sheet='foo'?>
- # @p name the instruction name; in the example, "xsl"
- # @p instruction the rest of the instruction. In the example,
- # "sheet='foo'"
- def instruction name, instruction
- end
- # Called when a comment is encountered.
- # @p comment The content of the comment
- def comment comment
- end
- # Handles a doctype declaration. Any attributes of the doctype which are
- # not supplied will be nil. # EG, <!DOCTYPE me PUBLIC "foo" "bar">
- # @p name the name of the doctype; EG, "me"
- # @p pub_sys "PUBLIC", "SYSTEM", or nil. EG, "PUBLIC"
- # @p long_name the supplied long name, or nil. EG, "foo"
- # @p uri the uri of the doctype, or nil. EG, "bar"
- def doctype name, pub_sys, long_name, uri
- end
- # Called when the doctype is done
- def doctype_end
- end
- # If a doctype includes an ATTLIST declaration, it will cause this
- # method to be called. The content is the declaration itself, unparsed.
- # EG, <!ATTLIST el attr CDATA #REQUIRED> will come to this method as "el
- # attr CDATA #REQUIRED". This is the same for all of the .*decl
- # methods.
- def attlistdecl element_name, attributes, raw_content
- end
- # <!ELEMENT ...>
- def elementdecl content
- end
- # <!ENTITY ...>
- # The argument passed to this method is an array of the entity
- # declaration. It can be in a number of formats, but in general it
- # returns (example, result):
- # <!ENTITY % YN '"Yes"'>
- # ["%", "YN", "'\"Yes\"'", "\""]
- # <!ENTITY % YN 'Yes'>
- # ["%", "YN", "'Yes'", "s"]
- # <!ENTITY WhatHeSaid "He said %YN;">
- # ["WhatHeSaid", "\"He said %YN;\"", "YN"]
- # <!ENTITY open-hatch SYSTEM "http://www.textuality.com/boilerplate/OpenHatch.xml">
- # ["open-hatch", "SYSTEM", "\"http://www.textuality.com/boilerplate/OpenHatch.xml\""]
- # <!ENTITY open-hatch PUBLIC "-//Textuality//TEXT Standard open-hatch boilerplate//EN" "http://www.textuality.com/boilerplate/OpenHatch.xml">
- # ["open-hatch", "PUBLIC", "\"-//Textuality//TEXT Standard open-hatch boilerplate//EN\"", "\"http://www.textuality.com/boilerplate/OpenHatch.xml\""]
- # <!ENTITY hatch-pic SYSTEM "../grafix/OpenHatch.gif" NDATA gif>
- # ["hatch-pic", "SYSTEM", "\"../grafix/OpenHatch.gif\"", "\n\t\t\t\t\t\t\tNDATA gif", "gif"]
- def entitydecl content
- end
- # <!NOTATION ...>
- def notationdecl content
- end
- # Called when %foo; is encountered in a doctype declaration.
- # @p content "foo"
- def entity content
- end
- # Called when <![CDATA[ ... ]]> is encountered in a document.
- # @p content "..."
- def cdata content
- end
- # Called when an XML PI is encountered in the document.
- # EG: <?xml version="1.0" encoding="utf"?>
- # @p version the version attribute value. EG, "1.0"
- # @p encoding the encoding attribute value, or nil. EG, "utf"
- # @p standalone the standalone attribute value, or nil. EG, nil
- def xmldecl version, encoding, standalone
- end
- end
+ # A template for stream parser listeners.
+ # Note that the declarations (attlistdecl, elementdecl, etc) are trivially
+ # processed; REXML doesn't yet handle doctype entity declarations, so you
+ # have to parse them out yourself.
+ module StreamListener
+ # Called when a tag is encountered.
+ # @p name the tag name
+ # @p attrs an array of arrays of attribute/value pairs, suitable for
+ # use with assoc or rassoc. IE, <tag attr1="value1" attr2="value2">
+ # will result in
+ # tag_start( "tag", # [["attr1","value1"],["attr2","value2"]])
+ def tag_start name, attrs
+ end
+ # Called when the end tag is reached. In the case of <tag/>, tag_end
+ # will be called immidiately after tag_start
+ # @p the name of the tag
+ def tag_end name
+ end
+ # Called when text is encountered in the document
+ # @p text the text content.
+ def text text
+ end
+ # Called when an instruction is encountered. EG: <?xsl sheet='foo'?>
+ # @p name the instruction name; in the example, "xsl"
+ # @p instruction the rest of the instruction. In the example,
+ # "sheet='foo'"
+ def instruction name, instruction
+ end
+ # Called when a comment is encountered.
+ # @p comment The content of the comment
+ def comment comment
+ end
+ # Handles a doctype declaration. Any attributes of the doctype which are
+ # not supplied will be nil. # EG, <!DOCTYPE me PUBLIC "foo" "bar">
+ # @p name the name of the doctype; EG, "me"
+ # @p pub_sys "PUBLIC", "SYSTEM", or nil. EG, "PUBLIC"
+ # @p long_name the supplied long name, or nil. EG, "foo"
+ # @p uri the uri of the doctype, or nil. EG, "bar"
+ def doctype name, pub_sys, long_name, uri
+ end
+ # Called when the doctype is done
+ def doctype_end
+ end
+ # If a doctype includes an ATTLIST declaration, it will cause this
+ # method to be called. The content is the declaration itself, unparsed.
+ # EG, <!ATTLIST el attr CDATA #REQUIRED> will come to this method as "el
+ # attr CDATA #REQUIRED". This is the same for all of the .*decl
+ # methods.
+ def attlistdecl element_name, attributes, raw_content
+ end
+ # <!ELEMENT ...>
+ def elementdecl content
+ end
+ # <!ENTITY ...>
+ # The argument passed to this method is an array of the entity
+ # declaration. It can be in a number of formats, but in general it
+ # returns (example, result):
+ # <!ENTITY % YN '"Yes"'>
+ # ["%", "YN", "'\"Yes\"'", "\""]
+ # <!ENTITY % YN 'Yes'>
+ # ["%", "YN", "'Yes'", "s"]
+ # <!ENTITY WhatHeSaid "He said %YN;">
+ # ["WhatHeSaid", "\"He said %YN;\"", "YN"]
+ # <!ENTITY open-hatch SYSTEM "http://www.textuality.com/boilerplate/OpenHatch.xml">
+ # ["open-hatch", "SYSTEM", "\"http://www.textuality.com/boilerplate/OpenHatch.xml\""]
+ # <!ENTITY open-hatch PUBLIC "-//Textuality//TEXT Standard open-hatch boilerplate//EN" "http://www.textuality.com/boilerplate/OpenHatch.xml">
+ # ["open-hatch", "PUBLIC", "\"-//Textuality//TEXT Standard open-hatch boilerplate//EN\"", "\"http://www.textuality.com/boilerplate/OpenHatch.xml\""]
+ # <!ENTITY hatch-pic SYSTEM "../grafix/OpenHatch.gif" NDATA gif>
+ # ["hatch-pic", "SYSTEM", "\"../grafix/OpenHatch.gif\"", "\n\t\t\t\t\t\t\tNDATA gif", "gif"]
+ def entitydecl content
+ end
+ # <!NOTATION ...>
+ def notationdecl content
+ end
+ # Called when %foo; is encountered in a doctype declaration.
+ # @p content "foo"
+ def entity content
+ end
+ # Called when <![CDATA[ ... ]]> is encountered in a document.
+ # @p content "..."
+ def cdata content
+ end
+ # Called when an XML PI is encountered in the document.
+ # EG: <?xml version="1.0" encoding="utf"?>
+ # @p version the version attribute value. EG, "1.0"
+ # @p encoding the encoding attribute value, or nil. EG, "utf"
+ # @p standalone the standalone attribute value, or nil. EG, nil
+ def xmldecl version, encoding, standalone
+ end
+ end
end
diff --git a/lib/rexml/syncenumerator.rb b/lib/rexml/syncenumerator.rb
index 11609bdf3d..955e006cb2 100644
--- a/lib/rexml/syncenumerator.rb
+++ b/lib/rexml/syncenumerator.rb
@@ -6,7 +6,8 @@ module REXML
# Enumerable objects.
def initialize(*enums)
@gens = enums
- @length = @gens.collect {|x| x.size }.max
+ @biggest = @gens[0]
+ @gens.each {|x| @biggest = x if x.size > @biggest.size }
end
# Returns the number of enumerated Enumerable objects, i.e. the size
@@ -23,8 +24,8 @@ module REXML
# Enumerates rows of the Enumerable objects.
def each
- @length.times {|i|
- yield @gens.collect {|x| x[i]}
+ @biggest.zip( *@gens ) {|a|
+ yield(*a[1..-1])
}
self
end
diff --git a/lib/rexml/text.rb b/lib/rexml/text.rb
index d09dc3ac54..2bc00429b3 100644
--- a/lib/rexml/text.rb
+++ b/lib/rexml/text.rb
@@ -18,57 +18,25 @@ module REXML
# If +raw+ is true, then REXML leaves the value alone
attr_accessor :raw
- NEEDS_A_SECOND_CHECK = /(<|&((#{Entity::NAME});|(#0*((?:\d+)|(?:x[a-fA-F0-9]+)));)?)/um
- NUMERICENTITY = /&#0*((?:\d+)|(?:x[a-fA-F0-9]+));/
- VALID_CHAR = [
- 0x9, 0xA, 0xD,
- (0x20..0xD7FF),
- (0xE000..0xFFFD),
- (0x10000..0x10FFFF)
- ]
-
- if String.method_defined? :encode
- VALID_XML_CHARS = Regexp.new('^['+
- VALID_CHAR.map { |item|
- case item
- when Fixnum
- [item].pack('U').force_encoding('utf-8')
- when Range
- [item.first, '-'.ord, item.last].pack('UUU').force_encoding('utf-8')
- end
- }.join +
- ']*$')
- else
- VALID_XML_CHARS = /^(
- [\x09\x0A\x0D\x20-\x7E] # ASCII
- | [\xC2-\xDF][\x80-\xBF] # non-overlong 2-byte
- | \xE0[\xA0-\xBF][\x80-\xBF] # excluding overlongs
- | [\xE1-\xEC\xEE][\x80-\xBF]{2} # straight 3-byte
- | \xEF[\x80-\xBE]{2} #
- | \xEF\xBF[\x80-\xBD] # excluding U+fffe and U+ffff
- | \xED[\x80-\x9F][\x80-\xBF] # excluding surrogates
- | \xF0[\x90-\xBF][\x80-\xBF]{2} # planes 1-3
- | [\xF1-\xF3][\x80-\xBF]{3} # planes 4-15
- | \xF4[\x80-\x8F][\x80-\xBF]{2} # plane 16
- )*$/nx;
- end
+ ILLEGAL = /(<|&(?!(#{Entity::NAME})|(#0*((?:\d+)|(?:x[a-fA-F0-9]+)));))/um
+ NUMERICENTITY = /&#0*((?:\d+)|(?:x[a-fA-F0-9]+));/
# Constructor
# +arg+ if a String, the content is set to the String. If a Text,
- # the object is shallowly cloned.
+ # the object is shallowly cloned.
#
# +respect_whitespace+ (boolean, false) if true, whitespace is
# respected
#
# +parent+ (nil) if this is a Parent object, the parent
- # will be set to this.
+ # will be set to this.
#
# +raw+ (nil) This argument can be given three values.
- # If true, then the value of used to construct this object is expected to
- # contain no unescaped XML markup, and REXML will not change the text. If
+ # If true, then the value of used to construct this object is expected to
+ # contain no unescaped XML markup, and REXML will not change the text. If
# this value is false, the string may contain any characters, and REXML will
# escape any and all defined entities whose values are contained in the
- # text. If this value is nil (the default), then the raw value of the
+ # text. If this value is nil (the default), then the raw value of the
# parent will be used as the raw value for this node. If there is no raw
# value for the parent, and no value is supplied, the default is false.
# Use this field if you have entities defined for some text, and you don't
@@ -89,14 +57,14 @@ module REXML
# In the last example, the +entity_filter+ argument is ignored.
#
# +pattern+ INTERNAL USE ONLY
- def initialize(arg, respect_whitespace=false, parent=nil, raw=nil,
- entity_filter=nil, illegal=NEEDS_A_SECOND_CHECK )
+ def initialize(arg, respect_whitespace=false, parent=nil, raw=nil,
+ entity_filter=nil, illegal=ILLEGAL )
@raw = false
if parent
super( parent )
- @raw = parent.raw
+ @raw = parent.raw
else
@parent = nil
end
@@ -117,54 +85,10 @@ module REXML
@string.gsub!( /\r\n?/, "\n" )
- Text.check(@string, NEEDS_A_SECOND_CHECK, doctype) if @raw and @parent
- end
-
- def parent= parent
- super(parent)
- Text.check(@string, NEEDS_A_SECOND_CHECK, doctype) if @raw and @parent
- end
-
- # check for illegal characters
- def Text.check string, pattern, doctype
-
- # illegal anywhere
- if string !~ VALID_XML_CHARS
- if String.method_defined? :encode
- string.chars.each do |c|
- case c.ord
- when *VALID_CHAR
- else
- raise "Illegal character #{c.inspect} in raw string \"#{string}\""
- end
- end
- else
- string.scan(/[\x00-\x7F]|[\x80-\xBF][\xC0-\xF0]*|[\xC0-\xF0]/n) do |c|
- case c.unpack('U')
- when *VALID_CHAR
- else
- raise "Illegal character #{c.inspect} in raw string \"#{string}\""
- end
- end
- end
- end
-
- # context sensitive
- string.scan(pattern) do
- if $1[-1] != ?;
- raise "Illegal character '#{$1}' in raw string \"#{string}\""
- elsif $1[0] == ?&
- if $5 and $5[0] == ?#
- case ($5[1] == ?x ? $5[2..-1].to_i(16) : $5[1..-1].to_i)
- when *VALID_CHAR
- else
- raise "Illegal character '#{$1}' in raw string \"#{string}\""
- end
- elsif $3 and !SUBSTITUTES.include?($1)
- if !doctype or !doctype.entities.has_key?($3)
- raise "Undeclared entity '#{$1}' in raw string \"#{string}\""
- end
- end
+ # check for illegal characters
+ if @raw
+ if @string =~ illegal
+ raise "Illegal character '#{$1}' in raw string \"#{@string}\""
end
end
end
@@ -196,24 +120,17 @@ module REXML
to_s() <=> other.to_s
end
- def doctype
- if @parent
- doc = @parent.document
- doc.doctype if doc
- end
- end
-
REFERENCE = /#{Entity::REFERENCE}/
# Returns the string value of this text node. This string is always
# escaped, meaning that it is a valid XML text node string, and all
# entities that can be escaped, have been inserted. This method respects
# the entity filter set in the constructor.
- #
- # # Assume that the entity "s" is defined to be "sean", and that the
+ #
+ # # Assume that the entity "s" is defined to be "sean", and that the
# # entity "r" is defined to be "russell"
- # t = Text.new( "< & sean russell", false, nil, false, ['s'] )
+ # t = Text.new( "< & sean russell", false, nil, false, ['s'] )
# t.to_s #-> "&lt; &amp; &s; russell"
- # t = Text.new( "< & &s; russell", false, nil, false )
+ # t = Text.new( "< & &s; russell", false, nil, false )
# t.to_s #-> "&lt; &amp; &s; russell"
# u = Text.new( "sean russell", false, nil, true )
# u.to_s #-> "sean russell"
@@ -221,6 +138,12 @@ module REXML
return @string if @raw
return @normalized if @normalized
+ doctype = nil
+ if @parent
+ doc = @parent.document
+ doctype = doc.doctype if doc
+ end
+
@normalized = Text::normalize( @string, doctype, @entity_filter )
end
@@ -233,20 +156,25 @@ module REXML
# console. This ignores the 'raw' attribute setting, and any
# entity_filter.
#
- # # Assume that the entity "s" is defined to be "sean", and that the
+ # # Assume that the entity "s" is defined to be "sean", and that the
# # entity "r" is defined to be "russell"
- # t = Text.new( "< & sean russell", false, nil, false, ['s'] )
+ # t = Text.new( "< & sean russell", false, nil, false, ['s'] )
# t.value #-> "< & sean russell"
# t = Text.new( "< & &s; russell", false, nil, false )
# t.value #-> "< & sean russell"
# u = Text.new( "sean russell", false, nil, true )
# u.value #-> "sean russell"
def value
- return @unnormalized if @unnormalized
+ @unnormalized if @unnormalized
+ doctype = nil
+ if @parent
+ doc = @parent.document
+ doctype = doc.doctype if doc
+ end
@unnormalized = Text::unnormalize( @string, doctype )
end
- # Sets the contents of this text node. This expects the text to be
+ # Sets the contents of this text node. This expects the text to be
# unnormalized. It returns self.
#
# e = Element.new( "a" )
@@ -259,7 +187,7 @@ module REXML
@normalized = nil
@raw = false
end
-
+
def wrap(string, width, addnewline=false)
# Recursively wrap string at width.
return string if string.length <= width
@@ -282,11 +210,11 @@ module REXML
new_string.strip! unless indentfirstline
return new_string
end
-
+
# == DEPRECATED
# See REXML::Formatters
#
- def write( writer, indent=-1, transitive=false, ie_hack=false )
+ def write( writer, indent=-1, transitive=false, ie_hack=false )
Kernel.warn("#{self.class.name}.write is deprecated. See REXML::Formatters")
formatter = if indent > -1
REXML::Formatters::Pretty.new( indent )
@@ -337,7 +265,7 @@ module REXML
if copy =~ illegal
raise ParseException.new( "malformed text: Illegal character #$& in \"#{copy}\"" )
end if illegal
-
+
copy.gsub!( /\r\n?/, "\n" )
if copy.include? ?&
copy.gsub!( SETUTITSBUS[0], SLAICEPS[0] )
@@ -345,7 +273,7 @@ module REXML
copy.gsub!( SETUTITSBUS[2], SLAICEPS[2] )
copy.gsub!( SETUTITSBUS[3], SLAICEPS[3] )
copy.gsub!( SETUTITSBUS[4], SLAICEPS[4] )
- copy.gsub!( /&#0*((?:\d+)|(?:x[a-f0-9]+));/ ) {
+ copy.gsub!( /&#0*((?:\d+)|(?:x[a-f0-9]+));/ ) {|m|
m=$1
#m='0' if m==''
m = "0#{m}" if m[0] == ?x
@@ -358,15 +286,15 @@ module REXML
EREFERENCE = /&(?!#{Entity::NAME};)/
# Escapes all possible entities
def Text::normalize( input, doctype=nil, entity_filter=nil )
- copy = input.to_s
+ copy = input
# Doing it like this rather than in a loop improves the speed
#copy = copy.gsub( EREFERENCE, '&amp;' )
copy = copy.gsub( "&", "&amp;" )
if doctype
# Replace all ampersands that aren't part of an entity
doctype.entities.each_value do |entity|
- copy = copy.gsub( entity.value,
- "&#{entity.name};" ) if entity.value and
+ copy = copy.gsub( entity.value,
+ "&#{entity.name};" ) if entity.value and
not( entity_filter and entity_filter.include?(entity) )
end
else
@@ -380,25 +308,37 @@ module REXML
# Unescapes all possible entities
def Text::unnormalize( string, doctype=nil, filter=nil, illegal=nil )
- string.gsub( /\r\n?/, "\n" ).gsub( REFERENCE ) {
- ref = $&
- if ref[1] == ?#
- if ref[2] == ?x
- [ref[3...-1].to_i(16)].pack('U*')
- else
- [ref[2...-1].to_i].pack('U*')
+ rv = string.clone
+ rv.gsub!( /\r\n?/, "\n" )
+ matches = rv.scan( REFERENCE )
+ return rv if matches.size == 0
+ rv.gsub!( NUMERICENTITY ) {|m|
+ m=$1
+ m = "0#{m}" if m[0] == ?x
+ [Integer(m)].pack('U*')
+ }
+ matches.collect!{|x|x[0]}.compact!
+ if matches.size > 0
+ if doctype
+ matches.each do |entity_reference|
+ unless filter and filter.include?(entity_reference)
+ entity_value = doctype.entity( entity_reference )
+ re = /&#{entity_reference};/
+ rv.gsub!( re, entity_value ) if entity_value
+ end
end
- elsif ref == '&amp;'
- '&'
- elsif filter and filter.include?( ref[1...-1] )
- ref
- elsif doctype
- doctype.entity( ref[1...-1] ) or ref
else
- entity_value = DocType::DEFAULT_ENTITIES[ ref[1...-1] ]
- entity_value ? entity_value.value : ref
+ matches.each do |entity_reference|
+ unless filter and filter.include?(entity_reference)
+ entity_value = DocType::DEFAULT_ENTITIES[ entity_reference ]
+ re = /&#{entity_reference};/
+ rv.gsub!( re, entity_value.value ) if entity_value
+ end
+ end
end
- }
+ rv.gsub!( /&amp;/, '&' )
+ end
+ rv
end
end
end
diff --git a/lib/rexml/validation/relaxng.rb b/lib/rexml/validation/relaxng.rb
index 2441901d7b..969f51bc95 100644
--- a/lib/rexml/validation/relaxng.rb
+++ b/lib/rexml/validation/relaxng.rb
@@ -79,7 +79,7 @@ module REXML
when "mixed"
states << Interleave.new( self )
states[-2] << states[-1]
- states[-1] << TEXT
+ states[-1] << TEXT
when "define"
states << [ event[2]["name"] ]
when "ref"
@@ -102,7 +102,7 @@ module REXML
case event[1]
when "element", "attribute"
states[-1] << event
- when "zeroOrMore", "oneOrMore", "choice", "optional",
+ when "zeroOrMore", "oneOrMore", "choice", "optional",
"interleave", "group", "mixed"
states.pop
when "define"
@@ -139,7 +139,7 @@ module REXML
@events.each {|s| s.reset if s.kind_of? State }
end
- def previous=( previous )
+ def previous=( previous )
@previous << previous
end
@@ -183,7 +183,7 @@ module REXML
end
def inspect
- "< #{to_s} #{@events.collect{|e|
+ "< #{to_s} #{@events.collect{|e|
pre = e == @events[@current] ? '#' : ''
pre + e.inspect unless self == e
}.join(', ')} >"
@@ -201,15 +201,15 @@ module REXML
protected
def expand_ref_in( arry, ind )
new_events = []
- @references[ arry[ind].to_s ].each{ |evt|
+ @references[ arry[ind].to_s ].each{ |evt|
add_event_to_arry(new_events,evt)
}
arry[ind,1] = new_events
end
- def add_event_to_arry( arry, evt )
+ def add_event_to_arry( arry, evt )
evt = generate_event( evt )
- if evt.kind_of? String
+ if evt.kind_of? String
arry[-1].event_arg = evt if arry[-1].kind_of? Event and @value
@value = false
else
@@ -272,7 +272,7 @@ module REXML
end
def matches?(event)
- @events[@current].matches?(event) ||
+ @events[@current].matches?(event) ||
(@current == 0 and @previous[-1].matches?(event))
end
@@ -319,7 +319,7 @@ module REXML
end
def reset
- super
+ super
@ord = 0
end
@@ -345,7 +345,7 @@ module REXML
end
def matches?( event )
- @events[@current].matches?(event) ||
+ @events[@current].matches?(event) ||
(@current == 0 and @ord > 0 and @previous[-1].matches?(event))
end
@@ -412,7 +412,7 @@ module REXML
#puts "IN CHOICE EXPECTED"
#puts "EVENTS = #{@events.inspect}"
return [@events[@current]] if @events.size > 0
- return @choices.collect do |x|
+ return @choices.collect do |x|
if x[0].kind_of? State
x[0].expected
else
@@ -426,17 +426,17 @@ module REXML
end
protected
- def add_event_to_arry( arry, evt )
+ def add_event_to_arry( arry, evt )
if evt.kind_of? State or evt.class == Ref
arry << [evt]
- elsif evt[0] == :text
+ elsif evt[0] == :text
if arry[-1] and
- arry[-1][-1].kind_of?( Event ) and
+ arry[-1][-1].kind_of?( Event ) and
arry[-1][-1].event_type == :text and @value
arry[-1][-1].event_arg = evt[1]
@value = false
- end
+ end
else
arry << [] if evt[0] == :start_element
arry[-1] << generate_event( evt )
@@ -478,7 +478,7 @@ module REXML
@choices[idx] = old
@choice += 1
end
-
+
#puts "In next with #{event.inspect}."
#puts "events is #{@events.inspect}"
@events = [] unless @events
@@ -490,7 +490,7 @@ module REXML
next_current(event) unless @events[@current]
return nil unless @events[@current]
- expand_ref_in( @events, @current ) if @events[@current].class == Ref
+ expand_ref_in( @events, @current ) if @events[@current].class == Ref
#puts "In next with #{event.inspect}."
#puts "Next (#@current) is #{@events[@current]}"
if ( @events[@current].kind_of? State )
@@ -530,7 +530,7 @@ module REXML
#puts "IN CHOICE EXPECTED"
#puts "EVENTS = #{@events.inspect}"
return [@events[@current]] if @events[@current]
- return @choices[@choice..-1].collect do |x|
+ return @choices[@choice..-1].collect do |x|
if x[0].kind_of? State
x[0].expected
else
diff --git a/lib/rexml/validation/validation.rb b/lib/rexml/validation/validation.rb
index f0ffa78912..160ea96b31 100644
--- a/lib/rexml/validation/validation.rb
+++ b/lib/rexml/validation/validation.rb
@@ -14,7 +14,7 @@ module REXML
def dump
puts @root.inspect
end
- def validate( event )
+ def validate( event )
#puts "Current: #@current"
#puts "Event: #{event.inspect}"
@attr_stack = [] unless defined? @attr_stack
@@ -33,12 +33,12 @@ module REXML
sattr = [:start_attribute, nil]
eattr = [:end_attribute]
text = [:text, nil]
- k,v = event[2].find { |key,value|
- sattr[1] = key
+ k,v = event[2].find { |k,v|
+ sattr[1] = k
#puts "Looking for #{sattr.inspect}"
m = @current.next( sattr )
#puts "Got #{m.inspect}"
- if m
+ if m
# If the state has text children...
#puts "Looking for #{eattr.inspect}"
#puts "Expect #{m.expected}"
@@ -47,7 +47,7 @@ module REXML
@current = m
else
#puts "Didn't get end"
- text[1] = value
+ text[1] = v
#puts "Looking for #{text.inspect}"
m = m.next( text )
#puts "Got #{m.inspect}"
diff --git a/lib/rexml/xmldecl.rb b/lib/rexml/xmldecl.rb
index 361e4b7106..427eb78cf8 100644
--- a/lib/rexml/xmldecl.rb
+++ b/lib/rexml/xmldecl.rb
@@ -2,40 +2,40 @@ require 'rexml/encoding'
require 'rexml/source'
module REXML
- # NEEDS DOCUMENTATION
- class XMLDecl < Child
- include Encoding
+ # NEEDS DOCUMENTATION
+ class XMLDecl < Child
+ include Encoding
- DEFAULT_VERSION = "1.0";
- DEFAULT_ENCODING = "UTF-8";
- DEFAULT_STANDALONE = "no";
- START = '<\?xml';
- STOP = '\?>';
+ DEFAULT_VERSION = "1.0";
+ DEFAULT_ENCODING = "UTF-8";
+ DEFAULT_STANDALONE = "no";
+ START = '<\?xml';
+ STOP = '\?>';
- attr_accessor :version, :standalone
+ attr_accessor :version, :standalone
attr_reader :writeencoding, :writethis
- def initialize(version=DEFAULT_VERSION, encoding=nil, standalone=nil)
+ def initialize(version=DEFAULT_VERSION, encoding=nil, standalone=nil)
@writethis = true
@writeencoding = !encoding.nil?
- if version.kind_of? XMLDecl
- super()
- @version = version.version
- self.encoding = version.encoding
+ if version.kind_of? XMLDecl
+ super()
+ @version = version.version
+ self.encoding = version.encoding
@writeencoding = version.writeencoding
- @standalone = version.standalone
- else
- super()
- @version = version
- self.encoding = encoding
- @standalone = standalone
- end
- @version = DEFAULT_VERSION if @version.nil?
- end
-
- def clone
- XMLDecl.new(self)
- end
+ @standalone = version.standalone
+ else
+ super()
+ @version = version
+ self.encoding = encoding
+ @standalone = standalone
+ end
+ @version = DEFAULT_VERSION if @version.nil?
+ end
+
+ def clone
+ XMLDecl.new(self)
+ end
# indent::
# Ignored. There must be no whitespace before an XML declaration
@@ -43,35 +43,35 @@ module REXML
# Ignored
# ie_hack::
# Ignored
- def write(writer, indent=-1, transitive=false, ie_hack=false)
+ def write(writer, indent=-1, transitive=false, ie_hack=false)
return nil unless @writethis or writer.kind_of? Output
- writer << START.sub(/\\/u, '')
+ writer << START.sub(/\\/u, '')
if writer.kind_of? Output
writer << " #{content writer.encoding}"
else
writer << " #{content encoding}"
end
- writer << STOP.sub(/\\/u, '')
- end
-
- def ==( other )
- other.kind_of?(XMLDecl) and
- other.version == @version and
- other.encoding == self.encoding and
- other.standalone == @standalone
- end
-
- def xmldecl version, encoding, standalone
- @version = version
- self.encoding = encoding
- @standalone = standalone
- end
-
- def node_type
- :xmldecl
- end
-
- alias :stand_alone? :standalone
+ writer << STOP.sub(/\\/u, '')
+ end
+
+ def ==( other )
+ other.kind_of?(XMLDecl) and
+ other.version == @version and
+ other.encoding == self.encoding and
+ other.standalone == @standalone
+ end
+
+ def xmldecl version, encoding, standalone
+ @version = version
+ self.encoding = encoding
+ @standalone = standalone
+ end
+
+ def node_type
+ :xmldecl
+ end
+
+ alias :stand_alone? :standalone
alias :old_enc= :encoding=
def encoding=( enc )
@@ -108,12 +108,12 @@ module REXML
START.sub(/\\/u, '') + " ... " + STOP.sub(/\\/u, '')
end
- private
- def content(enc)
- rv = "version='#@version'"
- rv << " encoding='#{enc}'" if @writeencoding || enc !~ /utf-8/i
- rv << " standalone='#@standalone'" if @standalone
- rv
- end
- end
+ private
+ def content(enc)
+ rv = "version='#@version'"
+ rv << " encoding='#{enc}'" if @writeencoding || enc !~ /utf-8/i
+ rv << " standalone='#@standalone'" if @standalone
+ rv
+ end
+ end
end
diff --git a/lib/rexml/xmltokens.rb b/lib/rexml/xmltokens.rb
index 83efeb0e44..6bbe5b07d5 100644
--- a/lib/rexml/xmltokens.rb
+++ b/lib/rexml/xmltokens.rb
@@ -1,18 +1,18 @@
module REXML
- # Defines a number of tokens used for parsing XML. Not for general
- # consumption.
- module XMLTokens
- NCNAME_STR= '[\w:][\-\w\d.]*'
- NAME_STR= "(?:#{NCNAME_STR}:)?#{NCNAME_STR}"
+ # Defines a number of tokens used for parsing XML. Not for general
+ # consumption.
+ module XMLTokens
+ NCNAME_STR= '[\w:][\-\w\d.]*'
+ NAME_STR= "(?:#{NCNAME_STR}:)?#{NCNAME_STR}"
- NAMECHAR = '[\-\w\d\.:]'
- NAME = "([\\w:]#{NAMECHAR}*)"
- NMTOKEN = "(?:#{NAMECHAR})+"
- NMTOKENS = "#{NMTOKEN}(\\s+#{NMTOKEN})*"
- REFERENCE = "(?:&#{NAME};|&#\\d+;|&#x[0-9a-fA-F]+;)"
+ NAMECHAR = '[\-\w\d\.:]'
+ NAME = "([\\w:]#{NAMECHAR}*)"
+ NMTOKEN = "(?:#{NAMECHAR})+"
+ NMTOKENS = "#{NMTOKEN}(\\s+#{NMTOKEN})*"
+ REFERENCE = "(?:&#{NAME};|&#\\d+;|&#x[0-9a-fA-F]+;)"
- #REFERENCE = "(?:#{ENTITYREF}|#{CHARREF})"
- #ENTITYREF = "&#{NAME};"
- #CHARREF = "&#\\d+;|&#x[0-9a-fA-F]+;"
- end
+ #REFERENCE = "(?:#{ENTITYREF}|#{CHARREF})"
+ #ENTITYREF = "&#{NAME};"
+ #CHARREF = "&#\\d+;|&#x[0-9a-fA-F]+;"
+ end
end
diff --git a/lib/rexml/xpath.rb b/lib/rexml/xpath.rb
index 5f7ecefe29..e8813efd3e 100644
--- a/lib/rexml/xpath.rb
+++ b/lib/rexml/xpath.rb
@@ -2,76 +2,65 @@ require 'rexml/functions'
require 'rexml/xpath_parser'
module REXML
- # Wrapper class. Use this class to access the XPath functions.
- class XPath
- include Functions
- EMPTY_HASH = {}
+ # Wrapper class. Use this class to access the XPath functions.
+ class XPath
+ include Functions
+ EMPTY_HASH = {}
- # Finds and returns the first node that matches the supplied xpath.
- # element::
- # The context element
- # path::
- # The xpath to search for. If not supplied or nil, returns the first
- # node matching '*'.
- # namespaces::
- # If supplied, a Hash which defines a namespace mapping.
- # variables::
- # If supplied, a Hash which maps $variables in the query
- # to values. This can be used to avoid XPath injection attacks
- # or to automatically handle escaping string values.
- #
- # XPath.first( node )
- # XPath.first( doc, "//b"} )
- # XPath.first( node, "a/x:b", { "x"=>"http://doofus" } )
- # XPath.first( node, '/book/publisher/text()=$publisher', {}, {"publisher"=>"O'Reilly"})
+ # Finds and returns the first node that matches the supplied xpath.
+ # element::
+ # The context element
+ # path::
+ # The xpath to search for. If not supplied or nil, returns the first
+ # node matching '*'.
+ # namespaces::
+ # If supplied, a Hash which defines a namespace mapping.
+ #
+ # XPath.first( node )
+ # XPath.first( doc, "//b"} )
+ # XPath.first( node, "a/x:b", { "x"=>"http://doofus" } )
def XPath::first element, path=nil, namespaces=nil, variables={}
raise "The namespaces argument, if supplied, must be a hash object." unless namespaces.nil? or namespaces.kind_of?(Hash)
raise "The variables argument, if supplied, must be a hash object." unless variables.kind_of?(Hash)
- parser = XPathParser.new
- parser.namespaces = namespaces
- parser.variables = variables
- path = "*" unless path
- element = [element] unless element.kind_of? Array
- parser.parse(path, element).flatten[0]
- end
+ parser = XPathParser.new
+ parser.namespaces = namespaces
+ parser.variables = variables
+ path = "*" unless path
+ element = [element] unless element.kind_of? Array
+ parser.parse(path, element).flatten[0]
+ end
- # Iterates over nodes that match the given path, calling the supplied
- # block with the match.
- # element::
- # The context element
- # path::
- # The xpath to search for. If not supplied or nil, defaults to '*'
- # namespaces::
- # If supplied, a Hash which defines a namespace mapping
- # variables::
- # If supplied, a Hash which maps $variables in the query
- # to values. This can be used to avoid XPath injection attacks
- # or to automatically handle escaping string values.
- #
- # XPath.each( node ) { |el| ... }
- # XPath.each( node, '/*[@attr='v']' ) { |el| ... }
- # XPath.each( node, 'ancestor::x' ) { |el| ... }
- # XPath.each( node, '/book/publisher/text()=$publisher', {}, {"publisher"=>"O'Reilly"}) \
- # {|el| ... }
- def XPath::each element, path=nil, namespaces=nil, variables={}, &block
+ # Iterates over nodes that match the given path, calling the supplied
+ # block with the match.
+ # element::
+ # The context element
+ # path::
+ # The xpath to search for. If not supplied or nil, defaults to '*'
+ # namespaces::
+ # If supplied, a Hash which defines a namespace mapping
+ #
+ # XPath.each( node ) { |el| ... }
+ # XPath.each( node, '/*[@attr='v']' ) { |el| ... }
+ # XPath.each( node, 'ancestor::x' ) { |el| ... }
+ def XPath::each element, path=nil, namespaces=nil, variables={}, &block
raise "The namespaces argument, if supplied, must be a hash object." unless namespaces.nil? or namespaces.kind_of?(Hash)
raise "The variables argument, if supplied, must be a hash object." unless variables.kind_of?(Hash)
- parser = XPathParser.new
- parser.namespaces = namespaces
- parser.variables = variables
- path = "*" unless path
- element = [element] unless element.kind_of? Array
- parser.parse(path, element).each( &block )
- end
+ parser = XPathParser.new
+ parser.namespaces = namespaces
+ parser.variables = variables
+ path = "*" unless path
+ element = [element] unless element.kind_of? Array
+ parser.parse(path, element).each( &block )
+ end
- # Returns an array of nodes matching a given XPath.
- def XPath::match element, path=nil, namespaces=nil, variables={}
- parser = XPathParser.new
- parser.namespaces = namespaces
- parser.variables = variables
- path = "*" unless path
- element = [element] unless element.kind_of? Array
- parser.parse(path,element)
- end
- end
+ # Returns an array of nodes matching a given XPath.
+ def XPath::match element, path=nil, namespaces=nil, variables={}
+ parser = XPathParser.new
+ parser.namespaces = namespaces
+ parser.variables = variables
+ path = "*" unless path
+ element = [element] unless element.kind_of? Array
+ parser.parse(path,element)
+ end
+ end
end
diff --git a/lib/rexml/xpath_parser.rb b/lib/rexml/xpath_parser.rb
index 11950ecd93..eb608fdb34 100644
--- a/lib/rexml/xpath_parser.rb
+++ b/lib/rexml/xpath_parser.rb
@@ -88,7 +88,7 @@ module REXML
case path[0]
when :document
- # do nothing
+ # do nothing
return first( path[1..-1], node )
when :child
for c in node.children
@@ -123,7 +123,7 @@ module REXML
end
- def match( path_stack, nodeset )
+ def match( path_stack, nodeset )
#puts "MATCH: path_stack = #{path_stack.inspect}"
#puts "MATCH: nodeset = #{nodeset.inspect}"
r = expr( path_stack, nodeset )
@@ -136,7 +136,7 @@ module REXML
# Returns a String namespace for a node, given a prefix
# The rules are:
- #
+ #
# 1. Use the supplied namespace mapping first.
# 2. If no mapping was supplied, use the context node to look up the namespace
def get_namespace( node, prefix )
@@ -187,8 +187,8 @@ module REXML
#puts "node.namespace == #{ns.inspect} => #{node.namespace == ns}"
end
end
- !(node.node_type == :element and
- node.name == name and
+ !(node.node_type == :element and
+ node.name == name and
node.namespace == ns )
end
node_types = ELEMENTS
@@ -205,7 +205,7 @@ module REXML
when :processing_instruction
target = path_stack.shift
nodeset.delete_if do |node|
- (node.node_type != :processing_instruction) or
+ (node.node_type != :processing_instruction) or
( target!='' and ( node.target != target ) )
end
@@ -222,7 +222,7 @@ module REXML
when :child
new_nodeset = []
nt = nil
- nodeset.each do |node|
+ for node in nodeset
nt = node.node_type
new_nodeset += node.children if nt == :element or nt == :document
end
@@ -231,7 +231,7 @@ module REXML
when :literal
return path_stack.shift
-
+
when :attribute
new_nodeset = []
case path_stack.shift
@@ -266,7 +266,7 @@ module REXML
when :ancestor
new_nodeset = []
- nodeset.each do |node|
+ for node in nodeset
while node.parent
node = node.parent
new_nodeset << node unless new_nodeset.include? node
@@ -277,7 +277,7 @@ module REXML
when :ancestor_or_self
new_nodeset = []
- nodeset.each do |node|
+ for node in nodeset
if node.node_type == :element
new_nodeset << node
while ( node.parent )
@@ -341,7 +341,7 @@ module REXML
when :descendant
results = []
nt = nil
- nodeset.each do |node|
+ for node in nodeset
nt = node.node_type
results += expr( path_stack.dclone.unshift( :descendant_or_self ),
node.children ) if nt == :element or nt == :document
@@ -376,7 +376,7 @@ module REXML
when :preceding
new_nodeset = []
- nodeset.each do |node|
+ for node in nodeset
new_nodeset += preceding( node )
end
#puts "NEW NODESET => #{new_nodeset.inspect}"
@@ -385,7 +385,7 @@ module REXML
when :following
new_nodeset = []
- nodeset.each do |node|
+ for node in nodeset
new_nodeset += following( node )
end
nodeset = new_nodeset
@@ -395,7 +395,7 @@ module REXML
#puts "In :namespace"
new_nodeset = []
prefix = path_stack.shift
- nodeset.each do |node|
+ for node in nodeset
if (node.node_type == :element or node.node_type == :attribute)
if @namespaces
namespaces = @namespaces
@@ -419,10 +419,10 @@ module REXML
return @variables[ var_name ]
# :and, :or, :eq, :neq, :lt, :lteq, :gt, :gteq
- # TODO: Special case for :or and :and -- not evaluate the right
- # operand if the left alone determines result (i.e. is true for
- # :or and false for :and).
- when :eq, :neq, :lt, :lteq, :gt, :gteq, :or
+ # TODO: Special case for :or and :and -- not evaluate the right
+ # operand if the left alone determines result (i.e. is true for
+ # :or and false for :and).
+ when :eq, :neq, :lt, :lteq, :gt, :gteq, :and, :or
left = expr( path_stack.shift, nodeset.dup, context )
#puts "LEFT => #{left.inspect} (#{left.class.name})"
right = expr( path_stack.shift, nodeset.dup, context )
@@ -481,23 +481,23 @@ module REXML
when :function
func_name = path_stack.shift.tr('-','_')
arguments = path_stack.shift
- #puts "FUNCTION 0: #{func_name}(#{arguments.collect{|a|a.inspect}.join(', ')})"
+ #puts "FUNCTION 0: #{func_name}(#{arguments.collect{|a|a.inspect}.join(', ')})"
subcontext = context ? nil : { :size => nodeset.size }
res = []
cont = context
- nodeset.each_with_index { |n, i|
+ nodeset.each_with_index { |n, i|
if subcontext
subcontext[:node] = n
subcontext[:index] = i
cont = subcontext
end
arg_clone = arguments.dclone
- args = arg_clone.collect { |arg|
+ args = arg_clone.collect { |arg|
#puts "FUNCTION 1: Calling expr( #{arg.inspect}, [#{n.inspect}] )"
- expr( arg, [n], cont )
+ expr( arg, [n], cont )
}
- #puts "FUNCTION 2: #{func_name}(#{args.collect{|a|a.inspect}.join(', ')})"
+ #puts "FUNCTION 2: #{func_name}(#{args.collect{|a|a.inspect}.join(', ')})"
Functions.context = cont
res << Functions.send( func_name, *args )
#puts "FUNCTION 3: #{res[-1].inspect}"
@@ -515,10 +515,10 @@ module REXML
# FIXME
# The next two methods are BAD MOJO!
# This is my achilles heel. If anybody thinks of a better
- # way of doing this, be my guest. This really sucks, but
+ # way of doing this, be my guest. This really sucks, but
# it is a wonder it works at all.
# ########################################################
-
+
def descendant_or_self( path_stack, nodeset )
rs = []
#puts "#"*80
@@ -547,7 +547,7 @@ module REXML
# Reorders an array of nodes so that they are in document order
# It tries to do this efficiently.
#
- # FIXME: I need to get rid of this, but the issue is that most of the XPath
+ # FIXME: I need to get rid of this, but the issue is that most of the XPath
# interpreter functions as a filter, which means that we lose context going
# in and out of function calls. If I knew what the index of the nodes was,
# I wouldn't have to do this. Maybe add a document IDX for each node?
@@ -555,7 +555,7 @@ module REXML
def document_order( array_of_nodes )
new_arry = []
array_of_nodes.each { |node|
- node_idx = []
+ node_idx = []
np = node.node_type == :attribute ? node.element : node
while np.parent and np.parent.node_type == :element
node_idx << np.parent.index( np )
@@ -579,7 +579,7 @@ module REXML
# Builds a nodeset of all of the preceding nodes of the supplied node,
# in reverse document order
- # preceding:: includes every element in the document that precedes this node,
+ # preceding:: includes every element in the document that precedes this node,
# except for ancestors
def preceding( node )
#puts "IN PRECEDING"
@@ -609,9 +609,9 @@ module REXML
#puts "NODE: #{node.inspect}"
#puts "PREVIOUS NODE: #{node.previous_sibling_node.inspect}"
#puts "PARENT NODE: #{node.parent}"
- psn = node.previous_sibling_node
+ psn = node.previous_sibling_node
if psn.nil?
- if node.parent.nil? or node.parent.class == Document
+ if node.parent.nil? or node.parent.class == Document
return nil
end
return node.parent
@@ -647,9 +647,9 @@ module REXML
end
def next_sibling_node(node)
- psn = node.next_sibling_node
+ psn = node.next_sibling_node
while psn.nil?
- if node.parent.nil? or node.parent.class == Document
+ if node.parent.nil? or node.parent.class == Document
return nil
end
node = node.parent
@@ -675,7 +675,7 @@ module REXML
def equality_relational_compare( set1, op, set2 )
#puts "EQ_REL_COMP(#{set1.inspect} #{op.inspect} #{set2.inspect})"
if set1.kind_of? Array and set2.kind_of? Array
- #puts "#{set1.size} & #{set2.size}"
+ #puts "#{set1.size} & #{set2.size}"
if set1.size == 1 and set2.size == 1
set1 = set1[0]
set2 = set2[0]
@@ -696,7 +696,7 @@ module REXML
return res
end
end
- #puts "EQ_REL_COMP: #{set1.inspect} (#{set1.class.name}), #{op}, #{set2.inspect} (#{set2.class.name})"
+ #puts "EQ_REL_COMP: #{set1.inspect} (#{set1.class.name}), #{op}, #{set2.inspect} (#{set2.class.name})"
#puts "COMPARING VALUES"
# If one is nodeset and other is number, compare number to each item
# in nodeset s.t. number op number(string(item))
@@ -705,7 +705,7 @@ module REXML
# If one is nodeset and other is boolean, compare boolean to each item
# in nodeset s.t. boolean op boolean(item)
if set1.kind_of? Array or set2.kind_of? Array
- #puts "ISA ARRAY"
+ #puts "ISA ARRAY"
if set1.kind_of? Array
a = set1
b = set2
@@ -724,7 +724,7 @@ module REXML
#puts "B = #{b.inspect}"
return a.collect {|v| compare( Functions::number(v), op, b )}
else
- #puts "Functions::string( #{b}(#{b.class.name}) ) = #{Functions::string(b)}"
+ #puts "Functions::string( #{b}(#{b.class.name}) ) = #{Functions::string(b)}"
b = Functions::string( b )
return a.collect { |v| compare( Functions::string(v), op, b ) }
end
diff --git a/lib/rinda/.document b/lib/rinda/.document
deleted file mode 100644
index 598977af68..0000000000
--- a/lib/rinda/.document
+++ /dev/null
@@ -1,3 +0,0 @@
-rinda.rb
-ring.rb
-tuplespace.rb
diff --git a/lib/rinda/rinda.rb b/lib/rinda/rinda.rb
index 18e284a544..6c59e68654 100644
--- a/lib/rinda/rinda.rb
+++ b/lib/rinda/rinda.rb
@@ -58,7 +58,7 @@ module Rinda
##
# The number of elements in the tuple.
-
+
def size
@tuple.size
end
@@ -162,7 +162,7 @@ module Rinda
end
return true
end
-
+
##
# Alias for #match.
@@ -171,7 +171,7 @@ module Rinda
end
end
-
+
##
# <i>Documentation?</i>
@@ -184,7 +184,7 @@ module Rinda
@drb_uri = uri
@drb_ref = ref
end
-
+
##
# This DRbObjectTemplate matches +ro+ if the remote object's drburi and
# drbref are the same. +nil+ is used as a wildcard.
@@ -213,14 +213,14 @@ module Rinda
def initialize(ts)
@ts = ts
end
-
+
##
# Adds +tuple+ to the proxied TupleSpace. See TupleSpace#write.
def write(tuple, sec=nil)
@ts.write(tuple, sec)
end
-
+
##
# Takes +tuple+ from the proxied TupleSpace. See TupleSpace#take.
@@ -229,14 +229,14 @@ module Rinda
@ts.move(DRbObject.new(port), tuple, sec, &block)
port[0]
end
-
+
##
# Reads +tuple+ from the proxied TupleSpace. See TupleSpace#read.
def read(tuple, sec=nil, &block)
@ts.read(tuple, sec, &block)
end
-
+
##
# Reads all tuples matching +tuple+ from the proxied TupleSpace. See
# TupleSpace#read_all.
@@ -244,7 +244,7 @@ module Rinda
def read_all(tuple)
@ts.read_all(tuple)
end
-
+
##
# Registers for notifications of event +ev+ on the proxied TupleSpace.
# See TupleSpace#notify
diff --git a/lib/rinda/ring.rb b/lib/rinda/ring.rb
index b25fd99856..1fad92dbc7 100644
--- a/lib/rinda/ring.rb
+++ b/lib/rinda/ring.rb
@@ -49,7 +49,7 @@ module Rinda
end
end
end
-
+
##
# Extracts the response URI from +msg+ and adds it to TupleSpace where it
# will be picked up by +reply_service+ for notification.
@@ -74,13 +74,13 @@ module Rinda
end
end
end
-
+
##
# Pulls lookup tuples out of the TupleSpace and sends their DRb object the
# address of the local TupleSpace.
def do_reply
- tuple = @ts.take([:lookup_ring, DRbObject])
+ tuple = @ts.take([:lookup_ring, nil])
Thread.new { tuple[1].call(@ts) rescue nil}
rescue
end
@@ -104,7 +104,7 @@ module Rinda
# created RingFinger.
def self.finger
- unless @@finger
+ unless @@finger
@@finger = self.new
@@finger.lookup_ring_any
end
@@ -207,7 +207,7 @@ module Rinda
@rings.push(it)
end
end
-
+
@primary = queue.pop
raise('RingNotFound') if @primary.nil?
@primary
@@ -256,15 +256,15 @@ if __FILE__ == $0
$stdin.gets
when 'w'
finger = Rinda::RingFinger.new(nil)
- finger.lookup_ring do |ts2|
- p ts2
- ts2.write([:hello, :world])
+ finger.lookup_ring do |ts|
+ p ts
+ ts.write([:hello, :world])
end
when 'r'
finger = Rinda::RingFinger.new(nil)
- finger.lookup_ring do |ts2|
- p ts2
- p ts2.take([nil, nil])
+ finger.lookup_ring do |ts|
+ p ts
+ p ts.take([nil, nil])
end
end
end
diff --git a/lib/rinda/tuplespace.rb b/lib/rinda/tuplespace.rb
index 113aa0de15..b0409dde3b 100644
--- a/lib/rinda/tuplespace.rb
+++ b/lib/rinda/tuplespace.rb
@@ -73,14 +73,14 @@ module Rinda
end
##
- # Reset the expiry time according to +sec_or_renewer+.
+ # Reset the expiry time according to +sec_or_renewer+.
#
# +nil+:: it is set to expire in the far future.
# +false+:: it has expired.
# Numeric:: it will expire in that many seconds.
#
# Otherwise the argument refers to some kind of renewer object
- # which will reset its expiry time.
+ # which will reset its expiry time.
def renew(sec_or_renewer)
sec, @renewer = get_renewer(sec_or_renewer)
@@ -168,7 +168,7 @@ module Rinda
def match(tuple)
@tuple.match(tuple)
end
-
+
alias === match
def make_tuple(ary) # :nodoc:
@@ -224,11 +224,11 @@ module Rinda
#
# ts = Rinda::TupleSpace.new
# observer = ts.notify 'write', [nil]
- #
+ #
# Thread.start do
# observer.each { |t| p t }
# end
- #
+ #
# 3.times { |i| ts.write [i] }
#
# Outputs:
@@ -276,7 +276,7 @@ module Rinda
it = pop
yield(it)
end
- rescue
+ rescue
ensure
cancel
end
@@ -295,16 +295,16 @@ module Rinda
def initialize
@bin = []
end
-
+
def add(tuple)
@bin.push(tuple)
end
-
+
def delete(tuple)
idx = @bin.rindex(tuple)
@bin.delete_at(idx) if idx
end
-
+
def find(&blk)
@bin.reverse_each do |x|
return x if yield(x)
@@ -315,7 +315,7 @@ module Rinda
def initialize # :nodoc:
@hash = {}
- @enum = enum_for(:each_entry)
+ @enum = Enumerable::Enumerator.new(self, :each_entry)
end
##
diff --git a/lib/rss/0.9.rb b/lib/rss/0.9.rb
index 28ef768274..7b24e7596d 100644
--- a/lib/rss/0.9.rb
+++ b/lib/rss/0.9.rb
@@ -8,7 +8,7 @@ module RSS
def self.append_features(klass)
super
-
+
klass.install_must_call_validator('', "")
end
end
@@ -123,7 +123,7 @@ module RSS
def not_need_to_call_setup_maker_variables
%w(image textInput)
end
-
+
class SkipDays < Element
include RSS09
@@ -146,11 +146,11 @@ module RSS
self.content = args[0]
end
end
-
+
end
-
+
end
-
+
class SkipHours < Element
include RSS09
@@ -174,13 +174,13 @@ module RSS
end
end
end
-
+
end
-
+
class Image < Element
include RSS09
-
+
%w(url title link).each do |name|
install_text_element(name, "", nil)
end
@@ -239,9 +239,9 @@ module RSS
end
end
end
-
+
class Item < Element
-
+
include RSS09
[
@@ -269,7 +269,7 @@ module RSS
@enclosure.setup_maker(item) if @enclosure
@source.setup_maker(item) if @source
end
-
+
class Source < Element
include RSS09
@@ -279,7 +279,7 @@ module RSS
].each do |name, uri, required|
install_get_attribute(name, uri, required)
end
-
+
content_setup
def initialize(*args)
@@ -341,7 +341,7 @@ module RSS
class Category < Element
include RSS09
-
+
[
["domain", "", false]
].each do |name, uri, required|
@@ -369,11 +369,11 @@ module RSS
category.domain = domain
category.content = content
end
-
+
end
end
-
+
class TextInput < Element
include RSS09
@@ -399,9 +399,9 @@ module RSS
maker.textinput
end
end
-
+
end
-
+
end
RSS09::ELEMENTS.each do |name|
@@ -411,8 +411,8 @@ module RSS
module ListenerMixin
private
def initial_start_rss(tag_name, prefix, attrs, ns)
- check_ns(tag_name, prefix, ns, "", false)
-
+ check_ns(tag_name, prefix, ns, "")
+
@rss = Rss.new(attrs['version'], @version, @encoding, @standalone)
@rss.do_validate = @do_validate
@rss.xml_stylesheets = @xml_stylesheets
@@ -422,7 +422,7 @@ module RSS
end
@proc_stack.push(pr)
end
-
+
end
end
diff --git a/lib/rss/1.0.rb b/lib/rss/1.0.rb
index 2ff53b4723..f04e61c5eb 100644
--- a/lib/rss/1.0.rb
+++ b/lib/rss/1.0.rb
@@ -8,7 +8,7 @@ module RSS
def self.append_features(klass)
super
-
+
klass.install_must_call_validator('', ::RSS::URI)
end
@@ -64,13 +64,13 @@ module RSS
URI
end
end
-
+
[
["resource", [URI, ""], true]
].each do |name, uri, required|
install_get_attribute(name, uri, required)
end
-
+
def initialize(*args)
if Utils.element_initialize_arguments?(args)
super
@@ -98,10 +98,10 @@ module RSS
end
@tag_name = 'Seq'
-
+
install_have_children_element("li", URI, "*")
install_must_call_validator('rdf', ::RSS::RDF::URI)
-
+
def initialize(*args)
if Utils.element_initialize_arguments?(args)
super
@@ -114,7 +114,7 @@ module RSS
def full_name
tag_name_with_prefix(PREFIX)
end
-
+
def setup_maker(target)
lis.each do |li|
target << li.resource
@@ -135,10 +135,10 @@ module RSS
end
@tag_name = 'Bag'
-
+
install_have_children_element("li", URI, "*")
install_must_call_validator('rdf', URI)
-
+
def initialize(*args)
if Utils.element_initialize_arguments?(args)
super
@@ -151,7 +151,7 @@ module RSS
def full_name
tag_name_with_prefix(PREFIX)
end
-
+
def setup_maker(target)
lis.each do |li|
target << li.resource
@@ -162,7 +162,7 @@ module RSS
class Channel < Element
include RSS10
-
+
class << self
def required_uri
@@ -202,17 +202,17 @@ module RSS
def maker_target(maker)
maker.channel
end
-
+
def setup_maker_attributes(channel)
channel.about = about
end
class Image < Element
-
+
include RSS10
class << self
-
+
def required_uri
::RSS::URI
end
@@ -225,7 +225,7 @@ module RSS
install_get_attribute(name, uri, required, nil, nil,
"#{PREFIX}:#{name}")
end
-
+
def initialize(*args)
if Utils.element_initialize_arguments?(args)
super
@@ -237,11 +237,11 @@ module RSS
end
class Textinput < Element
-
+
include RSS10
class << self
-
+
def required_uri
::RSS::URI
end
@@ -254,7 +254,7 @@ module RSS
install_get_attribute(name, uri, required, nil, nil,
"#{PREFIX}:#{name}")
end
-
+
def initialize(*args)
if Utils.element_initialize_arguments?(args)
super
@@ -264,7 +264,7 @@ module RSS
end
end
end
-
+
class Items < Element
include RSS10
@@ -272,16 +272,16 @@ module RSS
Seq = ::RSS::RDF::Seq
class << self
-
+
def required_uri
::RSS::URI
end
-
+
end
install_have_child_element("Seq", URI, nil)
install_must_call_validator('rdf', URI)
-
+
def initialize(*args)
if Utils.element_initialize_arguments?(args)
super
@@ -309,7 +309,7 @@ module RSS
include RSS10
class << self
-
+
def required_uri
::RSS::URI
end
@@ -351,7 +351,7 @@ module RSS
def required_uri
::RSS::URI
end
-
+
end
@@ -436,7 +436,7 @@ module RSS
module ListenerMixin
private
def initial_start_RDF(tag_name, prefix, attrs, ns)
- check_ns(tag_name, prefix, ns, RDF::URI, false)
+ check_ns(tag_name, prefix, ns, RDF::URI)
@rss = RDF.new(@version, @encoding, @standalone)
@rss.do_validate = @do_validate
diff --git a/lib/rss/2.0.rb b/lib/rss/2.0.rb
index 9622c598d9..3798da4eb7 100644
--- a/lib/rss/2.0.rb
+++ b/lib/rss/2.0.rb
@@ -29,7 +29,7 @@ module RSS
Category = Item::Category
class Item
-
+
[
["comments", "?"],
["author", "?"],
@@ -57,9 +57,9 @@ module RSS
_setup_maker_element(item)
@guid.setup_maker(item) if @guid
end
-
+
class Guid < Element
-
+
include RSS09
[
diff --git a/lib/rss/atom.rb b/lib/rss/atom.rb
index ff8ff2249a..7cba934feb 100644
--- a/lib/rss/atom.rb
+++ b/lib/rss/atom.rb
@@ -1,3 +1,4 @@
+require 'base64'
require 'rss/parser'
module RSS
@@ -716,7 +717,7 @@ module RSS
module ListenerMixin
private
def initial_start_feed(tag_name, prefix, attrs, ns)
- check_ns(tag_name, prefix, ns, Atom::URI, false)
+ check_ns(tag_name, prefix, ns, Atom::URI)
@rss = Atom::Feed.new(@version, @encoding, @standalone)
@rss.do_validate = @do_validate
@@ -731,7 +732,7 @@ module RSS
end
def initial_start_entry(tag_name, prefix, attrs, ns)
- check_ns(tag_name, prefix, ns, Atom::URI, false)
+ check_ns(tag_name, prefix, ns, Atom::URI)
@rss = Atom::Entry.new(@version, @encoding, @standalone)
@rss.do_validate = @do_validate
diff --git a/lib/rss/content/1.0.rb b/lib/rss/content/1.0.rb
index e5dc857930..e7c0c19685 100644
--- a/lib/rss/content/1.0.rb
+++ b/lib/rss/content/1.0.rb
@@ -1,4 +1,5 @@
require 'rss/1.0'
+require 'rss/content'
module RSS
RDF.install_ns(CONTENT_PREFIX, CONTENT_URI)
diff --git a/lib/rss/content/2.0.rb b/lib/rss/content/2.0.rb
index 8491a99937..8671b5b1a6 100644
--- a/lib/rss/content/2.0.rb
+++ b/lib/rss/content/2.0.rb
@@ -1,4 +1,5 @@
require "rss/2.0"
+require "rss/content"
module RSS
Rss.install_ns(CONTENT_PREFIX, CONTENT_URI)
diff --git a/lib/rss/converter.rb b/lib/rss/converter.rb
index 3e79eba4fb..415a319188 100644
--- a/lib/rss/converter.rb
+++ b/lib/rss/converter.rb
@@ -3,14 +3,10 @@ require "rss/utils"
module RSS
class Converter
-
+
include Utils
def initialize(to_enc, from_enc=nil)
- if "".respond_to?(:encode)
- @to_encoding = to_enc
- return
- end
normalized_to_enc = to_enc.downcase.gsub(/-/, '_')
from_enc ||= 'utf-8'
normalized_from_enc = from_enc.downcase.gsub(/-/, '_')
@@ -27,11 +23,7 @@ module RSS
end
def convert(value)
- if value.is_a?(String) and value.respond_to?(:encode)
- value.encode(@to_encoding)
- else
- value
- end
+ value
end
def def_convert(depth=0)
@@ -63,11 +55,11 @@ module RSS
raise UnknownConversionMethodError.new(to_enc, from_enc)
end
end
-
+
def def_else_enc(to_enc, from_enc)
def_iconv_convert(to_enc, from_enc, 0)
end
-
+
def def_same_enc()
def_convert do |value|
value
@@ -101,40 +93,40 @@ module RSS
def def_to_euc_jp_from_utf_8
def_uconv_convert_if_can('u8toeuc', 'EUC-JP', 'UTF-8', '-We')
end
-
+
def def_to_utf_8_from_euc_jp
def_uconv_convert_if_can('euctou8', 'UTF-8', 'EUC-JP', '-Ew')
end
-
+
def def_to_shift_jis_from_utf_8
def_uconv_convert_if_can('u8tosjis', 'Shift_JIS', 'UTF-8', '-Ws')
end
-
+
def def_to_utf_8_from_shift_jis
def_uconv_convert_if_can('sjistou8', 'UTF-8', 'Shift_JIS', '-Sw')
end
-
+
def def_to_euc_jp_from_shift_jis
require "nkf"
def_convert do |value|
"NKF.nkf('-Se', #{value})"
end
end
-
+
def def_to_shift_jis_from_euc_jp
require "nkf"
def_convert do |value|
"NKF.nkf('-Es', #{value})"
end
end
-
+
def def_to_euc_jp_from_iso_2022_jp
require "nkf"
def_convert do |value|
"NKF.nkf('-Je', #{value})"
end
end
-
+
def def_to_iso_2022_jp_from_euc_jp
require "nkf"
def_convert do |value|
@@ -147,7 +139,7 @@ module RSS
"#{value}.unpack('C*').pack('U*')"
end
end
-
+
def def_to_iso_8859_1_from_utf_8
def_convert do |value|
<<-EOC
@@ -164,7 +156,7 @@ module RSS
EOC
end
end
-
+
end
-
+
end
diff --git a/lib/rss/dublincore.rb b/lib/rss/dublincore.rb
index 53a4ca70d6..7ba239f8f1 100644
--- a/lib/rss/dublincore.rb
+++ b/lib/rss/dublincore.rb
@@ -25,7 +25,7 @@ module RSS
def #{full_name}
@#{full_name}.first and @#{full_name}.first.value
end
-
+
def #{full_name}=(new_value)
@#{full_name}[0] = Utils.new_with_value_if_need(#{klass_name}, new_value)
end
@@ -50,7 +50,7 @@ module RSS
EOC
end
end
-
+
module DublinCoreModel
extend BaseModel
@@ -76,26 +76,26 @@ module RSS
DATE_ELEMENTS = {
"date" => "w3cdtf",
}
-
+
ELEMENT_NAME_INFOS = DublinCoreModel::TEXT_ELEMENTS.to_a
DublinCoreModel::DATE_ELEMENTS.each do |name, |
ELEMENT_NAME_INFOS << [name, nil]
end
-
+
ELEMENTS = TEXT_ELEMENTS.keys + DATE_ELEMENTS.keys
ELEMENTS.each do |name, plural_name|
module_eval(<<-EOC, *get_file_and_line_from_caller(0))
class DublinCore#{Utils.to_class_name(name)} < Element
include RSS10
-
+
content_setup
class << self
def required_prefix
DC_PREFIX
end
-
+
def required_uri
DC_URI
end
@@ -105,7 +105,7 @@ module RSS
alias_method(:value, :content)
alias_method(:value=, :content=)
-
+
def initialize(*args)
if Utils.element_initialize_arguments?(args)
super
@@ -114,7 +114,7 @@ module RSS
self.content = args[0]
end
end
-
+
def full_name
tag_name_with_prefix(DC_PREFIX)
end
diff --git a/lib/rss/dublincore/1.0.rb b/lib/rss/dublincore/1.0.rb
index efe2f5dad4..e193c6d2c2 100644
--- a/lib/rss/dublincore/1.0.rb
+++ b/lib/rss/dublincore/1.0.rb
@@ -1,4 +1,5 @@
require "rss/1.0"
+require "rss/dublincore"
module RSS
RDF.install_ns(DC_PREFIX, DC_URI)
diff --git a/lib/rss/dublincore/2.0.rb b/lib/rss/dublincore/2.0.rb
index a79c1e84a4..82ed1888c5 100644
--- a/lib/rss/dublincore/2.0.rb
+++ b/lib/rss/dublincore/2.0.rb
@@ -1,4 +1,5 @@
require "rss/2.0"
+require "rss/dublincore"
module RSS
Rss.install_ns(DC_PREFIX, DC_URI)
diff --git a/lib/rss/dublincore/atom.rb b/lib/rss/dublincore/atom.rb
index 8db9066bb8..e78df4821b 100644
--- a/lib/rss/dublincore/atom.rb
+++ b/lib/rss/dublincore/atom.rb
@@ -1,4 +1,5 @@
require "rss/atom"
+require "rss/dublincore"
module RSS
module Atom
diff --git a/lib/rss/image.rb b/lib/rss/image.rb
index e79e9f5e65..c4714aea12 100644
--- a/lib/rss/image.rb
+++ b/lib/rss/image.rb
@@ -15,7 +15,7 @@ module RSS
BaseListener.install_class_name(IMAGE_URI, name, "Image#{class_name}")
IMAGE_ELEMENTS << "#{IMAGE_PREFIX}_#{name}"
end
-
+
module ImageModelUtils
def validate_one_tag_name(ignore_unknown_element, name, tags)
if !ignore_unknown_element
@@ -25,7 +25,7 @@ module RSS
raise TooMuchTagError.new(name, tag_name) if tags.size > 1
end
end
-
+
module ImageItemModel
include ImageModelUtils
extend BaseModel
@@ -43,12 +43,12 @@ module RSS
include DublinCoreModel
@tag_name = "item"
-
+
class << self
def required_prefix
IMAGE_PREFIX
end
-
+
def required_uri
IMAGE_URI
end
@@ -102,11 +102,11 @@ module RSS
end
end
end
-
+
module ImageFaviconModel
include ImageModelUtils
extend BaseModel
-
+
def self.append_features(klass)
super
@@ -122,12 +122,12 @@ module RSS
include DublinCoreModel
@tag_name = "favicon"
-
+
class << self
def required_prefix
IMAGE_PREFIX
end
-
+
def required_uri
IMAGE_URI
end
@@ -154,7 +154,7 @@ module RSS
end
set_size(new_value)
end
-
+
alias image_size= size=
alias image_size size
diff --git a/lib/rss/maker.rb b/lib/rss/maker.rb
index a7ee200b32..bcba1aaff3 100644
--- a/lib/rss/maker.rb
+++ b/lib/rss/maker.rb
@@ -6,13 +6,13 @@ module RSS
class << self
def make(version, &block)
- self[version].make(&block)
+ m = maker(version)
+ raise UnsupportedMakerVersionError.new(version) if m.nil?
+ m[:maker].make(m[:version], &block)
end
- def [](version)
- maker_info = maker(version)
- raise UnsupportedMakerVersionError.new(version) if maker_info.nil?
- maker_info[:maker]
+ def maker(version)
+ MAKERS[version]
end
def add_maker(version, normalized_version, maker)
@@ -26,16 +26,6 @@ module RSS
def makers
MAKERS.values.collect {|info| info[:maker]}.uniq
end
-
- def supported?(version)
- versions.include?(version)
- end
-
- private
- # Can I remove this method?
- def maker(version)
- MAKERS[version]
- end
end
end
end
diff --git a/lib/rss/maker/0.9.rb b/lib/rss/maker/0.9.rb
index aede4d7c20..72b14dc977 100644
--- a/lib/rss/maker/0.9.rb
+++ b/lib/rss/maker/0.9.rb
@@ -4,14 +4,14 @@ require "rss/maker/base"
module RSS
module Maker
-
+
class RSS09 < RSSBase
-
- def initialize(feed_version)
+
+ def initialize(feed_version="0.92")
super
@feed_type = "rss"
end
-
+
private
def make_feed
Rss.new(@feed_version, @version, @encoding, @standalone)
@@ -38,20 +38,20 @@ module RSS
raise NotSetError.new("maker.channel", _not_set_required_variables)
end
end
-
+
private
def setup_items(rss)
@maker.items.to_feed(rss)
end
-
+
def setup_image(rss)
@maker.image.to_feed(rss)
end
-
+
def setup_textinput(rss)
@maker.textinput.to_feed(rss)
end
-
+
def variables
super + ["pubDate"]
end
@@ -78,7 +78,7 @@ module RSS
end
end
end
-
+
class Day < DayBase
def to_feed(rss, days)
day = Rss::Channel::SkipDays::Day.new
@@ -96,7 +96,7 @@ module RSS
end
end
end
-
+
class SkipHours < SkipHoursBase
def to_feed(rss, channel)
unless @hours.empty?
@@ -108,7 +108,7 @@ module RSS
end
end
end
-
+
class Hour < HourBase
def to_feed(rss, hours)
hour = Rss::Channel::SkipHours::Hour.new
@@ -126,7 +126,7 @@ module RSS
end
end
end
-
+
class Cloud < CloudBase
def to_feed(*args)
end
@@ -243,7 +243,7 @@ module RSS
true
end
end
-
+
class Items < ItemsBase
def to_feed(rss)
if rss.channel
@@ -253,7 +253,7 @@ module RSS
setup_other_elements(rss, rss.items)
end
end
-
+
class Item < ItemBase
def to_feed(rss)
item = Rss::Channel::Item.new
@@ -439,7 +439,7 @@ module RSS
end
end
end
-
+
class Textinput < TextinputBase
def to_feed(rss)
textInput = Rss::Channel::TextInput.new
@@ -457,52 +457,11 @@ module RSS
end
end
end
-
- class RSS091 < RSS09
- def initialize(feed_version="0.91")
- super
- end
-
- class Channel < RSS09::Channel
- end
-
- class Items < RSS09::Items
- class Item < RSS09::Items::Item
- end
- end
-
- class Image < RSS09::Image
- end
-
- class Textinput < RSS09::Textinput
- end
- end
-
- class RSS092 < RSS09
- def initialize(feed_version="0.92")
- super
- end
-
- class Channel < RSS09::Channel
- end
-
- class Items < RSS09::Items
- class Item < RSS09::Items::Item
- end
- end
-
- class Image < RSS09::Image
- end
-
- class Textinput < RSS09::Textinput
- end
- end
-
- add_maker("0.9", "0.92", RSS092)
- add_maker("0.91", "0.91", RSS091)
- add_maker("0.92", "0.92", RSS092)
- add_maker("rss0.9", "0.92", RSS092)
- add_maker("rss0.91", "0.91", RSS091)
- add_maker("rss0.92", "0.92", RSS092)
+
+ add_maker("0.9", "0.92", RSS09)
+ add_maker("0.91", "0.91", RSS09)
+ add_maker("0.92", "0.92", RSS09)
+ add_maker("rss0.91", "0.91", RSS09)
+ add_maker("rss0.92", "0.92", RSS09)
end
end
diff --git a/lib/rss/maker/1.0.rb b/lib/rss/maker/1.0.rb
index 0d8075f836..a1e2594f70 100644
--- a/lib/rss/maker/1.0.rb
+++ b/lib/rss/maker/1.0.rb
@@ -25,7 +25,6 @@ module RSS
end
class Channel < ChannelBase
- include SetupDefaultLanguage
def to_feed(rss)
set_default_values do
@@ -61,7 +60,7 @@ module RSS
rss.channel.items = items
set_parent(rss.channel, items)
end
-
+
def setup_image(rss)
if @maker.image.have_required_values?
image = RDF::Channel::Image.new(@maker.image.url)
@@ -92,11 +91,11 @@ module RSS
class SkipDays < SkipDaysBase
def to_feed(*args)
end
-
+
class Day < DayBase
end
end
-
+
class SkipHours < SkipHoursBase
def to_feed(*args)
end
@@ -104,7 +103,7 @@ module RSS
class Hour < HourBase
end
end
-
+
class Cloud < CloudBase
def to_feed(*args)
end
@@ -404,7 +403,7 @@ module RSS
end
end
end
-
+
class Textinput < TextinputBase
def to_feed(rss)
if @link
diff --git a/lib/rss/maker/2.0.rb b/lib/rss/maker/2.0.rb
index 15b1349c2a..67d68126ac 100644
--- a/lib/rss/maker/2.0.rb
+++ b/lib/rss/maker/2.0.rb
@@ -4,9 +4,9 @@ require "rss/maker/0.9"
module RSS
module Maker
-
+
class RSS20 < RSS09
-
+
def initialize(feed_version="2.0")
super
end
@@ -17,17 +17,17 @@ module RSS
def required_variable_names
%w(link)
end
-
+
class SkipDays < RSS09::Channel::SkipDays
class Day < RSS09::Channel::SkipDays::Day
end
end
-
+
class SkipHours < RSS09::Channel::SkipHours
class Hour < RSS09::Channel::SkipHours::Hour
end
end
-
+
class Cloud < RSS09::Channel::Cloud
def to_feed(rss, channel)
cloud = Rss::Channel::Cloud.new
@@ -51,7 +51,7 @@ module RSS
category.to_feed(rss, channel)
end
end
-
+
class Category < RSS09::Channel::Categories::Category
def to_feed(rss, channel)
category = Rss::Channel::Category.new
@@ -81,14 +81,14 @@ module RSS
end
end
end
-
+
class Image < RSS09::Image
private
def required_element?
false
end
end
-
+
class Items < RSS09::Items
class Item < RSS09::Items::Item
private
@@ -179,7 +179,7 @@ module RSS
category.to_feed(rss, item)
end
end
-
+
class Category < RSS09::Items::Item::Categories::Category
def to_feed(rss, item)
category = Rss::Channel::Item::Category.new
@@ -212,11 +212,11 @@ module RSS
end
end
end
-
+
class Textinput < RSS09::Textinput
end
end
-
+
add_maker("2.0", "2.0", RSS20)
add_maker("rss2.0", "2.0", RSS20)
end
diff --git a/lib/rss/maker/base.rb b/lib/rss/maker/base.rb
index 9ccfba7e84..56bf04657e 100644
--- a/lib/rss/maker/base.rb
+++ b/lib/rss/maker/base.rb
@@ -31,9 +31,7 @@ module RSS
self::OTHER_ELEMENTS << variable_name
end
- def add_need_initialize_variable(variable_name, init_value=nil,
- &init_block)
- init_value ||= init_block
+ def add_need_initialize_variable(variable_name, init_value="nil")
self::NEED_INITIALIZE_VARIABLES << [variable_name, init_value]
end
@@ -47,7 +45,7 @@ module RSS
def_delegators("@#{plural}", :push, :pop, :shift, :unshift)
def_delegators("@#{plural}", :each, :size, :empty?, :clear)
- add_need_initialize_variable(plural) {[]}
+ add_need_initialize_variable(plural, "[]")
module_eval(<<-EOC, __FILE__, __LINE__ + 1)
def new_#{name}
@@ -76,9 +74,7 @@ module RSS
def def_classed_element_without_accessor(name, class_name=nil)
class_name ||= Utils.to_class_name(name)
add_other_element(name)
- add_need_initialize_variable(name) do |object|
- object.send("make_#{name}")
- end
+ add_need_initialize_variable(name, "make_#{name}")
module_eval(<<-EOC, __FILE__, __LINE__ + 1)
private
def setup_#{name}(feed, current)
@@ -189,19 +185,7 @@ module RSS
private
def initialize_variables
self.class.need_initialize_variables.each do |variable_name, init_value|
- if init_value.nil?
- value = nil
- else
- if init_value.respond_to?(:call)
- value = init_value.call(self)
- elsif init_value.is_a?(String)
- # just for backward compatibility
- value = instance_eval(init_value, __FILE__, __LINE__)
- else
- value = init_value
- end
- end
- instance_variable_set("@#{variable_name}", value)
+ instance_eval("@#{variable_name} = #{init_value}", __FILE__, __LINE__)
end
end
@@ -254,8 +238,7 @@ module RSS
def variables
self.class.need_initialize_variables.find_all do |name, init|
- # init == "nil" is just for backward compatibility
- init.nil? or init == "nil"
+ "nil" == init
end.collect do |name, init|
name
end
@@ -372,38 +355,17 @@ module RSS
end
end
- module SetupDefaultLanguage
- private
- def _set_default_values(&block)
- keep = {
- :dc_languages => dc_languages.to_a.dup,
- }
- _language = language
- if _language and
- !dc_languages.any? {|dc_language| dc_language.value == _language}
- dc_language = self.class::DublinCoreLanguages::DublinCoreLanguage.new(self)
- dc_language.value = _language.dup
- dc_languages.unshift(dc_language)
- end
- super(&block)
- ensure
- dc_languages.replace(keep[:dc_languages])
- end
- end
-
class RSSBase < Base
class << self
- def make(*args, &block)
- new(*args).make(&block)
+ def make(version, &block)
+ new(version).make(&block)
end
end
%w(xml_stylesheets channel image items textinput).each do |element|
attr_reader element
- add_need_initialize_variable(element) do |object|
- object.send("make_#{element}")
- end
- module_eval(<<-EOC, __FILE__, __LINE__ + 1)
+ add_need_initialize_variable(element, "make_#{element}")
+ module_eval(<<-EOC, __FILE__, __LINE__)
private
def setup_#{element}(feed)
@#{element}.to_feed(feed)
@@ -414,7 +376,7 @@ module RSS
end
EOC
end
-
+
attr_reader :feed_version
alias_method(:rss_version, :feed_version)
attr_accessor :version, :encoding, :standalone
@@ -428,10 +390,14 @@ module RSS
@encoding = "UTF-8"
@standalone = nil
end
-
+
def make
- yield(self)
- to_feed
+ if block_given?
+ yield(self)
+ to_feed
+ else
+ nil
+ end
end
def to_feed
@@ -439,10 +405,13 @@ module RSS
setup_xml_stylesheets(feed)
setup_elements(feed)
setup_other_elements(feed)
- feed.validate
- feed
+ if feed.valid?
+ feed
+ else
+ nil
+ end
end
-
+
private
remove_method :make_xml_stylesheets
def make_xml_stylesheets
@@ -459,7 +428,7 @@ module RSS
attr_accessor attribute
add_need_initialize_variable(attribute)
end
-
+
def to_feed(feed)
xss = ::RSS::XMLStyleSheet.new
guess_type_if_need(xss)
@@ -482,7 +451,7 @@ module RSS
end
end
end
-
+
class ChannelBase < Base
include SetupDefaultDate
@@ -557,7 +526,7 @@ module RSS
end
end
end
-
+
class SkipHoursBase < Base
def_array_element("hour")
@@ -568,7 +537,7 @@ module RSS
end
end
end
-
+
class CloudBase < Base
%w(domain port path registerProcedure protocol).each do |element|
attr_accessor element
@@ -638,7 +607,7 @@ module RSS
include AtomTextConstructBase
end
end
-
+
class ImageBase < Base
%w(title url width height description).each do |element|
attr_accessor element
@@ -649,18 +618,18 @@ module RSS
@maker.channel.link
end
end
-
+
class ItemsBase < Base
def_array_element("item")
attr_accessor :do_sort, :max_size
-
+
def initialize(maker)
super
@do_sort = false
@max_size = -1
end
-
+
def normalize
if @max_size >= 0
sort_if_need[0...@max_size]
@@ -746,14 +715,6 @@ module RSS
attr_accessor element
add_need_initialize_variable(element)
end
-
- def permanent_link?
- isPermaLink
- end
-
- def permanent_link=(bool)
- self.isPermaLink = bool
- end
end
class EnclosureBase < Base
diff --git a/lib/rss/maker/dublincore.rb b/lib/rss/maker/dublincore.rb
index 9069c27d06..ff4813fe19 100644
--- a/lib/rss/maker/dublincore.rb
+++ b/lib/rss/maker/dublincore.rb
@@ -90,7 +90,7 @@ EOC
class ChannelBase
include DublinCoreModel
end
-
+
class ImageBase; include DublinCoreModel; end
class ItemsBase
class ItemBase
diff --git a/lib/rss/maker/entry.rb b/lib/rss/maker/entry.rb
index b35936b208..edaa31ec06 100644
--- a/lib/rss/maker/entry.rb
+++ b/lib/rss/maker/entry.rb
@@ -135,7 +135,7 @@ module RSS
self.id = keep[:id]
@rights = keep[:rights]
@title = keep[:title]
- self.updated = keep[:updated]
+ self.updated = keep[:prev_updated]
end
Guid = Feed::Items::Item::Guid
diff --git a/lib/rss/maker/feed.rb b/lib/rss/maker/feed.rb
index 0129218b0c..3a30ad4287 100644
--- a/lib/rss/maker/feed.rb
+++ b/lib/rss/maker/feed.rb
@@ -22,8 +22,6 @@ module RSS
end
class Channel < ChannelBase
- include SetupDefaultLanguage
-
def to_feed(feed)
set_default_values do
setup_values(feed)
@@ -73,11 +71,14 @@ module RSS
def _set_default_values(&block)
keep = {
:id => id,
+ :updated => updated,
}
self.id ||= about
+ self.updated ||= dc_date
super(&block)
ensure
self.id = keep[:id]
+ self.updated = keep[:updated]
end
class SkipDays < SkipDaysBase
@@ -181,7 +182,6 @@ module RSS
set_default_values do
entry = feed.class::Entry.new
set = setup_values(entry)
- entry.dc_dates.clear
setup_other_elements(feed, entry)
if set
feed.entries << entry
@@ -216,11 +216,14 @@ module RSS
def _set_default_values(&block)
keep = {
:id => id,
+ :updated => updated,
}
self.id ||= link
+ self.updated ||= dc_date
super(&block)
ensure
self.id = keep[:id]
+ self.updated = keep[:updated]
end
class Guid < GuidBase
diff --git a/lib/rss/maker/image.rb b/lib/rss/maker/image.rb
index e2b36e0a08..b95cf4c714 100644
--- a/lib/rss/maker/image.rb
+++ b/lib/rss/maker/image.rb
@@ -89,7 +89,7 @@ EOC
end
class ChannelBase; include Maker::ImageFaviconModel; end
-
+
class ItemsBase
class ItemBase; include Maker::ImageItemModel; end
end
diff --git a/lib/rss/maker/itunes.rb b/lib/rss/maker/itunes.rb
index 8b7420da3c..7c5049129d 100644
--- a/lib/rss/maker/itunes.rb
+++ b/lib/rss/maker/itunes.rb
@@ -176,7 +176,7 @@ module RSS
%w(hour minute second).each do |name|
attr_reader(name)
- add_need_initialize_variable(name, 0)
+ add_need_initialize_variable(name, '0')
end
def content=(content)
diff --git a/lib/rss/maker/taxonomy.rb b/lib/rss/maker/taxonomy.rb
index 13ae9aa805..211603840f 100644
--- a/lib/rss/maker/taxonomy.rb
+++ b/lib/rss/maker/taxonomy.rb
@@ -72,12 +72,12 @@ EOC
class TaxonomyTopicBase < Base
include DublinCoreModel
include TaxonomyTopicsModel
-
+
attr_accessor :value
add_need_initialize_variable("value")
alias_method(:taxo_link, :value)
alias_method(:taxo_link=, :value=)
-
+
def have_required_values?
@value
end
@@ -88,11 +88,11 @@ EOC
class RSSBase
include TaxonomyTopicModel
end
-
+
class ChannelBase
include TaxonomyTopicsModel
end
-
+
class ItemsBase
class ItemBase
include TaxonomyTopicsModel
diff --git a/lib/rss/maker/trackback.rb b/lib/rss/maker/trackback.rb
index 00f001cb85..278fe53ebe 100644
--- a/lib/rss/maker/trackback.rb
+++ b/lib/rss/maker/trackback.rb
@@ -19,7 +19,7 @@ module RSS
class TrackBackAboutBase < Base
attr_accessor :value
add_need_initialize_variable("value")
-
+
alias_method(:resource, :value)
alias_method(:resource=, :value=)
alias_method(:content, :value)
diff --git a/lib/rss/parser.rb b/lib/rss/parser.rb
index 1a9e71ea57..9e4919223c 100644
--- a/lib/rss/parser.rb
+++ b/lib/rss/parser.rb
@@ -34,8 +34,8 @@ module RSS
class NotValidXMLParser < Error
def initialize(parser)
super("#{parser} is not an available XML parser. " <<
- "Available XML parser" <<
- (AVAILABLE_PARSERS.size > 1 ? "s are " : " is ") <<
+ "Available XML parser"<<
+ (AVAILABLE_PARSERS.size > 1 ? "s are ": " is ") <<
"#{AVAILABLE_PARSERS.inspect}.")
end
end
@@ -98,7 +98,7 @@ module RSS
return rss if maybe_xml?(rss)
uri = to_uri(rss)
-
+
if uri.respond_to?(:read)
uri.read
elsif !rss.tainted? and File.readable?(rss)
@@ -113,7 +113,7 @@ module RSS
source.is_a?(String) and /</ =~ source
end
- # Attempt to convert rss to a URI, but just return it if
+ # Attempt to convert rss to a URI, but just return it if
# there's a ::URI::Error
def to_uri(rss)
return rss if rss.is_a?(::URI::Generic)
@@ -133,7 +133,7 @@ module RSS
listener.raise_for_undefined_entity?
end
end
-
+
def initialize(rss)
@listener = self.class.listener.new
@rss = rss
@@ -196,13 +196,13 @@ module RSS
def available_tags(uri)
(@@accessor_bases[uri] || {}).keys
end
-
+
# register uri against this name.
def register_uri(uri, name)
@@registered_uris[name] ||= {}
@@registered_uris[name][uri] = nil
end
-
+
# test if this uri is registered against this name
def uri_registered?(uri, name)
@@registered_uris[name].has_key?(uri)
@@ -220,7 +220,9 @@ module RSS
name = (@@class_names[uri] || {})[tag_name]
return name if name
- tag_name = tag_name.gsub(/[_\-]([a-z]?)/) {$1.upcase}
+ tag_name = tag_name.gsub(/[_\-]([a-z]?)/) do
+ $1.upcase
+ end
tag_name[0, 1].upcase + tag_name[1..-1]
end
@@ -228,11 +230,11 @@ module RSS
install_accessor_base(uri, name, accessor_base)
def_get_text_element(uri, name, *get_file_and_line_from_caller(1))
end
-
+
def raise_for_undefined_entity?
true
end
-
+
private
# set the accessor for the uri, tag_name pair
def install_accessor_base(uri, tag_name, accessor_base)
@@ -279,7 +281,7 @@ module RSS
@xml_element = nil
@last_xml_element = nil
end
-
+
# set instance vars for version, encoding, standalone
def xmldecl(version, encoding, standalone)
@version, @encoding, @standalone = version, encoding, standalone
@@ -387,12 +389,14 @@ module RSS
def start_else_element(local, prefix, attrs, ns)
class_name = self.class.class_name(_ns(ns, prefix), local)
current_class = @last_element.class
- if known_class?(current_class, class_name)
+ if class_name and
+ (current_class.const_defined?(class_name) or
+ current_class.constants.include?(class_name))
next_class = current_class.const_get(class_name)
start_have_something_element(local, prefix, attrs, ns, next_class)
else
if !@do_validate or @ignore_unknown_element
- @proc_stack.push(setup_next_element_in_unknown_element)
+ @proc_stack.push(nil)
else
parent = "ROOT ELEMENT???"
if current_class.tag_name
@@ -403,42 +407,19 @@ module RSS
end
end
- if Module.method(:const_defined?).arity == -1
- def known_class?(target_class, class_name)
- class_name and
- (target_class.const_defined?(class_name, false) or
- target_class.constants.include?(class_name.to_sym))
- end
- else
- def known_class?(target_class, class_name)
- class_name and
- (target_class.const_defined?(class_name) or
- target_class.constants.include?(class_name))
- end
- end
-
NAMESPLIT = /^(?:([\w:][-\w\d.]*):)?([\w:][-\w\d.]*)/
def split_name(name)
name =~ NAMESPLIT
[$1 || '', $2]
end
- def check_ns(tag_name, prefix, ns, require_uri, ignore_unknown_element=nil)
- if _ns(ns, prefix) == require_uri
- true
- else
- if ignore_unknown_element.nil?
- ignore_unknown_element = @ignore_unknown_element
- end
-
- if ignore_unknown_element
- false
- elsif @do_validate
+ def check_ns(tag_name, prefix, ns, require_uri)
+ unless _ns(ns, prefix) == require_uri
+ if @do_validate
raise NSError.new(tag_name, prefix, require_uri)
else
# Force bind required URI with prefix
@ns_stack.last[prefix] = require_uri
- true
end
end
end
@@ -446,7 +427,7 @@ module RSS
def start_get_text_element(tag_name, prefix, ns, required_uri)
pr = Proc.new do |text, tags|
setter = self.class.setter(required_uri, tag_name)
- if setter and @last_element.respond_to?(setter)
+ if @last_element.respond_to?(setter)
if @do_validate
getter = self.class.getter(required_uri, tag_name)
if @last_element.__send__(getter)
@@ -465,12 +446,9 @@ module RSS
end
def start_have_something_element(tag_name, prefix, attrs, ns, klass)
- if check_ns(tag_name, prefix, ns, klass.required_uri)
- attributes = collect_attributes(tag_name, prefix, attrs, ns, klass)
- @proc_stack.push(setup_next_element(tag_name, klass, attributes))
- else
- @proc_stack.push(setup_next_element_in_unknown_element)
- end
+ check_ns(tag_name, prefix, ns, klass.required_uri)
+ attributes = collect_attributes(tag_name, prefix, attrs, ns, klass)
+ @proc_stack.push(setup_next_element(tag_name, klass, attributes))
end
def collect_attributes(tag_name, prefix, attrs, ns, klass)
@@ -526,7 +504,7 @@ module RSS
else
if klass.have_content?
if @last_element.need_base64_encode?
- text = text.lstrip.unpack("m").first
+ text = Base64.decode64(text.lstrip)
end
@last_element.content = text
end
@@ -537,11 +515,6 @@ module RSS
@last_element = previous
end
end
-
- def setup_next_element_in_unknown_element
- current_element, @last_element = @last_element, nil
- Proc.new {@last_element = current_element}
- end
end
unless const_defined? :AVAILABLE_PARSER_LIBRARIES
diff --git a/lib/rss/rexmlparser.rb b/lib/rss/rexmlparser.rb
index 7112ac3669..4dabf59199 100644
--- a/lib/rss/rexmlparser.rb
+++ b/lib/rss/rexmlparser.rb
@@ -7,7 +7,7 @@ if ([$1.to_i, $2.to_i] <=> [2, 5]) < 0
end
module RSS
-
+
class REXMLParser < BaseParser
class << self
@@ -15,7 +15,7 @@ module RSS
REXMLListener
end
end
-
+
private
def _parse
begin
@@ -28,9 +28,9 @@ module RSS
raise NotWellFormedError.new(line){e.message}
end
end
-
+
end
-
+
class REXMLListener < BaseListener
include REXML::StreamListener
@@ -41,7 +41,7 @@ module RSS
false
end
end
-
+
def xmldecl(version, encoding, standalone)
super(version, encoding, standalone == "yes")
# Encoding is converted to UTF-8 when REXML parse XML.
diff --git a/lib/rss/rss.rb b/lib/rss/rss.rb
index 6f008049ca..5aa4a2cedd 100644
--- a/lib/rss/rss.rb
+++ b/lib/rss/rss.rb
@@ -45,7 +45,6 @@ class Time
end
end
-
require "English"
require "rss/utils"
require "rss/converter"
@@ -53,7 +52,7 @@ require "rss/xml-stylesheet"
module RSS
- VERSION = "0.2.7"
+ VERSION = "0.2.4"
URI = "http://purl.org/rss/1.0/"
@@ -249,7 +248,7 @@ EOC
# accessor
convert_attr_reader name
date_writer(name, type, disp_name)
-
+
install_element(name) do |n, elem_name|
<<-EOC
if @#{n}
@@ -634,7 +633,7 @@ EOC
include SetupMaker
INDENT = " "
-
+
MUST_CALL_VALIDATORS = {}
MODELS = []
GET_ATTRIBUTES = []
@@ -830,7 +829,7 @@ EOC
def full_name
tag_name
end
-
+
def converter=(converter)
@converter = converter
targets = children.dup
@@ -865,7 +864,7 @@ EOC
ensure
@do_validate = do_validate
end
-
+
def validate_for_stream(tags, ignore_unknown_element=true)
validate_attribute
__validate(ignore_unknown_element, tags, false)
@@ -985,7 +984,7 @@ EOC
end_tag = "\n#{indent}</#{full_name}>"
end
end
-
+
start_tag + content.join("\n") + end_tag
end
@@ -1010,7 +1009,7 @@ EOC
end
attrs
end
-
+
def tag_name_with_prefix(prefix)
"#{prefix}:#{tag_name}"
end
@@ -1201,7 +1200,7 @@ EOC
__send__(self.class.xml_getter).to_s
else
_content = content
- _content = [_content].pack("m").delete("\n") if need_base64_encode?
+ _content = Base64.encode64(_content) if need_base64_encode?
h(_content)
end
end
@@ -1210,7 +1209,7 @@ EOC
module RootElementMixin
include XMLStyleSheetMixin
-
+
attr_reader :output_encoding
attr_reader :feed_type, :feed_subtype, :feed_version
attr_accessor :version, :encoding, :standalone
@@ -1296,7 +1295,7 @@ EOC
rv << "?>\n"
rv
end
-
+
def ns_declarations
decls = {}
self.class::NSPOOL.collect do |prefix, uri|
diff --git a/lib/rss/syndication.rb b/lib/rss/syndication.rb
index c375645dd6..3eb15429f6 100644
--- a/lib/rss/syndication.rb
+++ b/lib/rss/syndication.rb
@@ -8,11 +8,11 @@ module RSS
RDF.install_ns(SY_PREFIX, SY_URI)
module SyndicationModel
-
+
extend BaseModel
-
+
ELEMENTS = []
-
+
def self.append_features(klass)
super
diff --git a/lib/rss/taxonomy.rb b/lib/rss/taxonomy.rb
index b82e55dacc..276f63b05d 100644
--- a/lib/rss/taxonomy.rb
+++ b/lib/rss/taxonomy.rb
@@ -24,7 +24,7 @@ module RSS
module TaxonomyTopicsModel
extend BaseModel
-
+
def self.append_features(klass)
super
@@ -37,21 +37,21 @@ module RSS
class TaxonomyTopics < Element
include RSS10
-
+
Bag = ::RSS::RDF::Bag
class << self
def required_prefix
TAXO_PREFIX
end
-
+
def required_uri
TAXO_URI
end
end
@tag_name = "topics"
-
+
install_have_child_element("Bag", RDF::URI, nil)
install_must_call_validator('rdf', RDF::URI)
@@ -84,10 +84,10 @@ module RSS
end
end
end
-
+
module TaxonomyTopicModel
extend BaseModel
-
+
def self.append_features(klass)
super
var_name = "#{TAXO_PREFIX}_topic"
@@ -99,12 +99,12 @@ module RSS
include DublinCoreModel
include TaxonomyTopicsModel
-
+
class << self
def required_prefix
TAXO_PREFIX
end
-
+
def required_uri
TAXO_URI
end
@@ -115,7 +115,7 @@ module RSS
install_get_attribute("about", ::RSS::RDF::URI, true, nil, nil,
"#{RDF::PREFIX}:about")
install_text_element("link", TAXO_URI, "?", "#{TAXO_PREFIX}_link")
-
+
def initialize(*args)
if Utils.element_initialize_arguments?(args)
super
diff --git a/lib/rss/trackback.rb b/lib/rss/trackback.rb
index 59fedb5f3e..ee2491f332 100644
--- a/lib/rss/trackback.rb
+++ b/lib/rss/trackback.rb
@@ -23,7 +23,7 @@ module RSS
module BaseTrackBackModel
ELEMENTS = %w(ping about)
-
+
def append_features(klass)
super
@@ -47,7 +47,7 @@ module RSS
end
EOC
end
-
+
[%w(about s)].each do |name, postfix|
var_name = "#{TRACKBACK_PREFIX}_#{name}"
klass_name = "TrackBack#{Utils.to_class_name(name)}"
@@ -105,7 +105,7 @@ module RSS
def required_prefix
TRACKBACK_PREFIX
end
-
+
def required_uri
TRACKBACK_URI
end
@@ -141,17 +141,17 @@ module RSS
include RSS10
class << self
-
+
def required_prefix
TRACKBACK_PREFIX
end
-
+
def required_uri
TRACKBACK_URI
end
end
-
+
@tag_name = "about"
[
@@ -163,7 +163,7 @@ module RSS
alias_method(:value, :resource)
alias_method(:value=, :resource=)
-
+
def initialize(*args)
if Utils.element_initialize_arguments?(args)
super
@@ -185,7 +185,7 @@ module RSS
def setup_maker_attributes(about)
about.resource = self.resource
end
-
+
end
end
@@ -197,7 +197,7 @@ module RSS
include RSS09
@tag_name = "ping"
-
+
content_setup
class << self
@@ -205,13 +205,13 @@ module RSS
def required_prefix
TRACKBACK_PREFIX
end
-
+
def required_uri
TRACKBACK_URI
end
end
-
+
alias_method(:value, :content)
alias_method(:value=, :content=)
@@ -223,26 +223,26 @@ module RSS
self.content = args[0]
end
end
-
+
def full_name
tag_name_with_prefix(TRACKBACK_PREFIX)
end
-
+
end
class TrackBackAbout < Element
include RSS09
@tag_name = "about"
-
+
content_setup
class << self
-
+
def required_prefix
TRACKBACK_PREFIX
end
-
+
def required_uri
TRACKBACK_URI
end
@@ -260,11 +260,11 @@ module RSS
self.content = args[0]
end
end
-
+
def full_name
tag_name_with_prefix(TRACKBACK_PREFIX)
end
-
+
end
end
diff --git a/lib/rss/utils.rb b/lib/rss/utils.rb
index 75b05d45c7..0e4001e1f3 100644
--- a/lib/rss/utils.rb
+++ b/lib/rss/utils.rb
@@ -8,7 +8,7 @@ module RSS
"#{part[0, 1].upcase}#{part[1..-1]}"
end.join("")
end
-
+
def get_file_and_line_from_caller(i=0)
file, line, = caller[i].split(':')
line = line.to_i
@@ -21,7 +21,7 @@ module RSS
s.to_s.gsub(/&/, "&amp;").gsub(/\"/, "&quot;").gsub(/>/, "&gt;").gsub(/</, "&lt;")
end
alias h html_escape
-
+
# If +value+ is an instance of class +klass+, return it, else
# create a new instance of +klass+ with value +value+.
def new_with_value_if_need(klass, value)
diff --git a/lib/rss/xml-stylesheet.rb b/lib/rss/xml-stylesheet.rb
index 96ee95050e..559d6bcd56 100644
--- a/lib/rss/xml-stylesheet.rb
+++ b/lib/rss/xml-stylesheet.rb
@@ -8,7 +8,7 @@ module RSS
super
@xml_stylesheets = []
end
-
+
private
def xml_stylesheet_pi
xsss = @xml_stylesheets.collect do |xss|
@@ -94,7 +94,7 @@ module RSS
xss.__send__("#{attr}=", __send__(attr))
end
end
-
+
private
def guess_type(filename)
/\.([^.]+)$/ =~ filename
diff --git a/lib/rss/xmlparser.rb b/lib/rss/xmlparser.rb
index aa902be396..3dfe7d461a 100644
--- a/lib/rss/xmlparser.rb
+++ b/lib/rss/xmlparser.rb
@@ -26,9 +26,9 @@ module XML
end
module RSS
-
+
class REXMLLikeXMLParser < ::XML::Parser
-
+
include ::XML::Encoding_ja
def listener=(listener)
@@ -38,7 +38,7 @@ module RSS
def startElement(name, attrs)
@listener.tag_start(name, attrs)
end
-
+
def endElement(name)
@listener.tag_end(name)
end
@@ -64,7 +64,7 @@ module RSS
XMLParserListener
end
end
-
+
private
def _parse
begin
@@ -75,13 +75,13 @@ module RSS
raise NotWellFormedError.new(parser.line){e.message}
end
end
-
+
end
-
+
class XMLParserListener < BaseListener
include ListenerMixin
-
+
def xmldecl(version, encoding, standalone)
super
# Encoding is converted to UTF-8 when XMLParser parses XML.
diff --git a/lib/rss/xmlscanner.rb b/lib/rss/xmlscanner.rb
index 1cdf81c0c3..61b9fa6bf4 100644
--- a/lib/rss/xmlscanner.rb
+++ b/lib/rss/xmlscanner.rb
@@ -2,15 +2,15 @@ require 'xmlscan/scanner'
require 'stringio'
module RSS
-
+
class XMLScanParser < BaseParser
-
+
class << self
def listener
XMLScanListener
end
end
-
+
private
def _parse
begin
@@ -26,11 +26,11 @@ module RSS
raise NotWellFormedError.new(lineno){e.message}
end
end
-
+
end
class XMLScanListener < BaseListener
-
+
include XMLScan::Visitor
include ListenerMixin
diff --git a/lib/rubygems.rb b/lib/rubygems.rb
deleted file mode 100644
index 8e6d8c9636..0000000000
--- a/lib/rubygems.rb
+++ /dev/null
@@ -1,1121 +0,0 @@
-# -*- ruby -*-
-#--
-# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
-# All rights reserved.
-# See LICENSE.txt for permissions.
-#++
-
-require 'rubygems/rubygems_version'
-require 'rubygems/defaults'
-require 'thread'
-require 'etc'
-
-module Gem
-
- ##
- # Raised when RubyGems is unable to load or activate a gem. Contains the
- # name and version requirements of the gem that either conflicts with
- # already activated gems or that RubyGems is otherwise unable to activate.
-
- class LoadError < ::LoadError
-
- ##
- # Name of gem
-
- attr_accessor :name
-
- ##
- # Version requirement of gem
-
- attr_accessor :version_requirement
-
- end
-
-end
-
-module Kernel
-
- ##
- # Use Kernel#gem to activate a specific version of +gem_name+.
- #
- # +version_requirements+ is a list of version requirements that the
- # specified gem must match, most commonly "= example.version.number". See
- # Gem::Requirement for how to specify a version requirement.
- #
- # If you will be activating the latest version of a gem, there is no need to
- # call Kernel#gem, Kernel#require will do the right thing for you.
- #
- # Kernel#gem returns true if the gem was activated, otherwise false. If the
- # gem could not be found, didn't match the version requirements, or a
- # different version was already activated, an exception will be raised.
- #
- # Kernel#gem should be called *before* any require statements (otherwise
- # RubyGems may load a conflicting library version).
- #
- # In older RubyGems versions, the environment variable GEM_SKIP could be
- # used to skip activation of specified gems, for example to test out changes
- # that haven't been installed yet. Now RubyGems defers to -I and the
- # RUBYLIB environment variable to skip activation of a gem.
- #
- # Example:
- #
- # GEM_SKIP=libA:libB ruby -I../libA -I../libB ./mycode.rb
-
- def gem(gem_name, *version_requirements) # :doc:
- skip_list = (ENV['GEM_SKIP'] || "").split(/:/)
- raise Gem::LoadError, "skipping #{gem_name}" if skip_list.include? gem_name
- Gem.activate(gem_name, *version_requirements)
- end
-
- private :gem
-
-end
-
-##
-# RubyGems is the Ruby standard for publishing and managing third party
-# libraries.
-#
-# For user documentation, see:
-#
-# * <tt>gem help</tt> and <tt>gem help [command]</tt>
-# * {RubyGems User Guide}[http://docs.rubygems.org/read/book/1]
-# * {Frequently Asked Questions}[http://docs.rubygems.org/read/book/3]
-#
-# For gem developer documentation see:
-#
-# * {Creating Gems}[http://docs.rubygems.org/read/chapter/5]
-# * Gem::Specification
-#
-# Further RubyGems documentation can be found at:
-#
-# * {RubyGems API}[http://rubygems.rubyforge.org/rdoc] (also available from
-# <tt>gem server</tt>)
-# * {RubyGems Bookshelf}[http://rubygem.org]
-#
-# == RubyGems Plugins
-#
-# As of RubyGems 1.3.2, RubyGems will load plugins installed in gems or
-# $LOAD_PATH. Plugins must be named 'rubygems_plugin' are discovered via
-# Gem::find_files then loaded. Take care when implementing a plugin as your
-# plugin file may be loaded multiple times if multiple versions of your gem
-# are installed.
-#
-# For an example plugin, see the graph gem which adds a `gem graph` command.
-#
-# == RubyGems Defaults, Packaging
-#
-# RubyGems defaults are stored in rubygems/defaults.rb. If you're packaging
-# RubyGems or implementing Ruby you can change RubyGems' defaults.
-#
-# For RubyGems packagers, provide lib/rubygems/operating_system.rb and
-# override any defaults from lib/rubygems/defaults.rb.
-#
-# For Ruby implementers, provide lib/rubygems/#{RUBY_ENGINE}.rb and override
-# any defaults from lib/rubygems/defaults.rb.
-#
-# If you need RubyGems to perform extra work on install or uninstall, your
-# defaults override file can set pre and post install and uninstall hooks.
-# See Gem::pre_install, Gem::pre_uninstall, Gem::post_install,
-# Gem::post_uninstall.
-#
-# == Bugs
-#
-# You can submit bugs to the
-# {RubyGems bug tracker}[http://rubyforge.org/tracker/?atid=575&group_id=126&func=browse]
-# on RubyForge
-#
-# == Credits
-#
-# RubyGems is currently maintained by Eric Hodel.
-#
-# RubyGems was originally developed at RubyConf 2003 by:
-#
-# * Rich Kilmer -- rich(at)infoether.com
-# * Chad Fowler -- chad(at)chadfowler.com
-# * David Black -- dblack(at)wobblini.net
-# * Paul Brannan -- paul(at)atdesk.com
-# * Jim Weirch -- {jim(at)weirichhouse.org}[mailto:jim@weirichhouse.org]
-#
-# Contributors:
-#
-# * Gavin Sinclair -- gsinclair(at)soyabean.com.au
-# * George Marrows -- george.marrows(at)ntlworld.com
-# * Dick Davies -- rasputnik(at)hellooperator.net
-# * Mauricio Fernandez -- batsman.geo(at)yahoo.com
-# * Simon Strandgaard -- neoneye(at)adslhome.dk
-# * Dave Glasser -- glasser(at)mit.edu
-# * Paul Duncan -- pabs(at)pablotron.org
-# * Ville Aine -- vaine(at)cs.helsinki.fi
-# * Eric Hodel -- drbrain(at)segment7.net
-# * Daniel Berger -- djberg96(at)gmail.com
-# * Phil Hagelberg -- technomancy(at)gmail.com
-# * Ryan Davis
-#
-# (If your name is missing, PLEASE let us know!)
-#
-# Thanks!
-#
-# -The RubyGems Team
-
-module Gem
-
- ##
- # Configuration settings from ::RbConfig
-
- ConfigMap = {} unless defined?(ConfigMap)
-
- require 'rbconfig'
-
- ConfigMap.merge!(
- :EXEEXT => RbConfig::CONFIG["EXEEXT"],
- :RUBY_SO_NAME => RbConfig::CONFIG["RUBY_SO_NAME"],
- :arch => RbConfig::CONFIG["arch"],
- :bindir => RbConfig::CONFIG["bindir"],
- :datadir => RbConfig::CONFIG["datadir"],
- :libdir => RbConfig::CONFIG["libdir"],
- :rubylibprefix => RbConfig::CONFIG["rubylibprefix"],
- :ruby_install_name => RbConfig::CONFIG["ruby_install_name"],
- :ruby_version => RbConfig::CONFIG["ruby_version"],
- :sitedir => RbConfig::CONFIG["sitedir"],
- :sitelibdir => RbConfig::CONFIG["sitelibdir"],
- :vendordir => RbConfig::CONFIG["vendordir"] ,
- :vendorlibdir => RbConfig::CONFIG["vendorlibdir"]
- )
-
- ##
- # Default directories in a gem repository
-
- DIRECTORIES = %w[cache doc gems specifications] unless defined?(DIRECTORIES)
-
- # :stopdoc:
- MUTEX = Mutex.new
-
- RubyGemsPackageVersion = RubyGemsVersion
- # :startdoc:
-
- ##
- # An Array of Regexps that match windows ruby platforms.
-
- WIN_PATTERNS = [
- /bccwin/i,
- /cygwin/i,
- /djgpp/i,
- /mingw/i,
- /mswin/i,
- /wince/i,
- ]
-
- @@source_index = nil
- @@win_platform = nil
-
- @configuration = nil
- @loaded_specs = {}
- @loaded_stacks = {}
- @platforms = []
- @ruby = nil
- @sources = []
-
- @post_install_hooks ||= []
- @post_uninstall_hooks ||= []
- @pre_uninstall_hooks ||= []
- @pre_install_hooks ||= []
-
- ##
- # Activates an installed gem matching +gem+. The gem must satisfy
- # +version_requirements+.
- #
- # Returns true if the gem is activated, false if it is already
- # loaded, or an exception otherwise.
- #
- # Gem#activate adds the library paths in +gem+ to $LOAD_PATH. Before a Gem
- # is activated its required Gems are activated. If the version information
- # is omitted, the highest version Gem of the supplied name is loaded. If a
- # Gem is not found that meets the version requirements or a required Gem is
- # not found, a Gem::LoadError is raised.
- #
- # More information on version requirements can be found in the
- # Gem::Requirement and Gem::Version documentation.
-
- def self.activate(gem, *version_requirements)
- if version_requirements.last.is_a?(Hash)
- options = version_requirements.pop
- else
- options = {}
- end
-
- sources = options[:sources] || []
-
- if version_requirements.empty? then
- version_requirements = Gem::Requirement.default
- end
-
- unless gem.respond_to?(:name) and
- gem.respond_to?(:version_requirements) then
- gem = Gem::Dependency.new(gem, version_requirements)
- end
-
- matches = Gem.source_index.find_name(gem.name, gem.version_requirements)
- report_activate_error(gem) if matches.empty?
-
- if @loaded_specs[gem.name] then
- # This gem is already loaded. If the currently loaded gem is not in the
- # list of candidate gems, then we have a version conflict.
- existing_spec = @loaded_specs[gem.name]
-
- unless matches.any? { |spec| spec.version == existing_spec.version } then
- sources_message = sources.map { |spec| spec.full_name }
- stack_message = @loaded_stacks[gem.name].map { |spec| spec.full_name }
-
- msg = "can't activate #{gem} for #{sources_message.inspect}, "
- msg << "already activated #{existing_spec.full_name} for "
- msg << "#{stack_message.inspect}"
-
- e = Gem::LoadError.new msg
- e.name = gem.name
- e.version_requirement = gem.version_requirements
-
- raise e
- end
-
- return false
- end
-
- # new load
- spec = matches.last
- return false if spec.loaded?
-
- spec.loaded = true
- @loaded_specs[spec.name] = spec
- @loaded_stacks[spec.name] = sources.dup
-
- # Load dependent gems first
- spec.runtime_dependencies.each do |dep_gem|
- activate dep_gem, :sources => [spec, *sources]
- end
-
- # bin directory must come before library directories
- spec.require_paths.unshift spec.bindir if spec.bindir
-
- require_paths = spec.require_paths.map do |path|
- File.join spec.full_gem_path, path
- end
-
- sitelibdir = ConfigMap[:sitelibdir]
-
- # gem directories must come after -I and ENV['RUBYLIB']
- insert_index = load_path_insert_index
-
- if insert_index then
- # gem directories must come after -I and ENV['RUBYLIB']
- $LOAD_PATH.insert(insert_index, *require_paths)
- else
- # we are probably testing in core, -I and RUBYLIB don't apply
- $LOAD_PATH.unshift(*require_paths)
- end
-
- return true
- end
-
- ##
- # An Array of all possible load paths for all versions of all gems in the
- # Gem installation.
-
- def self.all_load_paths
- result = []
-
- Gem.path.each do |gemdir|
- each_load_path all_partials(gemdir) do |load_path|
- result << load_path
- end
- end
-
- result
- end
-
- ##
- # Return all the partial paths in +gemdir+.
-
- def self.all_partials(gemdir)
- Dir[File.join(gemdir, 'gems/*')]
- end
-
- private_class_method :all_partials
-
- ##
- # See if a given gem is available.
-
- def self.available?(gem, *requirements)
- requirements = Gem::Requirement.default if requirements.empty?
-
- unless gem.respond_to?(:name) and
- gem.respond_to?(:version_requirements) then
- gem = Gem::Dependency.new gem, requirements
- end
-
- !Gem.source_index.search(gem).empty?
- end
-
- ##
- # Find the full path to the executable for gem +name+. If the +exec_name+
- # is not given, the gem's default_executable is chosen, otherwise the
- # specifed executable's path is returned. +version_requirements+ allows you
- # to specify specific gem versions.
-
- def self.bin_path(name, exec_name = nil, *version_requirements)
- version_requirements = Gem::Requirement.default if
- version_requirements.empty?
- spec = Gem.source_index.find_name(name, version_requirements).last
-
- raise Gem::GemNotFoundException,
- "can't find gem #{name} (#{version_requirements})" unless spec
-
- exec_name ||= spec.default_executable
-
- unless exec_name
- msg = "no default executable for #{spec.full_name}"
- raise Gem::Exception, msg
- end
-
- unless spec.executables.include? exec_name
- msg = "can't find executable #{exec_name} for #{spec.full_name}"
- raise Gem::Exception, msg
- end
-
- File.join(spec.full_gem_path, spec.bindir, exec_name).sub(/.*\s.*/m, '"\&"')
- end
-
- ##
- # The mode needed to read a file as straight binary.
-
- def self.binary_mode
- @binary_mode ||= RUBY_VERSION > '1.9' ? 'rb:ascii-8bit' : 'rb'
- end
-
- ##
- # The path where gem executables are to be installed.
-
- def self.bindir(install_dir=Gem.dir)
- return File.join(install_dir, 'bin') unless
- install_dir.to_s == Gem.default_dir
- Gem.default_bindir
- end
-
- ##
- # Reset the +dir+ and +path+ values. The next time +dir+ or +path+
- # is requested, the values will be calculated from scratch. This is
- # mainly used by the unit tests to provide test isolation.
-
- def self.clear_paths
- @gem_home = nil
- @gem_path = nil
- @user_home = nil
-
- @@source_index = nil
-
- MUTEX.synchronize do
- @searcher = nil
- end
- end
-
- ##
- # The path to standard location of the user's .gemrc file.
-
- def self.config_file
- File.join Gem.user_home, '.gemrc'
- end
-
- ##
- # The standard configuration object for gems.
-
- def self.configuration
- @configuration ||= Gem::ConfigFile.new []
- end
-
- ##
- # Use the given configuration object (which implements the ConfigFile
- # protocol) as the standard configuration object.
-
- def self.configuration=(config)
- @configuration = config
- end
-
- ##
- # The path the the data directory specified by the gem name. If the
- # package is not available as a gem, return nil.
-
- def self.datadir(gem_name)
- spec = @loaded_specs[gem_name]
- return nil if spec.nil?
- File.join(spec.full_gem_path, 'data', gem_name)
- end
-
- ##
- # A Zlib::Deflate.deflate wrapper
-
- def self.deflate(data)
- require 'zlib'
- Zlib::Deflate.deflate data
- end
-
- ##
- # The path where gems are to be installed.
-
- def self.dir
- @gem_home ||= nil
- set_home(ENV['GEM_HOME'] || Gem.configuration.home || default_dir) unless @gem_home
- @gem_home
- end
-
- ##
- # Expand each partial gem path with each of the required paths specified
- # in the Gem spec. Each expanded path is yielded.
-
- def self.each_load_path(partials)
- partials.each do |gp|
- base = File.basename(gp)
- specfn = File.join(dir, "specifications", base + ".gemspec")
- if File.exist?(specfn)
- spec = eval(File.read(specfn))
- spec.require_paths.each do |rp|
- yield(File.join(gp, rp))
- end
- else
- filename = File.join(gp, 'lib')
- yield(filename) if File.exist?(filename)
- end
- end
- end
-
- private_class_method :each_load_path
-
- ##
- # Quietly ensure the named Gem directory contains all the proper
- # subdirectories. If we can't create a directory due to a permission
- # problem, then we will silently continue.
-
- def self.ensure_gem_subdirectories(gemdir)
- require 'fileutils'
-
- Gem::DIRECTORIES.each do |filename|
- fn = File.join gemdir, filename
- FileUtils.mkdir_p fn rescue nil unless File.exist? fn
- end
- end
-
- ##
- # Returns a list of paths matching +file+ that can be used by a gem to pick
- # up features from other gems. For example:
- #
- # Gem.find_files('rdoc/discover').each do |path| load path end
- #
- # find_files search $LOAD_PATH for files as well as gems.
- #
- # Note that find_files will return all files even if they are from different
- # versions of the same gem.
-
- def self.find_files(path)
- load_path_files = $LOAD_PATH.map do |load_path|
- files = Dir["#{File.expand_path path, load_path}#{Gem.suffix_pattern}"]
-
- files.select do |load_path_file|
- File.file? load_path_file.untaint
- end
- end.flatten
-
- specs = searcher.find_all path
-
- specs_files = specs.map do |spec|
- searcher.matching_files spec, path
- end.flatten
-
- (load_path_files + specs_files).flatten.uniq
- end
-
- ##
- # Finds the user's home directory.
- #--
- # Some comments from the ruby-talk list regarding finding the home
- # directory:
- #
- # I have HOME, USERPROFILE and HOMEDRIVE + HOMEPATH. Ruby seems
- # to be depending on HOME in those code samples. I propose that
- # it should fallback to USERPROFILE and HOMEDRIVE + HOMEPATH (at
- # least on Win32).
-
- def self.find_home
- unless RUBY_VERSION > '1.9' then
- ['HOME', 'USERPROFILE'].each do |homekey|
- return ENV[homekey] if ENV[homekey]
- end
-
- if ENV['HOMEDRIVE'] && ENV['HOMEPATH'] then
- return "#{ENV['HOMEDRIVE']}#{ENV['HOMEPATH']}"
- end
- end
-
- File.expand_path "~"
- rescue
- if File::ALT_SEPARATOR then
- "C:/"
- else
- "/"
- end
- end
-
- private_class_method :find_home
-
- ##
- # Zlib::GzipReader wrapper that unzips +data+.
-
- def self.gunzip(data)
- require 'stringio'
- require 'zlib'
- data = StringIO.new data
-
- Zlib::GzipReader.new(data).read
- end
-
- ##
- # Zlib::GzipWriter wrapper that zips +data+.
-
- def self.gzip(data)
- require 'stringio'
- require 'zlib'
- zipped = StringIO.new
-
- Zlib::GzipWriter.wrap zipped do |io| io.write data end
-
- zipped.string
- end
-
- ##
- # A Zlib::Inflate#inflate wrapper
-
- def self.inflate(data)
- require 'zlib'
- Zlib::Inflate.inflate data
- end
-
- ##
- # Return a list of all possible load paths for the latest version for all
- # gems in the Gem installation.
-
- def self.latest_load_paths
- result = []
-
- Gem.path.each do |gemdir|
- each_load_path(latest_partials(gemdir)) do |load_path|
- result << load_path
- end
- end
-
- result
- end
-
- ##
- # Return only the latest partial paths in the given +gemdir+.
-
- def self.latest_partials(gemdir)
- latest = {}
- all_partials(gemdir).each do |gp|
- base = File.basename(gp)
- if base =~ /(.*)-((\d+\.)*\d+)/ then
- name, version = $1, $2
- ver = Gem::Version.new(version)
- if latest[name].nil? || ver > latest[name][0]
- latest[name] = [ver, gp]
- end
- end
- end
- latest.collect { |k,v| v[1] }
- end
-
- private_class_method :latest_partials
-
- ##
- # The index to insert activated gem paths into the $LOAD_PATH.
- #
- # Defaults to the site lib directory unless gem_prelude.rb has loaded paths,
- # then it inserts the activated gem's paths before the gem_prelude.rb paths
- # so you can override the gem_prelude.rb default $LOAD_PATH paths.
-
- def self.load_path_insert_index
- index = $LOAD_PATH.index ConfigMap[:sitelibdir]
-
- $LOAD_PATH.each_with_index do |path, i|
- if path.instance_variables.include?(:@gem_prelude_index) or
- path.instance_variables.include?('@gem_prelude_index') then
- index = i
- break
- end
- end
-
- index
- end
-
- ##
- # The file name and line number of the caller of the caller of this method.
-
- def self.location_of_caller
- caller[1] =~ /(.*?):(\d+).*?$/i
- file = $1
- lineno = $2.to_i
-
- [file, lineno]
- end
-
- ##
- # The version of the Marshal format for your Ruby.
-
- def self.marshal_version
- "#{Marshal::MAJOR_VERSION}.#{Marshal::MINOR_VERSION}"
- end
-
- ##
- # Array of paths to search for Gems.
-
- def self.path
- @gem_path ||= nil
-
- unless @gem_path then
- paths = [ENV['GEM_PATH'] || Gem.configuration.path || default_path]
-
- if defined?(APPLE_GEM_HOME) and not ENV['GEM_PATH'] then
- paths << APPLE_GEM_HOME
- end
-
- set_paths paths.compact.join(File::PATH_SEPARATOR)
- end
-
- @gem_path
- end
-
- ##
- # Set array of platforms this RubyGems supports (primarily for testing).
-
- def self.platforms=(platforms)
- @platforms = platforms
- end
-
- ##
- # Array of platforms this RubyGems supports.
-
- def self.platforms
- @platforms ||= []
- if @platforms.empty?
- @platforms = [Gem::Platform::RUBY, Gem::Platform.local]
- end
- @platforms
- end
-
- ##
- # Adds a post-install hook that will be passed an Gem::Installer instance
- # when Gem::Installer#install is called
-
- def self.post_install(&hook)
- @post_install_hooks << hook
- end
-
- ##
- # Adds a post-uninstall hook that will be passed a Gem::Uninstaller instance
- # and the spec that was uninstalled when Gem::Uninstaller#uninstall is
- # called
-
- def self.post_uninstall(&hook)
- @post_uninstall_hooks << hook
- end
-
- ##
- # Adds a pre-install hook that will be passed an Gem::Installer instance
- # when Gem::Installer#install is called
-
- def self.pre_install(&hook)
- @pre_install_hooks << hook
- end
-
- ##
- # Adds a pre-uninstall hook that will be passed an Gem::Uninstaller instance
- # and the spec that will be uninstalled when Gem::Uninstaller#uninstall is
- # called
-
- def self.pre_uninstall(&hook)
- @pre_uninstall_hooks << hook
- end
-
- ##
- # The directory prefix this RubyGems was installed at.
-
- def self.prefix
- prefix = File.dirname File.expand_path(__FILE__)
-
- if File.dirname(prefix) == File.expand_path(ConfigMap[:sitelibdir]) or
- File.dirname(prefix) == File.expand_path(ConfigMap[:libdir]) or
- 'lib' != File.basename(prefix) then
- nil
- else
- File.dirname prefix
- end
- end
-
- ##
- # Promotes the load paths of the +gem_name+ over the load paths of
- # +over_name+. Useful for allowing one gem to override features in another
- # using #find_files.
-
- def self.promote_load_path(gem_name, over_name)
- gem = Gem.loaded_specs[gem_name]
- over = Gem.loaded_specs[over_name]
-
- raise ArgumentError, "gem #{gem_name} is not activated" if gem.nil?
- raise ArgumentError, "gem #{over_name} is not activated" if over.nil?
-
- last_gem_path = File.join gem.full_gem_path, gem.require_paths.last
-
- over_paths = over.require_paths.map do |path|
- File.join over.full_gem_path, path
- end
-
- over_paths.each do |path|
- $LOAD_PATH.delete path
- end
-
- gem = $LOAD_PATH.index(last_gem_path) + 1
-
- $LOAD_PATH.insert(gem, *over_paths)
- end
-
- ##
- # Refresh source_index from disk and clear searcher.
-
- def self.refresh
- source_index.refresh!
-
- MUTEX.synchronize do
- @searcher = nil
- end
- end
-
- ##
- # Safely read a file in binary mode on all platforms.
-
- def self.read_binary(path)
- File.open path, binary_mode do |f| f.read end
- end
-
- ##
- # Report a load error during activation. The message of load error
- # depends on whether it was a version mismatch or if there are not gems of
- # any version by the requested name.
-
- def self.report_activate_error(gem)
- matches = Gem.source_index.find_name(gem.name)
-
- if matches.empty? then
- error = Gem::LoadError.new(
- "Could not find RubyGem #{gem.name} (#{gem.version_requirements})\n")
- else
- error = Gem::LoadError.new(
- "RubyGem version error: " +
- "#{gem.name}(#{matches.first.version} not #{gem.version_requirements})\n")
- end
-
- error.name = gem.name
- error.version_requirement = gem.version_requirements
- raise error
- end
-
- private_class_method :report_activate_error
-
- ##
- # Full path to +libfile+ in +gemname+. Searches for the latest gem unless
- # +requirements+ is given.
-
- def self.required_location(gemname, libfile, *requirements)
- requirements = Gem::Requirement.default if requirements.empty?
-
- matches = Gem.source_index.find_name gemname, requirements
-
- return nil if matches.empty?
-
- spec = matches.last
- spec.require_paths.each do |path|
- result = File.join spec.full_gem_path, path, libfile
- return result if File.exist? result
- end
-
- nil
- end
-
- ##
- # The path to the running Ruby interpreter.
-
- def self.ruby
- if @ruby.nil? then
- @ruby = File.join(ConfigMap[:bindir],
- ConfigMap[:ruby_install_name])
- @ruby << ConfigMap[:EXEEXT]
-
- # escape string in case path to ruby executable contain spaces.
- @ruby.sub!(/.*\s.*/m, '"\&"')
- end
-
- @ruby
- end
-
- ##
- # A Gem::Version for the currently running ruby.
-
- def self.ruby_version
- return @ruby_version if defined? @ruby_version
- version = RUBY_VERSION.dup
-
- if defined?(RUBY_PATCHLEVEL) && RUBY_PATCHLEVEL != -1 then
- version << ".#{RUBY_PATCHLEVEL}"
- elsif defined?(RUBY_REVISION) then
- version << ".dev.#{RUBY_REVISION}"
- end
-
- @ruby_version = Gem::Version.new version
- end
-
- ##
- # The GemPathSearcher object used to search for matching installed gems.
-
- def self.searcher
- MUTEX.synchronize do
- @searcher ||= Gem::GemPathSearcher.new
- end
- end
-
- ##
- # Set the Gem home directory (as reported by Gem.dir).
-
- def self.set_home(home)
- home = home.gsub File::ALT_SEPARATOR, File::SEPARATOR if File::ALT_SEPARATOR
- @gem_home = home
- end
-
- private_class_method :set_home
-
- ##
- # Set the Gem search path (as reported by Gem.path).
-
- def self.set_paths(gpaths)
- if gpaths
- @gem_path = gpaths.split(File::PATH_SEPARATOR)
-
- if File::ALT_SEPARATOR then
- @gem_path.map! do |path|
- path.gsub File::ALT_SEPARATOR, File::SEPARATOR
- end
- end
-
- @gem_path << Gem.dir
- else
- # TODO: should this be Gem.default_path instead?
- @gem_path = [Gem.dir]
- end
-
- @gem_path.uniq!
- end
-
- private_class_method :set_paths
-
- ##
- # Returns the Gem::SourceIndex of specifications that are in the Gem.path
-
- def self.source_index
- @@source_index ||= SourceIndex.from_installed_gems
- end
-
- ##
- # Returns an Array of sources to fetch remote gems from. If the sources
- # list is empty, attempts to load the "sources" gem, then uses
- # default_sources if it is not installed.
-
- def self.sources
- if @sources.empty? then
- begin
- gem 'sources', '> 0.0.1'
- require 'sources'
- rescue LoadError
- @sources = default_sources
- end
- end
-
- @sources
- end
-
- ##
- # Need to be able to set the sources without calling
- # Gem.sources.replace since that would cause an infinite loop.
-
- def self.sources=(new_sources)
- @sources = new_sources
- end
-
- ##
- # Glob pattern for require-able path suffixes.
-
- def self.suffix_pattern
- @suffix_pattern ||= "{#{suffixes.join(',')}}"
- end
-
- ##
- # Suffixes for require-able paths.
-
- def self.suffixes
- ['', '.rb', '.rbw', '.so', '.bundle', '.dll', '.sl', '.jar']
- end
-
- ##
- # Prints the amount of time the supplied block takes to run using the debug
- # UI output.
-
- def self.time(msg, width = 0, display = Gem.configuration.verbose)
- now = Time.now
-
- value = yield
-
- elapsed = Time.now - now
-
- ui.say "%2$*1$s: %3$3.3fs" % [-width, msg, elapsed] if display
-
- value
- end
-
- ##
- # Lazily loads DefaultUserInteraction and returns the default UI.
-
- def self.ui
- require 'rubygems/user_interaction'
-
- Gem::DefaultUserInteraction.ui
- end
-
- ##
- # Use the +home+ and +paths+ values for Gem.dir and Gem.path. Used mainly
- # by the unit tests to provide environment isolation.
-
- def self.use_paths(home, paths=[])
- clear_paths
- set_home(home) if home
- set_paths(paths.join(File::PATH_SEPARATOR)) if paths
- end
-
- ##
- # The home directory for the user.
-
- def self.user_home
- @user_home ||= find_home
- end
-
- ##
- # Is this a windows platform?
-
- def self.win_platform?
- if @@win_platform.nil? then
- @@win_platform = !!WIN_PATTERNS.find { |r| RUBY_PLATFORM =~ r }
- end
-
- @@win_platform
- end
-
- class << self
-
- ##
- # Hash of loaded Gem::Specification keyed by name
-
- attr_reader :loaded_specs
-
- ##
- # The list of hooks to be run before Gem::Install#install does any work
-
- attr_reader :post_install_hooks
-
- ##
- # The list of hooks to be run before Gem::Uninstall#uninstall does any
- # work
-
- attr_reader :post_uninstall_hooks
-
- ##
- # The list of hooks to be run after Gem::Install#install is finished
-
- attr_reader :pre_install_hooks
-
- ##
- # The list of hooks to be run after Gem::Uninstall#uninstall is finished
-
- attr_reader :pre_uninstall_hooks
-
- # :stopdoc:
-
- alias cache source_index # an alias for the old name
-
- # :startdoc:
-
- end
-
- ##
- # Location of Marshal quick gemspecs on remote repositories
-
- MARSHAL_SPEC_DIR = "quick/Marshal.#{Gem.marshal_version}/"
-
- ##
- # Location of legacy YAML quick gemspecs on remote repositories
-
- YAML_SPEC_DIR = 'quick/'
-
-end
-
-##
-# Return the path to the data directory associated with the named package. If
-# the package is loaded as a gem, return the gem specific data directory.
-# Otherwise return a path to the share area as define by
-# "#{ConfigMap[:datadir]}/#{package_name}".
-
-def RbConfig.datadir(package_name)
- Gem.datadir(package_name) ||
- File.join(Gem::ConfigMap[:datadir], package_name)
-end
-
-require 'rubygems/exceptions'
-require 'rubygems/version'
-require 'rubygems/requirement'
-require 'rubygems/dependency'
-require 'rubygems/gem_path_searcher' # Needed for Kernel#gem
-require 'rubygems/source_index' # Needed for Kernel#gem
-require 'rubygems/platform'
-require 'rubygems/builder' # HACK: Needed for rake's package task.
-
-begin
- require 'rubygems/defaults/operating_system'
-rescue LoadError
-end
-
-if defined?(RUBY_ENGINE) then
- begin
- require "rubygems/defaults/#{RUBY_ENGINE}"
- rescue LoadError
- end
-end
-
-require 'rubygems/config_file'
-
-if RUBY_VERSION < '1.9' then
- require 'rubygems/custom_require'
-end
-
-Gem.clear_paths
-
-plugins = Gem.find_files 'rubygems_plugin'
-
-plugins.each do |plugin|
- begin
- load plugin
- rescue => e
- warn "error loading #{plugin.inspect}: #{e.message} (#{e.class})"
- end
-end
-
diff --git a/lib/rubygems/builder.rb b/lib/rubygems/builder.rb
deleted file mode 100644
index 3061b752ce..0000000000
--- a/lib/rubygems/builder.rb
+++ /dev/null
@@ -1,90 +0,0 @@
-#--
-# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
-# All rights reserved.
-# See LICENSE.txt for permissions.
-#++
-
-##
-# The Builder class processes RubyGem specification files
-# to produce a .gem file.
-
-class Gem::Builder
-
- include Gem::UserInteraction
- ##
- # Constructs a builder instance for the provided specification
- #
- # spec:: [Gem::Specification] The specification instance
-
- def initialize(spec)
- require "yaml"
- require "rubygems/package"
- require "rubygems/security"
-
- @spec = spec
- end
-
- ##
- # Builds the gem from the specification. Returns the name of the file
- # written.
-
- def build
- @spec.mark_version
- @spec.validate
- @signer = sign
- write_package
- say success
- @spec.file_name
- end
-
- def success
- <<-EOM
- Successfully built RubyGem
- Name: #{@spec.name}
- Version: #{@spec.version}
- File: #{@spec.full_name+'.gem'}
-EOM
- end
-
- private
-
- ##
- # If the signing key was specified, then load the file, and swap to the
- # public key (TODO: we should probably just omit the signing key in favor of
- # the signing certificate, but that's for the future, also the signature
- # algorithm should be configurable)
-
- def sign
- signer = nil
-
- if @spec.respond_to?(:signing_key) and @spec.signing_key then
- signer = Gem::Security::Signer.new @spec.signing_key, @spec.cert_chain
- @spec.signing_key = nil
- @spec.cert_chain = signer.cert_chain.map { |cert| cert.to_s }
- end
-
- signer
- end
-
- def write_package
- open @spec.file_name, 'wb' do |gem_io|
- Gem::Package.open gem_io, 'w', @signer do |pkg|
- pkg.metadata = @spec.to_yaml
-
- @spec.files.each do |file|
- next if File.directory? file
- next if file == @spec.file_name # Don't add gem onto itself
-
- stat = File.stat file
- mode = stat.mode & 0777
- size = stat.size
-
- pkg.add_file_simple file, mode, size do |tar_io|
- tar_io.write open(file, "rb") { |f| f.read }
- end
- end
- end
- end
- end
-end
-
diff --git a/lib/rubygems/command.rb b/lib/rubygems/command.rb
deleted file mode 100644
index 3a1e2ac872..0000000000
--- a/lib/rubygems/command.rb
+++ /dev/null
@@ -1,511 +0,0 @@
-#--
-# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
-# All rights reserved.
-# See LICENSE.txt for permissions.
-#++
-
-require 'optparse'
-require 'rubygems/user_interaction'
-
-##
-# Base class for all Gem commands. When creating a new gem command, define
-# #new, #execute, #arguments, #defaults_str, #description and #usage
-# (as appropriate). See the above mentioned methods for details.
-#
-# A very good example to look at is Gem::Commands::ContentsCommand
-
-class Gem::Command
-
- include Gem::UserInteraction
-
- ##
- # The name of the command.
-
- attr_reader :command
-
- ##
- # The options for the command.
-
- attr_reader :options
-
- ##
- # The default options for the command.
-
- attr_accessor :defaults
-
- ##
- # The name of the command for command-line invocation.
-
- attr_accessor :program_name
-
- ##
- # A short description of the command.
-
- attr_accessor :summary
-
- ##
- # Arguments used when building gems
-
- def self.build_args
- @build_args ||= []
- end
-
- def self.build_args=(value)
- @build_args = value
- end
-
- def self.common_options
- @common_options ||= []
- end
-
- def self.add_common_option(*args, &handler)
- Gem::Command.common_options << [args, handler]
- end
-
- def self.extra_args
- @extra_args ||= []
- end
-
- def self.extra_args=(value)
- case value
- when Array
- @extra_args = value
- when String
- @extra_args = value.split
- end
- end
-
- ##
- # Return an array of extra arguments for the command. The extra arguments
- # come from the gem configuration file read at program startup.
-
- def self.specific_extra_args(cmd)
- specific_extra_args_hash[cmd]
- end
-
- ##
- # Add a list of extra arguments for the given command. +args+ may be an
- # array or a string to be split on white space.
-
- def self.add_specific_extra_args(cmd,args)
- args = args.split(/\s+/) if args.kind_of? String
- specific_extra_args_hash[cmd] = args
- end
-
- ##
- # Accessor for the specific extra args hash (self initializing).
-
- def self.specific_extra_args_hash
- @specific_extra_args_hash ||= Hash.new do |h,k|
- h[k] = Array.new
- end
- end
-
- ##
- # Initializes a generic gem command named +command+. +summary+ is a short
- # description displayed in `gem help commands`. +defaults+ are the default
- # options. Defaults should be mirrored in #defaults_str, unless there are
- # none.
- #
- # When defining a new command subclass, use add_option to add command-line
- # switches.
- #
- # Unhandled arguments (gem names, files, etc.) are left in
- # <tt>options[:args]</tt>.
-
- def initialize(command, summary=nil, defaults={})
- @command = command
- @summary = summary
- @program_name = "gem #{command}"
- @defaults = defaults
- @options = defaults.dup
- @option_groups = Hash.new { |h,k| h[k] = [] }
- @parser = nil
- @when_invoked = nil
- end
-
- ##
- # True if +long+ begins with the characters from +short+.
-
- def begins?(long, short)
- return false if short.nil?
- long[0, short.length] == short
- end
-
- ##
- # Override to provide command handling.
- #
- # #options will be filled in with your parsed options, unparsed options will
- # be left in <tt>options[:args]</tt>.
- #
- # See also: #get_all_gem_names, #get_one_gem_name,
- # #get_one_optional_argument
-
- def execute
- raise Gem::Exception, "generic command has no actions"
- end
-
- ##
- # Get all gem names from the command line.
-
- def get_all_gem_names
- args = options[:args]
-
- if args.nil? or args.empty? then
- raise Gem::CommandLineError,
- "Please specify at least one gem name (e.g. gem build GEMNAME)"
- end
-
- gem_names = args.select { |arg| arg !~ /^-/ }
- end
-
- ##
- # Get the single gem name from the command line. Fail if there is no gem
- # name or if there is more than one gem name given.
-
- def get_one_gem_name
- args = options[:args]
-
- if args.nil? or args.empty? then
- raise Gem::CommandLineError,
- "Please specify a gem name on the command line (e.g. gem build GEMNAME)"
- end
-
- if args.size > 1 then
- raise Gem::CommandLineError,
- "Too many gem names (#{args.join(', ')}); please specify only one"
- end
-
- args.first
- end
-
- ##
- # Get a single optional argument from the command line. If more than one
- # argument is given, return only the first. Return nil if none are given.
-
- def get_one_optional_argument
- args = options[:args] || []
- args.first
- end
-
- ##
- # Override to provide details of the arguments a command takes. It should
- # return a left-justified string, one argument per line.
- #
- # For example:
- #
- # def usage
- # "#{program_name} FILE [FILE ...]"
- # end
- #
- # def arguments
- # "FILE name of file to find"
- # end
-
- def arguments
- ""
- end
-
- ##
- # Override to display the default values of the command options. (similar to
- # +arguments+, but displays the default values).
- #
- # For example:
- #
- # def defaults_str
- # --no-gems-first --no-all
- # end
-
- def defaults_str
- ""
- end
-
- ##
- # Override to display a longer description of what this command does.
-
- def description
- nil
- end
-
- ##
- # Override to display the usage for an individual gem command.
- #
- # The text "[options]" is automatically appended to the usage text.
-
- def usage
- program_name
- end
-
- ##
- # Display the help message for the command.
-
- def show_help
- parser.program_name = usage
- say parser
- end
-
- ##
- # Invoke the command with the given list of arguments.
-
- def invoke(*args)
- handle_options(args)
- if options[:help]
- show_help
- elsif @when_invoked
- @when_invoked.call(options)
- else
- execute
- end
- end
-
- ##
- # Call the given block when invoked.
- #
- # Normal command invocations just executes the +execute+ method of the
- # command. Specifying an invocation block allows the test methods to
- # override the normal action of a command to determine that it has been
- # invoked correctly.
-
- def when_invoked(&block)
- @when_invoked = block
- end
-
- ##
- # Add a command-line option and handler to the command.
- #
- # See OptionParser#make_switch for an explanation of +opts+.
- #
- # +handler+ will be called with two values, the value of the argument and
- # the options hash.
- #
- # If the first argument of add_option is a Symbol, it's used to group
- # options in output. See `gem help list` for an example.
-
- def add_option(*opts, &handler) # :yields: value, options
- group_name = Symbol === opts.first ? opts.shift : :options
-
- @option_groups[group_name] << [opts, handler]
- end
-
- ##
- # Remove previously defined command-line argument +name+.
-
- def remove_option(name)
- @option_groups.each do |_, option_list|
- option_list.reject! { |args, _| args.any? { |x| x =~ /^#{name}/ } }
- end
- end
-
- ##
- # Merge a set of command options with the set of default options (without
- # modifying the default option hash).
-
- def merge_options(new_options)
- @options = @defaults.clone
- new_options.each do |k,v| @options[k] = v end
- end
-
- ##
- # True if the command handles the given argument list.
-
- def handles?(args)
- begin
- parser.parse!(args.dup)
- return true
- rescue
- return false
- end
- end
-
- ##
- # Handle the given list of arguments by parsing them and recording the
- # results.
-
- def handle_options(args)
- args = add_extra_args(args)
- @options = @defaults.clone
- parser.parse!(args)
- @options[:args] = args
- end
-
- ##
- # Adds extra args from ~/.gemrc
-
- def add_extra_args(args)
- result = []
-
- s_extra = Gem::Command.specific_extra_args(@command)
- extra = Gem::Command.extra_args + s_extra
-
- until extra.empty? do
- ex = []
- ex << extra.shift
- ex << extra.shift if extra.first.to_s =~ /^[^-]/
- result << ex if handles?(ex)
- end
-
- result.flatten!
- result.concat(args)
- result
- end
-
- private
-
- ##
- # Create on demand parser.
-
- def parser
- create_option_parser if @parser.nil?
- @parser
- end
-
- def create_option_parser
- @parser = OptionParser.new
-
- @parser.separator("")
- regular_options = @option_groups.delete :options
-
- configure_options "", regular_options
-
- @option_groups.sort_by { |n,_| n.to_s }.each do |group_name, option_list|
- configure_options group_name, option_list
- end
-
- configure_options "Common", Gem::Command.common_options
-
- @parser.separator("")
- unless arguments.empty?
- @parser.separator(" Arguments:")
- arguments.split(/\n/).each do |arg_desc|
- @parser.separator(" #{arg_desc}")
- end
- @parser.separator("")
- end
-
- @parser.separator(" Summary:")
- wrap(@summary, 80 - 4).split("\n").each do |line|
- @parser.separator(" #{line.strip}")
- end
-
- if description then
- formatted = description.split("\n\n").map do |chunk|
- wrap(chunk, 80 - 4)
- end.join("\n")
-
- @parser.separator ""
- @parser.separator " Description:"
- formatted.split("\n").each do |line|
- @parser.separator " #{line.rstrip}"
- end
- end
-
- unless defaults_str.empty?
- @parser.separator("")
- @parser.separator(" Defaults:")
- defaults_str.split(/\n/).each do |line|
- @parser.separator(" #{line}")
- end
- end
- end
-
- def configure_options(header, option_list)
- return if option_list.nil? or option_list.empty?
-
- header = header.to_s.empty? ? '' : "#{header} "
- @parser.separator " #{header}Options:"
-
- option_list.each do |args, handler|
- dashes = args.select { |arg| arg =~ /^-/ }
- @parser.on(*args) do |value|
- handler.call(value, @options)
- end
- end
-
- @parser.separator ''
- end
-
- ##
- # Wraps +text+ to +width+
-
- def wrap(text, width) # :doc:
- text.gsub(/(.{1,#{width}})( +|$\n?)|(.{1,#{width}})/, "\\1\\3\n")
- end
-
- # ----------------------------------------------------------------
- # Add the options common to all commands.
-
- add_common_option('-h', '--help',
- 'Get help on this command') do |value, options|
- options[:help] = true
- end
-
- add_common_option('-V', '--[no-]verbose',
- 'Set the verbose level of output') do |value, options|
- # Set us to "really verbose" so the progress meter works
- if Gem.configuration.verbose and value then
- Gem.configuration.verbose = 1
- else
- Gem.configuration.verbose = value
- end
- end
-
- add_common_option('-q', '--quiet', 'Silence commands') do |value, options|
- Gem.configuration.verbose = false
- end
-
- # Backtrace and config-file are added so they show up in the help
- # commands. Both options are actually handled before the other
- # options get parsed.
-
- add_common_option('--config-file FILE',
- 'Use this config file instead of default') do
- end
-
- add_common_option('--backtrace',
- 'Show stack backtrace on errors') do
- end
-
- add_common_option('--debug',
- 'Turn on Ruby debugging') do
- end
-
- # :stopdoc:
-
- HELP = %{
- RubyGems is a sophisticated package manager for Ruby. This is a
- basic help message containing pointers to more information.
-
- Usage:
- gem -h/--help
- gem -v/--version
- gem command [arguments...] [options...]
-
- Examples:
- gem install rake
- gem list --local
- gem build package.gemspec
- gem help install
-
- Further help:
- gem help commands list all 'gem' commands
- gem help examples show some examples of usage
- gem help platforms show information about platforms
- gem help <COMMAND> show help on COMMAND
- (e.g. 'gem help install')
- gem server present a web page at
- http://localhost:8808/
- with info about installed gems
- Further information:
- http://rubygems.rubyforge.org
- }.gsub(/^ /, '')
-
- # :startdoc:
-
-end
-
-##
-# This is where Commands will be placed in the namespace
-
-module Gem::Commands
-end
-
diff --git a/lib/rubygems/command_manager.rb b/lib/rubygems/command_manager.rb
deleted file mode 100644
index 0a190161ca..0000000000
--- a/lib/rubygems/command_manager.rb
+++ /dev/null
@@ -1,174 +0,0 @@
-#--
-# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
-# All rights reserved.
-# See LICENSE.txt for permissions.
-#++
-
-require 'timeout'
-require 'rubygems/command'
-require 'rubygems/user_interaction'
-
-##
-# The command manager registers and installs all the individual sub-commands
-# supported by the gem command.
-#
-# Extra commands can be provided by writing a rubygems_plugin.rb
-# file in an installed gem. You should register your command against the
-# Gem::CommandManager instance, like this:
-#
-# # file rubygems_plugin.rb
-# require 'rubygems/command_manager'
-#
-# class Gem::Commands::EditCommand < Gem::Command
-# # ...
-# end
-#
-# Gem::CommandManager.instance.register_command :edit
-#
-# See Gem::Command for instructions on writing gem commands.
-
-class Gem::CommandManager
-
- include Gem::UserInteraction
-
- ##
- # Return the authoritative instance of the command manager.
-
- def self.instance
- @command_manager ||= new
- end
-
- ##
- # Register all the subcommands supported by the gem command.
-
- def initialize
- @commands = {}
- register_command :build
- register_command :cert
- register_command :check
- register_command :cleanup
- register_command :contents
- register_command :dependency
- register_command :environment
- register_command :fetch
- register_command :generate_index
- register_command :help
- register_command :install
- register_command :list
- register_command :lock
- register_command :mirror
- register_command :outdated
- register_command :pristine
- register_command :query
- register_command :rdoc
- register_command :search
- register_command :server
- register_command :sources
- register_command :specification
- register_command :stale
- register_command :uninstall
- register_command :unpack
- register_command :update
- register_command :which
- end
-
- ##
- # Register the command object.
-
- def register_command(command_obj)
- @commands[command_obj] = false
- end
-
- ##
- # Return the registered command from the command name.
-
- def [](command_name)
- command_name = command_name.intern
- return nil if @commands[command_name].nil?
- @commands[command_name] ||= load_and_instantiate(command_name)
- end
-
- ##
- # Return a sorted list of all command names (as strings).
-
- def command_names
- @commands.keys.collect {|key| key.to_s}.sort
- end
-
- ##
- # Run the config specified by +args+.
-
- def run(args)
- process_args(args)
- rescue StandardError, Timeout::Error => ex
- alert_error "While executing gem ... (#{ex.class})\n #{ex.to_s}"
- ui.errs.puts "\t#{ex.backtrace.join "\n\t"}" if
- Gem.configuration.backtrace
- terminate_interaction(1)
- rescue Interrupt
- alert_error "Interrupted"
- terminate_interaction(1)
- end
-
- def process_args(args)
- args = args.to_str.split(/\s+/) if args.respond_to?(:to_str)
- if args.size == 0
- say Gem::Command::HELP
- terminate_interaction(1)
- end
- case args[0]
- when '-h', '--help'
- say Gem::Command::HELP
- terminate_interaction(0)
- when '-v', '--version'
- say Gem::RubyGemsVersion
- terminate_interaction(0)
- when /^-/
- alert_error "Invalid option: #{args[0]}. See 'gem --help'."
- terminate_interaction(1)
- else
- cmd_name = args.shift.downcase
- cmd = find_command(cmd_name)
- cmd.invoke(*args)
- end
- end
-
- def find_command(cmd_name)
- possibilities = find_command_possibilities cmd_name
- if possibilities.size > 1 then
- raise "Ambiguous command #{cmd_name} matches [#{possibilities.join(', ')}]"
- elsif possibilities.size < 1 then
- raise "Unknown command #{cmd_name}"
- end
-
- self[possibilities.first]
- end
-
- def find_command_possibilities(cmd_name)
- len = cmd_name.length
-
- command_names.select { |n| cmd_name == n[0, len] }
- end
-
- private
-
- def load_and_instantiate(command_name)
- command_name = command_name.to_s
- retried = false
-
- begin
- const_name = command_name.capitalize.gsub(/_(.)/) { $1.upcase }
- Gem::Commands.const_get("#{const_name}Command").new
- rescue NameError
- if retried then
- raise
- else
- retried = true
- require "rubygems/commands/#{command_name}_command"
- retry
- end
- end
- end
-
-end
-
diff --git a/lib/rubygems/commands/build_command.rb b/lib/rubygems/commands/build_command.rb
deleted file mode 100644
index e1f0122c6c..0000000000
--- a/lib/rubygems/commands/build_command.rb
+++ /dev/null
@@ -1,53 +0,0 @@
-require 'rubygems/command'
-require 'rubygems/builder'
-
-class Gem::Commands::BuildCommand < Gem::Command
-
- def initialize
- super('build', 'Build a gem from a gemspec')
- end
-
- def arguments # :nodoc:
- "GEMSPEC_FILE gemspec file name to build a gem for"
- end
-
- def usage # :nodoc:
- "#{program_name} GEMSPEC_FILE"
- end
-
- def execute
- gemspec = get_one_gem_name
- if File.exist?(gemspec)
- specs = load_gemspecs(gemspec)
- specs.each do |spec|
- Gem::Builder.new(spec).build
- end
- else
- alert_error "Gemspec file not found: #{gemspec}"
- end
- end
-
- def load_gemspecs(filename)
- if yaml?(filename)
- result = []
- open(filename) do |f|
- begin
- while not f.eof? and spec = Gem::Specification.from_yaml(f)
- result << spec
- end
- rescue Gem::EndOfYAMLException => e
- # OK
- end
- end
- else
- result = [Gem::Specification.load(filename)]
- end
- result
- end
-
- def yaml?(filename)
- line = open(filename) { |f| line = f.gets }
- result = line =~ %r{!ruby/object:Gem::Specification}
- result
- end
-end
diff --git a/lib/rubygems/commands/cert_command.rb b/lib/rubygems/commands/cert_command.rb
deleted file mode 100644
index f5b698855b..0000000000
--- a/lib/rubygems/commands/cert_command.rb
+++ /dev/null
@@ -1,86 +0,0 @@
-require 'rubygems/command'
-require 'rubygems/security'
-
-class Gem::Commands::CertCommand < Gem::Command
-
- def initialize
- super 'cert', 'Manage RubyGems certificates and signing settings'
-
- add_option('-a', '--add CERT',
- 'Add a trusted certificate.') do |value, options|
- cert = OpenSSL::X509::Certificate.new(File.read(value))
- Gem::Security.add_trusted_cert(cert)
- say "Added '#{cert.subject.to_s}'"
- end
-
- add_option('-l', '--list',
- 'List trusted certificates.') do |value, options|
- glob_str = File::join(Gem::Security::OPT[:trust_dir], '*.pem')
- Dir::glob(glob_str) do |path|
- begin
- cert = OpenSSL::X509::Certificate.new(File.read(path))
- # this could probably be formatted more gracefully
- say cert.subject.to_s
- rescue OpenSSL::X509::CertificateError
- next
- end
- end
- end
-
- add_option('-r', '--remove STRING',
- 'Remove trusted certificates containing',
- 'STRING.') do |value, options|
- trust_dir = Gem::Security::OPT[:trust_dir]
- glob_str = File::join(trust_dir, '*.pem')
-
- Dir::glob(glob_str) do |path|
- begin
- cert = OpenSSL::X509::Certificate.new(File.read(path))
- if cert.subject.to_s.downcase.index(value)
- say "Removed '#{cert.subject.to_s}'"
- File.unlink(path)
- end
- rescue OpenSSL::X509::CertificateError
- next
- end
- end
- end
-
- add_option('-b', '--build EMAIL_ADDR',
- 'Build private key and self-signed',
- 'certificate for EMAIL_ADDR.') do |value, options|
- vals = Gem::Security.build_self_signed_cert(value)
- File.chmod 0600, vals[:key_path]
- say "Public Cert: #{vals[:cert_path]}"
- say "Private Key: #{vals[:key_path]}"
- say "Don't forget to move the key file to somewhere private..."
- end
-
- add_option('-C', '--certificate CERT',
- 'Certificate for --sign command.') do |value, options|
- cert = OpenSSL::X509::Certificate.new(File.read(value))
- Gem::Security::OPT[:issuer_cert] = cert
- end
-
- add_option('-K', '--private-key KEY',
- 'Private key for --sign command.') do |value, options|
- key = OpenSSL::PKey::RSA.new(File.read(value))
- Gem::Security::OPT[:issuer_key] = key
- end
-
- add_option('-s', '--sign NEWCERT',
- 'Sign a certificate with my key and',
- 'certificate.') do |value, options|
- cert = OpenSSL::X509::Certificate.new(File.read(value))
- my_cert = Gem::Security::OPT[:issuer_cert]
- my_key = Gem::Security::OPT[:issuer_key]
- cert = Gem::Security.sign_cert(cert, my_key, my_cert)
- File.open(value, 'wb') { |file| file.write(cert.to_pem) }
- end
- end
-
- def execute
- end
-
-end
-
diff --git a/lib/rubygems/commands/check_command.rb b/lib/rubygems/commands/check_command.rb
deleted file mode 100644
index 475aeb3795..0000000000
--- a/lib/rubygems/commands/check_command.rb
+++ /dev/null
@@ -1,80 +0,0 @@
-require 'rubygems/command'
-require 'rubygems/version_option'
-require 'rubygems/validator'
-
-class Gem::Commands::CheckCommand < Gem::Command
-
- include Gem::VersionOption
-
- def initialize
- super 'check', 'Check installed gems',
- :verify => false, :alien => false
-
- add_option( '--verify FILE',
- 'Verify gem file against its internal',
- 'checksum') do |value, options|
- options[:verify] = value
- end
-
- add_option('-a', '--alien', "Report 'unmanaged' or rogue files in the",
- "gem repository") do |value, options|
- options[:alien] = true
- end
-
- add_option('-v', '--verbose', "Spew more words") do |value, options|
- options[:verbose] = true
- end
-
- add_option('-t', '--test', "Run unit tests for gem") do |value, options|
- options[:test] = true
- end
-
- add_version_option 'run tests for'
- end
-
- def execute
- if options[:test]
- version = options[:version] || Gem::Requirement.default
- dep = Gem::Dependency.new get_one_gem_name, version
- gem_spec = Gem::SourceIndex.from_installed_gems.search(dep).first
- Gem::Validator.new.unit_test(gem_spec)
- end
-
- if options[:alien]
- say "Performing the 'alien' operation"
- say
- gems = get_all_gem_names rescue []
- Gem::Validator.new.alien(gems).sort.each do |key, val|
- unless val.empty? then
- say "#{key} has #{val.size} problems"
- val.each do |error_entry|
- say " #{error_entry.path}:"
- say " #{error_entry.problem}"
- end
- else
- say "#{key} is error-free" if options[:verbose]
- end
- say
- end
- end
-
- if options[:verify]
- gem_name = options[:verify]
- unless gem_name
- alert_error "Must specify a .gem file with --verify NAME"
- return
- end
- unless File.exist?(gem_name)
- alert_error "Unknown file: #{gem_name}."
- return
- end
- say "Verifying gem: '#{gem_name}'"
- begin
- Gem::Validator.new.verify_gem_file(gem_name)
- rescue Exception => e
- alert_error "#{gem_name} is invalid."
- end
- end
- end
-
-end
diff --git a/lib/rubygems/commands/cleanup_command.rb b/lib/rubygems/commands/cleanup_command.rb
deleted file mode 100644
index 1b6e405782..0000000000
--- a/lib/rubygems/commands/cleanup_command.rb
+++ /dev/null
@@ -1,106 +0,0 @@
-require 'rubygems/command'
-require 'rubygems/source_index'
-require 'rubygems/dependency_list'
-require 'rubygems/uninstaller'
-
-class Gem::Commands::CleanupCommand < Gem::Command
-
- def initialize
- super 'cleanup',
- 'Clean up old versions of installed gems in the local repository',
- :force => false, :test => false, :install_dir => Gem.dir
-
- add_option('-d', '--dryrun', "") do |value, options|
- options[:dryrun] = true
- end
- end
-
- def arguments # :nodoc:
- "GEMNAME name of gem to cleanup"
- end
-
- def defaults_str # :nodoc:
- "--no-dryrun"
- end
-
- def description # :nodoc:
- <<-EOF
-The cleanup command removes old gems from GEM_HOME. If an older version is
-installed elsewhere in GEM_PATH the cleanup command won't touch it.
- EOF
- end
-
- def usage # :nodoc:
- "#{program_name} [GEMNAME ...]"
- end
-
- def execute
- say "Cleaning up installed gems..."
- primary_gems = {}
-
- Gem.source_index.each do |name, spec|
- if primary_gems[spec.name].nil? or
- primary_gems[spec.name].version < spec.version then
- primary_gems[spec.name] = spec
- end
- end
-
- gems_to_cleanup = []
-
- unless options[:args].empty? then
- options[:args].each do |gem_name|
- dep = Gem::Dependency.new gem_name, Gem::Requirement.default
- specs = Gem.source_index.search dep
- specs.each do |spec|
- gems_to_cleanup << spec
- end
- end
- else
- Gem.source_index.each do |name, spec|
- gems_to_cleanup << spec
- end
- end
-
- gems_to_cleanup = gems_to_cleanup.select { |spec|
- primary_gems[spec.name].version != spec.version
- }
-
- deplist = Gem::DependencyList.new
- gems_to_cleanup.uniq.each do |spec| deplist.add spec end
-
- deps = deplist.strongly_connected_components.flatten.reverse
-
- deps.each do |spec|
- if options[:dryrun] then
- say "Dry Run Mode: Would uninstall #{spec.full_name}"
- else
- say "Attempting to uninstall #{spec.full_name}"
-
- options[:args] = [spec.name]
-
- uninstall_options = {
- :executables => false,
- :version => "= #{spec.version}",
- }
-
- if Gem.user_dir == spec.installation_path then
- uninstall_options[:install_dir] = spec.installation_path
- end
-
- uninstaller = Gem::Uninstaller.new spec.name, uninstall_options
-
- begin
- uninstaller.uninstall
- rescue Gem::DependencyRemovalException, Gem::InstallError,
- Gem::GemNotInHomeException => e
- say "Unable to uninstall #{spec.full_name}:"
- say "\t#{e.class}: #{e.message}"
- end
- end
- end
-
- say "Clean Up Complete"
- end
-
-end
-
diff --git a/lib/rubygems/commands/contents_command.rb b/lib/rubygems/commands/contents_command.rb
deleted file mode 100644
index ce2c655240..0000000000
--- a/lib/rubygems/commands/contents_command.rb
+++ /dev/null
@@ -1,98 +0,0 @@
-require 'rubygems/command'
-require 'rubygems/version_option'
-
-class Gem::Commands::ContentsCommand < Gem::Command
-
- include Gem::VersionOption
-
- def initialize
- super 'contents', 'Display the contents of the installed gems',
- :specdirs => [], :lib_only => false
-
- add_version_option
-
- add_option( '--all',
- "Contents for all gems") do |all, options|
- options[:all] = all
- end
-
- add_option('-s', '--spec-dir a,b,c', Array,
- "Search for gems under specific paths") do |spec_dirs, options|
- options[:specdirs] = spec_dirs
- end
-
- add_option('-l', '--[no-]lib-only',
- "Only return files in the Gem's lib_dirs") do |lib_only, options|
- options[:lib_only] = lib_only
- end
-
- add_option( '--[no-]prefix',
- "Don't include installed path prefix") do |prefix, options|
- options[:prefix] = prefix
- end
- end
-
- def arguments # :nodoc:
- "GEMNAME name of gem to list contents for"
- end
-
- def defaults_str # :nodoc:
- "--no-lib-only --prefix"
- end
-
- def usage # :nodoc:
- "#{program_name} GEMNAME [GEMNAME ...]"
- end
-
- def execute
- version = options[:version] || Gem::Requirement.default
-
- spec_dirs = options[:specdirs].map do |i|
- [i, File.join(i, "specifications")]
- end.flatten
-
- path_kind = if spec_dirs.empty? then
- spec_dirs = Gem::SourceIndex.installed_spec_directories
- "default gem paths"
- else
- "specified path"
- end
-
- si = Gem::SourceIndex.from_gems_in(*spec_dirs)
-
- gem_names = if options[:all] then
- si.map { |_, spec| spec.name }
- else
- get_all_gem_names
- end
-
- gem_names.each do |name|
- gem_spec = si.find_name(name, version).last
-
- unless gem_spec then
- say "Unable to find gem '#{name}' in #{path_kind}"
-
- if Gem.configuration.verbose then
- say "\nDirectories searched:"
- spec_dirs.each { |dir| say dir }
- end
-
- terminate_interaction 1 if gem_names.length == 1
- end
-
- files = options[:lib_only] ? gem_spec.lib_files : gem_spec.files
-
- files.each do |f|
- path = if options[:prefix] then
- File.join gem_spec.full_gem_path, f
- else
- f
- end
-
- say path
- end
- end
- end
-
-end
-
diff --git a/lib/rubygems/commands/dependency_command.rb b/lib/rubygems/commands/dependency_command.rb
deleted file mode 100644
index 44b269bb11..0000000000
--- a/lib/rubygems/commands/dependency_command.rb
+++ /dev/null
@@ -1,188 +0,0 @@
-require 'rubygems/command'
-require 'rubygems/local_remote_options'
-require 'rubygems/version_option'
-require 'rubygems/source_info_cache'
-
-class Gem::Commands::DependencyCommand < Gem::Command
-
- include Gem::LocalRemoteOptions
- include Gem::VersionOption
-
- def initialize
- super 'dependency',
- 'Show the dependencies of an installed gem',
- :version => Gem::Requirement.default, :domain => :local
-
- add_version_option
- add_platform_option
-
- add_option('-R', '--[no-]reverse-dependencies',
- 'Include reverse dependencies in the output') do
- |value, options|
- options[:reverse_dependencies] = value
- end
-
- add_option('-p', '--pipe',
- "Pipe Format (name --version ver)") do |value, options|
- options[:pipe_format] = value
- end
-
- add_local_remote_options
- end
-
- def arguments # :nodoc:
- "GEMNAME name of gem to show dependencies for"
- end
-
- def defaults_str # :nodoc:
- "--local --version '#{Gem::Requirement.default}' --no-reverse-dependencies"
- end
-
- def usage # :nodoc:
- "#{program_name} GEMNAME"
- end
-
- def execute
- options[:args] << '' if options[:args].empty?
- specs = {}
-
- source_indexes = Hash.new do |h, source_uri|
- h[source_uri] = Gem::SourceIndex.new
- end
-
- pattern = if options[:args].length == 1 and
- options[:args].first =~ /\A\/(.*)\/(i)?\z/m then
- flags = $2 ? Regexp::IGNORECASE : nil
- Regexp.new $1, flags
- else
- /\A#{Regexp.union(*options[:args])}/
- end
-
- dependency = Gem::Dependency.new pattern, options[:version]
-
- if options[:reverse_dependencies] and remote? and not local? then
- alert_error 'Only reverse dependencies for local gems are supported.'
- terminate_interaction 1
- end
-
- if local? then
- Gem.source_index.search(dependency).each do |spec|
- source_indexes[:local].add_spec spec
- end
- end
-
- if remote? and not options[:reverse_dependencies] then
- fetcher = Gem::SpecFetcher.fetcher
-
- begin
- fetcher.find_matching(dependency).each do |spec_tuple, source_uri|
- spec = fetcher.fetch_spec spec_tuple, URI.parse(source_uri)
-
- source_indexes[source_uri].add_spec spec
- end
- rescue Gem::RemoteFetcher::FetchError => e
- raise unless fetcher.warn_legacy e do
- require 'rubygems/source_info_cache'
-
- specs = Gem::SourceInfoCache.search_with_source dependency, false
-
- specs.each do |spec, source_uri|
- source_indexes[source_uri].add_spec spec
- end
- end
- end
- end
-
- if source_indexes.empty? then
- patterns = options[:args].join ','
- say "No gems found matching #{patterns} (#{options[:version]})" if
- Gem.configuration.verbose
-
- terminate_interaction 1
- end
-
- specs = {}
-
- source_indexes.values.each do |source_index|
- source_index.gems.each do |name, spec|
- specs[spec.full_name] = [source_index, spec]
- end
- end
-
- reverse = Hash.new { |h, k| h[k] = [] }
-
- if options[:reverse_dependencies] then
- specs.values.each do |_, spec|
- reverse[spec.full_name] = find_reverse_dependencies spec
- end
- end
-
- if options[:pipe_format] then
- specs.values.sort_by { |_, spec| spec }.each do |_, spec|
- unless spec.dependencies.empty?
- spec.dependencies.each do |dep|
- say "#{dep.name} --version '#{dep.version_requirements}'"
- end
- end
- end
- else
- response = ''
-
- specs.values.sort_by { |_, spec| spec }.each do |_, spec|
- response << print_dependencies(spec)
- unless reverse[spec.full_name].empty? then
- response << " Used by\n"
- reverse[spec.full_name].each do |sp, dep|
- response << " #{sp} (#{dep})\n"
- end
- end
- response << "\n"
- end
-
- say response
- end
- end
-
- def print_dependencies(spec, level = 0)
- response = ''
- response << ' ' * level + "Gem #{spec.full_name}\n"
- unless spec.dependencies.empty? then
- spec.dependencies.each do |dep|
- response << ' ' * level + " #{dep}\n"
- end
- end
- response
- end
-
- # Retuns list of [specification, dep] that are satisfied by spec.
- def find_reverse_dependencies(spec)
- result = []
-
- Gem.source_index.each do |name, sp|
- sp.dependencies.each do |dep|
- dep = Gem::Dependency.new(*dep) unless Gem::Dependency === dep
-
- if spec.name == dep.name and
- dep.version_requirements.satisfied_by?(spec.version) then
- result << [sp.full_name, dep]
- end
- end
- end
-
- result
- end
-
- def find_gems(name, source_index)
- specs = {}
-
- spec_list = source_index.search name, options[:version]
-
- spec_list.each do |spec|
- specs[spec.full_name] = [source_index, spec]
- end
-
- specs
- end
-
-end
-
diff --git a/lib/rubygems/commands/environment_command.rb b/lib/rubygems/commands/environment_command.rb
deleted file mode 100644
index e672da54f0..0000000000
--- a/lib/rubygems/commands/environment_command.rb
+++ /dev/null
@@ -1,128 +0,0 @@
-require 'rubygems/command'
-
-class Gem::Commands::EnvironmentCommand < Gem::Command
-
- def initialize
- super 'environment', 'Display information about the RubyGems environment'
- end
-
- def arguments # :nodoc:
- args = <<-EOF
- packageversion display the package version
- gemdir display the path where gems are installed
- gempath display path used to search for gems
- version display the gem format version
- remotesources display the remote gem servers
- <omitted> display everything
- EOF
- return args.gsub(/^\s+/, '')
- end
-
- def description # :nodoc:
- <<-EOF
-The RubyGems environment can be controlled through command line arguments,
-gemrc files, environment variables and built-in defaults.
-
-Command line argument defaults and some RubyGems defaults can be set in
-~/.gemrc file for individual users and a /etc/gemrc for all users. A gemrc
-is a YAML file with the following YAML keys:
-
- :sources: A YAML array of remote gem repositories to install gems from
- :verbose: Verbosity of the gem command. false, true, and :really are the
- levels
- :update_sources: Enable/disable automatic updating of repository metadata
- :backtrace: Print backtrace when RubyGems encounters an error
- :bulk_threshold: Switch to a bulk update when this many sources are out of
- date (legacy setting)
- :gempath: The paths in which to look for gems
- gem_command: A string containing arguments for the specified gem command
-
-Example:
-
- :verbose: false
- install: --no-wrappers
- update: --no-wrappers
-
-RubyGems' default local repository can be overriden with the GEM_PATH and
-GEM_HOME environment variables. GEM_HOME sets the default repository to
-install into. GEM_PATH allows multiple local repositories to be searched for
-gems.
-
-If you are behind a proxy server, RubyGems uses the HTTP_PROXY,
-HTTP_PROXY_USER and HTTP_PROXY_PASS environment variables to discover the
-proxy server.
-
-If you are packaging RubyGems all of RubyGems' defaults are in
-lib/rubygems/defaults.rb. You may override these in
-lib/rubygems/defaults/operating_system.rb
- EOF
- end
-
- def usage # :nodoc:
- "#{program_name} [arg]"
- end
-
- def execute
- out = ''
- arg = options[:args][0]
- case arg
- when /^packageversion/ then
- out << Gem::RubyGemsPackageVersion
- when /^version/ then
- out << Gem::RubyGemsVersion
- when /^gemdir/, /^gemhome/, /^home/, /^GEM_HOME/ then
- out << Gem.dir
- when /^gempath/, /^path/, /^GEM_PATH/ then
- out << Gem.path.join(File::PATH_SEPARATOR)
- when /^remotesources/ then
- out << Gem.sources.join("\n")
- when nil then
- out = "RubyGems Environment:\n"
-
- out << " - RUBYGEMS VERSION: #{Gem::RubyGemsVersion}\n"
-
- out << " - RUBY VERSION: #{RUBY_VERSION} (#{RUBY_RELEASE_DATE}"
- out << " patchlevel #{RUBY_PATCHLEVEL}" if defined? RUBY_PATCHLEVEL
- out << ") [#{RUBY_PLATFORM}]\n"
-
- out << " - INSTALLATION DIRECTORY: #{Gem.dir}\n"
-
- out << " - RUBYGEMS PREFIX: #{Gem.prefix}\n" unless Gem.prefix.nil?
-
- out << " - RUBY EXECUTABLE: #{Gem.ruby}\n"
-
- out << " - EXECUTABLE DIRECTORY: #{Gem.bindir}\n"
-
- out << " - RUBYGEMS PLATFORMS:\n"
- Gem.platforms.each do |platform|
- out << " - #{platform}\n"
- end
-
- out << " - GEM PATHS:\n"
- out << " - #{Gem.dir}\n"
-
- path = Gem.path.dup
- path.delete Gem.dir
- path.each do |p|
- out << " - #{p}\n"
- end
-
- out << " - GEM CONFIGURATION:\n"
- Gem.configuration.each do |name, value|
- out << " - #{name.inspect} => #{value.inspect}\n"
- end
-
- out << " - REMOTE SOURCES:\n"
- Gem.sources.each do |s|
- out << " - #{s}\n"
- end
-
- else
- fail Gem::CommandLineError, "Unknown enviroment option [#{arg}]"
- end
- say out
- true
- end
-
-end
-
diff --git a/lib/rubygems/commands/fetch_command.rb b/lib/rubygems/commands/fetch_command.rb
deleted file mode 100644
index 76c9924e6b..0000000000
--- a/lib/rubygems/commands/fetch_command.rb
+++ /dev/null
@@ -1,62 +0,0 @@
-require 'rubygems/command'
-require 'rubygems/local_remote_options'
-require 'rubygems/version_option'
-require 'rubygems/source_info_cache'
-
-class Gem::Commands::FetchCommand < Gem::Command
-
- include Gem::LocalRemoteOptions
- include Gem::VersionOption
-
- def initialize
- super 'fetch', 'Download a gem and place it in the current directory'
-
- add_bulk_threshold_option
- add_proxy_option
- add_source_option
-
- add_version_option
- add_platform_option
- end
-
- def arguments # :nodoc:
- 'GEMNAME name of gem to download'
- end
-
- def defaults_str # :nodoc:
- "--version '#{Gem::Requirement.default}'"
- end
-
- def usage # :nodoc:
- "#{program_name} GEMNAME [GEMNAME ...]"
- end
-
- def execute
- version = options[:version] || Gem::Requirement.default
- all = Gem::Requirement.default
-
- gem_names = get_all_gem_names
-
- gem_names.each do |gem_name|
- dep = Gem::Dependency.new gem_name, version
-
- specs_and_sources = Gem::SpecFetcher.fetcher.fetch dep, all
-
- specs_and_sources.sort_by { |spec,| spec.version }
-
- spec, source_uri = specs_and_sources.last
-
- if spec.nil? then
- alert_error "Could not find #{gem_name} in any repository"
- next
- end
-
- path = Gem::RemoteFetcher.fetcher.download spec, source_uri
- FileUtils.mv path, "#{spec.full_name}.gem"
-
- say "Downloaded #{spec.full_name}"
- end
- end
-
-end
-
diff --git a/lib/rubygems/commands/generate_index_command.rb b/lib/rubygems/commands/generate_index_command.rb
deleted file mode 100644
index 945d32383c..0000000000
--- a/lib/rubygems/commands/generate_index_command.rb
+++ /dev/null
@@ -1,133 +0,0 @@
-require 'rubygems/command'
-require 'rubygems/indexer'
-
-##
-# Generates a index files for use as a gem server.
-#
-# See `gem help generate_index`
-
-class Gem::Commands::GenerateIndexCommand < Gem::Command
-
- def initialize
- super 'generate_index',
- 'Generates the index files for a gem server directory',
- :directory => '.', :build_legacy => true, :build_modern => true
-
- add_option '-d', '--directory=DIRNAME',
- 'repository base dir containing gems subdir' do |dir, options|
- options[:directory] = File.expand_path dir
- end
-
- add_option '--[no-]legacy',
- 'Generate indexes for RubyGems older than',
- '1.2.0' do |value, options|
- unless options[:build_modern] or value then
- raise OptionParser::InvalidOption, 'no indicies will be built'
- end
-
- options[:build_legacy] = value
- end
-
- add_option '--[no-]modern',
- 'Generate indexes for RubyGems newer',
- 'than 1.2.0' do |value, options|
- unless options[:build_legacy] or value then
- raise OptionParser::InvalidOption, 'no indicies will be built'
- end
-
- options[:build_modern] = value
- end
-
- add_option '--update',
- 'Update modern indexes with gems added',
- 'since the last update' do |value, options|
- options[:update] = value
- end
-
- add_option :RSS, '--rss-gems-host=GEM_HOST',
- 'Host name where gems are served from,',
- 'used for GUID and enclosure values' do |value, options|
- options[:rss_gems_host] = value
- end
-
- add_option :RSS, '--rss-host=HOST',
- 'Host name for more gems information,',
- 'used for RSS feed link' do |value, options|
- options[:rss_host] = value
- end
-
- add_option :RSS, '--rss-title=TITLE',
- 'Set title for RSS feed' do |value, options|
- options[:rss_title] = value
- end
- end
-
- def defaults_str # :nodoc:
- "--directory . --legacy --modern"
- end
-
- def description # :nodoc:
- <<-EOF
-The generate_index command creates a set of indexes for serving gems
-statically. The command expects a 'gems' directory under the path given to
-the --directory option. The given directory will be the directory you serve
-as the gem repository.
-
-For `gem generate_index --directory /path/to/repo`, expose /path/to/repo via
-your HTTP server configuration (not /path/to/repo/gems).
-
-When done, it will generate a set of files like this:
-
- gems/*.gem # .gem files you want to
- # index
-
- specs.<version>.gz # specs index
- latest_specs.<version>.gz # latest specs index
- prerelease_specs.<version>.gz # prerelease specs index
- quick/Marshal.<version>/<gemname>.gemspec.rz # Marshal quick index file
-
- # these files support legacy RubyGems
- quick/index
- quick/index.rz # quick index manifest
- quick/<gemname>.gemspec.rz # legacy YAML quick index
- # file
- Marshal.<version>
- Marshal.<version>.Z # Marshal full index
- yaml
- yaml.Z # legacy YAML full index
-
-The .Z and .rz extension files are compressed with the inflate algorithm.
-The Marshal version number comes from ruby's Marshal::MAJOR_VERSION and
-Marshal::MINOR_VERSION constants. It is used to ensure compatibility.
-The yaml indexes exist for legacy RubyGems clients and fallback in case of
-Marshal version changes.
-
-If --rss-host and --rss-gem-host are given an RSS feed will be generated at
-index.rss containing gems released in the last two days.
- EOF
- end
-
- def execute
- if options[:update] and
- (options[:rss_host] or options[:rss_gems_host]) then
- alert_error '--update not compatible with RSS generation'
- terminate_interaction 1
- end
-
- if not File.exist?(options[:directory]) or
- not File.directory?(options[:directory]) then
- alert_error "unknown directory name #{directory}."
- terminate_interaction 1
- else
- indexer = Gem::Indexer.new options.delete(:directory), options
-
- if options[:update] then
- indexer.update_index
- else
- indexer.generate_index
- end
- end
- end
-
-end
-
diff --git a/lib/rubygems/commands/help_command.rb b/lib/rubygems/commands/help_command.rb
deleted file mode 100644
index 0c4a4ec16f..0000000000
--- a/lib/rubygems/commands/help_command.rb
+++ /dev/null
@@ -1,172 +0,0 @@
-require 'rubygems/command'
-
-class Gem::Commands::HelpCommand < Gem::Command
-
- # :stopdoc:
- EXAMPLES = <<-EOF
-Some examples of 'gem' usage.
-
-* Install 'rake', either from local directory or remote server:
-
- gem install rake
-
-* Install 'rake', only from remote server:
-
- gem install rake --remote
-
-* Install 'rake' from remote server, and run unit tests,
- and generate RDocs:
-
- gem install --remote rake --test --rdoc --ri
-
-* Install 'rake', but only version 0.3.1, even if dependencies
- are not met, and into a user-specific directory:
-
- gem install rake --version 0.3.1 --force --user-install
-
-* List local gems whose name begins with 'D':
-
- gem list D
-
-* List local and remote gems whose name contains 'log':
-
- gem search log --both
-
-* List only remote gems whose name contains 'log':
-
- gem search log --remote
-
-* Uninstall 'rake':
-
- gem uninstall rake
-
-* Create a gem:
-
- See http://rubygems.rubyforge.org/wiki/wiki.pl?CreateAGemInTenMinutes
-
-* See information about RubyGems:
-
- gem environment
-
-* Update all gems on your system:
-
- gem update
- EOF
-
- PLATFORMS = <<-'EOF'
-RubyGems platforms are composed of three parts, a CPU, an OS, and a
-version. These values are taken from values in rbconfig.rb. You can view
-your current platform by running `gem environment`.
-
-RubyGems matches platforms as follows:
-
- * The CPU must match exactly, unless one of the platforms has
- "universal" as the CPU.
- * The OS must match exactly.
- * The versions must match exactly unless one of the versions is nil.
-
-For commands that install, uninstall and list gems, you can override what
-RubyGems thinks your platform is with the --platform option. The platform
-you pass must match "#{cpu}-#{os}" or "#{cpu}-#{os}-#{version}". On mswin
-platforms, the version is the compiler version, not the OS version. (Ruby
-compiled with VC6 uses "60" as the compiler version, VC8 uses "80".)
-
-Example platforms:
-
- x86-freebsd # Any FreeBSD version on an x86 CPU
- universal-darwin-8 # Darwin 8 only gems that run on any CPU
- x86-mswin32-80 # Windows gems compiled with VC8
-
-When building platform gems, set the platform in the gem specification to
-Gem::Platform::CURRENT. This will correctly mark the gem with your ruby's
-platform.
- EOF
- # :startdoc:
-
- def initialize
- super 'help', "Provide help on the 'gem' command"
- end
-
- def arguments # :nodoc:
- args = <<-EOF
- commands List all 'gem' commands
- examples Show examples of 'gem' usage
- <command> Show specific help for <command>
- EOF
- return args.gsub(/^\s+/, '')
- end
-
- def usage # :nodoc:
- "#{program_name} ARGUMENT"
- end
-
- def execute
- command_manager = Gem::CommandManager.instance
- arg = options[:args][0]
-
- if begins? "commands", arg then
- out = []
- out << "GEM commands are:"
- out << nil
-
- margin_width = 4
-
- desc_width = command_manager.command_names.map { |n| n.size }.max + 4
-
- summary_width = 80 - margin_width - desc_width
- wrap_indent = ' ' * (margin_width + desc_width)
- format = "#{' ' * margin_width}%-#{desc_width}s%s"
-
- command_manager.command_names.each do |cmd_name|
- summary = command_manager[cmd_name].summary
- summary = wrap(summary, summary_width).split "\n"
- out << sprintf(format, cmd_name, summary.shift)
- until summary.empty? do
- out << "#{wrap_indent}#{summary.shift}"
- end
- end
-
- out << nil
- out << "For help on a particular command, use 'gem help COMMAND'."
- out << nil
- out << "Commands may be abbreviated, so long as they are unambiguous."
- out << "e.g. 'gem i rake' is short for 'gem install rake'."
-
- say out.join("\n")
-
- elsif begins? "options", arg then
- say Gem::Command::HELP
-
- elsif begins? "examples", arg then
- say EXAMPLES
-
- elsif begins? "platforms", arg then
- say PLATFORMS
-
- elsif options[:help] then
- command = command_manager[options[:help]]
- if command
- # help with provided command
- command.invoke("--help")
- else
- alert_error "Unknown command #{options[:help]}. Try 'gem help commands'"
- end
-
- elsif arg then
- possibilities = command_manager.find_command_possibilities(arg.downcase)
- if possibilities.size == 1
- command = command_manager[possibilities.first]
- command.invoke("--help")
- elsif possibilities.size > 1
- alert_warning "Ambiguous command #{arg} (#{possibilities.join(', ')})"
- else
- alert_warning "Unknown command #{arg}. Try gem help commands"
- end
-
- else
- say Gem::Command::HELP
- end
- end
-
-end
-
diff --git a/lib/rubygems/commands/install_command.rb b/lib/rubygems/commands/install_command.rb
deleted file mode 100644
index af2d8bd739..0000000000
--- a/lib/rubygems/commands/install_command.rb
+++ /dev/null
@@ -1,174 +0,0 @@
-require 'rubygems/command'
-require 'rubygems/doc_manager'
-require 'rubygems/install_update_options'
-require 'rubygems/dependency_installer'
-require 'rubygems/local_remote_options'
-require 'rubygems/validator'
-require 'rubygems/version_option'
-
-##
-# Gem installer command line tool
-#
-# See `gem help install`
-
-class Gem::Commands::InstallCommand < Gem::Command
-
- include Gem::VersionOption
- include Gem::LocalRemoteOptions
- include Gem::InstallUpdateOptions
-
- def initialize
- defaults = Gem::DependencyInstaller::DEFAULT_OPTIONS.merge({
- :generate_rdoc => true,
- :generate_ri => true,
- :format_executable => false,
- :test => false,
- :version => Gem::Requirement.default,
- })
-
- super 'install', 'Install a gem into the local repository', defaults
-
- add_install_update_options
- add_local_remote_options
- add_platform_option
- add_version_option
- end
-
- def arguments # :nodoc:
- "GEMNAME name of gem to install"
- end
-
- def defaults_str # :nodoc:
- "--both --version '#{Gem::Requirement.default}' --rdoc --ri --no-force\n" \
- "--no-test --install-dir #{Gem.dir}"
- end
-
- def description # :nodoc:
- <<-EOF
-The install command installs local or remote gem into a gem repository.
-
-For gems with executables ruby installs a wrapper file into the executable
-directory by default. This can be overridden with the --no-wrappers option.
-The wrapper allows you to choose among alternate gem versions using _version_.
-
-For example `rake _0.7.3_ --version` will run rake version 0.7.3 if a newer
-version is also installed.
-
-If an extension fails to compile during gem installation the gem
-specification is not written out, but the gem remains unpacked in the
-repository. You may need to specify the path to the library's headers and
-libraries to continue. You can do this by adding a -- between RubyGems'
-options and the extension's build options:
-
- $ gem install some_extension_gem
- [build fails]
- Gem files will remain installed in \\
- /path/to/gems/some_extension_gem-1.0 for inspection.
- Results logged to /path/to/gems/some_extension_gem-1.0/gem_make.out
- $ gem install some_extension_gem -- --with-extension-lib=/path/to/lib
- [build succeeds]
- $ gem list some_extension_gem
-
- *** LOCAL GEMS ***
-
- some_extension_gem (1.0)
- $
-
-If you correct the compilation errors by editing the gem files you will need
-to write the specification by hand. For example:
-
- $ gem install some_extension_gem
- [build fails]
- Gem files will remain installed in \\
- /path/to/gems/some_extension_gem-1.0 for inspection.
- Results logged to /path/to/gems/some_extension_gem-1.0/gem_make.out
- $ [cd /path/to/gems/some_extension_gem-1.0]
- $ [edit files or what-have-you and run make]
- $ gem spec ../../cache/some_extension_gem-1.0.gem --ruby > \\
- ../../specifications/some_extension_gem-1.0.gemspec
- $ gem list some_extension_gem
-
- *** LOCAL GEMS ***
-
- some_extension_gem (1.0)
- $
-
- EOF
- end
-
- def usage # :nodoc:
- "#{program_name} GEMNAME [GEMNAME ...] [options] -- --build-flags"
- end
-
- def execute
- if options[:include_dependencies] then
- alert "`gem install -y` is now default and will be removed"
- alert "use --ignore-dependencies to install only the gems you list"
- end
-
- installed_gems = []
-
- ENV.delete 'GEM_PATH' if options[:install_dir].nil? and RUBY_VERSION > '1.9'
-
- exit_code = 0
-
- get_all_gem_names.each do |gem_name|
- begin
- inst = Gem::DependencyInstaller.new options
- inst.install gem_name, options[:version]
-
- inst.installed_gems.each do |spec|
- say "Successfully installed #{spec.full_name}"
- end
-
- installed_gems.push(*inst.installed_gems)
- rescue Gem::InstallError => e
- alert_error "Error installing #{gem_name}:\n\t#{e.message}"
- exit_code |= 1
- rescue Gem::GemNotFoundException => e
- alert_error e.message
- exit_code |= 2
- end
- end
-
- unless installed_gems.empty? then
- gems = installed_gems.length == 1 ? 'gem' : 'gems'
- say "#{installed_gems.length} #{gems} installed"
-
- # NOTE: *All* of the RI documents must be generated first. For some
- # reason, RI docs cannot be generated after any RDoc documents are
- # generated.
-
- if options[:generate_ri] then
- installed_gems.each do |gem|
- Gem::DocManager.new(gem, options[:rdoc_args]).generate_ri
- end
-
- Gem::DocManager.update_ri_cache
- end
-
- if options[:generate_rdoc] then
- installed_gems.each do |gem|
- Gem::DocManager.new(gem, options[:rdoc_args]).generate_rdoc
- end
- end
-
- if options[:test] then
- installed_gems.each do |spec|
- gem_spec = Gem::SourceIndex.from_installed_gems.find_name(spec.name, spec.version.version).first
- result = Gem::Validator.new.unit_test(gem_spec)
- if result and not result.passed?
- unless ask_yes_no("...keep Gem?", true)
- require 'rubygems/uninstaller'
- Gem::Uninstaller.new(spec.name, :version => spec.version.version).uninstall
- end
- end
- end
- end
- end
-
- raise Gem::SystemExitException, exit_code
- end
-
-end
-
diff --git a/lib/rubygems/commands/list_command.rb b/lib/rubygems/commands/list_command.rb
deleted file mode 100644
index f3e5da9551..0000000000
--- a/lib/rubygems/commands/list_command.rb
+++ /dev/null
@@ -1,35 +0,0 @@
-require 'rubygems/command'
-require 'rubygems/commands/query_command'
-
-##
-# An alternate to Gem::Commands::QueryCommand that searches for gems starting
-# with the the supplied argument.
-
-class Gem::Commands::ListCommand < Gem::Commands::QueryCommand
-
- def initialize
- super 'list', 'Display gems whose name starts with STRING'
-
- remove_option('--name-matches')
- end
-
- def arguments # :nodoc:
- "STRING start of gem name to look for"
- end
-
- def defaults_str # :nodoc:
- "--local --no-details"
- end
-
- def usage # :nodoc:
- "#{program_name} [STRING]"
- end
-
- def execute
- string = get_one_optional_argument || ''
- options[:name] = /^#{string}/i
- super
- end
-
-end
-
diff --git a/lib/rubygems/commands/lock_command.rb b/lib/rubygems/commands/lock_command.rb
deleted file mode 100644
index 5a43978dd9..0000000000
--- a/lib/rubygems/commands/lock_command.rb
+++ /dev/null
@@ -1,110 +0,0 @@
-require 'rubygems/command'
-
-class Gem::Commands::LockCommand < Gem::Command
-
- def initialize
- super 'lock', 'Generate a lockdown list of gems',
- :strict => false
-
- add_option '-s', '--[no-]strict',
- 'fail if unable to satisfy a dependency' do |strict, options|
- options[:strict] = strict
- end
- end
-
- def arguments # :nodoc:
- "GEMNAME name of gem to lock\nVERSION version of gem to lock"
- end
-
- def defaults_str # :nodoc:
- "--no-strict"
- end
-
- def description # :nodoc:
- <<-EOF
-The lock command will generate a list of +gem+ statements that will lock down
-the versions for the gem given in the command line. It will specify exact
-versions in the requirements list to ensure that the gems loaded will always
-be consistent. A full recursive search of all effected gems will be
-generated.
-
-Example:
-
- gemlock rails-1.0.0 > lockdown.rb
-
-will produce in lockdown.rb:
-
- require "rubygems"
- gem 'rails', '= 1.0.0'
- gem 'rake', '= 0.7.0.1'
- gem 'activesupport', '= 1.2.5'
- gem 'activerecord', '= 1.13.2'
- gem 'actionpack', '= 1.11.2'
- gem 'actionmailer', '= 1.1.5'
- gem 'actionwebservice', '= 1.0.0'
-
-Just load lockdown.rb from your application to ensure that the current
-versions are loaded. Make sure that lockdown.rb is loaded *before* any
-other require statements.
-
-Notice that rails 1.0.0 only requires that rake 0.6.2 or better be used.
-Rake-0.7.0.1 is the most recent version installed that satisfies that, so we
-lock it down to the exact version.
- EOF
- end
-
- def usage # :nodoc:
- "#{program_name} GEMNAME-VERSION [GEMNAME-VERSION ...]"
- end
-
- def complain(message)
- if options[:strict] then
- raise Gem::Exception, message
- else
- say "# #{message}"
- end
- end
-
- def execute
- say "require 'rubygems'"
-
- locked = {}
-
- pending = options[:args]
-
- until pending.empty? do
- full_name = pending.shift
-
- spec = Gem::SourceIndex.load_specification spec_path(full_name)
-
- if spec.nil? then
- complain "Could not find gem #{full_name}, try using the full name"
- next
- end
-
- say "gem '#{spec.name}', '= #{spec.version}'" unless locked[spec.name]
- locked[spec.name] = true
-
- spec.runtime_dependencies.each do |dep|
- next if locked[dep.name]
- candidates = Gem.source_index.search dep
-
- if candidates.empty? then
- complain "Unable to satisfy '#{dep}' from currently installed gems"
- else
- pending << candidates.last.full_name
- end
- end
- end
- end
-
- def spec_path(gem_full_name)
- gemspecs = Gem.path.map do |path|
- File.join path, "specifications", "#{gem_full_name}.gemspec"
- end
-
- gemspecs.find { |gemspec| File.exist? gemspec }
- end
-
-end
-
diff --git a/lib/rubygems/commands/mirror_command.rb b/lib/rubygems/commands/mirror_command.rb
deleted file mode 100644
index 959b8eaec3..0000000000
--- a/lib/rubygems/commands/mirror_command.rb
+++ /dev/null
@@ -1,111 +0,0 @@
-require 'yaml'
-require 'zlib'
-
-require 'rubygems/command'
-require 'open-uri'
-
-class Gem::Commands::MirrorCommand < Gem::Command
-
- def initialize
- super 'mirror', 'Mirror a gem repository'
- end
-
- def description # :nodoc:
- <<-EOF
-The mirror command uses the ~/.gemmirrorrc config file to mirror remote gem
-repositories to a local path. The config file is a YAML document that looks
-like this:
-
- ---
- - from: http://gems.example.com # source repository URI
- to: /path/to/mirror # destination directory
-
-Multiple sources and destinations may be specified.
- EOF
- end
-
- def execute
- config_file = File.join Gem.user_home, '.gemmirrorrc'
-
- raise "Config file #{config_file} not found" unless File.exist? config_file
-
- mirrors = YAML.load_file config_file
-
- raise "Invalid config file #{config_file}" unless mirrors.respond_to? :each
-
- mirrors.each do |mir|
- raise "mirror missing 'from' field" unless mir.has_key? 'from'
- raise "mirror missing 'to' field" unless mir.has_key? 'to'
-
- get_from = mir['from']
- save_to = File.expand_path mir['to']
-
- raise "Directory not found: #{save_to}" unless File.exist? save_to
- raise "Not a directory: #{save_to}" unless File.directory? save_to
-
- gems_dir = File.join save_to, "gems"
-
- if File.exist? gems_dir then
- raise "Not a directory: #{gems_dir}" unless File.directory? gems_dir
- else
- Dir.mkdir gems_dir
- end
-
- sourceindex_data = ''
-
- say "fetching: #{get_from}/Marshal.#{Gem.marshal_version}.Z"
-
- get_from = URI.parse get_from
-
- if get_from.scheme.nil? then
- get_from = get_from.to_s
- elsif get_from.scheme == 'file' then
- # check if specified URI contains a drive letter (file:/D:/Temp)
- get_from = get_from.to_s
- get_from = if get_from =~ /^file:.*[a-z]:/i then
- get_from[6..-1]
- else
- get_from[5..-1]
- end
- end
-
- open File.join(get_from.to_s, "Marshal.#{Gem.marshal_version}.Z"), "rb" do |y|
- sourceindex_data = Zlib::Inflate.inflate y.read
- open File.join(save_to, "Marshal.#{Gem.marshal_version}"), "wb" do |out|
- out.write sourceindex_data
- end
- end
-
- sourceindex = Marshal.load(sourceindex_data)
-
- progress = ui.progress_reporter sourceindex.size,
- "Fetching #{sourceindex.size} gems"
- sourceindex.each do |fullname, gem|
- gem_file = "#{fullname}.gem"
- gem_dest = File.join gems_dir, gem_file
-
- unless File.exist? gem_dest then
- begin
- open "#{get_from}/gems/#{gem_file}", "rb" do |g|
- contents = g.read
- open gem_dest, "wb" do |out|
- out.write contents
- end
- end
- rescue
- old_gf = gem_file
- gem_file = gem_file.downcase
- retry if old_gf != gem_file
- alert_error $!
- end
- end
-
- progress.updated gem_file
- end
-
- progress.done
- end
- end
-
-end
-
diff --git a/lib/rubygems/commands/outdated_command.rb b/lib/rubygems/commands/outdated_command.rb
deleted file mode 100644
index 9e054f988c..0000000000
--- a/lib/rubygems/commands/outdated_command.rb
+++ /dev/null
@@ -1,33 +0,0 @@
-require 'rubygems/command'
-require 'rubygems/local_remote_options'
-require 'rubygems/spec_fetcher'
-require 'rubygems/version_option'
-
-class Gem::Commands::OutdatedCommand < Gem::Command
-
- include Gem::LocalRemoteOptions
- include Gem::VersionOption
-
- def initialize
- super 'outdated', 'Display all gems that need updates'
-
- add_local_remote_options
- add_platform_option
- end
-
- def execute
- locals = Gem::SourceIndex.from_installed_gems
-
- locals.outdated.sort.each do |name|
- local = locals.find_name(name).last
-
- dep = Gem::Dependency.new local.name, ">= #{local.version}"
- remotes = Gem::SpecFetcher.fetcher.fetch dep
- remote = remotes.last.first
-
- say "#{local.name} (#{local.version} < #{remote.version})"
- end
- end
-
-end
-
diff --git a/lib/rubygems/commands/pristine_command.rb b/lib/rubygems/commands/pristine_command.rb
deleted file mode 100644
index d47fe54edd..0000000000
--- a/lib/rubygems/commands/pristine_command.rb
+++ /dev/null
@@ -1,93 +0,0 @@
-require 'fileutils'
-require 'rubygems/command'
-require 'rubygems/format'
-require 'rubygems/installer'
-require 'rubygems/version_option'
-
-class Gem::Commands::PristineCommand < Gem::Command
-
- include Gem::VersionOption
-
- def initialize
- super 'pristine',
- 'Restores installed gems to pristine condition from files located in the gem cache',
- :version => Gem::Requirement.default
-
- add_option('--all',
- 'Restore all installed gems to pristine',
- 'condition') do |value, options|
- options[:all] = value
- end
-
- add_version_option('restore to', 'pristine condition')
- end
-
- def arguments # :nodoc:
- "GEMNAME gem to restore to pristine condition (unless --all)"
- end
-
- def defaults_str # :nodoc:
- "--all"
- end
-
- def description # :nodoc:
- <<-EOF
-The pristine command compares the installed gems with the contents of the
-cached gem and restores any files that don't match the cached gem's copy.
-
-If you have made modifications to your installed gems, the pristine command
-will revert them. After all the gem's files have been checked all bin stubs
-for the gem are regenerated.
-
-If the cached gem cannot be found, you will need to use `gem install` to
-revert the gem.
- EOF
- end
-
- def usage # :nodoc:
- "#{program_name} [args]"
- end
-
- def execute
- gem_name = nil
-
- specs = if options[:all] then
- Gem::SourceIndex.from_installed_gems.map do |name, spec|
- spec
- end
- else
- gem_name = get_one_gem_name
- Gem::SourceIndex.from_installed_gems.find_name(gem_name,
- options[:version])
- end
-
- if specs.empty? then
- raise Gem::Exception,
- "Failed to find gem #{gem_name} #{options[:version]}"
- end
-
- install_dir = Gem.dir # TODO use installer option
-
- raise Gem::FilePermissionError.new(install_dir) unless
- File.writable?(install_dir)
-
- say "Restoring gem(s) to pristine condition..."
-
- specs.each do |spec|
- gem = Dir[File.join(Gem.dir, 'cache', "#{spec.full_name}.gem")].first
-
- if gem.nil? then
- alert_error "Cached gem for #{spec.full_name} not found, use `gem install` to restore"
- next
- end
-
- # TODO use installer options
- installer = Gem::Installer.new gem, :wrappers => true, :force => true
- installer.install
-
- say "Restored #{spec.full_name}"
- end
- end
-
-end
-
diff --git a/lib/rubygems/commands/query_command.rb b/lib/rubygems/commands/query_command.rb
deleted file mode 100644
index 88f7f0b54e..0000000000
--- a/lib/rubygems/commands/query_command.rb
+++ /dev/null
@@ -1,264 +0,0 @@
-require 'rubygems/command'
-require 'rubygems/local_remote_options'
-require 'rubygems/spec_fetcher'
-require 'rubygems/version_option'
-require 'rubygems/text'
-
-class Gem::Commands::QueryCommand < Gem::Command
-
- include Gem::Text
- include Gem::LocalRemoteOptions
- include Gem::VersionOption
-
- def initialize(name = 'query',
- summary = 'Query gem information in local or remote repositories')
- super name, summary,
- :name => //, :domain => :local, :details => false, :versions => true,
- :installed => false, :version => Gem::Requirement.default
-
- add_option('-i', '--[no-]installed',
- 'Check for installed gem') do |value, options|
- options[:installed] = value
- end
-
- add_version_option
-
- add_option('-n', '--name-matches REGEXP',
- 'Name of gem(s) to query on matches the',
- 'provided REGEXP') do |value, options|
- options[:name] = /#{value}/i
- end
-
- add_option('-d', '--[no-]details',
- 'Display detailed information of gem(s)') do |value, options|
- options[:details] = value
- end
-
- add_option( '--[no-]versions',
- 'Display only gem names') do |value, options|
- options[:versions] = value
- options[:details] = false unless value
- end
-
- add_option('-a', '--all',
- 'Display all gem versions') do |value, options|
- options[:all] = value
- end
-
- add_option( '--prerelease',
- 'Display prerelease versions') do |value, options|
- options[:prerelease] = value
- end
-
- add_local_remote_options
- end
-
- def defaults_str # :nodoc:
- "--local --name-matches // --no-details --versions --no-installed"
- end
-
- def execute
- exit_code = 0
-
- name = options[:name]
- prerelease = options[:prerelease]
-
- if options[:installed] then
- if name.source.empty? then
- alert_error "You must specify a gem name"
- exit_code |= 4
- elsif installed? name, options[:version] then
- say "true"
- else
- say "false"
- exit_code |= 1
- end
-
- raise Gem::SystemExitException, exit_code
- end
-
- dep = Gem::Dependency.new name, Gem::Requirement.default
-
- if local? then
- if prerelease and not both? then
- alert_warning "prereleases are always shown locally"
- end
-
- if ui.outs.tty? or both? then
- say
- say "*** LOCAL GEMS ***"
- say
- end
-
- specs = Gem.source_index.search dep
-
- spec_tuples = specs.map do |spec|
- [[spec.name, spec.version, spec.original_platform, spec], :local]
- end
-
- output_query_results spec_tuples
- end
-
- if remote? then
- if ui.outs.tty? or both? then
- say
- say "*** REMOTE GEMS ***"
- say
- end
-
- all = options[:all]
-
- begin
- fetcher = Gem::SpecFetcher.fetcher
- spec_tuples = fetcher.find_matching dep, all, false, prerelease
- rescue Gem::RemoteFetcher::FetchError => e
- if prerelease then
- raise Gem::OperationNotSupportedError,
- "Prereleases not supported on legacy repositories"
- end
-
- raise unless fetcher.warn_legacy e do
- require 'rubygems/source_info_cache'
-
- dep.name = '' if dep.name == //
-
- specs = Gem::SourceInfoCache.search_with_source dep, false, all
-
- spec_tuples = specs.map do |spec, source_uri|
- [[spec.name, spec.version, spec.original_platform, spec],
- source_uri]
- end
- end
- end
-
- output_query_results spec_tuples
- end
- end
-
- private
-
- ##
- # Check if gem +name+ version +version+ is installed.
-
- def installed?(name, version = Gem::Requirement.default)
- dep = Gem::Dependency.new name, version
- !Gem.source_index.search(dep).empty?
- end
-
- def output_query_results(spec_tuples)
- output = []
- versions = Hash.new { |h,name| h[name] = [] }
-
- spec_tuples.each do |spec_tuple, source_uri|
- versions[spec_tuple.first] << [spec_tuple, source_uri]
- end
-
- versions = versions.sort_by do |(name,_),_|
- name.downcase
- end
-
- versions.each do |gem_name, matching_tuples|
- matching_tuples = matching_tuples.sort_by do |(name, version,_),_|
- version
- end.reverse
-
- platforms = Hash.new { |h,version| h[version] = [] }
-
- matching_tuples.map do |(name, version, platform,_),_|
- platforms[version] << platform if platform
- end
-
- seen = {}
-
- matching_tuples.delete_if do |(name, version,_),_|
- if seen[version] then
- true
- else
- seen[version] = true
- false
- end
- end
-
- entry = gem_name.dup
-
- if options[:versions] then
- versions = matching_tuples.map { |(name, version,_),_| version }.uniq
- entry << " (#{versions.join ', '})"
- end
-
- if options[:details] then
- detail_tuple = matching_tuples.first
-
- spec = if detail_tuple.first.length == 4 then
- detail_tuple.first.last
- else
- uri = URI.parse detail_tuple.last
- Gem::SpecFetcher.fetcher.fetch_spec detail_tuple.first, uri
- end
-
- entry << "\n"
-
- non_ruby = platforms.any? do |_, pls|
- pls.any? { |pl| pl != Gem::Platform::RUBY }
- end
-
- if non_ruby then
- if platforms.length == 1 then
- title = platforms.values.length == 1 ? 'Platform' : 'Platforms'
- entry << " #{title}: #{platforms.values.sort.join ', '}\n"
- else
- entry << " Platforms:\n"
- platforms.sort_by do |version,|
- version
- end.each do |version, pls|
- label = " #{version}: "
- data = format_text pls.sort.join(', '), 68, label.length
- data[0, label.length] = label
- entry << data << "\n"
- end
- end
- end
-
- authors = "Author#{spec.authors.length > 1 ? 's' : ''}: "
- authors << spec.authors.join(', ')
- entry << format_text(authors, 68, 4)
-
- if spec.rubyforge_project and not spec.rubyforge_project.empty? then
- rubyforge = "Rubyforge: http://rubyforge.org/projects/#{spec.rubyforge_project}"
- entry << "\n" << format_text(rubyforge, 68, 4)
- end
-
- if spec.homepage and not spec.homepage.empty? then
- entry << "\n" << format_text("Homepage: #{spec.homepage}", 68, 4)
- end
-
- if spec.license and not spec.license.empty? then
- licenses = "License#{spec.licenses.length > 1 ? 's' : ''}: "
- licenses << spec.licenses.join(', ')
- entry << "\n" << format_text(licenses, 68, 4)
- end
-
- if spec.loaded_from then
- if matching_tuples.length == 1 then
- loaded_from = File.dirname File.dirname(spec.loaded_from)
- entry << "\n" << " Installed at: #{loaded_from}"
- else
- label = 'Installed at'
- matching_tuples.each do |(_,version,_,s),|
- loaded_from = File.dirname File.dirname(s.loaded_from)
- entry << "\n" << " #{label} (#{version}): #{loaded_from}"
- label = ' ' * label.length
- end
- end
- end
-
- entry << "\n\n" << format_text(spec.summary, 68, 4)
- end
- output << entry
- end
-
- say output.join(options[:details] ? "\n\n" : "\n")
- end
-
-end
-
diff --git a/lib/rubygems/commands/rdoc_command.rb b/lib/rubygems/commands/rdoc_command.rb
deleted file mode 100644
index 92f215705a..0000000000
--- a/lib/rubygems/commands/rdoc_command.rb
+++ /dev/null
@@ -1,76 +0,0 @@
-require 'rubygems/command'
-require 'rubygems/version_option'
-require 'rubygems/doc_manager'
-
-class Gem::Commands::RdocCommand < Gem::Command
- include Gem::VersionOption
-
- def initialize
- super 'rdoc', 'Generates RDoc for pre-installed gems',
- :version => Gem::Requirement.default,
- :include_rdoc => true, :include_ri => true
-
- add_option('--all',
- 'Generate RDoc/RI documentation for all',
- 'installed gems') do |value, options|
- options[:all] = value
- end
-
- add_option('--[no-]rdoc',
- 'Include RDoc generated documents') do |value, options|
- options[:include_rdoc] = value
- end
-
- add_option('--[no-]ri',
- 'Include RI generated documents') do |value, options|
- options[:include_ri] = value
- end
-
- add_version_option
- end
-
- def arguments # :nodoc:
- "GEMNAME gem to generate documentation for (unless --all)"
- end
-
- def defaults_str # :nodoc:
- "--version '#{Gem::Requirement.default}' --rdoc --ri"
- end
-
- def usage # :nodoc:
- "#{program_name} [args]"
- end
-
- def execute
- if options[:all] then
- specs = Gem::SourceIndex.from_installed_gems.collect { |name, spec|
- spec
- }
- else
- gem_name = get_one_gem_name
- dep = Gem::Dependency.new gem_name, options[:version]
- specs = Gem::SourceIndex.from_installed_gems.search dep
- end
-
- if specs.empty?
- fail "Failed to find gem #{gem_name} to generate RDoc for #{options[:version]}"
- end
-
- if options[:include_ri]
- specs.each do |spec|
- Gem::DocManager.new(spec).generate_ri
- end
-
- Gem::DocManager.update_ri_cache
- end
-
- if options[:include_rdoc]
- specs.each do |spec|
- Gem::DocManager.new(spec).generate_rdoc
- end
- end
-
- true
- end
-end
-
diff --git a/lib/rubygems/commands/search_command.rb b/lib/rubygems/commands/search_command.rb
deleted file mode 100644
index 52e96fd1ef..0000000000
--- a/lib/rubygems/commands/search_command.rb
+++ /dev/null
@@ -1,31 +0,0 @@
-require 'rubygems/command'
-require 'rubygems/commands/query_command'
-
-class Gem::Commands::SearchCommand < Gem::Commands::QueryCommand
-
- def initialize
- super 'search', 'Display all gems whose name contains STRING'
-
- remove_option '--name-matches'
- end
-
- def arguments # :nodoc:
- "STRING fragment of gem name to search for"
- end
-
- def defaults_str # :nodoc:
- "--local --no-details"
- end
-
- def usage # :nodoc:
- "#{program_name} [STRING]"
- end
-
- def execute
- string = get_one_optional_argument
- options[:name] = /#{string}/i
- super
- end
-
-end
-
diff --git a/lib/rubygems/commands/server_command.rb b/lib/rubygems/commands/server_command.rb
deleted file mode 100644
index f8b990d304..0000000000
--- a/lib/rubygems/commands/server_command.rb
+++ /dev/null
@@ -1,70 +0,0 @@
-require 'rubygems/command'
-require 'rubygems/server'
-
-class Gem::Commands::ServerCommand < Gem::Command
-
- def initialize
- super 'server', 'Documentation and gem repository HTTP server',
- :port => 8808, :gemdir => Gem.dir, :daemon => false
-
- OptionParser.accept :Port do |port|
- if port =~ /\A\d+\z/ then
- port = Integer port
- raise OptionParser::InvalidArgument, "#{port}: not a port number" if
- port > 65535
-
- port
- else
- begin
- Socket.getservbyname port
- rescue SocketError => e
- raise OptionParser::InvalidArgument, "#{port}: no such named service"
- end
- end
- end
-
- add_option '-p', '--port=PORT', :Port,
- 'port to listen on' do |port, options|
- options[:port] = port
- end
-
- add_option '-d', '--dir=GEMDIR',
- 'directory from which to serve gems' do |gemdir, options|
- options[:gemdir] = File.expand_path gemdir
- end
-
- add_option '--[no-]daemon', 'run as a daemon' do |daemon, options|
- options[:daemon] = daemon
- end
- end
-
- def defaults_str # :nodoc:
- "--port 8808 --dir #{Gem.dir} --no-daemon"
- end
-
- def description # :nodoc:
- <<-EOF
-The server command starts up a web server that hosts the RDoc for your
-installed gems and can operate as a server for installation of gems on other
-machines.
-
-The cache files for installed gems must exist to use the server as a source
-for gem installation.
-
-To install gems from a running server, use `gem install GEMNAME --source
-http://gem_server_host:8808`
-
-You can set up a shortcut to gem server documentation using the URL:
-
- http://localhost:8808/rdoc?q=%s - Firefox
- http://localhost:8808/rdoc?q=* - LaunchBar
-
- EOF
- end
-
- def execute
- Gem::Server.run options
- end
-
-end
-
diff --git a/lib/rubygems/commands/setup_command.rb b/lib/rubygems/commands/setup_command.rb
deleted file mode 100644
index 3220a7497c..0000000000
--- a/lib/rubygems/commands/setup_command.rb
+++ /dev/null
@@ -1,353 +0,0 @@
-require 'rubygems/command'
-require 'fileutils'
-require 'rbconfig'
-require 'tmpdir'
-require 'pathname'
-
-##
-# Installs RubyGems itself. This command is ordinarily only available from a
-# RubyGems checkout or tarball.
-
-class Gem::Commands::SetupCommand < Gem::Command
-
- def initialize
- super 'setup', 'Install RubyGems',
- :format_executable => true, :rdoc => true, :ri => true,
- :site_or_vendor => :sitelibdir,
- :destdir => '', :prefix => ''
-
- add_option '--prefix=PREFIX',
- 'Prefix path for installing RubyGems',
- 'Will not affect gem repository location' do |prefix, options|
- options[:prefix] = File.expand_path prefix
- end
-
- add_option '--destdir=DESTDIR',
- 'Root directory to install RubyGems into',
- 'Mainly used for packaging RubyGems' do |destdir, options|
- options[:destdir] = File.expand_path destdir
- end
-
- add_option '--[no-]vendor',
- 'Install into vendorlibdir not sitelibdir',
- '(Requires Ruby 1.8.7)' do |vendor, options|
- if vendor and Gem.ruby_version < Gem::Version.new('1.8.7') then
- raise OptionParser::InvalidOption,
- "requires ruby 1.8.7+ (you have #{Gem.ruby_version})"
- end
-
- options[:site_or_vendor] = vendor ? :vendorlibdir : :sitelibdir
- end
-
- add_option '--[no-]format-executable',
- 'Makes `gem` match ruby',
- 'If ruby is ruby18, gem will be gem18' do |value, options|
- options[:format_executable] = value
- end
-
- add_option '--[no-]rdoc',
- 'Generate RDoc documentation for RubyGems' do |value, options|
- options[:rdoc] = value
- end
-
- add_option '--[no-]ri',
- 'Generate RI documentation for RubyGems' do |value, options|
- options[:ri] = value
- end
- end
-
- def check_ruby_version
- required_version = Gem::Requirement.new '>= 1.8.6'
-
- unless required_version.satisfied_by? Gem.ruby_version then
- alert_error "Expected Ruby version #{required_version}, is #{Gem.ruby_version}"
- terminate_interaction 1
- end
- end
-
- def defaults_str # :nodoc:
- "--format-executable --rdoc --ri"
- end
-
- def description # :nodoc:
- <<-EOF
-Installs RubyGems itself.
-
-RubyGems installs RDoc for itself in GEM_HOME. By default this is:
- #{Gem.dir}
-
-If you prefer a different directory, set the GEM_HOME environment variable.
-
-RubyGems will install the gem command with a name matching ruby's
-prefix and suffix. If ruby was installed as `ruby18`, gem will be
-installed as `gem18`.
-
-By default, this RubyGems will install gem as:
- #{Gem.default_exec_format % 'gem'}
- EOF
- end
-
- def execute
- install_destdir = options[:destdir]
-
- unless install_destdir.empty? then
- ENV['GEM_HOME'] ||= File.join(install_destdir,
- Gem.default_dir.gsub(/^[a-zA-Z]:/, ''))
- end
-
- check_ruby_version
-
- if Gem.configuration.really_verbose then
- extend FileUtils::Verbose
- else
- extend FileUtils
- end
-
- lib_dir, bin_dir = make_destination_dirs install_destdir
-
- install_lib lib_dir
-
- install_executables bin_dir
-
- remove_old_bin_files bin_dir
-
- remove_source_caches install_destdir
-
- install_rdoc
-
- say
- say "-" * 78
- say
-
- release_notes = File.join Dir.pwd, 'doc', 'release_notes',
- "rel_#{Gem::RubyGemsVersion.gsub '.', '_'}.rdoc"
-
- if File.exist? release_notes then
- say File.read(release_notes)
- else
- say "Oh-no! Unable to find release notes!"
- say "Looked in: #{release_notes}" if Gem.configuration.really_verbose
- end
-
- say
- say "-" * 78
- say
-
- say "RubyGems installed the following executables:"
- say @bin_file_names.map { |name| "\t#{name}\n" }
- say
-
- unless @bin_file_names.grep(/#{File::SEPARATOR}gem$/) then
- say "If `gem` was installed by a previous RubyGems installation, you may need"
- say "to remove it by hand."
- say
- end
- end
-
- def install_executables(bin_dir)
- say "Installing gem executable"
-
- @bin_file_names = []
-
- Dir.chdir 'bin' do
- bin_files = Dir['*']
-
- bin_files.delete 'update_rubygems'
-
- bin_files.each do |bin_file|
- bin_file_formatted = if options[:format_executable] then
- Gem.default_exec_format % bin_file
- else
- bin_file
- end
-
- dest_file = File.join bin_dir, bin_file_formatted
- bin_tmp_file = File.join Dir.tmpdir, bin_file
-
- begin
- bin = File.readlines bin_file
- bin[0] = "#!#{Gem.ruby}\n"
-
- File.open bin_tmp_file, 'w' do |fp|
- fp.puts bin.join
- end
-
- install bin_tmp_file, dest_file, :mode => 0755
- @bin_file_names << dest_file
- ensure
- rm bin_tmp_file
- end
-
- next unless Gem.win_platform?
-
- begin
- bin_cmd_file = File.join Dir.tmpdir, "#{bin_file}.bat"
-
- File.open bin_cmd_file, 'w' do |file|
- file.puts <<-TEXT
-@ECHO OFF
-IF NOT "%~f0" == "~f0" GOTO :WinNT
-@"#{File.basename(Gem.ruby).chomp('"')}" "#{dest_file}" %1 %2 %3 %4 %5 %6 %7 %8 %9
-GOTO :EOF
-:WinNT
-@"#{File.basename(Gem.ruby).chomp('"')}" "%~dpn0" %*
-TEXT
- end
-
- install bin_cmd_file, "#{dest_file}.bat", :mode => 0755
- ensure
- rm bin_cmd_file
- end
- end
- end
- end
-
- def install_lib(lib_dir)
- say "Installing RubyGems"
-
- Dir.chdir 'lib' do
- lib_files = Dir[File.join('**', '*rb')]
-
- lib_files.each do |lib_file|
- dest_file = File.join lib_dir, lib_file
- dest_dir = File.dirname dest_file
- mkdir_p dest_dir unless File.directory? dest_dir
-
- install lib_file, dest_file, :mode => 0644
- end
- end
- end
-
- def install_rdoc
- gem_doc_dir = File.join Gem.dir, 'doc'
- rubygems_name = "rubygems-#{Gem::RubyGemsVersion}"
- rubygems_doc_dir = File.join gem_doc_dir, rubygems_name
-
- if File.writable? gem_doc_dir and
- (not File.exist? rubygems_doc_dir or
- File.writable? rubygems_doc_dir) then
- say "Removing old RubyGems RDoc and ri"
- Dir[File.join(Gem.dir, 'doc', 'rubygems-[0-9]*')].each do |dir|
- rm_rf dir
- end
-
- if options[:ri] then
- ri_dir = File.join rubygems_doc_dir, 'ri'
- say "Installing #{rubygems_name} ri into #{ri_dir}"
- run_rdoc '--ri', '--op', ri_dir
- end
-
- if options[:rdoc] then
- rdoc_dir = File.join rubygems_doc_dir, 'rdoc'
- say "Installing #{rubygems_name} rdoc into #{rdoc_dir}"
- run_rdoc '--op', rdoc_dir
- end
- else
- say "Skipping RDoc generation, #{gem_doc_dir} not writable"
- say "Set the GEM_HOME environment variable if you want RDoc generated"
- end
- end
-
- def make_destination_dirs(install_destdir)
- lib_dir = nil
- bin_dir = nil
-
- prefix = options[:prefix]
- site_or_vendor = options[:site_or_vendor]
-
- if prefix.empty? then
- lib_dir = Gem::ConfigMap[site_or_vendor]
- bin_dir = Gem::ConfigMap[:bindir]
- else
- # Apple installed RubyGems into libdir, and RubyGems <= 1.1.0 gets
- # confused about installation location, so switch back to
- # sitelibdir/vendorlibdir.
- if defined?(APPLE_GEM_HOME) and
- # just in case Apple and RubyGems don't get this patched up proper.
- (prefix == Gem::ConfigMap[:libdir] or
- # this one is important
- prefix == File.join(Gem::ConfigMap[:libdir], 'ruby')) then
- lib_dir = Gem::ConfigMap[site_or_vendor]
- bin_dir = Gem::ConfigMap[:bindir]
- else
- lib_dir = File.join prefix, 'lib'
- bin_dir = File.join prefix, 'bin'
- end
- end
-
- unless install_destdir.empty? then
- lib_dir = File.join install_destdir, lib_dir.gsub(/^[a-zA-Z]:/, '')
- bin_dir = File.join install_destdir, bin_dir.gsub(/^[a-zA-Z]:/, '')
- end
-
- mkdir_p lib_dir
- mkdir_p bin_dir
-
- return lib_dir, bin_dir
- end
-
- def remove_old_bin_files(bin_dir)
- old_bin_files = {
- 'gem_mirror' => 'gem mirror',
- 'gem_server' => 'gem server',
- 'gemlock' => 'gem lock',
- 'gemri' => 'ri',
- 'gemwhich' => 'gem which',
- 'index_gem_repository.rb' => 'gem generate_index',
- }
-
- old_bin_files.each do |old_bin_file, new_name|
- old_bin_path = File.join bin_dir, old_bin_file
- next unless File.exist? old_bin_path
-
- deprecation_message = "`#{old_bin_file}` has been deprecated. Use `#{new_name}` instead."
-
- File.open old_bin_path, 'w' do |fp|
- fp.write <<-EOF
-#!#{Gem.ruby}
-
-abort "#{deprecation_message}"
- EOF
- end
-
- next unless Gem.win_platform?
-
- File.open "#{old_bin_path}.bat", 'w' do |fp|
- fp.puts %{@ECHO.#{deprecation_message}}
- end
- end
- end
-
- def remove_source_caches(install_destdir)
- if install_destdir.empty?
- require 'rubygems/source_info_cache'
-
- user_cache_file = File.join(install_destdir,
- Gem::SourceInfoCache.user_cache_file)
- system_cache_file = File.join(install_destdir,
- Gem::SourceInfoCache.system_cache_file)
-
- say "Removing old source_cache files"
- rm_f user_cache_file if File.writable? File.dirname(user_cache_file)
- rm_f system_cache_file if File.writable? File.dirname(system_cache_file)
- end
- end
-
- def run_rdoc(*args)
- begin
- gem 'rdoc'
- rescue Gem::LoadError
- end
-
- require 'rdoc/rdoc'
-
- args << '--quiet'
- args << '--main' << 'README'
- args << '.' << 'README' << 'LICENSE.txt' << 'GPL.txt'
-
- r = RDoc::RDoc.new
- r.document args
- end
-
-end
-
diff --git a/lib/rubygems/commands/sources_command.rb b/lib/rubygems/commands/sources_command.rb
deleted file mode 100644
index 245ab91c9f..0000000000
--- a/lib/rubygems/commands/sources_command.rb
+++ /dev/null
@@ -1,157 +0,0 @@
-require 'fileutils'
-require 'rubygems/command'
-require 'rubygems/remote_fetcher'
-require 'rubygems/source_info_cache'
-require 'rubygems/spec_fetcher'
-require 'rubygems/local_remote_options'
-
-class Gem::Commands::SourcesCommand < Gem::Command
-
- include Gem::LocalRemoteOptions
-
- def initialize
- super 'sources',
- 'Manage the sources and cache file RubyGems uses to search for gems'
-
- add_option '-a', '--add SOURCE_URI', 'Add source' do |value, options|
- options[:add] = value
- end
-
- add_option '-l', '--list', 'List sources' do |value, options|
- options[:list] = value
- end
-
- add_option '-r', '--remove SOURCE_URI', 'Remove source' do |value, options|
- options[:remove] = value
- end
-
- add_option '-c', '--clear-all',
- 'Remove all sources (clear the cache)' do |value, options|
- options[:clear_all] = value
- end
-
- add_option '-u', '--update', 'Update source cache' do |value, options|
- options[:update] = value
- end
-
- add_proxy_option
- end
-
- def defaults_str
- '--list'
- end
-
- def execute
- options[:list] = !(options[:add] ||
- options[:clear_all] ||
- options[:remove] ||
- options[:update])
-
- if options[:clear_all] then
- path = Gem::SpecFetcher.fetcher.dir
- FileUtils.rm_rf path
-
- if not File.exist?(path) then
- say "*** Removed specs cache ***"
- elsif not File.writable?(path) then
- say "*** Unable to remove source cache (write protected) ***"
- else
- say "*** Unable to remove source cache ***"
- end
-
- sic = Gem::SourceInfoCache
- remove_cache_file 'user', sic.user_cache_file
- remove_cache_file 'latest user', sic.latest_user_cache_file
- remove_cache_file 'system', sic.system_cache_file
- remove_cache_file 'latest system', sic.latest_system_cache_file
- end
-
- if options[:add] then
- source_uri = options[:add]
- uri = URI.parse source_uri
-
- begin
- Gem::SpecFetcher.fetcher.load_specs uri, 'specs'
- Gem.sources << source_uri
- Gem.configuration.write
-
- say "#{source_uri} added to sources"
- rescue URI::Error, ArgumentError
- say "#{source_uri} is not a URI"
- rescue Gem::RemoteFetcher::FetchError => e
- yaml_uri = uri + 'yaml'
- gem_repo = Gem::RemoteFetcher.fetcher.fetch_size yaml_uri rescue false
-
- if e.uri =~ /specs\.#{Regexp.escape Gem.marshal_version}\.gz$/ and
- gem_repo then
-
- alert_warning <<-EOF
-RubyGems 1.2+ index not found for:
-\t#{source_uri}
-
-Will cause RubyGems to revert to legacy indexes, degrading performance.
- EOF
-
- say "#{source_uri} added to sources"
- else
- say "Error fetching #{source_uri}:\n\t#{e.message}"
- end
- end
- end
-
- if options[:remove] then
- source_uri = options[:remove]
-
- unless Gem.sources.include? source_uri then
- say "source #{source_uri} not present in cache"
- else
- Gem.sources.delete source_uri
- Gem.configuration.write
-
- say "#{source_uri} removed from sources"
- end
- end
-
- if options[:update] then
- fetcher = Gem::SpecFetcher.fetcher
-
- if fetcher.legacy_repos.empty? then
- Gem.sources.each do |update_uri|
- update_uri = URI.parse update_uri
- fetcher.load_specs update_uri, 'specs'
- fetcher.load_specs update_uri, 'latest_specs'
- end
- else
- Gem::SourceInfoCache.cache true
- Gem::SourceInfoCache.cache.flush
- end
-
- say "source cache successfully updated"
- end
-
- if options[:list] then
- say "*** CURRENT SOURCES ***"
- say
-
- Gem.sources.each do |source|
- say source
- end
- end
- end
-
- private
-
- def remove_cache_file(desc, path)
- FileUtils.rm_rf path
-
- if not File.exist?(path) then
- say "*** Removed #{desc} source cache ***"
- elsif not File.writable?(path) then
- say "*** Unable to remove #{desc} source cache (write protected) ***"
- else
- say "*** Unable to remove #{desc} source cache ***"
- end
- end
-
-end
-
diff --git a/lib/rubygems/commands/specification_command.rb b/lib/rubygems/commands/specification_command.rb
deleted file mode 100644
index 07d2c2cf0d..0000000000
--- a/lib/rubygems/commands/specification_command.rb
+++ /dev/null
@@ -1,124 +0,0 @@
-require 'yaml'
-require 'rubygems/command'
-require 'rubygems/local_remote_options'
-require 'rubygems/version_option'
-require 'rubygems/source_info_cache'
-require 'rubygems/format'
-
-class Gem::Commands::SpecificationCommand < Gem::Command
-
- include Gem::LocalRemoteOptions
- include Gem::VersionOption
-
- def initialize
- super 'specification', 'Display gem specification (in yaml)',
- :domain => :local, :version => Gem::Requirement.default,
- :format => :yaml
-
- add_version_option('examine')
- add_platform_option
-
- add_option('--all', 'Output specifications for all versions of',
- 'the gem') do |value, options|
- options[:all] = true
- end
-
- add_option('--ruby', 'Output ruby format') do |value, options|
- options[:format] = :ruby
- end
-
- add_option('--yaml', 'Output RUBY format') do |value, options|
- options[:format] = :yaml
- end
-
- add_option('--marshal', 'Output Marshal format') do |value, options|
- options[:format] = :marshal
- end
-
- add_local_remote_options
- end
-
- def arguments # :nodoc:
- <<-ARGS
-GEMFILE name of gem to show the gemspec for
-FIELD name of gemspec field to show
- ARGS
- end
-
- def defaults_str # :nodoc:
- "--local --version '#{Gem::Requirement.default}' --yaml"
- end
-
- def usage # :nodoc:
- "#{program_name} [GEMFILE] [FIELD]"
- end
-
- def execute
- specs = []
- gem = options[:args].shift
-
- unless gem then
- raise Gem::CommandLineError,
- "Please specify a gem name or file on the command line"
- end
-
- dep = Gem::Dependency.new gem, options[:version]
-
- field = get_one_optional_argument
-
- if field then
- field = field.intern
-
- if options[:format] == :ruby then
- raise Gem::CommandLineError, "--ruby and FIELD are mutually exclusive"
- end
-
- unless Gem::Specification.attribute_names.include? field then
- raise Gem::CommandLineError,
- "no field %p on Gem::Specification" % field.to_s
- end
- end
-
- if local? then
- if File.exist? gem then
- specs << Gem::Format.from_file_by_path(gem).spec rescue nil
- end
-
- if specs.empty? then
- specs.push(*Gem.source_index.search(dep))
- end
- end
-
- if remote? then
- found = Gem::SpecFetcher.fetcher.fetch dep
-
- specs.push(*found.map { |spec,| spec })
- end
-
- if specs.empty? then
- alert_error "Unknown gem '#{gem}'"
- terminate_interaction 1
- end
-
- output = lambda do |s|
- s = s.send field if field
-
- say case options[:format]
- when :ruby then s.to_ruby
- when :marshal then Marshal.dump s
- else s.to_yaml
- end
-
- say "\n"
- end
-
- if options[:all] then
- specs.each(&output)
- else
- spec = specs.sort_by { |s| s.version }.last
- output[spec]
- end
- end
-
-end
-
diff --git a/lib/rubygems/commands/stale_command.rb b/lib/rubygems/commands/stale_command.rb
deleted file mode 100644
index 78cbdcc00a..0000000000
--- a/lib/rubygems/commands/stale_command.rb
+++ /dev/null
@@ -1,27 +0,0 @@
-require 'rubygems/command'
-
-class Gem::Commands::StaleCommand < Gem::Command
- def initialize
- super('stale', 'List gems along with access times')
- end
-
- def usage # :nodoc:
- "#{program_name}"
- end
-
- def execute
- gem_to_atime = {}
- Gem.source_index.each do |name, spec|
- Dir["#{spec.full_gem_path}/**/*.*"].each do |file|
- next if File.directory?(file)
- stat = File.stat(file)
- gem_to_atime[name] ||= stat.atime
- gem_to_atime[name] = stat.atime if gem_to_atime[name] < stat.atime
- end
- end
-
- gem_to_atime.sort_by { |_, atime| atime }.each do |name, atime|
- say "#{name} at #{atime.strftime '%c'}"
- end
- end
-end
diff --git a/lib/rubygems/commands/uninstall_command.rb b/lib/rubygems/commands/uninstall_command.rb
deleted file mode 100644
index db6aeed022..0000000000
--- a/lib/rubygems/commands/uninstall_command.rb
+++ /dev/null
@@ -1,83 +0,0 @@
-require 'rubygems/command'
-require 'rubygems/version_option'
-require 'rubygems/uninstaller'
-
-##
-# Gem uninstaller command line tool
-#
-# See `gem help uninstall`
-
-class Gem::Commands::UninstallCommand < Gem::Command
-
- include Gem::VersionOption
-
- def initialize
- super 'uninstall', 'Uninstall gems from the local repository',
- :version => Gem::Requirement.default, :user_install => true
-
- add_option('-a', '--[no-]all',
- 'Uninstall all matching versions'
- ) do |value, options|
- options[:all] = value
- end
-
- add_option('-I', '--[no-]ignore-dependencies',
- 'Ignore dependency requirements while',
- 'uninstalling') do |value, options|
- options[:ignore] = value
- end
-
- add_option('-x', '--[no-]executables',
- 'Uninstall applicable executables without',
- 'confirmation') do |value, options|
- options[:executables] = value
- end
-
- add_option('-i', '--install-dir DIR',
- 'Directory to uninstall gem from') do |value, options|
- options[:install_dir] = File.expand_path(value)
- end
-
- add_option('-n', '--bindir DIR',
- 'Directory to remove binaries from') do |value, options|
- options[:bin_dir] = File.expand_path(value)
- end
-
- add_option('--[no-]user-install',
- 'Uninstall from user\'s home directory',
- 'in addition to GEM_HOME.') do |value, options|
- options[:user_install] = value
- end
-
- add_version_option
- add_platform_option
- end
-
- def arguments # :nodoc:
- "GEMNAME name of gem to uninstall"
- end
-
- def defaults_str # :nodoc:
- "--version '#{Gem::Requirement.default}' --no-force " \
- "--install-dir #{Gem.dir}\n" \
- "--user-install"
- end
-
- def usage # :nodoc:
- "#{program_name} GEMNAME [GEMNAME ...]"
- end
-
- def execute
- get_all_gem_names.each do |gem_name|
- begin
- Gem::Uninstaller.new(gem_name, options).uninstall
- rescue Gem::GemNotInHomeException => e
- spec = e.spec
- alert("In order to remove #{spec.name}, please execute:\n" \
- "\tgem uninstall #{spec.name} --install-dir=#{spec.installation_path}")
- end
- end
- end
-
-end
-
diff --git a/lib/rubygems/commands/unpack_command.rb b/lib/rubygems/commands/unpack_command.rb
deleted file mode 100644
index 075dc04203..0000000000
--- a/lib/rubygems/commands/unpack_command.rb
+++ /dev/null
@@ -1,97 +0,0 @@
-require 'fileutils'
-require 'rubygems/command'
-require 'rubygems/installer'
-require 'rubygems/version_option'
-
-class Gem::Commands::UnpackCommand < Gem::Command
-
- include Gem::VersionOption
-
- def initialize
- super 'unpack', 'Unpack an installed gem to the current directory',
- :version => Gem::Requirement.default,
- :target => Dir.pwd
-
- add_option('--target=DIR', 'target directory for unpacking') do |value, options|
- options[:target] = value
- end
-
- add_version_option
- end
-
- def arguments # :nodoc:
- "GEMNAME name of gem to unpack"
- end
-
- def defaults_str # :nodoc:
- "--version '#{Gem::Requirement.default}'"
- end
-
- def usage # :nodoc:
- "#{program_name} GEMNAME"
- end
-
- #--
- # TODO: allow, e.g., 'gem unpack rake-0.3.1'. Find a general solution for
- # this, so that it works for uninstall as well. (And check other commands
- # at the same time.)
-
- def execute
- get_all_gem_names.each do |name|
- path = get_path name, options[:version]
-
- if path then
- basename = File.basename(path).sub(/\.gem$/, '')
- target_dir = File.expand_path File.join(options[:target], basename)
- FileUtils.mkdir_p target_dir
- Gem::Installer.new(path, :unpack => true).unpack target_dir
- say "Unpacked gem: '#{target_dir}'"
- else
- alert_error "Gem '#{name}' not installed."
- end
- end
- end
-
- # Return the full path to the cached gem file matching the given
- # name and version requirement. Returns 'nil' if no match.
- #
- # Example:
- #
- # get_path('rake', '> 0.4') # -> '/usr/lib/ruby/gems/1.8/cache/rake-0.4.2.gem'
- # get_path('rake', '< 0.1') # -> nil
- # get_path('rak') # -> nil (exact name required)
- #--
- # TODO: This should be refactored so that it's a general service. I don't
- # think any of our existing classes are the right place though. Just maybe
- # 'Cache'?
- #
- # TODO: It just uses Gem.dir for now. What's an easy way to get the list of
- # source directories?
- def get_path(gemname, version_req)
- return gemname if gemname =~ /\.gem$/i
-
- specs = Gem::source_index.find_name gemname, version_req
-
- selected = specs.sort_by { |s| s.version }.last
-
- return nil if selected.nil?
-
- # We expect to find (basename).gem in the 'cache' directory.
- # Furthermore, the name match must be exact (ignoring case).
- if gemname =~ /^#{selected.name}$/i
- filename = selected.full_name + '.gem'
- path = nil
-
- Gem.path.find do |gem_dir|
- path = File.join gem_dir, 'cache', filename
- File.exist? path
- end
-
- path
- else
- nil
- end
- end
-
-end
-
diff --git a/lib/rubygems/commands/update_command.rb b/lib/rubygems/commands/update_command.rb
deleted file mode 100644
index 9974b2b54b..0000000000
--- a/lib/rubygems/commands/update_command.rb
+++ /dev/null
@@ -1,202 +0,0 @@
-require 'rubygems/command'
-require 'rubygems/command_manager'
-require 'rubygems/install_update_options'
-require 'rubygems/local_remote_options'
-require 'rubygems/spec_fetcher'
-require 'rubygems/version_option'
-require 'rubygems/commands/install_command'
-
-class Gem::Commands::UpdateCommand < Gem::Command
-
- include Gem::InstallUpdateOptions
- include Gem::LocalRemoteOptions
- include Gem::VersionOption
-
- def initialize
- super 'update',
- 'Update the named gems (or all installed gems) in the local repository',
- :generate_rdoc => true,
- :generate_ri => true,
- :force => false,
- :test => false
-
- add_install_update_options
-
- add_option('--system',
- 'Update the RubyGems system software') do |value, options|
- options[:system] = value
- end
-
- add_local_remote_options
-
- add_platform_option
- end
-
- def arguments # :nodoc:
- "GEMNAME name of gem to update"
- end
-
- def defaults_str # :nodoc:
- "--rdoc --ri --no-force --no-test --install-dir #{Gem.dir}"
- end
-
- def usage # :nodoc:
- "#{program_name} GEMNAME [GEMNAME ...]"
- end
-
- def execute
- hig = {}
-
- if options[:system] then
- say "Updating RubyGems"
-
- unless options[:args].empty? then
- fail "No gem names are allowed with the --system option"
- end
-
- rubygems_update = Gem::Specification.new
- rubygems_update.name = 'rubygems-update'
- rubygems_update.version = Gem::Version.new Gem::RubyGemsVersion
- hig['rubygems-update'] = rubygems_update
-
- options[:user_install] = false
- else
- say "Updating installed gems"
-
- hig = {} # highest installed gems
-
- Gem.source_index.each do |name, spec|
- if hig[spec.name].nil? or hig[spec.name].version < spec.version then
- hig[spec.name] = spec
- end
- end
- end
-
- gems_to_update = which_to_update hig, options[:args]
-
- updated = []
-
- installer = Gem::DependencyInstaller.new options
-
- gems_to_update.uniq.sort.each do |name|
- next if updated.any? { |spec| spec.name == name }
- success = false
-
- say "Updating #{name}"
- begin
- installer.install name
- success = true
- rescue Gem::InstallError => e
- alert_error "Error installing #{name}:\n\t#{e.message}"
- success = false
- end
-
- installer.installed_gems.each do |spec|
- updated << spec
- say "Successfully installed #{spec.full_name}" if success
- end
- end
-
- if gems_to_update.include? "rubygems-update" then
- Gem.source_index.refresh!
-
- update_gems = Gem.source_index.find_name 'rubygems-update'
-
- latest_update_gem = update_gems.sort_by { |s| s.version }.last
-
- say "Updating RubyGems to #{latest_update_gem.version}"
- installed = do_rubygems_update latest_update_gem.version
-
- say "RubyGems system software updated" if installed
- else
- if updated.empty? then
- say "Nothing to update"
- else
- say "Gems updated: #{updated.map { |spec| spec.name }.join ', '}"
-
- if options[:generate_ri] then
- updated.each do |gem|
- Gem::DocManager.new(gem, options[:rdoc_args]).generate_ri
- end
-
- Gem::DocManager.update_ri_cache
- end
-
- if options[:generate_rdoc] then
- updated.each do |gem|
- Gem::DocManager.new(gem, options[:rdoc_args]).generate_rdoc
- end
- end
- end
- end
- end
-
- ##
- # Update the RubyGems software to +version+.
-
- def do_rubygems_update(version)
- args = []
- args.push '--prefix', Gem.prefix unless Gem.prefix.nil?
- args << '--no-rdoc' unless options[:generate_rdoc]
- args << '--no-ri' unless options[:generate_ri]
- args << '--no-format-executable' if options[:no_format_executable]
-
- update_dir = File.join Gem.dir, 'gems', "rubygems-update-#{version}"
-
- Dir.chdir update_dir do
- say "Installing RubyGems #{version}"
- setup_cmd = "#{Gem.ruby} setup.rb #{args.join ' '}"
-
- # Make sure old rubygems isn't loaded
- old = ENV["RUBYOPT"]
- ENV.delete("RUBYOPT")
- system setup_cmd
- ENV["RUBYOPT"] = old if old
- end
- end
-
- def which_to_update(highest_installed_gems, gem_names)
- result = []
-
- highest_installed_gems.each do |l_name, l_spec|
- next if not gem_names.empty? and
- gem_names.all? { |name| /#{name}/ !~ l_spec.name }
-
- dependency = Gem::Dependency.new l_spec.name, "> #{l_spec.version}"
-
- begin
- fetcher = Gem::SpecFetcher.fetcher
- spec_tuples = fetcher.find_matching dependency
- rescue Gem::RemoteFetcher::FetchError => e
- raise unless fetcher.warn_legacy e do
- require 'rubygems/source_info_cache'
-
- dependency.name = '' if dependency.name == //
-
- specs = Gem::SourceInfoCache.search_with_source dependency
-
- spec_tuples = specs.map do |spec, source_uri|
- [[spec.name, spec.version, spec.original_platform], source_uri]
- end
- end
- end
-
- matching_gems = spec_tuples.select do |(name, version, platform),|
- name == l_name and Gem::Platform.match platform
- end
-
- highest_remote_gem = matching_gems.sort_by do |(name, version),|
- version
- end.last
-
- if highest_remote_gem and
- l_spec.version < highest_remote_gem.first[1] then
- result << l_name
- end
- end
-
- result
- end
-
-end
-
diff --git a/lib/rubygems/commands/which_command.rb b/lib/rubygems/commands/which_command.rb
deleted file mode 100644
index 7c2d188324..0000000000
--- a/lib/rubygems/commands/which_command.rb
+++ /dev/null
@@ -1,87 +0,0 @@
-require 'rubygems/command'
-require 'rubygems/gem_path_searcher'
-
-class Gem::Commands::WhichCommand < Gem::Command
-
- EXT = %w[.rb .rbw .so .dll .bundle] # HACK
-
- def initialize
- super 'which', 'Find the location of a library file you can require',
- :search_gems_first => false, :show_all => false
-
- add_option '-a', '--[no-]all', 'show all matching files' do |show_all, options|
- options[:show_all] = show_all
- end
-
- add_option '-g', '--[no-]gems-first',
- 'search gems before non-gems' do |gems_first, options|
- options[:search_gems_first] = gems_first
- end
- end
-
- def arguments # :nodoc:
- "FILE name of file to find"
- end
-
- def defaults_str # :nodoc:
- "--no-gems-first --no-all"
- end
-
- def usage # :nodoc:
- "#{program_name} FILE [FILE ...]"
- end
-
- def execute
- searcher = Gem::GemPathSearcher.new
-
- options[:args].each do |arg|
- dirs = $LOAD_PATH
- spec = searcher.find arg
-
- if spec then
- if options[:search_gems_first] then
- dirs = gem_paths(spec) + $LOAD_PATH
- else
- dirs = $LOAD_PATH + gem_paths(spec)
- end
-
- say "(checking gem #{spec.full_name} for #{arg})" if
- Gem.configuration.verbose and $stdout.tty?
- end
-
- paths = find_paths arg, dirs
-
- if paths.empty? then
- say "Can't find ruby library file or shared library #{arg}"
- else
- say paths
- end
- end
- end
-
- def find_paths(package_name, dirs)
- result = []
-
- dirs.each do |dir|
- EXT.each do |ext|
- full_path = File.join dir, "#{package_name}#{ext}"
- if File.exist? full_path then
- result << full_path
- return result unless options[:show_all]
- end
- end
- end
-
- result
- end
-
- def gem_paths(spec)
- spec.require_paths.collect { |d| File.join spec.full_gem_path, d }
- end
-
- def usage # :nodoc:
- "#{program_name} FILE [...]"
- end
-
-end
-
diff --git a/lib/rubygems/config_file.rb b/lib/rubygems/config_file.rb
deleted file mode 100644
index 3562805c62..0000000000
--- a/lib/rubygems/config_file.rb
+++ /dev/null
@@ -1,266 +0,0 @@
-#--
-# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
-# All rights reserved.
-# See LICENSE.txt for permissions.
-#++
-
-require 'yaml'
-
-# Store the gem command options specified in the configuration file. The
-# config file object acts much like a hash.
-
-class Gem::ConfigFile
-
- DEFAULT_BACKTRACE = false
- DEFAULT_BENCHMARK = false
- DEFAULT_BULK_THRESHOLD = 1000
- DEFAULT_VERBOSITY = true
- DEFAULT_UPDATE_SOURCES = true
-
- ##
- # For Ruby packagers to set configuration defaults. Set in
- # rubygems/defaults/operating_system.rb
-
- OPERATING_SYSTEM_DEFAULTS = {}
-
- ##
- # For Ruby implementers to set configuration defaults. Set in
- # rubygems/defaults/#{RUBY_ENGINE}.rb
-
- PLATFORM_DEFAULTS = {}
-
- system_config_path =
- begin
- require 'Win32API'
-
- CSIDL_COMMON_APPDATA = 0x0023
- path = 0.chr * 260
- SHGetFolderPath = Win32API.new 'shell32', 'SHGetFolderPath', 'PLPLP', 'L',
- :stdcall
- SHGetFolderPath.call nil, CSIDL_COMMON_APPDATA, nil, 1, path
-
- path.strip
- rescue LoadError
- '/etc'
- end
-
- SYSTEM_WIDE_CONFIG_FILE = File.join system_config_path, 'gemrc'
-
- # List of arguments supplied to the config file object.
- attr_reader :args
-
- # Where to look for gems
- attr_accessor :path
-
- attr_accessor :home
-
- # True if we print backtraces on errors.
- attr_writer :backtrace
-
- # True if we are benchmarking this run.
- attr_accessor :benchmark
-
- # Bulk threshold value. If the number of missing gems are above
- # this threshold value, then a bulk download technique is used.
- attr_accessor :bulk_threshold
-
- # Verbose level of output:
- # * false -- No output
- # * true -- Normal output
- # * :loud -- Extra output
- attr_accessor :verbose
-
- # True if we want to update the SourceInfoCache every time, false otherwise
- attr_accessor :update_sources
-
- # Create the config file object. +args+ is the list of arguments
- # from the command line.
- #
- # The following command line options are handled early here rather
- # than later at the time most command options are processed.
- #
- # * --config-file and --config-file==NAME -- Obviously these need
- # to be handled by the ConfigFile object to ensure we get the
- # right config file.
- #
- # * --backtrace -- Backtrace needs to be turned on early so that
- # errors before normal option parsing can be properly handled.
- #
- # * --debug -- Enable Ruby level debug messages. Handled early
- # for the same reason as --backtrace.
- #
- def initialize(arg_list)
- @config_file_name = nil
- need_config_file_name = false
-
- arg_list = arg_list.map do |arg|
- if need_config_file_name then
- @config_file_name = arg
- need_config_file_name = false
- nil
- elsif arg =~ /^--config-file=(.*)/ then
- @config_file_name = $1
- nil
- elsif arg =~ /^--config-file$/ then
- need_config_file_name = true
- nil
- else
- arg
- end
- end.compact
-
- @backtrace = DEFAULT_BACKTRACE
- @benchmark = DEFAULT_BENCHMARK
- @bulk_threshold = DEFAULT_BULK_THRESHOLD
- @verbose = DEFAULT_VERBOSITY
- @update_sources = DEFAULT_UPDATE_SOURCES
-
- operating_system_config = Marshal.load Marshal.dump(OPERATING_SYSTEM_DEFAULTS)
- platform_config = Marshal.load Marshal.dump(PLATFORM_DEFAULTS)
- system_config = load_file SYSTEM_WIDE_CONFIG_FILE
- user_config = load_file config_file_name.dup.untaint
-
- @hash = operating_system_config.merge platform_config
- @hash = @hash.merge system_config
- @hash = @hash.merge user_config
-
- # HACK these override command-line args, which is bad
- @backtrace = @hash[:backtrace] if @hash.key? :backtrace
- @benchmark = @hash[:benchmark] if @hash.key? :benchmark
- @bulk_threshold = @hash[:bulk_threshold] if @hash.key? :bulk_threshold
- Gem.sources = @hash[:sources] if @hash.key? :sources
- @verbose = @hash[:verbose] if @hash.key? :verbose
- @update_sources = @hash[:update_sources] if @hash.key? :update_sources
- @path = @hash[:gempath] if @hash.key? :gempath
- @home = @hash[:gemhome] if @hash.key? :gemhome
-
- handle_arguments arg_list
- end
-
- def load_file(filename)
- begin
- YAML.load(File.read(filename)) if filename and File.exist?(filename)
- rescue ArgumentError
- warn "Failed to load #{config_file_name}"
- rescue Errno::EACCES
- warn "Failed to load #{config_file_name} due to permissions problem."
- end or {}
- end
-
- # True if the backtrace option has been specified, or debug is on.
- def backtrace
- @backtrace or $DEBUG
- end
-
- # The name of the configuration file.
- def config_file_name
- @config_file_name || Gem.config_file
- end
-
- # Delegates to @hash
- def each(&block)
- hash = @hash.dup
- hash.delete :update_sources
- hash.delete :verbose
- hash.delete :benchmark
- hash.delete :backtrace
- hash.delete :bulk_threshold
-
- yield :update_sources, @update_sources
- yield :verbose, @verbose
- yield :benchmark, @benchmark
- yield :backtrace, @backtrace
- yield :bulk_threshold, @bulk_threshold
-
- yield 'config_file_name', @config_file_name if @config_file_name
-
- hash.each(&block)
- end
-
- # Handle the command arguments.
- def handle_arguments(arg_list)
- @args = []
-
- arg_list.each do |arg|
- case arg
- when /^--(backtrace|traceback)$/ then
- @backtrace = true
- when /^--bench(mark)?$/ then
- @benchmark = true
- when /^--debug$/ then
- $DEBUG = true
- else
- @args << arg
- end
- end
- end
-
- # Really verbose mode gives you extra output.
- def really_verbose
- case verbose
- when true, false, nil then false
- else true
- end
- end
-
- # to_yaml only overwrites things you can't override on the command line.
- def to_yaml # :nodoc:
- yaml_hash = {}
- yaml_hash[:backtrace] = @hash.key?(:backtrace) ? @hash[:backtrace] :
- DEFAULT_BACKTRACE
- yaml_hash[:benchmark] = @hash.key?(:benchmark) ? @hash[:benchmark] :
- DEFAULT_BENCHMARK
- yaml_hash[:bulk_threshold] = @hash.key?(:bulk_threshold) ?
- @hash[:bulk_threshold] : DEFAULT_BULK_THRESHOLD
- yaml_hash[:sources] = Gem.sources
- yaml_hash[:update_sources] = @hash.key?(:update_sources) ?
- @hash[:update_sources] : DEFAULT_UPDATE_SOURCES
- yaml_hash[:verbose] = @hash.key?(:verbose) ? @hash[:verbose] :
- DEFAULT_VERBOSITY
-
- keys = yaml_hash.keys.map { |key| key.to_s }
- keys << 'debug'
- re = Regexp.union(*keys)
-
- @hash.each do |key, value|
- key = key.to_s
- next if key =~ re
- yaml_hash[key.to_s] = value
- end
-
- yaml_hash.to_yaml
- end
-
- # Writes out this config file, replacing its source.
- def write
- File.open config_file_name, 'w' do |fp|
- fp.write self.to_yaml
- end
- end
-
- # Return the configuration information for +key+.
- def [](key)
- @hash[key.to_s]
- end
-
- # Set configuration option +key+ to +value+.
- def []=(key, value)
- @hash[key.to_s] = value
- end
-
- def ==(other) # :nodoc:
- self.class === other and
- @backtrace == other.backtrace and
- @benchmark == other.benchmark and
- @bulk_threshold == other.bulk_threshold and
- @verbose == other.verbose and
- @update_sources == other.update_sources and
- @hash == other.hash
- end
-
- protected
-
- attr_reader :hash
-
-end
-
diff --git a/lib/rubygems/custom_require.rb b/lib/rubygems/custom_require.rb
deleted file mode 100644
index 78c7872b6f..0000000000
--- a/lib/rubygems/custom_require.rb
+++ /dev/null
@@ -1,46 +0,0 @@
-#--
-# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
-# All rights reserved.
-# See LICENSE.txt for permissions.
-#++
-
-require 'rubygems'
-
-module Kernel
-
- ##
- # The Kernel#require from before RubyGems was loaded.
-
- alias gem_original_require require
-
- ##
- # When RubyGems is required, Kernel#require is replaced with our own which
- # is capable of loading gems on demand.
- #
- # When you call <tt>require 'x'</tt>, this is what happens:
- # * If the file can be loaded from the existing Ruby loadpath, it
- # is.
- # * Otherwise, installed gems are searched for a file that matches.
- # If it's found in gem 'y', that gem is activated (added to the
- # loadpath).
- #
- # The normal <tt>require</tt> functionality of returning false if
- # that file has already been loaded is preserved.
-
- def require(path) # :doc:
- gem_original_require path
- rescue LoadError => load_error
- if load_error.message =~ /#{Regexp.escape path}\z/ and
- spec = Gem.searcher.find(path) then
- Gem.activate(spec.name, "= #{spec.version}")
- gem_original_require path
- else
- raise load_error
- end
- end
-
- private :require
- private :gem_original_require
-
-end
-
diff --git a/lib/rubygems/defaults.rb b/lib/rubygems/defaults.rb
deleted file mode 100644
index 24314d8bf1..0000000000
--- a/lib/rubygems/defaults.rb
+++ /dev/null
@@ -1,106 +0,0 @@
-module Gem
-
- @post_install_hooks ||= []
- @post_uninstall_hooks ||= []
- @pre_uninstall_hooks ||= []
- @pre_install_hooks ||= []
-
- ##
- # An Array of the default sources that come with RubyGems
-
- def self.default_sources
- %w[http://gems.rubyforge.org/]
- end
-
- ##
- # Default home directory path to be used if an alternate value is not
- # specified in the environment
-
- def self.default_dir
- if defined? RUBY_FRAMEWORK_VERSION then
- File.join File.dirname(ConfigMap[:sitedir]), 'Gems',
- ConfigMap[:ruby_version]
- elsif RUBY_VERSION >= '1.9.2' then
- File.join(ConfigMap[:rubylibprefix], 'gems',
- ConfigMap[:ruby_version])
- # only Ruby 1.9.1 has a peculiar feature
- elsif RUBY_VERSION > '1.9' and
- File.join(ConfigMap[:libdir], ConfigMap[:ruby_install_name], 'gems',
- ConfigMap[:ruby_version])
- else
- File.join(ConfigMap[:libdir], ruby_engine, 'gems',
- ConfigMap[:ruby_version])
- end
- end
-
- ##
- # Path for gems in the user's home directory
-
- def self.user_dir
- File.join(Gem.user_home, '.gem', ruby_engine,
- ConfigMap[:ruby_version])
- end
-
- ##
- # Default gem load path
-
- def self.default_path
- if File.exist?(Gem.user_home)
- [user_dir, default_dir]
- else
- [default_dir]
- end
- end
-
- ##
- # Deduce Ruby's --program-prefix and --program-suffix from its install name
-
- def self.default_exec_format
- exec_format = ConfigMap[:ruby_install_name].sub('ruby', '%s') rescue '%s'
-
- unless exec_format =~ /%s/ then
- raise Gem::Exception,
- "[BUG] invalid exec_format #{exec_format.inspect}, no %s"
- end
-
- exec_format
- end
-
- ##
- # The default directory for binaries
-
- def self.default_bindir
- if defined? RUBY_FRAMEWORK_VERSION then # mac framework support
- '/usr/bin'
- else # generic install
- ConfigMap[:bindir]
- end
- end
-
- ##
- # The default system-wide source info cache directory
-
- def self.default_system_source_cache_dir
- File.join Gem.dir, 'source_cache'
- end
-
- ##
- # The default user-specific source info cache directory
-
- def self.default_user_source_cache_dir
- File.join Gem.user_home, '.gem', 'source_cache'
- end
-
- ##
- # A wrapper around RUBY_ENGINE const that may not be defined
-
- def self.ruby_engine
- if defined? RUBY_ENGINE then
- RUBY_ENGINE
- else
- 'ruby'
- end
- end
-
-end
-
diff --git a/lib/rubygems/dependency.rb b/lib/rubygems/dependency.rb
deleted file mode 100644
index d142265c5d..0000000000
--- a/lib/rubygems/dependency.rb
+++ /dev/null
@@ -1,148 +0,0 @@
-#--
-# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
-# All rights reserved.
-# See LICENSE.txt for permissions.
-#++
-
-##
-# The Dependency class holds a Gem name and a Gem::Requirement
-
-class Gem::Dependency
-
- ##
- # Valid dependency types.
- #--
- # When this list is updated, be sure to change
- # Gem::Specification::CURRENT_SPECIFICATION_VERSION as well.
-
- TYPES = [
- :development,
- :runtime,
- ]
-
- ##
- # Dependency name or regular expression.
-
- attr_accessor :name
-
- ##
- # Dependency type.
-
- attr_reader :type
-
- ##
- # Dependent versions.
-
- attr_writer :version_requirements
-
- ##
- # Orders dependencies by name only.
-
- def <=>(other)
- [@name] <=> [other.name]
- end
-
- ##
- # Constructs a dependency with +name+ and +requirements+.
-
- def initialize(name, version_requirements, type=:runtime)
- @name = name
-
- unless TYPES.include? type
- raise ArgumentError, "Valid types are #{TYPES.inspect}, not #{@type.inspect}"
- end
-
- @type = type
-
- @version_requirements = Gem::Requirement.create version_requirements
- @version_requirement = nil # Avoid warnings.
- end
-
- def version_requirements
- normalize if defined? @version_requirement and @version_requirement
- @version_requirements
- end
-
- def requirement_list
- version_requirements.as_list
- end
-
- alias requirements_list requirement_list
-
- def normalize
- ver = @version_requirement.instance_variable_get :@version
- @version_requirements = Gem::Requirement.new([ver])
- @version_requirement = nil
- end
-
- def to_s # :nodoc:
- "#{name} (#{version_requirements}, #{@type || :runtime})"
- end
-
- def pretty_print(q) # :nodoc:
- q.group 1, 'Gem::Dependency.new(', ')' do
- q.pp @name
- q.text ','
- q.breakable
-
- q.pp @version_requirements
-
- q.text ','
- q.breakable
-
- q.pp @type
- end
- end
-
- def ==(other) # :nodoc:
- self.class === other &&
- self.name == other.name &&
- self.type == other.type &&
- self.version_requirements == other.version_requirements
- end
-
- ##
- # Uses this dependency as a pattern to compare to +other+. This dependency
- # will match if the name matches the other's name, and other has only an
- # equal version requirement that satisfies this dependency.
-
- def =~(other)
- other = if self.class === other then
- other
- else
- return false unless other.respond_to? :name and
- other.respond_to? :version
-
- Gem::Dependency.new other.name, other.version
- end
-
- pattern = @name
- pattern = /\A#{Regexp.escape @name}\Z/ unless Regexp === pattern
-
- return false unless pattern =~ other.name
-
- reqs = other.version_requirements.requirements
-
- return false unless reqs.length == 1
- return false unless reqs.first.first == '='
-
- version = reqs.first.last
-
- version_requirements.satisfied_by? version
- end
-
- ##
- # A dependency's hash is the sum of the hash of the #name, #type and
- # #version_requirements
-
- def hash
- name.hash + type.hash + version_requirements.hash
- end
-
- def inspect # :nodoc:
- "<%s type=%p name=%p requirements=%p>" % [self.class, @type, @name,
- version_requirements.to_s]
- end
-
-end
-
diff --git a/lib/rubygems/dependency_installer.rb b/lib/rubygems/dependency_installer.rb
deleted file mode 100644
index beea212818..0000000000
--- a/lib/rubygems/dependency_installer.rb
+++ /dev/null
@@ -1,261 +0,0 @@
-require 'rubygems'
-require 'rubygems/dependency_list'
-require 'rubygems/installer'
-require 'rubygems/spec_fetcher'
-require 'rubygems/user_interaction'
-
-##
-# Installs a gem along with all its dependencies from local and remote gems.
-
-class Gem::DependencyInstaller
-
- include Gem::UserInteraction
-
- attr_reader :gems_to_install
- attr_reader :installed_gems
-
- DEFAULT_OPTIONS = {
- :env_shebang => false,
- :domain => :both, # HACK dup
- :force => false,
- :format_executable => false, # HACK dup
- :ignore_dependencies => false,
- :prerelease => false,
- :security_policy => nil, # HACK NoSecurity requires OpenSSL. AlmostNo? Low?
- :wrappers => true,
- }
-
- ##
- # Creates a new installer instance.
- #
- # Options are:
- # :cache_dir:: Alternate repository path to store .gem files in.
- # :domain:: :local, :remote, or :both. :local only searches gems in the
- # current directory. :remote searches only gems in Gem::sources.
- # :both searches both.
- # :env_shebang:: See Gem::Installer::new.
- # :force:: See Gem::Installer#install.
- # :format_executable:: See Gem::Installer#initialize.
- # :ignore_dependencies:: Don't install any dependencies.
- # :install_dir:: See Gem::Installer#install.
- # :prerelease:: Allow prerelease versions
- # :security_policy:: See Gem::Installer::new and Gem::Security.
- # :user_install:: See Gem::Installer.new
- # :wrappers:: See Gem::Installer::new
-
- def initialize(options = {})
- if options[:install_dir] then
- spec_dir = options[:install_dir], 'specifications'
- @source_index = Gem::SourceIndex.from_gems_in spec_dir
- else
- @source_index = Gem.source_index
- end
-
- options = DEFAULT_OPTIONS.merge options
-
- @bin_dir = options[:bin_dir]
- @development = options[:development]
- @domain = options[:domain]
- @env_shebang = options[:env_shebang]
- @force = options[:force]
- @format_executable = options[:format_executable]
- @ignore_dependencies = options[:ignore_dependencies]
- @prerelease = options[:prerelease]
- @security_policy = options[:security_policy]
- @user_install = options[:user_install]
- @wrappers = options[:wrappers]
-
- @installed_gems = []
-
- @install_dir = options[:install_dir] || Gem.dir
- @cache_dir = options[:cache_dir] || @install_dir
- end
-
- ##
- # Returns a list of pairs of gemspecs and source_uris that match
- # Gem::Dependency +dep+ from both local (Dir.pwd) and remote (Gem.sources)
- # sources. Gems are sorted with newer gems prefered over older gems, and
- # local gems preferred over remote gems.
-
- def find_gems_with_sources(dep)
- gems_and_sources = []
-
- if @domain == :both or @domain == :local then
- Dir[File.join(Dir.pwd, "#{dep.name}-[0-9]*.gem")].each do |gem_file|
- spec = Gem::Format.from_file_by_path(gem_file).spec
- gems_and_sources << [spec, gem_file] if spec.name == dep.name
- end
- end
-
- if @domain == :both or @domain == :remote then
- begin
- requirements = dep.version_requirements.requirements.map do |req, ver|
- req
- end
-
- all = !@prerelease && (requirements.length > 1 ||
- (requirements.first != ">=" and requirements.first != ">"))
-
- found = Gem::SpecFetcher.fetcher.fetch dep, all, true, @prerelease
- gems_and_sources.push(*found)
-
- rescue Gem::RemoteFetcher::FetchError => e
- if Gem.configuration.really_verbose then
- say "Error fetching remote data:\t\t#{e.message}"
- say "Falling back to local-only install"
- end
- @domain = :local
- end
- end
-
- gems_and_sources.sort_by do |gem, source|
- [gem, source =~ /^http:\/\// ? 0 : 1] # local gems win
- end
- end
-
- ##
- # Gathers all dependencies necessary for the installation from local and
- # remote sources unless the ignore_dependencies was given.
-
- def gather_dependencies
- specs = @specs_and_sources.map { |spec,_| spec }
-
- dependency_list = Gem::DependencyList.new
- dependency_list.add(*specs)
-
- unless @ignore_dependencies then
- to_do = specs.dup
- seen = {}
-
- until to_do.empty? do
- spec = to_do.shift
- next if spec.nil? or seen[spec.name]
- seen[spec.name] = true
-
- deps = spec.runtime_dependencies
- deps |= spec.development_dependencies if @development
-
- deps.each do |dep|
- results = find_gems_with_sources(dep).reverse
-
- results.reject! do |dep_spec,|
- to_do.push dep_spec
-
- @source_index.any? do |_, installed_spec|
- dep.name == installed_spec.name and
- dep.version_requirements.satisfied_by? installed_spec.version
- end
- end
-
- results.each do |dep_spec, source_uri|
- next if seen[dep_spec.name]
- @specs_and_sources << [dep_spec, source_uri]
- dependency_list.add dep_spec
- end
- end
- end
- end
-
- @gems_to_install = dependency_list.dependency_order.reverse
- end
-
- ##
- # Finds a spec and the source_uri it came from for gem +gem_name+ and
- # +version+. Returns an Array of specs and sources required for
- # installation of the gem.
-
- def find_spec_by_name_and_version gem_name, version = Gem::Requirement.default
- spec_and_source = nil
-
- glob = if File::ALT_SEPARATOR then
- gem_name.gsub File::ALT_SEPARATOR, File::SEPARATOR
- else
- gem_name
- end
-
- local_gems = Dir["#{glob}*"].sort.reverse
-
- unless local_gems.empty? then
- local_gems.each do |gem_file|
- next unless gem_file =~ /gem$/
- begin
- spec = Gem::Format.from_file_by_path(gem_file).spec
- spec_and_source = [spec, gem_file]
- break
- rescue SystemCallError, Gem::Package::FormatError
- end
- end
- end
-
- if spec_and_source.nil? then
- dep = Gem::Dependency.new gem_name, version
- spec_and_sources = find_gems_with_sources(dep).reverse
-
- spec_and_source = spec_and_sources.find { |spec, source|
- Gem::Platform.match spec.platform
- }
- end
-
- if spec_and_source.nil? then
- raise Gem::GemNotFoundException,
- "could not find gem #{gem_name} locally or in a repository"
- end
-
- @specs_and_sources = [spec_and_source]
- end
-
- ##
- # Installs the gem and all its dependencies. Returns an Array of installed
- # gems specifications.
-
- def install dep_or_name, version = Gem::Requirement.default
- if String === dep_or_name then
- find_spec_by_name_and_version dep_or_name, version
- else
- @specs_and_sources = [find_gems_with_sources(dep_or_name).last]
- end
-
- @installed_gems = []
-
- gather_dependencies
-
- @gems_to_install.each do |spec|
- last = spec == @gems_to_install.last
- # HACK is this test for full_name acceptable?
- next if @source_index.any? { |n,_| n == spec.full_name } and not last
-
- # TODO: make this sorta_verbose so other users can benefit from it
- say "Installing gem #{spec.full_name}" if Gem.configuration.really_verbose
-
- _, source_uri = @specs_and_sources.assoc spec
- begin
- local_gem_path = Gem::RemoteFetcher.fetcher.download spec, source_uri,
- @cache_dir
- rescue Gem::RemoteFetcher::FetchError
- next if @force
- raise
- end
-
- inst = Gem::Installer.new local_gem_path,
- :bin_dir => @bin_dir,
- :development => @development,
- :env_shebang => @env_shebang,
- :force => @force,
- :format_executable => @format_executable,
- :ignore_dependencies => @ignore_dependencies,
- :install_dir => @install_dir,
- :security_policy => @security_policy,
- :source_index => @source_index,
- :user_install => @user_install,
- :wrappers => @wrappers
-
- spec = inst.install
-
- @installed_gems << spec
- end
-
- @installed_gems
- end
-
-end
-
diff --git a/lib/rubygems/dependency_list.rb b/lib/rubygems/dependency_list.rb
deleted file mode 100644
index a73a32d545..0000000000
--- a/lib/rubygems/dependency_list.rb
+++ /dev/null
@@ -1,185 +0,0 @@
-#--
-# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
-# All rights reserved.
-# See LICENSE.txt for permissions.
-#++
-
-require 'tsort'
-
-class Gem::DependencyList
-
- include Enumerable
- include TSort
-
- def self.from_source_index(src_index)
- deps = new
-
- src_index.each do |full_name, spec|
- deps.add spec
- end
-
- deps
- end
-
- def initialize
- @specs = []
- end
-
- ##
- # Adds +gemspecs+ to the dependency list.
-
- def add(*gemspecs)
- @specs.push(*gemspecs)
- end
-
- ##
- # Return a list of the specifications in the dependency list, sorted in
- # order so that no spec in the list depends on a gem earlier in the list.
- #
- # This is useful when removing gems from a set of installed gems. By
- # removing them in the returned order, you don't get into as many dependency
- # issues.
- #
- # If there are circular dependencies (yuck!), then gems will be returned in
- # order until only the circular dependents and anything they reference are
- # left. Then arbitrary gemspecs will be returned until the circular
- # dependency is broken, after which gems will be returned in dependency
- # order again.
-
- def dependency_order
- sorted = strongly_connected_components.flatten
-
- result = []
- seen = {}
-
- sorted.each do |spec|
- if index = seen[spec.name] then
- if result[index].version < spec.version then
- result[index] = spec
- end
- else
- seen[spec.name] = result.length
- result << spec
- end
- end
-
- result.reverse
- end
-
- ##
- # Iterator over dependency_order
-
- def each(&block)
- dependency_order.each(&block)
- end
-
- def find_name(full_name)
- @specs.find { |spec| spec.full_name == full_name }
- end
-
- ##
- # Are all the dependencies in the list satisfied?
-
- def ok?
- @specs.all? do |spec|
- spec.runtime_dependencies.all? do |dep|
- @specs.find { |s| s.satisfies_requirement? dep }
- end
- end
- end
-
- ##
- # Is is ok to remove a gem from the dependency list?
- #
- # If removing the gemspec creates breaks a currently ok dependency, then it
- # is NOT ok to remove the gem.
-
- def ok_to_remove?(full_name)
- gem_to_remove = find_name full_name
-
- siblings = @specs.find_all { |s|
- s.name == gem_to_remove.name &&
- s.full_name != gem_to_remove.full_name
- }
-
- deps = []
-
- @specs.each do |spec|
- spec.dependencies.each do |dep|
- deps << dep if gem_to_remove.satisfies_requirement?(dep)
- end
- end
-
- deps.all? { |dep|
- siblings.any? { |s|
- s.satisfies_requirement? dep
- }
- }
- end
-
- def remove_by_name(full_name)
- @specs.delete_if { |spec| spec.full_name == full_name }
- end
-
- ##
- # Return a hash of predecessors. <tt>result[spec]</tt> is an Array of
- # gemspecs that have a dependency satisfied by the named spec.
-
- def spec_predecessors
- result = Hash.new { |h,k| h[k] = [] }
-
- specs = @specs.sort.reverse
-
- specs.each do |spec|
- specs.each do |other|
- next if spec == other
-
- other.dependencies.each do |dep|
- if spec.satisfies_requirement? dep then
- result[spec] << other
- end
- end
- end
- end
-
- result
- end
-
- def tsort_each_node(&block)
- @specs.each(&block)
- end
-
- def tsort_each_child(node, &block)
- specs = @specs.sort.reverse
-
- node.dependencies.each do |dep|
- specs.each do |spec|
- if spec.satisfies_requirement? dep then
- begin
- yield spec
- rescue TSort::Cyclic
- end
- break
- end
- end
- end
- end
-
- private
-
- ##
- # Count the number of gemspecs in the list +specs+ that are not in
- # +ignored+.
-
- def active_count(specs, ignored)
- result = 0
-
- specs.each do |spec|
- result += 1 unless ignored[spec.full_name]
- end
-
- result
- end
-
-end
-
diff --git a/lib/rubygems/digest/md5.rb b/lib/rubygems/digest/md5.rb
deleted file mode 100644
index 2bc8f9c138..0000000000
--- a/lib/rubygems/digest/md5.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-#--
-# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
-# All rights reserved.
-# See LICENSE.txt for permissions.
-#++
-
-require 'digest/md5'
-
-# :stopdoc:
-module Gem
- MD5 = Digest::MD5
-end
-# :startdoc:
diff --git a/lib/rubygems/digest/sha1.rb b/lib/rubygems/digest/sha1.rb
deleted file mode 100644
index 2d91c0f45a..0000000000
--- a/lib/rubygems/digest/sha1.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-#--
-# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
-# All rights reserved.
-# See LICENSE.txt for permissions.
-#++
-
-require 'digest/sha1'
-
-module Gem
- SHA1 = Digest::SHA1
-end
diff --git a/lib/rubygems/digest/sha2.rb b/lib/rubygems/digest/sha2.rb
deleted file mode 100644
index 91cb236165..0000000000
--- a/lib/rubygems/digest/sha2.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-#--
-# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
-# All rights reserved.
-# See LICENSE.txt for permissions.
-#++
-
-require 'digest/sha2'
-
-module Gem
- SHA256 = Digest::SHA256
-end
diff --git a/lib/rubygems/doc_manager.rb b/lib/rubygems/doc_manager.rb
deleted file mode 100644
index e1c8e03b91..0000000000
--- a/lib/rubygems/doc_manager.rb
+++ /dev/null
@@ -1,230 +0,0 @@
-#--
-# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
-# All rights reserved.
-# See LICENSE.txt for permissions.
-#++
-
-require 'fileutils'
-require 'rubygems'
-
-##
-# The documentation manager generates RDoc and RI for RubyGems.
-
-class Gem::DocManager
-
- include Gem::UserInteraction
-
- @configured_args = []
-
- def self.configured_args
- @configured_args ||= []
- end
-
- def self.configured_args=(args)
- case args
- when Array
- @configured_args = args
- when String
- @configured_args = args.split
- end
- end
-
- ##
- # Load RDoc from a gem if it is available, otherwise from Ruby's stdlib
-
- def self.load_rdoc
- begin
- gem 'rdoc'
- rescue Gem::LoadError
- # use built-in RDoc
- end
-
- begin
- require 'rdoc/rdoc'
-
- @rdoc_version = if defined? RDoc::VERSION then
- Gem::Version.new RDoc::VERSION
- else
- Gem::Version.new '1.0.1' # HACK parsing is hard
- end
-
- rescue LoadError => e
- raise Gem::DocumentError,
- "ERROR: RDoc documentation generator not installed: #{e}"
- end
- end
-
- def self.rdoc_version
- @rdoc_version
- end
-
- ##
- # Updates the RI cache for RDoc 2 if it is installed
-
- def self.update_ri_cache
- load_rdoc rescue return
-
- return unless defined? RDoc::VERSION # RDoc 1 does not have VERSION
-
- require 'rdoc/ri/driver'
-
- options = {
- :use_cache => true,
- :use_system => true,
- :use_site => true,
- :use_home => true,
- :use_gems => true,
- :formatter => RDoc::RI::Formatter,
- }
-
- driver = RDoc::RI::Driver.new(options).class_cache
- end
-
- ##
- # Create a document manager for +spec+. +rdoc_args+ contains arguments for
- # RDoc (template etc.) as a String.
-
- def initialize(spec, rdoc_args="")
- @spec = spec
- @doc_dir = File.join(spec.installation_path, "doc", spec.full_name)
- @rdoc_args = rdoc_args.nil? ? [] : rdoc_args.split
- end
-
- ##
- # Is the RDoc documentation installed?
-
- def rdoc_installed?
- File.exist?(File.join(@doc_dir, "rdoc"))
- end
-
- ##
- # Generate the RI documents for this gem spec.
- #
- # Note that if both RI and RDoc documents are generated from the same
- # process, the RI docs should be done first (a likely bug in RDoc will cause
- # RI docs generation to fail if run after RDoc).
-
- def generate_ri
- setup_rdoc
- install_ri # RDoc bug, ri goes first
-
- FileUtils.mkdir_p @doc_dir unless File.exist?(@doc_dir)
- end
-
- ##
- # Generate the RDoc documents for this gem spec.
- #
- # Note that if both RI and RDoc documents are generated from the same
- # process, the RI docs should be done first (a likely bug in RDoc will cause
- # RI docs generation to fail if run after RDoc).
-
- def generate_rdoc
- setup_rdoc
- install_rdoc
-
- FileUtils.mkdir_p @doc_dir unless File.exist?(@doc_dir)
- end
-
- ##
- # Generate and install RDoc into the documentation directory
-
- def install_rdoc
- rdoc_dir = File.join @doc_dir, 'rdoc'
-
- FileUtils.rm_rf rdoc_dir
-
- say "Installing RDoc documentation for #{@spec.full_name}..."
- run_rdoc '--op', rdoc_dir
- end
-
- ##
- # Generate and install RI into the documentation directory
-
- def install_ri
- ri_dir = File.join @doc_dir, 'ri'
-
- FileUtils.rm_rf ri_dir
-
- say "Installing ri documentation for #{@spec.full_name}..."
- run_rdoc '--ri', '--op', ri_dir
- end
-
- ##
- # Run RDoc with +args+, which is an ARGV style argument list
-
- def run_rdoc(*args)
- args << @spec.rdoc_options
- args << self.class.configured_args
- args << '--quiet'
- args << @spec.require_paths.clone
- args << @spec.extra_rdoc_files
- args << '--title' << "#{@spec.full_name} Documentation"
- args = args.flatten.map do |arg| arg.to_s end
-
- if self.class.rdoc_version >= Gem::Version.new('2.4.0') then
- args.delete '--inline-source'
- args.delete '--promiscuous'
- args.delete '-p'
- args.delete '--one-file'
- # HACK more
- end
-
- r = RDoc::RDoc.new
-
- old_pwd = Dir.pwd
- Dir.chdir(@spec.full_gem_path)
- begin
- r.document args
- rescue Errno::EACCES => e
- dirname = File.dirname e.message.split("-")[1].strip
- raise Gem::FilePermissionError.new(dirname)
- rescue RuntimeError => ex
- alert_error "While generating documentation for #{@spec.full_name}"
- ui.errs.puts "... MESSAGE: #{ex}"
- ui.errs.puts "... RDOC args: #{args.join(' ')}"
- ui.errs.puts "\t#{ex.backtrace.join "\n\t"}" if
- Gem.configuration.backtrace
- ui.errs.puts "(continuing with the rest of the installation)"
- ensure
- Dir.chdir(old_pwd)
- end
- end
-
- def setup_rdoc
- if File.exist?(@doc_dir) && !File.writable?(@doc_dir) then
- raise Gem::FilePermissionError.new(@doc_dir)
- end
-
- FileUtils.mkdir_p @doc_dir unless File.exist?(@doc_dir)
-
- self.class.load_rdoc
- end
-
- ##
- # Remove RDoc and RI documentation
-
- def uninstall_doc
- raise Gem::FilePermissionError.new(@spec.installation_path) unless
- File.writable? @spec.installation_path
-
- original_name = [
- @spec.name, @spec.version, @spec.original_platform].join '-'
-
- doc_dir = File.join @spec.installation_path, 'doc', @spec.full_name
- unless File.directory? doc_dir then
- doc_dir = File.join @spec.installation_path, 'doc', original_name
- end
-
- FileUtils.rm_rf doc_dir
-
- ri_dir = File.join @spec.installation_path, 'ri', @spec.full_name
-
- unless File.directory? ri_dir then
- ri_dir = File.join @spec.installation_path, 'ri', original_name
- end
-
- FileUtils.rm_rf ri_dir
- end
-
-end
-
diff --git a/lib/rubygems/exceptions.rb b/lib/rubygems/exceptions.rb
deleted file mode 100644
index d6c60c7a02..0000000000
--- a/lib/rubygems/exceptions.rb
+++ /dev/null
@@ -1,82 +0,0 @@
-##
-# Base exception class for RubyGems. All exception raised by RubyGems are a
-# subclass of this one.
-class Gem::Exception < RuntimeError; end
-
-class Gem::CommandLineError < Gem::Exception; end
-
-class Gem::DependencyError < Gem::Exception; end
-
-class Gem::DependencyRemovalException < Gem::Exception; end
-
-##
-# Raised when attempting to uninstall a gem that isn't in GEM_HOME.
-
-class Gem::GemNotInHomeException < Gem::Exception
- attr_accessor :spec
-end
-
-class Gem::DocumentError < Gem::Exception; end
-
-##
-# Potentially raised when a specification is validated.
-class Gem::EndOfYAMLException < Gem::Exception; end
-
-##
-# Signals that a file permission error is preventing the user from
-# installing in the requested directories.
-class Gem::FilePermissionError < Gem::Exception
- def initialize(path)
- super("You don't have write permissions into the #{path} directory.")
- end
-end
-
-##
-# Used to raise parsing and loading errors
-class Gem::FormatException < Gem::Exception
- attr_accessor :file_path
-end
-
-class Gem::GemNotFoundException < Gem::Exception; end
-
-class Gem::InstallError < Gem::Exception; end
-
-##
-# Potentially raised when a specification is validated.
-class Gem::InvalidSpecificationException < Gem::Exception; end
-
-class Gem::OperationNotSupportedError < Gem::Exception; end
-
-##
-# Signals that a remote operation cannot be conducted, probably due to not
-# being connected (or just not finding host).
-#--
-# TODO: create a method that tests connection to the preferred gems server.
-# All code dealing with remote operations will want this. Failure in that
-# method should raise this error.
-class Gem::RemoteError < Gem::Exception; end
-
-class Gem::RemoteInstallationCancelled < Gem::Exception; end
-
-class Gem::RemoteInstallationSkipped < Gem::Exception; end
-
-##
-# Represents an error communicating via HTTP.
-class Gem::RemoteSourceException < Gem::Exception; end
-
-class Gem::VerificationError < Gem::Exception; end
-
-##
-# Raised to indicate that a system exit should occur with the specified
-# exit_code
-
-class Gem::SystemExitException < SystemExit
- attr_accessor :exit_code
-
- def initialize(exit_code)
- @exit_code = exit_code
-
- super "Exiting RubyGems with exit_code #{exit_code}"
- end
-
-end
diff --git a/lib/rubygems/ext.rb b/lib/rubygems/ext.rb
deleted file mode 100644
index 97ee762a4a..0000000000
--- a/lib/rubygems/ext.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-#--
-# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
-# All rights reserved.
-# See LICENSE.txt for permissions.
-#++
-
-require 'rubygems'
-
-##
-# Classes for building C extensions live here.
-
-module Gem::Ext; end
-
-require 'rubygems/ext/builder'
-require 'rubygems/ext/configure_builder'
-require 'rubygems/ext/ext_conf_builder'
-require 'rubygems/ext/rake_builder'
-
diff --git a/lib/rubygems/ext/builder.rb b/lib/rubygems/ext/builder.rb
deleted file mode 100644
index c029bbe1e9..0000000000
--- a/lib/rubygems/ext/builder.rb
+++ /dev/null
@@ -1,54 +0,0 @@
-#--
-# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
-# All rights reserved.
-# See LICENSE.txt for permissions.
-#++
-
-class Gem::Ext::Builder
-
- def self.class_name
- name =~ /Ext::(.*)Builder/
- $1.downcase
- end
-
- def self.make(dest_path, results)
- unless File.exist? 'Makefile' then
- raise Gem::InstallError, "Makefile not found:\n\n#{results.join "\n"}"
- end
-
- mf = File.read('Makefile')
- mf = mf.gsub(/^RUBYARCHDIR\s*=\s*\$[^$]*/, "RUBYARCHDIR = #{dest_path}")
- mf = mf.gsub(/^RUBYLIBDIR\s*=\s*\$[^$]*/, "RUBYLIBDIR = #{dest_path}")
-
- File.open('Makefile', 'wb') {|f| f.print mf}
-
- make_program = ENV['make']
- unless make_program then
- make_program = (/mswin/ =~ RUBY_PLATFORM) ? 'nmake' : 'make'
- end
-
- ['', ' install'].each do |target|
- cmd = "#{make_program}#{target}"
- results << cmd
- results << `#{cmd} #{redirector}`
-
- raise Gem::InstallError, "make#{target} failed:\n\n#{results}" unless
- $?.success?
- end
- end
-
- def self.redirector
- '2>&1'
- end
-
- def self.run(command, results)
- results << command
- results << `#{command} #{redirector}`
-
- unless $?.success? then
- raise Gem::InstallError, "#{class_name} failed:\n\n#{results.join "\n"}"
- end
- end
-
-end
-
diff --git a/lib/rubygems/ext/configure_builder.rb b/lib/rubygems/ext/configure_builder.rb
deleted file mode 100644
index c2087eb5ad..0000000000
--- a/lib/rubygems/ext/configure_builder.rb
+++ /dev/null
@@ -1,25 +0,0 @@
-#--
-# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
-# All rights reserved.
-# See LICENSE.txt for permissions.
-#++
-
-require 'rubygems/ext/builder'
-
-class Gem::Ext::ConfigureBuilder < Gem::Ext::Builder
-
- def self.build(extension, directory, dest_path, results)
- unless File.exist?('Makefile') then
- cmd = "sh ./configure --prefix=#{dest_path}"
- cmd << " #{Gem::Command.build_args.join ' '}" unless Gem::Command.build_args.empty?
-
- run cmd, results
- end
-
- make dest_path, results
-
- results
- end
-
-end
-
diff --git a/lib/rubygems/ext/ext_conf_builder.rb b/lib/rubygems/ext/ext_conf_builder.rb
deleted file mode 100644
index b3d588dc9c..0000000000
--- a/lib/rubygems/ext/ext_conf_builder.rb
+++ /dev/null
@@ -1,24 +0,0 @@
-#--
-# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
-# All rights reserved.
-# See LICENSE.txt for permissions.
-#++
-
-require 'rubygems/ext/builder'
-require 'rubygems/command'
-
-class Gem::Ext::ExtConfBuilder < Gem::Ext::Builder
-
- def self.build(extension, directory, dest_path, results)
- cmd = "#{Gem.ruby} #{File.basename extension}"
- cmd << " #{Gem::Command.build_args.join ' '}" unless Gem::Command.build_args.empty?
-
- run cmd, results
-
- make dest_path, results
-
- results
- end
-
-end
-
diff --git a/lib/rubygems/ext/rake_builder.rb b/lib/rubygems/ext/rake_builder.rb
deleted file mode 100644
index 3b45ef4369..0000000000
--- a/lib/rubygems/ext/rake_builder.rb
+++ /dev/null
@@ -1,31 +0,0 @@
-#--
-# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
-# All rights reserved.
-# See LICENSE.txt for permissions.
-#++
-
-require 'rubygems/ext/builder'
-require 'rubygems/command'
-
-class Gem::Ext::RakeBuilder < Gem::Ext::Builder
-
- def self.build(extension, directory, dest_path, results)
- if File.basename(extension) =~ /mkrf_conf/i then
- cmd = "#{Gem.ruby} #{File.basename extension}"
- cmd << " #{Gem::Command.build_args.join " "}" unless Gem::Command.build_args.empty?
- run cmd, results
- end
-
- # Deal with possible spaces in the path, e.g. C:/Program Files
- dest_path = '"' + dest_path + '"' if dest_path.include?(' ')
-
- cmd = ENV['rake'] || "#{Gem.ruby} -rubygems #{Gem.bin_path('rake')}" rescue Gem.default_exec_format % 'rake'
- cmd += " RUBYARCHDIR=#{dest_path} RUBYLIBDIR=#{dest_path}" # ENV is frozen
-
- run cmd, results
-
- results
- end
-
-end
-
diff --git a/lib/rubygems/format.rb b/lib/rubygems/format.rb
deleted file mode 100644
index b2e7897339..0000000000
--- a/lib/rubygems/format.rb
+++ /dev/null
@@ -1,87 +0,0 @@
-#--
-# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
-# All rights reserved.
-# See LICENSE.txt for permissions.
-#++
-
-require 'fileutils'
-
-require 'rubygems/package'
-
-##
-# Gem::Format knows the guts of the RubyGem .gem file format and provides the
-# capability to read gem files
-
-class Gem::Format
-
- attr_accessor :spec, :file_entries, :gem_path
-
- extend Gem::UserInteraction
-
- ##
- # Constructs an instance of a Format object, representing the gem's
- # data structure.
- #
- # gem:: [String] The file name of the gem
- #
- def initialize(gem_path)
- @gem_path = gem_path
- end
-
- ##
- # Reads the named gem file and returns a Format object, representing
- # the data from the gem file
- #
- # file_path:: [String] Path to the gem file
-
- def self.from_file_by_path(file_path, security_policy = nil)
- format = nil
-
- unless File.exist?(file_path)
- raise Gem::Exception, "Cannot load gem at [#{file_path}] in #{Dir.pwd}"
- end
-
- # check for old version gem
- if File.read(file_path, 20).include?("MD5SUM =")
- require 'rubygems/old_format'
-
- format = Gem::OldFormat.from_file_by_path(file_path)
- else
- open file_path, Gem.binary_mode do |io|
- format = from_io io, file_path, security_policy
- end
- end
-
- return format
- end
-
- ##
- # Reads a gem from an io stream and returns a Format object, representing
- # the data from the gem file
- #
- # io:: [IO] Stream from which to read the gem
-
- def self.from_io(io, gem_path="(io)", security_policy = nil)
- format = new gem_path
-
- Gem::Package.open io, 'r', security_policy do |pkg|
- format.spec = pkg.metadata
- format.file_entries = []
-
- pkg.each do |entry|
- size = entry.header.size
- mode = entry.header.mode
-
- format.file_entries << [{
- "size" => size, "mode" => mode, "path" => entry.full_name,
- },
- entry.read
- ]
- end
- end
-
- format
- end
-
-end
-
diff --git a/lib/rubygems/gem_openssl.rb b/lib/rubygems/gem_openssl.rb
deleted file mode 100644
index bdaad8050a..0000000000
--- a/lib/rubygems/gem_openssl.rb
+++ /dev/null
@@ -1,94 +0,0 @@
-#--
-# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
-# All rights reserved.
-# See LICENSE.txt for permissions.
-#++
-
-#--
-# Some system might not have OpenSSL installed, therefore the core
-# library file openssl might not be available. We localize testing
-# for the presence of OpenSSL in this file.
-#++
-
-module Gem
- class << self
- ##
- # Is SSL (used by the signing commands) available on this
- # platform?
-
- def ssl_available?
- @ssl_available
- end
-
- ##
- # Is SSL available?
-
- attr_writer :ssl_available
-
- ##
- # Ensure that SSL is available. Throw an exception if it is not.
-
- def ensure_ssl_available
- unless ssl_available?
- fail Gem::Exception, "SSL is not installed on this system"
- end
- end
- end
-end
-
-begin
- require 'openssl'
-
- # Reference a constant defined in the .rb portion of ssl (just to
- # make sure that part is loaded too).
-
- dummy = OpenSSL::Digest::SHA1
-
- Gem.ssl_available = true
-
- class OpenSSL::X509::Certificate # :nodoc:
- # Check the validity of this certificate.
- def check_validity(issuer_cert = nil, time = Time.now)
- ret = if @not_before && @not_before > time
- [false, :expired, "not valid before '#@not_before'"]
- elsif @not_after && @not_after < time
- [false, :expired, "not valid after '#@not_after'"]
- elsif issuer_cert && !verify(issuer_cert.public_key)
- [false, :issuer, "#{issuer_cert.subject} is not issuer"]
- else
- [true, :ok, 'Valid certificate']
- end
-
- # return hash
- { :is_valid => ret[0], :error => ret[1], :desc => ret[2] }
- end
- end
-
-rescue LoadError, StandardError
- Gem.ssl_available = false
-end
-
-# :stopdoc:
-
-module Gem::SSL
-
- # We make our own versions of the constants here. This allows us
- # to reference the constants, even though some systems might not
- # have SSL installed in the Ruby core package.
- #
- # These constants are only used during load time. At runtime, any
- # method that makes a direct reference to SSL software must be
- # protected with a Gem.ensure_ssl_available call.
-
- if Gem.ssl_available? then
- PKEY_RSA = OpenSSL::PKey::RSA
- DIGEST_SHA1 = OpenSSL::Digest::SHA1
- else
- PKEY_RSA = :rsa
- DIGEST_SHA1 = :sha1
- end
-
-end
-
-# :startdoc:
-
diff --git a/lib/rubygems/gem_path_searcher.rb b/lib/rubygems/gem_path_searcher.rb
deleted file mode 100644
index 2232a574e3..0000000000
--- a/lib/rubygems/gem_path_searcher.rb
+++ /dev/null
@@ -1,102 +0,0 @@
-#--
-# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
-# All rights reserved.
-# See LICENSE.txt for permissions.
-#++
-
-##
-# GemPathSearcher has the capability to find loadable files inside
-# gems. It generates data up front to speed up searches later.
-
-class Gem::GemPathSearcher
-
- ##
- # Initialise the data we need to make searches later.
-
- def initialize
- # We want a record of all the installed gemspecs, in the order
- # we wish to examine them.
- @gemspecs = init_gemspecs
- # Map gem spec to glob of full require_path directories.
- # Preparing this information may speed up searches later.
- @lib_dirs = {}
- @gemspecs.each do |spec|
- @lib_dirs[spec.object_id] = lib_dirs_for(spec)
- end
- end
-
- ##
- # Look in all the installed gems until a matching _path_ is found.
- # Return the _gemspec_ of the gem where it was found. If no match
- # is found, return nil.
- #
- # The gems are searched in alphabetical order, and in reverse
- # version order.
- #
- # For example:
- #
- # find('log4r') # -> (log4r-1.1 spec)
- # find('log4r.rb') # -> (log4r-1.1 spec)
- # find('rake/rdoctask') # -> (rake-0.4.12 spec)
- # find('foobarbaz') # -> nil
- #
- # Matching paths can have various suffixes ('.rb', '.so', and
- # others), which may or may not already be attached to _file_.
- # This method doesn't care about the full filename that matches;
- # only that there is a match.
-
- def find(path)
- @gemspecs.find do |spec| matching_file? spec, path end
- end
-
- ##
- # Works like #find, but finds all gemspecs matching +path+.
-
- def find_all(path)
- @gemspecs.select do |spec|
- matching_file? spec, path
- end
- end
-
- ##
- # Attempts to find a matching path using the require_paths of the given
- # +spec+.
-
- def matching_file?(spec, path)
- !matching_files(spec, path).empty?
- end
-
- ##
- # Returns files matching +path+ in +spec+.
- #--
- # Some of the intermediate results are cached in @lib_dirs for speed.
-
- def matching_files(spec, path)
- glob = File.join @lib_dirs[spec.object_id], "#{path}#{Gem.suffix_pattern}"
- Dir[glob].select { |f| File.file? f.untaint }
- end
-
- ##
- # Return a list of all installed gemspecs, sorted by alphabetical order and
- # in reverse version order. (bar-2, bar-1, foo-2)
-
- def init_gemspecs
- specs = Gem.source_index.map { |_, spec| spec }
-
- specs.sort { |a, b|
- names = a.name <=> b.name
- next names if names.nonzero?
- b.version <=> a.version
- }
- end
-
- ##
- # Returns library directories glob for a gemspec. For example,
- # '/usr/local/lib/ruby/gems/1.8/gems/foobar-1.0/{lib,ext}'
-
- def lib_dirs_for(spec)
- "#{spec.full_gem_path}/{#{spec.require_paths.join(',')}}"
- end
-
-end
-
diff --git a/lib/rubygems/gem_runner.rb b/lib/rubygems/gem_runner.rb
deleted file mode 100644
index 07a792dd9b..0000000000
--- a/lib/rubygems/gem_runner.rb
+++ /dev/null
@@ -1,78 +0,0 @@
-#--
-# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
-# All rights reserved.
-# See LICENSE.txt for permissions.
-#++
-
-require 'rubygems/command_manager'
-require 'rubygems/config_file'
-require 'rubygems/doc_manager'
-
-##
-# Run an instance of the gem program.
-#
-# Gem::GemRunner is only intended for internal use by RubyGems itself. It
-# does not form any public API and may change at any time for any reason.
-#
-# If you would like to duplicate functionality of `gem` commands, use the
-# classes they call directly.
-
-class Gem::GemRunner
-
- def initialize(options={})
- @command_manager_class = options[:command_manager] || Gem::CommandManager
- @config_file_class = options[:config_file] || Gem::ConfigFile
- @doc_manager_class = options[:doc_manager] || Gem::DocManager
- end
-
- ##
- # Run the gem command with the following arguments.
-
- def run(args)
- start_time = Time.now
-
- if args.include?('--')
- # We need to preserve the original ARGV to use for passing gem options
- # to source gems. If there is a -- in the line, strip all options after
- # it...its for the source building process.
- build_args = args[args.index("--") + 1...args.length]
- args = args[0...args.index("--")]
- end
-
- Gem::Command.build_args = build_args if build_args
-
- do_configuration args
- cmd = @command_manager_class.instance
-
- cmd.command_names.each do |command_name|
- config_args = Gem.configuration[command_name]
- config_args = case config_args
- when String
- config_args.split ' '
- else
- Array(config_args)
- end
- Gem::Command.add_specific_extra_args command_name, config_args
- end
-
- cmd.run Gem.configuration.args
- end_time = Time.now
-
- if Gem.configuration.benchmark then
- printf "\nExecution time: %0.2f seconds.\n", end_time - start_time
- puts "Press Enter to finish"
- STDIN.gets
- end
- end
-
- private
-
- def do_configuration(args)
- Gem.configuration = @config_file_class.new(args)
- Gem.use_paths(Gem.configuration[:gemhome], Gem.configuration[:gempath])
- Gem::Command.extra_args = Gem.configuration[:gem]
- @doc_manager_class.configured_args = Gem.configuration[:rdoc]
- end
-
-end
-
diff --git a/lib/rubygems/indexer.rb b/lib/rubygems/indexer.rb
deleted file mode 100644
index 5ebde1b31c..0000000000
--- a/lib/rubygems/indexer.rb
+++ /dev/null
@@ -1,712 +0,0 @@
-require 'fileutils'
-require 'tmpdir'
-require 'zlib'
-
-require 'rubygems'
-require 'rubygems/format'
-
-begin
- gem 'builder'
- require 'builder/xchar'
-rescue LoadError
-end
-
-##
-# Top level class for building the gem repository index.
-
-class Gem::Indexer
-
- include Gem::UserInteraction
-
- ##
- # Build indexes for RubyGems older than 1.2.0 when true
-
- attr_accessor :build_legacy
-
- ##
- # Build indexes for RubyGems 1.2.0 and newer when true
-
- attr_accessor :build_modern
-
- ##
- # Index install location
-
- attr_reader :dest_directory
-
- ##
- # Specs index install location
-
- attr_reader :dest_specs_index
-
- ##
- # Latest specs index install location
-
- attr_reader :dest_latest_specs_index
-
- ##
- # Prerelease specs index install location
-
- attr_reader :dest_prerelease_specs_index
-
- ##
- # Index build directory
-
- attr_reader :directory
-
- ##
- # Create an indexer that will index the gems in +directory+.
-
- def initialize(directory, options = {})
- unless ''.respond_to? :to_xs then
- fail "Gem::Indexer requires that the XML Builder library be installed:" \
- "\n\tgem install builder"
- end
-
- options = { :build_legacy => true, :build_modern => true }.merge options
-
- @build_legacy = options[:build_legacy]
- @build_modern = options[:build_modern]
-
- @rss_title = options[:rss_title]
- @rss_host = options[:rss_host]
- @rss_gems_host = options[:rss_gems_host]
-
- @dest_directory = directory
- @directory = File.join Dir.tmpdir, "gem_generate_index_#{$$}"
-
- marshal_name = "Marshal.#{Gem.marshal_version}"
-
- @master_index = File.join @directory, 'yaml'
- @marshal_index = File.join @directory, marshal_name
-
- @quick_dir = File.join @directory, 'quick'
-
- @quick_marshal_dir = File.join @quick_dir, marshal_name
-
- @quick_index = File.join @quick_dir, 'index'
- @latest_index = File.join @quick_dir, 'latest_index'
-
- @specs_index = File.join @directory, "specs.#{Gem.marshal_version}"
- @latest_specs_index = File.join @directory,
- "latest_specs.#{Gem.marshal_version}"
- @prerelease_specs_index = File.join(@directory,
- "prerelease_specs.#{Gem.marshal_version}")
-
- @dest_specs_index = File.join @dest_directory,
- "specs.#{Gem.marshal_version}"
- @dest_latest_specs_index = File.join @dest_directory,
- "latest_specs.#{Gem.marshal_version}"
- @dest_prerelease_specs_index = File.join @dest_directory,
- "prerelease_specs.#{Gem.marshal_version}"
-
- @rss_index = File.join @directory, 'index.rss'
-
- @files = []
- end
-
- ##
- # Abbreviate the spec for downloading. Abbreviated specs are only used for
- # searching, downloading and related activities and do not need deployment
- # specific information (e.g. list of files). So we abbreviate the spec,
- # making it much smaller for quicker downloads.
-
- def abbreviate(spec)
- spec.files = []
- spec.test_files = []
- spec.rdoc_options = []
- spec.extra_rdoc_files = []
- spec.cert_chain = []
- spec
- end
-
- ##
- # Build various indicies
-
- def build_indicies(index)
- # Marshal gemspecs are used by both modern and legacy RubyGems
- build_marshal_gemspecs index
- build_legacy_indicies index if @build_legacy
- build_modern_indicies index if @build_modern
- build_rss index
-
- compress_indicies
- end
-
- ##
- # Builds indicies for RubyGems older than 1.2.x
-
- def build_legacy_indicies(index)
- progress = ui.progress_reporter index.size,
- "Generating YAML quick index gemspecs for #{index.size} gems",
- "Complete"
-
- Gem.time 'Generated YAML quick index gemspecs' do
- index.each do |original_name, spec|
- spec_file_name = "#{original_name}.gemspec.rz"
- yaml_name = File.join @quick_dir, spec_file_name
-
- yaml_zipped = Gem.deflate spec.to_yaml
- open yaml_name, 'wb' do |io| io.write yaml_zipped end
-
- progress.updated original_name
- end
-
- progress.done
- end
-
- say "Generating quick index"
-
- Gem.time 'Generated quick index' do
- open @quick_index, 'wb' do |io|
- io.puts index.sort.map { |_, spec| spec.original_name }
- end
- end
-
- say "Generating latest index"
-
- Gem.time 'Generated latest index' do
- open @latest_index, 'wb' do |io|
- io.puts index.latest_specs.sort.map { |spec| spec.original_name }
- end
- end
-
- # Don't need prerelease legacy index
-
- say "Generating Marshal master index"
-
- Gem.time 'Generated Marshal master index' do
- open @marshal_index, 'wb' do |io|
- io.write index.dump
- end
- end
-
- progress = ui.progress_reporter index.size,
- "Generating YAML master index for #{index.size} gems (this may take a while)",
- "Complete"
-
- Gem.time 'Generated YAML master index' do
- open @master_index, 'wb' do |io|
- io.puts "--- !ruby/object:#{index.class}"
- io.puts "gems:"
-
- gems = index.sort_by { |name, gemspec| gemspec.sort_obj }
- gems.each do |original_name, gemspec|
- yaml = gemspec.to_yaml.gsub(/^/, ' ')
- yaml = yaml.sub(/\A ---/, '') # there's a needed extra ' ' here
- io.print " #{original_name}:"
- io.puts yaml
-
- progress.updated original_name
- end
- end
-
- progress.done
- end
-
- @files << @quick_dir
- @files << @master_index
- @files << "#{@master_index}.Z"
- @files << @marshal_index
- @files << "#{@marshal_index}.Z"
- end
-
- ##
- # Builds Marshal quick index gemspecs.
-
- def build_marshal_gemspecs(index)
- progress = ui.progress_reporter index.size,
- "Generating Marshal quick index gemspecs for #{index.size} gems",
- "Complete"
-
- files = []
-
- Gem.time 'Generated Marshal quick index gemspecs' do
- (index.gems.merge(index.prerelease_gems)).each do |original_name, spec|
- spec_file_name = "#{original_name}.gemspec.rz"
- marshal_name = File.join @quick_marshal_dir, spec_file_name
-
- marshal_zipped = Gem.deflate Marshal.dump(spec)
- open marshal_name, 'wb' do |io| io.write marshal_zipped end
-
- files << marshal_name
-
- progress.updated original_name
- end
-
- progress.done
- end
-
- @files << @quick_marshal_dir
-
- files
- end
-
- ##
- # Build a single index for RubyGems 1.2 and newer
-
- def build_modern_index(index, file, name)
- say "Generating #{name} index"
-
- Gem.time "Generated #{name} index" do
- open(file, 'wb') do |io|
- specs = index.map do |*spec|
- # We have to splat here because latest_specs is an array,
- # while the others are hashes. See the TODO in source_index.rb
- spec = spec.flatten.last
- platform = spec.original_platform
-
- # win32-api-1.0.4-x86-mswin32-60
- unless String === platform then
- alert_warning "Skipping invalid platform in gem: #{spec.full_name}"
- next
- end
-
- platform = Gem::Platform::RUBY if platform.nil? or platform.empty?
- [spec.name, spec.version, platform]
- end
-
- specs = compact_specs(specs)
- Marshal.dump(specs, io)
- end
- end
- end
-
- ##
- # Builds indicies for RubyGems 1.2 and newer. Handles full, latest, prerelease
-
- def build_modern_indicies(index)
- build_modern_index(index.sort, @specs_index, 'specs')
- build_modern_index(index.latest_specs.sort,
- @latest_specs_index,
- 'latest specs')
- build_modern_index(index.prerelease_specs.sort,
- @prerelease_specs_index,
- 'prerelease specs')
-
- @files += [@specs_index,
- "#{@specs_index}.gz",
- @latest_specs_index,
- "#{@latest_specs_index}.gz",
- @prerelease_specs_index,
- "#{@prerelease_specs_index}.gz"]
- end
-
- ##
- # Builds an RSS feed for past two days gem releases according to the gem's
- # date.
-
- def build_rss(index)
- if @rss_host.nil? or @rss_gems_host.nil? then
- if Gem.configuration.really_verbose then
- alert_warning "no --rss-host or --rss-gems-host, RSS generation disabled"
- end
- return
- end
-
- require 'cgi'
- require 'rubygems/text'
-
- extend Gem::Text
-
- Gem.time 'Generated rss' do
- open @rss_index, 'wb' do |io|
- rss_host = CGI.escapeHTML @rss_host
- rss_title = CGI.escapeHTML(@rss_title || 'gems')
-
- io.puts <<-HEADER
-<?xml version="1.0"?>
-<rss version="2.0">
- <channel>
- <title>#{rss_title}</title>
- <link>http://#{rss_host}</link>
- <description>Recently released gems from http://#{rss_host}</description>
- <generator>RubyGems v#{Gem::RubyGemsVersion}</generator>
- <docs>http://cyber.law.harvard.edu/rss/rss.html</docs>
- HEADER
-
- today = Gem::Specification::TODAY
- yesterday = today - 86400
-
- index = index.select do |_, spec|
- spec_date = spec.date
-
- case spec_date
- when Date
- Time.parse(spec_date.to_s) >= yesterday
- when Time
- spec_date >= yesterday
- end
- end
-
- index = index.select do |_, spec|
- spec_date = spec.date
-
- case spec_date
- when Date
- Time.parse(spec_date.to_s) <= today
- when Time
- spec_date <= today
- end
- end
-
- index.sort_by { |_, spec| [-spec.date.to_i, spec] }.each do |_, spec|
- gem_path = CGI.escapeHTML "http://#{@rss_gems_host}/gems/#{spec.full_name}.gem"
- size = File.stat(spec.loaded_from).size rescue next
-
- description = spec.description || spec.summary || ''
- authors = Array spec.authors
- emails = Array spec.email
- authors = emails.zip(authors).map do |email, author|
- email += " (#{author})" if author and not author.empty?
- end.join ', '
-
- description = description.split(/\n\n+/).map do |chunk|
- format_text chunk, 78
- end
-
- description = description.join "\n\n"
-
- item = ''
-
- item << <<-ITEM
- <item>
- <title>#{CGI.escapeHTML spec.full_name}</title>
- <description>
-&lt;pre&gt;#{CGI.escapeHTML description.chomp}&lt;/pre&gt;
- </description>
- <author>#{CGI.escapeHTML authors}</author>
- <guid>#{CGI.escapeHTML spec.full_name}</guid>
- <enclosure url=\"#{gem_path}\"
- length=\"#{size}\" type=\"application/octet-stream\" />
- <pubDate>#{spec.date.rfc2822}</pubDate>
- ITEM
-
- item << <<-ITEM if spec.homepage
- <link>#{CGI.escapeHTML spec.homepage}</link>
- ITEM
-
- item << <<-ITEM
- </item>
- ITEM
-
- io.puts item
- end
-
- io.puts <<-FOOTER
- </channel>
-</rss>
- FOOTER
- end
- end
-
- @files << @rss_index
- end
-
- ##
- # Collect specifications from .gem files from the gem directory.
-
- def collect_specs(gems = gem_file_list)
- index = Gem::SourceIndex.new
-
- progress = ui.progress_reporter gems.size,
- "Loading #{gems.size} gems from #{@dest_directory}",
- "Loaded all gems"
-
- Gem.time 'loaded' do
- gems.each do |gemfile|
- if File.size(gemfile.to_s) == 0 then
- alert_warning "Skipping zero-length gem: #{gemfile}"
- next
- end
-
- begin
- spec = Gem::Format.from_file_by_path(gemfile).spec
- spec.loaded_from = gemfile
-
- unless gemfile =~ /\/#{Regexp.escape spec.original_name}.*\.gem\z/i then
- expected_name = spec.full_name
- expected_name << " (#{spec.original_name})" if
- spec.original_name != spec.full_name
- alert_warning "Skipping misnamed gem: #{gemfile} should be named #{expected_name}"
- next
- end
-
- abbreviate spec
- sanitize spec
-
- index.add_spec spec, spec.original_name
-
- progress.updated spec.original_name
-
- rescue SignalException => e
- alert_error "Received signal, exiting"
- raise
- rescue Exception => e
- alert_error "Unable to process #{gemfile}\n#{e.message} (#{e.class})\n\t#{e.backtrace.join "\n\t"}"
- end
- end
-
- progress.done
- end
-
- index
- end
-
- ##
- # Compresses indicies on disk
- #--
- # All future files should be compressed using gzip, not deflate
-
- def compress_indicies
- say "Compressing indicies"
-
- Gem.time 'Compressed indicies' do
- if @build_legacy then
- compress @quick_index, 'rz'
- paranoid @quick_index, 'rz'
-
- compress @latest_index, 'rz'
- paranoid @latest_index, 'rz'
-
- compress @marshal_index, 'Z'
- paranoid @marshal_index, 'Z'
-
- compress @master_index, 'Z'
- paranoid @master_index, 'Z'
- end
-
- if @build_modern then
- gzip @specs_index
- gzip @latest_specs_index
- gzip @prerelease_specs_index
- end
- end
- end
-
- ##
- # Compacts Marshal output for the specs index data source by using identical
- # objects as much as possible.
-
- def compact_specs(specs)
- names = {}
- versions = {}
- platforms = {}
-
- specs.map do |(name, version, platform)|
- names[name] = name unless names.include? name
- versions[version] = version unless versions.include? version
- platforms[platform] = platform unless platforms.include? platform
-
- [names[name], versions[version], platforms[platform]]
- end
- end
-
- ##
- # Compress +filename+ with +extension+.
-
- def compress(filename, extension)
- data = Gem.read_binary filename
-
- zipped = Gem.deflate data
-
- open "#{filename}.#{extension}", 'wb' do |io|
- io.write zipped
- end
- end
-
- ##
- # List of gem file names to index.
-
- def gem_file_list
- Dir.glob(File.join(@dest_directory, "gems", "*.gem"))
- end
-
- ##
- # Builds and installs indicies.
-
- def generate_index
- make_temp_directories
- index = collect_specs
- build_indicies index
- install_indicies
- rescue SignalException
- ensure
- FileUtils.rm_rf @directory
- end
-
- ##
- # Zlib::GzipWriter wrapper that gzips +filename+ on disk.
-
- def gzip(filename)
- Zlib::GzipWriter.open "#{filename}.gz" do |io|
- io.write Gem.read_binary(filename)
- end
- end
-
- ##
- # Install generated indicies into the destination directory.
-
- def install_indicies
- verbose = Gem.configuration.really_verbose
-
- say "Moving index into production dir #{@dest_directory}" if verbose
-
- files = @files.dup
- files.delete @quick_marshal_dir if files.include? @quick_dir
-
- if files.include? @quick_marshal_dir and
- not files.include? @quick_dir then
- files.delete @quick_marshal_dir
- quick_marshal_dir = @quick_marshal_dir.sub @directory, ''
-
- dst_name = File.join @dest_directory, quick_marshal_dir
-
- FileUtils.mkdir_p File.dirname(dst_name), :verbose => verbose
- FileUtils.rm_rf dst_name, :verbose => verbose
- FileUtils.mv @quick_marshal_dir, dst_name, :verbose => verbose,
- :force => true
- end
-
- files = files.map do |path|
- path.sub @directory, ''
- end
-
- files.each do |file|
- src_name = File.join @directory, file
- dst_name = File.join @dest_directory, file
-
- FileUtils.rm_rf dst_name, :verbose => verbose
- FileUtils.mv src_name, @dest_directory, :verbose => verbose,
- :force => true
- end
- end
-
- ##
- # Make directories for index generation
-
- def make_temp_directories
- FileUtils.rm_rf @directory
- FileUtils.mkdir_p @directory, :mode => 0700
- FileUtils.mkdir_p @quick_marshal_dir
- end
-
- ##
- # Ensure +path+ and path with +extension+ are identical.
-
- def paranoid(path, extension)
- data = Gem.read_binary path
- compressed_data = Gem.read_binary "#{path}.#{extension}"
-
- unless data == Gem.inflate(compressed_data) then
- raise "Compressed file #{compressed_path} does not match uncompressed file #{path}"
- end
- end
-
- ##
- # Sanitize the descriptive fields in the spec. Sometimes non-ASCII
- # characters will garble the site index. Non-ASCII characters will
- # be replaced by their XML entity equivalent.
-
- def sanitize(spec)
- spec.summary = sanitize_string(spec.summary)
- spec.description = sanitize_string(spec.description)
- spec.post_install_message = sanitize_string(spec.post_install_message)
- spec.authors = spec.authors.collect { |a| sanitize_string(a) }
-
- spec
- end
-
- ##
- # Sanitize a single string.
-
- def sanitize_string(string)
- # HACK the #to_s is in here because RSpec has an Array of Arrays of
- # Strings for authors. Need a way to disallow bad values on gempsec
- # generation. (Probably won't happen.)
- string ? string.to_s.to_xs : string
- end
-
- ##
- # Perform an in-place update of the repository from newly added gems. Only
- # works for modern indicies, and sets #build_legacy to false when run.
-
- def update_index
- @build_legacy = false
-
- make_temp_directories
-
- specs_mtime = File.stat(@dest_specs_index).mtime
- newest_mtime = Time.at 0
-
- updated_gems = gem_file_list.select do |gem|
- gem_mtime = File.stat(gem).mtime
- newest_mtime = gem_mtime if gem_mtime > newest_mtime
- gem_mtime >= specs_mtime
- end
-
- if updated_gems.empty? then
- say 'No new gems'
- terminate_interaction 0
- end
-
- index = collect_specs updated_gems
-
- files = build_marshal_gemspecs index
-
- Gem.time 'Updated indexes' do
- update_specs_index index, @dest_specs_index, @specs_index
- update_specs_index index, @dest_latest_specs_index, @latest_specs_index
- update_specs_index(index.prerelease_gems, @dest_prerelease_specs_index,
- @prerelease_specs_index)
- end
-
- compress_indicies
-
- verbose = Gem.configuration.really_verbose
-
- say "Updating production dir #{@dest_directory}" if verbose
-
- files << @specs_index
- files << "#{@specs_index}.gz"
- files << @latest_specs_index
- files << "#{@latest_specs_index}.gz"
- files << @prerelease_specs_index
- files << "#{@prerelease_specs_index}.gz"
-
- files = files.map do |path|
- path.sub @directory, ''
- end
-
- files.each do |file|
- src_name = File.join @directory, file
- dst_name = File.join @dest_directory, File.dirname(file)
-
- FileUtils.mv src_name, dst_name, :verbose => verbose,
- :force => true
-
- File.utime newest_mtime, newest_mtime, dst_name
- end
- end
-
- ##
- # Combines specs in +index+ and +source+ then writes out a new copy to
- # +dest+. For a latest index, does not ensure the new file is minimal.
-
- def update_specs_index(index, source, dest)
- specs_index = Marshal.load Gem.read_binary(source)
-
- index.each do |_, spec|
- platform = spec.original_platform
- platform = Gem::Platform::RUBY if platform.nil? or platform.empty?
- specs_index << [spec.name, spec.version, platform]
- end
-
- specs_index = compact_specs specs_index.uniq.sort
-
- open dest, 'wb' do |io|
- Marshal.dump specs_index, io
- end
- end
-
-end
-
diff --git a/lib/rubygems/indexer/abstract_index_builder.rb b/lib/rubygems/indexer/abstract_index_builder.rb
deleted file mode 100644
index 5815dcda87..0000000000
--- a/lib/rubygems/indexer/abstract_index_builder.rb
+++ /dev/null
@@ -1,88 +0,0 @@
-require 'zlib'
-
-require 'rubygems/indexer'
-
-# Abstract base class for building gem indicies. Uses the template pattern
-# with subclass specialization in the +begin_index+, +end_index+ and +cleanup+
-# methods.
-class Gem::Indexer::AbstractIndexBuilder
-
- # Directory to put index files in
- attr_reader :directory
-
- # File name of the generated index
- attr_reader :filename
-
- # List of written files/directories to move into production
- attr_reader :files
-
- def initialize(filename, directory)
- @filename = filename
- @directory = directory
- @files = []
- end
-
- ##
- # Build a Gem index. Yields to block to handle the details of the
- # actual building. Calls +begin_index+, +end_index+ and +cleanup+ at
- # appropriate times to customize basic operations.
-
- def build
- FileUtils.mkdir_p @directory unless File.exist? @directory
- raise "not a directory: #{@directory}" unless File.directory? @directory
-
- file_path = File.join @directory, @filename
-
- @files << @filename
-
- File.open file_path, "wb" do |file|
- @file = file
- start_index
- yield
- end_index
- end
-
- cleanup
- ensure
- @file = nil
- end
-
- ##
- # Compress the given file.
-
- def compress(filename, ext="rz")
- data = open filename, 'rb' do |fp| fp.read end
-
- zipped = zip data
-
- File.open "#{filename}.#{ext}", "wb" do |file|
- file.write zipped
- end
- end
-
- # Called immediately before the yield in build. The index file is open and
- # available as @file.
- def start_index
- end
-
- # Called immediately after the yield in build. The index file is still open
- # and available as @file.
- def end_index
- end
-
- # Called from within builder after the index file has been closed.
- def cleanup
- end
-
- # Return an uncompressed version of a compressed string.
- def unzip(string)
- Zlib::Inflate.inflate(string)
- end
-
- # Return a compressed version of the given string.
- def zip(string)
- Zlib::Deflate.deflate(string)
- end
-
-end
-
diff --git a/lib/rubygems/indexer/latest_index_builder.rb b/lib/rubygems/indexer/latest_index_builder.rb
deleted file mode 100644
index a5798580a6..0000000000
--- a/lib/rubygems/indexer/latest_index_builder.rb
+++ /dev/null
@@ -1,35 +0,0 @@
-require 'rubygems/indexer'
-
-##
-# Construct the latest Gem index file.
-
-class Gem::Indexer::LatestIndexBuilder < Gem::Indexer::AbstractIndexBuilder
-
- def start_index
- super
-
- @index = Gem::SourceIndex.new
- end
-
- def end_index
- super
-
- latest = @index.latest_specs.sort.map { |spec| spec.original_name }
-
- @file.write latest.join("\n")
- end
-
- def cleanup
- super
-
- compress @file.path
-
- @files.delete 'latest_index' # HACK installed via QuickIndexBuilder :/
- end
-
- def add(spec)
- @index.add_spec(spec)
- end
-
-end
-
diff --git a/lib/rubygems/indexer/marshal_index_builder.rb b/lib/rubygems/indexer/marshal_index_builder.rb
deleted file mode 100644
index e1a4d9f9b8..0000000000
--- a/lib/rubygems/indexer/marshal_index_builder.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-require 'rubygems/indexer'
-
-# Construct the master Gem index file.
-class Gem::Indexer::MarshalIndexBuilder < Gem::Indexer::MasterIndexBuilder
- def end_index
- gems = {}
- index = Gem::SourceIndex.new
-
- @index.each do |name, gemspec|
- gems[gemspec.original_name] = gemspec
- end
-
- index.instance_variable_get(:@gems).replace gems
-
- @file.write index.dump
- end
-end
diff --git a/lib/rubygems/indexer/master_index_builder.rb b/lib/rubygems/indexer/master_index_builder.rb
deleted file mode 100644
index 669ea5a1df..0000000000
--- a/lib/rubygems/indexer/master_index_builder.rb
+++ /dev/null
@@ -1,54 +0,0 @@
-require 'rubygems/indexer'
-
-##
-# Construct the master Gem index file.
-
-class Gem::Indexer::MasterIndexBuilder < Gem::Indexer::AbstractIndexBuilder
-
- def start_index
- super
- @index = Gem::SourceIndex.new
- end
-
- def end_index
- super
-
- @file.puts "--- !ruby/object:#{@index.class}"
- @file.puts "gems:"
-
- gems = @index.sort_by { |name, gemspec| gemspec.sort_obj }
- gems.each do |name, gemspec|
- yaml = gemspec.to_yaml.gsub(/^/, ' ')
- yaml = yaml.sub(/\A ---/, '') # there's a needed extra ' ' here
- @file.print " #{gemspec.original_name}:"
- @file.puts yaml
- end
- end
-
- def cleanup
- super
-
- index_file_name = File.join @directory, @filename
-
- compress index_file_name, "Z"
- paranoid index_file_name, "#{index_file_name}.Z"
-
- @files << "#{@filename}.Z"
- end
-
- def add(spec)
- @index.add_spec(spec)
- end
-
- private
-
- def paranoid(path, compressed_path)
- data = Gem.read_binary path
- compressed_data = Gem.read_binary compressed_path
-
- if data != unzip(compressed_data) then
- raise "Compressed file #{compressed_path} does not match uncompressed file #{path}"
- end
- end
-
-end
diff --git a/lib/rubygems/indexer/quick_index_builder.rb b/lib/rubygems/indexer/quick_index_builder.rb
deleted file mode 100644
index dc36179dc5..0000000000
--- a/lib/rubygems/indexer/quick_index_builder.rb
+++ /dev/null
@@ -1,50 +0,0 @@
-require 'rubygems/indexer'
-
-##
-# Construct a quick index file and all of the individual specs to support
-# incremental loading.
-
-class Gem::Indexer::QuickIndexBuilder < Gem::Indexer::AbstractIndexBuilder
-
- def initialize(filename, directory)
- directory = File.join directory, 'quick'
-
- super filename, directory
- end
-
- def cleanup
- super
-
- quick_index_file = File.join @directory, @filename
- compress quick_index_file
-
- # the complete quick index is in a directory, so move it as a whole
- @files.delete 'index'
- @files << 'quick'
- end
-
- def add(spec)
- @file.puts spec.original_name
- add_yaml(spec)
- add_marshal(spec)
- end
-
- def add_yaml(spec)
- fn = File.join @directory, "#{spec.original_name}.gemspec.rz"
- zipped = zip spec.to_yaml
- File.open fn, "wb" do |gsfile| gsfile.write zipped end
- end
-
- def add_marshal(spec)
- # HACK why does this not work in #initialize?
- FileUtils.mkdir_p File.join(@directory, "Marshal.#{Gem.marshal_version}")
-
- fn = File.join @directory, "Marshal.#{Gem.marshal_version}",
- "#{spec.original_name}.gemspec.rz"
-
- zipped = zip Marshal.dump(spec)
- File.open fn, "wb" do |gsfile| gsfile.write zipped end
- end
-
-end
-
diff --git a/lib/rubygems/install_update_options.rb b/lib/rubygems/install_update_options.rb
deleted file mode 100644
index a43a2a171c..0000000000
--- a/lib/rubygems/install_update_options.rb
+++ /dev/null
@@ -1,125 +0,0 @@
-#--
-# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
-# All rights reserved.
-# See LICENSE.txt for permissions.
-#++
-
-require 'rubygems'
-require 'rubygems/security'
-
-##
-# Mixin methods for install and update options for Gem::Commands
-
-module Gem::InstallUpdateOptions
-
- ##
- # Add the install/update options to the option parser.
-
- def add_install_update_options
- OptionParser.accept Gem::Security::Policy do |value|
- value = Gem::Security::Policies[value]
- raise OptionParser::InvalidArgument, value if value.nil?
- value
- end
-
- add_option(:"Install/Update", '-i', '--install-dir DIR',
- 'Gem repository directory to get installed',
- 'gems') do |value, options|
- options[:install_dir] = File.expand_path(value)
- end
-
- add_option(:"Install/Update", '-n', '--bindir DIR',
- 'Directory where binary files are',
- 'located') do |value, options|
- options[:bin_dir] = File.expand_path(value)
- end
-
- add_option(:"Install/Update", '-d', '--[no-]rdoc',
- 'Generate RDoc documentation for the gem on',
- 'install') do |value, options|
- options[:generate_rdoc] = value
- end
-
- add_option(:"Install/Update", '--[no-]ri',
- 'Generate RI documentation for the gem on',
- 'install') do |value, options|
- options[:generate_ri] = value
- end
-
- add_option(:"Install/Update", '-E', '--[no-]env-shebang',
- "Rewrite the shebang line on installed",
- "scripts to use /usr/bin/env") do |value, options|
- options[:env_shebang] = value
- end
-
- add_option(:"Install/Update", '-f', '--[no-]force',
- 'Force gem to install, bypassing dependency',
- 'checks') do |value, options|
- options[:force] = value
- end
-
- add_option(:"Install/Update", '-t', '--[no-]test',
- 'Run unit tests prior to installation') do |value, options|
- options[:test] = value
- end
-
- add_option(:"Install/Update", '-w', '--[no-]wrappers',
- 'Use bin wrappers for executables',
- 'Not available on dosish platforms') do |value, options|
- options[:wrappers] = value
- end
-
- add_option(:"Install/Update", '-P', '--trust-policy POLICY',
- Gem::Security::Policy,
- 'Specify gem trust policy') do |value, options|
- options[:security_policy] = value
- end
-
- add_option(:"Install/Update", '--ignore-dependencies',
- 'Do not install any required dependent gems') do |value, options|
- options[:ignore_dependencies] = value
- end
-
- add_option(:"Install/Update", '-y', '--include-dependencies',
- 'Unconditionally install the required',
- 'dependent gems') do |value, options|
- options[:include_dependencies] = value
- end
-
- add_option(:"Install/Update", '--[no-]format-executable',
- 'Make installed executable names match ruby.',
- 'If ruby is ruby18, foo_exec will be',
- 'foo_exec18') do |value, options|
- options[:format_executable] = value
- end
-
- add_option(:"Install/Update", '--[no-]user-install',
- 'Install in user\'s home directory instead',
- 'of GEM_HOME. Defaults to using home',
- 'only if GEM_HOME is not writable.') do |value, options|
- options[:user_install] = value
- end
-
- add_option(:"Install/Update", "--development",
- "Install any additional development",
- "dependencies") do |value, options|
- options[:development] = true
- end
-
- add_option(:"Install/Update", "--prerelease",
- "Install prerelease versions of a gem if",
- "available. Defaults to skipping",
- "prereleases.") do |value, options|
- options[:prerelease] = true
- end
- end
-
- ##
- # Default options for the gem install command.
-
- def install_update_defaults_str
- '--rdoc --no-force --no-test --wrappers'
- end
-
-end
-
diff --git a/lib/rubygems/installer.rb b/lib/rubygems/installer.rb
deleted file mode 100644
index e9910876f3..0000000000
--- a/lib/rubygems/installer.rb
+++ /dev/null
@@ -1,589 +0,0 @@
-#--
-# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
-# All rights reserved.
-# See LICENSE.txt for permissions.
-#++
-
-require 'fileutils'
-require 'pathname'
-require 'rbconfig'
-
-require 'rubygems/format'
-require 'rubygems/ext'
-require 'rubygems/require_paths_builder'
-
-##
-# The installer class processes RubyGem .gem files and installs the files
-# contained in the .gem into the Gem.path.
-#
-# Gem::Installer does the work of putting files in all the right places on the
-# filesystem including unpacking the gem into its gem dir, installing the
-# gemspec in the specifications dir, storing the cached gem in the cache dir,
-# and installing either wrappers or symlinks for executables.
-#
-# The installer fires pre and post install hooks. Hooks can be added either
-# through a rubygems_plugin.rb file in an installed gem or via a
-# rubygems/defaults/#{RUBY_ENGINE}.rb or rubygems/defaults/operating_system.rb
-# file. See Gem.pre_install and Gem.post_install for details.
-
-class Gem::Installer
-
- ##
- # Paths where env(1) might live. Some systems are broken and have it in
- # /bin
-
- ENV_PATHS = %w[/usr/bin/env /bin/env]
-
- ##
- # Raised when there is an error while building extensions.
- #
- class ExtensionBuildError < Gem::InstallError; end
-
- include Gem::UserInteraction
-
- include Gem::RequirePathsBuilder
-
- ##
- # The directory a gem's executables will be installed into
-
- attr_reader :bin_dir
-
- ##
- # The gem repository the gem will be installed into
-
- attr_reader :gem_home
-
- ##
- # The Gem::Specification for the gem being installed
-
- attr_reader :spec
-
- @home_install_warning = false
- @path_warning = false
-
- class << self
-
- ##
- # True if we've warned about ~/.gems install
-
- attr_accessor :home_install_warning
-
- ##
- # True if we've warned about PATH not including Gem.bindir
-
- attr_accessor :path_warning
-
- attr_writer :exec_format
-
- # Defaults to use Ruby's program prefix and suffix.
- def exec_format
- @exec_format ||= Gem.default_exec_format
- end
-
- end
-
- ##
- # Constructs an Installer instance that will install the gem located at
- # +gem+. +options+ is a Hash with the following keys:
- #
- # :env_shebang:: Use /usr/bin/env in bin wrappers.
- # :force:: Overrides all version checks and security policy checks, except
- # for a signed-gems-only policy.
- # :ignore_dependencies:: Don't raise if a dependency is missing.
- # :install_dir:: The directory to install the gem into.
- # :format_executable:: Format the executable the same as the ruby executable.
- # If your ruby is ruby18, foo_exec will be installed as
- # foo_exec18.
- # :security_policy:: Use the specified security policy. See Gem::Security
- # :wrappers:: Install wrappers if true, symlinks if false.
-
- def initialize(gem, options={})
- @gem = gem
-
- options = {
- :bin_dir => nil,
- :env_shebang => false,
- :exec_format => false,
- :force => false,
- :install_dir => Gem.dir,
- :source_index => Gem.source_index,
- }.merge options
-
- @env_shebang = options[:env_shebang]
- @force = options[:force]
- gem_home = options[:install_dir]
- @gem_home = Pathname.new(gem_home).expand_path
- @ignore_dependencies = options[:ignore_dependencies]
- @format_executable = options[:format_executable]
- @security_policy = options[:security_policy]
- @wrappers = options[:wrappers]
- @bin_dir = options[:bin_dir]
- @development = options[:development]
- @source_index = options[:source_index]
-
- begin
- @format = Gem::Format.from_file_by_path @gem, @security_policy
- rescue Gem::Package::FormatError
- raise Gem::InstallError, "invalid gem format for #{@gem}"
- end
-
- begin
- FileUtils.mkdir_p @gem_home
- rescue Errno::EACCES, Errno::ENOTDIR
- # We'll divert to ~/.gems below
- end
-
- if not File.writable? @gem_home or
- # TODO: Shouldn't have to test for existence of bindir; tests need it.
- (@gem_home.to_s == Gem.dir and File.exist? Gem.bindir and
- not File.writable? Gem.bindir) then
- if options[:user_install] == false then # You don't want to use ~
- raise Gem::FilePermissionError, @gem_home
- elsif options[:user_install].nil? then
- unless self.class.home_install_warning or options[:unpack] then
- alert_warning "Installing to ~/.gem since #{@gem_home} and\n\t #{Gem.bindir} aren't both writable."
- self.class.home_install_warning = true
- end
- end
- options[:user_install] = true
- end
-
- if options[:user_install] and not options[:unpack] then
- @gem_home = Gem.user_dir
-
- user_bin_dir = File.join(@gem_home, 'bin')
- unless ENV['PATH'].split(File::PATH_SEPARATOR).include? user_bin_dir then
- unless self.class.path_warning then
- alert_warning "You don't have #{user_bin_dir} in your PATH,\n\t gem executables will not run."
- self.class.path_warning = true
- end
- end
-
- FileUtils.mkdir_p @gem_home unless File.directory? @gem_home
- # If it's still not writable, you've got issues.
- raise Gem::FilePermissionError, @gem_home unless File.writable? @gem_home
- end
-
- @spec = @format.spec
-
- @gem_dir = File.join(@gem_home, "gems", @spec.full_name).untaint
- end
-
- ##
- # Installs the gem and returns a loaded Gem::Specification for the installed
- # gem.
- #
- # The gem will be installed with the following structure:
- #
- # @gem_home/
- # cache/<gem-version>.gem #=> a cached copy of the installed gem
- # gems/<gem-version>/... #=> extracted files
- # specifications/<gem-version>.gemspec #=> the Gem::Specification
-
- def install
- # If we're forcing the install then disable security unless the security
- # policy says that we only install singed gems.
- @security_policy = nil if @force and @security_policy and
- not @security_policy.only_signed
-
- unless @force then
- if rrv = @spec.required_ruby_version then
- unless rrv.satisfied_by? Gem.ruby_version then
- raise Gem::InstallError, "#{@spec.name} requires Ruby version #{rrv}"
- end
- end
-
- if rrgv = @spec.required_rubygems_version then
- unless rrgv.satisfied_by? Gem::Version.new(Gem::RubyGemsVersion) then
- raise Gem::InstallError,
- "#{@spec.name} requires RubyGems version #{rrgv}"
- end
- end
-
- unless @ignore_dependencies then
- deps = @spec.runtime_dependencies
- deps |= @spec.development_dependencies if @development
-
- deps.each do |dep_gem|
- ensure_dependency @spec, dep_gem
- end
- end
- end
-
- Gem.pre_install_hooks.each do |hook|
- hook.call self
- end
-
- FileUtils.mkdir_p @gem_home unless File.directory? @gem_home
-
- Gem.ensure_gem_subdirectories @gem_home
-
- FileUtils.mkdir_p @gem_dir
-
- extract_files
- generate_bin
- build_extensions
- write_spec
-
- write_require_paths_file_if_needed
-
- # HACK remove? Isn't this done in multiple places?
- cached_gem = File.join @gem_home, "cache", @gem.split(/\//).pop
- unless File.exist? cached_gem then
- FileUtils.cp @gem, File.join(@gem_home, "cache")
- end
-
- say @spec.post_install_message unless @spec.post_install_message.nil?
-
- @spec.loaded_from = File.join(@gem_home, 'specifications',
- "#{@spec.full_name}.gemspec")
-
- @source_index.add_spec @spec
-
- Gem.post_install_hooks.each do |hook|
- hook.call self
- end
-
- return @spec
- rescue Zlib::GzipFile::Error
- raise Gem::InstallError, "gzip error installing #{@gem}"
- end
-
- ##
- # Ensure that the dependency is satisfied by the current installation of
- # gem. If it is not an exception is raised.
- #
- # spec :: Gem::Specification
- # dependency :: Gem::Dependency
-
- def ensure_dependency(spec, dependency)
- unless installation_satisfies_dependency? dependency then
- raise Gem::InstallError, "#{spec.name} requires #{dependency}"
- end
-
- true
- end
-
- ##
- # True if the gems in the source_index satisfy +dependency+.
-
- def installation_satisfies_dependency?(dependency)
- @source_index.find_name(dependency.name, dependency.version_requirements).size > 0
- end
-
- ##
- # Unpacks the gem into the given directory.
-
- def unpack(directory)
- @gem_dir = directory
- @format = Gem::Format.from_file_by_path @gem, @security_policy
- extract_files
- end
-
- ##
- # Writes the .gemspec specification (in Ruby) to the gem home's
- # specifications directory.
-
- def write_spec
- rubycode = @spec.to_ruby
-
- file_name = File.join @gem_home, 'specifications',
- "#{@spec.full_name}.gemspec"
-
- file_name.untaint
-
- File.open(file_name, "w") do |file|
- file.puts rubycode
- end
- end
-
- ##
- # Creates windows .bat files for easy running of commands
-
- def generate_windows_script(bindir, filename)
- if Gem.win_platform? then
- script_name = filename + ".bat"
- script_path = File.join bindir, File.basename(script_name)
- File.open script_path, 'w' do |file|
- file.puts windows_stub_script(bindir, filename)
- end
-
- say script_path if Gem.configuration.really_verbose
- end
- end
-
- def generate_bin
- return if @spec.executables.nil? or @spec.executables.empty?
-
- # If the user has asked for the gem to be installed in a directory that is
- # the system gem directory, then use the system bin directory, else create
- # (or use) a new bin dir under the gem_home.
- bindir = @bin_dir ? @bin_dir : Gem.bindir(@gem_home)
-
- Dir.mkdir bindir unless File.exist? bindir
- raise Gem::FilePermissionError.new(bindir) unless File.writable? bindir
-
- @spec.executables.each do |filename|
- filename.untaint
- bin_path = File.expand_path File.join(@gem_dir, @spec.bindir, filename)
- mode = File.stat(bin_path).mode | 0111
- File.chmod mode, bin_path
-
- if @wrappers then
- generate_bin_script filename, bindir
- else
- generate_bin_symlink filename, bindir
- end
- end
- end
-
- ##
- # Creates the scripts to run the applications in the gem.
- #--
- # The Windows script is generated in addition to the regular one due to a
- # bug or misfeature in the Windows shell's pipe. See
- # http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/193379
-
- def generate_bin_script(filename, bindir)
- bin_script_path = File.join bindir, formatted_program_filename(filename)
-
- exec_path = File.join @gem_dir, @spec.bindir, filename
-
- # HACK some gems don't have #! in their executables, restore 2008/06
- #if File.read(exec_path, 2) == '#!' then
- FileUtils.rm_f bin_script_path # prior install may have been --no-wrappers
-
- File.open bin_script_path, 'w', 0755 do |file|
- file.print app_script_text(filename)
- end
-
- say bin_script_path if Gem.configuration.really_verbose
-
- generate_windows_script bindir, filename
- #else
- # FileUtils.rm_f bin_script_path
- # FileUtils.cp exec_path, bin_script_path,
- # :verbose => Gem.configuration.really_verbose
- #end
- end
-
- ##
- # Creates the symlinks to run the applications in the gem. Moves
- # the symlink if the gem being installed has a newer version.
-
- def generate_bin_symlink(filename, bindir)
- if Gem.win_platform? then
- alert_warning "Unable to use symlinks on Windows, installing wrapper"
- generate_bin_script filename, bindir
- return
- end
-
- src = File.join @gem_dir, 'bin', filename
- dst = File.join bindir, formatted_program_filename(filename)
-
- if File.exist? dst then
- if File.symlink? dst then
- link = File.readlink(dst).split File::SEPARATOR
- cur_version = Gem::Version.create(link[-3].sub(/^.*-/, ''))
- return if @spec.version < cur_version
- end
- File.unlink dst
- end
-
- FileUtils.symlink src, dst, :verbose => Gem.configuration.really_verbose
- end
-
- ##
- # Generates a #! line for +bin_file_name+'s wrapper copying arguments if
- # necessary.
-
- def shebang(bin_file_name)
- ruby_name = Gem::ConfigMap[:ruby_install_name] if @env_shebang
- path = File.join @gem_dir, @spec.bindir, bin_file_name
- first_line = File.open(path, "rb") {|file| file.gets}
-
- if /\A#!/ =~ first_line then
- # Preserve extra words on shebang line, like "-w". Thanks RPA.
- shebang = first_line.sub(/\A\#!.*?ruby\S*(?=(\s+\S+))/, "#!#{Gem.ruby}")
- opts = $1
- shebang.strip! # Avoid nasty ^M issues.
- end
-
- if not ruby_name then
- "#!#{Gem.ruby}#{opts}"
- elsif opts then
- "#!/bin/sh\n'exec' #{ruby_name.dump} '-x' \"$0\" \"$@\"\n#{shebang}"
- else
- # Create a plain shebang line.
- @env_path ||= ENV_PATHS.find {|env_path| File.executable? env_path }
- "#!#{@env_path} #{ruby_name}"
- end
- end
-
- ##
- # Return the text for an application file.
-
- def app_script_text(bin_file_name)
- <<-TEXT
-#{shebang bin_file_name}
-#
-# This file was generated by RubyGems.
-#
-# The application '#{@spec.name}' is installed as part of a gem, and
-# this file is here to facilitate running it.
-#
-
-require 'rubygems'
-
-version = "#{Gem::Requirement.default}"
-
-if ARGV.first =~ /^_(.*)_$/ and Gem::Version.correct? $1 then
- version = $1
- ARGV.shift
-end
-
-gem '#{@spec.name}', version
-load Gem.bin_path('#{@spec.name}', '#{bin_file_name}', version)
-TEXT
- end
-
- ##
- # return the stub script text used to launch the true ruby script
-
- def windows_stub_script(bindir, bin_file_name)
- <<-TEXT
-@ECHO OFF
-IF NOT "%~f0" == "~f0" GOTO :WinNT
-@"#{File.basename(Gem.ruby).chomp('"')}" "#{File.join(bindir, bin_file_name)}" %1 %2 %3 %4 %5 %6 %7 %8 %9
-GOTO :EOF
-:WinNT
-@"#{File.basename(Gem.ruby).chomp('"')}" "%~dpn0" %*
-TEXT
- end
-
- ##
- # Builds extensions. Valid types of extensions are extconf.rb files,
- # configure scripts and rakefiles or mkrf_conf files.
-
- def build_extensions
- return if @spec.extensions.empty?
- say "Building native extensions. This could take a while..."
- start_dir = Dir.pwd
- dest_path = File.join @gem_dir, @spec.require_paths.first
- ran_rake = false # only run rake once
-
- @spec.extensions.each do |extension|
- break if ran_rake
- results = []
-
- builder = case extension
- when /extconf/ then
- Gem::Ext::ExtConfBuilder
- when /configure/ then
- Gem::Ext::ConfigureBuilder
- when /rakefile/i, /mkrf_conf/i then
- ran_rake = true
- Gem::Ext::RakeBuilder
- else
- results = ["No builder for extension '#{extension}'"]
- nil
- end
-
- begin
- Dir.chdir File.join(@gem_dir, File.dirname(extension))
- results = builder.build(extension, @gem_dir, dest_path, results)
-
- say results.join("\n") if Gem.configuration.really_verbose
-
- rescue => ex
- results = results.join "\n"
-
- File.open('gem_make.out', 'wb') { |f| f.puts results }
-
- message = <<-EOF
-ERROR: Failed to build gem native extension.
-
-#{results}
-
-Gem files will remain installed in #{@gem_dir} for inspection.
-Results logged to #{File.join(Dir.pwd, 'gem_make.out')}
- EOF
-
- raise ExtensionBuildError, message
- ensure
- Dir.chdir start_dir
- end
- end
- end
-
- ##
- # Reads the file index and extracts each file into the gem directory.
- #
- # Ensures that files can't be installed outside the gem directory.
-
- def extract_files
- expand_and_validate_gem_dir
-
- raise ArgumentError, "format required to extract from" if @format.nil?
-
- @format.file_entries.each do |entry, file_data|
- path = entry['path'].untaint
-
- if path =~ /\A\// then # for extra sanity
- raise Gem::InstallError,
- "attempt to install file into #{entry['path'].inspect}"
- end
-
- path = File.expand_path File.join(@gem_dir, path)
-
- if path !~ /\A#{Regexp.escape @gem_dir}/ then
- msg = "attempt to install file into %p under %p" %
- [entry['path'], @gem_dir]
- raise Gem::InstallError, msg
- end
-
- FileUtils.rm_rf(path) if File.exists?(path)
- FileUtils.mkdir_p File.dirname(path)
-
- File.open(path, "wb") do |out|
- out.write file_data
- end
-
- FileUtils.chmod entry['mode'], path
-
- say path if Gem.configuration.really_verbose
- end
- end
-
- ##
- # Prefix and suffix the program filename the same as ruby.
-
- def formatted_program_filename(filename)
- if @format_executable then
- self.class.exec_format % File.basename(filename)
- else
- filename
- end
- end
-
- private
-
- ##
- # HACK Pathname is broken on windows.
-
- def absolute_path? pathname
- pathname.absolute? or (Gem.win_platform? and pathname.to_s =~ /\A[a-z]:/i)
- end
-
- def expand_and_validate_gem_dir
- @gem_dir = Pathname.new(@gem_dir).expand_path
-
- unless absolute_path?(@gem_dir) then # HACK is this possible after #expand_path?
- raise ArgumentError, "install directory %p not absolute" % @gem_dir
- end
-
- @gem_dir = @gem_dir.to_s
- end
-
-end
-
diff --git a/lib/rubygems/local_remote_options.rb b/lib/rubygems/local_remote_options.rb
deleted file mode 100644
index e238c7292c..0000000000
--- a/lib/rubygems/local_remote_options.rb
+++ /dev/null
@@ -1,135 +0,0 @@
-#--
-# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
-# All rights reserved.
-# See LICENSE.txt for permissions.
-#++
-
-require 'uri'
-require 'rubygems'
-
-##
-# Mixin methods for local and remote Gem::Command options.
-
-module Gem::LocalRemoteOptions
-
- ##
- # Allows OptionParser to handle HTTP URIs.
-
- def accept_uri_http
- OptionParser.accept URI::HTTP do |value|
- begin
- uri = URI.parse value
- rescue URI::InvalidURIError
- raise OptionParser::InvalidArgument, value
- end
-
- unless ['http', 'https', 'file'].include?(uri.scheme)
- raise OptionParser::InvalidArgument, value
- end
-
- value
- end
- end
-
- ##
- # Add local/remote options to the command line parser.
-
- def add_local_remote_options
- add_option(:"Local/Remote", '-l', '--local',
- 'Restrict operations to the LOCAL domain') do |value, options|
- options[:domain] = :local
- end
-
- add_option(:"Local/Remote", '-r', '--remote',
- 'Restrict operations to the REMOTE domain') do |value, options|
- options[:domain] = :remote
- end
-
- add_option(:"Local/Remote", '-b', '--both',
- 'Allow LOCAL and REMOTE operations') do |value, options|
- options[:domain] = :both
- end
-
- add_bulk_threshold_option
- add_source_option
- add_proxy_option
- add_update_sources_option
- end
-
- ##
- # Add the --bulk-threshold option
-
- def add_bulk_threshold_option
- add_option(:"Local/Remote", '-B', '--bulk-threshold COUNT',
- "Threshold for switching to bulk",
- "synchronization (default #{Gem.configuration.bulk_threshold})") do
- |value, options|
- Gem.configuration.bulk_threshold = value.to_i
- end
- end
-
- ##
- # Add the --http-proxy option
-
- def add_proxy_option
- accept_uri_http
-
- add_option(:"Local/Remote", '-p', '--[no-]http-proxy [URL]', URI::HTTP,
- 'Use HTTP proxy for remote operations') do |value, options|
- options[:http_proxy] = (value == false) ? :no_proxy : value
- Gem.configuration[:http_proxy] = options[:http_proxy]
- end
- end
-
- ##
- # Add the --source option
-
- def add_source_option
- accept_uri_http
-
- add_option(:"Local/Remote", '--source URL', URI::HTTP,
- 'Use URL as the remote source for gems') do |source, options|
- source << '/' if source !~ /\/\z/
-
- if options[:added_source] then
- Gem.sources << source unless Gem.sources.include?(source)
- else
- options[:added_source] = true
- Gem.sources.replace [source]
- end
- end
- end
-
- ##
- # Add the --update-sources option
-
- def add_update_sources_option
- add_option(:"Local/Remote", '-u', '--[no-]update-sources',
- 'Update local source cache') do |value, options|
- Gem.configuration.update_sources = value
- end
- end
-
- ##
- # Is fetching of local and remote information enabled?
-
- def both?
- options[:domain] == :both
- end
-
- ##
- # Is local fetching enabled?
-
- def local?
- options[:domain] == :local || options[:domain] == :both
- end
-
- ##
- # Is remote fetching enabled?
-
- def remote?
- options[:domain] == :remote || options[:domain] == :both
- end
-
-end
-
diff --git a/lib/rubygems/old_format.rb b/lib/rubygems/old_format.rb
deleted file mode 100644
index 43967db412..0000000000
--- a/lib/rubygems/old_format.rb
+++ /dev/null
@@ -1,152 +0,0 @@
-#--
-# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
-# All rights reserved.
-# See LICENSE.txt for permissions.
-#++
-
-require 'rubygems'
-require 'fileutils'
-require 'yaml'
-require 'zlib'
-
-##
-# The format class knows the guts of the RubyGem .gem file format and provides
-# the capability to read gem files
-
-class Gem::OldFormat
-
- attr_accessor :spec, :file_entries, :gem_path
-
- ##
- # Constructs an instance of a Format object, representing the gem's data
- # structure.
- #
- # gem:: [String] The file name of the gem
-
- def initialize(gem_path)
- @gem_path = gem_path
- end
-
- ##
- # Reads the named gem file and returns a Format object, representing the
- # data from the gem file
- #
- # file_path:: [String] Path to the gem file
-
- def self.from_file_by_path(file_path)
- unless File.exist?(file_path)
- raise Gem::Exception, "Cannot load gem file [#{file_path}]"
- end
-
- File.open(file_path, 'rb') do |file|
- from_io(file, file_path)
- end
- end
-
- ##
- # Reads a gem from an io stream and returns a Format object, representing
- # the data from the gem file
- #
- # io:: [IO] Stream from which to read the gem
-
- def self.from_io(io, gem_path="(io)")
- format = self.new(gem_path)
- skip_ruby(io)
- format.spec = read_spec(io)
- format.file_entries = []
- read_files_from_gem(io) do |entry, file_data|
- format.file_entries << [entry, file_data]
- end
- format
- end
-
- private
-
- ##
- # Skips the Ruby self-install header. After calling this method, the
- # IO index will be set after the Ruby code.
- #
- # file:: [IO] The IO to process (skip the Ruby code)
-
- def self.skip_ruby(file)
- end_seen = false
- loop {
- line = file.gets
- if(line == nil || line.chomp == "__END__") then
- end_seen = true
- break
- end
- }
-
- if end_seen == false then
- raise Gem::Exception.new("Failed to find end of ruby script while reading gem")
- end
- end
-
- ##
- # Reads the specification YAML from the supplied IO and constructs
- # a Gem::Specification from it. After calling this method, the
- # IO index will be set after the specification header.
- #
- # file:: [IO] The IO to process
-
- def self.read_spec(file)
- yaml = ''
-
- read_until_dashes file do |line|
- yaml << line
- end
-
- Gem::Specification.from_yaml yaml
- rescue YAML::Error => e
- raise Gem::Exception, "Failed to parse gem specification out of gem file"
- rescue ArgumentError => e
- raise Gem::Exception, "Failed to parse gem specification out of gem file"
- end
-
- ##
- # Reads lines from the supplied IO until a end-of-yaml (---) is
- # reached
- #
- # file:: [IO] The IO to process
- # block:: [String] The read line
-
- def self.read_until_dashes(file)
- while((line = file.gets) && line.chomp.strip != "---") do
- yield line
- end
- end
-
- ##
- # Reads the embedded file data from a gem file, yielding an entry
- # containing metadata about the file and the file contents themselves
- # for each file that's archived in the gem.
- # NOTE: Many of these methods should be extracted into some kind of
- # Gem file read/writer
- #
- # gem_file:: [IO] The IO to process
-
- def self.read_files_from_gem(gem_file)
- errstr = "Error reading files from gem"
- header_yaml = ''
- begin
- self.read_until_dashes(gem_file) do |line|
- header_yaml << line
- end
- header = YAML.load(header_yaml)
- raise Gem::Exception, errstr unless header
-
- header.each do |entry|
- file_data = ''
- self.read_until_dashes(gem_file) do |line|
- file_data << line
- end
- yield [entry, Zlib::Inflate.inflate(file_data.strip.unpack("m")[0])]
- end
- rescue Zlib::DataError => e
- raise Gem::Exception, errstr
- end
- end
-
-end
-
diff --git a/lib/rubygems/package.rb b/lib/rubygems/package.rb
deleted file mode 100644
index 9cb393b0c7..0000000000
--- a/lib/rubygems/package.rb
+++ /dev/null
@@ -1,95 +0,0 @@
-#++
-# Copyright (C) 2004 Mauricio Julio Fernndez Pradier
-# See LICENSE.txt for additional licensing information.
-#--
-
-require 'fileutils'
-require 'find'
-require 'stringio'
-require 'yaml'
-require 'zlib'
-
-require 'rubygems/digest/md5'
-require 'rubygems/security'
-require 'rubygems/specification'
-
-# Wrapper for FileUtils meant to provide logging and additional operations if
-# needed.
-class Gem::FileOperations
-
- def initialize(logger = nil)
- @logger = logger
- end
-
- def method_missing(meth, *args, &block)
- case
- when FileUtils.respond_to?(meth)
- @logger.log "#{meth}: #{args}" if @logger
- FileUtils.send meth, *args, &block
- when Gem::FileOperations.respond_to?(meth)
- @logger.log "#{meth}: #{args}" if @logger
- Gem::FileOperations.send meth, *args, &block
- else
- super
- end
- end
-
-end
-
-module Gem::Package
-
- class Error < StandardError; end
- class NonSeekableIO < Error; end
- class ClosedIO < Error; end
- class BadCheckSum < Error; end
- class TooLongFileName < Error; end
- class FormatError < Error; end
-
- def self.open(io, mode = "r", signer = nil, &block)
- tar_type = case mode
- when 'r' then TarInput
- when 'w' then TarOutput
- else
- raise "Unknown Package open mode"
- end
-
- tar_type.open(io, signer, &block)
- end
-
- def self.pack(src, destname, signer = nil)
- TarOutput.open(destname, signer) do |outp|
- dir_class.chdir(src) do
- outp.metadata = (file_class.read("RPA/metadata") rescue nil)
- find_class.find('.') do |entry|
- case
- when file_class.file?(entry)
- entry.sub!(%r{\./}, "")
- next if entry =~ /\ARPA\//
- stat = File.stat(entry)
- outp.add_file_simple(entry, stat.mode, stat.size) do |os|
- file_class.open(entry, "rb") do |f|
- os.write(f.read(4096)) until f.eof?
- end
- end
- when file_class.dir?(entry)
- entry.sub!(%r{\./}, "")
- next if entry == "RPA"
- outp.mkdir(entry, file_class.stat(entry).mode)
- else
- raise "Don't know how to pack this yet!"
- end
- end
- end
- end
- end
-
-end
-
-require 'rubygems/package/f_sync_dir'
-require 'rubygems/package/tar_header'
-require 'rubygems/package/tar_input'
-require 'rubygems/package/tar_output'
-require 'rubygems/package/tar_reader'
-require 'rubygems/package/tar_reader/entry'
-require 'rubygems/package/tar_writer'
-
diff --git a/lib/rubygems/package/f_sync_dir.rb b/lib/rubygems/package/f_sync_dir.rb
deleted file mode 100644
index 1915ab3ecb..0000000000
--- a/lib/rubygems/package/f_sync_dir.rb
+++ /dev/null
@@ -1,22 +0,0 @@
-#++
-# Copyright (C) 2004 Mauricio Julio Fernndez Pradier
-# See LICENSE.txt for additional licensing information.
-#--
-
-module Gem::Package::FSyncDir
-
- private
-
- ##
- # make sure this hits the disc
-
- def fsync_dir(dirname)
- dir = open dirname, 'r'
- dir.fsync
- rescue # ignore IOError if it's an unpatched (old) Ruby
- ensure
- dir.close if dir rescue nil
- end
-
-end
-
diff --git a/lib/rubygems/package/tar_header.rb b/lib/rubygems/package/tar_header.rb
deleted file mode 100644
index 44c6695cf9..0000000000
--- a/lib/rubygems/package/tar_header.rb
+++ /dev/null
@@ -1,265 +0,0 @@
-#++
-# Copyright (C) 2004 Mauricio Julio Fernndez Pradier
-# See LICENSE.txt for additional licensing information.
-#--
-
-##
-#--
-# struct tarfile_entry_posix {
-# char name[100]; # ASCII + (Z unless filled)
-# char mode[8]; # 0 padded, octal, null
-# char uid[8]; # ditto
-# char gid[8]; # ditto
-# char size[12]; # 0 padded, octal, null
-# char mtime[12]; # 0 padded, octal, null
-# char checksum[8]; # 0 padded, octal, null, space
-# char typeflag[1]; # file: "0" dir: "5"
-# char linkname[100]; # ASCII + (Z unless filled)
-# char magic[6]; # "ustar\0"
-# char version[2]; # "00"
-# char uname[32]; # ASCIIZ
-# char gname[32]; # ASCIIZ
-# char devmajor[8]; # 0 padded, octal, null
-# char devminor[8]; # o padded, octal, null
-# char prefix[155]; # ASCII + (Z unless filled)
-# };
-#++
-# A header for a tar file
-
-class Gem::Package::TarHeader
-
- ##
- # Fields in the tar header
-
- FIELDS = [
- :checksum,
- :devmajor,
- :devminor,
- :gid,
- :gname,
- :linkname,
- :magic,
- :mode,
- :mtime,
- :name,
- :prefix,
- :size,
- :typeflag,
- :uid,
- :uname,
- :version,
- ]
-
- ##
- # Pack format for a tar header
-
- PACK_FORMAT = 'a100' + # name
- 'a8' + # mode
- 'a8' + # uid
- 'a8' + # gid
- 'a12' + # size
- 'a12' + # mtime
- 'a7a' + # chksum
- 'a' + # typeflag
- 'a100' + # linkname
- 'a6' + # magic
- 'a2' + # version
- 'a32' + # uname
- 'a32' + # gname
- 'a8' + # devmajor
- 'a8' + # devminor
- 'a155' # prefix
-
- ##
- # Unpack format for a tar header
-
- UNPACK_FORMAT = 'A100' + # name
- 'A8' + # mode
- 'A8' + # uid
- 'A8' + # gid
- 'A12' + # size
- 'A12' + # mtime
- 'A8' + # checksum
- 'A' + # typeflag
- 'A100' + # linkname
- 'A6' + # magic
- 'A2' + # version
- 'A32' + # uname
- 'A32' + # gname
- 'A8' + # devmajor
- 'A8' + # devminor
- 'A155' # prefix
-
- attr_reader(*FIELDS)
-
- ##
- # Creates a tar header from IO +stream+
-
- def self.from(stream)
- header = stream.read 512
- empty = (header == "\0" * 512)
-
- fields = header.unpack UNPACK_FORMAT
-
- name = fields.shift
- mode = fields.shift.oct
- uid = fields.shift.oct
- gid = fields.shift.oct
- size = fields.shift.oct
- mtime = fields.shift.oct
- checksum = fields.shift.oct
- typeflag = fields.shift
- linkname = fields.shift
- magic = fields.shift
- version = fields.shift.oct
- uname = fields.shift
- gname = fields.shift
- devmajor = fields.shift.oct
- devminor = fields.shift.oct
- prefix = fields.shift
-
- new :name => name,
- :mode => mode,
- :uid => uid,
- :gid => gid,
- :size => size,
- :mtime => mtime,
- :checksum => checksum,
- :typeflag => typeflag,
- :linkname => linkname,
- :magic => magic,
- :version => version,
- :uname => uname,
- :gname => gname,
- :devmajor => devmajor,
- :devminor => devminor,
- :prefix => prefix,
-
- :empty => empty
-
- # HACK unfactor for Rubinius
- #new :name => fields.shift,
- # :mode => fields.shift.oct,
- # :uid => fields.shift.oct,
- # :gid => fields.shift.oct,
- # :size => fields.shift.oct,
- # :mtime => fields.shift.oct,
- # :checksum => fields.shift.oct,
- # :typeflag => fields.shift,
- # :linkname => fields.shift,
- # :magic => fields.shift,
- # :version => fields.shift.oct,
- # :uname => fields.shift,
- # :gname => fields.shift,
- # :devmajor => fields.shift.oct,
- # :devminor => fields.shift.oct,
- # :prefix => fields.shift,
-
- # :empty => empty
- end
-
- ##
- # Creates a new TarHeader using +vals+
-
- def initialize(vals)
- unless vals[:name] && vals[:size] && vals[:prefix] && vals[:mode] then
- raise ArgumentError, ":name, :size, :prefix and :mode required"
- end
-
- vals[:uid] ||= 0
- vals[:gid] ||= 0
- vals[:mtime] ||= 0
- vals[:checksum] ||= ""
- vals[:typeflag] ||= "0"
- vals[:magic] ||= "ustar"
- vals[:version] ||= "00"
- vals[:uname] ||= "wheel"
- vals[:gname] ||= "wheel"
- vals[:devmajor] ||= 0
- vals[:devminor] ||= 0
-
- FIELDS.each do |name|
- instance_variable_set "@#{name}", vals[name]
- end
-
- @empty = vals[:empty]
- end
-
- ##
- # Is the tar entry empty?
-
- def empty?
- @empty
- end
-
- def ==(other) # :nodoc:
- self.class === other and
- @checksum == other.checksum and
- @devmajor == other.devmajor and
- @devminor == other.devminor and
- @gid == other.gid and
- @gname == other.gname and
- @linkname == other.linkname and
- @magic == other.magic and
- @mode == other.mode and
- @mtime == other.mtime and
- @name == other.name and
- @prefix == other.prefix and
- @size == other.size and
- @typeflag == other.typeflag and
- @uid == other.uid and
- @uname == other.uname and
- @version == other.version
- end
-
- def to_s # :nodoc:
- update_checksum
- header
- end
-
- ##
- # Updates the TarHeader's checksum
-
- def update_checksum
- header = header " " * 8
- @checksum = oct calculate_checksum(header), 6
- end
-
- private
-
- def calculate_checksum(header)
- header.unpack("C*").inject { |a, b| a + b }
- end
-
- def header(checksum = @checksum)
- header = [
- name,
- oct(mode, 7),
- oct(uid, 7),
- oct(gid, 7),
- oct(size, 11),
- oct(mtime, 11),
- checksum,
- " ",
- typeflag,
- linkname,
- magic,
- oct(version, 2),
- uname,
- gname,
- oct(devmajor, 7),
- oct(devminor, 7),
- prefix
- ]
-
- header = header.pack PACK_FORMAT
-
- header << ("\0" * ((512 - header.size) % 512))
- end
-
- def oct(num, len)
- "%0#{len}o" % num
- end
-
-end
-
diff --git a/lib/rubygems/package/tar_input.rb b/lib/rubygems/package/tar_input.rb
deleted file mode 100644
index 9f901023b8..0000000000
--- a/lib/rubygems/package/tar_input.rb
+++ /dev/null
@@ -1,217 +0,0 @@
-#++
-# Copyright (C) 2004 Mauricio Julio Fernndez Pradier
-# See LICENSE.txt for additional licensing information.
-#--
-
-class Gem::Package::TarInput
-
- include Gem::Package::FSyncDir
- include Enumerable
-
- attr_reader :metadata
-
- private_class_method :new
-
- def self.open(io, security_policy = nil, &block)
- is = new io, security_policy
-
- yield is
- ensure
- is.close if is
- end
-
- def initialize(io, security_policy = nil)
- @io = io
- @tarreader = Gem::Package::TarReader.new @io
- has_meta = false
-
- data_sig, meta_sig, data_dgst, meta_dgst = nil, nil, nil, nil
- dgst_algo = security_policy ? Gem::Security::OPT[:dgst_algo] : nil
-
- @tarreader.each do |entry|
- case entry.full_name
- when "metadata"
- @metadata = load_gemspec entry.read
- has_meta = true
- when "metadata.gz"
- begin
- # if we have a security_policy, then pre-read the metadata file
- # and calculate it's digest
- sio = nil
- if security_policy
- Gem.ensure_ssl_available
- sio = StringIO.new(entry.read)
- meta_dgst = dgst_algo.digest(sio.string)
- sio.rewind
- end
-
- gzis = Zlib::GzipReader.new(sio || entry)
- # YAML wants an instance of IO
- @metadata = load_gemspec(gzis)
- has_meta = true
- ensure
- gzis.close unless gzis.nil?
- end
- when 'metadata.gz.sig'
- meta_sig = entry.read
- when 'data.tar.gz.sig'
- data_sig = entry.read
- when 'data.tar.gz'
- if security_policy
- Gem.ensure_ssl_available
- data_dgst = dgst_algo.digest(entry.read)
- end
- end
- end
-
- if security_policy then
- Gem.ensure_ssl_available
-
- # map trust policy from string to actual class (or a serialized YAML
- # file, if that exists)
- if String === security_policy then
- if Gem::Security::Policies.key? security_policy then
- # load one of the pre-defined security policies
- security_policy = Gem::Security::Policies[security_policy]
- elsif File.exist? security_policy then
- # FIXME: this doesn't work yet
- security_policy = YAML.load File.read(security_policy)
- else
- raise Gem::Exception, "Unknown trust policy '#{security_policy}'"
- end
- end
-
- if data_sig && data_dgst && meta_sig && meta_dgst then
- # the user has a trust policy, and we have a signed gem
- # file, so use the trust policy to verify the gem signature
-
- begin
- security_policy.verify_gem(data_sig, data_dgst, @metadata.cert_chain)
- rescue Exception => e
- raise "Couldn't verify data signature: #{e}"
- end
-
- begin
- security_policy.verify_gem(meta_sig, meta_dgst, @metadata.cert_chain)
- rescue Exception => e
- raise "Couldn't verify metadata signature: #{e}"
- end
- elsif security_policy.only_signed
- raise Gem::Exception, "Unsigned gem"
- else
- # FIXME: should display warning here (trust policy, but
- # either unsigned or badly signed gem file)
- end
- end
-
- @tarreader.rewind
- @fileops = Gem::FileOperations.new
-
- raise Gem::Package::FormatError, "No metadata found!" unless has_meta
- end
-
- def close
- @io.close
- @tarreader.close
- end
-
- def each(&block)
- @tarreader.each do |entry|
- next unless entry.full_name == "data.tar.gz"
- is = zipped_stream entry
-
- begin
- Gem::Package::TarReader.new is do |inner|
- inner.each(&block)
- end
- ensure
- is.close if is
- end
- end
-
- @tarreader.rewind
- end
-
- def extract_entry(destdir, entry, expected_md5sum = nil)
- if entry.directory? then
- dest = File.join destdir, entry.full_name
-
- if File.directory? dest then
- @fileops.chmod entry.header.mode, dest, :verbose => false
- else
- @fileops.mkdir_p dest, :mode => entry.header.mode, :verbose => false
- end
-
- fsync_dir dest
- fsync_dir File.join(dest, "..")
-
- return
- end
-
- # it's a file
- md5 = Digest::MD5.new if expected_md5sum
- destdir = File.join destdir, File.dirname(entry.full_name)
- @fileops.mkdir_p destdir, :mode => 0755, :verbose => false
- destfile = File.join destdir, File.basename(entry.full_name)
- @fileops.chmod 0600, destfile, :verbose => false rescue nil # Errno::ENOENT
-
- open destfile, "wb", entry.header.mode do |os|
- loop do
- data = entry.read 4096
- break unless data
- # HACK shouldn't we check the MD5 before writing to disk?
- md5 << data if expected_md5sum
- os.write(data)
- end
-
- os.fsync
- end
-
- @fileops.chmod entry.header.mode, destfile, :verbose => false
- fsync_dir File.dirname(destfile)
- fsync_dir File.join(File.dirname(destfile), "..")
-
- if expected_md5sum && expected_md5sum != md5.hexdigest then
- raise Gem::Package::BadCheckSum
- end
- end
-
- # Attempt to YAML-load a gemspec from the given _io_ parameter. Return
- # nil if it fails.
- def load_gemspec(io)
- Gem::Specification.from_yaml io
- rescue Gem::Exception
- nil
- end
-
- ##
- # Return an IO stream for the zipped entry.
- #
- # NOTE: Originally this method used two approaches, Return a GZipReader
- # directly, or read the GZipReader into a string and return a StringIO on
- # the string. The string IO approach was used for versions of ZLib before
- # 1.2.1 to avoid buffer errors on windows machines. Then we found that
- # errors happened with 1.2.1 as well, so we changed the condition. Then
- # we discovered errors occurred with versions as late as 1.2.3. At this
- # point (after some benchmarking to show we weren't seriously crippling
- # the unpacking speed) we threw our hands in the air and declared that
- # this method would use the String IO approach on all platforms at all
- # times. And that's the way it is.
-
- def zipped_stream(entry)
- if defined? Rubinius then
- zis = Zlib::GzipReader.new entry
- dis = zis.read
- is = StringIO.new(dis)
- else
- # This is Jamis Buck's Zlib workaround for some unknown issue
- entry.read(10) # skip the gzip header
- zis = Zlib::Inflate.new(-Zlib::MAX_WBITS)
- is = StringIO.new(zis.inflate(entry.read))
- end
- ensure
- zis.finish if zis
- end
-
-end
-
diff --git a/lib/rubygems/package/tar_output.rb b/lib/rubygems/package/tar_output.rb
deleted file mode 100644
index dfb74af9fc..0000000000
--- a/lib/rubygems/package/tar_output.rb
+++ /dev/null
@@ -1,143 +0,0 @@
-#++
-# Copyright (C) 2004 Mauricio Julio Fernndez Pradier
-# See LICENSE.txt for additional licensing information.
-#--
-
-##
-# TarOutput is a wrapper to TarWriter that builds gem-format tar file.
-#
-# Gem-format tar files contain the following files:
-# [data.tar.gz] A gzipped tar file containing the files that compose the gem
-# which will be extracted into the gem/ dir on installation.
-# [metadata.gz] A YAML format Gem::Specification.
-# [data.tar.gz.sig] A signature for the gem's data.tar.gz.
-# [metadata.gz.sig] A signature for the gem's metadata.gz.
-#
-# See TarOutput::open for usage details.
-
-class Gem::Package::TarOutput
-
- ##
- # Creates a new TarOutput which will yield a TarWriter object for the
- # data.tar.gz portion of a gem-format tar file.
- #
- # See #initialize for details on +io+ and +signer+.
- #
- # See #add_gem_contents for details on adding metadata to the tar file.
-
- def self.open(io, signer = nil, &block) # :yield: data_tar_writer
- tar_outputter = new io, signer
- tar_outputter.add_gem_contents(&block)
- tar_outputter.add_metadata
- tar_outputter.add_signatures
-
- ensure
- tar_outputter.close
- end
-
- ##
- # Creates a new TarOutput that will write a gem-format tar file to +io+. If
- # +signer+ is given, the data.tar.gz and metadata.gz will be signed and
- # the signatures will be added to the tar file.
-
- def initialize(io, signer)
- @io = io
- @signer = signer
-
- @tar_writer = Gem::Package::TarWriter.new @io
-
- @metadata = nil
-
- @data_signature = nil
- @meta_signature = nil
- end
-
- ##
- # Yields a TarWriter for the data.tar.gz inside a gem-format tar file.
- # The yielded TarWriter has been extended with a #metadata= method for
- # attaching a YAML format Gem::Specification which will be written by
- # add_metadata.
-
- def add_gem_contents
- @tar_writer.add_file "data.tar.gz", 0644 do |inner|
- sio = @signer ? StringIO.new : nil
- Zlib::GzipWriter.wrap(sio || inner) do |os|
-
- Gem::Package::TarWriter.new os do |data_tar_writer|
- # :stopdoc:
- def data_tar_writer.metadata() @metadata end
- def data_tar_writer.metadata=(metadata) @metadata = metadata end
- # :startdoc:
-
- yield data_tar_writer
-
- @metadata = data_tar_writer.metadata
- end
- end
-
- # if we have a signing key, then sign the data
- # digest and return the signature
- if @signer then
- digest = Gem::Security::OPT[:dgst_algo].digest sio.string
- @data_signature = @signer.sign digest
- inner.write sio.string
- end
- end
-
- self
- end
-
- ##
- # Adds metadata.gz to the gem-format tar file which was saved from a
- # previous #add_gem_contents call.
-
- def add_metadata
- return if @metadata.nil?
-
- @tar_writer.add_file "metadata.gz", 0644 do |io|
- begin
- sio = @signer ? StringIO.new : nil
- gzos = Zlib::GzipWriter.new(sio || io)
- gzos.write @metadata
- ensure
- gzos.flush
- gzos.finish
-
- # if we have a signing key, then sign the metadata digest and return
- # the signature
- if @signer then
- digest = Gem::Security::OPT[:dgst_algo].digest sio.string
- @meta_signature = @signer.sign digest
- io.write sio.string
- end
- end
- end
- end
-
- ##
- # Adds data.tar.gz.sig and metadata.gz.sig to the gem-format tar files if
- # a Gem::Security::Signer was sent to initialize.
-
- def add_signatures
- if @data_signature then
- @tar_writer.add_file 'data.tar.gz.sig', 0644 do |io|
- io.write @data_signature
- end
- end
-
- if @meta_signature then
- @tar_writer.add_file 'metadata.gz.sig', 0644 do |io|
- io.write @meta_signature
- end
- end
- end
-
- ##
- # Closes the TarOutput.
-
- def close
- @tar_writer.close
- end
-
-end
-
diff --git a/lib/rubygems/package/tar_reader.rb b/lib/rubygems/package/tar_reader.rb
deleted file mode 100644
index 1a2fbaf678..0000000000
--- a/lib/rubygems/package/tar_reader.rb
+++ /dev/null
@@ -1,105 +0,0 @@
-#++
-# Copyright (C) 2004 Mauricio Julio Fernndez Pradier
-# See LICENSE.txt for additional licensing information.
-#--
-
-##
-# TarReader reads tar files and allows iteration over their items
-
-class Gem::Package::TarReader
-
- include Gem::Package
-
- ##
- # Raised if the tar IO is not seekable
-
- class UnexpectedEOF < StandardError; end
-
- ##
- # Creates a new TarReader on +io+ and yields it to the block, if given.
-
- def self.new(io)
- reader = super
-
- return reader unless block_given?
-
- begin
- yield reader
- ensure
- reader.close
- end
-
- nil
- end
-
- ##
- # Creates a new tar file reader on +io+ which needs to respond to #pos,
- # #eof?, #read, #getc and #pos=
-
- def initialize(io)
- @io = io
- @init_pos = io.pos
- end
-
- ##
- # Close the tar file
-
- def close
- end
-
- ##
- # Iterates over files in the tarball yielding each entry
-
- def each
- loop do
- return if @io.eof?
-
- header = Gem::Package::TarHeader.from @io
- return if header.empty?
-
- entry = Gem::Package::TarReader::Entry.new header, @io
- size = entry.header.size
-
- yield entry
-
- skip = (512 - (size % 512)) % 512
- pending = size - entry.bytes_read
-
- begin
- # avoid reading...
- @io.seek pending, IO::SEEK_CUR
- pending = 0
- rescue Errno::EINVAL, NameError
- while pending > 0 do
- bytes_read = @io.read([pending, 4096].min).size
- raise UnexpectedEOF if @io.eof?
- pending -= bytes_read
- end
- end
-
- @io.read skip # discard trailing zeros
-
- # make sure nobody can use #read, #getc or #rewind anymore
- entry.close
- end
- end
-
- alias each_entry each
-
- ##
- # NOTE: Do not call #rewind during #each
-
- def rewind
- if @init_pos == 0 then
- raise Gem::Package::NonSeekableIO unless @io.respond_to? :rewind
- @io.rewind
- else
- raise Gem::Package::NonSeekableIO unless @io.respond_to? :pos=
- @io.pos = @init_pos
- end
- end
-
-end
-
-require 'rubygems/package/tar_reader/entry'
-
diff --git a/lib/rubygems/package/tar_reader/entry.rb b/lib/rubygems/package/tar_reader/entry.rb
deleted file mode 100644
index eeb70bf000..0000000000
--- a/lib/rubygems/package/tar_reader/entry.rb
+++ /dev/null
@@ -1,140 +0,0 @@
-#++
-# Copyright (C) 2004 Mauricio Julio Fernndez Pradier
-# See LICENSE.txt for additional licensing information.
-#--
-
-##
-# Class for reading entries out of a tar file
-
-class Gem::Package::TarReader::Entry
-
- ##
- # Header for this tar entry
-
- attr_reader :header
-
- ##
- # Creates a new tar entry for +header+ that will be read from +io+
-
- def initialize(header, io)
- @closed = false
- @header = header
- @io = io
- @orig_pos = @io.pos
- @read = 0
- end
-
- def check_closed # :nodoc:
- raise IOError, "closed #{self.class}" if closed?
- end
-
- ##
- # Number of bytes read out of the tar entry
-
- def bytes_read
- @read
- end
-
- ##
- # Closes the tar entry
-
- def close
- @closed = true
- end
-
- ##
- # Is the tar entry closed?
-
- def closed?
- @closed
- end
-
- ##
- # Are we at the end of the tar entry?
-
- def eof?
- check_closed
-
- @read >= @header.size
- end
-
- ##
- # Full name of the tar entry
-
- def full_name
- if @header.prefix != "" then
- File.join @header.prefix, @header.name
- else
- @header.name
- end
- end
-
- ##
- # Read one byte from the tar entry
-
- def getc
- check_closed
-
- return nil if @read >= @header.size
-
- ret = @io.getc
- @read += 1 if ret
-
- ret
- end
-
- ##
- # Is this tar entry a directory?
-
- def directory?
- @header.typeflag == "5"
- end
-
- ##
- # Is this tar entry a file?
-
- def file?
- @header.typeflag == "0"
- end
-
- ##
- # The position in the tar entry
-
- def pos
- check_closed
-
- bytes_read
- end
-
- ##
- # Reads +len+ bytes from the tar file entry, or the rest of the entry if
- # nil
-
- def read(len = nil)
- check_closed
-
- return nil if @read >= @header.size
-
- len ||= @header.size - @read
- max_read = [len, @header.size - @read].min
-
- ret = @io.read max_read
- @read += ret.size
-
- ret
- end
-
- ##
- # Rewinds to the beginning of the tar file entry
-
- def rewind
- check_closed
-
- raise Gem::Package::NonSeekableIO unless @io.respond_to? :pos=
-
- @io.pos = @orig_pos
- @read = 0
- end
-
-end
-
diff --git a/lib/rubygems/package/tar_writer.rb b/lib/rubygems/package/tar_writer.rb
deleted file mode 100644
index 6f11529302..0000000000
--- a/lib/rubygems/package/tar_writer.rb
+++ /dev/null
@@ -1,240 +0,0 @@
-#++
-# Copyright (C) 2004 Mauricio Julio Fernndez Pradier
-# See LICENSE.txt for additional licensing information.
-#--
-
-##
-# Allows writing of tar files
-
-class Gem::Package::TarWriter
-
- class FileOverflow < StandardError; end
-
- ##
- # IO wrapper that allows writing a limited amount of data
-
- class BoundedStream
-
- ##
- # Maximum number of bytes that can be written
-
- attr_reader :limit
-
- ##
- # Number of bytes written
-
- attr_reader :written
-
- ##
- # Wraps +io+ and allows up to +limit+ bytes to be written
-
- def initialize(io, limit)
- @io = io
- @limit = limit
- @written = 0
- end
-
- ##
- # Writes +data+ onto the IO, raising a FileOverflow exception if the
- # number of bytes will be more than #limit
-
- def write(data)
- if data.size + @written > @limit
- raise FileOverflow, "You tried to feed more data than fits in the file."
- end
- @io.write data
- @written += data.size
- data.size
- end
-
- end
-
- ##
- # IO wrapper that provides only #write
-
- class RestrictedStream
-
- ##
- # Creates a new RestrictedStream wrapping +io+
-
- def initialize(io)
- @io = io
- end
-
- ##
- # Writes +data+ onto the IO
-
- def write(data)
- @io.write data
- end
-
- end
-
- ##
- # Creates a new TarWriter, yielding it if a block is given
-
- def self.new(io)
- writer = super
-
- return writer unless block_given?
-
- begin
- yield writer
- ensure
- writer.close
- end
-
- nil
- end
-
- ##
- # Creates a new TarWriter that will write to +io+
-
- def initialize(io)
- @io = io
- @closed = false
- end
-
- ##
- # Adds file +name+ with permissions +mode+, and yields an IO for writing the
- # file to
-
- def add_file(name, mode) # :yields: io
- check_closed
-
- raise Gem::Package::NonSeekableIO unless @io.respond_to? :pos=
-
- name, prefix = split_name name
-
- init_pos = @io.pos
- @io.write "\0" * 512 # placeholder for the header
-
- yield RestrictedStream.new(@io) if block_given?
-
- size = @io.pos - init_pos - 512
-
- remainder = (512 - (size % 512)) % 512
- @io.write "\0" * remainder
-
- final_pos = @io.pos
- @io.pos = init_pos
-
- header = Gem::Package::TarHeader.new :name => name, :mode => mode,
- :size => size, :prefix => prefix
-
- @io.write header
- @io.pos = final_pos
-
- self
- end
-
- ##
- # Add file +name+ with permissions +mode+ +size+ bytes long. Yields an IO
- # to write the file to.
-
- def add_file_simple(name, mode, size) # :yields: io
- check_closed
-
- name, prefix = split_name name
-
- header = Gem::Package::TarHeader.new(:name => name, :mode => mode,
- :size => size, :prefix => prefix).to_s
-
- @io.write header
- os = BoundedStream.new @io, size
-
- yield os if block_given?
-
- min_padding = size - os.written
- @io.write("\0" * min_padding)
-
- remainder = (512 - (size % 512)) % 512
- @io.write("\0" * remainder)
-
- self
- end
-
- ##
- # Raises IOError if the TarWriter is closed
-
- def check_closed
- raise IOError, "closed #{self.class}" if closed?
- end
-
- ##
- # Closes the TarWriter
-
- def close
- check_closed
-
- @io.write "\0" * 1024
- flush
-
- @closed = true
- end
-
- ##
- # Is the TarWriter closed?
-
- def closed?
- @closed
- end
-
- ##
- # Flushes the TarWriter's IO
-
- def flush
- check_closed
-
- @io.flush if @io.respond_to? :flush
- end
-
- ##
- # Creates a new directory in the tar file +name+ with +mode+
-
- def mkdir(name, mode)
- check_closed
-
- name, prefix = split_name(name)
-
- header = Gem::Package::TarHeader.new :name => name, :mode => mode,
- :typeflag => "5", :size => 0,
- :prefix => prefix
-
- @io.write header
-
- self
- end
-
- ##
- # Splits +name+ into a name and prefix that can fit in the TarHeader
-
- def split_name(name) # :nodoc:
- raise Gem::Package::TooLongFileName if name.size > 256
-
- if name.size <= 100 then
- prefix = ""
- else
- parts = name.split(/\//)
- newname = parts.pop
- nxt = ""
-
- loop do
- nxt = parts.pop
- break if newname.size + 1 + nxt.size > 100
- newname = nxt + "/" + newname
- end
-
- prefix = (parts + [nxt]).join "/"
- name = newname
-
- if name.size > 100 or prefix.size > 155 then
- raise Gem::Package::TooLongFileName
- end
- end
-
- return name, prefix
- end
-
-end
-
diff --git a/lib/rubygems/package_task.rb b/lib/rubygems/package_task.rb
deleted file mode 100644
index d7f83276f8..0000000000
--- a/lib/rubygems/package_task.rb
+++ /dev/null
@@ -1,118 +0,0 @@
-# Copyright (c) 2003, 2004 Jim Weirich, 2009 Eric Hodel
-#
-# 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 'rubygems'
-begin
- gem 'rake'
-rescue Gem::LoadError
-end
-
-require 'rake/packagetask'
-
-##
-# Create a package based upon a Gem::Specification. Gem packages, as well as
-# zip files and tar/gzipped packages can be produced by this task.
-#
-# In addition to the Rake targets generated by Rake::PackageTask, a
-# Gem::PackageTask will also generate the following tasks:
-#
-# [<b>"<em>package_dir</em>/<em>name</em>-<em>version</em>.gem"</b>]
-# Create a RubyGems package with the given name and version.
-#
-# Example using a Gem::Specification:
-#
-# require 'rubygems'
-# require 'rubygems/package_task'
-#
-# spec = Gem::Specification.new do |s|
-# s.platform = Gem::Platform::RUBY
-# s.summary = "Ruby based make-like utility."
-# s.name = 'rake'
-# s.version = PKG_VERSION
-# s.requirements << 'none'
-# s.require_path = 'lib'
-# s.autorequire = 'rake'
-# s.files = PKG_FILES
-# s.description = <<-EOF
-# Rake is a Make-like program implemented in Ruby. Tasks
-# and dependencies are specified in standard Ruby syntax.
-# EOF
-# end
-#
-# Gem::PackageTask.new(spec) do |pkg|
-# pkg.need_zip = true
-# pkg.need_tar = true
-# end
-
-class Gem::PackageTask < Rake::PackageTask
-
- ##
- # Ruby Gem::Specification containing the metadata for this package. The
- # name, version and package_files are automatically determined from the
- # gemspec and don't need to be explicitly provided.
-
- attr_accessor :gem_spec
-
- ##
- # Create a Gem Package task library. Automatically define the gem if a
- # block is given. If no block is supplied, then #define needs to be called
- # to define the task.
-
- def initialize(gem_spec)
- init gem_spec
- yield self if block_given?
- define if block_given?
- end
-
- ##
- # Initialization tasks without the "yield self" or define operations.
-
- def init(gem)
- super gem.name, gem.version
- @gem_spec = gem
- @package_files += gem_spec.files if gem_spec.files
- end
-
- ##
- # Create the Rake tasks and actions specified by this Gem::PackageTask.
- # (+define+ is automatically called if a block is given to +new+).
-
- def define
- super
- task :package => [:gem]
- desc "Build the gem file #{gem_file}"
- task :gem => ["#{package_dir}/#{gem_file}"]
- file "#{package_dir}/#{gem_file}" => [package_dir] + @gem_spec.files do
- when_writing("Creating #{gem_spec.full_name}.gem") {
- Gem::Builder.new(gem_spec).build
- verbose(true) {
- mv gem_file, "#{package_dir}/#{gem_file}"
- }
- }
- end
- end
-
- def gem_file
- "#{@gem_spec.full_name}.gem"
- end
-
-end
-
diff --git a/lib/rubygems/platform.rb b/lib/rubygems/platform.rb
deleted file mode 100644
index bfa8fca0ff..0000000000
--- a/lib/rubygems/platform.rb
+++ /dev/null
@@ -1,180 +0,0 @@
-##
-# Available list of platforms for targeting Gem installations.
-
-class Gem::Platform
-
- @local = nil
-
- attr_accessor :cpu
-
- attr_accessor :os
-
- attr_accessor :version
-
- def self.local
- arch = Gem::ConfigMap[:arch]
- arch = "#{arch}_60" if arch =~ /mswin32$/
- @local ||= new(arch)
- end
-
- def self.match(platform)
- Gem.platforms.any? do |local_platform|
- platform.nil? or local_platform == platform or
- (local_platform != Gem::Platform::RUBY and local_platform =~ platform)
- end
- end
-
- def self.new(arch) # :nodoc:
- case arch
- when Gem::Platform::CURRENT then
- Gem::Platform.local
- when Gem::Platform::RUBY, nil, '' then
- Gem::Platform::RUBY
- else
- super
- end
- end
-
- def initialize(arch)
- case arch
- when Array then
- @cpu, @os, @version = arch
- when String then
- arch = arch.split '-'
-
- if arch.length > 2 and arch.last !~ /\d/ then # reassemble x86-linux-gnu
- extra = arch.pop
- arch.last << "-#{extra}"
- end
-
- cpu = arch.shift
-
- @cpu = case cpu
- when /i\d86/ then 'x86'
- else cpu
- end
-
- if arch.length == 2 and arch.last =~ /^\d+(\.\d+)?$/ then # for command-line
- @os, @version = arch
- return
- end
-
- os, = arch
- @cpu, os = nil, cpu if os.nil? # legacy jruby
-
- @os, @version = case os
- when /aix(\d+)/ then [ 'aix', $1 ]
- when /cygwin/ then [ 'cygwin', nil ]
- when /darwin(\d+)?/ then [ 'darwin', $1 ]
- when /freebsd(\d+)/ then [ 'freebsd', $1 ]
- when /hpux(\d+)/ then [ 'hpux', $1 ]
- when /^java$/, /^jruby$/ then [ 'java', nil ]
- when /^java([\d.]*)/ then [ 'java', $1 ]
- when /linux/ then [ 'linux', $1 ]
- when /mingw32/ then [ 'mingw32', nil ]
- when /(mswin\d+)(\_(\d+))?/ then
- os, version = $1, $3
- @cpu = 'x86' if @cpu.nil? and os =~ /32$/
- [os, version]
- when /netbsdelf/ then [ 'netbsdelf', nil ]
- when /openbsd(\d+\.\d+)/ then [ 'openbsd', $1 ]
- when /solaris(\d+\.\d+)/ then [ 'solaris', $1 ]
- # test
- when /^(\w+_platform)(\d+)/ then [ $1, $2 ]
- else [ 'unknown', nil ]
- end
- when Gem::Platform then
- @cpu = arch.cpu
- @os = arch.os
- @version = arch.version
- else
- raise ArgumentError, "invalid argument #{arch.inspect}"
- end
- end
-
- def inspect
- "#<%s:0x%x @cpu=%p, @os=%p, @version=%p>" % [self.class, object_id, *to_a]
- end
-
- def to_a
- [@cpu, @os, @version]
- end
-
- def to_s
- to_a.compact.join '-'
- end
-
- def empty?
- to_s.empty?
- end
-
- ##
- # Is +other+ equal to this platform? Two platforms are equal if they have
- # the same CPU, OS and version.
-
- def ==(other)
- self.class === other and
- @cpu == other.cpu and @os == other.os and @version == other.version
- end
-
- ##
- # Does +other+ match this platform? Two platforms match if they have the
- # same CPU, or either has a CPU of 'universal', they have the same OS, and
- # they have the same version, or either has no version.
-
- def ===(other)
- return nil unless Gem::Platform === other
-
- # cpu
- (@cpu == 'universal' or other.cpu == 'universal' or @cpu == other.cpu) and
-
- # os
- @os == other.os and
-
- # version
- (@version.nil? or other.version.nil? or @version == other.version)
- end
-
- ##
- # Does +other+ match this platform? If +other+ is a String it will be
- # converted to a Gem::Platform first. See #=== for matching rules.
-
- def =~(other)
- case other
- when Gem::Platform then # nop
- when String then
- # This data is from http://gems.rubyforge.org/gems/yaml on 19 Aug 2007
- other = case other
- when /^i686-darwin(\d)/ then ['x86', 'darwin', $1 ]
- when /^i\d86-linux/ then ['x86', 'linux', nil ]
- when 'java', 'jruby' then [nil, 'java', nil ]
- when /mswin32(\_(\d+))?/ then ['x86', 'mswin32', $2 ]
- when 'powerpc-darwin' then ['powerpc', 'darwin', nil ]
- when /powerpc-darwin(\d)/ then ['powerpc', 'darwin', $1 ]
- when /sparc-solaris2.8/ then ['sparc', 'solaris', '2.8' ]
- when /universal-darwin(\d)/ then ['universal', 'darwin', $1 ]
- else other
- end
-
- other = Gem::Platform.new other
- else
- return nil
- end
-
- self === other
- end
-
- ##
- # A pure-ruby gem that may use Gem::Specification#extensions to build
- # binary files.
-
- RUBY = 'ruby'
-
- ##
- # A platform-specific gem that is built for the packaging ruby's platform.
- # This will be replaced with Gem::Platform::local.
-
- CURRENT = 'current'
-
-end
-
diff --git a/lib/rubygems/remote_fetcher.rb b/lib/rubygems/remote_fetcher.rb
deleted file mode 100644
index 945523e5b0..0000000000
--- a/lib/rubygems/remote_fetcher.rb
+++ /dev/null
@@ -1,367 +0,0 @@
-require 'net/http'
-require 'stringio'
-require 'time'
-require 'uri'
-
-require 'rubygems'
-
-##
-# RemoteFetcher handles the details of fetching gems and gem information from
-# a remote source.
-
-class Gem::RemoteFetcher
-
- include Gem::UserInteraction
-
- ##
- # A FetchError exception wraps up the various possible IO and HTTP failures
- # that could happen while downloading from the internet.
-
- class FetchError < Gem::Exception
-
- ##
- # The URI which was being accessed when the exception happened.
-
- attr_accessor :uri
-
- def initialize(message, uri)
- super message
- @uri = uri
- end
-
- def to_s # :nodoc:
- "#{super} (#{uri})"
- end
-
- end
-
- @fetcher = nil
-
- ##
- # Cached RemoteFetcher instance.
-
- def self.fetcher
- @fetcher ||= self.new Gem.configuration[:http_proxy]
- end
-
- ##
- # Initialize a remote fetcher using the source URI and possible proxy
- # information.
- #
- # +proxy+
- # * [String]: explicit specification of proxy; overrides any environment
- # variable setting
- # * nil: respect environment variables (HTTP_PROXY, HTTP_PROXY_USER,
- # HTTP_PROXY_PASS)
- # * <tt>:no_proxy</tt>: ignore environment variables and _don't_ use a proxy
-
- def initialize(proxy = nil)
- Socket.do_not_reverse_lookup = true
-
- @connections = {}
- @requests = Hash.new 0
- @proxy_uri =
- case proxy
- when :no_proxy then nil
- when nil then get_proxy_from_env
- when URI::HTTP then proxy
- else URI.parse(proxy)
- end
- end
-
- ##
- # Moves the gem +spec+ from +source_uri+ to the cache dir unless it is
- # already there. If the source_uri is local the gem cache dir copy is
- # always replaced.
-
- def download(spec, source_uri, install_dir = Gem.dir)
- if File.writable?(install_dir)
- cache_dir = File.join install_dir, 'cache'
- else
- cache_dir = File.join(Gem.user_dir, 'cache')
- end
-
- gem_file_name = "#{spec.full_name}.gem"
- local_gem_path = File.join cache_dir, gem_file_name
-
- FileUtils.mkdir_p cache_dir rescue nil unless File.exist? cache_dir
-
- # Always escape URI's to deal with potential spaces and such
- unless URI::Generic === source_uri
- source_uri = URI.parse(URI.escape(source_uri))
- end
-
- scheme = source_uri.scheme
-
- # URI.parse gets confused by MS Windows paths with forward slashes.
- scheme = nil if scheme =~ /^[a-z]$/i
-
- case scheme
- when 'http', 'https' then
- unless File.exist? local_gem_path then
- begin
- say "Downloading gem #{gem_file_name}" if
- Gem.configuration.really_verbose
-
- remote_gem_path = source_uri + "gems/#{gem_file_name}"
-
- gem = self.fetch_path remote_gem_path
- rescue Gem::RemoteFetcher::FetchError
- raise if spec.original_platform == spec.platform
-
- alternate_name = "#{spec.original_name}.gem"
-
- say "Failed, downloading gem #{alternate_name}" if
- Gem.configuration.really_verbose
-
- remote_gem_path = source_uri + "gems/#{alternate_name}"
-
- gem = self.fetch_path remote_gem_path
- end
-
- File.open local_gem_path, 'wb' do |fp|
- fp.write gem
- end
- end
- when 'file' then
- begin
- path = source_uri.path
- path = File.dirname(path) if File.extname(path) == '.gem'
-
- remote_gem_path = File.join(path, 'gems', gem_file_name)
-
- FileUtils.cp(remote_gem_path, local_gem_path)
- rescue Errno::EACCES
- local_gem_path = source_uri.to_s
- end
-
- say "Using local gem #{local_gem_path}" if
- Gem.configuration.really_verbose
- when nil then # TODO test for local overriding cache
- begin
- if Gem.win_platform? && source_uri.scheme && !source_uri.path.include?(':')
- FileUtils.cp URI.unescape(source_uri.scheme + ':' + source_uri.path), local_gem_path
- else
- FileUtils.cp URI.unescape(source_uri.path), local_gem_path
- end
- rescue Errno::EACCES
- local_gem_path = source_uri.to_s
- end
-
- say "Using local gem #{local_gem_path}" if
- Gem.configuration.really_verbose
- else
- raise Gem::InstallError, "unsupported URI scheme #{source_uri.scheme}"
- end
-
- local_gem_path
- end
-
- ##
- # Downloads +uri+ and returns it as a String.
-
- def fetch_path(uri, mtime = nil, head = false)
- data = open_uri_or_path uri, mtime, head
- data = Gem.gunzip data if data and not head and uri.to_s =~ /gz$/
- data
- rescue FetchError
- raise
- rescue Timeout::Error
- raise FetchError.new('timed out', uri)
- rescue IOError, SocketError, SystemCallError => e
- raise FetchError.new("#{e.class}: #{e}", uri)
- end
-
- ##
- # Returns the size of +uri+ in bytes.
-
- def fetch_size(uri) # TODO: phase this out
- response = fetch_path(uri, nil, true)
-
- response['content-length'].to_i
- end
-
- def escape(str)
- return unless str
- URI.escape(str)
- end
-
- def unescape(str)
- return unless str
- URI.unescape(str)
- end
-
- ##
- # Returns an HTTP proxy URI if one is set in the environment variables.
-
- def get_proxy_from_env
- env_proxy = ENV['http_proxy'] || ENV['HTTP_PROXY']
-
- return nil if env_proxy.nil? or env_proxy.empty?
-
- uri = URI.parse(normalize_uri(env_proxy))
-
- if uri and uri.user.nil? and uri.password.nil? then
- # Probably we have http_proxy_* variables?
- 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
-
- ##
- # Normalize the URI by adding "http://" if it is missing.
-
- def normalize_uri(uri)
- (uri =~ /^(https?|ftp|file):/) ? uri : "http://#{uri}"
- end
-
- ##
- # Creates or an HTTP connection based on +uri+, or retrieves an existing
- # connection, using a proxy if needed.
-
- def connection_for(uri)
- net_http_args = [uri.host, uri.port]
-
- if @proxy_uri then
- net_http_args += [
- @proxy_uri.host,
- @proxy_uri.port,
- @proxy_uri.user,
- @proxy_uri.password
- ]
- end
-
- connection_id = net_http_args.join ':'
- @connections[connection_id] ||= Net::HTTP.new(*net_http_args)
- connection = @connections[connection_id]
-
- if uri.scheme == 'https' and not connection.started? then
- require 'net/https'
- connection.use_ssl = true
- connection.verify_mode = OpenSSL::SSL::VERIFY_NONE
- end
-
- connection.start unless connection.started?
-
- connection
- end
-
- ##
- # Read the data from the (source based) URI, but if it is a file:// URI,
- # read from the filesystem instead.
-
- def open_uri_or_path(uri, last_modified = nil, head = false, depth = 0)
- raise "block is dead" if block_given?
-
- uri = URI.parse uri unless URI::Generic === uri
-
- # This check is redundant unless Gem::RemoteFetcher is likely
- # to be used directly, since the scheme is checked elsewhere.
- # - Daniel Berger
- unless ['http', 'https', 'file'].include?(uri.scheme)
- raise ArgumentError, 'uri scheme is invalid'
- end
-
- if uri.scheme == 'file'
- path = uri.path
-
- # Deal with leading slash on Windows paths
- if path[0].chr == '/' && path[1].chr =~ /[a-zA-Z]/ && path[2].chr == ':'
- path = path[1..-1]
- end
-
- return Gem.read_binary(path)
- end
-
- fetch_type = head ? Net::HTTP::Head : Net::HTTP::Get
- response = request uri, fetch_type, last_modified
-
- case response
- when Net::HTTPOK, Net::HTTPNotModified then
- head ? response : response.body
- when Net::HTTPMovedPermanently, Net::HTTPFound, Net::HTTPSeeOther,
- Net::HTTPTemporaryRedirect then
- raise FetchError.new('too many redirects', uri) if depth > 10
-
- open_uri_or_path(response['Location'], last_modified, head, depth + 1)
- else
- raise FetchError.new("bad response #{response.message} #{response.code}", uri)
- end
- end
-
- ##
- # Performs a Net::HTTP request of type +request_class+ on +uri+ returning
- # a Net::HTTP response object. request maintains a table of persistent
- # connections to reduce connect overhead.
-
- def request(uri, request_class, last_modified = nil)
- request = request_class.new uri.request_uri
-
- unless uri.nil? || uri.user.nil? || uri.user.empty? then
- request.basic_auth uri.user, uri.password
- end
-
- ua = "RubyGems/#{Gem::RubyGemsVersion} #{Gem::Platform.local}"
- ua << " Ruby/#{RUBY_VERSION} (#{RUBY_RELEASE_DATE}"
- ua << " patchlevel #{RUBY_PATCHLEVEL}" if defined? RUBY_PATCHLEVEL
- ua << ")"
-
- request.add_field 'User-Agent', ua
- request.add_field 'Connection', 'keep-alive'
- request.add_field 'Keep-Alive', '30'
-
- if last_modified then
- last_modified = last_modified.utc
- request.add_field 'If-Modified-Since', last_modified.rfc2822
- end
-
- connection = connection_for uri
-
- retried = false
- bad_response = false
-
- begin
- @requests[connection.object_id] += 1
- response = connection.request request
- say "#{request.method} #{response.code} #{response.message}: #{uri}" if
- Gem.configuration.really_verbose
- rescue Net::HTTPBadResponse
- reset connection
-
- raise FetchError.new('too many bad responses', uri) if bad_response
-
- bad_response = true
- retry
- # HACK work around EOFError bug in Net::HTTP
- # NOTE Errno::ECONNABORTED raised a lot on Windows, and make impossible
- # to install gems.
- rescue EOFError, Errno::ECONNABORTED, Errno::ECONNRESET
- requests = @requests[connection.object_id]
- say "connection reset after #{requests} requests, retrying" if
- Gem.configuration.really_verbose
-
- raise FetchError.new('too many connection resets', uri) if retried
-
- reset connection
-
- retried = true
- retry
- end
-
- response
- end
-
- ##
- # Resets HTTP connection +connection+.
-
- def reset(connection)
- @requests.delete connection.object_id
-
- connection.finish
- connection.start
- end
-
-end
-
diff --git a/lib/rubygems/require_paths_builder.rb b/lib/rubygems/require_paths_builder.rb
deleted file mode 100644
index a77818603b..0000000000
--- a/lib/rubygems/require_paths_builder.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-require 'rubygems'
-
-module Gem::RequirePathsBuilder
- def write_require_paths_file_if_needed(spec = @spec, gem_home = @gem_home)
- return if spec.require_paths == ["lib"] &&
- (spec.bindir.nil? || spec.bindir == "bin")
- file_name = File.join(gem_home, 'gems', "#{@spec.full_name}", ".require_paths")
- file_name.untaint
- File.open(file_name, "w") do |file|
- spec.require_paths.each do |path|
- file.puts path
- end
- file.puts spec.bindir if spec.bindir
- end
- end
-end
-
diff --git a/lib/rubygems/requirement.rb b/lib/rubygems/requirement.rb
deleted file mode 100644
index 471d84eb61..0000000000
--- a/lib/rubygems/requirement.rb
+++ /dev/null
@@ -1,170 +0,0 @@
-#--
-# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
-# All rights reserved.
-# See LICENSE.txt for permissions.
-#++
-
-##
-# Requirement version includes a prefaced comparator in addition
-# to a version number.
-#
-# A Requirement object can actually contain multiple, er,
-# requirements, as in (> 1.2, < 2.0).
-
-class Gem::Requirement
-
- include Comparable
-
- attr_reader :requirements
-
- OPS = {
- "=" => lambda { |v, r| v == r },
- "!=" => lambda { |v, r| v != r },
- ">" => lambda { |v, r| v > r },
- "<" => lambda { |v, r| v < r },
- ">=" => lambda { |v, r| v >= r },
- "<=" => lambda { |v, r| v <= r },
- "~>" => lambda { |v, r| v = v.release; v >= r && v < r.bump }
- }
-
- OP_RE = OPS.keys.map{ |k| Regexp.quote k }.join '|'
-
- ##
- # Factory method to create a Gem::Requirement object. Input may be a
- # Version, a String, or nil. Intended to simplify client code.
- #
- # If the input is "weird", the default version requirement is returned.
-
- def self.create(input)
- case input
- when Gem::Requirement then
- input
- when Gem::Version, Array then
- new input
- else
- if input.respond_to? :to_str then
- self.new [input.to_str]
- else
- self.default
- end
- end
- end
-
- ##
- # A default "version requirement" can surely _only_ be '>= 0'.
- #--
- # This comment once said:
- #
- # "A default "version requirement" can surely _only_ be '> 0'."
-
- def self.default
- self.new ['>= 0']
- end
-
- ##
- # Constructs a Requirement from +requirements+ which can be a String, a
- # Gem::Version, or an Array of those. See #parse for details on the
- # formatting of requirement strings.
-
- def initialize(requirements)
- @requirements = case requirements
- when Array then
- requirements.map do |requirement|
- parse(requirement)
- end
- else
- [parse(requirements)]
- end
- @version = nil # Avoid warnings.
- end
-
- ##
- # Marshal raw requirements, rather than the full object
-
- def marshal_dump # :nodoc:
- [@requirements]
- end
-
- ##
- # Load custom marshal format
-
- def marshal_load(array) # :nodoc:
- @requirements = array[0]
- @version = nil
- end
-
- def to_s # :nodoc:
- as_list.join(", ")
- end
-
- def pretty_print(q) # :nodoc:
- q.group 1, 'Gem::Requirement.new(', ')' do
- q.pp as_list
- end
- end
-
- def as_list
- normalize
- @requirements.map do |op, version| "#{op} #{version}" end
- end
-
- def normalize
- return if not defined? @version or @version.nil?
- @requirements = [parse(@version)]
- @nums = nil
- @version = nil
- @op = nil
- end
-
- ##
- # True if this requirement satisfied by the Gem::Version +version+.
-
- def satisfied_by?(version)
- normalize
- @requirements.all? { |op, rv| satisfy?(op, version, rv) }
- end
-
- ##
- # Is "+version+ +op+ +required_version+" satisfied?
-
- def satisfy?(op, version, required_version)
- OPS[op].call(version, required_version)
- end
-
- def prerelease?
- # TODO: why is @requirements a nested array?
- @requirements.any?{ |r| r[1].prerelease? }
- end
-
- ##
- # Parse the version requirement obj returning the operator and version.
- #
- # The requirement can be a String or a Gem::Version. A String can be an
- # operator (<, <=, =, >=, >, !=, ~>), a version number, or both, operator
- # first.
-
- def parse(obj)
- case obj
- when /^\s*(#{OP_RE})\s*(#{Gem::Version::VERSION_PATTERN})\s*$/o then
- [$1, Gem::Version.new($2)]
- when /^\s*(#{Gem::Version::VERSION_PATTERN})\s*$/o then
- ['=', Gem::Version.new($1)]
- when /^\s*(#{OP_RE})\s*$/o then
- [$1, Gem::Version.new('0')]
- when Gem::Version then
- ['=', obj]
- else
- fail ArgumentError, "Illformed requirement [#{obj.inspect}]"
- end
- end
-
- def <=>(other) # :nodoc:
- to_s <=> other.to_s
- end
-
- def hash # :nodoc:
- to_s.hash
- end
-
-end
-
diff --git a/lib/rubygems/rubygems_version.rb b/lib/rubygems/rubygems_version.rb
deleted file mode 100644
index eda0a0e906..0000000000
--- a/lib/rubygems/rubygems_version.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-#--
-# DO NOT EDIT
-# This file is auto-generated by build scripts.
-# See: rake update_version
-#++
-
-module Gem
-
- ##
- # The version of RubyGems you are using
-
- RubyGemsVersion = '1.3.4'
-
- ##
- # The version of RubyGems you are using (duplicated for familiarity)
-
- VERSION = RubyGemsVersion
-
-end
diff --git a/lib/rubygems/security.rb b/lib/rubygems/security.rb
deleted file mode 100644
index abf3cf4a6a..0000000000
--- a/lib/rubygems/security.rb
+++ /dev/null
@@ -1,786 +0,0 @@
-#--
-# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
-# All rights reserved.
-# See LICENSE.txt for permissions.
-#++
-
-require 'rubygems'
-require 'rubygems/gem_openssl'
-
-# = Signed Gems README
-#
-# == Table of Contents
-# * Overview
-# * Walkthrough
-# * Command-Line Options
-# * OpenSSL Reference
-# * Bugs/TODO
-# * About the Author
-#
-# == Overview
-#
-# Gem::Security implements cryptographic signatures in RubyGems. The section
-# below is a step-by-step guide to using signed gems and generating your own.
-#
-# == Walkthrough
-#
-# In order to start signing your gems, you'll need to build a private key and
-# a self-signed certificate. Here's how:
-#
-# # build a private key and certificate for gemmaster@example.com
-# $ gem cert --build gemmaster@example.com
-#
-# This could take anywhere from 5 seconds to 10 minutes, depending on the
-# speed of your computer (public key algorithms aren't exactly the speediest
-# crypto algorithms in the world). When it's finished, you'll see the files
-# "gem-private_key.pem" and "gem-public_cert.pem" in the current directory.
-#
-# First things first: take the "gem-private_key.pem" file and move it
-# somewhere private, preferably a directory only you have access to, a floppy
-# (yuck!), a CD-ROM, or something comparably secure. Keep your private key
-# hidden; if it's compromised, someone can sign packages as you (note: PKI has
-# ways of mitigating the risk of stolen keys; more on that later).
-#
-# Now, let's sign an existing gem. I'll be using my Imlib2-Ruby bindings, but
-# you can use whatever gem you'd like. Open up your existing gemspec file and
-# add the following lines:
-#
-# # signing key and certificate chain
-# s.signing_key = '/mnt/floppy/gem-private_key.pem'
-# s.cert_chain = ['gem-public_cert.pem']
-#
-# (Be sure to replace "/mnt/floppy" with the ultra-secret path to your private
-# key).
-#
-# After that, go ahead and build your gem as usual. Congratulations, you've
-# just built your first signed gem! If you peek inside your gem file, you'll
-# see a couple of new files have been added:
-#
-# $ tar tf tar tf Imlib2-Ruby-0.5.0.gem
-# data.tar.gz
-# data.tar.gz.sig
-# metadata.gz
-# metadata.gz.sig
-#
-# Now let's verify the signature. Go ahead and install the gem, but add the
-# following options: "-P HighSecurity", like this:
-#
-# # install the gem with using the security policy "HighSecurity"
-# $ sudo gem install Imlib2-Ruby-0.5.0.gem -P HighSecurity
-#
-# The -P option sets your security policy -- we'll talk about that in just a
-# minute. Eh, what's this?
-#
-# Attempting local installation of 'Imlib2-Ruby-0.5.0.gem'
-# ERROR: Error installing gem Imlib2-Ruby-0.5.0.gem[.gem]: Couldn't
-# verify data signature: Untrusted Signing Chain Root: cert =
-# '/CN=gemmaster/DC=example/DC=com', error = 'path
-# "/root/.rubygems/trust/cert-15dbb43a6edf6a70a85d4e784e2e45312cff7030.pem"
-# does not exist'
-#
-# The culprit here is the security policy. RubyGems has several different
-# security policies. Let's take a short break and go over the security
-# policies. Here's a list of the available security policies, and a brief
-# description of each one:
-#
-# * NoSecurity - Well, no security at all. Signed packages are treated like
-# unsigned packages.
-# * LowSecurity - Pretty much no security. If a package is signed then
-# RubyGems will make sure the signature matches the signing
-# certificate, and that the signing certificate hasn't expired, but
-# that's it. A malicious user could easily circumvent this kind of
-# security.
-# * MediumSecurity - Better than LowSecurity and NoSecurity, but still
-# fallible. Package contents are verified against the signing
-# certificate, and the signing certificate is checked for validity,
-# and checked against the rest of the certificate chain (if you don't
-# know what a certificate chain is, stay tuned, we'll get to that).
-# The biggest improvement over LowSecurity is that MediumSecurity
-# won't install packages that are signed by untrusted sources.
-# Unfortunately, MediumSecurity still isn't totally secure -- a
-# malicious user can still unpack the gem, strip the signatures, and
-# distribute the gem unsigned.
-# * HighSecurity - Here's the bugger that got us into this mess.
-# The HighSecurity policy is identical to the MediumSecurity policy,
-# except that it does not allow unsigned gems. A malicious user
-# doesn't have a whole lot of options here; he can't modify the
-# package contents without invalidating the signature, and he can't
-# modify or remove signature or the signing certificate chain, or
-# RubyGems will simply refuse to install the package. Oh well, maybe
-# he'll have better luck causing problems for CPAN users instead :).
-#
-# So, the reason RubyGems refused to install our shiny new signed gem was
-# because it was from an untrusted source. Well, my code is infallible
-# (hah!), so I'm going to add myself as a trusted source.
-#
-# Here's how:
-#
-# # add trusted certificate
-# gem cert --add gem-public_cert.pem
-#
-# I've added my public certificate as a trusted source. Now I can install
-# packages signed my private key without any hassle. Let's try the install
-# command above again:
-#
-# # install the gem with using the HighSecurity policy (and this time
-# # without any shenanigans)
-# $ sudo gem install Imlib2-Ruby-0.5.0.gem -P HighSecurity
-#
-# This time RubyGems should accept your signed package and begin installing.
-# While you're waiting for RubyGems to work it's magic, have a look at some of
-# the other security commands:
-#
-# Usage: gem cert [options]
-#
-# Options:
-# -a, --add CERT Add a trusted certificate.
-# -l, --list List trusted certificates.
-# -r, --remove STRING Remove trusted certificates containing STRING.
-# -b, --build EMAIL_ADDR Build private key and self-signed certificate
-# for EMAIL_ADDR.
-# -C, --certificate CERT Certificate for --sign command.
-# -K, --private-key KEY Private key for --sign command.
-# -s, --sign NEWCERT Sign a certificate with my key and certificate.
-#
-# (By the way, you can pull up this list any time you'd like by typing "gem
-# cert --help")
-#
-# Hmm. We've already covered the "--build" option, and the "--add", "--list",
-# and "--remove" commands seem fairly straightforward; they allow you to add,
-# list, and remove the certificates in your trusted certificate list. But
-# what's with this "--sign" option?
-#
-# To answer that question, let's take a look at "certificate chains", a
-# concept I mentioned earlier. There are a couple of problems with
-# self-signed certificates: first of all, self-signed certificates don't offer
-# a whole lot of security. Sure, the certificate says Yukihiro Matsumoto, but
-# how do I know it was actually generated and signed by matz himself unless he
-# gave me the certificate in person?
-#
-# The second problem is scalability. Sure, if there are 50 gem authors, then
-# I have 50 trusted certificates, no problem. What if there are 500 gem
-# authors? 1000? Having to constantly add new trusted certificates is a
-# pain, and it actually makes the trust system less secure by encouraging
-# RubyGems users to blindly trust new certificates.
-#
-# Here's where certificate chains come in. A certificate chain establishes an
-# arbitrarily long chain of trust between an issuing certificate and a child
-# certificate. So instead of trusting certificates on a per-developer basis,
-# we use the PKI concept of certificate chains to build a logical hierarchy of
-# trust. Here's a hypothetical example of a trust hierarchy based (roughly)
-# on geography:
-#
-#
-# --------------------------
-# | rubygems@rubyforge.org |
-# --------------------------
-# |
-# -----------------------------------
-# | |
-# ---------------------------- -----------------------------
-# | seattle.rb@zenspider.com | | dcrubyists@richkilmer.com |
-# ---------------------------- -----------------------------
-# | | | |
-# --------------- ---------------- ----------- --------------
-# | alf@seattle | | bob@portland | | pabs@dc | | tomcope@dc |
-# --------------- ---------------- ----------- --------------
-#
-#
-# Now, rather than having 4 trusted certificates (one for alf@seattle,
-# bob@portland, pabs@dc, and tomecope@dc), a user could actually get by with 1
-# certificate: the "rubygems@rubyforge.org" certificate. Here's how it works:
-#
-# I install "Alf2000-Ruby-0.1.0.gem", a package signed by "alf@seattle". I've
-# never heard of "alf@seattle", but his certificate has a valid signature from
-# the "seattle.rb@zenspider.com" certificate, which in turn has a valid
-# signature from the "rubygems@rubyforge.org" certificate. Voila! At this
-# point, it's much more reasonable for me to trust a package signed by
-# "alf@seattle", because I can establish a chain to "rubygems@rubyforge.org",
-# which I do trust.
-#
-# And the "--sign" option allows all this to happen. A developer creates
-# their build certificate with the "--build" option, then has their
-# certificate signed by taking it with them to their next regional Ruby meetup
-# (in our hypothetical example), and it's signed there by the person holding
-# the regional RubyGems signing certificate, which is signed at the next
-# RubyConf by the holder of the top-level RubyGems certificate. At each point
-# the issuer runs the same command:
-#
-# # sign a certificate with the specified key and certificate
-# # (note that this modifies client_cert.pem!)
-# $ gem cert -K /mnt/floppy/issuer-priv_key.pem -C issuer-pub_cert.pem
-# --sign client_cert.pem
-#
-# Then the holder of issued certificate (in this case, our buddy
-# "alf@seattle"), can start using this signed certificate to sign RubyGems.
-# By the way, in order to let everyone else know about his new fancy signed
-# certificate, "alf@seattle" would change his gemspec file to look like this:
-#
-# # signing key (still kept in an undisclosed location!)
-# s.signing_key = '/mnt/floppy/alf-private_key.pem'
-#
-# # certificate chain (includes the issuer certificate now too)
-# s.cert_chain = ['/home/alf/doc/seattlerb-public_cert.pem',
-# '/home/alf/doc/alf_at_seattle-public_cert.pem']
-#
-# Obviously, this RubyGems trust infrastructure doesn't exist yet. Also, in
-# the "real world" issuers actually generate the child certificate from a
-# certificate request, rather than sign an existing certificate. And our
-# hypothetical infrastructure is missing a certificate revocation system.
-# These are that can be fixed in the future...
-#
-# I'm sure your new signed gem has finished installing by now (unless you're
-# installing rails and all it's dependencies, that is ;D). At this point you
-# should know how to do all of these new and interesting things:
-#
-# * build a gem signing key and certificate
-# * modify your existing gems to support signing
-# * adjust your security policy
-# * modify your trusted certificate list
-# * sign a certificate
-#
-# If you've got any questions, feel free to contact me at the email address
-# below. The next couple of sections
-#
-#
-# == Command-Line Options
-#
-# Here's a brief summary of the certificate-related command line options:
-#
-# gem install
-# -P, --trust-policy POLICY Specify gem trust policy.
-#
-# gem cert
-# -a, --add CERT Add a trusted certificate.
-# -l, --list List trusted certificates.
-# -r, --remove STRING Remove trusted certificates containing
-# STRING.
-# -b, --build EMAIL_ADDR Build private key and self-signed
-# certificate for EMAIL_ADDR.
-# -C, --certificate CERT Certificate for --sign command.
-# -K, --private-key KEY Private key for --sign command.
-# -s, --sign NEWCERT Sign a certificate with my key and
-# certificate.
-#
-# A more detailed description of each options is available in the walkthrough
-# above.
-#
-#
-# == OpenSSL Reference
-#
-# The .pem files generated by --build and --sign are just basic OpenSSL PEM
-# files. Here's a couple of useful commands for manipulating them:
-#
-# # convert a PEM format X509 certificate into DER format:
-# # (note: Windows .cer files are X509 certificates in DER format)
-# $ openssl x509 -in input.pem -outform der -out output.der
-#
-# # print out the certificate in a human-readable format:
-# $ openssl x509 -in input.pem -noout -text
-#
-# And you can do the same thing with the private key file as well:
-#
-# # convert a PEM format RSA key into DER format:
-# $ openssl rsa -in input_key.pem -outform der -out output_key.der
-#
-# # print out the key in a human readable format:
-# $ openssl rsa -in input_key.pem -noout -text
-#
-# == Bugs/TODO
-#
-# * There's no way to define a system-wide trust list.
-# * custom security policies (from a YAML file, etc)
-# * Simple method to generate a signed certificate request
-# * Support for OCSP, SCVP, CRLs, or some other form of cert
-# status check (list is in order of preference)
-# * Support for encrypted private keys
-# * Some sort of semi-formal trust hierarchy (see long-winded explanation
-# above)
-# * Path discovery (for gem certificate chains that don't have a self-signed
-# root) -- by the way, since we don't have this, THE ROOT OF THE CERTIFICATE
-# CHAIN MUST BE SELF SIGNED if Policy#verify_root is true (and it is for the
-# MediumSecurity and HighSecurity policies)
-# * Better explanation of X509 naming (ie, we don't have to use email
-# addresses)
-# * Possible alternate signing mechanisms (eg, via PGP). this could be done
-# pretty easily by adding a :signing_type attribute to the gemspec, then add
-# the necessary support in other places
-# * Honor AIA field (see note about OCSP above)
-# * Maybe honor restriction extensions?
-# * Might be better to store the certificate chain as a PKCS#7 or PKCS#12
-# file, instead of an array embedded in the metadata. ideas?
-# * Possibly embed signature and key algorithms into metadata (right now
-# they're assumed to be the same as what's set in Gem::Security::OPT)
-#
-# == About the Author
-#
-# Paul Duncan <pabs@pablotron.org>
-# http://pablotron.org/
-
-module Gem::Security
-
- class Exception < Gem::Exception; end
-
- #
- # default options for most of the methods below
- #
- OPT = {
- # private key options
- :key_algo => Gem::SSL::PKEY_RSA,
- :key_size => 2048,
-
- # public cert options
- :cert_age => 365 * 24 * 3600, # 1 year
- :dgst_algo => Gem::SSL::DIGEST_SHA1,
-
- # x509 certificate extensions
- :cert_exts => {
- 'basicConstraints' => 'CA:FALSE',
- 'subjectKeyIdentifier' => 'hash',
- 'keyUsage' => 'keyEncipherment,dataEncipherment,digitalSignature',
- },
-
- # save the key and cert to a file in build_self_signed_cert()?
- :save_key => true,
- :save_cert => true,
-
- # if you define either of these, then they'll be used instead of
- # the output_fmt macro below
- :save_key_path => nil,
- :save_cert_path => nil,
-
- # output name format for self-signed certs
- :output_fmt => 'gem-%s.pem',
- :munge_re => Regexp.new(/[^a-z0-9_.-]+/),
-
- # output directory for trusted certificate checksums
- :trust_dir => File::join(Gem.user_home, '.gem', 'trust'),
-
- # default permissions for trust directory and certs
- :perms => {
- :trust_dir => 0700,
- :trusted_cert => 0600,
- :signing_cert => 0600,
- :signing_key => 0600,
- },
- }
-
- #
- # A Gem::Security::Policy object encapsulates the settings for verifying
- # signed gem files. This is the base class. You can either declare an
- # instance of this or use one of the preset security policies below.
- #
- class Policy
- attr_accessor :verify_data, :verify_signer, :verify_chain,
- :verify_root, :only_trusted, :only_signed
-
- #
- # Create a new Gem::Security::Policy object with the given mode and
- # options.
- #
- def initialize(policy = {}, opt = {})
- # set options
- @opt = Gem::Security::OPT.merge(opt)
-
- # build policy
- policy.each_pair do |key, val|
- case key
- when :verify_data then @verify_data = val
- when :verify_signer then @verify_signer = val
- when :verify_chain then @verify_chain = val
- when :verify_root then @verify_root = val
- when :only_trusted then @only_trusted = val
- when :only_signed then @only_signed = val
- end
- end
- end
-
- #
- # Get the path to the file for this cert.
- #
- def self.trusted_cert_path(cert, opt = {})
- opt = Gem::Security::OPT.merge(opt)
-
- # get digest algorithm, calculate checksum of root.subject
- algo = opt[:dgst_algo]
- dgst = algo.hexdigest(cert.subject.to_s)
-
- # build path to trusted cert file
- name = "cert-#{dgst}.pem"
-
- # join and return path components
- File::join(opt[:trust_dir], name)
- end
-
- #
- # Verify that the gem data with the given signature and signing chain
- # matched this security policy at the specified time.
- #
- def verify_gem(signature, data, chain, time = Time.now)
- Gem.ensure_ssl_available
- cert_class = OpenSSL::X509::Certificate
- exc = Gem::Security::Exception
- chain ||= []
-
- chain = chain.map{ |str| cert_class.new(str) }
- signer, ch_len = chain[-1], chain.size
-
- # make sure signature is valid
- if @verify_data
- # get digest algorithm (TODO: this should be configurable)
- dgst = @opt[:dgst_algo]
-
- # verify the data signature (this is the most important part, so don't
- # screw it up :D)
- v = signer.public_key.verify(dgst.new, signature, data)
- raise exc, "Invalid Gem Signature" unless v
-
- # make sure the signer is valid
- if @verify_signer
- # make sure the signing cert is valid right now
- v = signer.check_validity(nil, time)
- raise exc, "Invalid Signature: #{v[:desc]}" unless v[:is_valid]
- end
- end
-
- # make sure the certificate chain is valid
- if @verify_chain
- # iterate down over the chain and verify each certificate against it's
- # issuer
- (ch_len - 1).downto(1) do |i|
- issuer, cert = chain[i - 1, 2]
- v = cert.check_validity(issuer, time)
- raise exc, "%s: cert = '%s', error = '%s'" % [
- 'Invalid Signing Chain', cert.subject, v[:desc]
- ] unless v[:is_valid]
- end
-
- # verify root of chain
- if @verify_root
- # make sure root is self-signed
- root = chain[0]
- raise exc, "%s: %s (subject = '%s', issuer = '%s')" % [
- 'Invalid Signing Chain Root',
- 'Subject does not match Issuer for Gem Signing Chain',
- root.subject.to_s,
- root.issuer.to_s,
- ] unless root.issuer.to_s == root.subject.to_s
-
- # make sure root is valid
- v = root.check_validity(root, time)
- raise exc, "%s: cert = '%s', error = '%s'" % [
- 'Invalid Signing Chain Root', root.subject, v[:desc]
- ] unless v[:is_valid]
-
- # verify that the chain root is trusted
- if @only_trusted
- # get digest algorithm, calculate checksum of root.subject
- algo = @opt[:dgst_algo]
- path = Gem::Security::Policy.trusted_cert_path(root, @opt)
-
- # check to make sure trusted path exists
- raise exc, "%s: cert = '%s', error = '%s'" % [
- 'Untrusted Signing Chain Root',
- root.subject.to_s,
- "path \"#{path}\" does not exist",
- ] unless File.exist?(path)
-
- # load calculate digest from saved cert file
- save_cert = OpenSSL::X509::Certificate.new(File.read(path))
- save_dgst = algo.digest(save_cert.public_key.to_s)
-
- # create digest of public key
- pkey_str = root.public_key.to_s
- cert_dgst = algo.digest(pkey_str)
-
- # now compare the two digests, raise exception
- # if they don't match
- raise exc, "%s: %s (saved = '%s', root = '%s')" % [
- 'Invalid Signing Chain Root',
- "Saved checksum doesn't match root checksum",
- save_dgst, cert_dgst,
- ] unless save_dgst == cert_dgst
- end
- end
-
- # return the signing chain
- chain.map { |cert| cert.subject }
- end
- end
- end
-
- #
- # No security policy: all package signature checks are disabled.
- #
- NoSecurity = Policy.new(
- :verify_data => false,
- :verify_signer => false,
- :verify_chain => false,
- :verify_root => false,
- :only_trusted => false,
- :only_signed => false
- )
-
- #
- # AlmostNo security policy: only verify that the signing certificate is the
- # one that actually signed the data. Make no attempt to verify the signing
- # certificate chain.
- #
- # This policy is basically useless. better than nothing, but can still be
- # easily spoofed, and is not recommended.
- #
- AlmostNoSecurity = Policy.new(
- :verify_data => true,
- :verify_signer => false,
- :verify_chain => false,
- :verify_root => false,
- :only_trusted => false,
- :only_signed => false
- )
-
- #
- # Low security policy: only verify that the signing certificate is actually
- # the gem signer, and that the signing certificate is valid.
- #
- # This policy is better than nothing, but can still be easily spoofed, and
- # is not recommended.
- #
- LowSecurity = Policy.new(
- :verify_data => true,
- :verify_signer => true,
- :verify_chain => false,
- :verify_root => false,
- :only_trusted => false,
- :only_signed => false
- )
-
- #
- # Medium security policy: verify the signing certificate, verify the signing
- # certificate chain all the way to the root certificate, and only trust root
- # certificates that we have explicitly allowed trust for.
- #
- # This security policy is reasonable, but it allows unsigned packages, so a
- # malicious person could simply delete the package signature and pass the
- # gem off as unsigned.
- #
- MediumSecurity = Policy.new(
- :verify_data => true,
- :verify_signer => true,
- :verify_chain => true,
- :verify_root => true,
- :only_trusted => true,
- :only_signed => false
- )
-
- #
- # High security policy: only allow signed gems to be installed, verify the
- # signing certificate, verify the signing certificate chain all the way to
- # the root certificate, and only trust root certificates that we have
- # explicitly allowed trust for.
- #
- # This security policy is significantly more difficult to bypass, and offers
- # a reasonable guarantee that the contents of the gem have not been altered.
- #
- HighSecurity = Policy.new(
- :verify_data => true,
- :verify_signer => true,
- :verify_chain => true,
- :verify_root => true,
- :only_trusted => true,
- :only_signed => true
- )
-
- #
- # Hash of configured security policies
- #
- Policies = {
- 'NoSecurity' => NoSecurity,
- 'AlmostNoSecurity' => AlmostNoSecurity,
- 'LowSecurity' => LowSecurity,
- 'MediumSecurity' => MediumSecurity,
- 'HighSecurity' => HighSecurity,
- }
-
- #
- # Sign the cert cert with @signing_key and @signing_cert, using the digest
- # algorithm opt[:dgst_algo]. Returns the newly signed certificate.
- #
- def self.sign_cert(cert, signing_key, signing_cert, opt = {})
- opt = OPT.merge(opt)
-
- # set up issuer information
- cert.issuer = signing_cert.subject
- cert.sign(signing_key, opt[:dgst_algo].new)
-
- cert
- end
-
- #
- # Make sure the trust directory exists. If it does exist, make sure it's
- # actually a directory. If not, then create it with the appropriate
- # permissions.
- #
- def self.verify_trust_dir(path, perms)
- # if the directory exists, then make sure it is in fact a directory. if
- # it doesn't exist, then create it with the appropriate permissions
- if File.exist?(path)
- # verify that the trust directory is actually a directory
- unless File.directory?(path)
- err = "trust directory #{path} isn't a directory"
- raise Gem::Security::Exception, err
- end
- else
- # trust directory doesn't exist, so create it with permissions
- FileUtils.mkdir_p(path)
- FileUtils.chmod(perms, path)
- end
- end
-
- #
- # Build a certificate from the given DN and private key.
- #
- def self.build_cert(name, key, opt = {})
- Gem.ensure_ssl_available
- opt = OPT.merge(opt)
-
- # create new cert
- ret = OpenSSL::X509::Certificate.new
-
- # populate cert attributes
- ret.version = 2
- ret.serial = 0
- ret.public_key = key.public_key
- ret.not_before = Time.now
- ret.not_after = Time.now + opt[:cert_age]
- ret.subject = name
-
- # add certificate extensions
- ef = OpenSSL::X509::ExtensionFactory.new(nil, ret)
- ret.extensions = opt[:cert_exts].map { |k, v| ef.create_extension(k, v) }
-
- # sign cert
- i_key, i_cert = opt[:issuer_key] || key, opt[:issuer_cert] || ret
- ret = sign_cert(ret, i_key, i_cert, opt)
-
- # return cert
- ret
- end
-
- #
- # Build a self-signed certificate for the given email address.
- #
- def self.build_self_signed_cert(email_addr, opt = {})
- Gem.ensure_ssl_available
- opt = OPT.merge(opt)
- path = { :key => nil, :cert => nil }
-
- # split email address up
- cn, dcs = email_addr.split('@')
- dcs = dcs.split('.')
-
- # munge email CN and DCs
- cn = cn.gsub(opt[:munge_re], '_')
- dcs = dcs.map { |dc| dc.gsub(opt[:munge_re], '_') }
-
- # create DN
- name = "CN=#{cn}/" << dcs.map { |dc| "DC=#{dc}" }.join('/')
- name = OpenSSL::X509::Name::parse(name)
-
- # build private key
- key = opt[:key_algo].new(opt[:key_size])
-
- # method name pretty much says it all :)
- verify_trust_dir(opt[:trust_dir], opt[:perms][:trust_dir])
-
- # if we're saving the key, then write it out
- if opt[:save_key]
- path[:key] = opt[:save_key_path] || (opt[:output_fmt] % 'private_key')
- File.open(path[:key], 'wb') do |file|
- file.chmod(opt[:perms][:signing_key])
- file.write(key.to_pem)
- end
- end
-
- # build self-signed public cert from key
- cert = build_cert(name, key, opt)
-
- # if we're saving the cert, then write it out
- if opt[:save_cert]
- path[:cert] = opt[:save_cert_path] || (opt[:output_fmt] % 'public_cert')
- File.open(path[:cert], 'wb') do |file|
- file.chmod(opt[:perms][:signing_cert])
- file.write(cert.to_pem)
- end
- end
-
- # return key, cert, and paths (if applicable)
- { :key => key, :cert => cert,
- :key_path => path[:key], :cert_path => path[:cert] }
- end
-
- #
- # Add certificate to trusted cert list.
- #
- # Note: At the moment these are stored in OPT[:trust_dir], although that
- # directory may change in the future.
- #
- def self.add_trusted_cert(cert, opt = {})
- opt = OPT.merge(opt)
-
- # get destination path
- path = Gem::Security::Policy.trusted_cert_path(cert, opt)
-
- # verify trust directory (can't write to nowhere, you know)
- verify_trust_dir(opt[:trust_dir], opt[:perms][:trust_dir])
-
- # write cert to output file
- File.open(path, 'wb') do |file|
- file.chmod(opt[:perms][:trusted_cert])
- file.write(cert.to_pem)
- end
-
- # return nil
- nil
- end
-
- #
- # Basic OpenSSL-based package signing class.
- #
- class Signer
- attr_accessor :key, :cert_chain
-
- def initialize(key, cert_chain)
- Gem.ensure_ssl_available
- @algo = Gem::Security::OPT[:dgst_algo]
- @key, @cert_chain = key, cert_chain
-
- # check key, if it's a file, and if it's key, leave it alone
- if @key && !@key.kind_of?(OpenSSL::PKey::PKey)
- @key = OpenSSL::PKey::RSA.new(File.read(@key))
- end
-
- # check cert chain, if it's a file, load it, if it's cert data, convert
- # it into a cert object, and if it's a cert object, leave it alone
- if @cert_chain
- @cert_chain = @cert_chain.map do |cert|
- # check cert, if it's a file, load it, if it's cert data, convert it
- # into a cert object, and if it's a cert object, leave it alone
- if cert && !cert.kind_of?(OpenSSL::X509::Certificate)
- cert = File.read(cert) if File::exist?(cert)
- cert = OpenSSL::X509::Certificate.new(cert)
- end
- cert
- end
- end
- end
-
- #
- # Sign data with given digest algorithm
- #
- def sign(data)
- @key.sign(@algo.new, data)
- end
-
- end
-end
-
diff --git a/lib/rubygems/server.rb b/lib/rubygems/server.rb
deleted file mode 100644
index 44bee74abf..0000000000
--- a/lib/rubygems/server.rb
+++ /dev/null
@@ -1,813 +0,0 @@
-require 'webrick'
-require 'yaml'
-require 'zlib'
-require 'erb'
-
-require 'rubygems'
-require 'rubygems/doc_manager'
-
-##
-# Gem::Server and allows users to serve gems for consumption by
-# `gem --remote-install`.
-#
-# gem_server starts an HTTP server on the given port and serves the following:
-# * "/" - Browsing of gem spec files for installed gems
-# * "/specs.#{Gem.marshal_version}.gz" - specs name/version/platform index
-# * "/latest_specs.#{Gem.marshal_version}.gz" - latest specs
-# name/version/platform index
-# * "/quick/" - Individual gemspecs
-# * "/gems" - Direct access to download the installable gems
-# * "/rdoc?q=" - Search for installed rdoc documentation
-# * legacy indexes:
-# * "/Marshal.#{Gem.marshal_version}" - Full SourceIndex dump of metadata
-# for installed gems
-# * "/yaml" - YAML dump of metadata for installed gems - deprecated
-#
-# == Usage
-#
-# gem_server = Gem::Server.new Gem.dir, 8089, false
-# gem_server.run
-#
-#--
-# TODO Refactor into a real WEBrick servlet to remove code duplication.
-
-class Gem::Server
-
- include ERB::Util
- include Gem::UserInteraction
-
- SEARCH = <<-SEARCH
- <form class="headerSearch" name="headerSearchForm" method="get" action="/rdoc">
- <div id="search" style="float:right">
- <span>Filter/Search</span>
- <input id="q" type="text" style="width:10em" name="q"/>
- <button type="submit" style="display:none" />
- </div>
- </form>
- SEARCH
-
- DOC_TEMPLATE = <<-'DOC_TEMPLATE'
- <?xml version="1.0" encoding="iso-8859-1"?>
- <!DOCTYPE html
- PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
- <head>
- <title>RubyGems Documentation Index</title>
- <link rel="stylesheet" href="gem-server-rdoc-style.css" type="text/css" media="screen" />
- </head>
- <body>
- <div id="fileHeader">
-<%= SEARCH %>
- <h1>RubyGems Documentation Index</h1>
- </div>
- <!-- banner header -->
-
- <div id="bodyContent">
- <div id="contextContent">
- <div id="description">
- <h1>Summary</h1>
- <p>There are <%=values["gem_count"]%> gems installed:</p>
- <p>
- <%= values["specs"].map { |v| "<a href=\"##{v["name"]}\">#{v["name"]}</a>" }.join ', ' %>.
- <h1>Gems</h1>
-
- <dl>
- <% values["specs"].each do |spec| %>
- <dt>
- <% if spec["first_name_entry"] then %>
- <a name="<%=spec["name"]%>"></a>
- <% end %>
-
- <b><%=spec["name"]%> <%=spec["version"]%></b>
-
- <% if spec["rdoc_installed"] then %>
- <a href="<%=spec["doc_path"]%>">[rdoc]</a>
- <% else %>
- <span title="rdoc not installed">[rdoc]</span>
- <% end %>
-
- <% if spec["homepage"] then %>
- <a href="<%=spec["homepage"]%>" title="<%=spec["homepage"]%>">[www]</a>
- <% else %>
- <span title="no homepage available">[www]</span>
- <% end %>
-
- <% if spec["has_deps"] then %>
- - depends on
- <%= spec["dependencies"].map { |v| "<a href=\"##{v["name"]}\">#{v["name"]}</a>" }.join ', ' %>.
- <% end %>
- </dt>
- <dd>
- <%=spec["summary"]%>
- <% if spec["executables"] then %>
- <br/>
-
- <% if spec["only_one_executable"] then %>
- Executable is
- <% else %>
- Executables are
- <%end%>
-
- <%= spec["executables"].map { |v| "<span class=\"context-item-name\">#{v["executable"]}</span>"}.join ', ' %>.
-
- <%end%>
- <br/>
- <br/>
- </dd>
- <% end %>
- </dl>
-
- </div>
- </div>
- </div>
- <div id="validator-badges">
- <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
- </div>
- </body>
- </html>
- DOC_TEMPLATE
-
- # CSS is copy & paste from rdoc-style.css, RDoc V1.0.1 - 20041108
- RDOC_CSS = <<-RDOC_CSS
-body {
- font-family: Verdana,Arial,Helvetica,sans-serif;
- font-size: 90%;
- margin: 0;
- margin-left: 40px;
- padding: 0;
- background: white;
-}
-
-h1,h2,h3,h4 { margin: 0; color: #efefef; background: transparent; }
-h1 { font-size: 150%; }
-h2,h3,h4 { margin-top: 1em; }
-
-a { background: #eef; color: #039; text-decoration: none; }
-a:hover { background: #039; color: #eef; }
-
-/* Override the base stylesheets Anchor inside a table cell */
-td > a {
- background: transparent;
- color: #039;
- text-decoration: none;
-}
-
-/* and inside a section title */
-.section-title > a {
- background: transparent;
- color: #eee;
- text-decoration: none;
-}
-
-/* === Structural elements =================================== */
-
-div#index {
- margin: 0;
- margin-left: -40px;
- padding: 0;
- font-size: 90%;
-}
-
-
-div#index a {
- margin-left: 0.7em;
-}
-
-div#index .section-bar {
- margin-left: 0px;
- padding-left: 0.7em;
- background: #ccc;
- font-size: small;
-}
-
-
-div#classHeader, div#fileHeader {
- width: auto;
- color: white;
- padding: 0.5em 1.5em 0.5em 1.5em;
- margin: 0;
- margin-left: -40px;
- border-bottom: 3px solid #006;
-}
-
-div#classHeader a, div#fileHeader a {
- background: inherit;
- color: white;
-}
-
-div#classHeader td, div#fileHeader td {
- background: inherit;
- color: white;
-}
-
-
-div#fileHeader {
- background: #057;
-}
-
-div#classHeader {
- background: #048;
-}
-
-
-.class-name-in-header {
- font-size: 180%;
- font-weight: bold;
-}
-
-
-div#bodyContent {
- padding: 0 1.5em 0 1.5em;
-}
-
-div#description {
- padding: 0.5em 1.5em;
- background: #efefef;
- border: 1px dotted #999;
-}
-
-div#description h1,h2,h3,h4,h5,h6 {
- color: #125;;
- background: transparent;
-}
-
-div#validator-badges {
- text-align: center;
-}
-div#validator-badges img { border: 0; }
-
-div#copyright {
- color: #333;
- background: #efefef;
- font: 0.75em sans-serif;
- margin-top: 5em;
- margin-bottom: 0;
- padding: 0.5em 2em;
-}
-
-
-/* === Classes =================================== */
-
-table.header-table {
- color: white;
- font-size: small;
-}
-
-.type-note {
- font-size: small;
- color: #DEDEDE;
-}
-
-.xxsection-bar {
- background: #eee;
- color: #333;
- padding: 3px;
-}
-
-.section-bar {
- color: #333;
- border-bottom: 1px solid #999;
- margin-left: -20px;
-}
-
-
-.section-title {
- background: #79a;
- color: #eee;
- padding: 3px;
- margin-top: 2em;
- margin-left: -30px;
- border: 1px solid #999;
-}
-
-.top-aligned-row { vertical-align: top }
-.bottom-aligned-row { vertical-align: bottom }
-
-/* --- Context section classes ----------------------- */
-
-.context-row { }
-.context-item-name { font-family: monospace; font-weight: bold; color: black; }
-.context-item-value { font-size: small; color: #448; }
-.context-item-desc { color: #333; padding-left: 2em; }
-
-/* --- Method classes -------------------------- */
-.method-detail {
- background: #efefef;
- padding: 0;
- margin-top: 0.5em;
- margin-bottom: 1em;
- border: 1px dotted #ccc;
-}
-.method-heading {
- color: black;
- background: #ccc;
- border-bottom: 1px solid #666;
- padding: 0.2em 0.5em 0 0.5em;
-}
-.method-signature { color: black; background: inherit; }
-.method-name { font-weight: bold; }
-.method-args { font-style: italic; }
-.method-description { padding: 0 0.5em 0 0.5em; }
-
-/* --- Source code sections -------------------- */
-
-a.source-toggle { font-size: 90%; }
-div.method-source-code {
- background: #262626;
- color: #ffdead;
- margin: 1em;
- padding: 0.5em;
- border: 1px dashed #999;
- overflow: hidden;
-}
-
-div.method-source-code pre { color: #ffdead; overflow: hidden; }
-
-/* --- Ruby keyword styles --------------------- */
-
-.standalone-code { background: #221111; color: #ffdead; overflow: hidden; }
-
-.ruby-constant { color: #7fffd4; background: transparent; }
-.ruby-keyword { color: #00ffff; background: transparent; }
-.ruby-ivar { color: #eedd82; background: transparent; }
-.ruby-operator { color: #00ffee; background: transparent; }
-.ruby-identifier { color: #ffdead; background: transparent; }
-.ruby-node { color: #ffa07a; background: transparent; }
-.ruby-comment { color: #b22222; font-weight: bold; background: transparent; }
-.ruby-regexp { color: #ffa07a; background: transparent; }
-.ruby-value { color: #7fffd4; background: transparent; }
- RDOC_CSS
-
- RDOC_NO_DOCUMENTATION = <<-'NO_DOC'
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
- <head>
- <title>Found documentation</title>
- <link rel="stylesheet" href="gem-server-rdoc-style.css" type="text/css" media="screen" />
- </head>
- <body>
- <div id="fileHeader">
-<%= SEARCH %>
- <h1>No documentation found</h1>
- </div>
-
- <div id="bodyContent">
- <div id="contextContent">
- <div id="description">
- <p>No gems matched <%= h query.inspect %></p>
-
- <p>
- Back to <a href="/">complete gem index</a>
- </p>
-
- </div>
- </div>
- </div>
- <div id="validator-badges">
- <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
- </div>
- </body>
-</html>
- NO_DOC
-
- RDOC_SEARCH_TEMPLATE = <<-'RDOC_SEARCH'
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
- <head>
- <title>Found documentation</title>
- <link rel="stylesheet" href="gem-server-rdoc-style.css" type="text/css" media="screen" />
- </head>
- <body>
- <div id="fileHeader">
-<%= SEARCH %>
- <h1>Found documentation</h1>
- </div>
- <!-- banner header -->
-
- <div id="bodyContent">
- <div id="contextContent">
- <div id="description">
- <h1>Summary</h1>
- <p><%=doc_items.length%> documentation topics found.</p>
- <h1>Topics</h1>
-
- <dl>
- <% doc_items.each do |doc_item| %>
- <dt>
- <b><%=doc_item[:name]%></b>
- <a href="<%=doc_item[:url]%>">[rdoc]</a>
- </dt>
- <dd>
- <%=doc_item[:summary]%>
- <br/>
- <br/>
- </dd>
- <% end %>
- </dl>
-
- <p>
- Back to <a href="/">complete gem index</a>
- </p>
-
- </div>
- </div>
- </div>
- <div id="validator-badges">
- <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
- </div>
- </body>
-</html>
- RDOC_SEARCH
-
- def self.run(options)
- new(options[:gemdir], options[:port], options[:daemon]).run
- end
-
- def initialize(gem_dir, port, daemon)
- Socket.do_not_reverse_lookup = true
-
- @gem_dir = gem_dir
- @port = port
- @daemon = daemon
- logger = WEBrick::Log.new nil, WEBrick::BasicLog::FATAL
- @server = WEBrick::HTTPServer.new :DoNotListen => true, :Logger => logger
-
- @spec_dir = File.join @gem_dir, 'specifications'
-
- unless File.directory? @spec_dir then
- raise ArgumentError, "#{@gem_dir} does not appear to be a gem repository"
- end
-
- @source_index = Gem::SourceIndex.from_gems_in @spec_dir
- end
-
- def Marshal(req, res)
- @source_index.refresh!
-
- res['date'] = File.stat(@spec_dir).mtime
-
- index = Marshal.dump @source_index
-
- if req.request_method == 'HEAD' then
- res['content-length'] = index.length
- return
- end
-
- if req.path =~ /Z$/ then
- res['content-type'] = 'application/x-deflate'
- index = Gem.deflate index
- else
- res['content-type'] = 'application/octet-stream'
- end
-
- res.body << index
- end
-
- def latest_specs(req, res)
- @source_index.refresh!
-
- res['content-type'] = 'application/x-gzip'
-
- res['date'] = File.stat(@spec_dir).mtime
-
- specs = @source_index.latest_specs.sort.map do |spec|
- platform = spec.original_platform
- platform = Gem::Platform::RUBY if platform.nil?
- [spec.name, spec.version, platform]
- end
-
- specs = Marshal.dump specs
-
- if req.path =~ /\.gz$/ then
- specs = Gem.gzip specs
- res['content-type'] = 'application/x-gzip'
- else
- res['content-type'] = 'application/octet-stream'
- end
-
- if req.request_method == 'HEAD' then
- res['content-length'] = specs.length
- else
- res.body << specs
- end
- end
-
- def quick(req, res)
- @source_index.refresh!
-
- res['content-type'] = 'text/plain'
- res['date'] = File.stat(@spec_dir).mtime
-
- case req.request_uri.path
- when '/quick/index' then
- res.body << @source_index.map { |name,| name }.sort.join("\n")
- when '/quick/index.rz' then
- index = @source_index.map { |name,| name }.sort.join("\n")
- res['content-type'] = 'application/x-deflate'
- res.body << Gem.deflate(index)
- when '/quick/latest_index' then
- index = @source_index.latest_specs.map { |spec| spec.full_name }
- res.body << index.sort.join("\n")
- when '/quick/latest_index.rz' then
- index = @source_index.latest_specs.map { |spec| spec.full_name }
- res['content-type'] = 'application/x-deflate'
- res.body << Gem.deflate(index.sort.join("\n"))
- when %r|^/quick/(Marshal.#{Regexp.escape Gem.marshal_version}/)?(.*?)-([0-9.]+)(-.*?)?\.gemspec\.rz$| then
- dep = Gem::Dependency.new $2, $3
- specs = @source_index.search dep
- marshal_format = $1
-
- selector = [$2, $3, $4].map { |s| s.inspect }.join ' '
-
- platform = if $4 then
- Gem::Platform.new $4.sub(/^-/, '')
- else
- Gem::Platform::RUBY
- end
-
- specs = specs.select { |s| s.platform == platform }
-
- if specs.empty? then
- res.status = 404
- res.body = "No gems found matching #{selector}"
- elsif specs.length > 1 then
- res.status = 500
- res.body = "Multiple gems found matching #{selector}"
- elsif marshal_format then
- res['content-type'] = 'application/x-deflate'
- res.body << Gem.deflate(Marshal.dump(specs.first))
- else # deprecated YAML format
- res['content-type'] = 'application/x-deflate'
- res.body << Gem.deflate(specs.first.to_yaml)
- end
- else
- raise WEBrick::HTTPStatus::NotFound, "`#{req.path}' not found."
- end
- end
-
- def root(req, res)
- @source_index.refresh!
- res['date'] = File.stat(@spec_dir).mtime
-
- raise WEBrick::HTTPStatus::NotFound, "`#{req.path}' not found." unless
- req.path == '/'
-
- specs = []
- total_file_count = 0
-
- @source_index.each do |path, spec|
- total_file_count += spec.files.size
- deps = spec.dependencies.map do |dep|
- { "name" => dep.name,
- "type" => dep.type,
- "version" => dep.version_requirements.to_s, }
- end
-
- deps = deps.sort_by { |dep| [dep["name"].downcase, dep["version"]] }
- deps.last["is_last"] = true unless deps.empty?
-
- # executables
- executables = spec.executables.sort.collect { |exec| {"executable" => exec} }
- executables = nil if executables.empty?
- executables.last["is_last"] = true if executables
-
- specs << {
- "authors" => spec.authors.sort.join(", "),
- "date" => spec.date.to_s,
- "dependencies" => deps,
- "doc_path" => "/doc_root/#{spec.full_name}/rdoc/index.html",
- "executables" => executables,
- "only_one_executable" => (executables && executables.size == 1),
- "full_name" => spec.full_name,
- "has_deps" => !deps.empty?,
- "homepage" => spec.homepage,
- "name" => spec.name,
- "rdoc_installed" => Gem::DocManager.new(spec).rdoc_installed?,
- "summary" => spec.summary,
- "version" => spec.version.to_s,
- }
- end
-
- specs << {
- "authors" => "Chad Fowler, Rich Kilmer, Jim Weirich, Eric Hodel and others",
- "dependencies" => [],
- "doc_path" => "/doc_root/rubygems-#{Gem::RubyGemsVersion}/rdoc/index.html",
- "executables" => [{"executable" => 'gem', "is_last" => true}],
- "only_one_executable" => true,
- "full_name" => "rubygems-#{Gem::RubyGemsVersion}",
- "has_deps" => false,
- "homepage" => "http://rubygems.org/",
- "name" => 'rubygems',
- "rdoc_installed" => true,
- "summary" => "RubyGems itself",
- "version" => Gem::RubyGemsVersion,
- }
-
- specs = specs.sort_by { |spec| [spec["name"].downcase, spec["version"]] }
- specs.last["is_last"] = true
-
- # tag all specs with first_name_entry
- last_spec = nil
- specs.each do |spec|
- is_first = last_spec.nil? || (last_spec["name"].downcase != spec["name"].downcase)
- spec["first_name_entry"] = is_first
- last_spec = spec
- end
-
- # create page from template
- template = ERB.new(DOC_TEMPLATE)
- res['content-type'] = 'text/html'
-
- values = { "gem_count" => specs.size.to_s, "specs" => specs,
- "total_file_count" => total_file_count.to_s }
-
- result = template.result binding
- res.body = result
- end
-
- ##
- # Can be used for quick navigation to the rdoc documentation. You can then
- # define a search shortcut for your browser. E.g. in Firefox connect
- # 'shortcut:rdoc' to http://localhost:8808/rdoc?q=%s template. Then you can
- # directly open the ActionPack documentation by typing 'rdoc actionp'. If
- # there are multiple hits for the search term, they are presented as a list
- # with links.
- #
- # Search algorithm aims for an intuitive search:
- # 1. first try to find the gems and documentation folders which name
- # starts with the search term
- # 2. search for entries, that *contain* the search term
- # 3. show all the gems
- #
- # If there is only one search hit, user is immediately redirected to the
- # documentation for the particular gem, otherwise a list with results is
- # shown.
- #
- # === Additional trick - install documentation for ruby core
- #
- # Note: please adjust paths accordingly use for example 'locate yaml.rb' and
- # 'gem environment' to identify directories, that are specific for your
- # local installation
- #
- # 1. install ruby sources
- # cd /usr/src
- # sudo apt-get source ruby
- #
- # 2. generate documentation
- # rdoc -o /usr/lib/ruby/gems/1.8/doc/core/rdoc \
- # /usr/lib/ruby/1.8 ruby1.8-1.8.7.72
- #
- # By typing 'rdoc core' you can now access the core documentation
-
- def rdoc(req, res)
- query = req.query['q']
- show_rdoc_for_pattern("#{query}*", res) && return
- show_rdoc_for_pattern("*#{query}*", res) && return
-
- template = ERB.new RDOC_NO_DOCUMENTATION
-
- res['content-type'] = 'text/html'
- res.body = template.result binding
- end
-
- ##
- # Returns true and prepares http response, if rdoc for the requested gem
- # name pattern was found.
- #
- # The search is based on the file system content, not on the gems metadata.
- # This allows additional documentation folders like 'core' for the ruby core
- # documentation - just put it underneath the main doc folder.
-
- def show_rdoc_for_pattern(pattern, res)
- found_gems = Dir.glob("#{@gem_dir}/doc/#{pattern}").select {|path|
- File.exist? File.join(path, 'rdoc/index.html')
- }
- case found_gems.length
- when 0
- return false
- when 1
- new_path = File.basename(found_gems[0])
- res.status = 302
- res['Location'] = "/doc_root/#{new_path}/rdoc/index.html"
- return true
- else
- doc_items = []
- found_gems.each do |file_name|
- base_name = File.basename(file_name)
- doc_items << {
- :name => base_name,
- :url => "/doc_root/#{base_name}/rdoc/index.html",
- :summary => ''
- }
- end
-
- template = ERB.new(RDOC_SEARCH_TEMPLATE)
- res['content-type'] = 'text/html'
- result = template.result binding
- res.body = result
- return true
- end
- end
-
- def run
- @server.listen nil, @port
-
- say "Starting gem server on http://localhost:#{@port}/"
-
- WEBrick::Daemon.start if @daemon
-
- @server.mount_proc "/yaml", method(:yaml)
- @server.mount_proc "/yaml.Z", method(:yaml)
-
- @server.mount_proc "/Marshal.#{Gem.marshal_version}", method(:Marshal)
- @server.mount_proc "/Marshal.#{Gem.marshal_version}.Z", method(:Marshal)
-
- @server.mount_proc "/specs.#{Gem.marshal_version}", method(:specs)
- @server.mount_proc "/specs.#{Gem.marshal_version}.gz", method(:specs)
-
- @server.mount_proc "/latest_specs.#{Gem.marshal_version}",
- method(:latest_specs)
- @server.mount_proc "/latest_specs.#{Gem.marshal_version}.gz",
- method(:latest_specs)
-
- @server.mount_proc "/quick/", method(:quick)
-
- @server.mount_proc("/gem-server-rdoc-style.css") do |req, res|
- res['content-type'] = 'text/css'
- res['date'] = File.stat(@spec_dir).mtime
- res.body << RDOC_CSS
- end
-
- @server.mount_proc "/", method(:root)
-
- @server.mount_proc "/rdoc", method(:rdoc)
-
- paths = { "/gems" => "/cache/", "/doc_root" => "/doc/" }
- paths.each do |mount_point, mount_dir|
- @server.mount(mount_point, WEBrick::HTTPServlet::FileHandler,
- File.join(@gem_dir, mount_dir), true)
- end
-
- trap("INT") { @server.shutdown; exit! }
- trap("TERM") { @server.shutdown; exit! }
-
- @server.start
- end
-
- def specs(req, res)
- @source_index.refresh!
-
- res['date'] = File.stat(@spec_dir).mtime
-
- specs = @source_index.sort.map do |_, spec|
- platform = spec.original_platform
- platform = Gem::Platform::RUBY if platform.nil?
- [spec.name, spec.version, platform]
- end
-
- specs = Marshal.dump specs
-
- if req.path =~ /\.gz$/ then
- specs = Gem.gzip specs
- res['content-type'] = 'application/x-gzip'
- else
- res['content-type'] = 'application/octet-stream'
- end
-
- if req.request_method == 'HEAD' then
- res['content-length'] = specs.length
- else
- res.body << specs
- end
- end
-
- def yaml(req, res)
- @source_index.refresh!
-
- res['date'] = File.stat(@spec_dir).mtime
-
- index = @source_index.to_yaml
-
- if req.path =~ /Z$/ then
- res['content-type'] = 'application/x-deflate'
- index = Gem.deflate index
- else
- res['content-type'] = 'text/plain'
- end
-
- if req.request_method == 'HEAD' then
- res['content-length'] = index.length
- return
- end
-
- res.body << index
- end
-
-end
-
diff --git a/lib/rubygems/source_index.rb b/lib/rubygems/source_index.rb
deleted file mode 100644
index c616aefcc0..0000000000
--- a/lib/rubygems/source_index.rb
+++ /dev/null
@@ -1,591 +0,0 @@
-#--
-# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
-# All rights reserved.
-# See LICENSE.txt for permissions.
-#++
-
-require 'rubygems/user_interaction'
-require 'rubygems/specification'
-
-# :stopdoc:
-module Gem
- autoload :SpecFetcher, 'rubygems/spec_fetcher'
-end
-# :startdoc:
-
-##
-# The SourceIndex object indexes all the gems available from a
-# particular source (e.g. a list of gem directories, or a remote
-# source). A SourceIndex maps a gem full name to a gem
-# specification.
-#
-# NOTE:: The class used to be named Cache, but that became
-# confusing when cached source fetchers where introduced. The
-# constant Gem::Cache is an alias for this class to allow old
-# YAMLized source index objects to load properly.
-
-class Gem::SourceIndex
-
- include Enumerable
-
- include Gem::UserInteraction
-
- attr_reader :gems, :prerelease_gems # :nodoc:
-
- ##
- # Directories to use to refresh this SourceIndex when calling refresh!
-
- attr_accessor :spec_dirs
-
- class << self
- include Gem::UserInteraction
-
- ##
- # Factory method to construct a source index instance for a given
- # path.
- #
- # deprecated::
- # If supplied, from_installed_gems will act just like
- # +from_gems_in+. This argument is deprecated and is provided
- # just for backwards compatibility, and should not generally
- # be used.
- #
- # return::
- # SourceIndex instance
-
- def from_installed_gems(*deprecated)
- if deprecated.empty?
- from_gems_in(*installed_spec_directories)
- else
- from_gems_in(*deprecated) # HACK warn
- end
- end
-
- ##
- # Returns a list of directories from Gem.path that contain specifications.
-
- def installed_spec_directories
- Gem.path.collect { |dir| File.join(dir, "specifications") }
- end
-
- ##
- # Creates a new SourceIndex from the ruby format gem specifications in
- # +spec_dirs+.
-
- def from_gems_in(*spec_dirs)
- source_index = new
- source_index.spec_dirs = spec_dirs
- source_index.refresh!
- end
-
- ##
- # Loads a ruby-format specification from +file_name+ and returns the
- # loaded spec.
-
- def load_specification(file_name)
- return nil unless file_name and File.exist? file_name
-
- spec_code = if RUBY_VERSION < '1.9' then
- File.read file_name
- else
- File.read file_name, :encoding => 'UTF-8'
- end.untaint
-
- begin
- gemspec = eval spec_code, binding, file_name
-
- if gemspec.is_a?(Gem::Specification)
- gemspec.loaded_from = file_name
- return gemspec
- end
- alert_warning "File '#{file_name}' does not evaluate to a gem specification"
- rescue SignalException, SystemExit
- raise
- rescue SyntaxError => e
- alert_warning e
- alert_warning spec_code
- rescue Exception => e
- alert_warning "#{e.inspect}\n#{spec_code}"
- alert_warning "Invalid .gemspec format in '#{file_name}'"
- end
-
- return nil
- end
-
- end
-
- ##
- # Constructs a source index instance from the provided specifications, which
- # is a Hash of gem full names and Gem::Specifications.
- #--
- # TODO merge @gems and @prerelease_gems and provide a separate method
- # #prerelease_gems
-
- def initialize(specifications={})
- @gems, @prerelease_gems = [{}, {}]
- specifications.each{ |full_name, spec| add_spec spec }
- @spec_dirs = nil
- end
-
- ##
- # Both regular and prerelease gems
-
- def all_gems
- @gems.merge @prerelease_gems
- end
-
- ##
- # Reconstruct the source index from the specifications in +spec_dirs+.
-
- def load_gems_in(*spec_dirs)
- @gems.clear
-
- spec_dirs.reverse_each do |spec_dir|
- spec_files = Dir.glob File.join(spec_dir, '*.gemspec')
-
- spec_files.each do |spec_file|
- gemspec = self.class.load_specification spec_file.untaint
- add_spec gemspec if gemspec
- end
- end
-
- self
- end
-
- ##
- # Returns an Array specifications for the latest versions of each gem in
- # this index.
-
- def latest_specs
- result = Hash.new { |h,k| h[k] = [] }
- latest = {}
-
- sort.each do |_, spec|
- name = spec.name
- curr_ver = spec.version
- prev_ver = latest.key?(name) ? latest[name].version : nil
-
- next unless prev_ver.nil? or curr_ver >= prev_ver or
- latest[name].platform != Gem::Platform::RUBY
-
- if prev_ver.nil? or
- (curr_ver > prev_ver and spec.platform == Gem::Platform::RUBY) then
- result[name].clear
- latest[name] = spec
- end
-
- if spec.platform != Gem::Platform::RUBY then
- result[name].delete_if do |result_spec|
- result_spec.platform == spec.platform
- end
- end
-
- result[name] << spec
- end
-
- # TODO: why is this a hash while @gems is an array? Seems like
- # structural similarity would be good.
- result.values.flatten
- end
-
- ##
- # An array including only the prerelease gemspecs
-
- def prerelease_specs
- @prerelease_gems.values
- end
-
- ##
- # Add a gem specification to the source index.
-
- def add_spec(gem_spec, name = gem_spec.full_name)
- # No idea why, but the Indexer wants to insert them using original_name
- # instead of full_name. So we make it an optional arg.
- if gem_spec.version.prerelease?
- @prerelease_gems[name] = gem_spec
- else
- @gems[name] = gem_spec
- end
- end
-
- ##
- # Add gem specifications to the source index.
-
- def add_specs(*gem_specs)
- gem_specs.each do |spec|
- add_spec spec
- end
- end
-
- ##
- # Remove a gem specification named +full_name+.
-
- def remove_spec(full_name)
- if @gems.key? full_name then
- @gems.delete full_name
- else
- @prerelease_gems.delete full_name
- end
- end
-
- ##
- # Iterate over the specifications in the source index.
-
- def each(&block) # :yields: gem.full_name, gem
- @gems.each(&block)
- end
-
- ##
- # The gem specification given a full gem spec name.
-
- def specification(full_name)
- @gems[full_name]
- end
-
- ##
- # The signature for the source index. Changes in the signature indicate a
- # change in the index.
-
- def index_signature
- require 'digest'
-
- Digest::SHA256.new.hexdigest(@gems.keys.sort.join(',')).to_s
- end
-
- ##
- # The signature for the given gem specification.
-
- def gem_signature(gem_full_name)
- require 'digest'
-
- Digest::SHA256.new.hexdigest(@gems[gem_full_name].to_yaml).to_s
- end
-
- def size
- @gems.size
- end
- alias length size
-
- ##
- # Find a gem by an exact match on the short name.
-
- def find_name(gem_name, version_requirement = Gem::Requirement.default)
- dep = Gem::Dependency.new gem_name, version_requirement
- search dep
- end
-
- ##
- # Search for a gem by Gem::Dependency +gem_pattern+. If +only_platform+
- # is true, only gems matching Gem::Platform.local will be returned. An
- # Array of matching Gem::Specification objects is returned.
- #
- # For backwards compatibility, a String or Regexp pattern may be passed as
- # +gem_pattern+, and a Gem::Requirement for +platform_only+. This
- # behavior is deprecated and will be removed.
-
- def search(gem_pattern, platform_only = false)
- version_requirement = nil
- only_platform = false
-
- # TODO - Remove support and warning for legacy arguments after 2008/11
- unless Gem::Dependency === gem_pattern
- warn "#{Gem.location_of_caller.join ':'}:Warning: Gem::SourceIndex#search support for #{gem_pattern.class} patterns is deprecated, use #find_name"
- end
-
- case gem_pattern
- when Regexp then
- version_requirement = platform_only || Gem::Requirement.default
- when Gem::Dependency then
- only_platform = platform_only
- version_requirement = gem_pattern.version_requirements
- gem_pattern = if Regexp === gem_pattern.name then
- gem_pattern.name
- elsif gem_pattern.name.empty? then
- //
- else
- /^#{Regexp.escape gem_pattern.name}$/
- end
- else
- version_requirement = platform_only || Gem::Requirement.default
- gem_pattern = /#{gem_pattern}/i
- end
-
- unless Gem::Requirement === version_requirement then
- version_requirement = Gem::Requirement.create version_requirement
- end
-
- specs = all_gems.values.select do |spec|
- spec.name =~ gem_pattern and
- version_requirement.satisfied_by? spec.version
- end
-
- if only_platform then
- specs = specs.select do |spec|
- Gem::Platform.match spec.platform
- end
- end
-
- specs.sort_by { |s| s.sort_obj }
- end
-
- ##
- # Replaces the gems in the source index from specifications in the
- # directories this source index was created from. Raises an exception if
- # this source index wasn't created from a directory (via from_gems_in or
- # from_installed_gems, or having spec_dirs set).
-
- def refresh!
- raise 'source index not created from disk' if @spec_dirs.nil?
- load_gems_in(*@spec_dirs)
- end
-
- ##
- # Returns an Array of Gem::Specifications that are not up to date.
-
- def outdated
- outdateds = []
-
- latest_specs.each do |local|
- dependency = Gem::Dependency.new local.name, ">= #{local.version}"
-
- begin
- fetcher = Gem::SpecFetcher.fetcher
- remotes = fetcher.find_matching dependency
- remotes = remotes.map { |(name, version,_),_| version }
- rescue Gem::RemoteFetcher::FetchError => e
- raise unless fetcher.warn_legacy e do
- require 'rubygems/source_info_cache'
-
- specs = Gem::SourceInfoCache.search_with_source dependency, true
-
- remotes = specs.map { |spec,| spec.version }
- end
- end
-
- latest = remotes.sort.last
-
- outdateds << local.name if latest and local.version < latest
- end
-
- outdateds
- end
-
- ##
- # Updates this SourceIndex from +source_uri+. If +all+ is false, only the
- # latest gems are fetched.
-
- def update(source_uri, all)
- source_uri = URI.parse source_uri unless URI::Generic === source_uri
- source_uri.path += '/' unless source_uri.path =~ /\/$/
-
- use_incremental = false
-
- begin
- gem_names = fetch_quick_index source_uri, all
- remove_extra gem_names
- missing_gems = find_missing gem_names
-
- return false if missing_gems.size.zero?
-
- say "Missing metadata for #{missing_gems.size} gems" if
- missing_gems.size > 0 and Gem.configuration.really_verbose
-
- use_incremental = missing_gems.size <= Gem.configuration.bulk_threshold
- rescue Gem::OperationNotSupportedError => ex
- alert_error "Falling back to bulk fetch: #{ex.message}" if
- Gem.configuration.really_verbose
- use_incremental = false
- end
-
- if use_incremental then
- update_with_missing(source_uri, missing_gems)
- else
- new_index = fetch_bulk_index(source_uri)
- @gems.replace(new_index.gems)
- end
-
- true
- end
-
- def ==(other) # :nodoc:
- self.class === other and @gems == other.gems
- end
-
- def dump
- Marshal.dump(self)
- end
-
- private
-
- def fetcher
- require 'rubygems/remote_fetcher'
-
- Gem::RemoteFetcher.fetcher
- end
-
- def fetch_index_from(source_uri)
- @fetch_error = nil
-
- indexes = %W[
- Marshal.#{Gem.marshal_version}.Z
- Marshal.#{Gem.marshal_version}
- yaml.Z
- yaml
- ]
-
- indexes.each do |name|
- spec_data = nil
- index = source_uri + name
- begin
- spec_data = fetcher.fetch_path index
- spec_data = unzip(spec_data) if name =~ /\.Z$/
-
- if name =~ /Marshal/ then
- return Marshal.load(spec_data)
- else
- return YAML.load(spec_data)
- end
- rescue => e
- if Gem.configuration.really_verbose then
- alert_error "Unable to fetch #{name}: #{e.message}"
- end
-
- @fetch_error = e
- end
- end
-
- nil
- end
-
- def fetch_bulk_index(source_uri)
- say "Bulk updating Gem source index for: #{source_uri}" if
- Gem.configuration.verbose
-
- index = fetch_index_from(source_uri)
- if index.nil? then
- raise Gem::RemoteSourceException,
- "Error fetching remote gem cache: #{@fetch_error}"
- end
- @fetch_error = nil
- index
- end
-
- ##
- # Get the quick index needed for incremental updates.
-
- def fetch_quick_index(source_uri, all)
- index = all ? 'index' : 'latest_index'
-
- zipped_index = fetcher.fetch_path source_uri + "quick/#{index}.rz"
-
- unzip(zipped_index).split("\n")
- rescue ::Exception => e
- unless all then
- say "Latest index not found, using quick index" if
- Gem.configuration.really_verbose
-
- fetch_quick_index source_uri, true
- else
- raise Gem::OperationNotSupportedError,
- "No quick index found: #{e.message}"
- end
- end
-
- ##
- # Make a list of full names for all the missing gemspecs.
-
- def find_missing(spec_names)
- unless defined? @originals then
- @originals = {}
- each do |full_name, spec|
- @originals[spec.original_name] = spec
- end
- end
-
- spec_names.find_all { |full_name|
- @originals[full_name].nil?
- }
- end
-
- def remove_extra(spec_names)
- dictionary = spec_names.inject({}) { |h, k| h[k] = true; h }
- each do |name, spec|
- remove_spec name unless dictionary.include? spec.original_name
- end
- end
-
- ##
- # Unzip the given string.
-
- def unzip(string)
- require 'zlib'
- Gem.inflate string
- end
-
- ##
- # Tries to fetch Marshal representation first, then YAML
-
- def fetch_single_spec(source_uri, spec_name)
- @fetch_error = nil
-
- begin
- marshal_uri = source_uri + "quick/Marshal.#{Gem.marshal_version}/#{spec_name}.gemspec.rz"
- zipped = fetcher.fetch_path marshal_uri
- return Marshal.load(unzip(zipped))
- rescue => ex
- @fetch_error = ex
-
- if Gem.configuration.really_verbose then
- say "unable to fetch marshal gemspec #{marshal_uri}: #{ex.class} - #{ex}"
- end
- end
-
- begin
- yaml_uri = source_uri + "quick/#{spec_name}.gemspec.rz"
- zipped = fetcher.fetch_path yaml_uri
- return YAML.load(unzip(zipped))
- rescue => ex
- @fetch_error = ex
- if Gem.configuration.really_verbose then
- say "unable to fetch YAML gemspec #{yaml_uri}: #{ex.class} - #{ex}"
- end
- end
-
- nil
- end
-
- ##
- # Update the cached source index with the missing names.
-
- def update_with_missing(source_uri, missing_names)
- progress = ui.progress_reporter(missing_names.size,
- "Updating metadata for #{missing_names.size} gems from #{source_uri}")
- missing_names.each do |spec_name|
- gemspec = fetch_single_spec(source_uri, spec_name)
- if gemspec.nil? then
- ui.say "Failed to download spec #{spec_name} from #{source_uri}:\n" \
- "\t#{@fetch_error.message}"
- else
- add_spec gemspec
- progress.updated spec_name
- end
- @fetch_error = nil
- end
- progress.done
- progress.count
- end
-
-end
-
-# :stopdoc:
-module Gem
-
- ##
- # Cache is an alias for SourceIndex to allow older YAMLized source index
- # objects to load properly.
-
- Cache = SourceIndex
-
-end
-# :startdoc:
-
diff --git a/lib/rubygems/source_info_cache.rb b/lib/rubygems/source_info_cache.rb
deleted file mode 100644
index fdb30ad8d3..0000000000
--- a/lib/rubygems/source_info_cache.rb
+++ /dev/null
@@ -1,393 +0,0 @@
-require 'fileutils'
-
-require 'rubygems'
-require 'rubygems/source_info_cache_entry'
-require 'rubygems/user_interaction'
-
-##
-# SourceInfoCache stores a copy of the gem index for each gem source.
-#
-# There are two possible cache locations, the system cache and the user cache:
-# * The system cache is preferred if it is writable or can be created.
-# * The user cache is used otherwise
-#
-# Once a cache is selected, it will be used for all operations.
-# SourceInfoCache will not switch between cache files dynamically.
-#
-# Cache data is a Hash mapping a source URI to a SourceInfoCacheEntry.
-#
-#--
-# To keep things straight, this is how the cache objects all fit together:
-#
-# Gem::SourceInfoCache
-# @cache_data = {
-# source_uri => Gem::SourceInfoCacheEntry
-# @size = source index size
-# @source_index = Gem::SourceIndex
-# ...
-# }
-
-class Gem::SourceInfoCache
-
- include Gem::UserInteraction
-
- ##
- # The singleton Gem::SourceInfoCache. If +all+ is true, a full refresh will
- # be performed if the singleton instance is being initialized.
-
- def self.cache(all = false)
- return @cache if @cache
- @cache = new
- @cache.refresh all if Gem.configuration.update_sources
- @cache
- end
-
- def self.cache_data
- cache.cache_data
- end
-
- ##
- # The name of the system cache file.
-
- def self.latest_system_cache_file
- File.join File.dirname(system_cache_file),
- "latest_#{File.basename system_cache_file}"
- end
-
- ##
- # The name of the latest user cache file.
-
- def self.latest_user_cache_file
- File.join File.dirname(user_cache_file),
- "latest_#{File.basename user_cache_file}"
- end
-
- ##
- # Reset all singletons, discarding any changes.
-
- def self.reset
- @cache = nil
- @system_cache_file = nil
- @user_cache_file = nil
- end
-
- ##
- # Search all source indexes. See Gem::SourceInfoCache#search.
-
- def self.search(*args)
- cache.search(*args)
- end
-
- ##
- # Search all source indexes returning the source_uri. See
- # Gem::SourceInfoCache#search_with_source.
-
- def self.search_with_source(*args)
- cache.search_with_source(*args)
- end
-
- ##
- # The name of the system cache file. (class method)
-
- def self.system_cache_file
- @system_cache_file ||= Gem.default_system_source_cache_dir
- end
-
- ##
- # The name of the user cache file.
-
- def self.user_cache_file
- @user_cache_file ||=
- ENV['GEMCACHE'] || Gem.default_user_source_cache_dir
- end
-
- def initialize # :nodoc:
- @cache_data = nil
- @cache_file = nil
- @dirty = false
- @only_latest = true
- end
-
- ##
- # The most recent cache data.
-
- def cache_data
- return @cache_data if @cache_data
- cache_file # HACK writable check
-
- @only_latest = true
-
- @cache_data = read_cache_data latest_cache_file
-
- @cache_data
- end
-
- ##
- # The name of the cache file.
-
- def cache_file
- return @cache_file if @cache_file
- @cache_file = (try_file(system_cache_file) or
- try_file(user_cache_file) or
- raise "unable to locate a writable cache file")
- end
-
- ##
- # Write the cache to a local file (if it is dirty).
-
- def flush
- write_cache if @dirty
- @dirty = false
- end
-
- def latest_cache_data
- latest_cache_data = {}
-
- cache_data.each do |repo, sice|
- latest = sice.source_index.latest_specs
-
- new_si = Gem::SourceIndex.new
- new_si.add_specs(*latest)
-
- latest_sice = Gem::SourceInfoCacheEntry.new new_si, sice.size
- latest_cache_data[repo] = latest_sice
- end
-
- latest_cache_data
- end
-
- ##
- # The name of the latest cache file.
-
- def latest_cache_file
- File.join File.dirname(cache_file), "latest_#{File.basename cache_file}"
- end
-
- ##
- # The name of the latest system cache file.
-
- def latest_system_cache_file
- self.class.latest_system_cache_file
- end
-
- ##
- # The name of the latest user cache file.
-
- def latest_user_cache_file
- self.class.latest_user_cache_file
- end
-
- ##
- # Merges the complete cache file into this Gem::SourceInfoCache.
-
- def read_all_cache_data
- if @only_latest then
- @only_latest = false
- all_data = read_cache_data cache_file
-
- cache_data.update all_data do |source_uri, latest_sice, all_sice|
- all_sice.source_index.gems.update latest_sice.source_index.gems
-
- Gem::SourceInfoCacheEntry.new all_sice.source_index, latest_sice.size
- end
-
- begin
- refresh true
- rescue Gem::RemoteFetcher::FetchError
- end
- end
- end
-
- ##
- # Reads cached data from +file+.
-
- def read_cache_data(file)
- # Marshal loads 30-40% faster from a String, and 2MB on 20061116 is small
- data = open file, 'rb' do |fp| fp.read end
- cache_data = Marshal.load data
-
- cache_data.each do |url, sice|
- next unless sice.is_a?(Hash)
- update
-
- cache = sice['cache']
- size = sice['size']
-
- if cache.is_a?(Gem::SourceIndex) and size.is_a?(Numeric) then
- new_sice = Gem::SourceInfoCacheEntry.new cache, size
- cache_data[url] = new_sice
- else # irreperable, force refetch.
- reset_cache_for url, cache_data
- end
- end
-
- cache_data
- rescue Errno::ENOENT
- {}
- rescue => e
- if Gem.configuration.really_verbose then
- say "Exception during cache_data handling: #{e.class} - #{e}"
- say "Cache file was: #{file}"
- say "\t#{e.backtrace.join "\n\t"}"
- end
-
- {}
- end
-
- ##
- # Refreshes each source in the cache from its repository. If +all+ is
- # false, only latest gems are updated.
-
- def refresh(all)
- Gem.sources.each do |source_uri|
- cache_entry = cache_data[source_uri]
- if cache_entry.nil? then
- cache_entry = Gem::SourceInfoCacheEntry.new nil, 0
- cache_data[source_uri] = cache_entry
- end
-
- update if cache_entry.refresh source_uri, all
- end
-
- flush
- end
-
- def reset_cache_for(url, cache_data)
- say "Reseting cache for #{url}" if Gem.configuration.really_verbose
-
- sice = Gem::SourceInfoCacheEntry.new Gem::SourceIndex.new, 0
- sice.refresh url, false # HACK may be unnecessary, see ::cache and #refresh
-
- cache_data[url] = sice
- cache_data
- end
-
- def reset_cache_data
- @cache_data = nil
- @only_latest = true
- end
-
- ##
- # Force cache file to be reset, useful for integration testing of rubygems
-
- def reset_cache_file
- @cache_file = nil
- end
-
- ##
- # Searches all source indexes. See Gem::SourceIndex#search for details on
- # +pattern+ and +platform_only+. If +all+ is set to true, the full index
- # will be loaded before searching.
-
- def search(pattern, platform_only = false, all = false)
- read_all_cache_data if all
-
- cache_data.map do |source_uri, sic_entry|
- next unless Gem.sources.include? source_uri
- # TODO - Remove this gunk after 2008/11
- unless pattern.kind_of?(Gem::Dependency)
- pattern = Gem::Dependency.new(pattern, Gem::Requirement.default)
- end
- sic_entry.source_index.search pattern, platform_only
- end.flatten.compact
- end
-
- # Searches all source indexes for +pattern+. If +only_platform+ is true,
- # only gems matching Gem.platforms will be selected. Returns an Array of
- # pairs containing the Gem::Specification found and the source_uri it was
- # found at.
- def search_with_source(pattern, only_platform = false, all = false)
- read_all_cache_data if all
-
- results = []
-
- cache_data.map do |source_uri, sic_entry|
- next unless Gem.sources.include? source_uri
-
- # TODO - Remove this gunk after 2008/11
- unless pattern.kind_of?(Gem::Dependency)
- pattern = Gem::Dependency.new(pattern, Gem::Requirement.default)
- end
-
- sic_entry.source_index.search(pattern, only_platform).each do |spec|
- results << [spec, source_uri]
- end
- end
-
- results
- end
-
- ##
- # Set the source info cache data directly. This is mainly used for unit
- # testing when we don't want to read a file system to grab the cached source
- # index information. The +hash+ should map a source URL into a
- # SourceInfoCacheEntry.
-
- def set_cache_data(hash)
- @cache_data = hash
- update
- end
-
- ##
- # The name of the system cache file.
-
- def system_cache_file
- self.class.system_cache_file
- end
-
- ##
- # Determine if +path+ is a candidate for a cache file. Returns +path+ if
- # it is, nil if not.
-
- def try_file(path)
- return path if File.writable? path
- return nil if File.exist? path
-
- dir = File.dirname path
-
- unless File.exist? dir then
- begin
- FileUtils.mkdir_p dir
- rescue RuntimeError, SystemCallError
- return nil
- end
- end
-
- return path if File.writable? dir
-
- nil
- end
-
- ##
- # Mark the cache as updated (i.e. dirty).
-
- def update
- @dirty = true
- end
-
- ##
- # The name of the user cache file.
-
- def user_cache_file
- self.class.user_cache_file
- end
-
- ##
- # Write data to the proper cache files.
-
- def write_cache
- if not File.exist?(cache_file) or not @only_latest then
- open cache_file, 'wb' do |io|
- io.write Marshal.dump(cache_data)
- end
- end
-
- open latest_cache_file, 'wb' do |io|
- io.write Marshal.dump(latest_cache_data)
- end
- end
-
- reset
-
-end
-
diff --git a/lib/rubygems/source_info_cache_entry.rb b/lib/rubygems/source_info_cache_entry.rb
deleted file mode 100644
index d8106b2806..0000000000
--- a/lib/rubygems/source_info_cache_entry.rb
+++ /dev/null
@@ -1,56 +0,0 @@
-require 'rubygems'
-require 'rubygems/source_index'
-require 'rubygems/remote_fetcher'
-
-##
-# Entries held by a SourceInfoCache.
-
-class Gem::SourceInfoCacheEntry
-
- ##
- # The source index for this cache entry.
-
- attr_reader :source_index
-
- ##
- # The size of the source entry. Used to determine if the source index has
- # changed.
-
- attr_reader :size
-
- ##
- # Create a cache entry.
-
- def initialize(si, size)
- @source_index = si || Gem::SourceIndex.new({})
- @size = size
- @all = false
- end
-
- def refresh(source_uri, all)
- begin
- marshal_uri = URI.join source_uri.to_s, "Marshal.#{Gem.marshal_version}"
- remote_size = Gem::RemoteFetcher.fetcher.fetch_size marshal_uri
- rescue Gem::RemoteSourceException
- yaml_uri = URI.join source_uri.to_s, 'yaml'
- remote_size = Gem::RemoteFetcher.fetcher.fetch_size yaml_uri
- end
-
- # TODO Use index_signature instead of size?
- return false if @size == remote_size and @all
-
- updated = @source_index.update source_uri, all
- @size = remote_size
- @all = all
-
- updated
- end
-
- def ==(other) # :nodoc:
- self.class === other and
- @size == other.size and
- @source_index == other.source_index
- end
-
-end
-
diff --git a/lib/rubygems/spec_fetcher.rb b/lib/rubygems/spec_fetcher.rb
deleted file mode 100644
index f46c355413..0000000000
--- a/lib/rubygems/spec_fetcher.rb
+++ /dev/null
@@ -1,271 +0,0 @@
-require 'zlib'
-require 'fileutils'
-
-require 'rubygems/remote_fetcher'
-require 'rubygems/user_interaction'
-
-##
-# SpecFetcher handles metadata updates from remote gem repositories.
-
-class Gem::SpecFetcher
-
- include Gem::UserInteraction
-
- ##
- # The SpecFetcher cache dir.
-
- attr_reader :dir # :nodoc:
-
- ##
- # Cache of latest specs
-
- attr_reader :latest_specs # :nodoc:
-
- ##
- # Cache of all spces
-
- attr_reader :specs # :nodoc:
-
- ##
- # Cache of prerelease specs
-
- attr_reader :prerelease_specs # :nodoc:
-
- @fetcher = nil
-
- def self.fetcher
- @fetcher ||= new
- end
-
- def self.fetcher=(fetcher) # :nodoc:
- @fetcher = fetcher
- end
-
- def initialize
- @dir = File.join Gem.user_home, '.gem', 'specs'
- @update_cache = File.stat(Gem.user_home).uid == Process.uid
-
- @specs = {}
- @latest_specs = {}
- @prerelease_specs = {}
-
- @fetcher = Gem::RemoteFetcher.fetcher
- end
-
- ##
- # Retuns the local directory to write +uri+ to.
-
- def cache_dir(uri)
- File.join @dir, "#{uri.host}%#{uri.port}", File.dirname(uri.path)
- end
-
- ##
- # Fetch specs matching +dependency+. If +all+ is true, all matching
- # versions are returned. If +matching_platform+ is false, all platforms are
- # returned. If +prerelease+ is true, prerelease versions are included.
-
- def fetch(dependency, all = false, matching_platform = true, prerelease = false)
- specs_and_sources = find_matching dependency, all, matching_platform, prerelease
-
- specs_and_sources.map do |spec_tuple, source_uri|
- [fetch_spec(spec_tuple, URI.parse(source_uri)), source_uri]
- end
-
- rescue Gem::RemoteFetcher::FetchError => e
- raise unless warn_legacy e do
- require 'rubygems/source_info_cache'
-
- return Gem::SourceInfoCache.search_with_source(dependency,
- matching_platform, all)
- end
- end
-
- def fetch_spec(spec, source_uri)
- spec = spec - [nil, 'ruby', '']
- spec_file_name = "#{spec.join '-'}.gemspec"
-
- uri = source_uri + "#{Gem::MARSHAL_SPEC_DIR}#{spec_file_name}"
-
- cache_dir = cache_dir uri
-
- local_spec = File.join cache_dir, spec_file_name
-
- if File.exist? local_spec then
- spec = Gem.read_binary local_spec
- else
- uri.path << '.rz'
-
- spec = @fetcher.fetch_path uri
- spec = Gem.inflate spec
-
- if @update_cache then
- FileUtils.mkdir_p cache_dir
-
- open local_spec, 'wb' do |io|
- io.write spec
- end
- end
- end
-
- # TODO: Investigate setting Gem::Specification#loaded_from to a URI
- Marshal.load spec
- end
-
- ##
- # Find spec names that match +dependency+. If +all+ is true, all matching
- # versions are returned. If +matching_platform+ is false, gems for all
- # platforms are returned.
-
- def find_matching(dependency, all = false, matching_platform = true, prerelease = false)
- found = {}
-
- list(all, prerelease).each do |source_uri, specs|
- found[source_uri] = specs.select do |spec_name, version, spec_platform|
- dependency =~ Gem::Dependency.new(spec_name, version) and
- (not matching_platform or Gem::Platform.match(spec_platform))
- end
- end
-
- specs_and_sources = []
-
- found.each do |source_uri, specs|
- uri_str = source_uri.to_s
- specs_and_sources.push(*specs.map { |spec| [spec, uri_str] })
- end
-
- specs_and_sources
- end
-
- ##
- # Returns Array of gem repositories that were generated with RubyGems less
- # than 1.2.
-
- def legacy_repos
- Gem.sources.reject do |source_uri|
- source_uri = URI.parse source_uri
- spec_path = source_uri + "specs.#{Gem.marshal_version}.gz"
-
- begin
- @fetcher.fetch_size spec_path
- rescue Gem::RemoteFetcher::FetchError
- begin
- @fetcher.fetch_size(source_uri + 'yaml') # re-raise if non-repo
- rescue Gem::RemoteFetcher::FetchError
- alert_error "#{source_uri} does not appear to be a repository"
- raise
- end
- false
- end
- end
- end
-
- ##
- # Returns a list of gems available for each source in Gem::sources. If
- # +all+ is true, all versions are returned instead of only latest
- # versions. If +prerelease+ is true, include prerelease versions.
-
- def list(all = false, prerelease = false)
- # TODO: make type the only argument
- type = if all
- :all
- elsif prerelease
- :prerelease
- else
- :latest
- end
-
- list = {}
-
- file = { :latest => 'latest_specs',
- :prerelease => 'prerelease_specs',
- :all => 'specs' }[type]
-
- cache = { :latest => @latest_specs,
- :prerelease => @prerelease_specs,
- :all => @specs }[type]
-
- Gem.sources.each do |source_uri|
- source_uri = URI.parse source_uri
-
- unless cache.include? source_uri
- cache[source_uri] = load_specs source_uri, file
- end
-
- list[source_uri] = cache[source_uri]
- end
-
- list
- end
-
- ##
- # Loads specs in +file+, fetching from +source_uri+ if the on-disk cache is
- # out of date.
-
- def load_specs(source_uri, file)
- file_name = "#{file}.#{Gem.marshal_version}"
- spec_path = source_uri + "#{file_name}.gz"
- cache_dir = cache_dir spec_path
- local_file = File.join(cache_dir, file_name)
- loaded = false
-
- if File.exist? local_file then
- spec_dump = @fetcher.fetch_path spec_path, File.mtime(local_file)
-
- if spec_dump.nil? then
- spec_dump = Gem.read_binary local_file
- else
- loaded = true
- end
- else
- spec_dump = @fetcher.fetch_path spec_path
- loaded = true
- end
-
- specs = begin
- Marshal.load spec_dump
- rescue ArgumentError
- spec_dump = @fetcher.fetch_path spec_path
- loaded = true
-
- Marshal.load spec_dump
- end
-
- if loaded and @update_cache then
- begin
- FileUtils.mkdir_p cache_dir
-
- open local_file, 'wb' do |io|
- Marshal.dump specs, io
- end
- rescue
- end
- end
-
- specs
- end
-
- ##
- # Warn about legacy repositories if +exception+ indicates only legacy
- # repositories are available, and yield to the block. Returns false if the
- # exception indicates some other FetchError.
-
- def warn_legacy(exception)
- uri = exception.uri.to_s
- if uri =~ /specs\.#{Regexp.escape Gem.marshal_version}\.gz$/ then
- alert_warning <<-EOF
-RubyGems 1.2+ index not found for:
-\t#{legacy_repos.join "\n\t"}
-
-RubyGems will revert to legacy indexes degrading performance.
- EOF
-
- yield
-
- return true
- end
-
- false
- end
-
-end
-
diff --git a/lib/rubygems/specification.rb b/lib/rubygems/specification.rb
deleted file mode 100644
index 3630b4adf5..0000000000
--- a/lib/rubygems/specification.rb
+++ /dev/null
@@ -1,1444 +0,0 @@
-#--
-# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
-# All rights reserved.
-# See LICENSE.txt for permissions.
-#++
-
-require 'rubygems/version'
-require 'rubygems/requirement'
-require 'rubygems/platform'
-
-# :stopdoc:
-class Date; end # for ruby_code if date.rb wasn't required
-# :startdoc:
-
-##
-# The Specification class contains the metadata for a Gem. Typically
-# defined in a .gemspec file or a Rakefile, and looks like this:
-#
-# spec = Gem::Specification.new do |s|
-# s.name = 'rfoo'
-# s.version = '1.0'
-# s.summary = 'Example gem specification'
-# ...
-# end
-#
-# For a great way to package gems, use Hoe.
-
-class Gem::Specification
-
- ##
- # Allows deinstallation of gems with legacy platforms.
-
- attr_accessor :original_platform # :nodoc:
-
- ##
- # The the version number of a specification that does not specify one
- # (i.e. RubyGems 0.7 or earlier).
-
- NONEXISTENT_SPECIFICATION_VERSION = -1
-
- ##
- # The specification version applied to any new Specification instances
- # created. This should be bumped whenever something in the spec format
- # changes.
- #--
- # When updating this number, be sure to also update #to_ruby.
- #
- # NOTE RubyGems < 1.2 cannot load specification versions > 2.
-
- CURRENT_SPECIFICATION_VERSION = 3
-
- ##
- # An informal list of changes to the specification. The highest-valued
- # key should be equal to the CURRENT_SPECIFICATION_VERSION.
-
- SPECIFICATION_VERSION_HISTORY = {
- -1 => ['(RubyGems versions up to and including 0.7 did not have versioned specifications)'],
- 1 => [
- 'Deprecated "test_suite_file" in favor of the new, but equivalent, "test_files"',
- '"test_file=x" is a shortcut for "test_files=[x]"'
- ],
- 2 => [
- 'Added "required_rubygems_version"',
- 'Now forward-compatible with future versions',
- ],
- 3 => [
- 'Added Fixnum validation to the specification_version'
- ]
- }
-
- # :stopdoc:
- MARSHAL_FIELDS = { -1 => 16, 1 => 16, 2 => 16, 3 => 17 }
-
- now = Time.at(Time.now.to_i)
- TODAY = now - ((now.to_i + now.gmt_offset) % 86400)
- # :startdoc:
-
- ##
- # Optional block used to gather newly defined instances.
-
- @@gather = nil
-
- ##
- # List of attribute names: [:name, :version, ...]
-
- @@required_attributes = []
-
- ##
- # List of _all_ attributes and default values:
- #
- # [[:name, nil],
- # [:bindir, 'bin'],
- # ...]
-
- @@attributes = []
-
- @@nil_attributes = []
- @@non_nil_attributes = [:@original_platform]
-
- ##
- # List of array attributes
-
- @@array_attributes = []
-
- ##
- # Map of attribute names to default values.
-
- @@default_value = {}
-
- ##
- # Names of all specification attributes
-
- def self.attribute_names
- @@attributes.map { |name, default| name }
- end
-
- ##
- # Default values for specification attributes
-
- def self.attribute_defaults
- @@attributes.dup
- end
-
- ##
- # The default value for specification attribute +name+
-
- def self.default_value(name)
- @@default_value[name]
- end
-
- ##
- # Required specification attributes
-
- def self.required_attributes
- @@required_attributes.dup
- end
-
- ##
- # Is +name+ a required attribute?
-
- def self.required_attribute?(name)
- @@required_attributes.include? name.to_sym
- end
-
- ##
- # Specification attributes that are arrays (appendable and so-forth)
-
- def self.array_attributes
- @@array_attributes.dup
- end
-
- ##
- # Specifies the +name+ and +default+ for a specification attribute, and
- # creates a reader and writer method like Module#attr_accessor.
- #
- # The reader method returns the default if the value hasn't been set.
-
- def self.attribute(name, default=nil)
- ivar_name = "@#{name}".intern
- if default.nil? then
- @@nil_attributes << ivar_name
- else
- @@non_nil_attributes << [ivar_name, default]
- end
-
- @@attributes << [name, default]
- @@default_value[name] = default
- attr_accessor(name)
- end
-
- ##
- # Same as :attribute, but ensures that values assigned to the attribute
- # are array values by applying :to_a to the value.
-
- def self.array_attribute(name)
- @@non_nil_attributes << ["@#{name}".intern, []]
-
- @@array_attributes << name
- @@attributes << [name, []]
- @@default_value[name] = []
- code = %{
- def #{name}
- @#{name} ||= []
- end
- def #{name}=(value)
- @#{name} = Array(value)
- end
- }
-
- module_eval code, __FILE__, __LINE__ - 9
- end
-
- ##
- # Same as attribute above, but also records this attribute as mandatory.
-
- def self.required_attribute(*args)
- @@required_attributes << args.first
- attribute(*args)
- end
-
- ##
- # Sometimes we don't want the world to use a setter method for a
- # particular attribute.
- #
- # +read_only+ makes it private so we can still use it internally.
-
- def self.read_only(*names)
- names.each do |name|
- private "#{name}="
- end
- end
-
- # Shortcut for creating several attributes at once (each with a default
- # value of +nil+).
-
- def self.attributes(*args)
- args.each do |arg|
- attribute(arg, nil)
- end
- end
-
- ##
- # Some attributes require special behaviour when they are accessed. This
- # allows for that.
-
- def self.overwrite_accessor(name, &block)
- remove_method name
- define_method(name, &block)
- end
-
- ##
- # Defines a _singular_ version of an existing _plural_ attribute (i.e. one
- # whose value is expected to be an array). This means just creating a
- # helper method that takes a single value and appends it to the array.
- # These are created for convenience, so that in a spec, one can write
- #
- # s.require_path = 'mylib'
- #
- # instead of:
- #
- # s.require_paths = ['mylib']
- #
- # That above convenience is available courtesy of:
- #
- # attribute_alias_singular :require_path, :require_paths
-
- def self.attribute_alias_singular(singular, plural)
- define_method("#{singular}=") { |val|
- send("#{plural}=", [val])
- }
- define_method("#{singular}") {
- val = send("#{plural}")
- val.nil? ? nil : val.first
- }
- end
-
- ##
- # Dump only crucial instance variables.
- #--
- # MAINTAIN ORDER!
-
- def _dump(limit)
- Marshal.dump [
- @rubygems_version,
- @specification_version,
- @name,
- @version,
- (Time === @date ? @date : (require 'time'; Time.parse(@date.to_s))),
- @summary,
- @required_ruby_version,
- @required_rubygems_version,
- @original_platform,
- @dependencies,
- @rubyforge_project,
- @email,
- @authors,
- @description,
- @homepage,
- @has_rdoc,
- @new_platform,
- @licenses
- ]
- end
-
- ##
- # Load custom marshal format, re-initializing defaults as needed
-
- def self._load(str)
- array = Marshal.load str
-
- spec = Gem::Specification.new
- spec.instance_variable_set :@specification_version, array[1]
-
- current_version = CURRENT_SPECIFICATION_VERSION
-
- field_count = if spec.specification_version > current_version then
- spec.instance_variable_set :@specification_version,
- current_version
- MARSHAL_FIELDS[current_version]
- else
- MARSHAL_FIELDS[spec.specification_version]
- end
-
- if array.size < field_count then
- raise TypeError, "invalid Gem::Specification format #{array.inspect}"
- end
-
- spec.instance_variable_set :@rubygems_version, array[0]
- # spec version
- spec.instance_variable_set :@name, array[2]
- spec.instance_variable_set :@version, array[3]
- spec.instance_variable_set :@date, array[4]
- spec.instance_variable_set :@summary, array[5]
- spec.instance_variable_set :@required_ruby_version, array[6]
- spec.instance_variable_set :@required_rubygems_version, array[7]
- spec.instance_variable_set :@original_platform, array[8]
- spec.instance_variable_set :@dependencies, array[9]
- spec.instance_variable_set :@rubyforge_project, array[10]
- spec.instance_variable_set :@email, array[11]
- spec.instance_variable_set :@authors, array[12]
- spec.instance_variable_set :@description, array[13]
- spec.instance_variable_set :@homepage, array[14]
- spec.instance_variable_set :@has_rdoc, array[15]
- spec.instance_variable_set :@new_platform, array[16]
- spec.instance_variable_set :@platform, array[16].to_s
- spec.instance_variable_set :@license, array[17]
- spec.instance_variable_set :@loaded, false
-
- spec
- end
-
- ##
- # List of depedencies that will automatically be activated at runtime.
-
- def runtime_dependencies
- dependencies.select { |d| d.type == :runtime || d.type == nil }
- end
-
- ##
- # List of dependencies that are used for development
-
- def development_dependencies
- dependencies.select { |d| d.type == :development }
- end
-
- def test_suite_file # :nodoc:
- warn 'test_suite_file deprecated, use test_files'
- test_files.first
- end
-
- def test_suite_file=(val) # :nodoc:
- warn 'test_suite_file= deprecated, use test_files='
- @test_files = [] unless defined? @test_files
- @test_files << val
- end
-
- ##
- # true when this gemspec has been loaded from a specifications directory.
- # This attribute is not persisted.
-
- attr_accessor :loaded
-
- ##
- # Path this gemspec was loaded from. This attribute is not persisted.
-
- attr_accessor :loaded_from
-
- ##
- # Returns an array with bindir attached to each executable in the
- # executables list
-
- def add_bindir(executables)
- return nil if executables.nil?
-
- if @bindir then
- Array(executables).map { |e| File.join(@bindir, e) }
- else
- executables
- end
- rescue
- return nil
- end
-
- ##
- # Files in the Gem under one of the require_paths
-
- def lib_files
- @files.select do |file|
- require_paths.any? do |path|
- file.index(path) == 0
- end
- end
- end
-
- ##
- # True if this gem was loaded from disk
-
- alias :loaded? :loaded
-
- ##
- # True if this gem has files in test_files
-
- def has_unit_tests?
- not test_files.empty?
- end
-
- # :stopdoc:
- alias has_test_suite? has_unit_tests?
- # :startdoc:
-
- ##
- # Specification constructor. Assigns the default values to the attributes
- # and yields itself for further initialization.
-
- def initialize
- @new_platform = nil
- assign_defaults
- @loaded = false
- @loaded_from = nil
-
- yield self if block_given?
-
- @@gather.call(self) if @@gather
- end
-
- ##
- # Duplicates array_attributes from +other_spec+ so state isn't shared.
-
- def initialize_copy(other_spec)
- other_ivars = other_spec.instance_variables
- other_ivars = other_ivars.map { |ivar| ivar.intern } if # for 1.9
- other_ivars.any? { |ivar| String === ivar }
-
- self.class.array_attributes.each do |name|
- name = :"@#{name}"
- next unless other_ivars.include? name
- instance_variable_set name, other_spec.instance_variable_get(name).dup
- end
- end
-
- ##
- # Each attribute has a default value (possibly nil). Here, we initialize
- # all attributes to their default value. This is done through the
- # accessor methods, so special behaviours will be honored. Furthermore,
- # we take a _copy_ of the default so each specification instance has its
- # own empty arrays, etc.
-
- def assign_defaults
- @@nil_attributes.each do |name|
- instance_variable_set name, nil
- end
-
- @@non_nil_attributes.each do |name, default|
- value = case default
- when Time, Numeric, Symbol, true, false, nil then default
- else default.dup
- end
-
- instance_variable_set name, value
- end
-
- # HACK
- instance_variable_set :@new_platform, Gem::Platform::RUBY
- end
-
- ##
- # Special loader for YAML files. When a Specification object is loaded
- # from a YAML file, it bypasses the normal Ruby object initialization
- # routine (#initialize). This method makes up for that and deals with
- # gems of different ages.
- #
- # 'input' can be anything that YAML.load() accepts: String or IO.
-
- def self.from_yaml(input)
- input = normalize_yaml_input input
- spec = YAML.load input
-
- if spec && spec.class == FalseClass then
- raise Gem::EndOfYAMLException
- end
-
- unless Gem::Specification === spec then
- raise Gem::Exception, "YAML data doesn't evaluate to gem specification"
- end
-
- unless (spec.instance_variables.include? '@specification_version' or
- spec.instance_variables.include? :@specification_version) and
- spec.instance_variable_get :@specification_version
- spec.instance_variable_set :@specification_version,
- NONEXISTENT_SPECIFICATION_VERSION
- end
-
- spec
- end
-
- ##
- # Loads ruby format gemspec from +filename+
-
- def self.load(filename)
- gemspec = nil
- fail "NESTED Specification.load calls not allowed!" if @@gather
- @@gather = proc { |gs| gemspec = gs }
- data = File.read(filename)
- eval(data)
- gemspec
- ensure
- @@gather = nil
- end
-
- ##
- # Make sure the YAML specification is properly formatted with dashes
-
- def self.normalize_yaml_input(input)
- result = input.respond_to?(:read) ? input.read : input
- result = "--- " + result unless result =~ /^--- /
- result
- end
-
- ##
- # Sets the rubygems_version to the current RubyGems version
-
- def mark_version
- @rubygems_version = Gem::RubyGemsVersion
- end
-
- ##
- # Ignore unknown attributes while loading
-
- def method_missing(sym, *a, &b) # :nodoc:
- if @specification_version > CURRENT_SPECIFICATION_VERSION and
- sym.to_s =~ /=$/ then
- warn "ignoring #{sym} loading #{full_name}" if $DEBUG
- else
- super
- end
- end
-
- ##
- # Adds a development dependency named +gem+ with +requirements+ to this
- # Gem. For example:
- #
- # spec.add_development_dependency 'jabber4r', '> 0.1', '<= 0.5'
- #
- # Development dependencies aren't installed by default and aren't
- # activated when a gem is required.
-
- def add_development_dependency(gem, *requirements)
- add_dependency_with_type(gem, :development, *requirements)
- end
-
- ##
- # Adds a runtime dependency named +gem+ with +requirements+ to this Gem.
- # For example:
- #
- # spec.add_runtime_dependency 'jabber4r', '> 0.1', '<= 0.5'
-
- def add_runtime_dependency(gem, *requirements)
- add_dependency_with_type(gem, :runtime, *requirements)
- end
-
- ##
- # Adds a runtime dependency
-
- alias add_dependency add_runtime_dependency
-
- ##
- # Returns the full name (name-version) of this Gem. Platform information
- # is included (name-version-platform) if it is specified and not the
- # default Ruby platform.
-
- def full_name
- if platform == Gem::Platform::RUBY or platform.nil? then
- "#{@name}-#{@version}"
- else
- "#{@name}-#{@version}-#{platform}"
- end
- end
-
- ##
- # Returns the full name (name-version) of this gemspec using the original
- # platform. For use with legacy gems.
-
- def original_name # :nodoc:
- if platform == Gem::Platform::RUBY or platform.nil? then
- "#{@name}-#{@version}"
- else
- "#{@name}-#{@version}-#{@original_platform}"
- end
- end
-
- ##
- # The full path to the gem (install path + full name).
-
- def full_gem_path
- path = File.join installation_path, 'gems', full_name
- return path if File.directory? path
- File.join installation_path, 'gems', original_name
- end
-
- ##
- # The default (generated) file name of the gem.
-
- def file_name
- full_name + ".gem"
- end
-
- ##
- # The directory that this gem was installed into.
-
- def installation_path
- unless @loaded_from then
- raise Gem::Exception, "spec #{full_name} is not from an installed gem"
- end
-
- File.expand_path File.dirname(File.dirname(@loaded_from))
- end
-
- ##
- # Checks if this specification meets the requirement of +dependency+.
-
- def satisfies_requirement?(dependency)
- return @name == dependency.name &&
- dependency.version_requirements.satisfied_by?(@version)
- end
-
- ##
- # Returns an object you can use to sort specifications in #sort_by.
-
- def sort_obj
- [@name, @version, @new_platform == Gem::Platform::RUBY ? -1 : 1]
- end
-
- def <=>(other) # :nodoc:
- sort_obj <=> other.sort_obj
- end
-
- ##
- # Tests specs for equality (across all attributes).
-
- def ==(other) # :nodoc:
- self.class === other && same_attributes?(other)
- end
-
- alias eql? == # :nodoc:
-
- ##
- # True if this gem has the same attributes as +other+.
-
- def same_attributes?(other)
- @@attributes.each do |name, default|
- return false unless self.send(name) == other.send(name)
- end
- true
- end
-
- private :same_attributes?
-
- def hash # :nodoc:
- @@attributes.inject(0) { |hash_code, (name, default_value)|
- n = self.send(name).hash
- hash_code + n
- }
- end
-
- def to_yaml(opts = {}) # :nodoc:
- mark_version
-
- attributes = @@attributes.map { |name,| name.to_s }.sort
- attributes = attributes - %w[name version platform]
-
- yaml = YAML.quick_emit object_id, opts do |out|
- out.map taguri, to_yaml_style do |map|
- map.add 'name', @name
- map.add 'version', @version
- platform = case @original_platform
- when nil, '' then
- 'ruby'
- when String then
- @original_platform
- else
- @original_platform.to_s
- end
- map.add 'platform', platform
-
- attributes.each do |name|
- map.add name, instance_variable_get("@#{name}")
- end
- end
- end
- end
-
- def yaml_initialize(tag, vals) # :nodoc:
- vals.each do |ivar, val|
- instance_variable_set "@#{ivar}", val
- end
-
- @original_platform = @platform # for backwards compatibility
- self.platform = Gem::Platform.new @platform
- end
-
- ##
- # Returns a Ruby code representation of this specification, such that it
- # can be eval'ed and reconstruct the same specification later. Attributes
- # that still have their default values are omitted.
-
- def to_ruby
- mark_version
- result = []
- result << "# -*- encoding: utf-8 -*-"
- result << nil
- result << "Gem::Specification.new do |s|"
-
- result << " s.name = #{ruby_code name}"
- result << " s.version = #{ruby_code version}"
- unless platform.nil? or platform == Gem::Platform::RUBY then
- result << " s.platform = #{ruby_code original_platform}"
- end
- result << ""
- result << " s.required_rubygems_version = #{ruby_code required_rubygems_version} if s.respond_to? :required_rubygems_version="
-
- handled = [
- :dependencies,
- :name,
- :platform,
- :required_rubygems_version,
- :specification_version,
- :version,
- ]
-
- attributes = @@attributes.sort_by { |attr_name,| attr_name.to_s }
-
- attributes.each do |attr_name, default|
- next if handled.include? attr_name
- current_value = self.send(attr_name)
- if current_value != default or
- self.class.required_attribute? attr_name then
- result << " s.#{attr_name} = #{ruby_code current_value}"
- end
- end
-
- result << nil
- result << " if s.respond_to? :specification_version then"
- result << " current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION"
- result << " s.specification_version = #{specification_version}"
- result << nil
-
- result << " if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then"
-
- unless dependencies.empty? then
- dependencies.each do |dep|
- version_reqs_param = dep.requirements_list.inspect
- dep.instance_variable_set :@type, :runtime if dep.type.nil? # HACK
- result << " s.add_#{dep.type}_dependency(%q<#{dep.name}>, #{version_reqs_param})"
- end
- end
-
- result << " else"
-
- unless dependencies.empty? then
- dependencies.each do |dep|
- version_reqs_param = dep.requirements_list.inspect
- result << " s.add_dependency(%q<#{dep.name}>, #{version_reqs_param})"
- end
- end
-
- result << ' end'
-
- result << " else"
- dependencies.each do |dep|
- version_reqs_param = dep.requirements_list.inspect
- result << " s.add_dependency(%q<#{dep.name}>, #{version_reqs_param})"
- end
- result << " end"
-
- result << "end"
- result << nil
-
- result.join "\n"
- end
-
- ##
- # Checks that the specification contains all required fields, and does a
- # very basic sanity check.
- #
- # Raises InvalidSpecificationException if the spec does not pass the
- # checks..
-
- def validate
- extend Gem::UserInteraction
- normalize
-
- if rubygems_version != Gem::RubyGemsVersion then
- raise Gem::InvalidSpecificationException,
- "expected RubyGems version #{Gem::RubyGemsVersion}, was #{rubygems_version}"
- end
-
- @@required_attributes.each do |symbol|
- unless self.send symbol then
- raise Gem::InvalidSpecificationException,
- "missing value for attribute #{symbol}"
- end
- end
-
- unless String === name then
- raise Gem::InvalidSpecificationException,
- "invalid value for attribute name: \"#{name.inspect}\""
- end
-
- if require_paths.empty? then
- raise Gem::InvalidSpecificationException,
- 'specification must have at least one require_path'
- end
-
- @files.delete_if do |file| File.directory? file end
- @test_files.delete_if do |file| File.directory? file end
- @executables.delete_if do |file|
- File.directory? File.join(bindir, file)
- end
- @extra_rdoc_files.delete_if do |file| File.directory? file end
- @extensions.delete_if do |file| File.directory? file end
-
- non_files = files.select do |file|
- !File.file? file
- end
-
- unless non_files.empty? then
- non_files = non_files.map { |file| file.inspect }
- raise Gem::InvalidSpecificationException,
- "[#{non_files.join ", "}] are not files"
- end
-
- unless specification_version.is_a?(Fixnum)
- raise Gem::InvalidSpecificationException,
- 'specification_version must be a Fixnum (did you mean version?)'
- end
-
- case platform
- when Gem::Platform, Gem::Platform::RUBY then # ok
- else
- raise Gem::InvalidSpecificationException,
- "invalid platform #{platform.inspect}, see Gem::Platform"
- end
-
- unless Array === authors and
- authors.all? { |author| String === author } then
- raise Gem::InvalidSpecificationException,
- 'authors must be Array of Strings'
- end
-
- licenses.each { |license|
- if license.length > 64
- raise Gem::InvalidSpecificationException,
- "each license must be 64 characters or less"
- end
- }
-
- # reject FIXME and TODO
-
- unless authors.grep(/FIXME|TODO/).empty? then
- raise Gem::InvalidSpecificationException,
- '"FIXME" or "TODO" is not an author'
- end
-
- unless Array(email).grep(/FIXME|TODO/).empty? then
- raise Gem::InvalidSpecificationException,
- '"FIXME" or "TODO" is not an email address'
- end
-
- if description =~ /FIXME|TODO/ then
- raise Gem::InvalidSpecificationException,
- '"FIXME" or "TODO" is not a description'
- end
-
- if summary =~ /FIXME|TODO/ then
- raise Gem::InvalidSpecificationException,
- '"FIXME" or "TODO" is not a summary'
- end
-
- if homepage and not homepage.empty? and
- homepage !~ /\A[a-z][a-z\d+.-]*:/i then
- raise Gem::InvalidSpecificationException,
- "\"#{homepage}\" is not a URI"
- end
-
- # Warnings
-
- %w[author description email homepage rubyforge_project summary].each do |attribute|
- value = self.send attribute
- alert_warning "no #{attribute} specified" if value.nil? or value.empty?
- end
-
- if summary and not summary.empty? and description == summary then
- alert_warning 'description and summary are identical'
- end
-
- alert_warning "deprecated autorequire specified" if autorequire
-
- executables.each do |executable|
- executable_path = File.join bindir, executable
- shebang = File.read(executable_path, 2) == '#!'
-
- alert_warning "#{executable_path} is missing #! line" unless shebang
- end
-
- true
- end
-
- ##
- # Normalize the list of files so that:
- # * All file lists have redundancies removed.
- # * Files referenced in the extra_rdoc_files are included in the package
- # file list.
-
- def normalize
- if defined?(@extra_rdoc_files) and @extra_rdoc_files then
- @extra_rdoc_files.uniq!
- @files ||= []
- @files.concat(@extra_rdoc_files)
- end
- @files.uniq! if @files
- end
-
- ##
- # Return a list of all gems that have a dependency on this gemspec. The
- # list is structured with entries that conform to:
- #
- # [depending_gem, dependency, [list_of_gems_that_satisfy_dependency]]
-
- def dependent_gems
- out = []
- Gem.source_index.each do |name,gem|
- gem.dependencies.each do |dep|
- if self.satisfies_requirement?(dep) then
- sats = []
- find_all_satisfiers(dep) do |sat|
- sats << sat
- end
- out << [gem, dep, sats]
- end
- end
- end
- out
- end
-
- def to_s # :nodoc:
- "#<Gem::Specification name=#{@name} version=#{@version}>"
- end
-
- def pretty_print(q) # :nodoc:
- q.group 2, 'Gem::Specification.new do |s|', 'end' do
- q.breakable
-
- attributes = @@attributes.sort_by { |attr_name,| attr_name.to_s }
-
- attributes.each do |attr_name, default|
- current_value = self.send attr_name
- if current_value != default or
- self.class.required_attribute? attr_name then
-
- q.text "s.#{attr_name} = "
-
- if attr_name == :date then
- current_value = current_value.utc
-
- q.text "Time.utc(#{current_value.year}, #{current_value.month}, #{current_value.day})"
- else
- q.pp current_value
- end
-
- q.breakable
- end
- end
- end
- end
-
- ##
- # Adds a dependency on gem +dependency+ with type +type+ that requires
- # +requirements+. Valid types are currently <tt>:runtime</tt> and
- # <tt>:development</tt>.
-
- def add_dependency_with_type(dependency, type, *requirements)
- requirements = if requirements.empty? then
- Gem::Requirement.default
- else
- requirements.flatten
- end
-
- unless dependency.respond_to?(:name) &&
- dependency.respond_to?(:version_requirements)
-
- dependency = Gem::Dependency.new(dependency, requirements, type)
- end
-
- dependencies << dependency
- end
-
- private :add_dependency_with_type
-
- ##
- # Finds all gems that satisfy +dep+
-
- def find_all_satisfiers(dep)
- Gem.source_index.each do |_, gem|
- yield gem if gem.satisfies_requirement? dep
- end
- end
-
- private :find_all_satisfiers
-
- ##
- # Return a string containing a Ruby code representation of the given
- # object.
-
- def ruby_code(obj)
- case obj
- when String then '%q{' + obj + '}'
- when Array then obj.inspect
- when Gem::Version then obj.to_s.inspect
- when Date then '%q{' + obj.strftime('%Y-%m-%d') + '}'
- when Time then '%q{' + obj.strftime('%Y-%m-%d') + '}'
- when Numeric then obj.inspect
- when true, false, nil then obj.inspect
- when Gem::Platform then "Gem::Platform.new(#{obj.to_a.inspect})"
- when Gem::Requirement then "Gem::Requirement.new(#{obj.to_s.inspect})"
- else raise Gem::Exception, "ruby_code case not handled: #{obj.class}"
- end
- end
-
- private :ruby_code
-
- # :section: Required gemspec attributes
-
- ##
- # :attr_accessor: rubygems_version
- #
- # The version of RubyGems used to create this gem
-
- required_attribute :rubygems_version, Gem::RubyGemsVersion
-
- ##
- # :attr_accessor: specification_version
- #
- # The Gem::Specification version of this gemspec
-
- required_attribute :specification_version, CURRENT_SPECIFICATION_VERSION
-
- ##
- # :attr_accessor: name
- #
- # This gem's name
-
- required_attribute :name
-
- ##
- # :attr_accessor: version
- #
- # This gem's version
-
- required_attribute :version
-
- ##
- # :attr_accessor: date
- #
- # The date this gem was created
-
- required_attribute :date, TODAY
-
- ##
- # :attr_accessor: summary
- #
- # A short summary of this gem's description. Displayed in `gem list -d`.
-
- required_attribute :summary
-
- ##
- # :attr_accessor: require_paths
- #
- # Paths in the gem to add to $LOAD_PATH when this gem is activated
-
- required_attribute :require_paths, ['lib']
-
- # :section: Optional gemspec attributes
-
- ##
- # :attr_accessor: email
- #
- # A contact email for this gem
-
- attribute :email
-
- ##
- # :attr_accessor: homepage
- #
- # The URL of this gem's home page
-
- attribute :homepage
-
- ##
- # :attr_accessor: rubyforge_project
- #
- # The rubyforge project this gem lives under. i.e. RubyGems'
- # rubyforge_project is "rubygems".
-
- attribute :rubyforge_project
-
- ##
- # :attr_accessor: description
- #
- # A long description of this gem
-
- attribute :description
-
- ##
- # :attr_accessor: autorequire
- #
- # Autorequire was used by old RubyGems to automatically require a file.
- # It no longer is supported.
-
- attribute :autorequire
-
- ##
- # :attr_accessor: default_executable
- #
- # The default executable for this gem.
-
- attribute :default_executable
-
- ##
- # :attr_accessor: bindir
- #
- # The path in the gem for executable scripts
-
- attribute :bindir, 'bin'
-
- ##
- # :attr_accessor: has_rdoc
- #
- # Deprecated and ignored, defaults to true.
- #
- # Formerly used to indicate this gem was RDoc-capable.
-
- attribute :has_rdoc, true
-
- ##
- # True if this gem supports RDoc
-
- alias :has_rdoc? :has_rdoc
-
- ##
- # :attr_accessor: required_ruby_version
- #
- # The ruby of version required by this gem
-
- attribute :required_ruby_version, Gem::Requirement.default
-
- ##
- # :attr_accessor: required_rubygems_version
- #
- # The RubyGems version required by this gem
-
- attribute :required_rubygems_version, Gem::Requirement.default
-
- ##
- # :attr_accessor: platform
- #
- # The platform this gem runs on. See Gem::Platform for details.
-
- attribute :platform, Gem::Platform::RUBY
-
- ##
- # :attr_accessor: signing_key
- #
- # The key used to sign this gem. See Gem::Security for details.
-
- attribute :signing_key, nil
-
- ##
- # :attr_accessor: cert_chain
- #
- # The certificate chain used to sign this gem. See Gem::Security for
- # details.
-
- attribute :cert_chain, []
-
- ##
- # :attr_accessor: post_install_message
- #
- # A message that gets displayed after the gem is installed
-
- attribute :post_install_message, nil
-
- ##
- # :attr_accessor: authors
- #
- # The list of authors who wrote this gem
-
- array_attribute :authors
-
- ##
- # :attr_accessor: licenses
- #
- # The license(s) for the library. Each license must be a short name, no
- # more than 64 characters.
-
- array_attribute :licenses
-
- ##
- # :attr_accessor: files
- #
- # Files included in this gem. You cannot append to this accessor, you must
- # assign to it.
- #
- # Only add files you can require to this list, not directories, etc.
- #
- # Directories are automatically stripped from this list when building a gem,
- # other non-files cause an error.
-
- array_attribute :files
-
- ##
- # :attr_accessor: test_files
- #
- # Test files included in this gem. You cannot append to this accessor, you
- # must assign to it.
-
- array_attribute :test_files
-
- ##
- # :attr_accessor: rdoc_options
- #
- # An ARGV-style array of options to RDoc
-
- array_attribute :rdoc_options
-
- ##
- # :attr_accessor: extra_rdoc_files
- #
- # Extra files to add to RDoc
-
- array_attribute :extra_rdoc_files
-
- ##
- # :attr_accessor: executables
- #
- # Executables included in the gem
-
- array_attribute :executables
-
- ##
- # :attr_accessor: extensions
- #
- # Extensions to build when installing the gem. See
- # Gem::Installer#build_extensions for valid values.
-
- array_attribute :extensions
-
- ##
- # :attr_accessor: requirements
- #
- # An array or things required by this gem. Not used by anything
- # presently.
-
- array_attribute :requirements
-
- ##
- # :attr_reader: dependencies
- #
- # A list of Gem::Dependency objects this gem depends on.
-
- array_attribute :dependencies
-
- read_only :dependencies
-
- # :section: Aliased gemspec attributes
-
- ##
- # Singular accessor for #executables
-
- attribute_alias_singular :executable, :executables
-
- ##
- # Singular accessor for #authors
-
- attribute_alias_singular :author, :authors
-
- ##
- # Singular accessor for #licenses
-
- attribute_alias_singular :license, :licenses
-
- ##
- # Singular accessor for #require_paths
-
- attribute_alias_singular :require_path, :require_paths
-
- ##
- # Singular accessor for #test_files
-
- attribute_alias_singular :test_file, :test_files
-
- ##
- # has_rdoc is now ignored
-
- overwrite_accessor :has_rdoc do
- true
- end
-
- ##
- # has_rdoc is now ignored
-
- overwrite_accessor :has_rdoc= do |value|
- @has_rdoc = true
- end
-
- overwrite_accessor :version= do |version|
- @version = Gem::Version.create(version)
- self.required_rubygems_version = '> 1.3.1' if @version.prerelease?
- return @version
- end
-
- overwrite_accessor :platform do
- @new_platform
- end
-
- overwrite_accessor :platform= do |platform|
- if @original_platform.nil? or
- @original_platform == Gem::Platform::RUBY then
- @original_platform = platform
- end
-
- case platform
- when Gem::Platform::CURRENT then
- @new_platform = Gem::Platform.local
- @original_platform = @new_platform.to_s
-
- when Gem::Platform then
- @new_platform = platform
-
- # legacy constants
- when nil, Gem::Platform::RUBY then
- @new_platform = Gem::Platform::RUBY
- when 'mswin32' then # was Gem::Platform::WIN32
- @new_platform = Gem::Platform.new 'x86-mswin32'
- when 'i586-linux' then # was Gem::Platform::LINUX_586
- @new_platform = Gem::Platform.new 'x86-linux'
- when 'powerpc-darwin' then # was Gem::Platform::DARWIN
- @new_platform = Gem::Platform.new 'ppc-darwin'
- else
- @new_platform = Gem::Platform.new platform
- end
-
- @platform = @new_platform.to_s
-
- @new_platform
- end
-
- overwrite_accessor :required_ruby_version= do |value|
- @required_ruby_version = Gem::Requirement.create(value)
- end
-
- overwrite_accessor :required_rubygems_version= do |value|
- @required_rubygems_version = Gem::Requirement.create(value)
- end
-
- overwrite_accessor :date= do |date|
- # We want to end up with a Time object with one-day resolution.
- # This is the cleanest, most-readable, faster-than-using-Date
- # way to do it.
- case date
- when String then
- @date = if /\A(\d{4})-(\d{2})-(\d{2})\Z/ =~ date then
- Time.local($1.to_i, $2.to_i, $3.to_i)
- else
- require 'time'
- Time.parse date
- end
- when Time then
- @date = Time.local(date.year, date.month, date.day)
- when Date then
- @date = Time.local(date.year, date.month, date.day)
- else
- @date = TODAY
- end
- end
-
- overwrite_accessor :date do
- self.date = nil if @date.nil? # HACK Sets the default value for date
- @date
- end
-
- overwrite_accessor :summary= do |str|
- @summary = if str then
- str.strip.
- gsub(/(\w-)\n[ \t]*(\w)/, '\1\2').
- gsub(/\n[ \t]*/, " ")
- end
- end
-
- overwrite_accessor :description= do |str|
- @description = str.to_s
- end
-
- overwrite_accessor :default_executable do
- begin
- if defined?(@default_executable) and @default_executable
- result = @default_executable
- elsif @executables and @executables.size == 1
- result = Array(@executables).first
- else
- result = nil
- end
- result
- rescue
- nil
- end
- end
-
- overwrite_accessor :test_files do
- # Handle the possibility that we have @test_suite_file but not
- # @test_files. This will happen when an old gem is loaded via
- # YAML.
- if defined? @test_suite_file then
- @test_files = [@test_suite_file].flatten
- @test_suite_file = nil
- end
- if defined?(@test_files) and @test_files then
- @test_files
- else
- @test_files = []
- end
- end
-
- overwrite_accessor :files do
- result = []
- result.push(*@files) if defined?(@files)
- result.push(*@test_files) if defined?(@test_files)
- result.push(*(add_bindir(@executables)))
- result.push(*@extra_rdoc_files) if defined?(@extra_rdoc_files)
- result.push(*@extensions) if defined?(@extensions)
- result.uniq.compact
- end
-
-end
-
diff --git a/lib/rubygems/test_utilities.rb b/lib/rubygems/test_utilities.rb
deleted file mode 100644
index 8b23d3236e..0000000000
--- a/lib/rubygems/test_utilities.rb
+++ /dev/null
@@ -1,131 +0,0 @@
-require 'tempfile'
-require 'rubygems'
-require 'rubygems/remote_fetcher'
-
-##
-# A fake Gem::RemoteFetcher for use in tests or to avoid real live HTTP
-# requests when testing code that uses RubyGems.
-#
-# Example:
-#
-# @fetcher = Gem::FakeFetcher.new
-# @fetcher.data['http://gems.example.com/yaml'] = source_index.to_yaml
-# Gem::RemoteFetcher.fetcher = @fetcher
-#
-# # invoke RubyGems code
-#
-# paths = @fetcher.paths
-# assert_equal 'http://gems.example.com/yaml', paths.shift
-# assert paths.empty?, paths.join(', ')
-#
-# See RubyGems' tests for more examples of FakeFetcher.
-
-class Gem::FakeFetcher
-
- attr_reader :data
- attr_accessor :paths
-
- def initialize
- @data = {}
- @paths = []
- end
-
- def fetch_path path, mtime = nil
- path = path.to_s
- @paths << path
- raise ArgumentError, 'need full URI' unless path =~ %r'^http://'
-
- unless @data.key? path then
- raise Gem::RemoteFetcher::FetchError.new("no data for #{path}", path)
- end
-
- data = @data[path]
-
- if data.respond_to?(:call) then
- data.call
- else
- if path.to_s =~ /gz$/ and not data.nil? and not data.empty? then
- data = Gem.gunzip data
- end
-
- data
- end
- end
-
- def fetch_size(path)
- path = path.to_s
- @paths << path
-
- raise ArgumentError, 'need full URI' unless path =~ %r'^http://'
-
- unless @data.key? path then
- raise Gem::RemoteFetcher::FetchError.new("no data for #{path}", path)
- end
-
- data = @data[path]
-
- data.respond_to?(:call) ? data.call : data.length
- end
-
- def download spec, source_uri, install_dir = Gem.dir
- name = "#{spec.full_name}.gem"
- path = File.join(install_dir, 'cache', name)
-
- Gem.ensure_gem_subdirectories install_dir
-
- if source_uri =~ /^http/ then
- File.open(path, "wb") do |f|
- f.write fetch_path(File.join(source_uri, "gems", name))
- end
- else
- FileUtils.cp source_uri, path
- end
-
- path
- end
-
-end
-
-# :stopdoc:
-class Gem::RemoteFetcher
-
- def self.fetcher=(fetcher)
- @fetcher = fetcher
- end
-
-end
-# :startdoc:
-
-##
-# A StringIO duck-typed class that uses Tempfile instead of String as the
-# backing store.
-#--
-# This class was added to flush out problems in Rubinius' IO implementation.
-
-class TempIO
-
- @@count = 0
-
- def initialize(string = '')
- @tempfile = Tempfile.new "TempIO-#{@@count += 1}"
- @tempfile.binmode
- @tempfile.write string
- @tempfile.rewind
- end
-
- def method_missing(meth, *args, &block)
- @tempfile.send(meth, *args, &block)
- end
-
- def respond_to?(meth)
- @tempfile.respond_to? meth
- end
-
- def string
- @tempfile.flush
-
- Gem.read_binary @tempfile.path
- end
-
-end
-
diff --git a/lib/rubygems/text.rb b/lib/rubygems/text.rb
deleted file mode 100644
index c694e8a9c0..0000000000
--- a/lib/rubygems/text.rb
+++ /dev/null
@@ -1,30 +0,0 @@
-require 'rubygems'
-
-##
-# A collection of text-wrangling methods
-
-module Gem::Text
-
- ##
- # Wraps +text+ to +wrap+ characters and optionally indents by +indent+
- # characters
-
- def format_text(text, wrap, indent=0)
- result = []
- work = text.dup
-
- while work.length > wrap do
- if work =~ /^(.{0,#{wrap}})[ \n]/ then
- result << $1
- work.slice!(0, $&.length)
- else
- result << work.slice!(0, wrap)
- end
- end
-
- result << work if work.length.nonzero?
- result.join("\n").gsub(/^/, " " * indent)
- end
-
-end
-
diff --git a/lib/rubygems/timer.rb b/lib/rubygems/timer.rb
deleted file mode 100644
index 028e640230..0000000000
--- a/lib/rubygems/timer.rb
+++ /dev/null
@@ -1,28 +0,0 @@
-#
-# This file defines a $log variable for logging, and a time() method for
-# recording timing information.
-#
-#--
-# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
-# All rights reserved.
-# See LICENSE.txt for permissions.
-#++
-
-require 'rubygems'
-
-file, lineno = Gem.location_of_caller
-
-warn "#{file}:#{lineno}:Warning: RubyGems' lib/rubygems/timer.rb deprecated and will be removed on or after June 2009."
-
-$log = Object.new
-
-# :stopdoc:
-def $log.debug(message)
- Gem.debug message
-end
-
-def time(msg, width=25, &block)
- Gem.time(msg, width, &block)
-end
-# :startdoc:
-
diff --git a/lib/rubygems/uninstaller.rb b/lib/rubygems/uninstaller.rb
deleted file mode 100644
index 4bb777a2a2..0000000000
--- a/lib/rubygems/uninstaller.rb
+++ /dev/null
@@ -1,262 +0,0 @@
-#--
-# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
-# All rights reserved.
-# See LICENSE.txt for permissions.
-#++
-
-require 'fileutils'
-require 'rubygems'
-require 'rubygems/dependency_list'
-require 'rubygems/doc_manager'
-require 'rubygems/user_interaction'
-
-##
-# An Uninstaller.
-#
-# The uninstaller fires pre and post uninstall hooks. Hooks can be added
-# either through a rubygems_plugin.rb file in an installed gem or via a
-# rubygems/defaults/#{RUBY_ENGINE}.rb or rubygems/defaults/operating_system.rb
-# file. See Gem.pre_uninstall and Gem.post_uninstall for details.
-
-class Gem::Uninstaller
-
- include Gem::UserInteraction
-
- ##
- # The directory a gem's executables will be installed into
-
- attr_reader :bin_dir
-
- ##
- # The gem repository the gem will be installed into
-
- attr_reader :gem_home
-
- ##
- # The Gem::Specification for the gem being uninstalled, only set during
- # #uninstall_gem
-
- attr_reader :spec
-
- ##
- # Constructs an uninstaller that will uninstall +gem+
-
- def initialize(gem, options = {})
- @gem = gem
- @version = options[:version] || Gem::Requirement.default
- gem_home = options[:install_dir] || Gem.dir
- @gem_home = File.expand_path gem_home
- @force_executables = options[:executables]
- @force_all = options[:all]
- @force_ignore = options[:ignore]
- @bin_dir = options[:bin_dir]
-
- # only add user directory if install_dir is not set
- @user_install = false
- @user_install = options[:user_install] unless options[:install_dir]
-
- spec_dir = File.join @gem_home, 'specifications'
- @source_index = Gem::SourceIndex.from_gems_in spec_dir
-
- if @user_install then
- user_dir = File.join Gem.user_dir, 'specifications'
- @user_index = Gem::SourceIndex.from_gems_in user_dir
- end
- end
-
- ##
- # Performs the uninstall of the gem. This removes the spec, the Gem
- # directory, and the cached .gem file.
-
- def uninstall
- list = @source_index.find_name @gem, @version
- list += @user_index.find_name @gem, @version if @user_install
-
- if list.empty? then
- raise Gem::InstallError, "cannot uninstall, check `gem list -d #{@gem}`"
-
- elsif list.size > 1 and @force_all then
- remove_all list.dup
-
- elsif list.size > 1 then
- gem_names = list.collect {|gem| gem.full_name} + ["All versions"]
-
- say
- gem_name, index = choose_from_list "Select gem to uninstall:", gem_names
-
- if index == list.size then
- remove_all list.dup
- elsif index >= 0 && index < list.size then
- uninstall_gem list[index], list.dup
- else
- say "Error: must enter a number [1-#{list.size+1}]"
- end
- else
- uninstall_gem list.first, list.dup
- end
- end
-
- ##
- # Uninstalls gem +spec+
-
- def uninstall_gem(spec, specs)
- @spec = spec
-
- Gem.pre_uninstall_hooks.each do |hook|
- hook.call self
- end
-
- remove_executables @spec
- remove @spec, specs
-
- Gem.post_uninstall_hooks.each do |hook|
- hook.call self
- end
-
- @spec = nil
- end
-
- ##
- # Removes installed executables and batch files (windows only) for
- # +gemspec+.
-
- def remove_executables(spec)
- return if spec.nil?
-
- unless spec.executables.empty? then
- bindir = @bin_dir ? @bin_dir : Gem.bindir(spec.installation_path)
-
- list = @source_index.find_name(spec.name).delete_if { |s|
- s.version == spec.version
- }
-
- executables = spec.executables.clone
-
- list.each do |s|
- s.executables.each do |exe_name|
- executables.delete exe_name
- end
- end
-
- return if executables.empty?
-
- answer = if @force_executables.nil? then
- ask_yes_no("Remove executables:\n" \
- "\t#{spec.executables.join(", ")}\n\nin addition to the gem?",
- true) # " # appease ruby-mode - don't ask
- else
- @force_executables
- end
-
- unless answer then
- say "Executables and scripts will remain installed."
- else
- raise Gem::FilePermissionError, bindir unless File.writable? bindir
-
- spec.executables.each do |exe_name|
- say "Removing #{exe_name}"
- FileUtils.rm_f File.join(bindir, exe_name)
- FileUtils.rm_f File.join(bindir, "#{exe_name}.bat")
- end
- end
- end
- end
-
- ##
- # Removes all gems in +list+.
- #
- # NOTE: removes uninstalled gems from +list+.
-
- def remove_all(list)
- list.dup.each { |spec| uninstall_gem spec, list }
- end
-
- ##
- # spec:: the spec of the gem to be uninstalled
- # list:: the list of all such gems
- #
- # Warning: this method modifies the +list+ parameter. Once it has
- # uninstalled a gem, it is removed from that list.
-
- def remove(spec, list)
- unless dependencies_ok? spec then
- raise Gem::DependencyRemovalException,
- "Uninstallation aborted due to dependent gem(s)"
- end
-
- unless path_ok?(@gem_home, spec) or
- (@user_install and path_ok?(Gem.user_dir, spec)) then
- e = Gem::GemNotInHomeException.new \
- "Gem is not installed in directory #{@gem_home}"
- e.spec = spec
-
- raise e
- end
-
- raise Gem::FilePermissionError, spec.installation_path unless
- File.writable?(spec.installation_path)
-
- FileUtils.rm_rf spec.full_gem_path
-
- original_platform_name = [
- spec.name, spec.version, spec.original_platform].join '-'
-
- spec_dir = File.join spec.installation_path, 'specifications'
- gemspec = File.join spec_dir, "#{spec.full_name}.gemspec"
-
- unless File.exist? gemspec then
- gemspec = File.join spec_dir, "#{original_platform_name}.gemspec"
- end
-
- FileUtils.rm_rf gemspec
-
- cache_dir = File.join spec.installation_path, 'cache'
- gem = File.join cache_dir, "#{spec.full_name}.gem"
-
- unless File.exist? gem then
- gem = File.join cache_dir, "#{original_platform_name}.gem"
- end
-
- FileUtils.rm_rf gem
-
- Gem::DocManager.new(spec).uninstall_doc
-
- say "Successfully uninstalled #{spec.full_name}"
-
- list.delete spec
- end
-
- ##
- # Is +spec+ in +gem_dir+?
-
- def path_ok?(gem_dir, spec)
- full_path = File.join gem_dir, 'gems', spec.full_name
- original_path = File.join gem_dir, 'gems', spec.original_name
-
- full_path == spec.full_gem_path || original_path == spec.full_gem_path
- end
-
- def dependencies_ok?(spec)
- return true if @force_ignore
-
- deplist = Gem::DependencyList.from_source_index @source_index
- deplist.add(*@user_index.gems.values) if @user_install
- deplist.ok_to_remove?(spec.full_name) || ask_if_ok(spec)
- end
-
- def ask_if_ok(spec)
- msg = ['']
- msg << 'You have requested to uninstall the gem:'
- msg << "\t#{spec.full_name}"
- spec.dependent_gems.each do |gem,dep,satlist|
- msg <<
- ("#{gem.name}-#{gem.version} depends on " +
- "[#{dep.name} (#{dep.version_requirements})]")
- end
- msg << 'If you remove this gems, one or more dependencies will not be met.'
- msg << 'Continue with Uninstall?'
- return ask_yes_no(msg.join("\n"), true)
- end
-
-end
-
diff --git a/lib/rubygems/user_interaction.rb b/lib/rubygems/user_interaction.rb
deleted file mode 100644
index 6a80c7c0bc..0000000000
--- a/lib/rubygems/user_interaction.rb
+++ /dev/null
@@ -1,390 +0,0 @@
-#--
-# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
-# All rights reserved.
-# See LICENSE.txt for permissions.
-#++
-
-##
-# Module that defines the default UserInteraction. Any class including this
-# module will have access to the +ui+ method that returns the default UI.
-
-module Gem::DefaultUserInteraction
-
- ##
- # The default UI is a class variable of the singleton class for this
- # module.
-
- @ui = nil
-
- ##
- # Return the default UI.
-
- def self.ui
- @ui ||= Gem::ConsoleUI.new
- end
-
- ##
- # Set the default UI. If the default UI is never explicitly set, a simple
- # console based UserInteraction will be used automatically.
-
- def self.ui=(new_ui)
- @ui = new_ui
- end
-
- ##
- # Use +new_ui+ for the duration of +block+.
-
- def self.use_ui(new_ui)
- old_ui = @ui
- @ui = new_ui
- yield
- ensure
- @ui = old_ui
- end
-
- ##
- # See DefaultUserInteraction::ui
-
- def ui
- Gem::DefaultUserInteraction.ui
- end
-
- ##
- # See DefaultUserInteraction::ui=
-
- def ui=(new_ui)
- Gem::DefaultUserInteraction.ui = new_ui
- end
-
- ##
- # See DefaultUserInteraction::use_ui
-
- def use_ui(new_ui, &block)
- Gem::DefaultUserInteraction.use_ui(new_ui, &block)
- end
-
-end
-
-##
-# Make the default UI accessable without the "ui." prefix. Classes
-# including this module may use the interaction methods on the default UI
-# directly. Classes may also reference the ui and ui= methods.
-#
-# Example:
-#
-# class X
-# include Gem::UserInteraction
-#
-# def get_answer
-# n = ask("What is the meaning of life?")
-# end
-# end
-
-module Gem::UserInteraction
-
- include Gem::DefaultUserInteraction
-
- ##
- # :method: alert
-
- ##
- # :method: alert_error
-
- ##
- # :method: alert_warning
-
- ##
- # :method: ask
-
- ##
- # :method: ask_yes_no
-
- ##
- # :method: choose_from_list
-
- ##
- # :method: say
-
- ##
- # :method: terminate_interaction
-
- [:alert,
- :alert_error,
- :alert_warning,
- :ask,
- :ask_yes_no,
- :choose_from_list,
- :say,
- :terminate_interaction ].each do |methname|
- class_eval %{
- def #{methname}(*args)
- ui.#{methname}(*args)
- end
- }, __FILE__, __LINE__
- end
-end
-
-##
-# Gem::StreamUI implements a simple stream based user interface.
-
-class Gem::StreamUI
-
- attr_reader :ins, :outs, :errs
-
- def initialize(in_stream, out_stream, err_stream=STDERR)
- @ins = in_stream
- @outs = out_stream
- @errs = err_stream
- end
-
- ##
- # Choose from a list of options. +question+ is a prompt displayed above
- # the list. +list+ is a list of option strings. Returns the pair
- # [option_name, option_index].
-
- def choose_from_list(question, list)
- @outs.puts question
-
- list.each_with_index do |item, index|
- @outs.puts " #{index+1}. #{item}"
- end
-
- @outs.print "> "
- @outs.flush
-
- result = @ins.gets
-
- return nil, nil unless result
-
- result = result.strip.to_i - 1
- return list[result], result
- end
-
- ##
- # Ask a question. Returns a true for yes, false for no. If not connected
- # to a tty, raises an exception if default is nil, otherwise returns
- # default.
-
- def ask_yes_no(question, default=nil)
- unless @ins.tty? then
- if default.nil? then
- raise Gem::OperationNotSupportedError,
- "Not connected to a tty and no default specified"
- else
- return default
- end
- end
-
- qstr = case default
- when nil
- 'yn'
- when true
- 'Yn'
- else
- 'yN'
- end
-
- result = nil
-
- while result.nil?
- result = ask("#{question} [#{qstr}]")
- result = case result
- when /^[Yy].*/
- true
- when /^[Nn].*/
- false
- when /^$/
- default
- else
- nil
- end
- end
-
- return result
- end
-
- ##
- # Ask a question. Returns an answer if connected to a tty, nil otherwise.
-
- def ask(question)
- return nil if not @ins.tty?
-
- @outs.print(question + " ")
- @outs.flush
-
- result = @ins.gets
- result.chomp! if result
- result
- end
-
- ##
- # Display a statement.
-
- def say(statement="")
- @outs.puts statement
- end
-
- ##
- # Display an informational alert. Will ask +question+ if it is not nil.
-
- def alert(statement, question=nil)
- @outs.puts "INFO: #{statement}"
- ask(question) if question
- end
-
- ##
- # Display a warning in a location expected to get error messages. Will
- # ask +question+ if it is not nil.
-
- def alert_warning(statement, question=nil)
- @errs.puts "WARNING: #{statement}"
- ask(question) if question
- end
-
- ##
- # Display an error message in a location expected to get error messages.
- # Will ask +question+ if it is not nil.
-
- def alert_error(statement, question=nil)
- @errs.puts "ERROR: #{statement}"
- ask(question) if question
- end
-
- ##
- # Display a debug message on the same location as error messages.
-
- def debug(statement)
- @errs.puts statement
- end
-
- ##
- # Terminate the application with exit code +status+, running any exit
- # handlers that might have been defined.
-
- def terminate_interaction(status = 0)
- raise Gem::SystemExitException, status
- end
-
- ##
- # Return a progress reporter object chosen from the current verbosity.
-
- def progress_reporter(*args)
- case Gem.configuration.verbose
- when nil, false
- SilentProgressReporter.new(@outs, *args)
- when true
- SimpleProgressReporter.new(@outs, *args)
- else
- VerboseProgressReporter.new(@outs, *args)
- end
- end
-
- ##
- # An absolutely silent progress reporter.
-
- class SilentProgressReporter
- attr_reader :count
-
- def initialize(out_stream, size, initial_message, terminal_message = nil)
- end
-
- def updated(message)
- end
-
- def done
- end
- end
-
- ##
- # A basic dotted progress reporter.
-
- class SimpleProgressReporter
-
- include Gem::DefaultUserInteraction
-
- attr_reader :count
-
- def initialize(out_stream, size, initial_message,
- terminal_message = "complete")
- @out = out_stream
- @total = size
- @count = 0
- @terminal_message = terminal_message
-
- @out.puts initial_message
- end
-
- ##
- # Prints out a dot and ignores +message+.
-
- def updated(message)
- @count += 1
- @out.print "."
- @out.flush
- end
-
- ##
- # Prints out the terminal message.
-
- def done
- @out.puts "\n#{@terminal_message}"
- end
-
- end
-
- ##
- # A progress reporter that prints out messages about the current progress.
-
- class VerboseProgressReporter
-
- include Gem::DefaultUserInteraction
-
- attr_reader :count
-
- def initialize(out_stream, size, initial_message,
- terminal_message = 'complete')
- @out = out_stream
- @total = size
- @count = 0
- @terminal_message = terminal_message
-
- @out.puts initial_message
- end
-
- ##
- # Prints out the position relative to the total and the +message+.
-
- def updated(message)
- @count += 1
- @out.puts "#{@count}/#{@total}: #{message}"
- end
-
- ##
- # Prints out the terminal message.
-
- def done
- @out.puts @terminal_message
- end
- end
-
-end
-
-##
-# Subclass of StreamUI that instantiates the user interaction using STDIN,
-# STDOUT, and STDERR.
-
-class Gem::ConsoleUI < Gem::StreamUI
- def initialize
- super STDIN, STDOUT, STDERR
- end
-end
-
-##
-# SilentUI is a UI choice that is absolutely silent.
-
-class Gem::SilentUI
- def method_missing(sym, *args, &block)
- self
- end
-end
-
diff --git a/lib/rubygems/validator.rb b/lib/rubygems/validator.rb
deleted file mode 100644
index 9bccc605b5..0000000000
--- a/lib/rubygems/validator.rb
+++ /dev/null
@@ -1,242 +0,0 @@
-#--
-# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
-# All rights reserved.
-# See LICENSE.txt for permissions.
-#++
-
-require 'find'
-
-require 'digest'
-require 'rubygems/format'
-require 'rubygems/installer'
-
-# Load test-unit 2.x if it's a gem
-begin
- Gem.activate('test-unit')
-rescue Gem::LoadError
- # Ignore - use the test-unit library that's part of the standard library
-end
-
-##
-# Validator performs various gem file and gem database validation
-
-class Gem::Validator
-
- include Gem::UserInteraction
-
- ##
- # Given a gem file's contents, validates against its own MD5 checksum
- # gem_data:: [String] Contents of the gem file
-
- def verify_gem(gem_data)
- raise Gem::VerificationError, 'empty gem file' if gem_data.size == 0
-
- unless gem_data =~ /MD5SUM/ then
- return # Don't worry about it...this sucks. Need to fix MD5 stuff for
- # new format
- # FIXME
- end
-
- sum_data = gem_data.gsub(/MD5SUM = "([a-z0-9]+)"/,
- "MD5SUM = \"#{"F" * 32}\"")
-
- unless Digest::MD5.hexdigest(sum_data) == $1.to_s then
- raise Gem::VerificationError, 'invalid checksum for gem file'
- end
- end
-
- ##
- # Given the path to a gem file, validates against its own MD5 checksum
- #
- # gem_path:: [String] Path to gem file
-
- def verify_gem_file(gem_path)
- open gem_path, Gem.binary_mode do |file|
- gem_data = file.read
- verify_gem gem_data
- end
- rescue Errno::ENOENT, Errno::EINVAL
- raise Gem::VerificationError, "missing gem file #{gem_path}"
- end
-
- private
-
- def find_files_for_gem(gem_directory)
- installed_files = []
- Find.find gem_directory do |file_name|
- fn = file_name[gem_directory.size..file_name.size-1].sub(/^\//, "")
- installed_files << fn unless
- fn =~ /CVS/ || fn.empty? || File.directory?(file_name)
- end
- installed_files
- end
-
- public
-
- ErrorData = Struct.new :path, :problem
-
- ##
- # Checks the gem directory for the following potential
- # inconsistencies/problems:
- #
- # * Checksum gem itself
- # * For each file in each gem, check consistency of installed versions
- # * Check for files that aren't part of the gem but are in the gems directory
- # * 1 cache - 1 spec - 1 directory.
- #
- # returns a hash of ErrorData objects, keyed on the problem gem's name.
-
- def alien(gems=[])
- errors = Hash.new { |h,k| h[k] = {} }
-
- Gem::SourceIndex.from_installed_gems.each do |gem_name, gem_spec|
- next unless gems.include? gem_spec.name unless gems.empty?
-
- install_dir = gem_spec.installation_path
- gem_path = File.join(install_dir, "cache", gem_spec.full_name) + ".gem"
- spec_path = File.join(install_dir, "specifications",
- gem_spec.full_name) + ".gemspec"
- gem_directory = gem_spec.full_gem_path
-
- unless File.directory? gem_directory then
- errors[gem_name][gem_spec.full_name] =
- "Gem registered but doesn't exist at #{gem_directory}"
- next
- end
-
- unless File.exist? spec_path then
- errors[gem_name][spec_path] = "Spec file missing for installed gem"
- end
-
- begin
- verify_gem_file(gem_path)
-
- good, gone, unreadable = nil, nil, nil, nil
-
- open gem_path, Gem.binary_mode do |file|
- format = Gem::Format.from_file_by_path(gem_path)
-
- good, gone = format.file_entries.partition { |entry, _|
- File.exist? File.join(gem_directory, entry['path'])
- }
-
- gone.map! { |entry, _| entry['path'] }
- gone.sort.each do |path|
- errors[gem_name][path] = "Missing file"
- end
-
- good, unreadable = good.partition { |entry, _|
- File.readable? File.join(gem_directory, entry['path'])
- }
-
- unreadable.map! { |entry, _| entry['path'] }
- unreadable.sort.each do |path|
- errors[gem_name][path] = "Unreadable file"
- end
-
- good.each do |entry, data|
- begin
- next unless data # HACK `gem check -a mkrf`
-
- open File.join(gem_directory, entry['path']), Gem.binary_mode do |f|
- unless Digest::MD5.hexdigest(f.read).to_s ==
- Digest::MD5.hexdigest(data).to_s then
- errors[gem_name][entry['path']] = "Modified from original"
- end
- end
- end
- end
- end
-
- installed_files = find_files_for_gem(gem_directory)
- good.map! { |entry, _| entry['path'] }
- extras = installed_files - good - unreadable
-
- extras.each do |extra|
- errors[gem_name][extra] = "Extra file"
- end
- rescue Gem::VerificationError => e
- errors[gem_name][gem_path] = e.message
- end
- end
-
- errors.each do |name, subhash|
- errors[name] = subhash.map { |path, msg| ErrorData.new(path, msg) }
- end
-
- errors
- end
-
- if RUBY_VERSION < '1.9' then
- class TestRunner
- def initialize(suite, ui)
- @suite = suite
- @ui = ui
- end
-
- def self.run(suite, ui)
- require 'test/unit/ui/testrunnermediator'
- return new(suite, ui).start
- end
-
- def start
- @mediator = Test::Unit::UI::TestRunnerMediator.new(@suite)
- @mediator.add_listener(Test::Unit::TestResult::FAULT, &method(:add_fault))
- return @mediator.run_suite
- end
-
- def add_fault(fault)
- if Gem.configuration.verbose then
- @ui.say fault.long_display
- end
- end
- end
-
- autoload :TestRunner, 'test/unit/ui/testrunnerutilities'
- end
-
- ##
- # Runs unit tests for a given gem specification
-
- def unit_test(gem_spec)
- start_dir = Dir.pwd
- Dir.chdir(gem_spec.full_gem_path)
- $: << gem_spec.full_gem_path
- # XXX: why do we need this gem_spec when we've already got 'spec'?
- test_files = gem_spec.test_files
-
- if test_files.empty? then
- say "There are no unit tests to run for #{gem_spec.full_name}"
- return nil
- end
-
- gem gem_spec.name, "= #{gem_spec.version.version}"
-
- test_files.each do |f| require f end
-
- if RUBY_VERSION < '1.9' then
- suite = Test::Unit::TestSuite.new("#{gem_spec.name}-#{gem_spec.version}")
-
- ObjectSpace.each_object(Class) do |klass|
- suite << klass.suite if (klass < Test::Unit::TestCase)
- end
-
- result = TestRunner.run suite, ui
-
- alert_error result.to_s unless result.passed?
- else
- result = MiniTest::Unit.new
- result.run
- end
-
- result
- ensure
- Dir.chdir(start_dir)
- end
-
- def remove_leading_dot_dir(path)
- path.sub(/^\.\//, "")
- end
-
-end
-
diff --git a/lib/rubygems/version.rb b/lib/rubygems/version.rb
deleted file mode 100644
index 7c49a34a73..0000000000
--- a/lib/rubygems/version.rb
+++ /dev/null
@@ -1,251 +0,0 @@
-#--
-# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
-# All rights reserved.
-# See LICENSE.txt for permissions.
-#++
-
-##
-# The Version class processes string versions into comparable
-# values. A version string should normally be a series of numbers
-# separated by periods. Each part (digits separated by periods) is
-# considered its own number, and these are used for sorting. So for
-# instance, 3.10 sorts higher than 3.2 because ten is greater than
-# two.
-#
-# If any part contains letters (currently only a-z are supported) then
-# that version is considered prerelease. Versions with a prerelease
-# part in the Nth part sort less than versions with N-1 parts. Prerelease
-# parts are sorted alphabetically using the normal Ruby string sorting
-# rules.
-#
-# Prereleases sort between real releases (newest to oldest):
-#
-# 1. 1.0
-# 2. 1.0.b
-# 3. 1.0.a
-# 4. 0.9
-
-class Gem::Version
-
- class Part
- include Comparable
-
- attr_reader :value
-
- def initialize(value)
- @value = (value =~ /\A\d+\z/) ? value.to_i : value
- end
-
- def to_s
- self.value.to_s
- end
-
- def inspect
- @value
- end
-
- def alpha?
- String === value
- end
-
- def numeric?
- Fixnum === value
- end
-
- def <=>(other)
- if self.numeric? && other.alpha? then
- 1
- elsif self.alpha? && other.numeric? then
- -1
- else
- self.value <=> other.value
- end
- end
-
- def succ
- self.class.new(self.value.succ)
- end
- end
-
- include Comparable
-
- VERSION_PATTERN = '[0-9]+(\.[0-9a-z]+)*'
-
- attr_reader :version
-
- def self.correct?(version)
- pattern = /\A\s*(#{VERSION_PATTERN})*\s*\z/
-
- version.is_a? Integer or
- version =~ pattern or
- version.to_s =~ pattern
- end
-
- ##
- # Factory method to create a Version object. Input may be a Version or a
- # String. Intended to simplify client code.
- #
- # ver1 = Version.create('1.3.17') # -> (Version object)
- # ver2 = Version.create(ver1) # -> (ver1)
- # ver3 = Version.create(nil) # -> nil
-
- def self.create(input)
- if input.respond_to? :version then
- input
- elsif input.nil? then
- nil
- else
- new input
- end
- end
-
- ##
- # Constructs a Version from the +version+ string. A version string is a
- # series of digits or ASCII letters separated by dots.
-
- def initialize(version)
- raise ArgumentError, "Malformed version number string #{version}" unless
- self.class.correct?(version)
-
- self.version = version
- end
-
- def inspect # :nodoc:
- "#<#{self.class} #{@version.inspect}>"
- end
-
- ##
- # Dump only the raw version string, not the complete object
-
- def marshal_dump
- [@version]
- end
-
- ##
- # Load custom marshal format
-
- def marshal_load(array)
- self.version = array[0]
- end
-
- def parts
- @parts ||= normalize
- end
-
- ##
- # Strip ignored trailing zeros.
-
- def normalize
- parts_arr = parse_parts_from_version_string
- if parts_arr.length != 1
- parts_arr.pop while parts_arr.last && parts_arr.last.value == 0
- parts_arr = [Part.new(0)] if parts_arr.empty?
- end
- parts_arr
- end
-
- ##
- # Returns the text representation of the version
-
- def to_s
- @version
- end
-
- def to_yaml_properties
- ['@version']
- end
-
- def version=(version)
- @version = version.to_s.strip
- normalize
- end
-
- ##
- # A version is considered a prerelease if any part contains a letter.
-
- def prerelease?
- parts.any? { |part| part.alpha? }
- end
-
- ##
- # The release for this version (e.g. 1.2.0.a -> 1.2.0)
- # Non-prerelease versions return themselves
- def release
- return self unless prerelease?
- rel_parts = parts.dup
- rel_parts.pop while rel_parts.any? { |part| part.alpha? }
- self.class.new(rel_parts.join('.'))
- end
-
- def yaml_initialize(tag, values)
- self.version = values['version']
- end
-
- ##
- # Compares this version with +other+ returning -1, 0, or 1 if the other
- # version is larger, the same, or smaller than this one.
-
- def <=>(other)
- return nil unless self.class === other
- return 1 unless other
- mine, theirs = balance(self.parts.dup, other.parts.dup)
- mine <=> theirs
- end
-
- def balance(a, b)
- a << Part.new(0) while a.size < b.size
- b << Part.new(0) while b.size < a.size
- [a, b]
- end
-
- ##
- # A Version is only eql? to another version if it has the same version
- # string. "1.0" is not the same version as "1".
-
- def eql?(other)
- self.class === other and @version == other.version
- end
-
- def hash # :nodoc:
- @version.hash
- end
-
- ##
- # Return a new version object where the next to the last revision number is
- # one greater. (e.g. 5.3.1 => 5.4)
- #
- # Pre-release (alpha) parts are ignored. (e.g 5.3.1.b2 => 5.4)
-
- def bump
- parts = parse_parts_from_version_string
- parts.pop while parts.any? { |part| part.alpha? }
- parts.pop if parts.size > 1
- parts[-1] = parts[-1].succ
- self.class.new(parts.join("."))
- end
-
- def parse_parts_from_version_string # :nodoc:
- @version.to_s.scan(/[0-9a-z]+/i).map { |s| Part.new(s) }
- end
-
- def pretty_print(q) # :nodoc:
- q.text "Gem::Version.new(#{@version.inspect})"
- end
-
- #:stopdoc:
-
- require 'rubygems/requirement'
-
- ##
- # Gem::Requirement's original definition is nested in Version.
- # Although an inappropriate place, current gems specs reference the nested
- # class name explicitly. To remain compatible with old software loading
- # gemspecs, we leave a copy of original definition in Version, but define an
- # alias Gem::Requirement for use everywhere else.
-
- Requirement = ::Gem::Requirement
-
- # :startdoc:
-
-end
-
diff --git a/lib/rubygems/version_option.rb b/lib/rubygems/version_option.rb
deleted file mode 100644
index a69b732f78..0000000000
--- a/lib/rubygems/version_option.rb
+++ /dev/null
@@ -1,49 +0,0 @@
-#--
-# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
-# All rights reserved.
-# See LICENSE.txt for permissions.
-#++
-
-require 'rubygems'
-
-# Mixin methods for --version and --platform Gem::Command options.
-module Gem::VersionOption
-
- # Add the --platform option to the option parser.
- def add_platform_option(task = command, *wrap)
- OptionParser.accept Gem::Platform do |value|
- if value == Gem::Platform::RUBY then
- value
- else
- Gem::Platform.new value
- end
- end
-
- add_option('--platform PLATFORM', Gem::Platform,
- "Specify the platform of gem to #{task}", *wrap) do
- |value, options|
- unless options[:added_platform] then
- Gem.platforms = [Gem::Platform::RUBY]
- options[:added_platform] = true
- end
-
- Gem.platforms << value unless Gem.platforms.include? value
- end
- end
-
- # Add the --version option to the option parser.
- def add_version_option(task = command, *wrap)
- OptionParser.accept Gem::Requirement do |value|
- Gem::Requirement.new value
- end
-
- add_option('-v', '--version VERSION', Gem::Requirement,
- "Specify version of gem to #{task}", *wrap) do
- |value, options|
- options[:version] = value
- options[:prerelease] = true if value.prerelease?
- end
- end
-
-end
-
diff --git a/lib/rubyunit.rb b/lib/rubyunit.rb
new file mode 100644
index 0000000000..1aca37864f
--- /dev/null
+++ b/lib/rubyunit.rb
@@ -0,0 +1,6 @@
+# Author:: Nathaniel Talbott.
+# Copyright:: Copyright (c) 2000-2002 Nathaniel Talbott. All rights reserved.
+# License:: Ruby license.
+
+require 'runit/testcase'
+require 'test/unit'
diff --git a/lib/runit/assert.rb b/lib/runit/assert.rb
new file mode 100644
index 0000000000..c752b19a25
--- /dev/null
+++ b/lib/runit/assert.rb
@@ -0,0 +1,73 @@
+# Author:: Nathaniel Talbott.
+# Copyright:: Copyright (c) 2000-2002 Nathaniel Talbott. All rights reserved.
+# License:: Ruby license.
+
+require 'test/unit/assertions'
+require 'runit/error'
+
+module RUNIT
+ module Assert
+ include Test::Unit::Assertions
+
+ def setup_assert
+ end
+
+ def assert_no_exception(*args, &block)
+ assert_nothing_raised(*args, &block)
+ end
+
+ # To deal with the fact that RubyUnit does not check that the
+ # regular expression is, indeed, a regular expression, if it is
+ # not, we do our own assertion using the same semantics as
+ # RubyUnit
+ def assert_match(actual_string, expected_re, message="")
+ _wrap_assertion {
+ full_message = build_message(message, "Expected <?> to match <?>", actual_string, expected_re)
+ assert_block(full_message) {
+ expected_re =~ actual_string
+ }
+ Regexp.last_match
+ }
+ end
+
+ def assert_not_nil(actual, message="")
+ assert(!actual.nil?, message)
+ end
+
+ def assert_not_match(actual_string, expected_re, message="")
+ assert_no_match(expected_re, actual_string, message)
+ end
+
+ def assert_matches(*args)
+ assert_match(*args)
+ end
+
+ def assert_fail(message="")
+ flunk(message)
+ end
+
+ def assert_equal_float(expected, actual, delta, message="")
+ assert_in_delta(expected, actual, delta, message)
+ end
+
+ def assert_send(object, method, *args)
+ super([object, method, *args])
+ end
+
+ def assert_exception(exception, message="", &block)
+ assert_raises(exception, message, &block)
+ end
+
+ def assert_respond_to(method, object, message="")
+ if (called_internally?)
+ super
+ else
+ super(object, method, message)
+ end
+ end
+
+ def called_internally?
+ /assertions\.rb/.match(caller[1])
+ end
+ end
+end
diff --git a/lib/runit/cui/testrunner.rb b/lib/runit/cui/testrunner.rb
new file mode 100644
index 0000000000..d521ec16ad
--- /dev/null
+++ b/lib/runit/cui/testrunner.rb
@@ -0,0 +1,51 @@
+# Author:: Nathaniel Talbott.
+# Copyright:: Copyright (c) 2000-2002 Nathaniel Talbott. All rights reserved.
+# License:: Ruby license.
+
+require 'test/unit/ui/console/testrunner'
+require 'runit/testresult'
+
+module RUNIT
+ module CUI
+ class TestRunner < Test::Unit::UI::Console::TestRunner
+ @@quiet_mode = false
+
+ def self.run(suite)
+ self.new().run(suite)
+ end
+
+ def initialize
+ super nil
+ end
+
+ def run(suite, quiet_mode=@@quiet_mode)
+ @suite = suite
+ def @suite.suite
+ self
+ end
+ @output_level = (quiet_mode ? Test::Unit::UI::PROGRESS_ONLY : Test::Unit::UI::VERBOSE)
+ start
+ end
+
+ def create_mediator(suite)
+ mediator = Test::Unit::UI::TestRunnerMediator.new(suite)
+ class << mediator
+ attr_writer :result_delegate
+ def create_result
+ return @result_delegate.create_result
+ end
+ end
+ mediator.result_delegate = self
+ return mediator
+ end
+
+ def create_result
+ return RUNIT::TestResult.new
+ end
+
+ def self.quiet_mode=(boolean)
+ @@quiet_mode = boolean
+ end
+ end
+ end
+end
diff --git a/lib/runit/error.rb b/lib/runit/error.rb
new file mode 100644
index 0000000000..4a727fb02b
--- /dev/null
+++ b/lib/runit/error.rb
@@ -0,0 +1,9 @@
+# Author:: Nathaniel Talbott.
+# Copyright:: Copyright (c) 2000-2002 Nathaniel Talbott. All rights reserved.
+# License:: Ruby license.
+
+require 'test/unit/assertionfailederror.rb'
+
+module RUNIT
+ AssertionFailedError = Test::Unit::AssertionFailedError
+end
diff --git a/lib/runit/testcase.rb b/lib/runit/testcase.rb
new file mode 100644
index 0000000000..4576cb8644
--- /dev/null
+++ b/lib/runit/testcase.rb
@@ -0,0 +1,45 @@
+# Author:: Nathaniel Talbott.
+# Copyright:: Copyright (c) 2000-2002 Nathaniel Talbott. All rights reserved.
+# License:: Ruby license.
+
+require 'runit/testresult'
+require 'runit/testsuite'
+require 'runit/assert'
+require 'runit/error'
+require 'test/unit/testcase'
+
+module RUNIT
+ class TestCase < Test::Unit::TestCase
+ include RUNIT::Assert
+
+ def self.suite
+ method_names = instance_methods(true)
+ tests = method_names.delete_if { |method_name| method_name !~ /^test/ }
+ suite = TestSuite.new(name)
+ tests.each {
+ |test|
+ catch(:invalid_test) {
+ suite << new(test, name)
+ }
+ }
+ return suite
+ end
+
+ def initialize(test_name, suite_name=self.class.name)
+ super(test_name)
+ end
+
+ def assert_equals(*args)
+ assert_equal(*args)
+ end
+
+ def name
+ super.sub(/^(.*?)\((.*)\)$/, '\2#\1')
+ end
+
+ def run(result, &progress_block)
+ progress_block = proc {} unless (block_given?)
+ super(result, &progress_block)
+ end
+ end
+end
diff --git a/lib/runit/testresult.rb b/lib/runit/testresult.rb
new file mode 100644
index 0000000000..7f70778171
--- /dev/null
+++ b/lib/runit/testresult.rb
@@ -0,0 +1,44 @@
+# Author:: Nathaniel Talbott.
+# Copyright:: Copyright (c) 2000-2002 Nathaniel Talbott. All rights reserved.
+# License:: Ruby license.
+
+require 'test/unit/testresult'
+
+module RUNIT
+ class TestResult < Test::Unit::TestResult
+ attr_reader(:errors, :failures)
+ def succeed?
+ return passed?
+ end
+ def failure_size
+ return failure_count
+ end
+ def run_asserts
+ return assertion_count
+ end
+ def error_size
+ return error_count
+ end
+ def run_tests
+ return run_count
+ end
+ def add_failure(failure)
+ def failure.at
+ return location
+ end
+ def failure.err
+ return message
+ end
+ super(failure)
+ end
+ def add_error(error)
+ def error.at
+ return location
+ end
+ def error.err
+ return exception
+ end
+ super(error)
+ end
+ end
+end
diff --git a/lib/runit/testsuite.rb b/lib/runit/testsuite.rb
new file mode 100644
index 0000000000..63baf65707
--- /dev/null
+++ b/lib/runit/testsuite.rb
@@ -0,0 +1,26 @@
+# Author:: Nathaniel Talbott.
+# Copyright:: Copyright (c) 2000-2002 Nathaniel Talbott. All rights reserved.
+# License:: Ruby license.
+
+require 'test/unit/testsuite'
+
+module RUNIT
+ class TestSuite < Test::Unit::TestSuite
+ def add_test(*args)
+ add(*args)
+ end
+
+ def add(*args)
+ self.<<(*args)
+ end
+
+ def count_test_cases
+ return size
+ end
+
+ def run(result, &progress_block)
+ progress_block = proc {} unless (block_given?)
+ super(result, &progress_block)
+ end
+ end
+end
diff --git a/lib/runit/topublic.rb b/lib/runit/topublic.rb
new file mode 100644
index 0000000000..566f0dd35c
--- /dev/null
+++ b/lib/runit/topublic.rb
@@ -0,0 +1,8 @@
+# Author:: Nathaniel Talbott.
+# Copyright:: Copyright (c) 2000-2002 Nathaniel Talbott. All rights reserved.
+# License:: Ruby license.
+
+module RUNIT
+ module ToPublic
+ end
+end
diff --git a/lib/scanf.rb b/lib/scanf.rb
index 386270b924..a54485661d 100644
--- a/lib/scanf.rb
+++ b/lib/scanf.rb
@@ -1,9 +1,9 @@
# scanf for Ruby
#
-# $Release Version: 1.1.2 $
# $Revision$
# $Id$
# $Author$
+# $Date$
#
# A product of the Austin Ruby Codefest (Austin, Texas, August 2002)
@@ -63,7 +63,7 @@ to the beginning of the format string, and yields a new array of
conversions to the block every time the format string is matched
(including partial matches, but not including complete failures). The
actual return value of scanf when called with a block is an array
-containing the results of all the executions of the block.
+containing the results of all the executions of the block.
str = "123 abc 456 def 789 ghi"
str.scanf("%d%s") { |num,str| [ num * 2, str.upcase ] }
@@ -100,7 +100,7 @@ and <tt>tests/scanftests.rb</tt> for examples.)
[u]
Same as d.
-[i]
+[i]
Matches an optionally signed integer. The integer is read in base
16 if it begins with `0x' or `0X', in base 8 if it begins with `0',
and in base 10 other- wise. Only characters that correspond to the
@@ -280,7 +280,7 @@ Project contributors:: Nolan Darilek, Jason Johnston
Thanks to Hal Fulton for hosting the Codefest.
-Thanks to Matz for suggestions about the class design.
+Thanks to Matz for suggestions about the class design.
Thanks to Gavin Sinclair for some feedback on the documentation.
@@ -325,14 +325,14 @@ module Scanf
end
def count_space?
- /(?:\A|\S)%\*?\d*c|%\d*\[/.match(@spec_string)
+ /(?:\A|\S)%\*?\d*c|\[/.match(@spec_string)
end
def initialize(str)
@spec_string = str
h = '[A-Fa-f0-9]'
- @re_string, @handler =
+ @re_string, @handler =
case @spec_string
# %[[:...:]]
@@ -466,11 +466,11 @@ module Scanf
end
def letter
- @spec_string[/%\*?\d*([a-z\[])/, 1]
+ /%\*?\d*([a-z\[])/.match(@spec_string).to_a[1]
end
def width
- w = @spec_string[/%\*?(\d+)/, 1]
+ w = /%\*?(\d+)/.match(@spec_string).to_a[1]
w && w.to_i
end
@@ -482,7 +482,7 @@ module Scanf
return width_left || cc_no_width
end
-
+
end
class FormatString
@@ -541,8 +541,7 @@ module Scanf
@string_left = str
@matched_count = 0
- @specs.each_with_index do |spec,i|
- @i=i
+ @specs.each_with_index do |spec,@i|
@last_spec_tried = spec
@last_match_tried = spec.match(@string_left)
break unless @last_match_tried
@@ -672,10 +671,10 @@ class String
if b
block_scanf(fstr,&b)
else
- fs =
+ fs =
if fstr.is_a? Scanf::FormatString
- fstr
- else
+ fstr
+ else
Scanf::FormatString.new(fstr)
end
fs.match(self)
diff --git a/lib/securerandom.rb b/lib/securerandom.rb
index 4a97ff8a78..3fd63e535f 100644
--- a/lib/securerandom.rb
+++ b/lib/securerandom.rb
@@ -7,7 +7,6 @@
#
# * openssl
# * /dev/urandom
-# * Win32
#
# == Example
#
@@ -46,21 +45,15 @@ module SecureRandom
# If n is not specified, 16 is assumed.
# It may be larger in future.
#
- # The result may contain any byte: "\x00" - "\xff".
- #
- # p SecureRandom.random_bytes #=> "\xD8\\\xE0\xF4\r\xB2\xFC*WM\xFF\x83\x18\xF45\xB6"
- # p SecureRandom.random_bytes #=> "m\xDC\xFC/\a\x00Uf\xB2\xB2P\xBD\xFF6S\x97"
- #
# If secure random number generator is not available,
# NotImplementedError is raised.
def self.random_bytes(n=nil)
n ||= 16
-
if defined? OpenSSL::Random
return OpenSSL::Random.random_bytes(n)
end
-
if !defined?(@has_urandom) || @has_urandom
+ @has_urandom = false
flags = File::RDONLY
flags |= File::NONBLOCK if defined? File::NONBLOCK
flags |= File::NOCTTY if defined? File::NOCTTY
@@ -78,39 +71,9 @@ module SecureRandom
return ret
}
rescue Errno::ENOENT
- @has_urandom = false
- end
- end
-
- if !defined?(@has_win32)
- begin
- require 'Win32API'
-
- crypt_acquire_context = Win32API.new("advapi32", "CryptAcquireContext", 'PPPII', 'L')
- @crypt_gen_random = Win32API.new("advapi32", "CryptGenRandom", 'LIP', 'L')
-
- hProvStr = " " * 4
- prov_rsa_full = 1
- crypt_verifycontext = 0xF0000000
-
- if crypt_acquire_context.call(hProvStr, nil, nil, prov_rsa_full, crypt_verifycontext) == 0
- raise SystemCallError, "CryptAcquireContext failed: #{lastWin32ErrorMessage}"
- end
- @hProv, = hProvStr.unpack('L')
-
- @has_win32 = true
- rescue LoadError
- @has_win32 = false
+ raise NotImplementedError, "No random device"
end
end
- if @has_win32
- bytes = " " * n
- if @crypt_gen_random.call(@hProv, bytes.size, bytes) == 0
- raise SystemCallError, "CryptGenRandom failed: #{lastWin32ErrorMessage}"
- end
- return bytes
- end
-
raise NotImplementedError, "No random device"
end
@@ -122,11 +85,6 @@ module SecureRandom
# If n is not specified, 16 is assumed.
# It may be larger in future.
#
- # The result may contain 0-9 and a-f.
- #
- # p SecureRandom.hex #=> "eb693ec8252cd630102fd0d0fb7c3485"
- # p SecureRandom.hex #=> "91dc3bfb4de5b11d029d376634589b61"
- #
# If secure random number generator is not available,
# NotImplementedError is raised.
def self.hex(n=nil)
@@ -141,81 +99,33 @@ module SecureRandom
# If n is not specified, 16 is assumed.
# It may be larger in future.
#
- # The result may contain A-Z, a-z, 0-9, "+", "/" and "=".
- #
- # p SecureRandom.base64 #=> "/2BuBuLf3+WfSKyQbRcc/A=="
- # p SecureRandom.base64 #=> "6BbW0pxO0YENxn38HMUbcQ=="
- #
# If secure random number generator is not available,
# NotImplementedError is raised.
- #
- # See RFC 3548 for base64.
def self.base64(n=nil)
[random_bytes(n)].pack("m*").delete("\n")
end
- # SecureRandom.urlsafe_base64 generates a random URL-safe base64 string.
- #
- # The argument _n_ specifies the length of the random length.
- # The length of the result string is about 4/3 of _n_.
- #
- # If _n_ is not specified, 16 is assumed.
- # It may be larger in future.
- #
- # The boolean argument _padding_ specifies the padding.
- # If it is false or nil, padding is not generated.
- # Otherwise padding is generated.
- # By default, padding is not generated because "=" may be used as a URL delimiter.
- #
- # The result may contain A-Z, a-z, 0-9, "-" and "_".
- # "=" is also used if _padding_ is true.
- #
- # p SecureRandom.urlsafe_base64 #=> "b4GOKm4pOYU_-BOXcrUGDg"
- # p SecureRandom.urlsafe_base64 #=> "UZLdOkzop70Ddx-IJR0ABg"
- #
- # p SecureRandom.urlsafe_base64(nil, true) #=> "i0XQ-7gglIsHGV2_BNPrdQ=="
- # p SecureRandom.urlsafe_base64(nil, true) #=> "-M8rLhr7JEpJlqFGUMmOxg=="
- #
- # If secure random number generator is not available,
- # NotImplementedError is raised.
- #
- # See RFC 3548 for URL-safe base64.
- def self.urlsafe_base64(n=nil, padding=false)
- s = [random_bytes(n)].pack("m*")
- s.delete!("\n")
- s.tr!("+/", "-_")
- s.delete!("=") if !padding
- s
- end
-
# SecureRandom.random_number generates a random number.
#
# If an positive integer is given as n,
# SecureRandom.random_number returns an integer:
# 0 <= SecureRandom.random_number(n) < n.
#
- # p SecureRandom.random_number(100) #=> 15
- # p SecureRandom.random_number(100) #=> 88
- #
# If 0 is given or an argument is not given,
# SecureRandom.random_number returns an float:
# 0.0 <= SecureRandom.random_number() < 1.0.
- #
- # p SecureRandom.random_number #=> 0.596506046187744
- # p SecureRandom.random_number #=> 0.350621695741409
- #
def self.random_number(n=0)
if 0 < n
hex = n.to_s(16)
hex = '0' + hex if (hex.length & 1) == 1
bin = [hex].pack("H*")
- mask = bin[0].ord
+ mask = bin[0]
mask |= mask >> 1
mask |= mask >> 2
mask |= mask >> 4
begin
rnd = SecureRandom.random_bytes(bin.length)
- rnd[0] = (rnd[0].ord & mask).chr
+ rnd[0] = (rnd[0] & mask).chr
end until rnd < bin
rnd.unpack("H*")[0].hex
else
@@ -224,34 +134,4 @@ module SecureRandom
Math.ldexp(i64 >> (64-Float::MANT_DIG), -Float::MANT_DIG)
end
end
-
- # SecureRandom.uuid generates a v4 random UUID (Universally Unique IDentifier).
- #
- # p SecureRandom.uuid #=> "2d931510-d99f-494a-8c67-87feb05e1594"
- # p SecureRandom.uuid #=> "62936e70-1815-439b-bf89-8492855a7e6b"
- #
- # The version 4 UUID is purely random (except the version).
- # It doesn't contain meaningful information such as MAC address, time, etc.
- #
- # See RFC 4122 for details of UUID.
- #
- def self.uuid
- ary = self.random_bytes(16).unpack("NnnnnN")
- ary[2] = (ary[2] & 0x0fff) | 0x4000
- ary[3] = (ary[3] & 0x3fff) | 0x8000
- "%08x-%04x-%04x-%04x-%04x%08x" % ary
- end
-
- # Following code is based on David Garamond's GUID library for Ruby.
- def self.lastWin32ErrorMessage # :nodoc:
- get_last_error = Win32API.new("kernel32", "GetLastError", '', 'L')
- format_message = Win32API.new("kernel32", "FormatMessageA", 'LPLLPLPPPPPPPP', 'L')
- format_message_ignore_inserts = 0x00000200
- format_message_from_system = 0x00001000
-
- code = get_last_error.call
- msg = "\0" * 1024
- len = format_message.call(format_message_ignore_inserts + format_message_from_system, 0, code, 0, msg, 1024, nil, nil, nil, nil, nil, nil, nil, nil)
- msg[0, len].tr("\r", '').chomp
- end
end
diff --git a/lib/set.rb b/lib/set.rb
index 8f2bef91ba..164aa429d9 100644
--- a/lib/set.rb
+++ b/lib/set.rb
@@ -4,15 +4,15 @@
#++
# Copyright (c) 2002-2008 Akinori MUSHA <knu@iDaemons.org>
#
-# Documentation by Akinori MUSHA and Gavin Sinclair.
+# Documentation by Akinori MUSHA and Gavin Sinclair.
#
# All rights reserved. You can redistribute and/or modify it under the same
# terms as Ruby.
#
# $Id$
#
-# == Overview
-#
+# == Overview
+#
# This library provides the Set class, which deals with a collection
# of unordered values with no duplicates. It is a hybrid of Array's
# intuitive inter-operation facilities and Hash's fast lookup. If you
@@ -20,7 +20,7 @@
#
# The method +to_set+ is added to Enumerable for convenience.
#
-# See the Set and SortedSet documentation for examples of usage.
+# See the Set class for an example of usage.
#
@@ -28,13 +28,14 @@
# This is a hybrid of Array's intuitive inter-operation facilities and
# Hash's fast lookup.
#
+# Several methods accept any Enumerable object (implementing +each+)
+# for greater flexibility: new, replace, merge, subtract, |, &, -, ^.
+#
# The equality of each couple of elements is determined according to
# Object#eql? and Object#hash, since Set uses Hash as storage.
#
-# Set is easy to use with Enumerable objects (implementing +each+).
-# Most of the initializer methods and binary operators accept generic
-# Enumerable objects besides sets and arrays. An Enumerable object
-# can be converted to Set using the +to_set+ method.
+# Finally, if you are using class Set, you can also use Enumerable#to_set
+# for convenience.
#
# == Example
#
@@ -81,24 +82,6 @@ class Set
@hash = orig.instance_eval{@hash}.dup
end
- def freeze # :nodoc:
- super
- @hash.freeze
- self
- end
-
- def taint # :nodoc:
- super
- @hash.taint
- self
- end
-
- def untaint # :nodoc:
- super
- @hash.untaint
- self
- end
-
# Returns the number of elements.
def size
@hash.size
@@ -122,6 +105,7 @@ class Set
if enum.class == self.class
@hash.replace(enum.instance_eval { @hash })
else
+ enum.is_a?(Enumerable) or raise ArgumentError, "value must be enumerable"
clear
enum.each { |o| add(o) }
end
@@ -213,7 +197,7 @@ class Set
end
# Adds the given object to the set and returns self. Use +merge+ to
- # add many elements at once.
+ # add several elements at once.
def add(o)
@hash[o] = true
self
@@ -231,7 +215,7 @@ class Set
end
# Deletes the given object from the set and returns self. Use +subtract+ to
- # delete many items at once.
+ # delete several items at once.
def delete(o)
@hash.delete(o)
self
@@ -250,14 +234,12 @@ class Set
# Deletes every element of the set for which block evaluates to
# true, and returns self.
def delete_if
- block_given? or return enum_for(__method__)
to_a.each { |o| @hash.delete(o) if yield(o) }
self
end
- # Replaces the elements with ones returned by collect().
+ # Do collect() destructively.
def collect!
- block_given? or return enum_for(__method__)
set = self.class.new
each { |o| set << yield(o) }
replace(set)
@@ -267,7 +249,6 @@ class Set
# Equivalent to Set#delete_if, but returns nil if no changes were
# made.
def reject!
- block_given? or return enum_for(__method__)
n = size
delete_if { |o| yield(o) }
size == n ? nil : self
@@ -276,9 +257,10 @@ class Set
# Merges the elements of the given enumerable object to the set and
# returns self.
def merge(enum)
- if enum.instance_of?(self.class)
- @hash.update(enum.instance_variable_get(:@hash))
+ if enum.is_a?(Set)
+ @hash.update(enum.instance_eval { @hash })
else
+ enum.is_a?(Enumerable) or raise ArgumentError, "value must be enumerable"
enum.each { |o| add(o) }
end
@@ -288,6 +270,7 @@ class Set
# Deletes every element that appears in the given enumerable object
# and returns self.
def subtract(enum)
+ enum.is_a?(Enumerable) or raise ArgumentError, "value must be enumerable"
enum.each { |o| delete(o) }
self
end
@@ -295,6 +278,7 @@ class Set
# Returns a new set built by merging the set and the elements of the
# given enumerable object.
def |(enum)
+ enum.is_a?(Enumerable) or raise ArgumentError, "value must be enumerable"
dup.merge(enum)
end
alias + | ##
@@ -303,6 +287,7 @@ class Set
# Returns a new set built by duplicating the set, removing every
# element that appears in the given enumerable object.
def -(enum)
+ enum.is_a?(Enumerable) or raise ArgumentError, "value must be enumerable"
dup.subtract(enum)
end
alias difference - ##
@@ -310,6 +295,7 @@ class Set
# Returns a new set containing elements common to the set and the
# given enumerable object.
def &(enum)
+ enum.is_a?(Enumerable) or raise ArgumentError, "value must be enumerable"
n = self.class.new
enum.each { |o| n.add(o) if include?(o) }
n
@@ -320,6 +306,7 @@ class Set
# and the given enumerable object. (set ^ enum) is equivalent to
# ((set | enum) - (set & enum)).
def ^(enum)
+ enum.is_a?(Enumerable) or raise ArgumentError, "value must be enumerable"
n = Set.new(enum)
each { |o| if n.include?(o) then n.delete(o) else n.add(o) end }
n
@@ -359,8 +346,6 @@ class Set
# # 2001=>#<Set: {"c.rb", "d.rb", "e.rb"}>,
# # 2002=>#<Set: {"f.rb"}>}
def classify # :yields: o
- block_given? or return enum_for(__method__)
-
h = {}
each { |i|
@@ -388,8 +373,6 @@ class Set
# # #<Set: {3, 4}>,
# # #<Set: {6}>}>
def divide(&func)
- func or return enum_for(__method__)
-
if func.arity == 2
require 'tsort'
@@ -451,35 +434,7 @@ class Set
end
end
-#
-# SortedSet implements a Set that guarantees that it's element are
-# yielded in sorted order (according to the return values of their
-# #<=> methods) when iterating over them.
-#
-# All elements that are added to a SortedSet must respond to the <=>
-# method for comparison.
-#
-# Also, all elements must be <em>mutually comparable</em>: <tt>el1 <=>
-# el2</tt> must not return <tt>nil</tt> for any elements <tt>el1</tt>
-# and <tt>el2</tt>, else an ArgumentError will be raised when
-# iterating over the SortedSet.
-#
-# == Example
-#
-# require "set"
-#
-# set = SortedSet.new([2, 1, 5, 6, 4, 5, 3, 3, 3])
-# ary = []
-#
-# set.each do |obj|
-# ary << obj
-# end
-#
-# p ary # => [1, 2, 3, 4, 5, 6]
-#
-# set2 = SortedSet.new([1, 2, "3"])
-# set2.each { |obj| } # => raises ArgumentError: comparison of Fixnum with String failed
-#
+# SortedSet implements a set which elements are sorted in order. See Set.
class SortedSet < Set
@@setup = false
@@ -504,12 +459,6 @@ class SortedSet < Set
@hash = RBTree.new
super
end
-
- def add(o)
- o.respond_to?(:<=>) or raise ArgumentError, "value must repond to <=>"
- super
- end
- alias << add
}
rescue LoadError
module_eval %{
@@ -529,9 +478,9 @@ class SortedSet < Set
end
def add(o)
- o.respond_to?(:<=>) or raise ArgumentError, "value must respond to <=>"
@keys = nil
- super
+ @hash[o] = true
+ self
end
alias << add
@@ -542,7 +491,6 @@ class SortedSet < Set
end
def delete_if
- block_given? or return enum_for(__method__)
n = @hash.size
super
@keys = nil if @hash.size != n
@@ -589,33 +537,33 @@ end
# == RestricedSet class
# RestricedSet implements a set with restrictions defined by a given
# block.
-#
+#
# === Super class
# Set
-#
+#
# === Class Methods
# --- RestricedSet::new(enum = nil) { |o| ... }
# --- RestricedSet::new(enum = nil) { |rset, o| ... }
# Creates a new restricted set containing the elements of the given
# enumerable object. Restrictions are defined by the given block.
-#
+#
# If the block's arity is 2, it is called with the RestrictedSet
# itself and an object to see if the object is allowed to be put in
# the set.
-#
+#
# Otherwise, the block is called with an object to see if the object
# is allowed to be put in the set.
-#
+#
# === Instance Methods
# --- restriction_proc
# Returns the restriction procedure of the set.
-#
+#
# =end
-#
+#
# class RestricedSet < Set
# def initialize(*args, &block)
# @proc = block or raise ArgumentError, "missing a block"
-#
+#
# if @proc.arity == 2
# instance_eval %{
# def add(o)
@@ -623,7 +571,7 @@ end
# self
# end
# alias << add
-#
+#
# def add?(o)
# if include?(o) || !@proc.call(self, o)
# nil
@@ -632,17 +580,19 @@ end
# self
# end
# end
-#
+#
# def replace(enum)
+# enum.is_a?(Enumerable) or raise ArgumentError, "value must be enumerable"
# clear
# enum.each { |o| add(o) }
-#
+#
# self
# end
-#
+#
# def merge(enum)
+# enum.is_a?(Enumerable) or raise ArgumentError, "value must be enumerable"
# enum.each { |o| add(o) }
-#
+#
# self
# end
# }
@@ -650,12 +600,12 @@ end
# instance_eval %{
# def add(o)
# if @proc.call(o)
-# @hash[o] = true
+# @hash[o] = true
# end
# self
# end
# alias << add
-#
+#
# def add?(o)
# if include?(o) || !@proc.call(o)
# nil
@@ -666,10 +616,10 @@ end
# end
# }
# end
-#
+#
# super(*args)
# end
-#
+#
# def restriction_proc
# @proc
# end
@@ -707,11 +657,12 @@ class TC_Set < Test::Unit::TestCase
Set.new([])
Set.new([1,2])
Set.new('a'..'c')
+ Set.new('XYZ')
}
- assert_raises(NoMethodError) {
+ assert_raises(ArgumentError) {
Set.new(false)
}
- assert_raises(NoMethodError) {
+ assert_raises(ArgumentError) {
Set.new(1)
}
assert_raises(ArgumentError) {
@@ -975,7 +926,7 @@ class TC_Set < Test::Unit::TestCase
assert_same(set, ret)
e = set.each
- assert_instance_of(Enumerator, e)
+ assert_instance_of(Enumerable::Enumerator, e)
assert_nothing_raised {
set.each { |o|
@@ -1275,33 +1226,33 @@ end
# class TC_RestricedSet < Test::Unit::TestCase
# def test_s_new
# assert_raises(ArgumentError) { RestricedSet.new }
-#
+#
# s = RestricedSet.new([-1,2,3]) { |o| o > 0 }
# assert_equal([2,3], s.sort)
# end
-#
+#
# def test_restriction_proc
# s = RestricedSet.new([-1,2,3]) { |o| o > 0 }
-#
+#
# f = s.restriction_proc
# assert_instance_of(Proc, f)
# assert(f[1])
# assert(!f[0])
# end
-#
+#
# def test_replace
# s = RestricedSet.new(-3..3) { |o| o > 0 }
# assert_equal([1,2,3], s.sort)
-#
+#
# s.replace([-2,0,3,4,5])
# assert_equal([3,4,5], s.sort)
# end
-#
+#
# def test_merge
# s = RestricedSet.new { |o| o > 0 }
# s.merge(-5..5)
# assert_equal([1,2,3,4,5], s.sort)
-#
+#
# s.merge([10,-10,-8,8])
# assert_equal([1,2,3,4,5,8,10], s.sort)
# end
diff --git a/lib/shell.rb b/lib/shell.rb
index d2ce26d3b3..039f849ef5 100644
--- a/lib/shell.rb
+++ b/lib/shell.rb
@@ -1,26 +1,24 @@
#
-# shell.rb -
-# $Release Version: 0.7 $
-# $Revision: 1.9 $
-# by Keiju ISHITSUKA(keiju@ruby-lang.org)
+# shell.rb -
+# $Release Version: 0.6.0 $
+# $Revision: 1.8 $
+# $Date: 2001/03/19 09:01:11 $
+# by Keiju ISHITSUKA(Nippon Rational Inc.)
#
# --
#
-#
+#
#
require "e2mmap"
-
-require "thread" unless defined?(Mutex)
-
-require "forwardable"
+require "thread"
require "shell/error"
require "shell/command-processor"
require "shell/process-controller"
class Shell
- @RCS_ID='-$Id: shell.rb,v 1.9 2002/03/04 12:01:10 keiju Exp keiju $-'
+ @RCS_ID='-$Id: shell.rb,v 1.8 2001/03/19 09:01:11 keiju Exp keiju $-'
include Error
extend Exception2MessageMapper
@@ -32,14 +30,10 @@ class Shell
@debug = false
@verbose = true
- @debug_display_process_id = false
- @debug_display_thread_id = true
- @debug_output_mutex = Mutex.new
-
class << Shell
- extend Forwardable
-
- attr_accessor :cascade, :debug, :verbose
+ attr :cascade, true
+ attr :debug, true
+ attr :verbose, true
# alias cascade? cascade
alias debug? debug
@@ -52,7 +46,9 @@ class Shell
end
def cd(path)
- new(path)
+ sh = new
+ sh.cd path
+ sh
end
def default_system_path
@@ -78,19 +74,12 @@ class Shell
def default_record_separator=(rs)
@default_record_separator = rs
end
-
- # os resource mutex
- mutex_methods = ["unlock", "lock", "locked?", "synchronize", "try_lock", "exclusive_unlock"]
- for m in mutex_methods
- def_delegator("@debug_output_mutex", m, "debug_output_"+m.to_s)
- end
-
end
- def initialize(pwd = Dir.pwd, umask = nil)
- @cwd = File.expand_path(pwd)
+ def initialize
+ @cwd = Dir.pwd
@dir_stack = []
- @umask = umask
+ @umask = nil
@system_path = Shell.default_system_path
@record_separator = Shell.default_record_separator
@@ -109,8 +98,11 @@ class Shell
rehash
end
- attr_accessor :umask, :record_separator
- attr_accessor :verbose, :debug
+ attr :umask, true
+ attr :record_separator, true
+
+ attr :verbose, true
+ attr :debug, true
def debug=(val)
@debug = val
@@ -139,58 +131,49 @@ class Shell
# Shell#mkdir
# Shell#rmdir
- attr_reader :cwd
+ attr :cwd
alias dir cwd
alias getwd cwd
alias pwd cwd
- attr_reader :dir_stack
+ attr :dir_stack
alias dirs dir_stack
# If called as iterator, it restores the current directory when the
# block ends.
- def chdir(path = nil, verbose = @verbose)
- check_point
-
+ def chdir(path = nil)
if iterator?
- notify("chdir(with block) #{path}") if verbose
cwd_old = @cwd
begin
- chdir(path, nil)
+ chdir(path)
yield
ensure
- chdir(cwd_old, nil)
+ chdir(cwd_old)
end
else
- notify("chdir #{path}") if verbose
path = "~" unless path
@cwd = expand_path(path)
notify "current dir: #{@cwd}"
rehash
- Void.new(self)
+ self
end
end
alias cd chdir
- def pushdir(path = nil, verbose = @verbose)
- check_point
-
+ def pushdir(path = nil)
if iterator?
- notify("pushdir(with block) #{path}") if verbose
- pushdir(path, nil)
+ pushdir(path)
begin
yield
ensure
popdir
end
elsif path
- notify("pushdir #{path}") if verbose
@dir_stack.push @cwd
- chdir(path, nil)
+ chdir path
notify "dir stack: [#{@dir_stack.join ', '}]"
self
else
- notify("pushdir") if verbose
if pop = @dir_stack.pop
@dir_stack.push @cwd
chdir pop
@@ -200,14 +183,10 @@ class Shell
Shell.Fail DirStackEmpty
end
end
- Void.new(self)
end
alias pushd pushdir
def popdir
- check_point
-
- notify("popdir")
if pop = @dir_stack.pop
chdir pop
notify "dir stack: [#{@dir_stack.join ', '}]"
@@ -215,10 +194,10 @@ class Shell
else
Shell.Fail DirStackEmpty
end
- Void.new(self)
end
alias popd popdir
+
#
# process management
#
@@ -263,35 +242,25 @@ class Shell
end
def self.notify(*opts, &block)
- Shell::debug_output_synchronize do
- if opts[-1].kind_of?(String)
- yorn = verbose?
- else
- yorn = opts.pop
- end
- return unless yorn
-
- if @debug_display_thread_id
- if @debug_display_process_id
- prefix = "shell(##{Process.pid}:#{Thread.current.to_s.sub("Thread", "Th")}): "
- else
- prefix = "shell(#{Thread.current.to_s.sub("Thread", "Th")}): "
- end
+ Thread.exclusive do
+ if opts[-1].kind_of?(String)
+ yorn = verbose?
+ else
+ yorn = opts.pop
+ end
+ return unless yorn
+
+ _head = true
+ print opts.collect{|mes|
+ mes = mes.dup
+ yield mes if iterator?
+ if _head
+ _head = false
+ "shell: " + mes
else
- prefix = "shell: "
+ " " + mes
end
- _head = true
- STDERR.print opts.collect{|mes|
- mes = mes.dup
- yield mes if iterator?
- if _head
- _head = false
-# "shell" " + mes
- prefix + mes
- else
- " "* prefix.size + mes
- end
- }.join("\n")+"\n"
+ }.join("\n")+"\n"
end
end
diff --git a/lib/shell/builtin-command.rb b/lib/shell/builtin-command.rb
index e489da4eca..db1adfa48b 100644
--- a/lib/shell/builtin-command.rb
+++ b/lib/shell/builtin-command.rb
@@ -1,12 +1,13 @@
#
-# shell/builtin-command.rb -
-# $Release Version: 0.7 $
+# shell/builtin-command.rb -
+# $Release Version: 0.6.0 $
# $Revision$
-# by Keiju ISHITSUKA(keiju@ruby-lang.org)
+# $Date$
+# by Keiju ISHITSUKA(Nihon Rational Software Co.,Ltd)
#
# --
#
-#
+#
#
require "shell/filter"
@@ -21,22 +22,12 @@ class Shell
end
end
- class Void < BuiltInCommand
- def initialize(sh, *opts)
- super sh
- end
-
- def each(rs = nil)
- # do nothing
- end
- end
-
class Echo < BuiltInCommand
def initialize(sh, *strings)
super sh
@strings = strings
end
-
+
def each(rs = nil)
rs = @shell.record_separator unless rs
for str in @strings
@@ -67,17 +58,20 @@ class Shell
super sh
@pattern = pattern
+ Thread.critical = true
+ back = Dir.pwd
+ begin
+ Dir.chdir @shell.cwd
+ @files = Dir[pattern]
+ ensure
+ Dir.chdir back
+ Thread.critical = false
+ end
end
def each(rs = nil)
- if @pattern[0] == ?/
- @files = Dir[@pattern]
- else
- prefix = @shell.pwd+"/"
- @files = Dir[prefix+@pattern].collect{|p| p.sub(prefix, "")}
- end
rs = @shell.record_separator unless rs
- for f in @files
+ for f in @files
yield f+rs
end
end
diff --git a/lib/shell/command-processor.rb b/lib/shell/command-processor.rb
index e224d91368..b0e4fb70db 100644
--- a/lib/shell/command-processor.rb
+++ b/lib/shell/command-processor.rb
@@ -1,15 +1,17 @@
#
-# shell/command-controller.rb -
-# $Release Version: 0.7 $
+# shell/command-controller.rb -
+# $Release Version: 0.6.0 $
# $Revision$
-# by Keiju ISHITSUKA(keiju@ruby-lang.org)
+# $Date$
+# by Keiju ISHITSUKA(Nippon Rational Inc.)
#
# --
#
-#
+#
#
require "e2mmap"
+require "ftools"
require "thread"
require "shell/error"
@@ -24,13 +26,7 @@ class Shell
#
# initialize of Shell and related classes.
#
- m = [:initialize, :expand_path]
- if Object.methods.first.kind_of?(String)
- NoDelegateMethods = m.collect{|x| x.id2name}
- else
- NoDelegateMethods = m
- end
-
+ NoDelegateMethods = ["initialize", "expand_path"]
def self.initialize
install_builtin_commands
@@ -39,7 +35,7 @@ class Shell
for m in CommandProcessor.instance_methods(false) - NoDelegateMethods
add_delegate_command_to_shell(m)
end
-
+
def self.method_added(id)
add_delegate_command_to_shell(id)
end
@@ -84,7 +80,7 @@ class Shell
# Shell#test
#
# -
- #
+ #
# CommandProcessor#foreach(path, rs)
# path: String
# rs: String - record separator
@@ -115,20 +111,13 @@ class Shell
# Dir#open (when path is directory)
# mode has an effect only when path is a file
#
- def open(path, mode = nil, perm = 0666, &b)
+ def open(path, mode)
path = expand_path(path)
if File.directory?(path)
- Dir.open(path, &b)
+ Dir.open(path)
else
- if @shell.umask
- f = File.open(path, mode, perm)
- File.chmod(perm & ~@shell.umask, path)
- if block_given?
- f.each(&b)
- end
- f
- else
- f = File.open(path, mode, perm, &b)
+ effect_umask do
+ File.open(path, mode)
end
end
end
@@ -141,15 +130,12 @@ class Shell
# File#unlink (when path is file)
#
def unlink(path)
- @shell.check_point
-
path = expand_path(path)
if File.directory?(path)
Dir.unlink(path)
else
IO.unlink(path)
end
- Void.new(@shell)
end
#
@@ -168,7 +154,7 @@ class Shell
# sh["e", "foo"]
# sh[:exists?, "foo"]
# sh["exists?", "foo"]
- #
+ #
alias top_level_test test
def test(command, file1, file2=nil)
file1 = expand_path(file1)
@@ -211,40 +197,22 @@ class Shell
# CommandProcessor#mkdir(*path)
# path: String
# same as Dir.mkdir()
- #
+ #
def mkdir(*path)
- @shell.check_point
- notify("mkdir #{path.join(' ')}")
-
- perm = nil
- if path.last.kind_of?(Integer)
- perm = path.pop
- end
for dir in path
- d = expand_path(dir)
- if perm
- Dir.mkdir(d, perm)
- else
- Dir.mkdir(d)
- end
- File.chmod(d, 0666 & ~@shell.umask) if @shell.umask
+ Dir.mkdir(expand_path(dir))
end
- Void.new(@shell)
end
#
# CommandProcessor#rmdir(*path)
# path: String
# same as Dir.rmdir()
- #
+ #
def rmdir(*path)
- @shell.check_point
- notify("rmdir #{path.join(' ')}")
-
for dir in path
Dir.rmdir(expand_path(dir))
end
- Void.new(@shell)
end
#
@@ -256,7 +224,7 @@ class Shell
# example:
# print sh.system("ls", "-l")
# sh.system("ls", "-l") | sh.head > STDOUT
- #
+ #
def system(command, *opts)
if opts.empty?
if command =~ /\*|\?|\{|\}|\[|\]|<|>|\(|\)|~|&|\||\\|\$|;|'|`|"|\n/
@@ -336,17 +304,35 @@ class Shell
# %pwd, %cwd -> @pwd
def notify(*opts, &block)
- Shell.notify(*opts) {|mes|
- yield mes if iterator?
-
- mes.gsub!("%pwd", "#{@cwd}")
- mes.gsub!("%cwd", "#{@cwd}")
- }
+ Thread.exclusive do
+ Shell.notify(*opts) {|mes|
+ yield mes if iterator?
+
+ mes.gsub!("%pwd", "#{@cwd}")
+ mes.gsub!("%cwd", "#{@cwd}")
+ }
+ end
end
#
# private functions
#
+ def effect_umask
+ if @shell.umask
+ Thread.critical = true
+ save = File.umask
+ begin
+ yield
+ ensure
+ File.umask save
+ Thread.critical = false
+ end
+ else
+ yield
+ end
+ end
+ private :effect_umask
+
def find_system_command(command)
return command if /^\// =~ command
case path = @system_commands[command]
@@ -362,7 +348,7 @@ class Shell
for p in @shell.system_path
path = join(p, command)
- if FileTest.exist?(path)
+ if FileTest.exists?(path)
@system_commands[command] = path
return path
end
@@ -383,10 +369,10 @@ class Shell
SystemCommand.new(@shell, '#{path}', *opts)
end]), nil, __FILE__, __LINE__ - 1)
rescue SyntaxError
- Shell.notify "warn: Can't define #{command} path: #{path}."
+ Shell.notify "warn: Can't define #{command} path: #{path}."
end
Shell.notify "Define #{command} path: #{path}.", Shell.debug?
- Shell.notify("Definition of #{command}: ", d,
+ Shell.notify("Definition of #{command}: ", d,
Shell.debug.kind_of?(Integer) && Shell.debug > 1)
end
@@ -418,7 +404,7 @@ class Shell
@shell.__send__(:#{command},
*(CommandProcessor.alias_map[:#{ali}].call *opts))
end]), nil, __FILE__, __LINE__ - 1)
-
+
else
args = opts.collect{|opt| '"' + opt + '"'}.join(",")
eval((d = %Q[def #{ali}(*opts)
@@ -426,22 +412,22 @@ class Shell
end]), nil, __FILE__, __LINE__ - 1)
end
rescue SyntaxError
- Shell.notify "warn: Can't alias #{ali} command: #{command}."
+ Shell.notify "warn: Can't alias #{ali} command: #{command}."
Shell.notify("Definition of #{ali}: ", d)
raise
end
Shell.notify "Define #{ali} command: #{command}.", Shell.debug?
- Shell.notify("Definition of #{ali}: ", d,
+ Shell.notify("Definition of #{ali}: ", d,
Shell.debug.kind_of?(Integer) && Shell.debug > 1)
self
end
-
+
def self.unalias_command(ali)
ali = ali.id2name if ali.kind_of?(Symbol)
@alias_map.delete ali.intern
undef_system_command(ali)
end
-
+
#
# CommandProcessor.def_builtin_commands(delegation_class, command_specs)
# delegation_class: Class or Module
@@ -472,8 +458,8 @@ class Shell
#{delegation_class}.#{meth}(#{call_arg_str})
end]
Shell.notify "Define #{meth}(#{arg_str})", Shell.debug?
- Shell.notify("Definition of #{meth}: ", d,
- Shell.debug.kind_of?(Integer) && Shell.debug > 1)
+ Shell.notify("Definition of #{meth}: ", d,
+ Shell.debug.kind_of?(Integer) && Shell.debug > 1)
eval d
end
end
@@ -513,7 +499,7 @@ class Shell
#----------------------------------------------------------------------
#
- # class initializing methods -
+ # class initializing methods -
#
#----------------------------------------------------------------------
def self.add_delegate_command_to_shell(id)
@@ -561,7 +547,7 @@ class Shell
normal_delegation_file_methods = [
["atime", ["FILENAME"]],
["basename", ["fn", "*opts"]],
- ["chmod", ["mode", "*FILENAMES"]],
+ ["chmod", ["mode", "*FILENAMES"]],
["chown", ["owner", "group", "*FILENAME"]],
["ctime", ["FILENAMES"]],
["delete", ["*FILENAMES"]],
@@ -584,9 +570,27 @@ class Shell
alias_method :rm, :delete
# method related FileTest
- def_builtin_commands(FileTest,
+ def_builtin_commands(FileTest,
FileTest.singleton_methods(false).collect{|m| [m, ["FILENAME"]]})
+ # method related ftools
+ normal_delegation_ftools_methods = [
+ ["syscopy", ["FILENAME_FROM", "FILENAME_TO"]],
+ ["copy", ["FILENAME_FROM", "FILENAME_TO"]],
+ ["move", ["FILENAME_FROM", "FILENAME_TO"]],
+ ["compare", ["FILENAME_FROM", "FILENAME_TO"]],
+ ["safe_unlink", ["*FILENAMES"]],
+ ["makedirs", ["*FILENAMES"]],
+ # ["chmod", ["mode", "*FILENAMES"]],
+ ["install", ["FILENAME_FROM", "FILENAME_TO", "mode"]],
+ ]
+ def_builtin_commands(File,
+ normal_delegation_ftools_methods)
+ alias_method :cmp, :compare
+ alias_method :mv, :move
+ alias_method :cp, :copy
+ alias_method :rm_f, :safe_unlink
+ alias_method :mkpath, :makedirs
end
end
diff --git a/lib/shell/error.rb b/lib/shell/error.rb
index dbb788a6fc..d338b1c5d1 100644
--- a/lib/shell/error.rb
+++ b/lib/shell/error.rb
@@ -1,12 +1,13 @@
#
-# shell/error.rb -
-# $Release Version: 0.7 $
+# shell/error.rb -
+# $Release Version: 0.6.0 $
# $Revision$
-# by Keiju ISHITSUKA(keiju@ruby-lang.org)
+# $Date$
+# by Keiju ISHITSUKA(Nihon Rational Software Co.,Ltd)
#
# --
#
-#
+#
#
require "e2mmap"
diff --git a/lib/shell/filter.rb b/lib/shell/filter.rb
index 3f88d0f5d2..27c5534695 100644
--- a/lib/shell/filter.rb
+++ b/lib/shell/filter.rb
@@ -1,12 +1,13 @@
#
-# shell/filter.rb -
-# $Release Version: 0.7 $
+# shell/filter.rb -
+# $Release Version: 0.6.0 $
# $Revision$
-# by Keiju ISHITSUKA(keiju@ruby-lang.org)
+# $Date$
+# by Keiju ISHITSUKA(Nihon Rational Software Co.,Ltd)
#
# --
#
-#
+#
#
class Shell
@@ -28,7 +29,7 @@ class Shell
def input=(filter)
@input = filter
end
-
+
def each(rs = nil)
rs = @shell.record_separator unless rs
if @input
diff --git a/lib/shell/process-controller.rb b/lib/shell/process-controller.rb
index 829ff7900a..8929805506 100644
--- a/lib/shell/process-controller.rb
+++ b/lib/shell/process-controller.rb
@@ -1,37 +1,33 @@
#
-# shell/process-controller.rb -
-# $Release Version: 0.7 $
+# shell/process-controller.rb -
+# $Release Version: 0.6.0 $
# $Revision$
-# by Keiju ISHITSUKA(keiju@ruby-lang.org)
+# $Date$
+# by Keiju ISHITSUKA(Nihon Rational Software Co.,Ltd)
#
# --
#
+#
#
-#
-require "forwardable"
-require "thread"
+require "mutex_m"
+require "monitor"
require "sync"
class Shell
class ProcessController
@ProcessControllers = {}
- @ProcessControllersMonitor = Mutex.new
- @ProcessControllersCV = ConditionVariable.new
-
- @BlockOutputMonitor = Mutex.new
- @BlockOutputCV = ConditionVariable.new
+ @ProcessControllers.extend Mutex_m
class<<self
- extend Forwardable
-
- def_delegator("@ProcessControllersMonitor",
- "synchronize", "process_controllers_exclusive")
- def active_process_controllers
- process_controllers_exclusive do
- @ProcessControllers.dup
+ def process_controllers_exclusive
+ begin
+ @ProcessControllers.lock unless Thread.critical
+ yield
+ ensure
+ @ProcessControllers.unlock unless Thread.critical
end
end
@@ -47,7 +43,6 @@ class Shell
if @ProcessControllers[pc]
if (@ProcessControllers[pc] -= 1) == 0
@ProcessControllers.delete(pc)
- @ProcessControllersCV.signal
end
end
end
@@ -60,34 +55,6 @@ class Shell
end
end
end
-
- def block_output_synchronize(&b)
- @BlockOutputMonitor.synchronize(&b)
- end
-
- def wait_to_finish_all_process_controllers
- process_controllers_exclusive do
- while !@ProcessControllers.empty?
- Shell::notify("Process finishing, but active shell exists",
- "You can use Shell#transact or Shell#check_point for more safe execution.")
- if Shell.debug?
- for pc in @ProcessControllers.keys
- Shell::notify(" Not finished jobs in "+pc.shell.to_s)
- for com in pc.jobs
- com.notify(" Jobs: %id")
- end
- end
- end
- @ProcessControllersCV.wait(@ProcessControllersMonitor)
- end
- end
- end
- end
-
- # for shell-command complete finish at this process exit.
- USING_AT_EXIT_WHEN_PROCESS_EXIT = true
- at_exit do
- wait_to_finish_all_process_controllers unless $@
end
def initialize(shell)
@@ -100,8 +67,6 @@ class Shell
@job_condition = ConditionVariable.new
end
- attr_reader :shell
-
def jobs
jobs = []
@jobs_sync.synchronize(:SH) do
@@ -118,7 +83,7 @@ class Shell
def waiting_jobs
@waiting_jobs
end
-
+
def jobs_exist?
@jobs_sync.synchronize(:SH) do
@active_jobs.empty? or @waiting_jobs.empty?
@@ -157,19 +122,15 @@ class Shell
@waiting_jobs.delete command
else
command = @waiting_jobs.shift
-# command.notify "job(%id) pre-start.", @shell.debug?
-
return unless command
end
@active_jobs.push command
command.start
-# command.notify "job(%id) post-start.", @shell.debug?
# start all jobs that input from the job
- for job in @waiting_jobs.dup
+ for job in @waiting_jobs
start_job(job) if job.input == command
end
-# command.notify "job(%id) post2-start.", @shell.debug?
end
end
@@ -191,7 +152,6 @@ class Shell
@active_jobs.delete command
ProcessController.inactivate(self)
if @active_jobs.empty?
- command.notify("start_jon in ierminate_jon(%id)", Shell::debug?)
start_job
end
end
@@ -199,7 +159,7 @@ class Shell
# kill a job
def kill_job(sig, command)
- @jobs_sync.synchronize(:EX) do
+ @jobs_sync.synchronize(:SH) do
if @waiting_jobs.delete command
ProcessController.inactivate(self)
return
@@ -223,9 +183,6 @@ class Shell
begin
while !jobs.empty?
@job_condition.wait(@job_monitor)
- for job in jobs
- job.notify("waiting job(%id)", Shell::debug?)
- end
end
ensure
redo unless jobs.empty?
@@ -237,82 +194,66 @@ class Shell
def sfork(command, &block)
pipe_me_in, pipe_peer_out = IO.pipe
pipe_peer_in, pipe_me_out = IO.pipe
+ Thread.critical = true
+ STDOUT.flush
+ ProcessController.each_active_object do |pc|
+ for jobs in pc.active_jobs
+ jobs.flush
+ end
+ end
+
+ pid = fork {
+ Thread.critical = true
- pid = nil
- pid_mutex = Mutex.new
- pid_cv = ConditionVariable.new
-
- Thread.start do
- ProcessController.block_output_synchronize do
- STDOUT.flush
- ProcessController.each_active_object do |pc|
- for jobs in pc.active_jobs
- jobs.flush
- end
- end
-
- pid = fork {
- Thread.list.each do |th|
-# th.kill unless [Thread.main, Thread.current].include?(th)
- th.kill unless Thread.current == th
- end
-
- STDIN.reopen(pipe_peer_in)
- STDOUT.reopen(pipe_peer_out)
+ Thread.list.each do |th|
+ th.kill unless [Thread.main, Thread.current].include?(th)
+ end
- ObjectSpace.each_object(IO) do |io|
- if ![STDIN, STDOUT, STDERR].include?(io)
- io.close unless io.closed?
- end
- end
+ STDIN.reopen(pipe_peer_in)
+ STDOUT.reopen(pipe_peer_out)
- yield
- }
+ ObjectSpace.each_object(IO) do |io|
+ if ![STDIN, STDOUT, STDERR].include?(io)
+ io.close unless io.closed?
+ end
end
- pid_cv.signal
+ yield
+ }
- pipe_peer_in.close
- pipe_peer_out.close
- command.notify "job(%name:##{pid}) start", @shell.debug?
+ pipe_peer_in.close
+ pipe_peer_out.close
+ command.notify "job(%name:##{pid}) start", @shell.debug?
+ Thread.critical = false
+ th = Thread.start {
+ Thread.critical = true
begin
_pid = nil
command.notify("job(%id) start to waiting finish.", @shell.debug?)
+ Thread.critical = false
_pid = Process.waitpid(pid, nil)
rescue Errno::ECHILD
command.notify "warn: job(%id) was done already waitipd."
_pid = true
- # rescue
- # STDERR.puts $!
ensure
- command.notify("Job(%id): Wait to finish when Process finished.", @shell.debug?)
# when the process ends, wait until the command termintes
- if USING_AT_EXIT_WHEN_PROCESS_EXIT or _pid
+ if _pid
else
command.notify("notice: Process finishing...",
"wait for Job[%id] to finish.",
"You can use Shell#transact or Shell#check_point for more safe execution.")
redo
end
-
-# command.notify "job(%id) pre-pre-finish.", @shell.debug?
- @job_monitor.synchronize do
-# command.notify "job(%id) pre-finish.", @shell.debug?
- terminate_job(command)
-# command.notify "job(%id) pre-finish2.", @shell.debug?
- @job_condition.signal
- command.notify "job(%id) finish.", @shell.debug?
+ Thread.exclusive do
+ @job_monitor.synchronize do
+ terminate_job(command)
+ @job_condition.signal
+ command.notify "job(%id) finish.", @shell.debug?
+ end
end
end
- end
-
- pid_mutex.synchronize do
- while !pid
- pid_cv.wait(pid_mutex)
- end
- end
-
+ }
return pid, pipe_me_in, pipe_me_out
end
end
diff --git a/lib/shell/system-command.rb b/lib/shell/system-command.rb
index af9b0a8e37..f87ba890ea 100644
--- a/lib/shell/system-command.rb
+++ b/lib/shell/system-command.rb
@@ -1,12 +1,13 @@
#
-# shell/system-command.rb -
-# $Release Version: 0.7 $
+# shell/system-command.rb -
+# $Release Version: 0.6.0 $
# $Revision$
-# by Keiju ISHITSUKA(keiju@ruby-lang.org)
+# $Date$
+# by Keiju ISHITSUKA(Nihon Rational Software Co.,Ltd)
#
# --
#
-#
+#
#
require "shell/filter"
@@ -20,7 +21,7 @@ class Shell
super(sh)
@command = command
@opts = opts
-
+
@input_queue = Queue.new
@pid = nil
@@ -46,15 +47,12 @@ class Shell
end
def start
- notify([@command, *@opts].join(" "))
-
@pid, @pipe_in, @pipe_out = @shell.process_controller.sfork(self) {
Dir.chdir @shell.pwd
- $0 = @command
exec(@command, *@opts)
}
if @input
- start_export
+ start_export
end
start_import
end
@@ -80,12 +78,17 @@ class Shell
end
end
+
def start_import
+# Thread.critical = true
notify "Job(%id) start imp-pipe.", @shell.debug?
rs = @shell.record_separator unless rs
_eop = true
+# Thread.critical = false
th = Thread.start {
+ Thread.critical = true
begin
+ Thread.critical = false
while l = @pipe_in.gets
@input_queue.push l
end
@@ -93,15 +96,19 @@ class Shell
rescue Errno::EPIPE
_eop = false
ensure
- if !ProcessController::USING_AT_EXIT_WHEN_PROCESS_EXIT and _eop
+ if _eop
notify("warn: Process finishing...",
"wait for Job[%id] to finish pipe importing.",
"You can use Shell#transact or Shell#check_point for more safe execution.")
+# Tracer.on
+ Thread.current.run
redo
end
- notify "job(%id}) close imp-pipe.", @shell.debug?
- @input_queue.push :EOF
- @pipe_in.close
+ Thread.exclusive do
+ notify "job(%id}) close imp-pipe.", @shell.debug?
+ @input_queue.push :EOF
+ @pipe_in.close
+ end
end
}
end
@@ -110,24 +117,25 @@ class Shell
notify "job(%id) start exp-pipe.", @shell.debug?
_eop = true
th = Thread.start{
+ Thread.critical = true
begin
- @input.each do |l|
- ProcessController::block_output_synchronize do
- @pipe_out.print l
- end
- end
+ Thread.critical = false
+ @input.each{|l| @pipe_out.print l}
_eop = false
- rescue Errno::EPIPE, Errno::EIO
+ rescue Errno::EPIPE
_eop = false
ensure
- if !ProcessController::USING_AT_EXIT_WHEN_PROCESS_EXIT and _eop
+ if _eop
notify("shell: warn: Process finishing...",
"wait for Job(%id) to finish pipe exporting.",
"You can use Shell#transact or Shell#check_point for more safe execution.")
+# Tracer.on
redo
end
- notify "job(%id) close exp-pipe.", @shell.debug?
- @pipe_out.close
+ Thread.exclusive do
+ notify "job(%id) close exp-pipe.", @shell.debug?
+ @pipe_out.close
+ end
end
}
end
@@ -140,19 +148,20 @@ class Shell
end
# ex)
- # if you wish to output:
+ # if you wish to output:
# "shell: job(#{@command}:#{@pid}) close pipe-out."
- # then
+ # then
# mes: "job(%id) close pipe-out."
# yorn: Boolean(@shell.debug? or @shell.verbose?)
def notify(*opts, &block)
- @shell.notify(*opts) do |mes|
- yield mes if iterator?
-
- mes.gsub!("%id", "#{@command}:##{@pid}")
- mes.gsub!("%name", "#{@command}")
- mes.gsub!("%pid", "#{@pid}")
- mes
+ Thread.exclusive do
+ @shell.notify(*opts) {|mes|
+ yield mes if iterator?
+
+ mes.gsub!("%id", "#{@command}:##{@pid}")
+ mes.gsub!("%name", "#{@command}")
+ mes.gsub!("%pid", "#{@pid}")
+ }
end
end
end
diff --git a/lib/shell/version.rb b/lib/shell/version.rb
index 6e4c170351..6694c804d8 100644
--- a/lib/shell/version.rb
+++ b/lib/shell/version.rb
@@ -1,15 +1,16 @@
#
# version.rb - shell version definition file
-# $Release Version: 0.7$
+# $Release Version: 0.6.0$
# $Revision$
-# by Keiju ISHITSUKA(keiju@ruby-lang.org)
+# $Date$
+# by Keiju ISHITSUKA(Nihon Rational Software Co.,Ltd)
#
# --
#
-#
+#
#
class Shell
- @RELEASE_VERSION = "0.7"
- @LAST_UPDATE_DATE = "07/03/20"
+ @RELEASE_VERSION = "0.6.0"
+ @LAST_UPDATE_DATE = "01/03/19"
end
diff --git a/lib/shellwords.rb b/lib/shellwords.rb
index f1300612bb..a4ec552a7e 100644
--- a/lib/shellwords.rb
+++ b/lib/shellwords.rb
@@ -30,16 +30,32 @@ module Shellwords
# argv #=> ["here", "are", "two words"]
#
def shellsplit(line)
+ line = String.new(line) rescue
+ raise(ArgumentError, "Argument must be a string")
+ line.lstrip!
words = []
- field = ''
- line.scan(/\G\s*(?>([^\s\\\'\"]+)|'([^\']*)'|"((?:[^\"\\]|\\.)*)"|(\\.?)|(\S))(\s|\z)?/m) do
- |word, sq, dq, esc, garbage, sep|
- raise ArgumentError, "Unmatched double quote: #{line.inspect}" if garbage
- field << (word || sq || (dq || esc).gsub(/\\(?=.)/, ''))
- if sep
- words << field
- field = ''
+ until line.empty?
+ field = ''
+ loop do
+ if line.sub!(/\A"(([^"\\]|\\.)*)"/, '') then
+ snippet = $1.gsub(/\\(.)/, '\1')
+ elsif line =~ /\A"/ then
+ raise ArgumentError, "Unmatched double quote: #{line}"
+ elsif line.sub!(/\A'([^']*)'/, '') then
+ snippet = $1
+ elsif line =~ /\A'/ then
+ raise ArgumentError, "Unmatched single quote: #{line}"
+ elsif line.sub!(/\A\\(.)?/, '') then
+ snippet = $1 || '\\'
+ elsif line.sub!(/\A([^\s\\'"]+)/, '') then
+ snippet = $1
+ else
+ line.lstrip!
+ break
+ end
+ field.concat(snippet)
end
+ words.push(field)
end
words
end
diff --git a/lib/singleton.rb b/lib/singleton.rb
index 3c81b2d3cb..592d33c063 100644
--- a/lib/singleton.rb
+++ b/lib/singleton.rb
@@ -9,9 +9,9 @@
# * this ensures that only one instance of Klass lets call it
# ``the instance'' can be created.
#
-# a,b = Klass.instance, Klass.instance
-# a == b # => true
-# Klass.new # NoMethodError - new is private ...
+# a,b = Klass.instance, Klass.instance
+# a == b # => true
+# a.new # NoMethodError - new is private ...
#
# * ``The instance'' is created at instantiation time, in other
# words the first call of Klass.instance(), thus
@@ -39,7 +39,7 @@
# method body is a simple:
#
# def Klass.instance()
-# return @singleton__instance__
+# return @__instance__
# end
#
# * Klass._load(str) - calling Klass.instance()
@@ -60,7 +60,7 @@
# and _dump(depth) hooks allows the (partially) resurrections of
# a previous state of ``the instance''.
-require 'thread'
+
module Singleton
# disable build-in copying methods
@@ -72,9 +72,56 @@ module Singleton
end
# default marshalling strategy
- def _dump(depth = -1)
+ def _dump(depth=-1)
''
end
+end
+
+
+class << Singleton
+ # Method body of first instance call.
+ FirstInstanceCall = proc do
+ # @__instance__ takes on one of the following values
+ # * nil - before and after a failed creation
+ # * false - during creation
+ # * sub_class instance - after a successful creation
+ # the form makes up for the lack of returns in progs
+ Thread.critical = true
+ if @__instance__.nil?
+ @__instance__ = false
+ Thread.critical = false
+ begin
+ @__instance__ = new
+ ensure
+ if @__instance__
+ class <<self
+ remove_method :instance
+ def instance; @__instance__ end
+ end
+ else
+ @__instance__ = nil # failed instance creation
+ end
+ end
+ elsif _instantiate?()
+ Thread.critical = false
+ else
+ @__instance__ = false
+ Thread.critical = false
+ begin
+ @__instance__ = new
+ ensure
+ if @__instance__
+ class <<self
+ remove_method :instance
+ def instance; @__instance__ end
+ end
+ else
+ @__instance__ = nil
+ end
+ end
+ end
+ @__instance__
+ end
module SingletonClassMethods
# properly clone the Singleton pattern - did you know
@@ -94,49 +141,48 @@ module Singleton
super
Singleton.__init__(sub_klass)
end
- end
- class << Singleton
- def __init__(klass)
- klass.instance_eval {
- @singleton__instance__ = nil
- @singleton__mutex__ = Mutex.new
- }
- def klass.instance
- return @singleton__instance__ if @singleton__instance__
- @singleton__mutex__.synchronize {
- return @singleton__instance__ if @singleton__instance__
- @singleton__instance__ = new()
- }
- @singleton__instance__
+ # waiting-loop hook
+ def _instantiate?()
+ while false.equal?(@__instance__)
+ Thread.critical = false
+ sleep(0.08) # timeout
+ Thread.critical = true
end
- klass
+ @__instance__
end
+ end
- private
-
- # extending an object with Singleton is a bad idea
- undef_method :extend_object
-
- def append_features(mod)
- # help out people counting on transitive mixins
- unless mod.instance_of?(Class)
- raise TypeError, "Inclusion of the OO-Singleton module in module #{mod}"
- end
- super
+ def __init__(klass)
+ klass.instance_eval { @__instance__ = nil }
+ class << klass
+ define_method(:instance,FirstInstanceCall)
end
+ klass
+ end
- def included(klass)
- super
- klass.private_class_method :new, :allocate
- klass.extend SingletonClassMethods
- Singleton.__init__(klass)
+ private
+ # extending an object with Singleton is a bad idea
+ undef_method :extend_object
+
+ def append_features(mod)
+ # help out people counting on transitive mixins
+ unless mod.instance_of?(Class)
+ raise TypeError, "Inclusion of the OO-Singleton module in module #{mod}"
end
+ super
end
+ def included(klass)
+ super
+ klass.private_class_method :new, :allocate
+ klass.extend SingletonClassMethods
+ Singleton.__init__(klass)
+ end
end
+
if __FILE__ == $0
def num_of_instances(klass)
@@ -175,13 +221,13 @@ end
class << Ups
def _instantiate?
@enter.push Thread.current[:i]
- while false.equal?(@singleton__instance__)
- @singleton__mutex__.unlock
+ while false.equal?(@__instance__)
+ Thread.critical = false
sleep 0.08
- @singleton__mutex__.lock
+ Thread.critical = true
end
@leave.push Thread.current[:i]
- @singleton__instance__
+ @__instance__
end
def __sleep
diff --git a/lib/soap/attachment.rb b/lib/soap/attachment.rb
new file mode 100644
index 0000000000..1a59b14018
--- /dev/null
+++ b/lib/soap/attachment.rb
@@ -0,0 +1,107 @@
+# soap/attachment.rb: SOAP4R - SwA implementation.
+# Copyright (C) 2002, 2003 Jamie Herre and NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+require 'soap/baseData'
+require 'soap/mapping'
+
+
+module SOAP
+
+
+class SOAPAttachment < SOAPExternalReference
+ attr_reader :data
+
+ def initialize(value)
+ super()
+ @data = value
+ end
+
+private
+
+ def external_contentid
+ @data.contentid
+ end
+end
+
+
+class Attachment
+ attr_reader :io
+ attr_accessor :contenttype
+
+ def initialize(string_or_readable = nil)
+ @string_or_readable = string_or_readable
+ @contenttype = "application/octet-stream"
+ @contentid = nil
+ end
+
+ def contentid
+ @contentid ||= Attachment.contentid(self)
+ end
+
+ def contentid=(contentid)
+ @contentid = contentid
+ end
+
+ def mime_contentid
+ '<' + contentid + '>'
+ end
+
+ def content
+ if @content == nil and @string_or_readable != nil
+ @content = @string_or_readable.respond_to?(:read) ?
+ @string_or_readable.read : @string_or_readable
+ end
+ @content
+ end
+
+ def to_s
+ content
+ end
+
+ def write(out)
+ out.write(content)
+ end
+
+ def save(filename)
+ File.open(filename, "wb") do |f|
+ write(f)
+ end
+ end
+
+ def self.contentid(obj)
+ # this needs to be fixed
+ [obj.__id__.to_s, Process.pid.to_s].join('.')
+ end
+
+ def self.mime_contentid(obj)
+ '<' + contentid(obj) + '>'
+ end
+end
+
+
+module Mapping
+ class AttachmentFactory < SOAP::Mapping::Factory
+ def obj2soap(soap_class, obj, info, map)
+ soap_obj = soap_class.new(obj)
+ mark_marshalled_obj(obj, soap_obj)
+ soap_obj
+ end
+
+ def soap2obj(obj_class, node, info, map)
+ obj = node.data
+ mark_unmarshalled_obj(node, obj)
+ return true, obj
+ end
+ end
+
+ DefaultRegistry.add(::SOAP::Attachment, ::SOAP::SOAPAttachment,
+ AttachmentFactory.new, nil)
+end
+
+
+end
diff --git a/lib/soap/baseData.rb b/lib/soap/baseData.rb
new file mode 100644
index 0000000000..0e8b00d450
--- /dev/null
+++ b/lib/soap/baseData.rb
@@ -0,0 +1,942 @@
+# soap/baseData.rb: SOAP4R - Base type library
+# Copyright (C) 2000, 2001, 2003-2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+require 'xsd/datatypes'
+require 'soap/soap'
+
+
+module SOAP
+
+
+###
+## Mix-in module for SOAP base type classes.
+#
+module SOAPModuleUtils
+ include SOAP
+
+public
+
+ def decode(elename)
+ d = self.new
+ d.elename = elename
+ d
+ end
+end
+
+
+###
+## for SOAP type(base and compound)
+#
+module SOAPType
+ attr_accessor :encodingstyle
+ attr_accessor :elename
+ attr_accessor :id
+ attr_reader :precedents
+ attr_accessor :root
+ attr_accessor :parent
+ attr_accessor :position
+ attr_reader :extraattr
+ attr_accessor :definedtype
+
+ def initialize(*arg)
+ super
+ @encodingstyle = nil
+ @elename = XSD::QName::EMPTY
+ @id = nil
+ @precedents = []
+ @root = false
+ @parent = nil
+ @position = nil
+ @definedtype = nil
+ @extraattr = {}
+ end
+
+ def inspect
+ if self.is_a?(XSD::NSDBase)
+ sprintf("#<%s:0x%x %s %s>", self.class.name, __id__, self.elename, self.type)
+ else
+ sprintf("#<%s:0x%x %s>", self.class.name, __id__, self.elename)
+ end
+ end
+
+ def rootnode
+ node = self
+ while node = node.parent
+ break if SOAPEnvelope === node
+ end
+ node
+ end
+end
+
+
+###
+## for SOAP base type
+#
+module SOAPBasetype
+ include SOAPType
+ include SOAP
+
+ def initialize(*arg)
+ super
+ end
+end
+
+
+###
+## for SOAP compound type
+#
+module SOAPCompoundtype
+ include SOAPType
+ include SOAP
+
+ def initialize(*arg)
+ super
+ end
+end
+
+
+###
+## Convenience datatypes.
+#
+class SOAPReference < XSD::NSDBase
+ include SOAPBasetype
+ extend SOAPModuleUtils
+
+public
+
+ attr_accessor :refid
+
+ # Override the definition in SOAPBasetype.
+ def initialize(obj = nil)
+ super()
+ @type = XSD::QName::EMPTY
+ @refid = nil
+ @obj = nil
+ __setobj__(obj) if obj
+ end
+
+ def __getobj__
+ @obj
+ end
+
+ def __setobj__(obj)
+ @obj = obj
+ @refid = @obj.id || SOAPReference.create_refid(@obj)
+ @obj.id = @refid unless @obj.id
+ @obj.precedents << self
+ # Copies NSDBase information
+ @obj.type = @type unless @obj.type
+ end
+
+ # Why don't I use delegate.rb?
+ # -> delegate requires target object type at initialize time.
+ # Why don't I use forwardable.rb?
+ # -> forwardable requires a list of forwarding methods.
+ #
+ # ToDo: Maybe I should use forwardable.rb and give it a methods list like
+ # delegate.rb...
+ #
+ def method_missing(msg_id, *params)
+ if @obj
+ @obj.send(msg_id, *params)
+ else
+ nil
+ end
+ end
+
+ def refidstr
+ '#' + @refid
+ end
+
+ def self.create_refid(obj)
+ 'id' + obj.__id__.to_s
+ end
+
+ def self.decode(elename, refidstr)
+ if /\A#(.*)\z/ =~ refidstr
+ refid = $1
+ elsif /\Acid:(.*)\z/ =~ refidstr
+ refid = $1
+ else
+ raise ArgumentError.new("illegal refid #{refidstr}")
+ end
+ d = super(elename)
+ d.refid = refid
+ d
+ end
+end
+
+
+class SOAPExternalReference < XSD::NSDBase
+ include SOAPBasetype
+ extend SOAPModuleUtils
+
+ def initialize
+ super()
+ @type = XSD::QName::EMPTY
+ end
+
+ def referred
+ rootnode.external_content[external_contentid] = self
+ end
+
+ def refidstr
+ 'cid:' + external_contentid
+ end
+
+private
+
+ def external_contentid
+ raise NotImplementedError.new
+ end
+end
+
+
+class SOAPNil < XSD::XSDNil
+ include SOAPBasetype
+ extend SOAPModuleUtils
+end
+
+# SOAPRawString is for sending raw string. In contrast to SOAPString,
+# SOAP4R does not do XML encoding and does not convert its CES. The string it
+# holds is embedded to XML instance directly as a 'xsd:string'.
+class SOAPRawString < XSD::XSDString
+ include SOAPBasetype
+ extend SOAPModuleUtils
+end
+
+
+###
+## Basic datatypes.
+#
+class SOAPAnySimpleType < XSD::XSDAnySimpleType
+ include SOAPBasetype
+ extend SOAPModuleUtils
+end
+
+class SOAPString < XSD::XSDString
+ include SOAPBasetype
+ extend SOAPModuleUtils
+end
+
+class SOAPBoolean < XSD::XSDBoolean
+ include SOAPBasetype
+ extend SOAPModuleUtils
+end
+
+class SOAPDecimal < XSD::XSDDecimal
+ include SOAPBasetype
+ extend SOAPModuleUtils
+end
+
+class SOAPFloat < XSD::XSDFloat
+ include SOAPBasetype
+ extend SOAPModuleUtils
+end
+
+class SOAPDouble < XSD::XSDDouble
+ include SOAPBasetype
+ extend SOAPModuleUtils
+end
+
+class SOAPDuration < XSD::XSDDuration
+ include SOAPBasetype
+ extend SOAPModuleUtils
+end
+
+class SOAPDateTime < XSD::XSDDateTime
+ include SOAPBasetype
+ extend SOAPModuleUtils
+end
+
+class SOAPTime < XSD::XSDTime
+ include SOAPBasetype
+ extend SOAPModuleUtils
+end
+
+class SOAPDate < XSD::XSDDate
+ include SOAPBasetype
+ extend SOAPModuleUtils
+end
+
+class SOAPGYearMonth < XSD::XSDGYearMonth
+ include SOAPBasetype
+ extend SOAPModuleUtils
+end
+
+class SOAPGYear < XSD::XSDGYear
+ include SOAPBasetype
+ extend SOAPModuleUtils
+end
+
+class SOAPGMonthDay < XSD::XSDGMonthDay
+ include SOAPBasetype
+ extend SOAPModuleUtils
+end
+
+class SOAPGDay < XSD::XSDGDay
+ include SOAPBasetype
+ extend SOAPModuleUtils
+end
+
+class SOAPGMonth < XSD::XSDGMonth
+ include SOAPBasetype
+ extend SOAPModuleUtils
+end
+
+class SOAPHexBinary < XSD::XSDHexBinary
+ include SOAPBasetype
+ extend SOAPModuleUtils
+end
+
+class SOAPBase64 < XSD::XSDBase64Binary
+ include SOAPBasetype
+ extend SOAPModuleUtils
+ Type = QName.new(EncodingNamespace, Base64Literal)
+
+public
+ # Override the definition in SOAPBasetype.
+ def initialize(value = nil)
+ super(value)
+ @type = Type
+ end
+
+ def as_xsd
+ @type = XSD::XSDBase64Binary::Type
+ end
+end
+
+class SOAPAnyURI < XSD::XSDAnyURI
+ include SOAPBasetype
+ extend SOAPModuleUtils
+end
+
+class SOAPQName < XSD::XSDQName
+ include SOAPBasetype
+ extend SOAPModuleUtils
+end
+
+
+class SOAPInteger < XSD::XSDInteger
+ include SOAPBasetype
+ extend SOAPModuleUtils
+end
+
+class SOAPNonPositiveInteger < XSD::XSDNonPositiveInteger
+ include SOAPBasetype
+ extend SOAPModuleUtils
+end
+
+class SOAPNegativeInteger < XSD::XSDNegativeInteger
+ include SOAPBasetype
+ extend SOAPModuleUtils
+end
+
+class SOAPLong < XSD::XSDLong
+ include SOAPBasetype
+ extend SOAPModuleUtils
+end
+
+class SOAPInt < XSD::XSDInt
+ include SOAPBasetype
+ extend SOAPModuleUtils
+end
+
+class SOAPShort < XSD::XSDShort
+ include SOAPBasetype
+ extend SOAPModuleUtils
+end
+
+class SOAPByte < XSD::XSDByte
+ include SOAPBasetype
+ extend SOAPModuleUtils
+end
+
+class SOAPNonNegativeInteger < XSD::XSDNonNegativeInteger
+ include SOAPBasetype
+ extend SOAPModuleUtils
+end
+
+class SOAPUnsignedLong < XSD::XSDUnsignedLong
+ include SOAPBasetype
+ extend SOAPModuleUtils
+end
+
+class SOAPUnsignedInt < XSD::XSDUnsignedInt
+ include SOAPBasetype
+ extend SOAPModuleUtils
+end
+
+class SOAPUnsignedShort < XSD::XSDUnsignedShort
+ include SOAPBasetype
+ extend SOAPModuleUtils
+end
+
+class SOAPUnsignedByte < XSD::XSDUnsignedByte
+ include SOAPBasetype
+ extend SOAPModuleUtils
+end
+
+class SOAPPositiveInteger < XSD::XSDPositiveInteger
+ include SOAPBasetype
+ extend SOAPModuleUtils
+end
+
+
+###
+## Compound datatypes.
+#
+class SOAPStruct < XSD::NSDBase
+ include SOAPCompoundtype
+ include Enumerable
+
+public
+
+ def initialize(type = nil)
+ super()
+ @type = type || XSD::QName::EMPTY
+ @array = []
+ @data = []
+ end
+
+ def to_s()
+ str = ''
+ self.each do |key, data|
+ str << "#{key}: #{data}\n"
+ end
+ str
+ end
+
+ def add(name, value)
+ add_member(name, value)
+ end
+
+ def [](idx)
+ if idx.is_a?(Range)
+ @data[idx]
+ elsif idx.is_a?(Integer)
+ if (idx > @array.size)
+ raise ArrayIndexOutOfBoundsError.new('In ' << @type.name)
+ end
+ @data[idx]
+ else
+ if @array.include?(idx)
+ @data[@array.index(idx)]
+ else
+ nil
+ end
+ end
+ end
+
+ def []=(idx, data)
+ if @array.include?(idx)
+ data.parent = self if data.respond_to?(:parent=)
+ @data[@array.index(idx)] = data
+ else
+ add(idx, data)
+ end
+ end
+
+ def key?(name)
+ @array.include?(name)
+ end
+
+ def members
+ @array
+ end
+
+ def to_obj
+ hash = {}
+ proptype = {}
+ each do |k, v|
+ value = v.respond_to?(:to_obj) ? v.to_obj : v.to_s
+ case proptype[k]
+ when :single
+ hash[k] = [hash[k], value]
+ proptype[k] = :multi
+ when :multi
+ hash[k] << value
+ else
+ hash[k] = value
+ proptype[k] = :single
+ end
+ end
+ hash
+ end
+
+ def each
+ idx = 0
+ while idx < @array.length
+ yield(@array[idx], @data[idx])
+ idx += 1
+ end
+ end
+
+ def replace
+ members.each do |member|
+ self[member] = yield(self[member])
+ end
+ end
+
+ def self.decode(elename, type)
+ s = SOAPStruct.new(type)
+ s.elename = elename
+ s
+ end
+
+private
+
+ def add_member(name, value = nil)
+ value = SOAPNil.new() if value.nil?
+ @array.push(name)
+ value.elename = value.elename.dup_name(name)
+ @data.push(value)
+ value.parent = self if value.respond_to?(:parent=)
+ value
+ end
+end
+
+
+# SOAPElement is not typed so it is not derived from NSDBase.
+class SOAPElement
+ include Enumerable
+
+ attr_accessor :encodingstyle
+
+ attr_accessor :elename
+ attr_accessor :id
+ attr_reader :precedents
+ attr_accessor :root
+ attr_accessor :parent
+ attr_accessor :position
+ attr_accessor :extraattr
+
+ attr_accessor :qualified
+
+ def initialize(elename, text = nil)
+ if !elename.is_a?(XSD::QName)
+ elename = XSD::QName.new(nil, elename)
+ end
+ @encodingstyle = LiteralNamespace
+ @elename = elename
+ @id = nil
+ @precedents = []
+ @root = false
+ @parent = nil
+ @position = nil
+ @extraattr = {}
+
+ @qualified = nil
+
+ @array = []
+ @data = []
+ @text = text
+ end
+
+ def inspect
+ sprintf("#<%s:0x%x %s>", self.class.name, __id__, self.elename)
+ end
+
+ # Text interface.
+ attr_accessor :text
+ alias data text
+
+ # Element interfaces.
+ def add(value)
+ add_member(value.elename.name, value)
+ end
+
+ def [](idx)
+ if @array.include?(idx)
+ @data[@array.index(idx)]
+ else
+ nil
+ end
+ end
+
+ def []=(idx, data)
+ if @array.include?(idx)
+ data.parent = self if data.respond_to?(:parent=)
+ @data[@array.index(idx)] = data
+ else
+ add(data)
+ end
+ end
+
+ def key?(name)
+ @array.include?(name)
+ end
+
+ def members
+ @array
+ end
+
+ def to_obj
+ if members.empty?
+ @text
+ else
+ hash = {}
+ proptype = {}
+ each do |k, v|
+ value = v.respond_to?(:to_obj) ? v.to_obj : v.to_s
+ case proptype[k]
+ when :single
+ hash[k] = [hash[k], value]
+ proptype[k] = :multi
+ when :multi
+ hash[k] << value
+ else
+ hash[k] = value
+ proptype[k] = :single
+ end
+ end
+ hash
+ end
+ end
+
+ def each
+ idx = 0
+ while idx < @array.length
+ yield(@array[idx], @data[idx])
+ idx += 1
+ end
+ end
+
+ def self.decode(elename)
+ o = SOAPElement.new(elename)
+ o
+ end
+
+ def self.from_obj(obj, namespace = nil)
+ o = SOAPElement.new(nil)
+ case obj
+ when nil
+ o.text = nil
+ when Hash
+ obj.each do |elename, value|
+ if value.is_a?(Array)
+ value.each do |subvalue|
+ child = from_obj(subvalue, namespace)
+ child.elename = to_elename(elename, namespace)
+ o.add(child)
+ end
+ else
+ child = from_obj(value, namespace)
+ child.elename = to_elename(elename, namespace)
+ o.add(child)
+ end
+ end
+ else
+ o.text = obj.to_s
+ end
+ o
+ end
+
+ def self.to_elename(obj, namespace = nil)
+ if obj.is_a?(XSD::QName)
+ obj
+ elsif /\A(.+):([^:]+)\z/ =~ obj.to_s
+ XSD::QName.new($1, $2)
+ else
+ XSD::QName.new(namespace, obj.to_s)
+ end
+ end
+
+private
+
+ def add_member(name, value)
+ add_accessor(name)
+ @array.push(name)
+ @data.push(value)
+ value.parent = self if value.respond_to?(:parent=)
+ value
+ end
+
+ if RUBY_VERSION > "1.7.0"
+ def add_accessor(name)
+ methodname = name
+ if self.respond_to?(methodname)
+ methodname = safe_accessor_name(methodname)
+ end
+ Mapping.define_singleton_method(self, methodname) do
+ @data[@array.index(name)]
+ end
+ Mapping.define_singleton_method(self, methodname + '=') do |value|
+ @data[@array.index(name)] = value
+ end
+ end
+ else
+ def add_accessor(name)
+ methodname = safe_accessor_name(name)
+ instance_eval <<-EOS
+ def #{methodname}
+ @data[@array.index(#{name.dump})]
+ end
+
+ def #{methodname}=(value)
+ @data[@array.index(#{name.dump})] = value
+ end
+ EOS
+ end
+ end
+
+ def safe_accessor_name(name)
+ "var_" << name.gsub(/[^a-zA-Z0-9_]/, '')
+ end
+end
+
+
+class SOAPArray < XSD::NSDBase
+ include SOAPCompoundtype
+ include Enumerable
+
+public
+
+ attr_accessor :sparse
+
+ attr_reader :offset, :rank
+ attr_accessor :size, :size_fixed
+ attr_reader :arytype
+
+ def initialize(type = nil, rank = 1, arytype = nil)
+ super()
+ @type = type || ValueArrayName
+ @rank = rank
+ @data = Array.new
+ @sparse = false
+ @offset = Array.new(rank, 0)
+ @size = Array.new(rank, 0)
+ @size_fixed = false
+ @position = nil
+ @arytype = arytype
+ end
+
+ def offset=(var)
+ @offset = var
+ @sparse = true
+ end
+
+ def add(value)
+ self[*(@offset)] = value
+ end
+
+ def [](*idxary)
+ if idxary.size != @rank
+ raise ArgumentError.new("given #{idxary.size} params does not match rank: #{@rank}")
+ end
+
+ retrieve(idxary)
+ end
+
+ def []=(*idxary)
+ value = idxary.slice!(-1)
+
+ if idxary.size != @rank
+ raise ArgumentError.new("given #{idxary.size} params(#{idxary})" +
+ " does not match rank: #{@rank}")
+ end
+
+ idx = 0
+ while idx < idxary.size
+ if idxary[idx] + 1 > @size[idx]
+ @size[idx] = idxary[idx] + 1
+ end
+ idx += 1
+ end
+
+ data = retrieve(idxary[0, idxary.size - 1])
+ data[idxary.last] = value
+
+ if value.is_a?(SOAPType)
+ value.elename = ITEM_NAME
+ # Sync type
+ unless @type.name
+ @type = XSD::QName.new(value.type.namespace,
+ SOAPArray.create_arytype(value.type.name, @rank))
+ end
+ value.type ||= @type
+ end
+
+ @offset = idxary
+ value.parent = self if value.respond_to?(:parent=)
+ offsetnext
+ end
+
+ def each
+ @data.each do |data|
+ yield(data)
+ end
+ end
+
+ def to_a
+ @data.dup
+ end
+
+ def replace
+ @data = deep_map(@data) do |ele|
+ yield(ele)
+ end
+ end
+
+ def deep_map(ary, &block)
+ ary.collect do |ele|
+ if ele.is_a?(Array)
+ deep_map(ele, &block)
+ else
+ new_obj = block.call(ele)
+ new_obj.elename = ITEM_NAME
+ new_obj
+ end
+ end
+ end
+
+ def include?(var)
+ traverse_data(@data) do |v, *rank|
+ if v.is_a?(SOAPBasetype) && v.data == var
+ return true
+ end
+ end
+ false
+ end
+
+ def traverse
+ traverse_data(@data) do |v, *rank|
+ unless @sparse
+ yield(v)
+ else
+ yield(v, *rank) if v && !v.is_a?(SOAPNil)
+ end
+ end
+ end
+
+ def soap2array(ary)
+ traverse_data(@data) do |v, *position|
+ iteary = ary
+ rank = 1
+ while rank < position.size
+ idx = position[rank - 1]
+ if iteary[idx].nil?
+ iteary = iteary[idx] = Array.new
+ else
+ iteary = iteary[idx]
+ end
+ rank += 1
+ end
+ if block_given?
+ iteary[position.last] = yield(v)
+ else
+ iteary[position.last] = v
+ end
+ end
+ end
+
+ def position
+ @position
+ end
+
+private
+
+ ITEM_NAME = XSD::QName.new(nil, 'item')
+
+ def retrieve(idxary)
+ data = @data
+ rank = 1
+ while rank <= idxary.size
+ idx = idxary[rank - 1]
+ if data[idx].nil?
+ data = data[idx] = Array.new
+ else
+ data = data[idx]
+ end
+ rank += 1
+ end
+ data
+ end
+
+ def traverse_data(data, rank = 1)
+ idx = 0
+ while idx < ranksize(rank)
+ if rank < @rank
+ traverse_data(data[idx], rank + 1) do |*v|
+ v[1, 0] = idx
+ yield(*v)
+ end
+ else
+ yield(data[idx], idx)
+ end
+ idx += 1
+ end
+ end
+
+ def ranksize(rank)
+ @size[rank - 1]
+ end
+
+ def offsetnext
+ move = false
+ idx = @offset.size - 1
+ while !move && idx >= 0
+ @offset[idx] += 1
+ if @size_fixed
+ if @offset[idx] < @size[idx]
+ move = true
+ else
+ @offset[idx] = 0
+ idx -= 1
+ end
+ else
+ move = true
+ end
+ end
+ end
+
+ # Module function
+
+public
+
+ def self.decode(elename, type, arytype)
+ typestr, nofary = parse_type(arytype.name)
+ rank = nofary.count(',') + 1
+ plain_arytype = XSD::QName.new(arytype.namespace, typestr)
+ o = SOAPArray.new(type, rank, plain_arytype)
+ size = []
+ nofary.split(',').each do |s|
+ if s.empty?
+ size.clear
+ break
+ else
+ size << s.to_i
+ end
+ end
+ unless size.empty?
+ o.size = size
+ o.size_fixed = true
+ end
+ o.elename = elename
+ o
+ end
+
+private
+
+ def self.create_arytype(typename, rank)
+ "#{typename}[" << ',' * (rank - 1) << ']'
+ end
+
+ TypeParseRegexp = Regexp.new('^(.+)\[([\d,]*)\]$')
+
+ def self.parse_type(string)
+ TypeParseRegexp =~ string
+ return $1, $2
+ end
+end
+
+
+require 'soap/mapping/typeMap'
+
+
+end
diff --git a/lib/soap/element.rb b/lib/soap/element.rb
new file mode 100644
index 0000000000..cc58b5d341
--- /dev/null
+++ b/lib/soap/element.rb
@@ -0,0 +1,258 @@
+# SOAP4R - SOAP elements library
+# Copyright (C) 2000, 2001, 2003-2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+require 'xsd/qname'
+require 'soap/baseData'
+
+
+module SOAP
+
+
+###
+## SOAP elements
+#
+module SOAPEnvelopeElement; end
+
+class SOAPFault < SOAPStruct
+ include SOAPEnvelopeElement
+ include SOAPCompoundtype
+
+public
+
+ def faultcode
+ self['faultcode']
+ end
+
+ def faultstring
+ self['faultstring']
+ end
+
+ def faultactor
+ self['faultactor']
+ end
+
+ def detail
+ self['detail']
+ end
+
+ def faultcode=(rhs)
+ self['faultcode'] = rhs
+ end
+
+ def faultstring=(rhs)
+ self['faultstring'] = rhs
+ end
+
+ def faultactor=(rhs)
+ self['faultactor'] = rhs
+ end
+
+ def detail=(rhs)
+ self['detail'] = rhs
+ end
+
+ def initialize(faultcode = nil, faultstring = nil, faultactor = nil, detail = nil)
+ super(EleFaultName)
+ @elename = EleFaultName
+ @encodingstyle = EncodingNamespace
+
+ if faultcode
+ self.faultcode = faultcode
+ self.faultstring = faultstring
+ self.faultactor = faultactor
+ self.detail = detail
+ self.faultcode.elename = EleFaultCodeName if self.faultcode
+ self.faultstring.elename = EleFaultStringName if self.faultstring
+ self.faultactor.elename = EleFaultActorName if self.faultactor
+ self.detail.elename = EleFaultDetailName if self.detail
+ end
+ faultcode.parent = self if faultcode
+ faultstring.parent = self if faultstring
+ faultactor.parent = self if faultactor
+ detail.parent = self if detail
+ end
+
+ def encode(generator, ns, attrs = {})
+ SOAPGenerator.assign_ns(attrs, ns, EnvelopeNamespace)
+ SOAPGenerator.assign_ns(attrs, ns, EncodingNamespace)
+ attrs[ns.name(AttrEncodingStyleName)] = EncodingNamespace
+ name = ns.name(@elename)
+ generator.encode_tag(name, attrs)
+ yield(self.faultcode)
+ yield(self.faultstring)
+ yield(self.faultactor)
+ yield(self.detail) if self.detail
+ generator.encode_tag_end(name, true)
+ end
+end
+
+
+class SOAPBody < SOAPStruct
+ include SOAPEnvelopeElement
+
+ def initialize(data = nil, is_fault = false)
+ super(nil)
+ @elename = EleBodyName
+ @encodingstyle = nil
+ if data
+ if data.respond_to?(:elename)
+ add(data.elename.name, data)
+ else
+ data.to_a.each do |datum|
+ add(datum.elename.name, datum)
+ end
+ end
+ end
+ @is_fault = is_fault
+ end
+
+ def encode(generator, ns, attrs = {})
+ name = ns.name(@elename)
+ generator.encode_tag(name, attrs)
+ if @is_fault
+ yield(@data)
+ else
+ @data.each do |data|
+ yield(data)
+ end
+ end
+ generator.encode_tag_end(name, true)
+ end
+
+ def root_node
+ @data.each do |node|
+ if node.root == 1
+ return node
+ end
+ end
+ # No specified root...
+ @data.each do |node|
+ if node.root != 0
+ return node
+ end
+ end
+
+ raise Parser::FormatDecodeError.new('no root element')
+ end
+end
+
+
+class SOAPHeaderItem < XSD::NSDBase
+ include SOAPEnvelopeElement
+ include SOAPCompoundtype
+
+public
+
+ attr_accessor :element
+ attr_accessor :mustunderstand
+ attr_accessor :encodingstyle
+
+ def initialize(element, mustunderstand = true, encodingstyle = nil)
+ super()
+ @type = nil
+ @element = element
+ @mustunderstand = mustunderstand
+ @encodingstyle = encodingstyle
+ element.parent = self if element
+ end
+
+ def encode(generator, ns, attrs = {})
+ attrs.each do |key, value|
+ @element.extraattr[key] = value
+ end
+ @element.extraattr[ns.name(AttrMustUnderstandName)] =
+ (@mustunderstand ? '1' : '0')
+ if @encodingstyle
+ @element.extraattr[ns.name(AttrEncodingStyleName)] = @encodingstyle
+ end
+ @element.encodingstyle = @encodingstyle if !@element.encodingstyle
+ yield(@element)
+ end
+end
+
+
+class SOAPHeader < SOAPStruct
+ include SOAPEnvelopeElement
+
+ def initialize
+ super(nil)
+ @elename = EleHeaderName
+ @encodingstyle = nil
+ end
+
+ def encode(generator, ns, attrs = {})
+ name = ns.name(@elename)
+ generator.encode_tag(name, attrs)
+ @data.each do |data|
+ yield(data)
+ end
+ generator.encode_tag_end(name, true)
+ end
+
+ def add(name, value)
+ mu = (value.extraattr[AttrMustUnderstandName] == '1')
+ encstyle = value.extraattr[AttrEncodingStyleName]
+ item = SOAPHeaderItem.new(value, mu, encstyle)
+ super(name, item)
+ end
+
+ def length
+ @data.length
+ end
+ alias size length
+end
+
+
+class SOAPEnvelope < XSD::NSDBase
+ include SOAPEnvelopeElement
+ include SOAPCompoundtype
+
+ attr_reader :header
+ attr_reader :body
+ attr_reader :external_content
+
+ def initialize(header = nil, body = nil)
+ super()
+ @type = nil
+ @elename = EleEnvelopeName
+ @encodingstyle = nil
+ @header = header
+ @body = body
+ @external_content = {}
+ header.parent = self if header
+ body.parent = self if body
+ end
+
+ def header=(header)
+ header.parent = self
+ @header = header
+ end
+
+ def body=(body)
+ body.parent = self
+ @body = body
+ end
+
+ def encode(generator, ns, attrs = {})
+ SOAPGenerator.assign_ns(attrs, ns, elename.namespace, SOAPNamespaceTag)
+ name = ns.name(@elename)
+ generator.encode_tag(name, attrs)
+
+ yield(@header) if @header and @header.length > 0
+ yield(@body)
+
+ generator.encode_tag_end(name, true)
+ end
+
+ def to_ary
+ [header, body]
+ end
+end
+
+
+end
diff --git a/lib/soap/encodingstyle/aspDotNetHandler.rb b/lib/soap/encodingstyle/aspDotNetHandler.rb
new file mode 100644
index 0000000000..fd7e0fa217
--- /dev/null
+++ b/lib/soap/encodingstyle/aspDotNetHandler.rb
@@ -0,0 +1,213 @@
+# SOAP4R - ASP.NET EncodingStyle handler library
+# Copyright (C) 2001, 2003, 2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+require 'soap/encodingstyle/handler'
+
+
+module SOAP
+module EncodingStyle
+
+
+class ASPDotNetHandler < Handler
+ Namespace = 'http://tempuri.org/ASP.NET'
+ add_handler
+
+ def initialize(charset = nil)
+ super(charset)
+ @textbuf = ''
+ @decode_typemap = nil
+ end
+
+
+ ###
+ ## encode interface.
+ #
+ def encode_data(generator, ns, data, parent)
+ attrs = {}
+ # ASPDotNetHandler is intended to be used for accessing an ASP.NET doc/lit
+ # service as an rpc/encoded service. in the situation, local elements
+ # should be qualified. propagate parent's namespace to children.
+ if data.elename.namespace.nil?
+ data.elename.namespace = parent.elename.namespace
+ end
+ name = generator.encode_name(ns, data, attrs)
+ case data
+ when SOAPRawString
+ generator.encode_tag(name, attrs)
+ generator.encode_rawstring(data.to_s)
+ when XSD::XSDString
+ generator.encode_tag(name, attrs)
+ generator.encode_string(@charset ?
+ XSD::Charset.encoding_to_xml(data.to_s, @charset) : data.to_s)
+ when XSD::XSDAnySimpleType
+ generator.encode_tag(name, attrs)
+ generator.encode_string(data.to_s)
+ when SOAPStruct
+ generator.encode_tag(name, attrs)
+ data.each do |key, value|
+ generator.encode_child(ns, value, data)
+ end
+ when SOAPArray
+ generator.encode_tag(name, attrs)
+ data.traverse do |child, *rank|
+ data.position = nil
+ generator.encode_child(ns, child, data)
+ end
+ else
+ raise EncodingStyleError.new(
+ "unknown object:#{data} in this encodingStyle")
+ end
+ end
+
+ def encode_data_end(generator, ns, data, parent)
+ name = generator.encode_name_end(ns, data)
+ cr = data.is_a?(SOAPCompoundtype)
+ generator.encode_tag_end(name, cr)
+ end
+
+
+ ###
+ ## decode interface.
+ #
+ class SOAPTemporalObject
+ attr_accessor :parent
+
+ def initialize
+ @parent = nil
+ end
+ end
+
+ class SOAPUnknown < SOAPTemporalObject
+ def initialize(handler, elename)
+ super()
+ @handler = handler
+ @elename = elename
+ end
+
+ def as_struct
+ o = SOAPStruct.decode(@elename, XSD::AnyTypeName)
+ o.parent = @parent
+ o.type.name = @name
+ @handler.decode_parent(@parent, o)
+ o
+ end
+
+ def as_string
+ o = SOAPString.decode(@elename)
+ o.parent = @parent
+ @handler.decode_parent(@parent, o)
+ o
+ end
+
+ def as_nil
+ o = SOAPNil.decode(@elename)
+ o.parent = @parent
+ @handler.decode_parent(@parent, o)
+ o
+ end
+ end
+
+ def decode_tag(ns, elename, attrs, parent)
+ @textbuf = ''
+ o = SOAPUnknown.new(self, elename)
+ o.parent = parent
+ o
+ end
+
+ def decode_tag_end(ns, node)
+ o = node.node
+ if o.is_a?(SOAPUnknown)
+ newnode = o.as_string
+# if /\A\s*\z/ =~ @textbuf
+# o.as_struct
+# else
+# o.as_string
+# end
+ node.replace_node(newnode)
+ o = node.node
+ end
+
+ decode_textbuf(o)
+ @textbuf = ''
+ end
+
+ def decode_text(ns, text)
+ # @textbuf is set at decode_tag_end.
+ @textbuf << text
+ end
+
+ def decode_prologue
+ end
+
+ def decode_epilogue
+ end
+
+ def decode_parent(parent, node)
+ case parent.node
+ when SOAPUnknown
+ newparent = parent.node.as_struct
+ node.parent = newparent
+ parent.replace_node(newparent)
+ decode_parent(parent, node)
+
+ when SOAPStruct
+ data = parent.node[node.elename.name]
+ case data
+ when nil
+ parent.node.add(node.elename.name, node)
+ when SOAPArray
+ name, type_ns = node.elename.name, node.type.namespace
+ data.add(node)
+ node.elename, node.type.namespace = name, type_ns
+ else
+ parent.node[node.elename.name] = SOAPArray.new
+ name, type_ns = data.elename.name, data.type.namespace
+ parent.node[node.elename.name].add(data)
+ data.elename.name, data.type.namespace = name, type_ns
+ name, type_ns = node.elename.name, node.type.namespace
+ parent.node[node.elename.name].add(node)
+ node.elename.name, node.type.namespace = name, type_ns
+ end
+
+ when SOAPArray
+ if node.position
+ parent.node[*(decode_arypos(node.position))] = node
+ parent.node.sparse = true
+ else
+ parent.node.add(node)
+ end
+
+ when SOAPBasetype
+ raise EncodingStyleError.new("SOAP base type must not have a child")
+
+ else
+ # SOAPUnknown does not have parent.
+ # raise EncodingStyleError.new("illegal parent: #{parent}")
+ end
+ end
+
+private
+
+ def decode_textbuf(node)
+ if node.is_a?(XSD::XSDString)
+ if @charset
+ node.set(XSD::Charset.encoding_from_xml(@textbuf, @charset))
+ else
+ node.set(@textbuf)
+ end
+ else
+ # Nothing to do...
+ end
+ end
+end
+
+ASPDotNetHandler.new
+
+
+end
+end
diff --git a/lib/soap/encodingstyle/handler.rb b/lib/soap/encodingstyle/handler.rb
new file mode 100644
index 0000000000..c015417435
--- /dev/null
+++ b/lib/soap/encodingstyle/handler.rb
@@ -0,0 +1,100 @@
+# SOAP4R - EncodingStyle handler library
+# Copyright (C) 2001, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+require 'soap/soap'
+require 'soap/baseData'
+require 'soap/element'
+
+
+module SOAP
+module EncodingStyle
+
+
+class Handler
+ @@handlers = {}
+
+ class EncodingStyleError < Error; end
+
+ class << self
+ def uri
+ self::Namespace
+ end
+
+ def handler(uri)
+ @@handlers[uri]
+ end
+
+ def each
+ @@handlers.each do |key, value|
+ yield(value)
+ end
+ end
+
+ private
+
+ def add_handler
+ @@handlers[self.uri] = self
+ end
+ end
+
+ attr_reader :charset
+ attr_accessor :generate_explicit_type
+ def decode_typemap=(definedtypes)
+ @decode_typemap = definedtypes
+ end
+
+ def initialize(charset)
+ @charset = charset
+ @generate_explicit_type = true
+ @decode_typemap = nil
+ end
+
+ ###
+ ## encode interface.
+ #
+ # Returns a XML instance as a string.
+ def encode_data(generator, ns, data, parent)
+ raise NotImplementError
+ end
+
+ def encode_data_end(generator, ns, data, parent)
+ raise NotImplementError
+ end
+
+ def encode_prologue
+ end
+
+ def encode_epilogue
+ end
+
+ ###
+ ## decode interface.
+ #
+ # Returns SOAP/OM data.
+ def decode_tag(ns, name, attrs, parent)
+ raise NotImplementError.new('Method decode_tag must be defined in derived class.')
+ end
+
+ def decode_tag_end(ns, name)
+ raise NotImplementError.new('Method decode_tag_end must be defined in derived class.')
+ end
+
+ def decode_text(ns, text)
+ raise NotImplementError.new('Method decode_text must be defined in derived class.')
+ end
+
+ def decode_prologue
+ end
+
+ def decode_epilogue
+ end
+end
+
+
+end
+end
diff --git a/lib/soap/encodingstyle/literalHandler.rb b/lib/soap/encodingstyle/literalHandler.rb
new file mode 100644
index 0000000000..59c7205366
--- /dev/null
+++ b/lib/soap/encodingstyle/literalHandler.rb
@@ -0,0 +1,226 @@
+# SOAP4R - XML Literal EncodingStyle handler library
+# Copyright (C) 2001, 2003-2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+require 'soap/encodingstyle/handler'
+
+
+module SOAP
+module EncodingStyle
+
+
+class LiteralHandler < Handler
+ Namespace = SOAP::LiteralNamespace
+ add_handler
+
+ def initialize(charset = nil)
+ super(charset)
+ @textbuf = ''
+ end
+
+
+ ###
+ ## encode interface.
+ #
+ def encode_data(generator, ns, data, parent)
+ attrs = {}
+ name = generator.encode_name(ns, data, attrs)
+ data.extraattr.each do |k, v|
+ # ToDo: check generator.attributeformdefault here
+ if k.is_a?(XSD::QName)
+ if k.namespace
+ SOAPGenerator.assign_ns(attrs, ns, k.namespace)
+ k = ns.name(k)
+ else
+ k = k.name
+ end
+ end
+ attrs[k] = v
+ end
+ case data
+ when SOAPRawString
+ generator.encode_tag(name, attrs)
+ generator.encode_rawstring(data.to_s)
+ when XSD::XSDString
+ generator.encode_tag(name, attrs)
+ str = data.to_s
+ str = XSD::Charset.encoding_to_xml(str, @charset) if @charset
+ generator.encode_string(str)
+ when XSD::XSDAnySimpleType
+ generator.encode_tag(name, attrs)
+ generator.encode_string(data.to_s)
+ when SOAPStruct
+ generator.encode_tag(name, attrs)
+ data.each do |key, value|
+ generator.encode_child(ns, value, data)
+ end
+ when SOAPArray
+ generator.encode_tag(name, attrs)
+ data.traverse do |child, *rank|
+ data.position = nil
+ generator.encode_child(ns, child, data)
+ end
+ when SOAPElement
+ # passes 2 times for simplifying namespace definition
+ data.each do |key, value|
+ if value.elename.namespace
+ SOAPGenerator.assign_ns(attrs, ns, value.elename.namespace)
+ end
+ end
+ generator.encode_tag(name, attrs)
+ generator.encode_rawstring(data.text) if data.text
+ data.each do |key, value|
+ generator.encode_child(ns, value, data)
+ end
+ else
+ raise EncodingStyleError.new(
+ "unknown object:#{data} in this encodingStyle")
+ end
+ end
+
+ def encode_data_end(generator, ns, data, parent)
+ name = generator.encode_name_end(ns, data)
+ cr = (data.is_a?(SOAPCompoundtype) or
+ (data.is_a?(SOAPElement) and !data.text))
+ generator.encode_tag_end(name, cr)
+ end
+
+
+ ###
+ ## decode interface.
+ #
+ class SOAPTemporalObject
+ attr_accessor :parent
+
+ def initialize
+ @parent = nil
+ end
+ end
+
+ class SOAPUnknown < SOAPTemporalObject
+ def initialize(handler, elename, extraattr)
+ super()
+ @handler = handler
+ @elename = elename
+ @extraattr = extraattr
+ end
+
+ def as_element
+ o = SOAPElement.decode(@elename)
+ o.parent = @parent
+ o.extraattr.update(@extraattr)
+ @handler.decode_parent(@parent, o)
+ o
+ end
+
+ def as_string
+ o = SOAPString.decode(@elename)
+ o.parent = @parent
+ o.extraattr.update(@extraattr)
+ @handler.decode_parent(@parent, o)
+ o
+ end
+
+ def as_nil
+ o = SOAPNil.decode(@elename)
+ o.parent = @parent
+ o.extraattr.update(@extraattr)
+ @handler.decode_parent(@parent, o)
+ o
+ end
+ end
+
+ def decode_tag(ns, elename, attrs, parent)
+ @textbuf = ''
+ o = SOAPUnknown.new(self, elename, decode_attrs(ns, attrs))
+ o.parent = parent
+ o
+ end
+
+ def decode_tag_end(ns, node)
+ o = node.node
+ if o.is_a?(SOAPUnknown)
+ newnode = if /\A\s*\z/ =~ @textbuf
+ o.as_element
+ else
+ o.as_string
+ end
+ node.replace_node(newnode)
+ o = node.node
+ end
+
+ decode_textbuf(o)
+ @textbuf = ''
+ end
+
+ def decode_text(ns, text)
+ # @textbuf is set at decode_tag_end.
+ @textbuf << text
+ end
+
+ def decode_attrs(ns, attrs)
+ extraattr = {}
+ attrs.each do |key, value|
+ qname = ns.parse_local(key)
+ extraattr[qname] = value
+ end
+ extraattr
+ end
+
+ def decode_prologue
+ end
+
+ def decode_epilogue
+ end
+
+ def decode_parent(parent, node)
+ return unless parent.node
+ case parent.node
+ when SOAPUnknown
+ newparent = parent.node.as_element
+ node.parent = newparent
+ parent.replace_node(newparent)
+ decode_parent(parent, node)
+ when SOAPElement
+ parent.node.add(node)
+ node.parent = parent.node
+ when SOAPStruct
+ parent.node.add(node.elename.name, node)
+ node.parent = parent.node
+ when SOAPArray
+ if node.position
+ parent.node[*(decode_arypos(node.position))] = node
+ parent.node.sparse = true
+ else
+ parent.node.add(node)
+ end
+ node.parent = parent.node
+ else
+ raise EncodingStyleError.new("illegal parent: #{parent.node}")
+ end
+ end
+
+private
+
+ def decode_textbuf(node)
+ if node.is_a?(XSD::XSDString)
+ if @charset
+ node.set(XSD::Charset.encoding_from_xml(@textbuf, @charset))
+ else
+ node.set(@textbuf)
+ end
+ else
+ # Nothing to do...
+ end
+ end
+end
+
+LiteralHandler.new
+
+
+end
+end
diff --git a/lib/soap/encodingstyle/soapHandler.rb b/lib/soap/encodingstyle/soapHandler.rb
new file mode 100644
index 0000000000..a522392625
--- /dev/null
+++ b/lib/soap/encodingstyle/soapHandler.rb
@@ -0,0 +1,582 @@
+# SOAP4R - SOAP EncodingStyle handler library
+# Copyright (C) 2001, 2003, 2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+require 'soap/encodingstyle/handler'
+
+
+module SOAP
+module EncodingStyle
+
+
+class SOAPHandler < Handler
+ Namespace = SOAP::EncodingNamespace
+ add_handler
+
+ def initialize(charset = nil)
+ super(charset)
+ @refpool = []
+ @idpool = []
+ @textbuf = ''
+ @is_first_top_ele = true
+ end
+
+
+ ###
+ ## encode interface.
+ #
+ def encode_data(generator, ns, data, parent)
+ attrs = encode_attrs(generator, ns, data, parent)
+ if parent && parent.is_a?(SOAPArray) && parent.position
+ attrs[ns.name(AttrPositionName)] = "[#{parent.position.join(',')}]"
+ end
+ name = generator.encode_name(ns, data, attrs)
+ case data
+ when SOAPReference
+ attrs['href'] = data.refidstr
+ generator.encode_tag(name, attrs)
+ when SOAPExternalReference
+ data.referred
+ attrs['href'] = data.refidstr
+ generator.encode_tag(name, attrs)
+ when SOAPRawString
+ generator.encode_tag(name, attrs)
+ generator.encode_rawstring(data.to_s)
+ when XSD::XSDString
+ generator.encode_tag(name, attrs)
+ generator.encode_string(@charset ?
+ XSD::Charset.encoding_to_xml(data.to_s, @charset) : data.to_s)
+ when XSD::XSDAnySimpleType
+ generator.encode_tag(name, attrs)
+ generator.encode_string(data.to_s)
+ when SOAPStruct
+ generator.encode_tag(name, attrs)
+ data.each do |key, value|
+ generator.encode_child(ns, value, data)
+ end
+ when SOAPArray
+ generator.encode_tag(name, attrs)
+ data.traverse do |child, *rank|
+ data.position = data.sparse ? rank : nil
+ generator.encode_child(ns, child, data)
+ end
+ else
+ raise EncodingStyleError.new(
+ "unknown object:#{data} in this encodingStyle")
+ end
+ end
+
+ def encode_data_end(generator, ns, data, parent)
+ name = generator.encode_name_end(ns, data)
+ cr = data.is_a?(SOAPCompoundtype)
+ generator.encode_tag_end(name, cr)
+ end
+
+
+ ###
+ ## decode interface.
+ #
+ class SOAPTemporalObject
+ attr_accessor :parent
+ attr_accessor :position
+ attr_accessor :id
+ attr_accessor :root
+
+ def initialize
+ @parent = nil
+ @position = nil
+ @id = nil
+ @root = nil
+ end
+ end
+
+ class SOAPUnknown < SOAPTemporalObject
+ attr_reader :type
+ attr_accessor :definedtype
+ attr_reader :extraattr
+
+ def initialize(handler, elename, type, extraattr)
+ super()
+ @handler = handler
+ @elename = elename
+ @type = type
+ @extraattr = extraattr
+ @definedtype = nil
+ end
+
+ def as_struct
+ o = SOAPStruct.decode(@elename, @type)
+ o.id = @id
+ o.root = @root
+ o.parent = @parent
+ o.position = @position
+ o.extraattr.update(@extraattr)
+ @handler.decode_parent(@parent, o)
+ o
+ end
+
+ def as_string
+ o = SOAPString.decode(@elename)
+ o.id = @id
+ o.root = @root
+ o.parent = @parent
+ o.position = @position
+ o.extraattr.update(@extraattr)
+ @handler.decode_parent(@parent, o)
+ o
+ end
+
+ def as_nil
+ o = SOAPNil.decode(@elename)
+ o.id = @id
+ o.root = @root
+ o.parent = @parent
+ o.position = @position
+ o.extraattr.update(@extraattr)
+ @handler.decode_parent(@parent, o)
+ o
+ end
+ end
+
+ def decode_tag(ns, elename, attrs, parent)
+ @textbuf = ''
+ is_nil, type, arytype, root, offset, position, href, id, extraattr =
+ decode_attrs(ns, attrs)
+ o = nil
+ if is_nil
+ o = SOAPNil.decode(elename)
+ elsif href
+ o = SOAPReference.decode(elename, href)
+ @refpool << o
+ elsif @decode_typemap
+ o = decode_tag_by_wsdl(ns, elename, type, parent.node, arytype, extraattr)
+ else
+ o = decode_tag_by_type(ns, elename, type, parent.node, arytype, extraattr)
+ end
+
+ if o.is_a?(SOAPArray)
+ if offset
+ o.offset = decode_arypos(offset)
+ o.sparse = true
+ else
+ o.sparse = false
+ end
+ end
+
+ o.parent = parent
+ o.id = id
+ o.root = root
+ o.position = position
+
+ unless o.is_a?(SOAPTemporalObject)
+ @idpool << o if o.id
+ decode_parent(parent, o)
+ end
+ o
+ end
+
+ def decode_tag_end(ns, node)
+ o = node.node
+ if o.is_a?(SOAPUnknown)
+ newnode = if /\A\s*\z/ =~ @textbuf
+ o.as_struct
+ else
+ o.as_string
+ end
+ if newnode.id
+ @idpool << newnode
+ end
+ node.replace_node(newnode)
+ o = node.node
+ end
+ decode_textbuf(o)
+ # unlink definedtype
+ o.definedtype = nil
+ end
+
+ def decode_text(ns, text)
+ @textbuf << text
+ end
+
+ def decode_prologue
+ @refpool.clear
+ @idpool.clear
+ @is_first_top_ele = true
+ end
+
+ def decode_epilogue
+ decode_resolve_id
+ end
+
+ def decode_parent(parent, node)
+ return unless parent.node
+ case parent.node
+ when SOAPUnknown
+ newparent = parent.node.as_struct
+ node.parent = newparent
+ if newparent.id
+ @idpool << newparent
+ end
+ parent.replace_node(newparent)
+ decode_parent(parent, node)
+ when SOAPStruct
+ parent.node.add(node.elename.name, node)
+ node.parent = parent.node
+ when SOAPArray
+ if node.position
+ parent.node[*(decode_arypos(node.position))] = node
+ parent.node.sparse = true
+ else
+ parent.node.add(node)
+ end
+ node.parent = parent.node
+ else
+ raise EncodingStyleError.new("illegal parent: #{parent.node}")
+ end
+ end
+
+private
+
+ def content_ranksize(typename)
+ typename.scan(/\[[\d,]*\]$/)[0]
+ end
+
+ def content_typename(typename)
+ typename.sub(/\[,*\]$/, '')
+ end
+
+ def create_arytype(ns, data)
+ XSD::QName.new(data.arytype.namespace,
+ content_typename(data.arytype.name) + "[#{data.size.join(',')}]")
+ end
+
+ def encode_attrs(generator, ns, data, parent)
+ attrs = {}
+ return attrs if data.is_a?(SOAPReference)
+
+ if !parent || parent.encodingstyle != EncodingNamespace
+ if @generate_explicit_type
+ SOAPGenerator.assign_ns(attrs, ns, EnvelopeNamespace)
+ attrs[ns.name(AttrEncodingStyleName)] = EncodingNamespace
+ end
+ data.encodingstyle = EncodingNamespace
+ end
+
+ if data.is_a?(SOAPNil)
+ attrs[ns.name(XSD::AttrNilName)] = XSD::NilValue
+ elsif @generate_explicit_type
+ if data.type.namespace
+ SOAPGenerator.assign_ns(attrs, ns, data.type.namespace)
+ end
+ if data.is_a?(SOAPArray)
+ if data.arytype.namespace
+ SOAPGenerator.assign_ns(attrs, ns, data.arytype.namespace)
+ end
+ SOAPGenerator.assign_ns(attrs, ns, EncodingNamespace)
+ attrs[ns.name(AttrArrayTypeName)] = ns.name(create_arytype(ns, data))
+ if data.type.name
+ attrs[ns.name(XSD::AttrTypeName)] = ns.name(data.type)
+ end
+ elsif parent && parent.is_a?(SOAPArray) && (parent.arytype == data.type)
+ # No need to add.
+ elsif !data.type.namespace
+ # No need to add.
+ else
+ attrs[ns.name(XSD::AttrTypeName)] = ns.name(data.type)
+ end
+ end
+
+ data.extraattr.each do |key, value|
+ SOAPGenerator.assign_ns(attrs, ns, key.namespace)
+ attrs[ns.name(key)] = encode_attr_value(generator, ns, key, value)
+ end
+ if data.id
+ attrs['id'] = data.id
+ end
+ attrs
+ end
+
+ def encode_attr_value(generator, ns, qname, value)
+ if value.is_a?(SOAPType)
+ ref = SOAPReference.new(value)
+ generator.add_reftarget(qname.name, value)
+ ref.refidstr
+ else
+ value.to_s
+ end
+ end
+
+ def decode_tag_by_wsdl(ns, elename, typestr, parent, arytypestr, extraattr)
+ o = nil
+ if parent.class == SOAPBody
+ # root element: should branch by root attribute?
+ if @is_first_top_ele
+ # Unqualified name is allowed here.
+ @is_first_top_ele = false
+ type = @decode_typemap[elename] ||
+ @decode_typemap.find_name(elename.name)
+ if type
+ o = SOAPStruct.new(elename)
+ o.definedtype = type
+ return o
+ end
+ end
+ # multi-ref element.
+ if typestr
+ typename = ns.parse(typestr)
+ typedef = @decode_typemap[typename]
+ if typedef
+ return decode_definedtype(elename, typename, typedef, arytypestr)
+ end
+ end
+ return decode_tag_by_type(ns, elename, typestr, parent, arytypestr,
+ extraattr)
+ end
+
+ if parent.type == XSD::AnyTypeName
+ return decode_tag_by_type(ns, elename, typestr, parent, arytypestr,
+ extraattr)
+ end
+
+ # parent.definedtype == nil means the parent is SOAPUnknown. SOAPUnknown
+ # is generated by decode_tag_by_type when its type is anyType.
+ parenttype = parent.definedtype || @decode_typemap[parent.type]
+ unless parenttype
+ return decode_tag_by_type(ns, elename, typestr, parent, arytypestr,
+ extraattr)
+ end
+
+ definedtype_name = parenttype.child_type(elename)
+ if definedtype_name and (klass = TypeMap[definedtype_name])
+ return decode_basetype(klass, elename)
+ elsif definedtype_name == XSD::AnyTypeName
+ return decode_tag_by_type(ns, elename, typestr, parent, arytypestr,
+ extraattr)
+ end
+
+ if definedtype_name
+ typedef = @decode_typemap[definedtype_name]
+ else
+ typedef = parenttype.child_defined_complextype(elename)
+ end
+ decode_definedtype(elename, definedtype_name, typedef, arytypestr)
+ end
+
+ def decode_definedtype(elename, typename, typedef, arytypestr)
+ unless typedef
+ raise EncodingStyleError.new("unknown type '#{typename}'")
+ end
+ if typedef.is_a?(::WSDL::XMLSchema::SimpleType)
+ decode_defined_simpletype(elename, typename, typedef, arytypestr)
+ else
+ decode_defined_complextype(elename, typename, typedef, arytypestr)
+ end
+ end
+
+ def decode_basetype(klass, elename)
+ klass.decode(elename)
+ end
+
+ def decode_defined_simpletype(elename, typename, typedef, arytypestr)
+ o = decode_basetype(TypeMap[typedef.base], elename)
+ o.definedtype = typedef
+ o
+ end
+
+ def decode_defined_complextype(elename, typename, typedef, arytypestr)
+ case typedef.compoundtype
+ when :TYPE_STRUCT, :TYPE_MAP
+ o = SOAPStruct.decode(elename, typename)
+ o.definedtype = typedef
+ return o
+ when :TYPE_ARRAY
+ expected_arytype = typedef.find_arytype
+ if arytypestr
+ actual_arytype = XSD::QName.new(expected_arytype.namespace,
+ content_typename(expected_arytype.name) <<
+ content_ranksize(arytypestr))
+ o = SOAPArray.decode(elename, typename, actual_arytype)
+ else
+ o = SOAPArray.new(typename, 1, expected_arytype)
+ o.elename = elename
+ end
+ o.definedtype = typedef
+ return o
+ when :TYPE_EMPTY
+ o = SOAPNil.decode(elename)
+ o.definedtype = typedef
+ return o
+ else
+ raise RuntimeError.new(
+ "Unknown kind of complexType: #{typedef.compoundtype}")
+ end
+ nil
+ end
+
+ def decode_tag_by_type(ns, elename, typestr, parent, arytypestr, extraattr)
+ if arytypestr
+ type = typestr ? ns.parse(typestr) : ValueArrayName
+ node = SOAPArray.decode(elename, type, ns.parse(arytypestr))
+ node.extraattr.update(extraattr)
+ return node
+ end
+
+ type = nil
+ if typestr
+ type = ns.parse(typestr)
+ elsif parent.is_a?(SOAPArray)
+ type = parent.arytype
+ else
+ # Since it's in dynamic(without any type) encoding process,
+ # assumes entity as its type itself.
+ # <SOAP-ENC:Array ...> => type Array in SOAP-ENC.
+ # <Country xmlns="foo"> => type Country in foo.
+ type = elename
+ end
+
+ if (klass = TypeMap[type])
+ node = decode_basetype(klass, elename)
+ node.extraattr.update(extraattr)
+ return node
+ end
+
+ # Unknown type... Struct or String
+ SOAPUnknown.new(self, elename, type, extraattr)
+ end
+
+ def decode_textbuf(node)
+ case node
+ when XSD::XSDHexBinary, XSD::XSDBase64Binary
+ node.set_encoded(@textbuf)
+ when XSD::XSDString
+ if @charset
+ @textbuf = XSD::Charset.encoding_from_xml(@textbuf, @charset)
+ end
+ if node.definedtype
+ node.definedtype.check_lexical_format(@textbuf)
+ end
+ node.set(@textbuf)
+ when SOAPNil
+ # Nothing to do.
+ when SOAPBasetype
+ node.set(@textbuf)
+ else
+ # Nothing to do...
+ end
+ @textbuf = ''
+ end
+
+ NilLiteralMap = {
+ 'true' => true,
+ '1' => true,
+ 'false' => false,
+ '0' => false
+ }
+ RootLiteralMap = {
+ '1' => 1,
+ '0' => 0
+ }
+ def decode_attrs(ns, attrs)
+ is_nil = false
+ type = nil
+ arytype = nil
+ root = nil
+ offset = nil
+ position = nil
+ href = nil
+ id = nil
+ extraattr = {}
+
+ attrs.each do |key, value|
+ qname = ns.parse(key)
+ case qname.namespace
+ when XSD::InstanceNamespace
+ case qname.name
+ when XSD::NilLiteral
+ is_nil = NilLiteralMap[value] or
+ raise EncodingStyleError.new("cannot accept attribute value: #{value} as the value of xsi:#{XSD::NilLiteral} (expected 'true', 'false', '1', or '0')")
+ next
+ when XSD::AttrType
+ type = value
+ next
+ end
+ when EncodingNamespace
+ case qname.name
+ when AttrArrayType
+ arytype = value
+ next
+ when AttrRoot
+ root = RootLiteralMap[value] or
+ raise EncodingStyleError.new(
+ "illegal root attribute value: #{value}")
+ next
+ when AttrOffset
+ offset = value
+ next
+ when AttrPosition
+ position = value
+ next
+ end
+ end
+ if key == 'href'
+ href = value
+ next
+ elsif key == 'id'
+ id = value
+ next
+ end
+ qname = ns.parse_local(key)
+ extraattr[qname] = decode_attr_value(ns, qname, value)
+ end
+
+ return is_nil, type, arytype, root, offset, position, href, id, extraattr
+ end
+
+ def decode_attr_value(ns, qname, value)
+ if /\A#/ =~ value
+ o = SOAPReference.decode(nil, value)
+ @refpool << o
+ o
+ else
+ value
+ end
+ end
+
+ def decode_arypos(position)
+ /^\[(.+)\]$/ =~ position
+ $1.split(',').collect { |s| s.to_i }
+ end
+
+ def decode_resolve_id
+ count = @refpool.length # To avoid infinite loop
+ while !@refpool.empty? && count > 0
+ @refpool = @refpool.find_all { |ref|
+ o = @idpool.find { |item|
+ item.id == ref.refid
+ }
+ if o.is_a?(SOAPReference)
+ true # link of link.
+ elsif o
+ ref.__setobj__(o)
+ false
+ elsif o = ref.rootnode.external_content[ref.refid]
+ ref.__setobj__(o)
+ false
+ else
+ raise EncodingStyleError.new("unresolved reference: #{ref.refid}")
+ end
+ }
+ count -= 1
+ end
+ end
+end
+
+SOAPHandler.new
+
+
+end
+end
diff --git a/lib/soap/generator.rb b/lib/soap/generator.rb
new file mode 100644
index 0000000000..f179555e1d
--- /dev/null
+++ b/lib/soap/generator.rb
@@ -0,0 +1,268 @@
+# SOAP4R - SOAP XML Instance Generator library.
+# Copyright (C) 2001, 2003, 2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+require 'xsd/ns'
+require 'soap/soap'
+require 'soap/baseData'
+require 'soap/encodingstyle/handler'
+
+
+module SOAP
+
+
+###
+## CAUTION: MT-unsafe
+#
+class SOAPGenerator
+ include SOAP
+
+ class FormatEncodeError < Error; end
+
+public
+
+ attr_accessor :charset
+ attr_accessor :default_encodingstyle
+ attr_accessor :generate_explicit_type
+ attr_accessor :use_numeric_character_reference
+
+ def initialize(opt = {})
+ @reftarget = nil
+ @handlers = {}
+ @charset = opt[:charset] || XSD::Charset.xml_encoding_label
+ @default_encodingstyle = opt[:default_encodingstyle] || EncodingNamespace
+ @generate_explicit_type =
+ opt.key?(:generate_explicit_type) ? opt[:generate_explicit_type] : true
+ @elementformdefault = opt[:elementformdefault]
+ @attributeformdefault = opt[:attributeformdefault]
+ @use_numeric_character_reference = opt[:use_numeric_character_reference]
+ @indentstr = opt[:no_indent] ? '' : ' '
+ @buf = @indent = @curr = nil
+ end
+
+ def generate(obj, io = nil)
+ @buf = io || ''
+ @indent = ''
+
+ prologue
+ @handlers.each do |uri, handler|
+ handler.encode_prologue
+ end
+
+ ns = XSD::NS.new
+ @buf << xmldecl
+ encode_data(ns, obj, nil)
+
+ @handlers.each do |uri, handler|
+ handler.encode_epilogue
+ end
+ epilogue
+
+ @buf
+ end
+
+ def encode_data(ns, obj, parent)
+ if obj.is_a?(SOAPEnvelopeElement)
+ encode_element(ns, obj, parent)
+ return
+ end
+ if @reftarget && !obj.precedents.empty?
+ add_reftarget(obj.elename.name, obj)
+ ref = SOAPReference.new(obj)
+ ref.elename = ref.elename.dup_name(obj.elename.name)
+ obj.precedents.clear # Avoid cyclic delay.
+ obj.encodingstyle = parent.encodingstyle
+ # SOAPReference is encoded here.
+ obj = ref
+ end
+ encodingstyle = obj.encodingstyle
+ # Children's encodingstyle is derived from its parent.
+ encodingstyle ||= parent.encodingstyle if parent
+ obj.encodingstyle = encodingstyle
+ handler = find_handler(encodingstyle || @default_encodingstyle)
+ unless handler
+ raise FormatEncodeError.new("Unknown encodingStyle: #{ encodingstyle }.")
+ end
+ if !obj.elename.name
+ raise FormatEncodeError.new("Element name not defined: #{ obj }.")
+ end
+ handler.encode_data(self, ns, obj, parent)
+ handler.encode_data_end(self, ns, obj, parent)
+ end
+
+ def add_reftarget(name, node)
+ unless @reftarget
+ raise FormatEncodeError.new("Reftarget is not defined.")
+ end
+ @reftarget.add(name, node)
+ end
+
+ def encode_child(ns, child, parent)
+ indent_backup, @indent = @indent, @indent + @indentstr
+ encode_data(ns.clone_ns, child, parent)
+ @indent = indent_backup
+ end
+
+ def encode_element(ns, obj, parent)
+ attrs = {}
+ if obj.is_a?(SOAPBody)
+ @reftarget = obj
+ obj.encode(self, ns, attrs) do |child|
+ indent_backup, @indent = @indent, @indent + @indentstr
+ encode_data(ns.clone_ns, child, obj)
+ @indent = indent_backup
+ end
+ @reftarget = nil
+ else
+ if obj.is_a?(SOAPEnvelope)
+ # xsi:nil="true" can appear even if dumping without explicit type.
+ SOAPGenerator.assign_ns(attrs, ns,
+ XSD::InstanceNamespace, XSINamespaceTag)
+ if @generate_explicit_type
+ SOAPGenerator.assign_ns(attrs, ns, XSD::Namespace, XSDNamespaceTag)
+ end
+ end
+ obj.encode(self, ns, attrs) do |child|
+ indent_backup, @indent = @indent, @indent + @indentstr
+ encode_data(ns.clone_ns, child, obj)
+ @indent = indent_backup
+ end
+ end
+ end
+
+ def encode_name(ns, data, attrs)
+ if element_local?(data)
+ data.elename.name
+ else
+ if element_qualified?(data)
+ SOAPGenerator.assign_ns(attrs, ns, data.elename.namespace, '')
+ else
+ SOAPGenerator.assign_ns(attrs, ns, data.elename.namespace)
+ end
+ ns.name(data.elename)
+ end
+ end
+
+ def encode_name_end(ns, data)
+ if element_local?(data)
+ data.elename.name
+ else
+ ns.name(data.elename)
+ end
+ end
+
+ def encode_tag(elename, attrs = nil)
+ if !attrs or attrs.empty?
+ @buf << "\n#{ @indent }<#{ elename }>"
+ elsif attrs.size == 1
+ key, value = attrs.shift
+ @buf << %Q[\n#{ @indent }<#{ elename } #{ key }="#{ value }">]
+ else
+ @buf << "\n#{ @indent }<#{ elename } " <<
+ attrs.collect { |key, value|
+ %Q[#{ key }="#{ value }"]
+ }.join("\n#{ @indent }#{ @indentstr * 2 }") <<
+ '>'
+ end
+ end
+
+ def encode_tag_end(elename, cr = nil)
+ if cr
+ @buf << "\n#{ @indent }</#{ elename }>"
+ else
+ @buf << "</#{ elename }>"
+ end
+ end
+
+ def encode_rawstring(str)
+ @buf << str
+ end
+
+ EncodeMap = {
+ '&' => '&amp;',
+ '<' => '&lt;',
+ '>' => '&gt;',
+ '"' => '&quot;',
+ '\'' => '&apos;',
+ "\r" => '&#xd;'
+ }
+ EncodeCharRegexp = Regexp.new("[#{EncodeMap.keys.join}]")
+ def encode_string(str)
+ if @use_numeric_character_reference and !XSD::Charset.is_us_ascii(str)
+ str.gsub!(EncodeCharRegexp) { |c| EncodeMap[c] }
+ @buf << str.unpack("U*").collect { |c|
+ if c == 0x9 or c == 0xa or c == 0xd or (c >= 0x20 and c <= 0x7f)
+ c.chr
+ else
+ sprintf("&#x%x;", c)
+ end
+ }.join
+ else
+ @buf << str.gsub(EncodeCharRegexp) { |c| EncodeMap[c] }
+ end
+ end
+
+ def element_local?(element)
+ element.elename.namespace.nil?
+ end
+
+ def element_qualified?(element)
+ if element.respond_to?(:qualified)
+ if element.qualified.nil?
+ @elementformdefault
+ else
+ element.qualified
+ end
+ else
+ @elementformdefault
+ end
+ end
+
+ def self.assign_ns(attrs, ns, namespace, tag = nil)
+ if namespace.nil?
+ raise FormatEncodeError.new("empty namespace")
+ end
+ unless ns.assigned?(namespace)
+ tag = ns.assign(namespace, tag)
+ if tag == ''
+ attr = 'xmlns'
+ else
+ attr = "xmlns:#{tag}"
+ end
+ attrs[attr] = namespace
+ end
+ end
+
+private
+
+ def prologue
+ end
+
+ def epilogue
+ end
+
+ def find_handler(encodingstyle)
+ unless @handlers.key?(encodingstyle)
+ handler = SOAP::EncodingStyle::Handler.handler(encodingstyle).new(@charset)
+ handler.generate_explicit_type = @generate_explicit_type
+ handler.encode_prologue
+ @handlers[encodingstyle] = handler
+ end
+ @handlers[encodingstyle]
+ end
+
+ def xmldecl
+ if @charset
+ %Q[<?xml version="1.0" encoding="#{ @charset }" ?>]
+ else
+ %Q[<?xml version="1.0" ?>]
+ end
+ end
+end
+
+
+end
diff --git a/lib/soap/header/handler.rb b/lib/soap/header/handler.rb
new file mode 100644
index 0000000000..7da2836e24
--- /dev/null
+++ b/lib/soap/header/handler.rb
@@ -0,0 +1,57 @@
+# SOAP4R - SOAP Header handler item
+# Copyright (C) 2003, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+require 'soap/element'
+
+
+module SOAP
+module Header
+
+
+class Handler
+ attr_reader :elename
+ attr_reader :mustunderstand
+ attr_reader :encodingstyle
+
+ def initialize(elename)
+ @elename = elename
+ @mustunderstand = false
+ @encodingstyle = nil
+ end
+
+ # Should return a SOAP/OM, a SOAPHeaderItem or nil.
+ def on_outbound
+ nil
+ end
+
+ # Given header is a SOAPHeaderItem or nil.
+ def on_inbound(header, mustunderstand = false)
+ # do something.
+ end
+
+ def on_outbound_headeritem
+ item = on_outbound
+ if item.nil?
+ nil
+ elsif item.is_a?(::SOAP::SOAPHeaderItem)
+ item.elename = @elename
+ item
+ else
+ item.elename = @elename
+ ::SOAP::SOAPHeaderItem.new(item, @mustunderstand, @encodingstyle)
+ end
+ end
+
+ def on_inbound_headeritem(header)
+ on_inbound(header.element, header.mustunderstand)
+ end
+end
+
+
+end
+end
diff --git a/lib/soap/header/handlerset.rb b/lib/soap/header/handlerset.rb
new file mode 100644
index 0000000000..a8eee03023
--- /dev/null
+++ b/lib/soap/header/handlerset.rb
@@ -0,0 +1,70 @@
+# SOAP4R - SOAP Header handler set
+# Copyright (C) 2003, 2004 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+require 'xsd/namedelements'
+
+
+module SOAP
+module Header
+
+
+class HandlerSet
+ def initialize
+ @store = XSD::NamedElements.new
+ end
+
+ def dup
+ obj = HandlerSet.new
+ obj.store = @store.dup
+ obj
+ end
+
+ def add(handler)
+ @store << handler
+ end
+ alias << add
+
+ def delete(handler)
+ @store.delete(handler)
+ end
+
+ def include?(handler)
+ @store.include?(handler)
+ end
+
+ # returns: Array of SOAPHeaderItem
+ def on_outbound
+ @store.collect { |handler|
+ handler.on_outbound_headeritem
+ }.compact
+ end
+
+ # headers: SOAPHeaderItem enumerable object
+ def on_inbound(headers)
+ headers.each do |name, item|
+ handler = @store.find { |handler|
+ handler.elename == item.element.elename
+ }
+ if handler
+ handler.on_inbound_headeritem(item)
+ elsif item.mustunderstand
+ raise UnhandledMustUnderstandHeaderError.new(item.element.elename.to_s)
+ end
+ end
+ end
+
+protected
+
+ def store=(store)
+ @store = store
+ end
+end
+
+
+end
+end
diff --git a/lib/soap/header/simplehandler.rb b/lib/soap/header/simplehandler.rb
new file mode 100644
index 0000000000..7b206f77db
--- /dev/null
+++ b/lib/soap/header/simplehandler.rb
@@ -0,0 +1,44 @@
+# SOAP4R - SOAP Simple header item handler
+# Copyright (C) 2003-2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+require 'soap/header/handler'
+require 'soap/baseData'
+
+
+module SOAP
+module Header
+
+
+class SimpleHandler < SOAP::Header::Handler
+ def initialize(elename)
+ super(elename)
+ end
+
+ # Should return a Hash, String or nil.
+ def on_simple_outbound
+ nil
+ end
+
+ # Given header is a Hash, String or nil.
+ def on_simple_inbound(header, mustunderstand)
+ end
+
+ def on_outbound
+ h = on_simple_outbound
+ h ? SOAPElement.from_obj(h, elename.namespace) : nil
+ end
+
+ def on_inbound(header, mustunderstand)
+ h = header.respond_to?(:to_obj) ? header.to_obj : header.data
+ on_simple_inbound(h, mustunderstand)
+ end
+end
+
+
+end
+end
diff --git a/lib/soap/httpconfigloader.rb b/lib/soap/httpconfigloader.rb
new file mode 100644
index 0000000000..cd7bca8a65
--- /dev/null
+++ b/lib/soap/httpconfigloader.rb
@@ -0,0 +1,119 @@
+# SOAP4R - HTTP config loader.
+# Copyright (C) 2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+require 'soap/property'
+
+
+module SOAP
+
+
+module HTTPConfigLoader
+module_function
+
+ def set_options(client, options)
+ client.proxy = options["proxy"]
+ options.add_hook("proxy") do |key, value|
+ client.proxy = value
+ end
+ client.no_proxy = options["no_proxy"]
+ options.add_hook("no_proxy") do |key, value|
+ client.no_proxy = value
+ end
+ if client.respond_to?(:protocol_version=)
+ client.protocol_version = options["protocol_version"]
+ options.add_hook("protocol_version") do |key, value|
+ client.protocol_version = value
+ end
+ end
+ ssl_config = options["ssl_config"] ||= ::SOAP::Property.new
+ set_ssl_config(client, ssl_config)
+ ssl_config.add_hook(true) do |key, value|
+ set_ssl_config(client, ssl_config)
+ end
+ basic_auth = options["basic_auth"] ||= ::SOAP::Property.new
+ set_basic_auth(client, basic_auth)
+ basic_auth.add_hook do |key, value|
+ set_basic_auth(client, basic_auth)
+ end
+ options.add_hook("connect_timeout") do |key, value|
+ client.connect_timeout = value
+ end
+ options.add_hook("send_timeout") do |key, value|
+ client.send_timeout = value
+ end
+ options.add_hook("receive_timeout") do |key, value|
+ client.receive_timeout = value
+ end
+ end
+
+ def set_basic_auth(client, basic_auth)
+ basic_auth.values.each do |url, userid, passwd|
+ client.set_basic_auth(url, userid, passwd)
+ end
+ end
+
+ def set_ssl_config(client, ssl_config)
+ ssl_config.each do |key, value|
+ cfg = client.ssl_config
+ if cfg.nil?
+ raise NotImplementedError.new("SSL not supported")
+ end
+ case key
+ when 'client_cert'
+ cfg.client_cert = cert_from_file(value)
+ when 'client_key'
+ cfg.client_key = key_from_file(value)
+ when 'client_ca'
+ cfg.client_ca = value
+ when 'ca_path'
+ cfg.set_trust_ca(value)
+ when 'ca_file'
+ cfg.set_trust_ca(value)
+ when 'crl'
+ cfg.set_crl(value)
+ when 'verify_mode'
+ cfg.verify_mode = ssl_config_int(value)
+ when 'verify_depth'
+ cfg.verify_depth = ssl_config_int(value)
+ when 'options'
+ cfg.options = value
+ when 'ciphers'
+ cfg.ciphers = value
+ when 'verify_callback'
+ cfg.verify_callback = value
+ when 'cert_store'
+ cfg.cert_store = value
+ else
+ raise ArgumentError.new("unknown ssl_config property #{key}")
+ end
+ end
+ end
+
+ def ssl_config_int(value)
+ if value.nil? or value.to_s.empty?
+ nil
+ else
+ begin
+ Integer(value)
+ rescue ArgumentError
+ ::SOAP::Property::Util.const_from_name(value.to_s)
+ end
+ end
+ end
+
+ def cert_from_file(filename)
+ OpenSSL::X509::Certificate.new(File.open(filename) { |f| f.read })
+ end
+
+ def key_from_file(filename)
+ OpenSSL::PKey::RSA.new(File.open(filename) { |f| f.read })
+ end
+end
+
+
+end
diff --git a/lib/soap/mapping.rb b/lib/soap/mapping.rb
new file mode 100644
index 0000000000..b83f8b484a
--- /dev/null
+++ b/lib/soap/mapping.rb
@@ -0,0 +1,10 @@
+# SOAP4R - Ruby type mapping utility.
+# Copyright (C) 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+require 'soap/mapping/mapping'
+require 'soap/mapping/registry'
diff --git a/lib/soap/mapping/factory.rb b/lib/soap/mapping/factory.rb
new file mode 100644
index 0000000000..978b303b3d
--- /dev/null
+++ b/lib/soap/mapping/factory.rb
@@ -0,0 +1,355 @@
+# SOAP4R - Mapping factory.
+# Copyright (C) 2000, 2001, 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+module SOAP
+module Mapping
+
+
+class Factory
+ include TraverseSupport
+
+ def initialize
+ # nothing to do
+ end
+
+ def obj2soap(soap_class, obj, info, map)
+ raise NotImplementError.new
+ # return soap_obj
+ end
+
+ def soap2obj(obj_class, node, info, map)
+ raise NotImplementError.new
+ # return convert_succeeded_or_not, obj
+ end
+
+ def setiv2obj(obj, node, map)
+ return if node.nil?
+ if obj.is_a?(Array)
+ setiv2ary(obj, node, map)
+ else
+ setiv2struct(obj, node, map)
+ end
+ end
+
+ def setiv2soap(node, obj, map)
+ if obj.class.class_variables.include?('@@schema_element')
+ obj.class.class_eval('@@schema_element').each do |name, info|
+ type, qname = info
+ if qname
+ elename = qname.name
+ else
+ elename = Mapping.name2elename(name)
+ end
+ node.add(elename,
+ Mapping._obj2soap(obj.instance_variable_get('@' + name), map))
+ end
+ else
+ # should we sort instance_variables?
+ obj.instance_variables.each do |var|
+ name = var.sub(/^@/, '')
+ elename = Mapping.name2elename(name)
+ node.add(elename,
+ Mapping._obj2soap(obj.instance_variable_get(var), map))
+ end
+ end
+ end
+
+private
+
+ def setiv2ary(obj, node, map)
+ node.each do |name, value|
+ Array.instance_method(:<<).bind(obj).call(Mapping._soap2obj(value, map))
+ end
+ end
+
+ def setiv2struct(obj, node, map)
+ vars = {}
+ node.each do |name, value|
+ vars[Mapping.elename2name(name)] = Mapping._soap2obj(value, map)
+ end
+ Mapping.set_attributes(obj, vars)
+ end
+end
+
+class StringFactory_ < Factory
+ def initialize(allow_original_mapping = false)
+ super()
+ @allow_original_mapping = allow_original_mapping
+ end
+
+ def obj2soap(soap_class, obj, info, map)
+ if !@allow_original_mapping and !obj.instance_variables.empty?
+ return nil
+ end
+ begin
+ unless XSD::Charset.is_ces(obj, Thread.current[:SOAPExternalCES])
+ return nil
+ end
+ encoded = XSD::Charset.encoding_conv(obj,
+ Thread.current[:SOAPExternalCES], XSD::Charset.encoding)
+ soap_obj = soap_class.new(encoded)
+ rescue XSD::ValueSpaceError
+ return nil
+ end
+ mark_marshalled_obj(obj, soap_obj)
+ soap_obj
+ end
+
+ def soap2obj(obj_class, node, info, map)
+ obj = Mapping.create_empty_object(obj_class)
+ decoded = XSD::Charset.encoding_conv(node.data, XSD::Charset.encoding,
+ Thread.current[:SOAPExternalCES])
+ obj.replace(decoded)
+ mark_unmarshalled_obj(node, obj)
+ return true, obj
+ end
+end
+
+class BasetypeFactory_ < Factory
+ def initialize(allow_original_mapping = false)
+ super()
+ @allow_original_mapping = allow_original_mapping
+ end
+
+ def obj2soap(soap_class, obj, info, map)
+ if !@allow_original_mapping and !obj.instance_variables.empty?
+ return nil
+ end
+ soap_obj = nil
+ begin
+ soap_obj = soap_class.new(obj)
+ rescue XSD::ValueSpaceError
+ return nil
+ end
+ if @allow_original_mapping
+ # Basetype except String should not be multiref-ed in SOAP/1.1.
+ mark_marshalled_obj(obj, soap_obj)
+ end
+ soap_obj
+ end
+
+ def soap2obj(obj_class, node, info, map)
+ obj = node.data
+ mark_unmarshalled_obj(node, obj)
+ return true, obj
+ end
+end
+
+class DateTimeFactory_ < Factory
+ def initialize(allow_original_mapping = false)
+ super()
+ @allow_original_mapping = allow_original_mapping
+ end
+
+ def obj2soap(soap_class, obj, info, map)
+ if !@allow_original_mapping and
+ Time === obj and !obj.instance_variables.empty?
+ return nil
+ end
+ soap_obj = nil
+ begin
+ soap_obj = soap_class.new(obj)
+ rescue XSD::ValueSpaceError
+ return nil
+ end
+ mark_marshalled_obj(obj, soap_obj)
+ soap_obj
+ end
+
+ def soap2obj(obj_class, node, info, map)
+ if node.respond_to?(:to_obj)
+ obj = node.to_obj(obj_class)
+ return false if obj.nil?
+ mark_unmarshalled_obj(node, obj)
+ return true, obj
+ else
+ return false
+ end
+ end
+end
+
+class Base64Factory_ < Factory
+ def obj2soap(soap_class, obj, info, map)
+ return nil unless obj.instance_variables.empty?
+ soap_obj = soap_class.new(obj)
+ mark_marshalled_obj(obj, soap_obj) if soap_obj
+ soap_obj
+ end
+
+ def soap2obj(obj_class, node, info, map)
+ obj = node.string
+ mark_unmarshalled_obj(node, obj)
+ return true, obj
+ end
+end
+
+class URIFactory_ < Factory
+ def obj2soap(soap_class, obj, info, map)
+ soap_obj = soap_class.new(obj)
+ mark_marshalled_obj(obj, soap_obj) if soap_obj
+ soap_obj
+ end
+
+ def soap2obj(obj_class, node, info, map)
+ obj = node.data
+ mark_unmarshalled_obj(node, obj)
+ return true, obj
+ end
+end
+
+class ArrayFactory_ < Factory
+ def initialize(allow_original_mapping = false)
+ super()
+ @allow_original_mapping = allow_original_mapping
+ end
+
+ # [[1], [2]] is converted to Array of Array, not 2-D Array.
+ # To create M-D Array, you must call Mapping.ary2md.
+ def obj2soap(soap_class, obj, info, map)
+ if !@allow_original_mapping and !obj.instance_variables.empty?
+ return nil
+ end
+ arytype = Mapping.obj2element(obj)
+ if arytype.name
+ arytype.namespace ||= RubyTypeNamespace
+ else
+ arytype = XSD::AnyTypeName
+ end
+ soap_obj = SOAPArray.new(ValueArrayName, 1, arytype)
+ mark_marshalled_obj(obj, soap_obj)
+ obj.each do |item|
+ soap_obj.add(Mapping._obj2soap(item, map))
+ end
+ soap_obj
+ end
+
+ def soap2obj(obj_class, node, info, map)
+ obj = Mapping.create_empty_object(obj_class)
+ mark_unmarshalled_obj(node, obj)
+ node.soap2array(obj) do |elem|
+ elem ? Mapping._soap2obj(elem, map) : nil
+ end
+ return true, obj
+ end
+end
+
+class TypedArrayFactory_ < Factory
+ def initialize(allow_original_mapping = false)
+ super()
+ @allow_original_mapping = allow_original_mapping
+ end
+
+ def obj2soap(soap_class, obj, info, map)
+ if !@allow_original_mapping and !obj.instance_variables.empty?
+ return nil
+ end
+ arytype = info[:type] || info[0]
+ soap_obj = SOAPArray.new(ValueArrayName, 1, arytype)
+ mark_marshalled_obj(obj, soap_obj)
+ obj.each do |var|
+ soap_obj.add(Mapping._obj2soap(var, map))
+ end
+ soap_obj
+ end
+
+ def soap2obj(obj_class, node, info, map)
+ if node.rank > 1
+ return false
+ end
+ arytype = info[:type] || info[0]
+ unless node.arytype == arytype
+ return false
+ end
+ obj = Mapping.create_empty_object(obj_class)
+ mark_unmarshalled_obj(node, obj)
+ node.soap2array(obj) do |elem|
+ elem ? Mapping._soap2obj(elem, map) : nil
+ end
+ return true, obj
+ end
+end
+
+class TypedStructFactory_ < Factory
+ def obj2soap(soap_class, obj, info, map)
+ type = info[:type] || info[0]
+ soap_obj = soap_class.new(type)
+ mark_marshalled_obj(obj, soap_obj)
+ if obj.class <= SOAP::Marshallable
+ setiv2soap(soap_obj, obj, map)
+ else
+ setiv2soap(soap_obj, obj, map)
+ end
+ soap_obj
+ end
+
+ def soap2obj(obj_class, node, info, map)
+ type = info[:type] || info[0]
+ unless node.type == type
+ return false
+ end
+ obj = Mapping.create_empty_object(obj_class)
+ mark_unmarshalled_obj(node, obj)
+ setiv2obj(obj, node, map)
+ return true, obj
+ end
+end
+
+MapQName = XSD::QName.new(ApacheSOAPTypeNamespace, 'Map')
+class HashFactory_ < Factory
+ def initialize(allow_original_mapping = false)
+ super()
+ @allow_original_mapping = allow_original_mapping
+ end
+
+ def obj2soap(soap_class, obj, info, map)
+ if !@allow_original_mapping and !obj.instance_variables.empty?
+ return nil
+ end
+ if !obj.default.nil? or
+ (obj.respond_to?(:default_proc) and obj.default_proc)
+ return nil
+ end
+ soap_obj = SOAPStruct.new(MapQName)
+ mark_marshalled_obj(obj, soap_obj)
+ obj.each do |key, value|
+ elem = SOAPStruct.new
+ elem.add("key", Mapping._obj2soap(key, map))
+ elem.add("value", Mapping._obj2soap(value, map))
+ # ApacheAxis allows only 'item' here.
+ soap_obj.add("item", elem)
+ end
+ soap_obj
+ end
+
+ def soap2obj(obj_class, node, info, map)
+ unless node.type == MapQName
+ return false
+ end
+ if node.class == SOAPStruct and node.key?('default')
+ return false
+ end
+ obj = Mapping.create_empty_object(obj_class)
+ mark_unmarshalled_obj(node, obj)
+ if node.class == SOAPStruct
+ node.each do |key, value|
+ obj[Mapping._soap2obj(value['key'], map)] =
+ Mapping._soap2obj(value['value'], map)
+ end
+ else
+ node.each do |value|
+ obj[Mapping._soap2obj(value['key'], map)] =
+ Mapping._soap2obj(value['value'], map)
+ end
+ end
+ return true, obj
+ end
+end
+
+
+end
+end
diff --git a/lib/soap/mapping/mapping.rb b/lib/soap/mapping/mapping.rb
new file mode 100644
index 0000000000..65d6bb4d5b
--- /dev/null
+++ b/lib/soap/mapping/mapping.rb
@@ -0,0 +1,381 @@
+# SOAP4R - Ruby type mapping utility.
+# Copyright (C) 2000, 2001, 2003-2005 NAKAMURA Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+require 'xsd/codegen/gensupport'
+
+
+module SOAP
+
+
+module Mapping
+ RubyTypeNamespace = 'http://www.ruby-lang.org/xmlns/ruby/type/1.6'
+ RubyTypeInstanceNamespace =
+ 'http://www.ruby-lang.org/xmlns/ruby/type-instance'
+ RubyCustomTypeNamespace = 'http://www.ruby-lang.org/xmlns/ruby/type/custom'
+ ApacheSOAPTypeNamespace = 'http://xml.apache.org/xml-soap'
+
+
+ # TraverseSupport breaks following thread variables.
+ # Thread.current[:SOAPMarshalDataKey]
+ module TraverseSupport
+ def mark_marshalled_obj(obj, soap_obj)
+ raise if obj.nil?
+ Thread.current[:SOAPMarshalDataKey][obj.__id__] = soap_obj
+ end
+
+ def mark_unmarshalled_obj(node, obj)
+ return if obj.nil?
+ # node.id is not Object#id but SOAPReference#id
+ Thread.current[:SOAPMarshalDataKey][node.id] = obj
+ end
+ end
+
+
+ EMPTY_OPT = {}
+ def self.obj2soap(obj, registry = nil, type = nil, opt = EMPTY_OPT)
+ registry ||= Mapping::DefaultRegistry
+ soap_obj = nil
+ protect_threadvars(:SOAPMarshalDataKey, :SOAPExternalCES, :SOAPMarshalNoReference) do
+ Thread.current[:SOAPMarshalDataKey] = {}
+ Thread.current[:SOAPExternalCES] = opt[:external_ces] || $KCODE
+ Thread.current[:SOAPMarshalNoReference] = opt[:no_reference]
+ soap_obj = _obj2soap(obj, registry, type)
+ end
+ soap_obj
+ end
+
+ def self.soap2obj(node, registry = nil, klass = nil, opt = EMPTY_OPT)
+ registry ||= Mapping::DefaultRegistry
+ obj = nil
+ protect_threadvars(:SOAPMarshalDataKey, :SOAPExternalCES, :SOAPMarshalNoReference) do
+ Thread.current[:SOAPMarshalDataKey] = {}
+ Thread.current[:SOAPExternalCES] = opt[:external_ces] || $KCODE
+ Thread.current[:SOAPMarshalNoReference] = opt[:no_reference]
+ obj = _soap2obj(node, registry, klass)
+ end
+ obj
+ end
+
+ def self.ary2soap(ary, type_ns = XSD::Namespace, typename = XSD::AnyTypeLiteral, registry = nil, opt = EMPTY_OPT)
+ registry ||= Mapping::DefaultRegistry
+ type = XSD::QName.new(type_ns, typename)
+ soap_ary = SOAPArray.new(ValueArrayName, 1, type)
+ protect_threadvars(:SOAPMarshalDataKey, :SOAPExternalCES, :SOAPMarshalNoReference) do
+ Thread.current[:SOAPMarshalDataKey] = {}
+ Thread.current[:SOAPExternalCES] = opt[:external_ces] || $KCODE
+ Thread.current[:SOAPMarshalNoReference] = opt[:no_reference]
+ ary.each do |ele|
+ soap_ary.add(_obj2soap(ele, registry, type))
+ end
+ end
+ soap_ary
+ end
+
+ def self.ary2md(ary, rank, type_ns = XSD::Namespace, typename = XSD::AnyTypeLiteral, registry = nil, opt = EMPTY_OPT)
+ registry ||= Mapping::DefaultRegistry
+ type = XSD::QName.new(type_ns, typename)
+ md_ary = SOAPArray.new(ValueArrayName, rank, type)
+ protect_threadvars(:SOAPMarshalDataKey, :SOAPExternalCES, :SOAPMarshalNoReference) do
+ Thread.current[:SOAPMarshalDataKey] = {}
+ Thread.current[:SOAPExternalCES] = opt[:external_ces] || $KCODE
+ Thread.current[:SOAPMarshalNoReference] = opt[:no_reference]
+ add_md_ary(md_ary, ary, [], registry)
+ end
+ md_ary
+ end
+
+ def self.fault2exception(fault, registry = nil)
+ registry ||= Mapping::DefaultRegistry
+ detail = if fault.detail
+ soap2obj(fault.detail, registry) || ""
+ else
+ ""
+ end
+ if detail.is_a?(Mapping::SOAPException)
+ begin
+ e = detail.to_e
+ remote_backtrace = e.backtrace
+ e.set_backtrace(nil)
+ raise e # ruby sets current caller as local backtrace of e => e2.
+ rescue Exception => e
+ e.set_backtrace(remote_backtrace + e.backtrace[1..-1])
+ raise
+ end
+ else
+ fault.detail = detail
+ fault.set_backtrace(
+ if detail.is_a?(Array)
+ detail
+ else
+ [detail.to_s]
+ end
+ )
+ raise
+ end
+ end
+
+ def self._obj2soap(obj, registry, type = nil)
+ if referent = Thread.current[:SOAPMarshalDataKey][obj.__id__] and
+ !Thread.current[:SOAPMarshalNoReference]
+ SOAPReference.new(referent)
+ elsif registry
+ registry.obj2soap(obj, type)
+ else
+ raise MappingError.new("no mapping registry given")
+ end
+ end
+
+ def self._soap2obj(node, registry, klass = nil)
+ if node.nil?
+ return nil
+ elsif node.is_a?(SOAPReference)
+ target = node.__getobj__
+ # target.id is not Object#id but SOAPReference#id
+ if referent = Thread.current[:SOAPMarshalDataKey][target.id] and
+ !Thread.current[:SOAPMarshalNoReference]
+ return referent
+ else
+ return _soap2obj(target, registry, klass)
+ end
+ end
+ return registry.soap2obj(node, klass)
+ end
+
+ if Object.respond_to?(:allocate)
+ # ruby/1.7 or later.
+ def self.create_empty_object(klass)
+ klass.allocate
+ end
+ else
+ MARSHAL_TAG = {
+ String => ['"', 1],
+ Regexp => ['/', 2],
+ Array => ['[', 1],
+ Hash => ['{', 1]
+ }
+ def self.create_empty_object(klass)
+ if klass <= Struct
+ name = klass.name
+ return ::Marshal.load(sprintf("\004\006S:%c%s\000", name.length + 5, name))
+ end
+ if MARSHAL_TAG.has_key?(klass)
+ tag, terminate = MARSHAL_TAG[klass]
+ return ::Marshal.load(sprintf("\004\006%s%s", tag, "\000" * terminate))
+ end
+ MARSHAL_TAG.each do |k, v|
+ if klass < k
+ name = klass.name
+ tag, terminate = v
+ return ::Marshal.load(sprintf("\004\006C:%c%s%s%s", name.length + 5, name, tag, "\000" * terminate))
+ end
+ end
+ name = klass.name
+ ::Marshal.load(sprintf("\004\006o:%c%s\000", name.length + 5, name))
+ end
+ end
+
+ # Allow only (Letter | '_') (Letter | Digit | '-' | '_')* here.
+ # Caution: '.' is not allowed here.
+ # To follow XML spec., it should be NCName.
+ # (denied chars) => .[0-F][0-F]
+ # ex. a.b => a.2eb
+ #
+ def self.name2elename(name)
+ name.gsub(/([^a-zA-Z0-9:_\-]+)/n) {
+ '.' << $1.unpack('H2' * $1.size).join('.')
+ }.gsub(/::/n, '..')
+ end
+
+ def self.elename2name(name)
+ name.gsub(/\.\./n, '::').gsub(/((?:\.[0-9a-fA-F]{2})+)/n) {
+ [$1.delete('.')].pack('H*')
+ }
+ end
+
+ def self.const_from_name(name, lenient = false)
+ const = ::Object
+ name.sub(/\A::/, '').split('::').each do |const_str|
+ if XSD::CodeGen::GenSupport.safeconstname?(const_str)
+ if const.const_defined?(const_str)
+ const = const.const_get(const_str)
+ next
+ end
+ elsif lenient
+ const_str = XSD::CodeGen::GenSupport.safeconstname(const_str)
+ if const.const_defined?(const_str)
+ const = const.const_get(const_str)
+ next
+ end
+ end
+ return nil
+ end
+ const
+ end
+
+ def self.class_from_name(name, lenient = false)
+ const = const_from_name(name, lenient)
+ if const.is_a?(::Class)
+ const
+ else
+ nil
+ end
+ end
+
+ def self.module_from_name(name, lenient = false)
+ const = const_from_name(name, lenient)
+ if const.is_a?(::Module)
+ const
+ else
+ nil
+ end
+ end
+
+ def self.class2qname(klass)
+ name = schema_type_definition(klass)
+ namespace = schema_ns_definition(klass)
+ XSD::QName.new(namespace, name)
+ end
+
+ def self.class2element(klass)
+ type = Mapping.class2qname(klass)
+ type.name ||= Mapping.name2elename(klass.name)
+ type.namespace ||= RubyCustomTypeNamespace
+ type
+ end
+
+ def self.obj2element(obj)
+ name = namespace = nil
+ ivars = obj.instance_variables
+ if ivars.include?('@schema_type')
+ name = obj.instance_variable_get('@schema_type')
+ end
+ if ivars.include?('@schema_ns')
+ namespace = obj.instance_variable_get('@schema_ns')
+ end
+ if !name or !namespace
+ class2qname(obj.class)
+ else
+ XSD::QName.new(namespace, name)
+ end
+ end
+
+ def self.define_singleton_method(obj, name, &block)
+ sclass = (class << obj; self; end)
+ sclass.class_eval {
+ define_method(name, &block)
+ }
+ end
+
+ def self.get_attribute(obj, attr_name)
+ if obj.is_a?(::Hash)
+ obj[attr_name] || obj[attr_name.intern]
+ else
+ name = XSD::CodeGen::GenSupport.safevarname(attr_name)
+ if obj.instance_variables.include?('@' + name)
+ obj.instance_variable_get('@' + name)
+ elsif ((obj.is_a?(::Struct) or obj.is_a?(Marshallable)) and
+ obj.respond_to?(name))
+ obj.__send__(name)
+ end
+ end
+ end
+
+ def self.set_attributes(obj, values)
+ if obj.is_a?(::SOAP::Mapping::Object)
+ values.each do |attr_name, value|
+ obj.__add_xmlele_value(attr_name, value)
+ end
+ else
+ values.each do |attr_name, value|
+ name = XSD::CodeGen::GenSupport.safevarname(attr_name)
+ setter = name + "="
+ if obj.respond_to?(setter)
+ obj.__send__(setter, value)
+ else
+ obj.instance_variable_set('@' + name, value)
+ begin
+ define_attr_accessor(obj, name,
+ proc { instance_variable_get('@' + name) },
+ proc { |value| instance_variable_set('@' + name, value) })
+ rescue TypeError
+ # singleton class may not exist (e.g. Float)
+ end
+ end
+ end
+ end
+ end
+
+ def self.define_attr_accessor(obj, name, getterproc, setterproc = nil)
+ define_singleton_method(obj, name, &getterproc)
+ define_singleton_method(obj, name + '=', &setterproc) if setterproc
+ end
+
+ def self.schema_type_definition(klass)
+ class_schema_variable(:schema_type, klass)
+ end
+
+ def self.schema_ns_definition(klass)
+ class_schema_variable(:schema_ns, klass)
+ end
+
+ def self.schema_element_definition(klass)
+ schema_element = class_schema_variable(:schema_element, klass) or return nil
+ schema_ns = schema_ns_definition(klass)
+ elements = []
+ as_array = []
+ schema_element.each do |varname, definition|
+ class_name, name = definition
+ if /\[\]$/ =~ class_name
+ class_name = class_name.sub(/\[\]$/, '')
+ as_array << (name ? name.name : varname)
+ end
+ elements << [name || XSD::QName.new(schema_ns, varname), class_name]
+ end
+ [elements, as_array]
+ end
+
+ def self.schema_attribute_definition(klass)
+ class_schema_variable(:schema_attribute, klass)
+ end
+
+ class << Mapping
+ private
+
+ def class_schema_variable(sym, klass)
+ var = "@@#{sym}"
+ klass.class_variables.include?(var) ? klass.class_eval(var) : nil
+ end
+
+ def protect_threadvars(*symbols)
+ backup = {}
+ begin
+ symbols.each do |sym|
+ backup[sym] = Thread.current[sym]
+ end
+ yield
+ ensure
+ symbols.each do |sym|
+ Thread.current[sym] = backup[sym]
+ end
+ end
+ end
+
+ def add_md_ary(md_ary, ary, indices, registry)
+ for idx in 0..(ary.size - 1)
+ if ary[idx].is_a?(Array)
+ add_md_ary(md_ary, ary[idx], indices + [idx], registry)
+ else
+ md_ary[*(indices + [idx])] = _obj2soap(ary[idx], registry)
+ end
+ end
+ end
+ end
+end
+
+
+end
diff --git a/lib/soap/mapping/registry.rb b/lib/soap/mapping/registry.rb
new file mode 100644
index 0000000000..823e80666d
--- /dev/null
+++ b/lib/soap/mapping/registry.rb
@@ -0,0 +1,541 @@
+# SOAP4R - Mapping registry.
+# Copyright (C) 2000, 2001, 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+require 'soap/baseData'
+require 'soap/mapping/mapping'
+require 'soap/mapping/typeMap'
+require 'soap/mapping/factory'
+require 'soap/mapping/rubytypeFactory'
+
+
+module SOAP
+
+
+module Marshallable
+ # @@type_ns = Mapping::RubyCustomTypeNamespace
+end
+
+
+module Mapping
+
+
+module MappedException; end
+
+
+RubyTypeName = XSD::QName.new(RubyTypeInstanceNamespace, 'rubyType')
+RubyExtendName = XSD::QName.new(RubyTypeInstanceNamespace, 'extends')
+RubyIVarName = XSD::QName.new(RubyTypeInstanceNamespace, 'ivars')
+
+
+# Inner class to pass an exception.
+class SOAPException; include Marshallable
+ attr_reader :excn_type_name, :cause
+ def initialize(e)
+ @excn_type_name = Mapping.name2elename(e.class.to_s)
+ @cause = e
+ end
+
+ def to_e
+ if @cause.is_a?(::Exception)
+ @cause.extend(::SOAP::Mapping::MappedException)
+ return @cause
+ elsif @cause.respond_to?(:message) and @cause.respond_to?(:backtrace)
+ e = RuntimeError.new(@cause.message)
+ e.set_backtrace(@cause.backtrace)
+ return e
+ end
+ klass = Mapping.class_from_name(Mapping.elename2name(@excn_type_name.to_s))
+ if klass.nil? or not klass <= ::Exception
+ return RuntimeError.new(@cause.inspect)
+ end
+ obj = klass.new(@cause.message)
+ obj.extend(::SOAP::Mapping::MappedException)
+ obj
+ end
+end
+
+
+# For anyType object: SOAP::Mapping::Object not ::Object
+class Object; include Marshallable
+ def initialize
+ @__xmlele_type = {}
+ @__xmlele = []
+ @__xmlattr = {}
+ end
+
+ def inspect
+ sprintf("#<%s:0x%x%s>", self.class.name, __id__,
+ @__xmlele.collect { |name, value| " #{name}=#{value.inspect}" }.join)
+ end
+
+ def __xmlattr
+ @__xmlattr
+ end
+
+ def __xmlele
+ @__xmlele
+ end
+
+ def [](qname)
+ unless qname.is_a?(XSD::QName)
+ qname = XSD::QName.new(nil, qname)
+ end
+ @__xmlele.each do |k, v|
+ return v if k == qname
+ end
+ # fallback
+ @__xmlele.each do |k, v|
+ return v if k.name == qname.name
+ end
+ nil
+ end
+
+ def []=(qname, value)
+ unless qname.is_a?(XSD::QName)
+ qname = XSD::QName.new(nil, qname)
+ end
+ found = false
+ @__xmlele.each do |pair|
+ if pair[0] == qname
+ found = true
+ pair[1] = value
+ end
+ end
+ unless found
+ __define_attr_accessor(qname)
+ @__xmlele << [qname, value]
+ end
+ @__xmlele_type[qname] = :single
+ end
+
+ def __add_xmlele_value(qname, value)
+ found = false
+ @__xmlele.map! do |k, v|
+ if k == qname
+ found = true
+ [k, __set_xmlele_value(k, v, value)]
+ else
+ [k, v]
+ end
+ end
+ unless found
+ __define_attr_accessor(qname)
+ @__xmlele << [qname, value]
+ @__xmlele_type[qname] = :single
+ end
+ value
+ end
+
+private
+
+ if RUBY_VERSION > "1.7.0"
+ def __define_attr_accessor(qname)
+ name = XSD::CodeGen::GenSupport.safemethodname(qname.name)
+ Mapping.define_attr_accessor(self, name,
+ proc { self[qname] },
+ proc { |value| self[qname] = value })
+ end
+ else
+ def __define_attr_accessor(qname)
+ name = XSD::CodeGen::GenSupport.safemethodname(qname.name)
+ instance_eval <<-EOS
+ def #{name}
+ self[#{qname.dump}]
+ end
+
+ def #{name}=(value)
+ self[#{qname.dump}] = value
+ end
+ EOS
+ end
+ end
+
+ def __set_xmlele_value(key, org, value)
+ case @__xmlele_type[key]
+ when :multi
+ org << value
+ org
+ when :single
+ @__xmlele_type[key] = :multi
+ [org, value]
+ else
+ raise RuntimeError.new("unknown type")
+ end
+ end
+end
+
+
+class MappingError < Error; end
+
+
+class Registry
+ class Map
+ def initialize(registry)
+ @obj2soap = {}
+ @soap2obj = {}
+ @registry = registry
+ end
+
+ def obj2soap(obj)
+ klass = obj.class
+ if map = @obj2soap[klass]
+ map.each do |soap_class, factory, info|
+ ret = factory.obj2soap(soap_class, obj, info, @registry)
+ return ret if ret
+ end
+ end
+ ancestors = klass.ancestors
+ ancestors.delete(klass)
+ ancestors.delete(::Object)
+ ancestors.delete(::Kernel)
+ ancestors.each do |klass|
+ if map = @obj2soap[klass]
+ map.each do |soap_class, factory, info|
+ if info[:derived_class]
+ ret = factory.obj2soap(soap_class, obj, info, @registry)
+ return ret if ret
+ end
+ end
+ end
+ end
+ nil
+ end
+
+ def soap2obj(node, klass = nil)
+ if map = @soap2obj[node.class]
+ map.each do |obj_class, factory, info|
+ next if klass and obj_class != klass
+ conv, obj = factory.soap2obj(obj_class, node, info, @registry)
+ return true, obj if conv
+ end
+ end
+ return false, nil
+ end
+
+ # Give priority to former entry.
+ def init(init_map = [])
+ clear
+ init_map.reverse_each do |obj_class, soap_class, factory, info|
+ add(obj_class, soap_class, factory, info)
+ end
+ end
+
+ # Give priority to latter entry.
+ def add(obj_class, soap_class, factory, info)
+ info ||= {}
+ (@obj2soap[obj_class] ||= []).unshift([soap_class, factory, info])
+ (@soap2obj[soap_class] ||= []).unshift([obj_class, factory, info])
+ end
+
+ def clear
+ @obj2soap.clear
+ @soap2obj.clear
+ end
+
+ def find_mapped_soap_class(target_obj_class)
+ map = @obj2soap[target_obj_class]
+ map.empty? ? nil : map[0][1]
+ end
+
+ def find_mapped_obj_class(target_soap_class)
+ map = @soap2obj[target_soap_class]
+ map.empty? ? nil : map[0][0]
+ end
+ end
+
+ StringFactory = StringFactory_.new
+ BasetypeFactory = BasetypeFactory_.new
+ DateTimeFactory = DateTimeFactory_.new
+ ArrayFactory = ArrayFactory_.new
+ Base64Factory = Base64Factory_.new
+ URIFactory = URIFactory_.new
+ TypedArrayFactory = TypedArrayFactory_.new
+ TypedStructFactory = TypedStructFactory_.new
+
+ HashFactory = HashFactory_.new
+
+ SOAPBaseMap = [
+ [::NilClass, ::SOAP::SOAPNil, BasetypeFactory],
+ [::TrueClass, ::SOAP::SOAPBoolean, BasetypeFactory],
+ [::FalseClass, ::SOAP::SOAPBoolean, BasetypeFactory],
+ [::String, ::SOAP::SOAPString, StringFactory],
+ [::DateTime, ::SOAP::SOAPDateTime, DateTimeFactory],
+ [::Date, ::SOAP::SOAPDate, DateTimeFactory],
+ [::Time, ::SOAP::SOAPDateTime, DateTimeFactory],
+ [::Time, ::SOAP::SOAPTime, DateTimeFactory],
+ [::Float, ::SOAP::SOAPDouble, BasetypeFactory,
+ {:derived_class => true}],
+ [::Float, ::SOAP::SOAPFloat, BasetypeFactory,
+ {:derived_class => true}],
+ [::Integer, ::SOAP::SOAPInt, BasetypeFactory,
+ {:derived_class => true}],
+ [::Integer, ::SOAP::SOAPLong, BasetypeFactory,
+ {:derived_class => true}],
+ [::Integer, ::SOAP::SOAPInteger, BasetypeFactory,
+ {:derived_class => true}],
+ [::Integer, ::SOAP::SOAPShort, BasetypeFactory,
+ {:derived_class => true}],
+ [::Integer, ::SOAP::SOAPByte, BasetypeFactory,
+ {:derived_class => true}],
+ [::Integer, ::SOAP::SOAPNonPositiveInteger, BasetypeFactory,
+ {:derived_class => true}],
+ [::Integer, ::SOAP::SOAPNegativeInteger, BasetypeFactory,
+ {:derived_class => true}],
+ [::Integer, ::SOAP::SOAPNonNegativeInteger, BasetypeFactory,
+ {:derived_class => true}],
+ [::Integer, ::SOAP::SOAPPositiveInteger, BasetypeFactory,
+ {:derived_class => true}],
+ [::Integer, ::SOAP::SOAPUnsignedLong, BasetypeFactory,
+ {:derived_class => true}],
+ [::Integer, ::SOAP::SOAPUnsignedInt, BasetypeFactory,
+ {:derived_class => true}],
+ [::Integer, ::SOAP::SOAPUnsignedShort, BasetypeFactory,
+ {:derived_class => true}],
+ [::Integer, ::SOAP::SOAPUnsignedByte, BasetypeFactory,
+ {:derived_class => true}],
+ [::URI::Generic, ::SOAP::SOAPAnyURI, URIFactory,
+ {:derived_class => true}],
+ [::String, ::SOAP::SOAPBase64, Base64Factory],
+ [::String, ::SOAP::SOAPHexBinary, Base64Factory],
+ [::String, ::SOAP::SOAPDecimal, BasetypeFactory],
+ [::String, ::SOAP::SOAPDuration, BasetypeFactory],
+ [::String, ::SOAP::SOAPGYearMonth, BasetypeFactory],
+ [::String, ::SOAP::SOAPGYear, BasetypeFactory],
+ [::String, ::SOAP::SOAPGMonthDay, BasetypeFactory],
+ [::String, ::SOAP::SOAPGDay, BasetypeFactory],
+ [::String, ::SOAP::SOAPGMonth, BasetypeFactory],
+ [::String, ::SOAP::SOAPQName, BasetypeFactory],
+
+ [::Hash, ::SOAP::SOAPArray, HashFactory],
+ [::Hash, ::SOAP::SOAPStruct, HashFactory],
+
+ [::Array, ::SOAP::SOAPArray, ArrayFactory,
+ {:derived_class => true}],
+
+ [::SOAP::Mapping::SOAPException,
+ ::SOAP::SOAPStruct, TypedStructFactory,
+ {:type => XSD::QName.new(RubyCustomTypeNamespace, "SOAPException")}],
+ ]
+
+ RubyOriginalMap = [
+ [::NilClass, ::SOAP::SOAPNil, BasetypeFactory],
+ [::TrueClass, ::SOAP::SOAPBoolean, BasetypeFactory],
+ [::FalseClass, ::SOAP::SOAPBoolean, BasetypeFactory],
+ [::String, ::SOAP::SOAPString, StringFactory],
+ [::DateTime, ::SOAP::SOAPDateTime, DateTimeFactory],
+ [::Date, ::SOAP::SOAPDate, DateTimeFactory],
+ [::Time, ::SOAP::SOAPDateTime, DateTimeFactory],
+ [::Time, ::SOAP::SOAPTime, DateTimeFactory],
+ [::Float, ::SOAP::SOAPDouble, BasetypeFactory,
+ {:derived_class => true}],
+ [::Float, ::SOAP::SOAPFloat, BasetypeFactory,
+ {:derived_class => true}],
+ [::Integer, ::SOAP::SOAPInt, BasetypeFactory,
+ {:derived_class => true}],
+ [::Integer, ::SOAP::SOAPLong, BasetypeFactory,
+ {:derived_class => true}],
+ [::Integer, ::SOAP::SOAPInteger, BasetypeFactory,
+ {:derived_class => true}],
+ [::Integer, ::SOAP::SOAPShort, BasetypeFactory,
+ {:derived_class => true}],
+ [::Integer, ::SOAP::SOAPByte, BasetypeFactory,
+ {:derived_class => true}],
+ [::Integer, ::SOAP::SOAPNonPositiveInteger, BasetypeFactory,
+ {:derived_class => true}],
+ [::Integer, ::SOAP::SOAPNegativeInteger, BasetypeFactory,
+ {:derived_class => true}],
+ [::Integer, ::SOAP::SOAPNonNegativeInteger, BasetypeFactory,
+ {:derived_class => true}],
+ [::Integer, ::SOAP::SOAPPositiveInteger, BasetypeFactory,
+ {:derived_class => true}],
+ [::Integer, ::SOAP::SOAPUnsignedLong, BasetypeFactory,
+ {:derived_class => true}],
+ [::Integer, ::SOAP::SOAPUnsignedInt, BasetypeFactory,
+ {:derived_class => true}],
+ [::Integer, ::SOAP::SOAPUnsignedShort, BasetypeFactory,
+ {:derived_class => true}],
+ [::Integer, ::SOAP::SOAPUnsignedByte, BasetypeFactory,
+ {:derived_class => true}],
+ [::URI::Generic, ::SOAP::SOAPAnyURI, URIFactory,
+ {:derived_class => true}],
+ [::String, ::SOAP::SOAPBase64, Base64Factory],
+ [::String, ::SOAP::SOAPHexBinary, Base64Factory],
+ [::String, ::SOAP::SOAPDecimal, BasetypeFactory],
+ [::String, ::SOAP::SOAPDuration, BasetypeFactory],
+ [::String, ::SOAP::SOAPGYearMonth, BasetypeFactory],
+ [::String, ::SOAP::SOAPGYear, BasetypeFactory],
+ [::String, ::SOAP::SOAPGMonthDay, BasetypeFactory],
+ [::String, ::SOAP::SOAPGDay, BasetypeFactory],
+ [::String, ::SOAP::SOAPGMonth, BasetypeFactory],
+ [::String, ::SOAP::SOAPQName, BasetypeFactory],
+
+ [::Hash, ::SOAP::SOAPArray, HashFactory],
+ [::Hash, ::SOAP::SOAPStruct, HashFactory],
+
+ # Does not allow Array's subclass here.
+ [::Array, ::SOAP::SOAPArray, ArrayFactory],
+
+ [::SOAP::Mapping::SOAPException,
+ ::SOAP::SOAPStruct, TypedStructFactory,
+ {:type => XSD::QName.new(RubyCustomTypeNamespace, "SOAPException")}],
+ ]
+
+ attr_accessor :default_factory
+ attr_accessor :excn_handler_obj2soap
+ attr_accessor :excn_handler_soap2obj
+
+ def initialize(config = {})
+ @config = config
+ @map = Map.new(self)
+ if @config[:allow_original_mapping]
+ @allow_original_mapping = true
+ @map.init(RubyOriginalMap)
+ else
+ @allow_original_mapping = false
+ @map.init(SOAPBaseMap)
+ end
+ @allow_untyped_struct = @config.key?(:allow_untyped_struct) ?
+ @config[:allow_untyped_struct] : true
+ @rubytype_factory = RubytypeFactory.new(
+ :allow_untyped_struct => @allow_untyped_struct,
+ :allow_original_mapping => @allow_original_mapping
+ )
+ @default_factory = @rubytype_factory
+ @excn_handler_obj2soap = nil
+ @excn_handler_soap2obj = nil
+ end
+
+ def add(obj_class, soap_class, factory, info = nil)
+ @map.add(obj_class, soap_class, factory, info)
+ end
+ alias set add
+
+ # general Registry ignores type_qname
+ def obj2soap(obj, type_qname = nil)
+ soap = _obj2soap(obj)
+ if @allow_original_mapping
+ addextend2soap(soap, obj)
+ end
+ soap
+ end
+
+ def soap2obj(node, klass = nil)
+ obj = _soap2obj(node, klass)
+ if @allow_original_mapping
+ addextend2obj(obj, node.extraattr[RubyExtendName])
+ addiv2obj(obj, node.extraattr[RubyIVarName])
+ end
+ obj
+ end
+
+ def find_mapped_soap_class(obj_class)
+ @map.find_mapped_soap_class(obj_class)
+ end
+
+ def find_mapped_obj_class(soap_class)
+ @map.find_mapped_obj_class(soap_class)
+ end
+
+private
+
+ def _obj2soap(obj)
+ ret = nil
+ if obj.is_a?(SOAPStruct) or obj.is_a?(SOAPArray)
+ obj.replace do |ele|
+ Mapping._obj2soap(ele, self)
+ end
+ return obj
+ elsif obj.is_a?(SOAPBasetype)
+ return obj
+ end
+ begin
+ ret = @map.obj2soap(obj) ||
+ @default_factory.obj2soap(nil, obj, nil, self)
+ return ret if ret
+ rescue MappingError
+ end
+ if @excn_handler_obj2soap
+ ret = @excn_handler_obj2soap.call(obj) { |yield_obj|
+ Mapping._obj2soap(yield_obj, self)
+ }
+ return ret if ret
+ end
+ raise MappingError.new("Cannot map #{ obj.class.name } to SOAP/OM.")
+ end
+
+ # Might return nil as a mapping result.
+ def _soap2obj(node, klass = nil)
+ if node.extraattr.key?(RubyTypeName)
+ conv, obj = @rubytype_factory.soap2obj(nil, node, nil, self)
+ return obj if conv
+ else
+ conv, obj = @map.soap2obj(node, klass)
+ return obj if conv
+ conv, obj = @default_factory.soap2obj(nil, node, nil, self)
+ return obj if conv
+ end
+ if @excn_handler_soap2obj
+ begin
+ return @excn_handler_soap2obj.call(node) { |yield_node|
+ Mapping._soap2obj(yield_node, self)
+ }
+ rescue Exception
+ end
+ end
+ raise MappingError.new("Cannot map #{ node.type.name } to Ruby object.")
+ end
+
+ def addiv2obj(obj, attr)
+ return unless attr
+ vars = {}
+ attr.__getobj__.each do |name, value|
+ vars[name] = Mapping._soap2obj(value, self)
+ end
+ Mapping.set_attributes(obj, vars)
+ end
+
+ if RUBY_VERSION >= '1.8.0'
+ def addextend2obj(obj, attr)
+ return unless attr
+ attr.split(/ /).reverse_each do |mstr|
+ obj.extend(Mapping.module_from_name(mstr))
+ end
+ end
+ else
+ # (class < false; self; end).ancestors includes "TrueClass" under 1.6...
+ def addextend2obj(obj, attr)
+ return unless attr
+ attr.split(/ /).reverse_each do |mstr|
+ m = Mapping.module_from_name(mstr)
+ obj.extend(m)
+ end
+ end
+ end
+
+ def addextend2soap(node, obj)
+ return if obj.is_a?(Symbol) or obj.is_a?(Fixnum)
+ list = (class << obj; self; end).ancestors - obj.class.ancestors
+ unless list.empty?
+ node.extraattr[RubyExtendName] = list.collect { |c|
+ if c.name.empty?
+ raise TypeError.new("singleton can't be dumped #{ obj }")
+ end
+ c.name
+ }.join(" ")
+ end
+ end
+
+end
+
+
+DefaultRegistry = Registry.new
+RubyOriginalRegistry = Registry.new(:allow_original_mapping => true)
+
+
+end
+end
diff --git a/lib/soap/mapping/rubytypeFactory.rb b/lib/soap/mapping/rubytypeFactory.rb
new file mode 100644
index 0000000000..61c21d8b20
--- /dev/null
+++ b/lib/soap/mapping/rubytypeFactory.rb
@@ -0,0 +1,475 @@
+# SOAP4R - Ruby type mapping factory.
+# Copyright (C) 2000-2003, 2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+module SOAP
+module Mapping
+
+
+class RubytypeFactory < Factory
+ TYPE_STRING = XSD::QName.new(RubyTypeNamespace, 'String')
+ TYPE_TIME = XSD::QName.new(RubyTypeNamespace, 'Time')
+ TYPE_ARRAY = XSD::QName.new(RubyTypeNamespace, 'Array')
+ TYPE_REGEXP = XSD::QName.new(RubyTypeNamespace, 'Regexp')
+ TYPE_RANGE = XSD::QName.new(RubyTypeNamespace, 'Range')
+ TYPE_CLASS = XSD::QName.new(RubyTypeNamespace, 'Class')
+ TYPE_MODULE = XSD::QName.new(RubyTypeNamespace, 'Module')
+ TYPE_SYMBOL = XSD::QName.new(RubyTypeNamespace, 'Symbol')
+ TYPE_STRUCT = XSD::QName.new(RubyTypeNamespace, 'Struct')
+ TYPE_HASH = XSD::QName.new(RubyTypeNamespace, 'Map')
+
+ def initialize(config = {})
+ @config = config
+ @allow_untyped_struct = @config.key?(:allow_untyped_struct) ?
+ @config[:allow_untyped_struct] : true
+ @allow_original_mapping = @config.key?(:allow_original_mapping) ?
+ @config[:allow_original_mapping] : false
+ @string_factory = StringFactory_.new(true)
+ @basetype_factory = BasetypeFactory_.new(true)
+ @datetime_factory = DateTimeFactory_.new(true)
+ @array_factory = ArrayFactory_.new(true)
+ @hash_factory = HashFactory_.new(true)
+ end
+
+ def obj2soap(soap_class, obj, info, map)
+ param = nil
+ case obj
+ when ::String
+ unless @allow_original_mapping
+ return nil
+ end
+ param = @string_factory.obj2soap(SOAPString, obj, info, map)
+ if obj.class != String
+ param.extraattr[RubyTypeName] = obj.class.name
+ end
+ addiv2soapattr(param, obj, map)
+ when ::Time
+ unless @allow_original_mapping
+ return nil
+ end
+ param = @datetime_factory.obj2soap(SOAPDateTime, obj, info, map)
+ if obj.class != Time
+ param.extraattr[RubyTypeName] = obj.class.name
+ end
+ addiv2soapattr(param, obj, map)
+ when ::Array
+ unless @allow_original_mapping
+ return nil
+ end
+ param = @array_factory.obj2soap(nil, obj, info, map)
+ if obj.class != Array
+ param.extraattr[RubyTypeName] = obj.class.name
+ end
+ addiv2soapattr(param, obj, map)
+ when ::NilClass
+ unless @allow_original_mapping
+ return nil
+ end
+ param = @basetype_factory.obj2soap(SOAPNil, obj, info, map)
+ addiv2soapattr(param, obj, map)
+ when ::FalseClass, ::TrueClass
+ unless @allow_original_mapping
+ return nil
+ end
+ param = @basetype_factory.obj2soap(SOAPBoolean, obj, info, map)
+ addiv2soapattr(param, obj, map)
+ when ::Integer
+ unless @allow_original_mapping
+ return nil
+ end
+ param = @basetype_factory.obj2soap(SOAPInt, obj, info, map)
+ param ||= @basetype_factory.obj2soap(SOAPInteger, obj, info, map)
+ param ||= @basetype_factory.obj2soap(SOAPDecimal, obj, info, map)
+ addiv2soapattr(param, obj, map)
+ when ::Float
+ unless @allow_original_mapping
+ return nil
+ end
+ param = @basetype_factory.obj2soap(SOAPDouble, obj, info, map)
+ if obj.class != Float
+ param.extraattr[RubyTypeName] = obj.class.name
+ end
+ addiv2soapattr(param, obj, map)
+ when ::Hash
+ unless @allow_original_mapping
+ return nil
+ end
+ if obj.respond_to?(:default_proc) && obj.default_proc
+ raise TypeError.new("cannot dump hash with default proc")
+ end
+ param = SOAPStruct.new(TYPE_HASH)
+ mark_marshalled_obj(obj, param)
+ if obj.class != Hash
+ param.extraattr[RubyTypeName] = obj.class.name
+ end
+ obj.each do |key, value|
+ elem = SOAPStruct.new # Undefined type.
+ elem.add("key", Mapping._obj2soap(key, map))
+ elem.add("value", Mapping._obj2soap(value, map))
+ param.add("item", elem)
+ end
+ param.add('default', Mapping._obj2soap(obj.default, map))
+ addiv2soapattr(param, obj, map)
+ when ::Regexp
+ unless @allow_original_mapping
+ return nil
+ end
+ param = SOAPStruct.new(TYPE_REGEXP)
+ mark_marshalled_obj(obj, param)
+ if obj.class != Regexp
+ param.extraattr[RubyTypeName] = obj.class.name
+ end
+ param.add('source', SOAPBase64.new(obj.source))
+ if obj.respond_to?('options')
+ # Regexp#options is from Ruby/1.7
+ options = obj.options
+ else
+ options = 0
+ obj.inspect.sub(/^.*\//, '').each_byte do |c|
+ options += case c
+ when ?i
+ 1
+ when ?x
+ 2
+ when ?m
+ 4
+ when ?n
+ 16
+ when ?e
+ 32
+ when ?s
+ 48
+ when ?u
+ 64
+ end
+ end
+ end
+ param.add('options', SOAPInt.new(options))
+ addiv2soapattr(param, obj, map)
+ when ::Range
+ unless @allow_original_mapping
+ return nil
+ end
+ param = SOAPStruct.new(TYPE_RANGE)
+ mark_marshalled_obj(obj, param)
+ if obj.class != Range
+ param.extraattr[RubyTypeName] = obj.class.name
+ end
+ param.add('begin', Mapping._obj2soap(obj.begin, map))
+ param.add('end', Mapping._obj2soap(obj.end, map))
+ param.add('exclude_end', SOAP::SOAPBoolean.new(obj.exclude_end?))
+ addiv2soapattr(param, obj, map)
+ when ::Class
+ unless @allow_original_mapping
+ return nil
+ end
+ if obj.to_s[0] == ?#
+ raise TypeError.new("can't dump anonymous class #{obj}")
+ end
+ param = SOAPStruct.new(TYPE_CLASS)
+ mark_marshalled_obj(obj, param)
+ param.add('name', SOAPString.new(obj.name))
+ addiv2soapattr(param, obj, map)
+ when ::Module
+ unless @allow_original_mapping
+ return nil
+ end
+ if obj.to_s[0] == ?#
+ raise TypeError.new("can't dump anonymous module #{obj}")
+ end
+ param = SOAPStruct.new(TYPE_MODULE)
+ mark_marshalled_obj(obj, param)
+ param.add('name', SOAPString.new(obj.name))
+ addiv2soapattr(param, obj, map)
+ when ::Symbol
+ unless @allow_original_mapping
+ return nil
+ end
+ param = SOAPStruct.new(TYPE_SYMBOL)
+ mark_marshalled_obj(obj, param)
+ param.add('id', SOAPString.new(obj.id2name))
+ addiv2soapattr(param, obj, map)
+ when ::Struct
+ unless @allow_original_mapping
+ # treat it as an user defined class. [ruby-talk:104980]
+ #param = unknownobj2soap(soap_class, obj, info, map)
+ param = SOAPStruct.new(XSD::AnyTypeName)
+ mark_marshalled_obj(obj, param)
+ obj.members.each do |member|
+ param.add(Mapping.name2elename(member),
+ Mapping._obj2soap(obj[member], map))
+ end
+ else
+ param = SOAPStruct.new(TYPE_STRUCT)
+ mark_marshalled_obj(obj, param)
+ param.add('type', ele_type = SOAPString.new(obj.class.to_s))
+ ele_member = SOAPStruct.new
+ obj.members.each do |member|
+ ele_member.add(Mapping.name2elename(member),
+ Mapping._obj2soap(obj[member], map))
+ end
+ param.add('member', ele_member)
+ addiv2soapattr(param, obj, map)
+ end
+ when ::IO, ::Binding, ::Continuation, ::Data, ::Dir, ::File::Stat,
+ ::MatchData, Method, ::Proc, ::Thread, ::ThreadGroup
+ # from 1.8: Process::Status, UnboundMethod
+ return nil
+ when ::SOAP::Mapping::Object
+ param = SOAPStruct.new(XSD::AnyTypeName)
+ mark_marshalled_obj(obj, param)
+ obj.__xmlele.each do |key, value|
+ param.add(key.name, Mapping._obj2soap(value, map))
+ end
+ obj.__xmlattr.each do |key, value|
+ param.extraattr[key] = value
+ end
+ when ::Exception
+ typestr = Mapping.name2elename(obj.class.to_s)
+ param = SOAPStruct.new(XSD::QName.new(RubyTypeNamespace, typestr))
+ mark_marshalled_obj(obj, param)
+ param.add('message', Mapping._obj2soap(obj.message, map))
+ param.add('backtrace', Mapping._obj2soap(obj.backtrace, map))
+ addiv2soapattr(param, obj, map)
+ else
+ param = unknownobj2soap(soap_class, obj, info, map)
+ end
+ param
+ end
+
+ def soap2obj(obj_class, node, info, map)
+ rubytype = node.extraattr[RubyTypeName]
+ if rubytype or node.type.namespace == RubyTypeNamespace
+ rubytype2obj(node, info, map, rubytype)
+ elsif node.type == XSD::AnyTypeName or node.type == XSD::AnySimpleTypeName
+ anytype2obj(node, info, map)
+ else
+ unknowntype2obj(node, info, map)
+ end
+ end
+
+private
+
+ def addiv2soapattr(node, obj, map)
+ return if obj.instance_variables.empty?
+ ivars = SOAPStruct.new # Undefined type.
+ setiv2soap(ivars, obj, map)
+ node.extraattr[RubyIVarName] = ivars
+ end
+
+ def unknownobj2soap(soap_class, obj, info, map)
+ if obj.class.name.empty?
+ raise TypeError.new("can't dump anonymous class #{obj}")
+ end
+ singleton_class = class << obj; self; end
+ if !singleton_methods_true(obj).empty? or
+ !singleton_class.instance_variables.empty?
+ raise TypeError.new("singleton can't be dumped #{obj}")
+ end
+ if !(singleton_class.ancestors - obj.class.ancestors).empty?
+ typestr = Mapping.name2elename(obj.class.to_s)
+ type = XSD::QName.new(RubyTypeNamespace, typestr)
+ else
+ type = Mapping.class2element(obj.class)
+ end
+ param = SOAPStruct.new(type)
+ mark_marshalled_obj(obj, param)
+ setiv2soap(param, obj, map)
+ param
+ end
+
+ if RUBY_VERSION >= '1.8.0'
+ def singleton_methods_true(obj)
+ obj.singleton_methods(true)
+ end
+ else
+ def singleton_methods_true(obj)
+ obj.singleton_methods
+ end
+ end
+
+ def rubytype2obj(node, info, map, rubytype)
+ klass = rubytype ? Mapping.class_from_name(rubytype) : nil
+ obj = nil
+ case node
+ when SOAPString
+ return @string_factory.soap2obj(klass || String, node, info, map)
+ when SOAPDateTime
+ #return @datetime_factory.soap2obj(klass || Time, node, info, map)
+ klass ||= Time
+ t = node.to_time
+ arg = [t.year, t.month, t.mday, t.hour, t.min, t.sec, t.usec]
+ obj = t.gmt? ? klass.gm(*arg) : klass.local(*arg)
+ mark_unmarshalled_obj(node, obj)
+ return true, obj
+ when SOAPArray
+ return @array_factory.soap2obj(klass || Array, node, info, map)
+ when SOAPNil, SOAPBoolean, SOAPInt, SOAPInteger, SOAPDecimal, SOAPDouble
+ return @basetype_factory.soap2obj(nil, node, info, map)
+ when SOAPStruct
+ return rubytypestruct2obj(node, info, map, rubytype)
+ else
+ raise
+ end
+ end
+
+ def rubytypestruct2obj(node, info, map, rubytype)
+ klass = rubytype ? Mapping.class_from_name(rubytype) : nil
+ obj = nil
+ case node.type
+ when TYPE_HASH
+ klass = rubytype ? Mapping.class_from_name(rubytype) : Hash
+ obj = Mapping.create_empty_object(klass)
+ mark_unmarshalled_obj(node, obj)
+ node.each do |key, value|
+ next unless key == 'item'
+ obj[Mapping._soap2obj(value['key'], map)] =
+ Mapping._soap2obj(value['value'], map)
+ end
+ if node.key?('default')
+ obj.default = Mapping._soap2obj(node['default'], map)
+ end
+ when TYPE_REGEXP
+ klass = rubytype ? Mapping.class_from_name(rubytype) : Regexp
+ obj = Mapping.create_empty_object(klass)
+ mark_unmarshalled_obj(node, obj)
+ source = node['source'].string
+ options = node['options'].data || 0
+ Regexp.instance_method(:initialize).bind(obj).call(source, options)
+ when TYPE_RANGE
+ klass = rubytype ? Mapping.class_from_name(rubytype) : Range
+ obj = Mapping.create_empty_object(klass)
+ mark_unmarshalled_obj(node, obj)
+ first = Mapping._soap2obj(node['begin'], map)
+ last = Mapping._soap2obj(node['end'], map)
+ exclude_end = node['exclude_end'].data
+ Range.instance_method(:initialize).bind(obj).call(first, last, exclude_end)
+ when TYPE_CLASS
+ obj = Mapping.class_from_name(node['name'].data)
+ when TYPE_MODULE
+ obj = Mapping.class_from_name(node['name'].data)
+ when TYPE_SYMBOL
+ obj = node['id'].data.intern
+ when TYPE_STRUCT
+ typestr = Mapping.elename2name(node['type'].data)
+ klass = Mapping.class_from_name(typestr)
+ if klass.nil?
+ return false
+ end
+ unless klass <= ::Struct
+ return false
+ end
+ obj = Mapping.create_empty_object(klass)
+ mark_unmarshalled_obj(node, obj)
+ node['member'].each do |name, value|
+ obj[Mapping.elename2name(name)] = Mapping._soap2obj(value, map)
+ end
+ else
+ return unknowntype2obj(node, info, map)
+ end
+ return true, obj
+ end
+
+ def anytype2obj(node, info, map)
+ case node
+ when SOAPBasetype
+ return true, node.data
+ when SOAPStruct
+ klass = ::SOAP::Mapping::Object
+ obj = klass.new
+ mark_unmarshalled_obj(node, obj)
+ node.each do |name, value|
+ obj.__add_xmlele_value(XSD::QName.new(nil, name),
+ Mapping._soap2obj(value, map))
+ end
+ unless node.extraattr.empty?
+ obj.instance_variable_set('@__xmlattr', node.extraattr)
+ end
+ return true, obj
+ else
+ return false
+ end
+ end
+
+ def unknowntype2obj(node, info, map)
+ case node
+ when SOAPBasetype
+ return true, node.data
+ when SOAPArray
+ return @array_factory.soap2obj(Array, node, info, map)
+ when SOAPStruct
+ obj = unknownstruct2obj(node, info, map)
+ return true, obj if obj
+ if !@allow_untyped_struct
+ return false
+ end
+ return anytype2obj(node, info, map)
+ else
+ # Basetype which is not defined...
+ return false
+ end
+ end
+
+ def unknownstruct2obj(node, info, map)
+ unless node.type.name
+ return nil
+ end
+ typestr = Mapping.elename2name(node.type.name)
+ klass = Mapping.class_from_name(typestr)
+ if klass.nil? and @allow_untyped_struct
+ klass = Mapping.class_from_name(typestr, true) # lenient
+ end
+ if klass.nil?
+ return nil
+ end
+ if klass <= ::Exception
+ return exception2obj(klass, node, map)
+ end
+ klass_type = Mapping.class2qname(klass)
+ return nil unless node.type.match(klass_type)
+ obj = nil
+ begin
+ obj = Mapping.create_empty_object(klass)
+ rescue
+ # type name "data" tries Data.new which raises TypeError
+ nil
+ end
+ mark_unmarshalled_obj(node, obj)
+ setiv2obj(obj, node, map)
+ obj
+ end
+
+ def exception2obj(klass, node, map)
+ message = Mapping._soap2obj(node['message'], map)
+ backtrace = Mapping._soap2obj(node['backtrace'], map)
+ obj = Mapping.create_empty_object(klass)
+ obj = obj.exception(message)
+ mark_unmarshalled_obj(node, obj)
+ obj.set_backtrace(backtrace)
+ obj
+ end
+
+ # Only creates empty array. Do String#replace it with real string.
+ def array2obj(node, map, rubytype)
+ klass = rubytype ? Mapping.class_from_name(rubytype) : Array
+ obj = Mapping.create_empty_object(klass)
+ mark_unmarshalled_obj(node, obj)
+ obj
+ end
+
+ # Only creates empty string. Do String#replace it with real string.
+ def string2obj(node, map, rubytype)
+ klass = rubytype ? Mapping.class_from_name(rubytype) : String
+ obj = Mapping.create_empty_object(klass)
+ mark_unmarshalled_obj(node, obj)
+ obj
+ end
+end
+
+
+end
+end
diff --git a/lib/soap/mapping/typeMap.rb b/lib/soap/mapping/typeMap.rb
new file mode 100644
index 0000000000..34db19a5b6
--- /dev/null
+++ b/lib/soap/mapping/typeMap.rb
@@ -0,0 +1,50 @@
+# SOAP4R - Base type mapping definition
+# Copyright (C) 2000, 2001, 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+module SOAP
+
+
+TypeMap = {
+ XSD::XSDAnySimpleType::Type => SOAPAnySimpleType,
+ XSD::XSDString::Type => SOAPString,
+ XSD::XSDBoolean::Type => SOAPBoolean,
+ XSD::XSDDecimal::Type => SOAPDecimal,
+ XSD::XSDFloat::Type => SOAPFloat,
+ XSD::XSDDouble::Type => SOAPDouble,
+ XSD::XSDDuration::Type => SOAPDuration,
+ XSD::XSDDateTime::Type => SOAPDateTime,
+ XSD::XSDTime::Type => SOAPTime,
+ XSD::XSDDate::Type => SOAPDate,
+ XSD::XSDGYearMonth::Type => SOAPGYearMonth,
+ XSD::XSDGYear::Type => SOAPGYear,
+ XSD::XSDGMonthDay::Type => SOAPGMonthDay,
+ XSD::XSDGDay::Type => SOAPGDay,
+ XSD::XSDGMonth::Type => SOAPGMonth,
+ XSD::XSDHexBinary::Type => SOAPHexBinary,
+ XSD::XSDBase64Binary::Type => SOAPBase64,
+ XSD::XSDAnyURI::Type => SOAPAnyURI,
+ XSD::XSDQName::Type => SOAPQName,
+ XSD::XSDInteger::Type => SOAPInteger,
+ XSD::XSDNonPositiveInteger::Type => SOAPNonPositiveInteger,
+ XSD::XSDNegativeInteger::Type => SOAPNegativeInteger,
+ XSD::XSDLong::Type => SOAPLong,
+ XSD::XSDInt::Type => SOAPInt,
+ XSD::XSDShort::Type => SOAPShort,
+ XSD::XSDByte::Type => SOAPByte,
+ XSD::XSDNonNegativeInteger::Type => SOAPNonNegativeInteger,
+ XSD::XSDUnsignedLong::Type => SOAPUnsignedLong,
+ XSD::XSDUnsignedInt::Type => SOAPUnsignedInt,
+ XSD::XSDUnsignedShort::Type => SOAPUnsignedShort,
+ XSD::XSDUnsignedByte::Type => SOAPUnsignedByte,
+ XSD::XSDPositiveInteger::Type => SOAPPositiveInteger,
+
+ SOAP::SOAPBase64::Type => SOAPBase64,
+}
+
+
+end
diff --git a/lib/soap/mapping/wsdlencodedregistry.rb b/lib/soap/mapping/wsdlencodedregistry.rb
new file mode 100644
index 0000000000..4efb60188f
--- /dev/null
+++ b/lib/soap/mapping/wsdlencodedregistry.rb
@@ -0,0 +1,280 @@
+# SOAP4R - WSDL encoded mapping registry.
+# Copyright (C) 2000-2003, 2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+require 'xsd/qname'
+require 'xsd/namedelements'
+require 'soap/baseData'
+require 'soap/mapping/mapping'
+require 'soap/mapping/typeMap'
+
+
+module SOAP
+module Mapping
+
+
+class WSDLEncodedRegistry < Registry
+ include TraverseSupport
+
+ attr_reader :definedelements
+ attr_reader :definedtypes
+ attr_accessor :excn_handler_obj2soap
+ attr_accessor :excn_handler_soap2obj
+
+ def initialize(definedtypes = XSD::NamedElements::Empty)
+ @definedtypes = definedtypes
+ # @definedelements = definedelements needed?
+ @excn_handler_obj2soap = nil
+ @excn_handler_soap2obj = nil
+ # For mapping AnyType element.
+ @rubytype_factory = RubytypeFactory.new(
+ :allow_untyped_struct => true,
+ :allow_original_mapping => true
+ )
+ @schema_element_cache = {}
+ end
+
+ def obj2soap(obj, qname = nil)
+ soap_obj = nil
+ if type = @definedtypes[qname]
+ soap_obj = obj2typesoap(obj, type)
+ else
+ soap_obj = any2soap(obj, qname)
+ end
+ return soap_obj if soap_obj
+ if @excn_handler_obj2soap
+ soap_obj = @excn_handler_obj2soap.call(obj) { |yield_obj|
+ Mapping._obj2soap(yield_obj, self)
+ }
+ return soap_obj if soap_obj
+ end
+ if qname
+ raise MappingError.new("cannot map #{obj.class.name} as #{qname}")
+ else
+ raise MappingError.new("cannot map #{obj.class.name} to SOAP/OM")
+ end
+ end
+
+ # map anything for now: must refer WSDL while mapping. [ToDo]
+ def soap2obj(node, obj_class = nil)
+ begin
+ return any2obj(node, obj_class)
+ rescue MappingError
+ end
+ if @excn_handler_soap2obj
+ begin
+ return @excn_handler_soap2obj.call(node) { |yield_node|
+ Mapping._soap2obj(yield_node, self)
+ }
+ rescue Exception
+ end
+ end
+ raise MappingError.new("cannot map #{node.type.name} to Ruby object")
+ end
+
+private
+
+ def any2soap(obj, qname)
+ if obj.nil?
+ SOAPNil.new
+ elsif qname.nil? or qname == XSD::AnyTypeName
+ @rubytype_factory.obj2soap(nil, obj, nil, self)
+ elsif obj.is_a?(XSD::NSDBase)
+ soap2soap(obj, qname)
+ elsif (type = TypeMap[qname])
+ base2soap(obj, type)
+ else
+ nil
+ end
+ end
+
+ def soap2soap(obj, type_qname)
+ if obj.is_a?(SOAPBasetype)
+ obj
+ elsif obj.is_a?(SOAPStruct) && (type = @definedtypes[type_qname])
+ soap_obj = obj
+ mark_marshalled_obj(obj, soap_obj)
+ elements2soap(obj, soap_obj, type.content.elements)
+ soap_obj
+ elsif obj.is_a?(SOAPArray) && (type = @definedtypes[type_qname])
+ soap_obj = obj
+ contenttype = type.child_type
+ mark_marshalled_obj(obj, soap_obj)
+ obj.replace do |ele|
+ Mapping._obj2soap(ele, self, contenttype)
+ end
+ soap_obj
+ else
+ nil
+ end
+ end
+
+ def obj2typesoap(obj, type)
+ if type.is_a?(::WSDL::XMLSchema::SimpleType)
+ simpleobj2soap(obj, type)
+ else
+ complexobj2soap(obj, type)
+ end
+ end
+
+ def simpleobj2soap(obj, type)
+ type.check_lexical_format(obj)
+ return SOAPNil.new if obj.nil? # ToDo: check nillable.
+ o = base2soap(obj, TypeMap[type.base])
+ o
+ end
+
+ def complexobj2soap(obj, type)
+ case type.compoundtype
+ when :TYPE_STRUCT
+ struct2soap(obj, type.name, type)
+ when :TYPE_ARRAY
+ array2soap(obj, type.name, type)
+ when :TYPE_MAP
+ map2soap(obj, type.name, type)
+ when :TYPE_SIMPLE
+ simpleobj2soap(obj, type.simplecontent)
+ when :TYPE_EMPTY
+ raise MappingError.new("should be empty") unless obj.nil?
+ SOAPNil.new
+ else
+ raise MappingError.new("unknown compound type: #{type.compoundtype}")
+ end
+ end
+
+ def base2soap(obj, type)
+ soap_obj = nil
+ if type <= XSD::XSDString
+ str = XSD::Charset.encoding_conv(obj.to_s,
+ Thread.current[:SOAPExternalCES], XSD::Charset.encoding)
+ soap_obj = type.new(str)
+ mark_marshalled_obj(obj, soap_obj)
+ else
+ soap_obj = type.new(obj)
+ end
+ soap_obj
+ end
+
+ def struct2soap(obj, type_qname, type)
+ return SOAPNil.new if obj.nil? # ToDo: check nillable.
+ soap_obj = SOAPStruct.new(type_qname)
+ unless obj.nil?
+ mark_marshalled_obj(obj, soap_obj)
+ elements2soap(obj, soap_obj, type.content.elements)
+ end
+ soap_obj
+ end
+
+ def array2soap(obj, type_qname, type)
+ return SOAPNil.new if obj.nil? # ToDo: check nillable.
+ arytype = type.child_type
+ soap_obj = SOAPArray.new(ValueArrayName, 1, arytype)
+ unless obj.nil?
+ mark_marshalled_obj(obj, soap_obj)
+ obj.each do |item|
+ soap_obj.add(Mapping._obj2soap(item, self, arytype))
+ end
+ end
+ soap_obj
+ end
+
+ MapKeyName = XSD::QName.new(nil, "key")
+ MapValueName = XSD::QName.new(nil, "value")
+ def map2soap(obj, type_qname, type)
+ return SOAPNil.new if obj.nil? # ToDo: check nillable.
+ keytype = type.child_type(MapKeyName) || XSD::AnyTypeName
+ valuetype = type.child_type(MapValueName) || XSD::AnyTypeName
+ soap_obj = SOAPStruct.new(MapQName)
+ unless obj.nil?
+ mark_marshalled_obj(obj, soap_obj)
+ obj.each do |key, value|
+ elem = SOAPStruct.new
+ elem.add("key", Mapping._obj2soap(key, self, keytype))
+ elem.add("value", Mapping._obj2soap(value, self, valuetype))
+ # ApacheAxis allows only 'item' here.
+ soap_obj.add("item", elem)
+ end
+ end
+ soap_obj
+ end
+
+ def elements2soap(obj, soap_obj, elements)
+ elements.each do |element|
+ name = element.name.name
+ child_obj = Mapping.get_attribute(obj, name)
+ soap_obj.add(name,
+ Mapping._obj2soap(child_obj, self, element.type || element.name))
+ end
+ end
+
+ def any2obj(node, obj_class)
+ unless obj_class
+ typestr = XSD::CodeGen::GenSupport.safeconstname(node.elename.name)
+ obj_class = Mapping.class_from_name(typestr)
+ end
+ if obj_class and obj_class.class_variables.include?('@@schema_element')
+ soap2stubobj(node, obj_class)
+ else
+ Mapping._soap2obj(node, Mapping::DefaultRegistry, obj_class)
+ end
+ end
+
+ def soap2stubobj(node, obj_class)
+ obj = Mapping.create_empty_object(obj_class)
+ unless node.is_a?(SOAPNil)
+ add_elements2stubobj(node, obj)
+ end
+ obj
+ end
+
+ def add_elements2stubobj(node, obj)
+ elements, as_array = schema_element_definition(obj.class)
+ vars = {}
+ node.each do |name, value|
+ item = elements.find { |k, v| k.name == name }
+ if item
+ elename, class_name = item
+ if klass = Mapping.class_from_name(class_name)
+ # klass must be a SOAPBasetype or a class
+ if klass.ancestors.include?(::SOAP::SOAPBasetype)
+ if value.respond_to?(:data)
+ child = klass.new(value.data).data
+ else
+ child = klass.new(nil).data
+ end
+ else
+ child = Mapping._soap2obj(value, self, klass)
+ end
+ elsif klass = Mapping.module_from_name(class_name)
+ # simpletype
+ if value.respond_to?(:data)
+ child = value.data
+ else
+ raise MappingError.new(
+ "cannot map to a module value: #{class_name}")
+ end
+ else
+ raise MappingError.new("unknown class: #{class_name}")
+ end
+ else # untyped element is treated as anyType.
+ child = Mapping._soap2obj(value, self)
+ end
+ vars[name] = child
+ end
+ Mapping.set_attributes(obj, vars)
+ end
+
+ # it caches @@schema_element. this means that @@schema_element must not be
+ # changed while a lifetime of a WSDLLiteralRegistry.
+ def schema_element_definition(klass)
+ @schema_element_cache[klass] ||= Mapping.schema_element_definition(klass)
+ end
+end
+
+
+end
+end
diff --git a/lib/soap/mapping/wsdlliteralregistry.rb b/lib/soap/mapping/wsdlliteralregistry.rb
new file mode 100644
index 0000000000..7bb8e12203
--- /dev/null
+++ b/lib/soap/mapping/wsdlliteralregistry.rb
@@ -0,0 +1,418 @@
+# SOAP4R - WSDL literal mapping registry.
+# Copyright (C) 2004, 2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+require 'soap/baseData'
+require 'soap/mapping/mapping'
+require 'soap/mapping/typeMap'
+require 'xsd/codegen/gensupport'
+require 'xsd/namedelements'
+
+
+module SOAP
+module Mapping
+
+
+class WSDLLiteralRegistry < Registry
+ attr_reader :definedelements
+ attr_reader :definedtypes
+ attr_accessor :excn_handler_obj2soap
+ attr_accessor :excn_handler_soap2obj
+
+ def initialize(definedtypes = XSD::NamedElements::Empty,
+ definedelements = XSD::NamedElements::Empty)
+ @definedtypes = definedtypes
+ @definedelements = definedelements
+ @excn_handler_obj2soap = nil
+ @excn_handler_soap2obj = nil
+ @schema_element_cache = {}
+ @schema_attribute_cache = {}
+ end
+
+ def obj2soap(obj, qname)
+ soap_obj = nil
+ if ele = @definedelements[qname]
+ soap_obj = obj2elesoap(obj, ele)
+ elsif type = @definedtypes[qname]
+ soap_obj = obj2typesoap(obj, type, true)
+ else
+ soap_obj = any2soap(obj, qname)
+ end
+ return soap_obj if soap_obj
+ if @excn_handler_obj2soap
+ soap_obj = @excn_handler_obj2soap.call(obj) { |yield_obj|
+ Mapping.obj2soap(yield_obj, nil, nil, MAPPING_OPT)
+ }
+ return soap_obj if soap_obj
+ end
+ raise MappingError.new("cannot map #{obj.class.name} as #{qname}")
+ end
+
+ # node should be a SOAPElement
+ def soap2obj(node, obj_class = nil)
+ # obj_class is given when rpc/literal service. but ignored for now.
+ begin
+ return any2obj(node)
+ rescue MappingError
+ end
+ if @excn_handler_soap2obj
+ begin
+ return @excn_handler_soap2obj.call(node) { |yield_node|
+ Mapping.soap2obj(yield_node, nil, nil, MAPPING_OPT)
+ }
+ rescue Exception
+ end
+ end
+ if node.respond_to?(:type)
+ raise MappingError.new("cannot map #{node.type.name} to Ruby object")
+ else
+ raise MappingError.new("cannot map #{node.elename.name} to Ruby object")
+ end
+ end
+
+private
+
+ MAPPING_OPT = { :no_reference => true }
+
+ def obj2elesoap(obj, ele)
+ o = nil
+ qualified = (ele.elementform == 'qualified')
+ if ele.type
+ if type = @definedtypes[ele.type]
+ o = obj2typesoap(obj, type, qualified)
+ elsif type = TypeMap[ele.type]
+ o = base2soap(obj, type)
+ else
+ raise MappingError.new("cannot find type #{ele.type}")
+ end
+ elsif ele.local_complextype
+ o = obj2typesoap(obj, ele.local_complextype, qualified)
+ add_attributes2soap(obj, o)
+ elsif ele.local_simpletype
+ o = obj2typesoap(obj, ele.local_simpletype, qualified)
+ else
+ raise MappingError.new('illegal schema?')
+ end
+ o.elename = ele.name
+ o
+ end
+
+ def obj2typesoap(obj, type, qualified)
+ if type.is_a?(::WSDL::XMLSchema::SimpleType)
+ simpleobj2soap(obj, type)
+ else
+ complexobj2soap(obj, type, qualified)
+ end
+ end
+
+ def simpleobj2soap(obj, type)
+ type.check_lexical_format(obj)
+ return SOAPNil.new if obj.nil? # ToDo: check nillable.
+ o = base2soap(obj, TypeMap[type.base])
+ o
+ end
+
+ def complexobj2soap(obj, type, qualified)
+ o = SOAPElement.new(type.name)
+ o.qualified = qualified
+ type.each_element do |child_ele|
+ child = Mapping.get_attribute(obj, child_ele.name.name)
+ if child.nil?
+ if child_ele.nillable
+ # ToDo: test
+ # add empty element
+ child_soap = obj2elesoap(nil, child_ele)
+ o.add(child_soap)
+ elsif Integer(child_ele.minoccurs) == 0
+ # nothing to do
+ else
+ raise MappingError.new("nil not allowed: #{child_ele.name.name}")
+ end
+ elsif child_ele.map_as_array?
+ child.each do |item|
+ child_soap = obj2elesoap(item, child_ele)
+ o.add(child_soap)
+ end
+ else
+ child_soap = obj2elesoap(child, child_ele)
+ o.add(child_soap)
+ end
+ end
+ o
+ end
+
+ def any2soap(obj, qname)
+ if obj.is_a?(SOAPElement)
+ obj
+ elsif obj.class.class_variables.include?('@@schema_element')
+ stubobj2soap(obj, qname)
+ elsif obj.is_a?(SOAP::Mapping::Object)
+ mappingobj2soap(obj, qname)
+ elsif obj.is_a?(Hash)
+ ele = SOAPElement.from_obj(obj)
+ ele.elename = qname
+ ele
+ else
+ # expected to be a basetype or an anyType.
+ # SOAPStruct, etc. is used instead of SOAPElement.
+ begin
+ ele = Mapping.obj2soap(obj, nil, nil, MAPPING_OPT)
+ ele.elename = qname
+ ele
+ rescue MappingError
+ ele = SOAPElement.new(qname, obj.to_s)
+ end
+ if obj.respond_to?(:__xmlattr)
+ obj.__xmlattr.each do |key, value|
+ ele.extraattr[key] = value
+ end
+ end
+ ele
+ end
+ end
+
+ def stubobj2soap(obj, qname)
+ ele = SOAPElement.new(qname)
+ ele.qualified =
+ (obj.class.class_variables.include?('@@schema_qualified') and
+ obj.class.class_eval('@@schema_qualified'))
+ add_elements2soap(obj, ele)
+ add_attributes2soap(obj, ele)
+ ele
+ end
+
+ def mappingobj2soap(obj, qname)
+ ele = SOAPElement.new(qname)
+ obj.__xmlele.each do |key, value|
+ if value.is_a?(::Array)
+ value.each do |item|
+ ele.add(obj2soap(item, key))
+ end
+ else
+ ele.add(obj2soap(value, key))
+ end
+ end
+ obj.__xmlattr.each do |key, value|
+ ele.extraattr[key] = value
+ end
+ ele
+ end
+
+ def add_elements2soap(obj, ele)
+ elements, as_array = schema_element_definition(obj.class)
+ if elements
+ elements.each do |elename, type|
+ if child = Mapping.get_attribute(obj, elename.name)
+ if as_array.include?(elename.name)
+ child.each do |item|
+ ele.add(obj2soap(item, elename))
+ end
+ else
+ ele.add(obj2soap(child, elename))
+ end
+ elsif obj.is_a?(::Array) and as_array.include?(elename.name)
+ obj.each do |item|
+ ele.add(obj2soap(item, elename))
+ end
+ end
+ end
+ end
+ end
+
+ def add_attributes2soap(obj, ele)
+ attributes = schema_attribute_definition(obj.class)
+ if attributes
+ attributes.each do |qname, param|
+ attr = obj.__send__('xmlattr_' +
+ XSD::CodeGen::GenSupport.safevarname(qname.name))
+ ele.extraattr[qname] = attr
+ end
+ end
+ end
+
+ def base2soap(obj, type)
+ soap_obj = nil
+ if type <= XSD::XSDString
+ str = XSD::Charset.encoding_conv(obj.to_s,
+ Thread.current[:SOAPExternalCES], XSD::Charset.encoding)
+ soap_obj = type.new(str)
+ else
+ soap_obj = type.new(obj)
+ end
+ soap_obj
+ end
+
+ def anytype2obj(node)
+ if node.is_a?(::SOAP::SOAPBasetype)
+ return node.data
+ end
+ klass = ::SOAP::Mapping::Object
+ obj = klass.new
+ obj
+ end
+
+ def any2obj(node, obj_class = nil)
+ unless obj_class
+ typestr = XSD::CodeGen::GenSupport.safeconstname(node.elename.name)
+ obj_class = Mapping.class_from_name(typestr)
+ end
+ if obj_class and obj_class.class_variables.include?('@@schema_element')
+ soapele2stubobj(node, obj_class)
+ elsif node.is_a?(SOAPElement) or node.is_a?(SOAPStruct)
+ # SOAPArray for literal?
+ soapele2plainobj(node)
+ else
+ obj = Mapping.soap2obj(node, nil, obj_class, MAPPING_OPT)
+ add_attributes2plainobj(node, obj)
+ obj
+ end
+ end
+
+ def soapele2stubobj(node, obj_class)
+ obj = Mapping.create_empty_object(obj_class)
+ add_elements2stubobj(node, obj)
+ add_attributes2stubobj(node, obj)
+ obj
+ end
+
+ def soapele2plainobj(node)
+ obj = anytype2obj(node)
+ add_elements2plainobj(node, obj)
+ add_attributes2plainobj(node, obj)
+ obj
+ end
+
+ def add_elements2stubobj(node, obj)
+ elements, as_array = schema_element_definition(obj.class)
+ vars = {}
+ node.each do |name, value|
+ item = elements.find { |k, v| k.name == name }
+ if item
+ elename, class_name = item
+ if klass = Mapping.class_from_name(class_name)
+ # klass must be a SOAPBasetype or a class
+ if klass.ancestors.include?(::SOAP::SOAPBasetype)
+ if value.respond_to?(:data)
+ child = klass.new(value.data).data
+ else
+ child = klass.new(nil).data
+ end
+ else
+ child = any2obj(value, klass)
+ end
+ elsif klass = Mapping.module_from_name(class_name)
+ # simpletype
+ if value.respond_to?(:data)
+ child = value.data
+ else
+ raise MappingError.new(
+ "cannot map to a module value: #{class_name}")
+ end
+ else
+ raise MappingError.new("unknown class/module: #{class_name}")
+ end
+ else # untyped element is treated as anyType.
+ child = any2obj(value)
+ end
+ if as_array.include?(elename.name)
+ (vars[name] ||= []) << child
+ else
+ vars[name] = child
+ end
+ end
+ Mapping.set_attributes(obj, vars)
+ end
+
+ def add_attributes2stubobj(node, obj)
+ if attributes = schema_attribute_definition(obj.class)
+ define_xmlattr(obj)
+ attributes.each do |qname, class_name|
+ attr = node.extraattr[qname]
+ next if attr.nil? or attr.empty?
+ klass = Mapping.class_from_name(class_name)
+ if klass.ancestors.include?(::SOAP::SOAPBasetype)
+ child = klass.new(attr).data
+ else
+ child = attr
+ end
+ obj.__xmlattr[qname] = child
+ define_xmlattr_accessor(obj, qname)
+ end
+ end
+ end
+
+ def add_elements2plainobj(node, obj)
+ node.each do |name, value|
+ obj.__add_xmlele_value(value.elename, any2obj(value))
+ end
+ end
+
+ def add_attributes2plainobj(node, obj)
+ return if node.extraattr.empty?
+ define_xmlattr(obj)
+ node.extraattr.each do |qname, value|
+ obj.__xmlattr[qname] = value
+ define_xmlattr_accessor(obj, qname)
+ end
+ end
+
+ if RUBY_VERSION > "1.7.0"
+ def define_xmlattr_accessor(obj, qname)
+ name = XSD::CodeGen::GenSupport.safemethodname(qname.name)
+ Mapping.define_attr_accessor(obj, 'xmlattr_' + name,
+ proc { @__xmlattr[qname] },
+ proc { |value| @__xmlattr[qname] = value })
+ end
+ else
+ def define_xmlattr_accessor(obj, qname)
+ name = XSD::CodeGen::GenSupport.safemethodname(qname.name)
+ obj.instance_eval <<-EOS
+ def #{name}
+ @__xmlattr[#{qname.dump}]
+ end
+
+ def #{name}=(value)
+ @__xmlattr[#{qname.dump}] = value
+ end
+ EOS
+ end
+ end
+
+ if RUBY_VERSION > "1.7.0"
+ def define_xmlattr(obj)
+ obj.instance_variable_set('@__xmlattr', {})
+ unless obj.respond_to?(:__xmlattr)
+ Mapping.define_attr_accessor(obj, :__xmlattr, proc { @__xmlattr })
+ end
+ end
+ else
+ def define_xmlattr(obj)
+ obj.instance_variable_set('@__xmlattr', {})
+ unless obj.respond_to?(:__xmlattr)
+ obj.instance_eval <<-EOS
+ def __xmlattr
+ @__xmlattr
+ end
+ EOS
+ end
+ end
+ end
+
+ # it caches @@schema_element. this means that @@schema_element must not be
+ # changed while a lifetime of a WSDLLiteralRegistry.
+ def schema_element_definition(klass)
+ @schema_element_cache[klass] ||= Mapping.schema_element_definition(klass)
+ end
+
+ def schema_attribute_definition(klass)
+ @schema_attribute_cache[klass] ||= Mapping.schema_attribute_definition(klass)
+ end
+end
+
+
+end
+end
diff --git a/lib/soap/marshal.rb b/lib/soap/marshal.rb
new file mode 100644
index 0000000000..1c3d5b01db
--- /dev/null
+++ b/lib/soap/marshal.rb
@@ -0,0 +1,59 @@
+# SOAP4R - Marshalling/Unmarshalling Ruby's object using SOAP Encoding.
+# Copyright (C) 2001, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+require "soap/mapping"
+require "soap/processor"
+
+
+module SOAP
+
+
+module Marshal
+ # Trying xsd:dateTime data to be recovered as aTime.
+ MarshalMappingRegistry = Mapping::Registry.new(
+ :allow_original_mapping => true)
+ MarshalMappingRegistry.add(
+ Time,
+ ::SOAP::SOAPDateTime,
+ ::SOAP::Mapping::Registry::DateTimeFactory
+ )
+
+ class << self
+ public
+ def dump(obj, io = nil)
+ marshal(obj, MarshalMappingRegistry, io)
+ end
+
+ def load(stream)
+ unmarshal(stream, MarshalMappingRegistry)
+ end
+
+ def marshal(obj, mapping_registry = MarshalMappingRegistry, io = nil)
+ elename = Mapping.name2elename(obj.class.to_s)
+ soap_obj = Mapping.obj2soap(obj, mapping_registry)
+ body = SOAPBody.new
+ body.add(elename, soap_obj)
+ env = SOAPEnvelope.new(nil, body)
+ SOAP::Processor.marshal(env, {}, io)
+ end
+
+ def unmarshal(stream, mapping_registry = MarshalMappingRegistry)
+ env = SOAP::Processor.unmarshal(stream)
+ if env.nil?
+ raise ArgumentError.new("Illegal SOAP marshal format.")
+ end
+ Mapping.soap2obj(env.body.root_node, mapping_registry)
+ end
+ end
+end
+
+
+end
+
+
+SOAPMarshal = SOAP::Marshal
diff --git a/lib/soap/mimemessage.rb b/lib/soap/mimemessage.rb
new file mode 100644
index 0000000000..acb4322e11
--- /dev/null
+++ b/lib/soap/mimemessage.rb
@@ -0,0 +1,240 @@
+# SOAP4R - MIME Message implementation.
+# Copyright (C) 2002 Jamie Herre.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+require 'soap/attachment'
+
+
+module SOAP
+
+
+# Classes for MIME message handling. Should be put somewhere else!
+# Tried using the 'tmail' module but found that I needed something
+# lighter in weight.
+
+
+class MIMEMessage
+ class MIMEMessageError < StandardError; end
+
+ MultipartContentType = 'multipart/\w+'
+
+ class Header
+ attr_accessor :str, :key, :root
+
+ def initialize
+ @attrs = {}
+ end
+
+ def [](key)
+ @attrs[key]
+ end
+
+ def []=(key, value)
+ @attrs[key] = value
+ end
+
+ def to_s
+ @key + ": " + @str
+ end
+ end
+
+ class Headers < Hash
+ def self.parse(str)
+ new.parse(str)
+ end
+
+ def parse(str)
+ header_cache = nil
+ str.each do |line|
+ case line
+ when /^\A[^\: \t]+:\s*.+$/
+ parse_line(header_cache) if header_cache
+ header_cache = line.sub(/\r?\n\z/, '')
+ when /^\A\s+(.*)$/
+ # a continuous line at the beginning line crashes here.
+ header_cache << line
+ else
+ raise RuntimeError.new("unexpected header: #{line.inspect}")
+ end
+ end
+ parse_line(header_cache) if header_cache
+ self
+ end
+
+ def parse_line(line)
+ if /^\A([^\: \t]+):\s*(.+)\z/ =~ line
+ header = parse_rhs($2.strip)
+ header.key = $1.strip
+ self[header.key.downcase] = header
+ else
+ raise RuntimeError.new("unexpected header line: #{line.inspect}")
+ end
+ end
+
+ def parse_rhs(str)
+ a = str.split(/;+\s+/)
+ header = Header.new
+ header.str = str
+ header.root = a.shift
+ a.each do |pair|
+ if pair =~ /(\w+)\s*=\s*"?([^"]+)"?/
+ header[$1.downcase] = $2
+ else
+ raise RuntimeError.new("unexpected header component: #{pair.inspect}")
+ end
+ end
+ header
+ end
+
+ def add(key, value)
+ if key != nil and value != nil
+ header = parse_rhs(value)
+ header.key = key
+ self[key.downcase] = header
+ end
+ end
+
+ def to_s
+ self.values.collect { |hdr|
+ hdr.to_s
+ }.join("\r\n")
+ end
+ end
+
+ class Part
+ attr_accessor :headers, :body
+
+ def initialize
+ @headers = Headers.new
+ @headers.add("Content-Transfer-Encoding", "8bit")
+ @body = nil
+ @contentid = nil
+ end
+
+ def self.parse(str)
+ new.parse(str)
+ end
+
+ def parse(str)
+ headers, body = str.split(/\r\n\r\n/s)
+ if headers != nil and body != nil
+ @headers = Headers.parse(headers)
+ @body = body.sub(/\r\n\z/, '')
+ else
+ raise RuntimeError.new("unexpected part: #{str.inspect}")
+ end
+ self
+ end
+
+ def contentid
+ if @contentid == nil and @headers.key?('content-id')
+ @contentid = @headers['content-id'].str
+ @contentid = $1 if @contentid =~ /^<(.+)>$/
+ end
+ @contentid
+ end
+
+ alias content body
+
+ def to_s
+ @headers.to_s + "\r\n\r\n" + @body
+ end
+ end
+
+ def initialize
+ @parts = []
+ @headers = Headers.new
+ @root = nil
+ end
+
+ def self.parse(head, str)
+ new.parse(head, str)
+ end
+
+ attr_reader :parts, :headers
+
+ def close
+ @headers.add(
+ "Content-Type",
+ "multipart/related; type=\"text/xml\"; boundary=\"#{boundary}\"; start=\"#{@parts[0].contentid}\""
+ )
+ end
+
+ def parse(head, str)
+ @headers = Headers.parse(head + "\r\n" + "From: jfh\r\n")
+ boundary = @headers['content-type']['boundary']
+ if boundary != nil
+ parts = str.split(/--#{Regexp.quote(boundary)}\s*(?:\r\n|--\r\n)/)
+ part = parts.shift # preamble must be ignored.
+ @parts = parts.collect { |part| Part.parse(part) }
+ else
+ @parts = [Part.parse(str)]
+ end
+ if @parts.length < 1
+ raise MIMEMessageError.new("This message contains no valid parts!")
+ end
+ self
+ end
+
+ def root
+ if @root == nil
+ start = @headers['content-type']['start']
+ @root = (start && @parts.find { |prt| prt.contentid == start }) ||
+ @parts[0]
+ end
+ @root
+ end
+
+ def boundary
+ if @boundary == nil
+ @boundary = "----=Part_" + __id__.to_s + rand.to_s
+ end
+ @boundary
+ end
+
+ def add_part(content)
+ part = Part.new
+ part.headers.add("Content-Type",
+ "text/xml; charset=" + XSD::Charset.xml_encoding_label)
+ part.headers.add("Content-ID", Attachment.contentid(part))
+ part.body = content
+ @parts.unshift(part)
+ end
+
+ def add_attachment(attach)
+ part = Part.new
+ part.headers.add("Content-Type", attach.contenttype)
+ part.headers.add("Content-ID", attach.mime_contentid)
+ part.body = attach.content
+ @parts.unshift(part)
+ end
+
+ def has_parts?
+ (@parts.length > 0)
+ end
+
+ def headers_str
+ @headers.to_s
+ end
+
+ def content_str
+ str = ''
+ @parts.each do |prt|
+ str << "--" + boundary + "\r\n"
+ str << prt.to_s + "\r\n"
+ end
+ str << '--' + boundary + "--\r\n"
+ str
+ end
+
+ def to_s
+ str = headers_str + "\r\n\r\n" + conent_str
+ end
+end
+
+
+end
diff --git a/lib/soap/netHttpClient.rb b/lib/soap/netHttpClient.rb
new file mode 100644
index 0000000000..10d68e2a4c
--- /dev/null
+++ b/lib/soap/netHttpClient.rb
@@ -0,0 +1,190 @@
+# SOAP4R - net/http wrapper
+# Copyright (C) 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+require 'net/http'
+
+
+module SOAP
+
+
+class NetHttpClient
+
+ SSLEnabled = begin
+ require 'net/https'
+ true
+ rescue LoadError
+ false
+ end
+
+ attr_reader :proxy
+ attr_accessor :no_proxy
+ attr_accessor :debug_dev
+ attr_accessor :ssl_config # ignored for now.
+ attr_accessor :protocol_version # ignored for now.
+ attr_accessor :connect_timeout
+ attr_accessor :send_timeout # ignored for now.
+ attr_accessor :receive_timeout
+
+ def initialize(proxy = nil, agent = nil)
+ @proxy = proxy ? URI.parse(proxy) : nil
+ @agent = agent
+ @debug_dev = nil
+ @session_manager = SessionManager.new
+ @no_proxy = @ssl_config = @protocol_version = nil
+ @connect_timeout = @send_timeout = @receive_timeout = nil
+ end
+
+ def test_loopback_response
+ raise NotImplementedError.new("not supported for now")
+ end
+
+ def proxy=(proxy)
+ if proxy.nil?
+ @proxy = nil
+ else
+ if proxy.is_a?(URI)
+ @proxy = proxy
+ else
+ @proxy = URI.parse(proxy)
+ end
+ if @proxy.scheme == nil or @proxy.scheme.downcase != 'http' or
+ @proxy.host == nil or @proxy.port == nil
+ raise ArgumentError.new("unsupported proxy `#{proxy}'")
+ end
+ end
+ reset_all
+ @proxy
+ end
+
+ def set_basic_auth(uri, user_id, passwd)
+ # net/http does not handle url.
+ @basic_auth = [user_id, passwd]
+ raise NotImplementedError.new("basic_auth is not supported under soap4r + net/http.")
+ end
+
+ def set_cookie_store(filename)
+ raise NotImplementedError.new
+ end
+
+ def save_cookie_store(filename)
+ raise NotImplementedError.new
+ end
+
+ def reset(url)
+ # no persistent connection. ignored.
+ end
+
+ def reset_all
+ # no persistent connection. ignored.
+ end
+
+ def post(url, req_body, header = {})
+ unless url.is_a?(URI)
+ url = URI.parse(url)
+ end
+ extra = header.dup
+ extra['User-Agent'] = @agent if @agent
+ res = start(url) { |http|
+ http.post(url.request_uri, req_body, extra)
+ }
+ Response.new(res)
+ end
+
+ def get_content(url, header = {})
+ unless url.is_a?(URI)
+ url = URI.parse(url)
+ end
+ extra = header.dup
+ extra['User-Agent'] = @agent if @agent
+ res = start(url) { |http|
+ http.get(url.request_uri, extra)
+ }
+ res.body
+ end
+
+private
+
+ def start(url)
+ http = create_connection(url)
+ response = nil
+ http.start { |worker|
+ response = yield(worker)
+ worker.finish
+ }
+ @debug_dev << response.body if @debug_dev
+ response
+ end
+
+ def create_connection(url)
+ proxy_host = proxy_port = nil
+ unless no_proxy?(url)
+ proxy_host = @proxy.host
+ proxy_port = @proxy.port
+ end
+ http = Net::HTTP::Proxy(proxy_host, proxy_port).new(url.host, url.port)
+ if http.respond_to?(:set_debug_output)
+ http.set_debug_output(@debug_dev)
+ end
+ http.open_timeout = @connect_timeout if @connect_timeout
+ http.read_timeout = @receive_timeout if @receive_timeout
+ case url
+ when URI::HTTPS
+ if SSLEnabled
+ http.use_ssl = true
+ else
+ raise RuntimeError.new("Cannot connect to #{url} (OpenSSL is not installed.)")
+ end
+ when URI::HTTP
+ # OK
+ else
+ raise RuntimeError.new("Cannot connect to #{url} (Not HTTP.)")
+ end
+ http
+ end
+
+ NO_PROXY_HOSTS = ['localhost']
+
+ def no_proxy?(uri)
+ if !@proxy or NO_PROXY_HOSTS.include?(uri.host)
+ return true
+ end
+ if @no_proxy
+ @no_proxy.scan(/([^:,]*)(?::(\d+))?/) do |host, port|
+ if /(\A|\.)#{Regexp.quote(host)}\z/i =~ uri.host &&
+ (!port || uri.port == port.to_i)
+ return true
+ end
+ end
+ else
+ false
+ end
+ end
+
+ class SessionManager
+ attr_accessor :connect_timeout
+ attr_accessor :send_timeout
+ attr_accessor :receive_timeout
+ end
+
+ class Response
+ attr_reader :content
+ attr_reader :status
+ attr_reader :reason
+ attr_reader :contenttype
+
+ def initialize(res)
+ @status = res.code.to_i
+ @reason = res.message
+ @contenttype = res['content-type']
+ @content = res.body
+ end
+ end
+end
+
+
+end
diff --git a/lib/soap/parser.rb b/lib/soap/parser.rb
new file mode 100644
index 0000000000..412fd4855a
--- /dev/null
+++ b/lib/soap/parser.rb
@@ -0,0 +1,251 @@
+# SOAP4R - SOAP XML Instance Parser library.
+# Copyright (C) 2001, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+require 'xsd/ns'
+require 'xsd/xmlparser'
+require 'soap/soap'
+require 'soap/baseData'
+require 'soap/encodingstyle/handler'
+
+
+module SOAP
+
+
+class Parser
+ include SOAP
+
+ class ParseError < Error; end
+ class FormatDecodeError < ParseError; end
+ class UnexpectedElementError < ParseError; end
+
+private
+
+ class ParseFrame
+ attr_reader :node
+ attr_reader :name
+ attr_reader :ns, :encodingstyle
+
+ class NodeContainer
+ def initialize(node)
+ @node = node
+ end
+
+ def node
+ @node
+ end
+
+ def replace_node(node)
+ @node = node
+ end
+ end
+
+ public
+
+ def initialize(ns, name, node, encodingstyle)
+ @ns = ns
+ @name = name
+ self.node = node
+ @encodingstyle = encodingstyle
+ end
+
+ def node=(node)
+ @node = NodeContainer.new(node)
+ end
+ end
+
+public
+
+ attr_accessor :envelopenamespace
+ attr_accessor :default_encodingstyle
+ attr_accessor :decode_typemap
+ attr_accessor :allow_unqualified_element
+
+ def initialize(opt = {})
+ @opt = opt
+ @parser = XSD::XMLParser.create_parser(self, opt)
+ @parsestack = nil
+ @lastnode = nil
+ @handlers = {}
+ @envelopenamespace = opt[:envelopenamespace] || EnvelopeNamespace
+ @default_encodingstyle = opt[:default_encodingstyle] || EncodingNamespace
+ @decode_typemap = opt[:decode_typemap] || nil
+ @allow_unqualified_element = opt[:allow_unqualified_element] || false
+ end
+
+ def charset
+ @parser.charset
+ end
+
+ def parse(string_or_readable)
+ @parsestack = []
+ @lastnode = nil
+
+ @handlers.each do |uri, handler|
+ handler.decode_prologue
+ end
+
+ @parser.do_parse(string_or_readable)
+
+ unless @parsestack.empty?
+ raise FormatDecodeError.new("Unbalanced tag in XML.")
+ end
+
+ @handlers.each do |uri, handler|
+ handler.decode_epilogue
+ end
+
+ @lastnode
+ end
+
+ def start_element(name, attrs)
+ lastframe = @parsestack.last
+ ns = parent = parent_encodingstyle = nil
+ if lastframe
+ ns = lastframe.ns.clone_ns
+ parent = lastframe.node
+ parent_encodingstyle = lastframe.encodingstyle
+ else
+ ns = XSD::NS.new
+ parent = ParseFrame::NodeContainer.new(nil)
+ parent_encodingstyle = nil
+ end
+
+ attrs = XSD::XMLParser.filter_ns(ns, attrs)
+ encodingstyle = find_encodingstyle(ns, attrs)
+
+ # Children's encodingstyle is derived from its parent.
+ if encodingstyle.nil?
+ if parent.node.is_a?(SOAPHeader)
+ encodingstyle = LiteralNamespace
+ else
+ encodingstyle = parent_encodingstyle || @default_encodingstyle
+ end
+ end
+
+ node = decode_tag(ns, name, attrs, parent, encodingstyle)
+
+ @parsestack << ParseFrame.new(ns, name, node, encodingstyle)
+ end
+
+ def characters(text)
+ lastframe = @parsestack.last
+ if lastframe
+ # Need not to be cloned because character does not have attr.
+ decode_text(lastframe.ns, text, lastframe.encodingstyle)
+ else
+ # Ignore Text outside of SOAP Envelope.
+ p text if $DEBUG
+ end
+ end
+
+ def end_element(name)
+ lastframe = @parsestack.pop
+ unless name == lastframe.name
+ raise UnexpectedElementError.new("Closing element name '#{ name }' does not match with opening element '#{ lastframe.name }'.")
+ end
+ decode_tag_end(lastframe.ns, lastframe.node, lastframe.encodingstyle)
+ @lastnode = lastframe.node.node
+ end
+
+private
+
+ def find_encodingstyle(ns, attrs)
+ attrs.each do |key, value|
+ if (ns.compare(@envelopenamespace, AttrEncodingStyle, key))
+ return value
+ end
+ end
+ nil
+ end
+
+ def decode_tag(ns, name, attrs, parent, encodingstyle)
+ ele = ns.parse(name)
+
+ # Envelope based parsing.
+ if ((ele.namespace == @envelopenamespace) ||
+ (@allow_unqualified_element && ele.namespace.nil?))
+ o = decode_soap_envelope(ns, ele, attrs, parent)
+ return o if o
+ end
+
+ # Encoding based parsing.
+ handler = find_handler(encodingstyle)
+ if handler
+ return handler.decode_tag(ns, ele, attrs, parent)
+ else
+ raise FormatDecodeError.new("Unknown encodingStyle: #{ encodingstyle }.")
+ end
+ end
+
+ def decode_tag_end(ns, node, encodingstyle)
+ return unless encodingstyle
+
+ handler = find_handler(encodingstyle)
+ if handler
+ return handler.decode_tag_end(ns, node)
+ else
+ raise FormatDecodeError.new("Unknown encodingStyle: #{ encodingstyle }.")
+ end
+ end
+
+ def decode_text(ns, text, encodingstyle)
+ handler = find_handler(encodingstyle)
+
+ if handler
+ handler.decode_text(ns, text)
+ else
+ # How should I do?
+ end
+ end
+
+ def decode_soap_envelope(ns, ele, attrs, parent)
+ o = nil
+ if ele.name == EleEnvelope
+ o = SOAPEnvelope.new
+ if ext = @opt[:external_content]
+ ext.each do |k, v|
+ o.external_content[k] = v
+ end
+ end
+ elsif ele.name == EleHeader
+ unless parent.node.is_a?(SOAPEnvelope)
+ raise FormatDecodeError.new("Header should be a child of Envelope.")
+ end
+ o = SOAPHeader.new
+ parent.node.header = o
+ elsif ele.name == EleBody
+ unless parent.node.is_a?(SOAPEnvelope)
+ raise FormatDecodeError.new("Body should be a child of Envelope.")
+ end
+ o = SOAPBody.new
+ parent.node.body = o
+ elsif ele.name == EleFault
+ unless parent.node.is_a?(SOAPBody)
+ raise FormatDecodeError.new("Fault should be a child of Body.")
+ end
+ o = SOAPFault.new
+ parent.node.fault = o
+ end
+ o
+ end
+
+ def find_handler(encodingstyle)
+ unless @handlers.key?(encodingstyle)
+ handler_factory = SOAP::EncodingStyle::Handler.handler(encodingstyle) ||
+ SOAP::EncodingStyle::Handler.handler(EncodingNamespace)
+ handler = handler_factory.new(@parser.charset)
+ handler.decode_typemap = @decode_typemap
+ handler.decode_prologue
+ @handlers[encodingstyle] = handler
+ end
+ @handlers[encodingstyle]
+ end
+end
+
+
+end
diff --git a/lib/soap/processor.rb b/lib/soap/processor.rb
new file mode 100644
index 0000000000..3c6dbedf2f
--- /dev/null
+++ b/lib/soap/processor.rb
@@ -0,0 +1,66 @@
+# SOAP4R - marshal/unmarshal interface.
+# Copyright (C) 2000, 2001, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+require 'xsd/datatypes'
+require 'soap/soap'
+require 'soap/element'
+require 'soap/parser'
+require 'soap/generator'
+require 'soap/encodingstyle/soapHandler'
+require 'soap/encodingstyle/literalHandler'
+require 'soap/encodingstyle/aspDotNetHandler'
+
+
+module SOAP
+
+
+module Processor
+ @@default_parser_option = {}
+
+ class << self
+ public
+
+ def marshal(env, opt = {}, io = nil)
+ generator = create_generator(opt)
+ marshalled_str = generator.generate(env, io)
+ unless env.external_content.empty?
+ opt[:external_content] = env.external_content
+ end
+ marshalled_str
+ end
+
+ def unmarshal(stream, opt = {})
+ parser = create_parser(opt)
+ parser.parse(stream)
+ end
+
+ def default_parser_option=(rhs)
+ @@default_parser_option = rhs
+ end
+
+ def default_parser_option
+ @@default_parser_option
+ end
+
+ private
+
+ def create_generator(opt)
+ SOAPGenerator.new(opt)
+ end
+
+ def create_parser(opt)
+ if opt.empty?
+ opt = @@default_parser_option
+ end
+ ::SOAP::Parser.new(opt)
+ end
+ end
+end
+
+
+end
diff --git a/lib/soap/property.rb b/lib/soap/property.rb
new file mode 100644
index 0000000000..882dcc6e28
--- /dev/null
+++ b/lib/soap/property.rb
@@ -0,0 +1,333 @@
+# soap/property.rb: SOAP4R - Property implementation.
+# Copyright (C) 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+module SOAP
+
+
+# Property stream format:
+#
+# line separator is \r?\n. 1 line per a property.
+# line which begins with '#' is a comment line. empty line is ignored, too.
+# key/value separator is ':' or '='.
+# '\' as escape character. but line separator cannot be escaped.
+# \s at the head/tail of key/value are trimmed.
+#
+# '[' + key + ']' indicates property section. for example,
+#
+# [aaa.bbb]
+# ccc = ddd
+# eee.fff = ggg
+# []
+# aaa.hhh = iii
+#
+# is the same as;
+#
+# aaa.bbb.ccc = ddd
+# aaa.bbb.eee.fff = ggg
+# aaa.hhh = iii
+#
+class Property
+ FrozenError = (RUBY_VERSION >= "1.9.0") ? RuntimeError : TypeError
+
+ include Enumerable
+
+ module Util
+ def const_from_name(fqname)
+ fqname.split("::").inject(Kernel) { |klass, name| klass.const_get(name) }
+ end
+ module_function :const_from_name
+
+ def require_from_name(fqname)
+ require File.join(fqname.split("::").collect { |ele| ele.downcase })
+ end
+ module_function :require_from_name
+ end
+
+ def self.load(stream)
+ new.load(stream)
+ end
+
+ def self.loadproperty(propname)
+ new.loadproperty(propname)
+ end
+
+ def initialize
+ @store = Hash.new
+ @hook = Hash.new
+ @self_hook = Array.new
+ @locked = false
+ end
+
+ KEY_REGSRC = '([^=:\\\\]*(?:\\\\.[^=:\\\\]*)*)'
+ DEF_REGSRC = '\\s*' + KEY_REGSRC + '\\s*[=:]\\s*(.*)'
+ COMMENT_REGEXP = Regexp.new('^(?:#.*|)$')
+ CATDEF_REGEXP = Regexp.new("^\\[\\s*#{KEY_REGSRC}\\s*\\]$")
+ LINE_REGEXP = Regexp.new("^#{DEF_REGSRC}$")
+ def load(stream)
+ key_prefix = ""
+ stream.each_with_index do |line, lineno|
+ line.sub!(/\r?\n\z/, '')
+ case line
+ when COMMENT_REGEXP
+ next
+ when CATDEF_REGEXP
+ key_prefix = $1.strip
+ when LINE_REGEXP
+ key, value = $1.strip, $2.strip
+ key = "#{key_prefix}.#{key}" unless key_prefix.empty?
+ key, value = loadstr(key), loadstr(value)
+ self[key] = value
+ else
+ raise TypeError.new(
+ "property format error at line #{lineno + 1}: `#{line}'")
+ end
+ end
+ self
+ end
+
+ # find property from $:.
+ def loadproperty(propname)
+ return loadpropertyfile(propname) if File.file?(propname)
+ $:.each do |path|
+ if File.file?(file = File.join(path, propname))
+ return loadpropertyfile(file)
+ end
+ end
+ nil
+ end
+
+ # name: a Symbol, String or an Array
+ def [](name)
+ referent(name_to_a(name))
+ end
+
+ # name: a Symbol, String or an Array
+ # value: an Object
+ def []=(name, value)
+ name_pair = name_to_a(name).freeze
+ hooks = assign(name_pair, value)
+ hooks.each do |hook|
+ hook.call(name_pair, value)
+ end
+ value
+ end
+
+ # value: an Object
+ # key is generated by property
+ def <<(value)
+ self[generate_new_key] = value
+ end
+
+ # name: a Symbol, String or an Array; nil means hook to the root
+ # cascade: true/false; for cascading hook of sub key
+ # hook: block which will be called with 2 args, name and value
+ def add_hook(name = nil, cascade = false, &hook)
+ if name == nil or name == true or name == false
+ cascade = name
+ assign_self_hook(cascade, &hook)
+ else
+ assign_hook(name_to_a(name), cascade, &hook)
+ end
+ end
+
+ def each
+ @store.each do |key, value|
+ yield(key, value)
+ end
+ end
+
+ def empty?
+ @store.empty?
+ end
+
+ def keys
+ @store.keys
+ end
+
+ def values
+ @store.values
+ end
+
+ def lock(cascade = false)
+ if cascade
+ each_key do |key|
+ key.lock(cascade)
+ end
+ end
+ @locked = true
+ self
+ end
+
+ def unlock(cascade = false)
+ @locked = false
+ if cascade
+ each_key do |key|
+ key.unlock(cascade)
+ end
+ end
+ self
+ end
+
+ def locked?
+ @locked
+ end
+
+protected
+
+ def deref_key(key)
+ check_lock(key)
+ ref = @store[key] ||= self.class.new
+ unless propkey?(ref)
+ raise ArgumentError.new("key `#{key}' already defined as a value")
+ end
+ ref
+ end
+
+ def local_referent(key)
+ check_lock(key)
+ if propkey?(@store[key]) and @store[key].locked?
+ raise FrozenError.new("cannot split any key from locked property")
+ end
+ @store[key]
+ end
+
+ def local_assign(key, value)
+ check_lock(key)
+ if @locked
+ if propkey?(value)
+ raise FrozenError.new("cannot add any key to locked property")
+ elsif propkey?(@store[key])
+ raise FrozenError.new("cannot override any key in locked property")
+ end
+ end
+ @store[key] = value
+ end
+
+ def local_hook(key, direct)
+ hooks = []
+ (@self_hook + (@hook[key] || NO_HOOK)).each do |hook, cascade|
+ hooks << hook if direct or cascade
+ end
+ hooks
+ end
+
+ def local_assign_hook(key, cascade, &hook)
+ check_lock(key)
+ @store[key] ||= nil
+ (@hook[key] ||= []) << [hook, cascade]
+ end
+
+private
+
+ NO_HOOK = [].freeze
+
+ def referent(ary)
+ ary[0..-2].inject(self) { |ref, name|
+ ref.deref_key(to_key(name))
+ }.local_referent(to_key(ary.last))
+ end
+
+ def assign(ary, value)
+ ref = self
+ hook = NO_HOOK
+ ary[0..-2].each do |name|
+ key = to_key(name)
+ hook += ref.local_hook(key, false)
+ ref = ref.deref_key(key)
+ end
+ last_key = to_key(ary.last)
+ ref.local_assign(last_key, value)
+ hook + ref.local_hook(last_key, true)
+ end
+
+ def assign_hook(ary, cascade, &hook)
+ ary[0..-2].inject(self) { |ref, name|
+ ref.deref_key(to_key(name))
+ }.local_assign_hook(to_key(ary.last), cascade, &hook)
+ end
+
+ def assign_self_hook(cascade, &hook)
+ check_lock(nil)
+ @self_hook << [hook, cascade]
+ end
+
+ def each_key
+ self.each do |key, value|
+ if propkey?(value)
+ yield(value)
+ end
+ end
+ end
+
+ def check_lock(key)
+ if @locked and (key.nil? or !@store.key?(key))
+ raise FrozenError.new("cannot add any key to locked property")
+ end
+ end
+
+ def propkey?(value)
+ value.is_a?(::SOAP::Property)
+ end
+
+ def name_to_a(name)
+ case name
+ when Symbol
+ [name]
+ when String
+ name.scan(/[^.\\]+(?:\\.[^.\\])*/) # split with unescaped '.'
+ when Array
+ name
+ else
+ raise ArgumentError.new("Unknown name #{name}(#{name.class})")
+ end
+ end
+
+ def to_key(name)
+ name.to_s.downcase
+ end
+
+ def generate_new_key
+ if @store.empty?
+ "0"
+ else
+ (key_max + 1).to_s
+ end
+ end
+
+ def key_max
+ (@store.keys.max { |l, r| l.to_s.to_i <=> r.to_s.to_i }).to_s.to_i
+ end
+
+ def loadpropertyfile(file)
+ puts "find property at #{file}" if $DEBUG
+ File.open(file) do |f|
+ load(f)
+ end
+ end
+
+ def loadstr(str)
+ str.gsub(/\\./) { |c| eval("\"#{c}\"") }
+ end
+end
+
+
+end
+
+
+# for ruby/1.6.
+unless Enumerable.instance_methods.include?('inject')
+ module Enumerable
+ def inject(init)
+ result = init
+ each do |item|
+ result = yield(result, item)
+ end
+ result
+ end
+ end
+end
diff --git a/lib/soap/rpc/cgistub.rb b/lib/soap/rpc/cgistub.rb
new file mode 100644
index 0000000000..487f05a9bf
--- /dev/null
+++ b/lib/soap/rpc/cgistub.rb
@@ -0,0 +1,206 @@
+# SOAP4R - CGI/mod_ruby stub library
+# Copyright (C) 2001, 2003-2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+require 'soap/streamHandler'
+require 'webrick/httpresponse'
+require 'webrick/httpstatus'
+require 'logger'
+require 'soap/rpc/soaplet'
+
+
+module SOAP
+module RPC
+
+
+###
+# SYNOPSIS
+# CGIStub.new
+#
+# DESCRIPTION
+# To be written...
+#
+class CGIStub < Logger::Application
+ include SOAP
+ include WEBrick
+
+ class SOAPRequest
+ attr_reader :body
+
+ def [](var); end
+
+ def meta_vars; end
+ end
+
+ class SOAPStdinRequest < SOAPRequest
+ attr_reader :body
+
+ def initialize(stream)
+ size = ENV['CONTENT_LENGTH'].to_i || 0
+ @body = stream.read(size)
+ end
+
+ def [](var)
+ ENV[var.gsub(/-/, '_').upcase]
+ end
+
+ def meta_vars
+ {
+ 'HTTP_SOAPACTION' => ENV['HTTP_SOAPAction']
+ }
+ end
+ end
+
+ class SOAPFCGIRequest < SOAPRequest
+ attr_reader :body
+
+ def initialize(request)
+ @request = request
+ @body = @request.in.read
+ end
+
+ def [](var)
+ @request.env[var.gsub(/-/, '_').upcase]
+ end
+
+ def meta_vars
+ {
+ 'HTTP_SOAPACTION' => @request.env['HTTP_SOAPAction']
+ }
+ end
+ end
+
+ def initialize(appname, default_namespace)
+ super(appname)
+ set_log(STDERR)
+ self.level = ERROR
+ @default_namespace = default_namespace
+ @remote_host = ENV['REMOTE_HOST'] || ENV['REMOTE_ADDR'] || 'unknown'
+ @router = ::SOAP::RPC::Router.new(self.class.name)
+ @soaplet = ::SOAP::RPC::SOAPlet.new(@router)
+ on_init
+ end
+
+ def on_init
+ # do extra initialization in a derived class if needed.
+ end
+
+ def mapping_registry
+ @router.mapping_registry
+ end
+
+ def mapping_registry=(value)
+ @router.mapping_registry = value
+ end
+
+ def generate_explicit_type
+ @router.generate_explicit_type
+ end
+
+ def generate_explicit_type=(generate_explicit_type)
+ @router.generate_explicit_type = generate_explicit_type
+ end
+
+ # servant entry interface
+
+ def add_rpc_servant(obj, namespace = @default_namespace)
+ @router.add_rpc_servant(obj, namespace)
+ end
+ alias add_servant add_rpc_servant
+
+ def add_headerhandler(obj)
+ @router.add_headerhandler(obj)
+ end
+ alias add_rpc_headerhandler add_headerhandler
+
+ # method entry interface
+
+ def add_rpc_method(obj, name, *param)
+ add_rpc_method_with_namespace_as(@default_namespace, obj, name, name, *param)
+ end
+ alias add_method add_rpc_method
+
+ def add_rpc_method_as(obj, name, name_as, *param)
+ add_rpc_method_with_namespace_as(@default_namespace, obj, name, name_as, *param)
+ end
+ alias add_method_as add_rpc_method_as
+
+ def add_rpc_method_with_namespace(namespace, obj, name, *param)
+ add_rpc_method_with_namespace_as(namespace, obj, name, name, *param)
+ end
+ alias add_method_with_namespace add_rpc_method_with_namespace
+
+ def add_rpc_method_with_namespace_as(namespace, obj, name, name_as, *param)
+ qname = XSD::QName.new(namespace, name_as)
+ soapaction = nil
+ param_def = SOAPMethod.derive_rpc_param_def(obj, name, *param)
+ @router.add_rpc_operation(obj, qname, soapaction, name, param_def)
+ end
+ alias add_method_with_namespace_as add_rpc_method_with_namespace_as
+
+ def add_rpc_operation(receiver, qname, soapaction, name, param_def, opt = {})
+ @router.add_rpc_operation(receiver, qname, soapaction, name, param_def, opt)
+ end
+
+ def add_document_operation(receiver, soapaction, name, param_def, opt = {})
+ @router.add_document_operation(receiver, soapaction, name, param_def, opt)
+ end
+
+ def set_fcgi_request(request)
+ @fcgi = request
+ end
+
+private
+
+ HTTPVersion = WEBrick::HTTPVersion.new('1.0') # dummy; ignored
+
+ def run
+ res = WEBrick::HTTPResponse.new({:HTTPVersion => HTTPVersion})
+ begin
+ @log.info { "received a request from '#{ @remote_host }'" }
+ if @fcgi
+ req = SOAPFCGIRequest.new(@fcgi)
+ else
+ req = SOAPStdinRequest.new($stdin)
+ end
+ @soaplet.do_POST(req, res)
+ rescue HTTPStatus::EOFError, HTTPStatus::RequestTimeout => ex
+ res.set_error(ex)
+ rescue HTTPStatus::Error => ex
+ res.set_error(ex)
+ rescue HTTPStatus::Status => ex
+ res.status = ex.code
+ rescue StandardError, NameError => ex # for Ruby 1.6
+ res.set_error(ex, true)
+ ensure
+ if defined?(MOD_RUBY)
+ r = Apache.request
+ r.status = res.status
+ r.content_type = res.content_type
+ r.send_http_header
+ buf = res.body
+ else
+ buf = ''
+ res.send_response(buf)
+ buf.sub!(/^[^\r]+\r\n/, '') # Trim status line.
+ end
+ @log.debug { "SOAP CGI Response:\n#{ buf }" }
+ if @fcgi
+ @fcgi.out.print buf
+ @fcgi.finish
+ @fcgi = nil
+ else
+ print buf
+ end
+ end
+ 0
+ end
+end
+
+
+end
+end
diff --git a/lib/soap/rpc/driver.rb b/lib/soap/rpc/driver.rb
new file mode 100644
index 0000000000..0fb4e82488
--- /dev/null
+++ b/lib/soap/rpc/driver.rb
@@ -0,0 +1,254 @@
+# SOAP4R - SOAP RPC driver
+# Copyright (C) 2000, 2001, 2003-2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+require 'soap/soap'
+require 'soap/mapping'
+require 'soap/mapping/wsdlliteralregistry'
+require 'soap/rpc/rpc'
+require 'soap/rpc/proxy'
+require 'soap/rpc/element'
+require 'soap/streamHandler'
+require 'soap/property'
+require 'soap/header/handlerset'
+
+
+module SOAP
+module RPC
+
+
+class Driver
+ class << self
+ if RUBY_VERSION >= "1.7.0"
+ def __attr_proxy(symbol, assignable = false)
+ name = symbol.to_s
+ define_method(name) {
+ @proxy.__send__(name)
+ }
+ if assignable
+ aname = name + '='
+ define_method(aname) { |rhs|
+ @proxy.__send__(aname, rhs)
+ }
+ end
+ end
+ else
+ def __attr_proxy(symbol, assignable = false)
+ name = symbol.to_s
+ module_eval <<-EOS
+ def #{name}
+ @proxy.#{name}
+ end
+ EOS
+ if assignable
+ module_eval <<-EOS
+ def #{name}=(value)
+ @proxy.#{name} = value
+ end
+ EOS
+ end
+ end
+ end
+ end
+
+ __attr_proxy :endpoint_url, true
+ __attr_proxy :mapping_registry, true
+ __attr_proxy :default_encodingstyle, true
+ __attr_proxy :generate_explicit_type, true
+ __attr_proxy :allow_unqualified_element, true
+ __attr_proxy :headerhandler
+ __attr_proxy :streamhandler
+ __attr_proxy :test_loopback_response
+ __attr_proxy :reset_stream
+
+ attr_reader :proxy
+ attr_reader :options
+ attr_accessor :soapaction
+
+ def inspect
+ "#<#{self.class}:#{@proxy.inspect}>"
+ end
+
+ def httpproxy
+ options["protocol.http.proxy"]
+ end
+
+ def httpproxy=(httpproxy)
+ options["protocol.http.proxy"] = httpproxy
+ end
+
+ def wiredump_dev
+ options["protocol.http.wiredump_dev"]
+ end
+
+ def wiredump_dev=(wiredump_dev)
+ options["protocol.http.wiredump_dev"] = wiredump_dev
+ end
+
+ def mandatorycharset
+ options["protocol.mandatorycharset"]
+ end
+
+ def mandatorycharset=(mandatorycharset)
+ options["protocol.mandatorycharset"] = mandatorycharset
+ end
+
+ def wiredump_file_base
+ options["protocol.wiredump_file_base"]
+ end
+
+ def wiredump_file_base=(wiredump_file_base)
+ options["protocol.wiredump_file_base"] = wiredump_file_base
+ end
+
+ def initialize(endpoint_url, namespace = nil, soapaction = nil)
+ @namespace = namespace
+ @soapaction = soapaction
+ @options = setup_options
+ @wiredump_file_base = nil
+ @proxy = Proxy.new(endpoint_url, @soapaction, @options)
+ end
+
+ def loadproperty(propertyname)
+ unless options.loadproperty(propertyname)
+ raise LoadError.new("No such property to load -- #{propertyname}")
+ end
+ end
+
+ def add_rpc_method(name, *params)
+ add_rpc_method_with_soapaction_as(name, name, @soapaction, *params)
+ end
+
+ def add_rpc_method_as(name, name_as, *params)
+ add_rpc_method_with_soapaction_as(name, name_as, @soapaction, *params)
+ end
+
+ def add_rpc_method_with_soapaction(name, soapaction, *params)
+ add_rpc_method_with_soapaction_as(name, name, soapaction, *params)
+ end
+
+ def add_rpc_method_with_soapaction_as(name, name_as, soapaction, *params)
+ param_def = SOAPMethod.create_rpc_param_def(params)
+ qname = XSD::QName.new(@namespace, name_as)
+ @proxy.add_rpc_method(qname, soapaction, name, param_def)
+ add_rpc_method_interface(name, param_def)
+ end
+
+ # add_method is for shortcut of typical rpc/encoded method definition.
+ alias add_method add_rpc_method
+ alias add_method_as add_rpc_method_as
+ alias add_method_with_soapaction add_rpc_method_with_soapaction
+ alias add_method_with_soapaction_as add_rpc_method_with_soapaction_as
+
+ def add_document_method(name, soapaction, req_qname, res_qname)
+ param_def = SOAPMethod.create_doc_param_def(req_qname, res_qname)
+ @proxy.add_document_method(soapaction, name, param_def)
+ add_document_method_interface(name, param_def)
+ end
+
+ def add_rpc_operation(qname, soapaction, name, param_def, opt = {})
+ @proxy.add_rpc_operation(qname, soapaction, name, param_def, opt)
+ add_rpc_method_interface(name, param_def)
+ end
+
+ def add_document_operation(soapaction, name, param_def, opt = {})
+ @proxy.add_document_operation(soapaction, name, param_def, opt)
+ add_document_method_interface(name, param_def)
+ end
+
+ def invoke(headers, body)
+ if headers and !headers.is_a?(SOAPHeader)
+ headers = create_header(headers)
+ end
+ set_wiredump_file_base(body.elename.name)
+ env = @proxy.invoke(headers, body)
+ if env.nil?
+ return nil, nil
+ else
+ return env.header, env.body
+ end
+ end
+
+ def call(name, *params)
+ set_wiredump_file_base(name)
+ @proxy.call(name, *params)
+ end
+
+private
+
+ def set_wiredump_file_base(name)
+ if @wiredump_file_base
+ @proxy.set_wiredump_file_base("#{@wiredump_file_base}_#{name}")
+ end
+ end
+
+ def create_header(headers)
+ header = SOAPHeader.new()
+ headers.each do |content, mustunderstand, encodingstyle|
+ header.add(SOAPHeaderItem.new(content, mustunderstand, encodingstyle))
+ end
+ header
+ end
+
+ def setup_options
+ if opt = Property.loadproperty(::SOAP::PropertyName)
+ opt = opt["client"]
+ end
+ opt ||= Property.new
+ opt.add_hook("protocol.mandatorycharset") do |key, value|
+ @proxy.mandatorycharset = value
+ end
+ opt.add_hook("protocol.wiredump_file_base") do |key, value|
+ @wiredump_file_base = value
+ end
+ opt["protocol.http.charset"] ||= XSD::Charset.xml_encoding_label
+ opt["protocol.http.proxy"] ||= Env::HTTP_PROXY
+ opt["protocol.http.no_proxy"] ||= Env::NO_PROXY
+ opt
+ end
+
+ def add_rpc_method_interface(name, param_def)
+ param_count = RPC::SOAPMethod.param_count(param_def,
+ RPC::SOAPMethod::IN, RPC::SOAPMethod::INOUT)
+ add_method_interface(name, param_count)
+ end
+
+ def add_document_method_interface(name, param_def)
+ param_count = RPC::SOAPMethod.param_count(param_def, RPC::SOAPMethod::IN)
+ add_method_interface(name, param_count)
+ end
+
+ if RUBY_VERSION > "1.7.0"
+ def add_method_interface(name, param_count)
+ ::SOAP::Mapping.define_singleton_method(self, name) do |*arg|
+ unless arg.size == param_count
+ raise ArgumentError.new(
+ "wrong number of arguments (#{arg.size} for #{param_count})")
+ end
+ call(name, *arg)
+ end
+ self.method(name)
+ end
+ else
+ def add_method_interface(name, param_count)
+ instance_eval <<-EOS
+ def #{name}(*arg)
+ unless arg.size == #{param_count}
+ raise ArgumentError.new(
+ "wrong number of arguments (\#{arg.size} for #{param_count})")
+ end
+ call(#{name.dump}, *arg)
+ end
+ EOS
+ self.method(name)
+ end
+ end
+end
+
+
+end
+end
diff --git a/lib/soap/rpc/element.rb b/lib/soap/rpc/element.rb
new file mode 100644
index 0000000000..c224b03d0d
--- /dev/null
+++ b/lib/soap/rpc/element.rb
@@ -0,0 +1,325 @@
+# SOAP4R - RPC element definition.
+# Copyright (C) 2000, 2001, 2003, 2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+require 'soap/baseData'
+
+
+module SOAP
+
+# Add method definitions for RPC to common definition in element.rb
+class SOAPBody < SOAPStruct
+ public
+
+ def request
+ root_node
+ end
+
+ def response
+ root = root_node
+ if !@is_fault
+ if root.nil?
+ nil
+ elsif root.is_a?(SOAPBasetype)
+ root
+ else
+ # Initial element is [retval].
+ root[0]
+ end
+ else
+ root
+ end
+ end
+
+ def outparams
+ root = root_node
+ if !@is_fault and !root.nil? and !root.is_a?(SOAPBasetype)
+ op = root[1..-1]
+ op = nil if op && op.empty?
+ op
+ else
+ nil
+ end
+ end
+
+ def fault
+ if @is_fault
+ self['fault']
+ else
+ nil
+ end
+ end
+
+ def fault=(fault)
+ @is_fault = true
+ add_member('fault', fault)
+ end
+end
+
+
+module RPC
+
+
+class RPCError < Error; end
+class MethodDefinitionError < RPCError; end
+class ParameterError < RPCError; end
+
+class SOAPMethod < SOAPStruct
+ RETVAL = 'retval'
+ IN = 'in'
+ OUT = 'out'
+ INOUT = 'inout'
+
+ attr_reader :param_def
+ attr_reader :inparam
+ attr_reader :outparam
+ attr_reader :retval_name
+ attr_reader :retval_class_name
+
+ def initialize(qname, param_def = nil)
+ super(nil)
+ @elename = qname
+ @encodingstyle = nil
+
+ @param_def = param_def
+
+ @signature = []
+ @inparam_names = []
+ @inoutparam_names = []
+ @outparam_names = []
+
+ @inparam = {}
+ @outparam = {}
+ @retval_name = nil
+ @retval_class_name = nil
+
+ init_param(@param_def) if @param_def
+ end
+
+ def have_outparam?
+ @outparam_names.size > 0
+ end
+
+ def input_params
+ collect_params(IN, INOUT)
+ end
+
+ def output_params
+ collect_params(OUT, INOUT)
+ end
+
+ def set_param(params)
+ params.each do |param, data|
+ @inparam[param] = data
+ data.elename.name = param
+ data.parent = self
+ end
+ end
+
+ def set_outparam(params)
+ params.each do |param, data|
+ @outparam[param] = data
+ data.elename.name = param
+ end
+ end
+
+ def SOAPMethod.param_count(param_def, *type)
+ count = 0
+ param_def.each do |io_type, name, param_type|
+ if type.include?(io_type)
+ count += 1
+ end
+ end
+ count
+ end
+
+ def SOAPMethod.derive_rpc_param_def(obj, name, *param)
+ if param.size == 1 and param[0].is_a?(Array)
+ return param[0]
+ end
+ if param.empty?
+ method = obj.method(name)
+ param_names = (1..method.arity.abs).collect { |i| "p#{i}" }
+ else
+ param_names = param
+ end
+ create_rpc_param_def(param_names)
+ end
+
+ def SOAPMethod.create_rpc_param_def(param_names)
+ param_def = []
+ param_names.each do |param_name|
+ param_def.push([IN, param_name, nil])
+ end
+ param_def.push([RETVAL, 'return', nil])
+ param_def
+ end
+
+ def SOAPMethod.create_doc_param_def(req_qnames, res_qnames)
+ req_qnames = [req_qnames] if req_qnames.is_a?(XSD::QName)
+ res_qnames = [res_qnames] if res_qnames.is_a?(XSD::QName)
+ param_def = []
+ req_qnames.each do |qname|
+ param_def << [IN, qname.name, [nil, qname.namespace, qname.name]]
+ end
+ res_qnames.each do |qname|
+ param_def << [OUT, qname.name, [nil, qname.namespace, qname.name]]
+ end
+ param_def
+ end
+
+private
+
+ def collect_params(*type)
+ names = []
+ @signature.each do |io_type, name, param_type|
+ names << name if type.include?(io_type)
+ end
+ names
+ end
+
+ def init_param(param_def)
+ param_def.each do |io_type, name, param_type|
+ case io_type
+ when IN
+ @signature.push([IN, name, param_type])
+ @inparam_names.push(name)
+ when OUT
+ @signature.push([OUT, name, param_type])
+ @outparam_names.push(name)
+ when INOUT
+ @signature.push([INOUT, name, param_type])
+ @inoutparam_names.push(name)
+ when RETVAL
+ if @retval_name
+ raise MethodDefinitionError.new('duplicated retval')
+ end
+ @retval_name = name
+ @retval_class_name = nil
+ if param_type
+ if param_type[0].is_a?(String)
+ @retval_class_name = Mapping.class_from_name(param_type[0])
+ else
+ @retval_class_name = param_type[0]
+ end
+ end
+ else
+ raise MethodDefinitionError.new("unknown type: #{io_type}")
+ end
+ end
+ end
+end
+
+
+class SOAPMethodRequest < SOAPMethod
+ attr_accessor :soapaction
+
+ def SOAPMethodRequest.create_request(qname, *params)
+ param_def = []
+ param_value = []
+ i = 0
+ params.each do |param|
+ param_name = "p#{i}"
+ i += 1
+ param_def << [IN, param_name, nil]
+ param_value << [param_name, param]
+ end
+ param_def << [RETVAL, 'return', nil]
+ o = new(qname, param_def)
+ o.set_param(param_value)
+ o
+ end
+
+ def initialize(qname, param_def = nil, soapaction = nil)
+ check_elename(qname)
+ super(qname, param_def)
+ @soapaction = soapaction
+ end
+
+ def each
+ input_params.each do |name|
+ unless @inparam[name]
+ raise ParameterError.new("parameter: #{name} was not given")
+ end
+ yield(name, @inparam[name])
+ end
+ end
+
+ def dup
+ req = self.class.new(@elename.dup, @param_def, @soapaction)
+ req.encodingstyle = @encodingstyle
+ req
+ end
+
+ def create_method_response(response_name = nil)
+ response_name ||=
+ XSD::QName.new(@elename.namespace, @elename.name + 'Response')
+ SOAPMethodResponse.new(response_name, @param_def)
+ end
+
+private
+
+ def check_elename(qname)
+ # NCName & ruby's method name
+ unless /\A[\w_][\w\d_\-]*\z/ =~ qname.name
+ raise MethodDefinitionError.new("element name '#{qname.name}' not allowed")
+ end
+ end
+end
+
+
+class SOAPMethodResponse < SOAPMethod
+
+ def initialize(qname, param_def = nil)
+ super(qname, param_def)
+ @retval = nil
+ end
+
+ def retval=(retval)
+ @retval = retval
+ @retval.elename = @retval.elename.dup_name(@retval_name || 'return')
+ retval.parent = self
+ retval
+ end
+
+ def each
+ if @retval_name and !@retval.is_a?(SOAPVoid)
+ yield(@retval_name, @retval)
+ end
+
+ output_params.each do |name|
+ unless @outparam[name]
+ raise ParameterError.new("parameter: #{name} was not given")
+ end
+ yield(name, @outparam[name])
+ end
+ end
+end
+
+
+# To return(?) void explicitly.
+# def foo(input_var)
+# ...
+# return SOAP::RPC::SOAPVoid.new
+# end
+class SOAPVoid < XSD::XSDAnySimpleType
+ include SOAPBasetype
+ extend SOAPModuleUtils
+ Name = XSD::QName.new(Mapping::RubyCustomTypeNamespace, nil)
+
+public
+ def initialize()
+ @elename = Name
+ @id = nil
+ @precedents = []
+ @parent = nil
+ end
+end
+
+
+end
+end
diff --git a/lib/soap/rpc/httpserver.rb b/lib/soap/rpc/httpserver.rb
new file mode 100644
index 0000000000..6d2a72ebe3
--- /dev/null
+++ b/lib/soap/rpc/httpserver.rb
@@ -0,0 +1,129 @@
+# SOAP4R - WEBrick HTTP Server
+# Copyright (C) 2003, 2004 by NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+require 'logger'
+require 'soap/rpc/soaplet'
+require 'soap/streamHandler'
+require 'webrick'
+
+
+module SOAP
+module RPC
+
+
+class HTTPServer < Logger::Application
+ attr_reader :server
+ attr_accessor :default_namespace
+
+ def initialize(config)
+ super(config[:SOAPHTTPServerApplicationName] || self.class.name)
+ @default_namespace = config[:SOAPDefaultNamespace]
+ @webrick_config = config.dup
+ self.level = Logger::Severity::ERROR # keep silent by default
+ @webrick_config[:Logger] ||= @log
+ @log = @webrick_config[:Logger] # sync logger of App and HTTPServer
+ @router = ::SOAP::RPC::Router.new(self.class.name)
+ @soaplet = ::SOAP::RPC::SOAPlet.new(@router)
+ on_init
+ @server = WEBrick::HTTPServer.new(@webrick_config)
+ @server.mount('/', @soaplet)
+ end
+
+ def on_init
+ # do extra initialization in a derived class if needed.
+ end
+
+ def status
+ @server.status if @server
+ end
+
+ def shutdown
+ @server.shutdown if @server
+ end
+
+ def mapping_registry
+ @router.mapping_registry
+ end
+
+ def mapping_registry=(mapping_registry)
+ @router.mapping_registry = mapping_registry
+ end
+
+ def generate_explicit_type
+ @router.generate_explicit_type
+ end
+
+ def generate_explicit_type=(generate_explicit_type)
+ @router.generate_explicit_type = generate_explicit_type
+ end
+
+ # servant entry interface
+
+ def add_rpc_request_servant(factory, namespace = @default_namespace)
+ @router.add_rpc_request_servant(factory, namespace)
+ end
+
+ def add_rpc_servant(obj, namespace = @default_namespace)
+ @router.add_rpc_servant(obj, namespace)
+ end
+
+ def add_request_headerhandler(factory)
+ @router.add_request_headerhandler(factory)
+ end
+
+ def add_headerhandler(obj)
+ @router.add_headerhandler(obj)
+ end
+ alias add_rpc_headerhandler add_headerhandler
+
+ # method entry interface
+
+ def add_rpc_method(obj, name, *param)
+ add_rpc_method_as(obj, name, name, *param)
+ end
+ alias add_method add_rpc_method
+
+ def add_rpc_method_as(obj, name, name_as, *param)
+ qname = XSD::QName.new(@default_namespace, name_as)
+ soapaction = nil
+ param_def = SOAPMethod.derive_rpc_param_def(obj, name, *param)
+ @router.add_rpc_operation(obj, qname, soapaction, name, param_def)
+ end
+ alias add_method_as add_rpc_method_as
+
+ def add_document_method(obj, soapaction, name, req_qnames, res_qnames)
+ param_def = SOAPMethod.create_doc_param_def(req_qnames, res_qnames)
+ @router.add_document_operation(obj, soapaction, name, param_def)
+ end
+
+ def add_rpc_operation(receiver, qname, soapaction, name, param_def, opt = {})
+ @router.add_rpc_operation(receiver, qname, soapaction, name, param_def, opt)
+ end
+
+ def add_rpc_request_operation(factory, qname, soapaction, name, param_def, opt = {})
+ @router.add_rpc_request_operation(factory, qname, soapaction, name, param_def, opt)
+ end
+
+ def add_document_operation(receiver, soapaction, name, param_def, opt = {})
+ @router.add_document_operation(receiver, soapaction, name, param_def, opt)
+ end
+
+ def add_document_request_operation(factory, soapaction, name, param_def, opt = {})
+ @router.add_document_request_operation(factory, soapaction, name, param_def, opt)
+ end
+
+private
+
+ def run
+ @server.start
+ end
+end
+
+
+end
+end
diff --git a/lib/soap/rpc/proxy.rb b/lib/soap/rpc/proxy.rb
new file mode 100644
index 0000000000..7dfda62006
--- /dev/null
+++ b/lib/soap/rpc/proxy.rb
@@ -0,0 +1,497 @@
+# SOAP4R - RPC Proxy library.
+# Copyright (C) 2000, 2003-2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+require 'soap/soap'
+require 'soap/processor'
+require 'soap/mapping'
+require 'soap/rpc/rpc'
+require 'soap/rpc/element'
+require 'soap/streamHandler'
+require 'soap/mimemessage'
+
+
+module SOAP
+module RPC
+
+
+class Proxy
+ include SOAP
+
+public
+
+ attr_accessor :soapaction
+ attr_accessor :mandatorycharset
+ attr_accessor :allow_unqualified_element
+ attr_accessor :default_encodingstyle
+ attr_accessor :generate_explicit_type
+ attr_reader :headerhandler
+ attr_reader :streamhandler
+
+ attr_accessor :mapping_registry
+ attr_accessor :literal_mapping_registry
+
+ attr_reader :operation
+
+ def initialize(endpoint_url, soapaction, options)
+ @endpoint_url = endpoint_url
+ @soapaction = soapaction
+ @options = options
+ @streamhandler = HTTPStreamHandler.new(
+ @options["protocol.http"] ||= ::SOAP::Property.new)
+ @operation = {}
+ @mandatorycharset = nil
+ @allow_unqualified_element = true
+ @default_encodingstyle = nil
+ @generate_explicit_type = true
+ @headerhandler = Header::HandlerSet.new
+ @mapping_registry = nil
+ @literal_mapping_registry = ::SOAP::Mapping::WSDLLiteralRegistry.new
+ end
+
+ def inspect
+ "#<#{self.class}:#{@endpoint_url}>"
+ end
+
+ def endpoint_url
+ @endpoint_url
+ end
+
+ def endpoint_url=(endpoint_url)
+ @endpoint_url = endpoint_url
+ reset_stream
+ end
+
+ def reset_stream
+ @streamhandler.reset(@endpoint_url)
+ end
+
+ def set_wiredump_file_base(wiredump_file_base)
+ @streamhandler.wiredump_file_base = wiredump_file_base
+ end
+
+ def test_loopback_response
+ @streamhandler.test_loopback_response
+ end
+
+ def add_rpc_operation(qname, soapaction, name, param_def, opt = {})
+ opt[:request_qname] = qname
+ opt[:request_style] ||= :rpc
+ opt[:response_style] ||= :rpc
+ opt[:request_use] ||= :encoded
+ opt[:response_use] ||= :encoded
+ @operation[name] = Operation.new(soapaction, param_def, opt)
+ end
+
+ def add_document_operation(soapaction, name, param_def, opt = {})
+ opt[:request_style] ||= :document
+ opt[:response_style] ||= :document
+ opt[:request_use] ||= :literal
+ opt[:response_use] ||= :literal
+ # default values of these values are unqualified in XML Schema.
+ # set true for backward compatibility.
+ unless opt.key?(:elementformdefault)
+ opt[:elementformdefault] = true
+ end
+ unless opt.key?(:attributeformdefault)
+ opt[:attributeformdefault] = true
+ end
+ @operation[name] = Operation.new(soapaction, param_def, opt)
+ end
+
+ # add_method is for shortcut of typical rpc/encoded method definition.
+ alias add_method add_rpc_operation
+ alias add_rpc_method add_rpc_operation
+ alias add_document_method add_document_operation
+
+ def invoke(req_header, req_body, opt = nil)
+ opt ||= create_encoding_opt
+ route(req_header, req_body, opt, opt)
+ end
+
+ def call(name, *params)
+ unless op_info = @operation[name]
+ raise MethodDefinitionError, "method: #{name} not defined"
+ end
+ mapping_opt = create_mapping_opt
+ req_header = create_request_header
+ req_body = SOAPBody.new(
+ op_info.request_body(params, @mapping_registry,
+ @literal_mapping_registry, mapping_opt)
+ )
+ reqopt = create_encoding_opt(
+ :soapaction => op_info.soapaction || @soapaction,
+ :envelopenamespace => @options["soap.envelope.requestnamespace"],
+ :default_encodingstyle =>
+ @default_encodingstyle || op_info.request_default_encodingstyle,
+ :elementformdefault => op_info.elementformdefault,
+ :attributeformdefault => op_info.attributeformdefault
+ )
+ resopt = create_encoding_opt(
+ :envelopenamespace => @options["soap.envelope.responsenamespace"],
+ :default_encodingstyle =>
+ @default_encodingstyle || op_info.response_default_encodingstyle,
+ :elementformdefault => op_info.elementformdefault,
+ :attributeformdefault => op_info.attributeformdefault
+ )
+ env = route(req_header, req_body, reqopt, resopt)
+ raise EmptyResponseError unless env
+ receive_headers(env.header)
+ begin
+ check_fault(env.body)
+ rescue ::SOAP::FaultError => e
+ op_info.raise_fault(e, @mapping_registry, @literal_mapping_registry)
+ end
+ op_info.response_obj(env.body, @mapping_registry,
+ @literal_mapping_registry, mapping_opt)
+ end
+
+ def route(req_header, req_body, reqopt, resopt)
+ req_env = ::SOAP::SOAPEnvelope.new(req_header, req_body)
+ unless reqopt[:envelopenamespace].nil?
+ set_envelopenamespace(req_env, reqopt[:envelopenamespace])
+ end
+ reqopt[:external_content] = nil
+ conn_data = marshal(req_env, reqopt)
+ if ext = reqopt[:external_content]
+ mime = MIMEMessage.new
+ ext.each do |k, v|
+ mime.add_attachment(v.data)
+ end
+ mime.add_part(conn_data.send_string + "\r\n")
+ mime.close
+ conn_data.send_string = mime.content_str
+ conn_data.send_contenttype = mime.headers['content-type'].str
+ end
+ conn_data = @streamhandler.send(@endpoint_url, conn_data,
+ reqopt[:soapaction])
+ if conn_data.receive_string.empty?
+ return nil
+ end
+ unmarshal(conn_data, resopt)
+ end
+
+ def check_fault(body)
+ if body.fault
+ raise SOAP::FaultError.new(body.fault)
+ end
+ end
+
+private
+
+ def set_envelopenamespace(env, namespace)
+ env.elename = XSD::QName.new(namespace, env.elename.name)
+ if env.header
+ env.header.elename = XSD::QName.new(namespace, env.header.elename.name)
+ end
+ if env.body
+ env.body.elename = XSD::QName.new(namespace, env.body.elename.name)
+ end
+ end
+
+ def create_request_header
+ headers = @headerhandler.on_outbound
+ if headers.empty?
+ nil
+ else
+ h = ::SOAP::SOAPHeader.new
+ headers.each do |header|
+ h.add(header.elename.name, header)
+ end
+ h
+ end
+ end
+
+ def receive_headers(headers)
+ @headerhandler.on_inbound(headers) if headers
+ end
+
+ def marshal(env, opt)
+ send_string = Processor.marshal(env, opt)
+ StreamHandler::ConnectionData.new(send_string)
+ end
+
+ def unmarshal(conn_data, opt)
+ contenttype = conn_data.receive_contenttype
+ if /#{MIMEMessage::MultipartContentType}/i =~ contenttype
+ opt[:external_content] = {}
+ mime = MIMEMessage.parse("Content-Type: " + contenttype,
+ conn_data.receive_string)
+ mime.parts.each do |part|
+ value = Attachment.new(part.content)
+ value.contentid = part.contentid
+ obj = SOAPAttachment.new(value)
+ opt[:external_content][value.contentid] = obj if value.contentid
+ end
+ opt[:charset] = @mandatorycharset ||
+ StreamHandler.parse_media_type(mime.root.headers['content-type'].str)
+ env = Processor.unmarshal(mime.root.content, opt)
+ else
+ opt[:charset] = @mandatorycharset ||
+ ::SOAP::StreamHandler.parse_media_type(contenttype)
+ env = Processor.unmarshal(conn_data.receive_string, opt)
+ end
+ unless env.is_a?(::SOAP::SOAPEnvelope)
+ raise ResponseFormatError.new(
+ "response is not a SOAP envelope: #{conn_data.receive_string}")
+ end
+ env
+ end
+
+ def create_header(headers)
+ header = SOAPHeader.new()
+ headers.each do |content, mustunderstand, encodingstyle|
+ header.add(SOAPHeaderItem.new(content, mustunderstand, encodingstyle))
+ end
+ header
+ end
+
+ def create_encoding_opt(hash = nil)
+ opt = {}
+ opt[:default_encodingstyle] = @default_encodingstyle
+ opt[:allow_unqualified_element] = @allow_unqualified_element
+ opt[:generate_explicit_type] = @generate_explicit_type
+ opt[:no_indent] = @options["soap.envelope.no_indent"]
+ opt[:use_numeric_character_reference] =
+ @options["soap.envelope.use_numeric_character_reference"]
+ opt.update(hash) if hash
+ opt
+ end
+
+ def create_mapping_opt(hash = nil)
+ opt = {
+ :external_ces => @options["soap.mapping.external_ces"]
+ }
+ opt.update(hash) if hash
+ opt
+ end
+
+ class Operation
+ attr_reader :soapaction
+ attr_reader :request_style
+ attr_reader :response_style
+ attr_reader :request_use
+ attr_reader :response_use
+ attr_reader :elementformdefault
+ attr_reader :attributeformdefault
+
+ def initialize(soapaction, param_def, opt)
+ @soapaction = soapaction
+ @request_style = opt[:request_style]
+ @response_style = opt[:response_style]
+ @request_use = opt[:request_use]
+ @response_use = opt[:response_use]
+ # set nil(unqualified) by default
+ @elementformdefault = opt[:elementformdefault]
+ @attributeformdefault = opt[:attributeformdefault]
+ check_style(@request_style)
+ check_style(@response_style)
+ check_use(@request_use)
+ check_use(@response_use)
+ if @request_style == :rpc
+ @rpc_request_qname = opt[:request_qname]
+ if @rpc_request_qname.nil?
+ raise MethodDefinitionError.new("rpc_request_qname must be given")
+ end
+ @rpc_method_factory =
+ RPC::SOAPMethodRequest.new(@rpc_request_qname, param_def, @soapaction)
+ else
+ @doc_request_qnames = []
+ @doc_request_qualified = []
+ @doc_response_qnames = []
+ @doc_response_qualified = []
+ param_def.each do |inout, paramname, typeinfo, eleinfo|
+ klass_not_used, nsdef, namedef = typeinfo
+ qualified = eleinfo
+ if namedef.nil?
+ raise MethodDefinitionError.new("qname must be given")
+ end
+ case inout
+ when SOAPMethod::IN
+ @doc_request_qnames << XSD::QName.new(nsdef, namedef)
+ @doc_request_qualified << qualified
+ when SOAPMethod::OUT
+ @doc_response_qnames << XSD::QName.new(nsdef, namedef)
+ @doc_response_qualified << qualified
+ else
+ raise MethodDefinitionError.new(
+ "illegal inout definition for document style: #{inout}")
+ end
+ end
+ end
+ end
+
+ def request_default_encodingstyle
+ (@request_use == :encoded) ? EncodingNamespace : LiteralNamespace
+ end
+
+ def response_default_encodingstyle
+ (@response_use == :encoded) ? EncodingNamespace : LiteralNamespace
+ end
+
+ def request_body(values, mapping_registry, literal_mapping_registry, opt)
+ if @request_style == :rpc
+ request_rpc(values, mapping_registry, literal_mapping_registry, opt)
+ else
+ request_doc(values, mapping_registry, literal_mapping_registry, opt)
+ end
+ end
+
+ def response_obj(body, mapping_registry, literal_mapping_registry, opt)
+ if @response_style == :rpc
+ response_rpc(body, mapping_registry, literal_mapping_registry, opt)
+ else
+ response_doc(body, mapping_registry, literal_mapping_registry, opt)
+ end
+ end
+
+ def raise_fault(e, mapping_registry, literal_mapping_registry)
+ if @response_style == :rpc
+ Mapping.fault2exception(e, mapping_registry)
+ else
+ Mapping.fault2exception(e, literal_mapping_registry)
+ end
+ end
+
+ private
+
+ def check_style(style)
+ unless [:rpc, :document].include?(style)
+ raise MethodDefinitionError.new("unknown style: #{style}")
+ end
+ end
+
+ def check_use(use)
+ unless [:encoded, :literal].include?(use)
+ raise MethodDefinitionError.new("unknown use: #{use}")
+ end
+ end
+
+ def request_rpc(values, mapping_registry, literal_mapping_registry, opt)
+ if @request_use == :encoded
+ request_rpc_enc(values, mapping_registry, opt)
+ else
+ request_rpc_lit(values, literal_mapping_registry, opt)
+ end
+ end
+
+ def request_doc(values, mapping_registry, literal_mapping_registry, opt)
+ if @request_use == :encoded
+ request_doc_enc(values, mapping_registry, opt)
+ else
+ request_doc_lit(values, literal_mapping_registry, opt)
+ end
+ end
+
+ def request_rpc_enc(values, mapping_registry, opt)
+ method = @rpc_method_factory.dup
+ names = method.input_params
+ obj = create_request_obj(names, values)
+ soap = Mapping.obj2soap(obj, mapping_registry, @rpc_request_qname, opt)
+ method.set_param(soap)
+ method
+ end
+
+ def request_rpc_lit(values, mapping_registry, opt)
+ method = @rpc_method_factory.dup
+ params = {}
+ idx = 0
+ method.input_params.each do |name|
+ params[name] = Mapping.obj2soap(values[idx], mapping_registry,
+ XSD::QName.new(nil, name), opt)
+ idx += 1
+ end
+ method.set_param(params)
+ method
+ end
+
+ def request_doc_enc(values, mapping_registry, opt)
+ (0...values.size).collect { |idx|
+ ele = Mapping.obj2soap(values[idx], mapping_registry, nil, opt)
+ ele.elename = @doc_request_qnames[idx]
+ ele
+ }
+ end
+
+ def request_doc_lit(values, mapping_registry, opt)
+ (0...values.size).collect { |idx|
+ ele = Mapping.obj2soap(values[idx], mapping_registry,
+ @doc_request_qnames[idx], opt)
+ ele.encodingstyle = LiteralNamespace
+ if ele.respond_to?(:qualified)
+ ele.qualified = @doc_request_qualified[idx]
+ end
+ ele
+ }
+ end
+
+ def response_rpc(body, mapping_registry, literal_mapping_registry, opt)
+ if @response_use == :encoded
+ response_rpc_enc(body, mapping_registry, opt)
+ else
+ response_rpc_lit(body, literal_mapping_registry, opt)
+ end
+ end
+
+ def response_doc(body, mapping_registry, literal_mapping_registry, opt)
+ if @response_use == :encoded
+ return *response_doc_enc(body, mapping_registry, opt)
+ else
+ return *response_doc_lit(body, literal_mapping_registry, opt)
+ end
+ end
+
+ def response_rpc_enc(body, mapping_registry, opt)
+ ret = nil
+ if body.response
+ ret = Mapping.soap2obj(body.response, mapping_registry,
+ @rpc_method_factory.retval_class_name, opt)
+ end
+ if body.outparams
+ outparams = body.outparams.collect { |outparam|
+ Mapping.soap2obj(outparam, mapping_registry, nil, opt)
+ }
+ [ret].concat(outparams)
+ else
+ ret
+ end
+ end
+
+ def response_rpc_lit(body, mapping_registry, opt)
+ body.root_node.collect { |key, value|
+ Mapping.soap2obj(value, mapping_registry,
+ @rpc_method_factory.retval_class_name, opt)
+ }
+ end
+
+ def response_doc_enc(body, mapping_registry, opt)
+ body.collect { |key, value|
+ Mapping.soap2obj(value, mapping_registry, nil, opt)
+ }
+ end
+
+ def response_doc_lit(body, mapping_registry, opt)
+ body.collect { |key, value|
+ Mapping.soap2obj(value, mapping_registry)
+ }
+ end
+
+ def create_request_obj(names, params)
+ o = Object.new
+ idx = 0
+ while idx < params.length
+ o.instance_variable_set('@' + names[idx], params[idx])
+ idx += 1
+ end
+ o
+ end
+ end
+end
+
+
+end
+end
diff --git a/lib/soap/rpc/router.rb b/lib/soap/rpc/router.rb
new file mode 100644
index 0000000000..71c6eb625b
--- /dev/null
+++ b/lib/soap/rpc/router.rb
@@ -0,0 +1,594 @@
+# SOAP4R - RPC Routing library
+# Copyright (C) 2001, 2002, 2004, 2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+require 'soap/soap'
+require 'soap/processor'
+require 'soap/mapping'
+require 'soap/mapping/wsdlliteralregistry'
+require 'soap/rpc/rpc'
+require 'soap/rpc/element'
+require 'soap/streamHandler'
+require 'soap/mimemessage'
+require 'soap/header/handlerset'
+
+
+module SOAP
+module RPC
+
+
+class Router
+ include SOAP
+
+ attr_reader :actor
+ attr_accessor :mapping_registry
+ attr_accessor :literal_mapping_registry
+ attr_accessor :generate_explicit_type
+ attr_accessor :external_ces
+
+ def initialize(actor)
+ @actor = actor
+ @mapping_registry = nil
+ @headerhandler = Header::HandlerSet.new
+ @literal_mapping_registry = ::SOAP::Mapping::WSDLLiteralRegistry.new
+ @generate_explicit_type = true
+ @external_ces = nil
+ @operation_by_soapaction = {}
+ @operation_by_qname = {}
+ @headerhandlerfactory = []
+ end
+
+ ###
+ ## header handler interface
+ #
+ def add_request_headerhandler(factory)
+ unless factory.respond_to?(:create)
+ raise TypeError.new("factory must respond to 'create'")
+ end
+ @headerhandlerfactory << factory
+ end
+
+ def add_headerhandler(handler)
+ @headerhandler.add(handler)
+ end
+
+ ###
+ ## servant definition interface
+ #
+ def add_rpc_request_servant(factory, namespace)
+ unless factory.respond_to?(:create)
+ raise TypeError.new("factory must respond to 'create'")
+ end
+ obj = factory.create # a dummy instance for introspection
+ ::SOAP::RPC.defined_methods(obj).each do |name|
+ begin
+ qname = XSD::QName.new(namespace, name)
+ param_def = ::SOAP::RPC::SOAPMethod.derive_rpc_param_def(obj, name)
+ opt = create_styleuse_option(:rpc, :encoded)
+ add_rpc_request_operation(factory, qname, nil, name, param_def, opt)
+ rescue SOAP::RPC::MethodDefinitionError => e
+ p e if $DEBUG
+ end
+ end
+ end
+
+ def add_rpc_servant(obj, namespace)
+ ::SOAP::RPC.defined_methods(obj).each do |name|
+ begin
+ qname = XSD::QName.new(namespace, name)
+ param_def = ::SOAP::RPC::SOAPMethod.derive_rpc_param_def(obj, name)
+ opt = create_styleuse_option(:rpc, :encoded)
+ add_rpc_operation(obj, qname, nil, name, param_def, opt)
+ rescue SOAP::RPC::MethodDefinitionError => e
+ p e if $DEBUG
+ end
+ end
+ end
+ alias add_servant add_rpc_servant
+
+ ###
+ ## operation definition interface
+ #
+ def add_rpc_operation(receiver, qname, soapaction, name, param_def, opt = {})
+ ensure_styleuse_option(opt, :rpc, :encoded)
+ opt[:request_qname] = qname
+ op = ApplicationScopeOperation.new(soapaction, receiver, name, param_def,
+ opt)
+ if opt[:request_style] != :rpc
+ raise RPCRoutingError.new("illegal request_style given")
+ end
+ assign_operation(soapaction, qname, op)
+ end
+ alias add_method add_rpc_operation
+ alias add_rpc_method add_rpc_operation
+
+ def add_rpc_request_operation(factory, qname, soapaction, name, param_def, opt = {})
+ ensure_styleuse_option(opt, :rpc, :encoded)
+ opt[:request_qname] = qname
+ op = RequestScopeOperation.new(soapaction, factory, name, param_def, opt)
+ if opt[:request_style] != :rpc
+ raise RPCRoutingError.new("illegal request_style given")
+ end
+ assign_operation(soapaction, qname, op)
+ end
+
+ def add_document_operation(receiver, soapaction, name, param_def, opt = {})
+ #
+ # adopt workaround for doc/lit wrapper method
+ # (you should consider to simply use rpc/lit service)
+ #
+ #unless soapaction
+ # raise RPCRoutingError.new("soapaction is a must for document method")
+ #end
+ ensure_styleuse_option(opt, :document, :literal)
+ op = ApplicationScopeOperation.new(soapaction, receiver, name, param_def,
+ opt)
+ if opt[:request_style] != :document
+ raise RPCRoutingError.new("illegal request_style given")
+ end
+ assign_operation(soapaction, first_input_part_qname(param_def), op)
+ end
+ alias add_document_method add_document_operation
+
+ def add_document_request_operation(factory, soapaction, name, param_def, opt = {})
+ #
+ # adopt workaround for doc/lit wrapper method
+ # (you should consider to simply use rpc/lit service)
+ #
+ #unless soapaction
+ # raise RPCRoutingError.new("soapaction is a must for document method")
+ #end
+ ensure_styleuse_option(opt, :document, :literal)
+ op = RequestScopeOperation.new(soapaction, receiver, name, param_def, opt)
+ if opt[:request_style] != :document
+ raise RPCRoutingError.new("illegal request_style given")
+ end
+ assign_operation(soapaction, first_input_part_qname(param_def), op)
+ end
+
+ def route(conn_data)
+ # we cannot set request_default_encodingsyle before parsing the content.
+ env = unmarshal(conn_data)
+ if env.nil?
+ raise ArgumentError.new("illegal SOAP marshal format")
+ end
+ op = lookup_operation(conn_data.soapaction, env.body)
+ headerhandler = @headerhandler.dup
+ @headerhandlerfactory.each do |f|
+ headerhandler.add(f.create)
+ end
+ receive_headers(headerhandler, env.header)
+ soap_response = default_encodingstyle = nil
+ begin
+ soap_response =
+ op.call(env.body, @mapping_registry, @literal_mapping_registry,
+ create_mapping_opt)
+ default_encodingstyle = op.response_default_encodingstyle
+ rescue Exception
+ soap_response = fault($!)
+ default_encodingstyle = nil
+ end
+ conn_data.is_fault = true if soap_response.is_a?(SOAPFault)
+ header = call_headers(headerhandler)
+ body = SOAPBody.new(soap_response)
+ env = SOAPEnvelope.new(header, body)
+ marshal(conn_data, env, default_encodingstyle)
+ end
+
+ # Create fault response string.
+ def create_fault_response(e)
+ env = SOAPEnvelope.new(SOAPHeader.new, SOAPBody.new(fault(e)))
+ opt = {}
+ opt[:external_content] = nil
+ response_string = Processor.marshal(env, opt)
+ conn_data = StreamHandler::ConnectionData.new(response_string)
+ conn_data.is_fault = true
+ if ext = opt[:external_content]
+ mimeize(conn_data, ext)
+ end
+ conn_data
+ end
+
+private
+
+ def first_input_part_qname(param_def)
+ param_def.each do |inout, paramname, typeinfo|
+ if inout == SOAPMethod::IN
+ klass, nsdef, namedef = typeinfo
+ return XSD::QName.new(nsdef, namedef)
+ end
+ end
+ nil
+ end
+
+ def create_styleuse_option(style, use)
+ opt = {}
+ opt[:request_style] = opt[:response_style] = style
+ opt[:request_use] = opt[:response_use] = use
+ opt
+ end
+
+ def ensure_styleuse_option(opt, style, use)
+ opt[:request_style] ||= style
+ opt[:response_style] ||= style
+ opt[:request_use] ||= use
+ opt[:response_use] ||= use
+ end
+
+ def assign_operation(soapaction, qname, op)
+ assigned = false
+ if soapaction and !soapaction.empty?
+ @operation_by_soapaction[soapaction] = op
+ assigned = true
+ end
+ if qname
+ @operation_by_qname[qname] = op
+ assigned = true
+ end
+ unless assigned
+ raise RPCRoutingError.new("cannot assign operation")
+ end
+ end
+
+ def lookup_operation(soapaction, body)
+ if op = @operation_by_soapaction[soapaction]
+ return op
+ end
+ qname = body.root_node.elename
+ if op = @operation_by_qname[qname]
+ return op
+ end
+ if soapaction
+ raise RPCRoutingError.new(
+ "operation: #{soapaction} #{qname} not supported")
+ else
+ raise RPCRoutingError.new("operation: #{qname} not supported")
+ end
+ end
+
+ def call_headers(headerhandler)
+ headers = headerhandler.on_outbound
+ if headers.empty?
+ nil
+ else
+ h = ::SOAP::SOAPHeader.new
+ headers.each do |header|
+ h.add(header.elename.name, header)
+ end
+ h
+ end
+ end
+
+ def receive_headers(headerhandler, headers)
+ headerhandler.on_inbound(headers) if headers
+ end
+
+ def unmarshal(conn_data)
+ opt = {}
+ contenttype = conn_data.receive_contenttype
+ if /#{MIMEMessage::MultipartContentType}/i =~ contenttype
+ opt[:external_content] = {}
+ mime = MIMEMessage.parse("Content-Type: " + contenttype,
+ conn_data.receive_string)
+ mime.parts.each do |part|
+ value = Attachment.new(part.content)
+ value.contentid = part.contentid
+ obj = SOAPAttachment.new(value)
+ opt[:external_content][value.contentid] = obj if value.contentid
+ end
+ opt[:charset] =
+ StreamHandler.parse_media_type(mime.root.headers['content-type'].str)
+ env = Processor.unmarshal(mime.root.content, opt)
+ else
+ opt[:charset] = ::SOAP::StreamHandler.parse_media_type(contenttype)
+ env = Processor.unmarshal(conn_data.receive_string, opt)
+ end
+ charset = opt[:charset]
+ conn_data.send_contenttype = "text/xml; charset=\"#{charset}\""
+ env
+ end
+
+ def marshal(conn_data, env, default_encodingstyle = nil)
+ opt = {}
+ opt[:external_content] = nil
+ opt[:default_encodingstyle] = default_encodingstyle
+ opt[:generate_explicit_type] = @generate_explicit_type
+ response_string = Processor.marshal(env, opt)
+ conn_data.send_string = response_string
+ if ext = opt[:external_content]
+ mimeize(conn_data, ext)
+ end
+ conn_data
+ end
+
+ def mimeize(conn_data, ext)
+ mime = MIMEMessage.new
+ ext.each do |k, v|
+ mime.add_attachment(v.data)
+ end
+ mime.add_part(conn_data.send_string + "\r\n")
+ mime.close
+ conn_data.send_string = mime.content_str
+ conn_data.send_contenttype = mime.headers['content-type'].str
+ conn_data
+ end
+
+ # Create fault response.
+ def fault(e)
+ detail = Mapping::SOAPException.new(e)
+ SOAPFault.new(
+ SOAPString.new('Server'),
+ SOAPString.new(e.to_s),
+ SOAPString.new(@actor),
+ Mapping.obj2soap(detail, @mapping_registry))
+ end
+
+ def create_mapping_opt
+ { :external_ces => @external_ces }
+ end
+
+ class Operation
+ attr_reader :name
+ attr_reader :soapaction
+ attr_reader :request_style
+ attr_reader :response_style
+ attr_reader :request_use
+ attr_reader :response_use
+
+ def initialize(soapaction, name, param_def, opt)
+ @soapaction = soapaction
+ @name = name
+ @request_style = opt[:request_style]
+ @response_style = opt[:response_style]
+ @request_use = opt[:request_use]
+ @response_use = opt[:response_use]
+ check_style(@request_style)
+ check_style(@response_style)
+ check_use(@request_use)
+ check_use(@response_use)
+ if @response_style == :rpc
+ request_qname = opt[:request_qname] or raise
+ @rpc_method_factory =
+ RPC::SOAPMethodRequest.new(request_qname, param_def, @soapaction)
+ @rpc_response_qname = opt[:response_qname]
+ else
+ @doc_request_qnames = []
+ @doc_request_qualified = []
+ @doc_response_qnames = []
+ @doc_response_qualified = []
+ param_def.each do |inout, paramname, typeinfo, eleinfo|
+ klass, nsdef, namedef = typeinfo
+ qualified = eleinfo
+ case inout
+ when SOAPMethod::IN
+ @doc_request_qnames << XSD::QName.new(nsdef, namedef)
+ @doc_request_qualified << qualified
+ when SOAPMethod::OUT
+ @doc_response_qnames << XSD::QName.new(nsdef, namedef)
+ @doc_response_qualified << qualified
+ else
+ raise ArgumentError.new(
+ "illegal inout definition for document style: #{inout}")
+ end
+ end
+ end
+ end
+
+ def request_default_encodingstyle
+ (@request_use == :encoded) ? EncodingNamespace : LiteralNamespace
+ end
+
+ def response_default_encodingstyle
+ (@response_use == :encoded) ? EncodingNamespace : LiteralNamespace
+ end
+
+ def call(body, mapping_registry, literal_mapping_registry, opt)
+ if @request_style == :rpc
+ values = request_rpc(body, mapping_registry, literal_mapping_registry,
+ opt)
+ else
+ values = request_document(body, mapping_registry,
+ literal_mapping_registry, opt)
+ end
+ result = receiver.method(@name.intern).call(*values)
+ return result if result.is_a?(SOAPFault)
+ if @response_style == :rpc
+ response_rpc(result, mapping_registry, literal_mapping_registry, opt)
+ else
+ response_doc(result, mapping_registry, literal_mapping_registry, opt)
+ end
+ end
+
+ private
+
+ def receiver
+ raise NotImplementedError.new('must be defined in derived class')
+ end
+
+ def request_rpc(body, mapping_registry, literal_mapping_registry, opt)
+ request = body.request
+ unless request.is_a?(SOAPStruct)
+ raise RPCRoutingError.new("not an RPC style")
+ end
+ if @request_use == :encoded
+ request_rpc_enc(request, mapping_registry, opt)
+ else
+ request_rpc_lit(request, literal_mapping_registry, opt)
+ end
+ end
+
+ def request_document(body, mapping_registry, literal_mapping_registry, opt)
+ # ToDo: compare names with @doc_request_qnames
+ if @request_use == :encoded
+ request_doc_enc(body, mapping_registry, opt)
+ else
+ request_doc_lit(body, literal_mapping_registry, opt)
+ end
+ end
+
+ def request_rpc_enc(request, mapping_registry, opt)
+ param = Mapping.soap2obj(request, mapping_registry, nil, opt)
+ request.collect { |key, value|
+ param[key]
+ }
+ end
+
+ def request_rpc_lit(request, mapping_registry, opt)
+ request.collect { |key, value|
+ Mapping.soap2obj(value, mapping_registry, nil, opt)
+ }
+ end
+
+ def request_doc_enc(body, mapping_registry, opt)
+ body.collect { |key, value|
+ Mapping.soap2obj(value, mapping_registry, nil, opt)
+ }
+ end
+
+ def request_doc_lit(body, mapping_registry, opt)
+ body.collect { |key, value|
+ Mapping.soap2obj(value, mapping_registry, nil, opt)
+ }
+ end
+
+ def response_rpc(result, mapping_registry, literal_mapping_registry, opt)
+ if @response_use == :encoded
+ response_rpc_enc(result, mapping_registry, opt)
+ else
+ response_rpc_lit(result, literal_mapping_registry, opt)
+ end
+ end
+
+ def response_doc(result, mapping_registry, literal_mapping_registry, opt)
+ if @doc_response_qnames.size == 1 and !result.is_a?(Array)
+ result = [result]
+ end
+ if result.size != @doc_response_qnames.size
+ raise "required #{@doc_response_qnames.size} responses " +
+ "but #{result.size} given"
+ end
+ if @response_use == :encoded
+ response_doc_enc(result, mapping_registry, opt)
+ else
+ response_doc_lit(result, literal_mapping_registry, opt)
+ end
+ end
+
+ def response_rpc_enc(result, mapping_registry, opt)
+ soap_response =
+ @rpc_method_factory.create_method_response(@rpc_response_qname)
+ if soap_response.have_outparam?
+ unless result.is_a?(Array)
+ raise RPCRoutingError.new("out parameter was not returned")
+ end
+ outparams = {}
+ i = 1
+ soap_response.output_params.each do |outparam|
+ outparams[outparam] = Mapping.obj2soap(result[i], mapping_registry,
+ nil, opt)
+ i += 1
+ end
+ soap_response.set_outparam(outparams)
+ soap_response.retval = Mapping.obj2soap(result[0], mapping_registry,
+ nil, opt)
+ else
+ soap_response.retval = Mapping.obj2soap(result, mapping_registry, nil,
+ opt)
+ end
+ soap_response
+ end
+
+ def response_rpc_lit(result, mapping_registry, opt)
+ soap_response =
+ @rpc_method_factory.create_method_response(@rpc_response_qname)
+ if soap_response.have_outparam?
+ unless result.is_a?(Array)
+ raise RPCRoutingError.new("out parameter was not returned")
+ end
+ outparams = {}
+ i = 1
+ soap_response.output_params.each do |outparam|
+ outparams[outparam] = Mapping.obj2soap(result[i], mapping_registry,
+ XSD::QName.new(nil, outparam), opt)
+ i += 1
+ end
+ soap_response.set_outparam(outparams)
+ soap_response.retval = Mapping.obj2soap(result[0], mapping_registry,
+ XSD::QName.new(nil, soap_response.elename), opt)
+ else
+ soap_response.retval = Mapping.obj2soap(result, mapping_registry,
+ XSD::QName.new(nil, soap_response.elename), opt)
+ end
+ soap_response
+ end
+
+ def response_doc_enc(result, mapping_registry, opt)
+ (0...result.size).collect { |idx|
+ ele = Mapping.obj2soap(result[idx], mapping_registry, nil, opt)
+ ele.elename = @doc_response_qnames[idx]
+ ele
+ }
+ end
+
+ def response_doc_lit(result, mapping_registry, opt)
+ (0...result.size).collect { |idx|
+ ele = Mapping.obj2soap(result[idx], mapping_registry,
+ @doc_response_qnames[idx])
+ ele.encodingstyle = LiteralNamespace
+ if ele.respond_to?(:qualified)
+ ele.qualified = @doc_response_qualified[idx]
+ end
+ ele
+ }
+ end
+
+ def check_style(style)
+ unless [:rpc, :document].include?(style)
+ raise ArgumentError.new("unknown style: #{style}")
+ end
+ end
+
+ def check_use(use)
+ unless [:encoded, :literal].include?(use)
+ raise ArgumentError.new("unknown use: #{use}")
+ end
+ end
+ end
+
+ class ApplicationScopeOperation < Operation
+ def initialize(soapaction, receiver, name, param_def, opt)
+ super(soapaction, name, param_def, opt)
+ @receiver = receiver
+ end
+
+ private
+
+ def receiver
+ @receiver
+ end
+ end
+
+ class RequestScopeOperation < Operation
+ def initialize(soapaction, receiver_factory, name, param_def, opt)
+ super(soapaction, name, param_def, opt)
+ unless receiver_factory.respond_to?(:create)
+ raise TypeError.new("factory must respond to 'create'")
+ end
+ @receiver_factory = receiver_factory
+ end
+
+ private
+
+ def receiver
+ @receiver_factory.create
+ end
+ end
+end
+
+
+end
+end
diff --git a/lib/soap/rpc/rpc.rb b/lib/soap/rpc/rpc.rb
new file mode 100644
index 0000000000..a48b525dbb
--- /dev/null
+++ b/lib/soap/rpc/rpc.rb
@@ -0,0 +1,25 @@
+# SOAP4R - RPC utility.
+# Copyright (C) 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+module SOAP
+
+
+module RPC
+ ServerException = Mapping::MappedException
+
+ def self.defined_methods(obj)
+ if obj.is_a?(Module)
+ obj.methods - Module.methods
+ else
+ obj.methods - Object.instance_methods(true)
+ end
+ end
+end
+
+
+end
diff --git a/lib/soap/rpc/soaplet.rb b/lib/soap/rpc/soaplet.rb
new file mode 100644
index 0000000000..7cccdd3e31
--- /dev/null
+++ b/lib/soap/rpc/soaplet.rb
@@ -0,0 +1,162 @@
+# SOAP4R - SOAP handler servlet for WEBrick
+# Copyright (C) 2001-2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+require 'webrick/httpservlet/abstract'
+require 'webrick/httpstatus'
+require 'soap/rpc/router'
+require 'soap/streamHandler'
+begin
+ require 'stringio'
+ require 'zlib'
+rescue LoadError
+ warn("Loading stringio or zlib failed. No gzipped response supported.") if $DEBUG
+end
+
+
+warn("Overriding WEBrick::Log#debug") if $DEBUG
+require 'webrick/log'
+module WEBrick
+ class Log < BasicLog
+ alias __debug debug
+ def debug(msg = nil)
+ if block_given? and msg.nil?
+ __debug(yield)
+ else
+ __debug(msg)
+ end
+ end
+ end
+end
+
+
+module SOAP
+module RPC
+
+
+class SOAPlet < WEBrick::HTTPServlet::AbstractServlet
+public
+ attr_reader :options
+
+ def initialize(router = nil)
+ @router = router || ::SOAP::RPC::Router.new(self.class.name)
+ @options = {}
+ @config = {}
+ end
+
+ # for backward compatibility
+ def app_scope_router
+ @router
+ end
+
+ # for backward compatibility
+ def add_servant(obj, namespace)
+ @router.add_rpc_servant(obj, namespace)
+ end
+
+ def allow_content_encoding_gzip=(allow)
+ @options[:allow_content_encoding_gzip] = allow
+ end
+
+ ###
+ ## Servlet interfaces for WEBrick.
+ #
+ def get_instance(config, *options)
+ @config = config
+ self
+ end
+
+ def require_path_info?
+ false
+ end
+
+ def do_GET(req, res)
+ res.header['Allow'] = 'POST'
+ raise WEBrick::HTTPStatus::MethodNotAllowed, "GET request not allowed"
+ end
+
+ def do_POST(req, res)
+ logger.debug { "SOAP request: " + req.body } if logger
+ begin
+ conn_data = ::SOAP::StreamHandler::ConnectionData.new
+ setup_req(conn_data, req)
+ @router.external_ces = @options[:external_ces]
+ conn_data = @router.route(conn_data)
+ setup_res(conn_data, req, res)
+ rescue Exception => e
+ conn_data = @router.create_fault_response(e)
+ res.status = WEBrick::HTTPStatus::RC_INTERNAL_SERVER_ERROR
+ res.body = conn_data.send_string
+ res['content-type'] = conn_data.send_contenttype || "text/xml"
+ end
+ if res.body.is_a?(IO)
+ res.chunked = true
+ logger.debug { "SOAP response: (chunked response not logged)" } if logger
+ else
+ logger.debug { "SOAP response: " + res.body } if logger
+ end
+ end
+
+private
+
+ def logger
+ @config[:Logger]
+ end
+
+ def setup_req(conn_data, req)
+ conn_data.receive_string = req.body
+ conn_data.receive_contenttype = req['content-type']
+ conn_data.soapaction = parse_soapaction(req.meta_vars['HTTP_SOAPACTION'])
+ end
+
+ def setup_res(conn_data, req, res)
+ res['content-type'] = conn_data.send_contenttype
+ if conn_data.is_fault
+ res.status = WEBrick::HTTPStatus::RC_INTERNAL_SERVER_ERROR
+ end
+ if outstring = encode_gzip(req, conn_data.send_string)
+ res['content-encoding'] = 'gzip'
+ res['content-length'] = outstring.size
+ res.body = outstring
+ else
+ res.body = conn_data.send_string
+ end
+ end
+
+ def parse_soapaction(soapaction)
+ if !soapaction.nil? and !soapaction.empty?
+ if /^"(.+)"$/ =~ soapaction
+ return $1
+ end
+ end
+ nil
+ end
+
+ def encode_gzip(req, outstring)
+ unless encode_gzip?(req)
+ return nil
+ end
+ begin
+ ostream = StringIO.new
+ gz = Zlib::GzipWriter.new(ostream)
+ gz.write(outstring)
+ ostream.string
+ ensure
+ gz.close
+ end
+ end
+
+ def encode_gzip?(req)
+ @options[:allow_content_encoding_gzip] and defined?(::Zlib) and
+ req['accept-encoding'] and
+ req['accept-encoding'].split(/,\s*/).include?('gzip')
+ end
+end
+
+
+end
+end
diff --git a/lib/soap/rpc/standaloneServer.rb b/lib/soap/rpc/standaloneServer.rb
new file mode 100644
index 0000000000..080343ba33
--- /dev/null
+++ b/lib/soap/rpc/standaloneServer.rb
@@ -0,0 +1,43 @@
+# SOAP4R - WEBrick Server
+# Copyright (C) 2003 by NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+require 'soap/rpc/httpserver'
+
+
+module SOAP
+module RPC
+
+
+class StandaloneServer < HTTPServer
+ def initialize(appname, default_namespace, host = "0.0.0.0", port = 8080)
+ @appname = appname
+ @default_namespace = default_namespace
+ @host = host
+ @port = port
+ super(create_config)
+ end
+
+ alias add_servant add_rpc_servant
+ alias add_headerhandler add_rpc_headerhandler
+
+private
+
+ def create_config
+ {
+ :BindAddress => @host,
+ :Port => @port,
+ :AccessLog => [],
+ :SOAPDefaultNamespace => @default_namespace,
+ :SOAPHTTPServerApplicationName => @appname,
+ }
+ end
+end
+
+
+end
+end
diff --git a/lib/soap/soap.rb b/lib/soap/soap.rb
new file mode 100644
index 0000000000..12e09eccfe
--- /dev/null
+++ b/lib/soap/soap.rb
@@ -0,0 +1,140 @@
+# soap/soap.rb: SOAP4R - Base definitions.
+# Copyright (C) 2000-2004 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+require 'xsd/qname'
+require 'xsd/charset'
+
+
+module SOAP
+
+
+VERSION = Version = '1.5.5'
+PropertyName = 'soap/property'
+
+EnvelopeNamespace = 'http://schemas.xmlsoap.org/soap/envelope/'
+EncodingNamespace = 'http://schemas.xmlsoap.org/soap/encoding/'
+LiteralNamespace = 'http://xml.apache.org/xml-soap/literalxml'
+
+NextActor = 'http://schemas.xmlsoap.org/soap/actor/next'
+
+EleEnvelope = 'Envelope'
+EleHeader = 'Header'
+EleBody = 'Body'
+EleFault = 'Fault'
+EleFaultString = 'faultstring'
+EleFaultActor = 'faultactor'
+EleFaultCode = 'faultcode'
+EleFaultDetail = 'detail'
+
+AttrMustUnderstand = 'mustUnderstand'
+AttrEncodingStyle = 'encodingStyle'
+AttrActor = 'actor'
+AttrRoot = 'root'
+AttrArrayType = 'arrayType'
+AttrOffset = 'offset'
+AttrPosition = 'position'
+ValueArray = 'Array'
+
+EleEnvelopeName = XSD::QName.new(EnvelopeNamespace, EleEnvelope).freeze
+EleHeaderName = XSD::QName.new(EnvelopeNamespace, EleHeader).freeze
+EleBodyName = XSD::QName.new(EnvelopeNamespace, EleBody).freeze
+EleFaultName = XSD::QName.new(EnvelopeNamespace, EleFault).freeze
+EleFaultStringName = XSD::QName.new(nil, EleFaultString).freeze
+EleFaultActorName = XSD::QName.new(nil, EleFaultActor).freeze
+EleFaultCodeName = XSD::QName.new(nil, EleFaultCode).freeze
+EleFaultDetailName = XSD::QName.new(nil, EleFaultDetail).freeze
+AttrMustUnderstandName = XSD::QName.new(EnvelopeNamespace, AttrMustUnderstand).freeze
+AttrEncodingStyleName = XSD::QName.new(EnvelopeNamespace, AttrEncodingStyle).freeze
+AttrRootName = XSD::QName.new(EncodingNamespace, AttrRoot).freeze
+AttrArrayTypeName = XSD::QName.new(EncodingNamespace, AttrArrayType).freeze
+AttrOffsetName = XSD::QName.new(EncodingNamespace, AttrOffset).freeze
+AttrPositionName = XSD::QName.new(EncodingNamespace, AttrPosition).freeze
+ValueArrayName = XSD::QName.new(EncodingNamespace, ValueArray).freeze
+
+Base64Literal = 'base64'
+
+SOAPNamespaceTag = 'env'
+XSDNamespaceTag = 'xsd'
+XSINamespaceTag = 'xsi'
+
+MediaType = 'text/xml'
+
+class Error < StandardError; end
+
+class StreamError < Error; end
+class HTTPStreamError < StreamError; end
+class PostUnavailableError < HTTPStreamError; end
+class MPostUnavailableError < HTTPStreamError; end
+
+class ArrayIndexOutOfBoundsError < Error; end
+class ArrayStoreError < Error; end
+
+class RPCRoutingError < Error; end
+class EmptyResponseError < Error; end
+class ResponseFormatError < Error; end
+
+class UnhandledMustUnderstandHeaderError < Error; end
+
+class FaultError < Error
+ attr_reader :faultcode
+ attr_reader :faultstring
+ attr_reader :faultactor
+ attr_accessor :detail
+
+ def initialize(fault)
+ @faultcode = fault.faultcode
+ @faultstring = fault.faultstring
+ @faultactor = fault.faultactor
+ @detail = fault.detail
+ super(self.to_s)
+ end
+
+ def to_s
+ str = nil
+ if @faultstring and @faultstring.respond_to?('data')
+ str = @faultstring.data
+ end
+ str || '(No faultstring)'
+ end
+end
+
+
+module Env
+ def self.getenv(name)
+ ENV[name.downcase] || ENV[name.upcase]
+ end
+
+ use_proxy = getenv('soap_use_proxy') == 'on'
+ HTTP_PROXY = use_proxy ? getenv('http_proxy') : nil
+ NO_PROXY = use_proxy ? getenv('no_proxy') : nil
+end
+
+
+end
+
+
+unless Object.respond_to?(:instance_variable_get)
+ class Object
+ def instance_variable_get(ivarname)
+ instance_eval(ivarname)
+ end
+
+ def instance_variable_set(ivarname, value)
+ instance_eval("#{ivarname} = value")
+ end
+ end
+end
+
+
+unless Kernel.respond_to?(:warn)
+ module Kernel
+ def warn(msg)
+ STDERR.puts(msg + "\n") unless $VERBOSE.nil?
+ end
+ end
+end
diff --git a/lib/soap/streamHandler.rb b/lib/soap/streamHandler.rb
new file mode 100644
index 0000000000..672396ecce
--- /dev/null
+++ b/lib/soap/streamHandler.rb
@@ -0,0 +1,229 @@
+# SOAP4R - Stream handler.
+# Copyright (C) 2000, 2001, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+require 'soap/soap'
+require 'soap/httpconfigloader'
+begin
+ require 'stringio'
+ require 'zlib'
+rescue LoadError
+ warn("Loading stringio or zlib failed. No gzipped response support.") if $DEBUG
+end
+
+
+module SOAP
+
+
+class StreamHandler
+ RUBY_VERSION_STRING = "ruby #{ RUBY_VERSION } (#{ RUBY_RELEASE_DATE }) [#{ RUBY_PLATFORM }]"
+
+ class ConnectionData
+ attr_accessor :send_string
+ attr_accessor :send_contenttype
+ attr_accessor :receive_string
+ attr_accessor :receive_contenttype
+ attr_accessor :is_fault
+ attr_accessor :soapaction
+
+ def initialize(send_string = nil)
+ @send_string = send_string
+ @send_contenttype = nil
+ @receive_string = nil
+ @receive_contenttype = nil
+ @is_fault = false
+ @soapaction = nil
+ end
+ end
+
+ def self.parse_media_type(str)
+ if /^#{ MediaType }(?:\s*;\s*charset=([^"]+|"[^"]+"))?$/i !~ str
+ return nil
+ end
+ charset = $1
+ charset.gsub!(/"/, '') if charset
+ charset || 'us-ascii'
+ end
+
+ def self.create_media_type(charset)
+ "#{ MediaType }; charset=#{ charset }"
+ end
+end
+
+
+class HTTPStreamHandler < StreamHandler
+ include SOAP
+
+ begin
+ require 'http-access2'
+ if HTTPAccess2::VERSION < "2.0"
+ raise LoadError.new("http-access/2.0 or later is required.")
+ end
+ Client = HTTPAccess2::Client
+ RETRYABLE = true
+ rescue LoadError
+ warn("Loading http-access2 failed. Net/http is used.") if $DEBUG
+ require 'soap/netHttpClient'
+ Client = SOAP::NetHttpClient
+ RETRYABLE = false
+ end
+
+
+public
+
+ attr_reader :client
+ attr_accessor :wiredump_file_base
+
+ MAX_RETRY_COUNT = 10 # [times]
+
+ def initialize(options)
+ super()
+ @client = Client.new(nil, "SOAP4R/#{ Version }")
+ @wiredump_file_base = nil
+ @charset = @wiredump_dev = nil
+ @options = options
+ set_options
+ @client.debug_dev = @wiredump_dev
+ @cookie_store = nil
+ @accept_encoding_gzip = false
+ end
+
+ def test_loopback_response
+ @client.test_loopback_response
+ end
+
+ def accept_encoding_gzip=(allow)
+ @accept_encoding_gzip = allow
+ end
+
+ def inspect
+ "#<#{self.class}>"
+ end
+
+ def send(endpoint_url, conn_data, soapaction = nil, charset = @charset)
+ conn_data.soapaction ||= soapaction # for backward conpatibility
+ send_post(endpoint_url, conn_data, charset)
+ end
+
+ def reset(endpoint_url = nil)
+ if endpoint_url.nil?
+ @client.reset_all
+ else
+ @client.reset(endpoint_url)
+ end
+ @client.save_cookie_store if @cookie_store
+ end
+
+private
+
+ def set_options
+ HTTPConfigLoader.set_options(@client, @options)
+ @charset = @options["charset"] || XSD::Charset.xml_encoding_label
+ @options.add_hook("charset") do |key, value|
+ @charset = value
+ end
+ @wiredump_dev = @options["wiredump_dev"]
+ @options.add_hook("wiredump_dev") do |key, value|
+ @wiredump_dev = value
+ @client.debug_dev = @wiredump_dev
+ end
+ set_cookie_store_file(@options["cookie_store_file"])
+ @options.add_hook("cookie_store_file") do |key, value|
+ set_cookie_store_file(value)
+ end
+ ssl_config = @options["ssl_config"]
+ basic_auth = @options["basic_auth"]
+ @options.lock(true)
+ ssl_config.unlock
+ basic_auth.unlock
+ end
+
+ def set_cookie_store_file(value)
+ value = nil if value and value.empty?
+ @cookie_store = value
+ @client.set_cookie_store(@cookie_store) if @cookie_store
+ end
+
+ def send_post(endpoint_url, conn_data, charset)
+ conn_data.send_contenttype ||= StreamHandler.create_media_type(charset)
+
+ if @wiredump_file_base
+ filename = @wiredump_file_base + '_request.xml'
+ f = File.open(filename, "w")
+ f << conn_data.send_string
+ f.close
+ end
+
+ extra = {}
+ extra['Content-Type'] = conn_data.send_contenttype
+ extra['SOAPAction'] = "\"#{ conn_data.soapaction }\""
+ extra['Accept-Encoding'] = 'gzip' if send_accept_encoding_gzip?
+ send_string = conn_data.send_string
+ @wiredump_dev << "Wire dump:\n\n" if @wiredump_dev
+ begin
+ retry_count = 0
+ while true
+ res = @client.post(endpoint_url, send_string, extra)
+ if RETRYABLE and HTTP::Status.redirect?(res.status)
+ retry_count += 1
+ if retry_count >= MAX_RETRY_COUNT
+ raise HTTPStreamError.new("redirect count exceeded")
+ end
+ endpoint_url = res.header["location"][0]
+ puts "redirected to #{endpoint_url}" if $DEBUG
+ else
+ break
+ end
+ end
+ rescue
+ @client.reset(endpoint_url)
+ raise
+ end
+ @wiredump_dev << "\n\n" if @wiredump_dev
+ receive_string = res.content
+ if @wiredump_file_base
+ filename = @wiredump_file_base + '_response.xml'
+ f = File.open(filename, "w")
+ f << receive_string
+ f.close
+ end
+ case res.status
+ when 405
+ raise PostUnavailableError.new("#{ res.status }: #{ res.reason }")
+ when 200, 500
+ # Nothing to do.
+ else
+ raise HTTPStreamError.new("#{ res.status }: #{ res.reason }")
+ end
+ if res.respond_to?(:header) and !res.header['content-encoding'].empty? and
+ res.header['content-encoding'][0].downcase == 'gzip'
+ receive_string = decode_gzip(receive_string)
+ end
+ conn_data.receive_string = receive_string
+ conn_data.receive_contenttype = res.contenttype
+ conn_data
+ end
+
+ def send_accept_encoding_gzip?
+ @accept_encoding_gzip and defined?(::Zlib)
+ end
+
+ def decode_gzip(instring)
+ unless send_accept_encoding_gzip?
+ raise HTTPStreamError.new("Gzipped response content.")
+ end
+ begin
+ gz = Zlib::GzipReader.new(StringIO.new(instring))
+ gz.read
+ ensure
+ gz.close
+ end
+ end
+end
+
+
+end
diff --git a/lib/soap/wsdlDriver.rb b/lib/soap/wsdlDriver.rb
new file mode 100644
index 0000000000..eba9608df5
--- /dev/null
+++ b/lib/soap/wsdlDriver.rb
@@ -0,0 +1,575 @@
+# SOAP4R - SOAP WSDL driver
+# Copyright (C) 2002, 2003, 2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+require 'wsdl/parser'
+require 'wsdl/importer'
+require 'xsd/qname'
+require 'xsd/codegen/gensupport'
+require 'soap/mapping/wsdlencodedregistry'
+require 'soap/mapping/wsdlliteralregistry'
+require 'soap/rpc/driver'
+require 'wsdl/soap/methodDefCreator'
+
+
+module SOAP
+
+
+class WSDLDriverFactory
+ class FactoryError < StandardError; end
+
+ attr_reader :wsdl
+
+ def initialize(wsdl)
+ @wsdl = import(wsdl)
+ @methoddefcreator = WSDL::SOAP::MethodDefCreator.new(@wsdl)
+ end
+
+ def inspect
+ "#<#{self.class}:#{@wsdl.name}>"
+ end
+
+ def create_rpc_driver(servicename = nil, portname = nil)
+ port = find_port(servicename, portname)
+ drv = SOAP::RPC::Driver.new(port.soap_address.location)
+ init_driver(drv, port)
+ add_operation(drv, port)
+ drv
+ end
+
+ # depricated old interface
+ def create_driver(servicename = nil, portname = nil)
+ warn("WSDLDriverFactory#create_driver is depricated. Use create_rpc_driver instead.")
+ port = find_port(servicename, portname)
+ WSDLDriver.new(@wsdl, port, nil)
+ end
+
+ # Backward compatibility.
+ alias createDriver create_driver
+
+private
+
+ def find_port(servicename = nil, portname = nil)
+ service = port = nil
+ if servicename
+ service = @wsdl.service(
+ XSD::QName.new(@wsdl.targetnamespace, servicename))
+ else
+ service = @wsdl.services[0]
+ end
+ if service.nil?
+ raise FactoryError.new("service #{servicename} not found in WSDL")
+ end
+ if portname
+ port = service.ports[XSD::QName.new(@wsdl.targetnamespace, portname)]
+ if port.nil?
+ raise FactoryError.new("port #{portname} not found in WSDL")
+ end
+ else
+ port = service.ports.find { |port| !port.soap_address.nil? }
+ if port.nil?
+ raise FactoryError.new("no ports have soap:address")
+ end
+ end
+ if port.soap_address.nil?
+ raise FactoryError.new("soap:address element not found in WSDL")
+ end
+ port
+ end
+
+ def init_driver(drv, port)
+ wsdl_elements = @wsdl.collect_elements
+ wsdl_types = @wsdl.collect_complextypes + @wsdl.collect_simpletypes
+ rpc_decode_typemap = wsdl_types +
+ @wsdl.soap_rpc_complextypes(port.find_binding)
+ drv.proxy.mapping_registry =
+ Mapping::WSDLEncodedRegistry.new(rpc_decode_typemap)
+ drv.proxy.literal_mapping_registry =
+ Mapping::WSDLLiteralRegistry.new(wsdl_types, wsdl_elements)
+ end
+
+ def add_operation(drv, port)
+ port.find_binding.operations.each do |op_bind|
+ op_name = op_bind.soapoperation_name
+ soapaction = op_bind.soapaction || ''
+ orgname = op_name.name
+ name = XSD::CodeGen::GenSupport.safemethodname(orgname)
+ param_def = create_param_def(op_bind)
+ opt = {
+ :request_style => op_bind.soapoperation_style,
+ :response_style => op_bind.soapoperation_style,
+ :request_use => op_bind.input.soapbody_use,
+ :response_use => op_bind.output.soapbody_use,
+ :elementformdefault => false,
+ :attributeformdefault => false
+ }
+ if op_bind.soapoperation_style == :rpc
+ drv.add_rpc_operation(op_name, soapaction, name, param_def, opt)
+ else
+ drv.add_document_operation(soapaction, name, param_def, opt)
+ end
+ if orgname != name and orgname.capitalize == name.capitalize
+ ::SOAP::Mapping.define_singleton_method(drv, orgname) do |*arg|
+ __send__(name, *arg)
+ end
+ end
+ end
+ end
+
+ def import(location)
+ WSDL::Importer.import(location)
+ end
+
+ def create_param_def(op_bind)
+ op = op_bind.find_operation
+ if op_bind.soapoperation_style == :rpc
+ param_def = @methoddefcreator.collect_rpcparameter(op)
+ else
+ param_def = @methoddefcreator.collect_documentparameter(op)
+ end
+ # the first element of typedef in param_def is a String like
+ # "::SOAP::SOAPStruct". turn this String to a class.
+ param_def.collect { |io, name, typedef|
+ typedef[0] = Mapping.class_from_name(typedef[0])
+ [io, name, typedef]
+ }
+ end
+
+ def partqname(part)
+ if part.type
+ part.type
+ else
+ part.element
+ end
+ end
+
+ def param_def(type, name, klass, partqname)
+ [type, name, [klass, partqname.namespace, partqname.name]]
+ end
+
+ def filter_parts(partsdef, partssource)
+ parts = partsdef.split(/\s+/)
+ partssource.find_all { |part| parts.include?(part.name) }
+ end
+end
+
+
+class WSDLDriver
+ class << self
+ if RUBY_VERSION >= "1.7.0"
+ def __attr_proxy(symbol, assignable = false)
+ name = symbol.to_s
+ define_method(name) {
+ @servant.__send__(name)
+ }
+ if assignable
+ aname = name + '='
+ define_method(aname) { |rhs|
+ @servant.__send__(aname, rhs)
+ }
+ end
+ end
+ else
+ def __attr_proxy(symbol, assignable = false)
+ name = symbol.to_s
+ module_eval <<-EOS
+ def #{name}
+ @servant.#{name}
+ end
+ EOS
+ if assignable
+ module_eval <<-EOS
+ def #{name}=(value)
+ @servant.#{name} = value
+ end
+ EOS
+ end
+ end
+ end
+ end
+
+ __attr_proxy :options
+ __attr_proxy :headerhandler
+ __attr_proxy :streamhandler
+ __attr_proxy :test_loopback_response
+ __attr_proxy :endpoint_url, true
+ __attr_proxy :mapping_registry, true # for RPC unmarshal
+ __attr_proxy :wsdl_mapping_registry, true # for RPC marshal
+ __attr_proxy :default_encodingstyle, true
+ __attr_proxy :generate_explicit_type, true
+ __attr_proxy :allow_unqualified_element, true
+
+ def httpproxy
+ @servant.options["protocol.http.proxy"]
+ end
+
+ def httpproxy=(httpproxy)
+ @servant.options["protocol.http.proxy"] = httpproxy
+ end
+
+ def wiredump_dev
+ @servant.options["protocol.http.wiredump_dev"]
+ end
+
+ def wiredump_dev=(wiredump_dev)
+ @servant.options["protocol.http.wiredump_dev"] = wiredump_dev
+ end
+
+ def mandatorycharset
+ @servant.options["protocol.mandatorycharset"]
+ end
+
+ def mandatorycharset=(mandatorycharset)
+ @servant.options["protocol.mandatorycharset"] = mandatorycharset
+ end
+
+ def wiredump_file_base
+ @servant.options["protocol.wiredump_file_base"]
+ end
+
+ def wiredump_file_base=(wiredump_file_base)
+ @servant.options["protocol.wiredump_file_base"] = wiredump_file_base
+ end
+
+ def initialize(wsdl, port, logdev)
+ @servant = Servant__.new(self, wsdl, port, logdev)
+ end
+
+ def inspect
+ "#<#{self.class}:#{@servant.port.name}>"
+ end
+
+ def reset_stream
+ @servant.reset_stream
+ end
+
+ # Backward compatibility.
+ alias generateEncodeType= generate_explicit_type=
+
+ class Servant__
+ include SOAP
+
+ attr_reader :options
+ attr_reader :port
+
+ attr_accessor :soapaction
+ attr_accessor :default_encodingstyle
+ attr_accessor :allow_unqualified_element
+ attr_accessor :generate_explicit_type
+ attr_accessor :mapping_registry
+ attr_accessor :wsdl_mapping_registry
+
+ def initialize(host, wsdl, port, logdev)
+ @host = host
+ @wsdl = wsdl
+ @port = port
+ @logdev = logdev
+ @soapaction = nil
+ @options = setup_options
+ @default_encodingstyle = nil
+ @allow_unqualified_element = nil
+ @generate_explicit_type = false
+ @mapping_registry = nil # for rpc unmarshal
+ @wsdl_mapping_registry = nil # for rpc marshal
+ @wiredump_file_base = nil
+ @mandatorycharset = nil
+ @wsdl_elements = @wsdl.collect_elements
+ @wsdl_types = @wsdl.collect_complextypes + @wsdl.collect_simpletypes
+ @rpc_decode_typemap = @wsdl_types +
+ @wsdl.soap_rpc_complextypes(port.find_binding)
+ @wsdl_mapping_registry = Mapping::WSDLEncodedRegistry.new(
+ @rpc_decode_typemap)
+ @doc_mapper = Mapping::WSDLLiteralRegistry.new(
+ @wsdl_types, @wsdl_elements)
+ endpoint_url = @port.soap_address.location
+ # Convert a map which key is QName, to a Hash which key is String.
+ @operation = {}
+ @port.inputoperation_map.each do |op_name, op_info|
+ orgname = op_name.name
+ name = XSD::CodeGen::GenSupport.safemethodname(orgname)
+ @operation[name] = @operation[orgname] = op_info
+ add_method_interface(op_info)
+ end
+ @proxy = ::SOAP::RPC::Proxy.new(endpoint_url, @soapaction, @options)
+ end
+
+ def inspect
+ "#<#{self.class}:#{@proxy.inspect}>"
+ end
+
+ def endpoint_url
+ @proxy.endpoint_url
+ end
+
+ def endpoint_url=(endpoint_url)
+ @proxy.endpoint_url = endpoint_url
+ end
+
+ def headerhandler
+ @proxy.headerhandler
+ end
+
+ def streamhandler
+ @proxy.streamhandler
+ end
+
+ def test_loopback_response
+ @proxy.test_loopback_response
+ end
+
+ def reset_stream
+ @proxy.reset_stream
+ end
+
+ def rpc_call(name, *values)
+ set_wiredump_file_base(name)
+ unless op_info = @operation[name]
+ raise RuntimeError, "method: #{name} not defined"
+ end
+ req_header = create_request_header
+ req_body = create_request_body(op_info, *values)
+ reqopt = create_options({
+ :soapaction => op_info.soapaction || @soapaction})
+ resopt = create_options({
+ :decode_typemap => @rpc_decode_typemap})
+ env = @proxy.route(req_header, req_body, reqopt, resopt)
+ raise EmptyResponseError unless env
+ receive_headers(env.header)
+ begin
+ @proxy.check_fault(env.body)
+ rescue ::SOAP::FaultError => e
+ Mapping.fault2exception(e)
+ end
+ ret = env.body.response ?
+ Mapping.soap2obj(env.body.response, @mapping_registry) : nil
+ if env.body.outparams
+ outparams = env.body.outparams.collect { |outparam|
+ Mapping.soap2obj(outparam)
+ }
+ return [ret].concat(outparams)
+ else
+ return ret
+ end
+ end
+
+ # req_header: [[element, mustunderstand, encodingstyle(QName/String)], ...]
+ # req_body: SOAPBasetype/SOAPCompoundtype
+ def document_send(name, header_obj, body_obj)
+ set_wiredump_file_base(name)
+ unless op_info = @operation[name]
+ raise RuntimeError, "method: #{name} not defined"
+ end
+ req_header = header_obj ? header_from_obj(header_obj, op_info) : nil
+ req_body = body_from_obj(body_obj, op_info)
+ opt = create_options({
+ :soapaction => op_info.soapaction || @soapaction,
+ :decode_typemap => @wsdl_types})
+ env = @proxy.invoke(req_header, req_body, opt)
+ raise EmptyResponseError unless env
+ if env.body.fault
+ raise ::SOAP::FaultError.new(env.body.fault)
+ end
+ res_body_obj = env.body.response ?
+ Mapping.soap2obj(env.body.response, @mapping_registry) : nil
+ return env.header, res_body_obj
+ end
+
+ private
+
+ def create_options(hash = nil)
+ opt = {}
+ opt[:default_encodingstyle] = @default_encodingstyle
+ opt[:allow_unqualified_element] = @allow_unqualified_element
+ opt[:generate_explicit_type] = @generate_explicit_type
+ opt.update(hash) if hash
+ opt
+ end
+
+ def set_wiredump_file_base(name)
+ if @wiredump_file_base
+ @proxy.set_wiredump_file_base(@wiredump_file_base + "_#{name}")
+ end
+ end
+
+ def create_request_header
+ headers = @proxy.headerhandler.on_outbound
+ if headers.empty?
+ nil
+ else
+ h = SOAPHeader.new
+ headers.each do |header|
+ h.add(header.elename.name, header)
+ end
+ h
+ end
+ end
+
+ def receive_headers(headers)
+ @proxy.headerhandler.on_inbound(headers) if headers
+ end
+
+ def create_request_body(op_info, *values)
+ method = create_method_struct(op_info, *values)
+ SOAPBody.new(method)
+ end
+
+ def create_method_struct(op_info, *params)
+ parts_names = op_info.bodyparts.collect { |part| part.name }
+ obj = create_method_obj(parts_names, params)
+ method = Mapping.obj2soap(obj, @wsdl_mapping_registry, op_info.op_name)
+ if method.members.size != parts_names.size
+ new_method = SOAPStruct.new
+ method.each do |key, value|
+ if parts_names.include?(key)
+ new_method.add(key, value)
+ end
+ end
+ method = new_method
+ end
+ method.elename = op_info.op_name
+ method.type = XSD::QName.new # Request should not be typed.
+ method
+ end
+
+ def create_method_obj(names, params)
+ o = Object.new
+ idx = 0
+ while idx < params.length
+ o.instance_variable_set('@' + names[idx], params[idx])
+ idx += 1
+ end
+ o
+ end
+
+ def header_from_obj(obj, op_info)
+ if obj.is_a?(SOAPHeader)
+ obj
+ elsif op_info.headerparts.empty?
+ if obj.nil?
+ nil
+ else
+ raise RuntimeError.new("no header definition in schema: #{obj}")
+ end
+ elsif op_info.headerparts.size == 1
+ part = op_info.headerparts[0]
+ header = SOAPHeader.new()
+ header.add(headeritem_from_obj(obj, part.element || part.eletype))
+ header
+ else
+ header = SOAPHeader.new()
+ op_info.headerparts.each do |part|
+ child = Mapping.get_attribute(obj, part.name)
+ ele = headeritem_from_obj(child, part.element || part.eletype)
+ header.add(part.name, ele)
+ end
+ header
+ end
+ end
+
+ def headeritem_from_obj(obj, name)
+ if obj.nil?
+ SOAPElement.new(name)
+ elsif obj.is_a?(SOAPHeaderItem)
+ obj
+ else
+ Mapping.obj2soap(obj, @doc_mapper, name)
+ end
+ end
+
+ def body_from_obj(obj, op_info)
+ if obj.is_a?(SOAPBody)
+ obj
+ elsif op_info.bodyparts.empty?
+ if obj.nil?
+ nil
+ else
+ raise RuntimeError.new("no body found in schema")
+ end
+ elsif op_info.bodyparts.size == 1
+ part = op_info.bodyparts[0]
+ ele = bodyitem_from_obj(obj, part.element || part.type)
+ SOAPBody.new(ele)
+ else
+ body = SOAPBody.new
+ op_info.bodyparts.each do |part|
+ child = Mapping.get_attribute(obj, part.name)
+ ele = bodyitem_from_obj(child, part.element || part.type)
+ body.add(ele.elename.name, ele)
+ end
+ body
+ end
+ end
+
+ def bodyitem_from_obj(obj, name)
+ if obj.nil?
+ SOAPElement.new(name)
+ elsif obj.is_a?(SOAPElement)
+ obj
+ else
+ Mapping.obj2soap(obj, @doc_mapper, name)
+ end
+ end
+
+ def add_method_interface(op_info)
+ name = XSD::CodeGen::GenSupport.safemethodname(op_info.op_name.name)
+ orgname = op_info.op_name.name
+ parts_names = op_info.bodyparts.collect { |part| part.name }
+ case op_info.style
+ when :document
+ if orgname != name and orgname.capitalize == name.capitalize
+ add_document_method_interface(orgname, parts_names)
+ end
+ add_document_method_interface(name, parts_names)
+ when :rpc
+ if orgname != name and orgname.capitalize == name.capitalize
+ add_rpc_method_interface(orgname, parts_names)
+ end
+ add_rpc_method_interface(name, parts_names)
+ else
+ raise RuntimeError.new("unknown style: #{op_info.style}")
+ end
+ end
+
+ def add_rpc_method_interface(name, parts_names)
+ ::SOAP::Mapping.define_singleton_method(@host, name) do |*arg|
+ unless arg.size == parts_names.size
+ raise ArgumentError.new(
+ "wrong number of arguments (#{arg.size} for #{parts_names.size})")
+ end
+ @servant.rpc_call(name, *arg)
+ end
+ @host.method(name)
+ end
+
+ def add_document_method_interface(name, parts_names)
+ ::SOAP::Mapping.define_singleton_method(@host, name) do |h, b|
+ @servant.document_send(name, h, b)
+ end
+ @host.method(name)
+ end
+
+ def setup_options
+ if opt = Property.loadproperty(::SOAP::PropertyName)
+ opt = opt["client"]
+ end
+ opt ||= Property.new
+ opt.add_hook("protocol.mandatorycharset") do |key, value|
+ @mandatorycharset = value
+ end
+ opt.add_hook("protocol.wiredump_file_base") do |key, value|
+ @wiredump_file_base = value
+ end
+ opt["protocol.http.charset"] ||= XSD::Charset.xml_encoding_label
+ opt["protocol.http.proxy"] ||= Env::HTTP_PROXY
+ opt["protocol.http.no_proxy"] ||= Env::NO_PROXY
+ opt
+ end
+ end
+end
+
+
+end
diff --git a/lib/sync.rb b/lib/sync.rb
index 36c4c08d45..9e522c2466 100644
--- a/lib/sync.rb
+++ b/lib/sync.rb
@@ -2,6 +2,7 @@
# sync.rb - 2 phase lock with counter
# $Release Version: 1.0$
# $Revision$
+# $Date$
# by Keiju ISHITSUKA(keiju@ishitsuka.com)
#
# --
@@ -22,8 +23,9 @@
# Sync_m#sync_lock, lock
# Sync_m#sync_unlock, unlock
#
-# Sync, Synchronizer:
-# Usage:
+# Sync, Synchronicer:
+# include Sync_m
+# Usage:
# sync = Sync.new
#
# Sync#mode
@@ -34,34 +36,35 @@
# Sync#lock(mode) -- mode = :EX, :SH, :UN
# Sync#unlock
# Sync#synchronize(mode) {...}
-#
+#
#
unless defined? Thread
- raise "Thread not available for this ruby interpreter"
+ fail "Thread not available for this ruby interpreter"
end
module Sync_m
RCS_ID='-$Header$-'
-
+
# lock mode
UN = :UN
SH = :SH
EX = :EX
-
+
# exceptions
class Err < StandardError
def Err.Fail(*opt)
+ Thread.critical = false
fail self, sprintf(self::Message, *opt)
end
-
+
class UnknownLocker < Err
Message = "Thread(%s) not locked."
def UnknownLocker.Fail(th)
super(th.inspect)
end
end
-
+
class LockModeFailer < Err
Message = "Unknown lock mode(%s)"
def LockModeFailer.Fail(mode)
@@ -72,7 +75,7 @@ module Sync_m
end
end
end
-
+
def Sync_m.define_aliases(cl)
cl.module_eval %q{
alias locked? sync_locked?
@@ -84,21 +87,22 @@ module Sync_m
alias synchronize sync_synchronize
}
end
-
+
def Sync_m.append_features(cl)
super
- # do nothing for Modules
- # make aliases for Classes.
- define_aliases(cl) unless cl.instance_of?(Module)
- self
+ unless cl.instance_of?(Module)
+ # do nothing for Modules
+ # make aliases and include the proper module.
+ define_aliases(cl)
+ end
end
-
+
def Sync_m.extend_object(obj)
super
- obj.sync_extend
+ obj.sync_extended
end
- def sync_extend
+ def sync_extended
unless (defined? locked? and
defined? shared? and
defined? exclusive? and
@@ -115,132 +119,128 @@ module Sync_m
def sync_locked?
sync_mode != UN
end
-
+
def sync_shared?
sync_mode == SH
end
-
+
def sync_exclusive?
sync_mode == EX
end
-
+
# locking methods.
def sync_try_lock(mode = EX)
return unlock if mode == UN
- @sync_mutex.synchronize do
- ret = sync_try_lock_sub(mode)
- end
+
+ Thread.critical = true
+ ret = sync_try_lock_sub(mode)
+ Thread.critical = false
ret
end
-
+
def sync_lock(m = EX)
return unlock if m == UN
- while true
- @sync_mutex.synchronize do
- if sync_try_lock_sub(m)
- return self
- else
- if sync_sh_locker[Thread.current]
- sync_upgrade_waiting.push [Thread.current, sync_sh_locker[Thread.current]]
- sync_sh_locker.delete(Thread.current)
- else
- sync_waiting.push Thread.current
- end
- @sync_mutex.sleep
- end
+ until (Thread.critical = true; sync_try_lock_sub(m))
+ if sync_sh_locker[Thread.current]
+ sync_upgrade_waiting.push [Thread.current, sync_sh_locker[Thread.current]]
+ sync_sh_locker.delete(Thread.current)
+ else
+ sync_waiting.push Thread.current
end
+ Thread.stop
end
+ Thread.critical = false
self
end
-
+
def sync_unlock(m = EX)
- wakeup_threads = []
- @sync_mutex.synchronize do
- if sync_mode == UN
+ Thread.critical = true
+ if sync_mode == UN
+ Thread.critical = false
+ Err::UnknownLocker.Fail(Thread.current)
+ end
+
+ m = sync_mode if m == EX and sync_mode == SH
+
+ runnable = false
+ case m
+ when UN
+ Thread.critical = false
+ Err::UnknownLocker.Fail(Thread.current)
+
+ when EX
+ if sync_ex_locker == Thread.current
+ if (self.sync_ex_count = sync_ex_count - 1) == 0
+ self.sync_ex_locker = nil
+ if sync_sh_locker.include?(Thread.current)
+ self.sync_mode = SH
+ else
+ self.sync_mode = UN
+ end
+ runnable = true
+ end
+ else
Err::UnknownLocker.Fail(Thread.current)
end
-
- m = sync_mode if m == EX and sync_mode == SH
-
- runnable = false
- case m
- when UN
+
+ when SH
+ if (count = sync_sh_locker[Thread.current]).nil?
Err::UnknownLocker.Fail(Thread.current)
-
- when EX
- if sync_ex_locker == Thread.current
- if (self.sync_ex_count = sync_ex_count - 1) == 0
- self.sync_ex_locker = nil
- if sync_sh_locker.include?(Thread.current)
- self.sync_mode = SH
- else
- self.sync_mode = UN
- end
+ else
+ if (sync_sh_locker[Thread.current] = count - 1) == 0
+ sync_sh_locker.delete(Thread.current)
+ if sync_sh_locker.empty? and sync_ex_count == 0
+ self.sync_mode = UN
runnable = true
end
- else
- Err::UnknownLocker.Fail(Thread.current)
- end
-
- when SH
- if (count = sync_sh_locker[Thread.current]).nil?
- Err::UnknownLocker.Fail(Thread.current)
- else
- if (sync_sh_locker[Thread.current] = count - 1) == 0
- sync_sh_locker.delete(Thread.current)
- if sync_sh_locker.empty? and sync_ex_count == 0
- self.sync_mode = UN
- runnable = true
- end
- end
end
end
-
- if runnable
- if sync_upgrade_waiting.size > 0
- th, count = sync_upgrade_waiting.shift
- sync_sh_locker[th] = count
- th.wakeup
- wakeup_threads.push th
- else
- wait = sync_waiting
- self.sync_waiting = []
- for th in wait
- th.wakeup
- wakeup_threads.push th
- end
+ end
+
+ if runnable
+ if sync_upgrade_waiting.size > 0
+ for k, v in sync_upgrade_waiting
+ sync_sh_locker[k] = v
+ end
+ wait = sync_upgrade_waiting
+ self.sync_upgrade_waiting = []
+ Thread.critical = false
+
+ for w, v in wait
+ w.run
+ end
+ else
+ wait = sync_waiting
+ self.sync_waiting = []
+ Thread.critical = false
+ for w in wait
+ w.run
end
end
end
- for th in wakeup_threads
- th.run
- end
+
+ Thread.critical = false
self
end
-
+
def sync_synchronize(mode = EX)
- sync_lock(mode)
begin
+ sync_lock(mode)
yield
ensure
sync_unlock
end
end
- attr_accessor :sync_mode
-
- attr_accessor :sync_waiting
- attr_accessor :sync_upgrade_waiting
- attr_accessor :sync_sh_locker
- attr_accessor :sync_ex_locker
- attr_accessor :sync_ex_count
-
- def sync_inspect
- sync_iv = instance_variables.select{|iv| /^@sync_/ =~ iv.id2name}.collect{|iv| iv.id2name + '=' + instance_eval(iv.id2name).inspect}.join(",")
- print "<#{self.class}.extend Sync_m: #{inspect}, <Sync_m: #{sync_iv}>"
- end
-
+ attr :sync_mode, true
+
+ attr :sync_waiting, true
+ attr :sync_upgrade_waiting, true
+ attr :sync_sh_locker, true
+ attr :sync_ex_locker, true
+ attr :sync_ex_count, true
+
private
def sync_initialize
@@ -250,15 +250,13 @@ module Sync_m
@sync_sh_locker = Hash.new
@sync_ex_locker = nil
@sync_ex_count = 0
-
- @sync_mutex = Mutex.new
end
def initialize(*args)
- super
sync_initialize
+ super
end
-
+
def sync_try_lock_sub(m)
case m
when SH
@@ -282,7 +280,7 @@ module Sync_m
end
when EX
if sync_mode == UN or
- sync_mode == SH && sync_sh_locker.size == 1 && sync_sh_locker.include?(Thread.current)
+ sync_mode == SH && sync_sh_locker.size == 1 && sync_sh_locker.include?(Thread.current)
self.sync_mode = m
self.sync_ex_locker = Thread.current
self.sync_ex_count = 1
@@ -294,6 +292,7 @@ module Sync_m
ret = false
end
else
+ Thread.critical = false
Err::LockModeFailer.Fail mode
end
return ret
@@ -302,6 +301,12 @@ end
Synchronizer_m = Sync_m
class Sync
+ #Sync_m.extend_class self
include Sync_m
+
+ def initialize
+ super
+ end
+
end
Synchronizer = Sync
diff --git a/lib/tempfile.rb b/lib/tempfile.rb
index a00208cd7c..c984cd3393 100644
--- a/lib/tempfile.rb
+++ b/lib/tempfile.rb
@@ -6,14 +6,12 @@
require 'delegate'
require 'tmpdir'
-require 'thread'
# A class for managing temporary files. This library is written to be
# thread safe.
class Tempfile < DelegateClass(File)
MAX_TRY = 10
@@cleanlist = []
- @@lock = Mutex.new
# Creates a temporary file of mode 0600 in the temporary directory,
# opens it with mode "w+", and returns a Tempfile object which
@@ -29,44 +27,38 @@ class Tempfile < DelegateClass(File)
# Dir::tmpdir provided by 'tmpdir.rb'.
# When $SAFE > 0 and the given tmpdir is tainted, it uses
# /tmp. (Note that ENV values are tainted by default)
- def initialize(basename, *rest)
- # I wish keyword argument settled soon.
- if opts = Hash.try_convert(rest[-1])
- rest.pop
- end
- tmpdir = rest[0] || Dir::tmpdir
+ def initialize(basename, tmpdir=Dir::tmpdir)
if $SAFE > 0 and tmpdir.tainted?
tmpdir = '/tmp'
end
- lock = tmpname = nil
+ lock = nil
n = failure = 0
- @@lock.synchronize {
+
+ begin
+ Thread.critical = true
+
begin
- begin
- tmpname = File.join(tmpdir, make_tmpname(basename, n))
- lock = tmpname + '.lock'
- n += 1
- end while @@cleanlist.include?(tmpname) or
- File.exist?(lock) or File.exist?(tmpname)
- Dir.mkdir(lock)
- rescue
- failure += 1
- retry if failure < MAX_TRY
- raise "cannot generate tempfile `%s'" % tmpname
- end
- }
+ tmpname = File.join(tmpdir, make_tmpname(basename, n))
+ lock = tmpname + '.lock'
+ n += 1
+ end while @@cleanlist.include?(tmpname) or
+ File.exist?(lock) or File.exist?(tmpname)
+
+ Dir.mkdir(lock)
+ rescue
+ failure += 1
+ retry if failure < MAX_TRY
+ raise "cannot generate tempfile `%s'" % tmpname
+ ensure
+ Thread.critical = false
+ end
@data = [tmpname]
@clean_proc = Tempfile.callback(@data)
ObjectSpace.define_finalizer(self, @clean_proc)
- if opts.nil?
- opts = []
- else
- opts = [opts]
- end
- @tmpfile = File.open(tmpname, File::RDWR|File::CREAT|File::EXCL, 0600, *opts)
+ @tmpfile = File.open(tmpname, File::RDWR|File::CREAT|File::EXCL, 0600)
@tmpname = tmpname
@@cleanlist << @tmpname
@data[1] = @tmpfile
@@ -87,7 +79,7 @@ class Tempfile < DelegateClass(File)
else
prefix, suffix = basename, ''
end
-
+
t = Time.now.strftime("%Y%m%d")
path = "#{prefix}#{t}-#{$$}-#{rand(0x100000000).to_s(36)}-#{n}#{suffix}"
end
@@ -105,10 +97,10 @@ class Tempfile < DelegateClass(File)
@tmpfile.close if @tmpfile
@tmpfile = nil
@data[1] = nil if @data
- end
+ end
protected :_close
- #Closes the file. If the optional flag is true, unlinks the file
+ # Closes the file. If the optional flag is true, unlinks the file
# after closing.
#
# If you don't explicitly unlink the temporary file, the removal
@@ -136,10 +128,7 @@ class Tempfile < DelegateClass(File)
def unlink
# keep this order for thread safeness
begin
- if File.exist?(@tmpname)
- closed? or close
- File.unlink(@tmpname)
- end
+ File.unlink(@tmpname) if File.exist?(@tmpname)
@@cleanlist.delete(@tmpname)
@data = @tmpname = nil
ObjectSpace.undefine_finalizer(self)
@@ -169,8 +158,8 @@ class Tempfile < DelegateClass(File)
class << self
def callback(data) # :nodoc:
pid = $$
- Proc.new {
- if pid == $$
+ lambda{
+ if pid == $$
path, tmpfile, cleanlist = *data
print "removing ", path, "..." if $DEBUG
@@ -190,7 +179,7 @@ class Tempfile < DelegateClass(File)
#
# If a block is given, it will be passed tempfile as an argument,
# and the tempfile will automatically be closed when the block
- # terminates. The call returns the value of the block.
+ # terminates. In this case, open() returns nil.
def open(*args)
tempfile = new(*args)
@@ -200,6 +189,8 @@ class Tempfile < DelegateClass(File)
ensure
tempfile.close
end
+
+ nil
else
tempfile
end
diff --git a/lib/test/unit.rb b/lib/test/unit.rb
index 3e2b388273..b71f644566 100644
--- a/lib/test/unit.rb
+++ b/lib/test/unit.rb
@@ -1,66 +1,280 @@
-# test/unit compatibility layer using minitest.
-
-require 'minitest/unit'
-require 'test/unit/assertions'
require 'test/unit/testcase'
+require 'test/unit/autorunner'
-module Test
- module Unit
- TEST_UNIT_IMPLEMENTATION = 'test/unit compatibility layer using minitest'
-
- def self.setup_argv(original_argv=ARGV)
- minitest_argv = []
- files = []
- reject = []
- original_argv = original_argv.dup
- while arg = original_argv.shift
- case arg
- when '-v'
- minitest_argv << arg
- when /\A(-n)(.+)?/, /\A(--name)=?\b(.+)?/
- minitest_argv << $1
- minitest_argv << ($2 || original_argv.shift)
- when /\A-x(.+)?/
- reject << ($1 || original_argv.shift)
- else
- files << arg
- end
- end
-
- if block_given?
- files = yield files
- end
-
- files.map! {|f|
- f = f.gsub(Regexp.compile(Regexp.quote(File::ALT_SEPARATOR)), File::SEPARATOR) if File::ALT_SEPARATOR
- if File.directory? f
- Dir["#{f}/**/test_*.rb"]
- elsif File.file? f
- f
- else
- raise ArgumentError, "file not found: #{f}"
- end
- }
- files.flatten!
+module Test # :nodoc:
+ #
+ # = Test::Unit - Ruby Unit Testing Framework
+ #
+ # == Introduction
+ #
+ # Unit testing is making waves all over the place, largely due to the
+ # fact that it is a core practice of XP. While XP is great, unit testing
+ # has been around for a long time and has always been a good idea. One
+ # of the keys to good unit testing, though, is not just writing tests,
+ # but having tests. What's the difference? Well, if you just _write_ a
+ # test and throw it away, you have no guarantee that something won't
+ # change later which breaks your code. If, on the other hand, you _have_
+ # tests (obviously you have to write them first), and run them as often
+ # as possible, you slowly build up a wall of things that cannot break
+ # without you immediately knowing about it. This is when unit testing
+ # hits its peak usefulness.
+ #
+ # Enter Test::Unit, a framework for unit testing in Ruby, helping you to
+ # design, debug and evaluate your code by making it easy to write and
+ # have tests for it.
+ #
+ #
+ # == Notes
+ #
+ # Test::Unit has grown out of and superceded Lapidary.
+ #
+ #
+ # == Feedback
+ #
+ # I like (and do my best to practice) XP, so I value early releases,
+ # user feedback, and clean, simple, expressive code. There is always
+ # room for improvement in everything I do, and Test::Unit is no
+ # exception. Please, let me know what you think of Test::Unit as it
+ # stands, and what you'd like to see expanded/changed/improved/etc. If
+ # you find a bug, let me know ASAP; one good way to let me know what the
+ # bug is is to submit a new test that catches it :-) Also, I'd love to
+ # hear about any successes you have with Test::Unit, and any
+ # documentation you might add will be greatly appreciated. My contact
+ # info is below.
+ #
+ #
+ # == Contact Information
+ #
+ # A lot of discussion happens about Ruby in general on the ruby-talk
+ # mailing list (http://www.ruby-lang.org/en/ml.html), and you can ask
+ # any questions you might have there. I monitor the list, as do many
+ # other helpful Rubyists, and you're sure to get a quick answer. Of
+ # course, you're also welcome to email me (Nathaniel Talbott) directly
+ # at mailto:testunit@talbott.ws, and I'll do my best to help you out.
+ #
+ #
+ # == Credits
+ #
+ # I'd like to thank...
+ #
+ # Matz, for a great language!
+ #
+ # Masaki Suketa, for his work on RubyUnit, which filled a vital need in
+ # the Ruby world for a very long time. I'm also grateful for his help in
+ # polishing Test::Unit and getting the RubyUnit compatibility layer
+ # right. His graciousness in allowing Test::Unit to supercede RubyUnit
+ # continues to be a challenge to me to be more willing to defer my own
+ # rights.
+ #
+ # Ken McKinlay, for his interest and work on unit testing, and for his
+ # willingness to dialog about it. He was also a great help in pointing
+ # out some of the holes in the RubyUnit compatibility layer.
+ #
+ # Dave Thomas, for the original idea that led to the extremely simple
+ # "require 'test/unit'", plus his code to improve it even more by
+ # allowing the selection of tests from the command-line. Also, without
+ # RDoc, the documentation for Test::Unit would stink a lot more than it
+ # does now.
+ #
+ # Everyone who's helped out with bug reports, feature ideas,
+ # encouragement to continue, etc. It's a real privilege to be a part of
+ # the Ruby community.
+ #
+ # The guys at RoleModel Software, for putting up with me repeating, "But
+ # this would be so much easier in Ruby!" whenever we're coding in Java.
+ #
+ # My Creator, for giving me life, and giving it more abundantly.
+ #
+ #
+ # == License
+ #
+ # Test::Unit is copyright (c) 2000-2003 Nathaniel Talbott. It is free
+ # software, and is distributed under the Ruby license. See the COPYING
+ # file in the standard Ruby distribution for details.
+ #
+ #
+ # == Warranty
+ #
+ # This software is provided "as is" and without any express or
+ # implied warranties, including, without limitation, the implied
+ # warranties of merchantibility and fitness for a particular
+ # purpose.
+ #
+ #
+ # == Author
+ #
+ # Nathaniel Talbott.
+ # Copyright (c) 2000-2003, Nathaniel Talbott
+ #
+ # ----
+ #
+ # = Usage
+ #
+ # The general idea behind unit testing is that you write a _test_
+ # _method_ that makes certain _assertions_ about your code, working
+ # against a _test_ _fixture_. A bunch of these _test_ _methods_ are
+ # bundled up into a _test_ _suite_ and can be run any time the
+ # developer wants. The results of a run are gathered in a _test_
+ # _result_ and displayed to the user through some UI. So, lets break
+ # this down and see how Test::Unit provides each of these necessary
+ # pieces.
+ #
+ #
+ # == Assertions
+ #
+ # These are the heart of the framework. Think of an assertion as a
+ # statement of expected outcome, i.e. "I assert that x should be equal
+ # to y". If, when the assertion is executed, it turns out to be
+ # correct, nothing happens, and life is good. If, on the other hand,
+ # your assertion turns out to be false, an error is propagated with
+ # pertinent information so that you can go back and make your
+ # assertion succeed, and, once again, life is good. For an explanation
+ # of the current assertions, see Test::Unit::Assertions.
+ #
+ #
+ # == Test Method & Test Fixture
+ #
+ # Obviously, these assertions have to be called within a context that
+ # knows about them and can do something meaningful with their
+ # pass/fail value. Also, it's handy to collect a bunch of related
+ # tests, each test represented by a method, into a common test class
+ # that knows how to run them. The tests will be in a separate class
+ # from the code they're testing for a couple of reasons. First of all,
+ # it allows your code to stay uncluttered with test code, making it
+ # easier to maintain. Second, it allows the tests to be stripped out
+ # for deployment, since they're really there for you, the developer,
+ # and your users don't need them. Third, and most importantly, it
+ # allows you to set up a common test fixture for your tests to run
+ # against.
+ #
+ # What's a test fixture? Well, tests do not live in a vacuum; rather,
+ # they're run against the code they are testing. Often, a collection
+ # of tests will run against a common set of data, also called a
+ # fixture. If they're all bundled into the same test class, they can
+ # all share the setting up and tearing down of that data, eliminating
+ # unnecessary duplication and making it much easier to add related
+ # tests.
+ #
+ # Test::Unit::TestCase wraps up a collection of test methods together
+ # and allows you to easily set up and tear down the same test fixture
+ # for each test. This is done by overriding #setup and/or #teardown,
+ # which will be called before and after each test method that is
+ # run. The TestCase also knows how to collect the results of your
+ # assertions into a Test::Unit::TestResult, which can then be reported
+ # back to you... but I'm getting ahead of myself. To write a test,
+ # follow these steps:
+ #
+ # * Make sure Test::Unit is in your library path.
+ # * require 'test/unit' in your test script.
+ # * Create a class that subclasses Test::Unit::TestCase.
+ # * Add a method that begins with "test" to your class.
+ # * Make assertions in your test method.
+ # * Optionally define #setup and/or #teardown to set up and/or tear
+ # down your common test fixture.
+ # * You can now run your test as you would any other Ruby
+ # script... try it and see!
+ #
+ # A really simple test might look like this (#setup and #teardown are
+ # commented out to indicate that they are completely optional):
+ #
+ # require 'test/unit'
+ #
+ # class TC_MyTest < Test::Unit::TestCase
+ # # def setup
+ # # end
+ #
+ # # def teardown
+ # # end
+ #
+ # def test_fail
+ # assert(false, 'Assertion was false.')
+ # end
+ # end
+ #
+ #
+ # == Test Runners
+ #
+ # So, now you have this great test class, but you still need a way to
+ # run it and view any failures that occur during the run. This is
+ # where Test::Unit::UI::Console::TestRunner (and others, such as
+ # Test::Unit::UI::GTK::TestRunner) comes into play. The console test
+ # runner is automatically invoked for you if you require 'test/unit'
+ # and simply run the file. To use another runner, or to manually
+ # invoke a runner, simply call its run class method and pass in an
+ # object that responds to the suite message with a
+ # Test::Unit::TestSuite. This can be as simple as passing in your
+ # TestCase class (which has a class suite method). It might look
+ # something like this:
+ #
+ # require 'test/unit/ui/console/testrunner'
+ # Test::Unit::UI::Console::TestRunner.run(TC_MyTest)
+ #
+ #
+ # == Test Suite
+ #
+ # As more and more unit tests accumulate for a given project, it
+ # becomes a real drag running them one at a time, and it also
+ # introduces the potential to overlook a failing test because you
+ # forget to run it. Suddenly it becomes very handy that the
+ # TestRunners can take any object that returns a Test::Unit::TestSuite
+ # in response to a suite method. The TestSuite can, in turn, contain
+ # other TestSuites or individual tests (typically created by a
+ # TestCase). In other words, you can easily wrap up a group of
+ # TestCases and TestSuites like this:
+ #
+ # require 'test/unit/testsuite'
+ # require 'tc_myfirsttests'
+ # require 'tc_moretestsbyme'
+ # require 'ts_anothersetoftests'
+ #
+ # class TS_MyTests
+ # def self.suite
+ # suite = Test::Unit::TestSuite.new
+ # suite << TC_MyFirstTests.suite
+ # suite << TC_MoreTestsByMe.suite
+ # suite << TS_AnotherSetOfTests.suite
+ # return suite
+ # end
+ # end
+ # Test::Unit::UI::Console::TestRunner.run(TS_MyTests)
+ #
+ # Now, this is a bit cumbersome, so Test::Unit does a little bit more
+ # for you, by wrapping these up automatically when you require
+ # 'test/unit'. What does this mean? It means you could write the above
+ # test case like this instead:
+ #
+ # require 'test/unit'
+ # require 'tc_myfirsttests'
+ # require 'tc_moretestsbyme'
+ # require 'ts_anothersetoftests'
+ #
+ # Test::Unit is smart enough to find all the test cases existing in
+ # the ObjectSpace and wrap them up into a suite for you. It then runs
+ # the dynamic suite using the console TestRunner.
+ #
+ #
+ # == Questions?
+ #
+ # I'd really like to get feedback from all levels of Ruby
+ # practitioners about typos, grammatical errors, unclear statements,
+ # missing points, etc., in this document (or any other).
+ #
- reject_pat = Regexp.union(reject.map {|r| /#{r}/ })
- files.reject! {|f| reject_pat =~ f }
-
- files.each {|f|
- d = File.dirname(File.expand_path(f))
- unless $:.include? d
- $: << d
- end
- begin
- require f
- rescue LoadError
- puts "#{f}: #{$!}"
- end
- }
+ module Unit
+ # If set to false Test::Unit will not automatically run at exit.
+ def self.run=(flag)
+ @run = flag
+ end
- ARGV.replace minitest_argv
+ # Automatically run tests at exit?
+ def self.run?
+ @run ||= false
end
end
end
-MiniTest::Unit.autorun
+at_exit do
+ unless $! || Test::Unit.run?
+ exit Test::Unit::AutoRunner.run
+ end
+end
diff --git a/lib/test/unit/assertionfailederror.rb b/lib/test/unit/assertionfailederror.rb
new file mode 100644
index 0000000000..a21e4b5870
--- /dev/null
+++ b/lib/test/unit/assertionfailederror.rb
@@ -0,0 +1,14 @@
+#--
+#
+# Author:: Nathaniel Talbott.
+# Copyright:: Copyright (c) 2000-2002 Nathaniel Talbott. All rights reserved.
+# License:: Ruby license.
+
+module Test
+ module Unit
+
+ # Thrown by Test::Unit::Assertions when an assertion fails.
+ class AssertionFailedError < StandardError
+ end
+ end
+end
diff --git a/lib/test/unit/assertions.rb b/lib/test/unit/assertions.rb
index 35348d87be..aa97799de8 100644
--- a/lib/test/unit/assertions.rb
+++ b/lib/test/unit/assertions.rb
@@ -1,137 +1,622 @@
-require 'minitest/unit'
-require 'pp'
+# Author:: Nathaniel Talbott.
+# Copyright:: Copyright (c) 2000-2003 Nathaniel Talbott. All rights reserved.
+# License:: Ruby license.
+
+require 'test/unit/assertionfailederror'
+require 'test/unit/util/backtracefilter'
module Test
module Unit
+
+ ##
+ # Test::Unit::Assertions contains the standard Test::Unit assertions.
+ # Assertions is included in Test::Unit::TestCase.
+ #
+ # To include it in your own code and use its functionality, you simply
+ # need to rescue Test::Unit::AssertionFailedError. Additionally you may
+ # override add_assertion to get notified whenever an assertion is made.
+ #
+ # Notes:
+ # * The message to each assertion, if given, will be propagated with the
+ # failure.
+ # * It is easy to add your own assertions based on assert_block().
+ #
+ # = Example Custom Assertion
+ #
+ # def deny(boolean, message = nil)
+ # message = build_message message, '<?> is not false or nil.', boolean
+ # assert_block message do
+ # not boolean
+ # end
+ # end
+
module Assertions
- include MiniTest::Assertions
- def mu_pp(obj)
- obj.pretty_inspect.chomp
+ ##
+ # The assertion upon which all other assertions are based. Passes if the
+ # block yields true.
+ #
+ # Example:
+ # assert_block "Couldn't do the thing" do
+ # do_the_thing
+ # end
+
+ public
+ def assert_block(message="assert_block failed.") # :yields:
+ _wrap_assertion do
+ if (! yield)
+ raise AssertionFailedError.new(message.to_s)
+ end
+ end
end
- def assert_raise(*args, &b)
- assert_raises(*args, &b)
+ ##
+ # Asserts that +boolean+ is not false or nil.
+ #
+ # Example:
+ # assert [1, 2].include?(5)
+
+ public
+ def assert(boolean, message=nil)
+ _wrap_assertion do
+ assert_block("assert should not be called with a block.") { !block_given? }
+ assert_block(build_message(message, "<?> is not true.", boolean)) { boolean }
+ end
end
- def assert_nothing_raised(*args)
- self._assertions += 1
- if Module === args.last
- msg = nil
- else
- msg = args.pop
- end
- begin
- line = __LINE__; yield
- rescue Exception => e
- bt = e.backtrace
- as = e.instance_of?(MiniTest::Assertion)
- if as
- ans = /\A#{Regexp.quote(__FILE__)}:#{line}:in /o
- bt.reject! {|ln| ans =~ ln}
- end
- if ((args.empty? && !as) ||
- args.any? {|a| a.instance_of?(Module) ? e.is_a?(a) : e.class == a })
- msg = message(msg) { "Exception raised:\n<#{mu_pp(e)}>" }
- raise MiniTest::Assertion, msg.call, bt
+ ##
+ # Passes if +expected+ == +actual.
+ #
+ # Note that the ordering of arguments is important, since a helpful
+ # error message is generated when this one fails that tells you the
+ # values of expected and actual.
+ #
+ # Example:
+ # assert_equal 'MY STRING', 'my string'.upcase
+
+ public
+ def assert_equal(expected, actual, message=nil)
+ full_message = build_message(message, <<EOT, expected, actual)
+<?> expected but was
+<?>.
+EOT
+ assert_block(full_message) { expected == actual }
+ end
+
+ private
+ def _check_exception_class(args) # :nodoc:
+ args.partition do |klass|
+ next if klass.instance_of?(Module)
+ assert(Exception >= klass, "Should expect a class of exception, #{klass}")
+ true
+ end
+ end
+
+ private
+ def _expected_exception?(actual_exception, exceptions, modules) # :nodoc:
+ exceptions.include?(actual_exception.class) or
+ modules.any? {|mod| actual_exception.is_a?(mod)}
+ end
+
+ ##
+ # Passes if the block raises one of the given exceptions.
+ #
+ # Example:
+ # assert_raise RuntimeError, LoadError do
+ # raise 'Boom!!!'
+ # end
+
+ public
+ def assert_raise(*args)
+ _wrap_assertion do
+ if Module === args.last
+ message = ""
else
- raise
- end
- end
- nil
- end
-
- def assert_nothing_thrown(msg=nil)
- begin
- yield
- rescue ArgumentError => error
- raise error if /\Auncaught throw (.+)\z/m !~ error.message
- msg = message(msg) { "<#{$1}> was thrown when nothing was expected" }
- flunk(msg)
- end
- assert(true, "Expected nothing to be thrown")
- end
-
- def assert_equal(exp, act, msg = nil)
- msg = message(msg) {
- exp_str = mu_pp(exp)
- act_str = mu_pp(act)
- exp_comment = ''
- act_comment = ''
- if exp_str == act_str
- if (exp.is_a?(String) && act.is_a?(String)) ||
- (exp.is_a?(Regexp) && act.is_a?(Regexp))
- exp_comment = " (#{exp.encoding})"
- act_comment = " (#{act.encoding})"
- elsif exp.is_a?(Float) && act.is_a?(Float)
- exp_str = "%\#.#{Float::DIG+2}g" % exp
- act_str = "%\#.#{Float::DIG+2}g" % act
- elsif exp.is_a?(Time) && act.is_a?(Time)
- exp_comment = " (nsec=#{exp.nsec})"
- act_comment = " (nsec=#{act.nsec})"
- elsif exp.class != act.class
- # a subclass of Range, for example.
- exp_comment = " (#{exp.class})"
- act_comment = " (#{act.class})"
+ message = args.pop
+ end
+ exceptions, modules = _check_exception_class(args)
+ expected = args.size == 1 ? args.first : args
+ actual_exception = nil
+ full_message = build_message(message, "<?> exception expected but none was thrown.", expected)
+ assert_block(full_message) do
+ begin
+ yield
+ rescue Exception => actual_exception
+ break
end
- elsif !Encoding.compatible?(exp_str, act_str)
- if exp.is_a?(String) && act.is_a?(String)
- exp_str = exp.dump
- act_str = act.dump
- exp_comment = " (#{exp.encoding})"
- act_comment = " (#{act.encoding})"
+ false
+ end
+ full_message = build_message(message, "<?> exception expected but was\n?", expected, actual_exception)
+ assert_block(full_message) {_expected_exception?(actual_exception, exceptions, modules)}
+ actual_exception
+ end
+ end
+
+ ##
+ # Alias of assert_raise.
+ #
+ # Will be deprecated in 1.9, and removed in 2.0.
+
+ public
+ def assert_raises(*args, &block)
+ assert_raise(*args, &block)
+ end
+
+ ##
+ # Passes if +object+ .instance_of? +klass+
+ #
+ # Example:
+ # assert_instance_of String, 'foo'
+
+ public
+ def assert_instance_of(klass, object, message="")
+ _wrap_assertion do
+ assert_equal(Class, klass.class, "assert_instance_of takes a Class as its first argument")
+ full_message = build_message(message, <<EOT, object, klass, object.class)
+<?> expected to be an instance of
+<?> but was
+<?>.
+EOT
+ assert_block(full_message){object.instance_of?(klass)}
+ end
+ end
+
+ ##
+ # Passes if +object+ is nil.
+ #
+ # Example:
+ # assert_nil [1, 2].uniq!
+
+ public
+ def assert_nil(object, message="")
+ assert_equal(nil, object, message)
+ end
+
+ ##
+ # Passes if +object+ .kind_of? +klass+
+ #
+ # Example:
+ # assert_kind_of Object, 'foo'
+
+ public
+ def assert_kind_of(klass, object, message="")
+ _wrap_assertion do
+ assert(klass.kind_of?(Module), "The first parameter to assert_kind_of should be a kind_of Module.")
+ full_message = build_message(message, "<?>\nexpected to be kind_of\\?\n<?> but was\n<?>.", object, klass, object.class)
+ assert_block(full_message){object.kind_of?(klass)}
+ end
+ end
+
+ ##
+ # Passes if +object+ .respond_to? +method+
+ #
+ # Example:
+ # assert_respond_to 'bugbear', :slice
+
+ public
+ def assert_respond_to(object, method, message="")
+ _wrap_assertion do
+ full_message = build_message(nil, "<?>\ngiven as the method name argument to #assert_respond_to must be a Symbol or #respond_to\\?(:to_str).", method)
+
+ assert_block(full_message) do
+ method.kind_of?(Symbol) || method.respond_to?(:to_str)
+ end
+ full_message = build_message(message, <<EOT, object, object.class, method)
+<?>
+of type <?>
+expected to respond_to\\?<?>.
+EOT
+ assert_block(full_message) { object.respond_to?(method) }
+ end
+ end
+
+ ##
+ # Passes if +string+ =~ +pattern+.
+ #
+ # Example:
+ # assert_match(/\d+/, 'five, 6, seven')
+
+ public
+ def assert_match(pattern, string, message="")
+ _wrap_assertion do
+ pattern = case(pattern)
+ when String
+ Regexp.new(Regexp.escape(pattern))
else
- exp_str = exp_str.dump
- act_str = act_str.dump
- end
+ pattern
end
- "<#{exp_str}>#{exp_comment} expected but was\n<#{act_str}>#{act_comment}"
- }
- assert(exp == act, msg)
+ full_message = build_message(message, "<?> expected to be =~\n<?>.", string, pattern)
+ assert_block(full_message) { string =~ pattern }
+ end
end
- def assert_not_nil(exp, msg=nil)
- msg = message(msg) { "<#{mu_pp(exp)}> expected to not be nil" }
- assert(!exp.nil?, msg)
+ ##
+ # Passes if +actual+ .equal? +expected+ (i.e. they are the same
+ # instance).
+ #
+ # Example:
+ # o = Object.new
+ # assert_same o, o
+
+ public
+ def assert_same(expected, actual, message="")
+ full_message = build_message(message, <<EOT, expected, expected.__id__, actual, actual.__id__)
+<?>
+with id <?> expected to be equal\\? to
+<?>
+with id <?>.
+EOT
+ assert_block(full_message) { actual.equal?(expected) }
end
- def assert_not_equal(exp, act, msg=nil)
- msg = message(msg) { "<#{mu_pp(exp)}> expected to be != to\n<#{mu_pp(act)}>" }
- assert(exp != act, msg)
+ ##
+ # Compares the +object1+ with +object2+ using +operator+.
+ #
+ # Passes if object1.__send__(operator, object2) is true.
+ #
+ # Example:
+ # assert_operator 5, :>=, 4
+
+ public
+ def assert_operator(object1, operator, object2, message="")
+ _wrap_assertion do
+ full_message = build_message(nil, "<?>\ngiven as the operator for #assert_operator must be a Symbol or #respond_to\\?(:to_str).", operator)
+ assert_block(full_message){operator.kind_of?(Symbol) || operator.respond_to?(:to_str)}
+ full_message = build_message(message, <<EOT, object1, AssertionMessage.literal(operator), object2)
+<?> expected to be
+?
+<?>.
+EOT
+ assert_block(full_message) { object1.__send__(operator, object2) }
+ end
+ end
+
+ ##
+ # Passes if block does not raise an exception.
+ #
+ # Example:
+ # assert_nothing_raised do
+ # [1, 2].uniq
+ # end
+
+ public
+ def assert_nothing_raised(*args)
+ _wrap_assertion do
+ if Module === args.last
+ message = ""
+ else
+ message = args.pop
+ end
+ exceptions, modules = _check_exception_class(args)
+ begin
+ yield
+ rescue Exception => e
+ if ((args.empty? && !e.instance_of?(AssertionFailedError)) ||
+ _expected_exception?(e, exceptions, modules))
+ assert_block(build_message(message, "Exception raised:\n?", e)){false}
+ else
+ raise
+ end
+ end
+ nil
+ end
end
- def assert_no_match(regexp, string, msg=nil)
- assert_instance_of(Regexp, regexp, "The first argument to assert_no_match should be a Regexp.")
- self._assertions -= 1
- msg = message(msg) { "<#{mu_pp(regexp)}> expected to not match\n<#{mu_pp(string)}>" }
- assert(regexp !~ string, msg)
+ ##
+ # Flunk always fails.
+ #
+ # Example:
+ # flunk 'Not done testing yet.'
+
+ public
+ def flunk(message="Flunked")
+ assert_block(build_message(message)){false}
end
+ ##
+ # Passes if ! +actual+ .equal? +expected+
+ #
+ # Example:
+ # assert_not_same Object.new, Object.new
+
+ public
def assert_not_same(expected, actual, message="")
- msg = message(msg) { build_message(message, <<EOT, expected, expected.__id__, actual, actual.__id__) }
+ full_message = build_message(message, <<EOT, expected, expected.__id__, actual, actual.__id__)
<?>
with id <?> expected to not be equal\\? to
<?>
with id <?>.
EOT
- assert(!actual.equal?(expected), msg)
+ assert_block(full_message) { !actual.equal?(expected) }
end
- # get rid of overcounting
- def assert_respond_to obj, meth, msg = nil
- super if !caller[0].rindex(MiniTest::MINI_DIR, 0) || !obj.respond_to?(meth)
+ ##
+ # Passes if +expected+ != +actual+
+ #
+ # Example:
+ # assert_not_equal 'some string', 5
+
+ public
+ def assert_not_equal(expected, actual, message="")
+ full_message = build_message(message, "<?> expected to be != to\n<?>.", expected, actual)
+ assert_block(full_message) { expected != actual }
end
- ms = instance_methods(true).map {|sym| sym.to_s }
- ms.grep(/\Arefute_/) do |m|
- mname = ('assert_not_' << m.to_s[/.*?_(.*)/, 1])
- alias_method(mname, m) unless ms.include? mname
+ ##
+ # Passes if ! +object+ .nil?
+ #
+ # Example:
+ # assert_not_nil '1 two 3'.sub!(/two/, '2')
+
+ public
+ def assert_not_nil(object, message="")
+ full_message = build_message(message, "<?> expected to not be nil.", object)
+ assert_block(full_message){!object.nil?}
end
+ ##
+ # Passes if +regexp+ !~ +string+
+ #
+ # Example:
+ # assert_no_match(/two/, 'one 2 three')
+
+ public
+ def assert_no_match(regexp, string, message="")
+ _wrap_assertion do
+ assert_instance_of(Regexp, regexp, "The first argument to assert_no_match should be a Regexp.")
+ full_message = build_message(message, "<?> expected to not match\n<?>.", regexp, string)
+ assert_block(full_message) { regexp !~ string }
+ end
+ end
+
+ UncaughtThrow = {NameError => /^uncaught throw \`(.+)\'$/,
+ ThreadError => /^uncaught throw \`(.+)\' in thread /} #`
+
+ ##
+ # Passes if the block throws +expected_symbol+
+ #
+ # Example:
+ # assert_throws :done do
+ # throw :done
+ # end
+
+ public
+ def assert_throws(expected_symbol, message="", &proc)
+ _wrap_assertion do
+ assert_instance_of(Symbol, expected_symbol, "assert_throws expects the symbol that should be thrown for its first argument")
+ assert_block("Should have passed a block to assert_throws."){block_given?}
+ caught = true
+ begin
+ catch(expected_symbol) do
+ proc.call
+ caught = false
+ end
+ full_message = build_message(message, "<?> should have been thrown.", expected_symbol)
+ assert_block(full_message){caught}
+ rescue NameError, ThreadError => error
+ if UncaughtThrow[error.class] !~ error.message
+ raise error
+ end
+ full_message = build_message(message, "<?> expected to be thrown but\n<?> was thrown.", expected_symbol, $1.intern)
+ flunk(full_message)
+ end
+ end
+ end
+
+ ##
+ # Passes if block does not throw anything.
+ #
+ # Example:
+ # assert_nothing_thrown do
+ # [1, 2].uniq
+ # end
+
+ public
+ def assert_nothing_thrown(message="", &proc)
+ _wrap_assertion do
+ assert(block_given?, "Should have passed a block to assert_nothing_thrown")
+ begin
+ proc.call
+ rescue NameError, ThreadError => error
+ if UncaughtThrow[error.class] !~ error.message
+ raise error
+ end
+ full_message = build_message(message, "<?> was thrown when nothing was expected", $1.intern)
+ flunk(full_message)
+ end
+ assert(true, "Expected nothing to be thrown")
+ end
+ end
+
+ ##
+ # Passes if +expected_float+ and +actual_float+ are equal
+ # within +delta+ tolerance.
+ #
+ # Example:
+ # assert_in_delta 0.05, (50000.0 / 10**6), 0.00001
+
+ public
+ def assert_in_delta(expected_float, actual_float, delta, message="")
+ _wrap_assertion do
+ {expected_float => "first float", actual_float => "second float", delta => "delta"}.each do |float, name|
+ assert_respond_to(float, :to_f, "The arguments must respond to to_f; the #{name} did not")
+ end
+ assert_operator(delta, :>=, 0.0, "The delta should not be negative")
+ full_message = build_message(message, <<EOT, expected_float, actual_float, delta)
+<?> and
+<?> expected to be within
+<?> of each other.
+EOT
+ assert_block(full_message) { (expected_float.to_f - actual_float.to_f).abs <= delta.to_f }
+ end
+ end
+
+ ##
+ # Passes if the method send returns a true value.
+ #
+ # +send_array+ is composed of:
+ # * A receiver
+ # * A method
+ # * Arguments to the method
+ #
+ # Example:
+ # assert_send [[1, 2], :include?, 4]
+
+ public
+ def assert_send(send_array, message="")
+ _wrap_assertion do
+ assert_instance_of(Array, send_array, "assert_send requires an array of send information")
+ assert(send_array.size >= 2, "assert_send requires at least a receiver and a message name")
+ full_message = build_message(message, <<EOT, send_array[0], AssertionMessage.literal(send_array[1].to_s), send_array[2..-1])
+<?> expected to respond to
+<?(?)> with a true value.
+EOT
+ assert_block(full_message) { send_array[0].__send__(send_array[1], *send_array[2..-1]) }
+ end
+ end
+
+ ##
+ # Builds a failure message. +head+ is added before the +template+ and
+ # +arguments+ replaces the '?'s positionally in the template.
+
+ public
def build_message(head, template=nil, *arguments)
template &&= template.chomp
- template.gsub(/\?/) { mu_pp(arguments.shift) }
+ return AssertionMessage.new(head, template, arguments)
end
+
+ private
+ def _wrap_assertion
+ @_assertion_wrapped ||= false
+ unless (@_assertion_wrapped)
+ @_assertion_wrapped = true
+ begin
+ add_assertion
+ return yield
+ ensure
+ @_assertion_wrapped = false
+ end
+ else
+ return yield
+ end
+ end
+
+ ##
+ # Called whenever an assertion is made. Define this in classes that
+ # include Test::Unit::Assertions to record assertion counts.
+
+ private
+ def add_assertion
+ end
+
+ ##
+ # Select whether or not to use the pretty-printer. If this option is set
+ # to false before any assertions are made, pp.rb will not be required.
+
+ public
+ def self.use_pp=(value)
+ AssertionMessage.use_pp = value
+ end
+
+ # :stopdoc:
+
+ class AssertionMessage
+ @use_pp = true
+ class << self
+ attr_accessor :use_pp
+ end
+
+ class Literal
+ def initialize(value)
+ @value = value
+ end
+
+ def inspect
+ @value.to_s
+ end
+ end
+
+ class Template
+ def self.create(string)
+ parts = (string ? string.scan(/(?=[^\\])\?|(?:\\\?|[^\?])+/m) : [])
+ self.new(parts)
+ end
+
+ attr_reader :count
+
+ def initialize(parts)
+ @parts = parts
+ @count = parts.find_all{|e| e == '?'}.size
+ end
+
+ def result(parameters)
+ raise "The number of parameters does not match the number of substitutions." if(parameters.size != count)
+ params = parameters.dup
+ @parts.collect{|e| e == '?' ? params.shift : e.gsub(/\\\?/m, '?')}.join('')
+ end
+ end
+
+ def self.literal(value)
+ Literal.new(value)
+ end
+
+ include Util::BacktraceFilter
+
+ def initialize(head, template_string, parameters)
+ @head = head
+ @template_string = template_string
+ @parameters = parameters
+ end
+
+ def convert(object)
+ case object
+ when Exception
+ <<EOM.chop
+Class: <#{convert(object.class)}>
+Message: <#{convert(object.message)}>
+---Backtrace---
+#{filter_backtrace(object.backtrace).join("\n")}
+---------------
+EOM
+ else
+ if(self.class.use_pp)
+ begin
+ require 'pp'
+ rescue LoadError
+ self.class.use_pp = false
+ return object.inspect
+ end unless(defined?(PP))
+ PP.pp(object, '').chomp
+ else
+ object.inspect
+ end
+ end
+ end
+
+ def template
+ @template ||= Template.create(@template_string)
+ end
+
+ def add_period(string)
+ (string =~ /\.\Z/ ? string : string + '.')
+ end
+
+ def to_s
+ message_parts = []
+ if (@head)
+ head = @head.to_s
+ unless(head.empty?)
+ message_parts << add_period(head)
+ end
+ end
+ tail = template.result(@parameters.collect{|e| convert(e)})
+ message_parts << tail unless(tail.empty?)
+ message_parts.join("\n")
+ end
+ end
+
+ # :startdoc:
+
end
end
end
diff --git a/lib/test/unit/autorunner.rb b/lib/test/unit/autorunner.rb
new file mode 100644
index 0000000000..86c9b12940
--- /dev/null
+++ b/lib/test/unit/autorunner.rb
@@ -0,0 +1,220 @@
+require 'test/unit'
+require 'test/unit/ui/testrunnerutilities'
+require 'optparse'
+
+module Test
+ module Unit
+ class AutoRunner
+ def self.run(force_standalone=false, default_dir=nil, argv=ARGV, &block)
+ r = new(force_standalone || standalone?, &block)
+ r.base = default_dir
+ r.process_args(argv)
+ r.run
+ end
+
+ def self.standalone?
+ return false unless("-e" == $0)
+ ObjectSpace.each_object(Class) do |klass|
+ return false if(klass < TestCase)
+ end
+ true
+ end
+
+ RUNNERS = {
+ :console => proc do |r|
+ require 'test/unit/ui/console/testrunner'
+ Test::Unit::UI::Console::TestRunner
+ end,
+ :gtk => proc do |r|
+ require 'test/unit/ui/gtk/testrunner'
+ Test::Unit::UI::GTK::TestRunner
+ end,
+ :gtk2 => proc do |r|
+ require 'test/unit/ui/gtk2/testrunner'
+ Test::Unit::UI::GTK2::TestRunner
+ end,
+ :fox => proc do |r|
+ require 'test/unit/ui/fox/testrunner'
+ Test::Unit::UI::Fox::TestRunner
+ end,
+ :tk => proc do |r|
+ require 'test/unit/ui/tk/testrunner'
+ Test::Unit::UI::Tk::TestRunner
+ end,
+ }
+
+ OUTPUT_LEVELS = [
+ [:silent, UI::SILENT],
+ [:progress, UI::PROGRESS_ONLY],
+ [:normal, UI::NORMAL],
+ [:verbose, UI::VERBOSE],
+ ]
+
+ COLLECTORS = {
+ :objectspace => proc do |r|
+ require 'test/unit/collector/objectspace'
+ c = Collector::ObjectSpace.new
+ c.filter = r.filters
+ c.collect($0.sub(/\.rb\Z/, ''))
+ end,
+ :dir => proc do |r|
+ require 'test/unit/collector/dir'
+ c = Collector::Dir.new
+ c.filter = r.filters
+ c.pattern.concat(r.pattern) if(r.pattern)
+ c.exclude.concat(r.exclude) if(r.exclude)
+ c.base = r.base
+ $:.push(r.base) if r.base
+ c.collect(*(r.to_run.empty? ? ['.'] : r.to_run))
+ end,
+ }
+
+ attr_reader :suite
+ attr_accessor :output_level, :filters, :to_run, :pattern, :exclude, :base, :workdir
+ attr_writer :runner, :collector
+
+ def initialize(standalone)
+ Unit.run = true
+ @standalone = standalone
+ @runner = RUNNERS[:console]
+ @collector = COLLECTORS[(standalone ? :dir : :objectspace)]
+ @filters = []
+ @to_run = []
+ @output_level = UI::NORMAL
+ @workdir = nil
+ yield(self) if(block_given?)
+ end
+
+ def process_args(args = ARGV)
+ begin
+ options.order!(args) {|arg| @to_run << arg}
+ rescue OptionParser::ParseError => e
+ puts e
+ puts options
+ $! = nil
+ abort
+ else
+ @filters << proc{false} unless(@filters.empty?)
+ end
+ not @to_run.empty?
+ end
+
+ def options
+ @options ||= OptionParser.new do |o|
+ o.banner = "Test::Unit automatic runner."
+ o.banner << "\nUsage: #{$0} [options] [-- untouched arguments]"
+
+ o.on
+ o.on('-r', '--runner=RUNNER', RUNNERS,
+ "Use the given RUNNER.",
+ "(" + keyword_display(RUNNERS) + ")") do |r|
+ @runner = r
+ end
+
+ if(@standalone)
+ o.on('-b', '--basedir=DIR', "Base directory of test suites.") do |b|
+ @base = b
+ end
+
+ o.on('-w', '--workdir=DIR', "Working directory to run tests.") do |w|
+ @workdir = w
+ end
+
+ o.on('-a', '--add=TORUN', Array,
+ "Add TORUN to the list of things to run;",
+ "can be a file or a directory.") do |a|
+ @to_run.concat(a)
+ end
+
+ @pattern = []
+ o.on('-p', '--pattern=PATTERN', Regexp,
+ "Match files to collect against PATTERN.") do |e|
+ @pattern << e
+ end
+
+ @exclude = []
+ o.on('-x', '--exclude=PATTERN', Regexp,
+ "Ignore files to collect against PATTERN.") do |e|
+ @exclude << e
+ end
+ end
+
+ o.on('-n', '--name=NAME', String,
+ "Runs tests matching NAME.",
+ "(patterns may be used).") do |n|
+ n = (%r{\A/(.*)/\Z} =~ n ? Regexp.new($1) : n)
+ case n
+ when Regexp
+ @filters << proc{|t| n =~ t.method_name ? true : nil}
+ else
+ @filters << proc{|t| n == t.method_name ? true : nil}
+ end
+ end
+
+ o.on('-t', '--testcase=TESTCASE', String,
+ "Runs tests in TestCases matching TESTCASE.",
+ "(patterns may be used).") do |n|
+ n = (%r{\A/(.*)/\Z} =~ n ? Regexp.new($1) : n)
+ case n
+ when Regexp
+ @filters << proc{|t| n =~ t.class.name ? true : nil}
+ else
+ @filters << proc{|t| n == t.class.name ? true : nil}
+ end
+ end
+
+ o.on('-I', "--load-path=DIR[#{File::PATH_SEPARATOR}DIR...]",
+ "Appends directory list to $LOAD_PATH.") do |dirs|
+ $LOAD_PATH.concat(dirs.split(File::PATH_SEPARATOR))
+ end
+
+ o.on('-v', '--verbose=[LEVEL]', OUTPUT_LEVELS,
+ "Set the output level (default is verbose).",
+ "(" + keyword_display(OUTPUT_LEVELS) + ")") do |l|
+ @output_level = l || UI::VERBOSE
+ end
+
+ o.on('--',
+ "Stop processing options so that the",
+ "remaining options will be passed to the",
+ "test."){o.terminate}
+
+ o.on('-h', '--help', 'Display this help.'){puts o; exit}
+
+ o.on_tail
+ o.on_tail('Deprecated options:')
+
+ o.on_tail('--console', 'Console runner (use --runner).') do
+ warn("Deprecated option (--console).")
+ @runner = RUNNERS[:console]
+ end
+
+ o.on_tail('--gtk', 'GTK runner (use --runner).') do
+ warn("Deprecated option (--gtk).")
+ @runner = RUNNERS[:gtk]
+ end
+
+ o.on_tail('--fox', 'Fox runner (use --runner).') do
+ warn("Deprecated option (--fox).")
+ @runner = RUNNERS[:fox]
+ end
+
+ o.on_tail
+ end
+ end
+
+ def keyword_display(array)
+ list = array.collect {|e, *| e.to_s}
+ Array === array or list.sort!
+ list.collect {|e| e.sub(/^(.)([A-Za-z]+)(?=\w*$)/, '\\1[\\2]')}.join(", ")
+ end
+
+ def run
+ @suite = @collector[self]
+ result = @runner[self] or return false
+ Dir.chdir(@workdir) if @workdir
+ result.run(@suite, @output_level).passed?
+ end
+ end
+ end
+end
diff --git a/lib/test/unit/collector.rb b/lib/test/unit/collector.rb
new file mode 100644
index 0000000000..9e9e654147
--- /dev/null
+++ b/lib/test/unit/collector.rb
@@ -0,0 +1,43 @@
+module Test
+ module Unit
+ module Collector
+ def initialize
+ @filters = []
+ end
+
+ def filter=(filters)
+ @filters = case(filters)
+ when Proc
+ [filters]
+ when Array
+ filters
+ end
+ end
+
+ def add_suite(destination, suite)
+ to_delete = suite.tests.find_all{|t| !include?(t)}
+ to_delete.each{|t| suite.delete(t)}
+ destination << suite unless(suite.size == 0)
+ end
+
+ def include?(test)
+ return true if(@filters.empty?)
+ @filters.each do |filter|
+ result = filter[test]
+ if(result.nil?)
+ next
+ elsif(!result)
+ return false
+ else
+ return true
+ end
+ end
+ true
+ end
+
+ def sort(suites)
+ suites.sort_by{|s| s.name}
+ end
+ end
+ end
+end
diff --git a/lib/test/unit/collector/dir.rb b/lib/test/unit/collector/dir.rb
new file mode 100644
index 0000000000..97c8d28481
--- /dev/null
+++ b/lib/test/unit/collector/dir.rb
@@ -0,0 +1,107 @@
+require 'test/unit/testsuite'
+require 'test/unit/collector'
+
+module Test
+ module Unit
+ module Collector
+ class Dir
+ include Collector
+
+ attr_reader :pattern, :exclude
+ attr_accessor :base
+
+ def initialize(dir=::Dir, file=::File, object_space=::ObjectSpace, req=nil)
+ super()
+ @dir = dir
+ @file = file
+ @object_space = object_space
+ @req = req
+ @pattern = [/\btest_.*\.rb\Z/m]
+ @exclude = []
+ end
+
+ def collect(*from)
+ basedir = @base
+ $:.push(basedir) if basedir
+ if(from.empty?)
+ recursive_collect('.', find_test_cases)
+ elsif(from.size == 1)
+ recursive_collect(from.first, find_test_cases)
+ else
+ suites = []
+ from.each do |f|
+ suite = recursive_collect(f, find_test_cases)
+ suites << suite unless(suite.tests.empty?)
+ end
+ suite = TestSuite.new("[#{from.join(', ')}]")
+ sort(suites).each{|s| suite << s}
+ suite
+ end
+ ensure
+ $:.delete_at($:.rindex(basedir)) if basedir
+ end
+
+ def find_test_cases(ignore=[])
+ cases = []
+ @object_space.each_object(Class) do |c|
+ cases << c if(c < TestCase && !ignore.include?(c))
+ end
+ ignore.concat(cases)
+ cases
+ end
+
+ def recursive_collect(name, already_gathered)
+ sub_suites = []
+ path = realdir(name)
+ if @file.directory?(path)
+ dir_name = name unless name == '.'
+ @dir.entries(path).each do |e|
+ next if(e == '.' || e == '..')
+ e_name = dir_name ? @file.join(dir_name, e) : e
+ if @file.directory?(realdir(e_name))
+ next if /\ACVS\z/ =~ e
+ sub_suite = recursive_collect(e_name, already_gathered)
+ sub_suites << sub_suite unless(sub_suite.empty?)
+ else
+ next if /~\z/ =~ e_name or /\A\.\#/ =~ e
+ if @pattern and !@pattern.empty?
+ next unless @pattern.any? {|pat| pat =~ e_name}
+ end
+ if @exclude and !@exclude.empty?
+ next if @exclude.any? {|pat| pat =~ e_name}
+ end
+ collect_file(e_name, sub_suites, already_gathered)
+ end
+ end
+ else
+ collect_file(name, sub_suites, already_gathered)
+ end
+ suite = TestSuite.new(@file.basename(name))
+ sort(sub_suites).each{|s| suite << s}
+ suite
+ end
+
+ def collect_file(name, suites, already_gathered)
+ dir = @file.dirname(@file.expand_path(name, @base))
+ $:.unshift(dir)
+ if(@req)
+ @req.require(name)
+ else
+ require(name)
+ end
+ find_test_cases(already_gathered).each{|t| add_suite(suites, t.suite)}
+ ensure
+ $:.delete_at($:.rindex(dir)) if(dir)
+ end
+
+ def realdir(path)
+ if @base
+ @file.join(@base, path)
+ else
+ path
+ end
+ end
+ end
+ end
+ end
+end
diff --git a/lib/test/unit/collector/objectspace.rb b/lib/test/unit/collector/objectspace.rb
new file mode 100644
index 0000000000..d1127a981f
--- /dev/null
+++ b/lib/test/unit/collector/objectspace.rb
@@ -0,0 +1,34 @@
+# Author:: Nathaniel Talbott.
+# Copyright:: Copyright (c) 2000-2003 Nathaniel Talbott. All rights reserved.
+# License:: Ruby license.
+
+require 'test/unit/collector'
+
+module Test
+ module Unit
+ module Collector
+ class ObjectSpace
+ include Collector
+
+ NAME = 'collected from the ObjectSpace'
+
+ def initialize(source=::ObjectSpace)
+ super()
+ @source = source
+ end
+
+ def collect(name=NAME)
+ suite = TestSuite.new(name)
+ sub_suites = []
+ @source.each_object(Class) do |klass|
+ if(Test::Unit::TestCase > klass)
+ add_suite(sub_suites, klass.suite)
+ end
+ end
+ sort(sub_suites).each{|s| suite << s}
+ suite
+ end
+ end
+ end
+ end
+end
diff --git a/lib/test/unit/error.rb b/lib/test/unit/error.rb
new file mode 100644
index 0000000000..43a813f7d1
--- /dev/null
+++ b/lib/test/unit/error.rb
@@ -0,0 +1,56 @@
+#--
+#
+# Author:: Nathaniel Talbott.
+# Copyright:: Copyright (c) 2000-2002 Nathaniel Talbott. All rights reserved.
+# License:: Ruby license.
+
+require 'test/unit/util/backtracefilter'
+
+module Test
+ module Unit
+
+ # Encapsulates an error in a test. Created by
+ # Test::Unit::TestCase when it rescues an exception thrown
+ # during the processing of a test.
+ class Error
+ include Util::BacktraceFilter
+
+ attr_reader(:test_name, :exception)
+
+ SINGLE_CHARACTER = 'E'
+
+ # Creates a new Error with the given test_name and
+ # exception.
+ def initialize(test_name, exception)
+ @test_name = test_name
+ @exception = exception
+ end
+
+ # Returns a single character representation of an error.
+ def single_character_display
+ SINGLE_CHARACTER
+ end
+
+ # Returns the message associated with the error.
+ def message
+ "#{@exception.class.name}: #{@exception.message}"
+ end
+
+ # Returns a brief version of the error description.
+ def short_display
+ "#@test_name: #{message.split("\n")[0]}"
+ end
+
+ # Returns a verbose version of the error description.
+ def long_display
+ backtrace = filter_backtrace(@exception.backtrace).join("\n ")
+ "Error:\n#@test_name:\n#{message}\n #{backtrace}"
+ end
+
+ # Overridden to return long_display.
+ def to_s
+ long_display
+ end
+ end
+ end
+end
diff --git a/lib/test/unit/failure.rb b/lib/test/unit/failure.rb
new file mode 100644
index 0000000000..832c99857c
--- /dev/null
+++ b/lib/test/unit/failure.rb
@@ -0,0 +1,51 @@
+#--
+#
+# Author:: Nathaniel Talbott.
+# Copyright:: Copyright (c) 2000-2002 Nathaniel Talbott. All rights reserved.
+# License:: Ruby license.
+
+module Test
+ module Unit
+
+ # Encapsulates a test failure. Created by Test::Unit::TestCase
+ # when an assertion fails.
+ class Failure
+ attr_reader :test_name, :location, :message
+
+ SINGLE_CHARACTER = 'F'
+
+ # Creates a new Failure with the given location and
+ # message.
+ def initialize(test_name, location, message)
+ @test_name = test_name
+ @location = location
+ @message = message
+ end
+
+ # Returns a single character representation of a failure.
+ def single_character_display
+ SINGLE_CHARACTER
+ end
+
+ # Returns a brief version of the error description.
+ def short_display
+ "#@test_name: #{@message.split("\n")[0]}"
+ end
+
+ # Returns a verbose version of the error description.
+ def long_display
+ location_display = if(location.size == 1)
+ location[0].sub(/\A(.+:\d+).*/, ' [\\1]')
+ else
+ "\n [#{location.join("\n ")}]"
+ end
+ "Failure:\n#@test_name#{location_display}:\n#@message"
+ end
+
+ # Overridden to return long_display.
+ def to_s
+ long_display
+ end
+ end
+ end
+end
diff --git a/lib/test/unit/testcase.rb b/lib/test/unit/testcase.rb
index 89aa0f34c0..f53b460c5d 100644
--- a/lib/test/unit/testcase.rb
+++ b/lib/test/unit/testcase.rb
@@ -1,11 +1,159 @@
+#--
+#
+# Author:: Nathaniel Talbott.
+# Copyright:: Copyright (c) 2000-2003 Nathaniel Talbott. All rights reserved.
+# License:: Ruby license.
+
require 'test/unit/assertions'
+require 'test/unit/failure'
+require 'test/unit/error'
+require 'test/unit/testsuite'
+require 'test/unit/assertionfailederror'
+require 'test/unit/util/backtracefilter'
module Test
module Unit
- class TestCase < MiniTest::Unit::TestCase
+
+ # Ties everything together. If you subclass and add your own
+ # test methods, it takes care of making them into tests and
+ # wrapping those tests into a suite. It also does the
+ # nitty-gritty of actually running an individual test and
+ # collecting its results into a Test::Unit::TestResult object.
+ class TestCase
include Assertions
- def self.test_order
- :sorted
+ include Util::BacktraceFilter
+
+ attr_reader :method_name
+
+ STARTED = name + "::STARTED"
+ FINISHED = name + "::FINISHED"
+
+ ##
+ # These exceptions are not caught by #run.
+
+ PASSTHROUGH_EXCEPTIONS = [NoMemoryError, SignalException, Interrupt,
+ SystemExit]
+
+ # Creates a new instance of the fixture for running the
+ # test represented by test_method_name.
+ def initialize(test_method_name)
+ unless(respond_to?(test_method_name) and
+ (method(test_method_name).arity == 0 ||
+ method(test_method_name).arity == -1))
+ throw :invalid_test
+ end
+ @method_name = test_method_name
+ @test_passed = true
+ end
+
+ # Rolls up all of the test* methods in the fixture into
+ # one suite, creating a new instance of the fixture for
+ # each method.
+ def self.suite
+ method_names = public_instance_methods(true)
+ tests = method_names.delete_if {|method_name| method_name !~ /^test./}
+ suite = TestSuite.new(name)
+ tests.sort.each do
+ |test|
+ catch(:invalid_test) do
+ suite << new(test)
+ end
+ end
+ if (suite.empty?)
+ catch(:invalid_test) do
+ suite << new("default_test")
+ end
+ end
+ return suite
+ end
+
+ # Runs the individual test method represented by this
+ # instance of the fixture, collecting statistics, failures
+ # and errors in result.
+ def run(result)
+ yield(STARTED, name)
+ @_result = result
+ begin
+ setup
+ __send__(@method_name)
+ rescue AssertionFailedError => e
+ add_failure(e.message, e.backtrace)
+ rescue Exception
+ raise if PASSTHROUGH_EXCEPTIONS.include? $!.class
+ add_error($!)
+ ensure
+ begin
+ teardown
+ rescue AssertionFailedError => e
+ add_failure(e.message, e.backtrace)
+ rescue Exception
+ raise if PASSTHROUGH_EXCEPTIONS.include? $!.class
+ add_error($!)
+ end
+ end
+ result.add_run
+ yield(FINISHED, name)
+ end
+
+ # Called before every test method runs. Can be used
+ # to set up fixture information.
+ def setup
+ end
+
+ # Called after every test method runs. Can be used to tear
+ # down fixture information.
+ def teardown
+ end
+
+ def default_test
+ flunk("No tests were specified")
+ end
+
+ # Returns whether this individual test passed or
+ # not. Primarily for use in teardown so that artifacts
+ # can be left behind if the test fails.
+ def passed?
+ return @test_passed
+ end
+ private :passed?
+
+ def size
+ 1
+ end
+
+ def add_assertion
+ @_result.add_assertion
+ end
+ private :add_assertion
+
+ def add_failure(message, all_locations=caller())
+ @test_passed = false
+ @_result.add_failure(Failure.new(name, filter_backtrace(all_locations), message))
+ end
+ private :add_failure
+
+ def add_error(exception)
+ @test_passed = false
+ @_result.add_error(Error.new(name, exception))
+ end
+ private :add_error
+
+ # Returns a human-readable name for the specific test that
+ # this instance of TestCase represents.
+ def name
+ "#{@method_name}(#{self.class.name})"
+ end
+
+ # Overridden to return #name.
+ def to_s
+ name
+ end
+
+ # It's handy to be able to compare TestCase instances.
+ def ==(other)
+ return false unless(other.kind_of?(self.class))
+ return false unless(@method_name == other.method_name)
+ self.class == other.class
end
end
end
diff --git a/lib/test/unit/testresult.rb b/lib/test/unit/testresult.rb
new file mode 100644
index 0000000000..e3a472ef7f
--- /dev/null
+++ b/lib/test/unit/testresult.rb
@@ -0,0 +1,80 @@
+#--
+# Author:: Nathaniel Talbott.
+# Copyright:: Copyright (c) 2000-2002 Nathaniel Talbott. All rights reserved.
+# License:: Ruby license.
+
+require 'test/unit/util/observable'
+
+module Test
+ module Unit
+
+ # Collects Test::Unit::Failure and Test::Unit::Error so that
+ # they can be displayed to the user. To this end, observers
+ # can be added to it, allowing the dynamic updating of, say, a
+ # UI.
+ class TestResult
+ include Util::Observable
+
+ CHANGED = "CHANGED"
+ FAULT = "FAULT"
+
+ attr_reader(:run_count, :assertion_count)
+
+ # Constructs a new, empty TestResult.
+ def initialize
+ @run_count, @assertion_count = 0, 0
+ @failures, @errors = Array.new, Array.new
+ end
+
+ # Records a test run.
+ def add_run
+ @run_count += 1
+ notify_listeners(CHANGED, self)
+ end
+
+ # Records a Test::Unit::Failure.
+ def add_failure(failure)
+ @failures << failure
+ notify_listeners(FAULT, failure)
+ notify_listeners(CHANGED, self)
+ end
+
+ # Records a Test::Unit::Error.
+ def add_error(error)
+ @errors << error
+ notify_listeners(FAULT, error)
+ notify_listeners(CHANGED, self)
+ end
+
+ # Records an individual assertion.
+ def add_assertion
+ @assertion_count += 1
+ notify_listeners(CHANGED, self)
+ end
+
+ # Returns a string contain the recorded runs, assertions,
+ # failures and errors in this TestResult.
+ def to_s
+ "#{run_count} tests, #{assertion_count} assertions, #{failure_count} failures, #{error_count} errors"
+ end
+
+ # Returns whether or not this TestResult represents
+ # successful completion.
+ def passed?
+ return @failures.empty? && @errors.empty?
+ end
+
+ # Returns the number of failures this TestResult has
+ # recorded.
+ def failure_count
+ return @failures.size
+ end
+
+ # Returns the number of errors this TestResult has
+ # recorded.
+ def error_count
+ return @errors.size
+ end
+ end
+ end
+end
diff --git a/lib/test/unit/testsuite.rb b/lib/test/unit/testsuite.rb
new file mode 100644
index 0000000000..6fea976c50
--- /dev/null
+++ b/lib/test/unit/testsuite.rb
@@ -0,0 +1,76 @@
+#--
+#
+# Author:: Nathaniel Talbott.
+# Copyright:: Copyright (c) 2000-2003 Nathaniel Talbott. All rights reserved.
+# License:: Ruby license.
+
+module Test
+ module Unit
+
+ # A collection of tests which can be #run.
+ #
+ # Note: It is easy to confuse a TestSuite instance with
+ # something that has a static suite method; I know because _I_
+ # have trouble keeping them straight. Think of something that
+ # has a suite method as simply providing a way to get a
+ # meaningful TestSuite instance.
+ class TestSuite
+ attr_reader :name, :tests
+
+ STARTED = name + "::STARTED"
+ FINISHED = name + "::FINISHED"
+
+ # Creates a new TestSuite with the given name.
+ def initialize(name="Unnamed TestSuite")
+ @name = name
+ @tests = []
+ end
+
+ # Runs the tests and/or suites contained in this
+ # TestSuite.
+ def run(result, &progress_block)
+ yield(STARTED, name)
+ @tests.each do |test|
+ test.run(result, &progress_block)
+ end
+ yield(FINISHED, name)
+ end
+
+ # Adds the test to the suite.
+ def <<(test)
+ @tests << test
+ self
+ end
+
+ def delete(test)
+ @tests.delete(test)
+ end
+
+ # Retuns the rolled up number of tests in this suite;
+ # i.e. if the suite contains other suites, it counts the
+ # tests within those suites, not the suites themselves.
+ def size
+ total_size = 0
+ @tests.each { |test| total_size += test.size }
+ total_size
+ end
+
+ def empty?
+ tests.empty?
+ end
+
+ # Overridden to return the name given the suite at
+ # creation.
+ def to_s
+ @name
+ end
+
+ # It's handy to be able to compare TestSuite instances.
+ def ==(other)
+ return false unless(other.kind_of?(self.class))
+ return false unless(@name == other.name)
+ @tests == other.tests
+ end
+ end
+ end
+end
diff --git a/lib/test/unit/ui/console/testrunner.rb b/lib/test/unit/ui/console/testrunner.rb
new file mode 100644
index 0000000000..6b600e319a
--- /dev/null
+++ b/lib/test/unit/ui/console/testrunner.rb
@@ -0,0 +1,127 @@
+#--
+#
+# Author:: Nathaniel Talbott.
+# Copyright:: Copyright (c) 2000-2003 Nathaniel Talbott. All rights reserved.
+# License:: Ruby license.
+
+require 'test/unit/ui/testrunnermediator'
+require 'test/unit/ui/testrunnerutilities'
+
+module Test
+ module Unit
+ module UI
+ module Console
+
+ # Runs a Test::Unit::TestSuite on the console.
+ class TestRunner
+ extend TestRunnerUtilities
+
+ # Creates a new TestRunner for running the passed
+ # suite. If quiet_mode is true, the output while
+ # running is limited to progress dots, errors and
+ # failures, and the final result. io specifies
+ # where runner output should go to; defaults to
+ # STDOUT.
+ def initialize(suite, output_level=NORMAL, io=STDOUT)
+ if (suite.respond_to?(:suite))
+ @suite = suite.suite
+ else
+ @suite = suite
+ end
+ @output_level = output_level
+ @io = io
+ @already_outputted = false
+ @faults = []
+ end
+
+ # Begins the test run.
+ def start
+ setup_mediator
+ attach_to_mediator
+ return start_mediator
+ end
+
+ private
+ def setup_mediator
+ @mediator = create_mediator(@suite)
+ suite_name = @suite.to_s
+ if ( @suite.kind_of?(Module) )
+ suite_name = @suite.name
+ end
+ output("Loaded suite #{suite_name}")
+ end
+
+ def create_mediator(suite)
+ return TestRunnerMediator.new(suite)
+ end
+
+ def attach_to_mediator
+ @mediator.add_listener(TestResult::FAULT, &method(:add_fault))
+ @mediator.add_listener(TestRunnerMediator::STARTED, &method(:started))
+ @mediator.add_listener(TestRunnerMediator::FINISHED, &method(:finished))
+ @mediator.add_listener(TestCase::STARTED, &method(:test_started))
+ @mediator.add_listener(TestCase::FINISHED, &method(:test_finished))
+ end
+
+ def start_mediator
+ return @mediator.run_suite
+ end
+
+ def add_fault(fault)
+ @faults << fault
+ output_single(fault.single_character_display, PROGRESS_ONLY)
+ @already_outputted = true
+ end
+
+ def started(result)
+ @result = result
+ output("Started")
+ end
+
+ def finished(elapsed_time)
+ nl
+ output("Finished in #{elapsed_time} seconds.")
+ @faults.each_with_index do |fault, index|
+ nl
+ output("%3d) %s" % [index + 1, fault.long_display])
+ end
+ nl
+ output(@result)
+ end
+
+ def test_started(name)
+ output_single(name + ": ", VERBOSE)
+ end
+
+ def test_finished(name)
+ output_single(".", PROGRESS_ONLY) unless (@already_outputted)
+ nl(VERBOSE)
+ @already_outputted = false
+ end
+
+ def nl(level=NORMAL)
+ output("", level)
+ end
+
+ def output(something, level=NORMAL)
+ @io.puts(something) if (output?(level))
+ @io.flush
+ end
+
+ def output_single(something, level=NORMAL)
+ @io.write(something) if (output?(level))
+ @io.flush
+ end
+
+ def output?(level)
+ level <= @output_level
+ end
+ end
+ end
+ end
+ end
+end
+
+if __FILE__ == $0
+ Test::Unit::UI::Console::TestRunner.start_command_line_test
+end
diff --git a/lib/test/unit/ui/fox/testrunner.rb b/lib/test/unit/ui/fox/testrunner.rb
new file mode 100644
index 0000000000..a23a450567
--- /dev/null
+++ b/lib/test/unit/ui/fox/testrunner.rb
@@ -0,0 +1,268 @@
+#--
+#
+# Author:: Nathaniel Talbott.
+# Copyright:: Copyright (c) 2000-2002 Nathaniel Talbott. All rights reserved.
+# License:: Ruby license.
+
+require 'fox'
+require 'test/unit/ui/testrunnermediator'
+require 'test/unit/ui/testrunnerutilities'
+
+include Fox
+
+module Test
+ module Unit
+ module UI
+ module Fox
+
+ # Runs a Test::Unit::TestSuite in a Fox UI. Obviously,
+ # this one requires you to have Fox
+ # (http://www.fox-toolkit.org/fox.html) and the Ruby
+ # Fox extension (http://fxruby.sourceforge.net/)
+ # installed.
+ class TestRunner
+
+ extend TestRunnerUtilities
+
+ RED_STYLE = FXRGBA(0xFF,0,0,0xFF) #0xFF000000
+ GREEN_STYLE = FXRGBA(0,0xFF,0,0xFF) #0x00FF0000
+
+ # Creates a new TestRunner for running the passed
+ # suite.
+ def initialize(suite, output_level = NORMAL)
+ if (suite.respond_to?(:suite))
+ @suite = suite.suite
+ else
+ @suite = suite
+ end
+
+ @result = nil
+ @red = false
+ end
+
+ # Begins the test run.
+ def start
+ setup_ui
+ setup_mediator
+ attach_to_mediator
+ start_ui
+ @result
+ end
+
+ def setup_mediator
+ @mediator = TestRunnerMediator.new(@suite)
+ suite_name = @suite.to_s
+ if ( @suite.kind_of?(Module) )
+ suite_name = @suite.name
+ end
+ @suite_name_entry.text = suite_name
+ end
+
+ def attach_to_mediator
+ @mediator.add_listener(TestRunnerMediator::RESET, &method(:reset_ui))
+ @mediator.add_listener(TestResult::FAULT, &method(:add_fault))
+ @mediator.add_listener(TestResult::CHANGED, &method(:result_changed))
+ @mediator.add_listener(TestRunnerMediator::STARTED, &method(:started))
+ @mediator.add_listener(TestCase::STARTED, &method(:test_started))
+ @mediator.add_listener(TestRunnerMediator::FINISHED, &method(:finished))
+ end
+
+ def start_ui
+ @application.create
+ @window.show(PLACEMENT_SCREEN)
+ @application.addTimeout(1) do
+ @mediator.run_suite
+ end
+ @application.run
+ end
+
+ def stop
+ @application.exit(0)
+ end
+
+ def reset_ui(count)
+ @test_progress_bar.barColor = GREEN_STYLE
+ @test_progress_bar.total = count
+ @test_progress_bar.progress = 0
+ @red = false
+
+ @test_count_label.text = "0"
+ @assertion_count_label.text = "0"
+ @failure_count_label.text = "0"
+ @error_count_label.text = "0"
+
+ @fault_list.clearItems
+ end
+
+ def add_fault(fault)
+ if ( ! @red )
+ @test_progress_bar.barColor = RED_STYLE
+ @red = true
+ end
+ item = FaultListItem.new(fault)
+ @fault_list.appendItem(item)
+ end
+
+ def show_fault(fault)
+ raw_show_fault(fault.long_display)
+ end
+
+ def raw_show_fault(string)
+ @detail_text.setText(string)
+ end
+
+ def clear_fault
+ raw_show_fault("")
+ end
+
+ def result_changed(result)
+ @test_progress_bar.progress = result.run_count
+
+ @test_count_label.text = result.run_count.to_s
+ @assertion_count_label.text = result.assertion_count.to_s
+ @failure_count_label.text = result.failure_count.to_s
+ @error_count_label.text = result.error_count.to_s
+
+ # repaint now!
+ @info_panel.repaint
+ @application.flush
+ end
+
+ def started(result)
+ @result = result
+ output_status("Started...")
+ end
+
+ def test_started(test_name)
+ output_status("Running #{test_name}...")
+ end
+
+ def finished(elapsed_time)
+ output_status("Finished in #{elapsed_time} seconds")
+ end
+
+ def output_status(string)
+ @status_entry.text = string
+ @status_entry.repaint
+ end
+
+ def setup_ui
+ @application = create_application
+ create_tooltip(@application)
+
+ @window = create_window(@application)
+
+ @status_entry = create_entry(@window)
+
+ main_panel = create_main_panel(@window)
+
+ suite_panel = create_suite_panel(main_panel)
+ create_label(suite_panel, "Suite:")
+ @suite_name_entry = create_entry(suite_panel)
+ create_button(suite_panel, "&Run\tRun the current suite", proc { @mediator.run_suite })
+
+ @test_progress_bar = create_progress_bar(main_panel)
+
+ @info_panel = create_info_panel(main_panel)
+ create_label(@info_panel, "Tests:")
+ @test_count_label = create_label(@info_panel, "0")
+ create_label(@info_panel, "Assertions:")
+ @assertion_count_label = create_label(@info_panel, "0")
+ create_label(@info_panel, "Failures:")
+ @failure_count_label = create_label(@info_panel, "0")
+ create_label(@info_panel, "Errors:")
+ @error_count_label = create_label(@info_panel, "0")
+
+ list_panel = create_list_panel(main_panel)
+ @fault_list = create_fault_list(list_panel)
+
+ detail_panel = create_detail_panel(main_panel)
+ @detail_text = create_text(detail_panel)
+ end
+
+ def create_application
+ app = FXApp.new("TestRunner", "Test::Unit")
+ app.init([])
+ app
+ end
+
+ def create_window(app)
+ FXMainWindow.new(app, "Test::Unit TestRunner", nil, nil, DECOR_ALL, 0, 0, 450)
+ end
+
+ def create_tooltip(app)
+ FXTooltip.new(app)
+ end
+
+ def create_main_panel(parent)
+ panel = FXVerticalFrame.new(parent, LAYOUT_FILL_X | LAYOUT_FILL_Y)
+ panel.vSpacing = 10
+ panel
+ end
+
+ def create_suite_panel(parent)
+ FXHorizontalFrame.new(parent, LAYOUT_SIDE_LEFT | LAYOUT_FILL_X)
+ end
+
+ def create_button(parent, text, action)
+ FXButton.new(parent, text).connect(SEL_COMMAND, &action)
+ end
+
+ def create_progress_bar(parent)
+ FXProgressBar.new(parent, nil, 0, PROGRESSBAR_NORMAL | LAYOUT_FILL_X)
+ end
+
+ def create_info_panel(parent)
+ FXMatrix.new(parent, 1, MATRIX_BY_ROWS | LAYOUT_FILL_X)
+ end
+
+ def create_label(parent, text)
+ FXLabel.new(parent, text, nil, JUSTIFY_CENTER_X | LAYOUT_FILL_COLUMN)
+ end
+
+ def create_list_panel(parent)
+ FXHorizontalFrame.new(parent, LAYOUT_FILL_X | FRAME_SUNKEN | FRAME_THICK)
+ end
+
+ def create_fault_list(parent)
+ list = FXList.new(parent, 10, nil, 0, LIST_SINGLESELECT | LAYOUT_FILL_X) #, 0, 0, 0, 150)
+ list.connect(SEL_COMMAND) do |sender, sel, ptr|
+ if sender.retrieveItem(sender.currentItem).selected?
+ show_fault(sender.retrieveItem(sender.currentItem).fault)
+ else
+ clear_fault
+ end
+ end
+ list
+ end
+
+ def create_detail_panel(parent)
+ FXHorizontalFrame.new(parent, LAYOUT_FILL_X | LAYOUT_FILL_Y | FRAME_SUNKEN | FRAME_THICK)
+ end
+
+ def create_text(parent)
+ FXText.new(parent, nil, 0, TEXT_READONLY | LAYOUT_FILL_X | LAYOUT_FILL_Y)
+ end
+
+ def create_entry(parent)
+ entry = FXTextField.new(parent, 30, nil, 0, TEXTFIELD_NORMAL | LAYOUT_SIDE_BOTTOM | LAYOUT_FILL_X)
+ entry.disable
+ entry
+ end
+ end
+
+ class FaultListItem < FXListItem
+ attr_reader(:fault)
+ def initialize(fault)
+ super(fault.short_display)
+ @fault = fault
+ end
+ end
+ end
+ end
+ end
+end
+
+if __FILE__ == $0
+ Test::Unit::UI::Fox::TestRunner.start_command_line_test
+end
diff --git a/lib/test/unit/ui/gtk/testrunner.rb b/lib/test/unit/ui/gtk/testrunner.rb
new file mode 100644
index 0000000000..994328dc9b
--- /dev/null
+++ b/lib/test/unit/ui/gtk/testrunner.rb
@@ -0,0 +1,416 @@
+#--
+#
+# Author:: Nathaniel Talbott.
+# Copyright:: Copyright (c) 2000-2002 Nathaniel Talbott. All rights reserved.
+# License:: Ruby license.
+
+require 'gtk'
+require 'test/unit/ui/testrunnermediator'
+require 'test/unit/ui/testrunnerutilities'
+
+module Test
+ module Unit
+ module UI
+ module GTK
+
+ # Runs a Test::Unit::TestSuite in a Gtk UI. Obviously,
+ # this one requires you to have Gtk
+ # (http://www.gtk.org/) and the Ruby Gtk extension
+ # (http://ruby-gnome.sourceforge.net/) installed.
+ class TestRunner
+ extend TestRunnerUtilities
+
+ # Creates a new TestRunner for running the passed
+ # suite.
+ def initialize(suite, output_level = NORMAL)
+ if (suite.respond_to?(:suite))
+ @suite = suite.suite
+ else
+ @suite = suite
+ end
+ @result = nil
+
+ @runner = Thread.current
+ @restart_signal = Class.new(Exception)
+ @viewer = Thread.start do
+ @runner.join rescue @runner.run
+ Gtk.main
+ end
+ @viewer.join rescue nil # wait deadlock to handshake
+ end
+
+ # Begins the test run.
+ def start
+ setup_mediator
+ setup_ui
+ attach_to_mediator
+ start_ui
+ @result
+ end
+
+ private
+ def setup_mediator
+ @mediator = TestRunnerMediator.new(@suite)
+ suite_name = @suite.to_s
+ if ( @suite.kind_of?(Module) )
+ suite_name = @suite.name
+ end
+ suite_name_entry.set_text(suite_name)
+ end
+
+ def attach_to_mediator
+ run_button.signal_connect("clicked", nil, &method(:run_test))
+ @mediator.add_listener(TestRunnerMediator::RESET, &method(:reset_ui))
+ @mediator.add_listener(TestResult::FAULT, &method(:add_fault))
+ @mediator.add_listener(TestResult::CHANGED, &method(:result_changed))
+ @mediator.add_listener(TestRunnerMediator::STARTED, &method(:started))
+ @mediator.add_listener(TestCase::STARTED, &method(:test_started))
+ @mediator.add_listener(TestCase::FINISHED, &method(:test_finished))
+ @mediator.add_listener(TestRunnerMediator::FINISHED, &method(:finished))
+ end
+
+ def run_test(*)
+ @runner.raise(@restart_signal)
+ end
+
+ def start_ui
+ @viewer.run
+ running = false
+ begin
+ loop do
+ if (running ^= true)
+ run_button.child.text = "Stop"
+ @mediator.run_suite
+ else
+ run_button.child.text = "Run"
+ @viewer.join
+ break
+ end
+ end
+ rescue @restart_signal
+ retry
+ rescue
+ end
+ end
+
+ def stop(*)
+ Gtk.main_quit
+ end
+
+ def reset_ui(count)
+ test_progress_bar.set_style(green_style)
+ test_progress_bar.configure(0, 0, count)
+ @red = false
+
+ run_count_label.set_text("0")
+ assertion_count_label.set_text("0")
+ failure_count_label.set_text("0")
+ error_count_label.set_text("0")
+
+ fault_list.remove_items(fault_list.children)
+ end
+
+ def add_fault(fault)
+ if ( ! @red )
+ test_progress_bar.set_style(red_style)
+ @red = true
+ end
+ item = FaultListItem.new(fault)
+ item.show
+ fault_list.append_items([item])
+ end
+
+ def show_fault(fault)
+ raw_show_fault(fault.long_display)
+ end
+
+ def raw_show_fault(string)
+ fault_detail_label.set_text(string)
+ outer_detail_sub_panel.queue_resize
+ end
+
+ def clear_fault
+ raw_show_fault("")
+ end
+
+ def result_changed(result)
+ run_count_label.set_text(result.run_count.to_s)
+ assertion_count_label.set_text(result.assertion_count.to_s)
+ failure_count_label.set_text(result.failure_count.to_s)
+ error_count_label.set_text(result.error_count.to_s)
+ end
+
+ def started(result)
+ @result = result
+ output_status("Started...")
+ end
+
+ def test_started(test_name)
+ output_status("Running #{test_name}...")
+ end
+
+ def test_finished(test_name)
+ test_progress_bar.set_value(test_progress_bar.get_value + 1)
+ end
+
+ def finished(elapsed_time)
+ output_status("Finished in #{elapsed_time} seconds")
+ end
+
+ def output_status(string)
+ status_entry.set_text(string)
+ end
+
+ def setup_ui
+ main_window.signal_connect("destroy", nil, &method(:stop))
+ main_window.show_all
+ fault_list.signal_connect("select-child", nil) {
+ | list, item, data |
+ show_fault(item.fault)
+ }
+ fault_list.signal_connect("unselect-child", nil) {
+ clear_fault
+ }
+ @red = false
+ end
+
+ def main_window
+ lazy_initialize(:main_window) {
+ @main_window = Gtk::Window.new(Gtk::WINDOW_TOPLEVEL)
+ @main_window.set_title("Test::Unit TestRunner")
+ @main_window.set_usize(800, 600)
+ @main_window.set_uposition(20, 20)
+ @main_window.set_policy(true, true, false)
+ @main_window.add(main_panel)
+ }
+ end
+
+ def main_panel
+ lazy_initialize(:main_panel) {
+ @main_panel = Gtk::VBox.new(false, 0)
+ @main_panel.pack_start(suite_panel, false, false, 0)
+ @main_panel.pack_start(progress_panel, false, false, 0)
+ @main_panel.pack_start(info_panel, false, false, 0)
+ @main_panel.pack_start(list_panel, false, false, 0)
+ @main_panel.pack_start(detail_panel, true, true, 0)
+ @main_panel.pack_start(status_panel, false, false, 0)
+ }
+ end
+
+ def suite_panel
+ lazy_initialize(:suite_panel) {
+ @suite_panel = Gtk::HBox.new(false, 10)
+ @suite_panel.border_width(10)
+ @suite_panel.pack_start(Gtk::Label.new("Suite:"), false, false, 0)
+ @suite_panel.pack_start(suite_name_entry, true, true, 0)
+ @suite_panel.pack_start(run_button, false, false, 0)
+ }
+ end
+
+ def suite_name_entry
+ lazy_initialize(:suite_name_entry) {
+ @suite_name_entry = Gtk::Entry.new
+ @suite_name_entry.set_editable(false)
+ }
+ end
+
+ def run_button
+ lazy_initialize(:run_button) {
+ @run_button = Gtk::Button.new("Run")
+ }
+ end
+
+ def progress_panel
+ lazy_initialize(:progress_panel) {
+ @progress_panel = Gtk::HBox.new(false, 10)
+ @progress_panel.border_width(10)
+ @progress_panel.pack_start(test_progress_bar, true, true, 0)
+ }
+ end
+
+ def test_progress_bar
+ lazy_initialize(:test_progress_bar) {
+ @test_progress_bar = EnhancedProgressBar.new
+ @test_progress_bar.set_usize(@test_progress_bar.allocation.width,
+ info_panel.size_request.height)
+ @test_progress_bar.set_style(green_style)
+ }
+ end
+
+ def green_style
+ lazy_initialize(:green_style) {
+ @green_style = Gtk::Style.new
+ @green_style.set_bg(Gtk::STATE_PRELIGHT, 0x0000, 0xFFFF, 0x0000)
+ }
+ end
+
+ def red_style
+ lazy_initialize(:red_style) {
+ @red_style = Gtk::Style.new
+ @red_style.set_bg(Gtk::STATE_PRELIGHT, 0xFFFF, 0x0000, 0x0000)
+ }
+ end
+
+ def info_panel
+ lazy_initialize(:info_panel) {
+ @info_panel = Gtk::HBox.new(false, 0)
+ @info_panel.border_width(10)
+ @info_panel.pack_start(Gtk::Label.new("Runs:"), false, false, 0)
+ @info_panel.pack_start(run_count_label, true, false, 0)
+ @info_panel.pack_start(Gtk::Label.new("Assertions:"), false, false, 0)
+ @info_panel.pack_start(assertion_count_label, true, false, 0)
+ @info_panel.pack_start(Gtk::Label.new("Failures:"), false, false, 0)
+ @info_panel.pack_start(failure_count_label, true, false, 0)
+ @info_panel.pack_start(Gtk::Label.new("Errors:"), false, false, 0)
+ @info_panel.pack_start(error_count_label, true, false, 0)
+ }
+ end
+
+ def run_count_label
+ lazy_initialize(:run_count_label) {
+ @run_count_label = Gtk::Label.new("0")
+ @run_count_label.set_justify(Gtk::JUSTIFY_LEFT)
+ }
+ end
+
+ def assertion_count_label
+ lazy_initialize(:assertion_count_label) {
+ @assertion_count_label = Gtk::Label.new("0")
+ @assertion_count_label.set_justify(Gtk::JUSTIFY_LEFT)
+ }
+ end
+
+ def failure_count_label
+ lazy_initialize(:failure_count_label) {
+ @failure_count_label = Gtk::Label.new("0")
+ @failure_count_label.set_justify(Gtk::JUSTIFY_LEFT)
+ }
+ end
+
+ def error_count_label
+ lazy_initialize(:error_count_label) {
+ @error_count_label = Gtk::Label.new("0")
+ @error_count_label.set_justify(Gtk::JUSTIFY_LEFT)
+ }
+ end
+
+ def list_panel
+ lazy_initialize(:list_panel) {
+ @list_panel = Gtk::HBox.new
+ @list_panel.border_width(10)
+ @list_panel.pack_start(list_scrolled_window, true, true, 0)
+ }
+ end
+
+ def list_scrolled_window
+ lazy_initialize(:list_scrolled_window) {
+ @list_scrolled_window = Gtk::ScrolledWindow.new
+ @list_scrolled_window.set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC)
+ @list_scrolled_window.set_usize(@list_scrolled_window.allocation.width, 150)
+ @list_scrolled_window.add_with_viewport(fault_list)
+ }
+ end
+
+ def fault_list
+ lazy_initialize(:fault_list) {
+ @fault_list = Gtk::List.new
+ }
+ end
+
+ def detail_panel
+ lazy_initialize(:detail_panel) {
+ @detail_panel = Gtk::HBox.new
+ @detail_panel.border_width(10)
+ @detail_panel.pack_start(detail_scrolled_window, true, true, 0)
+ }
+ end
+
+ def detail_scrolled_window
+ lazy_initialize(:detail_scrolled_window) {
+ @detail_scrolled_window = Gtk::ScrolledWindow.new
+ @detail_scrolled_window.set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC)
+ @detail_scrolled_window.set_usize(400, @detail_scrolled_window.allocation.height)
+ @detail_scrolled_window.add_with_viewport(outer_detail_sub_panel)
+ }
+ end
+
+ def outer_detail_sub_panel
+ lazy_initialize(:outer_detail_sub_panel) {
+ @outer_detail_sub_panel = Gtk::VBox.new
+ @outer_detail_sub_panel.pack_start(inner_detail_sub_panel, false, false, 0)
+ }
+ end
+
+ def inner_detail_sub_panel
+ lazy_initialize(:inner_detail_sub_panel) {
+ @inner_detail_sub_panel = Gtk::HBox.new
+ @inner_detail_sub_panel.pack_start(fault_detail_label, false, false, 0)
+ }
+ end
+
+ def fault_detail_label
+ lazy_initialize(:fault_detail_label) {
+ @fault_detail_label = EnhancedLabel.new("")
+ style = Gtk::Style.new
+ font = Gdk::Font.font_load("-*-Courier New-medium-r-normal--*-120-*-*-*-*-*-*")
+ begin
+ style.set_font(font)
+ rescue ArgumentError; end
+ @fault_detail_label.set_style(style)
+ @fault_detail_label.set_justify(Gtk::JUSTIFY_LEFT)
+ @fault_detail_label.set_line_wrap(false)
+ }
+ end
+
+ def status_panel
+ lazy_initialize(:status_panel) {
+ @status_panel = Gtk::HBox.new
+ @status_panel.border_width(10)
+ @status_panel.pack_start(status_entry, true, true, 0)
+ }
+ end
+
+ def status_entry
+ lazy_initialize(:status_entry) {
+ @status_entry = Gtk::Entry.new
+ @status_entry.set_editable(false)
+ }
+ end
+
+ def lazy_initialize(symbol)
+ if (!instance_eval("defined?(@#{symbol.to_s})"))
+ yield
+ end
+ return instance_eval("@" + symbol.to_s)
+ end
+ end
+
+ class EnhancedProgressBar < Gtk::ProgressBar
+ def set_style(style)
+ super
+ hide
+ show
+ end
+ end
+
+ class EnhancedLabel < Gtk::Label
+ def set_text(text)
+ super(text.gsub(/\n\t/, "\n" + (" " * 4)))
+ end
+ end
+
+ class FaultListItem < Gtk::ListItem
+ attr_reader(:fault)
+ def initialize(fault)
+ super(fault.short_display)
+ @fault = fault
+ end
+ end
+ end
+ end
+ end
+end
+
+if __FILE__ == $0
+ Test::Unit::UI::GTK::TestRunner.start_command_line_test
+end
diff --git a/lib/test/unit/ui/gtk2/testrunner.rb b/lib/test/unit/ui/gtk2/testrunner.rb
new file mode 100644
index 0000000000..b05549c0e8
--- /dev/null
+++ b/lib/test/unit/ui/gtk2/testrunner.rb
@@ -0,0 +1,465 @@
+#--
+#
+# Author:: Kenta MURATA.
+# Copyright:: Copyright (c) 2000-2002 Kenta MURATA. All rights reserved.
+# License:: Ruby license.
+
+require "gtk2"
+require "test/unit/ui/testrunnermediator"
+require "test/unit/ui/testrunnerutilities"
+
+module Test
+ module Unit
+ module UI
+ module GTK2
+
+ Gtk.init
+
+ class EnhancedLabel < Gtk::Label
+ def set_text(text)
+ super(text.gsub(/\n\t/, "\n "))
+ end
+ end
+
+ class FaultList < Gtk::TreeView
+ def initialize
+ @faults = []
+ @model = Gtk::ListStore.new(String, String)
+ super(@model)
+ column = Gtk::TreeViewColumn.new
+ column.visible = false
+ append_column(column)
+ renderer = Gtk::CellRendererText.new
+ column = Gtk::TreeViewColumn.new("Failures", renderer, {:text => 1})
+ append_column(column)
+ selection.mode = Gtk::SELECTION_SINGLE
+ set_rules_hint(true)
+ set_headers_visible(false)
+ end # def initialize
+
+ def add_fault(fault)
+ @faults.push(fault)
+ iter = @model.append
+ iter.set_value(0, (@faults.length - 1).to_s)
+ iter.set_value(1, fault.short_display)
+ end # def add_fault(fault)
+
+ def get_fault(iter)
+ @faults[iter.get_value(0).to_i]
+ end # def get_fault
+
+ def clear
+ model.clear
+ end # def clear
+ end
+
+ class TestRunner
+ extend TestRunnerUtilities
+
+ def lazy_initialize(symbol)
+ if !instance_eval("defined?(@#{symbol})") then
+ yield
+ end
+ return instance_eval("@#{symbol}")
+ end
+ private :lazy_initialize
+
+ def status_entry
+ lazy_initialize(:status_entry) do
+ @status_entry = Gtk::Entry.new
+ @status_entry.editable = false
+ end
+ end
+ private :status_entry
+
+ def status_panel
+ lazy_initialize(:status_panel) do
+ @status_panel = Gtk::HBox.new
+ @status_panel.border_width = 10
+ @status_panel.pack_start(status_entry, true, true, 0)
+ end
+ end
+ private :status_panel
+
+ def fault_detail_label
+ lazy_initialize(:fault_detail_label) do
+ @fault_detail_label = EnhancedLabel.new("")
+# style = Gtk::Style.new
+# font = Gdk::Font.
+# font_load("-*-Courier 10 Pitch-medium-r-normal--*-120-*-*-*-*-*-*")
+# style.set_font(font)
+# @fault_detail_label.style = style
+ @fault_detail_label.justify = Gtk::JUSTIFY_LEFT
+ @fault_detail_label.wrap = false
+ end
+ end
+ private :fault_detail_label
+
+ def inner_detail_sub_panel
+ lazy_initialize(:inner_detail_sub_panel) do
+ @inner_detail_sub_panel = Gtk::HBox.new
+ @inner_detail_sub_panel.pack_start(fault_detail_label, false, false, 0)
+ end
+ end
+ private :inner_detail_sub_panel
+
+ def outer_detail_sub_panel
+ lazy_initialize(:outer_detail_sub_panel) do
+ @outer_detail_sub_panel = Gtk::VBox.new
+ @outer_detail_sub_panel.pack_start(inner_detail_sub_panel, false, false, 0)
+ end
+ end
+ private :outer_detail_sub_panel
+
+ def detail_scrolled_window
+ lazy_initialize(:detail_scrolled_window) do
+ @detail_scrolled_window = Gtk::ScrolledWindow.new
+ @detail_scrolled_window.set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC)
+ @detail_scrolled_window.
+ set_size_request(400, @detail_scrolled_window.allocation.height)
+ @detail_scrolled_window.add_with_viewport(outer_detail_sub_panel)
+ end
+ end
+ private :detail_scrolled_window
+
+ def detail_panel
+ lazy_initialize(:detail_panel) do
+ @detail_panel = Gtk::HBox.new
+ @detail_panel.border_width = 10
+ @detail_panel.pack_start(detail_scrolled_window, true, true, 0)
+ end
+ end
+ private :detail_panel
+
+ def fault_list
+ lazy_initialize(:fault_list) do
+ @fault_list = FaultList.new
+ end
+ end
+ private :fault_list
+
+ def list_scrolled_window
+ lazy_initialize(:list_scrolled_window) do
+ @list_scrolled_window = Gtk::ScrolledWindow.new
+ @list_scrolled_window.set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC)
+ @list_scrolled_window.
+ set_size_request(@list_scrolled_window.allocation.width, 150)
+ @list_scrolled_window.add_with_viewport(fault_list)
+ end
+ end
+ private :list_scrolled_window
+
+ def list_panel
+ lazy_initialize(:list_panel) do
+ @list_panel = Gtk::HBox.new
+ @list_panel.border_width = 10
+ @list_panel.pack_start(list_scrolled_window, true, true, 0)
+ end
+ end
+ private :list_panel
+
+ def error_count_label
+ lazy_initialize(:error_count_label) do
+ @error_count_label = Gtk::Label.new("0")
+ @error_count_label.justify = Gtk::JUSTIFY_LEFT
+ end
+ end
+ private :error_count_label
+
+ def failure_count_label
+ lazy_initialize(:failure_count_label) do
+ @failure_count_label = Gtk::Label.new("0")
+ @failure_count_label.justify = Gtk::JUSTIFY_LEFT
+ end
+ end
+ private :failure_count_label
+
+ def assertion_count_label
+ lazy_initialize(:assertion_count_label) do
+ @assertion_count_label = Gtk::Label.new("0")
+ @assertion_count_label.justify = Gtk::JUSTIFY_LEFT
+ end
+ end
+ private :assertion_count_label
+
+ def run_count_label
+ lazy_initialize(:run_count_label) do
+ @run_count_label = Gtk::Label.new("0")
+ @run_count_label.justify = Gtk::JUSTIFY_LEFT
+ end
+ end
+ private :run_count_label
+
+ def info_panel
+ lazy_initialize(:info_panel) do
+ @info_panel = Gtk::HBox.new(false, 0)
+ @info_panel.border_width = 10
+ @info_panel.pack_start(Gtk::Label.new("Runs:"), false, false, 0)
+ @info_panel.pack_start(run_count_label, true, false, 0)
+ @info_panel.pack_start(Gtk::Label.new("Assertions:"), false, false, 0)
+ @info_panel.pack_start(assertion_count_label, true, false, 0)
+ @info_panel.pack_start(Gtk::Label.new("Failures:"), false, false, 0)
+ @info_panel.pack_start(failure_count_label, true, false, 0)
+ @info_panel.pack_start(Gtk::Label.new("Errors:"), false, false, 0)
+ @info_panel.pack_start(error_count_label, true, false, 0)
+ end
+ end # def info_panel
+ private :info_panel
+
+ def green_style
+ lazy_initialize(:green_style) do
+ @green_style = Gtk::Style.new
+ @green_style.set_bg(Gtk::STATE_PRELIGHT, 0x0000, 0xFFFF, 0x0000)
+ end
+ end # def green_style
+ private :green_style
+
+ def red_style
+ lazy_initialize(:red_style) do
+ @red_style = Gtk::Style.new
+ @red_style.set_bg(Gtk::STATE_PRELIGHT, 0xFFFF, 0x0000, 0x0000)
+ end
+ end # def red_style
+ private :red_style
+
+ def test_progress_bar
+ lazy_initialize(:test_progress_bar) {
+ @test_progress_bar = Gtk::ProgressBar.new
+ @test_progress_bar.fraction = 0.0
+ @test_progress_bar.
+ set_size_request(@test_progress_bar.allocation.width,
+ info_panel.size_request[1])
+ @test_progress_bar.style = green_style
+ }
+ end # def test_progress_bar
+ private :test_progress_bar
+
+ def progress_panel
+ lazy_initialize(:progress_panel) do
+ @progress_panel = Gtk::HBox.new(false, 10)
+ @progress_panel.border_width = 10
+ @progress_panel.pack_start(test_progress_bar, true, true, 0)
+ end
+ end # def progress_panel
+
+ def run_button
+ lazy_initialize(:run_button) do
+ @run_button = Gtk::Button.new("Run")
+ end
+ end # def run_button
+
+ def suite_name_entry
+ lazy_initialize(:suite_name_entry) do
+ @suite_name_entry = Gtk::Entry.new
+ @suite_name_entry.editable = false
+ end
+ end # def suite_name_entry
+ private :suite_name_entry
+
+ def suite_panel
+ lazy_initialize(:suite_panel) do
+ @suite_panel = Gtk::HBox.new(false, 10)
+ @suite_panel.border_width = 10
+ @suite_panel.pack_start(Gtk::Label.new("Suite:"), false, false, 0)
+ @suite_panel.pack_start(suite_name_entry, true, true, 0)
+ @suite_panel.pack_start(run_button, false, false, 0)
+ end
+ end # def suite_panel
+ private :suite_panel
+
+ def main_panel
+ lazy_initialize(:main_panel) do
+ @main_panel = Gtk::VBox.new(false, 0)
+ @main_panel.pack_start(suite_panel, false, false, 0)
+ @main_panel.pack_start(progress_panel, false, false, 0)
+ @main_panel.pack_start(info_panel, false, false, 0)
+ @main_panel.pack_start(list_panel, false, false, 0)
+ @main_panel.pack_start(detail_panel, true, true, 0)
+ @main_panel.pack_start(status_panel, false, false, 0)
+ end
+ end # def main_panel
+ private :main_panel
+
+ def main_window
+ lazy_initialize(:main_window) do
+ @main_window = Gtk::Window.new(Gtk::Window::TOPLEVEL)
+ @main_window.set_title("Test::Unit TestRunner")
+ @main_window.set_default_size(800, 600)
+ @main_window.set_resizable(true)
+ @main_window.add(main_panel)
+ end
+ end # def main_window
+ private :main_window
+
+ def setup_ui
+ main_window.signal_connect("destroy", nil) { stop }
+ main_window.show_all
+ fault_list.selection.signal_connect("changed", nil) do
+ |selection, data|
+ if selection.selected then
+ show_fault(fault_list.get_fault(selection.selected))
+ else
+ clear_fault
+ end
+ end
+ end # def setup_ui
+ private :setup_ui
+
+ def output_status(string)
+ status_entry.set_text(string)
+ end # def output_status(string)
+ private :output_status
+
+ def finished(elapsed_time)
+ test_progress_bar.fraction = 1.0
+ output_status("Finished in #{elapsed_time} seconds")
+ end # def finished(elapsed_time)
+ private :finished
+
+ def test_started(test_name)
+ output_status("Running #{test_name}...")
+ end # def test_started(test_name)
+ private :test_started
+
+ def started(result)
+ @result = result
+ output_status("Started...")
+ end # def started(result)
+ private :started
+
+ def test_finished(result)
+ test_progress_bar.fraction += 1.0 / @count
+ end # def test_finished(result)
+
+ def result_changed(result)
+ run_count_label.label = result.run_count.to_s
+ assertion_count_label.label = result.assertion_count.to_s
+ failure_count_label.label = result.failure_count.to_s
+ error_count_label.label = result.error_count.to_s
+ end # def result_changed(result)
+ private :result_changed
+
+ def clear_fault
+ raw_show_fault("")
+ end # def clear_fault
+ private :clear_fault
+
+ def raw_show_fault(string)
+ fault_detail_label.set_text(string)
+ outer_detail_sub_panel.queue_resize
+ end # def raw_show_fault(string)
+ private :raw_show_fault
+
+ def show_fault(fault)
+ raw_show_fault(fault.long_display)
+ end # def show_fault(fault)
+ private :show_fault
+
+ def add_fault(fault)
+ if not @red then
+ test_progress_bar.style = red_style
+ @red = true
+ end
+ fault_list.add_fault(fault)
+ end # def add_fault(fault)
+ private :add_fault
+
+ def reset_ui(count)
+ test_progress_bar.style = green_style
+ test_progress_bar.fraction = 0.0
+ @count = count + 1
+ @red = false
+
+ run_count_label.set_text("0")
+ assertion_count_label.set_text("0")
+ failure_count_label.set_text("0")
+ error_count_label.set_text("0")
+
+ fault_list.clear
+ end # def reset_ui(count)
+ private :reset_ui
+
+ def stop
+ Gtk.main_quit
+ end # def stop
+ private :stop
+
+ def run_test
+ @runner.raise(@restart_signal)
+ end
+ private :run_test
+
+ def start_ui
+ @viewer.run
+ running = false
+ begin
+ loop do
+ if (running ^= true)
+ run_button.child.text = "Stop"
+ @mediator.run_suite
+ else
+ run_button.child.text = "Run"
+ @viewer.join
+ break
+ end
+ end
+ rescue @restart_signal
+ retry
+ rescue
+ end
+ end # def start_ui
+ private :start_ui
+
+ def attach_to_mediator
+ run_button.signal_connect("clicked", nil) { run_test }
+ @mediator.add_listener(TestRunnerMediator::RESET, &method(:reset_ui))
+ @mediator.add_listener(TestRunnerMediator::STARTED, &method(:started))
+ @mediator.add_listener(TestRunnerMediator::FINISHED, &method(:finished))
+ @mediator.add_listener(TestResult::FAULT, &method(:add_fault))
+ @mediator.add_listener(TestResult::CHANGED, &method(:result_changed))
+ @mediator.add_listener(TestCase::STARTED, &method(:test_started))
+ @mediator.add_listener(TestCase::FINISHED, &method(:test_finished))
+ end # def attach_to_mediator
+ private :attach_to_mediator
+
+ def setup_mediator
+ @mediator = TestRunnerMediator.new(@suite)
+ suite_name = @suite.to_s
+ if @suite.kind_of?(Module) then
+ suite_name = @suite.name
+ end
+ suite_name_entry.set_text(suite_name)
+ end # def setup_mediator
+ private :setup_mediator
+
+ def start
+ setup_mediator
+ setup_ui
+ attach_to_mediator
+ start_ui
+ @result
+ end # def start
+
+ def initialize(suite, output_level = NORMAL)
+ if suite.respond_to?(:suite) then
+ @suite = suite.suite
+ else
+ @suite = suite
+ end
+ @result = nil
+
+ @runner = Thread.current
+ @restart_signal = Class.new(Exception)
+ @viewer = Thread.start do
+ @runner.join rescue @runner.run
+ Gtk.main
+ end
+ @viewer.join rescue nil # wait deadlock to handshake
+ end # def initialize(suite)
+
+ end # class TestRunner
+
+ end # module GTK2
+ end # module UI
+ end # module Unit
+end # module Test
diff --git a/lib/test/unit/ui/testrunnermediator.rb b/lib/test/unit/ui/testrunnermediator.rb
new file mode 100644
index 0000000000..d34510d1c6
--- /dev/null
+++ b/lib/test/unit/ui/testrunnermediator.rb
@@ -0,0 +1,68 @@
+#--
+#
+# Author:: Nathaniel Talbott.
+# Copyright:: Copyright (c) 2000-2002 Nathaniel Talbott. All rights reserved.
+# License:: Ruby license.
+
+require 'test/unit'
+require 'test/unit/util/observable'
+require 'test/unit/testresult'
+
+module Test
+ module Unit
+ module UI
+
+ # Provides an interface to write any given UI against,
+ # hopefully making it easy to write new UIs.
+ class TestRunnerMediator
+ RESET = name + "::RESET"
+ STARTED = name + "::STARTED"
+ FINISHED = name + "::FINISHED"
+
+ include Util::Observable
+
+ # Creates a new TestRunnerMediator initialized to run
+ # the passed suite.
+ def initialize(suite)
+ @suite = suite
+ end
+
+ # Runs the suite the TestRunnerMediator was created
+ # with.
+ def run_suite
+ Unit.run = true
+ begin_time = Time.now
+ notify_listeners(RESET, @suite.size)
+ result = create_result
+ notify_listeners(STARTED, result)
+ result_listener = result.add_listener(TestResult::CHANGED) do |updated_result|
+ notify_listeners(TestResult::CHANGED, updated_result)
+ end
+
+ fault_listener = result.add_listener(TestResult::FAULT) do |fault|
+ notify_listeners(TestResult::FAULT, fault)
+ end
+
+ @suite.run(result) do |channel, value|
+ notify_listeners(channel, value)
+ end
+
+ result.remove_listener(TestResult::FAULT, fault_listener)
+ result.remove_listener(TestResult::CHANGED, result_listener)
+ end_time = Time.now
+ elapsed_time = end_time - begin_time
+ notify_listeners(FINISHED, elapsed_time) #"Finished in #{elapsed_time} seconds.")
+ return result
+ end
+
+ private
+ # A factory method to create the result the mediator
+ # should run with. Can be overridden by subclasses if
+ # one wants to use a different result.
+ def create_result
+ return TestResult.new
+ end
+ end
+ end
+ end
+end
diff --git a/lib/test/unit/ui/testrunnerutilities.rb b/lib/test/unit/ui/testrunnerutilities.rb
new file mode 100644
index 0000000000..70b885bd6c
--- /dev/null
+++ b/lib/test/unit/ui/testrunnerutilities.rb
@@ -0,0 +1,46 @@
+#--
+#
+# Author:: Nathaniel Talbott.
+# Copyright:: Copyright (c) 2000-2002 Nathaniel Talbott. All rights reserved.
+# License:: Ruby license.
+
+module Test
+ module Unit
+ module UI
+
+ SILENT = 0
+ PROGRESS_ONLY = 1
+ NORMAL = 2
+ VERBOSE = 3
+
+ # Provides some utilities common to most, if not all,
+ # TestRunners.
+ #
+ #--
+ #
+ # Perhaps there ought to be a TestRunner superclass? There
+ # seems to be a decent amount of shared code between test
+ # runners.
+
+ module TestRunnerUtilities
+
+ # Creates a new TestRunner and runs the suite.
+ def run(suite, output_level=NORMAL)
+ return new(suite, output_level).start
+ end
+
+ # Takes care of the ARGV parsing and suite
+ # determination necessary for running one of the
+ # TestRunners from the command line.
+ def start_command_line_test
+ if ARGV.empty?
+ puts "You should supply the name of a test suite file to the runner"
+ exit
+ end
+ require ARGV[0].gsub(/.+::/, '')
+ new(eval(ARGV[0])).start
+ end
+ end
+ end
+ end
+end
diff --git a/lib/test/unit/ui/tk/testrunner.rb b/lib/test/unit/ui/tk/testrunner.rb
new file mode 100644
index 0000000000..4d05f2fb22
--- /dev/null
+++ b/lib/test/unit/ui/tk/testrunner.rb
@@ -0,0 +1,260 @@
+#--
+#
+# Original Author:: Nathaniel Talbott.
+# Author:: Kazuhiro NISHIYAMA.
+# Copyright:: Copyright (c) 2000-2002 Nathaniel Talbott. All rights reserved.
+# Copyright:: Copyright (c) 2003 Kazuhiro NISHIYAMA. All rights reserved.
+# License:: Ruby license.
+
+require 'tk'
+require 'test/unit/ui/testrunnermediator'
+require 'test/unit/ui/testrunnerutilities'
+
+module Test
+ module Unit
+ module UI
+ module Tk
+
+ # Runs a Test::Unit::TestSuite in a Tk UI. Obviously,
+ # this one requires you to have Tk
+ # and the Ruby Tk extension installed.
+ class TestRunner
+ extend TestRunnerUtilities
+
+ # Creates a new TestRunner for running the passed
+ # suite.
+ def initialize(suite, output_level = NORMAL)
+ if (suite.respond_to?(:suite))
+ @suite = suite.suite
+ else
+ @suite = suite
+ end
+ @result = nil
+
+ @red = false
+ @fault_detail_list = []
+ @runner = Thread.current
+ @restart_signal = Class.new(Exception)
+ @viewer = Thread.start do
+ @runner.join rescue @runner.run
+ ::Tk.mainloop
+ end
+ @viewer.join rescue nil # wait deadlock to handshake
+ end
+
+ # Begins the test run.
+ def start
+ setup_ui
+ setup_mediator
+ attach_to_mediator
+ start_ui
+ @result
+ end
+
+ private
+ def setup_mediator
+ @mediator = TestRunnerMediator.new(@suite)
+ suite_name = @suite.to_s
+ if ( @suite.kind_of?(Module) )
+ suite_name = @suite.name
+ end
+ @suite_name_entry.value = suite_name
+ end
+
+ def attach_to_mediator
+ @run_button.command(method(:run_test))
+ @fault_list.bind('ButtonPress-1', proc{|y|
+ fault = @fault_detail_list[@fault_list.nearest(y)]
+ if fault
+ show_fault(fault)
+ end
+ }, '%y')
+ @mediator.add_listener(TestRunnerMediator::RESET, &method(:reset_ui))
+ @mediator.add_listener(TestResult::FAULT, &method(:add_fault))
+ @mediator.add_listener(TestResult::CHANGED, &method(:result_changed))
+ @mediator.add_listener(TestRunnerMediator::STARTED, &method(:started))
+ @mediator.add_listener(TestCase::STARTED, &method(:test_started))
+ @mediator.add_listener(TestRunnerMediator::FINISHED, &method(:finished))
+ end
+
+ def run_test
+ @runner.raise(@restart_signal)
+ end
+
+ def start_ui
+ @viewer.run
+ running = false
+ begin
+ loop do
+ if (running ^= true)
+ @run_button.configure('text'=>'Stop')
+ @mediator.run_suite
+ else
+ @run_button.configure('text'=>'Run')
+ @viewer.join
+ break
+ end
+ end
+ rescue @restart_signal
+ retry
+ rescue
+ end
+ end
+
+ def stop
+ ::Tk.exit
+ end
+
+ def reset_ui(count)
+ @test_total_count = count.to_f
+ @test_progress_bar.configure('background'=>'green')
+ @test_progress_bar.place('relwidth'=>(count.zero? ? 0 : 0/count))
+ @red = false
+
+ @test_count_label.value = 0
+ @assertion_count_label.value = 0
+ @failure_count_label.value = 0
+ @error_count_label.value = 0
+
+ @fault_list.delete(0, 'end')
+ @fault_detail_list = []
+ clear_fault
+ end
+
+ def add_fault(fault)
+ if ( ! @red )
+ @test_progress_bar.configure('background'=>'red')
+ @red = true
+ end
+ @fault_detail_list.push fault
+ @fault_list.insert('end', fault.short_display)
+ end
+
+ def show_fault(fault)
+ raw_show_fault(fault.long_display)
+ end
+
+ def raw_show_fault(string)
+ @detail_text.value = string
+ end
+
+ def clear_fault
+ raw_show_fault("")
+ end
+
+ def result_changed(result)
+ @test_count_label.value = result.run_count
+ @test_progress_bar.place('relwidth'=>result.run_count/@test_total_count)
+ @assertion_count_label.value = result.assertion_count
+ @failure_count_label.value = result.failure_count
+ @error_count_label.value = result.error_count
+ end
+
+ def started(result)
+ @result = result
+ output_status("Started...")
+ end
+
+ def test_started(test_name)
+ output_status("Running #{test_name}...")
+ end
+
+ def finished(elapsed_time)
+ output_status("Finished in #{elapsed_time} seconds")
+ end
+
+ def output_status(string)
+ @status_entry.value = string
+ end
+
+ def setup_ui
+ @status_entry = TkVariable.new
+ l = TkLabel.new(nil, 'textvariable'=>@status_entry, 'relief'=>'sunken')
+ l.pack('side'=>'bottom', 'fill'=>'x')
+
+ suite_frame = TkFrame.new.pack('fill'=>'x')
+
+ @run_button = TkButton.new(suite_frame, 'text'=>'Run')
+ @run_button.pack('side'=>'right')
+
+ TkLabel.new(suite_frame, 'text'=>'Suite:').pack('side'=>'left')
+ @suite_name_entry = TkVariable.new
+ l = TkLabel.new(suite_frame, 'textvariable'=>@suite_name_entry, 'relief'=>'sunken')
+ l.pack('side'=>'left', 'fill'=>'x', 'expand'=>true)
+
+ f = TkFrame.new(nil, 'relief'=>'sunken', 'borderwidth'=>3, 'height'=>20).pack('fill'=>'x', 'padx'=>1)
+ @test_progress_bar = TkFrame.new(f, 'background'=>'green').place('anchor'=>'nw', 'relwidth'=>0.0, 'relheight'=>1.0)
+
+ info_frame = TkFrame.new.pack('fill'=>'x')
+ @test_count_label = create_count_label(info_frame, 'Tests:')
+ @assertion_count_label = create_count_label(info_frame, 'Assertions:')
+ @failure_count_label = create_count_label(info_frame, 'Failures:')
+ @error_count_label = create_count_label(info_frame, 'Errors:')
+
+ if (::Tk.info('command', TkPanedWindow::TkCommandNames[0]) != "")
+ # use panedwindow
+ paned_frame = TkPanedWindow.new("orient"=>"vertical").pack('fill'=>'both', 'expand'=>true)
+
+ fault_list_frame = TkFrame.new(paned_frame)
+ detail_frame = TkFrame.new(paned_frame)
+
+ paned_frame.add(fault_list_frame, detail_frame)
+ else
+ # no panedwindow
+ paned_frame = nil
+ fault_list_frame = TkFrame.new.pack('fill'=>'both', 'expand'=>true)
+ detail_frame = TkFrame.new.pack('fill'=>'both', 'expand'=>true)
+ end
+
+ TkGrid.rowconfigure(fault_list_frame, 0, 'weight'=>1, 'minsize'=>0)
+ TkGrid.columnconfigure(fault_list_frame, 0, 'weight'=>1, 'minsize'=>0)
+
+ fault_scrollbar_y = TkScrollbar.new(fault_list_frame)
+ fault_scrollbar_x = TkScrollbar.new(fault_list_frame)
+ @fault_list = TkListbox.new(fault_list_frame)
+ @fault_list.yscrollbar(fault_scrollbar_y)
+ @fault_list.xscrollbar(fault_scrollbar_x)
+
+ TkGrid.rowconfigure(detail_frame, 0, 'weight'=>1, 'minsize'=>0)
+ TkGrid.columnconfigure(detail_frame, 0, 'weight'=>1, 'minsize'=>0)
+
+ ::Tk.grid(@fault_list, fault_scrollbar_y, 'sticky'=>'news')
+ ::Tk.grid(fault_scrollbar_x, 'sticky'=>'news')
+
+ detail_scrollbar_y = TkScrollbar.new(detail_frame)
+ detail_scrollbar_x = TkScrollbar.new(detail_frame)
+ @detail_text = TkText.new(detail_frame, 'height'=>10, 'wrap'=>'none') {
+ bindtags(bindtags - [TkText])
+ }
+ @detail_text.yscrollbar(detail_scrollbar_y)
+ @detail_text.xscrollbar(detail_scrollbar_x)
+
+ ::Tk.grid(@detail_text, detail_scrollbar_y, 'sticky'=>'news')
+ ::Tk.grid(detail_scrollbar_x, 'sticky'=>'news')
+
+ # rubber-style pane
+ if paned_frame
+ ::Tk.update
+ @height = paned_frame.winfo_height
+ paned_frame.bind('Configure', proc{|h|
+ paned_frame.sash_place(0, 0, paned_frame.sash_coord(0)[1] * h / @height)
+ @height = h
+ }, '%h')
+ end
+ end
+
+ def create_count_label(parent, label)
+ TkLabel.new(parent, 'text'=>label).pack('side'=>'left', 'expand'=>true)
+ v = TkVariable.new(0)
+ TkLabel.new(parent, 'textvariable'=>v).pack('side'=>'left', 'expand'=>true)
+ v
+ end
+ end
+ end
+ end
+ end
+end
+
+if __FILE__ == $0
+ Test::Unit::UI::Tk::TestRunner.start_command_line_test
+end
diff --git a/lib/test/unit/util/backtracefilter.rb b/lib/test/unit/util/backtracefilter.rb
new file mode 100644
index 0000000000..7ebec2dfef
--- /dev/null
+++ b/lib/test/unit/util/backtracefilter.rb
@@ -0,0 +1,40 @@
+module Test
+ module Unit
+ module Util
+ module BacktraceFilter
+ TESTUNIT_FILE_SEPARATORS = %r{[\\/:]}
+ TESTUNIT_PREFIX = __FILE__.split(TESTUNIT_FILE_SEPARATORS)[0..-3]
+ TESTUNIT_RB_FILE = /\.rb\Z/
+
+ def filter_backtrace(backtrace, prefix=nil)
+ return ["No backtrace"] unless(backtrace)
+ split_p = if(prefix)
+ prefix.split(TESTUNIT_FILE_SEPARATORS)
+ else
+ TESTUNIT_PREFIX
+ end
+ match = proc do |e|
+ split_e = e.split(TESTUNIT_FILE_SEPARATORS)[0, split_p.size]
+ next false unless(split_e[0..-2] == split_p[0..-2])
+ split_e[-1].sub(TESTUNIT_RB_FILE, '') == split_p[-1]
+ end
+ return backtrace unless(backtrace.detect(&match))
+ found_prefix = false
+ new_backtrace = backtrace.reverse.reject do |e|
+ if(match[e])
+ found_prefix = true
+ true
+ elsif(found_prefix)
+ false
+ else
+ true
+ end
+ end.reverse
+ new_backtrace = (new_backtrace.empty? ? backtrace : new_backtrace)
+ new_backtrace = new_backtrace.reject(&match)
+ new_backtrace.empty? ? backtrace : new_backtrace
+ end
+ end
+ end
+ end
+end
diff --git a/lib/test/unit/util/observable.rb b/lib/test/unit/util/observable.rb
new file mode 100644
index 0000000000..3567d34271
--- /dev/null
+++ b/lib/test/unit/util/observable.rb
@@ -0,0 +1,90 @@
+#--
+#
+# Author:: Nathaniel Talbott.
+# Copyright:: Copyright (c) 2000-2002 Nathaniel Talbott. All rights reserved.
+# License:: Ruby license.
+
+require 'test/unit/util/procwrapper'
+
+module Test
+ module Unit
+ module Util
+
+ # This is a utility class that allows anything mixing
+ # it in to notify a set of listeners about interesting
+ # events.
+ module Observable
+ # We use this for defaults since nil might mean something
+ NOTHING = "NOTHING/#{__id__}"
+
+ # Adds the passed proc as a listener on the
+ # channel indicated by channel_name. listener_key
+ # is used to remove the listener later; if none is
+ # specified, the proc itself is used.
+ #
+ # Whatever is used as the listener_key is
+ # returned, making it very easy to use the proc
+ # itself as the listener_key:
+ #
+ # listener = add_listener("Channel") { ... }
+ # remove_listener("Channel", listener)
+ def add_listener(channel_name, listener_key=NOTHING, &listener) # :yields: value
+ unless(block_given?)
+ raise ArgumentError.new("No callback was passed as a listener")
+ end
+
+ key = listener_key
+ if (listener_key == NOTHING)
+ listener_key = listener
+ key = ProcWrapper.new(listener)
+ end
+
+ channels[channel_name] ||= {}
+ channels[channel_name][key] = listener
+ return listener_key
+ end
+
+ # Removes the listener indicated by listener_key
+ # from the channel indicated by
+ # channel_name. Returns the registered proc, or
+ # nil if none was found.
+ def remove_listener(channel_name, listener_key)
+ channel = channels[channel_name]
+ return nil unless (channel)
+ key = listener_key
+ if (listener_key.instance_of?(Proc))
+ key = ProcWrapper.new(listener_key)
+ end
+ if (channel.has_key?(key))
+ return channel.delete(key)
+ end
+ return nil
+ end
+
+ # Calls all the procs registered on the channel
+ # indicated by channel_name. If value is
+ # specified, it is passed in to the procs,
+ # otherwise they are called with no arguments.
+ #
+ #--
+ #
+ # Perhaps this should be private? Would it ever
+ # make sense for an external class to call this
+ # method directly?
+ def notify_listeners(channel_name, *arguments)
+ channel = channels[channel_name]
+ return 0 unless (channel)
+ listeners = channel.values
+ listeners.each { |listener| listener.call(*arguments) }
+ return listeners.size
+ end
+
+ private
+ def channels
+ @channels ||= {}
+ return @channels
+ end
+ end
+ end
+ end
+end
diff --git a/lib/test/unit/util/procwrapper.rb b/lib/test/unit/util/procwrapper.rb
new file mode 100644
index 0000000000..ad7252186d
--- /dev/null
+++ b/lib/test/unit/util/procwrapper.rb
@@ -0,0 +1,48 @@
+#--
+#
+# Author:: Nathaniel Talbott.
+# Copyright:: Copyright (c) 2000-2002 Nathaniel Talbott. All rights reserved.
+# License:: Ruby license.
+
+module Test
+ module Unit
+ module Util
+
+ # Allows the storage of a Proc passed through '&' in a
+ # hash.
+ #
+ # Note: this may be inefficient, since the hash being
+ # used is not necessarily very good. In Observable,
+ # efficiency is not too important, since the hash is
+ # only accessed when adding and removing listeners,
+ # not when notifying.
+
+ class ProcWrapper
+
+ # Creates a new wrapper for a_proc.
+ def initialize(a_proc)
+ @a_proc = a_proc
+ @hash = a_proc.inspect.sub(/^(#<#{a_proc.class}:)/){''}.sub(/(>)$/){''}.hex
+ end
+
+ def hash
+ return @hash
+ end
+
+ def ==(other)
+ case(other)
+ when ProcWrapper
+ return @a_proc == other.to_proc
+ else
+ return super
+ end
+ end
+ alias :eql? :==
+
+ def to_proc
+ return @a_proc
+ end
+ end
+ end
+ end
+end
diff --git a/lib/thread.rb b/lib/thread.rb
index cb6d8c62fc..7df6a140f5 100644
--- a/lib/thread.rb
+++ b/lib/thread.rb
@@ -1,5 +1,10 @@
#
+# NOTE:
+# This file is overwritten by ext/thread/lib/thread.rb unless ruby
+# is configured with --disable-fastthread.
+#
# thread.rb - thread support classes
+# $Date$
# by Yukihiro Matsumoto <matz@netlab.co.jp>
#
# Copyright (C) 2001 Yukihiro Matsumoto
@@ -8,19 +13,147 @@
#
unless defined? Thread
- raise "Thread not available for this ruby interpreter"
+ fail "Thread not available for this ruby interpreter"
end
-unless defined? ThreadError
- class ThreadError < StandardError
+class Thread
+ #
+ # Wraps a block in Thread.critical, restoring the original value upon exit
+ # from the critical section.
+ #
+ def Thread.exclusive
+ _old = Thread.critical
+ begin
+ Thread.critical = true
+ return yield
+ ensure
+ Thread.critical = _old
+ end
end
end
-if $DEBUG
- Thread.abort_on_exception = true
+#
+# Mutex implements a simple semaphore that can be used to coordinate access to
+# shared data from multiple concurrent threads.
+#
+# Example:
+#
+# require 'thread'
+# semaphore = Mutex.new
+#
+# a = Thread.new {
+# semaphore.synchronize {
+# # access shared resource
+# }
+# }
+#
+# b = Thread.new {
+# semaphore.synchronize {
+# # access shared resource
+# }
+# }
+#
+class Mutex
+ #
+ # Creates a new Mutex
+ #
+ def initialize
+ @waiting = []
+ @locked = false;
+ @waiting.taint # enable tainted comunication
+ self.taint
+ end
+
+ #
+ # Returns +true+ if this lock is currently held by some thread.
+ #
+ def locked?
+ @locked
+ end
+
+ #
+ # Attempts to obtain the lock and returns immediately. Returns +true+ if the
+ # lock was granted.
+ #
+ def try_lock
+ result = false
+ Thread.critical = true
+ unless @locked
+ @locked = true
+ result = true
+ end
+ Thread.critical = false
+ result
+ end
+
+ #
+ # Attempts to grab the lock and waits if it isn't available.
+ #
+ def lock
+ while (Thread.critical = true; @locked)
+ @waiting.push Thread.current
+ Thread.stop
+ end
+ @locked = true
+ Thread.critical = false
+ self
+ end
+
+ #
+ # Releases the lock. Returns +nil+ if ref wasn't locked.
+ #
+ def unlock
+ return unless @locked
+ Thread.critical = true
+ @locked = false
+ begin
+ t = @waiting.shift
+ t.wakeup if t
+ rescue ThreadError
+ retry
+ end
+ Thread.critical = false
+ begin
+ t.run if t
+ rescue ThreadError
+ end
+ self
+ end
+
+ #
+ # Obtains a lock, runs the block, and releases the lock when the block
+ # completes. See the example under Mutex.
+ #
+ def synchronize
+ lock
+ begin
+ yield
+ ensure
+ unlock
+ end
+ end
+
+ #
+ # If the mutex is locked, unlocks the mutex, wakes one waiting thread, and
+ # yields in a critical section.
+ #
+ def exclusive_unlock
+ return unless @locked
+ Thread.exclusive do
+ @locked = false
+ begin
+ t = @waiting.shift
+ t.wakeup if t
+ rescue ThreadError
+ retry
+ end
+ yield
+ end
+ self
+ end
end
-#
+#
# 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.
@@ -31,7 +164,7 @@ end
#
# mutex = Mutex.new
# resource = ConditionVariable.new
-#
+#
# a = Thread.new {
# mutex.synchronize {
# # Thread 'a' now needs the resource
@@ -39,7 +172,7 @@ end
# # 'a' can now have the resource
# }
# }
-#
+#
# b = Thread.new {
# mutex.synchronize {
# # Thread 'b' has finished using the resource
@@ -53,41 +186,40 @@ class ConditionVariable
#
def initialize
@waiters = []
- @waiters_mutex = Mutex.new
end
-
+
#
# Releases the lock held in +mutex+ and waits; reacquires the lock on wakeup.
#
def wait(mutex)
begin
- # TODO: mutex should not be used
- @waiters_mutex.synchronize do
+ mutex.exclusive_unlock do
@waiters.push(Thread.current)
+ Thread.stop
end
- mutex.sleep
+ ensure
+ mutex.lock
end
end
-
+
#
# Wakes up the first thread in line waiting for this lock.
#
def signal
begin
- t = @waiters_mutex.synchronize { @waiters.shift }
+ t = @waiters.shift
t.run if t
rescue ThreadError
retry
end
end
-
+
#
# Wakes up all threads waiting for this lock.
#
def broadcast
- # TODO: imcomplete
waiters0 = nil
- @waiters_mutex.synchronize do
+ Thread.exclusive do
waiters0 = @waiters.dup
@waiters.clear
end
@@ -106,9 +238,9 @@ end
# Example:
#
# require 'thread'
-#
+#
# queue = Queue.new
-#
+#
# producer = Thread.new do
# 5.times do |i|
# sleep rand(i) # simulate expense
@@ -116,7 +248,7 @@ end
# puts "#{i} produced"
# end
# end
-#
+#
# consumer = Thread.new do
# 5.times do |i|
# value = queue.pop
@@ -124,7 +256,7 @@ end
# puts "consumed #{value}"
# end
# end
-#
+#
# consumer.join
#
class Queue
@@ -137,23 +269,22 @@ class Queue
@que.taint # enable tainted comunication
@waiting.taint
self.taint
- @mutex = Mutex.new
end
#
# Pushes +obj+ to the queue.
#
def push(obj)
- t = nil
- @mutex.synchronize{
- @que.push obj
- begin
- t = @waiting.shift
- t.wakeup if t
- rescue ThreadError
- retry
- end
- }
+ Thread.critical = true
+ @que.push obj
+ begin
+ t = @waiting.shift
+ t.wakeup if t
+ rescue ThreadError
+ retry
+ ensure
+ Thread.critical = false
+ end
begin
t.run if t
rescue ThreadError
@@ -176,17 +307,14 @@ class Queue
# thread isn't suspended, and an exception is raised.
#
def pop(non_block=false)
- while true
- @mutex.synchronize{
- if @que.empty?
- raise ThreadError, "queue empty" if non_block
- @waiting.push Thread.current
- @mutex.sleep
- else
- return @que.shift
- end
- }
+ while (Thread.critical = true; @que.empty?)
+ raise ThreadError, "queue empty" if non_block
+ @waiting.push Thread.current
+ Thread.stop
end
+ @que.shift
+ ensure
+ Thread.critical = false
end
#
@@ -200,7 +328,7 @@ class Queue
alias deq pop
#
- # Returns +true+ if the queue is empty.
+ # Returns +true+ is the queue is empty.
#
def empty?
@que.empty?
@@ -239,7 +367,7 @@ end
#
# See Queue for an example of how a SizedQueue works.
#
-class SizedQueue < Queue
+class SizedQueue<Queue
#
# Creates a fixed-length queue with a maximum size of +max+.
#
@@ -262,16 +390,14 @@ class SizedQueue < Queue
# Sets the maximum size of the queue.
#
def max=(max)
- diff = nil
- @mutex.synchronize {
- if max <= @max
- @max = max
- else
- diff = max - @max
- @max = max
- end
- }
- if diff
+ Thread.critical = true
+ if max <= @max
+ @max = max
+ Thread.critical = false
+ else
+ diff = max - @max
+ @max = max
+ Thread.critical = false
diff.times do
begin
t = @queue_wait.shift
@@ -289,27 +415,13 @@ class SizedQueue < Queue
# until space becomes available.
#
def push(obj)
- t = nil
- @mutex.synchronize{
- while true
- break if @que.length < @max
- @queue_wait.push Thread.current
- @mutex.sleep
- end
-
- @que.push obj
- begin
- t = @waiting.shift
- t.wakeup if t
- rescue ThreadError
- retry
- end
- }
-
- begin
- t.run if t
- rescue ThreadError
+ Thread.critical = true
+ while @que.length >= @max
+ @queue_wait.push Thread.current
+ Thread.stop
+ Thread.critical = true
end
+ super
end
#
@@ -327,20 +439,20 @@ class SizedQueue < Queue
#
def pop(*args)
retval = super
- t = nil
- @mutex.synchronize {
- if @que.length < @max
- begin
- t = @queue_wait.shift
- t.wakeup if t
- rescue ThreadError
- retry
- end
+ Thread.critical = true
+ if @que.length < @max
+ begin
+ t = @queue_wait.shift
+ t.wakeup if t
+ rescue ThreadError
+ retry
+ ensure
+ Thread.critical = false
+ end
+ begin
+ t.run if t
+ rescue ThreadError
end
- }
- begin
- t.run if t
- rescue ThreadError
end
retval
end
diff --git a/lib/thwait.rb b/lib/thwait.rb
index 09d99a6c5b..95d294a85d 100644
--- a/lib/thwait.rb
+++ b/lib/thwait.rb
@@ -2,6 +2,7 @@
# thwait.rb - thread synchronization class
# $Release Version: 0.9 $
# $Revision: 1.3 $
+# $Date: 1998/06/26 03:19:34 $
# by Keiju ISHITSUKA(Nihpon Rational Software Co.,Ltd.)
#
# --
@@ -15,7 +16,7 @@
# each thread termination.
# * th = ThreadsWait.new(thread1,...)
# creates synchronization object, specifying thread(s) to wait.
-#
+#
# methods:
# * th.threads
# list threads to be synchronized
@@ -23,7 +24,7 @@
# is there any thread to be synchronized.
# * th.finished?
# is there already terminated thread.
-# * th.join(thread1,...)
+# * th.join(thread1,...)
# wait for specified thread(s).
# * th.join_nowait(threa1,...)
# specifies thread(s) to wait. non-blocking.
@@ -52,11 +53,11 @@ require "e2mmap.rb"
#
class ThreadsWait
RCS_ID='-$Id: thwait.rb,v 1.3 1998/06/26 03:19:34 keiju Exp keiju $-'
-
- extend Exception2MessageMapper
+
+ Exception2MessageMapper.extend_to(binding)
def_exception("ErrNoWaitingThread", "No threads for waiting.")
def_exception("ErrNoFinishedThread", "No finished threads.")
-
+
#
# Waits until all specified threads have terminated. If a block is provided,
# it is executed for each thread termination.
@@ -71,7 +72,7 @@ class ThreadsWait
tw.all_waits
end
end
-
+
#
# Creates a ThreadsWait object, specifying the threads to wait on.
# Non-blocking.
@@ -81,24 +82,24 @@ class ThreadsWait
@wait_queue = Queue.new
join_nowait(*threads) unless threads.empty?
end
-
+
# Returns the array of threads in the wait queue.
attr :threads
-
+
#
# Returns +true+ if there are no threads to be synchronized.
#
def empty?
@threads.empty?
end
-
+
#
# Returns +true+ if any thread has terminated.
#
def finished?
!@wait_queue.empty?
end
-
+
#
# Waits for specified threads to terminate.
#
@@ -106,7 +107,7 @@ class ThreadsWait
join_nowait(*threads)
next_wait
end
-
+
#
# Specifies the threads that this object will wait for, but does not actually
# wait.
@@ -124,7 +125,7 @@ class ThreadsWait
end
end
end
-
+
#
# Waits until any of the specified threads has terminated, and returns the one
# that does.
@@ -141,7 +142,7 @@ class ThreadsWait
ThreadsWait.fail ErrNoFinishedThread
end
end
-
+
#
# Waits until all of the specified threads are terminated. If a block is
# supplied for the method, it is executed for each thread termination.
diff --git a/lib/time.rb b/lib/time.rb
index 2e6ed324e3..a37a067390 100644
--- a/lib/time.rb
+++ b/lib/time.rb
@@ -1,42 +1,46 @@
#
# == Introduction
-#
+#
# This library extends the Time class:
# * conversion between date string and time object.
# * date-time defined by RFC 2822
# * HTTP-date defined by RFC 2616
# * dateTime defined by XML Schema Part 2: Datatypes (ISO 8601)
# * various formats handled by Date._parse (string to time only)
-#
+#
# == Design Issues
-#
+#
# === Specialized interface
-#
+#
# This library provides methods dedicated to special purposes:
# * RFC 2822, RFC 2616 and XML Schema.
# * They makes usual life easier.
-#
+#
# === Doesn't depend on strftime
-#
+#
# This library doesn't use +strftime+. Especially #rfc2822 doesn't depend
# on +strftime+ because:
-#
+#
# * %a and %b are locale sensitive
-#
+#
# Since they are locale sensitive, they may be replaced to
# invalid weekday/month name in some locales.
# Since ruby-1.6 doesn't invoke setlocale by default,
# the problem doesn't arise until some external library invokes setlocale.
# Ruby/GTK is the example of such library.
-#
+#
# * %z is not portable
-#
+#
# %z is required to generate zone in date-time of RFC 2822
# but it is not portable.
#
+# == Revision Information
+#
+# $Id$
+#
-require 'date/format'
+require 'parsedate'
#
# Implements the extensions to the Time class that are described in the
@@ -57,9 +61,9 @@ class Time
'PST' => -8, 'PDT' => -7,
# Following definition of military zones is original one.
# See RFC 1123 and RFC 2822 for the error in RFC 822.
- 'A' => +1, 'B' => +2, 'C' => +3, 'D' => +4, 'E' => +5, 'F' => +6,
+ 'A' => +1, 'B' => +2, 'C' => +3, 'D' => +4, 'E' => +5, 'F' => +6,
'G' => +7, 'H' => +8, 'I' => +9, 'K' => +10, 'L' => +11, 'M' => +12,
- 'N' => -1, 'O' => -2, 'P' => -3, 'Q' => -4, 'R' => -5, 'S' => -6,
+ 'N' => -1, 'O' => -2, 'P' => -3, 'Q' => -4, 'R' => -5, 'S' => -6,
'T' => -7, 'U' => -8, 'V' => -9, 'W' => -10, 'X' => -11, 'Y' => -12,
}
def zone_offset(zone, year=self.now.year)
@@ -80,26 +84,8 @@ class Time
end
def zone_utc?(zone)
- # * +0000
- # In RFC 2822, +0000 indicate a time zone at Universal Time.
- # Europe/London is "a time zone at Universal Time" in Winter.
- # Europe/Lisbon is "a time zone at Universal Time" in Winter.
- # Atlantic/Reykjavik is "a time zone at Universal Time".
- # Africa/Dakar is "a time zone at Universal Time".
- # So +0000 is a local time such as Europe/London, etc.
- # * GMT
- # GMT is used as a time zone abbreviation in Europe/London,
- # Africa/Dakar, etc.
- # So it is a local time.
- #
- # * -0000, -00:00
- # In RFC 2822, -0000 the date-time contains no information about the
- # local time zone.
- # In RFC 3339, -00:00 is used for the time in UTC is known,
- # but the offset to local time is unknown.
- # They are not appropriate for specific time zone such as
- # Europe/London because time zone neutral,
- # So -00:00 and -0000 are treated as UTC.
+ # * +0000 means localtime. [RFC 2822]
+ # * GMT is a localtime abbreviation in Europe/London, etc.
if /\A(?:-00:00|-0000|-00|UTC|Z|UT)\z/i =~ zone
true
else
@@ -164,7 +150,7 @@ class Time
def make_time(year, mon, day, hour, min, sec, sec_fraction, zone, now)
usec = nil
- usec = sec_fraction * 1000000 if sec_fraction
+ usec = (sec_fraction * 1000000).to_i if sec_fraction
if now
begin
break if year; year = now.year
@@ -206,7 +192,7 @@ class Time
# If a block is given, the year described in +date+ is converted by the
# block. For example:
#
- # Time.parse(...) {|y| 0 <= y && y < 100 ? (y >= 69 ? y + 1900 : y + 2000) : y}
+ # Time.parse(...) {|y| y < 100 ? (y >= 69 ? y + 1900 : y + 2000) : y}
#
# If the upper components of the given time are broken or missing, they are
# supplied with those of +now+. For the lower components, the minimum
@@ -214,11 +200,9 @@ class Time
#
# # Suppose it is "Thu Nov 29 14:33:20 GMT 2001" now and
# # your timezone is GMT:
- # now = Time.parse("Thu Nov 29 14:33:20 GMT 2001")
- # Time.parse("16:30", now) #=> 2001-11-29 16:30:00 +0900
- # Time.parse("7/23", now) #=> 2001-07-23 00:00:00 +0900
- # Time.parse("Aug 31", now) #=> 2001-08-31 00:00:00 +0900
- # Time.parse("Aug 2000", now) #=> 2000-08-01 00:00:00 +0900
+ # Time.parse("16:30") #=> Thu Nov 29 16:30:00 GMT 2001
+ # Time.parse("7/23") #=> Mon Jul 23 00:00:00 GMT 2001
+ # Time.parse("Aug 31") #=> Fri Aug 31 00:00:00 GMT 2001
#
# Since there are numerous conflicts among locally defined timezone
# abbreviations all over the world, this method is not made to
@@ -253,26 +237,7 @@ class Time
# A failure for Time.parse should be checked, though.
#
def parse(date, now=self.now)
- comp = !block_given?
- d = Date._parse(date, comp)
- if !d[:year] && !d[:mon] && !d[:mday] && !d[:hour] && !d[:min] && !d[:sec] && !d[:sec_fraction]
- raise ArgumentError, "no time information in #{date.inspect}"
- end
- year = d[:year]
- year = yield(year) if year && !comp
- make_time(year, d[:mon], d[:mday], d[:hour], d[:min], d[:sec], d[:sec_fraction], d[:zone], now)
- end
-
- #
- # Parses +date+ using Date._strptime and converts it to a Time object.
- #
- # If a block is given, the year described in +date+ is converted by the
- # block. For example:
- #
- # Time.strptime(...) {|y| y < 100 ? (y >= 69 ? y + 1900 : y + 2000) : y}
- def strptime(date, format, now=self.now)
- d = Date._strptime(date, format)
- raise ArgumentError, "invalid strptime format - `#{format}'" unless d
+ d = Date._parse(date, false)
year = d[:year]
year = yield(year) if year && block_given?
make_time(year, d[:mon], d[:mday], d[:hour], d[:min], d[:sec], d[:sec_fraction], d[:zone], now)
@@ -358,13 +323,7 @@ class Time
(\d\d):(\d\d):(\d\d)\x20
GMT
\s*\z/ix =~ date
- year = $3.to_i
- if year < 50
- year += 2000
- else
- year += 1900
- end
- self.utc(year, $2, $1.to_i, $4.to_i, $5.to_i, $6.to_i)
+ self.parse(date)
elsif /\A\s*
(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun)\x20
(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\x20
@@ -394,7 +353,7 @@ class Time
(-?\d+)-(\d\d)-(\d\d)
T
(\d\d):(\d\d):(\d\d)
- (\.\d+)?
+ (\.\d*)?
(Z|[+-]\d\d:\d\d)?
\s*\z/ix =~ date
year = $1.to_i
@@ -404,9 +363,7 @@ class Time
min = $5.to_i
sec = $6.to_i
usec = 0
- if $7
- usec = Rational($7) * 1000000
- end
+ usec = ($7[1..-1] + '000000')[0,6].to_i if $7
if $8
zone = $8
year, mon, day, hour, min, sec =
@@ -432,7 +389,7 @@ class Time
# If +self+ is a UTC time, -0000 is used as zone.
#
def rfc2822
- sprintf('%s, %02d %s %04d %02d:%02d:%02d ',
+ sprintf('%s, %02d %s %d %02d:%02d:%02d ',
RFC2822_DAY_NAME[wday],
day, RFC2822_MONTH_NAME[mon-1], year,
hour, min, sec) +
@@ -456,15 +413,15 @@ class Time
#
# Returns a string which represents the time as rfc1123-date of HTTP-date
- # defined by RFC 2616:
- #
+ # defined by RFC 2616:
+ #
# day-of-week, DD month-name CCYY hh:mm:ss GMT
#
# Note that the result is always UTC (GMT).
#
def httpdate
t = dup.utc
- sprintf('%s, %02d %s %04d %02d:%02d:%02d GMT',
+ sprintf('%s, %02d %s %d %02d:%02d:%02d GMT',
RFC2822_DAY_NAME[t.wday],
t.day, RFC2822_MONTH_NAME[t.mon-1], t.year,
t.hour, t.min, t.sec)
@@ -485,12 +442,14 @@ class Time
# Its default value is 0.
#
def xmlschema(fraction_digits=0)
- sprintf('%04d-%02d-%02dT%02d:%02d:%02d',
+ sprintf('%d-%02d-%02dT%02d:%02d:%02d',
year, mon, day, hour, min, sec) +
if fraction_digits == 0
''
+ elsif fraction_digits <= 6
+ '.' + sprintf('%06d', usec)[0, fraction_digits]
else
- '.' + sprintf('%0*d', fraction_digits, (subsec * 10**fraction_digits).floor)
+ '.' + sprintf('%06d', usec) + '0' * (fraction_digits - 6)
end +
if utc?
'Z'
@@ -503,3 +462,338 @@ class Time
alias iso8601 xmlschema
end
+if __FILE__ == $0
+ require 'test/unit'
+
+ class TimeExtentionTest < Test::Unit::TestCase # :nodoc:
+ def test_rfc822
+ assert_equal(Time.utc(1976, 8, 26, 14, 30) + 4 * 3600,
+ Time.rfc2822("26 Aug 76 14:30 EDT"))
+ assert_equal(Time.utc(1976, 8, 27, 9, 32) + 7 * 3600,
+ Time.rfc2822("27 Aug 76 09:32 PDT"))
+ end
+
+ def test_rfc2822
+ assert_equal(Time.utc(1997, 11, 21, 9, 55, 6) + 6 * 3600,
+ Time.rfc2822("Fri, 21 Nov 1997 09:55:06 -0600"))
+ assert_equal(Time.utc(2003, 7, 1, 10, 52, 37) - 2 * 3600,
+ Time.rfc2822("Tue, 1 Jul 2003 10:52:37 +0200"))
+ assert_equal(Time.utc(1997, 11, 21, 10, 1, 10) + 6 * 3600,
+ Time.rfc2822("Fri, 21 Nov 1997 10:01:10 -0600"))
+ assert_equal(Time.utc(1997, 11, 21, 11, 0, 0) + 6 * 3600,
+ Time.rfc2822("Fri, 21 Nov 1997 11:00:00 -0600"))
+ assert_equal(Time.utc(1997, 11, 24, 14, 22, 1) + 8 * 3600,
+ Time.rfc2822("Mon, 24 Nov 1997 14:22:01 -0800"))
+ begin
+ Time.at(-1)
+ rescue ArgumentError
+ # ignore
+ else
+ assert_equal(Time.utc(1969, 2, 13, 23, 32, 54) + 3 * 3600 + 30 * 60,
+ Time.rfc2822("Thu, 13 Feb 1969 23:32:54 -0330"))
+ assert_equal(Time.utc(1969, 2, 13, 23, 32, 0) + 3 * 3600 + 30 * 60,
+ Time.rfc2822(" Thu,
+ 13
+ Feb
+ 1969
+ 23:32
+ -0330 (Newfoundland Time)"))
+ end
+ assert_equal(Time.utc(1997, 11, 21, 9, 55, 6),
+ Time.rfc2822("21 Nov 97 09:55:06 GMT"))
+ assert_equal(Time.utc(1997, 11, 21, 9, 55, 6) + 6 * 3600,
+ Time.rfc2822("Fri, 21 Nov 1997 09 : 55 : 06 -0600"))
+ assert_raise(ArgumentError) {
+ # inner comment is not supported.
+ Time.rfc2822("Fri, 21 Nov 1997 09(comment): 55 : 06 -0600")
+ }
+ end
+
+ def test_rfc2616
+ t = Time.utc(1994, 11, 6, 8, 49, 37)
+ assert_equal(t, Time.httpdate("Sun, 06 Nov 1994 08:49:37 GMT"))
+ assert_equal(t, Time.httpdate("Sunday, 06-Nov-94 08:49:37 GMT"))
+ assert_equal(t, Time.httpdate("Sun Nov 6 08:49:37 1994"))
+ assert_equal(Time.utc(1995, 11, 15, 6, 25, 24),
+ Time.httpdate("Wed, 15 Nov 1995 06:25:24 GMT"))
+ assert_equal(Time.utc(1995, 11, 15, 4, 58, 8),
+ Time.httpdate("Wed, 15 Nov 1995 04:58:08 GMT"))
+ assert_equal(Time.utc(1994, 11, 15, 8, 12, 31),
+ Time.httpdate("Tue, 15 Nov 1994 08:12:31 GMT"))
+ assert_equal(Time.utc(1994, 12, 1, 16, 0, 0),
+ Time.httpdate("Thu, 01 Dec 1994 16:00:00 GMT"))
+ assert_equal(Time.utc(1994, 10, 29, 19, 43, 31),
+ Time.httpdate("Sat, 29 Oct 1994 19:43:31 GMT"))
+ assert_equal(Time.utc(1994, 11, 15, 12, 45, 26),
+ Time.httpdate("Tue, 15 Nov 1994 12:45:26 GMT"))
+ assert_equal(Time.utc(1999, 12, 31, 23, 59, 59),
+ Time.httpdate("Fri, 31 Dec 1999 23:59:59 GMT"))
+ end
+
+ def test_rfc3339
+ t = Time.utc(1985, 4, 12, 23, 20, 50, 520000)
+ s = "1985-04-12T23:20:50.52Z"
+ assert_equal(t, Time.iso8601(s))
+ assert_equal(s, t.iso8601(2))
+
+ t = Time.utc(1996, 12, 20, 0, 39, 57)
+ s = "1996-12-19T16:39:57-08:00"
+ assert_equal(t, Time.iso8601(s))
+ # There is no way to generate time string with arbitrary timezone.
+ s = "1996-12-20T00:39:57Z"
+ assert_equal(t, Time.iso8601(s))
+ assert_equal(s, t.iso8601)
+
+ t = Time.utc(1990, 12, 31, 23, 59, 60)
+ s = "1990-12-31T23:59:60Z"
+ assert_equal(t, Time.iso8601(s))
+ # leap second is representable only if timezone file has it.
+ s = "1990-12-31T15:59:60-08:00"
+ assert_equal(t, Time.iso8601(s))
+
+ begin
+ Time.at(-1)
+ rescue ArgumentError
+ # ignore
+ else
+ t = Time.utc(1937, 1, 1, 11, 40, 27, 870000)
+ s = "1937-01-01T12:00:27.87+00:20"
+ assert_equal(t, Time.iso8601(s))
+ end
+ end
+
+ # http://www.w3.org/TR/xmlschema-2/
+ def test_xmlschema
+ assert_equal(Time.utc(1999, 5, 31, 13, 20, 0) + 5 * 3600,
+ Time.xmlschema("1999-05-31T13:20:00-05:00"))
+ assert_equal(Time.local(2000, 1, 20, 12, 0, 0),
+ Time.xmlschema("2000-01-20T12:00:00"))
+ assert_equal(Time.utc(2000, 1, 20, 12, 0, 0),
+ Time.xmlschema("2000-01-20T12:00:00Z"))
+ assert_equal(Time.utc(2000, 1, 20, 12, 0, 0) - 12 * 3600,
+ Time.xmlschema("2000-01-20T12:00:00+12:00"))
+ assert_equal(Time.utc(2000, 1, 20, 12, 0, 0) + 13 * 3600,
+ Time.xmlschema("2000-01-20T12:00:00-13:00"))
+ assert_equal(Time.utc(2000, 3, 4, 23, 0, 0) - 3 * 3600,
+ Time.xmlschema("2000-03-04T23:00:00+03:00"))
+ assert_equal(Time.utc(2000, 3, 4, 20, 0, 0),
+ Time.xmlschema("2000-03-04T20:00:00Z"))
+ assert_equal(Time.local(2000, 1, 15, 0, 0, 0),
+ Time.xmlschema("2000-01-15T00:00:00"))
+ assert_equal(Time.local(2000, 2, 15, 0, 0, 0),
+ Time.xmlschema("2000-02-15T00:00:00"))
+ assert_equal(Time.local(2000, 1, 15, 12, 0, 0),
+ Time.xmlschema("2000-01-15T12:00:00"))
+ assert_equal(Time.utc(2000, 1, 16, 12, 0, 0),
+ Time.xmlschema("2000-01-16T12:00:00Z"))
+ assert_equal(Time.local(2000, 1, 1, 12, 0, 0),
+ Time.xmlschema("2000-01-01T12:00:00"))
+ assert_equal(Time.utc(1999, 12, 31, 23, 0, 0),
+ Time.xmlschema("1999-12-31T23:00:00Z"))
+ assert_equal(Time.local(2000, 1, 16, 12, 0, 0),
+ Time.xmlschema("2000-01-16T12:00:00"))
+ assert_equal(Time.local(2000, 1, 16, 0, 0, 0),
+ Time.xmlschema("2000-01-16T00:00:00"))
+ assert_equal(Time.utc(2000, 1, 12, 12, 13, 14),
+ Time.xmlschema("2000-01-12T12:13:14Z"))
+ assert_equal(Time.utc(2001, 4, 17, 19, 23, 17, 300000),
+ Time.xmlschema("2001-04-17T19:23:17.3Z"))
+ end
+
+ def test_encode_xmlschema
+ t = Time.utc(2001, 4, 17, 19, 23, 17, 300000)
+ assert_equal("2001-04-17T19:23:17Z", t.xmlschema)
+ assert_equal("2001-04-17T19:23:17.3Z", t.xmlschema(1))
+ assert_equal("2001-04-17T19:23:17.300000Z", t.xmlschema(6))
+ assert_equal("2001-04-17T19:23:17.3000000Z", t.xmlschema(7))
+
+ t = Time.utc(2001, 4, 17, 19, 23, 17, 123456)
+ assert_equal("2001-04-17T19:23:17.1234560Z", t.xmlschema(7))
+ assert_equal("2001-04-17T19:23:17.123456Z", t.xmlschema(6))
+ assert_equal("2001-04-17T19:23:17.12345Z", t.xmlschema(5))
+ assert_equal("2001-04-17T19:23:17.1Z", t.xmlschema(1))
+
+ begin
+ Time.at(-1)
+ rescue ArgumentError
+ # ignore
+ else
+ t = Time.utc(1960, 12, 31, 23, 0, 0, 123456)
+ assert_equal("1960-12-31T23:00:00.123456Z", t.xmlschema(6))
+ end
+
+ assert_equal(249, Time.xmlschema("2008-06-05T23:49:23.000249+09:00").usec)
+ end
+
+ def test_completion
+ now = Time.local(2001,11,29,21,26,35)
+ assert_equal(Time.local( 2001,11,29,21,12),
+ Time.parse("2001/11/29 21:12", now))
+ assert_equal(Time.local( 2001,11,29),
+ Time.parse("2001/11/29", now))
+ assert_equal(Time.local( 2001,11,29),
+ Time.parse( "11/29", now))
+ #assert_equal(Time.local(2001,11,1), Time.parse("Nov", now))
+ assert_equal(Time.local( 2001,11,29,10,22),
+ Time.parse( "10:22", now))
+ end
+
+ def test_invalid
+ # They were actually used in some web sites.
+ assert_raise(ArgumentError) { Time.httpdate("1 Dec 2001 10:23:57 GMT") }
+ assert_raise(ArgumentError) { Time.httpdate("Sat, 1 Dec 2001 10:25:42 GMT") }
+ assert_raise(ArgumentError) { Time.httpdate("Sat, 1-Dec-2001 10:53:55 GMT") }
+ assert_raise(ArgumentError) { Time.httpdate("Saturday, 01-Dec-2001 10:15:34 GMT") }
+ assert_raise(ArgumentError) { Time.httpdate("Saturday, 01-Dec-101 11:10:07 GMT") }
+ assert_raise(ArgumentError) { Time.httpdate("Fri, 30 Nov 2001 21:30:00 JST") }
+
+ # They were actually used in some mails.
+ assert_raise(ArgumentError) { Time.rfc2822("01-5-20") }
+ assert_raise(ArgumentError) { Time.rfc2822("7/21/00") }
+ assert_raise(ArgumentError) { Time.rfc2822("2001-8-28") }
+ assert_raise(ArgumentError) { Time.rfc2822("00-5-6 1:13:06") }
+ assert_raise(ArgumentError) { Time.rfc2822("2001-9-27 9:36:49") }
+ assert_raise(ArgumentError) { Time.rfc2822("2000-12-13 11:01:11") }
+ assert_raise(ArgumentError) { Time.rfc2822("2001/10/17 04:29:55") }
+ assert_raise(ArgumentError) { Time.rfc2822("9/4/2001 9:23:19 PM") }
+ assert_raise(ArgumentError) { Time.rfc2822("01 Nov 2001 09:04:31") }
+ assert_raise(ArgumentError) { Time.rfc2822("13 Feb 2001 16:4 GMT") }
+ assert_raise(ArgumentError) { Time.rfc2822("01 Oct 00 5:41:19 PM") }
+ assert_raise(ArgumentError) { Time.rfc2822("2 Jul 00 00:51:37 JST") }
+ assert_raise(ArgumentError) { Time.rfc2822("01 11 2001 06:55:57 -0500") }
+ assert_raise(ArgumentError) { Time.rfc2822("18 \343\366\356\341\370 2000") }
+ assert_raise(ArgumentError) { Time.rfc2822("Fri, Oct 2001 18:53:32") }
+ assert_raise(ArgumentError) { Time.rfc2822("Fri, 2 Nov 2001 03:47:54") }
+ assert_raise(ArgumentError) { Time.rfc2822("Fri, 27 Jul 2001 11.14.14 +0200") }
+ assert_raise(ArgumentError) { Time.rfc2822("Thu, 2 Nov 2000 04:13:53 -600") }
+ assert_raise(ArgumentError) { Time.rfc2822("Wed, 5 Apr 2000 22:57:09 JST") }
+ assert_raise(ArgumentError) { Time.rfc2822("Mon, 11 Sep 2000 19:47:33 00000") }
+ assert_raise(ArgumentError) { Time.rfc2822("Fri, 28 Apr 2000 20:40:47 +-900") }
+ assert_raise(ArgumentError) { Time.rfc2822("Fri, 19 Jan 2001 8:15:36 AM -0500") }
+ assert_raise(ArgumentError) { Time.rfc2822("Thursday, Sep 27 2001 7:42:35 AM EST") }
+ assert_raise(ArgumentError) { Time.rfc2822("3/11/2001 1:31:57 PM Pacific Daylight Time") }
+ assert_raise(ArgumentError) { Time.rfc2822("Mi, 28 Mrz 2001 11:51:36") }
+ assert_raise(ArgumentError) { Time.rfc2822("P, 30 sept 2001 23:03:14") }
+ assert_raise(ArgumentError) { Time.rfc2822("fr, 11 aug 2000 18:39:22") }
+ assert_raise(ArgumentError) { Time.rfc2822("Fr, 21 Sep 2001 17:44:03 -1000") }
+ assert_raise(ArgumentError) { Time.rfc2822("Mo, 18 Jun 2001 19:21:40 -1000") }
+ assert_raise(ArgumentError) { Time.rfc2822("l\366, 12 aug 2000 18:53:20") }
+ assert_raise(ArgumentError) { Time.rfc2822("l\366, 26 maj 2001 00:15:58") }
+ assert_raise(ArgumentError) { Time.rfc2822("Dom, 30 Sep 2001 17:36:30") }
+ assert_raise(ArgumentError) { Time.rfc2822("%&, 31 %2/ 2000 15:44:47 -0500") }
+ assert_raise(ArgumentError) { Time.rfc2822("dom, 26 ago 2001 03:57:07 -0300") }
+ assert_raise(ArgumentError) { Time.rfc2822("ter, 04 set 2001 16:27:58 -0300") }
+ assert_raise(ArgumentError) { Time.rfc2822("Wen, 3 oct 2001 23:17:49 -0400") }
+ assert_raise(ArgumentError) { Time.rfc2822("Wen, 3 oct 2001 23:17:49 -0400") }
+ assert_raise(ArgumentError) { Time.rfc2822("ele, 11 h: 2000 12:42:15 -0500") }
+ assert_raise(ArgumentError) { Time.rfc2822("Tue, 14 Aug 2001 3:55:3 +0200") }
+ assert_raise(ArgumentError) { Time.rfc2822("Fri, 25 Aug 2000 9:3:48 +0800") }
+ assert_raise(ArgumentError) { Time.rfc2822("Fri, 1 Dec 2000 0:57:50 EST") }
+ assert_raise(ArgumentError) { Time.rfc2822("Mon, 7 May 2001 9:39:51 +0200") }
+ assert_raise(ArgumentError) { Time.rfc2822("Wed, 1 Aug 2001 16:9:15 +0200") }
+ assert_raise(ArgumentError) { Time.rfc2822("Wed, 23 Aug 2000 9:17:36 +0800") }
+ assert_raise(ArgumentError) { Time.rfc2822("Fri, 11 Aug 2000 10:4:42 +0800") }
+ assert_raise(ArgumentError) { Time.rfc2822("Sat, 15 Sep 2001 13:22:2 +0300") }
+ assert_raise(ArgumentError) { Time.rfc2822("Wed,16 \276\305\324\302 2001 20:06:25 +0800") }
+ assert_raise(ArgumentError) { Time.rfc2822("Wed,7 \312\256\322\273\324\302 2001 23:47:22 +0800") }
+ assert_raise(ArgumentError) { Time.rfc2822("=?iso-8859-1?Q?(=C5=DA),?= 10 2 2001 23:32:26 +0900 (JST)") }
+ assert_raise(ArgumentError) { Time.rfc2822("\307\341\314\343\332\311, 30 \344\346\335\343\310\321 2001 10:01:06") }
+ assert_raise(ArgumentError) { Time.rfc2822("=?iso-8859-1?Q?(=BF=E5),?= 12 =?iso-8859-1?Q?9=B7=EE?= 2001 14:52:41\n+0900 (JST)") }
+ end
+
+ def test_zone_0000
+ assert_equal(true, Time.parse("2000-01-01T00:00:00Z").utc?)
+ assert_equal(true, Time.parse("2000-01-01T00:00:00-00:00").utc?)
+ assert_equal(false, Time.parse("2000-01-01T00:00:00+00:00").utc?)
+ assert_equal(false, Time.parse("Sat, 01 Jan 2000 00:00:00 GMT").utc?)
+ assert_equal(true, Time.parse("Sat, 01 Jan 2000 00:00:00 -0000").utc?)
+ assert_equal(false, Time.parse("Sat, 01 Jan 2000 00:00:00 +0000").utc?)
+ assert_equal(false, Time.rfc2822("Sat, 01 Jan 2000 00:00:00 GMT").utc?)
+ assert_equal(true, Time.rfc2822("Sat, 01 Jan 2000 00:00:00 -0000").utc?)
+ assert_equal(false, Time.rfc2822("Sat, 01 Jan 2000 00:00:00 +0000").utc?)
+ assert_equal(true, Time.rfc2822("Sat, 01 Jan 2000 00:00:00 UTC").utc?)
+ end
+
+ def test_parse_leap_second
+ t = Time.utc(1998,12,31,23,59,59)
+ assert_equal(t, Time.parse("Thu Dec 31 23:59:59 UTC 1998"))
+ assert_equal(t, Time.parse("Fri Dec 31 23:59:59 -0000 1998"));t.localtime
+ assert_equal(t, Time.parse("Fri Jan 1 08:59:59 +0900 1999"))
+ assert_equal(t, Time.parse("Fri Jan 1 00:59:59 +0100 1999"))
+ assert_equal(t, Time.parse("Fri Dec 31 23:59:59 +0000 1998"))
+ assert_equal(t, Time.parse("Fri Dec 31 22:59:59 -0100 1998"));t.utc
+ t += 1
+ assert_equal(t, Time.parse("Thu Dec 31 23:59:60 UTC 1998"))
+ assert_equal(t, Time.parse("Fri Dec 31 23:59:60 -0000 1998"));t.localtime
+ assert_equal(t, Time.parse("Fri Jan 1 08:59:60 +0900 1999"))
+ assert_equal(t, Time.parse("Fri Jan 1 00:59:60 +0100 1999"))
+ assert_equal(t, Time.parse("Fri Dec 31 23:59:60 +0000 1998"))
+ assert_equal(t, Time.parse("Fri Dec 31 22:59:60 -0100 1998"));t.utc
+ t += 1 if t.sec == 60
+ assert_equal(t, Time.parse("Thu Jan 1 00:00:00 UTC 1999"))
+ assert_equal(t, Time.parse("Fri Jan 1 00:00:00 -0000 1999"));t.localtime
+ assert_equal(t, Time.parse("Fri Jan 1 09:00:00 +0900 1999"))
+ assert_equal(t, Time.parse("Fri Jan 1 01:00:00 +0100 1999"))
+ assert_equal(t, Time.parse("Fri Jan 1 00:00:00 +0000 1999"))
+ assert_equal(t, Time.parse("Fri Dec 31 23:00:00 -0100 1998"))
+ end
+
+ def test_rfc2822_leap_second
+ t = Time.utc(1998,12,31,23,59,59)
+ assert_equal(t, Time.rfc2822("Thu, 31 Dec 1998 23:59:59 UTC"))
+ assert_equal(t, Time.rfc2822("Fri, 31 Dec 1998 23:59:59 -0000"));t.localtime
+ assert_equal(t, Time.rfc2822("Fri, 1 Jan 1999 08:59:59 +0900"))
+ assert_equal(t, Time.rfc2822("Fri, 1 Jan 1999 00:59:59 +0100"))
+ assert_equal(t, Time.rfc2822("Fri, 31 Dec 1998 23:59:59 +0000"))
+ assert_equal(t, Time.rfc2822("Fri, 31 Dec 1998 22:59:59 -0100"));t.utc
+ t += 1
+ assert_equal(t, Time.rfc2822("Thu, 31 Dec 1998 23:59:60 UTC"))
+ assert_equal(t, Time.rfc2822("Fri, 31 Dec 1998 23:59:60 -0000"));t.localtime
+ assert_equal(t, Time.rfc2822("Fri, 1 Jan 1999 08:59:60 +0900"))
+ assert_equal(t, Time.rfc2822("Fri, 1 Jan 1999 00:59:60 +0100"))
+ assert_equal(t, Time.rfc2822("Fri, 31 Dec 1998 23:59:60 +0000"))
+ assert_equal(t, Time.rfc2822("Fri, 31 Dec 1998 22:59:60 -0100"));t.utc
+ t += 1 if t.sec == 60
+ assert_equal(t, Time.rfc2822("Thu, 1 Jan 1999 00:00:00 UTC"))
+ assert_equal(t, Time.rfc2822("Fri, 1 Jan 1999 00:00:00 -0000"));t.localtime
+ assert_equal(t, Time.rfc2822("Fri, 1 Jan 1999 09:00:00 +0900"))
+ assert_equal(t, Time.rfc2822("Fri, 1 Jan 1999 01:00:00 +0100"))
+ assert_equal(t, Time.rfc2822("Fri, 1 Jan 1999 00:00:00 +0000"))
+ assert_equal(t, Time.rfc2822("Fri, 31 Dec 1998 23:00:00 -0100"))
+ end
+
+ def test_xmlschema_leap_second
+ t = Time.utc(1998,12,31,23,59,59)
+ assert_equal(t, Time.xmlschema("1998-12-31T23:59:59Z"))
+ assert_equal(t, Time.xmlschema("1998-12-31T23:59:59-00:00"));t.localtime
+ assert_equal(t, Time.xmlschema("1999-01-01T08:59:59+09:00"))
+ assert_equal(t, Time.xmlschema("1999-01-01T00:59:59+01:00"))
+ assert_equal(t, Time.xmlschema("1998-12-31T23:59:59+00:00"))
+ assert_equal(t, Time.xmlschema("1998-12-31T22:59:59-01:00"));t.utc
+ t += 1
+ assert_equal(t, Time.xmlschema("1998-12-31T23:59:60Z"))
+ assert_equal(t, Time.xmlschema("1998-12-31T23:59:60-00:00"));t.localtime
+ assert_equal(t, Time.xmlschema("1999-01-01T08:59:60+09:00"))
+ assert_equal(t, Time.xmlschema("1999-01-01T00:59:60+01:00"))
+ assert_equal(t, Time.xmlschema("1998-12-31T23:59:60+00:00"))
+ assert_equal(t, Time.xmlschema("1998-12-31T22:59:60-01:00"));t.utc
+ t += 1 if t.sec == 60
+ assert_equal(t, Time.xmlschema("1999-01-01T00:00:00Z"))
+ assert_equal(t, Time.xmlschema("1999-01-01T00:00:00-00:00"));t.localtime
+ assert_equal(t, Time.xmlschema("1999-01-01T09:00:00+09:00"))
+ assert_equal(t, Time.xmlschema("1999-01-01T01:00:00+01:00"))
+ assert_equal(t, Time.xmlschema("1999-01-01T00:00:00+00:00"))
+ assert_equal(t, Time.xmlschema("1998-12-31T23:00:00-01:00"))
+ end
+
+ def test_ruby_talk_152866
+ t = Time::xmlschema('2005-08-30T22:48:00-07:00')
+ assert_equal(31, t.day)
+ assert_equal(8, t.mon)
+ end
+
+ def test_parse_fraction
+ assert_equal(500000, Time.parse("2000-01-01T00:00:00.5+00:00").tv_usec)
+ end
+ end
+end
diff --git a/lib/timeout.rb b/lib/timeout.rb
index 893b5f8f58..5a99c28092 100644
--- a/lib/timeout.rb
+++ b/lib/timeout.rb
@@ -1,30 +1,38 @@
+#--
# = timeout.rb
#
# execution timeout
#
-# = Synopsis
+# = Copyright
#
-# require 'timeout'
-# status = Timeout::timeout(5) {
-# # Something that should be interrupted if it takes too much time...
-# }
+# Copyright:: (C) 2000 Network Applied Communication Laboratory, Inc.
+# Copyright:: (C) 2000 Information-technology Promotion Agency, Japan
+#
+#++
#
# = Description
#
-# A way of performing a potentially long-running operation in a thread, and terminating
-# it's execution if it hasn't finished by a fixed amount of time.
+# A way of performing a potentially long-running operation in a thread, and
+# terminating it's execution if it hasn't finished within fixed amount of
+# time.
#
-# Previous versions of timeout didn't provide use a module for namespace. This version
+# Previous versions of timeout didn't use a module for namespace. This version
# provides both Timeout.timeout, and a backwards-compatible #timeout.
#
-# = Copyright
+# = Synopsis
+#
+# require 'timeout'
+# status = Timeout::timeout(5) {
+# # Something that should be interrupted if it takes too much time...
+# }
#
-# Copyright:: (C) 2000 Network Applied Communication Laboratory, Inc.
-# Copyright:: (C) 2000 Information-technology Promotion Agency, Japan
module Timeout
+
+ ##
# Raised by Timeout#timeout when the block times out.
- class Error < RuntimeError
+
+ class Error < Interrupt
end
class ExitException < ::Exception # :nodoc:
end
@@ -32,16 +40,18 @@ module Timeout
THIS_FILE = /\A#{Regexp.quote(__FILE__)}:/o
CALLER_OFFSET = ((c = caller[0]) && THIS_FILE =~ c) ? 1 : 0
- # Executes the method's block. If the block execution terminates before
- # +sec+ seconds has passed, it returns the result value of the block.
- # If not, it terminates the execution and raises +exception+ (which defaults
- # to Timeout::Error).
+ ##
+ # Executes the method's block. If the block execution terminates before +sec+
+ # seconds has passed, it returns true. If not, it terminates the execution
+ # and raises +exception+ (which defaults to Timeout::Error).
#
- # Note that this is both a method of module Timeout, so you can 'include Timeout'
- # into your classes so they have a #timeout method, as well as a module method,
- # so you can call it directly as Timeout.timeout().
- def timeout(sec, klass = nil) #:yield: +sec+
- return yield(sec) if sec == nil or sec.zero?
+ # Note that this is both a method of module Timeout, so you can 'include
+ # Timeout' into your classes so they have a #timeout method, as well as a
+ # module method, so you can call it directly as Timeout.timeout().
+
+ def timeout(sec, klass = nil)
+ return yield if sec == nil or sec.zero?
+ raise ThreadError, "timeout within critical session" if Thread.critical
exception = klass || Class.new(ExitException)
begin
x = Thread.current
@@ -49,7 +59,8 @@ module Timeout
sleep sec
x.raise exception, "execution expired" if x.alive?
}
- return yield(sec)
+ yield sec
+ # return true
rescue exception => e
rej = /\A#{Regexp.quote(__FILE__)}:#{__LINE__-4}\z/o
(bt = e.backtrace).reject! {|m| rej =~ m}
@@ -62,29 +73,31 @@ module Timeout
# would be expected outside.
raise Error, e.message, e.backtrace
ensure
- if y and y.alive?
- y.kill
- y.join # make sure y is dead.
- end
+ y.kill if y and y.alive?
end
end
module_function :timeout
+
end
+##
# Identical to:
#
# Timeout::timeout(n, e, &block).
#
# Defined for backwards compatibility with earlier versions of timeout.rb, see
# Timeout#timeout.
-def timeout(n, e = nil, &block)
+
+def timeout(n, e = nil, &block) # :nodoc:
Timeout::timeout(n, e, &block)
end
+##
# Another name for Timeout::Error, defined for backwards compatibility with
# earlier versions of timeout.rb.
-TimeoutError = Timeout::Error
+
+TimeoutError = Timeout::Error # :nodoc:
if __FILE__ == $0
p timeout(5) {
@@ -106,3 +119,4 @@ if __FILE__ == $0
}
}
end
+
diff --git a/lib/tmpdir.rb b/lib/tmpdir.rb
index 0d247bdd54..bcd66ab424 100644
--- a/lib/tmpdir.rb
+++ b/lib/tmpdir.rb
@@ -18,17 +18,17 @@ class Dir
begin
getdir = Win32API.new('shell32', 'SHGetFolderPath', 'LLLLP', 'L')
raise RuntimeError if getdir.call(0, CSIDL_LOCAL_APPDATA, 0, 0, windir) != 0
- windir.rstrip!
+ windir = File.expand_path(windir.rstrip)
rescue RuntimeError
begin
getdir = Win32API.new('kernel32', 'GetSystemWindowsDirectory', 'PL', 'L')
rescue RuntimeError
getdir = Win32API.new('kernel32', 'GetWindowsDirectory', 'PL', 'L')
end
- windir[getdir.call(windir, windir.size)..-1] = ""
+ len = getdir.call(windir, windir.size)
+ windir = File.expand_path(windir[0, len])
end
- windir.force_encoding(Dir.pwd.encoding)
- temp = File.expand_path('temp', windir.untaint)
+ temp = File.join(windir.untaint, 'temp')
@@systmpdir = temp if File.directory?(temp) and File.writable?(temp)
rescue LoadError
end
@@ -41,11 +41,12 @@ class Dir
if $SAFE > 0
tmp = @@systmpdir
else
- for dir in [ENV['TMPDIR'], ENV['TMP'], ENV['TEMP'], @@systmpdir, '/tmp']
- if dir and stat = File.stat(dir) and stat.directory? and stat.writable?
+ for dir in [ENV['TMPDIR'], ENV['TMP'], ENV['TEMP'],
+ ENV['USERPROFILE'], @@systmpdir, '/tmp']
+ if dir and File.directory?(dir) and File.writable?(dir)
tmp = dir
break
- end rescue nil
+ end
end
File.expand_path(tmp)
end
diff --git a/lib/tracer.rb b/lib/tracer.rb
index 8e6586d7c6..71aa49c306 100644
--- a/lib/tracer.rb
+++ b/lib/tracer.rb
@@ -1,12 +1,13 @@
#
-# tracer.rb -
+# tracer.rb -
# $Release Version: 0.2$
# $Revision: 1.8 $
+# $Date: 1998/05/19 03:42:49 $
# by Keiju ISHITSUKA(Nippon Rational Inc.)
#
# --
#
-#
+#
#
#
@@ -18,11 +19,11 @@ class Tracer
@stdout = STDOUT
@verbose = false
class << self
- attr_accessor :verbose
+ attr :verbose, true
alias verbose? verbose
- attr_accessor :stdout
+ attr :stdout, true
end
-
+
EVENT_SYMBOL = {
"line" => "-",
"call" => ">",
@@ -32,7 +33,7 @@ class Tracer
"c-call" => ">",
"c-return" => "<",
}
-
+
def initialize
@threads = Hash.new
if defined? Thread.main
@@ -45,7 +46,7 @@ class Tracer
@filters = []
end
-
+
def stdout
Tracer.stdout
end
@@ -63,7 +64,7 @@ class Tracer
stdout.print "Trace on\n" if Tracer.verbose?
end
end
-
+
def off
set_trace_func nil
stdout.print "Trace off\n" if Tracer.verbose?
@@ -76,7 +77,7 @@ class Tracer
def set_get_line_procs(file, p = proc)
@get_line_procs[file] = p
end
-
+
def get_line(file, line)
if p = @get_line_procs[file]
return p.call(line)
@@ -85,7 +86,7 @@ class Tracer
unless list = SCRIPT_LINES__[file]
begin
f = open(file)
- begin
+ begin
SCRIPT_LINES__[file] = list = f.readlines
ensure
f.close
@@ -101,7 +102,7 @@ class Tracer
"-\n"
end
end
-
+
def get_thread_no
if no = @threads[Thread.current.object_id]
no
@@ -109,16 +110,16 @@ class Tracer
@threads[Thread.current.object_id] = @threads.size
end
end
-
+
def trace_func(event, file, line, id, binding, klass, *)
return if file == __FILE__
-
+
for p in @filters
return unless p.call event, file, line, id, binding, klass
end
-
- # saved_crit = Thread.critical
- # Thread.critical = true
+
+ saved_crit = Thread.critical
+ Thread.critical = true
stdout.printf("#%d:%s:%d:%s:%s: %s",
get_thread_no,
file,
@@ -126,7 +127,7 @@ class Tracer
klass || '',
EVENT_SYMBOL[event],
get_line(file, line))
- # Thread.critical = saved_crit
+ Thread.critical = saved_crit
end
Single = new
@@ -137,11 +138,11 @@ class Tracer
Single.on
end
end
-
+
def Tracer.off
Single.off
end
-
+
def Tracer.set_get_line_procs(file_name, p = proc)
Single.set_get_line_procs(file_name, p)
end
@@ -149,14 +150,14 @@ class Tracer
def Tracer.add_filter(p = proc)
Single.add_filter(p)
end
-
+
end
SCRIPT_LINES__ = {} unless defined? SCRIPT_LINES__
if $0 == __FILE__
# direct call
-
+
$0 = ARGV[0]
ARGV.shift
Tracer.on
diff --git a/lib/tsort.rb b/lib/tsort.rb
index d0f3cd4caa..a014e7f6c2 100644
--- a/lib/tsort.rb
+++ b/lib/tsort.rb
@@ -1,3 +1,4 @@
+#!/usr/bin/env ruby
#--
# tsort.rb - provides a module for topological sorting and strongly connected components.
#++
@@ -31,7 +32,7 @@
# array using the user-supplied block.
#
# require 'tsort'
-#
+#
# class Hash
# include TSort
# alias tsort_each_node each_key
@@ -39,10 +40,10 @@
# fetch(node).each(&block)
# end
# end
-#
+#
# {1=>[2, 3], 2=>[3], 3=>[], 4=>[]}.tsort
# #=> [3, 2, 1, 4]
-#
+#
# {1=>[2], 2=>[3, 4], 3=>[2], 4=>[]}.strongly_connected_components
# #=> [[4], [2, 3], [1]]
#
@@ -51,19 +52,19 @@
# A very simple `make' like tool can be implemented as follows:
#
# require 'tsort'
-#
+#
# class Make
# def initialize
# @dep = {}
# @dep.default = []
# end
-#
+#
# def rule(outputs, inputs=[], &block)
# triple = [outputs, inputs, block]
# outputs.each {|f| @dep[f] = [triple]}
# @dep[triple] = inputs
# end
-#
+#
# def build(target)
# each_strongly_connected_component_from(target) {|ns|
# if ns.length != 1
@@ -87,18 +88,18 @@
# end
# }
# end
-#
+#
# def tsort_each_child(node, &block)
# @dep[node].each(&block)
# end
# include TSort
# end
-#
+#
# def command(arg)
# print arg, "\n"
# system arg
# end
-#
+#
# m = Make.new
# m.rule(%w[t1]) { command 'date > t1' }
# m.rule(%w[t2]) { command 'date > t2' }
@@ -188,7 +189,7 @@ module TSort
end
#
- # Iterates over strongly connected component in the subgraph reachable from
+ # Iterates over strongly connected component in the subgraph reachable from
# _node_.
#
# Return value is unspecified.
@@ -240,3 +241,50 @@ module TSort
raise NotImplementedError.new
end
end
+
+if __FILE__ == $0
+ require 'test/unit'
+
+ class TSortHash < Hash # :nodoc:
+ include TSort
+ alias tsort_each_node each_key
+ def tsort_each_child(node, &block)
+ fetch(node).each(&block)
+ end
+ end
+
+ class TSortArray < Array # :nodoc:
+ include TSort
+ alias tsort_each_node each_index
+ def tsort_each_child(node, &block)
+ fetch(node).each(&block)
+ end
+ end
+
+ class TSortTest < Test::Unit::TestCase # :nodoc:
+ def test_dag
+ h = TSortHash[{1=>[2, 3], 2=>[3], 3=>[]}]
+ assert_equal([3, 2, 1], h.tsort)
+ assert_equal([[3], [2], [1]], h.strongly_connected_components)
+ end
+
+ def test_cycle
+ h = TSortHash[{1=>[2], 2=>[3, 4], 3=>[2], 4=>[]}]
+ assert_equal([[4], [2, 3], [1]],
+ h.strongly_connected_components.map {|nodes| nodes.sort})
+ assert_raise(TSort::Cyclic) { h.tsort }
+ end
+
+ def test_array
+ a = TSortArray[[1], [0], [0], [2]]
+ assert_equal([[0, 1], [2], [3]],
+ a.strongly_connected_components.map {|nodes| nodes.sort})
+
+ a = TSortArray[[], [0]]
+ assert_equal([[0], [1]],
+ a.strongly_connected_components.map {|nodes| nodes.sort})
+ end
+ end
+
+end
+
diff --git a/lib/ubygems.rb b/lib/ubygems.rb
deleted file mode 100644
index fec880f73b..0000000000
--- a/lib/ubygems.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-# This file allows for the running of rubygems with a nice
-# command line look-and-feel: ruby -rubygems foo.rb
-#--
-# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
-# All rights reserved.
-# See LICENSE.txt for permissions.
-#++
-
-
-require 'rubygems'
diff --git a/lib/un.rb b/lib/un.rb
index 0ce88a5c37..9bf6c13146 100644
--- a/lib/un.rb
+++ b/lib/un.rb
@@ -1,11 +1,11 @@
-#
+#
# = un.rb
-#
+#
# Copyright (c) 2003 WATANABE Hirofumi <eban@ruby-lang.org>
-#
+#
# This program is free software.
# You can distribute/modify this program under the same terms of Ruby.
-#
+#
# == Utilities to replace common UNIX commands in Makefiles etc
#
# == SYNOPSIS
@@ -19,8 +19,6 @@
# ruby -run -e install -- [OPTION] SOURCE DEST
# ruby -run -e chmod -- [OPTION] OCTAL-MODE FILE
# ruby -run -e touch -- [OPTION] FILE
-# ruby -run -e wait_writable -- [OPTION] FILE
-# ruby -run -e mkmf -- [OPTION] EXTNAME [OPTION]
# ruby -run -e help [COMMAND]
require "fileutils"
@@ -31,32 +29,30 @@ module FileUtils
@fileutils_output = $stdout
end
-def setup(options = "", *long_options)
+def setup(options = "")
+ ARGV.map! do |x|
+ case x
+ when /^-/
+ x.delete "^-#{options}v"
+ when /[*?\[{]/
+ Dir[x]
+ else
+ x
+ end
+ end
+ ARGV.flatten!
+ ARGV.delete_if{|x| x == "-"}
opt_hash = {}
- argv = []
OptionParser.new do |o|
options.scan(/.:?/) do |s|
- opt_name = s.delete(":").intern
o.on("-" + s.tr(":", " ")) do |val|
- opt_hash[opt_name] = val
- end
- end
- long_options.each do |s|
- opt_name = s[/\A(?:--)?([^\s=]+)/, 1].intern
- o.on(s.sub(/\A(?!--)/, '--')) do |val|
- opt_hash[opt_name] = val
+ opt_hash[s.delete(":").intern] = val
end
end
o.on("-v") do opt_hash[:verbose] = true end
- o.order!(ARGV) do |x|
- if /[*?\[{]/ =~ x
- argv.concat(Dir[x])
- else
- argv << x
- end
- end
+ o.parse!
end
- yield argv, opt_hash
+ yield ARGV, opt_hash
end
##
@@ -158,13 +154,11 @@ end
#
# ruby -run -e rmdir -- [OPTION] DIR
#
-# -p remove DIRECTORY and its ancestors.
# -v verbose
#
def rmdir
- setup("p") do |argv, options|
- options[:parents] = true if options.delete :p
+ setup do |argv, options|
FileUtils.rmdir argv, options
end
end
@@ -220,69 +214,6 @@ def touch
end
##
-# Wait until the file becomes writable.
-#
-# ruby -run -e wait_writable -- [OPTION] FILE
-#
-# -n RETRY count to retry
-# -w SEC each wait time in seconds
-# -v verbose
-#
-
-def wait_writable
- setup("n:w:v") do |argv, options|
- verbose = options[:verbose]
- n = options[:n] and n = Integer(n)
- wait = (wait = options[:w]) ? Float(wait) : 0.2
- argv.each do |file|
- begin
- open(file, "r+b")
- rescue Errno::ENOENT
- break
- rescue Errno::EACCES => e
- raise if n and (n -= 1) <= 0
- puts e
- STDOUT.flush
- sleep wait
- retry
- end
- end
- end
-end
-
-##
-# Create makefile using mkmf.
-#
-# ruby -run -e mkmf -- [OPTION] EXTNAME [OPTION]
-#
-# -d ARGS run dir_config
-# -h ARGS run have_header
-# -l ARGS run have_library
-# -f ARGS run have_func
-# -v ARGS run have_var
-# -t ARGS run have_type
-# -m ARGS run have_macro
-# -c ARGS run have_const
-# --vendor install to vendor_ruby
-#
-
-def mkmf
- setup("d:h:l:f:v:t:m:c:", "vendor") do |argv, options|
- require 'mkmf'
- opt = options[:d] and opt.split(/:/).each {|n| dir_config(*n.split(/,/))}
- opt = options[:h] and opt.split(/:/).each {|n| have_header(*n.split(/,/))}
- opt = options[:l] and opt.split(/:/).each {|n| have_library(*n.split(/,/))}
- opt = options[:f] and opt.split(/:/).each {|n| have_func(*n.split(/,/))}
- opt = options[:v] and opt.split(/:/).each {|n| have_var(*n.split(/,/))}
- opt = options[:t] and opt.split(/:/).each {|n| have_type(*n.split(/,/))}
- opt = options[:m] and opt.split(/:/).each {|n| have_macro(*n.split(/,/))}
- opt = options[:c] and opt.split(/:/).each {|n| have_const(*n.split(/,/))}
- $configure_args["--vendor"] = true if options[:vendor]
- create_makefile(*argv)
- end
-end
-
-##
# Display help message.
#
# ruby -run -e help [COMMAND]
diff --git a/lib/uri.rb b/lib/uri.rb
index 41bb09b467..f7110f18fd 100644
--- a/lib/uri.rb
+++ b/lib/uri.rb
@@ -3,11 +3,11 @@
#
# Author:: Akira Yamada <akira@ruby-lang.org>
# Documentation:: Akira Yamada <akira@ruby-lang.org>, Dmitry V. Sabanin <sdmitry@lrn.ru>
-# License::
+# 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$
-#
+#
# See URI for documentation
#
diff --git a/lib/uri/.document b/lib/uri/.document
deleted file mode 100644
index 214dd2e48f..0000000000
--- a/lib/uri/.document
+++ /dev/null
@@ -1,7 +0,0 @@
-common.rb
-ftp.rb
-generic.rb
-http.rb
-https.rb
-ldap.rb
-mailto.rb
diff --git a/lib/uri/common.rb b/lib/uri/common.rb
index 828b2b8a4a..af6aaf26fb 100644
--- a/lib/uri/common.rb
+++ b/lib/uri/common.rb
@@ -2,7 +2,7 @@
#
# Author:: Akira Yamada <akira@ruby-lang.org>
# Revision:: $Id$
-# License::
+# License::
# You can redistribute it and/or modify it under the same term as Ruby.
#
@@ -34,236 +34,26 @@ module URI
UNRESERVED = "-_.!~*'()#{ALNUM}"
# reserved = ";" | "/" | "?" | ":" | "@" | "&" | "=" | "+" |
# "$" | ","
- # 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 Parser
- include REGEXP
-
- #
- # == Synopsis
- #
- # URI::Parser.new([opts])
- #
- # == Args
- #
- # The constructor accepts a hash as options for parser.
- # Keys of options are pattern names of URI components
- # and values of options are pattern strings.
- # The constructor generetes set of regexps for parsing URIs.
- #
- # You can use the following keys:
- #
- # * <tt>:ESCAPED</tt> (URI::PATTERN::ESCAPED in default)
- # * <tt>:UNRESERVED</tt> (URI::PATTERN::UNRESERVED in default)
- # * <tt>:DOMLABEL</tt> (URI::PATTERN::DOMLABEL in default)
- # * <tt>:TOPLABEL</tt> (URI::PATTERN::TOPLABEL in default)
- # * <tt>:HOSTNAME</tt> (URI::PATTERN::HOSTNAME in default)
- #
- # == Examples
- #
- # p = URI::Parser.new(:ESCPAED => "(?:%[a-fA-F0-9]{2}|%u[a-fA-F0-9]{4})"
- # u = p.parse("http://example.jp/%uABCD") #=> #<URI::HTTP:0xb78cf4f8 URL:http://example.jp/%uABCD>
- # URI.parse(u.to_s) #=> raises URI::InvalidURIError
- #
- # s = "http://examle.com/ABCD"
- # u1 = p.parse(s) #=> #<URI::HTTP:0xb78c3220 URL:http://example.com/ABCD>
- # u2 = URI.parse(s) #=> #<URI::HTTP:0xb78b6d54 URL:http://example.com/ABCD>
- # u1 == u2 #=> true
- # u1.eql?(u2) #=> false
- #
- def initialize(opts = {})
- @pattern = initialize_pattern(opts)
- @pattern.each_value {|v| v.freeze}
- @pattern.freeze
-
- @regexp = initialize_regexp(@pattern)
- @regexp.each_value {|v| v.freeze}
- @regexp.freeze
- end
- attr_reader :pattern, :regexp
-
- def split(uri)
- case uri
- when ''
- # null uri
-
- when @regexp[:ABS_URI]
- scheme, opaque, userinfo, host, port,
- registry, path, query, fragment = $~[1..-1]
-
- # 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 URI(absolute but no scheme): #{uri}"
- end
- if !opaque && (!path && (!host && !registry))
- raise InvalidURIError,
- "bad 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
-
- # 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 URI(is not 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
-
- def parse(uri)
- scheme, userinfo, host, port,
- registry, path, opaque, query, fragment = self.split(uri)
-
- if scheme && URI.scheme_list.include?(scheme.upcase)
- URI.scheme_list[scheme.upcase].new(scheme, userinfo, host, port,
- registry, path, opaque, query,
- fragment, self)
- else
- Generic.new(scheme, userinfo, host, port,
- registry, path, opaque, query,
- fragment, self)
- end
- end
-
- def join(*str)
- u = self.parse(str[0])
- str[1 .. -1].each do |x|
- u = u.merge(x)
- end
- u
- end
-
- def extract(str, schemes = nil, &block)
- if block_given?
- str.scan(make_regexp(schemes)) { yield $& }
- nil
- else
- result = []
- str.scan(make_regexp(schemes)) { result.push $& }
- result
- end
- end
-
- def make_regexp(schemes = nil)
- unless schemes
- @regexp[:ABS_URI_REF]
- else
- /(?=#{Regexp.union(*schemes)}:)#{@pattern[:X_ABS_URI]}/x
- end
- end
-
- 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
-
- def unescape(str, escaped = @regexp[:ESCAPED])
- str.gsub(escaped) { [$&[1, 2].hex].pack('C') }.force_encoding(str.encoding)
- end
-
- @@to_s = Kernel.instance_method(:to_s)
- def inspect
- @@to_s.bind(self).call
- end
-
- private
-
- 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] = domlabel = opts.delete(:DOMLABEL) || PATTERN::DOMLABEL
- ret[:TOPLABEL] = toplabel = opts.delete(:TOPLABEL) || PATTERN::TOPLABEL
- ret[:HOSTNAME] = hostname = opts.delete(:HOSTNAME)
-
- # RFC 2396 (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 = "(?:[#{UNRESERVED}#{RESERVED}]|#{ESCAPED})"
# uric_no_slash = unreserved | escaped | ";" | "?" | ":" | "@" |
# "&" | "=" | "+" | "$" | ","
- ret[:URIC_NO_SLASH] = uric_no_slash = "(?:[#{unreserved};?:@&=+$,]|#{escaped})"
+ URIC_NO_SLASH = "(?:[#{UNRESERVED};?:@&=+$,]|#{ESCAPED})"
# query = *uric
- ret[:QUERY] = query = "#{uric}*"
+ QUERY = "#{URIC}*"
# fragment = *uric
- ret[:FRAGMENT] = fragment = "#{uric}*"
+ FRAGMENT = "#{URIC}*"
+ # domainlabel = alphanum | alphanum *( alphanum | "-" ) alphanum
+ DOMLABEL = "(?:[#{ALNUM}](?:[-#{ALNUM}]*[#{ALNUM}])?)"
+ # toplabel = alpha | alpha *( alphanum | "-" ) alphanum
+ TOPLABEL = "(?:[#{ALPHA}](?:[-#{ALNUM}]*[#{ALNUM}])?)"
# hostname = *( domainlabel "." ) toplabel [ "." ]
- unless hostname
- ret[:HOSTNAME] = hostname = "(?:#{domlabel}\\.)*#{toplabel}\\.?"
- end
+ HOSTNAME = "(?:#{DOMLABEL}\\.)*#{TOPLABEL}\\.?"
# RFC 2373, APPENDIX B:
# IPv6address = hexpart [ ":" IPv4address ]
@@ -276,164 +66,153 @@ module URI
# 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}"
+ IPV4ADDR = "\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}"
# hex4 = 1*4HEXDIG
- hex4 = "[#{PATTERN::HEX}]{1,4}"
+ HEX4 = "[#{HEX}]{1,4}"
# lastpart = hex4 | IPv4address
- lastpart = "(?:#{hex4}|#{ipv4addr})"
+ LASTPART = "(?:#{HEX4}|#{IPV4ADDR})"
# hexseq1 = *( hex4 ":" ) hex4
- hexseq1 = "(?:#{hex4}:)*#{hex4}"
+ HEXSEQ1 = "(?:#{HEX4}:)*#{HEX4}"
# hexseq2 = *( hex4 ":" ) lastpart
- hexseq2 = "(?:#{hex4}:)*#{lastpart}"
+ HEXSEQ2 = "(?:#{HEX4}:)*#{LASTPART}"
# IPv6address = hexseq2 | [ hexseq1 ] "::" [ hexseq2 ]
- ret[:IPV6ADDR] = ipv6addr = "(?:#{hexseq2}|(?:#{hexseq1})?::(?:#{hexseq2})?)"
+ IPV6ADDR = "(?:#{HEXSEQ2}|(?:#{HEXSEQ1})?::(?:#{HEXSEQ2})?)"
# IPv6prefix = ( hexseq1 | [ hexseq1 ] "::" [ hexseq1 ] ) "/" 1*2DIGIT
# unused
# ipv6reference = "[" IPv6address "]" (RFC 2732)
- ret[:IPV6REF] = ipv6ref = "\\[#{ipv6addr}\\]"
+ IPV6REF = "\\[#{IPV6ADDR}\\]"
# host = hostname | IPv4address
# host = hostname | IPv4address | IPv6reference (RFC 2732)
- ret[:HOST] = host = "(?:#{hostname}|#{ipv4addr}|#{ipv6ref})"
+ HOST = "(?:#{HOSTNAME}|#{IPV4ADDR}|#{IPV6REF})"
# port = *digit
- port = '\d*'
+ PORT = '\d*'
# hostport = host [ ":" port ]
- ret[:HOSTPORT] = hostport = "#{host}(?::#{port})?"
+ HOSTPORT = "#{HOST}(?::#{PORT})?"
# userinfo = *( unreserved | escaped |
# ";" | ":" | "&" | "=" | "+" | "$" | "," )
- ret[:USERINFO] = userinfo = "(?:[#{unreserved};:&=+$,]|#{escaped})*"
+ USERINFO = "(?:[#{UNRESERVED};:&=+$,]|#{ESCAPED})*"
# pchar = unreserved | escaped |
# ":" | "@" | "&" | "=" | "+" | "$" | ","
- pchar = "(?:[#{unreserved}:@&=+$,]|#{escaped})"
+ PCHAR = "(?:[#{UNRESERVED}:@&=+$,]|#{ESCAPED})"
# param = *pchar
- param = "#{pchar}*"
+ PARAM = "#{PCHAR}*"
# segment = *pchar *( ";" param )
- segment = "#{pchar}*(?:;#{param})*"
+ SEGMENT = "#{PCHAR}*(?:;#{PARAM})*"
# path_segments = segment *( "/" segment )
- ret[:PATH_SEGMENTS] = path_segments = "#{segment}(?:/#{segment})*"
+ PATH_SEGMENTS = "#{SEGMENT}(?:/#{SEGMENT})*"
# server = [ [ userinfo "@" ] hostport ]
- server = "(?:#{userinfo}@)?#{hostport}"
+ SERVER = "(?:#{USERINFO}@)?#{HOSTPORT}"
# reg_name = 1*( unreserved | escaped | "$" | "," |
# ";" | ":" | "@" | "&" | "=" | "+" )
- ret[:REG_NAME] = reg_name = "(?:[#{unreserved}$,;:@&=+]|#{escaped})+"
+ REG_NAME = "(?:[#{UNRESERVED}$,;:@&=+]|#{ESCAPED})+"
# authority = server | reg_name
- authority = "(?:#{server}|#{reg_name})"
+ AUTHORITY = "(?:#{SERVER}|#{REG_NAME})"
# rel_segment = 1*( unreserved | escaped |
# ";" | "@" | "&" | "=" | "+" | "$" | "," )
- ret[:REL_SEGMENT] = rel_segment = "(?:[#{unreserved};@&=+$,]|#{escaped})+"
+ REL_SEGMENT = "(?:[#{UNRESERVED};@&=+$,]|#{ESCAPED})+"
# scheme = alpha *( alpha | digit | "+" | "-" | "." )
- ret[:SCHEME] = scheme = "[#{PATTERN::ALPHA}][-+.#{PATTERN::ALPHA}\\d]*"
+ SCHEME = "[#{ALPHA}][-+.#{ALPHA}\\d]*"
# abs_path = "/" path_segments
- ret[:ABS_PATH] = abs_path = "/#{path_segments}"
+ ABS_PATH = "/#{PATH_SEGMENTS}"
# rel_path = rel_segment [ abs_path ]
- ret[:REL_PATH] = rel_path = "#{rel_segment}(?:#{abs_path})?"
+ REL_PATH = "#{REL_SEGMENT}(?:#{ABS_PATH})?"
# net_path = "//" authority [ abs_path ]
- ret[:NET_PATH] = net_path = "//#{authority}(?:#{abs_path})?"
+ NET_PATH = "//#{AUTHORITY}(?:#{ABS_PATH})?"
# hier_part = ( net_path | abs_path ) [ "?" query ]
- ret[:HIER_PART] = hier_part = "(?:#{net_path}|#{abs_path})(?:\\?(?:#{query}))?"
+ HIER_PART = "(?:#{NET_PATH}|#{ABS_PATH})(?:\\?(?:#{QUERY}))?"
# opaque_part = uric_no_slash *uric
- ret[:OPAQUE_PART] = opaque_part = "#{uric_no_slash}#{uric}*"
+ OPAQUE_PART = "#{URIC_NO_SLASH}#{URIC}*"
# absoluteURI = scheme ":" ( hier_part | opaque_part )
- ret[:ABS_URI] = abs_uri = "#{scheme}:(?:#{hier_part}|#{opaque_part})"
+ 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})?"
+ REL_URI = "(?:#{NET_PATH}|#{ABS_PATH}|#{REL_PATH})(?:\\?#{QUERY})?"
# URI-reference = [ absoluteURI | relativeURI ] [ "#" fragment ]
- ret[:URI_REF] = uri_ref = "(?:#{abs_uri}|#{rel_uri})?(?:##{fragment})?"
+ URI_REF = "(?:#{ABS_URI}|#{REL_URI})?(?:##{FRAGMENT})?"
- ret[:X_ABS_URI] = "
- (#{scheme}): (?# 1: scheme)
+ # XXX:
+ X_ABS_URI = "
+ (#{PATTERN::SCHEME}): (?# 1: scheme)
(?:
- (#{opaque_part}) (?# 2: opaque)
+ (#{PATTERN::OPAQUE_PART}) (?# 2: opaque)
|
(?:(?:
//(?:
- (?:(?:(#{userinfo})@)? (?# 3: userinfo)
- (?:(#{host})(?::(\\d*))?))? (?# 4: host, 5: port)
+ (?:(?:(#{PATTERN::USERINFO})@)? (?# 3: userinfo)
+ (?:(#{PATTERN::HOST})(?::(\\d*))?))?(?# 4: host, 5: port)
|
- (#{reg_name}) (?# 6: registry)
+ (#{PATTERN::REG_NAME}) (?# 6: registry)
)
|
- (?!//)) (?# XXX: '//' is the mark for hostport)
- (#{abs_path})? (?# 7: path)
- )(?:\\?(#{query}))? (?# 8: query)
+ (?!//)) (?# XXX: '//' is the mark for hostport)
+ (#{PATTERN::ABS_PATH})? (?# 7: path)
+ )(?:\\?(#{PATTERN::QUERY}))? (?# 8: query)
)
- (?:\\#(#{fragment}))? (?# 9: fragment)
+ (?:\\#(#{PATTERN::FRAGMENT}))? (?# 9: fragment)
"
-
- ret[:X_REL_URI] = "
+ X_REL_URI = "
(?:
(?:
//
(?:
- (?:(#{userinfo})@)? (?# 1: userinfo)
- (#{host})?(?::(\\d*))? (?# 2: host, 3: port)
+ (?:(#{PATTERN::USERINFO})@)? (?# 1: userinfo)
+ (#{PATTERN::HOST})?(?::(\\d*))? (?# 2: host, 3: port)
|
- (#{reg_name}) (?# 4: registry)
+ (#{PATTERN::REG_NAME}) (?# 4: registry)
)
)
|
- (#{rel_segment}) (?# 5: rel_segment)
+ (#{PATTERN::REL_SEGMENT}) (?# 5: rel_segment)
)?
- (#{abs_path})? (?# 6: abs_path)
- (?:\\?(#{query}))? (?# 7: query)
- (?:\\#(#{fragment}))? (?# 8: fragment)
+ (#{PATTERN::ABS_PATH})? (?# 6: abs_path)
+ (?:\\?(#{PATTERN::QUERY}))? (?# 7: query)
+ (?:\\#(#{PATTERN::FRAGMENT}))? (?# 8: fragment)
"
+ # :startdoc:
+ end # PATTERN
- ret
- end
-
- def initialize_regexp(pattern)
- ret = {}
-
- # for URI::split
- ret[:ABS_URI] = Regexp.new('^' + pattern[:X_ABS_URI] + '$', Regexp::EXTENDED)
- ret[:REL_URI] = Regexp.new('^' + pattern[:X_REL_URI] + '$', Regexp::EXTENDED)
-
- # for 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 URI::escape/unescape
- ret[:ESCAPED] = Regexp.new(pattern[:ESCAPED])
- ret[:UNSAFE] = Regexp.new("[^#{pattern[:UNRESERVED]}#{pattern[:RESERVED]}]")
-
- # for Generic#initialize
- ret[:SCHEME] = Regexp.new("^#{pattern[:SCHEME]}$")
- ret[:USERINFO] = Regexp.new("^#{pattern[:USERINFO]}$")
- ret[:HOST] = Regexp.new("^#{pattern[:HOST]}$")
- ret[:PORT] = Regexp.new("^#{pattern[:PORT]}$")
- ret[:OPAQUE] = Regexp.new("^#{pattern[:OPAQUE_PART]}$")
- ret[:REGISTRY] = Regexp.new("^#{pattern[:REG_NAME]}$")
- ret[:ABS_PATH] = Regexp.new("^#{pattern[:ABS_PATH]}$")
- ret[:REL_PATH] = Regexp.new("^#{pattern[:REL_PATH]}$")
- ret[:QUERY] = Regexp.new("^#{pattern[:QUERY]}$")
- ret[:FRAGMENT] = Regexp.new("^#{pattern[:FRAGMENT]}$")
-
- ret
- end
- end # class Parser
-
- 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
+ # :stopdoc:
+
+ # for URI::split
+ ABS_URI = Regexp.new('^' + PATTERN::X_ABS_URI + '$', #'
+ Regexp::EXTENDED, 'N').freeze
+ REL_URI = Regexp.new('^' + PATTERN::X_REL_URI + '$', #'
+ Regexp::EXTENDED, 'N').freeze
+
+ # for URI::extract
+ URI_REF = Regexp.new(PATTERN::URI_REF, false, 'N').freeze
+ ABS_URI_REF = Regexp.new(PATTERN::X_ABS_URI, Regexp::EXTENDED, 'N').freeze
+ REL_URI_REF = Regexp.new(PATTERN::X_REL_URI, Regexp::EXTENDED, 'N').freeze
+
+ # for URI::escape/unescape
+ ESCAPED = Regexp.new(PATTERN::ESCAPED, false, 'N').freeze
+ UNSAFE = Regexp.new("[^#{PATTERN::UNRESERVED}#{PATTERN::RESERVED}]",
+ false, 'N').freeze
+
+ # for Generic#initialize
+ SCHEME = Regexp.new("^#{PATTERN::SCHEME}$", false, 'N').freeze #"
+ USERINFO = Regexp.new("^#{PATTERN::USERINFO}$", false, 'N').freeze #"
+ HOST = Regexp.new("^#{PATTERN::HOST}$", false, 'N').freeze #"
+ PORT = Regexp.new("^#{PATTERN::PORT}$", false, 'N').freeze #"
+ OPAQUE = Regexp.new("^#{PATTERN::OPAQUE_PART}$", false, 'N').freeze #"
+ REGISTRY = Regexp.new("^#{PATTERN::REG_NAME}$", false, 'N').freeze #"
+ ABS_PATH = Regexp.new("^#{PATTERN::ABS_PATH}$", false, 'N').freeze #"
+ REL_PATH = Regexp.new("^#{PATTERN::REL_PATH}$", false, 'N').freeze #"
+ QUERY = Regexp.new("^#{PATTERN::QUERY}$", false, 'N').freeze #"
+ FRAGMENT = Regexp.new("^#{PATTERN::FRAGMENT}$", false, 'N').freeze #"
+ # :startdoc:
+ end # REGEXP
module Util # :nodoc:
def make_components_hash(klass, array_hash)
@@ -457,7 +236,7 @@ module URI
end
end
else
- raise ArgumentError,
+ raise ArgumentError,
"expected Array of or Hash of components of #{klass.to_s} (#{klass.component[1..-1].join(', ')})"
end
tmp[:scheme] = klass.to_s.sub(/\A.*::/, '').downcase
@@ -468,6 +247,8 @@ module URI
end
module Escape
+ include REGEXP
+
#
# == Synopsis
#
@@ -500,8 +281,18 @@ module URI
# p URI.escape("@?@!", "!?")
# # => "@%3F@%21"
#
- def escape(*arg)
- DEFAULT_PARSER.escape(*arg)
+ def escape(str, unsafe = UNSAFE)
+ unless unsafe.kind_of?(Regexp)
+ # perhaps unsafe is String object
+ unsafe = Regexp.new("[#{Regexp.quote(unsafe)}]", false, 'N')
+ end
+ str.gsub(unsafe) do |us|
+ tmp = ''
+ us.each_byte do |uc|
+ tmp << sprintf('%%%02X', uc)
+ end
+ tmp
+ end
end
alias encode escape
#
@@ -525,20 +316,19 @@ module URI
# p URI.unescape(enc_uri)
# # => "http://example.com/?a=\t\r"
#
- def unescape(*arg)
- DEFAULT_PARSER.unescape(*arg)
+ def unescape(str)
+ str.gsub(ESCAPED) do
+ $&[1,2].hex.chr
+ end
end
alias decode unescape
end
- extend Escape
include REGEXP
+ extend Escape
@@schemes = {}
- def self.scheme_list
- @@schemes
- end
-
+
#
# Base class for all URI exceptions.
#
@@ -579,7 +369,7 @@ module URI
# * Opaque
# * Query
# * Fragment
- #
+ #
# == Usage
#
# require 'uri'
@@ -588,7 +378,75 @@ module URI
# # => ["http", nil, "www.ruby-lang.org", nil, nil, "/", nil, nil, nil]
#
def self.split(uri)
- DEFAULT_PARSER.split(uri)
+ case uri
+ when ''
+ # null uri
+
+ when ABS_URI
+ scheme, opaque, userinfo, host, port,
+ registry, path, query, fragment = $~[1..-1]
+
+ # 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 URI(absolute but no scheme): #{uri}"
+ end
+ if !opaque && (!path && (!host && !registry))
+ raise InvalidURIError,
+ "bad URI(absolute but no path): #{uri}"
+ end
+
+ when 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
+
+ # 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 URI(is not 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
#
@@ -604,7 +462,7 @@ module URI
# == Description
#
# Creates one of the URI's subclasses instance from the string.
- #
+ #
# == Raises
#
# URI::InvalidURIError
@@ -617,13 +475,24 @@ module URI
# uri = URI.parse("http://www.ruby-lang.org/")
# p uri
# # => #<URI::HTTP:0x202281be URL:http://www.ruby-lang.org/>
- # p uri.scheme
- # # => "http"
- # p uri.host
- # # => "www.ruby-lang.org"
- #
+ # p uri.scheme
+ # # => "http"
+ # p uri.host
+ # # => "www.ruby-lang.org"
+ #
def self.parse(uri)
- DEFAULT_PARSER.parse(uri)
+ scheme, userinfo, host, port,
+ registry, path, opaque, query, fragment = self.split(uri)
+
+ if scheme && @@schemes.include?(scheme.upcase)
+ @@schemes[scheme.upcase].new(scheme, userinfo, host, port,
+ registry, path, opaque, query,
+ fragment)
+ else
+ Generic.new(scheme, userinfo, host, port,
+ registry, path, opaque, query,
+ fragment)
+ end
end
#
@@ -648,7 +517,11 @@ module URI
# # => #<URI::HTTP:0x2022ac02 URL:http://localhost/main.rbx>
#
def self.join(*str)
- DEFAULT_PARSER.join(*str)
+ u = self.parse(str[0])
+ str[1 .. -1].each do |x|
+ u = u.merge(x)
+ end
+ u
end
#
@@ -658,7 +531,7 @@ module URI
#
# == Args
#
- # +str+::
+ # +str+::
# String to extract URIs from.
# +schemes+::
# Limit URI matching to a specific schemes.
@@ -676,7 +549,14 @@ module URI
# # => ["http://foo.example.com/bla", "mailto:test@example.com"]
#
def self.extract(str, schemes = nil, &block)
- DEFAULT_PARSER.extract(str, schemes, &block)
+ if block_given?
+ str.scan(regexp(schemes)) { yield $& }
+ nil
+ else
+ result = []
+ str.scan(regexp(schemes)) { result.push $& }
+ result
+ end
end
#
@@ -686,32 +566,36 @@ module URI
#
# == Args
#
- # +match_schemes+::
+ # +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 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 'uri'
#
# # extract first URI from html_string
# html_string.slice(URI.regexp)
- #
+ #
# # remove ftp URIs
# html_string.sub(URI.regexp(['ftp'])
- #
+ #
# # You should not rely on the number of parentheses
# html_string.scan(URI.regexp) do |*matches|
# p $&
# end
#
def self.regexp(schemes = nil)
- DEFAULT_PARSER.make_regexp(schemes)
+ unless schemes
+ ABS_URI_REF
+ else
+ /(?=#{Regexp.union(*schemes)}:)#{PATTERN::X_ABS_URI}/xn
+ end
end
end
diff --git a/lib/uri/ftp.rb b/lib/uri/ftp.rb
index a40b958497..1a18e9cae7 100644
--- a/lib/uri/ftp.rb
+++ b/lib/uri/ftp.rb
@@ -17,12 +17,12 @@ module URI
DEFAULT_PORT = 21
COMPONENT = [
- :scheme,
+ :scheme,
:userinfo, :host, :port,
:path, :typecode
].freeze
#
- # Typecode is "a", "i" or "d".
+ # Typecode is "a", "i" or "d".
#
# * "a" indicates a text file (the FTP command was ASCII)
# * "i" indicates a binary file (FTP command IMAGE)
@@ -31,7 +31,7 @@ module URI
TYPECODE = ['a', 'i', 'd'].freeze
TYPECODE_PREFIX = ';type='.freeze
- def self.new2(user, password, host, port, path,
+ def self.new2(user, password, host, port, path,
typecode = nil, arg_check = true)
typecode = nil if typecode.size == 0
if typecode && !TYPECODE.include?(typecode)
@@ -42,22 +42,22 @@ module URI
# do escape
self.new('ftp',
- [user, password],
- host, port, nil,
- typecode ? path + TYPECODE_PREFIX + typecode : path,
+ [user, password],
+ host, port, nil,
+ typecode ? path + TYPECODE_PREFIX + typecode : path,
nil, nil, nil, arg_check)
end
#
# == Description
#
- # Creates a new URI::FTP object from components, with syntax checking.
+ # Creates a new URI::FTP object from components, with syntax checking.
#
- # The components accepted are +userinfo+, +host+, +port+, +path+ and
+ # 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.
+ # 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
# [userinfo, host, port, path, typecode]
@@ -67,11 +67,11 @@ module URI
#
# require 'uri'
#
- # uri = URI::FTP.build(['user:password', 'ftp.example.com', nil,
+ # uri = URI::FTP.build(['user:password', 'ftp.example.com', nil,
# '/path/file.> zip', 'i'])
# puts uri.to_s -> ftp://user:password@ftp.example.com/%2Fpath/file.zip;type=a
#
- # uri2 = URI::FTP.build({:host => 'ftp.example.com',
+ # uri2 = URI::FTP.build({:host => 'ftp.example.com',
# :path => 'ruby/src'})
# puts uri2.to_s -> ftp://ftp.example.com/ruby/src
#
@@ -92,7 +92,7 @@ module URI
if tmp[:typecode]
if tmp[:typecode].size == 1
- tmp[:typecode] = TYPECODE_PREFIX + tmp[:typecode]
+ tmp[:typecode] = TYPECODE_PREFIX + tmp[:typecode]
end
tmp[:path] << tmp[:typecode]
end
@@ -109,7 +109,7 @@ module URI
# 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+,
+ # Arguments are +scheme+, +userinfo+, +host+, +port+, +registry+, +path+,
# +opaque+, +query+ and +fragment+, in that order.
#
def initialize(*arg)
@@ -119,7 +119,7 @@ module URI
if tmp
typecode = @path[tmp + TYPECODE_PREFIX.size..-1]
self.set_path(@path[0..tmp - 1])
-
+
if arg[-1]
self.typecode = typecode
else
@@ -164,9 +164,9 @@ module URI
# RFC 1738 specifically states that the path for an FTP URI does not
# include the / which separates the URI path from the URI host. Example:
#
- # ftp://ftp.example.com/pub/ruby
+ # ftp://ftp.example.com/pub/ruby
#
- # The above URI indicates that the client should connect to
+ # The above URI indicates that the client should connect to
# ftp.example.com then cd pub/ruby from the initial login directory.
#
# If you want to cd to an absolute directory, you must include an
@@ -177,7 +177,7 @@ module URI
# This method will then return "/pub/ruby"
#
def path
- return @path.sub(/^\//,'').sub(/^%2F/,'/')
+ return @path.sub(/^\//,'').sub(/^%2F/i,'/')
end
def to_s
diff --git a/lib/uri/generic.rb b/lib/uri/generic.rb
index fd01f89797..d907e0b4b2 100644
--- a/lib/uri/generic.rb
+++ b/lib/uri/generic.rb
@@ -9,13 +9,14 @@
require 'uri/common'
module URI
-
+
#
# Base class for all URI classes.
# Implements generic URI syntax as per RFC 2396.
#
class Generic
include URI
+ include REGEXP
DEFAULT_PORT = nil
@@ -31,10 +32,10 @@ module URI
end
COMPONENT = [
- :scheme,
- :userinfo, :host, :port, :registry,
- :path, :opaque,
- :query,
+ :scheme,
+ :userinfo, :host, :port, :registry,
+ :path, :opaque,
+ :query,
:fragment
].freeze
@@ -62,7 +63,7 @@ module URI
# == Description
#
# At first, tries to create a new URI::Generic instance using
- # URI::Generic::build. But, if exception URI::InvalidComponentError is raised,
+ # URI::Generic::build. But, if exception URI::InvalidComponentError is raised,
# then it URI::Escape.escape all URI components and tries again.
#
#
@@ -71,9 +72,9 @@ module URI
return self.build(args)
rescue InvalidComponentError
if args.kind_of?(Array)
- return self.build(args.collect{|x|
+ return self.build(args.collect{|x|
if x
- parser.escape(x)
+ URI.escape(x)
else
x
end
@@ -82,7 +83,7 @@ module URI
tmp = {}
args.each do |key, value|
tmp[key] = if value
- parser.escape(value)
+ URI.escape(value)
else
value
end
@@ -117,11 +118,10 @@ module URI
end
end
else
- raise ArgumentError,
+ raise ArgumentError,
"expected Array of or Hash of components of #{self.class} (#{self.class.component.join(', ')})"
end
- tmp << nil
tmp << true
return self.new(*tmp)
end
@@ -146,8 +146,6 @@ module URI
# Query data
# +fragment+::
# A part of URI after '#' sign
- # +parser+::
- # Parser for internal use [URI::DEFAULT_PARSER by default]
# +arg_check+::
# Check arguments [false by default]
#
@@ -155,12 +153,11 @@ module URI
#
# Creates a new URI::Generic instance from ``generic'' components without check.
#
- def initialize(scheme,
- userinfo, host, port, registry,
- path, opaque,
- query,
+ def initialize(scheme,
+ userinfo, host, port, registry,
+ path, opaque,
+ query,
fragment,
- parser = DEFAULT_PARSER,
arg_check = false)
@scheme = nil
@user = nil
@@ -172,7 +169,6 @@ module URI
@opaque = nil
@registry = nil
@fragment = nil
- @parser = parser == DEFAULT_PARSER ? nil : parser
if arg_check
self.scheme = scheme
@@ -196,10 +192,10 @@ module URI
self.set_fragment(fragment)
end
if @registry && !self.class.use_registry
- raise InvalidURIError,
+ raise InvalidURIError,
"the scheme #{@scheme} does not accept registry part: #{@registry} (or bad hostname?)"
end
-
+
@scheme.freeze if @scheme
self.set_path('') if !@path && !@opaque # (see RFC2396 Section 5.2)
self.set_port(self.default_port) if self.default_port && !@port
@@ -213,14 +209,6 @@ module URI
attr_reader :opaque
attr_reader :fragment
- def parser
- if !defined?(@parser) || !@parser
- DEFAULT_PARSER
- else
- @parser || DEFAULT_PARSER
- end
- end
-
# replace self by other URI object
def replace!(oth)
if self.class != oth.class
@@ -238,7 +226,7 @@ module URI
end
def check_scheme(v)
- if v && parser.regexp[:SCHEME] !~ v
+ if v && SCHEME !~ v
raise InvalidComponentError,
"bad component(expected scheme component): #{v}"
end
@@ -271,13 +259,13 @@ module URI
def check_user(v)
if @registry || @opaque
- raise InvalidURIError,
+ raise InvalidURIError,
"can not set user with registry or opaque"
end
return v unless v
- if parser.regexp[:USERINFO] !~ v
+ if USERINFO !~ v
raise InvalidComponentError,
"bad component(expected userinfo component or user component): #{v}"
end
@@ -288,7 +276,7 @@ module URI
def check_password(v, user = @user)
if @registry || @opaque
- raise InvalidURIError,
+ raise InvalidURIError,
"can not set password with registry or opaque"
end
return v unless v
@@ -298,7 +286,7 @@ module URI
"password component depends user component"
end
- if parser.regexp[:USERINFO] !~ v
+ if USERINFO !~ v
raise InvalidComponentError,
"bad component(expected user component): #{v}"
end
@@ -324,7 +312,7 @@ module URI
set_user(user)
# returns user
end
-
+
def password=(password)
check_password(password)
set_password(password)
@@ -332,7 +320,7 @@ module URI
end
def set_userinfo(user, password = nil)
- unless password
+ unless password
user, password = split_userinfo(user)
end
@user = user
@@ -363,7 +351,7 @@ module URI
private :split_userinfo
def escape_userpass(v)
- v = parser.escape(v, /[@:\/]/o) # RFC 1738 section 3.1 #/
+ v = URI.escape(v, /[@:\/]/o) # RFC 1738 section 3.1 #/
end
private :escape_userpass
@@ -389,9 +377,9 @@ module URI
return v unless v
if @registry || @opaque
- raise InvalidURIError,
+ raise InvalidURIError,
"can not set host with registry or opaque"
- elsif parser.regexp[:HOST] !~ v
+ elsif HOST !~ v
raise InvalidComponentError,
"bad component(expected host component): #{v}"
end
@@ -415,9 +403,9 @@ module URI
return v unless v
if @registry || @opaque
- raise InvalidURIError,
+ raise InvalidURIError,
"can not set port with registry or opaque"
- elsif !v.kind_of?(Fixnum) && parser.regexp[:PORT] !~ v
+ elsif !v.kind_of?(Fixnum) && PORT !~ v
raise InvalidComponentError,
"bad component(expected port component): #{v}"
end
@@ -451,9 +439,9 @@ module URI
# authority = server | reg_name
# server = [ [ userinfo "@" ] hostport ]
if @host || @port || @user # userinfo = @user + ':' + @password
- raise InvalidURIError,
+ raise InvalidURIError,
"can not set registry with host, port, or userinfo"
- elsif v && parser.regexp[:REGISTRY] !~ v
+ elsif v && REGISTRY !~ v
raise InvalidComponentError,
"bad component(expected registry component): #{v}"
end
@@ -478,18 +466,18 @@ module URI
# absoluteURI = scheme ":" ( hier_part | opaque_part )
# hier_part = ( net_path | abs_path ) [ "?" query ]
if v && @opaque
- raise InvalidURIError,
+ raise InvalidURIError,
"path conflicts with opaque"
end
if @scheme
- if v && v != '' && parser.regexp[:ABS_PATH] !~ v
- raise InvalidComponentError,
+ if v && v != '' && 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,
+ if v && v != '' && ABS_PATH !~ v && REL_PATH !~ v
+ raise InvalidComponentError,
"bad component(expected relative path component): #{v}"
end
end
@@ -516,14 +504,14 @@ module URI
# absoluteURI = scheme ":" ( hier_part | opaque_part )
# hier_part = ( net_path | abs_path ) [ "?" query ]
if @opaque
- raise InvalidURIError,
+ raise InvalidURIError,
"query conflicts with opaque"
end
- if v && v != '' && parser.regexp[:QUERY] !~ v
- raise InvalidComponentError,
+ if v && v != '' && QUERY !~ v
+ raise InvalidComponentError,
"bad component(expected query component): #{v}"
- end
+ end
return true
end
@@ -547,9 +535,9 @@ module URI
# absoluteURI = scheme ":" ( hier_part | opaque_part )
# hier_part = ( net_path | abs_path ) [ "?" query ]
if @host || @port || @user || @path # userinfo = @user + ':' + @password
- raise InvalidURIError,
+ raise InvalidURIError,
"can not set opaque with host, port, userinfo or path"
- elsif v && parser.regexp[:OPAQUE] !~ v
+ elsif v && OPAQUE !~ v
raise InvalidComponentError,
"bad component(expected opaque component): #{v}"
end
@@ -572,8 +560,8 @@ module URI
def check_fragment(v)
return v unless v
- if v && v != '' && parser.regexp[:FRAGMENT] !~ v
- raise InvalidComponentError,
+ if v && v != '' && FRAGMENT !~ v
+ raise InvalidComponentError,
"bad component(expected fragment component): #{v}"
end
@@ -784,19 +772,19 @@ module URI
case oth
when Generic
when String
- oth = parser.parse(oth)
+ oth = URI.parse(oth)
else
raise ArgumentError,
"bad argument(expected URI object or URI string)"
end
if self.relative? && oth.relative?
- raise BadURIError,
+ raise BadURIError,
"both URI are relative"
end
if self.absolute? && oth.absolute?
- #raise BadURIError,
+ #raise BadURIError,
# "both URI are absolute"
# hmm... should return oth for usability?
return oth, oth
@@ -817,7 +805,7 @@ module URI
src_path = split_path(src)
dst_path = split_path(dst)
- # hmm... dst has abnormal absolute path,
+ # hmm... dst has abnormal absolute path,
# like "/./", "/../", "/x/../", ...
if dst_path.include?('..') ||
dst_path.include?('.')
@@ -855,18 +843,18 @@ module URI
case oth
when Generic
when String
- oth = parser.parse(oth)
+ oth = URI.parse(oth)
else
raise ArgumentError,
"bad argument(expected URI object or URI string)"
end
if self.relative?
- raise BadURIError,
+ raise BadURIError,
"relative URI: #{self}"
end
if oth.relative?
- raise BadURIError,
+ raise BadURIError,
"relative URI: #{oth}"
end
@@ -874,9 +862,9 @@ module URI
return self, self.dup
end
rel = URI::Generic.new(nil, # it is relative URI
- self.userinfo, self.host, self.port,
+ self.userinfo, self.host, self.port,
self.registry, self.path, self.opaque,
- self.query, self.fragment, parser)
+ self.query, self.fragment)
if rel.userinfo != oth.userinfo ||
rel.host.to_s.downcase != oth.host.to_s.downcase ||
@@ -962,12 +950,12 @@ module URI
# uri = URI.parse('http://my.example.com')
# p uri.route_to('http://my.example.com/main.rbx?page=1')
# #=> #<URI::Generic:0x2020c2f6 URL:/main.rbx?page=1>
- #
+ #
def route_to(oth)
case oth
when Generic
when String
- oth = parser.parse(oth)
+ oth = URI.parse(oth)
else
raise ArgumentError,
"bad argument(expected URI object or URI string)"
@@ -978,7 +966,7 @@ module URI
#
# Returns normalized URI
- #
+ #
def normalize
uri = dup
uri.normalize!
@@ -994,7 +982,7 @@ module URI
end
if host && host != host.downcase
set_host(self.host.downcase)
- end
+ end
end
def path_query
@@ -1008,7 +996,7 @@ module URI
#
# Constructs String from URI
- #
+ #
def to_s
str = ''
if @scheme
@@ -1066,7 +1054,6 @@ module URI
end
def eql?(oth)
- parser == oth.parser &&
self.component_ary.eql?(oth.component_ary)
end
@@ -1110,7 +1097,7 @@ module URI
if component.include?(c)
self.send(c)
else
- raise ArgumentError,
+ raise ArgumentError,
"expected of components of #{self.class} (#{self.class.component.join(', ')})"
end
end
@@ -1124,7 +1111,7 @@ module URI
def coerce(oth)
case oth
when String
- oth = parser.parse(oth)
+ oth = URI.parse(oth)
else
super
end
diff --git a/lib/uri/http.rb b/lib/uri/http.rb
index 69a7658918..87eb8893f2 100644
--- a/lib/uri/http.rb
+++ b/lib/uri/http.rb
@@ -14,18 +14,18 @@ module URI
# The syntax of HTTP URIs is defined in RFC1738 section 3.3.
#
# Note that the Ruby 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
+ # 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
DEFAULT_PORT = 80
COMPONENT = [
- :scheme,
- :userinfo, :host, :port,
- :path,
- :query,
+ :scheme,
+ :userinfo, :host, :port,
+ :path,
+ :query,
:fragment
].freeze
@@ -37,21 +37,21 @@ module URI
# 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.
+ # 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
# [userinfo, host, port, path, query, fragment].
#
# Example:
#
- # newuri = URI::HTTP.build({:host => 'www.example.com',
+ # newuri = URI::HTTP.build({:host => 'www.example.com',
# :path> => '/foo/bar'})
#
- # newuri = URI::HTTP.build([nil, "www.example.com", nil, "/path",
+ # newuri = URI::HTTP.build([nil, "www.example.com", nil, "/path",
# "query", 'fragment'])
#
- # Currently, if passed userinfo components this method generates
+ # Currently, if passed userinfo components this method generates
# invalid HTTP URIs as per RFC 1738.
#
def self.build(args)
@@ -63,10 +63,10 @@ module URI
# == Description
#
# Create a new URI::HTTP object from generic URI components as per
- # RFC 2396. No HTTP-specific syntax checking (as per RFC 1738) is
+ # RFC 2396. No HTTP-specific syntax checking (as per RFC 1738) is
# performed.
#
- # Arguments are +scheme+, +userinfo+, +host+, +port+, +registry+, +path+,
+ # Arguments are +scheme+, +userinfo+, +host+, +port+, +registry+, +path+,
# +opaque+, +query+ and +fragment+, in that order.
#
# Example:
diff --git a/lib/uri/ldap.rb b/lib/uri/ldap.rb
index 6739a018af..163d2cda24 100644
--- a/lib/uri/ldap.rb
+++ b/lib/uri/ldap.rb
@@ -1,10 +1,10 @@
#
# = uri/ldap.rb
#
-# Author::
+# Author::
# Takaaki Tateishi <ttate@jaist.ac.jp>
# Akira Yamada <akira@ruby-lang.org>
-# License::
+# License::
# 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$
@@ -21,7 +21,7 @@ module URI
class LDAP < Generic
DEFAULT_PORT = 389
-
+
COMPONENT = [
:scheme,
:host, :port,
diff --git a/lib/uri/mailto.rb b/lib/uri/mailto.rb
index 240c849e9a..44f04f2dd5 100644
--- a/lib/uri/mailto.rb
+++ b/lib/uri/mailto.rb
@@ -55,7 +55,7 @@ module URI
(#{PATTERN::FRAGMENT}) (?# 3: fragment)
)?
\\z
- ", Regexp::EXTENDED).freeze
+ ", Regexp::EXTENDED, 'N').freeze
# :startdoc:
#
@@ -68,20 +68,20 @@ module URI
#
# 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
+ # The headers can be supplied as a pre-encoded string, such as
# "subject=subscribe&cc=address", or as an Array of Arrays like
# [['subject', 'subscribe'], ['cc', 'address']]
#
# Examples:
- #
+ #
# require 'uri'
- #
+ #
# m1 = URI::MailTo.build(['joe@example.com', 'subject=Ruby'])
# puts m1.to_s -> mailto:joe@example.com?subject=Ruby
- #
+ #
# m2 = URI::MailTo.build(['john@example.com', [['Subject', 'Ruby'], ['Cc', 'jack@example.com']]])
# puts m2.to_s -> mailto:john@example.com?Subject=Ruby&Cc=jack@example.com
- #
+ #
# m3 = URI::MailTo.build({:to => 'listman@example.com', :headers => [['subject', 'subscribe']]})
# puts m3.to_s -> mailto:listman@example.com?subject=subscribe
#
@@ -135,7 +135,7 @@ module URI
@headers = []
if MAILTO_REGEXP =~ @opaque
- if arg[-1]
+ if arg[-1]
self.to = $1
self.headers = $2
else
@@ -159,7 +159,7 @@ module URI
return true unless v
return true if v.size == 0
- if parser.regexp[:OPAQUE] !~ v || /\A#{MAILBOX_PATTERN}*\z/o !~ v
+ if OPAQUE !~ v || /\A#{MAILBOX_PATTERN}*\z/o !~ v
raise InvalidComponentError,
"bad component(expected opaque component): #{v}"
end
@@ -183,7 +183,7 @@ module URI
return true unless v
return true if v.size == 0
- if parser.regexp[:OPAQUE] !~ v ||
+ if OPAQUE !~ v ||
/\A(#{HEADER_PATTERN}(?:\&#{HEADER_PATTERN})*)\z/o !~ v
raise InvalidComponentError,
"bad component(expected opaque component): #{v}"
@@ -210,12 +210,12 @@ module URI
end
def to_s
- @scheme + ':' +
- if @to
+ @scheme + ':' +
+ if @to
@to
else
''
- end +
+ end +
if @headers.size > 0
'?' + @headers.collect{|x| x.join('=')}.join('&')
else
@@ -227,7 +227,7 @@ module URI
''
end
end
-
+
# Returns the RFC822 e-mail text equivalent of the URL, as a String.
#
# Example:
@@ -239,18 +239,18 @@ module URI
# # => "To: ruby-list@ruby-lang.org\nSubject: subscribe\nCc: myaddr\n\n\n"
#
def to_mailtext
- to = parser.unescape(@to)
+ to = URI::unescape(@to)
head = ''
body = ''
@headers.each do |x|
case x[0]
when 'body'
- body = parser.unescape(x[1])
+ body = URI::unescape(x[1])
when 'to'
- to << ', ' + parser.unescape(x[1])
+ to << ', ' + URI::unescape(x[1])
else
- head << parser.unescape(x[0]).capitalize + ': ' +
- parser.unescape(x[1]) + "\n"
+ head << URI::unescape(x[0]).capitalize + ': ' +
+ URI::unescape(x[1]) + "\n"
end
end
diff --git a/lib/weakref.rb b/lib/weakref.rb
index ba39242445..591819c948 100644
--- a/lib/weakref.rb
+++ b/lib/weakref.rb
@@ -1,6 +1,13 @@
-# Weak Reference class that does not bother GCing.
+require "delegate"
+
+# WeakRef is a class to represent a reference to an object that is not seen by
+# the tracing phase of the garbage collector. This allows the referenced
+# object to be garbage collected as if nothing is referring to it. Because
+# WeakRef delegates method calls to the referenced object, it may be used in
+# place of that object, i.e. it is of the same duck type.
#
# Usage:
+#
# foo = Object.new
# foo = Object.new
# p foo.to_s # original's class
@@ -8,20 +15,18 @@
# p foo.to_s # should be same class
# ObjectSpace.garbage_collect
# p foo.to_s # should raise exception (recycled)
+class WeakRef<Delegator
-require "delegate"
-require 'thread'
-
-class WeakRef < Delegator
-
- class RefError < StandardError
+ # RefError is raised if an object cannot be referenced by a WeakRef.
+ class RefError<StandardError
end
@@id_map = {} # obj -> [ref,...]
@@id_rev_map = {} # ref -> obj
- @@mutex = Mutex.new
- @@final = lambda {|id|
- @@mutex.synchronize {
+ @@final = lambda{|id|
+ __old_status = Thread.critical
+ Thread.critical = true
+ begin
rids = @@id_map[id]
if rids
for rid in rids
@@ -35,46 +40,61 @@ class WeakRef < Delegator
@@id_map[rid].delete(id)
@@id_map.delete(rid) if @@id_map[rid].empty?
end
- }
+ ensure
+ Thread.critical = __old_status
+ end
}
+ # Create a new WeakRef from +orig+.
def initialize(orig)
- @__id = orig.object_id
- ObjectSpace.define_finalizer orig, @@final
- ObjectSpace.define_finalizer self, @@final
- @@mutex.synchronize {
- @@id_map[@__id] = [] unless @@id_map[@__id]
- }
- @@id_map[@__id].push self.object_id
- @@id_rev_map[self.object_id] = @__id
super
+ __setobj__(orig)
end
+ # Return the object this WeakRef references. Raises RefError if the object
+ # has been garbage collected. The object returned is the object to which
+ # method calls are delegated (see Delegator).
def __getobj__
- unless @@id_rev_map[self.object_id] == @__id
- Kernel::raise RefError, "Invalid Reference - probably recycled", Kernel::caller(2)
+ unless @@id_rev_map[self.__id__] == @__id
+ raise RefError, "Illegal Reference - probably recycled", caller(2)
end
begin
ObjectSpace._id2ref(@__id)
rescue RangeError
- Kernel::raise RefError, "Invalid Reference - probably recycled", Kernel::caller(2)
+ raise RefError, "Illegal Reference - probably recycled", caller(2)
end
end
+
def __setobj__(obj)
+ @__id = obj.__id__
+ __old_status = Thread.critical
+ begin
+ Thread.critical = true
+ unless @@id_rev_map.key?(self)
+ ObjectSpace.define_finalizer obj, @@final
+ ObjectSpace.define_finalizer self, @@final
+ end
+ @@id_map[@__id] = [] unless @@id_map[@__id]
+ ensure
+ Thread.critical = __old_status
+ end
+ @@id_map[@__id].push self.__id__
+ @@id_rev_map[self.__id__] = @__id
end
+ # Returns true if the referenced object still exists, and false if it has
+ # been garbage collected.
def weakref_alive?
- @@id_rev_map[self.object_id] == @__id
+ @@id_rev_map[self.__id__] == @__id
end
end
if __FILE__ == $0
-# require 'thread'
+ require 'thread'
foo = Object.new
p foo.to_s # original's class
foo = WeakRef.new(foo)
p foo.to_s # should be same class
ObjectSpace.garbage_collect
- ObjectSpace.garbage_collect
p foo.to_s # should raise exception (recycled)
end
diff --git a/lib/webrick/cgi.rb b/lib/webrick/cgi.rb
index 7099d14689..ff5f7a6102 100644
--- a/lib/webrick/cgi.rb
+++ b/lib/webrick/cgi.rb
@@ -77,7 +77,7 @@ module WEBrick
res.set_error(ex)
rescue HTTPStatus::Status => ex
res.status = ex.code
- rescue Exception => ex
+ rescue Exception => ex
@logger.error(ex)
res.set_error(ex, true)
ensure
@@ -122,7 +122,7 @@ module WEBrick
include Enumerable
private
-
+
def initialize(config, env, stdin, stdout)
@config = config
@env = env
@@ -130,7 +130,7 @@ module WEBrick
@body_part = stdin
@out_port = stdout
@out_port.binmode
-
+
@server_addr = @env["SERVER_ADDR"] || "0.0.0.0"
@server_name = @env["SERVER_NAME"]
@server_port = @env["SERVER_PORT"]
@@ -164,42 +164,43 @@ module WEBrick
httpv = @config[:HTTPVersion]
return "#{meth} #{url} HTTP/#{httpv}"
end
-
+
def setup_header
- @env.each{|key, value|
- case key
- when "CONTENT_TYPE", "CONTENT_LENGTH"
- add_header(key.gsub(/_/, "-"), value)
- when /^HTTP_(.*)/
- add_header($1.gsub(/_/, "-"), value)
+ add_header("CONTENT_TYPE", "Content-Type")
+ add_header("CONTENT_LENGTH", "Content-length")
+ @env.each_key{|name|
+ if /^HTTP_(.*)/ =~ name
+ add_header(name, $1.gsub(/_/, "-"))
end
}
end
-
- def add_header(hdrname, value)
- unless value.empty?
- @header_part << hdrname << ": " << value << CRLF
+
+ def add_header(envname, hdrname)
+ if value = @env[envname]
+ unless value.empty?
+ @header_part << hdrname << ": " << value << CRLF
+ end
end
end
def input
@header_part.eof? ? @body_part : @header_part
end
-
+
public
-
+
def peeraddr
[nil, @remote_port, @remote_host, @remote_addr]
end
-
+
def addr
[nil, @server_port, @server_name, @server_addr]
end
-
- def gets(eol=LF, size=nil)
- input.gets(eol, size)
+
+ def gets(eol=LF)
+ input.gets(eol)
end
-
+
def read(size=nil)
input.read(size)
end
@@ -207,11 +208,7 @@ module WEBrick
def each
input.each{|line| yield(line) }
end
-
- def eof?
- input.eof?
- end
-
+
def <<(data)
@out_port << data
end
@@ -256,5 +253,5 @@ module WEBrick
end
end
end
- end
-end
+ end
+end
diff --git a/lib/webrick/config.rb b/lib/webrick/config.rb
index 946312e915..5897b977d8 100644
--- a/lib/webrick/config.rb
+++ b/lib/webrick/config.rb
@@ -33,8 +33,6 @@ module WEBrick
:StartCallback => nil,
:StopCallback => nil,
:AcceptCallback => nil,
- :DoNotReverseLookup => nil,
- :ShutdownSocketWithoutClose => false,
}
# for HTTPServer, HTTPRequest, HTTPResponse ...
@@ -47,10 +45,9 @@ module WEBrick
:DirectoryIndex => ["index.html","index.htm","index.cgi","index.rhtml"],
:DocumentRoot => nil,
:DocumentRootOptions => { :FancyIndexing => true },
- :RequestCallback => nil,
+ :RequestHandler => nil,
+ :RequestCallback => nil, # alias of :RequestHandler
:ServerAlias => nil,
- :InputBufferSize => 65536, # input buffer size in reading request body
- :OutputBufferSize => 65536, # output buffer size in sending File or IO
# for HTTPProxyServer
:ProxyAuthProc => nil,
@@ -83,7 +80,7 @@ module WEBrick
}
DigestAuth = {
- :Algorithm => 'MD5-sess', # or 'MD5'
+ :Algorithm => 'MD5-sess', # or 'MD5'
:Domain => nil, # an array includes domain names.
:Qop => [ 'auth' ], # 'auth' or 'auth-int' or both.
:UseOpaque => true,
diff --git a/lib/webrick/httpauth/authenticator.rb b/lib/webrick/httpauth/authenticator.rb
index d93f12a97a..fe2dbf4e0c 100644
--- a/lib/webrick/httpauth/authenticator.rb
+++ b/lib/webrick/httpauth/authenticator.rb
@@ -25,7 +25,7 @@ module WEBrick
unless config[sym]
raise ArgumentError, "Argument #{sym.inspect} missing."
end
- }
+ }
@realm = config[:Realm]
@userdb = config[:UserDB]
@logger = config[:Logger] || Log::new($stderr)
@@ -40,9 +40,9 @@ module WEBrick
def check_scheme(req)
unless credentials = req[@request_field]
error("no credentials in the request.")
- return nil
- end
- unless match = /^#{@auth_scheme}\s+/i.match(credentials)
+ return nil
+ end
+ unless match = /^#{@auth_scheme}\s+/.match(credentials)
error("invalid scheme in %s.", credentials)
info("%s: %s", @request_field, credentials) if $DEBUG
return nil
@@ -60,7 +60,7 @@ module WEBrick
if @logger.error?
log(:error, fmt, *args)
end
- end
+ end
def info(fmt, *args)
if @logger.info?
diff --git a/lib/webrick/httpauth/basicauth.rb b/lib/webrick/httpauth/basicauth.rb
index 210fb00bbe..e835361dc2 100644
--- a/lib/webrick/httpauth/basicauth.rb
+++ b/lib/webrick/httpauth/basicauth.rb
@@ -34,7 +34,7 @@ module WEBrick
unless basic_credentials = check_scheme(req)
challenge(req, res)
end
- userid, password = basic_credentials.unpack("m*")[0].split(":", 2)
+ userid, password = basic_credentials.unpack("m*")[0].split(":", 2)
password ||= ""
if userid.empty?
error("user id was not given.")
diff --git a/lib/webrick/httpauth/digestauth.rb b/lib/webrick/httpauth/digestauth.rb
index aac87a06df..318e0bf17f 100644
--- a/lib/webrick/httpauth/digestauth.rb
+++ b/lib/webrick/httpauth/digestauth.rb
@@ -52,7 +52,7 @@ module WEBrick
when 'SHA1','SHA1-sess' # it is a bonus feature :-)
@h = Digest::SHA1
else
- msg = format('Algorithm "%s" is not supported.', @algorithm)
+ msg = format('Alogrithm "%s" is not supported.', @algorithm)
raise ArgumentError.new(msg)
end
@@ -118,16 +118,16 @@ module WEBrick
}
if !check_uri(req, auth_req)
- raise HTTPStatus::BadRequest
+ raise HTTPStatus::BadRequest
end
- if auth_req['realm'] != @realm
+ if auth_req['realm'] != @realm
error('%s: realm unmatch. "%s" for "%s"',
auth_req['username'], auth_req['realm'], @realm)
return false
end
- auth_req['algorithm'] ||= 'MD5'
+ auth_req['algorithm'] ||= 'MD5'
if auth_req['algorithm'] != @algorithm &&
(@opera_hack && auth_req['algorithm'] != @algorithm.upcase)
error('%s: algorithm unmatch. "%s" for "%s"',
@@ -229,8 +229,8 @@ module WEBrick
def split_param_value(string)
ret = {}
- while string.bytesize != 0
- case string
+ while string.size != 0
+ case string
when /^\s*([\w\-\.\*\%\!]+)=\s*\"((\\.|[^\"])*)\"\s*,?/
key = $1
matched = $2
@@ -320,7 +320,7 @@ module WEBrick
uri = auth_req['uri']
if uri != req.request_uri.to_s && uri != req.unparsed_uri &&
(@internet_explorer_hack && uri != req.path)
- error('%s: uri unmatch. "%s" for "%s"', auth_req['username'],
+ error('%s: uri unmatch. "%s" for "%s"', auth_req['username'],
auth_req['uri'], req.request_uri.to_s)
return false
end
@@ -330,7 +330,6 @@ module WEBrick
def hexdigest(*args)
@h.hexdigest(args.join(":"))
end
-
end
class ProxyDigestAuth < DigestAuth
diff --git a/lib/webrick/httpauth/htpasswd.rb b/lib/webrick/httpauth/htpasswd.rb
index 8a058861d3..40f9297b05 100644
--- a/lib/webrick/httpauth/htpasswd.rb
+++ b/lib/webrick/httpauth/htpasswd.rb
@@ -35,7 +35,7 @@ module WEBrick
case line
when %r!\A[^:]+:[a-zA-Z0-9./]{13}\z!
user, pass = line.split(":")
- when /:\$/, /:{SHA}/
+ when /:\$/, /:\{SHA\}/
raise NotImplementedError,
'MD5, SHA1 .htpasswd file not supported'
else
diff --git a/lib/webrick/httpauth/userdb.rb b/lib/webrick/httpauth/userdb.rb
index 0285f89352..33e01405f4 100644
--- a/lib/webrick/httpauth/userdb.rb
+++ b/lib/webrick/httpauth/userdb.rb
@@ -18,7 +18,7 @@ module WEBrick
def set_passwd(realm, user, pass)
self[user] = pass
- end
+ end
def get_passwd(realm, user, reload_db=false)
# reload_db is dummy
diff --git a/lib/webrick/httpproxy.rb b/lib/webrick/httpproxy.rb
index ce99c55d8f..9295259085 100644
--- a/lib/webrick/httpproxy.rb
+++ b/lib/webrick/httpproxy.rb
@@ -23,26 +23,16 @@ module WEBrick
alias gets read
end
- FakeProxyURI = Object.new
- class << FakeProxyURI
- def method_missing(meth, *args)
- if %w(scheme host port path query userinfo).member?(meth.to_s)
- return nil
- end
- super
- end
- end
-
class HTTPProxyServer < HTTPServer
- def initialize(config={}, default=Config::HTTP)
- super(config, default)
+ def initialize(config)
+ super
c = @config
@via = "#{c[:HTTPVersion]} #{c[:ServerName]}:#{c[:Port]}"
end
def service(req, res)
if req.request_method == "CONNECT"
- do_CONNECT(req, res)
+ proxy_connect(req, res)
elsif req.unparsed_uri =~ %r!^http://!
proxy_service(req, res)
else
@@ -57,24 +47,118 @@ module WEBrick
req.header.delete("proxy-authorization")
end
+ # Some header fields should not be transferred.
+ HopByHop = %w( connection keep-alive proxy-authenticate upgrade
+ proxy-authorization te trailers transfer-encoding )
+ ShouldNotTransfer = %w( set-cookie proxy-connection )
+ def split_field(f) f ? f.split(/,\s+/).collect{|i| i.downcase } : [] end
+
+ def choose_header(src, dst)
+ connections = split_field(src['connection'])
+ src.each{|key, value|
+ key = key.downcase
+ if HopByHop.member?(key) || # RFC2616: 13.5.1
+ connections.member?(key) || # RFC2616: 14.10
+ ShouldNotTransfer.member?(key) # pragmatics
+ @logger.debug("choose_header: `#{key}: #{value}'")
+ next
+ end
+ dst[key] = value
+ }
+ end
+
+ # Net::HTTP is stupid about the multiple header fields.
+ # Here is workaround:
+ def set_cookie(src, dst)
+ if str = src['set-cookie']
+ cookies = []
+ str.split(/,\s*/).each{|token|
+ if /^[^=]+;/o =~ token
+ cookies[-1] << ", " << token
+ elsif /=/o =~ token
+ cookies << token
+ else
+ cookies[-1] << ", " << token
+ end
+ }
+ dst.cookies.replace(cookies)
+ end
+ end
+
+ def set_via(h)
+ if @config[:ProxyVia]
+ if h['via']
+ h['via'] << ", " << @via
+ else
+ h['via'] = @via
+ end
+ end
+ end
+
def proxy_uri(req, res)
- # should return upstream proxy server's URI
- return @config[:ProxyURI]
+ @config[:ProxyURI]
end
def proxy_service(req, res)
# Proxy Authentication
- proxy_auth(req, res)
+ proxy_auth(req, res)
+
+ # Create Request-URI to send to the origin server
+ uri = req.request_uri
+ path = uri.path.dup
+ path << "?" << uri.query if uri.query
+
+ # Choose header fields to transfer
+ header = Hash.new
+ choose_header(req, header)
+ set_via(header)
+ # select upstream proxy server
+ if proxy = proxy_uri(req, res)
+ proxy_host = proxy.host
+ proxy_port = proxy.port
+ if proxy.userinfo
+ credentials = "Basic " + [proxy.userinfo].pack("m*")
+ credentials.chomp!
+ header['proxy-authorization'] = credentials
+ end
+ end
+
+ response = nil
begin
- self.send("do_#{req.request_method}", req, res)
- rescue NoMethodError
- raise HTTPStatus::MethodNotAllowed,
- "unsupported method `#{req.request_method}'."
+ http = Net::HTTP.new(uri.host, uri.port, proxy_host, proxy_port)
+ http.start{
+ if @config[:ProxyTimeout]
+ ################################## these issues are
+ http.open_timeout = 30 # secs # necessary (maybe bacause
+ http.read_timeout = 60 # secs # Ruby's bug, but why?)
+ ##################################
+ end
+ case req.request_method
+ when "GET" then response = http.get(path, header)
+ when "POST" then response = http.post(path, req.body || "", header)
+ when "HEAD" then response = http.head(path, header)
+ else
+ raise HTTPStatus::MethodNotAllowed,
+ "unsupported method `#{req.request_method}'."
+ end
+ }
rescue => err
logger.debug("#{err.class}: #{err.message}")
raise HTTPStatus::ServiceUnavailable, err.message
end
+
+ # Persistent connction requirements are mysterious for me.
+ # So I will close the connection in every response.
+ res['proxy-connection'] = "close"
+ res['connection'] = "close"
+
+ # Convert Net::HTTP::HTTPResponse to WEBrick::HTTPProxy
+ res.status = response.code.to_i
+ choose_header(response, res)
+ set_cookie(response, res)
+ set_via(res)
+ res.body = response.body
# Process contents
if handler = @config[:ProxyContentHandler]
@@ -82,7 +166,7 @@ module WEBrick
end
end
- def do_CONNECT(req, res)
+ def proxy_connect(req, res)
# Proxy Authentication
proxy_auth(req, res)
@@ -95,7 +179,8 @@ module WEBrick
if proxy = proxy_uri(req, res)
proxy_request_line = "CONNECT #{host}:#{port} HTTP/1.0"
if proxy.userinfo
- credentials = "Basic " + [proxy.userinfo].pack("m").delete("\n")
+ credentials = "Basic " + [proxy.userinfo].pack("m*")
+ credentials.chomp!
end
host, port = proxy.host, proxy.port
end
@@ -146,11 +231,11 @@ module WEBrick
while fds = IO::select([ua, os])
if fds[0].member?(ua)
buf = ua.sysread(1024);
- @logger.debug("CONNECT: #{buf.bytesize} byte from User-Agent")
+ @logger.debug("CONNECT: #{buf.size} byte from User-Agent")
os.syswrite(buf)
elsif fds[0].member?(os)
buf = os.sysread(1024);
- @logger.debug("CONNECT: #{buf.bytesize} byte from #{host}:#{port}")
+ @logger.debug("CONNECT: #{buf.size} byte from #{host}:#{port}")
ua.syswrite(buf)
end
end
@@ -162,127 +247,8 @@ module WEBrick
raise HTTPStatus::EOFError
end
- def do_GET(req, res)
- perform_proxy_request(req, res) do |http, path, header|
- http.get(path, header)
- end
- end
-
- def do_HEAD(req, res)
- perform_proxy_request(req, res) do |http, path, header|
- http.head(path, header)
- end
- end
-
- def do_POST(req, res)
- perform_proxy_request(req, res) do |http, path, header|
- http.post(path, req.body || "", header)
- end
- end
-
def do_OPTIONS(req, res)
res['allow'] = "GET,HEAD,POST,OPTIONS,CONNECT"
end
-
- private
-
- # Some header fields should not be transferred.
- HopByHop = %w( connection keep-alive proxy-authenticate upgrade
- proxy-authorization te trailers transfer-encoding )
- ShouldNotTransfer = %w( set-cookie proxy-connection )
- def split_field(f) f ? f.split(/,\s+/).collect{|i| i.downcase } : [] end
-
- def choose_header(src, dst)
- connections = split_field(src['connection'])
- src.each{|key, value|
- key = key.downcase
- if HopByHop.member?(key) || # RFC2616: 13.5.1
- connections.member?(key) || # RFC2616: 14.10
- ShouldNotTransfer.member?(key) # pragmatics
- @logger.debug("choose_header: `#{key}: #{value}'")
- next
- end
- dst[key] = value
- }
- end
-
- # Net::HTTP is stupid about the multiple header fields.
- # Here is workaround:
- def set_cookie(src, dst)
- if str = src['set-cookie']
- cookies = []
- str.split(/,\s*/).each{|token|
- if /^[^=]+;/o =~ token
- cookies[-1] << ", " << token
- elsif /=/o =~ token
- cookies << token
- else
- cookies[-1] << ", " << token
- end
- }
- dst.cookies.replace(cookies)
- end
- end
-
- def set_via(h)
- if @config[:ProxyVia]
- if h['via']
- h['via'] << ", " << @via
- else
- h['via'] = @via
- end
- end
- end
-
- def setup_proxy_header(req, res)
- # Choose header fields to transfer
- header = Hash.new
- choose_header(req, header)
- set_via(header)
- return header
- end
-
- def setup_upstream_proxy_authentication(req, res, header)
- if upstream = proxy_uri(req, res)
- if upstream.userinfo
- header['proxy-authorization'] =
- "Basic " + [upstream.userinfo].pack("m").delete("\n")
- end
- return upstream
- end
- return FakeProxyURI
- end
-
- def perform_proxy_request(req, res)
- uri = req.request_uri
- path = uri.path.dup
- path << "?" << uri.query if uri.query
- header = setup_proxy_header(req, res)
- upstream = setup_upstream_proxy_authentication(req, res, header)
- response = nil
-
- http = Net::HTTP.new(uri.host, uri.port, upstream.host, upstream.port)
- http.start do
- if @config[:ProxyTimeout]
- ################################## these issues are
- http.open_timeout = 30 # secs # necessary (maybe bacause
- http.read_timeout = 60 # secs # Ruby's bug, but why?)
- ##################################
- end
- response = yield(http, path, header)
- end
-
- # Persistent connection requirements are mysterious for me.
- # So I will close the connection in every response.
- res['proxy-connection'] = "close"
- res['connection'] = "close"
-
- # Convert Net::HTTP::HTTPResponse to WEBrick::HTTPResponse
- res.status = response.code.to_i
- choose_header(response, res)
- set_cookie(response, res)
- set_via(res)
- res.body = response.body
- end
end
end
diff --git a/lib/webrick/httprequest.rb b/lib/webrick/httprequest.rb
index ff9b6d7849..4021259072 100644
--- a/lib/webrick/httprequest.rb
+++ b/lib/webrick/httprequest.rb
@@ -8,22 +8,26 @@
#
# $IPR: httprequest.rb,v 1.64 2003/07/13 17:18:22 gotoyuzo Exp $
+require 'timeout'
require 'uri'
+
require 'webrick/httpversion'
require 'webrick/httpstatus'
require 'webrick/httputils'
require 'webrick/cookie'
module WEBrick
+
class HTTPRequest
BODY_CONTAINABLE_METHODS = [ "POST", "PUT" ]
+ BUFSIZE = 1024*4
# Request line
attr_reader :request_line
attr_reader :request_method, :unparsed_uri, :http_version
# Request-URI
- attr_reader :request_uri, :path
+ attr_reader :request_uri, :host, :port, :path
attr_accessor :script_name, :path_info, :query_string
# Header and entity body
@@ -40,7 +44,6 @@ module WEBrick
def initialize(config)
@config = config
- @buffer_size = @config[:InputBufferSize]
@logger = config[:Logger]
@request_line = @request_method =
@@ -69,9 +72,6 @@ module WEBrick
@remaining_size = nil
@socket = nil
-
- @forwarded_proto = @forwarded_host = @forwarded_port =
- @forwarded_server = @forwarded_for = nil
end
def parse(socket=nil)
@@ -98,7 +98,6 @@ module WEBrick
return if @unparsed_uri == "*"
begin
- setup_forwarded_info
@request_uri = parse_uri(@unparsed_uri)
@path = HTTPUtils::unescape(@request_uri.path)
@path = HTTPUtils::normalize_path(@path)
@@ -157,26 +156,6 @@ module WEBrick
}
end
- def host
- return @forwarded_host || @host
- end
-
- def port
- return @forwarded_port || @port
- end
-
- def server_name
- return @forwarded_server || @config[:ServerName]
- end
-
- def remote_ip
- return self["client-ip"] || @forwarded_for || @peeraddr[3]
- end
-
- def ssl?
- return @request_uri.scheme == "https"
- end
-
def keep_alive?
@keep_alive
end
@@ -243,13 +222,10 @@ module WEBrick
private
def read_request_line(socket)
- @request_line = read_line(socket, 1024) if socket
- if @request_line.bytesize >= 1024 and @request_line[-1, 1] != LF
- raise HTTPStatus::RequestURITooLarge
- end
+ @request_line = read_line(socket) if socket
@request_time = Time.now
raise HTTPStatus::EOFError unless @request_line
- if /^(\S+)\s+(\S++)(?:\s+HTTP\/(\d+\.\d+))?\r?\n/mo =~ @request_line
+ if /^(\S+)\s+(\S+?)(?:\s+HTTP\/(\d+\.\d+))?\r?\n/mo =~ @request_line
@request_method = $1
@unparsed_uri = $2
@http_version = HTTPVersion.new($3 ? $3 : "0.9")
@@ -267,7 +243,7 @@ module WEBrick
end
end
begin
- @header = HTTPUtils::parse_header(@raw_header.join)
+ @header = HTTPUtils::parse_header(@raw_header)
rescue => ex
raise HTTPStatus::BadRequest, ex.message
end
@@ -279,9 +255,7 @@ module WEBrick
end
uri = URI::parse(str)
return uri if uri.absolute?
- if @forwarded_host
- host, port = @forwarded_host, @forwarded_port
- elsif self["host"]
+ if self["host"]
pattern = /\A(#{URI::REGEXP::PATTERN::HOST})(?::(\d+))?\z/n
host, port = *self['host'].scan(pattern)[0]
elsif @addr.size > 0
@@ -289,7 +263,7 @@ module WEBrick
else
host, port = @config[:ServerName], @config[:Port]
end
- uri.scheme = @forwarded_proto || scheme
+ uri.scheme = scheme
uri.host = host
uri.port = port ? port.to_i : nil
return URI::parse(uri.to_s)
@@ -304,10 +278,10 @@ module WEBrick
end
elsif self['content-length'] || @remaining_size
@remaining_size ||= self['content-length'].to_i
- while @remaining_size > 0
- sz = [@buffer_size, @remaining_size].min
+ while @remaining_size > 0
+ sz = BUFSIZE < @remaining_size ? BUFSIZE : @remaining_size
break unless buf = read_data(socket, sz)
- @remaining_size -= buf.bytesize
+ @remaining_size -= buf.size
block.call(buf)
end
if @remaining_size > 0 && @socket.eof?
@@ -333,8 +307,13 @@ module WEBrick
def read_chunked(socket, block)
chunk_size, = read_chunk_size(socket)
while chunk_size > 0
- data = read_data(socket, chunk_size) # read chunk-data
- if data.nil? || data.bytesize != chunk_size
+ data = ""
+ while data.size < chunk_size
+ tmp = read_data(socket, chunk_size-data.size) # read chunk-data
+ break unless tmp
+ data << tmp
+ end
+ if data.nil? || data.size != chunk_size
raise BadRequest, "bad chunk data size."
end
read_line(socket) # skip CRLF
@@ -346,10 +325,10 @@ module WEBrick
@remaining_size = 0
end
- def _read_data(io, method, *arg)
+ def _read_data(io, method, arg)
begin
- WEBrick::Utils.timeout(@config[:RequestTimeout]){
- return io.__send__(method, *arg)
+ timeout(@config[:RequestTimeout]){
+ return io.__send__(method, arg)
}
rescue Errno::ECONNRESET
return nil
@@ -358,8 +337,8 @@ module WEBrick
end
end
- def read_line(io, size=4096)
- _read_data(io, :gets, LF, size)
+ def read_line(io)
+ _read_data(io, :gets, LF)
end
def read_data(io, size)
@@ -382,25 +361,5 @@ module WEBrick
raise HTTPStatus::BadRequest, ex.message
end
end
-
- PrivateNetworkRegexp = /
- ^unknown$|
- ^((::ffff:)?127.0.0.1|::1)$|
- ^(::ffff:)?(10|172\.(1[6-9]|2[0-9]|3[01])|192\.168)\.
- /ixo
-
- def setup_forwarded_info
- @forwarded_server = self["x-forwarded-server"]
- @forwarded_proto = self["x-forwarded-proto"]
- if host_port = self["x-forwarded-host"]
- @forwarded_host, tmp = host_port.split(":", 2)
- @forwarded_port = (tmp || (@forwarded_proto == "https" ? 443 : 80)).to_i
- end
- if addrs = self["x-forwarded-for"]
- addrs = addrs.split(",").collect(&:strip)
- addrs.reject!{|ip| PrivateNetworkRegexp =~ ip }
- @forwarded_for = addrs.first
- end
- end
end
end
diff --git a/lib/webrick/httpresponse.rb b/lib/webrick/httpresponse.rb
index 98c4a357fa..62156b1abd 100644
--- a/lib/webrick/httpresponse.rb
+++ b/lib/webrick/httpresponse.rb
@@ -16,6 +16,8 @@ require 'webrick/httpstatus'
module WEBrick
class HTTPResponse
+ BUFSIZE = 1024*4
+
attr_reader :http_version, :status, :header
attr_reader :cookies
attr_accessor :reason_phrase
@@ -28,7 +30,6 @@ module WEBrick
def initialize(config)
@config = config
- @buffer_size = config[:OutputBufferSize]
@logger = config[:Logger]
@header = Hash.new
@status = HTTPStatus::RC_OK
@@ -142,7 +143,7 @@ module WEBrick
@header.delete('content-length')
elsif @header['content-length'].nil?
unless @body.is_a?(IO)
- @header['content-length'] = @body ? @body.bytesize : 0
+ @header['content-length'] = @body ? @body.size : 0
end
end
@@ -169,7 +170,7 @@ module WEBrick
if @http_version.major > 0
data = status_line()
@header.each{|key, value|
- tmp = key.gsub(/\bwww|^te$|\b\w/){ $&.upcase }
+ tmp = key.gsub(/\bwww|^te$|\b\w/){|s| s.upcase }
data << "#{tmp}: #{value}" << CRLF
}
@cookies.each{|cookie|
@@ -201,10 +202,10 @@ module WEBrick
def set_error(ex, backtrace=false)
case ex
- when HTTPStatus::Status
+ when HTTPStatus::Status
@keep_alive = false if HTTPStatus::error?(ex.code)
self.status = ex.code
- else
+ else
@keep_alive = false
self.status = HTTPStatus::RC_INTERNAL_SERVER_ERROR
end
@@ -257,13 +258,13 @@ module WEBrick
if @request_method == "HEAD"
# do nothing
elsif chunked?
- while buf = @body.read(@buffer_size)
+ while buf = @body.read(BUFSIZE)
next if buf.empty?
data = ""
- data << format("%x", buf.bytesize) << CRLF
+ data << format("%x", buf.size) << CRLF
data << buf << CRLF
_write_data(socket, data)
- @sent_size += buf.bytesize
+ @sent_size += buf.size
end
_write_data(socket, "0#{CRLF}#{CRLF}")
else
@@ -280,41 +281,41 @@ module WEBrick
if @request_method == "HEAD"
# do nothing
elsif chunked?
- remain = body ? @body.bytesize : 0
- while buf = @body[@sent_size, @buffer_size]
+ remain = body ? @body.size : 0
+ while buf = @body[@sent_size, BUFSIZE]
break if buf.empty?
data = ""
- data << format("%x", buf.bytesize) << CRLF
+ data << format("%x", buf.size) << CRLF
data << buf << CRLF
_write_data(socket, data)
- @sent_size += buf.bytesize
+ @sent_size += buf.size
end
_write_data(socket, "0#{CRLF}#{CRLF}")
else
- if @body && @body.bytesize > 0
+ if @body && @body.size > 0
_write_data(socket, @body)
- @sent_size = @body.bytesize
+ @sent_size = @body.size
end
end
end
def _send_file(output, input, offset, size)
while offset > 0
- sz = @buffer_size < size ? @buffer_size : size
+ sz = BUFSIZE < offset ? BUFSIZE : offset
buf = input.read(sz)
- offset -= buf.bytesize
+ offset -= buf.size
end
if size == 0
- while buf = input.read(@buffer_size)
+ while buf = input.read(BUFSIZE)
_write_data(output, buf)
end
else
while size > 0
- sz = @buffer_size < size ? @buffer_size : size
+ sz = BUFSIZE < size ? BUFSIZE : size
buf = input.read(sz)
_write_data(output, buf)
- size -= buf.bytesize
+ size -= buf.size
end
end
end
diff --git a/lib/webrick/httpserver.rb b/lib/webrick/httpserver.rb
index 929d856a4a..9edb0018f8 100644
--- a/lib/webrick/httpserver.rb
+++ b/lib/webrick/httpserver.rb
@@ -21,7 +21,7 @@ module WEBrick
class HTTPServer < ::WEBrick::GenericServer
def initialize(config={}, default=Config::HTTP)
- super(config, default)
+ super
@http_version = HTTPVersion::convert(@config[:HTTPVersion])
@mount_tab = MountTable.new
@@ -36,12 +36,12 @@ module WEBrick
[ $stderr, AccessLog::REFERER_LOG_FORMAT ]
]
end
-
+
@virtual_hosts = Array.new
end
def run(sock)
- while true
+ while true
res = HTTPResponse.new(@config)
req = HTTPRequest.new(@config)
server = self
@@ -52,19 +52,14 @@ module WEBrick
timeout = 0 if @status != :Running
timeout -= 0.5
end
- raise HTTPStatus::EOFError if timeout <= 0
- raise HTTPStatus::EOFError if sock.eof?
+ raise HTTPStatus::EOFError if timeout <= 0 || sock.eof?
req.parse(sock)
res.request_method = req.request_method
res.request_uri = req.request_uri
res.request_http_version = req.http_version
res.keep_alive = req.keep_alive?
server = lookup_server(req) || self
- if callback = server[:RequestCallback]
- callback.call(req, res)
- elsif callback = server[:RequestHandler]
- msg = ":RequestHandler is deprecated, please use :RequestCallback"
- @logger.warn(msg)
+ if callback = server[:RequestCallback] || server[:RequestHandler]
callback.call(req, res)
end
server.service(req, res)
@@ -80,9 +75,7 @@ module WEBrick
res.set_error(ex, true)
ensure
if req.request_line
- if req.keep_alive? && res.keep_alive?
- req.fixup()
- end
+ req.fixup()
res.send_response(sock)
server.access_log(@config, req, res)
end
diff --git a/lib/webrick/httpservlet/abstract.rb b/lib/webrick/httpservlet/abstract.rb
index 2a0a4049f2..5375c4622d 100644
--- a/lib/webrick/httpservlet/abstract.rb
+++ b/lib/webrick/httpservlet/abstract.rb
@@ -59,7 +59,7 @@ module WEBrick
def redirect_to_directory_uri(req, res)
if req.path[-1] != ?/
location = WEBrick::HTTPUtils.escape_path(req.path + "/")
- if req.query_string && req.query_string.bytesize > 0
+ if req.query_string && req.query_string.size > 0
location << "?" << req.query_string
end
res.set_redirect(HTTPStatus::MovedPermanently, location)
diff --git a/lib/webrick/httpservlet/cgi_runner.rb b/lib/webrick/httpservlet/cgi_runner.rb
index dd7325d25c..006abd458e 100644
--- a/lib/webrick/httpservlet/cgi_runner.rb
+++ b/lib/webrick/httpservlet/cgi_runner.rb
@@ -13,7 +13,7 @@ def sysread(io, size)
while size > 0
tmp = io.sysread(size)
buf << tmp
- size -= tmp.bytesize
+ size -= tmp.size
end
return buf
end
diff --git a/lib/webrick/httpservlet/cgihandler.rb b/lib/webrick/httpservlet/cgihandler.rb
index ab36b906f1..d5895e5285 100644
--- a/lib/webrick/httpservlet/cgihandler.rb
+++ b/lib/webrick/httpservlet/cgihandler.rb
@@ -1,11 +1,11 @@
-#
+#
# cgihandler.rb -- CGIHandler Class
-#
+#
# Author: IPR -- Internet Programming with Ruby -- writers
# Copyright (c) 2001 TAKAHASHI Masayoshi, GOTOU Yuuzou
# Copyright (c) 2002 Internet Programming with Ruby writers. All rights
# reserved.
-#
+#
# $IPR: cgihandler.rb,v 1.27 2003/03/21 19:56:01 gotoyuzo Exp $
require 'rbconfig'
@@ -17,13 +17,13 @@ module WEBrick
module HTTPServlet
class CGIHandler < AbstractServlet
- Ruby = File::join(RbConfig::CONFIG['bindir'],
- RbConfig::CONFIG['ruby_install_name'])
- Ruby << RbConfig::CONFIG['EXEEXT']
- CGIRunner = "\"#{Ruby}\" \"#{WEBrick::Config::LIBDIR}/httpservlet/cgi_runner.rb\""
+ Ruby = File::join(::Config::CONFIG['bindir'],
+ ::Config::CONFIG['ruby_install_name'])
+ Ruby << ::Config::CONFIG['EXEEXT']
+ CGIRunner = "\"#{Ruby}\" \"#{Config::LIBDIR}/httpservlet/cgi_runner.rb\""
def initialize(server, name)
- super(server, name)
+ super
@script_filename = name
@tempdir = server[:TempDir]
@cgicmd = "#{CGIRunner} #{server[:CGIInterpreter]}"
@@ -35,9 +35,7 @@ module WEBrick
cgi_in = IO::popen(@cgicmd, "wb")
cgi_out = Tempfile.new("webrick.cgiout.", @tempdir)
- cgi_out.set_encoding("ASCII-8BIT")
cgi_err = Tempfile.new("webrick.cgierr.", @tempdir)
- cgi_err.set_encoding("ASCII-8BIT")
begin
cgi_in.sync = true
meta = req.meta_vars
@@ -48,14 +46,14 @@ module WEBrick
end
dump = Marshal.dump(meta)
- cgi_in.write("%8d" % cgi_out.path.bytesize)
+ cgi_in.write("%8d" % cgi_out.path.size)
cgi_in.write(cgi_out.path)
- cgi_in.write("%8d" % cgi_err.path.bytesize)
+ cgi_in.write("%8d" % cgi_err.path.size)
cgi_in.write(cgi_err.path)
- cgi_in.write("%8d" % dump.bytesize)
+ cgi_in.write("%8d" % dump.size)
cgi_in.write(dump)
- if req.body and req.body.bytesize > 0
+ if req.body and req.body.size > 0
cgi_in.write(req.body)
end
ensure
@@ -65,19 +63,19 @@ module WEBrick
data = cgi_out.read
cgi_out.close(true)
if errmsg = cgi_err.read
- if errmsg.bytesize > 0
+ if errmsg.size > 0
@logger.error("CGIHandler: #{@script_filename}:\n" + errmsg)
end
- end
+ end
cgi_err.close(true)
end
-
+
if status != 0
@logger.error("CGIHandler: #{@script_filename} exit with #{status}")
end
data = "" unless data
- raw_header, body = data.split(/^[\xd\xa]+/, 2)
+ raw_header, body = data.split(/^[\xd\xa]+/on, 2)
raise HTTPStatus::InternalServerError,
"Premature end of script headers: #{@script_filename}" if body.nil?
diff --git a/lib/webrick/httpservlet/erbhandler.rb b/lib/webrick/httpservlet/erbhandler.rb
index 845db07169..b9d5e65b65 100644
--- a/lib/webrick/httpservlet/erbhandler.rb
+++ b/lib/webrick/httpservlet/erbhandler.rb
@@ -1,11 +1,11 @@
-#
+#
# erbhandler.rb -- ERBHandler Class
-#
+#
# Author: IPR -- Internet Programming with Ruby -- writers
# Copyright (c) 2001 TAKAHASHI Masayoshi, GOTOU Yuuzou
# Copyright (c) 2002 Internet Programming with Ruby writers. All rights
# reserved.
-#
+#
# $IPR: erbhandler.rb,v 1.25 2003/02/24 19:25:31 gotoyuzo Exp $
require 'webrick/httpservlet/abstract.rb'
@@ -17,7 +17,7 @@ module WEBrick
class ERBHandler < AbstractServlet
def initialize(server, name)
- super(server, name)
+ super
@script_filename = name
end
diff --git a/lib/webrick/httpservlet/filehandler.rb b/lib/webrick/httpservlet/filehandler.rb
index 1cac0cabe3..24f59d7142 100644
--- a/lib/webrick/httpservlet/filehandler.rb
+++ b/lib/webrick/httpservlet/filehandler.rb
@@ -20,7 +20,7 @@ module WEBrick
class DefaultFileHandler < AbstractServlet
def initialize(server, local_path)
- super(server, local_path)
+ super
@local_path = local_path
end
@@ -32,7 +32,7 @@ module WEBrick
if not_modified?(req, res, mtime, res['etag'])
res.body = ''
raise HTTPStatus::NotModified
- elsif req['range']
+ elsif req['range']
make_partial_content(req, res, @local_path, st.size)
raise HTTPStatus::PartialContent
else
@@ -402,25 +402,25 @@ module WEBrick
res.body << "<A HREF=\"?M=#{d1}\">Last modified</A> "
res.body << "<A HREF=\"?S=#{d1}\">Size</A>\n"
res.body << "<HR>\n"
-
+
list.unshift [ "..", File::mtime(local_path+"/.."), -1 ]
list.each{ |name, time, size|
if name == ".."
dname = "Parent Directory"
- elsif name.bytesize > 25
- dname = name.sub(/^(.{23})(?:.*)/, '\1..')
+ elsif name.size > 25
+ dname = name.sub(/^(.{23})(.*)/){ $1 + ".." }
else
dname = name
end
s = " <A HREF=\"#{HTTPUtils::escape(name)}\">#{dname}</A>"
- s << " " * (30 - dname.bytesize)
+ s << " " * (30 - dname.size)
s << (time ? time.strftime("%Y/%m/%d %H:%M ") : " " * 22)
s << (size >= 0 ? size.to_s : "-") << "\n"
res.body << s
}
res.body << "</PRE><HR>"
- res.body << <<-_end_of_html_
+ res.body << <<-_end_of_html_
<ADDRESS>
#{HTMLUtils::escape(@config[:ServerSoftware])}<BR>
at #{req.host}:#{req.port}
diff --git a/lib/webrick/httpservlet/prochandler.rb b/lib/webrick/httpservlet/prochandler.rb
index 2be3c854c1..783cb27896 100644
--- a/lib/webrick/httpservlet/prochandler.rb
+++ b/lib/webrick/httpservlet/prochandler.rb
@@ -1,11 +1,11 @@
-#
+#
# prochandler.rb -- ProcHandler Class
-#
+#
# Author: IPR -- Internet Programming with Ruby -- writers
# Copyright (c) 2001 TAKAHASHI Masayoshi, GOTOU Yuuzou
# Copyright (c) 2002 Internet Programming with Ruby writers. All rights
# reserved.
-#
+#
# $IPR: prochandler.rb,v 1.7 2002/09/21 12:23:42 gotoyuzo Exp $
require 'webrick/httpservlet/abstract.rb'
@@ -16,7 +16,7 @@ module WEBrick
class ProcHandler < AbstractServlet
def get_instance(server, *options)
self
- end
+ end
def initialize(proc)
@proc = proc
diff --git a/lib/webrick/httpstatus.rb b/lib/webrick/httpstatus.rb
index d022ddb446..0b22c992b3 100644
--- a/lib/webrick/httpstatus.rb
+++ b/lib/webrick/httpstatus.rb
@@ -19,50 +19,50 @@ module WEBrick
class Error < Status; end
class ClientError < Error; end
class ServerError < Error; end
-
+
class EOFError < StandardError; end
StatusMessage = {
- 100 => 'Continue',
- 101 => 'Switching Protocols',
- 200 => 'OK',
- 201 => 'Created',
- 202 => 'Accepted',
- 203 => 'Non-Authoritative Information',
- 204 => 'No Content',
- 205 => 'Reset Content',
- 206 => 'Partial Content',
- 300 => 'Multiple Choices',
- 301 => 'Moved Permanently',
- 302 => 'Found',
- 303 => 'See Other',
- 304 => 'Not Modified',
- 305 => 'Use Proxy',
- 307 => 'Temporary 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 => 'Request Entity Too Large',
- 414 => 'Request-URI Too Large',
- 415 => 'Unsupported Media Type',
- 416 => 'Request Range Not Satisfiable',
- 417 => 'Expectation Failed',
- 500 => 'Internal Server Error',
- 501 => 'Not Implemented',
- 502 => 'Bad Gateway',
- 503 => 'Service Unavailable',
- 504 => 'Gateway Timeout',
- 505 => 'HTTP Version Not Supported'
+ 100, 'Continue',
+ 101, 'Switching Protocols',
+ 200, 'OK',
+ 201, 'Created',
+ 202, 'Accepted',
+ 203, 'Non-Authoritative Information',
+ 204, 'No Content',
+ 205, 'Reset Content',
+ 206, 'Partial Content',
+ 300, 'Multiple Choices',
+ 301, 'Moved Permanently',
+ 302, 'Found',
+ 303, 'See Other',
+ 304, 'Not Modified',
+ 305, 'Use Proxy',
+ 307, 'Temporary 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, 'Request Entity Too Large',
+ 414, 'Request-URI Too Large',
+ 415, 'Unsupported Media Type',
+ 416, 'Request Range Not Satisfiable',
+ 417, 'Expectation Failed',
+ 500, 'Internal Server Error',
+ 501, 'Not Implemented',
+ 502, 'Bad Gateway',
+ 503, 'Service Unavailable',
+ 504, 'Gateway Timeout',
+ 505, 'HTTP Version Not Supported'
}
CodeToError = {}
@@ -84,7 +84,7 @@ module WEBrick
class #{err_name} < #{parent}
def self.code() RC_#{var_name} end
def self.reason_phrase() StatusMessage[code] end
- def code() self::class::code end
+ def code() self::class::code end
def reason_phrase() self::class::reason_phrase end
alias to_i code
end
diff --git a/lib/webrick/httputils.rb b/lib/webrick/httputils.rb
index 6f6f05a199..976d3e915e 100644
--- a/lib/webrick/httputils.rb
+++ b/lib/webrick/httputils.rb
@@ -82,7 +82,6 @@ module WEBrick
"tiff" => "image/tiff",
"txt" => "text/plain",
"xbm" => "image/x-xbitmap",
- "xhtml" => "text/html",
"xls" => "application/vnd.ms-excel",
"xml" => "text/xml",
"xpm" => "image/x-xpixmap",
@@ -98,7 +97,7 @@ module WEBrick
next if /^#/ =~ line
line.chomp!
mimetype, ext0 = line.split(/\s+/, 2)
- next unless ext0
+ next unless ext0
next if ext0.empty?
ext0.split(/\s+/).each{ |ext| hash[ext] = mimetype }
}
@@ -119,7 +118,7 @@ module WEBrick
def parse_header(raw)
header = Hash.new([].freeze)
field = nil
- raw.each_line{|line|
+ raw.each{|line|
case line
when /^([A-Za-z0-9!\#$%&'*+\-.^_`|~]+):\s*(.*?)\s*\z/om
field, value = $1, $2
@@ -216,7 +215,7 @@ module WEBrick
super("")
else
@raw_header = EmptyRawHeader
- @header = EmptyHeader
+ @header = EmptyHeader
super(args.shift)
unless args.empty?
@next_data = self.class.new(*args)
@@ -236,7 +235,7 @@ module WEBrick
if @header
super
elsif str == CRLF
- @header = HTTPUtils::parse_header(@raw_header.join)
+ @header = HTTPUtils::parse_header(@raw_header)
if cd = self['content-disposition']
if /\s+name="(.*?)"/ =~ cd then @name = $1 end
if /\s+filename="(.*?)"/ =~ cd then @filename = $1 end
@@ -250,7 +249,7 @@ module WEBrick
def append_data(data)
tmp = self
while tmp
- unless tmp.next_data
+ unless tmp.next_data
tmp.next_data = data
break
end
@@ -287,7 +286,7 @@ module WEBrick
query = Hash.new
if str
str.split(/[&;]/).each{|x|
- next if x.empty?
+ next if x.empty?
key, val = x.split(/=/,2)
key = unescape_form(key)
val = unescape_form(val.to_s)
@@ -305,11 +304,11 @@ module WEBrick
module_function :parse_query
def parse_form_data(io, boundary)
- boundary_regexp = /\A--#{Regexp.quote(boundary)}(--)?#{CRLF}\z/
+ boundary_regexp = /\A--#{boundary}(--)?#{CRLF}\z/
form_data = Hash.new
return form_data unless io
data = nil
- io.each_line{|line|
+ io.each{|line|
if boundary_regexp =~ line
if data
data.chop!
@@ -317,7 +316,7 @@ module WEBrick
if form_data.has_key?(key)
form_data[key].append_data(data)
else
- form_data[key] = data
+ form_data[key] = data
end
end
data = FormData.new
@@ -350,7 +349,7 @@ module WEBrick
def _make_regex(str) /([#{Regexp.escape(str)}])/n end
def _make_regex!(str) /([^#{Regexp.escape(str)}])/n end
- def _escape(str, regex) str.gsub(regex){ "%%%02X" % $1.ord } end
+ def _escape(str, regex) str.gsub(regex){ "%%%02X" % $1[0] } end
def _unescape(str, regex) str.gsub(regex){ $1.hex.chr } end
UNESCAPED = _make_regex(control+space+delims+unwise+nonascii)
diff --git a/lib/webrick/log.rb b/lib/webrick/log.rb
index 0ffa12dd96..5d4fd0a174 100644
--- a/lib/webrick/log.rb
+++ b/lib/webrick/log.rb
@@ -72,7 +72,7 @@ module WEBrick
end
class Log < BasicLog
- attr_accessor :time_format
+ attr_accessor :time_format
def initialize(log_file=nil, level=nil)
super(log_file, level)
diff --git a/lib/webrick/server.rb b/lib/webrick/server.rb
index c4d23bd67b..16dbd46f98 100644
--- a/lib/webrick/server.rb
+++ b/lib/webrick/server.rb
@@ -10,6 +10,7 @@
require 'thread'
require 'socket'
+require 'timeout'
require 'webrick/config'
require 'webrick/log'
@@ -91,7 +92,6 @@ module WEBrick
svrs[0].each{|svr|
@tokens.pop # blocks while no token is there.
if sock = accept_client(svr)
- sock.do_not_reverse_lookup = config[:DoNotReverseLookup]
th = start_thread(sock, &block)
th[:WEBrickThread] = true
thgroup.add(th)
@@ -130,18 +130,7 @@ module WEBrick
addr = s.addr
@logger.debug("close TCPSocket(#{addr[2]}, #{addr[1]})")
end
- begin
- s.shutdown
- rescue Errno::ENOTCONN
- # when `Errno::ENOTCONN: Socket is not connected' on some platforms,
- # call #close instead of #shutdown.
- # (ignore @config[:ShutdownSocketWithoutClose])
- s.close
- else
- unless @config[:ShutdownSocketWithoutClose]
- s.close
- end
- end
+ s.close
}
@listeners.clear
end
@@ -159,8 +148,9 @@ module WEBrick
sock.sync = true
Utils::set_non_blocking(sock)
Utils::set_close_on_exec(sock)
- rescue Errno::ECONNRESET, Errno::ECONNABORTED,
- Errno::EPROTO, Errno::EINVAL => ex
+ rescue Errno::ECONNRESET, Errno::ECONNABORTED, Errno::EPROTO => ex
+ # TCP connection was established but RST segment was sent
+ # from peer before calling TCPServer#accept.
rescue Exception => ex
msg = "#{ex.class}: #{ex.message}\n\t#{ex.backtrace[0]}"
@logger.error msg
diff --git a/lib/webrick/ssl.rb b/lib/webrick/ssl.rb
index 896206b483..03bfdf4aa0 100644
--- a/lib/webrick/ssl.rb
+++ b/lib/webrick/ssl.rb
@@ -2,7 +2,7 @@
# ssl.rb -- SSL/TLS enhancement for GenericServer
#
# Copyright (c) 2003 GOTOU Yuuzou All rights reserved.
-#
+#
# $Id$
require 'webrick'
@@ -41,7 +41,7 @@ module WEBrick
case p
when 0; $stderr.putc "." # BN_generate_prime
when 1; $stderr.putc "+" # BN_generate_prime
- when 2; $stderr.putc "*" # searching good prime,
+ when 2; $stderr.putc "*" # searching good prime,
# n = #of try,
# but also data from BN_generate_prime
when 3; $stderr.putc "\n" # found good prime, n==0 - p, n==1 - q,
@@ -88,7 +88,7 @@ module WEBrick
if @config[:SSLEnable]
unless ssl_context
@ssl_context = setup_ssl_context(@config)
- @logger.info("\n" + @config[:SSLCertificate].to_text)
+ @logger.info("\n" + @config[:SSLCertificate].to_text)
end
listeners.collect!{|svr|
ssvr = ::OpenSSL::SSL::SSLServer.new(svr, ssl_context)
diff --git a/lib/webrick/utils.rb b/lib/webrick/utils.rb
index dee9363441..cf9da6f2ce 100644
--- a/lib/webrick/utils.rb
+++ b/lib/webrick/utils.rb
@@ -86,90 +86,15 @@ module WEBrick
RAND_CHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" +
"0123456789" +
- "abcdefghijklmnopqrstuvwxyz"
+ "abcdefghijklmnopqrstuvwxyz"
def random_string(len)
- rand_max = RAND_CHARS.bytesize
- ret = ""
+ rand_max = RAND_CHARS.size
+ ret = ""
len.times{ ret << RAND_CHARS[rand(rand_max)] }
- ret
+ ret
end
module_function :random_string
- ###########
-
- require "thread"
- require "timeout"
- require "singleton"
-
- class TimeoutHandler
- include Singleton
- TimeoutMutex = Mutex.new
-
- def TimeoutHandler.register(seconds, exception)
- TimeoutMutex.synchronize{
- instance.register(Thread.current, Time.now + seconds, exception)
- }
- end
-
- def TimeoutHandler.cancel(id)
- TimeoutMutex.synchronize{
- instance.cancel(Thread.current, id)
- }
- end
-
- def initialize
- @timeout_info = Hash.new
- Thread.start{
- while true
- now = Time.now
- @timeout_info.each{|thread, ary|
- ary.dup.each{|info|
- time, exception = *info
- interrupt(thread, info.object_id, exception) if time < now
- }
- }
- sleep 0.5
- end
- }
- end
-
- def interrupt(thread, id, exception)
- TimeoutMutex.synchronize{
- if cancel(thread, id) && thread.alive?
- thread.raise(exception, "execution timeout")
- end
- }
- end
-
- def register(thread, time, exception)
- @timeout_info[thread] ||= Array.new
- @timeout_info[thread] << [time, exception]
- return @timeout_info[thread].last.object_id
- end
-
- def cancel(thread, id)
- if ary = @timeout_info[thread]
- ary.delete_if{|info| info.object_id == id }
- if ary.empty?
- @timeout_info.delete(thread)
- end
- return true
- end
- return false
- end
- end
-
- def timeout(seconds, exception=Timeout::Error)
- return yield if seconds.nil? or seconds.zero?
- # raise ThreadError, "timeout within critical session" if Thread.critical
- id = TimeoutHandler.register(seconds, exception)
- begin
- yield(seconds)
- ensure
- TimeoutHandler.cancel(id)
- end
- end
- module_function :timeout
end
end
diff --git a/lib/wsdl/binding.rb b/lib/wsdl/binding.rb
new file mode 100644
index 0000000000..58a21d820d
--- /dev/null
+++ b/lib/wsdl/binding.rb
@@ -0,0 +1,65 @@
+# WSDL4R - WSDL binding definition.
+# Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+require 'wsdl/info'
+require 'xsd/namedelements'
+
+
+module WSDL
+
+
+class Binding < Info
+ attr_reader :name # required
+ attr_reader :type # required
+ attr_reader :operations
+ attr_reader :soapbinding
+
+ def initialize
+ super
+ @name = nil
+ @type = nil
+ @operations = XSD::NamedElements.new
+ @soapbinding = nil
+ end
+
+ def targetnamespace
+ parent.targetnamespace
+ end
+
+ def parse_element(element)
+ case element
+ when OperationName
+ o = OperationBinding.new
+ @operations << o
+ o
+ when SOAPBindingName
+ o = WSDL::SOAP::Binding.new
+ @soapbinding = o
+ o
+ when DocumentationName
+ o = Documentation.new
+ o
+ else
+ nil
+ end
+ end
+
+ def parse_attr(attr, value)
+ case attr
+ when NameAttrName
+ @name = XSD::QName.new(targetnamespace, value.source)
+ when TypeAttrName
+ @type = value
+ else
+ nil
+ end
+ end
+end
+
+
+end
diff --git a/lib/wsdl/data.rb b/lib/wsdl/data.rb
new file mode 100644
index 0000000000..45eaad8526
--- /dev/null
+++ b/lib/wsdl/data.rb
@@ -0,0 +1,64 @@
+# WSDL4R - WSDL data definitions.
+# Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+require 'xsd/qname'
+require 'wsdl/documentation'
+require 'wsdl/definitions'
+require 'wsdl/types'
+require 'wsdl/message'
+require 'wsdl/part'
+require 'wsdl/portType'
+require 'wsdl/operation'
+require 'wsdl/param'
+require 'wsdl/binding'
+require 'wsdl/operationBinding'
+require 'wsdl/service'
+require 'wsdl/port'
+require 'wsdl/import'
+
+
+module WSDL
+
+
+ArrayTypeAttrName = XSD::QName.new(Namespace, 'arrayType')
+BindingName = XSD::QName.new(Namespace, 'binding')
+DefinitionsName = XSD::QName.new(Namespace, 'definitions')
+DocumentationName = XSD::QName.new(Namespace, 'documentation')
+FaultName = XSD::QName.new(Namespace, 'fault')
+ImportName = XSD::QName.new(Namespace, 'import')
+InputName = XSD::QName.new(Namespace, 'input')
+MessageName = XSD::QName.new(Namespace, 'message')
+OperationName = XSD::QName.new(Namespace, 'operation')
+OutputName = XSD::QName.new(Namespace, 'output')
+PartName = XSD::QName.new(Namespace, 'part')
+PortName = XSD::QName.new(Namespace, 'port')
+PortTypeName = XSD::QName.new(Namespace, 'portType')
+ServiceName = XSD::QName.new(Namespace, 'service')
+TypesName = XSD::QName.new(Namespace, 'types')
+
+SchemaName = XSD::QName.new(XSD::Namespace, 'schema')
+
+SOAPAddressName = XSD::QName.new(SOAPBindingNamespace, 'address')
+SOAPBindingName = XSD::QName.new(SOAPBindingNamespace, 'binding')
+SOAPHeaderName = XSD::QName.new(SOAPBindingNamespace, 'header')
+SOAPBodyName = XSD::QName.new(SOAPBindingNamespace, 'body')
+SOAPFaultName = XSD::QName.new(SOAPBindingNamespace, 'fault')
+SOAPOperationName = XSD::QName.new(SOAPBindingNamespace, 'operation')
+
+BindingAttrName = XSD::QName.new(nil, 'binding')
+ElementAttrName = XSD::QName.new(nil, 'element')
+LocationAttrName = XSD::QName.new(nil, 'location')
+MessageAttrName = XSD::QName.new(nil, 'message')
+NameAttrName = XSD::QName.new(nil, 'name')
+NamespaceAttrName = XSD::QName.new(nil, 'namespace')
+ParameterOrderAttrName = XSD::QName.new(nil, 'parameterOrder')
+TargetNamespaceAttrName = XSD::QName.new(nil, 'targetNamespace')
+TypeAttrName = XSD::QName.new(nil, 'type')
+
+
+end
diff --git a/lib/wsdl/definitions.rb b/lib/wsdl/definitions.rb
new file mode 100644
index 0000000000..5235037cfe
--- /dev/null
+++ b/lib/wsdl/definitions.rb
@@ -0,0 +1,250 @@
+# WSDL4R - WSDL definitions.
+# Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+require 'wsdl/info'
+require 'xsd/namedelements'
+
+
+module WSDL
+
+
+class Definitions < Info
+ attr_reader :name
+ attr_reader :targetnamespace
+ attr_reader :imports
+
+ attr_accessor :location
+ attr_reader :importedschema
+
+ def initialize
+ super
+ @name = nil
+ @targetnamespace = nil
+ @location = nil
+ @importedschema = {}
+
+ @types = nil
+ @imports = []
+ @messages = XSD::NamedElements.new
+ @porttypes = XSD::NamedElements.new
+ @bindings = XSD::NamedElements.new
+ @services = XSD::NamedElements.new
+
+ @anontypes = XSD::NamedElements.new
+ @root = self
+ end
+
+ def inspect
+ sprintf("#<%s:0x%x %s>", self.class.name, __id__, @name || '(unnamed)')
+ end
+
+ def targetnamespace=(targetnamespace)
+ @targetnamespace = targetnamespace
+ if @name
+ @name = XSD::QName.new(@targetnamespace, @name.name)
+ end
+ end
+
+ def collect_attributes
+ result = XSD::NamedElements.new
+ if @types
+ @types.schemas.each do |schema|
+ result.concat(schema.collect_attributes)
+ end
+ end
+ @imports.each do |import|
+ result.concat(import.content.collect_attributes)
+ end
+ result
+ end
+
+ def collect_elements
+ result = XSD::NamedElements.new
+ if @types
+ @types.schemas.each do |schema|
+ result.concat(schema.collect_elements)
+ end
+ end
+ @imports.each do |import|
+ result.concat(import.content.collect_elements)
+ end
+ result
+ end
+
+ def collect_complextypes
+ result = @anontypes.dup
+ if @types
+ @types.schemas.each do |schema|
+ result.concat(schema.collect_complextypes)
+ end
+ end
+ @imports.each do |import|
+ result.concat(import.content.collect_complextypes)
+ end
+ result
+ end
+
+ def collect_simpletypes
+ result = XSD::NamedElements.new
+ if @types
+ @types.schemas.each do |schema|
+ result.concat(schema.collect_simpletypes)
+ end
+ end
+ @imports.each do |import|
+ result.concat(import.content.collect_simpletypes)
+ end
+ result
+ end
+
+ # ToDo: simpletype must be accepted...
+ def add_type(complextype)
+ @anontypes << complextype
+ end
+
+ def messages
+ result = @messages.dup
+ @imports.each do |import|
+ result.concat(import.content.messages) if self.class === import.content
+ end
+ result
+ end
+
+ def porttypes
+ result = @porttypes.dup
+ @imports.each do |import|
+ result.concat(import.content.porttypes) if self.class === import.content
+ end
+ result
+ end
+
+ def bindings
+ result = @bindings.dup
+ @imports.each do |import|
+ result.concat(import.content.bindings) if self.class === import.content
+ end
+ result
+ end
+
+ def services
+ result = @services.dup
+ @imports.each do |import|
+ result.concat(import.content.services) if self.class === import.content
+ end
+ result
+ end
+
+ def message(name)
+ message = @messages[name]
+ return message if message
+ @imports.each do |import|
+ message = import.content.message(name) if self.class === import.content
+ return message if message
+ end
+ nil
+ end
+
+ def porttype(name)
+ porttype = @porttypes[name]
+ return porttype if porttype
+ @imports.each do |import|
+ porttype = import.content.porttype(name) if self.class === import.content
+ return porttype if porttype
+ end
+ nil
+ end
+
+ def binding(name)
+ binding = @bindings[name]
+ return binding if binding
+ @imports.each do |import|
+ binding = import.content.binding(name) if self.class === import.content
+ return binding if binding
+ end
+ nil
+ end
+
+ def service(name)
+ service = @services[name]
+ return service if service
+ @imports.each do |import|
+ service = import.content.service(name) if self.class === import.content
+ return service if service
+ end
+ nil
+ end
+
+ def porttype_binding(name)
+ binding = @bindings.find { |item| item.type == name }
+ return binding if binding
+ @imports.each do |import|
+ binding = import.content.porttype_binding(name) if self.class === import.content
+ return binding if binding
+ end
+ nil
+ end
+
+ def parse_element(element)
+ case element
+ when ImportName
+ o = Import.new
+ @imports << o
+ o
+ when TypesName
+ o = Types.new
+ @types = o
+ o
+ when MessageName
+ o = Message.new
+ @messages << o
+ o
+ when PortTypeName
+ o = PortType.new
+ @porttypes << o
+ o
+ when BindingName
+ o = Binding.new
+ @bindings << o
+ o
+ when ServiceName
+ o = Service.new
+ @services << o
+ o
+ when DocumentationName
+ o = Documentation.new
+ o
+ else
+ nil
+ end
+ end
+
+ def parse_attr(attr, value)
+ case attr
+ when NameAttrName
+ @name = XSD::QName.new(targetnamespace, value.source)
+ when TargetNamespaceAttrName
+ self.targetnamespace = value.source
+ else
+ nil
+ end
+ end
+
+ def self.parse_element(element)
+ if element == DefinitionsName
+ Definitions.new
+ else
+ nil
+ end
+ end
+
+private
+
+end
+
+
+end
diff --git a/lib/wsdl/documentation.rb b/lib/wsdl/documentation.rb
new file mode 100644
index 0000000000..3a7fd7d23e
--- /dev/null
+++ b/lib/wsdl/documentation.rb
@@ -0,0 +1,32 @@
+# WSDL4R - WSDL SOAP documentation element.
+# Copyright (C) 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+require 'wsdl/info'
+
+
+module WSDL
+
+
+class Documentation < Info
+ def initialize
+ super
+ end
+
+ def parse_element(element)
+ # Accepts any element.
+ self
+ end
+
+ def parse_attr(attr, value)
+ # Accepts any attribute.
+ true
+ end
+end
+
+
+end
diff --git a/lib/wsdl/import.rb b/lib/wsdl/import.rb
new file mode 100644
index 0000000000..faf60871a5
--- /dev/null
+++ b/lib/wsdl/import.rb
@@ -0,0 +1,80 @@
+# WSDL4R - WSDL import definition.
+# Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+require 'wsdl/info'
+require 'wsdl/importer'
+
+
+module WSDL
+
+
+class Import < Info
+ attr_reader :namespace
+ attr_reader :location
+ attr_reader :content
+
+ def initialize
+ super
+ @namespace = nil
+ @location = nil
+ @content = nil
+ @web_client = nil
+ end
+
+ def parse_element(element)
+ case element
+ when DocumentationName
+ o = Documentation.new
+ o
+ else
+ nil
+ end
+ end
+
+ def parse_attr(attr, value)
+ case attr
+ when NamespaceAttrName
+ @namespace = value.source
+ if @content
+ @content.targetnamespace = @namespace
+ end
+ @namespace
+ when LocationAttrName
+ @location = URI.parse(value.source)
+ if @location.relative? and !parent.location.nil? and
+ !parent.location.relative?
+ @location = parent.location + @location
+ end
+ if root.importedschema.key?(@location)
+ @content = root.importedschema[@location]
+ else
+ root.importedschema[@location] = nil # placeholder
+ @content = import(@location)
+ if @content.is_a?(Definitions)
+ @content.root = root
+ if @namespace
+ @content.targetnamespace = @namespace
+ end
+ end
+ root.importedschema[@location] = @content
+ end
+ @location
+ else
+ nil
+ end
+ end
+
+private
+
+ def import(location)
+ Importer.import(location, root)
+ end
+end
+
+
+end
diff --git a/lib/wsdl/importer.rb b/lib/wsdl/importer.rb
new file mode 100644
index 0000000000..481bd81b25
--- /dev/null
+++ b/lib/wsdl/importer.rb
@@ -0,0 +1,38 @@
+# WSDL4R - WSDL importer library.
+# Copyright (C) 2003, 2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+require 'wsdl/xmlSchema/importer'
+require 'wsdl/parser'
+
+
+module WSDL
+
+
+class Importer < WSDL::XMLSchema::Importer
+ def self.import(location, originalroot = nil)
+ new.import(location, originalroot)
+ end
+
+private
+
+ def parse(content, location, originalroot)
+ opt = {
+ :location => location,
+ :originalroot => originalroot
+ }
+ begin
+ WSDL::Parser.new(opt).parse(content)
+ rescue WSDL::Parser::ParseError
+ super(content, location, originalroot)
+ end
+ end
+
+end
+
+
+end
diff --git a/lib/wsdl/info.rb b/lib/wsdl/info.rb
new file mode 100644
index 0000000000..ffd90390a4
--- /dev/null
+++ b/lib/wsdl/info.rb
@@ -0,0 +1,39 @@
+# WSDL4R - WSDL information base.
+# Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+module WSDL
+
+
+class Info
+ attr_accessor :root
+ attr_accessor :parent
+ attr_accessor :id
+
+ def initialize
+ @root = nil
+ @parent = nil
+ @id = nil
+ end
+
+ def inspect
+ if self.respond_to?(:name)
+ sprintf("#<%s:0x%x %s>", self.class.name, __id__, self.name)
+ else
+ sprintf("#<%s:0x%x>", self.class.name, __id__)
+ end
+ end
+
+ def parse_element(element); end # abstract
+
+ def parse_attr(attr, value); end # abstract
+
+ def parse_epilogue; end # abstract
+end
+
+
+end
diff --git a/lib/wsdl/message.rb b/lib/wsdl/message.rb
new file mode 100644
index 0000000000..cecc602da3
--- /dev/null
+++ b/lib/wsdl/message.rb
@@ -0,0 +1,54 @@
+# WSDL4R - WSDL message definition.
+# Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+require 'wsdl/info'
+
+
+module WSDL
+
+
+class Message < Info
+ attr_reader :name # required
+ attr_reader :parts
+
+ def initialize
+ super
+ @name = nil
+ @parts = []
+ end
+
+ def targetnamespace
+ parent.targetnamespace
+ end
+
+ def parse_element(element)
+ case element
+ when PartName
+ o = Part.new
+ @parts << o
+ o
+ when DocumentationName
+ o = Documentation.new
+ o
+ else
+ nil
+ end
+ end
+
+ def parse_attr(attr, value)
+ case attr
+ when NameAttrName
+ @name = XSD::QName.new(parent.targetnamespace, value.source)
+ else
+ nil
+ end
+ end
+end
+
+
+end
diff --git a/lib/wsdl/operation.rb b/lib/wsdl/operation.rb
new file mode 100644
index 0000000000..fb7f4a80f4
--- /dev/null
+++ b/lib/wsdl/operation.rb
@@ -0,0 +1,130 @@
+# WSDL4R - WSDL operation definition.
+# Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+require 'wsdl/info'
+
+
+module WSDL
+
+
+class Operation < Info
+ class NameInfo
+ attr_reader :op_name
+ attr_reader :optype_name
+ attr_reader :parts
+ def initialize(op_name, optype_name, parts)
+ @op_name = op_name
+ @optype_name = optype_name
+ @parts = parts
+ end
+ end
+
+ attr_reader :name # required
+ attr_reader :parameter_order # optional
+ attr_reader :input
+ attr_reader :output
+ attr_reader :fault
+ attr_reader :type # required
+
+ def initialize
+ super
+ @name = nil
+ @type = nil
+ @parameter_order = nil
+ @input = nil
+ @output = nil
+ @fault = []
+ end
+
+ def targetnamespace
+ parent.targetnamespace
+ end
+
+ def input_info
+ typename = input.find_message.name
+ NameInfo.new(@name, typename, inputparts)
+ end
+
+ def output_info
+ typename = output.find_message.name
+ NameInfo.new(@name, typename, outputparts)
+ end
+
+ def inputparts
+ sort_parts(input.find_message.parts)
+ end
+
+ def inputname
+ XSD::QName.new(targetnamespace, input.name ? input.name.name : @name.name)
+ end
+
+ def outputparts
+ sort_parts(output.find_message.parts)
+ end
+
+ def outputname
+ XSD::QName.new(targetnamespace,
+ output.name ? output.name.name : @name.name + 'Response')
+ end
+
+ def parse_element(element)
+ case element
+ when InputName
+ o = Param.new
+ @input = o
+ o
+ when OutputName
+ o = Param.new
+ @output = o
+ o
+ when FaultName
+ o = Param.new
+ @fault << o
+ o
+ when DocumentationName
+ o = Documentation.new
+ o
+ else
+ nil
+ end
+ end
+
+ def parse_attr(attr, value)
+ case attr
+ when NameAttrName
+ @name = XSD::QName.new(targetnamespace, value.source)
+ when TypeAttrName
+ @type = value
+ when ParameterOrderAttrName
+ @parameter_order = value.source.split(/\s+/)
+ else
+ nil
+ end
+ end
+
+private
+
+ def sort_parts(parts)
+ return parts.dup unless parameter_order
+ result = []
+ parameter_order.each do |orderitem|
+ if (ele = parts.find { |part| part.name == orderitem })
+ result << ele
+ end
+ end
+ if result.length == 0
+ return parts.dup
+ end
+ # result length can be shorter than parts's.
+ # return part must not be a part of the parameterOrder.
+ result
+ end
+end
+
+
+end
diff --git a/lib/wsdl/operationBinding.rb b/lib/wsdl/operationBinding.rb
new file mode 100644
index 0000000000..c2b8cd6591
--- /dev/null
+++ b/lib/wsdl/operationBinding.rb
@@ -0,0 +1,108 @@
+# WSDL4R - WSDL bound operation definition.
+# Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+require 'wsdl/info'
+
+
+module WSDL
+
+
+class OperationBinding < Info
+ attr_reader :name # required
+ attr_reader :input
+ attr_reader :output
+ attr_reader :fault
+ attr_reader :soapoperation
+
+ def initialize
+ super
+ @name = nil
+ @input = nil
+ @output = nil
+ @fault = []
+ @soapoperation = nil
+ end
+
+ def targetnamespace
+ parent.targetnamespace
+ end
+
+ def porttype
+ root.porttype(parent.type)
+ end
+
+ def find_operation
+ porttype.operations[@name] or raise RuntimeError.new("#{@name} not found")
+ end
+
+ def soapoperation_name
+ if @soapoperation
+ @soapoperation.input_info.op_name
+ else
+ find_operation.name
+ end
+ end
+
+ def soapoperation_style
+ style = nil
+ if @soapoperation
+ style = @soapoperation.operation_style
+ elsif parent.soapbinding
+ style = parent.soapbinding.style
+ else
+ raise TypeError.new("operation style definition not found")
+ end
+ style || :document
+ end
+
+ def soapaction
+ if @soapoperation
+ @soapoperation.soapaction
+ else
+ nil
+ end
+ end
+
+ def parse_element(element)
+ case element
+ when InputName
+ o = Param.new
+ @input = o
+ o
+ when OutputName
+ o = Param.new
+ @output = o
+ o
+ when FaultName
+ o = Param.new
+ @fault << o
+ o
+ when SOAPOperationName
+ o = WSDL::SOAP::Operation.new
+ @soapoperation = o
+ o
+ when DocumentationName
+ o = Documentation.new
+ o
+ else
+ nil
+ end
+ end
+
+ def parse_attr(attr, value)
+ case attr
+ when NameAttrName
+ @name = XSD::QName.new(targetnamespace, value.source)
+ else
+ nil
+ end
+ end
+end
+
+
+end
diff --git a/lib/wsdl/param.rb b/lib/wsdl/param.rb
new file mode 100644
index 0000000000..b6836b7def
--- /dev/null
+++ b/lib/wsdl/param.rb
@@ -0,0 +1,85 @@
+# WSDL4R - WSDL param definition.
+# Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+require 'wsdl/info'
+
+
+module WSDL
+
+
+class Param < Info
+ attr_reader :message # required
+ attr_reader :name # optional but required for fault.
+ attr_reader :soapbody
+ attr_reader :soapheader
+ attr_reader :soapfault
+
+ def initialize
+ super
+ @message = nil
+ @name = nil
+ @soapbody = nil
+ @soapheader = []
+ @soapfault = nil
+ end
+
+ def targetnamespace
+ parent.targetnamespace
+ end
+
+ def find_message
+ root.message(@message) or raise RuntimeError.new("#{@message} not found")
+ end
+
+ def soapbody_use
+ if @soapbody
+ @soapbody.use || :literal
+ else
+ raise RuntimeError.new("soap:body not found")
+ end
+ end
+
+ def parse_element(element)
+ case element
+ when SOAPBodyName
+ o = WSDL::SOAP::Body.new
+ @soapbody = o
+ o
+ when SOAPHeaderName
+ o = WSDL::SOAP::Header.new
+ @soapheader << o
+ o
+ when SOAPFaultName
+ o = WSDL::SOAP::Fault.new
+ @soap_fault = o
+ o
+ when DocumentationName
+ o = Documentation.new
+ o
+ else
+ nil
+ end
+ end
+
+ def parse_attr(attr, value)
+ case attr
+ when MessageAttrName
+ if value.namespace.nil?
+ value = XSD::QName.new(targetnamespace, value.source)
+ end
+ @message = value
+ when NameAttrName
+ @name = XSD::QName.new(targetnamespace, value.source)
+ else
+ nil
+ end
+ end
+end
+
+
+end
diff --git a/lib/wsdl/parser.rb b/lib/wsdl/parser.rb
new file mode 100644
index 0000000000..f96e96ee2a
--- /dev/null
+++ b/lib/wsdl/parser.rb
@@ -0,0 +1,163 @@
+# WSDL4R - WSDL XML Instance parser library.
+# Copyright (C) 2002, 2003, 2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+require 'xsd/qname'
+require 'xsd/ns'
+require 'xsd/charset'
+require 'xsd/datatypes'
+require 'xsd/xmlparser'
+require 'wsdl/wsdl'
+require 'wsdl/data'
+require 'wsdl/xmlSchema/data'
+require 'wsdl/soap/data'
+
+
+module WSDL
+
+
+class Parser
+ include WSDL
+
+ class ParseError < Error; end
+ class FormatDecodeError < ParseError; end
+ class UnknownElementError < FormatDecodeError; end
+ class UnknownAttributeError < FormatDecodeError; end
+ class UnexpectedElementError < FormatDecodeError; end
+ class ElementConstraintError < FormatDecodeError; end
+ class AttributeConstraintError < FormatDecodeError; end
+
+private
+
+ class ParseFrame
+ attr_reader :ns
+ attr_reader :name
+ attr_accessor :node
+
+ private
+
+ def initialize(ns, name, node)
+ @ns = ns
+ @name = name
+ @node = node
+ end
+ end
+
+public
+
+ def initialize(opt = {})
+ @parser = XSD::XMLParser.create_parser(self, opt)
+ @parsestack = nil
+ @lastnode = nil
+ @ignored = {}
+ @location = opt[:location]
+ @originalroot = opt[:originalroot]
+ end
+
+ def parse(string_or_readable)
+ @parsestack = []
+ @lastnode = nil
+ @textbuf = ''
+ @parser.do_parse(string_or_readable)
+ @lastnode
+ end
+
+ def charset
+ @parser.charset
+ end
+
+ def start_element(name, attrs)
+ lastframe = @parsestack.last
+ ns = parent = nil
+ if lastframe
+ ns = lastframe.ns.clone_ns
+ parent = lastframe.node
+ else
+ ns = XSD::NS.new
+ parent = nil
+ end
+ attrs = XSD::XMLParser.filter_ns(ns, attrs)
+ node = decode_tag(ns, name, attrs, parent)
+ @parsestack << ParseFrame.new(ns, name, node)
+ end
+
+ def characters(text)
+ lastframe = @parsestack.last
+ if lastframe
+ # Need not to be cloned because character does not have attr.
+ ns = lastframe.ns
+ decode_text(ns, text)
+ else
+ p text if $DEBUG
+ end
+ end
+
+ def end_element(name)
+ lastframe = @parsestack.pop
+ unless name == lastframe.name
+ raise UnexpectedElementError.new("closing element name '#{name}' does not match with opening element '#{lastframe.name}'")
+ end
+ decode_tag_end(lastframe.ns, lastframe.node)
+ @lastnode = lastframe.node
+ end
+
+private
+
+ def decode_tag(ns, name, attrs, parent)
+ o = nil
+ elename = ns.parse(name)
+ if !parent
+ if elename == DefinitionsName
+ o = Definitions.parse_element(elename)
+ o.location = @location
+ else
+ raise UnknownElementError.new("unknown element: #{elename}")
+ end
+ o.root = @originalroot if @originalroot # o.root = o otherwise
+ else
+ if elename == XMLSchema::AnnotationName
+ # only the first annotation element is allowed for each xsd element.
+ o = XMLSchema::Annotation.new
+ else
+ o = parent.parse_element(elename)
+ end
+ unless o
+ unless @ignored.key?(elename)
+ warn("ignored element: #{elename}")
+ @ignored[elename] = elename
+ end
+ o = Documentation.new # which accepts any element.
+ end
+ # node could be a pseudo element. pseudo element has its own parent.
+ o.root = parent.root
+ o.parent = parent if o.parent.nil?
+ end
+ attrs.each do |key, value|
+ attr_ele = ns.parse(key, true)
+ value_ele = ns.parse(value, true)
+ value_ele.source = value # for recovery; value may not be a QName
+ unless o.parse_attr(attr_ele, value_ele)
+ unless @ignored.key?(attr_ele)
+ warn("ignored attr: #{attr_ele}")
+ @ignored[attr_ele] = attr_ele
+ end
+ end
+ end
+ o
+ end
+
+ def decode_tag_end(ns, node)
+ node.parse_epilogue
+ end
+
+ def decode_text(ns, text)
+ @textbuf << text
+ end
+end
+
+
+end
diff --git a/lib/wsdl/part.rb b/lib/wsdl/part.rb
new file mode 100644
index 0000000000..5dafd4ee73
--- /dev/null
+++ b/lib/wsdl/part.rb
@@ -0,0 +1,52 @@
+# WSDL4R - WSDL part definition.
+# Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+require 'wsdl/info'
+
+
+module WSDL
+
+
+class Part < Info
+ attr_reader :name # required
+ attr_reader :element # optional
+ attr_reader :type # optional
+
+ def initialize
+ super
+ @name = nil
+ @element = nil
+ @type = nil
+ end
+
+ def parse_element(element)
+ case element
+ when DocumentationName
+ o = Documentation.new
+ o
+ else
+ nil
+ end
+ end
+
+ def parse_attr(attr, value)
+ case attr
+ when NameAttrName
+ @name = value.source
+ when ElementAttrName
+ @element = value
+ when TypeAttrName
+ @type = value
+ else
+ nil
+ end
+ end
+end
+
+
+end
diff --git a/lib/wsdl/port.rb b/lib/wsdl/port.rb
new file mode 100644
index 0000000000..883cc3232d
--- /dev/null
+++ b/lib/wsdl/port.rb
@@ -0,0 +1,84 @@
+# WSDL4R - WSDL port definition.
+# Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+require 'wsdl/info'
+
+
+module WSDL
+
+
+class Port < Info
+ attr_reader :name # required
+ attr_reader :binding # required
+ attr_reader :soap_address
+
+ def initialize
+ super
+ @name = nil
+ @binding = nil
+ @soap_address = nil
+ end
+
+ def targetnamespace
+ parent.targetnamespace
+ end
+
+ def porttype
+ root.porttype(find_binding.type)
+ end
+
+ def find_binding
+ root.binding(@binding) or raise RuntimeError.new("#{@binding} not found")
+ end
+
+ def inputoperation_map
+ result = {}
+ find_binding.operations.each do |op_bind|
+ op_info = op_bind.soapoperation.input_info
+ result[op_info.op_name] = op_info
+ end
+ result
+ end
+
+ def outputoperation_map
+ result = {}
+ find_binding.operations.each do |op_bind|
+ op_info = op_bind.soapoperation.output_info
+ result[op_info.op_name] = op_info
+ end
+ result
+ end
+
+ def parse_element(element)
+ case element
+ when SOAPAddressName
+ o = WSDL::SOAP::Address.new
+ @soap_address = o
+ o
+ when DocumentationName
+ o = Documentation.new
+ o
+ else
+ nil
+ end
+ end
+
+ def parse_attr(attr, value)
+ case attr
+ when NameAttrName
+ @name = XSD::QName.new(targetnamespace, value.source)
+ when BindingAttrName
+ @binding = value
+ else
+ nil
+ end
+ end
+end
+
+
+end
diff --git a/lib/wsdl/portType.rb b/lib/wsdl/portType.rb
new file mode 100644
index 0000000000..03e37690a8
--- /dev/null
+++ b/lib/wsdl/portType.rb
@@ -0,0 +1,73 @@
+# WSDL4R - WSDL portType definition.
+# Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+require 'wsdl/info'
+require 'xsd/namedelements'
+
+
+module WSDL
+
+
+class PortType < Info
+ attr_reader :name # required
+ attr_reader :operations
+
+ def targetnamespace
+ parent.targetnamespace
+ end
+
+ def initialize
+ super
+ @name = nil
+ @operations = XSD::NamedElements.new
+ end
+
+ def find_binding
+ root.bindings.find { |item| item.type == @name } or
+ raise RuntimeError.new("#{@name} not found")
+ end
+
+ def locations
+ bind_name = find_binding.name
+ result = []
+ root.services.each do |service|
+ service.ports.each do |port|
+ if port.binding == bind_name
+ result << port.soap_address.location if port.soap_address
+ end
+ end
+ end
+ result
+ end
+
+ def parse_element(element)
+ case element
+ when OperationName
+ o = Operation.new
+ @operations << o
+ o
+ when DocumentationName
+ o = Documentation.new
+ o
+ else
+ nil
+ end
+ end
+
+ def parse_attr(attr, value)
+ case attr
+ when NameAttrName
+ @name = XSD::QName.new(targetnamespace, value.source)
+ else
+ nil
+ end
+ end
+end
+
+
+end
diff --git a/lib/wsdl/service.rb b/lib/wsdl/service.rb
new file mode 100644
index 0000000000..652b127331
--- /dev/null
+++ b/lib/wsdl/service.rb
@@ -0,0 +1,61 @@
+# WSDL4R - WSDL service definition.
+# Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+require 'wsdl/info'
+require 'xsd/namedelements'
+
+
+module WSDL
+
+
+class Service < Info
+ attr_reader :name # required
+ attr_reader :ports
+ attr_reader :soap_address
+
+ def initialize
+ super
+ @name = nil
+ @ports = XSD::NamedElements.new
+ @soap_address = nil
+ end
+
+ def targetnamespace
+ parent.targetnamespace
+ end
+
+ def parse_element(element)
+ case element
+ when PortName
+ o = Port.new
+ @ports << o
+ o
+ when SOAPAddressName
+ o = WSDL::SOAP::Address.new
+ @soap_address = o
+ o
+ when DocumentationName
+ o = Documentation.new
+ o
+ else
+ nil
+ end
+ end
+
+ def parse_attr(attr, value)
+ case attr
+ when NameAttrName
+ @name = XSD::QName.new(targetnamespace, value.source)
+ else
+ nil
+ end
+ end
+end
+
+
+end
diff --git a/lib/wsdl/soap/address.rb b/lib/wsdl/soap/address.rb
new file mode 100644
index 0000000000..0b2b59caf0
--- /dev/null
+++ b/lib/wsdl/soap/address.rb
@@ -0,0 +1,40 @@
+# WSDL4R - WSDL SOAP address definition.
+# Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+require 'wsdl/info'
+
+
+module WSDL
+module SOAP
+
+
+class Address < Info
+ attr_reader :location
+
+ def initialize
+ super
+ @location = nil
+ end
+
+ def parse_element(element)
+ nil
+ end
+
+ def parse_attr(attr, value)
+ case attr
+ when LocationAttrName
+ @location = value.source
+ else
+ nil
+ end
+ end
+end
+
+
+end
+end
diff --git a/lib/wsdl/soap/binding.rb b/lib/wsdl/soap/binding.rb
new file mode 100644
index 0000000000..7e15a99701
--- /dev/null
+++ b/lib/wsdl/soap/binding.rb
@@ -0,0 +1,49 @@
+# WSDL4R - WSDL SOAP binding definition.
+# Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+require 'wsdl/info'
+
+
+module WSDL
+module SOAP
+
+
+class Binding < Info
+ attr_reader :style
+ attr_reader :transport
+
+ def initialize
+ super
+ @style = nil
+ @transport = nil
+ end
+
+ def parse_element(element)
+ nil
+ end
+
+ def parse_attr(attr, value)
+ case attr
+ when StyleAttrName
+ if ["document", "rpc"].include?(value.source)
+ @style = value.source.intern
+ else
+ raise Parser::AttributeConstraintError.new(
+ "Unexpected value #{ value }.")
+ end
+ when TransportAttrName
+ @transport = value.source
+ else
+ nil
+ end
+ end
+end
+
+
+end
+end
diff --git a/lib/wsdl/soap/body.rb b/lib/wsdl/soap/body.rb
new file mode 100644
index 0000000000..824f8121a2
--- /dev/null
+++ b/lib/wsdl/soap/body.rb
@@ -0,0 +1,56 @@
+# WSDL4R - WSDL SOAP body definition.
+# Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+require 'wsdl/info'
+
+
+module WSDL
+module SOAP
+
+
+class Body < Info
+ attr_reader :parts
+ attr_reader :use # required
+ attr_reader :encodingstyle
+ attr_reader :namespace
+
+ def initialize
+ super
+ @parts = nil
+ @use = nil
+ @encodingstyle = nil
+ @namespace = nil
+ end
+
+ def parse_element(element)
+ nil
+ end
+
+ def parse_attr(attr, value)
+ case attr
+ when PartsAttrName
+ @parts = value.source
+ when UseAttrName
+ if ['literal', 'encoded'].include?(value.source)
+ @use = value.source.intern
+ else
+ raise RuntimeError.new("unknown use of soap:body: #{value.source}")
+ end
+ when EncodingStyleAttrName
+ @encodingstyle = value.source
+ when NamespaceAttrName
+ @namespace = value.source
+ else
+ nil
+ end
+ end
+end
+
+
+end
+end
diff --git a/lib/wsdl/soap/cgiStubCreator.rb b/lib/wsdl/soap/cgiStubCreator.rb
new file mode 100644
index 0000000000..2c4dff2f62
--- /dev/null
+++ b/lib/wsdl/soap/cgiStubCreator.rb
@@ -0,0 +1,76 @@
+# WSDL4R - Creating CGI stub code from WSDL.
+# Copyright (C) 2002, 2003, 2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+require 'wsdl/info'
+require 'wsdl/soap/mappingRegistryCreator'
+require 'wsdl/soap/methodDefCreator'
+require 'wsdl/soap/classDefCreatorSupport'
+
+
+module WSDL
+module SOAP
+
+
+class CGIStubCreator
+ include ClassDefCreatorSupport
+
+ attr_reader :definitions
+
+ def initialize(definitions)
+ @definitions = definitions
+ end
+
+ def dump(service_name)
+ warn("CGI stub can have only 1 port. Creating stub for the first port... Rests are ignored.")
+ port = @definitions.service(service_name).ports[0]
+ dump_porttype(port.porttype.name)
+ end
+
+private
+
+ def dump_porttype(name)
+ class_name = create_class_name(name)
+ methoddef, types = MethodDefCreator.new(@definitions).dump(name)
+ mr_creator = MappingRegistryCreator.new(@definitions)
+ c1 = XSD::CodeGen::ClassDef.new(class_name)
+ c1.def_require("soap/rpc/cgistub")
+ c1.def_require("soap/mapping/registry")
+ c1.def_const("MappingRegistry", "::SOAP::Mapping::Registry.new")
+ c1.def_code(mr_creator.dump(types))
+ c1.def_code <<-EOD
+Methods = [
+#{methoddef.gsub(/^/, " ")}
+]
+ EOD
+ c2 = XSD::CodeGen::ClassDef.new(class_name + "App",
+ "::SOAP::RPC::CGIStub")
+ c2.def_method("initialize", "*arg") do
+ <<-EOD
+ super(*arg)
+ servant = #{class_name}.new
+ #{class_name}::Methods.each do |definitions|
+ opt = definitions.last
+ if opt[:request_style] == :document
+ @router.add_document_operation(servant, *definitions)
+ else
+ @router.add_rpc_operation(servant, *definitions)
+ end
+ end
+ self.mapping_registry = #{class_name}::MappingRegistry
+ self.level = Logger::Severity::ERROR
+ EOD
+ end
+ c1.dump + "\n" + c2.dump + format(<<-EOD)
+ #{class_name}App.new('app', nil).start
+ EOD
+ end
+end
+
+
+end
+end
diff --git a/lib/wsdl/soap/classDefCreator.rb b/lib/wsdl/soap/classDefCreator.rb
new file mode 100644
index 0000000000..aeb67c0613
--- /dev/null
+++ b/lib/wsdl/soap/classDefCreator.rb
@@ -0,0 +1,314 @@
+# WSDL4R - Creating class definition from WSDL
+# Copyright (C) 2002, 2003, 2004 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+require 'wsdl/data'
+require 'wsdl/soap/classDefCreatorSupport'
+require 'xsd/codegen'
+
+
+module WSDL
+module SOAP
+
+
+class ClassDefCreator
+ include ClassDefCreatorSupport
+
+ def initialize(definitions)
+ @elements = definitions.collect_elements
+ @simpletypes = definitions.collect_simpletypes
+ @complextypes = definitions.collect_complextypes
+ @faulttypes = nil
+ if definitions.respond_to?(:collect_faulttypes)
+ @faulttypes = definitions.collect_faulttypes
+ end
+ end
+
+ def dump(type = nil)
+ result = "require 'xsd/qname'\n"
+ if type
+ result = dump_classdef(type.name, type)
+ else
+ str = dump_element
+ unless str.empty?
+ result << "\n" unless result.empty?
+ result << str
+ end
+ str = dump_complextype
+ unless str.empty?
+ result << "\n" unless result.empty?
+ result << str
+ end
+ str = dump_simpletype
+ unless str.empty?
+ result << "\n" unless result.empty?
+ result << str
+ end
+ end
+ result
+ end
+
+private
+
+ def dump_element
+ @elements.collect { |ele|
+ if ele.local_complextype
+ dump_classdef(ele.name, ele.local_complextype,
+ ele.elementform == 'qualified')
+ elsif ele.local_simpletype
+ dump_simpletypedef(ele.name, ele.local_simpletype)
+ else
+ nil
+ end
+ }.compact.join("\n")
+ end
+
+ def dump_simpletype
+ @simpletypes.collect { |type|
+ dump_simpletypedef(type.name, type)
+ }.compact.join("\n")
+ end
+
+ def dump_complextype
+ @complextypes.collect { |type|
+ case type.compoundtype
+ when :TYPE_STRUCT, :TYPE_EMPTY
+ dump_classdef(type.name, type)
+ when :TYPE_ARRAY
+ dump_arraydef(type)
+ when :TYPE_SIMPLE
+ dump_simpleclassdef(type)
+ when :TYPE_MAP
+ # mapped as a general Hash
+ nil
+ else
+ raise RuntimeError.new(
+ "unknown kind of complexContent: #{type.compoundtype}")
+ end
+ }.compact.join("\n")
+ end
+
+ def dump_simpletypedef(qname, simpletype)
+ if !simpletype.restriction or simpletype.restriction.enumeration.empty?
+ return nil
+ end
+ c = XSD::CodeGen::ModuleDef.new(create_class_name(qname))
+ c.comment = "#{qname}"
+ const = {}
+ simpletype.restriction.enumeration.each do |value|
+ constname = safeconstname(value)
+ const[constname] ||= 0
+ if (const[constname] += 1) > 1
+ constname += "_#{const[constname]}"
+ end
+ c.def_const(constname, ndq(value))
+ end
+ c.dump
+ end
+
+ def dump_simpleclassdef(type_or_element)
+ qname = type_or_element.name
+ base = create_class_name(type_or_element.simplecontent.base)
+ c = XSD::CodeGen::ClassDef.new(create_class_name(qname), base)
+ c.comment = "#{qname}"
+ c.dump
+ end
+
+ def dump_classdef(qname, typedef, qualified = false)
+ if @faulttypes and @faulttypes.index(qname)
+ c = XSD::CodeGen::ClassDef.new(create_class_name(qname),
+ '::StandardError')
+ else
+ c = XSD::CodeGen::ClassDef.new(create_class_name(qname))
+ end
+ c.comment = "#{qname}"
+ c.def_classvar('schema_type', ndq(qname.name))
+ c.def_classvar('schema_ns', ndq(qname.namespace))
+ c.def_classvar('schema_qualified', dq('true')) if qualified
+ schema_element = []
+ init_lines = ''
+ params = []
+ typedef.each_element do |element|
+ if element.type == XSD::AnyTypeName
+ type = nil
+ elsif klass = element_basetype(element)
+ type = klass.name
+ elsif element.type
+ type = create_class_name(element.type)
+ else
+ type = nil # means anyType.
+ # do we define a class for local complexType from it's name?
+ # type = create_class_name(element.name)
+ # <element>
+ # <complexType>
+ # <seq...>
+ # </complexType>
+ # </element>
+ end
+ name = name_element(element).name
+ attrname = safemethodname?(name) ? name : safemethodname(name)
+ varname = safevarname(name)
+ c.def_attr(attrname, true, varname)
+ init_lines << "@#{varname} = #{varname}\n"
+ if element.map_as_array?
+ params << "#{varname} = []"
+ type << '[]' if type
+ else
+ params << "#{varname} = nil"
+ end
+ # nil means @@schema_ns + varname
+ eleqname =
+ (varname == name && element.name.namespace == qname.namespace) ?
+ nil : element.name
+ schema_element << [varname, eleqname, type]
+ end
+ unless typedef.attributes.empty?
+ define_attribute(c, typedef.attributes)
+ init_lines << "@__xmlattr = {}\n"
+ end
+ c.def_classvar('schema_element',
+ '[' +
+ schema_element.collect { |varname, name, type|
+ '[' +
+ (
+ if name
+ varname.dump + ', [' + ndq(type) + ', ' + dqname(name) + ']'
+ else
+ varname.dump + ', ' + ndq(type)
+ end
+ ) +
+ ']'
+ }.join(', ') +
+ ']'
+ )
+ c.def_method('initialize', *params) do
+ init_lines
+ end
+ c.dump
+ end
+
+ def element_basetype(ele)
+ if klass = basetype_class(ele.type)
+ klass
+ elsif ele.local_simpletype
+ basetype_class(ele.local_simpletype.base)
+ else
+ nil
+ end
+ end
+
+ def attribute_basetype(attr)
+ if klass = basetype_class(attr.type)
+ klass
+ elsif attr.local_simpletype
+ basetype_class(attr.local_simpletype.base)
+ else
+ nil
+ end
+ end
+
+ def basetype_class(type)
+ return nil if type.nil?
+ if simpletype = @simpletypes[type]
+ basetype_mapped_class(simpletype.base)
+ else
+ basetype_mapped_class(type)
+ end
+ end
+
+ def define_attribute(c, attributes)
+ schema_attribute = []
+ attributes.each do |attribute|
+ name = name_attribute(attribute)
+ if klass = attribute_basetype(attribute)
+ type = klass.name
+ else
+ type = nil
+ end
+ methodname = safemethodname('xmlattr_' + name.name)
+ c.def_method(methodname) do <<-__EOD__
+ (@__xmlattr ||= {})[#{dqname(name)}]
+ __EOD__
+ end
+ c.def_method(methodname + '=', 'value') do <<-__EOD__
+ (@__xmlattr ||= {})[#{dqname(name)}] = value
+ __EOD__
+ end
+ schema_attribute << [name, type]
+ end
+ c.def_classvar('schema_attribute',
+ '{' +
+ schema_attribute.collect { |name, type|
+ dqname(name) + ' => ' + ndq(type)
+ }.join(', ') +
+ '}'
+ )
+ end
+
+ def name_element(element)
+ return element.name if element.name
+ return element.ref if element.ref
+ raise RuntimeError.new("cannot define name of #{element}")
+ end
+
+ def name_attribute(attribute)
+ return attribute.name if attribute.name
+ return attribute.ref if attribute.ref
+ raise RuntimeError.new("cannot define name of #{attribute}")
+ end
+
+ DEFAULT_ITEM_NAME = XSD::QName.new(nil, 'item')
+
+ def dump_arraydef(complextype)
+ qname = complextype.name
+ c = XSD::CodeGen::ClassDef.new(create_class_name(qname), '::Array')
+ c.comment = "#{qname}"
+ child_type = complextype.child_type
+ c.def_classvar('schema_type', ndq(child_type.name))
+ c.def_classvar('schema_ns', ndq(child_type.namespace))
+ child_element = complextype.find_aryelement
+ schema_element = []
+ if child_type == XSD::AnyTypeName
+ type = nil
+ elsif child_element and (klass = element_basetype(child_element))
+ type = klass.name
+ elsif child_type
+ type = create_class_name(child_type)
+ else
+ type = nil
+ end
+ if child_element
+ if child_element.map_as_array?
+ type << '[]' if type
+ end
+ child_element_name = child_element.name
+ else
+ child_element_name = DEFAULT_ITEM_NAME
+ end
+ schema_element << [child_element_name.name, child_element_name, type]
+ c.def_classvar('schema_element',
+ '[' +
+ schema_element.collect { |varname, name, type|
+ '[' +
+ (
+ if name
+ varname.dump + ', [' + ndq(type) + ', ' + dqname(name) + ']'
+ else
+ varname.dump + ', ' + ndq(type)
+ end
+ ) +
+ ']'
+ }.join(', ') +
+ ']'
+ )
+ c.dump
+ end
+end
+
+
+end
+end
diff --git a/lib/wsdl/soap/classDefCreatorSupport.rb b/lib/wsdl/soap/classDefCreatorSupport.rb
new file mode 100644
index 0000000000..8f335653c8
--- /dev/null
+++ b/lib/wsdl/soap/classDefCreatorSupport.rb
@@ -0,0 +1,126 @@
+# WSDL4R - Creating class code support from WSDL.
+# Copyright (C) 2004 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+require 'wsdl/info'
+require 'soap/mapping'
+require 'soap/mapping/typeMap'
+require 'xsd/codegen/gensupport'
+
+
+module WSDL
+module SOAP
+
+
+module ClassDefCreatorSupport
+ include XSD::CodeGen::GenSupport
+
+ def create_class_name(qname)
+ if klass = basetype_mapped_class(qname)
+ ::SOAP::Mapping::DefaultRegistry.find_mapped_obj_class(klass).name
+ else
+ safeconstname(qname.name)
+ end
+ end
+
+ def basetype_mapped_class(name)
+ ::SOAP::TypeMap[name]
+ end
+
+ def dump_method_signature(operation)
+ name = operation.name.name
+ input = operation.input
+ output = operation.output
+ fault = operation.fault
+ signature = "#{ name }#{ dump_inputparam(input) }"
+ str = <<__EOD__
+# SYNOPSIS
+# #{name}#{dump_inputparam(input)}
+#
+# ARGS
+#{dump_inout_type(input).chomp}
+#
+# RETURNS
+#{dump_inout_type(output).chomp}
+#
+__EOD__
+ unless fault.empty?
+ faultstr = (fault.collect { |f| dump_inout_type(f).chomp }).join(', ')
+ str <<<<__EOD__
+# RAISES
+# #{faultstr}
+#
+__EOD__
+ end
+ str
+ end
+
+ def dq(ele)
+ ele.dump
+ end
+
+ def ndq(ele)
+ ele.nil? ? 'nil' : dq(ele)
+ end
+
+ def sym(ele)
+ ':' + ele
+ end
+
+ def dqname(qname)
+ qname.dump
+ end
+
+private
+
+ def dump_inout_type(param)
+ if param
+ message = param.find_message
+ params = ""
+ message.parts.each do |part|
+ name = safevarname(part.name)
+ if part.type
+ typename = safeconstname(part.type.name)
+ params << add_at("# #{name}", "#{typename} - #{part.type}\n", 20)
+ elsif part.element
+ typename = safeconstname(part.element.name)
+ params << add_at("# #{name}", "#{typename} - #{part.element}\n", 20)
+ end
+ end
+ unless params.empty?
+ return params
+ end
+ end
+ "# N/A\n"
+ end
+
+ def dump_inputparam(input)
+ message = input.find_message
+ params = ""
+ message.parts.each do |part|
+ params << ", " unless params.empty?
+ params << safevarname(part.name)
+ end
+ if params.empty?
+ ""
+ else
+ "(#{ params })"
+ end
+ end
+
+ def add_at(base, str, pos)
+ if base.size >= pos
+ base + ' ' + str
+ else
+ base + ' ' * (pos - base.size) + str
+ end
+ end
+end
+
+
+end
+end
diff --git a/lib/wsdl/soap/clientSkeltonCreator.rb b/lib/wsdl/soap/clientSkeltonCreator.rb
new file mode 100644
index 0000000000..916f0d4dc0
--- /dev/null
+++ b/lib/wsdl/soap/clientSkeltonCreator.rb
@@ -0,0 +1,78 @@
+# WSDL4R - Creating client skelton code from WSDL.
+# Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+require 'wsdl/info'
+require 'wsdl/soap/classDefCreatorSupport'
+
+
+module WSDL
+module SOAP
+
+
+class ClientSkeltonCreator
+ include ClassDefCreatorSupport
+
+ attr_reader :definitions
+
+ def initialize(definitions)
+ @definitions = definitions
+ end
+
+ def dump(service_name)
+ result = ""
+ @definitions.service(service_name).ports.each do |port|
+ result << dump_porttype(port.porttype.name)
+ result << "\n"
+ end
+ result
+ end
+
+private
+
+ def dump_porttype(name)
+ drv_name = create_class_name(name)
+
+ result = ""
+ result << <<__EOD__
+endpoint_url = ARGV.shift
+obj = #{ drv_name }.new(endpoint_url)
+
+# run ruby with -d to see SOAP wiredumps.
+obj.wiredump_dev = STDERR if $DEBUG
+
+__EOD__
+ @definitions.porttype(name).operations.each do |operation|
+ result << dump_method_signature(operation)
+ result << dump_input_init(operation.input) << "\n"
+ result << dump_operation(operation) << "\n\n"
+ end
+ result
+ end
+
+ def dump_operation(operation)
+ name = operation.name
+ input = operation.input
+ "puts obj.#{ safemethodname(name.name) }#{ dump_inputparam(input) }"
+ end
+
+ def dump_input_init(input)
+ result = input.find_message.parts.collect { |part|
+ safevarname(part.name)
+ }.join(" = ")
+ if result.empty?
+ ""
+ else
+ result << " = nil"
+ end
+ result
+ end
+end
+
+
+end
+end
diff --git a/lib/wsdl/soap/complexType.rb b/lib/wsdl/soap/complexType.rb
new file mode 100644
index 0000000000..b2e13d0564
--- /dev/null
+++ b/lib/wsdl/soap/complexType.rb
@@ -0,0 +1,161 @@
+# WSDL4R - SOAP complexType definition for WSDL.
+# Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+require 'wsdl/xmlSchema/complexType'
+require 'soap/mapping'
+
+
+module WSDL
+module XMLSchema
+
+
+class ComplexType < Info
+ def compoundtype
+ @compoundtype ||= check_type
+ end
+
+ def check_type
+ if content
+ if attributes.empty? and
+ content.elements.size == 1 and content.elements[0].maxoccurs != '1'
+ if name == ::SOAP::Mapping::MapQName
+ :TYPE_MAP
+ else
+ :TYPE_ARRAY
+ end
+ else
+ :TYPE_STRUCT
+ end
+ elsif complexcontent
+ if complexcontent.base == ::SOAP::ValueArrayName
+ :TYPE_ARRAY
+ else
+ complexcontent.basetype.check_type
+ end
+ elsif simplecontent
+ :TYPE_SIMPLE
+ elsif !attributes.empty?
+ :TYPE_STRUCT
+ else # empty complexType definition (seen in partner.wsdl of salesforce)
+ :TYPE_EMPTY
+ end
+ end
+
+ def child_type(name = nil)
+ case compoundtype
+ when :TYPE_STRUCT
+ if ele = find_element(name)
+ ele.type
+ elsif ele = find_element_by_name(name.name)
+ ele.type
+ end
+ when :TYPE_ARRAY
+ @contenttype ||= content_arytype
+ when :TYPE_MAP
+ item_ele = find_element_by_name("item") or
+ raise RuntimeError.new("'item' element not found in Map definition.")
+ content = item_ele.local_complextype or
+ raise RuntimeError.new("No complexType definition for 'item'.")
+ if ele = content.find_element(name)
+ ele.type
+ elsif ele = content.find_element_by_name(name.name)
+ ele.type
+ end
+ else
+ raise NotImplementedError.new("Unknown kind of complexType.")
+ end
+ end
+
+ def child_defined_complextype(name)
+ ele = nil
+ case compoundtype
+ when :TYPE_STRUCT, :TYPE_MAP
+ unless ele = find_element(name)
+ if name.namespace.nil?
+ ele = find_element_by_name(name.name)
+ end
+ end
+ when :TYPE_ARRAY
+ if content.elements.size == 1
+ ele = content.elements[0]
+ else
+ raise RuntimeError.new("Assert: must not reach.")
+ end
+ else
+ raise RuntimeError.new("Assert: Not implemented.")
+ end
+ unless ele
+ raise RuntimeError.new("Cannot find #{name} as a children of #{@name}.")
+ end
+ ele.local_complextype
+ end
+
+ def find_arytype
+ unless compoundtype == :TYPE_ARRAY
+ raise RuntimeError.new("Assert: not for array")
+ end
+ if complexcontent
+ complexcontent.attributes.each do |attribute|
+ if attribute.ref == ::SOAP::AttrArrayTypeName
+ return attribute.arytype
+ end
+ end
+ if check_array_content(complexcontent.content)
+ return element_simpletype(complexcontent.content.elements[0])
+ end
+ elsif check_array_content(content)
+ return element_simpletype(content.elements[0])
+ end
+ raise RuntimeError.new("Assert: Unknown array definition.")
+ end
+
+ def find_aryelement
+ unless compoundtype == :TYPE_ARRAY
+ raise RuntimeError.new("Assert: not for array")
+ end
+ if complexcontent
+ if check_array_content(complexcontent.content)
+ return complexcontent.content.elements[0]
+ end
+ elsif check_array_content(content)
+ return content.elements[0]
+ end
+ nil # use default item name
+ end
+
+private
+
+ def element_simpletype(element)
+ if element.type
+ element.type
+ elsif element.local_simpletype
+ element.local_simpletype.base
+ else
+ nil
+ end
+ end
+
+ def check_array_content(content)
+ content and content.elements.size == 1 and
+ content.elements[0].maxoccurs != '1'
+ end
+
+ def content_arytype
+ if arytype = find_arytype
+ ns = arytype.namespace
+ name = arytype.name.sub(/\[(?:,)*\]$/, '')
+ XSD::QName.new(ns, name)
+ else
+ nil
+ end
+ end
+end
+
+
+end
+end
diff --git a/lib/wsdl/soap/data.rb b/lib/wsdl/soap/data.rb
new file mode 100644
index 0000000000..48512d3751
--- /dev/null
+++ b/lib/wsdl/soap/data.rb
@@ -0,0 +1,42 @@
+# WSDL4R - WSDL SOAP binding data definitions.
+# Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+require 'xsd/qname'
+require 'wsdl/soap/definitions'
+require 'wsdl/soap/binding'
+require 'wsdl/soap/operation'
+require 'wsdl/soap/body'
+require 'wsdl/soap/element'
+require 'wsdl/soap/header'
+require 'wsdl/soap/headerfault'
+require 'wsdl/soap/fault'
+require 'wsdl/soap/address'
+require 'wsdl/soap/complexType'
+
+
+module WSDL
+module SOAP
+
+
+HeaderFaultName = XSD::QName.new(SOAPBindingNamespace, 'headerfault')
+
+LocationAttrName = XSD::QName.new(nil, 'location')
+StyleAttrName = XSD::QName.new(nil, 'style')
+TransportAttrName = XSD::QName.new(nil, 'transport')
+UseAttrName = XSD::QName.new(nil, 'use')
+PartsAttrName = XSD::QName.new(nil, 'parts')
+PartAttrName = XSD::QName.new(nil, 'part')
+NameAttrName = XSD::QName.new(nil, 'name')
+MessageAttrName = XSD::QName.new(nil, 'message')
+EncodingStyleAttrName = XSD::QName.new(nil, 'encodingStyle')
+NamespaceAttrName = XSD::QName.new(nil, 'namespace')
+SOAPActionAttrName = XSD::QName.new(nil, 'soapAction')
+
+
+end
+end
diff --git a/lib/wsdl/soap/definitions.rb b/lib/wsdl/soap/definitions.rb
new file mode 100644
index 0000000000..b014d5af6b
--- /dev/null
+++ b/lib/wsdl/soap/definitions.rb
@@ -0,0 +1,149 @@
+# WSDL4R - WSDL additional definitions for SOAP.
+# Copyright (C) 2002-2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+require 'wsdl/info'
+require 'xsd/namedelements'
+require 'soap/mapping'
+
+
+module WSDL
+
+
+class Definitions < Info
+ def self.soap_rpc_complextypes
+ types = XSD::NamedElements.new
+ types << array_complextype
+ types << fault_complextype
+ types << exception_complextype
+ types
+ end
+
+ def self.array_complextype
+ type = XMLSchema::ComplexType.new(::SOAP::ValueArrayName)
+ type.complexcontent = XMLSchema::ComplexContent.new
+ type.complexcontent.base = ::SOAP::ValueArrayName
+ attr = XMLSchema::Attribute.new
+ attr.ref = ::SOAP::AttrArrayTypeName
+ anytype = XSD::AnyTypeName.dup
+ anytype.name += '[]'
+ attr.arytype = anytype
+ type.complexcontent.attributes << attr
+ type
+ end
+
+=begin
+<xs:complexType name="Fault" final="extension">
+ <xs:sequence>
+ <xs:element name="faultcode" type="xs:QName" />
+ <xs:element name="faultstring" type="xs:string" />
+ <xs:element name="faultactor" type="xs:anyURI" minOccurs="0" />
+ <xs:element name="detail" type="tns:detail" minOccurs="0" />
+ </xs:sequence>
+</xs:complexType>
+=end
+ def self.fault_complextype
+ type = XMLSchema::ComplexType.new(::SOAP::EleFaultName)
+ faultcode = XMLSchema::Element.new(::SOAP::EleFaultCodeName, XSD::XSDQName::Type)
+ faultstring = XMLSchema::Element.new(::SOAP::EleFaultStringName, XSD::XSDString::Type)
+ faultactor = XMLSchema::Element.new(::SOAP::EleFaultActorName, XSD::XSDAnyURI::Type)
+ faultactor.minoccurs = 0
+ detail = XMLSchema::Element.new(::SOAP::EleFaultDetailName, XSD::AnyTypeName)
+ detail.minoccurs = 0
+ type.all_elements = [faultcode, faultstring, faultactor, detail]
+ type.final = 'extension'
+ type
+ end
+
+ def self.exception_complextype
+ type = XMLSchema::ComplexType.new(XSD::QName.new(
+ ::SOAP::Mapping::RubyCustomTypeNamespace, 'SOAPException'))
+ excn_name = XMLSchema::Element.new(XSD::QName.new(nil, 'excn_type_name'), XSD::XSDString::Type)
+ cause = XMLSchema::Element.new(XSD::QName.new(nil, 'cause'), XSD::AnyTypeName)
+ backtrace = XMLSchema::Element.new(XSD::QName.new(nil, 'backtrace'), ::SOAP::ValueArrayName)
+ message = XMLSchema::Element.new(XSD::QName.new(nil, 'message'), XSD::XSDString::Type)
+ type.all_elements = [excn_name, cause, backtrace, message]
+ type
+ end
+
+ def soap_rpc_complextypes(binding)
+ types = rpc_operation_complextypes(binding)
+ types + self.class.soap_rpc_complextypes
+ end
+
+ def collect_faulttypes
+ result = []
+ collect_fault_messages.each do |name|
+ faultparts = message(name).parts
+ if faultparts.size != 1
+ raise RuntimeError.new("expecting fault message to have only 1 part")
+ end
+ if result.index(faultparts[0].type).nil?
+ result << faultparts[0].type
+ end
+ end
+ result
+ end
+
+private
+
+ def collect_fault_messages
+ result = []
+ porttypes.each do |porttype|
+ porttype.operations.each do |operation|
+ operation.fault.each do |fault|
+ if result.index(fault.message).nil?
+ result << fault.message
+ end
+ end
+ end
+ end
+ result
+ end
+
+ def rpc_operation_complextypes(binding)
+ types = XSD::NamedElements.new
+ binding.operations.each do |op_bind|
+ if op_bind_rpc?(op_bind)
+ operation = op_bind.find_operation
+ if op_bind.input
+ type = XMLSchema::ComplexType.new(op_bind.soapoperation_name)
+ message = messages[operation.input.message]
+ type.sequence_elements = elements_from_message(message)
+ types << type
+ end
+ if op_bind.output
+ type = XMLSchema::ComplexType.new(operation.outputname)
+ message = messages[operation.output.message]
+ type.sequence_elements = elements_from_message(message)
+ types << type
+ end
+ end
+ end
+ types
+ end
+
+ def op_bind_rpc?(op_bind)
+ op_bind.soapoperation_style == :rpc
+ end
+
+ def elements_from_message(message)
+ message.parts.collect { |part|
+ if part.element
+ collect_elements[part.element]
+ elsif part.name.nil? or part.type.nil?
+ raise RuntimeError.new("part of a message must be an element or typed")
+ else
+ qname = XSD::QName.new(nil, part.name)
+ XMLSchema::Element.new(qname, part.type)
+ end
+ }
+ end
+end
+
+
+end
diff --git a/lib/wsdl/soap/driverCreator.rb b/lib/wsdl/soap/driverCreator.rb
new file mode 100644
index 0000000000..eba7c158a2
--- /dev/null
+++ b/lib/wsdl/soap/driverCreator.rb
@@ -0,0 +1,95 @@
+# WSDL4R - Creating driver code from WSDL.
+# Copyright (C) 2002, 2003, 2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+require 'wsdl/info'
+require 'wsdl/soap/mappingRegistryCreator'
+require 'wsdl/soap/methodDefCreator'
+require 'wsdl/soap/classDefCreatorSupport'
+require 'xsd/codegen'
+
+
+module WSDL
+module SOAP
+
+
+class DriverCreator
+ include ClassDefCreatorSupport
+
+ attr_reader :definitions
+
+ def initialize(definitions)
+ @definitions = definitions
+ end
+
+ def dump(porttype = nil)
+ if porttype.nil?
+ result = ""
+ @definitions.porttypes.each do |type|
+ result << dump_porttype(type.name)
+ result << "\n"
+ end
+ else
+ result = dump_porttype(porttype)
+ end
+ result
+ end
+
+private
+
+ def dump_porttype(name)
+ class_name = create_class_name(name)
+ methoddef, types = MethodDefCreator.new(@definitions).dump(name)
+ mr_creator = MappingRegistryCreator.new(@definitions)
+ binding = @definitions.bindings.find { |item| item.type == name }
+ return '' unless binding.soapbinding # not a SOAP binding
+ address = @definitions.porttype(name).locations[0]
+
+ c = XSD::CodeGen::ClassDef.new(class_name, "::SOAP::RPC::Driver")
+ c.def_require("soap/rpc/driver")
+ c.def_const("MappingRegistry", "::SOAP::Mapping::Registry.new")
+ c.def_const("DefaultEndpointUrl", ndq(address))
+ c.def_code(mr_creator.dump(types))
+ c.def_code <<-EOD
+Methods = [
+#{methoddef.gsub(/^/, " ")}
+]
+ EOD
+ c.def_method("initialize", "endpoint_url = nil") do
+ <<-EOD
+ endpoint_url ||= DefaultEndpointUrl
+ super(endpoint_url, nil)
+ self.mapping_registry = MappingRegistry
+ init_methods
+ EOD
+ end
+ c.def_privatemethod("init_methods") do
+ <<-EOD
+ Methods.each do |definitions|
+ opt = definitions.last
+ if opt[:request_style] == :document
+ add_document_operation(*definitions)
+ else
+ add_rpc_operation(*definitions)
+ qname = definitions[0]
+ name = definitions[2]
+ if qname.name != name and qname.name.capitalize == name.capitalize
+ ::SOAP::Mapping.define_singleton_method(self, qname.name) do |*arg|
+ __send__(name, *arg)
+ end
+ end
+ end
+ end
+ EOD
+ end
+ c.dump
+ end
+end
+
+
+end
+end
diff --git a/lib/wsdl/soap/element.rb b/lib/wsdl/soap/element.rb
new file mode 100644
index 0000000000..0fa6017c5b
--- /dev/null
+++ b/lib/wsdl/soap/element.rb
@@ -0,0 +1,28 @@
+# WSDL4R - XMLSchema element definition for WSDL.
+# Copyright (C) 2004 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+require 'wsdl/xmlSchema/element'
+
+
+module WSDL
+module XMLSchema
+
+
+class Element < Info
+ def map_as_array?
+ maxoccurs != '1'
+ end
+
+ def attributes
+ @local_complextype.attributes
+ end
+end
+
+
+end
+end
diff --git a/lib/wsdl/soap/fault.rb b/lib/wsdl/soap/fault.rb
new file mode 100644
index 0000000000..2862b659ab
--- /dev/null
+++ b/lib/wsdl/soap/fault.rb
@@ -0,0 +1,56 @@
+# WSDL4R - WSDL SOAP body definition.
+# Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+require 'wsdl/info'
+
+
+module WSDL
+module SOAP
+
+
+class Fault < Info
+ attr_reader :name # required
+ attr_reader :use # required
+ attr_reader :encodingstyle
+ attr_reader :namespace
+
+ def initialize
+ super
+ @name = nil
+ @use = nil
+ @encodingstyle = nil
+ @namespace = nil
+ end
+
+ def targetnamespace
+ parent.targetnamespace
+ end
+
+ def parse_element(element)
+ nil
+ end
+
+ def parse_attr(attr, value)
+ case attr
+ when NameAttrName
+ @name = XSD::QName.new(targetnamespace, value.source)
+ when UseAttrName
+ @use = value.source
+ when EncodingStyleAttrName
+ @encodingstyle = value.source
+ when NamespaceAttrName
+ @namespace = value.source
+ else
+ nil
+ end
+ end
+end
+
+
+end
+end
diff --git a/lib/wsdl/soap/header.rb b/lib/wsdl/soap/header.rb
new file mode 100644
index 0000000000..8d7c4e9d70
--- /dev/null
+++ b/lib/wsdl/soap/header.rb
@@ -0,0 +1,86 @@
+# WSDL4R - WSDL SOAP body definition.
+# Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+require 'wsdl/info'
+
+
+module WSDL
+module SOAP
+
+
+class Header < Info
+ attr_reader :headerfault
+
+ attr_reader :message # required
+ attr_reader :part # required
+ attr_reader :use # required
+ attr_reader :encodingstyle
+ attr_reader :namespace
+
+ def initialize
+ super
+ @message = nil
+ @part = nil
+ @use = nil
+ @encodingstyle = nil
+ @namespace = nil
+ @headerfault = nil
+ end
+
+ def targetnamespace
+ parent.targetnamespace
+ end
+
+ def find_message
+ root.message(@message) or raise RuntimeError.new("#{@message} not found")
+ end
+
+ def find_part
+ find_message.parts.each do |part|
+ if part.name == @part
+ return part
+ end
+ end
+ raise RuntimeError.new("#{@part} not found")
+ end
+
+ def parse_element(element)
+ case element
+ when HeaderFaultName
+ o = WSDL::SOAP::HeaderFault.new
+ @headerfault = o
+ o
+ else
+ nil
+ end
+ end
+
+ def parse_attr(attr, value)
+ case attr
+ when MessageAttrName
+ if value.namespace.nil?
+ value = XSD::QName.new(targetnamespace, value.source)
+ end
+ @message = value
+ when PartAttrName
+ @part = value.source
+ when UseAttrName
+ @use = value.source
+ when EncodingStyleAttrName
+ @encodingstyle = value.source
+ when NamespaceAttrName
+ @namespace = value.source
+ else
+ nil
+ end
+ end
+end
+
+
+end
+end
diff --git a/lib/wsdl/soap/headerfault.rb b/lib/wsdl/soap/headerfault.rb
new file mode 100644
index 0000000000..d6b14f2646
--- /dev/null
+++ b/lib/wsdl/soap/headerfault.rb
@@ -0,0 +1,56 @@
+# WSDL4R - WSDL SOAP body definition.
+# Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+require 'wsdl/info'
+
+
+module WSDL
+module SOAP
+
+
+class HeaderFault < Info
+ attr_reader :message # required
+ attr_reader :part # required
+ attr_reader :use # required
+ attr_reader :encodingstyle
+ attr_reader :namespace
+
+ def initialize
+ super
+ @message = nil
+ @part = nil
+ @use = nil
+ @encodingstyle = nil
+ @namespace = nil
+ end
+
+ def parse_element(element)
+ nil
+ end
+
+ def parse_attr(attr, value)
+ case attr
+ when MessageAttrName
+ @message = value
+ when PartAttrName
+ @part = value.source
+ when UseAttrName
+ @use = value.source
+ when EncodingStyleAttrName
+ @encodingstyle = value.source
+ when NamespaceAttrName
+ @namespace = value.source
+ else
+ nil
+ end
+ end
+end
+
+
+end
+end
diff --git a/lib/wsdl/soap/mappingRegistryCreator.rb b/lib/wsdl/soap/mappingRegistryCreator.rb
new file mode 100644
index 0000000000..8669339ce4
--- /dev/null
+++ b/lib/wsdl/soap/mappingRegistryCreator.rb
@@ -0,0 +1,92 @@
+# WSDL4R - Creating MappingRegistry code from WSDL.
+# Copyright (C) 2002, 2003, 2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+require 'wsdl/info'
+require 'wsdl/soap/classDefCreatorSupport'
+
+
+module WSDL
+module SOAP
+
+
+class MappingRegistryCreator
+ include ClassDefCreatorSupport
+
+ attr_reader :definitions
+
+ def initialize(definitions)
+ @definitions = definitions
+ @complextypes = @definitions.collect_complextypes
+ @types = nil
+ end
+
+ def dump(types)
+ @types = types
+ map_cache = []
+ map = ""
+ @types.each do |type|
+ if map_cache.index(type).nil?
+ map_cache << type
+ if type.namespace != XSD::Namespace
+ if typemap = dump_typemap(type)
+ map << typemap
+ end
+ end
+ end
+ end
+ return map
+ end
+
+private
+
+ def dump_typemap(type)
+ if definedtype = @complextypes[type]
+ case definedtype.compoundtype
+ when :TYPE_STRUCT
+ dump_struct_typemap(definedtype)
+ when :TYPE_ARRAY
+ dump_array_typemap(definedtype)
+ when :TYPE_MAP, :TYPE_EMPTY
+ nil
+ else
+ raise NotImplementedError.new("must not reach here")
+ end
+ end
+ end
+
+ def dump_struct_typemap(definedtype)
+ ele = definedtype.name
+ return <<__EOD__
+MappingRegistry.set(
+ #{create_class_name(ele)},
+ ::SOAP::SOAPStruct,
+ ::SOAP::Mapping::Registry::TypedStructFactory,
+ { :type => #{dqname(ele)} }
+)
+__EOD__
+ end
+
+ def dump_array_typemap(definedtype)
+ ele = definedtype.name
+ arytype = definedtype.find_arytype || XSD::AnyTypeName
+ type = XSD::QName.new(arytype.namespace, arytype.name.sub(/\[(?:,)*\]$/, ''))
+ @types << type
+ return <<__EOD__
+MappingRegistry.set(
+ #{create_class_name(ele)},
+ ::SOAP::SOAPArray,
+ ::SOAP::Mapping::Registry::TypedArrayFactory,
+ { :type => #{dqname(type)} }
+)
+__EOD__
+ end
+end
+
+
+end
+end
diff --git a/lib/wsdl/soap/methodDefCreator.rb b/lib/wsdl/soap/methodDefCreator.rb
new file mode 100644
index 0000000000..f3ffadbe69
--- /dev/null
+++ b/lib/wsdl/soap/methodDefCreator.rb
@@ -0,0 +1,228 @@
+# WSDL4R - Creating driver code from WSDL.
+# Copyright (C) 2002, 2003, 2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+require 'wsdl/info'
+require 'wsdl/soap/classDefCreatorSupport'
+require 'soap/rpc/element'
+
+
+module WSDL
+module SOAP
+
+
+class MethodDefCreator
+ include ClassDefCreatorSupport
+
+ attr_reader :definitions
+
+ def initialize(definitions)
+ @definitions = definitions
+ @simpletypes = @definitions.collect_simpletypes
+ @complextypes = @definitions.collect_complextypes
+ @elements = @definitions.collect_elements
+ @types = []
+ end
+
+ def dump(porttype)
+ @types.clear
+ result = ""
+ operations = @definitions.porttype(porttype).operations
+ binding = @definitions.porttype_binding(porttype)
+ operations.each do |operation|
+ op_bind = binding.operations[operation.name]
+ next unless op_bind # no binding is defined
+ next unless op_bind.soapoperation # not a SOAP operation binding
+ result << ",\n" unless result.empty?
+ result << dump_method(operation, op_bind).chomp
+ end
+ return result, @types
+ end
+
+ def collect_rpcparameter(operation)
+ result = operation.inputparts.collect { |part|
+ collect_type(part.type)
+ param_set(::SOAP::RPC::SOAPMethod::IN, part.name, rpcdefinedtype(part))
+ }
+ outparts = operation.outputparts
+ if outparts.size > 0
+ retval = outparts[0]
+ collect_type(retval.type)
+ result << param_set(::SOAP::RPC::SOAPMethod::RETVAL, retval.name,
+ rpcdefinedtype(retval))
+ cdr(outparts).each { |part|
+ collect_type(part.type)
+ result << param_set(::SOAP::RPC::SOAPMethod::OUT, part.name,
+ rpcdefinedtype(part))
+ }
+ end
+ result
+ end
+
+ def collect_documentparameter(operation)
+ param = []
+ operation.inputparts.each do |input|
+ param << param_set(::SOAP::RPC::SOAPMethod::IN, input.name,
+ documentdefinedtype(input), elementqualified(input))
+ end
+ operation.outputparts.each do |output|
+ param << param_set(::SOAP::RPC::SOAPMethod::OUT, output.name,
+ documentdefinedtype(output), elementqualified(output))
+ end
+ param
+ end
+
+private
+
+ def dump_method(operation, binding)
+ name = safemethodname(operation.name.name)
+ name_as = operation.name.name
+ style = binding.soapoperation_style
+ inputuse = binding.input.soapbody_use
+ outputuse = binding.output.soapbody_use
+ namespace = binding.input.soapbody.namespace
+ if style == :rpc
+ qname = XSD::QName.new(namespace, name_as)
+ paramstr = param2str(collect_rpcparameter(operation))
+ else
+ qname = nil
+ paramstr = param2str(collect_documentparameter(operation))
+ end
+ if paramstr.empty?
+ paramstr = '[]'
+ else
+ paramstr = "[ " << paramstr.split(/\r?\n/).join("\n ") << " ]"
+ end
+ definitions = <<__EOD__
+#{ndq(binding.soapaction)},
+ #{dq(name)},
+ #{paramstr},
+ { :request_style => #{sym(style.id2name)}, :request_use => #{sym(inputuse.id2name)},
+ :response_style => #{sym(style.id2name)}, :response_use => #{sym(outputuse.id2name)} }
+__EOD__
+ if style == :rpc
+ return <<__EOD__
+[ #{qname.dump},
+ #{definitions}]
+__EOD__
+ else
+ return <<__EOD__
+[ #{definitions}]
+__EOD__
+ end
+ end
+
+ def rpcdefinedtype(part)
+ if mapped = basetype_mapped_class(part.type)
+ ['::' + mapped.name]
+ elsif definedtype = @simpletypes[part.type]
+ ['::' + basetype_mapped_class(definedtype.base).name]
+ elsif definedtype = @elements[part.element]
+ #['::SOAP::SOAPStruct', part.element.namespace, part.element.name]
+ ['nil', part.element.namespace, part.element.name]
+ elsif definedtype = @complextypes[part.type]
+ case definedtype.compoundtype
+ when :TYPE_STRUCT, :TYPE_EMPTY # ToDo: empty should be treated as void.
+ type = create_class_name(part.type)
+ [type, part.type.namespace, part.type.name]
+ when :TYPE_MAP
+ [Hash.name, part.type.namespace, part.type.name]
+ when :TYPE_ARRAY
+ arytype = definedtype.find_arytype || XSD::AnyTypeName
+ ns = arytype.namespace
+ name = arytype.name.sub(/\[(?:,)*\]$/, '')
+ type = create_class_name(XSD::QName.new(ns, name))
+ [type + '[]', ns, name]
+ else
+ raise NotImplementedError.new("must not reach here")
+ end
+ else
+ raise RuntimeError.new("part: #{part.name} cannot be resolved")
+ end
+ end
+
+ def documentdefinedtype(part)
+ if mapped = basetype_mapped_class(part.type)
+ ['::' + mapped.name, nil, part.name]
+ elsif definedtype = @simpletypes[part.type]
+ ['::' + basetype_mapped_class(definedtype.base).name, nil, part.name]
+ elsif definedtype = @elements[part.element]
+ ['::SOAP::SOAPElement', part.element.namespace, part.element.name]
+ elsif definedtype = @complextypes[part.type]
+ ['::SOAP::SOAPElement', part.type.namespace, part.type.name]
+ else
+ raise RuntimeError.new("part: #{part.name} cannot be resolved")
+ end
+ end
+
+ def elementqualified(part)
+ if mapped = basetype_mapped_class(part.type)
+ false
+ elsif definedtype = @simpletypes[part.type]
+ false
+ elsif definedtype = @elements[part.element]
+ definedtype.elementform == 'qualified'
+ elsif definedtype = @complextypes[part.type]
+ false
+ else
+ raise RuntimeError.new("part: #{part.name} cannot be resolved")
+ end
+ end
+
+ def param_set(io_type, name, type, ele = nil)
+ [io_type, name, type, ele]
+ end
+
+ def collect_type(type)
+ # ignore inline type definition.
+ return if type.nil?
+ return if @types.include?(type)
+ @types << type
+ return unless @complextypes[type]
+ @complextypes[type].each_element do |element|
+ collect_type(element.type)
+ end
+ end
+
+ def param2str(params)
+ params.collect { |param|
+ io, name, type, ele = param
+ unless ele.nil?
+ "[#{dq(io)}, #{dq(name)}, #{type2str(type)}, #{ele2str(ele)}]"
+ else
+ "[#{dq(io)}, #{dq(name)}, #{type2str(type)}]"
+ end
+ }.join(",\n")
+ end
+
+ def type2str(type)
+ if type.size == 1
+ "[#{dq(type[0])}]"
+ else
+ "[#{dq(type[0])}, #{ndq(type[1])}, #{dq(type[2])}]"
+ end
+ end
+
+ def ele2str(ele)
+ qualified = ele
+ if qualified
+ "true"
+ else
+ "false"
+ end
+ end
+
+ def cdr(ary)
+ result = ary.dup
+ result.shift
+ result
+ end
+end
+
+
+end
+end
diff --git a/lib/wsdl/soap/operation.rb b/lib/wsdl/soap/operation.rb
new file mode 100644
index 0000000000..502d34a07d
--- /dev/null
+++ b/lib/wsdl/soap/operation.rb
@@ -0,0 +1,122 @@
+# WSDL4R - WSDL SOAP operation definition.
+# Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+require 'wsdl/info'
+
+
+module WSDL
+module SOAP
+
+
+class Operation < Info
+ class OperationInfo
+ attr_reader :style
+ attr_reader :op_name
+ attr_reader :optype_name
+ attr_reader :headerparts
+ attr_reader :bodyparts
+ attr_reader :faultpart
+ attr_reader :soapaction
+
+ def initialize(style, op_name, optype_name, headerparts, bodyparts, faultpart, soapaction)
+ @style = style
+ @op_name = op_name
+ @optype_name = optype_name
+ @headerparts = headerparts
+ @bodyparts = bodyparts
+ @faultpart = faultpart
+ @soapaction = soapaction
+ end
+ end
+
+ attr_reader :soapaction
+ attr_reader :style
+
+ def initialize
+ super
+ @soapaction = nil
+ @style = nil
+ end
+
+ def parse_element(element)
+ nil
+ end
+
+ def parse_attr(attr, value)
+ case attr
+ when StyleAttrName
+ if ["document", "rpc"].include?(value.source)
+ @style = value.source.intern
+ else
+ raise Parser::AttributeConstraintError.new(
+ "Unexpected value #{ value }.")
+ end
+ when SOAPActionAttrName
+ @soapaction = value.source
+ else
+ nil
+ end
+ end
+
+ def input_info
+ name_info = parent.find_operation.input_info
+ param_info(name_info, parent.input)
+ end
+
+ def output_info
+ name_info = parent.find_operation.output_info
+ param_info(name_info, parent.output)
+ end
+
+ def operation_style
+ return @style if @style
+ if parent_binding.soapbinding
+ return parent_binding.soapbinding.style
+ end
+ nil
+ end
+
+private
+
+ def parent_binding
+ parent.parent
+ end
+
+ def param_info(name_info, param)
+ op_name = name_info.op_name
+ optype_name = name_info.optype_name
+
+ soapheader = param.soapheader
+ headerparts = soapheader.collect { |item| item.find_part }
+
+ soapbody = param.soapbody
+ if soapbody.encodingstyle and
+ soapbody.encodingstyle != ::SOAP::EncodingNamespace
+ raise NotImplementedError.new(
+ "EncodingStyle '#{ soapbody.encodingstyle }' not supported.")
+ end
+ if soapbody.namespace
+ op_name = XSD::QName.new(soapbody.namespace, op_name.name)
+ end
+ if soapbody.parts
+ target = soapbody.parts.split(/\s+/)
+ bodyparts = name_info.parts.find_all { |part|
+ target.include?(part.name)
+ }
+ else
+ bodyparts = name_info.parts
+ end
+
+ faultpart = nil
+ OperationInfo.new(operation_style, op_name, optype_name, headerparts, bodyparts, faultpart, parent.soapaction)
+ end
+end
+
+
+end
+end
diff --git a/lib/wsdl/soap/servantSkeltonCreator.rb b/lib/wsdl/soap/servantSkeltonCreator.rb
new file mode 100644
index 0000000000..88294ffed8
--- /dev/null
+++ b/lib/wsdl/soap/servantSkeltonCreator.rb
@@ -0,0 +1,67 @@
+# WSDL4R - Creating servant skelton code from WSDL.
+# Copyright (C) 2002, 2003, 2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+require 'wsdl/info'
+require 'wsdl/soap/classDefCreatorSupport'
+require 'xsd/codegen'
+
+
+module WSDL
+module SOAP
+
+
+class ServantSkeltonCreator
+ include ClassDefCreatorSupport
+ include XSD::CodeGen::GenSupport
+
+ attr_reader :definitions
+
+ def initialize(definitions)
+ @definitions = definitions
+ end
+
+ def dump(porttype = nil)
+ if porttype.nil?
+ result = ""
+ @definitions.porttypes.each do |type|
+ result << dump_porttype(type.name)
+ result << "\n"
+ end
+ else
+ result = dump_porttype(porttype)
+ end
+ result
+ end
+
+private
+
+ def dump_porttype(name)
+ class_name = create_class_name(name)
+ c = XSD::CodeGen::ClassDef.new(class_name)
+ operations = @definitions.porttype(name).operations
+ operations.each do |operation|
+ name = safemethodname(operation.name.name)
+ input = operation.input
+ params = input.find_message.parts.collect { |part|
+ safevarname(part.name)
+ }
+ m = XSD::CodeGen::MethodDef.new(name, params) do <<-EOD
+ p [#{params.join(", ")}]
+ raise NotImplementedError.new
+ EOD
+ end
+ m.comment = dump_method_signature(operation)
+ c.add_method(m)
+ end
+ c.dump
+ end
+end
+
+
+end
+end
diff --git a/lib/wsdl/soap/standaloneServerStubCreator.rb b/lib/wsdl/soap/standaloneServerStubCreator.rb
new file mode 100644
index 0000000000..0b751b5153
--- /dev/null
+++ b/lib/wsdl/soap/standaloneServerStubCreator.rb
@@ -0,0 +1,85 @@
+# WSDL4R - Creating standalone server stub code from WSDL.
+# Copyright (C) 2002, 2003, 2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+require 'wsdl/info'
+require 'wsdl/soap/mappingRegistryCreator'
+require 'wsdl/soap/methodDefCreator'
+require 'wsdl/soap/classDefCreatorSupport'
+
+
+module WSDL
+module SOAP
+
+
+class StandaloneServerStubCreator
+ include ClassDefCreatorSupport
+
+ attr_reader :definitions
+
+ def initialize(definitions)
+ @definitions = definitions
+ end
+
+ def dump(service_name)
+ warn("- Standalone stub can have only 1 port for now. So creating stub for the first port and rests are ignored.")
+ warn("- Standalone server stub ignores port location defined in WSDL. Location is http://localhost:10080/ by default. Generated client from WSDL must be configured to point this endpoint manually.")
+ port = @definitions.service(service_name).ports[0]
+ dump_porttype(port.porttype.name)
+ end
+
+private
+
+ def dump_porttype(name)
+ class_name = create_class_name(name)
+ methoddef, types = MethodDefCreator.new(@definitions).dump(name)
+ mr_creator = MappingRegistryCreator.new(@definitions)
+
+ c1 = XSD::CodeGen::ClassDef.new(class_name)
+ c1.def_require("soap/rpc/standaloneServer")
+ c1.def_require("soap/mapping/registry")
+ c1.def_const("MappingRegistry", "::SOAP::Mapping::Registry.new")
+ c1.def_code(mr_creator.dump(types))
+ c1.def_code <<-EOD
+Methods = [
+#{methoddef.gsub(/^/, " ")}
+]
+ EOD
+ c2 = XSD::CodeGen::ClassDef.new(class_name + "App",
+ "::SOAP::RPC::StandaloneServer")
+ c2.def_method("initialize", "*arg") do
+ <<-EOD
+ super(*arg)
+ servant = #{class_name}.new
+ #{class_name}::Methods.each do |definitions|
+ opt = definitions.last
+ if opt[:request_style] == :document
+ @router.add_document_operation(servant, *definitions)
+ else
+ @router.add_rpc_operation(servant, *definitions)
+ end
+ end
+ self.mapping_registry = #{class_name}::MappingRegistry
+ EOD
+ end
+ c1.dump + "\n" + c2.dump + format(<<-EOD)
+
+ if $0 == __FILE__
+ # Change listen port.
+ server = #{class_name}App.new('app', nil, '0.0.0.0', 10080)
+ trap(:INT) do
+ server.shutdown
+ end
+ server.start
+ end
+ EOD
+ end
+end
+
+
+end
+end
diff --git a/lib/wsdl/soap/wsdl2ruby.rb b/lib/wsdl/soap/wsdl2ruby.rb
new file mode 100644
index 0000000000..16b05fb032
--- /dev/null
+++ b/lib/wsdl/soap/wsdl2ruby.rb
@@ -0,0 +1,176 @@
+# WSDL4R - WSDL to ruby mapping library.
+# Copyright (C) 2002-2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+require 'logger'
+require 'xsd/qname'
+require 'wsdl/importer'
+require 'wsdl/soap/classDefCreator'
+require 'wsdl/soap/servantSkeltonCreator'
+require 'wsdl/soap/driverCreator'
+require 'wsdl/soap/clientSkeltonCreator'
+require 'wsdl/soap/standaloneServerStubCreator'
+require 'wsdl/soap/cgiStubCreator'
+
+
+module WSDL
+module SOAP
+
+
+class WSDL2Ruby
+ attr_accessor :location
+ attr_reader :opt
+ attr_accessor :logger
+ attr_accessor :basedir
+
+ def run
+ unless @location
+ raise RuntimeError, "WSDL location not given"
+ end
+ @wsdl = import(@location)
+ @name = @wsdl.name ? @wsdl.name.name : 'default'
+ create_file
+ end
+
+private
+
+ def initialize
+ @location = nil
+ @opt = {}
+ @logger = Logger.new(STDERR)
+ @basedir = nil
+ @wsdl = nil
+ @name = nil
+ end
+
+ def create_file
+ create_classdef if @opt.key?('classdef')
+ create_servant_skelton(@opt['servant_skelton']) if @opt.key?('servant_skelton')
+ create_cgi_stub(@opt['cgi_stub']) if @opt.key?('cgi_stub')
+ create_standalone_server_stub(@opt['standalone_server_stub']) if @opt.key?('standalone_server_stub')
+ create_driver(@opt['driver']) if @opt.key?('driver')
+ create_client_skelton(@opt['client_skelton']) if @opt.key?('client_skelton')
+ end
+
+ def create_classdef
+ @logger.info { "Creating class definition." }
+ @classdef_filename = @name + '.rb'
+ check_file(@classdef_filename) or return
+ write_file(@classdef_filename) do |f|
+ f << WSDL::SOAP::ClassDefCreator.new(@wsdl).dump
+ end
+ end
+
+ def create_client_skelton(servicename)
+ @logger.info { "Creating client skelton." }
+ servicename ||= @wsdl.services[0].name.name
+ @client_skelton_filename = servicename + 'Client.rb'
+ check_file(@client_skelton_filename) or return
+ write_file(@client_skelton_filename) do |f|
+ f << shbang << "\n"
+ f << "require '#{@driver_filename}'\n\n" if @driver_filename
+ f << WSDL::SOAP::ClientSkeltonCreator.new(@wsdl).dump(
+ create_name(servicename))
+ end
+ end
+
+ def create_servant_skelton(porttypename)
+ @logger.info { "Creating servant skelton." }
+ @servant_skelton_filename = (porttypename || @name + 'Servant') + '.rb'
+ check_file(@servant_skelton_filename) or return
+ write_file(@servant_skelton_filename) do |f|
+ f << "require '#{@classdef_filename}'\n\n" if @classdef_filename
+ f << WSDL::SOAP::ServantSkeltonCreator.new(@wsdl).dump(
+ create_name(porttypename))
+ end
+ end
+
+ def create_cgi_stub(servicename)
+ @logger.info { "Creating CGI stub." }
+ servicename ||= @wsdl.services[0].name.name
+ @cgi_stubFilename = servicename + '.cgi'
+ check_file(@cgi_stubFilename) or return
+ write_file(@cgi_stubFilename) do |f|
+ f << shbang << "\n"
+ if @servant_skelton_filename
+ f << "require '#{@servant_skelton_filename}'\n\n"
+ end
+ f << WSDL::SOAP::CGIStubCreator.new(@wsdl).dump(create_name(servicename))
+ end
+ end
+
+ def create_standalone_server_stub(servicename)
+ @logger.info { "Creating standalone stub." }
+ servicename ||= @wsdl.services[0].name.name
+ @standalone_server_stub_filename = servicename + '.rb'
+ check_file(@standalone_server_stub_filename) or return
+ write_file(@standalone_server_stub_filename) do |f|
+ f << shbang << "\n"
+ f << "require '#{@servant_skelton_filename}'\n\n" if @servant_skelton_filename
+ f << WSDL::SOAP::StandaloneServerStubCreator.new(@wsdl).dump(
+ create_name(servicename))
+ end
+ end
+
+ def create_driver(porttypename)
+ @logger.info { "Creating driver." }
+ @driver_filename = (porttypename || @name) + 'Driver.rb'
+ check_file(@driver_filename) or return
+ write_file(@driver_filename) do |f|
+ f << "require '#{@classdef_filename}'\n\n" if @classdef_filename
+ f << WSDL::SOAP::DriverCreator.new(@wsdl).dump(
+ create_name(porttypename))
+ end
+ end
+
+ def write_file(filename)
+ if @basedir
+ filename = File.join(basedir, filename)
+ end
+ File.open(filename, "w") do |f|
+ yield f
+ end
+ end
+
+ def check_file(filename)
+ if @basedir
+ filename = File.join(basedir, filename)
+ end
+ if FileTest.exist?(filename)
+ if @opt.key?('force')
+ @logger.warn {
+ "File '#{filename}' exists but overrides it."
+ }
+ true
+ else
+ @logger.warn {
+ "File '#{filename}' exists. #{$0} did not override it."
+ }
+ false
+ end
+ else
+ @logger.info { "Creates file '#{filename}'." }
+ true
+ end
+ end
+
+ def shbang
+ "#!/usr/bin/env ruby"
+ end
+
+ def create_name(name)
+ name ? XSD::QName.new(@wsdl.targetnamespace, name) : nil
+ end
+
+ def import(location)
+ WSDL::Importer.import(location)
+ end
+end
+
+
+end
+end
diff --git a/lib/wsdl/types.rb b/lib/wsdl/types.rb
new file mode 100644
index 0000000000..96ae5a4988
--- /dev/null
+++ b/lib/wsdl/types.rb
@@ -0,0 +1,43 @@
+# WSDL4R - WSDL types definition.
+# Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+require 'wsdl/info'
+
+
+module WSDL
+
+
+class Types < Info
+ attr_reader :schemas
+
+ def initialize
+ super
+ @schemas = []
+ end
+
+ def parse_element(element)
+ case element
+ when SchemaName
+ o = XMLSchema::Schema.new
+ @schemas << o
+ o
+ when DocumentationName
+ o = Documentation.new
+ o
+ else
+ nil
+ end
+ end
+
+ def parse_attr(attr, value)
+ nil
+ end
+end
+
+
+end
diff --git a/lib/wsdl/wsdl.rb b/lib/wsdl/wsdl.rb
new file mode 100644
index 0000000000..eb13c18806
--- /dev/null
+++ b/lib/wsdl/wsdl.rb
@@ -0,0 +1,23 @@
+# WSDL4R - Base definitions.
+# Copyright (C) 2000, 2001, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+require 'xsd/qname'
+
+
+module WSDL
+
+
+Version = '0.0.2'
+
+Namespace = 'http://schemas.xmlsoap.org/wsdl/'
+SOAPBindingNamespace ='http://schemas.xmlsoap.org/wsdl/soap/'
+
+class Error < StandardError; end
+
+
+end
diff --git a/lib/wsdl/xmlSchema/all.rb b/lib/wsdl/xmlSchema/all.rb
new file mode 100644
index 0000000000..bb9566feac
--- /dev/null
+++ b/lib/wsdl/xmlSchema/all.rb
@@ -0,0 +1,69 @@
+# WSDL4R - XMLSchema complexType definition for WSDL.
+# Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+require 'wsdl/info'
+
+
+module WSDL
+module XMLSchema
+
+
+class All < Info
+ attr_reader :minoccurs
+ attr_reader :maxoccurs
+ attr_reader :elements
+
+ def initialize
+ super()
+ @minoccurs = '1'
+ @maxoccurs = '1'
+ @elements = []
+ end
+
+ def targetnamespace
+ parent.targetnamespace
+ end
+
+ def elementformdefault
+ parent.elementformdefault
+ end
+
+ def <<(element)
+ @elements << element
+ end
+
+ def parse_element(element)
+ case element
+ when AnyName
+ o = Any.new
+ @elements << o
+ o
+ when ElementName
+ o = Element.new
+ @elements << o
+ o
+ else
+ nil
+ end
+ end
+
+ def parse_attr(attr, value)
+ case attr
+ when MaxOccursAttrName
+ @maxoccurs = value.source
+ when MinOccursAttrName
+ @minoccurs = value.source
+ else
+ nil
+ end
+ end
+end
+
+
+end
+end
diff --git a/lib/wsdl/xmlSchema/annotation.rb b/lib/wsdl/xmlSchema/annotation.rb
new file mode 100644
index 0000000000..633bd196f1
--- /dev/null
+++ b/lib/wsdl/xmlSchema/annotation.rb
@@ -0,0 +1,34 @@
+# WSDL4R - WSDL SOAP documentation element.
+# Copyright (C) 2003, 2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+require 'wsdl/info'
+
+
+module WSDL
+module XMLSchema
+
+
+class Annotation < Info
+ def initialize
+ super
+ end
+
+ def parse_element(element)
+ # Accepts any element.
+ self
+ end
+
+ def parse_attr(attr, value)
+ # Accepts any attribute.
+ true
+ end
+end
+
+
+end
+end
diff --git a/lib/wsdl/xmlSchema/any.rb b/lib/wsdl/xmlSchema/any.rb
new file mode 100644
index 0000000000..72d25e8dde
--- /dev/null
+++ b/lib/wsdl/xmlSchema/any.rb
@@ -0,0 +1,56 @@
+# WSDL4R - XMLSchema any definition for WSDL.
+# Copyright (C) 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+require 'wsdl/info'
+
+
+module WSDL
+module XMLSchema
+
+
+class Any < Info
+ attr_accessor :maxoccurs
+ attr_accessor :minoccurs
+ attr_accessor :namespace
+ attr_accessor :process_contents
+
+ def initialize
+ super()
+ @maxoccurs = '1'
+ @minoccurs = '1'
+ @namespace = '##any'
+ @process_contents = 'strict'
+ end
+
+ def targetnamespace
+ parent.targetnamespace
+ end
+
+ def parse_element(element)
+ nil
+ end
+
+ def parse_attr(attr, value)
+ case attr
+ when MaxOccursAttrName
+ @maxoccurs = value.source
+ when MinOccursAttrName
+ @minoccurs = value.source
+ when NamespaceAttrName
+ @namespace = value.source
+ when ProcessContentsAttrName
+ @process_contents = value.source
+ else
+ nil
+ end
+ end
+end
+
+
+end
+end
diff --git a/lib/wsdl/xmlSchema/attribute.rb b/lib/wsdl/xmlSchema/attribute.rb
new file mode 100644
index 0000000000..f9048661a2
--- /dev/null
+++ b/lib/wsdl/xmlSchema/attribute.rb
@@ -0,0 +1,127 @@
+# WSDL4R - XMLSchema attribute definition for WSDL.
+# Copyright (C) 2002, 2003, 2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+require 'wsdl/info'
+
+
+module WSDL
+module XMLSchema
+
+
+class Attribute < Info
+ class << self
+ if RUBY_VERSION > "1.7.0"
+ def attr_reader_ref(symbol)
+ name = symbol.to_s
+ define_method(name) {
+ instance_variable_get("@#{name}") ||
+ (refelement ? refelement.__send__(name) : nil)
+ }
+ end
+ else
+ def attr_reader_ref(symbol)
+ name = symbol.to_s
+ module_eval <<-EOS
+ def #{name}
+ @#{name} || (refelement ? refelement.#{name} : nil)
+ end
+ EOS
+ end
+ end
+ end
+
+ attr_writer :use
+ attr_writer :form
+ attr_writer :name
+ attr_writer :type
+ attr_writer :local_simpletype
+ attr_writer :default
+ attr_writer :fixed
+
+ attr_reader_ref :use
+ attr_reader_ref :form
+ attr_reader_ref :name
+ attr_reader_ref :type
+ attr_reader_ref :local_simpletype
+ attr_reader_ref :default
+ attr_reader_ref :fixed
+
+ attr_accessor :ref
+ attr_accessor :arytype
+
+ def initialize
+ super
+ @use = nil
+ @form = nil
+ @name = nil
+ @type = nil
+ @local_simpletype = nil
+ @default = nil
+ @fixed = nil
+ @ref = nil
+ @refelement = nil
+ @arytype = nil
+ end
+
+ def refelement
+ @refelement ||= root.collect_attributes[@ref]
+ end
+
+ def targetnamespace
+ parent.targetnamespace
+ end
+
+ def parse_element(element)
+ case element
+ when SimpleTypeName
+ @local_simpletype = SimpleType.new
+ @local_simpletype
+ end
+ end
+
+ def parse_attr(attr, value)
+ case attr
+ when RefAttrName
+ @ref = value
+ when UseAttrName
+ @use = value.source
+ when FormAttrName
+ @form = value.source
+ when NameAttrName
+ if directelement?
+ @name = XSD::QName.new(targetnamespace, value.source)
+ else
+ @name = XSD::QName.new(nil, value.source)
+ end
+ when TypeAttrName
+ @type = value
+ when DefaultAttrName
+ @default = value.source
+ when FixedAttrName
+ @fixed = value.source
+ when ArrayTypeAttrName
+ @arytype = if value.namespace.nil?
+ XSD::QName.new(XSD::Namespace, value.source)
+ else
+ value
+ end
+ else
+ nil
+ end
+ end
+
+private
+
+ def directelement?
+ parent.is_a?(Schema)
+ end
+end
+
+
+end
+end
diff --git a/lib/wsdl/xmlSchema/choice.rb b/lib/wsdl/xmlSchema/choice.rb
new file mode 100644
index 0000000000..f6d27fa38c
--- /dev/null
+++ b/lib/wsdl/xmlSchema/choice.rb
@@ -0,0 +1,69 @@
+# WSDL4R - XMLSchema complexType definition for WSDL.
+# Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+require 'wsdl/info'
+
+
+module WSDL
+module XMLSchema
+
+
+class Choice < Info
+ attr_reader :minoccurs
+ attr_reader :maxoccurs
+ attr_reader :elements
+
+ def initialize
+ super()
+ @minoccurs = '1'
+ @maxoccurs = '1'
+ @elements = []
+ end
+
+ def targetnamespace
+ parent.targetnamespace
+ end
+
+ def elementformdefault
+ parent.elementformdefault
+ end
+
+ def <<(element)
+ @elements << element
+ end
+
+ def parse_element(element)
+ case element
+ when AnyName
+ o = Any.new
+ @elements << o
+ o
+ when ElementName
+ o = Element.new
+ @elements << o
+ o
+ else
+ nil
+ end
+ end
+
+ def parse_attr(attr, value)
+ case attr
+ when MaxOccursAttrName
+ @maxoccurs = value.source
+ when MinOccursAttrName
+ @minoccurs = value.source
+ else
+ nil
+ end
+ end
+end
+
+
+end
+end
diff --git a/lib/wsdl/xmlSchema/complexContent.rb b/lib/wsdl/xmlSchema/complexContent.rb
new file mode 100644
index 0000000000..f7fb6c16b4
--- /dev/null
+++ b/lib/wsdl/xmlSchema/complexContent.rb
@@ -0,0 +1,92 @@
+# WSDL4R - XMLSchema complexContent definition for WSDL.
+# Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+require 'wsdl/info'
+require 'xsd/namedelements'
+
+
+module WSDL
+module XMLSchema
+
+
+class ComplexContent < Info
+ attr_accessor :base
+ attr_reader :derivetype
+ attr_reader :content
+ attr_reader :attributes
+
+ def initialize
+ super
+ @base = nil
+ @derivetype = nil
+ @content = nil
+ @attributes = XSD::NamedElements.new
+ @basetype = nil
+ end
+
+ def targetnamespace
+ parent.targetnamespace
+ end
+
+ def elementformdefault
+ parent.elementformdefault
+ end
+
+ def basetype
+ @basetype ||= root.collect_complextypes[@base]
+ end
+
+ def parse_element(element)
+ case element
+ when RestrictionName, ExtensionName
+ @derivetype = element.name
+ self
+ when AllName
+ if @derivetype.nil?
+ raise Parser::ElementConstraintError.new("base attr not found.")
+ end
+ @content = All.new
+ @content
+ when SequenceName
+ if @derivetype.nil?
+ raise Parser::ElementConstraintError.new("base attr not found.")
+ end
+ @content = Sequence.new
+ @content
+ when ChoiceName
+ if @derivetype.nil?
+ raise Parser::ElementConstraintError.new("base attr not found.")
+ end
+ @content = Choice.new
+ @content
+ when AttributeName
+ if @derivetype.nil?
+ raise Parser::ElementConstraintError.new("base attr not found.")
+ end
+ o = Attribute.new
+ @attributes << o
+ o
+ end
+ end
+
+ def parse_attr(attr, value)
+ if @derivetype.nil?
+ return nil
+ end
+ case attr
+ when BaseAttrName
+ @base = value
+ else
+ nil
+ end
+ end
+end
+
+
+end
+end
diff --git a/lib/wsdl/xmlSchema/complexType.rb b/lib/wsdl/xmlSchema/complexType.rb
new file mode 100644
index 0000000000..dc9ec954fc
--- /dev/null
+++ b/lib/wsdl/xmlSchema/complexType.rb
@@ -0,0 +1,139 @@
+# WSDL4R - XMLSchema complexType definition for WSDL.
+# Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+require 'wsdl/info'
+require 'wsdl/xmlSchema/content'
+require 'wsdl/xmlSchema/element'
+require 'xsd/namedelements'
+
+
+module WSDL
+module XMLSchema
+
+
+class ComplexType < Info
+ attr_accessor :name
+ attr_accessor :complexcontent
+ attr_accessor :simplecontent
+ attr_reader :content
+ attr_accessor :final
+ attr_accessor :mixed
+ attr_reader :attributes
+
+ def initialize(name = nil)
+ super()
+ @name = name
+ @complexcontent = nil
+ @simplecontent = nil
+ @content = nil
+ @final = nil
+ @mixed = false
+ @attributes = XSD::NamedElements.new
+ end
+
+ def targetnamespace
+ # inner elements can be qualified
+ # parent.is_a?(WSDL::XMLSchema::Element) ? nil : parent.targetnamespace
+ parent.targetnamespace
+ end
+
+ def elementformdefault
+ parent.elementformdefault
+ end
+
+ AnyAsElement = Element.new(XSD::QName.new(nil, 'any'), XSD::AnyTypeName)
+ def each_element
+ if content
+ content.elements.each do |element|
+ if element.is_a?(Any)
+ yield(AnyAsElement)
+ else
+ yield(element)
+ end
+ end
+ end
+ end
+
+ def find_element(name)
+ if content
+ content.elements.each do |element|
+ if element.is_a?(Any)
+ return AnyAsElement if name == AnyAsElement.name
+ else
+ return element if name == element.name
+ end
+ end
+ end
+ nil
+ end
+
+ def find_element_by_name(name)
+ if content
+ content.elements.each do |element|
+ if element.is_a?(Any)
+ return AnyAsElement if name == AnyAsElement.name.name
+ else
+ return element if name == element.name.name
+ end
+ end
+ end
+ nil
+ end
+
+ def sequence_elements=(elements)
+ @content = Sequence.new
+ elements.each do |element|
+ @content << element
+ end
+ end
+
+ def all_elements=(elements)
+ @content = All.new
+ elements.each do |element|
+ @content << element
+ end
+ end
+
+ def parse_element(element)
+ case element
+ when AllName
+ @content = All.new
+ when SequenceName
+ @content = Sequence.new
+ when ChoiceName
+ @content = Choice.new
+ when ComplexContentName
+ @complexcontent = ComplexContent.new
+ when SimpleContentName
+ @simplecontent = SimpleContent.new
+ when AttributeName
+ o = Attribute.new
+ @attributes << o
+ o
+ else
+ nil
+ end
+ end
+
+ def parse_attr(attr, value)
+ case attr
+ when FinalAttrName
+ @final = value.source
+ when MixedAttrName
+ @mixed = (value.source == 'true')
+ when NameAttrName
+ @name = XSD::QName.new(targetnamespace, value.source)
+ else
+ nil
+ end
+ end
+end
+
+
+end
+end
diff --git a/lib/wsdl/xmlSchema/content.rb b/lib/wsdl/xmlSchema/content.rb
new file mode 100644
index 0000000000..2f1dfb4b6c
--- /dev/null
+++ b/lib/wsdl/xmlSchema/content.rb
@@ -0,0 +1,96 @@
+# WSDL4R - XMLSchema complexType definition for WSDL.
+# Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+require 'wsdl/info'
+
+
+module WSDL
+module XMLSchema
+
+
+class Content < Info
+ attr_accessor :final
+ attr_accessor :mixed
+ attr_accessor :type
+ attr_reader :contents
+ attr_reader :elements
+
+ def initialize
+ super()
+ @final = nil
+ @mixed = false
+ @type = nil
+ @contents = []
+ @elements = []
+ end
+
+ def targetnamespace
+ parent.targetnamespace
+ end
+
+ def <<(content)
+ @contents << content
+ update_elements
+ end
+
+ def each
+ @contents.each do |content|
+ yield content
+ end
+ end
+
+ def parse_element(element)
+ case element
+ when AllName, SequenceName, ChoiceName
+ o = Content.new
+ o.type = element.name
+ @contents << o
+ o
+ when AnyName
+ o = Any.new
+ @contents << o
+ o
+ when ElementName
+ o = Element.new
+ @contents << o
+ o
+ else
+ nil
+ end
+ end
+
+ def parse_attr(attr, value)
+ case attr
+ when FinalAttrName
+ @final = value.source
+ when MixedAttrName
+ @mixed = (value.source == 'true')
+ else
+ nil
+ end
+ end
+
+ def parse_epilogue
+ update_elements
+ end
+
+private
+
+ def update_elements
+ @elements = []
+ @contents.each do |content|
+ if content.is_a?(Element)
+ @elements << [content.name, content]
+ end
+ end
+ end
+end
+
+
+end
+end
diff --git a/lib/wsdl/xmlSchema/data.rb b/lib/wsdl/xmlSchema/data.rb
new file mode 100644
index 0000000000..23ab1adf0b
--- /dev/null
+++ b/lib/wsdl/xmlSchema/data.rb
@@ -0,0 +1,80 @@
+# WSDL4R - XMLSchema data definitions.
+# Copyright (C) 2002, 2003, 2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+require 'xsd/datatypes'
+require 'wsdl/xmlSchema/annotation'
+require 'wsdl/xmlSchema/schema'
+require 'wsdl/xmlSchema/import'
+require 'wsdl/xmlSchema/include'
+require 'wsdl/xmlSchema/simpleType'
+require 'wsdl/xmlSchema/simpleRestriction'
+require 'wsdl/xmlSchema/simpleExtension'
+require 'wsdl/xmlSchema/complexType'
+require 'wsdl/xmlSchema/complexContent'
+require 'wsdl/xmlSchema/simpleContent'
+require 'wsdl/xmlSchema/any'
+require 'wsdl/xmlSchema/element'
+require 'wsdl/xmlSchema/all'
+require 'wsdl/xmlSchema/choice'
+require 'wsdl/xmlSchema/sequence'
+require 'wsdl/xmlSchema/attribute'
+require 'wsdl/xmlSchema/unique'
+require 'wsdl/xmlSchema/enumeration'
+require 'wsdl/xmlSchema/length'
+require 'wsdl/xmlSchema/pattern'
+
+module WSDL
+module XMLSchema
+
+
+AllName = XSD::QName.new(XSD::Namespace, 'all')
+AnnotationName = XSD::QName.new(XSD::Namespace, 'annotation')
+AnyName = XSD::QName.new(XSD::Namespace, 'any')
+AttributeName = XSD::QName.new(XSD::Namespace, 'attribute')
+ChoiceName = XSD::QName.new(XSD::Namespace, 'choice')
+ComplexContentName = XSD::QName.new(XSD::Namespace, 'complexContent')
+ComplexTypeName = XSD::QName.new(XSD::Namespace, 'complexType')
+ElementName = XSD::QName.new(XSD::Namespace, 'element')
+EnumerationName = XSD::QName.new(XSD::Namespace, 'enumeration')
+ExtensionName = XSD::QName.new(XSD::Namespace, 'extension')
+ImportName = XSD::QName.new(XSD::Namespace, 'import')
+IncludeName = XSD::QName.new(XSD::Namespace, 'include')
+LengthName = XSD::QName.new(XSD::Namespace, 'length')
+PatternName = XSD::QName.new(XSD::Namespace, 'pattern')
+RestrictionName = XSD::QName.new(XSD::Namespace, 'restriction')
+SequenceName = XSD::QName.new(XSD::Namespace, 'sequence')
+SchemaName = XSD::QName.new(XSD::Namespace, 'schema')
+SimpleContentName = XSD::QName.new(XSD::Namespace, 'simpleContent')
+SimpleTypeName = XSD::QName.new(XSD::Namespace, 'simpleType')
+UniqueName = XSD::QName.new(XSD::Namespace, 'unique')
+
+AttributeFormDefaultAttrName = XSD::QName.new(nil, 'attributeFormDefault')
+BaseAttrName = XSD::QName.new(nil, 'base')
+DefaultAttrName = XSD::QName.new(nil, 'default')
+ElementFormDefaultAttrName = XSD::QName.new(nil, 'elementFormDefault')
+FinalAttrName = XSD::QName.new(nil, 'final')
+FixedAttrName = XSD::QName.new(nil, 'fixed')
+FormAttrName = XSD::QName.new(nil, 'form')
+IdAttrName = XSD::QName.new(nil, 'id')
+MaxOccursAttrName = XSD::QName.new(nil, 'maxOccurs')
+MinOccursAttrName = XSD::QName.new(nil, 'minOccurs')
+MixedAttrName = XSD::QName.new(nil, 'mixed')
+NameAttrName = XSD::QName.new(nil, 'name')
+NamespaceAttrName = XSD::QName.new(nil, 'namespace')
+NillableAttrName = XSD::QName.new(nil, 'nillable')
+ProcessContentsAttrName = XSD::QName.new(nil, 'processContents')
+RefAttrName = XSD::QName.new(nil, 'ref')
+SchemaLocationAttrName = XSD::QName.new(nil, 'schemaLocation')
+TargetNamespaceAttrName = XSD::QName.new(nil, 'targetNamespace')
+TypeAttrName = XSD::QName.new(nil, 'type')
+UseAttrName = XSD::QName.new(nil, 'use')
+ValueAttrName = XSD::QName.new(nil, 'value')
+
+
+end
+end
diff --git a/lib/wsdl/xmlSchema/element.rb b/lib/wsdl/xmlSchema/element.rb
new file mode 100644
index 0000000000..fffb6485d0
--- /dev/null
+++ b/lib/wsdl/xmlSchema/element.rb
@@ -0,0 +1,154 @@
+# WSDL4R - XMLSchema element definition for WSDL.
+# Copyright (C) 2002, 2003, 2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+require 'wsdl/info'
+
+
+module WSDL
+module XMLSchema
+
+
+class Element < Info
+ class << self
+ if RUBY_VERSION > "1.7.0"
+ def attr_reader_ref(symbol)
+ name = symbol.to_s
+ define_method(name) {
+ instance_variable_get("@#{name}") ||
+ (refelement ? refelement.__send__(name) : nil)
+ }
+ end
+ else
+ def attr_reader_ref(symbol)
+ name = symbol.to_s
+ module_eval <<-EOS
+ def #{name}
+ @#{name} || (refelement ? refelement.#{name} : nil)
+ end
+ EOS
+ end
+ end
+ end
+
+ attr_writer :name # required
+ attr_writer :form
+ attr_writer :type
+ attr_writer :local_simpletype
+ attr_writer :local_complextype
+ attr_writer :constraint
+ attr_writer :maxoccurs
+ attr_writer :minoccurs
+ attr_writer :nillable
+
+ attr_reader_ref :name
+ attr_reader_ref :form
+ attr_reader_ref :type
+ attr_reader_ref :local_simpletype
+ attr_reader_ref :local_complextype
+ attr_reader_ref :constraint
+ attr_reader_ref :maxoccurs
+ attr_reader_ref :minoccurs
+ attr_reader_ref :nillable
+
+ attr_accessor :ref
+
+ def initialize(name = nil, type = nil)
+ super()
+ @name = name
+ @form = nil
+ @type = type
+ @local_simpletype = @local_complextype = nil
+ @constraint = nil
+ @maxoccurs = '1'
+ @minoccurs = '1'
+ @nillable = nil
+ @ref = nil
+ @refelement = nil
+ end
+
+ def refelement
+ @refelement ||= (@ref ? root.collect_elements[@ref] : nil)
+ end
+
+ def targetnamespace
+ parent.targetnamespace
+ end
+
+ def elementformdefault
+ parent.elementformdefault
+ end
+
+ def elementform
+ self.form.nil? ? parent.elementformdefault : self.form
+ end
+
+ def parse_element(element)
+ case element
+ when SimpleTypeName
+ @local_simpletype = SimpleType.new
+ @local_simpletype
+ when ComplexTypeName
+ @type = nil
+ @local_complextype = ComplexType.new
+ @local_complextype
+ when UniqueName
+ @constraint = Unique.new
+ @constraint
+ else
+ nil
+ end
+ end
+
+ def parse_attr(attr, value)
+ case attr
+ when NameAttrName
+ # namespace may be nil
+ if directelement? or elementform == 'qualified'
+ @name = XSD::QName.new(targetnamespace, value.source)
+ else
+ @name = XSD::QName.new(nil, value.source)
+ end
+ when FormAttrName
+ @form = value.source
+ when TypeAttrName
+ @type = value
+ when RefAttrName
+ @ref = value
+ when MaxOccursAttrName
+ if parent.is_a?(All)
+ if value.source != '1'
+ raise Parser::AttrConstraintError.new(
+ "cannot parse #{value} for #{attr}")
+ end
+ end
+ @maxoccurs = value.source
+ when MinOccursAttrName
+ if parent.is_a?(All)
+ unless ['0', '1'].include?(value.source)
+ raise Parser::AttrConstraintError.new(
+ "cannot parse #{value} for #{attr}")
+ end
+ end
+ @minoccurs = value.source
+ when NillableAttrName
+ @nillable = (value.source == 'true')
+ else
+ nil
+ end
+ end
+
+private
+
+ def directelement?
+ parent.is_a?(Schema)
+ end
+end
+
+
+end
+end
diff --git a/lib/wsdl/xmlSchema/enumeration.rb b/lib/wsdl/xmlSchema/enumeration.rb
new file mode 100644
index 0000000000..5a16476032
--- /dev/null
+++ b/lib/wsdl/xmlSchema/enumeration.rb
@@ -0,0 +1,36 @@
+# WSDL4R - XMLSchema enumeration definition for WSDL.
+# Copyright (C) 2004 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+require 'wsdl/info'
+
+
+module WSDL
+module XMLSchema
+
+
+class Enumeration < Info
+ def initialize
+ super
+ end
+
+ def parse_element(element)
+ nil
+ end
+
+ def parse_attr(attr, value)
+ case attr
+ when ValueAttrName
+ parent.enumeration << value.source
+ value.source
+ end
+ end
+end
+
+
+end
+end
diff --git a/lib/wsdl/xmlSchema/import.rb b/lib/wsdl/xmlSchema/import.rb
new file mode 100644
index 0000000000..d3487af934
--- /dev/null
+++ b/lib/wsdl/xmlSchema/import.rb
@@ -0,0 +1,65 @@
+# WSDL4R - XMLSchema import definition.
+# Copyright (C) 2002, 2003, 2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+require 'wsdl/info'
+require 'wsdl/xmlSchema/importer'
+
+
+module WSDL
+module XMLSchema
+
+
+class Import < Info
+ attr_reader :namespace
+ attr_reader :schemalocation
+ attr_reader :content
+
+ def initialize
+ super
+ @namespace = nil
+ @schemalocation = nil
+ @content = nil
+ end
+
+ def parse_element(element)
+ nil
+ end
+
+ def parse_attr(attr, value)
+ case attr
+ when NamespaceAttrName
+ @namespace = value.source
+ when SchemaLocationAttrName
+ @schemalocation = URI.parse(value.source)
+ if @schemalocation.relative? and !parent.location.nil? and
+ !parent.location.relative?
+ @schemalocation = parent.location + @schemalocation
+ end
+ if root.importedschema.key?(@schemalocation)
+ @content = root.importedschema[@schemalocation]
+ else
+ root.importedschema[@schemalocation] = nil # placeholder
+ @content = import(@schemalocation)
+ root.importedschema[@schemalocation] = @content
+ end
+ @schemalocation
+ else
+ nil
+ end
+ end
+
+private
+
+ def import(location)
+ Importer.import(location, root)
+ end
+end
+
+
+end
+end
diff --git a/lib/wsdl/xmlSchema/importer.rb b/lib/wsdl/xmlSchema/importer.rb
new file mode 100644
index 0000000000..f57bfd972a
--- /dev/null
+++ b/lib/wsdl/xmlSchema/importer.rb
@@ -0,0 +1,87 @@
+# WSDL4R - XSD importer library.
+# Copyright (C) 2003, 2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+require 'soap/httpconfigloader'
+require 'wsdl/xmlSchema/parser'
+
+
+module WSDL
+module XMLSchema
+
+
+class Importer
+ def self.import(location, originalroot = nil)
+ new.import(location, originalroot)
+ end
+
+ def initialize
+ @web_client = nil
+ end
+
+ def import(location, originalroot = nil)
+ unless location.is_a?(URI)
+ location = URI.parse(location)
+ end
+ content = parse(fetch(location), location, originalroot)
+ content.location = location
+ content
+ end
+
+private
+
+ def parse(content, location, originalroot)
+ opt = {
+ :location => location,
+ :originalroot => originalroot
+ }
+ WSDL::XMLSchema::Parser.new(opt).parse(content)
+ end
+
+ def fetch(location)
+ warn("importing: #{location}") if $DEBUG
+ content = nil
+ if location.scheme == 'file' or
+ (location.relative? and FileTest.exist?(location.path))
+ content = File.open(location.path).read
+ elsif location.scheme and location.scheme.size == 1 and
+ FileTest.exist?(location.to_s)
+ # ToDo: remove this ugly workaround for a path with drive letter
+ # (D://foo/bar)
+ content = File.open(location.to_s).read
+ else
+ client = web_client.new(nil, "WSDL4R")
+ client.proxy = ::SOAP::Env::HTTP_PROXY
+ client.no_proxy = ::SOAP::Env::NO_PROXY
+ if opt = ::SOAP::Property.loadproperty(::SOAP::PropertyName)
+ ::SOAP::HTTPConfigLoader.set_options(client,
+ opt["client.protocol.http"])
+ end
+ content = client.get_content(location)
+ end
+ content
+ end
+
+ def web_client
+ @web_client ||= begin
+ require 'http-access2'
+ if HTTPAccess2::VERSION < "2.0"
+ raise LoadError.new("http-access/2.0 or later is required.")
+ end
+ HTTPAccess2::Client
+ rescue LoadError
+ warn("Loading http-access2 failed. Net/http is used.") if $DEBUG
+ require 'soap/netHttpClient'
+ ::SOAP::NetHttpClient
+ end
+ @web_client
+ end
+end
+
+
+end
+end
diff --git a/lib/wsdl/xmlSchema/include.rb b/lib/wsdl/xmlSchema/include.rb
new file mode 100644
index 0000000000..af1ef942bb
--- /dev/null
+++ b/lib/wsdl/xmlSchema/include.rb
@@ -0,0 +1,54 @@
+# WSDL4R - XMLSchema include definition.
+# Copyright (C) 2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+require 'wsdl/info'
+require 'wsdl/xmlSchema/importer'
+
+
+module WSDL
+module XMLSchema
+
+
+class Include < Info
+ attr_reader :schemalocation
+ attr_reader :content
+
+ def initialize
+ super
+ @schemalocation = nil
+ @content = nil
+ end
+
+ def parse_element(element)
+ nil
+ end
+
+ def parse_attr(attr, value)
+ case attr
+ when SchemaLocationAttrName
+ @schemalocation = URI.parse(value.source)
+ if @schemalocation.relative?
+ @schemalocation = parent.location + @schemalocation
+ end
+ @content = import(@schemalocation)
+ @schemalocation
+ else
+ nil
+ end
+ end
+
+private
+
+ def import(location)
+ Importer.import(location)
+ end
+end
+
+
+end
+end
diff --git a/lib/wsdl/xmlSchema/length.rb b/lib/wsdl/xmlSchema/length.rb
new file mode 100644
index 0000000000..7f61602da9
--- /dev/null
+++ b/lib/wsdl/xmlSchema/length.rb
@@ -0,0 +1,35 @@
+# WSDL4R - XMLSchema length definition for WSDL.
+# Copyright (C) 2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+require 'wsdl/info'
+
+
+module WSDL
+module XMLSchema
+
+
+class Length < Info
+ def initialize
+ super
+ end
+
+ def parse_element(element)
+ nil
+ end
+
+ def parse_attr(attr, value)
+ case attr
+ when ValueAttrName
+ value.source
+ end
+ end
+end
+
+
+end
+end
diff --git a/lib/wsdl/xmlSchema/parser.rb b/lib/wsdl/xmlSchema/parser.rb
new file mode 100644
index 0000000000..057d9d9b70
--- /dev/null
+++ b/lib/wsdl/xmlSchema/parser.rb
@@ -0,0 +1,166 @@
+# WSDL4R - WSDL XML Instance parser library.
+# Copyright (C) 2002, 2003, 2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+require 'xsd/qname'
+require 'xsd/ns'
+require 'xsd/charset'
+require 'xsd/datatypes'
+require 'xsd/xmlparser'
+require 'wsdl/xmlSchema/data'
+
+
+module WSDL
+module XMLSchema
+
+
+class Parser
+ include XSD
+
+ class ParseError < Error; end
+ class FormatDecodeError < ParseError; end
+ class UnknownElementError < FormatDecodeError; end
+ class UnknownAttributeError < FormatDecodeError; end
+ class UnexpectedElementError < FormatDecodeError; end
+ class ElementConstraintError < FormatDecodeError; end
+ class AttributeConstraintError < FormatDecodeError; end
+
+private
+
+ class ParseFrame
+ attr_reader :ns
+ attr_reader :name
+ attr_accessor :node
+
+ private
+
+ def initialize(ns, name, node)
+ @ns = ns
+ @name = name
+ @node = node
+ end
+ end
+
+public
+
+ def initialize(opt = {})
+ @parser = XSD::XMLParser.create_parser(self, opt)
+ @parsestack = nil
+ @lastnode = nil
+ @ignored = {}
+ @location = opt[:location]
+ @originalroot = opt[:originalroot]
+ end
+
+ def parse(string_or_readable)
+ @parsestack = []
+ @lastnode = nil
+ @textbuf = ''
+ @parser.do_parse(string_or_readable)
+ @lastnode
+ end
+
+ def charset
+ @parser.charset
+ end
+
+ def start_element(name, attrs)
+ lastframe = @parsestack.last
+ ns = parent = nil
+ if lastframe
+ ns = lastframe.ns.clone_ns
+ parent = lastframe.node
+ else
+ ns = XSD::NS.new
+ parent = nil
+ end
+ attrs = XSD::XMLParser.filter_ns(ns, attrs)
+ node = decode_tag(ns, name, attrs, parent)
+ @parsestack << ParseFrame.new(ns, name, node)
+ end
+
+ def characters(text)
+ lastframe = @parsestack.last
+ if lastframe
+ # Need not to be cloned because character does not have attr.
+ ns = lastframe.ns
+ decode_text(ns, text)
+ else
+ p text if $DEBUG
+ end
+ end
+
+ def end_element(name)
+ lastframe = @parsestack.pop
+ unless name == lastframe.name
+ raise UnexpectedElementError.new("closing element name '#{name}' does not match with opening element '#{lastframe.name}'")
+ end
+ decode_tag_end(lastframe.ns, lastframe.node)
+ @lastnode = lastframe.node
+ end
+
+private
+
+ def decode_tag(ns, name, attrs, parent)
+ o = nil
+ elename = ns.parse(name)
+ if !parent
+ if elename == SchemaName
+ o = Schema.parse_element(elename)
+ o.location = @location
+ else
+ raise UnknownElementError.new("unknown element: #{elename}")
+ end
+ o.root = @originalroot if @originalroot # o.root = o otherwise
+ else
+ if elename == AnnotationName
+ # only the first annotation element is allowed for each element.
+ o = Annotation.new
+ else
+ o = parent.parse_element(elename)
+ end
+ unless o
+ unless @ignored.key?(elename)
+ warn("ignored element: #{elename} of #{parent.class}")
+ @ignored[elename] = elename
+ end
+ o = Documentation.new # which accepts any element.
+ end
+ # node could be a pseudo element. pseudo element has its own parent.
+ o.root = parent.root
+ o.parent = parent if o.parent.nil?
+ end
+ attrs.each do |key, value|
+ attr_ele = ns.parse(key, true)
+ value_ele = ns.parse(value, true)
+ value_ele.source = value # for recovery; value may not be a QName
+ if attr_ele == IdAttrName
+ o.id = value_ele
+ else
+ unless o.parse_attr(attr_ele, value_ele)
+ unless @ignored.key?(attr_ele)
+ warn("ignored attr: #{attr_ele}")
+ @ignored[attr_ele] = attr_ele
+ end
+ end
+ end
+ end
+ o
+ end
+
+ def decode_tag_end(ns, node)
+ node.parse_epilogue
+ end
+
+ def decode_text(ns, text)
+ @textbuf << text
+ end
+end
+
+
+end
+end
diff --git a/lib/wsdl/xmlSchema/pattern.rb b/lib/wsdl/xmlSchema/pattern.rb
new file mode 100644
index 0000000000..f826be4578
--- /dev/null
+++ b/lib/wsdl/xmlSchema/pattern.rb
@@ -0,0 +1,36 @@
+# WSDL4R - XMLSchema pattern definition for WSDL.
+# Copyright (C) 2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+require 'wsdl/info'
+
+
+module WSDL
+module XMLSchema
+
+
+class Pattern < Info
+ def initialize
+ super
+ end
+
+ def parse_element(element)
+ nil
+ end
+
+ def parse_attr(attr, value)
+ case attr
+ when ValueAttrName
+ parent.pattern = /\A#{value.source}\z/n
+ value.source
+ end
+ end
+end
+
+
+end
+end
diff --git a/lib/wsdl/xmlSchema/schema.rb b/lib/wsdl/xmlSchema/schema.rb
new file mode 100644
index 0000000000..ec97d07aa5
--- /dev/null
+++ b/lib/wsdl/xmlSchema/schema.rb
@@ -0,0 +1,143 @@
+# WSDL4R - XMLSchema schema definition for WSDL.
+# Copyright (C) 2002, 2003-2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+require 'wsdl/info'
+require 'xsd/namedelements'
+
+
+module WSDL
+module XMLSchema
+
+
+class Schema < Info
+ attr_reader :targetnamespace # required
+ attr_reader :complextypes
+ attr_reader :simpletypes
+ attr_reader :elements
+ attr_reader :attributes
+ attr_reader :imports
+ attr_accessor :attributeformdefault
+ attr_accessor :elementformdefault
+
+ attr_reader :importedschema
+
+ def initialize
+ super
+ @targetnamespace = nil
+ @complextypes = XSD::NamedElements.new
+ @simpletypes = XSD::NamedElements.new
+ @elements = XSD::NamedElements.new
+ @attributes = XSD::NamedElements.new
+ @imports = []
+ @attributeformdefault = "unqualified"
+ @elementformdefault = "unqualified"
+ @importedschema = {}
+ @location = nil
+ @root = self
+ end
+
+ def location
+ @location || (root.nil? ? nil : root.location)
+ end
+
+ def location=(location)
+ @location = location
+ end
+
+ def parse_element(element)
+ case element
+ when ImportName
+ o = Import.new
+ @imports << o
+ o
+ when IncludeName
+ o = Include.new
+ @imports << o
+ o
+ when ComplexTypeName
+ o = ComplexType.new
+ @complextypes << o
+ o
+ when SimpleTypeName
+ o = SimpleType.new
+ @simpletypes << o
+ o
+ when ElementName
+ o = Element.new
+ @elements << o
+ o
+ when AttributeName
+ o = Attribute.new
+ @attributes << o
+ o
+ else
+ nil
+ end
+ end
+
+ def parse_attr(attr, value)
+ case attr
+ when TargetNamespaceAttrName
+ @targetnamespace = value.source
+ when AttributeFormDefaultAttrName
+ @attributeformdefault = value.source
+ when ElementFormDefaultAttrName
+ @elementformdefault = value.source
+ else
+ nil
+ end
+ end
+
+ def collect_attributes
+ result = XSD::NamedElements.new
+ result.concat(@attributes)
+ @imports.each do |import|
+ result.concat(import.content.collect_attributes) if import.content
+ end
+ result
+ end
+
+ def collect_elements
+ result = XSD::NamedElements.new
+ result.concat(@elements)
+ @imports.each do |import|
+ result.concat(import.content.collect_elements) if import.content
+ end
+ result
+ end
+
+ def collect_complextypes
+ result = XSD::NamedElements.new
+ result.concat(@complextypes)
+ @imports.each do |import|
+ result.concat(import.content.collect_complextypes) if import.content
+ end
+ result
+ end
+
+ def collect_simpletypes
+ result = XSD::NamedElements.new
+ result.concat(@simpletypes)
+ @imports.each do |import|
+ result.concat(import.content.collect_simpletypes) if import.content
+ end
+ result
+ end
+
+ def self.parse_element(element)
+ if element == SchemaName
+ Schema.new
+ else
+ nil
+ end
+ end
+end
+
+
+end
+end
diff --git a/lib/wsdl/xmlSchema/sequence.rb b/lib/wsdl/xmlSchema/sequence.rb
new file mode 100644
index 0000000000..823fa3b7f9
--- /dev/null
+++ b/lib/wsdl/xmlSchema/sequence.rb
@@ -0,0 +1,69 @@
+# WSDL4R - XMLSchema complexType definition for WSDL.
+# Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+require 'wsdl/info'
+
+
+module WSDL
+module XMLSchema
+
+
+class Sequence < Info
+ attr_reader :minoccurs
+ attr_reader :maxoccurs
+ attr_reader :elements
+
+ def initialize
+ super()
+ @minoccurs = '1'
+ @maxoccurs = '1'
+ @elements = []
+ end
+
+ def targetnamespace
+ parent.targetnamespace
+ end
+
+ def elementformdefault
+ parent.elementformdefault
+ end
+
+ def <<(element)
+ @elements << element
+ end
+
+ def parse_element(element)
+ case element
+ when AnyName
+ o = Any.new
+ @elements << o
+ o
+ when ElementName
+ o = Element.new
+ @elements << o
+ o
+ else
+ nil
+ end
+ end
+
+ def parse_attr(attr, value)
+ case attr
+ when MaxOccursAttrName
+ @maxoccurs = value.source
+ when MinOccursAttrName
+ @minoccurs = value.source
+ else
+ nil
+ end
+ end
+end
+
+
+end
+end
diff --git a/lib/wsdl/xmlSchema/simpleContent.rb b/lib/wsdl/xmlSchema/simpleContent.rb
new file mode 100644
index 0000000000..e1f35c88b8
--- /dev/null
+++ b/lib/wsdl/xmlSchema/simpleContent.rb
@@ -0,0 +1,65 @@
+# WSDL4R - XMLSchema simpleContent definition for WSDL.
+# Copyright (C) 2004, 2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+require 'wsdl/info'
+require 'xsd/namedelements'
+
+
+module WSDL
+module XMLSchema
+
+
+class SimpleContent < Info
+ attr_reader :restriction
+ attr_reader :extension
+
+ def check_lexical_format(value)
+ check(value)
+ end
+
+ def initialize
+ super
+ @restriction = nil
+ @extension = nil
+ end
+
+ def base
+ content.base
+ end
+
+ def targetnamespace
+ parent.targetnamespace
+ end
+
+ def parse_element(element)
+ case element
+ when RestrictionName
+ @restriction = SimpleRestriction.new
+ @restriction
+ when ExtensionName
+ @extension = SimpleExtension.new
+ @extension
+ end
+ end
+
+private
+
+ def content
+ @restriction || @extension
+ end
+
+ def check(value)
+ unless content.valid?(value)
+ raise XSD::ValueSpaceError.new("#{@name}: cannot accept '#{value}'")
+ end
+ end
+end
+
+
+end
+end
diff --git a/lib/wsdl/xmlSchema/simpleExtension.rb b/lib/wsdl/xmlSchema/simpleExtension.rb
new file mode 100644
index 0000000000..3c53a7328c
--- /dev/null
+++ b/lib/wsdl/xmlSchema/simpleExtension.rb
@@ -0,0 +1,54 @@
+# WSDL4R - XMLSchema simpleType extension definition for WSDL.
+# Copyright (C) 2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+require 'wsdl/info'
+require 'xsd/namedelements'
+
+
+module WSDL
+module XMLSchema
+
+
+class SimpleExtension < Info
+ attr_reader :base
+ attr_reader :attributes
+
+ def initialize
+ super
+ @base = nil
+ @attributes = XSD::NamedElements.new
+ end
+
+ def targetnamespace
+ parent.targetnamespace
+ end
+
+ def valid?(value)
+ true
+ end
+
+ def parse_element(element)
+ case element
+ when AttributeName
+ o = Attribute.new
+ @attributes << o
+ o
+ end
+ end
+
+ def parse_attr(attr, value)
+ case attr
+ when BaseAttrName
+ @base = value
+ end
+ end
+end
+
+
+end
+end
diff --git a/lib/wsdl/xmlSchema/simpleRestriction.rb b/lib/wsdl/xmlSchema/simpleRestriction.rb
new file mode 100644
index 0000000000..e8bf3ebfa5
--- /dev/null
+++ b/lib/wsdl/xmlSchema/simpleRestriction.rb
@@ -0,0 +1,73 @@
+# WSDL4R - XMLSchema simpleContent restriction definition for WSDL.
+# Copyright (C) 2004 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+require 'wsdl/info'
+require 'xsd/namedelements'
+
+
+module WSDL
+module XMLSchema
+
+
+class SimpleRestriction < Info
+ attr_reader :base
+ attr_reader :enumeration
+ attr_accessor :length
+ attr_accessor :pattern
+
+ def initialize
+ super
+ @base = nil
+ @enumeration = [] # NamedElements?
+ @length = nil
+ @pattern = nil
+ end
+
+ def valid?(value)
+ return false unless check_restriction(value)
+ return false unless check_length(value)
+ return false unless check_pattern(value)
+ true
+ end
+
+ def parse_element(element)
+ case element
+ when EnumerationName
+ Enumeration.new # just a parsing handler
+ when LengthName
+ Length.new # just a parsing handler
+ when PatternName
+ Pattern.new # just a parsing handler
+ end
+ end
+
+ def parse_attr(attr, value)
+ case attr
+ when BaseAttrName
+ @base = value
+ end
+ end
+
+private
+
+ def check_restriction(value)
+ @enumeration.empty? or @enumeration.include?(value)
+ end
+
+ def check_length(value)
+ @length.nil? or value.size == @length
+ end
+
+ def check_pattern(value)
+ @pattern.nil? or @pattern =~ value
+ end
+end
+
+
+end
+end
diff --git a/lib/wsdl/xmlSchema/simpleType.rb b/lib/wsdl/xmlSchema/simpleType.rb
new file mode 100644
index 0000000000..e808c318c4
--- /dev/null
+++ b/lib/wsdl/xmlSchema/simpleType.rb
@@ -0,0 +1,73 @@
+# WSDL4R - XMLSchema simpleType definition for WSDL.
+# Copyright (C) 2004, 2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+require 'wsdl/info'
+require 'xsd/namedelements'
+
+
+module WSDL
+module XMLSchema
+
+
+class SimpleType < Info
+ attr_accessor :name
+ attr_reader :restriction
+
+ def check_lexical_format(value)
+ if @restriction
+ check_restriction(value)
+ else
+ raise ArgumentError.new("incomplete simpleType")
+ end
+ end
+
+ def base
+ if @restriction
+ @restriction.base
+ else
+ raise ArgumentError.new("incomplete simpleType")
+ end
+ end
+
+ def initialize(name = nil)
+ super()
+ @name = name
+ @restriction = nil
+ end
+
+ def targetnamespace
+ parent.targetnamespace
+ end
+
+ def parse_element(element)
+ case element
+ when RestrictionName
+ @restriction = SimpleRestriction.new
+ @restriction
+ end
+ end
+
+ def parse_attr(attr, value)
+ case attr
+ when NameAttrName
+ @name = XSD::QName.new(targetnamespace, value.source)
+ end
+ end
+
+private
+
+ def check_restriction(value)
+ unless @restriction.valid?(value)
+ raise XSD::ValueSpaceError.new("#{@name}: cannot accept '#{value}'")
+ end
+ end
+end
+
+
+end
+end
diff --git a/lib/wsdl/xmlSchema/unique.rb b/lib/wsdl/xmlSchema/unique.rb
new file mode 100644
index 0000000000..837ff22b4a
--- /dev/null
+++ b/lib/wsdl/xmlSchema/unique.rb
@@ -0,0 +1,34 @@
+# WSDL4R - XMLSchema unique element.
+# Copyright (C) 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+require 'wsdl/info'
+
+
+module WSDL
+module XMLSchema
+
+
+class Unique < Info
+ def initialize
+ super
+ end
+
+ def parse_element(element)
+ # Accepts any element.
+ self
+ end
+
+ def parse_attr(attr, value)
+ # Accepts any attribute.
+ true
+ end
+end
+
+
+end
+end
diff --git a/lib/wsdl/xmlSchema/xsd2ruby.rb b/lib/wsdl/xmlSchema/xsd2ruby.rb
new file mode 100644
index 0000000000..afe5fc5ada
--- /dev/null
+++ b/lib/wsdl/xmlSchema/xsd2ruby.rb
@@ -0,0 +1,107 @@
+# XSD4R - XSD to ruby mapping library.
+# Copyright (C) 2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+require 'xsd/codegen/gensupport'
+require 'wsdl/xmlSchema/importer'
+require 'wsdl/soap/classDefCreator'
+
+
+module WSDL
+module XMLSchema
+
+
+class XSD2Ruby
+ attr_accessor :location
+ attr_reader :opt
+ attr_accessor :logger
+ attr_accessor :basedir
+
+ def run
+ unless @location
+ raise RuntimeError, "XML Schema location not given"
+ end
+ @xsd = import(@location)
+ @name = create_classname(@xsd)
+ create_file
+ end
+
+private
+
+ def initialize
+ @location = nil
+ @opt = {}
+ @logger = Logger.new(STDERR)
+ @basedir = nil
+ @xsd = nil
+ @name = nil
+ end
+
+ def create_file
+ create_classdef
+ end
+
+ def create_classdef
+ @logger.info { "Creating class definition." }
+ @classdef_filename = @name + '.rb'
+ check_file(@classdef_filename) or return
+ write_file(@classdef_filename) do |f|
+ f << WSDL::SOAP::ClassDefCreator.new(@xsd).dump
+ end
+ end
+
+ def write_file(filename)
+ if @basedir
+ filename = File.join(basedir, filename)
+ end
+ File.open(filename, "w") do |f|
+ yield f
+ end
+ end
+
+ def check_file(filename)
+ if @basedir
+ filename = File.join(basedir, filename)
+ end
+ if FileTest.exist?(filename)
+ if @opt.key?('force')
+ @logger.warn {
+ "File '#{filename}' exists but overrides it."
+ }
+ true
+ else
+ @logger.warn {
+ "File '#{filename}' exists. #{$0} did not override it."
+ }
+ false
+ end
+ else
+ @logger.info { "Creates file '#{filename}'." }
+ true
+ end
+ end
+
+ def create_classname(xsd)
+ name = nil
+ if xsd.targetnamespace
+ name = xsd.targetnamespace.scan(/[a-zA-Z0-9]+$/)[0]
+ end
+ if name.nil?
+ 'default'
+ else
+ XSD::CodeGen::GenSupport.safevarname(name)
+ end
+ end
+
+ def import(location)
+ WSDL::XMLSchema::Importer.import(location)
+ end
+end
+
+
+end
+end
diff --git a/lib/xmlrpc/README.rdoc b/lib/xmlrpc/README.rdoc
deleted file mode 100644
index 221d675219..0000000000
--- a/lib/xmlrpc/README.rdoc
+++ /dev/null
@@ -1,300 +0,0 @@
-= XMLRPC for Ruby
-
-== Author and Copyright
-
-Copyright (C) 2001-2004 by Michael Neumann (mailto:mneumann@ntecs.de)
-
-Released under the same term of license as Ruby.
-
-== Overview
-
-XMLRPC is a lightweight protocol that enables remote procedure calls over
-HTTP. It is defined at http://www.xmlrpc.com.
-
-XMLRPC allows you to create simple distributed computing solutions that span
-computer languages. Its distinctive feature is its simplicity compared to
-other approaches like SOAP and CORBA.
-
-The Ruby standard library package 'xmlrpc' enables you to create a server that
-implements remote procedures and a client that calls them. Very little code
-is required to achieve either of these.
-
-== Example
-
-Try the following code. It calls a standard demonstration remote procedure.
-
- require 'xmlrpc/client'
- require 'pp'
-
- server = XMLRPC::Client.new2("http://xmlrpc-c.sourceforge.net/api/sample.php")
- result = server.call("sample.sumAndDifference", 5, 3)
- pp result
-
-== Documentation
-
-See http://www.ntecs.de/projects/xmlrpc4r. There is plenty of detail there to
-use the client and implement a server.
-
-== Features of XMLRPC for Ruby
-
-* Extensions
- * Introspection
- * multiCall
- * optionally nil values and integers larger than 32 Bit
-
-* Server
- * Standalone XML-RPC server
- * CGI-based (works with FastCGI)
- * Apache mod_ruby server
- * WEBrick servlet
-
-* Client
- * synchronous/asynchronous calls
- * Basic HTTP-401 Authentification
- * HTTPS protocol (SSL)
-
-* Parsers
- * NQXML (NQXMLStreamParser, NQXMLTreeParser)
- * Expat (XMLStreamParser, XMLTreeParser)
- * REXML (REXMLStreamParser)
- * xml-scan (XMLScanStreamParser)
- * Fastest parser is Expat's XMLStreamParser!
-
-* General
- * possible to choose between XMLParser module (Expat wrapper) and REXML/NQXML (pure Ruby) parsers
- * Marshalling Ruby objects to Hashs and reconstruct them later from a Hash
- * SandStorm component architecture Client interface
-
-== Howto
-
-=== Client
-
- require "xmlrpc/client"
-
- # Make an object to represent the XML-RPC server.
- server = XMLRPC::Client.new( "xmlrpc-c.sourceforge.net", "/api/sample.php")
-
- # Call the remote server and get our result
- result = server.call("sample.sumAndDifference", 5, 3)
-
- sum = result["sum"]
- difference = result["difference"]
-
- puts "Sum: #{sum}, Difference: #{difference}"
-
-=== Client with XML-RPC fault-structure handling
-
-There are two possible ways, of handling a fault-structure:
-
-==== by catching a XMLRPC::FaultException exception
-
- require "xmlrpc/client"
-
- # Make an object to represent the XML-RPC server.
- server = XMLRPC::Client.new( "xmlrpc-c.sourceforge.net", "/api/sample.php")
-
- begin
- # Call the remote server and get our result
- result = server.call("sample.sumAndDifference", 5, 3)
-
- sum = result["sum"]
- difference = result["difference"]
-
- puts "Sum: #{sum}, Difference: #{difference}"
-
- rescue XMLRPC::FaultException => e
- puts "Error: "
- puts e.faultCode
- puts e.faultString
- end
-
-==== by calling "call2" which returns a boolean
-
- require "xmlrpc/client"
-
- # Make an object to represent the XML-RPC server.
- server = XMLRPC::Client.new( "xmlrpc-c.sourceforge.net", "/api/sample.php")
-
- # Call the remote server and get our result
- ok, result = server.call2("sample.sumAndDifference", 5, 3)
-
- if ok
- sum = result["sum"]
- difference = result["difference"]
-
- puts "Sum: #{sum}, Difference: #{difference}"
- else
- puts "Error: "
- puts result.faultCode
- puts result.faultString
- end
-
-=== Client using Proxy
-
-You can create a +Proxy+ object onto which you can call methods. This way it
-looks nicer. Both forms, _call_ and _call2_ are supported through _proxy_ and
-<i>proxy2</i>. You can additionally give arguments to the Proxy, which will be
-given to each XML-RPC call using that Proxy.
-
- require "xmlrpc/client"
-
- # Make an object to represent the XML-RPC server.
- server = XMLRPC::Client.new( "xmlrpc-c.sourceforge.net", "/api/sample.php")
-
- # Create a Proxy object
- sample = server.proxy("sample")
-
- # Call the remote server and get our result
- result = sample.sumAndDifference(5,3)
-
- sum = result["sum"]
- difference = result["difference"]
-
- puts "Sum: #{sum}, Difference: #{difference}"
-
-=== CGI-based Server
-
-There are also two ways to define handler, the first is
-like C/PHP, the second like Java, of course both ways
-can be mixed:
-
-==== C/PHP-like (handler functions)
-
- require "xmlrpc/server"
-
- s = XMLRPC::CGIServer.new
-
- s.add_handler("sample.sumAndDifference") do |a,b|
- { "sum" => a + b, "difference" => a - b }
- end
-
- s.serve
-
-==== Java-like (handler classes)
-
- require "xmlrpc/server"
-
- s = XMLRPC::CGIServer.new
-
- class MyHandler
- def sumAndDifference(a, b)
- { "sum" => a + b, "difference" => a - b }
- end
- end
-
- # NOTE: Security Hole (read below)!!!
- s.add_handler("sample", MyHandler.new)
- s.serve
-
-
-To return a fault-structure you have to raise an FaultException e.g.:
-
- raise XMLRPC::FaultException.new(3, "division by Zero")
-
-===== Security Note
-
-From Brian Candler:
-
- Above code sample has an extremely nasty security hole, in that you can now call
- any method of 'MyHandler' remotely, including methods inherited from Object
- and Kernel! For example, in the client code, you can use
-
- puts server.call("sample.send","`","ls")
-
- (backtick being the method name for running system processes). Needless to
- say, 'ls' can be replaced with something else.
-
- The version which binds proc objects (or the version presented below in the next section)
- doesn't have this problem, but people may be tempted to use the second version because it's
- so nice and 'Rubyesque'. I think it needs a big red disclaimer.
-
-
-From Michael:
-
-A solution is to undef insecure methods or to use (({XMLRPC::iPIMethods})) as shown below:
-
- class MyHandler
- def sumAndDifference(a, b)
- { "sum" => a + b, "difference" => a - b }
- end
- end
-
- # ... server initialization ...
-
- s.add_handler(XMLRPC::iPIMethods("sample"), MyHandler.new)
-
- # ...
-
-This adds only public instance methods explicitly declared in class MyHandler
-(and not those inherited from any other class).
-
-==== With interface declarations
-
-Code sample from the book Ruby Developer's Guide:
-
- require "xmlrpc/server"
-
- class Num
- INTERFACE = XMLRPC::interface("num") {
- meth 'int add(int, int)', 'Add two numbers', 'add'
- meth 'int div(int, int)', 'Divide two numbers'
- }
-
- def add(a, b) a + b end
- def div(a, b) a / b end
- end
-
-
- s = XMLRPC::CGIServer.new
- s.add_handler(Num::INTERFACE, Num.new)
- s.serve
-
-=== Standalone server
-
-Same as CGI-based server, only that the line
-
- server = XMLRPC::CGIServer.new
-
-must be changed to
-
- server = XMLRPC::Server.new(8080)
-
-if you want a server listening on port 8080.
-The rest is the same.
-
-=== Choosing a different XML Parser or XML Writer
-
-The examples above all use the default parser (which is now since 1.8
-REXMLStreamParser) and a default XML writer. If you want to use a different
-XML parser, then you have to call the <i>set_parser</i> method of
-<tt>XMLRPC::Client</tt> instances or instances of subclasses of
-<tt>XMLRPC::BasicServer</tt> or by editing xmlrpc/config.rb.
-
-Client Example:
-
- # ...
- server = XMLRPC::Client.new( "xmlrpc-c.sourceforge.net", "/api/sample.php")
- server.set_parser(XMLRPC::XMLParser::XMLParser.new)
- # ...
-
-Server Example:
-
- # ...
- s = XMLRPC::CGIServer.new
- s.set_parser(XMLRPC::XMLParser::XMLStreamParser.new)
- # ...
-
-or:
-
- # ...
- server = XMLRPC::Server.new(8080)
- server.set_parser(XMLRPC::XMLParser::NQXMLParser.new)
- # ...
-
-
-Note that XMLStreamParser is incredible faster (and uses less memory) than any
-other parser and scales well for large documents. For example for a 0.5 MB XML
-document with many tags, XMLStreamParser is ~350 (!) times faster than
-NQXMLTreeParser and still ~18 times as fast as XMLTreeParser.
-
-You can change the XML-writer by calling method <i>set_writer</i>.
diff --git a/lib/xmlrpc/base64.rb b/lib/xmlrpc/base64.rb
index bfa8c0a2d5..f9a21c703a 100644
--- a/lib/xmlrpc/base64.rb
+++ b/lib/xmlrpc/base64.rb
@@ -9,19 +9,19 @@ Released under the same term of license as Ruby.
= XMLRPC::Base64
== Description
-This class is necessary for (('xmlrpc4r')) to determine that a string should
-be transmitted base64-encoded and not as a raw-string.
-You can use (({XMLRPC::Base64})) on the client and server-side as a
+This class is necessary for (('xmlrpc4r')) to determine that a string should
+be transmitted base64-encoded and not as a raw-string.
+You can use (({XMLRPC::Base64})) on the client and server-side as a
parameter and/or return-value.
== Class Methods
--- XMLRPC::Base64.new( str, state = :dec )
Creates a new (({XMLRPC::Base64})) instance with string ((|str|)) as the
- internal string. When ((|state|)) is (({:dec})) it assumes that the
- string ((|str|)) is not in base64 format (perhaps already decoded),
- otherwise if ((|state|)) is (({:enc})) it decodes ((|str|))
+ internal string. When ((|state|)) is (({:dec})) it assumes that the
+ string ((|str|)) is not in base64 format (perhaps already decoded),
+ otherwise if ((|state|)) is (({:enc})) it decodes ((|str|))
and stores it as the internal string.
-
+
--- XMLRPC::Base64.decode( str )
Decodes string ((|str|)) with base64 and returns that value.
@@ -40,7 +40,7 @@ parameter and/or return-value.
module XMLRPC
class Base64
-
+
def initialize(str, state = :dec)
case state
when :enc
@@ -51,11 +51,11 @@ class Base64
raise ArgumentError, "wrong argument; either :enc or :dec"
end
end
-
+
def decoded
- @str
+ @str
end
-
+
def encoded
Base64.encode(@str)
end
diff --git a/lib/xmlrpc/client.rb b/lib/xmlrpc/client.rb
index 65c9cd0c9c..278855e01d 100644
--- a/lib/xmlrpc/client.rb
+++ b/lib/xmlrpc/client.rb
@@ -26,7 +26,7 @@ Released under the same term of license as Ruby.
or
require "xmlrpc/client"
-
+
server = XMLRPC::Client.new("www.ruby-lang.org", "/RPC2", 80)
ok, param = server.call2("michael.add", 4, 5)
if ok then
@@ -40,14 +40,14 @@ or
== Description
Class (({XMLRPC::Client})) provides remote procedure calls to a XML-RPC server.
After setting the connection-parameters with ((<XMLRPC::Client.new>)) which
-creates a new (({XMLRPC::Client})) instance, you can execute a remote procedure
+creates a new (({XMLRPC::Client})) instance, you can execute a remote procedure
by sending the ((<call|XMLRPC::Client#call>)) or ((<call2|XMLRPC::Client#call2>))
-message to this new instance. The given parameters indicate which method to
+message to this new instance. The given parameters indicate which method to
call on the remote-side and of course the parameters for the remote procedure.
== Class Methods
--- XMLRPC::Client.new( host=nil, path=nil, port=nil, proxy_host=nil, proxy_port=nil, user=nil, password=nil, use_ssl=false, timeout =nil)
- Creates an object which represents the remote XML-RPC server on the
+ Creates an object which represents the remote XML-RPC server on the
given host ((|host|)). If the server is CGI-based, ((|path|)) is the
path to the CGI-script, which will be called, otherwise (in the
case of a standalone server) ((|path|)) should be (({"/RPC2"})).
@@ -59,8 +59,8 @@ call on the remote-side and of course the parameters for the remote procedure.
Default values for ((|host|)), ((|path|)) and ((|port|)) are 'localhost', '/RPC2' and
'80' respectively using SSL '443'.
- If ((|user|)) and ((|password|)) are given, each time a request is send,
- a Authorization header is send. Currently only Basic Authentification is
+ If ((|user|)) and ((|password|)) are given, each time a request is send,
+ a Authorization header is send. Currently only Basic Authentification is
implemented no Digest.
If ((|use_ssl|)) is set to (({true})), comunication over SSL is enabled.
@@ -76,9 +76,9 @@ call on the remote-side and of course the parameters for the remote procedure.
: proxy
Is of the form "host:port".
-
+
: timeout
- Defaults to 30.
+ Defaults to 30.
--- XMLRPC::Client.new3( hash={} )
--- XMLRPC::Client.new_from_hash( hash={} )
@@ -97,10 +97,10 @@ call on the remote-side and of course the parameters for the remote procedure.
== Instance Methods
--- XMLRPC::Client#call( method, *args )
- Invokes the method named ((|method|)) with the parameters given by
+ Invokes the method named ((|method|)) with the parameters given by
((|args|)) on the XML-RPC server.
- The parameter ((|method|)) is converted into a (({String})) and should
- be a valid XML-RPC method-name.
+ The parameter ((|method|)) is converted into a (({String})) and should
+ be a valid XML-RPC method-name.
Each parameter of ((|args|)) must be of one of the following types,
where (({Hash})), (({Struct})) and (({Array})) can contain any of these listed ((:types:)):
* (({Fixnum})), (({Bignum}))
@@ -110,31 +110,31 @@ call on the remote-side and of course the parameters for the remote procedure.
* (({Hash})), (({Struct}))
* (({Array}))
* (({Date})), (({Time})), (({XMLRPC::DateTime}))
- * (({XMLRPC::Base64}))
- * A Ruby object which class includes XMLRPC::Marshallable (only if Config::ENABLE_MARSHALLABLE is (({true}))).
+ * (({XMLRPC::Base64}))
+ * A Ruby object which class includes XMLRPC::Marshallable (only if Config::ENABLE_MARSHALLABLE is (({true}))).
That object is converted into a hash, with one additional key/value pair "___class___" which contains the class name
for restoring later that object.
-
- The method returns the return-value from the RPC
- ((-stands for Remote Procedure Call-)).
+
+ The method returns the return-value from the RPC
+ ((-stands for Remote Procedure Call-)).
The type of the return-value is one of the above shown,
only that a (({Bignum})) is only allowed when it fits in 32-bit and
that a XML-RPC (('dateTime.iso8601')) type is always returned as
- a ((<(({XMLRPC::DateTime}))|URL:datetime.html>)) object and
+ a ((<(({XMLRPC::DateTime}))|URL:datetime.html>)) object and
a (({Struct})) is never returned, only a (({Hash})), the same for a (({Symbol})), where
- always a (({String})) is returned.
+ always a (({String})) is returned.
A (({XMLRPC::Base64})) is returned as a (({String})) from xmlrpc4r version 1.6.1 on.
-
- If the remote procedure returned a fault-structure, then a
+
+ If the remote procedure returned a fault-structure, then a
(({XMLRPC::FaultException})) exception is raised, which has two accessor-methods
(({faultCode})) and (({faultString})) of type (({Integer})) and (({String})).
--- XMLRPC::Client#call2( method, *args )
The difference between this method and ((<call|XMLRPC::Client#call>)) is, that
this method do ((*not*)) raise a (({XMLRPC::FaultException})) exception.
- The method returns an array of two values. The first value indicates if
+ The method returns an array of two values. The first value indicates if
the second value is a return-value ((({true}))) or an object of type
- (({XMLRPC::FaultException})).
+ (({XMLRPC::FaultException})).
Both are explained in ((<call|XMLRPC::Client#call>)).
Simple to remember: The "2" in "call2" denotes the number of values it returns.
@@ -151,19 +151,19 @@ call on the remote-side and of course the parameters for the remote procedure.
# => [7, -1]
--- XMLRPC::Client#multicall2( *methods )
- Same as ((<XMLRPC::Client#multicall>)), but returns like ((<XMLRPC::Client#call2>)) two parameters
+ Same as ((<XMLRPC::Client#multicall>)), but returns like ((<XMLRPC::Client#call2>)) two parameters
instead of raising an (({XMLRPC::FaultException})).
--- XMLRPC::Client#proxy( prefix, *args )
Returns an object of class (({XMLRPC::Client::Proxy})), initialized with
((|prefix|)) and ((|args|)). A proxy object returned by this method behaves
like ((<XMLRPC::Client#call>)), i.e. a call on that object will raise a
- (({XMLRPC::FaultException})) when a fault-structure is returned by that call.
+ (({XMLRPC::FaultException})) when a fault-structure is returned by that call.
--- XMLRPC::Client#proxy2( prefix, *args )
Almost the same like ((<XMLRPC::Client#proxy>)) only that a call on the returned
(({XMLRPC::Client::Proxy})) object behaves like ((<XMLRPC::Client#call2>)), i.e.
- a call on that object will return two parameters.
+ a call on that object will return two parameters.
@@ -175,21 +175,21 @@ call on the remote-side and of course the parameters for the remote procedure.
--- XMLRPC::Client#proxy_async(...)
--- XMLRPC::Client#proxy2_async(...)
In contrast to corresponding methods without "_async", these can be
- called concurrently and use for each request a new connection, where the
+ called concurrently and use for each request a new connection, where the
non-asynchronous counterparts use connection-alive (one connection for all requests)
- if possible.
+ if possible.
- Note, that you have to use Threads to call these methods concurrently.
+ Note, that you have to use Threads to call these methods concurrently.
The following example calls two methods concurrently:
-
+
Thread.new {
p client.call_async("michael.add", 4, 5)
}
-
+
Thread.new {
p client.call_async("michael.div", 7, 9)
}
-
+
--- XMLRPC::Client#timeout
--- XMLRPC::Client#user
@@ -200,12 +200,12 @@ call on the remote-side and of course the parameters for the remote procedure.
--- XMLRPC::Client#user= (new_user)
--- XMLRPC::Client#password= (new_password)
Set the corresponding attributes.
-
+
--- XMLRPC::Client#set_writer( writer )
Sets the XML writer to use for generating XML output.
Should be an instance of a class from module (({XMLRPC::XMLWriter})).
- If this method is not called, then (({XMLRPC::Config::DEFAULT_WRITER})) is used.
+ If this method is not called, then (({XMLRPC::Config::DEFAULT_WRITER})) is used.
--- XMLRPC::Client#set_parser( parser )
Sets the XML parser to use for parsing XML documents.
@@ -220,7 +220,7 @@ call on the remote-side and of course the parameters for the remote procedure.
Set extra HTTP headers that are included in the request.
--- XMLRPC::Client#http_header_extra
- Access the via ((<XMLRPC::Client#http_header_extra=>)) assigned header.
+ Access the via ((<XMLRPC::Client#http_header_extra=>)) assigned header.
--- XMLRPC::Client#http_last_response
Returns the (({Net::HTTPResponse})) object of the last RPC.
@@ -240,31 +240,31 @@ call on the remote-side and of course the parameters for the remote procedure.
== Description
Class (({XMLRPC::Client::Proxy})) makes XML-RPC calls look nicer!
-You can call any method onto objects of that class - the object handles
+You can call any method onto objects of that class - the object handles
(({method_missing})) and will forward the method call to a XML-RPC server.
Don't use this class directly, but use instead method ((<XMLRPC::Client#proxy>)) or
((<XMLRPC::Client#proxy2>)).
== Class Methods
---- XMLRPC::Client::Proxy.new( server, prefix, args=[], meth=:call, delim="." )
+--- XMLRPC::Client::Proxy.new( server, prefix, args=[], meth=:call, delim="." )
Creates an object which provides (({method_missing})).
((|server|)) must be of type (({XMLRPC::Client})), which is the XML-RPC server to be used
for a XML-RPC call. ((|prefix|)) and ((|delim|)) will be prepended to the methodname
- called onto this object.
+ called onto this object.
Parameter ((|meth|)) is the method (call, call2, call_async, call2_async) to use for
a RPC.
((|args|)) are arguments which are automatically given
to every XML-RPC call before the arguments provides through (({method_missing})).
-
+
== Instance Methods
Every method call is forwarded to the XML-RPC server defined in ((<new|XMLRPC::Client::Proxy#new>)).
-
+
Note: Inherited methods from class (({Object})) cannot be used as XML-RPC names, because they get around
-(({method_missing})).
-
+(({method_missing})).
+
= History
@@ -283,7 +283,7 @@ require "net/http"
module XMLRPC
class Client
-
+
USER_AGENT = "XMLRPC::Client (Ruby #{RUBY_VERSION})"
include ParserWriterChooseMixin
@@ -292,11 +292,11 @@ module XMLRPC
# Constructors -------------------------------------------------------------------
- def initialize(host=nil, path=nil, port=nil, proxy_host=nil, proxy_port=nil,
+ def initialize(host=nil, path=nil, port=nil, proxy_host=nil, proxy_port=nil,
user=nil, password=nil, use_ssl=nil, timeout=nil)
@http_header_extra = nil
- @http_last_response = nil
+ @http_last_response = nil
@cookie = nil
@host = host || "localhost"
@@ -325,7 +325,7 @@ module XMLRPC
# HTTP object for synchronous calls
Net::HTTP.version_1_2
- @http = Net::HTTP.new(@host, @port, @proxy_host, @proxy_port)
+ @http = Net::HTTP.new(@host, @port, @proxy_host, @proxy_port)
@http.use_ssl = @use_ssl if @use_ssl
@http.read_timeout = @timeout
@http.open_timeout = @timeout
@@ -341,7 +341,7 @@ module XMLRPC
if match = /^([^:]+):\/\/(([^@]+)@)?([^\/]+)(\/.*)?$/.match(uri)
proto = match[1]
user, passwd = (match[3] || "").split(":")
- host, port = match[4].split(":")
+ host, port = match[4].split(":")
path = match[5]
if proto != "http" and proto != "https"
@@ -351,7 +351,7 @@ module XMLRPC
else
raise "Wrong URI as parameter!"
end
-
+
proxy_host, proxy_port = (proxy || "").split(":")
self.new(host, path, port, proxy_host, proxy_port, user, passwd, (proto == "https"), timeout)
@@ -384,7 +384,7 @@ module XMLRPC
# Cookie support
attr_accessor :cookie
-
+
attr_reader :timeout, :user, :password
@@ -407,13 +407,13 @@ module XMLRPC
# Call methods --------------------------------------------------------------
def call(method, *args)
- ok, param = call2(method, *args)
+ ok, param = call2(method, *args)
if ok
param
else
raise param
end
- end
+ end
def call2(method, *args)
request = create().methodCall(method, *args)
@@ -422,13 +422,13 @@ module XMLRPC
end
def call_async(method, *args)
- ok, param = call2_async(method, *args)
+ ok, param = call2_async(method, *args)
if ok
param
else
raise param
end
- end
+ end
def call2_async(method, *args)
request = create().methodCall(method, *args)
@@ -467,7 +467,7 @@ module XMLRPC
# Proxy generating methods ------------------------------------------
-
+
def proxy(prefix=nil, *args)
Proxy.new(self, prefix, args, :call)
end
@@ -498,10 +498,10 @@ module XMLRPC
end
def do_rpc(request, async=false)
- header = {
+ header = {
"User-Agent" => USER_AGENT,
"Content-Type" => "text/xml; charset=utf-8",
- "Content-Length" => request.size.to_s,
+ "Content-Length" => request.size.to_s,
"Connection" => (async ? "close" : "keep-alive")
}
@@ -512,41 +512,41 @@ module XMLRPC
# add authorization header
header["Authorization"] = @auth
end
-
+
resp = nil
@http_last_response = nil
if async
- # use a new HTTP object for each call
+ # use a new HTTP object for each call
Net::HTTP.version_1_2
- http = Net::HTTP.new(@host, @port, @proxy_host, @proxy_port)
+ http = Net::HTTP.new(@host, @port, @proxy_host, @proxy_port)
http.use_ssl = @use_ssl if @use_ssl
http.read_timeout = @timeout
http.open_timeout = @timeout
-
+
# post request
http.start {
- resp = http.post2(@path, request, header)
+ resp = http.post2(@path, request, header)
}
else
# reuse the HTTP object for each call => connection alive is possible
# we must start connection explicitely first time so that http.request
# does not assume that we don't want keepalive
@http.start if not @http.started?
-
+
# post request
- resp = @http.post2(@path, request, header)
+ resp = @http.post2(@path, request, header)
end
-
+
@http_last_response = resp
data = resp.body
if resp.code == "401"
# Authorization Required
- raise "Authorization failed.\nHTTP-Error: #{resp.code} #{resp.message}"
+ raise "Authorization failed.\nHTTP-Error: #{resp.code} #{resp.message}"
elsif resp.code[0,1] != "2"
- raise "HTTP-Error: #{resp.code} #{resp.message}"
+ raise "HTTP-Error: #{resp.code} #{resp.message}"
end
ct = parse_content_type(resp["Content-Type"]).first
@@ -559,8 +559,8 @@ module XMLRPC
end
expected = resp["Content-Length"] || "<unknown>"
- if data.nil? or data.size == 0
- raise "Wrong size. Was #{data.size}, should be #{expected}"
+ if data.nil? or data.size == 0
+ raise "Wrong size. Was #{data.size}, should be #{expected}"
elsif expected != "<unknown>" and expected.to_i != data.size and resp["Transfer-Encoding"].nil?
raise "Wrong size. Was #{data.size}, should be #{expected}"
end
@@ -581,11 +581,11 @@ module XMLRPC
meth = :call2
meth = :call2_async if async
- ok, params = self.send(meth, "system.multicall",
+ ok, params = self.send(meth, "system.multicall",
methods.collect {|m| {'methodName' => m[0], 'params' => m[1..-1]} }
)
- if ok
+ if ok
params = params.collect do |param|
if param.is_a? Array
param[0]
@@ -593,7 +593,7 @@ module XMLRPC
XMLRPC::FaultException.new(param["faultCode"], param["faultString"])
else
raise "Wrong multicall return value"
- end
+ end
end
end
@@ -605,16 +605,16 @@ module XMLRPC
class Proxy
def initialize(server, prefix, args=[], meth=:call, delim=".")
- @server = server
- @prefix = prefix ? prefix + delim : ""
- @args = args
+ @server = server
+ @prefix = prefix ? prefix + delim : ""
+ @args = args
@meth = meth
end
def method_missing(mid, *args)
- pre = @prefix + mid.to_s
- arg = @args + args
- @server.send(@meth, pre, *arg)
+ pre = @prefix + mid.to_s
+ arg = @args + args
+ @server.send(@meth, pre, *arg)
end
end # class Proxy
diff --git a/lib/xmlrpc/config.rb b/lib/xmlrpc/config.rb
index 34c3bbaf1b..c4d2c41aac 100644
--- a/lib/xmlrpc/config.rb
+++ b/lib/xmlrpc/config.rb
@@ -8,7 +8,7 @@ module XMLRPC
module Config
DEFAULT_WRITER = XMLWriter::Simple # or XMLWriter::XMLParser
-
+
# available parser:
# * XMLParser::NQXMLTreeParser
# * XMLParser::NQXMLStreamParser
@@ -21,16 +21,16 @@ module XMLRPC
# enable <nil/> tag
ENABLE_NIL_CREATE = false
ENABLE_NIL_PARSER = false
-
+
# allows integers greater than 32-bit if true
ENABLE_BIGINT = false
# enable marshalling ruby objects which include XMLRPC::Marshallable
- ENABLE_MARSHALLING = true
+ ENABLE_MARSHALLING = true
# enable multiCall extension by default
ENABLE_MULTICALL = false
-
+
# enable Introspection extension by default
ENABLE_INTROSPECTION = false
diff --git a/lib/xmlrpc/create.rb b/lib/xmlrpc/create.rb
index 2d38a44b30..b5c94254a4 100644
--- a/lib/xmlrpc/create.rb
+++ b/lib/xmlrpc/create.rb
@@ -1,6 +1,6 @@
#
# Creates XML-RPC call/response documents
-#
+#
# Copyright (C) 2001, 2002, 2003 by Michael Neumann (mneumann@ntecs.de)
#
# $Id$
@@ -15,11 +15,11 @@ module XMLRPC
class Abstract
def ele(name, *children)
- element(name, nil, *children)
+ element(name, nil, *children)
end
def tag(name, txt)
- element(name, nil, text(txt))
+ element(name, nil, text(txt))
end
end
@@ -27,21 +27,21 @@ module XMLRPC
class Simple < Abstract
def document_to_str(doc)
- doc
+ doc
end
def document(*params)
- params.join("")
+ params.join("")
end
def pi(name, *params)
- "<?#{name} " + params.join(" ") + " ?>"
+ "<?#{name} " + params.join(" ") + " ?>"
end
def element(name, attrs, *children)
- raise "attributes not yet implemented" unless attrs.nil?
+ raise "attributes not yet implemented" unless attrs.nil?
if children.empty?
- "<#{name}/>"
+ "<#{name}/>"
else
"<#{name}>" + children.join("") + "</#{name}>"
end
@@ -61,27 +61,27 @@ module XMLRPC
class XMLParser < Abstract
def initialize
- require "xmltreebuilder"
+ require "xmltreebuilder"
end
def document_to_str(doc)
- doc.to_s
+ doc.to_s
end
def document(*params)
- XML::SimpleTree::Document.new(*params)
+ XML::SimpleTree::Document.new(*params)
end
def pi(name, *params)
- XML::SimpleTree::ProcessingInstruction.new(name, *params)
+ XML::SimpleTree::ProcessingInstruction.new(name, *params)
end
def element(name, attrs, *children)
- XML::SimpleTree::Element.new(name, attrs, *children)
+ XML::SimpleTree::Element.new(name, attrs, *children)
end
def text(txt)
- XML::SimpleTree::Text.new(txt)
+ XML::SimpleTree::Text.new(txt)
end
end # class XMLParser
@@ -111,20 +111,20 @@ module XMLRPC
name = name.to_s
if name !~ /[a-zA-Z0-9_.:\/]+/
- raise ArgumentError, "Wrong XML-RPC method-name"
+ raise ArgumentError, "Wrong XML-RPC method-name"
end
parameter = params.collect do |param|
- @writer.ele("param", conv2value(param))
+ @writer.ele("param", conv2value(param))
end
tree = @writer.document(
- @writer.pi("xml", 'version="1.0"'),
- @writer.ele("methodCall",
- @writer.tag("methodName", name),
- @writer.ele("params", *parameter)
- )
- )
+ @writer.pi("xml", 'version="1.0"'),
+ @writer.ele("methodCall",
+ @writer.tag("methodName", name),
+ @writer.ele("params", *parameter)
+ )
+ )
@writer.document_to_str(tree) + "\n"
end
@@ -137,30 +137,30 @@ module XMLRPC
# if is_ret == false then the params array must
# contain only one element, which is a structure
# of a fault return-value.
- #
- # if is_ret == true then a normal
+ #
+ # if is_ret == true then a normal
# return-value of all the given params is created.
#
def methodResponse(is_ret, *params)
- if is_ret
- resp = params.collect do |param|
- @writer.ele("param", conv2value(param))
- end
-
- resp = [@writer.ele("params", *resp)]
+ if is_ret
+ resp = params.collect do |param|
+ @writer.ele("param", conv2value(param))
+ end
+
+ resp = [@writer.ele("params", *resp)]
else
- if params.size != 1 or params[0] === XMLRPC::FaultException
- raise ArgumentError, "no valid fault-structure given"
- end
- resp = @writer.ele("fault", conv2value(params[0].to_h))
+ if params.size != 1 or params[0] === XMLRPC::FaultException
+ raise ArgumentError, "no valid fault-structure given"
+ end
+ resp = @writer.ele("fault", conv2value(params[0].to_h))
end
-
+
tree = @writer.document(
- @writer.pi("xml", 'version="1.0"'),
- @writer.ele("methodResponse", resp)
- )
+ @writer.pi("xml", 'version="1.0"'),
+ @writer.ele("methodResponse", resp)
+ )
@writer.document_to_str(tree) + "\n"
end
@@ -177,11 +177,11 @@ module XMLRPC
#
def conv2value(param)
- val = case param
- when Fixnum
- @writer.tag("i4", param.to_s)
+ val = case param
+ when Fixnum
+ @writer.tag("i4", param.to_s)
- when Bignum
+ when Bignum
if Config::ENABLE_BIGINT
@writer.tag("i4", param.to_s)
else
@@ -191,14 +191,14 @@ module XMLRPC
raise "Bignum is too big! Must be signed 32-bit integer!"
end
end
- when TrueClass, FalseClass
- @writer.tag("boolean", param ? "1" : "0")
+ when TrueClass, FalseClass
+ @writer.tag("boolean", param ? "1" : "0")
- when Symbol
- @writer.tag("string", param.to_s)
+ when String
+ @writer.tag("string", param)
- when String
- @writer.tag("string", param)
+ when Symbol
+ @writer.tag("string", param.to_s)
when NilClass
if Config::ENABLE_NIL_CREATE
@@ -207,55 +207,55 @@ module XMLRPC
raise "Wrong type NilClass. Not allowed!"
end
- when Float
- @writer.tag("double", param.to_s)
-
- when Struct
- h = param.members.collect do |key|
- value = param[key]
- @writer.ele("member",
- @writer.tag("name", key.to_s),
- conv2value(value)
- )
- end
-
- @writer.ele("struct", *h)
-
- when Hash
- # TODO: can a Hash be empty?
-
- h = param.collect do |key, value|
- @writer.ele("member",
- @writer.tag("name", key.to_s),
- conv2value(value)
- )
- end
-
- @writer.ele("struct", *h)
-
- when Array
- # TODO: can an Array be empty?
- a = param.collect {|v| conv2value(v) }
-
- @writer.ele("array",
- @writer.ele("data", *a)
- )
-
- when Time, Date, ::DateTime
- @writer.tag("dateTime.iso8601", param.strftime("%Y%m%dT%H:%M:%S"))
-
- when XMLRPC::DateTime
- @writer.tag("dateTime.iso8601",
- format("%.4d%02d%02dT%02d:%02d:%02d", *param.to_a))
-
- when XMLRPC::Base64
- @writer.tag("base64", param.encoded)
-
- else
+ when Float
+ @writer.tag("double", param.to_s)
+
+ when Struct
+ h = param.members.collect do |key|
+ value = param[key]
+ @writer.ele("member",
+ @writer.tag("name", key.to_s),
+ conv2value(value)
+ )
+ end
+
+ @writer.ele("struct", *h)
+
+ when Hash
+ # TODO: can a Hash be empty?
+
+ h = param.collect do |key, value|
+ @writer.ele("member",
+ @writer.tag("name", key.to_s),
+ conv2value(value)
+ )
+ end
+
+ @writer.ele("struct", *h)
+
+ when Array
+ # TODO: can an Array be empty?
+ a = param.collect {|v| conv2value(v) }
+
+ @writer.ele("array",
+ @writer.ele("data", *a)
+ )
+
+ when Time, Date, ::DateTime
+ @writer.tag("dateTime.iso8601", param.strftime("%Y%m%dT%H:%M:%S"))
+
+ when XMLRPC::DateTime
+ @writer.tag("dateTime.iso8601",
+ format("%.4d%02d%02dT%02d:%02d:%02d", *param.to_a))
+
+ when XMLRPC::Base64
+ @writer.tag("base64", param.encoded)
+
+ else
if Config::ENABLE_MARSHALLING and param.class.included_modules.include? XMLRPC::Marshallable
# convert Ruby object into Hash
ret = {"___class___" => param.class.name}
- param.instance_variables.each {|v|
+ param.instance_variables.each {|v|
name = v[1..-1]
val = param.instance_variable_get(v)
@@ -266,24 +266,24 @@ module XMLRPC
end
}
return conv2value(ret)
- else
+ else
ok, pa = wrong_type(param)
if ok
return conv2value(pa)
- else
+ else
raise "Wrong type!"
end
end
- end
-
- @writer.ele("value", val)
+ end
+
+ @writer.ele("value", val)
end
def wrong_type(value)
false
end
-
+
end # class Create
end # module XMLRPC
diff --git a/lib/xmlrpc/datetime.rb b/lib/xmlrpc/datetime.rb
index d6c80a2cb9..298263fe8a 100644
--- a/lib/xmlrpc/datetime.rb
+++ b/lib/xmlrpc/datetime.rb
@@ -10,19 +10,19 @@ Released under the same term of license as Ruby.
= XMLRPC::DateTime
== Description
This class is important to handle XMLRPC (('dateTime.iso8601')) values,
-correcly, because normal UNIX-dates (class (({Date}))) only handle dates
+correcly, because normal UNIX-dates (class (({Date}))) only handle dates
from year 1970 on, and class (({Time})) handles dates without the time
-component. (({XMLRPC::DateTime})) is able to store a XMLRPC
+component. (({XMLRPC::DateTime})) is able to store a XMLRPC
(('dateTime.iso8601')) value correctly.
== Class Methods
--- XMLRPC::DateTime.new( year, month, day, hour, min, sec )
Creates a new (({XMLRPC::DateTime})) instance with the
- parameters ((|year|)), ((|month|)), ((|day|)) as date and
+ parameters ((|year|)), ((|month|)), ((|day|)) as date and
((|hour|)), ((|min|)), ((|sec|)) as time.
Raises (({ArgumentError})) if a parameter is out of range, or ((|year|)) is not
of type (({Integer})).
-
+
== Instance Methods
--- XMLRPC::DateTime#year
--- XMLRPC::DateTime#month
@@ -50,7 +50,7 @@ component. (({XMLRPC::DateTime})) is able to store a XMLRPC
--- XMLRPC::DateTime#to_time
Return a (({Time})) object of the date/time which (({self})) represents.
- If the (('year')) is below 1970, this method returns (({nil})),
+ If the (('year')) is below 1970, this method returns (({nil})),
because (({Time})) cannot handle years below 1970.
The used timezone is GMT.
@@ -68,7 +68,7 @@ require "date"
module XMLRPC
class DateTime
-
+
attr_reader :year, :month, :day, :hour, :min, :sec
def year= (value)
@@ -102,14 +102,14 @@ class DateTime
end
alias mon month
- alias mon= month=
-
+ alias mon= month=
+
def initialize(year, month, day, hour, min, sec)
self.year, self.month, self.day = year, month, day
self.hour, self.min, self.sec = hour, min, sec
end
-
+
def to_time
if @year >= 1970
Time.gm(*to_a)
@@ -127,7 +127,7 @@ class DateTime
end
def ==(o)
- self.to_a == Array(o) rescue false
+ Array(self) == Array(o)
end
end
diff --git a/lib/xmlrpc/httpserver.rb b/lib/xmlrpc/httpserver.rb
index 66d52139db..9afb5fd5ec 100644
--- a/lib/xmlrpc/httpserver.rb
+++ b/lib/xmlrpc/httpserver.rb
@@ -1,7 +1,7 @@
#
-# Implements a simple HTTP-server by using John W. Small's (jsmall@laser.net)
+# Implements a simple HTTP-server by using John W. Small's (jsmall@laser.net)
# ruby-generic-server.
-#
+#
# Copyright (C) 2001, 2002, 2003 by Michael Neumann (mneumann@ntecs.de)
#
# $Id$
@@ -14,8 +14,8 @@ class HttpServer < GServer
##
# handle_obj specifies the object, that receives calls to request_handler
- # and ip_auth_handler
- def initialize(handle_obj, port = 8080, host = DEFAULT_HOST, maxConnections = 4,
+ # and ip_auth_handler
+ def initialize(handle_obj, port = 8080, host = DEFAULT_HOST, maxConnections = 4,
stdlog = $stdout, audit = true, debug = true)
@handler = handle_obj
super(port, host, maxConnections, stdlog, audit, debug)
@@ -24,7 +24,7 @@ class HttpServer < GServer
private
# Constants -----------------------------------------------
-
+
CRLF = "\r\n"
HTTP_PROTO = "HTTP/1.0"
SERVER_NAME = "HttpServer (Ruby #{RUBY_VERSION})"
@@ -46,27 +46,27 @@ private
}
# Classes -------------------------------------------------
-
+
class Request
attr_reader :data, :header, :method, :path, :proto
-
+
def initialize(data, method=nil, path=nil, proto=nil)
@header, @data = Table.new, data
@method, @path, @proto = method, path, proto
end
-
+
def content_length
len = @header['Content-Length']
return nil if len.nil?
- return len.to_i
+ return len.to_i
end
-
+
end
-
+
class Response
attr_reader :header
attr_accessor :body, :status, :status_message
-
+
def initialize(status=200)
@status = status
@status_message = nil
@@ -82,7 +82,7 @@ private
include Enumerable
def initialize(hash={})
- @hash = hash
+ @hash = hash
update(hash)
end
@@ -113,7 +113,7 @@ private
def http_header(header=nil)
new_header = Table.new(DEFAULT_HEADER)
- new_header.update(header) unless header.nil?
+ new_header.update(header) unless header.nil?
new_header["Connection"] = "close"
new_header["Date"] = http_date(Time.now)
@@ -127,7 +127,7 @@ private
def http_resp(status_code, status_message=nil, header=nil, body=nil)
status_message ||= StatusCodeMapping[status_code]
-
+
str = ""
str << "#{HTTP_PROTO} #{status_code} #{status_message}" << CRLF
http_header(header).writeTo(str)
@@ -137,8 +137,8 @@ private
end
# Main Serve Loop -----------------------------------------
-
- def serve(io)
+
+ def serve(io)
# perform IP authentification
unless @handler.ip_auth_handler(io)
io << http_resp(403, "Forbidden")
@@ -149,26 +149,26 @@ private
if io.gets =~ /^(\S+)\s+(\S+)\s+(\S+)/
request = Request.new(io, $1, $2, $3)
else
- io << http_resp(400, "Bad Request")
+ io << http_resp(400, "Bad Request")
return
end
-
+
# parse HTTP headers
while (line=io.gets) !~ /^(\n|\r)/
if line =~ /^([\w-]+):\s*(.*)$/
- request.header[$1] = $2.strip
+ request.header[$1] = $2.strip
end
end
- io.binmode
+ io.binmode
response = Response.new
# execute request handler
@handler.request_handler(request, response)
-
+
# write response back to the client
io << http_resp(response.status, response.status_message,
- response.header, response.body)
+ response.header, response.body)
rescue Exception => e
io << http_resp(500, "Internal Server Error")
diff --git a/lib/xmlrpc/marshal.rb b/lib/xmlrpc/marshal.rb
index d121828312..26510124c2 100644
--- a/lib/xmlrpc/marshal.rb
+++ b/lib/xmlrpc/marshal.rb
@@ -1,6 +1,6 @@
#
# Marshalling of XML-RPC methodCall and methodResponse
-#
+#
# Copyright (C) 2001, 2002, 2003 by Michael Neumann (mneumann@ntecs.de)
#
# $Id$
@@ -17,7 +17,7 @@ module XMLRPC
include ParserWriterChooseMixin
# class methods -------------------------------
-
+
class << self
def dump_call( methodName, *params )
@@ -52,7 +52,7 @@ module XMLRPC
create.methodCall( methodName, *params )
end
- def dump_response( param )
+ def dump_response( param )
create.methodResponse( ! param.kind_of?( XMLRPC::FaultException ) , param )
end
diff --git a/lib/xmlrpc/parser.rb b/lib/xmlrpc/parser.rb
index d078de2f4b..6d10fde9d9 100644
--- a/lib/xmlrpc/parser.rb
+++ b/lib/xmlrpc/parser.rb
@@ -1,6 +1,6 @@
#
# Parser for XML-RPC call and response
-#
+#
# Copyright (C) 2001, 2002, 2003 by Michael Neumann (mneumann@ntecs.de)
#
# $Id$
@@ -60,7 +60,7 @@ module XMLRPC
@faultCode = faultCode
@faultString = faultString
end
-
+
# returns a hash
def to_h
{"faultCode" => @faultCode, "faultString" => @faultString}
@@ -77,7 +77,7 @@ module XMLRPC
when "0" then false
when "1" then true
else
- raise "RPC-value of type boolean is wrong"
+ raise "RPC-value of type boolean is wrong"
end
end
@@ -122,7 +122,7 @@ module XMLRPC
def self.struct(hash)
# convert to marhalled object
klass = hash["___class___"]
- if klass.nil? or Config::ENABLE_MARSHALLING == false
+ if klass.nil? or Config::ENABLE_MARSHALLING == false
hash
else
begin
@@ -130,9 +130,9 @@ module XMLRPC
klass.split("::").each {|const| mod = mod.const_get(const.strip)}
obj = mod.allocate
-
+
hash.delete "___class___"
- hash.each {|key, value|
+ hash.each {|key, value|
obj.instance_variable_set("@#{ key }", value) if key =~ /^([\w_][\w_0-9]*)$/
}
obj
@@ -143,11 +143,11 @@ module XMLRPC
end
def self.fault(hash)
- if hash.kind_of? Hash and hash.size == 2 and
- hash.has_key? "faultCode" and hash.has_key? "faultString" and
+ if hash.kind_of? Hash and hash.size == 2 and
+ hash.has_key? "faultCode" and hash.has_key? "faultString" and
hash["faultCode"].kind_of? Integer and hash["faultString"].kind_of? String
- XMLRPC::FaultException.new(hash["faultCode"], hash["faultString"])
+ XMLRPC::FaultException.new(hash["faultCode"], hash["faultString"])
else
raise "wrong fault-structure: #{hash.inspect}"
end
@@ -160,11 +160,11 @@ module XMLRPC
class AbstractTreeParser
def parseMethodResponse(str)
- methodResponse_document(createCleanedTree(str))
+ methodResponse_document(createCleanedTree(str))
end
def parseMethodCall(str)
- methodCall_document(createCleanedTree(str))
+ methodCall_document(createCleanedTree(str))
end
private
@@ -174,205 +174,205 @@ module XMLRPC
# and all comments
#
def removeWhitespacesAndComments(node)
- remove = []
- childs = node.childNodes.to_a
- childs.each do |nd|
- case _nodeType(nd)
- when :TEXT
+ remove = []
+ childs = node.childNodes.to_a
+ childs.each do |nd|
+ case _nodeType(nd)
+ when :TEXT
# TODO: add nil?
unless %w(i4 int boolean string double dateTime.iso8601 base64).include? node.nodeName
- if node.nodeName == "value"
+ if node.nodeName == "value"
if not node.childNodes.to_a.detect {|n| _nodeType(n) == :ELEMENT}.nil?
- remove << nd if nd.nodeValue.strip == ""
+ remove << nd if nd.nodeValue.strip == ""
end
else
remove << nd if nd.nodeValue.strip == ""
end
- end
- when :COMMENT
- remove << nd
- else
- removeWhitespacesAndComments(nd)
- end
- end
+ end
+ when :COMMENT
+ remove << nd
+ else
+ removeWhitespacesAndComments(nd)
+ end
+ end
- remove.each { |i| node.removeChild(i) }
+ remove.each { |i| node.removeChild(i) }
end
def nodeMustBe(node, name)
- cmp = case name
- when Array
- name.include?(node.nodeName)
- when String
- name == node.nodeName
- else
- raise "error"
- end
+ cmp = case name
+ when Array
+ name.include?(node.nodeName)
+ when String
+ name == node.nodeName
+ else
+ raise "error"
+ end
- if not cmp then
- raise "wrong xml-rpc (name)"
- end
+ if not cmp then
+ raise "wrong xml-rpc (name)"
+ end
- node
+ node
end
#
# returns, when successfully the only child-node
#
def hasOnlyOneChild(node, name=nil)
- if node.childNodes.to_a.size != 1
- raise "wrong xml-rpc (size)"
- end
- if name != nil then
- nodeMustBe(node.firstChild, name)
- end
+ if node.childNodes.to_a.size != 1
+ raise "wrong xml-rpc (size)"
+ end
+ if name != nil then
+ nodeMustBe(node.firstChild, name)
+ end
end
def assert(b)
- if not b then
- raise "assert-fail"
- end
+ if not b then
+ raise "assert-fail"
+ end
end
# the node `node` has empty string or string
def text_zero_one(node)
- nodes = node.childNodes.to_a.size
+ nodes = node.childNodes.to_a.size
- if nodes == 1
- text(node.firstChild)
- elsif nodes == 0
- ""
- else
- raise "wrong xml-rpc (size)"
- end
+ if nodes == 1
+ text(node.firstChild)
+ elsif nodes == 0
+ ""
+ else
+ raise "wrong xml-rpc (size)"
+ end
end
-
+
def integer(node)
- #TODO: check string for float because to_i returnsa
- # 0 when wrong string
- nodeMustBe(node, %w(i4 int))
- hasOnlyOneChild(node)
-
- Convert.int(text(node.firstChild))
+ #TODO: check string for float because to_i returnsa
+ # 0 when wrong string
+ nodeMustBe(node, %w(i4 int))
+ hasOnlyOneChild(node)
+
+ Convert.int(text(node.firstChild))
end
def boolean(node)
- nodeMustBe(node, "boolean")
- hasOnlyOneChild(node)
-
+ nodeMustBe(node, "boolean")
+ hasOnlyOneChild(node)
+
Convert.boolean(text(node.firstChild))
end
def v_nil(node)
nodeMustBe(node, "nil")
- assert( node.childNodes.to_a.size == 0 )
+ assert( node.childNodes.to_a.size == 0 )
nil
end
def string(node)
- nodeMustBe(node, "string")
- text_zero_one(node)
+ nodeMustBe(node, "string")
+ text_zero_one(node)
end
def double(node)
- #TODO: check string for float because to_f returnsa
- # 0.0 when wrong string
- nodeMustBe(node, "double")
- hasOnlyOneChild(node)
-
- Convert.double(text(node.firstChild))
+ #TODO: check string for float because to_f returnsa
+ # 0.0 when wrong string
+ nodeMustBe(node, "double")
+ hasOnlyOneChild(node)
+
+ Convert.double(text(node.firstChild))
end
def dateTime(node)
- nodeMustBe(node, "dateTime.iso8601")
- hasOnlyOneChild(node)
-
+ nodeMustBe(node, "dateTime.iso8601")
+ hasOnlyOneChild(node)
+
Convert.dateTime( text(node.firstChild) )
end
def base64(node)
- nodeMustBe(node, "base64")
- #hasOnlyOneChild(node)
-
+ nodeMustBe(node, "base64")
+ #hasOnlyOneChild(node)
+
Convert.base64(text_zero_one(node))
end
def member(node)
- nodeMustBe(node, "member")
- assert( node.childNodes.to_a.size == 2 )
+ nodeMustBe(node, "member")
+ assert( node.childNodes.to_a.size == 2 )
- [ name(node[0]), value(node[1]) ]
+ [ name(node[0]), value(node[1]) ]
end
def name(node)
- nodeMustBe(node, "name")
- #hasOnlyOneChild(node)
- text_zero_one(node)
+ nodeMustBe(node, "name")
+ #hasOnlyOneChild(node)
+ text_zero_one(node)
end
def array(node)
- nodeMustBe(node, "array")
- hasOnlyOneChild(node, "data")
- data(node.firstChild)
+ nodeMustBe(node, "array")
+ hasOnlyOneChild(node, "data")
+ data(node.firstChild)
end
def data(node)
- nodeMustBe(node, "data")
+ nodeMustBe(node, "data")
- node.childNodes.to_a.collect do |val|
- value(val)
- end
+ node.childNodes.to_a.collect do |val|
+ value(val)
+ end
end
def param(node)
- nodeMustBe(node, "param")
- hasOnlyOneChild(node, "value")
- value(node.firstChild)
+ nodeMustBe(node, "param")
+ hasOnlyOneChild(node, "value")
+ value(node.firstChild)
end
-
+
def methodResponse(node)
- nodeMustBe(node, "methodResponse")
- hasOnlyOneChild(node, %w(params fault))
- child = node.firstChild
+ nodeMustBe(node, "methodResponse")
+ hasOnlyOneChild(node, %w(params fault))
+ child = node.firstChild
- case child.nodeName
- when "params"
- [ true, params(child,false) ]
- when "fault"
- [ false, fault(child) ]
- else
- raise "unexpected error"
- end
+ case child.nodeName
+ when "params"
+ [ true, params(child,false) ]
+ when "fault"
+ [ false, fault(child) ]
+ else
+ raise "unexpected error"
+ end
end
def methodName(node)
- nodeMustBe(node, "methodName")
- hasOnlyOneChild(node)
- text(node.firstChild)
+ nodeMustBe(node, "methodName")
+ hasOnlyOneChild(node)
+ text(node.firstChild)
end
def params(node, call=true)
- nodeMustBe(node, "params")
+ nodeMustBe(node, "params")
- if call
- node.childNodes.to_a.collect do |n|
- param(n)
- end
- else # response (only one param)
- hasOnlyOneChild(node)
- param(node.firstChild)
- end
+ if call
+ node.childNodes.to_a.collect do |n|
+ param(n)
+ end
+ else # response (only one param)
+ hasOnlyOneChild(node)
+ param(node.firstChild)
+ end
end
def fault(node)
- nodeMustBe(node, "fault")
- hasOnlyOneChild(node, "value")
- f = value(node.firstChild)
+ nodeMustBe(node, "fault")
+ hasOnlyOneChild(node, "value")
+ f = value(node.firstChild)
Convert.fault(f)
end
@@ -380,76 +380,76 @@ module XMLRPC
# _nodeType is defined in the subclass
def text(node)
- assert( _nodeType(node) == :TEXT )
- assert( node.hasChildNodes == false )
- assert( node.nodeValue != nil )
+ assert( _nodeType(node) == :TEXT )
+ assert( node.hasChildNodes == false )
+ assert( node.nodeValue != nil )
- node.nodeValue.to_s
+ node.nodeValue.to_s
end
def struct(node)
- nodeMustBe(node, "struct")
+ nodeMustBe(node, "struct")
- hash = {}
- node.childNodes.to_a.each do |me|
- n, v = member(me)
- hash[n] = v
- end
+ hash = {}
+ node.childNodes.to_a.each do |me|
+ n, v = member(me)
+ hash[n] = v
+ end
Convert.struct(hash)
- end
+ end
def value(node)
- nodeMustBe(node, "value")
- nodes = node.childNodes.to_a.size
- if nodes == 0
+ nodeMustBe(node, "value")
+ nodes = node.childNodes.to_a.size
+ if nodes == 0
return ""
- elsif nodes > 1
- raise "wrong xml-rpc (size)"
+ elsif nodes > 1
+ raise "wrong xml-rpc (size)"
end
- child = node.firstChild
+ child = node.firstChild
- case _nodeType(child)
- when :TEXT
+ case _nodeType(child)
+ when :TEXT
text_zero_one(node)
- when :ELEMENT
- case child.nodeName
- when "i4", "int" then integer(child)
- when "boolean" then boolean(child)
- when "string" then string(child)
- when "double" then double(child)
- when "dateTime.iso8601" then dateTime(child)
- when "base64" then base64(child)
- when "struct" then struct(child)
- when "array" then array(child)
- when "nil"
+ when :ELEMENT
+ case child.nodeName
+ when "i4", "int" then integer(child)
+ when "boolean" then boolean(child)
+ when "string" then string(child)
+ when "double" then double(child)
+ when "dateTime.iso8601" then dateTime(child)
+ when "base64" then base64(child)
+ when "struct" then struct(child)
+ when "array" then array(child)
+ when "nil"
if Config::ENABLE_NIL_PARSER
v_nil(child)
else
raise "wrong/unknown XML-RPC type 'nil'"
end
- else
- raise "wrong/unknown XML-RPC type"
- end
- else
- raise "wrong type of node"
- end
+ else
+ raise "wrong/unknown XML-RPC type"
+ end
+ else
+ raise "wrong type of node"
+ end
end
def methodCall(node)
- nodeMustBe(node, "methodCall")
- assert( (1..2).include?( node.childNodes.to_a.size ) )
- name = methodName(node[0])
-
- if node.childNodes.to_a.size == 2 then
- pa = params(node[1])
- else # no parameters given
- pa = []
- end
- [name, pa]
+ nodeMustBe(node, "methodCall")
+ assert( (1..2).include?( node.childNodes.to_a.size ) )
+ name = methodName(node[0])
+
+ if node.childNodes.to_a.size == 2 then
+ pa = params(node[1])
+ else # no parameters given
+ pa = []
+ end
+ [name, pa]
end
end # module TreeParserMixin
@@ -461,7 +461,7 @@ module XMLRPC
raise "No valid method response!" if parser.method_name != nil
if parser.fault != nil
# is a fault structure
- [false, parser.fault]
+ [false, parser.fault]
else
# is a normal return value
raise "Missing return value!" if parser.params.size == 0
@@ -508,7 +508,7 @@ module XMLRPC
@value = nil
when "nil"
raise "wrong/unknown XML-RPC type 'nil'" unless Config::ENABLE_NIL_PARSER
- @value = :nil
+ @value = :nil
when "array"
@val_stack << @values
@values = []
@@ -517,7 +517,7 @@ module XMLRPC
@name = []
@structs << @struct
- @struct = {}
+ @struct = {}
end
end
@@ -538,7 +538,7 @@ module XMLRPC
@value = Convert.base64(@data)
when "value"
@value = @data if @value.nil?
- @values << (@value == :nil ? nil : @value)
+ @values << (@value == :nil ? nil : @value)
when "array"
@value = @values
@values = @val_stack.pop
@@ -548,9 +548,9 @@ module XMLRPC
@name = @names.pop
@struct = @structs.pop
when "name"
- @name[0] = @data
+ @name[0] = @data
when "member"
- @struct[@name[0]] = @values.pop
+ @struct[@name[0]] = @values.pop
when "param"
@params << @values[0]
@@ -560,7 +560,7 @@ module XMLRPC
@fault = Convert.fault(@values[0])
when "methodName"
- @method_name = @data
+ @method_name = @data
end
@data = nil
@@ -592,7 +592,7 @@ module XMLRPC
@parser_class = XMLRPCParser
end
- class XMLRPCParser
+ class XMLRPCParser
include StreamParserMixin
def parse(str)
@@ -620,9 +620,9 @@ module XMLRPC
def initialize
require "xmltreebuilder"
- # The new XMLParser library (0.6.2+) uses a slightly different DOM implementation.
+ # The new XMLParser library (0.6.2+) uses a slightly different DOM implementation.
# The following code removes the differences between both versions.
- if defined? XML::DOM::Builder
+ if defined? XML::DOM::Builder
return if defined? XML::DOM::Node::DOCUMENT # code below has been already executed
klass = XML::DOM::Node
klass.const_set("DOCUMENT", klass::DOCUMENT_NODE)
@@ -635,34 +635,34 @@ module XMLRPC
private
def _nodeType(node)
- tp = node.nodeType
- if tp == XML::SimpleTree::Node::TEXT then :TEXT
- elsif tp == XML::SimpleTree::Node::COMMENT then :COMMENT
- elsif tp == XML::SimpleTree::Node::ELEMENT then :ELEMENT
- else :ELSE
- end
+ tp = node.nodeType
+ if tp == XML::SimpleTree::Node::TEXT then :TEXT
+ elsif tp == XML::SimpleTree::Node::COMMENT then :COMMENT
+ elsif tp == XML::SimpleTree::Node::ELEMENT then :ELEMENT
+ else :ELSE
+ end
end
def methodResponse_document(node)
- assert( node.nodeType == XML::SimpleTree::Node::DOCUMENT )
- hasOnlyOneChild(node, "methodResponse")
-
- methodResponse(node.firstChild)
+ assert( node.nodeType == XML::SimpleTree::Node::DOCUMENT )
+ hasOnlyOneChild(node, "methodResponse")
+
+ methodResponse(node.firstChild)
end
def methodCall_document(node)
- assert( node.nodeType == XML::SimpleTree::Node::DOCUMENT )
- hasOnlyOneChild(node, "methodCall")
-
- methodCall(node.firstChild)
+ assert( node.nodeType == XML::SimpleTree::Node::DOCUMENT )
+ hasOnlyOneChild(node, "methodCall")
+
+ methodCall(node.firstChild)
end
def createCleanedTree(str)
- doc = XML::SimpleTreeBuilder.new.parse(str)
- doc.documentElement.normalize
- removeWhitespacesAndComments(doc)
- doc
+ doc = XML::SimpleTreeBuilder.new.parse(str)
+ doc.documentElement.normalize
+ removeWhitespacesAndComments(doc)
+ doc
end
end # class XMLParser
@@ -676,21 +676,21 @@ module XMLRPC
private
def _nodeType(node)
- node.nodeType
+ node.nodeType
end
def methodResponse_document(node)
- methodResponse(node)
+ methodResponse(node)
end
def methodCall_document(node)
- methodCall(node)
+ methodCall(node)
end
def createCleanedTree(str)
- doc = ::NQXML::TreeParser.new(str).document.rootNode
- removeWhitespacesAndComments(doc)
- doc
+ doc = ::NQXML::TreeParser.new(str).document.rootNode
+ removeWhitespacesAndComments(doc)
+ doc
end
end # class NQXMLTreeParser
@@ -701,7 +701,7 @@ module XMLRPC
@parser_class = StreamListener
end
- class StreamListener
+ class StreamListener
include StreamParserMixin
alias :tag_start :startElement
@@ -715,8 +715,8 @@ module XMLRPC
def parse(str)
parser = REXML::Document.parse_stream(str, self)
- end
- end
+ end
+ end
end
# ---------------------------------------------------------------------------
@@ -751,7 +751,7 @@ module XMLRPC
startElement(name)
endElement(name)
end
-
+
def on_chardata(str)
character(str)
end
@@ -784,7 +784,7 @@ module XMLRPC
# valid_name?
# valid_chardata?
# valid_char?
- # parse_error
+ # parse_error
end
end
@@ -792,8 +792,8 @@ module XMLRPC
XMLParser = XMLTreeParser
NQXMLParser = NQXMLTreeParser
- Classes = [XMLStreamParser, XMLTreeParser,
- NQXMLStreamParser, NQXMLTreeParser,
+ Classes = [XMLStreamParser, XMLTreeParser,
+ NQXMLStreamParser, NQXMLTreeParser,
REXMLStreamParser, XMLScanStreamParser]
# yields an instance of each installed parser
diff --git a/lib/xmlrpc/server.rb b/lib/xmlrpc/server.rb
index 6b5c5d4253..0ee88c8c8f 100644
--- a/lib/xmlrpc/server.rb
+++ b/lib/xmlrpc/server.rb
@@ -14,23 +14,23 @@ Released under the same term of license as Ruby.
= XMLRPC::BasicServer
== Description
Is the base class for all XML-RPC server-types (CGI, standalone).
-You can add handler and set a default handler.
+You can add handler and set a default handler.
Do not use this server, as this is/should be an abstract class.
=== How the method to call is found
-The arity (number of accepted arguments) of a handler (method or (({Proc})) object) is
-compared to the given arguments submitted by the client for a RPC ((-Remote Procedure Call-)).
-A handler is only called if it accepts the number of arguments, otherwise the search
-for another handler will go on. When at the end no handler was found,
+The arity (number of accepted arguments) of a handler (method or (({Proc})) object) is
+compared to the given arguments submitted by the client for a RPC ((-Remote Procedure Call-)).
+A handler is only called if it accepts the number of arguments, otherwise the search
+for another handler will go on. When at the end no handler was found,
the ((<default_handler|XMLRPC::BasicServer#set_default_handler>)) will be called.
With this technique it is possible to do overloading by number of parameters, but
only for (({Proc})) handler, because you cannot define two methods of the same name in
-the same class.
+the same class.
== Class Methods
--- XMLRPC::BasicServer.new( class_delim="." )
- Creates a new (({XMLRPC::BasicServer})) instance, which should not be
+ Creates a new (({XMLRPC::BasicServer})) instance, which should not be
done, because (({XMLRPC::BasicServer})) is an abstract class. This
method should be called from a subclass indirectly by a (({super})) call
in the method (({initialize})). The paramter ((|class_delim|)) is used
@@ -40,24 +40,24 @@ the same class.
== Instance Methods
--- XMLRPC::BasicServer#add_handler( name, signature=nil, help=nil ) { aBlock }
Adds ((|aBlock|)) to the list of handlers, with ((|name|)) as the name of the method.
- Parameters ((|signature|)) and ((|help|)) are used by the Introspection method if specified,
- where ((|signature|)) is either an Array containing strings each representing a type of it's
- signature (the first is the return value) or an Array of Arrays if the method has multiple
+ Parameters ((|signature|)) and ((|help|)) are used by the Introspection method if specified,
+ where ((|signature|)) is either an Array containing strings each representing a type of it's
+ signature (the first is the return value) or an Array of Arrays if the method has multiple
signatures. Value type-names are "int, boolean, double, string, dateTime.iso8601, base64, array, struct".
Parameter ((|help|)) is a String with informations about how to call this method etc.
A handler method or code-block can return the types listed at
- ((<XMLRPC::Client#call|URL:client.html#index:0>)).
- When a method fails, it can tell it the client by throwing an
+ ((<XMLRPC::Client#call|URL:client.html#index:0>)).
+ When a method fails, it can tell it the client by throwing an
(({XMLRPC::FaultException})) like in this example:
s.add_handler("michael.div") do |a,b|
if b == 0
raise XMLRPC::FaultException.new(1, "division by zero")
else
- a / b
+ a / b
end
- end
+ end
The client gets in the case of (({b==0})) an object back of type
(({XMLRPC::FaultException})) that has a ((|faultCode|)) and ((|faultString|))
field.
@@ -67,10 +67,10 @@ the same class.
To add an object write:
server.add_handler("michael", MyHandlerClass.new)
All public methods of (({MyHandlerClass})) are accessible to
- the XML-RPC clients by (('michael."name of method"')). This is
- where the ((|class_delim|)) in ((<new|XMLRPC::BasicServer.new>))
- has it's role, a XML-RPC method-name is defined by
- ((|prefix|)) + ((|class_delim|)) + (('"name of method"')).
+ the XML-RPC clients by (('michael."name of method"')). This is
+ where the ((|class_delim|)) in ((<new|XMLRPC::BasicServer.new>))
+ has it's role, a XML-RPC method-name is defined by
+ ((|prefix|)) + ((|class_delim|)) + (('"name of method"')).
--- XMLRPC::BasicServer#add_handler( interface, obj )
This is the third form of ((<add_handler|XMLRPC::BasicServer#add_handler>)).
@@ -91,11 +91,11 @@ the same class.
It is a (({Proc})) object or (({nil})).
--- XMLRPC::BasicServer#set_default_handler ( &handler )
- Sets ((|handler|)) as the default-handler, which is called when
+ Sets ((|handler|)) as the default-handler, which is called when
no handler for a method-name is found. ((|handler|)) is a code-block.
The default-handler is called with the (XML-RPC) method-name as first argument, and
the other arguments are the parameters given by the client-call.
-
+
If no block is specified the default of (({XMLRPC::BasicServer})) is used, which raises a
XMLRPC::FaultException saying "method missing".
@@ -103,7 +103,7 @@ the same class.
--- XMLRPC::BasicServer#set_writer( writer )
Sets the XML writer to use for generating XML output.
Should be an instance of a class from module (({XMLRPC::XMLWriter})).
- If this method is not called, then (({XMLRPC::Config::DEFAULT_WRITER})) is used.
+ If this method is not called, then (({XMLRPC::Config::DEFAULT_WRITER})) is used.
--- XMLRPC::BasicServer#set_parser( parser )
Sets the XML parser to use for parsing XML documents.
@@ -111,7 +111,7 @@ the same class.
If this method is not called, then (({XMLRPC::Config::DEFAULT_PARSER})) is used.
--- XMLRPC::BasicServer#add_introspection
- Adds the introspection handlers "system.listMethods", "system.methodSignature" and "system.methodHelp",
+ Adds the introspection handlers "system.listMethods", "system.methodSignature" and "system.methodHelp",
where only the first one works.
--- XMLRPC::BasicServer#add_multicall
@@ -123,7 +123,7 @@ the same class.
--- XMLRPC::BasicServer#set_service_hook ( &handler )
A service-hook is called for each service request (RPC).
You can use a service-hook for example to wrap existing methods and catch exceptions of them or
- convert values to values recognized by XMLRPC. You can disable it by passing (({nil})) as parameter
+ convert values to values recognized by XMLRPC. You can disable it by passing (({nil})) as parameter
((|handler|)) .
The service-hook is called with a (({Proc})) object and with the parameters for this (({Proc})).
@@ -132,7 +132,7 @@ the same class.
server.set_service_hook {|obj, *args|
begin
ret = obj.call(*args) # call the original service-method
- # could convert the return value
+ # could convert the return value
resuce
# rescue exceptions
end
@@ -157,7 +157,7 @@ class BasicServer
include ParserWriterChooseMixin
include ParseContentType
- ERR_METHOD_MISSING = 1
+ ERR_METHOD_MISSING = 1
ERR_UNCAUGHT_EXCEPTION = 2
ERR_MC_WRONG_PARAM = 3
ERR_MC_MISSING_PARAMS = 4
@@ -169,7 +169,7 @@ class BasicServer
def initialize(class_delim=".")
@handler = []
- @default_handler = nil
+ @default_handler = nil
@service_hook = nil
@class_delim = class_delim
@@ -183,7 +183,7 @@ class BasicServer
def add_handler(prefix, obj_or_signature=nil, help=nil, &block)
if block_given?
# proc-handler
- @handler << [prefix, block, obj_or_signature, help]
+ @handler << [prefix, block, obj_or_signature, help]
else
if prefix.kind_of? String
# class-handler
@@ -208,7 +208,7 @@ class BasicServer
@service_hook = handler
self
end
-
+
def get_default_handler
@default_handler
end
@@ -216,18 +216,18 @@ class BasicServer
def set_default_handler (&handler)
@default_handler = handler
self
- end
+ end
def add_multicall
add_handler("system.multicall", %w(array array), "Multicall Extension") do |arrStructs|
- unless arrStructs.is_a? Array
+ unless arrStructs.is_a? Array
raise XMLRPC::FaultException.new(ERR_MC_WRONG_PARAM, "system.multicall expects an array")
end
arrStructs.collect {|call|
if call.is_a? Hash
methodName = call["methodName"]
- params = call["params"]
+ params = call["params"]
if params.nil?
multicall_fault(ERR_MC_MISSING_PARAMS, "Missing params")
@@ -246,16 +246,16 @@ class BasicServer
[val]
else
# exception
- multicall_fault(val.faultCode, val.faultString)
+ multicall_fault(val.faultCode, val.faultString)
end
end
end
- end
-
+ end
+
else
multicall_fault(ERR_MC_EXPECTED_STRUCT, "system.multicall expected struct")
end
- }
+ }
end # end add_handler
self
end
@@ -284,7 +284,7 @@ class BasicServer
sig.each {|s| sigs << s}
else
# sig is a single signature, e.g. ["array"]
- sigs << sig
+ sigs << sig
end
end
end
@@ -292,11 +292,11 @@ class BasicServer
end
add_handler("system.methodHelp", %w(string string), "Returns help on using this method") do |meth|
- help = nil
+ help = nil
@handler.each do |name, obj, sig, hlp|
- if obj.kind_of? Proc and name == meth
+ if obj.kind_of? Proc and name == meth
help = hlp
- break
+ break
end
end
help || ""
@@ -306,18 +306,18 @@ class BasicServer
end
-
+
def process(data)
- method, params = parser().parseMethodCall(data)
+ method, params = parser().parseMethodCall(data)
handle(method, *params)
end
-
+
private # --------------------------------------------------------------
def multicall_fault(nr, str)
{"faultCode" => nr, "faultString" => str}
end
-
+
#
# method dispatch
#
@@ -333,17 +333,17 @@ class BasicServer
if check_arity(obj, args.size)
if @service_hook.nil?
- return obj.call(*args)
+ return obj.call(*args)
else
return @service_hook.call(obj, *args)
end
end
- end
-
+ end
+
if @default_handler.nil?
raise XMLRPC::FaultException.new(ERR_METHOD_MISSING, "Method #{methodname} missing or wrong number of parameters!")
else
- @default_handler.call(methodname, *args)
+ @default_handler.call(methodname, *args)
end
end
@@ -357,7 +357,7 @@ class BasicServer
if ary >= 0
n_args == ary
else
- n_args >= (ary+1).abs
+ n_args >= (ary+1).abs
end
end
@@ -366,8 +366,8 @@ class BasicServer
def call_method(methodname, *args)
begin
[true, dispatch(methodname, *args)]
- rescue XMLRPC::FaultException => e
- [false, e]
+ rescue XMLRPC::FaultException => e
+ [false, e]
rescue Exception => e
[false, XMLRPC::FaultException.new(ERR_UNCAUGHT_EXCEPTION, "Uncaught exception #{e.message} in method #{methodname}")]
end
@@ -388,8 +388,8 @@ end
= XMLRPC::CGIServer
== Synopsis
require "xmlrpc/server"
-
- s = XMLRPC::CGIServer.new
+
+ s = XMLRPC::CGIServer.new
s.add_handler("michael.add") do |a,b|
a + b
@@ -399,15 +399,15 @@ end
if b == 0
raise XMLRPC::FaultException.new(1, "division by zero")
else
- a / b
+ a / b
end
- end
+ end
s.set_default_handler do |name, *args|
raise XMLRPC::FaultException.new(-99, "Method #{name} missing" +
" or wrong number of parameters!")
end
-
+
s.serve
== Description
@@ -419,7 +419,7 @@ Implements a CGI-based XML-RPC server.
== Class Methods
--- XMLRPC::CGIServer.new( *a )
Creates a new (({XMLRPC::CGIServer})) instance. All parameters given
- are by-passed to ((<XMLRPC::BasicServer.new>)). You can only create
+ are by-passed to ((<XMLRPC::BasicServer.new>)). You can only create
((*one*)) (({XMLRPC::CGIServer})) instance, because more than one makes
no sense.
@@ -427,7 +427,7 @@ Implements a CGI-based XML-RPC server.
--- XMLRPC::CGIServer#serve
Call this after you have added all you handlers to the server.
This method processes a XML-RPC methodCall and sends the answer
- back to the client.
+ back to the client.
Make sure that you don't write to standard-output in a handler, or in
any other part of your program, this would case a CGI-based server to fail!
=end
@@ -443,14 +443,14 @@ class CGIServer < BasicServer
def initialize(*a)
super(*a)
end
-
+
def serve
catch(:exit_serve) {
length = ENV['CONTENT_LENGTH'].to_i
- http_error(405, "Method Not Allowed") unless ENV['REQUEST_METHOD'] == "POST"
+ http_error(405, "Method Not Allowed") unless ENV['REQUEST_METHOD'] == "POST"
http_error(400, "Bad Request") unless parse_content_type(ENV['CONTENT_TYPE']).first == "text/xml"
- http_error(411, "Length Required") unless length > 0
+ http_error(411, "Length Required") unless length > 0
# TODO: do we need a call to binmode?
$stdin.binmode if $stdin.respond_to? :binmode
@@ -467,7 +467,7 @@ class CGIServer < BasicServer
def http_error(status, message)
err = "#{status} #{message}"
- msg = <<-"MSGEND"
+ msg = <<-"MSGEND"
<html>
<head>
<title>#{err}</title>
@@ -487,7 +487,7 @@ class CGIServer < BasicServer
h = {}
header.each {|key, value| h[key.to_s.capitalize] = value}
h['Status'] ||= "200 OK"
- h['Content-length'] ||= body.size.to_s
+ h['Content-length'] ||= body.size.to_s
str = ""
h.each {|key, value| str << "#{key}: #{value}\r\n"}
@@ -507,7 +507,7 @@ Use it in the same way as CGIServer!
== Superclass
((<XMLRPC::BasicServer>))
-=end
+=end
class ModRubyServer < BasicServer
@@ -523,9 +523,9 @@ class ModRubyServer < BasicServer
length = header['Content-length'].to_i
- http_error(405, "Method Not Allowed") unless @ap.request_method == "POST"
+ http_error(405, "Method Not Allowed") unless @ap.request_method == "POST"
http_error(400, "Bad Request") unless parse_content_type(header['Content-type']).first == "text/xml"
- http_error(411, "Length Required") unless length > 0
+ http_error(411, "Length Required") unless length > 0
# TODO: do we need a call to binmode?
@ap.binmode
@@ -542,7 +542,7 @@ class ModRubyServer < BasicServer
def http_error(status, message)
err = "#{status} #{message}"
- msg = <<-"MSGEND"
+ msg = <<-"MSGEND"
<html>
<head>
<title>#{err}</title>
@@ -562,12 +562,12 @@ class ModRubyServer < BasicServer
h = {}
header.each {|key, value| h[key.to_s.capitalize] = value}
h['Status'] ||= "200 OK"
- h['Content-length'] ||= body.size.to_s
+ h['Content-length'] ||= body.size.to_s
h.each {|key, value| @ap.headers_out[key] = value }
- @ap.content_type = h["Content-type"]
- @ap.status = status.to_i
- @ap.send_http_header
+ @ap.content_type = h["Content-type"]
+ @ap.status = status.to_i
+ @ap.send_http_header
@ap.print body
end
@@ -578,8 +578,8 @@ end
= XMLRPC::Server
== Synopsis
require "xmlrpc/server"
-
- s = XMLRPC::Server.new(8080)
+
+ s = XMLRPC::Server.new(8080)
s.add_handler("michael.add") do |a,b|
a + b
@@ -589,15 +589,15 @@ end
if b == 0
raise XMLRPC::FaultException.new(1, "division by zero")
else
- a / b
+ a / b
end
- end
+ end
s.set_default_handler do |name, *args|
raise XMLRPC::FaultException.new(-99, "Method #{name} missing" +
" or wrong number of parameters!")
end
-
+
s.serve
== Description
@@ -610,13 +610,13 @@ program.
== Class Methods
--- XMLRPC::Server.new( port=8080, host="127.0.0.1", maxConnections=4, stdlog=$stdout, audit=true, debug=true, *a )
Creates a new (({XMLRPC::Server})) instance, which is a XML-RPC server listening on
- port ((|port|)) and accepts requests for the host ((|host|)), which is by default only the localhost.
+ port ((|port|)) and accepts requests for the host ((|host|)), which is by default only the localhost.
The server is not started, to start it you have to call ((<serve|XMLRPC::Server#serve>)).
Parameters ((|audit|)) and ((|debug|)) are obsolete!
- All additionally given parameters in ((|*a|)) are by-passed to ((<XMLRPC::BasicServer.new>)).
-
+ All additionally given parameters in ((|*a|)) are by-passed to ((<XMLRPC::BasicServer.new>)).
+
== Instance Methods
--- XMLRPC::Server#serve
Call this after you have added all you handlers to the server.
@@ -624,7 +624,7 @@ program.
--- XMLRPC::Server#shutdown
Stops and shuts the server down.
-
+
=end
class WEBrickServlet < BasicServer; end # forward declaration
@@ -634,22 +634,26 @@ class Server < WEBrickServlet
def initialize(port=8080, host="127.0.0.1", maxConnections=4, stdlog=$stdout, audit=true, debug=true, *a)
super(*a)
require 'webrick'
- @server = WEBrick::HTTPServer.new(:Port => port, :BindAddress => host, :MaxClients => maxConnections,
+ @server = WEBrick::HTTPServer.new(:Port => port, :BindAddress => host, :MaxClients => maxConnections,
:Logger => WEBrick::Log.new(stdlog))
@server.mount("/", self)
end
-
+
def serve
- signals = %w[INT TERM HUP] & Signal.list.keys
+ if RUBY_PLATFORM =~ /mingw|mswin32/
+ signals = [1]
+ else
+ signals = %w[INT TERM HUP]
+ end
signals.each { |signal| trap(signal) { @server.shutdown } }
@server.start
end
-
+
def shutdown
@server.shutdown
end
-
+
end
=begin
@@ -668,16 +672,16 @@ end
if b == 0
raise XMLRPC::FaultException.new(1, "division by zero")
else
- a / b
+ a / b
end
- end
+ end
s.set_default_handler do |name, *args|
raise XMLRPC::FaultException.new(-99, "Method #{name} missing" +
" or wrong number of parameters!")
end
- httpserver = WEBrick::HTTPServer.new(:Port => 8080)
+ httpserver = WEBrick::HTTPServer.new(:Port => 8080)
httpserver.mount("/RPC2", s)
trap("HUP") { httpserver.shutdown } # use 1 instead of "HUP" on Windows
httpserver.start
@@ -691,7 +695,7 @@ end
--- XMLRPC::WEBrickServlet#get_valid_ip
Return the via method ((<set_valid_ip|XMLRPC::Server#set_valid_ip>)) specified
valid IP addresses.
-
+
== Description
Implements a servlet for use with WEBrick, a pure Ruby (HTTP-) server framework.
@@ -707,10 +711,10 @@ class WEBrickServlet < BasicServer
@valid_ip = nil
end
- # deprecated from WEBrick/1.2.2.
+ # deprecated from WEBrick/1.2.2.
# but does not break anything.
def require_path_info?
- false
+ false
end
def get_instance(config, *options)
@@ -732,7 +736,7 @@ class WEBrickServlet < BasicServer
def service(request, response)
- if @valid_ip
+ if @valid_ip
raise WEBrick::HTTPStatus::Forbidden unless @valid_ip.any? { |ip| request.peeraddr[3] =~ ip }
end
@@ -741,9 +745,9 @@ class WEBrickServlet < BasicServer
"unsupported method `#{request.request_method}'."
end
- if parse_content_type(request['Content-type']).first != "text/xml"
+ if parse_content_type(request['Content-type']).first != "text/xml"
raise WEBrick::HTTPStatus::BadRequest
- end
+ end
length = (request['Content-length'] || 0).to_i
@@ -756,14 +760,14 @@ class WEBrickServlet < BasicServer
end
resp = process(data)
- if resp.nil? or resp.size <= 0
+ if resp.nil? or resp.size <= 0
raise WEBrick::HTTPStatus::InternalServerError
end
response.status = 200
response['Content-Length'] = resp.size
response['Content-Type'] = "text/xml; charset=utf-8"
- response.body = resp
+ response.body = resp
end
end
@@ -773,6 +777,6 @@ end # module XMLRPC
=begin
= History
- $Id$
+ $Id$
=end
diff --git a/lib/xmlrpc/utils.rb b/lib/xmlrpc/utils.rb
index 60d4ef5d99..f0966fee40 100644
--- a/lib/xmlrpc/utils.rb
+++ b/lib/xmlrpc/utils.rb
@@ -1,12 +1,12 @@
#
# Defines ParserWriterChooseMixin, which makes it possible to choose a
# different XML writer and/or XML parser then the default one.
-# The Mixin is used in client.rb (class Client) and server.rb (class
+# The Mixin is used in client.rb (class Client) and server.rb (class
# BasicServer)
-#
+#
# Copyright (C) 2001, 2002, 2003 by Michael Neumann (mneumann@ntecs.de)
#
-# $Id$
+# $Id$
#
module XMLRPC
@@ -15,7 +15,7 @@ module XMLRPC
# This module enables a user-class to be marshalled
# by XML-RPC for Ruby into a Hash, with one additional
# key/value pair "___class___" => ClassName
- #
+ #
module Marshallable
end
@@ -37,7 +37,7 @@ module XMLRPC
def create
# if set_writer was not already called then call it now
if @create.nil? then
- set_writer(Config::DEFAULT_WRITER.new)
+ set_writer(Config::DEFAULT_WRITER.new)
end
@create
end
@@ -45,7 +45,7 @@ module XMLRPC
def parser
# if set_parser was not already called then call it now
if @parser.nil? then
- set_parser(Config::DEFAULT_PARSER.new)
+ set_parser(Config::DEFAULT_PARSER.new)
end
@parser
end
@@ -72,9 +72,9 @@ module XMLRPC
mname = nil
sig = [sig] if sig.kind_of? String
- sig = sig.collect do |s|
+ sig = sig.collect do |s|
name, si = parse_sig(s)
- raise "Wrong signatures!" if mname != nil and name != mname
+ raise "Wrong signatures!" if mname != nil and name != mname
mname = name
si
end
@@ -83,12 +83,12 @@ module XMLRPC
end
private # ---------------------------------
-
+
def parse_sig(sig)
# sig is a String
if sig =~ /^\s*(\w+)\s+([^(]+)(\(([^)]*)\))?\s*$/
params = [$1]
- name = $2.strip
+ name = $2.strip
$4.split(",").each {|i| params << i.strip} if $4 != nil
return name, params
else
@@ -109,10 +109,10 @@ module XMLRPC
instance_eval(&p)
end
- def get_methods(obj, delim=".")
+ def get_methods(obj, delim=".")
prefix = @prefix + delim
- @methods.collect { |name, meth, sig, help|
- [prefix + name, obj.method(meth).to_proc, sig, help]
+ @methods.collect { |name, meth, sig, help|
+ [prefix + name, obj.method(meth).to_proc, sig, help]
}
end
@@ -132,7 +132,7 @@ module XMLRPC
def get_methods(obj, delim=".")
prefix = @prefix + delim
obj.class.public_instance_methods(false).collect { |name|
- [prefix + name, obj.method(name).to_proc, nil, nil]
+ [prefix + name, obj.method(name).to_proc, nil, nil]
}
end
end
@@ -141,16 +141,16 @@ module XMLRPC
end # module Service
- #
+ #
# short-form to create a Service::Interface
#
def self.interface(prefix, &p)
- Service::Interface.new(prefix, &p)
+ Service::Interface.new(prefix, &p)
end
# short-cut for creating a PublicInstanceMethodsInterface
def self.iPIMethods(prefix)
- Service::PublicInstanceMethodsInterface.new(prefix)
+ Service::PublicInstanceMethodsInterface.new(prefix)
end
diff --git a/lib/xsd/charset.rb b/lib/xsd/charset.rb
new file mode 100644
index 0000000000..15d5500fce
--- /dev/null
+++ b/lib/xsd/charset.rb
@@ -0,0 +1,187 @@
+# XSD4R - Charset handling library.
+# Copyright (C) 2001, 2003, 2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+module XSD
+
+
+module Charset
+ @internal_encoding = $KCODE
+
+ class XSDError < StandardError; end
+ class CharsetError < XSDError; end
+ class UnknownCharsetError < CharsetError; end
+ class CharsetConversionError < CharsetError; end
+
+public
+
+ ###
+ ## Maps
+ #
+ EncodingConvertMap = {}
+ def Charset.init
+ EncodingConvertMap[['UTF8', 'X_ISO8859_1']] =
+ Proc.new { |str| str.unpack('U*').pack('C*') }
+ EncodingConvertMap[['X_ISO8859_1', 'UTF8']] =
+ Proc.new { |str| str.unpack('C*').pack('U*') }
+ begin
+ require 'xsd/iconvcharset'
+ @internal_encoding = 'UTF8'
+ sjtag = (/(mswin|bccwin|mingw|cygwin|emx)/ =~ RUBY_PLATFORM) ? 'cp932' :
+ 'shift_jis'
+ EncodingConvertMap[['UTF8', 'EUC' ]] =
+ Proc.new { |str| IconvCharset.safe_iconv("euc-jp", "utf-8", str) }
+ EncodingConvertMap[['EUC' , 'UTF8']] =
+ Proc.new { |str| IconvCharset.safe_iconv("utf-8", "euc-jp", str) }
+ EncodingConvertMap[['EUC' , 'SJIS']] =
+ Proc.new { |str| IconvCharset.safe_iconv(sjtag, "euc-jp", str) }
+ EncodingConvertMap[['UTF8', 'SJIS']] =
+ Proc.new { |str| IconvCharset.safe_iconv(sjtag, "utf-8", str) }
+ EncodingConvertMap[['SJIS', 'UTF8']] =
+ Proc.new { |str| IconvCharset.safe_iconv("utf-8", sjtag, str) }
+ EncodingConvertMap[['SJIS', 'EUC' ]] =
+ Proc.new { |str| IconvCharset.safe_iconv("euc-jp", sjtag, str) }
+ rescue LoadError
+ begin
+ require 'nkf'
+ EncodingConvertMap[['EUC' , 'SJIS']] =
+ Proc.new { |str| NKF.nkf('-sXm0', str) }
+ EncodingConvertMap[['SJIS', 'EUC' ]] =
+ Proc.new { |str| NKF.nkf('-eXm0', str) }
+ rescue LoadError
+ end
+
+ begin
+ require 'uconv'
+ @internal_encoding = 'UTF8'
+ EncodingConvertMap[['UTF8', 'EUC' ]] = Uconv.method(:u8toeuc)
+ EncodingConvertMap[['UTF8', 'SJIS']] = Uconv.method(:u8tosjis)
+ EncodingConvertMap[['EUC' , 'UTF8']] = Uconv.method(:euctou8)
+ EncodingConvertMap[['SJIS', 'UTF8']] = Uconv.method(:sjistou8)
+ rescue LoadError
+ end
+ end
+ end
+ self.init
+
+ CharsetMap = {
+ 'NONE' => 'us-ascii',
+ 'EUC' => 'euc-jp',
+ 'SJIS' => 'shift_jis',
+ 'UTF8' => 'utf-8',
+ 'X_ISO_8859_1' => 'iso-8859-1',
+ 'X_UNKNOWN' => nil,
+ }
+
+
+ ###
+ ## handlers
+ #
+ def Charset.encoding
+ @internal_encoding
+ end
+
+ def Charset.encoding=(encoding)
+ warn("xsd charset is set to #{encoding}") if $DEBUG
+ @internal_encoding = encoding
+ end
+
+ def Charset.xml_encoding_label
+ charset_label(@internal_encoding)
+ end
+
+ def Charset.encoding_to_xml(str, charset)
+ encoding_conv(str, @internal_encoding, charset_str(charset))
+ end
+
+ def Charset.encoding_from_xml(str, charset)
+ encoding_conv(str, charset_str(charset), @internal_encoding)
+ end
+
+ def Charset.encoding_conv(str, enc_from, enc_to)
+ if enc_from == enc_to or enc_from == 'NONE' or enc_to == 'NONE'
+ str
+ elsif converter = EncodingConvertMap[[enc_from, enc_to]]
+ converter.call(str)
+ else
+ raise CharsetConversionError.new(
+ "Converter not found: #{enc_from} -> #{enc_to}")
+ end
+ end
+
+ def Charset.charset_label(encoding)
+ CharsetMap[encoding.upcase]
+ end
+
+ def Charset.charset_str(label)
+ if CharsetMap.respond_to?(:key)
+ CharsetMap.key(label.downcase) || 'X_UNKNOWN'
+ else
+ CharsetMap.index(label.downcase) || 'X_UNKNOWN'
+ end
+ end
+
+ # us_ascii = '[\x00-\x7F]'
+ us_ascii = '[\x9\xa\xd\x20-\x7F]' # XML 1.0 restricted.
+ USASCIIRegexp = Regexp.new("\\A#{us_ascii}*\\z", nil, "NONE")
+
+ twobytes_euc = '(?:[\x8E\xA1-\xFE][\xA1-\xFE])'
+ threebytes_euc = '(?:\x8F[\xA1-\xFE][\xA1-\xFE])'
+ character_euc = "(?:#{us_ascii}|#{twobytes_euc}|#{threebytes_euc})"
+ EUCRegexp = Regexp.new("\\A#{character_euc}*\\z", nil, "NONE")
+
+ # onebyte_sjis = '[\x00-\x7F\xA1-\xDF]'
+ onebyte_sjis = '[\x9\xa\xd\x20-\x7F\xA1-\xDF]' # XML 1.0 restricted.
+ twobytes_sjis = '(?:[\x81-\x9F\xE0-\xFC][\x40-\x7E\x80-\xFC])'
+ character_sjis = "(?:#{onebyte_sjis}|#{twobytes_sjis})"
+ SJISRegexp = Regexp.new("\\A#{character_sjis}*\\z", nil, "NONE")
+
+ # 0xxxxxxx
+ # 110yyyyy 10xxxxxx
+ twobytes_utf8 = '(?:[\xC0-\xDF][\x80-\xBF])'
+ # 1110zzzz 10yyyyyy 10xxxxxx
+ threebytes_utf8 = '(?:[\xE0-\xEF][\x80-\xBF][\x80-\xBF])'
+ # 11110uuu 10uuuzzz 10yyyyyy 10xxxxxx
+ fourbytes_utf8 = '(?:[\xF0-\xF7][\x80-\xBF][\x80-\xBF][\x80-\xBF])'
+ character_utf8 =
+ "(?:#{us_ascii}|#{twobytes_utf8}|#{threebytes_utf8}|#{fourbytes_utf8})"
+ UTF8Regexp = Regexp.new("\\A#{character_utf8}*\\z", nil, "NONE")
+
+ def Charset.is_us_ascii(str)
+ USASCIIRegexp =~ str
+ end
+
+ def Charset.is_utf8(str)
+ UTF8Regexp =~ str
+ end
+
+ def Charset.is_euc(str)
+ EUCRegexp =~ str
+ end
+
+ def Charset.is_sjis(str)
+ SJISRegexp =~ str
+ end
+
+ def Charset.is_ces(str, code = $KCODE)
+ case code
+ when 'NONE'
+ is_us_ascii(str)
+ when 'UTF8'
+ is_utf8(str)
+ when 'EUC'
+ is_euc(str)
+ when 'SJIS'
+ is_sjis(str)
+ else
+ raise UnknownCharsetError.new("Unknown charset: #{code}")
+ end
+ end
+end
+
+
+end
diff --git a/lib/xsd/codegen.rb b/lib/xsd/codegen.rb
new file mode 100644
index 0000000000..d820ebf1f2
--- /dev/null
+++ b/lib/xsd/codegen.rb
@@ -0,0 +1,12 @@
+# XSD4R - Generating code library
+# Copyright (C) 2004 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+require 'xsd/codegen/gensupport'
+require 'xsd/codegen/moduledef'
+require 'xsd/codegen/classdef'
+require 'xsd/codegen/methoddef'
diff --git a/lib/xsd/codegen/classdef.rb b/lib/xsd/codegen/classdef.rb
new file mode 100644
index 0000000000..9eb1ce6607
--- /dev/null
+++ b/lib/xsd/codegen/classdef.rb
@@ -0,0 +1,203 @@
+# XSD4R - Generating class definition code
+# Copyright (C) 2004 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+require 'xsd/codegen/gensupport'
+require 'xsd/codegen/moduledef'
+require 'xsd/codegen/methoddef'
+
+
+module XSD
+module CodeGen
+
+
+class ClassDef < ModuleDef
+ include GenSupport
+
+ def initialize(name, baseclass = nil)
+ super(name)
+ @baseclass = baseclass
+ @classvar = []
+ @attrdef = []
+ end
+
+ def def_classvar(var, value)
+ var = var.sub(/\A@@/, "")
+ unless safevarname?(var)
+ raise ArgumentError.new("#{var} seems to be unsafe")
+ end
+ @classvar << [var, value]
+ end
+
+ def def_attr(attrname, writable = true, varname = nil)
+ unless safevarname?(varname || attrname)
+ raise ArgumentError.new("#{varname || attrname} seems to be unsafe")
+ end
+ @attrdef << [attrname, writable, varname]
+ end
+
+ def dump
+ buf = ""
+ unless @requirepath.empty?
+ buf << dump_requirepath
+ end
+ buf << dump_emptyline unless buf.empty?
+ package = @name.split(/::/)[0..-2]
+ buf << dump_package_def(package) unless package.empty?
+ buf << dump_comment if @comment
+ buf << dump_class_def
+ spacer = false
+ unless @classvar.empty?
+ spacer = true
+ buf << dump_classvar
+ end
+ unless @const.empty?
+ buf << dump_emptyline if spacer
+ spacer = true
+ buf << dump_const
+ end
+ unless @code.empty?
+ buf << dump_emptyline if spacer
+ spacer = true
+ buf << dump_code
+ end
+ unless @attrdef.empty?
+ buf << dump_emptyline if spacer
+ spacer = true
+ buf << dump_attributes
+ end
+ unless @methoddef.empty?
+ buf << dump_emptyline if spacer
+ spacer = true
+ buf << dump_methods
+ end
+ buf << dump_class_def_end
+ buf << dump_package_def_end(package) unless package.empty?
+ buf.gsub(/^\s+$/, '')
+ end
+
+private
+
+ def dump_class_def
+ name = @name.to_s.split(/::/)
+ if @baseclass
+ format("class #{name.last} < #{@baseclass}")
+ else
+ format("class #{name.last}")
+ end
+ end
+
+ def dump_class_def_end
+ str = format("end")
+ end
+
+ def dump_classvar
+ dump_static(
+ @classvar.collect { |var, value|
+ %Q(@@#{var.sub(/^@@/, "")} = #{dump_value(value)})
+ }.join("\n")
+ )
+ end
+
+ def dump_attributes
+ str = ""
+ @attrdef.each do |attrname, writable, varname|
+ varname ||= attrname
+ if attrname == varname
+ str << format(dump_accessor(attrname, writable), 2)
+ end
+ end
+ @attrdef.each do |attrname, writable, varname|
+ varname ||= attrname
+ if attrname != varname
+ str << "\n" unless str.empty?
+ str << format(dump_attribute(attrname, writable, varname), 2)
+ end
+ end
+ str
+ end
+
+ def dump_accessor(attrname, writable)
+ if writable
+ "attr_accessor :#{attrname}"
+ else
+ "attr_reader :#{attrname}"
+ end
+ end
+
+ def dump_attribute(attrname, writable, varname)
+ str = nil
+ mr = MethodDef.new(attrname)
+ mr.definition = "@#{varname}"
+ str = mr.dump
+ if writable
+ mw = MethodDef.new(attrname + "=", 'value')
+ mw.definition = "@#{varname} = value"
+ str << "\n" + mw.dump
+ end
+ str
+ end
+end
+
+
+end
+end
+
+
+if __FILE__ == $0
+ require 'xsd/codegen/classdef'
+ include XSD::CodeGen
+ c = ClassDef.new("Foo::Bar::HobbitName", String)
+ c.def_require("foo/bar")
+ c.comment = <<-EOD
+ foo
+ bar
+ baz
+ EOD
+ c.def_const("FOO", 1)
+ c.def_classvar("@@foo", "var".dump)
+ c.def_classvar("baz", "1".dump)
+ c.def_attr("Foo", true, "foo")
+ c.def_attr("bar")
+ c.def_attr("baz", true)
+ c.def_attr("Foo2", true, "foo2")
+ c.def_attr("foo3", false, "foo3")
+ c.def_method("foo") do
+ <<-EOD
+ foo.bar = 1
+\tbaz.each do |ele|
+\t ele
+ end
+ EOD
+ end
+ c.def_method("baz", "qux") do
+ <<-EOD
+ [1, 2, 3].each do |i|
+ p i
+ end
+ EOD
+ end
+
+ m = MethodDef.new("qux", "quxx", "quxxx") do
+ <<-EOD
+ p quxx + quxxx
+ EOD
+ end
+ m.comment = "hello world\n123"
+ c.add_method(m)
+ c.def_code <<-EOD
+ Foo.new
+ Bar.z
+ EOD
+ c.def_code <<-EOD
+ Foo.new
+ Bar.z
+ EOD
+ c.def_privatemethod("foo", "baz", "*arg", "&block")
+
+ puts c.dump
+end
diff --git a/lib/xsd/codegen/commentdef.rb b/lib/xsd/codegen/commentdef.rb
new file mode 100644
index 0000000000..c9493a1363
--- /dev/null
+++ b/lib/xsd/codegen/commentdef.rb
@@ -0,0 +1,34 @@
+# XSD4R - Generating comment definition code
+# Copyright (C) 2004 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+require 'xsd/codegen/gensupport'
+
+
+module XSD
+module CodeGen
+
+
+module CommentDef
+ include GenSupport
+
+ attr_accessor :comment
+
+private
+
+ def dump_comment
+ if /\A#/ =~ @comment
+ format(@comment)
+ else
+ format(@comment).gsub(/^/, '# ')
+ end
+ end
+end
+
+
+end
+end
diff --git a/lib/xsd/codegen/gensupport.rb b/lib/xsd/codegen/gensupport.rb
new file mode 100644
index 0000000000..1e85d3668f
--- /dev/null
+++ b/lib/xsd/codegen/gensupport.rb
@@ -0,0 +1,166 @@
+# XSD4R - Code generation support
+# Copyright (C) 2004, 2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+module XSD
+module CodeGen
+
+# from the file 'keywords' in 1.9.
+KEYWORD = {}
+%w(
+__LINE__
+__FILE__
+BEGIN
+END
+alias
+and
+begin
+break
+case
+class
+def
+defined?
+do
+else
+elsif
+end
+ensure
+false
+for
+if
+in
+module
+next
+nil
+not
+or
+redo
+rescue
+retry
+return
+self
+super
+then
+true
+undef
+unless
+until
+when
+while
+yield
+).each { |k| KEYWORD[k] = nil }
+
+module GenSupport
+ def capitalize(target)
+ target.sub(/^([a-z])/) { $1.tr!('[a-z]', '[A-Z]') }
+ end
+ module_function :capitalize
+
+ def uncapitalize(target)
+ target.sub(/^([A-Z])/) { $1.tr!('[A-Z]', '[a-z]') }
+ end
+ module_function :uncapitalize
+
+ def safeconstname(name)
+ safename = name.scan(/[a-zA-Z0-9_]+/).collect { |ele|
+ GenSupport.capitalize(ele)
+ }.join
+ if /^[A-Z]/ !~ safename or keyword?(safename)
+ safename = "C_#{safename}"
+ end
+ safename
+ end
+ module_function :safeconstname
+
+ def safeconstname?(name)
+ /\A[A-Z][a-zA-Z0-9_]*\z/ =~ name and !keyword?(name)
+ end
+ module_function :safeconstname?
+
+ def safemethodname(name)
+ safename = name.scan(/[a-zA-Z0-9_]+/).join('_')
+ safename = uncapitalize(safename)
+ if /^[a-z]/ !~ safename
+ safename = "m_#{safename}"
+ end
+ safename
+ end
+ module_function :safemethodname
+
+ def safemethodname?(name)
+ /\A[a-zA-Z_][a-zA-Z0-9_]*[=!?]?\z/ =~ name
+ end
+ module_function :safemethodname?
+
+ def safevarname(name)
+ safename = uncapitalize(name.scan(/[a-zA-Z0-9_]+/).join('_'))
+ if /^[a-z]/ !~ safename or keyword?(safename)
+ "v_#{safename}"
+ else
+ safename
+ end
+ end
+ module_function :safevarname
+
+ def safevarname?(name)
+ /\A[a-z_][a-zA-Z0-9_]*\z/ =~ name and !keyword?(name)
+ end
+ module_function :safevarname?
+
+ def keyword?(word)
+ KEYWORD.key?(word)
+ end
+ module_function :keyword?
+
+ def format(str, indent = nil)
+ str = trim_eol(str)
+ str = trim_indent(str)
+ if indent
+ str.gsub(/^/, " " * indent)
+ else
+ str
+ end
+ end
+
+private
+
+ def trim_eol(str)
+ str.collect { |line|
+ line.sub(/\r?\n\z/, "") + "\n"
+ }.join
+ end
+
+ def trim_indent(str)
+ indent = nil
+ str = str.collect { |line| untab(line) }.join
+ str.each do |line|
+ head = line.index(/\S/)
+ if !head.nil? and (indent.nil? or head < indent)
+ indent = head
+ end
+ end
+ return str unless indent
+ str.collect { |line|
+ line.sub(/^ {0,#{indent}}/, "")
+ }.join
+ end
+
+ def untab(line, ts = 8)
+ while pos = line.index(/\t/)
+ line = line.sub(/\t/, " " * (ts - (pos % ts)))
+ end
+ line
+ end
+
+ def dump_emptyline
+ "\n"
+ end
+end
+
+
+end
+end
diff --git a/lib/xsd/codegen/methoddef.rb b/lib/xsd/codegen/methoddef.rb
new file mode 100644
index 0000000000..15892fc5bf
--- /dev/null
+++ b/lib/xsd/codegen/methoddef.rb
@@ -0,0 +1,63 @@
+# XSD4R - Generating method definition code
+# Copyright (C) 2004 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+require 'xsd/codegen/gensupport'
+require 'xsd/codegen/commentdef'
+
+
+module XSD
+module CodeGen
+
+
+class MethodDef
+ include GenSupport
+ include CommentDef
+
+ attr_accessor :definition
+
+ def initialize(name, *params)
+ unless safemethodname?(name)
+ raise ArgumentError.new("name '#{name}' seems to be unsafe")
+ end
+ @name = name
+ @params = params
+ @comment = nil
+ @definition = yield if block_given?
+ end
+
+ def dump
+ buf = ""
+ buf << dump_comment if @comment
+ buf << dump_method_def
+ buf << dump_definition if @definition and !@definition.empty?
+ buf << dump_method_def_end
+ buf
+ end
+
+private
+
+ def dump_method_def
+ if @params.empty?
+ format("def #{@name}")
+ else
+ format("def #{@name}(#{@params.join(", ")})")
+ end
+ end
+
+ def dump_method_def_end
+ format("end")
+ end
+
+ def dump_definition
+ format(@definition, 2)
+ end
+end
+
+
+end
+end
diff --git a/lib/xsd/codegen/moduledef.rb b/lib/xsd/codegen/moduledef.rb
new file mode 100644
index 0000000000..744af2ff97
--- /dev/null
+++ b/lib/xsd/codegen/moduledef.rb
@@ -0,0 +1,191 @@
+# XSD4R - Generating module definition code
+# Copyright (C) 2004 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+require 'xsd/codegen/gensupport'
+require 'xsd/codegen/methoddef'
+require 'xsd/codegen/commentdef'
+
+
+module XSD
+module CodeGen
+
+
+class ModuleDef
+ include GenSupport
+ include CommentDef
+
+ def initialize(name)
+ @name = name
+ @comment = nil
+ @const = []
+ @code = []
+ @requirepath = []
+ @methoddef = []
+ end
+
+ def def_require(path)
+ @requirepath << path
+ end
+
+ def def_const(const, value)
+ unless safeconstname?(const)
+ raise ArgumentError.new("#{const} seems to be unsafe")
+ end
+ @const << [const, value]
+ end
+
+ def def_code(code)
+ @code << code
+ end
+
+ def def_method(name, *params)
+ add_method(MethodDef.new(name, *params) { yield if block_given? }, :public)
+ end
+ alias def_publicmethod def_method
+
+ def def_protectedmethod(name, *params)
+ add_method(MethodDef.new(name, *params) { yield if block_given? },
+ :protected)
+ end
+
+ def def_privatemethod(name, *params)
+ add_method(MethodDef.new(name, *params) { yield if block_given? }, :private)
+ end
+
+ def add_method(m, visibility = :public)
+ @methoddef << [visibility, m]
+ end
+
+ def dump
+ buf = ""
+ unless @requirepath.empty?
+ buf << dump_requirepath
+ end
+ buf << dump_emptyline unless buf.empty?
+ package = @name.split(/::/)[0..-2]
+ buf << dump_package_def(package) unless package.empty?
+ buf << dump_comment if @comment
+ buf << dump_module_def
+ spacer = false
+ unless @const.empty?
+ buf << dump_emptyline if spacer
+ spacer = true
+ buf << dump_const
+ end
+ unless @code.empty?
+ buf << dump_emptyline if spacer
+ spacer = true
+ buf << dump_code
+ end
+ unless @methoddef.empty?
+ buf << dump_emptyline if spacer
+ spacer = true
+ buf << dump_methods
+ end
+ buf << dump_module_def_end
+ buf << dump_package_def_end(package) unless package.empty?
+ buf.gsub(/^\s+$/, '')
+ end
+
+private
+
+ def dump_requirepath
+ format(
+ @requirepath.collect { |path|
+ %Q(require '#{path}')
+ }.join("\n")
+ )
+ end
+
+ def dump_const
+ dump_static(
+ @const.sort.collect { |var, value|
+ %Q(#{var} = #{dump_value(value)})
+ }.join("\n")
+ )
+ end
+
+ def dump_code
+ dump_static(@code.join("\n"))
+ end
+
+ def dump_static(str)
+ format(str, 2)
+ end
+
+ def dump_methods
+ methods = {}
+ @methoddef.each do |visibility, method|
+ (methods[visibility] ||= []) << method
+ end
+ str = ""
+ [:public, :protected, :private].each do |visibility|
+ if methods[visibility]
+ str << "\n" unless str.empty?
+ str << visibility.to_s << "\n\n" unless visibility == :public
+ str << methods[visibility].collect { |m| format(m.dump, 2) }.join("\n")
+ end
+ end
+ str
+ end
+
+ def dump_value(value)
+ if value.respond_to?(:to_src)
+ value.to_src
+ else
+ value
+ end
+ end
+
+ def dump_package_def(package)
+ format(package.collect { |ele| "module #{ele}" }.join("; ")) + "\n\n"
+ end
+
+ def dump_package_def_end(package)
+ "\n\n" + format(package.collect { |ele| "end" }.join("; "))
+ end
+
+ def dump_module_def
+ name = @name.to_s.split(/::/)
+ format("module #{name.last}")
+ end
+
+ def dump_module_def_end
+ format("end")
+ end
+end
+
+
+end
+end
+
+
+if __FILE__ == $0
+ require 'xsd/codegen/moduledef'
+ include XSD::CodeGen
+ m = ModuleDef.new("Foo::Bar::HobbitName")
+ m.def_require("foo/bar")
+ m.def_require("baz")
+ m.comment = <<-EOD
+ foo
+ bar
+ baz
+ EOD
+ m.def_method("foo") do
+ <<-EOD
+ foo.bar = 1
+ baz.each do |ele|
+ ele + 1
+ end
+ EOD
+ end
+ m.def_method("baz", "qux")
+ #m.def_protectedmethod("aaa")
+ m.def_privatemethod("bbb")
+ puts m.dump
+end
diff --git a/lib/xsd/datatypes.rb b/lib/xsd/datatypes.rb
new file mode 100644
index 0000000000..bbe6c8578f
--- /dev/null
+++ b/lib/xsd/datatypes.rb
@@ -0,0 +1,1269 @@
+# XSD4R - XML Schema Datatype implementation.
+# Copyright (C) 2000, 2001, 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+require 'xsd/qname'
+require 'xsd/charset'
+require 'uri'
+
+
+###
+## XMLSchamaDatatypes general definitions.
+#
+module XSD
+
+
+Namespace = 'http://www.w3.org/2001/XMLSchema'
+InstanceNamespace = 'http://www.w3.org/2001/XMLSchema-instance'
+
+AttrType = 'type'
+NilValue = 'true'
+
+AnyTypeLiteral = 'anyType'
+AnySimpleTypeLiteral = 'anySimpleType'
+NilLiteral = 'nil'
+StringLiteral = 'string'
+BooleanLiteral = 'boolean'
+DecimalLiteral = 'decimal'
+FloatLiteral = 'float'
+DoubleLiteral = 'double'
+DurationLiteral = 'duration'
+DateTimeLiteral = 'dateTime'
+TimeLiteral = 'time'
+DateLiteral = 'date'
+GYearMonthLiteral = 'gYearMonth'
+GYearLiteral = 'gYear'
+GMonthDayLiteral = 'gMonthDay'
+GDayLiteral = 'gDay'
+GMonthLiteral = 'gMonth'
+HexBinaryLiteral = 'hexBinary'
+Base64BinaryLiteral = 'base64Binary'
+AnyURILiteral = 'anyURI'
+QNameLiteral = 'QName'
+
+NormalizedStringLiteral = 'normalizedString'
+#3.3.2 token
+#3.3.3 language
+#3.3.4 NMTOKEN
+#3.3.5 NMTOKENS
+#3.3.6 Name
+#3.3.7 NCName
+#3.3.8 ID
+#3.3.9 IDREF
+#3.3.10 IDREFS
+#3.3.11 ENTITY
+#3.3.12 ENTITIES
+IntegerLiteral = 'integer'
+NonPositiveIntegerLiteral = 'nonPositiveInteger'
+NegativeIntegerLiteral = 'negativeInteger'
+LongLiteral = 'long'
+IntLiteral = 'int'
+ShortLiteral = 'short'
+ByteLiteral = 'byte'
+NonNegativeIntegerLiteral = 'nonNegativeInteger'
+UnsignedLongLiteral = 'unsignedLong'
+UnsignedIntLiteral = 'unsignedInt'
+UnsignedShortLiteral = 'unsignedShort'
+UnsignedByteLiteral = 'unsignedByte'
+PositiveIntegerLiteral = 'positiveInteger'
+
+AttrTypeName = QName.new(InstanceNamespace, AttrType)
+AttrNilName = QName.new(InstanceNamespace, NilLiteral)
+
+AnyTypeName = QName.new(Namespace, AnyTypeLiteral)
+AnySimpleTypeName = QName.new(Namespace, AnySimpleTypeLiteral)
+
+class Error < StandardError; end
+class ValueSpaceError < Error; end
+
+
+###
+## The base class of all datatypes with Namespace.
+#
+class NSDBase
+ @@types = []
+
+ attr_accessor :type
+
+ def self.inherited(klass)
+ @@types << klass
+ end
+
+ def self.types
+ @@types
+ end
+
+ def initialize
+ end
+
+ def init(type)
+ @type = type
+ end
+end
+
+
+###
+## The base class of XSD datatypes.
+#
+class XSDAnySimpleType < NSDBase
+ include XSD
+ Type = QName.new(Namespace, AnySimpleTypeLiteral)
+
+ # @data represents canonical space (ex. Integer: 123).
+ attr_reader :data
+ # @is_nil represents this data is nil or not.
+ attr_accessor :is_nil
+
+ def initialize(value = nil)
+ init(Type, value)
+ end
+
+ # true or raise
+ def check_lexical_format(value)
+ screen_data(value)
+ true
+ end
+
+ # set accepts a string which follows lexical space (ex. String: "+123"), or
+ # an object which follows canonical space (ex. Integer: 123).
+ def set(value)
+ if value.nil?
+ @is_nil = true
+ @data = nil
+ _set(nil)
+ else
+ @is_nil = false
+ _set(screen_data(value))
+ end
+ end
+
+ # to_s creates a string which follows lexical space (ex. String: "123").
+ def to_s()
+ if @is_nil
+ ""
+ else
+ _to_s
+ end
+ end
+
+private
+
+ def init(type, value)
+ super(type)
+ set(value)
+ end
+
+ # raises ValueSpaceError if check failed
+ def screen_data(value)
+ value
+ end
+
+ def _set(value)
+ @data = value
+ end
+
+ def _to_s
+ @data.to_s
+ end
+end
+
+class XSDNil < XSDAnySimpleType
+ Type = QName.new(Namespace, NilLiteral)
+ Value = 'true'
+
+ def initialize(value = nil)
+ init(Type, value)
+ end
+end
+
+
+###
+## Primitive datatypes.
+#
+class XSDString < XSDAnySimpleType
+ Type = QName.new(Namespace, StringLiteral)
+
+ def initialize(value = nil)
+ init(Type, value)
+ end
+
+private
+
+ def screen_data(value)
+ unless XSD::Charset.is_ces(value, XSD::Charset.encoding)
+ raise ValueSpaceError.new("#{ type }: cannot accept '#{ value }'.")
+ end
+ value
+ end
+end
+
+class XSDBoolean < XSDAnySimpleType
+ Type = QName.new(Namespace, BooleanLiteral)
+
+ def initialize(value = nil)
+ init(Type, value)
+ end
+
+private
+
+ def screen_data(value)
+ if value.is_a?(String)
+ str = value.strip
+ if str == 'true' || str == '1'
+ true
+ elsif str == 'false' || str == '0'
+ false
+ else
+ raise ValueSpaceError.new("#{ type }: cannot accept '#{ str }'.")
+ end
+ else
+ value ? true : false
+ end
+ end
+end
+
+class XSDDecimal < XSDAnySimpleType
+ Type = QName.new(Namespace, DecimalLiteral)
+
+ def initialize(value = nil)
+ init(Type, value)
+ end
+
+ def nonzero?
+ (@number != '0')
+ end
+
+private
+
+ def screen_data(d)
+ if d.is_a?(String)
+ # Integer("00012") => 10 in Ruby.
+ d.sub!(/^([+\-]?)0*(?=\d)/, "\\1")
+ end
+ screen_data_str(d)
+ end
+
+ def screen_data_str(str)
+ /^([+\-]?)(\d*)(?:\.(\d*)?)?$/ =~ str.to_s.strip
+ unless Regexp.last_match
+ raise ValueSpaceError.new("#{ type }: cannot accept '#{ str }'.")
+ end
+ sign = $1 || '+'
+ int_part = $2
+ frac_part = $3
+ int_part = '0' if int_part.empty?
+ frac_part = frac_part ? frac_part.sub(/0+$/, '') : ''
+ point = - frac_part.size
+ number = int_part + frac_part
+ # normalize
+ if sign == '+'
+ sign = ''
+ elsif sign == '-'
+ if number == '0'
+ sign = ''
+ end
+ end
+ [sign, point, number]
+ end
+
+ def _set(data)
+ if data.nil?
+ @sign = @point = @number = @data = nil
+ return
+ end
+ @sign, @point, @number = data
+ @data = _to_s
+ @data.freeze
+ end
+
+ # 0.0 -> 0; right?
+ def _to_s
+ str = @number.dup
+ if @point.nonzero?
+ str[@number.size + @point, 0] = '.'
+ end
+ @sign + str
+ end
+end
+
+module FloatConstants
+ NaN = 0.0/0.0
+ POSITIVE_INF = +1.0/0.0
+ NEGATIVE_INF = -1.0/0.0
+ POSITIVE_ZERO = +1.0/POSITIVE_INF
+ NEGATIVE_ZERO = -1.0/POSITIVE_INF
+ MIN_POSITIVE_SINGLE = 2.0 ** -149
+end
+
+class XSDFloat < XSDAnySimpleType
+ include FloatConstants
+ Type = QName.new(Namespace, FloatLiteral)
+
+ def initialize(value = nil)
+ init(Type, value)
+ end
+
+private
+
+ def screen_data(value)
+ # "NaN".to_f => 0 in some environment. libc?
+ if value.is_a?(Float)
+ return narrow32bit(value)
+ end
+ str = value.to_s.strip
+ if str == 'NaN'
+ NaN
+ elsif str == 'INF'
+ POSITIVE_INF
+ elsif str == '-INF'
+ NEGATIVE_INF
+ else
+ if /^[+\-\.\deE]+$/ !~ str
+ raise ValueSpaceError.new("#{ type }: cannot accept '#{ str }'.")
+ end
+ # Float("-1.4E") might fail on some system.
+ str << '0' if /e$/i =~ str
+ begin
+ return narrow32bit(Float(str))
+ rescue ArgumentError
+ raise ValueSpaceError.new("#{ type }: cannot accept '#{ str }'.")
+ end
+ end
+ end
+
+ def _to_s
+ if @data.nan?
+ 'NaN'
+ elsif @data.infinite? == 1
+ 'INF'
+ elsif @data.infinite? == -1
+ '-INF'
+ else
+ sign = XSDFloat.positive?(@data) ? '+' : '-'
+ sign + sprintf("%.10g", @data.abs).sub(/[eE]([+-])?0+/) { 'e' + $1 }
+ end
+ end
+
+ # Convert to single-precision 32-bit floating point value.
+ def narrow32bit(f)
+ if f.nan? || f.infinite?
+ f
+ elsif f.abs < MIN_POSITIVE_SINGLE
+ XSDFloat.positive?(f) ? POSITIVE_ZERO : NEGATIVE_ZERO
+ else
+ f
+ end
+ end
+
+ def self.positive?(value)
+ (1 / value) > 0.0
+ end
+end
+
+# Ruby's Float is double-precision 64-bit floating point value.
+class XSDDouble < XSDAnySimpleType
+ include FloatConstants
+ Type = QName.new(Namespace, DoubleLiteral)
+
+ def initialize(value = nil)
+ init(Type, value)
+ end
+
+private
+
+ def screen_data(value)
+ # "NaN".to_f => 0 in some environment. libc?
+ if value.is_a?(Float)
+ return value
+ end
+ str = value.to_s.strip
+ if str == 'NaN'
+ NaN
+ elsif str == 'INF'
+ POSITIVE_INF
+ elsif str == '-INF'
+ NEGATIVE_INF
+ else
+ begin
+ return Float(str)
+ rescue ArgumentError
+ # '1.4e' cannot be parsed on some architecture.
+ if /e\z/i =~ str
+ begin
+ return Float(str + '0')
+ rescue ArgumentError
+ raise ValueSpaceError.new("#{ type }: cannot accept '#{ str }'.")
+ end
+ else
+ raise ValueSpaceError.new("#{ type }: cannot accept '#{ str }'.")
+ end
+ end
+ end
+ end
+
+ def _to_s
+ if @data.nan?
+ 'NaN'
+ elsif @data.infinite? == 1
+ 'INF'
+ elsif @data.infinite? == -1
+ '-INF'
+ else
+ sign = (1 / @data > 0.0) ? '+' : '-'
+ sign + sprintf("%.16g", @data.abs).sub(/[eE]([+-])?0+/) { 'e' + $1 }
+ end
+ end
+end
+
+class XSDDuration < XSDAnySimpleType
+ Type = QName.new(Namespace, DurationLiteral)
+
+ attr_accessor :sign
+ attr_accessor :year
+ attr_accessor :month
+ attr_accessor :day
+ attr_accessor :hour
+ attr_accessor :min
+ attr_accessor :sec
+
+ def initialize(value = nil)
+ init(Type, value)
+ end
+
+private
+
+ def screen_data(value)
+ /^([+\-]?)P(?:(\d+)Y)?(?:(\d+)M)?(?:(\d+)D)?(T(?:(\d+)H)?(?:(\d+)M)?(?:(\d+(?:\.\d+)?)S)?)?$/ =~ value.to_s.strip
+ unless Regexp.last_match
+ raise ValueSpaceError.new("#{ type }: cannot accept '#{ value }'.")
+ end
+ if ($5 and ((!$2 and !$3 and !$4) or (!$6 and !$7 and !$8)))
+ # Should we allow 'PT5S' here?
+ raise ValueSpaceError.new("#{ type }: cannot accept '#{ value }'.")
+ end
+ sign = $1
+ year = $2.to_i
+ month = $3.to_i
+ day = $4.to_i
+ hour = $6.to_i
+ min = $7.to_i
+ sec = $8 ? XSDDecimal.new($8) : 0
+ [sign, year, month, day, hour, min, sec]
+ end
+
+ def _set(data)
+ if data.nil?
+ @sign = @year = @month = @day = @hour = @min = @sec = @data = nil
+ return
+ end
+ @sign, @year, @month, @day, @hour, @min, @sec = data
+ @data = _to_s
+ @data.freeze
+ end
+
+ def _to_s
+ str = ''
+ str << @sign if @sign
+ str << 'P'
+ l = ''
+ l << "#{ @year }Y" if @year.nonzero?
+ l << "#{ @month }M" if @month.nonzero?
+ l << "#{ @day }D" if @day.nonzero?
+ r = ''
+ r << "#{ @hour }H" if @hour.nonzero?
+ r << "#{ @min }M" if @min.nonzero?
+ r << "#{ @sec }S" if @sec.nonzero?
+ str << l
+ if l.empty?
+ str << "0D"
+ end
+ unless r.empty?
+ str << "T" << r
+ end
+ str
+ end
+end
+
+
+require 'rational'
+require 'date'
+
+module XSDDateTimeImpl
+ SecInDay = 86400 # 24 * 60 * 60
+
+ def to_obj(klass)
+ if klass == Time
+ to_time
+ elsif klass == Date
+ to_date
+ elsif klass == DateTime
+ to_datetime
+ else
+ nil
+ end
+ end
+
+ def to_time
+ begin
+ if @data.offset * SecInDay == Time.now.utc_offset
+ d = @data
+ usec = (d.sec_fraction * SecInDay * 1000000).round
+ Time.local(d.year, d.month, d.mday, d.hour, d.min, d.sec, usec)
+ else
+ d = @data.newof
+ usec = (d.sec_fraction * SecInDay * 1000000).round
+ Time.gm(d.year, d.month, d.mday, d.hour, d.min, d.sec, usec)
+ end
+ rescue ArgumentError
+ nil
+ end
+ end
+
+ def to_date
+ Date.new0(@data.class.jd_to_ajd(@data.jd, 0, 0), 0, @data.start)
+ end
+
+ def to_datetime
+ data
+ end
+
+ def tz2of(str)
+ /^(?:Z|(?:([+\-])(\d\d):(\d\d))?)$/ =~ str
+ sign = $1
+ hour = $2.to_i
+ min = $3.to_i
+
+ of = case sign
+ when '+'
+ of = +(hour.to_r * 60 + min) / 1440 # 24 * 60
+ when '-'
+ of = -(hour.to_r * 60 + min) / 1440 # 24 * 60
+ else
+ 0
+ end
+ of
+ end
+
+ def of2tz(offset)
+ diffmin = offset * 24 * 60
+ if diffmin.zero?
+ 'Z'
+ else
+ ((diffmin < 0) ? '-' : '+') << format('%02d:%02d',
+ (diffmin.abs / 60.0).to_i, (diffmin.abs % 60.0).to_i)
+ end
+ end
+
+ def screen_data(t)
+ # convert t to a DateTime as an internal representation.
+ if t.respond_to?(:to_datetime) # 1.9 or later
+ t.to_datetime
+ elsif t.is_a?(DateTime)
+ t
+ elsif t.is_a?(Date)
+ t = screen_data_str(t)
+ t <<= 12 if t.year < 0
+ t
+ elsif t.is_a?(Time)
+ jd = DateTime.civil_to_jd(t.year, t.mon, t.mday, DateTime::ITALY)
+ fr = DateTime.time_to_day_fraction(t.hour, t.min, [t.sec, 59].min) +
+ t.usec.to_r / 1000000 / SecInDay
+ of = t.utc_offset.to_r / SecInDay
+ DateTime.new0(DateTime.jd_to_ajd(jd, fr, of), of, DateTime::ITALY)
+ else
+ screen_data_str(t)
+ end
+ end
+
+ def add_tz(s)
+ s + of2tz(@data.offset)
+ end
+end
+
+class XSDDateTime < XSDAnySimpleType
+ include XSDDateTimeImpl
+ Type = QName.new(Namespace, DateTimeLiteral)
+
+ def initialize(value = nil)
+ init(Type, value)
+ end
+
+private
+
+ def screen_data_str(t)
+ /^([+\-]?\d{4,})-(\d\d)-(\d\d)T(\d\d):(\d\d):(\d\d(?:\.(\d*))?)(Z|(?:[+\-]\d\d:\d\d)?)?$/ =~ t.to_s.strip
+ unless Regexp.last_match
+ raise ValueSpaceError.new("#{ type }: cannot accept '#{ t }'.")
+ end
+ if $1 == '0000'
+ raise ValueSpaceError.new("#{ type }: cannot accept '#{ t }'.")
+ end
+ year = $1.to_i
+ if year < 0
+ year += 1
+ end
+ mon = $2.to_i
+ mday = $3.to_i
+ hour = $4.to_i
+ min = $5.to_i
+ sec = $6.to_i
+ secfrac = $7
+ zonestr = $8
+ data = DateTime.civil(year, mon, mday, hour, min, sec, tz2of(zonestr))
+ if secfrac
+ diffday = secfrac.to_i.to_r / (10 ** secfrac.size) / SecInDay
+ data += diffday
+ # FYI: new0 and jd_to_rjd are not necessary to use if you don't have
+ # exceptional reason.
+ end
+ [data, secfrac]
+ end
+
+ def _set(data)
+ if data.nil?
+ @data = @secfrac = nil
+ return
+ end
+ @data, @secfrac = data
+ end
+
+ def _to_s
+ year = (@data.year > 0) ? @data.year : @data.year - 1
+ s = format('%.4d-%02d-%02dT%02d:%02d:%02d',
+ year, @data.mon, @data.mday, @data.hour, @data.min, @data.sec)
+ if @data.sec_fraction.nonzero?
+ if @secfrac
+ s << ".#{ @secfrac }"
+ else
+ s << sprintf("%.16f",
+ (@data.sec_fraction * SecInDay).to_f).sub(/^0/, '').sub(/0*$/, '')
+ end
+ end
+ add_tz(s)
+ end
+end
+
+class XSDTime < XSDAnySimpleType
+ include XSDDateTimeImpl
+ Type = QName.new(Namespace, TimeLiteral)
+
+ def initialize(value = nil)
+ init(Type, value)
+ end
+
+private
+
+ def screen_data_str(t)
+ /^(\d\d):(\d\d):(\d\d(?:\.(\d*))?)(Z|(?:([+\-])(\d\d):(\d\d))?)?$/ =~ t.to_s.strip
+ unless Regexp.last_match
+ raise ValueSpaceError.new("#{ type }: cannot accept '#{ t }'.")
+ end
+ hour = $1.to_i
+ min = $2.to_i
+ sec = $3.to_i
+ secfrac = $4
+ zonestr = $5
+ data = DateTime.civil(1, 1, 1, hour, min, sec, tz2of(zonestr))
+ if secfrac
+ diffday = secfrac.to_i.to_r / (10 ** secfrac.size) / SecInDay
+ data += diffday
+ end
+ [data, secfrac]
+ end
+
+ def _set(data)
+ if data.nil?
+ @data = @secfrac = nil
+ return
+ end
+ @data, @secfrac = data
+ end
+
+ def _to_s
+ s = format('%02d:%02d:%02d', @data.hour, @data.min, @data.sec)
+ if @data.sec_fraction.nonzero?
+ if @secfrac
+ s << ".#{ @secfrac }"
+ else
+ s << sprintf("%.16f",
+ (@data.sec_fraction * SecInDay).to_f).sub(/^0/, '').sub(/0*$/, '')
+ end
+ end
+ add_tz(s)
+ end
+end
+
+class XSDDate < XSDAnySimpleType
+ include XSDDateTimeImpl
+ Type = QName.new(Namespace, DateLiteral)
+
+ def initialize(value = nil)
+ init(Type, value)
+ end
+
+private
+
+ def screen_data_str(t)
+ /^([+\-]?\d{4,})-(\d\d)-(\d\d)(Z|(?:([+\-])(\d\d):(\d\d))?)?$/ =~ t.to_s.strip
+ unless Regexp.last_match
+ raise ValueSpaceError.new("#{ type }: cannot accept '#{ t }'.")
+ end
+ year = $1.to_i
+ if year < 0
+ year += 1
+ end
+ mon = $2.to_i
+ mday = $3.to_i
+ zonestr = $4
+ DateTime.civil(year, mon, mday, 0, 0, 0, tz2of(zonestr))
+ end
+
+ def _to_s
+ year = (@data.year > 0) ? @data.year : @data.year - 1
+ s = format('%.4d-%02d-%02d', year, @data.mon, @data.mday)
+ add_tz(s)
+ end
+end
+
+class XSDGYearMonth < XSDAnySimpleType
+ include XSDDateTimeImpl
+ Type = QName.new(Namespace, GYearMonthLiteral)
+
+ def initialize(value = nil)
+ init(Type, value)
+ end
+
+private
+
+ def screen_data_str(t)
+ /^([+\-]?\d{4,})-(\d\d)(Z|(?:([+\-])(\d\d):(\d\d))?)?$/ =~ t.to_s.strip
+ unless Regexp.last_match
+ raise ValueSpaceError.new("#{ type }: cannot accept '#{ t }'.")
+ end
+ year = $1.to_i
+ if year < 0
+ year += 1
+ end
+ mon = $2.to_i
+ zonestr = $3
+ DateTime.civil(year, mon, 1, 0, 0, 0, tz2of(zonestr))
+ end
+
+ def _to_s
+ year = (@data.year > 0) ? @data.year : @data.year - 1
+ s = format('%.4d-%02d', year, @data.mon)
+ add_tz(s)
+ end
+end
+
+class XSDGYear < XSDAnySimpleType
+ include XSDDateTimeImpl
+ Type = QName.new(Namespace, GYearLiteral)
+
+ def initialize(value = nil)
+ init(Type, value)
+ end
+
+private
+
+ def screen_data_str(t)
+ /^([+\-]?\d{4,})(Z|(?:([+\-])(\d\d):(\d\d))?)?$/ =~ t.to_s.strip
+ unless Regexp.last_match
+ raise ValueSpaceError.new("#{ type }: cannot accept '#{ t }'.")
+ end
+ year = $1.to_i
+ if year < 0
+ year += 1
+ end
+ zonestr = $2
+ DateTime.civil(year, 1, 1, 0, 0, 0, tz2of(zonestr))
+ end
+
+ def _to_s
+ year = (@data.year > 0) ? @data.year : @data.year - 1
+ s = format('%.4d', year)
+ add_tz(s)
+ end
+end
+
+class XSDGMonthDay < XSDAnySimpleType
+ include XSDDateTimeImpl
+ Type = QName.new(Namespace, GMonthDayLiteral)
+
+ def initialize(value = nil)
+ init(Type, value)
+ end
+
+private
+
+ def screen_data_str(t)
+ /^(\d\d)-(\d\d)(Z|(?:[+\-]\d\d:\d\d)?)?$/ =~ t.to_s.strip
+ unless Regexp.last_match
+ raise ValueSpaceError.new("#{ type }: cannot accept '#{ t }'.")
+ end
+ mon = $1.to_i
+ mday = $2.to_i
+ zonestr = $3
+ DateTime.civil(1, mon, mday, 0, 0, 0, tz2of(zonestr))
+ end
+
+ def _to_s
+ s = format('%02d-%02d', @data.mon, @data.mday)
+ add_tz(s)
+ end
+end
+
+class XSDGDay < XSDAnySimpleType
+ include XSDDateTimeImpl
+ Type = QName.new(Namespace, GDayLiteral)
+
+ def initialize(value = nil)
+ init(Type, value)
+ end
+
+private
+
+ def screen_data_str(t)
+ /^(\d\d)(Z|(?:[+\-]\d\d:\d\d)?)?$/ =~ t.to_s.strip
+ unless Regexp.last_match
+ raise ValueSpaceError.new("#{ type }: cannot accept '#{ t }'.")
+ end
+ mday = $1.to_i
+ zonestr = $2
+ DateTime.civil(1, 1, mday, 0, 0, 0, tz2of(zonestr))
+ end
+
+ def _to_s
+ s = format('%02d', @data.mday)
+ add_tz(s)
+ end
+end
+
+class XSDGMonth < XSDAnySimpleType
+ include XSDDateTimeImpl
+ Type = QName.new(Namespace, GMonthLiteral)
+
+ def initialize(value = nil)
+ init(Type, value)
+ end
+
+private
+
+ def screen_data_str(t)
+ /^(\d\d)(Z|(?:[+\-]\d\d:\d\d)?)?$/ =~ t.to_s.strip
+ unless Regexp.last_match
+ raise ValueSpaceError.new("#{ type }: cannot accept '#{ t }'.")
+ end
+ mon = $1.to_i
+ zonestr = $2
+ DateTime.civil(1, mon, 1, 0, 0, 0, tz2of(zonestr))
+ end
+
+ def _to_s
+ s = format('%02d', @data.mon)
+ add_tz(s)
+ end
+end
+
+class XSDHexBinary < XSDAnySimpleType
+ Type = QName.new(Namespace, HexBinaryLiteral)
+
+ # String in Ruby could be a binary.
+ def initialize(value = nil)
+ init(Type, value)
+ end
+
+ def set_encoded(value)
+ if /^[0-9a-fA-F]*$/ !~ value
+ raise ValueSpaceError.new("#{ type }: cannot accept '#{ value }'.")
+ end
+ @data = String.new(value).strip
+ @is_nil = false
+ end
+
+ def string
+ [@data].pack("H*")
+ end
+
+private
+
+ def screen_data(value)
+ value.unpack("H*")[0].tr('a-f', 'A-F')
+ end
+end
+
+class XSDBase64Binary < XSDAnySimpleType
+ Type = QName.new(Namespace, Base64BinaryLiteral)
+
+ # String in Ruby could be a binary.
+ def initialize(value = nil)
+ init(Type, value)
+ end
+
+ def set_encoded(value)
+ if /^[A-Za-z0-9+\/=]*$/ !~ value
+ raise ValueSpaceError.new("#{ type }: cannot accept '#{ value }'.")
+ end
+ @data = String.new(value).strip
+ @is_nil = false
+ end
+
+ def string
+ @data.unpack("m")[0]
+ end
+
+private
+
+ def screen_data(value)
+ [value].pack("m").strip
+ end
+end
+
+class XSDAnyURI < XSDAnySimpleType
+ Type = QName.new(Namespace, AnyURILiteral)
+
+ def initialize(value = nil)
+ init(Type, value)
+ end
+
+private
+
+ def screen_data(value)
+ begin
+ URI.parse(value.to_s.strip)
+ rescue URI::InvalidURIError
+ raise ValueSpaceError.new("#{ type }: cannot accept '#{ value }'.")
+ end
+ end
+end
+
+class XSDQName < XSDAnySimpleType
+ Type = QName.new(Namespace, QNameLiteral)
+
+ def initialize(value = nil)
+ init(Type, value)
+ end
+
+private
+
+ def screen_data(value)
+ /^(?:([^:]+):)?([^:]+)$/ =~ value.to_s.strip
+ unless Regexp.last_match
+ raise ValueSpaceError.new("#{ type }: cannot accept '#{ value }'.")
+ end
+ prefix = $1
+ localpart = $2
+ [prefix, localpart]
+ end
+
+ def _set(data)
+ if data.nil?
+ @prefix = @localpart = @data = nil
+ return
+ end
+ @prefix, @localpart = data
+ @data = _to_s
+ @data.freeze
+ end
+
+ def _to_s
+ if @prefix
+ "#{ @prefix }:#{ @localpart }"
+ else
+ "#{ @localpart }"
+ end
+ end
+end
+
+
+###
+## Derived types
+#
+class XSDNormalizedString < XSDString
+ Type = QName.new(Namespace, NormalizedStringLiteral)
+
+ def initialize(value = nil)
+ init(Type, value)
+ end
+
+private
+
+ def screen_data(value)
+ if /[\t\r\n]/ =~ value
+ raise ValueSpaceError.new("#{ type }: cannot accept '#{ value }'.")
+ end
+ super
+ end
+end
+
+class XSDInteger < XSDDecimal
+ Type = QName.new(Namespace, IntegerLiteral)
+
+ def initialize(value = nil)
+ init(Type, value)
+ end
+
+private
+
+ def screen_data_str(str)
+ begin
+ data = Integer(str)
+ rescue ArgumentError
+ raise ValueSpaceError.new("#{ type }: cannot accept '#{ str }'.")
+ end
+ unless validate(data)
+ raise ValueSpaceError.new("#{ type }: cannot accept '#{ str }'.")
+ end
+ data
+ end
+
+ def _set(value)
+ @data = value
+ end
+
+ def _to_s()
+ @data.to_s
+ end
+
+ def validate(v)
+ max = maxinclusive
+ min = mininclusive
+ (max.nil? or v <= max) and (min.nil? or v >= min)
+ end
+
+ def maxinclusive
+ nil
+ end
+
+ def mininclusive
+ nil
+ end
+
+ PositiveMinInclusive = 1
+ def positive(v)
+ PositiveMinInclusive <= v
+ end
+end
+
+class XSDNonPositiveInteger < XSDInteger
+ Type = QName.new(Namespace, NonPositiveIntegerLiteral)
+
+ def initialize(value = nil)
+ init(Type, value)
+ end
+
+private
+
+ def maxinclusive
+ 0
+ end
+
+ def mininclusive
+ nil
+ end
+end
+
+class XSDNegativeInteger < XSDNonPositiveInteger
+ Type = QName.new(Namespace, NegativeIntegerLiteral)
+
+ def initialize(value = nil)
+ init(Type, value)
+ end
+
+private
+
+ def maxinclusive
+ -1
+ end
+
+ def mininclusive
+ nil
+ end
+end
+
+class XSDLong < XSDInteger
+ Type = QName.new(Namespace, LongLiteral)
+
+ def initialize(value = nil)
+ init(Type, value)
+ end
+
+private
+
+ def maxinclusive
+ +9223372036854775807
+ end
+
+ def mininclusive
+ -9223372036854775808
+ end
+end
+
+class XSDInt < XSDLong
+ Type = QName.new(Namespace, IntLiteral)
+
+ def initialize(value = nil)
+ init(Type, value)
+ end
+
+private
+
+ def maxinclusive
+ +2147483647
+ end
+
+ def mininclusive
+ -2147483648
+ end
+end
+
+class XSDShort < XSDInt
+ Type = QName.new(Namespace, ShortLiteral)
+
+ def initialize(value = nil)
+ init(Type, value)
+ end
+
+private
+
+ def maxinclusive
+ +32767
+ end
+
+ def mininclusive
+ -32768
+ end
+end
+
+class XSDByte < XSDShort
+ Type = QName.new(Namespace, ByteLiteral)
+
+ def initialize(value = nil)
+ init(Type, value)
+ end
+
+private
+
+ def maxinclusive
+ +127
+ end
+
+ def mininclusive
+ -128
+ end
+end
+
+class XSDNonNegativeInteger < XSDInteger
+ Type = QName.new(Namespace, NonNegativeIntegerLiteral)
+
+ def initialize(value = nil)
+ init(Type, value)
+ end
+
+private
+
+ def maxinclusive
+ nil
+ end
+
+ def mininclusive
+ 0
+ end
+end
+
+class XSDUnsignedLong < XSDNonNegativeInteger
+ Type = QName.new(Namespace, UnsignedLongLiteral)
+
+ def initialize(value = nil)
+ init(Type, value)
+ end
+
+private
+
+ def maxinclusive
+ +18446744073709551615
+ end
+
+ def mininclusive
+ 0
+ end
+end
+
+class XSDUnsignedInt < XSDUnsignedLong
+ Type = QName.new(Namespace, UnsignedIntLiteral)
+
+ def initialize(value = nil)
+ init(Type, value)
+ end
+
+private
+
+ def maxinclusive
+ +4294967295
+ end
+
+ def mininclusive
+ 0
+ end
+end
+
+class XSDUnsignedShort < XSDUnsignedInt
+ Type = QName.new(Namespace, UnsignedShortLiteral)
+
+ def initialize(value = nil)
+ init(Type, value)
+ end
+
+private
+
+ def maxinclusive
+ +65535
+ end
+
+ def mininclusive
+ 0
+ end
+end
+
+class XSDUnsignedByte < XSDUnsignedShort
+ Type = QName.new(Namespace, UnsignedByteLiteral)
+
+ def initialize(value = nil)
+ init(Type, value)
+ end
+
+private
+
+ def maxinclusive
+ +255
+ end
+
+ def mininclusive
+ 0
+ end
+end
+
+class XSDPositiveInteger < XSDNonNegativeInteger
+ Type = QName.new(Namespace, PositiveIntegerLiteral)
+
+ def initialize(value = nil)
+ init(Type, value)
+ end
+
+private
+
+ def maxinclusive
+ nil
+ end
+
+ def mininclusive
+ 1
+ end
+end
+
+
+end
diff --git a/lib/xsd/datatypes1999.rb b/lib/xsd/datatypes1999.rb
new file mode 100644
index 0000000000..c7d6479e54
--- /dev/null
+++ b/lib/xsd/datatypes1999.rb
@@ -0,0 +1,20 @@
+# XSD4R - XML Schema Datatype 1999 support
+# Copyright (C) 2001, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+require 'xsd/datatypes'
+
+
+module XSD
+ Namespace.replace('http://www.w3.org/1999/XMLSchema')
+ InstanceNamespace.replace('http://www.w3.org/1999/XMLSchema-instance')
+ AnyTypeLiteral.replace('ur-type')
+ AnySimpleTypeLiteral.replace('ur-type')
+ NilLiteral.replace('null')
+ NilValue.replace('1')
+ DateTimeLiteral.replace('timeInstant')
+end
diff --git a/lib/xsd/iconvcharset.rb b/lib/xsd/iconvcharset.rb
new file mode 100644
index 0000000000..7e629d569b
--- /dev/null
+++ b/lib/xsd/iconvcharset.rb
@@ -0,0 +1,33 @@
+# XSD4R - Charset handling with iconv.
+# Copyright (C) 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+require 'iconv'
+
+
+module XSD
+
+
+class IconvCharset
+ def self.safe_iconv(to, from, str)
+ iconv = Iconv.new(to, from)
+ out = ""
+ begin
+ out << iconv.iconv(str)
+ rescue Iconv::IllegalSequence => e
+ out << e.success
+ ch, str = e.failed.split(//, 2)
+ out << '?'
+ warn("Failed to convert #{ch}")
+ retry
+ end
+ return out
+ end
+end
+
+
+end
diff --git a/lib/xsd/mapping.rb b/lib/xsd/mapping.rb
new file mode 100644
index 0000000000..06d30d4cbf
--- /dev/null
+++ b/lib/xsd/mapping.rb
@@ -0,0 +1,42 @@
+# XSD4R - XML Mapping for Ruby
+# Copyright (C) 2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+require "soap/parser"
+require 'soap/encodingstyle/literalHandler'
+require "soap/generator"
+require "soap/mapping"
+require "soap/mapping/wsdlliteralregistry"
+
+
+module XSD
+
+
+module Mapping
+ MappingRegistry = SOAP::Mapping::WSDLLiteralRegistry.new
+ MappingOpt = {:default_encodingstyle => SOAP::LiteralNamespace}
+
+ def self.obj2xml(obj, elename = nil, io = nil)
+ if !elename.nil? and !elename.is_a?(XSD::QName)
+ elename = XSD::QName.new(nil, elename)
+ end
+ elename ||= XSD::QName.new(nil, SOAP::Mapping.name2elename(obj.class.to_s))
+ soap = SOAP::Mapping.obj2soap(obj, MappingRegistry)
+ soap.elename = elename
+ generator = SOAP::SOAPGenerator.new(MappingOpt)
+ generator.generate(soap, io)
+ end
+
+ def self.xml2obj(stream)
+ parser = SOAP::Parser.new(MappingOpt)
+ soap = parser.parse(stream)
+ SOAP::Mapping.soap2obj(soap, MappingRegistry)
+ end
+end
+
+
+end
diff --git a/lib/xsd/namedelements.rb b/lib/xsd/namedelements.rb
new file mode 100644
index 0000000000..a13396bb71
--- /dev/null
+++ b/lib/xsd/namedelements.rb
@@ -0,0 +1,95 @@
+# XSD4R - WSDL named element collection.
+# Copyright (C) 2002, 2003, 2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+module XSD
+
+
+class NamedElements
+ include Enumerable
+
+ def initialize
+ @elements = []
+ @cache = {}
+ end
+
+ def dup
+ o = NamedElements.new
+ o.elements = @elements.dup
+ o
+ end
+
+ def freeze
+ super
+ @elements.freeze
+ self
+ end
+
+ def empty?
+ size == 0
+ end
+
+ def size
+ @elements.size
+ end
+
+ def [](idx)
+ if idx.is_a?(Numeric)
+ @elements[idx]
+ else
+ @cache[idx] ||= @elements.find { |item| item.name == idx }
+ end
+ end
+
+ def find_name(name)
+ @elements.find { |item| item.name.name == name }
+ end
+
+ def keys
+ collect { |element| element.name }
+ end
+
+ def each
+ @elements.each do |element|
+ yield(element)
+ end
+ end
+
+ def <<(rhs)
+ @elements << rhs
+ self
+ end
+
+ def delete(rhs)
+ @elements.delete(rhs)
+ end
+
+ def +(rhs)
+ o = NamedElements.new
+ o.elements = @elements + rhs.elements
+ o
+ end
+
+ def concat(rhs)
+ @elements.concat(rhs.elements)
+ self
+ end
+
+ Empty = NamedElements.new.freeze
+
+protected
+
+ def elements=(rhs)
+ @elements = rhs
+ end
+
+ def elements
+ @elements
+ end
+end
+
+end
diff --git a/lib/xsd/ns.rb b/lib/xsd/ns.rb
new file mode 100644
index 0000000000..53eeae7130
--- /dev/null
+++ b/lib/xsd/ns.rb
@@ -0,0 +1,140 @@
+# XSD4R - XML Schema Namespace library
+# Copyright (C) 2000-2003, 2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+require 'xsd/datatypes'
+
+
+module XSD
+
+
+class NS
+ class Assigner
+ def initialize
+ @count = 0
+ end
+
+ def assign(ns)
+ @count += 1
+ "n#{@count}"
+ end
+ end
+
+ attr_reader :default_namespace
+
+ class FormatError < Error; end
+
+public
+
+ def initialize(tag2ns = {})
+ @tag2ns = tag2ns
+ @assigner = nil
+ @ns2tag = {}
+ @tag2ns.each do |tag, ns|
+ @ns2tag[ns] = tag
+ end
+ @default_namespace = nil
+ end
+
+ def assign(ns, tag = nil)
+ if (tag == '')
+ @default_namespace = ns
+ tag
+ else
+ @assigner ||= Assigner.new
+ tag ||= @assigner.assign(ns)
+ @ns2tag[ns] = tag
+ @tag2ns[tag] = ns
+ tag
+ end
+ end
+
+ def assigned?(ns)
+ @default_namespace == ns or @ns2tag.key?(ns)
+ end
+
+ def assigned_tag?(tag)
+ @tag2ns.key?(tag)
+ end
+
+ def clone_ns
+ cloned = NS.new(@tag2ns.dup)
+ cloned.assigner = @assigner
+ cloned.assign(@default_namespace, '') if @default_namespace
+ cloned
+ end
+
+ def name(name)
+ if (name.namespace == @default_namespace)
+ name.name
+ elsif @ns2tag.key?(name.namespace)
+ "#{@ns2tag[name.namespace]}:#{name.name}"
+ else
+ raise FormatError.new("namespace: #{name.namespace} not defined yet")
+ end
+ end
+
+ def compare(ns, name, rhs)
+ if (ns == @default_namespace)
+ return true if (name == rhs)
+ end
+ @tag2ns.each do |assigned_tag, assigned_ns|
+ if assigned_ns == ns && "#{assigned_tag}:#{name}" == rhs
+ return true
+ end
+ end
+ false
+ end
+
+ # $1 and $2 are necessary.
+ ParseRegexp = Regexp.new('^([^:]+)(?::(.+))?$')
+
+ def parse(str, local = false)
+ if ParseRegexp =~ str
+ if (name = $2) and (ns = @tag2ns[$1])
+ return XSD::QName.new(ns, name)
+ end
+ end
+ XSD::QName.new(local ? nil : @default_namespace, str)
+ end
+
+ # For local attribute key parsing
+ # <foo xmlns="urn:a" xmlns:n1="urn:a" bar="1" n1:baz="2" />
+ # =>
+ # {}bar, {urn:a}baz
+ def parse_local(elem)
+ ParseRegexp =~ elem
+ if $2
+ ns = @tag2ns[$1]
+ name = $2
+ if !ns
+ raise FormatError.new("unknown namespace qualifier: #{$1}")
+ end
+ elsif $1
+ ns = nil
+ name = $1
+ else
+ raise FormatError.new("illegal element format: #{elem}")
+ end
+ XSD::QName.new(ns, name)
+ end
+
+ def each_ns
+ @ns2tag.each do |ns, tag|
+ yield(ns, tag)
+ end
+ end
+
+protected
+
+ def assigner=(assigner)
+ @assigner = assigner
+ end
+end
+
+
+end
diff --git a/lib/xsd/qname.rb b/lib/xsd/qname.rb
new file mode 100644
index 0000000000..bb9763a69a
--- /dev/null
+++ b/lib/xsd/qname.rb
@@ -0,0 +1,78 @@
+# XSD4R - XML QName definition.
+# Copyright (C) 2002, 2003, 2004 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+module XSD
+
+
+class QName
+ attr_accessor :namespace
+ attr_accessor :name
+ attr_accessor :source
+
+ def initialize(namespace = nil, name = nil)
+ @namespace = namespace
+ @name = name
+ @source = nil
+ end
+
+ def dup_name(name)
+ XSD::QName.new(@namespace, name)
+ end
+
+ def dump
+ ns = @namespace.nil? ? 'nil' : @namespace.dump
+ name = @name.nil? ? 'nil' : @name.dump
+ "XSD::QName.new(#{ns}, #{name})"
+ end
+
+ def match(rhs)
+ if rhs.namespace and (rhs.namespace != @namespace)
+ return false
+ end
+ if rhs.name and (rhs.name != @name)
+ return false
+ end
+ true
+ end
+
+ def ==(rhs)
+ !rhs.nil? and @namespace == rhs.namespace and @name == rhs.name
+ end
+
+ def ===(rhs)
+ (self == rhs)
+ end
+
+ def eql?(rhs)
+ (self == rhs)
+ end
+
+ def hash
+ @namespace.hash ^ @name.hash
+ end
+
+ def to_s
+ "{#{ namespace }}#{ name }"
+ end
+
+ def inspect
+ sprintf("#<%s:0x%x %s>", self.class.name, __id__,
+ "{#{ namespace }}#{ name }")
+ end
+
+ NormalizedNameRegexp = /^\{([^}]*)\}(.*)$/
+ def parse(str)
+ NormalizedNameRegexp =~ str
+ self.new($1, $2)
+ end
+
+ EMPTY = QName.new.freeze
+end
+
+
+end
diff --git a/lib/xsd/xmlparser.rb b/lib/xsd/xmlparser.rb
new file mode 100644
index 0000000000..e79e36c58c
--- /dev/null
+++ b/lib/xsd/xmlparser.rb
@@ -0,0 +1,61 @@
+# XSD4R - XML Instance parser library.
+# Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+require 'xsd/xmlparser/parser'
+
+
+module XSD
+
+
+module XMLParser
+ def create_parser(host, opt)
+ XSD::XMLParser::Parser.create_parser(host, opt)
+ end
+ module_function :create_parser
+
+ # $1 is necessary.
+ NSParseRegexp = Regexp.new('^xmlns:?(.*)$')
+
+ def filter_ns(ns, attrs)
+ return attrs if attrs.nil? or attrs.empty?
+ newattrs = {}
+ attrs.each do |key, value|
+ if (NSParseRegexp =~ key)
+ # '' means 'default namespace'.
+ tag = $1 || ''
+ ns.assign(value, tag)
+ else
+ newattrs[key] = value
+ end
+ end
+ newattrs
+ end
+ module_function :filter_ns
+end
+
+
+end
+
+
+# Try to load XML processor.
+loaded = false
+[
+ 'xsd/xmlparser/xmlparser',
+ 'xsd/xmlparser/xmlscanner',
+ 'xsd/xmlparser/rexmlparser',
+].each do |lib|
+ begin
+ require lib
+ loaded = true
+ break
+ rescue LoadError
+ end
+end
+unless loaded
+ raise RuntimeError.new("XML processor module not found.")
+end
diff --git a/lib/xsd/xmlparser/parser.rb b/lib/xsd/xmlparser/parser.rb
new file mode 100644
index 0000000000..ad01d55aa0
--- /dev/null
+++ b/lib/xsd/xmlparser/parser.rb
@@ -0,0 +1,96 @@
+# XSD4R - XML Instance parser library.
+# Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+require 'xsd/qname'
+require 'xsd/ns'
+require 'xsd/charset'
+
+
+module XSD
+module XMLParser
+
+
+class Parser
+ class ParseError < Error; end
+ class FormatDecodeError < ParseError; end
+ class UnknownElementError < FormatDecodeError; end
+ class UnknownAttributeError < FormatDecodeError; end
+ class UnexpectedElementError < FormatDecodeError; end
+ class ElementConstraintError < FormatDecodeError; end
+
+ @@parser_factory = nil
+
+ def self.factory
+ @@parser_factory
+ end
+
+ def self.create_parser(host, opt = {})
+ @@parser_factory.new(host, opt)
+ end
+
+ def self.add_factory(factory)
+ if $DEBUG
+ puts "Set #{ factory } as XML processor."
+ end
+ @@parser_factory = factory
+ end
+
+public
+
+ attr_accessor :charset
+
+ def initialize(host, opt = {})
+ @host = host
+ @charset = opt[:charset] || nil
+ end
+
+ def parse(string_or_readable)
+ @textbuf = ''
+ prologue
+ do_parse(string_or_readable)
+ epilogue
+ end
+
+private
+
+ def do_parse(string_or_readable)
+ raise NotImplementError.new(
+ 'Method do_parse must be defined in derived class.')
+ end
+
+ def start_element(name, attrs)
+ @host.start_element(name, attrs)
+ end
+
+ def characters(text)
+ @host.characters(text)
+ end
+
+ def end_element(name)
+ @host.end_element(name)
+ end
+
+ def prologue
+ end
+
+ def epilogue
+ end
+
+ def xmldecl_encoding=(charset)
+ if @charset.nil?
+ @charset = charset
+ else
+ # Definition in a stream (like HTTP) has a priority.
+ p "encoding definition: #{ charset } is ignored." if $DEBUG
+ end
+ end
+end
+
+
+end
+end
diff --git a/lib/xsd/xmlparser/rexmlparser.rb b/lib/xsd/xmlparser/rexmlparser.rb
new file mode 100644
index 0000000000..61da9aafc7
--- /dev/null
+++ b/lib/xsd/xmlparser/rexmlparser.rb
@@ -0,0 +1,54 @@
+# XSD4R - REXMLParser XML parser library.
+# Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+require 'xsd/xmlparser'
+require 'rexml/streamlistener'
+require 'rexml/document'
+
+
+module XSD
+module XMLParser
+
+
+class REXMLParser < XSD::XMLParser::Parser
+ include REXML::StreamListener
+
+ def do_parse(string_or_readable)
+ source = nil
+ source = REXML::SourceFactory.create_from(string_or_readable)
+ source.encoding = charset if charset
+ # Listener passes a String in utf-8.
+ @charset = 'utf-8'
+ REXML::Document.parse_stream(source, self)
+ end
+
+ def epilogue
+ end
+
+ def tag_start(name, attrs)
+ start_element(name, attrs)
+ end
+
+ def tag_end(name)
+ end_element(name)
+ end
+
+ def text(text)
+ characters(text)
+ end
+
+ def xmldecl(version, encoding, standalone)
+ # Version should be checked.
+ end
+
+ add_factory(self)
+end
+
+
+end
+end
diff --git a/lib/xsd/xmlparser/xmlparser.rb b/lib/xsd/xmlparser/xmlparser.rb
new file mode 100644
index 0000000000..6db914cd37
--- /dev/null
+++ b/lib/xsd/xmlparser/xmlparser.rb
@@ -0,0 +1,50 @@
+# XSD4R - XMLParser XML parser library.
+# Copyright (C) 2001, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+require 'xsd/xmlparser'
+require 'xml/parser'
+
+
+module XSD
+module XMLParser
+
+
+class XMLParser < XSD::XMLParser::Parser
+ class Listener < XML::Parser
+ begin
+ require 'xml/encoding-ja'
+ include XML::Encoding_ja
+ rescue LoadError
+ # uconv may not be installed.
+ end
+ end
+
+ def do_parse(string_or_readable)
+ # XMLParser passes a String in utf-8.
+ @charset = 'utf-8'
+ @parser = Listener.new
+ @parser.parse(string_or_readable) do |type, name, data|
+ case type
+ when XML::Parser::START_ELEM
+ start_element(name, data)
+ when XML::Parser::END_ELEM
+ end_element(name)
+ when XML::Parser::CDATA
+ characters(data)
+ else
+ raise FormatDecodeError.new("Unexpected XML: #{ type }/#{ name }/#{ data }.")
+ end
+ end
+ end
+
+ add_factory(self)
+end
+
+
+end
+end
diff --git a/lib/xsd/xmlparser/xmlscanner.rb b/lib/xsd/xmlparser/xmlscanner.rb
new file mode 100644
index 0000000000..c80dc23910
--- /dev/null
+++ b/lib/xsd/xmlparser/xmlscanner.rb
@@ -0,0 +1,147 @@
+# XSD4R - XMLScan XML parser library.
+# Copyright (C) 2002, 2003, 2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+require 'xsd/xmlparser'
+require 'xmlscan/scanner'
+
+
+module XSD
+module XMLParser
+
+
+class XMLScanner < XSD::XMLParser::Parser
+ include XMLScan::Visitor
+
+ def do_parse(string_or_readable)
+ @attrs = {}
+ @curattr = nil
+ @scanner = XMLScan::XMLScanner.new(self)
+ @scanner.kcode = XSD::Charset.charset_str(charset) if charset
+ @scanner.parse(string_or_readable)
+ end
+
+ def scanner_kcode=(charset)
+ @scanner.kcode = XSD::Charset.charset_str(charset) if charset
+ self.xmldecl_encoding = charset
+ end
+
+ ENTITY_REF_MAP = {
+ 'lt' => '<',
+ 'gt' => '>',
+ 'amp' => '&',
+ 'quot' => '"',
+ 'apos' => '\''
+ }
+
+ def parse_error(msg)
+ raise ParseError.new(msg)
+ end
+
+ def wellformed_error(msg)
+ raise NotWellFormedError.new(msg)
+ end
+
+ def valid_error(msg)
+ raise NotValidError.new(msg)
+ end
+
+ def warning(msg)
+ p msg if $DEBUG
+ end
+
+ # def on_xmldecl; end
+
+ def on_xmldecl_version(str)
+ # 1.0 expected.
+ end
+
+ def on_xmldecl_encoding(str)
+ self.scanner_kcode = str
+ end
+
+ # def on_xmldecl_standalone(str); end
+
+ # def on_xmldecl_other(name, value); end
+
+ # def on_xmldecl_end; end
+
+ # def on_doctype(root, pubid, sysid); end
+
+ # def on_prolog_space(str); end
+
+ # def on_comment(str); end
+
+ # def on_pi(target, pi); end
+
+ def on_chardata(str)
+ characters(str)
+ end
+
+ # def on_cdata(str); end
+
+ def on_etag(name)
+ end_element(name)
+ end
+
+ def on_entityref(ref)
+ characters(ENTITY_REF_MAP[ref])
+ end
+
+ def on_charref(code)
+ characters([code].pack('U'))
+ end
+
+ def on_charref_hex(code)
+ on_charref(code)
+ end
+
+ # def on_start_document; end
+
+ # def on_end_document; end
+
+ def on_stag(name)
+ @attrs = {}
+ end
+
+ def on_attribute(name)
+ @attrs[name] = @curattr = ''
+ end
+
+ def on_attr_value(str)
+ @curattr << str
+ end
+
+ def on_attr_entityref(ref)
+ @curattr << ENTITY_REF_MAP[ref]
+ end
+
+ def on_attr_charref(code)
+ @curattr << [code].pack('U')
+ end
+
+ def on_attr_charref_hex(code)
+ on_attr_charref(code)
+ end
+
+ # def on_attribute_end(name); end
+
+ def on_stag_end_empty(name)
+ on_stag_end(name)
+ on_etag(name)
+ end
+
+ def on_stag_end(name)
+ start_element(name, @attrs)
+ end
+
+ add_factory(self)
+end
+
+
+end
+end
diff --git a/lib/yaml.rb b/lib/yaml.rb
index 0c95b7e82c..a8da42a321 100644
--- a/lib/yaml.rb
+++ b/lib/yaml.rb
@@ -4,7 +4,7 @@
# = yaml.rb: top-level module with methods for loading and parsing YAML documents
#
# Author:: why the lucky stiff
-#
+#
require 'stringio'
require 'yaml/error'
@@ -24,18 +24,18 @@ require 'yaml/constants'
# serialization format. Together with the Unicode standard for characters, it
# provides all the information necessary to understand YAML Version 1.0
# and construct computer programs to process it.
-#
+#
# See http://yaml.org/ for more information. For a quick tutorial, please
# visit YAML In Five Minutes (http://yaml.kwiki.org/?YamlInFiveMinutes).
-#
+#
# == About This Library
-#
+#
# The YAML 1.0 specification outlines four stages of YAML loading and dumping.
# This library honors all four of those stages, although data is really only
# available to you in three stages.
-#
+#
# The four stages are: native, representation, serialization, and presentation.
-#
+#
# The native stage refers to data which has been loaded completely into Ruby's
# own types. (See +YAML::load+.)
#
@@ -43,14 +43,14 @@ require 'yaml/constants'
# +YAML::BaseNode+ objects. In this stage, the document is available as a
# tree of node objects. You can perform YPath queries and transformations
# at this level. (See +YAML::parse+.)
-#
+#
# The serialization stage happens inside the parser. The YAML parser used in
# Ruby is called Syck. Serialized nodes are available in the extension as
# SyckNode structs.
-#
+#
# The presentation stage is the YAML document itself. This is accessible
# to you as a string. (See +YAML::dump+.)
-#
+#
# For more information about the various information models, see Chapter
# 3 of the YAML 1.0 Specification (http://yaml.org/spec/#id2491269).
#
@@ -102,7 +102,7 @@ module YAML
#
# Converts _obj_ to YAML and writes the YAML result to _io_.
- #
+ #
# File.open( 'animals.yaml', 'w' ) do |out|
# YAML.dump( ['badger', 'elephant', 'tiger'], out )
# end
@@ -168,8 +168,8 @@ module YAML
# Can also load from a string.
#
# YAML.parse( "--- :locked" )
- # #=> #<YAML::Syck::Node:0x82edddc
- # @type_id="tag:ruby.yaml.org,2002:sym",
+ # #=> #<YAML::Syck::Node:0x82edddc
+ # @type_id="tag:ruby.yaml.org,2002:sym",
# @value=":locked", @kind=:scalar>
#
def YAML.parse( io )
@@ -213,7 +213,7 @@ module YAML
# end
# end
#
- def YAML.each_document( io, &block )
+ def YAML.each_document( io, &block )
yp = parser.load_documents( io, &block )
end
@@ -228,7 +228,7 @@ module YAML
# end
# end
#
- def YAML.load_documents( io, &doc_proc )
+ def YAML.load_documents( io, &doc_proc )
YAML.each_document( io, &doc_proc )
end
@@ -243,7 +243,7 @@ module YAML
# end
# end
#
- def YAML.each_node( io, &doc_proc )
+ def YAML.each_node( io, &doc_proc )
yp = generic_parser.load_documents( io, &doc_proc )
end
@@ -258,12 +258,12 @@ module YAML
# end
# end
#
- def YAML.parse_documents( io, &doc_proc )
+ def YAML.parse_documents( io, &doc_proc )
YAML.each_node( io, &doc_proc )
end
#
- # Loads all documents from the current _io_ stream,
+ # Loads all documents from the current _io_ stream,
# returning a +YAML::Stream+ object containing all
# loaded documents.
#
@@ -271,7 +271,7 @@ module YAML
d = nil
parser.load_documents( io ) do |doc|
d = YAML::Stream.new if not d
- d.add( doc )
+ d.add( doc )
end
return d
end
@@ -288,7 +288,7 @@ module YAML
def YAML.dump_stream( *objs )
d = YAML::Stream.new
objs.each do |doc|
- d.add( doc )
+ d.add( doc )
end
d.emit
end
@@ -378,7 +378,7 @@ module YAML
# Allocate an Emitter if needed
#
def YAML.quick_emit( oid, opts = {}, &e )
- out =
+ out =
if opts.is_a? YAML::Emitter
opts
else
@@ -390,7 +390,7 @@ module YAML
end
out.emit( oid, &e )
end
-
+
end
require 'yaml/rubytypes'
@@ -422,7 +422,7 @@ module Kernel
#
# _produces:_
#
- # --- !ruby/struct:S
+ # --- !ruby/struct:S
# name: dave
# state: TX
#
diff --git a/lib/yaml/baseemitter.rb b/lib/yaml/baseemitter.rb
index 59d9eddc76..a1992f498b 100644
--- a/lib/yaml/baseemitter.rb
+++ b/lib/yaml/baseemitter.rb
@@ -7,236 +7,241 @@ require 'yaml/encoding'
require 'yaml/error'
module YAML
- module BaseEmitter
- def options( opt = nil )
- if opt
- @options[opt] || YAML::DEFAULTS[opt]
- else
- @options
- end
- end
- def options=( opt )
- @options = opt
- end
+ module BaseEmitter
- #
- # Emit binary data
- #
- def binary_base64( value )
- self << "!binary "
- self.node_text( [value].pack("m"), '|' )
- end
-
- #
- # Emit plain, normal flowing text
- #
- def node_text( value, block = nil )
- @seq_map = false
- valx = value.dup
- unless block
- block =
- if options(:UseBlock)
- '|'
- elsif not options(:UseFold) and valx =~ /\n[ \t]/ and not valx =~ /#{YAML::ESCAPE_CHAR}/
- '|'
- else
- '>'
- end
- indt = $&.to_i if block =~ /\d+/
- if valx =~ /(\A\n*[ \t#]|^---\s+)/
- indt = options(:Indent) unless indt.to_i > 0
- block += indt.to_s
+ def options( opt = nil )
+ if opt
+ @options[opt] || YAML::DEFAULTS[opt]
+ else
+ @options
+ end
end
- block +=
- if valx =~ /\n\Z\n/
- "+"
- elsif valx =~ /\Z\n/
- ""
- else
- "-"
- end
- end
- block += "\n"
- if block[0] == ?"
- esc_skip = ( "\t\n" unless valx =~ /^[ \t]/ ) || ""
- valx = fold( YAML::escape( valx, esc_skip ) + "\"" ).chomp
- self << '"' + indent_text( valx, indt, false )
- else
- if block[0] == ?>
- valx = fold( valx )
+ def options=( opt )
+ @options = opt
end
- #p [block, indt]
- self << block + indent_text( valx, indt )
- end
- end
-
- #
- # Emit a simple, unqouted string
- #
- def simple( value )
- @seq_map = false
- self << value.to_s
- end
- #
- # Emit double-quoted string
- #
- def double( value )
- "\"#{YAML.escape( value )}\""
- end
-
- #
- # Emit single-quoted string
- #
- def single( value )
- "'#{value}'"
- end
-
- #
- # Write a text block with the current indent
- #
- def indent_text( text, mod, first_line = true )
- return "" if text.to_s.empty?
- spacing = indent( mod )
- text = text.gsub( /\A([^\n])/, "#{ spacing }\\1" ) if first_line
- return text.gsub( /\n^([^\n])/, "\n#{spacing}\\1" )
- end
-
- #
- # Write a current indent
- #
- def indent( mod = nil )
- #p [ self.id, level, mod, :INDENT ]
- if level <= 0
- mod ||= 0
- else
- mod ||= options(:Indent)
- mod += ( level - 1 ) * options(:Indent)
- end
- return " " * mod
- end
+ #
+ # Emit binary data
+ #
+ def binary_base64( value )
+ self << "!binary "
+ self.node_text( [value].pack("m"), '|' )
+ end
- #
- # Add indent to the buffer
- #
- def indent!
- self << indent
- end
+ #
+ # Emit plain, normal flowing text
+ #
+ def node_text( value, block = nil )
+ @seq_map = false
+ valx = value.dup
+ unless block
+ block =
+ if options(:UseBlock)
+ '|'
+ elsif not options(:UseFold) and valx =~ /\n[ \t]/ and not valx =~ /#{YAML::ESCAPE_CHAR}/
+ '|'
+ else
+ '>'
+ end
+
+ indt = $&.to_i if block =~ /\d+/
+ if valx =~ /(\A\n*[ \t#]|^---\s+)/
+ indt = options(:Indent) unless indt.to_i > 0
+ block += indt.to_s
+ end
+
+ block +=
+ if valx =~ /\n\Z\n/
+ "+"
+ elsif valx =~ /\Z\n/
+ ""
+ else
+ "-"
+ end
+ end
+ block += "\n"
+ if block[0] == ?"
+ esc_skip = ( "\t\n" unless valx =~ /^[ \t]/ ) || ""
+ valx = fold( YAML::escape( valx, esc_skip ) + "\"" ).chomp
+ self << '"' + indent_text( valx, indt, false )
+ else
+ if block[0] == ?>
+ valx = fold( valx )
+ end
+ #p [block, indt]
+ self << block + indent_text( valx, indt )
+ end
+ end
+
+ #
+ # Emit a simple, unqouted string
+ #
+ def simple( value )
+ @seq_map = false
+ self << value.to_s
+ end
+
+ #
+ # Emit double-quoted string
+ #
+ def double( value )
+ "\"#{YAML.escape( value )}\""
+ end
+
+ #
+ # Emit single-quoted string
+ #
+ def single( value )
+ "'#{value}'"
+ end
+
+ #
+ # Write a text block with the current indent
+ #
+ def indent_text( text, mod, first_line = true )
+ return "" if text.to_s.empty?
+ spacing = indent( mod )
+ text = text.gsub( /\A([^\n])/, "#{ spacing }\\1" ) if first_line
+ return text.gsub( /\n^([^\n])/, "\n#{spacing}\\1" )
+ end
+
+ #
+ # Write a current indent
+ #
+ def indent( mod = nil )
+ #p [ self.id, level, mod, :INDENT ]
+ if level <= 0
+ mod ||= 0
+ else
+ mod ||= options(:Indent)
+ mod += ( level - 1 ) * options(:Indent)
+ end
+ return " " * mod
+ end
+
+ #
+ # Add indent to the buffer
+ #
+ def indent!
+ self << indent
+ end
+
+ #
+ # Folding paragraphs within a column
+ #
+ def fold( value )
+ value.gsub( /(^[ \t]+.*$)|(\S.{0,#{options(:BestWidth) - 1}})(?:[ \t]+|(\n+(?=[ \t]|\Z))|$)/ ) do
+ $1 || $2 + ( $3 || "\n" )
+ end
+ end
- #
- # Folding paragraphs within a column
- #
- def fold( value )
- value.gsub( /(^[ \t]+.*$)|(\S.{0,#{options(:BestWidth) - 1}})(?:[ \t]+|(\n+(?=[ \t]|\Z))|$)/ ) do
- $1 || $2 + ( $3 || "\n" )
- end
- end
+ #
+ # Quick mapping
+ #
+ def map( type, &e )
+ val = Mapping.new
+ e.call( val )
+ self << "#{type} " if type.length.nonzero?
+
+ #
+ # Empty hashes
+ #
+ if val.length.zero?
+ self << "{}"
+ @seq_map = false
+ else
+ # FIXME
+ # if @buffer.length == 1 and options(:UseHeader) == false and type.length.zero?
+ # @headless = 1
+ # end
+
+ defkey = @options.delete( :DefaultKey )
+ if defkey
+ seq_map_shortcut
+ self << "= : "
+ defkey.to_yaml( :Emitter => self )
+ end
+
+ #
+ # Emit the key and value
+ #
+ val.each { |v|
+ seq_map_shortcut
+ if v[0].is_complex_yaml?
+ self << "? "
+ end
+ v[0].to_yaml( :Emitter => self )
+ if v[0].is_complex_yaml?
+ self << "\n"
+ indent!
+ end
+ self << ": "
+ v[1].to_yaml( :Emitter => self )
+ }
+ end
+ end
- #
- # Quick mapping
- #
- def map( type, &e )
- val = Mapping.new
- e.call( val )
- self << "#{type} " if type.length.nonzero?
-
- #
- # Empty hashes
- #
- if val.length.zero?
- self << "{}"
- @seq_map = false
- else
- # FIXME
- # if @buffer.length == 1 and options(:UseHeader) == false and type.length.zero?
- # @headless = 1
- # end
-
- defkey = @options.delete( :DefaultKey )
- if defkey
- seq_map_shortcut
- self << "= : "
- defkey.to_yaml( :Emitter => self )
+ def seq_map_shortcut
+ # FIXME: seq_map needs to work with the new anchoring system
+ # if @seq_map
+ # @anchor_extras[@buffer.length - 1] = "\n" + indent
+ # @seq_map = false
+ # else
+ self << "\n"
+ indent!
+ # end
end
#
- # Emit the key and value
+ # Quick sequence
#
- val.each { |v|
- seq_map_shortcut
- if v[0].is_complex_yaml?
- self << "? "
- end
- v[0].to_yaml( :Emitter => self )
- if v[0].is_complex_yaml?
- self << "\n"
- indent!
- end
- self << ": "
- v[1].to_yaml( :Emitter => self )
- }
- end
- end
+ def seq( type, &e )
+ @seq_map = false
+ val = Sequence.new
+ e.call( val )
+ self << "#{type} " if type.length.nonzero?
+
+ #
+ # Empty arrays
+ #
+ if val.length.zero?
+ self << "[]"
+ else
+ # FIXME
+ # if @buffer.length == 1 and options(:UseHeader) == false and type.length.zero?
+ # @headless = 1
+ # end
+
+ #
+ # Emit the key and value
+ #
+ val.each { |v|
+ self << "\n"
+ indent!
+ self << "- "
+ @seq_map = true if v.class == Hash
+ v.to_yaml( :Emitter => self )
+ }
+ end
+ end
- def seq_map_shortcut
- # FIXME: seq_map needs to work with the new anchoring system
- # if @seq_map
- # @anchor_extras[@buffer.length - 1] = "\n" + indent
- # @seq_map = false
- # else
- self << "\n"
- indent!
- # end
end
#
- # Quick sequence
+ # Emitter helper classes
#
- def seq( type, &e )
- @seq_map = false
- val = Sequence.new
- e.call( val )
- self << "#{type} " if type.length.nonzero?
-
- #
- # Empty arrays
- #
- if val.length.zero?
- self << "[]"
- else
- # FIXME
- # if @buffer.length == 1 and options(:UseHeader) == false and type.length.zero?
- # @headless = 1
- # end
-
- #
- # Emit the key and value
- #
- val.each { |v|
- self << "\n"
- indent!
- self << "- "
- @seq_map = true if v.class == Hash
- v.to_yaml( :Emitter => self )
- }
- end
- end
- end
-
- #
- # Emitter helper classes
- #
- class Mapping < Array
- def add( k, v )
- push [k, v]
+ class Mapping < Array
+ def add( k, v )
+ push [k, v]
+ end
end
- end
- class Sequence < Array
- def add( v )
- push v
+ class Sequence < Array
+ def add( v )
+ push v
+ end
end
- end
+
end
diff --git a/lib/yaml/constants.rb b/lib/yaml/constants.rb
index 728d3b7932..fb833d3077 100644
--- a/lib/yaml/constants.rb
+++ b/lib/yaml/constants.rb
@@ -13,7 +13,7 @@ module YAML
# Parser tokens
#
WORD_CHAR = 'A-Za-z0-9'
- PRINTABLE_CHAR = '-_A-Za-z0-9!?/()$\'". '
+ PRINTABLE_CHAR = '-_A-Za-z0-9!?/()$\'". '
NOT_PLAIN_CHAR = '\x7f\x0-\x1f\x80-\x9f'
ESCAPE_CHAR = '[\\x00-\\x09\\x0b-\\x1f]'
INDICATOR_CHAR = '*&!|\\\\^@%{}[]='
@@ -27,7 +27,7 @@ module YAML
\x18 \x19 \x1a \e \x1c \x1d \x1e \x1f
}
UNESCAPES = {
- 'a' => "\x07", 'b' => "\x08", 't' => "\x09",
+ 'a' => "\x07", 'b' => "\x08", 't' => "\x09",
'n' => "\x0a", 'v' => "\x0b", 'f' => "\x0c",
'r' => "\x0d", 'e' => "\x1b", '\\' => '\\',
}
diff --git a/lib/yaml/dbm.rb b/lib/yaml/dbm.rb
index a28fd04f19..87d6009250 100644
--- a/lib/yaml/dbm.rb
+++ b/lib/yaml/dbm.rb
@@ -35,14 +35,14 @@ class DBM < ::DBM
def delete( key )
v = super( key )
if String === v
- v = YAML::load( v )
+ v = YAML::load( v )
end
v
end
def delete_if
del_keys = keys.dup
del_keys.delete_if { |k| yield( k, fetch( k ) ) == false }
- del_keys.each { |k| delete( k ) }
+ del_keys.each { |k| delete( k ) }
self
end
def reject
diff --git a/lib/yaml/encoding.rb b/lib/yaml/encoding.rb
index 98e83c3853..57dc553606 100644
--- a/lib/yaml/encoding.rb
+++ b/lib/yaml/encoding.rb
@@ -23,9 +23,9 @@ module YAML
if $3
["#$3".hex ].pack('U*')
elsif $2
- [$2].pack( "H2" )
+ [$2].pack( "H2" )
else
- UNESCAPES[$1]
+ UNESCAPES[$1]
end
}
end
diff --git a/lib/yaml/error.rb b/lib/yaml/error.rb
index 75de0ec18a..15865a9aa9 100644
--- a/lib/yaml/error.rb
+++ b/lib/yaml/error.rb
@@ -26,7 +26,7 @@ module YAML
#
# YAML Error classes
#
-
+
class Error < StandardError; end
class ParseError < Error; end
class TypeError < StandardError; end
diff --git a/lib/yaml/rubytypes.rb b/lib/yaml/rubytypes.rb
index e8c0c89f2c..35b719196e 100644
--- a/lib/yaml/rubytypes.rb
+++ b/lib/yaml/rubytypes.rb
@@ -64,7 +64,7 @@ class Struct
end
if not struct_type
struct_def = [ tag.split( ':', 4 ).last ]
- struct_type = Struct.new( *struct_def.concat( val.keys.collect { |k| k.intern } ) )
+ struct_type = Struct.new( *struct_def.concat( val.keys.collect { |k| k.intern } ) )
end
#
@@ -143,7 +143,7 @@ class String
to_yaml_style or not to_yaml_properties.empty? or self =~ /\n.+/
end
def is_binary_data?
- self.count("^ -~\t\r\n").fdiv(self.size) > 0.3 || self.index("\x00") unless self.empty?
+ ( self.count( "^ -~", "^\r\n" ).fdiv(self.size) > 0.3 || self.index( "\x00" ) ) unless empty?
end
def String.yaml_new( klass, tag, val )
val = val.unpack("m")[0] if tag == "tag:yaml.org,2002:binary"
@@ -317,7 +317,7 @@ class Time
utc_same_instant = self.dup.utc
utc_same_writing = Time.utc(year,month,day,hour,min,sec,usec)
difference_to_utc = utc_same_writing - utc_same_instant
- if (difference_to_utc < 0)
+ if (difference_to_utc < 0)
difference_sign = '-'
absolute_difference = -difference_to_utc
else
@@ -379,44 +379,6 @@ class Float
end
end
-class Rational
- yaml_as "tag:ruby.yaml.org,2002:object:Rational"
- def Rational.yaml_new( klass, tag, val )
- if val.is_a? String
- Rational( val )
- else
- Rational( val['numerator'], val['denominator'] )
- end
- end
- def to_yaml( opts = {} )
- YAML::quick_emit( self, opts ) do |out|
- out.map( taguri, nil ) do |map|
- map.add( 'denominator', denominator )
- map.add( 'numerator', numerator )
- end
- end
- end
-end
-
-class Complex
- yaml_as "tag:ruby.yaml.org,2002:object:Complex"
- def Complex.yaml_new( klass, tag, val )
- if val.is_a? String
- Complex( val )
- else
- Complex( val['real'], val['image'] )
- end
- end
- def to_yaml( opts = {} )
- YAML::quick_emit( self, opts ) do |out|
- out.map( taguri, nil ) do |map|
- map.add( 'image', imaginary )
- map.add( 'real', real )
- end
- end
- end
-end
-
class TrueClass
yaml_as "tag:yaml.org,2002:bool#yes"
def to_yaml( opts = {} )
@@ -435,7 +397,7 @@ class FalseClass
end
end
-class NilClass
+class NilClass
yaml_as "tag:yaml.org,2002:null"
def to_yaml( opts = {} )
YAML::quick_emit( nil, opts ) do |out|
diff --git a/lib/yaml/stream.rb b/lib/yaml/stream.rb
index 651a1bbbef..060fbc4200 100644
--- a/lib/yaml/stream.rb
+++ b/lib/yaml/stream.rb
@@ -11,7 +11,7 @@ module YAML
@options = opts
@documents = []
end
-
+
def []( i )
@documents[ i ]
end
diff --git a/lib/yaml/stringio.rb b/lib/yaml/stringio.rb
index b0fda19e28..8ad949fa2b 100644
--- a/lib/yaml/stringio.rb
+++ b/lib/yaml/stringio.rb
@@ -13,7 +13,7 @@ rescue LoadError
end
def pos
@pos
- end
+ end
def eof
@eof
end
diff --git a/lib/yaml/tag.rb b/lib/yaml/tag.rb
index add3c49894..0fb6bef9a0 100644
--- a/lib/yaml/tag.rb
+++ b/lib/yaml/tag.rb
@@ -4,13 +4,13 @@
# = yaml/tag.rb: methods for associating a taguri to a class.
#
# Author:: why the lucky stiff
-#
+#
module YAML
# A dictionary of taguris which map to
# Ruby classes.
@@tagged_classes = {}
-
- #
+
+ #
# Associates a taguri _tag_ with a Ruby class _cls_. The taguri is used to give types
# to classes when loading YAML. Taguris are of the form:
#
@@ -19,7 +19,7 @@ module YAML
# The +authorityName+ is a domain name or email address. The +date+ is the date the type
# was issued in YYYY or YYYY-MM or YYYY-MM-DD format. The +specific+ is a name for
# the type being added.
- #
+ #
# For example, built-in YAML types have 'yaml.org' as the +authorityName+ and '2002' as the
# +date+. The +specific+ is simply the name of the type:
#
diff --git a/lib/yaml/types.rb b/lib/yaml/types.rb
index 60aebc0481..3871c628fe 100644
--- a/lib/yaml/types.rb
+++ b/lib/yaml/types.rb
@@ -58,7 +58,7 @@ module YAML
#
# YAML Hash class to support comments and defaults
#
- class SpecialHash < ::Hash
+ class SpecialHash < ::Hash
attr_accessor :default
def inspect
self.default.to_s
@@ -112,7 +112,7 @@ module YAML
if ( tmp = self.assoc( k ) ) and not set
tmp[1] = val
else
- self << [ k, val ]
+ self << [ k, val ]
end
val
end
@@ -163,7 +163,7 @@ module YAML
self.assoc( k ).to_a
end
def []=( k, val )
- self << [ k, val ]
+ self << [ k, val ]
val
end
def has_key?( k )
diff --git a/lib/yaml/yamlnode.rb b/lib/yaml/yamlnode.rb
index 8afa142669..e36a18e694 100644
--- a/lib/yaml/yamlnode.rb
+++ b/lib/yaml/yamlnode.rb
@@ -11,13 +11,13 @@ module YAML
class YamlNode
include BaseNode
attr_accessor :kind, :type_id, :value, :anchor
- def initialize(t, v)
+ def initialize( t, v )
@type_id = t
if Hash === v
@kind = 'map'
@value = {}
- v.each {|key,val|
- @value[key.transform] = [key, val]
+ v.each { |k,v|
+ @value[ k.transform ] = [ k, v ]
}
elsif Array === v
@kind = 'seq'
diff --git a/load.c b/load.c
deleted file mode 100644
index 9a5498e4da..0000000000
--- a/load.c
+++ /dev/null
@@ -1,737 +0,0 @@
-/*
- * load methods from eval.c
- */
-
-#include "ruby/ruby.h"
-#include "ruby/util.h"
-#include "dln.h"
-#include "eval_intern.h"
-
-VALUE ruby_dln_librefs;
-
-#define IS_RBEXT(e) (strcmp(e, ".rb") == 0)
-#define IS_SOEXT(e) (strcmp(e, ".so") == 0 || strcmp(e, ".o") == 0)
-#ifdef DLEXT2
-#define IS_DLEXT(e) (strcmp(e, DLEXT) == 0 || strcmp(e, DLEXT2) == 0)
-#else
-#define IS_DLEXT(e) (strcmp(e, DLEXT) == 0)
-#endif
-
-
-static const char *const loadable_ext[] = {
- ".rb", DLEXT,
-#ifdef DLEXT2
- DLEXT2,
-#endif
- 0
-};
-
-VALUE
-rb_get_load_path(void)
-{
- VALUE load_path = GET_VM()->load_path;
- return load_path;
-}
-
-VALUE
-rb_get_expanded_load_path(void)
-{
- VALUE load_path = rb_get_load_path();
- VALUE ary = rb_ary_new2(RARRAY_LEN(load_path));
- long i;
-
- for (i = 0; i < RARRAY_LEN(load_path); ++i) {
- VALUE path = rb_file_expand_path(RARRAY_PTR(load_path)[i], Qnil);
- rb_str_freeze(path);
- rb_ary_push(ary, path);
- }
- rb_obj_freeze(ary);
- return ary;
-}
-
-static VALUE
-load_path_getter(ID id, rb_vm_t *vm)
-{
- return vm->load_path;
-}
-
-static VALUE
-get_loaded_features(void)
-{
- return GET_VM()->loaded_features;
-}
-
-static st_table *
-get_loading_table(void)
-{
- return GET_VM()->loading_table;
-}
-
-static VALUE
-loaded_feature_path(const char *name, long vlen, const char *feature, long len,
- int type, VALUE load_path)
-{
- long i;
-
- for (i = 0; i < RARRAY_LEN(load_path); ++i) {
- VALUE p = RARRAY_PTR(load_path)[i];
- const char *s = StringValuePtr(p);
- long n = RSTRING_LEN(p);
-
- if (vlen < n + len + 1) continue;
- if (n && (strncmp(name, s, n) || name[n] != '/')) continue;
- if (strncmp(name + n + 1, feature, len)) continue;
- if (name[n+len+1] && name[n+len+1] != '.') continue;
- switch (type) {
- case 's':
- if (IS_DLEXT(&name[n+len+1])) return p;
- break;
- case 'r':
- if (IS_RBEXT(&name[n+len+1])) return p;
- break;
- default:
- return p;
- }
- }
- return 0;
-}
-
-struct loaded_feature_searching {
- const char *name;
- long len;
- int type;
- VALUE load_path;
- const char *result;
-};
-
-static int
-loaded_feature_path_i(st_data_t v, st_data_t b, st_data_t f)
-{
- const char *s = (const char *)v;
- struct loaded_feature_searching *fp = (struct loaded_feature_searching *)f;
- VALUE p = loaded_feature_path(s, strlen(s), fp->name, fp->len,
- fp->type, fp->load_path);
- if (!p) return ST_CONTINUE;
- fp->result = s;
- return ST_STOP;
-}
-
-static int
-rb_feature_p(const char *feature, const char *ext, int rb, int expanded, const char **fn)
-{
- VALUE v, features, p, load_path = 0;
- const char *f, *e;
- long i, len, elen, n;
- st_table *loading_tbl;
- st_data_t data;
- int type;
-
- if (fn) *fn = 0;
- if (ext) {
- elen = strlen(ext);
- len = strlen(feature) - elen;
- type = rb ? 'r' : 's';
- }
- else {
- len = strlen(feature);
- elen = 0;
- type = 0;
- }
- features = get_loaded_features();
- for (i = 0; i < RARRAY_LEN(features); ++i) {
- v = RARRAY_PTR(features)[i];
- f = StringValuePtr(v);
- if ((n = RSTRING_LEN(v)) < len) continue;
- if (strncmp(f, feature, len) != 0) {
- if (expanded) continue;
- if (!load_path) load_path = rb_get_expanded_load_path();
- if (!(p = loaded_feature_path(f, n, feature, len, type, load_path)))
- continue;
- expanded = 1;
- f += RSTRING_LEN(p) + 1;
- }
- if (!*(e = f + len)) {
- if (ext) continue;
- return 'u';
- }
- if (*e != '.') continue;
- if ((!rb || !ext) && (IS_SOEXT(e) || IS_DLEXT(e))) {
- return 's';
- }
- if ((rb || !ext) && (IS_RBEXT(e))) {
- return 'r';
- }
- }
- loading_tbl = get_loading_table();
- if (loading_tbl) {
- f = 0;
- if (!expanded) {
- struct loaded_feature_searching fs;
- fs.name = feature;
- fs.len = len;
- fs.type = type;
- fs.load_path = load_path ? load_path : rb_get_load_path();
- fs.result = 0;
- st_foreach(loading_tbl, loaded_feature_path_i, (st_data_t)&fs);
- if ((f = fs.result) != 0) {
- if (fn) *fn = f;
- goto loading;
- }
- }
- if (st_get_key(loading_tbl, (st_data_t)feature, &data)) {
- if (fn) *fn = (const char*)data;
- loading:
- if (!ext) return 'u';
- return !IS_RBEXT(ext) ? 's' : 'r';
- }
- else {
- VALUE bufstr;
- char *buf;
-
- if (ext && *ext) return 0;
- bufstr = rb_str_tmp_new(len + DLEXT_MAXLEN);
- buf = RSTRING_PTR(bufstr);
- MEMCPY(buf, feature, char, len);
- for (i = 0; (e = loadable_ext[i]) != 0; i++) {
- strlcpy(buf + len, e, DLEXT_MAXLEN + 1);
- if (st_get_key(loading_tbl, (st_data_t)buf, &data)) {
- rb_str_resize(bufstr, 0);
- if (fn) *fn = (const char*)data;
- return i ? 's' : 'r';
- }
- }
- rb_str_resize(bufstr, 0);
- }
- }
- return 0;
-}
-
-int
-rb_provided(const char *feature)
-{
- return rb_feature_provided(feature, 0);
-}
-
-int
-rb_feature_provided(const char *feature, const char **loading)
-{
- const char *ext = strrchr(feature, '.');
- volatile VALUE fullpath = 0;
-
- if (*feature == '.' &&
- (feature[1] == '/' || strncmp(feature+1, "./", 2) == 0)) {
- fullpath = rb_file_expand_path(rb_str_new2(feature), Qnil);
- feature = RSTRING_PTR(fullpath);
- }
- if (ext && !strchr(ext, '/')) {
- if (IS_RBEXT(ext)) {
- if (rb_feature_p(feature, ext, Qtrue, Qfalse, loading)) return Qtrue;
- return Qfalse;
- }
- else if (IS_SOEXT(ext) || IS_DLEXT(ext)) {
- if (rb_feature_p(feature, ext, Qfalse, Qfalse, loading)) return Qtrue;
- return Qfalse;
- }
- }
- if (rb_feature_p(feature, feature + strlen(feature), Qtrue, Qfalse, loading))
- return Qtrue;
- return Qfalse;
-}
-
-static void
-rb_provide_feature(VALUE feature)
-{
- rb_ary_push(get_loaded_features(), feature);
-}
-
-void
-rb_provide(const char *feature)
-{
- rb_provide_feature(rb_usascii_str_new2(feature));
-}
-
-NORETURN(static void load_failed(VALUE));
-
-static void
-rb_load_internal(VALUE fname, int wrap)
-{
- int state;
- rb_thread_t *th = GET_THREAD();
- volatile VALUE wrapper = th->top_wrapper;
- volatile VALUE self = th->top_self;
- volatile int loaded = Qfalse;
- volatile int mild_compile_error;
-#ifndef __GNUC__
- rb_thread_t *volatile th0 = th;
-#endif
-
- th->errinfo = Qnil; /* ensure */
-
- if (!wrap) {
- rb_secure(4); /* should alter global state */
- th->top_wrapper = 0;
- }
- else {
- /* load in anonymous module as toplevel */
- th->top_self = rb_obj_clone(rb_vm_top_self());
- th->top_wrapper = rb_module_new();
- rb_extend_object(th->top_self, th->top_wrapper);
- }
-
- mild_compile_error = th->mild_compile_error;
- PUSH_TAG();
- state = EXEC_TAG();
- if (state == 0) {
- NODE *node;
- VALUE iseq;
-
- th->mild_compile_error++;
- node = (NODE *)rb_load_file(RSTRING_PTR(fname));
- loaded = Qtrue;
- iseq = rb_iseq_new_top(node, rb_str_new2("<top (required)>"), fname, Qfalse);
- th->mild_compile_error--;
- rb_iseq_eval(iseq);
- }
- POP_TAG();
-
-#ifndef __GNUC__
- th = th0;
- fname = RB_GC_GUARD(fname);
-#endif
- th->mild_compile_error = mild_compile_error;
- th->top_self = self;
- th->top_wrapper = wrapper;
-
- if (!loaded) {
- rb_exc_raise(GET_THREAD()->errinfo);
- }
- if (state) {
- rb_vm_jump_tag_but_local_jump(state, Qundef);
- }
-
- if (!NIL_P(GET_THREAD()->errinfo)) {
- /* exception during load */
- rb_exc_raise(th->errinfo);
- }
-}
-
-void
-rb_load(VALUE fname, int wrap)
-{
- VALUE tmp = rb_find_file(FilePathValue(fname));
- if (!tmp) load_failed(fname);
- rb_load_internal(tmp, wrap);
-}
-
-void
-rb_load_protect(VALUE fname, int wrap, int *state)
-{
- int status;
-
- PUSH_TAG();
- if ((status = EXEC_TAG()) == 0) {
- rb_load(fname, wrap);
- }
- POP_TAG();
- if (state)
- *state = status;
-}
-
-/*
- * call-seq:
- * load(filename, wrap=false) => true
- *
- * Loads and executes the Ruby
- * program in the file _filename_. If the filename does not
- * resolve to an absolute path, the file is searched for in the library
- * directories listed in <code>$:</code>. If the optional _wrap_
- * parameter is +true+, the loaded script will be executed
- * under an anonymous module, protecting the calling program's global
- * namespace. In no circumstance will any local variables in the loaded
- * file be propagated to the loading environment.
- */
-
-static VALUE
-rb_f_load(int argc, VALUE *argv)
-{
- VALUE fname, wrap, path;
-
- rb_scan_args(argc, argv, "11", &fname, &wrap);
- path = rb_find_file(FilePathValue(fname));
- if (!path) {
- if (!rb_file_load_ok(RSTRING_PTR(fname)))
- load_failed(fname);
- path = fname;
- }
- rb_load_internal(path, RTEST(wrap));
- return Qtrue;
-}
-
-static char *
-load_lock(const char *ftptr)
-{
- st_data_t data;
- st_table *loading_tbl = get_loading_table();
-
- if (!loading_tbl || !st_lookup(loading_tbl, (st_data_t)ftptr, &data)) {
- /* loading ruby library should be serialized. */
- if (!loading_tbl) {
- GET_VM()->loading_table = loading_tbl = st_init_strtable();
- }
- /* partial state */
- ftptr = ruby_strdup(ftptr);
- data = (st_data_t)rb_barrier_new();
- st_insert(loading_tbl, (st_data_t)ftptr, data);
- return (char *)ftptr;
- }
- if (RTEST(ruby_verbose)) {
- rb_warning("loading in progress, circular require considered harmful - %s", ftptr);
- rb_backtrace();
- }
- return RTEST(rb_barrier_wait((VALUE)data)) ? (char *)ftptr : 0;
-}
-
-static void
-load_unlock(const char *ftptr, int done)
-{
- if (ftptr) {
- st_data_t key = (st_data_t)ftptr;
- st_data_t data;
- st_table *loading_tbl = get_loading_table();
-
- if (st_delete(loading_tbl, &key, &data)) {
- VALUE barrier = (VALUE)data;
- xfree((char *)key);
- if (done)
- rb_barrier_destroy(barrier);
- else
- rb_barrier_release(barrier);
- }
- }
-}
-
-
-/*
- * call-seq:
- * require(string) => true or false
- *
- * Ruby tries to load the library named _string_, returning
- * +true+ if successful. If the filename does not resolve to
- * an absolute path, it will be searched for in the directories listed
- * in <code>$:</code>. If the file has the extension ``.rb'', it is
- * loaded as a source file; if the extension is ``.so'', ``.o'', or
- * ``.dll'', or whatever the default shared library extension is on
- * the current platform, Ruby loads the shared library as a Ruby
- * extension. Otherwise, Ruby tries adding ``.rb'', ``.so'', and so on
- * to the name. The name of the loaded feature is added to the array in
- * <code>$"</code>. A feature will not be loaded if its name already
- * appears in <code>$"</code>. The file name is converted to an absolute
- * path, so ``<code>require 'a'; require './a'</code>'' will not load
- * <code>a.rb</code> twice.
- *
- * require "my-library.rb"
- * require "db-driver"
- */
-
-VALUE
-rb_f_require(VALUE obj, VALUE fname)
-{
- return rb_require_safe(fname, rb_safe_level());
-}
-
-static int
-search_required(VALUE fname, volatile VALUE *path, int safe_level)
-{
- VALUE tmp;
- char *ext, *ftptr;
- int type, ft = 0;
- const char *loading;
-
- *path = 0;
- ext = strrchr(ftptr = RSTRING_PTR(fname), '.');
- if (ext && !strchr(ext, '/')) {
- if (IS_RBEXT(ext)) {
- if (rb_feature_p(ftptr, ext, Qtrue, Qfalse, &loading)) {
- if (loading) *path = rb_str_new2(loading);
- return 'r';
- }
- if ((tmp = rb_find_file_safe(fname, safe_level)) != 0) {
- ext = strrchr(ftptr = RSTRING_PTR(tmp), '.');
- if (!rb_feature_p(ftptr, ext, Qtrue, Qtrue, &loading) || loading)
- *path = tmp;
- return 'r';
- }
- return 0;
- }
- else if (IS_SOEXT(ext)) {
- if (rb_feature_p(ftptr, ext, Qfalse, Qfalse, &loading)) {
- if (loading) *path = rb_str_new2(loading);
- return 's';
- }
- tmp = rb_str_new(RSTRING_PTR(fname), ext - RSTRING_PTR(fname));
-#ifdef DLEXT2
- OBJ_FREEZE(tmp);
- if (rb_find_file_ext_safe(&tmp, loadable_ext + 1, safe_level)) {
- ext = strrchr(ftptr = RSTRING_PTR(tmp), '.');
- if (!rb_feature_p(ftptr, ext, Qfalse, Qtrue, &loading) || loading)
- *path = tmp;
- return 's';
- }
-#else
- rb_str_cat2(tmp, DLEXT);
- OBJ_FREEZE(tmp);
- if ((tmp = rb_find_file_safe(tmp, safe_level)) != 0) {
- ext = strrchr(ftptr = RSTRING_PTR(tmp), '.');
- if (!rb_feature_p(ftptr, ext, Qfalse, Qtrue, &loading) || loading)
- *path = tmp;
- return 's';
- }
-#endif
- }
- else if (IS_DLEXT(ext)) {
- if (rb_feature_p(ftptr, ext, Qfalse, Qfalse, &loading)) {
- if (loading) *path = rb_str_new2(loading);
- return 's';
- }
- if ((tmp = rb_find_file_safe(fname, safe_level)) != 0) {
- ext = strrchr(ftptr = RSTRING_PTR(tmp), '.');
- if (!rb_feature_p(ftptr, ext, Qfalse, Qtrue, &loading) || loading)
- *path = tmp;
- return 's';
- }
- }
- }
- else if ((ft = rb_feature_p(ftptr, 0, Qfalse, Qfalse, &loading)) == 'r') {
- if (loading) *path = rb_str_new2(loading);
- return 'r';
- }
- tmp = fname;
- type = rb_find_file_ext_safe(&tmp, loadable_ext, safe_level);
- switch (type) {
- case 0:
- if (ft)
- break;
- ftptr = RSTRING_PTR(tmp);
- return rb_feature_p(ftptr, 0, Qfalse, Qtrue, 0);
-
- default:
- if (ft)
- break;
- case 1:
- ext = strrchr(ftptr = RSTRING_PTR(tmp), '.');
- if (rb_feature_p(ftptr, ext, !--type, Qtrue, &loading) && !loading)
- break;
- *path = tmp;
- }
- return type ? 's' : 'r';
-}
-
-static void
-load_failed(VALUE fname)
-{
- rb_raise(rb_eLoadError, "no such file to load -- %s",
- RSTRING_PTR(fname));
-}
-
-static VALUE
-load_ext(VALUE path)
-{
- VALUE result;
-
- SCOPE_SET(NOEX_PUBLIC);
-#if defined DLN_NEEDS_ALT_SEPARATOR && DLN_NEEDS_ALT_SEPARATOR
- translit_char(RSTRING_PTR(path), '/', '\\');
-#endif
- result = (VALUE)dln_load(RSTRING_PTR(path));
-#if defined DLN_NEEDS_ALT_SEPARATOR && DLN_NEEDS_ALT_SEPARATOR
- translit_char(RSTRING_PTR(path), '\\', '/');
-#endif
- return result;
-}
-
-VALUE
-rb_require_safe(VALUE fname, int safe)
-{
- volatile VALUE result = Qnil;
- rb_thread_t *th = GET_THREAD();
- volatile VALUE errinfo = th->errinfo;
- int state;
- struct {
- int safe;
- } volatile saved;
- char *volatile ftptr = 0;
-
- PUSH_TAG();
- saved.safe = rb_safe_level();
- if ((state = EXEC_TAG()) == 0) {
- VALUE path;
- long handle;
- int found;
-
- rb_set_safe_level_force(safe);
- FilePathValue(fname);
- rb_set_safe_level_force(0);
- found = search_required(fname, &path, safe);
- if (found) {
- if (!path || !(ftptr = load_lock(RSTRING_PTR(path)))) {
- result = Qfalse;
- }
- else {
- switch (found) {
- case 'r':
- rb_load_internal(path, 0);
- break;
-
- case 's':
- handle = (long)rb_vm_call_cfunc(rb_vm_top_self(), load_ext,
- path, 0, path);
- rb_ary_push(ruby_dln_librefs, LONG2NUM(handle));
- break;
- }
- rb_provide_feature(path);
- result = Qtrue;
- }
- }
- }
- POP_TAG();
- load_unlock(ftptr, !state);
-
- rb_set_safe_level_force(saved.safe);
- if (state) {
- JUMP_TAG(state);
- }
-
- if (NIL_P(result)) {
- load_failed(fname);
- }
-
- th->errinfo = errinfo;
-
- return result;
-}
-
-VALUE
-rb_require(const char *fname)
-{
- VALUE fn = rb_str_new2(fname);
- OBJ_FREEZE(fn);
- return rb_require_safe(fn, rb_safe_level());
-}
-
-static VALUE
-init_ext_call(VALUE arg)
-{
- SCOPE_SET(NOEX_PUBLIC);
- (*(void (*)(void))arg)();
- return Qnil;
-}
-
-void
-ruby_init_ext(const char *name, void (*init)(void))
-{
- if (load_lock(name)) {
- rb_vm_call_cfunc(rb_vm_top_self(), init_ext_call, (VALUE)init,
- 0, rb_str_new2(name));
- rb_provide(name);
- load_unlock(name, 1);
- }
-}
-
-/*
- * call-seq:
- * mod.autoload(module, filename) => nil
- *
- * Registers _filename_ to be loaded (using <code>Kernel::require</code>)
- * the first time that _module_ (which may be a <code>String</code> or
- * a symbol) is accessed in the namespace of _mod_.
- *
- * module A
- * end
- * A.autoload(:B, "b")
- * A::B.doit # autoloads "b"
- */
-
-static VALUE
-rb_mod_autoload(VALUE mod, VALUE sym, VALUE file)
-{
- ID id = rb_to_id(sym);
-
- FilePathValue(file);
- rb_autoload(mod, id, RSTRING_PTR(file));
- return Qnil;
-}
-
-/*
- * MISSING: documentation
- */
-
-static VALUE
-rb_mod_autoload_p(VALUE mod, VALUE sym)
-{
- return rb_autoload_p(mod, rb_to_id(sym));
-}
-
-/*
- * call-seq:
- * autoload(module, filename) => nil
- *
- * Registers _filename_ to be loaded (using <code>Kernel::require</code>)
- * the first time that _module_ (which may be a <code>String</code> or
- * a symbol) is accessed.
- *
- * autoload(:MyModule, "/usr/local/lib/modules/my_module.rb")
- */
-
-static VALUE
-rb_f_autoload(VALUE obj, VALUE sym, VALUE file)
-{
- VALUE klass = rb_vm_cbase();
- if (NIL_P(klass)) {
- rb_raise(rb_eTypeError, "Can not set autoload on singleton class");
- }
- return rb_mod_autoload(klass, sym, file);
-}
-
-/*
- * MISSING: documentation
- */
-
-static VALUE
-rb_f_autoload_p(VALUE obj, VALUE sym)
-{
- /* use rb_vm_cbase() as same as rb_f_autoload. */
- VALUE klass = rb_vm_cbase();
- if (NIL_P(klass)) {
- return Qnil;
- }
- return rb_mod_autoload_p(klass, sym);
-}
-
-void
-Init_load()
-{
-#undef rb_intern
-#define rb_intern(str) rb_intern2(str, strlen(str))
- rb_vm_t *vm = GET_VM();
- static const char var_load_path[] = "$:";
- ID id_load_path = rb_intern2(var_load_path, sizeof(var_load_path)-1);
-
- rb_define_hooked_variable(var_load_path, (VALUE*)vm, load_path_getter, rb_gvar_readonly_setter);
- rb_alias_variable(rb_intern("$-I"), id_load_path);
- rb_alias_variable(rb_intern("$LOAD_PATH"), id_load_path);
- vm->load_path = rb_ary_new();
-
- rb_define_virtual_variable("$\"", get_loaded_features, 0);
- rb_define_virtual_variable("$LOADED_FEATURES", get_loaded_features, 0);
- vm->loaded_features = rb_ary_new();
-
- rb_define_global_function("load", rb_f_load, -1);
- rb_define_global_function("require", rb_f_require, 1);
- rb_define_method(rb_cModule, "autoload", rb_mod_autoload, 2);
- rb_define_method(rb_cModule, "autoload?", rb_mod_autoload_p, 1);
- rb_define_global_function("autoload", rb_f_autoload, 2);
- rb_define_global_function("autoload?", rb_f_autoload_p, 1);
-
- ruby_dln_librefs = rb_ary_new();
- rb_gc_register_mark_object(ruby_dln_librefs);
-}
diff --git a/main.c b/main.c
index a782939ff3..bee9a4b15b 100644
--- a/main.c
+++ b/main.c
@@ -3,35 +3,49 @@
main.c -
$Author$
+ $Date$
created at: Fri Aug 19 13:19:58 JST 1994
- Copyright (C) 1993-2007 Yukihiro Matsumoto
+ Copyright (C) 1993-2003 Yukihiro Matsumoto
**********************************************************************/
-#undef RUBY_EXPORT
#include "ruby.h"
-#include "debug.h"
-#ifdef HAVE_LOCALE_H
-#include <locale.h>
+
+#ifdef __human68k__
+int _stacksize = 262144;
+#endif
+
+#if defined __MINGW32__
+int _CRT_glob = 0;
#endif
-RUBY_GLOBAL_SETUP
+#if defined(__MACOS__) && defined(__MWERKS__)
+#include <console.h>
+#endif
+
+/* to link startup code with ObjC support */
+#if (defined(__APPLE__) || defined(__NeXT__)) && defined(__MACH__)
+static void objcdummyfunction( void ) { objc_msgSend(); }
+#endif
int
-main(int argc, char **argv)
+main(argc, argv, envp)
+ int argc;
+ char **argv, **envp;
{
-#ifdef RUBY_DEBUG_ENV
- ruby_set_debug_option(getenv("RUBY_DEBUG"));
+#ifdef _WIN32
+ NtInitialize(&argc, &argv);
#endif
-#ifdef HAVE_LOCALE_H
- setlocale(LC_CTYPE, "");
+#if defined(__MACOS__) && defined(__MWERKS__)
+ argc = ccommand(&argv);
#endif
- ruby_sysinit(&argc, &argv);
{
- RUBY_INIT_STACK;
- ruby_init();
- return ruby_run_node(ruby_options(argc, argv));
+ RUBY_INIT_STACK
+ ruby_init();
+ ruby_options(argc, argv);
+ ruby_run();
}
+ return 0;
}
diff --git a/man/erb.1 b/man/erb.1
deleted file mode 100644
index 87a0a6fca4..0000000000
--- a/man/erb.1
+++ /dev/null
@@ -1,158 +0,0 @@
-.\"Ruby is copyrighted by Yukihiro Matsumoto <matz@netlab.jp>.
-.Dd December 27, 2008
-.Dt ERB(1) "" "Ruby Programmers Reference Guide"
-.Os UNIX
-.Sh NAME
-.Nm erb
-.Nd Ruby Templating
-.Sh SYNOPSIS
-.Nm
-.Op Fl -version
-.Op Fl UPdnvx
-.Op Fl E Ar ext Ns Op Ns : Ns int
-.Op Fl S Ar level
-.Op Fl T Ar mode
-.Op Fl r Ar library
-.Op Fl -
-.Op file ...
-.Pp
-.Sh DESCRIPTION
-.Nm
-is a command line front-end for
-.Li "ERB"
-library, which is an implementation of eRuby.
-
-eRuby provdes an easy to use but powerful templating system for Ruby.
-Using eRuby, actual Ruby code can be added to any plain text document for the
-purposes of generating document information details and/or flow control.
-
-.Nm
-is a part of
-.Nm Ruby .
-.Pp
-.Sh OPTIONS
-.Bl -tag -width "1234567890123" -compact
-.Pp
-.It Fl -version
-Prints the version of
-.Nm .
-.Pp
-.It Fl E Ar external Ns Op : Ns Ar internal
-.It Fl -encoding Ar external Ns Op : Ns Ar internal
-Specifies the default value(s) for external encodings and internal encoding. Values should be separated with colon (:).
-
-You can ommit the one for internal encodings, then the value
-.Pf ( Li "Encoding.default_internal" ) will be nil.
-.Pp
-.It Fl P
-Evaluates lines starting with
-.Li "%"
-as Ruby code and removes the tailing EOLs.
-.Pp
-.It Fl S Ar level
-Specifies the safe level in which eRuby script will run.
-.Pp
-.It Fl T Ar mode
-Specifies trim mode (default 0).
-.Ar mode
-can be one of
-.Bl -hang -offset indent
-.It Sy 0
-EOL remains after the embedded ruby script is evaluated.
-.Pp
-.It Sy 1
-EOL is removed if the line ends with
-.Li "%>" .
-.Pp
-.It Sy 2
-EOL is removed if the line starts with
-.Li "<%"
-and ends with
-.Li "%>" .
-.Pp
-.It Sy -
-EOL is removed if the line ends with
-.Li "-%>" .
-And leading whitespaces are removed if the erb directive starts with
-.Li "<%-" .
-.Pp
-.El
-.Pp
-.It Fl U
-can be one of
-Sets the defalut value for internal encodings
-.Pf ( Li "Encoding.default_internal" ) to UTF-8.
-.Pp
-.It Fl d
-.It Fl -debug
-Turns on debug mode.
-.Li "$DEBUG"
-will be set to true.
-.Pp
-.It Fl h
-.It Fl -help
-Prints a summry of the options.
-.Pp
-.It Fl n
-Used with
-.Fl x .
-Prepends the line number to each line in the output.
-.Pp
-.It Fl v
-Enables verbose mode.
-.Li "$VERBOSE"
-will be set to true.
-.Pp
-.It Fl x
-Converts the eRuby script into Ruby script and prints it without line numbers.
-.Pp
-.El
-.Pp
-.Sh EXAMPLES
-Here is an eRuby script
-.Bd -literal -offset indent
-<?xml version="1.0" ?>
-<% require 'prime' -%>
-<erb-example>
- <calc><%= 1+1 %></calc>
- <var><%= __FILE__ %></var>
- <library><%= Prime.each(10).to_a.join(", ") %></library>
-</erb-example>
-.Ed
-
-Command
-.Dl "% erb -T - example.erb"
-prints
-.Bd -literal -offset indent
-<?xml version="1.0" ?>
-<erb-example>
- <calc>2</calc>
- <var>example.erb</var>
- <library>2, 3, 5, 7</library>
-</erb-example>
-.Ed
-.Pp
-.Sh SEE ALSO
-.Xr ruby 1 .
-
-And see
-.Xr ri 1
-documentation for
-.Li "ERB"
-class.
-.El
-.Pp
-.Sh REPORTING BUGS
-.Bl -bullet
-.Li Security vulnerabilities should be reported via an email to
-.Aq security@ruby-lang.org Ns
-.Li .
-Reported problems will be published after fixed.
-.Pp
-.Li And you can report other bugs and feature requests via the
-Ruby Issue Tracking System (http://redmine.ruby-lang.org).
-Do not report security vulnerabilities
-via the system because it publishes the vulnerabilities immedately.
-.El
-.Sh AUTHORS
-Written by Masatoshi SEKI.
diff --git a/man/goruby.1 b/man/goruby.1
deleted file mode 100644
index f69b951a06..0000000000
--- a/man/goruby.1
+++ /dev/null
@@ -1,39 +0,0 @@
-.\"Ruby is copyrighted by Yukihiro Matsumoto <matz@netlab.jp>.
-.Dd October 25, 2008
-.Dt GORUBY(1) "" "Ruby Programmers Reference Guide"
-.Os UNIX
-.Sh NAME
-.Nm goruby
-.Nd Code-golfer's best friend
-.Sh SYNOPSIS
-.Nm
-.Op options ...
-.Op Fl -
-.Op Ar program_file
-.Op Ar argument ...
-.Sh DESCRIPTION
-.Sy goruby
-is a kind of Ruby language processor
-which recognizes extremely shorten programs as bellow;
-.Bd -literal -offset indent
-rq"date";s De.td
-.Ed
-.Pp
-This means
-.Bd -literal -offset indent
-require"date";puts Date.today
-.Ed
-.Pp
-.Sh OPTIONS
-.Sy goruby
-takes same options as
-.Xr ruby 1 .
-.Sh SEE ALSO
-.Bl -hang -compact -width "ruby(1)"
-.It Xr ruby 1
-The stiff version of Ruby interpreter.
-.El
-.Pp
-.Sh AUTHORS
-Originally written by Nobuyoshi Nakada and developed by
-Ruby core team.
diff --git a/man/irb.1 b/man/irb.1
deleted file mode 100644
index 20e97e32f7..0000000000
--- a/man/irb.1
+++ /dev/null
@@ -1,173 +0,0 @@
-.\"Ruby is copyrighted by Yukihiro Matsumoto <matz@netlab.jp>.
-.Dd October 25, 2008
-.Dt IRB(1) "" "Ruby Programmers Reference Guide"
-.Os UNIX
-.Sh NAME
-.Nm irb
-.Nd Interactive Ruby Shell
-.Sh SYNOPSIS
-.Nm
-.Op Fl -version
-.Op Fl dfm
-.Op Fl I Ar directory
-.Op Fl r Ar library
-.Op Fl - Ns Oo no Oc Ns inspect
-.Op Fl - Ns Oo no Oc Ns readline
-.Op Fl -prompt Ar mode
-.Op Fl -prompt-mode Ar mode
-.Op Fl -inf-ruby-mode
-.Op Fl -simple-prompt
-.Op Fl -noprompt
-.Op Fl -tracer
-.Op Fl -back-trace-limit Ar n
-.Op Fl -irb_debug Ar n
-.Op Fl -
-.Op program_file
-.Op argument ...
-.Pp
-.Sh DESCRIPTION
-.Nm
-is the REPL(read-eval&print loop) environment for Ruby programs.
-.Pp
-.Sh OPTIONS
-.Bl -tag -width "1234567890123" -compact
-.Pp
-.It Fl -version
-Prints the version of
-.Nm .
-.Pp
-.It Fl E Ar external Ns Op : Ns Ar internal
-.It Fl -encoding Ar external Ns Op : Ns Ar internal
-Same as `ruby -E' .
-Specifies the default value(s) for external encodings and internal encoding. Values should be separated with colon (:).
-
-You can ommit the one for internal encodings, then the value
-.Pf ( Li "Encoding.default_internal" ) will be nil.
-.Pp
-.It Fl I Ar path
-Same as `ruby -I' .
-Specifies
-.Li $LOAD_PATH
-directory
-.Pp
-.It Fl U
-Same as `ruby -U' .
-Sets the defalut value for internal encodings
-.Pf ( Li "Encoding.default_internal" ) to UTF-8.
-.Pp
-.It Fl d
-Same as `ruby -d' .
-Sets
-.Li $DEBUG
-to true.
-.Pp
-.It Fl f
-Suppresses read of
-.Pa ~/.irbrc .
-.Pp
-.It Fl h
-.It Fl -help
-Prints a summary of the options.
-.Pp
-.It Fl m
-Bc mode (load mathn, fraction or matrix are available)
-.Pp
-.It Fl r Ar library
-Same as `ruby -r'.
-Causes irb to load the library using require.
-.Pp
-.It Fl -inspect
-Uses `inspect' for output (default except for bc mode)
-.Pp
-.It Fl -noinspect
-Doesn't use inspect for output
-.Pp
-.It Fl -readline
-Uses Readline extension module.
-.Pp
-.It Fl -noreadline
-Doesn't use Readline extension module.
-.Pp
-.It Fl -prompt Ar mode
-.It Fl -prompt-mode Ar mode
-Switch prompt mode. Pre-defined prompt modes are
-`default', `simple', `xmp' and `inf-ruby'.
-.Pp
-.It Fl -inf-ruby-mode
-Uses prompt appropriate for inf-ruby-mode on emacs.
-Suppresses --readline.
-.Pp
-.It Fl -simple-prompt
-Makes prompts simple.
-.Pp
-.It Fl -noprompt
-No prompt mode.
-.Pp
-.It Fl -tracer
-Displays trace for each execution of commands.
-.Pp
-.It Fl -back-trace-limit Ar n
-Displays backtrace top
-.Ar n
-and tail
-.Ar n Ns .
-The default value is 16.
-.Pp
-.It Fl -irb_debug Ar n
-Sets internal debug level to n (not for popular use)
-.Pp
-.El
-.Pp
-.Sh ENVIRONMENT
-.Bl -tag -width "RUBYLIB_PREFIX" -compact
-.It Ev IRBRC
-.Pp
-.El
-.Pp
-Also
-.Nm
-depends on same variables as
-.Xr ruby 1 .
-.Pp
-.Sh FILES
-.Bl -tag -width "RUBYLIB_PREFIX" -compact
-.It Pa ~/.irbrc
-Personal irb initialization.
-.Pp
-.El
-.Pp
-.Sh EXAMPLES
-.Dl % irb
-.Dl irb(main):001:0> Ic 1 + 1
-.Dl 2
-.Dl irb(main):002:0> Ic def t(x)
-.Dl irb(main):003:1> Ic x+1
-.Dl irb(main):004:1> Ic end
-.Dl => nil
-.Dl irb(main):005:0> Ic t(3)
-.Dl => 4
-.Dl irb(main):006:0> Ic if t(3) == 4
-.Dl irb(main):007:1> Ic p :ok
-.Dl irb(main):008:1> Ic end
-.Dl :ok
-.Dl => :ok
-.Dl irb(main):009:0> Ic quit
-.Dl %
-.Pp
-.Sh SEE ALSO
-.Xr ruby 1 .
-.Pp
-.Sh REPORTING BUGS
-.Bl -bullet
-.Li Security vulnerabilities should be reported via an email to
-.Aq security@ruby-lang.org Ns
-.Li .
-Reported problems will be published after fixed.
-.Pp
-.Li And you can report other bugs and feature requests via the
-Ruby Issue Tracking System (http://redmine.ruby-lang.org).
-Do not report security vulnerabilities
-via the system because it publishes the vulnerabilities immedately.
-.El
-.Sh AUTHORS
-Written by Keiju ISHITSUKA.
diff --git a/man/rake.1 b/man/rake.1
deleted file mode 100644
index 3872026bf1..0000000000
--- a/man/rake.1
+++ /dev/null
@@ -1,169 +0,0 @@
-.Dd November 30, 2008
-.Dt RAKE(1) "" "Ruby Programmers Reference Guide"
-.Os UNIX
-.Sh NAME
-.Nm rake
-.Nd Ruby Make
-.Sh SYNOPSIS
-.Nm
-.Op Fl -f Ar Rakefile
-.Op Fl -version
-.Op Fl CGNPgnqstv
-.Op Fl D Op Ar PATTERN
-.Op Fl E Ar CODE
-.Op Fl I Ar LIBDIR
-.Op Fl R Ar RAKELIBDIR
-.Op Fl T Op Ar PATTERN
-.Op Fl e Ar CODE
-.Op Fl p Ar CODE
-.Op Fl r Ar MODULE
-.Op Fl -rules
-.Op Ar variable Ns = Ns Ar value
-.Ar target ...
-.Sh DESCRIPTION
-.Nm Rake
-is a simple
-.Xr ruby 1
-build program with capabilities similar to the regular
-.Xr make 1
-command.
-
-.Nm Rake
-has the following features:
-.Bl -bullet
-.It
-Rakefiles (Rake's version of Makefiles) are completely defined in standard Ruby syntax.
-No XML files to edit. No quirky Makefile syntax to worry about (is that a tab or a space?).
-.It
-Users can specify tasks with prerequisites.
-.It
-Rake supports rule patterns to sythesize implicit tasks.
-.It
-Flexible FileLists that act like arrays but know about manipulating file names and paths.
-.It
-A library of prepackaged tasks to make building rakefiles easier.
-.El
-.Pp
-.Sh OPTIONS
-.Bl -tag -width "--execute-continue" -compact
-.Pp
-.It Fl -version
-Display the program version.
-.Pp
-.It Fl C
-.It Fl -classic-namespace
-Put Task and FileTask in the top level namespace
-.Pp
-.It Fl D Op Ar PATTERN
-.It Fl -describe Op Ar PATTERN
-Describe the tasks (matching optional
-.Ar PATTERN Ns
-), then exit.
-.Pp
-.It Fl E Ar CODE
-.It Fl -execute-continue Ar CODE
-Execute some Ruby code, then continue with normal task processing.
-.Pp
-.It Fl G
-.It Fl -no-system
-.It Fl -nosystem
-Use standard project Rakefile search paths, ignore system wide rakefiles.
-.Pp
-.It Fl I Ar LIBDIR
-.It Fl -libdir Ar LIBDIR
-Include
-.Ar LIBDIR
-in the search path for required modules.
-.Pp
-.It Fl N
-.It Fl -no-search
-.It Fl -nosearch
-Do not search parent directories for the Rakefile.
-.Pp
-.It Fl P
-.It Fl -prereqs
-Display the tasks and dependencies, then exit.
-.Pp
-.It Fl R Ar RAKELIBDIR
-.It Fl -rakelib Ar RAKELIBDIR
-.It Fl -rakelibdir Ar RAKELIBDIR
-Auto-import any .rake files in
-.Ar RAKELIBDIR .
-(default is
-.Pa rakelib
-)
-.Pp
-.It Fl T Op Ar PATTERN
-.It Fl -tasks Op Ar PATTERN
-Display the tasks (matching optional
-.Ar PATTERN Ns
-) with descriptions, then exit.
-.Pp
-.It Fl e Ar CODE
-.It Fl -execute Ar CODE
-Execute some Ruby code and exit.
-.Pp
-.It Fl f Ar FILE
-.It Fl -rakefile Ar FILE
-Use FILE as the rakefile.
-.Pp
-.It Fl h
-.It Fl -help
-Prints a summary of options.
-.Pp
-.It Fl g
-.It Fl -system
-Using system wide (global) rakefiles (usually
-.Pa ~/.rake/*.rake
-).
-.Pp
-.It Fl n
-.It Fl -dry-run
-Do a dry run without executing actions.
-.Pp
-.It Fl p Ar CODE
-.It Fl -execute-print Ar CODE
-Execute some Ruby code, print the result, then exit.
-.Pp
-.It Fl q
-.It Fl -quiet
-Do not log messages to standard output.
-.Pp
-.It Fl r Ar MODULE
-.It Fl -require Ar MODULE
-Require MODULE before executing rakefile.
-.Pp
-.It Fl s
-.It Fl -silent
-Like
-.Fl -quiet ,
-but also suppresses the 'in directory' announcement.
-.Pp
-.It Fl t
-.It Fl -trace
-Turn on invoke/execute tracing, enable full backtrace.
-.Pp
-.It Fl v
-.It Fl -verbose
-Log message to standard output (default).
-.Pp
-.It Fl -rules
-Trace the rules resolution.
-.Pp
-.El
-.Pp
-.Sh SEE ALSO
-.Xr ruby 1
-.Xr make 1
-.Pp
-http://rake.rubyforge.org/
-.Sh REPORTING BUGS
-Bugs, features requests and other issues can be logged at
-<\fBhttp://onestepback.org/redmine/projects/show/rake\fR>.
-.Pp
-You will need an account to before you can post issues. Register at <\fBhttp://onestepback.org/redmine/account/register\fR>.
-Or you can send an email to the author.
-.Sh AUTHOR
-.Nm Rake
-is written by
-.An Jim Weirich Aq jim@weirichhouse.org
diff --git a/man/ri.1 b/man/ri.1
deleted file mode 100644
index f414adb559..0000000000
--- a/man/ri.1
+++ /dev/null
@@ -1,180 +0,0 @@
-.\"Ruby is copyrighted by Yukihiro Matsumoto <matz@netlab.jp>.
-.Dd December 29, 2008
-.Dt RI(1) "" "Ruby Programmers Reference Guide"
-.Os UNIX
-.Sh NAME
-.Nm ri
-.Nd Ruby API reference front end
-.Sh SYNOPSIS
-.Nm
-.Op Fl Ti
-.Op Fl d Ar directory
-.Op Fl f Ar format
-.Op Fl -list-doc-dirs
-.Op Fl -no-standard-docs
-.Op Fl - Ns Oo Cm no- Oc Ns Cm Bro Cm system Ns | Ns Cm site Ns | Ns Cm gems Ns | Ns Cm home Brc
-.Op Fl - Ns Oo Cm no- Oc Ns Cm use-cache
-.Op Fl -width Ns = Ns Ar width
-.Op Ar target ...
-.Sh DESCRIPTION
-.Nm
-is a CUI front end for the Ruby API reference.
-You can search and read API reference for classes and methods with
-.Nm .
-
-.Nm
-is a part of Ruby.
-
-.Ar target
-can be one of the following forms:
-.Bl -diag -offset indent
-.It Class
-for classes
-.It Class::method
-for class methods
-.It Class#method
-for instance methods
-.It Class.method
-for both class and instance methods
-.It method
-for both class and instance methods
-.El
-
-All class names may be abbreviated to their minimum unambiguous form. If a name
-is ambiguous, all valid options will be listed.
-
-For example:
-.Bd -literal -offset indent
-ri Fil
-ri File
-ri File.new
-ri zip
-.Ed
-
-Note that shell quoting may be required for method names containing
-punctuation:
-.Bd -literal -offset indent
-ri 'Array.[]'
-ri compact\!
-.Ed
-.Sh OPTIONS
-.Bl -tag -width "1234567890123" -compact
-.Pp
-.It Fl -version
-Prints the version of
-.Nm .
-.Pp
-.It Fl T
-.It Fl -no-pager
-Send output directly to stdout, rather than to a pager.
-.Pp
-.It Fl d Ar directory
-.It Fl -doc-dir Ns = Ns Ar directory
-List of directories from which to source documentation in addition to the standard
-directories. May be repeated.
-.Pp
-.It Fl f Ar FORMAT
-.It Fl -fmt Ar FORMAT
-.It Fl -format Ns = Ns FORMAT
-Format to use when displaying output:
-.Dd ansi, bs, html, plain, simple
-.Pp
-Use 'bs' (backspace) with most pager programs. To use ANSI, either disable the
-pager or tell the pager to allow control characters.
-.Pp
-.It Fl i
-.It Fl -interactive
-This makes
-.Nm
-go into interactive mode.
-.Pp
-When
-.Nm
-is in interactive mode it will allow the user to disambiguate lists of
-methods in case multiple methods match against a method search string. It also
-will allow the user to enter in a method name (with auto-completion, if readline
-is supported) when viewing a class.
-.Pp
-.It Fl -list-doc-dirs
-List the directories from which ri will source documentation on stdout and exit.
-.Pp
-.It Fl -no-standard-docs
-Do not include documentation from the Ruby standard library,
-.Pa site_lib ,
-installed gems, or
-.Pa ~/.rdoc .
-
-Equivalent to specifying the options
-.Fl -no-system , Fl -no-site , Fl -no-gems ,
-and
-.Fl -no-home .
-.Pp
-.It Fl - Ns Oo Cm no- Oc Ns Cm system
-Include documentation from Ruby's standard library. Defaults to true.
-.Pp
-.It Fl - Ns Oo Cm no- Oc Ns Cm site
- Include documentation from libraries installed in site_lib. Defaults to true.
-.Pp
-.It Fl - Ns Oo Cm no- Oc Ns Cm gems
-Include documentation from RubyGems. Defaults to true.
-.Pp
-.It Fl - Ns Oo Cm no- Oc Ns Cm home
-Include documentation stored in ~/.rdoc. Defaults to true.
-.Pp
-.It Fl - Ns Oo Cm no- Oc Ns Cm use-cache
-Whether or not to use
-.Nm Ns
-.Ns 's cache. True by default.
-.Pp
-.It Fl w Ar width
-.It Fl -width Ns = Ns Ar width
-Set the width of the output.
-.Pp
-.El
-.Pp
-.Sh ENVIRONMENT
-.Bl -tag -width "USERPROFILE" -compact
-.Pp
-.It Ev RI
-Additional options.
-.Pp
-.It Ev PAGER
-Used as the name of pager program for displaying.
-.Pp
-.It Ev HOME
-.It Ev USERPROFILE
-.It Ev HOMEPATH
-Path to user's home directory.
-.El
-.Pp
-.Sh FILES
-.Bl -tag -width "USERPROFILE" -compact
-.Pp
-.It Pa ~/.ri
-Caches recently referenced documents here.
-.Pp
-.It Pa ~/.rdoc
-Searches user-wide documents here.
-.Pp
-.El
-.Pp
-.Sh SEE ALSO
-.Xr ruby 1
-.Xr rdoc 1
-.Xr gem 1
-.Pp
-.Sh REPORTING BUGS
-.Bl -bullet
-.Li Security vulnerabilities should be reported via an email to
-.Aq security@ruby-lang.org Ns
-.Li .
-Reported problems will be published after fixed.
-.Pp
-.Li And you can report other bugs and feature requests via the
-Ruby Issue Tracking System (http://redmine.ruby-lang.org).
-Do not report security vulnerabilities
-via the system because it publishes the vulnerabilities immedately.
-.El
-.Sh AUTHORS
-Written by Dave Thomas
-.Aq dave@pragmaticprogrammer.com
diff --git a/man/ruby.1 b/man/ruby.1
deleted file mode 100644
index e2d0abdefd..0000000000
--- a/man/ruby.1
+++ /dev/null
@@ -1,511 +0,0 @@
-.\"Ruby is copyrighted by Yukihiro Matsumoto <matz@netlab.jp>.
-.Dd October 25, 2008
-.Dt RUBY(1) "" "Ruby Programmers Reference Guide"
-.\".Dt RUBY 1
-.Os UNIX
-.Sh NAME
-.Nm ruby
-.Nd Interpreted object-oriented scripting language
-.Sh SYNOPSIS
-.Nm
-.Op Fl -copyright
-.Op Fl -version
-.Op Fl SUacdlnpswvy
-.Op Fl 0 Ns Op Ar octal
-.Op Fl C Ar directory
-.Op Fl E Ar external Ns Op : Ns Ar internal
-.Op Fl F Ar pattern
-.Op Fl I Ar directory
-.Op Fl K Ar c
-.Op Fl T Ns Op Ar level
-.Op Fl W Ns Op Ar level
-.Op Fl e Ar command
-.Op Fl i Ns Op Ar extension
-.Op Fl r Ar library
-.Op Fl x Ns Op Ar directory
-.Op - Ns Bro Cm enable Ns | Ns Cm disable Brc Ns - Ns Ar FEATURE
-.Op Fl -dump Ns = Ns Ar target
-.Op Fl -verbose
-.Op Fl -
-.Op Ar program_file
-.Op Ar argument ...
-.Sh DESCRIPTION
-Ruby is an 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.
-.Pp
-If you want a language for easy object-oriented programming, or you
-don't like the Perl ugliness, or you do like the concept of LISP, but
-don't like too much parentheses, Ruby may be the language of your
-choice.
-.Sh FEATURES
-Ruby's features are as follows:
-.Bl -tag -width 6n
-.It Sy "Interpretive"
-Ruby is an interpreted language, so you don't have to recompile
-programs written in Ruby to execute them.
-.Pp
-.It Sy "Variables have no type (dynamic typing)"
-Variables in Ruby can contain data of any type. You don't have to
-worry about variable typing. Consequently, it has a weaker compile
-time check.
-.Pp
-.It Sy "No declaration needed"
-You can use variables in your Ruby programs without any declarations.
-Variable names denote their scope, local, global, instance, etc.
-.Pp
-.It Sy "Simple syntax"
-Ruby has a simple syntax influenced slightly from Eiffel.
-.Pp
-.It Sy "No user-level memory management"
-Ruby has automatic memory management. Objects no longer referenced
-from anywhere are automatically collected by the garbage collector
-built into the interpreter.
-.Pp
-.It Sy "Everything is an object"
-Ruby is the purely object-oriented language, and was so since its
-creation. Even such basic data as integers are seen as objects.
-.Pp
-.It Sy "Class, inheritance, and methods"
-Of course, as an object-oriented language, Ruby has such basic
-features like classes, inheritance, and methods.
-.Pp
-.It Sy "Singleton methods"
-Ruby has the ability to define methods for certain objects. For
-example, you can define a press-button action for certain widget by
-defining a singleton method for the button. Or, you can make up your
-own prototype based object system using singleton methods, if you want
-to.
-.Pp
-.It Sy "Mix-in by modules"
-Ruby intentionally does not have the multiple inheritance as it is a
-source of confusion. Instead, Ruby has the ability to share
-implementations across the inheritance tree. This is often called
-.Sq Mix-in .
-.Pp
-.It Sy "Iterators"
-Ruby has iterators for loop abstraction.
-.Pp
-.It Sy "Closures"
-In Ruby, you can objectify the procedure.
-.Pp
-.It Sy "Text processing and regular expression"
-Ruby has a bunch of text processing features like in Perl.
-.Pp
-.It Sy "M17N, character set independent"
-Ruby supports multilingualized programming. Easy to process texts
-written in many different natural languages and encoded in many
-different character encodings, without dependence on Unicode.
-.Pp
-.It Sy "Bignums"
-With built-in bignums, you can for example calculate factorial(400).
-.Pp
-.It Sy "Reflection and domain specific languages"
-Class is also an instance of Class class. Definition of classes and methods
-is just an expression as 1+1 is. So your programs can even write and modify programs.
-Thus you can write your application in your own programming language on top of Ruby.
-.Pp
-.It Sy "Exception handling"
-As in Java(tm).
-.Pp
-.It Sy "Direct access to the OS"
-Ruby can use most
-.Ux
-system calls, often used in system programming.
-.Pp
-.It Sy "Dynamic loading"
-On most
-.Ux
-systems, you can load object files into the Ruby interpreter
-on-the-fly.
-.It Sy "Rich libraries"
-Libraries called "builtin libraries" and "standard libraries" are bundled with Ruby.
-And you can obtain more libraries via the package management system called `RubyGems'.
-
-Moreover there are thousands of Ruby projects in Rubyforge
-.Pf ( "http://www.rubyforge.org" ) and RAA
-.Pf ( "http://raa.ruby-lang.org" ) Ns .
-.El
-.Pp
-.Sh OPTIONS
-Ruby interpreter accepts following command-line options (switches).
-They are quite similar to those of
-.Xr perl 1 .
-.Bl -tag -width "1234567890123" -compact
-.Pp
-.It Fl -copyright
-Prints the copyright notice.
-.Pp
-.It Fl -version
-Prints the version of Ruby interpreter.
-.Pp
-.It Fl 0 Ns Op Ar octal
-(The digit
-.Dq zero . )
-Specifies the input record separator
-.Pf ( Li "$/" )
-as an octal number. If no digit is given, the null character is taken
-as the separator. Other switches may follow the digits.
-.Fl 00
-turns Ruby into paragraph mode.
-.Fl 0777
-makes Ruby read whole file at once as a single string since there is
-no legal character with that value.
-.Pp
-.It Fl C Ar directory
-.It Fl X Ar directory
-Causes Ruby to switch to the directory.
-.Pp
-.It Fl E Ar external Ns Op : Ns Ar internal
-.It Fl -encoding Ar external Ns Op : Ns Ar internal
-Specifies the default value(s) for external encodings and internal encoding. Values should be separated with colon (:).
-
-You can ommit the one for internal encodings, then the value
-.Pf ( Li "Encoding.default_internal" ) will be nil.
-.Pp
-.It Fl F Ar pattern
-Specifies input field separator
-.Pf ( Li "$;" ) .
-.Pp
-.It Fl I Ar directory
-Used to tell Ruby where to load the library scripts. Directory path
-will be added to the load-path variable
-.Pf ( Li "$:" ) .
-.Pp
-.It Fl K Ar kcode
-Specifies KANJI (Japanese) encoding. The default value for script encodings
-.Pf ( Li "__ENCODING__" ) and external encodings ( Li "Encoding.default_external" ) will be the specified one.
-.Ar kcode
-can be one of
-.Bl -hang -offset indent
-.It Sy e
-EUC-JP
-.Pp
-.It Sy s
-Windows-31J (CP932)
-.Pp
-.It Sy u
-UTF-8
-.Pp
-.It Sy n
-ASCII-8BIT (BINARY)
-.El
-.Pp
-.It Fl S
-Makes Ruby use the
-.Ev PATH
-environment variable to search for script, unless if its name begins
-with a slash. This is used to emulate
-.Li #!
-on machines that don't support it, in the following manner:
-.Bd -literal -offset indent
-#! /usr/local/bin/ruby
-# This line makes the next one a comment in Ruby \e
- exec /usr/local/bin/ruby -S $0 $*
-.Ed
-.Pp
-.It Fl T Ns Op Ar level
-Turns on taint checks at the specified level (default 1).
-.Pp
-.It Fl U
-Sets the defalut value for internal encodings
-.Pf ( Li "Encoding.default_internal" ) to UTF-8.
-.Pp
-.It Fl W Ns Op Ar level
-Turns on verbose mode at the specified level, without printing version
-message at the beginning. The level can be;
-.Bl -hang -offset indent
-.It Sy 0
-Verbose mode is "silence". It sets the
-.Li "$VERBOSE"
-to nil.
-.Pp
-.It Sy 1
-Verbose mode is "medium". It sets the
-.Li "$VERBOSE"
-to false.
-.Pp
-.It Sy 2 (default)
-Verbose mode is "verbose". It sets the
-.Li "$VERBOSE"
-to true.
-.Fl W Ns
-2 is same as
-.Fl w
-.
-.El
-.Pp
-.It Fl a
-Turns on auto-split mode when used with
-.Fl n
-or
-.Fl p .
-In auto-split mode, Ruby executes
-.Dl $F = $_.split
-at beginning of each loop.
-.Pp
-.It Fl c
-Causes Ruby to check the syntax of the script and exit without
-executing. If there are no syntax errors, Ruby will print
-.Dq Syntax OK
-to the standard output.
-.Pp
-.It Fl d
-.It Fl -debug
-Turns on debug mode.
-.Li "$DEBUG"
-will be set to true.
-.Pp
-.It Fl e Ar command
-Specifies script from command-line while telling Ruby not to search
-the rest of arguments for a script file name.
-.Pp
-.It Fl h
-.It Fl -help
-Prints a summary of the options.
-.Pp
-.It Fl i Ar extension
-Specifies in-place-edit mode. The extension, if specified, is added
-to old file name to make a backup copy. For example:
-.Bd -literal -offset indent
-% echo matz > /tmp/junk
-% cat /tmp/junk
-matz
-% ruby -p -i.bak -e '$_.upcase!' /tmp/junk
-% cat /tmp/junk
-MATZ
-% cat /tmp/junk.bak
-matz
-.Ed
-.Pp
-.It Fl l
-(The lowercase letter
-.Dq ell . )
-Enables automatic line-ending processing, which means to firstly set
-.Li "$\e"
-to the value of
-.Li "$/" ,
-and secondly chops every line read using
-.Li chop! .
-.Pp
-.It Fl n
-Causes Ruby to assume the following loop around your script, which
-makes it iterate over file name arguments somewhat like
-.Nm sed
-.Fl n
-or
-.Nm awk .
-.Bd -literal -offset indent
-while gets
- ...
-end
-.Ed
-.Pp
-.It Fl p
-Acts mostly same as -n switch, but print the value of variable
-.Li "$_"
-at the each end of the loop. For example:
-.Bd -literal -offset indent
-% echo matz | ruby -p -e '$_.tr! "a-z", "A-Z"'
-MATZ
-.Ed
-.Pp
-.It Fl r Ar library
-Causes Ruby to load the library using require. It is useful when using
-.Fl n
-or
-.Fl p .
-.Pp
-.It Fl s
-Enables some switch parsing for switches after script name but before
-any file name arguments (or before a
-.Fl - ) .
-Any switches found there are removed from
-.Li ARGV
-and set the corresponding variable in the script. For example:
-.Bd -literal -offset indent
-#! /usr/local/bin/ruby -s
-# prints "true" if invoked with `-xyz' switch.
-print "true\en" if $xyz
-.Ed
-.Pp
-On some systems
-.Li "$0"
-does not always contain the full pathname, so you need the
-.Fl S
-switch to tell Ruby to search for the script if necessary. To handle
-embedded spaces or such. A better construct than
-.Li "$*"
-would be
-.Li ${1+"$@"} ,
-but it does not work if the script is being interpreted by
-.Xr csh 1 .
-.Pp
-.It Fl v
-Enables verbose mode. Ruby will print its version at the beginning,
-and set the variable
-.Li "$VERBOSE"
-to true. Some methods print extra messages if this variable is true.
-If this switch is given, and no other switches are present, Ruby quits
-after printing its version.
-.Pp
-.It Fl w
-Enables verbose mode without printing version message at the
-beginning. It sets the
-.Li "$VERBOSE"
-variable to true.
-.Pp
-.It Fl x Ns Op Ar directory
-Tells Ruby that the script is embedded in a message. Leading garbage
-will be discarded until the first that starts with
-.Dq #!
-and contains the string,
-.Dq ruby .
-Any meaningful switches on that line will applied. The end of script
-must be specified with either
-.Li EOF ,
-.Li "^D" ( Li "control-D" ) ,
-.Li "^Z" ( Li "control-Z" ) ,
-or reserved word
-.Li __END__ .
-If the directory name is specified, Ruby will switch to that directory
-before executing script.
-.Pp
-.It Fl y
-.It Fl -yydebug
-DO NOT USE.
-
-Turns on compiler debug mode. Ruby will print a bunch of internal
-state messages during compiling scripts. You don't have to specify
-this switch, unless you are going to debug the Ruby interpreter.
-.Pp
-.It Fl -disable- Ns Ar FEATURE
-.It Fl -enable- Ns Ar FEATURE
-Disables (or enables) the specified
-.Ar FEATURE Ns
-\&.
-.Bl -tag -width "--disable-rubyopt" -compact
-.It Fl -disable-gems
-.It Fl -enable-gems
-Disables (or enables) RubyGems libraries. By default, Ruby will load the latest
-version of each installed gem. The
-.Li Gem
-constant is true if RubyGems is enabled, false if otherwise.
-.Pp
-.It Fl -disable-rubyopt
-.It Fl -enable-rubyopt
-Ignores (or considers) the
-.Ev RUBYOPT
-environment variable. By default, Ruby considers the variable.
-.Pp
-.It Fl -disable-all
-.It Fl -enable-all
-Disables (or enables) all features.
-.Pp
-.El
-.Pp
-.It Fl -dump Ns = Ns Ar target
-DO NOT USE.
-
-Prints the specified target.
-.Ar target
-can be one of;
-.Bl -hang -offset indent
-.It Sy insns
-disassembed instructions
-.Pp
-.El
-.Pp
-You don't have to specify this switch, unless you are going to debug the Ruby interpreter.
-.Pp
-.It Fl -verbose
-Enables verbose mode without printing version message at the
-beginning. It sets the
-.Li "$VERBOSE"
-variable to true.
-If this switch is given, and no other switches are present, Ruby quits
-after printing its version.
-.El
-.Pp
-.Sh ENVIRONMENT
-.Bl -tag -width "RUBYLIB_PREFIX" -compact
-.It Ev RUBYLIB
-A colon-separated list of directories that are added to Ruby's
-library load path
-.Pf ( Li "$:" ) . Directories from this environment variable are searched
-before the standard load path is searched.
-.Pp
-e.g.:
-.Dl RUBYLIB="$HOME/lib/ruby:$HOME/lib/rubyext"
-.Pp
-.It Ev RUBYOPT
-Additional Ruby options.
-.Pp
-e.g.
-.Dl RUBYOPT="-w -Ke"
-.Pp
-Note that RUBYOPT can contain only
-.Fl d , Fl E , Fl I , Fl K , Fl r , Fl T , Fl U , Fl v , Fl w , Fl W, Fl -debug ,
-.Fl -disable- Ns Ar FEATURE
-and
-.Fl -enable- Ns Ar FEATURE .
-.Pp
-.It Ev RUBYPATH
-A colon-separated list of directories that Ruby searches for
-Ruby programs when the
-.Fl S
-flag is specified. This variable precedes the
-.Ev PATH
-environment variable.
-.Pp
-.It Ev RUBYSHELL
-The path to the system shell command. This environment variable is
-enabled for only mswin32, mingw32, and OS/2 platforms. If this
-variable is not defined, Ruby refers to
-.Ev COMSPEC .
-.Pp
-.It Ev PATH
-Ruby refers to the
-.Ev PATH
-environment variable on calling Kernel#system.
-.Pp
-.It Ev RUBYLIB_PREFIX
-This variable is obsolete.
-.El
-.Pp
-And Ruby depends on some RubyGems related environment variables unless disabled RubyGems.
-See the help of
-.Xr gem 1
-as bellow.
-.Bd -literal -offset indent
-% gem help
-.Ed
-.Pp
-.Sh SEE ALSO
-.Bl -hang -compact -width "http://www.ruby-lang.org/123"
-.It http://www.ruby-lang.org
-The official web site.
-.It http://www.rubyforge.org
-hosting many open source ruby projects.
-.It http://raa.ruby-lang.org
-Ruby Application Archive.
-.El
-.Pp
-.Sh REPORTING BUGS
-.Bl -bullet
-.Li Security vulnerabilities should be reported via an email to
-.Aq security@ruby-lang.org Ns
-.Li .
-Reported problems will be published after fixed.
-.Pp
-.Li And you can report other bugs and feature requests via the
-Ruby Issue Tracking System (http://redmine.ruby-lang.org).
-Do not report security vulnerabilities
-via the system because it publishes the vulnerabilities immedately.
-.El
-.Sh AUTHORS
-Ruby is designed and implemented by
-.An Yukihiro Matsumoto Aq matz@netlab.jp .
-
-See <\fBhttp://redmine.ruby-lang.org/wiki/ruby/Contributors\fR> for contributors to Ruby.
diff --git a/marshal.c b/marshal.c
index 5cdd2176b8..69e730ee5d 100644
--- a/marshal.c
+++ b/marshal.c
@@ -3,17 +3,17 @@
marshal.c -
$Author$
+ $Date$
created at: Thu Apr 27 16:30:01 JST 1995
- Copyright (C) 1993-2007 Yukihiro Matsumoto
+ Copyright (C) 1993-2003 Yukihiro Matsumoto
**********************************************************************/
-#include "ruby/ruby.h"
-#include "ruby/io.h"
-#include "ruby/st.h"
-#include "ruby/util.h"
-#include "ruby/encoding.h"
+#include "ruby.h"
+#include "rubyio.h"
+#include "st.h"
+#include "util.h"
#include <math.h>
#ifdef HAVE_FLOAT_H
@@ -30,8 +30,10 @@
#if SIZEOF_SHORT == SIZEOF_BDIGITS
#define SHORTLEN(x) (x)
#else
-static long
-shortlen(long len, BDIGIT *ds)
+static int
+shortlen(len, ds)
+ long len;
+ BDIGIT *ds;
{
BDIGIT num;
int offset = 0;
@@ -80,56 +82,7 @@ shortlen(long len, BDIGIT *ds)
static ID s_dump, s_load, s_mdump, s_mload;
static ID s_dump_data, s_load_data, s_alloc, s_call;
-static ID s_getbyte, s_read, s_write, s_binmode;
-
-ID rb_id_encoding(void);
-
-typedef struct {
- VALUE newclass;
- VALUE oldclass;
- VALUE (*dumper)(VALUE);
- VALUE (*loader)(VALUE, VALUE);
-} marshal_compat_t;
-
-static st_table *compat_allocator_tbl;
-static VALUE compat_allocator_tbl_wrapper;
-
-static int
-mark_marshal_compat_i(st_data_t key, st_data_t value)
-{
- marshal_compat_t *p = (marshal_compat_t *)value;
- rb_gc_mark(p->newclass);
- rb_gc_mark(p->oldclass);
- return ST_CONTINUE;
-}
-
-static void
-mark_marshal_compat_t(void *tbl)
-{
- if (!tbl) return;
- st_foreach(tbl, mark_marshal_compat_i, 0);
-}
-
-void
-rb_marshal_define_compat(VALUE newclass, VALUE oldclass, VALUE (*dumper)(VALUE), VALUE (*loader)(VALUE, VALUE))
-{
- marshal_compat_t *compat;
- rb_alloc_func_t allocator = rb_get_alloc_func(newclass);
-
- if (!allocator) {
- rb_raise(rb_eTypeError, "no allocator");
- }
-
- compat = ALLOC(marshal_compat_t);
- compat->newclass = Qnil;
- compat->oldclass = Qnil;
- compat->newclass = newclass;
- compat->oldclass = oldclass;
- compat->dumper = dumper;
- compat->loader = loader;
-
- st_insert(compat_allocator_tbl, (st_data_t)allocator, (st_data_t)compat);
-}
+static ID s_getc, s_read, s_write, s_binmode;
struct dump_arg {
VALUE obj;
@@ -137,10 +90,7 @@ struct dump_arg {
st_table *symbols;
st_table *data;
int taint;
- int untrust;
- st_table *compat_tbl;
VALUE wrapper;
- st_table *encodings;
};
struct dump_call_arg {
@@ -150,7 +100,9 @@ struct dump_call_arg {
};
static void
-check_dump_arg(struct dump_arg *arg, ID sym)
+check_dump_arg(arg, sym)
+ struct dump_arg *arg;
+ ID sym;
{
if (!DATA_PTR(arg->wrapper)) {
rb_raise(rb_eRuntimeError, "Marshal.dump reentered at %s",
@@ -159,20 +111,21 @@ check_dump_arg(struct dump_arg *arg, ID sym)
}
static void
-mark_dump_arg(void *ptr)
+mark_dump_arg(ptr)
+ void *ptr;
{
struct dump_arg *p = ptr;
if (!ptr)
return;
rb_mark_set(p->data);
- rb_mark_hash(p->compat_tbl);
}
static VALUE
-class2path(VALUE klass)
+class2path(klass)
+ VALUE klass;
{
VALUE path = rb_class_path(klass);
- char *n = RSTRING_PTR(path);
+ char *n = RSTRING(path)->ptr;
if (n[0] == '#') {
rb_raise(rb_eTypeError, "can't dump anonymous %s %s",
@@ -180,48 +133,59 @@ class2path(VALUE klass)
n);
}
if (rb_path2class(n) != rb_class_real(klass)) {
- rb_raise(rb_eTypeError, "%s can't be referred to", n);
+ rb_raise(rb_eTypeError, "%s can't be referred", n);
}
return path;
}
-static void w_long(long, struct dump_arg*);
+static void w_long _((long, struct dump_arg*));
static void
-w_nbyte(const char *s, long n, struct dump_arg *arg)
+w_nbyte(s, n, arg)
+ const char *s;
+ int n;
+ struct dump_arg *arg;
{
VALUE buf = arg->str;
rb_str_buf_cat(buf, s, n);
- if (arg->dest && RSTRING_LEN(buf) >= BUFSIZ) {
+ if (arg->dest && RSTRING(buf)->len >= BUFSIZ) {
if (arg->taint) OBJ_TAINT(buf);
- if (arg->untrust) OBJ_UNTRUST(buf);
rb_io_write(arg->dest, buf);
rb_str_resize(buf, 0);
}
}
static void
-w_byte(char c, struct dump_arg *arg)
+w_byte(c, arg)
+ char c;
+ struct dump_arg *arg;
{
w_nbyte(&c, 1, arg);
}
static void
-w_bytes(const char *s, long n, struct dump_arg *arg)
+w_bytes(s, n, arg)
+ const char *s;
+ int n;
+ struct dump_arg *arg;
{
w_long(n, arg);
w_nbyte(s, n, arg);
}
static void
-w_short(int x, struct dump_arg *arg)
+w_short(x, arg)
+ int x;
+ struct dump_arg *arg;
{
- w_byte((char)((x >> 0) & 0xff), arg);
- w_byte((char)((x >> 8) & 0xff), arg);
+ w_byte((x >> 0) & 0xff, arg);
+ w_byte((x >> 8) & 0xff, arg);
}
static void
-w_long(long x, struct dump_arg *arg)
+w_long(x, arg)
+ long x;
+ struct dump_arg *arg;
{
char buf[sizeof(long)+1];
int i, len = 0;
@@ -238,15 +202,15 @@ w_long(long x, struct dump_arg *arg)
return;
}
if (0 < x && x < 123) {
- w_byte((char)(x + 5), arg);
+ w_byte(x + 5, arg);
return;
}
if (-124 < x && x < 0) {
- w_byte((char)((x - 5)&0xff), arg);
+ w_byte((x - 5)&0xff, arg);
return;
}
- for (i=1;i<(int)sizeof(long)+1;i++) {
- buf[i] = (char)(x & 0xff);
+ for (i=1;i<sizeof(long)+1;i++) {
+ buf[i] = x & 0xff;
x = RSHIFT(x,8);
if (x == 0) {
buf[0] = i;
@@ -277,7 +241,9 @@ w_long(long x, struct dump_arg *arg)
#endif
static int
-save_mantissa(double d, char *buf)
+save_mantissa(d, buf)
+ double d;
+ char *buf;
{
int e, i = 0;
unsigned long m;
@@ -290,15 +256,15 @@ save_mantissa(double d, char *buf)
d = modf(ldexp(d, MANT_BITS), &n);
m = (unsigned long)n;
#if MANT_BITS > 24
- buf[i++] = (char)(m >> 24);
+ buf[i++] = m >> 24;
#endif
#if MANT_BITS > 16
- buf[i++] = (char)(m >> 16);
+ buf[i++] = m >> 16;
#endif
#if MANT_BITS > 8
- buf[i++] = (char)(m >> 8);
+ buf[i++] = m >> 8;
#endif
- buf[i++] = (char)m;
+ buf[i++] = m;
} while (d > 0);
while (!buf[i - 1]) --i;
}
@@ -306,9 +272,11 @@ save_mantissa(double d, char *buf)
}
static double
-load_mantissa(double d, const char *buf, long len)
+load_mantissa(d, buf, len)
+ double d;
+ const char *buf;
+ int len;
{
- if (!len) return d;
if (--len > 0 && !*buf++) { /* binary mantissa mark */
int e, s = d < 0, dig = 0;
unsigned long m;
@@ -348,9 +316,11 @@ load_mantissa(double d, const char *buf, long len)
#endif
static void
-w_float(double d, struct dump_arg *arg)
+w_float(d, arg)
+ double d;
+ struct dump_arg *arg;
{
- char buf[FLOAT_DIG + (DECIMAL_MANT + 7) / 8 + 10];
+ char buf[100];
if (isinf(d)) {
if (d < 0) strcpy(buf, "-inf");
@@ -364,10 +334,10 @@ w_float(double d, struct dump_arg *arg)
else strcpy(buf, "0");
}
else {
- size_t len;
+ int len;
/* xxx: should not use system's sprintf(3) */
- snprintf(buf, sizeof(buf), "%.*g", FLOAT_DIG, d);
+ sprintf(buf, "%.*g", FLOAT_DIG, d);
len = strlen(buf);
w_bytes(buf, len + save_mantissa(d, buf + len), arg);
return;
@@ -376,9 +346,11 @@ w_float(double d, struct dump_arg *arg)
}
static void
-w_symbol(ID id, struct dump_arg *arg)
+w_symbol(id, arg)
+ ID id;
+ struct dump_arg *arg;
{
- const char *sym;
+ const char *sym = rb_id2name(id);
st_data_t num;
if (st_lookup(arg->symbols, id, &num)) {
@@ -386,10 +358,6 @@ w_symbol(ID id, struct dump_arg *arg)
w_long((long)num, arg);
}
else {
- sym = rb_id2name(id);
- if (!sym) {
- rb_raise(rb_eTypeError, "can't dump anonymous ID %ld", id);
- }
w_byte(TYPE_SYMBOL, arg);
w_bytes(sym, strlen(sym), arg);
st_add_direct(arg->symbols, id, arg->symbols->num_entries);
@@ -397,7 +365,9 @@ w_symbol(ID id, struct dump_arg *arg)
}
static void
-w_unique(const char *s, struct dump_arg *arg)
+w_unique(s, arg)
+ const char *s;
+ struct dump_arg *arg;
{
if (s[0] == '#') {
rb_raise(rb_eTypeError, "can't dump anonymous class %s", s);
@@ -405,10 +375,12 @@ w_unique(const char *s, struct dump_arg *arg)
w_symbol(rb_intern(s), arg);
}
-static void w_object(VALUE,struct dump_arg*,int);
+static void w_object _((VALUE,struct dump_arg*,int));
static int
-hash_each(VALUE key, VALUE value, struct dump_call_arg *arg)
+hash_each(key, value, arg)
+ VALUE key, value;
+ struct dump_call_arg *arg;
{
w_object(key, arg->arg, arg->limit);
w_object(value, arg->arg, arg->limit);
@@ -416,143 +388,93 @@ hash_each(VALUE key, VALUE value, struct dump_call_arg *arg)
}
static void
-w_extended(VALUE klass, struct dump_arg *arg, int check)
+w_extended(klass, arg, check)
+ VALUE klass;
+ struct dump_arg *arg;
+ int check;
{
const char *path;
if (check && FL_TEST(klass, FL_SINGLETON)) {
- if (RCLASS_M_TBL(klass)->num_entries ||
- (RCLASS_IV_TBL(klass) && RCLASS_IV_TBL(klass)->num_entries > 1)) {
+ if (RCLASS(klass)->m_tbl->num_entries ||
+ (RCLASS(klass)->iv_tbl && RCLASS(klass)->iv_tbl->num_entries > 1)) {
rb_raise(rb_eTypeError, "singleton can't be dumped");
}
- klass = RCLASS_SUPER(klass);
+ klass = RCLASS(klass)->super;
}
while (BUILTIN_TYPE(klass) == T_ICLASS) {
path = rb_class2name(RBASIC(klass)->klass);
w_byte(TYPE_EXTENDED, arg);
w_unique(path, arg);
- klass = RCLASS_SUPER(klass);
+ klass = RCLASS(klass)->super;
}
}
static void
-w_class(char type, VALUE obj, struct dump_arg *arg, int check)
+w_class(type, obj, arg, check)
+ int type;
+ VALUE obj;
+ struct dump_arg *arg;
+ int check;
{
- volatile VALUE p;
char *path;
- st_data_t real_obj;
- VALUE klass;
- if (st_lookup(arg->compat_tbl, (st_data_t)obj, &real_obj)) {
- obj = (VALUE)real_obj;
- }
- klass = CLASS_OF(obj);
+ VALUE klass = CLASS_OF(obj);
w_extended(klass, arg, check);
w_byte(type, arg);
- p = class2path(rb_class_real(klass));
- path = RSTRING_PTR(p);
+ path = RSTRING(class2path(rb_class_real(klass)))->ptr;
w_unique(path, arg);
}
static void
-w_uclass(VALUE obj, VALUE super, struct dump_arg *arg)
+w_uclass(obj, base_klass, arg)
+ VALUE obj, base_klass;
+ struct dump_arg *arg;
{
VALUE klass = CLASS_OF(obj);
w_extended(klass, arg, Qtrue);
klass = rb_class_real(klass);
- if (klass != super) {
+ if (klass != base_klass) {
w_byte(TYPE_UCLASS, arg);
- w_unique(RSTRING_PTR(class2path(klass)), arg);
+ w_unique(RSTRING(class2path(klass))->ptr, arg);
}
}
static int
-w_obj_each(ID id, VALUE value, struct dump_call_arg *arg)
+w_obj_each(id, value, arg)
+ ID id;
+ VALUE value;
+ struct dump_call_arg *arg;
{
- if (id == rb_id_encoding()) return ST_CONTINUE;
- if (id == rb_intern("E")) return ST_CONTINUE;
w_symbol(id, arg->arg);
w_object(value, arg->arg, arg->limit);
return ST_CONTINUE;
}
static void
-w_encoding(VALUE obj, long num, struct dump_call_arg *arg)
-{
- int encidx = rb_enc_get_index(obj);
- rb_encoding *enc = 0;
- st_data_t name;
-
- if (encidx <= 0 || !(enc = rb_enc_from_index(encidx))) {
- w_long(num, arg->arg);
- return;
- }
- w_long(num + 1, arg->arg);
-
- /* special treatment for US-ASCII and UTF-8 */
- if (encidx == rb_usascii_encindex()) {
- w_symbol(rb_intern("E"), arg->arg);
- w_object(Qfalse, arg->arg, arg->limit + 1);
- return;
- }
- else if (encidx == rb_utf8_encindex()) {
- w_symbol(rb_intern("E"), arg->arg);
- w_object(Qtrue, arg->arg, arg->limit + 1);
- return;
- }
-
- w_symbol(rb_id_encoding(), arg->arg);
- do {
- if (!arg->arg->encodings)
- arg->arg->encodings = st_init_strcasetable();
- else if (st_lookup(arg->arg->encodings, (st_data_t)rb_enc_name(enc), &name))
- break;
- name = (st_data_t)rb_str_new2(rb_enc_name(enc));
- st_insert(arg->arg->encodings, (st_data_t)rb_enc_name(enc), name);
- } while (0);
- w_object(name, arg->arg, arg->limit + 1);
-}
-
-static void
-w_ivar(VALUE obj, st_table *tbl, struct dump_call_arg *arg)
+w_ivar(tbl, arg)
+ st_table *tbl;
+ struct dump_call_arg *arg;
{
- long num = tbl ? tbl->num_entries : 0;
-
- w_encoding(obj, num, arg);
if (tbl) {
+ w_long(tbl->num_entries, arg->arg);
st_foreach_safe(tbl, w_obj_each, (st_data_t)arg);
}
-}
-
-static void
-w_objivar(VALUE obj, struct dump_call_arg *arg)
-{
- VALUE *ptr;
- long i, len, num;
-
- len = ROBJECT_NUMIV(obj);
- ptr = ROBJECT_IVPTR(obj);
- num = 0;
- for (i = 0; i < len; i++)
- if (ptr[i] != Qundef)
- num += 1;
-
- w_encoding(obj, num, arg);
- if (num != 0) {
- rb_ivar_foreach(obj, w_obj_each, (st_data_t)arg);
+ else {
+ w_long(0, arg->arg);
}
}
static void
-w_object(VALUE obj, struct dump_arg *arg, int limit)
+w_object(obj, arg, limit)
+ VALUE obj;
+ struct dump_arg *arg;
+ int limit;
{
struct dump_call_arg c_arg;
st_table *ivtbl = 0;
st_data_t num;
- int hasiv = 0;
-#define has_ivars(obj, ivtbl) ((ivtbl = rb_generic_ivar_table(obj)) != 0 || \
- (!SPECIAL_CONST_P(obj) && !ENCODING_IS_ASCII8BIT(obj)))
if (limit == 0) {
rb_raise(rb_eArgError, "exceed depth limit");
@@ -568,7 +490,7 @@ w_object(VALUE obj, struct dump_arg *arg, int limit)
return;
}
- if ((hasiv = has_ivars(obj, ivtbl)) != 0) {
+ if ((ivtbl = rb_generic_ivar_table(obj)) != 0) {
w_byte(TYPE_IVAR, arg);
}
if (obj == Qnil) {
@@ -599,60 +521,37 @@ w_object(VALUE obj, struct dump_arg *arg, int limit)
}
else {
if (OBJ_TAINTED(obj)) arg->taint = Qtrue;
- if (OBJ_UNTRUSTED(obj)) arg->untrust = Qtrue;
+ st_add_direct(arg->data, obj, arg->data->num_entries);
if (rb_respond_to(obj, s_mdump)) {
volatile VALUE v;
- st_add_direct(arg->data, obj, arg->data->num_entries);
-
v = rb_funcall(obj, s_mdump, 0, 0);
check_dump_arg(arg, s_mdump);
w_class(TYPE_USRMARSHAL, obj, arg, Qfalse);
w_object(v, arg, limit);
- if (hasiv) w_ivar(obj, 0, &c_arg);
+ if (ivtbl) w_ivar(0, &c_arg);
return;
}
if (rb_respond_to(obj, s_dump)) {
VALUE v;
- st_table *ivtbl2 = 0;
- int hasiv2;
v = rb_funcall(obj, s_dump, 1, INT2NUM(limit));
check_dump_arg(arg, s_dump);
if (TYPE(v) != T_STRING) {
rb_raise(rb_eTypeError, "_dump() must return string");
}
- if ((hasiv2 = has_ivars(v, ivtbl2)) != 0 && !hasiv) {
+ if (!ivtbl && (ivtbl = rb_generic_ivar_table(v))) {
w_byte(TYPE_IVAR, arg);
}
w_class(TYPE_USERDEF, obj, arg, Qfalse);
- w_bytes(RSTRING_PTR(v), RSTRING_LEN(v), arg);
- if (hasiv2) {
- w_ivar(v, ivtbl2, &c_arg);
- }
- else if (hasiv) {
- w_ivar(obj, ivtbl, &c_arg);
+ w_bytes(RSTRING(v)->ptr, RSTRING(v)->len, arg);
+ if (ivtbl) {
+ w_ivar(ivtbl, &c_arg);
}
- st_add_direct(arg->data, obj, arg->data->num_entries);
return;
}
- st_add_direct(arg->data, obj, arg->data->num_entries);
-
- {
- st_data_t compat_data;
- rb_alloc_func_t allocator = rb_get_alloc_func(RBASIC(obj)->klass);
- if (st_lookup(compat_allocator_tbl,
- (st_data_t)allocator,
- &compat_data)) {
- marshal_compat_t *compat = (marshal_compat_t*)compat_data;
- VALUE real_obj = obj;
- obj = compat->dumper(real_obj);
- st_insert(arg->compat_tbl, (st_data_t)obj, (st_data_t)real_obj);
- }
- }
-
switch (BUILTIN_TYPE(obj)) {
case T_CLASS:
if (FL_TEST(obj, FL_SINGLETON)) {
@@ -660,8 +559,8 @@ w_object(VALUE obj, struct dump_arg *arg, int limit)
}
w_byte(TYPE_CLASS, arg);
{
- volatile VALUE path = class2path(obj);
- w_bytes(RSTRING_PTR(path), RSTRING_LEN(path), arg);
+ VALUE path = class2path(obj);
+ w_bytes(RSTRING(path)->ptr, RSTRING(path)->len, arg);
}
break;
@@ -669,21 +568,21 @@ w_object(VALUE obj, struct dump_arg *arg, int limit)
w_byte(TYPE_MODULE, arg);
{
VALUE path = class2path(obj);
- w_bytes(RSTRING_PTR(path), RSTRING_LEN(path), arg);
+ w_bytes(RSTRING(path)->ptr, RSTRING(path)->len, arg);
}
break;
case T_FLOAT:
w_byte(TYPE_FLOAT, arg);
- w_float(RFLOAT_VALUE(obj), arg);
+ w_float(RFLOAT(obj)->value, arg);
break;
case T_BIGNUM:
w_byte(TYPE_BIGNUM, arg);
{
- char sign = RBIGNUM_SIGN(obj) ? '+' : '-';
- long len = RBIGNUM_LEN(obj);
- BDIGIT *d = RBIGNUM_DIGITS(obj);
+ char sign = RBIGNUM(obj)->sign ? '+' : '-';
+ long len = RBIGNUM(obj)->len;
+ BDIGIT *d = RBIGNUM(obj)->digits;
w_byte(sign, arg);
w_long(SHORTLEN(len), arg); /* w_short? */
@@ -708,31 +607,27 @@ w_object(VALUE obj, struct dump_arg *arg, int limit)
case T_STRING:
w_uclass(obj, rb_cString, arg);
w_byte(TYPE_STRING, arg);
- w_bytes(RSTRING_PTR(obj), RSTRING_LEN(obj), arg);
+ w_bytes(RSTRING(obj)->ptr, RSTRING(obj)->len, arg);
break;
case T_REGEXP:
- w_uclass(obj, rb_cRegexp, arg);
- w_byte(TYPE_REGEXP, arg);
- {
- int opts = rb_reg_options(obj);
- w_bytes(RREGEXP_SRC_PTR(obj), RREGEXP_SRC_LEN(obj), arg);
- w_byte((char)opts, arg);
- }
+ w_uclass(obj, rb_cRegexp, arg);
+ w_byte(TYPE_REGEXP, arg);
+ w_bytes(RREGEXP(obj)->str, RREGEXP(obj)->len, arg);
+ w_byte(rb_reg_options(obj), arg);
break;
case T_ARRAY:
w_uclass(obj, rb_cArray, arg);
w_byte(TYPE_ARRAY, arg);
{
- long i, len = RARRAY_LEN(obj);
+ long len = RARRAY(obj)->len;
+ VALUE *ptr = RARRAY(obj)->ptr;
w_long(len, arg);
- for (i=0; i<RARRAY_LEN(obj); i++) {
- w_object(RARRAY_PTR(obj)[i], arg, limit);
- if (len != RARRAY_LEN(obj)) {
- rb_raise(rb_eRuntimeError, "array modified during dump");
- }
+ while (len--) {
+ w_object(*ptr, arg, limit);
+ ptr++;
}
}
break;
@@ -749,7 +644,7 @@ w_object(VALUE obj, struct dump_arg *arg, int limit)
else {
w_byte(TYPE_HASH_DEF, arg);
}
- w_long(RHASH_SIZE(obj), arg);
+ w_long(RHASH(obj)->tbl->num_entries, arg);
rb_hash_foreach(obj, hash_each, (st_data_t)&c_arg);
if (!NIL_P(RHASH(obj)->ifnone)) {
w_object(RHASH(obj)->ifnone, arg, limit);
@@ -759,22 +654,22 @@ w_object(VALUE obj, struct dump_arg *arg, int limit)
case T_STRUCT:
w_class(TYPE_STRUCT, obj, arg, Qtrue);
{
- long len = RSTRUCT_LEN(obj);
+ long len = RSTRUCT(obj)->len;
VALUE mem;
long i;
w_long(len, arg);
mem = rb_struct_members(obj);
for (i=0; i<len; i++) {
- w_symbol(SYM2ID(RARRAY_PTR(mem)[i]), arg);
- w_object(RSTRUCT_PTR(obj)[i], arg, limit);
+ w_symbol(SYM2ID(RARRAY(mem)->ptr[i]), arg);
+ w_object(RSTRUCT(obj)->ptr[i], arg, limit);
}
}
break;
case T_OBJECT:
w_class(TYPE_OBJECT, obj, arg, Qtrue);
- w_objivar(obj, &c_arg);
+ w_ivar(ROBJECT(obj)->iv_tbl, &c_arg);
break;
case T_DATA:
@@ -799,13 +694,14 @@ w_object(VALUE obj, struct dump_arg *arg, int limit)
break;
}
}
- if (hasiv) {
- w_ivar(obj, ivtbl, &c_arg);
+ if (ivtbl) {
+ w_ivar(ivtbl, &c_arg);
}
}
static VALUE
-dump(struct dump_call_arg *arg)
+dump(arg)
+ struct dump_call_arg *arg;
{
w_object(arg->obj, arg->arg, arg->limit);
if (arg->arg->dest) {
@@ -816,21 +712,18 @@ dump(struct dump_call_arg *arg)
}
static VALUE
-dump_ensure(struct dump_arg *arg)
+dump_ensure(arg)
+ struct dump_arg *arg;
{
if (!DATA_PTR(arg->wrapper)) return 0;
st_free_table(arg->symbols);
st_free_table(arg->data);
- st_free_table(arg->compat_tbl);
- if (arg->encodings) st_free_table(arg->encodings);
DATA_PTR(arg->wrapper) = 0;
arg->wrapper = 0;
if (arg->taint) {
OBJ_TAINT(arg->str);
}
- if (arg->untrust) {
- OBJ_UNTRUST(arg->str);
- }
+
return 0;
}
@@ -861,7 +754,9 @@ dump_ensure(struct dump_arg *arg)
* obj.sayHello #=> "hello\n"
*/
static VALUE
-marshal_dump(int argc, VALUE *argv)
+marshal_dump(argc, argv)
+ int argc;
+ VALUE* argv;
{
VALUE obj, port, a1, a2;
int limit = -1;
@@ -884,9 +779,6 @@ marshal_dump(int argc, VALUE *argv)
arg.symbols = st_init_numtable();
arg.data = st_init_numtable();
arg.taint = Qfalse;
- arg.untrust = Qfalse;
- arg.compat_tbl = st_init_numtable();
- arg.encodings = 0;
arg.str = rb_str_buf_new(0);
RBASIC(arg.str)->klass = 0;
arg.wrapper = Data_Wrap_Struct(rb_cData, mark_dump_arg, 0, &arg);
@@ -925,13 +817,13 @@ struct load_arg {
st_table *data;
VALUE proc;
int taint;
- int untrust;
- st_table *compat_tbl;
VALUE wrapper;
};
static void
-check_load_arg(struct load_arg *arg, ID sym)
+check_load_arg(arg, sym)
+ struct load_arg *arg;
+ ID sym;
{
if (!DATA_PTR(arg->wrapper)) {
rb_raise(rb_eRuntimeError, "Marshal.load reentered at %s",
@@ -940,27 +832,26 @@ check_load_arg(struct load_arg *arg, ID sym)
}
static void
-mark_load_arg(void *ptr)
+mark_load_arg(ptr)
+ void *ptr;
{
struct load_arg *p = ptr;
if (!ptr)
return;
rb_mark_tbl(p->data);
- rb_mark_hash(p->compat_tbl);
}
-static VALUE r_entry(VALUE v, struct load_arg *arg);
-static VALUE r_object(struct load_arg *arg);
-static VALUE path2class(const char *path);
+static VALUE r_object _((struct load_arg *arg));
static int
-r_byte(struct load_arg *arg)
+r_byte(arg)
+ struct load_arg *arg;
{
int c;
if (TYPE(arg->src) == T_STRING) {
- if (RSTRING_LEN(arg->src) > arg->offset) {
- c = (unsigned char)RSTRING_PTR(arg->src)[arg->offset++];
+ if (RSTRING(arg->src)->len > arg->offset) {
+ c = (unsigned char)RSTRING(arg->src)->ptr[arg->offset++];
}
else {
rb_raise(rb_eArgError, "marshal data too short");
@@ -968,19 +859,20 @@ r_byte(struct load_arg *arg)
}
else {
VALUE src = arg->src;
- VALUE v = rb_funcall2(src, s_getbyte, 0, 0);
- check_load_arg(arg, s_getbyte);
+ VALUE v = rb_funcall2(src, s_getc, 0, 0);
+ check_load_arg(arg, s_getc);
if (NIL_P(v)) rb_eof_error();
- c = (unsigned char)NUM2CHR(v);
+ c = (unsigned char)FIX2INT(v);
}
return c;
}
static void
-long_toobig(int size)
+long_toobig(size)
+ int size;
{
- rb_raise(rb_eTypeError, "long too big for this architecture (size "
- STRINGIZE(SIZEOF_LONG)", given %d)", size);
+ rb_raise(rb_eTypeError, "long too big for this architecture (size %d, given %d)",
+ sizeof(long), size);
}
#undef SIGN_EXTEND_CHAR
@@ -992,7 +884,8 @@ long_toobig(int size)
#endif
static long
-r_long(struct load_arg *arg)
+r_long(arg)
+ struct load_arg *arg;
{
register long x;
int c = SIGN_EXTEND_CHAR(r_byte(arg));
@@ -1003,7 +896,7 @@ r_long(struct load_arg *arg)
if (4 < c && c < 128) {
return c - 5;
}
- if (c > (int)sizeof(long)) long_toobig(c);
+ if (c > sizeof(long)) long_toobig(c);
x = 0;
for (i=0;i<c;i++) {
x |= (long)r_byte(arg) << (8*i);
@@ -1014,7 +907,7 @@ r_long(struct load_arg *arg)
return c + 5;
}
c = -c;
- if (c > (int)sizeof(long)) long_toobig(c);
+ if (c > sizeof(long)) long_toobig(c);
x = -1;
for (i=0;i<c;i++) {
x &= ~((long)0xff << (8*i));
@@ -1027,14 +920,16 @@ r_long(struct load_arg *arg)
#define r_bytes(arg) r_bytes0(r_long(arg), (arg))
static VALUE
-r_bytes0(long len, struct load_arg *arg)
+r_bytes0(len, arg)
+ long len;
+ struct load_arg *arg;
{
VALUE str;
if (len == 0) return rb_str_new(0, 0);
if (TYPE(arg->src) == T_STRING) {
- if (RSTRING_LEN(arg->src) - arg->offset >= len) {
- str = rb_str_new(RSTRING_PTR(arg->src)+arg->offset, len);
+ if (RSTRING(arg->src)->len - arg->offset >= len) {
+ str = rb_str_new(RSTRING(arg->src)->ptr+arg->offset, len);
arg->offset += len;
}
else {
@@ -1049,15 +944,15 @@ r_bytes0(long len, struct load_arg *arg)
check_load_arg(arg, s_read);
if (NIL_P(str)) goto too_short;
StringValue(str);
- if (RSTRING_LEN(str) != len) goto too_short;
+ if (RSTRING(str)->len != len) goto too_short;
if (OBJ_TAINTED(str)) arg->taint = Qtrue;
- if (OBJ_UNTRUSTED(str)) arg->untrust = Qtrue;
}
return str;
}
static ID
-r_symlink(struct load_arg *arg)
+r_symlink(arg)
+ struct load_arg *arg;
{
ID id;
long num = r_long(arg);
@@ -1069,162 +964,98 @@ r_symlink(struct load_arg *arg)
}
static ID
-r_symreal(struct load_arg *arg)
+r_symreal(arg)
+ struct load_arg *arg;
{
- volatile VALUE s = r_bytes(arg);
- ID id = rb_intern(RSTRING_PTR(s));
+ ID id;
+ id = rb_intern(RSTRING(r_bytes(arg))->ptr);
st_insert(arg->symbols, arg->symbols->num_entries, id);
return id;
}
static ID
-r_symbol(struct load_arg *arg)
+r_symbol(arg)
+ struct load_arg *arg;
{
- int type;
-
- switch ((type = r_byte(arg))) {
- case TYPE_SYMBOL:
- return r_symreal(arg);
- case TYPE_SYMLINK:
+ if (r_byte(arg) == TYPE_SYMLINK) {
return r_symlink(arg);
- default:
- rb_raise(rb_eArgError, "dump format error(0x%x)", type);
- break;
}
+ return r_symreal(arg);
}
static const char*
-r_unique(struct load_arg *arg)
+r_unique(arg)
+ struct load_arg *arg;
{
return rb_id2name(r_symbol(arg));
}
static VALUE
-r_string(struct load_arg *arg)
+r_string(arg)
+ struct load_arg *arg;
{
return r_bytes(arg);
}
static VALUE
-r_entry(VALUE v, struct load_arg *arg)
-{
- st_data_t real_obj = (VALUE)Qundef;
- if (st_lookup(arg->compat_tbl, v, &real_obj)) {
- st_insert(arg->data, arg->data->num_entries, (st_data_t)real_obj);
- }
- else {
- st_insert(arg->data, arg->data->num_entries, (st_data_t)v);
- }
- if (arg->taint) {
- OBJ_TAINT(v);
- if ((VALUE)real_obj != Qundef)
- OBJ_TAINT((VALUE)real_obj);
- }
- if (arg->untrust) {
- OBJ_UNTRUST(v);
- if ((VALUE)real_obj != Qundef)
- OBJ_UNTRUST((VALUE)real_obj);
- }
- return v;
-}
-
-static VALUE
-r_leave(VALUE v, struct load_arg *arg)
+r_entry(v, arg)
+ VALUE v;
+ struct load_arg *arg;
{
- st_data_t data;
- if (st_lookup(arg->compat_tbl, v, &data)) {
- VALUE real_obj = (VALUE)data;
- rb_alloc_func_t allocator = rb_get_alloc_func(CLASS_OF(real_obj));
- st_data_t key = v;
- if (st_lookup(compat_allocator_tbl, (st_data_t)allocator, &data)) {
- marshal_compat_t *compat = (marshal_compat_t*)data;
- compat->loader(real_obj, v);
- }
- st_delete(arg->compat_tbl, &key, 0);
- v = real_obj;
- }
- if (arg->proc) {
- v = rb_funcall(arg->proc, s_call, 1, v);
- check_load_arg(arg, s_call);
- }
+ st_insert(arg->data, arg->data->num_entries, (st_data_t)v);
+ if (arg->taint) OBJ_TAINT(v);
return v;
}
static void
-r_ivar(VALUE obj, struct load_arg *arg)
+r_ivar(obj, arg)
+ VALUE obj;
+ struct load_arg *arg;
{
long len;
len = r_long(arg);
if (len > 0) {
- do {
+ while (len--) {
ID id = r_symbol(arg);
VALUE val = r_object(arg);
- if (id == rb_id_encoding()) {
- int idx = rb_enc_find_index(StringValueCStr(val));
- if (idx > 0) rb_enc_associate_index(obj, idx);
- }
- else if (id == rb_intern("E")) {
- if (val == Qfalse) rb_enc_associate_index(obj, rb_usascii_encindex());
- else if (val == Qtrue) rb_enc_associate_index(obj, rb_utf8_encindex());
- /* bogus ignore */
- }
- else {
- rb_ivar_set(obj, id, val);
- }
- } while (--len > 0);
+ rb_ivar_set(obj, id, val);
+ }
}
}
static VALUE
-path2class(const char *path)
+path2class(path)
+ const char *path;
{
VALUE v = rb_path2class(path);
if (TYPE(v) != T_CLASS) {
- rb_raise(rb_eArgError, "%s does not refer to class", path);
+ rb_raise(rb_eArgError, "%s does not refer class", path);
}
return v;
}
static VALUE
-path2module(const char *path)
+path2module(path)
+ const char *path;
{
VALUE v = rb_path2class(path);
if (TYPE(v) != T_MODULE) {
- rb_raise(rb_eArgError, "%s does not refer to module", path);
+ rb_raise(rb_eArgError, "%s does not refer module", path);
}
return v;
}
static VALUE
-obj_alloc_by_path(const char *path, struct load_arg *arg)
-{
- VALUE klass;
- st_data_t data;
- rb_alloc_func_t allocator;
-
- klass = path2class(path);
-
- allocator = rb_get_alloc_func(klass);
- if (st_lookup(compat_allocator_tbl, (st_data_t)allocator, &data)) {
- marshal_compat_t *compat = (marshal_compat_t*)data;
- VALUE real_obj = rb_obj_alloc(klass);
- VALUE obj = rb_obj_alloc(compat->oldclass);
- st_insert(arg->compat_tbl, (st_data_t)obj, (st_data_t)real_obj);
- return obj;
- }
-
- return rb_obj_alloc(klass);
-}
-
-#define div0(x) ruby_div0(x)
-
-static VALUE
-r_object0(struct load_arg *arg, int *ivp, VALUE extmod)
+r_object0(arg, proc, ivp, extmod)
+ struct load_arg *arg;
+ VALUE proc;
+ int *ivp;
+ VALUE extmod;
{
VALUE v = Qnil;
int type = r_byte(arg);
@@ -1234,21 +1065,17 @@ r_object0(struct load_arg *arg, int *ivp, VALUE extmod)
switch (type) {
case TYPE_LINK:
id = r_long(arg);
- if (!st_lookup(arg->data, (st_data_t)id, &link)) {
+ if (!st_lookup(arg->data, (st_data_t)id, &link)) {
rb_raise(rb_eArgError, "dump format error (unlinked)");
}
- v = (VALUE)link;
- if (arg->proc) {
- v = rb_funcall(arg->proc, s_call, 1, v);
- check_load_arg(arg, s_call);
- }
- break;
+ v = (st_data_t)link;
+ return v;
case TYPE_IVAR:
{
int ivar = Qtrue;
- v = r_object0(arg, &ivar, extmod);
+ v = r_object0(arg, 0, &ivar, extmod);
if (ivar) r_ivar(v, arg);
}
break;
@@ -1260,8 +1087,8 @@ r_object0(struct load_arg *arg, int *ivp, VALUE extmod)
if (NIL_P(extmod)) extmod = rb_ary_new2(0);
rb_ary_push(extmod, m);
- v = r_object0(arg, 0, extmod);
- while (RARRAY_LEN(extmod) > 0) {
+ v = r_object0(arg, 0, 0, extmod);
+ while (RARRAY(extmod)->len > 0) {
m = rb_ary_pop(extmod);
rb_extend_object(v, m);
}
@@ -1275,7 +1102,7 @@ r_object0(struct load_arg *arg, int *ivp, VALUE extmod)
if (FL_TEST(c, FL_SINGLETON)) {
rb_raise(rb_eTypeError, "singleton can't be loaded");
}
- v = r_object0(arg, 0, extmod);
+ v = r_object0(arg, 0, 0, extmod);
if (rb_special_const_p(v) || TYPE(v) == T_OBJECT || TYPE(v) == T_CLASS) {
format_error:
rb_raise(rb_eArgError, "dump format error (user class)");
@@ -1291,17 +1118,14 @@ r_object0(struct load_arg *arg, int *ivp, VALUE extmod)
case TYPE_NIL:
v = Qnil;
- v = r_leave(v, arg);
break;
case TYPE_TRUE:
v = Qtrue;
- v = r_leave(v, arg);
break;
case TYPE_FALSE:
v = Qfalse;
- v = r_leave(v, arg);
break;
case TYPE_FIXNUM:
@@ -1309,32 +1133,30 @@ r_object0(struct load_arg *arg, int *ivp, VALUE extmod)
long i = r_long(arg);
v = LONG2FIX(i);
}
- v = r_leave(v, arg);
break;
case TYPE_FLOAT:
{
- double d;
+ double d, t = 0.0;
VALUE str = r_bytes(arg);
- const char *ptr = RSTRING_PTR(str);
+ const char *ptr = RSTRING(str)->ptr;
if (strcmp(ptr, "nan") == 0) {
- d = div0(0.0);
+ d = t / t;
}
else if (strcmp(ptr, "inf") == 0) {
- d = div0(+1.0);
+ d = 1.0 / t;
}
else if (strcmp(ptr, "-inf") == 0) {
- d = div0(-1.0);
+ d = -1.0 / t;
}
else {
char *e;
d = strtod(ptr, &e);
- d = load_mantissa(d, e, RSTRING_LEN(str) - (e - ptr));
+ d = load_mantissa(d, e, RSTRING(str)->len - (e - ptr));
}
- v = DBL2NUM(d);
- v = r_entry(v, arg);
- v = r_leave(v, arg);
+ v = rb_float_new(d);
+ r_entry(v, arg);
}
break;
@@ -1346,21 +1168,21 @@ r_object0(struct load_arg *arg, int *ivp, VALUE extmod)
NEWOBJ(big, struct RBignum);
OBJSETUP(big, rb_cBignum, T_BIGNUM);
- RBIGNUM_SET_SIGN(big, (r_byte(arg) == '+'));
+ big->sign = (r_byte(arg) == '+');
len = r_long(arg);
data = r_bytes0(len * 2, arg);
#if SIZEOF_BDIGITS == SIZEOF_SHORT
- rb_big_resize((VALUE)big, len);
+ big->len = len;
#else
- rb_big_resize((VALUE)big, (len + 1) * 2 / sizeof(BDIGIT));
+ big->len = (len + 1) * 2 / sizeof(BDIGIT);
#endif
- digits = RBIGNUM_DIGITS(big);
- MEMCPY(digits, RSTRING_PTR(data), char, len * 2);
+ big->digits = digits = ALLOC_N(BDIGIT, big->len);
+ MEMCPY(digits, RSTRING(data)->ptr, char, len * 2);
#if SIZEOF_BDIGITS > SIZEOF_SHORT
MEMZERO((char *)digits + len * 2, char,
- RBIGNUM_LEN(big) * sizeof(BDIGIT) - len * 2);
+ big->len * sizeof(BDIGIT) - len * 2);
#endif
- len = RBIGNUM_LEN(big);
+ len = big->len;
while (len > 0) {
unsigned char *p = (unsigned char *)digits;
BDIGIT num = 0;
@@ -1379,34 +1201,19 @@ r_object0(struct load_arg *arg, int *ivp, VALUE extmod)
len--;
}
v = rb_big_norm((VALUE)big);
- v = r_entry(v, arg);
- v = r_leave(v, arg);
+ r_entry(v, arg);
}
break;
case TYPE_STRING:
v = r_entry(r_string(arg), arg);
- v = r_leave(v, arg);
break;
case TYPE_REGEXP:
{
volatile VALUE str = r_bytes(arg);
int options = r_byte(arg);
- v = rb_reg_new("", 0, options);
- if (ivp) {
- r_ivar(v, arg);
- *ivp = Qfalse;
- }
- if (rb_enc_get_index(v) != rb_usascii_encindex())
- rb_enc_copy(str, v);
- if (rb_enc_get_index(str) != rb_utf8_encindex()) {
-#define f_gsub_bang(x,y,z) rb_funcall(x, rb_intern("gsub!"), 2, y, z)
- f_gsub_bang(str, rb_reg_new("\\\\u", 3, 0), rb_usascii_str_new_cstr("u"));
- }
- str = r_entry(rb_reg_new_str(str, options), arg);
- rb_copy_generic_ivar(str, v);
- v = r_leave(str, arg);
+ v = r_entry(rb_reg_new(RSTRING(str)->ptr, RSTRING(str)->len, options), arg);
}
break;
@@ -1415,11 +1222,10 @@ r_object0(struct load_arg *arg, int *ivp, VALUE extmod)
volatile long len = r_long(arg); /* gcc 2.7.2.3 -O2 bug?? */
v = rb_ary_new2(len);
- v = r_entry(v, arg);
+ r_entry(v, arg);
while (len--) {
rb_ary_push(v, r_object(arg));
}
- v = r_leave(v, arg);
}
break;
@@ -1429,7 +1235,7 @@ r_object0(struct load_arg *arg, int *ivp, VALUE extmod)
long len = r_long(arg);
v = rb_hash_new();
- v = r_entry(v, arg);
+ r_entry(v, arg);
while (len--) {
VALUE key = r_object(arg);
VALUE value = r_object(arg);
@@ -1438,46 +1244,37 @@ r_object0(struct load_arg *arg, int *ivp, VALUE extmod)
if (type == TYPE_HASH_DEF) {
RHASH(v)->ifnone = r_object(arg);
}
- v = r_leave(v, arg);
}
break;
case TYPE_STRUCT:
{
- VALUE klass, mem;
- VALUE values;
+ VALUE klass, mem, values;
volatile long i; /* gcc 2.7.2.3 -O2 bug?? */
long len;
ID slot;
klass = path2class(r_unique(arg));
- len = r_long(arg);
-
- v = rb_obj_alloc(klass);
- if (TYPE(v) != T_STRUCT) {
- rb_raise(rb_eTypeError, "class %s not a struct", rb_class2name(klass));
- }
mem = rb_struct_s_members(klass);
- if (RARRAY_LEN(mem) != len) {
- rb_raise(rb_eTypeError, "struct %s not compatible (struct size differs)",
- rb_class2name(klass));
- }
+ len = r_long(arg);
- v = r_entry(v, arg);
values = rb_ary_new2(len);
for (i=0; i<len; i++) {
+ rb_ary_push(values, Qnil);
+ }
+ v = rb_struct_alloc(klass, values);
+ r_entry(v, arg);
+ for (i=0; i<len; i++) {
slot = r_symbol(arg);
- if (RARRAY_PTR(mem)[i] != ID2SYM(slot)) {
+ if (RARRAY(mem)->ptr[i] != ID2SYM(slot)) {
rb_raise(rb_eTypeError, "struct %s not compatible (:%s for :%s)",
rb_class2name(klass),
rb_id2name(slot),
- rb_id2name(SYM2ID(RARRAY_PTR(mem)[i])));
+ rb_id2name(SYM2ID(RARRAY(mem)->ptr[i])));
}
- rb_ary_push(values, r_object(arg));
+ rb_struct_aset(v, LONG2FIX(i), r_object(arg));
}
- rb_struct_initialize(v, values);
- v = r_leave(v, arg);
}
break;
@@ -1497,8 +1294,7 @@ r_object0(struct load_arg *arg, int *ivp, VALUE extmod)
}
v = rb_funcall(klass, s_load, 1, data);
check_load_arg(arg, s_load);
- v = r_entry(v, arg);
- v = r_leave(v, arg);
+ r_entry(v, arg);
}
break;
@@ -1508,8 +1304,8 @@ r_object0(struct load_arg *arg, int *ivp, VALUE extmod)
VALUE data;
v = rb_obj_alloc(klass);
- if (!NIL_P(extmod)) {
- while (RARRAY_LEN(extmod) > 0) {
+ if (! NIL_P(extmod)) {
+ while (RARRAY(extmod)->len > 0) {
VALUE m = rb_ary_pop(extmod);
rb_extend_object(v, m);
}
@@ -1518,23 +1314,23 @@ r_object0(struct load_arg *arg, int *ivp, VALUE extmod)
rb_raise(rb_eTypeError, "instance of %s needs to have method `marshal_load'",
rb_class2name(klass));
}
- v = r_entry(v, arg);
+ r_entry(v, arg);
data = r_object(arg);
rb_funcall(v, s_mload, 1, data);
check_load_arg(arg, s_mload);
- v = r_leave(v, arg);
}
break;
case TYPE_OBJECT:
{
- v = obj_alloc_by_path(r_unique(arg), arg);
+ VALUE klass = path2class(r_unique(arg));
+
+ v = rb_obj_alloc(klass);
if (TYPE(v) != T_OBJECT) {
rb_raise(rb_eArgError, "dump format error");
}
- v = r_entry(v, arg);
+ r_entry(v, arg);
r_ivar(v, arg);
- v = r_leave(v, arg);
}
break;
@@ -1556,15 +1352,14 @@ r_object0(struct load_arg *arg, int *ivp, VALUE extmod)
if (TYPE(v) != T_DATA) {
rb_raise(rb_eArgError, "dump format error");
}
- v = r_entry(v, arg);
+ r_entry(v, arg);
if (!rb_respond_to(v, s_load_data)) {
rb_raise(rb_eTypeError,
"class %s needs to have instance method `_load_data'",
rb_class2name(klass));
}
- rb_funcall(v, s_load_data, 1, r_object0(arg, 0, extmod));
+ rb_funcall(v, s_load_data, 1, r_object0(arg, 0, 0, extmod));
check_load_arg(arg, s_load_data);
- v = r_leave(v, arg);
}
break;
@@ -1572,9 +1367,8 @@ r_object0(struct load_arg *arg, int *ivp, VALUE extmod)
{
volatile VALUE str = r_bytes(arg);
- v = rb_path2class(RSTRING_PTR(str));
- v = r_entry(v, arg);
- v = r_leave(v, arg);
+ v = rb_path2class(RSTRING(str)->ptr);
+ r_entry(v, arg);
}
break;
@@ -1582,9 +1376,8 @@ r_object0(struct load_arg *arg, int *ivp, VALUE extmod)
{
volatile VALUE str = r_bytes(arg);
- v = path2class(RSTRING_PTR(str));
- v = r_entry(v, arg);
- v = r_leave(v, arg);
+ v = path2class(RSTRING(str)->ptr);
+ r_entry(v, arg);
}
break;
@@ -1592,47 +1385,50 @@ r_object0(struct load_arg *arg, int *ivp, VALUE extmod)
{
volatile VALUE str = r_bytes(arg);
- v = path2module(RSTRING_PTR(str));
- v = r_entry(v, arg);
- v = r_leave(v, arg);
+ v = path2module(RSTRING(str)->ptr);
+ r_entry(v, arg);
}
break;
case TYPE_SYMBOL:
v = ID2SYM(r_symreal(arg));
- v = r_leave(v, arg);
break;
case TYPE_SYMLINK:
- v = ID2SYM(r_symlink(arg));
- break;
+ return ID2SYM(r_symlink(arg));
default:
rb_raise(rb_eArgError, "dump format error(0x%x)", type);
break;
}
+ if (proc) {
+ rb_funcall(proc, s_call, 1, v);
+ check_load_arg(arg, s_call);
+ }
return v;
}
static VALUE
-r_object(struct load_arg *arg)
+r_object(arg)
+ struct load_arg *arg;
{
- return r_object0(arg, 0, Qnil);
+ return r_object0(arg, arg->proc, 0, Qnil);
}
static VALUE
-load(struct load_arg *arg)
+load(arg)
+ struct load_arg *arg;
{
return r_object(arg);
}
static VALUE
-load_ensure(struct load_arg *arg)
+load_ensure(arg)
+ struct load_arg *arg;
{
if (!DATA_PTR(arg->wrapper)) return 0;
st_free_table(arg->symbols);
st_free_table(arg->data);
- st_free_table(arg->compat_tbl);
DATA_PTR(arg->wrapper) = 0;
arg->wrapper = 0;
return 0;
@@ -1642,7 +1438,7 @@ load_ensure(struct load_arg *arg)
* call-seq:
* load( source [, proc] ) => obj
* restore( source [, proc] ) => obj
- *
+ *
* Returns the result of converting the serialized data in source into a
* Ruby object (possibly with associated subordinate objects). source
* may be either an instance of IO or an object that responds to
@@ -1650,7 +1446,9 @@ load_ensure(struct load_arg *arg)
* is deserialized.
*/
static VALUE
-marshal_load(int argc, VALUE *argv)
+marshal_load(argc, argv)
+ int argc;
+ VALUE *argv;
{
VALUE port, proc;
int major, minor;
@@ -1663,7 +1461,7 @@ marshal_load(int argc, VALUE *argv)
arg.taint = OBJ_TAINTED(port); /* original taintedness */
port = v;
}
- else if (rb_respond_to(port, s_getbyte) && rb_respond_to(port, s_read)) {
+ else if (rb_respond_to(port, s_getc) && rb_respond_to(port, s_read)) {
if (rb_respond_to(port, s_binmode)) {
rb_funcall2(port, s_binmode, 0, 0);
}
@@ -1672,12 +1470,10 @@ marshal_load(int argc, VALUE *argv)
else {
rb_raise(rb_eTypeError, "instance of IO needed");
}
- arg.untrust = OBJ_UNTRUSTED(port);
arg.src = port;
arg.offset = 0;
arg.symbols = st_init_numtable();
arg.data = st_init_numtable();
- arg.compat_tbl = st_init_numtable();
arg.proc = 0;
arg.wrapper = Data_Wrap_Struct(rb_cData, mark_load_arg, 0, &arg);
@@ -1715,9 +1511,9 @@ marshal_load(int argc, VALUE *argv)
* first two bytes of marshaled data.
*
* str = Marshal.dump("thing")
- * RUBY_VERSION #=> "1.9.0"
- * str[0].ord #=> 4
- * str[1].ord #=> 8
+ * RUBY_VERSION #=> "1.8.0"
+ * str[0] #=> 4
+ * str[1] #=> 8
*
* Some objects cannot be dumped: if the objects to be dumped include
* bindings, procedure or method objects, instances of class IO, or
@@ -1734,11 +1530,8 @@ marshal_load(int argc, VALUE *argv)
* The class method _load should take a String and return an object of this class.
*/
void
-Init_marshal(void)
+Init_marshal()
{
-#undef rb_intern
-#define rb_intern(str) rb_intern_const(str)
-
VALUE rb_mMarshal = rb_define_module("Marshal");
s_dump = rb_intern("_dump");
@@ -1749,7 +1542,7 @@ Init_marshal(void)
s_load_data = rb_intern("_load_data");
s_alloc = rb_intern("_alloc");
s_call = rb_intern("call");
- s_getbyte = rb_intern("getbyte");
+ s_getc = rb_intern("getc");
s_read = rb_intern("read");
s_write = rb_intern("write");
s_binmode = rb_intern("binmode");
@@ -1760,15 +1553,11 @@ Init_marshal(void)
rb_define_const(rb_mMarshal, "MAJOR_VERSION", INT2FIX(MARSHAL_MAJOR));
rb_define_const(rb_mMarshal, "MINOR_VERSION", INT2FIX(MARSHAL_MINOR));
-
- compat_allocator_tbl = st_init_numtable();
- compat_allocator_tbl_wrapper =
- Data_Wrap_Struct(rb_cData, mark_marshal_compat_t, 0, compat_allocator_tbl);
- rb_gc_register_mark_object(compat_allocator_tbl_wrapper);
}
VALUE
-rb_marshal_dump(VALUE obj, VALUE port)
+rb_marshal_dump(obj, port)
+ VALUE obj, port;
{
int argc = 1;
VALUE argv[2];
@@ -1780,7 +1569,8 @@ rb_marshal_dump(VALUE obj, VALUE port)
}
VALUE
-rb_marshal_load(VALUE port)
+rb_marshal_load(port)
+ VALUE port;
{
return marshal_load(1, &port);
}
diff --git a/math.c b/math.c
index 6273d60976..bf9b598156 100644
--- a/math.c
+++ b/math.c
@@ -3,34 +3,35 @@
math.c -
$Author$
+ $Date$
created at: Tue Jan 25 14:12:56 JST 1994
- Copyright (C) 1993-2007 Yukihiro Matsumoto
+ Copyright (C) 1993-2003 Yukihiro Matsumoto
**********************************************************************/
-#include "ruby/ruby.h"
+#include "ruby.h"
#include <math.h>
#include <errno.h>
VALUE rb_mMath;
-extern VALUE rb_to_float(VALUE val);
-#define Need_Float(x) do {if (TYPE(x) != T_FLOAT) {(x) = rb_to_float(x);}} while(0)
+#define Need_Float(x) (x) = rb_Float(x)
#define Need_Float2(x,y) do {\
Need_Float(x);\
Need_Float(y);\
} while (0)
static void
-domain_check(double x, double y, const char *msg)
+domain_check(x, msg)
+ double x;
+ char *msg;
{
while(1) {
if (errno) {
rb_sys_fail(msg);
}
- if (isnan(y)) {
- if (isnan(x)) break;
+ if (isnan(x)) {
#if defined(EDOM)
errno = EDOM;
#elif defined(ERANGE)
@@ -42,146 +43,134 @@ domain_check(double x, double y, const char *msg)
}
}
-static void
-infinity_check(VALUE arg, double res, const char *msg)
-{
- while(1) {
- if (errno) {
- rb_sys_fail(msg);
- }
- if (isinf(res) && !isinf(RFLOAT_VALUE(arg))) {
-#if defined(EDOM)
- errno = EDOM;
-#elif defined(ERANGE)
- errno = ERANGE;
-#endif
- continue;
- }
- break;
- }
-}
/*
* call-seq:
* Math.atan2(y, x) => float
- *
+ *
* Computes the arc tangent given <i>y</i> and <i>x</i>. Returns
* -PI..PI.
- *
+ *
*/
static VALUE
-math_atan2(VALUE obj, VALUE y, VALUE x)
+math_atan2(obj, y, x)
+ VALUE obj, x, y;
{
Need_Float2(y, x);
- return DBL2NUM(atan2(RFLOAT_VALUE(y), RFLOAT_VALUE(x)));
+ return rb_float_new(atan2(RFLOAT(y)->value, RFLOAT(x)->value));
}
/*
* call-seq:
* Math.cos(x) => float
- *
+ *
* Computes the cosine of <i>x</i> (expressed in radians). Returns
* -1..1.
*/
static VALUE
-math_cos(VALUE obj, VALUE x)
+math_cos(obj, x)
+ VALUE obj, x;
{
Need_Float(x);
- return DBL2NUM(cos(RFLOAT_VALUE(x)));
+ return rb_float_new(cos(RFLOAT(x)->value));
}
/*
* call-seq:
* Math.sin(x) => float
- *
+ *
* Computes the sine of <i>x</i> (expressed in radians). Returns
* -1..1.
*/
static VALUE
-math_sin(VALUE obj, VALUE x)
+math_sin(obj, x)
+ VALUE obj, x;
{
Need_Float(x);
- return DBL2NUM(sin(RFLOAT_VALUE(x)));
+ return rb_float_new(sin(RFLOAT(x)->value));
}
/*
* call-seq:
* Math.tan(x) => float
- *
+ *
* Returns the tangent of <i>x</i> (expressed in radians).
*/
static VALUE
-math_tan(VALUE obj, VALUE x)
+math_tan(obj, x)
+ VALUE obj, x;
{
Need_Float(x);
- return DBL2NUM(tan(RFLOAT_VALUE(x)));
+ return rb_float_new(tan(RFLOAT(x)->value));
}
/*
* call-seq:
* Math.acos(x) => float
- *
+ *
* Computes the arc cosine of <i>x</i>. Returns 0..PI.
*/
static VALUE
-math_acos(VALUE obj, VALUE x)
+math_acos(obj, x)
+ VALUE obj, x;
{
- double d0, d;
+ double d;
Need_Float(x);
errno = 0;
- d0 = RFLOAT_VALUE(x);
- d = acos(d0);
- domain_check(d0, d, "acos");
- return DBL2NUM(d);
+ d = acos(RFLOAT(x)->value);
+ domain_check(d, "acos");
+ return rb_float_new(d);
}
/*
* call-seq:
* Math.asin(x) => float
- *
+ *
* Computes the arc sine of <i>x</i>. Returns -{PI/2} .. {PI/2}.
*/
static VALUE
-math_asin(VALUE obj, VALUE x)
+math_asin(obj, x)
+ VALUE obj, x;
{
- double d0, d;
+ double d;
Need_Float(x);
errno = 0;
- d0 = RFLOAT_VALUE(x);
- d = asin(d0);
- domain_check(d0, d, "asin");
- return DBL2NUM(d);
+ d = asin(RFLOAT(x)->value);
+ domain_check(d, "asin");
+ return rb_float_new(d);
}
/*
* call-seq:
* Math.atan(x) => float
- *
+ *
* Computes the arc tangent of <i>x</i>. Returns -{PI/2} .. {PI/2}.
*/
static VALUE
-math_atan(VALUE obj, VALUE x)
+math_atan(obj, x)
+ VALUE obj, x;
{
Need_Float(x);
- return DBL2NUM(atan(RFLOAT_VALUE(x)));
+ return rb_float_new(atan(RFLOAT(x)->value));
}
#ifndef HAVE_COSH
double
-cosh(double x)
+cosh(x)
+ double x;
{
return (exp(x) + exp(-x)) / 2;
}
@@ -190,21 +179,23 @@ cosh(double x)
/*
* call-seq:
* Math.cosh(x) => float
- *
+ *
* Computes the hyperbolic cosine of <i>x</i> (expressed in radians).
*/
static VALUE
-math_cosh(VALUE obj, VALUE x)
+math_cosh(obj, x)
+ VALUE obj, x;
{
Need_Float(x);
-
- return DBL2NUM(cosh(RFLOAT_VALUE(x)));
+
+ return rb_float_new(cosh(RFLOAT(x)->value));
}
#ifndef HAVE_SINH
double
-sinh(double x)
+sinh(x)
+ double x;
{
return (exp(x) - exp(-x)) / 2;
}
@@ -213,21 +204,23 @@ sinh(double x)
/*
* call-seq:
* Math.sinh(x) => float
- *
+ *
* Computes the hyperbolic sine of <i>x</i> (expressed in
* radians).
*/
static VALUE
-math_sinh(VALUE obj, VALUE x)
+math_sinh(obj, x)
+ VALUE obj, x;
{
Need_Float(x);
- return DBL2NUM(sinh(RFLOAT_VALUE(x)));
+ return rb_float_new(sinh(RFLOAT(x)->value));
}
#ifndef HAVE_TANH
double
-tanh(double x)
+tanh(x)
+ double x;
{
return sinh(x) / cosh(x);
}
@@ -236,90 +229,87 @@ tanh(double x)
/*
* call-seq:
* Math.tanh() => float
- *
+ *
* Computes the hyperbolic tangent of <i>x</i> (expressed in
* radians).
*/
static VALUE
-math_tanh(VALUE obj, VALUE x)
+math_tanh(obj, x)
+ VALUE obj, x;
{
Need_Float(x);
- return DBL2NUM(tanh(RFLOAT_VALUE(x)));
+ return rb_float_new(tanh(RFLOAT(x)->value));
}
/*
* call-seq:
* Math.acosh(x) => float
- *
+ *
* Computes the inverse hyperbolic cosine of <i>x</i>.
*/
static VALUE
-math_acosh(VALUE obj, VALUE x)
+math_acosh(obj, x)
+ VALUE obj, x;
{
- double d0, d;
+ double d;
Need_Float(x);
errno = 0;
- d0 = RFLOAT_VALUE(x);
- d = acosh(d0);
- domain_check(d0, d, "acosh");
- return DBL2NUM(d);
+ d = acosh(RFLOAT(x)->value);
+ domain_check(d, "acosh");
+ return rb_float_new(d);
}
/*
* call-seq:
* Math.asinh(x) => float
- *
+ *
* Computes the inverse hyperbolic sine of <i>x</i>.
*/
static VALUE
-math_asinh(VALUE obj, VALUE x)
+math_asinh(obj, x)
+ VALUE obj, x;
{
Need_Float(x);
- return DBL2NUM(asinh(RFLOAT_VALUE(x)));
+ return rb_float_new(asinh(RFLOAT(x)->value));
}
/*
* call-seq:
* Math.atanh(x) => float
- *
+ *
* Computes the inverse hyperbolic tangent of <i>x</i>.
*/
static VALUE
-math_atanh(VALUE obj, VALUE x)
+math_atanh(obj, x)
+ VALUE obj, x;
{
- double d0, d;
+ double d;
Need_Float(x);
errno = 0;
- d0 = RFLOAT_VALUE(x);
- d = atanh(d0);
- domain_check(d0, d, "atanh");
- infinity_check(x, d, "atanh");
- return DBL2NUM(d);
+ d = atanh(RFLOAT(x)->value);
+ domain_check(d, "atanh");
+ return rb_float_new(d);
}
/*
* call-seq:
* Math.exp(x) => float
- *
+ *
* Returns e**x.
- *
- * Math.exp(0) #=> 1.0
- * Math.exp(1) #=> 2.718281828459045
- * Math.exp(1.5) #=> 4.4816890703380645
- *
*/
static VALUE
-math_exp(VALUE obj, VALUE x)
+math_exp(obj, x)
+ VALUE obj, x;
{
Need_Float(x);
- return DBL2NUM(exp(RFLOAT_VALUE(x)));
+ return rb_float_new(exp(RFLOAT(x)->value));
}
#if defined __CYGWIN__
@@ -334,236 +324,122 @@ math_exp(VALUE obj, VALUE x)
/*
* call-seq:
* Math.log(numeric) => float
- * Math.log(num,base) => float
- *
+ *
* Returns the natural logarithm of <i>numeric</i>.
- * If additional second argument is given, it will be the base
- * of logarithm.
- *
- * Math.log(1) #=> 0.0
- * Math.log(Math::E) #=> 1.0
- * Math.log(Math::E**3) #=> 3.0
- * Math.log(12,3) #=> 2.2618595071429146
- *
*/
static VALUE
-math_log(int argc, VALUE *argv)
+math_log(obj, x)
+ VALUE obj, x;
{
- VALUE x, base;
- double d0, d;
-
- rb_scan_args(argc, argv, "11", &x, &base);
- Need_Float(x);
- errno = 0;
- d0 = RFLOAT_VALUE(x);
- d = log(d0);
- if (argc == 2) {
- Need_Float(base);
- d /= log(RFLOAT_VALUE(base));
- }
- domain_check(d0, d, "log");
- infinity_check(x, d, "log");
- return DBL2NUM(d);
-}
-
-#ifndef log2
-#ifndef HAVE_LOG2
-double
-log2(double x)
-{
- return log10(x)/log10(2.0);
-}
-#else
-extern double log2(double);
-#endif
-#endif
-
-/*
- * call-seq:
- * Math.log2(numeric) => float
- *
- * Returns the base 2 logarithm of <i>numeric</i>.
- *
- * Math.log2(1) #=> 0.0
- * Math.log2(2) #=> 1.0
- * Math.log2(32768) #=> 15.0
- * Math.log2(65536) #=> 16.0
- *
- */
-
-static VALUE
-math_log2(VALUE obj, VALUE x)
-{
- double d0, d;
+ double d;
Need_Float(x);
errno = 0;
- d0 = RFLOAT_VALUE(x);
- d = log2(d0);
- domain_check(d0, d, "log2");
- infinity_check(x, d, "log2");
- return DBL2NUM(d);
+ d = log(RFLOAT(x)->value);
+ domain_check(d, "log");
+ return rb_float_new(d);
}
/*
* call-seq:
* Math.log10(numeric) => float
- *
+ *
* Returns the base 10 logarithm of <i>numeric</i>.
- *
- * Math.log10(1) #=> 0.0
- * Math.log10(10) #=> 1.0
- * Math.log10(10**100) #=> 100.0
- *
*/
static VALUE
-math_log10(VALUE obj, VALUE x)
+math_log10(obj, x)
+ VALUE obj, x;
{
- double d0, d;
+ double d;
Need_Float(x);
errno = 0;
- d0 = RFLOAT_VALUE(x);
- d = log10(d0);
- domain_check(d0, d, "log10");
- infinity_check(x, d, "log10");
- return DBL2NUM(d);
+ d = log10(RFLOAT(x)->value);
+ domain_check(d, "log10");
+ return rb_float_new(d);
}
/*
* call-seq:
* Math.sqrt(numeric) => float
- *
+ *
* Returns the non-negative square root of <i>numeric</i>.
- *
- * 0.upto(10) {|x|
- * p [x, Math.sqrt(x), Math.sqrt(x)**2]
- * }
- * #=>
- * [0, 0.0, 0.0]
- * [1, 1.0, 1.0]
- * [2, 1.4142135623731, 2.0]
- * [3, 1.73205080756888, 3.0]
- * [4, 2.0, 4.0]
- * [5, 2.23606797749979, 5.0]
- * [6, 2.44948974278318, 6.0]
- * [7, 2.64575131106459, 7.0]
- * [8, 2.82842712474619, 8.0]
- * [9, 3.0, 9.0]
- * [10, 3.16227766016838, 10.0]
- *
*/
static VALUE
-math_sqrt(VALUE obj, VALUE x)
+math_sqrt(obj, x)
+ VALUE obj, x;
{
- double d0, d;
+ double d;
Need_Float(x);
errno = 0;
- d0 = RFLOAT_VALUE(x);
- d = sqrt(d0);
- domain_check(d0, d, "sqrt");
- return DBL2NUM(d);
-}
-
-/*
- * call-seq:
- * Math.cbrt(numeric) => float
- *
- * Returns the cube root of <i>numeric</i>.
- *
- * -9.upto(9) {|x|
- * p [x, Math.cbrt(x), Math.cbrt(x)**3]
- * }
- * #=>
- * [-9, -2.0800838230519, -9.0]
- * [-8, -2.0, -8.0]
- * [-7, -1.91293118277239, -7.0]
- * [-6, -1.81712059283214, -6.0]
- * [-5, -1.7099759466767, -5.0]
- * [-4, -1.5874010519682, -4.0]
- * [-3, -1.44224957030741, -3.0]
- * [-2, -1.25992104989487, -2.0]
- * [-1, -1.0, -1.0]
- * [0, 0.0, 0.0]
- * [1, 1.0, 1.0]
- * [2, 1.25992104989487, 2.0]
- * [3, 1.44224957030741, 3.0]
- * [4, 1.5874010519682, 4.0]
- * [5, 1.7099759466767, 5.0]
- * [6, 1.81712059283214, 6.0]
- * [7, 1.91293118277239, 7.0]
- * [8, 2.0, 8.0]
- * [9, 2.0800838230519, 9.0]
- *
- */
-
-static VALUE
-math_cbrt(VALUE obj, VALUE x)
-{
- Need_Float(x);
- return DBL2NUM(cbrt(RFLOAT_VALUE(x)));
+ d = sqrt(RFLOAT(x)->value);
+ domain_check(d, "sqrt");
+ return rb_float_new(d);
}
/*
* call-seq:
* Math.frexp(numeric) => [ fraction, exponent ]
- *
+ *
* Returns a two-element array containing the normalized fraction (a
* <code>Float</code>) and exponent (a <code>Fixnum</code>) of
* <i>numeric</i>.
- *
+ *
* fraction, exponent = Math.frexp(1234) #=> [0.6025390625, 11]
* fraction * 2**exponent #=> 1234.0
*/
static VALUE
-math_frexp(VALUE obj, VALUE x)
+math_frexp(obj, x)
+ VALUE obj, x;
{
double d;
int exp;
Need_Float(x);
-
- d = frexp(RFLOAT_VALUE(x), &exp);
- return rb_assoc_new(DBL2NUM(d), INT2NUM(exp));
+
+ d = frexp(RFLOAT(x)->value, &exp);
+ return rb_assoc_new(rb_float_new(d), INT2NUM(exp));
}
/*
* call-seq:
* Math.ldexp(flt, int) -> float
- *
+ *
* Returns the value of <i>flt</i>*(2**<i>int</i>).
- *
+ *
* fraction, exponent = Math.frexp(1234)
* Math.ldexp(fraction, exponent) #=> 1234.0
*/
static VALUE
-math_ldexp(VALUE obj, VALUE x, VALUE n)
+math_ldexp(obj, x, n)
+ VALUE obj, x, n;
{
Need_Float(x);
- return DBL2NUM(ldexp(RFLOAT_VALUE(x), NUM2INT(n)));
+ return rb_float_new(ldexp(RFLOAT(x)->value, NUM2INT(n)));
}
/*
* call-seq:
* Math.hypot(x, y) => float
- *
+ *
* Returns sqrt(x**2 + y**2), the hypotenuse of a right-angled triangle
* with sides <i>x</i> and <i>y</i>.
- *
+ *
* Math.hypot(3, 4) #=> 5.0
*/
static VALUE
-math_hypot(VALUE obj, VALUE x, VALUE y)
+math_hypot(obj, x, y)
+ VALUE obj, x, y;
{
Need_Float2(x, y);
- return DBL2NUM(hypot(RFLOAT_VALUE(x), RFLOAT_VALUE(y)));
+ return rb_float_new(hypot(RFLOAT(x)->value, RFLOAT(y)->value));
}
/*
@@ -574,10 +450,11 @@ math_hypot(VALUE obj, VALUE x, VALUE y)
*/
static VALUE
-math_erf(VALUE obj, VALUE x)
+math_erf(obj, x)
+ VALUE obj, x;
{
Need_Float(x);
- return DBL2NUM(erf(RFLOAT_VALUE(x)));
+ return rb_float_new(erf(RFLOAT(x)->value));
}
/*
@@ -588,180 +465,36 @@ math_erf(VALUE obj, VALUE x)
*/
static VALUE
-math_erfc(VALUE obj, VALUE x)
+math_erfc(obj, x)
+ VALUE obj, x;
{
Need_Float(x);
- return DBL2NUM(erfc(RFLOAT_VALUE(x)));
+ return rb_float_new(erfc(RFLOAT(x)->value));
}
/*
- * call-seq:
- * Math.gamma(x) => float
- *
- * Calculates the gamma function of x.
- *
- * Note that gamma(n) is same as fact(n-1) for integer n > 0.
- * However gamma(n) returns float and possibly has error in calculation.
- *
- * def fact(n) (1..n).inject(1) {|r,i| r*i } end
- * 1.upto(26) {|i| p [i, Math.gamma(i), fact(i-1)] }
- * #=> [1, 1.0, 1]
- * # [2, 1.0, 1]
- * # [3, 2.0, 2]
- * # [4, 6.0, 6]
- * # [5, 24.0, 24]
- * # [6, 120.0, 120]
- * # [7, 720.0, 720]
- * # [8, 5040.0, 5040]
- * # [9, 40320.0, 40320]
- * # [10, 362880.0, 362880]
- * # [11, 3628800.0, 3628800]
- * # [12, 39916800.0, 39916800]
- * # [13, 479001600.0, 479001600]
- * # [14, 6227020800.0, 6227020800]
- * # [15, 87178291200.0, 87178291200]
- * # [16, 1307674368000.0, 1307674368000]
- * # [17, 20922789888000.0, 20922789888000]
- * # [18, 355687428096000.0, 355687428096000]
- * # [19, 6.402373705728e+15, 6402373705728000]
- * # [20, 1.21645100408832e+17, 121645100408832000]
- * # [21, 2.43290200817664e+18, 2432902008176640000]
- * # [22, 5.109094217170944e+19, 51090942171709440000]
- * # [23, 1.1240007277776077e+21, 1124000727777607680000]
- * # [24, 2.5852016738885062e+22, 25852016738884976640000]
- * # [25, 6.204484017332391e+23, 620448401733239439360000]
- * # [26, 1.5511210043330954e+25, 15511210043330985984000000]
- *
- */
-
-static VALUE
-math_gamma(VALUE obj, VALUE x)
-{
- static double fact_table[] = {
- /* fact(0) */ 1.0,
- /* fact(1) */ 1.0,
- /* fact(2) */ 2.0,
- /* fact(3) */ 6.0,
- /* fact(4) */ 24.0,
- /* fact(5) */ 120.0,
- /* fact(6) */ 720.0,
- /* fact(7) */ 5040.0,
- /* fact(8) */ 40320.0,
- /* fact(9) */ 362880.0,
- /* fact(10) */ 3628800.0,
- /* fact(11) */ 39916800.0,
- /* fact(12) */ 479001600.0,
- /* fact(13) */ 6227020800.0,
- /* fact(14) */ 87178291200.0,
- /* fact(15) */ 1307674368000.0,
- /* fact(16) */ 20922789888000.0,
- /* fact(17) */ 355687428096000.0,
- /* fact(18) */ 6402373705728000.0,
- /* fact(19) */ 121645100408832000.0,
- /* fact(20) */ 2432902008176640000.0,
- /* fact(21) */ 51090942171709440000.0,
- /* fact(22) */ 1124000727777607680000.0,
- /* fact(23)=25852016738884976640000 needs 56bit mantissa which is
- * impossible to represent exactly in IEEE 754 double. */
- };
- double d0, d;
- double intpart, fracpart;
- Need_Float(x);
- d0 = RFLOAT_VALUE(x);
- fracpart = modf(d0, &intpart);
- if (fracpart == 0.0 &&
- 0 < intpart &&
- (size_t)intpart <= sizeof(fact_table)/sizeof(*fact_table)) {
- return DBL2NUM(fact_table[(int)intpart - 1]);
- }
- errno = 0;
- d = tgamma(d0);
- domain_check(d0, d, "gamma");
- return DBL2NUM(d);
-}
-
-/*
- * call-seq:
- * Math.lgamma(x) => [float, -1 or 1]
- *
- * Calculates the logarithmic gamma of x and
- * the sign of gamma of x.
- *
- * Math.lgamma(x) is same as
- * [Math.log(Math.gamma(x).abs), Math.gamma(x) < 0 ? -1 : 1]
- * but avoid overflow by Math.gamma(x) for large x.
- */
-
-static VALUE
-math_lgamma(VALUE obj, VALUE x)
-{
- double d0, d;
- int sign;
- VALUE v;
- Need_Float(x);
- errno = 0;
- d0 = RFLOAT_VALUE(x);
- d = lgamma_r(d0, &sign);
- domain_check(d0, d, "lgamma");
- v = DBL2NUM(d);
- return rb_assoc_new(v, INT2FIX(sign));
-}
-
-
-#define exp1(n) \
-VALUE \
-rb_math_##n(VALUE x)\
-{\
- return math_##n(rb_mMath, x);\
-}
-
-#define exp2(n) \
-VALUE \
-rb_math_##n(VALUE x, VALUE y)\
-{\
- return math_##n(rb_mMath, x, y);\
-}
-
-exp2(atan2)
-exp1(cos)
-exp1(cosh)
-exp1(exp)
-exp2(hypot)
-
-VALUE
-rb_math_log(int argc, VALUE *argv)
-{
- return math_log(argc, argv);
-}
-
-exp1(sin)
-exp1(sinh)
-exp1(sqrt)
-
-
-/*
* The <code>Math</code> module contains module functions for basic
* trigonometric and transcendental functions. See class
* <code>Float</code> for a list of constants that
* define Ruby's floating point accuracy.
- */
+ */
void
-Init_Math(void)
+Init_Math()
{
rb_mMath = rb_define_module("Math");
#ifdef M_PI
- rb_define_const(rb_mMath, "PI", DBL2NUM(M_PI));
+ rb_define_const(rb_mMath, "PI", rb_float_new(M_PI));
#else
- rb_define_const(rb_mMath, "PI", DBL2NUM(atan(1.0)*4.0));
+ rb_define_const(rb_mMath, "PI", rb_float_new(atan(1.0)*4.0));
#endif
#ifdef M_E
- rb_define_const(rb_mMath, "E", DBL2NUM(M_E));
+ rb_define_const(rb_mMath, "E", rb_float_new(M_E));
#else
- rb_define_const(rb_mMath, "E", DBL2NUM(exp(1.0)));
+ rb_define_const(rb_mMath, "E", rb_float_new(exp(1.0)));
#endif
rb_define_module_function(rb_mMath, "atan2", math_atan2, 2);
@@ -782,11 +515,9 @@ Init_Math(void)
rb_define_module_function(rb_mMath, "atanh", math_atanh, 1);
rb_define_module_function(rb_mMath, "exp", math_exp, 1);
- rb_define_module_function(rb_mMath, "log", math_log, -1);
- rb_define_module_function(rb_mMath, "log2", math_log2, 1);
+ rb_define_module_function(rb_mMath, "log", math_log, 1);
rb_define_module_function(rb_mMath, "log10", math_log10, 1);
rb_define_module_function(rb_mMath, "sqrt", math_sqrt, 1);
- rb_define_module_function(rb_mMath, "cbrt", math_cbrt, 1);
rb_define_module_function(rb_mMath, "frexp", math_frexp, 1);
rb_define_module_function(rb_mMath, "ldexp", math_ldexp, 2);
@@ -795,7 +526,4 @@ Init_Math(void)
rb_define_module_function(rb_mMath, "erf", math_erf, 1);
rb_define_module_function(rb_mMath, "erfc", math_erfc, 1);
-
- rb_define_module_function(rb_mMath, "gamma", math_gamma, 1);
- rb_define_module_function(rb_mMath, "lgamma", math_lgamma, 1);
}
diff --git a/mdoc2man.rb b/mdoc2man.rb
new file mode 100755
index 0000000000..910b2e5745
--- /dev/null
+++ b/mdoc2man.rb
@@ -0,0 +1,465 @@
+#!/usr/bin/env ruby
+###
+### mdoc2man - mdoc to man converter
+###
+### Quick usage: mdoc2man.rb < mdoc_manpage.8 > man_manpage.8
+###
+### Ported from Perl by Akinori MUSHA.
+###
+### Copyright (c) 2001 University of Illinois Board of Trustees
+### Copyright (c) 2001 Mark D. Roth
+### Copyright (c) 2002, 2003 Akinori MUSHA
+### 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. All advertising materials mentioning features or use of this software
+### must display the following acknowledgement:
+### This product includes software developed by the University of
+### Illinois at Urbana, and their contributors.
+### 4. The University nor the names of their
+### contributors may be used to endorse or promote products derived from
+### this software without specific prior written permission.
+###
+### THIS SOFTWARE IS PROVIDED BY THE TRUSTEES 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 TRUSTEES 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.
+###
+### $Id$
+###
+
+class Mdoc2Man
+ ANGLE = 1
+ OPTION = 2
+ PAREN = 3
+
+ RE_PUNCT = /^[!"'),\.\/:;>\?\]`]$/
+
+ def initialize
+ @name = @date = @id = nil
+ @refauthors = @reftitle = @refissue = @refdate = @refopt = nil
+
+ @optlist = 0 ### 1 = bullet, 2 = enum, 3 = tag, 4 = item
+ @oldoptlist = 0
+ @nospace = 0 ### 0, 1, 2
+ @enum = 0
+ @synopsis = true
+ @reference = false
+ @ext = false
+ @extopt = false
+ @literal = false
+ end
+
+ def mdoc2man(i, o)
+ i.each { |line|
+ if /^\./ !~ line
+ o.print line
+ o.print ".br\n" if @literal
+ next
+ end
+
+ line.slice!(0, 1)
+
+ next if /\\"/ =~ line
+
+ line = parse_macro(line) and o.print line
+ }
+
+ initialize
+ end
+
+ def parse_macro(line)
+ words = line.split
+ retval = ''
+
+ quote = []
+ dl = false
+
+ while word = words.shift
+ case word
+ when RE_PUNCT
+ while q = quote.pop
+ case q
+ when OPTION
+ retval << ']'
+ when PAREN
+ retval << ')'
+ when ANGLE
+ retval << '>'
+ end
+ end
+ retval << word
+ next
+ when 'Li', 'Pf'
+ @nospace = 1
+ next
+ when 'Xo'
+ @ext = true
+ retval << ' ' unless retval.empty? || /[\n ]\z/ =~ retval
+ next
+ when 'Xc'
+ @ext = false
+ retval << "\n" unless @extopt
+ break
+ when 'Bd'
+ @literal = true if words[0] == '-literal'
+ retval << "\n"
+ break
+ when 'Ed'
+ @literal = false
+ break
+ when 'Ns'
+ @nospace = 1 if @nospace == 0
+ retval.chomp!(' ')
+ next
+ when 'No'
+ retval.chomp!(' ')
+ retval << words.shift
+ next
+ when 'Dq'
+ retval << '``'
+ begin
+ retval << words.shift << ' '
+ end until words.empty? || RE_PUNCT =~ words[0]
+ retval.chomp!(' ')
+ retval << '\'\''
+ @nospace = 1 if @nospace == 0 && RE_PUNCT =~ words[0]
+ next
+ when 'Sq', 'Ql'
+ retval << '`' << words.shift << '\''
+ @nospace = 1 if @nospace == 0 && RE_PUNCT =~ words[0]
+ next
+ # when 'Ic'
+ # retval << '\\fB' << words.shift << '\\fP'
+ # next
+ when 'Oo'
+ #retval << "[\\c\n"
+ @extopt = true
+ @nospace = 1 if @nospace == 0
+ retval << '['
+ next
+ when 'Oc'
+ @extopt = false
+ retval << ']'
+ next
+ when 'Ao'
+ @nospace = 1 if @nospace == 0
+ retval << '<'
+ next
+ when 'Ac'
+ retval << '>'
+ next
+ end
+
+ retval << ' ' if @nospace == 0 && !(retval.empty? || /[\n ]\z/ =~ retval)
+ @nospace = 0 if @nospace == 1
+
+ case word
+ when 'Dd'
+ @date = words.join(' ')
+ return nil
+ when 'Dt'
+ if words.size >= 2 && words[1] == '""' &&
+ /^(.*)\(([0-9])\)$/ =~ words[0]
+ words[0] = $1
+ words[1] = $2
+ end
+ @id = words.join(' ')
+ return nil
+ when 'Os'
+ retval << '.TH ' << @id << ' "' << @date << '" "' <<
+ words.join(' ') << '"'
+ break
+ when 'Sh'
+ retval << '.SH'
+ @synopsis = (words[0] == 'SYNOPSIS')
+ next
+ when 'Xr'
+ retval << '\\fB' << words.shift <<
+ '\\fP(' << words.shift << ')' << words.shift
+ break
+ when 'Rs'
+ @refauthors = []
+ @reftitle = ''
+ @refissue = ''
+ @refdate = ''
+ @refopt = ''
+ @reference = true
+ break
+ when 'Re'
+ retval << "\n"
+
+ # authors
+ while @refauthors.size > 1
+ retval << @refauthors.shift << ', '
+ end
+ retval << 'and ' unless retval.empty?
+ retval << @refauthors.shift
+
+ # title
+ retval << ', \\fI' << @reftitle << '\\fP'
+
+ # issue
+ retval << ', ' << @refissue unless @refissue.empty?
+
+ # date
+ retval << ', ' << @refdate unless @refdate.empty?
+
+ # optional info
+ retval << ', ' << @refopt unless @refopt.empty?
+
+ retval << ".\n"
+
+ @reference = false
+ break
+ when 'An'
+ next
+ when 'Dl'
+ retval << ".nf\n" << '\\& '
+ dl = true
+ next
+ when 'Ux'
+ retval << "UNIX"
+ next
+ end
+
+ if @reference
+ case word
+ when '%A'
+ @refauthors.unshift(words.join(' '))
+ break
+ when '%T'
+ @reftitle = words.join(' ')
+ @reftitle.sub!(/^"/, '')
+ @reftitle.sub!(/"$/, '')
+ break
+ when '%N'
+ @refissue = words.join(' ')
+ break
+ when '%D'
+ @refdate = words.join(' ')
+ break
+ when '%O'
+ @refopt = words.join(' ')
+ break
+ end
+ end
+
+ case word
+ when 'Nm'
+ name = words.empty? ? @name : words.shift
+ @name ||= name
+ retval << ".br\n" if @synopsis
+ retval << "\\fB" << name << "\\fP"
+ @nospace = 1 if @nospace == 0 && RE_PUNCT =~ words[0]
+ next
+ when 'Nd'
+ retval << '\\-'
+ next
+ when 'Fl'
+ retval << '\\fB\\-' << words.shift << '\\fP'
+ @nospace = 1 if @nospace == 0 && RE_PUNCT =~ words[0]
+ next
+ when 'Ar'
+ retval << '\\fI'
+ if words.empty?
+ retval << 'file ...\\fP'
+ else
+ retval << words.shift << '\\fP'
+ while words[0] == '|'
+ retval << ' ' << words.shift << ' \\fI' << words.shift << '\\fP'
+ end
+ @nospace = 1 if @nospace == 0 && RE_PUNCT =~ words[0]
+ next
+ end
+ when 'Cm'
+ retval << '\\fB' << words.shift << '\\fP'
+ while RE_PUNCT =~ words[0]
+ retval << words.shift
+ end
+ next
+ when 'Op'
+ quote << OPTION
+ @nospace = 1 if @nospace == 0
+ retval << '['
+ # words.push(words.pop + ']')
+ next
+ when 'Aq'
+ quote << ANGLE
+ @nospace = 1 if @nospace == 0
+ retval << '<'
+ # words.push(words.pop + '>')
+ next
+ when 'Pp'
+ retval << "\n"
+ next
+ when 'Ss'
+ retval << '.SS'
+ next
+ end
+
+ if word == 'Pa' && !quote.include?(OPTION)
+ retval << '\\fI'
+ retval << '\\&' if /^\./ =~ words[0]
+ retval << words.shift << '\\fP'
+ while RE_PUNCT =~ words[0]
+ retval << words.shift
+ end
+ # @nospace = 1 if @nospace == 0 && RE_PUNCT =~ words[0]
+ next
+ end
+
+ case word
+ when 'Dv'
+ retval << '.BR'
+ next
+ when 'Em', 'Ev'
+ retval << '.IR'
+ next
+ when 'Pq'
+ retval << '('
+ @nospace = 1
+ quote << PAREN
+ next
+ when 'Sx', 'Sy'
+ retval << '.B ' << words.join(' ')
+ break
+ when 'Ic'
+ retval << '\\fB'
+ until words.empty? || RE_PUNCT =~ words[0]
+ case words[0]
+ when 'Op'
+ words.shift
+ retval << '['
+ words.push(words.pop + ']')
+ next
+ when 'Aq'
+ words.shift
+ retval << '<'
+ words.push(words.pop + '>')
+ next
+ when 'Ar'
+ words.shift
+ retval << '\\fI' << words.shift << '\\fP'
+ else
+ retval << words.shift
+ end
+
+ retval << ' ' if @nospace == 0
+ end
+
+ retval.chomp!(' ')
+ retval << '\\fP'
+ retval << words.shift unless words.empty?
+ break
+ when 'Bl'
+ @oldoptlist = @optlist
+
+ case words[0]
+ when '-bullet'
+ @optlist = 1
+ when '-enum'
+ @optlist = 2
+ @enum = 0
+ when '-tag'
+ @optlist = 3
+ when '-item'
+ @optlist = 4
+ end
+
+ break
+ when 'El'
+ @optlist = @oldoptlist
+ next
+ end
+
+ if @optlist != 0 && word == 'It'
+ case @optlist
+ when 1
+ # bullets
+ retval << '.IP \\(bu'
+ when 2
+ # enum
+ @enum += 1
+ retval << '.IP ' << @enum << '.'
+ when 3
+ # tags
+ retval << ".TP\n"
+ case words[0]
+ when 'Pa', 'Ev'
+ words.shift
+ retval << '.B'
+ end
+ when 4
+ # item
+ retval << ".IP\n"
+ end
+
+ next
+ end
+
+ case word
+ when 'Sm'
+ case words[0]
+ when 'off'
+ @nospace = 2
+ when 'on'
+ # retval << "\n"
+ @nospace = 0
+ end
+ words.shift
+ next
+ end
+
+ retval << word
+ end
+
+ return nil if retval == '.'
+
+ retval.sub!(/\A\.([^a-zA-Z])/, "\\1")
+ # retval.chomp!(' ')
+
+ while q = quote.pop
+ case q
+ when OPTION
+ retval << ']'
+ when PAREN
+ retval << ')'
+ when ANGLE
+ retval << '>'
+ end
+ end
+
+ # retval << ' ' unless @nospace == 0 || retval.empty? || /\n\z/ =~ retval
+
+ retval << ' ' unless !@ext || @extopt || / $/ =~ retval
+
+ retval << "\n" unless @ext || @extopt || retval.empty? || /\n\z/ =~ retval
+
+ retval << ".fi\n" if dl
+
+ return retval
+ end
+
+ def self.mdoc2man(i, o)
+ new.mdoc2man(i, o)
+ end
+end
+
+if $0 == __FILE__
+ Mdoc2Man.mdoc2man(ARGF, STDOUT)
+end
diff --git a/method.h b/method.h
deleted file mode 100644
index 49eefade2d..0000000000
--- a/method.h
+++ /dev/null
@@ -1,78 +0,0 @@
-/**********************************************************************
-
- method.h -
-
- $Author$
- created at: Wed Jul 15 20:02:33 2009
-
- Copyright (C) 2009 Koichi Sasada
-
-**********************************************************************/
-#ifndef METHOD_H
-#define METHOD_H
-
-typedef enum {
- NOEX_PUBLIC = 0x00,
- NOEX_NOSUPER = 0x01,
- NOEX_PRIVATE = 0x02,
- NOEX_PROTECTED = 0x04,
- NOEX_MASK = 0x06,
- NOEX_BASIC = 0x08,
- NOEX_UNDEF = NOEX_NOSUPER,
- NOEX_MODFUNC = 0x12,
- NOEX_SUPER = 0x20,
- NOEX_VCALL = 0x40,
-} rb_method_flag_t;
-
-#define NOEX_SAFE(n) ((int)((n) >> 8) & 0x0F)
-#define NOEX_WITH(n, s) ((s << 8) | (n) | (ruby_running ? 0 : NOEX_BASIC))
-#define NOEX_WITH_SAFE(n) NOEX_WITH(n, rb_safe_level())
-
-/* method data type */
-
-typedef enum {
- VM_METHOD_TYPE_ISEQ,
- VM_METHOD_TYPE_CFUNC,
- VM_METHOD_TYPE_ATTRSET,
- VM_METHOD_TYPE_IVAR,
- VM_METHOD_TYPE_BMETHOD,
- VM_METHOD_TYPE_ZSUPER,
- VM_METHOD_TYPE_UNDEF,
- VM_METHOD_TYPE_NOTIMPLEMENTED,
- VM_METHOD_TYPE_OPTIMIZED, /* Kernel#send, Proc#call, etc */
-} rb_method_type_t;
-
-typedef struct rb_method_cfunc_struct {
- VALUE (*func)(ANYARGS);
- int argc;
-} rb_method_cfunc_t;
-
-typedef struct rb_iseq_struct rb_iseq_t;
-
-typedef struct rb_method_entry_struct {
- rb_method_flag_t flag;
- rb_method_type_t type; /* method type */
- ID called_id;
- ID original_id;
- VALUE klass; /* should be mark */
- union {
- rb_iseq_t *iseq; /* should be mark */
- rb_method_cfunc_t cfunc;
- ID attr_id;
- VALUE proc;
- enum method_optimized_type {
- OPTIMIZED_METHOD_TYPE_SEND,
- OPTIMIZED_METHOD_TYPE_CALL,
- } optimize_type;
- } body;
- int alias_count;
-} rb_method_entry_t;
-
-void rb_add_method_cfunc(VALUE klass, ID mid, VALUE (*func)(ANYARGS), int argc, rb_method_flag_t noex);
-rb_method_entry_t *rb_add_method(VALUE klass, ID mid, rb_method_type_t type, void *option, rb_method_flag_t noex);
-void rb_add_method_me(VALUE klass, ID mid, const rb_method_entry_t *, rb_method_flag_t noex);
-rb_method_entry_t *rb_method_entry(VALUE klass, ID id);
-int rb_method_entry_arity(const rb_method_entry_t *me);
-void rb_gc_mark_method_entry(const rb_method_entry_t *me);
-
-#endif /* METHOD_H */
diff --git a/misc/inf-ruby.el b/misc/inf-ruby.el
index 6b5d74c304..0a7eb76bda 100644
--- a/misc/inf-ruby.el
+++ b/misc/inf-ruby.el
@@ -2,6 +2,7 @@
;;;
;;; $Id$
;;; $Author$
+;;; $Date$
;;;
;;; Inferior Ruby Mode - ruby process in a buffer.
;;; adapted from cmuscheme.el
@@ -18,7 +19,7 @@
;;; (setq auto-mode-alist
;;; (append '(("\\.rb$" . ruby-mode)) auto-mode-alist))
;;; (setq interpreter-mode-alist (append '(("ruby" . ruby-mode))
-;;; interpreter-mode-alist))
+;;; interpreter-mode-alist))
;;;
;;; (2) set to load inf-ruby and set inf-ruby key definition in ruby-mode.
;;;
@@ -33,79 +34,79 @@
;;;
;;; HISTORY
;;; senda - 8 Apr 1998: Created.
-;;; $Log$
-;;; Revision 1.7 2004/07/27 08:11:36 matz
-;;; * eval.c (rb_eval): copy on write for argument local variable
-;;; assignment.
+;;; $Log$
+;;; Revision 1.7 2004/07/27 08:11:36 matz
+;;; * eval.c (rb_eval): copy on write for argument local variable
+;;; assignment.
;;;
-;;; * eval.c (assign): ditto.
+;;; * eval.c (assign): ditto.
;;;
-;;; * eval.c (rb_call0): update ruby_frame->argv with the default
-;;; value used for the optional arguments.
+;;; * eval.c (rb_call0): update ruby_frame->argv with the default
+;;; value used for the optional arguments.
;;;
-;;; * object.c (Init_Object): "===" calls rb_obj_equal() directly.
-;;; [ruby-list:39937]
+;;; * object.c (Init_Object): "===" calls rb_obj_equal() directly.
+;;; [ruby-list:39937]
;;;
-;;; Revision 1.6 2002/09/07 14:35:46 nobu
-;;; * misc/inf-ruby.el (inferior-ruby-error-regexp-alist): regexp
-;;; alist for error message from ruby.
-;;;
-;;; * misc/inf-ruby.el (inferior-ruby-mode): fixed for Emacs.
-;;;
-;;; * misc/inf-ruby.el (ruby-send-region): compilation-parse-errors
-;;; doesn't parse first line, so insert separators before each
-;;; evaluations.
-;;;
-;;; Revision 1.5 2002/08/19 10:05:47 nobu
-;;; * misc/inf-ruby.el (inf-ruby-keys): ruby-send-definition
-;;; conflicted with ruby-insert-end.
-;;;
-;;; * misc/inf-ruby.el (inferior-ruby-mode): compilation-minor-mode.
-;;;
-;;; * misc/inf-ruby.el (ruby-send-region): send as here document to
-;;; adjust source file/line. [ruby-talk:47113], [ruby-dev:17965]
-;;;
-;;; * misc/inf-ruby.el (ruby-send-terminator): added to make unique
-;;; terminator.
-;;;
-;;; Revision 1.4 2002/01/29 07:16:09 matz
-;;; * file.c (rb_stat_rdev_major): added. [new]
-;;;
-;;; * file.c (rb_stat_rdev_minor): added. [new]
-;;;
-;;; * file.c (rb_stat_inspect): print mode in octal.
-;;;
-;;; Revision 1.3 1999/12/01 09:24:18 matz
-;;; 19991201
-;;;
-;;; Revision 1.2 1999/08/13 05:45:18 matz
-;;; 1.4.0
-;;;
-;;; Revision 1.1.1.1.2.1 1999/07/15 07:59:59 matz
-;;; 990715
-;;;
-;;; Revision 1.1.1.1 1999/01/20 04:59:36 matz
-;;; ruby 1.3 cycle
-;;;
-;;; Revision 1.1.2.1 1998/12/16 07:30:36 matz
-;;; first public release of 1.1d (pre1.2) series
-;;;
-;;; Revision 1.4 1998/05/20 02:45:58 senda
-;;; default program to irb
+;;; Revision 1.6 2002/09/07 14:35:46 nobu
+;;; * misc/inf-ruby.el (inferior-ruby-error-regexp-alist): regexp
+;;; alist for error message from ruby.
+;;;
+;;; * misc/inf-ruby.el (inferior-ruby-mode): fixed for Emacs.
+;;;
+;;; * misc/inf-ruby.el (ruby-send-region): compilation-parse-errors
+;;; doesn't parse first line, so insert separators before each
+;;; evaluations.
+;;;
+;;; Revision 1.5 2002/08/19 10:05:47 nobu
+;;; * misc/inf-ruby.el (inf-ruby-keys): ruby-send-definition
+;;; conflicted with ruby-insert-end.
+;;;
+;;; * misc/inf-ruby.el (inferior-ruby-mode): compilation-minor-mode.
+;;;
+;;; * misc/inf-ruby.el (ruby-send-region): send as here document to
+;;; adjust source file/line. [ruby-talk:47113], [ruby-dev:17965]
+;;;
+;;; * misc/inf-ruby.el (ruby-send-terminator): added to make unique
+;;; terminator.
+;;;
+;;; Revision 1.4 2002/01/29 07:16:09 matz
+;;; * file.c (rb_stat_rdev_major): added. [new]
+;;;
+;;; * file.c (rb_stat_rdev_minor): added. [new]
+;;;
+;;; * file.c (rb_stat_inspect): print mode in octal.
+;;;
+;;; Revision 1.3 1999/12/01 09:24:18 matz
+;;; 19991201
+;;;
+;;; Revision 1.2 1999/08/13 05:45:18 matz
+;;; 1.4.0
+;;;
+;;; Revision 1.1.1.1.2.1 1999/07/15 07:59:59 matz
+;;; 990715
+;;;
+;;; Revision 1.1.1.1 1999/01/20 04:59:36 matz
+;;; ruby 1.3 cycle
+;;;
+;;; Revision 1.1.2.1 1998/12/16 07:30:36 matz
+;;; first public release of 1.1d (pre1.2) series
+;;;
+;;; Revision 1.4 1998/05/20 02:45:58 senda
+;;; default program to irb
;;;
-;;; Revision 1.3 1998/04/10 04:11:30 senda
-;;; modification by Matsumoto san (1.1b9_09)
-;;; remove-in-string defined
-;;; global variable :
-;;; inferior-ruby-first-prompt-pattern
-;;; inferior-ruby-prompt-pattern
-;;; defined
+;;; Revision 1.3 1998/04/10 04:11:30 senda
+;;; modification by Matsumoto san (1.1b9_09)
+;;; remove-in-string defined
+;;; global variable :
+;;; inferior-ruby-first-prompt-pattern
+;;; inferior-ruby-prompt-pattern
+;;; defined
;;;
-;;; Revision 1.2 1998/04/09 07:53:42 senda
-;;; remove M-C-x in inferior-ruby-mode
+;;; Revision 1.2 1998/04/09 07:53:42 senda
+;;; remove M-C-x in inferior-ruby-mode
;;;
-;;; Revision 1.1 1998/04/09 07:28:36 senda
-;;; Initial revision
+;;; Revision 1.1 1998/04/09 07:28:36 senda
+;;; Initial revision
;;;
;;;
@@ -145,13 +146,13 @@
(defconst inferior-ruby-error-regexp-alist
'(("SyntaxError: compile error\n^\\([^\(].*\\):\\([1-9][0-9]*\\):" 1 2)
- ("^\tfrom \\([^\(].*\\):\\([1-9][0-9]*\\)\\(:in `.*'\\)?$" 1 2)))
+ ("^\tfrom \\([^\(].*\\):\\([1-9][0-9]*\\)\\(:in `.*'\\)?$" 1 2)))
(cond ((not inferior-ruby-mode-map)
(setq inferior-ruby-mode-map
- (copy-keymap comint-mode-map))
+ (copy-keymap comint-mode-map))
; (define-key inferior-ruby-mode-map "\M-\C-x" ;gnu convention
-; 'ruby-send-definition)
+; 'ruby-send-definition)
; (define-key inferior-ruby-mode-map "\C-x\C-e" 'ruby-send-last-sexp)
(define-key inferior-ruby-mode-map "\C-c\C-l" 'ruby-load-file)
))
@@ -239,8 +240,8 @@ Defaults to a regexp ignoring all inputs of 0, 1, or 2 letters.")
(let ((rtn-str "") (start 0) match prev-start)
(while (setq match (string-match regexp str start))
(setq prev-start start
- start (match-end 0)
- rtn-str (concat rtn-str (substring str prev-start match))))
+ start (match-end 0)
+ rtn-str (concat rtn-str (substring str prev-start match))))
(concat rtn-str (substring str start))))
(defun ruby-get-old-input ()
@@ -249,21 +250,21 @@ Defaults to a regexp ignoring all inputs of 0, 1, or 2 letters.")
(let ((end (point)))
(re-search-backward inferior-ruby-first-prompt-pattern)
(remove-in-string (buffer-substring (point) end)
- inferior-ruby-prompt-pattern)
+ inferior-ruby-prompt-pattern)
)))
(defun ruby-args-to-list (string)
(let ((where (string-match "[ \t]" string)))
(cond ((null where) (list string))
- ((not (= where 0))
- (cons (substring string 0 where)
- (ruby-args-to-list (substring string (+ 1 where)
- (length string)))))
- (t (let ((pos (string-match "[^ \t]" string)))
- (if (null pos)
- nil
- (ruby-args-to-list (substring string pos
- (length string)))))))))
+ ((not (= where 0))
+ (cons (substring string 0 where)
+ (ruby-args-to-list (substring string (+ 1 where)
+ (length string)))))
+ (t (let ((pos (string-match "[^ \t]" string)))
+ (if (null pos)
+ nil
+ (ruby-args-to-list (substring string pos
+ (length string)))))))))
(defun run-ruby (cmd)
"Run an inferior Ruby process, input and output via buffer *ruby*.
@@ -274,13 +275,13 @@ of `ruby-program-name'). Runs the hooks `inferior-ruby-mode-hook'
\(Type \\[describe-mode] in the process buffer for a list of commands.)"
(interactive (list (if current-prefix-arg
- (read-string "Run Ruby: " ruby-program-name)
- ruby-program-name)))
+ (read-string "Run Ruby: " ruby-program-name)
+ ruby-program-name)))
(if (not (comint-check-proc "*ruby*"))
(let ((cmdlist (ruby-args-to-list cmd)))
- (set-buffer (apply 'make-comint "ruby" (car cmdlist)
- nil (cdr cmdlist)))
- (inferior-ruby-mode)))
+ (set-buffer (apply 'make-comint "ruby" (car cmdlist)
+ nil (cdr cmdlist)))
+ (inferior-ruby-mode)))
(setq ruby-program-name cmd)
(setq ruby-buffer "*ruby*")
(pop-to-buffer "*ruby*"))
@@ -297,20 +298,20 @@ Must not contain ruby meta characters.")
(let (term (file (buffer-file-name)) line)
(save-excursion
(save-restriction
- (widen)
- (goto-char start)
- (setq line (+ start (forward-line (- start)) 1))
- (goto-char start)
- (while (progn
- (setq term (apply 'format ruby-send-terminator (random) (current-time)))
- (re-search-forward (concat "^" (regexp-quote term) "$") end t)))))
+ (widen)
+ (goto-char start)
+ (setq line (+ start (forward-line (- start)) 1))
+ (goto-char start)
+ (while (progn
+ (setq term (apply 'format ruby-send-terminator (random) (current-time)))
+ (re-search-forward (concat "^" (regexp-quote term) "$") end t)))))
;; compilation-parse-errors parses from second line.
(save-excursion
(let ((m (process-mark (ruby-proc))))
- (set-buffer (marker-buffer m))
- (goto-char m)
- (insert ruby-eval-separator "\n")
- (set-marker m (point))))
+ (set-buffer (marker-buffer m))
+ (goto-char m)
+ (insert ruby-eval-separator "\n")
+ (set-marker m (point))))
(comint-send-string (ruby-proc) (format "eval <<'%s', nil, %S, %d\n" term file line))
(comint-send-region (ruby-proc) start end)
(comint-send-string (ruby-proc) (concat "\n" term "\n"))))
@@ -347,8 +348,8 @@ With argument, positions cursor at end of buffer."
(pop-to-buffer ruby-buffer)
(error "No current process buffer. See variable ruby-buffer."))
(cond (eob-p
- (push-mark)
- (goto-char (point-max)))))
+ (push-mark)
+ (goto-char (point-max)))))
(defun ruby-send-region-and-go (start end)
"Send the current region to the inferior Ruby process.
@@ -386,29 +387,29 @@ next one.")
(defun ruby-load-file (file-name)
"Load a Ruby file into the inferior Ruby process."
(interactive (comint-get-source "Load Ruby file: " ruby-prev-l/c-dir/file
- ruby-source-modes t)) ; T because LOAD
+ ruby-source-modes t)) ; T because LOAD
; needs an exact name
(comint-check-source file-name) ; Check to see if buffer needs saved.
(setq ruby-prev-l/c-dir/file (cons (file-name-directory file-name)
- (file-name-nondirectory file-name)))
+ (file-name-nondirectory file-name)))
(comint-send-string (ruby-proc) (concat "(load \""
- file-name
- "\"\)\n")))
+ file-name
+ "\"\)\n")))
(defun ruby-proc ()
"Returns the current ruby process. See variable ruby-buffer."
(let ((proc (get-buffer-process (if (eq major-mode 'inferior-ruby-mode)
- (current-buffer)
- ruby-buffer))))
+ (current-buffer)
+ ruby-buffer))))
(or proc
- (error "No current process. See variable ruby-buffer"))))
+ (error "No current process. See variable ruby-buffer"))))
;;; Do the user's customisation...
(defvar inf-ruby-load-hook nil
"This hook is run when inf-ruby is loaded in.
This is a good place to put keybindings.")
-
+
(run-hooks 'inf-ruby-load-hook)
(provide 'inf-ruby)
diff --git a/misc/ruby-electric.el b/misc/ruby-electric.el
index 174bd00fd9..c361089938 100644
--- a/misc/ruby-electric.el
+++ b/misc/ruby-electric.el
@@ -67,8 +67,8 @@
(?\` . ?\`)
(?\" . ?\")))
-(defcustom ruby-electric-simple-keywords-re
- (regexp-opt '("def" "if" "class" "module" "unless" "case" "while" "do" "until" "for" "begin") t)
+(defcustom ruby-electric-simple-keywords-re
+ "\\(def\\|if\\|class\\|module\\|unless\\|case\\|while\\|do\\|until\\|for\\|begin\\)"
"*Regular expresion matching keywords for which closing 'end'
is to be inserted."
:type 'regexp :group 'ruby-electric)
@@ -77,14 +77,14 @@ is to be inserted."
"*List of contexts where matching delimiter should be
inserted. The word 'all' will do all insertions."
:type '(set :extra-offset 8
- (const :tag "Everything" all )
- (const :tag "Curly brace" ?\{ )
- (const :tag "Square brace" ?\[ )
- (const :tag "Round brace" ?\( )
- (const :tag "Quote" ?\' )
- (const :tag "Double quote" ?\" )
- (const :tag "Back quote" ?\` )
- (const :tag "Vertical bar" ?\| ))
+ (const :tag "Everything" all )
+ (const :tag "Curly brace" ?\{ )
+ (const :tag "Square brace" ?\[ )
+ (const :tag "Round brace" ?\( )
+ (const :tag "Quote" ?\' )
+ (const :tag "Double quote" ?\" )
+ (const :tag "Back quote" ?\` )
+ (const :tag "Vertical bar" ?\| ))
:group 'ruby-electric)
(defcustom ruby-electric-newline-before-closing-bracket nil
@@ -126,15 +126,15 @@ strings. Note that you must have Font Lock enabled."
(self-insert-command (prefix-numeric-value arg))
(if (ruby-electric-space-can-be-expanded-p)
(save-excursion
- (ruby-indent-line t)
- (newline)
- (ruby-insert-end))))
+ (ruby-indent-line t)
+ (newline)
+ (ruby-insert-end))))
(defun ruby-electric-code-at-point-p()
(and ruby-electric-mode
(let* ((properties (text-properties-at (point))))
- (and (null (memq 'font-lock-string-face properties))
- (null (memq 'font-lock-comment-face properties))))))
+ (and (null (memq 'font-lock-string-face properties))
+ (null (memq 'font-lock-comment-face properties))))))
(defun ruby-electric-string-at-point-p()
(and ruby-electric-mode
@@ -147,17 +147,17 @@ strings. Note that you must have Font Lock enabled."
(defun ruby-electric-space-can-be-expanded-p()
(if (ruby-electric-code-at-point-p)
(let* ((ruby-electric-keywords-re
- (concat ruby-electric-simple-keywords-re "\\s-$"))
- (ruby-electric-single-keyword-in-line-re
- (concat "\\s-*" ruby-electric-keywords-re)))
- (save-excursion
- (backward-word 1)
- (or (looking-at ruby-electric-expandable-do-re)
- (and (looking-at ruby-electric-keywords-re)
- (not (string= "do" (match-string 1)))
- (progn
- (beginning-of-line)
- (looking-at ruby-electric-single-keyword-in-line-re))))))))
+ (concat ruby-electric-simple-keywords-re "\\s-$"))
+ (ruby-electric-single-keyword-in-line-re
+ (concat "\\s-*" ruby-electric-keywords-re)))
+ (save-excursion
+ (backward-word 1)
+ (or (looking-at ruby-electric-expandable-do-re)
+ (and (looking-at ruby-electric-keywords-re)
+ (not (string= "do" (match-string 1)))
+ (progn
+ (beginning-of-line)
+ (looking-at ruby-electric-single-keyword-in-line-re))))))))
(defun ruby-electric-curlies(arg)
@@ -165,17 +165,17 @@ strings. Note that you must have Font Lock enabled."
(self-insert-command (prefix-numeric-value arg))
(if (ruby-electric-is-last-command-char-expandable-punct-p)
(cond ((ruby-electric-code-at-point-p)
- (insert " ")
- (save-excursion
- (if ruby-electric-newline-before-closing-bracket
- (newline))
- (insert "}")))
- ((ruby-electric-string-at-point-p)
- (save-excursion
- (backward-char 1)
- (when (char-equal ?\# (preceding-char))
- (forward-char 1)
- (insert "}")))))))
+ (insert " ")
+ (save-excursion
+ (if ruby-electric-newline-before-closing-bracket
+ (newline))
+ (insert "}")))
+ ((ruby-electric-string-at-point-p)
+ (save-excursion
+ (backward-char 1)
+ (when (char-equal ?\# (preceding-char))
+ (forward-char 1)
+ (insert "}")))))))
(defun ruby-electric-matching-char(arg)
(interactive "P")
@@ -183,8 +183,8 @@ strings. Note that you must have Font Lock enabled."
(and (ruby-electric-is-last-command-char-expandable-punct-p)
(ruby-electric-code-at-point-p)
(save-excursion
- (insert (cdr (assoc last-command-char
- ruby-electric-matching-delimeter-alist))))))
+ (insert (cdr (assoc last-command-char
+ ruby-electric-matching-delimeter-alist))))))
(defun ruby-electric-bar(arg)
(interactive "P")
@@ -192,9 +192,9 @@ strings. Note that you must have Font Lock enabled."
(and (ruby-electric-is-last-command-char-expandable-punct-p)
(ruby-electric-code-at-point-p)
(and (save-excursion (re-search-backward ruby-electric-expandable-bar nil t))
- (= (point) (match-end 0))) ;looking-back is missing on XEmacs
+ (= (point) (match-end 0))) ;looking-back is missing on XEmacs
(save-excursion
- (insert "|"))))
+ (insert "|"))))
(provide 'ruby-electric)
diff --git a/misc/ruby-mode.el b/misc/ruby-mode.el
index 70acd7266b..90204d0812 100644
--- a/misc/ruby-mode.el
+++ b/misc/ruby-mode.el
@@ -1,145 +1,74 @@
-;;; ruby-mode.el --- Major mode for editing Ruby files
+;;;
+;;; ruby-mode.el -
+;;;
+;;; $Author$
+;;; $Date$
+;;; created at: Fri Feb 4 14:49:13 JST 1994
+;;;
-;; Copyright (C) 1994, 1995, 1996 1997, 1998, 1999, 2000, 2001,
-;; 2002,2003, 2004, 2005, 2006, 2007, 2008
-;; Free Software Foundation, Inc.
-
-;; Authors: Yukihiro Matsumoto, Nobuyoshi Nakada
-;; URL: http://www.emacswiki.org/cgi-bin/wiki/RubyMode
-;; Created: Fri Feb 4 14:49:13 JST 1994
-;; Keywords: languages ruby
-;; Version: 0.9
-
-;; This file is not part of GNU Emacs. However, a newer version of
-;; ruby-mode is included in recent releases of GNU Emacs (version 23
-;; and up), but the new version is not guaranteed to be compatible
-;; with older versions of Emacs or XEmacs. This file is the last
-;; version that aims to keep this compatibility.
-
-;; You can also get the latest version from the Emacs Lisp Package
-;; Archive: http://tromey.com/elpa
-
-;; 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
-;; (at your option) any later version.
-
-;; It is distributed in the hope that it will be useful, but WITHOUT
-;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
-;; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
-;; License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with it. If not, see <http://www.gnu.org/licenses/>.
-
-;;; Commentary:
-
-;; Provides font-locking, indentation support, and navigation for Ruby code.
-;;
-;; If you're installing manually, you should add this to your .emacs
-;; file after putting it on your load path:
-;;
-;; (autoload 'ruby-mode "ruby-mode" "Major mode for ruby files" t)
-;; (add-to-list 'auto-mode-alist '("\\.rb$" . ruby-mode))
-;; (add-to-list 'interpreter-mode-alist '("ruby" . ruby-mode))
-;;
-
-;;; Code:
-
-(defconst ruby-mode-revision "$Revision$"
- "Ruby mode revision string.")
+(defconst ruby-mode-revision "$Revision$")
(defconst ruby-mode-version
- (and (string-match "[0-9.]+" ruby-mode-revision)
- (substring ruby-mode-revision (match-beginning 0) (match-end 0)))
- "Ruby mode version number.")
-
-(defconst ruby-keyword-end-re
- (if (string-match "\\_>" "ruby")
- "\\_>"
- "\\>"))
-
-(defconst ruby-block-beg-keywords
- '("class" "module" "def" "if" "unless" "case" "while" "until" "for" "begin" "do")
- "Keywords at the beginning of blocks.")
+ (progn
+ (string-match "[0-9.]+" ruby-mode-revision)
+ (substring ruby-mode-revision (match-beginning 0) (match-end 0))))
(defconst ruby-block-beg-re
- (regexp-opt ruby-block-beg-keywords)
- "Regexp to match the beginning of blocks.")
+ "class\\|module\\|def\\|if\\|unless\\|case\\|while\\|until\\|for\\|begin\\|do"
+ )
(defconst ruby-non-block-do-re
- (concat (regexp-opt '("while" "until" "for" "rescue") t) ruby-keyword-end-re)
- "Regexp to match")
+ "\\(while\\|until\\|for\\|rescue\\)\\>[^_]"
+ )
(defconst ruby-indent-beg-re
- (concat "\\(\\s *" (regexp-opt '("class" "module" "def") t) "\\)"
- (regexp-opt '("if" "unless" "case" "while" "until" "for" "begin")))
- "Regexp to match where the indentation gets deeper.")
-
-(defconst ruby-modifier-beg-keywords
- '("if" "unless" "while" "until")
- "Modifiers that are the same as the beginning of blocks.")
+ "\\(\\s *\\(class\\|module\\|def\\)\\)\\|if\\|unless\\|case\\|while\\|until\\|for\\|begin"
+ )
(defconst ruby-modifier-beg-re
- (regexp-opt ruby-modifier-beg-keywords)
- "Regexp to match modifiers same as the beginning of blocks.")
+ "if\\|unless\\|while\\|until"
+ )
(defconst ruby-modifier-re
- (regexp-opt (cons "rescue" ruby-modifier-beg-keywords))
- "Regexp to match modifiers.")
-
-(defconst ruby-block-mid-keywords
- '("then" "else" "elsif" "when" "rescue" "ensure")
- "Keywords where the indentation gets shallower in middle of block statements.")
+ (concat ruby-modifier-beg-re "\\|rescue")
+ )
(defconst ruby-block-mid-re
- (regexp-opt ruby-block-mid-keywords)
- "Regexp to match where the indentation gets shallower in middle of block statements.")
+ "then\\|else\\|elsif\\|when\\|rescue\\|ensure"
+ )
-(defconst ruby-block-op-keywords
- '("and" "or" "not")
- "Block operators.")
+(defconst ruby-block-op-re
+ "and\\|or\\|not"
+ )
(defconst ruby-block-hanging-re
- (regexp-opt (append ruby-modifier-beg-keywords ruby-block-op-keywords))
- "Regexp to match hanging block modifiers.")
+ (concat ruby-modifier-beg-re "\\|" ruby-block-op-re)
+ )
(defconst ruby-block-end-re "\\<end\\>")
(defconst ruby-here-doc-beg-re
- "\\(<\\)<\\(-\\)?\\(\\([a-zA-Z0-9_]+\\)\\|[\"]\\([^\"]+\\)[\"]\\|[']\\([^']+\\)[']\\)")
-
-(defconst ruby-here-doc-end-re
- "^\\([ \t]+\\)?\\(.*\\)\\(.\\)$")
+ "<<\\(-\\)?\\(\\([a-zA-Z0-9_]+\\)\\|[\"]\\([^\"]+\\)[\"]\\|[']\\([^']+\\)[']\\)")
(defun ruby-here-doc-end-match ()
(concat "^"
- (if (match-string 2) "[ \t]*" nil)
- (regexp-quote
- (or (match-string 4)
- (match-string 5)
- (match-string 6)))))
-
-(defun ruby-here-doc-beg-match ()
- (let ((contents (regexp-quote (concat (match-string 2) (match-string 3)))))
- (concat "<<"
- (let ((match (match-string 1)))
- (if (and match (> (length match) 0))
- (concat "\\(?:-\\([\"']?\\)\\|\\([\"']\\)" (match-string 1) "\\)"
- contents "\\b\\(\\1\\|\\2\\)")
- (concat "-?\\([\"']\\|\\)" contents "\\b\\1"))))))
+ (if (match-string 1) "[ \t]*" nil)
+ (regexp-quote
+ (or (match-string 3)
+ (match-string 4)
+ (match-string 5)))))
(defconst ruby-delimiter
(concat "[?$/%(){}#\"'`.:]\\|<<\\|\\[\\|\\]\\|\\<\\("
- ruby-block-beg-re
- "\\)\\>\\|" ruby-block-end-re
- "\\|^=begin\\|" ruby-here-doc-beg-re)
+ ruby-block-beg-re
+ "\\)\\>\\|" ruby-block-end-re
+ "\\|^=begin\\|" ruby-here-doc-beg-re)
)
(defconst ruby-negative
(concat "^[ \t]*\\(\\(" ruby-block-mid-re "\\)\\>\\|"
- ruby-block-end-re "\\|}\\|\\]\\)")
- "Regexp to match where the indentation gets shallower.")
+ ruby-block-end-re "\\|}\\|\\]\\)")
+ )
(defconst ruby-operator-chars "-,.+*/%&|^~=<>:")
(defconst ruby-operator-re (concat "[" ruby-operator-chars "]"))
@@ -209,23 +138,19 @@
(defcustom ruby-indent-tabs-mode nil
"*Indentation can insert tabs in ruby mode if this is non-nil."
:type 'boolean :group 'ruby)
-(put 'ruby-indent-tabs-mode 'safe-local-variable 'booleanp)
(defcustom ruby-indent-level 2
"*Indentation of ruby statements."
:type 'integer :group 'ruby)
-(put 'ruby-indent-level 'safe-local-variable 'integerp)
(defcustom ruby-comment-column 32
"*Indentation column of comments."
:type 'integer :group 'ruby)
-(put 'ruby-comment-column 'safe-local-variable 'integerp)
(defcustom ruby-deep-arglist t
"*Deep indent lists in parenthesis when non-nil.
Also ignores spaces after parenthesis when 'space."
:group 'ruby)
-(put 'ruby-deep-arglist 'safe-local-variable 'booleanp)
(defcustom ruby-deep-indent-paren '(?\( ?\[ ?\] t)
"*Deep indent lists in parenthesis when non-nil. t means continuous line.
@@ -236,20 +161,12 @@ Also ignores spaces after parenthesis when 'space."
"Default deep indent style."
:options '(t nil space) :group 'ruby)
-(defcustom ruby-encoding-map '((shift_jis . cp932) (shift-jis . cp932))
- "Alist to map encoding name from emacs to ruby."
- :group 'ruby)
-
-(defcustom ruby-use-encoding-map t
- "*Use `ruby-encoding-map' to set encoding magic comment if this is non-nil."
- :type 'boolean :group 'ruby)
-
(eval-when-compile (require 'cl))
(defun ruby-imenu-create-index-in-block (prefix beg end)
(let ((index-alist '()) (case-fold-search nil)
- name next pos decl sing)
+ name next pos decl sing)
(goto-char beg)
- (while (re-search-forward "^\\s *\\(\\(class\\s +\\|\\(class\\s *<<\\s *\\)\\|module\\s +\\)\\([^\(<\n ]+\\)\\|\\(def\\|alias\\)\\s +\\([^\(\n ]+\\)\\)" end t)
+ (while (re-search-forward "^\\s *\\(\\(class\\>\\(\\s *<<\\)?\\|module\\>\\)\\s *\\([^\(<\n ]+\\)\\|\\(def\\|alias\\)\\>\\s *\\([^\(\n ]+\\)\\)" end t)
(setq sing (match-beginning 3))
(setq decl (match-string 5))
(setq next (match-end 0))
@@ -257,29 +174,29 @@ Also ignores spaces after parenthesis when 'space."
(setq pos (match-beginning 0))
(cond
((string= "alias" decl)
- (if prefix (setq name (concat prefix name)))
- (push (cons name pos) index-alist))
+ (if prefix (setq name (concat prefix name)))
+ (push (cons name pos) index-alist))
((string= "def" decl)
- (if prefix
- (setq name
- (cond
- ((string-match "^self\." name)
- (concat (substring prefix 0 -1) (substring name 4)))
- (t (concat prefix name)))))
- (push (cons name pos) index-alist)
- (ruby-accurate-end-of-block end))
+ (if prefix
+ (setq name
+ (cond
+ ((string-match "^self\." name)
+ (concat (substring prefix 0 -1) (substring name 4)))
+ (t (concat prefix name)))))
+ (push (cons name pos) index-alist)
+ (ruby-accurate-end-of-block end))
(t
- (if (string= "self" name)
- (if prefix (setq name (substring prefix 0 -1)))
- (if prefix (setq name (concat (substring prefix 0 -1) "::" name)))
- (push (cons name pos) index-alist))
- (ruby-accurate-end-of-block end)
- (setq beg (point))
- (setq index-alist
- (nconc (ruby-imenu-create-index-in-block
- (concat name (if sing "." "#"))
- next beg) index-alist))
- (goto-char beg))))
+ (if (string= "self" name)
+ (if prefix (setq name (substring prefix 0 -1)))
+ (if prefix (setq name (concat (substring prefix 0 -1) "::" name)))
+ (push (cons name pos) index-alist))
+ (ruby-accurate-end-of-block end)
+ (setq beg (point))
+ (setq index-alist
+ (nconc (ruby-imenu-create-index-in-block
+ (concat name (if sing "." "#"))
+ next beg) index-alist))
+ (goto-char beg))))
index-alist))
(defun ruby-imenu-create-index ()
@@ -289,7 +206,7 @@ Also ignores spaces after parenthesis when 'space."
(let (state)
(or end (setq end (point-max)))
(while (and (setq state (apply 'ruby-parse-partial end state))
- (>= (nth 2 state) 0) (< (point) end)))))
+ (>= (nth 2 state) 0) (< (point) end)))))
(defun ruby-mode-variables ()
(set-syntax-table ruby-mode-syntax-table)
@@ -309,8 +226,6 @@ Also ignores spaces after parenthesis when 'space."
(setq indent-tabs-mode ruby-indent-tabs-mode)
(make-local-variable 'parse-sexp-ignore-comments)
(setq parse-sexp-ignore-comments t)
- (make-local-variable 'parse-sexp-lookup-properties)
- (setq parse-sexp-lookup-properties t)
(make-local-variable 'paragraph-start)
(setq paragraph-start (concat "$\\|" page-delimiter))
(make-local-variable 'paragraph-separate)
@@ -318,41 +233,6 @@ Also ignores spaces after parenthesis when 'space."
(make-local-variable 'paragraph-ignore-fill-prefix)
(setq paragraph-ignore-fill-prefix t))
-(defun ruby-mode-set-encoding ()
- (save-excursion
- (widen)
- (goto-char (point-min))
- (when (re-search-forward "[^\0-\177]" nil t)
- (goto-char (point-min))
- (let ((coding-system
- (or coding-system-for-write
- buffer-file-coding-system)))
- (if coding-system
- (setq coding-system
- (or (coding-system-get coding-system 'mime-charset)
- (coding-system-change-eol-conversion coding-system nil))))
- (setq coding-system
- (if coding-system
- (symbol-name
- (or (and ruby-use-encoding-map
- (cdr (assq coding-system ruby-encoding-map)))
- coding-system))
- "ascii-8bit"))
- (if (looking-at "^#![^\n]*ruby") (beginning-of-line 2))
- (cond ((looking-at "\\s *#.*-\*-\\s *\\(en\\)?coding\\s *:\\s *\\([-a-z0-9_]*\\)\\s *\\(;\\|-\*-\\)")
- (unless (string= (match-string 2) coding-system)
- (goto-char (match-beginning 2))
- (delete-region (point) (match-end 2))
- (and (looking-at "-\*-")
- (let ((n (skip-chars-backward " ")))
- (cond ((= n 0) (insert " ") (backward-char))
- ((= n -1) (insert " "))
- ((forward-char)))))
- (insert coding-system)))
- ((looking-at "\\s *#.*coding\\s *[:=]"))
- (t (insert "# -*- coding: " coding-system " -*-\n"))
- )))))
-
;;;###autoload
(defun ruby-mode ()
"Major mode for editing ruby scripts.
@@ -375,22 +255,12 @@ The variable ruby-indent-level controls the amount of indentation.
(make-local-variable 'add-log-current-defun-function)
(setq add-log-current-defun-function 'ruby-add-log-current-method)
- (add-hook
- (cond ((boundp 'before-save-hook)
- (make-local-variable 'before-save-hook)
- 'before-save-hook)
- ((boundp 'write-contents-functions) 'write-contents-functions)
- ((boundp 'write-contents-hooks) 'write-contents-hooks))
- 'ruby-mode-set-encoding)
-
(set (make-local-variable 'font-lock-defaults) '((ruby-font-lock-keywords) nil nil))
(set (make-local-variable 'font-lock-keywords) ruby-font-lock-keywords)
(set (make-local-variable 'font-lock-syntax-table) ruby-font-lock-syntax-table)
(set (make-local-variable 'font-lock-syntactic-keywords) ruby-font-lock-syntactic-keywords)
- (if (fboundp 'run-mode-hooks)
- (run-mode-hooks 'ruby-mode-hook)
- (run-hooks 'ruby-mode-hook)))
+ (run-mode-hooks 'ruby-mode-hook))
(defun ruby-current-indentation ()
(save-excursion
@@ -409,91 +279,89 @@ The variable ruby-indent-level controls the amount of indentation.
(defun ruby-indent-to (x)
(if x
(let (shift top beg)
- (and (< x 0) (error "invalid nest"))
- (setq shift (current-column))
- (beginning-of-line)
- (setq beg (point))
- (back-to-indentation)
- (setq top (current-column))
- (skip-chars-backward " \t")
- (if (>= shift top) (setq shift (- shift top))
- (setq shift 0))
- (if (and (bolp)
- (= x top))
- (move-to-column (+ x shift))
- (move-to-column top)
- (delete-region beg (point))
- (beginning-of-line)
- (indent-to x)
- (move-to-column (+ x shift))))))
+ (and (< x 0) (error "invalid nest"))
+ (setq shift (current-column))
+ (beginning-of-line)
+ (setq beg (point))
+ (back-to-indentation)
+ (setq top (current-column))
+ (skip-chars-backward " \t")
+ (if (>= shift top) (setq shift (- shift top))
+ (setq shift 0))
+ (if (and (bolp)
+ (= x top))
+ (move-to-column (+ x shift))
+ (move-to-column top)
+ (delete-region beg (point))
+ (beginning-of-line)
+ (indent-to x)
+ (move-to-column (+ x shift))))))
(defun ruby-special-char-p (&optional pnt)
(setq pnt (or pnt (point)))
(let ((c (char-before pnt)) (b (and (< (point-min) pnt) (char-before (1- pnt)))))
(cond ((or (eq c ??) (eq c ?$)))
- ((and (eq c ?:) (or (not b) (eq (char-syntax b) ? ))))
- ((eq c ?\\) (eq b ??)))))
+ ((and (eq c ?:) (or (not b) (eq (char-syntax b) ? ))))
+ ((eq c ?\\) (eq b ??)))))
(defun ruby-expr-beg (&optional option)
(save-excursion
(store-match-data nil)
(let ((space (skip-chars-backward " \t"))
- (start (point)))
+ (start (point)))
(cond
((bolp) t)
((progn
- (forward-char -1)
- (and (looking-at "\\?")
- (or (eq (char-syntax (char-before (point))) ?w)
- (ruby-special-char-p))))
- nil)
+ (forward-char -1)
+ (and (looking-at "\\?")
+ (or (eq (char-syntax (char-before (point))) ?w)
+ (ruby-special-char-p))))
+ nil)
((and (eq option 'heredoc) (< space 0)) t)
((or (looking-at ruby-operator-re)
- (looking-at "[\\[({,;]")
- (and (looking-at "[!?]")
- (or (not (eq option 'modifier))
- (bolp)
- (save-excursion (forward-char -1) (looking-at "\\Sw$"))))
- (and (looking-at ruby-symbol-re)
- (skip-chars-backward ruby-symbol-chars)
- (cond
- ((looking-at (regexp-opt
- (append ruby-block-beg-keywords
- ruby-block-op-keywords
- ruby-block-mid-keywords)
- 'words))
- (goto-char (match-end 0))
- (not (looking-at "\\s_")))
- ((eq option 'expr-qstr)
- (looking-at "[a-zA-Z][a-zA-z0-9_]* +%[^ \t]"))
- ((eq option 'expr-re)
- (looking-at "[a-zA-Z][a-zA-z0-9_]* +/[^ \t]"))
- (t nil)))))))))
+ (looking-at "[\\[({,;]")
+ (and (looking-at "[!?]")
+ (or (not (eq option 'modifier))
+ (bolp)
+ (save-excursion (forward-char -1) (looking-at "\\Sw$"))))
+ (and (looking-at ruby-symbol-re)
+ (skip-chars-backward ruby-symbol-chars)
+ (cond
+ ((or (looking-at (concat "\\<\\(" ruby-block-beg-re
+ "|" ruby-block-op-re
+ "|" ruby-block-mid-re "\\)\\>")))
+ (goto-char (match-end 0))
+ (not (looking-at "\\s_")))
+ ((eq option 'expr-qstr)
+ (looking-at "[a-zA-Z][a-zA-z0-9_]* +%[^ \t]"))
+ ((eq option 'expr-re)
+ (looking-at "[a-zA-Z][a-zA-z0-9_]* +/[^ \t]"))
+ (t nil)))))))))
(defun ruby-forward-string (term &optional end no-error expand)
(let ((n 1) (c (string-to-char term))
- (re (if expand
- (concat "[^\\]\\(\\\\\\\\\\)*\\([" term "]\\|\\(#{\\)\\)")
- (concat "[^\\]\\(\\\\\\\\\\)*[" term "]"))))
+ (re (if expand
+ (concat "[^\\]\\(\\\\\\\\\\)*\\([" term "]\\|\\(#{\\)\\)")
+ (concat "[^\\]\\(\\\\\\\\\\)*[" term "]"))))
(while (and (re-search-forward re end no-error)
- (if (match-beginning 3)
- (ruby-forward-string "}{" end no-error nil)
- (> (setq n (if (eq (char-before (point)) c)
- (1- n) (1+ n))) 0)))
+ (if (match-beginning 3)
+ (ruby-forward-string "}{" end no-error nil)
+ (> (setq n (if (eq (char-before (point)) c)
+ (1- n) (1+ n))) 0)))
(forward-char -1))
(cond ((zerop n))
- (no-error nil)
- ((error "unterminated string")))))
+ (no-error nil)
+ ((error "unterminated string")))))
(defun ruby-deep-indent-paren-p (c)
(cond ((listp ruby-deep-indent-paren)
- (let ((deep (assoc c ruby-deep-indent-paren)))
- (cond (deep
- (or (cdr deep) ruby-deep-indent-paren-style))
- ((memq c ruby-deep-indent-paren)
- ruby-deep-indent-paren-style))))
- ((eq c ruby-deep-indent-paren) ruby-deep-indent-paren-style)
- ((eq c ?\( ) ruby-deep-arglist)))
+ (let ((deep (assoc c ruby-deep-indent-paren)))
+ (cond (deep
+ (or (cdr deep) ruby-deep-indent-paren-style))
+ ((memq c ruby-deep-indent-paren)
+ ruby-deep-indent-paren-style))))
+ ((eq c ruby-deep-indent-paren) ruby-deep-indent-paren-style)
+ ((eq c ?\( ) ruby-deep-arglist)))
(defun ruby-parse-partial (&optional end in-string nest depth pcol indent)
(or depth (setq depth 0))
@@ -503,218 +371,218 @@ The variable ruby-indent-level controls the amount of indentation.
(goto-char (match-beginning 0))
(cond
((and (memq (char-before) '(?@ ?$)) (looking-at "\\sw"))
- (goto-char pnt))
- ((looking-at "[\"`]") ;skip string
- (cond
- ((and (not (eobp))
- (ruby-forward-string (buffer-substring (point) (1+ (point))) end t t))
- nil)
- (t
- (setq in-string (point))
- (goto-char end))))
+ (goto-char pnt))
+ ((looking-at "[\"`]") ;skip string
+ (cond
+ ((and (not (eobp))
+ (ruby-forward-string (buffer-substring (point) (1+ (point))) end t t))
+ nil)
+ (t
+ (setq in-string (point))
+ (goto-char end))))
((looking-at "'")
- (cond
- ((and (not (eobp))
- (re-search-forward "[^\\]\\(\\\\\\\\\\)*'" end t))
- nil)
- (t
- (setq in-string (point))
- (goto-char end))))
+ (cond
+ ((and (not (eobp))
+ (re-search-forward "[^\\]\\(\\\\\\\\\\)*'" end t))
+ nil)
+ (t
+ (setq in-string (point))
+ (goto-char end))))
((looking-at "/=")
- (goto-char pnt))
+ (goto-char pnt))
((looking-at "/")
- (cond
- ((and (not (eobp)) (ruby-expr-beg 'expr-re))
- (if (ruby-forward-string "/" end t t)
- nil
- (setq in-string (point))
- (goto-char end)))
- (t
- (goto-char pnt))))
+ (cond
+ ((and (not (eobp)) (ruby-expr-beg 'expr-re))
+ (if (ruby-forward-string "/" end t t)
+ nil
+ (setq in-string (point))
+ (goto-char end)))
+ (t
+ (goto-char pnt))))
((looking-at "%")
- (cond
- ((and (not (eobp))
- (ruby-expr-beg 'expr-qstr)
- (not (looking-at "%="))
- (looking-at "%[QqrxWw]?\\([^a-zA-Z0-9 \t\n]\\)"))
- (goto-char (match-beginning 1))
- (setq expand (not (memq (char-before) '(?q ?w))))
- (setq w (match-string 1))
- (cond
- ((string= w "[") (setq re "]["))
- ((string= w "{") (setq re "}{"))
- ((string= w "(") (setq re ")("))
- ((string= w "<") (setq re "><"))
- ((and expand (string= w "\\"))
- (setq w (concat "\\" w))))
- (unless (cond (re (ruby-forward-string re end t expand))
- (expand (ruby-forward-string w end t t))
- (t (re-search-forward
- (if (string= w "\\")
- "\\\\[^\\]*\\\\"
- (concat "[^\\]\\(\\\\\\\\\\)*" w))
- end t)))
- (setq in-string (point))
- (goto-char end)))
- (t
- (goto-char pnt))))
- ((looking-at "\\?") ;skip ?char
- (cond
- ((and (ruby-expr-beg)
- (looking-at "?\\(\\\\C-\\|\\\\M-\\)*\\\\?."))
- (goto-char (match-end 0)))
- (t
- (goto-char pnt))))
- ((looking-at "\\$") ;skip $char
- (goto-char pnt)
- (forward-char 1))
- ((looking-at "#") ;skip comment
- (forward-line 1)
- (goto-char (point))
- )
+ (cond
+ ((and (not (eobp))
+ (ruby-expr-beg 'expr-qstr)
+ (not (looking-at "%="))
+ (looking-at "%[QqrxWw]?\\([^a-zA-Z0-9 \t\n]\\)"))
+ (goto-char (match-beginning 1))
+ (setq expand (not (memq (char-before) '(?q ?w))))
+ (setq w (match-string 1))
+ (cond
+ ((string= w "[") (setq re "]["))
+ ((string= w "{") (setq re "}{"))
+ ((string= w "(") (setq re ")("))
+ ((string= w "<") (setq re "><"))
+ ((and expand (string= w "\\"))
+ (setq w (concat "\\" w))))
+ (unless (cond (re (ruby-forward-string re end t expand))
+ (expand (ruby-forward-string w end t t))
+ (t (re-search-forward
+ (if (string= w "\\")
+ "\\\\[^\\]*\\\\"
+ (concat "[^\\]\\(\\\\\\\\\\)*" w))
+ end t)))
+ (setq in-string (point))
+ (goto-char end)))
+ (t
+ (goto-char pnt))))
+ ((looking-at "\\?") ;skip ?char
+ (cond
+ ((and (ruby-expr-beg)
+ (looking-at "?\\(\\\\C-\\|\\\\M-\\)*\\\\?."))
+ (goto-char (match-end 0)))
+ (t
+ (goto-char pnt))))
+ ((looking-at "\\$") ;skip $char
+ (goto-char pnt)
+ (forward-char 1))
+ ((looking-at "#") ;skip comment
+ (forward-line 1)
+ (goto-char (point))
+ )
((looking-at "[\\[{(]")
- (let ((deep (ruby-deep-indent-paren-p (char-after))))
- (if (and deep (or (not (eq (char-after) ?\{)) (ruby-expr-beg)))
- (progn
- (and (eq deep 'space) (looking-at ".\\s +[^# \t\n]")
- (setq pnt (1- (match-end 0))))
- (setq nest (cons (cons (char-after (point)) pnt) nest))
- (setq pcol (cons (cons pnt depth) pcol))
- (setq depth 0))
- (setq nest (cons (cons (char-after (point)) pnt) nest))
- (setq depth (1+ depth))))
- (goto-char pnt)
- )
+ (let ((deep (ruby-deep-indent-paren-p (char-after))))
+ (if (and deep (or (not (eq (char-after) ?\{)) (ruby-expr-beg)))
+ (progn
+ (and (eq deep 'space) (looking-at ".\\s +[^# \t\n]")
+ (setq pnt (1- (match-end 0))))
+ (setq nest (cons (cons (char-after (point)) pnt) nest))
+ (setq pcol (cons (cons pnt depth) pcol))
+ (setq depth 0))
+ (setq nest (cons (cons (char-after (point)) pnt) nest))
+ (setq depth (1+ depth))))
+ (goto-char pnt)
+ )
((looking-at "[])}]")
- (if (ruby-deep-indent-paren-p (matching-paren (char-after)))
- (setq depth (cdr (car pcol)) pcol (cdr pcol))
- (setq depth (1- depth)))
- (setq nest (cdr nest))
- (goto-char pnt))
+ (if (ruby-deep-indent-paren-p (matching-paren (char-after)))
+ (setq depth (cdr (car pcol)) pcol (cdr pcol))
+ (setq depth (1- depth)))
+ (setq nest (cdr nest))
+ (goto-char pnt))
((looking-at ruby-block-end-re)
- (if (or (and (not (bolp))
- (progn
- (forward-char -1)
- (setq w (char-after (point)))
- (or (eq ?_ w)
- (eq ?. w))))
- (progn
- (goto-char pnt)
- (setq w (char-after (point)))
- (or (eq ?_ w)
- (eq ?! w)
- (eq ?? w))))
- nil
- (setq nest (cdr nest))
- (setq depth (1- depth)))
- (goto-char pnt))
+ (if (or (and (not (bolp))
+ (progn
+ (forward-char -1)
+ (setq w (char-after (point)))
+ (or (eq ?_ w)
+ (eq ?. w))))
+ (progn
+ (goto-char pnt)
+ (setq w (char-after (point)))
+ (or (eq ?_ w)
+ (eq ?! w)
+ (eq ?? w))))
+ nil
+ (setq nest (cdr nest))
+ (setq depth (1- depth)))
+ (goto-char pnt))
((looking-at "def\\s +[^(\n;]*")
- (if (or (bolp)
- (progn
- (forward-char -1)
- (not (eq ?_ (char-after (point))))))
- (progn
- (setq nest (cons (cons nil pnt) nest))
- (setq depth (1+ depth))))
- (goto-char (match-end 0)))
+ (if (or (bolp)
+ (progn
+ (forward-char -1)
+ (not (eq ?_ (char-after (point))))))
+ (progn
+ (setq nest (cons (cons nil pnt) nest))
+ (setq depth (1+ depth))))
+ (goto-char (match-end 0)))
((looking-at (concat "\\<\\(" ruby-block-beg-re "\\)\\>"))
- (and
- (save-match-data
- (or (not (looking-at (concat "do" ruby-keyword-end-re)))
- (save-excursion
- (back-to-indentation)
- (not (looking-at ruby-non-block-do-re)))))
- (or (bolp)
- (progn
- (forward-char -1)
- (setq w (char-after (point)))
- (not (or (eq ?_ w)
- (eq ?. w)))))
- (goto-char pnt)
- (setq w (char-after (point)))
- (not (eq ?_ w))
- (not (eq ?! w))
- (not (eq ?? w))
- (skip-chars-forward " \t")
- (goto-char (match-beginning 0))
- (or (not (looking-at ruby-modifier-re))
- (ruby-expr-beg 'modifier))
- (goto-char pnt)
- (setq nest (cons (cons nil pnt) nest))
- (setq depth (1+ depth)))
- (goto-char pnt))
+ (and
+ (save-match-data
+ (or (not (looking-at "do\\>[^_]"))
+ (save-excursion
+ (back-to-indentation)
+ (not (looking-at ruby-non-block-do-re)))))
+ (or (bolp)
+ (progn
+ (forward-char -1)
+ (setq w (char-after (point)))
+ (not (or (eq ?_ w)
+ (eq ?. w)))))
+ (goto-char pnt)
+ (setq w (char-after (point)))
+ (not (eq ?_ w))
+ (not (eq ?! w))
+ (not (eq ?? w))
+ (skip-chars-forward " \t")
+ (goto-char (match-beginning 0))
+ (or (not (looking-at ruby-modifier-re))
+ (ruby-expr-beg 'modifier))
+ (goto-char pnt)
+ (setq nest (cons (cons nil pnt) nest))
+ (setq depth (1+ depth)))
+ (goto-char pnt))
((looking-at ":\\(['\"]\\)")
- (goto-char (match-beginning 1))
- (ruby-forward-string (buffer-substring (match-beginning 1) (match-end 1)) end))
- ((looking-at ":\\([-,.+*/%&|^~<>]=?\\|===?\\|<=>\\|![~=]?\\)")
- (goto-char (match-end 0)))
+ (goto-char (match-beginning 1))
+ (ruby-forward-string (buffer-substring (match-beginning 1) (match-end 1)) end))
+ ((looking-at ":\\([-,.+*/%&|^~<>]=?\\|===?\\|<=>\\)")
+ (goto-char (match-end 0)))
((looking-at ":\\([a-zA-Z_][a-zA-Z_0-9]*[!?=]?\\)?")
- (goto-char (match-end 0)))
+ (goto-char (match-end 0)))
((or (looking-at "\\.\\.\\.?")
- (looking-at "\\.[0-9]+")
- (looking-at "\\.[a-zA-Z_0-9]+")
- (looking-at "\\."))
- (goto-char (match-end 0)))
+ (looking-at "\\.[0-9]+")
+ (looking-at "\\.[a-zA-Z_0-9]+")
+ (looking-at "\\."))
+ (goto-char (match-end 0)))
((looking-at "^=begin")
- (if (re-search-forward "^=end" end t)
- (forward-line 1)
- (setq in-string (match-end 0))
- (goto-char end)))
+ (if (re-search-forward "^=end" end t)
+ (forward-line 1)
+ (setq in-string (match-end 0))
+ (goto-char end)))
((looking-at "<<")
- (cond
- ((and (ruby-expr-beg 'heredoc)
- (looking-at "<<\\(-\\)?\\(\\([\"'`]\\)\\([^\n]+?\\)\\3\\|\\(?:\\sw\\|\\s_\\)+\\)"))
- (setq re (regexp-quote (or (match-string 4) (match-string 2))))
- (if (match-beginning 1) (setq re (concat "\\s *" re)))
- (let* ((id-end (goto-char (match-end 0)))
- (line-end-position (save-excursion (end-of-line) (point)))
- (state (list in-string nest depth pcol indent)))
- ;; parse the rest of the line
- (while (and (> line-end-position (point))
- (setq state (apply 'ruby-parse-partial
- line-end-position state))))
- (setq in-string (car state)
- nest (nth 1 state)
- depth (nth 2 state)
- pcol (nth 3 state)
- indent (nth 4 state))
- ;; skip heredoc section
- (if (re-search-forward (concat "^" re "$") end 'move)
- (forward-line 1)
- (setq in-string id-end)
- (goto-char end))))
- (t
- (goto-char pnt))))
+ (cond
+ ((and (ruby-expr-beg 'heredoc)
+ (looking-at "<<\\(-\\)?\\(\\([\"'`]\\)\\([^\n]+?\\)\\3\\|\\(?:\\sw\\|\\s_\\)+\\)"))
+ (setq re (regexp-quote (or (match-string 4) (match-string 2))))
+ (if (match-beginning 1) (setq re (concat "\\s *" re)))
+ (let* ((id-end (goto-char (match-end 0)))
+ (line-end-position (save-excursion (end-of-line) (point)))
+ (state (list in-string nest depth pcol indent)))
+ ;; parse the rest of the line
+ (while (and (> line-end-position (point))
+ (setq state (apply 'ruby-parse-partial
+ line-end-position state))))
+ (setq in-string (car state)
+ nest (nth 1 state)
+ depth (nth 2 state)
+ pcol (nth 3 state)
+ indent (nth 4 state))
+ ;; skip heredoc section
+ (if (re-search-forward (concat "^" re "$") end 'move)
+ (forward-line 1)
+ (setq in-string id-end)
+ (goto-char end))))
+ (t
+ (goto-char pnt))))
((looking-at "^__END__$")
- (goto-char pnt))
+ (goto-char pnt))
((looking-at ruby-here-doc-beg-re)
- (if (re-search-forward (ruby-here-doc-end-match)
- indent-point t)
- (forward-line 1)
- (setq in-string (match-end 0))
- (goto-char indent-point)))
+ (if (re-search-forward (ruby-here-doc-end-match)
+ indent-point t)
+ (forward-line 1)
+ (setq in-string (match-end 0))
+ (goto-char indent-point)))
(t
- (error (format "bad string %s"
- (buffer-substring (point) pnt)
- ))))))
+ (error (format "bad string %s"
+ (buffer-substring (point) pnt)
+ ))))))
(list in-string nest depth pcol))
(defun ruby-parse-region (start end)
(let (state)
(save-excursion
(if start
- (goto-char start)
- (ruby-beginning-of-indent))
+ (goto-char start)
+ (ruby-beginning-of-indent))
(save-restriction
- (narrow-to-region (point) end)
- (while (and (> end (point))
- (setq state (apply 'ruby-parse-partial end state))))))
- (list (nth 0 state) ; in-string
- (car (nth 1 state)) ; nest
- (nth 2 state) ; depth
- (car (car (nth 3 state))) ; pcol
- ;(car (nth 5 state)) ; indent
- )))
+ (narrow-to-region (point) end)
+ (while (and (> end (point))
+ (setq state (apply 'ruby-parse-partial end state))))))
+ (list (nth 0 state) ; in-string
+ (car (nth 1 state)) ; nest
+ (nth 2 state) ; depth
+ (car (car (nth 3 state))) ; pcol
+ ;(car (nth 5 state)) ; indent
+ )))
(defun ruby-indent-size (pos nest)
(+ pos (* (or nest 1) ruby-indent-level)))
@@ -723,161 +591,157 @@ The variable ruby-indent-level controls the amount of indentation.
(save-excursion
(beginning-of-line)
(let ((indent-point (point))
- (case-fold-search nil)
- state bol eol begin op-end
- (paren (progn (skip-syntax-forward " ")
- (and (char-after) (matching-paren (char-after)))))
- (indent 0))
+ (case-fold-search nil)
+ state bol eol begin op-end
+ (paren (progn (skip-syntax-forward " ")
+ (and (char-after) (matching-paren (char-after)))))
+ (indent 0))
(if parse-start
- (goto-char parse-start)
- (ruby-beginning-of-indent)
- (setq parse-start (point)))
+ (goto-char parse-start)
+ (ruby-beginning-of-indent)
+ (setq parse-start (point)))
(back-to-indentation)
(setq indent (current-column))
(setq state (ruby-parse-region parse-start indent-point))
(cond
- ((nth 0 state) ; within string
- (setq indent nil)) ; do nothing
- ((car (nth 1 state)) ; in paren
- (goto-char (setq begin (cdr (nth 1 state))))
- (let ((deep (ruby-deep-indent-paren-p (car (nth 1 state)))))
- (if deep
- (cond ((and (eq deep t) (eq (car (nth 1 state)) paren))
- (skip-syntax-backward " ")
- (setq indent (1- (current-column))))
- ((let ((s (ruby-parse-region (point) indent-point)))
- (and (nth 2 s) (> (nth 2 s) 0)
- (or (goto-char (cdr (nth 1 s))) t)))
- (forward-word -1)
- (setq indent (ruby-indent-size (current-column) (nth 2 state))))
- (t
- (setq indent (current-column))
- (cond ((eq deep 'space))
- (paren (setq indent (1- indent)))
- (t (setq indent (ruby-indent-size (1- indent) 1))))))
- (if (nth 3 state) (goto-char (nth 3 state))
- (goto-char parse-start) (back-to-indentation))
- (setq indent (ruby-indent-size (current-column) (nth 2 state))))
- (and (eq (car (nth 1 state)) paren)
- (ruby-deep-indent-paren-p (matching-paren paren))
- (search-backward (char-to-string paren))
- (setq indent (current-column)))))
+ ((nth 0 state) ; within string
+ (setq indent nil)) ; do nothing
+ ((car (nth 1 state)) ; in paren
+ (goto-char (setq begin (cdr (nth 1 state))))
+ (let ((deep (ruby-deep-indent-paren-p (car (nth 1 state)))))
+ (if deep
+ (cond ((and (eq deep t) (eq (car (nth 1 state)) paren))
+ (skip-syntax-backward " ")
+ (setq indent (1- (current-column))))
+ ((let ((s (ruby-parse-region (point) indent-point)))
+ (and (nth 2 s) (> (nth 2 s) 0)
+ (or (goto-char (cdr (nth 1 s))) t)))
+ (forward-word -1)
+ (setq indent (ruby-indent-size (current-column) (nth 2 state))))
+ (t
+ (setq indent (current-column))
+ (cond ((eq deep 'space))
+ (paren (setq indent (1- indent)))
+ (t (setq indent (ruby-indent-size (1- indent) 1))))))
+ (if (nth 3 state) (goto-char (nth 3 state))
+ (goto-char parse-start) (back-to-indentation))
+ (setq indent (ruby-indent-size (current-column) (nth 2 state))))
+ (and (eq (car (nth 1 state)) paren)
+ (ruby-deep-indent-paren-p (matching-paren paren))
+ (search-backward (char-to-string paren))
+ (setq indent (current-column)))))
((and (nth 2 state) (> (nth 2 state) 0)) ; in nest
- (if (null (cdr (nth 1 state)))
- (error "invalid nest"))
- (goto-char (cdr (nth 1 state)))
- (forward-word -1) ; skip back a keyword
- (setq begin (point))
- (cond
- ((looking-at "do\\>[^_]") ; iter block is a special case
- (if (nth 3 state) (goto-char (nth 3 state))
- (goto-char parse-start) (back-to-indentation))
- (setq indent (ruby-indent-size (current-column) (nth 2 state))))
- (t
- (setq indent (+ (current-column) ruby-indent-level)))))
+ (if (null (cdr (nth 1 state)))
+ (error "invalid nest"))
+ (goto-char (cdr (nth 1 state)))
+ (forward-word -1) ; skip back a keyword
+ (setq begin (point))
+ (cond
+ ((looking-at "do\\>[^_]") ; iter block is a special case
+ (if (nth 3 state) (goto-char (nth 3 state))
+ (goto-char parse-start) (back-to-indentation))
+ (setq indent (ruby-indent-size (current-column) (nth 2 state))))
+ (t
+ (setq indent (+ (current-column) ruby-indent-level)))))
((and (nth 2 state) (< (nth 2 state) 0)) ; in negative nest
- (setq indent (ruby-indent-size (current-column) (nth 2 state)))))
+ (setq indent (ruby-indent-size (current-column) (nth 2 state)))))
(when indent
- (goto-char indent-point)
- (end-of-line)
- (setq eol (point))
- (beginning-of-line)
- (cond
- ((and (not (ruby-deep-indent-paren-p paren))
- (re-search-forward ruby-negative eol t))
- (and (not (eq ?_ (char-after (match-end 0))))
- (setq indent (- indent ruby-indent-level))))
- ((and
- (save-excursion
- (beginning-of-line)
- (not (bobp)))
- (or (ruby-deep-indent-paren-p t)
- (null (car (nth 1 state)))))
- ;; goto beginning of non-empty no-comment line
- (let (end done)
- (while (not done)
- (skip-chars-backward " \t\n")
- (setq end (point))
- (beginning-of-line)
- (if (re-search-forward "^\\s *#" end t)
- (beginning-of-line)
- (setq done t))))
- (setq bol (point))
- (end-of-line)
- ;; skip the comment at the end
- (skip-chars-backward " \t")
- (let (end (pos (point)))
- (beginning-of-line)
- (while (and (re-search-forward "#" pos t)
- (setq end (1- (point)))
- (or (ruby-special-char-p end)
- (and (setq state (ruby-parse-region parse-start end))
- (nth 0 state))))
- (setq end nil))
- (goto-char (or end pos))
- (skip-chars-backward " \t")
- (setq begin (if (and end (nth 0 state)) pos (cdr (nth 1 state))))
- (setq state (ruby-parse-region parse-start (point))))
- (or (bobp) (forward-char -1))
- (and
- (or (and (looking-at ruby-symbol-re)
- (skip-chars-backward ruby-symbol-chars)
- (looking-at (concat "\\<\\(" ruby-block-hanging-re "\\)\\>"))
- (not (eq (point) (nth 3 state)))
- (save-excursion
- (goto-char (match-end 0))
- (not (looking-at "[a-z_]"))))
- (and (looking-at ruby-operator-re)
- (not (ruby-special-char-p))
- ;; operator at the end of line
- (let ((c (char-after (point))))
- (and
-;; (or (null begin)
-;; (save-excursion
-;; (goto-char begin)
-;; (skip-chars-forward " \t")
-;; (not (or (eolp) (looking-at "#")
-;; (and (eq (car (nth 1 state)) ?{)
-;; (looking-at "|"))))))
- (or (not (eq ?/ c))
- (null (nth 0 (ruby-parse-region (or begin parse-start) (point)))))
- (or (not (eq ?| (char-after (point))))
- (save-excursion
- (or (eolp) (forward-char -1))
- (cond
- ((search-backward "|" nil t)
- (skip-chars-backward " \t\n")
- (and (not (eolp))
- (progn
- (forward-char -1)
- (not (looking-at "{")))
- (progn
- (forward-word -1)
- (not (looking-at "do\\>[^_]")))))
- (t t))))
- (not (eq ?, c))
- (setq op-end t)))))
- (setq indent
- (cond
- ((and
- (null op-end)
- (not (looking-at (concat "\\<\\(" ruby-block-hanging-re "\\)\\>")))
- (eq (ruby-deep-indent-paren-p t) 'space)
- (not (bobp)))
- (widen)
- (goto-char (or begin parse-start))
- (skip-syntax-forward " ")
- (current-column))
- ((car (nth 1 state)) indent)
- (t
- (+ indent ruby-indent-level))))))))
- (goto-char indent-point)
- (beginning-of-line)
- (skip-syntax-forward " ")
- (if (looking-at "\\.[^.]")
- (+ indent ruby-indent-level)
- indent))))
+ (goto-char indent-point)
+ (end-of-line)
+ (setq eol (point))
+ (beginning-of-line)
+ (cond
+ ((and (not (ruby-deep-indent-paren-p paren))
+ (re-search-forward ruby-negative eol t))
+ (and (not (eq ?_ (char-after (match-end 0))))
+ (setq indent (- indent ruby-indent-level))))
+ ((and
+ (save-excursion
+ (beginning-of-line)
+ (not (bobp)))
+ (or (ruby-deep-indent-paren-p t)
+ (null (car (nth 1 state)))))
+ ;; goto beginning of non-empty no-comment line
+ (let (end done)
+ (while (not done)
+ (skip-chars-backward " \t\n")
+ (setq end (point))
+ (beginning-of-line)
+ (if (re-search-forward "^\\s *#" end t)
+ (beginning-of-line)
+ (setq done t))))
+ (setq bol (point))
+ (end-of-line)
+ ;; skip the comment at the end
+ (skip-chars-backward " \t")
+ (let (end (pos (point)))
+ (beginning-of-line)
+ (while (and (re-search-forward "#" pos t)
+ (setq end (1- (point)))
+ (or (ruby-special-char-p end)
+ (and (setq state (ruby-parse-region parse-start end))
+ (nth 0 state))))
+ (setq end nil))
+ (goto-char (or end pos))
+ (skip-chars-backward " \t")
+ (setq begin (if (nth 0 state) pos (cdr (nth 1 state))))
+ (setq state (ruby-parse-region parse-start (point))))
+ (or (bobp) (forward-char -1))
+ (and
+ (or (and (looking-at ruby-symbol-re)
+ (skip-chars-backward ruby-symbol-chars)
+ (looking-at (concat "\\<\\(" ruby-block-hanging-re "\\)\\>"))
+ (not (eq (point) (nth 3 state)))
+ (save-excursion
+ (goto-char (match-end 0))
+ (not (looking-at "[a-z_]"))))
+ (and (looking-at ruby-operator-re)
+ (not (ruby-special-char-p))
+ ;; operator at the end of line
+ (let ((c (char-after (point))))
+ (and
+;; (or (null begin)
+;; (save-excursion
+;; (goto-char begin)
+;; (skip-chars-forward " \t")
+;; (not (or (eolp) (looking-at "#")
+;; (and (eq (car (nth 1 state)) ?{)
+;; (looking-at "|"))))))
+ (or (not (eq ?/ c))
+ (null (nth 0 (ruby-parse-region (or begin parse-start) (point)))))
+ (or (not (eq ?| (char-after (point))))
+ (save-excursion
+ (or (eolp) (forward-char -1))
+ (cond
+ ((search-backward "|" nil t)
+ (skip-chars-backward " \t\n")
+ (and (not (eolp))
+ (progn
+ (forward-char -1)
+ (not (looking-at "{")))
+ (progn
+ (forward-word -1)
+ (not (looking-at "do\\>[^_]")))))
+ (t t))))
+ (not (eq ?, c))
+ (setq op-end t)))))
+ (setq indent
+ (cond
+ ((and
+ (null op-end)
+ (not (looking-at (concat "\\<\\(" ruby-block-hanging-re "\\)\\>")))
+ (eq (ruby-deep-indent-paren-p t) 'space)
+ (not (bobp)))
+ (save-excursion
+ (widen)
+ (goto-char (or begin parse-start))
+ (skip-syntax-forward " ")
+ (current-column)))
+ ((car (nth 1 state)) indent)
+ (t
+ (+ indent ruby-indent-level))))))))
+ indent)))
(defun ruby-electric-brace (arg)
(interactive "P")
@@ -890,10 +754,10 @@ The variable ruby-indent-level controls the amount of indentation.
(defmacro defun-region-command (func args &rest body)
(let ((intr (car body)))
(when (featurep 'xemacs)
- (if (stringp intr) (setq intr (cadr body)))
- (and (eq (car intr) 'interactive)
- (setq intr (cdr intr))
- (setcar intr (concat "_" (car intr)))))
+ (if (stringp intr) (setq intr (cadr body)))
+ (and (eq (car intr) 'interactive)
+ (setq intr (cdr intr))
+ (setcar intr (concat "_" (car intr)))))
(cons 'defun (cons func (cons args body))))))
(defun-region-command ruby-beginning-of-defun (&optional arg)
@@ -902,22 +766,22 @@ With argument, do this that many times.
Returns t unless search stops due to end of buffer."
(interactive "p")
(and (re-search-backward (concat "^\\(" ruby-block-beg-re "\\)\\b")
- nil 'move (or arg 1))
+ nil 'move (or arg 1))
(progn (beginning-of-line) t)))
(defun ruby-beginning-of-indent ()
(and (re-search-backward (concat "^\\(" ruby-indent-beg-re "\\)\\b")
- nil 'move)
+ nil 'move)
(progn
- (beginning-of-line)
- t)))
+ (beginning-of-line)
+ t)))
(defun-region-command ruby-end-of-defun (&optional arg)
"Move forward to next end of defun.
An end of a defun is found by moving forward from the beginning of one."
(interactive "p")
(and (re-search-forward (concat "^\\(" ruby-block-end-re "\\)\\($\\|\\b[^_]\\)")
- nil 'move (or arg 1))
+ nil 'move (or arg 1))
(progn (beginning-of-line) t))
(forward-line 1))
@@ -925,30 +789,30 @@ An end of a defun is found by moving forward from the beginning of one."
(let (start pos done down)
(setq start (ruby-calculate-indent))
(setq down (looking-at (if (< n 0) ruby-block-end-re
- (concat "\\<\\(" ruby-block-beg-re "\\)\\>"))))
+ (concat "\\<\\(" ruby-block-beg-re "\\)\\>"))))
(while (and (not done) (not (if (< n 0) (bobp) (eobp))))
(forward-line n)
(cond
((looking-at "^\\s *$"))
((looking-at "^\\s *#"))
((and (> n 0) (looking-at "^=begin\\>"))
- (re-search-forward "^=end\\>"))
+ (re-search-forward "^=end\\>"))
((and (< n 0) (looking-at "^=end\\>"))
- (re-search-backward "^=begin\\>"))
+ (re-search-backward "^=begin\\>"))
(t
- (setq pos (current-indentation))
- (cond
- ((< start pos)
- (setq down t))
- ((and down (= pos start))
- (setq done t))
- ((> start pos)
- (setq done t)))))
+ (setq pos (current-indentation))
+ (cond
+ ((< start pos)
+ (setq down t))
+ ((and down (= pos start))
+ (setq done t))
+ ((> start pos)
+ (setq done t)))))
(if done
- (save-excursion
- (back-to-indentation)
- (if (looking-at (concat "\\<\\(" ruby-block-mid-re "\\)\\>"))
- (setq done nil))))))
+ (save-excursion
+ (back-to-indentation)
+ (if (looking-at (concat "\\<\\(" ruby-block-mid-re "\\)\\>"))
+ (setq done nil))))))
(back-to-indentation))
(defun-region-command ruby-beginning-of-block (&optional arg)
@@ -967,37 +831,37 @@ An end of a defun is found by moving forward from the beginning of one."
(ruby-backward-sexp (- cnt))
(let ((i (or cnt 1)))
(condition-case nil
- (while (> i 0)
- (skip-syntax-forward " ")
- (cond ((looking-at "\\?\\(\\\\[CM]-\\)*\\\\?\\S ")
- (goto-char (match-end 0)))
- ((progn
- (skip-chars-forward ",.:;|&^~=!?\\+\\-\\*")
- (looking-at "\\s("))
- (goto-char (scan-sexps (point) 1)))
- ((and (looking-at (concat "\\<\\(" ruby-block-beg-re "\\)\\>"))
- (not (eq (char-before (point)) ?.))
- (not (eq (char-before (point)) ?:)))
- (ruby-end-of-block)
- (forward-word 1))
- ((looking-at "\\(\\$\\|@@?\\)?\\sw")
- (while (progn
- (while (progn (forward-word 1) (looking-at "_")))
- (cond ((looking-at "::") (forward-char 2) t)
- ((> (skip-chars-forward ".") 0))
- ((looking-at "\\?\\|!\\(=[~=>]\\|[^~=]\\)")
- (forward-char 1) nil)))))
- ((let (state expr)
- (while
- (progn
- (setq expr (or expr (ruby-expr-beg)
- (looking-at "%\\sw?\\Sw\\|[\"'`/]")))
- (nth 1 (setq state (apply 'ruby-parse-partial nil state))))
- (setq expr t)
- (skip-chars-forward "<"))
- (not expr))))
- (setq i (1- i)))
- ((error) (forward-word 1)))
+ (while (> i 0)
+ (skip-syntax-forward " ")
+ (cond ((looking-at "\\?\\(\\\\[CM]-\\)*\\\\?\\S ")
+ (goto-char (match-end 0)))
+ ((progn
+ (skip-chars-forward ",.:;|&^~=!?\\+\\-\\*")
+ (looking-at "\\s("))
+ (goto-char (scan-sexps (point) 1)))
+ ((and (looking-at (concat "\\<\\(" ruby-block-beg-re "\\)\\>"))
+ (not (eq (char-before (point)) ?.))
+ (not (eq (char-before (point)) ?:)))
+ (ruby-end-of-block)
+ (forward-word 1))
+ ((looking-at "\\(\\$\\|@@?\\)?\\sw")
+ (while (progn
+ (while (progn (forward-word 1) (looking-at "_")))
+ (cond ((looking-at "::") (forward-char 2) t)
+ ((> (skip-chars-forward ".") 0))
+ ((looking-at "\\?\\|!\\(=[~=>]\\|[^~=]\\)")
+ (forward-char 1) nil)))))
+ ((let (state expr)
+ (while
+ (progn
+ (setq expr (or expr (ruby-expr-beg)
+ (looking-at "%\\sw?\\Sw\\|[\"'`/]")))
+ (nth 1 (setq state (apply 'ruby-parse-partial nil state))))
+ (setq expr t)
+ (skip-chars-forward "<"))
+ (not expr))))
+ (setq i (1- i)))
+ ((error) (forward-word 1)))
i)))
(defun-region-command ruby-backward-sexp (&optional cnt)
@@ -1006,41 +870,41 @@ An end of a defun is found by moving forward from the beginning of one."
(ruby-forward-sexp (- cnt))
(let ((i (or cnt 1)))
(condition-case nil
- (while (> i 0)
- (skip-chars-backward " \t\n,.:;|&^~=!?\\+\\-\\*")
- (forward-char -1)
- (cond ((looking-at "\\s)")
- (goto-char (scan-sexps (1+ (point)) -1))
- (case (char-before)
- (?% (forward-char -1))
- ('(?q ?Q ?w ?W ?r ?x)
- (if (eq (char-before (1- (point))) ?%) (forward-char -2))))
- nil)
- ((looking-at "\\s\"\\|\\\\\\S_")
- (let ((c (char-to-string (char-before (match-end 0)))))
- (while (and (search-backward c)
- (oddp (skip-chars-backward "\\")))))
- nil)
- ((looking-at "\\s.\\|\\s\\")
- (if (ruby-special-char-p) (forward-char -1)))
- ((looking-at "\\s(") nil)
- (t
- (forward-char 1)
- (while (progn (forward-word -1)
- (case (char-before)
- (?_ t)
- (?. (forward-char -1) t)
- ((?$ ?@)
- (forward-char -1)
- (and (eq (char-before) (char-after)) (forward-char -1)))
- (?:
- (forward-char -1)
- (eq (char-before) :)))))
- (if (looking-at ruby-block-end-re)
- (ruby-beginning-of-block))
- nil))
- (setq i (1- i)))
- ((error)))
+ (while (> i 0)
+ (skip-chars-backward " \t\n,.:;|&^~=!?\\+\\-\\*")
+ (forward-char -1)
+ (cond ((looking-at "\\s)")
+ (goto-char (scan-sexps (1+ (point)) -1))
+ (case (char-before)
+ (?% (forward-char -1))
+ ('(?q ?Q ?w ?W ?r ?x)
+ (if (eq (char-before (1- (point))) ?%) (forward-char -2))))
+ nil)
+ ((looking-at "\\s\"\\|\\\\\\S_")
+ (let ((c (char-to-string (char-before (match-end 0)))))
+ (while (and (search-backward c)
+ (oddp (skip-chars-backward "\\")))))
+ nil)
+ ((looking-at "\\s.\\|\\s\\")
+ (if (ruby-special-char-p) (forward-char -1)))
+ ((looking-at "\\s(") nil)
+ (t
+ (forward-char 1)
+ (while (progn (forward-word -1)
+ (case (char-before)
+ (?_ t)
+ (?. (forward-char -1) t)
+ ((?$ ?@)
+ (forward-char -1)
+ (and (eq (char-before) (char-after)) (forward-char -1)))
+ (?:
+ (forward-char -1)
+ (eq (char-before) :)))))
+ (if (looking-at ruby-block-end-re)
+ (ruby-beginning-of-block))
+ nil))
+ (setq i (1- i)))
+ ((error)))
i)))
(defun ruby-reindent-then-newline-and-indent ()
@@ -1061,7 +925,7 @@ An end of a defun is found by moving forward from the beginning of one."
(while (re-search-forward "^\\([ \t]*\\)#" end t)
(replace-match "\\1" nil nil)
(save-excursion
- (ruby-indent-line)))))
+ (ruby-indent-line)))))
(defun ruby-insert-end ()
(interactive)
@@ -1086,18 +950,18 @@ balanced expression is found."
(let ((here (point-marker)) start top column (nest t))
(set-marker-insertion-type here t)
(unwind-protect
- (progn
- (beginning-of-line)
- (setq start (point) top (current-indentation))
- (while (and (not (eobp))
- (progn
- (setq column (ruby-calculate-indent start))
- (cond ((> column top)
- (setq nest t))
- ((and (= column top) nest)
- (setq nest nil) t))))
- (ruby-indent-to column)
- (beginning-of-line 2)))
+ (progn
+ (beginning-of-line)
+ (setq start (point) top (current-indentation))
+ (while (and (not (eobp))
+ (progn
+ (setq column (ruby-calculate-indent start))
+ (cond ((> column top)
+ (setq nest t))
+ ((and (= column top) nest)
+ (setq nest nil) t))))
+ (ruby-indent-to column)
+ (beginning-of-line 2)))
(goto-char here)
(set-marker here nil))))
@@ -1105,62 +969,37 @@ balanced expression is found."
"Return current method string."
(condition-case nil
(save-excursion
- (let (mname mlist (indent 0))
- ;; get current method (or class/module)
- (if (re-search-backward
- (concat "^[ \t]*\\(def\\|class\\|module\\)[ \t]+"
- "\\("
- ;; \\. and :: for class method
- "\\([A-Za-z_]" ruby-symbol-re "*\\|\\.\\|::" "\\)"
- "+\\)")
- nil t)
- (progn
- (setq mname (match-string 2))
- (unless (string-equal "def" (match-string 1))
- (setq mlist (list mname) mname nil))
- (goto-char (match-beginning 1))
- (setq indent (current-column))
- (beginning-of-line)))
- ;; nest class/module
- (while (and (> indent 0)
- (re-search-backward
- (concat
- "^[ \t]*\\(class\\|module\\)[ \t]+"
- "\\([A-Z]" ruby-symbol-re "*\\)")
- nil t))
- (goto-char (match-beginning 1))
- (if (< (current-column) indent)
- (progn
- (setq mlist (cons (match-string 2) mlist))
- (setq indent (current-column))
- (beginning-of-line))))
- (when mname
- (let ((mn (split-string mname "\\.\\|::")))
- (if (cdr mn)
- (progn
- (cond
- ((string-equal "" (car mn))
- (setq mn (cdr mn) mlist nil))
- ((string-equal "self" (car mn))
- (setq mn (cdr mn)))
- ((let ((ml (nreverse mlist)))
- (while ml
- (if (string-equal (car ml) (car mn))
- (setq mlist (nreverse (cdr ml)) ml nil))
- (or (setq ml (cdr ml)) (nreverse mlist))))))
- (if mlist
- (setcdr (last mlist) mn)
- (setq mlist mn))
- (setq mn (last mn 2))
- (setq mname (concat "." (cadr mn)))
- (setcdr mn nil))
- (setq mname (concat "#" mname)))))
- ;; generate string
- (if (consp mlist)
- (setq mlist (mapconcat (function identity) mlist "::")))
- (if mname
- (if mlist (concat mlist mname) mname)
- mlist)))))
+ (let ((mlist nil) (indent 0))
+ ;; get current method (or class/module)
+ (if (re-search-backward
+ (concat "^[ \t]*\\(def\\|class\\|module\\)[ \t]+"
+ "\\("
+ ;; \\. for class method
+ "\\(" ruby-symbol-re "\\|\\." "\\)"
+ "+\\)")
+ nil t)
+ (progn
+ (setq mlist (list (match-string 2)))
+ (goto-char (match-beginning 1))
+ (setq indent (current-column))
+ (beginning-of-line)))
+ ;; nest class/module
+ (while (and (> indent 0)
+ (re-search-backward
+ (concat
+ "^[ \t]*\\(class\\|module\\)[ \t]+"
+ "\\([A-Z]" ruby-symbol-re "+\\)")
+ nil t))
+ (goto-char (match-beginning 1))
+ (if (< (current-column) indent)
+ (progn
+ (setq mlist (cons (match-string 2) mlist))
+ (setq indent (current-column))
+ (beginning-of-line))))
+ ;; generate string
+ (if (consp mlist)
+ (mapconcat (function identity) mlist "::")
+ nil)))))
(cond
((featurep 'font-lock)
@@ -1168,204 +1007,140 @@ balanced expression is found."
(setq font-lock-variable-name-face font-lock-type-face))
(setq ruby-font-lock-syntactic-keywords
- `(
- ;; #{ }, #$hoge, #@foo are not comments
- ("\\(#\\)[{$@]" 1 (1 . nil))
- ;; the last $', $", $` in the respective string is not variable
- ;; the last ?', ?", ?` in the respective string is not ascii code
- ("\\(^\\|[\[ \t\n<+\(,=]\\)\\(['\"`]\\)\\(\\\\.\\|\\2\\|[^'\"`\n\\\\]\\)*?\\\\?[?$]\\(\\2\\)"
- (2 (7 . nil))
- (4 (7 . nil)))
- ;; $' $" $` .... are variables
- ;; ?' ?" ?` are ascii codes
- ("\\(^\\|[^\\\\]\\)\\(\\\\\\\\\\)*[?$]\\([#\"'`]\\)" 3 (1 . nil))
- ;; regexps
- ("\\(^\\|[=(,~?:;<>]\\|\\(^\\|\\s \\)\\(if\\|elsif\\|unless\\|while\\|until\\|when\\|and\\|or\\|&&\\|||\\)\\|g?sub!?\\|scan\\|split!?\\)\\s *\\(/\\)[^/\n\\\\]*\\(\\\\.[^/\n\\\\]*\\)*\\(/\\)"
- (4 (7 . ?/))
- (6 (7 . ?/)))
- ("^\\(=\\)begin\\(\\s \\|$\\)" 1 (7 . nil))
- ("^\\(=\\)end\\(\\s \\|$\\)" 1 (7 . nil))
- (,(concat ruby-here-doc-beg-re ".*\\(\n\\)")
- ,(+ 1 (regexp-opt-depth ruby-here-doc-beg-re))
- (ruby-here-doc-beg-syntax))
- (,ruby-here-doc-end-re 3 (ruby-here-doc-end-syntax))))
-
- (unless (functionp 'syntax-ppss)
- (defun syntax-ppss (&optional pos)
- (parse-partial-sexp (point-min) (or pos (point)))))
-
- (defun ruby-in-ppss-context-p (context &optional ppss)
- (let ((ppss (or ppss (syntax-ppss (point)))))
- (if (cond
- ((eq context 'anything)
- (or (nth 3 ppss)
- (nth 4 ppss)))
- ((eq context 'string)
- (nth 3 ppss))
- ((eq context 'heredoc)
- (and (nth 3 ppss)
- ;; If it's generic string, it's a heredoc and we don't care
- ;; See `parse-partial-sexp'
- (not (numberp (nth 3 ppss)))))
- ((eq context 'non-heredoc)
- (and (ruby-in-ppss-context-p 'anything)
- (not (ruby-in-ppss-context-p 'heredoc))))
- ((eq context 'comment)
- (nth 4 ppss))
- (t
- (error (concat
- "Internal error on `ruby-in-ppss-context-p': "
- "context name `" (symbol-name context) "' is unknown"))))
- t)))
-
- (defun ruby-in-here-doc-p ()
- (save-excursion
- (let ((old-point (point)) (case-fold-search nil))
- (beginning-of-line)
- (catch 'found-beg
- (while (re-search-backward ruby-here-doc-beg-re nil t)
- (if (not (or (ruby-in-ppss-context-p 'anything)
- (ruby-here-doc-find-end old-point)))
- (throw 'found-beg t)))))))
-
- (defun ruby-here-doc-find-end (&optional limit)
- "Expects the point to be on a line with one or more heredoc
-openers. Returns the buffer position at which all heredocs on the
-line are terminated, or nil if they aren't terminated before the
-buffer position `limit' or the end of the buffer."
- (save-excursion
- (beginning-of-line)
- (catch 'done
- (let ((eol (save-excursion (end-of-line) (point)))
- (case-fold-search nil)
- ;; Fake match data such that (match-end 0) is at eol
- (end-match-data (progn (looking-at ".*$") (match-data)))
- beg-match-data end-re)
- (while (re-search-forward ruby-here-doc-beg-re eol t)
- (setq beg-match-data (match-data))
- (setq end-re (ruby-here-doc-end-match))
-
- (set-match-data end-match-data)
- (goto-char (match-end 0))
- (unless (re-search-forward end-re limit t) (throw 'done nil))
- (setq end-match-data (match-data))
-
- (set-match-data beg-match-data)
- (goto-char (match-end 0)))
- (set-match-data end-match-data)
- (goto-char (match-end 0))
- (point)))))
-
- (defun ruby-here-doc-beg-syntax ()
- (save-excursion
- (goto-char (match-beginning 0))
- (unless (or (ruby-in-ppss-context-p 'non-heredoc)
- (ruby-in-here-doc-p))
- (string-to-syntax "|"))))
-
- (defun ruby-here-doc-end-syntax ()
- (let ((pss (syntax-ppss)) (case-fold-search nil))
- (when (ruby-in-ppss-context-p 'heredoc pss)
- (save-excursion
- (goto-char (nth 8 pss)) ; Go to the beginning of heredoc.
- (let ((eol (point)))
- (beginning-of-line)
- (if (and (re-search-forward (ruby-here-doc-beg-match) eol t) ; If there is a heredoc that matches this line...
- (not (ruby-in-ppss-context-p 'anything)) ; And that's not inside a heredoc/string/comment...
- (progn (goto-char (match-end 0)) ; And it's the last heredoc on its line...
- (not (re-search-forward ruby-here-doc-beg-re eol t))))
- (string-to-syntax "|")))))))
+ '(
+ ;; #{ }, #$hoge, #@foo are not comments
+ ("\\(#\\)[{$@]" 1 (1 . nil))
+ ;; the last $', $", $` in the respective string is not variable
+ ;; the last ?', ?", ?` in the respective string is not ascii code
+ ("\\(^\\|[\[ \t\n<+\(,=]\\)\\(['\"`]\\)\\(\\\\.\\|\\2\\|[^'\"`\n\\\\]\\)*?\\\\?[?$]\\(\\2\\)"
+ (2 (7 . nil))
+ (4 (7 . nil)))
+ ;; $' $" $` .... are variables
+ ;; ?' ?" ?` are ascii codes
+ ("\\(^\\|[^\\\\]\\)\\(\\\\\\\\\\)*[?$]\\([#\"'`]\\)" 3 (1 . nil))
+ ;; regexps
+ ("\\(^\\|[=(,~?:;<>]\\|\\(^\\|\\s \\)\\(if\\|elsif\\|unless\\|while\\|until\\|when\\|and\\|or\\|&&\\|||\\)\\|g?sub!?\\|scan\\|split!?\\)\\s *\\(/\\)[^/\n\\\\]*\\(\\\\.[^/\n\\\\]*\\)*\\(/\\)"
+ (4 (7 . ?/))
+ (6 (7 . ?/)))
+ ("^\\(=\\)begin\\(\\s \\|$\\)" 1 (7 . nil))
+ ("^\\(=\\)end\\(\\s \\|$\\)" 1 (7 . nil))))
(if (featurep 'xemacs)
(put 'ruby-mode 'font-lock-defaults
- '((ruby-font-lock-keywords)
- nil nil nil
- beginning-of-line
- (font-lock-syntactic-keywords
- . ruby-font-lock-syntactic-keywords))))
+ '((ruby-font-lock-keywords)
+ nil nil nil
+ beginning-of-line
+ (font-lock-syntactic-keywords
+ . ruby-font-lock-syntactic-keywords))))
(defun ruby-font-lock-docs (limit)
(if (re-search-forward "^=begin\\(\\s \\|$\\)" limit t)
- (let (beg)
- (beginning-of-line)
- (setq beg (point))
- (forward-line 1)
- (if (re-search-forward "^=end\\(\\s \\|$\\)" limit t)
- (progn
- (set-match-data (list beg (point)))
- t)))))
+ (let (beg)
+ (beginning-of-line)
+ (setq beg (point))
+ (forward-line 1)
+ (if (re-search-forward "^=end\\(\\s \\|$\\)" limit t)
+ (progn
+ (set-match-data (list beg (point)))
+ t)))))
(defun ruby-font-lock-maybe-docs (limit)
(let (beg)
(save-excursion
- (if (and (re-search-backward "^=\\(begin\\|end\\)\\(\\s \\|$\\)" nil t)
- (string= (match-string 1) "begin"))
- (progn
- (beginning-of-line)
- (setq beg (point)))))
+ (if (and (re-search-backward "^=\\(begin\\|end\\)\\(\\s \\|$\\)" nil t)
+ (string= (match-string 1) "begin"))
+ (progn
+ (beginning-of-line)
+ (setq beg (point)))))
(if (and beg (and (re-search-forward "^=\\(begin\\|end\\)\\(\\s \\|$\\)" nil t)
- (string= (match-string 1) "end")))
- (progn
- (set-match-data (list beg (point)))
- t)
- nil)))
+ (string= (match-string 1) "end")))
+ (progn
+ (set-match-data (list beg (point)))
+ t)
+ nil)))
(defvar ruby-font-lock-syntax-table
(let* ((tbl (copy-syntax-table ruby-mode-syntax-table)))
(modify-syntax-entry ?_ "w" tbl)
tbl))
- (defconst ruby-font-lock-keywords
+ (defun ruby-font-lock-here-docs (limit)
+ (if (re-search-forward ruby-here-doc-beg-re limit t)
+ (let (beg)
+ (beginning-of-line)
+ (forward-line)
+ (setq beg (point))
+ (if (re-search-forward (ruby-here-doc-end-match) nil t)
+ (progn
+ (set-match-data (list beg (point)))
+ t)))))
+
+ (defun ruby-font-lock-maybe-here-docs (limit)
+ (let (beg)
+ (save-excursion
+ (if (re-search-backward ruby-here-doc-beg-re nil t)
+ (progn
+ (beginning-of-line)
+ (forward-line)
+ (setq beg (point)))))
+ (if (and beg
+ (let ((end-match (ruby-here-doc-end-match)))
+ (and (not (re-search-backward end-match beg t))
+ (re-search-forward end-match nil t))))
+ (progn
+ (set-match-data (list beg (point)))
+ t)
+ nil)))
+
+ (defvar ruby-font-lock-keywords
(list
;; functions
'("^\\s *def\\s +\\([^( \t\n]+\\)"
1 font-lock-function-name-face)
;; keywords
(cons (concat
- "\\(^\\|[^_:.@$]\\|\\.\\.\\)\\b\\(defined\\?\\|"
- (regexp-opt
- '("alias"
- "and"
- "begin"
- "break"
- "case"
- "catch"
- "class"
- "def"
- "do"
- "elsif"
- "else"
- "fail"
- "ensure"
- "for"
- "end"
- "if"
- "in"
- "module"
- "next"
- "not"
- "or"
- "raise"
- "redo"
- "rescue"
- "retry"
- "return"
- "then"
- "throw"
- "super"
- "unless"
- "undef"
- "until"
- "when"
- "while"
- "yield"
- )
- t)
- "\\)"
- ruby-keyword-end-re)
- 2)
- ;; here-doc beginnings
- (list ruby-here-doc-beg-re 0 'font-lock-string-face)
+ "\\(^\\|[^_:.@$]\\|\\.\\.\\)\\b\\(defined\\?\\|\\("
+ (mapconcat
+ 'identity
+ '("alias"
+ "and"
+ "begin"
+ "break"
+ "case"
+ "catch"
+ "class"
+ "def"
+ "do"
+ "elsif"
+ "else"
+ "fail"
+ "ensure"
+ "for"
+ "end"
+ "if"
+ "in"
+ "module"
+ "next"
+ "not"
+ "or"
+ "raise"
+ "redo"
+ "rescue"
+ "retry"
+ "return"
+ "then"
+ "throw"
+ "super"
+ "unless"
+ "undef"
+ "until"
+ "when"
+ "while"
+ "yield"
+ )
+ "\\|")
+ "\\)\\>\\)")
+ 2)
;; variables
'("\\(^\\|[^_:.@$]\\|\\.\\.\\)\\b\\(nil\\|self\\|true\\|false\\)\\>"
2 font-lock-variable-name-face)
@@ -1379,6 +1154,13 @@ buffer position `limit' or the end of the buffer."
0 font-lock-comment-face t)
'(ruby-font-lock-maybe-docs
0 font-lock-comment-face t)
+ ;; "here" document
+ '(ruby-font-lock-here-docs
+ 0 font-lock-string-face t)
+ '(ruby-font-lock-maybe-here-docs
+ 0 font-lock-string-face t)
+ `(,ruby-here-doc-beg-re
+ 0 font-lock-string-face t)
;; general delimited string
'("\\(^\\|[[ \t\n<+(,=]\\)\\(%[xrqQwW]?\\([^<[{(a-zA-Z0-9 \n]\\)[^\n\\\\]*\\(\\\\.[^\n\\\\]*\\)*\\(\\3\\)\\)"
(2 font-lock-string-face))
@@ -1386,7 +1168,7 @@ buffer position `limit' or the end of the buffer."
'("\\(^\\|[^_]\\)\\b\\([A-Z]+\\(\\w\\|_\\)*\\)"
2 font-lock-type-face)
;; symbols
- '("\\(^\\|[^:]\\)\\(:\\([-+~]@?\\|[/%&|^`]\\|\\*\\*?\\|<\\(<\\|=>?\\)?\\|>[>=]?\\|===?\\|=~\\|![~=]?\\|\\[\\]=?\\|\\(\\w\\|_\\)+\\([!?=]\\|\\b_*\\)\\|#{[^}\n\\\\]*\\(\\\\.[^}\n\\\\]*\\)*}\\)\\)"
+ '("\\(^\\|[^:]\\)\\(:\\([-+~]@?\\|[/%&|^`]\\|\\*\\*?\\|<\\(<\\|=>?\\)?\\|>[>=]?\\|===?\\|=~\\|\\[\\]=?\\|\\(\\w\\|_\\)+\\([!?=]\\|\\b_*\\)\\|#{[^}\n\\\\]*\\(\\\\.[^}\n\\\\]*\\)*}\\)\\)"
2 font-lock-reference-face)
;; expression expansion
'("#\\({[^}\n\\\\]*\\(\\\\.[^}\n\\\\]*\\)*}\\|\\(\\$\\|@\\|@@\\)\\(\\w\\|_\\)+\\)"
diff --git a/misc/ruby-style.el b/misc/ruby-style.el
index 6dc444273c..ef05ea004a 100644
--- a/misc/ruby-style.el
+++ b/misc/ruby-style.el
@@ -4,20 +4,11 @@
;;;
;;; C/C++ mode style for Ruby.
;;;
-;;; $Author$
+;;; $Author: nobu $
;;; created at: Thu Apr 26 13:54:01 JST 2007
;;;
-;;; To switch to the "ruby" style automatically if it looks like a
-;;; source file of ruby, add ruby-style-c-mode to c-mode-hook:
-;;;
-;;; (require 'ruby-style)
-;;; (add-hook 'c-mode-hook 'ruby-style-c-mode)
-;;; (add-hook 'c++-mode-hook 'ruby-style-c-mode)
-;;;
-;;; Customize the c-default-style variable to set the default style
-;;; for each CC major mode.
-(defconst ruby-style-revision "$Revision$"
+(defconst ruby-style-revision "$Revision: 15588 $"
"Ruby style revision string.")
(defconst ruby-style-version
@@ -28,24 +19,22 @@
(defun ruby-style-case-indent (x)
(save-excursion
- (back-to-indentation)
(unless (progn (backward-up-list) (back-to-indentation)
- (> (point) (cdr x)))
+ (> (point) (cdr x)))
(goto-char (cdr x))
(if (looking-at "\\<case\\|default\\>") '*))))
(defun ruby-style-label-indent (x)
(save-excursion
- (back-to-indentation)
(unless (progn (backward-up-list) (back-to-indentation)
- (>= (point) (cdr x)))
+ (>= (point) (cdr x)))
(goto-char (cdr x))
(condition-case ()
- (progn
- (backward-up-list)
- (backward-sexp 2)
- (if (looking-at "\\<switch\\>") '/))
- (error)))))
+ (progn
+ (backward-up-list)
+ (backward-sexp 2)
+ (if (looking-at "\\<switch\\>") '/))
+ (error)))))
(require 'cc-styles)
(c-add-style
@@ -65,13 +54,13 @@
(defun ruby-style-c-mode ()
(interactive)
- (if (or (let ((name (buffer-file-name))) (and name (string-match "/ruby\\>" name)))
+ (if (or (string-match "/ruby\\>" (buffer-file-name))
(save-excursion
(goto-char (point-min))
(let ((head (progn (forward-line 100) (point)))
(case-fold-search nil))
(goto-char (point-min))
(re-search-forward "Copyright (C) .* Yukihiro Matsumoto" head t))))
- (c-set-style "ruby")))
+ (setq c-file-style "ruby")))
(provide 'ruby-style)
diff --git a/misc/rubydb3x.el b/misc/rubydb3x.el
index 9d6bc57d5a..98ce1a1978 100644
--- a/misc/rubydb3x.el
+++ b/misc/rubydb3x.el
@@ -28,20 +28,20 @@
;; Process all the complete markers in this chunk.
(while (string-match "\032\032\\([^:\n]*\\):\\([0-9]*\\):.*\n"
- gud-rubydb-marker-acc)
+ gud-rubydb-marker-acc)
(setq
;; Extract the frame position from the marker.
gud-last-frame
(cons (substring gud-rubydb-marker-acc (match-beginning 1) (match-end 1))
- (string-to-int (substring gud-rubydb-marker-acc
- (match-beginning 2)
- (match-end 2))))
+ (string-to-int (substring gud-rubydb-marker-acc
+ (match-beginning 2)
+ (match-end 2))))
;; Append any text before the marker to the output we're going
;; to return - we don't include the marker in this text.
output (concat output
- (substring gud-rubydb-marker-acc 0 (match-beginning 0)))
+ (substring gud-rubydb-marker-acc 0 (match-beginning 0)))
;; Set the accumulator to the remaining text.
gud-rubydb-marker-acc (substring gud-rubydb-marker-acc (match-end 0))))
@@ -52,17 +52,17 @@
;; know the full marker regexp above failed, it's pretty simple to
;; test for marker starts.
(if (string-match "\032.*\\'" gud-rubydb-marker-acc)
- (progn
- ;; Everything before the potential marker start can be output.
- (setq output (concat output (substring gud-rubydb-marker-acc
- 0 (match-beginning 0))))
+ (progn
+ ;; Everything before the potential marker start can be output.
+ (setq output (concat output (substring gud-rubydb-marker-acc
+ 0 (match-beginning 0))))
- ;; Everything after, we save, to combine with later input.
- (setq gud-rubydb-marker-acc
- (substring gud-rubydb-marker-acc (match-beginning 0))))
+ ;; Everything after, we save, to combine with later input.
+ (setq gud-rubydb-marker-acc
+ (substring gud-rubydb-marker-acc (match-beginning 0))))
(setq output (concat output gud-rubydb-marker-acc)
- gud-rubydb-marker-acc ""))
+ gud-rubydb-marker-acc ""))
output))
@@ -83,18 +83,18 @@ The directory containing FILE becomes the initial working directory
and source-file directory for your debugger."
(interactive
(list (read-from-minibuffer "Run rubydb (like this): "
- (if (consp gud-rubydb-history)
- (car gud-rubydb-history)
- (concat rubydb-command-name " "))
- nil nil
- '(gud-rubydb-history . 1))))
+ (if (consp gud-rubydb-history)
+ (car gud-rubydb-history)
+ (concat rubydb-command-name " "))
+ nil nil
+ '(gud-rubydb-history . 1))))
(if (not (fboundp 'gud-overload-functions))
(gud-common-init command-line 'gud-rubydb-massage-args
- 'gud-rubydb-marker-filter 'gud-rubydb-find-file)
+ 'gud-rubydb-marker-filter 'gud-rubydb-find-file)
(gud-overload-functions '((gud-massage-args . gud-rubydb-massage-args)
- (gud-marker-filter . gud-rubydb-marker-filter)
- (gud-find-file . gud-rubydb-find-file)))
+ (gud-marker-filter . gud-rubydb-marker-filter)
+ (gud-find-file . gud-rubydb-find-file)))
(gud-common-init command-line rubydb-command-name))
(gud-def gud-break "b %l" "\C-b" "Set breakpoint at current line.")
diff --git a/missing.h b/missing.h
new file mode 100644
index 0000000000..6eda516527
--- /dev/null
+++ b/missing.h
@@ -0,0 +1,142 @@
+/************************************************
+
+ missing.h - prototype for *.c in ./missing, and
+ for missing timeval struct
+
+ $Author$
+ $Date$
+ created at: Sat May 11 23:46:03 JST 2002
+
+************************************************/
+
+#ifndef MISSING_H
+#define MISSING_H
+
+#if defined(HAVE_SYS_TIME_H)
+# include <sys/time.h>
+#elif !defined(_WIN32)
+# define time_t long
+struct timeval {
+ time_t tv_sec; /* seconds */
+ time_t tv_usec; /* microseconds */
+};
+#endif
+#if defined(HAVE_SYS_TYPES_H)
+# include <sys/types.h>
+#endif
+
+#ifndef HAVE_ACOSH
+extern double acosh _((double));
+extern double asinh _((double));
+extern double atanh _((double));
+#endif
+
+#ifndef HAVE_CRYPT
+extern char *crypt _((const char *, const char *));
+#endif
+
+#ifndef HAVE_DUP2
+extern int dup2 _((int, int));
+#endif
+
+#ifndef HAVE_EACCESS
+extern int eaccess _((const char*, int));
+#endif
+
+#ifndef HAVE_FINITE
+extern int finite _((double));
+#endif
+
+#ifndef HAVE_FLOCK
+extern int flock _((int, int));
+#endif
+
+/*
+#ifndef HAVE_FREXP
+extern double frexp _((double, int *));
+#endif
+*/
+
+#ifndef HAVE_HYPOT
+extern double hypot _((double, double));
+#endif
+
+#ifndef HAVE_ERF
+extern double erf _((double));
+extern double erfc _((double));
+#endif
+
+#ifndef HAVE_ISINF
+# if defined(HAVE_FINITE) && defined(HAVE_ISNAN)
+# define isinf(x) (!finite(x) && !isnan(x))
+# else
+extern int isinf _((double));
+# endif
+#endif
+
+#ifndef HAVE_ISNAN
+extern int isnan _((double));
+#endif
+
+/*
+#ifndef HAVE_MEMCMP
+extern int memcmp _((char *, char *, int));
+#endif
+*/
+
+#ifndef HAVE_MEMMOVE
+extern void *memmove _((void *, void *, int));
+#endif
+
+/*
+#ifndef HAVE_MODF
+extern double modf _((double, double *));
+#endif
+*/
+
+#ifndef HAVE_STRCASECMP
+extern int strcasecmp _((char *, char *));
+#endif
+
+#ifndef HAVE_STRNCASECMP
+extern int strncasecmp _((char *, char *, int));
+#endif
+
+#ifndef HAVE_STRCHR
+extern char *strchr _((char *, int));
+extern char *strrchr _((char *, int));
+#endif
+
+#ifndef HAVE_STRERROR
+extern char *strerror _((int));
+#endif
+
+#ifndef HAVE_STRFTIME
+extern size_t strftime _((char *, size_t, const char *, const struct tm *));
+#endif
+
+#ifndef HAVE_STRSTR
+extern char *strstr _((char *, char *));
+#endif
+
+/*
+#ifndef HAVE_STRTOL
+extern long strtol _((char *, char **, int));
+#endif
+*/
+
+#ifndef HAVE_STRTOUL
+extern unsigned long strtoul _((char *, char **, int));
+#endif
+
+#ifndef HAVE_VSNPRINTF
+# ifdef HAVE_STDARG_PROTOTYPES
+# include <stdarg.h>
+# else
+# include <varargs.h>
+# endif
+extern int snprintf __((char *, size_t n, char const *, ...));
+extern int vsnprintf _((char *, size_t n, char const *, va_list));
+#endif
+
+#endif /* MISSING_H */
diff --git a/missing/acosh.c b/missing/acosh.c
index c6695b599e..a4443e191f 100644
--- a/missing/acosh.c
+++ b/missing/acosh.c
@@ -3,6 +3,7 @@
acosh.c -
$Author$
+ $Date$
created at: Fri Apr 12 00:34:17 JST 2002
public domain rewrite of acosh(3), asinh(3) and atanh(3)
@@ -12,7 +13,6 @@
#include <errno.h>
#include <float.h>
#include <math.h>
-#include "ruby.h"
/* DBL_MANT_DIG must be less than 4 times of bits of int */
#ifndef DBL_MANT_DIG
@@ -33,7 +33,8 @@
#ifndef HAVE_ACOSH
double
-acosh(double x)
+acosh(x)
+ double x;
{
if (x < 1)
x = -1; /* NaN */
@@ -49,7 +50,8 @@ acosh(double x)
#ifndef HAVE_ASINH
double
-asinh(double x)
+asinh(x)
+ double x;
{
int neg = x < 0;
double z = fabs(x);
@@ -72,7 +74,8 @@ asinh(double x)
#ifndef HAVE_ATANH
double
-atanh(double x)
+atanh(x)
+ double x;
{
int neg = x < 0;
double z = fabs(x);
@@ -80,14 +83,6 @@ atanh(double x)
if (z < SMALL_CRITERIA) return x;
z = log(z > 1 ? -1 : (1 + z) / (1 - z)) / 2;
if (neg) z = -z;
- if (isinf(z))
-#if defined(ERANGE)
- errno = ERANGE;
-#elif defined(EDOM)
- errno = EDOM;
-#else
- ;
-#endif
return z;
}
#endif
diff --git a/missing/alloca.c b/missing/alloca.c
index 620eef12e5..39697f114a 100644
--- a/missing/alloca.c
+++ b/missing/alloca.c
@@ -29,9 +29,7 @@
static char SCCSid[] = "@(#)alloca.c 1.1"; /* for the "what" utility */
#endif
-#include "ruby/config.h"
-#ifdef C_ALLOCA
-
+#include "config.h"
#ifdef emacs
#ifdef static
/* actually, only want this if static is defined as ""
@@ -194,4 +192,3 @@ alloca (size) /* returns pointer to storage */
}
}
-#endif
diff --git a/missing/cbrt.c b/missing/cbrt.c
deleted file mode 100644
index 54db2703a0..0000000000
--- a/missing/cbrt.c
+++ /dev/null
@@ -1,10 +0,0 @@
-#include <math.h>
-
-double cbrt(double x)
-{
- if (x < 0)
- return -pow(-x, 1/3.0);
- else
- return pow(x, 1/3.0);
-}
-
diff --git a/missing/crypt.c b/missing/crypt.c
index d5a9281f77..32736bccfb 100644
--- a/missing/crypt.c
+++ b/missing/crypt.c
@@ -257,10 +257,10 @@ typedef union {
*/
#define TO_SIX_BIT(rslt, src) { \
C_block cvt; \
- cvt.b[0] = (unsigned char)src; src >>= 6; \
- cvt.b[1] = (unsigned char)src; src >>= 6; \
- cvt.b[2] = (unsigned char)src; src >>= 6; \
- cvt.b[3] = (unsigned char)src; \
+ cvt.b[0] = src; src >>= 6; \
+ cvt.b[1] = src; src >>= 6; \
+ cvt.b[2] = src; src >>= 6; \
+ cvt.b[3] = src; \
rslt = (cvt.b32.i0 & 0x3f3f3f3fL) << 2; \
}
@@ -680,13 +680,13 @@ des_cipher(in, out, salt, num_iter)
if (num_iter >= 0)
{ /* encryption */
kp = &KS[0];
- ks_inc = (int)sizeof(*kp);
+ ks_inc = sizeof(*kp);
}
else
{ /* decryption */
num_iter = -num_iter;
kp = &KS[KS_SIZE-1];
- ks_inc = -(int)sizeof(*kp);
+ ks_inc = -sizeof(*kp);
}
while (--num_iter >= 0) {
@@ -784,7 +784,7 @@ init_des()
k = (k|07) - (k&07);
k++;
}
- perm[i] = (unsigned char)k;
+ perm[i] = k;
}
#ifdef DEBUG
prtab("pc1tab", perm, 8);
@@ -831,7 +831,7 @@ init_des()
k = (k|07) - (k&07);
k++;
}
- perm[i*8+j] = (unsigned char)k;
+ perm[i*8+j] = k;
}
}
#ifdef DEBUG
@@ -877,7 +877,7 @@ init_des()
for (i = 0; i < 32; i++)
tmp32[i] = 0;
for (i = 0; i < 4; i++)
- tmp32[4 * tableno + i] = (unsigned char)(k >> i) & 01;
+ tmp32[4 * tableno + i] = (k >> i) & 01;
k = 0;
for (i = 24; --i >= 0; )
k = (k<<1) | tmp32[perm[i]-1];
diff --git a/missing/dup2.c b/missing/dup2.c
index 7554084c5d..e7cc46f4c1 100644
--- a/missing/dup2.c
+++ b/missing/dup2.c
@@ -11,7 +11,7 @@
* Return fd2 if all went well; return BADEXIT otherwise.
*/
-#include "ruby/config.h"
+#include "config.h"
#if defined(HAVE_FCNTL)
# include <fcntl.h>
@@ -24,7 +24,8 @@
#define BADEXIT -1
int
-dup2(int fd1, int fd2)
+dup2(fd1, fd2)
+int fd1, fd2;
{
#if defined(HAVE_FCNTL) && defined(F_DUPFD)
if (fd1 != fd2) {
diff --git a/missing/erf.c b/missing/erf.c
index fe65b9a479..d9e7469024 100644
--- a/missing/erf.c
+++ b/missing/erf.c
@@ -25,7 +25,8 @@ static double q_gamma(double, double, double);
/* Incomplete gamma function
1 / Gamma(a) * Int_0^x exp(-t) t^(a-1) dt */
-static double p_gamma(double a, double x, double loggamma_a)
+static double p_gamma(a, x, loggamma_a)
+ double a, x, loggamma_a;
{
int k;
double result, term, previous;
@@ -44,7 +45,8 @@ static double p_gamma(double a, double x, double loggamma_a)
/* Incomplete gamma function
1 / Gamma(a) * Int_x^inf exp(-t) t^(a-1) dt */
-static double q_gamma(double a, double x, double loggamma_a)
+static double q_gamma(a, x, loggamma_a)
+ double a, x, loggamma_a;
{
int k;
double result, w, temp, previous;
@@ -67,7 +69,8 @@ static double q_gamma(double a, double x, double loggamma_a)
#define LOG_PI_OVER_2 0.572364942924700087071713675675 /* log_e(PI)/2 */
-double erf(double x)
+double erf(x)
+ double x;
{
if (!finite(x)) {
if (isnan(x)) return x; /* erf(NaN) = NaN */
@@ -77,7 +80,8 @@ double erf(double x)
else return - p_gamma(0.5, x * x, LOG_PI_OVER_2);
}
-double erfc(double x)
+double erfc(x)
+ double x;
{
if (!finite(x)) {
if (isnan(x)) return x; /* erfc(NaN) = NaN */
diff --git a/missing/finite.c b/missing/finite.c
index 8d0b7af262..f91035a8cd 100644
--- a/missing/finite.c
+++ b/missing/finite.c
@@ -1,7 +1,8 @@
/* public domain rewrite of finite(3) */
int
-finite(double n)
+finite(n)
+ double n;
{
return !isnan(n) && !isinf(n);
}
diff --git a/missing/flock.c b/missing/flock.c
index b02f8bf832..5f6b41c357 100644
--- a/missing/flock.c
+++ b/missing/flock.c
@@ -1,4 +1,4 @@
-#include "ruby/config.h"
+#include "config.h"
#if defined _WIN32
#elif defined HAVE_FCNTL && defined HAVE_FCNTL_H
@@ -24,7 +24,9 @@
#include <errno.h>
int
-flock(int fd, int operation)
+flock(fd, operation)
+ int fd;
+ int operation;
{
struct flock lock;
@@ -89,7 +91,9 @@ flock(int fd, int operation)
# endif
int
-flock(int fd, int operation)
+flock(fd, operation)
+ int fd;
+ int operation;
{
switch (operation) {
@@ -121,7 +125,9 @@ flock(int fd, int operation)
}
#else
int
-flock(int fd, int operation)
+flock(fd, operation)
+ int fd;
+ int operation;
{
rb_notimplement();
return -1;
diff --git a/missing/hypot.c b/missing/hypot.c
index 5a663553cf..aad5259e92 100644
--- a/missing/hypot.c
+++ b/missing/hypot.c
@@ -2,7 +2,8 @@
#include <math.h>
-double hypot(double x, double y)
+double hypot(x,y)
+ double x, y;
{
if (x < 0) x = -x;
if (y < 0) y = -y;
diff --git a/missing/isinf.c b/missing/isinf.c
index 4aef51b213..c9e49c6795 100644
--- a/missing/isinf.c
+++ b/missing/isinf.c
@@ -6,7 +6,8 @@
#include <nan.h>
int
-isinf(double n)
+isinf(n)
+ double n;
{
if (IsNANorINF(n) && IsINF(n)) {
return 1;
@@ -18,7 +19,7 @@ isinf(double n)
#else
-#include "ruby/config.h"
+#include "config.h"
#if defined(HAVE_FINITE) && defined(HAVE_ISNAN)
@@ -34,7 +35,8 @@ isinf(double n)
*/
#ifndef isinf
int
-isinf(double n)
+isinf(n)
+ double n;
{
return (!finite(n) && !isnan(n));
}
@@ -48,12 +50,13 @@ isinf(double n)
# include <strings.h>
#endif
-static double zero(void) { return 0.0; }
-static double one (void) { return 1.0; }
-static double inf (void) { return one() / zero(); }
+static double zero() { return 0.0; }
+static double one() { return 1.0; }
+static double inf() { return one() / zero(); }
int
-isinf(double n)
+isinf(n)
+ double n;
{
static double pinf = 0.0;
static double ninf = 0.0;
diff --git a/missing/isnan.c b/missing/isnan.c
index a8733978ad..459048e936 100644
--- a/missing/isnan.c
+++ b/missing/isnan.c
@@ -1,15 +1,17 @@
/* public domain rewrite of isnan(3) */
-static int double_ne(double n1, double n2);
+static int double_ne();
int
-isnan(double n)
+isnan(n)
+ double n;
{
return double_ne(n, n);
}
static int
-double_ne(double n1, double n2)
+double_ne(n1, n2)
+ double n1, n2;
{
return n1 != n2;
}
diff --git a/missing/langinfo.c b/missing/langinfo.c
deleted file mode 100644
index 6373afd0f5..0000000000
--- a/missing/langinfo.c
+++ /dev/null
@@ -1,147 +0,0 @@
-/* -*- c-file-style: "gnu" -*- */
-/*
- * This is a quick-and-dirty emulator of the nl_langinfo(CODESET)
- * function defined in the Single Unix Specification for those systems
- * (FreeBSD, etc.) that don't have one yet. It behaves as if it had
- * been called after setlocale(LC_CTYPE, ""), that is it looks at
- * the locale environment variables.
- *
- * http://www.opengroup.org/onlinepubs/7908799/xsh/langinfo.h.html
- *
- * Please extend it as needed and suggest improvements to the author.
- * This emulator will hopefully become redundant soon as
- * nl_langinfo(CODESET) becomes more widely implemented.
- *
- * Since the proposed Li18nux encoding name registry is still not mature,
- * the output follows the MIME registry where possible:
- *
- * http://www.iana.org/assignments/character-sets
- *
- * A possible autoconf test for the availability of nl_langinfo(CODESET)
- * can be found in
- *
- * http://www.cl.cam.ac.uk/~mgk25/unicode.html#activate
- *
- * 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.
- *
- * Latest version:
- *
- * http://www.cl.cam.ac.uk/~mgk25/ucs/langinfo.c
- */
-
-#include <stdlib.h>
-#include <string.h>
-#if defined _WIN32 || defined __CYGWIN__
-#include <windows.h>
-#if defined _WIN32
-#define strncasecmp strnicmp
-#endif
-#endif
-#ifdef HAVE_LANGINFO_H
-#include "langinfo.h"
-#endif
-
-#define C_CODESET "US-ASCII" /* Return this as the encoding of the
- * C/POSIX locale. Could as well one day
- * become "UTF-8". */
-
-#if defined _WIN32 || defined __CYGWIN__
-#define JA_CODESET "Windows-31J"
-#else
-#define JA_CODESET "EUC-JP"
-#endif
-
-#define digit(x) ((x) >= '0' && (x) <= '9')
-#define strstart(s, n) (strncasecmp(s, n, strlen(n)) == 0)
-
-static char buf[16];
-
-const char *
-nl_langinfo_codeset(void)
-{
- const char *l, *p;
- int n;
-
- if (((l = getenv("LC_ALL")) && *l) ||
- ((l = getenv("LC_CTYPE")) && *l) ||
- ((l = getenv("LANG")) && *l)) {
- /* check standardized locales */
- if (!strcmp(l, "C") || !strcmp(l, "POSIX"))
- return C_CODESET;
- /* check for encoding name fragment */
- p = strchr(l, '.');
- if (!p++) p = l;
- if (strstart(p, "UTF"))
- return "UTF-8";
- if ((n = 5, strstart(p, "8859-")) || (n = 9, strstart(p, "ISO-8859-"))) {
- if (digit(p[n])) {
- p += n;
- memcpy(buf, "ISO-8859-\0\0", 12);
- buf[9] = *p++;
- if (digit(*p)) buf[10] = *p++;
- return buf;
- }
- }
- if (strstart(p, "KOI8-R")) return "KOI8-R";
- if (strstart(p, "KOI8-U")) return "KOI8-U";
- if (strstart(p, "620")) return "TIS-620";
- if (strstart(p, "2312")) return "GB2312";
- if (strstart(p, "HKSCS")) return "Big5HKSCS"; /* no MIME charset */
- if (strstart(p, "BIG5")) return "Big5";
- if (strstart(p, "GBK")) return "GBK"; /* no MIME charset */
- if (strstart(p, "18030")) return "GB18030"; /* no MIME charset */
- if (strstart(p, "Shift_JIS") || strstart(p, "SJIS")) return "Windows-31J";
- /* check for conclusive modifier */
- if (strstart(p, "euro")) return "ISO-8859-15";
- /* check for language (and perhaps country) codes */
- if (strstart(l, "zh_TW")) return "Big5";
- if (strstart(l, "zh_HK")) return "Big5HKSCS"; /* no MIME charset */
- if (strstart(l, "zh")) return "GB2312";
- if (strstart(l, "ja")) return JA_CODESET;
- if (strstart(l, "ko")) return "EUC-KR";
- if (strstart(l, "ru")) return "KOI8-R";
- if (strstart(l, "uk")) return "KOI8-U";
- if (strstart(l, "pl") || strstart(l, "hr") ||
- strstart(l, "hu") || strstart(l, "cs") ||
- strstart(l, "sk") || strstart(l, "sl")) return "ISO-8859-2";
- if (strstart(l, "eo") || strstart(l, "mt")) return "ISO-8859-3";
- if (strstart(l, "el")) return "ISO-8859-7";
- if (strstart(l, "he")) return "ISO-8859-8";
- if (strstart(l, "tr")) return "ISO-8859-9";
- if (strstart(l, "th")) return "TIS-620"; /* or ISO-8859-11 */
- if (strstart(l, "lt")) return "ISO-8859-13";
- if (strstart(l, "cy")) return "ISO-8859-14";
- if (strstart(l, "ro")) return "ISO-8859-2"; /* or ISO-8859-16 */
- if (strstart(l, "am") || strstart(l, "vi")) return "UTF-8";
- /* Send me further rules if you like, but don't forget that we are
- * *only* interested in locale naming conventions on platforms
- * that do not already provide an nl_langinfo(CODESET) implementation. */
- }
- return NULL;
-}
-
-#ifdef HAVE_LANGINFO_H
-char *nl_langinfo(nl_item item)
-{
- const char *codeset;
- if (item != CODESET)
- return NULL;
- codeset = nl_langinfo_codeset();
- if (!codeset) codeset = C_CODESET;
- return (char *)codeset;
-}
-#endif
-
-/* For a demo, compile with "gcc -W -Wall -o langinfo -D TEST langinfo.c" */
-
-#ifdef TEST
-#include <stdio.h>
-int main()
-{
- printf("%s\n", nl_langinfo(CODESET));
- return 0;
-}
-#endif
diff --git a/missing/lgamma_r.c b/missing/lgamma_r.c
deleted file mode 100644
index ba8535b18a..0000000000
--- a/missing/lgamma_r.c
+++ /dev/null
@@ -1,68 +0,0 @@
-/* lgamma_r.c - public domain implementation of function lgamma_r(3m)
-
-lgamma_r() is based on gamma(). modified by Tanaka Akira.
-
-reference - Haruhiko Okumura: C-gengo niyoru saishin algorithm jiten
- (New Algorithm handbook in C language) (Gijyutsu hyouron
- sha, Tokyo, 1991) [in Japanese]
- http://oku.edu.mie-u.ac.jp/~okumura/algo/
-*/
-
-/***********************************************************
- gamma.c -- Gamma function
-***********************************************************/
-#include <math.h>
-#include <errno.h>
-#define PI 3.14159265358979324 /* $\pi$ */
-#define LOG_2PI 1.83787706640934548 /* $\log 2\pi$ */
-#define LOG_PI 1.14472988584940017 /* $\log_e \pi$ */
-#define N 8
-
-#define B0 1 /* Bernoulli numbers */
-#define B1 (-1.0 / 2.0)
-#define B2 ( 1.0 / 6.0)
-#define B4 (-1.0 / 30.0)
-#define B6 ( 1.0 / 42.0)
-#define B8 (-1.0 / 30.0)
-#define B10 ( 5.0 / 66.0)
-#define B12 (-691.0 / 2730.0)
-#define B14 ( 7.0 / 6.0)
-#define B16 (-3617.0 / 510.0)
-
-static double
-loggamma(double x) /* the natural logarithm of the Gamma function. */
-{
- double v, w;
-
- if (x == 1.0 || x == 2.0) return 0.0;
-
- v = 1;
- while (x < N) { v *= x; x++; }
- w = 1 / (x * x);
- return ((((((((B16 / (16 * 15)) * w + (B14 / (14 * 13))) * w
- + (B12 / (12 * 11))) * w + (B10 / (10 * 9))) * w
- + (B8 / ( 8 * 7))) * w + (B6 / ( 6 * 5))) * w
- + (B4 / ( 4 * 3))) * w + (B2 / ( 2 * 1))) / x
- + 0.5 * LOG_2PI - log(v) - x + (x - 0.5) * log(x);
-}
-
-/* the natural logarithm of the absolute value of the Gamma function */
-double
-lgamma_r(double x, int *signp)
-{
- if (x <= 0) {
- double i, f, s;
- f = modf(-x, &i);
- if (f == 0.0) { /* pole error */
- *signp = 1;
- errno = ERANGE;
- return HUGE_VAL;
- }
- *signp = (fmod(i, 2.0) != 0.0) ? 1 : -1;
- s = sin(PI * f);
- if (s < 0) s = -s;
- return LOG_PI - log(s) - loggamma(1 - x);
- }
- *signp = 1;
- return loggamma(x);
-}
diff --git a/missing/memcmp.c b/missing/memcmp.c
index 5b3ad3817a..9edc9c13b9 100644
--- a/missing/memcmp.c
+++ b/missing/memcmp.c
@@ -1,15 +1,16 @@
/* public domain rewrite of memcmp(3) */
-#include <stddef.h>
-
int
-memcmp(const void *s1, const void *s2, size_t len)
+memcmp(s1,s2,len)
+ char *s1;
+ char *s2;
+ register int len;
{
register unsigned char *a = (unsigned char*)s1;
register unsigned char *b = (unsigned char*)s2;
register int tmp;
- for (; len; --len) {
+ while (len--) {
if (tmp = *a++ - *b++)
return tmp;
}
diff --git a/missing/memmove.c b/missing/memmove.c
index 19c5f18847..c9d67d8b45 100644
--- a/missing/memmove.c
+++ b/missing/memmove.c
@@ -1,21 +1,22 @@
/* public domain rewrite of memcmp(3) */
-#include <stddef.h>
-
void *
-memmove(void *d, const void *s, size_t n)
+memmove (d, s, n)
+ void *d, *s;
+ int n;
{
- char *dst = (char *)d;
- const char *src = (const char *)s;
+ char *dst = d;
+ char *src = s;
+ void *ret = dst;
if (src < dst) {
src += n;
dst += n;
- for (; n; --n)
+ while (n--)
*--dst = *--src;
}
else if (dst < src)
- for (; n; --n)
+ while (n--)
*dst++ = *src++;
- return d;
+ return ret;
}
diff --git a/missing/os2.c b/missing/os2.c
index 3448cdc281..fe7238aad1 100644
--- a/missing/os2.c
+++ b/missing/os2.c
@@ -17,36 +17,11 @@ chown(char *path, int owner, int group)
return 0;
}
-#if 0
int
link(char *from, char *to)
{
return -1;
}
-#endif
-
-#if defined(EMX_REPLACE_GETCWD) && (EMX_REPLACE_GETCWD) \
- || defined(EMX_REPLACE_CHDIR) && (EMX_REPLACE_CHDIR)
-#include <unistd.h>
-
-#if defined(EMX_REPLACE_GETCWD) && (EMX_REPLACE_GETCWD)
-/* to handle the drive letter and DBCS characters within a given path */
-char *
-getcwd(char *path, size_t len)
-{
- return _getcwd2(path, (int)len);
-}
-#endif
-
-#if defined(EMX_REPLACE_CHDIR) && (EMX_REPLACE_CHDIR)
-/* to handle the drive letter and DBCS characters within a given path */
-int
-chdir(__const__ char *path)
-{
- return _chdir2(path);
-}
-#endif
-#endif
typedef char* CHARP;
diff --git a/missing/strcasecmp.c b/missing/strcasecmp.c
new file mode 100644
index 0000000000..fddb8385be
--- /dev/null
+++ b/missing/strcasecmp.c
@@ -0,0 +1,16 @@
+/* public domain rewrite of strcasecmp(3) */
+
+#include <ctype.h>
+
+int
+strcasecmp(p1, p2)
+ char *p1, *p2;
+{
+ while (*p1 && *p2) {
+ if (toupper(*p1) != toupper(*p2))
+ return toupper(*p1) - toupper(*p2);
+ p1++;
+ p2++;
+ }
+ return strlen(p1) - strlen(p2);
+}
diff --git a/missing/strchr.c b/missing/strchr.c
index bebd7ba578..886d70ede6 100644
--- a/missing/strchr.c
+++ b/missing/strchr.c
@@ -1,28 +1,32 @@
/* public domain rewrite of strchr(3) and strrchr(3) */
char *
-strchr(const char *s, int c)
+strchr(s, c)
+ char *s;
+ int c;
{
- if (c == 0) return (char *)s + strlen(s);
+ if (c == 0) return s + strlen(s);
while (*s) {
if (*s == c)
- return (char *)s;
+ return s;
s++;
}
return 0;
}
char *
-strrchr(const char *s, int c)
+strrchr(s, c)
+ char *s;
+ int c;
{
- const char *save;
+ char *save;
- if (c == 0) return (char *)s + strlen(s);
+ if (c == 0) return s + strlen(s);
save = 0;
while (*s) {
if (*s == c)
save = s;
s++;
}
- return (char *)save;
+ return save;
}
diff --git a/missing/strerror.c b/missing/strerror.c
index 023935a1ff..c1bf6feff8 100644
--- a/missing/strerror.c
+++ b/missing/strerror.c
@@ -6,7 +6,8 @@ extern char *sys_errlist[];
static char msg[50];
char *
-strerror(int error)
+strerror(error)
+ int error;
{
if (error <= sys_nerr && error > 0) {
return sys_errlist[error];
diff --git a/missing/strftime.c b/missing/strftime.c
new file mode 100644
index 0000000000..caa5eb8719
--- /dev/null
+++ b/missing/strftime.c
@@ -0,0 +1,903 @@
+/*
+ * strftime.c
+ *
+ * Public-domain implementation of ANSI C library routine.
+ *
+ * It's written in old-style C for maximal portability.
+ * However, since I'm used to prototypes, I've included them too.
+ *
+ * If you want stuff in the System V ascftime routine, add the SYSV_EXT define.
+ * For extensions from SunOS, add SUNOS_EXT.
+ * For stuff needed to implement the P1003.2 date command, add POSIX2_DATE.
+ * For VMS dates, add VMS_EXT.
+ * For a an RFC822 time format, add MAILHEADER_EXT.
+ * For ISO week years, add ISO_DATE_EXT.
+ * For complete POSIX semantics, add POSIX_SEMANTICS.
+ *
+ * The code for %c, %x, and %X now follows the 1003.2 specification for
+ * the POSIX locale.
+ * This version ignores LOCALE information.
+ * It also doesn't worry about multi-byte characters.
+ * So there.
+ *
+ * This file is also shipped with GAWK (GNU Awk), gawk specific bits of
+ * code are included if GAWK is defined.
+ *
+ * Arnold Robbins
+ * January, February, March, 1991
+ * Updated March, April 1992
+ * Updated April, 1993
+ * Updated February, 1994
+ * Updated May, 1994
+ * Updated January, 1995
+ * Updated September, 1995
+ * Updated January, 1996
+ *
+ * Fixes from ado@elsie.nci.nih.gov
+ * February 1991, May 1992
+ * Fixes from Tor Lillqvist tml@tik.vtt.fi
+ * May, 1993
+ * Further fixes from ado@elsie.nci.nih.gov
+ * February 1994
+ * %z code from chip@chinacat.unicom.com
+ * Applied September 1995
+ * %V code fixed (again) and %G, %g added,
+ * January 1996
+ */
+
+#include "config.h"
+
+#ifndef GAWK
+#include <stdio.h>
+#include <ctype.h>
+#include <string.h>
+#include <time.h>
+#endif
+#if defined(TM_IN_SYS_TIME) || !defined(GAWK) && !defined(_WIN32_WCE)
+#include <sys/types.h>
+#include <sys/time.h>
+#endif
+
+/* defaults: season to taste */
+#define SYSV_EXT 1 /* stuff in System V ascftime routine */
+#define SUNOS_EXT 1 /* stuff in SunOS strftime routine */
+#define POSIX2_DATE 1 /* stuff in Posix 1003.2 date command */
+#define VMS_EXT 1 /* include %v for VMS date format */
+#define MAILHEADER_EXT 1 /* add %z for HHMM format */
+#define ISO_DATE_EXT 1 /* %G and %g for year of ISO week */
+#ifndef GAWK
+#define POSIX_SEMANTICS 1 /* call tzset() if TZ changes */
+#endif
+
+#if defined(ISO_DATE_EXT)
+#if ! defined(POSIX2_DATE)
+#define POSIX2_DATE 1
+#endif
+#endif
+
+#if defined(POSIX2_DATE)
+#if ! defined(SYSV_EXT)
+#define SYSV_EXT 1
+#endif
+#if ! defined(SUNOS_EXT)
+#define SUNOS_EXT 1
+#endif
+#endif
+
+#if defined(POSIX2_DATE)
+#define adddecl(stuff) stuff
+#else
+#define adddecl(stuff)
+#endif
+
+#undef strchr /* avoid AIX weirdness */
+
+#ifndef __STDC__
+#define const /**/
+extern void tzset();
+static int weeknumber();
+adddecl(static int iso8601wknum();)
+#else
+extern void tzset(void);
+static int weeknumber(const struct tm *timeptr, int firstweekday);
+adddecl(static int iso8601wknum(const struct tm *timeptr);)
+#endif
+
+#ifdef STDC_HEADERS
+#include <stdlib.h>
+#include <string.h>
+#else
+extern void *malloc();
+extern void *realloc();
+extern char *getenv();
+extern char *strchr();
+#endif
+
+#define range(low, item, hi) max(low, min(item, hi))
+
+#ifdef __CYGWIN__
+#define DLL_IMPORT __declspec(dllimport)
+#endif
+#ifdef __WIN32__
+#define DLL_IMPORT __declspec(dllimport)
+#endif
+#if !defined(OS2) && !defined(MSDOS) && defined(HAVE_TZNAME)
+extern DLL_IMPORT char *tzname[2];
+#ifdef HAVE_DAYLIGHT
+extern DLL_IMPORT int daylight;
+#endif
+#ifdef HAVE_VAR_TIMEZONE
+extern DLL_IMPORT TYPEOF_VAR_TIMEZONE timezone;
+#endif
+#ifdef HAVE_VAR_ALTZONE
+extern DLL_IMPORT TYPEOF_VAR_ALTZONE altzone;
+#endif
+#endif
+
+#undef min /* just in case */
+
+/* min --- return minimum of two numbers */
+
+#ifndef __STDC__
+static inline int
+min(a, b)
+int a, b;
+#else
+static inline int
+min(int a, int b)
+#endif
+{
+ return (a < b ? a : b);
+}
+
+#undef max /* also, just in case */
+
+/* max --- return maximum of two numbers */
+
+#ifndef __STDC__
+static inline int
+max(a, b)
+int a, b;
+#else
+static inline int
+max(int a, int b)
+#endif
+{
+ return (a > b ? a : b);
+}
+
+/* strftime --- produce formatted time */
+
+#ifndef __STDC__
+size_t
+strftime(s, maxsize, format, timeptr)
+char *s;
+size_t maxsize;
+const char *format;
+const struct tm *timeptr;
+#else
+size_t
+strftime(char *s, size_t maxsize, const char *format, const struct tm *timeptr)
+#endif
+{
+ char *endp = s + maxsize;
+ char *start = s;
+ auto char tbuf[100];
+ long off;
+ int i, w;
+ long y;
+ static short first = 1;
+#ifdef POSIX_SEMANTICS
+ static char *savetz = NULL;
+ static int savetzlen = 0;
+ char *tz;
+#endif /* POSIX_SEMANTICS */
+#ifndef HAVE_TM_ZONE
+#ifndef HAVE_TM_NAME
+ struct timeval tv;
+ struct timezone zone;
+#endif /* HAVE_TM_NAME */
+#endif /* HAVE_TM_ZONE */
+
+ /* various tables, useful in North America */
+ static const char *days_a[] = {
+ "Sun", "Mon", "Tue", "Wed",
+ "Thu", "Fri", "Sat",
+ };
+ static const char *days_l[] = {
+ "Sunday", "Monday", "Tuesday", "Wednesday",
+ "Thursday", "Friday", "Saturday",
+ };
+ static const char *months_a[] = {
+ "Jan", "Feb", "Mar", "Apr", "May", "Jun",
+ "Jul", "Aug", "Sep", "Oct", "Nov", "Dec",
+ };
+ static const char *months_l[] = {
+ "January", "February", "March", "April",
+ "May", "June", "July", "August", "September",
+ "October", "November", "December",
+ };
+ static const char *ampm[] = { "AM", "PM", };
+
+ if (s == NULL || format == NULL || timeptr == NULL || maxsize == 0)
+ return 0;
+
+ /* quick check if we even need to bother */
+ if (strchr(format, '%') == NULL && strlen(format) + 1 >= maxsize)
+ return 0;
+
+#ifndef POSIX_SEMANTICS
+ if (first) {
+ tzset();
+ first = 0;
+ }
+#else /* POSIX_SEMANTICS */
+ tz = getenv("TZ");
+ if (first) {
+ if (tz != NULL) {
+ int tzlen = strlen(tz);
+
+ savetz = (char *) malloc(tzlen + 1);
+ if (savetz != NULL) {
+ savetzlen = tzlen + 1;
+ strcpy(savetz, tz);
+ }
+ }
+ tzset();
+ first = 0;
+ }
+ /* if we have a saved TZ, and it is different, recapture and reset */
+ if (tz && savetz && (tz[0] != savetz[0] || strcmp(tz, savetz) != 0)) {
+ i = strlen(tz) + 1;
+ if (i > savetzlen) {
+ savetz = (char *) realloc(savetz, i);
+ if (savetz) {
+ savetzlen = i;
+ strcpy(savetz, tz);
+ }
+ } else
+ strcpy(savetz, tz);
+ tzset();
+ }
+#endif /* POSIX_SEMANTICS */
+
+ for (; *format && s < endp - 1; format++) {
+ tbuf[0] = '\0';
+ if (*format != '%') {
+ *s++ = *format;
+ continue;
+ }
+ again:
+ switch (*++format) {
+ case '\0':
+ *s++ = '%';
+ goto out;
+
+ case '%':
+ *s++ = '%';
+ continue;
+
+ case 'a': /* abbreviated weekday name */
+ if (timeptr->tm_wday < 0 || timeptr->tm_wday > 6)
+ strcpy(tbuf, "?");
+ else
+ strcpy(tbuf, days_a[timeptr->tm_wday]);
+ break;
+
+ case 'A': /* full weekday name */
+ if (timeptr->tm_wday < 0 || timeptr->tm_wday > 6)
+ strcpy(tbuf, "?");
+ else
+ strcpy(tbuf, days_l[timeptr->tm_wday]);
+ break;
+
+#ifdef SYSV_EXT
+ case 'h': /* abbreviated month name */
+#endif
+ case 'b': /* abbreviated month name */
+ if (timeptr->tm_mon < 0 || timeptr->tm_mon > 11)
+ strcpy(tbuf, "?");
+ else
+ strcpy(tbuf, months_a[timeptr->tm_mon]);
+ break;
+
+ case 'B': /* full month name */
+ if (timeptr->tm_mon < 0 || timeptr->tm_mon > 11)
+ strcpy(tbuf, "?");
+ else
+ strcpy(tbuf, months_l[timeptr->tm_mon]);
+ break;
+
+ case 'c': /* appropriate date and time representation */
+ strftime(tbuf, sizeof tbuf, "%a %b %e %H:%M:%S %Y", timeptr);
+ break;
+
+ case 'd': /* day of the month, 01 - 31 */
+ i = range(1, timeptr->tm_mday, 31);
+ sprintf(tbuf, "%02d", i);
+ break;
+
+ case 'H': /* hour, 24-hour clock, 00 - 23 */
+ i = range(0, timeptr->tm_hour, 23);
+ sprintf(tbuf, "%02d", i);
+ break;
+
+ case 'I': /* hour, 12-hour clock, 01 - 12 */
+ i = range(0, timeptr->tm_hour, 23);
+ if (i == 0)
+ i = 12;
+ else if (i > 12)
+ i -= 12;
+ sprintf(tbuf, "%02d", i);
+ break;
+
+ case 'j': /* day of the year, 001 - 366 */
+ sprintf(tbuf, "%03d", timeptr->tm_yday + 1);
+ break;
+
+ case 'm': /* month, 01 - 12 */
+ i = range(0, timeptr->tm_mon, 11);
+ sprintf(tbuf, "%02d", i + 1);
+ break;
+
+ case 'M': /* minute, 00 - 59 */
+ i = range(0, timeptr->tm_min, 59);
+ sprintf(tbuf, "%02d", i);
+ break;
+
+ case 'p': /* am or pm based on 12-hour clock */
+ i = range(0, timeptr->tm_hour, 23);
+ if (i < 12)
+ strcpy(tbuf, ampm[0]);
+ else
+ strcpy(tbuf, ampm[1]);
+ break;
+
+ case 'S': /* second, 00 - 60 */
+ i = range(0, timeptr->tm_sec, 60);
+ sprintf(tbuf, "%02d", i);
+ break;
+
+ case 'U': /* week of year, Sunday is first day of week */
+ sprintf(tbuf, "%02d", weeknumber(timeptr, 0));
+ break;
+
+ case 'w': /* weekday, Sunday == 0, 0 - 6 */
+ i = range(0, timeptr->tm_wday, 6);
+ sprintf(tbuf, "%d", i);
+ break;
+
+ case 'W': /* week of year, Monday is first day of week */
+ sprintf(tbuf, "%02d", weeknumber(timeptr, 1));
+ break;
+
+ case 'x': /* appropriate date representation */
+ strftime(tbuf, sizeof tbuf, "%m/%d/%y", timeptr);
+ break;
+
+ case 'X': /* appropriate time representation */
+ strftime(tbuf, sizeof tbuf, "%H:%M:%S", timeptr);
+ break;
+
+ case 'y': /* year without a century, 00 - 99 */
+ i = timeptr->tm_year % 100;
+ sprintf(tbuf, "%02d", i);
+ break;
+
+ case 'Y': /* year with century */
+ sprintf(tbuf, "%ld", 1900L + timeptr->tm_year);
+ break;
+
+#ifdef MAILHEADER_EXT
+ /*
+ * From: Chip Rosenthal <chip@chinacat.unicom.com>
+ * Date: Sun, 19 Mar 1995 00:33:29 -0600 (CST)
+ *
+ * Warning: the %z [code] is implemented by inspecting the
+ * timezone name conditional compile settings, and
+ * inferring a method to get timezone offsets. I've tried
+ * this code on a couple of machines, but I don't doubt
+ * there is some system out there that won't like it.
+ * Maybe the easiest thing to do would be to bracket this
+ * with an #ifdef that can turn it off. The %z feature
+ * would be an admittedly obscure one that most folks can
+ * live without, but it would be a great help to those of
+ * us that muck around with various message processors.
+ */
+ case 'z': /* time zone offset east of GMT e.g. -0600 */
+#ifdef HAVE_TM_NAME
+ /*
+ * Systems with tm_name probably have tm_tzadj as
+ * secs west of GMT. Convert to mins east of GMT.
+ */
+ off = -timeptr->tm_tzadj / 60;
+#else /* !HAVE_TM_NAME */
+#ifdef HAVE_TM_ZONE
+ /*
+ * Systems with tm_zone probably have tm_gmtoff as
+ * secs east of GMT. Convert to mins east of GMT.
+ */
+ off = timeptr->tm_gmtoff / 60;
+#else /* !HAVE_TM_ZONE */
+#ifdef HAVE_GETTIMEOFDAY
+ gettimeofday(&tv, &zone);
+ off = -zone.tz_minuteswest;
+#else
+#if HAVE_VAR_TIMEZONE
+#if HAVE_VAR_ALTZONE
+ off = -(daylight ? timezone : altzone) / 60;
+#else
+ off = -timezone / 60;
+#endif
+#endif
+#endif
+#endif /* !HAVE_TM_ZONE */
+#endif /* !HAVE_TM_NAME */
+ if (off < 0) {
+ tbuf[0] = '-';
+ off = -off;
+ } else {
+ tbuf[0] = '+';
+ }
+ sprintf(tbuf+1, "%02u%02u", (unsigned)off/60, (unsigned)off%60);
+ break;
+#endif /* MAILHEADER_EXT */
+
+ case 'Z': /* time zone name or abbrevation */
+#ifdef HAVE_TZNAME
+ i = (daylight && timeptr->tm_isdst > 0); /* 0 or 1 */
+ strcpy(tbuf, tzname[i]);
+#else
+#ifdef HAVE_TM_ZONE
+ strcpy(tbuf, timeptr->tm_zone);
+#else
+#ifdef HAVE_TM_NAME
+ strcpy(tbuf, timeptr->tm_name);
+#else
+#ifdef HAVE_TIMEZONE
+ gettimeofday(& tv, & zone);
+#ifdef TIMEZONE_VOID
+ strcpy(tbuf, timezone());
+#else
+ strcpy(tbuf, timezone(zone.tz_minuteswest,
+ timeptr->tm_isdst > 0));
+#endif /* TIMEZONE_VOID */
+#endif /* HAVE_TIMEZONE */
+#endif /* HAVE_TM_NAME */
+#endif /* HAVE_TM_ZONE */
+#endif /* HAVE_TZNAME */
+ break;
+
+#ifdef SYSV_EXT
+ case 'n': /* same as \n */
+ tbuf[0] = '\n';
+ tbuf[1] = '\0';
+ break;
+
+ case 't': /* same as \t */
+ tbuf[0] = '\t';
+ tbuf[1] = '\0';
+ break;
+
+ case 'D': /* date as %m/%d/%y */
+ strftime(tbuf, sizeof tbuf, "%m/%d/%y", timeptr);
+ break;
+
+ case 'e': /* day of month, blank padded */
+ sprintf(tbuf, "%2d", range(1, timeptr->tm_mday, 31));
+ break;
+
+ case 'r': /* time as %I:%M:%S %p */
+ strftime(tbuf, sizeof tbuf, "%I:%M:%S %p", timeptr);
+ break;
+
+ case 'R': /* time as %H:%M */
+ strftime(tbuf, sizeof tbuf, "%H:%M", timeptr);
+ break;
+
+ case 'T': /* time as %H:%M:%S */
+ strftime(tbuf, sizeof tbuf, "%H:%M:%S", timeptr);
+ break;
+#endif
+
+#ifdef SUNOS_EXT
+ case 'k': /* hour, 24-hour clock, blank pad */
+ sprintf(tbuf, "%2d", range(0, timeptr->tm_hour, 23));
+ break;
+
+ case 'l': /* hour, 12-hour clock, 1 - 12, blank pad */
+ i = range(0, timeptr->tm_hour, 23);
+ if (i == 0)
+ i = 12;
+ else if (i > 12)
+ i -= 12;
+ sprintf(tbuf, "%2d", i);
+ break;
+#endif
+
+
+#ifdef VMS_EXT
+ case 'v': /* date as dd-bbb-YYYY */
+ sprintf(tbuf, "%2d-%3.3s-%4ld",
+ range(1, timeptr->tm_mday, 31),
+ months_a[range(0, timeptr->tm_mon, 11)],
+ timeptr->tm_year + 1900L);
+ for (i = 3; i < 6; i++)
+ if (islower(tbuf[i]))
+ tbuf[i] = toupper(tbuf[i]);
+ break;
+#endif
+
+
+#ifdef POSIX2_DATE
+ case 'C':
+ sprintf(tbuf, "%02ld", (timeptr->tm_year + 1900L) / 100);
+ break;
+
+
+ case 'E':
+ case 'O':
+ /* POSIX locale extensions, ignored for now */
+ goto again;
+
+ case 'V': /* week of year according ISO 8601 */
+ sprintf(tbuf, "%02d", iso8601wknum(timeptr));
+ break;
+
+ case 'u':
+ /* ISO 8601: Weekday as a decimal number [1 (Monday) - 7] */
+ sprintf(tbuf, "%d", timeptr->tm_wday == 0 ? 7 :
+ timeptr->tm_wday);
+ break;
+#endif /* POSIX2_DATE */
+
+#ifdef ISO_DATE_EXT
+ case 'G':
+ case 'g':
+ /*
+ * Year of ISO week.
+ *
+ * If it's December but the ISO week number is one,
+ * that week is in next year.
+ * If it's January but the ISO week number is 52 or
+ * 53, that week is in last year.
+ * Otherwise, it's this year.
+ */
+ w = iso8601wknum(timeptr);
+ if (timeptr->tm_mon == 11 && w == 1)
+ y = 1900L + timeptr->tm_year + 1;
+ else if (timeptr->tm_mon == 0 && w >= 52)
+ y = 1900L + timeptr->tm_year - 1;
+ else
+ y = 1900L + timeptr->tm_year;
+
+ if (*format == 'G')
+ sprintf(tbuf, "%ld", y);
+ else
+ sprintf(tbuf, "%02ld", y % 100);
+ break;
+#endif /* ISO_DATE_EXT */
+ default:
+ tbuf[0] = '%';
+ tbuf[1] = *format;
+ tbuf[2] = '\0';
+ break;
+ }
+ i = strlen(tbuf);
+ if (i) {
+ if (s + i < endp - 1) {
+ strcpy(s, tbuf);
+ s += i;
+ } else
+ return 0;
+ }
+ }
+out:
+ if (s < endp && *format == '\0') {
+ *s = '\0';
+ return (s - start);
+ } else
+ return 0;
+}
+
+/* isleap --- is a year a leap year? */
+
+#ifndef __STDC__
+static int
+isleap(year)
+long year;
+#else
+static int
+isleap(long year)
+#endif
+{
+ return ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0);
+}
+
+
+#ifdef POSIX2_DATE
+/* iso8601wknum --- compute week number according to ISO 8601 */
+
+#ifndef __STDC__
+static int
+iso8601wknum(timeptr)
+const struct tm *timeptr;
+#else
+static int
+iso8601wknum(const struct tm *timeptr)
+#endif
+{
+ /*
+ * From 1003.2:
+ * If the week (Monday to Sunday) containing January 1
+ * has four or more days in the new year, then it is week 1;
+ * otherwise it is the highest numbered week of the previous
+ * year (52 or 53), and the next week is week 1.
+ *
+ * ADR: This means if Jan 1 was Monday through Thursday,
+ * it was week 1, otherwise week 52 or 53.
+ *
+ * XPG4 erroneously included POSIX.2 rationale text in the
+ * main body of the standard. Thus it requires week 53.
+ */
+
+ int weeknum, jan1day;
+
+ /* get week number, Monday as first day of the week */
+ weeknum = weeknumber(timeptr, 1);
+
+ /*
+ * With thanks and tip of the hatlo to tml@tik.vtt.fi
+ *
+ * What day of the week does January 1 fall on?
+ * We know that
+ * (timeptr->tm_yday - jan1.tm_yday) MOD 7 ==
+ * (timeptr->tm_wday - jan1.tm_wday) MOD 7
+ * and that
+ * jan1.tm_yday == 0
+ * and that
+ * timeptr->tm_wday MOD 7 == timeptr->tm_wday
+ * from which it follows that. . .
+ */
+ jan1day = timeptr->tm_wday - (timeptr->tm_yday % 7);
+ if (jan1day < 0)
+ jan1day += 7;
+
+ /*
+ * If Jan 1 was a Monday through Thursday, it was in
+ * week 1. Otherwise it was last year's highest week, which is
+ * this year's week 0.
+ *
+ * What does that mean?
+ * If Jan 1 was Monday, the week number is exactly right, it can
+ * never be 0.
+ * If it was Tuesday through Thursday, the weeknumber is one
+ * less than it should be, so we add one.
+ * Otherwise, Friday, Saturday or Sunday, the week number is
+ * OK, but if it is 0, it needs to be 52 or 53.
+ */
+ switch (jan1day) {
+ case 1: /* Monday */
+ break;
+ case 2: /* Tuesday */
+ case 3: /* Wednesday */
+ case 4: /* Thursday */
+ weeknum++;
+ break;
+ case 5: /* Friday */
+ case 6: /* Saturday */
+ case 0: /* Sunday */
+ if (weeknum == 0) {
+#ifdef USE_BROKEN_XPG4
+ /* XPG4 (as of March 1994) says 53 unconditionally */
+ weeknum = 53;
+#else
+ /* get week number of last week of last year */
+ struct tm dec31ly; /* 12/31 last year */
+ dec31ly = *timeptr;
+ dec31ly.tm_year--;
+ dec31ly.tm_mon = 11;
+ dec31ly.tm_mday = 31;
+ dec31ly.tm_wday = (jan1day == 0) ? 6 : jan1day - 1;
+ dec31ly.tm_yday = 364 + isleap(dec31ly.tm_year + 1900L);
+ weeknum = iso8601wknum(& dec31ly);
+#endif
+ }
+ break;
+ }
+
+ if (timeptr->tm_mon == 11) {
+ /*
+ * The last week of the year
+ * can be in week 1 of next year.
+ * Sigh.
+ *
+ * This can only happen if
+ * M T W
+ * 29 30 31
+ * 30 31
+ * 31
+ */
+ int wday, mday;
+
+ wday = timeptr->tm_wday;
+ mday = timeptr->tm_mday;
+ if ( (wday == 1 && (mday >= 29 && mday <= 31))
+ || (wday == 2 && (mday == 30 || mday == 31))
+ || (wday == 3 && mday == 31))
+ weeknum = 1;
+ }
+
+ return weeknum;
+}
+#endif
+
+/* weeknumber --- figure how many weeks into the year */
+
+/* With thanks and tip of the hatlo to ado@elsie.nci.nih.gov */
+
+#ifndef __STDC__
+static int
+weeknumber(timeptr, firstweekday)
+const struct tm *timeptr;
+int firstweekday;
+#else
+static int
+weeknumber(const struct tm *timeptr, int firstweekday)
+#endif
+{
+ int wday = timeptr->tm_wday;
+ int ret;
+
+ if (firstweekday == 1) {
+ if (wday == 0) /* sunday */
+ wday = 6;
+ else
+ wday--;
+ }
+ ret = ((timeptr->tm_yday + 7 - wday) / 7);
+ if (ret < 0)
+ ret = 0;
+ return ret;
+}
+
+#if 0
+/* ADR --- I'm loathe to mess with ado's code ... */
+
+Date: Wed, 24 Apr 91 20:54:08 MDT
+From: Michal Jaegermann <audfax!emory!vm.ucs.UAlberta.CA!NTOMCZAK>
+To: arnold@audiofax.com
+
+Hi Arnold,
+in a process of fixing of strftime() in libraries on Atari ST I grabbed
+some pieces of code from your own strftime. When doing that it came
+to mind that your weeknumber() function compiles a little bit nicer
+in the following form:
+/*
+ * firstweekday is 0 if starting in Sunday, non-zero if in Monday
+ */
+{
+ return (timeptr->tm_yday - timeptr->tm_wday +
+ (firstweekday ? (timeptr->tm_wday ? 8 : 1) : 7)) / 7;
+}
+How nicer it depends on a compiler, of course, but always a tiny bit.
+
+ Cheers,
+ Michal
+ ntomczak@vm.ucs.ualberta.ca
+#endif
+
+#ifdef TEST_STRFTIME
+
+/*
+ * NAME:
+ * tst
+ *
+ * SYNOPSIS:
+ * tst
+ *
+ * DESCRIPTION:
+ * "tst" is a test driver for the function "strftime".
+ *
+ * OPTIONS:
+ * None.
+ *
+ * AUTHOR:
+ * Karl Vogel
+ * Control Data Systems, Inc.
+ * vogelke@c-17igp.wpafb.af.mil
+ *
+ * BUGS:
+ * None noticed yet.
+ *
+ * COMPILE:
+ * cc -o tst -DTEST_STRFTIME strftime.c
+ */
+
+/* ADR: I reformatted this to my liking, and deleted some unneeded code. */
+
+#ifndef NULL
+#include <stdio.h>
+#endif
+#include <sys/time.h>
+#include <string.h>
+
+#define MAXTIME 132
+
+/*
+ * Array of time formats.
+ */
+
+static char *array[] =
+{
+ "(%%A) full weekday name, var length (Sunday..Saturday) %A",
+ "(%%B) full month name, var length (January..December) %B",
+ "(%%C) Century %C",
+ "(%%D) date (%%m/%%d/%%y) %D",
+ "(%%E) Locale extensions (ignored) %E",
+ "(%%H) hour (24-hour clock, 00..23) %H",
+ "(%%I) hour (12-hour clock, 01..12) %I",
+ "(%%M) minute (00..59) %M",
+ "(%%O) Locale extensions (ignored) %O",
+ "(%%R) time, 24-hour (%%H:%%M) %R",
+ "(%%S) second (00..60) %S",
+ "(%%T) time, 24-hour (%%H:%%M:%%S) %T",
+ "(%%U) week of year, Sunday as first day of week (00..53) %U",
+ "(%%V) week of year according to ISO 8601 %V",
+ "(%%W) week of year, Monday as first day of week (00..53) %W",
+ "(%%X) appropriate locale time representation (%H:%M:%S) %X",
+ "(%%Y) year with century (1970...) %Y",
+ "(%%Z) timezone (EDT), or blank if timezone not determinable %Z",
+ "(%%a) locale's abbreviated weekday name (Sun..Sat) %a",
+ "(%%b) locale's abbreviated month name (Jan..Dec) %b",
+ "(%%c) full date (Sat Nov 4 12:02:33 1989)%n%t%t%t %c",
+ "(%%d) day of the month (01..31) %d",
+ "(%%e) day of the month, blank-padded ( 1..31) %e",
+ "(%%h) should be same as (%%b) %h",
+ "(%%j) day of the year (001..366) %j",
+ "(%%k) hour, 24-hour clock, blank pad ( 0..23) %k",
+ "(%%l) hour, 12-hour clock, blank pad ( 0..12) %l",
+ "(%%m) month (01..12) %m",
+ "(%%p) locale's AM or PM based on 12-hour clock %p",
+ "(%%r) time, 12-hour (same as %%I:%%M:%%S %%p) %r",
+ "(%%u) ISO 8601: Weekday as decimal number [1 (Monday) - 7] %u",
+ "(%%v) VMS date (dd-bbb-YYYY) %v",
+ "(%%w) day of week (0..6, Sunday == 0) %w",
+ "(%%x) appropriate locale date representation %x",
+ "(%%y) last two digits of year (00..99) %y",
+ "(%%z) timezone offset east of GMT as HHMM (e.g. -0500) %z",
+ (char *) NULL
+};
+
+/* main routine. */
+
+int
+main(argc, argv)
+int argc;
+char **argv;
+{
+ long time();
+
+ char *next;
+ char string[MAXTIME];
+
+ int k;
+ int length;
+
+ struct tm *tm;
+
+ long clock;
+
+ /* Call the function. */
+
+ clock = time((long *) 0);
+ tm = localtime(&clock);
+
+ for (k = 0; next = array[k]; k++) {
+ length = strftime(string, MAXTIME, next, tm);
+ printf("%s\n", string);
+ }
+
+ exit(0);
+}
+#endif /* TEST_STRFTIME */
diff --git a/missing/strlcat.c b/missing/strlcat.c
deleted file mode 100644
index b309648155..0000000000
--- a/missing/strlcat.c
+++ /dev/null
@@ -1,73 +0,0 @@
-/* $OpenBSD: strlcat.c,v 1.8 2001/05/13 15:40:15 deraadt Exp $ */
-
-/*
- * 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.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char *rcsid = "$OpenBSD: strlcat.c,v 1.8 2001/05/13 15:40:15 deraadt Exp $";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/types.h>
-#include <string.h>
-
-/*
- * Appends src to string dst of size siz (unlike strncat, siz is the
- * full size of dst, not space left). At most siz-1 characters
- * will be copied. Always NUL terminates (unless siz <= strlen(dst)).
- * Returns strlen(src) + MIN(siz, strlen(initial dst)).
- * If retval >= siz, truncation occurred.
- */
-size_t
-strlcat(dst, src, siz)
- char *dst;
- const char *src;
- size_t siz;
-{
- register char *d = dst;
- register const char *s = src;
- register size_t n = siz;
- size_t dlen;
-
- /* Find the end of dst and adjust bytes left but don't go past end */
- while (n-- != 0 && *d != '\0')
- d++;
- dlen = d - dst;
- n = siz - dlen;
-
- if (n == 0)
- return(dlen + strlen(s));
- while (*s != '\0') {
- if (n != 1) {
- *d++ = *s;
- n--;
- }
- s++;
- }
- *d = '\0';
-
- return(dlen + (s - src)); /* count does not include NUL */
-}
diff --git a/missing/strlcpy.c b/missing/strlcpy.c
deleted file mode 100644
index 5f586964b7..0000000000
--- a/missing/strlcpy.c
+++ /dev/null
@@ -1,69 +0,0 @@
-/* $OpenBSD: strlcpy.c,v 1.5 2001/05/13 15:40:16 deraadt Exp $ */
-
-/*
- * 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.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char *rcsid = "$OpenBSD: strlcpy.c,v 1.5 2001/05/13 15:40:16 deraadt Exp $";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/types.h>
-#include <string.h>
-
-/*
- * Copy src to string dst of size siz. At most siz-1 characters
- * will be copied. Always NUL terminates (unless siz == 0).
- * Returns strlen(src); if retval >= siz, truncation occurred.
- */
-size_t
-strlcpy(dst, src, siz)
- char *dst;
- const char *src;
- size_t siz;
-{
- register char *d = dst;
- register const char *s = src;
- register size_t n = siz;
-
- /* Copy as many bytes as will fit */
- if (n != 0 && --n != 0) {
- do {
- if ((*d++ = *s++) == 0)
- break;
- } while (--n != 0);
- }
-
- /* Not enough room in dst, add NUL and traverse rest of src */
- if (n == 0) {
- if (siz != 0)
- *d = '\0'; /* NUL-terminate dst */
- while (*s++)
- ;
- }
-
- return(s - src - 1); /* count does not include NUL */
-}
diff --git a/missing/strncasecmp.c b/missing/strncasecmp.c
new file mode 100644
index 0000000000..a4cc5828b8
--- /dev/null
+++ b/missing/strncasecmp.c
@@ -0,0 +1,21 @@
+/* public domain rewrite of strncasecmp(3) */
+
+#include <ctype.h>
+
+int
+strncasecmp(p1, p2, len)
+ char *p1;
+ char *p2;
+ int len;
+{
+ while (len != 0) {
+ if (toupper(*p1) != toupper(*p2)) {
+ return toupper(*p1) - toupper(*p2);
+ }
+ if (*p1 == '\0') {
+ return 0;
+ }
+ len--; p1++; p2++;
+ }
+ return 0;
+}
diff --git a/missing/strstr.c b/missing/strstr.c
index 2e9c282fb1..1673518f06 100644
--- a/missing/strstr.c
+++ b/missing/strstr.c
@@ -1,19 +1,20 @@
/* public domain rewrite of strstr(3) */
char *
-strstr(const char *haystack, const char *needle)
+strstr(haystack, needle)
+ char *haystack, *needle;
{
- const char *hend;
- const char *a, *b;
+ char *hend;
+ char *a, *b;
- if (*needle == 0) return (char *)haystack;
+ if (*needle == 0) return haystack;
hend = haystack + strlen(haystack) - strlen(needle) + 1;
while (haystack < hend) {
if (*haystack == *needle) {
a = haystack;
b = needle;
for (;;) {
- if (*b == 0) return (char *)haystack;
+ if (*b == 0) return haystack;
if (*a++ != *b++) {
break;
}
diff --git a/missing/strtod.c b/missing/strtod.c
new file mode 100644
index 0000000000..fdccd48081
--- /dev/null
+++ b/missing/strtod.c
@@ -0,0 +1,271 @@
+/*
+ * strtod.c --
+ *
+ * Source code for the "strtod" library procedure.
+ *
+ * Copyright (c) 1988-1993 The Regents of the University of California.
+ * Copyright (c) 1994 Sun Microsystems, Inc.
+ *
+ * Permission to use, copy, modify, and distribute this
+ * software and its documentation for any purpose and without
+ * fee is hereby granted, provided that the above copyright
+ * notice appear in all copies. The University of California
+ * makes no representations about the suitability of this
+ * software for any purpose. It is provided "as is" without
+ * express or implied warranty.
+ *
+ * RCS: @(#) $Id$
+ */
+
+#include "config.h"
+#ifdef HAVE_STDLIB_H
+# include <stdlib.h>
+#endif
+#include <ctype.h>
+#include <errno.h>
+extern int errno;
+
+#ifndef __STDC__
+# ifdef __GNUC__
+# define const __const__
+# else
+# define const
+# endif
+#endif
+
+#ifndef TRUE
+#define TRUE 1
+#define FALSE 0
+#endif
+#ifndef NULL
+#define NULL 0
+#endif
+
+static int maxExponent = 511; /* Largest possible base 10 exponent. Any
+ * exponent larger than this will already
+ * produce underflow or overflow, so there's
+ * no need to worry about additional digits.
+ */
+static double powersOf10[] = { /* Table giving binary powers of 10. Entry */
+ 10., /* is 10^2^i. Used to convert decimal */
+ 100., /* exponents into floating-point numbers. */
+ 1.0e4,
+ 1.0e8,
+ 1.0e16,
+ 1.0e32,
+ 1.0e64,
+ 1.0e128,
+ 1.0e256
+};
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * strtod --
+ *
+ * This procedure converts a floating-point number from an ASCII
+ * decimal representation to internal double-precision format.
+ *
+ * Results:
+ * The return value is the double-precision floating-point
+ * representation of the characters in string. If endPtr isn't
+ * NULL, then *endPtr is filled in with the address of the
+ * next character after the last one that was part of the
+ * floating-point number.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+double
+strtod(string, endPtr)
+ const char *string; /* A decimal ASCII floating-point number,
+ * optionally preceded by white space.
+ * Must have form "-I.FE-X", where I is the
+ * integer part of the mantissa, F is the
+ * fractional part of the mantissa, and X
+ * is the exponent. Either of the signs
+ * may be "+", "-", or omitted. Either I
+ * or F may be omitted, or both. The decimal
+ * point isn't necessary unless F is present.
+ * The "E" may actually be an "e". E and X
+ * may both be omitted (but not just one).
+ */
+ char **endPtr; /* If non-NULL, store terminating character's
+ * address here. */
+{
+ int sign, expSign = FALSE;
+ double fraction, dblExp, *d;
+ register const char *p;
+ register int c;
+ int exp = 0; /* Exponent read from "EX" field. */
+ int fracExp = 0; /* Exponent that derives from the fractional
+ * part. Under normal circumstatnces, it is
+ * the negative of the number of digits in F.
+ * However, if I is very long, the last digits
+ * of I get dropped (otherwise a long I with a
+ * large negative exponent could cause an
+ * unnecessary overflow on I alone). In this
+ * case, fracExp is incremented one for each
+ * dropped digit. */
+ int mantSize; /* Number of digits in mantissa. */
+ int decPt; /* Number of mantissa digits BEFORE decimal
+ * point. */
+ const char *pExp; /* Temporarily holds location of exponent
+ * in string. */
+
+ /*
+ * Strip off leading blanks and check for a sign.
+ */
+
+ p = string;
+ while (isspace(*p)) {
+ p += 1;
+ }
+ if (*p == '-') {
+ sign = TRUE;
+ p += 1;
+ } else {
+ if (*p == '+') {
+ p += 1;
+ }
+ sign = FALSE;
+ }
+
+ /*
+ * Count the number of digits in the mantissa (including the decimal
+ * point), and also locate the decimal point.
+ */
+
+ decPt = -1;
+ for (mantSize = 0; ; mantSize += 1)
+ {
+ c = *p;
+ if (!isdigit(c)) {
+ if ((c != '.') || (decPt >= 0)) {
+ break;
+ }
+ decPt = mantSize;
+ }
+ p += 1;
+ }
+
+ /*
+ * Now suck up the digits in the mantissa. Use two integers to
+ * collect 9 digits each (this is faster than using floating-point).
+ * If the mantissa has more than 18 digits, ignore the extras, since
+ * they can't affect the value anyway.
+ */
+
+ pExp = p;
+ p -= mantSize;
+ if (decPt < 0) {
+ decPt = mantSize;
+ } else {
+ mantSize -= 1; /* One of the digits was the point. */
+ }
+ if (mantSize > 18) {
+ fracExp = decPt - 18;
+ mantSize = 18;
+ } else {
+ fracExp = decPt - mantSize;
+ }
+ if (mantSize == 0) {
+ fraction = 0.0;
+ p = string;
+ goto done;
+ } else {
+ int frac1, frac2;
+ frac1 = 0;
+ for ( ; mantSize > 9; mantSize -= 1)
+ {
+ c = *p;
+ p += 1;
+ if (c == '.') {
+ c = *p;
+ p += 1;
+ }
+ frac1 = 10*frac1 + (c - '0');
+ }
+ frac2 = 0;
+ for (; mantSize > 0; mantSize -= 1)
+ {
+ c = *p;
+ p += 1;
+ if (c == '.') {
+ c = *p;
+ p += 1;
+ }
+ frac2 = 10*frac2 + (c - '0');
+ }
+ fraction = (1.0e9 * frac1) + frac2;
+ }
+
+ /*
+ * Skim off the exponent.
+ */
+
+ p = pExp;
+ if ((*p == 'E') || (*p == 'e')) {
+ p += 1;
+ if (*p == '-') {
+ expSign = TRUE;
+ p += 1;
+ } else {
+ if (*p == '+') {
+ p += 1;
+ }
+ expSign = FALSE;
+ }
+ while (isdigit(*p)) {
+ exp = exp * 10 + (*p - '0');
+ p += 1;
+ }
+ }
+ if (expSign) {
+ exp = fracExp - exp;
+ } else {
+ exp = fracExp + exp;
+ }
+
+ /*
+ * Generate a floating-point number that represents the exponent.
+ * Do this by processing the exponent one bit at a time to combine
+ * many powers of 2 of 10. Then combine the exponent with the
+ * fraction.
+ */
+
+ if (exp < 0) {
+ expSign = TRUE;
+ exp = -exp;
+ } else {
+ expSign = FALSE;
+ }
+ if (exp > maxExponent) {
+ exp = maxExponent;
+ errno = ERANGE;
+ }
+ dblExp = 1.0;
+ for (d = powersOf10; exp != 0; exp >>= 1, d += 1) {
+ if (exp & 01) {
+ dblExp *= *d;
+ }
+ }
+ if (expSign) {
+ fraction /= dblExp;
+ } else {
+ fraction *= dblExp;
+ }
+
+done:
+ if (endPtr != NULL) {
+ *endPtr = (char *) p;
+ }
+
+ if (sign) {
+ return -fraction;
+ }
+ return fraction;
+}
diff --git a/missing/strtol.c b/missing/strtol.c
index da6636f316..e94aa54ca0 100644
--- a/missing/strtol.c
+++ b/missing/strtol.c
@@ -3,10 +3,13 @@
#include <ctype.h>
long
-strtol(const char *nptr, char **endptr, int base)
+strtol(nptr, endptr, base)
+ char *nptr;
+ char **endptr;
+ int base;
{
long result;
- const char *p = nptr;
+ char *p = nptr;
while (isspace(*p)) {
p++;
@@ -20,7 +23,7 @@ strtol(const char *nptr, char **endptr, int base)
result = strtoul(p, endptr, base);
}
if (endptr != 0 && *endptr == p) {
- *endptr = (char *)nptr;
+ *endptr = nptr;
}
return result;
}
diff --git a/missing/strtoul.c b/missing/strtoul.c
new file mode 100644
index 0000000000..f16f2ad9cf
--- /dev/null
+++ b/missing/strtoul.c
@@ -0,0 +1,184 @@
+/*
+ * strtoul.c --
+ *
+ * Source code for the "strtoul" library procedure.
+ *
+ * Copyright 1988 Regents of the University of California
+ * Permission to use, copy, modify, and distribute this
+ * software and its documentation for any purpose and without
+ * fee is hereby granted, provided that the above copyright
+ * notice appear in all copies. The University of California
+ * makes no representations about the suitability of this
+ * software for any purpose. It is provided "as is" without
+ * express or implied warranty.
+ */
+
+#include <ctype.h>
+
+/*
+ * The table below is used to convert from ASCII digits to a
+ * numerical equivalent. It maps from '0' through 'z' to integers
+ * (100 for non-digit characters).
+ */
+
+static char cvtIn[] = {
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, /* '0' - '9' */
+ 100, 100, 100, 100, 100, 100, 100, /* punctuation */
+ 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, /* 'A' - 'Z' */
+ 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
+ 30, 31, 32, 33, 34, 35,
+ 100, 100, 100, 100, 100, 100, /* punctuation */
+ 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, /* 'a' - 'z' */
+ 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
+ 30, 31, 32, 33, 34, 35};
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * strtoul --
+ *
+ * Convert an ASCII string into an integer.
+ *
+ * Results:
+ * The return value is the integer equivalent of string. If endPtr
+ * is non-NULL, then *endPtr is filled in with the character
+ * after the last one that was part of the integer. If string
+ * doesn't contain a valid integer value, then zero is returned
+ * and *endPtr is set to string.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+unsigned long int
+strtoul(string, endPtr, base)
+ char *string; /* String of ASCII digits, possibly
+ * preceded by white space. For bases
+ * greater than 10, either lower- or
+ * upper-case digits may be used.
+ */
+ char **endPtr; /* Where to store address of terminating
+ * character, or NULL. */
+ int base; /* Base for conversion. Must be less
+ * than 37. If 0, then the base is chosen
+ * from the leading characters of string:
+ * "0x" means hex, "0" means octal, anything
+ * else means decimal.
+ */
+{
+ register char *p;
+ register unsigned long int result = 0;
+ register unsigned digit;
+ int anyDigits = 0;
+
+ /*
+ * Skip any leading blanks.
+ */
+
+ p = string;
+ while (isspace(*p)) {
+ p += 1;
+ }
+
+ /*
+ * If no base was provided, pick one from the leading characters
+ * of the string.
+ */
+
+ if (base == 0)
+ {
+ if (*p == '0') {
+ p += 1;
+ if (*p == 'x') {
+ p += 1;
+ base = 16;
+ } else {
+
+ /*
+ * Must set anyDigits here, otherwise "0" produces a
+ * "no digits" error.
+ */
+
+ anyDigits = 1;
+ base = 8;
+ }
+ }
+ else base = 10;
+ } else if (base == 16) {
+
+ /*
+ * Skip a leading "0x" from hex numbers.
+ */
+
+ if ((p[0] == '0') && (p[1] == 'x')) {
+ p += 2;
+ }
+ }
+
+ /*
+ * Sorry this code is so messy, but speed seems important. Do
+ * different things for base 8, 10, 16, and other.
+ */
+
+ if (base == 8) {
+ for ( ; ; p += 1) {
+ digit = *p - '0';
+ if (digit > 7) {
+ break;
+ }
+ result = (result << 3) + digit;
+ anyDigits = 1;
+ }
+ } else if (base == 10) {
+ for ( ; ; p += 1) {
+ digit = *p - '0';
+ if (digit > 9) {
+ break;
+ }
+ result = (10*result) + digit;
+ anyDigits = 1;
+ }
+ } else if (base == 16) {
+ for ( ; ; p += 1) {
+ digit = *p - '0';
+ if (digit > ('z' - '0')) {
+ break;
+ }
+ digit = cvtIn[digit];
+ if (digit > 15) {
+ break;
+ }
+ result = (result << 4) + digit;
+ anyDigits = 1;
+ }
+ } else {
+ for ( ; ; p += 1) {
+ digit = *p - '0';
+ if (digit > ('z' - '0')) {
+ break;
+ }
+ digit = cvtIn[digit];
+ if (digit >= base) {
+ break;
+ }
+ result = result*base + digit;
+ anyDigits = 1;
+ }
+ }
+
+ /*
+ * See if there were any digits at all.
+ */
+
+ if (!anyDigits) {
+ p = string;
+ }
+
+ if (endPtr != 0) {
+ *endPtr = p;
+ }
+
+ return result;
+}
diff --git a/missing/tgamma.c b/missing/tgamma.c
deleted file mode 100644
index 5e306fbb43..0000000000
--- a/missing/tgamma.c
+++ /dev/null
@@ -1,92 +0,0 @@
-/* tgamma.c - public domain implementation of function tgamma(3m)
-
-reference - Haruhiko Okumura: C-gengo niyoru saishin algorithm jiten
- (New Algorithm handbook in C language) (Gijyutsu hyouron
- sha, Tokyo, 1991) [in Japanese]
- http://oku.edu.mie-u.ac.jp/~okumura/algo/
-*/
-
-/***********************************************************
- gamma.c -- Gamma function
-***********************************************************/
-#include "ruby/config.h"
-#include <math.h>
-#include <errno.h>
-
-#ifdef HAVE_LGAMMA_R
-
-double tgamma(double x)
-{
- int sign;
- double d;
- if (x == 0.0) { /* Pole Error */
- errno = ERANGE;
- return 1/x < 0 ? -HUGE_VAL : HUGE_VAL;
- }
- if (x < 0) {
- static double zero = 0.0;
- double i, f;
- f = modf(-x, &i);
- if (f == 0.0) { /* Domain Error */
- errno = EDOM;
- return zero/zero;
- }
- }
- d = lgamma_r(x, &sign);
- return sign * exp(d);
-}
-
-#else
-
-#include <errno.h>
-#define PI 3.14159265358979324 /* $\pi$ */
-#define LOG_2PI 1.83787706640934548 /* $\log 2\pi$ */
-#define N 8
-
-#define B0 1 /* Bernoulli numbers */
-#define B1 (-1.0 / 2.0)
-#define B2 ( 1.0 / 6.0)
-#define B4 (-1.0 / 30.0)
-#define B6 ( 1.0 / 42.0)
-#define B8 (-1.0 / 30.0)
-#define B10 ( 5.0 / 66.0)
-#define B12 (-691.0 / 2730.0)
-#define B14 ( 7.0 / 6.0)
-#define B16 (-3617.0 / 510.0)
-
-static double
-loggamma(double x) /* the natural logarithm of the Gamma function. */
-{
- double v, w;
-
- v = 1;
- while (x < N) { v *= x; x++; }
- w = 1 / (x * x);
- return ((((((((B16 / (16 * 15)) * w + (B14 / (14 * 13))) * w
- + (B12 / (12 * 11))) * w + (B10 / (10 * 9))) * w
- + (B8 / ( 8 * 7))) * w + (B6 / ( 6 * 5))) * w
- + (B4 / ( 4 * 3))) * w + (B2 / ( 2 * 1))) / x
- + 0.5 * LOG_2PI - log(v) - x + (x - 0.5) * log(x);
-}
-
-double tgamma(double x) /* Gamma function */
-{
- if (x == 0.0) { /* Pole Error */
- errno = ERANGE;
- return 1/x < 0 ? -HUGE_VAL : HUGE_VAL;
- }
- if (x < 0) {
- int sign;
- static double zero = 0.0;
- double i, f;
- f = modf(-x, &i);
- if (f == 0.0) { /* Domain Error */
- errno = EDOM;
- return zero/zero;
- }
- sign = (fmod(i, 2.0) != 0.0) ? 1 : -1;
- return sign * PI / (sin(PI * f) * exp(loggamma(1 - x)));
- }
- return exp(loggamma(x));
-}
-#endif
diff --git a/missing/vsnprintf.c b/missing/vsnprintf.c
index 5718362fed..dd4f75cfd8 100644
--- a/missing/vsnprintf.c
+++ b/missing/vsnprintf.c
@@ -65,14 +65,8 @@
#define u_short unsigned short
#define u_int unsigned int
-#if !defined(HAVE_STDARG_PROTOTYPES)
-#if defined(__STDC__)
-#define HAVE_STDARG_PROTOTYPES 1
-#endif
-#endif
-
#undef __P
-#if defined(HAVE_STDARG_PROTOTYPES)
+#if defined(__STDC__)
# include <stdarg.h>
# if !defined(__P)
# define __P(x) x
@@ -111,22 +105,11 @@
#endif /* People who don't like const sys_error */
#include <stddef.h>
-#if defined(__hpux) && !defined(__GNUC__) || defined(__DECC)
-#include <string.h>
-#endif
-
-#if !defined(__CYGWIN32__) && defined(__hpux) && !defined(__GNUC__)
-#include <stdlib.h>
-#endif
#ifndef NULL
#define NULL 0
#endif
-#if SIZEOF_LONG > SIZEOF_INT
-# include <errno.h>
-#endif
-
/*
* NB: to fit things in six character monocase externals, the stdio
* code uses the prefix `__s' for stdio objects, typically followed
@@ -136,7 +119,7 @@
/* stdio buffers */
struct __sbuf {
unsigned char *_base;
- size_t _size;
+ int _size;
};
@@ -168,15 +151,12 @@ struct __sbuf {
*/
typedef struct __sFILE {
unsigned char *_p; /* current position in (some) buffer */
-#if 0
- size_t _r; /* read space left for getc() */
-#endif
- size_t _w; /* write space left for putc() */
+ int _r; /* read space left for getc() */
+ int _w; /* write space left for putc() */
short _flags; /* flags, below; this FILE is free if 0 */
short _file; /* fileno, if Unix descriptor, else -1 */
struct __sbuf _bf; /* the buffer (at least 1 byte, if !NULL) */
- size_t _lbfsize; /* 0 or -_bf._size, for inline putc */
- int (*vwrite)(/* struct __sFILE*, struct __suio * */);
+ int _lbfsize; /* 0 or -_bf._size, for inline putc */
} FILE;
@@ -205,9 +185,6 @@ typedef struct __sFILE {
#define __sclearerr(p) ((void)((p)->_flags &= ~(__SERR|__SEOF)))
#define __sfileno(p) ((p)->_file)
-#undef feof
-#undef ferror
-#undef clearerr
#define feof(p) __sfeof(p)
#define ferror(p) __sferror(p)
#define clearerr(p) __sclearerr(p)
@@ -217,34 +194,37 @@ typedef struct __sFILE {
#endif
+#if defined(__hpux) && !defined(__GNUC__) || defined(__DECC)
+#include <string.h>
+#endif
+
/*
* I/O descriptors for __sfvwrite().
*/
struct __siov {
- const void *iov_base;
+ void *iov_base;
size_t iov_len;
};
struct __suio {
struct __siov *uio_iov;
int uio_iovcnt;
- size_t uio_resid;
+ int uio_resid;
};
-#if !defined(HAVE_VSNPRINTF) || !defined(HAVE_SNPRINTF)
/*
* Write some memory regions. Return zero on success, EOF on error.
*
* This routine is large and unsightly, but most of the ugliness due
* to the three different kinds of output buffering is handled here.
*/
-static int BSD__sfvwrite(fp, uio)
+static BSD__sfvwrite(fp, uio)
register FILE *fp;
register struct __suio *uio;
{
register size_t len;
- register const char *p;
+ register char *p;
register struct __siov *iov;
- register size_t w;
+ register int w;
if ((len = uio->uio_resid) == 0)
return (0);
@@ -304,8 +284,11 @@ static int BSD__sfvwrite(fp, uio)
*/
}
return (0);
+
+err:
+ fp->_flags |= __SERR;
+ return (EOF);
}
-#endif
/*
* Actual printf innards.
@@ -313,12 +296,18 @@ static int BSD__sfvwrite(fp, uio)
* This code is large and complicated...
*/
+#if !defined(__CYGWIN32__) && defined(__hpux) && !defined(__GNUC__)
+#include <stdlib.h>
+#endif
+
/*
* Flush out all the vectors defined by the given uio,
* then reset it so that it can be reused.
*/
static int
-BSD__sprint(FILE *fp, register struct __suio *uio)
+BSD__sprint(fp, uio)
+ FILE *fp;
+ register struct __suio *uio;
{
register int err;
@@ -326,7 +315,7 @@ BSD__sprint(FILE *fp, register struct __suio *uio)
uio->uio_iovcnt = 0;
return (0);
}
- err = (*fp->vwrite)(fp, uio);
+ err = BSD__sfvwrite(fp, uio);
uio->uio_resid = 0;
uio->uio_iovcnt = 0;
return (err);
@@ -339,7 +328,10 @@ BSD__sprint(FILE *fp, register struct __suio *uio)
* worries about ungetc buffers and so forth.
*/
static int
-BSD__sbprintf(register FILE *fp, const char *fmt, va_list ap)
+BSD__sbprintf(fp, fmt, ap)
+ register FILE *fp;
+ const char *fmt;
+ va_list ap;
{
/* We don't support files. */
return 0;
@@ -351,73 +343,7 @@ BSD__sbprintf(register FILE *fp, const char *fmt, va_list ap)
*/
#define to_digit(c) ((c) - '0')
#define is_digit(c) ((unsigned)to_digit(c) <= 9)
-#define to_char(n) (char)((n) + '0')
-
-#ifdef _HAVE_SANE_QUAD_
-/*
- * Convert an unsigned long long to ASCII for printf purposes, returning
- * a pointer to the first character of the string representation.
- * Octal numbers can be forced to have a leading zero; hex numbers
- * use the given digits.
- */
-static char *
-BSD__uqtoa(register u_quad_t val, char *endp, int base, int octzero, const char *xdigs)
-{
- register char *cp = endp;
- register long sval;
-
- /*
- * Handle the three cases separately, in the hope of getting
- * better/faster code.
- */
- switch (base) {
- case 10:
- if (val < 10) { /* many numbers are 1 digit */
- *--cp = to_char(val);
- return (cp);
- }
- /*
- * On many machines, unsigned arithmetic is harder than
- * signed arithmetic, so we do at most one unsigned mod and
- * divide; this is sufficient to reduce the range of
- * the incoming value to where signed arithmetic works.
- */
- if (val > LLONG_MAX) {
- *--cp = to_char(val % 10);
- sval = val / 10;
- } else
- sval = val;
- do {
- *--cp = to_char(sval % 10);
- sval /= 10;
- } while (sval != 0);
- break;
-
- case 8:
- do {
- *--cp = to_char(val & 7);
- val >>= 3;
- } while (val);
- if (octzero && *cp != '0')
- *--cp = '0';
- break;
-
- case 16:
- do {
- *--cp = xdigs[val & 15];
- val >>= 4;
- } while (val);
- break;
-
- default: /* oops */
- /*
- abort();
- */
- break; /* fjc 7-31-97. Don't reference abort() here */
- }
- return (cp);
-}
-#endif /* _HAVE_SANE_QUAD_ */
+#define to_char(n) ((n) + '0')
/*
* Convert an unsigned long to ASCII for printf purposes, returning
@@ -426,7 +352,11 @@ BSD__uqtoa(register u_quad_t val, char *endp, int base, int octzero, const char
* use the given digits.
*/
static char *
-BSD__ultoa(register u_long val, char *endp, int base, int octzero, const char *xdigs)
+BSD__ultoa(val, endp, base, octzero, xdigs)
+ register u_long val;
+ char *endp;
+ int base, octzero;
+ char *xdigs;
{
register char *cp = endp;
register long sval;
@@ -498,7 +428,7 @@ BSD__ultoa(register u_long val, char *endp, int base, int octzero, const char *x
#define BUF (MAXEXP+MAXFRACT+1) /* + decimal point */
#define DEFPREC 6
-static char *cvt __P((double, int, int, char *, int *, int, int *, char *));
+static char *cvt __P((double, int, int, char *, int *, int, int *));
static int exponent __P((char *, int, int));
#else /* no FLOATING_POINT */
@@ -524,25 +454,28 @@ static int exponent __P((char *, int, int));
#define SHORTINT 0x040 /* short integer */
#define ZEROPAD 0x080 /* zero (as opposed to blank) pad */
#define FPT 0x100 /* Floating point number */
-static ssize_t
-BSD_vfprintf(FILE *fp, const char *fmt0, va_list ap)
+static int
+BSD_vfprintf(fp, fmt0, ap)
+ FILE *fp;
+ const char *fmt0;
+ va_list ap;
{
- register const char *fmt; /* format string */
+ register char *fmt; /* format string */
register int ch; /* character from fmt */
register int n; /* handy integer (short term usage) */
- register const char *cp;/* handy char pointer (short term usage) */
+ register char *cp; /* handy char pointer (short term usage) */
register struct __siov *iovp;/* for PRINT macro */
register int flags; /* flags as above */
- ssize_t ret; /* return value accumulator */
+ int ret; /* return value accumulator */
int width; /* width from format (%8d), or 0 */
int prec; /* precision from format (%.3d), or -1 */
char sign; /* sign prefix (' ', '+', '-', or \0) */
#ifdef FLOATING_POINT
char softsign; /* temporary negative sign for floats */
- double _double = 0; /* double precision arguments %[eEfgG] */
+ double _double; /* double precision arguments %[eEfgG] */
int expt; /* integer value of exponent */
- int expsize = 0; /* character count for expstr */
- int ndig = 0; /* actual number of digits returned by cvt */
+ int expsize; /* character count for expstr */
+ int ndig; /* actual number of digits returned by cvt */
char expstr[7]; /* buffer for exponent string */
#endif
u_long ulval; /* integer arguments %[diouxX] */
@@ -551,19 +484,15 @@ BSD_vfprintf(FILE *fp, const char *fmt0, va_list ap)
#endif /* _HAVE_SANE_QUAD_ */
int base; /* base for [diouxX] conversion */
int dprec; /* a copy of prec if [diouxX], 0 otherwise */
- long fieldsz; /* field size expanded by sign, etc */
- long realsz; /* field size expanded by dprec */
+ int fieldsz; /* field size expanded by sign, etc */
+ int realsz; /* field size expanded by dprec */
int size; /* size of converted field or string */
- const char *xdigs = 0; /* digits for [xX] conversion */
+ char *xdigs; /* digits for [xX] conversion */
#define NIOV 8
struct __suio uio; /* output information: summary */
struct __siov iov[NIOV];/* ... and individual io vectors */
char buf[BUF]; /* space for %c, %[diouxX], %[eEfgG] */
char ox[2]; /* space for 0x hex-prefix */
- char *const ebuf = buf + sizeof(buf);
-#if SIZEOF_LONG > SIZEOF_INT
- long ln;
-#endif
/*
* Choose PADSIZE to trade efficiency vs. size. If larger printf
@@ -571,9 +500,9 @@ BSD_vfprintf(FILE *fp, const char *fmt0, va_list ap)
* below longer.
*/
#define PADSIZE 16 /* pad chunk size */
- static const char blanks[PADSIZE] =
+ static char blanks[PADSIZE] =
{' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' '};
- static const char zeroes[PADSIZE] =
+ static char zeroes[PADSIZE] =
{'0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0'};
/*
@@ -599,19 +528,6 @@ BSD_vfprintf(FILE *fp, const char *fmt0, va_list ap)
PRINT(with, n); \
} \
}
-#if SIZEOF_LONG > SIZEOF_INT
- /* abandon if too larger padding */
-#define PAD_L(howmany, with) { \
- ln = (howmany); \
- if ((long)((int)ln) != ln) { \
- errno = ENOMEM; \
- goto error; \
- } \
- if (ln > 0) PAD((int)ln, with); \
-}
-#else
-#define PAD_L(howmany, with) PAD(howmany, with)
-#endif
#define FLUSH() { \
if (uio.uio_resid && BSD__sprint(fp, &uio)) \
goto error; \
@@ -637,23 +553,21 @@ BSD_vfprintf(FILE *fp, const char *fmt0, va_list ap)
fp->_file >= 0)
return (BSD__sbprintf(fp, fmt0, ap));
- fmt = fmt0;
+ fmt = (char *)fmt0;
uio.uio_iov = iovp = iov;
uio.uio_resid = 0;
uio.uio_iovcnt = 0;
ret = 0;
- xdigs = 0;
/*
* Scan the format for conversions (`%' character).
*/
for (;;) {
- size_t nc;
for (cp = fmt; (ch = *fmt) != '\0' && ch != '%'; fmt++)
/* void */;
- if ((nc = fmt - cp) != 0) {
- PRINT(cp, nc);
- ret += nc;
+ if ((n = fmt - cp) != 0) {
+ PRINT(cp, n);
+ ret += n;
}
if (ch == '\0')
goto done;
@@ -734,29 +648,16 @@ reswitch: switch (ch) {
case 'h':
flags |= SHORTINT;
goto rflag;
-#if SIZEOF_PTRDIFF_T == SIZEOF_LONG
- case 't':
-#endif
-#if SIZEOF_SIZE_T == SIZEOF_LONG
- case 'z':
-#endif
case 'l':
flags |= LONGINT;
goto rflag;
#ifdef _HAVE_SANE_QUAD_
-#if SIZEOF_PTRDIFF_T == SIZEOF_LONG_LONG
- case 't':
-#endif
-#if SIZEOF_SIZE_T == SIZEOF_LONG_LONG
- case 'z':
-#endif
case 'q':
flags |= QUADINT;
goto rflag;
#endif /* _HAVE_SANE_QUAD_ */
case 'c':
- cp = buf;
- *buf = (char)va_arg(ap, int);
+ *(cp = buf) = va_arg(ap, int);
size = 1;
sign = '\0';
break;
@@ -772,12 +673,13 @@ reswitch: switch (ch) {
uqval = -uqval;
sign = '-';
}
- } else
-#endif /* _HAVE_SANE_QUAD_ */
+ } else {
+#else /* _HAVE_SANE_QUAD_ */
{
+#endif /* _HAVE_SANE_QUAD_ */
ulval = SARG();
if ((long)ulval < 0) {
- ulval = (u_long)(-(long)ulval);
+ ulval = -ulval;
sign = '-';
}
}
@@ -786,8 +688,6 @@ reswitch: switch (ch) {
#ifdef FLOATING_POINT
case 'e': /* anomalous precision */
case 'E':
- if (prec != 0)
- flags |= ALT;
prec = (prec == -1) ?
DEFPREC + 1 : prec + 1;
/* FALLTHROUGH */
@@ -815,9 +715,9 @@ fp_begin: _double = va_arg(ap, double);
}
flags |= FPT;
cp = cvt(_double, prec, flags, &softsign,
- &expt, ch, &ndig, buf);
+ &expt, ch, &ndig);
if (ch == 'g' || ch == 'G') {
- if (expt <= -4 || (expt > prec && expt > 1))
+ if (expt <= -4 || expt > prec)
ch = (ch == 'g') ? 'e' : 'E';
else
ch = 'g';
@@ -833,8 +733,6 @@ fp_begin: _double = va_arg(ap, double);
size = expt;
if (prec || flags & ALT)
size += prec + 1;
- } else if (!prec) { /* "0" */
- size = 1;
} else /* "0.X" */
size = prec + 2;
} else if (expt >= ndig) { /* fixed g fmt */
@@ -859,9 +757,9 @@ fp_begin: _double = va_arg(ap, double);
#endif /* _HAVE_SANE_QUAD_ */
*va_arg(ap, long *) = ret;
else if (flags & SHORTINT)
- *va_arg(ap, short *) = (short)ret;
+ *va_arg(ap, short *) = ret;
else
- *va_arg(ap, int *) = (int)ret;
+ *va_arg(ap, int *) = ret;
continue; /* no output */
case 'O':
flags |= LONGINT;
@@ -883,7 +781,6 @@ fp_begin: _double = va_arg(ap, double);
* defined manner.''
* -- ANSI X3J11
*/
- prec = (int)(sizeof(void*)*CHAR_BIT/4);
#ifdef _HAVE_LLP64_
uqval = (u_long)va_arg(ap, void *);
flags = (flags) | QUADINT | HEXPREFIX;
@@ -908,17 +805,16 @@ fp_begin: _double = va_arg(ap, double);
* NUL in the first `prec' characters, and
* strlen() will go further.
*/
- const char *p = (char *)memchr(cp, 0, prec);
+ char *p = (char *)memchr(cp, 0, prec);
- if (p != NULL && (p - cp) > prec)
- size = (int)(p - cp);
- else
+ if (p != NULL) {
+ size = p - cp;
+ if (size > prec)
+ size = prec;
+ } else
size = prec;
- }
- else {
- fieldsz = strlen(cp);
- goto long_len;
- }
+ } else
+ size = strlen(cp);
sign = '\0';
break;
case 'U':
@@ -949,11 +845,10 @@ hex:
/* leading 0x/X only if non-zero */
if (flags & ALT &&
#ifdef _HAVE_SANE_QUAD_
- (flags & QUADINT ? uqval != 0 : ulval != 0)
+ (flags & QUADINT ? uqval != 0 : ulval != 0))
#else /* _HAVE_SANE_QUAD_ */
- ulval != 0
+ ulval != 0)
#endif /* _HAVE_SANE_QUAD_ */
- )
flags |= HEXPREFIX;
/* unsigned conversions */
@@ -971,27 +866,28 @@ number: if ((dprec = prec) >= 0)
* explicit precision of zero is no characters.''
* -- ANSI X3J11
*/
+ cp = buf + BUF;
#ifdef _HAVE_SANE_QUAD_
if (flags & QUADINT) {
if (uqval != 0 || prec != 0)
- cp = BSD__uqtoa(uqval, ebuf, base,
+ cp = __uqtoa(uqval, cp, base,
flags & ALT, xdigs);
- } else
+ } else {
#else /* _HAVE_SANE_QUAD_ */
-#endif /* _HAVE_SANE_QUAD_ */
{
+#endif /* _HAVE_SANE_QUAD_ */
if (ulval != 0 || prec != 0)
- cp = BSD__ultoa(ulval, ebuf, base,
+ cp = BSD__ultoa(ulval, cp, base,
flags & ALT, xdigs);
}
- size = (int)(ebuf - cp);
+ size = buf + BUF - cp;
break;
default: /* "%?" prints ?, unless ? is NUL */
if (ch == '\0')
goto done;
/* pretend it was %c with argument ch */
cp = buf;
- *buf = ch;
+ *cp = ch;
size = 1;
sign = '\0';
break;
@@ -1012,7 +908,6 @@ number: if ((dprec = prec) >= 0)
* fieldsz excludes decimal prec; realsz includes it.
*/
fieldsz = size;
-long_len:
if (sign)
fieldsz++;
else if (flags & HEXPREFIX)
@@ -1021,7 +916,7 @@ long_len:
/* right-adjusting blank padding */
if ((flags & (LADJUST|ZEROPAD)) == 0)
- PAD_L(width - realsz, blanks);
+ PAD(width - realsz, blanks);
/* prefix */
if (sign) {
@@ -1034,32 +929,26 @@ long_len:
/* right-adjusting zero padding */
if ((flags & (LADJUST|ZEROPAD)) == ZEROPAD)
- PAD_L(width - realsz, zeroes);
+ PAD(width - realsz, zeroes);
/* leading zeroes from decimal precision */
- PAD_L(dprec - fieldsz, zeroes);
- if (sign)
- fieldsz--;
- else if (flags & HEXPREFIX)
- fieldsz -= 2;
+ PAD(dprec - fieldsz, zeroes);
/* the string or number proper */
#ifdef FLOATING_POINT
if ((flags & FPT) == 0) {
- PRINT(cp, fieldsz);
+ PRINT(cp, size);
} else { /* glue together f_p fragments */
if (ch >= 'f') { /* 'f' or 'g' */
if (_double == 0) {
/* kludge for __dtoa irregularity */
- if (ndig <= 1 &&
+ if (prec == 0 ||
(flags & ALT) == 0) {
PRINT("0", 1);
} else {
PRINT("0.", 2);
PAD(ndig - 1, zeroes);
}
- } else if (expt == 0 && ndig == 0 && (flags & ALT) == 0) {
- PRINT("0", 1);
} else if (expt <= 0) {
PRINT("0.", 2);
PAD(-expt, zeroes);
@@ -1080,7 +969,7 @@ long_len:
ox[0] = *cp++;
ox[1] = '.';
PRINT(ox, 2);
- if (_double /*|| flags & ALT == 0*/) {
+ if (_double || flags & ALT == 0) {
PRINT(cp, ndig-1);
} else /* 0.[0..] */
/* __dtoa irregularity */
@@ -1091,11 +980,11 @@ long_len:
}
}
#else
- PRINT(cp, fieldsz);
+ PRINT(cp, size);
#endif
/* left-adjusting padding (always blank) */
if (flags & LADJUST)
- PAD_L(width - realsz, blanks);
+ PAD(width - realsz, blanks);
/* finally, adjust ret */
ret += width > realsz ? width : realsz;
@@ -1114,10 +1003,10 @@ error:
extern char *BSD__dtoa __P((double, int, int, int *, int *, char **));
static char *
-cvt(value, ndigits, flags, sign, decpt, ch, length, buf)
+cvt(value, ndigits, flags, sign, decpt, ch, length)
double value;
int ndigits, flags, *decpt, ch, *length;
- char *sign, *buf;
+ char *sign;
{
int mode, dsgn;
char *digits, *bp, *rve;
@@ -1136,10 +1025,6 @@ cvt(value, ndigits, flags, sign, decpt, ch, length, buf)
*sign = '\000';
}
digits = BSD__dtoa(value, mode, ndigits, decpt, &dsgn, &rve);
- memcpy(buf, digits, rve - digits);
- xfree(digits);
- rve = buf + (rve - digits);
- digits = buf;
if (flags & ALT) { /* Print trailing zeros */
bp = digits + ndigits;
if (ch == 'f') {
@@ -1152,7 +1037,7 @@ cvt(value, ndigits, flags, sign, decpt, ch, length, buf)
while (rve < bp)
*rve++ = '0';
}
- *length = (int)(rve - digits);
+ *length = rve - digits;
return (digits);
}
@@ -1184,11 +1069,10 @@ exponent(p0, exp, fmtch)
*p++ = '0';
*p++ = to_char(exp);
}
- return (int)(p - p0);
+ return (p - p0);
}
#endif /* FLOATING_POINT */
-#ifndef HAVE_VSNPRINTF
int
vsnprintf(str, n, fmt, ap)
char *str;
@@ -1204,20 +1088,23 @@ vsnprintf(str, n, fmt, ap)
f._flags = __SWR | __SSTR;
f._bf._base = f._p = (unsigned char *)str;
f._bf._size = f._w = n - 1;
- f.vwrite = BSD__sfvwrite;
ret = BSD_vfprintf(&f, fmt, ap);
*f._p = 0;
return (ret);
}
-#endif
#if defined(LIBC_SCCS) && !defined(lint)
static char sccsid[] = "@(#)snprintf.c 8.1 (Berkeley) 6/4/93";
#endif /* LIBC_SCCS and not lint */
-#ifndef HAVE_SNPRINTF
+#if defined(__STDC__)
+# include <stdarg.h>
+#else
+# include <varargs.h>
+#endif
+
int
-#if defined(HAVE_STDARG_PROTOTYPES)
+#if defined(__STDC__)
snprintf(char *str, size_t n, char const *fmt, ...)
#else
snprintf(str, n, fmt, va_alist)
@@ -1233,7 +1120,7 @@ va_dcl
if ((int)n < 1)
return (EOF);
-#if defined(HAVE_STDARG_PROTOTYPES)
+#if defined(__STDC__)
va_start(ap, fmt);
#else
va_start(ap);
@@ -1241,10 +1128,8 @@ va_dcl
f._flags = __SWR | __SSTR;
f._bf._base = f._p = (unsigned char *)str;
f._bf._size = f._w = n - 1;
- f.vwrite = BSD__sfvwrite;
ret = BSD_vfprintf(&f, fmt, ap);
*f._p = 0;
va_end(ap);
return (ret);
}
-#endif
diff --git a/missing/x68.c b/missing/x68.c
new file mode 100644
index 0000000000..8d00d50041
--- /dev/null
+++ b/missing/x68.c
@@ -0,0 +1,40 @@
+/* x68 compatibility functions -- follows Ruby's license */
+
+#include "config.h"
+
+#if !HAVE_SELECT
+#include "x68/select.c"
+#endif
+#if MISSING__DTOS18
+#include "x68/_dtos18.c"
+#endif
+#if MISSING_FCONVERT
+#include "x68/_round.c"
+#include "x68/fconvert.c"
+#endif
+
+/* missing some basic syscalls */
+int
+link(const char *src, const char *dst)
+{
+ return symlink(src, dst);
+}
+
+#ifndef HAVE_GETTIMEOFDAY
+#include <time.h>
+#include <sys/time.h>
+
+struct timezone {
+ int tz_minuteswest;
+ int tz_dsttime;
+};
+
+int
+gettimeofday(struct timeval *tv, struct timezone *tz)
+{
+ tv->tv_sec = (long)time((time_t*)0);
+ tv->tv_usec = 0;
+
+ return 0;
+}
+#endif
diff --git a/mkconfig.rb b/mkconfig.rb
new file mode 100755
index 0000000000..255bfa7436
--- /dev/null
+++ b/mkconfig.rb
@@ -0,0 +1,195 @@
+#!./miniruby -s
+
+# avoid warnings with -d.
+$install_name ||= nil
+$so_name ||= nil
+
+srcdir = File.dirname(__FILE__)
+$:.replace [srcdir+"/lib"] unless defined?(CROSS_COMPILING)
+$:.unshift(".")
+
+require "fileutils"
+mkconfig = File.basename($0)
+
+rbconfig_rb = ARGV[0] || 'rbconfig.rb'
+unless File.directory?(dir = File.dirname(rbconfig_rb))
+ FileUtils.makedirs(dir, :verbose => true)
+end
+
+version = RUBY_VERSION
+def (config = "").write(arg)
+ concat(arg.to_s)
+end
+$stdout = config
+
+fast = {'prefix'=>TRUE, 'ruby_install_name'=>TRUE, 'INSTALL'=>TRUE, 'EXEEXT'=>TRUE}
+print %[
+# This file was created by #{mkconfig} when ruby was built. Any
+# changes made to this file will be lost the next time ruby is built.
+
+module Config
+ RUBY_VERSION == "#{version}" or
+ raise "ruby lib version (#{version}) doesn't match executable version (\#{RUBY_VERSION})"
+
+]
+
+v_fast = []
+v_others = []
+vars = {}
+has_version = false
+continued_name = nil
+continued_line = nil
+File.foreach "config.status" do |line|
+ next if /^#/ =~ line
+ name = nil
+ case line
+ when /^s([%,])@(\w+)@\1(?:\|\#_!!_\#\|)?(.*)\1/
+ name = $2
+ val = $3.gsub(/\\(?=,)/, '')
+ when /^S\["(\w+)"\]\s*=\s*"(.*)"\s*(\\)?$/
+ name = $1
+ val = $2
+ if $3
+ continued_line = []
+ continued_line << val
+ continued_name = name
+ next
+ end
+ when /^"(.+)"\s*(\\)?$/
+ if continued_line
+ continued_line << $1
+ unless $2
+ val = continued_line.join("")
+ name = continued_name
+ continued_line = nil
+ end
+ end
+ when /^(?:ac_given_)?INSTALL=(.*)/
+ v_fast << " CONFIG[\"INSTALL\"] = " + $1 + "\n"
+ end
+
+ if name
+ next if /^(?:ac_.*|configure_input|(?:top_)?srcdir|\w+OBJS)$/ =~ name
+ next if /^\$\(ac_\w+\)$/ =~ val
+ next if /^\$\{ac_\w+\}$/ =~ val
+ next if /^\$ac_\w+$/ =~ val
+ next if $install_name and /^RUBY_INSTALL_NAME$/ =~ name
+ next if $so_name and /^RUBY_SO_NAME$/ =~ name
+ next if /^(?:X|(?:MINI|RUN)RUBY$)/ =~ name
+ if /^program_transform_name$/ =~ name and /^s(\\?.)(.*)\1$/ =~ val
+ next if $install_name
+ sep = %r"#{Regexp.quote($1)}"
+ ptn = $2.sub(/\$\$/, '$').split(sep, 2)
+ name = "ruby_install_name"
+ val = "ruby".sub(/#{ptn[0]}/, ptn[1])
+ end
+ val.gsub!(/ +(?!-)/, "=") if name == "configure_args" && /mswin32/ =~ RUBY_PLATFORM
+ val = val.gsub(/\$(?:\$|\{?(\w+)\}?)/) {$1 ? "$(#{$1})" : $&}.dump
+ if /^prefix$/ =~ name
+ val = "(TOPDIR || DESTDIR + #{val})"
+ end
+ v = " CONFIG[\"#{name}\"] #{vars[name] ? '<< "\n"' : '='} #{val}\n"
+ vars[name] = true
+ if fast[name]
+ v_fast << v
+ else
+ v_others << v
+ end
+ has_version = true if name == "MAJOR"
+ end
+# break if /^CEOF/
+end
+
+drive = File::PATH_SEPARATOR == ';'
+
+prefix = '/lib/ruby/' + RUBY_VERSION.sub(/\.\d+$/, '') + '/' + RUBY_PLATFORM
+print " TOPDIR = File.dirname(__FILE__).chomp!(#{prefix.dump})\n"
+print " DESTDIR = ", (drive ? "TOPDIR && TOPDIR[/\\A[a-z]:/i] || " : ""), "'' unless defined? DESTDIR\n"
+print " CONFIG = {}\n"
+print " CONFIG[\"DESTDIR\"] = DESTDIR\n"
+
+unless has_version
+ RUBY_VERSION.scan(/(\d+)\.(\d+)\.(\d+)/) {
+ print " CONFIG[\"MAJOR\"] = \"" + $1 + "\"\n"
+ print " CONFIG[\"MINOR\"] = \"" + $2 + "\"\n"
+ print " CONFIG[\"TEENY\"] = \"" + $3 + "\"\n"
+ }
+ patchlevel = IO.foreach(File.join(srcdir, "version.h")) {|l|
+ m = /^\s*#\s*define\s+RUBY_PATCHLEVEL\s+(\d+)/.match(l) and break m[1]
+ }
+ print " CONFIG[\"PATCHLEVEL\"] = \"#{patchlevel}\"\n"
+end
+
+dest = drive ? /= \"(?!\$[\(\{])(?:[a-z]:)?/i : /= \"(?!\$[\(\{])/
+v_others.collect! do |x|
+ if /^\s*CONFIG\["(?!abs_|old)[a-z]+(?:_prefix|dir)"\]/ === x
+ x.sub(dest, '= "$(DESTDIR)')
+ else
+ x
+ end
+end
+
+if $install_name
+ v_fast << " CONFIG[\"ruby_install_name\"] = \"" + $install_name + "\"\n"
+ v_fast << " CONFIG[\"RUBY_INSTALL_NAME\"] = \"" + $install_name + "\"\n"
+end
+if $so_name
+ v_fast << " CONFIG[\"RUBY_SO_NAME\"] = \"" + $so_name + "\"\n"
+end
+
+print(*v_fast)
+print(*v_others)
+print <<EOS
+ CONFIG["ruby_version"] = "$(MAJOR).$(MINOR)"
+ CONFIG["rubylibdir"] = "$(libdir)/ruby/$(ruby_version)"
+ CONFIG["archdir"] = "$(rubylibdir)/$(arch)"
+ CONFIG["sitelibdir"] = "$(sitedir)/$(ruby_version)"
+ CONFIG["sitearchdir"] = "$(sitelibdir)/$(sitearch)"
+ CONFIG["vendorlibdir"] = "$(vendordir)/$(ruby_version)"
+ CONFIG["vendorarchdir"] = "$(vendorlibdir)/$(sitearch)"
+ CONFIG["topdir"] = File.dirname(__FILE__)
+ MAKEFILE_CONFIG = {}
+ CONFIG.each{|k,v| MAKEFILE_CONFIG[k] = v.dup}
+ def Config::expand(val, config = CONFIG)
+ val.gsub!(/\\$\\$|\\$\\(([^()]+)\\)|\\$\\{([^{}]+)\\}/) do |var|
+ if !(v = $1 || $2)
+ '$'
+ elsif key = config[v = v[/\\A[^:]+(?=(?::(.*?)=(.*))?\\z)/]]
+ pat, sub = $1, $2
+ config[v] = false
+ Config::expand(key, config)
+ config[v] = key
+ key = key.gsub(/\#{Regexp.quote(pat)}(?=\\s|\\z)/n) {sub} if pat
+ key
+ else
+ var
+ end
+ end
+ val
+ end
+ CONFIG.each_value do |val|
+ Config::expand(val)
+ end
+end
+RbConfig = Config # compatibility for ruby-1.9
+CROSS_COMPILING = nil unless defined? CROSS_COMPILING
+EOS
+
+$stdout = STDOUT
+mode = IO::RDWR|IO::CREAT
+mode |= IO::BINARY if defined?(IO::BINARY)
+open(rbconfig_rb, mode) do |f|
+ if $timestamp and f.stat.size == config.size and f.read == config
+ puts "#{rbconfig_rb} unchanged"
+ else
+ puts "#{rbconfig_rb} updated"
+ f.rewind
+ f.truncate(0)
+ f.print(config)
+ end
+end
+if String === $timestamp
+ FileUtils.touch($timestamp)
+end
+
+# vi:set sw=2:
diff --git a/node.h b/node.h
index 4ad695ca60..c209fa50d3 100644
--- a/node.h
+++ b/node.h
@@ -3,233 +3,126 @@
node.h -
$Author$
+ $Date$
created at: Fri May 28 15:14:02 JST 1993
- Copyright (C) 1993-2007 Yukihiro Matsumoto
+ Copyright (C) 1993-2003 Yukihiro Matsumoto
**********************************************************************/
-#ifndef RUBY_NODE_H
-#define RUBY_NODE_H 1
+#ifndef NODE_H
+#define NODE_H
#if defined(__cplusplus)
extern "C" {
-#if 0
-} /* satisfy cc-mode */
-#endif
#endif
enum node_type {
+ NODE_METHOD,
+ NODE_FBODY,
+ NODE_CFUNC,
NODE_SCOPE,
-#define NODE_SCOPE NODE_SCOPE
NODE_BLOCK,
-#define NODE_BLOCK NODE_BLOCK
NODE_IF,
-#define NODE_IF NODE_IF
NODE_CASE,
-#define NODE_CASE NODE_CASE
NODE_WHEN,
-#define NODE_WHEN NODE_WHEN
NODE_OPT_N,
-#define NODE_OPT_N NODE_OPT_N
NODE_WHILE,
-#define NODE_WHILE NODE_WHILE
NODE_UNTIL,
-#define NODE_UNTIL NODE_UNTIL
NODE_ITER,
-#define NODE_ITER NODE_ITER
NODE_FOR,
-#define NODE_FOR NODE_FOR
NODE_BREAK,
-#define NODE_BREAK NODE_BREAK
NODE_NEXT,
-#define NODE_NEXT NODE_NEXT
NODE_REDO,
-#define NODE_REDO NODE_REDO
NODE_RETRY,
-#define NODE_RETRY NODE_RETRY
NODE_BEGIN,
-#define NODE_BEGIN NODE_BEGIN
NODE_RESCUE,
-#define NODE_RESCUE NODE_RESCUE
NODE_RESBODY,
-#define NODE_RESBODY NODE_RESBODY
NODE_ENSURE,
-#define NODE_ENSURE NODE_ENSURE
NODE_AND,
-#define NODE_AND NODE_AND
NODE_OR,
-#define NODE_OR NODE_OR
+ NODE_NOT,
NODE_MASGN,
-#define NODE_MASGN NODE_MASGN
NODE_LASGN,
-#define NODE_LASGN NODE_LASGN
NODE_DASGN,
-#define NODE_DASGN NODE_DASGN
NODE_DASGN_CURR,
-#define NODE_DASGN_CURR NODE_DASGN_CURR
NODE_GASGN,
-#define NODE_GASGN NODE_GASGN
NODE_IASGN,
-#define NODE_IASGN NODE_IASGN
- NODE_IASGN2,
-#define NODE_IASGN2 NODE_IASGN2
NODE_CDECL,
-#define NODE_CDECL NODE_CDECL
NODE_CVASGN,
-#define NODE_CVASGN NODE_CVASGN
NODE_CVDECL,
-#define NODE_CVDECL NODE_CVDECL
NODE_OP_ASGN1,
-#define NODE_OP_ASGN1 NODE_OP_ASGN1
NODE_OP_ASGN2,
-#define NODE_OP_ASGN2 NODE_OP_ASGN2
NODE_OP_ASGN_AND,
-#define NODE_OP_ASGN_AND NODE_OP_ASGN_AND
NODE_OP_ASGN_OR,
-#define NODE_OP_ASGN_OR NODE_OP_ASGN_OR
NODE_CALL,
-#define NODE_CALL NODE_CALL
NODE_FCALL,
-#define NODE_FCALL NODE_FCALL
NODE_VCALL,
-#define NODE_VCALL NODE_VCALL
NODE_SUPER,
-#define NODE_SUPER NODE_SUPER
NODE_ZSUPER,
-#define NODE_ZSUPER NODE_ZSUPER
NODE_ARRAY,
-#define NODE_ARRAY NODE_ARRAY
NODE_ZARRAY,
-#define NODE_ZARRAY NODE_ZARRAY
- NODE_VALUES,
-#define NODE_VALUES NODE_VALUES
NODE_HASH,
-#define NODE_HASH NODE_HASH
NODE_RETURN,
-#define NODE_RETURN NODE_RETURN
NODE_YIELD,
-#define NODE_YIELD NODE_YIELD
NODE_LVAR,
-#define NODE_LVAR NODE_LVAR
NODE_DVAR,
-#define NODE_DVAR NODE_DVAR
NODE_GVAR,
-#define NODE_GVAR NODE_GVAR
NODE_IVAR,
-#define NODE_IVAR NODE_IVAR
NODE_CONST,
-#define NODE_CONST NODE_CONST
NODE_CVAR,
-#define NODE_CVAR NODE_CVAR
NODE_NTH_REF,
-#define NODE_NTH_REF NODE_NTH_REF
NODE_BACK_REF,
-#define NODE_BACK_REF NODE_BACK_REF
NODE_MATCH,
-#define NODE_MATCH NODE_MATCH
NODE_MATCH2,
-#define NODE_MATCH2 NODE_MATCH2
NODE_MATCH3,
-#define NODE_MATCH3 NODE_MATCH3
NODE_LIT,
-#define NODE_LIT NODE_LIT
NODE_STR,
-#define NODE_STR NODE_STR
NODE_DSTR,
-#define NODE_DSTR NODE_DSTR
NODE_XSTR,
-#define NODE_XSTR NODE_XSTR
NODE_DXSTR,
-#define NODE_DXSTR NODE_DXSTR
NODE_EVSTR,
-#define NODE_EVSTR NODE_EVSTR
NODE_DREGX,
-#define NODE_DREGX NODE_DREGX
NODE_DREGX_ONCE,
-#define NODE_DREGX_ONCE NODE_DREGX_ONCE
NODE_ARGS,
-#define NODE_ARGS NODE_ARGS
- NODE_ARGS_AUX,
-#define NODE_ARGS_AUX NODE_ARGS_AUX
- NODE_OPT_ARG,
-#define NODE_OPT_ARG NODE_OPT_ARG
- NODE_POSTARG,
-#define NODE_POSTARG NODE_POSTARG
NODE_ARGSCAT,
-#define NODE_ARGSCAT NODE_ARGSCAT
NODE_ARGSPUSH,
-#define NODE_ARGSPUSH NODE_ARGSPUSH
NODE_SPLAT,
-#define NODE_SPLAT NODE_SPLAT
NODE_TO_ARY,
-#define NODE_TO_ARY NODE_TO_ARY
+ NODE_SVALUE,
NODE_BLOCK_ARG,
-#define NODE_BLOCK_ARG NODE_BLOCK_ARG
NODE_BLOCK_PASS,
-#define NODE_BLOCK_PASS NODE_BLOCK_PASS
NODE_DEFN,
-#define NODE_DEFN NODE_DEFN
NODE_DEFS,
-#define NODE_DEFS NODE_DEFS
NODE_ALIAS,
-#define NODE_ALIAS NODE_ALIAS
NODE_VALIAS,
-#define NODE_VALIAS NODE_VALIAS
NODE_UNDEF,
-#define NODE_UNDEF NODE_UNDEF
NODE_CLASS,
-#define NODE_CLASS NODE_CLASS
NODE_MODULE,
-#define NODE_MODULE NODE_MODULE
NODE_SCLASS,
-#define NODE_SCLASS NODE_SCLASS
NODE_COLON2,
-#define NODE_COLON2 NODE_COLON2
NODE_COLON3,
-#define NODE_COLON3 NODE_COLON3
+ NODE_CREF,
NODE_DOT2,
-#define NODE_DOT2 NODE_DOT2
NODE_DOT3,
-#define NODE_DOT3 NODE_DOT3
NODE_FLIP2,
-#define NODE_FLIP2 NODE_FLIP2
NODE_FLIP3,
-#define NODE_FLIP3 NODE_FLIP3
+ NODE_ATTRSET,
NODE_SELF,
-#define NODE_SELF NODE_SELF
NODE_NIL,
-#define NODE_NIL NODE_NIL
NODE_TRUE,
-#define NODE_TRUE NODE_TRUE
NODE_FALSE,
-#define NODE_FALSE NODE_FALSE
- NODE_ERRINFO,
-#define NODE_ERRINFO NODE_ERRINFO
NODE_DEFINED,
-#define NODE_DEFINED NODE_DEFINED
+ NODE_NEWLINE,
NODE_POSTEXE,
-#define NODE_POSTEXE NODE_POSTEXE
NODE_ALLOCA,
-#define NODE_ALLOCA NODE_ALLOCA
+ NODE_DMETHOD,
NODE_BMETHOD,
-#define NODE_BMETHOD NODE_BMETHOD
NODE_MEMO,
-#define NODE_MEMO NODE_MEMO
NODE_IFUNC,
-#define NODE_IFUNC NODE_IFUNC
NODE_DSYM,
-#define NODE_DSYM NODE_DSYM
NODE_ATTRASGN,
-#define NODE_ATTRASGN NODE_ATTRASGN
- NODE_PRELUDE,
-#define NODE_PRELUDE NODE_PRELUDE
- NODE_LAMBDA,
-#define NODE_LAMBDA NODE_LAMBDA
- NODE_OPTBLOCK,
-#define NODE_OPTBLOCK NODE_OPTBLOCK
NODE_LAST
-#define NODE_LAST NODE_LAST
};
typedef struct RNode {
@@ -252,27 +145,24 @@ typedef struct RNode {
struct RNode *node;
ID id;
long state;
- struct rb_global_entry *entry;
+ struct global_entry *entry;
long cnt;
VALUE value;
} u3;
} NODE;
-#define RNODE(obj) (R_CAST(RNode)(obj))
-
-/* 0..4:T_TYPES, 5:FL_MARK, 6:reserved, 7:NODE_FL_NEWLINE */
-#define NODE_FL_NEWLINE (((VALUE)1)<<7)
+extern NODE *ruby_cref;
+extern NODE *ruby_top_cref;
-#define NODE_TYPESHIFT 8
-#define NODE_TYPEMASK (((VALUE)0x7f)<<NODE_TYPESHIFT)
+#define RNODE(obj) (R_CAST(RNode)(obj))
-#define nd_type(n) ((int) (((RNODE(n))->flags & NODE_TYPEMASK)>>NODE_TYPESHIFT))
+#define nd_type(n) ((int)(((RNODE(n))->flags>>FL_USHIFT)&0xff))
#define nd_set_type(n,t) \
- RNODE(n)->flags=((RNODE(n)->flags&~NODE_TYPEMASK)|(((t)<<NODE_TYPESHIFT)&NODE_TYPEMASK))
+ RNODE(n)->flags=((RNODE(n)->flags&~FL_UMASK)|(((t)<<FL_USHIFT)&FL_UMASK))
-#define NODE_LSHIFT (NODE_TYPESHIFT+7)
-#define NODE_LMASK (((SIGNED_VALUE)1<<(sizeof(VALUE)*CHAR_BIT-NODE_LSHIFT))-1)
-#define nd_line(n) (RNODE(n)->flags>>NODE_LSHIFT)
+#define NODE_LSHIFT (FL_USHIFT+8)
+#define NODE_LMASK (((long)1<<(sizeof(NODE*)*CHAR_BIT-NODE_LSHIFT))-1)
+#define nd_line(n) ((unsigned int)(((RNODE(n))->flags>>NODE_LSHIFT)&NODE_LMASK))
#define nd_set_line(n,l) \
RNODE(n)->flags=((RNODE(n)->flags&~(-1<<NODE_LSHIFT))|(((l)&NODE_LMASK)<<NODE_LSHIFT))
@@ -299,11 +189,11 @@ typedef struct RNode {
#define nd_cflag u2.id
#define nd_cval u3.value
-#define nd_oid u1.id
#define nd_cnt u3.cnt
#define nd_tbl u1.tbl
#define nd_var u1.node
+#define nd_ibdy u2.node
#define nd_iter u3.node
#define nd_value u2.node
@@ -311,17 +201,15 @@ typedef struct RNode {
#define nd_lit u1.value
-#define nd_frml u2.argc
-#define nd_rest u1.id
+#define nd_frml u1.node
+#define nd_rest u2.node
#define nd_opt u1.node
-#define nd_pid u1.id
-#define nd_plen u2.argc
#define nd_recv u1.node
#define nd_mid u2.id
#define nd_args u3.node
-#define nd_noex u3.id
+#define nd_noex u1.id
#define nd_defn u3.node
#define nd_cfnc u1.cfunc
@@ -343,15 +231,16 @@ typedef struct RNode {
#define nd_tag u1.id
#define nd_tval u2.value
-#define nd_visi u2.argc
-
#define NEW_NODE(t,a0,a1,a2) rb_node_newnode((t),(VALUE)(a0),(VALUE)(a1),(VALUE)(a2))
-#define NEW_NODE_LONGLIFE(t,a0,a1,a2) rb_node_newnode_longlife((t),(VALUE)(a0),(VALUE)(a1),(VALUE)(a2))
-#define NEW_DEFN(i,a,d,p) NEW_NODE(NODE_DEFN,0,i,NEW_SCOPE(a,d))
-#define NEW_DEFS(r,i,a,d) NEW_NODE(NODE_DEFS,r,i,NEW_SCOPE(a,d))
+#define NEW_METHOD(n,x) NEW_NODE(NODE_METHOD,x,n,0)
+#define NEW_FBODY(n,i,o) NEW_NODE(NODE_FBODY,n,i,o)
+#define NEW_DEFN(i,a,d,p) NEW_NODE(NODE_DEFN,p,i,NEW_RFUNC(a,d))
+#define NEW_DEFS(r,i,a,d) NEW_NODE(NODE_DEFS,r,i,NEW_RFUNC(a,d))
+#define NEW_CFUNC(f,c) NEW_NODE(NODE_CFUNC,f,c,0)
#define NEW_IFUNC(f,c) NEW_NODE(NODE_IFUNC,f,c,0)
-#define NEW_SCOPE(a,b) NEW_NODE(NODE_SCOPE,local_tbl(),b,a)
+#define NEW_RFUNC(b1,b2) NEW_SCOPE(block_append(b1,b2))
+#define NEW_SCOPE(b) NEW_NODE(NODE_SCOPE,local_tbl(),0,(b))
#define NEW_BLOCK(a) NEW_NODE(NODE_BLOCK,a,0,0)
#define NEW_IF(c,t,e) NEW_NODE(NODE_IF,c,t,e)
#define NEW_UNLESS(c,t,e) NEW_IF(c,e,t)
@@ -361,8 +250,7 @@ typedef struct RNode {
#define NEW_WHILE(c,b,n) NEW_NODE(NODE_WHILE,c,b,n)
#define NEW_UNTIL(c,b,n) NEW_NODE(NODE_UNTIL,c,b,n)
#define NEW_FOR(v,i,b) NEW_NODE(NODE_FOR,v,b,i)
-#define NEW_ITER(a,b) NEW_NODE(NODE_ITER,0,NEW_SCOPE(a,b),0)
-#define NEW_LAMBDA(a) NEW_NODE(NODE_LAMBDA,a,0,0)
+#define NEW_ITER(v,i,b) NEW_NODE(NODE_ITER,v,b,i)
#define NEW_BREAK(s) NEW_NODE(NODE_BREAK,s,0,0)
#define NEW_NEXT(s) NEW_NODE(NODE_NEXT,s,0,0)
#define NEW_REDO() NEW_NODE(NODE_REDO,0,0,0)
@@ -377,13 +265,13 @@ typedef struct RNode {
#define NEW_ARRAY(a) NEW_NODE(NODE_ARRAY,a,1,0)
#define NEW_ZARRAY() NEW_NODE(NODE_ZARRAY,0,0,0)
#define NEW_HASH(a) NEW_NODE(NODE_HASH,a,0,0)
+#define NEW_NOT(a) NEW_NODE(NODE_NOT,0,a,0)
#define NEW_MASGN(l,r) NEW_NODE(NODE_MASGN,l,0,r)
#define NEW_GASGN(v,val) NEW_NODE(NODE_GASGN,v,val,rb_global_entry(v))
-#define NEW_LASGN(v,val) NEW_NODE(NODE_LASGN,v,val,0)
+#define NEW_LASGN(v,val) NEW_NODE(NODE_LASGN,v,val,local_cnt(v))
#define NEW_DASGN(v,val) NEW_NODE(NODE_DASGN,v,val,0)
#define NEW_DASGN_CURR(v,val) NEW_NODE(NODE_DASGN_CURR,v,val,0)
#define NEW_IASGN(v,val) NEW_NODE(NODE_IASGN,v,val,0)
-#define NEW_IASGN2(v,val) NEW_NODE(NODE_IASGN2,v,val,0)
#define NEW_CDECL(v,val,path) NEW_NODE(NODE_CDECL,v,val,path)
#define NEW_CVASGN(v,val) NEW_NODE(NODE_CVASGN,v,val,0)
#define NEW_CVDECL(v,val) NEW_NODE(NODE_CVDECL,v,val,0)
@@ -393,13 +281,13 @@ typedef struct RNode {
#define NEW_OP_ASGN_OR(i,val) NEW_NODE(NODE_OP_ASGN_OR,i,val,0)
#define NEW_OP_ASGN_AND(i,val) NEW_NODE(NODE_OP_ASGN_AND,i,val,0)
#define NEW_GVAR(v) NEW_NODE(NODE_GVAR,v,0,rb_global_entry(v))
-#define NEW_LVAR(v) NEW_NODE(NODE_LVAR,v,0,0)
+#define NEW_LVAR(v) NEW_NODE(NODE_LVAR,v,0,local_cnt(v))
#define NEW_DVAR(v) NEW_NODE(NODE_DVAR,v,0,0)
#define NEW_IVAR(v) NEW_NODE(NODE_IVAR,v,0,0)
#define NEW_CONST(v) NEW_NODE(NODE_CONST,v,0,0)
#define NEW_CVAR(v) NEW_NODE(NODE_CVAR,v,0,0)
-#define NEW_NTH_REF(n) NEW_NODE(NODE_NTH_REF,0,n,0)
-#define NEW_BACK_REF(n) NEW_NODE(NODE_BACK_REF,0,n,0)
+#define NEW_NTH_REF(n) NEW_NODE(NODE_NTH_REF,0,n,local_cnt('~'))
+#define NEW_BACK_REF(n) NEW_NODE(NODE_BACK_REF,0,n,local_cnt('~'))
#define NEW_MATCH(c) NEW_NODE(NODE_MATCH,c,0,0)
#define NEW_MATCH2(n1,n2) NEW_NODE(NODE_MATCH2,n1,n2,0)
#define NEW_MATCH3(r,n2) NEW_NODE(NODE_MATCH3,r,n2,0)
@@ -415,69 +303,186 @@ typedef struct RNode {
#define NEW_VCALL(m) NEW_NODE(NODE_VCALL,0,m,0)
#define NEW_SUPER(a) NEW_NODE(NODE_SUPER,0,0,a)
#define NEW_ZSUPER() NEW_NODE(NODE_ZSUPER,0,0,0)
-#define NEW_ARGS(m,o) NEW_NODE(NODE_ARGS,o,m,0)
-#define NEW_ARGS_AUX(r,b) NEW_NODE(NODE_ARGS_AUX,r,b,0)
-#define NEW_OPT_ARG(i,v) NEW_NODE(NODE_OPT_ARG,i,v,0)
-#define NEW_POSTARG(i,v) NEW_NODE(NODE_POSTARG,i,v,0)
+#define NEW_ARGS(f,o,r) NEW_NODE(NODE_ARGS,o,r,f)
#define NEW_ARGSCAT(a,b) NEW_NODE(NODE_ARGSCAT,a,b,0)
#define NEW_ARGSPUSH(a,b) NEW_NODE(NODE_ARGSPUSH,a,b,0)
#define NEW_SPLAT(a) NEW_NODE(NODE_SPLAT,a,0,0)
#define NEW_TO_ARY(a) NEW_NODE(NODE_TO_ARY,a,0,0)
+#define NEW_SVALUE(a) NEW_NODE(NODE_SVALUE,a,0,0)
#define NEW_BLOCK_ARG(v) NEW_NODE(NODE_BLOCK_ARG,v,0,local_cnt(v))
#define NEW_BLOCK_PASS(b) NEW_NODE(NODE_BLOCK_PASS,0,b,0)
#define NEW_ALIAS(n,o) NEW_NODE(NODE_ALIAS,n,o,0)
#define NEW_VALIAS(n,o) NEW_NODE(NODE_VALIAS,n,o,0)
#define NEW_UNDEF(i) NEW_NODE(NODE_UNDEF,0,i,0)
-#define NEW_CLASS(n,b,s) NEW_NODE(NODE_CLASS,n,NEW_SCOPE(0,b),(s))
-#define NEW_SCLASS(r,b) NEW_NODE(NODE_SCLASS,r,NEW_SCOPE(0,b),0)
-#define NEW_MODULE(n,b) NEW_NODE(NODE_MODULE,n,NEW_SCOPE(0,b),0)
+#define NEW_CLASS(n,b,s) NEW_NODE(NODE_CLASS,n,NEW_SCOPE(b),(s))
+#define NEW_SCLASS(r,b) NEW_NODE(NODE_SCLASS,r,NEW_SCOPE(b),0)
+#define NEW_MODULE(n,b) NEW_NODE(NODE_MODULE,n,NEW_SCOPE(b),0)
#define NEW_COLON2(c,i) NEW_NODE(NODE_COLON2,c,i,0)
#define NEW_COLON3(i) NEW_NODE(NODE_COLON3,0,i,0)
+#define NEW_CREF(c,n) NEW_NODE(NODE_CREF,c,0,n)
#define NEW_DOT2(b,e) NEW_NODE(NODE_DOT2,b,e,0)
#define NEW_DOT3(b,e) NEW_NODE(NODE_DOT3,b,e,0)
+#define NEW_ATTRSET(a) NEW_NODE(NODE_ATTRSET,a,0,0)
#define NEW_SELF() NEW_NODE(NODE_SELF,0,0,0)
#define NEW_NIL() NEW_NODE(NODE_NIL,0,0,0)
#define NEW_TRUE() NEW_NODE(NODE_TRUE,0,0,0)
#define NEW_FALSE() NEW_NODE(NODE_FALSE,0,0,0)
-#define NEW_ERRINFO() NEW_NODE(NODE_ERRINFO,0,0,0)
#define NEW_DEFINED(e) NEW_NODE(NODE_DEFINED,e,0,0)
+#define NEW_NEWLINE(n) NEW_NODE(NODE_NEWLINE,0,0,n)
#define NEW_PREEXE(b) NEW_SCOPE(b)
-#define NEW_POSTEXE(b) NEW_NODE(NODE_POSTEXE,0,b,0)
+#define NEW_POSTEXE() NEW_NODE(NODE_POSTEXE,0,0,0)
+#define NEW_DMETHOD(b) NEW_NODE(NODE_DMETHOD,0,0,b)
#define NEW_BMETHOD(b) NEW_NODE(NODE_BMETHOD,0,0,b)
#define NEW_ATTRASGN(r,m,a) NEW_NODE(NODE_ATTRASGN,r,m,a)
-#define NEW_PRELUDE(p,b) NEW_NODE(NODE_PRELUDE,p,b,0)
-#define NEW_OPTBLOCK(a) NEW_NODE(NODE_OPTBLOCK,a,0,0)
-VALUE rb_parser_new(void);
-VALUE rb_parser_end_seen_p(VALUE);
-VALUE rb_parser_encoding(VALUE);
+#define NOEX_PUBLIC 0
+#define NOEX_NOSUPER 1
+#define NOEX_PRIVATE 2
+#define NOEX_PROTECTED 4
+#define NOEX_MASK 6
+
+#define NOEX_UNDEF NOEX_NOSUPER
+
+NODE *rb_compile_cstr _((const char*, const char*, int, int));
+NODE *rb_compile_string _((const char*, VALUE, int));
+NODE *rb_compile_file _((const char*, VALUE, int));
+
+void rb_add_method _((VALUE, ID, NODE *, int));
+NODE *rb_node_newnode _((enum node_type,VALUE,VALUE,VALUE));
+
+NODE* rb_method_node _((VALUE klass, ID id));
+
+struct global_entry *rb_global_entry _((ID));
+VALUE rb_gvar_get _((struct global_entry *));
+VALUE rb_gvar_set _((struct global_entry *, VALUE));
+VALUE rb_gvar_defined _((struct global_entry *));
+
+typedef unsigned int rb_event_t;
+
+#define RUBY_EVENT_NONE 0x00
+#define RUBY_EVENT_LINE 0x01
+#define RUBY_EVENT_CLASS 0x02
+#define RUBY_EVENT_END 0x04
+#define RUBY_EVENT_CALL 0x08
+#define RUBY_EVENT_RETURN 0x10
+#define RUBY_EVENT_C_CALL 0x20
+#define RUBY_EVENT_C_RETURN 0x40
+#define RUBY_EVENT_RAISE 0x80
+#define RUBY_EVENT_ALL 0xff
+
+typedef void (*rb_event_hook_func_t) _((rb_event_t,NODE*,VALUE,ID,VALUE));
+NODE *rb_copy_node_scope _((NODE *, NODE *));
+void rb_add_event_hook _((rb_event_hook_func_t,rb_event_t));
+int rb_remove_event_hook _((rb_event_hook_func_t));
+
+#if defined(HAVE_GETCONTEXT) && defined(HAVE_SETCONTEXT)
+#include <ucontext.h>
+#define USE_CONTEXT
+#endif
+#include <setjmp.h>
+#include "st.h"
+
+#ifdef USE_CONTEXT
+typedef struct {
+ ucontext_t context;
+ volatile int status;
+} rb_jmpbuf_t[1];
+#else
+typedef RUBY_JMP_BUF rb_jmpbuf_t;
+#endif
+
+enum rb_thread_status {
+ THREAD_TO_KILL,
+ THREAD_RUNNABLE,
+ THREAD_STOPPED,
+ THREAD_KILLED,
+};
+
+typedef struct rb_thread *rb_thread_t;
+
+struct rb_thread {
+ rb_thread_t next, prev;
+ rb_jmpbuf_t context;
+#if (defined _WIN32 && !defined _WIN32_WCE) || defined __CYGWIN__
+ unsigned long win32_exception_list;
+#endif
+
+ VALUE result;
+
+ size_t stk_len;
+ size_t stk_max;
+ VALUE *stk_ptr;
+ VALUE *stk_pos;
+#ifdef __ia64
+ size_t bstr_len;
+ size_t bstr_max;
+ VALUE *bstr_ptr;
+ VALUE *bstr_pos;
+#endif
+
+ struct FRAME *frame;
+ struct SCOPE *scope;
+ struct RVarmap *dyna_vars;
+ struct BLOCK *block;
+ struct iter *iter;
+ struct tag *tag;
+ VALUE klass;
+ VALUE wrapper;
+ NODE *cref;
+
+ int flags; /* misc. states (vmode/rb_trap_immediate/raised) */
+
+ NODE *node;
+
+ int tracing;
+ VALUE errinfo;
+ VALUE last_status;
+ VALUE last_line;
+ VALUE last_match;
-NODE *rb_parser_compile_cstr(volatile VALUE, const char*, const char*, int, int);
-NODE *rb_parser_compile_string(volatile VALUE, const char*, VALUE, int);
-NODE *rb_parser_compile_file(volatile VALUE, const char*, VALUE, int);
+ int safe;
-NODE *rb_compile_cstr(const char*, const char*, int, int);
-NODE *rb_compile_string(const char*, VALUE, int);
-NODE *rb_compile_file(const char*, VALUE, int);
+ enum rb_thread_status status;
+ int wait_for;
+ int fd;
+ fd_set readfds;
+ fd_set writefds;
+ fd_set exceptfds;
+ int select_value;
+ double delay;
+ rb_thread_t join;
-NODE *rb_node_newnode(enum node_type,VALUE,VALUE,VALUE);
-NODE *rb_node_newnode_longlife(enum node_type,VALUE,VALUE,VALUE);
+ int abort;
+ int priority;
+ VALUE thgroup;
-struct rb_global_entry {
- struct rb_global_variable *var;
- ID id;
+ struct st_table *locals;
+
+ VALUE thread;
+
+ VALUE sandbox;
};
-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 *);
+extern VALUE (*ruby_sandbox_save)_((rb_thread_t));
+extern VALUE (*ruby_sandbox_restore)_((rb_thread_t));
+extern rb_thread_t rb_curr_thread;
+extern rb_thread_t rb_main_thread;
+
+enum {
+ RAISED_EXCEPTION = 0x1000,
+ RAISED_STACKOVERFLOW = 0x2000,
+ RAISED_NOMEMORY = 0x4000,
+ RAISED_MASK = 0xf000
+};
+int rb_thread_set_raised(rb_thread_t th);
+int rb_thread_reset_raised(rb_thread_t th);
+#define rb_thread_raised_set(th, f) ((th)->flags |= (f))
+#define rb_thread_raised_reset(th, f) ((th)->flags &= ~(f))
+#define rb_thread_raised_p(th, f) (((th)->flags & (f)) != 0)
+#define rb_thread_raised_clear(th) (rb_thread_raised_reset(th, RAISED_MASK))
#if defined(__cplusplus)
-#if 0
-{ /* satisfy cc-mode */
-#endif
} /* extern "C" { */
#endif
-#endif /* RUBY_NODE_H */
+#endif
diff --git a/numeric.c b/numeric.c
index 53da949609..de00de20d9 100644
--- a/numeric.c
+++ b/numeric.c
@@ -3,15 +3,15 @@
numeric.c -
$Author$
+ $Date$
created at: Fri Aug 13 18:33:09 JST 1993
- Copyright (C) 1993-2007 Yukihiro Matsumoto
+ Copyright (C) 1993-2003 Yukihiro Matsumoto
**********************************************************************/
-#include "ruby/ruby.h"
-#include "ruby/encoding.h"
-#include "ruby/util.h"
+#include "ruby.h"
+#include "env.h"
#include <ctype.h>
#include <math.h>
#include <stdio.h>
@@ -65,7 +65,8 @@
#ifndef HAVE_ROUND
double
-round(double x)
+round(x)
+ double x;
{
double f;
@@ -79,9 +80,6 @@ round(double x)
}
return x;
}
-#elif defined(__BEOS__)
-/* appears to be a bug in the BeOS headers */
-double round(double x);
#endif
static ID id_coerce, id_to_i, id_eq;
@@ -95,7 +93,7 @@ VALUE rb_eZeroDivError;
VALUE rb_eFloatDomainError;
void
-rb_num_zerodiv(void)
+rb_num_zerodiv()
{
rb_raise(rb_eZeroDivError, "divided by 0");
}
@@ -103,7 +101,7 @@ rb_num_zerodiv(void)
/*
* call-seq:
- * num.coerce(numeric) -> array
+ * num.coerce(numeric) => array
*
* If <i>aNumeric</i> is the same type as <i>num</i>, returns an array
* containing <i>aNumeric</i> and <i>num</i>. Otherwise, returns an
@@ -118,7 +116,8 @@ rb_num_zerodiv(void)
*/
static VALUE
-num_coerce(VALUE x, VALUE y)
+num_coerce(x, y)
+ VALUE x, y;
{
if (CLASS_OF(x) == CLASS_OF(y))
return rb_assoc_new(y, x);
@@ -128,26 +127,30 @@ num_coerce(VALUE x, VALUE y)
}
static VALUE
-coerce_body(VALUE *x)
+coerce_body(x)
+ VALUE *x;
{
return rb_funcall(x[1], id_coerce, 1, x[0]);
}
static VALUE
-coerce_rescue(VALUE *x)
+coerce_rescue(x)
+ VALUE *x;
{
volatile VALUE v = rb_inspect(x[1]);
rb_raise(rb_eTypeError, "%s can't be coerced into %s",
rb_special_const_p(x[1])?
- RSTRING_PTR(v):
+ RSTRING(v)->ptr:
rb_obj_classname(x[1]),
rb_obj_classname(x[0]));
return Qnil; /* dummy */
}
static int
-do_coerce(VALUE *x, VALUE *y, int err)
+do_coerce(x, y, err)
+ VALUE *x, *y;
+ int err;
{
VALUE ary;
VALUE a[2];
@@ -155,40 +158,43 @@ do_coerce(VALUE *x, VALUE *y, int err)
a[0] = *x; a[1] = *y;
ary = rb_rescue(coerce_body, (VALUE)a, err?coerce_rescue:0, (VALUE)a);
- if (TYPE(ary) != T_ARRAY || RARRAY_LEN(ary) != 2) {
+ if (TYPE(ary) != T_ARRAY || RARRAY(ary)->len != 2) {
if (err) {
rb_raise(rb_eTypeError, "coerce must return [x, y]");
}
return Qfalse;
}
- *x = RARRAY_PTR(ary)[0];
- *y = RARRAY_PTR(ary)[1];
+ *x = RARRAY(ary)->ptr[0];
+ *y = RARRAY(ary)->ptr[1];
return Qtrue;
}
VALUE
-rb_num_coerce_bin(VALUE x, VALUE y, ID func)
+rb_num_coerce_bin(x, y)
+ VALUE x, y;
{
do_coerce(&x, &y, Qtrue);
- return rb_funcall(x, func, 1, y);
+ return rb_funcall(x, ruby_frame->orig_func, 1, y);
}
VALUE
-rb_num_coerce_cmp(VALUE x, VALUE y, ID func)
+rb_num_coerce_cmp(x, y)
+ VALUE x, y;
{
if (do_coerce(&x, &y, Qfalse))
- return rb_funcall(x, func, 1, y);
+ return rb_funcall(x, ruby_frame->orig_func, 1, y);
return Qnil;
}
VALUE
-rb_num_coerce_relop(VALUE x, VALUE y, ID func)
+rb_num_coerce_relop(x, y)
+ VALUE x, y;
{
VALUE c, x0 = x, y0 = y;
if (!do_coerce(&x, &y, Qfalse) ||
- NIL_P(c = rb_funcall(x, func, 1, y))) {
+ NIL_P(c = rb_funcall(x, ruby_frame->orig_func, 1, y))) {
rb_cmperr(x0, y0);
return Qnil; /* not reached */
}
@@ -201,22 +207,22 @@ rb_num_coerce_relop(VALUE x, VALUE y, ID func)
*/
static VALUE
-num_sadded(VALUE x, VALUE name)
+num_sadded(x, name)
+ VALUE x, name;
{
- const char *nstr = rb_id2name(rb_to_id(name));
- /* ruby_frame = ruby_frame->prev; */ /* pop frame for "singleton_method_added" */
+ ruby_frame = ruby_frame->prev; /* pop frame for "singleton_method_added" */
/* Numerics should be values; singleton_methods should not be added to them */
- rb_remove_method(rb_singleton_class(x), nstr);
rb_raise(rb_eTypeError,
"can't define singleton method \"%s\" for %s",
- nstr,
+ rb_id2name(rb_to_id(name)),
rb_obj_classname(x));
return Qnil; /* not reached */
}
/* :nodoc: */
static VALUE
-num_init_copy(VALUE x, VALUE y)
+num_init_copy(x, y)
+ VALUE x, y;
{
/* Numerics are immutable values, which should not be copied */
rb_raise(rb_eTypeError, "can't copy %s", rb_obj_classname(x));
@@ -225,26 +231,28 @@ num_init_copy(VALUE x, VALUE y)
/*
* call-seq:
- * +num -> num
+ * +num => num
*
* Unary Plus---Returns the receiver's value.
*/
static VALUE
-num_uplus(VALUE num)
+num_uplus(num)
+ VALUE num;
{
return num;
}
/*
* call-seq:
- * -num -> numeric
+ * -num => numeric
*
* Unary Minus---Returns the receiver's value, negated.
*/
static VALUE
-num_uminus(VALUE num)
+num_uminus(num)
+ VALUE num;
{
VALUE zero;
@@ -256,108 +264,50 @@ num_uminus(VALUE num)
/*
* call-seq:
- * num.quo(numeric) -> real
+ * num.quo(numeric) => result
+ * num.fdiv(numeric) => result
*
- * Returns most exact division (rational for integers, float for floats).
+ * Equivalent to <code>Numeric#/</code>, but overridden in subclasses.
*/
static VALUE
-num_quo(VALUE x, VALUE y)
+num_quo(x, y)
+ VALUE x, y;
{
- return rb_funcall(rb_rational_raw1(x), '/', 1, y);
+ return rb_funcall(x, '/', 1, y);
}
-/*
- * call-seq:
- * num.fdiv(numeric) -> float
- *
- * Returns float division.
- */
-
-static VALUE
-num_fdiv(VALUE x, VALUE y)
-{
- return rb_funcall(rb_Float(x), '/', 1, y);
-}
-
+static VALUE num_floor(VALUE num);
/*
* call-seq:
- * num.div(numeric) -> integer
+ * num.div(numeric) => integer
*
* Uses <code>/</code> to perform division, then converts the result to
- * an integer. <code>numeric</code> does not define the <code>/</code>
+ * an integer. <code>Numeric</code> does not define the <code>/</code>
* operator; this is left to subclasses.
- *
- * Equivalent to
- * <i>num</i>.<code>divmod(</code><i>aNumeric</i><code>)[0]</code>.
- *
- * See <code>Numeric#divmod</code>.
- */
-
-static VALUE
-num_div(VALUE x, VALUE y)
-{
- if (rb_equal(INT2FIX(0), y)) rb_num_zerodiv();
- return rb_funcall(rb_funcall(x, '/', 1, y), rb_intern("floor"), 0);
-}
-
-
-/*
- * call-seq:
- * num.modulo(numeric) -> real
- *
- * x.modulo(y) means x-y*(x/y).floor
- *
- * Equivalent to
- * <i>num</i>.<code>divmod(</code><i>aNumeric</i><code>)[1]</code>.
- *
- * See <code>Numeric#divmod</code>.
*/
static VALUE
-num_modulo(VALUE x, VALUE y)
+num_div(x, y)
+ VALUE x, y;
{
- return rb_funcall(x, '-', 1,
- rb_funcall(y, '*', 1,
- rb_funcall(x, rb_intern("div"), 1, y)));
+ return num_floor(rb_funcall(x, '/', 1, y));
}
-/*
- * call-seq:
- * num.remainder(numeric) -> real
- *
- * x.remainder(y) means x-y*(x/y).truncate
- *
- * See <code>Numeric#divmod</code>.
- */
-static VALUE
-num_remainder(VALUE x, VALUE y)
-{
- VALUE z = rb_funcall(x, '%', 1, y);
-
- if ((!rb_equal(z, INT2FIX(0))) &&
- ((RTEST(rb_funcall(x, '<', 1, INT2FIX(0))) &&
- RTEST(rb_funcall(y, '>', 1, INT2FIX(0)))) ||
- (RTEST(rb_funcall(x, '>', 1, INT2FIX(0))) &&
- RTEST(rb_funcall(y, '<', 1, INT2FIX(0)))))) {
- return rb_funcall(z, '-', 1, y);
- }
- return z;
-}
/*
* call-seq:
- * num.divmod(numeric) -> array
+ * num.divmod( aNumeric ) -> anArray
*
* Returns an array containing the quotient and modulus obtained by
- * dividing <i>num</i> by <i>numeric</i>. If <code>q, r =
+ * dividing <i>num</i> by <i>aNumeric</i>. If <code>q, r =
* x.divmod(y)</code>, then
*
- * q = floor(x/y)
- * x = q*y+r
+ * q = floor(float(x)/float(y))
+ * x = q*y + r
*
* The quotient is rounded toward -infinity, as shown in the following table:
*
@@ -377,11 +327,10 @@ num_remainder(VALUE x, VALUE y)
* ------+-----+---------------+---------+-------------+---------------
* -11.5 | 4 | -3, 0.5 | -2.875 | 0.5 | -3.5
* ------+-----+---------------+---------+-------------+---------------
- * -11.5 | -4 | 2, -3.5 | 2.875 | -3.5 | -3.5
+ * -11.5 | -4 | 2 -3.5 | 2.875 | -3.5 | -3.5
*
*
* Examples
- *
* 11.divmod(3) #=> [3, 2]
* 11.divmod(-3) #=> [-4, -1]
* 11.divmod(3.5) #=> [3, 0.5]
@@ -390,43 +339,73 @@ num_remainder(VALUE x, VALUE y)
*/
static VALUE
-num_divmod(VALUE x, VALUE y)
+num_divmod(x, y)
+ VALUE x, y;
{
- return rb_assoc_new(num_div(x, y), num_modulo(x, y));
+ return rb_assoc_new(num_div(x, y), rb_funcall(x, '%', 1, y));
}
/*
* call-seq:
- * num.real? -> true or false
+ * num.modulo(numeric) => result
*
- * Returns <code>true</code> if <i>num</i> is a <code>Real</code>
- * (i.e. non <code>Complex</code>).
+ * Equivalent to
+ * <i>num</i>.<code>divmod(</code><i>aNumeric</i><code>)[1]</code>.
*/
static VALUE
-num_real_p(VALUE num)
+num_modulo(x, y)
+ VALUE x, y;
{
- return Qtrue;
+ return rb_funcall(x, '%', 1, y);
}
/*
* call-seq:
- * num.integer? -> true or false
+ * num.remainder(numeric) => result
+ *
+ * If <i>num</i> and <i>numeric</i> have different signs, returns
+ * <em>mod</em>-<i>numeric</i>; otherwise, returns <em>mod</em>. In
+ * both cases <em>mod</em> is the value
+ * <i>num</i>.<code>modulo(</code><i>numeric</i><code>)</code>. The
+ * differences between <code>remainder</code> and modulo
+ * (<code>%</code>) are shown in the table under <code>Numeric#divmod</code>.
+ */
+
+static VALUE
+num_remainder(x, y)
+ VALUE x, y;
+{
+ VALUE z = rb_funcall(x, '%', 1, y);
+
+ if ((!rb_equal(z, INT2FIX(0))) &&
+ ((RTEST(rb_funcall(x, '<', 1, INT2FIX(0))) &&
+ RTEST(rb_funcall(y, '>', 1, INT2FIX(0)))) ||
+ (RTEST(rb_funcall(x, '>', 1, INT2FIX(0))) &&
+ RTEST(rb_funcall(y, '<', 1, INT2FIX(0)))))) {
+ return rb_funcall(z, '-', 1, y);
+ }
+ return z;
+}
+
+/*
+ * call-seq:
+ * num.integer? -> true or false
*
* Returns <code>true</code> if <i>num</i> is an <code>Integer</code>
* (including <code>Fixnum</code> and <code>Bignum</code>).
*/
static VALUE
-num_int_p(VALUE num)
+num_int_p(num)
+ VALUE num;
{
return Qfalse;
}
/*
* call-seq:
- * num.abs -> numeric
- * num.magnitude -> numeric
+ * num.abs => num or numeric
*
* Returns the absolute value of <i>num</i>.
*
@@ -436,7 +415,8 @@ num_int_p(VALUE num)
*/
static VALUE
-num_abs(VALUE num)
+num_abs(num)
+ VALUE num;
{
if (RTEST(rb_funcall(num, '<', 1, INT2FIX(0)))) {
return rb_funcall(num, rb_intern("-@"), 0);
@@ -447,13 +427,14 @@ num_abs(VALUE num)
/*
* call-seq:
- * num.zero? -> true or false
+ * num.zero? => true or false
*
* Returns <code>true</code> if <i>num</i> has a zero value.
*/
static VALUE
-num_zero_p(VALUE num)
+num_zero_p(num)
+ VALUE num;
{
if (rb_equal(num, INT2FIX(0))) {
return Qtrue;
@@ -464,9 +445,9 @@ num_zero_p(VALUE num)
/*
* call-seq:
- * num.nonzero? -> self or nil
+ * num.nonzero? => num or nil
*
- * Returns <i>self</i> if <i>num</i> is not zero, <code>nil</code>
+ * Returns <i>num</i> if <i>num</i> is not zero, <code>nil</code>
* otherwise. This behavior is useful when chaining comparisons:
*
* a = %w( z Bb bB bb BB a aA Aa AA A )
@@ -475,7 +456,8 @@ num_zero_p(VALUE num)
*/
static VALUE
-num_nonzero_p(VALUE num)
+num_nonzero_p(num)
+ VALUE num;
{
if (RTEST(rb_funcall(num, rb_intern("zero?"), 0, 0))) {
return Qnil;
@@ -485,14 +467,15 @@ num_nonzero_p(VALUE num)
/*
* call-seq:
- * num.to_int -> integer
+ * num.to_int => integer
*
* Invokes the child class's <code>to_i</code> method to convert
* <i>num</i> to an integer.
*/
static VALUE
-num_to_int(VALUE num)
+num_to_int(num)
+ VALUE num;
{
return rb_funcall(num, id_to_i, 0, 0);
}
@@ -502,24 +485,24 @@ num_to_int(VALUE num)
*
* Document-class: Float
*
- * <code>Float</code> objects represent inexact real numbers using
- * the native architecture's double-precision floating point
- * representation.
+ * <code>Float</code> objects represent real numbers using the native
+ * architecture's double-precision floating point representation.
*/
VALUE
-rb_float_new(double d)
+rb_float_new(d)
+ double d;
{
NEWOBJ(flt, struct RFloat);
OBJSETUP(flt, rb_cFloat, T_FLOAT);
- flt->float_value = d;
+ flt->value = d;
return (VALUE)flt;
}
/*
* call-seq:
- * flt.to_s -> string
+ * flt.to_s => string
*
* Returns a string containing a representation of self. As well as a
* fixed or exponential form of the number, the call may return
@@ -528,28 +511,24 @@ rb_float_new(double d)
*/
static VALUE
-flo_to_s(VALUE flt)
+flo_to_s(flt)
+ VALUE flt;
{
- enum {decimal_mant = DBL_MANT_DIG-DBL_DIG};
- enum {float_dig = DBL_DIG+1};
- char buf[float_dig + (decimal_mant + CHAR_BIT - 1) / CHAR_BIT + 10];
- double value = RFLOAT_VALUE(flt);
+ char buf[32];
+ double value = RFLOAT(flt)->value;
char *p, *e;
if (isinf(value))
- return rb_usascii_str_new2(value < 0 ? "-Infinity" : "Infinity");
+ return rb_str_new2(value < 0 ? "-Infinity" : "Infinity");
else if(isnan(value))
- return rb_usascii_str_new2("NaN");
-
-# define FLOFMT(buf, size, fmt, prec, val) snprintf(buf, size, fmt, prec, val), \
- (void)((atof(buf) == val) || snprintf(buf, size, fmt, (prec)+1, val))
+ return rb_str_new2("NaN");
- FLOFMT(buf, sizeof(buf), "%#.*g", float_dig, value); /* ensure to print decimal point */
+ sprintf(buf, "%#.15g", value); /* ensure to print decimal point */
if (!(e = strchr(buf, 'e'))) {
e = buf + strlen(buf);
}
if (!ISDIGIT(e[-1])) { /* reformat if ended with decimal point (ex 111111111111111.) */
- FLOFMT(buf, sizeof(buf), "%#.*e", float_dig - 1, value);
+ sprintf(buf, "%#.14e", value);
if (!(e = strchr(buf, 'e'))) {
e = buf + strlen(buf);
}
@@ -558,7 +537,7 @@ flo_to_s(VALUE flt)
while (p[-1]=='0' && ISDIGIT(p[-2]))
p--;
memmove(p, e, strlen(e)+1);
- return rb_usascii_str_new2(buf);
+ return rb_str_new2(buf);
}
/*
@@ -566,103 +545,109 @@ flo_to_s(VALUE flt)
*/
static VALUE
-flo_coerce(VALUE x, VALUE y)
+flo_coerce(x, y)
+ VALUE x, y;
{
return rb_assoc_new(rb_Float(y), x);
}
/*
* call-seq:
- * -float -> float
+ * -float => float
*
* Returns float, negated.
*/
static VALUE
-flo_uminus(VALUE flt)
+flo_uminus(flt)
+ VALUE flt;
{
- return DBL2NUM(-RFLOAT_VALUE(flt));
+ return rb_float_new(-RFLOAT(flt)->value);
}
/*
* call-seq:
- * float + other -> float
+ * float + other => float
*
* Returns a new float which is the sum of <code>float</code>
* and <code>other</code>.
*/
static VALUE
-flo_plus(VALUE x, VALUE y)
+flo_plus(x, y)
+ VALUE x, y;
{
switch (TYPE(y)) {
case T_FIXNUM:
- return DBL2NUM(RFLOAT_VALUE(x) + (double)FIX2LONG(y));
+ return rb_float_new(RFLOAT(x)->value + (double)FIX2LONG(y));
case T_BIGNUM:
- return DBL2NUM(RFLOAT_VALUE(x) + rb_big2dbl(y));
+ return rb_float_new(RFLOAT(x)->value + rb_big2dbl(y));
case T_FLOAT:
- return DBL2NUM(RFLOAT_VALUE(x) + RFLOAT_VALUE(y));
+ return rb_float_new(RFLOAT(x)->value + RFLOAT(y)->value);
default:
- return rb_num_coerce_bin(x, y, '+');
+ return rb_num_coerce_bin(x, y);
}
}
/*
* call-seq:
- * float + other -> float
+ * float + other => float
*
* Returns a new float which is the difference of <code>float</code>
* and <code>other</code>.
*/
static VALUE
-flo_minus(VALUE x, VALUE y)
+flo_minus(x, y)
+ VALUE x, y;
{
switch (TYPE(y)) {
case T_FIXNUM:
- return DBL2NUM(RFLOAT_VALUE(x) - (double)FIX2LONG(y));
+ return rb_float_new(RFLOAT(x)->value - (double)FIX2LONG(y));
case T_BIGNUM:
- return DBL2NUM(RFLOAT_VALUE(x) - rb_big2dbl(y));
+ return rb_float_new(RFLOAT(x)->value - rb_big2dbl(y));
case T_FLOAT:
- return DBL2NUM(RFLOAT_VALUE(x) - RFLOAT_VALUE(y));
+ return rb_float_new(RFLOAT(x)->value - RFLOAT(y)->value);
default:
- return rb_num_coerce_bin(x, y, '-');
+ return rb_num_coerce_bin(x, y);
}
}
/*
* call-seq:
- * float * other -> float
+ * float * other => float
*
* Returns a new float which is the product of <code>float</code>
* and <code>other</code>.
*/
static VALUE
-flo_mul(VALUE x, VALUE y)
+flo_mul(x, y)
+ VALUE x, y;
{
switch (TYPE(y)) {
case T_FIXNUM:
- return DBL2NUM(RFLOAT_VALUE(x) * (double)FIX2LONG(y));
+ return rb_float_new(RFLOAT(x)->value * (double)FIX2LONG(y));
case T_BIGNUM:
- return DBL2NUM(RFLOAT_VALUE(x) * rb_big2dbl(y));
+ return rb_float_new(RFLOAT(x)->value * rb_big2dbl(y));
case T_FLOAT:
- return DBL2NUM(RFLOAT_VALUE(x) * RFLOAT_VALUE(y));
+ return rb_float_new(RFLOAT(x)->value * RFLOAT(y)->value);
default:
- return rb_num_coerce_bin(x, y, '*');
+ return rb_num_coerce_bin(x, y);
}
}
/*
* call-seq:
- * float / other -> float
+ * float / other => float
*
* Returns a new float which is the result of dividing
* <code>float</code> by <code>other</code>.
*/
static VALUE
-flo_div(VALUE x, VALUE y)
+flo_div(x, y)
+ VALUE x, y;
{
long f_y;
double d;
@@ -670,29 +655,25 @@ flo_div(VALUE x, VALUE y)
switch (TYPE(y)) {
case T_FIXNUM:
f_y = FIX2LONG(y);
- return DBL2NUM(RFLOAT_VALUE(x) / (double)f_y);
+ return rb_float_new(RFLOAT(x)->value / (double)f_y);
case T_BIGNUM:
d = rb_big2dbl(y);
- return DBL2NUM(RFLOAT_VALUE(x) / d);
+ return rb_float_new(RFLOAT(x)->value / d);
case T_FLOAT:
- return DBL2NUM(RFLOAT_VALUE(x) / RFLOAT_VALUE(y));
+ return rb_float_new(RFLOAT(x)->value / RFLOAT(y)->value);
default:
- return rb_num_coerce_bin(x, y, '/');
+ return rb_num_coerce_bin(x, y);
}
}
-static VALUE
-flo_quo(VALUE x, VALUE y)
-{
- return rb_funcall(x, '/', 1, y);
-}
static void
-flodivmod(double x, double y, double *divp, double *modp)
+flodivmod(x, y, divp, modp)
+ double x, y;
+ double *divp, *modp;
{
double div, mod;
- if (y == 0.0) rb_num_zerodiv();
#ifdef HAVE_FMOD
mod = fmod(x, y);
#else
@@ -718,8 +699,8 @@ flodivmod(double x, double y, double *divp, double *modp)
/*
* call-seq:
- * flt % other -> float
- * flt.modulo(other) -> float
+ * flt % other => float
+ * flt.modulo(other) => float
*
* Return the modulo after division of <code>flt</code> by <code>other</code>.
*
@@ -728,7 +709,8 @@ flodivmod(double x, double y, double *divp, double *modp)
*/
static VALUE
-flo_mod(VALUE x, VALUE y)
+flo_mod(x, y)
+ VALUE x, y;
{
double fy, mod;
@@ -740,36 +722,27 @@ flo_mod(VALUE x, VALUE y)
fy = rb_big2dbl(y);
break;
case T_FLOAT:
- fy = RFLOAT_VALUE(y);
+ fy = RFLOAT(y)->value;
break;
default:
- return rb_num_coerce_bin(x, y, '%');
- }
- flodivmod(RFLOAT_VALUE(x), fy, 0, &mod);
- return DBL2NUM(mod);
-}
-
-static VALUE
-dbl2ival(double d)
-{
- if (FIXABLE(d)) {
- d = round(d);
- return LONG2FIX((long)d);
+ return rb_num_coerce_bin(x, y);
}
- return rb_dbl2big(d);
+ flodivmod(RFLOAT(x)->value, fy, 0, &mod);
+ return rb_float_new(mod);
}
/*
* call-seq:
- * flt.divmod(numeric) -> array
+ * flt.divmod(numeric) => array
*
* See <code>Numeric#divmod</code>.
*/
static VALUE
-flo_divmod(VALUE x, VALUE y)
+flo_divmod(x, y)
+ VALUE x, y;
{
- double fy, div, mod;
+ double fy, div, mod, val;
volatile VALUE a, b;
switch (TYPE(y)) {
@@ -780,46 +753,50 @@ flo_divmod(VALUE x, VALUE y)
fy = rb_big2dbl(y);
break;
case T_FLOAT:
- fy = RFLOAT_VALUE(y);
+ fy = RFLOAT(y)->value;
break;
default:
- return rb_num_coerce_bin(x, y, rb_intern("divmod"));
+ return rb_num_coerce_bin(x, y);
+ }
+ flodivmod(RFLOAT(x)->value, fy, &div, &mod);
+ if (FIXABLE(div)) {
+ val = round(div);
+ a = LONG2FIX(val);
}
- flodivmod(RFLOAT_VALUE(x), fy, &div, &mod);
- a = dbl2ival(div);
- b = DBL2NUM(mod);
+ else {
+ a = rb_dbl2big(div);
+ }
+ b = rb_float_new(mod);
return rb_assoc_new(a, b);
}
/*
* call-seq:
*
- * flt ** other -> float
+ * flt ** other => float
*
* Raises <code>float</code> the <code>other</code> power.
- *
- * 2.0**3 #=> 8.0
- * (-8.0)**0.5 #=> NaN # try (-8.0)**Complex(0.5)
*/
static VALUE
-flo_pow(VALUE x, VALUE y)
+flo_pow(x, y)
+ VALUE x, y;
{
switch (TYPE(y)) {
case T_FIXNUM:
- return DBL2NUM(pow(RFLOAT_VALUE(x), (double)FIX2LONG(y)));
+ return rb_float_new(pow(RFLOAT(x)->value, (double)FIX2LONG(y)));
case T_BIGNUM:
- return DBL2NUM(pow(RFLOAT_VALUE(x), rb_big2dbl(y)));
+ return rb_float_new(pow(RFLOAT(x)->value, rb_big2dbl(y)));
case T_FLOAT:
- return DBL2NUM(pow(RFLOAT_VALUE(x), RFLOAT_VALUE(y)));
+ return rb_float_new(pow(RFLOAT(x)->value, RFLOAT(y)->value));
default:
- return rb_num_coerce_bin(x, y, rb_intern("**"));
+ return rb_num_coerce_bin(x, y);
}
}
/*
* call-seq:
- * num.eql?(numeric) -> true or false
+ * num.eql?(numeric) => true or false
*
* Returns <code>true</code> if <i>num</i> and <i>numeric</i> are the
* same type and have equal values.
@@ -830,7 +807,8 @@ flo_pow(VALUE x, VALUE y)
*/
static VALUE
-num_eql(VALUE x, VALUE y)
+num_eql(x, y)
+ VALUE x, y;
{
if (TYPE(x) != TYPE(y)) return Qfalse;
@@ -839,21 +817,23 @@ num_eql(VALUE x, VALUE y)
/*
* call-seq:
- * num <=> other -> 0 or nil
+ * num <=> other -> 0 or nil
*
* Returns zero if <i>num</i> equals <i>other</i>, <code>nil</code>
* otherwise.
*/
static VALUE
-num_cmp(VALUE x, VALUE y)
+num_cmp(x, y)
+ VALUE x, y;
{
if (x == y) return INT2FIX(0);
return Qnil;
}
static VALUE
-num_equal(VALUE x, VALUE y)
+num_equal(x, y)
+ VALUE x, y;
{
if (x == y) return Qtrue;
return rb_funcall(y, id_eq, 1, x);
@@ -861,7 +841,7 @@ num_equal(VALUE x, VALUE y)
/*
* call-seq:
- * flt == obj -> true or false
+ * flt == obj => true or false
*
* Returns <code>true</code> only if <i>obj</i> has the same value
* as <i>flt</i>. Contrast this with <code>Float#eql?</code>, which
@@ -872,7 +852,8 @@ num_equal(VALUE x, VALUE y)
*/
static VALUE
-flo_eq(VALUE x, VALUE y)
+flo_eq(x, y)
+ VALUE x, y;
{
volatile double a, b;
@@ -884,41 +865,45 @@ flo_eq(VALUE x, VALUE y)
b = rb_big2dbl(y);
break;
case T_FLOAT:
- b = RFLOAT_VALUE(y);
-#if defined(_MSC_VER) && _MSC_VER < 1300
+ b = RFLOAT(y)->value;
if (isnan(b)) return Qfalse;
-#endif
break;
default:
return num_equal(x, y);
}
- a = RFLOAT_VALUE(x);
-#if defined(_MSC_VER) && _MSC_VER < 1300
+ a = RFLOAT(x)->value;
if (isnan(a)) return Qfalse;
-#endif
return (a == b)?Qtrue:Qfalse;
}
/*
* call-seq:
- * flt.hash -> integer
+ * flt.hash => integer
*
* Returns a hash code for this float.
*/
static VALUE
-flo_hash(VALUE num)
+flo_hash(num)
+ VALUE num;
{
double d;
- int hash;
+ char *c;
+ int i, hash;
- d = RFLOAT_VALUE(num);
- hash = rb_memhash(&d, sizeof(d));
+ d = RFLOAT(num)->value;
+ if (d == 0) d = fabs(d);
+ c = (char*)&d;
+ for (hash=0, i=0; i<sizeof(double);i++) {
+ hash = (hash * 971) ^ (unsigned char)c[i];
+ }
+ if (hash < 0) hash = -hash;
return INT2FIX(hash);
}
VALUE
-rb_dbl_cmp(double a, double b)
+rb_dbl_cmp(a, b)
+ double a, b;
{
if (isnan(a) || isnan(b)) return Qnil;
if (a == b) return INT2FIX(0);
@@ -929,61 +914,53 @@ rb_dbl_cmp(double a, double b)
/*
* call-seq:
- * flt <=> real -> -1, 0, +1 or nil
+ * flt <=> numeric => -1, 0, +1
*
- * Returns -1, 0, +1 or nil depending on whether <i>flt</i> is less
- * than, equal to, or greater than <i>real</i>. This is the basis for
- * the tests in <code>Comparable</code>.
+ * Returns -1, 0, or +1 depending on whether <i>flt</i> is less than,
+ * equal to, or greater than <i>numeric</i>. This is the basis for the
+ * tests in <code>Comparable</code>.
*/
static VALUE
-flo_cmp(VALUE x, VALUE y)
+flo_cmp(x, y)
+ VALUE x, y;
{
double a, b;
- a = RFLOAT_VALUE(x);
- if (isnan(a)) return Qnil;
+ a = RFLOAT(x)->value;
switch (TYPE(y)) {
case T_FIXNUM:
b = (double)FIX2LONG(y);
break;
case T_BIGNUM:
- if (isinf(a)) {
- if (a > 0.0) return INT2FIX(1);
- else return INT2FIX(-1);
- }
b = rb_big2dbl(y);
break;
case T_FLOAT:
- b = RFLOAT_VALUE(y);
+ b = RFLOAT(y)->value;
break;
default:
- if (isinf(a) && (!rb_respond_to(y, rb_intern("infinite?")) ||
- !RTEST(rb_funcall(y, rb_intern("infinite?"), 0, 0)))) {
- if (a > 0.0) return INT2FIX(1);
- return INT2FIX(-1);
- }
- return rb_num_coerce_cmp(x, y, rb_intern("<=>"));
+ return rb_num_coerce_cmp(x, y);
}
return rb_dbl_cmp(a, b);
}
/*
* call-seq:
- * flt > real -> true or false
+ * flt > other => true or false
*
- * <code>true</code> if <code>flt</code> is greater than <code>real</code>.
+ * <code>true</code> if <code>flt</code> is greater than <code>other</code>.
*/
static VALUE
-flo_gt(VALUE x, VALUE y)
+flo_gt(x, y)
+ VALUE x, y;
{
double a, b;
- a = RFLOAT_VALUE(x);
+ a = RFLOAT(x)->value;
switch (TYPE(y)) {
case T_FIXNUM:
b = (double)FIX2LONG(y);
@@ -994,35 +971,32 @@ flo_gt(VALUE x, VALUE y)
break;
case T_FLOAT:
- b = RFLOAT_VALUE(y);
-#if defined(_MSC_VER) && _MSC_VER < 1300
+ b = RFLOAT(y)->value;
if (isnan(b)) return Qfalse;
-#endif
break;
default:
- return rb_num_coerce_relop(x, y, '>');
+ return rb_num_coerce_relop(x, y);
}
-#if defined(_MSC_VER) && _MSC_VER < 1300
if (isnan(a)) return Qfalse;
-#endif
return (a > b)?Qtrue:Qfalse;
}
/*
* call-seq:
- * flt >= real -> true or false
+ * flt >= other => true or false
*
* <code>true</code> if <code>flt</code> is greater than
- * or equal to <code>real</code>.
+ * or equal to <code>other</code>.
*/
static VALUE
-flo_ge(VALUE x, VALUE y)
+flo_ge(x, y)
+ VALUE x, y;
{
double a, b;
- a = RFLOAT_VALUE(x);
+ a = RFLOAT(x)->value;
switch (TYPE(y)) {
case T_FIXNUM:
b = (double)FIX2LONG(y);
@@ -1033,34 +1007,31 @@ flo_ge(VALUE x, VALUE y)
break;
case T_FLOAT:
- b = RFLOAT_VALUE(y);
-#if defined(_MSC_VER) && _MSC_VER < 1300
+ b = RFLOAT(y)->value;
if (isnan(b)) return Qfalse;
-#endif
break;
default:
- return rb_num_coerce_relop(x, y, rb_intern(">="));
+ return rb_num_coerce_relop(x, y);
}
-#if defined(_MSC_VER) && _MSC_VER < 1300
if (isnan(a)) return Qfalse;
-#endif
return (a >= b)?Qtrue:Qfalse;
}
/*
* call-seq:
- * flt < real -> true or false
+ * flt < other => true or false
*
- * <code>true</code> if <code>flt</code> is less than <code>real</code>.
+ * <code>true</code> if <code>flt</code> is less than <code>other</code>.
*/
static VALUE
-flo_lt(VALUE x, VALUE y)
+flo_lt(x, y)
+ VALUE x, y;
{
double a, b;
- a = RFLOAT_VALUE(x);
+ a = RFLOAT(x)->value;
switch (TYPE(y)) {
case T_FIXNUM:
b = (double)FIX2LONG(y);
@@ -1071,35 +1042,32 @@ flo_lt(VALUE x, VALUE y)
break;
case T_FLOAT:
- b = RFLOAT_VALUE(y);
-#if defined(_MSC_VER) && _MSC_VER < 1300
+ b = RFLOAT(y)->value;
if (isnan(b)) return Qfalse;
-#endif
break;
default:
- return rb_num_coerce_relop(x, y, '<');
+ return rb_num_coerce_relop(x, y);
}
-#if defined(_MSC_VER) && _MSC_VER < 1300
if (isnan(a)) return Qfalse;
-#endif
return (a < b)?Qtrue:Qfalse;
}
/*
* call-seq:
- * flt <= rael -> true or false
+ * flt <= other => true or false
*
* <code>true</code> if <code>flt</code> is less than
- * or equal to <code>real</code>.
+ * or equal to <code>other</code>.
*/
static VALUE
-flo_le(VALUE x, VALUE y)
+flo_le(x, y)
+ VALUE x, y;
{
double a, b;
- a = RFLOAT_VALUE(x);
+ a = RFLOAT(x)->value;
switch (TYPE(y)) {
case T_FIXNUM:
b = (double)FIX2LONG(y);
@@ -1110,24 +1078,20 @@ flo_le(VALUE x, VALUE y)
break;
case T_FLOAT:
- b = RFLOAT_VALUE(y);
-#if defined(_MSC_VER) && _MSC_VER < 1300
+ b = RFLOAT(y)->value;
if (isnan(b)) return Qfalse;
-#endif
break;
default:
- return rb_num_coerce_relop(x, y, rb_intern("<="));
+ return rb_num_coerce_relop(x, y);
}
-#if defined(_MSC_VER) && _MSC_VER < 1300
if (isnan(a)) return Qfalse;
-#endif
return (a <= b)?Qtrue:Qfalse;
}
/*
* call-seq:
- * flt.eql?(obj) -> true or false
+ * flt.eql?(obj) => true or false
*
* Returns <code>true</code> only if <i>obj</i> is a
* <code>Float</code> with the same value as <i>flt</i>. Contrast this
@@ -1137,37 +1101,36 @@ flo_le(VALUE x, VALUE y)
*/
static VALUE
-flo_eql(VALUE x, VALUE y)
+flo_eql(x, y)
+ VALUE x, y;
{
if (TYPE(y) == T_FLOAT) {
- double a = RFLOAT_VALUE(x);
- double b = RFLOAT_VALUE(y);
-#if defined(_MSC_VER) && _MSC_VER < 1300
+ double a = RFLOAT(x)->value;
+ double b = RFLOAT(y)->value;
+
if (isnan(a) || isnan(b)) return Qfalse;
-#endif
- if (a == b)
- return Qtrue;
+ if (a == b) return Qtrue;
}
return Qfalse;
}
/*
* call-seq:
- * flt.to_f -> self
+ * flt.to_f => flt
*
* As <code>flt</code> is already a float, returns <i>self</i>.
*/
static VALUE
-flo_to_f(VALUE num)
+flo_to_f(num)
+ VALUE num;
{
return num;
}
/*
* call-seq:
- * flt.abs -> float
- * flt.magnitude -> float
+ * flt.abs => float
*
* Returns the absolute value of <i>flt</i>.
*
@@ -1177,24 +1140,26 @@ flo_to_f(VALUE num)
*/
static VALUE
-flo_abs(VALUE flt)
+flo_abs(flt)
+ VALUE flt;
{
- double val = fabs(RFLOAT_VALUE(flt));
- return DBL2NUM(val);
+ double val = fabs(RFLOAT(flt)->value);
+ return rb_float_new(val);
}
/*
* call-seq:
- * flt.zero? -> true or false
+ * flt.zero? -> true or false
*
* Returns <code>true</code> if <i>flt</i> is 0.0.
*
*/
static VALUE
-flo_zero_p(VALUE num)
+flo_zero_p(num)
+ VALUE num;
{
- if (RFLOAT_VALUE(num) == 0.0) {
+ if (RFLOAT(num)->value == 0.0) {
return Qtrue;
}
return Qfalse;
@@ -1202,7 +1167,7 @@ flo_zero_p(VALUE num)
/*
* call-seq:
- * flt.nan? -> true or false
+ * flt.nan? -> true or false
*
* Returns <code>true</code> if <i>flt</i> is an invalid IEEE floating
* point number.
@@ -1214,16 +1179,17 @@ flo_zero_p(VALUE num)
*/
static VALUE
-flo_is_nan_p(VALUE num)
+flo_is_nan_p(num)
+ VALUE num;
{
- double value = RFLOAT_VALUE(num);
+ double value = RFLOAT(num)->value;
return isnan(value) ? Qtrue : Qfalse;
}
/*
* call-seq:
- * flt.infinite? -> nil, -1, +1
+ * flt.infinite? -> nil, -1, +1
*
* Returns <code>nil</code>, -1, or +1 depending on whether <i>flt</i>
* is finite, -infinity, or +infinity.
@@ -1234,9 +1200,10 @@ flo_is_nan_p(VALUE num)
*/
static VALUE
-flo_is_infinite_p(VALUE num)
+flo_is_infinite_p(num)
+ VALUE num;
{
- double value = RFLOAT_VALUE(num);
+ double value = RFLOAT(num)->value;
if (isinf(value)) {
return INT2FIX( value < 0 ? -1 : 1 );
@@ -1247,7 +1214,7 @@ flo_is_infinite_p(VALUE num)
/*
* call-seq:
- * flt.finite? -> true or false
+ * flt.finite? -> true or false
*
* Returns <code>true</code> if <i>flt</i> is a valid IEEE floating
* point number (it is not infinite, and <code>nan?</code> is
@@ -1256,9 +1223,10 @@ flo_is_infinite_p(VALUE num)
*/
static VALUE
-flo_is_finite_p(VALUE num)
+flo_is_finite_p(num)
+ VALUE num;
{
- double value = RFLOAT_VALUE(num);
+ double value = RFLOAT(num)->value;
#if HAVE_FINITE
if (!finite(value))
@@ -1273,7 +1241,7 @@ flo_is_finite_p(VALUE num)
/*
* call-seq:
- * flt.floor -> integer
+ * flt.floor => integer
*
* Returns the largest integer less than or equal to <i>flt</i>.
*
@@ -1284,21 +1252,22 @@ flo_is_finite_p(VALUE num)
*/
static VALUE
-flo_floor(VALUE num)
+flo_floor(num)
+ VALUE num;
{
- double f = floor(RFLOAT_VALUE(num));
+ double f = floor(RFLOAT(num)->value);
long val;
if (!FIXABLE(f)) {
return rb_dbl2big(f);
}
- val = (long)f;
+ val = f;
return LONG2FIX(val);
}
/*
* call-seq:
- * flt.ceil -> integer
+ * flt.ceil => integer
*
* Returns the smallest <code>Integer</code> greater than or equal to
* <i>flt</i>.
@@ -1310,80 +1279,66 @@ flo_floor(VALUE num)
*/
static VALUE
-flo_ceil(VALUE num)
+flo_ceil(num)
+ VALUE num;
{
- double f = ceil(RFLOAT_VALUE(num));
+ double f = ceil(RFLOAT(num)->value);
long val;
if (!FIXABLE(f)) {
return rb_dbl2big(f);
}
- val = (long)f;
+ val = f;
return LONG2FIX(val);
}
/*
* call-seq:
- * flt.round([ndigits]) -> integer or float
+ * flt.round => integer
*
- * Rounds <i>flt</i> to a given precision in decimal digits (default 0 digits).
- * Precision may be negative. Returns a floating point number when ndigits
- * is more than one.
+ * Rounds <i>flt</i> to the nearest integer. Equivalent to:
+ *
+ * def round
+ * return (self+0.5).floor if self > 0.0
+ * return (self-0.5).ceil if self < 0.0
+ * return 0
+ * end
*
* 1.5.round #=> 2
* (-1.5).round #=> -2
+ *
*/
static VALUE
-flo_round(int argc, VALUE *argv, VALUE num)
+flo_round(num)
+ VALUE num;
{
- VALUE nd;
- double number, f;
- int ndigits = 0, i;
+ double f = RFLOAT(num)->value;
long val;
- if (argc > 0 && rb_scan_args(argc, argv, "01", &nd) == 1) {
- ndigits = NUM2INT(nd);
- }
- number = RFLOAT_VALUE(num);
- f = 1.0;
- i = abs(ndigits);
- while (--i >= 0)
- f = f*10.0;
-
- if (isinf(f)) {
- if (ndigits < 0) number = 0;
- }
- else {
- if (ndigits < 0) number /= f;
- else number *= f;
- number = round(number);
- if (ndigits < 0) number *= f;
- else number /= f;
- }
+ f = round(f);
- if (ndigits > 0) return DBL2NUM(number);
-
- if (!FIXABLE(number)) {
- return rb_dbl2big(number);
+ if (!FIXABLE(f)) {
+ return rb_dbl2big(f);
}
- val = (long)number;
+ val = f;
return LONG2FIX(val);
}
/*
* call-seq:
- * flt.to_i -> integer
- * flt.to_int -> integer
- * flt.truncate -> integer
+ * flt.to_i => integer
+ * flt.to_int => integer
+ * flt.truncate => integer
*
* Returns <i>flt</i> truncated to an <code>Integer</code>.
*/
static VALUE
-flo_truncate(VALUE num)
+flo_truncate(num)
+ VALUE num;
{
- double f = RFLOAT_VALUE(num);
+ double f = RFLOAT(num)->value;
long val;
if (f > 0.0) f = floor(f);
@@ -1392,13 +1347,14 @@ flo_truncate(VALUE num)
if (!FIXABLE(f)) {
return rb_dbl2big(f);
}
- val = (long)f;
+ val = f;
return LONG2FIX(val);
}
+
/*
* call-seq:
- * num.floor -> integer
+ * num.floor => integer
*
* Returns the largest integer less than or equal to <i>num</i>.
* <code>Numeric</code> implements this by converting <i>anInteger</i>
@@ -1409,7 +1365,8 @@ flo_truncate(VALUE num)
*/
static VALUE
-num_floor(VALUE num)
+num_floor(num)
+ VALUE num;
{
return flo_floor(rb_Float(num));
}
@@ -1417,7 +1374,7 @@ num_floor(VALUE num)
/*
* call-seq:
- * num.ceil -> integer
+ * num.ceil => integer
*
* Returns the smallest <code>Integer</code> greater than or equal to
* <i>num</i>. Class <code>Numeric</code> achieves this by converting
@@ -1431,30 +1388,31 @@ num_floor(VALUE num)
*/
static VALUE
-num_ceil(VALUE num)
+num_ceil(num)
+ VALUE num;
{
return flo_ceil(rb_Float(num));
}
/*
* call-seq:
- * num.round([ndigits]) -> integer or float
+ * num.round => integer
*
- * Rounds <i>num</i> to a given precision in decimal digits (default 0 digits).
- * Precision may be negative. Returns a floating point number when ndigits
- * is more than one. <code>Numeric</code> implements this by converting itself
- * to a <code>Float</code> and invoking <code>Float#round</code>.
+ * Rounds <i>num</i> to the nearest integer. <code>Numeric</code>
+ * implements this by converting itself to a
+ * <code>Float</code> and invoking <code>Float#round</code>.
*/
static VALUE
-num_round(int argc, VALUE* argv, VALUE num)
+num_round(num)
+ VALUE num;
{
- return flo_round(argc, argv, rb_Float(num));
+ return flo_round(rb_Float(num));
}
/*
* call-seq:
- * num.truncate -> integer
+ * num.truncate => integer
*
* Returns <i>num</i> truncated to an integer. <code>Numeric</code>
* implements this by converting its value to a float and invoking
@@ -1462,14 +1420,19 @@ num_round(int argc, VALUE* argv, VALUE num)
*/
static VALUE
-num_truncate(VALUE num)
+num_truncate(num)
+ VALUE num;
{
return flo_truncate(rb_Float(num));
}
+int ruby_float_step _((VALUE from, VALUE to, VALUE step, int excl));
+
int
-ruby_float_step(VALUE from, VALUE to, VALUE step, int excl)
+ruby_float_step(from, to, step, excl)
+ VALUE from, to, step;
+ int excl;
{
if (TYPE(from) == T_FLOAT || TYPE(to) == T_FLOAT || TYPE(step) == T_FLOAT) {
const double epsilon = DBL_EPSILON;
@@ -1480,16 +1443,11 @@ ruby_float_step(VALUE from, VALUE to, VALUE step, int excl)
double err = (fabs(beg) + fabs(end) + fabs(end-beg)) / fabs(unit) * epsilon;
long i;
- if (isinf(unit)) {
- if (unit > 0) rb_yield(DBL2NUM(beg));
- }
- else {
- if (err>0.5) err=0.5;
- n = floor(n + err);
- if (!excl) n++;
- for (i=0; i<n; i++) {
- rb_yield(DBL2NUM(i*unit+beg));
- }
+ if (err>0.5) err=0.5;
+ n = floor(n + err);
+ if (!excl) n++;
+ for (i=0; i<n; i++) {
+ rb_yield(rb_float_new(i*unit+beg));
}
return Qtrue;
}
@@ -1498,22 +1456,21 @@ ruby_float_step(VALUE from, VALUE to, VALUE step, int excl)
/*
* call-seq:
- * num.step(limit[, step]) {|i| block } -> self
- * num.step(limit[, step]) -> enumerator
+ * num.step(limit, step ) {|i| block } => num
*
* Invokes <em>block</em> with the sequence of numbers starting at
- * <i>num</i>, incremented by <i>step</i> (default 1) on each
- * call. The loop finishes when the value to be passed to the block
- * is greater than <i>limit</i> (if <i>step</i> is positive) or less
- * than <i>limit</i> (if <i>step</i> is negative). If all the
- * arguments are integers, the loop operates using an integer
- * counter. If any of the arguments are floating point numbers, all
- * are converted to floats, and the loop is executed <i>floor(n +
- * n*epsilon)+ 1</i> times, where <i>n = (limit -
- * num)/step</i>. Otherwise, the loop starts at <i>num</i>, uses
- * either the <code><</code> or <code>></code> operator to compare
- * the counter against <i>limit</i>, and increments itself using the
- * <code>+</code> operator.
+ * <i>num</i>, incremented by <i>step</i> on each call. The loop
+ * finishes when the value to be passed to the block is greater than
+ * <i>limit</i> (if <i>step</i> is positive) or less than
+ * <i>limit</i> (if <i>step</i> is negative). If all the arguments are
+ * integers, the loop operates using an integer counter. If any of the
+ * arguments are floating point numbers, all are converted to floats,
+ * and the loop is executed <i>floor(n + n*epsilon)+ 1</i> times,
+ * where <i>n = (limit - num)/step</i>. Otherwise, the loop
+ * starts at <i>num</i>, uses either the <code><</code> or
+ * <code>></code> operator to compare the counter against
+ * <i>limit</i>, and increments itself using the <code>+</code>
+ * operator.
*
* 1.step(10, 2) { |i| print i, " " }
* Math::E.step(Math::PI, 0.2) { |f| print f, " " }
@@ -1525,11 +1482,15 @@ ruby_float_step(VALUE from, VALUE to, VALUE step, int excl)
*/
static VALUE
-num_step(int argc, VALUE *argv, VALUE from)
+num_step(argc, argv, from)
+ int argc;
+ VALUE *argv;
+ VALUE from;
{
VALUE to, step;
RETURN_ENUMERATOR(from, argc, argv);
+
if (argc == 1) {
to = argv[0];
step = INT2FIX(1);
@@ -1586,8 +1547,9 @@ num_step(int argc, VALUE *argv, VALUE from)
return from;
}
-SIGNED_VALUE
-rb_num2long(VALUE val)
+long
+rb_num2long(val)
+ VALUE val;
{
again:
if (NIL_P(val)) {
@@ -1598,15 +1560,15 @@ rb_num2long(VALUE val)
switch (TYPE(val)) {
case T_FLOAT:
- if (RFLOAT_VALUE(val) <= (double)LONG_MAX
- && RFLOAT_VALUE(val) >= (double)LONG_MIN) {
- return (SIGNED_VALUE)(RFLOAT_VALUE(val));
+ if (RFLOAT(val)->value <= (double)LONG_MAX
+ && RFLOAT(val)->value >= (double)LONG_MIN) {
+ return (long)(RFLOAT(val)->value);
}
else {
char buf[24];
char *s;
- snprintf(buf, sizeof(buf), "%-.10g", RFLOAT_VALUE(val));
+ sprintf(buf, "%-.10g", RFLOAT(val)->value);
if ((s = strchr(buf, ' ')) != 0) *s = '\0';
rb_raise(rb_eRangeError, "float %s out of range of integer", buf);
}
@@ -1620,50 +1582,57 @@ rb_num2long(VALUE val)
}
}
-VALUE
-rb_num2ulong(VALUE val)
+unsigned long
+rb_num2ulong(val)
+ VALUE val;
{
if (TYPE(val) == T_BIGNUM) {
return rb_big2ulong(val);
}
- return (VALUE)rb_num2long(val);
-}
-
-#if SIZEOF_INT < SIZEOF_VALUE
-void
-rb_out_of_int(SIGNED_VALUE num)
-{
- rb_raise(rb_eRangeError, "integer %"PRIdVALUE " too %s to convert to `int'",
- num, num < 0 ? "small" : "big");
+ return (unsigned long)rb_num2long(val);
}
+#if SIZEOF_INT < SIZEOF_LONG
static void
-check_int(SIGNED_VALUE num)
+check_int(num)
+ long num;
{
- if ((SIGNED_VALUE)(int)num != num) {
- rb_out_of_int(num);
+ const char *s;
+
+ if (num < INT_MIN) {
+ s = "small";
+ }
+ else if (num > INT_MAX) {
+ s = "big";
}
+ else {
+ return;
+ }
+ rb_raise(rb_eRangeError, "integer %ld too %s to convert to `int'", num, s);
}
static void
-check_uint(VALUE num, VALUE sign)
+check_uint(num, sign)
+ unsigned long num;
+ VALUE sign;
{
- static const VALUE mask = ~(VALUE)UINT_MAX;
+ static const unsigned long mask = ~(unsigned long)UINT_MAX;
if (RTEST(sign)) {
/* minus */
if ((num & mask) != mask || (num & ~mask) <= INT_MAX + 1UL)
- rb_raise(rb_eRangeError, "integer %"PRIdVALUE " too small to convert to `unsigned int'", num);
+ rb_raise(rb_eRangeError, "integer %ld too small to convert to `unsigned int'", num);
}
else {
/* plus */
if ((num & mask) != 0)
- rb_raise(rb_eRangeError, "integer %"PRIuVALUE " too big to convert to `unsigned int'", num);
+ rb_raise(rb_eRangeError, "integer %lu too big to convert to `unsigned int'", num);
}
}
long
-rb_num2int(VALUE val)
+rb_num2int(val)
+ VALUE val;
{
long num = rb_num2long(val);
@@ -1672,7 +1641,8 @@ rb_num2int(VALUE val)
}
long
-rb_fix2int(VALUE val)
+rb_fix2int(val)
+ VALUE val;
{
long num = FIXNUM_P(val)?FIX2LONG(val):rb_num2long(val);
@@ -1681,7 +1651,8 @@ rb_fix2int(VALUE val)
}
unsigned long
-rb_num2uint(VALUE val)
+rb_num2uint(val)
+ VALUE val;
{
unsigned long num = rb_num2ulong(val);
@@ -1690,12 +1661,13 @@ rb_num2uint(VALUE val)
}
unsigned long
-rb_fix2uint(VALUE val)
+rb_fix2uint(val)
+ VALUE val;
{
unsigned long num;
if (!FIXNUM_P(val)) {
- return rb_num2uint(val);
+ return rb_num2uint(val);
}
num = FIX2ULONG(val);
@@ -1704,20 +1676,23 @@ rb_fix2uint(VALUE val)
}
#else
long
-rb_num2int(VALUE val)
+rb_num2int(val)
+ VALUE val;
{
return rb_num2long(val);
}
long
-rb_fix2int(VALUE val)
+rb_fix2int(val)
+ VALUE val;
{
return FIX2INT(val);
}
#endif
VALUE
-rb_num2fix(VALUE val)
+rb_num2fix(val)
+ VALUE val;
{
long v;
@@ -1725,14 +1700,15 @@ rb_num2fix(VALUE val)
v = rb_num2long(val);
if (!FIXABLE(v))
- rb_raise(rb_eRangeError, "integer %"PRIdVALUE " out of range of fixnum", v);
+ rb_raise(rb_eRangeError, "integer %ld out of range of fixnum", v);
return LONG2FIX(v);
}
#if HAVE_LONG_LONG
LONG_LONG
-rb_num2ll(VALUE val)
+rb_num2ll(val)
+ VALUE val;
{
if (NIL_P(val)) {
rb_raise(rb_eTypeError, "no implicit conversion from nil");
@@ -1741,40 +1717,41 @@ rb_num2ll(VALUE val)
if (FIXNUM_P(val)) return (LONG_LONG)FIX2LONG(val);
switch (TYPE(val)) {
- case T_FLOAT:
- if (RFLOAT_VALUE(val) <= (double)LLONG_MAX
- && RFLOAT_VALUE(val) >= (double)LLONG_MIN) {
- return (LONG_LONG)(RFLOAT_VALUE(val));
+ case T_FLOAT:
+ if (RFLOAT(val)->value <= (double)LLONG_MAX
+ && RFLOAT(val)->value >= (double)LLONG_MIN) {
+ return (LONG_LONG)(RFLOAT(val)->value);
}
else {
char buf[24];
char *s;
- snprintf(buf, sizeof(buf), "%-.10g", RFLOAT_VALUE(val));
+ sprintf(buf, "%-.10g", RFLOAT(val)->value);
if ((s = strchr(buf, ' ')) != 0) *s = '\0';
rb_raise(rb_eRangeError, "float %s out of range of long long", buf);
}
- case T_BIGNUM:
+ case T_BIGNUM:
return rb_big2ll(val);
- case T_STRING:
+ case T_STRING:
rb_raise(rb_eTypeError, "no implicit conversion from string");
return Qnil; /* not reached */
- case T_TRUE:
- case T_FALSE:
+ case T_TRUE:
+ case T_FALSE:
rb_raise(rb_eTypeError, "no implicit conversion from boolean");
return Qnil; /* not reached */
default:
- val = rb_to_int(val);
- return NUM2LL(val);
+ val = rb_to_int(val);
+ return NUM2LL(val);
}
}
unsigned LONG_LONG
-rb_num2ull(VALUE val)
+rb_num2ull(val)
+ VALUE val;
{
if (TYPE(val) == T_BIGNUM) {
return rb_big2ull(val);
@@ -1784,6 +1761,7 @@ rb_num2ull(VALUE val)
#endif /* HAVE_LONG_LONG */
+
/*
* Document-class: Integer
*
@@ -1795,39 +1773,41 @@ rb_num2ull(VALUE val)
/*
* call-seq:
- * int.to_i -> integer
- * int.to_int -> integer
- * int.floor -> integer
- * int.ceil -> integer
- * int.round -> integer
- * int.truncate -> integer
+ * int.to_i => int
+ * int.to_int => int
+ * int.floor => int
+ * int.ceil => int
+ * int.round => int
+ * int.truncate => int
*
* As <i>int</i> is already an <code>Integer</code>, all these
* methods simply return the receiver.
*/
static VALUE
-int_to_i(VALUE num)
+int_to_i(num)
+ VALUE num;
{
return num;
}
/*
* call-seq:
- * int.integer? -> true
+ * int.integer? -> true
*
* Always returns <code>true</code>.
*/
static VALUE
-int_int_p(VALUE num)
+int_int_p(num)
+ VALUE num;
{
return Qtrue;
}
/*
* call-seq:
- * int.odd? -> true or false
+ * int.odd? -> true or false
*
* Returns <code>true</code> if <i>int</i> is an odd number.
*/
@@ -1836,14 +1816,14 @@ static VALUE
int_odd_p(VALUE num)
{
if (rb_funcall(num, '%', 1, INT2FIX(2)) != INT2FIX(0)) {
- return Qtrue;
+ return Qtrue;
}
return Qfalse;
}
/*
* call-seq:
- * int.even? -> true or false
+ * int.even? -> true or false
*
* Returns <code>true</code> if <i>int</i> is an even number.
*/
@@ -1852,33 +1832,16 @@ static VALUE
int_even_p(VALUE num)
{
if (rb_funcall(num, '%', 1, INT2FIX(2)) == INT2FIX(0)) {
- return Qtrue;
+ return Qtrue;
}
return Qfalse;
}
-/*
- * call-seq:
- * fixnum.next -> integer
- * fixnum.succ -> integer
- *
- * Returns the <code>Integer</code> equal to <i>int</i> + 1.
- *
- * 1.next #=> 2
- * (-1).next #=> 0
- */
-
-static VALUE
-fix_succ(VALUE num)
-{
- long i = FIX2LONG(num) + 1;
- return LONG2NUM(i);
-}
/*
* call-seq:
- * int.next -> integer
- * int.succ -> integer
+ * int.next => integer
+ * int.succ => integer
*
* Returns the <code>Integer</code> equal to <i>int</i> + 1.
*
@@ -1887,7 +1850,8 @@ fix_succ(VALUE num)
*/
static VALUE
-int_succ(VALUE num)
+int_succ(num)
+ VALUE num;
{
if (FIXNUM_P(num)) {
long i = FIX2LONG(num) + 1;
@@ -1898,7 +1862,7 @@ int_succ(VALUE num)
/*
* call-seq:
- * int.pred -> integer
+ * int.pred => integer
*
* Returns the <code>Integer</code> equal to <i>int</i> - 1.
*
@@ -1910,72 +1874,40 @@ static VALUE
int_pred(VALUE num)
{
if (FIXNUM_P(num)) {
- long i = FIX2LONG(num) - 1;
- return LONG2NUM(i);
+ long i = FIX2LONG(num) - 1;
+ return LONG2NUM(i);
}
return rb_funcall(num, '-', 1, INT2FIX(1));
}
/*
* call-seq:
- * int.chr([encoding]) -> string
+ * int.chr => string
*
- * Returns a string containing the character represented by the
- * receiver's value according to +encoding+.
+ * Returns a string containing the ASCII character represented by the
+ * receiver's value.
*
* 65.chr #=> "A"
+ * ?a.chr #=> "a"
* 230.chr #=> "\346"
- * 255.chr(Encoding::UTF_8) #=> "\303\277"
*/
static VALUE
-int_chr(int argc, VALUE *argv, VALUE num)
+int_chr(num)
+ VALUE num;
{
char c;
- int n;
long i = NUM2LONG(num);
- rb_encoding *enc;
- VALUE str;
-
- switch (argc) {
- case 0:
- if (i < 0) {
- out_of_range:
- rb_raise(rb_eRangeError, "%"PRIdVALUE " out of char range", i);
- }
- if (0xff < i) {
- enc = rb_default_internal_encoding();
- if (!enc) goto out_of_range;
- goto decode;
- }
- c = (char)i;
- if (i < 0x80) {
- return rb_usascii_str_new(&c, 1);
- }
- else {
- return rb_str_new(&c, 1);
- }
- case 1:
- break;
- default:
- rb_raise(rb_eArgError, "wrong number of arguments (%d for 0 or 1)", argc);
- break;
- }
- enc = rb_to_encoding(argv[0]);
- if (!enc) enc = rb_ascii8bit_encoding();
- decode:
-#if SIZEOF_INT < SIZEOF_LONG
- if (i > INT_MAX) goto out_of_range;
-#endif
- if (i < 0 || (n = rb_enc_codelen((int)i, enc)) <= 0) goto out_of_range;
- str = rb_enc_str_new(0, n, enc);
- rb_enc_mbcput((int)i, RSTRING_PTR(str), enc);
- return str;
+
+ if (i < 0 || 0xff < i)
+ rb_raise(rb_eRangeError, "%ld out of char range", i);
+ c = i;
+ return rb_str_new(&c, 1);
}
/*
* call-seq:
- * int.ord -> self
+ * int.ord => int
*
* Returns the int itself.
*
@@ -2014,30 +1946,94 @@ int_ord(num)
/*
* call-seq:
- * -fix -> integer
+ * Fixnum.induced_from(obj) => fixnum
+ *
+ * Convert <code>obj</code> to a Fixnum. Works with numeric parameters.
+ * Also works with Symbols, but this is deprecated.
+ */
+
+static VALUE
+rb_fix_induced_from(klass, x)
+ VALUE klass, x;
+{
+ return rb_num2fix(x);
+}
+
+/*
+ * call-seq:
+ * Integer.induced_from(obj) => fixnum, bignum
+ *
+ * Convert <code>obj</code> to an Integer.
+ */
+
+static VALUE
+rb_int_induced_from(klass, x)
+ VALUE klass, x;
+{
+ switch (TYPE(x)) {
+ case T_FIXNUM:
+ case T_BIGNUM:
+ return x;
+ case T_FLOAT:
+ return rb_funcall(x, id_to_i, 0);
+ default:
+ rb_raise(rb_eTypeError, "failed to convert %s into Integer",
+ rb_obj_classname(x));
+ }
+}
+
+/*
+ * call-seq:
+ * Float.induced_from(obj) => float
+ *
+ * Convert <code>obj</code> to a float.
+ */
+
+static VALUE
+rb_flo_induced_from(klass, x)
+ VALUE klass, x;
+{
+ switch (TYPE(x)) {
+ case T_FIXNUM:
+ case T_BIGNUM:
+ return rb_funcall(x, rb_intern("to_f"), 0);
+ case T_FLOAT:
+ return x;
+ default:
+ rb_raise(rb_eTypeError, "failed to convert %s into Float",
+ rb_obj_classname(x));
+ }
+}
+
+/*
+ * call-seq:
+ * -fix => integer
*
* Negates <code>fix</code> (which might return a Bignum).
*/
static VALUE
-fix_uminus(VALUE num)
+fix_uminus(num)
+ VALUE num;
{
return LONG2NUM(-FIX2LONG(num));
}
VALUE
-rb_fix2str(VALUE x, int base)
+rb_fix2str(x, base)
+ VALUE x;
+ int base;
{
extern const char ruby_digitmap[];
- char buf[SIZEOF_VALUE*CHAR_BIT + 2], *b = buf + sizeof buf;
+ char buf[SIZEOF_LONG*CHAR_BIT + 2], *b = buf + sizeof buf;
long val = FIX2LONG(x);
int neg = 0;
if (base < 2 || 36 < base) {
- rb_raise(rb_eArgError, "invalid radix %d", base);
+ rb_raise(rb_eArgError, "illegal radix %d", base);
}
if (val == 0) {
- return rb_usascii_str_new2("0");
+ return rb_str_new2("0");
}
if (val < 0) {
val = -val;
@@ -2051,12 +2047,12 @@ rb_fix2str(VALUE x, int base)
*--b = '-';
}
- return rb_usascii_str_new2(b);
+ return rb_str_new2(b);
}
/*
* call-seq:
- * fix.to_s(base=10) -> string
+ * fix.to_s( base=10 ) -> aString
*
* Returns a string containing the representation of <i>fix</i> radix
* <i>base</i> (between 2 and 36).
@@ -2070,24 +2066,24 @@ rb_fix2str(VALUE x, int base)
*
*/
static VALUE
-fix_to_s(int argc, VALUE *argv, VALUE x)
+fix_to_s(argc, argv, x)
+ int argc;
+ VALUE *argv;
+ VALUE x;
{
+ VALUE b;
int base;
+ rb_scan_args(argc, argv, "01", &b);
if (argc == 0) base = 10;
- else {
- VALUE b;
-
- rb_scan_args(argc, argv, "01", &b);
- base = NUM2INT(b);
- }
+ else base = NUM2INT(b);
return rb_fix2str(x, base);
}
/*
* call-seq:
- * fix + numeric -> numeric_result
+ * fix + numeric => numeric_result
*
* Performs addition: the class of the resulting object depends on
* the class of <code>numeric</code> and on the magnitude of the
@@ -2095,7 +2091,8 @@ fix_to_s(int argc, VALUE *argv, VALUE x)
*/
static VALUE
-fix_plus(VALUE x, VALUE y)
+fix_plus(x, y)
+ VALUE x, y;
{
if (FIXNUM_P(y)) {
long a, b, c;
@@ -2108,19 +2105,15 @@ fix_plus(VALUE x, VALUE y)
return r;
}
- switch (TYPE(y)) {
- case T_BIGNUM:
- return rb_big_plus(y, x);
- case T_FLOAT:
- return DBL2NUM((double)FIX2LONG(x) + RFLOAT_VALUE(y));
- default:
- return rb_num_coerce_bin(x, y, '+');
+ if (TYPE(y) == T_FLOAT) {
+ return rb_float_new((double)FIX2LONG(x) + RFLOAT(y)->value);
}
+ return rb_num_coerce_bin(x, y);
}
/*
* call-seq:
- * fix - numeric -> numeric_result
+ * fix - numeric => numeric_result
*
* Performs subtraction: the class of the resulting object depends on
* the class of <code>numeric</code> and on the magnitude of the
@@ -2128,7 +2121,8 @@ fix_plus(VALUE x, VALUE y)
*/
static VALUE
-fix_minus(VALUE x, VALUE y)
+fix_minus(x, y)
+ VALUE x, y;
{
if (FIXNUM_P(y)) {
long a, b, c;
@@ -2141,24 +2135,15 @@ fix_minus(VALUE x, VALUE y)
return r;
}
- switch (TYPE(y)) {
- case T_BIGNUM:
- x = rb_int2big(FIX2LONG(x));
- return rb_big_minus(x, y);
- case T_FLOAT:
- return DBL2NUM((double)FIX2LONG(x) - RFLOAT_VALUE(y));
- default:
- return rb_num_coerce_bin(x, y, '-');
+ if (TYPE(y) == T_FLOAT) {
+ return rb_float_new((double)FIX2LONG(x) - RFLOAT(y)->value);
}
+ return rb_num_coerce_bin(x, y);
}
-#define SQRT_LONG_MAX ((SIGNED_VALUE)1<<((SIZEOF_LONG*CHAR_BIT-1)/2))
-/*tests if N*N would overflow*/
-#define FIT_SQRT_LONG(n) (((n)<SQRT_LONG_MAX)&&((n)>=-SQRT_LONG_MAX))
-
/*
* call-seq:
- * fix * numeric -> numeric_result
+ * fix * numeric => numeric_result
*
* Performs multiplication: the class of the resulting object depends on
* the class of <code>numeric</code> and on the magnitude of the
@@ -2166,53 +2151,39 @@ fix_minus(VALUE x, VALUE y)
*/
static VALUE
-fix_mul(VALUE x, VALUE y)
+fix_mul(x, y)
+ VALUE x, y;
{
if (FIXNUM_P(y)) {
#ifdef __HP_cc
-/* avoids an optimization bug of HP aC++/ANSI C B3910B A.06.05 [Jul 25 2005] */
- volatile
+ /* avoids an optimization bug of HP aC++/ANSI C B3910B A.06.05 [Jul 25 2005] */
+ volatile
#endif
- SIGNED_VALUE a, b;
-#if SIZEOF_VALUE * 2 <= SIZEOF_LONG_LONG
- LONG_LONG d;
-#else
- SIGNED_VALUE c;
+ long a, b, c;
VALUE r;
-#endif
a = FIX2LONG(x);
- b = FIX2LONG(y);
+ if (a == 0) return x;
-#if SIZEOF_VALUE * 2 <= SIZEOF_LONG_LONG
- d = (LONG_LONG)a * b;
- if (FIXABLE(d)) return LONG2FIX(d);
- return rb_ll2inum(d);
-#else
- if (FIT_SQRT_LONG(a) && FIT_SQRT_LONG(b))
- return LONG2FIX(a*b);
+ b = FIX2LONG(y);
c = a * b;
r = LONG2FIX(c);
- if (a == 0) return x;
if (FIX2LONG(r) != c || c/a != b) {
r = rb_big_mul(rb_int2big(a), rb_int2big(b));
}
return r;
-#endif
}
- switch (TYPE(y)) {
- case T_BIGNUM:
- return rb_big_mul(y, x);
- case T_FLOAT:
- return DBL2NUM((double)FIX2LONG(x) * RFLOAT_VALUE(y));
- default:
- return rb_num_coerce_bin(x, y, '*');
+ if (TYPE(y) == T_FLOAT) {
+ return rb_float_new((double)FIX2LONG(x) * RFLOAT(y)->value);
}
+ return rb_num_coerce_bin(x, y);
}
static void
-fixdivmod(long x, long y, long *divp, long *modp)
+fixdivmod(x, y, divp, modp)
+ long x, y;
+ long *divp, *modp;
{
long div, mod;
@@ -2240,75 +2211,31 @@ fixdivmod(long x, long y, long *divp, long *modp)
/*
* call-seq:
- * fix.fdiv(numeric) -> float
+ * fix.quo(numeric) => float
+ * fix.fdiv(numeric) => float
*
* Returns the floating point result of dividing <i>fix</i> by
* <i>numeric</i>.
*
- * 654321.fdiv(13731) #=> 47.6528293642124
- * 654321.fdiv(13731.24) #=> 47.6519964693647
+ * 654321.quo(13731) #=> 47.6528293642124
+ * 654321.quo(13731.24) #=> 47.6519964693647
*
*/
-VALUE rb_big_fdiv(VALUE x, VALUE y);
-
static VALUE
-fix_fdiv(VALUE x, VALUE y)
+fix_quo(x, y)
+ VALUE x, y;
{
if (FIXNUM_P(y)) {
- return DBL2NUM((double)FIX2LONG(x) / (double)FIX2LONG(y));
- }
- switch (TYPE(y)) {
- case T_BIGNUM:
- return rb_big_fdiv(rb_int2big(FIX2LONG(x)), y);
- case T_FLOAT:
- return DBL2NUM((double)FIX2LONG(x) / RFLOAT_VALUE(y));
- default:
- return rb_num_coerce_bin(x, y, rb_intern("fdiv"));
- }
-}
-
-VALUE rb_rational_reciprocal(VALUE x);
-
-static VALUE
-fix_divide(VALUE x, VALUE y, ID op)
-{
- if (FIXNUM_P(y)) {
- long div;
-
- fixdivmod(FIX2LONG(x), FIX2LONG(y), &div, 0);
- return LONG2NUM(div);
- }
- switch (TYPE(y)) {
- case T_BIGNUM:
- x = rb_int2big(FIX2LONG(x));
- return rb_big_div(x, y);
- case T_FLOAT:
- {
- double div;
-
- if (op == '/') {
- div = (double)FIX2LONG(x) / RFLOAT_VALUE(y);
- return DBL2NUM(div);
- }
- else {
- if (RFLOAT_VALUE(y) == 0) rb_num_zerodiv();
- div = (double)FIX2LONG(x) / RFLOAT_VALUE(y);
- return rb_dbl2big(floor(div));
- }
- }
- case T_RATIONAL:
- if (op == '/' && FIX2LONG(x) == 1)
- return rb_rational_reciprocal(y);
- return rb_funcall(rb_rational_new1(x), op, 1, y);
- default:
- return rb_num_coerce_bin(x, y, op);
+ return rb_float_new((double)FIX2LONG(x) / (double)FIX2LONG(y));
}
+ return rb_num_coerce_bin(x, y);
}
/*
* call-seq:
- * fix / numeric -> numeric_result
+ * fix / numeric => numeric_result
+ * fix.div(numeric) => numeric_result
*
* Performs division: the class of the resulting object depends on
* the class of <code>numeric</code> and on the magnitude of the
@@ -2316,35 +2243,30 @@ fix_divide(VALUE x, VALUE y, ID op)
*/
static VALUE
-fix_div(VALUE x, VALUE y)
+fix_div(x, y)
+ VALUE x, y;
{
- return fix_divide(x, y, '/');
-}
-
-/*
- * call-seq:
- * fix.div(numeric) -> integer
- *
- * Performs integer division: returns integer value.
- */
+ if (FIXNUM_P(y)) {
+ long div;
-static VALUE
-fix_idiv(VALUE x, VALUE y)
-{
- return fix_divide(x, y, rb_intern("div"));
+ fixdivmod(FIX2LONG(x), FIX2LONG(y), &div, 0);
+ return LONG2NUM(div);
+ }
+ return rb_num_coerce_bin(x, y);
}
/*
* call-seq:
- * fix % other -> real
- * fix.modulo(other) -> real
+ * fix % other => Numeric
+ * fix.modulo(other) => Numeric
*
* Returns <code>fix</code> modulo <code>other</code>.
- * See <code>numeric.divmod</code> for more information.
+ * See <code>Numeric.divmod</code> for more information.
*/
static VALUE
-fix_mod(VALUE x, VALUE y)
+fix_mod(x, y)
+ VALUE x, y;
{
if (FIXNUM_P(y)) {
long mod;
@@ -2352,30 +2274,18 @@ fix_mod(VALUE x, VALUE y)
fixdivmod(FIX2LONG(x), FIX2LONG(y), 0, &mod);
return LONG2NUM(mod);
}
- switch (TYPE(y)) {
- case T_BIGNUM:
- x = rb_int2big(FIX2LONG(x));
- return rb_big_modulo(x, y);
- case T_FLOAT:
- {
- double mod;
-
- flodivmod((double)FIX2LONG(x), RFLOAT_VALUE(y), 0, &mod);
- return DBL2NUM(mod);
- }
- default:
- return rb_num_coerce_bin(x, y, '%');
- }
+ return rb_num_coerce_bin(x, y);
}
/*
* call-seq:
- * fix.divmod(numeric) -> array
+ * fix.divmod(numeric) => array
*
* See <code>Numeric#divmod</code>.
*/
static VALUE
-fix_divmod(VALUE x, VALUE y)
+fix_divmod(x, y)
+ VALUE x, y;
{
if (FIXNUM_P(y)) {
long div, mod;
@@ -2384,27 +2294,13 @@ fix_divmod(VALUE x, VALUE y)
return rb_assoc_new(LONG2NUM(div), LONG2NUM(mod));
}
- switch (TYPE(y)) {
- case T_BIGNUM:
- x = rb_int2big(FIX2LONG(x));
- return rb_big_divmod(x, y);
- case T_FLOAT:
- {
- double div, mod;
- volatile VALUE a, b;
-
- flodivmod((double)FIX2LONG(x), RFLOAT_VALUE(y), &div, &mod);
- a = dbl2ival(div);
- b = DBL2NUM(mod);
- return rb_assoc_new(a, b);
- }
- default:
- return rb_num_coerce_bin(x, y, rb_intern("divmod"));
- }
+ return rb_num_coerce_bin(x, y);
}
static VALUE
-int_pow(long x, unsigned long y)
+int_pow(x, y)
+ long x;
+ unsigned long y;
{
int neg = x < 0;
long z = 1;
@@ -2417,14 +2313,15 @@ int_pow(long x, unsigned long y)
y &= ~1;
do {
while (y % 2 == 0) {
- if (!FIT_SQRT_LONG(x)) {
+ long x2 = x * x;
+ if (x2/x != x || !POSFIXABLE(x2)) {
VALUE v;
bignum:
v = rb_big_pow(rb_int2big(x), LONG2NUM(y));
if (z != 1) v = rb_big_mul(rb_int2big(neg ? -z : z), v);
return v;
}
- x = x * x;
+ x = x2;
y >>= 1;
}
{
@@ -2439,53 +2336,48 @@ int_pow(long x, unsigned long y)
return LONG2NUM(z);
}
-#define infinite_value() ruby_div0(1.0)
-
/*
* call-seq:
- * fix ** numeric -> numeric_result
+ * fix ** other => Numeric
*
- * Raises <code>fix</code> to the <code>numeric</code> power, which may
+ * Raises <code>fix</code> to the <code>other</code> power, which may
* be negative or fractional.
*
* 2 ** 3 #=> 8
* 2 ** -1 #=> 0.5
* 2 ** 0.5 #=> 1.4142135623731
- * (-8)**0.5 #=> NaN # try (-8)**Complex(0.5)
*/
static VALUE
-fix_pow(VALUE x, VALUE y)
+fix_pow(x, y)
+ VALUE x, y;
{
+ static const double zero = 0.0;
long a = FIX2LONG(x);
if (FIXNUM_P(y)) {
long b = FIX2LONG(y);
- if (b < 0)
- return rb_funcall(rb_rational_raw1(x), rb_intern("**"), 1, y);
-
if (b == 0) return INT2FIX(1);
if (b == 1) return x;
if (a == 0) {
if (b > 0) return INT2FIX(0);
- return DBL2NUM(infinite_value());
+ return rb_float_new(1.0 / zero);
}
if (a == 1) return INT2FIX(1);
if (a == -1) {
if (b % 2 == 0)
return INT2FIX(1);
- else
+ else
return INT2FIX(-1);
}
- return int_pow(a, b);
+ if (b > 0) {
+ return int_pow(a, b);
+ }
+ return rb_float_new(pow((double)a, (double)b));
}
switch (TYPE(y)) {
case T_BIGNUM:
-
- if (rb_funcall(y, '<', 1, INT2FIX(0)))
- return rb_funcall(rb_rational_raw1(x), rb_intern("**"), 1, y);
-
if (a == 0) return INT2FIX(0);
if (a == 1) return INT2FIX(1);
if (a == -1) {
@@ -2495,20 +2387,20 @@ fix_pow(VALUE x, VALUE y)
x = rb_int2big(FIX2LONG(x));
return rb_big_pow(x, y);
case T_FLOAT:
- if (RFLOAT_VALUE(y) == 0.0) return DBL2NUM(1.0);
+ if (RFLOAT(y)->value == 0.0) return rb_float_new(1.0);
if (a == 0) {
- return DBL2NUM(RFLOAT_VALUE(y) < 0 ? infinite_value() : 0.0);
+ return rb_float_new(RFLOAT(y)->value < 0 ? (1.0 / zero) : 0.0);
}
- if (a == 1) return DBL2NUM(1.0);
- return DBL2NUM(pow((double)a, RFLOAT_VALUE(y)));
+ if (a == 1) return rb_float_new(1.0);
+ return rb_float_new(pow((double)a, RFLOAT(y)->value));
default:
- return rb_num_coerce_bin(x, y, rb_intern("**"));
+ return rb_num_coerce_bin(x, y);
}
}
/*
* call-seq:
- * fix == other -> true or false
+ * fix == other
*
* Return <code>true</code> if <code>fix</code> equals <code>other</code>
* numerically.
@@ -2518,157 +2410,141 @@ fix_pow(VALUE x, VALUE y)
*/
static VALUE
-fix_equal(VALUE x, VALUE y)
+fix_equal(x, y)
+ VALUE x, y;
{
if (x == y) return Qtrue;
if (FIXNUM_P(y)) return Qfalse;
- switch (TYPE(y)) {
- case T_BIGNUM:
- return rb_big_eq(y, x);
- case T_FLOAT:
- return (double)FIX2LONG(x) == RFLOAT_VALUE(y) ? Qtrue : Qfalse;
- default:
- return num_equal(x, y);
- }
+ return num_equal(x, y);
}
/*
* call-seq:
- * fix <=> numeric -> -1, 0, +1 or nil
+ * fix <=> numeric => -1, 0, +1
*
- * Comparison---Returns -1, 0, +1 or nil depending on whether
- * <i>fix</i> is less than, equal to, or greater than
- * <i>numeric</i>. This is the basis for the tests in
- * <code>Comparable</code>.
+ * Comparison---Returns -1, 0, or +1 depending on whether <i>fix</i> is
+ * less than, equal to, or greater than <i>numeric</i>. This is the
+ * basis for the tests in <code>Comparable</code>.
*/
static VALUE
-fix_cmp(VALUE x, VALUE y)
+fix_cmp(x, y)
+ VALUE x, y;
{
if (x == y) return INT2FIX(0);
if (FIXNUM_P(y)) {
- if (FIX2LONG(x) > FIX2LONG(y)) return INT2FIX(1);
+ long a = FIX2LONG(x), b = FIX2LONG(y);
+
+ if (a > b) return INT2FIX(1);
return INT2FIX(-1);
}
- switch (TYPE(y)) {
- case T_BIGNUM:
- return rb_big_cmp(rb_int2big(FIX2LONG(x)), y);
- case T_FLOAT:
- return rb_dbl_cmp((double)FIX2LONG(x), RFLOAT_VALUE(y));
- default:
- return rb_num_coerce_cmp(x, y, rb_intern("<=>"));
+ else {
+ return rb_num_coerce_cmp(x, y);
}
}
/*
* call-seq:
- * fix > real -> true or false
+ * fix > other => true or false
*
* Returns <code>true</code> if the value of <code>fix</code> is
- * greater than that of <code>real</code>.
+ * greater than that of <code>other</code>.
*/
static VALUE
-fix_gt(VALUE x, VALUE y)
+fix_gt(x, y)
+ VALUE x, y;
{
if (FIXNUM_P(y)) {
- if (FIX2LONG(x) > FIX2LONG(y)) return Qtrue;
+ long a = FIX2LONG(x), b = FIX2LONG(y);
+
+ if (a > b) return Qtrue;
return Qfalse;
}
- switch (TYPE(y)) {
- case T_BIGNUM:
- return FIX2INT(rb_big_cmp(rb_int2big(FIX2LONG(x)), y)) > 0 ? Qtrue : Qfalse;
- case T_FLOAT:
- return (double)FIX2LONG(x) > RFLOAT_VALUE(y) ? Qtrue : Qfalse;
- default:
- return rb_num_coerce_relop(x, y, '>');
+ else {
+ return rb_num_coerce_relop(x, y);
}
}
/*
* call-seq:
- * fix >= real -> true or false
+ * fix >= other => true or false
*
* Returns <code>true</code> if the value of <code>fix</code> is
- * greater than or equal to that of <code>real</code>.
+ * greater than or equal to that of <code>other</code>.
*/
static VALUE
-fix_ge(VALUE x, VALUE y)
+fix_ge(x, y)
+ VALUE x, y;
{
if (FIXNUM_P(y)) {
- if (FIX2LONG(x) >= FIX2LONG(y)) return Qtrue;
+ long a = FIX2LONG(x), b = FIX2LONG(y);
+
+ if (a >= b) return Qtrue;
return Qfalse;
}
- switch (TYPE(y)) {
- case T_BIGNUM:
- return FIX2INT(rb_big_cmp(rb_int2big(FIX2LONG(x)), y)) >= 0 ? Qtrue : Qfalse;
- case T_FLOAT:
- return (double)FIX2LONG(x) >= RFLOAT_VALUE(y) ? Qtrue : Qfalse;
- default:
- return rb_num_coerce_relop(x, y, rb_intern(">="));
+ else {
+ return rb_num_coerce_relop(x, y);
}
}
/*
* call-seq:
- * fix < real -> true or false
+ * fix < other => true or false
*
* Returns <code>true</code> if the value of <code>fix</code> is
- * less than that of <code>real</code>.
+ * less than that of <code>other</code>.
*/
static VALUE
-fix_lt(VALUE x, VALUE y)
+fix_lt(x, y)
+ VALUE x, y;
{
if (FIXNUM_P(y)) {
- if (FIX2LONG(x) < FIX2LONG(y)) return Qtrue;
+ long a = FIX2LONG(x), b = FIX2LONG(y);
+
+ if (a < b) return Qtrue;
return Qfalse;
}
- switch (TYPE(y)) {
- case T_BIGNUM:
- return FIX2INT(rb_big_cmp(rb_int2big(FIX2LONG(x)), y)) < 0 ? Qtrue : Qfalse;
- case T_FLOAT:
- return (double)FIX2LONG(x) < RFLOAT_VALUE(y) ? Qtrue : Qfalse;
- default:
- return rb_num_coerce_relop(x, y, '<');
+ else {
+ return rb_num_coerce_relop(x, y);
}
}
/*
* call-seq:
- * fix <= rael -> true or false
+ * fix <= other => true or false
*
* Returns <code>true</code> if the value of <code>fix</code> is
- * less than or equal to that of <code>real</code>.
+ * less thanor equal to that of <code>other</code>.
*/
static VALUE
-fix_le(VALUE x, VALUE y)
+fix_le(x, y)
+ VALUE x, y;
{
if (FIXNUM_P(y)) {
- if (FIX2LONG(x) <= FIX2LONG(y)) return Qtrue;
+ long a = FIX2LONG(x), b = FIX2LONG(y);
+
+ if (a <= b) return Qtrue;
return Qfalse;
}
- switch (TYPE(y)) {
- case T_BIGNUM:
- return FIX2INT(rb_big_cmp(rb_int2big(FIX2LONG(x)), y)) <= 0 ? Qtrue : Qfalse;
- case T_FLOAT:
- return (double)FIX2LONG(x) <= RFLOAT_VALUE(y) ? Qtrue : Qfalse;
- default:
- return rb_num_coerce_relop(x, y, rb_intern("<="));
+ else {
+ return rb_num_coerce_relop(x, y);
}
}
/*
* call-seq:
- * ~fix -> integer
+ * ~fix => integer
*
* One's complement: returns a number where each bit is flipped.
*/
static VALUE
-fix_rev(VALUE num)
+fix_rev(num)
+ VALUE num;
{
long val = FIX2LONG(num);
@@ -2677,12 +2553,10 @@ fix_rev(VALUE num)
}
static VALUE
-bit_coerce(VALUE x)
+fix_coerce(x)
+ VALUE x;
{
while (!FIXNUM_P(x) && TYPE(x) != T_BIGNUM) {
- if (TYPE(x) == T_FLOAT) {
- rb_raise(rb_eTypeError, "can't convert Float into Integer");
- }
x = rb_to_int(x);
}
return x;
@@ -2690,17 +2564,18 @@ bit_coerce(VALUE x)
/*
* call-seq:
- * fix & integer -> integer_result
+ * fix & other => integer
*
* Bitwise AND.
*/
static VALUE
-fix_and(VALUE x, VALUE y)
+fix_and(x, y)
+ VALUE x, y;
{
long val;
- if (!FIXNUM_P(y = bit_coerce(y))) {
+ if (!FIXNUM_P(y = fix_coerce(y))) {
return rb_big_and(y, x);
}
val = FIX2LONG(x) & FIX2LONG(y);
@@ -2709,17 +2584,18 @@ fix_and(VALUE x, VALUE y)
/*
* call-seq:
- * fix | integer -> integer_result
+ * fix | other => integer
*
* Bitwise OR.
*/
static VALUE
-fix_or(VALUE x, VALUE y)
+fix_or(x, y)
+ VALUE x, y;
{
long val;
- if (!FIXNUM_P(y = bit_coerce(y))) {
+ if (!FIXNUM_P(y = fix_coerce(y))) {
return rb_big_or(y, x);
}
val = FIX2LONG(x) | FIX2LONG(y);
@@ -2728,35 +2604,37 @@ fix_or(VALUE x, VALUE y)
/*
* call-seq:
- * fix ^ integer -> integer_result
+ * fix ^ other => integer
*
* Bitwise EXCLUSIVE OR.
*/
static VALUE
-fix_xor(VALUE x, VALUE y)
+fix_xor(x, y)
+ VALUE x, y;
{
long val;
- if (!FIXNUM_P(y = bit_coerce(y))) {
+ if (!FIXNUM_P(y = fix_coerce(y))) {
return rb_big_xor(y, x);
}
val = FIX2LONG(x) ^ FIX2LONG(y);
return LONG2NUM(val);
}
-static VALUE fix_lshift(long, unsigned long);
-static VALUE fix_rshift(long, unsigned long);
+static VALUE fix_lshift _((long, unsigned long));
+static VALUE fix_rshift _((long, unsigned long));
/*
* call-seq:
- * fix << count -> integer
+ * fix << count => integer
*
* Shifts _fix_ left _count_ positions (right if _count_ is negative).
*/
static VALUE
-rb_fix_lshift(VALUE x, VALUE y)
+rb_fix_lshift(x, y)
+ VALUE x, y;
{
long val, width;
@@ -2770,10 +2648,12 @@ rb_fix_lshift(VALUE x, VALUE y)
}
static VALUE
-fix_lshift(long val, unsigned long width)
+fix_lshift(val, width)
+ long val;
+ unsigned long width;
{
- if (width > (SIZEOF_LONG*CHAR_BIT-1)
- || ((unsigned long)val)>>(SIZEOF_LONG*CHAR_BIT-1-width) > 0) {
+ if (width > (sizeof(VALUE)*CHAR_BIT-1)
+ || ((unsigned long)val)>>(sizeof(VALUE)*CHAR_BIT-1-width) > 0) {
return rb_big_lshift(rb_int2big(val), ULONG2NUM(width));
}
val = val << width;
@@ -2782,13 +2662,14 @@ fix_lshift(long val, unsigned long width)
/*
* call-seq:
- * fix >> count -> integer
+ * fix >> count => integer
*
* Shifts _fix_ right _count_ positions (left if _count_ is negative).
*/
static VALUE
-rb_fix_rshift(VALUE x, VALUE y)
+rb_fix_rshift(x, y)
+ VALUE x, y;
{
long i, val;
@@ -2815,7 +2696,7 @@ fix_rshift(long val, unsigned long i)
/*
* call-seq:
- * fix[n] -> 0, 1
+ * fix[n] => 0, 1
*
* Bit Reference---Returns the <em>n</em>th bit in the binary
* representation of <i>fix</i>, where <i>fix</i>[0] is the least
@@ -2830,16 +2711,16 @@ fix_rshift(long val, unsigned long i)
*/
static VALUE
-fix_aref(VALUE fix, VALUE idx)
+fix_aref(fix, idx)
+ VALUE fix, idx;
{
long val = FIX2LONG(fix);
long i;
- idx = rb_to_int(idx);
- if (!FIXNUM_P(idx)) {
+ if (!FIXNUM_P(idx = fix_coerce(idx))) {
idx = rb_big_norm(idx);
if (!FIXNUM_P(idx)) {
- if (!RBIGNUM_SIGN(idx) || val >= 0)
+ if (!RBIGNUM(idx)->sign || val >= 0)
return INT2FIX(0);
return INT2FIX(1);
}
@@ -2847,7 +2728,7 @@ fix_aref(VALUE fix, VALUE idx)
i = FIX2LONG(idx);
if (i < 0) return INT2FIX(0);
- if (SIZEOF_LONG*CHAR_BIT-1 < i) {
+ if (sizeof(VALUE)*CHAR_BIT-1 < i) {
if (val < 0) return INT2FIX(1);
return INT2FIX(0);
}
@@ -2858,26 +2739,26 @@ fix_aref(VALUE fix, VALUE idx)
/*
* call-seq:
- * fix.to_f -> float
+ * fix.to_f -> float
*
* Converts <i>fix</i> to a <code>Float</code>.
*
*/
static VALUE
-fix_to_f(VALUE num)
+fix_to_f(num)
+ VALUE num;
{
double val;
val = (double)FIX2LONG(num);
- return DBL2NUM(val);
+ return rb_float_new(val);
}
/*
* call-seq:
- * fix.abs -> integer
- * fix.magnitude -> integer
+ * fix.abs -> aFixnum
*
* Returns the absolute value of <i>fix</i>.
*
@@ -2887,7 +2768,8 @@ fix_to_f(VALUE num)
*/
static VALUE
-fix_abs(VALUE fix)
+fix_abs(fix)
+ VALUE fix;
{
long i = FIX2LONG(fix);
@@ -2896,11 +2778,59 @@ fix_abs(VALUE fix)
return LONG2NUM(i);
}
+/*
+ * call-seq:
+ * fix.id2name -> string or nil
+ *
+ * Returns the name of the object whose symbol id is <i>fix</i>. If
+ * there is no symbol in the symbol table with this value, returns
+ * <code>nil</code>. <code>id2name</code> has nothing to do with the
+ * <code>Object.id</code> method. See also <code>Fixnum#to_sym</code>,
+ * <code>String#intern</code>, and class <code>Symbol</code>.
+ *
+ * symbol = :@inst_var #=> :@inst_var
+ * id = symbol.to_i #=> 9818
+ * id.id2name #=> "@inst_var"
+ */
+
+static VALUE
+fix_id2name(fix)
+ VALUE fix;
+{
+ const char *name = rb_id2name(FIX2UINT(fix));
+ if (name) return rb_str_new2(name);
+ return Qnil;
+}
/*
* call-seq:
- * fix.size -> fixnum
+ * fix.to_sym -> aSymbol
+ *
+ * Returns the symbol whose integer value is <i>fix</i>. See also
+ * <code>Fixnum#id2name</code>.
+ *
+ * fred = :fred.to_i
+ * fred.id2name #=> "fred"
+ * fred.to_sym #=> :fred
+ */
+
+static VALUE
+fix_to_sym(fix)
+ VALUE fix;
+{
+ ID id = FIX2UINT(fix);
+
+ if (rb_id2name(id)) {
+ return ID2SYM(id);
+ }
+ return Qnil;
+}
+
+
+/*
+ * call-seq:
+ * fix.size -> fixnum
*
* Returns the number of <em>bytes</em> in the machine representation
* of a <code>Fixnum</code>.
@@ -2911,15 +2841,15 @@ fix_abs(VALUE fix)
*/
static VALUE
-fix_size(VALUE fix)
+fix_size(fix)
+ VALUE fix;
{
return INT2FIX(sizeof(long));
}
/*
* call-seq:
- * int.upto(limit) {|i| block } -> self
- * int.upto(limit) -> enumerator
+ * int.upto(limit) {|i| block } => int
*
* Iterates <em>block</em>, passing in integer values from <i>int</i>
* up to and including <i>limit</i>.
@@ -2932,9 +2862,11 @@ fix_size(VALUE fix)
*/
static VALUE
-int_upto(VALUE from, VALUE to)
+int_upto(from, to)
+ VALUE from, to;
{
RETURN_ENUMERATOR(from, 1, &to);
+
if (FIXNUM_P(from) && FIXNUM_P(to)) {
long i, end;
@@ -2957,8 +2889,7 @@ int_upto(VALUE from, VALUE to)
/*
* call-seq:
- * int.downto(limit) {|i| block } -> self
- * int.downto(limit) -> enumerator
+ * int.downto(limit) {|i| block } => int
*
* Iterates <em>block</em>, passing decreasing values from <i>int</i>
* down to and including <i>limit</i>.
@@ -2972,9 +2903,11 @@ int_upto(VALUE from, VALUE to)
*/
static VALUE
-int_downto(VALUE from, VALUE to)
+int_downto(from, to)
+ VALUE from, to;
{
RETURN_ENUMERATOR(from, 1, &to);
+
if (FIXNUM_P(from) && FIXNUM_P(to)) {
long i, end;
@@ -2997,8 +2930,7 @@ int_downto(VALUE from, VALUE to)
/*
* call-seq:
- * int.times {|i| block } -> self
- * int.times -> enumerator
+ * int.times {|i| block } => int
*
* Iterates block <i>int</i> times, passing in values from zero to
* <i>int</i> - 1.
@@ -3013,7 +2945,8 @@ int_downto(VALUE from, VALUE to)
*/
static VALUE
-int_dotimes(VALUE num)
+int_dotimes(num)
+ VALUE num;
{
RETURN_ENUMERATOR(num, 0, 0);
@@ -3037,53 +2970,17 @@ int_dotimes(VALUE num)
return num;
}
-static VALUE
-int_round(int argc, VALUE* argv, VALUE num)
-{
- VALUE n, f, h, r;
- int ndigits;
-
- if (argc == 0) return num;
- rb_scan_args(argc, argv, "1", &n);
- ndigits = NUM2INT(n);
- if (ndigits > 0) {
- return rb_Float(num);
- }
- if (ndigits == 0) {
- return num;
- }
- ndigits = -ndigits;
- if (ndigits < 0) {
- rb_raise(rb_eArgError, "ndigits out of range");
- }
- f = int_pow(10, ndigits);
- if (FIXNUM_P(num) && FIXNUM_P(f)) {
- SIGNED_VALUE x = FIX2LONG(num), y = FIX2LONG(f);
- int neg = x < 0;
- if (neg) x = -x;
- x = (x + y / 2) / y * y;
- if (neg) x = -x;
- return LONG2NUM(x);
- }
- h = rb_funcall(f, '/', 1, INT2FIX(2));
- r = rb_funcall(num, '%', 1, f);
- n = rb_funcall(num, '-', 1, r);
- if (!RTEST(rb_funcall(r, '<', 1, h))) {
- n = rb_funcall(n, '+', 1, f);
- }
- return n;
-}
-
/*
* call-seq:
- * fix.zero? -> true or false
+ * fix.zero? => true or false
*
* Returns <code>true</code> if <i>fix</i> is zero.
*
*/
static VALUE
-fix_zero_p(VALUE num)
+fix_zero_p(num)
+ VALUE num;
{
if (FIX2LONG(num) == 0) {
return Qtrue;
@@ -3093,7 +2990,7 @@ fix_zero_p(VALUE num)
/*
* call-seq:
- * fix.odd? -> true or false
+ * fix.odd? -> true or false
*
* Returns <code>true</code> if <i>fix</i> is an odd number.
*/
@@ -3102,14 +2999,14 @@ static VALUE
fix_odd_p(VALUE num)
{
if (num & 2) {
- return Qtrue;
+ return Qtrue;
}
return Qfalse;
}
/*
* call-seq:
- * fix.even? -> true or false
+ * fix.even? -> true or false
*
* Returns <code>true</code> if <i>fix</i> is an even number.
*/
@@ -3118,17 +3015,14 @@ static VALUE
fix_even_p(VALUE num)
{
if (num & 2) {
- return Qfalse;
+ return Qfalse;
}
return Qtrue;
}
void
-Init_Numeric(void)
+Init_Numeric()
{
-#undef rb_intern
-#define rb_intern(str) rb_intern_const(str)
-
#if defined(__FreeBSD__) && __FreeBSD__ < 4
/* allow divide by zero -- Inf */
fpsetmask(fpgetmask() & ~(FP_X_DZ|FP_X_INV|FP_X_OFL));
@@ -3157,24 +3051,21 @@ Init_Numeric(void)
rb_define_method(rb_cNumeric, "<=>", num_cmp, 1);
rb_define_method(rb_cNumeric, "eql?", num_eql, 1);
rb_define_method(rb_cNumeric, "quo", num_quo, 1);
- rb_define_method(rb_cNumeric, "fdiv", num_fdiv, 1);
+ rb_define_method(rb_cNumeric, "fdiv", num_quo, 1);
rb_define_method(rb_cNumeric, "div", num_div, 1);
rb_define_method(rb_cNumeric, "divmod", num_divmod, 1);
- rb_define_method(rb_cNumeric, "%", num_modulo, 1);
rb_define_method(rb_cNumeric, "modulo", num_modulo, 1);
rb_define_method(rb_cNumeric, "remainder", num_remainder, 1);
rb_define_method(rb_cNumeric, "abs", num_abs, 0);
- rb_define_method(rb_cNumeric, "magnitude", num_abs, 0);
rb_define_method(rb_cNumeric, "to_int", num_to_int, 0);
- rb_define_method(rb_cNumeric, "real?", num_real_p, 0);
rb_define_method(rb_cNumeric, "integer?", num_int_p, 0);
rb_define_method(rb_cNumeric, "zero?", num_zero_p, 0);
rb_define_method(rb_cNumeric, "nonzero?", num_nonzero_p, 0);
rb_define_method(rb_cNumeric, "floor", num_floor, 0);
rb_define_method(rb_cNumeric, "ceil", num_ceil, 0);
- rb_define_method(rb_cNumeric, "round", num_round, -1);
+ rb_define_method(rb_cNumeric, "round", num_round, 0);
rb_define_method(rb_cNumeric, "truncate", num_truncate, 0);
rb_define_method(rb_cNumeric, "step", num_step, -1);
@@ -3188,36 +3079,43 @@ Init_Numeric(void)
rb_define_method(rb_cInteger, "upto", int_upto, 1);
rb_define_method(rb_cInteger, "downto", int_downto, 1);
rb_define_method(rb_cInteger, "times", int_dotimes, 0);
+ rb_include_module(rb_cInteger, rb_mPrecision);
rb_define_method(rb_cInteger, "succ", int_succ, 0);
rb_define_method(rb_cInteger, "next", int_succ, 0);
rb_define_method(rb_cInteger, "pred", int_pred, 0);
- rb_define_method(rb_cInteger, "chr", int_chr, -1);
+ rb_define_method(rb_cInteger, "chr", int_chr, 0);
rb_define_method(rb_cInteger, "ord", int_ord, 0);
rb_define_method(rb_cInteger, "to_i", int_to_i, 0);
rb_define_method(rb_cInteger, "to_int", int_to_i, 0);
rb_define_method(rb_cInteger, "floor", int_to_i, 0);
rb_define_method(rb_cInteger, "ceil", int_to_i, 0);
+ rb_define_method(rb_cInteger, "round", int_to_i, 0);
rb_define_method(rb_cInteger, "truncate", int_to_i, 0);
- rb_define_method(rb_cInteger, "round", int_round, -1);
rb_cFixnum = rb_define_class("Fixnum", rb_cInteger);
+ rb_include_module(rb_cFixnum, rb_mPrecision);
+ rb_define_singleton_method(rb_cFixnum, "induced_from", rb_fix_induced_from, 1);
+ rb_define_singleton_method(rb_cInteger, "induced_from", rb_int_induced_from, 1);
rb_define_method(rb_cFixnum, "to_s", fix_to_s, -1);
+ rb_define_method(rb_cFixnum, "id2name", fix_id2name, 0);
+ rb_define_method(rb_cFixnum, "to_sym", fix_to_sym, 0);
+
rb_define_method(rb_cFixnum, "-@", fix_uminus, 0);
rb_define_method(rb_cFixnum, "+", fix_plus, 1);
rb_define_method(rb_cFixnum, "-", fix_minus, 1);
rb_define_method(rb_cFixnum, "*", fix_mul, 1);
rb_define_method(rb_cFixnum, "/", fix_div, 1);
- rb_define_method(rb_cFixnum, "div", fix_idiv, 1);
+ rb_define_method(rb_cFixnum, "div", fix_div, 1);
rb_define_method(rb_cFixnum, "%", fix_mod, 1);
rb_define_method(rb_cFixnum, "modulo", fix_mod, 1);
rb_define_method(rb_cFixnum, "divmod", fix_divmod, 1);
- rb_define_method(rb_cFixnum, "fdiv", fix_fdiv, 1);
+ rb_define_method(rb_cFixnum, "quo", fix_quo, 1);
+ rb_define_method(rb_cFixnum, "fdiv", fix_quo, 1);
rb_define_method(rb_cFixnum, "**", fix_pow, 1);
rb_define_method(rb_cFixnum, "abs", fix_abs, 0);
- rb_define_method(rb_cFixnum, "magnitude", fix_abs, 0);
rb_define_method(rb_cFixnum, "==", fix_equal, 1);
rb_define_method(rb_cFixnum, "<=>", fix_cmp, 1);
@@ -3240,13 +3138,15 @@ Init_Numeric(void)
rb_define_method(rb_cFixnum, "zero?", fix_zero_p, 0);
rb_define_method(rb_cFixnum, "odd?", fix_odd_p, 0);
rb_define_method(rb_cFixnum, "even?", fix_even_p, 0);
- rb_define_method(rb_cFixnum, "succ", fix_succ, 0);
rb_cFloat = rb_define_class("Float", rb_cNumeric);
rb_undef_alloc_func(rb_cFloat);
rb_undef_method(CLASS_OF(rb_cFloat), "new");
+ rb_define_singleton_method(rb_cFloat, "induced_from", rb_flo_induced_from, 1);
+ rb_include_module(rb_cFloat, rb_mPrecision);
+
rb_define_const(rb_cFloat, "ROUNDS", INT2FIX(FLT_ROUNDS));
rb_define_const(rb_cFloat, "RADIX", INT2FIX(FLT_RADIX));
rb_define_const(rb_cFloat, "MANT_DIG", INT2FIX(DBL_MANT_DIG));
@@ -3255,9 +3155,9 @@ Init_Numeric(void)
rb_define_const(rb_cFloat, "MAX_EXP", INT2FIX(DBL_MAX_EXP));
rb_define_const(rb_cFloat, "MIN_10_EXP", INT2FIX(DBL_MIN_10_EXP));
rb_define_const(rb_cFloat, "MAX_10_EXP", INT2FIX(DBL_MAX_10_EXP));
- rb_define_const(rb_cFloat, "MIN", DBL2NUM(DBL_MIN));
- rb_define_const(rb_cFloat, "MAX", DBL2NUM(DBL_MAX));
- rb_define_const(rb_cFloat, "EPSILON", DBL2NUM(DBL_EPSILON));
+ rb_define_const(rb_cFloat, "MIN", rb_float_new(DBL_MIN));
+ rb_define_const(rb_cFloat, "MAX", rb_float_new(DBL_MAX));
+ rb_define_const(rb_cFloat, "EPSILON", rb_float_new(DBL_EPSILON));
rb_define_method(rb_cFloat, "to_s", flo_to_s, 0);
rb_define_method(rb_cFloat, "coerce", flo_coerce, 1);
@@ -3266,8 +3166,6 @@ Init_Numeric(void)
rb_define_method(rb_cFloat, "-", flo_minus, 1);
rb_define_method(rb_cFloat, "*", flo_mul, 1);
rb_define_method(rb_cFloat, "/", flo_div, 1);
- rb_define_method(rb_cFloat, "quo", flo_quo, 1);
- rb_define_method(rb_cFloat, "fdiv", flo_quo, 1);
rb_define_method(rb_cFloat, "%", flo_mod, 1);
rb_define_method(rb_cFloat, "modulo", flo_mod, 1);
rb_define_method(rb_cFloat, "divmod", flo_divmod, 1);
@@ -3282,14 +3180,13 @@ Init_Numeric(void)
rb_define_method(rb_cFloat, "hash", flo_hash, 0);
rb_define_method(rb_cFloat, "to_f", flo_to_f, 0);
rb_define_method(rb_cFloat, "abs", flo_abs, 0);
- rb_define_method(rb_cFloat, "magnitude", flo_abs, 0);
rb_define_method(rb_cFloat, "zero?", flo_zero_p, 0);
rb_define_method(rb_cFloat, "to_i", flo_truncate, 0);
rb_define_method(rb_cFloat, "to_int", flo_truncate, 0);
rb_define_method(rb_cFloat, "floor", flo_floor, 0);
rb_define_method(rb_cFloat, "ceil", flo_ceil, 0);
- rb_define_method(rb_cFloat, "round", flo_round, -1);
+ rb_define_method(rb_cFloat, "round", flo_round, 0);
rb_define_method(rb_cFloat, "truncate", flo_truncate, 0);
rb_define_method(rb_cFloat, "nan?", flo_is_nan_p, 0);
diff --git a/object.c b/object.c
index d86c6e49d4..75153b843a 100644
--- a/object.c
+++ b/object.c
@@ -3,24 +3,23 @@
object.c -
$Author$
+ $Date$
created at: Thu Jul 15 12:01:24 JST 1993
- Copyright (C) 1993-2007 Yukihiro Matsumoto
+ Copyright (C) 1993-2003 Yukihiro Matsumoto
Copyright (C) 2000 Network Applied Communication Laboratory, Inc.
Copyright (C) 2000 Information-technology Promotion Agency, Japan
**********************************************************************/
-#include "ruby/ruby.h"
-#include "ruby/st.h"
-#include "ruby/util.h"
+#include "ruby.h"
+#include "st.h"
+#include "util.h"
#include <stdio.h>
#include <errno.h>
#include <ctype.h>
#include <math.h>
-#include <float.h>
-VALUE rb_cBasicObject;
VALUE rb_mKernel;
VALUE rb_cObject;
VALUE rb_cModule;
@@ -30,20 +29,22 @@ VALUE rb_cData;
VALUE rb_cNilClass;
VALUE rb_cTrueClass;
VALUE rb_cFalseClass;
+VALUE rb_cSymbol;
-static ID id_eq, id_eql, id_match, id_inspect, id_init_copy;
+static ID id_eq, id_eql, id_inspect, id_init_copy;
/*
* call-seq:
* obj === other => true or false
- *
+ *
* Case Equality---For class <code>Object</code>, effectively the same
* as calling <code>#==</code>, but typically overridden by descendents
* to provide meaningful semantics in <code>case</code> statements.
*/
VALUE
-rb_equal(VALUE obj1, VALUE obj2)
+rb_equal(obj1, obj2)
+ VALUE obj1, obj2;
{
VALUE result;
@@ -54,7 +55,8 @@ rb_equal(VALUE obj1, VALUE obj2)
}
int
-rb_eql(VALUE obj1, VALUE obj2)
+rb_eql(obj1, obj2)
+ VALUE obj1, obj2;
{
return RTEST(rb_funcall(obj1, id_eql, 1, obj2));
}
@@ -64,7 +66,7 @@ rb_eql(VALUE obj1, VALUE obj2)
* obj == other => true or false
* obj.equal?(other) => true or false
* obj.eql?(other) => true or false
- *
+ *
* Equality---At the <code>Object</code> level, <code>==</code> returns
* <code>true</code> only if <i>obj</i> and <i>other</i> are the
* same object. Typically, this method is overridden in descendent
@@ -76,133 +78,112 @@ rb_eql(VALUE obj1, VALUE obj2)
* object as <code>b</code>).
*
* The <code>eql?</code> method returns <code>true</code> if
- * <i>obj</i> and <i>anObject</i> have the same value. Used by
- * <code>Hash</code> to test members for equality. For objects of
- * class <code>Object</code>, <code>eql?</code> is synonymous with
- * <code>==</code>. Subclasses normally continue this tradition, but
- * there are exceptions. <code>Numeric</code> types, for example,
- * perform type conversion across <code>==</code>, but not across
- * <code>eql?</code>, so:
- *
+ <i>obj</i> and <i>anObject</i> have the
+ * same value. Used by <code>Hash</code> to test members for equality.
+ * For objects of class <code>Object</code>, <code>eql?</code> is
+ * synonymous with <code>==</code>. Subclasses normally continue this
+ * tradition, but there are exceptions. <code>Numeric</code> types, for
+ * example, perform type conversion across <code>==</code>, but not
+ * across <code>eql?</code>, so:
+ *
* 1 == 1.0 #=> true
* 1.eql? 1.0 #=> false
*/
-VALUE
-rb_obj_equal(VALUE obj1, VALUE obj2)
+static VALUE
+rb_obj_equal(obj1, obj2)
+ VALUE obj1, obj2;
{
if (obj1 == obj2) return Qtrue;
return Qfalse;
}
-VALUE
-rb_obj_hash(VALUE obj)
-{
- VALUE oid = rb_obj_id(obj);
- unsigned h = rb_hash_end(rb_hash_start(NUM2LONG(oid)));
- return LONG2NUM(h);
-}
-
/*
* call-seq:
- * !obj => true or false
- *
- * Boolean negate.
+ * obj.id => fixnum
+ *
+ * Soon-to-be deprecated version of <code>Object#object_id</code>.
*/
VALUE
-rb_obj_not(VALUE obj)
+rb_obj_id_obsolete(obj)
+ VALUE obj;
+{
+ rb_warn("Object#id will be deprecated; use Object#object_id");
+ return rb_obj_id(obj);
+}
+
+VALUE
+rb_class_real(cl)
+ VALUE cl;
{
- return RTEST(obj) ? Qfalse : Qtrue;
+ while (FL_TEST(cl, FL_SINGLETON) || TYPE(cl) == T_ICLASS) {
+ cl = RCLASS(cl)->super;
+ }
+ return cl;
}
/*
* call-seq:
- * obj != other => true or false
- *
- * Returns true if two objects are not-equal, otherwise false.
+ * obj.type => class
+ *
+ * Deprecated synonym for <code>Object#class</code>.
*/
VALUE
-rb_obj_not_equal(VALUE obj1, VALUE obj2)
+rb_obj_type(obj)
+ VALUE obj;
{
- VALUE result = rb_funcall(obj1, id_eq, 1, obj2);
- return RTEST(result) ? Qfalse : Qtrue;
+ rb_warn("Object#type is deprecated; use Object#class");
+ return rb_class_real(CLASS_OF(obj));
}
-VALUE
-rb_class_real(VALUE cl)
-{
- if (cl == 0)
- return 0;
- while ((RBASIC(cl)->flags & FL_SINGLETON) || BUILTIN_TYPE(cl) == T_ICLASS) {
- cl = RCLASS_SUPER(cl);
- }
- return cl;
-}
/*
* call-seq:
* obj.class => class
- *
+ *
* Returns the class of <i>obj</i>, now preferred over
* <code>Object#type</code>, as an object's type in Ruby is only
* loosely tied to that object's class. This method must always be
* called with an explicit receiver, as <code>class</code> is also a
* reserved word in Ruby.
- *
+ *
* 1.class #=> Fixnum
* self.class #=> Object
*/
VALUE
-rb_obj_class(VALUE obj)
+rb_obj_class(obj)
+ VALUE obj;
{
return rb_class_real(CLASS_OF(obj));
}
static void
-init_copy(VALUE dest, VALUE obj)
+init_copy(dest, obj)
+ VALUE dest, obj;
{
if (OBJ_FROZEN(dest)) {
rb_raise(rb_eTypeError, "[bug] frozen object (%s) allocated", rb_obj_classname(dest));
}
RBASIC(dest)->flags &= ~(T_MASK|FL_EXIVAR);
- RBASIC(dest)->flags |= RBASIC(obj)->flags & (T_MASK|FL_EXIVAR|FL_TAINT|FL_UNTRUSTED);
- rb_copy_generic_ivar(dest, obj);
+ RBASIC(dest)->flags |= RBASIC(obj)->flags & (T_MASK|FL_EXIVAR|FL_TAINT);
+ if (FL_TEST(obj, FL_EXIVAR)) {
+ rb_copy_generic_ivar(dest, obj);
+ }
rb_gc_copy_finalizer(dest, obj);
switch (TYPE(obj)) {
case T_OBJECT:
- if (!(RBASIC(dest)->flags & ROBJECT_EMBED) && ROBJECT_IVPTR(dest)) {
- xfree(ROBJECT_IVPTR(dest));
- ROBJECT(dest)->as.heap.ivptr = 0;
- ROBJECT(dest)->as.heap.numiv = 0;
- ROBJECT(dest)->as.heap.iv_index_tbl = 0;
- }
- if (RBASIC(obj)->flags & ROBJECT_EMBED) {
- MEMCPY(ROBJECT(dest)->as.ary, ROBJECT(obj)->as.ary, VALUE, ROBJECT_EMBED_LEN_MAX);
- RBASIC(dest)->flags |= ROBJECT_EMBED;
- }
- else {
- long len = ROBJECT(obj)->as.heap.numiv;
- VALUE *ptr = ALLOC_N(VALUE, len);
- MEMCPY(ptr, ROBJECT(obj)->as.heap.ivptr, VALUE, len);
- ROBJECT(dest)->as.heap.ivptr = ptr;
- ROBJECT(dest)->as.heap.numiv = len;
- ROBJECT(dest)->as.heap.iv_index_tbl = ROBJECT(obj)->as.heap.iv_index_tbl;
- RBASIC(dest)->flags &= ~ROBJECT_EMBED;
- }
- break;
case T_CLASS:
case T_MODULE:
- if (RCLASS_IV_TBL(dest)) {
- st_free_table(RCLASS_IV_TBL(dest));
- RCLASS_IV_TBL(dest) = 0;
+ if (ROBJECT(dest)->iv_tbl) {
+ st_free_table(ROBJECT(dest)->iv_tbl);
+ ROBJECT(dest)->iv_tbl = 0;
}
- if (RCLASS_IV_TBL(obj)) {
- RCLASS_IV_TBL(dest) = st_copy(RCLASS_IV_TBL(obj));
+ if (ROBJECT(obj)->iv_tbl) {
+ ROBJECT(dest)->iv_tbl = st_copy(ROBJECT(obj)->iv_tbl);
}
- break;
}
rb_funcall(dest, id_init_copy, 1, obj);
}
@@ -210,12 +191,12 @@ init_copy(VALUE dest, VALUE obj)
/*
* call-seq:
* obj.clone -> an_object
- *
+ *
* Produces a shallow copy of <i>obj</i>---the instance variables of
* <i>obj</i> are copied, but not the objects they reference. Copies
* the frozen and tainted state of <i>obj</i>. See also the discussion
* under <code>Object#dup</code>.
- *
+ *
* class Klass
* attr_accessor :str
* end
@@ -232,7 +213,8 @@ init_copy(VALUE dest, VALUE obj)
*/
VALUE
-rb_obj_clone(VALUE obj)
+rb_obj_clone(obj)
+ VALUE obj;
{
VALUE clone;
@@ -241,7 +223,7 @@ rb_obj_clone(VALUE obj)
}
clone = rb_obj_alloc(rb_obj_class(obj));
RBASIC(clone)->klass = rb_singleton_class_clone(obj);
- RBASIC(clone)->flags = (RBASIC(obj)->flags | FL_TEST(clone, FL_TAINT) | FL_TEST(clone, FL_UNTRUSTED)) & ~(FL_FREEZE|FL_FINALIZE);
+ RBASIC(clone)->flags = (RBASIC(obj)->flags | FL_TEST(clone, FL_TAINT)) & ~(FL_FREEZE|FL_FINALIZE);
init_copy(clone, obj);
RBASIC(clone)->flags |= RBASIC(obj)->flags & FL_FREEZE;
@@ -251,7 +233,7 @@ rb_obj_clone(VALUE obj)
/*
* call-seq:
* obj.dup -> an_object
- *
+ *
* Produces a shallow copy of <i>obj</i>---the instance variables of
* <i>obj</i> are copied, but not the objects they reference.
* <code>dup</code> copies the tainted state of <i>obj</i>. See also
@@ -267,7 +249,8 @@ rb_obj_clone(VALUE obj)
*/
VALUE
-rb_obj_dup(VALUE obj)
+rb_obj_dup(obj)
+ VALUE obj;
{
VALUE dup;
@@ -282,7 +265,8 @@ rb_obj_dup(VALUE obj)
/* :nodoc: */
VALUE
-rb_obj_init_copy(VALUE obj, VALUE orig)
+rb_obj_init_copy(obj, orig)
+ VALUE obj, orig;
{
if (obj == orig) return obj;
rb_check_frozen(obj);
@@ -294,8 +278,32 @@ rb_obj_init_copy(VALUE obj, VALUE orig)
/*
* call-seq:
+ * obj.to_a -> anArray
+ *
+ * Returns an array representation of <i>obj</i>. For objects of class
+ * <code>Object</code> and others that don't explicitly override the
+ * method, the return value is an array containing <code>self</code>.
+ * However, this latter behavior will soon be obsolete.
+ *
+ * self.to_a #=> -:1: warning: default `to_a' will be obsolete
+ * "hello".to_a #=> ["hello"]
+ * Time.new.to_a #=> [39, 54, 8, 9, 4, 2003, 3, 99, true, "CDT"]
+ */
+
+
+static VALUE
+rb_any_to_a(obj)
+ VALUE obj;
+{
+ rb_warn("default `to_a' will be obsolete");
+ return rb_ary_new3(1, obj);
+}
+
+
+/*
+ * call-seq:
* obj.to_s => string
- *
+ *
* Returns a string representing <i>obj</i>. The default
* <code>to_s</code> prints the object's class and an encoding of the
* object id. As a special case, the top-level object that is the
@@ -303,25 +311,34 @@ rb_obj_init_copy(VALUE obj, VALUE orig)
*/
VALUE
-rb_any_to_s(VALUE obj)
+rb_any_to_s(obj)
+ VALUE obj;
{
const char *cname = rb_obj_classname(obj);
+ size_t len;
VALUE str;
- str = rb_sprintf("#<%s:%p>", cname, (void*)obj);
- OBJ_INFECT(str, obj);
+ len = strlen(cname)+6+16;
+ str = rb_str_new(0, len); /* 6:tags 16:addr */
+ snprintf(RSTRING(str)->ptr, len+1, "#<%s:0x%lx>", cname, obj);
+ RSTRING(str)->len = strlen(RSTRING(str)->ptr);
+ if (OBJ_TAINTED(obj)) OBJ_TAINT(str);
return str;
}
VALUE
-rb_inspect(VALUE obj)
+rb_inspect(obj)
+ VALUE obj;
{
return rb_obj_as_string(rb_funcall(obj, id_inspect, 0, 0));
}
static int
-inspect_i(ID id, VALUE value, VALUE str)
+inspect_i(id, value, str)
+ ID id;
+ VALUE value;
+ VALUE str;
{
VALUE str2;
const char *ivname;
@@ -329,8 +346,8 @@ inspect_i(ID id, VALUE value, VALUE str)
/* need not to show internal data */
if (CLASS_OF(value) == 0) return ST_CONTINUE;
if (!rb_is_instance_id(id)) return ST_CONTINUE;
- if (RSTRING_PTR(str)[0] == '-') { /* first element */
- RSTRING_PTR(str)[0] = '#';
+ if (RSTRING(str)->ptr[0] == '-') { /* first element */
+ RSTRING(str)->ptr[0] = '#';
rb_str_cat2(str, " ");
}
else {
@@ -347,16 +364,12 @@ inspect_i(ID id, VALUE value, VALUE str)
}
static VALUE
-inspect_obj(VALUE obj, VALUE str, int recur)
+inspect_obj(obj, str)
+ VALUE obj, str;
{
- if (recur) {
- rb_str_cat2(str, " ...");
- }
- else {
- rb_ivar_foreach(obj, inspect_i, str);
- }
+ st_foreach_safe(ROBJECT(obj)->iv_tbl, inspect_i, str);
rb_str_cat2(str, ">");
- RSTRING_PTR(str)[0] = '#';
+ RSTRING(str)->ptr[0] = '#';
OBJ_INFECT(str, obj);
return str;
@@ -365,40 +378,39 @@ inspect_obj(VALUE obj, VALUE str, int recur)
/*
* call-seq:
* obj.inspect => string
- *
+ *
* Returns a string containing a human-readable representation of
* <i>obj</i>. If not overridden, uses the <code>to_s</code> method to
* generate the string.
- *
+ *
* [ 1, 2, 3..4, 'five' ].inspect #=> "[1, 2, 3..4, \"five\"]"
- * Time.new.inspect #=> "2008-03-08 19:43:39 +0900"
+ * Time.new.inspect #=> "Wed Apr 09 08:54:39 CDT 2003"
*/
static VALUE
-rb_obj_inspect(VALUE obj)
+rb_obj_inspect(obj)
+ VALUE obj;
{
-
- if (TYPE(obj) == T_OBJECT) {
- int has_ivar = 0;
- VALUE *ptr = ROBJECT_IVPTR(obj);
- long len = ROBJECT_NUMIV(obj);
- long i;
-
- for (i = 0; i < len; i++) {
- if (ptr[i] != Qundef) {
- has_ivar = 1;
- break;
- }
- }
-
- if (has_ivar) {
- VALUE str;
- const char *c = rb_obj_classname(obj);
-
- str = rb_sprintf("-<%s:%p", c, (void*)obj);
- return rb_exec_recursive(inspect_obj, obj, str);
- }
+ if (TYPE(obj) == T_OBJECT
+ && ROBJECT(obj)->iv_tbl
+ && ROBJECT(obj)->iv_tbl->num_entries > 0) {
+ VALUE str;
+ size_t len;
+ const char *c = rb_obj_classname(obj);
+
+ if (rb_inspecting_p(obj)) {
+ len = strlen(c)+10+16+1;
+ str = rb_str_new(0, len); /* 10:tags 16:addr 1:nul */
+ snprintf(RSTRING(str)->ptr, len, "#<%s:0x%lx ...>", c, obj);
+ RSTRING(str)->len = strlen(RSTRING(str)->ptr);
+ return str;
+ }
+ len = strlen(c)+6+16+1;
+ str = rb_str_new(0, len); /* 6:tags 16:addr 1:nul */
+ snprintf(RSTRING(str)->ptr, len, "-<%s:0x%lx", c, obj);
+ RSTRING(str)->len = strlen(RSTRING(str)->ptr);
+ return rb_protect_inspect(inspect_obj, obj, str);
}
return rb_funcall(obj, rb_intern("to_s"), 0, 0);
}
@@ -407,13 +419,14 @@ rb_obj_inspect(VALUE obj)
/*
* call-seq:
* obj.instance_of?(class) => true or false
- *
+ *
* Returns <code>true</code> if <i>obj</i> is an instance of the given
* class. See also <code>Object#kind_of?</code>.
*/
VALUE
-rb_obj_is_instance_of(VALUE obj, VALUE c)
+rb_obj_is_instance_of(obj, c)
+ VALUE obj, c;
{
switch (TYPE(c)) {
case T_MODULE:
@@ -433,11 +446,11 @@ rb_obj_is_instance_of(VALUE obj, VALUE c)
* call-seq:
* obj.is_a?(class) => true or false
* obj.kind_of?(class) => true or false
- *
+ *
* Returns <code>true</code> if <i>class</i> is the class of
* <i>obj</i>, or if <i>class</i> is one of the superclasses of
* <i>obj</i> or modules included in <i>obj</i>.
- *
+ *
* module M; end
* class A
* include M
@@ -456,7 +469,8 @@ rb_obj_is_instance_of(VALUE obj, VALUE c)
*/
VALUE
-rb_obj_is_kind_of(VALUE obj, VALUE c)
+rb_obj_is_kind_of(obj, c)
+ VALUE obj, c;
{
VALUE cl = CLASS_OF(obj);
@@ -471,9 +485,9 @@ rb_obj_is_kind_of(VALUE obj, VALUE c)
}
while (cl) {
- if (cl == c || RCLASS_M_TBL(cl) == RCLASS_M_TBL(c))
+ if (cl == c || RCLASS(cl)->m_tbl == RCLASS(c)->m_tbl)
return Qtrue;
- cl = RCLASS_SUPER(cl);
+ cl = RCLASS(cl)->super;
}
return Qfalse;
}
@@ -482,20 +496,26 @@ rb_obj_is_kind_of(VALUE obj, VALUE c)
/*
* call-seq:
* obj.tap{|x|...} => obj
- *
+ *
* Yields <code>x</code> to the block, and then returns <code>x</code>.
* The primary purpose of this method is to "tap into" a method chain,
* in order to perform operations on intermediate results within the chain.
*
- * (1..10) .tap {|x| puts "original: #{x.inspect}"}
- * .to_a .tap {|x| puts "array: #{x.inspect}"}
- * .select {|x| x%2==0} .tap {|x| puts "evens: #{x.inspect}"}
- * .map { |x| x*x } .tap {|x| puts "squares: #{x.inspect}"}
+ * (1..10).tap {
+ * |x| puts "original: #{x.inspect}"
+ * }.to_a.tap {
+ * |x| puts "array: #{x.inspect}"
+ * }.select {|x| x%2==0}.tap {
+ * |x| puts "evens: #{x.inspect}"
+ * }.map {|x| x*x}.tap {
+ * |x| puts "squares: #{x.inspect}"
+ * }
*
*/
VALUE
-rb_obj_tap(VALUE obj)
+rb_obj_tap(obj)
+ VALUE obj;
{
rb_yield(obj);
return obj;
@@ -535,10 +555,10 @@ rb_obj_tap(VALUE obj)
*
* call-seq:
* singleton_method_added(symbol)
- *
+ *
* Invoked as a callback whenever a singleton method is added to the
* receiver.
- *
+ *
* module Chatty
* def Chatty.singleton_method_added(id)
* puts "Adding #{id.id2name}"
@@ -547,13 +567,13 @@ rb_obj_tap(VALUE obj)
* def two() end
* def Chatty.three() end
* end
- *
+ *
* <em>produces:</em>
- *
+ *
* Adding singleton_method_added
* Adding one
* Adding three
- *
+ *
*/
/*
@@ -561,10 +581,10 @@ rb_obj_tap(VALUE obj)
*
* call-seq:
* singleton_method_removed(symbol)
- *
+ *
* Invoked as a callback whenever a singleton method is removed from
* the receiver.
- *
+ *
* module Chatty
* def Chatty.singleton_method_removed(id)
* puts "Removing #{id.id2name}"
@@ -577,9 +597,9 @@ rb_obj_tap(VALUE obj)
* remove_method :one
* end
* end
- *
+ *
* <em>produces:</em>
- *
+ *
* Removing three
* Removing one
*/
@@ -589,10 +609,10 @@ rb_obj_tap(VALUE obj)
*
* call-seq:
* singleton_method_undefined(symbol)
- *
+ *
* Invoked as a callback whenever a singleton method is undefined in
* the receiver.
- *
+ *
* module Chatty
* def Chatty.singleton_method_undefined(id)
* puts "Undefining #{id.id2name}"
@@ -602,9 +622,9 @@ rb_obj_tap(VALUE obj)
* undef_method(:one)
* end
* end
- *
+ *
* <em>produces:</em>
- *
+ *
* Undefining one
*/
@@ -636,7 +656,7 @@ rb_obj_tap(VALUE obj)
*/
static VALUE
-rb_obj_dummy(void)
+rb_obj_dummy()
{
return Qnil;
}
@@ -644,12 +664,13 @@ rb_obj_dummy(void)
/*
* call-seq:
* obj.tainted? => true or false
- *
+ *
* Returns <code>true</code> if the object is tainted.
*/
VALUE
-rb_obj_tainted(VALUE obj)
+rb_obj_tainted(obj)
+ VALUE obj;
{
if (OBJ_TAINTED(obj))
return Qtrue;
@@ -659,14 +680,15 @@ rb_obj_tainted(VALUE obj)
/*
* call-seq:
* obj.taint -> obj
- *
+ *
* Marks <i>obj</i> as tainted---if the <code>$SAFE</code> level is
* set appropriately, many method calls which might alter the running
* programs environment will refuse to accept tainted strings.
*/
VALUE
-rb_obj_taint(VALUE obj)
+rb_obj_taint(obj)
+ VALUE obj;
{
rb_secure(4);
if (!OBJ_TAINTED(obj)) {
@@ -682,12 +704,13 @@ rb_obj_taint(VALUE obj)
/*
* call-seq:
* obj.untaint => obj
- *
+ *
* Removes the taint from <i>obj</i>.
*/
VALUE
-rb_obj_untaint(VALUE obj)
+rb_obj_untaint(obj)
+ VALUE obj;
{
rb_secure(3);
if (OBJ_TAINTED(obj)) {
@@ -699,105 +722,42 @@ rb_obj_untaint(VALUE obj)
return obj;
}
-/*
- * call-seq:
- * obj.untrusted? => true or false
- *
- * Returns <code>true</code> if the object is untrusted.
- */
-
-VALUE
-rb_obj_untrusted(VALUE obj)
-{
- if (OBJ_UNTRUSTED(obj))
- return Qtrue;
- return Qfalse;
-}
-
-/*
- * call-seq:
- * obj.untrust -> obj
- *
- * Marks <i>obj</i> as untrusted.
- */
-
-VALUE
-rb_obj_untrust(VALUE obj)
-{
- rb_secure(4);
- if (!OBJ_UNTRUSTED(obj)) {
- if (OBJ_FROZEN(obj)) {
- rb_error_frozen("object");
- }
- OBJ_UNTRUST(obj);
- }
- return obj;
-}
-
-
-/*
- * call-seq:
- * obj.trust => obj
- *
- * Removes the untrusted mark from <i>obj</i>.
- */
-
-VALUE
-rb_obj_trust(VALUE obj)
-{
- rb_secure(3);
- if (OBJ_UNTRUSTED(obj)) {
- if (OBJ_FROZEN(obj)) {
- rb_error_frozen("object");
- }
- FL_UNSET(obj, FL_UNTRUSTED);
- }
- return obj;
-}
-
void
-rb_obj_infect(VALUE obj1, VALUE obj2)
+rb_obj_infect(obj1, obj2)
+ VALUE obj1, obj2;
{
OBJ_INFECT(obj1, obj2);
}
-static st_table *immediate_frozen_tbl = 0;
/*
* call-seq:
* obj.freeze => obj
- *
+ *
* Prevents further modifications to <i>obj</i>. A
- * <code>RuntimeError</code> will be raised if modification is attempted.
+ * <code>TypeError</code> will be raised if modification is attempted.
* There is no way to unfreeze a frozen object. See also
* <code>Object#frozen?</code>.
- *
- * This method returns self.
- *
+ *
* a = [ "a", "b", "c" ]
* a.freeze
* a << "z"
- *
+ *
* <em>produces:</em>
- *
- * prog.rb:3:in `<<': can't modify frozen array (RuntimeError)
+ *
+ * prog.rb:3:in `<<': can't modify frozen array (TypeError)
* from prog.rb:3
*/
VALUE
-rb_obj_freeze(VALUE obj)
+rb_obj_freeze(obj)
+ VALUE obj;
{
if (!OBJ_FROZEN(obj)) {
- if (rb_safe_level() >= 4 && !OBJ_UNTRUSTED(obj)) {
+ if (rb_safe_level() >= 4 && !OBJ_TAINTED(obj)) {
rb_raise(rb_eSecurityError, "Insecure: can't freeze object");
}
OBJ_FREEZE(obj);
- if (SPECIAL_CONST_P(obj)) {
- if (!immediate_frozen_tbl) {
- immediate_frozen_tbl = st_init_numtable();
- }
- st_insert(immediate_frozen_tbl, obj, (st_data_t)Qtrue);
- }
}
return obj;
}
@@ -805,22 +765,19 @@ rb_obj_freeze(VALUE obj)
/*
* call-seq:
* obj.frozen? => true or false
- *
+ *
* Returns the freeze status of <i>obj</i>.
- *
+ *
* a = [ "a", "b", "c" ]
* a.freeze #=> ["a", "b", "c"]
* a.frozen? #=> true
*/
-VALUE
-rb_obj_frozen_p(VALUE obj)
+static VALUE
+rb_obj_frozen_p(obj)
+ VALUE obj;
{
if (OBJ_FROZEN(obj)) return Qtrue;
- if (SPECIAL_CONST_P(obj)) {
- if (!immediate_frozen_tbl) return Qfalse;
- if (st_lookup(immediate_frozen_tbl, obj, 0)) return Qtrue;
- }
return Qfalse;
}
@@ -834,15 +791,16 @@ rb_obj_frozen_p(VALUE obj)
/*
* call-seq:
* nil.to_i => 0
- *
+ *
* Always returns zero.
- *
+ *
* nil.to_i #=> 0
*/
static VALUE
-nil_to_i(VALUE obj)
+nil_to_i(obj)
+ VALUE obj;
{
return INT2FIX(0);
}
@@ -850,44 +808,47 @@ nil_to_i(VALUE obj)
/*
* call-seq:
* nil.to_f => 0.0
- *
+ *
* Always returns zero.
- *
+ *
* nil.to_f #=> 0.0
*/
static VALUE
-nil_to_f(VALUE obj)
+nil_to_f(obj)
+ VALUE obj;
{
- return DBL2NUM(0.0);
+ return rb_float_new(0.0);
}
/*
* call-seq:
* nil.to_s => ""
- *
+ *
* Always returns the empty string.
+ *
+ * nil.to_s #=> ""
*/
static VALUE
-nil_to_s(VALUE obj)
+nil_to_s(obj)
+ VALUE obj;
{
- return rb_usascii_str_new(0, 0);
+ return rb_str_new2("");
}
/*
- * Document-method: to_a
- *
* call-seq:
* nil.to_a => []
- *
+ *
* Always returns an empty array.
- *
+ *
* nil.to_a #=> []
*/
static VALUE
-nil_to_a(VALUE obj)
+nil_to_a(obj)
+ VALUE obj;
{
return rb_ary_new2(0);
}
@@ -900,11 +861,20 @@ nil_to_a(VALUE obj)
*/
static VALUE
-nil_inspect(VALUE obj)
+nil_inspect(obj)
+ VALUE obj;
{
- return rb_usascii_str_new2("nil");
+ return rb_str_new2("nil");
}
+static VALUE
+main_to_s(obj)
+ VALUE obj;
+{
+ return rb_str_new2("main");
+}
+
+
/***********************************************************************
* Document-class: TrueClass
*
@@ -923,22 +893,24 @@ nil_inspect(VALUE obj)
*/
static VALUE
-true_to_s(VALUE obj)
+true_to_s(obj)
+ VALUE obj;
{
- return rb_usascii_str_new2("true");
+ return rb_str_new2("true");
}
/*
* call-seq:
* true & obj => true or false
- *
+ *
* And---Returns <code>false</code> if <i>obj</i> is
* <code>nil</code> or <code>false</code>, <code>true</code> otherwise.
*/
static VALUE
-true_and(VALUE obj, VALUE obj2)
+true_and(obj, obj2)
+ VALUE obj, obj2;
{
return RTEST(obj2)?Qtrue:Qfalse;
}
@@ -946,21 +918,22 @@ true_and(VALUE obj, VALUE obj2)
/*
* call-seq:
* true | obj => true
- *
+ *
* Or---Returns <code>true</code>. As <i>anObject</i> is an argument to
* a method call, it is always evaluated; there is no short-circuit
* evaluation in this case.
- *
+ *
* true | puts("or")
* true || puts("logical or")
- *
+ *
* <em>produces:</em>
- *
+ *
* or
*/
static VALUE
-true_or(VALUE obj, VALUE obj2)
+true_or(obj, obj2)
+ VALUE obj, obj2;
{
return Qtrue;
}
@@ -969,14 +942,15 @@ true_or(VALUE obj, VALUE obj2)
/*
* call-seq:
* true ^ obj => !obj
- *
+ *
* Exclusive Or---Returns <code>true</code> if <i>obj</i> is
* <code>nil</code> or <code>false</code>, <code>false</code>
* otherwise.
*/
static VALUE
-true_xor(VALUE obj, VALUE obj2)
+true_xor(obj, obj2)
+ VALUE obj, obj2;
{
return RTEST(obj2)?Qfalse:Qtrue;
}
@@ -989,7 +963,7 @@ true_xor(VALUE obj, VALUE obj2)
* <code>FalseClass</code> and represents a logically false value in
* boolean expressions. The class provides operators allowing
* <code>false</code> to participate correctly in logical expressions.
- *
+ *
*/
/*
@@ -1000,23 +974,25 @@ true_xor(VALUE obj, VALUE obj2)
*/
static VALUE
-false_to_s(VALUE obj)
+false_to_s(obj)
+ VALUE obj;
{
- return rb_usascii_str_new2("false");
+ return rb_str_new2("false");
}
/*
* call-seq:
* false & obj => false
* nil & obj => false
- *
+ *
* And---Returns <code>false</code>. <i>obj</i> is always
* evaluated as it is the argument to a method call---there is no
* short-circuit evaluation in this case.
*/
static VALUE
-false_and(VALUE obj, VALUE obj2)
+false_and(obj, obj2)
+ VALUE obj, obj2;
{
return Qfalse;
}
@@ -1026,13 +1002,14 @@ false_and(VALUE obj, VALUE obj2)
* call-seq:
* false | obj => true or false
* nil | obj => true or false
- *
+ *
* Or---Returns <code>false</code> if <i>obj</i> is
* <code>nil</code> or <code>false</code>; <code>true</code> otherwise.
*/
static VALUE
-false_or(VALUE obj, VALUE obj2)
+false_or(obj, obj2)
+ VALUE obj, obj2;
{
return RTEST(obj2)?Qtrue:Qfalse;
}
@@ -1043,15 +1020,16 @@ false_or(VALUE obj, VALUE obj2)
* call-seq:
* false ^ obj => true or false
* nil ^ obj => true or false
- *
+ *
* Exclusive Or---If <i>obj</i> is <code>nil</code> or
* <code>false</code>, returns <code>false</code>; otherwise, returns
* <code>true</code>.
- *
+ *
*/
static VALUE
-false_xor(VALUE obj, VALUE obj2)
+false_xor(obj, obj2)
+ VALUE obj, obj2;
{
return RTEST(obj2)?Qtrue:Qfalse;
}
@@ -1064,7 +1042,8 @@ false_xor(VALUE obj, VALUE obj2)
*/
static VALUE
-rb_true(VALUE obj)
+rb_true(obj)
+ VALUE obj;
{
return Qtrue;
}
@@ -1079,7 +1058,8 @@ rb_true(VALUE obj)
static VALUE
-rb_false(VALUE obj)
+rb_false(obj)
+ VALUE obj;
{
return Qfalse;
}
@@ -1087,32 +1067,178 @@ rb_false(VALUE obj)
/*
* call-seq:
- * obj =~ other => nil
- *
+ * obj =~ other => false
+ *
* Pattern Match---Overridden by descendents (notably
* <code>Regexp</code> and <code>String</code>) to provide meaningful
* pattern-match semantics.
*/
static VALUE
-rb_obj_match(VALUE obj1, VALUE obj2)
+rb_obj_pattern_match(obj1, obj2)
+ VALUE obj1, obj2;
{
- return Qnil;
+ return Qfalse;
}
+/**********************************************************************
+ * Document-class: Symbol
+ *
+ * <code>Symbol</code> objects represent names and some strings
+ * inside the Ruby
+ * interpreter. They are generated using the <code>:name</code> and
+ * <code>:"string"</code> literals
+ * syntax, and by the various <code>to_sym</code> methods. The same
+ * <code>Symbol</code> object will be created for a given name or string
+ * for the duration of a program's execution, regardless of the context
+ * or meaning of that name. Thus if <code>Fred</code> is a constant in
+ * one context, a method in another, and a class in a third, the
+ * <code>Symbol</code> <code>:Fred</code> will be the same object in
+ * all three contexts.
+ *
+ * module One
+ * class Fred
+ * end
+ * $f1 = :Fred
+ * end
+ * module Two
+ * Fred = 1
+ * $f2 = :Fred
+ * end
+ * def Fred()
+ * end
+ * $f3 = :Fred
+ * $f1.id #=> 2514190
+ * $f2.id #=> 2514190
+ * $f3.id #=> 2514190
+ *
+ */
+
/*
* call-seq:
- * obj !~ other => true or false
+ * sym.to_i => fixnum
+ *
+ * Returns an integer that is unique for each symbol within a
+ * particular execution of a program.
+ *
+ * :fred.to_i #=> 9809
+ * "fred".to_sym.to_i #=> 9809
+ */
+
+static VALUE
+sym_to_i(sym)
+ VALUE sym;
+{
+ ID id = SYM2ID(sym);
+
+ return LONG2FIX(id);
+}
+
+
+/* :nodoc: */
+
+static VALUE
+sym_to_int(sym)
+ VALUE sym;
+{
+ rb_warning("treating Symbol as an integer");
+ return sym_to_i(sym);
+}
+
+
+/*
+ * call-seq:
+ * sym.inspect => string
+ *
+ * Returns the representation of <i>sym</i> as a symbol literal.
+ *
+ * :fred.inspect #=> ":fred"
+ */
+
+static VALUE
+sym_inspect(sym)
+ VALUE sym;
+{
+ VALUE str;
+ const char *name;
+ ID id = SYM2ID(sym);
+
+ name = rb_id2name(id);
+ str = rb_str_new(0, strlen(name)+1);
+ RSTRING(str)->ptr[0] = ':';
+ strcpy(RSTRING(str)->ptr+1, name);
+ if (!rb_symname_p(name)) {
+ str = rb_str_dump(str);
+ strncpy(RSTRING(str)->ptr, ":\"", 2);
+ }
+ return str;
+}
+
+
+/*
+ * call-seq:
+ * sym.id2name => string
+ * sym.to_s => string
+ *
+ * Returns the name or string corresponding to <i>sym</i>.
+ *
+ * :fred.id2name #=> "fred"
+ */
+
+
+static VALUE
+sym_to_s(sym)
+ VALUE sym;
+{
+ return rb_str_new2(rb_id2name(SYM2ID(sym)));
+}
+
+
+/*
+ * call-seq:
+ * sym.to_sym => sym
+ *
+ * In general, <code>to_sym</code> returns the <code>Symbol</code> corresponding
+ * to an object. As <i>sym</i> is already a symbol, <code>self</code> is returned
+ * in this case.
+ */
+
+static VALUE
+sym_to_sym(sym)
+ VALUE sym;
+{
+ return sym;
+}
+
+
+static VALUE
+sym_call(args, mid)
+ VALUE args, mid;
+{
+ VALUE obj;
+
+ if (RARRAY(args)->len < 1) {
+ rb_raise(rb_eArgError, "no receiver given");
+ }
+ obj = rb_ary_shift(args);
+ return rb_apply(obj, (ID)mid, args);
+}
+
+VALUE rb_proc_new _((VALUE (*)(ANYARGS/* VALUE yieldarg[, VALUE procarg] */), VALUE));
+
+/*
+ * call-seq:
+ * sym.to_proc
+ *
+ * Returns a _Proc_ object which respond to the given method by _sym_.
*
- * Returns true if two objects do not match (using the <i>=~</i>
- * method), otherwise false.
+ * (1..3).collect(&:to_s) #=> ["1", "2", "3"]
*/
static VALUE
-rb_obj_not_match(VALUE obj1, VALUE obj2)
+sym_to_proc(VALUE sym)
{
- VALUE result = rb_funcall(obj1, id_match, 1, obj2);
- return RTEST(result) ? Qfalse : Qtrue;
+ return rb_proc_new(sym_call, (VALUE)SYM2ID(sym));
}
@@ -1126,11 +1252,11 @@ rb_obj_not_match(VALUE obj1, VALUE obj2)
* included, module methods do not. Conversely, module methods may be
* called without creating an encapsulating object, while instance
* methods may not. (See <code>Module#module_function</code>)
- *
+ *
* In the descriptions that follow, the parameter <i>syml</i> refers
* to a symbol, which is either a quoted string or a
* <code>Symbol</code> (such as <code>:name</code>).
- *
+ *
* module Mod
* include Math
* CONST = 1
@@ -1139,9 +1265,9 @@ rb_obj_not_match(VALUE obj1, VALUE obj2)
* end
* end
* Mod.class #=> Module
- * Mod.constants #=> [:CONST, :PI, :E]
- * Mod.instance_methods #=> [:meth]
- *
+ * Mod.constants #=> ["E", "PI", "CONST"]
+ * Mod.instance_methods #=> ["meth"]
+ *
*/
/*
@@ -1154,10 +1280,12 @@ rb_obj_not_match(VALUE obj1, VALUE obj2)
*/
static VALUE
-rb_mod_to_s(VALUE klass)
+rb_mod_to_s(klass)
+ VALUE klass;
+
{
if (FL_TEST(klass, FL_SINGLETON)) {
- VALUE s = rb_usascii_str_new2("#<");
+ VALUE s = rb_str_new2("#<");
VALUE v = rb_iv_get(klass, "__attached__");
rb_str_cat2(s, "Class:");
@@ -1178,24 +1306,23 @@ rb_mod_to_s(VALUE klass)
/*
* call-seq:
- * mod.freeze => mod
- *
+ * mod.freeze
+ *
* Prevents further modifications to <i>mod</i>.
- *
- * This method returns self.
*/
static VALUE
-rb_mod_freeze(VALUE mod)
+rb_mod_freeze(mod)
+ VALUE mod;
{
- rb_class_name(mod);
+ rb_mod_to_s(mod);
return rb_obj_freeze(mod);
}
/*
* call-seq:
* mod === obj => true or false
- *
+ *
* Case Equality---Returns <code>true</code> if <i>anObject</i> is an
* instance of <i>mod</i> or one of <i>mod</i>'s descendents. Of
* limited use for modules, but can be used in <code>case</code>
@@ -1203,7 +1330,8 @@ rb_mod_freeze(VALUE mod)
*/
static VALUE
-rb_mod_eqq(VALUE mod, VALUE arg)
+rb_mod_eqq(mod, arg)
+ VALUE mod, arg;
{
return rb_obj_is_kind_of(arg, mod);
}
@@ -1213,15 +1341,16 @@ rb_mod_eqq(VALUE mod, VALUE arg)
* mod <= other => true, false, or nil
*
* Returns true if <i>mod</i> is a subclass of <i>other</i> or
- * is the same as <i>other</i>. Returns
- * <code>nil</code> if there's no relationship between the two.
- * (Think of the relationship in terms of the class definition:
+ * is the same as <i>other</i>. Returns
+ * <code>nil</code> if there's no relationship between the two.
+ * (Think of the relationship in terms of the class definition:
* "class A<B" implies "A<B").
*
*/
VALUE
-rb_class_inherited_p(VALUE mod, VALUE arg)
+rb_class_inherited_p(mod, arg)
+ VALUE mod, arg;
{
VALUE start = mod;
@@ -1233,16 +1362,22 @@ rb_class_inherited_p(VALUE mod, VALUE arg)
default:
rb_raise(rb_eTypeError, "compared with non class/module");
}
+
+ if (FL_TEST(mod, FL_SINGLETON)) {
+ if (RCLASS(mod)->m_tbl == RCLASS(arg)->m_tbl)
+ return Qtrue;
+ mod = RBASIC(mod)->klass;
+ }
while (mod) {
- if (RCLASS_M_TBL(mod) == RCLASS_M_TBL(arg))
+ if (RCLASS(mod)->m_tbl == RCLASS(arg)->m_tbl)
return Qtrue;
- mod = RCLASS_SUPER(mod);
+ mod = RCLASS(mod)->super;
}
/* not mod < arg; check if mod > arg */
while (arg) {
- if (RCLASS_M_TBL(arg) == RCLASS_M_TBL(start))
+ if (RCLASS(arg)->m_tbl == RCLASS(start)->m_tbl)
return Qfalse;
- arg = RCLASS_SUPER(arg);
+ arg = RCLASS(arg)->super;
}
return Qnil;
}
@@ -1251,15 +1386,16 @@ rb_class_inherited_p(VALUE mod, VALUE arg)
* call-seq:
* mod < other => true, false, or nil
*
- * Returns true if <i>mod</i> is a subclass of <i>other</i>. Returns
- * <code>nil</code> if there's no relationship between the two.
- * (Think of the relationship in terms of the class definition:
+ * Returns true if <i>mod</i> is a subclass of <i>other</i>. Returns
+ * <code>nil</code> if there's no relationship between the two.
+ * (Think of the relationship in terms of the class definition:
* "class A<B" implies "A<B").
*
*/
static VALUE
-rb_mod_lt(VALUE mod, VALUE arg)
+rb_mod_lt(mod, arg)
+ VALUE mod, arg;
{
if (mod == arg) return Qfalse;
return rb_class_inherited_p(mod, arg);
@@ -1271,15 +1407,16 @@ rb_mod_lt(VALUE mod, VALUE arg)
* mod >= other => true, false, or nil
*
* Returns true if <i>mod</i> is an ancestor of <i>other</i>, or the
- * two modules are the same. Returns
- * <code>nil</code> if there's no relationship between the two.
- * (Think of the relationship in terms of the class definition:
+ * two modules are the same. Returns
+ * <code>nil</code> if there's no relationship between the two.
+ * (Think of the relationship in terms of the class definition:
* "class A<B" implies "B>A").
*
*/
static VALUE
-rb_mod_ge(VALUE mod, VALUE arg)
+rb_mod_ge(mod, arg)
+ VALUE mod, arg;
{
switch (TYPE(arg)) {
case T_MODULE:
@@ -1296,15 +1433,16 @@ rb_mod_ge(VALUE mod, VALUE arg)
* call-seq:
* mod > other => true, false, or nil
*
- * Returns true if <i>mod</i> is an ancestor of <i>other</i>. Returns
- * <code>nil</code> if there's no relationship between the two.
- * (Think of the relationship in terms of the class definition:
+ * Returns true if <i>mod</i> is an ancestor of <i>other</i>. Returns
+ * <code>nil</code> if there's no relationship between the two.
+ * (Think of the relationship in terms of the class definition:
* "class A<B" implies "B>A").
*
*/
static VALUE
-rb_mod_gt(VALUE mod, VALUE arg)
+rb_mod_gt(mod, arg)
+ VALUE mod, arg;
{
if (mod == arg) return Qfalse;
return rb_mod_ge(mod, arg);
@@ -1313,16 +1451,17 @@ rb_mod_gt(VALUE mod, VALUE arg)
/*
* call-seq:
* mod <=> other_mod => -1, 0, +1, or nil
- *
+ *
* Comparison---Returns -1 if <i>mod</i> includes <i>other_mod</i>, 0 if
* <i>mod</i> is the same as <i>other_mod</i>, and +1 if <i>mod</i> is
- * included by <i>other_mod</i>. Returns <code>nil</code> if <i>mod</i>
- * has no relationship with <i>other_mod</i> or if <i>other_mod</i> is
+ * included by <i>other_mod</i> or if <i>mod</i> has no relationship with
+ * <i>other_mod</i>. Returns <code>nil</code> if <i>other_mod</i> is
* not a module.
*/
static VALUE
-rb_mod_cmp(VALUE mod, VALUE arg)
+rb_mod_cmp(mod, arg)
+ VALUE mod, arg;
{
VALUE cmp;
@@ -1343,8 +1482,10 @@ rb_mod_cmp(VALUE mod, VALUE arg)
return INT2FIX(1);
}
+static VALUE rb_module_s_alloc _((VALUE));
static VALUE
-rb_module_s_alloc(VALUE klass)
+rb_module_s_alloc(klass)
+ VALUE klass;
{
VALUE mod = rb_module_new();
@@ -1352,8 +1493,10 @@ rb_module_s_alloc(VALUE klass)
return mod;
}
+static VALUE rb_class_s_alloc _((VALUE));
static VALUE
-rb_class_s_alloc(VALUE klass)
+rb_class_s_alloc(klass)
+ VALUE klass;
{
return rb_class_boot(0);
}
@@ -1362,11 +1505,11 @@ rb_class_s_alloc(VALUE klass)
* call-seq:
* Module.new => mod
* Module.new {|mod| block } => mod
- *
+ *
* Creates a new anonymous module. If a block is given, it is passed
* the module object, and the block is evaluated in the context of this
* module using <code>module_eval</code>.
- *
+ *
* Fred = Module.new do
* def meth1
* "hello"
@@ -1382,12 +1525,11 @@ rb_class_s_alloc(VALUE klass)
*/
static VALUE
-rb_mod_initialize(VALUE module)
+rb_mod_initialize(module)
+ VALUE module;
{
- extern VALUE rb_mod_module_exec(int argc, VALUE *argv, VALUE mod);
-
if (rb_block_given_p()) {
- rb_mod_module_exec(1, &module, module);
+ rb_mod_module_eval(0, 0, module);
}
return Qnil;
}
@@ -1395,32 +1537,34 @@ rb_mod_initialize(VALUE module)
/*
* call-seq:
* Class.new(super_class=Object) => a_class
- *
+ *
* Creates a new anonymous (unnamed) class with the given superclass
* (or <code>Object</code> if no parameter is given). You can give a
* class a name by assigning the class object to a constant.
- *
+ *
*/
static VALUE
-rb_class_initialize(int argc, VALUE *argv, VALUE klass)
+rb_class_initialize(argc, argv, klass)
+ int argc;
+ VALUE *argv;
+ VALUE klass;
{
VALUE super;
- if (RCLASS_SUPER(klass) != 0) {
+ if (RCLASS(klass)->super != 0) {
rb_raise(rb_eTypeError, "already initialized class");
}
- if (argc == 0) {
+ if (rb_scan_args(argc, argv, "01", &super) == 0) {
super = rb_cObject;
}
else {
- rb_scan_args(argc, argv, "01", &super);
rb_check_inheritable(super);
}
- RCLASS_SUPER(klass) = super;
+ RCLASS(klass)->super = super;
rb_make_metaclass(klass, RBASIC(super)->klass);
- rb_class_inherited(super, klass);
rb_mod_initialize(klass);
+ rb_class_inherited(super, klass);
return klass;
}
@@ -1428,35 +1572,36 @@ rb_class_initialize(int argc, VALUE *argv, VALUE klass)
/*
* call-seq:
* class.allocate() => obj
- *
+ *
* Allocates space for a new object of <i>class</i>'s class and does not
* call initialize on the new instance. The returned object must be an
* instance of <i>class</i>.
- *
+ *
* klass = Class.new do
* def initialize(*args)
* @initialized = true
* end
- *
+ *
* def initialized?
* @initialized || false
* end
* end
- *
+ *
* klass.allocate.initialized? #=> false
- *
+ *
*/
VALUE
-rb_obj_alloc(VALUE klass)
+rb_obj_alloc(klass)
+ VALUE klass;
{
VALUE obj;
- if (RCLASS_SUPER(klass) == 0 && klass != rb_cBasicObject) {
+ if (RCLASS(klass)->super == 0) {
rb_raise(rb_eTypeError, "can't instantiate uninitialized class");
}
if (FL_TEST(klass, FL_SINGLETON)) {
- rb_raise(rb_eTypeError, "can't create instance of singleton class");
+ rb_raise(rb_eTypeError, "can't create instance of virtual class");
}
obj = rb_funcall(klass, ID_ALLOCATOR, 0, 0);
if (rb_obj_class(obj) != rb_class_real(klass)) {
@@ -1465,8 +1610,10 @@ rb_obj_alloc(VALUE klass)
return obj;
}
+static VALUE rb_class_allocate_instance _((VALUE));
static VALUE
-rb_class_allocate_instance(VALUE klass)
+rb_class_allocate_instance(klass)
+ VALUE klass;
{
NEWOBJ(obj, struct RObject);
OBJSETUP(obj, klass, T_OBJECT);
@@ -1476,17 +1623,20 @@ rb_class_allocate_instance(VALUE klass)
/*
* call-seq:
* class.new(args, ...) => obj
- *
+ *
* Calls <code>allocate</code> to create a new object of
* <i>class</i>'s class, then invokes that object's
* <code>initialize</code> method, passing it <i>args</i>.
* This is the method that ends up getting called whenever
* an object is constructed using .new.
- *
+ *
*/
VALUE
-rb_class_new_instance(int argc, VALUE *argv, VALUE klass)
+rb_class_new_instance(argc, argv, klass)
+ int argc;
+ VALUE *argv;
+ VALUE klass;
{
VALUE obj;
@@ -1499,33 +1649,29 @@ rb_class_new_instance(int argc, VALUE *argv, VALUE klass)
/*
* call-seq:
* class.superclass -> a_super_class or nil
- *
+ *
* Returns the superclass of <i>class</i>, or <code>nil</code>.
- *
- * File.superclass #=> IO
- * IO.superclass #=> Object
- * Object.superclass #=> BasicObject
- * class Foo; end
- * class Bar < Foo; end
- * Bar.superclass #=> Foo
- *
- * returns nil when the given class hasn't a parent class:
- *
- * BasicObject.superclass #=> nil
- *
+ *
+ * File.superclass #=> IO
+ * IO.superclass #=> Object
+ * Object.superclass #=> nil
+ *
*/
static VALUE
-rb_class_superclass(VALUE klass)
+rb_class_superclass(klass)
+ VALUE klass;
{
- VALUE super = RCLASS_SUPER(klass);
+ VALUE super = RCLASS(klass)->super;
if (!super) {
- if (klass == rb_cBasicObject) return Qnil;
rb_raise(rb_eTypeError, "uninitialized class");
}
+ if (FL_TEST(klass, FL_SINGLETON)) {
+ super = RBASIC(klass)->klass;
+ }
while (TYPE(super) == T_ICLASS) {
- super = RCLASS_SUPER(super);
+ super = RCLASS(super)->super;
}
if (!super) {
return Qnil;
@@ -1533,53 +1679,125 @@ rb_class_superclass(VALUE klass)
return super;
}
+static ID
+str_to_id(str)
+ VALUE str;
+{
+ VALUE sym = rb_str_intern(str);
+
+ return SYM2ID(sym);
+}
+
+ID
+rb_to_id(name)
+ VALUE name;
+{
+ VALUE tmp;
+ ID id;
+
+ switch (TYPE(name)) {
+ case T_STRING:
+ return str_to_id(name);
+ case T_FIXNUM:
+ rb_warn("do not use Fixnums as Symbols");
+ id = FIX2LONG(name);
+ if (!rb_id2name(id)) {
+ rb_raise(rb_eArgError, "%ld is not a symbol", id);
+ }
+ break;
+ case T_SYMBOL:
+ id = SYM2ID(name);
+ break;
+ default:
+ tmp = rb_check_string_type(name);
+ if (!NIL_P(tmp)) {
+ return str_to_id(tmp);
+ }
+ rb_raise(rb_eTypeError, "%s is not a symbol", RSTRING(rb_inspect(name))->ptr);
+ }
+ return id;
+}
+
+/*
+ * call-seq:
+ * attr(symbol, writable=false) => nil
+ *
+ * Defines a named attribute for this module, where the name is
+ * <i>symbol.</i><code>id2name</code>, creating an instance variable
+ * (<code>@name</code>) and a corresponding access method to read it.
+ * If the optional <i>writable</i> argument is <code>true</code>, also
+ * creates a method called <code>name=</code> to set the attribute.
+ *
+ * module Mod
+ * attr :size, true
+ * end
+ *
+ * <em>is equivalent to:</em>
+ *
+ * module Mod
+ * def size
+ * @size
+ * end
+ * def size=(val)
+ * @size = val
+ * end
+ * end
+ */
+
+static VALUE
+rb_mod_attr(argc, argv, klass)
+ int argc;
+ VALUE *argv;
+ VALUE klass;
+{
+ VALUE name, pub;
+
+ rb_scan_args(argc, argv, "11", &name, &pub);
+ rb_attr(klass, rb_to_id(name), 1, RTEST(pub), Qtrue);
+ return Qnil;
+}
+
/*
* call-seq:
* attr_reader(symbol, ...) => nil
- * attr(symbol, ...) => nil
- *
+ *
* Creates instance variables and corresponding methods that return the
* value of each instance variable. Equivalent to calling
* ``<code>attr</code><i>:name</i>'' on each name in turn.
*/
static VALUE
-rb_mod_attr_reader(int argc, VALUE *argv, VALUE klass)
+rb_mod_attr_reader(argc, argv, klass)
+ int argc;
+ VALUE *argv;
+ VALUE klass;
{
int i;
for (i=0; i<argc; i++) {
- rb_attr(klass, rb_to_id(argv[i]), Qtrue, Qfalse, Qtrue);
+ rb_attr(klass, rb_to_id(argv[i]), 1, 0, Qtrue);
}
return Qnil;
}
-VALUE
-rb_mod_attr(int argc, VALUE *argv, VALUE klass)
-{
- if (argc == 2 && (argv[1] == Qtrue || argv[1] == Qfalse)) {
- rb_warning("optional boolean argument is obsoleted");
- rb_attr(klass, rb_to_id(argv[0]), 1, RTEST(argv[1]), Qtrue);
- return Qnil;
- }
- return rb_mod_attr_reader(argc, argv, klass);
-}
-
/*
* call-seq:
* attr_writer(symbol, ...) => nil
- *
+ *
* Creates an accessor method to allow assignment to the attribute
* <i>aSymbol</i><code>.id2name</code>.
*/
static VALUE
-rb_mod_attr_writer(int argc, VALUE *argv, VALUE klass)
+rb_mod_attr_writer(argc, argv, klass)
+ int argc;
+ VALUE *argv;
+ VALUE klass;
{
int i;
for (i=0; i<argc; i++) {
- rb_attr(klass, rb_to_id(argv[i]), Qfalse, Qtrue, Qtrue);
+ rb_attr(klass, rb_to_id(argv[i]), 0, 1, Qtrue);
}
return Qnil;
}
@@ -1587,75 +1805,66 @@ rb_mod_attr_writer(int argc, VALUE *argv, VALUE klass)
/*
* call-seq:
* attr_accessor(symbol, ...) => nil
- *
- * Defines a named attribute for this module, where the name is
- * <i>symbol.</i><code>id2name</code>, creating an instance variable
- * (<code>@name</code>) and a corresponding access method to read it.
- * Also creates a method called <code>name=</code> to set the attribute.
- *
+ *
+ * Equivalent to calling ``<code>attr</code><i>symbol</i><code>,
+ * true</code>'' on each <i>symbol</i> in turn.
+ *
* module Mod
* attr_accessor(:one, :two)
* end
- * Mod.instance_methods.sort #=> [:one, :one=, :two, :two=]
+ * Mod.instance_methods.sort #=> ["one", "one=", "two", "two="]
*/
static VALUE
-rb_mod_attr_accessor(int argc, VALUE *argv, VALUE klass)
+rb_mod_attr_accessor(argc, argv, klass)
+ int argc;
+ VALUE *argv;
+ VALUE klass;
{
int i;
for (i=0; i<argc; i++) {
- rb_attr(klass, rb_to_id(argv[i]), Qtrue, Qtrue, Qtrue);
+ rb_attr(klass, rb_to_id(argv[i]), 1, 1, Qtrue);
}
return Qnil;
}
/*
* call-seq:
- * mod.const_get(sym, inherit=true) => obj
- *
+ * mod.const_get(sym) => obj
+ *
* Returns the value of the named constant in <i>mod</i>.
- *
+ *
* Math.const_get(:PI) #=> 3.14159265358979
- *
- * If the constant is not defined or is defined by the ancestors and
- * +inherit+ is false, +NameError+ will be raised.
*/
static VALUE
-rb_mod_const_get(int argc, VALUE *argv, VALUE mod)
+rb_mod_const_get(mod, name)
+ VALUE mod, name;
{
- VALUE name, recur;
- ID id;
+ ID id = rb_to_id(name);
- if (argc == 1) {
- name = argv[0];
- recur = Qtrue;
- }
- else {
- rb_scan_args(argc, argv, "11", &name, &recur);
- }
- id = rb_to_id(name);
if (!rb_is_const_id(id)) {
rb_name_error(id, "wrong constant name %s", rb_id2name(id));
}
- return RTEST(recur) ? rb_const_get(mod, id) : rb_const_get_at(mod, id);
+ return rb_const_get(mod, id);
}
/*
* call-seq:
* mod.const_set(sym, obj) => obj
- *
+ *
* Sets the named constant to the given object, returning that object.
* Creates a new constant if no constant with the given name previously
* existed.
- *
+ *
* Math.const_set("HIGH_SCHOOL_PI", 22.0/7.0) #=> 3.14285714285714
* Math::HIGH_SCHOOL_PI - Math::PI #=> 0.00126448926734968
*/
static VALUE
-rb_mod_const_set(VALUE mod, VALUE name, VALUE value)
+rb_mod_const_set(mod, name, value)
+ VALUE mod, name, value;
{
ID id = rb_to_id(name);
@@ -1668,57 +1877,50 @@ rb_mod_const_set(VALUE mod, VALUE name, VALUE value)
/*
* call-seq:
- * mod.const_defined?(sym, inherit=true) => true or false
- *
+ * mod.const_defined?(sym) => true or false
+ *
* Returns <code>true</code> if a constant with the given name is
- * defined by <i>mod</i>, or its ancestors if +inherit+ is not false.
- *
+ * defined by <i>mod</i>.
+ *
* Math.const_defined? "PI" #=> true
- * IO.const_defined? "SYNC" #=> true
- * IO.const_defined? "SYNC", false #=> false
*/
static VALUE
-rb_mod_const_defined(int argc, VALUE *argv, VALUE mod)
+rb_mod_const_defined(mod, name)
+ VALUE mod, name;
{
- VALUE name, recur;
- ID id;
+ ID id = rb_to_id(name);
- if (argc == 1) {
- name = argv[0];
- recur = Qtrue;
- }
- else {
- rb_scan_args(argc, argv, "11", &name, &recur);
- }
- id = rb_to_id(name);
if (!rb_is_const_id(id)) {
rb_name_error(id, "wrong constant name %s", rb_id2name(id));
}
- return RTEST(recur) ? rb_const_defined(mod, id) : rb_const_defined_at(mod, id);
+ return rb_const_defined_at(mod, id);
}
/*
* call-seq:
* obj.methods => array
- *
+ *
* Returns a list of the names of methods publicly accessible in
* <i>obj</i>. This will include all the methods accessible in
* <i>obj</i>'s ancestors.
- *
+ *
* class Klass
* def kMethod()
* end
* end
* k = Klass.new
- * k.methods[0..9] #=> ["kMethod", "freeze", "nil?", "is_a?",
- * # "class", "instance_variable_set",
- * # "methods", "extend", "__send__", "instance_eval"]
+ * k.methods[0..9] #=> ["kMethod", "freeze", "nil?", "is_a?",
+ * "class", "instance_variable_set",
+ * "methods", "extend", "__send__", "instance_eval"]
* k.methods.length #=> 42
*/
static VALUE
-rb_obj_methods(int argc, VALUE *argv, VALUE obj)
+rb_obj_methods(argc, argv, obj)
+ int argc;
+ VALUE *argv;
+ VALUE obj;
{
retry:
if (argc == 0) {
@@ -1742,14 +1944,17 @@ rb_obj_methods(int argc, VALUE *argv, VALUE obj)
/*
* call-seq:
* obj.protected_methods(all=true) => array
- *
+ *
* Returns the list of protected methods accessible to <i>obj</i>. If
* the <i>all</i> parameter is set to <code>false</code>, only those methods
* in the receiver will be listed.
*/
static VALUE
-rb_obj_protected_methods(int argc, VALUE *argv, VALUE obj)
+rb_obj_protected_methods(argc, argv, obj)
+ int argc;
+ VALUE *argv;
+ VALUE obj;
{
if (argc == 0) { /* hack to stop warning */
VALUE args[1];
@@ -1763,14 +1968,17 @@ rb_obj_protected_methods(int argc, VALUE *argv, VALUE obj)
/*
* call-seq:
* obj.private_methods(all=true) => array
- *
+ *
* Returns the list of private methods accessible to <i>obj</i>. If
* the <i>all</i> parameter is set to <code>false</code>, only those methods
* in the receiver will be listed.
*/
static VALUE
-rb_obj_private_methods(int argc, VALUE *argv, VALUE obj)
+rb_obj_private_methods(argc, argv, obj)
+ int argc;
+ VALUE *argv;
+ VALUE obj;
{
if (argc == 0) { /* hack to stop warning */
VALUE args[1];
@@ -1784,14 +1992,17 @@ rb_obj_private_methods(int argc, VALUE *argv, VALUE obj)
/*
* call-seq:
* obj.public_methods(all=true) => array
- *
+ *
* Returns the list of public methods accessible to <i>obj</i>. If
* the <i>all</i> parameter is set to <code>false</code>, only those methods
* in the receiver will be listed.
*/
static VALUE
-rb_obj_public_methods(int argc, VALUE *argv, VALUE obj)
+rb_obj_public_methods(argc, argv, obj)
+ int argc;
+ VALUE *argv;
+ VALUE obj;
{
if (argc == 0) { /* hack to stop warning */
VALUE args[1];
@@ -1811,7 +2022,7 @@ rb_obj_public_methods(int argc, VALUE *argv, VALUE obj)
* variable name should be included for regular instance
* variables. Throws a <code>NameError</code> exception if the
* supplied symbol is not valid as an instance variable name.
- *
+ *
* class Fred
* def initialize(p1, p2)
* @a, @b = p1, p2
@@ -1823,7 +2034,8 @@ rb_obj_public_methods(int argc, VALUE *argv, VALUE obj)
*/
static VALUE
-rb_obj_ivar_get(VALUE obj, VALUE iv)
+rb_obj_ivar_get(obj, iv)
+ VALUE obj, iv;
{
ID id = rb_to_id(iv);
@@ -1836,12 +2048,12 @@ rb_obj_ivar_get(VALUE obj, VALUE iv)
/*
* call-seq:
* obj.instance_variable_set(symbol, obj) => obj
- *
+ *
* Sets the instance variable names by <i>symbol</i> to
* <i>object</i>, thereby frustrating the efforts of the class's
* author to attempt to provide proper encapsulation. The variable
* did not have to exist prior to this call.
- *
+ *
* class Fred
* def initialize(p1, p2)
* @a, @b = p1, p2
@@ -1854,7 +2066,8 @@ rb_obj_ivar_get(VALUE obj, VALUE iv)
*/
static VALUE
-rb_obj_ivar_set(VALUE obj, VALUE iv, VALUE val)
+rb_obj_ivar_set(obj, iv, val)
+ VALUE obj, iv, val;
{
ID id = rb_to_id(iv);
@@ -1883,7 +2096,8 @@ rb_obj_ivar_set(VALUE obj, VALUE iv, VALUE val)
*/
static VALUE
-rb_obj_ivar_defined(VALUE obj, VALUE iv)
+rb_obj_ivar_defined(obj, iv)
+ VALUE obj, iv;
{
ID id = rb_to_id(iv);
@@ -1896,19 +2110,23 @@ rb_obj_ivar_defined(VALUE obj, VALUE iv)
/*
* call-seq:
* mod.class_variable_get(symbol) => obj
- *
+ *
* Returns the value of the given class variable (or throws a
* <code>NameError</code> exception). The <code>@@</code> part of the
* variable name should be included for regular class variables
- *
+ *
* class Fred
* @@foo = 99
* end
- * Fred.class_variable_get(:@@foo) #=> 99
+ *
+ * def Fred.foo
+ * class_variable_get(:@@foo) #=> 99
+ * end
*/
static VALUE
-rb_mod_cvar_get(VALUE obj, VALUE iv)
+rb_mod_cvar_get(obj, iv)
+ VALUE obj, iv;
{
ID id = rb_to_id(iv);
@@ -1921,29 +2139,34 @@ rb_mod_cvar_get(VALUE obj, VALUE iv)
/*
* call-seq:
* obj.class_variable_set(symbol, obj) => obj
- *
+ *
* Sets the class variable names by <i>symbol</i> to
* <i>object</i>.
- *
+ *
* class Fred
* @@foo = 99
* def foo
* @@foo
* end
* end
- * Fred.class_variable_set(:@@foo, 101) #=> 101
+ *
+ * def Fred.foo
+ * class_variable_set(:@@foo, 101) #=> 101
+ * end
+ * Fred.foo
* Fred.new.foo #=> 101
*/
static VALUE
-rb_mod_cvar_set(VALUE obj, VALUE iv, VALUE val)
+rb_mod_cvar_set(obj, iv, val)
+ VALUE obj, iv, val;
{
ID id = rb_to_id(iv);
if (!rb_is_class_id(id)) {
rb_name_error(id, "`%s' is not allowed as a class variable name", rb_id2name(id));
}
- rb_cvar_set(obj, id, val);
+ rb_cvar_set(obj, id, val, Qfalse);
return val;
}
@@ -1962,7 +2185,8 @@ rb_mod_cvar_set(VALUE obj, VALUE iv, VALUE val)
*/
static VALUE
-rb_mod_cvar_defined(VALUE obj, VALUE iv)
+rb_mod_cvar_defined(obj, iv)
+ VALUE obj, iv;
{
ID id = rb_to_id(iv);
@@ -1972,43 +2196,22 @@ rb_mod_cvar_defined(VALUE obj, VALUE iv)
return rb_cvar_defined(obj, id);
}
-static struct conv_method_tbl {
- const char *method;
- ID id;
-} conv_method_names[] = {
- {"to_int", 0},
- {"to_ary", 0},
- {"to_str", 0},
- {"to_sym", 0},
- {"to_hash", 0},
- {"to_proc", 0},
- {"to_io", 0},
- {"to_a", 0},
- {"to_s", 0},
- {NULL, 0}
-};
-
-static VALUE
-convert_type(VALUE val, const char *tname, const char *method, int raise)
-{
- ID m = 0;
- int i;
+static VALUE
+convert_type(val, tname, method, raise)
+ VALUE val;
+ const char *tname, *method;
+ int raise;
+{
+ ID m;
- for (i=0; conv_method_names[i].method; i++) {
- if (conv_method_names[i].method[0] == method[0] &&
- strcmp(conv_method_names[i].method, method) == 0) {
- m = conv_method_names[i].id;
- break;
- }
- }
- if (!m) m = rb_intern(method);
+ m = rb_intern(method);
if (!rb_respond_to(val, m)) {
if (raise) {
rb_raise(rb_eTypeError, "can't convert %s into %s",
NIL_P(val) ? "nil" :
val == Qtrue ? "true" :
val == Qfalse ? "false" :
- rb_obj_classname(val),
+ rb_obj_classname(val),
tname);
}
else {
@@ -2019,22 +2222,27 @@ convert_type(VALUE val, const char *tname, const char *method, int raise)
}
VALUE
-rb_convert_type(VALUE val, int type, const char *tname, const char *method)
+rb_convert_type(val, type, tname, method)
+ VALUE val;
+ int type;
+ const char *tname, *method;
{
VALUE v;
if (TYPE(val) == type) return val;
v = convert_type(val, tname, method, Qtrue);
if (TYPE(v) != type) {
- const char *cname = rb_obj_classname(val);
- rb_raise(rb_eTypeError, "can't convert %s to %s (%s#%s gives %s)",
- cname, tname, cname, method, rb_obj_classname(v));
+ rb_raise(rb_eTypeError, "%s#%s should return %s",
+ rb_obj_classname(val), method, tname);
}
return v;
}
VALUE
-rb_check_convert_type(VALUE val, int type, const char *tname, const char *method)
+rb_check_convert_type(val, type, tname, method)
+ VALUE val;
+ int type;
+ const char *tname, *method;
{
VALUE v;
@@ -2043,26 +2251,22 @@ rb_check_convert_type(VALUE val, int type, const char *tname, const char *method
v = convert_type(val, tname, method, Qfalse);
if (NIL_P(v)) return Qnil;
if (TYPE(v) != type) {
- const char *cname = rb_obj_classname(val);
- rb_raise(rb_eTypeError, "can't convert %s to %s (%s#%s gives %s)",
- cname, tname, cname, method, rb_obj_classname(v));
+ rb_raise(rb_eTypeError, "%s#%s should return %s",
+ rb_obj_classname(val), method, tname);
}
return v;
}
static VALUE
-rb_to_integer(VALUE val, const char *method)
+rb_to_integer(val, method)
+ VALUE val;
+ const char *method;
{
- VALUE v;
-
- if (FIXNUM_P(val)) return val;
- if (TYPE(val) == T_BIGNUM) return val;
- v = convert_type(val, "Integer", method, Qtrue);
+ VALUE v = convert_type(val, "Integer", method, Qtrue);
if (!rb_obj_is_kind_of(v, rb_cInteger)) {
- const char *cname = rb_obj_classname(val);
- rb_raise(rb_eTypeError, "can't convert %s to Integer (%s#%s gives %s)",
- cname, cname, method, rb_obj_classname(v));
+ rb_raise(rb_eTypeError, "%s#%s should return Integer",
+ rb_obj_classname(val), method);
}
return v;
}
@@ -2073,7 +2277,6 @@ rb_check_to_integer(VALUE val, const char *method)
VALUE v;
if (FIXNUM_P(val)) return val;
- if (TYPE(val) == T_BIGNUM) return val;
v = convert_type(val, "Integer", method, Qfalse);
if (!rb_obj_is_kind_of(v, rb_cInteger)) {
return Qnil;
@@ -2082,23 +2285,25 @@ rb_check_to_integer(VALUE val, const char *method)
}
VALUE
-rb_to_int(VALUE val)
+rb_to_int(val)
+ VALUE val;
{
return rb_to_integer(val, "to_int");
}
VALUE
-rb_Integer(VALUE val)
+rb_Integer(val)
+ VALUE val;
{
VALUE tmp;
switch (TYPE(val)) {
case T_FLOAT:
- if (RFLOAT_VALUE(val) <= (double)FIXNUM_MAX
- && RFLOAT_VALUE(val) >= (double)FIXNUM_MIN) {
+ if (RFLOAT(val)->value <= (double)FIXNUM_MAX
+ && RFLOAT(val)->value >= (double)FIXNUM_MIN) {
break;
}
- return rb_dbl2big(RFLOAT_VALUE(val));
+ return rb_dbl2big(RFLOAT(val)->value);
case T_FIXNUM:
case T_BIGNUM:
@@ -2107,10 +2312,6 @@ rb_Integer(VALUE val)
case T_STRING:
return rb_str_to_inum(val, 0, Qtrue);
- case T_NIL:
- rb_raise(rb_eTypeError, "can't convert nil into Integer");
- break;
-
default:
break;
}
@@ -2124,7 +2325,7 @@ rb_Integer(VALUE val)
/*
* call-seq:
* Integer(arg) => integer
- *
+ *
* Converts <i>arg</i> to a <code>Fixnum</code> or <code>Bignum</code>.
* Numeric types are converted directly (with floating point numbers
* being truncated). If <i>arg</i> is a <code>String</code>, leading
@@ -2132,20 +2333,23 @@ rb_Integer(VALUE val)
* <code>0x</code>) are honored. Others are converted using
* <code>to_int</code> and <code>to_i</code>. This behavior is
* different from that of <code>String#to_i</code>.
- *
+ *
* Integer(123.999) #=> 123
* Integer("0x1a") #=> 26
- * Integer(Time.new) #=> 1204973019
+ * Integer(Time.new) #=> 1049896590
*/
static VALUE
-rb_f_integer(VALUE obj, VALUE arg)
+rb_f_integer(obj, arg)
+ VALUE obj, arg;
{
return rb_Integer(arg);
}
double
-rb_cstr_to_dbl(const char *p, int badcheck)
+rb_cstr_to_dbl(p, badcheck)
+ const char *p;
+ int badcheck;
{
const char *q;
char *end;
@@ -2156,11 +2360,17 @@ rb_cstr_to_dbl(const char *p, int badcheck)
if (!p) return 0.0;
q = p;
- while (ISSPACE(*p)) p++;
+ if (badcheck) {
+ while (ISSPACE(*p)) p++;
+ }
+ else {
+ while (ISSPACE(*p) || *p == '_') p++;
+ }
+ errno = 0;
d = strtod(p, &end);
if (errno == ERANGE) {
OutOfRange();
- rb_warning("Float %.*s%s out of range", w, p, ellipsis);
+ rb_warn("Float %.*s%s out of range", w, p, ellipsis);
errno = 0;
}
if (p == end) {
@@ -2171,17 +2381,15 @@ rb_cstr_to_dbl(const char *p, int badcheck)
return d;
}
if (*end) {
- char buf[DBL_DIG * 4 + 10];
+ char *buf = ALLOCA_N(char, strlen(p)+1);
char *n = buf;
- char *e = buf + sizeof(buf) - 1;
- char prev = 0;
- while (p < end && n < e) prev = *n++ = *p++;
+ while (p < end) *n++ = *p++;
while (*p) {
if (*p == '_') {
/* remove underscores between digits */
if (badcheck) {
- if (n == buf || !ISDIGIT(prev)) goto bad;
+ if (n == buf || !ISDIGIT(n[-1])) goto bad;
++p;
if (!ISDIGIT(*p)) goto bad;
}
@@ -2190,15 +2398,14 @@ rb_cstr_to_dbl(const char *p, int badcheck)
continue;
}
}
- prev = *p++;
- if (n < e) *n++ = prev;
+ *n++ = *p++;
}
*n = '\0';
p = buf;
d = strtod(p, &end);
if (errno == ERANGE) {
OutOfRange();
- rb_warning("Float %.*s%s out of range", w, p, ellipsis);
+ rb_warn("Float %.*s%s out of range", w, p, ellipsis);
errno = 0;
}
if (badcheck) {
@@ -2216,14 +2423,16 @@ rb_cstr_to_dbl(const char *p, int badcheck)
}
double
-rb_str_to_dbl(VALUE str, int badcheck)
+rb_str_to_dbl(str, badcheck)
+ VALUE str;
+ int badcheck;
{
char *s;
long len;
StringValue(str);
- s = RSTRING_PTR(str);
- len = RSTRING_LEN(str);
+ s = RSTRING(str)->ptr;
+ len = RSTRING(str)->len;
if (s) {
if (s[len]) { /* no sentinel somehow */
char *p = ALLOCA_N(char, len+1);
@@ -2240,68 +2449,63 @@ rb_str_to_dbl(VALUE str, int badcheck)
}
VALUE
-rb_Float(VALUE val)
+rb_Float(val)
+ VALUE val;
{
switch (TYPE(val)) {
case T_FIXNUM:
- return DBL2NUM((double)FIX2LONG(val));
+ return rb_float_new((double)FIX2LONG(val));
case T_FLOAT:
return val;
case T_BIGNUM:
- return DBL2NUM(rb_big2dbl(val));
+ return rb_float_new(rb_big2dbl(val));
case T_STRING:
- return DBL2NUM(rb_str_to_dbl(val, Qtrue));
+ return rb_float_new(rb_str_to_dbl(val, Qtrue));
case T_NIL:
rb_raise(rb_eTypeError, "can't convert nil into Float");
break;
default:
- return rb_convert_type(val, T_FLOAT, "Float", "to_f");
+ {
+ VALUE f = rb_convert_type(val, T_FLOAT, "Float", "to_f");
+ if (isnan(RFLOAT(f)->value)) {
+ rb_raise(rb_eArgError, "invalid value for Float()");
+ }
+ return f;
+ }
}
}
/*
* call-seq:
* Float(arg) => float
- *
+ *
* Returns <i>arg</i> converted to a float. Numeric types are converted
* directly, the rest are converted using <i>arg</i>.to_f. As of Ruby
* 1.8, converting <code>nil</code> generates a <code>TypeError</code>.
- *
+ *
* Float(1) #=> 1.0
* Float("123.456") #=> 123.456
*/
static VALUE
-rb_f_float(VALUE obj, VALUE arg)
+rb_f_float(obj, arg)
+ VALUE obj, arg;
{
return rb_Float(arg);
}
-VALUE
-rb_to_float(VALUE val)
-{
- if (TYPE(val) == T_FLOAT) return val;
- if (!rb_obj_is_kind_of(val, rb_cNumeric)) {
- rb_raise(rb_eTypeError, "can't convert %s into Float",
- NIL_P(val) ? "nil" :
- val == Qtrue ? "true" :
- val == Qfalse ? "false" :
- rb_obj_classname(val));
- }
- return rb_convert_type(val, T_FLOAT, "Float", "to_f");
-}
-
double
-rb_num2dbl(VALUE val)
+rb_num2dbl(val)
+ VALUE val;
{
switch (TYPE(val)) {
case T_FLOAT:
- return RFLOAT_VALUE(val);
+ return RFLOAT(val)->value;
case T_STRING:
rb_raise(rb_eTypeError, "no implicit conversion to float from string");
@@ -2315,11 +2519,25 @@ rb_num2dbl(VALUE val)
break;
}
- return RFLOAT_VALUE(rb_Float(val));
+ return RFLOAT(rb_Float(val))->value;
+}
+
+char*
+rb_str2cstr(str, len)
+ VALUE str;
+ long *len;
+{
+ StringValue(str);
+ if (len) *len = RSTRING(str)->len;
+ else if (RTEST(ruby_verbose) && RSTRING(str)->len != strlen(RSTRING(str)->ptr)) {
+ rb_warn("string contains \\0 character");
+ }
+ return RSTRING(str)->ptr;
}
VALUE
-rb_String(VALUE val)
+rb_String(val)
+ VALUE val;
{
return rb_convert_type(val, T_STRING, "String", "to_s");
}
@@ -2328,23 +2546,26 @@ rb_String(VALUE val)
/*
* call-seq:
* String(arg) => string
- *
+ *
* Converts <i>arg</i> to a <code>String</code> by calling its
* <code>to_s</code> method.
- *
+ *
* String(self) #=> "main"
- * String(self.class) #=> "Object"
+ * String(self.class #=> "Object"
* String(123456) #=> "123456"
*/
static VALUE
-rb_f_string(VALUE obj, VALUE arg)
+rb_f_string(obj, arg)
+ VALUE obj, arg;
{
return rb_String(arg);
}
+#if 0
VALUE
-rb_Array(VALUE val)
+rb_Array(val)
+ VALUE val;
{
VALUE tmp = rb_check_array_type(val);
@@ -2356,25 +2577,31 @@ rb_Array(VALUE val)
}
return tmp;
}
+#endif
/*
* call-seq:
* Array(arg) => array
- *
+ *
* Returns <i>arg</i> as an <code>Array</code>. First tries to call
* <i>arg</i><code>.to_ary</code>, then <i>arg</i><code>.to_a</code>.
- *
+ * If both fail, creates a single element array containing <i>arg</i>
+ * (unless <i>arg</i> is <code>nil</code>).
+ *
* Array(1..5) #=> [1, 2, 3, 4, 5]
*/
static VALUE
-rb_f_array(VALUE obj, VALUE arg)
+rb_f_array(obj, arg)
+ VALUE obj, arg;
{
return rb_Array(arg);
}
static VALUE
-boot_defclass(const char *name, VALUE super)
+boot_defclass(name, super)
+ char *name;
+ VALUE super;
{
extern st_table *rb_class_tbl;
VALUE obj = rb_class_boot(super);
@@ -2386,18 +2613,14 @@ boot_defclass(const char *name, VALUE super)
return obj;
}
-static void
-boot_defmetametaclass(VALUE klass, VALUE metametaclass)
-{
- RBASIC(RBASIC(klass)->klass)->klass = metametaclass;
-}
+VALUE ruby_top_self;
/*
* Document-class: Class
*
* Classes in Ruby are first-class objects---each is an instance of
* class <code>Class</code>.
- *
+ *
* When a new class is created (typically using <code>class Name ...
* end</code>), an object of type <code>Class</code> is created and
* assigned to a global constant (<code>Name</code> in this case). When
@@ -2405,7 +2628,7 @@ boot_defmetametaclass(VALUE klass, VALUE metametaclass)
* <code>new</code> method in <code>Class</code> is run by default.
* This can be demonstrated by overriding <code>new</code> in
* <code>Class</code>:
- *
+ *
* class Class
* alias oldNew new
* def new(*args)
@@ -2413,117 +2636,76 @@ boot_defmetametaclass(VALUE klass, VALUE metametaclass)
* oldNew(*args)
* end
* end
- *
- *
+ *
+ *
* class Name
* end
- *
- *
+ *
+ *
* n = Name.new
- *
+ *
* <em>produces:</em>
- *
+ *
* Creating a new Name
- *
+ *
* Classes, modules, and objects are interrelated. In the diagram
* that follows, the vertical arrows represent inheritance, and the
- * parentheses meta-classes. All metaclasses are instances
+ * parentheses meta-classes. All metaclasses are instances
* of the class `Class'.
- * +---------+ +-...
- * | | |
- * BasicObject-----|-->(BasicObject)-------|-...
- * ^ | ^ |
- * | | | |
- * Object---------|----->(Object)---------|-...
- * ^ | ^ |
- * | | | |
- * +-------+ | +--------+ |
- * | | | | | |
- * | Module-|---------|--->(Module)-|-...
- * | ^ | | ^ |
- * | | | | | |
- * | Class-|---------|---->(Class)-|-...
- * | ^ | | ^ |
- * | +---+ | +----+
- * | |
- * obj--->OtherClass---------->(OtherClass)-----------...
*
+ * +------------------+
+ * | |
+ * Object---->(Object) |
+ * ^ ^ ^ ^ |
+ * | | | | |
+ * | | +-----+ +---------+ |
+ * | | | | |
+ * | +-----------+ | |
+ * | | | | |
+ * +------+ | Module--->(Module) |
+ * | | ^ ^ |
+ * OtherClass-->(OtherClass) | | |
+ * | | |
+ * Class---->(Class) |
+ * ^ |
+ * | |
+ * +----------------+
*/
-/*!
- * Initializes the world of objects and classes.
- *
- * At first, the function bootstraps the class hierarchy.
- * It initializes the most fundamental classes and their metaclasses.
- * - \c BasicObject
- * - \c Object
- * - \c Module
- * - \c Class
- * After the bootstrap step, the class hierarchy becomes as the following
- * diagram.
- *
- * \image html boottime-classes.png
- *
- * Then, the function defines classes, modules and methods as usual.
- * \ingroup class
- */
-
/*
- *
- * <code>BasicObject</code> is the parent class of all classes in Ruby.
- * It's an explicit blank class. <code>Object</code>, the root of Ruby's
- * class hierarchy is a direct subclass of <code>BasicObject</code>. Its
+ * <code>Object</code> is the parent class of all classes in Ruby. Its
* methods are therefore available to all objects unless explicitly
* overridden.
- *
+ *
* <code>Object</code> mixes in the <code>Kernel</code> module, making
* the built-in kernel functions globally accessible. Although the
* instance methods of <code>Object</code> are defined by the
* <code>Kernel</code> module, we have chosen to document them here for
* clarity.
- *
+ *
* In the descriptions of Object's methods, the parameter <i>symbol</i> refers
* to a symbol, which is either a quoted string or a
* <code>Symbol</code> (such as <code>:name</code>).
*/
void
-Init_Object(void)
+Init_Object()
{
- int i;
-
-#undef rb_intern
-#define rb_intern(str) rb_intern_const(str)
-
VALUE metaclass;
- rb_cBasicObject = boot_defclass("BasicObject", 0);
- rb_cObject = boot_defclass("Object", rb_cBasicObject);
+ rb_cObject = boot_defclass("Object", 0);
rb_cModule = boot_defclass("Module", rb_cObject);
rb_cClass = boot_defclass("Class", rb_cModule);
- metaclass = rb_make_metaclass(rb_cBasicObject, rb_cClass);
- metaclass = rb_make_metaclass(rb_cObject, metaclass);
+ metaclass = rb_make_metaclass(rb_cObject, rb_cClass);
metaclass = rb_make_metaclass(rb_cModule, metaclass);
metaclass = rb_make_metaclass(rb_cClass, metaclass);
- boot_defmetametaclass(rb_cModule, metaclass);
- boot_defmetametaclass(rb_cObject, metaclass);
- boot_defmetametaclass(rb_cBasicObject, metaclass);
-
- rb_define_private_method(rb_cBasicObject, "initialize", rb_obj_dummy, 0);
- rb_define_alloc_func(rb_cBasicObject, rb_class_allocate_instance);
- rb_define_method(rb_cBasicObject, "==", rb_obj_equal, 1);
- rb_define_method(rb_cBasicObject, "equal?", rb_obj_equal, 1);
- rb_define_method(rb_cBasicObject, "!", rb_obj_not, 0);
- rb_define_method(rb_cBasicObject, "!=", rb_obj_not_equal, 1);
-
- rb_define_private_method(rb_cBasicObject, "singleton_method_added", rb_obj_dummy, 1);
- rb_define_private_method(rb_cBasicObject, "singleton_method_removed", rb_obj_dummy, 1);
- rb_define_private_method(rb_cBasicObject, "singleton_method_undefined", rb_obj_dummy, 1);
rb_mKernel = rb_define_module("Kernel");
rb_include_module(rb_cObject, rb_mKernel);
+ rb_define_alloc_func(rb_cObject, rb_class_allocate_instance);
+ rb_define_private_method(rb_cObject, "initialize", rb_obj_dummy, 0);
rb_define_private_method(rb_cClass, "inherited", rb_obj_dummy, 1);
rb_define_private_method(rb_cModule, "included", rb_obj_dummy, 1);
rb_define_private_method(rb_cModule, "extended", rb_obj_dummy, 1);
@@ -2531,14 +2713,19 @@ Init_Object(void)
rb_define_private_method(rb_cModule, "method_removed", rb_obj_dummy, 1);
rb_define_private_method(rb_cModule, "method_undefined", rb_obj_dummy, 1);
+
rb_define_method(rb_mKernel, "nil?", rb_false, 0);
- rb_define_method(rb_mKernel, "===", rb_equal, 1);
- rb_define_method(rb_mKernel, "=~", rb_obj_match, 1);
- rb_define_method(rb_mKernel, "!~", rb_obj_not_match, 1);
+ rb_define_method(rb_mKernel, "==", rb_obj_equal, 1);
+ rb_define_method(rb_mKernel, "equal?", rb_obj_equal, 1);
+ rb_define_method(rb_mKernel, "===", rb_equal, 1);
+ rb_define_method(rb_mKernel, "=~", rb_obj_pattern_match, 1);
+
rb_define_method(rb_mKernel, "eql?", rb_obj_equal, 1);
- rb_define_method(rb_mKernel, "hash", rb_obj_hash, 0);
+ rb_define_method(rb_mKernel, "id", rb_obj_id_obsolete, 0);
+ rb_define_method(rb_mKernel, "type", rb_obj_type, 0);
rb_define_method(rb_mKernel, "class", rb_obj_class, 0);
+
rb_define_method(rb_mKernel, "clone", rb_obj_clone, 0);
rb_define_method(rb_mKernel, "dup", rb_obj_dup, 0);
rb_define_method(rb_mKernel, "initialize_copy", rb_obj_init_copy, 1);
@@ -2546,20 +2733,21 @@ Init_Object(void)
rb_define_method(rb_mKernel, "taint", rb_obj_taint, 0);
rb_define_method(rb_mKernel, "tainted?", rb_obj_tainted, 0);
rb_define_method(rb_mKernel, "untaint", rb_obj_untaint, 0);
- rb_define_method(rb_mKernel, "untrust", rb_obj_untrust, 0);
- rb_define_method(rb_mKernel, "untrusted?", rb_obj_untrusted, 0);
- rb_define_method(rb_mKernel, "trust", rb_obj_trust, 0);
rb_define_method(rb_mKernel, "freeze", rb_obj_freeze, 0);
rb_define_method(rb_mKernel, "frozen?", rb_obj_frozen_p, 0);
+ rb_define_method(rb_mKernel, "to_a", rb_any_to_a, 0); /* to be removed */
rb_define_method(rb_mKernel, "to_s", rb_any_to_s, 0);
rb_define_method(rb_mKernel, "inspect", rb_obj_inspect, 0);
rb_define_method(rb_mKernel, "methods", rb_obj_methods, -1);
- rb_define_method(rb_mKernel, "singleton_methods", rb_obj_singleton_methods, -1); /* in class.c */
- rb_define_method(rb_mKernel, "protected_methods", rb_obj_protected_methods, -1);
+ rb_define_method(rb_mKernel, "singleton_methods",
+ rb_obj_singleton_methods, -1); /* in class.c */
+ rb_define_method(rb_mKernel, "protected_methods",
+ rb_obj_protected_methods, -1);
rb_define_method(rb_mKernel, "private_methods", rb_obj_private_methods, -1);
rb_define_method(rb_mKernel, "public_methods", rb_obj_public_methods, -1);
- rb_define_method(rb_mKernel, "instance_variables", rb_obj_instance_variables, 0); /* in variable.c */
+ rb_define_method(rb_mKernel, "instance_variables",
+ rb_obj_instance_variables, 0); /* in variable.c */
rb_define_method(rb_mKernel, "instance_variable_get", rb_obj_ivar_get, 1);
rb_define_method(rb_mKernel, "instance_variable_set", rb_obj_ivar_set, 2);
rb_define_method(rb_mKernel, "instance_variable_defined?", rb_obj_ivar_defined, 1);
@@ -2571,8 +2759,12 @@ Init_Object(void)
rb_define_method(rb_mKernel, "is_a?", rb_obj_is_kind_of, 1);
rb_define_method(rb_mKernel, "tap", rb_obj_tap, 0);
+ rb_define_private_method(rb_mKernel, "singleton_method_added", rb_obj_dummy, 1);
+ rb_define_private_method(rb_mKernel, "singleton_method_removed", rb_obj_dummy, 1);
+ rb_define_private_method(rb_mKernel, "singleton_method_undefined", rb_obj_dummy, 1);
+
rb_define_global_function("sprintf", rb_f_sprintf, -1); /* in sprintf.c */
- rb_define_global_function("format", rb_f_sprintf, -1); /* in sprintf.c */
+ rb_define_global_function("format", rb_f_sprintf, -1); /* in sprintf.c */
rb_define_global_function("Integer", rb_f_integer, 1);
rb_define_global_function("Float", rb_f_float, 1);
@@ -2595,6 +2787,21 @@ Init_Object(void)
rb_undef_method(CLASS_OF(rb_cNilClass), "new");
rb_define_global_const("NIL", Qnil);
+ rb_cSymbol = rb_define_class("Symbol", rb_cObject);
+ rb_define_singleton_method(rb_cSymbol, "all_symbols",
+ rb_sym_all_symbols, 0); /* in parse.y */
+ rb_undef_alloc_func(rb_cSymbol);
+ rb_undef_method(CLASS_OF(rb_cSymbol), "new");
+
+ rb_define_method(rb_cSymbol, "to_i", sym_to_i, 0);
+ rb_define_method(rb_cSymbol, "to_int", sym_to_int, 0);
+ rb_define_method(rb_cSymbol, "inspect", sym_inspect, 0);
+ rb_define_method(rb_cSymbol, "to_s", sym_to_s, 0);
+ rb_define_method(rb_cSymbol, "id2name", sym_to_s, 0);
+ rb_define_method(rb_cSymbol, "to_sym", sym_to_sym, 0);
+ rb_define_method(rb_cSymbol, "to_proc", sym_to_proc, 0);
+ rb_define_method(rb_cSymbol, "===", rb_obj_equal, 1);
+
rb_define_method(rb_cModule, "freeze", rb_mod_freeze, 0);
rb_define_method(rb_cModule, "===", rb_mod_eqq, 1);
rb_define_method(rb_cModule, "==", rb_obj_equal, 1);
@@ -2605,7 +2812,8 @@ Init_Object(void)
rb_define_method(rb_cModule, ">=", rb_mod_ge, 1);
rb_define_method(rb_cModule, "initialize_copy", rb_mod_init_copy, 1); /* in class.c */
rb_define_method(rb_cModule, "to_s", rb_mod_to_s, 0);
- rb_define_method(rb_cModule, "included_modules", rb_mod_included_modules, 0); /* in class.c */
+ rb_define_method(rb_cModule, "included_modules",
+ rb_mod_included_modules, 0); /* in class.c */
rb_define_method(rb_cModule, "include?", rb_mod_include_p, 1); /* in class.c */
rb_define_method(rb_cModule, "name", rb_mod_name, 0); /* in variable.c */
rb_define_method(rb_cModule, "ancestors", rb_mod_ancestors, 0); /* in class.c */
@@ -2617,29 +2825,30 @@ Init_Object(void)
rb_define_alloc_func(rb_cModule, rb_module_s_alloc);
rb_define_method(rb_cModule, "initialize", rb_mod_initialize, 0);
- rb_define_method(rb_cModule, "instance_methods", rb_class_instance_methods, -1); /* in class.c */
- rb_define_method(rb_cModule, "public_instance_methods",
+ rb_define_method(rb_cModule, "instance_methods",
+ rb_class_instance_methods, -1); /* in class.c */
+ rb_define_method(rb_cModule, "public_instance_methods",
rb_class_public_instance_methods, -1); /* in class.c */
- rb_define_method(rb_cModule, "protected_instance_methods",
+ rb_define_method(rb_cModule, "protected_instance_methods",
rb_class_protected_instance_methods, -1); /* in class.c */
- rb_define_method(rb_cModule, "private_instance_methods",
+ rb_define_method(rb_cModule, "private_instance_methods",
rb_class_private_instance_methods, -1); /* in class.c */
- rb_define_method(rb_cModule, "constants", rb_mod_constants, -1); /* in variable.c */
- rb_define_method(rb_cModule, "const_get", rb_mod_const_get, -1);
+ rb_define_method(rb_cModule, "class_variable_defined?", rb_mod_cvar_defined, 1);
+ rb_define_method(rb_cModule, "constants", rb_mod_constants, 0); /* in variable.c */
+ rb_define_method(rb_cModule, "const_get", rb_mod_const_get, 1);
rb_define_method(rb_cModule, "const_set", rb_mod_const_set, 2);
- rb_define_method(rb_cModule, "const_defined?", rb_mod_const_defined, -1);
- rb_define_private_method(rb_cModule, "remove_const",
+ rb_define_method(rb_cModule, "const_defined?", rb_mod_const_defined, 1);
+ rb_define_private_method(rb_cModule, "remove_const",
rb_mod_remove_const, 1); /* in variable.c */
- rb_define_method(rb_cModule, "const_missing",
+ rb_define_method(rb_cModule, "const_missing",
rb_mod_const_missing, 1); /* in variable.c */
- rb_define_method(rb_cModule, "class_variables",
+ rb_define_method(rb_cModule, "class_variables",
rb_mod_class_variables, 0); /* in variable.c */
- rb_define_method(rb_cModule, "remove_class_variable",
- rb_mod_remove_cvar, 1); /* in variable.c */
- rb_define_method(rb_cModule, "class_variable_get", rb_mod_cvar_get, 1);
- rb_define_method(rb_cModule, "class_variable_set", rb_mod_cvar_set, 2);
- rb_define_method(rb_cModule, "class_variable_defined?", rb_mod_cvar_defined, 1);
+ rb_define_private_method(rb_cModule, "remove_class_variable",
+ rb_mod_remove_cvar, 1); /* in variable.c */
+ rb_define_private_method(rb_cModule, "class_variable_get", rb_mod_cvar_get, 1);
+ rb_define_private_method(rb_cModule, "class_variable_set", rb_mod_cvar_set, 2);
rb_define_method(rb_cClass, "allocate", rb_obj_alloc, 0);
rb_define_method(rb_cClass, "new", rb_class_new_instance, -1);
@@ -2653,6 +2862,10 @@ Init_Object(void)
rb_cData = rb_define_class("Data", rb_cObject);
rb_undef_alloc_func(rb_cData);
+ rb_global_variable(&ruby_top_self);
+ ruby_top_self = rb_obj_alloc(rb_cObject);
+ rb_define_singleton_method(ruby_top_self, "to_s", main_to_s, 0);
+
rb_cTrueClass = rb_define_class("TrueClass", rb_cObject);
rb_define_method(rb_cTrueClass, "to_s", true_to_s, 0);
rb_define_method(rb_cTrueClass, "&", true_and, 1);
@@ -2673,11 +2886,6 @@ Init_Object(void)
id_eq = rb_intern("==");
id_eql = rb_intern("eql?");
- id_match = rb_intern("=~");
id_inspect = rb_intern("inspect");
id_init_copy = rb_intern("initialize_copy");
-
- for (i=0; conv_method_names[i].method; i++) {
- conv_method_names[i].id = rb_intern(conv_method_names[i].method);
- }
}
diff --git a/pack.c b/pack.c
index 172534404d..7a04673309 100644
--- a/pack.c
+++ b/pack.c
@@ -3,17 +3,16 @@
pack.c -
$Author$
+ $Date$
created at: Thu Feb 10 15:17:05 JST 1994
- Copyright (C) 1993-2007 Yukihiro Matsumoto
+ Copyright (C) 1993-2003 Yukihiro Matsumoto
**********************************************************************/
-#include "ruby/ruby.h"
-#include "ruby/encoding.h"
+#include "ruby.h"
#include <sys/types.h>
#include <ctype.h>
-#include <errno.h>
#define SIZE16 2
#define SIZE32 4
@@ -53,7 +52,8 @@
#define define_swapx(x, xtype) \
static xtype \
-TOKEN_PASTE(swap,x)(xtype z) \
+TOKEN_PASTE(swap,x)(z) \
+ xtype z; \
{ \
xtype r; \
xtype *zp; \
@@ -68,8 +68,8 @@ TOKEN_PASTE(swap,x)(xtype z) \
t[sizeof(xtype)-i-1] = s[i]; \
} \
r = *(xtype *)t; \
- xfree(t); \
- xfree(zp); \
+ free(t); \
+ free(zp); \
return r; \
}
@@ -135,7 +135,8 @@ define_swapx(f,float)
#else
#if SIZEOF_LONG == 4 /* SIZEOF_DOUBLE == 8 && 4 == SIZEOF_LONG */
static double
-swapd(const double d)
+swapd(d)
+ const double d;
{
double dtmp = d;
unsigned long utmp[2];
@@ -152,7 +153,8 @@ swapd(const double d)
#else
#if SIZEOF_SHORT == 4 /* SIZEOF_DOUBLE == 8 && 4 == SIZEOF_SHORT */
static double
-swapd(const double d)
+swapd(d)
+ const double d;
{
double dtmp = d;
unsigned short utmp[2];
@@ -185,7 +187,7 @@ define_swapx(d, double)
#undef htonl
#endif
static int
-endian(void)
+endian()
{
static int init = 0;
static int endian_value;
@@ -329,10 +331,11 @@ endian(void)
#define VTOHD(x,y) vtohd(x)
#endif
-unsigned long rb_big2ulong_pack(VALUE x);
+unsigned long rb_big2ulong_pack _((VALUE x));
static unsigned long
-num2i32(VALUE x)
+num2i32(x)
+ VALUE x;
{
x = rb_to_int(x); /* is nil OK? (should not) */
@@ -345,13 +348,13 @@ num2i32(VALUE x)
}
#if SIZEOF_LONG == SIZE32
-# define EXTEND32(x)
+# define EXTEND32(x)
#else
/* invariant in modulo 1<<31 */
# define EXTEND32(x) do { if (!natint) {(x) = (((1L<<31)-1-(x))^~(~0L<<31));}} while(0)
#endif
#if SIZEOF_SHORT == SIZE16
-# define EXTEND16(x)
+# define EXTEND16(x)
#else
# define EXTEND16(x) do { if (!natint) {(x) = (short)(((1<<15)-1-(x))^~(~0<<15));}} while(0)
#endif
@@ -363,15 +366,16 @@ num2i32(VALUE x)
#endif
static const char toofew[] = "too few arguments";
-static void encodes(VALUE,const char*,long,int,int);
-static void qpencode(VALUE,VALUE,long);
+static void encodes _((VALUE,const char*,long,int));
+static void qpencode _((VALUE,VALUE,long));
-static unsigned long utf8_to_uv(const char*,long*);
+static int uv_to_utf8 _((char*,unsigned long));
+static unsigned long utf8_to_uv _((char*,long*));
/*
* call-seq:
* arr.pack ( aTemplateString ) -> aBinaryString
- *
+ *
* Packs the contents of <i>arr</i> into a binary sequence according to
* the directives in <i>aTemplateString</i> (see the table below)
* Directives ``A,'' ``a,'' and ``Z'' may be followed by a count,
@@ -384,24 +388,24 @@ static unsigned long utf8_to_uv(const char*,long*);
* platform's native size for the specified type; otherwise, they use a
* platform-independent size. Spaces are ignored in the template
* string. See also <code>String#unpack</code>.
- *
+ *
* a = [ "a", "b", "c" ]
* n = [ 65, 66, 67 ]
* a.pack("A3A3A3") #=> "a b c "
* a.pack("a3a3a3") #=> "a\000\000b\000\000c\000\000"
* n.pack("ccc") #=> "ABC"
- *
+ *
* Directives for +pack+.
*
* Directive Meaning
* ---------------------------------------------------------------
* @ | Moves to absolute position
- * A | arbitrary binary string (space padded, count is width)
- * a | arbitrary binary string (null padded, count is width)
+ * A | ASCII string (space padded, count is width)
+ * a | ASCII string (null padded, count is width)
* B | Bit string (descending bit order)
* b | Bit string (ascending bit order)
- * C | Unsigned byte (C unsigned char)
- * c | Byte (C char)
+ * C | Unsigned char
+ * c | Char
* D, d | Double-precision float, native format
* E | Double-precision float, little-endian byte order
* e | Single-precision float, little-endian byte order
@@ -415,8 +419,7 @@ static unsigned long utf8_to_uv(const char*,long*);
* L | Unsigned long
* l | Long
* M | Quoted printable, MIME encoding (see RFC2045)
- * m | Base64 encoded string (see RFC 2045, count is width)
- * | (if count is 0, no line feed are added, see RFC 4648)
+ * m | Base64 encoded string
* N | Long, network (big-endian) byte order
* n | Short, network (big-endian) byte-order
* P | Pointer to a structure (fixed-length string)
@@ -435,34 +438,34 @@ static unsigned long utf8_to_uv(const char*,long*);
*/
static VALUE
-pack_pack(VALUE ary, VALUE fmt)
+pack_pack(ary, fmt)
+ VALUE ary, fmt;
{
static const char nul10[] = "\0\0\0\0\0\0\0\0\0\0";
static const char spc10[] = " ";
- const char *p, *pend;
+ char *p, *pend;
VALUE res, from, associates = 0;
char type;
long items, len, idx, plen;
const char *ptr;
- int enc_info = 1; /* 0 - BINARY, 1 - US-ASCII, 2 - UTF-8 */
#ifdef NATINT_PACK
int natint; /* native integer */
#endif
StringValue(fmt);
- p = RSTRING_PTR(fmt);
- pend = p + RSTRING_LEN(fmt);
+ p = RSTRING(fmt)->ptr;
+ pend = p + RSTRING(fmt)->len;
res = rb_str_buf_new(0);
- items = RARRAY_LEN(ary);
+ items = RARRAY(ary)->len;
idx = 0;
#define TOO_FEW (rb_raise(rb_eArgError, toofew), 0)
-#define THISFROM (items > 0 ? RARRAY_PTR(ary)[idx] : TOO_FEW)
-#define NEXTFROM (items-- > 0 ? RARRAY_PTR(ary)[idx++] : TOO_FEW)
+#define THISFROM (items > 0 ? RARRAY(ary)->ptr[idx] : TOO_FEW)
+#define NEXTFROM (items-- > 0 ? RARRAY(ary)->ptr[idx++] : TOO_FEW)
while (p < pend) {
- if (RSTRING_PTR(fmt) + RSTRING_LEN(fmt) != pend) {
+ if (RSTRING(fmt)->ptr + RSTRING(fmt)->len != pend) {
rb_raise(rb_eRuntimeError, "format string modified");
}
type = *p++; /* get data type */
@@ -478,7 +481,7 @@ pack_pack(VALUE ary, VALUE fmt)
continue;
}
if (*p == '_' || *p == '!') {
- static const char natstr[] = "sSiIlL";
+ const char *natstr = "sSiIlL";
if (strchr(natstr, type)) {
#ifdef NATINT_PACK
@@ -497,30 +500,13 @@ pack_pack(VALUE ary, VALUE fmt)
p++;
}
else if (ISDIGIT(*p)) {
- errno = 0;
- len = STRTOUL(p, (char**)&p, 10);
- if (errno) {
- rb_raise(rb_eRangeError, "pack length too big");
- }
+ len = strtoul(p, (char**)&p, 10);
}
else {
len = 1;
}
switch (type) {
- case 'U':
- /* if encoding is US-ASCII, upgrade to UTF-8 */
- if (enc_info == 1) enc_info = 2;
- break;
- case 'm': case 'M': case 'u':
- /* keep US-ASCII (do nothing) */
- break;
- default:
- /* fall back to BINARY */
- enc_info = 0;
- break;
- }
- switch (type) {
case 'A': case 'a': case 'Z':
case 'B': case 'b':
case 'H': case 'h':
@@ -531,8 +517,8 @@ pack_pack(VALUE ary, VALUE fmt)
}
else {
StringValue(from);
- ptr = RSTRING_PTR(from);
- plen = RSTRING_LEN(from);
+ ptr = RSTRING(from)->ptr;
+ plen = RSTRING(from)->len;
OBJ_INFECT(res, from);
}
@@ -541,8 +527,8 @@ pack_pack(VALUE ary, VALUE fmt)
switch (type) {
case 'a': /* arbitrary binary string (null padded) */
- case 'A': /* arbitrary binary string (ASCII space padded) */
- case 'Z': /* null terminated string */
+ case 'A': /* ASCII string (space padded) */
+ case 'Z': /* null terminated ASCII string */
if (plen >= len) {
rb_str_buf_cat(res, ptr, len);
if (p[-1] == '*' && type == 'Z')
@@ -690,7 +676,7 @@ pack_pack(VALUE ary, VALUE fmt)
char c;
from = NEXTFROM;
- c = (char)num2i32(from);
+ c = num2i32(from);
rb_str_buf_cat(res, &c, sizeof(char));
}
break;
@@ -701,7 +687,7 @@ pack_pack(VALUE ary, VALUE fmt)
short s;
from = NEXTFROM;
- s = (short)num2i32(from);
+ s = num2i32(from);
rb_str_buf_cat(res, OFF16(&s), NATINT_LEN(short,2));
}
break;
@@ -709,11 +695,11 @@ pack_pack(VALUE ary, VALUE fmt)
case 'i': /* signed int */
case 'I': /* unsigned int */
while (len-- > 0) {
- int i;
+ long i;
from = NEXTFROM;
i = num2i32(from);
- rb_str_buf_cat(res, (char*)&i, sizeof(int));
+ rb_str_buf_cat(res, OFF32(&i), NATINT_LEN(int,4));
}
break;
@@ -744,7 +730,7 @@ pack_pack(VALUE ary, VALUE fmt)
unsigned short s;
from = NEXTFROM;
- s = (unsigned short)num2i32(from);
+ s = num2i32(from);
s = NATINT_HTONS(s);
rb_str_buf_cat(res, OFF16(&s), NATINT_LEN(short,2));
}
@@ -766,7 +752,7 @@ pack_pack(VALUE ary, VALUE fmt)
unsigned short s;
from = NEXTFROM;
- s = (unsigned short)num2i32(from);
+ s = num2i32(from);
s = NATINT_HTOVS(s);
rb_str_buf_cat(res, OFF16(&s), NATINT_LEN(short,2));
}
@@ -789,7 +775,7 @@ pack_pack(VALUE ary, VALUE fmt)
float f;
from = NEXTFROM;
- f = (float)RFLOAT_VALUE(rb_to_float(from));
+ f = RFLOAT(rb_Float(from))->value;
rb_str_buf_cat(res, (char*)&f, sizeof(float));
}
break;
@@ -800,7 +786,7 @@ pack_pack(VALUE ary, VALUE fmt)
FLOAT_CONVWITH(ftmp);
from = NEXTFROM;
- f = (float)RFLOAT_VALUE(rb_to_float(from));
+ f = RFLOAT(rb_Float(from))->value;
f = HTOVF(f,ftmp);
rb_str_buf_cat(res, (char*)&f, sizeof(float));
}
@@ -812,7 +798,7 @@ pack_pack(VALUE ary, VALUE fmt)
DOUBLE_CONVWITH(dtmp);
from = NEXTFROM;
- d = RFLOAT_VALUE(rb_to_float(from));
+ d = RFLOAT(rb_Float(from))->value;
d = HTOVD(d,dtmp);
rb_str_buf_cat(res, (char*)&d, sizeof(double));
}
@@ -824,7 +810,7 @@ pack_pack(VALUE ary, VALUE fmt)
double d;
from = NEXTFROM;
- d = RFLOAT_VALUE(rb_to_float(from));
+ d = RFLOAT(rb_Float(from))->value;
rb_str_buf_cat(res, (char*)&d, sizeof(double));
}
break;
@@ -835,7 +821,7 @@ pack_pack(VALUE ary, VALUE fmt)
FLOAT_CONVWITH(ftmp);
from = NEXTFROM;
- f = (float)RFLOAT_VALUE(rb_to_float(from));
+ f = RFLOAT(rb_Float(from))->value;
f = HTONF(f,ftmp);
rb_str_buf_cat(res, (char*)&f, sizeof(float));
}
@@ -847,7 +833,7 @@ pack_pack(VALUE ary, VALUE fmt)
DOUBLE_CONVWITH(dtmp);
from = NEXTFROM;
- d = RFLOAT_VALUE(rb_to_float(from));
+ d = RFLOAT(rb_Float(from))->value;
d = HTOND(d,dtmp);
rb_str_buf_cat(res, (char*)&d, sizeof(double));
}
@@ -864,14 +850,15 @@ pack_pack(VALUE ary, VALUE fmt)
case 'X': /* back up byte */
shrink:
- plen = RSTRING_LEN(res);
+ plen = RSTRING(res)->len;
if (plen < len)
rb_raise(rb_eArgError, "X outside of string");
- rb_str_set_len(res, plen - len);
+ RSTRING(res)->len = plen - len;
+ RSTRING(res)->ptr[plen - len] = '\0';
break;
case '@': /* null fill to absolute position */
- len -= RSTRING_LEN(res);
+ len -= RSTRING(res)->len;
if (len > 0) goto grow;
len = -len;
if (len > 0) goto shrink;
@@ -883,17 +870,17 @@ pack_pack(VALUE ary, VALUE fmt)
case 'U': /* Unicode character */
while (len-- > 0) {
- SIGNED_VALUE l;
+ long l;
char buf[8];
int le;
from = NEXTFROM;
from = rb_to_int(from);
- l = NUM2LONG(from);
+ l = NUM2INT(from);
if (l < 0) {
rb_raise(rb_eRangeError, "pack(U): value out of range");
}
- le = rb_uv_to_utf8(buf, l);
+ le = uv_to_utf8(buf, l);
rb_str_buf_cat(res, (char*)buf, le);
}
break;
@@ -902,14 +889,9 @@ pack_pack(VALUE ary, VALUE fmt)
case 'm': /* base64 encoded string */
from = NEXTFROM;
StringValue(from);
- ptr = RSTRING_PTR(from);
- plen = RSTRING_LEN(from);
+ ptr = RSTRING(from)->ptr;
+ plen = RSTRING(from)->len;
- if (len == 0 && type == 'm') {
- encodes(res, ptr, plen, type, 0);
- ptr += plen;
- break;
- }
if (len <= 2)
len = 45;
else
@@ -921,7 +903,7 @@ pack_pack(VALUE ary, VALUE fmt)
todo = len;
else
todo = plen;
- encodes(res, ptr, todo, type, 1);
+ encodes(res, ptr, todo, type);
plen -= todo;
ptr += todo;
}
@@ -938,9 +920,9 @@ pack_pack(VALUE ary, VALUE fmt)
from = THISFROM;
if (!NIL_P(from)) {
StringValue(from);
- if (RSTRING_LEN(from) < len) {
+ if (RSTRING(from)->len < len) {
rb_raise(rb_eArgError, "too short buffer for P(%ld for %ld)",
- RSTRING_LEN(from), len);
+ RSTRING(from)->len, len);
}
}
len = 1;
@@ -975,9 +957,9 @@ pack_pack(VALUE ary, VALUE fmt)
VALUE big128 = rb_uint2big(128);
while (TYPE(from) == T_BIGNUM) {
from = rb_big_divmod(from, big128);
- c = NUM2INT(RARRAY_PTR(from)[1]) | 0x80; /* mod */
+ c = NUM2INT(RARRAY(from)->ptr[1]) | 0x80; /* mod */
rb_str_buf_cat(buf, &c, sizeof(char));
- from = RARRAY_PTR(from)[0]; /* div */
+ from = RARRAY(from)->ptr[0]; /* div */
}
}
@@ -990,21 +972,21 @@ pack_pack(VALUE ary, VALUE fmt)
}
while (ul) {
- c = (char)(ul & 0x7f) | 0x80;
+ c = ((ul & 0x7f) | 0x80);
rb_str_buf_cat(buf, &c, sizeof(char));
ul >>= 7;
}
- if (RSTRING_LEN(buf)) {
- bufs = RSTRING_PTR(buf);
- bufe = bufs + RSTRING_LEN(buf) - 1;
+ if (RSTRING(buf)->len) {
+ bufs = RSTRING(buf)->ptr;
+ bufe = bufs + RSTRING(buf)->len - 1;
*bufs &= 0x7f; /* clear continue bit */
while (bufs < bufe) { /* reverse */
c = *bufs;
*bufs++ = *bufe;
*bufe-- = c;
}
- rb_str_buf_cat(res, RSTRING_PTR(buf), RSTRING_LEN(buf));
+ rb_str_buf_cat(res, RSTRING(buf)->ptr, RSTRING(buf)->len);
}
else {
c = 0;
@@ -1022,17 +1004,6 @@ pack_pack(VALUE ary, VALUE fmt)
rb_str_associate(res, associates);
}
OBJ_INFECT(res, fmt);
- switch (enc_info) {
- case 1:
- ENCODING_CODERANGE_SET(res, rb_usascii_encindex(), ENC_CODERANGE_7BIT);
- break;
- case 2:
- rb_enc_set_index(res, rb_utf8_encindex());
- break;
- default:
- /* do nothing, keep ASCII-8BIT */
- break;
- }
return res;
}
@@ -1042,35 +1013,32 @@ static const char b64_table[] =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
static void
-encodes(VALUE str, const char *s, long len, int type, int tail_lf)
+encodes(str, s, len, type)
+ VALUE str;
+ const char *s;
+ long len;
+ int type;
{
- char buff[4096];
+ char *buff = ALLOCA_N(char, len * 4 / 3 + 6);
long i = 0;
const char *trans = type == 'u' ? uu_table : b64_table;
int padding;
if (type == 'u') {
- buff[i++] = (char)len + ' ';
+ buff[i++] = len + ' ';
padding = '`';
}
else {
padding = '=';
}
while (len >= 3) {
- while (len >= 3 && sizeof(buff)-i >= 4) {
- buff[i++] = trans[077 & (*s >> 2)];
- buff[i++] = trans[077 & (((*s << 4) & 060) | ((s[1] >> 4) & 017))];
- buff[i++] = trans[077 & (((s[1] << 2) & 074) | ((s[2] >> 6) & 03))];
- buff[i++] = trans[077 & s[2]];
- s += 3;
- len -= 3;
- }
- if (sizeof(buff)-i < 4) {
- rb_str_buf_cat(str, buff, i);
- i = 0;
- }
+ buff[i++] = trans[077 & (*s >> 2)];
+ buff[i++] = trans[077 & (((*s << 4) & 060) | ((s[1] >> 4) & 017))];
+ buff[i++] = trans[077 & (((s[1] << 2) & 074) | ((s[2] >> 6) & 03))];
+ buff[i++] = trans[077 & s[2]];
+ s += 3;
+ len -= 3;
}
-
if (len == 2) {
buff[i++] = trans[077 & (*s >> 2)];
buff[i++] = trans[077 & (((*s << 4) & 060) | ((s[1] >> 4) & 017))];
@@ -1083,19 +1051,21 @@ encodes(VALUE str, const char *s, long len, int type, int tail_lf)
buff[i++] = padding;
buff[i++] = padding;
}
- if (tail_lf) buff[i++] = '\n';
+ buff[i++] = '\n';
rb_str_buf_cat(str, buff, i);
}
-static const char hex_table[] = "0123456789ABCDEF";
+static char hex_table[] = "0123456789ABCDEF";
static void
-qpencode(VALUE str, VALUE from, long len)
+qpencode(str, from, len)
+ VALUE str, from;
+ long len;
{
char buff[1024];
long i = 0, n = 0, prev = EOF;
- unsigned char *s = (unsigned char*)RSTRING_PTR(from);
- unsigned char *send = s + RSTRING_LEN(from);
+ unsigned char *s = (unsigned char*)RSTRING(from)->ptr;
+ unsigned char *send = s + RSTRING(from)->len;
while (s < send) {
if ((*s > 126) ||
@@ -1143,26 +1113,27 @@ qpencode(VALUE str, VALUE from, long len)
}
static inline int
-hex2num(char c)
+hex2num(c)
+ 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 '0': case '1': case '2': case '3': case '4':
+ case '5': case '6': case '7': case '8': case '9':
return c - '0';
- case 'a': case 'b': case 'c':
- case 'd': case 'e': case 'f':
+ case 'a': case 'b': case 'c':
+ case 'd': case 'e': case 'f':
return c - 'a' + 10;
- case 'A': case 'B': case 'C':
- case 'D': case 'E': case 'F':
+ case 'A': case 'B': case 'C':
+ case 'D': case 'E': case 'F':
return c - 'A' + 10;
- default:
+ default:
return -1;
}
}
#define PACK_LENGTH_ADJUST_SIZE(sz) do { \
tmp = 0; \
- if (len > (long)((send-s)/sz)) { \
+ if (len > (send-s)/sz) { \
if (!star) { \
tmp = len-(send-s)/sz; \
} \
@@ -1183,18 +1154,21 @@ hex2num(char c)
#define PACK_ITEM_ADJUST() while (tmp--) rb_ary_push(ary, Qnil)
static VALUE
-infected_str_new(const char *ptr, long len, VALUE str)
+infected_str_new(ptr, len, str)
+ const char *ptr;
+ long len;
+ VALUE str;
{
VALUE s = rb_str_new(ptr, len);
OBJ_INFECT(s, str);
return s;
}
-
+
/*
* call-seq:
* str.unpack(format) => anArray
- *
+ *
* Decodes <i>str</i> (which may contain binary data) according to the
* format string, returning an array of each value extracted. The
* format string consists of a sequence of single-character directives,
@@ -1207,7 +1181,7 @@ infected_str_new(const char *ptr, long len, VALUE str)
* platform's native size for the specified type; otherwise, it uses a
* platform-independent consistent size. Spaces are ignored in the
* format string. See also <code>Array#pack</code>.
- *
+ *
* "abc \0\0abc \0\0".unpack('A6Z6') #=> ["abc", "abc "]
* "abc \0\0".unpack('a3a3') #=> ["abc", " \000\000"]
* "abc \0abc \0".unpack('Z*Z*') #=> ["abc ", "abc "]
@@ -1219,21 +1193,20 @@ infected_str_new(const char *ptr, long len, VALUE str)
*
* This table summarizes the various formats and the Ruby classes
* returned by each.
- *
+ *
* Format | Returns | Function
* -------+---------+-----------------------------------------
- * A | String | arbitrary binary string with trailing
- * | | nulls and ASCII spaces removed
+ * A | String | with trailing nulls and spaces removed
* -------+---------+-----------------------------------------
- * a | String | arbitrary binary string
+ * a | String | string
* -------+---------+-----------------------------------------
* B | String | extract bits from each character (msb first)
* -------+---------+-----------------------------------------
* b | String | extract bits from each character (lsb first)
* -------+---------+-----------------------------------------
- * C | Fixnum | extract a byte (C char) as an unsigned integer
+ * C | Fixnum | extract a character as an unsigned integer
* -------+---------+-----------------------------------------
- * c | Fixnum | extract a byte (C char) as an integer
+ * c | Fixnum | extract a character as an integer
* -------+---------+-----------------------------------------
* d,D | Float | treat sizeof(double) characters as
* | | a native double
@@ -1277,8 +1250,7 @@ infected_str_new(const char *ptr, long len, VALUE str)
* -------+---------+-----------------------------------------
* M | String | quoted-printable
* -------+---------+-----------------------------------------
- * m | String | base64-encoded (RFC 2045) (default)
- * | | base64-encoded (RFC 4648) if followed by 0
+ * m | String | base64-encoded
* -------+---------+-----------------------------------------
* N | Integer | treat four characters as an unsigned
* | | long in network byte order
@@ -1293,17 +1265,17 @@ infected_str_new(const char *ptr, long len, VALUE str)
* p | String | treat sizeof(char *) characters as a
* | | pointer to a null-terminated string
* -------+---------+-----------------------------------------
- * Q | Integer | treat 8 characters as an unsigned
+ * Q | Integer | treat 8 characters as an unsigned
* | | quad word (64 bits)
* -------+---------+-----------------------------------------
- * q | Integer | treat 8 characters as a signed
+ * q | Integer | treat 8 characters as a signed
* | | quad word (64 bits)
* -------+---------+-----------------------------------------
* S | Fixnum | treat two (different if _ used)
* | | successive characters as an unsigned
* | | short in native byte order
* -------+---------+-----------------------------------------
- * s | Fixnum | Treat two (different if _ used)
+ * s | Fixnum | Treat two (different if _ used)
* | | successive characters as a signed short
* | | in native byte order
* -------+---------+-----------------------------------------
@@ -1326,15 +1298,16 @@ infected_str_new(const char *ptr, long len, VALUE str)
* Z | String | with trailing nulls removed
* | | upto first null with *
* -------+---------+-----------------------------------------
- * @ | --- | skip to the offset given by the
+ * @ | --- | skip to the offset given by the
* | | length argument
* -------+---------+-----------------------------------------
*/
static VALUE
-pack_unpack(VALUE str, VALUE fmt)
+pack_unpack(str, fmt)
+ VALUE str, fmt;
{
- static const char hexdigits[] = "0123456789abcdef";
+ static const char hexdigits[] = "0123456789abcdef0123456789ABCDEFx";
char *s, *send;
char *p, *pend;
VALUE ary;
@@ -1344,25 +1317,15 @@ pack_unpack(VALUE str, VALUE fmt)
#ifdef NATINT_PACK
int natint; /* native integer */
#endif
- int block_p = rb_block_given_p();
-#define UNPACK_PUSH(item) do {\
- VALUE item_val = (item);\
- if (block_p) {\
- rb_yield(item_val);\
- }\
- else {\
- rb_ary_push(ary, item_val);\
- }\
- } while (0)
StringValue(str);
StringValue(fmt);
- s = RSTRING_PTR(str);
- send = s + RSTRING_LEN(str);
- p = RSTRING_PTR(fmt);
- pend = p + RSTRING_LEN(fmt);
+ s = RSTRING(str)->ptr;
+ send = s + RSTRING(str)->len;
+ p = RSTRING(fmt)->ptr;
+ pend = p + RSTRING(fmt)->len;
- ary = block_p ? Qnil : rb_ary_new();
+ ary = rb_ary_new();
while (p < pend) {
type = *p++;
#ifdef NATINT_PACK
@@ -1398,11 +1361,7 @@ pack_unpack(VALUE str, VALUE fmt)
p++;
}
else if (ISDIGIT(*p)) {
- errno = 0;
- len = STRTOUL(p, (char**)&p, 10);
- if (errno) {
- rb_raise(rb_eRangeError, "pack length too big");
- }
+ len = strtoul(p, (char**)&p, 10);
}
else {
len = (type != '@');
@@ -1423,7 +1382,7 @@ pack_unpack(VALUE str, VALUE fmt)
if (*t != ' ' && *t != '\0') break;
t--; len--;
}
- UNPACK_PUSH(infected_str_new(s, len, str));
+ rb_ary_push(ary, infected_str_new(s, len, str));
s += end;
}
break;
@@ -1434,7 +1393,7 @@ pack_unpack(VALUE str, VALUE fmt)
if (len > send-s) len = send-s;
while (t < s+len && *t) t++;
- UNPACK_PUSH(infected_str_new(s, t-s, str));
+ rb_ary_push(ary, infected_str_new(s, t-s, str));
if (t < send) t++;
s = star ? t : s+len;
}
@@ -1442,7 +1401,7 @@ pack_unpack(VALUE str, VALUE fmt)
case 'a':
if (len > send - s) len = send - s;
- UNPACK_PUSH(infected_str_new(s, len, str));
+ rb_ary_push(ary, infected_str_new(s, len, str));
s += len;
break;
@@ -1456,8 +1415,8 @@ pack_unpack(VALUE str, VALUE fmt)
if (p[-1] == '*' || len > (send - s) * 8)
len = (send - s) * 8;
bits = 0;
- UNPACK_PUSH(bitstr = rb_str_new(0, len));
- t = RSTRING_PTR(bitstr);
+ rb_ary_push(ary, bitstr = rb_str_new(0, len));
+ t = RSTRING(bitstr)->ptr;
for (i=0; i<len; i++) {
if (i & 7) bits >>= 1;
else bits = *s++;
@@ -1476,8 +1435,8 @@ pack_unpack(VALUE str, VALUE fmt)
if (p[-1] == '*' || len > (send - s) * 8)
len = (send - s) * 8;
bits = 0;
- UNPACK_PUSH(bitstr = rb_str_new(0, len));
- t = RSTRING_PTR(bitstr);
+ rb_ary_push(ary, bitstr = rb_str_new(0, len));
+ t = RSTRING(bitstr)->ptr;
for (i=0; i<len; i++) {
if (i & 7) bits <<= 1;
else bits = *s++;
@@ -1496,8 +1455,8 @@ pack_unpack(VALUE str, VALUE fmt)
if (p[-1] == '*' || len > (send - s) * 2)
len = (send - s) * 2;
bits = 0;
- UNPACK_PUSH(bitstr = rb_str_new(0, len));
- t = RSTRING_PTR(bitstr);
+ rb_ary_push(ary, bitstr = rb_str_new(0, len));
+ t = RSTRING(bitstr)->ptr;
for (i=0; i<len; i++) {
if (i & 1)
bits >>= 4;
@@ -1518,8 +1477,8 @@ pack_unpack(VALUE str, VALUE fmt)
if (p[-1] == '*' || len > (send - s) * 2)
len = (send - s) * 2;
bits = 0;
- UNPACK_PUSH(bitstr = rb_str_new(0, len));
- t = RSTRING_PTR(bitstr);
+ rb_ary_push(ary, bitstr = rb_str_new(0, len));
+ t = RSTRING(bitstr)->ptr;
for (i=0; i<len; i++) {
if (i & 1)
bits <<= 4;
@@ -1535,7 +1494,7 @@ pack_unpack(VALUE str, VALUE fmt)
while (len-- > 0) {
int c = *s++;
if (c > (char)127) c-=256;
- UNPACK_PUSH(INT2FIX(c));
+ rb_ary_push(ary, INT2FIX(c));
}
PACK_ITEM_ADJUST();
break;
@@ -1544,7 +1503,7 @@ pack_unpack(VALUE str, VALUE fmt)
PACK_LENGTH_ADJUST(unsigned char,sizeof(unsigned char));
while (len-- > 0) {
unsigned char c = *s++;
- UNPACK_PUSH(INT2FIX(c));
+ rb_ary_push(ary, INT2FIX(c));
}
PACK_ITEM_ADJUST();
break;
@@ -1556,7 +1515,7 @@ pack_unpack(VALUE str, VALUE fmt)
memcpy(OFF16(&tmp), s, NATINT_LEN(short,2));
EXTEND16(tmp);
s += NATINT_LEN(short,2);
- UNPACK_PUSH(INT2FIX(tmp));
+ rb_ary_push(ary, INT2FIX(tmp));
}
PACK_ITEM_ADJUST();
break;
@@ -1567,7 +1526,7 @@ pack_unpack(VALUE str, VALUE fmt)
unsigned short tmp = 0;
memcpy(OFF16(&tmp), s, NATINT_LEN(unsigned short,2));
s += NATINT_LEN(unsigned short,2);
- UNPACK_PUSH(INT2FIX(tmp));
+ rb_ary_push(ary, INT2FIX(tmp));
}
PACK_ITEM_ADJUST();
break;
@@ -1578,7 +1537,7 @@ pack_unpack(VALUE str, VALUE fmt)
int tmp;
memcpy(&tmp, s, sizeof(int));
s += sizeof(int);
- UNPACK_PUSH(INT2NUM(tmp));
+ rb_ary_push(ary, INT2NUM(tmp));
}
PACK_ITEM_ADJUST();
break;
@@ -1589,7 +1548,7 @@ pack_unpack(VALUE str, VALUE fmt)
unsigned int tmp;
memcpy(&tmp, s, sizeof(unsigned int));
s += sizeof(unsigned int);
- UNPACK_PUSH(UINT2NUM(tmp));
+ rb_ary_push(ary, UINT2NUM(tmp));
}
PACK_ITEM_ADJUST();
break;
@@ -1601,17 +1560,18 @@ pack_unpack(VALUE str, VALUE fmt)
memcpy(OFF32(&tmp), s, NATINT_LEN(long,4));
EXTEND32(tmp);
s += NATINT_LEN(long,4);
- UNPACK_PUSH(LONG2NUM(tmp));
+ rb_ary_push(ary, LONG2NUM(tmp));
}
PACK_ITEM_ADJUST();
break;
+
case 'L':
PACK_LENGTH_ADJUST(unsigned long,4);
while (len-- > 0) {
unsigned long tmp = 0;
memcpy(OFF32(&tmp), s, NATINT_LEN(unsigned long,4));
s += NATINT_LEN(unsigned long,4);
- UNPACK_PUSH(ULONG2NUM(tmp));
+ rb_ary_push(ary, ULONG2NUM(tmp));
}
PACK_ITEM_ADJUST();
break;
@@ -1621,16 +1581,17 @@ pack_unpack(VALUE str, VALUE fmt)
while (len-- > 0) {
char *tmp = (char*)s;
s += QUAD_SIZE;
- UNPACK_PUSH(rb_quad_unpack(tmp, 1));
+ rb_ary_push(ary, rb_quad_unpack(tmp, 1));
}
PACK_ITEM_ADJUST();
break;
+
case 'Q':
PACK_LENGTH_ADJUST_SIZE(QUAD_SIZE);
while (len-- > 0) {
char *tmp = (char*)s;
s += QUAD_SIZE;
- UNPACK_PUSH(rb_quad_unpack(tmp, 0));
+ rb_ary_push(ary, rb_quad_unpack(tmp, 0));
}
break;
@@ -1640,7 +1601,7 @@ pack_unpack(VALUE str, VALUE fmt)
unsigned short tmp = 0;
memcpy(OFF16B(&tmp), s, NATINT_LEN(unsigned short,2));
s += NATINT_LEN(unsigned short,2);
- UNPACK_PUSH(UINT2NUM(ntohs(tmp)));
+ rb_ary_push(ary, UINT2NUM(ntohs(tmp)));
}
PACK_ITEM_ADJUST();
break;
@@ -1651,7 +1612,7 @@ pack_unpack(VALUE str, VALUE fmt)
unsigned long tmp = 0;
memcpy(OFF32B(&tmp), s, NATINT_LEN(unsigned long,4));
s += NATINT_LEN(unsigned long,4);
- UNPACK_PUSH(ULONG2NUM(ntohl(tmp)));
+ rb_ary_push(ary, ULONG2NUM(ntohl(tmp)));
}
PACK_ITEM_ADJUST();
break;
@@ -1660,9 +1621,9 @@ pack_unpack(VALUE str, VALUE fmt)
PACK_LENGTH_ADJUST(unsigned short,2);
while (len-- > 0) {
unsigned short tmp = 0;
- memcpy(&tmp, s, NATINT_LEN(unsigned short,2));
+ memcpy(OFF16(&tmp), s, NATINT_LEN(unsigned short,2));
s += NATINT_LEN(unsigned short,2);
- UNPACK_PUSH(UINT2NUM(vtohs(tmp)));
+ rb_ary_push(ary, UINT2NUM(vtohs(tmp)));
}
PACK_ITEM_ADJUST();
break;
@@ -1671,9 +1632,9 @@ pack_unpack(VALUE str, VALUE fmt)
PACK_LENGTH_ADJUST(unsigned long,4);
while (len-- > 0) {
unsigned long tmp = 0;
- memcpy(&tmp, s, NATINT_LEN(long,4));
+ memcpy(OFF32(&tmp), s, NATINT_LEN(long,4));
s += NATINT_LEN(long,4);
- UNPACK_PUSH(ULONG2NUM(vtohl(tmp)));
+ rb_ary_push(ary, ULONG2NUM(vtohl(tmp)));
}
PACK_ITEM_ADJUST();
break;
@@ -1685,7 +1646,7 @@ pack_unpack(VALUE str, VALUE fmt)
float tmp;
memcpy(&tmp, s, sizeof(float));
s += sizeof(float);
- UNPACK_PUSH(DBL2NUM((double)tmp));
+ rb_ary_push(ary, rb_float_new((double)tmp));
}
PACK_ITEM_ADJUST();
break;
@@ -1699,11 +1660,11 @@ pack_unpack(VALUE str, VALUE fmt)
memcpy(&tmp, s, sizeof(float));
s += sizeof(float);
tmp = VTOHF(tmp,ftmp);
- UNPACK_PUSH(DBL2NUM((double)tmp));
+ rb_ary_push(ary, rb_float_new((double)tmp));
}
PACK_ITEM_ADJUST();
break;
-
+
case 'E':
PACK_LENGTH_ADJUST(double,sizeof(double));
while (len-- > 0) {
@@ -1713,11 +1674,11 @@ pack_unpack(VALUE str, VALUE fmt)
memcpy(&tmp, s, sizeof(double));
s += sizeof(double);
tmp = VTOHD(tmp,dtmp);
- UNPACK_PUSH(DBL2NUM(tmp));
+ rb_ary_push(ary, rb_float_new(tmp));
}
PACK_ITEM_ADJUST();
break;
-
+
case 'D':
case 'd':
PACK_LENGTH_ADJUST(double,sizeof(double));
@@ -1725,7 +1686,7 @@ pack_unpack(VALUE str, VALUE fmt)
double tmp;
memcpy(&tmp, s, sizeof(double));
s += sizeof(double);
- UNPACK_PUSH(DBL2NUM(tmp));
+ rb_ary_push(ary, rb_float_new(tmp));
}
PACK_ITEM_ADJUST();
break;
@@ -1739,11 +1700,11 @@ pack_unpack(VALUE str, VALUE fmt)
memcpy(&tmp, s, sizeof(float));
s += sizeof(float);
tmp = NTOHF(tmp,ftmp);
- UNPACK_PUSH(DBL2NUM((double)tmp));
+ rb_ary_push(ary, rb_float_new((double)tmp));
}
PACK_ITEM_ADJUST();
break;
-
+
case 'G':
PACK_LENGTH_ADJUST(double,sizeof(double));
while (len-- > 0) {
@@ -1753,11 +1714,11 @@ pack_unpack(VALUE str, VALUE fmt)
memcpy(&tmp, s, sizeof(double));
s += sizeof(double);
tmp = NTOHD(tmp,dtmp);
- UNPACK_PUSH(DBL2NUM(tmp));
+ rb_ary_push(ary, rb_float_new(tmp));
}
PACK_ITEM_ADJUST();
break;
-
+
case 'U':
if (len > send - s) len = send - s;
while (len > 0 && s < send) {
@@ -1766,14 +1727,14 @@ pack_unpack(VALUE str, VALUE fmt)
l = utf8_to_uv(s, &alen);
s += alen; len--;
- UNPACK_PUSH(ULONG2NUM(l));
+ rb_ary_push(ary, ULONG2NUM(l));
}
break;
case 'u':
{
VALUE buf = infected_str_new(0, (send - s)*3/4, str);
- char *ptr = RSTRING_PTR(buf);
+ char *ptr = RSTRING(buf)->ptr;
long total = 0;
while (s < send && *s > ' ' && *s < 'a') {
@@ -1783,9 +1744,9 @@ pack_unpack(VALUE str, VALUE fmt)
hunk[3] = '\0';
len = (*s++ - ' ') & 077;
total += len;
- if (total > RSTRING_LEN(buf)) {
- len -= total - RSTRING_LEN(buf);
- total = RSTRING_LEN(buf);
+ if (total > RSTRING(buf)->len) {
+ len -= total - RSTRING(buf)->len;
+ total = RSTRING(buf)->len;
}
while (len > 0) {
@@ -1807,9 +1768,9 @@ pack_unpack(VALUE str, VALUE fmt)
d = (*s++ - ' ') & 077;
else
d = 0;
- hunk[0] = (char)(a << 2 | b >> 4);
- hunk[1] = (char)(b << 4 | c >> 2);
- hunk[2] = (char)(c << 6 | d);
+ hunk[0] = a << 2 | b >> 4;
+ hunk[1] = b << 4 | c >> 2;
+ hunk[2] = c << 6 | d;
memcpy(ptr, hunk, mlen);
ptr += mlen;
len -= mlen;
@@ -1819,96 +1780,68 @@ pack_unpack(VALUE str, VALUE fmt)
else if (s < send && (s+1 == send || s[1] == '\n'))
s += 2; /* possible checksum byte */
}
-
- rb_str_set_len(buf, total);
- UNPACK_PUSH(buf);
+
+ RSTRING(buf)->ptr[total] = '\0';
+ RSTRING(buf)->len = total;
+ rb_ary_push(ary, buf);
}
break;
case 'm':
{
VALUE buf = infected_str_new(0, (send - s)*3/4, str);
- char *ptr = RSTRING_PTR(buf);
- int a = -1,b = -1,c = 0,d = 0;
- static signed char b64_xtable[256];
+ char *ptr = RSTRING(buf)->ptr;
+ int a = -1,b = -1,c = 0,d;
+ static int first = 1;
+ static int b64_xtable[256];
- if (b64_xtable['/'] <= 0) {
+ if (first) {
int i;
+ first = 0;
for (i = 0; i < 256; i++) {
b64_xtable[i] = -1;
}
for (i = 0; i < 64; i++) {
- b64_xtable[(unsigned char)b64_table[i]] = i;
+ b64_xtable[(int)b64_table[i]] = i;
}
}
- if (len == 0) {
- while (s < send) {
- a = b = c = d = -1;
- a = b64_xtable[(unsigned char)*s++];
- if (s >= send || a == -1) rb_raise(rb_eArgError, "invalid base64");
- b = b64_xtable[(unsigned char)*s++];
- if (s >= send || b == -1) rb_raise(rb_eArgError, "invalid base64");
- if (*s == '=') {
- if (s + 2 == send && *(s + 1) == '=') break;
- rb_raise(rb_eArgError, "invalid base64");
- }
- c = b64_xtable[(unsigned char)*s++];
- if (s >= send || c == -1) rb_raise(rb_eArgError, "invalid base64");
- if (s + 1 == send && *s == '=') break;
- d = b64_xtable[(unsigned char)*s++];
- if (d == -1) rb_raise(rb_eArgError, "invalid base64");
- *ptr++ = a << 2 | b >> 4;
- *ptr++ = b << 4 | c >> 2;
- *ptr++ = c << 6 | d;
- }
- if (c == -1) {
- *ptr++ = a << 2 | b >> 4;
- if (b & 0xf) rb_raise(rb_eArgError, "invalid base64");
- }
- else if (d == -1) {
- *ptr++ = a << 2 | b >> 4;
- *ptr++ = b << 4 | c >> 2;
- if (c & 0x3) rb_raise(rb_eArgError, "invalid base64");
- }
+ while (s < send) {
+ a = b = c = d = -1;
+ while((a = b64_xtable[(int)(*(unsigned char*)s)]) == -1 && s < send) { s++; }
+ if( s >= send ) break;
+ s++;
+ while((b = b64_xtable[(int)(*(unsigned char*)s)]) == -1 && s < send) { s++; }
+ if( s >= send ) break;
+ s++;
+ while((c = b64_xtable[(int)(*(unsigned char*)s)]) == -1 && s < send) { if( *s == '=' ) break; s++; }
+ if( *s == '=' || s >= send ) break;
+ s++;
+ while((d = b64_xtable[(int)(*(unsigned char*)s)]) == -1 && s < send) { if( *s == '=' ) break; s++; }
+ if( *s == '=' || s >= send ) break;
+ s++;
+ *ptr++ = a << 2 | b >> 4;
+ *ptr++ = b << 4 | c >> 2;
+ *ptr++ = c << 6 | d;
}
- else {
- while (s < send) {
- a = b = c = d = -1;
- while ((a = b64_xtable[(unsigned char)*s]) == -1 && s < send) {s++;}
- if (s >= send) break;
- s++;
- while ((b = b64_xtable[(unsigned char)*s]) == -1 && s < send) {s++;}
- if (s >= send) break;
- s++;
- while ((c = b64_xtable[(unsigned char)*s]) == -1 && s < send) {if (*s == '=') break; s++;}
- if (*s == '=' || s >= send) break;
- s++;
- while ((d = b64_xtable[(unsigned char)*s]) == -1 && s < send) {if (*s == '=') break; s++;}
- if (*s == '=' || s >= send) break;
- s++;
+ if (a != -1 && b != -1) {
+ if (c == -1 && *s == '=')
+ *ptr++ = a << 2 | b >> 4;
+ else if (c != -1 && *s == '=') {
*ptr++ = a << 2 | b >> 4;
*ptr++ = b << 4 | c >> 2;
- *ptr++ = c << 6 | d;
- }
- if (a != -1 && b != -1) {
- if (c == -1 && *s == '=')
- *ptr++ = a << 2 | b >> 4;
- else if (c != -1 && *s == '=') {
- *ptr++ = a << 2 | b >> 4;
- *ptr++ = b << 4 | c >> 2;
- }
}
}
- rb_str_set_len(buf, ptr - RSTRING_PTR(buf));
- UNPACK_PUSH(buf);
+ *ptr = '\0';
+ RSTRING(buf)->len = ptr - RSTRING(buf)->ptr;
+ rb_ary_push(ary, buf);
}
break;
case 'M':
{
VALUE buf = infected_str_new(0, send - s, str);
- char *ptr = RSTRING_PTR(buf);
+ char *ptr = RSTRING(buf)->ptr;
int c1, c2;
while (s < send) {
@@ -1928,20 +1861,20 @@ pack_unpack(VALUE str, VALUE fmt)
}
s++;
}
- rb_str_set_len(buf, ptr - RSTRING_PTR(buf));
- ENCODING_CODERANGE_SET(buf, rb_usascii_encindex(), ENC_CODERANGE_7BIT);
- UNPACK_PUSH(buf);
+ *ptr = '\0';
+ RSTRING(buf)->len = ptr - RSTRING(buf)->ptr;
+ rb_ary_push(ary, buf);
}
break;
case '@':
- if (len > RSTRING_LEN(str))
+ if (len > RSTRING(str)->len)
rb_raise(rb_eArgError, "@ outside of string");
- s = RSTRING_PTR(str) + len;
+ s = RSTRING(str)->ptr + len;
break;
case 'X':
- if (len > s - RSTRING_PTR(str))
+ if (len > s - RSTRING(str)->ptr)
rb_raise(rb_eArgError, "X outside of string");
s -= len;
break;
@@ -1966,11 +1899,11 @@ pack_unpack(VALUE str, VALUE fmt)
if (!(a = rb_str_associated(str))) {
rb_raise(rb_eArgError, "no associated pointer");
}
- p = RARRAY_PTR(a);
- pend = p + RARRAY_LEN(a);
+ p = RARRAY(a)->ptr;
+ pend = p + RARRAY(a)->len;
while (p < pend) {
- if (TYPE(*p) == T_STRING && RSTRING_PTR(*p) == t) {
- if (len < RSTRING_LEN(*p)) {
+ if (TYPE(*p) == T_STRING && RSTRING(*p)->ptr == t) {
+ if (len < RSTRING(*p)->len) {
tmp = rb_tainted_str_new(t, len);
rb_str_associate(tmp, a);
}
@@ -1985,12 +1918,12 @@ pack_unpack(VALUE str, VALUE fmt)
rb_raise(rb_eArgError, "non associated pointer");
}
}
- UNPACK_PUSH(tmp);
+ rb_ary_push(ary, tmp);
}
break;
case 'p':
- if (len > (long)((send - s) / sizeof(char *)))
+ if (len > (send - s) / sizeof(char *))
len = (send - s) / sizeof(char *);
while (len-- > 0) {
if (send - s < sizeof(char *))
@@ -2008,10 +1941,10 @@ pack_unpack(VALUE str, VALUE fmt)
if (!(a = rb_str_associated(str))) {
rb_raise(rb_eArgError, "no associated pointer");
}
- p = RARRAY_PTR(a);
- pend = p + RARRAY_LEN(a);
+ p = RARRAY(a)->ptr;
+ pend = p + RARRAY(a)->len;
while (p < pend) {
- if (TYPE(*p) == T_STRING && RSTRING_PTR(*p) == t) {
+ if (TYPE(*p) == T_STRING && RSTRING(*p)->ptr == t) {
tmp = *p;
break;
}
@@ -2021,7 +1954,7 @@ pack_unpack(VALUE str, VALUE fmt)
rb_raise(rb_eArgError, "non associated pointer");
}
}
- UNPACK_PUSH(tmp);
+ rb_ary_push(ary, tmp);
}
}
break;
@@ -2035,7 +1968,7 @@ pack_unpack(VALUE str, VALUE fmt)
ul <<= 7;
ul |= (*s & 0x7f);
if (!(*s++ & 0x80)) {
- UNPACK_PUSH(ULONG2NUM(ul));
+ rb_ary_push(ary, ULONG2NUM(ul));
len--;
ul = 0;
}
@@ -2046,7 +1979,7 @@ pack_unpack(VALUE str, VALUE fmt)
big = rb_big_mul(big, big128);
big = rb_big_plus(big, rb_uint2big(*s & 0x7f));
if (!(*s++ & 0x80)) {
- UNPACK_PUSH(big);
+ rb_ary_push(ary, big);
len--;
ul = 0;
break;
@@ -2067,46 +2000,48 @@ pack_unpack(VALUE str, VALUE fmt)
#define BYTEWIDTH 8
-int
-rb_uv_to_utf8(char buf[6], unsigned long uv)
+static int
+uv_to_utf8(buf, uv)
+ char *buf;
+ unsigned long uv;
{
if (uv <= 0x7f) {
buf[0] = (char)uv;
return 1;
}
if (uv <= 0x7ff) {
- buf[0] = (char)((uv>>6)&0xff)|0xc0;
- buf[1] = (char)(uv&0x3f)|0x80;
+ buf[0] = ((uv>>6)&0xff)|0xc0;
+ buf[1] = (uv&0x3f)|0x80;
return 2;
}
if (uv <= 0xffff) {
- buf[0] = (char)((uv>>12)&0xff)|0xe0;
- buf[1] = (char)((uv>>6)&0x3f)|0x80;
- buf[2] = (char)(uv&0x3f)|0x80;
+ buf[0] = ((uv>>12)&0xff)|0xe0;
+ buf[1] = ((uv>>6)&0x3f)|0x80;
+ buf[2] = (uv&0x3f)|0x80;
return 3;
}
if (uv <= 0x1fffff) {
- buf[0] = (char)((uv>>18)&0xff)|0xf0;
- buf[1] = (char)((uv>>12)&0x3f)|0x80;
- buf[2] = (char)((uv>>6)&0x3f)|0x80;
- buf[3] = (char)(uv&0x3f)|0x80;
+ buf[0] = ((uv>>18)&0xff)|0xf0;
+ buf[1] = ((uv>>12)&0x3f)|0x80;
+ buf[2] = ((uv>>6)&0x3f)|0x80;
+ buf[3] = (uv&0x3f)|0x80;
return 4;
}
if (uv <= 0x3ffffff) {
- buf[0] = (char)((uv>>24)&0xff)|0xf8;
- buf[1] = (char)((uv>>18)&0x3f)|0x80;
- buf[2] = (char)((uv>>12)&0x3f)|0x80;
- buf[3] = (char)((uv>>6)&0x3f)|0x80;
- buf[4] = (char)(uv&0x3f)|0x80;
+ buf[0] = ((uv>>24)&0xff)|0xf8;
+ buf[1] = ((uv>>18)&0x3f)|0x80;
+ buf[2] = ((uv>>12)&0x3f)|0x80;
+ buf[3] = ((uv>>6)&0x3f)|0x80;
+ buf[4] = (uv&0x3f)|0x80;
return 5;
}
if (uv <= 0x7fffffff) {
- buf[0] = (char)((uv>>30)&0xff)|0xfc;
- buf[1] = (char)((uv>>24)&0x3f)|0x80;
- buf[2] = (char)((uv>>18)&0x3f)|0x80;
- buf[3] = (char)((uv>>12)&0x3f)|0x80;
- buf[4] = (char)((uv>>6)&0x3f)|0x80;
- buf[5] = (char)(uv&0x3f)|0x80;
+ buf[0] = ((uv>>30)&0xff)|0xfc;
+ buf[1] = ((uv>>24)&0x3f)|0x80;
+ buf[2] = ((uv>>18)&0x3f)|0x80;
+ buf[3] = ((uv>>12)&0x3f)|0x80;
+ buf[4] = ((uv>>6)&0x3f)|0x80;
+ buf[5] = (uv&0x3f)|0x80;
return 6;
}
rb_raise(rb_eRangeError, "pack(U): value out of range");
@@ -2123,7 +2058,9 @@ static const unsigned long utf8_limits[] = {
};
static unsigned long
-utf8_to_uv(const char *p, long *lenp)
+utf8_to_uv(p, lenp)
+ char *p;
+ long *lenp;
{
int c = *p++ & 0xff;
unsigned long uv = c;
@@ -2148,7 +2085,7 @@ utf8_to_uv(const char *p, long *lenp)
rb_raise(rb_eArgError, "malformed UTF-8 character");
}
if (n > *lenp) {
- rb_raise(rb_eArgError, "malformed UTF-8 character (expected %ld bytes, given %ld bytes)",
+ rb_raise(rb_eArgError, "malformed UTF-8 character (expected %d bytes, given %d bytes)",
n, *lenp);
}
*lenp = n--;
@@ -2173,7 +2110,7 @@ utf8_to_uv(const char *p, long *lenp)
}
void
-Init_pack(void)
+Init_pack()
{
rb_define_method(rb_cArray, "pack", pack_pack, 1);
rb_define_method(rb_cString, "unpack", pack_unpack, 1);
diff --git a/parse.y b/parse.y
index 4636b4de30..9f14466816 100644
--- a/parse.y
+++ b/parse.y
@@ -3,9 +3,10 @@
parse.y -
$Author$
+ $Date$
created at: Fri May 28 18:02:42 JST 1993
- Copyright (C) 1993-2007 Yukihiro Matsumoto
+ Copyright (C) 1993-2003 Yukihiro Matsumoto
**********************************************************************/
@@ -13,33 +14,49 @@
#define YYDEBUG 1
#define YYERROR_VERBOSE 1
+#ifndef YYSTACK_USE_ALLOCA
#define YYSTACK_USE_ALLOCA 0
+#endif
-#include "ruby/ruby.h"
-#include "ruby/st.h"
-#include "ruby/encoding.h"
+#include "ruby.h"
+#include "env.h"
+#include "intern.h"
#include "node.h"
-#include "parse.h"
-#include "id.h"
-#include "regenc.h"
+#include "st.h"
#include <stdio.h>
#include <errno.h>
#include <ctype.h>
-#define YYMALLOC(size) rb_parser_malloc(parser, size)
-#define YYREALLOC(ptr, size) rb_parser_realloc(parser, ptr, size)
-#define YYCALLOC(nelem, size) rb_parser_calloc(parser, nelem, size)
-#define YYFREE(ptr) rb_parser_free(parser, ptr)
+#define YYMALLOC rb_parser_malloc
+#define YYREALLOC rb_parser_realloc
+#define YYCALLOC rb_parser_calloc
+#define YYFREE rb_parser_free
#define malloc YYMALLOC
#define realloc YYREALLOC
#define calloc YYCALLOC
#define free YYFREE
+static void *rb_parser_malloc _((size_t));
+static void *rb_parser_realloc _((void *, size_t));
+static void *rb_parser_calloc _((size_t, size_t));
+static void rb_parser_free _((void *));
-#ifndef RIPPER
-static ID register_symid(ID, const char *, long, rb_encoding *);
-#define REGISTER_SYMID(id, name) register_symid(id, name, strlen(name), enc)
-#include "id.c"
-#endif
+#define yyparse ruby_yyparse
+#define yylex ruby_yylex
+#define yyerror ruby_yyerror
+#define yylval ruby_yylval
+#define yychar ruby_yychar
+#define yydebug ruby_yydebug
+
+#define ID_SCOPE_SHIFT 3
+#define ID_SCOPE_MASK 0x07
+#define ID_LOCAL 0x01
+#define ID_INSTANCE 0x02
+#define ID_GLOBAL 0x03
+#define ID_ATTRSET 0x04
+#define ID_CONST 0x05
+#define ID_CLASS 0x06
+#define ID_JUNK 0x07
+#define ID_INTERNAL ID_JUNK
#define is_notop_id(id) ((id)>tLAST_TOKEN)
#define is_local_id(id) (is_notop_id(id)&&((id)&ID_SCOPE_MASK)==ID_LOCAL)
@@ -55,408 +72,120 @@ static ID register_symid(ID, const char *, long, rb_encoding *);
((id)&ID_SCOPE_MASK) == ID_INSTANCE || \
((id)&ID_SCOPE_MASK) == ID_CLASS))
-enum lex_state_e {
+NODE *ruby_eval_tree_begin = 0;
+NODE *ruby_eval_tree = 0;
+
+char *ruby_sourcefile; /* current source file */
+int ruby_sourceline; /* current line no. */
+
+static int yylex();
+static int yyerror();
+
+static enum lex_state {
EXPR_BEG, /* ignore newline, +/- is a sign. */
EXPR_END, /* newline significant, +/- is an operator. */
- EXPR_ENDARG, /* ditto, and unbound braces. */
EXPR_ARG, /* newline significant, +/- is an operator. */
EXPR_CMDARG, /* newline significant, +/- is an operator. */
+ EXPR_ENDARG, /* newline significant, +/- is an operator. */
EXPR_MID, /* newline significant, +/- is an operator. */
EXPR_FNAME, /* ignore newline, no reserved words. */
EXPR_DOT, /* right after `.' or `::', no reserved words. */
EXPR_CLASS, /* immediate after `class', no here document. */
- EXPR_VALUE /* alike EXPR_BEG but label is disallowed. */
-};
+} lex_state;
+static NODE *lex_strterm;
-typedef VALUE stack_type;
+#ifdef HAVE_LONG_LONG
+typedef unsigned LONG_LONG stack_type;
+#else
+typedef unsigned long stack_type;
+#endif
-# define BITSTACK_PUSH(stack, n) (stack = (stack<<1)|((n)&1))
-# define BITSTACK_POP(stack) (stack = stack >> 1)
-# define BITSTACK_LEXPOP(stack) (stack = (stack >> 1) | (stack & 1))
-# define BITSTACK_SET_P(stack) (stack&1)
+#define BITSTACK_PUSH(stack, n) (stack = (stack<<1)|((n)&1))
+#define BITSTACK_POP(stack) (stack >>= 1)
+#define BITSTACK_LEXPOP(stack) (stack = (stack >> 1) | (stack & 1))
+#define BITSTACK_SET_P(stack) (stack&1)
+static stack_type cond_stack = 0;
#define COND_PUSH(n) BITSTACK_PUSH(cond_stack, n)
#define COND_POP() BITSTACK_POP(cond_stack)
#define COND_LEXPOP() BITSTACK_LEXPOP(cond_stack)
#define COND_P() BITSTACK_SET_P(cond_stack)
+static stack_type cmdarg_stack = 0;
#define CMDARG_PUSH(n) BITSTACK_PUSH(cmdarg_stack, n)
#define CMDARG_POP() BITSTACK_POP(cmdarg_stack)
#define CMDARG_LEXPOP() BITSTACK_LEXPOP(cmdarg_stack)
#define CMDARG_P() BITSTACK_SET_P(cmdarg_stack)
-struct vtable {
- ID *tbl;
- int pos;
- int capa;
- struct vtable *prev;
-};
-
-struct local_vars {
- struct vtable *args;
- struct vtable *vars;
- struct local_vars *prev;
-};
-
-#define DVARS_INHERIT ((void*)1)
-#define DVARS_TOPSCOPE NULL
-#define DVARS_SPECIAL_P(tbl) (!POINTER_P(tbl))
-#define POINTER_P(val) ((VALUE)(val) & ~(VALUE)3)
+static int class_nest = 0;
+static int in_single = 0;
+static int in_def = 0;
+static int compile_for_eval = 0;
+static ID cur_mid = 0;
+static int command_start = Qtrue;
-#ifndef RIPPER
-static int
-vtable_size(const struct vtable *tbl)
-{
- if (POINTER_P(tbl)) {
- return tbl->pos;
- }
- else {
- return 0;
- }
-}
+static NODE *deferred_nodes;
-#define VTBL_DEBUG 0
+static NODE *cond();
+static NODE *logop();
+static int cond_negative();
-static struct vtable *
-vtable_alloc(struct vtable *prev)
-{
- struct vtable *tbl = ALLOC(struct vtable);
- tbl->pos = 0;
- tbl->capa = 8;
- tbl->tbl = ALLOC_N(ID, tbl->capa);
- tbl->prev = prev;
- if (VTBL_DEBUG) printf("vtable_alloc: %p\n", (void *)tbl);
- return tbl;
-}
+static NODE *newline_node();
+static void fixpos();
-static void
-vtable_free(struct vtable *tbl)
-{
- if (VTBL_DEBUG)printf("vtable_free: %p\n", (void *)tbl);
- if (POINTER_P(tbl)) {
- if (tbl->tbl) {
- xfree(tbl->tbl);
- }
- xfree(tbl);
- }
-}
-
-static void
-vtable_add(struct vtable *tbl, ID id)
-{
- if (!POINTER_P(tbl)) {
- rb_bug("vtable_add: vtable is not allocated (%p)", (void *)tbl);
- }
- if (VTBL_DEBUG) printf("vtable_add: %p, %s\n", (void *)tbl, rb_id2name(id));
-
- if (tbl->pos == tbl->capa) {
- tbl->capa = tbl->capa * 2;
- REALLOC_N(tbl->tbl, ID, tbl->capa);
- }
- tbl->tbl[tbl->pos++] = id;
-}
-
-static int
-vtable_included(const struct vtable * tbl, ID id)
-{
- int i;
-
- if (POINTER_P(tbl)) {
- for (i = 0; i < tbl->pos; i++) {
- if (tbl->tbl[i] == id) {
- return 1;
- }
- }
- }
- return 0;
-}
-
-
-typedef struct token_info {
- const char *token;
- int linenum;
- int column;
- int nonspc;
- struct token_info *next;
-} token_info;
-#endif
-
-/*
- Structure of Lexer Buffer:
-
- lex_pbeg tokp lex_p lex_pend
- | | | |
- |-----------+--------------+------------|
- |<------------>|
- token
-*/
-struct parser_params {
- int is_ripper;
- NODE *heap;
-
- YYSTYPE *parser_yylval;
- VALUE eofp;
-
- NODE *parser_lex_strterm;
- enum lex_state_e parser_lex_state;
- stack_type parser_cond_stack;
- stack_type parser_cmdarg_stack;
- int parser_class_nest;
- int parser_paren_nest;
- int parser_lpar_beg;
- int parser_in_single;
- int parser_in_def;
- int parser_compile_for_eval;
- VALUE parser_cur_mid;
- int parser_in_defined;
- char *parser_tokenbuf;
- int parser_tokidx;
- int parser_toksiz;
- VALUE parser_lex_input;
- VALUE parser_lex_lastline;
- VALUE parser_lex_nextline;
- const char *parser_lex_pbeg;
- const char *parser_lex_p;
- const char *parser_lex_pend;
- int parser_heredoc_end;
- int parser_command_start;
- NODE *parser_deferred_nodes;
- long parser_lex_gets_ptr;
- VALUE (*parser_lex_gets)(struct parser_params*,VALUE);
- struct local_vars *parser_lvtbl;
- int parser_ruby__end__seen;
- int line_count;
- int has_shebang;
- char *parser_ruby_sourcefile; /* current source file */
- int parser_ruby_sourceline; /* current line no. */
- rb_encoding *enc;
- rb_encoding *utf8;
-
- int parser_yydebug;
-
-#ifndef RIPPER
- /* Ruby core only */
- NODE *parser_eval_tree_begin;
- NODE *parser_eval_tree;
- VALUE debug_lines;
- VALUE coverage;
- int nerr;
-
- token_info *parser_token_info;
-#else
- /* Ripper only */
- VALUE parser_ruby_sourcefile_string;
- const char *tokp;
- VALUE delayed;
- int delayed_line;
- int delayed_col;
-
- VALUE value;
- VALUE result;
- VALUE parsing_thread;
- int toplevel_p;
-#endif
-};
-
-#define UTF8_ENC() (parser->utf8 ? parser->utf8 : \
- (parser->utf8 = rb_utf8_encoding()))
-#define STR_NEW(p,n) rb_enc_str_new((p),(n),parser->enc)
-#define STR_NEW0() rb_enc_str_new(0,0,parser->enc)
-#define STR_NEW2(p) rb_enc_str_new((p),strlen(p),parser->enc)
-#define STR_NEW3(p,n,e,func) parser_str_new((p),(n),(e),(func),parser->enc)
-#define ENC_SINGLE(cr) ((cr)==ENC_CODERANGE_7BIT)
-#define TOK_INTERN(mb) rb_intern3(tok(), toklen(), parser->enc)
-
-#ifdef YYMALLOC
-void *rb_parser_malloc(struct parser_params *, size_t);
-void *rb_parser_realloc(struct parser_params *, void *, size_t);
-void *rb_parser_calloc(struct parser_params *, size_t, size_t);
-void rb_parser_free(struct parser_params *, void *);
-#endif
-
-static int parser_yyerror(struct parser_params*, const char*);
-#define yyerror(msg) parser_yyerror(parser, msg)
-
-#define YYLEX_PARAM parser
-
-#define lex_strterm (parser->parser_lex_strterm)
-#define lex_state (parser->parser_lex_state)
-#define cond_stack (parser->parser_cond_stack)
-#define cmdarg_stack (parser->parser_cmdarg_stack)
-#define class_nest (parser->parser_class_nest)
-#define paren_nest (parser->parser_paren_nest)
-#define lpar_beg (parser->parser_lpar_beg)
-#define in_single (parser->parser_in_single)
-#define in_def (parser->parser_in_def)
-#define compile_for_eval (parser->parser_compile_for_eval)
-#define cur_mid (parser->parser_cur_mid)
-#define in_defined (parser->parser_in_defined)
-#define tokenbuf (parser->parser_tokenbuf)
-#define tokidx (parser->parser_tokidx)
-#define toksiz (parser->parser_toksiz)
-#define lex_input (parser->parser_lex_input)
-#define lex_lastline (parser->parser_lex_lastline)
-#define lex_nextline (parser->parser_lex_nextline)
-#define lex_pbeg (parser->parser_lex_pbeg)
-#define lex_p (parser->parser_lex_p)
-#define lex_pend (parser->parser_lex_pend)
-#define heredoc_end (parser->parser_heredoc_end)
-#define command_start (parser->parser_command_start)
-#define deferred_nodes (parser->parser_deferred_nodes)
-#define lex_gets_ptr (parser->parser_lex_gets_ptr)
-#define lex_gets (parser->parser_lex_gets)
-#define lvtbl (parser->parser_lvtbl)
-#define ruby__end__seen (parser->parser_ruby__end__seen)
-#define ruby_sourceline (parser->parser_ruby_sourceline)
-#define ruby_sourcefile (parser->parser_ruby_sourcefile)
-#define yydebug (parser->parser_yydebug)
-#ifdef RIPPER
-#else
-#define ruby_eval_tree (parser->parser_eval_tree)
-#define ruby_eval_tree_begin (parser->parser_eval_tree_begin)
-#define ruby_debug_lines (parser->debug_lines)
-#define ruby_coverage (parser->coverage)
-#endif
-
-static int yylex(void*, void*);
-
-#ifndef RIPPER
-#define yyparse ruby_yyparse
-
-static NODE* node_newnode(struct parser_params *, enum node_type, VALUE, VALUE, VALUE);
-#define rb_node_newnode(type, a1, a2, a3) node_newnode(parser, type, a1, a2, a3)
-
-static NODE *cond_gen(struct parser_params*,NODE*);
-#define cond(node) cond_gen(parser, node)
-static NODE *logop_gen(struct parser_params*,enum node_type,NODE*,NODE*);
-#define logop(type,node1,node2) logop_gen(parser, type, node1, node2)
-
-static NODE *newline_node(NODE*);
-static void fixpos(NODE*,NODE*);
-
-static int value_expr_gen(struct parser_params*,NODE*);
-static void void_expr_gen(struct parser_params*,NODE*);
-static NODE *remove_begin(NODE*);
-#define value_expr(node) value_expr_gen(parser, (node) = remove_begin(node))
-#define void_expr0(node) void_expr_gen(parser, (node))
+static int value_expr0();
+static void void_expr0();
+static void void_stmts();
+static NODE *remove_begin();
+#define value_expr(node) value_expr0((node) = remove_begin(node))
#define void_expr(node) void_expr0((node) = remove_begin(node))
-static void void_stmts_gen(struct parser_params*,NODE*);
-#define void_stmts(node) void_stmts_gen(parser, node)
-static void reduce_nodes_gen(struct parser_params*,NODE**);
-#define reduce_nodes(n) reduce_nodes_gen(parser,n)
-static void block_dup_check_gen(struct parser_params*,NODE*,NODE*);
-#define block_dup_check(n1,n2) block_dup_check_gen(parser,n1,n2)
-
-static NODE *block_append_gen(struct parser_params*,NODE*,NODE*);
-#define block_append(h,t) block_append_gen(parser,h,t)
-static NODE *list_append_gen(struct parser_params*,NODE*,NODE*);
-#define list_append(l,i) list_append_gen(parser,l,i)
-static NODE *list_concat_gen(struct parser_params*,NODE*,NODE*);
-#define list_concat(h,t) list_concat_gen(parser,h,t)
-static NODE *arg_append_gen(struct parser_params*,NODE*,NODE*);
-#define arg_append(h,t) arg_append_gen(parser,h,t)
-static NODE *arg_concat_gen(struct parser_params*,NODE*,NODE*);
-#define arg_concat(h,t) arg_concat_gen(parser,h,t)
-static NODE *literal_concat_gen(struct parser_params*,NODE*,NODE*);
-#define literal_concat(h,t) literal_concat_gen(parser,h,t)
-static NODE *new_evstr_gen(struct parser_params*,NODE*);
-#define new_evstr(n) new_evstr_gen(parser,n)
-static NODE *evstr2dstr_gen(struct parser_params*,NODE*);
-#define evstr2dstr(n) evstr2dstr_gen(parser,n)
-static NODE *splat_array(NODE*);
-
-static NODE *call_bin_op_gen(struct parser_params*,NODE*,ID,NODE*);
-#define call_bin_op(recv,id,arg1) call_bin_op_gen(parser, recv,id,arg1)
-static NODE *call_uni_op_gen(struct parser_params*,NODE*,ID);
-#define call_uni_op(recv,id) call_uni_op_gen(parser, recv,id)
-
-static NODE *new_args_gen(struct parser_params*,NODE*,NODE*,ID,NODE*,ID);
-#define new_args(f,o,r,p,b) new_args_gen(parser, f,o,r,p,b)
-static void shadowing_lvar_gen(struct parser_params*,ID);
-#define shadowing_lvar(name) shadowing_lvar_gen(parser, name)
-
-static NODE *negate_lit(NODE*);
-static NODE *ret_args_gen(struct parser_params*,NODE*);
-#define ret_args(node) ret_args_gen(parser, node)
-static NODE *arg_blk_pass(NODE*,NODE*);
-static NODE *new_yield_gen(struct parser_params*,NODE*);
-#define new_yield(node) new_yield_gen(parser, node)
-
-static NODE *gettable_gen(struct parser_params*,ID);
-#define gettable(id) gettable_gen(parser,id)
-static NODE *assignable_gen(struct parser_params*,ID,NODE*);
-#define assignable(id,node) assignable_gen(parser, id, node)
-static void new_bv_gen(struct parser_params*,ID);
-#define new_bv(id) new_bv_gen(parser, id)
-static NODE *aryset_gen(struct parser_params*,NODE*,NODE*);
-#define aryset(node1,node2) aryset_gen(parser, node1, node2)
-static NODE *attrset_gen(struct parser_params*,NODE*,ID);
-#define attrset(node,id) attrset_gen(parser, node, id)
-
-static void rb_backref_error_gen(struct parser_params*,NODE*);
-#define rb_backref_error(n) rb_backref_error_gen(parser,n)
-static NODE *node_assign_gen(struct parser_params*,NODE*,NODE*);
-#define node_assign(node1, node2) node_assign_gen(parser, node1, node2)
-
-static NODE *match_op_gen(struct parser_params*,NODE*,NODE*);
-#define match_op(node1,node2) match_op_gen(parser, node1, node2)
-
-static void local_push_gen(struct parser_params*,int);
-#define local_push(top) local_push_gen(parser,top)
-static void local_pop_gen(struct parser_params*);
-#define local_pop() local_pop_gen(parser)
-static int local_var_gen(struct parser_params*, ID);
-#define local_var(id) local_var_gen(parser, id);
-static int arg_var_gen(struct parser_params*, ID);
-#define arg_var(id) arg_var_gen(parser, id)
-static int local_id_gen(struct parser_params*, ID);
-#define local_id(id) local_id_gen(parser, id)
-static ID *local_tbl_gen(struct parser_params*);
-#define local_tbl() local_tbl_gen(parser)
-static ID internal_id_gen(struct parser_params*);
-#define internal_id() internal_id_gen(parser)
-
-static void dyna_push_gen(struct parser_params*);
-#define dyna_push() dyna_push_gen(parser)
-static void dyna_pop_gen(struct parser_params*);
-#define dyna_pop() dyna_pop_gen(parser)
-static int dyna_in_block_gen(struct parser_params*);
-#define dyna_in_block() dyna_in_block_gen(parser)
-#define dyna_var(id) local_var(id)
-static int dvar_defined_gen(struct parser_params*,ID);
-#define dvar_defined(id) dvar_defined_gen(parser, id)
-static int dvar_curr_gen(struct parser_params*,ID);
-#define dvar_curr(id) dvar_curr_gen(parser, id)
-
-static void fixup_nodes(NODE **);
-
-extern int rb_dvar_defined(ID);
-extern int rb_local_defined(ID);
-extern int rb_parse_in_eval(void);
-extern int rb_parse_in_main(void);
-
-static VALUE reg_compile_gen(struct parser_params*, VALUE, int);
-#define reg_compile(str,options) reg_compile_gen(parser, str, options)
-static void reg_fragment_setenc_gen(struct parser_params*, VALUE, int);
-#define reg_fragment_setenc(str,options) reg_fragment_setenc_gen(parser, str, options)
-static void reg_fragment_check_gen(struct parser_params*, VALUE, int);
-#define reg_fragment_check(str,options) reg_fragment_check_gen(parser, str, options)
-static NODE *reg_named_capture_assign_gen(struct parser_params* parser, VALUE regexp, NODE *match);
-#define reg_named_capture_assign(regexp,match) reg_named_capture_assign_gen(parser,regexp,match)
-int rb_enc_symname2_p(const char *, int, rb_encoding *);
-#else
-#define remove_begin(node) (node)
-#endif /* !RIPPER */
-static int lvar_defined_gen(struct parser_params*, ID);
-#define lvar_defined(id) lvar_defined_gen(parser, id)
-
-#define RE_OPTION_ONCE (1<<16)
-#define RE_OPTION_ENCODING_SHIFT 8
-#define RE_OPTION_ENCODING(e) (((e)&0xff)<<RE_OPTION_ENCODING_SHIFT)
-#define RE_OPTION_ENCODING_IDX(o) (((o)>>RE_OPTION_ENCODING_SHIFT)&0xff)
-#define RE_OPTION_ENCODING_NONE(o) ((o)&RE_OPTION_ARG_ENCODING_NONE)
-#define RE_OPTION_MASK 0xff
-#define RE_OPTION_ARG_ENCODING_NONE 32
+
+static NODE *block_append();
+static NODE *list_append();
+static NODE *list_concat();
+static NODE *arg_concat();
+static NODE *arg_prepend();
+static NODE *literal_concat();
+static NODE *new_evstr();
+static NODE *evstr2dstr();
+static NODE *call_op();
+static int in_defined = 0;
+
+static NODE *negate_lit();
+static NODE *ret_args();
+static NODE *arg_blk_pass();
+static NODE *new_call();
+static NODE *new_fcall();
+static NODE *new_super();
+static NODE *new_yield();
+
+static NODE *gettable();
+static NODE *assignable();
+static NODE *aryset();
+static NODE *attrset();
+static void rb_backref_error();
+static NODE *node_assign();
+
+static NODE *match_gen();
+static void local_push();
+static void local_pop();
+static int local_append();
+static int local_cnt();
+static int local_id();
+static ID *local_tbl();
+static ID internal_id();
+
+static struct RVarmap *dyna_push();
+static void dyna_pop();
+static int dyna_in_block();
+static NODE *dyna_init();
+
+static void top_local_init();
+static void top_local_setup();
+
+static void fixup_nodes();
+
+#define RE_OPTION_ONCE 0x80
#define NODE_STRTERM NODE_ZARRAY /* nothing to gc */
#define NODE_HEREDOC NODE_ARRAY /* 1, 3 to gc */
@@ -468,111 +197,9 @@ static int lvar_defined_gen(struct parser_params*, ID);
#define nd_term(node) SIGN_EXTEND((node)->u2.id, CHAR_BIT*2)
#endif
#define nd_paren(node) (char)((node)->u2.id >> CHAR_BIT*2)
-#define nd_nest u3.cnt
-
-/****** Ripper *******/
-
-#ifdef RIPPER
-#define RIPPER_VERSION "0.1.0"
-
-#include "eventids1.c"
-#include "eventids2.c"
-static ID ripper_id_gets;
-
-static VALUE ripper_dispatch0(struct parser_params*,ID);
-static VALUE ripper_dispatch1(struct parser_params*,ID,VALUE);
-static VALUE ripper_dispatch2(struct parser_params*,ID,VALUE,VALUE);
-static VALUE ripper_dispatch3(struct parser_params*,ID,VALUE,VALUE,VALUE);
-static VALUE ripper_dispatch4(struct parser_params*,ID,VALUE,VALUE,VALUE,VALUE);
-static VALUE ripper_dispatch5(struct parser_params*,ID,VALUE,VALUE,VALUE,VALUE,VALUE);
-
-#define dispatch0(n) ripper_dispatch0(parser, TOKEN_PASTE(ripper_id_, n))
-#define dispatch1(n,a) ripper_dispatch1(parser, TOKEN_PASTE(ripper_id_, n), a)
-#define dispatch2(n,a,b) ripper_dispatch2(parser, TOKEN_PASTE(ripper_id_, n), a, b)
-#define dispatch3(n,a,b,c) ripper_dispatch3(parser, TOKEN_PASTE(ripper_id_, n), a, b, c)
-#define dispatch4(n,a,b,c,d) ripper_dispatch4(parser, TOKEN_PASTE(ripper_id_, n), a, b, c, d)
-#define dispatch5(n,a,b,c,d,e) ripper_dispatch5(parser, TOKEN_PASTE(ripper_id_, n), a, b, c, d, e)
-
-#define yyparse ripper_yyparse
-
-static VALUE ripper_intern(const char*);
-static VALUE ripper_id2sym(ID);
-#ifdef __GNUC__
-#define ripper_id2sym(id) ((id) < 256 && rb_ispunct(id) ? \
- ID2SYM(id) : ripper_id2sym(id))
-#endif
-
-#define arg_new() dispatch0(args_new)
-#define arg_add(l,a) dispatch2(args_add, l, a)
-#define arg_prepend(l,a) dispatch2(args_prepend, l, a)
-#define arg_add_star(l,a) dispatch2(args_add_star, l, a)
-#define arg_add_block(l,b) dispatch2(args_add_block, l, b)
-#define arg_add_optblock(l,b) ((b)==Qundef? l : dispatch2(args_add_block, l, b))
-#define bare_assoc(v) dispatch1(bare_assoc_hash, v)
-#define arg_add_assocs(l,b) arg_add(l, bare_assoc(b))
-
-#define args2mrhs(a) dispatch1(mrhs_new_from_args, a)
-#define mrhs_new() dispatch0(mrhs_new)
-#define mrhs_add(l,a) dispatch2(mrhs_add, l, a)
-#define mrhs_add_star(l,a) dispatch2(mrhs_add_star, l, a)
-
-#define mlhs_new() dispatch0(mlhs_new)
-#define mlhs_add(l,a) dispatch2(mlhs_add, l, a)
-#define mlhs_add_star(l,a) dispatch2(mlhs_add_star, l, a)
-
-#define params_new(pars, opts, rest, pars2, blk) \
- dispatch5(params, pars, opts, rest, pars2, blk)
-
-#define blockvar_new(p,v) dispatch2(block_var, p, v)
-#define blockvar_add_star(l,a) dispatch2(block_var_add_star, l, a)
-#define blockvar_add_block(l,a) dispatch2(block_var_add_block, l, a)
+#define nd_nest u3.id
-#define method_optarg(m,a) ((a)==Qundef ? m : dispatch2(method_add_arg,m,a))
-#define method_arg(m,a) dispatch2(method_add_arg,m,a)
-#define method_add_block(m,b) dispatch2(method_add_block, m, b)
-
-#define escape_Qundef(x) ((x)==Qundef ? Qnil : (x))
-
-#define FIXME 0
-
-#endif /* RIPPER */
-
-#ifndef RIPPER
-# define ifndef_ripper(x) x
-#else
-# define ifndef_ripper(x)
-#endif
-
-#ifndef RIPPER
-# define rb_warn0(fmt) rb_compile_warn(ruby_sourcefile, ruby_sourceline, fmt)
-# define rb_warnI(fmt,a) rb_compile_warn(ruby_sourcefile, ruby_sourceline, fmt, a)
-# define rb_warnS(fmt,a) rb_compile_warn(ruby_sourcefile, ruby_sourceline, fmt, a)
-# define rb_warning0(fmt) rb_compile_warning(ruby_sourcefile, ruby_sourceline, fmt)
-# define rb_warningS(fmt,a) rb_compile_warning(ruby_sourcefile, ruby_sourceline, fmt, a)
-#else
-# define rb_warn0(fmt) ripper_warn0(parser, fmt)
-# define rb_warnI(fmt,a) ripper_warnI(parser, fmt, a)
-# define rb_warnS(fmt,a) ripper_warnS(parser, fmt, a)
-# define rb_warning0(fmt) ripper_warning0(parser, fmt)
-# define rb_warningS(fmt,a) ripper_warningS(parser, fmt, a)
-static void ripper_warn0(struct parser_params*, const char*);
-static void ripper_warnI(struct parser_params*, const char*, int);
-#if 0
-static void ripper_warnS(struct parser_params*, const char*, const char*);
-#endif
-static void ripper_warning0(struct parser_params*, const char*);
-static void ripper_warningS(struct parser_params*, const char*, const char*);
-#endif
-
-#ifdef RIPPER
-static void ripper_compile_error(struct parser_params*, const char *fmt, ...);
-# define rb_compile_error ripper_compile_error
-# define compile_error ripper_compile_error
-# define PARSER_ARG parser,
-#else
-# define compile_error parser->nerr++,rb_compile_error
-# define PARSER_ARG ruby_sourcefile, ruby_sourceline,
-#endif
+#define NEW_BLOCK_VAR(b, v) NEW_NODE(NODE_BLOCK_PASS, 0, b, v)
/* Older versions of Yacc set YYMAXDEPTH to a very low value by default (150,
for instance). This is too low for Ruby to parse some files, such as
@@ -583,79 +210,65 @@ static void ripper_compile_error(struct parser_params*, const char *fmt, ...);
#endif
#endif
-#ifndef RIPPER
-static void token_info_push(struct parser_params*, const char *token);
-static void token_info_pop(struct parser_params*, const char *token);
-#endif
%}
-%pure_parser
-%parse-param {struct parser_params *parser}
-
%union {
- VALUE val;
NODE *node;
ID id;
int num;
-}
-
-/*%%%*/
-%token
-/*%
-%token <val>
-%*/
- keyword_class
- keyword_module
- keyword_def
- keyword_undef
- keyword_begin
- keyword_rescue
- keyword_ensure
- keyword_end
- keyword_if
- keyword_unless
- keyword_then
- keyword_elsif
- keyword_else
- keyword_case
- keyword_when
- keyword_while
- keyword_until
- keyword_for
- keyword_break
- keyword_next
- keyword_redo
- keyword_retry
- keyword_in
- keyword_do
- keyword_do_cond
- keyword_do_block
- keyword_do_LAMBDA
- keyword_return
- keyword_yield
- keyword_super
- keyword_self
- keyword_nil
- keyword_true
- keyword_false
- keyword_and
- keyword_or
- keyword_not
- modifier_if
- modifier_unless
- modifier_while
- modifier_until
- modifier_rescue
- keyword_alias
- keyword_defined
- keyword_BEGIN
- keyword_END
- keyword__LINE__
- keyword__FILE__
- keyword__ENCODING__
-
-%token <id> tIDENTIFIER tFID tGVAR tIVAR tCONSTANT tCVAR tLABEL
-%token <node> tINTEGER tFLOAT tSTRING_CONTENT tCHAR
+ struct RVarmap *vars;
+}
+
+%token kCLASS
+ kMODULE
+ kDEF
+ kUNDEF
+ kBEGIN
+ kRESCUE
+ kENSURE
+ kEND
+ kIF
+ kUNLESS
+ kTHEN
+ kELSIF
+ kELSE
+ kCASE
+ kWHEN
+ kWHILE
+ kUNTIL
+ kFOR
+ kBREAK
+ kNEXT
+ kREDO
+ kRETRY
+ kIN
+ kDO
+ kDO_COND
+ kDO_BLOCK
+ kRETURN
+ kYIELD
+ kSUPER
+ kSELF
+ kNIL
+ kTRUE
+ kFALSE
+ kAND
+ kOR
+ kNOT
+ kIF_MOD
+ kUNLESS_MOD
+ kWHILE_MOD
+ kUNTIL_MOD
+ kRESCUE_MOD
+ kALIAS
+ kDEFINED
+ klBEGIN
+ klEND
+ k__LINE__
+ k__FILE__
+
+%token <id> tIDENTIFIER tFID tGVAR tIVAR tCONSTANT tCVAR
+%token <node> tINTEGER tFLOAT tSTRING_CONTENT
%token <node> tNTH_REF tBACK_REF
%token <num> tREGEXP_END
@@ -666,33 +279,26 @@ static void token_info_pop(struct parser_params*, const char *token);
%type <node> bodystmt compstmt stmts stmt expr arg primary command command_call method_call
%type <node> expr_value arg_value primary_value
%type <node> if_tail opt_else case_body cases opt_rescue exc_list exc_var opt_ensure
-%type <node> args call_args opt_call_args
-%type <node> paren_args opt_paren_args
+%type <node> args when_args call_args call_args2 open_args paren_args opt_paren_args
%type <node> command_args aref_args opt_block_arg block_arg var_ref var_lhs
%type <node> mrhs superclass block_call block_command
-%type <node> f_block_optarg f_block_opt
-%type <node> f_arglist f_args f_arg f_arg_item f_optarg f_marg f_marg_list f_margs
-%type <node> assoc_list assocs assoc undef_list backref string_dvar for_var
-%type <node> block_param opt_block_param block_param_def f_opt
-%type <node> bv_decls opt_bv_decl bvar
-%type <node> lambda f_larglist lambda_body
+%type <node> f_arglist f_args f_optarg f_opt f_rest_arg f_block_arg opt_f_block_arg
+%type <node> assoc_list assocs assoc undef_list backref string_dvar
+%type <node> for_var block_var opt_block_var block_par
%type <node> brace_block cmd_brace_block do_block lhs none fitem
-%type <node> mlhs mlhs_head mlhs_basic mlhs_item mlhs_node mlhs_post mlhs_inner
+%type <node> mlhs mlhs_head mlhs_basic mlhs_entry mlhs_item mlhs_node
%type <id> fsym variable sym symbol operation operation2 operation3
-%type <id> cname fname op f_rest_arg f_block_arg opt_f_block_arg f_norm_arg f_bad_arg
-/*%%%*/
-/*%
-%type <val> program reswords then do dot_or_colon
-%*/
-%token tUPLUS /* unary+ */
-%token tUMINUS /* unary- */
+%type <id> cname fname op
+%type <num> f_norm_arg f_arg
+%token tUPLUS /* unary+ */
+%token tUMINUS /* unary- */
%token tPOW /* ** */
-%token tCMP /* <=> */
-%token tEQ /* == */
-%token tEQQ /* === */
-%token tNEQ /* != */
-%token tGEQ /* >= */
-%token tLEQ /* <= */
+%token tCMP /* <=> */
+%token tEQ /* == */
+%token tEQQ /* === */
+%token tNEQ /* != */
+%token tGEQ /* >= */
+%token tLEQ /* <= */
%token tANDOP tOROP /* && and || */
%token tMATCH tNMATCH /* =~ and !~ */
%token tDOT2 tDOT3 /* .. and ... */
@@ -710,9 +316,8 @@ static void token_info_pop(struct parser_params*, const char *token);
%token tLBRACE_ARG /* { */
%token tSTAR /* * */
%token tAMPER /* & */
-%token tLAMBDA /* -> */
%token tSYMBEG tSTRING_BEG tXSTRING_BEG tREGEXP_BEG tWORDS_BEG tQWORDS_BEG
-%token tSTRING_DBEG tSTRING_DVAR tSTRING_END tLAMBEG
+%token tSTRING_DBEG tSTRING_DVAR tSTRING_END
/*
* precedence table
@@ -721,12 +326,12 @@ static void token_info_pop(struct parser_params*, const char *token);
%nonassoc tLOWEST
%nonassoc tLBRACE_ARG
-%nonassoc modifier_if modifier_unless modifier_while modifier_until
-%left keyword_or keyword_and
-%right keyword_not
-%nonassoc keyword_defined
+%nonassoc kIF_MOD kUNLESS_MOD kWHILE_MOD kUNTIL_MOD
+%left kOR kAND
+%right kNOT
+%nonassoc kDEFINED
%right '=' tOP_ASGN
-%left modifier_rescue
+%left kRESCUE_MOD
%right '?' ':'
%nonassoc tDOT2 tDOT3
%left tOROP
@@ -742,33 +347,19 @@ static void token_info_pop(struct parser_params*, const char *token);
%right tPOW
%right '!' '~' tUPLUS
-%nonassoc idNULL
-%nonassoc idRespond_to
-%nonassoc idIFUNC
-%nonassoc idCFUNC
-%nonassoc id_core_set_method_alias
-%nonassoc id_core_set_variable_alias
-%nonassoc id_core_undef_method
-%nonassoc id_core_define_method
-%nonassoc id_core_define_singleton_method
-%nonassoc id_core_set_postexe
-
%token tLAST_TOKEN
%%
program : {
lex_state = EXPR_BEG;
- /*%%%*/
- $<num>$ = compile_for_eval || rb_parse_in_main();
- local_push($<num>$);
- /*%
- %*/
+ top_local_init();
+ if (ruby_class == rb_cObject) class_nest = 0;
+ else class_nest = 1;
}
compstmt
{
- /*%%%*/
- if ($2 && !$<num>1) {
- /* last expression should not be void */
+ if ($2 && !compile_for_eval) {
+ /* last expression should not be void */
if (nd_type($2) != NODE_BLOCK) void_expr($2);
else {
NODE *node = $2;
@@ -778,12 +369,9 @@ program : {
void_expr(node->nd_head);
}
}
- ruby_eval_tree = NEW_SCOPE(0, block_append(ruby_eval_tree, $2));
- local_pop();
- /*%
- $$ = $2;
- parser->result = dispatch1(program, $$);
- %*/
+ ruby_eval_tree = block_append(ruby_eval_tree, $2);
+ top_local_setup();
+ class_nest = 0;
}
;
@@ -792,69 +380,37 @@ bodystmt : compstmt
opt_else
opt_ensure
{
- /*%%%*/
- $$ = $1;
+ $$ = $1;
if ($2) {
$$ = NEW_RESCUE($1, $2, $3);
}
else if ($3) {
- rb_warn0("else without rescue is useless");
+ rb_warn("else without rescue is useless");
$$ = block_append($$, $3);
}
if ($4) {
- if ($$) {
- $$ = NEW_ENSURE($$, $4);
- }
- else {
- $$ = block_append($4, NEW_NIL());
- }
+ $$ = NEW_ENSURE($$, $4);
}
fixpos($$, $1);
- /*%
- $$ = dispatch4(body_stmt,
- escape_Qundef($1),
- escape_Qundef($2),
- escape_Qundef($3),
- escape_Qundef($4));
- %*/
}
;
compstmt : stmts opt_terms
{
- /*%%%*/
void_stmts($1);
fixup_nodes(&deferred_nodes);
- /*%
- %*/
- $$ = $1;
+ $$ = $1;
}
;
stmts : none
- {
- /*%%%*/
- $$ = NEW_BEGIN(0);
- /*%
- $$ = dispatch2(stmts_add, dispatch0(stmts_new),
- dispatch0(void_stmt));
- %*/
- }
| stmt
{
- /*%%%*/
$$ = newline_node($1);
- /*%
- $$ = dispatch2(stmts_add, dispatch0(stmts_new), $1);
- %*/
}
| stmts terms stmt
{
- /*%%%*/
$$ = block_append($1, newline_node($3));
- /*%
- $$ = dispatch2(stmts_add, $1, $3);
- %*/
}
| error stmt
{
@@ -862,160 +418,111 @@ stmts : none
}
;
-stmt : keyword_alias fitem {lex_state = EXPR_FNAME;} fitem
+stmt : kALIAS fitem {lex_state = EXPR_FNAME;} fitem
{
- /*%%%*/
- $$ = NEW_ALIAS($2, $4);
- /*%
- $$ = dispatch2(alias, $2, $4);
- %*/
+ $$ = NEW_ALIAS($2, $4);
}
- | keyword_alias tGVAR tGVAR
+ | kALIAS tGVAR tGVAR
{
- /*%%%*/
- $$ = NEW_VALIAS($2, $3);
- /*%
- $$ = dispatch2(var_alias, $2, $3);
- %*/
+ $$ = NEW_VALIAS($2, $3);
}
- | keyword_alias tGVAR tBACK_REF
+ | kALIAS tGVAR tBACK_REF
{
- /*%%%*/
- char buf[2];
- buf[0] = '$';
- buf[1] = (char)$3->nd_nth;
- $$ = NEW_VALIAS($2, rb_intern2(buf, 2));
- /*%
- $$ = dispatch2(var_alias, $2, $3);
- %*/
+ char buf[3];
+
+ sprintf(buf, "$%c", (char)$3->nd_nth);
+ $$ = NEW_VALIAS($2, rb_intern(buf));
}
- | keyword_alias tGVAR tNTH_REF
+ | kALIAS tGVAR tNTH_REF
{
- /*%%%*/
- yyerror("can't make alias for the number variables");
- $$ = NEW_BEGIN(0);
- /*%
- $$ = dispatch2(var_alias, $2, $3);
- $$ = dispatch1(alias_error, $$);
- %*/
+ yyerror("can't make alias for the number variables");
+ $$ = 0;
}
- | keyword_undef undef_list
+ | kUNDEF undef_list
{
- /*%%%*/
$$ = $2;
- /*%
- $$ = dispatch1(undef, $2);
- %*/
}
- | stmt modifier_if expr_value
+ | stmt kIF_MOD expr_value
{
- /*%%%*/
$$ = NEW_IF(cond($3), remove_begin($1), 0);
- fixpos($$, $3);
- /*%
- $$ = dispatch2(if_mod, $3, $1);
- %*/
+ fixpos($$, $3);
+ if (cond_negative(&$$->nd_cond)) {
+ $$->nd_else = $$->nd_body;
+ $$->nd_body = 0;
+ }
}
- | stmt modifier_unless expr_value
+ | stmt kUNLESS_MOD expr_value
{
- /*%%%*/
$$ = NEW_UNLESS(cond($3), remove_begin($1), 0);
- fixpos($$, $3);
- /*%
- $$ = dispatch2(unless_mod, $3, $1);
- %*/
+ fixpos($$, $3);
+ if (cond_negative(&$$->nd_cond)) {
+ $$->nd_body = $$->nd_else;
+ $$->nd_else = 0;
+ }
}
- | stmt modifier_while expr_value
+ | stmt kWHILE_MOD expr_value
{
- /*%%%*/
if ($1 && nd_type($1) == NODE_BEGIN) {
$$ = NEW_WHILE(cond($3), $1->nd_body, 0);
}
else {
$$ = NEW_WHILE(cond($3), $1, 1);
}
- /*%
- $$ = dispatch2(while_mod, $3, $1);
- %*/
+ if (cond_negative(&$$->nd_cond)) {
+ nd_set_type($$, NODE_UNTIL);
+ }
}
- | stmt modifier_until expr_value
+ | stmt kUNTIL_MOD expr_value
{
- /*%%%*/
if ($1 && nd_type($1) == NODE_BEGIN) {
$$ = NEW_UNTIL(cond($3), $1->nd_body, 0);
}
else {
$$ = NEW_UNTIL(cond($3), $1, 1);
}
- /*%
- $$ = dispatch2(until_mod, $3, $1);
- %*/
+ if (cond_negative(&$$->nd_cond)) {
+ nd_set_type($$, NODE_WHILE);
+ }
}
- | stmt modifier_rescue stmt
+ | stmt kRESCUE_MOD stmt
{
- /*%%%*/
NODE *resq = NEW_RESBODY(0, remove_begin($3), 0);
$$ = NEW_RESCUE(remove_begin($1), resq, 0);
- /*%
- $$ = dispatch2(rescue_mod, $3, $1);
- %*/
}
- | keyword_BEGIN
+ | klBEGIN
{
if (in_def || in_single) {
yyerror("BEGIN in method");
}
- /*%%%*/
- /* local_push(0); */
- /*%
- %*/
+ local_push(0);
}
'{' compstmt '}'
{
- /*%%%*/
ruby_eval_tree_begin = block_append(ruby_eval_tree_begin,
- $4);
- /* NEW_PREEXE($4)); */
- /* local_pop(); */
- $$ = NEW_BEGIN(0);
- /*%
- $$ = dispatch1(BEGIN, $4);
- %*/
+ NEW_PREEXE($4));
+ local_pop();
+ $$ = 0;
}
- | keyword_END '{' compstmt '}'
+ | klEND '{' compstmt '}'
{
if (in_def || in_single) {
- rb_warn0("END in method; use at_exit");
+ rb_warn("END in method; use at_exit");
}
- /*%%%*/
- $$ = NEW_POSTEXE(NEW_NODE(
- NODE_SCOPE, 0 /* tbl */, $3 /* body */, 0 /* args */));
- /*%
- $$ = dispatch1(END, $3);
- %*/
+
+ $$ = NEW_ITER(0, NEW_POSTEXE(), $3);
}
| lhs '=' command_call
{
- /*%%%*/
- value_expr($3);
$$ = node_assign($1, $3);
- /*%
- $$ = dispatch2(assign, $1, $3);
- %*/
}
| mlhs '=' command_call
{
- /*%%%*/
value_expr($3);
- $1->nd_value = $3;
+ $1->nd_value = ($1->nd_head) ? NEW_TO_ARY($3) : NEW_ARRAY($3);
$$ = $1;
- /*%
- $$ = dispatch2(massign, $1, $3);
- %*/
}
| var_lhs tOP_ASGN command_call
{
- /*%%%*/
value_expr($3);
if ($1) {
ID vid = $1->nd_vid;
@@ -1032,20 +539,16 @@ stmt : keyword_alias fitem {lex_state = EXPR_FNAME;} fitem
}
else {
$$ = $1;
- $$->nd_value = NEW_CALL(gettable(vid), $2, NEW_LIST($3));
+ $$->nd_value = call_op(gettable(vid),$2,1,$3);
}
}
else {
- $$ = NEW_BEGIN(0);
+ $$ = 0;
}
- /*%
- $$ = dispatch3(opassign, $1, $2, $3);
- %*/
}
- | primary_value '[' opt_call_args rbracket tOP_ASGN command_call
+ | primary_value '[' aref_args ']' tOP_ASGN command_call
{
- /*%%%*/
- NODE *args;
+ NODE *args;
value_expr($6);
if (!$3) $3 = NEW_ZARRAY();
@@ -1057,15 +560,10 @@ stmt : keyword_alias fitem {lex_state = EXPR_FNAME;} fitem
$5 = 1;
}
$$ = NEW_OP_ASGN1($1, $5, args);
- fixpos($$, $1);
- /*%
- $$ = dispatch2(aref_field, $1, escape_Qundef($3));
- $$ = dispatch3(opassign, $$, $5, $6);
- %*/
+ fixpos($$, $1);
}
| primary_value '.' tIDENTIFIER tOP_ASGN command_call
{
- /*%%%*/
value_expr($5);
if ($4 == tOROP) {
$4 = 0;
@@ -1074,15 +572,10 @@ stmt : keyword_alias fitem {lex_state = EXPR_FNAME;} fitem
$4 = 1;
}
$$ = NEW_OP_ASGN2($1, $3, $4, $5);
- fixpos($$, $1);
- /*%
- $$ = dispatch3(field, $1, ripper_id2sym('.'), $3);
- $$ = dispatch3(opassign, $$, $4, $5);
- %*/
+ fixpos($$, $1);
}
| primary_value '.' tCONSTANT tOP_ASGN command_call
{
- /*%%%*/
value_expr($5);
if ($4 == tOROP) {
$4 = 0;
@@ -1091,20 +584,10 @@ stmt : keyword_alias fitem {lex_state = EXPR_FNAME;} fitem
$4 = 1;
}
$$ = NEW_OP_ASGN2($1, $3, $4, $5);
- fixpos($$, $1);
- /*%
- $$ = dispatch3(field, $1, ripper_id2sym('.'), $3);
- $$ = dispatch3(opassign, $$, $4, $5);
- %*/
- }
- | primary_value tCOLON2 tCONSTANT tOP_ASGN command_call
- {
- yyerror("constant re-assignment");
- $$ = 0;
+ fixpos($$, $1);
}
| primary_value tCOLON2 tIDENTIFIER tOP_ASGN command_call
{
- /*%%%*/
value_expr($5);
if ($4 == tOROP) {
$4 = 0;
@@ -1113,590 +596,315 @@ stmt : keyword_alias fitem {lex_state = EXPR_FNAME;} fitem
$4 = 1;
}
$$ = NEW_OP_ASGN2($1, $3, $4, $5);
- fixpos($$, $1);
- /*%
- $$ = dispatch3(field, $1, ripper_intern("::"), $3);
- $$ = dispatch3(opassign, $$, $4, $5);
- %*/
+ fixpos($$, $1);
}
| backref tOP_ASGN command_call
{
- /*%%%*/
- rb_backref_error($1);
- $$ = NEW_BEGIN(0);
- /*%
- $$ = dispatch2(assign, dispatch1(var_field, $1), $3);
- $$ = dispatch1(assign_error, $$);
- %*/
+ rb_backref_error($1);
+ $$ = 0;
}
| lhs '=' mrhs
{
- /*%%%*/
- value_expr($3);
- $$ = node_assign($1, $3);
- /*%
- $$ = dispatch2(assign, $1, $3);
- %*/
+ $$ = node_assign($1, NEW_SVALUE($3));
}
| mlhs '=' arg_value
{
- /*%%%*/
- $1->nd_value = $3;
+ $1->nd_value = ($1->nd_head) ? NEW_TO_ARY($3) : NEW_ARRAY($3);
$$ = $1;
- /*%
- $$ = dispatch2(massign, $1, $3);
- %*/
}
| mlhs '=' mrhs
{
- /*%%%*/
$1->nd_value = $3;
$$ = $1;
- /*%
- $$ = dispatch2(massign, $1, $3);
- %*/
}
| expr
;
expr : command_call
- | expr keyword_and expr
+ | expr kAND expr
{
- /*%%%*/
$$ = logop(NODE_AND, $1, $3);
- /*%
- $$ = dispatch3(binary, $1, ripper_intern("and"), $3);
- %*/
}
- | expr keyword_or expr
+ | expr kOR expr
{
- /*%%%*/
$$ = logop(NODE_OR, $1, $3);
- /*%
- $$ = dispatch3(binary, $1, ripper_intern("or"), $3);
- %*/
}
- | keyword_not opt_nl expr
+ | kNOT expr
{
- /*%%%*/
- $$ = call_uni_op(cond($3), '!');
- /*%
- $$ = dispatch2(unary, ripper_intern("not"), $3);
- %*/
+ $$ = NEW_NOT(cond($2));
}
| '!' command_call
{
- /*%%%*/
- $$ = call_uni_op(cond($2), '!');
- /*%
- $$ = dispatch2(unary, ripper_id2sym('!'), $2);
- %*/
+ $$ = NEW_NOT(cond($2));
}
| arg
;
expr_value : expr
{
- /*%%%*/
- value_expr($1);
+ value_expr($$);
$$ = $1;
- if (!$$) $$ = NEW_NIL();
- /*%
- $$ = $1;
- %*/
}
;
command_call : command
| block_command
+ | kRETURN call_args
+ {
+ $$ = NEW_RETURN(ret_args($2));
+ }
+ | kBREAK call_args
+ {
+ $$ = NEW_BREAK(ret_args($2));
+ }
+ | kNEXT call_args
+ {
+ $$ = NEW_NEXT(ret_args($2));
+ }
;
block_command : block_call
| block_call '.' operation2 command_args
{
- /*%%%*/
- $$ = NEW_CALL($1, $3, $4);
- /*%
- $$ = dispatch3(call, $1, ripper_id2sym('.'), $3);
- $$ = method_arg($$, $4);
- %*/
+ $$ = new_call($1, $3, $4);
}
| block_call tCOLON2 operation2 command_args
{
- /*%%%*/
- $$ = NEW_CALL($1, $3, $4);
- /*%
- $$ = dispatch3(call, $1, ripper_intern("::"), $3);
- $$ = method_arg($$, $4);
- %*/
+ $$ = new_call($1, $3, $4);
}
;
cmd_brace_block : tLBRACE_ARG
{
- /*%%%*/
- dyna_push();
- $<num>$ = ruby_sourceline;
- /*%
- %*/
+ $<vars>$ = dyna_push();
+ $<num>1 = ruby_sourceline;
}
- opt_block_param
+ opt_block_var {$<vars>$ = ruby_dyna_vars;}
compstmt
'}'
{
- /*%%%*/
- $$ = NEW_ITER($3,$4);
- nd_set_line($$, $<num>2);
- dyna_pop();
- /*%
- $$ = dispatch2(brace_block, escape_Qundef($3), $4);
- %*/
+ $$ = NEW_ITER($3, 0, dyna_init($5, $<vars>4));
+ nd_set_line($$, $<num>1);
+ dyna_pop($<vars>2);
}
;
command : operation command_args %prec tLOWEST
{
- /*%%%*/
- $$ = NEW_FCALL($1, $2);
- fixpos($$, $2);
- /*%
- $$ = dispatch2(command, $1, $2);
- %*/
- }
+ $$ = new_fcall($1, $2);
+ fixpos($$, $2);
+ }
| operation command_args cmd_brace_block
{
- /*%%%*/
- block_dup_check($2,$3);
- $3->nd_iter = NEW_FCALL($1, $2);
- $$ = $3;
- fixpos($$, $2);
- /*%
- $$ = dispatch2(command, $1, $2);
- $$ = method_add_block($$, $3);
- %*/
- }
+ $$ = new_fcall($1, $2);
+ if ($3) {
+ if (nd_type($$) == NODE_BLOCK_PASS) {
+ rb_compile_error("both block arg and actual block given");
+ }
+ $3->nd_iter = $$;
+ $$ = $3;
+ }
+ fixpos($$, $2);
+ }
| primary_value '.' operation2 command_args %prec tLOWEST
{
- /*%%%*/
- $$ = NEW_CALL($1, $3, $4);
- fixpos($$, $1);
- /*%
- $$ = dispatch4(command_call, $1, ripper_id2sym('.'), $3, $4);
- %*/
+ $$ = new_call($1, $3, $4);
+ fixpos($$, $1);
}
| primary_value '.' operation2 command_args cmd_brace_block
{
- /*%%%*/
- block_dup_check($4,$5);
- $5->nd_iter = NEW_CALL($1, $3, $4);
- $$ = $5;
- fixpos($$, $1);
- /*%
- $$ = dispatch4(command_call, $1, ripper_id2sym('.'), $3, $4);
- $$ = method_add_block($$, $5);
- %*/
+ $$ = new_call($1, $3, $4);
+ if ($5) {
+ if (nd_type($$) == NODE_BLOCK_PASS) {
+ rb_compile_error("both block arg and actual block given");
+ }
+ $5->nd_iter = $$;
+ $$ = $5;
+ }
+ fixpos($$, $1);
}
| primary_value tCOLON2 operation2 command_args %prec tLOWEST
{
- /*%%%*/
- $$ = NEW_CALL($1, $3, $4);
- fixpos($$, $1);
- /*%
- $$ = dispatch4(command_call, $1, ripper_intern("::"), $3, $4);
- %*/
+ $$ = new_call($1, $3, $4);
+ fixpos($$, $1);
}
| primary_value tCOLON2 operation2 command_args cmd_brace_block
{
- /*%%%*/
- block_dup_check($4,$5);
- $5->nd_iter = NEW_CALL($1, $3, $4);
- $$ = $5;
- fixpos($$, $1);
- /*%
- $$ = dispatch4(command_call, $1, ripper_intern("::"), $3, $4);
- $$ = method_add_block($$, $5);
- %*/
+ $$ = new_call($1, $3, $4);
+ if ($5) {
+ if (nd_type($$) == NODE_BLOCK_PASS) {
+ rb_compile_error("both block arg and actual block given");
+ }
+ $5->nd_iter = $$;
+ $$ = $5;
+ }
+ fixpos($$, $1);
}
- | keyword_super command_args
+ | kSUPER command_args
{
- /*%%%*/
- $$ = NEW_SUPER($2);
- fixpos($$, $2);
- /*%
- $$ = dispatch1(super, $2);
- %*/
+ $$ = new_super($2);
+ fixpos($$, $2);
}
- | keyword_yield command_args
+ | kYIELD command_args
{
- /*%%%*/
$$ = new_yield($2);
- fixpos($$, $2);
- /*%
- $$ = dispatch1(yield, $2);
- %*/
- }
- | keyword_return call_args
- {
- /*%%%*/
- $$ = NEW_RETURN(ret_args($2));
- /*%
- $$ = dispatch1(return, $2);
- %*/
- }
- | keyword_break call_args
- {
- /*%%%*/
- $$ = NEW_BREAK(ret_args($2));
- /*%
- $$ = dispatch1(break, $2);
- %*/
- }
- | keyword_next call_args
- {
- /*%%%*/
- $$ = NEW_NEXT(ret_args($2));
- /*%
- $$ = dispatch1(next, $2);
- %*/
+ fixpos($$, $2);
}
;
mlhs : mlhs_basic
- | tLPAREN mlhs_inner rparen
+ | tLPAREN mlhs_entry ')'
{
- /*%%%*/
$$ = $2;
- /*%
- $$ = dispatch1(mlhs_paren, $2);
- %*/
}
;
-mlhs_inner : mlhs_basic
- | tLPAREN mlhs_inner rparen
+mlhs_entry : mlhs_basic
+ | tLPAREN mlhs_entry ')'
{
- /*%%%*/
$$ = NEW_MASGN(NEW_LIST($2), 0);
- /*%
- $$ = dispatch1(mlhs_paren, $2);
- %*/
}
;
mlhs_basic : mlhs_head
{
- /*%%%*/
$$ = NEW_MASGN($1, 0);
- /*%
- $$ = $1;
- %*/
}
| mlhs_head mlhs_item
{
- /*%%%*/
$$ = NEW_MASGN(list_append($1,$2), 0);
- /*%
- $$ = mlhs_add($1, $2);
- %*/
}
| mlhs_head tSTAR mlhs_node
{
- /*%%%*/
$$ = NEW_MASGN($1, $3);
- /*%
- $$ = mlhs_add_star($1, $3);
- %*/
- }
- | mlhs_head tSTAR mlhs_node ',' mlhs_post
- {
- /*%%%*/
- $$ = NEW_MASGN($1, NEW_POSTARG($3,$5));
- /*%
- $$ = mlhs_add_star($1, $3);
- %*/
}
| mlhs_head tSTAR
{
- /*%%%*/
$$ = NEW_MASGN($1, -1);
- /*%
- $$ = mlhs_add_star($1, Qnil);
- %*/
- }
- | mlhs_head tSTAR ',' mlhs_post
- {
- /*%%%*/
- $$ = NEW_MASGN($1, NEW_POSTARG(-1, $4));
- /*%
- $$ = mlhs_add_star($1, Qnil);
- %*/
}
| tSTAR mlhs_node
{
- /*%%%*/
$$ = NEW_MASGN(0, $2);
- /*%
- $$ = mlhs_add_star(mlhs_new(), $2);
- %*/
- }
- | tSTAR mlhs_node ',' mlhs_post
- {
- /*%%%*/
- $$ = NEW_MASGN(0, NEW_POSTARG($2,$4));
- /*%
- $$ = mlhs_add_star(mlhs_new(), $2);
- %*/
}
| tSTAR
{
- /*%%%*/
$$ = NEW_MASGN(0, -1);
- /*%
- $$ = mlhs_add_star(mlhs_new(), Qnil);
- %*/
- }
- | tSTAR ',' mlhs_post
- {
- /*%%%*/
- $$ = NEW_MASGN(0, NEW_POSTARG(-1, $3));
- /*%
- $$ = mlhs_add_star(mlhs_new(), Qnil);
- %*/
}
;
mlhs_item : mlhs_node
- | tLPAREN mlhs_inner rparen
+ | tLPAREN mlhs_entry ')'
{
- /*%%%*/
$$ = $2;
- /*%
- $$ = dispatch1(mlhs_paren, $2);
- %*/
}
;
mlhs_head : mlhs_item ','
{
- /*%%%*/
$$ = NEW_LIST($1);
- /*%
- $$ = mlhs_add(mlhs_new(), $1);
- %*/
}
| mlhs_head mlhs_item ','
{
- /*%%%*/
$$ = list_append($1, $2);
- /*%
- $$ = mlhs_add($1, $2);
- %*/
- }
- ;
-
-mlhs_post : mlhs_item
- {
- /*%%%*/
- $$ = NEW_LIST($1);
- /*%
- $$ = mlhs_add(mlhs_new(), $1);
- %*/
- }
- | mlhs_post ',' mlhs_item
- {
- /*%%%*/
- $$ = list_append($1, $3);
- /*%
- $$ = mlhs_add($1, $3);
- %*/
}
;
mlhs_node : variable
{
- /*%%%*/
$$ = assignable($1, 0);
- /*%
- $$ = $1;
- %*/
}
- | primary_value '[' opt_call_args rbracket
+ | primary_value '[' aref_args ']'
{
- /*%%%*/
$$ = aryset($1, $3);
- /*%
- $$ = dispatch2(aref_field, $1, escape_Qundef($3));
- %*/
}
| primary_value '.' tIDENTIFIER
{
- /*%%%*/
$$ = attrset($1, $3);
- /*%
- $$ = dispatch3(field, $1, ripper_id2sym('.'), $3);
- %*/
}
| primary_value tCOLON2 tIDENTIFIER
{
- /*%%%*/
$$ = attrset($1, $3);
- /*%
- $$ = dispatch2(const_path_field, $1, $3);
- %*/
}
| primary_value '.' tCONSTANT
{
- /*%%%*/
$$ = attrset($1, $3);
- /*%
- $$ = dispatch3(field, $1, ripper_id2sym('.'), $3);
- %*/
}
| primary_value tCOLON2 tCONSTANT
{
- /*%%%*/
if (in_def || in_single)
yyerror("dynamic constant assignment");
$$ = NEW_CDECL(0, 0, NEW_COLON2($1, $3));
- /*%
- if (in_def || in_single)
- yyerror("dynamic constant assignment");
- $$ = dispatch2(const_path_field, $1, $3);
- %*/
}
| tCOLON3 tCONSTANT
{
- /*%%%*/
if (in_def || in_single)
yyerror("dynamic constant assignment");
$$ = NEW_CDECL(0, 0, NEW_COLON3($2));
- /*%
- $$ = dispatch1(top_const_field, $2);
- %*/
}
| backref
{
- /*%%%*/
- rb_backref_error($1);
- $$ = NEW_BEGIN(0);
- /*%
- $$ = dispatch1(var_field, $1);
- $$ = dispatch1(assign_error, $$);
- %*/
+ rb_backref_error($1);
+ $$ = 0;
}
;
lhs : variable
{
- /*%%%*/
- if (!($$ = assignable($1, 0))) $$ = NEW_BEGIN(0);
- /*%
- $$ = dispatch1(var_field, $1);
- %*/
+ $$ = assignable($1, 0);
}
- | primary_value '[' opt_call_args rbracket
+ | primary_value '[' aref_args ']'
{
- /*%%%*/
$$ = aryset($1, $3);
- /*%
- $$ = dispatch2(aref_field, $1, escape_Qundef($3));
- %*/
}
| primary_value '.' tIDENTIFIER
{
- /*%%%*/
$$ = attrset($1, $3);
- /*%
- $$ = dispatch3(field, $1, ripper_id2sym('.'), $3);
- %*/
}
| primary_value tCOLON2 tIDENTIFIER
{
- /*%%%*/
$$ = attrset($1, $3);
- /*%
- $$ = dispatch3(field, $1, ripper_intern("::"), $3);
- %*/
}
| primary_value '.' tCONSTANT
{
- /*%%%*/
$$ = attrset($1, $3);
- /*%
- $$ = dispatch3(field, $1, ripper_id2sym('.'), $3);
- %*/
}
| primary_value tCOLON2 tCONSTANT
{
- /*%%%*/
if (in_def || in_single)
yyerror("dynamic constant assignment");
$$ = NEW_CDECL(0, 0, NEW_COLON2($1, $3));
- /*%
- $$ = dispatch2(const_path_field, $1, $3);
- if (in_def || in_single) {
- $$ = dispatch1(assign_error, $$);
- }
- %*/
}
| tCOLON3 tCONSTANT
{
- /*%%%*/
if (in_def || in_single)
yyerror("dynamic constant assignment");
$$ = NEW_CDECL(0, 0, NEW_COLON3($2));
- /*%
- $$ = dispatch1(top_const_field, $2);
- if (in_def || in_single) {
- $$ = dispatch1(assign_error, $$);
- }
- %*/
}
| backref
{
- /*%%%*/
- rb_backref_error($1);
- $$ = NEW_BEGIN(0);
- /*%
- $$ = dispatch1(assign_error, $1);
- %*/
+ rb_backref_error($1);
+ $$ = 0;
}
;
cname : tIDENTIFIER
{
- /*%%%*/
yyerror("class/module name must be CONSTANT");
- /*%
- $$ = dispatch1(class_name_error, $1);
- %*/
}
| tCONSTANT
;
cpath : tCOLON3 cname
{
- /*%%%*/
$$ = NEW_COLON3($2);
- /*%
- $$ = dispatch1(top_const_ref, $2);
- %*/
}
| cname
{
- /*%%%*/
$$ = NEW_COLON2(0, $$);
- /*%
- $$ = dispatch1(const_ref, $1);
- %*/
}
| primary_value tCOLON2 cname
{
- /*%%%*/
$$ = NEW_COLON2($1, $3);
- /*%
- $$ = dispatch2(const_path_ref, $1, $3);
- %*/
}
;
@@ -1705,23 +913,13 @@ fname : tIDENTIFIER
| tFID
| op
{
- /*%%%*/
- lex_state = EXPR_END;
- $$ = $1;
- /*%
lex_state = EXPR_END;
$$ = $1;
- %*/
}
| reswords
{
- /*%%%*/
lex_state = EXPR_END;
$$ = $<id>1;
- /*%
- lex_state = EXPR_END;
- $$ = $1;
- %*/
}
;
@@ -1731,131 +929,69 @@ fsym : fname
fitem : fsym
{
- /*%%%*/
$$ = NEW_LIT(ID2SYM($1));
- /*%
- $$ = dispatch1(symbol_literal, $1);
- %*/
}
| dsym
;
undef_list : fitem
{
- /*%%%*/
$$ = NEW_UNDEF($1);
- /*%
- $$ = rb_ary_new3(1, $1);
- %*/
}
| undef_list ',' {lex_state = EXPR_FNAME;} fitem
{
- /*%%%*/
$$ = block_append($1, NEW_UNDEF($4));
- /*%
- rb_ary_push($1, $4);
- %*/
}
;
-op : '|' { ifndef_ripper($$ = '|'); }
- | '^' { ifndef_ripper($$ = '^'); }
- | '&' { ifndef_ripper($$ = '&'); }
- | tCMP { ifndef_ripper($$ = tCMP); }
- | tEQ { ifndef_ripper($$ = tEQ); }
- | tEQQ { ifndef_ripper($$ = tEQQ); }
- | tMATCH { ifndef_ripper($$ = tMATCH); }
- | tNMATCH { ifndef_ripper($$ = tNMATCH); }
- | '>' { ifndef_ripper($$ = '>'); }
- | tGEQ { ifndef_ripper($$ = tGEQ); }
- | '<' { ifndef_ripper($$ = '<'); }
- | tLEQ { ifndef_ripper($$ = tLEQ); }
- | tNEQ { ifndef_ripper($$ = tNEQ); }
- | tLSHFT { ifndef_ripper($$ = tLSHFT); }
- | tRSHFT { ifndef_ripper($$ = tRSHFT); }
- | '+' { ifndef_ripper($$ = '+'); }
- | '-' { ifndef_ripper($$ = '-'); }
- | '*' { ifndef_ripper($$ = '*'); }
- | tSTAR { ifndef_ripper($$ = '*'); }
- | '/' { ifndef_ripper($$ = '/'); }
- | '%' { ifndef_ripper($$ = '%'); }
- | tPOW { ifndef_ripper($$ = tPOW); }
- | '!' { ifndef_ripper($$ = '!'); }
- | '~' { ifndef_ripper($$ = '~'); }
- | tUPLUS { ifndef_ripper($$ = tUPLUS); }
- | tUMINUS { ifndef_ripper($$ = tUMINUS); }
- | tAREF { ifndef_ripper($$ = tAREF); }
- | tASET { ifndef_ripper($$ = tASET); }
- | '`' { ifndef_ripper($$ = '`'); }
- ;
-
-reswords : keyword__LINE__ | keyword__FILE__ | keyword__ENCODING__
- | keyword_BEGIN | keyword_END
- | keyword_alias | keyword_and | keyword_begin
- | keyword_break | keyword_case | keyword_class | keyword_def
- | keyword_defined | keyword_do | keyword_else | keyword_elsif
- | keyword_end | keyword_ensure | keyword_false
- | keyword_for | keyword_in | keyword_module | keyword_next
- | keyword_nil | keyword_not | keyword_or | keyword_redo
- | keyword_rescue | keyword_retry | keyword_return | keyword_self
- | keyword_super | keyword_then | keyword_true | keyword_undef
- | keyword_when | keyword_yield | keyword_if | keyword_unless
- | keyword_while | keyword_until
+op : '|' { $$ = '|'; }
+ | '^' { $$ = '^'; }
+ | '&' { $$ = '&'; }
+ | tCMP { $$ = tCMP; }
+ | tEQ { $$ = tEQ; }
+ | tEQQ { $$ = tEQQ; }
+ | tMATCH { $$ = tMATCH; }
+ | '>' { $$ = '>'; }
+ | tGEQ { $$ = tGEQ; }
+ | '<' { $$ = '<'; }
+ | tLEQ { $$ = tLEQ; }
+ | tLSHFT { $$ = tLSHFT; }
+ | tRSHFT { $$ = tRSHFT; }
+ | '+' { $$ = '+'; }
+ | '-' { $$ = '-'; }
+ | '*' { $$ = '*'; }
+ | tSTAR { $$ = '*'; }
+ | '/' { $$ = '/'; }
+ | '%' { $$ = '%'; }
+ | tPOW { $$ = tPOW; }
+ | '~' { $$ = '~'; }
+ | tUPLUS { $$ = tUPLUS; }
+ | tUMINUS { $$ = tUMINUS; }
+ | tAREF { $$ = tAREF; }
+ | tASET { $$ = tASET; }
+ | '`' { $$ = '`'; }
+ ;
+
+reswords : k__LINE__ | k__FILE__ | klBEGIN | klEND
+ | kALIAS | kAND | kBEGIN | kBREAK | kCASE | kCLASS | kDEF
+ | kDEFINED | kDO | kELSE | kELSIF | kEND | kENSURE | kFALSE
+ | kFOR | kIN | kMODULE | kNEXT | kNIL | kNOT
+ | kOR | kREDO | kRESCUE | kRETRY | kRETURN | kSELF | kSUPER
+ | kTHEN | kTRUE | kUNDEF | kWHEN | kYIELD
+ | kIF | kUNLESS | kWHILE | kUNTIL
;
arg : lhs '=' arg
{
- /*%%%*/
- value_expr($3);
$$ = node_assign($1, $3);
- /*%
- $$ = dispatch2(assign, $1, $3);
- %*/
}
- | lhs '=' arg modifier_rescue arg
+ | lhs '=' arg kRESCUE_MOD arg
{
- /*%%%*/
- value_expr($3);
- $3 = NEW_RESCUE($3, NEW_RESBODY(0,$5,0), 0);
- $$ = node_assign($1, $3);
- /*%
- $$ = dispatch2(assign, $1, dispatch2(rescue_mod, $3, $5));
- %*/
+ $$ = node_assign($1, NEW_RESCUE($3, NEW_RESBODY(0,$5,0), 0));
}
| var_lhs tOP_ASGN arg
{
- /*%%%*/
- value_expr($3);
- if ($1) {
- ID vid = $1->nd_vid;
- if ($2 == tOROP) {
- $1->nd_value = $3;
- $$ = NEW_OP_ASGN_OR(gettable(vid), $1);
- if (is_asgn_or_id(vid)) {
- $$->nd_aid = vid;
- }
- }
- else if ($2 == tANDOP) {
- $1->nd_value = $3;
- $$ = NEW_OP_ASGN_AND(gettable(vid), $1);
- }
- else {
- $$ = $1;
- $$->nd_value = NEW_CALL(gettable(vid), $2, NEW_LIST($3));
- }
- }
- else {
- $$ = NEW_BEGIN(0);
- }
- /*%
- $$ = dispatch3(opassign, $1, $2, $3);
- %*/
- }
- | var_lhs tOP_ASGN arg modifier_rescue arg
- {
- /*%%%*/
value_expr($3);
- $3 = NEW_RESCUE($3, NEW_RESBODY(0,$5,0), 0);
if ($1) {
ID vid = $1->nd_vid;
if ($2 == tOROP) {
@@ -1871,21 +1007,16 @@ arg : lhs '=' arg
}
else {
$$ = $1;
- $$->nd_value = NEW_CALL(gettable(vid), $2, NEW_LIST($3));
+ $$->nd_value = call_op(gettable(vid),$2,1,$3);
}
}
else {
- $$ = NEW_BEGIN(0);
+ $$ = 0;
}
- /*%
- $3 = dispatch2(rescue_mod, $3, $5);
- $$ = dispatch3(opassign, $1, $2, $3);
- %*/
}
- | primary_value '[' opt_call_args rbracket tOP_ASGN arg
+ | primary_value '[' aref_args ']' tOP_ASGN arg
{
- /*%%%*/
- NODE *args;
+ NODE *args;
value_expr($6);
if (!$3) $3 = NEW_ZARRAY();
@@ -1897,15 +1028,10 @@ arg : lhs '=' arg
$5 = 1;
}
$$ = NEW_OP_ASGN1($1, $5, args);
- fixpos($$, $1);
- /*%
- $1 = dispatch2(aref_field, $1, escape_Qundef($3));
- $$ = dispatch3(opassign, $1, $5, $6);
- %*/
+ fixpos($$, $1);
}
| primary_value '.' tIDENTIFIER tOP_ASGN arg
{
- /*%%%*/
value_expr($5);
if ($4 == tOROP) {
$4 = 0;
@@ -1914,15 +1040,10 @@ arg : lhs '=' arg
$4 = 1;
}
$$ = NEW_OP_ASGN2($1, $3, $4, $5);
- fixpos($$, $1);
- /*%
- $1 = dispatch3(field, $1, ripper_id2sym('.'), $3);
- $$ = dispatch3(opassign, $1, $4, $5);
- %*/
+ fixpos($$, $1);
}
| primary_value '.' tCONSTANT tOP_ASGN arg
{
- /*%%%*/
value_expr($5);
if ($4 == tOROP) {
$4 = 0;
@@ -1931,15 +1052,10 @@ arg : lhs '=' arg
$4 = 1;
}
$$ = NEW_OP_ASGN2($1, $3, $4, $5);
- fixpos($$, $1);
- /*%
- $1 = dispatch3(field, $1, ripper_id2sym('.'), $3);
- $$ = dispatch3(opassign, $1, $4, $5);
- %*/
+ fixpos($$, $1);
}
| primary_value tCOLON2 tIDENTIFIER tOP_ASGN arg
{
- /*%%%*/
value_expr($5);
if ($4 == tOROP) {
$4 = 0;
@@ -1948,48 +1064,25 @@ arg : lhs '=' arg
$4 = 1;
}
$$ = NEW_OP_ASGN2($1, $3, $4, $5);
- fixpos($$, $1);
- /*%
- $1 = dispatch3(field, $1, ripper_intern("::"), $3);
- $$ = dispatch3(opassign, $1, $4, $5);
- %*/
+ fixpos($$, $1);
}
| primary_value tCOLON2 tCONSTANT tOP_ASGN arg
{
- /*%%%*/
yyerror("constant re-assignment");
- $$ = NEW_BEGIN(0);
- /*%
- $$ = dispatch2(const_path_field, $1, $3);
- $$ = dispatch3(opassign, $$, $4, $5);
- $$ = dispatch1(assign_error, $$);
- %*/
+ $$ = 0;
}
| tCOLON3 tCONSTANT tOP_ASGN arg
{
- /*%%%*/
yyerror("constant re-assignment");
- $$ = NEW_BEGIN(0);
- /*%
- $$ = dispatch1(top_const_field, $2);
- $$ = dispatch3(opassign, $$, $3, $4);
- $$ = dispatch1(assign_error, $$);
- %*/
+ $$ = 0;
}
| backref tOP_ASGN arg
{
- /*%%%*/
- rb_backref_error($1);
- $$ = NEW_BEGIN(0);
- /*%
- $$ = dispatch1(var_field, $1);
- $$ = dispatch3(opassign, $$, $2, $3);
- $$ = dispatch1(assign_error, $$);
- %*/
+ rb_backref_error($1);
+ $$ = 0;
}
| arg tDOT2 arg
{
- /*%%%*/
value_expr($1);
value_expr($3);
$$ = NEW_DOT2($1, $3);
@@ -1997,13 +1090,9 @@ arg : lhs '=' arg
nd_type($3) == NODE_LIT && FIXNUM_P($3->nd_lit)) {
deferred_nodes = list_append(deferred_nodes, $$);
}
- /*%
- $$ = dispatch2(dot2, $1, $3);
- %*/
}
| arg tDOT3 arg
{
- /*%%%*/
value_expr($1);
value_expr($3);
$$ = NEW_DOT3($1, $3);
@@ -2011,266 +1100,137 @@ arg : lhs '=' arg
nd_type($3) == NODE_LIT && FIXNUM_P($3->nd_lit)) {
deferred_nodes = list_append(deferred_nodes, $$);
}
- /*%
- $$ = dispatch2(dot3, $1, $3);
- %*/
}
| arg '+' arg
{
- /*%%%*/
- $$ = call_bin_op($1, '+', $3);
- /*%
- $$ = dispatch3(binary, $1, ID2SYM('+'), $3);
- %*/
+ $$ = call_op($1, '+', 1, $3);
}
| arg '-' arg
{
- /*%%%*/
- $$ = call_bin_op($1, '-', $3);
- /*%
- $$ = dispatch3(binary, $1, ID2SYM('-'), $3);
- %*/
+ $$ = call_op($1, '-', 1, $3);
}
| arg '*' arg
{
- /*%%%*/
- $$ = call_bin_op($1, '*', $3);
- /*%
- $$ = dispatch3(binary, $1, ID2SYM('*'), $3);
- %*/
+ $$ = call_op($1, '*', 1, $3);
}
| arg '/' arg
{
- /*%%%*/
- $$ = call_bin_op($1, '/', $3);
- /*%
- $$ = dispatch3(binary, $1, ID2SYM('/'), $3);
- %*/
+ $$ = call_op($1, '/', 1, $3);
}
| arg '%' arg
{
- /*%%%*/
- $$ = call_bin_op($1, '%', $3);
- /*%
- $$ = dispatch3(binary, $1, ID2SYM('%'), $3);
- %*/
+ $$ = call_op($1, '%', 1, $3);
}
| arg tPOW arg
{
- /*%%%*/
- $$ = call_bin_op($1, tPOW, $3);
- /*%
- $$ = dispatch3(binary, $1, ripper_intern("**"), $3);
- %*/
+ $$ = call_op($1, tPOW, 1, $3);
}
| tUMINUS_NUM tINTEGER tPOW arg
{
- /*%%%*/
- $$ = NEW_CALL(call_bin_op($2, tPOW, $4), tUMINUS, 0);
- /*%
- $$ = dispatch3(binary, $2, ripper_intern("**"), $4);
- $$ = dispatch2(unary, ripper_intern("-@"), $$);
- %*/
+ $$ = call_op(call_op($2, tPOW, 1, $4), tUMINUS, 0, 0);
}
| tUMINUS_NUM tFLOAT tPOW arg
{
- /*%%%*/
- $$ = NEW_CALL(call_bin_op($2, tPOW, $4), tUMINUS, 0);
- /*%
- $$ = dispatch3(binary, $2, ripper_intern("**"), $4);
- $$ = dispatch2(unary, ripper_intern("-@"), $$);
- %*/
+ $$ = call_op(call_op($2, tPOW, 1, $4), tUMINUS, 0, 0);
}
| tUPLUS arg
{
- /*%%%*/
- $$ = call_uni_op($2, tUPLUS);
- /*%
- $$ = dispatch2(unary, ripper_intern("+@"), $2);
- %*/
+ if ($2 && nd_type($2) == NODE_LIT) {
+ $$ = $2;
+ }
+ else {
+ $$ = call_op($2, tUPLUS, 0, 0);
+ }
}
| tUMINUS arg
{
- /*%%%*/
- $$ = call_uni_op($2, tUMINUS);
- /*%
- $$ = dispatch2(unary, ripper_intern("-@"), $2);
- %*/
+ $$ = call_op($2, tUMINUS, 0, 0);
}
| arg '|' arg
{
- /*%%%*/
- $$ = call_bin_op($1, '|', $3);
- /*%
- $$ = dispatch3(binary, $1, ID2SYM('|'), $3);
- %*/
+ $$ = call_op($1, '|', 1, $3);
}
| arg '^' arg
{
- /*%%%*/
- $$ = call_bin_op($1, '^', $3);
- /*%
- $$ = dispatch3(binary, $1, ID2SYM('^'), $3);
- %*/
+ $$ = call_op($1, '^', 1, $3);
}
| arg '&' arg
{
- /*%%%*/
- $$ = call_bin_op($1, '&', $3);
- /*%
- $$ = dispatch3(binary, $1, ID2SYM('&'), $3);
- %*/
+ $$ = call_op($1, '&', 1, $3);
}
| arg tCMP arg
{
- /*%%%*/
- $$ = call_bin_op($1, tCMP, $3);
- /*%
- $$ = dispatch3(binary, $1, ripper_intern("<=>"), $3);
- %*/
+ $$ = call_op($1, tCMP, 1, $3);
}
| arg '>' arg
{
- /*%%%*/
- $$ = call_bin_op($1, '>', $3);
- /*%
- $$ = dispatch3(binary, $1, ID2SYM('>'), $3);
- %*/
+ $$ = call_op($1, '>', 1, $3);
}
| arg tGEQ arg
{
- /*%%%*/
- $$ = call_bin_op($1, tGEQ, $3);
- /*%
- $$ = dispatch3(binary, $1, ripper_intern(">="), $3);
- %*/
+ $$ = call_op($1, tGEQ, 1, $3);
}
| arg '<' arg
{
- /*%%%*/
- $$ = call_bin_op($1, '<', $3);
- /*%
- $$ = dispatch3(binary, $1, ID2SYM('<'), $3);
- %*/
+ $$ = call_op($1, '<', 1, $3);
}
| arg tLEQ arg
{
- /*%%%*/
- $$ = call_bin_op($1, tLEQ, $3);
- /*%
- $$ = dispatch3(binary, $1, ripper_intern("<="), $3);
- %*/
+ $$ = call_op($1, tLEQ, 1, $3);
}
| arg tEQ arg
{
- /*%%%*/
- $$ = call_bin_op($1, tEQ, $3);
- /*%
- $$ = dispatch3(binary, $1, ripper_intern("=="), $3);
- %*/
+ $$ = call_op($1, tEQ, 1, $3);
}
| arg tEQQ arg
{
- /*%%%*/
- $$ = call_bin_op($1, tEQQ, $3);
- /*%
- $$ = dispatch3(binary, $1, ripper_intern("==="), $3);
- %*/
+ $$ = call_op($1, tEQQ, 1, $3);
}
| arg tNEQ arg
{
- /*%%%*/
- $$ = call_bin_op($1, tNEQ, $3);
- /*%
- $$ = dispatch3(binary, $1, ripper_intern("!="), $3);
- %*/
+ $$ = NEW_NOT(call_op($1, tEQ, 1, $3));
}
| arg tMATCH arg
{
- /*%%%*/
- $$ = match_op($1, $3);
- if (nd_type($1) == NODE_LIT && TYPE($1->nd_lit) == T_REGEXP) {
- $$ = reg_named_capture_assign($1->nd_lit, $$);
- }
- /*%
- $$ = dispatch3(binary, $1, ripper_intern("=~"), $3);
- %*/
+ $$ = match_gen($1, $3);
}
| arg tNMATCH arg
{
- /*%%%*/
- $$ = call_bin_op($1, tNMATCH, $3);
- /*%
- $$ = dispatch3(binary, $1, ripper_intern("!~"), $3);
- %*/
+ $$ = NEW_NOT(match_gen($1, $3));
}
| '!' arg
{
- /*%%%*/
- $$ = call_uni_op(cond($2), '!');
- /*%
- $$ = dispatch2(unary, ID2SYM('!'), $2);
- %*/
+ $$ = NEW_NOT(cond($2));
}
| '~' arg
{
- /*%%%*/
- $$ = call_uni_op($2, '~');
- /*%
- $$ = dispatch2(unary, ID2SYM('~'), $2);
- %*/
+ $$ = call_op($2, '~', 0, 0);
}
| arg tLSHFT arg
{
- /*%%%*/
- $$ = call_bin_op($1, tLSHFT, $3);
- /*%
- $$ = dispatch3(binary, $1, ripper_intern("<<"), $3);
- %*/
+ $$ = call_op($1, tLSHFT, 1, $3);
}
| arg tRSHFT arg
{
- /*%%%*/
- $$ = call_bin_op($1, tRSHFT, $3);
- /*%
- $$ = dispatch3(binary, $1, ripper_intern(">>"), $3);
- %*/
+ $$ = call_op($1, tRSHFT, 1, $3);
}
| arg tANDOP arg
{
- /*%%%*/
$$ = logop(NODE_AND, $1, $3);
- /*%
- $$ = dispatch3(binary, $1, ripper_intern("&&"), $3);
- %*/
}
| arg tOROP arg
{
- /*%%%*/
$$ = logop(NODE_OR, $1, $3);
- /*%
- $$ = dispatch3(binary, $1, ripper_intern("||"), $3);
- %*/
}
- | keyword_defined opt_nl {in_defined = 1;} arg
+ | kDEFINED opt_nl {in_defined = 1;} arg
{
- /*%%%*/
- in_defined = 0;
+ in_defined = 0;
$$ = NEW_DEFINED($4);
- /*%
- in_defined = 0;
- $$ = dispatch1(defined, $4);
- %*/
}
- | arg '?' arg opt_nl ':' arg
+ | arg '?' arg ':' arg
{
- /*%%%*/
- value_expr($1);
- $$ = NEW_IF(cond($1), $3, $6);
- fixpos($$, $1);
- /*%
- $$ = dispatch3(ifop, $1, $3, $6);
- %*/
+ $$ = NEW_IF(cond($1), $3, $5);
+ fixpos($$, $1);
}
| primary
{
@@ -2280,46 +1240,51 @@ arg : lhs '=' arg
arg_value : arg
{
- /*%%%*/
value_expr($1);
$$ = $1;
- if (!$$) $$ = NEW_NIL();
- /*%
- $$ = $1;
- %*/
}
;
aref_args : none
+ | command opt_nl
+ {
+ $$ = NEW_LIST($1);
+ }
| args trailer
{
$$ = $1;
}
- | args ',' assocs trailer
+ | args ',' tSTAR arg opt_nl
{
- /*%%%*/
- $$ = arg_append($1, NEW_HASH($3));
- /*%
- $$ = arg_add_assocs($1, $3);
- %*/
+ value_expr($4);
+ $$ = arg_concat($1, $4);
}
| assocs trailer
{
- /*%%%*/
$$ = NEW_LIST(NEW_HASH($1));
- /*%
- $$ = arg_add_assocs(arg_new(), $1);
- %*/
+ }
+ | tSTAR arg opt_nl
+ {
+ value_expr($2);
+ $$ = NEW_NEWLINE(NEW_SPLAT($2));
}
;
-paren_args : '(' opt_call_args rparen
+paren_args : '(' none ')'
+ {
+ $$ = $2;
+ }
+ | '(' call_args opt_nl ')'
{
- /*%%%*/
$$ = $2;
- /*%
- $$ = dispatch1(arg_paren, escape_Qundef($2));
- %*/
+ }
+ | '(' block_call opt_nl ')'
+ {
+ $$ = NEW_LIST($2);
+ }
+ | '(' args ',' block_call opt_nl ')'
+ {
+ $$ = list_append($2, $4);
}
;
@@ -2327,74 +1292,130 @@ opt_paren_args : none
| paren_args
;
-opt_call_args : none
- | call_args
- ;
-
call_args : command
{
- /*%%%*/
- value_expr($1);
$$ = NEW_LIST($1);
- /*%
- $$ = arg_add(arg_new(), $1);
- %*/
}
| args opt_block_arg
{
- /*%%%*/
$$ = arg_blk_pass($1, $2);
- /*%
- $$ = arg_add_optblock($1, $2);
- %*/
+ }
+ | args ',' tSTAR arg_value opt_block_arg
+ {
+ $$ = arg_concat($1, $4);
+ $$ = arg_blk_pass($$, $5);
}
| assocs opt_block_arg
{
- /*%%%*/
$$ = NEW_LIST(NEW_HASH($1));
$$ = arg_blk_pass($$, $2);
- /*%
- $$ = arg_add_assocs(arg_new(), $1);
- $$ = arg_add_optblock($$, $2);
- %*/
+ }
+ | assocs ',' tSTAR arg_value opt_block_arg
+ {
+ $$ = arg_concat(NEW_LIST(NEW_HASH($1)), $4);
+ $$ = arg_blk_pass($$, $5);
}
| args ',' assocs opt_block_arg
{
- /*%%%*/
- $$ = arg_append($1, NEW_HASH($3));
+ $$ = list_append($1, NEW_HASH($3));
$$ = arg_blk_pass($$, $4);
- /*%
- $$ = arg_add_optblock(arg_add_assocs($1, $3), $4);
- %*/
+ }
+ | args ',' assocs ',' tSTAR arg opt_block_arg
+ {
+ value_expr($6);
+ $$ = arg_concat(list_append($1, NEW_HASH($3)), $6);
+ $$ = arg_blk_pass($$, $7);
+ }
+ | tSTAR arg_value opt_block_arg
+ {
+ $$ = arg_blk_pass(NEW_SPLAT($2), $3);
}
| block_arg
- /*%c%*/
- /*%c
+ ;
+
+call_args2 : arg_value ',' args opt_block_arg
{
- $$ = arg_add_block(arg_new(), $1);
+ $$ = arg_blk_pass(list_concat(NEW_LIST($1),$3), $4);
}
- %*/
+ | arg_value ',' block_arg
+ {
+ $$ = arg_blk_pass($1, $3);
+ }
+ | arg_value ',' tSTAR arg_value opt_block_arg
+ {
+ $$ = arg_concat(NEW_LIST($1), $4);
+ $$ = arg_blk_pass($$, $5);
+ }
+ | arg_value ',' args ',' tSTAR arg_value opt_block_arg
+ {
+ $$ = arg_concat(list_concat(NEW_LIST($1),$3), $6);
+ $$ = arg_blk_pass($$, $7);
+ }
+ | assocs opt_block_arg
+ {
+ $$ = NEW_LIST(NEW_HASH($1));
+ $$ = arg_blk_pass($$, $2);
+ }
+ | assocs ',' tSTAR arg_value opt_block_arg
+ {
+ $$ = arg_concat(NEW_LIST(NEW_HASH($1)), $4);
+ $$ = arg_blk_pass($$, $5);
+ }
+ | arg_value ',' assocs opt_block_arg
+ {
+ $$ = list_append(NEW_LIST($1), NEW_HASH($3));
+ $$ = arg_blk_pass($$, $4);
+ }
+ | arg_value ',' args ',' assocs opt_block_arg
+ {
+ $$ = list_append(list_concat(NEW_LIST($1),$3), NEW_HASH($5));
+ $$ = arg_blk_pass($$, $6);
+ }
+ | arg_value ',' assocs ',' tSTAR arg_value opt_block_arg
+ {
+ $$ = arg_concat(list_append(NEW_LIST($1), NEW_HASH($3)), $6);
+ $$ = arg_blk_pass($$, $7);
+ }
+ | arg_value ',' args ',' assocs ',' tSTAR arg_value opt_block_arg
+ {
+ $$ = arg_concat(list_append(list_concat(NEW_LIST($1), $3), NEW_HASH($5)), $8);
+ $$ = arg_blk_pass($$, $9);
+ }
+ | tSTAR arg_value opt_block_arg
+ {
+ $$ = arg_blk_pass(NEW_SPLAT($2), $3);
+ }
+ | block_arg
;
command_args : {
- $<val>$ = cmdarg_stack;
+ $<num>$ = cmdarg_stack;
CMDARG_PUSH(1);
}
- call_args
+ open_args
{
/* CMDARG_POP() */
- cmdarg_stack = $<val>1;
+ cmdarg_stack = $<num>1;
+ $$ = $2;
+ }
+ ;
+
+open_args : call_args
+ | tLPAREN_ARG {lex_state = EXPR_ENDARG;} ')'
+ {
+ rb_warn("don't put space before argument parentheses");
+ $$ = 0;
+ }
+ | tLPAREN_ARG call_args2 {lex_state = EXPR_ENDARG;} ')'
+ {
+ rb_warn("don't put space before argument parentheses");
$$ = $2;
}
;
block_arg : tAMPER arg_value
{
- /*%%%*/
$$ = NEW_BLOCK_PASS($2);
- /*%
- $$ = $2;
- %*/
}
;
@@ -2402,98 +1423,30 @@ opt_block_arg : ',' block_arg
{
$$ = $2;
}
- | ','
- {
- $$ = 0;
- }
| none
- {
- $$ = 0;
- }
;
-args : arg_value
+args : arg_value
{
- /*%%%*/
$$ = NEW_LIST($1);
- /*%
- $$ = arg_add(arg_new(), $1);
- %*/
- }
- | tSTAR arg_value
- {
- /*%%%*/
- $$ = NEW_SPLAT($2);
- /*%
- $$ = arg_add_star(arg_new(), $2);
- %*/
}
| args ',' arg_value
{
- /*%%%*/
- NODE *n1;
- if ((n1 = splat_array($1)) != 0) {
- $$ = list_append(n1, $3);
- }
- else {
- $$ = arg_append($1, $3);
- }
- /*%
- $$ = arg_add($1, $3);
- %*/
- }
- | args ',' tSTAR arg_value
- {
- /*%%%*/
- NODE *n1;
- if ((nd_type($4) == NODE_ARRAY) && (n1 = splat_array($1)) != 0) {
- $$ = list_concat(n1, $4);
- }
- else {
- $$ = arg_concat($1, $4);
- }
- /*%
- $$ = arg_add_star($1, $4);
- %*/
+ $$ = list_append($1, $3);
}
;
mrhs : args ',' arg_value
{
- /*%%%*/
- NODE *n1;
- if ((n1 = splat_array($1)) != 0) {
- $$ = list_append(n1, $3);
- }
- else {
- $$ = arg_append($1, $3);
- }
- /*%
- $$ = mrhs_add(args2mrhs($1), $3);
- %*/
+ $$ = list_append($1, $3);
}
| args ',' tSTAR arg_value
{
- /*%%%*/
- NODE *n1;
- if (nd_type($4) == NODE_ARRAY &&
- (n1 = splat_array($1)) != 0) {
- $$ = list_concat(n1, $4);
- }
- else {
- $$ = arg_concat($1, $4);
- }
- /*%
- $$ = mrhs_add_star(args2mrhs($1), $4);
- %*/
+ $$ = arg_concat($1, $4);
}
| tSTAR arg_value
{
- /*%%%*/
$$ = NEW_SPLAT($2);
- /*%
- $$ = mrhs_add_star(mrhs_new(), $2);
- %*/
}
;
@@ -2507,1172 +1460,497 @@ primary : literal
| backref
| tFID
{
- /*%%%*/
$$ = NEW_FCALL($1, 0);
- /*%
- $$ = method_arg(dispatch1(fcall, $1), arg_new());
- %*/
}
- | k_begin
+ | kBEGIN
{
- /*%%%*/
- $<num>$ = ruby_sourceline;
- /*%
- %*/
+ $<num>1 = ruby_sourceline;
}
bodystmt
- k_end
+ kEND
{
- /*%%%*/
- if ($3 == NULL) {
+ if ($3 == NULL)
$$ = NEW_NIL();
- }
- else {
- if (nd_type($3) == NODE_RESCUE ||
- nd_type($3) == NODE_ENSURE)
- nd_set_line($3, $<num>2);
+ else
$$ = NEW_BEGIN($3);
- }
- nd_set_line($$, $<num>2);
- /*%
- $$ = dispatch1(begin, $3);
- %*/
+ nd_set_line($$, $<num>1);
}
- | tLPAREN_ARG expr {lex_state = EXPR_ENDARG;} rparen
+ | tLPAREN_ARG expr {lex_state = EXPR_ENDARG;} opt_nl ')'
{
- rb_warning0("(...) interpreted as grouped expression");
- /*%%%*/
+ rb_warning("(...) interpreted as grouped expression");
$$ = $2;
- /*%
- $$ = dispatch1(paren, $2);
- %*/
}
| tLPAREN compstmt ')'
{
- /*%%%*/
- $$ = $2;
- /*%
- $$ = dispatch1(paren, $2);
- %*/
+ if (!$2) $$ = NEW_NIL();
+ else $$ = $2;
}
| primary_value tCOLON2 tCONSTANT
{
- /*%%%*/
$$ = NEW_COLON2($1, $3);
- /*%
- $$ = dispatch2(const_path_ref, $1, $3);
- %*/
}
| tCOLON3 tCONSTANT
{
- /*%%%*/
$$ = NEW_COLON3($2);
- /*%
- $$ = dispatch1(top_const_ref, $2);
- %*/
+ }
+ | primary_value '[' aref_args ']'
+ {
+ if ($1 && nd_type($1) == NODE_SELF)
+ $$ = NEW_FCALL(tAREF, $3);
+ else
+ $$ = NEW_CALL($1, tAREF, $3);
+ fixpos($$, $1);
}
| tLBRACK aref_args ']'
{
- /*%%%*/
- if ($2 == 0) {
+ if ($2 == 0) {
$$ = NEW_ZARRAY(); /* zero length array*/
}
else {
$$ = $2;
}
- /*%
- $$ = dispatch1(array, escape_Qundef($2));
- %*/
}
| tLBRACE assoc_list '}'
{
- /*%%%*/
$$ = NEW_HASH($2);
- /*%
- $$ = dispatch1(hash, escape_Qundef($2));
- %*/
}
- | keyword_return
+ | kRETURN
{
- /*%%%*/
$$ = NEW_RETURN(0);
- /*%
- $$ = dispatch0(return0);
- %*/
}
- | keyword_yield '(' call_args rparen
+ | kYIELD '(' call_args ')'
{
- /*%%%*/
$$ = new_yield($3);
- /*%
- $$ = dispatch1(yield, dispatch1(paren, $3));
- %*/
}
- | keyword_yield '(' rparen
+ | kYIELD '(' ')'
{
- /*%%%*/
$$ = NEW_YIELD(0, Qfalse);
- /*%
- $$ = dispatch1(yield, dispatch1(paren, arg_new()));
- %*/
}
- | keyword_yield
+ | kYIELD
{
- /*%%%*/
$$ = NEW_YIELD(0, Qfalse);
- /*%
- $$ = dispatch0(yield0);
- %*/
}
- | keyword_defined opt_nl '(' {in_defined = 1;} expr rparen
+ | kDEFINED opt_nl '(' {in_defined = 1;} expr ')'
{
- /*%%%*/
- in_defined = 0;
+ in_defined = 0;
$$ = NEW_DEFINED($5);
- /*%
- in_defined = 0;
- $$ = dispatch1(defined, $5);
- %*/
- }
- | keyword_not '(' expr rparen
- {
- /*%%%*/
- $$ = call_uni_op(cond($3), '!');
- /*%
- $$ = dispatch2(unary, ripper_intern("not"), $3);
- %*/
- }
- | keyword_not '(' rparen
- {
- /*%%%*/
- $$ = call_uni_op(cond(NEW_NIL()), '!');
- /*%
- $$ = dispatch2(unary, ripper_intern("not"), Qnil);
- %*/
}
| operation brace_block
{
- /*%%%*/
$2->nd_iter = NEW_FCALL($1, 0);
$$ = $2;
fixpos($2->nd_iter, $2);
- /*%
- $$ = method_arg(dispatch1(fcall, $1), arg_new());
- $$ = method_add_block($$, $2);
- %*/
}
| method_call
| method_call brace_block
{
- /*%%%*/
- block_dup_check($1->nd_args, $2);
+ if ($1 && nd_type($1) == NODE_BLOCK_PASS) {
+ rb_compile_error("both block arg and actual block given");
+ }
$2->nd_iter = $1;
$$ = $2;
- fixpos($$, $1);
- /*%
- $$ = method_add_block($1, $2);
- %*/
+ fixpos($$, $1);
}
- | tLAMBDA lambda
- {
- $$ = $2;
- }
- | k_if expr_value then
+ | kIF expr_value then
compstmt
if_tail
- k_end
+ kEND
{
- /*%%%*/
$$ = NEW_IF(cond($2), $4, $5);
- fixpos($$, $2);
- /*%
- $$ = dispatch3(if, $2, $4, escape_Qundef($5));
- %*/
+ fixpos($$, $2);
+ if (cond_negative(&$$->nd_cond)) {
+ NODE *tmp = $$->nd_body;
+ $$->nd_body = $$->nd_else;
+ $$->nd_else = tmp;
+ }
}
- | k_unless expr_value then
+ | kUNLESS expr_value then
compstmt
opt_else
- k_end
+ kEND
{
- /*%%%*/
$$ = NEW_UNLESS(cond($2), $4, $5);
- fixpos($$, $2);
- /*%
- $$ = dispatch3(unless, $2, $4, escape_Qundef($5));
- %*/
+ fixpos($$, $2);
+ if (cond_negative(&$$->nd_cond)) {
+ NODE *tmp = $$->nd_body;
+ $$->nd_body = $$->nd_else;
+ $$->nd_else = tmp;
+ }
}
- | k_while {COND_PUSH(1);} expr_value do {COND_POP();}
+ | kWHILE {COND_PUSH(1);} expr_value do {COND_POP();}
compstmt
- k_end
+ kEND
{
- /*%%%*/
$$ = NEW_WHILE(cond($3), $6, 1);
- fixpos($$, $3);
- /*%
- $$ = dispatch2(while, $3, $6);
- %*/
+ fixpos($$, $3);
+ if (cond_negative(&$$->nd_cond)) {
+ nd_set_type($$, NODE_UNTIL);
+ }
}
- | k_until {COND_PUSH(1);} expr_value do {COND_POP();}
+ | kUNTIL {COND_PUSH(1);} expr_value do {COND_POP();}
compstmt
- k_end
+ kEND
{
- /*%%%*/
$$ = NEW_UNTIL(cond($3), $6, 1);
- fixpos($$, $3);
- /*%
- $$ = dispatch2(until, $3, $6);
- %*/
+ fixpos($$, $3);
+ if (cond_negative(&$$->nd_cond)) {
+ nd_set_type($$, NODE_WHILE);
+ }
}
- | k_case expr_value opt_terms
+ | kCASE expr_value opt_terms
case_body
- k_end
+ kEND
{
- /*%%%*/
$$ = NEW_CASE($2, $4);
- fixpos($$, $2);
- /*%
- $$ = dispatch2(case, $2, $4);
- %*/
- }
- | k_case opt_terms case_body k_end
- {
- /*%%%*/
- $$ = NEW_CASE(0, $3);
- /*%
- $$ = dispatch2(case, Qnil, $3);
- %*/
- }
- | k_for for_var keyword_in
- {COND_PUSH(1);}
- expr_value do
- {COND_POP();}
+ fixpos($$, $2);
+ }
+ | kCASE opt_terms case_body kEND
+ {
+ $$ = $3;
+ }
+ | kCASE opt_terms kELSE compstmt kEND
+ {
+ $$ = $4;
+ }
+ | kFOR for_var kIN {COND_PUSH(1);} expr_value do {COND_POP();}
compstmt
- k_end
- {
- /*%%%*/
- /*
- * for a, b, c in e
- * #=>
- * e.each{|*x| a, b, c = x
- *
- * for a in e
- * #=>
- * e.each{|x| a, = x}
- */
- ID id = internal_id();
- ID *tbl = ALLOC_N(ID, 2);
- NODE *m = NEW_ARGS_AUX(0, 0);
- NODE *args, *scope;
-
- if (nd_type($2) == NODE_MASGN) {
- /* if args.length == 1 && args[0].kind_of?(Array)
- * args = args[0]
- * end
- */
- NODE *one = NEW_LIST(NEW_LIT(INT2FIX(1)));
- NODE *zero = NEW_LIST(NEW_LIT(INT2FIX(0)));
- m->nd_next = block_append(
- NEW_IF(
- NEW_NODE(NODE_AND,
- NEW_CALL(NEW_CALL(NEW_DVAR(id), rb_intern("length"), 0),
- rb_intern("=="), one),
- NEW_CALL(NEW_CALL(NEW_DVAR(id), rb_intern("[]"), zero),
- rb_intern("kind_of?"), NEW_LIST(NEW_LIT(rb_cArray))),
- 0),
- NEW_DASGN_CURR(id,
- NEW_CALL(NEW_DVAR(id), rb_intern("[]"), zero)),
- 0),
- node_assign($2, NEW_DVAR(id)));
-
- args = new_args(m, 0, id, 0, 0);
- }
- else {
- if (nd_type($2) == NODE_LASGN ||
- nd_type($2) == NODE_DASGN ||
- nd_type($2) == NODE_DASGN_CURR) {
- $2->nd_value = NEW_DVAR(id);
- m->nd_plen = 1;
- m->nd_next = $2;
- args = new_args(m, 0, 0, 0, 0);
- }
- else {
- m->nd_next = node_assign(NEW_MASGN(NEW_LIST($2), 0), NEW_DVAR(id));
- args = new_args(m, 0, id, 0, 0);
- }
- }
- scope = NEW_NODE(NODE_SCOPE, tbl, $8, args);
- tbl[0] = 1; tbl[1] = id;
- $$ = NEW_FOR(0, $5, scope);
- fixpos($$, $2);
- /*%
- $$ = dispatch3(for, $2, $5, $8);
- %*/
+ kEND
+ {
+ $$ = NEW_FOR($2, $5, $8);
+ fixpos($$, $2);
}
- | k_class cpath superclass
+ | kCLASS cpath superclass
{
if (in_def || in_single)
yyerror("class definition in method body");
- /*%%%*/
+ class_nest++;
local_push(0);
- $<num>$ = ruby_sourceline;
- /*%
- %*/
+ $<num>$ = ruby_sourceline;
}
bodystmt
- k_end
+ kEND
{
- /*%%%*/
- $$ = NEW_CLASS($2, $5, $3);
- nd_set_line($$, $<num>4);
- local_pop();
- /*%
- $$ = dispatch3(class, $2, $3, $5);
- %*/
+ $$ = NEW_CLASS($2, $5, $3);
+ nd_set_line($$, $<num>4);
+ local_pop();
+ class_nest--;
}
- | k_class tLSHFT expr
+ | kCLASS tLSHFT expr
{
$<num>$ = in_def;
- in_def = 0;
+ in_def = 0;
}
term
{
- $<num>$ = in_single;
- in_single = 0;
- /*%%%*/
+ $<num>$ = in_single;
+ in_single = 0;
+ class_nest++;
local_push(0);
- /*%
- %*/
}
bodystmt
- k_end
+ kEND
{
- /*%%%*/
- $$ = NEW_SCLASS($3, $7);
- fixpos($$, $3);
- local_pop();
- /*%
- $$ = dispatch2(sclass, $3, $7);
- %*/
- in_def = $<num>4;
- in_single = $<num>6;
+ $$ = NEW_SCLASS($3, $7);
+ fixpos($$, $3);
+ local_pop();
+ class_nest--;
+ in_def = $<num>4;
+ in_single = $<num>6;
}
- | k_module cpath
+ | kMODULE cpath
{
if (in_def || in_single)
yyerror("module definition in method body");
- /*%%%*/
+ class_nest++;
local_push(0);
- $<num>$ = ruby_sourceline;
- /*%
- %*/
+ $<num>$ = ruby_sourceline;
}
bodystmt
- k_end
+ kEND
{
- /*%%%*/
- $$ = NEW_MODULE($2, $4);
- nd_set_line($$, $<num>3);
- local_pop();
- /*%
- $$ = dispatch2(module, $2, $4);
- %*/
+ $$ = NEW_MODULE($2, $4);
+ nd_set_line($$, $<num>3);
+ local_pop();
+ class_nest--;
}
- | k_def fname
+ | kDEF fname
{
$<id>$ = cur_mid;
cur_mid = $2;
in_def++;
- /*%%%*/
local_push(0);
- /*%
- %*/
}
f_arglist
bodystmt
- k_end
- {
- /*%%%*/
- NODE *body = remove_begin($5);
- reduce_nodes(&body);
- $$ = NEW_DEFN($2, $4, body, NOEX_PRIVATE);
- fixpos($$, $4);
- fixpos($$->nd_defn, $4);
- local_pop();
- /*%
- $$ = dispatch3(def, $2, $4, $5);
- %*/
+ kEND
+ {
+ if (!$5) $5 = NEW_NIL();
+ $$ = NEW_DEFN($2, $4, $5, NOEX_PRIVATE);
+ fixpos($$, $4);
+ local_pop();
in_def--;
cur_mid = $<id>3;
}
- | k_def singleton dot_or_colon {lex_state = EXPR_FNAME;} fname
+ | kDEF singleton dot_or_colon {lex_state = EXPR_FNAME;} fname
{
in_single++;
- lex_state = EXPR_END; /* force for args */
- /*%%%*/
local_push(0);
- /*%
- %*/
+ lex_state = EXPR_END; /* force for args */
}
f_arglist
bodystmt
- k_end
- {
- /*%%%*/
- NODE *body = remove_begin($8);
- reduce_nodes(&body);
- $$ = NEW_DEFS($2, $5, $7, body);
- fixpos($$, $2);
- fixpos($$->nd_defn, $2);
- local_pop();
- /*%
- $$ = dispatch5(defs, $2, $3, $5, $7, $8);
- %*/
+ kEND
+ {
+ $$ = NEW_DEFS($2, $5, $7, $8);
+ fixpos($$, $2);
+ local_pop();
in_single--;
}
- | keyword_break
+ | kBREAK
{
- /*%%%*/
$$ = NEW_BREAK(0);
- /*%
- $$ = dispatch1(break, arg_new());
- %*/
}
- | keyword_next
+ | kNEXT
{
- /*%%%*/
$$ = NEW_NEXT(0);
- /*%
- $$ = dispatch1(next, arg_new());
- %*/
}
- | keyword_redo
+ | kREDO
{
- /*%%%*/
$$ = NEW_REDO();
- /*%
- $$ = dispatch0(redo);
- %*/
}
- | keyword_retry
+ | kRETRY
{
- /*%%%*/
$$ = NEW_RETRY();
- /*%
- $$ = dispatch0(retry);
- %*/
}
;
-primary_value : primary
+primary_value : primary
{
- /*%%%*/
value_expr($1);
$$ = $1;
- if (!$$) $$ = NEW_NIL();
- /*%
- $$ = $1;
- %*/
- }
- ;
-
-k_begin : keyword_begin
- {
-#ifndef RIPPER
- if (RTEST(ruby_verbose)) token_info_push(parser, "begin");
-#endif
- }
- ;
-
-k_if : keyword_if
- {
-#ifndef RIPPER
- if (RTEST(ruby_verbose)) token_info_push(parser, "if");
-#endif
- }
- ;
-
-k_unless : keyword_unless
- {
-#ifndef RIPPER
- if (RTEST(ruby_verbose)) token_info_push(parser, "unless");
-#endif
- }
- ;
-
-k_while : keyword_while
- {
-#ifndef RIPPER
- if (RTEST(ruby_verbose)) token_info_push(parser, "while");
-#endif
- }
- ;
-
-k_until : keyword_until
- {
-#ifndef RIPPER
- if (RTEST(ruby_verbose)) token_info_push(parser, "until");
-#endif
- }
- ;
-
-k_case : keyword_case
- {
-#ifndef RIPPER
- if (RTEST(ruby_verbose)) token_info_push(parser, "case");
-#endif
- }
- ;
-
-k_for : keyword_for
- {
-#ifndef RIPPER
- if (RTEST(ruby_verbose)) token_info_push(parser, "for");
-#endif
- }
- ;
-
-k_class : keyword_class
- {
-#ifndef RIPPER
- if (RTEST(ruby_verbose)) token_info_push(parser, "class");
-#endif
- }
- ;
-
-k_module : keyword_module
- {
-#ifndef RIPPER
- if (RTEST(ruby_verbose)) token_info_push(parser, "module");
-#endif
- }
- ;
-
-k_def : keyword_def
- {
-#ifndef RIPPER
- if (RTEST(ruby_verbose)) token_info_push(parser, "def");
-#endif
- }
- ;
-
-k_end : keyword_end
- {
-#ifndef RIPPER
- if (RTEST(ruby_verbose)) token_info_pop(parser, "end"); /* POP */
-#endif
}
;
then : term
- /*%c%*/
- /*%c
- { $$ = Qnil; }
- %*/
- | keyword_then
- | term keyword_then
- /*%c%*/
- /*%c
- { $$ = $2; }
- %*/
+ | ':'
+ | kTHEN
+ | term kTHEN
;
do : term
- /*%c%*/
- /*%c
- { $$ = Qnil; }
- %*/
- | keyword_do_cond
+ | ':'
+ | kDO_COND
;
if_tail : opt_else
- | keyword_elsif expr_value then
+ | kELSIF expr_value then
compstmt
if_tail
{
- /*%%%*/
$$ = NEW_IF(cond($2), $4, $5);
- fixpos($$, $2);
- /*%
- $$ = dispatch3(elsif, $2, $4, escape_Qundef($5));
- %*/
+ fixpos($$, $2);
}
;
opt_else : none
- | keyword_else compstmt
+ | kELSE compstmt
{
- /*%%%*/
$$ = $2;
- /*%
- $$ = dispatch1(else, $2);
- %*/
}
;
-for_var : lhs
+for_var : lhs
| mlhs
;
-f_marg : f_norm_arg
+block_par : mlhs_item
{
- /*%%%*/
- $$ = assignable($1, 0);
- /*%
- $$ = dispatch1(mlhs_paren, $1);
- %*/
- }
- | tLPAREN f_margs rparen
- {
- /*%%%*/
- $$ = $2;
- /*%
- $$ = dispatch1(mlhs_paren, $2);
- %*/
- }
- ;
-
-f_marg_list : f_marg
- {
- /*%%%*/
$$ = NEW_LIST($1);
- /*%
- $$ = mlhs_add(mlhs_new(), $1);
- %*/
}
- | f_marg_list ',' f_marg
+ | block_par ',' mlhs_item
{
- /*%%%*/
$$ = list_append($1, $3);
- /*%
- $$ = mlhs_add($1, $3);
- %*/
- }
- ;
-
-f_margs : f_marg_list
- {
- /*%%%*/
- $$ = NEW_MASGN($1, 0);
- /*%
- $$ = $1;
- %*/
- }
- | f_marg_list ',' tSTAR f_norm_arg
- {
- /*%%%*/
- $$ = NEW_MASGN($1, assignable($4, 0));
- /*%
- $$ = mlhs_add_star($1, $4);
- %*/
- }
- | f_marg_list ',' tSTAR f_norm_arg ',' f_marg_list
- {
- /*%%%*/
- $$ = NEW_MASGN($1, NEW_POSTARG(assignable($4, 0), $6));
- /*%
- $$ = mlhs_add_star($1, $4);
- %*/
- }
- | f_marg_list ',' tSTAR
- {
- /*%%%*/
- $$ = NEW_MASGN($1, -1);
- /*%
- $$ = mlhs_add_star($1, Qnil);
- %*/
- }
- | f_marg_list ',' tSTAR ',' f_marg_list
- {
- /*%%%*/
- $$ = NEW_MASGN($1, NEW_POSTARG(-1, $5));
- /*%
- $$ = mlhs_add_star($1, $5);
- %*/
- }
- | tSTAR f_norm_arg
- {
- /*%%%*/
- $$ = NEW_MASGN(0, assignable($2, 0));
- /*%
- $$ = mlhs_add_star(mlhs_new(), $2);
- %*/
- }
- | tSTAR f_norm_arg ',' f_marg_list
- {
- /*%%%*/
- $$ = NEW_MASGN(0, NEW_POSTARG(assignable($2, 0), $4));
- /*%
- #if 0
- TODO: Check me
- #endif
- $$ = mlhs_add_star($2, $4);
- %*/
- }
- | tSTAR
- {
- /*%%%*/
- $$ = NEW_MASGN(0, -1);
- /*%
- $$ = mlhs_add_star(mlhs_new(), Qnil);
- %*/
- }
- | tSTAR ',' f_marg_list
- {
- /*%%%*/
- $$ = NEW_MASGN(0, NEW_POSTARG(-1, $3));
- /*%
- $$ = mlhs_add_star(mlhs_new(), Qnil);
- %*/
}
;
-block_param : f_arg ',' f_block_optarg ',' f_rest_arg opt_f_block_arg
+block_var : block_par
{
- /*%%%*/
- $$ = new_args($1, $3, $5, 0, $6);
- /*%
- $$ = params_new($1, $3, $5, Qnil, escape_Qundef($6));
- %*/
- }
- | f_arg ',' f_block_optarg ',' f_rest_arg ',' f_arg opt_f_block_arg
- {
- /*%%%*/
- $$ = new_args($1, $3, $5, $7, $8);
- /*%
- $$ = params_new($1, $3, $5, $7, escape_Qundef($8));
- %*/
- }
- | f_arg ',' f_block_optarg opt_f_block_arg
- {
- /*%%%*/
- $$ = new_args($1, $3, 0, 0, $4);
- /*%
- $$ = params_new($1, $3, Qnil, Qnil, escape_Qundef($4));
- %*/
- }
- | f_arg ',' f_block_optarg ',' f_arg opt_f_block_arg
- {
- /*%%%*/
- $$ = new_args($1, $3, 0, $5, $6);
- /*%
- $$ = params_new($1, $3, Qnil, $5, escape_Qundef($6));
- %*/
+ if ($1->nd_alen == 1) {
+ $$ = $1->nd_head;
+ rb_gc_force_recycle((VALUE)$1);
+ }
+ else {
+ $$ = NEW_MASGN($1, 0);
+ }
}
- | f_arg ',' f_rest_arg opt_f_block_arg
+ | block_par ','
{
- /*%%%*/
- $$ = new_args($1, 0, $3, 0, $4);
- /*%
- $$ = params_new($1, Qnil, $3, Qnil, escape_Qundef($4));
- %*/
+ $$ = NEW_MASGN($1, 0);
}
- | f_arg ','
+ | block_par ',' tAMPER lhs
{
- /*%%%*/
- $$ = new_args($1, 0, 1, 0, 0);
- /*%
- $$ = params_new($1, Qnil, Qnil, Qnil, Qnil);
- dispatch1(excessed_comma, $$);
- %*/
+ $$ = NEW_BLOCK_VAR($4, NEW_MASGN($1, 0));
}
- | f_arg ',' f_rest_arg ',' f_arg opt_f_block_arg
+ | block_par ',' tSTAR lhs ',' tAMPER lhs
{
- /*%%%*/
- $$ = new_args($1, 0, $3, $5, $6);
- /*%
- $$ = params_new($1, Qnil, $3, $5, escape_Qundef($6));
- %*/
+ $$ = NEW_BLOCK_VAR($7, NEW_MASGN($1, $4));
}
- | f_arg opt_f_block_arg
+ | block_par ',' tSTAR ',' tAMPER lhs
{
- /*%%%*/
- $$ = new_args($1, 0, 0, 0, $2);
- /*%
- $$ = params_new($1, Qnil,Qnil, Qnil, escape_Qundef($2));
- %*/
+ $$ = NEW_BLOCK_VAR($6, NEW_MASGN($1, -1));
}
- | f_block_optarg ',' f_rest_arg opt_f_block_arg
+ | block_par ',' tSTAR lhs
{
- /*%%%*/
- $$ = new_args(0, $1, $3, 0, $4);
- /*%
- $$ = params_new(Qnil, $1, $3, Qnil, escape_Qundef($4));
- %*/
+ $$ = NEW_MASGN($1, $4);
}
- | f_block_optarg ',' f_rest_arg ',' f_arg opt_f_block_arg
+ | block_par ',' tSTAR
{
- /*%%%*/
- $$ = new_args(0, $1, $3, $5, $6);
- /*%
- $$ = params_new(Qnil, $1, $3, $5, escape_Qundef($6));
- %*/
+ $$ = NEW_MASGN($1, -1);
}
- | f_block_optarg opt_f_block_arg
+ | tSTAR lhs ',' tAMPER lhs
{
- /*%%%*/
- $$ = new_args(0, $1, 0, 0, $2);
- /*%
- $$ = params_new(Qnil, $1, Qnil, Qnil,escape_Qundef($2));
- %*/
+ $$ = NEW_BLOCK_VAR($5, NEW_MASGN(0, $2));
}
- | f_block_optarg ',' f_arg opt_f_block_arg
+ | tSTAR ',' tAMPER lhs
{
- /*%%%*/
- $$ = new_args(0, $1, 0, $3, $4);
- /*%
- $$ = params_new(Qnil, $1, Qnil, $3, escape_Qundef($4));
- %*/
+ $$ = NEW_BLOCK_VAR($4, NEW_MASGN(0, -1));
}
- | f_rest_arg opt_f_block_arg
+ | tSTAR lhs
{
- /*%%%*/
- $$ = new_args(0, 0, $1, 0, $2);
- /*%
- $$ = params_new(Qnil, Qnil, $1, Qnil, escape_Qundef($2));
- %*/
+ $$ = NEW_MASGN(0, $2);
}
- | f_rest_arg ',' f_arg opt_f_block_arg
+ | tSTAR
{
- /*%%%*/
- $$ = new_args(0, 0, $1, $3, $4);
- /*%
- $$ = params_new(Qnil, Qnil, $1, $3, escape_Qundef($4));
- %*/
+ $$ = NEW_MASGN(0, -1);
}
- | f_block_arg
+ | tAMPER lhs
{
- /*%%%*/
- $$ = new_args(0, 0, 0, 0, $1);
- /*%
- $$ = params_new(Qnil, Qnil, Qnil, Qnil, $1);
- %*/
+ $$ = NEW_BLOCK_VAR($2, (NODE*)1);
}
;
-opt_block_param : none
- | block_param_def
+opt_block_var : none
+ | '|' /* none */ '|'
{
+ $$ = (NODE*)1;
command_start = Qtrue;
}
- ;
-
-block_param_def : '|' opt_bv_decl '|'
- {
- /*%%%*/
- $$ = 0;
- /*%
- $$ = blockvar_new(params_new(Qnil,Qnil,Qnil,Qnil,Qnil),
- escape_Qundef($2));
- %*/
- }
| tOROP
{
- /*%%%*/
- $$ = 0;
- /*%
- $$ = blockvar_new(params_new(Qnil,Qnil,Qnil,Qnil,Qnil),
- Qnil);
- %*/
- }
- | '|' block_param opt_bv_decl '|'
- {
- /*%%%*/
- $$ = $2;
- /*%
- $$ = blockvar_new(escape_Qundef($2), escape_Qundef($3));
- %*/
- }
- ;
-
-
-opt_bv_decl : none
- | ';' bv_decls
- {
- /*%%%*/
- $$ = 0;
- /*%
- $$ = $2;
- %*/
- }
- ;
-
-bv_decls : bvar
- /*%c%*/
- /*%c
- {
- $$ = rb_ary_new2($1);
- }
- %*/
- | bv_decls ',' bvar
- /*%c%*/
- /*%c
- {
- rb_ary_push($$, $3);
- }
- %*/
- ;
-
-bvar : tIDENTIFIER
- {
- /*%%%*/
- new_bv($1);
- /*%
- $$ = $1;
- %*/
- }
- | f_bad_arg
- {
- $$ = 0;
- }
- ;
-
-lambda : {
- /*%%%*/
- dyna_push();
- /*%
- %*/
- $<num>$ = lpar_beg;
- lpar_beg = ++paren_nest;
- }
- f_larglist
- lambda_body
- {
- lpar_beg = $<num>1;
- /*%%%*/
- $$ = $2;
- $$->nd_body = NEW_SCOPE($2->nd_head, $3);
- dyna_pop();
- /*%
- $$ = dispatch2(lambda, $2, $3);
- %*/
- }
- ;
-
-f_larglist : '(' f_args opt_bv_decl rparen
- {
- /*%%%*/
- $$ = NEW_LAMBDA($2);
- /*%
- $$ = dispatch1(paren, $2);
- %*/
- }
- | f_args
- {
- /*%%%*/
- $$ = NEW_LAMBDA($1);
- /*%
- $$ = $1;
- %*/
- }
- ;
-
-lambda_body : tLAMBEG compstmt '}'
- {
- $$ = $2;
+ $$ = (NODE*)1;
+ command_start = Qtrue;
}
- | keyword_do_LAMBDA compstmt keyword_end
+ | '|' block_var '|'
{
$$ = $2;
+ command_start = Qtrue;
}
;
-do_block : keyword_do_block
+do_block : kDO_BLOCK
{
- /*%%%*/
- dyna_push();
- $<num>$ = ruby_sourceline;
- /*% %*/
+ $<vars>$ = dyna_push();
+ $<num>1 = ruby_sourceline;
}
- opt_block_param
+ opt_block_var {$<vars>$ = ruby_dyna_vars;}
compstmt
- keyword_end
+ kEND
{
- /*%%%*/
- $$ = NEW_ITER($3,$4);
- nd_set_line($$, $<num>2);
- dyna_pop();
- /*%
- $$ = dispatch2(do_block, escape_Qundef($3), $4);
- %*/
+ $$ = NEW_ITER($3, 0, dyna_init($5, $<vars>4));
+ nd_set_line($$, $<num>1);
+ dyna_pop($<vars>2);
}
;
block_call : command do_block
{
- /*%%%*/
- if (nd_type($1) == NODE_YIELD) {
- compile_error(PARSER_ARG "block given to yield");
- }
- else {
- block_dup_check($1->nd_args, $2);
+ if ($1 && nd_type($1) == NODE_BLOCK_PASS) {
+ rb_compile_error("both block arg and actual block given");
}
$2->nd_iter = $1;
$$ = $2;
- fixpos($$, $1);
- /*%
- $$ = method_add_block($1, $2);
- %*/
+ fixpos($$, $1);
}
| block_call '.' operation2 opt_paren_args
{
- /*%%%*/
- $$ = NEW_CALL($1, $3, $4);
- /*%
- $$ = dispatch3(call, $1, ripper_id2sym('.'), $3);
- $$ = method_optarg($$, $4);
- %*/
+ $$ = new_call($1, $3, $4);
}
| block_call tCOLON2 operation2 opt_paren_args
{
- /*%%%*/
- $$ = NEW_CALL($1, $3, $4);
- /*%
- $$ = dispatch3(call, $1, ripper_intern("::"), $3);
- $$ = method_optarg($$, $4);
- %*/
+ $$ = new_call($1, $3, $4);
}
;
method_call : operation paren_args
{
- /*%%%*/
- $$ = NEW_FCALL($1, $2);
- fixpos($$, $2);
- /*%
- $$ = method_arg(dispatch1(fcall, $1), $2);
- %*/
+ $$ = new_fcall($1, $2);
+ fixpos($$, $2);
}
| primary_value '.' operation2 opt_paren_args
{
- /*%%%*/
- $$ = NEW_CALL($1, $3, $4);
- fixpos($$, $1);
- /*%
- $$ = dispatch3(call, $1, ripper_id2sym('.'), $3);
- $$ = method_optarg($$, $4);
- %*/
+ $$ = new_call($1, $3, $4);
+ fixpos($$, $1);
}
| primary_value tCOLON2 operation2 paren_args
{
- /*%%%*/
- $$ = NEW_CALL($1, $3, $4);
- fixpos($$, $1);
- /*%
- $$ = dispatch3(call, $1, ripper_id2sym('.'), $3);
- $$ = method_optarg($$, $4);
- %*/
+ $$ = new_call($1, $3, $4);
+ fixpos($$, $1);
}
| primary_value tCOLON2 operation3
{
- /*%%%*/
- $$ = NEW_CALL($1, $3, 0);
- /*%
- $$ = dispatch3(call, $1, ripper_intern("::"), $3);
- %*/
- }
- | primary_value '.' paren_args
- {
- /*%%%*/
- $$ = NEW_CALL($1, rb_intern("call"), $3);
- fixpos($$, $1);
- /*%
- $$ = dispatch3(call, dispatch1(paren, $1),
- ripper_id2sym('.'), rb_intern("call"));
- $$ = method_optarg($$, $3);
- %*/
+ $$ = new_call($1, $3, 0);
}
- | primary_value tCOLON2 paren_args
+ | kSUPER paren_args
{
- /*%%%*/
- $$ = NEW_CALL($1, rb_intern("call"), $3);
- fixpos($$, $1);
- /*%
- $$ = dispatch3(call, dispatch1(paren, $1),
- ripper_id2sym('.'), rb_intern("call"));
- $$ = method_optarg($$, $3);
- %*/
+ $$ = new_super($2);
}
- | keyword_super paren_args
+ | kSUPER
{
- /*%%%*/
- $$ = NEW_SUPER($2);
- /*%
- $$ = dispatch1(super, $2);
- %*/
- }
- | keyword_super
- {
- /*%%%*/
$$ = NEW_ZSUPER();
- /*%
- $$ = dispatch0(zsuper);
- %*/
- }
- | primary_value '[' opt_call_args rbracket
- {
- /*%%%*/
- if ($1 && nd_type($1) == NODE_SELF)
- $$ = NEW_FCALL(tAREF, $3);
- else
- $$ = NEW_CALL($1, tAREF, $3);
- fixpos($$, $1);
- /*%
- $$ = dispatch2(aref, $1, escape_Qundef($3));
- %*/
}
;
brace_block : '{'
{
- /*%%%*/
- dyna_push();
- $<num>$ = ruby_sourceline;
- /*%
- %*/
+ $<vars>$ = dyna_push();
+ $<num>1 = ruby_sourceline;
}
- opt_block_param
+ opt_block_var {$<vars>$ = ruby_dyna_vars;}
compstmt '}'
{
- /*%%%*/
- $$ = NEW_ITER($3,$4);
- nd_set_line($$, $<num>2);
- nd_set_line($$->nd_body, $<num>2);
- nd_set_line($$->nd_body->nd_body, $<num>2);
- dyna_pop();
- /*%
- $$ = dispatch2(brace_block, escape_Qundef($3), $4);
- %*/
- }
- | keyword_do
- {
- /*%%%*/
- dyna_push();
- $<num>$ = ruby_sourceline;
- /*%
- %*/
- }
- opt_block_param
- compstmt keyword_end
- {
- /*%%%*/
- $$ = NEW_ITER($3,$4);
- nd_set_line($$, $<num>2);
- dyna_pop();
- /*%
- $$ = dispatch2(do_block, escape_Qundef($3), $4);
- %*/
+ $$ = NEW_ITER($3, 0, dyna_init($5, $<vars>4));
+ nd_set_line($$, $<num>1);
+ dyna_pop($<vars>2);
+ }
+ | kDO
+ {
+ $<vars>$ = dyna_push();
+ $<num>1 = ruby_sourceline;
+ }
+ opt_block_var {$<vars>$ = ruby_dyna_vars;}
+ compstmt kEND
+ {
+ $$ = NEW_ITER($3, 0, dyna_init($5, $<vars>4));
+ nd_set_line($$, $<num>1);
+ dyna_pop($<vars>2);
}
;
-case_body : keyword_when args then
+case_body : kWHEN when_args then
compstmt
cases
{
- /*%%%*/
$$ = NEW_WHEN($2, $4, $5);
- /*%
- $$ = dispatch3(when, $2, $4, escape_Qundef($5));
- %*/
+ }
+ ;
+when_args : args
+ | args ',' tSTAR arg_value
+ {
+ $$ = list_append($1, NEW_WHEN($4, 0, 0));
+ }
+ | tSTAR arg_value
+ {
+ $$ = NEW_LIST(NEW_WHEN($2, 0, 0));
}
;
@@ -3680,44 +1958,25 @@ cases : opt_else
| case_body
;
-opt_rescue : keyword_rescue exc_list exc_var then
+opt_rescue : kRESCUE exc_list exc_var then
compstmt
opt_rescue
{
- /*%%%*/
- if ($3) {
- $3 = node_assign($3, NEW_ERRINFO());
+ if ($3) {
+ $3 = node_assign($3, NEW_GVAR(rb_intern("$!")));
$5 = block_append($3, $5);
}
$$ = NEW_RESBODY($2, $5, $6);
- fixpos($$, $2?$2:$5);
- /*%
- $$ = dispatch4(rescue,
- escape_Qundef($2),
- escape_Qundef($3),
- escape_Qundef($5),
- escape_Qundef($6));
- %*/
+ fixpos($$, $2?$2:$5);
}
| none
;
exc_list : arg_value
{
- /*%%%*/
$$ = NEW_LIST($1);
- /*%
- $$ = rb_ary_new3(1, $1);
- %*/
}
| mrhs
- {
- /*%%%*/
- if (!($$ = splat_array($1))) $$ = $1;
- /*%
- $$ = $1;
- %*/
- }
| none
;
@@ -3728,13 +1987,13 @@ exc_var : tASSOC lhs
| none
;
-opt_ensure : keyword_ensure compstmt
+opt_ensure : kENSURE compstmt
{
- /*%%%*/
- $$ = $2;
- /*%
- $$ = dispatch1(ensure, $2);
- %*/
+ if ($2)
+ $$ = $2;
+ else
+ /* place holder */
+ $$ = NEW_NIL();
}
| none
;
@@ -3742,60 +2001,42 @@ opt_ensure : keyword_ensure compstmt
literal : numeric
| symbol
{
- /*%%%*/
$$ = NEW_LIT(ID2SYM($1));
- /*%
- $$ = dispatch1(symbol_literal, $1);
- %*/
}
| dsym
;
strings : string
{
- /*%%%*/
NODE *node = $1;
if (!node) {
- node = NEW_STR(STR_NEW0());
+ node = NEW_STR(rb_str_new(0, 0));
}
else {
node = evstr2dstr(node);
}
$$ = node;
- /*%
- $$ = $1;
- %*/
}
;
-string : tCHAR
- | string1
+string : string1
| string string1
{
- /*%%%*/
$$ = literal_concat($1, $2);
- /*%
- $$ = dispatch2(string_concat, $1, $2);
- %*/
}
;
string1 : tSTRING_BEG string_contents tSTRING_END
{
- /*%%%*/
$$ = $2;
- /*%
- $$ = dispatch1(string_literal, $2);
- %*/
}
;
xstring : tXSTRING_BEG xstring_contents tSTRING_END
{
- /*%%%*/
NODE *node = $2;
if (!node) {
- node = NEW_XSTR(STR_NEW0());
+ node = NEW_XSTR(rb_str_new(0, 0));
}
else {
switch (nd_type(node)) {
@@ -3806,36 +2047,33 @@ xstring : tXSTRING_BEG xstring_contents tSTRING_END
nd_set_type(node, NODE_DXSTR);
break;
default:
- node = NEW_NODE(NODE_DXSTR, STR_NEW0(), 1, NEW_LIST(node));
+ node = NEW_NODE(NODE_DXSTR, rb_str_new(0, 0), 1, NEW_LIST(node));
break;
}
}
$$ = node;
- /*%
- $$ = dispatch1(xstring_literal, $2);
- %*/
}
;
regexp : tREGEXP_BEG xstring_contents tREGEXP_END
{
- /*%%%*/
int options = $3;
NODE *node = $2;
- NODE *list;
if (!node) {
- node = NEW_LIT(reg_compile(STR_NEW0(), options));
+ node = NEW_LIT(rb_reg_new("", 0, options & ~RE_OPTION_ONCE));
}
else switch (nd_type(node)) {
case NODE_STR:
{
VALUE src = node->nd_lit;
nd_set_type(node, NODE_LIT);
- node->nd_lit = reg_compile(src, options);
+ node->nd_lit = rb_reg_new(RSTRING(src)->ptr,
+ RSTRING(src)->len,
+ options & ~RE_OPTION_ONCE);
}
break;
default:
- node = NEW_NODE(NODE_DSTR, STR_NEW0(), 1, NEW_LIST(node));
+ node = NEW_NODE(NODE_DSTR, rb_str_new(0, 0), 1, NEW_LIST(node));
case NODE_DSTR:
if (options & RE_OPTION_ONCE) {
nd_set_type(node, NODE_DREGX_ONCE);
@@ -3843,29 +2081,16 @@ regexp : tREGEXP_BEG xstring_contents tREGEXP_END
else {
nd_set_type(node, NODE_DREGX);
}
- node->nd_cflag = options & RE_OPTION_MASK;
- reg_fragment_check(node->nd_lit, options);
- for (list = node->nd_next; list; list = list->nd_next) {
- if (nd_type(list->nd_head) == NODE_STR) {
- reg_fragment_check(list->nd_head->nd_lit, options);
- }
- }
+ node->nd_cflag = options & ~RE_OPTION_ONCE;
break;
}
$$ = node;
- /*%
- $$ = dispatch2(regexp_literal, $2, $3);
- %*/
}
;
words : tWORDS_BEG ' ' tSTRING_END
{
- /*%%%*/
$$ = NEW_ZARRAY();
- /*%
- $$ = dispatch0(words_new);
- %*/
}
| tWORDS_BEG word_list tSTRING_END
{
@@ -3875,47 +2100,24 @@ words : tWORDS_BEG ' ' tSTRING_END
word_list : /* none */
{
- /*%%%*/
$$ = 0;
- /*%
- $$ = dispatch0(words_new);
- %*/
}
| word_list word ' '
{
- /*%%%*/
$$ = list_append($1, evstr2dstr($2));
- /*%
- $$ = dispatch2(words_add, $1, $2);
- %*/
}
;
word : string_content
- /*%c%*/
- /*%c
- {
- $$ = dispatch0(word_new);
- $$ = dispatch2(word_add, $$, $1);
- }
- %*/
| word string_content
{
- /*%%%*/
$$ = literal_concat($1, $2);
- /*%
- $$ = dispatch2(word_add, $1, $2);
- %*/
}
;
qwords : tQWORDS_BEG ' ' tSTRING_END
{
- /*%%%*/
$$ = NEW_ZARRAY();
- /*%
- $$ = dispatch0(qwords_new);
- %*/
}
| tQWORDS_BEG qword_list tSTRING_END
{
@@ -3925,55 +2127,31 @@ qwords : tQWORDS_BEG ' ' tSTRING_END
qword_list : /* none */
{
- /*%%%*/
$$ = 0;
- /*%
- $$ = dispatch0(qwords_new);
- %*/
}
| qword_list tSTRING_CONTENT ' '
{
- /*%%%*/
$$ = list_append($1, $2);
- /*%
- $$ = dispatch2(qwords_add, $1, $2);
- %*/
}
;
string_contents : /* none */
{
- /*%%%*/
$$ = 0;
- /*%
- $$ = dispatch0(string_content);
- %*/
}
| string_contents string_content
{
- /*%%%*/
$$ = literal_concat($1, $2);
- /*%
- $$ = dispatch2(string_add, $1, $2);
- %*/
}
;
xstring_contents: /* none */
{
- /*%%%*/
$$ = 0;
- /*%
- $$ = dispatch0(xstring_new);
- %*/
}
| xstring_contents string_content
{
- /*%%%*/
$$ = literal_concat($1, $2);
- /*%
- $$ = dispatch2(xstring_add, $1, $2);
- %*/
}
;
@@ -3986,13 +2164,8 @@ string_content : tSTRING_CONTENT
}
string_dvar
{
- /*%%%*/
- lex_strterm = $<node>2;
- $$ = NEW_EVSTR($3);
- /*%
lex_strterm = $<node>2;
- $$ = dispatch1(string_dvar, $3);
- %*/
+ $$ = NEW_EVSTR($3);
}
| tSTRING_DBEG
{
@@ -4007,51 +2180,24 @@ string_content : tSTRING_CONTENT
lex_strterm = $<node>2;
COND_LEXPOP();
CMDARG_LEXPOP();
- /*%%%*/
- if ($3) $3->flags &= ~NODE_FL_NEWLINE;
- $$ = new_evstr($3);
- /*%
- $$ = dispatch1(string_embexpr, $3);
- %*/
+ if (($$ = $3) && nd_type($$) == NODE_NEWLINE) {
+ $$ = $$->nd_next;
+ rb_gc_force_recycle((VALUE)$3);
+ }
+ $$ = new_evstr($$);
}
;
-string_dvar : tGVAR
- {
- /*%%%*/
- $$ = NEW_GVAR($1);
- /*%
- $$ = dispatch1(var_ref, $1);
- %*/
- }
- | tIVAR
- {
- /*%%%*/
- $$ = NEW_IVAR($1);
- /*%
- $$ = dispatch1(var_ref, $1);
- %*/
- }
- | tCVAR
- {
- /*%%%*/
- $$ = NEW_CVAR($1);
- /*%
- $$ = dispatch1(var_ref, $1);
- %*/
- }
+string_dvar : tGVAR {$$ = NEW_GVAR($1);}
+ | tIVAR {$$ = NEW_IVAR($1);}
+ | tCVAR {$$ = NEW_CVAR($1);}
| backref
;
symbol : tSYMBEG sym
{
- /*%%%*/
- lex_state = EXPR_END;
+ lex_state = EXPR_END;
$$ = $2;
- /*%
- lex_state = EXPR_END;
- $$ = dispatch1(symbol, $2);
- %*/
}
;
@@ -4063,10 +2209,10 @@ sym : fname
dsym : tSYMBEG xstring_contents tSTRING_END
{
- /*%%%*/
- lex_state = EXPR_END;
+ lex_state = EXPR_END;
if (!($$ = $2)) {
- $$ = NEW_LIT(ID2SYM(rb_intern("")));
+ $$ = NEW_NIL();
+ yyerror("empty symbol literal");
}
else {
VALUE lit;
@@ -4077,38 +2223,33 @@ dsym : tSYMBEG xstring_contents tSTRING_END
break;
case NODE_STR:
lit = $$->nd_lit;
- $$->nd_lit = ID2SYM(rb_intern_str(lit));
- nd_set_type($$, NODE_LIT);
- break;
+ if (RSTRING(lit)->len == 0) {
+ yyerror("empty symbol literal");
+ break;
+ }
+ if (strlen(RSTRING(lit)->ptr) == RSTRING(lit)->len) {
+ $$->nd_lit = ID2SYM(rb_intern(RSTRING($$->nd_lit)->ptr));
+ nd_set_type($$, NODE_LIT);
+ break;
+ }
+ /* fall through */
default:
- $$ = NEW_NODE(NODE_DSYM, STR_NEW0(), 1, NEW_LIST($$));
+ $$ = NEW_NODE(NODE_DSYM, rb_str_new(0, 0), 1, NEW_LIST($$));
break;
}
}
- /*%
- lex_state = EXPR_END;
- $$ = dispatch1(dyna_symbol, $2);
- %*/
}
;
-numeric : tINTEGER
+numeric : tINTEGER
| tFLOAT
| tUMINUS_NUM tINTEGER %prec tLOWEST
{
- /*%%%*/
$$ = negate_lit($2);
- /*%
- $$ = dispatch2(unary, ripper_intern("-@"), $2);
- %*/
}
| tUMINUS_NUM tFLOAT %prec tLOWEST
{
- /*%%%*/
$$ = negate_lit($2);
- /*%
- $$ = dispatch2(unary, ripper_intern("-@"), $2);
- %*/
}
;
@@ -4117,32 +2258,23 @@ variable : tIDENTIFIER
| tGVAR
| tCONSTANT
| tCVAR
- | keyword_nil {ifndef_ripper($$ = keyword_nil);}
- | keyword_self {ifndef_ripper($$ = keyword_self);}
- | keyword_true {ifndef_ripper($$ = keyword_true);}
- | keyword_false {ifndef_ripper($$ = keyword_false);}
- | keyword__FILE__ {ifndef_ripper($$ = keyword__FILE__);}
- | keyword__LINE__ {ifndef_ripper($$ = keyword__LINE__);}
- | keyword__ENCODING__ {ifndef_ripper($$ = keyword__ENCODING__);}
+ | kNIL {$$ = kNIL;}
+ | kSELF {$$ = kSELF;}
+ | kTRUE {$$ = kTRUE;}
+ | kFALSE {$$ = kFALSE;}
+ | k__FILE__ {$$ = k__FILE__;}
+ | k__LINE__ {$$ = k__LINE__;}
;
var_ref : variable
{
- /*%%%*/
- if (!($$ = gettable($1))) $$ = NEW_BEGIN(0);
- /*%
- $$ = dispatch1(var_ref, $1);
- %*/
+ $$ = gettable($1);
}
;
var_lhs : variable
{
- /*%%%*/
$$ = assignable($1, 0);
- /*%
- $$ = dispatch1(var_field, $1);
- %*/
}
;
@@ -4152,11 +2284,7 @@ backref : tNTH_REF
superclass : term
{
- /*%%%*/
$$ = 0;
- /*%
- $$ = Qnil;
- %*/
}
| '<'
{
@@ -4166,29 +2294,14 @@ superclass : term
{
$$ = $3;
}
- | error term
- {
- /*%%%*/
- yyerrok;
- $$ = 0;
- /*%
- yyerrok;
- $$ = Qnil;
- %*/
- }
+ | error term {yyerrok; $$ = 0;}
;
-f_arglist : '(' f_args rparen
+f_arglist : '(' f_args opt_nl ')'
{
- /*%%%*/
$$ = $2;
lex_state = EXPR_BEG;
- command_start = Qtrue;
- /*%
- $$ = dispatch1(paren, $2);
- lex_state = EXPR_BEG;
- command_start = Qtrue;
- %*/
+ command_start = Qtrue;
}
| f_args term
{
@@ -4198,297 +2311,94 @@ f_arglist : '(' f_args rparen
f_args : f_arg ',' f_optarg ',' f_rest_arg opt_f_block_arg
{
- /*%%%*/
- $$ = new_args($1, $3, $5, 0, $6);
- /*%
- $$ = params_new($1, $3, $5, Qnil, escape_Qundef($6));
- %*/
- }
- | f_arg ',' f_optarg ',' f_rest_arg ',' f_arg opt_f_block_arg
- {
- /*%%%*/
- $$ = new_args($1, $3, $5, $7, $8);
- /*%
- $$ = params_new($1, $3, $5, $7, escape_Qundef($8));
- %*/
+ $$ = block_append(NEW_ARGS($1, $3, $5), $6);
}
| f_arg ',' f_optarg opt_f_block_arg
{
- /*%%%*/
- $$ = new_args($1, $3, 0, 0, $4);
- /*%
- $$ = params_new($1, $3, Qnil, Qnil, escape_Qundef($4));
- %*/
- }
- | f_arg ',' f_optarg ',' f_arg opt_f_block_arg
- {
- /*%%%*/
- $$ = new_args($1, $3, 0, $5, $6);
- /*%
- $$ = params_new($1, $3, Qnil, $5, escape_Qundef($6));
- %*/
+ $$ = block_append(NEW_ARGS($1, $3, 0), $4);
}
| f_arg ',' f_rest_arg opt_f_block_arg
{
- /*%%%*/
- $$ = new_args($1, 0, $3, 0, $4);
- /*%
- $$ = params_new($1, Qnil, $3, Qnil, escape_Qundef($4));
- %*/
- }
- | f_arg ',' f_rest_arg ',' f_arg opt_f_block_arg
- {
- /*%%%*/
- $$ = new_args($1, 0, $3, $5, $6);
- /*%
- $$ = params_new($1, Qnil, $3, $5, escape_Qundef($6));
- %*/
+ $$ = block_append(NEW_ARGS($1, 0, $3), $4);
}
| f_arg opt_f_block_arg
{
- /*%%%*/
- $$ = new_args($1, 0, 0, 0, $2);
- /*%
- $$ = params_new($1, Qnil, Qnil, Qnil,escape_Qundef($2));
- %*/
+ $$ = block_append(NEW_ARGS($1, 0, 0), $2);
}
| f_optarg ',' f_rest_arg opt_f_block_arg
{
- /*%%%*/
- $$ = new_args(0, $1, $3, 0, $4);
- /*%
- $$ = params_new(Qnil, $1, $3, Qnil, escape_Qundef($4));
- %*/
- }
- | f_optarg ',' f_rest_arg ',' f_arg opt_f_block_arg
- {
- /*%%%*/
- $$ = new_args(0, $1, $3, $5, $6);
- /*%
- $$ = params_new(Qnil, $1, $3, $5, escape_Qundef($6));
- %*/
+ $$ = block_append(NEW_ARGS(0, $1, $3), $4);
}
| f_optarg opt_f_block_arg
{
- /*%%%*/
- $$ = new_args(0, $1, 0, 0, $2);
- /*%
- $$ = params_new(Qnil, $1, Qnil, Qnil,escape_Qundef($2));
- %*/
- }
- | f_optarg ',' f_arg opt_f_block_arg
- {
- /*%%%*/
- $$ = new_args(0, $1, 0, $3, $4);
- /*%
- $$ = params_new(Qnil, $1, Qnil, $3, escape_Qundef($4));
- %*/
+ $$ = block_append(NEW_ARGS(0, $1, 0), $2);
}
| f_rest_arg opt_f_block_arg
{
- /*%%%*/
- $$ = new_args(0, 0, $1, 0, $2);
- /*%
- $$ = params_new(Qnil, Qnil, $1, Qnil,escape_Qundef($2));
- %*/
- }
- | f_rest_arg ',' f_arg opt_f_block_arg
- {
- /*%%%*/
- $$ = new_args(0, 0, $1, $3, $4);
- /*%
- $$ = params_new(Qnil, Qnil, $1, $3, escape_Qundef($4));
- %*/
+ $$ = block_append(NEW_ARGS(0, 0, $1), $2);
}
| f_block_arg
{
- /*%%%*/
- $$ = new_args(0, 0, 0, 0, $1);
- /*%
- $$ = params_new(Qnil, Qnil, Qnil, Qnil, $1);
- %*/
+ $$ = block_append(NEW_ARGS(0, 0, 0), $1);
}
| /* none */
{
- /*%%%*/
- $$ = new_args(0, 0, 0, 0, 0);
- /*%
- $$ = params_new(Qnil, Qnil, Qnil, Qnil, Qnil);
- %*/
+ $$ = NEW_ARGS(0, 0, 0);
}
;
-f_bad_arg : tCONSTANT
+f_norm_arg : tCONSTANT
{
- /*%%%*/
yyerror("formal argument cannot be a constant");
- $$ = 0;
- /*%
- $$ = dispatch1(param_error, $1);
- %*/
}
- | tIVAR
+ | tIVAR
{
- /*%%%*/
- yyerror("formal argument cannot be an instance variable");
- $$ = 0;
- /*%
- $$ = dispatch1(param_error, $1);
- %*/
+ yyerror("formal argument cannot be an instance variable");
}
- | tGVAR
+ | tGVAR
{
- /*%%%*/
- yyerror("formal argument cannot be a global variable");
- $$ = 0;
- /*%
- $$ = dispatch1(param_error, $1);
- %*/
+ yyerror("formal argument cannot be a global variable");
}
- | tCVAR
+ | tCVAR
{
- /*%%%*/
- yyerror("formal argument cannot be a class variable");
- $$ = 0;
- /*%
- $$ = dispatch1(param_error, $1);
- %*/
+ yyerror("formal argument cannot be a class variable");
}
- ;
-
-f_norm_arg : f_bad_arg
| tIDENTIFIER
{
- /*%%%*/
if (!is_local_id($1))
yyerror("formal argument must be local variable");
- shadowing_lvar($1);
- /*%
- %*/
- $$ = $1;
+ else if (local_id($1))
+ yyerror("duplicate argument name");
+ local_cnt($1);
+ $$ = 1;
}
;
-f_arg_item : f_norm_arg
+f_arg : f_norm_arg
+ | f_arg ',' f_norm_arg
{
- /*%%%*/
- arg_var($1);
- $$ = NEW_ARGS_AUX($1, 1);
- /*%
- %*/
- }
- | tLPAREN f_margs rparen
- {
- /*%%%*/
- ID tid = internal_id();
- arg_var(tid);
- if (dyna_in_block()) {
- $2->nd_value = NEW_DVAR(tid);
- }
- else {
- $2->nd_value = NEW_LVAR(tid);
- }
- $$ = NEW_ARGS_AUX(tid, 1);
- $$->nd_next = $2;
- /*%
- $$ = dispatch1(mlhs_paren, $2);
- %*/
- }
- ;
-
-f_arg : f_arg_item
- /*%c%*/
- /*%c
- {
- $$ = rb_ary_new3(1, $1);
- }
- c%*/
- | f_arg ',' f_arg_item
- {
- /*%%%*/
- $$ = $1;
- $$->nd_plen++;
- $$->nd_next = block_append($$->nd_next, $3->nd_next);
- rb_gc_force_recycle((VALUE)$3);
- /*%
- $$ = rb_ary_push($1, $3);
- %*/
+ $$ += 1;
}
;
f_opt : tIDENTIFIER '=' arg_value
{
- /*%%%*/
if (!is_local_id($1))
yyerror("formal argument must be local variable");
- shadowing_lvar($1);
- arg_var($1);
- $$ = NEW_OPT_ARG(0, assignable($1, $3));
- /*%
- $$ = rb_assoc_new($1, $3);
- %*/
- }
- ;
-
-f_block_opt : tIDENTIFIER '=' primary_value
- {
- /*%%%*/
- if (!is_local_id($1))
- yyerror("formal argument must be local variable");
- shadowing_lvar($1);
- arg_var($1);
- $$ = NEW_OPT_ARG(0, assignable($1, $3));
- /*%
- $$ = rb_assoc_new($1, $3);
- %*/
- }
- ;
-
-f_block_optarg : f_block_opt
- {
- /*%%%*/
- $$ = $1;
- /*%
- $$ = rb_ary_new3(1, $1);
- %*/
- }
- | f_block_optarg ',' f_block_opt
- {
- /*%%%*/
- NODE *opts = $1;
-
- while (opts->nd_next) {
- opts = opts->nd_next;
- }
- opts->nd_next = $3;
- $$ = $1;
- /*%
- $$ = rb_ary_push($1, $3);
- %*/
+ else if (local_id($1))
+ yyerror("duplicate optional argument name");
+ $$ = assignable($1, $3);
}
;
f_optarg : f_opt
{
- /*%%%*/
- $$ = $1;
- /*%
- $$ = rb_ary_new3(1, $1);
- %*/
+ $$ = NEW_BLOCK($1);
+ $$->nd_end = $$;
}
| f_optarg ',' f_opt
{
- /*%%%*/
- NODE *opts = $1;
-
- while (opts->nd_next) {
- opts = opts->nd_next;
- }
- opts->nd_next = $3;
- $$ = $1;
- /*%
- $$ = rb_ary_push($1, $3);
- %*/
+ $$ = block_append($1, $3);
}
;
@@ -4498,24 +2408,23 @@ restarg_mark : '*'
f_rest_arg : restarg_mark tIDENTIFIER
{
- /*%%%*/
if (!is_local_id($2))
yyerror("rest argument must be local variable");
- shadowing_lvar($2);
- arg_var($2);
- $$ = $2;
- /*%
- $$ = dispatch1(rest_param, $2);
- %*/
+ else if (local_id($2))
+ yyerror("duplicate rest argument name");
+ if (dyna_in_block()) {
+ rb_dvar_push($2, Qnil);
+ }
+ $$ = assignable($2, 0);
}
| restarg_mark
{
- /*%%%*/
- $$ = internal_id();
- arg_var($$);
- /*%
- $$ = dispatch1(rest_param, Qnil);
- %*/
+ if (dyna_in_block()) {
+ $$ = NEW_DASGN_CURR(internal_id(), 0);
+ }
+ else {
+ $$ = NEW_NODE(NODE_LASGN,0,0,local_append(0));
+ }
}
;
@@ -4525,17 +2434,11 @@ blkarg_mark : '&'
f_block_arg : blkarg_mark tIDENTIFIER
{
- /*%%%*/
if (!is_local_id($2))
yyerror("block argument must be local variable");
- else if (!dyna_in_block() && local_id($2))
- yyerror("duplicated block argument name");
- shadowing_lvar($2);
- arg_var($2);
- $$ = $2;
- /*%
- $$ = dispatch1(blockarg, $2);
- %*/
+ else if (local_id($2))
+ yyerror("duplicate block argument name");
+ $$ = NEW_BLOCK_ARG($2);
}
;
@@ -4544,28 +2447,15 @@ opt_f_block_arg : ',' f_block_arg
$$ = $2;
}
| none
- {
- /*%%%*/
- $$ = 0;
- /*%
- $$ = Qundef;
- %*/
- }
;
singleton : var_ref
{
- /*%%%*/
- value_expr($1);
- $$ = $1;
- if (!$$) $$ = NEW_NIL();
- /*%
$$ = $1;
- %*/
+ value_expr($$);
}
- | '(' {lex_state = EXPR_BEG;} expr rparen
+ | '(' {lex_state = EXPR_BEG;} expr opt_nl ')'
{
- /*%%%*/
if ($3 == 0) {
yyerror("can't define singleton method for ().");
}
@@ -4586,55 +2476,33 @@ singleton : var_ref
}
}
$$ = $3;
- /*%
- $$ = dispatch1(paren, $3);
- %*/
}
;
assoc_list : none
| assocs trailer
{
- /*%%%*/
$$ = $1;
- /*%
- $$ = dispatch1(assoclist_from_args, $1);
- %*/
+ }
+ | args trailer
+ {
+ if ($1->nd_alen%2 != 0) {
+ yyerror("odd number list for Hash");
+ }
+ $$ = $1;
}
;
assocs : assoc
- /*%c%*/
- /*%c
- {
- $$ = rb_ary_new3(1, $1);
- }
- %*/
| assocs ',' assoc
{
- /*%%%*/
$$ = list_concat($1, $3);
- /*%
- $$ = rb_ary_push($1, $3);
- %*/
}
;
assoc : arg_value tASSOC arg_value
{
- /*%%%*/
$$ = list_append(NEW_LIST($1), $3);
- /*%
- $$ = dispatch2(assoc_new, $1, $3);
- %*/
- }
- | tLABEL arg_value
- {
- /*%%%*/
- $$ = list_append(NEW_LIST(NEW_LIT(ID2SYM($1))), $2);
- /*%
- $$ = dispatch2(assoc_new, $1, $2);
- %*/
}
;
@@ -4655,15 +2523,7 @@ operation3 : tIDENTIFIER
;
dot_or_colon : '.'
- /*%c%*/
- /*%c
- { $$ = $<val>1; }
- %*/
| tCOLON2
- /*%c%*/
- /*%c
- { $$ = $<val>1; }
- %*/
;
opt_terms : /* none */
@@ -4674,12 +2534,6 @@ opt_nl : /* none */
| '\n'
;
-rparen : opt_nl ')'
- ;
-
-rbracket : opt_nl ']'
- ;
-
trailer : /* none */
| '\n'
| ','
@@ -4693,99 +2547,15 @@ terms : term
| terms ';' {yyerrok;}
;
-none : /* none */
- {
- /*%%%*/
- $$ = 0;
- /*%
- $$ = Qundef;
- %*/
- }
+none : /* none */ {$$ = 0;}
;
%%
-# undef parser
-# undef yylex
-# undef yylval
-# define yylval (*((YYSTYPE*)(parser->parser_yylval)))
-
-static int parser_regx_options(struct parser_params*);
-static int parser_tokadd_string(struct parser_params*,int,int,int,long*,rb_encoding**);
-static void parser_tokaddmbc(struct parser_params *parser, int c, rb_encoding *enc);
-static int parser_parse_string(struct parser_params*,NODE*);
-static int parser_here_document(struct parser_params*,NODE*);
-
-
-# define nextc() parser_nextc(parser)
-# define pushback(c) parser_pushback(parser, c)
-# define newtok() parser_newtok(parser)
-# define tokspace(n) parser_tokspace(parser, n)
-# define tokadd(c) parser_tokadd(parser, c)
-# define tok_hex(numlen) parser_tok_hex(parser, numlen)
-# define read_escape(flags,e) parser_read_escape(parser, flags, e)
-# define tokadd_escape(e) parser_tokadd_escape(parser, e)
-# define regx_options() parser_regx_options(parser)
-# define tokadd_string(f,t,p,n,e) parser_tokadd_string(parser,f,t,p,n,e)
-# define parse_string(n) parser_parse_string(parser,n)
-# define tokaddmbc(c, enc) parser_tokaddmbc(parser, c, enc)
-# define here_document(n) parser_here_document(parser,n)
-# define heredoc_identifier() parser_heredoc_identifier(parser)
-# define heredoc_restore(n) parser_heredoc_restore(parser,n)
-# define whole_match_p(e,l,i) parser_whole_match_p(parser,e,l,i)
-
-#ifdef RIPPER
-/* FIXME */
-# define local_id(x) 1
-# define dyna_in_block() 1
-#endif /* RIPPER */
-
-#ifndef RIPPER
-# define set_yylval_str(x) yylval.node = NEW_STR(x)
-# define set_yylval_num(x) yylval.num = x
-# define set_yylval_id(x) yylval.id = x
-# define set_yylval_literal(x) yylval.node = NEW_LIT(x)
-# define set_yylval_node(x) yylval.node = x
-# define yylval_id() yylval.id
-#else
-# define set_yylval_str(x) (void)(x)
-# define set_yylval_num(x) (void)(x)
-# define set_yylval_id(x) (void)(x)
-# define set_yylval_literal(x) (void)(x)
-# define set_yylval_node(x) (void)(x)
-# define yylval_id() SYM2ID(yylval.val)
+#ifdef yystacksize
+#undef YYMALLOC
#endif
-#ifdef RIPPER
-#define ripper_flush(p) (p->tokp = p->parser_lex_p)
-
-static void
-ripper_dispatch_scan_event(struct parser_params *parser, int t)
-{
- VALUE str;
-
- if (lex_p < parser->tokp) rb_raise(rb_eRuntimeError, "lex_p < tokp");
- if (lex_p == parser->tokp) return;
- str = STR_NEW(parser->tokp, lex_p - parser->tokp);
- yylval.val = ripper_dispatch1(parser, ripper_token2eventid(t), str);
- ripper_flush(parser);
-}
-
-static void
-ripper_dispatch_delayed_token(struct parser_params *parser, int t)
-{
- int saved_line = ruby_sourceline;
- const char *saved_tokp = parser->tokp;
-
- ruby_sourceline = parser->delayed_line;
- parser->tokp = lex_pbeg + parser->delayed_col;
- yylval.val = ripper_dispatch1(parser, ripper_token2eventid(t), parser->delayed);
- parser->delayed = Qnil;
- ruby_sourceline = saved_line;
- parser->tokp = saved_tokp;
-}
-#endif /* RIPPER */
-
-#include "ruby/regex.h"
-#include "ruby/util.h"
+#include "regex.h"
+#include "util.h"
/* We remove any previous definition of `SIGN_EXTEND_CHAR',
since ours (we hope) works properly with all combinations of
@@ -4798,96 +2568,30 @@ ripper_dispatch_delayed_token(struct parser_params *parser, int t)
/* As in Harbison and Steele. */
# define SIGN_EXTEND_CHAR(c) ((((unsigned char)(c)) ^ 128) - 128)
#endif
+#define is_identchar(c) (SIGN_EXTEND_CHAR(c)!=-1&&(ISALNUM(c) || (c) == '_' || ismbchar(c)))
-#define parser_encoding_name() (parser->enc->name)
-#define parser_mbclen() mbclen((lex_p-1),lex_pend,parser->enc)
-#define parser_precise_mbclen() rb_enc_precise_mbclen((lex_p-1),lex_pend,parser->enc)
-#define is_identchar(p,e,enc) (rb_enc_isalnum(*p,enc) || (*p) == '_' || !ISASCII(*p))
-#define parser_is_identchar() (!parser->eofp && is_identchar((lex_p-1),lex_pend,parser->enc))
-
-#define parser_isascii() ISASCII(*(lex_p-1))
-
-#ifndef RIPPER
-static int
-token_info_get_column(struct parser_params *parser, const char *token)
-{
- int column = 1;
- const char *p, *pend = lex_p - strlen(token);
- for (p = lex_pbeg; p < pend; p++) {
- if (*p == '\t') {
- column = (((column - 1) / 8) + 1) * 8;
- }
- column++;
- }
- return column;
-}
+static char *tokenbuf = NULL;
+static int tokidx, toksiz = 0;
-static int
-token_info_has_nonspaces(struct parser_params *parser, const char *token)
-{
- const char *p, *pend = lex_p - strlen(token);
- for (p = lex_pbeg; p < pend; p++) {
- if (*p != ' ' && *p != '\t') {
- return 1;
- }
- }
- return 0;
-}
+#define LEAVE_BS 1
-static void
-token_info_push(struct parser_params *parser, const char *token)
-{
- token_info *ptinfo;
-
- if (compile_for_eval) return;
- ptinfo = ALLOC(token_info);
- ptinfo->token = token;
- ptinfo->linenum = ruby_sourceline;
- ptinfo->column = token_info_get_column(parser, token);
- ptinfo->nonspc = token_info_has_nonspaces(parser, token);
- ptinfo->next = parser->parser_token_info;
-
- parser->parser_token_info = ptinfo;
-}
-
-static void
-token_info_pop(struct parser_params *parser, const char *token)
-{
- int linenum;
- token_info *ptinfo = parser->parser_token_info;
-
- if (!ptinfo) return;
- parser->parser_token_info = ptinfo->next;
- if (token_info_get_column(parser, token) == ptinfo->column) { /* OK */
- goto finish;
- }
- linenum = ruby_sourceline;
- if (linenum == ptinfo->linenum) { /* SKIP */
- goto finish;
- }
- if (token_info_has_nonspaces(parser, token) || ptinfo->nonspc) { /* SKIP */
- goto finish;
- }
- rb_compile_warning(ruby_sourcefile, linenum,
- "mismatched indentations at '%s' with '%s' at %d",
- token, ptinfo->token, ptinfo->linenum);
-
- finish:
- xfree(ptinfo);
-}
-#endif /* RIPPER */
+static VALUE (*lex_gets)(); /* gets function */
+static VALUE lex_input; /* non-nil if File */
+static VALUE lex_lastline; /* gc protect */
+static char *lex_pbeg;
+static char *lex_p;
+static char *lex_pend;
static int
-parser_yyerror(struct parser_params *parser, const char *msg)
+yyerror(msg)
+ const char *msg;
{
-#ifndef RIPPER
const int max_line_margin = 30;
const char *p, *pe;
char *buf;
- long len;
- int i;
+ int len, i;
- compile_error(PARSER_ARG "%s", msg);
+ rb_compile_error("%s", msg);
p = lex_p;
while (lex_pbeg <= p) {
if (*p == '\n') break;
@@ -4907,12 +2611,13 @@ parser_yyerror(struct parser_params *parser, const char *msg)
const char *pre = "", *post = "";
if (len > max_line_margin * 2 + 10) {
- if (lex_p - p > max_line_margin) {
- p = rb_enc_prev_char(p, lex_p - max_line_margin, pe, rb_enc_get(lex_lastline));
+ int re_mbc_startpos _((const char *, int, int, int));
+ if ((len = lex_p - p) > max_line_margin) {
+ p = p + re_mbc_startpos(p, len, len - max_line_margin, 0);
pre = "...";
}
- if (pe - lex_p > max_line_margin) {
- pe = rb_enc_prev_char(lex_p, lex_p + max_line_margin, pe, rb_enc_get(lex_lastline));
+ if ((len = pe - lex_p) > max_line_margin) {
+ pe = lex_p + re_mbc_startpos(lex_p, len, max_line_margin, 1);
post = "...";
}
len = pe - p;
@@ -4922,7 +2627,7 @@ parser_yyerror(struct parser_params *parser, const char *msg)
buf[len] = '\0';
rb_compile_error_append("%s%s%s", pre, buf, post);
- i = (int)(lex_p - p);
+ i = lex_p - p;
p2 = buf; pe = buf + len;
while (p2 < pe) {
@@ -4931,315 +2636,181 @@ parser_yyerror(struct parser_params *parser, const char *msg)
}
buf[i] = '^';
buf[i+1] = '\0';
- rb_compile_error_append("%s%s", pre, buf);
+ rb_compile_error_append("%s", buf);
}
-#else
- dispatch1(parse_error, STR_NEW2(msg));
-#endif /* !RIPPER */
+
return 0;
}
-static void parser_prepare(struct parser_params *parser);
+static int heredoc_end;
-#ifndef RIPPER
-VALUE ruby_suppress_tracing(VALUE (*func)(VALUE, int), VALUE arg, int always);
+int ruby_in_compile = 0;
+int ruby__end__seen;
-static VALUE
-debug_lines(const char *f)
-{
- ID script_lines;
- CONST_ID(script_lines, "SCRIPT_LINES__");
- if (rb_const_defined_at(rb_cObject, script_lines)) {
- VALUE hash = rb_const_get_at(rb_cObject, script_lines);
- if (TYPE(hash) == T_HASH) {
- VALUE fname = rb_str_new2(f);
- VALUE lines = rb_ary_new();
- rb_hash_aset(hash, fname, lines);
- return lines;
- }
- }
- return 0;
-}
+static VALUE ruby_debug_lines;
+#ifdef YYMALLOC
+static NODE *parser_heap;
+#endif
-static VALUE
-coverage(const char *f, int n)
+static NODE*
+yycompile(f, line)
+ char *f;
+ int line;
{
- extern VALUE rb_get_coverages(void);
- VALUE coverages = rb_get_coverages();
- if (RTEST(coverages) && RBASIC(coverages)->klass == 0) {
- VALUE fname = rb_str_new2(f);
- VALUE lines = rb_ary_new2(n);
- int i;
- RBASIC(lines)->klass = 0;
- for (i = 0; i < n; i++) RARRAY_PTR(lines)[i] = Qnil;
- RARRAY(lines)->as.heap.len = n;
- rb_hash_aset(coverages, fname, lines);
- return lines;
- }
- return 0;
-}
+ int n;
+ NODE *node = 0;
+ struct RVarmap *vp, *vars = ruby_dyna_vars;
-static int
-e_option_supplied(struct parser_params *parser)
-{
- if (strcmp(ruby_sourcefile, "-e") == 0)
- return Qtrue;
- return Qfalse;
-}
+ ruby_in_compile = 1;
+ if (!compile_for_eval && rb_safe_level() == 0 &&
+ rb_const_defined(rb_cObject, rb_intern("SCRIPT_LINES__"))) {
+ VALUE hash, fname;
-static VALUE
-yycompile0(VALUE arg, int tracing)
-{
- int n;
- NODE *tree;
- struct parser_params *parser = (struct parser_params *)arg;
-
- if (!compile_for_eval && rb_safe_level() == 0) {
- ruby_debug_lines = debug_lines(ruby_sourcefile);
- if (ruby_debug_lines && ruby_sourceline > 0) {
- VALUE str = STR_NEW0();
- n = ruby_sourceline;
- do {
- rb_ary_push(ruby_debug_lines, str);
- } while (--n);
+ hash = rb_const_get(rb_cObject, rb_intern("SCRIPT_LINES__"));
+ if (TYPE(hash) == T_HASH) {
+ fname = rb_str_new2(f);
+ ruby_debug_lines = rb_ary_new();
+ rb_hash_aset(hash, fname, ruby_debug_lines);
}
-
- if (!e_option_supplied(parser)) {
- ruby_coverage = coverage(ruby_sourcefile, ruby_sourceline);
+ if (line > 1) {
+ VALUE str = rb_str_new(0,0);
+ while (line > 1) {
+ rb_ary_push(ruby_debug_lines, str);
+ line--;
+ }
}
}
- parser_prepare(parser);
+ ruby__end__seen = 0;
+ ruby_eval_tree = 0;
+ ruby_eval_tree_begin = 0;
+ heredoc_end = 0;
+ lex_strterm = 0;
+ ruby_current_node = 0;
+ ruby_sourcefile = rb_source_filename(f);
deferred_nodes = 0;
- n = yyparse((void*)parser);
+ n = yyparse();
ruby_debug_lines = 0;
- ruby_coverage = 0;
compile_for_eval = 0;
+ ruby_in_compile = 0;
+ cond_stack = 0;
+ cmdarg_stack = 0;
+ command_start = 1;
+ class_nest = 0;
+ in_single = 0;
+ in_def = 0;
+ cur_mid = 0;
+ deferred_nodes = 0;
+ vp = ruby_dyna_vars;
+ ruby_dyna_vars = vars;
lex_strterm = 0;
- lex_p = lex_pbeg = lex_pend = 0;
- lex_lastline = lex_nextline = 0;
- if (parser->nerr) {
- return 0;
+ while (vp && vp != vars) {
+ struct RVarmap *tmp = vp;
+ vp = vp->next;
+ rb_gc_force_recycle((VALUE)tmp);
}
- tree = ruby_eval_tree;
- if (!tree) {
- tree = NEW_NIL();
- }
- else if (ruby_eval_tree_begin) {
- tree->nd_body = NEW_PRELUDE(ruby_eval_tree_begin, tree->nd_body);
- }
- return (VALUE)tree;
+ if (n == 0) node = ruby_eval_tree;
+ if (ruby_nerrs) ruby_eval_tree_begin = 0;
+ return node;
}
-static NODE*
-yycompile(struct parser_params *parser, const char *f, int line)
-{
- ruby_sourcefile = ruby_strdup(f);
- ruby_sourceline = line - 1;
- return (NODE *)ruby_suppress_tracing(yycompile0, (VALUE)parser, Qtrue);
-}
-#endif /* !RIPPER */
+static int lex_gets_ptr;
static VALUE
-lex_get_str(struct parser_params *parser, VALUE s)
+lex_get_str(s)
+ VALUE s;
{
char *beg, *end, *pend;
- beg = RSTRING_PTR(s);
+ beg = RSTRING(s)->ptr;
if (lex_gets_ptr) {
- if (RSTRING_LEN(s) == lex_gets_ptr) return Qnil;
+ if (RSTRING(s)->len == lex_gets_ptr) return Qnil;
beg += lex_gets_ptr;
}
- pend = RSTRING_PTR(s) + RSTRING_LEN(s);
+ pend = RSTRING(s)->ptr + RSTRING(s)->len;
end = beg;
while (end < pend) {
if (*end++ == '\n') break;
}
- lex_gets_ptr = end - RSTRING_PTR(s);
- return rb_enc_str_new(beg, end - beg, rb_enc_get(s));
+ lex_gets_ptr = end - RSTRING(s)->ptr;
+ return rb_str_new(beg, end - beg);
}
static VALUE
-lex_getline(struct parser_params *parser)
+lex_getline()
{
- VALUE line = (*parser->parser_lex_gets)(parser, parser->parser_lex_input);
-#ifndef RIPPER
+ VALUE line = (*lex_gets)(lex_input);
if (ruby_debug_lines && !NIL_P(line)) {
rb_ary_push(ruby_debug_lines, line);
}
- if (ruby_coverage && !NIL_P(line)) {
- rb_ary_push(ruby_coverage, Qnil);
- }
-#endif
return line;
}
-static const rb_data_type_t parser_data_type;
-
-#ifndef RIPPER
-NODE*
-rb_compile_string(const char *f, VALUE s, int line)
-{
- VALUE volatile vparser = rb_parser_new();
-
- return rb_parser_compile_string(vparser, f, s, line);
-}
-
NODE*
-rb_parser_compile_string(volatile VALUE vparser, const char *f, VALUE s, int line)
+rb_compile_string(f, s, line)
+ const char *f;
+ VALUE s;
+ int line;
{
- struct parser_params *parser;
- NODE *node;
- volatile VALUE tmp;
-
- TypedData_Get_Struct(vparser, struct parser_params, &parser_data_type, parser);
lex_gets = lex_get_str;
lex_gets_ptr = 0;
lex_input = s;
lex_pbeg = lex_p = lex_pend = 0;
- compile_for_eval = rb_parse_in_eval();
-
- node = yycompile(parser, f, line);
- tmp = vparser; /* prohibit tail call optimization */
+ ruby_sourceline = line - 1;
+ compile_for_eval = ruby_in_eval;
- return node;
+ return yycompile(f, line);
}
NODE*
-rb_compile_cstr(const char *f, const char *s, int len, int line)
+rb_compile_cstr(f, s, len, line)
+ const char *f, *s;
+ int len, line;
{
return rb_compile_string(f, rb_str_new(s, len), line);
}
NODE*
-rb_parser_compile_cstr(volatile VALUE vparser, const char *f, const char *s, int len, int line)
-{
- return rb_parser_compile_string(vparser, f, rb_str_new(s, len), line);
-}
-
-static VALUE
-lex_io_gets(struct parser_params *parser, VALUE io)
+rb_compile_file(f, file, start)
+ const char *f;
+ VALUE file;
+ int start;
{
- return rb_io_gets(io);
-}
-
-NODE*
-rb_compile_file(const char *f, VALUE file, int start)
-{
- VALUE volatile vparser = rb_parser_new();
-
- return rb_parser_compile_file(vparser, f, file, start);
-}
-
-NODE*
-rb_parser_compile_file(volatile VALUE vparser, const char *f, VALUE file, int start)
-{
- struct parser_params *parser;
- volatile VALUE tmp;
- NODE *node;
-
- TypedData_Get_Struct(vparser, struct parser_params, &parser_data_type, parser);
- lex_gets = lex_io_gets;
+ lex_gets = rb_io_gets;
lex_input = file;
lex_pbeg = lex_p = lex_pend = 0;
- compile_for_eval = rb_parse_in_eval();
-
- node = yycompile(parser, f, start);
- tmp = vparser; /* prohibit tail call optimization */
-
- return node;
-}
-#endif /* !RIPPER */
-
-#define STR_FUNC_ESCAPE 0x01
-#define STR_FUNC_EXPAND 0x02
-#define STR_FUNC_REGEXP 0x04
-#define STR_FUNC_QWORDS 0x08
-#define STR_FUNC_SYMBOL 0x10
-#define STR_FUNC_INDENT 0x20
-
-enum string_type {
- str_squote = (0),
- str_dquote = (STR_FUNC_EXPAND),
- str_xquote = (STR_FUNC_EXPAND),
- str_regexp = (STR_FUNC_REGEXP|STR_FUNC_ESCAPE|STR_FUNC_EXPAND),
- str_sword = (STR_FUNC_QWORDS),
- str_dword = (STR_FUNC_QWORDS|STR_FUNC_EXPAND),
- str_ssym = (STR_FUNC_SYMBOL),
- str_dsym = (STR_FUNC_SYMBOL|STR_FUNC_EXPAND)
-};
+ ruby_sourceline = start - 1;
-static VALUE
-parser_str_new(const char *p, long n, rb_encoding *enc, int func, rb_encoding *enc0)
-{
- VALUE str;
-
- str = rb_enc_str_new(p, n, enc);
- if (!(func & STR_FUNC_REGEXP) && rb_enc_asciicompat(enc)) {
- if (rb_enc_str_coderange(str) == ENC_CODERANGE_7BIT) {
- }
- else if (enc0 == rb_usascii_encoding() && enc != rb_utf8_encoding()) {
- rb_enc_associate(str, rb_ascii8bit_encoding());
- }
- }
-
- return str;
+ return yycompile(f, start);
}
-#define lex_goto_eol(parser) (parser->parser_lex_p = parser->parser_lex_pend)
-#define peek(c) (lex_p < lex_pend && (c) == *lex_p)
-
static inline int
-parser_nextc(struct parser_params *parser)
+nextc()
{
int c;
if (lex_p == lex_pend) {
- VALUE v = lex_nextline;
- lex_nextline = 0;
- if (!v) {
- if (parser->eofp)
- return -1;
+ if (lex_input) {
+ VALUE v = lex_getline();
- if (!lex_input || NIL_P(v = lex_getline(parser))) {
- parser->eofp = Qtrue;
- lex_goto_eol(parser);
- return -1;
- }
- }
- {
-#ifdef RIPPER
- if (parser->tokp < lex_pend) {
- if (NIL_P(parser->delayed)) {
- parser->delayed = rb_str_buf_new(1024);
- rb_str_buf_cat(parser->delayed,
- parser->tokp, lex_pend - parser->tokp);
- parser->delayed_line = ruby_sourceline;
- parser->delayed_col = parser->tokp - lex_pbeg;
- }
- else {
- rb_str_buf_cat(parser->delayed,
- parser->tokp, lex_pend - parser->tokp);
- }
- }
-#endif
+ if (NIL_P(v)) return -1;
if (heredoc_end > 0) {
ruby_sourceline = heredoc_end;
heredoc_end = 0;
}
ruby_sourceline++;
- parser->line_count++;
- lex_pbeg = lex_p = RSTRING_PTR(v);
- lex_pend = lex_p + RSTRING_LEN(v);
-#ifdef RIPPER
- ripper_flush(parser);
-#endif
+ lex_pbeg = lex_p = RSTRING(v)->ptr;
+ lex_pend = lex_p + RSTRING(v)->len;
lex_lastline = v;
}
+ else {
+ lex_lastline = 0;
+ return -1;
+ }
}
c = (unsigned char)*lex_p++;
- if (c == '\r' && peek('\n')) {
+ if (c == '\r' && lex_p < lex_pend && *lex_p == '\n') {
lex_p++;
c = '\n';
}
@@ -5248,16 +2819,15 @@ parser_nextc(struct parser_params *parser)
}
static void
-parser_pushback(struct parser_params *parser, int c)
+pushback(c)
+ int c;
{
if (c == -1) return;
lex_p--;
- if (lex_p > lex_pbeg && lex_p[0] == '\n' && lex_p[-1] == '\r') {
- lex_p--;
- }
}
#define was_bol() (lex_p == lex_pbeg + 1)
+#define peek(c) (lex_p != lex_pend && (c) == *lex_p)
#define tokfix() (tokenbuf[tokidx]='\0')
#define tok() tokenbuf
@@ -5265,7 +2835,7 @@ parser_pushback(struct parser_params *parser, int c)
#define toklast() (tokidx>0?tokenbuf[tokidx-1]:0)
static char*
-parser_newtok(struct parser_params *parser)
+newtok()
{
tokidx = 0;
if (!tokenbuf) {
@@ -5279,22 +2849,11 @@ parser_newtok(struct parser_params *parser)
return tokenbuf;
}
-static char *
-parser_tokspace(struct parser_params *parser, int n)
-{
- tokidx += n;
-
- if (tokidx >= toksiz) {
- do {toksiz *= 2;} while (toksiz < tokidx);
- REALLOC_N(tokenbuf, char, toksiz);
- }
- return &tokenbuf[tokidx-n];
-}
-
static void
-parser_tokadd(struct parser_params *parser, int c)
+tokadd(c)
+ char c;
{
- tokenbuf[tokidx++] = (char)c;
+ tokenbuf[tokidx++] = c;
if (tokidx >= toksiz) {
toksiz *= 2;
REALLOC_N(tokenbuf, char, toksiz);
@@ -5302,113 +2861,10 @@ parser_tokadd(struct parser_params *parser, int c)
}
static int
-parser_tok_hex(struct parser_params *parser, size_t *numlen)
+read_escape()
{
int c;
- c = scan_hex(lex_p, 2, numlen);
- if (!*numlen) {
- yyerror("invalid hex escape");
- return 0;
- }
- lex_p += *numlen;
- return c;
-}
-
-#define tokcopy(n) memcpy(tokspace(n), lex_p - (n), (n))
-
-static int
-parser_tokadd_utf8(struct parser_params *parser, rb_encoding **encp,
- int string_literal, int symbol_literal, int regexp_literal)
-{
- /*
- * If string_literal is true, then we allow multiple codepoints
- * in \u{}, and add the codepoints to the current token.
- * Otherwise we're parsing a character literal and return a single
- * codepoint without adding it
- */
-
- int codepoint;
- size_t numlen;
-
- if (regexp_literal) { tokadd('\\'); tokadd('u'); }
-
- if (peek('{')) { /* handle \u{...} form */
- do {
- if (regexp_literal) { tokadd(*lex_p); }
- nextc();
- codepoint = scan_hex(lex_p, 6, &numlen);
- if (numlen == 0) {
- yyerror("invalid Unicode escape");
- return 0;
- }
- if (codepoint > 0x10ffff) {
- yyerror("invalid Unicode codepoint (too large)");
- return 0;
- }
- lex_p += numlen;
- if (regexp_literal) {
- tokcopy((int)numlen);
- }
- else if (codepoint >= 0x80) {
- *encp = UTF8_ENC();
- if (string_literal) tokaddmbc(codepoint, *encp);
- }
- else if (string_literal) {
- if (codepoint == 0 && symbol_literal) {
- yyerror("symbol cannot contain '\\u{0}'");
- return 0;
- }
-
- tokadd(codepoint);
- }
- } while (string_literal && (peek(' ') || peek('\t')));
-
- if (!peek('}')) {
- yyerror("unterminated Unicode escape");
- return 0;
- }
-
- if (regexp_literal) { tokadd('}'); }
- nextc();
- }
- else { /* handle \uxxxx form */
- codepoint = scan_hex(lex_p, 4, &numlen);
- if (numlen < 4) {
- yyerror("invalid Unicode escape");
- return 0;
- }
- lex_p += 4;
- if (regexp_literal) {
- tokcopy(4);
- }
- else if (codepoint >= 0x80) {
- *encp = UTF8_ENC();
- if (string_literal) tokaddmbc(codepoint, *encp);
- }
- else if (string_literal) {
- if (codepoint == 0 && symbol_literal) {
- yyerror("symbol cannot contain '\\u0000'");
- return 0;
- }
-
- tokadd(codepoint);
- }
- }
-
- return codepoint;
-}
-
-#define ESCAPE_CONTROL 1
-#define ESCAPE_META 2
-
-static int
-parser_read_escape(struct parser_params *parser, int flags,
- rb_encoding **encp)
-{
- int c;
- size_t numlen;
-
switch (c = nextc()) {
case '\\': /* Backslash */
return c;
@@ -5436,16 +2892,26 @@ parser_read_escape(struct parser_params *parser, int flags,
case '0': case '1': case '2': case '3': /* octal constant */
case '4': case '5': case '6': case '7':
- if (flags & (ESCAPE_CONTROL|ESCAPE_META)) goto eof;
- pushback(c);
- c = ruby_scan_oct(lex_p, 3, &numlen);
- lex_p += numlen;
+ {
+ int numlen;
+
+ pushback(c);
+ c = scan_oct(lex_p, 3, &numlen);
+ lex_p += numlen;
+ }
return c;
case 'x': /* hex constant */
- if (flags & (ESCAPE_CONTROL|ESCAPE_META)) goto eof;
- c = tok_hex(&numlen);
- if (numlen == 0) return 0;
+ {
+ int numlen;
+
+ c = scan_hex(lex_p, 2, &numlen);
+ if (numlen == 0) {
+ yyerror("Invalid escape character syntax");
+ return 0;
+ }
+ lex_p += numlen;
+ }
return c;
case 'b': /* backspace */
@@ -5455,32 +2921,32 @@ parser_read_escape(struct parser_params *parser, int flags,
return ' ';
case 'M':
- if (flags & ESCAPE_META) goto eof;
if ((c = nextc()) != '-') {
+ yyerror("Invalid escape character syntax");
pushback(c);
- goto eof;
+ return '\0';
}
if ((c = nextc()) == '\\') {
- return read_escape(flags|ESCAPE_META, encp) | 0x80;
+ return read_escape() | 0x80;
}
- else if (c == -1 || !ISASCII(c)) goto eof;
+ else if (c == -1) goto eof;
else {
return ((c & 0xff) | 0x80);
}
case 'C':
if ((c = nextc()) != '-') {
+ yyerror("Invalid escape character syntax");
pushback(c);
- goto eof;
+ return '\0';
}
case 'c':
- if (flags & ESCAPE_CONTROL) goto eof;
if ((c = nextc())== '\\') {
- c = read_escape(flags|ESCAPE_CONTROL, encp);
+ c = read_escape();
}
else if (c == '?')
return 0177;
- else if (c == -1 || !ISASCII(c)) goto eof;
+ else if (c == -1) goto eof;
return c & 0x9f;
eof:
@@ -5493,71 +2959,73 @@ parser_read_escape(struct parser_params *parser, int flags,
}
}
-static void
-parser_tokaddmbc(struct parser_params *parser, int c, rb_encoding *enc)
-{
- int len = rb_enc_codelen(c, enc);
- rb_enc_mbcput(c, tokspace(len), enc);
-}
-
static int
-parser_tokadd_escape(struct parser_params *parser, rb_encoding **encp)
+tokadd_escape()
{
int c;
- int flags = 0;
- size_t numlen;
- first:
switch (c = nextc()) {
case '\n':
return 0; /* just ignore */
case '0': case '1': case '2': case '3': /* octal constant */
case '4': case '5': case '6': case '7':
- if (flags & (ESCAPE_CONTROL|ESCAPE_META)) goto eof;
{
- ruby_scan_oct(--lex_p, 3, &numlen);
- if (numlen == 0) goto eof;
- lex_p += numlen;
- tokcopy((int)numlen + 1);
+ int i;
+
+ tokadd('\\');
+ tokadd(c);
+ for (i=0; i<2; i++) {
+ c = nextc();
+ if (c == -1) goto eof;
+ if (c < '0' || '7' < c) {
+ pushback(c);
+ break;
+ }
+ tokadd(c);
+ }
}
return 0;
case 'x': /* hex constant */
- if (flags & (ESCAPE_CONTROL|ESCAPE_META)) goto eof;
{
- tok_hex(&numlen);
- if (numlen == 0) goto eof;
- tokcopy((int)numlen + 2);
+ int numlen;
+
+ tokadd('\\');
+ tokadd(c);
+ scan_hex(lex_p, 2, &numlen);
+ if (numlen == 0) {
+ yyerror("Invalid escape character syntax");
+ return -1;
+ }
+ while (numlen--)
+ tokadd(nextc());
}
return 0;
case 'M':
- if (flags & ESCAPE_META) goto eof;
if ((c = nextc()) != '-') {
+ yyerror("Invalid escape character syntax");
pushback(c);
- goto eof;
+ return 0;
}
- tokcopy(3);
- flags |= ESCAPE_META;
+ tokadd('\\'); tokadd('M'); tokadd('-');
goto escaped;
case 'C':
- if (flags & ESCAPE_CONTROL) goto eof;
if ((c = nextc()) != '-') {
+ yyerror("Invalid escape character syntax");
pushback(c);
- goto eof;
+ return 0;
}
- tokcopy(3);
+ tokadd('\\'); tokadd('C'); tokadd('-');
goto escaped;
case 'c':
- if (flags & ESCAPE_CONTROL) goto eof;
- tokcopy(2);
- flags |= ESCAPE_CONTROL;
+ tokadd('\\'); tokadd('c');
escaped:
if ((c = nextc()) == '\\') {
- goto first;
+ return tokadd_escape();
}
else if (c == -1) goto eof;
tokadd(c);
@@ -5575,89 +3043,85 @@ parser_tokadd_escape(struct parser_params *parser, rb_encoding **encp)
return 0;
}
-extern int rb_char_to_option_kcode(int c, int *option, int *kcode);
-
static int
-parser_regx_options(struct parser_params *parser)
+regx_options()
{
- int kcode = 0;
+ char kcode = 0;
int options = 0;
- int c, opt, kc;
+ int c;
newtok();
while (c = nextc(), ISALPHA(c)) {
- if (c == 'o') {
- options |= RE_OPTION_ONCE;
- }
- else if (rb_char_to_option_kcode(c, &opt, &kc)) {
- options |= opt;
- if (kc >= 0) kcode = c;
- }
- else {
+ switch (c) {
+ case 'i':
+ options |= RE_OPTION_IGNORECASE;
+ break;
+ case 'x':
+ options |= RE_OPTION_EXTENDED;
+ break;
+ case 'm':
+ options |= RE_OPTION_MULTILINE;
+ break;
+ case 'o':
+ options |= RE_OPTION_ONCE;
+ break;
+ case 'n':
+ kcode = 16;
+ break;
+ case 'e':
+ kcode = 32;
+ break;
+ case 's':
+ kcode = 48;
+ break;
+ case 'u':
+ kcode = 64;
+ break;
+ default:
tokadd(c);
- }
+ break;
+ }
}
pushback(c);
if (toklen()) {
tokfix();
- compile_error(PARSER_ARG "unknown regexp option%s - %s",
- toklen() > 1 ? "s" : "", tok());
+ rb_compile_error("unknown regexp option%s - %s",
+ toklen() > 1 ? "s" : "", tok());
}
- return options | RE_OPTION_ENCODING(kcode);
+ return options | kcode;
}
+#define STR_FUNC_ESCAPE 0x01
+#define STR_FUNC_EXPAND 0x02
+#define STR_FUNC_REGEXP 0x04
+#define STR_FUNC_QWORDS 0x08
+#define STR_FUNC_SYMBOL 0x10
+#define STR_FUNC_INDENT 0x20
+
+enum string_type {
+ str_squote = (0),
+ str_dquote = (STR_FUNC_EXPAND),
+ str_xquote = (STR_FUNC_EXPAND),
+ str_regexp = (STR_FUNC_REGEXP|STR_FUNC_ESCAPE|STR_FUNC_EXPAND),
+ str_sword = (STR_FUNC_QWORDS),
+ str_dword = (STR_FUNC_QWORDS|STR_FUNC_EXPAND),
+ str_ssym = (STR_FUNC_SYMBOL),
+ str_dsym = (STR_FUNC_SYMBOL|STR_FUNC_EXPAND),
+};
+
static void
-dispose_string(VALUE str)
+dispose_string(str)
+ VALUE str;
{
- /* TODO: should use another API? */
- if (RBASIC(str)->flags & RSTRING_NOEMBED)
- xfree(RSTRING_PTR(str));
+ xfree(RSTRING(str)->ptr);
rb_gc_force_recycle(str);
}
static int
-parser_tokadd_mbchar(struct parser_params *parser, int c)
-{
- int len = parser_precise_mbclen();
- if (!MBCLEN_CHARFOUND_P(len)) {
- compile_error(PARSER_ARG "invalid multibyte char (%s)", parser_encoding_name());
- return -1;
- }
- tokadd(c);
- lex_p += --len;
- if (len > 0) tokcopy(len);
- return c;
-}
-
-#define tokadd_mbchar(c) parser_tokadd_mbchar(parser, c)
-
-static int
-parser_tokadd_string(struct parser_params *parser,
- int func, int term, int paren, long *nest,
- rb_encoding **encp)
+tokadd_string(func, term, paren, nest)
+ int func, term, paren, *nest;
{
int c;
- int has_nonascii = 0;
- rb_encoding *enc = *encp;
- char *errbuf = 0;
- static const char mixed_msg[] = "%s mixed within %s source";
-
-#define mixed_error(enc1, enc2) if (!errbuf) { \
- size_t len = sizeof(mixed_msg) - 4; \
- len += strlen(rb_enc_name(enc1)); \
- len += strlen(rb_enc_name(enc2)); \
- errbuf = ALLOCA_N(char, len); \
- snprintf(errbuf, len, mixed_msg, \
- rb_enc_name(enc1), \
- rb_enc_name(enc2)); \
- yyerror(errbuf); \
- }
-#define mixed_escape(beg, enc1, enc2) do { \
- const char *pos = lex_p; \
- lex_p = beg; \
- mixed_error(enc1, enc2); \
- lex_p = pos; \
- } while (0)
while ((c = nextc()) != -1) {
if (paren && c == paren) {
@@ -5678,7 +3142,6 @@ parser_tokadd_string(struct parser_params *parser,
}
}
else if (c == '\\') {
- const char *beg = lex_p - 1;
c = nextc();
switch (c) {
case '\n':
@@ -5691,33 +3154,17 @@ parser_tokadd_string(struct parser_params *parser,
if (func & STR_FUNC_ESCAPE) tokadd(c);
break;
- case 'u':
- if ((func & STR_FUNC_EXPAND) == 0) {
- tokadd('\\');
- break;
- }
- parser_tokadd_utf8(parser, &enc, 1,
- func & STR_FUNC_SYMBOL,
- func & STR_FUNC_REGEXP);
- if (has_nonascii && enc != *encp) {
- mixed_escape(beg, enc, *encp);
- }
- continue;
-
default:
if (func & STR_FUNC_REGEXP) {
pushback(c);
- if ((c = tokadd_escape(&enc)) < 0)
+ if (tokadd_escape() < 0)
return -1;
- if (has_nonascii && enc != *encp) {
- mixed_escape(beg, enc, *encp);
- }
continue;
}
else if (func & STR_FUNC_EXPAND) {
pushback(c);
if (func & STR_FUNC_ESCAPE) tokadd('\\');
- c = read_escape(0, &enc);
+ c = read_escape();
}
else if ((func & STR_FUNC_QWORDS) && ISSPACE(c)) {
/* ignore backslashed spaces in %w */
@@ -5727,14 +3174,13 @@ parser_tokadd_string(struct parser_params *parser,
}
}
}
- else if (!parser_isascii()) {
- has_nonascii = 1;
- if (enc != *encp) {
- mixed_error(enc, *encp);
- continue;
+ else if (ismbchar(c)) {
+ int i, len = mbclen(c)-1;
+
+ for (i = 0; i < len; i++) {
+ tokadd(c);
+ c = nextc();
}
- if (tokadd_mbchar(c) == -1) return -1;
- continue;
}
else if ((func & STR_FUNC_QWORDS) && ISSPACE(c)) {
pushback(c);
@@ -5742,19 +3188,11 @@ parser_tokadd_string(struct parser_params *parser,
}
if (!c && (func & STR_FUNC_SYMBOL)) {
func &= ~STR_FUNC_SYMBOL;
- compile_error(PARSER_ARG "symbol cannot contain '\\0'");
+ rb_compile_error("symbol cannot contain '\\0'");
continue;
}
- if (c & 0x80) {
- has_nonascii = 1;
- if (enc != *encp) {
- mixed_error(enc, *encp);
- continue;
- }
- }
tokadd(c);
}
- *encp = enc;
return c;
}
@@ -5762,13 +3200,13 @@ parser_tokadd_string(struct parser_params *parser,
rb_node_newnode(NODE_STRTERM, (func), (term) | ((paren) << (CHAR_BIT * 2)), 0)
static int
-parser_parse_string(struct parser_params *parser, NODE *quote)
+parse_string(quote)
+ NODE *quote;
{
int func = quote->nd_func;
int term = nd_term(quote);
int paren = nd_paren(quote);
int c, space = 0;
- rb_encoding *enc = parser->enc;
if (func == -1) return tSTRING_END;
c = nextc();
@@ -5782,7 +3220,7 @@ parser_parse_string(struct parser_params *parser, NODE *quote)
return ' ';
}
if (!(func & STR_FUNC_REGEXP)) return tSTRING_END;
- set_yylval_num(regx_options());
+ yylval.num = regx_options();
return tREGEXP_END;
}
if (space) {
@@ -5802,28 +3240,19 @@ parser_parse_string(struct parser_params *parser, NODE *quote)
tokadd('#');
}
pushback(c);
- if (tokadd_string(func, term, paren, &quote->nd_nest,
- &enc) == -1) {
+ if (tokadd_string(func, term, paren, &quote->nd_nest) == -1) {
ruby_sourceline = nd_line(quote);
- if (func & STR_FUNC_REGEXP) {
- if (parser->eofp)
- compile_error(PARSER_ARG "unterminated regexp meets end of file");
- return tREGEXP_END;
- }
- else {
- if (parser->eofp)
- compile_error(PARSER_ARG "unterminated string meets end of file");
- return tSTRING_END;
- }
+ rb_compile_error("unterminated string meets end of file");
+ return tSTRING_END;
}
tokfix();
- set_yylval_str(STR_NEW3(tok(), toklen(), enc, func));
+ yylval.node = NEW_STR(rb_str_new(tok(), toklen()));
return tSTRING_CONTENT;
}
static int
-parser_heredoc_identifier(struct parser_params *parser)
+heredoc_identifier()
{
int c = nextc(), term, func = 0, len;
@@ -5843,16 +3272,17 @@ parser_heredoc_identifier(struct parser_params *parser)
tokadd(func);
term = c;
while ((c = nextc()) != -1 && c != term) {
- if (tokadd_mbchar(c) == -1) return 0;
+ len = mbclen(c);
+ do {tokadd(c);} while (--len > 0 && (c = nextc()) != -1);
}
if (c == -1) {
- compile_error(PARSER_ARG "unterminated here document identifier");
+ rb_compile_error("unterminated here document identifier");
return 0;
}
break;
default:
- if (!parser_is_identchar()) {
+ if (!is_identchar(c)) {
pushback(c);
if (func & STR_FUNC_INDENT) {
pushback('-');
@@ -5863,59 +3293,44 @@ parser_heredoc_identifier(struct parser_params *parser)
term = '"';
tokadd(func |= str_dquote);
do {
- if (tokadd_mbchar(c) == -1) return 0;
- } while ((c = nextc()) != -1 && parser_is_identchar());
+ len = mbclen(c);
+ do {tokadd(c);} while (--len > 0 && (c = nextc()) != -1);
+ } while ((c = nextc()) != -1 && is_identchar(c));
pushback(c);
break;
}
tokfix();
-#ifdef RIPPER
- ripper_dispatch_scan_event(parser, tHEREDOC_BEG);
-#endif
len = lex_p - lex_pbeg;
- lex_goto_eol(parser);
+ lex_p = lex_pend;
lex_strterm = rb_node_newnode(NODE_HEREDOC,
- STR_NEW(tok(), toklen()), /* nd_lit */
+ rb_str_new(tok(), toklen()), /* nd_lit */
len, /* nd_nth */
lex_lastline); /* nd_orig */
- nd_set_line(lex_strterm, ruby_sourceline);
-#ifdef RIPPER
- ripper_flush(parser);
-#endif
return term == '`' ? tXSTRING_BEG : tSTRING_BEG;
}
static void
-parser_heredoc_restore(struct parser_params *parser, NODE *here)
+heredoc_restore(here)
+ NODE *here;
{
- VALUE line;
-
-#ifdef RIPPER
- if (!NIL_P(parser->delayed))
- ripper_dispatch_delayed_token(parser, tSTRING_CONTENT);
- lex_goto_eol(parser);
- ripper_dispatch_scan_event(parser, tHEREDOC_END);
-#endif
- line = here->nd_orig;
+ VALUE line = here->nd_orig;
lex_lastline = line;
- lex_pbeg = RSTRING_PTR(line);
- lex_pend = lex_pbeg + RSTRING_LEN(line);
+ lex_pbeg = RSTRING(line)->ptr;
+ lex_pend = lex_pbeg + RSTRING(line)->len;
lex_p = lex_pbeg + here->nd_nth;
heredoc_end = ruby_sourceline;
ruby_sourceline = nd_line(here);
dispose_string(here->nd_lit);
rb_gc_force_recycle((VALUE)here);
-#ifdef RIPPER
- ripper_flush(parser);
-#endif
}
static int
-parser_whole_match_p(struct parser_params *parser,
- const char *eos, int len, int indent)
+whole_match_p(eos, len, indent)
+ char *eos;
+ int len, indent;
{
- const char *p = lex_pbeg;
+ char *p = lex_pbeg;
int n;
if (indent) {
@@ -5928,21 +3343,21 @@ parser_whole_match_p(struct parser_params *parser,
}
static int
-parser_here_document(struct parser_params *parser, NODE *here)
+here_document(here)
+ NODE *here;
{
int c, func, indent = 0;
- const char *eos, *p, *pend;
+ char *eos, *p, *pend;
long len;
VALUE str = 0;
- eos = RSTRING_PTR(here->nd_lit);
- len = RSTRING_LEN(here->nd_lit) - 1;
+ eos = RSTRING(here->nd_lit)->ptr;
+ len = RSTRING(here->nd_lit)->len - 1;
indent = (func = *eos++) & STR_FUNC_INDENT;
if ((c = nextc()) == -1) {
error:
- compile_error(PARSER_ARG "can't find string \"%s\" anywhere before EOF", eos);
- restore:
+ rb_compile_error("can't find string \"%s\" anywhere before EOF", eos);
heredoc_restore(lex_strterm);
lex_strterm = 0;
return 0;
@@ -5954,7 +3369,7 @@ parser_here_document(struct parser_params *parser, NODE *here)
if (!(func & STR_FUNC_EXPAND)) {
do {
- p = RSTRING_PTR(lex_lastline);
+ p = RSTRING(lex_lastline)->ptr;
pend = lex_pend;
if (pend > p) {
switch (pend[-1]) {
@@ -5970,9 +3385,9 @@ parser_here_document(struct parser_params *parser, NODE *here)
if (str)
rb_str_cat(str, p, pend - p);
else
- str = STR_NEW(p, pend - p);
+ str = rb_str_new(p, pend - p);
if (pend < lex_pend) rb_str_cat(str, "\n", 1);
- lex_goto_eol(parser);
+ lex_p = lex_pend;
if (nextc() == -1) {
if (str) dispose_string(str);
goto error;
@@ -5980,8 +3395,6 @@ parser_here_document(struct parser_params *parser, NODE *here)
} while (!whole_match_p(eos, len, indent));
}
else {
- /* int mb = ENC_CODERANGE_7BIT, *mbp = &mb;*/
- rb_encoding *enc = parser->enc;
newtok();
if (c == '#') {
switch (c = nextc()) {
@@ -5996,343 +3409,40 @@ parser_here_document(struct parser_params *parser, NODE *here)
}
do {
pushback(c);
- if ((c = tokadd_string(func, '\n', 0, NULL, &enc)) == -1) {
- if (parser->eofp) goto error;
- goto restore;
- }
+ if ((c = tokadd_string(func, '\n', 0, NULL)) == -1) goto error;
if (c != '\n') {
- set_yylval_str(STR_NEW3(tok(), toklen(), enc, func));
+ yylval.node = NEW_STR(rb_str_new(tok(), toklen()));
return tSTRING_CONTENT;
}
tokadd(nextc());
- /* if (mbp && mb == ENC_CODERANGE_UNKNOWN) mbp = 0;*/
if ((c = nextc()) == -1) goto error;
} while (!whole_match_p(eos, len, indent));
- str = STR_NEW3(tok(), toklen(), enc, func);
+ str = rb_str_new(tok(), toklen());
}
heredoc_restore(lex_strterm);
lex_strterm = NEW_STRTERM(-1, 0, 0);
- set_yylval_str(str);
+ yylval.node = NEW_STR(str);
return tSTRING_CONTENT;
}
#include "lex.c"
-#ifndef RIPPER
-static void
-arg_ambiguous_gen(struct parser_params *parser)
-{
- rb_warning0("ambiguous first argument; put parentheses or even spaces");
-}
-#else
-static void
-arg_ambiguous_gen(struct parser_params *parser)
-{
- dispatch0(arg_ambiguous);
-}
-#endif
-#define arg_ambiguous() arg_ambiguous_gen(parser)
-
-static int
-lvar_defined_gen(struct parser_params *parser, ID id)
-{
-#ifndef RIPPER
- return (dyna_in_block() && dvar_defined(id)) || local_id(id);
-#else
- return 0;
-#endif
-}
-
-/* emacsen -*- hack */
-static int
-parser_encode_length(struct parser_params *parser, const char *name, int len)
-{
- int nlen;
-
- if (len > 5 && name[nlen = len - 5] == '-') {
- if (rb_memcicmp(name + nlen + 1, "unix", 4) == 0)
- return nlen;
- }
- if (len > 4 && name[nlen = len - 5] == '-') {
- if (rb_memcicmp(name + nlen + 1, "dos", 3) == 0)
- return nlen;
- if (rb_memcicmp(name + nlen + 1, "mac", 3) == 0)
- return nlen;
- }
- return len;
-}
-
-static void
-parser_set_encode(struct parser_params *parser, const char *name)
-{
- int idx = rb_enc_find_index(name);
- rb_encoding *enc;
- VALUE excargs[3];
-
- if (idx < 0) {
- VALUE rb_make_backtrace(void);
- VALUE rb_make_exception(int, VALUE*);
-
- excargs[1] = rb_sprintf("unknown encoding name: %s", name);
- error:
- excargs[0] = rb_eArgError;
- excargs[2] = rb_make_backtrace();
- rb_ary_unshift(excargs[2], rb_sprintf("%s:%d", ruby_sourcefile, ruby_sourceline));
- rb_exc_raise(rb_make_exception(3, excargs));
- }
- enc = rb_enc_from_index(idx);
- if (!rb_enc_asciicompat(enc)) {
- excargs[1] = rb_sprintf("%s is not ASCII compatible", rb_enc_name(enc));
- goto error;
- }
- parser->enc = enc;
-}
-
-static int
-comment_at_top(struct parser_params *parser)
-{
- const char *p = lex_pbeg, *pend = lex_p - 1;
- if (parser->line_count != (parser->has_shebang ? 2 : 1)) return 0;
- while (p < pend) {
- if (!ISSPACE(*p)) return 0;
- p++;
- }
- return 1;
-}
-
-#ifndef RIPPER
-typedef int (*rb_magic_comment_length_t)(struct parser_params *parser, const char *name, int len);
-typedef void (*rb_magic_comment_setter_t)(struct parser_params *parser, const char *name, const char *val);
-
-static void
-magic_comment_encoding(struct parser_params *parser, const char *name, const char *val)
-{
- if (!comment_at_top(parser)) {
- return;
- }
- parser_set_encode(parser, val);
-}
-
-struct magic_comment {
- const char *name;
- rb_magic_comment_setter_t func;
- rb_magic_comment_length_t length;
-};
-
-static const struct magic_comment magic_comments[] = {
- {"coding", magic_comment_encoding, parser_encode_length},
- {"encoding", magic_comment_encoding, parser_encode_length},
-};
-#endif
-
-static const char *
-magic_comment_marker(const char *str, int len)
-{
- int i = 2;
-
- while (i < len) {
- switch (str[i]) {
- case '-':
- if (str[i-1] == '*' && str[i-2] == '-') {
- return str + i + 1;
- }
- i += 2;
- break;
- case '*':
- if (i + 1 >= len) return 0;
- if (str[i+1] != '-') {
- i += 4;
- }
- else if (str[i-1] != '-') {
- i += 2;
- }
- else {
- return str + i + 2;
- }
- break;
- default:
- i += 3;
- break;
- }
- }
- return 0;
-}
-
-static int
-parser_magic_comment(struct parser_params *parser, const char *str, int len)
-{
- VALUE name = 0, val = 0;
- const char *beg, *end, *vbeg, *vend;
-#define str_copy(_s, _p, _n) ((_s) \
- ? (rb_str_resize((_s), (_n)), \
- MEMCPY(RSTRING_PTR(_s), (_p), char, (_n)), (_s)) \
- : ((_s) = STR_NEW((_p), (_n))))
-
- if (len <= 7) return Qfalse;
- if (!(beg = magic_comment_marker(str, len))) return Qfalse;
- if (!(end = magic_comment_marker(beg, str + len - beg))) return Qfalse;
- str = beg;
- len = end - beg - 3;
-
- /* %r"([^\\s\'\":;]+)\\s*:\\s*(\"(?:\\\\.|[^\"])*\"|[^\"\\s;]+)[\\s;]*" */
- while (len > 0) {
-#ifndef RIPPER
- const struct magic_comment *p = magic_comments;
-#endif
- char *s;
- int i, n = 0;
-
- for (; len > 0 && *str; str++, --len) {
- switch (*str) {
- case '\'': case '"': case ':': case ';':
- continue;
- }
- if (!ISSPACE(*str)) break;
- }
- for (beg = str; len > 0; str++, --len) {
- switch (*str) {
- case '\'': case '"': case ':': case ';':
- break;
- default:
- if (ISSPACE(*str)) break;
- continue;
- }
- break;
- }
- for (end = str; len > 0 && ISSPACE(*str); str++, --len);
- if (!len) break;
- if (*str != ':') continue;
-
- do str++; while (--len > 0 && ISSPACE(*str));
- if (!len) break;
- if (*str == '"') {
- for (vbeg = ++str; --len > 0 && *str != '"'; str++) {
- if (*str == '\\') {
- --len;
- ++str;
- }
- }
- vend = str;
- if (len) {
- --len;
- ++str;
- }
- }
- else {
- for (vbeg = str; len > 0 && *str != '"' && *str != ';' && !ISSPACE(*str); --len, str++);
- vend = str;
- }
- while (len > 0 && (*str == ';' || ISSPACE(*str))) --len, str++;
-
- n = end - beg;
- str_copy(name, beg, n);
- s = RSTRING_PTR(name);
- for (i = 0; i < n; ++i) {
- if (*s == '-') *s = '_';
- }
-#ifndef RIPPER
- do {
- if (STRNCASECMP(p->name, s, n) == 0) {
- n = vend - vbeg;
- if (p->length) {
- n = (*p->length)(parser, vbeg, n);
- }
- str_copy(val, vbeg, n);
- (*p->func)(parser, s, RSTRING_PTR(val));
- break;
- }
- } while (++p < magic_comments + sizeof(magic_comments) / sizeof(*p));
-#else
- dispatch2(magic_comment, name, val);
-#endif
- }
-
- return Qtrue;
-}
-
static void
-set_file_encoding(struct parser_params *parser, const char *str, const char *send)
+arg_ambiguous()
{
- int sep = 0;
- const char *beg = str;
- VALUE s;
-
- for (;;) {
- if (send - str <= 6) return;
- switch (str[6]) {
- case 'C': case 'c': str += 6; continue;
- case 'O': case 'o': str += 5; continue;
- case 'D': case 'd': str += 4; continue;
- case 'I': case 'i': str += 3; continue;
- case 'N': case 'n': str += 2; continue;
- case 'G': case 'g': str += 1; continue;
- case '=': case ':':
- sep = 1;
- str += 6;
- break;
- default:
- str += 6;
- if (ISSPACE(*str)) break;
- continue;
- }
- if (STRNCASECMP(str-6, "coding", 6) == 0) break;
- }
- for (;;) {
- do {
- if (++str >= send) return;
- } while (ISSPACE(*str));
- if (sep) break;
- if (*str != '=' && *str != ':') return;
- sep = 1;
- str++;
- }
- beg = str;
- while ((*str == '-' || *str == '_' || ISALNUM(*str)) && ++str < send);
- s = rb_str_new(beg, parser_encode_length(parser, beg, str - beg));
- parser_set_encode(parser, RSTRING_PTR(s));
- rb_str_resize(s, 0);
-}
-
-static void
-parser_prepare(struct parser_params *parser)
-{
- int c = nextc();
- switch (c) {
- case '#':
- if (peek('!')) parser->has_shebang = 1;
- break;
- case 0xef: /* UTF-8 BOM marker */
- if (lex_pend - lex_p >= 2 &&
- (unsigned char)lex_p[0] == 0xbb &&
- (unsigned char)lex_p[1] == 0xbf) {
- parser->enc = rb_utf8_encoding();
- lex_p += 2;
- lex_pbeg = lex_p;
- return;
- }
- break;
- case EOF:
- return;
- }
- pushback(c);
- parser->enc = rb_enc_get(lex_lastline);
+ rb_warning("ambiguous first argument; put parentheses or even spaces");
}
#define IS_ARG() (lex_state == EXPR_ARG || lex_state == EXPR_CMDARG)
-#define IS_BEG() (lex_state == EXPR_BEG || lex_state == EXPR_MID || lex_state == EXPR_VALUE || lex_state == EXPR_CLASS)
+#define IS_BEG() (lex_state == EXPR_BEG || lex_state == EXPR_MID || lex_state == EXPR_CLASS)
static int
-parser_yylex(struct parser_params *parser)
+yylex()
{
register int c;
int space_seen = 0;
int cmd_state;
- enum lex_state_e last_state;
- rb_encoding *enc;
- int mb;
-#ifdef RIPPER
- int fallthru = Qfalse;
-#endif
+ enum lex_state last_state;
if (lex_strterm) {
int token;
@@ -6367,34 +3477,13 @@ parser_yylex(struct parser_params *parser)
case ' ': case '\t': case '\f': case '\r':
case '\13': /* '\v' */
space_seen++;
-#ifdef RIPPER
- while ((c = nextc())) {
- switch (c) {
- case ' ': case '\t': case '\f': case '\r':
- case '\13': /* '\v' */
- break;
- default:
- goto outofloop;
- }
- }
- outofloop:
- pushback(c);
- ripper_dispatch_scan_event(parser, tSP);
-#endif
goto retry;
case '#': /* it's a comment */
- /* no magic_comment in shebang line */
- if (!parser_magic_comment(parser, lex_p, lex_pend - lex_p)) {
- if (comment_at_top(parser)) {
- set_file_encoding(parser, lex_p, lex_pend);
- }
+ while ((c = nextc()) != '\n') {
+ if (c == -1)
+ return 0;
}
- lex_p = lex_pend;
-#ifdef RIPPER
- ripper_dispatch_scan_event(parser, tCOMMENT);
- fallthru = Qtrue;
-#endif
/* fall through */
case '\n':
switch (lex_state) {
@@ -6402,44 +3491,10 @@ parser_yylex(struct parser_params *parser)
case EXPR_FNAME:
case EXPR_DOT:
case EXPR_CLASS:
- case EXPR_VALUE:
-#ifdef RIPPER
- if (!fallthru) {
- ripper_dispatch_scan_event(parser, tIGNORED_NL);
- }
- fallthru = Qfalse;
-#endif
goto retry;
default:
break;
}
- while ((c = nextc())) {
- switch (c) {
- case ' ': case '\t': case '\f': case '\r':
- case '\13': /* '\v' */
- space_seen++;
- break;
- case '.': {
- if ((c = nextc()) != '.') {
- pushback(c);
- pushback('.');
- goto retry;
- }
- }
- default:
- --ruby_sourceline;
- lex_nextline = lex_lastline;
- case -1: /* EOF no decrement*/
- lex_goto_eol(parser);
-#ifdef RIPPER
- if (c != -1) {
- parser->tokp = lex_p;
- }
-#endif
- goto normal_newline;
- }
- }
- normal_newline:
command_start = Qtrue;
lex_state = EXPR_BEG;
return '\n';
@@ -6447,7 +3502,7 @@ parser_yylex(struct parser_params *parser)
case '*':
if ((c = nextc()) == '*') {
if ((c = nextc()) == '=') {
- set_yylval_id(tPOW);
+ yylval.id = tPOW;
lex_state = EXPR_BEG;
return tOP_ASGN;
}
@@ -6456,13 +3511,13 @@ parser_yylex(struct parser_params *parser)
}
else {
if (c == '=') {
- set_yylval_id('*');
+ yylval.id = '*';
lex_state = EXPR_BEG;
return tOP_ASGN;
}
pushback(c);
- if (IS_ARG() && space_seen && !ISSPACE(c)) {
- rb_warning0("`*' interpreted as argument prefix");
+ if (IS_ARG() && space_seen && !ISSPACE(c)){
+ rb_warning("`*' interpreted as argument prefix");
c = tSTAR;
}
else if (IS_BEG()) {
@@ -6481,17 +3536,8 @@ parser_yylex(struct parser_params *parser)
return c;
case '!':
- c = nextc();
- if (lex_state == EXPR_FNAME || lex_state == EXPR_DOT) {
- lex_state = EXPR_ARG;
- if (c == '@') {
- return '!';
- }
- }
- else {
- lex_state = EXPR_BEG;
- }
- if (c == '=') {
+ lex_state = EXPR_BEG;
+ if ((c = nextc()) == '=') {
return tNEQ;
}
if (c == '~') {
@@ -6504,23 +3550,11 @@ parser_yylex(struct parser_params *parser)
if (was_bol()) {
/* skip embedded rd document */
if (strncmp(lex_p, "begin", 5) == 0 && ISSPACE(lex_p[5])) {
-#ifdef RIPPER
- int first_p = Qtrue;
-
- lex_goto_eol(parser);
- ripper_dispatch_scan_event(parser, tEMBDOC_BEG);
-#endif
for (;;) {
- lex_goto_eol(parser);
-#ifdef RIPPER
- if (!first_p) {
- ripper_dispatch_scan_event(parser, tEMBDOC);
- }
- first_p = Qfalse;
-#endif
+ lex_p = lex_pend;
c = nextc();
if (c == -1) {
- compile_error(PARSER_ARG "embedded document meets end of file");
+ rb_compile_error("embedded document meets end of file");
return 0;
}
if (c != '=') continue;
@@ -6529,10 +3563,7 @@ parser_yylex(struct parser_params *parser)
break;
}
}
- lex_goto_eol(parser);
-#ifdef RIPPER
- ripper_dispatch_scan_event(parser, tEMBDOC_END);
-#endif
+ lex_p = lex_pend;
goto retry;
}
}
@@ -6585,7 +3616,7 @@ parser_yylex(struct parser_params *parser)
}
if (c == '<') {
if ((c = nextc()) == '=') {
- set_yylval_id(tLSHFT);
+ yylval.id = tLSHFT;
lex_state = EXPR_BEG;
return tOP_ASGN;
}
@@ -6607,7 +3638,7 @@ parser_yylex(struct parser_params *parser)
}
if (c == '>') {
if ((c = nextc()) == '=') {
- set_yylval_id(tRSHFT);
+ yylval.id = tRSHFT;
lex_state = EXPR_BEG;
return tOP_ASGN;
}
@@ -6642,16 +3673,16 @@ parser_yylex(struct parser_params *parser)
case '?':
if (lex_state == EXPR_END || lex_state == EXPR_ENDARG) {
- lex_state = EXPR_VALUE;
+ lex_state = EXPR_BEG;
return '?';
}
c = nextc();
if (c == -1) {
- compile_error(PARSER_ARG "incomplete character syntax");
+ rb_compile_error("incomplete character syntax");
return 0;
}
- if (rb_enc_isspace(c, parser->enc)) {
- if (!IS_ARG()) {
+ if (ISSPACE(c)){
+ if (!IS_ARG()){
int c2 = 0;
switch (c) {
case ' ':
@@ -6674,52 +3705,34 @@ parser_yylex(struct parser_params *parser)
break;
}
if (c2) {
- rb_warnI("invalid character syntax; use ?\\%c", c2);
+ rb_warn("invalid character syntax; use ?\\%c", c2);
}
}
ternary:
pushback(c);
- lex_state = EXPR_VALUE;
+ lex_state = EXPR_BEG;
return '?';
}
- newtok();
- enc = parser->enc;
- if (!parser_isascii()) {
- if (tokadd_mbchar(c) == -1) return 0;
+ else if (ismbchar(c)) {
+ rb_warn("multibyte character literal not supported yet; use ?\\%.3o", c);
+ goto ternary;
}
- else if ((rb_enc_isalnum(c, parser->enc) || c == '_') &&
- lex_p < lex_pend && is_identchar(lex_p, lex_pend, parser->enc)) {
+ else if ((ISALNUM(c) || c == '_') && lex_p < lex_pend && is_identchar(*lex_p)) {
goto ternary;
}
- else if (c == '\\') {
- if (peek('u')) {
- nextc();
- c = parser_tokadd_utf8(parser, &enc, 0, 0, 0);
- if (0x80 <= c) {
- tokaddmbc(c, enc);
- }
- else {
- tokadd(c);
- }
- }
- else {
- c = read_escape(0, &enc);
- tokadd(c);
- }
- }
- else {
- tokadd(c);
- }
- tokfix();
- set_yylval_str(STR_NEW3(tok(), toklen(), enc, 0));
+ else if (c == '\\') {
+ c = read_escape();
+ }
+ c &= 0xff;
lex_state = EXPR_END;
- return tCHAR;
+ yylval.node = NEW_LIT(INT2FIX(c));
+ return tINTEGER;
case '&':
if ((c = nextc()) == '&') {
lex_state = EXPR_BEG;
if ((c = nextc()) == '=') {
- set_yylval_id(tANDOP);
+ yylval.id = tANDOP;
lex_state = EXPR_BEG;
return tOP_ASGN;
}
@@ -6727,13 +3740,13 @@ parser_yylex(struct parser_params *parser)
return tANDOP;
}
else if (c == '=') {
- set_yylval_id('&');
+ yylval.id = '&';
lex_state = EXPR_BEG;
return tOP_ASGN;
}
pushback(c);
- if (IS_ARG() && space_seen && !ISSPACE(c)) {
- rb_warning0("`&' interpreted as argument prefix");
+ if (IS_ARG() && space_seen && !ISSPACE(c)){
+ rb_warning("`&' interpreted as argument prefix");
c = tAMPER;
}
else if (IS_BEG()) {
@@ -6754,7 +3767,7 @@ parser_yylex(struct parser_params *parser)
if ((c = nextc()) == '|') {
lex_state = EXPR_BEG;
if ((c = nextc()) == '=') {
- set_yylval_id(tOROP);
+ yylval.id = tOROP;
lex_state = EXPR_BEG;
return tOP_ASGN;
}
@@ -6762,7 +3775,7 @@ parser_yylex(struct parser_params *parser)
return tOROP;
}
if (c == '=') {
- set_yylval_id('|');
+ yylval.id = '|';
lex_state = EXPR_BEG;
return tOP_ASGN;
}
@@ -6786,7 +3799,7 @@ parser_yylex(struct parser_params *parser)
return '+';
}
if (c == '=') {
- set_yylval_id('+');
+ yylval.id = '+';
lex_state = EXPR_BEG;
return tOP_ASGN;
}
@@ -6795,7 +3808,7 @@ parser_yylex(struct parser_params *parser)
if (IS_ARG()) arg_ambiguous();
lex_state = EXPR_BEG;
pushback(c);
- if (c != -1 && ISDIGIT(c)) {
+ if (ISDIGIT(c)) {
c = '+';
goto start_num;
}
@@ -6816,20 +3829,16 @@ parser_yylex(struct parser_params *parser)
return '-';
}
if (c == '=') {
- set_yylval_id('-');
+ yylval.id = '-';
lex_state = EXPR_BEG;
return tOP_ASGN;
}
- if (c == '>') {
- lex_state = EXPR_ARG;
- return tLAMBDA;
- }
if (IS_BEG() ||
(IS_ARG() && space_seen && !ISSPACE(c))) {
if (IS_ARG()) arg_ambiguous();
lex_state = EXPR_BEG;
pushback(c);
- if (c != -1 && ISDIGIT(c)) {
+ if (ISDIGIT(c)) {
return tUMINUS_NUM;
}
return tUMINUS;
@@ -6848,7 +3857,7 @@ parser_yylex(struct parser_params *parser)
return tDOT2;
}
pushback(c);
- if (c != -1 && ISDIGIT(c)) {
+ if (ISDIGIT(c)) {
yyerror("no .<digit> floating literal anymore; put 0 before dot");
}
lex_state = EXPR_DOT;
@@ -6873,7 +3882,7 @@ parser_yylex(struct parser_params *parser)
if (c == 'x' || c == 'X') {
/* hexadecimal */
c = nextc();
- if (c != -1 && ISXDIGIT(c)) {
+ if (ISXDIGIT(c)) {
do {
if (c == '_') {
if (nondigit) break;
@@ -6891,7 +3900,7 @@ parser_yylex(struct parser_params *parser)
yyerror("numeric literal without digits");
}
else if (nondigit) goto trailing_uc;
- set_yylval_literal(rb_cstr_to_inum(tok(), 16, Qfalse));
+ yylval.node = NEW_LIT(rb_cstr_to_inum(tok(), 16, Qfalse));
return tINTEGER;
}
if (c == 'b' || c == 'B') {
@@ -6915,13 +3924,13 @@ parser_yylex(struct parser_params *parser)
yyerror("numeric literal without digits");
}
else if (nondigit) goto trailing_uc;
- set_yylval_literal(rb_cstr_to_inum(tok(), 2, Qfalse));
+ yylval.node = NEW_LIT(rb_cstr_to_inum(tok(), 2, Qfalse));
return tINTEGER;
}
if (c == 'd' || c == 'D') {
/* decimal */
c = nextc();
- if (c != -1 && ISDIGIT(c)) {
+ if (ISDIGIT(c)) {
do {
if (c == '_') {
if (nondigit) break;
@@ -6939,7 +3948,7 @@ parser_yylex(struct parser_params *parser)
yyerror("numeric literal without digits");
}
else if (nondigit) goto trailing_uc;
- set_yylval_literal(rb_cstr_to_inum(tok(), 10, Qfalse));
+ yylval.node = NEW_LIT(rb_cstr_to_inum(tok(), 10, Qfalse));
return tINTEGER;
}
if (c == '_') {
@@ -6949,7 +3958,7 @@ parser_yylex(struct parser_params *parser)
if (c == 'o' || c == 'O') {
/* prefixed octal */
c = nextc();
- if (c == -1 || c == '_' || !ISDIGIT(c)) {
+ if (c == '_') {
yyerror("numeric literal without digits");
}
}
@@ -6971,7 +3980,7 @@ parser_yylex(struct parser_params *parser)
pushback(c);
tokfix();
if (nondigit) goto trailing_uc;
- set_yylval_literal(rb_cstr_to_inum(tok(), 8, Qfalse));
+ yylval.node = NEW_LIT(rb_cstr_to_inum(tok(), 8, Qfalse));
return tINTEGER;
}
if (nondigit) {
@@ -6981,14 +3990,14 @@ parser_yylex(struct parser_params *parser)
}
if (c > '7' && c <= '9') {
invalid_octal:
- yyerror("Invalid octal digit");
+ yyerror("Illegal octal digit");
}
else if (c == '.' || c == 'e' || c == 'E') {
tokadd('0');
}
else {
pushback(c);
- set_yylval_literal(INT2FIX(0));
+ yylval.node = NEW_LIT(INT2FIX(0));
return tINTEGER;
}
}
@@ -7008,7 +4017,7 @@ parser_yylex(struct parser_params *parser)
}
else {
int c0 = nextc();
- if (c0 == -1 || !ISDIGIT(c0)) {
+ if (!ISDIGIT(c0)) {
pushback(c0);
goto decode_num;
}
@@ -7058,46 +4067,41 @@ parser_yylex(struct parser_params *parser)
if (nondigit) {
char tmp[30];
trailing_uc:
- snprintf(tmp, sizeof(tmp), "trailing `%c' in number", nondigit);
+ sprintf(tmp, "trailing `%c' in number", nondigit);
yyerror(tmp);
}
if (is_float) {
double d = strtod(tok(), 0);
if (errno == ERANGE) {
- rb_warningS("Float %s out of range", tok());
+ rb_warn("Float %s out of range", tok());
errno = 0;
}
- set_yylval_literal(DBL2NUM(d));
+ yylval.node = NEW_LIT(rb_float_new(d));
return tFLOAT;
}
- set_yylval_literal(rb_cstr_to_inum(tok(), 10, Qfalse));
+ yylval.node = NEW_LIT(rb_cstr_to_inum(tok(), 10, Qfalse));
return tINTEGER;
}
- case ')':
case ']':
- paren_nest--;
case '}':
+ case ')':
COND_LEXPOP();
CMDARG_LEXPOP();
- if (c == ')')
- lex_state = EXPR_END;
- else
- lex_state = EXPR_ENDARG;
+ lex_state = EXPR_END;
return c;
case ':':
c = nextc();
if (c == ':') {
- if (IS_BEG() ||
- lex_state == EXPR_CLASS || (IS_ARG() && space_seen)) {
+ if (IS_BEG() || (IS_ARG() && space_seen)) {
lex_state = EXPR_BEG;
return tCOLON3;
}
lex_state = EXPR_DOT;
return tCOLON2;
}
- if (lex_state == EXPR_END || lex_state == EXPR_ENDARG || (c != -1 && ISSPACE(c))) {
+ if (lex_state == EXPR_END || lex_state == EXPR_ENDARG || ISSPACE(c)) {
pushback(c);
lex_state = EXPR_BEG;
return ':';
@@ -7122,7 +4126,7 @@ parser_yylex(struct parser_params *parser)
return tREGEXP_BEG;
}
if ((c = nextc()) == '=') {
- set_yylval_id('/');
+ yylval.id = '/';
lex_state = EXPR_BEG;
return tOP_ASGN;
}
@@ -7144,7 +4148,7 @@ parser_yylex(struct parser_params *parser)
case '^':
if ((c = nextc()) == '=') {
- set_yylval_id('^');
+ yylval.id = '^';
lex_state = EXPR_BEG;
return tOP_ASGN;
}
@@ -7158,43 +4162,45 @@ parser_yylex(struct parser_params *parser)
return '^';
case ';':
- lex_state = EXPR_BEG;
command_start = Qtrue;
- return ';';
-
case ',':
lex_state = EXPR_BEG;
- return ',';
+ return c;
case '~':
if (lex_state == EXPR_FNAME || lex_state == EXPR_DOT) {
if ((c = nextc()) != '@') {
pushback(c);
}
- lex_state = EXPR_ARG;
}
- else {
- lex_state = EXPR_BEG;
+ switch (lex_state) {
+ case EXPR_FNAME: case EXPR_DOT:
+ lex_state = EXPR_ARG; break;
+ default:
+ lex_state = EXPR_BEG; break;
}
return '~';
case '(':
+ command_start = Qtrue;
if (IS_BEG()) {
c = tLPAREN;
}
else if (space_seen) {
- if (IS_ARG()) {
+ if (lex_state == EXPR_CMDARG) {
c = tLPAREN_ARG;
}
+ else if (lex_state == EXPR_ARG) {
+ rb_warn("don't put space before argument parentheses");
+ c = '(';
+ }
}
- paren_nest++;
COND_PUSH(0);
CMDARG_PUSH(0);
lex_state = EXPR_BEG;
return c;
case '[':
- paren_nest++;
if (lex_state == EXPR_FNAME || lex_state == EXPR_DOT) {
lex_state = EXPR_ARG;
if ((c = nextc()) == ']') {
@@ -7219,12 +4225,6 @@ parser_yylex(struct parser_params *parser)
return c;
case '{':
- if (lpar_beg && lpar_beg == paren_nest) {
- lex_state = EXPR_BEG;
- lpar_beg = 0;
- --paren_nest;
- return tLAMBEG;
- }
if (IS_ARG() || lex_state == EXPR_END)
c = '{'; /* block (primary) */
else if (lex_state == EXPR_ENDARG)
@@ -7241,9 +4241,6 @@ parser_yylex(struct parser_params *parser)
c = nextc();
if (c == '\n') {
space_seen = 1;
-#ifdef RIPPER
- ripper_dispatch_scan_event(parser, tSP);
-#endif
goto retry; /* skip \\n */
}
pushback(c);
@@ -7256,19 +4253,19 @@ parser_yylex(struct parser_params *parser)
c = nextc();
quotation:
- if (c == -1 || !ISALNUM(c)) {
+ if (!ISALNUM(c)) {
term = c;
c = 'Q';
}
else {
term = nextc();
- if (rb_enc_isalnum(term, parser->enc) || !parser_isascii()) {
+ if (ISALNUM(term) || ismbchar(term)) {
yyerror("unknown type of %string");
return 0;
}
}
if (c == -1 || term == -1) {
- compile_error(PARSER_ARG "unterminated quoted string meets end of file");
+ rb_compile_error("unterminated quoted string meets end of file");
return 0;
}
paren = term;
@@ -7318,7 +4315,7 @@ parser_yylex(struct parser_params *parser)
}
}
if ((c = nextc()) == '=') {
- set_yylval_id('%');
+ yylval.id = '%';
lex_state = EXPR_BEG;
return tOP_ASGN;
}
@@ -7342,7 +4339,7 @@ parser_yylex(struct parser_params *parser)
switch (c) {
case '_': /* $_: last read line string */
c = nextc();
- if (parser_is_identchar()) {
+ if (is_identchar(c)) {
tokadd('$');
tokadd('_');
break;
@@ -7351,6 +4348,8 @@ parser_yylex(struct parser_params *parser)
c = '_';
/* fall through */
case '~': /* $~: match-data */
+ local_cnt(c);
+ /* fall through */
case '*': /* $*: argv */
case '$': /* $$: pid */
case '?': /* $?: last status */
@@ -7369,22 +4368,23 @@ parser_yylex(struct parser_params *parser)
tokadd('$');
tokadd(c);
tokfix();
- set_yylval_id(rb_intern(tok()));
+ yylval.id = rb_intern(tok());
return tGVAR;
case '-':
tokadd('$');
tokadd(c);
c = nextc();
- if (parser_is_identchar()) {
- if (tokadd_mbchar(c) == -1) return 0;
+ if (is_identchar(c)) {
+ tokadd(c);
}
else {
pushback(c);
}
gvar:
tokfix();
- set_yylval_id(rb_intern(tok()));
+ yylval.id = rb_intern(tok());
+ /* xxx shouldn't check if valid option variable */
return tGVAR;
case '&': /* $&: last match */
@@ -7396,7 +4396,7 @@ parser_yylex(struct parser_params *parser)
tokadd(c);
goto gvar;
}
- set_yylval_node(NEW_BACK_REF(c));
+ yylval.node = NEW_BACK_REF(c);
return tBACK_REF;
case '1': case '2': case '3':
@@ -7406,15 +4406,15 @@ parser_yylex(struct parser_params *parser)
do {
tokadd(c);
c = nextc();
- } while (c != -1 && ISDIGIT(c));
+ } while (ISDIGIT(c));
pushback(c);
if (last_state == EXPR_FNAME) goto gvar;
tokfix();
- set_yylval_node(NEW_NTH_REF(atoi(tok()+1)));
+ yylval.node = NEW_NTH_REF(atoi(tok()+1));
return tNTH_REF;
default:
- if (!parser_is_identchar()) {
+ if (!is_identchar(c)) {
pushback(c);
return '$';
}
@@ -7431,16 +4431,16 @@ parser_yylex(struct parser_params *parser)
tokadd('@');
c = nextc();
}
- if (c != -1 && ISDIGIT(c)) {
+ if (ISDIGIT(c)) {
if (tokidx == 1) {
- compile_error(PARSER_ARG "`@%c' is not allowed as an instance variable name", c);
+ rb_compile_error("`@%c' is not allowed as an instance variable name", c);
}
else {
- compile_error(PARSER_ARG "`@@%c' is not allowed as a class variable name", c);
+ rb_compile_error("`@@%c' is not allowed as a class variable name", c);
}
return 0;
}
- if (!parser_is_identchar()) {
+ if (!is_identchar(c)) {
pushback(c);
return '@';
}
@@ -7449,21 +4449,15 @@ parser_yylex(struct parser_params *parser)
case '_':
if (was_bol() && whole_match_p("__END__", 7, 0)) {
ruby__end__seen = 1;
- parser->eofp = Qtrue;
-#ifndef RIPPER
+ lex_lastline = 0;
return -1;
-#else
- lex_goto_eol(parser);
- ripper_dispatch_scan_event(parser, k__END__);
- return 0;
-#endif
}
newtok();
break;
default:
- if (!parser_is_identchar()) {
- rb_compile_error(PARSER_ARG "Invalid char `\\x%02X' in expression", c);
+ if (!is_identchar(c)) {
+ rb_compile_error("Invalid char `\\%03o' in expression", c);
goto retry;
}
@@ -7471,23 +4465,23 @@ parser_yylex(struct parser_params *parser)
break;
}
- mb = ENC_CODERANGE_7BIT;
do {
- if (!ISASCII(c)) mb = ENC_CODERANGE_UNKNOWN;
- if (tokadd_mbchar(c) == -1) return 0;
+ tokadd(c);
+ if (ismbchar(c)) {
+ int i, len = mbclen(c)-1;
+
+ for (i = 0; i < len; i++) {
+ c = nextc();
+ tokadd(c);
+ }
+ }
c = nextc();
- } while (parser_is_identchar());
- switch (tok()[0]) {
- case '@': case '$':
+ } while (is_identchar(c));
+ if ((c == '!' || c == '?') && is_identchar(tok()[0]) && !peek('=')) {
+ tokadd(c);
+ }
+ else {
pushback(c);
- break;
- default:
- if ((c == '!' || c == '?') && !peek('=')) {
- tokadd(c);
- }
- else {
- pushback(c);
- }
}
tokfix();
@@ -7532,43 +4526,28 @@ parser_yylex(struct parser_params *parser)
}
}
- if ((lex_state == EXPR_BEG && !cmd_state) ||
- lex_state == EXPR_ARG ||
- lex_state == EXPR_CMDARG) {
- if (peek(':') && !(lex_p + 1 < lex_pend && lex_p[1] == ':')) {
- lex_state = EXPR_BEG;
- nextc();
- set_yylval_id(TOK_INTERN(!ENC_SINGLE(mb)));
- return tLABEL;
- }
- }
- if (mb == ENC_CODERANGE_7BIT && lex_state != EXPR_DOT) {
+ if (lex_state != EXPR_DOT) {
const struct kwtable *kw;
/* See if it is a reserved word. */
kw = rb_reserved_word(tok(), toklen());
if (kw) {
- enum lex_state_e state = lex_state;
+ enum lex_state state = lex_state;
lex_state = kw->state;
if (state == EXPR_FNAME) {
- set_yylval_id(rb_intern(kw->name));
+ yylval.id = rb_intern(kw->name);
return kw->id[0];
}
- if (kw->id[0] == keyword_do) {
+ if (kw->id[0] == kDO) {
command_start = Qtrue;
- if (lpar_beg && lpar_beg == paren_nest) {
- lpar_beg = 0;
- --paren_nest;
- return keyword_do_LAMBDA;
- }
- if (COND_P()) return keyword_do_cond;
+ if (COND_P()) return kDO_COND;
if (CMDARG_P() && state != EXPR_CMDARG)
- return keyword_do_block;
- if (state == EXPR_ENDARG || state == EXPR_BEG)
- return keyword_do_block;
- return keyword_do;
+ return kDO_BLOCK;
+ if (state == EXPR_ENDARG)
+ return kDO_BLOCK;
+ return kDO;
}
- if (state == EXPR_BEG || state == EXPR_VALUE)
+ if (state == EXPR_BEG)
return kw->id[0];
else {
if (kw->id[0] != kw->id[1])
@@ -7578,9 +4557,12 @@ parser_yylex(struct parser_params *parser)
}
}
- if (IS_BEG() ||
+ if (lex_state == EXPR_BEG ||
+ lex_state == EXPR_MID ||
lex_state == EXPR_DOT ||
- IS_ARG()) {
+ lex_state == EXPR_ARG ||
+ lex_state == EXPR_CLASS ||
+ lex_state == EXPR_CMDARG) {
if (cmd_state) {
lex_state = EXPR_CMDARG;
}
@@ -7592,114 +4574,115 @@ parser_yylex(struct parser_params *parser)
lex_state = EXPR_END;
}
}
- {
- ID ident = TOK_INTERN(!ENC_SINGLE(mb));
-
- set_yylval_id(ident);
- if (last_state != EXPR_DOT && is_local_id(ident) && lvar_defined(ident)) {
- lex_state = EXPR_END;
- }
- }
+ yylval.id = rb_intern(tok());
+ if (is_local_id(yylval.id) &&
+ last_state != EXPR_DOT &&
+ ((dyna_in_block() && rb_dvar_defined(yylval.id)) || local_id(yylval.id))) {
+ lex_state = EXPR_END;
+ }
return result;
}
}
-#if YYPURE
-static int
-yylex(void *lval, void *p)
-#else
-yylex(void *p)
-#endif
+NODE*
+rb_node_newnode(type, a0, a1, a2)
+ enum node_type type;
+ VALUE a0, a1, a2;
{
- struct parser_params *parser = (struct parser_params*)p;
- int t;
+ NODE *n = (NODE*)rb_newobj();
-#if YYPURE
- parser->parser_yylval = lval;
- parser->parser_yylval->val = Qundef;
-#endif
- t = parser_yylex(parser);
-#ifdef RIPPER
- if (!NIL_P(parser->delayed)) {
- ripper_dispatch_delayed_token(parser, t);
- return t;
- }
- if (t != 0)
- ripper_dispatch_scan_event(parser, t);
-#endif
+ n->flags |= T_NODE;
+ nd_set_type(n, type);
+ nd_set_line(n, ruby_sourceline);
+ n->nd_file = ruby_sourcefile;
- return t;
-}
+ n->u1.value = a0;
+ n->u2.value = a1;
+ n->u3.value = a2;
-#ifndef RIPPER
-static NODE*
-node_newnode(struct parser_params *parser, enum node_type type, VALUE a0, VALUE a1, VALUE a2)
-{
- NODE *n = (rb_node_newnode)(type, a0, a1, a2);
- nd_set_line(n, ruby_sourceline);
return n;
}
-enum node_type
-nodetype(NODE *node) /* for debug */
+static enum node_type
+nodetype(node) /* for debug */
+ NODE *node;
{
return (enum node_type)nd_type(node);
}
-int
-nodeline(NODE *node)
+static int
+nodeline(node)
+ NODE *node;
{
return nd_line(node);
}
static NODE*
-newline_node(NODE *node)
+newline_node(node)
+ NODE *node;
{
+ NODE *nl = 0;
if (node) {
+ int line;
+ if (nd_type(node) == NODE_NEWLINE) return node;
+ line = nd_line(node);
node = remove_begin(node);
- node->flags |= NODE_FL_NEWLINE;
+ nl = NEW_NEWLINE(node);
+ nd_set_line(nl, line);
+ nl->nd_nth = line;
}
- return node;
+ return nl;
}
static void
-fixpos(NODE *node, NODE *orig)
+fixpos(node, orig)
+ NODE *node, *orig;
{
if (!node) return;
if (!orig) return;
if (orig == (NODE*)1) return;
+ node->nd_file = orig->nd_file;
nd_set_line(node, nd_line(orig));
}
static void
-parser_warning(struct parser_params *parser, NODE *node, const char *mesg)
+parser_warning(node, mesg)
+ NODE *node;
+ const char *mesg;
{
- rb_compile_warning(ruby_sourcefile, nd_line(node), "%s", mesg);
+ int line = ruby_sourceline;
+ ruby_sourceline = nd_line(node);
+ rb_warning("%s", mesg);
+ ruby_sourceline = line;
}
-#define parser_warning(node, mesg) parser_warning(parser, node, mesg)
static void
-parser_warn(struct parser_params *parser, NODE *node, const char *mesg)
+parser_warn(node, mesg)
+ NODE *node;
+ const char *mesg;
{
- rb_compile_warn(ruby_sourcefile, nd_line(node), "%s", mesg);
+ int line = ruby_sourceline;
+ ruby_sourceline = nd_line(node);
+ rb_warn("%s", mesg);
+ ruby_sourceline = line;
}
-#define parser_warn(node, mesg) parser_warn(parser, node, mesg)
static NODE*
-block_append_gen(struct parser_params *parser, NODE *head, NODE *tail)
+block_append(head, tail)
+ NODE *head, *tail;
{
- NODE *end, *h = head, *nd;
+ NODE *end, *h = head;
if (tail == 0) return head;
+ again:
if (h == 0) return tail;
switch (nd_type(h)) {
+ case NODE_NEWLINE:
+ h = h->nd_next;
+ goto again;
case NODE_LIT:
case NODE_STR:
- case NODE_SELF:
- case NODE_TRUE:
- case NODE_FALSE:
- case NODE_NIL:
parser_warning(h, "unused literal ignored");
return tail;
default:
@@ -7713,20 +4696,25 @@ block_append_gen(struct parser_params *parser, NODE *head, NODE *tail)
break;
}
- nd = end->nd_head;
- switch (nd_type(nd)) {
- case NODE_RETURN:
- case NODE_BREAK:
- case NODE_NEXT:
- case NODE_REDO:
- case NODE_RETRY:
- if (RTEST(ruby_verbose)) {
+ if (RTEST(ruby_verbose)) {
+ NODE *nd = end->nd_head;
+ newline:
+ switch (nd_type(nd)) {
+ case NODE_RETURN:
+ case NODE_BREAK:
+ case NODE_NEXT:
+ case NODE_REDO:
+ case NODE_RETRY:
parser_warning(nd, "statement not reached");
- }
- break;
+ break;
- default:
- break;
+ case NODE_NEWLINE:
+ nd = nd->nd_next;
+ goto newline;
+
+ default:
+ break;
+ }
}
if (nd_type(tail) != NODE_BLOCK) {
@@ -7740,7 +4728,8 @@ block_append_gen(struct parser_params *parser, NODE *head, NODE *tail)
/* append item to the list */
static NODE*
-list_append_gen(struct parser_params *parser, NODE *list, NODE *item)
+list_append(list, item)
+ NODE *list, *item;
{
NODE *last;
@@ -7760,7 +4749,8 @@ list_append_gen(struct parser_params *parser, NODE *list, NODE *item)
/* concat two lists */
static NODE*
-list_concat_gen(struct parser_params *parser, NODE *head, NODE *tail)
+list_concat(head, tail)
+ NODE *head, *tail;
{
NODE *last;
@@ -7783,24 +4773,10 @@ list_concat_gen(struct parser_params *parser, NODE *head, NODE *tail)
return head;
}
-static int
-literal_concat0(struct parser_params *parser, VALUE head, VALUE tail)
-{
- if (!rb_enc_compatible(head, tail)) {
- compile_error(PARSER_ARG "string literal encodings differ (%s / %s)",
- rb_enc_name(rb_enc_get(head)),
- rb_enc_name(rb_enc_get(tail)));
- rb_str_resize(head, 0);
- rb_str_resize(tail, 0);
- return 0;
- }
- rb_str_buf_append(head, tail);
- return 1;
-}
-
/* concat two string literals */
static NODE *
-literal_concat_gen(struct parser_params *parser, NODE *head, NODE *tail)
+literal_concat(head, tail)
+ NODE *head, *tail;
{
enum node_type htype;
@@ -7809,18 +4785,13 @@ literal_concat_gen(struct parser_params *parser, NODE *head, NODE *tail)
htype = nd_type(head);
if (htype == NODE_EVSTR) {
- NODE *node = NEW_DSTR(STR_NEW0());
+ NODE *node = NEW_DSTR(rb_str_new(0, 0));
head = list_append(node, head);
}
switch (nd_type(tail)) {
case NODE_STR:
if (htype == NODE_STR) {
- if (!literal_concat0(parser, head->nd_lit, tail->nd_lit)) {
- error:
- rb_gc_force_recycle((VALUE)head);
- rb_gc_force_recycle((VALUE)tail);
- return 0;
- }
+ rb_str_concat(head->nd_lit, tail->nd_lit);
rb_gc_force_recycle((VALUE)tail);
}
else {
@@ -7830,8 +4801,7 @@ literal_concat_gen(struct parser_params *parser, NODE *head, NODE *tail)
case NODE_DSTR:
if (htype == NODE_STR) {
- if (!literal_concat0(parser, head->nd_lit, tail->nd_lit))
- goto error;
+ rb_str_concat(head->nd_lit, tail->nd_lit);
tail->nd_lit = head->nd_lit;
rb_gc_force_recycle((VALUE)head);
head = tail;
@@ -7855,46 +4825,59 @@ literal_concat_gen(struct parser_params *parser, NODE *head, NODE *tail)
}
static NODE *
-evstr2dstr_gen(struct parser_params *parser, NODE *node)
+evstr2dstr(node)
+ NODE *node;
{
if (nd_type(node) == NODE_EVSTR) {
- node = list_append(NEW_DSTR(STR_NEW0()), node);
+ node = list_append(NEW_DSTR(rb_str_new(0, 0)), node);
}
return node;
}
static NODE *
-new_evstr_gen(struct parser_params *parser, NODE *node)
+new_evstr(node)
+ NODE *node;
{
NODE *head = node;
+ again:
if (node) {
switch (nd_type(node)) {
case NODE_STR: case NODE_DSTR: case NODE_EVSTR:
return node;
+ case NODE_NEWLINE:
+ node = node->nd_next;
+ goto again;
}
}
return NEW_EVSTR(head);
}
static NODE *
-call_bin_op_gen(struct parser_params *parser, NODE *recv, ID id, NODE *arg1)
-{
- value_expr(recv);
- value_expr(arg1);
- return NEW_CALL(recv, id, NEW_LIST(arg1));
-}
-
-static NODE *
-call_uni_op_gen(struct parser_params *parser, NODE *recv, ID id)
+call_op(recv, id, narg, arg1)
+ NODE *recv;
+ ID id;
+ int narg;
+ NODE *arg1;
{
value_expr(recv);
- return NEW_CALL(recv, id, 0);
+ if (narg == 1) {
+ value_expr(arg1);
+ arg1 = NEW_LIST(arg1);
+ }
+ else {
+ arg1 = 0;
+ }
+ return NEW_CALL(recv, id, arg1);
}
static NODE*
-match_op_gen(struct parser_params *parser, NODE *node1, NODE *node2)
+match_gen(node1, node2)
+ NODE *node1;
+ NODE *node2;
{
+ local_cnt('~');
+
value_expr(node1);
value_expr(node2);
if (node1) {
@@ -7927,34 +4910,36 @@ match_op_gen(struct parser_params *parser, NODE *node1, NODE *node2)
}
static NODE*
-gettable_gen(struct parser_params *parser, ID id)
+gettable(id)
+ ID id;
{
- if (id == keyword_self) {
+ if (id == kSELF) {
return NEW_SELF();
}
- else if (id == keyword_nil) {
+ else if (id == kNIL) {
return NEW_NIL();
}
- else if (id == keyword_true) {
+ else if (id == kTRUE) {
return NEW_TRUE();
}
- else if (id == keyword_false) {
+ else if (id == kFALSE) {
return NEW_FALSE();
}
- else if (id == keyword__FILE__) {
- return NEW_STR(rb_external_str_new_with_enc(ruby_sourcefile, strlen(ruby_sourcefile),
- rb_filesystem_encoding()));
+ else if (id == k__FILE__) {
+ return NEW_STR(rb_str_new2(ruby_sourcefile));
}
- else if (id == keyword__LINE__) {
+ else if (id == k__LINE__) {
return NEW_LIT(INT2FIX(ruby_sourceline));
}
- else if (id == keyword__ENCODING__) {
- return NEW_LIT(rb_enc_from_encoding(parser->enc));
- }
else if (is_local_id(id)) {
- if (dyna_in_block() && dvar_defined(id)) return NEW_DVAR(id);
+ if (dyna_in_block() && rb_dvar_defined(id)) return NEW_DVAR(id);
if (local_id(id)) return NEW_LVAR(id);
/* method call without arguments */
+#if 0
+ /* Rite will warn this */
+ rb_warn("ambiguous identifier; %s() or self.%s is better for method call",
+ rb_id2name(id), rb_id2name(id));
+#endif
return NEW_VCALL(id);
}
else if (is_global_id(id)) {
@@ -7969,57 +4954,50 @@ gettable_gen(struct parser_params *parser, ID id)
else if (is_class_id(id)) {
return NEW_CVAR(id);
}
- compile_error(PARSER_ARG "identifier %s is not valid to get", rb_id2name(id));
+ rb_compile_error("identifier %s is not valid", rb_id2name(id));
return 0;
}
+static VALUE dyna_var_lookup _((ID id));
+
static NODE*
-assignable_gen(struct parser_params *parser, ID id, NODE *val)
+assignable(id, val)
+ ID id;
+ NODE *val;
{
- if (!id) return 0;
- if (id == keyword_self) {
+ value_expr(val);
+ if (id == kSELF) {
yyerror("Can't change the value of self");
}
- else if (id == keyword_nil) {
+ else if (id == kNIL) {
yyerror("Can't assign to nil");
}
- else if (id == keyword_true) {
+ else if (id == kTRUE) {
yyerror("Can't assign to true");
}
- else if (id == keyword_false) {
+ else if (id == kFALSE) {
yyerror("Can't assign to false");
}
- else if (id == keyword__FILE__) {
+ else if (id == k__FILE__) {
yyerror("Can't assign to __FILE__");
}
- else if (id == keyword__LINE__) {
+ else if (id == k__LINE__) {
yyerror("Can't assign to __LINE__");
}
- else if (id == keyword__ENCODING__) {
- yyerror("Can't assign to __ENCODING__");
- }
else if (is_local_id(id)) {
- if (dyna_in_block()) {
- if (dvar_curr(id)) {
- return NEW_DASGN_CURR(id, val);
- }
- else if (dvar_defined(id)) {
- return NEW_DASGN(id, val);
- }
- else if (local_id(id)) {
- return NEW_LASGN(id, val);
- }
- else{
- dyna_var(id);
- return NEW_DASGN_CURR(id, val);
- }
+ if (rb_dvar_curr(id)) {
+ return NEW_DASGN_CURR(id, val);
}
- else {
- if (!local_id(id)) {
- local_var(id);
- }
+ else if (dyna_var_lookup(id)) {
+ return NEW_DASGN(id, val);
+ }
+ else if (local_id(id) || !dyna_in_block()) {
return NEW_LASGN(id, val);
}
+ else{
+ rb_dvar_push(id, Qnil);
+ return NEW_DASGN_CURR(id, val);
+ }
}
else if (is_global_id(id)) {
return NEW_GASGN(id, val);
@@ -8033,68 +5011,29 @@ assignable_gen(struct parser_params *parser, ID id, NODE *val)
return NEW_CDECL(id, val, 0);
}
else if (is_class_id(id)) {
- return NEW_CVASGN(id, val);
+ if (in_def || in_single) return NEW_CVASGN(id, val);
+ return NEW_CVDECL(id, val);
}
else {
- compile_error(PARSER_ARG "identifier %s is not valid to set", rb_id2name(id));
+ rb_compile_error("identifier %s is not valid", rb_id2name(id));
}
return 0;
}
-static void
-shadowing_lvar_gen(struct parser_params *parser, ID name)
-{
- ID uscore;
-
- CONST_ID(uscore, "_");
- if (uscore == name) return;
- if (dyna_in_block()) {
- if (dvar_curr(name)) {
- yyerror("duplicated argument name");
- }
- else if (dvar_defined(name) || local_id(name)) {
- rb_warningS("shadowing outer local variable - %s", rb_id2name(name));
- vtable_add(lvtbl->vars, name);
- }
- }
- else {
- if (local_id(name)) {
- yyerror("duplicated argument name");
- }
- }
-}
-
-static void
-new_bv_gen(struct parser_params *parser, ID name)
-{
- if (!name) return;
- if (!is_local_id(name)) {
- compile_error(PARSER_ARG "invalid local variable - %s",
- rb_id2name(name));
- return;
- }
- shadowing_lvar(name);
- dyna_var(name);
-}
-
static NODE *
-aryset_gen(struct parser_params *parser, NODE *recv, NODE *idx)
+aryset(recv, idx)
+ NODE *recv, *idx;
{
if (recv && nd_type(recv) == NODE_SELF)
recv = (NODE *)1;
+ else
+ value_expr(recv);
return NEW_ATTRASGN(recv, tASET, idx);
}
-static void
-block_dup_check_gen(struct parser_params *parser, NODE *node1, NODE *node2)
-{
- if (node2 && node1 && nd_type(node1) == NODE_BLOCK_PASS) {
- compile_error(PARSER_ARG "both block arg and actual block given");
- }
-}
-
ID
-rb_id_attrset(ID id)
+rb_id_attrset(id)
+ ID id;
{
id &= ~ID_SCOPE_MASK;
id |= ID_ATTRSET;
@@ -8102,95 +5041,77 @@ rb_id_attrset(ID id)
}
static NODE *
-attrset_gen(struct parser_params *parser, NODE *recv, ID id)
+attrset(recv, id)
+ NODE *recv;
+ ID id;
{
if (recv && nd_type(recv) == NODE_SELF)
recv = (NODE *)1;
+ else
+ value_expr(recv);
return NEW_ATTRASGN(recv, rb_id_attrset(id), 0);
}
static void
-rb_backref_error_gen(struct parser_params *parser, NODE *node)
+rb_backref_error(node)
+ NODE *node;
{
switch (nd_type(node)) {
case NODE_NTH_REF:
- compile_error(PARSER_ARG "Can't set variable $%ld", node->nd_nth);
+ rb_compile_error("Can't set variable $%d", node->nd_nth);
break;
case NODE_BACK_REF:
- compile_error(PARSER_ARG "Can't set variable $%c", (int)node->nd_nth);
+ rb_compile_error("Can't set variable $%c", (int)node->nd_nth);
break;
}
}
static NODE *
-arg_concat_gen(struct parser_params *parser, NODE *node1, NODE *node2)
+arg_concat(node1, node2)
+ NODE *node1;
+ NODE *node2;
{
if (!node2) return node1;
- switch (nd_type(node1)) {
- case NODE_BLOCK_PASS:
- node1->nd_iter = arg_concat(node1->nd_iter, node2);
- return node1;
- case NODE_ARGSPUSH:
- if (nd_type(node2) != NODE_ARRAY) break;
- node1->nd_body = list_concat(NEW_LIST(node1->nd_body), node2);
- nd_set_type(node1, NODE_ARGSCAT);
- return node1;
- case NODE_ARGSCAT:
- if (nd_type(node2) != NODE_ARRAY ||
- nd_type(node1->nd_body) != NODE_ARRAY) break;
- node1->nd_body = list_concat(node1->nd_body, node2);
- return node1;
- }
return NEW_ARGSCAT(node1, node2);
}
static NODE *
-arg_append_gen(struct parser_params *parser, NODE *node1, NODE *node2)
+arg_add(node1, node2)
+ NODE *node1;
+ NODE *node2;
{
if (!node1) return NEW_LIST(node2);
- switch (nd_type(node1)) {
- case NODE_ARRAY:
+ if (nd_type(node1) == NODE_ARRAY) {
return list_append(node1, node2);
- case NODE_BLOCK_PASS:
- node1->nd_head = arg_append(node1->nd_head, node2);
- return node1;
- case NODE_ARGSPUSH:
- node1->nd_body = list_append(NEW_LIST(node1->nd_body), node2);
- nd_set_type(node1, NODE_ARGSCAT);
- return node1;
- }
- return NEW_ARGSPUSH(node1, node2);
-}
-
-static NODE *
-splat_array(NODE* node)
-{
- if (nd_type(node) == NODE_SPLAT) node = node->nd_head;
- if (nd_type(node) == NODE_ARRAY) return node;
- return 0;
+ }
+ else {
+ return NEW_ARGSPUSH(node1, node2);
+ }
}
-static NODE *
-node_assign_gen(struct parser_params *parser, NODE *lhs, NODE *rhs)
+static NODE*
+node_assign(lhs, rhs)
+ NODE *lhs, *rhs;
{
if (!lhs) return 0;
+ value_expr(rhs);
switch (nd_type(lhs)) {
case NODE_GASGN:
case NODE_IASGN:
- case NODE_IASGN2:
case NODE_LASGN:
case NODE_DASGN:
case NODE_DASGN_CURR:
case NODE_MASGN:
case NODE_CDECL:
+ case NODE_CVDECL:
case NODE_CVASGN:
lhs->nd_value = rhs;
break;
case NODE_ATTRASGN:
case NODE_CALL:
- lhs->nd_args = arg_append(lhs->nd_args, rhs);
+ lhs->nd_args = arg_add(lhs->nd_args, rhs);
break;
default:
@@ -8202,13 +5123,11 @@ node_assign_gen(struct parser_params *parser, NODE *lhs, NODE *rhs)
}
static int
-value_expr_gen(struct parser_params *parser, NODE *node)
+value_expr0(node)
+ NODE *node;
{
int cond = 0;
- if (!node) {
- rb_warning0("empty expression");
- }
while (node) {
switch (nd_type(node)) {
case NODE_DEFN:
@@ -8237,14 +5156,6 @@ value_expr_gen(struct parser_params *parser, NODE *node)
break;
case NODE_IF:
- if (!node->nd_body) {
- node = node->nd_else;
- break;
- }
- else if (!node->nd_else) {
- node = node->nd_body;
- break;
- }
if (!value_expr(node->nd_body)) return Qfalse;
node = node->nd_else;
break;
@@ -8255,6 +5166,10 @@ value_expr_gen(struct parser_params *parser, NODE *node)
node = node->nd_2nd;
break;
+ case NODE_NEWLINE:
+ node = node->nd_next;
+ break;
+
default:
return Qtrue;
}
@@ -8264,14 +5179,20 @@ value_expr_gen(struct parser_params *parser, NODE *node)
}
static void
-void_expr_gen(struct parser_params *parser, NODE *node)
+void_expr0(node)
+ NODE *node;
{
const char *useless = 0;
if (!RTEST(ruby_verbose)) return;
+ again:
if (!node) return;
switch (nd_type(node)) {
+ case NODE_NEWLINE:
+ node = node->nd_next;
+ goto again;
+
case NODE_CALL:
switch (node->nd_mid) {
case '+':
@@ -8307,6 +5228,7 @@ void_expr_gen(struct parser_params *parser, NODE *node)
useless = "a variable";
break;
case NODE_CONST:
+ case NODE_CREF:
useless = "a constant";
break;
case NODE_LIT:
@@ -8347,13 +5269,14 @@ void_expr_gen(struct parser_params *parser, NODE *node)
int line = ruby_sourceline;
ruby_sourceline = nd_line(node);
- rb_warnS("useless use of %s in void context", useless);
+ rb_warn("useless use of %s in void context", useless);
ruby_sourceline = line;
}
}
static void
-void_stmts_gen(struct parser_params *parser, NODE *node)
+void_stmts(node)
+ NODE *node;
{
if (!RTEST(ruby_verbose)) return;
if (!node) return;
@@ -8367,70 +5290,27 @@ void_stmts_gen(struct parser_params *parser, NODE *node)
}
static NODE *
-remove_begin(NODE *node)
-{
- NODE **n = &node, *n1 = node;
- while (n1 && nd_type(n1) == NODE_BEGIN && n1->nd_body) {
- *n = n1 = n1->nd_body;
- }
- return node;
-}
-
-static void
-reduce_nodes_gen(struct parser_params *parser, NODE **body)
+remove_begin(node)
+ NODE *node;
{
- NODE *node = *body;
-
- if (!node) {
- *body = NEW_NIL();
- return;
- }
-#define subnodes(n1, n2) \
- ((!node->n1) ? (node->n2 ? (body = &node->n2, 1) : 0) : \
- (!node->n2) ? (body = &node->n1, 1) : \
- (reduce_nodes(&node->n1), body = &node->n2, 1))
-
- while (node) {
- switch (nd_type(node)) {
- end:
- case NODE_NIL:
- *body = 0;
- return;
- case NODE_RETURN:
- *body = node = node->nd_stts;
+ NODE **n = &node;
+ while (*n) {
+ switch (nd_type(*n)) {
+ case NODE_NEWLINE:
+ n = &(*n)->nd_next;
continue;
case NODE_BEGIN:
- *body = node = node->nd_body;
- continue;
- case NODE_BLOCK:
- body = &node->nd_end->nd_head;
- break;
- case NODE_IF:
- if (subnodes(nd_body, nd_else)) break;
- return;
- case NODE_CASE:
- body = &node->nd_body;
- break;
- case NODE_WHEN:
- if (!subnodes(nd_body, nd_next)) goto end;
- break;
- case NODE_ENSURE:
- if (!subnodes(nd_head, nd_resq)) goto end;
- break;
- case NODE_RESCUE:
- if (!subnodes(nd_head, nd_resq)) goto end;
- break;
+ *n = (*n)->nd_body;
default:
- return;
+ return node;
}
- node = *body;
}
-
-#undef subnodes
+ return node;
}
static int
-assign_in_cond(struct parser_params *parser, NODE *node)
+assign_in_cond(node)
+ NODE *node;
{
switch (nd_type(node)) {
case NODE_MASGN:
@@ -8443,6 +5323,7 @@ assign_in_cond(struct parser_params *parser, NODE *node)
case NODE_IASGN:
break;
+ case NODE_NEWLINE:
default:
return 0;
}
@@ -8465,23 +5346,41 @@ assign_in_cond(struct parser_params *parser, NODE *node)
default:
break;
}
+#if 0
+ if (assign_in_cond(node->nd_value) == 0) {
+ parser_warning(node->nd_value, "assignment in condition");
+ }
+#endif
return 1;
}
+static int
+e_option_supplied()
+{
+ if (strcmp(ruby_sourcefile, "-e") == 0)
+ return Qtrue;
+ return Qfalse;
+}
+
static void
-warn_unless_e_option(struct parser_params *parser, NODE *node, const char *str)
+warn_unless_e_option(node, str)
+ NODE *node;
+ const char *str;
{
- if (!e_option_supplied(parser)) parser_warn(node, str);
+ if (!e_option_supplied()) parser_warn(node, str);
}
static void
-warning_unless_e_option(struct parser_params *parser, NODE *node, const char *str)
+warning_unless_e_option(node, str)
+ NODE *node;
+ const char *str;
{
- if (!e_option_supplied(parser)) parser_warning(node, str);
+ if (!e_option_supplied()) parser_warning(node, str);
}
static void
-fixup_nodes(NODE **rootnode)
+fixup_nodes(rootnode)
+ NODE **rootnode;
{
NODE *node, *next, *head;
@@ -8509,26 +5408,32 @@ fixup_nodes(NODE **rootnode)
}
}
-static NODE *cond0(struct parser_params*,NODE*);
+static NODE *cond0();
static NODE*
-range_op(struct parser_params *parser, NODE *node)
+range_op(node)
+ NODE *node;
{
enum node_type type;
if (node == 0) return 0;
type = nd_type(node);
+ if (type == NODE_NEWLINE) {
+ node = node->nd_next;
+ type = nd_type(node);
+ }
value_expr(node);
if (type == NODE_LIT && FIXNUM_P(node->nd_lit)) {
- warn_unless_e_option(parser, node, "integer literal in conditional range");
- return NEW_CALL(node, tEQ, NEW_LIST(NEW_GVAR(rb_intern("$."))));
+ warn_unless_e_option(node, "integer literal in conditional range");
+ return call_op(node,tEQ,1,NEW_GVAR(rb_intern("$.")));
}
- return cond0(parser, node);
+ return cond0(node);
}
static int
-literal_node(NODE *node)
+literal_node(node)
+ NODE *node;
{
if (!node) return 1; /* same as NODE_NIL */
switch (nd_type(node)) {
@@ -8549,36 +5454,40 @@ literal_node(NODE *node)
}
static NODE*
-cond0(struct parser_params *parser, NODE *node)
+cond0(node)
+ NODE *node;
{
if (node == 0) return 0;
- assign_in_cond(parser, node);
+ assign_in_cond(node);
switch (nd_type(node)) {
case NODE_DSTR:
case NODE_EVSTR:
case NODE_STR:
- rb_warn0("string literal in condition");
+ rb_warn("string literal in condition");
break;
case NODE_DREGX:
case NODE_DREGX_ONCE:
- warning_unless_e_option(parser, node, "regex literal in condition");
+ warning_unless_e_option(node, "regex literal in condition");
+ local_cnt('_');
+ local_cnt('~');
return NEW_MATCH2(node, NEW_GVAR(rb_intern("$_")));
case NODE_AND:
case NODE_OR:
- node->nd_1st = cond0(parser, node->nd_1st);
- node->nd_2nd = cond0(parser, node->nd_2nd);
+ node->nd_1st = cond0(node->nd_1st);
+ node->nd_2nd = cond0(node->nd_2nd);
break;
case NODE_DOT2:
case NODE_DOT3:
- node->nd_beg = range_op(parser, node->nd_beg);
- node->nd_end = range_op(parser, node->nd_end);
+ node->nd_beg = range_op(node->nd_beg);
+ node->nd_end = range_op(node->nd_end);
if (nd_type(node) == NODE_DOT2) nd_set_type(node,NODE_FLIP2);
else if (nd_type(node) == NODE_DOT3) nd_set_type(node, NODE_FLIP3);
- if (!e_option_supplied(parser)) {
+ node->nd_cnt = local_append(internal_id());
+ if (!e_option_supplied()) {
int b = literal_node(node->nd_beg);
int e = literal_node(node->nd_end);
if ((b == 1 && e == 1) || (b + e >= 2 && RTEST(ruby_verbose))) {
@@ -8593,8 +5502,10 @@ cond0(struct parser_params *parser, NODE *node)
case NODE_LIT:
if (TYPE(node->nd_lit) == T_REGEXP) {
- warn_unless_e_option(parser, node, "regex literal in condition");
+ warn_unless_e_option(node, "regex literal in condition");
nd_set_type(node, NODE_MATCH);
+ local_cnt('_');
+ local_cnt('~');
}
else {
parser_warning(node, "literal in condition");
@@ -8606,14 +5517,22 @@ cond0(struct parser_params *parser, NODE *node)
}
static NODE*
-cond_gen(struct parser_params *parser, NODE *node)
+cond(node)
+ NODE *node;
{
if (node == 0) return 0;
- return cond0(parser, node);
+ value_expr(node);
+ if (nd_type(node) == NODE_NEWLINE){
+ node->nd_next = cond0(node->nd_next);
+ return node;
+ }
+ return cond0(node);
}
static NODE*
-logop_gen(struct parser_params *parser, enum node_type type, NODE *left, NODE *right)
+logop(type, left, right)
+ enum node_type type;
+ NODE *left, *right;
{
value_expr(left);
if (left && nd_type(left) == type) {
@@ -8627,41 +5546,66 @@ logop_gen(struct parser_params *parser, enum node_type type, NODE *left, NODE *r
return NEW_NODE(type, left, right, 0);
}
+static int
+cond_negative(nodep)
+ NODE **nodep;
+{
+ NODE *c = *nodep;
+
+ if (!c) return 0;
+ switch (nd_type(c)) {
+ case NODE_NOT:
+ *nodep = c->nd_body;
+ return 1;
+ case NODE_NEWLINE:
+ if (c->nd_next && nd_type(c->nd_next) == NODE_NOT) {
+ c->nd_next = c->nd_next->nd_body;
+ return 1;
+ }
+ }
+ return 0;
+}
+
static void
-no_blockarg(struct parser_params *parser, NODE *node)
+no_blockarg(node)
+ NODE *node;
{
if (node && nd_type(node) == NODE_BLOCK_PASS) {
- compile_error(PARSER_ARG "block argument should not be given");
+ rb_compile_error("block argument should not be given");
}
}
static NODE *
-ret_args_gen(struct parser_params *parser, NODE *node)
+ret_args(node)
+ NODE *node;
{
if (node) {
- no_blockarg(parser, node);
- if (nd_type(node) == NODE_ARRAY) {
- if (node->nd_next == 0) {
- node = node->nd_head;
- }
- else {
- nd_set_type(node, NODE_VALUES);
- }
+ no_blockarg(node);
+ if (nd_type(node) == NODE_ARRAY && node->nd_next == 0) {
+ node = node->nd_head;
+ }
+ if (node && nd_type(node) == NODE_SPLAT) {
+ node = NEW_SVALUE(node);
}
}
return node;
}
static NODE *
-new_yield_gen(struct parser_params *parser, NODE *node)
+new_yield(node)
+ NODE *node;
{
long state = Qtrue;
if (node) {
- no_blockarg(parser, node);
- if (node && nd_type(node) == NODE_SPLAT) {
- state = Qtrue;
- }
+ no_blockarg(node);
+ if (nd_type(node) == NODE_ARRAY && node->nd_next == 0) {
+ node = node->nd_head;
+ state = Qfalse;
+ }
+ if (node && nd_type(node) == NODE_SPLAT) {
+ state = Qtrue;
+ }
}
else {
state = Qfalse;
@@ -8670,7 +5614,8 @@ new_yield_gen(struct parser_params *parser, NODE *node)
}
static NODE*
-negate_lit(NODE *node)
+negate_lit(node)
+ NODE *node;
{
switch (TYPE(node->nd_lit)) {
case T_FIXNUM:
@@ -8680,7 +5625,7 @@ negate_lit(NODE *node)
node->nd_lit = rb_funcall(node->nd_lit,tUMINUS,0,0);
break;
case T_FLOAT:
- RFLOAT(node->nd_lit)->float_value = -RFLOAT_VALUE(node->nd_lit);
+ RFLOAT(node->nd_lit)->value = -RFLOAT(node->nd_lit)->value;
break;
default:
break;
@@ -8689,7 +5634,9 @@ negate_lit(NODE *node)
}
static NODE *
-arg_blk_pass(NODE *node1, NODE *node2)
+arg_blk_pass(node1, node2)
+ NODE *node1;
+ NODE *node2;
{
if (node2) {
node2->nd_head = node1;
@@ -8699,512 +5646,408 @@ arg_blk_pass(NODE *node1, NODE *node2)
}
static NODE*
-new_args_gen(struct parser_params *parser, NODE *m, NODE *o, ID r, NODE *p, ID b)
+arg_prepend(node1, node2)
+ NODE *node1, *node2;
{
- int saved_line = ruby_sourceline;
- NODE *node;
- NODE *i1, *i2 = 0;
+ switch (nd_type(node2)) {
+ case NODE_ARRAY:
+ return list_concat(NEW_LIST(node1), node2);
- node = NEW_ARGS(m ? m->nd_plen : 0, o);
- i1 = m ? m->nd_next : 0;
- node->nd_next = NEW_ARGS_AUX(r, b);
+ case NODE_SPLAT:
+ return arg_concat(node1, node2->nd_head);
- if (p) {
- i2 = p->nd_next;
- node->nd_next->nd_next = NEW_ARGS_AUX(p->nd_pid, p->nd_plen);
+ case NODE_BLOCK_PASS:
+ node2->nd_body = arg_prepend(node1, node2->nd_body);
+ return node2;
+
+ default:
+ rb_bug("unknown nodetype(%d) for arg_prepend", nd_type(node2));
}
- else if (i1) {
- node->nd_next->nd_next = NEW_ARGS_AUX(0, 0);
+ return 0; /* not reached */
+}
+
+static NODE*
+new_call(r,m,a)
+ NODE *r;
+ ID m;
+ NODE *a;
+{
+ if (a && nd_type(a) == NODE_BLOCK_PASS) {
+ a->nd_iter = NEW_CALL(r,m,a->nd_head);
+ return a;
}
- if (i1 || i2) {
- node->nd_next->nd_next->nd_next = NEW_NODE(NODE_AND, i1, i2, 0);
+ return NEW_CALL(r,m,a);
+}
+
+static NODE*
+new_fcall(m,a)
+ ID m;
+ NODE *a;
+{
+ if (a && nd_type(a) == NODE_BLOCK_PASS) {
+ a->nd_iter = NEW_FCALL(m,a->nd_head);
+ return a;
}
- ruby_sourceline = saved_line;
- return node;
+ return NEW_FCALL(m,a);
+}
+
+static NODE*
+new_super(a)
+ NODE *a;
+{
+ if (a && nd_type(a) == NODE_BLOCK_PASS) {
+ a->nd_iter = NEW_SUPER(a->nd_head);
+ return a;
+ }
+ return NEW_SUPER(a);
}
+static struct local_vars {
+ ID *tbl;
+ int nofree;
+ int cnt;
+ int dlev;
+ struct RVarmap* dyna_vars;
+ struct local_vars *prev;
+} *lvtbl;
+
static void
-local_push_gen(struct parser_params *parser, int inherit_dvars)
+local_push(top)
+ int top;
{
struct local_vars *local;
local = ALLOC(struct local_vars);
local->prev = lvtbl;
- local->args = vtable_alloc(0);
- local->vars = vtable_alloc(inherit_dvars ? DVARS_INHERIT : DVARS_TOPSCOPE);
+ local->nofree = 0;
+ local->cnt = 0;
+ local->tbl = 0;
+ local->dlev = 0;
+ local->dyna_vars = ruby_dyna_vars;
lvtbl = local;
+ if (!top) {
+ /* preserve reference for GC, but link should be cut. */
+ rb_dvar_push(0, (VALUE)ruby_dyna_vars);
+ ruby_dyna_vars->next = 0;
+ }
}
static void
-local_pop_gen(struct parser_params *parser)
+local_pop()
{
struct local_vars *local = lvtbl->prev;
- vtable_free(lvtbl->args);
- vtable_free(lvtbl->vars);
- xfree(lvtbl);
- lvtbl = local;
-}
-static ID*
-vtable_tblcpy(ID *buf, const struct vtable *src)
-{
- int i, cnt = vtable_size(src);
-
- if (cnt > 0) {
- buf[0] = cnt;
- for (i = 0; i < cnt; i++) {
- buf[i] = src->tbl[i];
- }
- return buf;
+ if (lvtbl->tbl) {
+ if (!lvtbl->nofree) xfree(lvtbl->tbl);
+ else lvtbl->tbl[0] = lvtbl->cnt;
}
- return 0;
+ ruby_dyna_vars = lvtbl->dyna_vars;
+ xfree(lvtbl);
+ lvtbl = local;
}
static ID*
-local_tbl_gen(struct parser_params *parser)
+local_tbl()
{
- int cnt = vtable_size(lvtbl->args) + vtable_size(lvtbl->vars);
- ID *buf;
-
- if (cnt <= 0) return 0;
- buf = ALLOC_N(ID, cnt + 1);
- vtable_tblcpy(buf+1, lvtbl->args);
- vtable_tblcpy(buf+vtable_size(lvtbl->args)+1, lvtbl->vars);
- buf[0] = cnt;
- return buf;
+ lvtbl->nofree = 1;
+ return lvtbl->tbl;
}
static int
-arg_var_gen(struct parser_params *parser, ID id)
+local_append(id)
+ ID id;
{
- vtable_add(lvtbl->args, id);
- return vtable_size(lvtbl->args) - 1;
+ if (lvtbl->tbl == 0) {
+ lvtbl->tbl = ALLOC_N(ID, 4);
+ lvtbl->tbl[0] = 0;
+ lvtbl->tbl[1] = '_';
+ lvtbl->tbl[2] = '~';
+ lvtbl->cnt = 2;
+ if (id == '_') return 0;
+ if (id == '~') return 1;
+ }
+ else {
+ REALLOC_N(lvtbl->tbl, ID, lvtbl->cnt+2);
+ }
+
+ lvtbl->tbl[lvtbl->cnt+1] = id;
+ return lvtbl->cnt++;
}
static int
-local_var_gen(struct parser_params *parser, ID id)
+local_cnt(id)
+ ID id;
{
- vtable_add(lvtbl->vars, id);
- return vtable_size(lvtbl->vars) - 1;
+ int cnt, max;
+
+ if (id == 0) return lvtbl->cnt;
+
+ for (cnt=1, max=lvtbl->cnt+1; cnt<max;cnt++) {
+ if (lvtbl->tbl[cnt] == id) return cnt-1;
+ }
+ return local_append(id);
}
static int
-local_id_gen(struct parser_params *parser, ID id)
+local_id(id)
+ ID id;
{
- struct vtable *vars, *args;
+ int i, max;
- vars = lvtbl->vars;
- args = lvtbl->args;
-
- while (vars && POINTER_P(vars->prev)) {
- vars = vars->prev;
- args = args->prev;
+ if (lvtbl == 0) return Qfalse;
+ for (i=3, max=lvtbl->cnt+1; i<max; i++) {
+ if (lvtbl->tbl[i] == id) return Qtrue;
}
+ return Qfalse;
+}
- if (vars && vars->prev == DVARS_INHERIT) {
- return rb_local_defined(id);
+static void
+top_local_init()
+{
+ local_push(1);
+ lvtbl->cnt = ruby_scope->local_tbl?ruby_scope->local_tbl[0]:0;
+ if (lvtbl->cnt > 0) {
+ lvtbl->tbl = ALLOC_N(ID, lvtbl->cnt+3);
+ MEMCPY(lvtbl->tbl, ruby_scope->local_tbl, ID, lvtbl->cnt+1);
}
else {
- return (vtable_included(args, id) ||
- vtable_included(vars, id));
+ lvtbl->tbl = 0;
}
+ if (ruby_dyna_vars)
+ lvtbl->dlev = 1;
+ else
+ lvtbl->dlev = 0;
}
static void
-dyna_push_gen(struct parser_params *parser)
+top_local_setup()
{
- lvtbl->args = vtable_alloc(lvtbl->args);
- lvtbl->vars = vtable_alloc(lvtbl->vars);
-}
+ int len = lvtbl->cnt;
+ int i;
-static void
-dyna_pop_gen(struct parser_params *parser)
-{
- struct vtable *tmp;
-
- tmp = lvtbl->args;
- lvtbl->args = lvtbl->args->prev;
- vtable_free(tmp);
- tmp = lvtbl->vars;
- lvtbl->vars = lvtbl->vars->prev;
- vtable_free(tmp);
-}
+ if (len > 0) {
+ i = ruby_scope->local_tbl?ruby_scope->local_tbl[0]:0;
-static int
-dyna_in_block_gen(struct parser_params *parser)
-{
- return POINTER_P(lvtbl->vars) && lvtbl->vars->prev != DVARS_TOPSCOPE;
+ if (i < len) {
+ if (i == 0 || (ruby_scope->flags & SCOPE_MALLOC) == 0) {
+ VALUE *vars = ALLOC_N(VALUE, len+1);
+ if (ruby_scope->local_vars) {
+ *vars++ = ruby_scope->local_vars[-1];
+ MEMCPY(vars, ruby_scope->local_vars, VALUE, i);
+ rb_mem_clear(vars+i, len-i);
+ }
+ else {
+ *vars++ = 0;
+ rb_mem_clear(vars, len);
+ }
+ ruby_scope->local_vars = vars;
+ ruby_scope->flags |= SCOPE_MALLOC;
+ }
+ else {
+ VALUE *vars = ruby_scope->local_vars-1;
+ REALLOC_N(vars, VALUE, len+1);
+ ruby_scope->local_vars = vars+1;
+ rb_mem_clear(ruby_scope->local_vars+i, len-i);
+ }
+ if (ruby_scope->local_tbl && ruby_scope->local_vars[-1] == 0) {
+ if (!(ruby_scope->flags & SCOPE_CLONE))
+ xfree(ruby_scope->local_tbl);
+ }
+ ruby_scope->local_vars[-1] = 0; /* no reference needed */
+ ruby_scope->local_tbl = local_tbl();
+ }
+ }
+ local_pop();
}
-static int
-dvar_defined_gen(struct parser_params *parser, ID id)
-{
- struct vtable *vars, *args;
+#define DVAR_USED FL_USER6
- args = lvtbl->args;
- vars = lvtbl->vars;
+static VALUE
+dyna_var_lookup(id)
+ ID id;
+{
+ struct RVarmap *vars = ruby_dyna_vars;
- while (POINTER_P(vars)) {
- if (vtable_included(args, id)) {
- return 1;
- }
- if (vtable_included(vars, id)) {
- return 1;
+ while (vars) {
+ if (vars->id == id) {
+ FL_SET(vars, DVAR_USED);
+ return Qtrue;
}
- args = args->prev;
- vars = vars->prev;
- }
-
- if (vars == DVARS_INHERIT) {
- return rb_dvar_defined(id);
+ vars = vars->next;
}
-
- return 0;
+ return Qfalse;
}
-static int
-dvar_curr_gen(struct parser_params *parser, ID id)
+static struct RVarmap*
+dyna_push()
{
- return (vtable_included(lvtbl->args, id) ||
- vtable_included(lvtbl->vars, id));
-}
-
-VALUE rb_reg_compile(VALUE str, int options);
-VALUE rb_reg_check_preprocess(VALUE);
-
-static void
-reg_fragment_setenc_gen(struct parser_params* parser, VALUE str, int options)
-{
- int c = RE_OPTION_ENCODING_IDX(options);
-
- if (c) {
- int opt, idx;
- rb_char_to_option_kcode(c, &opt, &idx);
- if (idx != ENCODING_GET(str) &&
- rb_enc_str_coderange(str) != ENC_CODERANGE_7BIT) {
- goto error;
- }
- ENCODING_SET(str, idx);
- }
- else if (RE_OPTION_ENCODING_NONE(options)) {
- if (!ENCODING_IS_ASCII8BIT(str) &&
- rb_enc_str_coderange(str) != ENC_CODERANGE_7BIT) {
- c = 'n';
- goto error;
- }
- rb_enc_associate(str, rb_ascii8bit_encoding());
- }
- else if (parser->enc == rb_usascii_encoding()) {
- if (rb_enc_str_coderange(str) != ENC_CODERANGE_7BIT) {
- /* raise in re.c */
- rb_enc_associate(str, rb_usascii_encoding());
- }
- else {
- rb_enc_associate(str, rb_ascii8bit_encoding());
- }
- }
- return;
+ struct RVarmap* vars = ruby_dyna_vars;
- error:
- compile_error(PARSER_ARG
- "regexp encoding option '%c' differs from source encoding '%s'",
- c, rb_enc_name(rb_enc_get(str)));
+ rb_dvar_push(0, 0);
+ lvtbl->dlev++;
+ return vars;
}
static void
-reg_fragment_check_gen(struct parser_params* parser, VALUE str, int options)
+dyna_pop(vars)
+ struct RVarmap* vars;
{
- VALUE err;
- reg_fragment_setenc_gen(parser, str, options);
- err = rb_reg_check_preprocess(str);
- if (err != Qnil) {
- err = rb_obj_as_string(err);
- compile_error(PARSER_ARG "%s", RSTRING_PTR(err));
- RB_GC_GUARD(err);
- }
+ lvtbl->dlev--;
+ ruby_dyna_vars = vars;
}
-typedef struct {
- struct parser_params* parser;
- rb_encoding *enc;
- NODE *succ_block;
- NODE *fail_block;
- int num;
-} reg_named_capture_assign_t;
-
static int
-reg_named_capture_assign_iter(const OnigUChar *name, const OnigUChar *name_end,
- int back_num, int *back_refs, OnigRegex regex, void *arg0)
+dyna_in_block()
{
- reg_named_capture_assign_t *arg = (reg_named_capture_assign_t*)arg0;
- struct parser_params* parser = arg->parser;
- rb_encoding *enc = arg->enc;
- int len = name_end - name;
- const char *s = (const char *)name;
- ID var;
-
- arg->num++;
-
- if (arg->succ_block == 0) {
- arg->succ_block = NEW_BEGIN(0);
- arg->fail_block = NEW_BEGIN(0);
- }
-
- if (!len || (*name != '_' && ISASCII(*name) && !rb_enc_islower(*name, enc)) ||
- rb_reserved_word(s, len) || !rb_enc_symname2_p(s, len, enc)) {
- return ST_CONTINUE;
- }
- var = rb_intern3(s, len, enc);
- if (dvar_defined(var) || local_id(var)) {
- rb_warningS("named capture conflicts a local variable - %s",
- rb_id2name(var));
- }
- arg->succ_block = block_append(arg->succ_block,
- newline_node(node_assign(assignable(var,0),
- NEW_CALL(
- gettable(rb_intern("$~")),
- idAREF,
- NEW_LIST(NEW_LIT(ID2SYM(var))))
- )));
- arg->fail_block = block_append(arg->fail_block,
- newline_node(node_assign(assignable(var,0), NEW_LIT(Qnil))));
- return ST_CONTINUE;
+ return (lvtbl->dlev > 0);
}
static NODE *
-reg_named_capture_assign_gen(struct parser_params* parser, VALUE regexp, NODE *match)
+dyna_init(node, pre)
+ NODE *node;
+ struct RVarmap *pre;
{
- reg_named_capture_assign_t arg;
-
- arg.parser = parser;
- arg.enc = rb_enc_get(regexp);
- arg.succ_block = 0;
- arg.fail_block = 0;
- arg.num = 0;
- onig_foreach_name(RREGEXP(regexp)->ptr, reg_named_capture_assign_iter, (void*)&arg);
-
- if (arg.num == 0)
- return match;
-
- return
- block_append(
- newline_node(match),
- NEW_IF(gettable(rb_intern("$~")),
- block_append(
- newline_node(arg.succ_block),
- newline_node(
- NEW_CALL(
- gettable(rb_intern("$~")),
- rb_intern("begin"),
- NEW_LIST(NEW_LIT(INT2FIX(0)))))),
- block_append(
- newline_node(arg.fail_block),
- newline_node(
- NEW_LIT(Qnil)))));
-}
+ struct RVarmap *post = ruby_dyna_vars;
+ NODE *var;
-static VALUE
-reg_compile_gen(struct parser_params* parser, VALUE str, int options)
-{
- VALUE re;
- VALUE err;
-
- reg_fragment_setenc(str, options);
- err = rb_errinfo();
- re = rb_reg_compile(str, options & RE_OPTION_MASK);
- if (NIL_P(re)) {
- ID mesg = rb_intern("mesg");
- VALUE m = rb_attr_get(rb_errinfo(), mesg);
- rb_set_errinfo(err);
- if (!NIL_P(err)) {
- rb_str_append(rb_str_cat(rb_attr_get(err, mesg), "\n", 1), m);
- }
- else {
- compile_error(PARSER_ARG "%s", RSTRING_PTR(m));
+ if (!node || !post || pre == post) return node;
+ for (var = 0; post != pre && post->id; post = post->next) {
+ if (FL_TEST(post, DVAR_USED)) {
+ var = NEW_DASGN_CURR(post->id, var);
}
- return Qnil;
}
- return re;
+ return block_append(var, node);
}
-void
-rb_gc_mark_parser(void)
+int
+ruby_parser_stack_on_heap()
{
+#if defined(YYMALLOC)
+ (void)rb_parser_realloc;
+ (void)rb_parser_calloc;
+ (void)nodetype;
+ (void)nodeline;
+ return Qfalse;
+#else
+ return Qtrue;
+#endif
}
-NODE*
-rb_parser_append_print(VALUE vparser, NODE *node)
+void
+rb_gc_mark_parser()
{
- NODE *prelude = 0;
- NODE *scope = node;
- struct parser_params *parser;
-
- if (!node) return node;
-
- TypedData_Get_Struct(vparser, struct parser_params, &parser_data_type, parser);
-
- node = node->nd_body;
-
- if (nd_type(node) == NODE_PRELUDE) {
- prelude = node;
- node = node->nd_body;
- }
+#if defined YYMALLOC
+ rb_gc_mark((VALUE)parser_heap);
+#elif defined yystacksize
+ if (yyvsp) rb_gc_mark_locations((VALUE *)yyvs, (VALUE *)yyvsp);
+#endif
- node = block_append(node,
- NEW_FCALL(rb_intern("print"),
- NEW_ARRAY(NEW_GVAR(rb_intern("$_")))));
- if (prelude) {
- prelude->nd_body = node;
- scope->nd_body = prelude;
- }
- else {
- scope->nd_body = node;
- }
+ if (!ruby_in_compile) return;
- return scope;
+ rb_gc_mark_maybe((VALUE)yylval.node);
+ rb_gc_mark(ruby_debug_lines);
+ rb_gc_mark(lex_lastline);
+ rb_gc_mark(lex_input);
+ rb_gc_mark((VALUE)lex_strterm);
+ rb_gc_mark((VALUE)deferred_nodes);
}
-NODE *
-rb_parser_while_loop(VALUE vparser, NODE *node, int chop, int split)
+void
+rb_parser_append_print()
{
- NODE *prelude = 0;
- NODE *scope = node;
- struct parser_params *parser;
-
- if (!node) return node;
-
- TypedData_Get_Struct(vparser, struct parser_params, &parser_data_type, parser);
-
- node = node->nd_body;
+ ruby_eval_tree =
+ block_append(ruby_eval_tree,
+ NEW_FCALL(rb_intern("print"),
+ NEW_ARRAY(NEW_GVAR(rb_intern("$_")))));
+}
- if (nd_type(node) == NODE_PRELUDE) {
- prelude = node;
- node = node->nd_body;
- }
+void
+rb_parser_while_loop(chop, split)
+ int chop, split;
+{
if (split) {
- node = block_append(NEW_GASGN(rb_intern("$F"),
- NEW_CALL(NEW_GVAR(rb_intern("$_")),
- rb_intern("split"), 0)),
- node);
+ ruby_eval_tree =
+ block_append(NEW_GASGN(rb_intern("$F"),
+ NEW_CALL(NEW_GVAR(rb_intern("$_")),
+ rb_intern("split"), 0)),
+ ruby_eval_tree);
}
if (chop) {
- node = block_append(NEW_CALL(NEW_GVAR(rb_intern("$_")),
- rb_intern("chop!"), 0), node);
- }
-
- node = NEW_OPT_N(node);
-
- if (prelude) {
- prelude->nd_body = node;
- scope->nd_body = prelude;
- }
- else {
- scope->nd_body = node;
+ ruby_eval_tree =
+ block_append(NEW_CALL(NEW_GVAR(rb_intern("$_")),
+ rb_intern("chop!"), 0), ruby_eval_tree);
}
-
- return scope;
+ ruby_eval_tree = NEW_OPT_N(ruby_eval_tree);
}
-static const struct {
+static struct {
ID token;
const char *name;
} op_tbl[] = {
{tDOT2, ".."},
{tDOT3, "..."},
+ {'+', "+"},
+ {'-', "-"},
{'+', "+(binary)"},
{'-', "-(binary)"},
+ {'*', "*"},
+ {'/', "/"},
+ {'%', "%"},
{tPOW, "**"},
{tUPLUS, "+@"},
{tUMINUS, "-@"},
+ {tUPLUS, "+(unary)"},
+ {tUMINUS, "-(unary)"},
+ {'|', "|"},
+ {'^', "^"},
+ {'&', "&"},
{tCMP, "<=>"},
+ {'>', ">"},
{tGEQ, ">="},
+ {'<', "<"},
{tLEQ, "<="},
{tEQ, "=="},
{tEQQ, "==="},
{tNEQ, "!="},
{tMATCH, "=~"},
{tNMATCH, "!~"},
+ {'!', "!"},
+ {'~', "~"},
+ {'!', "!(unary)"},
+ {'~', "~(unary)"},
+ {'!', "!@"},
+ {'~', "~@"},
{tAREF, "[]"},
{tASET, "[]="},
{tLSHFT, "<<"},
{tRSHFT, ">>"},
{tCOLON2, "::"},
+ {'`', "`"},
+ {0, 0}
};
-#define op_tbl_count (sizeof(op_tbl) / sizeof(op_tbl[0]))
-
-static struct symbols {
- ID last_id;
- st_table *sym_id;
- st_table *id_str;
- st_table *ivar2_id;
- st_table *id_ivar2;
- VALUE op_sym[tLAST_TOKEN];
-} global_symbols = {tLAST_ID};
-
-static const struct st_hash_type symhash = {
- rb_str_hash_cmp,
- rb_str_hash,
-};
-
-struct ivar2_key {
- ID id;
- VALUE klass;
-};
-
-static int
-ivar2_cmp(struct ivar2_key *key1, struct ivar2_key *key2)
-{
- if (key1->id == key2->id && key1->klass == key2->klass) {
- return 0;
- }
- return 1;
-}
-
-static int
-ivar2_hash(struct ivar2_key *key)
-{
- return (key->id << 8) ^ (key->klass >> 2);
-}
-
-static const struct st_hash_type ivar2_hash_type = {
- ivar2_cmp,
- ivar2_hash,
-};
+static st_table *sym_tbl;
+static st_table *sym_rev_tbl;
void
-Init_sym(void)
+Init_sym()
{
- global_symbols.sym_id = st_init_table_with_size(&symhash, 1000);
- global_symbols.id_str = st_init_numtable_with_size(1000);
- global_symbols.ivar2_id = st_init_table_with_size(&ivar2_hash_type, 1000);
- global_symbols.id_ivar2 = st_init_numtable_with_size(1000);
-
- Init_id();
+ sym_tbl = st_init_strtable_with_size(200);
+ sym_rev_tbl = st_init_numtable_with_size(200);
}
-void
-rb_gc_mark_symbols(void)
-{
- rb_mark_tbl(global_symbols.id_str);
- rb_gc_mark_locations(global_symbols.op_sym,
- global_symbols.op_sym + tLAST_TOKEN);
-}
+static ID last_id = tLAST_TOKEN;
static ID
-internal_id_gen(struct parser_params *parser)
+internal_id()
{
- ID id = (ID)vtable_size(lvtbl->args) + (ID)vtable_size(lvtbl->vars);
- id += ((tLAST_TOKEN - ID_INTERNAL) >> ID_SCOPE_SHIFT) + 1;
- return ID_INTERNAL | (id << ID_SCOPE_SHIFT);
+ return ID_INTERNAL | (++last_id << ID_SCOPE_SHIFT);
}
static int
-is_special_global_name(const char *m, const char *e, rb_encoding *enc)
+is_special_global_name(m)
+ const char *m;
{
- int mb = 0;
-
- if (m >= e) return 0;
switch (*m) {
case '~': case '*': case '$': case '?': case '!': case '@':
case '/': case '\\': case ';': case ',': case '.': case '=':
@@ -9215,38 +6058,20 @@ is_special_global_name(const char *m, const char *e, rb_encoding *enc)
break;
case '-':
++m;
- if (m < e && is_identchar(m, e, enc)) {
- if (!ISASCII(*m)) mb = 1;
- m += rb_enc_mbclen(m, e, enc);
- }
+ if (is_identchar(*m)) m += mbclen(*m);
break;
default:
- if (!rb_enc_isdigit(*m, enc)) return 0;
- do {
- if (!ISASCII(*m)) mb = 1;
- ++m;
- } while (rb_enc_isdigit(*m, enc));
+ if (!ISDIGIT(*m)) return 0;
+ do ++m; while (ISDIGIT(*m));
}
- return m == e ? mb + 1 : 0;
+ return !*m;
}
int
-rb_symname_p(const char *name)
-{
- return rb_enc_symname_p(name, rb_ascii8bit_encoding());
-}
-
-int
-rb_enc_symname_p(const char *name, rb_encoding *enc)
-{
- return rb_enc_symname2_p(name, strlen(name), enc);
-}
-
-int
-rb_enc_symname2_p(const char *name, int len, rb_encoding *enc)
+rb_symname_p(name)
+ const char *name;
{
const char *m = name;
- const char *e = m + len;
int localid = Qfalse;
if (!m) return Qfalse;
@@ -9255,7 +6080,7 @@ rb_enc_symname2_p(const char *name, int len, rb_encoding *enc)
return Qfalse;
case '$':
- if (is_special_global_name(++m, e, enc)) return Qtrue;
+ if (is_special_global_name(++m)) return Qtrue;
goto id;
case '@':
@@ -9301,20 +6126,11 @@ rb_enc_symname2_p(const char *name, int len, rb_encoding *enc)
if (*++m == '=') ++m;
break;
- case '!':
- switch (*++m) {
- case '\0': return Qtrue;
- case '=': case '~': ++m; break;
- default: return Qfalse;
- }
- break;
-
default:
- localid = !rb_enc_isupper(*m, enc);
+ localid = !ISUPPER(*m);
id:
- if (m >= e || (*m != '_' && !rb_enc_isalpha(*m, enc) && ISASCII(*m)))
- return Qfalse;
- while (m < e && is_identchar(m, e, enc)) m += rb_enc_mbclen(m, e, enc);
+ if (*m != '_' && !ISALPHA(*m) && !ismbchar(*m)) return Qfalse;
+ while (is_identchar(*m)) m += mbclen(*m);
if (localid) {
switch (*m) {
case '!': case '?': case '=': ++m;
@@ -9325,54 +6141,37 @@ rb_enc_symname2_p(const char *name, int len, rb_encoding *enc)
return *m ? Qfalse : Qtrue;
}
-static ID
-register_symid(ID id, const char *name, long len, rb_encoding *enc)
+int
+rb_sym_interned_p(str)
+ VALUE str;
{
- VALUE str = rb_enc_str_new(name, len, enc);
- OBJ_FREEZE(str);
- st_add_direct(global_symbols.sym_id, (st_data_t)str, id);
- st_add_direct(global_symbols.id_str, id, (st_data_t)str);
- return id;
+ ID id;
+
+ if (st_lookup(sym_tbl, (st_data_t)RSTRING(str)->ptr, (st_data_t *)&id))
+ return Qtrue;
+ return Qfalse;
}
ID
-rb_intern3(const char *name, long len, rb_encoding *enc)
+rb_intern(name)
+ const char *name;
{
const char *m = name;
- const char *e = m + len;
- unsigned char c;
- VALUE str;
ID id;
int last;
- int mb;
- struct RString fake_str;
- fake_str.basic.flags = T_STRING|RSTRING_NOEMBED|FL_FREEZE;
- fake_str.basic.klass = rb_cString;
- fake_str.as.heap.len = len;
- fake_str.as.heap.ptr = (char *)name;
- fake_str.as.heap.aux.capa = len;
- str = (VALUE)&fake_str;
- rb_enc_associate(str, enc);
-
- if (st_lookup(global_symbols.sym_id, str, (st_data_t *)&id))
+
+ if (st_lookup(sym_tbl, (st_data_t)name, (st_data_t *)&id))
return id;
- if (rb_cString && !rb_enc_asciicompat(enc)) {
- id = ID_JUNK;
- goto new_id;
- }
- last = len-1;
+ last = strlen(name)-1;
id = 0;
- switch (*m) {
+ switch (*name) {
case '$':
id |= ID_GLOBAL;
- if ((mb = is_special_global_name(++m, e, enc)) != 0) {
- if (!--mb) enc = rb_ascii8bit_encoding();
- goto new_id;
- }
+ if (is_special_global_name(++m)) goto new_id;
break;
case '@':
- if (m[1] == '@') {
+ if (name[1] == '@') {
m++;
id |= ID_CLASS;
}
@@ -9382,35 +6181,33 @@ rb_intern3(const char *name, long len, rb_encoding *enc)
m++;
break;
default:
- c = m[0];
- if (c != '_' && rb_enc_isascii(c, enc) && rb_enc_ispunct(c, enc)) {
+ if (name[0] != '_' && ISASCII(name[0]) && !ISALNUM(name[0])) {
/* operators */
int i;
- if (len == 1) {
- id = c;
- goto id_register;
- }
- for (i = 0; i < op_tbl_count; i++) {
- if (*op_tbl[i].name == *m &&
- strcmp(op_tbl[i].name, m) == 0) {
+ for (i=0; op_tbl[i].token; i++) {
+ if (*op_tbl[i].name == *name &&
+ strcmp(op_tbl[i].name, name) == 0) {
id = op_tbl[i].token;
- goto id_register;
+ goto id_regist;
}
}
}
- if (m[last] == '=') {
+ if (name[last] == '=') {
/* attribute assignment */
- id = rb_intern3(name, last, enc);
+ char *buf = ALLOCA_N(char,last+1);
+
+ strncpy(buf, name, last);
+ buf[last] = '\0';
+ id = rb_intern(buf);
if (id > tLAST_TOKEN && !is_attrset_id(id)) {
- enc = rb_enc_get(rb_id2str(id));
id = rb_id_attrset(id);
- goto id_register;
+ goto id_regist;
}
id = ID_ATTRSET;
}
- else if (rb_enc_isupper(m[0], enc)) {
+ else if (ISUPPER(name[0])) {
id = ID_CONST;
}
else {
@@ -9418,140 +6215,66 @@ rb_intern3(const char *name, long len, rb_encoding *enc)
}
break;
}
- mb = 0;
- if (!rb_enc_isdigit(*m, enc)) {
- while (m <= name + last && is_identchar(m, e, enc)) {
- if (ISASCII(*m)) {
- m++;
- }
- else {
- mb = 1;
- m += rb_enc_mbclen(m, e, enc);
- }
+ if (!ISDIGIT(*m)) {
+ while (m <= name + last && is_identchar(*m)) {
+ m += mbclen(*m);
}
}
- if (m - name < len) id = ID_JUNK;
- if (enc != rb_usascii_encoding()) {
- /*
- * this clause makes sense only when called from other than
- * rb_intern_str() taking care of code-range.
- */
- if (!mb) {
- for (; m <= name + len; ++m) {
- if (!ISASCII(*m)) goto mbstr;
- }
- enc = rb_usascii_encoding();
- }
- mbstr:;
- }
+ if (*m) id = ID_JUNK;
new_id:
- id |= ++global_symbols.last_id << ID_SCOPE_SHIFT;
- id_register:
- return register_symid(id, name, len, enc);
-}
-
-ID
-rb_intern2(const char *name, long len)
-{
- return rb_intern3(name, len, rb_usascii_encoding());
-}
-
-#undef rb_intern
-ID
-rb_intern(const char *name)
-{
- return rb_intern2(name, strlen(name));
-}
-
-ID
-rb_intern_str(VALUE str)
-{
- rb_encoding *enc;
- ID id;
-
- if (rb_enc_str_coderange(str) == ENC_CODERANGE_7BIT) {
- enc = rb_usascii_encoding();
- }
- else {
- enc = rb_enc_get(str);
- }
- id = rb_intern3(RSTRING_PTR(str), RSTRING_LEN(str), enc);
- RB_GC_GUARD(str);
+ id |= ++last_id << ID_SCOPE_SHIFT;
+ id_regist:
+ name = strdup(name);
+ st_add_direct(sym_tbl, (st_data_t)name, id);
+ st_add_direct(sym_rev_tbl, id, (st_data_t)name);
return id;
}
-VALUE
-rb_id2str(ID id)
+const char *
+rb_id2name(id)
+ ID id;
{
+ const char *name;
st_data_t data;
if (id < tLAST_TOKEN) {
- int i = 0;
-
- if (rb_ispunct(id)) {
- VALUE str = global_symbols.op_sym[i = (int)id];
- if (!str) {
- char name[2];
- name[0] = (char)id;
- name[1] = 0;
- str = rb_usascii_str_new(name, 1);
- OBJ_FREEZE(str);
- global_symbols.op_sym[i] = str;
- }
- return str;
- }
- for (i = 0; i < op_tbl_count; i++) {
- if (op_tbl[i].token == id) {
- VALUE str = global_symbols.op_sym[i];
- if (!str) {
- str = rb_usascii_str_new2(op_tbl[i].name);
- OBJ_FREEZE(str);
- global_symbols.op_sym[i] = str;
- }
- return str;
- }
+ int i;
+
+ for (i=0; op_tbl[i].token; i++) {
+ if (op_tbl[i].token == id)
+ return op_tbl[i].name;
}
}
- if (st_lookup(global_symbols.id_str, id, &data)) {
- VALUE str = (VALUE)data;
- if (RBASIC(str)->klass == 0)
- RBASIC(str)->klass = rb_cString;
- return str;
- }
+ if (st_lookup(sym_rev_tbl, id, &data))
+ return (char *)data;
if (is_attrset_id(id)) {
ID id2 = (id & ~ID_SCOPE_MASK) | ID_LOCAL;
- VALUE str;
- while (!(str = rb_id2str(id2))) {
- if (!is_local_id(id2)) return 0;
+ again:
+ name = rb_id2name(id2);
+ if (name) {
+ char *buf = ALLOCA_N(char, strlen(name)+2);
+
+ strcpy(buf, name);
+ strcat(buf, "=");
+ rb_intern(buf);
+ return rb_id2name(id);
+ }
+ if (is_local_id(id2)) {
id2 = (id & ~ID_SCOPE_MASK) | ID_CONST;
+ goto again;
}
- str = rb_str_dup(str);
- rb_str_cat(str, "=", 1);
- rb_intern_str(str);
- if (st_lookup(global_symbols.id_str, id, &data)) {
- VALUE str = (VALUE)data;
- if (RBASIC(str)->klass == 0)
- RBASIC(str)->klass = rb_cString;
- return str;
- }
}
return 0;
}
-const char *
-rb_id2name(ID id)
-{
- VALUE str = rb_id2str(id);
-
- if (!str) return 0;
- return RSTRING_PTR(str);
-}
-
static int
-symbols_i(VALUE sym, ID value, VALUE ary)
+symbols_i(key, value, ary)
+ char *key;
+ ID value;
+ VALUE ary;
{
rb_ary_push(ary, ID2SYM(value));
return ST_CONTINUE;
@@ -9560,292 +6283,136 @@ symbols_i(VALUE sym, ID value, VALUE ary)
/*
* call-seq:
* Symbol.all_symbols => array
- *
+ *
* Returns an array of all the symbols currently in Ruby's symbol
* table.
- *
+ *
* Symbol.all_symbols.size #=> 903
* Symbol.all_symbols[1,20] #=> [:floor, :ARGV, :Binding, :symlink,
- * :chown, :EOFError, :$;, :String,
- * :LOCK_SH, :"setuid?", :$<,
- * :default_proc, :compact, :extend,
+ * :chown, :EOFError, :$;, :String,
+ * :LOCK_SH, :"setuid?", :$<,
+ * :default_proc, :compact, :extend,
* :Tms, :getwd, :$=, :ThreadGroup,
* :wait2, :$>]
*/
VALUE
-rb_sym_all_symbols(void)
+rb_sym_all_symbols()
{
- VALUE ary = rb_ary_new2(global_symbols.sym_id->num_entries);
+ VALUE ary = rb_ary_new2(sym_tbl->num_entries);
- st_foreach(global_symbols.sym_id, symbols_i, ary);
+ st_foreach(sym_tbl, symbols_i, ary);
return ary;
}
int
-rb_is_const_id(ID id)
+rb_is_const_id(id)
+ ID id;
{
if (is_const_id(id)) return Qtrue;
return Qfalse;
}
int
-rb_is_class_id(ID id)
+rb_is_class_id(id)
+ ID id;
{
if (is_class_id(id)) return Qtrue;
return Qfalse;
}
int
-rb_is_instance_id(ID id)
+rb_is_instance_id(id)
+ ID id;
{
if (is_instance_id(id)) return Qtrue;
return Qfalse;
}
int
-rb_is_local_id(ID id)
+rb_is_local_id(id)
+ ID id;
{
if (is_local_id(id)) return Qtrue;
return Qfalse;
}
int
-rb_is_junk_id(ID id)
+rb_is_junk_id(id)
+ ID id;
{
if (is_junk_id(id)) return Qtrue;
return Qfalse;
}
-#endif /* !RIPPER */
-
static void
-parser_initialize(struct parser_params *parser)
+special_local_set(c, val)
+ char c;
+ VALUE val;
{
- parser->eofp = Qfalse;
-
- parser->parser_lex_strterm = 0;
- parser->parser_cond_stack = 0;
- parser->parser_cmdarg_stack = 0;
- parser->parser_class_nest = 0;
- parser->parser_paren_nest = 0;
- parser->parser_lpar_beg = 0;
- parser->parser_in_single = 0;
- parser->parser_in_def = 0;
- parser->parser_in_defined = 0;
- parser->parser_compile_for_eval = 0;
- parser->parser_cur_mid = 0;
- parser->parser_tokenbuf = NULL;
- parser->parser_tokidx = 0;
- parser->parser_toksiz = 0;
- parser->parser_heredoc_end = 0;
- parser->parser_command_start = Qtrue;
- parser->parser_deferred_nodes = 0;
- parser->parser_lex_pbeg = 0;
- parser->parser_lex_p = 0;
- parser->parser_lex_pend = 0;
- parser->parser_lvtbl = 0;
- parser->parser_ruby__end__seen = 0;
- parser->parser_ruby_sourcefile = 0;
-#ifndef RIPPER
- parser->is_ripper = 0;
- parser->parser_eval_tree_begin = 0;
- parser->parser_eval_tree = 0;
-#else
- parser->is_ripper = 1;
- parser->parser_ruby_sourcefile_string = Qnil;
- parser->delayed = Qnil;
-
- parser->result = Qnil;
- parser->parsing_thread = Qnil;
- parser->toplevel_p = Qtrue;
-#endif
-#ifdef YYMALLOC
- parser->heap = NULL;
-#endif
- parser->enc = rb_usascii_encoding();
-}
+ int cnt;
-#ifdef RIPPER
-#define parser_mark ripper_parser_mark
-#define parser_free ripper_parser_free
-#endif
-
-static void
-parser_mark(void *ptr)
-{
- struct parser_params *p = (struct parser_params*)ptr;
-
- rb_gc_mark((VALUE)p->parser_lex_strterm);
- rb_gc_mark((VALUE)p->parser_deferred_nodes);
- rb_gc_mark(p->parser_lex_input);
- rb_gc_mark(p->parser_lex_lastline);
- rb_gc_mark(p->parser_lex_nextline);
-#ifndef RIPPER
- rb_gc_mark((VALUE)p->parser_eval_tree_begin) ;
- rb_gc_mark((VALUE)p->parser_eval_tree) ;
- rb_gc_mark(p->debug_lines);
-#else
- rb_gc_mark(p->parser_ruby_sourcefile_string);
- rb_gc_mark(p->delayed);
- rb_gc_mark(p->value);
- rb_gc_mark(p->result);
- rb_gc_mark(p->parsing_thread);
-#endif
-#ifdef YYMALLOC
- rb_gc_mark((VALUE)p->heap);
-#endif
+ top_local_init();
+ cnt = local_cnt(c);
+ top_local_setup();
+ ruby_scope->local_vars[cnt] = val;
}
-static void
-parser_free(void *ptr)
+VALUE
+rb_backref_get()
{
- struct parser_params *p = (struct parser_params*)ptr;
- struct local_vars *local, *prev;
-
- if (p->parser_tokenbuf) {
- xfree(p->parser_tokenbuf);
+ VALUE *var = rb_svar(1);
+ if (var) {
+ return *var;
}
- for (local = p->parser_lvtbl; local; local = prev) {
- if (local->vars) xfree(local->vars);
- prev = local->prev;
- xfree(local);
- }
-#ifndef RIPPER
- xfree(p->parser_ruby_sourcefile);
-#endif
- xfree(p);
+ return Qnil;
}
-static size_t
-parser_memsize(void *ptr)
+void
+rb_backref_set(val)
+ VALUE val;
{
- struct parser_params *p = (struct parser_params*)ptr;
- struct local_vars *local;
- size_t size = sizeof(*p);
-
- if (!ptr) return 0;
- size += p->parser_toksiz;
- for (local = p->parser_lvtbl; local; local = local->prev) {
- size += sizeof(*local);
- if (local->vars) size += local->vars->capa * sizeof(ID);
+ VALUE *var = rb_svar(1);
+ if (var) {
+ *var = val;
}
-#ifndef RIPPER
- if (p->parser_ruby_sourcefile) {
- size += strlen(p->parser_ruby_sourcefile) + 1;
+ else {
+ special_local_set('~', val);
}
-#endif
- return size;
-}
-
-static const rb_data_type_t parser_data_type = {
- "parser",
- parser_mark,
- parser_free,
- parser_memsize,
-};
-
-VALUE rb_parser_get_yydebug(VALUE);
-VALUE rb_parser_set_yydebug(VALUE, VALUE);
-
-#ifndef RIPPER
-#undef rb_reserved_word
-
-const struct kwtable *
-rb_reserved_word(const char *str, unsigned int len)
-{
- return reserved_word(str, len);
-}
-
-static struct parser_params *
-parser_new(void)
-{
- struct parser_params *p;
-
- p = ALLOC_N(struct parser_params, 1);
- MEMZERO(p, struct parser_params, 1);
- parser_initialize(p);
- return p;
}
VALUE
-rb_parser_new(void)
+rb_lastline_get()
{
- struct parser_params *p = parser_new();
-
- return TypedData_Wrap_Struct(0, &parser_data_type, p);
-}
-
-/*
- * call-seq:
- * ripper#end_seen? -> Boolean
- *
- * Return if parsed source ended by +\_\_END\_\_+.
- * This number starts from 1.
- */
-VALUE
-rb_parser_end_seen_p(VALUE vparser)
-{
- struct parser_params *parser;
-
- TypedData_Get_Struct(vparser, struct parser_params, &parser_data_type, parser);
- return ruby__end__seen ? Qtrue : Qfalse;
-}
-
-/*
- * call-seq:
- * ripper#encoding -> encoding
- *
- * Return encoding of the source.
- */
-VALUE
-rb_parser_encoding(VALUE vparser)
-{
- struct parser_params *parser;
-
- TypedData_Get_Struct(vparser, struct parser_params, &parser_data_type, parser);
- return rb_enc_from_encoding(parser->enc);
-}
-
-/*
- * call-seq:
- * ripper.yydebug -> true or false
- *
- * Get yydebug.
- */
-VALUE
-rb_parser_get_yydebug(VALUE self)
-{
- struct parser_params *parser;
-
- TypedData_Get_Struct(self, struct parser_params, &parser_data_type, parser);
- return yydebug ? Qtrue : Qfalse;
+ VALUE *var = rb_svar(0);
+ if (var) {
+ return *var;
+ }
+ return Qnil;
}
-/*
- * call-seq:
- * ripper.yydebug = flag
- *
- * Set yydebug.
- */
-VALUE
-rb_parser_set_yydebug(VALUE self, VALUE flag)
+void
+rb_lastline_set(val)
+ VALUE val;
{
- struct parser_params *parser;
-
- TypedData_Get_Struct(self, struct parser_params, &parser_data_type, parser);
- yydebug = RTEST(flag);
- return flag;
+ VALUE *var = rb_svar(0);
+ if (var) {
+ *var = val;
+ }
+ else {
+ special_local_set('_', val);
+ }
}
#ifdef YYMALLOC
#define HEAPCNT(n, size) ((n) * (size) / sizeof(YYSTYPE))
-#define NEWHEAP() rb_node_newnode(NODE_ALLOCA, 0, (VALUE)parser->heap, 0)
-#define ADD2HEAP(n, c, p) ((parser->heap = (n))->u1.node = (p), \
+#define NEWHEAP() rb_node_newnode(NODE_ALLOCA, 0, (VALUE)parser_heap, 0)
+#define ADD2HEAP(n, c, p) ((parser_heap = (n))->u1.node = (p), \
(n)->u3.cnt = (c), (p))
-void *
-rb_parser_malloc(struct parser_params *parser, size_t size)
+static void *
+rb_parser_malloc(size)
+ size_t size;
{
size_t cnt = HEAPCNT(1, size);
NODE *n = NEWHEAP();
@@ -9854,8 +6421,9 @@ rb_parser_malloc(struct parser_params *parser, size_t size)
return ADD2HEAP(n, cnt, ptr);
}
-void *
-rb_parser_calloc(struct parser_params *parser, size_t nelem, size_t size)
+static void *
+rb_parser_calloc(nelem, size)
+ size_t nelem, size;
{
size_t cnt = HEAPCNT(nelem, size);
NODE *n = NEWHEAP();
@@ -9864,13 +6432,15 @@ rb_parser_calloc(struct parser_params *parser, size_t nelem, size_t size)
return ADD2HEAP(n, cnt, ptr);
}
-void *
-rb_parser_realloc(struct parser_params *parser, void *ptr, size_t size)
+static void *
+rb_parser_realloc(ptr, size)
+ void *ptr;
+ size_t size;
{
NODE *n;
size_t cnt = HEAPCNT(1, size);
- if (ptr && (n = parser->heap) != NULL) {
+ if (ptr && (n = parser_heap) != NULL) {
do {
if (n->u1.node == ptr) {
n->u1.node = ptr = xrealloc(ptr, size);
@@ -9884,12 +6454,13 @@ rb_parser_realloc(struct parser_params *parser, void *ptr, size_t size)
return ADD2HEAP(n, cnt, ptr);
}
-void
-rb_parser_free(struct parser_params *parser, void *ptr)
+static void
+rb_parser_free(ptr)
+ void *ptr;
{
- NODE **prev = &parser->heap, *n;
+ NODE **prev = &parser_heap, *n;
- while ((n = *prev) != NULL) {
+ while ((n = *prev) != 0) {
if (n->u1.node == ptr) {
*prev = n->u2.node;
rb_gc_force_recycle((VALUE)n);
@@ -9900,455 +6471,3 @@ rb_parser_free(struct parser_params *parser, void *ptr)
xfree(ptr);
}
#endif
-#endif
-
-#ifdef RIPPER
-#ifdef RIPPER_DEBUG
-extern int rb_is_pointer_to_heap(VALUE);
-
-/* :nodoc: */
-static VALUE
-ripper_validate_object(VALUE self, VALUE x)
-{
- if (x == Qfalse) return x;
- if (x == Qtrue) return x;
- if (x == Qnil) return x;
- if (x == Qundef)
- rb_raise(rb_eArgError, "Qundef given");
- if (FIXNUM_P(x)) return x;
- if (SYMBOL_P(x)) return x;
- if (!rb_is_pointer_to_heap(x))
- rb_raise(rb_eArgError, "invalid pointer: %p", x);
- switch (TYPE(x)) {
- case T_STRING:
- case T_OBJECT:
- case T_ARRAY:
- case T_BIGNUM:
- case T_FLOAT:
- return x;
- case T_NODE:
- rb_raise(rb_eArgError, "NODE given: %p", x);
- default:
- rb_raise(rb_eArgError, "wrong type of ruby object: %p (%s)",
- x, rb_obj_classname(x));
- }
- return x;
-}
-#endif
-
-#define validate(x)
-
-static VALUE
-ripper_dispatch0(struct parser_params *parser, ID mid)
-{
- return rb_funcall(parser->value, mid, 0);
-}
-
-static VALUE
-ripper_dispatch1(struct parser_params *parser, ID mid, VALUE a)
-{
- validate(a);
- return rb_funcall(parser->value, mid, 1, a);
-}
-
-static VALUE
-ripper_dispatch2(struct parser_params *parser, ID mid, VALUE a, VALUE b)
-{
- validate(a);
- validate(b);
- return rb_funcall(parser->value, mid, 2, a, b);
-}
-
-static VALUE
-ripper_dispatch3(struct parser_params *parser, ID mid, VALUE a, VALUE b, VALUE c)
-{
- validate(a);
- validate(b);
- validate(c);
- return rb_funcall(parser->value, mid, 3, a, b, c);
-}
-
-static VALUE
-ripper_dispatch4(struct parser_params *parser, ID mid, VALUE a, VALUE b, VALUE c, VALUE d)
-{
- validate(a);
- validate(b);
- validate(c);
- validate(d);
- return rb_funcall(parser->value, mid, 4, a, b, c, d);
-}
-
-static VALUE
-ripper_dispatch5(struct parser_params *parser, ID mid, VALUE a, VALUE b, VALUE c, VALUE d, VALUE e)
-{
- validate(a);
- validate(b);
- validate(c);
- validate(d);
- validate(e);
- return rb_funcall(parser->value, mid, 5, a, b, c, d, e);
-}
-
-static const struct kw_assoc {
- ID id;
- const char *name;
-} keyword_to_name[] = {
- {keyword_class, "class"},
- {keyword_module, "module"},
- {keyword_def, "def"},
- {keyword_undef, "undef"},
- {keyword_begin, "begin"},
- {keyword_rescue, "rescue"},
- {keyword_ensure, "ensure"},
- {keyword_end, "end"},
- {keyword_if, "if"},
- {keyword_unless, "unless"},
- {keyword_then, "then"},
- {keyword_elsif, "elsif"},
- {keyword_else, "else"},
- {keyword_case, "case"},
- {keyword_when, "when"},
- {keyword_while, "while"},
- {keyword_until, "until"},
- {keyword_for, "for"},
- {keyword_break, "break"},
- {keyword_next, "next"},
- {keyword_redo, "redo"},
- {keyword_retry, "retry"},
- {keyword_in, "in"},
- {keyword_do, "do"},
- {keyword_do_cond, "do"},
- {keyword_do_block, "do"},
- {keyword_return, "return"},
- {keyword_yield, "yield"},
- {keyword_super, "super"},
- {keyword_self, "self"},
- {keyword_nil, "nil"},
- {keyword_true, "true"},
- {keyword_false, "false"},
- {keyword_and, "and"},
- {keyword_or, "or"},
- {keyword_not, "not"},
- {modifier_if, "if"},
- {modifier_unless, "unless"},
- {modifier_while, "while"},
- {modifier_until, "until"},
- {modifier_rescue, "rescue"},
- {keyword_alias, "alias"},
- {keyword_defined, "defined?"},
- {keyword_BEGIN, "BEGIN"},
- {keyword_END, "END"},
- {keyword__LINE__, "__LINE__"},
- {keyword__FILE__, "__FILE__"},
- {keyword__ENCODING__, "__ENCODING__"},
- {0, NULL}
-};
-
-static const char*
-keyword_id_to_str(ID id)
-{
- const struct kw_assoc *a;
-
- for (a = keyword_to_name; a->id; a++) {
- if (a->id == id)
- return a->name;
- }
- return NULL;
-}
-
-#undef ripper_id2sym
-static VALUE
-ripper_id2sym(ID id)
-{
- const char *name;
- char buf[8];
-
- if (id <= 256) {
- buf[0] = (char)id;
- buf[1] = '\0';
- return ID2SYM(rb_intern2(buf, 1));
- }
- if ((name = keyword_id_to_str(id))) {
- return ID2SYM(rb_intern(name));
- }
- switch (id) {
- case tOROP:
- name = "||";
- break;
- case tANDOP:
- name = "&&";
- break;
- default:
- name = rb_id2name(id);
- if (!name) {
- rb_bug("cannot convert ID to string: %ld", (unsigned long)id);
- }
- break;
- }
- return ID2SYM(rb_intern(name));
-}
-
-static VALUE
-ripper_intern(const char *s)
-{
- return ID2SYM(rb_intern(s));
-}
-
-static void
-ripper_compile_error(struct parser_params *parser, const char *fmt, ...)
-{
- VALUE str;
- va_list args;
-
- va_start(args, fmt);
- str = rb_vsprintf(fmt, args);
- va_end(args);
- rb_funcall(parser->value, rb_intern("compile_error"), 1, str);
-}
-
-static void
-ripper_warn0(struct parser_params *parser, const char *fmt)
-{
- rb_funcall(parser->value, rb_intern("warn"), 1, STR_NEW2(fmt));
-}
-
-static void
-ripper_warnI(struct parser_params *parser, const char *fmt, int a)
-{
- rb_funcall(parser->value, rb_intern("warn"), 2,
- STR_NEW2(fmt), INT2NUM(a));
-}
-
-#if 0
-static void
-ripper_warnS(struct parser_params *parser, const char *fmt, const char *str)
-{
- rb_funcall(parser->value, rb_intern("warn"), 2,
- STR_NEW2(fmt), STR_NEW2(str));
-}
-#endif
-
-static void
-ripper_warning0(struct parser_params *parser, const char *fmt)
-{
- rb_funcall(parser->value, rb_intern("warning"), 1, STR_NEW2(fmt));
-}
-
-static void
-ripper_warningS(struct parser_params *parser, const char *fmt, const char *str)
-{
- rb_funcall(parser->value, rb_intern("warning"), 2,
- STR_NEW2(fmt), STR_NEW2(str));
-}
-
-static VALUE
-ripper_lex_get_generic(struct parser_params *parser, VALUE src)
-{
- return rb_funcall(src, ripper_id_gets, 0);
-}
-
-static VALUE
-ripper_s_allocate(VALUE klass)
-{
- struct parser_params *p;
- VALUE self;
-
- p = ALLOC_N(struct parser_params, 1);
- MEMZERO(p, struct parser_params, 1);
- self = TypedData_Wrap_Struct(klass, &parser_data_type, p);
- p->value = self;
- return self;
-}
-
-#define ripper_initialized_p(r) ((r)->parser_lex_input != 0)
-
-/*
- * call-seq:
- * Ripper.new(src, filename="(ripper)", lineno=1) -> ripper
- *
- * Create a new Ripper object.
- * _src_ must be a String, an IO, or an Object which has #gets method.
- *
- * This method does not starts parsing.
- * See also Ripper#parse and Ripper.parse.
- */
-static VALUE
-ripper_initialize(int argc, VALUE *argv, VALUE self)
-{
- struct parser_params *parser;
- VALUE src, fname, lineno;
-
- TypedData_Get_Struct(self, struct parser_params, &parser_data_type, parser);
- rb_scan_args(argc, argv, "12", &src, &fname, &lineno);
- if (rb_obj_respond_to(src, ripper_id_gets, 0)) {
- parser->parser_lex_gets = ripper_lex_get_generic;
- }
- else {
- StringValue(src);
- parser->parser_lex_gets = lex_get_str;
- }
- parser->parser_lex_input = src;
- parser->eofp = Qfalse;
- if (NIL_P(fname)) {
- fname = STR_NEW2("(ripper)");
- }
- else {
- StringValue(fname);
- }
- parser_initialize(parser);
-
- parser->parser_ruby_sourcefile_string = fname;
- parser->parser_ruby_sourcefile = RSTRING_PTR(fname);
- parser->parser_ruby_sourceline = NIL_P(lineno) ? 0 : NUM2INT(lineno) - 1;
-
- return Qnil;
-}
-
-extern VALUE rb_thread_pass(void);
-
-struct ripper_args {
- struct parser_params *parser;
- int argc;
- VALUE *argv;
-};
-
-static VALUE
-ripper_parse0(VALUE parser_v)
-{
- struct parser_params *parser;
-
- TypedData_Get_Struct(parser_v, struct parser_params, &parser_data_type, parser);
- parser_prepare(parser);
- ripper_yyparse((void*)parser);
- return parser->result;
-}
-
-static VALUE
-ripper_ensure(VALUE parser_v)
-{
- struct parser_params *parser;
-
- TypedData_Get_Struct(parser_v, struct parser_params, &parser_data_type, parser);
- parser->parsing_thread = Qnil;
- return Qnil;
-}
-
-/*
- * call-seq:
- * ripper#parse
- *
- * Start parsing and returns the value of the root action.
- */
-static VALUE
-ripper_parse(VALUE self)
-{
- struct parser_params *parser;
-
- TypedData_Get_Struct(self, struct parser_params, &parser_data_type, parser);
- if (!ripper_initialized_p(parser)) {
- rb_raise(rb_eArgError, "method called for uninitialized object");
- }
- if (!NIL_P(parser->parsing_thread)) {
- if (parser->parsing_thread == rb_thread_current())
- rb_raise(rb_eArgError, "Ripper#parse is not reentrant");
- else
- rb_raise(rb_eArgError, "Ripper#parse is not multithread-safe");
- }
- parser->parsing_thread = rb_thread_current();
- rb_ensure(ripper_parse0, self, ripper_ensure, self);
-
- return parser->result;
-}
-
-/*
- * call-seq:
- * ripper#column -> Integer
- *
- * Return column number of current parsing line.
- * This number starts from 0.
- */
-static VALUE
-ripper_column(VALUE self)
-{
- struct parser_params *parser;
- long col;
-
- TypedData_Get_Struct(self, struct parser_params, &parser_data_type, parser);
- if (!ripper_initialized_p(parser)) {
- rb_raise(rb_eArgError, "method called for uninitialized object");
- }
- if (NIL_P(parser->parsing_thread)) return Qnil;
- col = parser->tokp - parser->parser_lex_pbeg;
- return LONG2NUM(col);
-}
-
-/*
- * call-seq:
- * ripper#lineno -> Integer
- *
- * Return line number of current parsing line.
- * This number starts from 1.
- */
-static VALUE
-ripper_lineno(VALUE self)
-{
- struct parser_params *parser;
-
- TypedData_Get_Struct(self, struct parser_params, &parser_data_type, parser);
- if (!ripper_initialized_p(parser)) {
- rb_raise(rb_eArgError, "method called for uninitialized object");
- }
- if (NIL_P(parser->parsing_thread)) return Qnil;
- return INT2NUM(parser->parser_ruby_sourceline);
-}
-
-#ifdef RIPPER_DEBUG
-/* :nodoc: */
-static VALUE
-ripper_assert_Qundef(VALUE self, VALUE obj, VALUE msg)
-{
- StringValue(msg);
- if (obj == Qundef) {
- rb_raise(rb_eArgError, "%s", RSTRING_PTR(msg));
- }
- return Qnil;
-}
-
-/* :nodoc: */
-static VALUE
-ripper_value(VALUE self, VALUE obj)
-{
- return ULONG2NUM(obj);
-}
-#endif
-
-void
-Init_ripper(void)
-{
- VALUE Ripper;
-
- Ripper = rb_define_class("Ripper", rb_cObject);
- rb_define_const(Ripper, "Version", rb_usascii_str_new2(RIPPER_VERSION));
- rb_define_alloc_func(Ripper, ripper_s_allocate);
- rb_define_method(Ripper, "initialize", ripper_initialize, -1);
- rb_define_method(Ripper, "parse", ripper_parse, 0);
- rb_define_method(Ripper, "column", ripper_column, 0);
- rb_define_method(Ripper, "lineno", ripper_lineno, 0);
- rb_define_method(Ripper, "end_seen?", rb_parser_end_seen_p, 0);
- rb_define_method(Ripper, "encoding", rb_parser_encoding, 0);
- rb_define_method(Ripper, "yydebug", rb_parser_get_yydebug, 0);
- rb_define_method(Ripper, "yydebug=", rb_parser_set_yydebug, 1);
-#ifdef RIPPER_DEBUG
- rb_define_method(rb_mKernel, "assert_Qundef", ripper_assert_Qundef, 2);
- rb_define_method(rb_mKernel, "rawVALUE", ripper_value, 1);
- rb_define_method(rb_mKernel, "validate_object", ripper_validate_object, 1);
-#endif
-
- ripper_id_gets = rb_intern("gets");
- ripper_init_eventids1(Ripper);
- ripper_init_eventids2(Ripper);
- /* ensure existing in symbol table */
- rb_intern("||");
- rb_intern("&&");
-}
-#endif /* RIPPER */
diff --git a/prec.c b/prec.c
new file mode 100644
index 0000000000..7b215fba09
--- /dev/null
+++ b/prec.c
@@ -0,0 +1,141 @@
+/**********************************************************************
+
+ prec.c -
+
+ $Author$
+ $Date$
+ created at: Tue Jan 26 02:40:41 2000
+
+ Copyright (C) 1993-2003 Yukihiro Matsumoto
+
+**********************************************************************/
+
+#include "ruby.h"
+
+VALUE rb_mPrecision;
+
+static ID prc_pr, prc_if;
+
+
+/*
+ * call-seq:
+ * num.prec(klass) => a_klass
+ *
+ * Converts _self_ into an instance of _klass_. By default,
+ * +prec+ invokes
+ *
+ * klass.induced_from(num)
+ *
+ * and returns its value. So, if <code>klass.induced_from</code>
+ * doesn't return an instance of _klass_, it will be necessary
+ * to reimplement +prec+.
+ */
+
+static VALUE
+prec_prec(x, klass)
+ VALUE x, klass;
+{
+ return rb_funcall(klass, prc_if, 1, x);
+}
+
+/*
+ * call-seq:
+ * num.prec_i => Integer
+ *
+ * Returns an +Integer+ converted from _num_. It is equivalent
+ * to <code>prec(Integer)</code>.
+ */
+
+static VALUE
+prec_prec_i(x)
+ VALUE x;
+{
+ VALUE klass = rb_cInteger;
+
+ return rb_funcall(x, prc_pr, 1, klass);
+}
+
+/*
+ * call-seq:
+ * num.prec_f => Float
+ *
+ * Returns a +Float+ converted from _num_. It is equivalent
+ * to <code>prec(Float)</code>.
+ */
+
+static VALUE
+prec_prec_f(x)
+ VALUE x;
+{
+ VALUE klass = rb_cFloat;
+
+ return rb_funcall(x, prc_pr, 1, klass);
+}
+
+/*
+ * call-seq:
+ * Mod.induced_from(number) => a_mod
+ *
+ * Creates an instance of mod from. This method is overridden
+ * by concrete +Numeric+ classes, so that (for example)
+ *
+ * Fixnum.induced_from(9.9) #=> 9
+ *
+ * Note that a use of +prec+ in a redefinition may cause
+ * an infinite loop.
+ */
+
+static VALUE
+prec_induced_from(module, x)
+ VALUE module, x;
+{
+ rb_raise(rb_eTypeError, "undefined conversion from %s into %s",
+ rb_obj_classname(x), rb_class2name(module));
+ return Qnil; /* not reached */
+}
+
+/*
+ * call_seq:
+ * included
+ *
+ * When the +Precision+ module is mixed-in to a class, this +included+
+ * method is used to add our default +induced_from+ implementation
+ * to the host class.
+ */
+
+static VALUE
+prec_included(module, include)
+ VALUE module, include;
+{
+ switch (TYPE(include)) {
+ case T_CLASS:
+ case T_MODULE:
+ break;
+ default:
+ Check_Type(include, T_CLASS);
+ break;
+ }
+ rb_define_singleton_method(include, "induced_from", prec_induced_from, 1);
+ return module;
+}
+
+/*
+ * Precision is a mixin for concrete numeric classes with
+ * precision. Here, `precision' means the fineness of approximation
+ * of a real number, so, this module should not be included into
+ * anything which is not a subset of Real (so it should not be
+ * included in classes such as +Complex+ or +Matrix+).
+*/
+
+void
+Init_Precision()
+{
+ rb_mPrecision = rb_define_module("Precision");
+ rb_define_singleton_method(rb_mPrecision, "included", prec_included, 1);
+ rb_define_method(rb_mPrecision, "prec", prec_prec, 1);
+ rb_define_method(rb_mPrecision, "prec_i", prec_prec_i, 0);
+ rb_define_method(rb_mPrecision, "prec_f", prec_prec_f, 0);
+
+ prc_pr = rb_intern("prec");
+ prc_if = rb_intern("induced_from");
+}
diff --git a/prelude.rb b/prelude.rb
deleted file mode 100644
index fdf401b56a..0000000000
--- a/prelude.rb
+++ /dev/null
@@ -1,35 +0,0 @@
-
-# Mutex
-
-class Mutex
- def synchronize
- self.lock
- begin
- yield
- ensure
- self.unlock rescue nil
- end
- end
-end
-
-# Thread
-
-class Thread
- MUTEX_FOR_THREAD_EXCLUSIVE = Mutex.new
- def self.exclusive
- MUTEX_FOR_THREAD_EXCLUSIVE.synchronize{
- yield
- }
- end
-end
-
-def require_relative(relative_feature)
- c = caller.first
- e = c.rindex(/:\d+:in /)
- file = $`
- if /\A\((.*)\)/ =~ file # eval, etc.
- raise LoadError, "require_relative is called in #{$1}"
- end
- absolute_feature = File.expand_path(File.join(File.dirname(file), relative_feature))
- require absolute_feature
-end
diff --git a/proc.c b/proc.c
deleted file mode 100644
index 691c45b8d3..0000000000
--- a/proc.c
+++ /dev/null
@@ -1,2068 +0,0 @@
-/**********************************************************************
-
- proc.c - Proc, Binding, Env
-
- $Author$
- created at: Wed Jan 17 12:13:14 2007
-
- Copyright (C) 2004-2007 Koichi Sasada
-
-**********************************************************************/
-
-#include "eval_intern.h"
-#include "gc.h"
-
-struct METHOD {
- VALUE recv;
- VALUE rclass;
- ID id;
- rb_method_entry_t *me;
-};
-
-VALUE rb_cUnboundMethod;
-VALUE rb_cMethod;
-VALUE rb_cBinding;
-VALUE rb_cProc;
-
-VALUE rb_iseq_parameters(const rb_iseq_t *iseq, int is_proc);
-
-static VALUE bmcall(VALUE, VALUE);
-static int method_arity(VALUE);
-static int rb_obj_is_method(VALUE m);
-rb_iseq_t *rb_method_get_iseq(VALUE method);
-
-/* Proc */
-
-static void
-proc_free(void *ptr)
-{
- RUBY_FREE_ENTER("proc");
- if (ptr) {
- ruby_xfree(ptr);
- }
- RUBY_FREE_LEAVE("proc");
-}
-
-static void
-proc_mark(void *ptr)
-{
- rb_proc_t *proc;
- RUBY_MARK_ENTER("proc");
- if (ptr) {
- proc = ptr;
- RUBY_MARK_UNLESS_NULL(proc->envval);
- RUBY_MARK_UNLESS_NULL(proc->blockprocval);
- RUBY_MARK_UNLESS_NULL(proc->block.proc);
- RUBY_MARK_UNLESS_NULL(proc->block.self);
- if (proc->block.iseq && RUBY_VM_IFUNC_P(proc->block.iseq)) {
- RUBY_MARK_UNLESS_NULL((VALUE)(proc->block.iseq));
- }
- }
- RUBY_MARK_LEAVE("proc");
-}
-
-static size_t
-proc_memsize(void *ptr)
-{
- return ptr ? sizeof(rb_proc_t) : 0;
-}
-
-static const rb_data_type_t proc_data_type = {
- "proc",
- proc_mark,
- proc_free,
- proc_memsize,
-};
-
-VALUE
-rb_proc_alloc(VALUE klass)
-{
- rb_proc_t *proc;
- return TypedData_Make_Struct(klass, rb_proc_t, &proc_data_type, proc);
-}
-
-VALUE
-rb_obj_is_proc(VALUE proc)
-{
- if (rb_typeddata_is_kind_of(proc, &proc_data_type)) {
- return Qtrue;
- }
- else {
- return Qfalse;
- }
-}
-
-static VALUE
-proc_dup(VALUE self)
-{
- VALUE procval = rb_proc_alloc(rb_cProc);
- rb_proc_t *src, *dst;
- GetProcPtr(self, src);
- GetProcPtr(procval, dst);
-
- dst->block = src->block;
- dst->block.proc = procval;
- dst->envval = src->envval;
- dst->safe_level = src->safe_level;
- dst->is_lambda = src->is_lambda;
-
- return procval;
-}
-
-static VALUE
-proc_clone(VALUE self)
-{
- VALUE procval = proc_dup(self);
- CLONESETUP(procval, self);
- return procval;
-}
-
-/*
- * call-seq:
- * prc.lambda? => true or false
- *
- * Returns true for a Proc object which argument handling is rigid.
- * Such procs are typically generated by lambda.
- *
- * A Proc object generated by proc ignore extra arguments.
- *
- * proc {|a,b| [a,b] }.call(1,2,3) => [1,2]
- *
- * It provides nil for lacked arguments.
- *
- * proc {|a,b| [a,b] }.call(1) => [1,nil]
- *
- * It expand single-array argument.
- *
- * proc {|a,b| [a,b] }.call([1,2]) => [1,2]
- *
- * A Proc object generated by lambda doesn't have such tricks.
- *
- * lambda {|a,b| [a,b] }.call(1,2,3) => ArgumentError
- * lambda {|a,b| [a,b] }.call(1) => ArgumentError
- * lambda {|a,b| [a,b] }.call([1,2]) => ArgumentError
- *
- * Proc#lambda? is a predicate for the tricks.
- * It returns true if no tricks.
- *
- * lambda {}.lambda? => true
- * proc {}.lambda? => false
- *
- * Proc.new is same as proc.
- *
- * Proc.new {}.lambda? => false
- *
- * lambda, proc and Proc.new preserves the tricks of
- * a Proc object given by & argument.
- *
- * lambda(&lambda {}).lambda? => true
- * proc(&lambda {}).lambda? => true
- * Proc.new(&lambda {}).lambda? => true
- *
- * lambda(&proc {}).lambda? => false
- * proc(&proc {}).lambda? => false
- * Proc.new(&proc {}).lambda? => false
- *
- * A Proc object generated by & argument has the tricks
- *
- * def n(&b) b.lambda? end
- * n {} => false
- *
- * The & argument preserves the tricks if a Proc object is given
- * by & argument.
- *
- * n(&lambda {}) => true
- * n(&proc {}) => false
- * n(&Proc.new {}) => false
- *
- * A Proc object converted from a method has no tricks.
- *
- * def m() end
- * method(:m).to_proc.lambda? => true
- *
- * n(&method(:m)) => true
- * n(&method(:m).to_proc) => true
- *
- * define_method is treated same as method definition.
- * The defined method has no tricks.
- *
- * class C
- * define_method(:d) {}
- * end
- * C.new.e(1,2) => ArgumentError
- * C.new.method(:d).to_proc.lambda? => true
- *
- * define_method always defines a method without the tricks,
- * even if a non-lambda Proc object is given.
- * This is the only exception which the tricks are not preserved.
- *
- * class C
- * define_method(:e, &proc {})
- * end
- * C.new.e(1,2) => ArgumentError
- * C.new.method(:e).to_proc.lambda? => true
- *
- * This exception is for a wrapper of define_method.
- * It eases defining a method defining method which defines a usual method which has no tricks.
- *
- * class << C
- * def def2(name, &body)
- * define_method(name, &body)
- * end
- * end
- * class C
- * def2(:f) {}
- * end
- * C.new.f(1,2) => ArgumentError
- *
- * The wrapper, def2, defines a method which has no tricks.
- *
- */
-
-static VALUE
-proc_lambda_p(VALUE procval)
-{
- rb_proc_t *proc;
- GetProcPtr(procval, proc);
-
- return proc->is_lambda ? Qtrue : Qfalse;
-}
-
-/* Binding */
-
-static void
-binding_free(void *ptr)
-{
- rb_binding_t *bind;
- RUBY_FREE_ENTER("binding");
- if (ptr) {
- bind = ptr;
- ruby_xfree(ptr);
- }
- RUBY_FREE_LEAVE("binding");
-}
-
-static void
-binding_mark(void *ptr)
-{
- rb_binding_t *bind;
- RUBY_MARK_ENTER("binding");
- if (ptr) {
- bind = ptr;
- RUBY_MARK_UNLESS_NULL(bind->env);
- }
- RUBY_MARK_LEAVE("binding");
-}
-
-static size_t
-binding_memsize(void *ptr)
-{
- return ptr ? sizeof(rb_binding_t) : 0;
-}
-
-static const rb_data_type_t binding_data_type = {
- "binding",
- binding_mark,
- binding_free,
- binding_memsize,
-};
-
-static VALUE
-binding_alloc(VALUE klass)
-{
- VALUE obj;
- rb_binding_t *bind;
- obj = TypedData_Make_Struct(klass, rb_binding_t, &binding_data_type, bind);
- return obj;
-}
-
-static VALUE
-binding_dup(VALUE self)
-{
- VALUE bindval = binding_alloc(rb_cBinding);
- rb_binding_t *src, *dst;
- GetBindingPtr(self, src);
- GetBindingPtr(bindval, dst);
- dst->env = src->env;
- return bindval;
-}
-
-static VALUE
-binding_clone(VALUE self)
-{
- VALUE bindval = binding_dup(self);
- CLONESETUP(bindval, self);
- return bindval;
-}
-
-VALUE
-rb_binding_new(void)
-{
- rb_thread_t *th = GET_THREAD();
- rb_control_frame_t *cfp = rb_vm_get_ruby_level_next_cfp(th, th->cfp);
- VALUE bindval = binding_alloc(rb_cBinding);
- rb_binding_t *bind;
-
- if (cfp == 0) {
- rb_raise(rb_eRuntimeError, "Can't create Binding Object on top of Fiber.");
- }
-
- GetBindingPtr(bindval, bind);
- bind->env = rb_vm_make_env_object(th, cfp);
- return bindval;
-}
-
-/*
- * call-seq:
- * binding -> a_binding
- *
- * Returns a +Binding+ object, describing the variable and
- * method bindings at the point of call. This object can be used when
- * calling +eval+ to execute the evaluated command in this
- * environment. Also see the description of class +Binding+.
- *
- * def getBinding(param)
- * return binding
- * end
- * b = getBinding("hello")
- * eval("param", b) #=> "hello"
- */
-
-static VALUE
-rb_f_binding(VALUE self)
-{
- return rb_binding_new();
-}
-
-/*
- * call-seq:
- * binding.eval(string [, filename [,lineno]]) => obj
- *
- * Evaluates the Ruby expression(s) in <em>string</em>, in the
- * <em>binding</em>'s context. If the optional <em>filename</em> and
- * <em>lineno</em> parameters are present, they will be used when
- * reporting syntax errors.
- *
- * def getBinding(param)
- * return binding
- * end
- * b = getBinding("hello")
- * b.eval("param") #=> "hello"
- */
-
-static VALUE
-bind_eval(int argc, VALUE *argv, VALUE bindval)
-{
- VALUE args[4];
-
- rb_scan_args(argc, argv, "12", &args[0], &args[2], &args[3]);
- args[1] = bindval;
- return rb_f_eval(argc+1, args, Qnil /* self will be searched in eval */);
-}
-
-static VALUE
-proc_new(VALUE klass, int is_lambda)
-{
- VALUE procval = Qnil;
- rb_thread_t *th = GET_THREAD();
- rb_control_frame_t *cfp = th->cfp;
- rb_block_t *block;
-
- if ((GC_GUARDED_PTR_REF(cfp->lfp[0])) != 0 &&
- !RUBY_VM_CLASS_SPECIAL_P(cfp->lfp[0])) {
-
- block = GC_GUARDED_PTR_REF(cfp->lfp[0]);
- }
- else {
- cfp = RUBY_VM_PREVIOUS_CONTROL_FRAME(cfp);
-
- if ((GC_GUARDED_PTR_REF(cfp->lfp[0])) != 0 &&
- !RUBY_VM_CLASS_SPECIAL_P(cfp->lfp[0])) {
-
- block = GC_GUARDED_PTR_REF(cfp->lfp[0]);
-
- if (is_lambda) {
- rb_warn("tried to create Proc object without a block");
- }
- }
- else {
- rb_raise(rb_eArgError,
- "tried to create Proc object without a block");
- }
- }
-
- procval = block->proc;
-
- if (procval) {
- if (RBASIC(procval)->klass == klass) {
- return procval;
- }
- else {
- VALUE newprocval = proc_dup(procval);
- RBASIC(newprocval)->klass = klass;
- return newprocval;
- }
- }
-
- procval = rb_vm_make_proc(th, block, klass);
-
- if (is_lambda) {
- rb_proc_t *proc;
- GetProcPtr(procval, proc);
- proc->is_lambda = Qtrue;
- }
- return procval;
-}
-
-/*
- * call-seq:
- * Proc.new {|...| block } => a_proc
- * Proc.new => a_proc
- *
- * Creates a new <code>Proc</code> object, bound to the current
- * context. <code>Proc::new</code> may be called without a block only
- * within a method with an attached block, in which case that block is
- * converted to the <code>Proc</code> object.
- *
- * def proc_from
- * Proc.new
- * end
- * proc = proc_from { "hello" }
- * proc.call #=> "hello"
- */
-
-static VALUE
-rb_proc_s_new(int argc, VALUE *argv, VALUE klass)
-{
- VALUE block = proc_new(klass, Qfalse);
-
- rb_obj_call_init(block, argc, argv);
- return block;
-}
-
-/*
- * call-seq:
- * proc { |...| block } => a_proc
- *
- * Equivalent to <code>Proc.new</code>.
- */
-
-VALUE
-rb_block_proc(void)
-{
- return proc_new(rb_cProc, Qfalse);
-}
-
-VALUE
-rb_block_lambda(void)
-{
- return proc_new(rb_cProc, Qtrue);
-}
-
-VALUE
-rb_f_lambda(void)
-{
- rb_warn("rb_f_lambda() is deprecated; use rb_block_proc() instead");
- return rb_block_lambda();
-}
-
-/*
- * call-seq:
- * lambda { |...| block } => a_proc
- *
- * Equivalent to <code>Proc.new</code>, except the resulting Proc objects
- * check the number of parameters passed when called.
- */
-
-static VALUE
-proc_lambda(void)
-{
- return rb_block_lambda();
-}
-
-/* CHECKME: are the argument checking semantics correct? */
-
-/*
- * call-seq:
- * prc.call(params,...) => obj
- * prc[params,...] => obj
- * prc.(params,...) => obj
- *
- * Invokes the block, setting the block's parameters to the values in
- * <i>params</i> using something close to method calling semantics.
- * Generates a warning if multiple values are passed to a proc that
- * expects just one (previously this silently converted the parameters
- * to an array). Note that prc.() invokes prc.call() with the parameters
- * given. It's a syntax sugar to hide "call".
- *
- * For procs created using <code>Kernel.proc</code>, generates an
- * error if the wrong number of parameters
- * are passed to a proc with multiple parameters. For procs created using
- * <code>Proc.new</code>, extra parameters are silently discarded.
- *
- * Returns the value of the last expression evaluated in the block. See
- * also <code>Proc#yield</code>.
- *
- * a_proc = Proc.new {|a, *b| b.collect {|i| i*a }}
- * a_proc.call(9, 1, 2, 3) #=> [9, 18, 27]
- * a_proc[9, 1, 2, 3] #=> [9, 18, 27]
- * a_proc = Proc.new {|a,b| a}
- * a_proc.call(1,2,3)
- *
- * <em>produces:</em>
- *
- * prog.rb:5: wrong number of arguments (3 for 2) (ArgumentError)
- * from prog.rb:4:in `call'
- * from prog.rb:5
- */
-
-/*
- * call-seq:
- * prc === obj => obj
- *
- * Invokes the block, with <i>obj</i> as the block's parameter. It is
- * to allow a proc object to be a target of when clause in the case statement.
- */
-
-static VALUE
-proc_call(int argc, VALUE *argv, VALUE procval)
-{
- rb_proc_t *proc;
- rb_block_t *blockptr = 0;
- rb_iseq_t *iseq;
- GetProcPtr(procval, proc);
-
- iseq = proc->block.iseq;
- if (BUILTIN_TYPE(iseq) == T_NODE || iseq->arg_block != -1) {
- if (rb_block_given_p()) {
- rb_proc_t *proc;
- VALUE procval;
- procval = rb_block_proc();
- GetProcPtr(procval, proc);
- blockptr = &proc->block;
- }
- }
-
- return rb_vm_invoke_proc(GET_THREAD(), proc, proc->block.self,
- argc, argv, blockptr);
-}
-
-#if SIZEOF_LONG > SIZEOF_INT
-static inline int
-check_argc(long argc)
-{
- if (argc > INT_MAX || argc < 0) {
- rb_raise(rb_eArgError, "too many arguments (%lu)",
- (unsigned long)argc);
- }
- return (int)argc;
-}
-#else
-#define check_argc(argc) (argc)
-#endif
-
-VALUE
-rb_proc_call(VALUE self, VALUE args)
-{
- rb_proc_t *proc;
- GetProcPtr(self, proc);
- return rb_vm_invoke_proc(GET_THREAD(), proc, proc->block.self,
- check_argc(RARRAY_LEN(args)), RARRAY_PTR(args), 0);
-}
-
-VALUE
-rb_proc_call_with_block(VALUE self, int argc, VALUE *argv, VALUE pass_procval)
-{
- rb_proc_t *proc;
- rb_block_t *block = 0;
- GetProcPtr(self, proc);
-
- if (!NIL_P(pass_procval)) {
- rb_proc_t *pass_proc;
- GetProcPtr(pass_procval, pass_proc);
- block = &pass_proc->block;
- }
-
- return rb_vm_invoke_proc(GET_THREAD(), proc, proc->block.self,
- argc, argv, block);
-}
-
-/*
- * call-seq:
- * prc.arity -> fixnum
- *
- * Returns the number of arguments that would not be ignored. If the block
- * is declared to take no arguments, returns 0. If the block is known
- * to take exactly n arguments, returns n. If the block has optional
- * arguments, return -n-1, where n is the number of mandatory
- * arguments. A <code>proc</code> with no argument declarations
- * is the same a block declaring <code>||</code> as its arguments.
- *
- * Proc.new {}.arity #=> 0
- * Proc.new {||}.arity #=> 0
- * Proc.new {|a|}.arity #=> 1
- * Proc.new {|a,b|}.arity #=> 2
- * Proc.new {|a,b,c|}.arity #=> 3
- * Proc.new {|*a|}.arity #=> -1
- * Proc.new {|a,*b|}.arity #=> -2
- * Proc.new {|a,*b, c|}.arity #=> -3
- */
-
-static VALUE
-proc_arity(VALUE self)
-{
- int arity = rb_proc_arity(self);
- return INT2FIX(arity);
-}
-
-int
-rb_proc_arity(VALUE self)
-{
- rb_proc_t *proc;
- rb_iseq_t *iseq;
- GetProcPtr(self, proc);
- iseq = proc->block.iseq;
- if (iseq) {
- if (BUILTIN_TYPE(iseq) != T_NODE) {
- if (iseq->arg_rest < 0) {
- return iseq->argc;
- }
- else {
- return -(iseq->argc + 1 + iseq->arg_post_len);
- }
- }
- else {
- NODE *node = (NODE *)iseq;
- if (nd_type(node) == NODE_IFUNC && node->nd_cfnc == bmcall) {
- /* method(:foo).to_proc.arity */
- return method_arity(node->nd_tval);
- }
- }
- }
- return -1;
-}
-
-static rb_iseq_t *
-get_proc_iseq(VALUE self, int *is_proc)
-{
- rb_proc_t *proc;
- rb_iseq_t *iseq;
-
- GetProcPtr(self, proc);
- iseq = proc->block.iseq;
- if (is_proc) *is_proc = !proc->is_lambda;
- if (!RUBY_VM_NORMAL_ISEQ_P(iseq)) {
- NODE *node = (NODE *)iseq;
- iseq = 0;
- if (nd_type(node) == NODE_IFUNC && node->nd_cfnc == bmcall) {
- /* method(:foo).to_proc */
- iseq = rb_method_get_iseq(node->nd_tval);
- if (is_proc) *is_proc = 0;
- }
- }
- return iseq;
-}
-
-static VALUE
-iseq_location(rb_iseq_t *iseq)
-{
- VALUE loc[2];
-
- if (!iseq) return Qnil;
- loc[0] = iseq->filename;
- if (iseq->insn_info_table) {
- loc[1] = INT2FIX(rb_iseq_first_lineno(iseq));
- }
- else {
- loc[1] = Qnil;
- }
- return rb_ary_new4(2, loc);
-}
-
-/*
- * call-seq:
- * prc.source_location => [String, Fixnum]
- *
- * returns the ruby source filename and line number containing this proc
- * or nil if this proc was not defined in ruby (i.e. native)
- */
-
-VALUE
-rb_proc_location(VALUE self)
-{
- return iseq_location(get_proc_iseq(self, 0));
-}
-
-static VALUE
-unnamed_parameters(int arity)
-{
- VALUE a, param = rb_ary_new2((arity < 0) ? -arity : arity);
- int n = (arity < 0) ? ~arity : arity;
- ID req, rest;
- CONST_ID(req, "req");
- a = rb_ary_new3(1, ID2SYM(req));
- OBJ_FREEZE(a);
- for (; n; --n) {
- rb_ary_push(param, a);
- }
- if (arity < 0) {
- CONST_ID(rest, "rest");
- rb_ary_store(param, ~arity, rb_ary_new3(1, ID2SYM(rest)));
- }
- return param;
-}
-
-/*
- * call-seq:
- * proc.parameters => array
- *
- * returns the parameter information of this proc
- */
-
-static VALUE
-rb_proc_parameters(VALUE self)
-{
- int is_proc;
- rb_iseq_t *iseq = get_proc_iseq(self, &is_proc);
- if (!iseq) {
- return unnamed_parameters(rb_proc_arity(self));
- }
- return rb_iseq_parameters(iseq, is_proc);
-}
-
-/*
- * call-seq:
- * prc == other_proc => true or false
- *
- * Return <code>true</code> if <i>prc</i> is the same object as
- * <i>other_proc</i>, or if they are both procs with the same body.
- */
-
-static VALUE
-proc_eq(VALUE self, VALUE other)
-{
- if (self == other) {
- return Qtrue;
- }
- else {
- if (rb_obj_is_proc(other)) {
- rb_proc_t *p1, *p2;
- GetProcPtr(self, p1);
- GetProcPtr(other, p2);
- if (p1->envval == p2->envval &&
- p1->block.iseq->iseq_size == p2->block.iseq->iseq_size &&
- p1->block.iseq->local_size == p2->block.iseq->local_size &&
- MEMCMP(p1->block.iseq->iseq, p2->block.iseq->iseq, VALUE,
- p1->block.iseq->iseq_size) == 0) {
- return Qtrue;
- }
- }
- }
- return Qfalse;
-}
-
-/*
- * call-seq:
- * prc.hash => integer
- *
- * Return hash value corresponding to proc body.
- */
-
-static VALUE
-proc_hash(VALUE self)
-{
- long hash;
- rb_proc_t *proc;
- GetProcPtr(self, proc);
- hash = (long)proc->block.iseq;
- hash ^= (long)proc->envval;
- hash ^= (long)proc->block.lfp >> 16;
- return LONG2FIX(hash);
-}
-
-/*
- * call-seq:
- * prc.to_s => string
- *
- * Shows the unique identifier for this proc, along with
- * an indication of where the proc was defined.
- */
-
-static VALUE
-proc_to_s(VALUE self)
-{
- VALUE str = 0;
- rb_proc_t *proc;
- const char *cname = rb_obj_classname(self);
- rb_iseq_t *iseq;
- const char *is_lambda;
-
- GetProcPtr(self, proc);
- iseq = proc->block.iseq;
- is_lambda = proc->is_lambda ? " (lambda)" : "";
-
- if (RUBY_VM_NORMAL_ISEQ_P(iseq)) {
- int line_no = 0;
-
- if (iseq->insn_info_table) {
- line_no = rb_iseq_first_lineno(iseq);
- }
- str = rb_sprintf("#<%s:%p@%s:%d%s>", cname, (void *)self,
- RSTRING_PTR(iseq->filename),
- line_no, is_lambda);
- }
- else {
- str = rb_sprintf("#<%s:%p%s>", cname, (void *)proc->block.iseq,
- is_lambda);
- }
-
- if (OBJ_TAINTED(self)) {
- OBJ_TAINT(str);
- }
- return str;
-}
-
-/*
- * call-seq:
- * prc.to_proc -> prc
- *
- * Part of the protocol for converting objects to <code>Proc</code>
- * objects. Instances of class <code>Proc</code> simply return
- * themselves.
- */
-
-static VALUE
-proc_to_proc(VALUE self)
-{
- return self;
-}
-
-static void
-bm_mark(void *ptr)
-{
- struct METHOD *data = ptr;
- rb_gc_mark(data->rclass);
- rb_gc_mark(data->recv);
- rb_gc_mark_method_entry(data->me);
-}
-
-static size_t
-bm_memsize(void *ptr)
-{
- return ptr ? sizeof(struct METHOD) : 0;
-}
-
-static const rb_data_type_t method_data_type = {
- "method",
- bm_mark,
- RUBY_TYPED_DEFAULT_FREE,
- bm_memsize,
-};
-
-static inline int
-rb_obj_is_method(VALUE m)
-{
- return rb_typeddata_is_kind_of(m, &method_data_type);
-}
-
-static VALUE
-mnew(VALUE klass, VALUE obj, ID id, VALUE mclass, int scope)
-{
- VALUE method;
- VALUE rclass = klass;
- ID rid = id;
- struct METHOD *data;
- rb_method_entry_t *me;
-
- again:
- me = rb_method_entry(klass, id);
- if (!me) {
- rb_print_undef(klass, id, 0);
- }
- if (scope && (me->flag & NOEX_MASK) != NOEX_PUBLIC) {
- rb_print_undef(rclass, me->original_id, (int)(me->flag & NOEX_MASK));
- }
- if (me->type == VM_METHOD_TYPE_ZSUPER) {
- klass = RCLASS_SUPER(me->klass);
- id = me->original_id;
- goto again;
- }
-
- klass = me->klass;
-
- while (rclass != klass &&
- (FL_TEST(rclass, FL_SINGLETON) || TYPE(rclass) == T_ICLASS)) {
- rclass = RCLASS_SUPER(rclass);
- }
-
- if (TYPE(klass) == T_ICLASS) {
- klass = RBASIC(klass)->klass;
- }
-
- method = TypedData_Make_Struct(mclass, struct METHOD, &method_data_type, data);
-
- data->recv = obj;
- data->rclass = rclass;
- data->id = rid;
- data->me = me;
-
- OBJ_INFECT(method, klass);
-
- return method;
-}
-
-
-/**********************************************************************
- *
- * Document-class : Method
- *
- * Method objects are created by <code>Object#method</code>, and are
- * associated with a particular object (not just with a class). They
- * may be used to invoke the method within the object, and as a block
- * associated with an iterator. They may also be unbound from one
- * object (creating an <code>UnboundMethod</code>) and bound to
- * another.
- *
- * class Thing
- * def square(n)
- * n*n
- * end
- * end
- * thing = Thing.new
- * meth = thing.method(:square)
- *
- * meth.call(9) #=> 81
- * [ 1, 2, 3 ].collect(&meth) #=> [1, 4, 9]
- *
- */
-
-/*
- * call-seq:
- * meth == other_meth => true or false
- *
- * Two method objects are equal if that are bound to the same
- * object and contain the same body.
- */
-
-static VALUE
-method_eq(VALUE method, VALUE other)
-{
- struct METHOD *m1, *m2;
- extern int rb_method_entry_eq(rb_method_entry_t *m1, rb_method_entry_t *m2);
-
- if (!rb_obj_is_method(other))
- return Qfalse;
- if (CLASS_OF(method) != CLASS_OF(other))
- return Qfalse;
-
- Check_TypedStruct(method, &method_data_type);
- m1 = (struct METHOD *)DATA_PTR(method);
- m2 = (struct METHOD *)DATA_PTR(other);
-
- if (!rb_method_entry_eq(m1->me, m2->me) ||
- m1->rclass != m2->rclass ||
- m1->recv != m2->recv) {
- return Qfalse;
- }
-
- return Qtrue;
-}
-
-/*
- * call-seq:
- * meth.hash => integer
- *
- * Return a hash value corresponding to the method object.
- */
-
-static VALUE
-method_hash(VALUE method)
-{
- struct METHOD *m;
- long hash;
-
- TypedData_Get_Struct(method, struct METHOD, &method_data_type, m);
- hash = (long)m->rclass;
- hash ^= (long)m->recv;
- hash ^= (long)m->me;
-
- return INT2FIX(hash);
-}
-
-/*
- * call-seq:
- * meth.unbind => unbound_method
- *
- * Dissociates <i>meth</i> from it's current receiver. The resulting
- * <code>UnboundMethod</code> can subsequently be bound to a new object
- * of the same class (see <code>UnboundMethod</code>).
- */
-
-static VALUE
-method_unbind(VALUE obj)
-{
- VALUE method;
- struct METHOD *orig, *data;
-
- TypedData_Get_Struct(obj, struct METHOD, &method_data_type, orig);
- method = TypedData_Make_Struct(rb_cUnboundMethod, struct METHOD,
- &method_data_type, data);
- data->recv = Qundef;
- data->id = orig->id;
- data->me = orig->me;
- data->rclass = orig->rclass;
- OBJ_INFECT(method, obj);
-
- return method;
-}
-
-/*
- * call-seq:
- * meth.receiver => object
- *
- * Returns the bound receiver of the method object.
- */
-
-static VALUE
-method_receiver(VALUE obj)
-{
- struct METHOD *data;
-
- TypedData_Get_Struct(obj, struct METHOD, &method_data_type, data);
- return data->recv;
-}
-
-/*
- * call-seq:
- * meth.name => symbol
- *
- * Returns the name of the method.
- */
-
-static VALUE
-method_name(VALUE obj)
-{
- struct METHOD *data;
-
- TypedData_Get_Struct(obj, struct METHOD, &method_data_type, data);
- return ID2SYM(data->id);
-}
-
-/*
- * call-seq:
- * meth.owner => class_or_module
- *
- * Returns the class or module that defines the method.
- */
-
-static VALUE
-method_owner(VALUE obj)
-{
- struct METHOD *data;
-
- TypedData_Get_Struct(obj, struct METHOD, &method_data_type, data);
- return data->me->klass;
-}
-
-/*
- * call-seq:
- * obj.method(sym) => method
- *
- * Looks up the named method as a receiver in <i>obj</i>, returning a
- * <code>Method</code> object (or raising <code>NameError</code>). The
- * <code>Method</code> object acts as a closure in <i>obj</i>'s object
- * instance, so instance variables and the value of <code>self</code>
- * remain available.
- *
- * class Demo
- * def initialize(n)
- * @iv = n
- * end
- * def hello()
- * "Hello, @iv = #{@iv}"
- * end
- * end
- *
- * k = Demo.new(99)
- * m = k.method(:hello)
- * m.call #=> "Hello, @iv = 99"
- *
- * l = Demo.new('Fred')
- * m = l.method("hello")
- * m.call #=> "Hello, @iv = Fred"
- */
-
-VALUE
-rb_obj_method(VALUE obj, VALUE vid)
-{
- return mnew(CLASS_OF(obj), obj, rb_to_id(vid), rb_cMethod, Qfalse);
-}
-
-VALUE
-rb_obj_public_method(VALUE obj, VALUE vid)
-{
- return mnew(CLASS_OF(obj), obj, rb_to_id(vid), rb_cMethod, Qtrue);
-}
-
-/*
- * call-seq:
- * mod.instance_method(symbol) => unbound_method
- *
- * Returns an +UnboundMethod+ representing the given
- * instance method in _mod_.
- *
- * class Interpreter
- * def do_a() print "there, "; end
- * def do_d() print "Hello "; end
- * def do_e() print "!\n"; end
- * def do_v() print "Dave"; end
- * Dispatcher = {
- * ?a => instance_method(:do_a),
- * ?d => instance_method(:do_d),
- * ?e => instance_method(:do_e),
- * ?v => instance_method(:do_v)
- * }
- * def interpret(string)
- * string.each_byte {|b| Dispatcher[b].bind(self).call }
- * end
- * end
- *
- *
- * interpreter = Interpreter.new
- * interpreter.interpret('dave')
- *
- * <em>produces:</em>
- *
- * Hello there, Dave!
- */
-
-static VALUE
-rb_mod_instance_method(VALUE mod, VALUE vid)
-{
- return mnew(mod, Qundef, rb_to_id(vid), rb_cUnboundMethod, Qfalse);
-}
-
-static VALUE
-rb_mod_public_instance_method(VALUE mod, VALUE vid)
-{
- return mnew(mod, Qundef, rb_to_id(vid), rb_cUnboundMethod, Qtrue);
-}
-
-/*
- * call-seq:
- * define_method(symbol, method) => new_method
- * define_method(symbol) { block } => proc
- *
- * Defines an instance method in the receiver. The _method_
- * parameter can be a +Proc+ or +Method+ object.
- * If a block is specified, it is used as the method body. This block
- * is evaluated using <code>instance_eval</code>, a point that is
- * tricky to demonstrate because <code>define_method</code> is private.
- * (This is why we resort to the +send+ hack in this example.)
- *
- * class A
- * def fred
- * puts "In Fred"
- * end
- * def create_method(name, &block)
- * self.class.send(:define_method, name, &block)
- * end
- * define_method(:wilma) { puts "Charge it!" }
- * end
- * class B < A
- * define_method(:barney, instance_method(:fred))
- * end
- * a = B.new
- * a.barney
- * a.wilma
- * a.create_method(:betty) { p self }
- * a.betty
- *
- * <em>produces:</em>
- *
- * In Fred
- * Charge it!
- * #<B:0x401b39e8>
- */
-
-static VALUE
-rb_mod_define_method(int argc, VALUE *argv, VALUE mod)
-{
- ID id;
- VALUE body;
- int noex = NOEX_PUBLIC;
-
- if (argc == 1) {
- id = rb_to_id(argv[0]);
- body = rb_block_lambda();
- }
- else if (argc == 2) {
- id = rb_to_id(argv[0]);
- body = argv[1];
- if (!rb_obj_is_method(body) && !rb_obj_is_proc(body)) {
- rb_raise(rb_eTypeError,
- "wrong argument type %s (expected Proc/Method)",
- rb_obj_classname(body));
- }
- }
- else {
- rb_raise(rb_eArgError, "wrong number of arguments (%d for 1)", argc);
- }
-
- if (rb_obj_is_method(body)) {
- struct METHOD *method = (struct METHOD *)DATA_PTR(body);
- VALUE rclass = method->rclass;
- if (rclass != mod) {
- if (FL_TEST(rclass, FL_SINGLETON)) {
- rb_raise(rb_eTypeError,
- "can't bind singleton method to a different class");
- }
- if (!RTEST(rb_class_inherited_p(mod, rclass))) {
- rb_raise(rb_eTypeError,
- "bind argument must be a subclass of %s",
- rb_class2name(rclass));
- }
- }
- rb_add_method_me(mod, id, method->me, noex);
- }
- else if (rb_obj_is_proc(body)) {
- rb_proc_t *proc;
- body = proc_dup(body);
- GetProcPtr(body, proc);
- if (BUILTIN_TYPE(proc->block.iseq) != T_NODE) {
- proc->block.iseq->defined_method_id = id;
- proc->block.iseq->klass = mod;
- proc->is_lambda = Qtrue;
- proc->is_from_method = Qtrue;
- }
- rb_add_method(mod, id, VM_METHOD_TYPE_BMETHOD, (void *)body, noex);
- }
- else {
- /* type error */
- rb_raise(rb_eTypeError, "wrong argument type (expected Proc/Method)");
- }
-
- return body;
-}
-
-/*
- * call-seq:
- * define_singleton_method(symbol, method) => new_method
- * define_singleton_method(symbol) { block } => proc
- *
- * Defines a singleton method in the receiver. The _method_
- * parameter can be a +Proc+ or +Method+ object.
- * If a block is specified, it is used as the method body.
- *
- * class A
- * class << self
- * def class_name
- * to_s
- * end
- * end
- * end
- * A.define_singleton_method(:who_am_i) do
- * "I am: #{class_name}"
- * end
- * A.who_am_i # ==> "I am: A"
- *
- * guy = "Bob"
- * guy.define_singleton_method(:hello) { "#{self}: Hello there!" }
- * guy.hello # => "Bob: Hello there!"
- */
-
-static VALUE
-rb_obj_define_method(int argc, VALUE *argv, VALUE obj)
-{
- VALUE klass = rb_singleton_class(obj);
-
- return rb_mod_define_method(argc, argv, klass);
-}
-
-
-/*
- * MISSING: documentation
- */
-
-static VALUE
-method_clone(VALUE self)
-{
- VALUE clone;
- struct METHOD *orig, *data;
-
- TypedData_Get_Struct(self, struct METHOD, &method_data_type, orig);
- clone = TypedData_Make_Struct(CLASS_OF(self), struct METHOD, &method_data_type, data);
- CLONESETUP(clone, self);
- *data = *orig;
-
- return clone;
-}
-
-/*
- * call-seq:
- * meth.call(args, ...) => obj
- * meth[args, ...] => obj
- *
- * Invokes the <i>meth</i> with the specified arguments, returning the
- * method's return value.
- *
- * m = 12.method("+")
- * m.call(3) #=> 15
- * m.call(20) #=> 32
- */
-
-VALUE
-rb_method_call(int argc, VALUE *argv, VALUE method)
-{
- VALUE result = Qnil; /* OK */
- struct METHOD *data;
- int state;
- volatile int safe = -1;
-
- TypedData_Get_Struct(method, struct METHOD, &method_data_type, data);
- if (data->recv == Qundef) {
- rb_raise(rb_eTypeError, "can't call unbound method; bind first");
- }
- PUSH_TAG();
- if (OBJ_TAINTED(method)) {
- safe = rb_safe_level();
- if (rb_safe_level() < 4) {
- rb_set_safe_level_force(4);
- }
- }
- if ((state = EXEC_TAG()) == 0) {
- rb_thread_t *th = GET_THREAD();
- VALUE rb_vm_call(rb_thread_t *th, VALUE recv, VALUE id, int argc, const VALUE *argv,
- const rb_method_entry_t *me);
-
- PASS_PASSED_BLOCK_TH(th);
- result = rb_vm_call(th, data->recv, data->id, argc, argv, data->me);
- }
- POP_TAG();
- if (safe >= 0)
- rb_set_safe_level_force(safe);
- if (state)
- JUMP_TAG(state);
- return result;
-}
-
-/**********************************************************************
- *
- * Document-class: UnboundMethod
- *
- * Ruby supports two forms of objectified methods. Class
- * <code>Method</code> is used to represent methods that are associated
- * with a particular object: these method objects are bound to that
- * object. Bound method objects for an object can be created using
- * <code>Object#method</code>.
- *
- * Ruby also supports unbound methods; methods objects that are not
- * associated with a particular object. These can be created either by
- * calling <code>Module#instance_method</code> or by calling
- * <code>unbind</code> on a bound method object. The result of both of
- * these is an <code>UnboundMethod</code> object.
- *
- * Unbound methods can only be called after they are bound to an
- * object. That object must be be a kind_of? the method's original
- * class.
- *
- * class Square
- * def area
- * @side * @side
- * end
- * def initialize(side)
- * @side = side
- * end
- * end
- *
- * area_un = Square.instance_method(:area)
- *
- * s = Square.new(12)
- * area = area_un.bind(s)
- * area.call #=> 144
- *
- * Unbound methods are a reference to the method at the time it was
- * objectified: subsequent changes to the underlying class will not
- * affect the unbound method.
- *
- * class Test
- * def test
- * :original
- * end
- * end
- * um = Test.instance_method(:test)
- * class Test
- * def test
- * :modified
- * end
- * end
- * t = Test.new
- * t.test #=> :modified
- * um.bind(t).call #=> :original
- *
- */
-
-/*
- * call-seq:
- * umeth.bind(obj) -> method
- *
- * Bind <i>umeth</i> to <i>obj</i>. If <code>Klass</code> was the class
- * from which <i>umeth</i> was obtained,
- * <code>obj.kind_of?(Klass)</code> must be true.
- *
- * class A
- * def test
- * puts "In test, class = #{self.class}"
- * end
- * end
- * class B < A
- * end
- * class C < B
- * end
- *
- *
- * um = B.instance_method(:test)
- * bm = um.bind(C.new)
- * bm.call
- * bm = um.bind(B.new)
- * bm.call
- * bm = um.bind(A.new)
- * bm.call
- *
- * <em>produces:</em>
- *
- * In test, class = C
- * In test, class = B
- * prog.rb:16:in `bind': bind argument must be an instance of B (TypeError)
- * from prog.rb:16
- */
-
-static VALUE
-umethod_bind(VALUE method, VALUE recv)
-{
- struct METHOD *data, *bound;
-
- TypedData_Get_Struct(method, struct METHOD, &method_data_type, data);
- if (data->rclass != CLASS_OF(recv)) {
- if (FL_TEST(data->rclass, FL_SINGLETON)) {
- rb_raise(rb_eTypeError,
- "singleton method called for a different object");
- }
- if (!rb_obj_is_kind_of(recv, data->rclass)) {
- rb_raise(rb_eTypeError, "bind argument must be an instance of %s",
- rb_class2name(data->rclass));
- }
- }
-
- method = TypedData_Make_Struct(rb_cMethod, struct METHOD, &method_data_type, bound);
- *bound = *data;
- bound->recv = recv;
- bound->rclass = CLASS_OF(recv);
-
- return method;
-}
-
-int
-rb_method_entry_arity(const rb_method_entry_t *me)
-{
- switch (me->type) {
- case VM_METHOD_TYPE_CFUNC:
- if (me->body.cfunc.argc < 0)
- return -1;
- return check_argc(me->body.cfunc.argc);
- case VM_METHOD_TYPE_ZSUPER:
- return -1;
- case VM_METHOD_TYPE_ATTRSET:
- return 1;
- case VM_METHOD_TYPE_IVAR:
- return 0;
- case VM_METHOD_TYPE_BMETHOD:
- return rb_proc_arity(me->body.proc);
- case VM_METHOD_TYPE_ISEQ: {
- rb_iseq_t *iseq = me->body.iseq;
- if (iseq->arg_rest == -1 && iseq->arg_opts == 0) {
- return iseq->argc;
- }
- else {
- return -(iseq->argc + 1 + iseq->arg_post_len);
- }
- }
- default:
- rb_bug("rb_method_entry_arity: invalid method entry type (%d)", me->type);
- }
-}
-
-/*
- * call-seq:
- * meth.arity => fixnum
- *
- * Returns an indication of the number of arguments accepted by a
- * method. Returns a nonnegative integer for methods that take a fixed
- * number of arguments. For Ruby methods that take a variable number of
- * arguments, returns -n-1, where n is the number of required
- * arguments. For methods written in C, returns -1 if the call takes a
- * variable number of arguments.
- *
- * class C
- * def one; end
- * def two(a); end
- * def three(*a); end
- * def four(a, b); end
- * def five(a, b, *c); end
- * def six(a, b, *c, &d); end
- * end
- * c = C.new
- * c.method(:one).arity #=> 0
- * c.method(:two).arity #=> 1
- * c.method(:three).arity #=> -1
- * c.method(:four).arity #=> 2
- * c.method(:five).arity #=> -3
- * c.method(:six).arity #=> -3
- *
- * "cat".method(:size).arity #=> 0
- * "cat".method(:replace).arity #=> 1
- * "cat".method(:squeeze).arity #=> -1
- * "cat".method(:count).arity #=> -1
- */
-
-static VALUE
-method_arity_m(VALUE method)
-{
- int n = method_arity(method);
- return INT2FIX(n);
-}
-
-static int
-method_arity(VALUE method)
-{
- struct METHOD *data;
-
- TypedData_Get_Struct(method, struct METHOD, &method_data_type, data);
- return rb_method_entry_arity(data->me);
-}
-
-int
-rb_mod_method_arity(VALUE mod, ID id)
-{
- rb_method_entry_t *me = rb_method_entry(mod, id);
- return rb_method_entry_arity(me);
-}
-
-int
-rb_obj_method_arity(VALUE obj, ID id)
-{
- return rb_mod_method_arity(CLASS_OF(obj), id);
-}
-
-rb_iseq_t *
-rb_method_get_iseq(VALUE method)
-{
- struct METHOD *data;
- rb_method_entry_t *me;
-
- TypedData_Get_Struct(method, struct METHOD, &method_data_type, data);
- me = data->me;
-
- switch (me->type) {
- case VM_METHOD_TYPE_BMETHOD:
- return get_proc_iseq(me->body.proc, 0);
- case VM_METHOD_TYPE_ISEQ:
- return me->body.iseq;
- default:
- return 0;
- }
-}
-
-/*
- * call-seq:
- * meth.source_location => [String, Fixnum]
- *
- * returns the ruby source filename and line number containing this method
- * or nil if this method was not defined in ruby (i.e. native)
- */
-
-VALUE
-rb_method_location(VALUE method)
-{
- return iseq_location(rb_method_get_iseq(method));
-}
-
-/*
- * call-seq:
- * meth.parameters => array
- *
- * returns the parameter information of this method
- */
-
-static VALUE
-rb_method_parameters(VALUE method)
-{
- rb_iseq_t *iseq = rb_method_get_iseq(method);
- if (!iseq) {
- return unnamed_parameters(method_arity(method));
- }
- return rb_iseq_parameters(iseq, 0);
-}
-
-/*
- * call-seq:
- * meth.to_s => string
- * meth.inspect => string
- *
- * Show the name of the underlying method.
- *
- * "cat".method(:count).inspect #=> "#<Method: String#count>"
- */
-
-static VALUE
-method_inspect(VALUE method)
-{
- struct METHOD *data;
- VALUE str;
- const char *s;
- const char *sharp = "#";
-
- TypedData_Get_Struct(method, struct METHOD, &method_data_type, data);
- str = rb_str_buf_new2("#<");
- s = rb_obj_classname(method);
- rb_str_buf_cat2(str, s);
- rb_str_buf_cat2(str, ": ");
-
- if (FL_TEST(data->me->klass, FL_SINGLETON)) {
- VALUE v = rb_iv_get(data->me->klass, "__attached__");
-
- if (data->recv == Qundef) {
- rb_str_buf_append(str, rb_inspect(data->me->klass));
- }
- else if (data->recv == v) {
- rb_str_buf_append(str, rb_inspect(v));
- sharp = ".";
- }
- else {
- rb_str_buf_append(str, rb_inspect(data->recv));
- rb_str_buf_cat2(str, "(");
- rb_str_buf_append(str, rb_inspect(v));
- rb_str_buf_cat2(str, ")");
- sharp = ".";
- }
- }
- else {
- rb_str_buf_cat2(str, rb_class2name(data->rclass));
- if (data->rclass != data->me->klass) {
- rb_str_buf_cat2(str, "(");
- rb_str_buf_cat2(str, rb_class2name(data->me->klass));
- rb_str_buf_cat2(str, ")");
- }
- }
- rb_str_buf_cat2(str, sharp);
- rb_str_append(str, rb_id2str(data->me->original_id));
- if (data->me->type == VM_METHOD_TYPE_NOTIMPLEMENTED) {
- rb_str_buf_cat2(str, " (not-implemented)");
- }
- rb_str_buf_cat2(str, ">");
-
- return str;
-}
-
-static VALUE
-mproc(VALUE method)
-{
- return rb_funcall(Qnil, rb_intern("proc"), 0);
-}
-
-static VALUE
-mlambda(VALUE method)
-{
- return rb_funcall(Qnil, rb_intern("lambda"), 0);
-}
-
-static VALUE
-bmcall(VALUE args, VALUE method)
-{
- volatile VALUE a;
- VALUE ret;
- int argc;
-
- if (CLASS_OF(args) != rb_cArray) {
- args = rb_ary_new3(1, args);
- argc = 1;
- }
- else {
- argc = check_argc(RARRAY_LEN(args));
- }
- ret = rb_method_call(argc, RARRAY_PTR(args), method);
- RB_GC_GUARD(a) = args;
- return ret;
-}
-
-VALUE
-rb_proc_new(
- VALUE (*func)(ANYARGS), /* VALUE yieldarg[, VALUE procarg] */
- VALUE val)
-{
- VALUE procval = rb_iterate(mproc, 0, func, val);
- return procval;
-}
-
-/*
- * call-seq:
- * meth.to_proc => prc
- *
- * Returns a <code>Proc</code> object corresponding to this method.
- */
-
-static VALUE
-method_proc(VALUE method)
-{
- VALUE procval;
- rb_proc_t *proc;
- /*
- * class Method
- * def to_proc
- * proc{|*args|
- * self.call(*args)
- * }
- * end
- * end
- */
- procval = rb_iterate(mlambda, 0, bmcall, method);
- GetProcPtr(procval, proc);
- proc->is_from_method = 1;
- return procval;
-}
-
-/*
- * call_seq:
- * local_jump_error.exit_value => obj
- *
- * Returns the exit value associated with this +LocalJumpError+.
- */
-static VALUE
-localjump_xvalue(VALUE exc)
-{
- return rb_iv_get(exc, "@exit_value");
-}
-
-/*
- * call-seq:
- * local_jump_error.reason => symbol
- *
- * The reason this block was terminated:
- * :break, :redo, :retry, :next, :return, or :noreason.
- */
-
-static VALUE
-localjump_reason(VALUE exc)
-{
- return rb_iv_get(exc, "@reason");
-}
-
-/*
- * call-seq:
- * prc.binding => binding
- *
- * Returns the binding associated with <i>prc</i>. Note that
- * <code>Kernel#eval</code> accepts either a <code>Proc</code> or a
- * <code>Binding</code> object as its second parameter.
- *
- * def fred(param)
- * proc {}
- * end
- *
- * b = fred(99)
- * eval("param", b.binding) #=> 99
- */
-static VALUE
-proc_binding(VALUE self)
-{
- rb_proc_t *proc;
- VALUE bindval = binding_alloc(rb_cBinding);
- rb_binding_t *bind;
-
- GetProcPtr(self, proc);
- GetBindingPtr(bindval, bind);
-
- if (TYPE(proc->block.iseq) == T_NODE) {
- rb_raise(rb_eArgError, "Can't create Binding from C level Proc");
- }
-
- bind->env = proc->envval;
- return bindval;
-}
-
-static VALUE curry(VALUE dummy, VALUE args, int argc, VALUE *argv, VALUE passed_proc);
-
-static VALUE
-make_curry_proc(VALUE proc, VALUE passed, VALUE arity)
-{
- VALUE args = rb_ary_new3(3, proc, passed, arity);
- rb_proc_t *procp;
- int is_lambda;
-
- GetProcPtr(proc, procp);
- is_lambda = procp->is_lambda;
- rb_ary_freeze(passed);
- rb_ary_freeze(args);
- proc = rb_proc_new(curry, args);
- GetProcPtr(proc, procp);
- procp->is_lambda = is_lambda;
- return proc;
-}
-
-static VALUE
-curry(VALUE dummy, VALUE args, int argc, VALUE *argv, VALUE passed_proc)
-{
- VALUE proc, passed, arity;
- proc = RARRAY_PTR(args)[0];
- passed = RARRAY_PTR(args)[1];
- arity = RARRAY_PTR(args)[2];
-
- passed = rb_ary_plus(passed, rb_ary_new4(argc, argv));
- rb_ary_freeze(passed);
-
- if (RARRAY_LEN(passed) < FIX2INT(arity)) {
- if (!NIL_P(passed_proc)) {
- rb_warn("given block not used");
- }
- arity = make_curry_proc(proc, passed, arity);
- return arity;
- }
- else {
- return rb_proc_call_with_block(proc, check_argc(RARRAY_LEN(passed)),
- RARRAY_PTR(passed), passed_proc);
- }
-}
-
- /*
- * call-seq:
- * prc.curry => a_proc
- * prc.curry(arity) => a_proc
- *
- * Returns a curried proc. If the optional <i>arity</i> argument is given,
- * it determines the number of arguments.
- * A curried proc receives some arguments. If a sufficient number of
- * arguments are supplied, it passes the supplied arguments to the original
- * proc and returns the result. Otherwise, returns another curried proc that
- * takes the rest of arguments.
- *
- * b = proc {|x, y, z| (x||0) + (y||0) + (z||0) }
- * p b.curry[1][2][3] #=> 6
- * p b.curry[1, 2][3, 4] #=> 6
- * p b.curry(5)[1][2][3][4][5] #=> 6
- * p b.curry(5)[1, 2][3, 4][5] #=> 6
- * p b.curry(1)[1] #=> 1
- *
- * b = proc {|x, y, z, *w| (x||0) + (y||0) + (z||0) + w.inject(0, &:+) }
- * p b.curry[1][2][3] #=> 6
- * p b.curry[1, 2][3, 4] #=> 10
- * p b.curry(5)[1][2][3][4][5] #=> 15
- * p b.curry(5)[1, 2][3, 4][5] #=> 15
- * p b.curry(1)[1] #=> 1
- *
- * b = lambda {|x, y, z| (x||0) + (y||0) + (z||0) }
- * p b.curry[1][2][3] #=> 6
- * p b.curry[1, 2][3, 4] #=> wrong number of arguments (4 or 3)
- * p b.curry(5) #=> wrong number of arguments (5 or 3)
- * p b.curry(1) #=> wrong number of arguments (1 or 3)
- *
- * b = lambda {|x, y, z, *w| (x||0) + (y||0) + (z||0) + w.inject(0, &:+) }
- * p b.curry[1][2][3] #=> 6
- * p b.curry[1, 2][3, 4] #=> 10
- * p b.curry(5)[1][2][3][4][5] #=> 15
- * p b.curry(5)[1, 2][3, 4][5] #=> 15
- * p b.curry(1) #=> wrong number of arguments (1 or 3)
- *
- * b = proc { :foo }
- * p b.curry[] #=> :foo
- */
-static VALUE
-proc_curry(int argc, VALUE *argv, VALUE self)
-{
- int sarity, marity = rb_proc_arity(self);
- VALUE arity, opt = Qfalse;
-
- if (marity < 0) {
- marity = -marity - 1;
- opt = Qtrue;
- }
-
- rb_scan_args(argc, argv, "01", &arity);
- if (NIL_P(arity)) {
- arity = INT2FIX(marity);
- }
- else {
- sarity = FIX2INT(arity);
- if (proc_lambda_p(self) && (sarity < marity || (sarity > marity && !opt))) {
- rb_raise(rb_eArgError, "wrong number of arguments (%d for %d)", sarity, marity);
- }
- }
-
- return make_curry_proc(self, rb_ary_new(), arity);
-}
-
-/*
- * <code>Proc</code> objects are blocks of code that have been bound to
- * a set of local variables. Once bound, the code may be called in
- * different contexts and still access those variables.
- *
- * def gen_times(factor)
- * return Proc.new {|n| n*factor }
- * end
- *
- * times3 = gen_times(3)
- * times5 = gen_times(5)
- *
- * times3.call(12) #=> 36
- * times5.call(5) #=> 25
- * times3.call(times5.call(4)) #=> 60
- *
- */
-
-void
-Init_Proc(void)
-{
- /* Proc */
- rb_cProc = rb_define_class("Proc", rb_cObject);
- rb_undef_alloc_func(rb_cProc);
- rb_define_singleton_method(rb_cProc, "new", rb_proc_s_new, -1);
-
-#if 0 /* incomplete. */
- rb_add_method(rb_cProc, rb_intern("call"), VM_METHOD_TYPE_OPTIMIZED,
- (void *)OPTIMIZED_METHOD_TYPE_CALL, 0);
- rb_add_method(rb_cProc, rb_intern("[]"), VM_METHOD_TYPE_OPTIMIZED,
- (void *)OPTIMIZED_METHOD_TYPE_CALL, 0);
- rb_add_method(rb_cProc, rb_intern("==="), VM_METHOD_TYPE_OPTIMIZED,
- (void *)OPTIMIZED_METHOD_TYPE_CALL, 0);
- rb_add_method(rb_cProc, rb_intern("yield"), VM_METHOD_TYPE_OPTIMIZED,
- (void *)OPTIMIZED_METHOD_TYPE_CALL, 0);
-#else
- rb_define_method(rb_cProc, "call", proc_call, -1);
- rb_define_method(rb_cProc, "[]", proc_call, -1);
- rb_define_method(rb_cProc, "===", proc_call, -1);
- rb_define_method(rb_cProc, "yield", proc_call, -1);
-#endif
- rb_define_method(rb_cProc, "to_proc", proc_to_proc, 0);
- rb_define_method(rb_cProc, "arity", proc_arity, 0);
- rb_define_method(rb_cProc, "clone", proc_clone, 0);
- rb_define_method(rb_cProc, "dup", proc_dup, 0);
- rb_define_method(rb_cProc, "==", proc_eq, 1);
- rb_define_method(rb_cProc, "eql?", proc_eq, 1);
- rb_define_method(rb_cProc, "hash", proc_hash, 0);
- rb_define_method(rb_cProc, "to_s", proc_to_s, 0);
- rb_define_method(rb_cProc, "lambda?", proc_lambda_p, 0);
- rb_define_method(rb_cProc, "binding", proc_binding, 0);
- rb_define_method(rb_cProc, "curry", proc_curry, -1);
- rb_define_method(rb_cProc, "source_location", rb_proc_location, 0);
- rb_define_method(rb_cProc, "parameters", rb_proc_parameters, 0);
-
- /* Exceptions */
- rb_eLocalJumpError = rb_define_class("LocalJumpError", rb_eStandardError);
- rb_define_method(rb_eLocalJumpError, "exit_value", localjump_xvalue, 0);
- rb_define_method(rb_eLocalJumpError, "reason", localjump_reason, 0);
-
- rb_eSysStackError = rb_define_class("SystemStackError", rb_eException);
- sysstack_error = rb_exc_new3(rb_eSysStackError,
- rb_obj_freeze(rb_str_new2("stack level too deep")));
- OBJ_TAINT(sysstack_error);
- OBJ_FREEZE(sysstack_error);
-
- /* utility functions */
- rb_define_global_function("proc", rb_block_proc, 0);
- rb_define_global_function("lambda", proc_lambda, 0);
-
- /* Method */
- rb_cMethod = rb_define_class("Method", rb_cObject);
- rb_undef_alloc_func(rb_cMethod);
- rb_undef_method(CLASS_OF(rb_cMethod), "new");
- rb_define_method(rb_cMethod, "==", method_eq, 1);
- rb_define_method(rb_cMethod, "eql?", method_eq, 1);
- rb_define_method(rb_cMethod, "hash", method_hash, 0);
- rb_define_method(rb_cMethod, "clone", method_clone, 0);
- rb_define_method(rb_cMethod, "call", rb_method_call, -1);
- rb_define_method(rb_cMethod, "[]", rb_method_call, -1);
- rb_define_method(rb_cMethod, "arity", method_arity_m, 0);
- rb_define_method(rb_cMethod, "inspect", method_inspect, 0);
- rb_define_method(rb_cMethod, "to_s", method_inspect, 0);
- rb_define_method(rb_cMethod, "to_proc", method_proc, 0);
- rb_define_method(rb_cMethod, "receiver", method_receiver, 0);
- rb_define_method(rb_cMethod, "name", method_name, 0);
- rb_define_method(rb_cMethod, "owner", method_owner, 0);
- rb_define_method(rb_cMethod, "unbind", method_unbind, 0);
- rb_define_method(rb_cMethod, "source_location", rb_method_location, 0);
- rb_define_method(rb_cMethod, "parameters", rb_method_parameters, 0);
- rb_define_method(rb_mKernel, "method", rb_obj_method, 1);
- rb_define_method(rb_mKernel, "public_method", rb_obj_public_method, 1);
-
- /* UnboundMethod */
- rb_cUnboundMethod = rb_define_class("UnboundMethod", rb_cObject);
- rb_undef_alloc_func(rb_cUnboundMethod);
- rb_undef_method(CLASS_OF(rb_cUnboundMethod), "new");
- rb_define_method(rb_cUnboundMethod, "==", method_eq, 1);
- rb_define_method(rb_cUnboundMethod, "eql?", method_eq, 1);
- rb_define_method(rb_cUnboundMethod, "hash", method_hash, 0);
- rb_define_method(rb_cUnboundMethod, "clone", method_clone, 0);
- rb_define_method(rb_cUnboundMethod, "arity", method_arity_m, 0);
- rb_define_method(rb_cUnboundMethod, "inspect", method_inspect, 0);
- rb_define_method(rb_cUnboundMethod, "to_s", method_inspect, 0);
- rb_define_method(rb_cUnboundMethod, "name", method_name, 0);
- rb_define_method(rb_cUnboundMethod, "owner", method_owner, 0);
- rb_define_method(rb_cUnboundMethod, "bind", umethod_bind, 1);
- rb_define_method(rb_cUnboundMethod, "source_location", rb_method_location, 0);
- rb_define_method(rb_cUnboundMethod, "parameters", rb_method_parameters, 0);
-
- /* Module#*_method */
- rb_define_method(rb_cModule, "instance_method", rb_mod_instance_method, 1);
- rb_define_method(rb_cModule, "public_instance_method", rb_mod_public_instance_method, 1);
- rb_define_private_method(rb_cModule, "define_method", rb_mod_define_method, -1);
-
- /* Kernel */
- rb_define_method(rb_mKernel, "define_singleton_method", rb_obj_define_method, -1);
-}
-
-/*
- * Objects of class <code>Binding</code> encapsulate the execution
- * context at some particular place in the code and retain this context
- * for future use. The variables, methods, value of <code>self</code>,
- * and possibly an iterator block that can be accessed in this context
- * are all retained. Binding objects can be created using
- * <code>Kernel#binding</code>, and are made available to the callback
- * of <code>Kernel#set_trace_func</code>.
- *
- * These binding objects can be passed as the second argument of the
- * <code>Kernel#eval</code> method, establishing an environment for the
- * evaluation.
- *
- * class Demo
- * def initialize(n)
- * @secret = n
- * end
- * def getBinding
- * return binding()
- * end
- * end
- *
- * k1 = Demo.new(99)
- * b1 = k1.getBinding
- * k2 = Demo.new(-3)
- * b2 = k2.getBinding
- *
- * eval("@secret", b1) #=> 99
- * eval("@secret", b2) #=> -3
- * eval("@secret") #=> nil
- *
- * Binding objects have no class-specific methods.
- *
- */
-
-void
-Init_Binding(void)
-{
- rb_cBinding = rb_define_class("Binding", rb_cObject);
- rb_undef_alloc_func(rb_cBinding);
- rb_undef_method(CLASS_OF(rb_cBinding), "new");
- rb_define_method(rb_cBinding, "clone", binding_clone, 0);
- rb_define_method(rb_cBinding, "dup", binding_dup, 0);
- rb_define_method(rb_cBinding, "eval", bind_eval, -1);
- rb_define_global_function("binding", rb_f_binding, 0);
-}
-
diff --git a/process.c b/process.c
index 161e384aa8..0d16bb6e43 100644
--- a/process.c
+++ b/process.c
@@ -3,19 +3,17 @@
process.c -
$Author$
+ $Date$
created at: Tue Aug 10 14:30:50 JST 1993
- Copyright (C) 1993-2007 Yukihiro Matsumoto
+ Copyright (C) 1993-2003 Yukihiro Matsumoto
Copyright (C) 2000 Network Applied Communication Laboratory, Inc.
Copyright (C) 2000 Information-technology Promotion Agency, Japan
**********************************************************************/
-#include "ruby/ruby.h"
-#include "ruby/io.h"
-#include "ruby/util.h"
-#include "vm_core.h"
-
+#include "ruby.h"
+#include "rubysig.h"
#include <stdio.h>
#include <errno.h>
#include <signal.h>
@@ -25,8 +23,8 @@
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
-#ifdef HAVE_FCNTL_H
-#include <fcntl.h>
+#ifdef __DJGPP__
+#include <process.h>
#endif
#include <time.h>
@@ -39,7 +37,7 @@
#define EXIT_FAILURE 1
#endif
-struct timeval rb_time_interval(VALUE);
+struct timeval rb_time_interval _((VALUE));
#ifdef HAVE_SYS_WAIT_H
# include <sys/wait.h>
@@ -47,20 +45,12 @@ struct timeval rb_time_interval(VALUE);
#ifdef HAVE_SYS_RESOURCE_H
# include <sys/resource.h>
#endif
-#ifdef HAVE_SYS_PARAM_H
-# include <sys/param.h>
-#endif
-#ifndef MAXPATHLEN
-# define MAXPATHLEN 1024
-#endif
-#include "ruby/st.h"
+#include "st.h"
#ifdef __EMX__
#undef HAVE_GETPGRP
#endif
-#include <sys/stat.h>
-
#ifdef HAVE_SYS_TIMES_H
#include <sys/times.h>
#endif
@@ -70,7 +60,7 @@ struct timeval rb_time_interval(VALUE);
#endif
#if defined(HAVE_TIMES) || defined(_WIN32)
-static VALUE rb_cProcessTms;
+static VALUE S_Tms;
#endif
#ifndef WIFEXITED
@@ -122,17 +112,6 @@ static VALUE rb_cProcessTms;
#endif
#endif
-#if SIZEOF_RLIM_T == SIZEOF_INT
-# define RLIM2NUM(v) UINT2NUM(v)
-# define NUM2RLIM(v) NUM2UINT(v)
-#elif SIZEOF_RLIM_T == SIZEOF_LONG
-# define RLIM2NUM(v) ULONG2NUM(v)
-# define NUM2RLIM(v) NUM2ULONG(v)
-#elif SIZEOF_RLIM_T == SIZEOF_LONG_LONG
-# define RLIM2NUM(v) ULL2NUM(v)
-# define NUM2RLIM(v) NUM2ULL(v)
-#endif
-
#define preserving_errno(stmts) \
do {int saved_errno = errno; stmts; errno = saved_errno;} while (0)
@@ -148,10 +127,10 @@ static VALUE rb_cProcessTms;
*/
static VALUE
-get_pid(void)
+get_pid()
{
rb_secure(2);
- return PIDT2NUM(getpid());
+ return INT2FIX(getpid());
}
@@ -159,8 +138,8 @@ get_pid(void)
* call-seq:
* Process.ppid => fixnum
*
- * Returns the process id of the parent of this process. Returns
- * untrustworthy value on Win32/64. Not available on all platforms.
+ * Returns the process id of the parent of this process. Always
+ * returns 0 on NT. Not available on all platforms.
*
* puts "I am #{Process.pid}"
* Process.fork { puts "Dad is #{Process.ppid}" }
@@ -172,10 +151,14 @@ get_pid(void)
*/
static VALUE
-get_ppid(void)
+get_ppid()
{
rb_secure(2);
- return PIDT2NUM(getppid());
+#ifdef _WIN32
+ return INT2FIX(0);
+#else
+ return INT2FIX(getppid());
+#endif
}
@@ -209,29 +192,19 @@ get_ppid(void)
* _stat_, we're referring to this 16 bit value.
*/
-static VALUE rb_cProcessStatus;
-
-VALUE
-rb_last_status_get(void)
-{
- return GET_THREAD()->last_status;
-}
-
-void
-rb_last_status_set(int status, rb_pid_t pid)
-{
- rb_thread_t *th = GET_THREAD();
- th->last_status = rb_obj_alloc(rb_cProcessStatus);
- rb_iv_set(th->last_status, "status", INT2FIX(status));
- rb_iv_set(th->last_status, "pid", PIDT2NUM(pid));
-}
+static VALUE rb_cProcStatus;
+VALUE rb_last_status = Qnil;
static void
-rb_last_status_clear(void)
+last_status_set(status, pid)
+ int status, pid;
{
- GET_THREAD()->last_status = Qnil;
+ rb_last_status = rb_obj_alloc(rb_cProcStatus);
+ rb_iv_set(rb_last_status, "status", INT2FIX(status));
+ rb_iv_set(rb_last_status, "pid", INT2FIX(pid));
}
+
/*
* call-seq:
* stat.to_i => fixnum
@@ -246,12 +219,27 @@ rb_last_status_clear(void)
*/
static VALUE
-pst_to_i(VALUE st)
+pst_to_i(st)
+ VALUE st;
{
return rb_iv_get(st, "status");
}
-#define PST2INT(st) NUM2INT(pst_to_i(st))
+
+/*
+ * call-seq:
+ * stat.to_s => string
+ *
+ * Equivalent to _stat_<code>.to_i.to_s</code>.
+ */
+
+static VALUE
+pst_to_s(st)
+ VALUE st;
+{
+ return rb_fix2str(pst_to_i(st), 10);
+}
+
/*
* call-seq:
@@ -265,92 +253,65 @@ pst_to_i(VALUE st)
*/
static VALUE
-pst_pid(VALUE st)
+pst_pid(st)
+ VALUE st;
{
- return rb_attr_get(st, rb_intern("pid"));
+ return rb_iv_get(st, "pid");
}
-static void
-pst_message(VALUE str, rb_pid_t pid, int status)
+
+/*
+ * call-seq:
+ * stat.inspect => string
+ *
+ * Override the inspection method.
+ */
+
+static VALUE
+pst_inspect(st)
+ VALUE st;
{
- rb_str_catf(str, "pid %ld", (long)pid);
+ VALUE pid;
+ int status;
+ VALUE str;
+ char buf[256];
+
+ pid = pst_pid(st);
+ status = NUM2INT(st);
+
+ snprintf(buf, sizeof(buf), "#<%s: pid=%ld", rb_class2name(CLASS_OF(st)), NUM2LONG(pid));
+ str = rb_str_new2(buf);
if (WIFSTOPPED(status)) {
int stopsig = WSTOPSIG(status);
const char *signame = ruby_signal_name(stopsig);
if (signame) {
- rb_str_catf(str, " stopped SIG%s (signal %d)", signame, stopsig);
+ snprintf(buf, sizeof(buf), ",stopped(SIG%s=%d)", signame, stopsig);
}
else {
- rb_str_catf(str, " stopped signal %d", stopsig);
+ snprintf(buf, sizeof(buf), ",stopped(%d)", stopsig);
}
+ rb_str_cat2(str, buf);
}
if (WIFSIGNALED(status)) {
int termsig = WTERMSIG(status);
const char *signame = ruby_signal_name(termsig);
if (signame) {
- rb_str_catf(str, " SIG%s (signal %d)", signame, termsig);
+ snprintf(buf, sizeof(buf), ",signaled(SIG%s=%d)", signame, termsig);
}
else {
- rb_str_catf(str, " signal %d", termsig);
+ snprintf(buf, sizeof(buf), ",signaled(%d)", termsig);
}
+ rb_str_cat2(str, buf);
}
if (WIFEXITED(status)) {
- rb_str_catf(str, " exit %d", WEXITSTATUS(status));
+ snprintf(buf, sizeof(buf), ",exited(%d)", WEXITSTATUS(status));
+ rb_str_cat2(str, buf);
}
#ifdef WCOREDUMP
if (WCOREDUMP(status)) {
- rb_str_cat2(str, " (core dumped)");
+ rb_str_cat2(str, ",coredumped");
}
#endif
-}
-
-
-/*
- * call-seq:
- * stat.to_s => string
- *
- * Show pid and exit status as a string.
- */
-
-static VALUE
-pst_to_s(VALUE st)
-{
- rb_pid_t pid;
- int status;
- VALUE str;
-
- pid = NUM2PIDT(pst_pid(st));
- status = PST2INT(st);
-
- str = rb_str_buf_new(0);
- pst_message(str, pid, status);
- return str;
-}
-
-
-/*
- * call-seq:
- * stat.inspect => string
- *
- * Override the inspection method.
- */
-
-static VALUE
-pst_inspect(VALUE st)
-{
- rb_pid_t pid;
- int status;
- VALUE vpid, str;
-
- vpid = pst_pid(st);
- if (NIL_P(vpid)) {
- return rb_sprintf("#<%s: uninitialized>", rb_class2name(CLASS_OF(st)));
- }
- pid = NUM2PIDT(vpid);
- status = PST2INT(st);
-
- str = rb_sprintf("#<%s: ", rb_class2name(CLASS_OF(st)));
- pst_message(str, pid, status);
rb_str_cat2(str, ">");
return str;
}
@@ -365,7 +326,8 @@ pst_inspect(VALUE st)
*/
static VALUE
-pst_equal(VALUE st1, VALUE st2)
+pst_equal(st1, st2)
+ VALUE st1, st2;
{
if (st1 == st2) return Qtrue;
return rb_equal(pst_to_i(st1), st2);
@@ -385,9 +347,10 @@ pst_equal(VALUE st1, VALUE st2)
*/
static VALUE
-pst_bitand(VALUE st1, VALUE st2)
+pst_bitand(st1, st2)
+ VALUE st1, st2;
{
- int status = PST2INT(st1) & NUM2INT(st2);
+ int status = NUM2INT(st1) & NUM2INT(st2);
return INT2NUM(status);
}
@@ -406,9 +369,10 @@ pst_bitand(VALUE st1, VALUE st2)
*/
static VALUE
-pst_rshift(VALUE st1, VALUE st2)
+pst_rshift(st1, st2)
+ VALUE st1, st2;
{
- int status = PST2INT(st1) >> NUM2INT(st2);
+ int status = NUM2INT(st1) >> NUM2INT(st2);
return INT2NUM(status);
}
@@ -424,9 +388,10 @@ pst_rshift(VALUE st1, VALUE st2)
*/
static VALUE
-pst_wifstopped(VALUE st)
+pst_wifstopped(st)
+ VALUE st;
{
- int status = PST2INT(st);
+ int status = NUM2INT(st);
if (WIFSTOPPED(status))
return Qtrue;
@@ -444,9 +409,10 @@ pst_wifstopped(VALUE st)
*/
static VALUE
-pst_wstopsig(VALUE st)
+pst_wstopsig(st)
+ VALUE st;
{
- int status = PST2INT(st);
+ int status = NUM2INT(st);
if (WIFSTOPPED(status))
return INT2NUM(WSTOPSIG(status));
@@ -463,9 +429,10 @@ pst_wstopsig(VALUE st)
*/
static VALUE
-pst_wifsignaled(VALUE st)
+pst_wifsignaled(st)
+ VALUE st;
{
- int status = PST2INT(st);
+ int status = NUM2INT(st);
if (WIFSIGNALED(status))
return Qtrue;
@@ -484,9 +451,10 @@ pst_wifsignaled(VALUE st)
*/
static VALUE
-pst_wtermsig(VALUE st)
+pst_wtermsig(st)
+ VALUE st;
{
- int status = PST2INT(st);
+ int status = NUM2INT(st);
if (WIFSIGNALED(status))
return INT2NUM(WTERMSIG(status));
@@ -504,9 +472,10 @@ pst_wtermsig(VALUE st)
*/
static VALUE
-pst_wifexited(VALUE st)
+pst_wifexited(st)
+ VALUE st;
{
- int status = PST2INT(st);
+ int status = NUM2INT(st);
if (WIFEXITED(status))
return Qtrue;
@@ -535,9 +504,10 @@ pst_wifexited(VALUE st)
*/
static VALUE
-pst_wexitstatus(VALUE st)
+pst_wexitstatus(st)
+ VALUE st;
{
- int status = PST2INT(st);
+ int status = NUM2INT(st);
if (WIFEXITED(status))
return INT2NUM(WEXITSTATUS(status));
@@ -554,9 +524,10 @@ pst_wexitstatus(VALUE st)
*/
static VALUE
-pst_success_p(VALUE st)
+pst_success_p(st)
+ VALUE st;
{
- int status = PST2INT(st);
+ int status = NUM2INT(st);
if (!WIFEXITED(status))
return Qnil;
@@ -573,10 +544,11 @@ pst_success_p(VALUE st)
*/
static VALUE
-pst_wcoredump(VALUE st)
+pst_wcoredump(st)
+ VALUE st;
{
#ifdef WCOREDUMP
- int status = PST2INT(st);
+ int status = NUM2INT(st);
if (WCOREDUMP(status))
return Qtrue;
@@ -590,93 +562,47 @@ pst_wcoredump(VALUE st)
#if !defined(HAVE_WAITPID) && !defined(HAVE_WAIT4)
#define NO_WAITPID
static st_table *pid_tbl;
+#endif
-struct wait_data {
- rb_pid_t pid;
- int status;
-};
-
-static int
-wait_each(rb_pid_t pid, int status, struct wait_data *data)
-{
- if (data->status != -1) return ST_STOP;
-
- data->pid = pid;
- data->status = status;
- return ST_DELETE;
-}
-
-static int
-waitall_each(rb_pid_t pid, int status, VALUE ary)
-{
- rb_last_status_set(status, pid);
- rb_ary_push(ary, rb_assoc_new(PIDT2NUM(pid), rb_last_status_get()));
- return ST_DELETE;
-}
-#else
-struct waitpid_arg {
- rb_pid_t pid;
+int
+rb_waitpid(pid, st, flags)
+ int pid;
int *st;
int flags;
-};
-#endif
-
-static VALUE
-rb_waitpid_blocking(void *data)
{
- rb_pid_t result;
+ int result;
#ifndef NO_WAITPID
- struct waitpid_arg *arg = data;
-#endif
+ int oflags = flags;
+ if (!rb_thread_alone()) { /* there're other threads to run */
+ flags |= WNOHANG;
+ }
-#if defined NO_WAITPID
- result = wait(data);
-#elif defined HAVE_WAITPID
- result = waitpid(arg->pid, arg->st, arg->flags);
+ retry:
+ TRAP_BEG;
+#ifdef HAVE_WAITPID
+ result = waitpid(pid, st, flags);
#else /* HAVE_WAIT4 */
- result = wait4(arg->pid, arg->st, arg->flags, NULL);
+ result = wait4(pid, st, flags, NULL);
#endif
-
- return (VALUE)result;
-}
-
-rb_pid_t
-rb_waitpid(rb_pid_t pid, int *st, int flags)
-{
- rb_pid_t result;
-#ifndef NO_WAITPID
- struct waitpid_arg arg;
-
- retry:
- arg.pid = pid;
- arg.st = st;
- arg.flags = flags;
- result = (rb_pid_t)rb_thread_blocking_region(rb_waitpid_blocking, &arg,
- RUBY_UBF_PROCESS, 0);
+ TRAP_END;
if (result < 0) {
if (errno == EINTR) {
- RUBY_VM_CHECK_INTS();
- goto retry;
- }
- return (rb_pid_t)-1;
+ rb_thread_polling();
+ goto retry;
+ }
+ return -1;
+ }
+ if (result == 0) {
+ if (oflags & WNOHANG) return 0;
+ rb_thread_polling();
+ if (rb_thread_alone()) flags = oflags;
+ goto retry;
}
#else /* NO_WAITPID */
- if (pid_tbl) {
- st_data_t status, piddata = (st_data_t)pid;
- if (pid == (rb_pid_t)-1) {
- struct wait_data data;
- data.pid = (rb_pid_t)-1;
- data.status = -1;
- st_foreach(pid_tbl, wait_each, (st_data_t)&data);
- if (data.status != -1) {
- rb_last_status_set(data.status, data.pid);
- return data.pid;
- }
- }
- else if (st_delete(pid_tbl, &piddata, &status)) {
- rb_last_status_set(*st = (int)status, pid);
- return pid;
- }
+ if (pid_tbl && st_lookup(pid_tbl, pid, st)) {
+ last_status_set(*st, pid);
+ st_delete(pid_tbl, (st_data_t*)&pid, NULL);
+ return pid;
}
if (flags) {
@@ -684,30 +610,60 @@ rb_waitpid(rb_pid_t pid, int *st, int flags)
}
for (;;) {
- result = (rb_pid_t)rb_thread_blocking_region(rb_waitpid_blocking,
- st, RUBY_UBF_PROCESS, 0);
+ TRAP_BEG;
+ result = wait(st);
+ TRAP_END;
if (result < 0) {
if (errno == EINTR) {
rb_thread_schedule();
continue;
}
- return (rb_pid_t)-1;
+ return -1;
}
- if (result == pid || pid == (rb_pid_t)-1) {
+ if (result == pid) {
break;
}
if (!pid_tbl)
pid_tbl = st_init_numtable();
- st_insert(pid_tbl, pid, (st_data_t)st);
+ st_insert(pid_tbl, pid, st);
if (!rb_thread_alone()) rb_thread_schedule();
}
#endif
if (result > 0) {
- rb_last_status_set(*st, result);
+ last_status_set(*st, result);
}
return result;
}
+#ifdef NO_WAITPID
+struct wait_data {
+ int pid;
+ int status;
+};
+
+static int
+wait_each(pid, status, data)
+ int pid, status;
+ struct wait_data *data;
+{
+ if (data->status != -1) return ST_STOP;
+
+ data->pid = pid;
+ data->status = status;
+ return ST_DELETE;
+}
+
+static int
+waitall_each(pid, status, ary)
+ int pid, status;
+ VALUE ary;
+{
+ last_status_set(status, pid);
+ rb_ary_push(ary, rb_assoc_new(INT2NUM(pid), rb_last_status));
+ return ST_DELETE;
+}
+#endif
+
/* [MG]:FIXME: I wasn't sure how this should be done, since ::wait()
has historically been documented as if it didn't take any arguments
@@ -760,28 +716,29 @@ rb_waitpid(rb_pid_t pid, int *st, int flags)
* $?.exitstatus #=> 99
*
* pid = fork { sleep 3 } #=> 27440
- * Time.now #=> 2008-03-08 19:56:16 +0900
+ * Time.now #=> Wed Apr 09 08:57:09 CDT 2003
* waitpid(pid, Process::WNOHANG) #=> nil
- * Time.now #=> 2008-03-08 19:56:16 +0900
+ * Time.now #=> Wed Apr 09 08:57:09 CDT 2003
* waitpid(pid, 0) #=> 27440
- * Time.now #=> 2008-03-08 19:56:19 +0900
+ * Time.now #=> Wed Apr 09 08:57:12 CDT 2003
*/
static VALUE
-proc_wait(int argc, VALUE *argv)
+proc_wait(argc, argv)
+ int argc;
+ VALUE *argv;
{
VALUE vpid, vflags;
- rb_pid_t pid;
- int flags, status;
+ int pid, flags, status;
rb_secure(2);
flags = 0;
+ rb_scan_args(argc, argv, "02", &vpid, &vflags);
if (argc == 0) {
pid = -1;
}
else {
- rb_scan_args(argc, argv, "02", &vpid, &vflags);
- pid = NUM2PIDT(vpid);
+ pid = NUM2INT(vpid);
if (argc == 2 && !NIL_P(vflags)) {
flags = NUM2UINT(vflags);
}
@@ -789,10 +746,9 @@ proc_wait(int argc, VALUE *argv)
if ((pid = rb_waitpid(pid, &status, flags)) < 0)
rb_sys_fail(0);
if (pid == 0) {
- rb_last_status_clear();
- return Qnil;
+ return rb_last_status = Qnil;
}
- return PIDT2NUM(pid);
+ return INT2FIX(pid);
}
@@ -814,11 +770,13 @@ proc_wait(int argc, VALUE *argv)
*/
static VALUE
-proc_wait2(int argc, VALUE *argv)
+proc_wait2(argc, argv)
+ int argc;
+ VALUE *argv;
{
VALUE pid = proc_wait(argc, argv);
if (NIL_P(pid)) return Qnil;
- return rb_assoc_new(pid, rb_last_status_get());
+ return rb_assoc_new(pid, rb_last_status);
}
@@ -843,11 +801,10 @@ proc_wait2(int argc, VALUE *argv)
*/
static VALUE
-proc_waitall(void)
+proc_waitall()
{
VALUE result;
- rb_pid_t pid;
- int status;
+ int pid, status;
rb_secure(2);
result = rb_ary_new();
@@ -855,68 +812,53 @@ proc_waitall(void)
if (pid_tbl) {
st_foreach(pid_tbl, waitall_each, result);
}
-#else
- rb_last_status_clear();
-#endif
for (pid = -1;;) {
-#ifdef NO_WAITPID
pid = wait(&status);
-#else
- pid = rb_waitpid(-1, &status, 0);
-#endif
if (pid == -1) {
if (errno == ECHILD)
break;
-#ifdef NO_WAITPID
if (errno == EINTR) {
rb_thread_schedule();
continue;
}
-#endif
rb_sys_fail(0);
}
-#ifdef NO_WAITPID
- rb_last_status_set(status, pid);
-#endif
- rb_ary_push(result, rb_assoc_new(PIDT2NUM(pid), rb_last_status_get()));
+ last_status_set(status, pid);
+ rb_ary_push(result, rb_assoc_new(INT2NUM(pid), rb_last_status));
}
+#else
+ rb_last_status = Qnil;
+ for (pid = -1;;) {
+ pid = rb_waitpid(-1, &status, 0);
+ if (pid == -1) {
+ if (errno == ECHILD)
+ break;
+ rb_sys_fail(0);
+ }
+ rb_ary_push(result, rb_assoc_new(INT2NUM(pid), rb_last_status));
+ }
+#endif
return result;
}
-static inline ID
-id_pid(void)
-{
- ID pid;
- CONST_ID(pid, "pid");
- return pid;
-}
-
static VALUE
-detach_process_pid(VALUE thread)
+detach_process_watcher(arg)
+ void *arg;
{
- return rb_thread_local_aref(thread, id_pid());
-}
+ int pid = (int)(VALUE)arg, status;
-static VALUE
-detach_process_watcher(void *arg)
-{
- rb_pid_t cpid, pid = (rb_pid_t)(VALUE)arg;
- int status;
-
- while ((cpid = rb_waitpid(pid, &status, 0)) == 0) {
- /* wait while alive */
+ while (rb_waitpid(pid, &status, WNOHANG) == 0) {
+ rb_thread_sleep(1);
}
- return rb_last_status_get();
+ return rb_last_status;
}
VALUE
-rb_detach_process(rb_pid_t pid)
+rb_detach_process(pid)
+ int pid;
{
- VALUE watcher = rb_thread_create(detach_process_watcher, (void*)(VALUE)pid);
- rb_thread_local_aset(watcher, id_pid(), PIDT2NUM(pid));
- rb_define_singleton_method(watcher, "pid", detach_process_pid, 0);
- return watcher;
+ return rb_thread_create(detach_process_watcher, (void*)(VALUE)pid);
}
@@ -932,15 +874,14 @@ rb_detach_process(rb_pid_t pid)
* separate Ruby thread whose sole job is to reap the status of the
* process _pid_ when it terminates. Use <code>detach</code>
* only when you do not intent to explicitly wait for the child to
- * terminate.
+ * terminate. <code>detach</code> only checks the status
+ * periodically (currently once each second).
*
* The waiting thread returns the exit status of the detached process
* when it terminates, so you can use <code>Thread#join</code> to
* know the result. If specified _pid_ is not a valid child process
* ID, the thread returns +nil+ immediately.
*
- * The waiting thread has <code>pid</code> method which returns the pid.
- *
* In this first example, we don't reap the first child process, so
* it appears as a zombie in the process status display.
*
@@ -971,30 +912,26 @@ static VALUE
proc_detach(VALUE obj, VALUE pid)
{
rb_secure(2);
- return rb_detach_process(NUM2PIDT(pid));
+ return rb_detach_process(NUM2INT(pid));
}
#ifndef HAVE_STRING_H
char *strtok();
#endif
-void rb_thread_stop_timer_thread(void);
-void rb_thread_start_timer_thread(void);
-void rb_thread_reset_timer_thread(void);
-
-static int forked_child = 0;
-
-#define before_exec() \
- (rb_enable_interrupt(), (forked_child ? 0 : (rb_thread_stop_timer_thread(), 1)))
-#define after_exec() \
- (rb_thread_reset_timer_thread(), rb_thread_start_timer_thread(), forked_child = 0, rb_disable_interrupt())
-#define before_fork() before_exec()
-#define after_fork() (GET_THREAD()->thrown_errinfo = 0, after_exec())
+#ifdef HAVE_SETITIMER
+#define before_exec() rb_thread_stop_timer()
+#define after_exec() rb_thread_start_timer()
+#else
+#define before_exec()
+#define after_exec()
+#endif
-#include "dln.h"
+extern char *dln_find_exe();
static void
-security(const char *str)
+security(str)
+ char *str;
{
if (rb_env_path_tainted()) {
if (rb_safe_level() > 0) {
@@ -1004,24 +941,31 @@ security(const char *str)
}
static int
-proc_exec_v(char **argv, const char *prog)
+proc_exec_v(argv, prog)
+ char **argv;
+ char *prog;
{
- char fbuf[MAXPATHLEN];
-
if (!prog)
prog = argv[0];
- prog = dln_find_exe_r(prog, 0, fbuf, sizeof(fbuf));
- if (!prog) {
- errno = ENOENT;
+ security(prog);
+ prog = dln_find_exe(prog, 0);
+ if (!prog)
return -1;
- }
-#if defined(__EMX__) || defined(OS2)
+#if (defined(MSDOS) && !defined(DJGPP)) || defined(__human68k__) || defined(__EMX__) || defined(OS2)
{
+#if defined(__human68k__)
+#define COMMAND "command.x"
+#endif
+#if defined(__EMX__) || defined(OS2) /* OS/2 emx */
#define COMMAND "cmd.exe"
+#endif
+#if (defined(MSDOS) && !defined(DJGPP))
+#define COMMAND "command.com"
+#endif
char *extension;
- if ((extension = strrchr(prog, '.')) != NULL && STRCASECMP(extension, ".bat") == 0) {
+ if ((extension = strrchr(prog, '.')) != NULL && strcasecmp(extension, ".bat") == 0) {
char **new_argv;
char *p;
int n;
@@ -1037,29 +981,37 @@ proc_exec_v(char **argv, const char *prog)
*p = '\\';
new_argv[0] = COMMAND;
argv = new_argv;
- prog = dln_find_exe_r(argv[0], 0, fbuf, sizeof(fbuf));
+ prog = dln_find_exe(argv[0], 0);
if (!prog) {
errno = ENOENT;
return -1;
}
}
}
-#endif /* __EMX__ */
+#endif /* MSDOS or __human68k__ or __EMX__ */
before_exec();
execv(prog, argv);
preserving_errno(after_exec());
return -1;
}
-int
-rb_proc_exec_n(int argc, VALUE *argv, const char *prog)
+static int
+proc_exec_n(argc, argv, progv)
+ int argc;
+ VALUE *argv;
+ VALUE progv;
{
+ char *prog = 0;
char **args;
int i;
+ if (progv) {
+ prog = RSTRING(progv)->ptr;
+ }
args = ALLOCA_N(char*, argc+1);
for (i=0; i<argc; i++) {
- args[i] = RSTRING_PTR(argv[i]);
+ SafeStringValue(argv[i]);
+ args[i] = RSTRING(argv[i])->ptr;
}
args[i] = 0;
if (args[0]) {
@@ -1069,7 +1021,8 @@ rb_proc_exec_n(int argc, VALUE *argv, const char *prog)
}
int
-rb_proc_exec(const char *str)
+rb_proc_exec(str)
+ const char *str;
{
#ifndef _WIN32
const char *s = str;
@@ -1082,22 +1035,21 @@ rb_proc_exec(const char *str)
#ifdef _WIN32
before_exec();
- rb_w32_spawn(P_OVERLAY, (char *)str, 0);
+ do_spawn(P_OVERLAY, (char *)str);
after_exec();
#else
for (s=str; *s; s++) {
- if (ISSPACE(*s)) {
- const char *p, *nl = NULL;
- for (p = s; ISSPACE(*p); p++) {
- if (*p == '\n') nl = p;
- }
- if (!*p) break;
- if (nl) s = nl;
- }
if (*s != ' ' && !ISALPHA(*s) && strchr("*?{}[]<>()~&|\\$;'`\"\n",*s)) {
-#if defined(__CYGWIN32__) || defined(__EMX__)
- char fbuf[MAXPATHLEN];
- char *shell = dln_find_exe_r("sh", 0, fbuf, sizeof(fbuf));
+#if defined(MSDOS)
+ int status;
+ before_exec();
+ status = system(str);
+ after_exec();
+ if (status != -1)
+ exit(status);
+#else
+#if defined(__human68k__) || defined(__CYGWIN32__) || defined(__EMX__)
+ char *shell = dln_find_exe("sh", 0);
int status = -1;
before_exec();
if (shell)
@@ -1112,13 +1064,13 @@ rb_proc_exec(const char *str)
execl("/bin/sh", "sh", "-c", str, (char *)NULL);
preserving_errno(after_exec());
#endif
+#endif
return -1;
}
}
a = argv = ALLOCA_N(char*, (s-str)/2+2);
ss = ALLOCA_N(char, s-str+1);
- memcpy(ss, str, s-str);
- ss[s-str] = '\0';
+ strcpy(ss, str);
if ((*a++ = strtok(ss, " \t")) != 0) {
while ((t = strtok(NULL, " \t")) != 0) {
*a++ = t;
@@ -1133,68 +1085,97 @@ rb_proc_exec(const char *str)
return -1;
}
-#if defined(_WIN32)
-#define HAVE_SPAWNV 1
-#endif
-
-#if !defined(HAVE_FORK) && defined(HAVE_SPAWNV)
-#if defined(_WIN32)
-#define proc_spawn_v(argv, prog) rb_w32_aspawn(P_NOWAIT, prog, argv)
-#else
-static rb_pid_t
-proc_spawn_v(char **argv, char *prog)
+#if defined(__human68k__) || defined(__DJGPP__) || defined(_WIN32)
+static int
+proc_spawn_v(argv, prog)
+ char **argv;
+ char *prog;
{
- char fbuf[MAXPATHLEN];
- rb_pid_t status;
+#if defined(__human68k__)
+ char *extension;
+#endif
+ int status;
if (!prog)
prog = argv[0];
security(prog);
- prog = dln_find_exe_r(prog, 0, fbuf, sizeof(fbuf));
+ prog = dln_find_exe(prog, 0);
if (!prog)
return -1;
+#if defined(__human68k__)
+ if ((extension = strrchr(prog, '.')) != NULL && strcasecmp(extension, ".bat") == 0) {
+ char **new_argv;
+ char *p;
+ int n;
+
+ for (n = 0; argv[n]; n++)
+ /* no-op */;
+ new_argv = ALLOCA_N(char*, n + 2);
+ for (; n > 0; n--)
+ new_argv[n + 1] = argv[n];
+ new_argv[1] = strcpy(ALLOCA_N(char, strlen(argv[0]) + 1), argv[0]);
+ for (p = new_argv[1]; *p != '\0'; p++)
+ if (*p == '/')
+ *p = '\\';
+ new_argv[0] = COMMAND;
+ argv = new_argv;
+ prog = dln_find_exe(argv[0], 0);
+ if (!prog) {
+ errno = ENOENT;
+ return -1;
+ }
+ }
+#endif
before_exec();
+#if defined(_WIN32)
+ status = do_aspawn(P_WAIT, prog, argv);
+#else
status = spawnv(P_WAIT, prog, argv);
- rb_last_status_set(status == -1 ? 127 : status, 0);
+#endif
after_exec();
return status;
}
-#endif
-static rb_pid_t
-proc_spawn_n(int argc, VALUE *argv, VALUE prog)
+static int
+proc_spawn_n(argc, argv, prog)
+ int argc;
+ VALUE *argv;
+ VALUE prog;
{
char **args;
int i;
args = ALLOCA_N(char*, argc + 1);
for (i = 0; i < argc; i++) {
- args[i] = RSTRING_PTR(argv[i]);
+ SafeStringValue(argv[i]);
+ args[i] = StringValueCStr(argv[i]);
}
+ if (prog)
+ SafeStringValue(prog);
args[i] = (char*) 0;
if (args[0])
- return proc_spawn_v(args, prog ? RSTRING_PTR(prog) : 0);
+ return proc_spawn_v(args, prog ? StringValueCStr(prog) : 0);
return -1;
}
-#if defined(_WIN32)
-#define proc_spawn(str) rb_w32_spawn(P_NOWAIT, str, 0)
-#else
-static rb_pid_t
-proc_spawn(char *str)
+#if !defined(_WIN32)
+static int
+proc_spawn(sv)
+ VALUE sv;
{
- char fbuf[MAXPATHLEN];
+ char *str;
char *s, *t;
char **argv, **a;
- rb_pid_t status;
+ int status;
+ SafeStringValue(sv);
+ str = s = StringValueCStr(sv);
for (s = str; *s; s++) {
if (*s != ' ' && !ISALPHA(*s) && strchr("*?{}[]<>()~&|\\$;'`\"\n",*s)) {
- char *shell = dln_find_exe_r("sh", 0, fbuf, sizeof(fbuf));
+ char *shell = dln_find_exe("sh", 0);
before_exec();
status = shell?spawnl(P_WAIT,shell,"sh","-c",str,(char*)NULL):system(str);
- rb_last_status_set(status == -1 ? 127 : status, 0);
after_exec();
return status;
}
@@ -1212,547 +1193,69 @@ proc_spawn(char *str)
#endif
#endif
-static VALUE
-hide_obj(VALUE obj)
-{
- RBASIC(obj)->klass = 0;
- return obj;
-}
-
-enum {
- EXEC_OPTION_PGROUP,
- EXEC_OPTION_RLIMIT,
- EXEC_OPTION_UNSETENV_OTHERS,
- EXEC_OPTION_ENV,
- EXEC_OPTION_CHDIR,
- EXEC_OPTION_UMASK,
- EXEC_OPTION_DUP2,
- EXEC_OPTION_CLOSE,
- EXEC_OPTION_OPEN,
- EXEC_OPTION_DUP2_CHILD,
- EXEC_OPTION_CLOSE_OTHERS
+struct rb_exec_arg {
+ int argc;
+ VALUE *argv;
+ VALUE prog;
};
-static VALUE
-check_exec_redirect_fd(VALUE v)
-{
- VALUE tmp;
- int fd;
- if (FIXNUM_P(v)) {
- fd = FIX2INT(v);
- }
- else if (SYMBOL_P(v)) {
- ID id = SYM2ID(v);
- if (id == rb_intern("in"))
- fd = 0;
- else if (id == rb_intern("out"))
- fd = 1;
- else if (id == rb_intern("err"))
- fd = 2;
- else
- goto wrong;
- }
- else if (!NIL_P(tmp = rb_check_convert_type(v, T_FILE, "IO", "to_io"))) {
- rb_io_t *fptr;
- GetOpenFile(tmp, fptr);
- if (fptr->tied_io_for_writing)
- rb_raise(rb_eArgError, "duplex IO redirection");
- fd = fptr->fd;
- }
- else {
- rb_raise(rb_eArgError, "wrong exec redirect");
- }
- if (fd < 0) {
- wrong:
- rb_raise(rb_eArgError, "negative file descriptor");
- }
- return INT2FIX(fd);
-}
-
static void
-check_exec_redirect(VALUE key, VALUE val, VALUE options)
-{
- int index;
- VALUE ary, param;
- VALUE path, flags, perm;
- ID id;
-
- switch (TYPE(val)) {
- case T_SYMBOL:
- id = SYM2ID(val);
- if (id == rb_intern("close")) {
- index = EXEC_OPTION_CLOSE;
- param = Qnil;
- }
- else if (id == rb_intern("in")) {
- index = EXEC_OPTION_DUP2;
- param = INT2FIX(0);
- }
- else if (id == rb_intern("out")) {
- index = EXEC_OPTION_DUP2;
- param = INT2FIX(1);
- }
- else if (id == rb_intern("err")) {
- index = EXEC_OPTION_DUP2;
- param = INT2FIX(2);
- }
- else {
- rb_raise(rb_eArgError, "wrong exec redirect symbol: %s",
- rb_id2name(id));
- }
- break;
-
- case T_FILE:
- val = check_exec_redirect_fd(val);
- /* fall through */
- case T_FIXNUM:
- index = EXEC_OPTION_DUP2;
- param = val;
- break;
-
- case T_ARRAY:
- path = rb_ary_entry(val, 0);
- if (RARRAY_LEN(val) == 2 && SYMBOL_P(path) &&
- SYM2ID(path) == rb_intern("child")) {
- index = EXEC_OPTION_DUP2_CHILD;
- param = check_exec_redirect_fd(rb_ary_entry(val, 1));
- }
- else {
- index = EXEC_OPTION_OPEN;
- FilePathValue(path);
- flags = rb_ary_entry(val, 1);
- if (NIL_P(flags))
- flags = INT2NUM(O_RDONLY);
- else if (TYPE(flags) == T_STRING)
- flags = INT2NUM(rb_io_modestr_oflags(StringValueCStr(flags)));
- else
- flags = rb_to_int(flags);
- perm = rb_ary_entry(val, 2);
- perm = NIL_P(perm) ? INT2FIX(0644) : rb_to_int(perm);
- param = hide_obj(rb_ary_new3(3, hide_obj(rb_str_dup(path)),
- flags, perm));
- }
- break;
-
- case T_STRING:
- index = EXEC_OPTION_OPEN;
- path = val;
- FilePathValue(path);
- if (TYPE(key) == T_FILE)
- key = check_exec_redirect_fd(key);
- if (FIXNUM_P(key) && (FIX2INT(key) == 1 || FIX2INT(key) == 2))
- flags = INT2NUM(O_WRONLY|O_CREAT|O_TRUNC);
- else
- flags = INT2NUM(O_RDONLY);
- perm = INT2FIX(0644);
- param = hide_obj(rb_ary_new3(3, hide_obj(rb_str_dup(path)),
- flags, perm));
- break;
-
- default:
- rb_raise(rb_eArgError, "wrong exec redirect action");
- }
-
- ary = rb_ary_entry(options, index);
- if (NIL_P(ary)) {
- ary = hide_obj(rb_ary_new());
- rb_ary_store(options, index, ary);
- }
- if (TYPE(key) != T_ARRAY) {
- VALUE fd = check_exec_redirect_fd(key);
- rb_ary_push(ary, hide_obj(rb_assoc_new(fd, param)));
- }
- else {
- int i, n=0;
- for (i = 0 ; i < RARRAY_LEN(key); i++) {
- VALUE v = RARRAY_PTR(key)[i];
- VALUE fd = check_exec_redirect_fd(v);
- rb_ary_push(ary, hide_obj(rb_assoc_new(fd, param)));
- n++;
- }
- }
-}
-
-#ifdef RLIM2NUM
-static int rlimit_type_by_lname(const char *name);
-#endif
-
-int
-rb_exec_arg_addopt(struct rb_exec_arg *e, VALUE key, VALUE val)
-{
- VALUE options = e->options;
- ID id;
-#ifdef RLIM2NUM
- int rtype;
-#endif
-
- rb_secure(2);
-
- switch (TYPE(key)) {
- case T_SYMBOL:
- id = SYM2ID(key);
-#ifdef HAVE_SETPGID
- if (id == rb_intern("pgroup")) {
- if (!NIL_P(rb_ary_entry(options, EXEC_OPTION_PGROUP))) {
- rb_raise(rb_eArgError, "pgroup option specified twice");
- }
- if (!RTEST(val))
- val = Qfalse;
- else if (val == Qtrue)
- val = INT2FIX(0);
- else {
- pid_t pgroup = NUM2PIDT(val);
- if (pgroup < 0) {
- rb_raise(rb_eArgError, "negative process group ID : %ld", (long)pgroup);
- }
- val = PIDT2NUM(pgroup);
- }
- rb_ary_store(options, EXEC_OPTION_PGROUP, val);
- }
- else
-#endif
-#ifdef RLIM2NUM
- if (strncmp("rlimit_", rb_id2name(id), 7) == 0 &&
- (rtype = rlimit_type_by_lname(rb_id2name(id)+7)) != -1) {
- VALUE ary = rb_ary_entry(options, EXEC_OPTION_RLIMIT);
- VALUE tmp, softlim, hardlim;
- if (NIL_P(ary)) {
- ary = hide_obj(rb_ary_new());
- rb_ary_store(options, EXEC_OPTION_RLIMIT, ary);
- }
- tmp = rb_check_array_type(val);
- if (!NIL_P(tmp)) {
- if (RARRAY_LEN(tmp) == 1)
- softlim = hardlim = rb_to_int(rb_ary_entry(tmp, 0));
- else if (RARRAY_LEN(tmp) == 2) {
- softlim = rb_to_int(rb_ary_entry(tmp, 0));
- hardlim = rb_to_int(rb_ary_entry(tmp, 1));
- }
- else {
- rb_raise(rb_eArgError, "wrong exec rlimit option");
- }
- }
- else {
- softlim = hardlim = rb_to_int(val);
- }
- tmp = hide_obj(rb_ary_new3(3, INT2NUM(rtype), softlim, hardlim));
- rb_ary_push(ary, tmp);
- }
- else
-#endif
- if (id == rb_intern("unsetenv_others")) {
- if (!NIL_P(rb_ary_entry(options, EXEC_OPTION_UNSETENV_OTHERS))) {
- rb_raise(rb_eArgError, "unsetenv_others option specified twice");
- }
- val = RTEST(val) ? Qtrue : Qfalse;
- rb_ary_store(options, EXEC_OPTION_UNSETENV_OTHERS, val);
- }
- else if (id == rb_intern("chdir")) {
- if (!NIL_P(rb_ary_entry(options, EXEC_OPTION_CHDIR))) {
- rb_raise(rb_eArgError, "chdir option specified twice");
- }
- FilePathValue(val);
- rb_ary_store(options, EXEC_OPTION_CHDIR,
- hide_obj(rb_str_dup(val)));
- }
- else if (id == rb_intern("umask")) {
- mode_t cmask = NUM2LONG(val);
- if (!NIL_P(rb_ary_entry(options, EXEC_OPTION_UMASK))) {
- rb_raise(rb_eArgError, "umask option specified twice");
- }
- rb_ary_store(options, EXEC_OPTION_UMASK, LONG2NUM(cmask));
- }
- else if (id == rb_intern("close_others")) {
- if (!NIL_P(rb_ary_entry(options, EXEC_OPTION_CLOSE_OTHERS))) {
- rb_raise(rb_eArgError, "close_others option specified twice");
- }
- val = RTEST(val) ? Qtrue : Qfalse;
- rb_ary_store(options, EXEC_OPTION_CLOSE_OTHERS, val);
- }
- else if (id == rb_intern("in")) {
- key = INT2FIX(0);
- goto redirect;
- }
- else if (id == rb_intern("out")) {
- key = INT2FIX(1);
- goto redirect;
- }
- else if (id == rb_intern("err")) {
- key = INT2FIX(2);
- goto redirect;
- }
- else {
- rb_raise(rb_eArgError, "wrong exec option symbol: %s",
- rb_id2name(id));
- }
- break;
-
- case T_FIXNUM:
- case T_FILE:
- case T_ARRAY:
-redirect:
- check_exec_redirect(key, val, options);
- break;
-
- default:
- rb_raise(rb_eArgError, "wrong exec option");
- }
-
- return ST_CONTINUE;
-}
-
-static int
-check_exec_options_i(st_data_t st_key, st_data_t st_val, st_data_t arg)
-{
- VALUE key = (VALUE)st_key;
- VALUE val = (VALUE)st_val;
- struct rb_exec_arg *e = (struct rb_exec_arg *)arg;
- return rb_exec_arg_addopt(e, key, val);
-}
-
-static VALUE
-check_exec_fds(VALUE options)
-{
- VALUE h = rb_hash_new();
- VALUE ary;
- int index, i;
- int maxhint = -1;
-
- for (index = EXEC_OPTION_DUP2; index <= EXEC_OPTION_DUP2_CHILD; index++) {
- ary = rb_ary_entry(options, index);
- if (NIL_P(ary))
- continue;
- for (i = 0; i < RARRAY_LEN(ary); i++) {
- VALUE elt = RARRAY_PTR(ary)[i];
- int fd = FIX2INT(RARRAY_PTR(elt)[0]);
- if (RTEST(rb_hash_lookup(h, INT2FIX(fd)))) {
- rb_raise(rb_eArgError, "fd %d specified twice", fd);
- }
- if (index == EXEC_OPTION_OPEN || index == EXEC_OPTION_DUP2)
- rb_hash_aset(h, INT2FIX(fd), Qtrue);
- else if (index == EXEC_OPTION_DUP2_CHILD)
- rb_hash_aset(h, INT2FIX(fd), RARRAY_PTR(elt)[1]);
- else /* index == EXEC_OPTION_CLOSE */
- rb_hash_aset(h, INT2FIX(fd), INT2FIX(-1));
- if (maxhint < fd)
- maxhint = fd;
- if (index == EXEC_OPTION_DUP2 || index == EXEC_OPTION_DUP2_CHILD) {
- fd = FIX2INT(RARRAY_PTR(elt)[1]);
- if (maxhint < fd)
- maxhint = fd;
- }
- }
- }
-
- ary = rb_ary_entry(options, EXEC_OPTION_DUP2_CHILD);
- if (!NIL_P(ary)) {
- for (i = 0; i < RARRAY_LEN(ary); i++) {
- VALUE elt = RARRAY_PTR(ary)[i];
- int newfd = FIX2INT(RARRAY_PTR(elt)[0]);
- int oldfd = FIX2INT(RARRAY_PTR(elt)[1]);
- int lastfd = oldfd;
- VALUE val = rb_hash_lookup(h, INT2FIX(lastfd));
- long depth = 0;
- while (FIXNUM_P(val) && 0 <= FIX2INT(val)) {
- lastfd = FIX2INT(val);
- val = rb_hash_lookup(h, val);
- if (RARRAY_LEN(ary) < depth)
- rb_raise(rb_eArgError, "cyclic child fd redirection from %d", oldfd);
- depth++;
- }
- if (val != Qtrue)
- rb_raise(rb_eArgError, "child fd %d is not redirected", oldfd);
- if (oldfd != lastfd) {
- VALUE val2;
- rb_ary_store(elt, 1, INT2FIX(lastfd));
- rb_hash_aset(h, INT2FIX(newfd), INT2FIX(lastfd));
- val = INT2FIX(oldfd);
- while (FIXNUM_P(val2 = rb_hash_lookup(h, val))) {
- rb_hash_aset(h, val, INT2FIX(lastfd));
- val = val2;
- }
- }
- }
- }
-
- if (rb_ary_entry(options, EXEC_OPTION_CLOSE_OTHERS) != Qfalse) {
- rb_ary_store(options, EXEC_OPTION_CLOSE_OTHERS, INT2FIX(maxhint));
- }
- return h;
-}
-
-static void
-rb_check_exec_options(VALUE opthash, struct rb_exec_arg *e)
-{
- if (RHASH_EMPTY_P(opthash))
- return;
- st_foreach(RHASH_TBL(opthash), check_exec_options_i, (st_data_t)e);
-}
-
-static int
-check_exec_env_i(st_data_t st_key, st_data_t st_val, st_data_t arg)
-{
- VALUE key = (VALUE)st_key;
- VALUE val = (VALUE)st_val;
- VALUE env = (VALUE)arg;
- char *k;
-
- k = StringValueCStr(key);
- if (strchr(k, '='))
- rb_raise(rb_eArgError, "environment name contains a equal : %s", k);
-
- if (!NIL_P(val))
- StringValueCStr(val);
-
- rb_ary_push(env, hide_obj(rb_assoc_new(key, val)));
-
- return ST_CONTINUE;
-}
-
-static VALUE
-rb_check_exec_env(VALUE hash)
-{
- VALUE env;
-
- env = hide_obj(rb_ary_new());
- st_foreach(RHASH_TBL(hash), check_exec_env_i, (st_data_t)env);
-
- return env;
-}
-
-static VALUE
-rb_check_argv(int argc, VALUE *argv)
+proc_prepare_args(e, argc, argv, prog)
+ struct rb_exec_arg *e;
+ int argc;
+ VALUE *argv;
+ VALUE prog;
{
- VALUE tmp, prog;
int i;
- const char *name = 0;
-
- if (argc == 0) {
- rb_raise(rb_eArgError, "wrong number of arguments");
- }
- prog = 0;
- tmp = rb_check_array_type(argv[0]);
- if (!NIL_P(tmp)) {
- if (RARRAY_LEN(tmp) != 2) {
- rb_raise(rb_eArgError, "wrong first argument");
- }
- prog = RARRAY_PTR(tmp)[0];
- argv[0] = RARRAY_PTR(tmp)[1];
+ MEMZERO(e, struct rb_exec_arg, 1);
+ if (prog) {
SafeStringValue(prog);
StringValueCStr(prog);
- prog = rb_str_new4(prog);
- name = RSTRING_PTR(prog);
}
for (i = 0; i < argc; i++) {
SafeStringValue(argv[i]);
- argv[i] = rb_str_new4(argv[i]);
StringValueCStr(argv[i]);
}
- security(name ? name : RSTRING_PTR(argv[0]));
- return prog;
+ security(RSTRING(prog ? prog : argv[0])->ptr);
+ e->prog = prog;
+ e->argc = argc;
+ e->argv = argv;
}
static VALUE
-rb_exec_getargs(int *argc_p, VALUE **argv_p, int accept_shell, VALUE *env_ret, VALUE *opthash_ret, struct rb_exec_arg *e)
-{
- VALUE hash, prog;
-
- if (0 < *argc_p) {
- hash = rb_check_convert_type((*argv_p)[*argc_p-1], T_HASH, "Hash", "to_hash");
- if (!NIL_P(hash)) {
- *opthash_ret = hash;
- (*argc_p)--;
- }
- }
-
- if (0 < *argc_p) {
- hash = rb_check_convert_type((*argv_p)[0], T_HASH, "Hash", "to_hash");
- if (!NIL_P(hash)) {
- *env_ret = hash;
- (*argc_p)--;
- (*argv_p)++;
- }
- }
- prog = rb_check_argv(*argc_p, *argv_p);
- if (!prog) {
- prog = (*argv_p)[0];
- if (accept_shell && *argc_p == 1) {
- *argc_p = 0;
- *argv_p = 0;
- }
- }
- return prog;
-}
-
-static void
-rb_exec_fillarg(VALUE prog, int argc, VALUE *argv, VALUE env, VALUE opthash, struct rb_exec_arg *e)
+proc_exec_args(earg)
+ VALUE earg;
{
- VALUE options;
- MEMZERO(e, struct rb_exec_arg, 1);
- options = hide_obj(rb_ary_new());
- e->options = options;
+ struct rb_exec_arg *e = (struct rb_exec_arg *)earg;
+ int argc = e->argc;
+ VALUE *argv = e->argv;
+ VALUE prog = e->prog;
- if (!NIL_P(opthash)) {
- rb_check_exec_options(opthash, e);
+ if (argc == 1 && prog == 0) {
+ return (VALUE)rb_proc_exec(RSTRING(argv[0])->ptr);
}
- if (!NIL_P(env)) {
- env = rb_check_exec_env(env);
- rb_ary_store(options, EXEC_OPTION_ENV, env);
+ else {
+ return (VALUE)proc_exec_n(argc, argv, prog);
}
-
- e->argc = argc;
- e->argv = argv;
- e->prog = prog ? RSTRING_PTR(prog) : 0;
-}
-
-VALUE
-rb_exec_arg_init(int argc, VALUE *argv, int accept_shell, struct rb_exec_arg *e)
-{
- VALUE prog;
- VALUE env = Qnil, opthash = Qnil;
- prog = rb_exec_getargs(&argc, &argv, accept_shell, &env, &opthash, e);
- rb_exec_fillarg(prog, argc, argv, env, opthash, e);
- return prog;
-}
-
-void
-rb_exec_arg_fixup(struct rb_exec_arg *e)
-{
- e->redirect_fds = check_exec_fds(e->options);
}
/*
* call-seq:
- * exec([env,] command... [,options])
+ * exec(command [, arg, ...])
*
* Replaces the current process by running the given external _command_.
- * _command..._ is one of following forms.
- *
- * commandline : command line string which is passed to a shell
- * cmdname, arg1, ... : command name and one or more arguments (no shell)
- * [cmdname, argv0], arg1, ... : command name, argv[0] and zero or more arguments (no shell)
- *
- * If single string is given as the command,
- * it is taken as a command line that is subject to shell expansion before being executed.
- *
- * If two or more +string+ given,
- * the first is taken as a command name and
- * the rest are passed as parameters to command with no shell expansion.
- *
- * If a two-element array at the beginning of the command,
- * the first element is the command to be executed,
- * and the second argument is used as the <code>argv[0]</code> value,
- * which may show up in process listings.
- *
- * In order to execute the command, one of the <code>exec(2)</code>
- * system calls is used, so the running command may inherit some of the environment
- * of the original program (including open file descriptors).
- * This behavior is modified by env and options.
- * See <code>spawn</code> for details.
- *
- * Raises SystemCallError if the command couldn't execute (typically
- * <code>Errno::ENOENT</code> when it was not found).
+ * If +exec+ is given a single argument, that argument is
+ * taken as a line that is subject to shell expansion before being
+ * executed. If multiple arguments are given, the second and subsequent
+ * arguments are passed as parameters to _command_ with no shell
+ * expansion. If the first argument is a two-element array, the first
+ * element is the command to be executed, and the second argument is
+ * used as the <code>argv[0]</code> value, which may show up in process
+ * listings. In MSDOS environments, the command is executed in a
+ * subshell; otherwise, one of the <code>exec(2)</code> system calls is
+ * used, so the running command may inherit some of the environment of
+ * the original program (including open file descriptors).
*
* exec "echo *" # echoes list of files in current directory
* # never get here
@@ -1763,825 +1266,35 @@ rb_exec_arg_fixup(struct rb_exec_arg *e)
*/
VALUE
-rb_f_exec(int argc, VALUE *argv)
+rb_f_exec(argc, argv)
+ int argc;
+ VALUE *argv;
{
+ VALUE prog = 0;
+ VALUE tmp;
struct rb_exec_arg earg;
-#define CHILD_ERRMSG_BUFLEN 80
- char errmsg[CHILD_ERRMSG_BUFLEN] = { '\0' };
-
- rb_exec_arg_init(argc, argv, Qtrue, &earg);
- if (NIL_P(rb_ary_entry(earg.options, EXEC_OPTION_CLOSE_OTHERS)))
- rb_exec_arg_addopt(&earg, ID2SYM(rb_intern("close_others")), Qfalse);
- rb_exec_arg_fixup(&earg);
-
- rb_exec_err(&earg, errmsg, sizeof(errmsg));
- if (errmsg[0])
- rb_sys_fail(errmsg);
- rb_sys_fail(earg.prog);
- return Qnil; /* dummy */
-}
-
-#define ERRMSG(str) do { if (errmsg && 0 < errmsg_buflen) strlcpy(errmsg, (str), errmsg_buflen); } while (0)
-
-/*#define DEBUG_REDIRECT*/
-#if defined(DEBUG_REDIRECT)
-
-#include <stdarg.h>
-
-static void
-ttyprintf(const char *fmt, ...)
-{
- va_list ap;
- FILE *tty;
- int save = errno;
-#ifdef _WIN32
- tty = fopen("con", "w");
-#else
- tty = fopen("/dev/tty", "w");
-#endif
- if (!tty)
- return;
-
- va_start(ap, fmt);
- vfprintf(tty, fmt, ap);
- va_end(ap);
- fclose(tty);
- errno = save;
-}
-
-static int
-redirect_dup(int oldfd)
-{
- int ret;
- ret = dup(oldfd);
- ttyprintf("dup(%d) => %d\n", oldfd, ret);
- return ret;
-}
-
-static int
-redirect_dup2(int oldfd, int newfd)
-{
- int ret;
- ret = dup2(oldfd, newfd);
- ttyprintf("dup2(%d, %d)\n", oldfd, newfd);
- return ret;
-}
-
-static int
-redirect_close(int fd)
-{
- int ret;
- ret = close(fd);
- ttyprintf("close(%d)\n", fd);
- return ret;
-}
-
-static int
-redirect_open(const char *pathname, int flags, mode_t perm)
-{
- int ret;
- ret = open(pathname, flags, perm);
- ttyprintf("open(\"%s\", 0x%x, 0%o) => %d\n", pathname, flags, perm, ret);
- return ret;
-}
-
-#else
-#define redirect_dup(oldfd) dup(oldfd)
-#define redirect_dup2(oldfd, newfd) dup2(oldfd, newfd)
-#define redirect_close(fd) close(fd)
-#define redirect_open(pathname, flags, perm) open(pathname, flags, perm)
-#endif
-
-static int
-save_redirect_fd(int fd, VALUE save, char *errmsg, size_t errmsg_buflen)
-{
- if (!NIL_P(save)) {
- VALUE newary;
- int save_fd = redirect_dup(fd);
- if (save_fd == -1) {
- ERRMSG("dup");
- return -1;
- }
- newary = rb_ary_entry(save, EXEC_OPTION_DUP2);
- if (NIL_P(newary)) {
- newary = hide_obj(rb_ary_new());
- rb_ary_store(save, EXEC_OPTION_DUP2, newary);
- }
- rb_ary_push(newary,
- hide_obj(rb_assoc_new(INT2FIX(fd), INT2FIX(save_fd))));
-
- newary = rb_ary_entry(save, EXEC_OPTION_CLOSE);
- if (NIL_P(newary)) {
- newary = hide_obj(rb_ary_new());
- rb_ary_store(save, EXEC_OPTION_CLOSE, newary);
- }
- rb_ary_push(newary, hide_obj(rb_assoc_new(INT2FIX(save_fd), Qnil)));
- }
-
- return 0;
-}
-
-static VALUE
-save_env_i(VALUE i, VALUE ary, int argc, VALUE *argv)
-{
- rb_ary_push(ary, hide_obj(rb_ary_dup(argv[0])));
- return Qnil;
-}
-
-static void
-save_env(VALUE save)
-{
- if (!NIL_P(save) && NIL_P(rb_ary_entry(save, EXEC_OPTION_ENV))) {
- VALUE env = rb_const_get(rb_cObject, rb_intern("ENV"));
- if (RTEST(env)) {
- VALUE ary = hide_obj(rb_ary_new());
- rb_block_call(env, rb_intern("each"), 0, 0, save_env_i,
- (VALUE)ary);
- rb_ary_store(save, EXEC_OPTION_ENV, ary);
- }
- rb_ary_store(save, EXEC_OPTION_UNSETENV_OTHERS, Qtrue);
- }
-}
-
-static int
-intcmp(const void *a, const void *b)
-{
- return *(int*)a - *(int*)b;
-}
-
-static int
-intrcmp(const void *a, const void *b)
-{
- return *(int*)b - *(int*)a;
-}
-
-static int
-run_exec_dup2(VALUE ary, VALUE save, char *errmsg, size_t errmsg_buflen)
-{
- long n, i;
- int ret;
- int extra_fd = -1;
- struct fd_pair {
- int oldfd;
- int newfd;
- int older_index;
- int num_newer;
- } *pairs = 0;
-
- n = RARRAY_LEN(ary);
- pairs = (struct fd_pair *)malloc(sizeof(struct fd_pair) * n);
- if (pairs == NULL) {
- ERRMSG("malloc");
- return -1;
- }
-
- /* initialize oldfd and newfd: O(n) */
- for (i = 0; i < n; i++) {
- VALUE elt = RARRAY_PTR(ary)[i];
- pairs[i].oldfd = FIX2INT(RARRAY_PTR(elt)[1]);
- pairs[i].newfd = FIX2INT(RARRAY_PTR(elt)[0]); /* unique */
- pairs[i].older_index = -1;
- }
-
- /* sort the table by oldfd: O(n log n) */
- if (!RTEST(save))
- qsort(pairs, n, sizeof(struct fd_pair), intcmp);
- else
- qsort(pairs, n, sizeof(struct fd_pair), intrcmp);
-
- /* initialize older_index and num_newer: O(n log n) */
- for (i = 0; i < n; i++) {
- int newfd = pairs[i].newfd;
- struct fd_pair key, *found;
- key.oldfd = newfd;
- found = bsearch(&key, pairs, n, sizeof(struct fd_pair), intcmp);
- pairs[i].num_newer = 0;
- if (found) {
- while (pairs < found && (found-1)->oldfd == newfd)
- found--;
- while (found < pairs+n && found->oldfd == newfd) {
- pairs[i].num_newer++;
- found->older_index = i;
- found++;
- }
- }
- }
-
- /* non-cyclic redirection: O(n) */
- for (i = 0; i < n; i++) {
- int j = i;
- while (j != -1 && pairs[j].oldfd != -1 && pairs[j].num_newer == 0) {
- if (save_redirect_fd(pairs[j].newfd, save, errmsg, errmsg_buflen) < 0)
- goto fail;
- ret = redirect_dup2(pairs[j].oldfd, pairs[j].newfd);
- if (ret == -1) {
- ERRMSG("dup2");
- goto fail;
- }
- pairs[j].oldfd = -1;
- j = pairs[j].older_index;
- if (j != -1)
- pairs[j].num_newer--;
- }
- }
-
- /* cyclic redirection: O(n) */
- for (i = 0; i < n; i++) {
- int j;
- if (pairs[i].oldfd == -1)
- continue;
- if (pairs[i].oldfd == pairs[i].newfd) { /* self cycle */
-#ifdef F_GETFD
- int fd = pairs[i].oldfd;
- ret = fcntl(fd, F_GETFD);
- if (ret == -1) {
- ERRMSG("fcntl(F_GETFD)");
- goto fail;
- }
- if (ret & FD_CLOEXEC) {
- ret &= ~FD_CLOEXEC;
- ret = fcntl(fd, F_SETFD, ret);
- if (ret == -1) {
- ERRMSG("fcntl(F_SETFD)");
- goto fail;
- }
- }
-#endif
- pairs[i].oldfd = -1;
- continue;
- }
- if (extra_fd == -1) {
- extra_fd = redirect_dup(pairs[i].oldfd);
- if (extra_fd == -1) {
- ERRMSG("dup");
- goto fail;
- }
- }
- else {
- ret = redirect_dup2(pairs[i].oldfd, extra_fd);
- if (ret == -1) {
- ERRMSG("dup2");
- goto fail;
- }
- }
- pairs[i].oldfd = extra_fd;
- j = pairs[i].older_index;
- pairs[i].older_index = -1;
- while (j != -1) {
- ret = redirect_dup2(pairs[j].oldfd, pairs[j].newfd);
- if (ret == -1) {
- ERRMSG("dup2");
- goto fail;
- }
- pairs[j].oldfd = -1;
- j = pairs[j].older_index;
- }
- }
- if (extra_fd != -1) {
- ret = redirect_close(extra_fd);
- if (ret == -1) {
- ERRMSG("close");
- goto fail;
- }
- }
-
- xfree(pairs);
- return 0;
-
- fail:
- xfree(pairs);
- return -1;
-}
-
-static int
-run_exec_close(VALUE ary, char *errmsg, size_t errmsg_buflen)
-{
- int i, ret;
-
- for (i = 0; i < RARRAY_LEN(ary); i++) {
- VALUE elt = RARRAY_PTR(ary)[i];
- int fd = FIX2INT(RARRAY_PTR(elt)[0]);
- ret = redirect_close(fd);
- if (ret == -1) {
- ERRMSG("close");
- return -1;
- }
- }
- return 0;
-}
-
-static int
-run_exec_open(VALUE ary, VALUE save, char *errmsg, size_t errmsg_buflen)
-{
- int i, ret;
-
- for (i = 0; i < RARRAY_LEN(ary);) {
- VALUE elt = RARRAY_PTR(ary)[i];
- int fd = FIX2INT(RARRAY_PTR(elt)[0]);
- VALUE param = RARRAY_PTR(elt)[1];
- char *path = RSTRING_PTR(RARRAY_PTR(param)[0]);
- int flags = NUM2INT(RARRAY_PTR(param)[1]);
- int perm = NUM2INT(RARRAY_PTR(param)[2]);
- int need_close = 1;
- int fd2 = redirect_open(path, flags, perm);
- if (fd2 == -1) {
- ERRMSG("open");
- return -1;
- }
- while (i < RARRAY_LEN(ary) &&
- (elt = RARRAY_PTR(ary)[i], RARRAY_PTR(elt)[1] == param)) {
- fd = FIX2INT(RARRAY_PTR(elt)[0]);
- if (fd == fd2) {
- need_close = 0;
- }
- else {
- if (save_redirect_fd(fd, save, errmsg, errmsg_buflen) < 0)
- return -1;
- ret = redirect_dup2(fd2, fd);
- if (ret == -1) {
- ERRMSG("dup2");
- return -1;
- }
- }
- i++;
- }
- if (need_close) {
- ret = redirect_close(fd2);
- if (ret == -1) {
- ERRMSG("close");
- return -1;
- }
- }
- }
- return 0;
-}
-
-static int
-run_exec_dup2_child(VALUE ary, VALUE save, char *errmsg, size_t errmsg_buflen)
-{
- int i, ret;
- for (i = 0; i < RARRAY_LEN(ary); i++) {
- VALUE elt = RARRAY_PTR(ary)[i];
- int newfd = FIX2INT(RARRAY_PTR(elt)[0]);
- int oldfd = FIX2INT(RARRAY_PTR(elt)[1]);
-
- if (save_redirect_fd(newfd, save, errmsg, errmsg_buflen) < 0)
- return -1;
- ret = redirect_dup2(oldfd, newfd);
- if (ret == -1) {
- ERRMSG("dup2");
- return -1;
- }
- }
- return 0;
-}
-
-#ifdef HAVE_SETPGID
-static int
-run_exec_pgroup(VALUE obj, VALUE save, char *errmsg, size_t errmsg_buflen)
-{
- /*
- * If FD_CLOEXEC is available, rb_fork waits the child's execve.
- * So setpgid is done in the child when rb_fork is returned in the parent.
- * No race condition, even without setpgid from the parent.
- * (Is there an environment which has setpgid but FD_CLOEXEC?)
- */
- int ret;
- pid_t pgroup;
- if (!NIL_P(save)) {
- /* maybe meaningless with no fork environment... */
- rb_ary_store(save, EXEC_OPTION_PGROUP, PIDT2NUM(getpgrp()));
- }
- pgroup = NUM2PIDT(obj);
- if (pgroup == 0) {
- pgroup = getpid();
- }
- ret = setpgid(getpid(), pgroup);
- if (ret == -1) ERRMSG("setpgid");
- return ret;
-}
-#endif
-
-#ifdef RLIM2NUM
-static int
-run_exec_rlimit(VALUE ary, VALUE save, char *errmsg, size_t errmsg_buflen)
-{
- int i;
- for (i = 0; i < RARRAY_LEN(ary); i++) {
- VALUE elt = RARRAY_PTR(ary)[i];
- int rtype = NUM2INT(RARRAY_PTR(elt)[0]);
- struct rlimit rlim;
- if (!NIL_P(save)) {
- VALUE tmp, newary;
- if (getrlimit(rtype, &rlim) == -1) {
- ERRMSG("getrlimit");
- return -1;
- }
- tmp = hide_obj(rb_ary_new3(3, RARRAY_PTR(elt)[0],
- RLIM2NUM(rlim.rlim_cur),
- RLIM2NUM(rlim.rlim_max)));
- newary = rb_ary_entry(save, EXEC_OPTION_RLIMIT);
- if (NIL_P(newary)) {
- newary = hide_obj(rb_ary_new());
- rb_ary_store(save, EXEC_OPTION_RLIMIT, newary);
- }
- rb_ary_push(newary, tmp);
- }
- rlim.rlim_cur = NUM2RLIM(RARRAY_PTR(elt)[1]);
- rlim.rlim_max = NUM2RLIM(RARRAY_PTR(elt)[2]);
- if (setrlimit(rtype, &rlim) == -1) {
- ERRMSG("setrlimit");
- return -1;
- }
- }
- return 0;
-}
-#endif
-
-int
-rb_run_exec_options_err(const struct rb_exec_arg *e, struct rb_exec_arg *s, char *errmsg, size_t errmsg_buflen)
-{
- VALUE options = e->options;
- VALUE soptions = Qnil;
- VALUE obj;
-
- if (!RTEST(options))
- return 0;
-
- if (s) {
- s->argc = 0;
- s->argv = NULL;
- s->prog = NULL;
- s->options = soptions = hide_obj(rb_ary_new());
- s->redirect_fds = Qnil;
- }
-
-#ifdef HAVE_SETPGID
- obj = rb_ary_entry(options, EXEC_OPTION_PGROUP);
- if (RTEST(obj)) {
- if (run_exec_pgroup(obj, soptions, errmsg, errmsg_buflen) == -1)
- return -1;
- }
-#endif
-
-#ifdef RLIM2NUM
- obj = rb_ary_entry(options, EXEC_OPTION_RLIMIT);
- if (!NIL_P(obj)) {
- if (run_exec_rlimit(obj, soptions, errmsg, errmsg_buflen) == -1)
- return -1;
- }
-#endif
-
- obj = rb_ary_entry(options, EXEC_OPTION_UNSETENV_OTHERS);
- if (RTEST(obj)) {
- save_env(soptions);
- rb_env_clear();
- }
-
- obj = rb_ary_entry(options, EXEC_OPTION_ENV);
- if (!NIL_P(obj)) {
- int i;
- save_env(soptions);
- for (i = 0; i < RARRAY_LEN(obj); i++) {
- VALUE pair = RARRAY_PTR(obj)[i];
- VALUE key = RARRAY_PTR(pair)[0];
- VALUE val = RARRAY_PTR(pair)[1];
- if (NIL_P(val))
- ruby_setenv(StringValueCStr(key), 0);
- else
- ruby_setenv(StringValueCStr(key), StringValueCStr(val));
- }
- }
-
- obj = rb_ary_entry(options, EXEC_OPTION_CHDIR);
- if (!NIL_P(obj)) {
- if (!NIL_P(soptions)) {
- char *cwd = my_getcwd();
- rb_ary_store(soptions, EXEC_OPTION_CHDIR,
- hide_obj(rb_str_new2(cwd)));
- xfree(cwd);
- }
- if (chdir(RSTRING_PTR(obj)) == -1) {
- ERRMSG("chdir");
- return -1;
- }
- }
-
- obj = rb_ary_entry(options, EXEC_OPTION_UMASK);
- if (!NIL_P(obj)) {
- mode_t mask = NUM2LONG(obj);
- mode_t oldmask = umask(mask); /* never fail */
- if (!NIL_P(soptions))
- rb_ary_store(soptions, EXEC_OPTION_UMASK, LONG2NUM(oldmask));
- }
-
- obj = rb_ary_entry(options, EXEC_OPTION_DUP2);
- if (!NIL_P(obj)) {
- if (run_exec_dup2(obj, soptions, errmsg, errmsg_buflen) == -1)
- return -1;
- }
-
- obj = rb_ary_entry(options, EXEC_OPTION_CLOSE);
- if (!NIL_P(obj)) {
- if (!NIL_P(soptions))
- rb_warn("cannot close fd before spawn");
- else {
- if (run_exec_close(obj, errmsg, errmsg_buflen) == -1)
- return -1;
- }
- }
-
-#ifdef HAVE_FORK
- obj = rb_ary_entry(options, EXEC_OPTION_CLOSE_OTHERS);
- if (obj != Qfalse) {
- rb_close_before_exec(3, FIX2INT(obj), e->redirect_fds);
- }
-#endif
-
- obj = rb_ary_entry(options, EXEC_OPTION_OPEN);
- if (!NIL_P(obj)) {
- if (run_exec_open(obj, soptions, errmsg, errmsg_buflen) == -1)
- return -1;
- }
-
- obj = rb_ary_entry(options, EXEC_OPTION_DUP2_CHILD);
- if (!NIL_P(obj)) {
- if (run_exec_dup2_child(obj, soptions, errmsg, errmsg_buflen) == -1)
- return -1;
- }
-
- return 0;
-}
-
-int
-rb_run_exec_options(const struct rb_exec_arg *e, struct rb_exec_arg *s)
-{
- return rb_run_exec_options_err(e, s, NULL, 0);
-}
-
-int
-rb_exec_err(const struct rb_exec_arg *e, char *errmsg, size_t errmsg_buflen)
-{
- int argc = e->argc;
- VALUE *argv = e->argv;
- const char *prog = e->prog;
-
- if (rb_run_exec_options_err(e, NULL, errmsg, errmsg_buflen) < 0) {
- return -1;
- }
if (argc == 0) {
- rb_proc_exec(prog);
- }
- else {
- rb_proc_exec_n(argc, argv, prog);
- }
- return -1;
-}
-
-int
-rb_exec(const struct rb_exec_arg *e)
-{
-#if !defined FD_CLOEXEC && !defined HAVE_SPAWNV
- char errmsg[80] = { '\0' };
- int ret = rb_exec_err(e, errmsg, sizeof(errmsg));
- preserving_errno(
- if (errmsg[0]) {
- fprintf(stderr, "%s\n", errmsg);
- }
- else {
- fprintf(stderr, "%s:%d: command not found: %s\n",
- rb_sourcefile(), rb_sourceline(), e->prog);
- }
- );
- return ret;
-#else
- return rb_exec_err(e, NULL, 0);
-#endif
-}
-
-#ifdef HAVE_FORK
-static int
-rb_exec_atfork(void* arg, char *errmsg, size_t errmsg_buflen)
-{
- rb_thread_atfork_before_exec();
- return rb_exec_err(arg, errmsg, errmsg_buflen);
-}
-#endif
-
-#ifdef HAVE_FORK
-#ifdef FD_CLOEXEC
-#if SIZEOF_INT == SIZEOF_LONG
-#define proc_syswait (VALUE (*)(VALUE))rb_syswait
-#else
-static VALUE
-proc_syswait(VALUE pid)
-{
- rb_syswait((int)pid);
- return Qnil;
-}
-#endif
-#endif
-
-static int
-move_fds_to_avoid_crash(int *fdp, int n, VALUE fds)
-{
- long min = 0;
- int i;
- for (i = 0; i < n; i++) {
- int ret;
- while (RTEST(rb_hash_lookup(fds, INT2FIX(fdp[i])))) {
- if (min <= fdp[i])
- min = fdp[i]+1;
- while (RTEST(rb_hash_lookup(fds, INT2FIX(min))))
- min++;
- ret = fcntl(fdp[i], F_DUPFD, min);
- if (ret == -1)
- return -1;
- close(fdp[i]);
- fdp[i] = ret;
- }
+ rb_last_status = Qnil;
+ rb_raise(rb_eArgError, "wrong number of arguments");
}
- return 0;
-}
-static int
-pipe_nocrash(int filedes[2], VALUE fds)
-{
- int ret;
- ret = rb_pipe(filedes);
- if (ret == -1)
- return -1;
- if (RTEST(fds)) {
- int save = errno;
- if (move_fds_to_avoid_crash(filedes, 2, fds) == -1) {
- close(filedes[0]);
- close(filedes[1]);
- return -1;
- }
- errno = save;
- }
- return ret;
-}
-
-/*
- * Forks child process, and returns the process ID in the parent
- * process.
- *
- * If +status+ is given, protects from any exceptions and sets the
- * jump status to it.
- *
- * In the child process, just returns 0 if +chfunc+ is +NULL+.
- * Otherwise +chfunc+ will be called with +charg+, and then the child
- * process exits with +EXIT_SUCCESS+ when it returned zero.
- *
- * In the case of the function is called and returns non-zero value,
- * the child process exits with non-+EXIT_SUCCESS+ value (normally
- * 127). And, on the platforms where +FD_CLOEXEC+ is available,
- * +errno+ is propagated to the parent process, and this function
- * returns -1 in the parent process. On the other platforms, just
- * returns pid.
- *
- * If fds is not Qnil, internal pipe for the errno propagation is
- * arranged to avoid conflicts of the hash keys in +fds+.
- *
- * +chfunc+ must not raise any exceptions.
- */
-rb_pid_t
-rb_fork_err(int *status, int (*chfunc)(void*, char *, size_t), void *charg, VALUE fds,
- char *errmsg, size_t errmsg_buflen)
-{
- rb_pid_t pid;
- int err, state = 0;
-#ifdef FD_CLOEXEC
- int ep[2];
-#endif
-
-#define prefork() ( \
- rb_io_flush(rb_stdout), \
- rb_io_flush(rb_stderr) \
- )
- prefork();
-
-#ifdef FD_CLOEXEC
- if (chfunc) {
- if (pipe_nocrash(ep, fds)) return -1;
- if (fcntl(ep[1], F_SETFD, FD_CLOEXEC)) {
- preserving_errno((close(ep[0]), close(ep[1])));
- return -1;
- }
- }
-#endif
- for (; before_fork(), (pid = fork()) < 0; prefork()) {
- after_fork();
- switch (errno) {
- case EAGAIN:
-#if defined(EWOULDBLOCK) && EWOULDBLOCK != EAGAIN
- case EWOULDBLOCK:
-#endif
- if (!status && !chfunc) {
- rb_thread_sleep(1);
- continue;
- }
- else {
- rb_protect((VALUE (*)())rb_thread_sleep, 1, &state);
- if (status) *status = state;
- if (!state) continue;
- }
- default:
-#ifdef FD_CLOEXEC
- if (chfunc) {
- preserving_errno((close(ep[0]), close(ep[1])));
- }
-#endif
- if (state && !status) rb_jump_tag(state);
- return -1;
- }
- }
- if (!pid) {
- forked_child = 1;
- if (chfunc) {
-#ifdef FD_CLOEXEC
- close(ep[0]);
-#endif
- if (!(*chfunc)(charg, errmsg, errmsg_buflen)) _exit(EXIT_SUCCESS);
-#ifdef FD_CLOEXEC
- err = errno;
- (void)write(ep[1], &err, sizeof(err));
- if (errmsg && 0 < errmsg_buflen) {
- errmsg[errmsg_buflen-1] = '\0';
- (void)write(ep[1], errmsg, strlen(errmsg));
- }
-#endif
-#if EXIT_SUCCESS == 127
- _exit(EXIT_FAILURE);
-#else
- _exit(127);
-#endif
- }
- }
- after_fork();
-#ifdef FD_CLOEXEC
- if (pid && chfunc) {
- ssize_t size;
- close(ep[1]);
- if ((size = read(ep[0], &err, sizeof(err))) < 0) {
- err = errno;
- }
- if (size == sizeof(err) &&
- errmsg && 0 < errmsg_buflen) {
- ssize_t ret;
- ret = read(ep[0], errmsg, errmsg_buflen-1);
- if (0 <= ret) {
- errmsg[ret] = '\0';
- }
- }
- close(ep[0]);
- if (size) {
- if (status) {
- rb_protect(proc_syswait, (VALUE)pid, status);
- }
- else {
- rb_syswait(pid);
- }
- errno = err;
- return -1;
+ tmp = rb_check_array_type(argv[0]);
+ if (!NIL_P(tmp)) {
+ if (RARRAY(tmp)->len != 2) {
+ rb_raise(rb_eArgError, "wrong first argument");
}
+ prog = RARRAY(tmp)->ptr[0];
+ argv[0] = RARRAY(tmp)->ptr[1];
+ SafeStringValue(prog);
}
-#endif
- return pid;
-}
-
-struct chfunc_wrapper_t {
- int (*chfunc)(void*);
- void *arg;
-};
-
-static int
-chfunc_wrapper(void *arg_, char *errmsg, size_t errmsg_buflen)
-{
- struct chfunc_wrapper_t *arg = arg_;
- return arg->chfunc(arg->arg);
-}
-
-rb_pid_t
-rb_fork(int *status, int (*chfunc)(void*), void *charg, VALUE fds)
-{
- if (chfunc) {
- struct chfunc_wrapper_t warg;
- warg.chfunc = chfunc;
- warg.arg = charg;
- return rb_fork_err(status, chfunc_wrapper, &warg, fds, NULL, 0);
- }
- else {
- return rb_fork_err(status, NULL, NULL, fds, NULL, 0);
- }
-
+ proc_prepare_args(&earg, argc, argv, prog);
+ proc_exec_args((VALUE)&earg);
+ rb_sys_fail(RSTRING(argv[0])->ptr);
+ return Qnil; /* dummy */
}
-#endif
-#if defined(HAVE_FORK) && !defined(CANNOT_FORK_WITH_PTHREAD)
/*
* call-seq:
* Kernel.fork [{ block }] => fixnum or nil
@@ -2604,13 +1317,20 @@ rb_fork(int *status, int (*chfunc)(void*), void *charg, VALUE fds)
*/
static VALUE
-rb_f_fork(VALUE obj)
+rb_f_fork(obj)
+ VALUE obj;
{
- rb_pid_t pid;
+#if !defined(__human68k__) && !defined(_WIN32) && !defined(__MACOS__) && !defined(__EMX__) && !defined(__VMS)
+ int pid;
rb_secure(2);
- switch (pid = rb_fork(0, 0, 0, Qnil)) {
+#ifndef __VMS
+ fflush(stdout);
+ fflush(stderr);
+#endif
+
+ switch (pid = fork()) {
case 0:
#ifdef linux
after_exec();
@@ -2629,12 +1349,13 @@ rb_f_fork(VALUE obj)
return Qnil;
default:
- return PIDT2NUM(pid);
+ return INT2FIX(pid);
}
-}
#else
-#define rb_f_fork rb_f_notimplement
+ rb_notimplement();
#endif
+}
+
/*
* call-seq:
@@ -2648,13 +1369,16 @@ rb_f_fork(VALUE obj)
*/
static VALUE
-rb_f_exit_bang(int argc, VALUE *argv, VALUE obj)
+rb_f_exit_bang(argc, argv, obj)
+ int argc;
+ VALUE *argv;
+ VALUE obj;
{
VALUE status;
int istatus;
rb_secure(4);
- if (argc > 0 && rb_scan_args(argc, argv, "01", &status) == 1) {
+ if (rb_scan_args(argc, argv, "01", &status) == 1) {
switch (status) {
case Qtrue:
istatus = EXIT_SUCCESS;
@@ -2675,142 +1399,22 @@ rb_f_exit_bang(int argc, VALUE *argv, VALUE obj)
return Qnil; /* not reached */
}
-void
-rb_exit(int status)
-{
- if (GET_THREAD()->tag) {
- VALUE args[2];
-
- args[0] = INT2NUM(status);
- args[1] = rb_str_new2("exit");
- rb_exc_raise(rb_class_new_instance(2, args, rb_eSystemExit));
- }
- ruby_finalize();
- exit(status);
-}
-
-
-/*
- * call-seq:
- * exit(integer=0)
- * Kernel::exit(integer=0)
- * Process::exit(integer=0)
- *
- * Initiates the termination of the Ruby script by raising the
- * <code>SystemExit</code> exception. This exception may be caught. The
- * optional parameter is used to return a status code to the invoking
- * environment.
- *
- * begin
- * exit
- * puts "never get here"
- * rescue SystemExit
- * puts "rescued a SystemExit exception"
- * end
- * puts "after begin block"
- *
- * <em>produces:</em>
- *
- * rescued a SystemExit exception
- * after begin block
- *
- * Just prior to termination, Ruby executes any <code>at_exit</code> functions
- * (see Kernel::at_exit) and runs any object finalizers (see
- * ObjectSpace::define_finalizer).
- *
- * at_exit { puts "at_exit function" }
- * ObjectSpace.define_finalizer("string", proc { puts "in finalizer" })
- * exit
- *
- * <em>produces:</em>
- *
- * at_exit function
- * in finalizer
- */
-
-VALUE
-rb_f_exit(int argc, VALUE *argv)
-{
- VALUE status;
- int istatus;
-
- rb_secure(4);
- if (argc > 0 && rb_scan_args(argc, argv, "01", &status) == 1) {
- switch (status) {
- case Qtrue:
- istatus = EXIT_SUCCESS;
- break;
- case Qfalse:
- istatus = EXIT_FAILURE;
- break;
- default:
- istatus = NUM2INT(status);
-#if EXIT_SUCCESS != 0
- if (istatus == 0)
- istatus = EXIT_SUCCESS;
-#endif
- break;
- }
- }
- else {
- istatus = EXIT_SUCCESS;
- }
- rb_exit(istatus);
- return Qnil; /* not reached */
-}
-
-
-/*
- * call-seq:
- * abort
- * Kernel::abort
- * Process::abort
- *
- * Terminate execution immediately, effectively by calling
- * <code>Kernel.exit(1)</code>. If _msg_ is given, it is written
- * to STDERR prior to terminating.
- */
-
-VALUE
-rb_f_abort(int argc, VALUE *argv)
-{
- extern void ruby_error_print(void);
-
- rb_secure(4);
- if (argc == 0) {
- if (!NIL_P(GET_THREAD()->errinfo)) {
- ruby_error_print();
- }
- rb_exit(EXIT_FAILURE);
- }
- else {
- VALUE args[2];
-
- rb_scan_args(argc, argv, "1", &args[1]);
- StringValue(argv[0]);
- rb_io_puts(argc, argv, rb_stderr);
- args[0] = INT2NUM(EXIT_FAILURE);
- rb_exc_raise(rb_class_new_instance(2, args, rb_eSystemExit));
- }
- return Qnil; /* not reached */
-}
-
-
-#if defined(POSIX_SIGNAL)
-# define signal(a,b) posix_signal(a,b)
+#if defined(sun)
+#define signal(a,b) sigset(a,b)
#endif
void
-rb_syswait(rb_pid_t pid)
+rb_syswait(pid)
+ int pid;
{
static int overriding;
#ifdef SIGHUP
- RETSIGTYPE (*hfunc)(int) = 0;
+ RETSIGTYPE (*hfunc)_((int)) = 0;
#endif
#ifdef SIGQUIT
- RETSIGTYPE (*qfunc)(int) = 0;
+ RETSIGTYPE (*qfunc)_((int)) = 0;
#endif
- RETSIGTYPE (*ifunc)(int) = 0;
+ RETSIGTYPE (*ifunc)_((int)) = 0;
int status;
int i, hooked = Qfalse;
@@ -2842,93 +1446,15 @@ rb_syswait(rb_pid_t pid)
}
}
-static rb_pid_t
-rb_spawn_internal(int argc, VALUE *argv, int default_close_others,
- char *errmsg, size_t errmsg_buflen)
-{
- rb_pid_t pid;
-#if defined HAVE_FORK || !defined HAVE_SPAWNV
- int status;
-#endif
- VALUE prog;
- struct rb_exec_arg earg;
-#if !defined HAVE_FORK
- struct rb_exec_arg sarg;
-#endif
-
- prog = rb_exec_arg_init(argc, argv, Qtrue, &earg);
- if (NIL_P(rb_ary_entry(earg.options, EXEC_OPTION_CLOSE_OTHERS))) {
- VALUE v = default_close_others ? Qtrue : Qfalse;
- rb_exec_arg_addopt(&earg, ID2SYM(rb_intern("close_others")), v);
- }
- rb_exec_arg_fixup(&earg);
-
-#if defined HAVE_FORK
- pid = rb_fork_err(&status, rb_exec_atfork, &earg, earg.redirect_fds, errmsg, errmsg_buflen);
- if (prog && earg.argc) earg.argv[0] = prog;
-#else
- if (rb_run_exec_options_err(&earg, &sarg, errmsg, errmsg_buflen) < 0) {
- return -1;
- }
-
- argc = earg.argc;
- argv = earg.argv;
- if (prog && argc) argv[0] = prog;
-# if defined HAVE_SPAWNV
- if (!argc) {
- pid = proc_spawn(RSTRING_PTR(prog));
- }
- else {
- pid = proc_spawn_n(argc, argv, prog);
- }
-# if defined(_WIN32)
- if (pid == -1)
- rb_last_status_set(0x7f << 8, 0);
-# endif
-# else
- if (argc) prog = rb_ary_join(rb_ary_new4(argc, argv), rb_str_new2(" "));
- status = system(StringValuePtr(prog));
- rb_last_status_set((status & 0xff) << 8, 0);
-# endif
-
- rb_run_exec_options_err(&sarg, NULL, errmsg, errmsg_buflen);
-#endif
- return pid;
-}
-
-rb_pid_t
-rb_spawn_err(int argc, VALUE *argv, char *errmsg, size_t errmsg_buflen)
-{
- return rb_spawn_internal(argc, argv, Qtrue, errmsg, errmsg_buflen);
-}
-
-rb_pid_t
-rb_spawn(int argc, VALUE *argv)
-{
- return rb_spawn_internal(argc, argv, Qtrue, NULL, 0);
-}
-
/*
* call-seq:
- * system([env,] command... [,options]) => true, false or nil
- *
- * Executes _command..._ in a subshell.
- * _command..._ is one of following forms.
- *
- * commandline : command line string which is passed to a shell
- * cmdname, arg1, ... : command name and one or more arguments (no shell)
- * [cmdname, argv0], arg1, ... : command name, argv[0] and zero or more arguments (no shell)
- *
- * system returns +true+ if the command gives zero exit status,
- * +false+ for non zero exit status.
- * Returns +nil+ if command execution fails.
- * An error status is available in <code>$?</code>.
- * The arguments are processed in the same way as
- * for <code>Kernel.spawn</code>.
+ * system(cmd [, arg, ...]) => true or false
*
- * The hash arguments, env and options, are same as
- * <code>exec</code> and <code>spawn</code>.
- * See <code>Kernel.spawn</code> for details.
+ * Executes _cmd_ in a subshell, returning +true+ if
+ * the command was found and ran successfully, +false+
+ * otherwise. An error status is available in <code>$?</code>. The
+ * arguments are processed in the same way as for
+ * <code>Kernel::exec</code>.
*
* system("echo *")
* system("echo", "*")
@@ -2940,301 +1466,158 @@ rb_spawn(int argc, VALUE *argv)
*/
static VALUE
-rb_f_system(int argc, VALUE *argv)
+rb_f_system(argc, argv)
+ int argc;
+ VALUE *argv;
{
- rb_pid_t pid;
int status;
+#if defined(__EMX__)
+ VALUE cmd;
-#if defined(SIGCLD) && !defined(SIGCHLD)
-# define SIGCHLD SIGCLD
+ fflush(stdout);
+ fflush(stderr);
+ if (argc == 0) {
+ rb_last_status = Qnil;
+ rb_raise(rb_eArgError, "wrong number of arguments");
+ }
+
+ if (TYPE(argv[0]) == T_ARRAY) {
+ if (RARRAY(argv[0])->len != 2) {
+ rb_raise(rb_eArgError, "wrong first argument");
+ }
+ argv[0] = RARRAY(argv[0])->ptr[0];
+ }
+ cmd = rb_ary_join(rb_ary_new4(argc, argv), rb_str_new2(" "));
+
+ SafeStringValue(cmd);
+ status = do_spawn(RSTRING(cmd)->ptr);
+ last_status_set(status, 0);
+#elif defined(__human68k__) || defined(__DJGPP__) || defined(_WIN32)
+ volatile VALUE prog = 0;
+
+ fflush(stdout);
+ fflush(stderr);
+ if (argc == 0) {
+ rb_last_status = Qnil;
+ rb_raise(rb_eArgError, "wrong number of arguments");
+ }
+
+ if (TYPE(argv[0]) == T_ARRAY) {
+ if (RARRAY(argv[0])->len != 2) {
+ rb_raise(rb_eArgError, "wrong first argument");
+ }
+ prog = RARRAY(argv[0])->ptr[0];
+ argv[0] = RARRAY(argv[0])->ptr[1];
+ }
+
+ if (argc == 1 && prog == 0) {
+#if defined(_WIN32)
+ SafeStringValue(argv[0]);
+ status = do_spawn(P_WAIT, StringValueCStr(argv[0]));
+#else
+ status = proc_spawn(argv[0]);
#endif
+ }
+ else {
+ status = proc_spawn_n(argc, argv, prog);
+ }
+#if !defined(_WIN32)
+ last_status_set(status == -1 ? 127 : status, 0);
+#else
+ if (status == -1)
+ last_status_set(0x7f << 8, 0);
+#endif
+#elif defined(__VMS)
+ VALUE cmd;
+
+ if (argc == 0) {
+ rb_last_status = Qnil;
+ rb_raise(rb_eArgError, "wrong number of arguments");
+ }
-#ifdef SIGCHLD
+ if (TYPE(argv[0]) == T_ARRAY) {
+ if (RARRAY(argv[0])->len != 2) {
+ rb_raise(rb_eArgError, "wrong first argument");
+ }
+ argv[0] = RARRAY(argv[0])->ptr[0];
+ }
+ cmd = rb_ary_join(rb_ary_new4(argc, argv), rb_str_new2(" "));
+
+ SafeStringValue(cmd);
+ status = system(StringValueCStr(cmd));
+ last_status_set((status & 0xff) << 8, 0);
+#else
+ volatile VALUE prog = 0;
+ int pid;
+ struct rb_exec_arg earg;
RETSIGTYPE (*chfunc)(int);
+ fflush(stdout);
+ fflush(stderr);
+ if (argc == 0) {
+ rb_last_status = Qnil;
+ rb_raise(rb_eArgError, "wrong number of arguments");
+ }
+
+ if (TYPE(argv[0]) == T_ARRAY) {
+ if (RARRAY(argv[0])->len != 2) {
+ rb_raise(rb_eArgError, "wrong first argument");
+ }
+ prog = RARRAY(argv[0])->ptr[0];
+ argv[0] = RARRAY(argv[0])->ptr[1];
+ }
+ proc_prepare_args(&earg, argc, argv, prog);
+
chfunc = signal(SIGCHLD, SIG_DFL);
-#endif
- pid = rb_spawn_internal(argc, argv, Qfalse, NULL, 0);
-#if defined(HAVE_FORK) || defined(HAVE_SPAWNV)
- if (pid > 0) {
+ retry:
+ pid = fork();
+ if (pid == 0) {
+ /* child process */
+ rb_thread_atfork();
+ rb_protect(proc_exec_args, (VALUE)&earg, NULL);
+ _exit(127);
+ }
+ if (pid < 0) {
+ if (errno == EAGAIN) {
+ rb_thread_sleep(1);
+ goto retry;
+ }
+ }
+ else {
rb_syswait(pid);
}
-#endif
-#ifdef SIGCHLD
signal(SIGCHLD, chfunc);
+ if (pid < 0) rb_sys_fail(0);
+ status = NUM2INT(rb_last_status);
#endif
- if (pid < 0) {
- return Qnil;
- }
- status = PST2INT(rb_last_status_get());
+
if (status == EXIT_SUCCESS) return Qtrue;
return Qfalse;
}
/*
* call-seq:
- * spawn([env,] command... [,options]) => pid
- * Process.spawn([env,] command... [,options]) => pid
- *
- * spawn executes specified command and return its pid.
- * It doesn't wait for end of the command.
- *
- * spawn has bunch of options to specify process attributes:
- *
- * env: hash
- * name => val : set the environment variable
- * name => nil : unset the environment variable
- * command...:
- * commandline : command line string which is passed to a shell
- * cmdname, arg1, ... : command name and one or more arguments (no shell)
- * [cmdname, argv0], arg1, ... : command name, argv[0] and zero or more arguments (no shell)
- * options: hash
- * clearing environment variables:
- * :unsetenv_others => true : clear environment variables except specified by env
- * :unsetenv_others => false : don't clear (default)
- * process group:
- * :pgroup => true or 0 : make a new process group
- * :pgroup => pgid : join to specified process group
- * :pgroup => nil : don't change the process group (default)
- * resource limit: resourcename is core, cpu, data, etc. See Process.setrlimit.
- * :rlimit_resourcename => limit
- * :rlimit_resourcename => [cur_limit, max_limit]
- * current directory:
- * :chdir => str
- * umask:
- * :umask => int
- * redirection:
- * key:
- * FD : single file descriptor in child process
- * [FD, FD, ...] : multiple file descriptor in child process
- * value:
- * FD : redirect to the file descriptor in parent process
- * string : redirect to file with open(string, "r" or "w")
- * [string] : redirect to file with open(string, File::RDONLY)
- * [string, open_mode] : redirect to file with open(string, open_mode, 0644)
- * [string, open_mode, perm] : redirect to file with open(string, open_mode, perm)
- * [:child, FD] : redirect to the redirected file descriptor
- * :close : close the file descriptor in child process
- * FD is one of follows
- * :in : the file descriptor 0 which is the standard input
- * :out : the file descriptor 1 which is the standard output
- * :err : the file descriptor 2 which is the standard error
- * integer : the file descriptor of specified the integer
- * io : the file descriptor specified as io.fileno
- * file descriptor inheritance: close non-redirected non-standard fds (3, 4, 5, ...) or not
- * :close_others => false : inherit fds (default for system and exec)
- * :close_others => true : don't inherit (default for spawn and IO.popen)
- *
- * If a hash is given as +env+, the environment is
- * updated by +env+ before <code>exec(2)</code> in the child process.
- * If a pair in +env+ has nil as the value, the variable is deleted.
- *
- * # set FOO as BAR and unset BAZ.
- * pid = spawn({"FOO"=>"BAR", "BAZ"=>nil}, command)
- *
- * If a hash is given as +options+,
- * it specifies
- * process group,
- * resource limit,
- * current directory,
- * umask and
- * redirects for the child process.
- * Also, it can be specified to clear environment variables.
- *
- * The <code>:unsetenv_others</code> key in +options+ specifies
- * to clear environment variables, other than specified by +env+.
- *
- * pid = spawn(command, :unsetenv_others=>true) # no environment variable
- * pid = spawn({"FOO"=>"BAR"}, command, :unsetenv_others=>true) # FOO only
- *
- * The <code>:pgroup</code> key in +options+ specifies a process group.
- * The corresponding value should be true, zero or positive integer.
- * true and zero means the process should be a process leader of a new
- * process group.
- * Other values specifies a process group to be belongs.
- *
- * pid = spawn(command, :pgroup=>true) # process leader
- * pid = spawn(command, :pgroup=>10) # belongs to the process group 10
- *
- * The <code>:rlimit_</code><em>foo</em> key specifies a resource limit.
- * <em>foo</em> should be one of resource types such as <code>core</code>.
- * The corresponding value should be an integer or an array which have one or
- * two integers: same as cur_limit and max_limit arguments for
- * Process.setrlimit.
- *
- * cur, max = Process.getrlimit(:CORE)
- * pid = spawn(command, :rlimit_core=>[0,max]) # disable core temporary.
- * pid = spawn(command, :rlimit_core=>max) # enable core dump
- * pid = spawn(command, :rlimit_core=>0) # never dump core.
- *
- * The <code>:chdir</code> key in +options+ specifies the current directory.
- *
- * pid = spawn(command, :chdir=>"/var/tmp")
- *
- * The <code>:umask</code> key in +options+ specifies the umask.
- *
- * pid = spawn(command, :umask=>077)
- *
- * The :in, :out, :err, a fixnum, an IO and an array key specifies a redirection.
- * The redirection maps a file descriptor in the child process.
- *
- * For example, stderr can be merged into stdout as follows:
- *
- * pid = spawn(command, :err=>:out)
- * pid = spawn(command, 2=>1)
- * pid = spawn(command, STDERR=>:out)
- * pid = spawn(command, STDERR=>STDOUT)
- *
- * The hash keys specifies a file descriptor
- * in the child process started by <code>spawn</code>.
- * :err, 2 and STDERR specifies the standard error stream (stderr).
- *
- * The hash values specifies a file descriptor
- * in the parent process which invokes <code>spawn</code>.
- * :out, 1 and STDOUT specifies the standard output stream (stdout).
- *
- * In the above example,
- * the standard output in the child process is not specified.
- * So it is inherited from the parent process.
- *
- * The standard input stream (stdin) can be specified by :in, 0 and STDIN.
- *
- * A filename can be specified as a hash value.
- *
- * pid = spawn(command, :in=>"/dev/null") # read mode
- * pid = spawn(command, :out=>"/dev/null") # write mode
- * pid = spawn(command, :err=>"log") # write mode
- * pid = spawn(command, 3=>"/dev/null") # read mode
- *
- * For stdout and stderr,
- * it is opened in write mode.
- * Otherwise read mode is used.
- *
- * For specifying flags and permission of file creation explicitly,
- * an array is used instead.
- *
- * pid = spawn(command, :in=>["file"]) # read mode is assumed
- * pid = spawn(command, :in=>["file", "r"])
- * pid = spawn(command, :out=>["log", "w"]) # 0644 assumed
- * pid = spawn(command, :out=>["log", "w", 0600])
- * pid = spawn(command, :out=>["log", File::WRONLY|File::EXCL|File::CREAT, 0600])
- *
- * The array specifies a filename, flags and permission.
- * The flags can be a string or an integer.
- * If the flags is omitted or nil, File::RDONLY is assumed.
- * The permission should be an integer.
- * If the permission is omitted or nil, 0644 is assumed.
- *
- * If an array of IOs and integers are specified as a hash key,
- * all the elements are redirected.
- *
- * # stdout and stderr is redirected to log file.
- * # The file "log" is opened just once.
- * pid = spawn(command, [:out, :err]=>["log", "w"])
- *
- * Another way to merge multiple file descriptors is [:child, fd].
- * \[:child, fd] means the file descriptor in the child process.
- * This is different from fd.
- * For example, :err=>:out means redirecting child stderr to parent stdout.
- * But :err=>[:child, :out] means redirecting child stderr to child stdout.
- * They differs if stdout is redirected in the child process as follows.
- *
- * # stdout and stderr is redirected to log file.
- * # The file "log" is opened just once.
- * pid = spawn(command, :out=>["log", "w"], :err=>[:child, :out])
- *
- * \[:child, :out] can be used to merge stderr into stdout in IO.popen.
- * In this case, IO.popen redirects stdout to a pipe in the child process
- * and [:child, :out] refers the redirected stdout.
- *
- * io = IO.popen(["sh", "-c", "echo out; echo err >&2", :err=>[:child, :out]])
- * p io.read #=> "out\nerr\n"
- *
- * spawn closes all non-standard unspecified descriptors by default.
- * The "standard" descriptors are 0, 1 and 2.
- * This behavior is specified by :close_others option.
- * :close_others doesn't affect the standard descriptors which are
- * closed only if :close is specified explicitly.
- *
- * pid = spawn(command, :close_others=>true) # close 3,4,5,... (default)
- * pid = spawn(command, :close_others=>false) # don't close 3,4,5,...
- *
- * :close_others is true by default for spawn and IO.popen.
- *
- * So IO.pipe and spawn can be used as IO.popen.
- *
- * # similar to r = IO.popen(command)
- * r, w = IO.pipe
- * pid = spawn(command, :out=>w) # r, w is closed in the child process.
- * w.close
- *
- * :close is specified as a hash value to close a fd individually.
- *
- * f = open(foo)
- * system(command, f=>:close) # don't inherit f.
- *
- * If a file descriptor need to be inherited,
- * io=>io can be used.
- *
- * # valgrind has --log-fd option for log destination.
- * # log_w=>log_w indicates log_w.fileno inherits to child process.
- * log_r, log_w = IO.pipe
- * pid = spawn("valgrind", "--log-fd=#{log_w.fileno}", "echo", "a", log_w=>log_w)
- * log_w.close
- * p log_r.read
- *
- * It is also possible to exchange file descriptors.
- *
- * pid = spawn(command, :out=>:err, :err=>:out)
- *
- * The hash keys specify file descriptors in the child process.
- * The hash values specifies file descriptors in the parent process.
- * So the above specifies exchanging stdout and stderr.
- * Internally, +spawn+ uses an extra file descriptor to resolve such cyclic
- * file descriptor mapping.
- *
- */
-
-static VALUE
-rb_f_spawn(int argc, VALUE *argv)
-{
- rb_pid_t pid;
- char errmsg[CHILD_ERRMSG_BUFLEN] = { '\0' };
-
- pid = rb_spawn_err(argc, argv, errmsg, sizeof(errmsg));
- if (pid == -1) {
- if (errmsg[0] == '\0')
- rb_sys_fail(RSTRING_PTR(argv[0]));
- rb_sys_fail(errmsg);
- }
-#if defined(HAVE_FORK) || defined(HAVE_SPAWNV)
- return PIDT2NUM(pid);
-#else
- return Qnil;
-#endif
-}
-
-/*
- * call-seq:
* sleep([duration]) => fixnum
*
* Suspends the current thread for _duration_ seconds (which may be any number,
* including a +Float+ with fractional seconds). Returns the actual number of
* seconds slept (rounded), which may be less than that asked for if another
- * thread calls <code>Thread#run</code>. Called without an argument, sleep()
- * will sleep forever.
+ * thread calls <code>Thread#run</code>. Zero arguments causes +sleep+ to sleep
+ * forever.
*
- * Time.new #=> 2008-03-08 19:56:19 +0900
+ * Time.new #=> Wed Apr 09 08:56:32 CDT 2003
* sleep 1.2 #=> 1
- * Time.new #=> 2008-03-08 19:56:20 +0900
+ * Time.new #=> Wed Apr 09 08:56:33 CDT 2003
* sleep 1.9 #=> 2
- * Time.new #=> 2008-03-08 19:56:22 +0900
+ * Time.new #=> Wed Apr 09 08:56:35 CDT 2003
*/
static VALUE
-rb_f_sleep(int argc, VALUE *argv)
+rb_f_sleep(argc, argv)
+ int argc;
+ VALUE *argv;
{
- time_t beg, end;
+ int beg, end;
beg = time(0);
if (argc == 0) {
@@ -3253,7 +1636,10 @@ rb_f_sleep(int argc, VALUE *argv)
}
-#if (defined(HAVE_GETPGRP) && defined(GETPGRP_VOID)) || defined(HAVE_GETPGID)
+#if defined(SIGCLD) && !defined(SIGCHLD)
+# define SIGCHLD SIGCLD
+#endif
+
/*
* call-seq:
* Process.getpgrp => integer
@@ -3266,27 +1652,29 @@ rb_f_sleep(int argc, VALUE *argv)
*/
static VALUE
-proc_getpgrp(void)
+proc_getpgrp()
{
- rb_pid_t pgrp;
+#if defined(HAVE_GETPGRP) && defined(GETPGRP_VOID)
+ int pgrp;
+#endif
rb_secure(2);
#if defined(HAVE_GETPGRP) && defined(GETPGRP_VOID)
pgrp = getpgrp();
if (pgrp < 0) rb_sys_fail(0);
- return PIDT2NUM(pgrp);
-#else /* defined(HAVE_GETPGID) */
+ return INT2FIX(pgrp);
+#else
+# ifdef HAVE_GETPGID
pgrp = getpgid(0);
if (pgrp < 0) rb_sys_fail(0);
- return PIDT2NUM(pgrp);
+ return INT2FIX(pgrp);
+# else
+ rb_notimplement();
+# endif
#endif
}
-#else
-#define proc_getpgrp rb_f_notimplement
-#endif
-#if defined(HAVE_SETPGID) || (defined(HAVE_SETPGRP) && defined(SETPGRP_VOID))
/*
* call-seq:
* Process.setpgrp => 0
@@ -3296,26 +1684,24 @@ proc_getpgrp(void)
*/
static VALUE
-proc_setpgrp(void)
+proc_setpgrp()
{
rb_secure(2);
/* check for posix setpgid() first; this matches the posix */
/* getpgrp() above. It appears that configure will set SETPGRP_VOID */
- /* even though setpgrp(0,0) would be preferred. The posix call avoids */
+ /* even though setpgrp(0,0) would be prefered. The posix call avoids */
/* this confusion. */
#ifdef HAVE_SETPGID
if (setpgid(0,0) < 0) rb_sys_fail(0);
#elif defined(HAVE_SETPGRP) && defined(SETPGRP_VOID)
if (setpgrp() < 0) rb_sys_fail(0);
+#else
+ rb_notimplement();
#endif
return INT2FIX(0);
}
-#else
-#define proc_setpgrp rb_f_notimplement
-#endif
-#if defined(HAVE_GETPGID)
/*
* call-seq:
* Process.getpgid(pid) => integer
@@ -3327,21 +1713,22 @@ proc_setpgrp(void)
*/
static VALUE
-proc_getpgid(VALUE obj, VALUE pid)
+proc_getpgid(obj, pid)
+ VALUE obj, pid;
{
- rb_pid_t i;
+#if defined(HAVE_GETPGID) && !defined(__CHECKER__)
+ int i;
rb_secure(2);
- i = getpgid(NUM2PIDT(pid));
+ i = getpgid(NUM2INT(pid));
if (i < 0) rb_sys_fail(0);
- return PIDT2NUM(i);
-}
+ return INT2NUM(i);
#else
-#define proc_getpgid rb_f_notimplement
+ rb_notimplement();
#endif
+}
-#ifdef HAVE_SETPGID
/*
* call-seq:
* Process.setpgid(pid, integer) => 0
@@ -3351,23 +1738,24 @@ proc_getpgid(VALUE obj, VALUE pid)
*/
static VALUE
-proc_setpgid(VALUE obj, VALUE pid, VALUE pgrp)
+proc_setpgid(obj, pid, pgrp)
+ VALUE obj, pid, pgrp;
{
- rb_pid_t ipid, ipgrp;
+#ifdef HAVE_SETPGID
+ int ipid, ipgrp;
rb_secure(2);
- ipid = NUM2PIDT(pid);
- ipgrp = NUM2PIDT(pgrp);
+ ipid = NUM2INT(pid);
+ ipgrp = NUM2INT(pgrp);
if (setpgid(ipid, ipgrp) < 0) rb_sys_fail(0);
return INT2FIX(0);
-}
#else
-#define proc_setpgid rb_f_notimplement
+ rb_notimplement();
#endif
+}
-#if defined(HAVE_SETSID) || (defined(HAVE_SETPGRP) && defined(TIOCNOTTY))
/*
* call-seq:
* Process.setsid => fixnum
@@ -3380,44 +1768,42 @@ proc_setpgid(VALUE obj, VALUE pid, VALUE pgrp)
*/
static VALUE
-proc_setsid(void)
+proc_setsid()
{
#if defined(HAVE_SETSID)
- rb_pid_t pid;
+ int pid;
rb_secure(2);
pid = setsid();
if (pid < 0) rb_sys_fail(0);
- return PIDT2NUM(pid);
+ return INT2FIX(pid);
#elif defined(HAVE_SETPGRP) && defined(TIOCNOTTY)
- rb_pid_t pid;
- int ret;
+ rb_pid_t pid;
+ int ret;
- rb_secure(2);
- pid = getpid();
+ rb_secure(2);
+ pid = getpid();
#if defined(SETPGRP_VOID)
- ret = setpgrp();
- /* If `pid_t setpgrp(void)' is equivalent to setsid(),
- `ret' will be the same value as `pid', and following open() will fail.
- In Linux, `int setpgrp(void)' is equivalent to setpgid(0, 0). */
+ ret = setpgrp();
+ /* If `pid_t setpgrp(void)' is equivalent to setsid(),
+ `ret' will be the same value as `pid', and following open() will fail.
+ In Linux, `int setpgrp(void)' is equivalent to setpgid(0, 0). */
#else
- ret = setpgrp(0, pid);
+ ret = setpgrp(0, pid);
#endif
- if (ret == -1) rb_sys_fail(0);
+ if (ret == -1) rb_sys_fail(0);
- if ((fd = open("/dev/tty", O_RDWR)) >= 0) {
- ioctl(fd, TIOCNOTTY, NULL);
- close(fd);
- }
- return PIDT2NUM(pid);
-#endif
-}
+ if ((fd = open("/dev/tty", O_RDWR)) >= 0) {
+ ioctl(fd, TIOCNOTTY, NULL);
+ close(fd);
+ }
+ return INT2FIX(pid);
#else
-#define proc_setsid rb_f_notimplement
+ rb_notimplement();
#endif
+}
-#ifdef HAVE_GETPRIORITY
/*
* call-seq:
* Process.getpriority(kind, integer) => fixnum
@@ -3436,8 +1822,10 @@ proc_setsid(void)
*/
static VALUE
-proc_getpriority(VALUE obj, VALUE which, VALUE who)
+proc_getpriority(obj, which, who)
+ VALUE obj, which, who;
{
+#ifdef HAVE_GETPRIORITY
int prio, iwhich, iwho;
rb_secure(2);
@@ -3448,13 +1836,12 @@ proc_getpriority(VALUE obj, VALUE which, VALUE who)
prio = getpriority(iwhich, iwho);
if (errno) rb_sys_fail(0);
return INT2FIX(prio);
-}
#else
-#define proc_getpriority rb_f_notimplement
+ rb_notimplement();
#endif
+}
-#ifdef HAVE_GETPRIORITY
/*
* call-seq:
* Process.setpriority(kind, integer, priority) => 0
@@ -3468,8 +1855,10 @@ proc_getpriority(VALUE obj, VALUE which, VALUE who)
*/
static VALUE
-proc_setpriority(VALUE obj, VALUE which, VALUE who, VALUE prio)
+proc_setpriority(obj, which, who, prio)
+ VALUE obj, which, who, prio;
{
+#ifdef HAVE_GETPRIORITY
int iwhich, iwho, iprio;
rb_secure(2);
@@ -3480,176 +1869,22 @@ proc_setpriority(VALUE obj, VALUE which, VALUE who, VALUE prio)
if (setpriority(iwhich, iwho, iprio) < 0)
rb_sys_fail(0);
return INT2FIX(0);
-}
#else
-#define proc_setpriority rb_f_notimplement
-#endif
-
-#if defined(RLIM2NUM)
-static int
-rlimit_resource_name2int(const char *name, int casetype)
-{
- size_t len = strlen(name);
- if (16 < len) return -1;
- if (casetype == 1) {
- size_t i;
- char *name2 = ALLOCA_N(char, len+1);
- for (i = 0; i < len; i++) {
- if (!ISLOWER(name[i]))
- return -1;
- name2[i] = TOUPPER(name[i]);
- }
- name2[len] = '\0';
- name = name2;
- }
-
- switch (*name) {
- case 'A':
-#ifdef RLIMIT_AS
- if (strcmp(name, "AS") == 0) return RLIMIT_AS;
-#endif
- break;
-
- case 'C':
-#ifdef RLIMIT_CORE
- if (strcmp(name, "CORE") == 0) return RLIMIT_CORE;
-#endif
-#ifdef RLIMIT_CPU
- if (strcmp(name, "CPU") == 0) return RLIMIT_CPU;
-#endif
- break;
-
- case 'D':
-#ifdef RLIMIT_DATA
- if (strcmp(name, "DATA") == 0) return RLIMIT_DATA;
-#endif
- break;
-
- case 'F':
-#ifdef RLIMIT_FSIZE
- if (strcmp(name, "FSIZE") == 0) return RLIMIT_FSIZE;
-#endif
- break;
-
- case 'M':
-#ifdef RLIMIT_MEMLOCK
- if (strcmp(name, "MEMLOCK") == 0) return RLIMIT_MEMLOCK;
-#endif
- break;
-
- case 'N':
-#ifdef RLIMIT_NOFILE
- if (strcmp(name, "NOFILE") == 0) return RLIMIT_NOFILE;
-#endif
-#ifdef RLIMIT_NPROC
- if (strcmp(name, "NPROC") == 0) return RLIMIT_NPROC;
-#endif
- break;
-
- case 'R':
-#ifdef RLIMIT_RSS
- if (strcmp(name, "RSS") == 0) return RLIMIT_RSS;
-#endif
- break;
-
- case 'S':
-#ifdef RLIMIT_STACK
- if (strcmp(name, "STACK") == 0) return RLIMIT_STACK;
-#endif
-#ifdef RLIMIT_SBSIZE
- if (strcmp(name, "SBSIZE") == 0) return RLIMIT_SBSIZE;
+ rb_notimplement();
#endif
- break;
- }
- return -1;
}
-static int
-rlimit_type_by_hname(const char *name)
-{
- return rlimit_resource_name2int(name, 0);
-}
-
-static int
-rlimit_type_by_lname(const char *name)
-{
- return rlimit_resource_name2int(name, 1);
-}
-
-static int
-rlimit_resource_type(VALUE rtype)
-{
- const char *name;
- VALUE v;
- int r;
-
- switch (TYPE(rtype)) {
- case T_SYMBOL:
- name = rb_id2name(SYM2ID(rtype));
- break;
-
- default:
- v = rb_check_string_type(rtype);
- if (!NIL_P(v)) {
- rtype = v;
- case T_STRING:
- name = StringValueCStr(rtype);
- break;
- }
- /* fall through */
-
- case T_FIXNUM:
- case T_BIGNUM:
- return NUM2INT(rtype);
- }
-
- r = rlimit_type_by_hname(name);
- if (r != -1)
- return r;
-
- rb_raise(rb_eArgError, "invalid resource name: %s", name);
-}
-
-static rlim_t
-rlimit_resource_value(VALUE rval)
-{
- const char *name;
- VALUE v;
-
- switch (TYPE(rval)) {
- case T_SYMBOL:
- name = rb_id2name(SYM2ID(rval));
- break;
-
- default:
- v = rb_check_string_type(rval);
- if (!NIL_P(v)) {
- rval = v;
- case T_STRING:
- name = StringValueCStr(rval);
- break;
- }
- /* fall through */
-
- case T_FIXNUM:
- case T_BIGNUM:
- return NUM2RLIM(rval);
- }
-
-#ifdef RLIM_INFINITY
- if (strcmp(name, "INFINITY") == 0) return RLIM_INFINITY;
-#endif
-#ifdef RLIM_SAVED_MAX
- if (strcmp(name, "SAVED_MAX") == 0) return RLIM_SAVED_MAX;
-#endif
-#ifdef RLIM_SAVED_CUR
- if (strcmp(name, "SAVED_CUR") == 0) return RLIM_SAVED_CUR;
-#endif
- rb_raise(rb_eArgError, "invalid resource value: %s", name);
-}
+#if SIZEOF_RLIM_T == SIZEOF_INT
+# define RLIM2NUM(v) UINT2NUM(v)
+# define NUM2RLIM(v) NUM2UINT(v)
+#elif SIZEOF_RLIM_T == SIZEOF_LONG
+# define RLIM2NUM(v) ULONG2NUM(v)
+# define NUM2RLIM(v) NUM2ULONG(v)
+#elif SIZEOF_RLIM_T == SIZEOF_LONG_LONG
+# define RLIM2NUM(v) ULL2NUM(v)
+# define NUM2RLIM(v) NUM2ULL(v)
#endif
-#if defined(HAVE_GETRLIMIT) && defined(RLIM2NUM)
/*
* call-seq:
* Process.getrlimit(resource) => [cur_limit, max_limit]
@@ -3658,10 +1893,9 @@ rlimit_resource_value(VALUE rval)
* _cur_limit_ means current (soft) limit and
* _max_limit_ means maximum (hard) limit.
*
- * _resource_ indicates the kind of resource to limit.
- * It is specified as a symbol such as <code>:CORE</code>,
- * a string such as <code>"CORE"</code> or
- * a constant such as <code>Process::RLIMIT_CORE</code>.
+ * _resource_ indicates the kind of resource to limit:
+ * such as <code>Process::RLIMIT_CORE</code>,
+ * <code>Process::RLIMIT_CPU</code>, etc.
* See Process.setrlimit for details.
*
* _cur_limit_ and _max_limit_ may be <code>Process::RLIM_INFINITY</code>,
@@ -3673,20 +1907,20 @@ rlimit_resource_value(VALUE rval)
static VALUE
proc_getrlimit(VALUE obj, VALUE resource)
{
+#if defined(HAVE_GETRLIMIT) && defined(RLIM2NUM)
struct rlimit rlim;
rb_secure(2);
- if (getrlimit(rlimit_resource_type(resource), &rlim) < 0) {
- rb_sys_fail("getrlimit");
+ if (getrlimit(NUM2INT(resource), &rlim) < 0) {
+ rb_sys_fail("getrlimit");
}
return rb_assoc_new(RLIM2NUM(rlim.rlim_cur), RLIM2NUM(rlim.rlim_max));
-}
#else
-#define proc_getrlimit rb_f_notimplement
+ rb_notimplement();
#endif
+}
-#if defined(HAVE_SETRLIMIT) && defined(NUM2RLIM)
/*
* call-seq:
* Process.setrlimit(resource, cur_limit, max_limit) => nil
@@ -3699,43 +1933,35 @@ proc_getrlimit(VALUE obj, VALUE resource)
* If _max_limit_ is not given, _cur_limit_ is used.
*
* _resource_ indicates the kind of resource to limit.
- * It should be a symbol such as <code>:CORE</code>,
- * a string such as <code>"CORE"</code> or
- * a constant such as <code>Process::RLIMIT_CORE</code>.
- * The available resources are OS dependent.
+ * The list of resources are OS dependent.
* Ruby may support following resources.
*
- * [CORE] core size (bytes) (SUSv3)
- * [CPU] CPU time (seconds) (SUSv3)
- * [DATA] data segment (bytes) (SUSv3)
- * [FSIZE] file size (bytes) (SUSv3)
- * [NOFILE] file descriptors (number) (SUSv3)
- * [STACK] stack size (bytes) (SUSv3)
- * [AS] total available memory (bytes) (SUSv3, NetBSD, FreeBSD, OpenBSD but 4.4BSD-Lite)
- * [MEMLOCK] total size for mlock(2) (bytes) (4.4BSD, GNU/Linux)
- * [NPROC] number of processes for the user (number) (4.4BSD, GNU/Linux)
- * [RSS] resident memory size (bytes) (4.2BSD, GNU/Linux)
- * [SBSIZE] all socket buffers (bytes) (NetBSD, FreeBSD)
- *
- * _cur_limit_ and _max_limit_ may be
- * <code>:INFINITY</code>, <code>"INFINITY"</code> or
- * <code>Process::RLIM_INFINITY</code>,
- * which means that the resource is not limited.
- * They may be <code>Process::RLIM_SAVED_MAX</code>,
- * <code>Process::RLIM_SAVED_CUR</code> and
- * corresponding symbols and strings too.
- * See system setrlimit(2) manual for details.
+ * [Process::RLIMIT_CORE] core size (bytes) (SUSv3)
+ * [Process::RLIMIT_CPU] CPU time (seconds) (SUSv3)
+ * [Process::RLIMIT_DATA] data segment (bytes) (SUSv3)
+ * [Process::RLIMIT_FSIZE] file size (bytes) (SUSv3)
+ * [Process::RLIMIT_NOFILE] file descriptors (number) (SUSv3)
+ * [Process::RLIMIT_STACK] stack size (bytes) (SUSv3)
+ * [Process::RLIMIT_AS] total available memory (bytes) (SUSv3, NetBSD, FreeBSD, OpenBSD but 4.4BSD-Lite)
+ * [Process::RLIMIT_MEMLOCK] total size for mlock(2) (bytes) (4.4BSD, GNU/Linux)
+ * [Process::RLIMIT_NPROC] number of processes for the user (number) (4.4BSD, GNU/Linux)
+ * [Process::RLIMIT_RSS] resident memory size (bytes) (4.2BSD, GNU/Linux)
+ * [Process::RLIMIT_SBSIZE] all socket buffers (bytes) (NetBSD, FreeBSD)
*
- * The following example raise the soft limit of core size to
- * the hard limit to try to make core dump possible.
+ * Other <code>Process::RLIMIT_???</code> constants may be defined.
*
- * Process.setrlimit(:CORE, Process.getrlimit(:CORE)[1])
+ * _cur_limit_ and _max_limit_ may be <code>Process::RLIM_INFINITY</code>,
+ * which means that the resource is not limited.
+ * They may be <code>Process::RLIM_SAVED_MAX</code> or
+ * <code>Process::RLIM_SAVED_CUR</code> too.
+ * See system setrlimit(2) manual for details.
*
*/
static VALUE
proc_setrlimit(int argc, VALUE *argv, VALUE obj)
{
+#if defined(HAVE_SETRLIMIT) && defined(NUM2RLIM)
VALUE resource, rlim_cur, rlim_max;
struct rlimit rlim;
@@ -3745,21 +1971,21 @@ proc_setrlimit(int argc, VALUE *argv, VALUE obj)
if (rlim_max == Qnil)
rlim_max = rlim_cur;
- rlim.rlim_cur = rlimit_resource_value(rlim_cur);
- rlim.rlim_max = rlimit_resource_value(rlim_max);
+ rlim.rlim_cur = NUM2RLIM(rlim_cur);
+ rlim.rlim_max = NUM2RLIM(rlim_max);
- if (setrlimit(rlimit_resource_type(resource), &rlim) < 0) {
- rb_sys_fail("setrlimit");
+ if (setrlimit(NUM2INT(resource), &rlim) < 0) {
+ rb_sys_fail("setrlimit");
}
return Qnil;
-}
#else
-#define proc_setrlimit rb_f_notimplement
+ rb_notimplement();
#endif
+}
static int under_uid_switch = 0;
static void
-check_uid_switch(void)
+check_uid_switch()
{
rb_secure(2);
if (under_uid_switch) {
@@ -3769,7 +1995,7 @@ check_uid_switch(void)
static int under_gid_switch = 0;
static void
-check_gid_switch(void)
+check_gid_switch()
{
rb_secure(2);
if (under_gid_switch) {
@@ -3789,7 +2015,6 @@ check_gid_switch(void)
*/
-#if defined HAVE_SETUID
/*
* call-seq:
* Process::Sys.setuid(integer) => nil
@@ -3800,18 +2025,20 @@ check_gid_switch(void)
*/
static VALUE
-p_sys_setuid(VALUE obj, VALUE id)
+p_sys_setuid(obj, id)
+ VALUE obj, id;
{
+#if defined HAVE_SETUID
check_uid_switch();
- if (setuid(NUM2UIDT(id)) != 0) rb_sys_fail(0);
- return Qnil;
-}
+ if (setuid(NUM2INT(id)) != 0) rb_sys_fail(0);
#else
-#define p_sys_setuid rb_f_notimplement
+ rb_notimplement();
#endif
+ return Qnil;
+}
+
-#if defined HAVE_SETRUID
/*
* call-seq:
* Process::Sys.setruid(integer) => nil
@@ -3822,18 +2049,19 @@ p_sys_setuid(VALUE obj, VALUE id)
*/
static VALUE
-p_sys_setruid(VALUE obj, VALUE id)
+p_sys_setruid(obj, id)
+ VALUE obj, id;
{
+#if defined HAVE_SETRUID
check_uid_switch();
- if (setruid(NUM2UIDT(id)) != 0) rb_sys_fail(0);
- return Qnil;
-}
+ if (setruid(NUM2INT(id)) != 0) rb_sys_fail(0);
#else
-#define p_sys_setruid rb_f_notimplement
+ rb_notimplement();
#endif
+ return Qnil;
+}
-#if defined HAVE_SETEUID
/*
* call-seq:
* Process::Sys.seteuid(integer) => nil
@@ -3844,18 +2072,19 @@ p_sys_setruid(VALUE obj, VALUE id)
*/
static VALUE
-p_sys_seteuid(VALUE obj, VALUE id)
+p_sys_seteuid(obj, id)
+ VALUE obj, id;
{
+#if defined HAVE_SETEUID
check_uid_switch();
- if (seteuid(NUM2UIDT(id)) != 0) rb_sys_fail(0);
- return Qnil;
-}
+ if (seteuid(NUM2INT(id)) != 0) rb_sys_fail(0);
#else
-#define p_sys_seteuid rb_f_notimplement
+ rb_notimplement();
#endif
+ return Qnil;
+}
-#if defined HAVE_SETREUID
/*
* call-seq:
* Process::Sys.setreuid(rid, eid) => nil
@@ -3868,18 +2097,19 @@ p_sys_seteuid(VALUE obj, VALUE id)
*/
static VALUE
-p_sys_setreuid(VALUE obj, VALUE rid, VALUE eid)
+p_sys_setreuid(obj, rid, eid)
+ VALUE obj, rid, eid;
{
+#if defined HAVE_SETREUID
check_uid_switch();
- if (setreuid(NUM2UIDT(rid),NUM2UIDT(eid)) != 0) rb_sys_fail(0);
- return Qnil;
-}
+ if (setreuid(NUM2INT(rid),NUM2INT(eid)) != 0) rb_sys_fail(0);
#else
-#define p_sys_setreuid rb_f_notimplement
+ rb_notimplement();
#endif
+ return Qnil;
+}
-#if defined HAVE_SETRESUID
/*
* call-seq:
* Process::Sys.setresuid(rid, eid, sid) => nil
@@ -3892,15 +2122,17 @@ p_sys_setreuid(VALUE obj, VALUE rid, VALUE eid)
*/
static VALUE
-p_sys_setresuid(VALUE obj, VALUE rid, VALUE eid, VALUE sid)
+p_sys_setresuid(obj, rid, eid, sid)
+ VALUE obj, rid, eid, sid;
{
+#if defined HAVE_SETRESUID
check_uid_switch();
- if (setresuid(NUM2UIDT(rid),NUM2UIDT(eid),NUM2UIDT(sid)) != 0) rb_sys_fail(0);
- return Qnil;
-}
+ if (setresuid(NUM2INT(rid),NUM2INT(eid),NUM2INT(sid)) != 0) rb_sys_fail(0);
#else
-#define p_sys_setresuid rb_f_notimplement
+ rb_notimplement();
#endif
+ return Qnil;
+}
/*
@@ -3915,14 +2147,14 @@ p_sys_setresuid(VALUE obj, VALUE rid, VALUE eid, VALUE sid)
*/
static VALUE
-proc_getuid(VALUE obj)
+proc_getuid(obj)
+ VALUE obj;
{
- rb_uid_t uid = getuid();
- return UIDT2NUM(uid);
+ int uid = getuid();
+ return INT2FIX(uid);
}
-#if defined(HAVE_SETRESUID) || defined(HAVE_SETREUID) || defined(HAVE_SETRUID) || defined(HAVE_SETUID)
/*
* call-seq:
* Process.uid= integer => numeric
@@ -3932,14 +2164,13 @@ proc_getuid(VALUE obj)
*/
static VALUE
-proc_setuid(VALUE obj, VALUE id)
+proc_setuid(obj, id)
+ VALUE obj, id;
{
- rb_uid_t uid;
+ int uid = NUM2INT(id);
check_uid_switch();
-
- uid = NUM2UIDT(id);
-#if defined(HAVE_SETRESUID)
+#if defined(HAVE_SETRESUID) && !defined(__CHECKER__)
if (setresuid(uid, -1, -1) < 0) rb_sys_fail(0);
#elif defined HAVE_SETREUID
if (setreuid(uid, -1) < 0) rb_sys_fail(0);
@@ -3954,12 +2185,11 @@ proc_setuid(VALUE obj, VALUE id)
rb_notimplement();
}
}
-#endif
- return id;
-}
#else
-#define proc_setuid rb_f_notimplement
+ rb_notimplement();
#endif
+ return INT2FIX(uid);
+}
/********************************************************************
@@ -3972,11 +2202,12 @@ proc_setuid(VALUE obj, VALUE id)
*
*/
-static rb_uid_t SAVED_USER_ID = -1;
+static int SAVED_USER_ID = -1;
#ifdef BROKEN_SETREUID
int
-setreuid(rb_uid_t ruid, rb_uid_t euid)
+setreuid(ruid, euid)
+ rb_uid_t ruid, euid;
{
if (ruid != -1 && ruid != getuid()) {
if (euid == -1) euid = geteuid();
@@ -4003,13 +2234,14 @@ setreuid(rb_uid_t ruid, rb_uid_t euid)
*/
static VALUE
-p_uid_change_privilege(VALUE obj, VALUE id)
+p_uid_change_privilege(obj, id)
+ VALUE obj, id;
{
- rb_uid_t uid;
+ int uid;
check_uid_switch();
- uid = NUM2UIDT(id);
+ uid = NUM2INT(id);
if (geteuid() == 0) { /* root-user */
#if defined(HAVE_SETRESUID)
@@ -4137,12 +2369,11 @@ p_uid_change_privilege(VALUE obj, VALUE id)
rb_notimplement();
#endif
}
- return id;
+ return INT2FIX(uid);
}
-#if defined HAVE_SETGID
/*
* call-seq:
* Process::Sys.setgid(integer) => nil
@@ -4153,18 +2384,19 @@ p_uid_change_privilege(VALUE obj, VALUE id)
*/
static VALUE
-p_sys_setgid(VALUE obj, VALUE id)
+p_sys_setgid(obj, id)
+ VALUE obj, id;
{
+#if defined HAVE_SETGID
check_gid_switch();
- if (setgid(NUM2GIDT(id)) != 0) rb_sys_fail(0);
- return Qnil;
-}
+ if (setgid(NUM2INT(id)) != 0) rb_sys_fail(0);
#else
-#define p_sys_setgid rb_f_notimplement
+ rb_notimplement();
#endif
+ return Qnil;
+}
-#if defined HAVE_SETRGID
/*
* call-seq:
* Process::Sys.setrgid(integer) => nil
@@ -4175,18 +2407,20 @@ p_sys_setgid(VALUE obj, VALUE id)
*/
static VALUE
-p_sys_setrgid(VALUE obj, VALUE id)
+p_sys_setrgid(obj, id)
+ VALUE obj, id;
{
+#if defined HAVE_SETRGID
check_gid_switch();
- if (setrgid(NUM2GIDT(id)) != 0) rb_sys_fail(0);
- return Qnil;
-}
+ if (setrgid(NUM2INT(id)) != 0) rb_sys_fail(0);
#else
-#define p_sys_setrgid rb_f_notimplement
+ rb_notimplement();
#endif
+ return Qnil;
+}
+
-#if defined HAVE_SETEGID
/*
* call-seq:
* Process::Sys.setegid(integer) => nil
@@ -4197,18 +2431,19 @@ p_sys_setrgid(VALUE obj, VALUE id)
*/
static VALUE
-p_sys_setegid(VALUE obj, VALUE id)
+p_sys_setegid(obj, id)
+ VALUE obj, id;
{
+#if defined HAVE_SETEGID
check_gid_switch();
- if (setegid(NUM2GIDT(id)) != 0) rb_sys_fail(0);
- return Qnil;
-}
+ if (setegid(NUM2INT(id)) != 0) rb_sys_fail(0);
#else
-#define p_sys_setegid rb_f_notimplement
+ rb_notimplement();
#endif
+ return Qnil;
+}
-#if defined HAVE_SETREGID
/*
* call-seq:
* Process::Sys.setregid(rid, eid) => nil
@@ -4221,17 +2456,18 @@ p_sys_setegid(VALUE obj, VALUE id)
*/
static VALUE
-p_sys_setregid(VALUE obj, VALUE rid, VALUE eid)
+p_sys_setregid(obj, rid, eid)
+ VALUE obj, rid, eid;
{
+#if defined HAVE_SETREGID
check_gid_switch();
- if (setregid(NUM2GIDT(rid),NUM2GIDT(eid)) != 0) rb_sys_fail(0);
- return Qnil;
-}
+ if (setregid(NUM2INT(rid),NUM2INT(eid)) != 0) rb_sys_fail(0);
#else
-#define p_sys_setregid rb_f_notimplement
+ rb_notimplement();
#endif
+ return Qnil;
+}
-#if defined HAVE_SETRESGID
/*
* call-seq:
* Process::Sys.setresgid(rid, eid, sid) => nil
@@ -4244,18 +2480,19 @@ p_sys_setregid(VALUE obj, VALUE rid, VALUE eid)
*/
static VALUE
-p_sys_setresgid(VALUE obj, VALUE rid, VALUE eid, VALUE sid)
+p_sys_setresgid(obj, rid, eid, sid)
+ VALUE obj, rid, eid, sid;
{
+#if defined HAVE_SETRESGID
check_gid_switch();
- if (setresgid(NUM2GIDT(rid),NUM2GIDT(eid),NUM2GIDT(sid)) != 0) rb_sys_fail(0);
- return Qnil;
-}
+ if (setresgid(NUM2INT(rid),NUM2INT(eid),NUM2INT(sid)) != 0) rb_sys_fail(0);
#else
-#define p_sys_setresgid rb_f_notimplement
+ rb_notimplement();
#endif
+ return Qnil;
+}
-#if defined HAVE_ISSETUGID
/*
* call-seq:
* Process::Sys.issetugid => true or false
@@ -4269,18 +2506,21 @@ p_sys_setresgid(VALUE obj, VALUE rid, VALUE eid, VALUE sid)
*/
static VALUE
-p_sys_issetugid(VALUE obj)
+p_sys_issetugid(obj)
+ VALUE obj;
{
+#if defined HAVE_ISSETUGID
rb_secure(2);
if (issetugid()) {
return Qtrue;
} else {
return Qfalse;
}
-}
#else
-#define p_sys_issetugid rb_f_notimplement
+ rb_notimplement();
+ return Qnil; /* not reached */
#endif
+}
/*
@@ -4295,14 +2535,14 @@ p_sys_issetugid(VALUE obj)
*/
static VALUE
-proc_getgid(VALUE obj)
+proc_getgid(obj)
+ VALUE obj;
{
- rb_gid_t gid = getgid();
- return GIDT2NUM(gid);
+ int gid = getgid();
+ return INT2FIX(gid);
}
-#if defined(HAVE_SETRESGID) || defined(HAVE_SETREGID) || defined(HAVE_SETRGID) || defined(HAVE_SETGID)
/*
* call-seq:
* Process.gid= fixnum => fixnum
@@ -4311,14 +2551,13 @@ proc_getgid(VALUE obj)
*/
static VALUE
-proc_setgid(VALUE obj, VALUE id)
+proc_setgid(obj, id)
+ VALUE obj, id;
{
- rb_gid_t gid;
+ int gid = NUM2INT(id);
check_gid_switch();
-
- gid = NUM2GIDT(id);
-#if defined(HAVE_SETRESGID)
+#if defined(HAVE_SETRESGID) && !defined(__CHECKER__)
if (setresgid(gid, -1, -1) < 0) rb_sys_fail(0);
#elif defined HAVE_SETREGID
if (setregid(gid, -1) < 0) rb_sys_fail(0);
@@ -4333,18 +2572,16 @@ proc_setgid(VALUE obj, VALUE id)
rb_notimplement();
}
}
-#endif
- return GIDT2NUM(gid);
-}
#else
-#define proc_setgid rb_f_notimplement
+ rb_notimplement();
#endif
+ return INT2FIX(gid);
+}
static size_t maxgroups = 32;
-#ifdef HAVE_GETGROUPS
/*
* call-seq:
* Process.groups => array
@@ -4359,28 +2596,30 @@ static size_t maxgroups = 32;
static VALUE
proc_getgroups(VALUE obj)
{
+#ifdef HAVE_GETGROUPS
VALUE ary;
- size_t i, ngroups;
+ size_t ngroups;
rb_gid_t *groups;
+ int i;
groups = ALLOCA_N(rb_gid_t, maxgroups);
ngroups = getgroups(maxgroups, groups);
- if (ngroups == (size_t)-1)
+ if (ngroups == -1)
rb_sys_fail(0);
ary = rb_ary_new();
for (i = 0; i < ngroups; i++)
- rb_ary_push(ary, GIDT2NUM(groups[i]));
+ rb_ary_push(ary, INT2NUM(groups[i]));
return ary;
-}
#else
-#define proc_getgroups rb_f_notimplement
+ rb_notimplement();
+ return Qnil;
#endif
+}
-#ifdef HAVE_SETGROUPS
/*
* call-seq:
* Process.groups= array => array
@@ -4397,51 +2636,54 @@ proc_getgroups(VALUE obj)
static VALUE
proc_setgroups(VALUE obj, VALUE ary)
{
- size_t ngroups, i;
+#ifdef HAVE_SETGROUPS
+ size_t ngroups;
rb_gid_t *groups;
+ int i;
struct group *gr;
Check_Type(ary, T_ARRAY);
- ngroups = RARRAY_LEN(ary);
+ ngroups = RARRAY(ary)->len;
if (ngroups > maxgroups)
- rb_raise(rb_eArgError, "too many groups, %lu max", (unsigned long)maxgroups);
+ rb_raise(rb_eArgError, "too many groups, %d max", maxgroups);
groups = ALLOCA_N(rb_gid_t, ngroups);
- for (i = 0; i < ngroups && i < (size_t)RARRAY_LEN(ary); i++) {
- VALUE g = RARRAY_PTR(ary)[i];
+ for (i = 0; i < ngroups && i < RARRAY(ary)->len; i++) {
+ VALUE g = RARRAY(ary)->ptr[i];
if (FIXNUM_P(g)) {
- groups[i] = NUM2GIDT(g);
+ groups[i] = FIX2INT(g);
}
else {
VALUE tmp = rb_check_string_type(g);
if (NIL_P(tmp)) {
- groups[i] = NUM2GIDT(g);
+ groups[i] = NUM2INT(g);
}
else {
- gr = getgrnam(RSTRING_PTR(tmp));
+ gr = getgrnam(RSTRING(tmp)->ptr);
if (gr == NULL)
rb_raise(rb_eArgError,
- "can't find group for %s", RSTRING_PTR(tmp));
+ "can't find group for %s", RSTRING(tmp)->ptr);
groups[i] = gr->gr_gid;
}
}
}
- if (setgroups(ngroups, groups) == -1)
+ i = setgroups(ngroups, groups);
+ if (i == -1)
rb_sys_fail(0);
return proc_getgroups(obj);
-}
#else
-#define proc_setgroups rb_f_notimplement
+ rb_notimplement();
+ return Qnil;
#endif
+}
-#ifdef HAVE_INITGROUPS
/*
* call-seq:
* Process.initgroups(username, gid) => array
@@ -4460,16 +2702,19 @@ proc_setgroups(VALUE obj, VALUE ary)
*/
static VALUE
-proc_initgroups(VALUE obj, VALUE uname, VALUE base_grp)
+proc_initgroups(obj, uname, base_grp)
+ VALUE obj, uname, base_grp;
{
- if (initgroups(StringValuePtr(uname), NUM2GIDT(base_grp)) != 0) {
+#ifdef HAVE_INITGROUPS
+ if (initgroups(StringValuePtr(uname), (rb_gid_t)NUM2INT(base_grp)) != 0) {
rb_sys_fail(0);
}
return proc_getgroups(obj);
-}
#else
-#define proc_initgroups rb_f_notimplement
+ rb_notimplement();
+ return Qnil;
#endif
+}
/*
@@ -4483,7 +2728,8 @@ proc_initgroups(VALUE obj, VALUE uname, VALUE base_grp)
*/
static VALUE
-proc_getmaxgroups(VALUE obj)
+proc_getmaxgroups(obj)
+ VALUE obj;
{
return INT2FIX(maxgroups);
}
@@ -4510,74 +2756,6 @@ proc_setmaxgroups(VALUE obj, VALUE val)
return INT2FIX(maxgroups);
}
-#if defined(HAVE_DAEMON) || defined(HAVE_FORK)
-/*
- * call-seq:
- * Process.daemon() => fixnum
- * Process.daemon(nochdir=nil,noclose=nil) => fixnum
- *
- * Detach the process from controlling terminal and run in
- * the background as system daemon. Unless the argument
- * nochdir is true (i.e. non false), it changes the current
- * working directory to the root ("/"). Unless the argument
- * noclose is true, daemon() will redirect standard input,
- * standard output and standard error to /dev/null.
- */
-
-static VALUE
-proc_daemon(int argc, VALUE *argv)
-{
- VALUE nochdir, noclose;
- int n;
-
- rb_secure(2);
- rb_scan_args(argc, argv, "02", &nochdir, &noclose);
-
-#if defined(HAVE_DAEMON)
- prefork();
- before_fork();
- n = daemon(RTEST(nochdir), RTEST(noclose));
- after_fork();
- if (n < 0) rb_sys_fail("daemon");
- return INT2FIX(n);
-#elif defined(HAVE_FORK)
- switch (rb_fork(0, 0, 0, Qnil)) {
- case -1:
- return INT2FIX(-1);
- case 0:
- break;
- default:
- _exit(0);
- }
-
- proc_setsid();
-
- /* must not be process-leader */
- switch (rb_fork(0, 0, 0, Qnil)) {
- case -1:
- return INT2FIX(-1);
- case 0:
- break;
- default:
- _exit(0);
- }
-
- if (!RTEST(nochdir))
- (void)chdir("/");
-
- if (!RTEST(noclose) && (n = open("/dev/null", O_RDWR, 0)) != -1) {
- (void)dup2(n, 0);
- (void)dup2(n, 1);
- (void)dup2(n, 2);
- if (n > 2)
- (void)close (n);
- }
- return INT2FIX(0);
-#endif
-}
-#else
-#define proc_daemon rb_f_notimplement
-#endif
/********************************************************************
*
@@ -4589,11 +2767,12 @@ proc_daemon(int argc, VALUE *argv)
*
*/
-static rb_gid_t SAVED_GROUP_ID = -1;
+static int SAVED_GROUP_ID = -1;
#ifdef BROKEN_SETREGID
int
-setregid(rb_gid_t rgid, rb_gid_t egid)
+setregid(rgid, egid)
+ rb_gid_t rgid, egid;
{
if (rgid != -1 && rgid != getgid()) {
if (egid == -1) egid = getegid();
@@ -4620,13 +2799,14 @@ setregid(rb_gid_t rgid, rb_gid_t egid)
*/
static VALUE
-p_gid_change_privilege(VALUE obj, VALUE id)
+p_gid_change_privilege(obj, id)
+ VALUE obj, id;
{
- rb_gid_t gid;
+ int gid;
check_gid_switch();
- gid = NUM2GIDT(id);
+ gid = NUM2INT(id);
if (geteuid() == 0) { /* root-user */
#if defined(HAVE_SETRESGID)
@@ -4718,7 +2898,7 @@ p_gid_change_privilege(VALUE obj, VALUE id)
if (setrgid(SAVED_GROUP_ID) < 0) rb_sys_fail(0);
SAVED_GROUP_ID = gid;
if (setrgid(gid) < 0) rb_sys_fail(0);
- }
+ }
} else if (/* getegid() != gid && */ getgid() == gid) {
if (setegid(gid) < 0) rb_sys_fail(0);
if (setrgid(SAVED_GROUP_ID) < 0) rb_sys_fail(0);
@@ -4755,7 +2935,7 @@ p_gid_change_privilege(VALUE obj, VALUE id)
rb_notimplement();
#endif
}
- return id;
+ return INT2FIX(gid);
}
@@ -4771,13 +2951,14 @@ p_gid_change_privilege(VALUE obj, VALUE id)
*/
static VALUE
-proc_geteuid(VALUE obj)
+proc_geteuid(obj)
+ VALUE obj;
{
- rb_uid_t euid = geteuid();
- return UIDT2NUM(euid);
+ int euid = geteuid();
+ return INT2FIX(euid);
}
-#if defined(HAVE_SETRESUID) || defined(HAVE_SETREUID) || defined(HAVE_SETEUID) || defined(HAVE_SETUID) || defined(_POSIX_SAVED_IDS)
+
/*
* call-seq:
* Process.euid= integer
@@ -4787,22 +2968,20 @@ proc_geteuid(VALUE obj)
*/
static VALUE
-proc_seteuid(VALUE obj, VALUE euid)
+proc_seteuid(obj, euid)
+ VALUE obj, euid;
{
- rb_uid_t uid;
-
check_uid_switch();
-
- uid = NUM2UIDT(euid);
-#if defined(HAVE_SETRESUID)
- if (setresuid(-1, uid, -1) < 0) rb_sys_fail(0);
+#if defined(HAVE_SETRESUID) && !defined(__CHECKER__)
+ if (setresuid(-1, NUM2INT(euid), -1) < 0) rb_sys_fail(0);
#elif defined HAVE_SETREUID
- if (setreuid(-1, uid) < 0) rb_sys_fail(0);
+ if (setreuid(-1, NUM2INT(euid)) < 0) rb_sys_fail(0);
#elif defined HAVE_SETEUID
- if (seteuid(uid) < 0) rb_sys_fail(0);
+ if (seteuid(NUM2INT(euid)) < 0) rb_sys_fail(0);
#elif defined HAVE_SETUID
- if (uid == getuid()) {
- if (setuid(uid) < 0) rb_sys_fail(0);
+ euid = NUM2INT(euid);
+ if (euid == getuid()) {
+ if (setuid(euid) < 0) rb_sys_fail(0);
}
else {
rb_notimplement();
@@ -4812,24 +2991,18 @@ proc_seteuid(VALUE obj, VALUE euid)
#endif
return euid;
}
-#endif
-#if defined(HAVE_SETRESUID) || defined(HAVE_SETREUID) || defined(HAVE_SETEUID) || defined(HAVE_SETUID)
-#define proc_seteuid_m proc_seteuid
-#else
-#define proc_seteuid_m rb_f_notimplement
-#endif
-
-static rb_uid_t
-rb_seteuid_core(rb_uid_t euid)
+static VALUE
+rb_seteuid_core(euid)
+ int euid;
{
- rb_uid_t uid;
+ int uid;
check_uid_switch();
uid = getuid();
-#if defined(HAVE_SETRESUID)
+#if defined(HAVE_SETRESUID) && !defined(__CHECKER__)
if (uid != euid) {
if (setresuid(-1,euid,euid) < 0) rb_sys_fail(0);
SAVED_USER_ID = euid;
@@ -4851,7 +3024,7 @@ rb_seteuid_core(rb_uid_t euid)
#else
rb_notimplement();
#endif
- return euid;
+ return INT2FIX(euid);
}
@@ -4870,10 +3043,10 @@ rb_seteuid_core(rb_uid_t euid)
*/
static VALUE
-p_uid_grant_privilege(VALUE obj, VALUE id)
+p_uid_grant_privilege(obj, id)
+ VALUE obj, id;
{
- rb_seteuid_core(NUM2UIDT(id));
- return id;
+ return rb_seteuid_core(NUM2INT(id));
}
@@ -4890,14 +3063,15 @@ p_uid_grant_privilege(VALUE obj, VALUE id)
*/
static VALUE
-proc_getegid(VALUE obj)
+proc_getegid(obj)
+ VALUE obj;
{
- rb_gid_t egid = getegid();
+ int egid = getegid();
- return GIDT2NUM(egid);
+ return INT2FIX(egid);
}
-#if defined(HAVE_SETRESGID) || defined(HAVE_SETREGID) || defined(HAVE_SETEGID) || defined(HAVE_SETGID) || defined(_POSIX_SAVED_IDS)
+
/*
* call-seq:
* Process.egid = fixnum => fixnum
@@ -4907,22 +3081,21 @@ proc_getegid(VALUE obj)
*/
static VALUE
-proc_setegid(VALUE obj, VALUE egid)
+proc_setegid(obj, egid)
+ VALUE obj, egid;
{
- rb_gid_t gid;
-
check_gid_switch();
- gid = NUM2GIDT(egid);
-#if defined(HAVE_SETRESGID)
- if (setresgid(-1, gid, -1) < 0) rb_sys_fail(0);
+#if defined(HAVE_SETRESGID) && !defined(__CHECKER__)
+ if (setresgid(-1, NUM2INT(egid), -1) < 0) rb_sys_fail(0);
#elif defined HAVE_SETREGID
- if (setregid(-1, gid) < 0) rb_sys_fail(0);
+ if (setregid(-1, NUM2INT(egid)) < 0) rb_sys_fail(0);
#elif defined HAVE_SETEGID
- if (setegid(gid) < 0) rb_sys_fail(0);
+ if (setegid(NUM2INT(egid)) < 0) rb_sys_fail(0);
#elif defined HAVE_SETGID
- if (gid == getgid()) {
- if (setgid(gid) < 0) rb_sys_fail(0);
+ egid = NUM2INT(egid);
+ if (egid == getgid()) {
+ if (setgid(egid) < 0) rb_sys_fail(0);
}
else {
rb_notimplement();
@@ -4932,24 +3105,18 @@ proc_setegid(VALUE obj, VALUE egid)
#endif
return egid;
}
-#endif
-#if defined(HAVE_SETRESGID) || defined(HAVE_SETREGID) || defined(HAVE_SETEGID) || defined(HAVE_SETGID)
-#define proc_setegid_m proc_setegid
-#else
-#define proc_setegid_m rb_f_notimplement
-#endif
-
-static rb_gid_t
-rb_setegid_core(rb_gid_t egid)
+static VALUE
+rb_setegid_core(egid)
+ int egid;
{
- rb_gid_t gid;
+ int gid;
check_gid_switch();
gid = getgid();
-#if defined(HAVE_SETRESGID)
+#if defined(HAVE_SETRESGID) && !defined(__CHECKER__)
if (gid != egid) {
if (setresgid(-1,egid,egid) < 0) rb_sys_fail(0);
SAVED_GROUP_ID = egid;
@@ -4971,7 +3138,7 @@ rb_setegid_core(rb_gid_t egid)
#else
rb_notimplement();
#endif
- return egid;
+ return INT2FIX(egid);
}
@@ -4990,10 +3157,10 @@ rb_setegid_core(rb_gid_t egid)
*/
static VALUE
-p_gid_grant_privilege(VALUE obj, VALUE id)
+p_gid_grant_privilege(obj, id)
+ VALUE obj, id;
{
- rb_setegid_core(NUM2GIDT(id));
- return id;
+ return rb_setegid_core(NUM2INT(id));
}
@@ -5007,9 +3174,9 @@ p_gid_grant_privilege(VALUE obj, VALUE id)
*/
static VALUE
-p_uid_exchangeable(void)
+p_uid_exchangeable()
{
-#if defined(HAVE_SETRESUID)
+#if defined(HAVE_SETRESUID) && !defined(__CHECKER__)
return Qtrue;
#elif defined(HAVE_SETREUID) && !defined(OBSOLETE_SETREUID)
return Qtrue;
@@ -5032,16 +3199,17 @@ p_uid_exchangeable(void)
*/
static VALUE
-p_uid_exchange(VALUE obj)
+p_uid_exchange(obj)
+ VALUE obj;
{
- rb_uid_t uid, euid;
+ int uid, euid;
check_uid_switch();
uid = getuid();
euid = geteuid();
-#if defined(HAVE_SETRESUID)
+#if defined(HAVE_SETRESUID) && !defined(__CHECKER__)
if (setresuid(euid, uid, uid) < 0) rb_sys_fail(0);
SAVED_USER_ID = uid;
#elif defined(HAVE_SETREUID) && !defined(OBSOLETE_SETREUID)
@@ -5050,7 +3218,7 @@ p_uid_exchange(VALUE obj)
#else
rb_notimplement();
#endif
- return UIDT2NUM(uid);
+ return INT2FIX(uid);
}
@@ -5064,9 +3232,9 @@ p_uid_exchange(VALUE obj)
*/
static VALUE
-p_gid_exchangeable(void)
+p_gid_exchangeable()
{
-#if defined(HAVE_SETRESGID)
+#if defined(HAVE_SETRESGID) && !defined(__CHECKER__)
return Qtrue;
#elif defined(HAVE_SETREGID) && !defined(OBSOLETE_SETREGID)
return Qtrue;
@@ -5089,16 +3257,17 @@ p_gid_exchangeable(void)
*/
static VALUE
-p_gid_exchange(VALUE obj)
+p_gid_exchange(obj)
+ VALUE obj;
{
- rb_gid_t gid, egid;
+ int gid, egid;
check_gid_switch();
gid = getgid();
egid = getegid();
-#if defined(HAVE_SETRESGID)
+#if defined(HAVE_SETRESGID) && !defined(__CHECKER__)
if (setresgid(egid, gid, gid) < 0) rb_sys_fail(0);
SAVED_GROUP_ID = gid;
#elif defined(HAVE_SETREGID) && !defined(OBSOLETE_SETREGID)
@@ -5107,7 +3276,7 @@ p_gid_exchange(VALUE obj)
#else
rb_notimplement();
#endif
- return GIDT2NUM(gid);
+ return INT2FIX(gid);
}
/* [MG] :FIXME: Is this correct? I'm not sure how to phrase this. */
@@ -5122,7 +3291,7 @@ p_gid_exchange(VALUE obj)
*/
static VALUE
-p_uid_have_saved_id(void)
+p_uid_have_saved_id()
{
#if defined(HAVE_SETRESUID) || defined(HAVE_SETEUID) || defined(_POSIX_SAVED_IDS)
return Qtrue;
@@ -5134,11 +3303,11 @@ p_uid_have_saved_id(void)
#if defined(HAVE_SETRESUID) || defined(HAVE_SETEUID) || defined(_POSIX_SAVED_IDS)
static VALUE
-p_uid_sw_ensure(rb_uid_t id)
+p_uid_sw_ensure(id)
+ int id;
{
under_uid_switch = 0;
- id = rb_seteuid_core(id);
- return UIDT2NUM(id);
+ return rb_seteuid_core(id);
}
@@ -5156,9 +3325,10 @@ p_uid_sw_ensure(rb_uid_t id)
*/
static VALUE
-p_uid_switch(VALUE obj)
+p_uid_switch(obj)
+ VALUE obj;
{
- rb_uid_t uid, euid;
+ int uid, euid;
check_uid_switch();
@@ -5166,38 +3336,40 @@ p_uid_switch(VALUE obj)
euid = geteuid();
if (uid != euid) {
- proc_seteuid(obj, UIDT2NUM(uid));
+ proc_seteuid(obj, INT2FIX(uid));
if (rb_block_given_p()) {
under_uid_switch = 1;
return rb_ensure(rb_yield, Qnil, p_uid_sw_ensure, SAVED_USER_ID);
} else {
- return UIDT2NUM(euid);
+ return INT2FIX(euid);
}
} else if (euid != SAVED_USER_ID) {
- proc_seteuid(obj, UIDT2NUM(SAVED_USER_ID));
+ proc_seteuid(obj, INT2FIX(SAVED_USER_ID));
if (rb_block_given_p()) {
under_uid_switch = 1;
return rb_ensure(rb_yield, Qnil, p_uid_sw_ensure, euid);
} else {
- return UIDT2NUM(uid);
+ return INT2FIX(uid);
}
} else {
errno = EPERM;
rb_sys_fail(0);
}
-}
+
#else
static VALUE
-p_uid_sw_ensure(VALUE obj)
+p_uid_sw_ensure(obj)
+ VALUE obj;
{
under_uid_switch = 0;
return p_uid_exchange(obj);
}
static VALUE
-p_uid_switch(VALUE obj)
+p_uid_switch(obj)
+ VALUE obj;
{
- rb_uid_t uid, euid;
+ int uid, euid;
check_uid_switch();
@@ -5213,10 +3385,10 @@ p_uid_switch(VALUE obj)
under_uid_switch = 1;
return rb_ensure(rb_yield, Qnil, p_uid_sw_ensure, obj);
} else {
- return UIDT2NUM(euid);
+ return INT2FIX(euid);
}
-}
#endif
+}
/* [MG] :FIXME: Is this correct? I'm not sure how to phrase this. */
@@ -5231,7 +3403,7 @@ p_uid_switch(VALUE obj)
*/
static VALUE
-p_gid_have_saved_id(void)
+p_gid_have_saved_id()
{
#if defined(HAVE_SETRESGID) || defined(HAVE_SETEGID) || defined(_POSIX_SAVED_IDS)
return Qtrue;
@@ -5242,11 +3414,11 @@ p_gid_have_saved_id(void)
#if defined(HAVE_SETRESGID) || defined(HAVE_SETEGID) || defined(_POSIX_SAVED_IDS)
static VALUE
-p_gid_sw_ensure(rb_gid_t id)
+p_gid_sw_ensure(id)
+ int id;
{
under_gid_switch = 0;
- id = rb_setegid_core(id);
- return GIDT2NUM(id);
+ return rb_setegid_core(id);
}
@@ -5264,9 +3436,10 @@ p_gid_sw_ensure(rb_gid_t id)
*/
static VALUE
-p_gid_switch(VALUE obj)
+p_gid_switch(obj)
+ VALUE obj;
{
- rb_gid_t gid, egid;
+ int gid, egid;
check_gid_switch();
@@ -5274,40 +3447,39 @@ p_gid_switch(VALUE obj)
egid = getegid();
if (gid != egid) {
- proc_setegid(obj, GIDT2NUM(gid));
+ proc_setegid(obj, INT2FIX(gid));
if (rb_block_given_p()) {
under_gid_switch = 1;
return rb_ensure(rb_yield, Qnil, p_gid_sw_ensure, SAVED_GROUP_ID);
} else {
- return GIDT2NUM(egid);
+ return INT2FIX(egid);
}
- }
- else if (egid != SAVED_GROUP_ID) {
- proc_setegid(obj, GIDT2NUM(SAVED_GROUP_ID));
+ } else if (egid != SAVED_GROUP_ID) {
+ proc_setegid(obj, INT2FIX(SAVED_GROUP_ID));
if (rb_block_given_p()) {
under_gid_switch = 1;
return rb_ensure(rb_yield, Qnil, p_gid_sw_ensure, egid);
} else {
- return GIDT2NUM(gid);
+ return INT2FIX(gid);
}
- }
- else {
+ } else {
errno = EPERM;
rb_sys_fail(0);
}
-}
#else
static VALUE
-p_gid_sw_ensure(VALUE obj)
+p_gid_sw_ensure(obj)
+ VALUE obj;
{
under_gid_switch = 0;
return p_gid_exchange(obj);
}
static VALUE
-p_gid_switch(VALUE obj)
+p_gid_switch(obj)
+ VALUE obj;
{
- rb_gid_t gid, egid;
+ int gid, egid;
check_gid_switch();
@@ -5323,13 +3495,12 @@ p_gid_switch(VALUE obj)
under_gid_switch = 1;
return rb_ensure(rb_yield, Qnil, p_gid_sw_ensure, obj);
} else {
- return GIDT2NUM(egid);
+ return INT2FIX(egid);
}
-}
#endif
+}
-#if defined(HAVE_TIMES)
/*
* call-seq:
* Process.times => aStructTms
@@ -5343,8 +3514,10 @@ p_gid_switch(VALUE obj)
*/
VALUE
-rb_proc_times(VALUE obj)
+rb_proc_times(obj)
+ VALUE obj;
{
+#if defined(HAVE_TIMES) && !defined(__CHECKER__)
const double hertz =
#ifdef HAVE__SC_CLK_TCK
(double)sysconf(_SC_CLK_TCK);
@@ -5362,15 +3535,15 @@ rb_proc_times(VALUE obj)
volatile VALUE utime, stime, cutime, sctime;
times(&buf);
- return rb_struct_new(rb_cProcessTms,
- utime = DBL2NUM(buf.tms_utime / hertz),
- stime = DBL2NUM(buf.tms_stime / hertz),
- cutime = DBL2NUM(buf.tms_cutime / hertz),
- sctime = DBL2NUM(buf.tms_cstime / hertz));
-}
+ return rb_struct_new(S_Tms,
+ utime = rb_float_new(buf.tms_utime / hertz),
+ stime = rb_float_new(buf.tms_stime / hertz),
+ cutime = rb_float_new(buf.tms_cutime / hertz),
+ sctime = rb_float_new(buf.tms_cstime / hertz));
#else
-#define rb_proc_times rb_f_notimplement
+ rb_notimplement();
#endif
+}
VALUE rb_mProcess;
VALUE rb_mProcUID;
@@ -5384,21 +3557,19 @@ VALUE rb_mProcID_Syscall;
*/
void
-Init_process(void)
+Init_process()
{
- rb_define_virtual_variable("$?", rb_last_status_get, 0);
rb_define_virtual_variable("$$", get_pid, 0);
+ rb_define_readonly_variable("$?", &rb_last_status);
rb_define_global_function("exec", rb_f_exec, -1);
rb_define_global_function("fork", rb_f_fork, 0);
rb_define_global_function("exit!", rb_f_exit_bang, -1);
rb_define_global_function("system", rb_f_system, -1);
- rb_define_global_function("spawn", rb_f_spawn, -1);
rb_define_global_function("sleep", rb_f_sleep, -1);
- rb_define_global_function("exit", rb_f_exit, -1);
- rb_define_global_function("abort", rb_f_abort, -1);
rb_mProcess = rb_define_module("Process");
+#if !defined(_WIN32) && !defined(DJGPP)
#ifdef WNOHANG
rb_define_const(rb_mProcess, "WNOHANG", INT2FIX(WNOHANG));
#else
@@ -5409,13 +3580,13 @@ Init_process(void)
#else
rb_define_const(rb_mProcess, "WUNTRACED", INT2FIX(0));
#endif
+#endif
rb_define_singleton_method(rb_mProcess, "exec", rb_f_exec, -1);
rb_define_singleton_method(rb_mProcess, "fork", rb_f_fork, 0);
- rb_define_singleton_method(rb_mProcess, "spawn", rb_f_spawn, -1);
rb_define_singleton_method(rb_mProcess, "exit!", rb_f_exit_bang, -1);
- rb_define_singleton_method(rb_mProcess, "exit", rb_f_exit, -1);
- rb_define_singleton_method(rb_mProcess, "abort", rb_f_abort, -1);
+ rb_define_singleton_method(rb_mProcess, "exit", rb_f_exit, -1); /* in eval.c */
+ rb_define_singleton_method(rb_mProcess, "abort", rb_f_abort, -1); /* in eval.c */
rb_define_module_function(rb_mProcess, "kill", rb_f_kill, -1); /* in signal.c */
rb_define_module_function(rb_mProcess, "wait", proc_wait, -1);
@@ -5425,26 +3596,27 @@ Init_process(void)
rb_define_module_function(rb_mProcess, "waitall", proc_waitall, 0);
rb_define_module_function(rb_mProcess, "detach", proc_detach, 1);
- rb_cProcessStatus = rb_define_class_under(rb_mProcess, "Status", rb_cObject);
- rb_undef_method(CLASS_OF(rb_cProcessStatus), "new");
+ rb_cProcStatus = rb_define_class_under(rb_mProcess, "Status", rb_cObject);
+ rb_undef_method(CLASS_OF(rb_cProcStatus), "new");
- rb_define_method(rb_cProcessStatus, "==", pst_equal, 1);
- rb_define_method(rb_cProcessStatus, "&", pst_bitand, 1);
- rb_define_method(rb_cProcessStatus, ">>", pst_rshift, 1);
- rb_define_method(rb_cProcessStatus, "to_i", pst_to_i, 0);
- rb_define_method(rb_cProcessStatus, "to_s", pst_to_s, 0);
- rb_define_method(rb_cProcessStatus, "inspect", pst_inspect, 0);
+ rb_define_method(rb_cProcStatus, "==", pst_equal, 1);
+ rb_define_method(rb_cProcStatus, "&", pst_bitand, 1);
+ rb_define_method(rb_cProcStatus, ">>", pst_rshift, 1);
+ rb_define_method(rb_cProcStatus, "to_i", pst_to_i, 0);
+ rb_define_method(rb_cProcStatus, "to_int", pst_to_i, 0);
+ rb_define_method(rb_cProcStatus, "to_s", pst_to_s, 0);
+ rb_define_method(rb_cProcStatus, "inspect", pst_inspect, 0);
- rb_define_method(rb_cProcessStatus, "pid", pst_pid, 0);
+ rb_define_method(rb_cProcStatus, "pid", pst_pid, 0);
- rb_define_method(rb_cProcessStatus, "stopped?", pst_wifstopped, 0);
- rb_define_method(rb_cProcessStatus, "stopsig", pst_wstopsig, 0);
- rb_define_method(rb_cProcessStatus, "signaled?", pst_wifsignaled, 0);
- rb_define_method(rb_cProcessStatus, "termsig", pst_wtermsig, 0);
- rb_define_method(rb_cProcessStatus, "exited?", pst_wifexited, 0);
- rb_define_method(rb_cProcessStatus, "exitstatus", pst_wexitstatus, 0);
- rb_define_method(rb_cProcessStatus, "success?", pst_success_p, 0);
- rb_define_method(rb_cProcessStatus, "coredump?", pst_wcoredump, 0);
+ rb_define_method(rb_cProcStatus, "stopped?", pst_wifstopped, 0);
+ rb_define_method(rb_cProcStatus, "stopsig", pst_wstopsig, 0);
+ rb_define_method(rb_cProcStatus, "signaled?", pst_wifsignaled, 0);
+ rb_define_method(rb_cProcStatus, "termsig", pst_wtermsig, 0);
+ rb_define_method(rb_cProcStatus, "exited?", pst_wifexited, 0);
+ rb_define_method(rb_cProcStatus, "exitstatus", pst_wexitstatus, 0);
+ rb_define_method(rb_cProcStatus, "success?", pst_success_p, 0);
+ rb_define_method(rb_cProcStatus, "coredump?", pst_wcoredump, 0);
rb_define_module_function(rb_mProcess, "pid", get_pid, 0);
rb_define_module_function(rb_mProcess, "ppid", get_ppid, 0);
@@ -5469,19 +3641,15 @@ Init_process(void)
rb_define_module_function(rb_mProcess, "setrlimit", proc_setrlimit, -1);
#ifdef RLIM2NUM
{
- VALUE inf = RLIM2NUM(RLIM_INFINITY);
+ VALUE inf = RLIM2NUM(RLIM_INFINITY), v;
+ rb_define_const(rb_mProcess, "RLIM_INFINITY", inf);
#ifdef RLIM_SAVED_MAX
- {
- VALUE v = RLIM_INFINITY == RLIM_SAVED_MAX ? inf : RLIM2NUM(RLIM_SAVED_MAX);
- rb_define_const(rb_mProcess, "RLIM_SAVED_MAX", v);
- }
+ v = RLIM_INFINITY == RLIM_SAVED_MAX ? inf : RLIM2NUM(RLIM_SAVED_MAX);
+ rb_define_const(rb_mProcess, "RLIM_SAVED_MAX", v);
#endif
- rb_define_const(rb_mProcess, "RLIM_INFINITY", inf);
#ifdef RLIM_SAVED_CUR
- {
- VALUE v = RLIM_INFINITY == RLIM_SAVED_CUR ? inf : RLIM2NUM(RLIM_SAVED_CUR);
- rb_define_const(rb_mProcess, "RLIM_SAVED_CUR", v);
- }
+ v = RLIM_INFINITY == RLIM_SAVED_CUR ? inf : RLIM2NUM(RLIM_SAVED_CUR);
+ rb_define_const(rb_mProcess, "RLIM_SAVED_CUR", v);
#endif
}
#ifdef RLIMIT_CORE
@@ -5524,21 +3692,19 @@ Init_process(void)
rb_define_module_function(rb_mProcess, "gid", proc_getgid, 0);
rb_define_module_function(rb_mProcess, "gid=", proc_setgid, 1);
rb_define_module_function(rb_mProcess, "euid", proc_geteuid, 0);
- rb_define_module_function(rb_mProcess, "euid=", proc_seteuid_m, 1);
+ rb_define_module_function(rb_mProcess, "euid=", proc_seteuid, 1);
rb_define_module_function(rb_mProcess, "egid", proc_getegid, 0);
- rb_define_module_function(rb_mProcess, "egid=", proc_setegid_m, 1);
+ rb_define_module_function(rb_mProcess, "egid=", proc_setegid, 1);
rb_define_module_function(rb_mProcess, "initgroups", proc_initgroups, 2);
rb_define_module_function(rb_mProcess, "groups", proc_getgroups, 0);
rb_define_module_function(rb_mProcess, "groups=", proc_setgroups, 1);
rb_define_module_function(rb_mProcess, "maxgroups", proc_getmaxgroups, 0);
rb_define_module_function(rb_mProcess, "maxgroups=", proc_setmaxgroups, 1);
- rb_define_module_function(rb_mProcess, "daemon", proc_daemon, -1);
-
rb_define_module_function(rb_mProcess, "times", rb_proc_times, 0);
#if defined(HAVE_TIMES) || defined(_WIN32)
- rb_cProcessTms = rb_struct_define("Tms", "utime", "stime", "cutime", "cstime", NULL);
+ S_Tms = rb_struct_define("Tms", "utime", "stime", "cutime", "cstime", NULL);
#endif
SAVED_USER_ID = geteuid();
diff --git a/random.c b/random.c
index f67b65f2be..258b0b2230 100644
--- a/random.c
+++ b/random.c
@@ -3,13 +3,14 @@
random.c -
$Author$
+ $Date$
created at: Fri Dec 24 16:39:21 JST 1993
- Copyright (C) 1993-2007 Yukihiro Matsumoto
+ Copyright (C) 1993-2003 Yukihiro Matsumoto
**********************************************************************/
-/*
+/*
This is based on trimmed version of MT19937. To get the original version,
contact <http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html>.
@@ -20,11 +21,11 @@ The original copyright notice follows.
This is a faster version by taking Shawn Cokus's optimization,
Matthe Bellew's simplification, Isaku Wada's real version.
- Before using, initialize the state by using init_genrand(mt, seed)
- or init_by_array(mt, init_key, key_length).
+ Before using, initialize the state by using init_genrand(seed)
+ or init_by_array(init_key, key_length).
Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura,
- All rights reserved.
+ All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
@@ -37,8 +38,8 @@ The original copyright notice follows.
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
- 3. The names of its contributors may not be used to endorse or promote
- products derived from this software without specific prior written
+ 3. The names of its contributors may not be used to endorse or promote
+ products derived from this software without specific prior written
permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
@@ -59,46 +60,36 @@ The original copyright notice follows.
email: matumoto@math.keio.ac.jp
*/
-#include <limits.h>
-typedef int int_must_be_32bit_at_least[sizeof(int) * CHAR_BIT < 32 ? -1 : 1];
-
-/* Period parameters */
+/* Period parameters */
#define N 624
#define M 397
-#define MATRIX_A 0x9908b0dfU /* constant vector a */
-#define UMASK 0x80000000U /* most significant w-r bits */
-#define LMASK 0x7fffffffU /* least significant r bits */
+#define MATRIX_A 0x9908b0dfUL /* constant vector a */
+#define UMASK 0x80000000UL /* most significant w-r bits */
+#define LMASK 0x7fffffffUL /* least significant r bits */
#define MIXBITS(u,v) ( ((u) & UMASK) | ((v) & LMASK) )
-#define TWIST(u,v) ((MIXBITS(u,v) >> 1) ^ ((v)&1U ? MATRIX_A : 0U))
-
-enum {MT_MAX_STATE = N};
-
-struct MT {
- /* assume int is enough to store 32bits */
- unsigned int state[N]; /* the array for the state vector */
- unsigned int *next;
- int left;
-};
+#define TWIST(u,v) ((MIXBITS(u,v) >> 1) ^ ((v)&1UL ? MATRIX_A : 0UL))
-#define genrand_initialized(mt) ((mt)->next != 0)
-#define uninit_genrand(mt) ((mt)->next = 0)
+static unsigned long state[N]; /* the array for the state vector */
+static int left = 1;
+static int initf = 0;
+static unsigned long *next;
/* initializes state[N] with a seed */
static void
-init_genrand(struct MT *mt, unsigned int s)
+init_genrand(s)
+ unsigned long s;
{
int j;
- mt->state[0] = s & 0xffffffffU;
+ state[0]= s & 0xffffffffUL;
for (j=1; j<N; j++) {
- mt->state[j] = (1812433253U * (mt->state[j-1] ^ (mt->state[j-1] >> 30)) + j);
+ state[j] = (1812433253UL * (state[j-1] ^ (state[j-1] >> 30)) + j);
/* See Knuth TAOCP Vol2. 3rd Ed. P.106 for multiplier. */
/* In the previous versions, MSBs of the seed affect */
- /* only MSBs of the array state[]. */
+ /* only MSBs of the array state[]. */
/* 2002/01/09 modified by Makoto Matsumoto */
- mt->state[j] &= 0xffffffff; /* for >32 bit machines */
+ state[j] &= 0xffffffffUL; /* for >32 bit machines */
}
- mt->left = 1;
- mt->next = mt->state + N - 1;
+ left = 1; initf = 1;
}
/* initialize by an array with array-length */
@@ -106,78 +97,79 @@ init_genrand(struct MT *mt, unsigned int s)
/* key_length is its length */
/* slight change for C++, 2004/2/26 */
static void
-init_by_array(struct MT *mt, unsigned int init_key[], int key_length)
+init_by_array(unsigned long init_key[], int key_length)
{
int i, j, k;
- init_genrand(mt, 19650218U);
+ init_genrand(19650218UL);
i=1; j=0;
k = (N>key_length ? N : key_length);
for (; k; k--) {
- mt->state[i] = (mt->state[i] ^ ((mt->state[i-1] ^ (mt->state[i-1] >> 30)) * 1664525U))
+ state[i] = (state[i] ^ ((state[i-1] ^ (state[i-1] >> 30)) * 1664525UL))
+ init_key[j] + j; /* non linear */
- mt->state[i] &= 0xffffffffU; /* for WORDSIZE > 32 machines */
+ state[i] &= 0xffffffffUL; /* for WORDSIZE > 32 machines */
i++; j++;
- if (i>=N) { mt->state[0] = mt->state[N-1]; i=1; }
+ if (i>=N) { state[0] = state[N-1]; i=1; }
if (j>=key_length) j=0;
}
for (k=N-1; k; k--) {
- mt->state[i] = (mt->state[i] ^ ((mt->state[i-1] ^ (mt->state[i-1] >> 30)) * 1566083941U))
+ state[i] = (state[i] ^ ((state[i-1] ^ (state[i-1] >> 30)) * 1566083941UL))
- i; /* non linear */
- mt->state[i] &= 0xffffffffU; /* for WORDSIZE > 32 machines */
+ state[i] &= 0xffffffffUL; /* for WORDSIZE > 32 machines */
i++;
- if (i>=N) { mt->state[0] = mt->state[N-1]; i=1; }
+ if (i>=N) { state[0] = state[N-1]; i=1; }
}
- mt->state[0] = 0x80000000U; /* MSB is 1; assuring non-zero initial array */
+ state[0] = 0x80000000UL; /* MSB is 1; assuring non-zero initial array */
+ left = 1; initf = 1;
}
static void
-next_state(struct MT *mt)
+next_state()
{
- unsigned int *p = mt->state;
+ unsigned long *p=state;
int j;
/* if init_genrand() has not been called, */
/* a default initial seed is used */
- if (!genrand_initialized(mt)) init_genrand(mt, 5489U);
+ if (initf==0) init_genrand(5489UL);
- mt->left = N;
- mt->next = mt->state;
-
- for (j=N-M+1; --j; p++)
+ left = N;
+ next = state;
+
+ for (j=N-M+1; --j; p++)
*p = p[M] ^ TWIST(p[0], p[1]);
- for (j=M; --j; p++)
+ for (j=M; --j; p++)
*p = p[M-N] ^ TWIST(p[0], p[1]);
- *p = p[M-N] ^ TWIST(p[0], mt->state[0]);
+ *p = p[M-N] ^ TWIST(p[0], state[0]);
}
/* generates a random number on [0,0xffffffff]-interval */
-static unsigned int
-genrand_int32(struct MT *mt)
+unsigned long
+rb_genrand_int32(void)
{
- unsigned int y;
+ unsigned long y;
- if (--mt->left <= 0) next_state(mt);
- y = *mt->next++;
+ if (--left == 0) next_state();
+ y = *next++;
/* Tempering */
y ^= (y >> 11);
- y ^= (y << 7) & 0x9d2c5680;
- y ^= (y << 15) & 0xefc60000;
+ y ^= (y << 7) & 0x9d2c5680UL;
+ y ^= (y << 15) & 0xefc60000UL;
y ^= (y >> 18);
return y;
}
/* generates a random number on [0,1) with 53-bit resolution*/
-static double
-genrand_real(struct MT *mt)
-{
- unsigned int a = genrand_int32(mt)>>5, b = genrand_int32(mt)>>6;
- return(a*67108864.0+b)*(1.0/9007199254740992.0);
-}
+double
+rb_genrand_real(void)
+{
+ unsigned long a=rb_genrand_int32()>>5, b=rb_genrand_int32()>>6;
+ return(a*67108864.0+b)*(1.0/9007199254740992.0);
+}
/* These real versions are due to Isaku Wada, 2002/01/09 added */
#undef N
@@ -185,7 +177,7 @@ genrand_real(struct MT *mt)
/* These real versions are due to Isaku Wada, 2002/01/09 added */
-#include "ruby/ruby.h"
+#include "ruby.h"
#ifdef HAVE_UNISTD_H
#include <unistd.h>
@@ -197,203 +189,90 @@ genrand_real(struct MT *mt)
#include <fcntl.h>
#endif
-typedef struct {
- VALUE seed;
- struct MT mt;
-} rb_random_t;
-
-#define DEFAULT_SEED_CNT 4
-
-struct Random {
- rb_random_t rnd;
- unsigned int initial[DEFAULT_SEED_CNT];
-};
-
-static struct Random default_rand;
-
-unsigned long
-rb_genrand_int32(void)
-{
- return genrand_int32(&default_rand.rnd.mt);
-}
-
-double
-rb_genrand_real(void)
-{
- return genrand_real(&default_rand.rnd.mt);
-}
-
-#define BDIGITS(x) (RBIGNUM_DIGITS(x))
-#define BITSPERDIG (SIZEOF_BDIGITS*CHAR_BIT)
-#define BIGRAD ((BDIGIT_DBL)1 << BITSPERDIG)
-#define DIGSPERINT (SIZEOF_INT/SIZEOF_BDIGITS)
-#define BIGUP(x) ((BDIGIT_DBL)(x) << BITSPERDIG)
-#define BIGDN(x) RSHIFT(x,BITSPERDIG)
-#define BIGLO(x) ((BDIGIT)((x) & (BIGRAD-1)))
-#define BDIGMAX ((BDIGIT)-1)
-
-#define roomof(n, m) (int)(((n)+(m)-1) / (m))
-#define numberof(array) (int)(sizeof(array) / sizeof((array)[0]))
-#define SIZEOF_INT32 (31/CHAR_BIT + 1)
-
-VALUE rb_cRandom;
-#define id_minus '-'
-#define id_plus '+'
-
-static VALUE random_seed(void);
-
-/* :nodoc: */
-static void
-random_mark(void *ptr)
-{
- rb_gc_mark(((rb_random_t *)ptr)->seed);
-}
-
-#define random_free RUBY_TYPED_DEFAULT_FREE
-
-static size_t
-random_memsize(void *ptr)
-{
- return ptr ? sizeof(rb_random_t) : 0;
-}
-
-static const rb_data_type_t random_data_type = {
- "random",
- random_mark,
- random_free,
- random_memsize,
-};
-
-static rb_random_t *
-get_rnd(VALUE obj)
-{
- rb_random_t *ptr;
- TypedData_Get_Struct(obj, rb_random_t, &random_data_type, ptr);
- return ptr;
-}
-
-/* :nodoc: */
-static VALUE
-random_alloc(VALUE klass)
-{
- rb_random_t *rnd;
- VALUE obj = TypedData_Make_Struct(rb_cRandom, rb_random_t, &random_data_type, rnd);
- rnd->seed = INT2FIX(0);
- return obj;
-}
+static VALUE saved_seed = INT2FIX(0);
static VALUE
-rand_init(struct MT *mt, VALUE vseed)
+rand_init(vseed)
+ VALUE vseed;
{
volatile VALUE seed;
- long blen = 0;
- int i, j, len;
- unsigned int buf0[SIZEOF_LONG / SIZEOF_INT32 * 4], *buf = buf0;
+ VALUE old;
+ long len;
+ unsigned long *buf;
seed = rb_to_int(vseed);
switch (TYPE(seed)) {
case T_FIXNUM:
- len = 1;
- buf[0] = (unsigned int)(FIX2ULONG(seed) & 0xffffffff);
-#if SIZEOF_LONG > SIZEOF_INT32
- if ((buf[1] = (unsigned int)(FIX2ULONG(seed) >> 32)) != 0) ++len;
-#endif
- break;
+ len = sizeof(VALUE);
+ break;
case T_BIGNUM:
- blen = RBIGNUM_LEN(seed);
- if (blen == 0) {
- len = 1;
- }
- else if (blen > MT_MAX_STATE * SIZEOF_INT32 / SIZEOF_BDIGITS) {
- blen = (len = MT_MAX_STATE) * SIZEOF_INT32 / SIZEOF_BDIGITS;
- len = roomof(len, SIZEOF_INT32);
- }
- else {
- len = roomof((int)blen * SIZEOF_BDIGITS, SIZEOF_INT32);
- }
- /* allocate ints for init_by_array */
- if (len > numberof(buf0)) buf = ALLOC_N(unsigned int, len);
- memset(buf, 0, len * sizeof(*buf));
- len = 0;
- for (i = (int)(blen-1); 0 <= i; i--) {
- j = i * SIZEOF_BDIGITS / SIZEOF_INT32;
-#if SIZEOF_BDIGITS < SIZEOF_INT32
- buf[j] <<= SIZEOF_BDIGITS * CHAR_BIT;
-#endif
- buf[j] |= RBIGNUM_DIGITS(seed)[i];
- if (!len && buf[j]) len = j;
- }
- ++len;
- break;
+ len = RBIGNUM(seed)->len * SIZEOF_BDIGITS;
+ if (len == 0)
+ len = 4;
+ break;
default:
- rb_raise(rb_eTypeError, "failed to convert %s into Integer",
- rb_obj_classname(vseed));
+ rb_raise(rb_eTypeError, "failed to convert %s into Integer",
+ rb_obj_classname(vseed));
+ }
+ len = (len + 3) / 4; /* number of 32bit words */
+ buf = ALLOC_N(unsigned long, len); /* allocate longs for init_by_array */
+ memset(buf, 0, len * sizeof(long));
+ if (FIXNUM_P(seed)) {
+ buf[0] = FIX2ULONG(seed) & 0xffffffff;
+#if SIZEOF_LONG > 4
+ buf[1] = FIX2ULONG(seed) >> 32;
+#endif
+ }
+ else {
+ int i, j;
+ for (i = RBIGNUM(seed)->len-1; 0 <= i; i--) {
+ j = i * SIZEOF_BDIGITS / 4;
+#if SIZEOF_BDIGITS < 4
+ buf[j] <<= SIZEOF_BDIGITS * 8;
+#endif
+ buf[j] |= ((BDIGIT *)RBIGNUM(seed)->digits)[i];
+ }
+ }
+ while (1 < len && buf[len-1] == 0) {
+ len--;
}
if (len <= 1) {
- init_genrand(mt, buf[0]);
+ init_genrand(buf[0]);
}
else {
if (buf[len-1] == 1) /* remove leading-zero-guard */
len--;
- init_by_array(mt, buf, len);
+ init_by_array(buf, len);
}
- if (buf != buf0) xfree(buf);
- return seed;
+ old = saved_seed;
+ saved_seed = seed;
+ free(buf);
+ return old;
}
-/*
- * call-seq: Random.new([seed]) -> prng
- *
- * Creates new Mersenne Twister based pseudorandom number generator with
- * seed. When the argument seed is omitted, the generator is initialized
- * with Random.seed.
- *
- * The argument seed is used to ensure repeatable sequences of random numbers
- * between different runs of the program.
- *
- * prng = Random.new(1234)
- * [ prng.rand, prng.rand ] #=> [0.191519450378892, 0.622108771039832]
- * [ prng.integer(10), prng.integer(1000) ] #=> [4, 664]
- * prng = Random.new(1234)
- * [ prng.rand, prng.rand ] #=> [0.191519450378892, 0.622108771039832]
- */
static VALUE
-random_init(int argc, VALUE *argv, VALUE obj)
-{
- VALUE vseed;
- rb_random_t *rnd = get_rnd(obj);
-
- if (argc == 0) {
- vseed = random_seed();
- }
- else {
- rb_scan_args(argc, argv, "01", &vseed);
- }
- rnd->seed = rand_init(&rnd->mt, vseed);
- return obj;
-}
-
-#define DEFAULT_SEED_LEN (DEFAULT_SEED_CNT * sizeof(int))
-
-#if defined(S_ISCHR) && !defined(DOSISH)
-# define USE_DEV_URANDOM 1
-#else
-# define USE_DEV_URANDOM 0
-#endif
-
-static void
-fill_random_seed(unsigned int seed[DEFAULT_SEED_CNT])
+random_seed()
{
static int n = 0;
struct timeval tv;
-#if USE_DEV_URANDOM
int fd;
struct stat statbuf;
-#endif
- memset(seed, 0, DEFAULT_SEED_LEN);
+ int seed_len;
+ BDIGIT *digits;
+ unsigned long *seed;
+ NEWOBJ(big, struct RBignum);
+ OBJSETUP(big, rb_cBignum, T_BIGNUM);
-#if USE_DEV_URANDOM
+ seed_len = 4 * sizeof(long);
+ big->sign = 1;
+ big->len = seed_len / SIZEOF_BDIGITS + 1;
+ digits = big->digits = ALLOC_N(BDIGIT, big->len);
+ seed = (unsigned long *)big->digits;
+
+ memset(digits, 0, big->len * SIZEOF_BDIGITS);
+
+#ifdef S_ISCHR
if ((fd = open("/dev/urandom", O_RDONLY
#ifdef O_NONBLOCK
|O_NONBLOCK
@@ -406,7 +285,7 @@ fill_random_seed(unsigned int seed[DEFAULT_SEED_CNT])
#endif
)) >= 0) {
if (fstat(fd, &statbuf) == 0 && S_ISCHR(statbuf.st_mode)) {
- (void)read(fd, seed, DEFAULT_SEED_LEN);
+ read(fd, seed, seed_len);
}
close(fd);
}
@@ -414,230 +293,23 @@ fill_random_seed(unsigned int seed[DEFAULT_SEED_CNT])
gettimeofday(&tv, 0);
seed[0] ^= tv.tv_usec;
- seed[1] ^= (unsigned int)tv.tv_sec;
-#if SIZEOF_TIME_T > SIZEOF_INT
- seed[0] ^= (unsigned int)((time_t)tv.tv_sec >> SIZEOF_INT * CHAR_BIT);
-#endif
+ seed[1] ^= tv.tv_sec;
seed[2] ^= getpid() ^ (n++ << 16);
- seed[3] ^= (unsigned int)(VALUE)&seed;
-#if SIZEOF_VOIDP > SIZEOF_INT
- seed[2] ^= (unsigned int)((VALUE)&seed >> SIZEOF_INT * CHAR_BIT);
-#endif
-}
-
-static VALUE
-make_seed_value(const void *ptr)
-{
- BDIGIT *digits;
- NEWOBJ(big, struct RBignum);
- OBJSETUP(big, rb_cBignum, T_BIGNUM);
-
- RBIGNUM_SET_SIGN(big, 1);
- rb_big_resize((VALUE)big, DEFAULT_SEED_LEN / SIZEOF_BDIGITS + 1);
- digits = RBIGNUM_DIGITS(big);
-
- MEMCPY(digits, ptr, char, DEFAULT_SEED_LEN);
+ seed[3] ^= (unsigned long)&seed;
/* set leading-zero-guard if need. */
- digits[RBIGNUM_LEN(big)-1] = digits[RBIGNUM_LEN(big)-2] <= 1 ? 1 : 0;
+ digits[big->len-1] = digits[big->len-2] <= 1 ? 1 : 0;
return rb_big_norm((VALUE)big);
}
/*
- * call-seq: Random.seed -> integer
- *
- * Returns arbitrary value for seed.
- */
-static VALUE
-random_seed(void)
-{
- unsigned int buf[DEFAULT_SEED_CNT];
- fill_random_seed(buf);
- return make_seed_value(buf);
-}
-
-/*
- * call-seq: prng.seed -> integer
- *
- * Returns the seed of the generator.
- */
-static VALUE
-random_get_seed(VALUE obj)
-{
- return get_rnd(obj)->seed;
-}
-
-/* :nodoc: */
-static VALUE
-random_copy(VALUE obj, VALUE orig)
-{
- rb_random_t *rnd1 = get_rnd(obj);
- rb_random_t *rnd2 = get_rnd(orig);
- struct MT *mt = &rnd1->mt;
-
- *rnd1 = *rnd2;
- mt->next = mt->state + numberof(mt->state) - mt->left + 1;
- return obj;
-}
-
-static VALUE
-mt_state(const struct MT *mt)
-{
- VALUE bigo = rb_big_new(sizeof(mt->state) / sizeof(BDIGIT), 1);
- BDIGIT *d = RBIGNUM_DIGITS(bigo);
- int i;
-
- for (i = 0; i < numberof(mt->state); ++i) {
- unsigned int x = mt->state[i];
-#if SIZEOF_BDIGITS < SIZEOF_INT32
- int j;
- for (j = 0; j < SIZEOF_INT32 / SIZEOF_BDIGITS; ++j) {
- *d++ = BIGLO(x);
- x = BIGDN(x);
- }
-#else
- *d++ = (BDIGIT)x;
-#endif
- }
- return rb_big_norm(bigo);
-}
-
-static VALUE
-random_state(VALUE obj)
-{
- rb_random_t *rnd = get_rnd(obj);
- return mt_state(&rnd->mt);
-}
-
-static VALUE
-random_s_state(VALUE klass)
-{
- return mt_state(&default_rand.rnd.mt);
-}
-
-static VALUE
-random_left(VALUE obj)
-{
- rb_random_t *rnd = get_rnd(obj);
- return INT2FIX(rnd->mt.left);
-}
-
-static VALUE
-random_s_left(VALUE klass)
-{
- return INT2FIX(default_rand.rnd.mt.left);
-}
-
-/* :nodoc: */
-static VALUE
-random_dump(VALUE obj)
-{
- rb_random_t *rnd = get_rnd(obj);
- VALUE dump = rb_ary_new2(3);
-
- rb_ary_push(dump, mt_state(&rnd->mt));
- rb_ary_push(dump, INT2FIX(rnd->mt.left));
- rb_ary_push(dump, rnd->seed);
-
- return dump;
-}
-
-/* :nodoc: */
-static VALUE
-random_load(VALUE obj, VALUE dump)
-{
- rb_random_t *rnd = get_rnd(obj);
- struct MT *mt = &rnd->mt;
- VALUE state, left = INT2FIX(1), seed = INT2FIX(0);
- VALUE *ary;
- unsigned long x;
-
- Check_Type(dump, T_ARRAY);
- ary = RARRAY_PTR(dump);
- switch (RARRAY_LEN(dump)) {
- case 3:
- seed = ary[2];
- case 2:
- left = ary[1];
- case 1:
- state = ary[0];
- break;
- default:
- rb_raise(rb_eArgError, "wrong dump data");
- }
- memset(mt->state, 0, sizeof(mt->state));
- if (FIXNUM_P(state)) {
- x = FIX2ULONG(state);
- mt->state[0] = (unsigned int)x;
-#if SIZEOF_LONG / SIZEOF_INT >= 2
- mt->state[1] = (unsigned int)(x >> CHAR_BIT * SIZEOF_BDIGITS);
-#endif
-#if SIZEOF_LONG / SIZEOF_INT >= 3
- mt->state[2] = (unsigned int)(x >> 2 * CHAR_BIT * SIZEOF_BDIGITS);
-#endif
-#if SIZEOF_LONG / SIZEOF_INT >= 4
- mt->state[3] = (unsigned int)(x >> 3 * CHAR_BIT * SIZEOF_BDIGITS);
-#endif
- }
- else {
- BDIGIT *d;
- long len;
- Check_Type(state, T_BIGNUM);
- len = RBIGNUM_LEN(state);
- if (len > roomof(sizeof(mt->state), SIZEOF_BDIGITS)) {
- len = roomof(sizeof(mt->state), SIZEOF_BDIGITS);
- }
-#if SIZEOF_BDIGITS < SIZEOF_INT
- else if (len % DIGSPERINT) {
- d = RBIGNUM_DIGITS(state) + len;
-# if DIGSPERINT == 2
- --len;
- x = *--d;
-# else
- x = 0;
- do {
- x = (x << CHAR_BIT * SIZEOF_BDIGITS) | *--d;
- } while (--len % DIGSPERINT);
-# endif
- mt->state[len / DIGSPERINT] = (unsigned int)x;
- }
-#endif
- if (len > 0) {
- d = BDIGITS(state) + len;
- do {
- --len;
- x = *--d;
-# if DIGSPERINT == 2
- --len;
- x = (x << CHAR_BIT * SIZEOF_BDIGITS) | *--d;
-# elif SIZEOF_BDIGITS < SIZEOF_INT
- do {
- x = (x << CHAR_BIT * SIZEOF_BDIGITS) | *--d;
- } while (--len % DIGSPERINT);
-# endif
- mt->state[len / DIGSPERINT] = (unsigned int)x;
- } while (len > 0);
- }
- }
- x = NUM2ULONG(left);
- if (x > numberof(mt->state)) {
- rb_raise(rb_eArgError, "wrong value");
- }
- mt->left = (unsigned int)x;
- mt->next = mt->state + numberof(mt->state) - x + 1;
- rnd->seed = rb_to_int(seed);
-
- return obj;
-}
-
-/*
* call-seq:
* srand(number=0) => old_seed
- *
+ *
* Seeds the pseudorandom number generator to the value of
- * <i>number</i>. If <i>number</i> is omitted
- * or zero, seeds the generator using a combination of the time, the
+ * <i>number</i>.<code>to_i.abs</code>. If <i>number</i> is omitted,
+ * seeds the generator using a combination of the time, the
* process id, and a sequence number. (This is also the behavior if
* <code>Kernel::rand</code> is called without previously calling
* <code>srand</code>, but without the sequence.) By setting the seed
@@ -646,24 +318,23 @@ random_load(VALUE obj, VALUE dump)
*/
static VALUE
-rb_f_srand(int argc, VALUE *argv, VALUE obj)
+rb_f_srand(argc, argv, obj)
+ int argc;
+ VALUE *argv;
+ VALUE obj;
{
VALUE seed, old;
rb_secure(4);
- if (argc == 0) {
+ if (rb_scan_args(argc, argv, "01", &seed) == 0) {
seed = random_seed();
}
- else {
- rb_scan_args(argc, argv, "01", &seed);
- }
- old = default_rand.rnd.seed;
- default_rand.rnd.seed = rand_init(&default_rand.rnd.mt, seed);
+ old = rand_init(seed);
return old;
}
-static unsigned long
+static unsigned long
make_mask(unsigned long x)
{
x = x | x >> 1;
@@ -678,7 +349,7 @@ make_mask(unsigned long x)
}
static unsigned long
-limited_rand(struct MT *mt, unsigned long limit)
+limited_rand(unsigned long limit)
{
unsigned long mask = make_mask(limit);
int i;
@@ -686,9 +357,9 @@ limited_rand(struct MT *mt, unsigned long limit)
retry:
val = 0;
- for (i = SIZEOF_LONG/SIZEOF_INT32-1; 0 <= i; i--) {
- if ((mask >> (i * 32)) & 0xffffffff) {
- val |= (unsigned long)genrand_int32(mt) << (i * 32);
+ for (i = SIZEOF_LONG/4-1; 0 <= i; i--) {
+ if (mask >> (i * 32)) {
+ val |= rb_genrand_int32() << (i * 32);
val &= mask;
if (limit < val)
goto retry;
@@ -698,31 +369,26 @@ limited_rand(struct MT *mt, unsigned long limit)
}
static VALUE
-limited_big_rand(struct MT *mt, struct RBignum *limit)
+limited_big_rand(struct RBignum *limit)
{
unsigned long mask, lim, rnd;
struct RBignum *val;
- long i, len;
- int boundary;
+ int i, len, boundary;
- len = (RBIGNUM_LEN(limit) * SIZEOF_BDIGITS + 3) / 4;
+ len = (limit->len * SIZEOF_BDIGITS + 3) / 4;
val = (struct RBignum *)rb_big_clone((VALUE)limit);
- RBIGNUM_SET_SIGN(val, 1);
+ val->sign = 1;
#if SIZEOF_BDIGITS == 2
-# define BIG_GET32(big,i) \
- (RBIGNUM_DIGITS(big)[(i)*2] | \
- ((i)*2+1 < RBIGNUM_LEN(big) ? \
- (RBIGNUM_DIGITS(big)[(i)*2+1] << 16) : \
- 0))
-# define BIG_SET32(big,i,d) \
- ((RBIGNUM_DIGITS(big)[(i)*2] = (d) & 0xffff), \
- ((i)*2+1 < RBIGNUM_LEN(big) ? \
- (RBIGNUM_DIGITS(big)[(i)*2+1] = (d) >> 16) : \
- 0))
+# define BIG_GET32(big,i) (((BDIGIT *)(big)->digits)[(i)*2] | \
+ ((i)*2+1 < (big)->len ? (((BDIGIT *)(big)->digits)[(i)*2+1] << 16) \
+ : 0))
+# define BIG_SET32(big,i,d) ((((BDIGIT *)(big)->digits)[(i)*2] = (d) & 0xffff), \
+ ((i)*2+1 < (big)->len ? (((BDIGIT *)(big)->digits)[(i)*2+1] = (d) >> 16) \
+ : 0))
#else
/* SIZEOF_BDIGITS == 4 */
-# define BIG_GET32(big,i) (RBIGNUM_DIGITS(big)[i])
-# define BIG_SET32(big,i,d) (RBIGNUM_DIGITS(big)[i] = (d))
+# define BIG_GET32(big,i) (((BDIGIT *)(big)->digits)[i])
+# define BIG_SET32(big,i,d) (((BDIGIT *)(big)->digits)[i] = (d))
#endif
retry:
mask = 0;
@@ -731,7 +397,7 @@ limited_big_rand(struct MT *mt, struct RBignum *limit)
lim = BIG_GET32(limit, i);
mask = mask ? 0xffffffff : make_mask(lim);
if (mask) {
- rnd = genrand_int32(mt) & mask;
+ rnd = rb_genrand_int32() & mask;
if (boundary) {
if (lim < rnd)
goto retry;
@@ -742,204 +408,15 @@ limited_big_rand(struct MT *mt, struct RBignum *limit)
else {
rnd = 0;
}
- BIG_SET32(val, i, (BDIGIT)rnd);
+ BIG_SET32(val, i, rnd);
}
return rb_big_norm((VALUE)val);
}
-unsigned long
-rb_rand_internal(unsigned long i)
-{
- struct MT *mt = &default_rand.rnd.mt;
- if (!genrand_initialized(mt)) {
- rand_init(mt, random_seed());
- }
- return limited_rand(mt, i);
-}
-
-/*
- * call-seq: prng.bytes(size) -> prng
- *
- * Returns a random binary string. The argument size specified the length of
- * the result string.
- */
-static VALUE
-random_bytes(VALUE obj, VALUE len)
-{
- rb_random_t *rnd = get_rnd(obj);
- long n = FIX2LONG(rb_to_int(len));
- VALUE bytes = rb_str_new(0, n);
- char *ptr = RSTRING_PTR(bytes);
- unsigned int r, i;
-
- for (; n >= SIZEOF_INT32; n -= SIZEOF_INT32) {
- r = genrand_int32(&rnd->mt);
- i = SIZEOF_INT32;
- do {
- *ptr++ = (char)r;
- r >>= CHAR_BIT;
- } while (--i);
- }
- if (n > 0) {
- r = genrand_int32(&rnd->mt);
- do {
- *ptr++ = (char)r;
- r >>= CHAR_BIT;
- } while (--n);
- }
- return bytes;
-}
-
-static VALUE
-range_values(VALUE vmax, VALUE *begp)
-{
- VALUE end, r, one = INT2FIX(1);
- int excl;
-
- if (!rb_range_values(vmax, begp, &end, &excl)) return Qfalse;
- if (!rb_respond_to(end, id_minus)) return Qfalse;
- r = rb_funcall2(end, id_minus, 1, begp);
- if (NIL_P(r)) return Qfalse;
- if (!excl && rb_respond_to(r, id_plus)) {
- r = rb_funcall2(r, id_plus, 1, &one);
- if (NIL_P(r)) return Qfalse;
- }
- return r;
-}
-
-static inline VALUE
-add_to_begin(VALUE beg, VALUE offset)
-{
- if (beg == Qundef) return offset;
- return rb_funcall2(beg, id_plus, 1, &offset);
-}
-
-static VALUE
-rand_int(struct MT *mt, VALUE vmax)
-{
- if (FIXNUM_P(vmax)) {
- long max = FIX2LONG(vmax);
- unsigned long r;
- if (!max) return Qnil;
- r = limited_rand(mt, (unsigned long)(max < 0 ? -max : max) - 1);
- return ULONG2NUM(r);
- }
- else {
- struct RBignum *limit = (struct RBignum *)vmax;
- if (rb_bigzero_p(vmax)) return Qnil;
- if (!RBIGNUM_SIGN(limit)) {
- limit = (struct RBignum *)rb_big_clone(vmax);
- RBIGNUM_SET_SIGN(limit, 1);
- }
- limit = (struct RBignum *)rb_big_minus((VALUE)limit, INT2FIX(1));
- if (FIXNUM_P((VALUE)limit)) {
- if (FIX2LONG((VALUE)limit) == -1)
- return Qnil;
- return LONG2NUM(limited_rand(mt, FIX2LONG((VALUE)limit)));
- }
- return limited_big_rand(mt, limit);
- }
-}
-
-/*
- * call-seq: prng.int(limit) -> integer
- *
- * When the argument is an +Integer+ or a +Bignum+, it returns a
- * random integer greater than or equal to zero and less than the
- * argument. Unlike Random#rand, when the argument is a negative
- * integer or zero, it raises an ArgumentError.
- *
- * When the argument _limit_ is a +Range+, it returns a random
- * integer from integers where range.member?(integer) == true.
- * prng.int(5..9) # => one of [5, 6, 7, 8, 9]
- * prng.int(5...9) # => one of [5, 6, 7, 8]
- *
- * +begin+/+end+ of the range have to have subtruct and add methods.
- *
- * Otherwise, it raises an ArgumentError.
- */
-static VALUE
-random_int(VALUE obj, VALUE vmax)
-{
- VALUE v, beg = Qundef;
- rb_random_t *rnd = get_rnd(obj);
-
- v = rb_check_to_integer(vmax, "to_int");
- if (NIL_P(v)) {
- /* range like object support */
- if (!(v = range_values(vmax, &beg))) {
- beg = Qundef;
- NUM2LONG(vmax);
- }
- }
- v = rand_int(&rnd->mt, v);
- if (NIL_P(v)) v = INT2FIX(0);
- return add_to_begin(beg, v);
-}
-
-/*
- * call-seq:
- * prng.float -> float
- * prng.float([max=1.0]) -> float
- *
- * Returns a random floating point number between 0.0 and _max_,
- * including 0.0 and excluding _max_.
- */
-static VALUE
-random_float(int argc, VALUE *argv, VALUE obj)
-{
- rb_random_t *rnd = get_rnd(obj);
- VALUE vmax, beg = Qundef;
- double max = 0, r;
-
- switch (argc) {
- case 0:
- break;
- case 1:
- vmax = argv[0];
- if (TYPE(vmax) == T_FLOAT ||
- !NIL_P(vmax = rb_to_float(vmax)) ||
- (vmax = range_values(vmax, &beg)) != Qfalse) {
- max = RFLOAT_VALUE(vmax);
- }
- else {
- beg = Qundef;
- Check_Type(argv[0], T_FLOAT);
- }
- break;
- default:
- rb_scan_args(argc, argv, "01", 0);
- break;
- }
- r = genrand_real(&rnd->mt);
- if (argc) r *= max;
- return add_to_begin(beg, rb_float_new(r));
-}
-
-/*
- * call-seq:
- * prng1 == prng2 -> true or false
- *
- * Returns true if the generators' states equal.
- */
-static VALUE
-random_equal(VALUE self, VALUE other)
-{
- rb_random_t *r1, *r2;
- if (rb_obj_class(self) != rb_obj_class(other)) return Qfalse;
- r1 = get_rnd(self);
- r2 = get_rnd(other);
- if (!RTEST(rb_funcall2(r1->seed, rb_intern("=="), 1, &r2->seed))) return Qfalse;
- if (memcmp(r1->mt.state, r2->mt.state, sizeof(r1->mt.state))) return Qfalse;
- if ((r1->mt.next - r1->mt.state) != (r2->mt.next - r2->mt.state)) return Qfalse;
- if (r1->mt.left != r2->mt.left) return Qfalse;
- return Qtrue;
-}
-
/*
* call-seq:
* rand(max=0) => number
- *
+ *
* Converts <i>max</i> to an integer using max1 =
* max<code>.to_i.abs</code>. If the result is zero, returns a
* pseudorandom floating point number greater than or equal to 0.0 and
@@ -948,7 +425,7 @@ random_equal(VALUE self, VALUE other)
* may be used to ensure repeatable sequences of random numbers between
* different runs of the program. Ruby currently uses a modified
* Mersenne Twister with a period of 2**19937-1.
- *
+ *
* srand 1234 #=> 0
* [ rand, rand ] #=> [0.191519450163469, 0.49766366626136]
* [ rand(10), rand(1000) ] #=> [6, 817]
@@ -957,71 +434,67 @@ random_equal(VALUE self, VALUE other)
*/
static VALUE
-rb_f_rand(int argc, VALUE *argv, VALUE obj)
+rb_f_rand(argc, argv, obj)
+ int argc;
+ VALUE *argv;
+ VALUE obj;
{
- VALUE vmax, r;
- struct MT *mt = &default_rand.rnd.mt;
+ VALUE vmax;
+ long val, max;
- if (!genrand_initialized(mt)) {
- rand_init(mt, random_seed());
- }
- if (argc == 0) goto zero_arg;
rb_scan_args(argc, argv, "01", &vmax);
- if (NIL_P(vmax)) goto zero_arg;
- vmax = rb_to_int(vmax);
- if (vmax == INT2FIX(0) || NIL_P(r = rand_int(mt, vmax))) {
- zero_arg:
- return DBL2NUM(genrand_real(mt));
+ switch (TYPE(vmax)) {
+ case T_FLOAT:
+ if (RFLOAT(vmax)->value <= LONG_MAX && RFLOAT(vmax)->value >= LONG_MIN) {
+ max = (long)RFLOAT(vmax)->value;
+ break;
+ }
+ if (RFLOAT(vmax)->value < 0)
+ vmax = rb_dbl2big(-RFLOAT(vmax)->value);
+ else
+ vmax = rb_dbl2big(RFLOAT(vmax)->value);
+ /* fall through */
+ case T_BIGNUM:
+ bignum:
+ {
+ struct RBignum *limit = (struct RBignum *)vmax;
+ if (!limit->sign) {
+ limit = (struct RBignum *)rb_big_clone(vmax);
+ limit->sign = 1;
+ }
+ limit = (struct RBignum *)rb_big_minus((VALUE)limit, INT2FIX(1));
+ if (FIXNUM_P((VALUE)limit)) {
+ if (FIX2LONG((VALUE)limit) == -1)
+ return rb_float_new(rb_genrand_real());
+ return LONG2NUM(limited_rand(FIX2LONG((VALUE)limit)));
+ }
+ return limited_big_rand(limit);
+ }
+ case T_NIL:
+ max = 0;
+ break;
+ default:
+ vmax = rb_Integer(vmax);
+ if (TYPE(vmax) == T_BIGNUM) goto bignum;
+ /* fall through */
+ case T_FIXNUM:
+ max = FIX2LONG(vmax);
+ break;
}
- return r;
-}
-
-void
-Init_RandomSeed(void)
-{
- fill_random_seed(default_rand.initial);
- init_by_array(&default_rand.rnd.mt, default_rand.initial, DEFAULT_SEED_CNT);
-}
-static void
-Init_RandomSeed2(void)
-{
- default_rand.rnd.seed = make_seed_value(default_rand.initial);
- memset(default_rand.initial, 0, DEFAULT_SEED_LEN);
-}
-
-void
-rb_reset_random_seed(void)
-{
- uninit_genrand(&default_rand.rnd.mt);
- default_rand.rnd.seed = INT2FIX(0);
+ if (max == 0) {
+ return rb_float_new(rb_genrand_real());
+ }
+ if (max < 0) max = -max;
+ val = limited_rand(max-1);
+ return LONG2NUM(val);
}
void
-Init_Random(void)
+Init_Random()
{
- Init_RandomSeed2();
+ rand_init(random_seed());
rb_define_global_function("srand", rb_f_srand, -1);
rb_define_global_function("rand", rb_f_rand, -1);
- rb_global_variable(&default_rand.rnd.seed);
-
- rb_cRandom = rb_define_class("Random", rb_cObject);
- rb_define_alloc_func(rb_cRandom, random_alloc);
- rb_define_method(rb_cRandom, "initialize", random_init, -1);
- rb_define_method(rb_cRandom, "int", random_int, 1);
- rb_define_method(rb_cRandom, "bytes", random_bytes, 1);
- rb_define_method(rb_cRandom, "float", random_float, -1);
- rb_define_method(rb_cRandom, "seed", random_get_seed, 0);
- rb_define_method(rb_cRandom, "initialize_copy", random_copy, 1);
- rb_define_method(rb_cRandom, "marshal_dump", random_dump, 0);
- rb_define_method(rb_cRandom, "marshal_load", random_load, 1);
- rb_define_method(rb_cRandom, "state", random_state, 0);
- rb_define_method(rb_cRandom, "left", random_left, 0);
- rb_define_method(rb_cRandom, "==", random_equal, 1);
-
- rb_define_singleton_method(rb_cRandom, "srand", rb_f_srand, -1);
- rb_define_singleton_method(rb_cRandom, "rand", rb_f_rand, -1);
- rb_define_singleton_method(rb_cRandom, "new_seed", random_seed, 0);
- rb_define_singleton_method(rb_cRandom, "state", random_s_state, 0);
- rb_define_singleton_method(rb_cRandom, "left", random_s_left, 0);
+ rb_global_variable(&saved_seed);
}
diff --git a/range.c b/range.c
index e013a8a13f..864ca9fb28 100644
--- a/range.c
+++ b/range.c
@@ -3,63 +3,61 @@
range.c -
$Author$
+ $Date$
created at: Thu Aug 19 17:46:47 JST 1993
- Copyright (C) 1993-2007 Yukihiro Matsumoto
+ Copyright (C) 1993-2003 Yukihiro Matsumoto
**********************************************************************/
-#include "ruby/ruby.h"
-#include "ruby/encoding.h"
+#include "ruby.h"
VALUE rb_cRange;
static ID id_cmp, id_succ, id_beg, id_end, id_excl;
-extern VALUE rb_struct_init_copy(VALUE copy, VALUE s);
-
-#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])
-
-#define EXCL(r) RTEST(RANGE_EXCL(r))
-#define SET_EXCL(r,v) (RSTRUCT(r)->as.ary[2] = (v) ? Qtrue : Qfalse)
+#define EXCL(r) RTEST(rb_ivar_get((r), id_excl))
+#define SET_EXCL(r,v) rb_ivar_set((r), id_excl, (v) ? Qtrue : Qfalse)
static VALUE
-range_failed(void)
+range_failed()
{
rb_raise(rb_eArgError, "bad value for range");
return Qnil; /* dummy */
}
static VALUE
-range_check(VALUE *args)
+range_check(args)
+ VALUE *args;
{
return rb_funcall(args[0], id_cmp, 1, args[1]);
}
static void
-range_init(VALUE range, VALUE beg, VALUE end, int exclude_end)
+range_init(range, beg, end, exclude_end)
+ VALUE range, beg, end;
+ int exclude_end;
{
VALUE args[2];
args[0] = beg;
args[1] = end;
-
+
if (!FIXNUM_P(beg) || !FIXNUM_P(end)) {
VALUE v;
v = rb_rescue(range_check, (VALUE)args, range_failed, 0);
- if (NIL_P(v))
- range_failed();
+ if (NIL_P(v)) range_failed();
}
SET_EXCL(range, exclude_end);
- RSTRUCT(range)->as.ary[0] = beg;
- RSTRUCT(range)->as.ary[1] = end;
+ rb_ivar_set(range, id_beg, beg);
+ rb_ivar_set(range, id_end, end);
}
VALUE
-rb_range_new(VALUE beg, VALUE end, int exclude_end)
+rb_range_new(beg, end, exclude_end)
+ VALUE beg, end;
+ int exclude_end;
{
VALUE range = rb_obj_alloc(rb_cRange);
@@ -70,37 +68,40 @@ rb_range_new(VALUE beg, VALUE end, int exclude_end)
/*
* call-seq:
* Range.new(start, end, exclusive=false) => range
- *
+ *
* Constructs a range using the given <i>start</i> and <i>end</i>. If the third
* parameter is omitted or is <code>false</code>, the <i>range</i> will include
* the end object; otherwise, it will be excluded.
*/
static VALUE
-range_initialize(int argc, VALUE *argv, VALUE range)
+range_initialize(argc, argv, range)
+ int argc;
+ VALUE *argv;
+ VALUE range;
{
VALUE beg, end, flags;
-
+
rb_scan_args(argc, argv, "21", &beg, &end, &flags);
/* Ranges are immutable, so that they should be initialized only once. */
- if (RANGE_EXCL(range) != Qnil) {
+ if (rb_ivar_defined(range, id_beg)) {
rb_name_error(rb_intern("initialize"), "`initialize' called twice");
}
range_init(range, beg, end, RTEST(flags));
return Qnil;
}
-#define range_initialize_copy rb_struct_init_copy /* :nodoc: */
/*
* call-seq:
* rng.exclude_end? => true or false
- *
+ *
* Returns <code>true</code> if <i>rng</i> excludes its end value.
*/
static VALUE
-range_exclude_end_p(VALUE range)
+range_exclude_end_p(range)
+ VALUE range;
{
return EXCL(range) ? Qtrue : Qfalse;
}
@@ -109,61 +110,57 @@ range_exclude_end_p(VALUE range)
/*
* call-seq:
* rng == obj => true or false
- *
+ *
* Returns <code>true</code> only if <i>obj</i> is a Range, has equivalent
* beginning and end items (by comparing them with <code>==</code>), and has
- * the same <code>exclude_end?</code> setting as <i>rng</i>.
- *
+ * the same #exclude_end? setting as <i>rng</t>.
+ *
* (0..2) == (0..2) #=> true
* (0..2) == Range.new(0,2) #=> true
* (0..2) == (0...2) #=> false
- *
+ *
*/
static VALUE
-range_eq(VALUE range, VALUE obj)
+range_eq(range, obj)
+ VALUE range, obj;
{
- if (range == obj)
- return Qtrue;
+ if (range == obj) return Qtrue;
if (!rb_obj_is_instance_of(obj, rb_obj_class(range)))
return Qfalse;
- if (!rb_equal(RANGE_BEG(range), RANGE_BEG(obj)))
+ if (!rb_equal(rb_ivar_get(range, id_beg), rb_ivar_get(obj, id_beg)))
return Qfalse;
- if (!rb_equal(RANGE_END(range), RANGE_END(obj)))
+ if (!rb_equal(rb_ivar_get(range, id_end), rb_ivar_get(obj, id_end)))
return Qfalse;
- if (EXCL(range) != EXCL(obj))
- return Qfalse;
+ if (EXCL(range) != EXCL(obj)) return Qfalse;
return Qtrue;
}
static int
-r_lt(VALUE a, VALUE b)
+r_lt(a, b)
+ VALUE a, b;
{
VALUE r = rb_funcall(a, id_cmp, 1, b);
- if (NIL_P(r))
- return Qfalse;
- if (rb_cmpint(r, a, b) < 0)
- return Qtrue;
+ if (NIL_P(r)) return Qfalse;
+ if (rb_cmpint(r, a, b) < 0) return Qtrue;
return Qfalse;
}
static int
-r_le(VALUE a, VALUE b)
+r_le(a, b)
+ VALUE a, b;
{
int c;
VALUE r = rb_funcall(a, id_cmp, 1, b);
- if (NIL_P(r))
- return Qfalse;
+ if (NIL_P(r)) return Qfalse;
c = rb_cmpint(r, a, b);
- if (c == 0)
- return (int)INT2FIX(0);
- if (c < 0)
- return Qtrue;
+ if (c == 0) return INT2FIX(0);
+ if (c < 0) return Qtrue;
return Qfalse;
}
@@ -171,56 +168,35 @@ r_le(VALUE a, VALUE b)
/*
* call-seq:
* rng.eql?(obj) => true or false
- *
+ *
* Returns <code>true</code> only if <i>obj</i> is a Range, has equivalent
* beginning and end items (by comparing them with #eql?), and has the same
* #exclude_end? setting as <i>rng</i>.
- *
- * (0..2).eql?(0..2) #=> true
- * (0..2).eql?(Range.new(0,2)) #=> true
- * (0..2).eql?(0...2) #=> false
- *
+ *
+ * (0..2) == (0..2) #=> true
+ * (0..2) == Range.new(0,2) #=> true
+ * (0..2) == (0...2) #=> false
+ *
*/
static VALUE
-range_eql(VALUE range, VALUE obj)
+range_eql(range, obj)
+ VALUE range, obj;
{
- if (range == obj)
- return Qtrue;
+ if (range == obj) return Qtrue;
if (!rb_obj_is_instance_of(obj, rb_obj_class(range)))
return Qfalse;
- if (!rb_eql(RANGE_BEG(range), RANGE_BEG(obj)))
+ if (!rb_eql(rb_ivar_get(range, id_beg), rb_ivar_get(obj, id_beg)))
return Qfalse;
- if (!rb_eql(RANGE_END(range), RANGE_END(obj)))
+ if (!rb_eql(rb_ivar_get(range, id_end), rb_ivar_get(obj, id_end)))
return Qfalse;
- if (EXCL(range) != EXCL(obj))
- return Qfalse;
+ if (EXCL(range) != EXCL(obj)) return Qfalse;
return Qtrue;
}
-static VALUE
-recursive_hash(VALUE range, VALUE dummy, int recur)
-{
- unsigned long hash = EXCL(range);
- VALUE v;
-
- if (recur) {
- rb_raise(rb_eArgError, "recursive key for hash");
- }
- hash = rb_hash_start(hash);
- v = rb_hash(RANGE_BEG(range));
- hash = rb_hash_uint(hash, NUM2LONG(v));
- v = rb_hash(RANGE_END(range));
- hash = rb_hash_uint(hash, NUM2LONG(v));
- hash = rb_hash_uint(hash, EXCL(range) << 24);
- hash = rb_hash_end(hash);
-
- return LONG2FIX(hash);
-}
-
/*
* call-seq:
* rng.hash => fixnum
@@ -231,39 +207,58 @@ recursive_hash(VALUE range, VALUE dummy, int recur)
*/
static VALUE
-range_hash(VALUE range)
+range_hash(range)
+ VALUE range;
{
- return rb_exec_recursive(recursive_hash, range, 0);
+ long hash = EXCL(range);
+ VALUE v;
+
+ v = rb_hash(rb_ivar_get(range, id_beg));
+ hash ^= v << 1;
+ v = rb_hash(rb_ivar_get(range, id_end));
+ hash ^= v << 9;
+ hash ^= EXCL(range) << 24;
+
+ return LONG2FIX(hash);
+}
+
+static VALUE
+str_step(args)
+ VALUE *args;
+{
+ return rb_str_upto(args[0], args[1], EXCL(args[2]));
}
static void
-range_each_func(VALUE range, VALUE (*func) (VALUE, void *), void *arg)
+range_each_func(range, func, v, e, arg)
+ VALUE range;
+ void (*func) _((VALUE, void*));
+ VALUE v, e;
+ void *arg;
{
int c;
- VALUE b = RANGE_BEG(range);
- VALUE e = RANGE_END(range);
- VALUE v = b;
if (EXCL(range)) {
while (r_lt(v, e)) {
- (*func) (v, arg);
+ (*func)(v, arg);
v = rb_funcall(v, id_succ, 0, 0);
}
}
else {
- while ((c = r_le(v, e)) != Qfalse) {
- (*func) (v, arg);
- if (c == (int)INT2FIX(0))
- break;
+ while (RTEST(c = r_le(v, e))) {
+ (*func)(v, arg);
+ if (c == INT2FIX(0)) break;
v = rb_funcall(v, id_succ, 0, 0);
}
}
}
static VALUE
-step_i(VALUE i, void *arg)
+step_i(i, arg)
+ VALUE i;
+ VALUE arg;
{
- VALUE *iter = arg;
+ VALUE *iter = (VALUE *)arg;
if (FIXNUM_P(iter[0])) {
iter[0] -= INT2FIX(1) & ~FIXNUM_FLAG;
@@ -278,24 +273,24 @@ step_i(VALUE i, void *arg)
return Qnil;
}
-extern int ruby_float_step(VALUE from, VALUE to, VALUE step, int excl);
+extern int ruby_float_step _((VALUE from, VALUE to, VALUE step, int excl));
/*
* call-seq:
* rng.step(n=1) {| obj | block } => rng
- *
+ *
* Iterates over <i>rng</i>, passing each <i>n</i>th element to the block. If
* the range contains numbers, <i>n</i> is added for each iteration. Otherwise
* <code>step</code> invokes <code>succ</code> to iterate through range
* elements. The following code uses class <code>Xs</code>, which is defined
* in the class-level documentation.
- *
+ *
* range = Xs.new(1)..Xs.new(10)
* range.step(2) {|x| puts x}
* range.step(3) {|x| puts x}
- *
+ *
* <em>produces:</em>
- *
+ *
* 1 x
* 3 xxx
* 5 xxxxx
@@ -309,14 +304,17 @@ extern int ruby_float_step(VALUE from, VALUE to, VALUE step, int excl);
static VALUE
-range_step(int argc, VALUE *argv, VALUE range)
+range_step(argc, argv, range)
+ int argc;
+ VALUE *argv;
+ VALUE range;
{
VALUE b, e, step, tmp;
RETURN_ENUMERATOR(range, argc, argv);
- b = RANGE_BEG(range);
- e = RANGE_END(range);
+ b = rb_ivar_get(range, id_beg);
+ e = rb_ivar_get(range, id_end);
if (argc == 0) {
step = INT2FIX(1);
}
@@ -339,7 +337,7 @@ range_step(int argc, VALUE *argv, VALUE range)
if (!EXCL(range))
end += 1;
- i = FIX2LONG(b);
+ i = FIX2LONG(b);
while (i < end) {
rb_yield(LONG2NUM(i));
if (i + unit < i) break;
@@ -354,20 +352,17 @@ range_step(int argc, VALUE *argv, VALUE range)
!NIL_P(rb_check_to_integer(b, "to_int")) ||
!NIL_P(rb_check_to_integer(e, "to_int"))) {
ID op = EXCL(range) ? '<' : rb_intern("<=");
- VALUE v = b;
- int i = 0;
- while (RTEST(rb_funcall(v, op, 1, e))) {
- rb_yield(v);
- i++;
- v = rb_funcall(b, '+', 1, rb_funcall(INT2NUM(i), '*', 1, step));
+ while (RTEST(rb_funcall(b, op, 1, e))) {
+ rb_yield(b);
+ b = rb_funcall(b, '+', 1, step);
}
}
else {
tmp = rb_check_string_type(b);
if (!NIL_P(tmp)) {
- VALUE args[2], iter[2];
+ VALUE args[5], iter[2];
b = tmp;
args[0] = e;
@@ -376,6 +371,16 @@ range_step(int argc, VALUE *argv, VALUE range)
iter[1] = step;
rb_block_call(b, rb_intern("upto"), 2, args, step_i, (VALUE)iter);
}
+ else if (rb_obj_is_kind_of(b, rb_cNumeric) ||
+ !NIL_P(rb_check_to_integer(b, "to_int")) ||
+ !NIL_P(rb_check_to_integer(e, "to_int"))) {
+ ID c = EXCL(range) ? '<' : rb_intern("<=");
+
+ while (RTEST(rb_funcall(b, c, 1, e))) {
+ rb_yield(b);
+ b = rb_funcall(b, '+', 1, step);
+ }
+ }
else {
VALUE args[2];
@@ -385,286 +390,137 @@ range_step(int argc, VALUE *argv, VALUE range)
}
args[0] = INT2FIX(1);
args[1] = step;
- range_each_func(range, step_i, args);
+ range_each_func(range, step_i, b, e, args);
}
}
return range;
}
-static VALUE
-each_i(VALUE v, void *arg)
+static void
+each_i(v, arg)
+ VALUE v;
+ void *arg;
{
rb_yield(v);
- return Qnil;
}
/*
* call-seq:
* rng.each {| i | block } => rng
- *
+ *
* Iterates over the elements <i>rng</i>, passing each in turn to the
* block. You can only iterate if the start object of the range
* supports the +succ+ method (which means that you can't iterate over
* ranges of +Float+ objects).
- *
+ *
* (10..15).each do |n|
* print n, ' '
* end
- *
+ *
* <em>produces:</em>
- *
+ *
* 10 11 12 13 14 15
*/
static VALUE
-range_each(VALUE range)
+range_each(range)
+ VALUE range;
{
VALUE beg, end;
RETURN_ENUMERATOR(range, 0, 0);
- beg = RANGE_BEG(range);
- end = RANGE_END(range);
+ beg = rb_ivar_get(range, id_beg);
+ end = rb_ivar_get(range, id_end);
+ if (!rb_respond_to(beg, id_succ)) {
+ rb_raise(rb_eTypeError, "can't iterate from %s",
+ rb_obj_classname(beg));
+ }
if (FIXNUM_P(beg) && FIXNUM_P(end)) { /* fixnums are special */
long lim = FIX2LONG(end);
long i;
- if (!EXCL(range))
- lim += 1;
- for (i = FIX2LONG(beg); i < lim; i++) {
- rb_yield(LONG2FIX(i));
+ if (!EXCL(range)) lim += 1;
+ for (i=FIX2LONG(beg); i<lim; i++) {
+ rb_yield(LONG2NUM(i));
}
}
else if (TYPE(beg) == T_STRING) {
- VALUE args[2];
+ VALUE args[5], iter[2];
- args[0] = end;
- args[1] = EXCL(range) ? Qtrue : Qfalse;
- rb_block_call(beg, rb_intern("upto"), 2, args, rb_yield, 0);
+ args[0] = beg; args[1] = end; args[2] = range;
+ iter[0] = INT2FIX(1); iter[1] = INT2FIX(1);
+ rb_iterate((VALUE(*)_((VALUE)))str_step, (VALUE)args, step_i,
+ (VALUE)iter);
}
else {
- if (!rb_respond_to(beg, id_succ)) {
- rb_raise(rb_eTypeError, "can't iterate from %s",
- rb_obj_classname(beg));
- }
- range_each_func(range, each_i, NULL);
+ range_each_func(range, each_i, beg, end, NULL);
}
return range;
}
/*
* call-seq:
+ * rng.first => obj
* rng.begin => obj
- *
+ *
* Returns the first object in <i>rng</i>.
*/
static VALUE
-range_begin(VALUE range)
+range_first(range)
+ VALUE range;
{
- return RANGE_BEG(range);
+ return rb_ivar_get(range, id_beg);
}
/*
* call-seq:
* rng.end => obj
- *
+ * rng.last => obj
+ *
* Returns the object that defines the end of <i>rng</i>.
- *
+ *
* (1..10).end #=> 10
* (1...10).end #=> 10
*/
static VALUE
-range_end(VALUE range)
-{
- return RANGE_END(range);
-}
-
-
-static VALUE
-first_i(VALUE i, VALUE *ary)
-{
- long n = NUM2LONG(ary[0]);
-
- if (n <= 0) {
- rb_iter_break();
- }
- rb_ary_push(ary[1], i);
- n--;
- ary[0] = INT2NUM(n);
- return Qnil;
-}
-
-/*
- * call-seq:
- * rng.first => obj
- * rng.first(n) => an_array
- *
- * Returns the first object in <i>rng</i>, or the first +n+ elements.
- */
-
-static VALUE
-range_first(int argc, VALUE *argv, VALUE range)
-{
- VALUE n, ary[2];
-
- if (argc == 0) return RANGE_BEG(range);
-
- rb_scan_args(argc, argv, "1", &n);
- ary[0] = n;
- ary[1] = rb_ary_new2(NUM2LONG(n));
- rb_block_call(range, rb_intern("each"), 0, 0, first_i, (VALUE)ary);
-
- return ary[1];
-}
-
-
-/*
- * call-seq:
- * rng.last => obj
- * rng.last(n) => an_array
- *
- * Returns the last object in <i>rng</i>, or the last +n+ elements.
- */
-
-static VALUE
-range_last(int argc, VALUE *argv, VALUE range)
-{
- VALUE rb_ary_last(int, VALUE *, VALUE);
-
- if (argc == 0) return RANGE_END(range);
- return rb_ary_last(argc, argv, rb_Array(range));
-}
-
-
-/*
- * call-seq:
- * rng.min => obj
- * rng.min {| a,b | block } => obj
- *
- * Returns the minimum value in <i>rng</i>. The second uses
- * the block to compare values. Returns nil if the first
- * value in range is larger than the last value.
- *
- */
-
-
-static VALUE
-range_min(VALUE range)
-{
- if (rb_block_given_p()) {
- return rb_call_super(0, 0);
- }
- else {
- VALUE b = RANGE_BEG(range);
- VALUE e = RANGE_END(range);
- int c = rb_cmpint(rb_funcall(b, id_cmp, 1, e), b, e);
-
- if (c > 0 || (c == 0 && EXCL(range)))
- return Qnil;
- return b;
- }
-}
-
-/*
- * call-seq:
- * rng.max => obj
- * rng.max {| a,b | block } => obj
- *
- * Returns the maximum value in <i>rng</i>. The second uses
- * the block to compare values. Returns nil if the first
- * value in range is larger than the last value.
- *
- */
-
-static VALUE
-range_max(VALUE range)
+range_last(range)
+ VALUE range;
{
- VALUE e = RANGE_END(range);
- int nm = FIXNUM_P(e) || rb_obj_is_kind_of(e, rb_cNumeric);
-
- if (rb_block_given_p() || (EXCL(range) && !nm)) {
- return rb_call_super(0, 0);
- }
- else {
- VALUE b = RANGE_BEG(range);
- int c = rb_cmpint(rb_funcall(b, id_cmp, 1, e), b, e);
-
- if (c > 0)
- return Qnil;
- if (EXCL(range)) {
- if (!FIXNUM_P(e) && !rb_obj_is_kind_of(e, rb_cInteger)) {
- rb_raise(rb_eTypeError, "cannot exclude non Integer end value");
- }
- if (c == 0) return Qnil;
- if (FIXNUM_P(e)) {
- return LONG2NUM(FIX2LONG(e) - 1);
- }
- return rb_funcall(e, '-', 1, INT2FIX(1));
- }
- return e;
- }
+ return rb_ivar_get(range, id_end);
}
-int
-rb_range_values(VALUE range, VALUE *begp, VALUE *endp, int *exclp)
+VALUE
+rb_range_beg_len(range, begp, lenp, len, err)
+ VALUE range;
+ long *begp, *lenp;
+ long len;
+ int err;
{
- VALUE b, e;
- int excl;
+ long beg, end, b, e;
- if (rb_obj_is_kind_of(range, rb_cRange)) {
- b = RANGE_BEG(range);
- e = RANGE_END(range);
- excl = EXCL(range);
- }
- else {
- if (!rb_respond_to(range, id_beg)) return Qfalse;
- if (!rb_respond_to(range, id_end)) return Qfalse;
- b = rb_funcall(range, id_beg, 0);
- e = rb_funcall(range, id_end, 0);
- excl = RTEST(rb_funcall(range, rb_intern("exclude_end?"), 0));
- }
- *begp = b;
- *endp = e;
- *exclp = excl;
- return Qtrue;
-}
+ if (!rb_obj_is_kind_of(range, rb_cRange)) return Qfalse;
-VALUE
-rb_range_beg_len(VALUE range, long *begp, long *lenp, long len, int err)
-{
- long beg, end, origbeg, origend;
- VALUE b, e;
- int excl;
+ beg = b = NUM2LONG(rb_ivar_get(range, id_beg));
+ end = e = NUM2LONG(rb_ivar_get(range, id_end));
- if (!rb_range_values(range, &b, &e, &excl))
- return Qfalse;
- beg = NUM2LONG(b);
- end = NUM2LONG(e);
- origbeg = beg;
- origend = end;
if (beg < 0) {
beg += len;
- if (beg < 0)
- goto out_of_range;
+ if (beg < 0) goto out_of_range;
}
if (err == 0 || err == 2) {
- if (beg > len)
- goto out_of_range;
- if (end > len)
- end = len;
+ if (beg > len) goto out_of_range;
+ if (end > len) end = len;
}
- if (end < 0)
- end += len;
- if (!excl)
- end++; /* include end point */
+ if (end < 0) end += len;
+ if (!EXCL(range)) end++; /* include end point */
len = end - beg;
- if (len < 0)
- len = 0;
+ if (len < 0) len = 0;
*begp = beg;
*lenp = len;
@@ -673,7 +529,7 @@ rb_range_beg_len(VALUE range, long *begp, long *lenp, long len, int err)
out_of_range:
if (err) {
rb_raise(rb_eRangeError, "%ld..%s%ld out of range",
- origbeg, excl ? "." : "", origend);
+ b, EXCL(range)? "." : "", e);
}
return Qnil;
}
@@ -686,32 +542,15 @@ rb_range_beg_len(VALUE range, long *begp, long *lenp, long len, int err)
*/
static VALUE
-range_to_s(VALUE range)
-{
- VALUE str, str2;
-
- str = rb_obj_as_string(RANGE_BEG(range));
- str2 = rb_obj_as_string(RANGE_END(range));
- str = rb_str_dup(str);
- rb_str_cat(str, "...", EXCL(range) ? 3 : 2);
- rb_str_append(str, str2);
- OBJ_INFECT(str, str2);
-
- return str;
-}
-
-static VALUE
-inspect_range(VALUE range, VALUE dummy, int recur)
+range_to_s(range)
+ VALUE range;
{
VALUE str, str2;
- if (recur) {
- return rb_str_new2(EXCL(range) ? "(... ... ...)" : "(... .. ...)");
- }
- str = rb_inspect(RANGE_BEG(range));
- str2 = rb_inspect(RANGE_END(range));
+ str = rb_obj_as_string(rb_ivar_get(range, id_beg));
+ str2 = rb_obj_as_string(rb_ivar_get(range, id_end));
str = rb_str_dup(str);
- rb_str_cat(str, "...", EXCL(range) ? 3 : 2);
+ rb_str_cat(str, "...", EXCL(range)?3:2);
rb_str_append(str, str2);
OBJ_INFECT(str, str2);
@@ -722,173 +561,69 @@ inspect_range(VALUE range, VALUE dummy, int recur)
* call-seq:
* rng.inspect => string
*
- * Convert this range object to a printable form (using
+ * Convert this range object to a printable form (using
* <code>inspect</code> to convert the start and end
* objects).
*/
static VALUE
-range_inspect(VALUE range)
+range_inspect(range)
+ VALUE range;
{
- return rb_exec_recursive(inspect_range, range, 0);
+ VALUE str, str2;
+
+ str = rb_inspect(rb_ivar_get(range, id_beg));
+ str2 = rb_inspect(rb_ivar_get(range, id_end));
+ str = rb_str_dup(str);
+ rb_str_cat(str, "...", EXCL(range)?3:2);
+ rb_str_append(str, str2);
+ OBJ_INFECT(str, str2);
+
+ return str;
}
/*
* call-seq:
* rng === obj => true or false
- *
+ * rng.member?(val) => true or false
+ * rng.include?(val) => true or false
+ *
* Returns <code>true</code> if <i>obj</i> is an element of
* <i>rng</i>, <code>false</code> otherwise. Conveniently,
* <code>===</code> is the comparison operator used by
* <code>case</code> statements.
- *
+ *
* case 79
* when 1..50 then print "low\n"
* when 51..75 then print "medium\n"
* when 76..100 then print "high\n"
* end
- *
+ *
* <em>produces:</em>
- *
+ *
* high
*/
static VALUE
-range_eqq(VALUE range, VALUE val)
-{
- return rb_funcall(range, rb_intern("include?"), 1, val);
-}
-
-
-/*
- * call-seq:
- * rng.member?(val) => true or false
- * rng.include?(val) => true or false
- *
- * Returns <code>true</code> if <i>obj</i> is an element of
- * <i>rng</i>, <code>false</code> otherwise. If beg and end are
- * numeric, comparison is done according magnitude of values.
- *
- * ("a".."z").include?("g") # => true
- * ("a".."z").include?("A") # => false
- */
-
-static VALUE
-range_include(VALUE range, VALUE val)
-{
- VALUE beg = RANGE_BEG(range);
- VALUE end = RANGE_END(range);
- int nv = FIXNUM_P(beg) || FIXNUM_P(end) ||
- rb_obj_is_kind_of(beg, rb_cNumeric) ||
- rb_obj_is_kind_of(end, rb_cNumeric);
-
- if (nv ||
- !NIL_P(rb_check_to_integer(beg, "to_int")) ||
- !NIL_P(rb_check_to_integer(end, "to_int"))) {
- if (r_le(beg, val)) {
- if (EXCL(range)) {
- if (r_lt(val, end))
- return Qtrue;
- }
- else {
- if (r_le(val, end))
- return Qtrue;
- }
- }
- return Qfalse;
- }
- else if (TYPE(beg) == T_STRING && TYPE(end) == T_STRING &&
- RSTRING_LEN(beg) == 1 && RSTRING_LEN(end) == 1) {
- if (NIL_P(val)) return Qfalse;
- if (TYPE(val) == T_STRING) {
- if (RSTRING_LEN(val) == 0 || RSTRING_LEN(val) > 1)
- return Qfalse;
- else {
- char b = RSTRING_PTR(beg)[0];
- char e = RSTRING_PTR(end)[0];
- char v = RSTRING_PTR(val)[0];
-
- if (ISASCII(b) && ISASCII(e) && ISASCII(v)) {
- if (b <= v && v < e) return Qtrue;
- if (!EXCL(range) && v == e) return Qtrue;
- return Qfalse;
- }
- }
- }
- }
- /* TODO: ruby_frame->this_func = rb_intern("include?"); */
- return rb_call_super(1, &val);
-}
-
-
-/*
- * call-seq:
- * rng.cover?(val) => true or false
- *
- * Returns <code>true</code> if <i>obj</i> is between beg and end,
- * i.e <code>beg <= obj <= end</code> (or <i>end</i> exclusive when
- * <code>exclude_end?</code> is true).
- *
- * ("a".."z").cover?("c") #=> true
- * ("a".."z").cover?("5") #=> false
- */
-
-static VALUE
-range_cover(VALUE range, VALUE val)
+range_include(range, val)
+ VALUE range, val;
{
VALUE beg, end;
- beg = RANGE_BEG(range);
- end = RANGE_END(range);
+ beg = rb_ivar_get(range, id_beg);
+ end = rb_ivar_get(range, id_end);
if (r_le(beg, val)) {
if (EXCL(range)) {
- if (r_lt(val, end))
- return Qtrue;
+ if (r_lt(val, end)) return Qtrue;
}
else {
- if (r_le(val, end))
- return Qtrue;
+ if (r_le(val, end)) return Qtrue;
}
}
return Qfalse;
}
-static VALUE
-range_dumper(VALUE range)
-{
- VALUE v;
- NEWOBJ(m, struct RObject);
- OBJSETUP(m, rb_cObject, T_OBJECT);
-
- v = (VALUE)m;
-
- rb_ivar_set(v, id_excl, RANGE_EXCL(range));
- rb_ivar_set(v, id_beg, RANGE_BEG(range));
- rb_ivar_set(v, id_end, RANGE_END(range));
- return v;
-}
-
-static VALUE
-range_loader(VALUE range, VALUE obj)
-{
- if (TYPE(obj) != T_OBJECT || RBASIC(obj)->klass != rb_cObject) {
- rb_raise(rb_eTypeError, "not a dumped range object");
- }
-
- RSTRUCT(range)->as.ary[0] = rb_ivar_get(obj, id_beg);
- RSTRUCT(range)->as.ary[1] = rb_ivar_get(obj, id_end);
- RSTRUCT(range)->as.ary[2] = rb_ivar_get(obj, id_excl);
- return range;
-}
-
-static VALUE
-range_alloc(VALUE klass)
-{
- /* rb_struct_alloc_noinit itself should not be used because
- * rb_marshal_define_compat uses equality of allocaiton function */
- return rb_struct_alloc_noinit(klass);
-}
/* A <code>Range</code> represents an interval---a set of values with a
* start and an end. Ranges may be constructed using the
@@ -898,17 +633,17 @@ range_alloc(VALUE klass)
* run from the start to the end inclusively. Those created using
* <code>...</code> exclude the end value. When used as an iterator,
* ranges return each value in the sequence.
- *
+ *
* (-1..-5).to_a #=> []
* (-5..-1).to_a #=> [-5, -4, -3, -2, -1]
* ('a'..'e').to_a #=> ["a", "b", "c", "d", "e"]
* ('a'...'e').to_a #=> ["a", "b", "c", "d"]
- *
+ *
* Ranges can be constructed using objects of any type, as long as the
* objects can be compared using their <code><=></code> operator and
* they support the <code>succ</code> method to return the next object
* in sequence.
- *
+ *
* class Xs # represent a string of 'x's
* include Comparable
* attr :length
@@ -928,52 +663,36 @@ range_alloc(VALUE klass)
* 'x' * @length
* end
* end
- *
+ *
* r = Xs.new(3)..Xs.new(6) #=> xxx..xxxxxx
* r.to_a #=> [xxx, xxxx, xxxxx, xxxxxx]
* r.member?(Xs.new(5)) #=> true
- *
+ *
* In the previous code example, class <code>Xs</code> includes the
* <code>Comparable</code> module. This is because
* <code>Enumerable#member?</code> checks for equality using
* <code>==</code>. Including <code>Comparable</code> ensures that the
* <code>==</code> method is defined in terms of the <code><=></code>
* method implemented in <code>Xs</code>.
- *
+ *
*/
void
-Init_Range(void)
+Init_Range()
{
-#undef rb_intern
-#define rb_intern(str) rb_intern_const(str)
-
- id_cmp = rb_intern("<=>");
- id_succ = rb_intern("succ");
- id_beg = rb_intern("begin");
- id_end = rb_intern("end");
- id_excl = rb_intern("excl");
-
- rb_cRange = rb_struct_define_without_accessor(
- "Range", rb_cObject, range_alloc,
- "begin", "end", "excl", NULL);
-
+ rb_cRange = rb_define_class("Range", rb_cObject);
rb_include_module(rb_cRange, rb_mEnumerable);
- rb_marshal_define_compat(rb_cRange, rb_cObject, range_dumper, range_loader);
rb_define_method(rb_cRange, "initialize", range_initialize, -1);
- rb_define_method(rb_cRange, "initialize_copy", range_initialize_copy, 1);
rb_define_method(rb_cRange, "==", range_eq, 1);
- rb_define_method(rb_cRange, "===", range_eqq, 1);
+ rb_define_method(rb_cRange, "===", range_include, 1);
rb_define_method(rb_cRange, "eql?", range_eql, 1);
rb_define_method(rb_cRange, "hash", range_hash, 0);
rb_define_method(rb_cRange, "each", range_each, 0);
rb_define_method(rb_cRange, "step", range_step, -1);
- rb_define_method(rb_cRange, "begin", range_begin, 0);
- rb_define_method(rb_cRange, "end", range_end, 0);
- rb_define_method(rb_cRange, "first", range_first, -1);
- rb_define_method(rb_cRange, "last", range_last, -1);
- rb_define_method(rb_cRange, "min", range_min, 0);
- rb_define_method(rb_cRange, "max", range_max, 0);
+ rb_define_method(rb_cRange, "first", range_first, 0);
+ rb_define_method(rb_cRange, "last", range_last, 0);
+ rb_define_method(rb_cRange, "begin", range_first, 0);
+ rb_define_method(rb_cRange, "end", range_last, 0);
rb_define_method(rb_cRange, "to_s", range_to_s, 0);
rb_define_method(rb_cRange, "inspect", range_inspect, 0);
@@ -981,5 +700,10 @@ Init_Range(void)
rb_define_method(rb_cRange, "member?", range_include, 1);
rb_define_method(rb_cRange, "include?", range_include, 1);
- rb_define_method(rb_cRange, "cover?", range_cover, 1);
+
+ id_cmp = rb_intern("<=>");
+ id_succ = rb_intern("succ");
+ id_beg = rb_intern("begin");
+ id_end = rb_intern("end");
+ id_excl = rb_intern("excl");
}
diff --git a/rational.c b/rational.c
deleted file mode 100644
index a9e60ebc09..0000000000
--- a/rational.c
+++ /dev/null
@@ -1,2130 +0,0 @@
-/*
- rational.c: Coded by Tadayoshi Funaba 2008,2009
-
- This implementation is based on Keiju Ishitsuka's Rational library
- which is written in ruby.
-*/
-
-#include "ruby.h"
-#include <math.h>
-#include <float.h>
-
-#ifdef HAVE_IEEEFP_H
-#include <ieeefp.h>
-#endif
-
-#define NDEBUG
-#include <assert.h>
-
-#define ZERO INT2FIX(0)
-#define ONE INT2FIX(1)
-#define TWO INT2FIX(2)
-
-VALUE rb_cRational;
-
-static ID id_abs, id_cmp, id_convert, id_eqeq_p, id_expt, id_fdiv,
- id_floor, id_idiv, id_inspect, id_integer_p, id_negate, id_to_f,
- id_to_i, id_to_s, id_truncate;
-
-#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)\
-{\
- return rb_funcall(x, id_##n, 0);\
-}
-
-#define fun2(n) \
-inline static VALUE \
-f_##n(VALUE x, VALUE y)\
-{\
- return rb_funcall(x, id_##n, 1, y);\
-}
-
-inline static VALUE
-f_add(VALUE x, VALUE y)
-{
- if (FIXNUM_P(y) && FIX2LONG(y) == 0)
- return x;
- else if (FIXNUM_P(x) && FIX2LONG(x) == 0)
- return y;
- return rb_funcall(x, '+', 1, y);
-}
-
-inline static VALUE
-f_cmp(VALUE x, VALUE y)
-{
- if (FIXNUM_P(x) && FIXNUM_P(y)) {
- long c = FIX2LONG(x) - FIX2LONG(y);
- if (c > 0)
- c = 1;
- else if (c < 0)
- c = -1;
- return INT2FIX(c);
- }
- return rb_funcall(x, id_cmp, 1, y);
-}
-
-inline static VALUE
-f_div(VALUE x, VALUE y)
-{
- if (FIXNUM_P(y) && FIX2LONG(y) == 1)
- return x;
- return rb_funcall(x, '/', 1, y);
-}
-
-inline static VALUE
-f_gt_p(VALUE x, VALUE y)
-{
- if (FIXNUM_P(x) && FIXNUM_P(y))
- return f_boolcast(FIX2LONG(x) > FIX2LONG(y));
- return rb_funcall(x, '>', 1, y);
-}
-
-inline static VALUE
-f_lt_p(VALUE x, VALUE y)
-{
- if (FIXNUM_P(x) && FIXNUM_P(y))
- return f_boolcast(FIX2LONG(x) < FIX2LONG(y));
- return rb_funcall(x, '<', 1, y);
-}
-
-binop(mod, '%')
-
-inline static VALUE
-f_mul(VALUE x, VALUE y)
-{
- if (FIXNUM_P(y)) {
- long iy = FIX2LONG(y);
- if (iy == 0) {
- if (FIXNUM_P(x) || TYPE(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) || TYPE(y) == T_BIGNUM)
- return ZERO;
- }
- else if (ix == 1)
- return y;
- }
- return rb_funcall(x, '*', 1, y);
-}
-
-inline static VALUE
-f_sub(VALUE x, VALUE y)
-{
- if (FIXNUM_P(y) && FIX2LONG(y) == 0)
- return x;
- return rb_funcall(x, '-', 1, y);
-}
-
-fun1(abs)
-fun1(floor)
-fun1(inspect)
-fun1(integer_p)
-fun1(negate)
-fun1(to_f)
-fun1(to_i)
-fun1(to_s)
-fun1(truncate)
-
-inline static VALUE
-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);
-}
-
-fun2(expt)
-fun2(fdiv)
-fun2(idiv)
-
-inline static VALUE
-f_negative_p(VALUE 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 VALUE
-f_zero_p(VALUE x)
-{
- switch (TYPE(x)) {
- case T_FIXNUM:
- return f_boolcast(FIX2LONG(x) == 0);
- case T_BIGNUM:
- return Qfalse;
- case T_RATIONAL:
- {
- VALUE num = RRATIONAL(x)->num;
-
- return f_boolcast(FIXNUM_P(num) && FIX2LONG(num) == 0);
- }
- }
- return rb_funcall(x, id_eqeq_p, 1, ZERO);
-}
-
-#define f_nonzero_p(x) (!f_zero_p(x))
-
-inline static VALUE
-f_one_p(VALUE x)
-{
- switch (TYPE(x)) {
- case T_FIXNUM:
- return f_boolcast(FIX2LONG(x) == 1);
- case T_BIGNUM:
- return Qfalse;
- case T_RATIONAL:
- {
- 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_funcall(x, id_eqeq_p, 1, ONE);
-}
-
-inline static VALUE
-f_kind_of_p(VALUE x, VALUE c)
-{
- return rb_obj_is_kind_of(x, c);
-}
-
-inline static VALUE
-k_numeric_p(VALUE x)
-{
- return f_kind_of_p(x, rb_cNumeric);
-}
-
-inline static VALUE
-k_integer_p(VALUE x)
-{
- return f_kind_of_p(x, rb_cInteger);
-}
-
-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);
-}
-
-#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))
-
-#ifndef NDEBUG
-#define f_gcd f_gcd_orig
-#endif
-
-inline static long
-i_gcd(long x, long y)
-{
- if (x < 0)
- x = -x;
- if (y < 0)
- y = -y;
-
- if (x == 0)
- return y;
- if (y == 0)
- return x;
-
- while (x > 0) {
- long t = x;
- x = y % x;
- y = t;
- }
- return y;
-}
-
-inline static VALUE
-f_gcd(VALUE x, VALUE y)
-{
- VALUE z;
-
- if (FIXNUM_P(x) && FIXNUM_P(y))
- return LONG2NUM(i_gcd(FIX2LONG(x), FIX2LONG(y)));
-
- if (f_negative_p(x))
- x = f_negate(x);
- if (f_negative_p(y))
- y = f_negate(y);
-
- if (f_zero_p(x))
- return y;
- if (f_zero_p(y))
- return x;
-
- for (;;) {
- if (FIXNUM_P(x)) {
- if (FIX2LONG(x) == 0)
- return y;
- if (FIXNUM_P(y))
- return LONG2NUM(i_gcd(FIX2LONG(x), FIX2LONG(y)));
- }
- z = x;
- x = f_mod(y, x);
- y = z;
- }
- /* NOTREACHED */
-}
-
-#ifndef NDEBUG
-#undef f_gcd
-
-inline static VALUE
-f_gcd(VALUE x, VALUE y)
-{
- VALUE r = f_gcd_orig(x, y);
- if (f_nonzero_p(r)) {
- assert(f_zero_p(f_mod(x, r)));
- assert(f_zero_p(f_mod(y, r)));
- }
- return r;
-}
-#endif
-
-inline static VALUE
-f_lcm(VALUE x, VALUE y)
-{
- if (f_zero_p(x) || f_zero_p(y))
- return ZERO;
- return f_abs(f_mul(f_div(x, f_gcd(x, y)), y));
-}
-
-#define get_dat1(x) \
- struct RRational *dat;\
- dat = ((struct RRational *)(x))
-
-#define get_dat2(x,y) \
- struct RRational *adat, *bdat;\
- adat = ((struct RRational *)(x));\
- bdat = ((struct RRational *)(y))
-
-inline static VALUE
-nurat_s_new_internal(VALUE klass, VALUE num, VALUE den)
-{
- NEWOBJ(obj, struct RRational);
- OBJSETUP(obj, klass, T_RATIONAL);
-
- obj->num = num;
- obj->den = den;
-
- return (VALUE)obj;
-}
-
-static VALUE
-nurat_s_alloc(VALUE klass)
-{
- return nurat_s_new_internal(klass, ZERO, ONE);
-}
-
-#define rb_raise_zerodiv() rb_raise(rb_eZeroDivError, "divided by 0")
-
-#if 0
-static VALUE
-nurat_s_new_bang(int argc, VALUE *argv, VALUE klass)
-{
- VALUE num, den;
-
- switch (rb_scan_args(argc, argv, "11", &num, &den)) {
- case 1:
- if (!k_integer_p(num))
- num = f_to_i(num);
- den = ONE;
- break;
- default:
- if (!k_integer_p(num))
- num = f_to_i(num);
- if (!k_integer_p(den))
- den = f_to_i(den);
-
- switch (FIX2INT(f_cmp(den, ZERO))) {
- case -1:
- num = f_negate(num);
- den = f_negate(den);
- break;
- case 0:
- rb_raise_zerodiv();
- break;
- }
- break;
- }
-
- return nurat_s_new_internal(klass, num, den);
-}
-#endif
-
-inline static VALUE
-f_rational_new_bang1(VALUE klass, VALUE x)
-{
- return nurat_s_new_internal(klass, x, ONE);
-}
-
-inline static VALUE
-f_rational_new_bang2(VALUE klass, VALUE x, VALUE y)
-{
- assert(f_positive_p(y));
- assert(f_nonzero_p(y));
- return nurat_s_new_internal(klass, x, y);
-}
-
-#ifdef CANONICALIZATION_FOR_MATHN
-#define CANON
-#endif
-
-#ifdef CANON
-static int canonicalization = 0;
-
-void
-nurat_canonicalization(int f)
-{
- canonicalization = f;
-}
-#endif
-
-inline static void
-nurat_int_check(VALUE num)
-{
- switch (TYPE(num)) {
- case T_FIXNUM:
- case T_BIGNUM:
- break;
- default:
- if (!k_numeric_p(num) || !f_integer_p(num))
- rb_raise(rb_eArgError, "not an integer");
- }
-}
-
-inline static VALUE
-nurat_int_value(VALUE num)
-{
- nurat_int_check(num);
- if (!k_integer_p(num))
- num = f_to_i(num);
- return num;
-}
-
-inline static VALUE
-nurat_s_canonicalize_internal(VALUE klass, VALUE num, VALUE den)
-{
- VALUE gcd;
-
- switch (FIX2INT(f_cmp(den, ZERO))) {
- case -1:
- num = f_negate(num);
- den = f_negate(den);
- break;
- case 0:
- rb_raise_zerodiv();
- break;
- }
-
- gcd = f_gcd(num, den);
- num = f_idiv(num, gcd);
- den = f_idiv(den, gcd);
-
-#ifdef CANON
- if (f_one_p(den) && canonicalization)
- return num;
-#endif
- return nurat_s_new_internal(klass, num, den);
-}
-
-inline static VALUE
-nurat_s_canonicalize_internal_no_reduce(VALUE klass, VALUE num, VALUE den)
-{
- switch (FIX2INT(f_cmp(den, ZERO))) {
- case -1:
- num = f_negate(num);
- den = f_negate(den);
- break;
- case 0:
- rb_raise_zerodiv();
- break;
- }
-
-#ifdef CANON
- if (f_one_p(den) && canonicalization)
- return num;
-#endif
- return nurat_s_new_internal(klass, num, den);
-}
-
-static VALUE
-nurat_s_new(int argc, VALUE *argv, VALUE klass)
-{
- VALUE num, den;
-
- switch (rb_scan_args(argc, argv, "11", &num, &den)) {
- case 1:
- num = nurat_int_value(num);
- den = ONE;
- break;
- default:
- num = nurat_int_value(num);
- den = nurat_int_value(den);
- break;
- }
-
- return nurat_s_canonicalize_internal(klass, num, den);
-}
-
-inline static VALUE
-f_rational_new1(VALUE klass, VALUE x)
-{
- assert(!k_rational_p(x));
- return nurat_s_canonicalize_internal(klass, x, ONE);
-}
-
-inline static VALUE
-f_rational_new2(VALUE klass, VALUE x, VALUE y)
-{
- assert(!k_rational_p(x));
- assert(!k_rational_p(y));
- return nurat_s_canonicalize_internal(klass, x, y);
-}
-
-inline static VALUE
-f_rational_new_no_reduce1(VALUE klass, VALUE x)
-{
- assert(!k_rational_p(x));
- return nurat_s_canonicalize_internal_no_reduce(klass, x, ONE);
-}
-
-inline static VALUE
-f_rational_new_no_reduce2(VALUE klass, VALUE x, VALUE y)
-{
- assert(!k_rational_p(x));
- assert(!k_rational_p(y));
- return nurat_s_canonicalize_internal_no_reduce(klass, x, y);
-}
-
-/*
- * call-seq:
- * Rational(x[, y]) -> numeric
- *
- * Returns x/y;
- */
-static VALUE
-nurat_f_rational(int argc, VALUE *argv, VALUE klass)
-{
- return rb_funcall2(rb_cRational, id_convert, argc, argv);
-}
-
-/*
- * call-seq:
- * rat.numerator -> integer
- *
- * Returns the numerator.
- *
- * For example:
- *
- * Rational(7).numerator #=> 7
- * Rational(7, 1).numerator #=> 7
- * Rational(9, -4).numerator #=> -9
- * Rational(-2, -10).numerator #=> 1
- */
-static VALUE
-nurat_numerator(VALUE self)
-{
- get_dat1(self);
- return dat->num;
-}
-
-/*
- * call-seq:
- * rat.denominator -> integer
- *
- * Returns the denominator (always positive).
- *
- * For example:
- *
- * Rational(7).denominator #=> 1
- * Rational(7, 1).denominator #=> 1
- * Rational(9, -4).denominator #=> 4
- * Rational(-2, -10).denominator #=> 5
- * rat.numerator.gcd(rat.denominator) #=> 1
- */
-static VALUE
-nurat_denominator(VALUE self)
-{
- get_dat1(self);
- return dat->den;
-}
-
-#ifndef NDEBUG
-#define f_imul f_imul_orig
-#endif
-
-inline static VALUE
-f_imul(long a, long b)
-{
- VALUE r;
- long c;
-
- if (a == 0 || b == 0)
- return ZERO;
- else if (a == 1)
- return LONG2NUM(b);
- else if (b == 1)
- return LONG2NUM(a);
-
- c = a * b;
- r = LONG2NUM(c);
- if (NUM2LONG(r) != c || (c / a) != b)
- r = rb_big_mul(rb_int2big(a), rb_int2big(b));
- return r;
-}
-
-#ifndef NDEBUG
-#undef f_imul
-
-inline static VALUE
-f_imul(long x, long y)
-{
- VALUE r = f_imul_orig(x, y);
- assert(f_eqeq_p(r, f_mul(LONG2NUM(x), LONG2NUM(y))));
- return r;
-}
-#endif
-
-inline static VALUE
-f_addsub(VALUE self, VALUE anum, VALUE aden, VALUE bnum, VALUE bden, int k)
-{
- VALUE num, den;
-
- if (FIXNUM_P(anum) && FIXNUM_P(aden) &&
- FIXNUM_P(bnum) && FIXNUM_P(bden)) {
- long an = FIX2LONG(anum);
- long ad = FIX2LONG(aden);
- long bn = FIX2LONG(bnum);
- long bd = FIX2LONG(bden);
- long ig = i_gcd(ad, bd);
-
- VALUE g = LONG2NUM(ig);
- VALUE a = f_imul(an, bd / ig);
- VALUE b = f_imul(bn, ad / ig);
- VALUE c;
-
- if (k == '+')
- c = f_add(a, b);
- else
- c = f_sub(a, b);
-
- b = f_idiv(aden, g);
- g = f_gcd(c, g);
- num = f_idiv(c, g);
- a = f_idiv(bden, g);
- den = f_mul(a, b);
- }
- else {
- VALUE g = f_gcd(aden, bden);
- VALUE a = f_mul(anum, f_idiv(bden, g));
- VALUE b = f_mul(bnum, f_idiv(aden, g));
- VALUE c;
-
- if (k == '+')
- c = f_add(a, b);
- else
- c = f_sub(a, b);
-
- b = f_idiv(aden, g);
- g = f_gcd(c, g);
- num = f_idiv(c, g);
- a = f_idiv(bden, g);
- den = f_mul(a, b);
- }
- return f_rational_new_no_reduce2(CLASS_OF(self), num, den);
-}
-
-/*
- * call-seq:
- * rat + numeric -> numeric_result
- *
- * Performs addition.
- *
- * For example:
- *
- * Rational(2, 3) + Rational(2, 3) #=> (4/3)
- * Rational(900) + Rational(1) #=> (900/1)
- * Rational(-2, 9) + Rational(-9, 2) #=> (-85/18)
- * Rational(9, 8) + 4 #=> (41/8)
- * Rational(20, 9) + 9.8 #=> 12.022222222222222
- */
-static VALUE
-nurat_add(VALUE self, VALUE other)
-{
- switch (TYPE(other)) {
- case T_FIXNUM:
- case T_BIGNUM:
- {
- get_dat1(self);
-
- return f_addsub(self,
- dat->num, dat->den,
- other, ONE, '+');
- }
- case T_FLOAT:
- return f_add(f_to_f(self), other);
- case T_RATIONAL:
- {
- get_dat2(self, other);
-
- return f_addsub(self,
- adat->num, adat->den,
- bdat->num, bdat->den, '+');
- }
- default:
- return rb_num_coerce_bin(self, other, '+');
- }
-}
-
-/*
- * call-seq:
- * rat - numeric -> numeric_result
- *
- * Performs subtraction.
- *
- * For example:
- *
- * Rational(2, 3) - Rational(2, 3) #=> (0/1)
- * Rational(900) - Rational(1) #=> (899/1)
- * Rational(-2, 9) - Rational(-9, 2) #=> (77/18)
- * Rational(9, 8) - 4 #=> (23/8)
- * Rational(20, 9) - 9.8 #=> -7.577777777777778
- */
-static VALUE
-nurat_sub(VALUE self, VALUE other)
-{
- switch (TYPE(other)) {
- case T_FIXNUM:
- case T_BIGNUM:
- {
- get_dat1(self);
-
- return f_addsub(self,
- dat->num, dat->den,
- other, ONE, '-');
- }
- case T_FLOAT:
- return f_sub(f_to_f(self), other);
- case T_RATIONAL:
- {
- get_dat2(self, other);
-
- return f_addsub(self,
- adat->num, adat->den,
- bdat->num, bdat->den, '-');
- }
- default:
- return rb_num_coerce_bin(self, other, '-');
- }
-}
-
-inline static VALUE
-f_muldiv(VALUE self, VALUE anum, VALUE aden, VALUE bnum, VALUE bden, int k)
-{
- VALUE num, den;
-
- if (k == '/') {
- VALUE t;
-
- if (f_negative_p(bnum)) {
- anum = f_negate(anum);
- bnum = f_negate(bnum);
- }
- t = bnum;
- bnum = bden;
- bden = t;
- }
-
- if (FIXNUM_P(anum) && FIXNUM_P(aden) &&
- FIXNUM_P(bnum) && FIXNUM_P(bden)) {
- long an = FIX2LONG(anum);
- long ad = FIX2LONG(aden);
- long bn = FIX2LONG(bnum);
- long bd = FIX2LONG(bden);
- long g1 = i_gcd(an, bd);
- long g2 = i_gcd(ad, bn);
-
- num = f_imul(an / g1, bn / g2);
- den = f_imul(ad / g2, bd / g1);
- }
- else {
- VALUE g1 = f_gcd(anum, bden);
- VALUE g2 = f_gcd(aden, bnum);
-
- num = f_mul(f_idiv(anum, g1), f_idiv(bnum, g2));
- den = f_mul(f_idiv(aden, g2), f_idiv(bden, g1));
- }
- return f_rational_new_no_reduce2(CLASS_OF(self), num, den);
-}
-
-/*
- * call-seq:
- * rat * numeric -> numeric_result
- *
- * Performs multiplication.
- *
- * For example:
- *
- * Rational(2, 3) * Rational(2, 3) #=> (4/9)
- * Rational(900) * Rational(1) #=> (900/1)
- * Rational(-2, 9) * Rational(-9, 2) #=> (1/1)
- * Rational(9, 8) * 4 #=> (9/2)
- * Rational(20, 9) * 9.8 #=> 21.77777777777778
- */
-static VALUE
-nurat_mul(VALUE self, VALUE other)
-{
- switch (TYPE(other)) {
- case T_FIXNUM:
- case T_BIGNUM:
- {
- get_dat1(self);
-
- return f_muldiv(self,
- dat->num, dat->den,
- other, ONE, '*');
- }
- case T_FLOAT:
- return f_mul(f_to_f(self), other);
- case T_RATIONAL:
- {
- get_dat2(self, other);
-
- return f_muldiv(self,
- adat->num, adat->den,
- bdat->num, bdat->den, '*');
- }
- default:
- return rb_num_coerce_bin(self, other, '*');
- }
-}
-
-/*
- * call-seq:
- * rat / numeric -> numeric_result
- * rat.quo(numeric) -> numeric_result
- *
- * Performs division.
- *
- * For example:
- *
- * Rational(2, 3) / Rational(2, 3) #=> (1/1)
- * Rational(900) / Rational(1) #=> (900/1)
- * Rational(-2, 9) / Rational(-9, 2) #=> (4/81)
- * Rational(9, 8) / 4 #=> (9/32)
- * Rational(20, 9) / 9.8 #=> 0.22675736961451246
- */
-static VALUE
-nurat_div(VALUE self, VALUE other)
-{
- switch (TYPE(other)) {
- case T_FIXNUM:
- case T_BIGNUM:
- if (f_zero_p(other))
- rb_raise_zerodiv();
- {
- get_dat1(self);
-
- return f_muldiv(self,
- dat->num, dat->den,
- other, ONE, '/');
- }
- case T_FLOAT:
- return rb_funcall(f_to_f(self), '/', 1, other);
- case T_RATIONAL:
- if (f_zero_p(other))
- rb_raise_zerodiv();
- {
- get_dat2(self, other);
-
- if (f_one_p(self))
- return f_rational_new_no_reduce2(CLASS_OF(self),
- bdat->den, bdat->num);
-
- return f_muldiv(self,
- adat->num, adat->den,
- bdat->num, bdat->den, '/');
- }
- default:
- return rb_num_coerce_bin(self, other, '/');
- }
-}
-
-/*
- * call-seq:
- * rat.fdiv(numeric) -> float
- *
- * Performs division and returns the value as a float.
- *
- * For example:
- *
- * Rational(2, 3).fdiv(1) #=> 0.6666666666666666
- * Rational(2, 3).fdiv(0.5) #=> 1.3333333333333333
- * Rational(2).fdiv(3) #=> 0.6666666666666666
- */
-static VALUE
-nurat_fdiv(VALUE self, VALUE other)
-{
- if (f_zero_p(other))
- return f_div(self, f_to_f(other));
- return f_to_f(f_div(self, other));
-}
-
-extern VALUE rb_fexpt(VALUE x, VALUE y);
-
-/*
- * call-seq:
- * rat ** numeric -> numeric_result
- *
- * Performs exponentiation.
- *
- * For example:
- *
- * Rational(2) ** Rational(3) #=> (8/1)
- * Rational(10) ** -2 #=> (1/100)
- * Rational(10) ** -2.0 #=> 0.01
- * Rational(-4) ** Rational(1,2) #=> (1.2246063538223773e-16+2.0i)
- * Rational(1, 2) ** 0 #=> (1/1)
- * Rational(1, 2) ** 0.0 #=> 1.0
- */
-static VALUE
-nurat_expt(VALUE self, VALUE other)
-{
- if (k_exact_zero_p(other))
- return f_rational_new_bang1(CLASS_OF(self), ONE);
-
- if (k_rational_p(other)) {
- get_dat1(other);
-
- if (f_one_p(dat->den))
- other = dat->num; /* c14n */
- }
-
- switch (TYPE(other)) {
- case T_FIXNUM:
- {
- VALUE num, den;
-
- get_dat1(self);
-
- switch (FIX2INT(f_cmp(other, ZERO))) {
- case 1:
- num = f_expt(dat->num, other);
- den = f_expt(dat->den, other);
- break;
- case -1:
- num = f_expt(dat->den, f_negate(other));
- den = f_expt(dat->num, f_negate(other));
- break;
- default:
- num = ONE;
- den = ONE;
- break;
- }
- return f_rational_new2(CLASS_OF(self), num, den);
- }
- case T_BIGNUM:
- rb_warn("in a**b, b may be too big");
- /* fall through */
- case T_FLOAT:
- case T_RATIONAL:
- return rb_fexpt(f_to_f(self), other);
- default:
- return rb_num_coerce_bin(self, other, id_expt);
- }
-}
-
-/*
- * call-seq:
- * rat <=> numeric -> -1, 0, +1 or nil
- *
- * Performs comparison and returns -1, 0, or +1.
- *
- * For example:
- *
- * Rational(2, 3) <=> Rational(2, 3) #=> 0
- * Rational(5) <=> 5 #=> 0
- * Rational(2,3) <=> Rational(1,3) #=> 1
- * Rational(1,3) <=> 1 #=> -1
- * Rational(1,3) <=> 0.3 #=> 1
- */
-static VALUE
-nurat_cmp(VALUE self, VALUE other)
-{
- switch (TYPE(other)) {
- case T_FIXNUM:
- case T_BIGNUM:
- {
- get_dat1(self);
-
- if (FIXNUM_P(dat->den) && FIX2LONG(dat->den) == 1)
- return f_cmp(dat->num, other); /* c14n */
- return f_cmp(self, f_rational_new_bang1(CLASS_OF(self), other));
- }
- case T_FLOAT:
- return f_cmp(f_to_f(self), other);
- case T_RATIONAL:
- {
- VALUE num1, num2;
-
- get_dat2(self, other);
-
- if (FIXNUM_P(adat->num) && FIXNUM_P(adat->den) &&
- FIXNUM_P(bdat->num) && FIXNUM_P(bdat->den)) {
- num1 = f_imul(FIX2LONG(adat->num), FIX2LONG(bdat->den));
- num2 = f_imul(FIX2LONG(bdat->num), FIX2LONG(adat->den));
- }
- else {
- num1 = f_mul(adat->num, bdat->den);
- num2 = f_mul(bdat->num, adat->den);
- }
- return f_cmp(f_sub(num1, num2), ZERO);
- }
- default:
- return rb_num_coerce_cmp(self, other, id_cmp);
- }
-}
-
-/*
- * call-seq:
- * rat == object -> true or false
- *
- * Returns true if rat equals object numerically.
- *
- * For example:
- *
- * Rational(2, 3) == Rational(2, 3) #=> true
- * Rational(5) == 5 #=> true
- * Rational(0) == 0.0 #=> true
- * Rational('1/3') == 0.33 #=> false
- * Rational('1/2') == '1/2' #=> false
- */
-static VALUE
-nurat_eqeq_p(VALUE self, VALUE other)
-{
- switch (TYPE(other)) {
- case T_FIXNUM:
- case T_BIGNUM:
- {
- get_dat1(self);
-
- if (f_zero_p(dat->num) && f_zero_p(other))
- return Qtrue;
-
- if (!FIXNUM_P(dat->den))
- return Qfalse;
- if (FIX2LONG(dat->den) != 1)
- return Qfalse;
- if (f_eqeq_p(dat->num, other))
- return Qtrue;
- return Qfalse;
- }
- case T_FLOAT:
- return f_eqeq_p(f_to_f(self), other);
- case T_RATIONAL:
- {
- get_dat2(self, other);
-
- if (f_zero_p(adat->num) && f_zero_p(bdat->num))
- return Qtrue;
-
- return f_boolcast(f_eqeq_p(adat->num, bdat->num) &&
- f_eqeq_p(adat->den, bdat->den));
- }
- default:
- return f_eqeq_p(other, self);
- }
-}
-
-/* :nodoc: */
-static VALUE
-nurat_coerce(VALUE self, VALUE other)
-{
- switch (TYPE(other)) {
- case T_FIXNUM:
- case T_BIGNUM:
- return rb_assoc_new(f_rational_new_bang1(CLASS_OF(self), other), self);
- case T_FLOAT:
- return rb_assoc_new(other, f_to_f(self));
- case T_RATIONAL:
- return rb_assoc_new(other, self);
- case T_COMPLEX:
- if (k_exact_zero_p(RCOMPLEX(other)->imag))
- return rb_assoc_new(f_rational_new_bang1
- (CLASS_OF(self), RCOMPLEX(other)->real), self);
- }
-
- rb_raise(rb_eTypeError, "%s can't be coerced into %s",
- rb_obj_classname(other), rb_obj_classname(self));
- return Qnil;
-}
-
-#if 0
-/* :nodoc: */
-static VALUE
-nurat_idiv(VALUE self, VALUE other)
-{
- return f_idiv(self, other);
-}
-
-/* :nodoc: */
-static VALUE
-nurat_quot(VALUE self, VALUE other)
-{
- return f_truncate(f_div(self, other));
-}
-
-/* :nodoc: */
-static VALUE
-nurat_quotrem(VALUE self, VALUE other)
-{
- VALUE val = f_truncate(f_div(self, other));
- return rb_assoc_new(val, f_sub(self, f_mul(other, val)));
-}
-#endif
-
-#if 0
-/* :nodoc: */
-static VALUE
-nurat_true(VALUE self)
-{
- return Qtrue;
-}
-#endif
-
-static VALUE
-nurat_floor(VALUE self)
-{
- get_dat1(self);
- return f_idiv(dat->num, dat->den);
-}
-
-static VALUE
-nurat_ceil(VALUE self)
-{
- get_dat1(self);
- return f_negate(f_idiv(f_negate(dat->num), dat->den));
-}
-
-
-/*
- * call-seq:
- * rat.to_i -> integer
- *
- * Returns the truncated value as an integer.
- *
- * Equivalent to
- * rat.truncate.
- *
- * For example:
- *
- * Rational(2, 3).to_i #=> 0
- * Rational(3).to_i #=> 3
- * Rational(300.6).to_i #=> 300
- * Rational(98,71).to_i #=> 1
- * Rational(-30,2).to_i #=> -15
- */
-static VALUE
-nurat_truncate(VALUE self)
-{
- get_dat1(self);
- if (f_negative_p(dat->num))
- return f_negate(f_idiv(f_negate(dat->num), dat->den));
- return f_idiv(dat->num, dat->den);
-}
-
-static VALUE
-nurat_round(VALUE self)
-{
- VALUE num, den, neg;
-
- get_dat1(self);
-
- num = dat->num;
- den = dat->den;
- neg = f_negative_p(num);
-
- if (neg)
- num = f_negate(num);
-
- num = f_add(f_mul(num, TWO), den);
- den = f_mul(den, TWO);
- num = f_idiv(num, den);
-
- if (neg)
- num = f_negate(num);
-
- return num;
-}
-
-static VALUE
-f_round_common(int argc, VALUE *argv, VALUE self, VALUE (*func)(VALUE))
-{
- VALUE n, b, s;
-
- if (argc == 0)
- return (*func)(self);
-
- rb_scan_args(argc, argv, "01", &n);
-
- if (!k_integer_p(n))
- rb_raise(rb_eTypeError, "not an integer");
-
- b = f_expt(INT2FIX(10), n);
- s = f_mul(self, b);
-
- s = (*func)(s);
-
- s = f_div(f_rational_new_bang1(CLASS_OF(self), s), b);
-
- if (f_lt_p(n, ONE))
- s = f_to_i(s);
-
- return s;
-}
-
-/*
- * call-seq:
- * rat.floor -> integer
- * rat.floor(precision=0) -> rational
- *
- * Returns the truncated value (toward negative infinity).
- *
- * For example:
- *
- * Rational(3).floor #=> 3
- * Rational(2, 3).floor #=> 0
- * Rational(-3, 2).floor #=> -1
- *
- * decimal - 1 2 3 . 4 5 6
- * ^ ^ ^ ^ ^ ^
- * precision -3 -2 -1 0 +1 +2
- *
- * '%f' % Rational('-123.456').floor(+1) #=> "-123.500000"
- * '%f' % Rational('-123.456').floor(-1) #=> "-130.000000"
- */
-static VALUE
-nurat_floor_n(int argc, VALUE *argv, VALUE self)
-{
- return f_round_common(argc, argv, self, nurat_floor);
-}
-
-/*
- * call-seq:
- * rat.ceil -> integer
- * rat.ceil(precision=0) -> rational
- *
- * Returns the truncated value (toward positive infinity).
- *
- * For example:
- *
- * Rational(3).ceil #=> 3
- * Rational(2, 3).ceil #=> 1
- * Rational(-3, 2).ceil #=> -1
- *
- * decimal - 1 2 3 . 4 5 6
- * ^ ^ ^ ^ ^ ^
- * precision -3 -2 -1 0 +1 +2
- *
- * '%f' % Rational('-123.456').ceil(+1) #=> "-123.400000"
- * '%f' % Rational('-123.456').ceil(-1) #=> "-120.000000"
- */
-static VALUE
-nurat_ceil_n(int argc, VALUE *argv, VALUE self)
-{
- return f_round_common(argc, argv, self, nurat_ceil);
-}
-
-/*
- * call-seq:
- * rat.truncate -> integer
- * rat.truncate(precision=0) -> rational
- *
- * Returns the truncated value (toward zero).
- *
- * For example:
- *
- * Rational(3).truncate #=> 3
- * Rational(2, 3).truncate #=> 0
- * Rational(-3, 2).truncate #=> -1
- *
- * decimal - 1 2 3 . 4 5 6
- * ^ ^ ^ ^ ^ ^
- * precision -3 -2 -1 0 +1 +2
- *
- * '%f' % Rational('-123.456').truncate(+1) #=> "-123.400000"
- * '%f' % Rational('-123.456').truncate(-1) #=> "-120.000000"
- */
-static VALUE
-nurat_truncate_n(int argc, VALUE *argv, VALUE self)
-{
- return f_round_common(argc, argv, self, nurat_truncate);
-}
-
-/*
- * call-seq:
- * rat.round -> integer
- * rat.round(precision=0) -> rational
- *
- * Returns the truncated value (toward the nearest integer;
- * 0.5 => 1; -0.5 => -1).
- *
- * For example:
- *
- * Rational(3).round #=> 3
- * Rational(2, 3).round #=> 1
- * Rational(-3, 2).round #=> -2
- *
- * decimal - 1 2 3 . 4 5 6
- * ^ ^ ^ ^ ^ ^
- * precision -3 -2 -1 0 +1 +2
- *
- * '%f' % Rational('-123.456').round(+1) #=> "-123.500000"
- * '%f' % Rational('-123.456').round(-1) #=> "-120.000000"
- */
-static VALUE
-nurat_round_n(int argc, VALUE *argv, VALUE self)
-{
- return f_round_common(argc, argv, self, nurat_round);
-}
-
-/*
- * call-seq:
- * rat.to_f -> float
- *
- * Return the value as a float.
- *
- * For example:
- *
- * Rational(2).to_f #=> 2.0
- * Rational(9, 4).to_f #=> 2.25
- * Rational(-3, 4).to_f #=> -0.75
- * Rational(20, 3).to_f #=> 6.666666666666667
- */
-static VALUE
-nurat_to_f(VALUE self)
-{
- get_dat1(self);
- return f_fdiv(dat->num, dat->den);
-}
-
-/*
- * call-seq:
- * rat.to_r -> self
- *
- * Returns self.
- *
- * For example:
- *
- * Rational(2).to_r #=> (2/1)
- * Rational(-8, 6).to_r #=> (-4/3)
- */
-static VALUE
-nurat_to_r(VALUE self)
-{
- return self;
-}
-
-/* :nodoc: */
-static VALUE
-nurat_hash(VALUE self)
-{
- long v, h[3];
- VALUE n;
-
- get_dat1(self);
- h[0] = rb_hash(rb_obj_class(self));
- n = rb_hash(dat->num);
- h[1] = NUM2LONG(n);
- n = rb_hash(dat->den);
- h[2] = NUM2LONG(n);
- v = rb_memhash(h, sizeof(h));
- return LONG2FIX(v);
-}
-
-static VALUE
-f_format(VALUE self, VALUE (*func)(VALUE))
-{
- VALUE s;
- get_dat1(self);
-
- s = (*func)(dat->num);
- rb_str_cat2(s, "/");
- rb_str_concat(s, (*func)(dat->den));
-
- return s;
-}
-
-/*
- * call-seq:
- * rat.to_s -> string
- *
- * Returns the value as a string.
- *
- * For example:
- *
- * Rational(2).to_s #=> "2/1"
- * Rational(-8, 6).to_s #=> "-4/3"
- * Rational('0.5').to_s #=> "1/2"
- */
-static VALUE
-nurat_to_s(VALUE self)
-{
- return f_format(self, f_to_s);
-}
-
-/*
- * call-seq:
- * rat.inspect -> string
- *
- * Returns the value as a string for inspection.
- *
- * For example:
- *
- * Rational(2).inspect #=> "(2/1)"
- * Rational(-8, 6).inspect #=> "(-4/3)"
- * Rational('0.5').inspect #=> "(1/2)"
- */
-static VALUE
-nurat_inspect(VALUE self)
-{
- VALUE s;
-
- s = rb_usascii_str_new2("(");
- rb_str_concat(s, f_format(self, f_inspect));
- rb_str_cat2(s, ")");
-
- return s;
-}
-
-/* :nodoc: */
-static VALUE
-nurat_marshal_dump(VALUE self)
-{
- VALUE a;
- get_dat1(self);
-
- a = rb_assoc_new(dat->num, dat->den);
- rb_copy_generic_ivar(a, self);
- return a;
-}
-
-/* :nodoc: */
-static VALUE
-nurat_marshal_load(VALUE self, VALUE a)
-{
- get_dat1(self);
- dat->num = RARRAY_PTR(a)[0];
- dat->den = RARRAY_PTR(a)[1];
- rb_copy_generic_ivar(self, a);
-
- if (f_zero_p(dat->den))
- rb_raise_zerodiv();
-
- return self;
-}
-
-/* --- */
-
-VALUE
-rb_rational_reciprocal(VALUE x)
-{
- get_dat1(x);
- return f_rational_new_no_reduce2(CLASS_OF(x), dat->den, dat->num);
-}
-
-/*
- * call-seq:
- * int.gcd(int2) -> integer
- *
- * Returns the greatest common divisor (always positive). 0.gcd(x)
- * and x.gcd(0) return abs(x).
- *
- * For example:
- *
- * 2.gcd(2) #=> 2
- * 3.gcd(-7) #=> 1
- * ((1<<31)-1).gcd((1<<61)-1) #=> 1
- */
-VALUE
-rb_gcd(VALUE self, VALUE other)
-{
- other = nurat_int_value(other);
- return f_gcd(self, other);
-}
-
-/*
- * call-seq:
- * int.lcm(int2) -> integer
- *
- * Returns the least common multiple (always positive). 0.lcm(x) and
- * x.lcm(0) return zero.
- *
- * For example:
- *
- * 2.lcm(2) #=> 2
- * 3.lcm(-7) #=> 21
- * ((1<<31)-1).lcm((1<<61)-1) #=> 4951760154835678088235319297
- */
-VALUE
-rb_lcm(VALUE self, VALUE other)
-{
- other = nurat_int_value(other);
- return f_lcm(self, other);
-}
-
-/*
- * call-seq:
- * int.gcdlcm(int2) -> array
- *
- * Returns an array; [int.gcd(int2), int.lcm(int2)].
- *
- * For example:
- *
- * 2.gcdlcm(2) #=> [2, 2]
- * 3.gcdlcm(-7) #=> [1, 21]
- * ((1<<31)-1).gcdlcm((1<<61)-1) #=> [1, 4951760154835678088235319297]
- */
-VALUE
-rb_gcdlcm(VALUE self, VALUE other)
-{
- other = nurat_int_value(other);
- return rb_assoc_new(f_gcd(self, other), f_lcm(self, other));
-}
-
-VALUE
-rb_rational_raw(VALUE x, VALUE y)
-{
- return nurat_s_new_internal(rb_cRational, x, y);
-}
-
-VALUE
-rb_rational_new(VALUE x, VALUE y)
-{
- return nurat_s_canonicalize_internal(rb_cRational, x, y);
-}
-
-static VALUE nurat_s_convert(int argc, VALUE *argv, VALUE klass);
-
-VALUE
-rb_Rational(VALUE x, VALUE y)
-{
- VALUE a[2];
- a[0] = x;
- a[1] = y;
- return nurat_s_convert(2, a, rb_cRational);
-}
-
-#define id_numerator rb_intern("numerator")
-#define f_numerator(x) rb_funcall(x, id_numerator, 0)
-
-#define id_denominator rb_intern("denominator")
-#define f_denominator(x) rb_funcall(x, id_denominator, 0)
-
-#define id_to_r rb_intern("to_r")
-#define f_to_r(x) rb_funcall(x, id_to_r, 0)
-
-/*
- * call-seq:
- * num.numerator -> integer
- *
- * Returns the numerator.
- */
-static VALUE
-numeric_numerator(VALUE self)
-{
- return f_numerator(f_to_r(self));
-}
-
-/*
- * call-seq:
- * num.denominator -> integer
- *
- * Returns the denominator (always positive).
- */
-static VALUE
-numeric_denominator(VALUE self)
-{
- return f_denominator(f_to_r(self));
-}
-
-/*
- * call-seq:
- * int.numerator -> self
- *
- * Returns self.
- */
-static VALUE
-integer_numerator(VALUE self)
-{
- return self;
-}
-
-/*
- * call-seq:
- * int.denominator -> 1
- *
- * Returns 1.
- */
-static VALUE
-integer_denominator(VALUE self)
-{
- return INT2FIX(1);
-}
-
-/*
- * call-seq:
- * flo.numerator -> integer
- *
- * Returns the numerator. The result is machine dependent.
- *
- * For example:
- *
- * n = 0.3.numerator #=> 5404319552844595
- * d = 0.3.denominator #=> 18014398509481984
- * n.fdiv(d) #=> 0.3
- */
-static VALUE
-float_numerator(VALUE self)
-{
- double d = RFLOAT_VALUE(self);
- if (isinf(d) || isnan(d))
- return self;
- return rb_call_super(0, 0);
-}
-
-/*
- * call-seq:
- * flo.denominator -> integer
- *
- * Returns the denominator (always positive). The result is machine
- * dependent.
- *
- * See numerator.
- */
-static VALUE
-float_denominator(VALUE self)
-{
- double d = RFLOAT_VALUE(self);
- if (isinf(d) || isnan(d))
- return INT2FIX(1);
- return rb_call_super(0, 0);
-}
-
-/*
- * call-seq:
- * nil.to_r -> (0/1)
- *
- * Returns zero as a rational.
- */
-static VALUE
-nilclass_to_r(VALUE self)
-{
- return rb_rational_new1(INT2FIX(0));
-}
-
-/*
- * call-seq:
- * int.to_r -> rational
- *
- * Returns the value as a rational.
- *
- * For example:
- *
- * 1.to_r #=> (1/1)
- * (1<<64).to_r #=> (18446744073709551616/1)
- */
-static VALUE
-integer_to_r(VALUE self)
-{
- return rb_rational_new1(self);
-}
-
-static void
-float_decode_internal(VALUE self, VALUE *rf, VALUE *rn)
-{
- double f;
- int n;
-
- f = frexp(RFLOAT_VALUE(self), &n);
- f = ldexp(f, DBL_MANT_DIG);
- n -= DBL_MANT_DIG;
- *rf = rb_dbl2big(f);
- *rn = INT2FIX(n);
-}
-
-#if 0
-static VALUE
-float_decode(VALUE self)
-{
- VALUE f, n;
-
- float_decode_internal(self, &f, &n);
- return rb_assoc_new(f, n);
-}
-#endif
-
-/*
- * call-seq:
- * flt.to_r -> rational
- *
- * Returns the value as a rational.
- *
- * NOTE: 0.3.to_r isn't the same as '0.3'.to_r. The latter is
- * equivalent to '3/10'.to_r, but the former isn't so.
- *
- * For example:
- *
- * 2.0.to_r #=> (2/1)
- * 2.5.to_r #=> (5/2)
- * -0.75.to_r #=> (-3/4)
- * 0.0.to_r #=> (0/1)
- */
-static VALUE
-float_to_r(VALUE self)
-{
- VALUE f, n;
-
- float_decode_internal(self, &f, &n);
- return f_to_r(f_mul(f, f_expt(INT2FIX(FLT_RADIX), n)));
-}
-
-static VALUE rat_pat, an_e_pat, a_dot_pat, underscores_pat, an_underscore;
-
-#define WS "\\s*"
-#define DIGITS "(?:\\d(?:_\\d|\\d)*)"
-#define NUMERATOR "(?:" DIGITS "?\\.)?" DIGITS "(?:[eE][-+]?" DIGITS ")?"
-#define DENOMINATOR DIGITS
-#define PATTERN "\\A" WS "([-+])?(" NUMERATOR ")(?:\\/(" DENOMINATOR "))?" WS
-
-static void
-make_patterns(void)
-{
- static const char rat_pat_source[] = PATTERN;
- static const char an_e_pat_source[] = "[eE]";
- static const char a_dot_pat_source[] = "\\.";
- static const char underscores_pat_source[] = "_+";
-
- if (rat_pat) return;
-
- rat_pat = rb_reg_new(rat_pat_source, sizeof rat_pat_source - 1, 0);
- rb_gc_register_mark_object(rat_pat);
-
- an_e_pat = rb_reg_new(an_e_pat_source, sizeof an_e_pat_source - 1, 0);
- rb_gc_register_mark_object(an_e_pat);
-
- a_dot_pat = rb_reg_new(a_dot_pat_source, sizeof a_dot_pat_source - 1, 0);
- rb_gc_register_mark_object(a_dot_pat);
-
- underscores_pat = rb_reg_new(underscores_pat_source,
- sizeof underscores_pat_source - 1, 0);
- rb_gc_register_mark_object(underscores_pat);
-
- an_underscore = rb_usascii_str_new2("_");
- rb_gc_register_mark_object(an_underscore);
-}
-
-#define id_match rb_intern("match")
-#define f_match(x,y) rb_funcall(x, id_match, 1, y)
-
-#define id_aref rb_intern("[]")
-#define f_aref(x,y) rb_funcall(x, id_aref, 1, y)
-
-#define id_post_match rb_intern("post_match")
-#define f_post_match(x) rb_funcall(x, id_post_match, 0)
-
-#define id_split rb_intern("split")
-#define f_split(x,y) rb_funcall(x, id_split, 1, y)
-
-#include <ctype.h>
-
-static VALUE
-string_to_r_internal(VALUE self)
-{
- VALUE s, m;
-
- s = self;
-
- if (RSTRING_LEN(s) == 0)
- return rb_assoc_new(Qnil, self);
-
- m = f_match(rat_pat, s);
-
- if (!NIL_P(m)) {
- VALUE v, ifp, exp, ip, fp;
- VALUE si = f_aref(m, INT2FIX(1));
- VALUE nu = f_aref(m, INT2FIX(2));
- VALUE de = f_aref(m, INT2FIX(3));
- VALUE re = f_post_match(m);
-
- {
- VALUE a;
-
- a = f_split(nu, an_e_pat);
- ifp = RARRAY_PTR(a)[0];
- if (RARRAY_LEN(a) != 2)
- exp = Qnil;
- else
- exp = RARRAY_PTR(a)[1];
-
- a = f_split(ifp, a_dot_pat);
- ip = RARRAY_PTR(a)[0];
- if (RARRAY_LEN(a) != 2)
- fp = Qnil;
- else
- fp = RARRAY_PTR(a)[1];
- }
-
- v = rb_rational_new1(f_to_i(ip));
-
- if (!NIL_P(fp)) {
- char *p = StringValuePtr(fp);
- long count = 0;
- VALUE l;
-
- while (*p) {
- if (rb_isdigit(*p))
- count++;
- p++;
- }
-
- l = f_expt(INT2FIX(10), LONG2NUM(count));
- v = f_mul(v, l);
- v = f_add(v, f_to_i(fp));
- v = f_div(v, l);
- }
- if (!NIL_P(si) && *StringValuePtr(si) == '-')
- v = f_negate(v);
- if (!NIL_P(exp))
- v = f_mul(v, f_expt(INT2FIX(10), f_to_i(exp)));
-#if 0
- if (!NIL_P(de) && (!NIL_P(fp) || !NIL_P(exp)))
- return rb_assoc_new(v, rb_usascii_str_new2("dummy"));
-#endif
- if (!NIL_P(de))
- v = f_div(v, f_to_i(de));
-
- return rb_assoc_new(v, re);
- }
- return rb_assoc_new(Qnil, self);
-}
-
-static VALUE
-string_to_r_strict(VALUE self)
-{
- VALUE a = string_to_r_internal(self);
- if (NIL_P(RARRAY_PTR(a)[0]) || RSTRING_LEN(RARRAY_PTR(a)[1]) > 0) {
- VALUE s = f_inspect(self);
- rb_raise(rb_eArgError, "invalid value for convert(): %s",
- StringValuePtr(s));
- }
- return RARRAY_PTR(a)[0];
-}
-
-#define id_gsub rb_intern("gsub")
-#define f_gsub(x,y,z) rb_funcall(x, id_gsub, 2, y, z)
-
-/*
- * call-seq:
- * str.to_r -> rational
- *
- * Returns a rational which denotes the string form. The parser
- * ignores leading whitespaces and trailing garbage. Any digit
- * sequences can be separeted by an underscore. Returns zero for null
- * or garbage string.
- *
- * NOTE: '0.3'.to_r isn't the same as 0.3.to_r. The former is
- * equivalent to '3/10'.to_r, but the latter isn't so.
- *
- * For example:
- *
- * ' 2 '.to_r #=> (2/1)
- * '300/2'.to_r #=> (150/1)
- * '-9.2'.to_r #=> (-46/5)
- * '-9.2e2'.to_r #=> (-920/1)
- * '1_234_567'.to_r #=> (1234567/1)
- * '21 june 09'.to_r #=> (21/1)
- * '21/06/09'.to_r #=> (7/2)
- * 'bwv 1079'.to_r #=> (0/1)
- */
-static VALUE
-string_to_r(VALUE self)
-{
- VALUE s, a, backref;
-
- backref = rb_backref_get();
- rb_match_busy(backref);
-
- s = f_gsub(self, underscores_pat, an_underscore);
- a = string_to_r_internal(s);
-
- rb_backref_set(backref);
-
- if (!NIL_P(RARRAY_PTR(a)[0]))
- return RARRAY_PTR(a)[0];
- return rb_rational_new1(INT2FIX(0));
-}
-
-#define id_to_r rb_intern("to_r")
-#define f_to_r(x) rb_funcall(x, id_to_r, 0)
-
-static VALUE
-nurat_s_convert(int argc, VALUE *argv, VALUE klass)
-{
- VALUE a1, a2, backref;
-
- 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 Rational");
-
- switch (TYPE(a1)) {
- case T_COMPLEX:
- if (k_exact_zero_p(RCOMPLEX(a1)->imag))
- a1 = RCOMPLEX(a1)->real;
- }
-
- switch (TYPE(a2)) {
- case T_COMPLEX:
- if (k_exact_zero_p(RCOMPLEX(a2)->imag))
- a2 = RCOMPLEX(a2)->real;
- }
-
- backref = rb_backref_get();
- rb_match_busy(backref);
-
- switch (TYPE(a1)) {
- case T_FIXNUM:
- case T_BIGNUM:
- break;
- case T_FLOAT:
- a1 = f_to_r(a1);
- break;
- case T_STRING:
- a1 = string_to_r_strict(a1);
- break;
- }
-
- switch (TYPE(a2)) {
- case T_FIXNUM:
- case T_BIGNUM:
- break;
- case T_FLOAT:
- a2 = f_to_r(a2);
- break;
- case T_STRING:
- a2 = string_to_r_strict(a2);
- break;
- }
-
- rb_backref_set(backref);
-
- switch (TYPE(a1)) {
- case T_RATIONAL:
- if (argc == 1 || (k_exact_one_p(a2)))
- return a1;
- }
-
- if (argc == 1) {
- if (!(k_numeric_p(a1) && k_integer_p(a1)))
- return rb_convert_type(a1, T_RATIONAL, "Rational", "to_r");
- }
- else {
- if ((k_numeric_p(a1) && k_numeric_p(a2)) &&
- (!f_integer_p(a1) || !f_integer_p(a2)))
- return f_div(a1, a2);
- }
-
- {
- VALUE argv2[2];
- argv2[0] = a1;
- argv2[1] = a2;
- return nurat_s_new(argc, argv2, klass);
- }
-}
-
-/*
- * A rational number can be represented as a paired integer number;
- * a/b (b>0). Where a is numerator and b is denominator. Integer a
- * equals rational a/1 mathematically.
- *
- * In ruby, you can create rational object with Rational or to_r
- * method. The return values will be irreducible.
- *
- * Rational(1) #=> (1/1)
- * Rational(2, 3) #=> (2/3)
- * Rational(4, -6) #=> (-2/3)
- * 3.to_r #=> (3/1)
- *
- * You can also create ratioanl object from floating-point numbers or
- * strings.
- *
- * Rational(0.3) #=> (5404319552844595/18014398509481984)
- * Rational('0.3') #=> (3/10)
- * Rational('2/3') #=> (2/3)
- *
- * 0.3.to_r #=> (5404319552844595/18014398509481984)
- * '0.3'.to_r #=> (3/10)
- * '2/3'.to_r #=> (2/3)
- *
- * A rational object is an exact number, which helps you to write
- * program without any rounding errors.
- *
- * 10.times.inject(0){|t,| t + 0.1} #=> 0.9999999999999999
- * 10.times.inject(0){|t,| t + Rational('0.1')} #=> (1/1)
- *
- * However, when an expression has inexact factor (numerical value or
- * operation), will produce an inexact result.
- *
- * Rational(10) / 3 #=> (10/3)
- * Rational(10) / 3.0 #=> 3.3333333333333335
- *
- * Rational(-8) ** Rational(1, 3)
- * #=> (1.0000000000000002+1.7320508075688772i)
- */
-void
-Init_Rational(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_cmp = rb_intern("<=>");
- id_convert = rb_intern("convert");
- id_eqeq_p = rb_intern("==");
- id_expt = rb_intern("**");
- id_fdiv = rb_intern("fdiv");
- id_floor = rb_intern("floor");
- id_idiv = rb_intern("div");
- id_inspect = rb_intern("inspect");
- id_integer_p = rb_intern("integer?");
- id_negate = rb_intern("-@");
- id_to_f = rb_intern("to_f");
- id_to_i = rb_intern("to_i");
- id_to_s = rb_intern("to_s");
- id_truncate = rb_intern("truncate");
-
- rb_cRational = rb_define_class("Rational", rb_cNumeric);
-
- rb_define_alloc_func(rb_cRational, nurat_s_alloc);
- rb_undef_method(CLASS_OF(rb_cRational), "allocate");
-
-#if 0
- rb_define_private_method(CLASS_OF(rb_cRational), "new!", nurat_s_new_bang, -1);
- rb_define_private_method(CLASS_OF(rb_cRational), "new", nurat_s_new, -1);
-#else
- rb_undef_method(CLASS_OF(rb_cRational), "new");
-#endif
-
- rb_define_global_function("Rational", nurat_f_rational, -1);
-
- rb_define_method(rb_cRational, "numerator", nurat_numerator, 0);
- rb_define_method(rb_cRational, "denominator", nurat_denominator, 0);
-
- rb_define_method(rb_cRational, "+", nurat_add, 1);
- rb_define_method(rb_cRational, "-", nurat_sub, 1);
- rb_define_method(rb_cRational, "*", nurat_mul, 1);
- rb_define_method(rb_cRational, "/", nurat_div, 1);
- rb_define_method(rb_cRational, "quo", nurat_div, 1);
- rb_define_method(rb_cRational, "fdiv", nurat_fdiv, 1);
- rb_define_method(rb_cRational, "**", nurat_expt, 1);
-
- rb_define_method(rb_cRational, "<=>", nurat_cmp, 1);
- rb_define_method(rb_cRational, "==", nurat_eqeq_p, 1);
- rb_define_method(rb_cRational, "coerce", nurat_coerce, 1);
-
-#if 0 /* NUBY */
- rb_define_method(rb_cRational, "//", nurat_idiv, 1);
-#endif
-
-#if 0
- rb_define_method(rb_cRational, "quot", nurat_quot, 1);
- rb_define_method(rb_cRational, "quotrem", nurat_quotrem, 1);
-#endif
-
-#if 0
- rb_define_method(rb_cRational, "rational?", nurat_true, 0);
- rb_define_method(rb_cRational, "exact?", nurat_true, 0);
-#endif
-
- rb_define_method(rb_cRational, "floor", nurat_floor_n, -1);
- rb_define_method(rb_cRational, "ceil", nurat_ceil_n, -1);
- rb_define_method(rb_cRational, "truncate", nurat_truncate_n, -1);
- rb_define_method(rb_cRational, "round", nurat_round_n, -1);
-
- rb_define_method(rb_cRational, "to_i", nurat_truncate, 0);
- rb_define_method(rb_cRational, "to_f", nurat_to_f, 0);
- rb_define_method(rb_cRational, "to_r", nurat_to_r, 0);
-
- rb_define_method(rb_cRational, "hash", nurat_hash, 0);
-
- rb_define_method(rb_cRational, "to_s", nurat_to_s, 0);
- rb_define_method(rb_cRational, "inspect", nurat_inspect, 0);
-
- rb_define_method(rb_cRational, "marshal_dump", nurat_marshal_dump, 0);
- rb_define_method(rb_cRational, "marshal_load", nurat_marshal_load, 1);
-
- /* --- */
-
- rb_define_method(rb_cInteger, "gcd", rb_gcd, 1);
- rb_define_method(rb_cInteger, "lcm", rb_lcm, 1);
- rb_define_method(rb_cInteger, "gcdlcm", rb_gcdlcm, 1);
-
- rb_define_method(rb_cNumeric, "numerator", numeric_numerator, 0);
- rb_define_method(rb_cNumeric, "denominator", numeric_denominator, 0);
-
- rb_define_method(rb_cInteger, "numerator", integer_numerator, 0);
- rb_define_method(rb_cInteger, "denominator", integer_denominator, 0);
-
- rb_define_method(rb_cFloat, "numerator", float_numerator, 0);
- rb_define_method(rb_cFloat, "denominator", float_denominator, 0);
-
- rb_define_method(rb_cNilClass, "to_r", nilclass_to_r, 0);
- rb_define_method(rb_cInteger, "to_r", integer_to_r, 0);
- rb_define_method(rb_cFloat, "to_r", float_to_r, 0);
-
- make_patterns();
-
- rb_define_method(rb_cString, "to_r", string_to_r, 0);
-
- rb_define_private_method(CLASS_OF(rb_cRational), "convert", nurat_s_convert, -1);
-}
-
-/*
-Local variables:
-c-file-style: "ruby"
-End:
-*/
diff --git a/re.c b/re.c
index 447728da09..f2ac99f9ff 100644
--- a/re.c
+++ b/re.c
@@ -5,22 +5,16 @@
$Author$
created at: Mon Aug 9 18:24:49 JST 1993
- Copyright (C) 1993-2007 Yukihiro Matsumoto
+ Copyright (C) 1993-2003 Yukihiro Matsumoto
**********************************************************************/
-#include "ruby/ruby.h"
-#include "ruby/re.h"
-#include "ruby/encoding.h"
-#include "ruby/util.h"
-#include "regint.h"
+#include "ruby.h"
+#include "re.h"
#include <ctype.h>
VALUE rb_eRegexpError;
-typedef char onig_errmsg_buffer[ONIG_MAX_ERROR_MESSAGE_LEN];
-#define errcpy(err, msg) strlcpy((err), (msg), ONIG_MAX_ERROR_MESSAGE_LEN)
-
#define BEG(no) regs->beg[no]
#define END(no) regs->end[no]
@@ -76,324 +70,297 @@ static const char casetable[] = {
#endif
int
-rb_memcicmp(const void *x, const void *y, long len)
+rb_memcicmp(x, y, len)
+ const void *x, *y;
+ long len;
{
const unsigned char *p1 = x, *p2 = y;
int tmp;
while (len--) {
- if ((tmp = casetable[(unsigned)*p1++] - casetable[(unsigned)*p2++]))
+ if ((tmp = casetable[(unsigned)*p1++] - casetable[(unsigned)*p2++]) != 0)
return tmp;
}
return 0;
}
-#undef rb_memcmp
-
int
-rb_memcmp(const void *p1, const void *p2, long len)
+rb_memcmp(p1, p2, len)
+ const void *p1, *p2;
+ long len;
{
- return memcmp(p1, p2, len);
+ if (!ruby_ignorecase) {
+ return memcmp(p1, p2, len);
+ }
+ return rb_memcicmp(p1, p2, len);
}
-static inline long
-rb_memsearch_ss(const unsigned char *xs, long m, const unsigned char *ys, long n)
+long
+rb_memsearch(x0, m, y0, n)
+ const void *x0, *y0;
+ long m, n;
{
- const unsigned char *x = xs, *xe = xs + m;
- const unsigned char *y = ys, *ye = ys + n;
-#ifndef VALUE_MAX
-# if SIZEOF_VALUE == 8
-# define VALUE_MAX 0xFFFFFFFFFFFFFFFFULL
-# elif SIZEOF_VALUE == 4
-# define VALUE_MAX 0xFFFFFFFFUL
-# endif
-#endif
- VALUE hx, hy, mask = VALUE_MAX >> ((SIZEOF_VALUE - m) * CHAR_BIT);
+ const unsigned char *x = (unsigned char *)x0, *y = (unsigned char *)y0;
+ const unsigned char *s, *e;
+ long i;
+ int d;
+ unsigned long hx, hy;
- if (m > SIZEOF_VALUE)
- rb_bug("!!too long pattern string!!");
+#define KR_REHASH(a, b, h) (((h) << 1) - (((unsigned long)(a))<<d) + (b))
- /* Prepare hash value */
- for (hx = *x++, hy = *y++; x < xe; ++x, ++y) {
- hx <<= CHAR_BIT;
- hy <<= CHAR_BIT;
- hx |= *x;
- hy |= *y;
- }
- /* Searching */
- while (hx != hy) {
- if (y == ye)
- return -1;
- hy <<= CHAR_BIT;
- hy |= *y;
- hy &= mask;
- y++;
- }
- return y - ys - m;
-}
-
-static inline long
-rb_memsearch_qs(const unsigned char *xs, long m, const unsigned char *ys, long n)
-{
- const unsigned char *x = xs, *xe = xs + m;
- const unsigned char *y = ys;
- VALUE i, qstable[256];
+ if (m > n) return -1;
+ s = y; e = s + n - m;
/* Preprocessing */
- for (i = 0; i < 256; ++i)
- qstable[i] = m + 1;
- for (; x < xe; ++x)
- qstable[*x] = xe - x;
- /* Searching */
- for (; y + m <= ys + n; y += *(qstable + y[m])) {
- if (*xs == *y && memcmp(xs, y, m) == 0)
- return y - ys;
- }
- return -1;
-}
-
-static inline unsigned int
-rb_memsearch_qs_utf8_hash(const unsigned char *x)
-{
- register const unsigned int mix = 8353;
- register unsigned int h = *x;
- if (h < 0xC0) {
- return h + 256;
- }
- else if (h < 0xE0) {
- h *= mix;
- h += x[1];
- }
- else if (h < 0xF0) {
- h *= mix;
- h += x[1];
- h *= mix;
- h += x[2];
- }
- else if (h < 0xF5) {
- h *= mix;
- h += x[1];
- h *= mix;
- h += x[2];
- h *= mix;
- h += x[3];
+ /* computes d = 2^(m-1) with
+ the left-shift operator */
+ d = sizeof(hx) * CHAR_BIT - 1;
+ if (d > m) d = m;
+
+ if (ruby_ignorecase) {
+ if (n == m) {
+ return rb_memcicmp(x, s, m) == 0 ? 0 : -1;
+ }
+ /* Prepare hash value */
+ for (hy = hx = i = 0; i < d; ++i) {
+ hx = KR_REHASH(0, casetable[x[i]], hx);
+ hy = KR_REHASH(0, casetable[s[i]], hy);
+ }
+ /* Searching */
+ while (hx != hy || rb_memcicmp(x, s, m)) {
+ if (s >= e) return -1;
+ hy = KR_REHASH(casetable[*s], casetable[*(s+d)], hy);
+ s++;
+ }
}
else {
- return h + 256;
+ if (n == m) {
+ return memcmp(x, s, m) == 0 ? 0 : -1;
+ }
+ /* Prepare hash value */
+ for (hy = hx = i = 0; i < d; ++i) {
+ hx = KR_REHASH(0, x[i], hx);
+ hy = KR_REHASH(0, s[i], hy);
+ }
+ /* Searching */
+ while (hx != hy || memcmp(x, s, m)) {
+ if (s >= e) return -1;
+ hy = KR_REHASH(*s, *(s+d), hy);
+ s++;
+ }
}
- return (unsigned char)h;
+ return s-y;
}
-static inline long
-rb_memsearch_qs_utf8(const unsigned char *xs, long m, const unsigned char *ys, long n)
-{
- const unsigned char *x = xs, *xe = xs + m;
- const unsigned char *y = ys;
- VALUE i, qstable[512];
+#define REG_LITERAL FL_USER5
+#define REG_CASESTATE FL_USER0
+#define KCODE_NONE 0
+#define KCODE_EUC FL_USER1
+#define KCODE_SJIS FL_USER2
+#define KCODE_UTF8 FL_USER3
+#define KCODE_FIXED FL_USER4
+#define KCODE_MASK (KCODE_EUC|KCODE_SJIS|KCODE_UTF8)
- /* Preprocessing */
- for (i = 0; i < 512; ++i) {
- qstable[i] = m + 1;
- }
- for (; x < xe; ++x) {
- qstable[rb_memsearch_qs_utf8_hash(x)] = xe - x;
- }
- /* Searching */
- for (; y + m <= ys + n; y += qstable[rb_memsearch_qs_utf8_hash(y+m)]) {
- if (*xs == *y && memcmp(xs, y, m) == 0)
- return y - ys;
- }
- return -1;
-}
+static int reg_kcode = DEFAULT_KCODE;
-long
-rb_memsearch(const void *x0, long m, const void *y0, long n, rb_encoding *enc)
+static void
+kcode_euc(re)
+ struct RRegexp *re;
{
- const unsigned char *x = x0, *y = y0;
+ FL_UNSET(re, KCODE_MASK);
+ FL_SET(re, KCODE_EUC);
+ FL_SET(re, KCODE_FIXED);
+}
- if (m > n) return -1;
- else if (m == n) {
- return memcmp(x0, y0, m) == 0 ? 0 : -1;
- }
- else if (m < 1) {
- return 0;
- }
- else if (m == 1) {
- const unsigned char *ys = y, *ye = ys + n;
- for (; y < ye; ++y) {
- if (*x == *y)
- return y - ys;
- }
- return -1;
- }
- else if (m <= SIZEOF_VALUE) {
- return rb_memsearch_ss(x0, m, y0, n);
- }
- else if (enc == rb_utf8_encoding()){
- return rb_memsearch_qs_utf8(x0, m, y0, n);
- }
- else {
- return rb_memsearch_qs(x0, m, y0, n);
- }
+static void
+kcode_sjis(re)
+ struct RRegexp *re;
+{
+ FL_UNSET(re, KCODE_MASK);
+ FL_SET(re, KCODE_SJIS);
+ FL_SET(re, KCODE_FIXED);
}
-#define REG_LITERAL FL_USER5
-#define REG_ENCODING_NONE FL_USER6
+static void
+kcode_utf8(re)
+ struct RRegexp *re;
+{
+ FL_UNSET(re, KCODE_MASK);
+ FL_SET(re, KCODE_UTF8);
+ FL_SET(re, KCODE_FIXED);
+}
-#define KCODE_FIXED FL_USER4
+static void
+kcode_none(re)
+ struct RRegexp *re;
+{
+ FL_UNSET(re, KCODE_MASK);
+ FL_SET(re, KCODE_FIXED);
+}
-#define ARG_REG_OPTION_MASK \
- (ONIG_OPTION_IGNORECASE|ONIG_OPTION_MULTILINE|ONIG_OPTION_EXTEND)
-#define ARG_ENCODING_FIXED 16
-#define ARG_ENCODING_NONE 32
+static int curr_kcode;
-static int
-char_to_option(int c)
+void
+rb_kcode_set_option(re)
+ VALUE re;
{
- int val;
+ if (!FL_TEST(re, KCODE_FIXED)) return;
- switch (c) {
- case 'i':
- val = ONIG_OPTION_IGNORECASE;
+ curr_kcode = RBASIC(re)->flags & KCODE_MASK;
+ if (reg_kcode == curr_kcode) return;
+ switch (curr_kcode) {
+ case KCODE_NONE:
+ re_mbcinit(MBCTYPE_ASCII);
break;
- case 'x':
- val = ONIG_OPTION_EXTEND;
+ case KCODE_EUC:
+ re_mbcinit(MBCTYPE_EUC);
break;
- case 'm':
- val = ONIG_OPTION_MULTILINE;
+ case KCODE_SJIS:
+ re_mbcinit(MBCTYPE_SJIS);
break;
- default:
- val = 0;
+ case KCODE_UTF8:
+ re_mbcinit(MBCTYPE_UTF8);
break;
}
- return val;
-}
+}
-static char *
-option_to_str(char str[4], int options)
-{
- char *p = str;
- if (options & ONIG_OPTION_MULTILINE) *p++ = 'm';
- if (options & ONIG_OPTION_IGNORECASE) *p++ = 'i';
- if (options & ONIG_OPTION_EXTEND) *p++ = 'x';
- *p = 0;
- return str;
-}
-
-extern int
-rb_char_to_option_kcode(int c, int *option, int *kcode)
+void
+rb_kcode_reset_option()
{
- *option = 0;
-
- switch (c) {
- case 'n':
- *kcode = -1;
- return (*option = ARG_ENCODING_NONE);
- case 'e':
- *kcode = rb_enc_find_index("EUC-JP");
+ if (reg_kcode == curr_kcode) return;
+ switch (reg_kcode) {
+ case KCODE_NONE:
+ re_mbcinit(MBCTYPE_ASCII);
break;
- case 's':
- *kcode = rb_enc_find_index("Windows-31J");
+ case KCODE_EUC:
+ re_mbcinit(MBCTYPE_EUC);
break;
- case 'u':
- *kcode = rb_enc_find_index("UTF-8");
+ case KCODE_SJIS:
+ re_mbcinit(MBCTYPE_SJIS);
+ break;
+ case KCODE_UTF8:
+ re_mbcinit(MBCTYPE_UTF8);
break;
- default:
- *kcode = -1;
- return (*option = char_to_option(c));
}
- *option = ARG_ENCODING_FIXED;
- return 1;
+}
+
+int
+rb_reg_mbclen2(c, re)
+ unsigned int c;
+ VALUE re;
+{
+ int len;
+
+ if (!FL_TEST(re, KCODE_FIXED))
+ return mbclen(c);
+ rb_kcode_set_option(re);
+ len = mbclen(c);
+ rb_kcode_reset_option();
+ return len;
}
static void
-rb_reg_check(VALUE re)
+rb_reg_check(re)
+ VALUE re;
{
- if (!RREGEXP(re)->ptr || !RREGEXP_SRC(re) || !RREGEXP_SRC_PTR(re)) {
+ if (!RREGEXP(re)->ptr || !RREGEXP(re)->str) {
rb_raise(rb_eTypeError, "uninitialized Regexp");
}
}
+extern int ruby_in_compile;
+
static void
-rb_reg_expr_str(VALUE str, const char *s, long len)
+rb_reg_expr_str(str, s, len)
+ VALUE str;
+ const char *s;
+ long len;
{
- rb_encoding *enc = rb_enc_get(str);
const char *p, *pend;
int need_escape = 0;
- int c, clen;
p = s; pend = p + len;
while (p<pend) {
- c = rb_enc_ascget(p, pend, &clen, enc);
- if (c == -1) {
- p += mbclen(p, pend, enc);
- }
- else if (c != '/' && rb_enc_isprint(c, enc)) {
- p += clen;
- }
- else {
+ if (*p == '/' || (!ISPRINT(*p) && !ismbchar(*p))) {
need_escape = 1;
break;
- }
+ }
+ p += mbclen(*p);
}
if (!need_escape) {
rb_str_buf_cat(str, s, len);
}
else {
- p = s;
+ p = s;
while (p<pend) {
- c = rb_enc_ascget(p, pend, &clen, enc);
- if (c == '\\' && p+clen < pend) {
- int n = clen + mbclen(p+clen, pend, enc);
+ if (*p == '\\') {
+ int n = mbclen(p[1]) + 1;
rb_str_buf_cat(str, p, n);
p += n;
continue;
}
- else if (c == '/') {
+ else if (*p == '/') {
char c = '\\';
rb_str_buf_cat(str, &c, 1);
- rb_str_buf_cat(str, p, clen);
+ rb_str_buf_cat(str, p, 1);
}
- else if (c == -1) {
- int l = mbclen(p, pend, enc);
- rb_str_buf_cat(str, p, l);
- p += l;
+ else if (ismbchar(*p)) {
+ rb_str_buf_cat(str, p, mbclen(*p));
+ p += mbclen(*p);
continue;
}
- else if (rb_enc_isprint(c, enc)) {
- rb_str_buf_cat(str, p, clen);
+ else if (ISPRINT(*p)) {
+ rb_str_buf_cat(str, p, 1);
}
- else if (!rb_enc_isspace(c, enc)) {
+ else if (!ISSPACE(*p)) {
char b[8];
- snprintf(b, sizeof(b), "\\x%02X", c);
+ sprintf(b, "\\%03o", *p & 0377);
rb_str_buf_cat(str, b, 4);
}
else {
- rb_str_buf_cat(str, p, clen);
+ rb_str_buf_cat(str, p, 1);
}
- p += clen;
+ p++;
}
}
}
static VALUE
-rb_reg_desc(const char *s, long len, VALUE re)
+rb_reg_desc(s, len, re)
+ const char *s;
+ long len;
+ VALUE re;
{
VALUE str = rb_str_buf_new2("/");
- if (re && rb_enc_asciicompat(rb_enc_get(re))) {
- rb_enc_copy(str, re);
- }
- else {
- rb_enc_associate(str, rb_usascii_encoding());
- }
+
rb_reg_expr_str(str, s, len);
rb_str_buf_cat2(str, "/");
if (re) {
- char opts[4];
rb_reg_check(re);
- if (*option_to_str(opts, RREGEXP(re)->ptr->options))
- rb_str_buf_cat2(str, opts);
+ if (RREGEXP(re)->ptr->options & RE_OPTION_MULTILINE)
+ rb_str_buf_cat2(str, "m");
+ if (RREGEXP(re)->ptr->options & RE_OPTION_IGNORECASE)
+ rb_str_buf_cat2(str, "i");
+ if (RREGEXP(re)->ptr->options & RE_OPTION_EXTENDED)
+ rb_str_buf_cat2(str, "x");
+
+ if (FL_TEST(re, KCODE_FIXED)) {
+ switch ((RBASIC(re)->flags & KCODE_MASK)) {
+ case KCODE_NONE:
+ rb_str_buf_cat2(str, "n");
+ break;
+ case KCODE_EUC:
+ rb_str_buf_cat2(str, "e");
+ break;
+ case KCODE_SJIS:
+ rb_str_buf_cat2(str, "s");
+ break;
+ case KCODE_UTF8:
+ rb_str_buf_cat2(str, "u");
+ break;
+ }
+ }
}
OBJ_INFECT(str, re);
return str;
@@ -402,25 +369,21 @@ rb_reg_desc(const char *s, long len, VALUE re)
/*
* call-seq:
- * rxp.source => str
- *
+ * rxp.source => str
+ *
* Returns the original string of the pattern.
- *
- * /ab+c/ix.source #=> "ab+c"
- *
- * Note that escape sequences are retained as is.
- *
- * /\x20\+/.source #=> "\\x20\\+"
- *
+ *
+ * /ab+c/ix.source #=> "ab+c"
*/
static VALUE
-rb_reg_source(VALUE re)
+rb_reg_source(re)
+ VALUE re;
{
VALUE str;
rb_reg_check(re);
- str = rb_enc_str_new(RREGEXP_SRC_PTR(re),RREGEXP_SRC_LEN(re), rb_enc_get(re));
+ str = rb_str_new(RREGEXP(re)->str,RREGEXP(re)->len);
if (OBJ_TAINTED(re)) OBJ_TAINT(str);
return str;
}
@@ -433,69 +396,69 @@ rb_reg_source(VALUE re)
* <code>#inspect</code> actually produces the more natural version of
* the string than <code>#to_s</code>.
*
- * /ab+c/ix.inspect #=> "/ab+c/ix"
- *
- */
+ * /ab+c/ix.to_s #=> /ab+c/ix
+*/
static VALUE
-rb_reg_inspect(VALUE re)
+rb_reg_inspect(re)
+ VALUE re;
{
- if (!RREGEXP(re)->ptr || !RREGEXP_SRC(re) || !RREGEXP_SRC_PTR(re)) {
- return rb_any_to_s(re);
- }
- return rb_reg_desc(RREGEXP_SRC_PTR(re), RREGEXP_SRC_LEN(re), re);
+ rb_reg_check(re);
+ return rb_reg_desc(RREGEXP(re)->str, RREGEXP(re)->len, re);
}
/*
* call-seq:
* rxp.to_s => str
- *
+ *
* Returns a string containing the regular expression and its options (using the
- * <code>(?opts:source)</code> notation. This string can be fed back in to
+ * <code>(?xxx:yyy)</code> notation. This string can be fed back in to
* <code>Regexp::new</code> to a regular expression with the same semantics as
* the original. (However, <code>Regexp#==</code> may not return true when
* comparing the two, as the source of the regular expression itself may
* differ, as the example shows). <code>Regexp#inspect</code> produces a
* generally more readable version of <i>rxp</i>.
- *
- * r1 = /ab+c/ix #=> /ab+c/ix
- * s1 = r1.to_s #=> "(?ix-m:ab+c)"
- * r2 = Regexp.new(s1) #=> /(?ix-m:ab+c)/
- * r1 == r2 #=> false
- * r1.source #=> "ab+c"
- * r2.source #=> "(?ix-m:ab+c)"
+ *
+ * r1 = /ab+c/ix #=> /ab+c/ix
+ * s1 = r1.to_s #=> "(?ix-m:ab+c)"
+ * r2 = Regexp.new(s1) #=> /(?ix-m:ab+c)/
+ * r1 == r2 #=> false
+ * r1.source #=> "ab+c"
+ * r2.source #=> "(?ix-m:ab+c)"
*/
static VALUE
-rb_reg_to_s(VALUE re)
+rb_reg_to_s(re)
+ VALUE re;
{
- int options, opt;
- const int embeddable = ONIG_OPTION_MULTILINE|ONIG_OPTION_IGNORECASE|ONIG_OPTION_EXTEND;
+ int options;
+ const int embeddable = RE_OPTION_MULTILINE|RE_OPTION_IGNORECASE|RE_OPTION_EXTENDED;
long len;
- const UChar* ptr;
+ const char* ptr;
VALUE str = rb_str_buf_new2("(?");
- char optbuf[5];
rb_reg_check(re);
- rb_enc_copy(str, re);
options = RREGEXP(re)->ptr->options;
- ptr = (UChar*)RREGEXP_SRC_PTR(re);
- len = RREGEXP_SRC_LEN(re);
+ ptr = RREGEXP(re)->str;
+ len = RREGEXP(re)->len;
again:
if (len >= 4 && ptr[0] == '(' && ptr[1] == '?') {
int err = 1;
ptr += 2;
if ((len -= 2) > 0) {
do {
- opt = char_to_option((int )*ptr);
- if (opt != 0) {
- options |= opt;
- }
- else {
- break;
- }
+ if (*ptr == 'm') {
+ options |= RE_OPTION_MULTILINE;
+ }
+ else if (*ptr == 'i') {
+ options |= RE_OPTION_IGNORECASE;
+ }
+ else if (*ptr == 'x') {
+ options |= RE_OPTION_EXTENDED;
+ }
+ else break;
++ptr;
} while (--len > 0);
}
@@ -503,13 +466,16 @@ rb_reg_to_s(VALUE re)
++ptr;
--len;
do {
- opt = char_to_option((int )*ptr);
- if (opt != 0) {
- options &= ~opt;
- }
- else {
- break;
- }
+ if (*ptr == 'm') {
+ options &= ~RE_OPTION_MULTILINE;
+ }
+ else if (*ptr == 'i') {
+ options &= ~RE_OPTION_IGNORECASE;
+ }
+ else if (*ptr == 'x') {
+ options &= ~RE_OPTION_EXTENDED;
+ }
+ else break;
++ptr;
} while (--len > 0);
}
@@ -519,102 +485,69 @@ rb_reg_to_s(VALUE re)
goto again;
}
if (*ptr == ':' && ptr[len-1] == ')') {
- int r;
Regexp *rp;
- r = onig_alloc_init(&rp, ONIG_OPTION_DEFAULT,
- ONIGENC_CASE_FOLD_DEFAULT,
- rb_enc_get(re),
- OnigDefaultSyntax);
- if (r == 0) {
- ++ptr;
- len -= 2;
- err = (onig_compile(rp, ptr, ptr + len, NULL) != 0);
- }
- onig_free(rp);
+ rb_kcode_set_option(re);
+ rp = ALLOC(Regexp);
+ MEMZERO((char *)rp, Regexp, 1);
+ err = re_compile_pattern(++ptr, len -= 2, rp) != 0;
+ rb_kcode_reset_option();
+ re_free_pattern(rp);
}
if (err) {
options = RREGEXP(re)->ptr->options;
- ptr = (UChar*)RREGEXP_SRC_PTR(re);
- len = RREGEXP_SRC_LEN(re);
+ ptr = RREGEXP(re)->str;
+ len = RREGEXP(re)->len;
}
}
- if (*option_to_str(optbuf, options)) rb_str_buf_cat2(str, optbuf);
+ if (options & RE_OPTION_MULTILINE) rb_str_buf_cat2(str, "m");
+ if (options & RE_OPTION_IGNORECASE) rb_str_buf_cat2(str, "i");
+ if (options & RE_OPTION_EXTENDED) rb_str_buf_cat2(str, "x");
if ((options & embeddable) != embeddable) {
- optbuf[0] = '-';
- option_to_str(optbuf + 1, ~options);
- rb_str_buf_cat2(str, optbuf);
+ rb_str_buf_cat2(str, "-");
+ if (!(options & RE_OPTION_MULTILINE)) rb_str_buf_cat2(str, "m");
+ if (!(options & RE_OPTION_IGNORECASE)) rb_str_buf_cat2(str, "i");
+ if (!(options & RE_OPTION_EXTENDED)) rb_str_buf_cat2(str, "x");
}
rb_str_buf_cat2(str, ":");
- rb_reg_expr_str(str, (char*)ptr, len);
+ rb_reg_expr_str(str, ptr, len);
rb_str_buf_cat2(str, ")");
- rb_enc_copy(str, re);
OBJ_INFECT(str, re);
return str;
}
static void
-rb_reg_raise(const char *s, long len, const char *err, VALUE re)
+rb_reg_raise(s, len, err, re)
+ const char *s;
+ long len;
+ const char *err;
+ VALUE re;
{
VALUE desc = rb_reg_desc(s, len, re);
- rb_raise(rb_eRegexpError, "%s: %s", err, RSTRING_PTR(desc));
-}
-
-static VALUE
-rb_enc_reg_error_desc(const char *s, long len, rb_encoding *enc, int options, const char *err)
-{
- char opts[6];
- VALUE desc = rb_str_buf_new2(err);
-
- rb_enc_associate(desc, enc);
- rb_str_buf_cat2(desc, ": /");
- rb_reg_expr_str(desc, s, len);
- opts[0] = '/';
- option_to_str(opts + 1, options);
- rb_str_buf_cat2(desc, opts);
- return rb_exc_new3(rb_eRegexpError, desc);
-}
-
-static void
-rb_enc_reg_raise(const char *s, long len, rb_encoding *enc, int options, const char *err)
-{
- rb_exc_raise(rb_enc_reg_error_desc(s, len, enc, options, err));
-}
-
-static VALUE
-rb_reg_error_desc(VALUE str, int options, const char *err)
-{
- return rb_enc_reg_error_desc(RSTRING_PTR(str), RSTRING_LEN(str),
- rb_enc_get(str), options, err);
-}
-
-static void
-rb_reg_raise_str(VALUE str, int options, const char *err)
-{
- rb_exc_raise(rb_reg_error_desc(str, options, err));
+ if (ruby_in_compile)
+ rb_compile_error("%s: %s", err, RSTRING(desc)->ptr);
+ else
+ rb_raise(rb_eRegexpError, "%s: %s", err, RSTRING(desc)->ptr);
}
/*
* call-seq:
* rxp.casefold? => true or false
- *
+ *
* Returns the value of the case-insensitive flag.
- *
- * /a/.casefold? #=> false
- * /a/i.casefold? #=> true
- * /(?i:a)/.casefold? #=> false
*/
static VALUE
-rb_reg_casefold_p(VALUE re)
+rb_reg_casefold_p(re)
+ VALUE re;
{
rb_reg_check(re);
- if (RREGEXP(re)->ptr->options & ONIG_OPTION_IGNORECASE) return Qtrue;
+ if (RREGEXP(re)->ptr->options & RE_OPTION_IGNORECASE) return Qtrue;
return Qfalse;
}
@@ -622,120 +555,75 @@ rb_reg_casefold_p(VALUE re)
/*
* call-seq:
* rxp.options => fixnum
- *
+ *
* Returns the set of bits corresponding to the options used when creating this
* Regexp (see <code>Regexp::new</code> for details. Note that additional bits
* may be set in the returned options: these are used internally by the regular
* expression code. These extra bits are ignored if the options are passed to
* <code>Regexp::new</code>.
- *
+ *
* Regexp::IGNORECASE #=> 1
* Regexp::EXTENDED #=> 2
* Regexp::MULTILINE #=> 4
- *
- * /cat/.options #=> 0
- * /cat/ix.options #=> 3
- * Regexp.new('cat', true).options #=> 1
- * /\xa1\xa2/e.options #=> 16
- *
+ *
+ * /cat/.options #=> 128
+ * /cat/ix.options #=> 131
+ * Regexp.new('cat', true).options #=> 129
+ * Regexp.new('cat', 0, 's').options #=> 384
+ *
* r = /cat/ix
* Regexp.new(r.source, r.options) #=> /cat/ix
*/
static VALUE
-rb_reg_options_m(VALUE re)
+rb_reg_options_m(re)
+ VALUE re;
{
int options = rb_reg_options(re);
return INT2NUM(options);
}
-static int
-reg_names_iter(const OnigUChar *name, const OnigUChar *name_end,
- int back_num, int *back_refs, OnigRegex regex, void *arg)
-{
- VALUE ary = (VALUE)arg;
- rb_ary_push(ary, rb_str_new((const char *)name, name_end-name));
- return 0;
-}
-
-/*
- * call-seq:
- * rxp.names => [name1, name2, ...]
- *
- * Returns a list of names of captures as an array of strings.
- *
- * /(?<foo>.)(?<bar>.)(?<baz>.)/.names
- * #=> ["foo", "bar", "baz"]
- *
- * /(?<foo>.)(?<foo>.)/.names
- * #=> ["foo"]
- *
- * /(.)(.)/.names
- * #=> []
- */
-
-static VALUE
-rb_reg_names(VALUE re)
-{
- VALUE ary = rb_ary_new();
- rb_reg_check(re);
- onig_foreach_name(RREGEXP(re)->ptr, reg_names_iter, (void*)ary);
- return ary;
-}
-
-static int
-reg_named_captures_iter(const OnigUChar *name, const OnigUChar *name_end,
- int back_num, int *back_refs, OnigRegex regex, void *arg)
-{
- VALUE hash = (VALUE)arg;
- VALUE ary = rb_ary_new2(back_num);
- int i;
-
- for(i = 0; i < back_num; i++)
- rb_ary_store(ary, i, INT2NUM(back_refs[i]));
-
- rb_hash_aset(hash, rb_str_new((const char*)name, name_end-name),ary);
-
- return 0;
-}
/*
- * call-seq:
- * rxp.named_captures => hash
- *
- * Returns a hash representing information about named captures of <i>rxp</i>.
- *
- * A key of the hash is a name of the named captures.
- * A value of the hash is an array which is list of indexes of corresponding
- * named captures.
- *
- * /(?<foo>.)(?<bar>.)/.named_captures
- * #=> {"foo"=>[1], "bar"=>[2]}
- *
- * /(?<foo>.)(?<foo>.)/.named_captures
- * #=> {"foo"=>[1, 2]}
- *
- * If there are no named captures, an empty hash is returned.
- *
- * /(.)(.)/.named_captures
- * #=> {}
+ * call-seq:
+ * rxp.kcode => str
+ *
+ * Returns the character set code for the regexp.
*/
static VALUE
-rb_reg_named_captures(VALUE re)
-{
- VALUE hash = rb_hash_new();
- rb_reg_check(re);
- onig_foreach_name(RREGEXP(re)->ptr, reg_named_captures_iter, (void*)hash);
- return hash;
+rb_reg_kcode_m(re)
+ VALUE re;
+{
+ const char *kcode;
+
+ if (FL_TEST(re, KCODE_FIXED)) {
+ switch (RBASIC(re)->flags & KCODE_MASK) {
+ case KCODE_NONE:
+ kcode = "none"; break;
+ case KCODE_EUC:
+ kcode = "euc"; break;
+ case KCODE_SJIS:
+ kcode = "sjis"; break;
+ case KCODE_UTF8:
+ kcode = "utf8"; break;
+ default:
+ rb_bug("unknown kcode - should not happen");
+ break;
+ }
+ return rb_str_new2(kcode);
+ }
+ return Qnil;
}
static Regexp*
-make_regexp(const char *s, long len, rb_encoding *enc, int flags, onig_errmsg_buffer err)
+make_regexp(s, len, flags)
+ const char *s;
+ long len;
+ int flags;
{
Regexp *rp;
- int r;
- OnigErrorInfo einfo;
+ const char *err;
/* Handle escaped characters first. */
@@ -744,18 +632,19 @@ make_regexp(const char *s, long len, rb_encoding *enc, int flags, onig_errmsg_bu
from that.
*/
- r = onig_alloc_init(&rp, flags, ONIGENC_CASE_FOLD_DEFAULT,
- enc, OnigDefaultSyntax);
- if (r) {
- onig_error_code_to_str((UChar*)err, r);
- return 0;
+ rp = ALLOC(Regexp);
+ MEMZERO((char *)rp, Regexp, 1);
+ rp->buffer = ALLOC_N(char, 16);
+ rp->allocated = 16;
+ rp->fastmap = ALLOC_N(char, 256);
+ if (flags) {
+ rp->options = flags;
}
+ err = re_compile_pattern(s, len, rp);
- r = onig_compile(rp, (UChar*)s, (UChar*)(s + len), &einfo);
-
- if (r != 0) {
- onig_free(rp);
- (void )onig_error_code_to_str((UChar*)err, r, &einfo);
+ if (err != NULL) {
+ re_free_pattern(rp);
+ rb_reg_raise(s, len, err, 0);
return 0;
}
return rp;
@@ -767,662 +656,362 @@ make_regexp(const char *s, long len, rb_encoding *enc, int flags, onig_errmsg_bu
*
* <code>MatchData</code> is the type of the special variable <code>$~</code>,
* and is the type of the object returned by <code>Regexp#match</code> and
- * <code>Regexp.last_match</code>. It encapsulates all the results of a pattern
+ * <code>Regexp#last_match</code>. It encapsulates all the results of a pattern
* match, results normally accessed through the special variables
* <code>$&</code>, <code>$'</code>, <code>$`</code>, <code>$1</code>,
- * <code>$2</code>, and so on.
+ * <code>$2</code>, and so on. <code>Matchdata</code> is also known as
+ * <code>MatchingData</code>.
*
*/
VALUE rb_cMatch;
+static VALUE match_alloc _((VALUE));
static VALUE
-match_alloc(VALUE klass)
+match_alloc(klass)
+ VALUE klass;
{
NEWOBJ(match, struct RMatch);
OBJSETUP(match, klass, T_MATCH);
match->str = 0;
- match->rmatch = 0;
- match->regexp = 0;
- match->rmatch = ALLOC(struct rmatch);
- MEMZERO(match->rmatch, struct rmatch, 1);
+ match->regs = 0;
+ match->regs = ALLOC(struct re_registers);
+ MEMZERO(match->regs, struct re_registers, 1);
return (VALUE)match;
}
-typedef struct {
- long byte_pos;
- long char_pos;
-} pair_t;
-
-static int
-pair_byte_cmp(const void *pair1, const void *pair2)
-{
- long diff = ((pair_t*)pair1)->byte_pos - ((pair_t*)pair2)->byte_pos;
-#if SIZEOF_LONG > SIZEOF_INT
- return diff ? diff > 0 ? 1 : -1 : 0;
-#else
- return (int)diff;
-#endif
-}
-
-static void
-update_char_offset(VALUE match)
-{
- struct rmatch *rm = RMATCH(match)->rmatch;
- struct re_registers *regs;
- int num_regs;
- int i, num_pos, c;
- char *s, *p, *q, *e;
- rb_encoding *enc;
- pair_t *pairs;
-
- if (rm->char_offset_updated)
- return;
-
- regs = &rm->regs;
- num_regs = rm->regs.num_regs;
-
- if (rm->char_offset_num_allocated < num_regs) {
- REALLOC_N(rm->char_offset, struct rmatch_offset, num_regs);
- rm->char_offset_num_allocated = num_regs;
- }
-
- enc = rb_enc_get(RMATCH(match)->str);
- if (rb_enc_mbmaxlen(enc) == 1) {
- for (i = 0; i < num_regs; i++) {
- rm->char_offset[i].beg = BEG(i);
- rm->char_offset[i].end = END(i);
- }
- rm->char_offset_updated = 1;
- return;
- }
-
- pairs = ALLOCA_N(pair_t, num_regs*2);
- num_pos = 0;
- for (i = 0; i < num_regs; i++) {
- if (BEG(i) < 0)
- continue;
- pairs[num_pos++].byte_pos = BEG(i);
- pairs[num_pos++].byte_pos = END(i);
- }
- qsort(pairs, num_pos, sizeof(pair_t), pair_byte_cmp);
-
- s = p = RSTRING_PTR(RMATCH(match)->str);
- e = s + RSTRING_LEN(RMATCH(match)->str);
- c = 0;
- for (i = 0; i < num_pos; i++) {
- q = s + pairs[i].byte_pos;
- c += rb_enc_strlen(p, q, enc);
- pairs[i].char_pos = c;
- p = q;
- }
-
- for (i = 0; i < num_regs; i++) {
- pair_t key, *found;
- if (BEG(i) < 0) {
- rm->char_offset[i].beg = -1;
- rm->char_offset[i].end = -1;
- continue;
- }
-
- key.byte_pos = BEG(i);
- found = bsearch(&key, pairs, num_pos, sizeof(pair_t), pair_byte_cmp);
- rm->char_offset[i].beg = found->char_pos;
-
- key.byte_pos = END(i);
- found = bsearch(&key, pairs, num_pos, sizeof(pair_t), pair_byte_cmp);
- rm->char_offset[i].end = found->char_pos;
- }
-
- rm->char_offset_updated = 1;
-}
-
static void
match_check(VALUE match)
{
- if (!RMATCH(match)->regexp) {
+ if (!RMATCH(match)->str) {
rb_raise(rb_eTypeError, "uninitialized Match");
}
}
/* :nodoc: */
static VALUE
-match_init_copy(VALUE obj, VALUE orig)
+match_init_copy(obj, orig)
+ VALUE obj, orig;
{
- struct rmatch *rm;
-
if (obj == orig) return obj;
if (!rb_obj_is_instance_of(orig, rb_obj_class(obj))) {
rb_raise(rb_eTypeError, "wrong argument class");
}
RMATCH(obj)->str = RMATCH(orig)->str;
- RMATCH(obj)->regexp = RMATCH(orig)->regexp;
-
- rm = RMATCH(obj)->rmatch;
- onig_region_copy(&rm->regs, RMATCH_REGS(orig));
-
- if (!RMATCH(orig)->rmatch->char_offset_updated) {
- rm->char_offset_updated = 0;
- }
- else {
- if (rm->char_offset_num_allocated < rm->regs.num_regs) {
- REALLOC_N(rm->char_offset, struct rmatch_offset, rm->regs.num_regs);
- rm->char_offset_num_allocated = rm->regs.num_regs;
- }
- MEMCPY(rm->char_offset, RMATCH(orig)->rmatch->char_offset,
- struct rmatch_offset, rm->regs.num_regs);
- rm->char_offset_updated = 1;
- }
+ re_free_registers(RMATCH(obj)->regs);
+ RMATCH(obj)->regs->allocated = 0;
+ re_copy_registers(RMATCH(obj)->regs, RMATCH(orig)->regs);
return obj;
}
/*
- * call-seq:
- * mtch.regexp => regexp
- *
- * Returns the regexp.
- *
- * m = /a.*b/.match("abc")
- * m.regexp #=> /a.*b/
- */
-
-static VALUE
-match_regexp(VALUE match)
-{
- match_check(match);
- return RMATCH(match)->regexp;
-}
-
-/*
- * call-seq:
- * mtch.names => [name1, name2, ...]
- *
- * Returns a list of names of captures as an array of strings.
- * It is same as mtch.regexp.names.
- *
- * /(?<foo>.)(?<bar>.)(?<baz>.)/.match("hoge").names
- * #=> ["foo", "bar", "baz"]
- *
- * m = /(?<x>.)(?<y>.)?/.match("a") #=> #<MatchData "a" x:"a" y:nil>
- * m.names #=> ["x", "y"]
- */
-
-static VALUE
-match_names(VALUE match)
-{
- match_check(match);
- return rb_reg_names(RMATCH(match)->regexp);
-}
-
-/*
* call-seq:
* mtch.length => integer
* mtch.size => integer
- *
+ *
* Returns the number of elements in the match array.
- *
+ *
* m = /(.)(.)(\d+)(\d)/.match("THX1138.")
* m.length #=> 5
* m.size #=> 5
*/
static VALUE
-match_size(VALUE match)
-{
- match_check(match);
- return INT2FIX(RMATCH_REGS(match)->num_regs);
-}
-
-static int
-match_backref_number(VALUE match, VALUE backref)
+match_size(match)
+ VALUE match;
{
- const char *name;
- int num;
-
- struct re_registers *regs = RMATCH_REGS(match);
- VALUE regexp = RMATCH(match)->regexp;
-
match_check(match);
- switch(TYPE(backref)) {
- default:
- return NUM2INT(backref);
-
- case T_SYMBOL:
- name = rb_id2name(SYM2ID(backref));
- break;
-
- case T_STRING:
- name = StringValueCStr(backref);
- break;
- }
-
- num = onig_name_to_backref_number(RREGEXP(regexp)->ptr,
- (const unsigned char*)name,
- (const unsigned char*)name + strlen(name),
- regs);
-
- if (num < 1) {
- rb_raise(rb_eIndexError, "undefined group name reference: %s", name);
- }
-
- return num;
+ return INT2FIX(RMATCH(match)->regs->num_regs);
}
-int
-rb_reg_backref_number(VALUE match, VALUE backref)
-{
- return match_backref_number(match, backref);
-}
/*
* call-seq:
* mtch.offset(n) => array
- *
+ *
* Returns a two-element array containing the beginning and ending offsets of
* the <em>n</em>th match.
- * <em>n</em> can be a string or symbol to reference a named capture.
- *
+ *
* m = /(.)(.)(\d+)(\d)/.match("THX1138.")
- * m.offset(0) #=> [1, 7]
- * m.offset(4) #=> [6, 7]
- *
- * m = /(?<foo>.)(.)(?<bar>.)/.match("hoge")
- * p m.offset(:foo) #=> [0, 1]
- * p m.offset(:bar) #=> [2, 3]
- *
+ * m.offset(0) #=> [1, 7]
+ * m.offset(4) #=> [6, 7]
*/
static VALUE
-match_offset(VALUE match, VALUE n)
+match_offset(match, n)
+ VALUE match, n;
{
- int i = match_backref_number(match, n);
- struct re_registers *regs = RMATCH_REGS(match);
+ int i = NUM2INT(n);
match_check(match);
- if (i < 0 || regs->num_regs <= i)
+ if (i < 0 || RMATCH(match)->regs->num_regs <= i)
rb_raise(rb_eIndexError, "index %d out of matches", i);
- if (BEG(i) < 0)
+ if (RMATCH(match)->regs->beg[i] < 0)
return rb_assoc_new(Qnil, Qnil);
- update_char_offset(match);
- return rb_assoc_new(INT2FIX(RMATCH(match)->rmatch->char_offset[i].beg),
- INT2FIX(RMATCH(match)->rmatch->char_offset[i].end));
+ return rb_assoc_new(INT2FIX(RMATCH(match)->regs->beg[i]),
+ INT2FIX(RMATCH(match)->regs->end[i]));
}
/*
* call-seq:
* mtch.begin(n) => integer
- *
+ *
* Returns the offset of the start of the <em>n</em>th element of the match
* array in the string.
- * <em>n</em> can be a string or symbol to reference a named capture.
- *
+ *
* m = /(.)(.)(\d+)(\d)/.match("THX1138.")
- * m.begin(0) #=> 1
- * m.begin(2) #=> 2
- *
- * m = /(?<foo>.)(.)(?<bar>.)/.match("hoge")
- * p m.begin(:foo) #=> 0
- * p m.begin(:bar) #=> 2
+ * m.begin(0) #=> 1
+ * m.begin(2) #=> 2
*/
static VALUE
-match_begin(VALUE match, VALUE n)
+match_begin(match, n)
+ VALUE match, n;
{
- int i = match_backref_number(match, n);
- struct re_registers *regs = RMATCH_REGS(match);
+ int i = NUM2INT(n);
match_check(match);
- if (i < 0 || regs->num_regs <= i)
+ if (i < 0 || RMATCH(match)->regs->num_regs <= i)
rb_raise(rb_eIndexError, "index %d out of matches", i);
- if (BEG(i) < 0)
+ if (RMATCH(match)->regs->beg[i] < 0)
return Qnil;
- update_char_offset(match);
- return INT2FIX(RMATCH(match)->rmatch->char_offset[i].beg);
+ return INT2FIX(RMATCH(match)->regs->beg[i]);
}
/*
* call-seq:
* mtch.end(n) => integer
- *
+ *
* Returns the offset of the character immediately following the end of the
* <em>n</em>th element of the match array in the string.
- * <em>n</em> can be a string or symbol to reference a named capture.
- *
+ *
* m = /(.)(.)(\d+)(\d)/.match("THX1138.")
- * m.end(0) #=> 7
- * m.end(2) #=> 3
- *
- * m = /(?<foo>.)(.)(?<bar>.)/.match("hoge")
- * p m.end(:foo) #=> 1
- * p m.end(:bar) #=> 3
+ * m.end(0) #=> 7
+ * m.end(2) #=> 3
*/
static VALUE
-match_end(VALUE match, VALUE n)
+match_end(match, n)
+ VALUE match, n;
{
- int i = match_backref_number(match, n);
- struct re_registers *regs = RMATCH_REGS(match);
+ int i = NUM2INT(n);
match_check(match);
- if (i < 0 || regs->num_regs <= i)
+ if (i < 0 || RMATCH(match)->regs->num_regs <= i)
rb_raise(rb_eIndexError, "index %d out of matches", i);
- if (BEG(i) < 0)
+ if (RMATCH(match)->regs->beg[i] < 0)
return Qnil;
- update_char_offset(match);
- return INT2FIX(RMATCH(match)->rmatch->char_offset[i].end);
+ return INT2FIX(RMATCH(match)->regs->end[i]);
}
#define MATCH_BUSY FL_USER2
void
-rb_match_busy(VALUE match)
+rb_match_busy(match)
+ VALUE match;
{
FL_SET(match, MATCH_BUSY);
}
-/*
- * call-seq:
- * rxp.fixed_encoding? => true or false
- *
- * Returns false if rxp is applicable to
- * a string with any ASCII compatible encoding.
- * Returns true otherwise.
- *
- * r = /a/
- * r.fixed_encoding? #=> false
- * r =~ "\u{6666} a" #=> 2
- * r =~ "\xa1\xa2 a".force_encoding("euc-jp") #=> 2
- * r =~ "abc".force_encoding("euc-jp") #=> 0
- *
- * r = /a/u
- * r.fixed_encoding? #=> true
- * r.encoding #=> #<Encoding:UTF-8>
- * r =~ "\u{6666} a" #=> 2
- * r =~ "\xa1\xa2".force_encoding("euc-jp") #=> ArgumentError
- * r =~ "abc".force_encoding("euc-jp") #=> 0
- *
- * r = /\u{6666}/
- * r.fixed_encoding? #=> true
- * r.encoding #=> #<Encoding:UTF-8>
- * r =~ "\u{6666} a" #=> 0
- * r =~ "\xa1\xa2".force_encoding("euc-jp") #=> ArgumentError
- * r =~ "abc".force_encoding("euc-jp") #=> nil
- */
-
-static VALUE
-rb_reg_fixed_encoding_p(VALUE re)
-{
- if (FL_TEST(re, KCODE_FIXED))
- return Qtrue;
- else
- return Qfalse;
-}
-
-static VALUE
-rb_reg_preprocess(const char *p, const char *end, rb_encoding *enc,
- rb_encoding **fixed_enc, onig_errmsg_buffer err);
-
+int ruby_ignorecase;
+static int may_need_recompile;
static void
-reg_enc_error(VALUE re, VALUE str)
-{
- rb_raise(rb_eEncCompatError,
- "incompatible encoding regexp match (%s regexp with %s string)",
- rb_enc_name(RREGEXP(re)->ptr->enc),
- rb_enc_name(rb_enc_get(str)));
-}
-
-static rb_encoding*
-rb_reg_prepare_enc(VALUE re, VALUE str, int warn)
+rb_reg_prepare_re(re)
+ VALUE re;
{
- rb_encoding *enc = 0;
-
- if (rb_enc_str_coderange(str) == ENC_CODERANGE_BROKEN) {
- rb_raise(rb_eArgError,
- "invalid byte sequence in %s",
- rb_enc_name(rb_enc_get(str)));
- }
+ int need_recompile = 0;
+ int state;
rb_reg_check(re);
- enc = rb_enc_get(str);
- if (!rb_enc_str_asciicompat_p(str)) {
- if (RREGEXP(re)->ptr->enc != enc) {
- reg_enc_error(re, str);
- }
+ state = FL_TEST(re, REG_CASESTATE);
+ /* ignorecase status */
+ if (ruby_ignorecase && !state) {
+ FL_SET(re, REG_CASESTATE);
+ RREGEXP(re)->ptr->options |= RE_OPTION_IGNORECASE;
+ need_recompile = 1;
}
- else if (rb_reg_fixed_encoding_p(re)) {
- if (RREGEXP(re)->ptr->enc != enc &&
- (!rb_enc_asciicompat(RREGEXP(re)->ptr->enc) ||
- rb_enc_str_coderange(str) != ENC_CODERANGE_7BIT)) {
- reg_enc_error(re, str);
- }
- enc = RREGEXP(re)->ptr->enc;
- }
- if (warn && (RBASIC(re)->flags & REG_ENCODING_NONE) &&
- enc != rb_ascii8bit_encoding() &&
- rb_enc_str_coderange(str) != ENC_CODERANGE_7BIT) {
- rb_warn("regexp match /.../n against to %s string",
- rb_enc_name(enc));
+ if (!ruby_ignorecase && state) {
+ FL_UNSET(re, REG_CASESTATE);
+ RREGEXP(re)->ptr->options &= ~RE_OPTION_IGNORECASE;
+ need_recompile = 1;
}
- return enc;
-}
-regex_t *
-rb_reg_prepare_re(VALUE re, VALUE str)
-{
- regex_t *reg = RREGEXP(re)->ptr;
- onig_errmsg_buffer err = "";
- int r;
- OnigErrorInfo einfo;
- const char *pattern;
- VALUE unescaped;
- rb_encoding *fixed_enc = 0;
- rb_encoding *enc = rb_reg_prepare_enc(re, str, 1);
-
- if (reg->enc == enc) return reg;
-
- rb_reg_check(re);
- reg = RREGEXP(re)->ptr;
- pattern = RREGEXP_SRC_PTR(re);
-
- unescaped = rb_reg_preprocess(
- pattern, pattern + RREGEXP_SRC_LEN(re), enc,
- &fixed_enc, err);
-
- if (unescaped == Qnil) {
- rb_raise(rb_eArgError, "regexp preprocess failed: %s", err);
+ if (!FL_TEST(re, KCODE_FIXED) &&
+ (RBASIC(re)->flags & KCODE_MASK) != reg_kcode) {
+ need_recompile = 1;
+ RBASIC(re)->flags &= ~KCODE_MASK;
+ RBASIC(re)->flags |= reg_kcode;
}
- r = onig_new(&reg, (UChar* )RSTRING_PTR(unescaped),
- (UChar* )(RSTRING_PTR(unescaped) + RSTRING_LEN(unescaped)),
- reg->options, enc,
- OnigDefaultSyntax, &einfo);
- if (r) {
- onig_error_code_to_str((UChar*)err, r, &einfo);
- rb_reg_raise(pattern, RREGEXP_SRC_LEN(re), err, re);
- }
+ if (need_recompile) {
+ const char *err;
- RB_GC_GUARD(unescaped);
- return reg;
+ if (FL_TEST(re, KCODE_FIXED))
+ rb_kcode_set_option(re);
+ rb_reg_check(re);
+ RREGEXP(re)->ptr->fastmap_accurate = 0;
+ err = re_compile_pattern(RREGEXP(re)->str, RREGEXP(re)->len, RREGEXP(re)->ptr);
+ if (err != NULL) {
+ rb_reg_raise(RREGEXP(re)->str, RREGEXP(re)->len, err, re);
+ }
+ }
}
long
-rb_reg_adjust_startpos(VALUE re, VALUE str, long pos, int reverse)
+rb_reg_adjust_startpos(re, str, pos, reverse)
+ VALUE re, str;
+ long pos, reverse;
{
long range;
- rb_encoding *enc;
- UChar *p, *string;
- enc = rb_reg_prepare_enc(re, str, 0);
+ rb_reg_check(re);
+ if (may_need_recompile) rb_reg_prepare_re(re);
+
+ if (FL_TEST(re, KCODE_FIXED))
+ rb_kcode_set_option(re);
+ else if (reg_kcode != curr_kcode)
+ rb_kcode_reset_option();
if (reverse) {
range = -pos;
}
else {
- range = RSTRING_LEN(str) - pos;
+ range = RSTRING(str)->len - pos;
}
-
- if (pos > 0 && ONIGENC_MBC_MAXLEN(enc) != 1 && pos < RSTRING_LEN(str)) {
- string = (UChar*)RSTRING_PTR(str);
-
- if (range > 0) {
- p = onigenc_get_right_adjust_char_head(enc, string, string + pos, string + RSTRING_LEN(str));
- }
- else {
- p = ONIGENC_LEFT_ADJUST_CHAR_HEAD(enc, string, string + pos, string + RSTRING_LEN(str));
- }
- return p - string;
- }
-
- return pos;
+ return re_adjust_startpos(RREGEXP(re)->ptr,
+ RSTRING(str)->ptr, RSTRING(str)->len,
+ pos, range);
}
long
-rb_reg_search(VALUE re, VALUE str, long pos, int reverse)
+rb_reg_search(re, str, pos, reverse)
+ VALUE re, str;
+ long pos, reverse;
{
long result;
VALUE match;
- struct re_registers regi, *regs = &regi;
- char *range = RSTRING_PTR(str);
- regex_t *reg;
- int tmpreg;
+ struct re_registers regs;
+ long range;
- if (pos > RSTRING_LEN(str) || pos < 0) {
+ if (pos > RSTRING(str)->len || pos < 0) {
rb_backref_set(Qnil);
return -1;
}
- reg = rb_reg_prepare_re(re, str);
- tmpreg = reg != RREGEXP(re)->ptr;
- if (!tmpreg) RREGEXP(re)->usecnt++;
+ rb_reg_check(re);
+ if (may_need_recompile) rb_reg_prepare_re(re);
- match = rb_backref_get();
- if (!NIL_P(match)) {
- if (FL_TEST(match, MATCH_BUSY)) {
- match = Qnil;
- }
- else {
- regs = RMATCH_REGS(match);
- }
+ if (FL_TEST(re, KCODE_FIXED))
+ rb_kcode_set_option(re);
+ else if (reg_kcode != curr_kcode)
+ rb_kcode_reset_option();
+
+ if (reverse) {
+ range = -pos;
}
- if (NIL_P(match)) {
- MEMZERO(regs, struct re_registers, 1);
- }
- if (!reverse) {
- range += RSTRING_LEN(str);
- }
- result = onig_search(reg,
- (UChar*)(RSTRING_PTR(str)),
- ((UChar*)(RSTRING_PTR(str)) + RSTRING_LEN(str)),
- ((UChar*)(RSTRING_PTR(str)) + pos),
- ((UChar*)range),
- regs, ONIG_OPTION_NONE);
- if (!tmpreg) RREGEXP(re)->usecnt--;
- if (tmpreg) {
- if (RREGEXP(re)->usecnt) {
- onig_free(reg);
- }
- else {
- onig_free(RREGEXP(re)->ptr);
- RREGEXP(re)->ptr = reg;
- }
+ else {
+ range = RSTRING(str)->len - pos;
+ }
+ MEMZERO(&regs, struct re_registers, 1);
+ result = re_search(RREGEXP(re)->ptr,RSTRING(str)->ptr,RSTRING(str)->len,
+ pos, range, &regs);
+
+ if (FL_TEST(re, KCODE_FIXED))
+ rb_kcode_reset_option();
+
+ if (result == -2) {
+ rb_reg_raise(RREGEXP(re)->str, RREGEXP(re)->len,
+ "Stack overflow in regexp matcher", re);
}
+
if (result < 0) {
- if (regs == &regi)
- onig_region_free(regs, 0);
- if (result == ONIG_MISMATCH) {
- rb_backref_set(Qnil);
- return result;
- }
- else {
- onig_errmsg_buffer err = "";
- onig_error_code_to_str((UChar*)err, (int)result);
- rb_reg_raise(RREGEXP_SRC_PTR(re), RREGEXP_SRC_LEN(re), err, 0);
- }
+ re_free_registers(&regs);
+ rb_backref_set(Qnil);
+ return result;
}
- if (NIL_P(match)) {
+ match = rb_backref_get();
+ if (NIL_P(match) || FL_TEST(match, MATCH_BUSY)) {
match = match_alloc(rb_cMatch);
- onig_region_copy(RMATCH_REGS(match), regs);
- onig_region_free(regs, 0);
}
else {
- if (rb_safe_level() >= 3)
+ if (rb_safe_level() >= 3)
OBJ_TAINT(match);
else
FL_UNSET(match, FL_TAINT);
}
+ re_copy_registers(RMATCH(match)->regs, &regs);
+ re_free_registers(&regs);
RMATCH(match)->str = rb_str_new4(str);
- RMATCH(match)->regexp = re;
- RMATCH(match)->rmatch->char_offset_updated = 0;
rb_backref_set(match);
OBJ_INFECT(match, re);
OBJ_INFECT(match, str);
-
return result;
}
VALUE
-rb_reg_nth_defined(int nth, VALUE match)
+rb_reg_nth_defined(nth, match)
+ int nth;
+ VALUE match;
{
- struct re_registers *regs;
if (NIL_P(match)) return Qnil;
match_check(match);
- regs = RMATCH_REGS(match);
- if (nth >= regs->num_regs) {
+ if (nth >= RMATCH(match)->regs->num_regs) {
return Qnil;
}
if (nth < 0) {
- nth += regs->num_regs;
+ nth += RMATCH(match)->regs->num_regs;
if (nth <= 0) return Qnil;
}
- if (BEG(nth) == -1) return Qfalse;
+ if (RMATCH(match)->BEG(nth) == -1) return Qfalse;
return Qtrue;
}
VALUE
-rb_reg_nth_match(int nth, VALUE match)
+rb_reg_nth_match(nth, match)
+ int nth;
+ VALUE match;
{
VALUE str;
long start, end, len;
- struct re_registers *regs;
if (NIL_P(match)) return Qnil;
match_check(match);
- regs = RMATCH_REGS(match);
- if (nth >= regs->num_regs) {
+ if (nth >= RMATCH(match)->regs->num_regs) {
return Qnil;
}
if (nth < 0) {
- nth += regs->num_regs;
+ nth += RMATCH(match)->regs->num_regs;
if (nth <= 0) return Qnil;
}
- start = BEG(nth);
+ start = RMATCH(match)->BEG(nth);
if (start == -1) return Qnil;
- end = END(nth);
+ end = RMATCH(match)->END(nth);
len = end - start;
- str = rb_str_subseq(RMATCH(match)->str, start, len);
+ str = rb_str_substr(RMATCH(match)->str, start, len);
OBJ_INFECT(str, match);
return str;
}
VALUE
-rb_reg_last_match(VALUE match)
+rb_reg_last_match(match)
+ VALUE match;
{
return rb_reg_nth_match(0, match);
}
@@ -1431,25 +1020,24 @@ rb_reg_last_match(VALUE match)
/*
* call-seq:
* mtch.pre_match => str
- *
+ *
* Returns the portion of the original string before the current match.
* Equivalent to the special variable <code>$`</code>.
- *
+ *
* m = /(.)(.)(\d+)(\d)/.match("THX1138.")
* m.pre_match #=> "T"
*/
VALUE
-rb_reg_match_pre(VALUE match)
+rb_reg_match_pre(match)
+ VALUE match;
{
VALUE str;
- struct re_registers *regs;
if (NIL_P(match)) return Qnil;
match_check(match);
- regs = RMATCH_REGS(match);
- if (BEG(0) == -1) return Qnil;
- str = rb_str_subseq(RMATCH(match)->str, 0, BEG(0));
+ if (RMATCH(match)->BEG(0) == -1) return Qnil;
+ str = rb_str_substr(RMATCH(match)->str, 0, RMATCH(match)->BEG(0));
if (OBJ_TAINTED(match)) OBJ_TAINT(str);
return str;
}
@@ -1458,75 +1046,75 @@ rb_reg_match_pre(VALUE match)
/*
* call-seq:
* mtch.post_match => str
- *
+ *
* Returns the portion of the original string after the current match.
* Equivalent to the special variable <code>$'</code>.
- *
+ *
* m = /(.)(.)(\d+)(\d)/.match("THX1138: The Movie")
* m.post_match #=> ": The Movie"
*/
VALUE
-rb_reg_match_post(VALUE match)
+rb_reg_match_post(match)
+ VALUE match;
{
VALUE str;
long pos;
- struct re_registers *regs;
if (NIL_P(match)) return Qnil;
match_check(match);
- regs = RMATCH_REGS(match);
- if (BEG(0) == -1) return Qnil;
+ if (RMATCH(match)->BEG(0) == -1) return Qnil;
str = RMATCH(match)->str;
- pos = END(0);
- str = rb_str_subseq(str, pos, RSTRING_LEN(str) - pos);
+ pos = RMATCH(match)->END(0);
+ str = rb_str_substr(str, pos, RSTRING(str)->len - pos);
if (OBJ_TAINTED(match)) OBJ_TAINT(str);
return str;
}
VALUE
-rb_reg_match_last(VALUE match)
+rb_reg_match_last(match)
+ VALUE match;
{
int i;
- struct re_registers *regs;
if (NIL_P(match)) return Qnil;
match_check(match);
- regs = RMATCH_REGS(match);
- if (BEG(0) == -1) return Qnil;
+ if (RMATCH(match)->BEG(0) == -1) return Qnil;
- for (i=regs->num_regs-1; BEG(i) == -1 && i > 0; i--)
+ for (i=RMATCH(match)->regs->num_regs-1; RMATCH(match)->BEG(i) == -1 && i > 0; i--)
;
if (i == 0) return Qnil;
return rb_reg_nth_match(i, match);
}
static VALUE
-last_match_getter(void)
+last_match_getter()
{
return rb_reg_last_match(rb_backref_get());
}
static VALUE
-prematch_getter(void)
+prematch_getter()
{
return rb_reg_match_pre(rb_backref_get());
}
static VALUE
-postmatch_getter(void)
+postmatch_getter()
{
return rb_reg_match_post(rb_backref_get());
}
static VALUE
-last_paren_match_getter(void)
+last_paren_match_getter()
{
return rb_reg_match_last(rb_backref_get());
}
static VALUE
-match_array(VALUE match, int start)
+match_array(match, start)
+ VALUE match;
+ int start;
{
struct re_registers *regs;
VALUE ary;
@@ -1535,7 +1123,7 @@ match_array(VALUE match, int start)
int taint = OBJ_TAINTED(match);
match_check(match);
- regs = RMATCH_REGS(match);
+ regs = RMATCH(match)->regs;
ary = rb_ary_new2(regs->num_regs);
target = RMATCH(match)->str;
@@ -1544,7 +1132,7 @@ match_array(VALUE match, int start)
rb_ary_push(ary, Qnil);
}
else {
- VALUE str = rb_str_subseq(target, regs->beg[i], regs->end[i]-regs->beg[i]);
+ VALUE str = rb_str_substr(target, regs->beg[i], regs->end[i]-regs->beg[i]);
if (taint) OBJ_TAINT(str);
rb_ary_push(ary, str);
}
@@ -1560,18 +1148,18 @@ match_array(VALUE match, int start)
/*
* call-seq:
* mtch.to_a => anArray
- *
+ *
* Returns the array of matches.
- *
+ *
* m = /(.)(.)(\d+)(\d)/.match("THX1138.")
* m.to_a #=> ["HX1138", "H", "X", "113", "8"]
- *
+ *
* Because <code>to_a</code> is called when expanding
* <code>*</code><em>variable</em>, there's a useful assignment
* shortcut for extracting matched fields. This is slightly slower than
* accessing the fields directly (as an intermediate array is
* generated).
- *
+ *
* all,f1,f2,f3 = *(/(.)(.)(\d+)(\d)/.match("THX1138."))
* all #=> "HX1138"
* f1 #=> "H"
@@ -1580,7 +1168,8 @@ match_array(VALUE match, int start)
*/
static VALUE
-match_to_a(VALUE match)
+match_to_a(match)
+ VALUE match;
{
return match_array(match, 0);
}
@@ -1599,143 +1188,141 @@ match_to_a(VALUE match)
* f4 #=> "8"
*/
static VALUE
-match_captures(VALUE match)
+match_captures(match)
+ VALUE match;
{
return match_array(match, 1);
}
-static int
-name_to_backref_number(struct re_registers *regs, VALUE regexp, const char* name, const char* name_end)
-{
- int num;
-
- num = onig_name_to_backref_number(RREGEXP(regexp)->ptr,
- (const unsigned char* )name, (const unsigned char* )name_end, regs);
- if (num >= 1) {
- return num;
- }
- else {
- VALUE s = rb_str_new(name, (long )(name_end - name));
- rb_raise(rb_eIndexError, "undefined group name reference: %s",
- StringValuePtr(s));
- }
-}
/*
* call-seq:
- * mtch[i] => str or nil
+ * mtch[i] => obj
* mtch[start, length] => array
* mtch[range] => array
- * mtch[name] => str or nil
- *
+ *
* Match Reference---<code>MatchData</code> acts as an array, and may be
* accessed using the normal array indexing techniques. <i>mtch</i>[0] is
* equivalent to the special variable <code>$&</code>, and returns the entire
* matched string. <i>mtch</i>[1], <i>mtch</i>[2], and so on return the values
* of the matched backreferences (portions of the pattern between parentheses).
- *
+ *
* m = /(.)(.)(\d+)(\d)/.match("THX1138.")
- * m #=> #<MatchData "HX1138" 1:"H" 2:"X" 3:"113" 4:"8">
* m[0] #=> "HX1138"
* m[1, 2] #=> ["H", "X"]
* m[1..3] #=> ["H", "X", "113"]
* m[-3, 2] #=> ["X", "113"]
- *
- * m = /(?<foo>a+)b/.match("ccaaab")
- * m #=> #<MatchData "aaab" foo:"aaa">
- * m["foo"] #=> "aaa"
- * m[:foo] #=> "aaa"
*/
static VALUE
-match_aref(int argc, VALUE *argv, VALUE match)
+match_aref(argc, argv, match)
+ int argc;
+ VALUE *argv;
+ VALUE match;
{
VALUE idx, rest;
- match_check(match);
rb_scan_args(argc, argv, "11", &idx, &rest);
- if (NIL_P(rest)) {
- if (FIXNUM_P(idx)) {
- if (FIX2INT(idx) >= 0) {
- return rb_reg_nth_match(FIX2INT(idx), match);
- }
- }
- else {
- const char *p;
- int num;
-
- switch (TYPE(idx)) {
- case T_SYMBOL:
- p = rb_id2name(SYM2ID(idx));
- goto name_to_backref;
- break;
- case T_STRING:
- p = StringValuePtr(idx);
-
- name_to_backref:
- num = name_to_backref_number(RMATCH_REGS(match),
- RMATCH(match)->regexp, p, p + strlen(p));
- return rb_reg_nth_match(num, match);
- break;
-
- default:
- break;
- }
- }
+ if (!NIL_P(rest) || !FIXNUM_P(idx) || FIX2INT(idx) < 0) {
+ return rb_ary_aref(argc, argv, match_to_a(match));
}
-
- return rb_ary_aref(argc, argv, match_to_a(match));
+ return rb_reg_nth_match(FIX2INT(idx), match);
}
+static VALUE match_entry _((VALUE, long));
static VALUE
-match_entry(VALUE match, long n)
+match_entry(match, n)
+ VALUE match;
+ long n;
{
- /* n should not exceed num_regs */
- return rb_reg_nth_match((int)n, match);
+ return rb_reg_nth_match(n, match);
}
/*
* call-seq:
- *
* mtch.values_at([index]*) => array
- *
+ *
* Uses each <i>index</i> to access the matching values, returning an array of
* the corresponding matches.
- *
+ *
* m = /(.)(.)(\d+)(\d)/.match("THX1138: The Movie")
* m.to_a #=> ["HX1138", "H", "X", "113", "8"]
* m.values_at(0, 2, -2) #=> ["HX1138", "X", "113"]
*/
static VALUE
-match_values_at(int argc, VALUE *argv, VALUE match)
+match_values_at(argc, argv, match)
+ int argc;
+ VALUE *argv;
+ VALUE match;
{
- struct re_registers *regs;
-
match_check(match);
- regs = RMATCH_REGS(match);
- return rb_get_values_at(match, regs->num_regs, argc, argv, match_entry);
+ return rb_values_at(match, RMATCH(match)->regs->num_regs, argc, argv, match_entry);
+}
+
+
+/*
+ * call-seq:
+ * mtch.select{|obj| block} => array
+ *
+ * Returns an array containing match strings for which <em>block</em>
+ * gives <code>true</code>. MatchData#select will be removed from Ruby 1.9.
+ *
+ * m = /(.)(.)(\d+)(\d)/.match("THX1138: The Movie")
+ * p m.select{|x| /X/ =~ x} #=> ["HX1138", "X"]
+ */
+
+static VALUE
+match_select(argc, argv, match)
+ int argc;
+ VALUE *argv;
+ VALUE match;
+{
+ if (argc > 0) {
+ rb_raise(rb_eArgError, "wrong number of arguments (%d for 0)", argc);
+ }
+ else {
+ struct re_registers *regs;
+ VALUE target;
+ VALUE result = rb_ary_new();
+ int i;
+ int taint = OBJ_TAINTED(match);
+
+ match_check(match);
+ regs = RMATCH(match)->regs;
+ target = RMATCH(match)->str;
+
+ for (i=0; i<regs->num_regs; i++) {
+ VALUE str = rb_str_substr(target, regs->beg[i], regs->end[i]-regs->beg[i]);
+ if (taint) OBJ_TAINT(str);
+ if (RTEST(rb_yield(str))) {
+ rb_ary_push(result, str);
+ }
+ }
+ return result;
+ }
}
+
/*
* call-seq:
* mtch.to_s => str
- *
+ *
* Returns the entire matched string.
- *
+ *
* m = /(.)(.)(\d+)(\d)/.match("THX1138.")
* m.to_s #=> "HX1138"
*/
static VALUE
-match_to_s(VALUE match)
+match_to_s(match)
+ VALUE match;
{
VALUE str = rb_reg_last_match(match);
- match_check(match);
if (NIL_P(str)) str = rb_str_new(0,0);
if (OBJ_TAINTED(match)) OBJ_TAINT(str);
if (OBJ_TAINTED(RMATCH(match)->str)) OBJ_TAINT(str);
@@ -1746,39 +1333,21 @@ match_to_s(VALUE match)
/*
* call-seq:
* mtch.string => str
- *
+ *
* Returns a frozen copy of the string passed in to <code>match</code>.
- *
+ *
* m = /(.)(.)(\d+)(\d)/.match("THX1138.")
* m.string #=> "THX1138."
*/
static VALUE
-match_string(VALUE match)
+match_string(match)
+ VALUE match;
{
match_check(match);
return RMATCH(match)->str; /* str is frozen */
}
-struct backref_name_tag {
- const UChar *name;
- long len;
-};
-
-static int
-match_inspect_name_iter(const OnigUChar *name, const OnigUChar *name_end,
- int back_num, int *back_refs, OnigRegex regex, void *arg0)
-{
- struct backref_name_tag *arg = (struct backref_name_tag *)arg0;
- int i;
-
- for (i = 0; i < back_num; i++) {
- arg[back_refs[i]].name = name;
- arg[back_refs[i]].len = name_end - name;
- }
- return 0;
-}
-
/*
* call-seq:
* mtch.inspect => str
@@ -1794,9 +1363,6 @@ match_inspect_name_iter(const OnigUChar *name, const OnigUChar *name_end,
* puts /(.)(.)?(.)/.match("fo").inspect
* #=> #<MatchData "fo" 1:"f" 2:nil 3:"o">
*
- * puts /(?<foo>.)(?<bar>.)(?<baz>.)/.match("hoge").inspect
- * #=> #<MatchData "hog" foo:"h" bar:"o" baz:"g">
- *
*/
static VALUE
@@ -1805,20 +1371,8 @@ match_inspect(VALUE match)
const char *cname = rb_obj_classname(match);
VALUE str;
int i;
- struct re_registers *regs = RMATCH_REGS(match);
+ struct re_registers *regs = RMATCH(match)->regs;
int num_regs = regs->num_regs;
- struct backref_name_tag *names;
- VALUE regexp = RMATCH(match)->regexp;
-
- if (regexp == 0) {
- return rb_sprintf("#<%s:%p>", cname, (void*)match);
- }
-
- names = ALLOCA_N(struct backref_name_tag, num_regs);
- MEMZERO(names, struct backref_name_tag, num_regs);
-
- onig_foreach_name(RREGEXP(regexp)->ptr,
- match_inspect_name_iter, names);
str = rb_str_buf_new2("#<");
rb_str_buf_cat2(str, cname);
@@ -1827,11 +1381,9 @@ match_inspect(VALUE match)
VALUE v;
rb_str_buf_cat2(str, " ");
if (0 < i) {
- if (names[i].name)
- rb_str_buf_cat(str, (const char *)names[i].name, names[i].len);
- else {
- rb_str_catf(str, "%d", i);
- }
+ char buf[sizeof(i)*3+1];
+ snprintf(buf, sizeof(buf), "%d", i);
+ rb_str_buf_cat2(str, buf);
rb_str_buf_cat2(str, ":");
}
v = rb_reg_nth_match(i, match);
@@ -1847,629 +1399,125 @@ match_inspect(VALUE match)
VALUE rb_cRegexp;
-static int
-read_escaped_byte(const char **pp, const char *end, onig_errmsg_buffer err)
-{
- const char *p = *pp;
- int code;
- int meta_prefix = 0, ctrl_prefix = 0;
- size_t len;
- int retbyte;
-
- retbyte = -1;
- if (p == end || *p++ != '\\') {
- errcpy(err, "too short escaped multibyte character");
- return -1;
- }
-
-again:
- if (p == end) {
- errcpy(err, "too short escape sequence");
- return -1;
- }
- switch (*p++) {
- case '\\': code = '\\'; break;
- case 'n': code = '\n'; break;
- case 't': code = '\t'; break;
- case 'r': code = '\r'; break;
- case 'f': code = '\f'; break;
- case 'v': code = '\013'; break;
- case 'a': code = '\007'; break;
- case 'e': code = '\033'; break;
-
- /* \OOO */
- case '0': case '1': case '2': case '3':
- case '4': case '5': case '6': case '7':
- p--;
- code = scan_oct(p, end < p+3 ? end-p : 3, &len);
- p += len;
- break;
-
- case 'x': /* \xHH */
- code = scan_hex(p, end < p+2 ? end-p : 2, &len);
- if (len < 1) {
- errcpy(err, "invalid hex escape");
- return -1;
- }
- p += len;
- break;
-
- case 'M': /* \M-X, \M-\C-X, \M-\cX */
- if (meta_prefix) {
- errcpy(err, "duplicate meta escape");
- return -1;
- }
- meta_prefix = 1;
- if (p+1 < end && *p++ == '-' && (*p & 0x80) == 0) {
- if (*p == '\\') {
- p++;
- goto again;
- }
- else {
- code = *p++;
- break;
- }
- }
- errcpy(err, "too short meta escape");
- return -1;
-
- case 'C': /* \C-X, \C-\M-X */
- if (p == end || *p++ != '-') {
- errcpy(err, "too short control escape");
- return -1;
- }
- case 'c': /* \cX, \c\M-X */
- if (ctrl_prefix) {
- errcpy(err, "duplicate control escape");
- return -1;
- }
- ctrl_prefix = 1;
- if (p < end && (*p & 0x80) == 0) {
- if (*p == '\\') {
- p++;
- goto again;
- }
- else {
- code = *p++;
- break;
- }
- }
- errcpy(err, "too short control escape");
- return -1;
-
- default:
- errcpy(err, "unexpected escape sequence");
- return -1;
- }
- if (code < 0 || 0xff < code) {
- errcpy(err, "invalid escape code");
- return -1;
- }
-
- if (ctrl_prefix)
- code &= 0x1f;
- if (meta_prefix)
- code |= 0x80;
-
- *pp = p;
- return code;
-}
-
-static int
-unescape_escaped_nonascii(const char **pp, const char *end, rb_encoding *enc,
- VALUE buf, rb_encoding **encp, onig_errmsg_buffer err)
-{
- const char *p = *pp;
- int chmaxlen = rb_enc_mbmaxlen(enc);
- char *chbuf = ALLOCA_N(char, chmaxlen);
- int chlen = 0;
- int byte;
- int l;
-
- memset(chbuf, 0, chmaxlen);
-
- byte = read_escaped_byte(&p, end, err);
- if (byte == -1) {
- return -1;
- }
-
- chbuf[chlen++] = byte;
- while (chlen < chmaxlen &&
- MBCLEN_NEEDMORE_P(rb_enc_precise_mbclen(chbuf, chbuf+chlen, enc))) {
- byte = read_escaped_byte(&p, end, err);
- if (byte == -1) {
- return -1;
- }
- chbuf[chlen++] = byte;
- }
-
- l = rb_enc_precise_mbclen(chbuf, chbuf+chlen, enc);
- if (MBCLEN_INVALID_P(l)) {
- errcpy(err, "invalid multibyte escape");
- return -1;
- }
- if (1 < chlen || (chbuf[0] & 0x80)) {
- rb_str_buf_cat(buf, chbuf, chlen);
-
- if (*encp == 0)
- *encp = enc;
- else if (*encp != enc) {
- errcpy(err, "escaped non ASCII character in UTF-8 regexp");
- return -1;
- }
- }
- else {
- char escbuf[5];
- snprintf(escbuf, sizeof(escbuf), "\\x%02X", chbuf[0]&0xff);
- rb_str_buf_cat(buf, escbuf, 4);
- }
- *pp = p;
- return 0;
-}
-
-static int
-check_unicode_range(unsigned long code, onig_errmsg_buffer err)
-{
- if ((0xd800 <= code && code <= 0xdfff) || /* Surrogates */
- 0x10ffff < code) {
- errcpy(err, "invalid Unicode range");
- return -1;
- }
- return 0;
-}
-
-static int
-append_utf8(unsigned long uv,
- VALUE buf, rb_encoding **encp, onig_errmsg_buffer err)
-{
- if (check_unicode_range(uv, err) != 0)
- return -1;
- if (uv < 0x80) {
- char escbuf[5];
- snprintf(escbuf, sizeof(escbuf), "\\x%02X", (int)uv);
- rb_str_buf_cat(buf, escbuf, 4);
- }
- else {
- int len;
- char utf8buf[6];
- len = rb_uv_to_utf8(utf8buf, uv);
- rb_str_buf_cat(buf, utf8buf, len);
-
- if (*encp == 0)
- *encp = rb_utf8_encoding();
- else if (*encp != rb_utf8_encoding()) {
- errcpy(err, "UTF-8 character in non UTF-8 regexp");
- return -1;
- }
- }
- return 0;
-}
-
-static int
-unescape_unicode_list(const char **pp, const char *end,
- VALUE buf, rb_encoding **encp, onig_errmsg_buffer err)
-{
- const char *p = *pp;
- int has_unicode = 0;
- unsigned long code;
- size_t len;
-
- while (p < end && ISSPACE(*p)) p++;
-
- while (1) {
- code = ruby_scan_hex(p, end-p, &len);
- if (len == 0)
- break;
- if (6 < len) { /* max 10FFFF */
- errcpy(err, "invalid Unicode range");
- return -1;
- }
- p += len;
- if (append_utf8(code, buf, encp, err) != 0)
- return -1;
- has_unicode = 1;
-
- while (p < end && ISSPACE(*p)) p++;
- }
-
- if (has_unicode == 0) {
- errcpy(err, "invalid Unicode list");
- return -1;
- }
-
- *pp = p;
-
- return 0;
-}
-
-static int
-unescape_unicode_bmp(const char **pp, const char *end,
- VALUE buf, rb_encoding **encp, onig_errmsg_buffer err)
-{
- const char *p = *pp;
- size_t len;
- unsigned long code;
-
- if (end < p+4) {
- errcpy(err, "invalid Unicode escape");
- return -1;
- }
- code = ruby_scan_hex(p, 4, &len);
- if (len != 4) {
- errcpy(err, "invalid Unicode escape");
- return -1;
- }
- if (append_utf8(code, buf, encp, err) != 0)
- return -1;
- *pp = p + 4;
- return 0;
-}
-
-static int
-unescape_nonascii(const char *p, const char *end, rb_encoding *enc,
- VALUE buf, rb_encoding **encp, int *has_property,
- onig_errmsg_buffer err)
-{
- char c;
- char smallbuf[2];
-
- while (p < end) {
- int chlen = rb_enc_precise_mbclen(p, end, enc);
- if (!MBCLEN_CHARFOUND_P(chlen)) {
- errcpy(err, "invalid multibyte character");
- return -1;
- }
- chlen = MBCLEN_CHARFOUND_LEN(chlen);
- if (1 < chlen || (*p & 0x80)) {
- rb_str_buf_cat(buf, p, chlen);
- p += chlen;
- if (*encp == 0)
- *encp = enc;
- else if (*encp != enc) {
- errcpy(err, "non ASCII character in UTF-8 regexp");
- return -1;
- }
- continue;
- }
-
- switch (c = *p++) {
- case '\\':
- if (p == end) {
- errcpy(err, "too short escape sequence");
- return -1;
- }
- switch (c = *p++) {
- case '1': case '2': case '3':
- case '4': case '5': case '6': case '7': /* \O, \OO, \OOO or backref */
- {
- size_t octlen;
- if (ruby_scan_oct(p-1, end-(p-1), &octlen) <= 0177) {
- /* backref or 7bit octal.
- no need to unescape anyway.
- re-escaping may break backref */
- goto escape_asis;
- }
- }
- /* xxx: How about more than 199 subexpressions? */
-
- case '0': /* \0, \0O, \0OO */
-
- case 'x': /* \xHH */
- case 'c': /* \cX, \c\M-X */
- case 'C': /* \C-X, \C-\M-X */
- case 'M': /* \M-X, \M-\C-X, \M-\cX */
- p = p-2;
- if (unescape_escaped_nonascii(&p, end, enc, buf, encp, err) != 0)
- return -1;
- break;
-
- case 'u':
- if (p == end) {
- errcpy(err, "too short escape sequence");
- return -1;
- }
- if (*p == '{') {
- /* \u{H HH HHH HHHH HHHHH HHHHHH ...} */
- p++;
- if (unescape_unicode_list(&p, end, buf, encp, err) != 0)
- return -1;
- if (p == end || *p++ != '}') {
- errcpy(err, "invalid Unicode list");
- return -1;
- }
- break;
- }
- else {
- /* \uHHHH */
- if (unescape_unicode_bmp(&p, end, buf, encp, err) != 0)
- return -1;
- break;
- }
-
- case 'p': /* \p{Hiragana} */
- if (!*encp) {
- *has_property = 1;
- }
- goto escape_asis;
-
- default: /* \n, \\, \d, \9, etc. */
-escape_asis:
- smallbuf[0] = '\\';
- smallbuf[1] = c;
- rb_str_buf_cat(buf, smallbuf, 2);
- break;
- }
- break;
-
- default:
- rb_str_buf_cat(buf, &c, 1);
- break;
- }
- }
-
- return 0;
-}
-
-static VALUE
-rb_reg_preprocess(const char *p, const char *end, rb_encoding *enc,
- rb_encoding **fixed_enc, onig_errmsg_buffer err)
-{
- VALUE buf;
- int has_property = 0;
-
- buf = rb_str_buf_new(0);
-
- if (rb_enc_asciicompat(enc))
- *fixed_enc = 0;
- else {
- *fixed_enc = enc;
- rb_enc_associate(buf, enc);
- }
-
- if (unescape_nonascii(p, end, enc, buf, fixed_enc, &has_property, err) != 0)
- return Qnil;
-
- if (has_property && !*fixed_enc) {
- *fixed_enc = enc;
- }
-
- if (*fixed_enc) {
- rb_enc_associate(buf, *fixed_enc);
- }
-
- return buf;
-}
-
-VALUE
-rb_reg_check_preprocess(VALUE str)
-{
- rb_encoding *fixed_enc = 0;
- onig_errmsg_buffer err = "";
- VALUE buf;
- char *p, *end;
- rb_encoding *enc;
-
- StringValue(str);
- p = RSTRING_PTR(str);
- end = p + RSTRING_LEN(str);
- enc = rb_enc_get(str);
-
- buf = rb_reg_preprocess(p, end, enc, &fixed_enc, err);
- RB_GC_GUARD(str);
-
- if (buf == Qnil) {
- return rb_reg_error_desc(str, 0, err);
- }
- return Qnil;
-}
-
-static VALUE
-rb_reg_preprocess_dregexp(VALUE ary)
-{
- rb_encoding *fixed_enc = 0;
- rb_encoding *regexp_enc = 0;
- onig_errmsg_buffer err = "";
- int i;
- VALUE result = 0;
-
- if (RARRAY_LEN(ary) == 0) {
- rb_raise(rb_eArgError, "no arguments given");
- }
-
- for (i = 0; i < RARRAY_LEN(ary); i++) {
- VALUE str = RARRAY_PTR(ary)[i];
- VALUE buf;
- char *p, *end;
- rb_encoding *src_enc;
-
- StringValue(str);
- p = RSTRING_PTR(str);
- end = p + RSTRING_LEN(str);
- src_enc = rb_enc_get(str);
-
- buf = rb_reg_preprocess(p, end, src_enc, &fixed_enc, err);
-
- if (buf == Qnil)
- rb_raise(rb_eArgError, "%s", err);
-
- if (fixed_enc != 0) {
- if (regexp_enc != 0 && regexp_enc != fixed_enc) {
- rb_raise(rb_eArgError, "encoding mismatch in dynamic regexp : %s and %s",
- rb_enc_name(regexp_enc), rb_enc_name(fixed_enc));
- }
- regexp_enc = fixed_enc;
- }
-
- if (!result)
- result = rb_str_new3(str);
- else
- rb_str_buf_append(result, str);
- }
- if (regexp_enc) {
- rb_enc_associate(result, regexp_enc);
- }
-
- return result;
-}
-
-static int
-rb_reg_initialize(VALUE obj, const char *s, long len, rb_encoding *enc,
- int options, onig_errmsg_buffer err)
+static void
+rb_reg_initialize(obj, s, len, options)
+ VALUE obj;
+ const char *s;
+ long len;
+ int options; /* CASEFOLD = 1 */
+ /* EXTENDED = 2 */
+ /* MULTILINE = 4 */
+ /* CODE_NONE = 16 */
+ /* CODE_EUC = 32 */
+ /* CODE_SJIS = 48 */
+ /* CODE_UTF8 = 64 */
{
struct RRegexp *re = RREGEXP(obj);
- VALUE unescaped;
- rb_encoding *fixed_enc = 0;
- rb_encoding *a_enc = rb_ascii8bit_encoding();
- if (!OBJ_UNTRUSTED(obj) && rb_safe_level() >= 4)
+ if (!OBJ_TAINTED(obj) && rb_safe_level() >= 4)
rb_raise(rb_eSecurityError, "Insecure: can't modify regexp");
rb_check_frozen(obj);
if (FL_TEST(obj, REG_LITERAL))
rb_raise(rb_eSecurityError, "can't modify literal regexp");
- if (re->ptr)
- rb_raise(rb_eTypeError, "already initialized regexp");
+ if (re->ptr) re_free_pattern(re->ptr);
+ if (re->str) free(re->str);
re->ptr = 0;
+ re->str = 0;
- if (rb_enc_dummy_p(enc)) {
- errcpy(err, "can't make regexp with dummy encoding");
- return -1;
- }
-
- unescaped = rb_reg_preprocess(s, s+len, enc, &fixed_enc, err);
- if (unescaped == Qnil)
- return -1;
-
- if (fixed_enc) {
- if ((fixed_enc != enc && (options & ARG_ENCODING_FIXED)) ||
- (fixed_enc != a_enc && (options & ARG_ENCODING_NONE))) {
- errcpy(err, "incompatible character encoding");
- return -1;
- }
- if (fixed_enc != a_enc) {
- options |= ARG_ENCODING_FIXED;
- enc = fixed_enc;
- }
- }
- else if (!(options & ARG_ENCODING_FIXED)) {
- enc = rb_usascii_encoding();
+ switch (options & ~0xf) {
+ case 0:
+ default:
+ FL_SET(re, reg_kcode);
+ break;
+ case 16:
+ kcode_none(re);
+ break;
+ case 32:
+ kcode_euc(re);
+ break;
+ case 48:
+ kcode_sjis(re);
+ break;
+ case 64:
+ kcode_utf8(re);
+ break;
}
- rb_enc_associate((VALUE)re, enc);
- if ((options & ARG_ENCODING_FIXED) || fixed_enc) {
- re->basic.flags |= KCODE_FIXED;
+ if (options & ~0xf) {
+ rb_kcode_set_option((VALUE)re);
}
- if (options & ARG_ENCODING_NONE) {
- re->basic.flags |= REG_ENCODING_NONE;
+ if (ruby_ignorecase) {
+ options |= RE_OPTION_IGNORECASE;
+ FL_SET(re, REG_CASESTATE);
}
-
- re->ptr = make_regexp(RSTRING_PTR(unescaped), RSTRING_LEN(unescaped), enc,
- options & ARG_REG_OPTION_MASK, err);
- if (!re->ptr) return -1;
- re->src = rb_enc_str_new(s, len, enc);
- OBJ_FREEZE(re->src);
- RB_GC_GUARD(unescaped);
- return 0;
-}
-
-static int
-rb_reg_initialize_str(VALUE obj, VALUE str, int options, onig_errmsg_buffer err)
-{
- int ret;
- rb_encoding *enc = rb_enc_get(str);
- if (options & ARG_ENCODING_NONE) {
- rb_encoding *ascii8bit = rb_ascii8bit_encoding();
- if (enc != ascii8bit) {
- if (rb_enc_str_coderange(str) != ENC_CODERANGE_7BIT) {
- errcpy(err, "/.../n has a non escaped non ASCII character in non ASCII-8BIT script");
- return -1;
- }
- enc = ascii8bit;
- }
+ re->ptr = make_regexp(s, len, options & 0xf);
+ re->str = ALLOC_N(char, len+1);
+ memcpy(re->str, s, len);
+ re->str[len] = '\0';
+ re->len = len;
+ if (options & ~0xf) {
+ rb_kcode_reset_option();
}
- ret = rb_reg_initialize(obj, RSTRING_PTR(str), RSTRING_LEN(str), enc,
- options, err);
- RB_GC_GUARD(str);
- return ret;
+ if (ruby_in_compile) FL_SET(obj, REG_LITERAL);
}
+static VALUE rb_reg_s_alloc _((VALUE));
static VALUE
-rb_reg_s_alloc(VALUE klass)
+rb_reg_s_alloc(klass)
+ VALUE klass;
{
NEWOBJ(re, struct RRegexp);
OBJSETUP(re, klass, T_REGEXP);
re->ptr = 0;
- re->src = 0;
- re->usecnt = 0;
+ re->len = 0;
+ re->str = 0;
return (VALUE)re;
}
VALUE
-rb_reg_new_str(VALUE s, int options)
+rb_reg_new(s, len, options)
+ const char *s;
+ long len;
+ int options;
{
VALUE re = rb_reg_s_alloc(rb_cRegexp);
- onig_errmsg_buffer err = "";
- if (rb_reg_initialize_str(re, s, options, err) != 0) {
- rb_reg_raise_str(s, options, err);
- }
-
- return re;
+ rb_reg_initialize(re, s, len, options);
+ return (VALUE)re;
}
-VALUE
-rb_reg_new_ary(VALUE ary, int opt)
-{
- return rb_reg_new_str(rb_reg_preprocess_dregexp(ary), opt);
-}
+static int case_cache;
+static int kcode_cache;
+static VALUE reg_cache;
VALUE
-rb_enc_reg_new(const char *s, long len, rb_encoding *enc, int options)
+rb_reg_regcomp(str)
+ VALUE str;
{
- VALUE re = rb_reg_s_alloc(rb_cRegexp);
- onig_errmsg_buffer err = "";
-
- if (rb_reg_initialize(re, s, len, enc, options, err) != 0) {
- rb_enc_reg_raise(s, len, enc, options, err);
- }
-
- return re;
-}
+ volatile VALUE save_str = str;
+ if (reg_cache && RREGEXP(reg_cache)->len == RSTRING(str)->len
+ && case_cache == ruby_ignorecase
+ && kcode_cache == reg_kcode
+ && memcmp(RREGEXP(reg_cache)->str, RSTRING(str)->ptr, RSTRING(str)->len) == 0)
+ return reg_cache;
-VALUE
-rb_reg_new(const char *s, long len, int options)
-{
- return rb_enc_reg_new(s, len, rb_ascii8bit_encoding(), options);
+ case_cache = ruby_ignorecase;
+ kcode_cache = reg_kcode;
+ reg_cache = rb_reg_new(RSTRING(str)->ptr, RSTRING(str)->len, ruby_ignorecase);
+ RB_GC_GUARD(save_str);
+ return reg_cache;
}
-VALUE
-rb_reg_compile(VALUE str, int options)
+static int
+rb_reg_cur_kcode(re)
+ VALUE re;
{
- VALUE re = rb_reg_s_alloc(rb_cRegexp);
- onig_errmsg_buffer err = "";
-
- if (!str) str = rb_str_new(0,0);
- if (rb_reg_initialize_str(re, str, options, err) != 0) {
- rb_set_errinfo(rb_reg_error_desc(str, options, err));
- return Qnil;
+ if (FL_TEST(re, KCODE_FIXED)) {
+ return RBASIC(re)->flags & KCODE_MASK;
}
- FL_SET(re, REG_LITERAL);
- return re;
-}
-
-static VALUE reg_cache;
-
-VALUE
-rb_reg_regcomp(VALUE str)
-{
- volatile VALUE save_str = str;
- if (reg_cache && RREGEXP_SRC_LEN(reg_cache) == RSTRING_LEN(str)
- && ENCODING_GET(reg_cache) == ENCODING_GET(str)
- && memcmp(RREGEXP_SRC_PTR(reg_cache), RSTRING_PTR(str), RSTRING_LEN(str)) == 0)
- return reg_cache;
-
- return reg_cache = rb_reg_new_str(save_str, 0);
+ return 0;
}
/*
@@ -2480,22 +1528,22 @@ rb_reg_regcomp(VALUE str)
*/
static VALUE
-rb_reg_hash(VALUE re)
+rb_reg_hash(re)
+ VALUE re;
{
- unsigned long hashval;
- long len;
+ int hashval, len;
char *p;
rb_reg_check(re);
hashval = RREGEXP(re)->ptr->options;
- len = RREGEXP_SRC_LEN(re);
- p = RREGEXP_SRC_PTR(re);
+ len = RREGEXP(re)->len;
+ p = RREGEXP(re)->str;
while (len--) {
hashval = hashval * 33 + *p++;
}
hashval = hashval + (hashval>>5);
-
- return LONG2FIX(hashval);
+
+ return INT2FIX(hashval);
}
@@ -2503,157 +1551,95 @@ rb_reg_hash(VALUE re)
* call-seq:
* rxp == other_rxp => true or false
* rxp.eql?(other_rxp) => true or false
- *
+ *
* Equality---Two regexps are equal if their patterns are identical, they have
* the same character set code, and their <code>casefold?</code> values are the
* same.
- *
+ *
* /abc/ == /abc/x #=> false
* /abc/ == /abc/i #=> false
- * /abc/ == /abc/n #=> false
* /abc/u == /abc/n #=> false
*/
static VALUE
-rb_reg_equal(VALUE re1, VALUE re2)
+rb_reg_equal(re1, re2)
+ VALUE re1, re2;
{
if (re1 == re2) return Qtrue;
if (TYPE(re2) != T_REGEXP) return Qfalse;
rb_reg_check(re1); rb_reg_check(re2);
- if (FL_TEST(re1, KCODE_FIXED) != FL_TEST(re2, KCODE_FIXED)) return Qfalse;
- if (RREGEXP(re1)->ptr->options != RREGEXP(re2)->ptr->options) return Qfalse;
- if (RREGEXP_SRC_LEN(re1) != RREGEXP_SRC_LEN(re2)) return Qfalse;
- if (ENCODING_GET(re1) != ENCODING_GET(re2)) return Qfalse;
- if (memcmp(RREGEXP_SRC_PTR(re1), RREGEXP_SRC_PTR(re2), RREGEXP_SRC_LEN(re1)) == 0) {
+ if (RREGEXP(re1)->len != RREGEXP(re2)->len) return Qfalse;
+ if (memcmp(RREGEXP(re1)->str, RREGEXP(re2)->str, RREGEXP(re1)->len) == 0 &&
+ rb_reg_cur_kcode(re1) == rb_reg_cur_kcode(re2) &&
+ RREGEXP(re1)->ptr->options == RREGEXP(re2)->ptr->options) {
return Qtrue;
}
return Qfalse;
}
-static VALUE
-reg_operand(VALUE s, int check)
-{
- if (SYMBOL_P(s)) {
- return rb_sym_to_s(s);
- }
- else {
- VALUE tmp = rb_check_string_type(s);
- if (check && NIL_P(tmp)) {
- rb_raise(rb_eTypeError, "can't convert %s to String",
- rb_obj_classname(s));
- }
- return tmp;
- }
-}
-static long
-reg_match_pos(VALUE re, VALUE *strp, long pos)
+/*
+ * call-seq:
+ * rxp.match(str) => matchdata or nil
+ *
+ * Returns a <code>MatchData</code> object describing the match, or
+ * <code>nil</code> if there was no match. This is equivalent to retrieving the
+ * value of the special variable <code>$~</code> following a normal match.
+ *
+ * /(.)(.)(.)/.match("abc")[2] #=> "b"
+ */
+
+VALUE
+rb_reg_match(re, str)
+ VALUE re, str;
{
- VALUE str = *strp;
+ long start;
if (NIL_P(str)) {
rb_backref_set(Qnil);
- return -1;
+ return Qnil;
}
- *strp = str = reg_operand(str, Qtrue);
- if (pos != 0) {
- if (pos < 0) {
- VALUE l = rb_str_length(str);
- pos += NUM2INT(l);
- if (pos < 0) {
- return pos;
- }
- }
- pos = rb_str_offset(str, pos);
+ StringValue(str);
+ start = rb_reg_search(re, str, 0, 0);
+ if (start < 0) {
+ return Qnil;
}
- return rb_reg_search(re, str, pos, 0);
+ return LONG2FIX(start);
}
-/*
- * call-seq:
- * rxp =~ str => integer or nil
- *
- * Match---Matches <i>rxp</i> against <i>str</i>.
- *
- * /at/ =~ "input data" #=> 7
- * /ax/ =~ "input data" #=> nil
- *
- * If <code>=~</code> is used with a regexp literal with named captures,
- * captured strings (or nil) is assigned to local variables named by
- * the capture names.
- *
- * /(?<lhs>\w+)\s*=\s*(?<rhs>\w+)/ =~ " x = y "
- * p lhs #=> "x"
- * p rhs #=> "y"
- *
- * If it is not matched, nil is assigned for the variables.
- *
- * /(?<lhs>\w+)\s*=\s*(?<rhs>\w+)/ =~ " x = "
- * p lhs #=> nil
- * p rhs #=> nil
- *
- * This assignment is implemented in the Ruby parser.
- * The parser detects 'regexp-literal =~ expression' for the assignment.
- * The regexp must be a literal without interpolation and placed at left hand side.
- *
- * The assignment is not occur if the regexp is not a literal.
- *
- * re = /(?<lhs>\w+)\s*=\s*(?<rhs>\w+)/
- * re =~ " x = y "
- * p lhs # undefined local variable
- * p rhs # undefined local variable
- *
- * A regexp interpolation, <code>#{}</code>, also disables
- * the assignment.
- *
- * rhs_pat = /(?<rhs>\w+)/
- * /(?<lhs>\w+)\s*=\s*#{rhs_pat}/ =~ "x = y"
- * p lhs # undefined local variable
- *
- * The assignment is not occur if the regexp is placed at right hand side.
- *
- * " x = y " =~ /(?<lhs>\w+)\s*=\s*(?<rhs>\w+)/
- * p lhs, rhs # undefined local variable
- *
- */
-
-VALUE
-rb_reg_match(VALUE re, VALUE str)
-{
- long pos = reg_match_pos(re, &str, 0);
- if (pos < 0) return Qnil;
- pos = rb_str_sublen(str, pos);
- return LONG2FIX(pos);
-}
/*
* call-seq:
* rxp === str => true or false
- *
+ *
* Case Equality---Synonym for <code>Regexp#=~</code> used in case statements.
- *
+ *
* a = "HELLO"
* case a
* when /^[a-z]*$/; print "Lower case\n"
* when /^[A-Z]*$/; print "Upper case\n"
* else; print "Mixed case\n"
* end
- *
+ *
* <em>produces:</em>
- *
+ *
* Upper case
*/
VALUE
-rb_reg_eqq(VALUE re, VALUE str)
+rb_reg_eqq(re, str)
+ VALUE re, str;
{
long start;
- str = reg_operand(str, Qfalse);
- if (NIL_P(str)) {
- rb_backref_set(Qnil);
- return Qfalse;
+ if (TYPE(str) != T_STRING) {
+ str = rb_check_string_type(str);
+ if (NIL_P(str)) {
+ rb_backref_set(Qnil);
+ return Qfalse;
+ }
}
+ StringValue(str);
start = rb_reg_search(re, str, 0, 0);
if (start < 0) {
return Qfalse;
@@ -2665,16 +1651,17 @@ rb_reg_eqq(VALUE re, VALUE str)
/*
* call-seq:
* ~ rxp => integer or nil
- *
+ *
* Match---Matches <i>rxp</i> against the contents of <code>$_</code>.
* Equivalent to <code><i>rxp</i> =~ $_</code>.
- *
+ *
* $_ = "input data"
* ~ /at/ #=> 7
*/
VALUE
-rb_reg_match2(VALUE re)
+rb_reg_match2(re)
+ VALUE re;
{
long start;
VALUE line = rb_lastline_get();
@@ -2688,62 +1675,30 @@ rb_reg_match2(VALUE re)
if (start < 0) {
return Qnil;
}
- start = rb_str_sublen(line, start);
return LONG2FIX(start);
}
/*
* call-seq:
- * rxp.match(str) => matchdata or nil
- * rxp.match(str,pos) => matchdata or nil
- *
+ * rxp.match(str) => matchdata or nil
+ *
* Returns a <code>MatchData</code> object describing the match, or
* <code>nil</code> if there was no match. This is equivalent to retrieving the
* value of the special variable <code>$~</code> following a normal match.
- * If the second parameter is present, it specifies the position in the string
- * to begin the search.
- *
+ *
* /(.)(.)(.)/.match("abc")[2] #=> "b"
- * /(.)(.)/.match("abc", 1)[2] #=> "c"
- *
- * If a block is given, invoke the block with MatchData if match succeed, so
- * that you can write
- *
- * pat.match(str) {|m| ...}
- *
- * instead of
- *
- * if m = pat.match(str)
- * ...
- * end
- *
- * The return value is a value from block execution in this case.
*/
static VALUE
-rb_reg_match_m(int argc, VALUE *argv, VALUE re)
+rb_reg_match_m(re, str)
+ VALUE re, str;
{
- VALUE result, str, initpos;
- long pos;
-
- if (rb_scan_args(argc, argv, "11", &str, &initpos) == 2) {
- pos = NUM2LONG(initpos);
- }
- else {
- pos = 0;
- }
+ VALUE result = rb_reg_match(re, str);
- pos = reg_match_pos(re, &str, pos);
- if (pos < 0) {
- rb_backref_set(Qnil);
- return Qnil;
- }
+ if (NIL_P(result)) return Qnil;
result = rb_backref_get();
rb_match_busy(result);
- if (!NIL_P(result) && rb_block_given_p()) {
- return rb_yield(result);
- }
return result;
}
@@ -2753,14 +1708,13 @@ rb_reg_match_m(int argc, VALUE *argv, VALUE re)
* Synonym for <code>Regexp.new</code>
*/
-
/*
* call-seq:
- * Regexp.new(string [, options]) => regexp
+ * Regexp.new(string [, options [, lang]]) => regexp
* Regexp.new(regexp) => regexp
- * Regexp.compile(string [, options]) => regexp
+ * Regexp.compile(string [, options [, lang]]) => regexp
* Regexp.compile(regexp) => regexp
- *
+ *
* Constructs a new regular expression from <i>pattern</i>, which can be either
* a <code>String</code> or a <code>Regexp</code> (in which case that regexp's
* options are propagated, and new options may not be specified (a change as of
@@ -2768,8 +1722,10 @@ rb_reg_match_m(int argc, VALUE *argv, VALUE re)
* more of the constants <code>Regexp::EXTENDED</code>,
* <code>Regexp::IGNORECASE</code>, and <code>Regexp::MULTILINE</code>,
* <em>or</em>-ed together. Otherwise, if <i>options</i> is not
- * <code>nil</code>, the regexp will be case insensitive.
- *
+ * <code>nil</code>, the regexp will be case insensitive. The <i>lang</i>
+ * parameter enables multibyte support for the regexp: `n', `N' = none, `e',
+ * `E' = EUC, `s', `S' = SJIS, `u', `U' = UTF-8.
+ *
* r1 = Regexp.new('^a-z+:\\s+\w+') #=> /^a-z+:\s+\w+/
* r2 = Regexp.new('cat', true) #=> /cat/i
* r3 = Regexp.new('dog', Regexp::EXTENDED) #=> /dog/x
@@ -2777,76 +1733,96 @@ rb_reg_match_m(int argc, VALUE *argv, VALUE re)
*/
static VALUE
-rb_reg_initialize_m(int argc, VALUE *argv, VALUE self)
+rb_reg_initialize_m(argc, argv, self)
+ int argc;
+ VALUE *argv;
+ VALUE self;
{
- onig_errmsg_buffer err = "";
- int flags = 0;
- VALUE str;
- rb_encoding *enc;
- const char *ptr;
+ const char *s;
long len;
+ int flags = 0;
if (argc == 0 || argc > 3) {
rb_raise(rb_eArgError, "wrong number of arguments");
}
if (TYPE(argv[0]) == T_REGEXP) {
- VALUE re = argv[0];
-
if (argc > 1) {
- rb_warn("flags ignored");
+ rb_warn("flags%s ignored", (argc == 3) ? " and encoding": "");
}
- rb_reg_check(re);
- flags = rb_reg_options(re);
- ptr = RREGEXP_SRC_PTR(re);
- len = RREGEXP_SRC_LEN(re);
- enc = rb_enc_get(re);
- if (rb_reg_initialize(self, ptr, len, enc, flags, err)) {
- str = rb_enc_str_new(ptr, len, enc);
- rb_reg_raise_str(str, flags, err);
+ rb_reg_check(argv[0]);
+ flags = RREGEXP(argv[0])->ptr->options & 0xf;
+ if (FL_TEST(argv[0], KCODE_FIXED)) {
+ switch (RBASIC(argv[0])->flags & KCODE_MASK) {
+ case KCODE_NONE:
+ flags |= 16;
+ break;
+ case KCODE_EUC:
+ flags |= 32;
+ break;
+ case KCODE_SJIS:
+ flags |= 48;
+ break;
+ case KCODE_UTF8:
+ flags |= 64;
+ break;
+ default:
+ break;
+ }
}
+ s = RREGEXP(argv[0])->str;
+ len = RREGEXP(argv[0])->len;
}
else {
if (argc >= 2) {
if (FIXNUM_P(argv[1])) flags = FIX2INT(argv[1]);
- else if (RTEST(argv[1])) flags = ONIG_OPTION_IGNORECASE;
+ else if (RTEST(argv[1])) flags = RE_OPTION_IGNORECASE;
}
- enc = 0;
if (argc == 3 && !NIL_P(argv[2])) {
char *kcode = StringValuePtr(argv[2]);
- if (kcode[0] == 'n' || kcode[1] == 'N') {
- enc = rb_ascii8bit_encoding();
- flags |= ARG_ENCODING_NONE;
- }
- else {
- rb_warn("encoding option is ignored - %s", kcode);
+
+ flags &= ~0x70;
+ switch (kcode[0]) {
+ case 'n': case 'N':
+ flags |= 16;
+ break;
+ case 'e': case 'E':
+ flags |= 32;
+ break;
+ case 's': case 'S':
+ flags |= 48;
+ break;
+ case 'u': case 'U':
+ flags |= 64;
+ break;
+ default:
+ break;
}
}
- str = argv[0];
- ptr = StringValuePtr(str);
- if (enc
- ? rb_reg_initialize(self, ptr, RSTRING_LEN(str), enc, flags, err)
- : rb_reg_initialize_str(self, str, flags, err)) {
- rb_reg_raise_str(str, flags, err);
- }
+ s = StringValuePtr(argv[0]);
+ len = RSTRING(argv[0])->len;
}
+ rb_reg_initialize(self, s, len, flags);
return self;
}
VALUE
-rb_reg_quote(VALUE str)
+rb_reg_quote(str)
+ VALUE str;
{
- rb_encoding *enc = rb_enc_get(str);
char *s, *send, *t;
VALUE tmp;
- int c, clen;
- int ascii_only = rb_enc_str_asciionly_p(str);
-
- s = RSTRING_PTR(str);
- send = s + RSTRING_LEN(str);
- while (s < send) {
- c = rb_enc_ascget(s, send, &clen, enc);
- if (c == -1) {
- s += mbclen(s, send, enc);
+ int c;
+
+ s = RSTRING(str)->ptr;
+ send = s + RSTRING(str)->len;
+ for (; s < send; s++) {
+ c = *s;
+ if (ismbchar(c)) {
+ int n = mbclen(c);
+
+ while (n-- && s < send)
+ s++;
+ s--;
continue;
}
switch (c) {
@@ -2855,76 +1831,61 @@ rb_reg_quote(VALUE str)
case '*': case '.': case '\\':
case '?': case '+': case '^': case '$':
case ' ': case '#':
- case '\t': case '\f': case '\v': case '\n': case '\r':
+ case '\t': case '\f': case '\n': case '\r':
goto meta_found;
}
- s += clen;
- }
- tmp = rb_str_new3(str);
- if (ascii_only) {
- rb_enc_associate(tmp, rb_usascii_encoding());
}
- return tmp;
+ return rb_str_new3(str);
meta_found:
- tmp = rb_str_new(0, RSTRING_LEN(str)*2);
- if (ascii_only) {
- rb_enc_associate(tmp, rb_usascii_encoding());
- }
- else {
- rb_enc_copy(tmp, str);
- }
- t = RSTRING_PTR(tmp);
+ tmp = rb_str_new(0, RSTRING(str)->len*2);
+ t = RSTRING(tmp)->ptr;
/* copy upto metacharacter */
- memcpy(t, RSTRING_PTR(str), s - RSTRING_PTR(str));
- t += s - RSTRING_PTR(str);
+ memcpy(t, RSTRING(str)->ptr, s - RSTRING(str)->ptr);
+ t += s - RSTRING(str)->ptr;
- while (s < send) {
- c = rb_enc_ascget(s, send, &clen, enc);
- if (c == -1) {
- int n = mbclen(s, send, enc);
+ for (; s < send; s++) {
+ c = *s;
+ if (ismbchar(c)) {
+ int n = mbclen(c);
- while (n--)
+ while (n-- && s < send)
*t++ = *s++;
+ s--;
continue;
}
- s += clen;
switch (c) {
case '[': case ']': case '{': case '}':
case '(': case ')': case '|': case '-':
case '*': case '.': case '\\':
case '?': case '+': case '^': case '$':
case '#':
- t += rb_enc_mbcput('\\', t, enc);
+ *t++ = '\\';
break;
case ' ':
- t += rb_enc_mbcput('\\', t, enc);
- t += rb_enc_mbcput(' ', t, enc);
+ *t++ = '\\';
+ *t++ = ' ';
continue;
case '\t':
- t += rb_enc_mbcput('\\', t, enc);
- t += rb_enc_mbcput('t', t, enc);
+ *t++ = '\\';
+ *t++ = 't';
continue;
case '\n':
- t += rb_enc_mbcput('\\', t, enc);
- t += rb_enc_mbcput('n', t, enc);
+ *t++ = '\\';
+ *t++ = 'n';
continue;
case '\r':
- t += rb_enc_mbcput('\\', t, enc);
- t += rb_enc_mbcput('r', t, enc);
+ *t++ = '\\';
+ *t++ = 'r';
continue;
case '\f':
- t += rb_enc_mbcput('\\', t, enc);
- t += rb_enc_mbcput('f', t, enc);
- continue;
- case '\v':
- t += rb_enc_mbcput('\\', t, enc);
- t += rb_enc_mbcput('v', t, enc);
+ *t++ = '\\';
+ *t++ = 'f';
continue;
}
- t += rb_enc_mbcput(c, t, enc);
+ *t++ = c;
}
- rb_str_resize(tmp, t - RSTRING_PTR(tmp));
+ rb_str_resize(tmp, t - RSTRING(tmp)->ptr);
OBJ_INFECT(tmp, str);
return tmp;
}
@@ -2932,176 +1893,160 @@ rb_reg_quote(VALUE str)
/*
* call-seq:
- * Regexp.escape(str) => string
- * Regexp.quote(str) => string
- *
+ * Regexp.escape(str) => a_str
+ * Regexp.quote(str) => a_str
+ *
* Escapes any characters that would have special meaning in a regular
* expression. Returns a new escaped string, or self if no characters are
* escaped. For any string,
- * <code>Regexp.new(Regexp.escape(<i>str</i>))=~<i>str</i></code> will be true.
- *
- * Regexp.escape('\*?{}.') #=> \\\*\?\{\}\.
- *
+ * <code>Regexp.escape(<i>str</i>)=~<i>str</i></code> will be true.
+ *
+ * Regexp.escape('\\*?{}.') #=> \\\\\*\?\{\}\.
*/
static VALUE
-rb_reg_s_quote(VALUE c, VALUE str)
+rb_reg_s_quote(argc, argv)
+ int argc;
+ VALUE *argv;
{
- return rb_reg_quote(reg_operand(str, Qtrue));
+ VALUE str, kcode;
+ int kcode_saved = reg_kcode;
+
+ rb_scan_args(argc, argv, "11", &str, &kcode);
+ if (!NIL_P(kcode)) {
+ rb_set_kcode(StringValuePtr(kcode));
+ curr_kcode = reg_kcode;
+ reg_kcode = kcode_saved;
+ }
+ StringValue(str);
+ str = rb_reg_quote(str);
+ rb_kcode_reset_option();
+ return str;
}
int
-rb_reg_options(VALUE re)
+rb_kcode()
{
- int options;
-
- rb_reg_check(re);
- options = RREGEXP(re)->ptr->options & ARG_REG_OPTION_MASK;
- if (RBASIC(re)->flags & KCODE_FIXED) options |= ARG_ENCODING_FIXED;
- if (RBASIC(re)->flags & REG_ENCODING_NONE) options |= ARG_ENCODING_NONE;
- return options;
+ switch (reg_kcode) {
+ case KCODE_EUC:
+ return MBCTYPE_EUC;
+ case KCODE_SJIS:
+ return MBCTYPE_SJIS;
+ case KCODE_UTF8:
+ return MBCTYPE_UTF8;
+ case KCODE_NONE:
+ return MBCTYPE_ASCII;
+ }
+ rb_bug("wrong reg_kcode value (0x%x)", reg_kcode);
}
-VALUE
-rb_check_regexp_type(VALUE re)
-{
- return rb_check_convert_type(re, T_REGEXP, "Regexp", "to_regexp");
+static int
+rb_reg_get_kcode(re)
+ VALUE re;
+{
+ switch (RBASIC(re)->flags & KCODE_MASK) {
+ case KCODE_NONE:
+ return 16;
+ case KCODE_EUC:
+ return 32;
+ case KCODE_SJIS:
+ return 48;
+ case KCODE_UTF8:
+ return 64;
+ default:
+ return 0;
+ }
}
-/*
- * call-seq:
- * Regexp.try_convert(obj) -> re or nil
- *
- * Try to convert <i>obj</i> into a Regexp, using to_regexp method.
- * Returns converted regexp or nil if <i>obj</i> cannot be converted
- * for any reason.
- *
- * Regexp.try_convert(/re/) #=> /re/
- * Regexp.try_convert("re") #=> nil
- *
- * o = Object.new
- * Regexp.try_convert(o) #=> nil
- * def o.to_regexp() /foo/ end
- * Regexp.try_convert(o) #=> /foo/
- *
- */
-static VALUE
-rb_reg_s_try_convert(VALUE dummy, VALUE re)
+int
+rb_reg_options(re)
+ VALUE re;
{
- return rb_check_regexp_type(re);
+ int options;
+
+ rb_reg_check(re);
+ options = RREGEXP(re)->ptr->options &
+ (RE_OPTION_IGNORECASE|RE_OPTION_MULTILINE|RE_OPTION_EXTENDED);
+ if (FL_TEST(re, KCODE_FIXED)) {
+ options |= rb_reg_get_kcode(re);
+ }
+ return options;
}
static VALUE
-rb_reg_s_union(VALUE self, VALUE args0)
+rb_reg_s_union(self, args0)
+ VALUE self;
+ VALUE args0;
{
long argc = RARRAY_LEN(args0);
-
if (argc == 0) {
VALUE args[1];
args[0] = rb_str_new2("(?!)");
return rb_class_new_instance(1, args, rb_cRegexp);
}
else if (argc == 1) {
- VALUE arg = rb_ary_entry(args0, 0);
- VALUE re = rb_check_regexp_type(arg);
- if (!NIL_P(re))
- return re;
+ VALUE v;
+ v = rb_check_convert_type(rb_ary_entry(args0, 0), T_REGEXP, "Regexp", "to_regexp");
+ if (!NIL_P(v))
+ return v;
else {
- VALUE quoted;
- quoted = rb_reg_s_quote(Qnil, arg);
- return rb_reg_new_str(quoted, 0);
+ VALUE args[1];
+ args[0] = rb_reg_s_quote(RARRAY_LEN(args0), RARRAY_PTR(args0));
+ return rb_class_new_instance(1, args, rb_cRegexp);
}
}
else {
- int i;
- VALUE source = rb_str_buf_new(0);
- rb_encoding *result_enc;
-
- int has_asciionly = 0;
- rb_encoding *has_ascii_compat_fixed = 0;
- rb_encoding *has_ascii_incompat = 0;
-
- for (i = 0; i < argc; i++) {
- volatile VALUE v;
- VALUE e = rb_ary_entry(args0, i);
-
- if (0 < i)
- rb_str_buf_cat_ascii(source, "|");
-
- v = rb_check_regexp_type(e);
- if (!NIL_P(v)) {
- rb_encoding *enc = rb_enc_get(v);
- if (!rb_enc_asciicompat(enc)) {
- if (!has_ascii_incompat)
- has_ascii_incompat = enc;
- else if (has_ascii_incompat != enc)
- rb_raise(rb_eArgError, "incompatible encodings: %s and %s",
- rb_enc_name(has_ascii_incompat), rb_enc_name(enc));
- }
- else if (rb_reg_fixed_encoding_p(v)) {
- if (!has_ascii_compat_fixed)
- has_ascii_compat_fixed = enc;
- else if (has_ascii_compat_fixed != enc)
- rb_raise(rb_eArgError, "incompatible encodings: %s and %s",
- rb_enc_name(has_ascii_compat_fixed), rb_enc_name(enc));
- }
- else {
- has_asciionly = 1;
- }
- v = rb_reg_to_s(v);
- }
- else {
- rb_encoding *enc;
- StringValue(e);
- enc = rb_enc_get(e);
- if (!rb_enc_str_asciicompat_p(e)) {
- if (!has_ascii_incompat)
- has_ascii_incompat = enc;
- else if (has_ascii_incompat != enc)
- rb_raise(rb_eArgError, "incompatible encodings: %s and %s",
- rb_enc_name(has_ascii_incompat), rb_enc_name(enc));
- }
- else if (rb_enc_str_asciionly_p(e)) {
- has_asciionly = 1;
- }
- else {
- if (!has_ascii_compat_fixed)
- has_ascii_compat_fixed = enc;
- else if (has_ascii_compat_fixed != enc)
- rb_raise(rb_eArgError, "incompatible encodings: %s and %s",
- rb_enc_name(has_ascii_compat_fixed), rb_enc_name(enc));
- }
- v = rb_reg_s_quote(Qnil, e);
- }
- if (has_ascii_incompat) {
- if (has_asciionly) {
- rb_raise(rb_eArgError, "ASCII incompatible encoding: %s",
- rb_enc_name(has_ascii_incompat));
- }
- if (has_ascii_compat_fixed) {
- rb_raise(rb_eArgError, "incompatible encodings: %s and %s",
- rb_enc_name(has_ascii_incompat), rb_enc_name(has_ascii_compat_fixed));
+ int i, kcode = -1;
+ VALUE kcode_re = Qnil;
+ VALUE source = rb_str_buf_new(0);
+ VALUE args[3];
+ for (i = 0; i < argc; i++) {
+ volatile VALUE v;
+ if (0 < i)
+ rb_str_buf_cat2(source, "|");
+ v = rb_check_convert_type(rb_ary_entry(args0, i), T_REGEXP, "Regexp", "to_regexp");
+ if (!NIL_P(v)) {
+ if (FL_TEST(v, KCODE_FIXED)) {
+ if (kcode == -1) {
+ kcode_re = v;
+ kcode = RBASIC(v)->flags & KCODE_MASK;
+ }
+ else if ((RBASIC(v)->flags & KCODE_MASK) != kcode) {
+ volatile VALUE str1, str2;
+ str1 = rb_inspect(kcode_re);
+ str2 = rb_inspect(v);
+ rb_raise(rb_eArgError, "mixed kcode: %s and %s",
+ RSTRING(str1)->ptr, RSTRING(str2)->ptr);
+ }
}
+ v = rb_reg_to_s(v);
}
-
- if (i == 0) {
- rb_enc_copy(source, v);
+ else {
+ args[0] = rb_ary_entry(args0, i);
+ v = rb_reg_s_quote(1, args);
}
- rb_str_append(source, v);
- }
-
- if (has_ascii_incompat) {
- result_enc = has_ascii_incompat;
+ rb_str_buf_append(source, v);
}
- else if (has_ascii_compat_fixed) {
- result_enc = has_ascii_compat_fixed;
- }
- else {
- result_enc = rb_ascii8bit_encoding();
+ args[0] = source;
+ args[1] = Qnil;
+ switch (kcode) {
+ case -1:
+ args[2] = Qnil;
+ break;
+ case KCODE_NONE:
+ args[2] = rb_str_new2("n");
+ break;
+ case KCODE_EUC:
+ args[2] = rb_str_new2("e");
+ break;
+ case KCODE_SJIS:
+ args[2] = rb_str_new2("s");
+ break;
+ case KCODE_UTF8:
+ args[2] = rb_str_new2("u");
+ break;
}
-
- rb_enc_associate(source, result_enc);
- return rb_class_new_instance(1, &source, rb_cRegexp);
+ return rb_class_new_instance(3, args, rb_cRegexp);
}
}
@@ -3109,12 +2054,12 @@ rb_reg_s_union(VALUE self, VALUE args0)
* call-seq:
* Regexp.union(pat1, pat2, ...) => new_regexp
* Regexp.union(pats_ary) => new_regexp
- *
+ *
* Return a <code>Regexp</code> object that is the union of the given
* <em>pattern</em>s, i.e., will match any of its parts. The <em>pattern</em>s
* can be Regexp objects, in which case their options will be preserved, or
* Strings. If no patterns are given, returns <code>/(?!)/</code>.
- *
+ *
* Regexp.union #=> /(?!)/
* Regexp.union("penzance") #=> /penzance/
* Regexp.union("a+b*c") #=> /a\+b\*c/
@@ -3135,12 +2080,9 @@ rb_reg_s_union_m(VALUE self, VALUE args)
/* :nodoc: */
static VALUE
-rb_reg_init_copy(VALUE copy, VALUE re)
+rb_reg_init_copy(copy, re)
+ VALUE copy, re;
{
- onig_errmsg_buffer err = "";
- const char *s;
- long len;
-
if (copy == re) return copy;
rb_check_frozen(copy);
/* need better argument type check */
@@ -3148,101 +2090,58 @@ rb_reg_init_copy(VALUE copy, VALUE re)
rb_raise(rb_eTypeError, "wrong argument type");
}
rb_reg_check(re);
- s = RREGEXP_SRC_PTR(re);
- len = RREGEXP_SRC_LEN(re);
- if (rb_reg_initialize(copy, s, len, rb_enc_get(re), rb_reg_options(re), err) != 0) {
- rb_reg_raise(s, len, err, re);
- }
+ rb_reg_initialize(copy, RREGEXP(re)->str, RREGEXP(re)->len,
+ rb_reg_options(re));
return copy;
}
VALUE
-rb_reg_regsub(VALUE str, VALUE src, struct re_registers *regs, VALUE regexp)
+rb_reg_regsub(str, src, regs)
+ VALUE str, src;
+ struct re_registers *regs;
{
VALUE val = 0;
- char *p, *s, *e;
- int no, clen;
- rb_encoding *str_enc = rb_enc_get(str);
- rb_encoding *src_enc = rb_enc_get(src);
- int acompat = rb_enc_asciicompat(str_enc);
-#define ASCGET(s,e,cl) (acompat ? (*cl=1,ISASCII(s[0])?s[0]:-1) : rb_enc_ascget(s, e, cl, str_enc))
+ char *p, *s, *e, c;
+ int no;
- p = s = RSTRING_PTR(str);
- e = s + RSTRING_LEN(str);
+ p = s = RSTRING(str)->ptr;
+ e = s + RSTRING(str)->len;
while (s < e) {
- int c = ASCGET(s, e, &clen);
- char *ss;
+ char *ss = s;
- if (c == -1) {
- s += mbclen(s, e, str_enc);
+ c = *s++;
+ if (ismbchar(c)) {
+ s += mbclen(c) - 1;
continue;
}
- ss = s;
- s += clen;
-
if (c != '\\' || s == e) continue;
if (!val) {
val = rb_str_buf_new(ss-p);
+ rb_str_buf_cat(val, p, ss-p);
+ }
+ else {
+ rb_str_buf_cat(val, p, ss-p);
}
- rb_enc_str_buf_cat(val, p, ss-p, str_enc);
-
- c = ASCGET(s, e, &clen);
- if (c == -1) {
- s += mbclen(s, e, str_enc);
- rb_enc_str_buf_cat(val, ss, s-ss, str_enc);
- p = s;
- continue;
- }
- s += clen;
+ c = *s++;
p = s;
switch (c) {
- case '1': case '2': case '3': case '4':
+ case '0': case '1': case '2': case '3': case '4':
case '5': case '6': case '7': case '8': case '9':
- if (onig_noname_group_capture_is_active(RREGEXP(regexp)->ptr)) {
- no = c - '0';
- }
- else {
- continue;
- }
+ no = c - '0';
break;
-
- case 'k':
- if (s < e && ASCGET(s, e, &clen) == '<') {
- char *name, *name_end;
-
- name_end = name = s + clen;
- while (name_end < e) {
- c = ASCGET(name_end, e, &clen);
- if (c == '>') break;
- name_end += c == -1 ? mbclen(name_end, e, str_enc) : clen;
- }
- if (name_end < e) {
- no = name_to_backref_number(regs, regexp, name, name_end);
- p = s = name_end + clen;
- break;
- }
- else {
- rb_raise(rb_eRuntimeError, "invalid group name reference format");
- }
- }
-
- rb_enc_str_buf_cat(val, ss, s-ss, str_enc);
- continue;
-
- case '0':
case '&':
no = 0;
break;
case '`':
- rb_enc_str_buf_cat(val, RSTRING_PTR(src), BEG(0), src_enc);
+ rb_str_buf_cat(val, RSTRING(src)->ptr, BEG(0));
continue;
case '\'':
- rb_enc_str_buf_cat(val, RSTRING_PTR(src)+END(0), RSTRING_LEN(src)-END(0), src_enc);
+ rb_str_buf_cat(val, RSTRING(src)->ptr+END(0), RSTRING(src)->len-END(0));
continue;
case '+':
@@ -3252,57 +2151,116 @@ rb_reg_regsub(VALUE str, VALUE src, struct re_registers *regs, VALUE regexp)
break;
case '\\':
- rb_enc_str_buf_cat(val, s-clen, clen, str_enc);
+ rb_str_buf_cat(val, s-1, 1);
continue;
default:
- rb_enc_str_buf_cat(val, ss, s-ss, str_enc);
+ rb_str_buf_cat(val, s-2, 2);
continue;
}
if (no >= 0) {
if (no >= regs->num_regs) continue;
if (BEG(no) == -1) continue;
- rb_enc_str_buf_cat(val, RSTRING_PTR(src)+BEG(no), END(no)-BEG(no), src_enc);
+ rb_str_buf_cat(val, RSTRING(src)->ptr+BEG(no), END(no)-BEG(no));
}
}
- if (!val) return str;
if (p < e) {
- rb_enc_str_buf_cat(val, p, e-p, str_enc);
+ if (!val) {
+ val = rb_str_buf_new(e-p);
+ rb_str_buf_cat(val, p, e-p);
+ }
+ else {
+ rb_str_buf_cat(val, p, e-p);
+ }
}
+ if (!val) return str;
return val;
}
+const char*
+rb_get_kcode()
+{
+ switch (reg_kcode) {
+ case KCODE_SJIS:
+ return "SJIS";
+ case KCODE_EUC:
+ return "EUC";
+ case KCODE_UTF8:
+ return "UTF8";
+ default:
+ return "NONE";
+ }
+}
+
static VALUE
-kcode_getter(void)
+kcode_getter()
{
- rb_warn("variable $KCODE is no longer effective");
- return Qnil;
+ return rb_str_new2(rb_get_kcode());
+}
+
+void
+rb_set_kcode(code)
+ const char *code;
+{
+ if (code == 0) goto set_no_conversion;
+
+ switch (code[0]) {
+ case 'E':
+ case 'e':
+ reg_kcode = KCODE_EUC;
+ re_mbcinit(MBCTYPE_EUC);
+ break;
+ case 'S':
+ case 's':
+ reg_kcode = KCODE_SJIS;
+ re_mbcinit(MBCTYPE_SJIS);
+ break;
+ case 'U':
+ case 'u':
+ reg_kcode = KCODE_UTF8;
+ re_mbcinit(MBCTYPE_UTF8);
+ break;
+ default:
+ case 'N':
+ case 'n':
+ case 'A':
+ case 'a':
+ set_no_conversion:
+ reg_kcode = KCODE_NONE;
+ re_mbcinit(MBCTYPE_ASCII);
+ break;
+ }
}
static void
-kcode_setter(VALUE val, ID id)
+kcode_setter(val)
+ VALUE val;
{
- rb_warn("variable $KCODE is no longer effective; ignored");
+ may_need_recompile = 1;
+ rb_set_kcode(StringValuePtr(val));
}
static VALUE
-ignorecase_getter(void)
+ignorecase_getter()
{
- rb_warn("variable $= is no longer effective");
- return Qfalse;
+ return ruby_ignorecase?Qtrue:Qfalse;
}
static void
-ignorecase_setter(VALUE val, ID id)
+ignorecase_setter(val, id)
+ VALUE val;
+ ID id;
{
- rb_warn("variable $= is no longer effective; ignored");
+ rb_warn("modifying %s is deprecated", rb_id2name(id));
+ may_need_recompile = 1;
+ ruby_ignorecase = RTEST(val);
}
static VALUE
-match_getter(void)
+match_getter()
{
VALUE match = rb_backref_get();
@@ -3312,7 +2270,8 @@ match_getter(void)
}
static void
-match_setter(VALUE val)
+match_setter(val)
+ VALUE val;
{
if (!NIL_P(val)) {
Check_Type(val, T_MATCH);
@@ -3323,46 +2282,33 @@ match_setter(VALUE val)
/*
* call-seq:
* Regexp.last_match => matchdata
- * Regexp.last_match(n) => str
- *
+ * Regexp.last_match(fixnum) => str
+ *
* The first form returns the <code>MatchData</code> object generated by the
* last successful pattern match. Equivalent to reading the global variable
- * <code>$~</code>. The second form returns the <i>n</i>th field in this
+ * <code>$~</code>. The second form returns the nth field in this
* <code>MatchData</code> object.
- * <em>n</em> can be a string or symbol to reference a named capture.
- *
- * /c(.)t/ =~ 'cat' #=> 0
- * Regexp.last_match #=> #<MatchData "cat" 1:"a">
- * Regexp.last_match(0) #=> "cat"
- * Regexp.last_match(1) #=> "a"
- * Regexp.last_match(2) #=> nil
- *
- * /(?<lhs>\w+)\s*=\s*(?<rhs>\w+)/ =~ "var = val"
- * Regexp.last_match #=> #<MatchData "var = val" lhs:"var" rhs:"val">
- * Regexp.last_match(:lhs) #=> "var"
- * Regexp.last_match(:rhs) #=> "val"
+ *
+ * /c(.)t/ =~ 'cat' #=> 0
+ * Regexp.last_match #=> #<MatchData:0x401b3d30>
+ * Regexp.last_match(0) #=> "cat"
+ * Regexp.last_match(1) #=> "a"
+ * Regexp.last_match(2) #=> nil
*/
static VALUE
-rb_reg_s_last_match(int argc, VALUE *argv)
+rb_reg_s_last_match(argc, argv)
+ int argc;
+ VALUE *argv;
{
VALUE nth;
- if (argc > 0 && rb_scan_args(argc, argv, "01", &nth) == 1) {
- VALUE match = rb_backref_get();
- int n;
- if (NIL_P(match)) return Qnil;
- n = match_backref_number(match, nth);
- return rb_reg_nth_match(n, match);
+ if (rb_scan_args(argc, argv, "01", &nth) == 1) {
+ return rb_reg_nth_match(NUM2INT(nth), rb_backref_get());
}
return match_getter();
}
-static void
-re_warn(const char *s)
-{
- rb_warn("%s", s);
-}
/*
* Document-class: Regexp
@@ -3375,14 +2321,24 @@ re_warn(const char *s)
*/
void
-Init_Regexp(void)
+Init_Regexp()
{
rb_eRegexpError = rb_define_class("RegexpError", rb_eStandardError);
- onigenc_set_default_caseconv_table((UChar*)casetable);
- onigenc_set_default_encoding(ONIG_ENCODING_ASCII);
- onig_set_warn_func(re_warn);
- onig_set_verb_warn_func(re_warn);
+ re_set_casetable(casetable);
+#if DEFAULT_KCODE == KCODE_EUC
+ re_mbcinit(MBCTYPE_EUC);
+#else
+#if DEFAULT_KCODE == KCODE_SJIS
+ re_mbcinit(MBCTYPE_SJIS);
+#else
+#if DEFAULT_KCODE == KCODE_UTF8
+ re_mbcinit(MBCTYPE_UTF8);
+#else
+ re_mbcinit(MBCTYPE_ASCII);
+#endif
+#endif
+#endif
rb_define_virtual_variable("$~", match_getter, match_setter);
rb_define_virtual_variable("$&", last_match_getter, 0);
@@ -3397,11 +2353,10 @@ Init_Regexp(void)
rb_cRegexp = rb_define_class("Regexp", rb_cObject);
rb_define_alloc_func(rb_cRegexp, rb_reg_s_alloc);
rb_define_singleton_method(rb_cRegexp, "compile", rb_class_new_instance, -1);
- rb_define_singleton_method(rb_cRegexp, "quote", rb_reg_s_quote, 1);
- rb_define_singleton_method(rb_cRegexp, "escape", rb_reg_s_quote, 1);
+ rb_define_singleton_method(rb_cRegexp, "quote", rb_reg_s_quote, -1);
+ rb_define_singleton_method(rb_cRegexp, "escape", rb_reg_s_quote, -1);
rb_define_singleton_method(rb_cRegexp, "union", rb_reg_s_union_m, -2);
rb_define_singleton_method(rb_cRegexp, "last_match", rb_reg_s_last_match, -1);
- rb_define_singleton_method(rb_cRegexp, "try_convert", rb_reg_s_try_convert, 1);
rb_define_method(rb_cRegexp, "initialize", rb_reg_initialize_m, -1);
rb_define_method(rb_cRegexp, "initialize_copy", rb_reg_init_copy, 1);
@@ -3411,31 +2366,26 @@ Init_Regexp(void)
rb_define_method(rb_cRegexp, "=~", rb_reg_match, 1);
rb_define_method(rb_cRegexp, "===", rb_reg_eqq, 1);
rb_define_method(rb_cRegexp, "~", rb_reg_match2, 0);
- rb_define_method(rb_cRegexp, "match", rb_reg_match_m, -1);
+ rb_define_method(rb_cRegexp, "match", rb_reg_match_m, 1);
rb_define_method(rb_cRegexp, "to_s", rb_reg_to_s, 0);
rb_define_method(rb_cRegexp, "inspect", rb_reg_inspect, 0);
rb_define_method(rb_cRegexp, "source", rb_reg_source, 0);
rb_define_method(rb_cRegexp, "casefold?", rb_reg_casefold_p, 0);
rb_define_method(rb_cRegexp, "options", rb_reg_options_m, 0);
- rb_define_method(rb_cRegexp, "encoding", rb_obj_encoding, 0); /* in encoding.c */
- rb_define_method(rb_cRegexp, "fixed_encoding?", rb_reg_fixed_encoding_p, 0);
- rb_define_method(rb_cRegexp, "names", rb_reg_names, 0);
- rb_define_method(rb_cRegexp, "named_captures", rb_reg_named_captures, 0);
+ rb_define_method(rb_cRegexp, "kcode", rb_reg_kcode_m, 0);
- rb_define_const(rb_cRegexp, "IGNORECASE", INT2FIX(ONIG_OPTION_IGNORECASE));
- rb_define_const(rb_cRegexp, "EXTENDED", INT2FIX(ONIG_OPTION_EXTEND));
- rb_define_const(rb_cRegexp, "MULTILINE", INT2FIX(ONIG_OPTION_MULTILINE));
- rb_define_const(rb_cRegexp, "FIXEDENCODING", INT2FIX(ARG_ENCODING_FIXED));
+ rb_define_const(rb_cRegexp, "IGNORECASE", INT2FIX(RE_OPTION_IGNORECASE));
+ rb_define_const(rb_cRegexp, "EXTENDED", INT2FIX(RE_OPTION_EXTENDED));
+ rb_define_const(rb_cRegexp, "MULTILINE", INT2FIX(RE_OPTION_MULTILINE));
rb_global_variable(&reg_cache);
rb_cMatch = rb_define_class("MatchData", rb_cObject);
+ rb_define_global_const("MatchingData", rb_cMatch);
rb_define_alloc_func(rb_cMatch, match_alloc);
rb_undef_method(CLASS_OF(rb_cMatch), "new");
rb_define_method(rb_cMatch, "initialize_copy", match_init_copy, 1);
- rb_define_method(rb_cMatch, "regexp", match_regexp, 0);
- rb_define_method(rb_cMatch, "names", match_names, 0);
rb_define_method(rb_cMatch, "size", match_size, 0);
rb_define_method(rb_cMatch, "length", match_size, 0);
rb_define_method(rb_cMatch, "offset", match_offset, 1);
@@ -3445,6 +2395,7 @@ Init_Regexp(void)
rb_define_method(rb_cMatch, "[]", match_aref, -1);
rb_define_method(rb_cMatch, "captures", match_captures, 0);
rb_define_method(rb_cMatch, "values_at", match_values_at, -1);
+ rb_define_method(rb_cMatch, "select", match_select, -1);
rb_define_method(rb_cMatch, "pre_match", rb_reg_match_pre, 0);
rb_define_method(rb_cMatch, "post_match", rb_reg_match_post, 0);
rb_define_method(rb_cMatch, "to_s", match_to_s, 0);
diff --git a/re.h b/re.h
new file mode 100644
index 0000000000..45b2753dd5
--- /dev/null
+++ b/re.h
@@ -0,0 +1,42 @@
+/**********************************************************************
+
+ re.h -
+
+ $Author$
+ $Date$
+ created at: Thu Sep 30 14:18:32 JST 1993
+
+ Copyright (C) 1993-2003 Yukihiro Matsumoto
+
+**********************************************************************/
+
+#ifndef RE_H
+#define RE_H
+
+#include <sys/types.h>
+#include <stdio.h>
+
+#include "regex.h"
+
+typedef struct re_pattern_buffer Regexp;
+
+struct RMatch {
+ struct RBasic basic;
+ VALUE str;
+ struct re_registers *regs;
+};
+
+#define RMATCH(obj) (R_CAST(RMatch)(obj))
+
+VALUE rb_reg_regcomp _((VALUE));
+long rb_reg_search _((VALUE, VALUE, long, long));
+VALUE rb_reg_regsub _((VALUE, VALUE, struct re_registers *));
+long rb_reg_adjust_startpos _((VALUE, VALUE, long, long));
+void rb_match_busy _((VALUE));
+VALUE rb_reg_quote _((VALUE));
+
+RUBY_EXTERN int ruby_ignorecase;
+
+int rb_reg_mbclen2 _((unsigned int, VALUE));
+#define mbclen2(c,re) rb_reg_mbclen2((c),(re))
+#endif
diff --git a/regcomp.c b/regcomp.c
deleted file mode 100644
index a7346d3d8e..0000000000
--- a/regcomp.c
+++ /dev/null
@@ -1,6325 +0,0 @@
-/**********************************************************************
- regcomp.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 "regparse.h"
-
-OnigCaseFoldType OnigDefaultCaseFoldFlag = ONIGENC_CASE_FOLD_MIN;
-
-extern OnigCaseFoldType
-onig_get_default_case_fold_flag(void)
-{
- return OnigDefaultCaseFoldFlag;
-}
-
-extern int
-onig_set_default_case_fold_flag(OnigCaseFoldType case_fold_flag)
-{
- OnigDefaultCaseFoldFlag = case_fold_flag;
- return 0;
-}
-
-
-#ifndef PLATFORM_UNALIGNED_WORD_ACCESS
-static unsigned char PadBuf[WORD_ALIGNMENT_SIZE];
-#endif
-
-static UChar*
-str_dup(UChar* s, UChar* end)
-{
- ptrdiff_t len = end - s;
-
- if (len > 0) {
- UChar* r = (UChar* )xmalloc(len + 1);
- CHECK_NULL_RETURN(r);
- xmemcpy(r, s, len);
- r[len] = (UChar )0;
- return r;
- }
- else return NULL;
-}
-
-static void
-swap_node(Node* a, Node* b)
-{
- Node c;
- c = *a; *a = *b; *b = c;
-
- if (NTYPE(a) == NT_STR) {
- StrNode* sn = NSTR(a);
- if (sn->capa == 0) {
- size_t len = sn->end - sn->s;
- sn->s = sn->buf;
- sn->end = sn->s + len;
- }
- }
-
- if (NTYPE(b) == NT_STR) {
- StrNode* sn = NSTR(b);
- if (sn->capa == 0) {
- size_t len = sn->end - sn->s;
- sn->s = sn->buf;
- sn->end = sn->s + len;
- }
- }
-}
-
-static OnigDistance
-distance_add(OnigDistance d1, OnigDistance d2)
-{
- if (d1 == ONIG_INFINITE_DISTANCE || d2 == ONIG_INFINITE_DISTANCE)
- return ONIG_INFINITE_DISTANCE;
- else {
- if (d1 <= ONIG_INFINITE_DISTANCE - d2) return d1 + d2;
- else return ONIG_INFINITE_DISTANCE;
- }
-}
-
-static OnigDistance
-distance_multiply(OnigDistance d, int m)
-{
- if (m == 0) return 0;
-
- if (d < ONIG_INFINITE_DISTANCE / m)
- return d * m;
- else
- return ONIG_INFINITE_DISTANCE;
-}
-
-static int
-bitset_is_empty(BitSetRef bs)
-{
- int i;
- for (i = 0; i < (int )BITSET_SIZE; i++) {
- if (bs[i] != 0) return 0;
- }
- return 1;
-}
-
-#ifdef ONIG_DEBUG
-static int
-bitset_on_num(BitSetRef bs)
-{
- int i, n;
-
- n = 0;
- for (i = 0; i < SINGLE_BYTE_SIZE; i++) {
- if (BITSET_AT(bs, i)) n++;
- }
- return n;
-}
-#endif
-
-extern int
-onig_bbuf_init(BBuf* buf, int size)
-{
- if (size <= 0) {
- size = 0;
- buf->p = NULL;
- }
- else {
- buf->p = (UChar* )xmalloc(size);
- if (IS_NULL(buf->p)) return(ONIGERR_MEMORY);
- }
-
- buf->alloc = size;
- buf->used = 0;
- return 0;
-}
-
-
-#ifdef USE_SUBEXP_CALL
-
-static int
-unset_addr_list_init(UnsetAddrList* uslist, int size)
-{
- UnsetAddr* p;
-
- p = (UnsetAddr* )xmalloc(sizeof(UnsetAddr)* size);
- CHECK_NULL_RETURN_MEMERR(p);
- uslist->num = 0;
- uslist->alloc = size;
- uslist->us = p;
- return 0;
-}
-
-static void
-unset_addr_list_end(UnsetAddrList* uslist)
-{
- if (IS_NOT_NULL(uslist->us))
- xfree(uslist->us);
-}
-
-static int
-unset_addr_list_add(UnsetAddrList* uslist, int offset, struct _Node* node)
-{
- UnsetAddr* p;
- int size;
-
- if (uslist->num >= uslist->alloc) {
- size = uslist->alloc * 2;
- p = (UnsetAddr* )xrealloc(uslist->us, sizeof(UnsetAddr) * size);
- CHECK_NULL_RETURN_MEMERR(p);
- uslist->alloc = size;
- uslist->us = p;
- }
-
- uslist->us[uslist->num].offset = offset;
- uslist->us[uslist->num].target = node;
- uslist->num++;
- return 0;
-}
-#endif /* USE_SUBEXP_CALL */
-
-
-static int
-add_opcode(regex_t* reg, int opcode)
-{
- BBUF_ADD1(reg, opcode);
- return 0;
-}
-
-#ifdef USE_COMBINATION_EXPLOSION_CHECK
-static int
-add_state_check_num(regex_t* reg, int num)
-{
- StateCheckNumType n = (StateCheckNumType )num;
-
- BBUF_ADD(reg, &n, SIZE_STATE_CHECK_NUM);
- return 0;
-}
-#endif
-
-static int
-add_rel_addr(regex_t* reg, int addr)
-{
- RelAddrType ra = (RelAddrType )addr;
-
- BBUF_ADD(reg, &ra, SIZE_RELADDR);
- return 0;
-}
-
-static int
-add_abs_addr(regex_t* reg, int addr)
-{
- AbsAddrType ra = (AbsAddrType )addr;
-
- BBUF_ADD(reg, &ra, SIZE_ABSADDR);
- return 0;
-}
-
-static int
-add_length(regex_t* reg, int len)
-{
- LengthType l = (LengthType )len;
-
- BBUF_ADD(reg, &l, SIZE_LENGTH);
- return 0;
-}
-
-static int
-add_mem_num(regex_t* reg, int num)
-{
- MemNumType n = (MemNumType )num;
-
- BBUF_ADD(reg, &n, SIZE_MEMNUM);
- return 0;
-}
-
-static int
-add_pointer(regex_t* reg, void* addr)
-{
- PointerType ptr = (PointerType )addr;
-
- BBUF_ADD(reg, &ptr, SIZE_POINTER);
- return 0;
-}
-
-static int
-add_option(regex_t* reg, OnigOptionType option)
-{
- BBUF_ADD(reg, &option, SIZE_OPTION);
- return 0;
-}
-
-static int
-add_opcode_rel_addr(regex_t* reg, int opcode, int addr)
-{
- int r;
-
- r = add_opcode(reg, opcode);
- if (r) return r;
- r = add_rel_addr(reg, addr);
- return r;
-}
-
-static int
-add_bytes(regex_t* reg, UChar* bytes, int len)
-{
- BBUF_ADD(reg, bytes, len);
- return 0;
-}
-
-static int
-add_bitset(regex_t* reg, BitSetRef bs)
-{
- BBUF_ADD(reg, bs, SIZE_BITSET);
- return 0;
-}
-
-static int
-add_opcode_option(regex_t* reg, int opcode, OnigOptionType option)
-{
- int r;
-
- r = add_opcode(reg, opcode);
- if (r) return r;
- r = add_option(reg, option);
- return r;
-}
-
-static int compile_length_tree(Node* node, regex_t* reg);
-static int compile_tree(Node* node, regex_t* reg);
-
-
-#define IS_NEED_STR_LEN_OP_EXACT(op) \
- ((op) == OP_EXACTN || (op) == OP_EXACTMB2N ||\
- (op) == OP_EXACTMB3N || (op) == OP_EXACTMBN || (op) == OP_EXACTN_IC)
-
-static int
-select_str_opcode(int mb_len, int str_len, int ignore_case)
-{
- int op;
-
- if (ignore_case) {
- switch (str_len) {
- case 1: op = OP_EXACT1_IC; break;
- default: op = OP_EXACTN_IC; break;
- }
- }
- else {
- switch (mb_len) {
- case 1:
- switch (str_len) {
- case 1: op = OP_EXACT1; break;
- case 2: op = OP_EXACT2; break;
- case 3: op = OP_EXACT3; break;
- case 4: op = OP_EXACT4; break;
- case 5: op = OP_EXACT5; break;
- default: op = OP_EXACTN; break;
- }
- break;
-
- case 2:
- switch (str_len) {
- case 1: op = OP_EXACTMB2N1; break;
- case 2: op = OP_EXACTMB2N2; break;
- case 3: op = OP_EXACTMB2N3; break;
- default: op = OP_EXACTMB2N; break;
- }
- break;
-
- case 3:
- op = OP_EXACTMB3N;
- break;
-
- default:
- op = OP_EXACTMBN;
- break;
- }
- }
- return op;
-}
-
-static int
-compile_tree_empty_check(Node* node, regex_t* reg, int empty_info)
-{
- int r;
- int saved_num_null_check = reg->num_null_check;
-
- if (empty_info != 0) {
- r = add_opcode(reg, OP_NULL_CHECK_START);
- if (r) return r;
- r = add_mem_num(reg, reg->num_null_check); /* NULL CHECK ID */
- if (r) return r;
- reg->num_null_check++;
- }
-
- r = compile_tree(node, reg);
- if (r) return r;
-
- if (empty_info != 0) {
- if (empty_info == NQ_TARGET_IS_EMPTY)
- r = add_opcode(reg, OP_NULL_CHECK_END);
- else if (empty_info == NQ_TARGET_IS_EMPTY_MEM)
- r = add_opcode(reg, OP_NULL_CHECK_END_MEMST);
- else if (empty_info == NQ_TARGET_IS_EMPTY_REC)
- r = add_opcode(reg, OP_NULL_CHECK_END_MEMST_PUSH);
-
- if (r) return r;
- r = add_mem_num(reg, saved_num_null_check); /* NULL CHECK ID */
- }
- return r;
-}
-
-#ifdef USE_SUBEXP_CALL
-static int
-compile_call(CallNode* node, regex_t* reg)
-{
- int r;
-
- r = add_opcode(reg, OP_CALL);
- if (r) return r;
- r = unset_addr_list_add(node->unset_addr_list, BBUF_GET_OFFSET_POS(reg),
- node->target);
- if (r) return r;
- r = add_abs_addr(reg, 0 /*dummy addr.*/);
- return r;
-}
-#endif
-
-static int
-compile_tree_n_times(Node* node, int n, regex_t* reg)
-{
- int i, r;
-
- for (i = 0; i < n; i++) {
- r = compile_tree(node, reg);
- if (r) return r;
- }
- return 0;
-}
-
-static int
-add_compile_string_length(UChar* s ARG_UNUSED, int mb_len, OnigDistance str_len,
- regex_t* reg ARG_UNUSED, int ignore_case)
-{
- int len;
- int op = select_str_opcode(mb_len, str_len, ignore_case);
-
- len = SIZE_OPCODE;
-
- if (op == OP_EXACTMBN) len += SIZE_LENGTH;
- if (IS_NEED_STR_LEN_OP_EXACT(op))
- len += SIZE_LENGTH;
-
- len += mb_len * str_len;
- return len;
-}
-
-static int
-add_compile_string(UChar* s, int mb_len, int str_len,
- regex_t* reg, int ignore_case)
-{
- int op = select_str_opcode(mb_len, str_len, ignore_case);
- add_opcode(reg, op);
-
- if (op == OP_EXACTMBN)
- add_length(reg, mb_len);
-
- if (IS_NEED_STR_LEN_OP_EXACT(op)) {
- if (op == OP_EXACTN_IC)
- add_length(reg, mb_len * str_len);
- else
- add_length(reg, str_len);
- }
-
- add_bytes(reg, s, mb_len * str_len);
- return 0;
-}
-
-
-static int
-compile_length_string_node(Node* node, regex_t* reg)
-{
- int rlen, r, len, prev_len, slen, ambig;
- OnigEncoding enc = reg->enc;
- UChar *p, *prev;
- StrNode* sn;
-
- sn = NSTR(node);
- if (sn->end <= sn->s)
- return 0;
-
- ambig = NSTRING_IS_AMBIG(node);
-
- p = prev = sn->s;
- prev_len = enclen(enc, p, sn->end);
- p += prev_len;
- slen = 1;
- rlen = 0;
-
- for (; p < sn->end; ) {
- len = enclen(enc, p, sn->end);
- if (len == prev_len) {
- slen++;
- }
- else {
- r = add_compile_string_length(prev, prev_len, slen, reg, ambig);
- rlen += r;
- prev = p;
- slen = 1;
- prev_len = len;
- }
- p += len;
- }
- r = add_compile_string_length(prev, prev_len, slen, reg, ambig);
- rlen += r;
- return rlen;
-}
-
-static int
-compile_length_string_raw_node(StrNode* sn, regex_t* reg)
-{
- if (sn->end <= sn->s)
- return 0;
-
- return add_compile_string_length(sn->s, 1 /* sb */, sn->end - sn->s, reg, 0);
-}
-
-static int
-compile_string_node(Node* node, regex_t* reg)
-{
- int r, len, prev_len, slen, ambig;
- OnigEncoding enc = reg->enc;
- UChar *p, *prev, *end;
- StrNode* sn;
-
- sn = NSTR(node);
- if (sn->end <= sn->s)
- return 0;
-
- end = sn->end;
- ambig = NSTRING_IS_AMBIG(node);
-
- p = prev = sn->s;
- prev_len = enclen(enc, p, end);
- p += prev_len;
- slen = 1;
-
- for (; p < end; ) {
- len = enclen(enc, p, end);
- if (len == prev_len) {
- slen++;
- }
- else {
- r = add_compile_string(prev, prev_len, slen, reg, ambig);
- if (r) return r;
-
- prev = p;
- slen = 1;
- prev_len = len;
- }
-
- p += len;
- }
- return add_compile_string(prev, prev_len, slen, reg, ambig);
-}
-
-static int
-compile_string_raw_node(StrNode* sn, regex_t* reg)
-{
- if (sn->end <= sn->s)
- return 0;
-
- return add_compile_string(sn->s, 1 /* sb */, sn->end - sn->s, reg, 0);
-}
-
-static int
-add_multi_byte_cclass(BBuf* mbuf, regex_t* reg)
-{
-#ifdef PLATFORM_UNALIGNED_WORD_ACCESS
- add_length(reg, mbuf->used);
- return add_bytes(reg, mbuf->p, mbuf->used);
-#else
- int r, pad_size;
- UChar* p = BBUF_GET_ADD_ADDRESS(reg) + SIZE_LENGTH;
-
- GET_ALIGNMENT_PAD_SIZE(p, pad_size);
- add_length(reg, mbuf->used + (WORD_ALIGNMENT_SIZE - 1));
- if (pad_size != 0) add_bytes(reg, PadBuf, pad_size);
-
- r = add_bytes(reg, mbuf->p, mbuf->used);
-
- /* padding for return value from compile_length_cclass_node() to be fix. */
- pad_size = (WORD_ALIGNMENT_SIZE - 1) - pad_size;
- if (pad_size != 0) add_bytes(reg, PadBuf, pad_size);
- return r;
-#endif
-}
-
-static int
-compile_length_cclass_node(CClassNode* cc, regex_t* reg)
-{
- int len;
-
- if (IS_NCCLASS_SHARE(cc)) {
- len = SIZE_OPCODE + SIZE_POINTER;
- return len;
- }
-
- if (IS_NULL(cc->mbuf)) {
- len = SIZE_OPCODE + SIZE_BITSET;
- }
- else {
- if (ONIGENC_MBC_MINLEN(reg->enc) > 1 || bitset_is_empty(cc->bs)) {
- len = SIZE_OPCODE;
- }
- else {
- len = SIZE_OPCODE + SIZE_BITSET;
- }
-#ifdef PLATFORM_UNALIGNED_WORD_ACCESS
- len += SIZE_LENGTH + cc->mbuf->used;
-#else
- len += SIZE_LENGTH + cc->mbuf->used + (WORD_ALIGNMENT_SIZE - 1);
-#endif
- }
-
- return len;
-}
-
-static int
-compile_cclass_node(CClassNode* cc, regex_t* reg)
-{
- int r;
-
- if (IS_NCCLASS_SHARE(cc)) {
- add_opcode(reg, OP_CCLASS_NODE);
- r = add_pointer(reg, cc);
- return r;
- }
-
- if (IS_NULL(cc->mbuf)) {
- if (IS_NCCLASS_NOT(cc))
- add_opcode(reg, OP_CCLASS_NOT);
- else
- add_opcode(reg, OP_CCLASS);
-
- r = add_bitset(reg, cc->bs);
- }
- else {
- if (ONIGENC_MBC_MINLEN(reg->enc) > 1 || bitset_is_empty(cc->bs)) {
- if (IS_NCCLASS_NOT(cc))
- add_opcode(reg, OP_CCLASS_MB_NOT);
- else
- add_opcode(reg, OP_CCLASS_MB);
-
- r = add_multi_byte_cclass(cc->mbuf, reg);
- }
- else {
- if (IS_NCCLASS_NOT(cc))
- add_opcode(reg, OP_CCLASS_MIX_NOT);
- else
- add_opcode(reg, OP_CCLASS_MIX);
-
- r = add_bitset(reg, cc->bs);
- if (r) return r;
- r = add_multi_byte_cclass(cc->mbuf, reg);
- }
- }
-
- return r;
-}
-
-static int
-entry_repeat_range(regex_t* reg, int id, int lower, int upper)
-{
-#define REPEAT_RANGE_ALLOC 4
-
- OnigRepeatRange* p;
-
- if (reg->repeat_range_alloc == 0) {
- p = (OnigRepeatRange* )xmalloc(sizeof(OnigRepeatRange) * REPEAT_RANGE_ALLOC);
- CHECK_NULL_RETURN_MEMERR(p);
- reg->repeat_range = p;
- reg->repeat_range_alloc = REPEAT_RANGE_ALLOC;
- }
- else if (reg->repeat_range_alloc <= id) {
- int n;
- n = reg->repeat_range_alloc + REPEAT_RANGE_ALLOC;
- p = (OnigRepeatRange* )xrealloc(reg->repeat_range,
- sizeof(OnigRepeatRange) * n);
- CHECK_NULL_RETURN_MEMERR(p);
- reg->repeat_range = p;
- reg->repeat_range_alloc = n;
- }
- else {
- p = reg->repeat_range;
- }
-
- p[id].lower = lower;
- p[id].upper = (IS_REPEAT_INFINITE(upper) ? 0x7fffffff : upper);
- return 0;
-}
-
-static int
-compile_range_repeat_node(QtfrNode* qn, int target_len, int empty_info,
- regex_t* reg)
-{
- int r;
- int num_repeat = reg->num_repeat;
-
- r = add_opcode(reg, qn->greedy ? OP_REPEAT : OP_REPEAT_NG);
- if (r) return r;
- r = add_mem_num(reg, num_repeat); /* OP_REPEAT ID */
- reg->num_repeat++;
- if (r) return r;
- r = add_rel_addr(reg, target_len + SIZE_OP_REPEAT_INC);
- if (r) return r;
-
- r = entry_repeat_range(reg, num_repeat, qn->lower, qn->upper);
- if (r) return r;
-
- r = compile_tree_empty_check(qn->target, reg, empty_info);
- if (r) return r;
-
- if (
-#ifdef USE_SUBEXP_CALL
- reg->num_call > 0 ||
-#endif
- IS_QUANTIFIER_IN_REPEAT(qn)) {
- r = add_opcode(reg, qn->greedy ? OP_REPEAT_INC_SG : OP_REPEAT_INC_NG_SG);
- }
- else {
- r = add_opcode(reg, qn->greedy ? OP_REPEAT_INC : OP_REPEAT_INC_NG);
- }
- if (r) return r;
- r = add_mem_num(reg, num_repeat); /* OP_REPEAT ID */
- return r;
-}
-
-static int
-is_anychar_star_quantifier(QtfrNode* qn)
-{
- if (qn->greedy && IS_REPEAT_INFINITE(qn->upper) &&
- NTYPE(qn->target) == NT_CANY)
- return 1;
- else
- return 0;
-}
-
-#define QUANTIFIER_EXPAND_LIMIT_SIZE 50
-#define CKN_ON (ckn > 0)
-
-#ifdef USE_COMBINATION_EXPLOSION_CHECK
-
-static int
-compile_length_quantifier_node(QtfrNode* qn, regex_t* reg)
-{
- int len, mod_tlen, cklen;
- int ckn;
- int infinite = IS_REPEAT_INFINITE(qn->upper);
- int empty_info = qn->target_empty_info;
- int tlen = compile_length_tree(qn->target, reg);
-
- if (tlen < 0) return tlen;
-
- ckn = ((reg->num_comb_exp_check > 0) ? qn->comb_exp_check_num : 0);
-
- cklen = (CKN_ON ? SIZE_STATE_CHECK_NUM: 0);
-
- /* anychar repeat */
- if (NTYPE(qn->target) == NT_CANY) {
- if (qn->greedy && infinite) {
- if (IS_NOT_NULL(qn->next_head_exact) && !CKN_ON)
- return SIZE_OP_ANYCHAR_STAR_PEEK_NEXT + tlen * qn->lower + cklen;
- else
- return SIZE_OP_ANYCHAR_STAR + tlen * qn->lower + cklen;
- }
- }
-
- if (empty_info != 0)
- mod_tlen = tlen + (SIZE_OP_NULL_CHECK_START + SIZE_OP_NULL_CHECK_END);
- else
- mod_tlen = tlen;
-
- if (infinite && qn->lower <= 1) {
- if (qn->greedy) {
- if (qn->lower == 1)
- len = SIZE_OP_JUMP;
- else
- len = 0;
-
- len += SIZE_OP_PUSH + cklen + mod_tlen + SIZE_OP_JUMP;
- }
- else {
- if (qn->lower == 0)
- len = SIZE_OP_JUMP;
- else
- len = 0;
-
- len += mod_tlen + SIZE_OP_PUSH + cklen;
- }
- }
- else if (qn->upper == 0) {
- if (qn->is_refered != 0) /* /(?<n>..){0}/ */
- len = SIZE_OP_JUMP + tlen;
- else
- len = 0;
- }
- else if (qn->upper == 1 && qn->greedy) {
- if (qn->lower == 0) {
- if (CKN_ON) {
- len = SIZE_OP_STATE_CHECK_PUSH + tlen;
- }
- else {
- len = SIZE_OP_PUSH + tlen;
- }
- }
- else {
- len = tlen;
- }
- }
- else if (!qn->greedy && qn->upper == 1 && qn->lower == 0) { /* '??' */
- len = SIZE_OP_PUSH + cklen + SIZE_OP_JUMP + tlen;
- }
- else {
- len = SIZE_OP_REPEAT_INC
- + mod_tlen + SIZE_OPCODE + SIZE_RELADDR + SIZE_MEMNUM;
- if (CKN_ON)
- len += SIZE_OP_STATE_CHECK;
- }
-
- return len;
-}
-
-static int
-compile_quantifier_node(QtfrNode* qn, regex_t* reg)
-{
- int r, mod_tlen;
- int ckn;
- int infinite = IS_REPEAT_INFINITE(qn->upper);
- int empty_info = qn->target_empty_info;
- int tlen = compile_length_tree(qn->target, reg);
-
- if (tlen < 0) return tlen;
-
- ckn = ((reg->num_comb_exp_check > 0) ? qn->comb_exp_check_num : 0);
-
- if (is_anychar_star_quantifier(qn)) {
- r = compile_tree_n_times(qn->target, qn->lower, reg);
- if (r) return r;
- if (IS_NOT_NULL(qn->next_head_exact) && !CKN_ON) {
- if (IS_MULTILINE(reg->options))
- r = add_opcode(reg, OP_ANYCHAR_ML_STAR_PEEK_NEXT);
- else
- r = add_opcode(reg, OP_ANYCHAR_STAR_PEEK_NEXT);
- if (r) return r;
- if (CKN_ON) {
- r = add_state_check_num(reg, ckn);
- if (r) return r;
- }
-
- return add_bytes(reg, NSTR(qn->next_head_exact)->s, 1);
- }
- else {
- if (IS_MULTILINE(reg->options)) {
- r = add_opcode(reg, (CKN_ON ?
- OP_STATE_CHECK_ANYCHAR_ML_STAR
- : OP_ANYCHAR_ML_STAR));
- }
- else {
- r = add_opcode(reg, (CKN_ON ?
- OP_STATE_CHECK_ANYCHAR_STAR
- : OP_ANYCHAR_STAR));
- }
- if (r) return r;
- if (CKN_ON)
- r = add_state_check_num(reg, ckn);
-
- return r;
- }
- }
-
- if (empty_info != 0)
- mod_tlen = tlen + (SIZE_OP_NULL_CHECK_START + SIZE_OP_NULL_CHECK_END);
- else
- mod_tlen = tlen;
-
- if (infinite && qn->lower <= 1) {
- if (qn->greedy) {
- if (qn->lower == 1) {
- r = add_opcode_rel_addr(reg, OP_JUMP,
- (CKN_ON ? SIZE_OP_STATE_CHECK_PUSH : SIZE_OP_PUSH));
- if (r) return r;
- }
-
- if (CKN_ON) {
- r = add_opcode(reg, OP_STATE_CHECK_PUSH);
- if (r) return r;
- r = add_state_check_num(reg, ckn);
- if (r) return r;
- r = add_rel_addr(reg, mod_tlen + SIZE_OP_JUMP);
- }
- else {
- r = add_opcode_rel_addr(reg, OP_PUSH, mod_tlen + SIZE_OP_JUMP);
- }
- if (r) return r;
- r = compile_tree_empty_check(qn->target, reg, empty_info);
- if (r) return r;
- r = add_opcode_rel_addr(reg, OP_JUMP,
- -(mod_tlen + (int )SIZE_OP_JUMP
- + (int )(CKN_ON ? SIZE_OP_STATE_CHECK_PUSH : SIZE_OP_PUSH)));
- }
- else {
- if (qn->lower == 0) {
- r = add_opcode_rel_addr(reg, OP_JUMP, mod_tlen);
- if (r) return r;
- }
- r = compile_tree_empty_check(qn->target, reg, empty_info);
- if (r) return r;
- if (CKN_ON) {
- r = add_opcode(reg, OP_STATE_CHECK_PUSH_OR_JUMP);
- if (r) return r;
- r = add_state_check_num(reg, ckn);
- if (r) return r;
- r = add_rel_addr(reg,
- -(mod_tlen + (int )SIZE_OP_STATE_CHECK_PUSH_OR_JUMP));
- }
- else
- r = add_opcode_rel_addr(reg, OP_PUSH, -(mod_tlen + (int )SIZE_OP_PUSH));
- }
- }
- else if (qn->upper == 0) {
- if (qn->is_refered != 0) { /* /(?<n>..){0}/ */
- r = add_opcode_rel_addr(reg, OP_JUMP, tlen);
- if (r) return r;
- r = compile_tree(qn->target, reg);
- }
- else
- r = 0;
- }
- else if (qn->upper == 1 && qn->greedy) {
- if (qn->lower == 0) {
- if (CKN_ON) {
- r = add_opcode(reg, OP_STATE_CHECK_PUSH);
- if (r) return r;
- r = add_state_check_num(reg, ckn);
- if (r) return r;
- r = add_rel_addr(reg, tlen);
- }
- else {
- r = add_opcode_rel_addr(reg, OP_PUSH, tlen);
- }
- if (r) return r;
- }
-
- r = compile_tree(qn->target, reg);
- }
- else if (!qn->greedy && qn->upper == 1 && qn->lower == 0) { /* '??' */
- if (CKN_ON) {
- r = add_opcode(reg, OP_STATE_CHECK_PUSH);
- if (r) return r;
- r = add_state_check_num(reg, ckn);
- if (r) return r;
- r = add_rel_addr(reg, SIZE_OP_JUMP);
- }
- else {
- r = add_opcode_rel_addr(reg, OP_PUSH, SIZE_OP_JUMP);
- }
-
- if (r) return r;
- r = add_opcode_rel_addr(reg, OP_JUMP, tlen);
- if (r) return r;
- r = compile_tree(qn->target, reg);
- }
- else {
- r = compile_range_repeat_node(qn, mod_tlen, empty_info, reg);
- if (CKN_ON) {
- if (r) return r;
- r = add_opcode(reg, OP_STATE_CHECK);
- if (r) return r;
- r = add_state_check_num(reg, ckn);
- }
- }
- return r;
-}
-
-#else /* USE_COMBINATION_EXPLOSION_CHECK */
-
-static int
-compile_length_quantifier_node(QtfrNode* qn, regex_t* reg)
-{
- int len, mod_tlen;
- int infinite = IS_REPEAT_INFINITE(qn->upper);
- int empty_info = qn->target_empty_info;
- int tlen = compile_length_tree(qn->target, reg);
-
- if (tlen < 0) return tlen;
-
- /* anychar repeat */
- if (NTYPE(qn->target) == NT_CANY) {
- if (qn->greedy && infinite) {
- if (IS_NOT_NULL(qn->next_head_exact))
- return SIZE_OP_ANYCHAR_STAR_PEEK_NEXT + tlen * qn->lower;
- else
- return SIZE_OP_ANYCHAR_STAR + tlen * qn->lower;
- }
- }
-
- if (empty_info != 0)
- mod_tlen = tlen + (SIZE_OP_NULL_CHECK_START + SIZE_OP_NULL_CHECK_END);
- else
- mod_tlen = tlen;
-
- if (infinite &&
- (qn->lower <= 1 || tlen * qn->lower <= QUANTIFIER_EXPAND_LIMIT_SIZE)) {
- if (qn->lower == 1 && tlen > QUANTIFIER_EXPAND_LIMIT_SIZE) {
- len = SIZE_OP_JUMP;
- }
- else {
- len = tlen * qn->lower;
- }
-
- if (qn->greedy) {
- if (IS_NOT_NULL(qn->head_exact))
- len += SIZE_OP_PUSH_OR_JUMP_EXACT1 + mod_tlen + SIZE_OP_JUMP;
- else if (IS_NOT_NULL(qn->next_head_exact))
- len += SIZE_OP_PUSH_IF_PEEK_NEXT + mod_tlen + SIZE_OP_JUMP;
- else
- len += SIZE_OP_PUSH + mod_tlen + SIZE_OP_JUMP;
- }
- else
- len += SIZE_OP_JUMP + mod_tlen + SIZE_OP_PUSH;
- }
- else if (qn->upper == 0 && qn->is_refered != 0) { /* /(?<n>..){0}/ */
- len = SIZE_OP_JUMP + tlen;
- }
- else if (!infinite && qn->greedy &&
- (qn->upper == 1 || (tlen + SIZE_OP_PUSH) * qn->upper
- <= QUANTIFIER_EXPAND_LIMIT_SIZE)) {
- len = tlen * qn->lower;
- len += (SIZE_OP_PUSH + tlen) * (qn->upper - qn->lower);
- }
- else if (!qn->greedy && qn->upper == 1 && qn->lower == 0) { /* '??' */
- len = SIZE_OP_PUSH + SIZE_OP_JUMP + tlen;
- }
- else {
- len = SIZE_OP_REPEAT_INC
- + mod_tlen + SIZE_OPCODE + SIZE_RELADDR + SIZE_MEMNUM;
- }
-
- return len;
-}
-
-static int
-compile_quantifier_node(QtfrNode* qn, regex_t* reg)
-{
- int i, r, mod_tlen;
- int infinite = IS_REPEAT_INFINITE(qn->upper);
- int empty_info = qn->target_empty_info;
- int tlen = compile_length_tree(qn->target, reg);
-
- if (tlen < 0) return tlen;
-
- if (is_anychar_star_quantifier(qn)) {
- r = compile_tree_n_times(qn->target, qn->lower, reg);
- if (r) return r;
- if (IS_NOT_NULL(qn->next_head_exact)) {
- if (IS_MULTILINE(reg->options))
- r = add_opcode(reg, OP_ANYCHAR_ML_STAR_PEEK_NEXT);
- else
- r = add_opcode(reg, OP_ANYCHAR_STAR_PEEK_NEXT);
- if (r) return r;
- return add_bytes(reg, NSTR(qn->next_head_exact)->s, 1);
- }
- else {
- if (IS_MULTILINE(reg->options))
- return add_opcode(reg, OP_ANYCHAR_ML_STAR);
- else
- return add_opcode(reg, OP_ANYCHAR_STAR);
- }
- }
-
- if (empty_info != 0)
- mod_tlen = tlen + (SIZE_OP_NULL_CHECK_START + SIZE_OP_NULL_CHECK_END);
- else
- mod_tlen = tlen;
-
- if (infinite &&
- (qn->lower <= 1 || tlen * qn->lower <= QUANTIFIER_EXPAND_LIMIT_SIZE)) {
- if (qn->lower == 1 && tlen > QUANTIFIER_EXPAND_LIMIT_SIZE) {
- if (qn->greedy) {
- if (IS_NOT_NULL(qn->head_exact))
- r = add_opcode_rel_addr(reg, OP_JUMP, SIZE_OP_PUSH_OR_JUMP_EXACT1);
- else if (IS_NOT_NULL(qn->next_head_exact))
- r = add_opcode_rel_addr(reg, OP_JUMP, SIZE_OP_PUSH_IF_PEEK_NEXT);
- else
- r = add_opcode_rel_addr(reg, OP_JUMP, SIZE_OP_PUSH);
- }
- else {
- r = add_opcode_rel_addr(reg, OP_JUMP, SIZE_OP_JUMP);
- }
- if (r) return r;
- }
- else {
- r = compile_tree_n_times(qn->target, qn->lower, reg);
- if (r) return r;
- }
-
- if (qn->greedy) {
- if (IS_NOT_NULL(qn->head_exact)) {
- r = add_opcode_rel_addr(reg, OP_PUSH_OR_JUMP_EXACT1,
- mod_tlen + SIZE_OP_JUMP);
- if (r) return r;
- add_bytes(reg, NSTR(qn->head_exact)->s, 1);
- r = compile_tree_empty_check(qn->target, reg, empty_info);
- if (r) return r;
- r = add_opcode_rel_addr(reg, OP_JUMP,
- -(mod_tlen + (int )SIZE_OP_JUMP + (int )SIZE_OP_PUSH_OR_JUMP_EXACT1));
- }
- else if (IS_NOT_NULL(qn->next_head_exact)) {
- r = add_opcode_rel_addr(reg, OP_PUSH_IF_PEEK_NEXT,
- mod_tlen + SIZE_OP_JUMP);
- if (r) return r;
- add_bytes(reg, NSTR(qn->next_head_exact)->s, 1);
- r = compile_tree_empty_check(qn->target, reg, empty_info);
- if (r) return r;
- r = add_opcode_rel_addr(reg, OP_JUMP,
- -(mod_tlen + (int )SIZE_OP_JUMP + (int )SIZE_OP_PUSH_IF_PEEK_NEXT));
- }
- else {
- r = add_opcode_rel_addr(reg, OP_PUSH, mod_tlen + SIZE_OP_JUMP);
- if (r) return r;
- r = compile_tree_empty_check(qn->target, reg, empty_info);
- if (r) return r;
- r = add_opcode_rel_addr(reg, OP_JUMP,
- -(mod_tlen + (int )SIZE_OP_JUMP + (int )SIZE_OP_PUSH));
- }
- }
- else {
- r = add_opcode_rel_addr(reg, OP_JUMP, mod_tlen);
- if (r) return r;
- r = compile_tree_empty_check(qn->target, reg, empty_info);
- if (r) return r;
- r = add_opcode_rel_addr(reg, OP_PUSH, -(mod_tlen + (int )SIZE_OP_PUSH));
- }
- }
- else if (qn->upper == 0 && qn->is_refered != 0) { /* /(?<n>..){0}/ */
- r = add_opcode_rel_addr(reg, OP_JUMP, tlen);
- if (r) return r;
- r = compile_tree(qn->target, reg);
- }
- else if (!infinite && qn->greedy &&
- (qn->upper == 1 || (tlen + SIZE_OP_PUSH) * qn->upper
- <= QUANTIFIER_EXPAND_LIMIT_SIZE)) {
- int n = qn->upper - qn->lower;
-
- r = compile_tree_n_times(qn->target, qn->lower, reg);
- if (r) return r;
-
- for (i = 0; i < n; i++) {
- r = add_opcode_rel_addr(reg, OP_PUSH,
- (n - i) * tlen + (n - i - 1) * SIZE_OP_PUSH);
- if (r) return r;
- r = compile_tree(qn->target, reg);
- if (r) return r;
- }
- }
- else if (!qn->greedy && qn->upper == 1 && qn->lower == 0) { /* '??' */
- r = add_opcode_rel_addr(reg, OP_PUSH, SIZE_OP_JUMP);
- if (r) return r;
- r = add_opcode_rel_addr(reg, OP_JUMP, tlen);
- if (r) return r;
- r = compile_tree(qn->target, reg);
- }
- else {
- r = compile_range_repeat_node(qn, mod_tlen, empty_info, reg);
- }
- return r;
-}
-#endif /* USE_COMBINATION_EXPLOSION_CHECK */
-
-static int
-compile_length_option_node(EncloseNode* node, regex_t* reg)
-{
- int tlen;
- OnigOptionType prev = reg->options;
-
- reg->options = node->option;
- tlen = compile_length_tree(node->target, reg);
- reg->options = prev;
-
- if (tlen < 0) return tlen;
-
- if (IS_DYNAMIC_OPTION(prev ^ node->option)) {
- return SIZE_OP_SET_OPTION_PUSH + SIZE_OP_SET_OPTION + SIZE_OP_FAIL
- + tlen + SIZE_OP_SET_OPTION;
- }
- else
- return tlen;
-}
-
-static int
-compile_option_node(EncloseNode* node, regex_t* reg)
-{
- int r;
- OnigOptionType prev = reg->options;
-
- if (IS_DYNAMIC_OPTION(prev ^ node->option)) {
- r = add_opcode_option(reg, OP_SET_OPTION_PUSH, node->option);
- if (r) return r;
- r = add_opcode_option(reg, OP_SET_OPTION, prev);
- if (r) return r;
- r = add_opcode(reg, OP_FAIL);
- if (r) return r;
- }
-
- reg->options = node->option;
- r = compile_tree(node->target, reg);
- reg->options = prev;
-
- if (IS_DYNAMIC_OPTION(prev ^ node->option)) {
- if (r) return r;
- r = add_opcode_option(reg, OP_SET_OPTION, prev);
- }
- return r;
-}
-
-static int
-compile_length_enclose_node(EncloseNode* node, regex_t* reg)
-{
- int len;
- int tlen;
-
- if (node->type == ENCLOSE_OPTION)
- return compile_length_option_node(node, reg);
-
- if (node->target) {
- tlen = compile_length_tree(node->target, reg);
- if (tlen < 0) return tlen;
- }
- else
- tlen = 0;
-
- switch (node->type) {
- case ENCLOSE_MEMORY:
-#ifdef USE_SUBEXP_CALL
- if (IS_ENCLOSE_CALLED(node)) {
- len = SIZE_OP_MEMORY_START_PUSH + tlen
- + SIZE_OP_CALL + SIZE_OP_JUMP + SIZE_OP_RETURN;
- if (BIT_STATUS_AT(reg->bt_mem_end, node->regnum))
- len += (IS_ENCLOSE_RECURSION(node)
- ? SIZE_OP_MEMORY_END_PUSH_REC : SIZE_OP_MEMORY_END_PUSH);
- else
- len += (IS_ENCLOSE_RECURSION(node)
- ? SIZE_OP_MEMORY_END_REC : SIZE_OP_MEMORY_END);
- }
- else
-#endif
- {
- if (BIT_STATUS_AT(reg->bt_mem_start, node->regnum))
- len = SIZE_OP_MEMORY_START_PUSH;
- else
- len = SIZE_OP_MEMORY_START;
-
- len += tlen + (BIT_STATUS_AT(reg->bt_mem_end, node->regnum)
- ? SIZE_OP_MEMORY_END_PUSH : SIZE_OP_MEMORY_END);
- }
- break;
-
- case ENCLOSE_STOP_BACKTRACK:
- if (IS_ENCLOSE_STOP_BT_SIMPLE_REPEAT(node)) {
- QtfrNode* qn = NQTFR(node->target);
- tlen = compile_length_tree(qn->target, reg);
- if (tlen < 0) return tlen;
-
- len = tlen * qn->lower
- + SIZE_OP_PUSH + tlen + SIZE_OP_POP + SIZE_OP_JUMP;
- }
- else {
- len = SIZE_OP_PUSH_STOP_BT + tlen + SIZE_OP_POP_STOP_BT;
- }
- break;
-
- default:
- return ONIGERR_TYPE_BUG;
- break;
- }
-
- return len;
-}
-
-static int get_char_length_tree(Node* node, regex_t* reg, int* len);
-
-static int
-compile_enclose_node(EncloseNode* node, regex_t* reg)
-{
- int r, len;
-
- if (node->type == ENCLOSE_OPTION)
- return compile_option_node(node, reg);
-
- switch (node->type) {
- case ENCLOSE_MEMORY:
-#ifdef USE_SUBEXP_CALL
- if (IS_ENCLOSE_CALLED(node)) {
- r = add_opcode(reg, OP_CALL);
- if (r) return r;
- node->call_addr = BBUF_GET_OFFSET_POS(reg) + SIZE_ABSADDR + SIZE_OP_JUMP;
- node->state |= NST_ADDR_FIXED;
- r = add_abs_addr(reg, (int )node->call_addr);
- if (r) return r;
- len = compile_length_tree(node->target, reg);
- len += (SIZE_OP_MEMORY_START_PUSH + SIZE_OP_RETURN);
- if (BIT_STATUS_AT(reg->bt_mem_end, node->regnum))
- len += (IS_ENCLOSE_RECURSION(node)
- ? SIZE_OP_MEMORY_END_PUSH_REC : SIZE_OP_MEMORY_END_PUSH);
- else
- len += (IS_ENCLOSE_RECURSION(node)
- ? SIZE_OP_MEMORY_END_REC : SIZE_OP_MEMORY_END);
-
- r = add_opcode_rel_addr(reg, OP_JUMP, len);
- if (r) return r;
- }
-#endif
- if (BIT_STATUS_AT(reg->bt_mem_start, node->regnum))
- r = add_opcode(reg, OP_MEMORY_START_PUSH);
- else
- r = add_opcode(reg, OP_MEMORY_START);
- if (r) return r;
- r = add_mem_num(reg, node->regnum);
- if (r) return r;
- r = compile_tree(node->target, reg);
- if (r) return r;
-#ifdef USE_SUBEXP_CALL
- if (IS_ENCLOSE_CALLED(node)) {
- if (BIT_STATUS_AT(reg->bt_mem_end, node->regnum))
- r = add_opcode(reg, (IS_ENCLOSE_RECURSION(node)
- ? OP_MEMORY_END_PUSH_REC : OP_MEMORY_END_PUSH));
- else
- r = add_opcode(reg, (IS_ENCLOSE_RECURSION(node)
- ? OP_MEMORY_END_REC : OP_MEMORY_END));
-
- if (r) return r;
- r = add_mem_num(reg, node->regnum);
- if (r) return r;
- r = add_opcode(reg, OP_RETURN);
- }
- else
-#endif
- {
- if (BIT_STATUS_AT(reg->bt_mem_end, node->regnum))
- r = add_opcode(reg, OP_MEMORY_END_PUSH);
- else
- r = add_opcode(reg, OP_MEMORY_END);
- if (r) return r;
- r = add_mem_num(reg, node->regnum);
- }
- break;
-
- case ENCLOSE_STOP_BACKTRACK:
- if (IS_ENCLOSE_STOP_BT_SIMPLE_REPEAT(node)) {
- QtfrNode* qn = NQTFR(node->target);
- r = compile_tree_n_times(qn->target, qn->lower, reg);
- if (r) return r;
-
- len = compile_length_tree(qn->target, reg);
- if (len < 0) return len;
-
- r = add_opcode_rel_addr(reg, OP_PUSH, len + SIZE_OP_POP + SIZE_OP_JUMP);
- if (r) return r;
- r = compile_tree(qn->target, reg);
- if (r) return r;
- r = add_opcode(reg, OP_POP);
- if (r) return r;
- r = add_opcode_rel_addr(reg, OP_JUMP,
- -((int )SIZE_OP_PUSH + len + (int )SIZE_OP_POP + (int )SIZE_OP_JUMP));
- }
- else {
- r = add_opcode(reg, OP_PUSH_STOP_BT);
- if (r) return r;
- r = compile_tree(node->target, reg);
- if (r) return r;
- r = add_opcode(reg, OP_POP_STOP_BT);
- }
- break;
-
- default:
- return ONIGERR_TYPE_BUG;
- break;
- }
-
- return r;
-}
-
-static int
-compile_length_anchor_node(AnchorNode* node, regex_t* reg)
-{
- int len;
- int tlen = 0;
-
- if (node->target) {
- tlen = compile_length_tree(node->target, reg);
- if (tlen < 0) return tlen;
- }
-
- switch (node->type) {
- case ANCHOR_PREC_READ:
- len = SIZE_OP_PUSH_POS + tlen + SIZE_OP_POP_POS;
- break;
- case ANCHOR_PREC_READ_NOT:
- len = SIZE_OP_PUSH_POS_NOT + tlen + SIZE_OP_FAIL_POS;
- break;
- case ANCHOR_LOOK_BEHIND:
- len = SIZE_OP_LOOK_BEHIND + tlen;
- break;
- case ANCHOR_LOOK_BEHIND_NOT:
- len = SIZE_OP_PUSH_LOOK_BEHIND_NOT + tlen + SIZE_OP_FAIL_LOOK_BEHIND_NOT;
- break;
-
- default:
- len = SIZE_OPCODE;
- break;
- }
-
- return len;
-}
-
-static int
-compile_anchor_node(AnchorNode* node, regex_t* reg)
-{
- int r, len;
-
- switch (node->type) {
- case ANCHOR_BEGIN_BUF: r = add_opcode(reg, OP_BEGIN_BUF); break;
- case ANCHOR_END_BUF: r = add_opcode(reg, OP_END_BUF); break;
- case ANCHOR_BEGIN_LINE: r = add_opcode(reg, OP_BEGIN_LINE); break;
- case ANCHOR_END_LINE: r = add_opcode(reg, OP_END_LINE); break;
- case ANCHOR_SEMI_END_BUF: r = add_opcode(reg, OP_SEMI_END_BUF); break;
- case ANCHOR_BEGIN_POSITION: r = add_opcode(reg, OP_BEGIN_POSITION); break;
-
- case ANCHOR_WORD_BOUND: r = add_opcode(reg, OP_WORD_BOUND); break;
- case ANCHOR_NOT_WORD_BOUND: r = add_opcode(reg, OP_NOT_WORD_BOUND); break;
-#ifdef USE_WORD_BEGIN_END
- case ANCHOR_WORD_BEGIN: r = add_opcode(reg, OP_WORD_BEGIN); break;
- case ANCHOR_WORD_END: r = add_opcode(reg, OP_WORD_END); break;
-#endif
-
- case ANCHOR_PREC_READ:
- r = add_opcode(reg, OP_PUSH_POS);
- if (r) return r;
- r = compile_tree(node->target, reg);
- if (r) return r;
- r = add_opcode(reg, OP_POP_POS);
- break;
-
- case ANCHOR_PREC_READ_NOT:
- len = compile_length_tree(node->target, reg);
- if (len < 0) return len;
- r = add_opcode_rel_addr(reg, OP_PUSH_POS_NOT, len + SIZE_OP_FAIL_POS);
- if (r) return r;
- r = compile_tree(node->target, reg);
- if (r) return r;
- r = add_opcode(reg, OP_FAIL_POS);
- break;
-
- case ANCHOR_LOOK_BEHIND:
- {
- int n;
- r = add_opcode(reg, OP_LOOK_BEHIND);
- if (r) return r;
- if (node->char_len < 0) {
- r = get_char_length_tree(node->target, reg, &n);
- if (r) return ONIGERR_INVALID_LOOK_BEHIND_PATTERN;
- }
- else
- n = node->char_len;
- r = add_length(reg, n);
- if (r) return r;
- r = compile_tree(node->target, reg);
- }
- break;
-
- case ANCHOR_LOOK_BEHIND_NOT:
- {
- int n;
- len = compile_length_tree(node->target, reg);
- r = add_opcode_rel_addr(reg, OP_PUSH_LOOK_BEHIND_NOT,
- len + SIZE_OP_FAIL_LOOK_BEHIND_NOT);
- if (r) return r;
- if (node->char_len < 0) {
- r = get_char_length_tree(node->target, reg, &n);
- if (r) return ONIGERR_INVALID_LOOK_BEHIND_PATTERN;
- }
- else
- n = node->char_len;
- r = add_length(reg, n);
- if (r) return r;
- r = compile_tree(node->target, reg);
- if (r) return r;
- r = add_opcode(reg, OP_FAIL_LOOK_BEHIND_NOT);
- }
- break;
-
- default:
- return ONIGERR_TYPE_BUG;
- break;
- }
-
- return r;
-}
-
-static int
-compile_length_tree(Node* node, regex_t* reg)
-{
- int len, type, r;
-
- type = NTYPE(node);
- switch (type) {
- case NT_LIST:
- len = 0;
- do {
- r = compile_length_tree(NCAR(node), reg);
- if (r < 0) return r;
- len += r;
- } while (IS_NOT_NULL(node = NCDR(node)));
- r = len;
- break;
-
- case NT_ALT:
- {
- int n;
-
- n = r = 0;
- do {
- r += compile_length_tree(NCAR(node), reg);
- n++;
- } while (IS_NOT_NULL(node = NCDR(node)));
- r += (SIZE_OP_PUSH + SIZE_OP_JUMP) * (n - 1);
- }
- break;
-
- case NT_STR:
- if (NSTRING_IS_RAW(node))
- r = compile_length_string_raw_node(NSTR(node), reg);
- else
- r = compile_length_string_node(node, reg);
- break;
-
- case NT_CCLASS:
- r = compile_length_cclass_node(NCCLASS(node), reg);
- break;
-
- case NT_CTYPE:
- case NT_CANY:
- r = SIZE_OPCODE;
- break;
-
- case NT_BREF:
- {
- BRefNode* br = NBREF(node);
-
-#ifdef USE_BACKREF_WITH_LEVEL
- if (IS_BACKREF_NEST_LEVEL(br)) {
- r = SIZE_OPCODE + SIZE_OPTION + SIZE_LENGTH +
- SIZE_LENGTH + (SIZE_MEMNUM * br->back_num);
- }
- else
-#endif
- if (br->back_num == 1) {
- r = ((!IS_IGNORECASE(reg->options) && br->back_static[0] <= 2)
- ? SIZE_OPCODE : (SIZE_OPCODE + SIZE_MEMNUM));
- }
- else {
- r = SIZE_OPCODE + SIZE_LENGTH + (SIZE_MEMNUM * br->back_num);
- }
- }
- break;
-
-#ifdef USE_SUBEXP_CALL
- case NT_CALL:
- r = SIZE_OP_CALL;
- break;
-#endif
-
- case NT_QTFR:
- r = compile_length_quantifier_node(NQTFR(node), reg);
- break;
-
- case NT_ENCLOSE:
- r = compile_length_enclose_node(NENCLOSE(node), reg);
- break;
-
- case NT_ANCHOR:
- r = compile_length_anchor_node(NANCHOR(node), reg);
- break;
-
- default:
- return ONIGERR_TYPE_BUG;
- break;
- }
-
- return r;
-}
-
-static int
-compile_tree(Node* node, regex_t* reg)
-{
- int n, type, len, pos, r = 0;
-
- type = NTYPE(node);
- switch (type) {
- case NT_LIST:
- do {
- r = compile_tree(NCAR(node), reg);
- } while (r == 0 && IS_NOT_NULL(node = NCDR(node)));
- break;
-
- case NT_ALT:
- {
- Node* x = node;
- len = 0;
- do {
- len += compile_length_tree(NCAR(x), reg);
- if (NCDR(x) != NULL) {
- len += SIZE_OP_PUSH + SIZE_OP_JUMP;
- }
- } while (IS_NOT_NULL(x = NCDR(x)));
- pos = reg->used + len; /* goal position */
-
- do {
- len = compile_length_tree(NCAR(node), reg);
- if (IS_NOT_NULL(NCDR(node))) {
- r = add_opcode_rel_addr(reg, OP_PUSH, len + SIZE_OP_JUMP);
- if (r) break;
- }
- r = compile_tree(NCAR(node), reg);
- if (r) break;
- if (IS_NOT_NULL(NCDR(node))) {
- len = pos - (reg->used + SIZE_OP_JUMP);
- r = add_opcode_rel_addr(reg, OP_JUMP, len);
- if (r) break;
- }
- } while (IS_NOT_NULL(node = NCDR(node)));
- }
- break;
-
- case NT_STR:
- if (NSTRING_IS_RAW(node))
- r = compile_string_raw_node(NSTR(node), reg);
- else
- r = compile_string_node(node, reg);
- break;
-
- case NT_CCLASS:
- r = compile_cclass_node(NCCLASS(node), reg);
- break;
-
- case NT_CTYPE:
- {
- int op;
-
- switch (NCTYPE(node)->ctype) {
- case ONIGENC_CTYPE_WORD:
- if (NCTYPE(node)->not != 0) op = OP_NOT_WORD;
- else op = OP_WORD;
- break;
- default:
- return ONIGERR_TYPE_BUG;
- break;
- }
- r = add_opcode(reg, op);
- }
- break;
-
- case NT_CANY:
- if (IS_MULTILINE(reg->options))
- r = add_opcode(reg, OP_ANYCHAR_ML);
- else
- r = add_opcode(reg, OP_ANYCHAR);
- break;
-
- case NT_BREF:
- {
- BRefNode* br = NBREF(node);
-
-#ifdef USE_BACKREF_WITH_LEVEL
- if (IS_BACKREF_NEST_LEVEL(br)) {
- r = add_opcode(reg, OP_BACKREF_WITH_LEVEL);
- if (r) return r;
- r = add_option(reg, (reg->options & ONIG_OPTION_IGNORECASE));
- if (r) return r;
- r = add_length(reg, br->nest_level);
- if (r) return r;
-
- goto add_bacref_mems;
- }
- else
-#endif
- if (br->back_num == 1) {
- n = br->back_static[0];
- if (IS_IGNORECASE(reg->options)) {
- r = add_opcode(reg, OP_BACKREFN_IC);
- if (r) return r;
- r = add_mem_num(reg, n);
- }
- else {
- switch (n) {
- case 1: r = add_opcode(reg, OP_BACKREF1); break;
- case 2: r = add_opcode(reg, OP_BACKREF2); break;
- default:
- r = add_opcode(reg, OP_BACKREFN);
- if (r) return r;
- r = add_mem_num(reg, n);
- break;
- }
- }
- }
- else {
- int i;
- int* p;
-
- if (IS_IGNORECASE(reg->options)) {
- r = add_opcode(reg, OP_BACKREF_MULTI_IC);
- }
- else {
- r = add_opcode(reg, OP_BACKREF_MULTI);
- }
- if (r) return r;
-
-#ifdef USE_BACKREF_WITH_LEVEL
- add_bacref_mems:
-#endif
- r = add_length(reg, br->back_num);
- if (r) return r;
- p = BACKREFS_P(br);
- for (i = br->back_num - 1; i >= 0; i--) {
- r = add_mem_num(reg, p[i]);
- if (r) return r;
- }
- }
- }
- break;
-
-#ifdef USE_SUBEXP_CALL
- case NT_CALL:
- r = compile_call(NCALL(node), reg);
- break;
-#endif
-
- case NT_QTFR:
- r = compile_quantifier_node(NQTFR(node), reg);
- break;
-
- case NT_ENCLOSE:
- r = compile_enclose_node(NENCLOSE(node), reg);
- break;
-
- case NT_ANCHOR:
- r = compile_anchor_node(NANCHOR(node), reg);
- break;
-
- default:
-#ifdef ONIG_DEBUG
- fprintf(stderr, "compile_tree: undefined node type %d\n", NTYPE(node));
-#endif
- break;
- }
-
- return r;
-}
-
-#ifdef USE_NAMED_GROUP
-
-static int
-noname_disable_map(Node** plink, GroupNumRemap* map, int* counter)
-{
- int r = 0;
- Node* node = *plink;
-
- switch (NTYPE(node)) {
- case NT_LIST:
- case NT_ALT:
- do {
- r = noname_disable_map(&(NCAR(node)), map, counter);
- } while (r == 0 && IS_NOT_NULL(node = NCDR(node)));
- break;
-
- case NT_QTFR:
- {
- Node** ptarget = &(NQTFR(node)->target);
- Node* old = *ptarget;
- r = noname_disable_map(ptarget, map, counter);
- if (*ptarget != old && NTYPE(*ptarget) == NT_QTFR) {
- onig_reduce_nested_quantifier(node, *ptarget);
- }
- }
- break;
-
- case NT_ENCLOSE:
- {
- EncloseNode* en = NENCLOSE(node);
- if (en->type == ENCLOSE_MEMORY) {
- if (IS_ENCLOSE_NAMED_GROUP(en)) {
- (*counter)++;
- map[en->regnum].new_val = *counter;
- en->regnum = *counter;
- r = noname_disable_map(&(en->target), map, counter);
- }
- else {
- *plink = en->target;
- en->target = NULL_NODE;
- onig_node_free(node);
- r = noname_disable_map(plink, map, counter);
- }
- }
- else
- r = noname_disable_map(&(en->target), map, counter);
- }
- break;
-
- default:
- break;
- }
-
- return r;
-}
-
-static int
-renumber_node_backref(Node* node, GroupNumRemap* map)
-{
- int i, pos, n, old_num;
- int *backs;
- BRefNode* bn = NBREF(node);
-
- if (! IS_BACKREF_NAME_REF(bn))
- return ONIGERR_NUMBERED_BACKREF_OR_CALL_NOT_ALLOWED;
-
- old_num = bn->back_num;
- if (IS_NULL(bn->back_dynamic))
- backs = bn->back_static;
- else
- backs = bn->back_dynamic;
-
- for (i = 0, pos = 0; i < old_num; i++) {
- n = map[backs[i]].new_val;
- if (n > 0) {
- backs[pos] = n;
- pos++;
- }
- }
-
- bn->back_num = pos;
- return 0;
-}
-
-static int
-renumber_by_map(Node* node, GroupNumRemap* map)
-{
- int r = 0;
-
- switch (NTYPE(node)) {
- case NT_LIST:
- case NT_ALT:
- do {
- r = renumber_by_map(NCAR(node), map);
- } while (r == 0 && IS_NOT_NULL(node = NCDR(node)));
- break;
- case NT_QTFR:
- r = renumber_by_map(NQTFR(node)->target, map);
- break;
- case NT_ENCLOSE:
- r = renumber_by_map(NENCLOSE(node)->target, map);
- break;
-
- case NT_BREF:
- r = renumber_node_backref(node, map);
- break;
-
- default:
- break;
- }
-
- return r;
-}
-
-static int
-numbered_ref_check(Node* node)
-{
- int r = 0;
-
- switch (NTYPE(node)) {
- case NT_LIST:
- case NT_ALT:
- do {
- r = numbered_ref_check(NCAR(node));
- } while (r == 0 && IS_NOT_NULL(node = NCDR(node)));
- break;
- case NT_QTFR:
- r = numbered_ref_check(NQTFR(node)->target);
- break;
- case NT_ENCLOSE:
- r = numbered_ref_check(NENCLOSE(node)->target);
- break;
-
- case NT_BREF:
- if (! IS_BACKREF_NAME_REF(NBREF(node)))
- return ONIGERR_NUMBERED_BACKREF_OR_CALL_NOT_ALLOWED;
- break;
-
- default:
- break;
- }
-
- return r;
-}
-
-static int
-disable_noname_group_capture(Node** root, regex_t* reg, ScanEnv* env)
-{
- int r, i, pos, counter;
- BitStatusType loc;
- GroupNumRemap* map;
-
- map = (GroupNumRemap* )xalloca(sizeof(GroupNumRemap) * (env->num_mem + 1));
- CHECK_NULL_RETURN_MEMERR(map);
- for (i = 1; i <= env->num_mem; i++) {
- map[i].new_val = 0;
- }
- counter = 0;
- r = noname_disable_map(root, map, &counter);
- if (r != 0) return r;
-
- r = renumber_by_map(*root, map);
- if (r != 0) return r;
-
- for (i = 1, pos = 1; i <= env->num_mem; i++) {
- if (map[i].new_val > 0) {
- SCANENV_MEM_NODES(env)[pos] = SCANENV_MEM_NODES(env)[i];
- pos++;
- }
- }
-
- loc = env->capture_history;
- BIT_STATUS_CLEAR(env->capture_history);
- for (i = 1; i <= ONIG_MAX_CAPTURE_HISTORY_GROUP; i++) {
- if (BIT_STATUS_AT(loc, i)) {
- BIT_STATUS_ON_AT_SIMPLE(env->capture_history, map[i].new_val);
- }
- }
-
- env->num_mem = env->num_named;
- reg->num_mem = env->num_named;
-
- return onig_renumber_name_table(reg, map);
-}
-#endif /* USE_NAMED_GROUP */
-
-#ifdef USE_SUBEXP_CALL
-static int
-unset_addr_list_fix(UnsetAddrList* uslist, regex_t* reg)
-{
- int i, offset;
- EncloseNode* en;
- AbsAddrType addr;
-
- for (i = 0; i < uslist->num; i++) {
- en = NENCLOSE(uslist->us[i].target);
- if (! IS_ENCLOSE_ADDR_FIXED(en)) return ONIGERR_PARSER_BUG;
- addr = en->call_addr;
- offset = uslist->us[i].offset;
-
- BBUF_WRITE(reg, offset, &addr, SIZE_ABSADDR);
- }
- return 0;
-}
-#endif
-
-#ifdef USE_MONOMANIAC_CHECK_CAPTURES_IN_ENDLESS_REPEAT
-static int
-quantifiers_memory_node_info(Node* node)
-{
- int r = 0;
-
- switch (NTYPE(node)) {
- case NT_LIST:
- case NT_ALT:
- {
- int v;
- do {
- v = quantifiers_memory_node_info(NCAR(node));
- if (v > r) r = v;
- } while (v >= 0 && IS_NOT_NULL(node = NCDR(node)));
- }
- break;
-
-#ifdef USE_SUBEXP_CALL
- case NT_CALL:
- if (IS_CALL_RECURSION(NCALL(node))) {
- return NQ_TARGET_IS_EMPTY_REC; /* tiny version */
- }
- else
- r = quantifiers_memory_node_info(NCALL(node)->target);
- break;
-#endif
-
- case NT_QTFR:
- {
- QtfrNode* qn = NQTFR(node);
- if (qn->upper != 0) {
- r = quantifiers_memory_node_info(qn->target);
- }
- }
- break;
-
- case NT_ENCLOSE:
- {
- EncloseNode* en = NENCLOSE(node);
- switch (en->type) {
- case ENCLOSE_MEMORY:
- return NQ_TARGET_IS_EMPTY_MEM;
- break;
-
- case ENCLOSE_OPTION:
- case ENCLOSE_STOP_BACKTRACK:
- r = quantifiers_memory_node_info(en->target);
- break;
- default:
- break;
- }
- }
- break;
-
- case NT_BREF:
- case NT_STR:
- case NT_CTYPE:
- case NT_CCLASS:
- case NT_CANY:
- case NT_ANCHOR:
- default:
- break;
- }
-
- return r;
-}
-#endif /* USE_MONOMANIAC_CHECK_CAPTURES_IN_ENDLESS_REPEAT */
-
-static int
-get_min_match_length(Node* node, OnigDistance *min, ScanEnv* env)
-{
- OnigDistance tmin;
- int r = 0;
-
- *min = 0;
- switch (NTYPE(node)) {
- case NT_BREF:
- {
- int i;
- int* backs;
- Node** nodes = SCANENV_MEM_NODES(env);
- BRefNode* br = NBREF(node);
- if (br->state & NST_RECURSION) break;
-
- backs = BACKREFS_P(br);
- if (backs[0] > env->num_mem) return ONIGERR_INVALID_BACKREF;
- r = get_min_match_length(nodes[backs[0]], min, env);
- if (r != 0) break;
- for (i = 1; i < br->back_num; i++) {
- if (backs[i] > env->num_mem) return ONIGERR_INVALID_BACKREF;
- r = get_min_match_length(nodes[backs[i]], &tmin, env);
- if (r != 0) break;
- if (*min > tmin) *min = tmin;
- }
- }
- break;
-
-#ifdef USE_SUBEXP_CALL
- case NT_CALL:
- if (IS_CALL_RECURSION(NCALL(node))) {
- EncloseNode* en = NENCLOSE(NCALL(node)->target);
- if (IS_ENCLOSE_MIN_FIXED(en))
- *min = en->min_len;
- }
- else
- r = get_min_match_length(NCALL(node)->target, min, env);
- break;
-#endif
-
- case NT_LIST:
- do {
- r = get_min_match_length(NCAR(node), &tmin, env);
- if (r == 0) *min += tmin;
- } while (r == 0 && IS_NOT_NULL(node = NCDR(node)));
- break;
-
- case NT_ALT:
- {
- Node *x, *y;
- y = node;
- do {
- x = NCAR(y);
- r = get_min_match_length(x, &tmin, env);
- if (r != 0) break;
- if (y == node) *min = tmin;
- else if (*min > tmin) *min = tmin;
- } while (r == 0 && IS_NOT_NULL(y = NCDR(y)));
- }
- break;
-
- case NT_STR:
- {
- StrNode* sn = NSTR(node);
- *min = sn->end - sn->s;
- }
- break;
-
- case NT_CTYPE:
- *min = 1;
- break;
-
- case NT_CCLASS:
- case NT_CANY:
- *min = 1;
- break;
-
- case NT_QTFR:
- {
- QtfrNode* qn = NQTFR(node);
-
- if (qn->lower > 0) {
- r = get_min_match_length(qn->target, min, env);
- if (r == 0)
- *min = distance_multiply(*min, qn->lower);
- }
- }
- break;
-
- case NT_ENCLOSE:
- {
- EncloseNode* en = NENCLOSE(node);
- switch (en->type) {
- case ENCLOSE_MEMORY:
-#ifdef USE_SUBEXP_CALL
- if (IS_ENCLOSE_MIN_FIXED(en))
- *min = en->min_len;
- else {
- r = get_min_match_length(en->target, min, env);
- if (r == 0) {
- en->min_len = *min;
- SET_ENCLOSE_STATUS(node, NST_MIN_FIXED);
- }
- }
- break;
-#endif
- case ENCLOSE_OPTION:
- case ENCLOSE_STOP_BACKTRACK:
- r = get_min_match_length(en->target, min, env);
- break;
- }
- }
- break;
-
- case NT_ANCHOR:
- default:
- break;
- }
-
- return r;
-}
-
-static int
-get_max_match_length(Node* node, OnigDistance *max, ScanEnv* env)
-{
- OnigDistance tmax;
- int r = 0;
-
- *max = 0;
- switch (NTYPE(node)) {
- case NT_LIST:
- do {
- r = get_max_match_length(NCAR(node), &tmax, env);
- if (r == 0)
- *max = distance_add(*max, tmax);
- } while (r == 0 && IS_NOT_NULL(node = NCDR(node)));
- break;
-
- case NT_ALT:
- do {
- r = get_max_match_length(NCAR(node), &tmax, env);
- if (r == 0 && *max < tmax) *max = tmax;
- } while (r == 0 && IS_NOT_NULL(node = NCDR(node)));
- break;
-
- case NT_STR:
- {
- StrNode* sn = NSTR(node);
- *max = sn->end - sn->s;
- }
- break;
-
- case NT_CTYPE:
- *max = ONIGENC_MBC_MAXLEN_DIST(env->enc);
- break;
-
- case NT_CCLASS:
- case NT_CANY:
- *max = ONIGENC_MBC_MAXLEN_DIST(env->enc);
- break;
-
- case NT_BREF:
- {
- int i;
- int* backs;
- Node** nodes = SCANENV_MEM_NODES(env);
- BRefNode* br = NBREF(node);
- if (br->state & NST_RECURSION) {
- *max = ONIG_INFINITE_DISTANCE;
- break;
- }
- backs = BACKREFS_P(br);
- for (i = 0; i < br->back_num; i++) {
- if (backs[i] > env->num_mem) return ONIGERR_INVALID_BACKREF;
- r = get_max_match_length(nodes[backs[i]], &tmax, env);
- if (r != 0) break;
- if (*max < tmax) *max = tmax;
- }
- }
- break;
-
-#ifdef USE_SUBEXP_CALL
- case NT_CALL:
- if (! IS_CALL_RECURSION(NCALL(node)))
- r = get_max_match_length(NCALL(node)->target, max, env);
- else
- *max = ONIG_INFINITE_DISTANCE;
- break;
-#endif
-
- case NT_QTFR:
- {
- QtfrNode* qn = NQTFR(node);
-
- if (qn->upper != 0) {
- r = get_max_match_length(qn->target, max, env);
- if (r == 0 && *max != 0) {
- if (! IS_REPEAT_INFINITE(qn->upper))
- *max = distance_multiply(*max, qn->upper);
- else
- *max = ONIG_INFINITE_DISTANCE;
- }
- }
- }
- break;
-
- case NT_ENCLOSE:
- {
- EncloseNode* en = NENCLOSE(node);
- switch (en->type) {
- case ENCLOSE_MEMORY:
-#ifdef USE_SUBEXP_CALL
- if (IS_ENCLOSE_MAX_FIXED(en))
- *max = en->max_len;
- else {
- r = get_max_match_length(en->target, max, env);
- if (r == 0) {
- en->max_len = *max;
- SET_ENCLOSE_STATUS(node, NST_MAX_FIXED);
- }
- }
- break;
-#endif
- case ENCLOSE_OPTION:
- case ENCLOSE_STOP_BACKTRACK:
- r = get_max_match_length(en->target, max, env);
- break;
- }
- }
- break;
-
- case NT_ANCHOR:
- default:
- break;
- }
-
- return r;
-}
-
-#define GET_CHAR_LEN_VARLEN -1
-#define GET_CHAR_LEN_TOP_ALT_VARLEN -2
-
-/* fixed size pattern node only */
-static int
-get_char_length_tree1(Node* node, regex_t* reg, int* len, int level)
-{
- int tlen;
- int r = 0;
-
- level++;
- *len = 0;
- switch (NTYPE(node)) {
- case NT_LIST:
- do {
- r = get_char_length_tree1(NCAR(node), reg, &tlen, level);
- if (r == 0)
- *len = distance_add(*len, tlen);
- } while (r == 0 && IS_NOT_NULL(node = NCDR(node)));
- break;
-
- case NT_ALT:
- {
- int tlen2;
- int varlen = 0;
-
- r = get_char_length_tree1(NCAR(node), reg, &tlen, level);
- while (r == 0 && IS_NOT_NULL(node = NCDR(node))) {
- r = get_char_length_tree1(NCAR(node), reg, &tlen2, level);
- if (r == 0) {
- if (tlen != tlen2)
- varlen = 1;
- }
- }
- if (r == 0) {
- if (varlen != 0) {
- if (level == 1)
- r = GET_CHAR_LEN_TOP_ALT_VARLEN;
- else
- r = GET_CHAR_LEN_VARLEN;
- }
- else
- *len = tlen;
- }
- }
- break;
-
- case NT_STR:
- {
- StrNode* sn = NSTR(node);
- UChar *s = sn->s;
- while (s < sn->end) {
- s += enclen(reg->enc, s, sn->end);
- (*len)++;
- }
- }
- break;
-
- case NT_QTFR:
- {
- QtfrNode* qn = NQTFR(node);
- if (qn->lower == qn->upper) {
- r = get_char_length_tree1(qn->target, reg, &tlen, level);
- if (r == 0)
- *len = distance_multiply(tlen, qn->lower);
- }
- else
- r = GET_CHAR_LEN_VARLEN;
- }
- break;
-
-#ifdef USE_SUBEXP_CALL
- case NT_CALL:
- if (! IS_CALL_RECURSION(NCALL(node)))
- r = get_char_length_tree1(NCALL(node)->target, reg, len, level);
- else
- r = GET_CHAR_LEN_VARLEN;
- break;
-#endif
-
- case NT_CTYPE:
- *len = 1;
- break;
-
- case NT_CCLASS:
- case NT_CANY:
- *len = 1;
- break;
-
- case NT_ENCLOSE:
- {
- EncloseNode* en = NENCLOSE(node);
- switch (en->type) {
- case ENCLOSE_MEMORY:
-#ifdef USE_SUBEXP_CALL
- if (IS_ENCLOSE_CLEN_FIXED(en))
- *len = en->char_len;
- else {
- r = get_char_length_tree1(en->target, reg, len, level);
- if (r == 0) {
- en->char_len = *len;
- SET_ENCLOSE_STATUS(node, NST_CLEN_FIXED);
- }
- }
- break;
-#endif
- case ENCLOSE_OPTION:
- case ENCLOSE_STOP_BACKTRACK:
- r = get_char_length_tree1(en->target, reg, len, level);
- break;
- default:
- break;
- }
- }
- break;
-
- case NT_ANCHOR:
- break;
-
- default:
- r = GET_CHAR_LEN_VARLEN;
- break;
- }
-
- return r;
-}
-
-static int
-get_char_length_tree(Node* node, regex_t* reg, int* len)
-{
- return get_char_length_tree1(node, reg, len, 0);
-}
-
-/* x is not included y ==> 1 : 0 */
-static int
-is_not_included(Node* x, Node* y, regex_t* reg)
-{
- int i, len;
- OnigCodePoint code;
- UChar *p, c;
- int ytype;
-
- retry:
- ytype = NTYPE(y);
- switch (NTYPE(x)) {
- case NT_CTYPE:
- {
- switch (ytype) {
- case NT_CTYPE:
- if (NCTYPE(y)->ctype == NCTYPE(x)->ctype &&
- NCTYPE(y)->not != NCTYPE(x)->not)
- return 1;
- else
- return 0;
- break;
-
- case NT_CCLASS:
- swap:
- {
- Node* tmp;
- tmp = x; x = y; y = tmp;
- goto retry;
- }
- break;
-
- case NT_STR:
- goto swap;
- break;
-
- default:
- break;
- }
- }
- break;
-
- case NT_CCLASS:
- {
- CClassNode* xc = NCCLASS(x);
- switch (ytype) {
- case NT_CTYPE:
- switch (NCTYPE(y)->ctype) {
- case ONIGENC_CTYPE_WORD:
- if (NCTYPE(y)->not == 0) {
- if (IS_NULL(xc->mbuf) && !IS_NCCLASS_NOT(xc)) {
- for (i = 0; i < SINGLE_BYTE_SIZE; i++) {
- if (BITSET_AT(xc->bs, i)) {
- if (IS_CODE_SB_WORD(reg->enc, i)) return 0;
- }
- }
- return 1;
- }
- return 0;
- }
- else {
- for (i = 0; i < SINGLE_BYTE_SIZE; i++) {
- if (! IS_CODE_SB_WORD(reg->enc, i)) {
- if (!IS_NCCLASS_NOT(xc)) {
- if (BITSET_AT(xc->bs, i))
- return 0;
- }
- else {
- if (! BITSET_AT(xc->bs, i))
- return 0;
- }
- }
- }
- return 1;
- }
- break;
-
- default:
- break;
- }
- break;
-
- case NT_CCLASS:
- {
- int v;
- CClassNode* yc = NCCLASS(y);
-
- for (i = 0; i < SINGLE_BYTE_SIZE; i++) {
- v = BITSET_AT(xc->bs, i);
- if ((v != 0 && !IS_NCCLASS_NOT(xc)) ||
- (v == 0 && IS_NCCLASS_NOT(xc))) {
- v = BITSET_AT(yc->bs, i);
- if ((v != 0 && !IS_NCCLASS_NOT(yc)) ||
- (v == 0 && IS_NCCLASS_NOT(yc)))
- return 0;
- }
- }
- if ((IS_NULL(xc->mbuf) && !IS_NCCLASS_NOT(xc)) ||
- (IS_NULL(yc->mbuf) && !IS_NCCLASS_NOT(yc)))
- return 1;
- return 0;
- }
- break;
-
- case NT_STR:
- goto swap;
- break;
-
- default:
- break;
- }
- }
- break;
-
- case NT_STR:
- {
- StrNode* xs = NSTR(x);
- if (NSTRING_LEN(x) == 0)
- break;
-
- c = *(xs->s);
- switch (ytype) {
- case NT_CTYPE:
- switch (NCTYPE(y)->ctype) {
- case ONIGENC_CTYPE_WORD:
- if (ONIGENC_IS_MBC_WORD(reg->enc, xs->s, xs->end))
- return NCTYPE(y)->not;
- else
- return !(NCTYPE(y)->not);
- break;
- default:
- break;
- }
- break;
-
- case NT_CCLASS:
- {
- CClassNode* cc = NCCLASS(y);
-
- code = ONIGENC_MBC_TO_CODE(reg->enc, xs->s,
- xs->s + ONIGENC_MBC_MAXLEN(reg->enc));
- return (onig_is_code_in_cc(reg->enc, code, cc) != 0 ? 0 : 1);
- }
- break;
-
- case NT_STR:
- {
- UChar *q;
- StrNode* ys = NSTR(y);
- len = NSTRING_LEN(x);
- if (len > NSTRING_LEN(y)) len = NSTRING_LEN(y);
- if (NSTRING_IS_AMBIG(x) || NSTRING_IS_AMBIG(y)) {
- /* tiny version */
- return 0;
- }
- else {
- for (i = 0, p = ys->s, q = xs->s; i < len; i++, p++, q++) {
- if (*p != *q) return 1;
- }
- }
- }
- break;
-
- default:
- break;
- }
- }
- break;
-
- default:
- break;
- }
-
- return 0;
-}
-
-static Node*
-get_head_value_node(Node* node, int exact, regex_t* reg)
-{
- Node* n = NULL_NODE;
-
- switch (NTYPE(node)) {
- case NT_BREF:
- case NT_ALT:
- case NT_CANY:
-#ifdef USE_SUBEXP_CALL
- case NT_CALL:
-#endif
- break;
-
- case NT_CTYPE:
- case NT_CCLASS:
- if (exact == 0) {
- n = node;
- }
- break;
-
- case NT_LIST:
- n = get_head_value_node(NCAR(node), exact, reg);
- break;
-
- case NT_STR:
- {
- StrNode* sn = NSTR(node);
-
- if (sn->end <= sn->s)
- break;
-
- if (exact != 0 &&
- !NSTRING_IS_RAW(node) && IS_IGNORECASE(reg->options)) {
- }
- else {
- n = node;
- }
- }
- break;
-
- case NT_QTFR:
- {
- QtfrNode* qn = NQTFR(node);
- if (qn->lower > 0) {
- if (IS_NOT_NULL(qn->head_exact))
- n = qn->head_exact;
- else
- n = get_head_value_node(qn->target, exact, reg);
- }
- }
- break;
-
- case NT_ENCLOSE:
- {
- EncloseNode* en = NENCLOSE(node);
- switch (en->type) {
- case ENCLOSE_OPTION:
- {
- OnigOptionType options = reg->options;
-
- reg->options = NENCLOSE(node)->option;
- n = get_head_value_node(NENCLOSE(node)->target, exact, reg);
- reg->options = options;
- }
- break;
-
- case ENCLOSE_MEMORY:
- case ENCLOSE_STOP_BACKTRACK:
- n = get_head_value_node(en->target, exact, reg);
- break;
- }
- }
- break;
-
- case NT_ANCHOR:
- if (NANCHOR(node)->type == ANCHOR_PREC_READ)
- n = get_head_value_node(NANCHOR(node)->target, exact, reg);
- break;
-
- default:
- break;
- }
-
- return n;
-}
-
-static int
-check_type_tree(Node* node, int type_mask, int enclose_mask, int anchor_mask)
-{
- int type, r = 0;
-
- type = NTYPE(node);
- if ((NTYPE2BIT(type) & type_mask) == 0)
- return 1;
-
- switch (type) {
- case NT_LIST:
- case NT_ALT:
- do {
- r = check_type_tree(NCAR(node), type_mask, enclose_mask,
- anchor_mask);
- } while (r == 0 && IS_NOT_NULL(node = NCDR(node)));
- break;
-
- case NT_QTFR:
- r = check_type_tree(NQTFR(node)->target, type_mask, enclose_mask,
- anchor_mask);
- break;
-
- case NT_ENCLOSE:
- {
- EncloseNode* en = NENCLOSE(node);
- if ((en->type & enclose_mask) == 0)
- return 1;
-
- r = check_type_tree(en->target, type_mask, enclose_mask, anchor_mask);
- }
- break;
-
- case NT_ANCHOR:
- type = NANCHOR(node)->type;
- if ((type & anchor_mask) == 0)
- return 1;
-
- if (NANCHOR(node)->target)
- r = check_type_tree(NANCHOR(node)->target,
- type_mask, enclose_mask, anchor_mask);
- break;
-
- default:
- break;
- }
- return r;
-}
-
-#ifdef USE_SUBEXP_CALL
-
-#define RECURSION_EXIST 1
-#define RECURSION_INFINITE 2
-
-static int
-subexp_inf_recursive_check(Node* node, ScanEnv* env, int head)
-{
- int type;
- int r = 0;
-
- type = NTYPE(node);
- switch (type) {
- case NT_LIST:
- {
- Node *x;
- OnigDistance min;
- int ret;
-
- x = node;
- do {
- ret = subexp_inf_recursive_check(NCAR(x), env, head);
- if (ret < 0 || ret == RECURSION_INFINITE) return ret;
- r |= ret;
- if (head) {
- ret = get_min_match_length(NCAR(x), &min, env);
- if (ret != 0) return ret;
- if (min != 0) head = 0;
- }
- } while (IS_NOT_NULL(x = NCDR(x)));
- }
- break;
-
- case NT_ALT:
- {
- int ret;
- r = RECURSION_EXIST;
- do {
- ret = subexp_inf_recursive_check(NCAR(node), env, head);
- if (ret < 0 || ret == RECURSION_INFINITE) return ret;
- r &= ret;
- } while (IS_NOT_NULL(node = NCDR(node)));
- }
- break;
-
- case NT_QTFR:
- r = subexp_inf_recursive_check(NQTFR(node)->target, env, head);
- if (r == RECURSION_EXIST) {
- if (NQTFR(node)->lower == 0) r = 0;
- }
- break;
-
- case NT_ANCHOR:
- {
- AnchorNode* an = NANCHOR(node);
- switch (an->type) {
- case ANCHOR_PREC_READ:
- case ANCHOR_PREC_READ_NOT:
- case ANCHOR_LOOK_BEHIND:
- case ANCHOR_LOOK_BEHIND_NOT:
- r = subexp_inf_recursive_check(an->target, env, head);
- break;
- }
- }
- break;
-
- case NT_CALL:
- r = subexp_inf_recursive_check(NCALL(node)->target, env, head);
- break;
-
- case NT_ENCLOSE:
- if (IS_ENCLOSE_MARK2(NENCLOSE(node)))
- return 0;
- else if (IS_ENCLOSE_MARK1(NENCLOSE(node)))
- return (head == 0 ? RECURSION_EXIST : RECURSION_INFINITE);
- else {
- SET_ENCLOSE_STATUS(node, NST_MARK2);
- r = subexp_inf_recursive_check(NENCLOSE(node)->target, env, head);
- CLEAR_ENCLOSE_STATUS(node, NST_MARK2);
- }
- break;
-
- default:
- break;
- }
-
- return r;
-}
-
-static int
-subexp_inf_recursive_check_trav(Node* node, ScanEnv* env)
-{
- int type;
- int r = 0;
-
- type = NTYPE(node);
- switch (type) {
- case NT_LIST:
- case NT_ALT:
- do {
- r = subexp_inf_recursive_check_trav(NCAR(node), env);
- } while (r == 0 && IS_NOT_NULL(node = NCDR(node)));
- break;
-
- case NT_QTFR:
- r = subexp_inf_recursive_check_trav(NQTFR(node)->target, env);
- break;
-
- case NT_ANCHOR:
- {
- AnchorNode* an = NANCHOR(node);
- switch (an->type) {
- case ANCHOR_PREC_READ:
- case ANCHOR_PREC_READ_NOT:
- case ANCHOR_LOOK_BEHIND:
- case ANCHOR_LOOK_BEHIND_NOT:
- r = subexp_inf_recursive_check_trav(an->target, env);
- break;
- }
- }
- break;
-
- case NT_ENCLOSE:
- {
- EncloseNode* en = NENCLOSE(node);
-
- if (IS_ENCLOSE_RECURSION(en)) {
- SET_ENCLOSE_STATUS(node, NST_MARK1);
- r = subexp_inf_recursive_check(en->target, env, 1);
- if (r > 0) return ONIGERR_NEVER_ENDING_RECURSION;
- CLEAR_ENCLOSE_STATUS(node, NST_MARK1);
- }
- r = subexp_inf_recursive_check_trav(en->target, env);
- }
-
- break;
-
- default:
- break;
- }
-
- return r;
-}
-
-static int
-subexp_recursive_check(Node* node)
-{
- int r = 0;
-
- switch (NTYPE(node)) {
- case NT_LIST:
- case NT_ALT:
- do {
- r |= subexp_recursive_check(NCAR(node));
- } while (IS_NOT_NULL(node = NCDR(node)));
- break;
-
- case NT_QTFR:
- r = subexp_recursive_check(NQTFR(node)->target);
- break;
-
- case NT_ANCHOR:
- {
- AnchorNode* an = NANCHOR(node);
- switch (an->type) {
- case ANCHOR_PREC_READ:
- case ANCHOR_PREC_READ_NOT:
- case ANCHOR_LOOK_BEHIND:
- case ANCHOR_LOOK_BEHIND_NOT:
- r = subexp_recursive_check(an->target);
- break;
- }
- }
- break;
-
- case NT_CALL:
- r = subexp_recursive_check(NCALL(node)->target);
- if (r != 0) SET_CALL_RECURSION(node);
- break;
-
- case NT_ENCLOSE:
- if (IS_ENCLOSE_MARK2(NENCLOSE(node)))
- return 0;
- else if (IS_ENCLOSE_MARK1(NENCLOSE(node)))
- return 1; /* recursion */
- else {
- SET_ENCLOSE_STATUS(node, NST_MARK2);
- r = subexp_recursive_check(NENCLOSE(node)->target);
- CLEAR_ENCLOSE_STATUS(node, NST_MARK2);
- }
- break;
-
- default:
- break;
- }
-
- return r;
-}
-
-
-static int
-subexp_recursive_check_trav(Node* node, ScanEnv* env)
-{
-#define FOUND_CALLED_NODE 1
-
- int type;
- int r = 0;
-
- type = NTYPE(node);
- switch (type) {
- case NT_LIST:
- case NT_ALT:
- {
- int ret;
- do {
- ret = subexp_recursive_check_trav(NCAR(node), env);
- if (ret == FOUND_CALLED_NODE) r = FOUND_CALLED_NODE;
- else if (ret < 0) return ret;
- } while (IS_NOT_NULL(node = NCDR(node)));
- }
- break;
-
- case NT_QTFR:
- r = subexp_recursive_check_trav(NQTFR(node)->target, env);
- if (NQTFR(node)->upper == 0) {
- if (r == FOUND_CALLED_NODE)
- NQTFR(node)->is_refered = 1;
- }
- break;
-
- case NT_ANCHOR:
- {
- AnchorNode* an = NANCHOR(node);
- switch (an->type) {
- case ANCHOR_PREC_READ:
- case ANCHOR_PREC_READ_NOT:
- case ANCHOR_LOOK_BEHIND:
- case ANCHOR_LOOK_BEHIND_NOT:
- r = subexp_recursive_check_trav(an->target, env);
- break;
- }
- }
- break;
-
- case NT_ENCLOSE:
- {
- EncloseNode* en = NENCLOSE(node);
-
- if (! IS_ENCLOSE_RECURSION(en)) {
- if (IS_ENCLOSE_CALLED(en)) {
- SET_ENCLOSE_STATUS(node, NST_MARK1);
- r = subexp_recursive_check(en->target);
- if (r != 0) SET_ENCLOSE_STATUS(node, NST_RECURSION);
- CLEAR_ENCLOSE_STATUS(node, NST_MARK1);
- }
- }
- r = subexp_recursive_check_trav(en->target, env);
- if (IS_ENCLOSE_CALLED(en))
- r |= FOUND_CALLED_NODE;
- }
- break;
-
- default:
- break;
- }
-
- return r;
-}
-
-static int
-setup_subexp_call(Node* node, ScanEnv* env)
-{
- int type;
- int r = 0;
-
- type = NTYPE(node);
- switch (type) {
- case NT_LIST:
- do {
- r = setup_subexp_call(NCAR(node), env);
- } while (r == 0 && IS_NOT_NULL(node = NCDR(node)));
- break;
-
- case NT_ALT:
- do {
- r = setup_subexp_call(NCAR(node), env);
- } while (r == 0 && IS_NOT_NULL(node = NCDR(node)));
- break;
-
- case NT_QTFR:
- r = setup_subexp_call(NQTFR(node)->target, env);
- break;
- case NT_ENCLOSE:
- r = setup_subexp_call(NENCLOSE(node)->target, env);
- break;
-
- case NT_CALL:
- {
- CallNode* cn = NCALL(node);
- Node** nodes = SCANENV_MEM_NODES(env);
-
- if (cn->group_num != 0) {
- int gnum = cn->group_num;
-
-#ifdef USE_NAMED_GROUP
- if (env->num_named > 0 &&
- IS_SYNTAX_BV(env->syntax, ONIG_SYN_CAPTURE_ONLY_NAMED_GROUP) &&
- !ONIG_IS_OPTION_ON(env->option, ONIG_OPTION_CAPTURE_GROUP)) {
- return ONIGERR_NUMBERED_BACKREF_OR_CALL_NOT_ALLOWED;
- }
-#endif
- if (gnum > env->num_mem) {
- onig_scan_env_set_error_string(env,
- ONIGERR_UNDEFINED_GROUP_REFERENCE, cn->name, cn->name_end);
- return ONIGERR_UNDEFINED_GROUP_REFERENCE;
- }
-
-#ifdef USE_NAMED_GROUP
- set_call_attr:
-#endif
- cn->target = nodes[cn->group_num];
- if (IS_NULL(cn->target)) {
- onig_scan_env_set_error_string(env,
- ONIGERR_UNDEFINED_NAME_REFERENCE, cn->name, cn->name_end);
- return ONIGERR_UNDEFINED_NAME_REFERENCE;
- }
- SET_ENCLOSE_STATUS(cn->target, NST_CALLED);
- BIT_STATUS_ON_AT(env->bt_mem_start, cn->group_num);
- cn->unset_addr_list = env->unset_addr_list;
- }
-#ifdef USE_NAMED_GROUP
- else {
- int *refs;
-
- int n = onig_name_to_group_numbers(env->reg, cn->name, cn->name_end,
- &refs);
- if (n <= 0) {
- onig_scan_env_set_error_string(env,
- ONIGERR_UNDEFINED_NAME_REFERENCE, cn->name, cn->name_end);
- return ONIGERR_UNDEFINED_NAME_REFERENCE;
- }
- else if (n > 1) {
- onig_scan_env_set_error_string(env,
- ONIGERR_MULTIPLEX_DEFINITION_NAME_CALL, cn->name, cn->name_end);
- return ONIGERR_MULTIPLEX_DEFINITION_NAME_CALL;
- }
- else {
- cn->group_num = refs[0];
- goto set_call_attr;
- }
- }
-#endif
- }
- break;
-
- case NT_ANCHOR:
- {
- AnchorNode* an = NANCHOR(node);
-
- switch (an->type) {
- case ANCHOR_PREC_READ:
- case ANCHOR_PREC_READ_NOT:
- case ANCHOR_LOOK_BEHIND:
- case ANCHOR_LOOK_BEHIND_NOT:
- r = setup_subexp_call(an->target, env);
- break;
- }
- }
- break;
-
- default:
- break;
- }
-
- return r;
-}
-#endif
-
-/* divide different length alternatives in look-behind.
- (?<=A|B) ==> (?<=A)|(?<=B)
- (?<!A|B) ==> (?<!A)(?<!B)
-*/
-static int
-divide_look_behind_alternatives(Node* node)
-{
- Node *head, *np, *insert_node;
- AnchorNode* an = NANCHOR(node);
- int anc_type = an->type;
-
- head = an->target;
- np = NCAR(head);
- swap_node(node, head);
- NCAR(node) = head;
- NANCHOR(head)->target = np;
-
- np = node;
- while ((np = NCDR(np)) != NULL_NODE) {
- insert_node = onig_node_new_anchor(anc_type);
- CHECK_NULL_RETURN_MEMERR(insert_node);
- NANCHOR(insert_node)->target = NCAR(np);
- NCAR(np) = insert_node;
- }
-
- if (anc_type == ANCHOR_LOOK_BEHIND_NOT) {
- np = node;
- do {
- SET_NTYPE(np, NT_LIST); /* alt -> list */
- } while ((np = NCDR(np)) != NULL_NODE);
- }
- return 0;
-}
-
-static int
-setup_look_behind(Node* node, regex_t* reg, ScanEnv* env)
-{
- int r, len;
- AnchorNode* an = NANCHOR(node);
-
- r = get_char_length_tree(an->target, reg, &len);
- if (r == 0)
- an->char_len = len;
- else if (r == GET_CHAR_LEN_VARLEN)
- r = ONIGERR_INVALID_LOOK_BEHIND_PATTERN;
- else if (r == GET_CHAR_LEN_TOP_ALT_VARLEN) {
- if (IS_SYNTAX_BV(env->syntax, ONIG_SYN_DIFFERENT_LEN_ALT_LOOK_BEHIND))
- r = divide_look_behind_alternatives(node);
- else
- r = ONIGERR_INVALID_LOOK_BEHIND_PATTERN;
- }
-
- return r;
-}
-
-static int
-next_setup(Node* node, Node* next_node, regex_t* reg)
-{
- int type;
-
- retry:
- type = NTYPE(node);
- if (type == NT_QTFR) {
- QtfrNode* qn = NQTFR(node);
- if (qn->greedy && IS_REPEAT_INFINITE(qn->upper)) {
-#ifdef USE_QTFR_PEEK_NEXT
- Node* n = get_head_value_node(next_node, 1, reg);
- /* '\0': for UTF-16BE etc... */
- if (IS_NOT_NULL(n) && NSTR(n)->s[0] != '\0') {
- qn->next_head_exact = n;
- }
-#endif
- /* automatic posseivation a*b ==> (?>a*)b */
- if (qn->lower <= 1) {
- int ttype = NTYPE(qn->target);
- if (IS_NODE_TYPE_SIMPLE(ttype)) {
- Node *x, *y;
- x = get_head_value_node(qn->target, 0, reg);
- if (IS_NOT_NULL(x)) {
- y = get_head_value_node(next_node, 0, reg);
- if (IS_NOT_NULL(y) && is_not_included(x, y, reg)) {
- Node* en = onig_node_new_enclose(ENCLOSE_STOP_BACKTRACK);
- CHECK_NULL_RETURN_MEMERR(en);
- SET_ENCLOSE_STATUS(en, NST_STOP_BT_SIMPLE_REPEAT);
- swap_node(node, en);
- NENCLOSE(node)->target = en;
- }
- }
- }
- }
- }
- }
- else if (type == NT_ENCLOSE) {
- EncloseNode* en = NENCLOSE(node);
- if (en->type == ENCLOSE_MEMORY) {
- node = en->target;
- goto retry;
- }
- }
- return 0;
-}
-
-
-static int
-update_string_node_case_fold(regex_t* reg, Node *node)
-{
- UChar *p, *q, *end, buf[ONIGENC_MBC_CASE_FOLD_MAXLEN];
- UChar *sbuf, *ebuf, *sp;
- int r, i, len, sbuf_size;
- StrNode* sn = NSTR(node);
-
- end = sn->end;
- sbuf_size = (end - sn->s) * 2;
- sbuf = (UChar* )xmalloc(sbuf_size);
- CHECK_NULL_RETURN_MEMERR(sbuf);
- ebuf = sbuf + sbuf_size;
-
- sp = sbuf;
- p = sn->s;
- while (p < end) {
- len = ONIGENC_MBC_CASE_FOLD(reg->enc, reg->case_fold_flag, &p, end, buf);
- q = buf;
- for (i = 0; i < len; i++) {
- if (sp >= ebuf) {
- sbuf = (UChar* )xrealloc(sbuf, sbuf_size * 2);
- CHECK_NULL_RETURN_MEMERR(sbuf);
- sp = sbuf + sbuf_size;
- sbuf_size *= 2;
- ebuf = sbuf + sbuf_size;
- }
-
- *sp++ = buf[i];
- }
- }
-
- r = onig_node_str_set(node, sbuf, sp);
- if (r != 0) {
- xfree(sbuf);
- return r;
- }
-
- xfree(sbuf);
- return 0;
-}
-
-static int
-expand_case_fold_make_rem_string(Node** rnode, UChar *s, UChar *end,
- regex_t* reg)
-{
- int r;
- Node *node;
-
- node = onig_node_new_str(s, end);
- if (IS_NULL(node)) return ONIGERR_MEMORY;
-
- r = update_string_node_case_fold(reg, node);
- if (r != 0) {
- onig_node_free(node);
- return r;
- }
-
- NSTRING_SET_AMBIG(node);
- NSTRING_SET_DONT_GET_OPT_INFO(node);
- *rnode = node;
- return 0;
-}
-
-static int
-expand_case_fold_string_alt(int item_num, OnigCaseFoldCodeItem items[],
- UChar *p, int slen, UChar *end,
- regex_t* reg, Node **rnode)
-{
- int r, i, j, len, varlen;
- Node *anode, *var_anode, *snode, *xnode, *an;
- UChar buf[ONIGENC_CODE_TO_MBC_MAXLEN];
-
- *rnode = var_anode = NULL_NODE;
-
- varlen = 0;
- for (i = 0; i < item_num; i++) {
- if (items[i].byte_len != slen) {
- varlen = 1;
- break;
- }
- }
-
- if (varlen != 0) {
- *rnode = var_anode = onig_node_new_alt(NULL_NODE, NULL_NODE);
- if (IS_NULL(var_anode)) return ONIGERR_MEMORY;
-
- xnode = onig_node_new_list(NULL, NULL);
- if (IS_NULL(xnode)) goto mem_err;
- NCAR(var_anode) = xnode;
-
- anode = onig_node_new_alt(NULL_NODE, NULL_NODE);
- if (IS_NULL(anode)) goto mem_err;
- NCAR(xnode) = anode;
- }
- else {
- *rnode = anode = onig_node_new_alt(NULL_NODE, NULL_NODE);
- if (IS_NULL(anode)) return ONIGERR_MEMORY;
- }
-
- snode = onig_node_new_str(p, p + slen);
- if (IS_NULL(snode)) goto mem_err;
-
- NCAR(anode) = snode;
-
- for (i = 0; i < item_num; i++) {
- snode = onig_node_new_str(NULL, NULL);
- if (IS_NULL(snode)) goto mem_err;
-
- for (j = 0; j < items[i].code_len; j++) {
- len = ONIGENC_CODE_TO_MBC(reg->enc, items[i].code[j], buf);
- if (len < 0) {
- r = len;
- goto mem_err2;
- }
-
- r = onig_node_str_cat(snode, buf, buf + len);
- if (r != 0) goto mem_err2;
- }
-
- an = onig_node_new_alt(NULL_NODE, NULL_NODE);
- if (IS_NULL(an)) {
- goto mem_err2;
- }
-
- if (items[i].byte_len != slen) {
- Node *rem;
- UChar *q = p + items[i].byte_len;
-
- if (q < end) {
- r = expand_case_fold_make_rem_string(&rem, q, end, reg);
- if (r != 0) {
- onig_node_free(an);
- goto mem_err2;
- }
-
- xnode = onig_node_list_add(NULL_NODE, snode);
- if (IS_NULL(xnode)) {
- onig_node_free(an);
- onig_node_free(rem);
- goto mem_err2;
- }
- if (IS_NULL(onig_node_list_add(xnode, rem))) {
- onig_node_free(an);
- onig_node_free(xnode);
- onig_node_free(rem);
- goto mem_err;
- }
-
- NCAR(an) = xnode;
- }
- else {
- NCAR(an) = snode;
- }
-
- NCDR(var_anode) = an;
- var_anode = an;
- }
- else {
- NCAR(an) = snode;
- NCDR(anode) = an;
- anode = an;
- }
- }
-
- return varlen;
-
- mem_err2:
- onig_node_free(snode);
-
- mem_err:
- onig_node_free(*rnode);
-
- return ONIGERR_MEMORY;
-}
-
-static int
-expand_case_fold_string(Node* node, regex_t* reg)
-{
-#define THRESHOLD_CASE_FOLD_ALT_FOR_EXPANSION 8
-
- int r, n, len, alt_num;
- UChar *start, *end, *p;
- Node *top_root, *root, *snode, *prev_node;
- OnigCaseFoldCodeItem items[ONIGENC_GET_CASE_FOLD_CODES_MAX_NUM];
- StrNode* sn = NSTR(node);
-
- if (NSTRING_IS_AMBIG(node)) return 0;
-
- start = sn->s;
- end = sn->end;
- if (start >= end) return 0;
-
- r = 0;
- top_root = root = prev_node = snode = NULL_NODE;
- alt_num = 1;
- p = start;
- while (p < end) {
- n = ONIGENC_GET_CASE_FOLD_CODES_BY_STR(reg->enc, reg->case_fold_flag,
- p, end, items);
- if (n < 0) {
- r = n;
- goto err;
- }
-
- len = enclen(reg->enc, p, end);
-
- if (n == 0) {
- if (IS_NULL(snode)) {
- if (IS_NULL(root) && IS_NOT_NULL(prev_node)) {
- top_root = root = onig_node_list_add(NULL_NODE, prev_node);
- if (IS_NULL(root)) {
- onig_node_free(prev_node);
- goto mem_err;
- }
- }
-
- prev_node = snode = onig_node_new_str(NULL, NULL);
- if (IS_NULL(snode)) goto mem_err;
- if (IS_NOT_NULL(root)) {
- if (IS_NULL(onig_node_list_add(root, snode))) {
- onig_node_free(snode);
- goto mem_err;
- }
- }
- }
-
- r = onig_node_str_cat(snode, p, p + len);
- if (r != 0) goto err;
- }
- else {
- alt_num *= (n + 1);
- if (alt_num > THRESHOLD_CASE_FOLD_ALT_FOR_EXPANSION) break;
-
- if (IS_NULL(root) && IS_NOT_NULL(prev_node)) {
- top_root = root = onig_node_list_add(NULL_NODE, prev_node);
- if (IS_NULL(root)) {
- onig_node_free(prev_node);
- goto mem_err;
- }
- }
-
- r = expand_case_fold_string_alt(n, items, p, len, end, reg, &prev_node);
- if (r < 0) goto mem_err;
- if (r == 1) {
- if (IS_NULL(root)) {
- top_root = prev_node;
- }
- else {
- if (IS_NULL(onig_node_list_add(root, prev_node))) {
- onig_node_free(prev_node);
- goto mem_err;
- }
- }
-
- root = NCAR(prev_node);
- }
- else { /* r == 0 */
- if (IS_NOT_NULL(root)) {
- if (IS_NULL(onig_node_list_add(root, prev_node))) {
- onig_node_free(prev_node);
- goto mem_err;
- }
- }
- }
-
- snode = NULL_NODE;
- }
-
- p += len;
- }
-
- if (p < end) {
- Node *srem;
-
- r = expand_case_fold_make_rem_string(&srem, p, end, reg);
- if (r != 0) goto mem_err;
-
- if (IS_NOT_NULL(prev_node) && IS_NULL(root)) {
- top_root = root = onig_node_list_add(NULL_NODE, prev_node);
- if (IS_NULL(root)) {
- onig_node_free(srem);
- onig_node_free(prev_node);
- goto mem_err;
- }
- }
-
- if (IS_NULL(root)) {
- prev_node = srem;
- }
- else {
- if (IS_NULL(onig_node_list_add(root, srem))) {
- onig_node_free(srem);
- goto mem_err;
- }
- }
- }
-
- /* ending */
- top_root = (IS_NOT_NULL(top_root) ? top_root : prev_node);
- swap_node(node, top_root);
- onig_node_free(top_root);
- return 0;
-
- mem_err:
- r = ONIGERR_MEMORY;
-
- err:
- onig_node_free(top_root);
- return r;
-}
-
-
-#ifdef USE_COMBINATION_EXPLOSION_CHECK
-
-#define CEC_THRES_NUM_BIG_REPEAT 512
-#define CEC_INFINITE_NUM 0x7fffffff
-
-#define CEC_IN_INFINITE_REPEAT (1<<0)
-#define CEC_IN_FINITE_REPEAT (1<<1)
-#define CEC_CONT_BIG_REPEAT (1<<2)
-
-static int
-setup_comb_exp_check(Node* node, int state, ScanEnv* env)
-{
- int type;
- int r = state;
-
- type = NTYPE(node);
- switch (type) {
- case NT_LIST:
- {
- Node* prev = NULL_NODE;
- do {
- r = setup_comb_exp_check(NCAR(node), r, env);
- prev = NCAR(node);
- } while (r >= 0 && IS_NOT_NULL(node = NCDR(node)));
- }
- break;
-
- case NT_ALT:
- {
- int ret;
- do {
- ret = setup_comb_exp_check(NCAR(node), state, env);
- r |= ret;
- } while (ret >= 0 && IS_NOT_NULL(node = NCDR(node)));
- }
- break;
-
- case NT_QTFR:
- {
- int child_state = state;
- int add_state = 0;
- QtfrNode* qn = NQTFR(node);
- Node* target = qn->target;
- int var_num;
-
- if (! IS_REPEAT_INFINITE(qn->upper)) {
- if (qn->upper > 1) {
- /* {0,1}, {1,1} are allowed */
- child_state |= CEC_IN_FINITE_REPEAT;
-
- /* check (a*){n,m}, (a+){n,m} => (a*){n,n}, (a+){n,n} */
- if (env->backrefed_mem == 0) {
- if (NTYPE(qn->target) == NT_ENCLOSE) {
- EncloseNode* en = NENCLOSE(qn->target);
- if (en->type == ENCLOSE_MEMORY) {
- if (NTYPE(en->target) == NT_QTFR) {
- QtfrNode* q = NQTFR(en->target);
- if (IS_REPEAT_INFINITE(q->upper)
- && q->greedy == qn->greedy) {
- qn->upper = (qn->lower == 0 ? 1 : qn->lower);
- if (qn->upper == 1)
- child_state = state;
- }
- }
- }
- }
- }
- }
- }
-
- if (state & CEC_IN_FINITE_REPEAT) {
- qn->comb_exp_check_num = -1;
- }
- else {
- if (IS_REPEAT_INFINITE(qn->upper)) {
- var_num = CEC_INFINITE_NUM;
- child_state |= CEC_IN_INFINITE_REPEAT;
- }
- else {
- var_num = qn->upper - qn->lower;
- }
-
- if (var_num >= CEC_THRES_NUM_BIG_REPEAT)
- add_state |= CEC_CONT_BIG_REPEAT;
-
- if (((state & CEC_IN_INFINITE_REPEAT) != 0 && var_num != 0) ||
- ((state & CEC_CONT_BIG_REPEAT) != 0 &&
- var_num >= CEC_THRES_NUM_BIG_REPEAT)) {
- if (qn->comb_exp_check_num == 0) {
- env->num_comb_exp_check++;
- qn->comb_exp_check_num = env->num_comb_exp_check;
- if (env->curr_max_regnum > env->comb_exp_max_regnum)
- env->comb_exp_max_regnum = env->curr_max_regnum;
- }
- }
- }
-
- r = setup_comb_exp_check(target, child_state, env);
- r |= add_state;
- }
- break;
-
- case NT_ENCLOSE:
- {
- EncloseNode* en = NENCLOSE(node);
-
- switch (en->type) {
- case ENCLOSE_MEMORY:
- {
- if (env->curr_max_regnum < en->regnum)
- env->curr_max_regnum = en->regnum;
-
- r = setup_comb_exp_check(en->target, state, env);
- }
- break;
-
- default:
- r = setup_comb_exp_check(en->target, state, env);
- break;
- }
- }
- break;
-
-#ifdef USE_SUBEXP_CALL
- case NT_CALL:
- if (IS_CALL_RECURSION(NCALL(node)))
- env->has_recursion = 1;
- else
- r = setup_comb_exp_check(NCALL(node)->target, state, env);
- break;
-#endif
-
- default:
- break;
- }
-
- return r;
-}
-#endif
-
-#define IN_ALT (1<<0)
-#define IN_NOT (1<<1)
-#define IN_REPEAT (1<<2)
-#define IN_VAR_REPEAT (1<<3)
-
-/* setup_tree does the following work.
- 1. check empty loop. (set qn->target_empty_info)
- 2. expand ignore-case in char class.
- 3. set memory status bit flags. (reg->mem_stats)
- 4. set qn->head_exact for [push, exact] -> [push_or_jump_exact1, exact].
- 5. find invalid patterns in look-behind.
- 6. expand repeated string.
- */
-static int
-setup_tree(Node* node, regex_t* reg, int state, ScanEnv* env)
-{
- int type;
- int r = 0;
-
- type = NTYPE(node);
- switch (type) {
- case NT_LIST:
- {
- Node* prev = NULL_NODE;
- do {
- r = setup_tree(NCAR(node), reg, state, env);
- if (IS_NOT_NULL(prev) && r == 0) {
- r = next_setup(prev, NCAR(node), reg);
- }
- prev = NCAR(node);
- } while (r == 0 && IS_NOT_NULL(node = NCDR(node)));
- }
- break;
-
- case NT_ALT:
- do {
- r = setup_tree(NCAR(node), reg, (state | IN_ALT), env);
- } while (r == 0 && IS_NOT_NULL(node = NCDR(node)));
- break;
-
- case NT_CCLASS:
- break;
-
- case NT_STR:
- if (IS_IGNORECASE(reg->options) && !NSTRING_IS_RAW(node)) {
- r = expand_case_fold_string(node, reg);
- }
- break;
-
- case NT_CTYPE:
- case NT_CANY:
- break;
-
-#ifdef USE_SUBEXP_CALL
- case NT_CALL:
- break;
-#endif
-
- case NT_BREF:
- {
- int i;
- int* p;
- Node** nodes = SCANENV_MEM_NODES(env);
- BRefNode* br = NBREF(node);
- p = BACKREFS_P(br);
- for (i = 0; i < br->back_num; i++) {
- if (p[i] > env->num_mem) return ONIGERR_INVALID_BACKREF;
- BIT_STATUS_ON_AT(env->backrefed_mem, p[i]);
- BIT_STATUS_ON_AT(env->bt_mem_start, p[i]);
-#ifdef USE_BACKREF_WITH_LEVEL
- if (IS_BACKREF_NEST_LEVEL(br)) {
- BIT_STATUS_ON_AT(env->bt_mem_end, p[i]);
- }
-#endif
- SET_ENCLOSE_STATUS(nodes[p[i]], NST_MEM_BACKREFED);
- }
- }
- break;
-
- case NT_QTFR:
- {
- OnigDistance d;
- QtfrNode* qn = NQTFR(node);
- Node* target = qn->target;
-
- if ((state & IN_REPEAT) != 0) {
- qn->state |= NST_IN_REPEAT;
- }
-
- if (IS_REPEAT_INFINITE(qn->upper) || qn->upper >= 1) {
- r = get_min_match_length(target, &d, env);
- if (r) break;
- if (d == 0) {
- qn->target_empty_info = NQ_TARGET_IS_EMPTY;
-#ifdef USE_MONOMANIAC_CHECK_CAPTURES_IN_ENDLESS_REPEAT
- r = quantifiers_memory_node_info(target);
- if (r < 0) break;
- if (r > 0) {
- qn->target_empty_info = r;
- }
-#endif
-#if 0
- r = get_max_match_length(target, &d, env);
- if (r == 0 && d == 0) {
- /* ()* ==> ()?, ()+ ==> () */
- qn->upper = 1;
- if (qn->lower > 1) qn->lower = 1;
- if (NTYPE(target) == NT_STR) {
- qn->upper = qn->lower = 0; /* /(?:)+/ ==> // */
- }
- }
-#endif
- }
- }
-
- state |= IN_REPEAT;
- if (qn->lower != qn->upper)
- state |= IN_VAR_REPEAT;
- r = setup_tree(target, reg, state, env);
- if (r) break;
-
- /* expand string */
-#define EXPAND_STRING_MAX_LENGTH 100
- if (NTYPE(target) == NT_STR) {
- if (!IS_REPEAT_INFINITE(qn->lower) && qn->lower == qn->upper &&
- qn->lower > 1 && qn->lower <= EXPAND_STRING_MAX_LENGTH) {
- int len = NSTRING_LEN(target);
- StrNode* sn = NSTR(target);
-
- if (len * qn->lower <= EXPAND_STRING_MAX_LENGTH) {
- int i, n = qn->lower;
- onig_node_conv_to_str_node(node, NSTR(target)->flag);
- for (i = 0; i < n; i++) {
- r = onig_node_str_cat(node, sn->s, sn->end);
- if (r) break;
- }
- onig_node_free(target);
- break; /* break case NT_QTFR: */
- }
- }
- }
-
-#ifdef USE_OP_PUSH_OR_JUMP_EXACT
- if (qn->greedy && (qn->target_empty_info != 0)) {
- if (NTYPE(target) == NT_QTFR) {
- QtfrNode* tqn = NQTFR(target);
- if (IS_NOT_NULL(tqn->head_exact)) {
- qn->head_exact = tqn->head_exact;
- tqn->head_exact = NULL;
- }
- }
- else {
- qn->head_exact = get_head_value_node(qn->target, 1, reg);
- }
- }
-#endif
- }
- break;
-
- case NT_ENCLOSE:
- {
- EncloseNode* en = NENCLOSE(node);
-
- switch (en->type) {
- case ENCLOSE_OPTION:
- {
- OnigOptionType options = reg->options;
- reg->options = NENCLOSE(node)->option;
- r = setup_tree(NENCLOSE(node)->target, reg, state, env);
- reg->options = options;
- }
- break;
-
- case ENCLOSE_MEMORY:
- if ((state & (IN_ALT | IN_NOT | IN_VAR_REPEAT)) != 0) {
- BIT_STATUS_ON_AT(env->bt_mem_start, en->regnum);
- /* SET_ENCLOSE_STATUS(node, NST_MEM_IN_ALT_NOT); */
- }
- r = setup_tree(en->target, reg, state, env);
- break;
-
- case ENCLOSE_STOP_BACKTRACK:
- {
- Node* target = en->target;
- r = setup_tree(target, reg, state, env);
- if (NTYPE(target) == NT_QTFR) {
- QtfrNode* tqn = NQTFR(target);
- if (IS_REPEAT_INFINITE(tqn->upper) && tqn->lower <= 1 &&
- tqn->greedy != 0) { /* (?>a*), a*+ etc... */
- int qtype = NTYPE(tqn->target);
- if (IS_NODE_TYPE_SIMPLE(qtype))
- SET_ENCLOSE_STATUS(node, NST_STOP_BT_SIMPLE_REPEAT);
- }
- }
- }
- break;
- }
- }
- break;
-
- case NT_ANCHOR:
- {
- AnchorNode* an = NANCHOR(node);
-
- switch (an->type) {
- case ANCHOR_PREC_READ:
- r = setup_tree(an->target, reg, state, env);
- break;
- case ANCHOR_PREC_READ_NOT:
- r = setup_tree(an->target, reg, (state | IN_NOT), env);
- break;
-
-/* allowed node types in look-behind */
-#define ALLOWED_TYPE_IN_LB \
- ( BIT_NT_LIST | BIT_NT_ALT | BIT_NT_STR | BIT_NT_CCLASS | BIT_NT_CTYPE | \
- BIT_NT_CANY | BIT_NT_ANCHOR | BIT_NT_ENCLOSE | BIT_NT_QTFR | BIT_NT_CALL )
-
-#define ALLOWED_ENCLOSE_IN_LB ( ENCLOSE_MEMORY )
-#define ALLOWED_ENCLOSE_IN_LB_NOT 0
-
-#define ALLOWED_ANCHOR_IN_LB \
-( ANCHOR_LOOK_BEHIND | ANCHOR_BEGIN_LINE | ANCHOR_END_LINE | ANCHOR_BEGIN_BUF | ANCHOR_BEGIN_POSITION )
-#define ALLOWED_ANCHOR_IN_LB_NOT \
-( ANCHOR_LOOK_BEHIND | ANCHOR_LOOK_BEHIND_NOT | ANCHOR_BEGIN_LINE | ANCHOR_END_LINE | ANCHOR_BEGIN_BUF | ANCHOR_BEGIN_POSITION )
-
- case ANCHOR_LOOK_BEHIND:
- {
- r = check_type_tree(an->target, ALLOWED_TYPE_IN_LB,
- ALLOWED_ENCLOSE_IN_LB, ALLOWED_ANCHOR_IN_LB);
- if (r < 0) return r;
- if (r > 0) return ONIGERR_INVALID_LOOK_BEHIND_PATTERN;
- r = setup_look_behind(node, reg, env);
- if (r != 0) return r;
- r = setup_tree(an->target, reg, state, env);
- }
- break;
-
- case ANCHOR_LOOK_BEHIND_NOT:
- {
- r = check_type_tree(an->target, ALLOWED_TYPE_IN_LB,
- ALLOWED_ENCLOSE_IN_LB_NOT, ALLOWED_ANCHOR_IN_LB_NOT);
- if (r < 0) return r;
- if (r > 0) return ONIGERR_INVALID_LOOK_BEHIND_PATTERN;
- r = setup_look_behind(node, reg, env);
- if (r != 0) return r;
- r = setup_tree(an->target, reg, (state | IN_NOT), env);
- }
- break;
- }
- }
- break;
-
- default:
- break;
- }
-
- return r;
-}
-
-/* set skip map for Boyer-Moor search */
-static int
-set_bm_skip(UChar* s, UChar* end, OnigEncoding enc ARG_UNUSED,
- UChar skip[], int** int_skip)
-{
- int i, len;
-
- len = end - s;
- if (len < ONIG_CHAR_TABLE_SIZE) {
- for (i = 0; i < ONIG_CHAR_TABLE_SIZE; i++) skip[i] = len;
-
- for (i = 0; i < len - 1; i++)
- skip[s[i]] = len - 1 - i;
- }
- else {
- if (IS_NULL(*int_skip)) {
- *int_skip = (int* )xmalloc(sizeof(int) * ONIG_CHAR_TABLE_SIZE);
- if (IS_NULL(*int_skip)) return ONIGERR_MEMORY;
- }
- for (i = 0; i < ONIG_CHAR_TABLE_SIZE; i++) (*int_skip)[i] = len;
-
- for (i = 0; i < len - 1; i++)
- (*int_skip)[s[i]] = len - 1 - i;
- }
- return 0;
-}
-
-#define OPT_EXACT_MAXLEN 24
-
-typedef struct {
- OnigDistance min; /* min byte length */
- OnigDistance max; /* max byte length */
-} MinMaxLen;
-
-typedef struct {
- MinMaxLen mmd;
- OnigEncoding enc;
- OnigOptionType options;
- OnigCaseFoldType case_fold_flag;
- ScanEnv* scan_env;
-} OptEnv;
-
-typedef struct {
- int left_anchor;
- int right_anchor;
-} OptAncInfo;
-
-typedef struct {
- MinMaxLen mmd; /* info position */
- OptAncInfo anc;
-
- int reach_end;
- int ignore_case;
- int len;
- UChar s[OPT_EXACT_MAXLEN];
-} OptExactInfo;
-
-typedef struct {
- MinMaxLen mmd; /* info position */
- OptAncInfo anc;
-
- int value; /* weighted value */
- UChar map[ONIG_CHAR_TABLE_SIZE];
-} OptMapInfo;
-
-typedef struct {
- MinMaxLen len;
-
- OptAncInfo anc;
- OptExactInfo exb; /* boundary */
- OptExactInfo exm; /* middle */
- OptExactInfo expr; /* prec read (?=...) */
-
- OptMapInfo map; /* boundary */
-} NodeOptInfo;
-
-
-static int
-map_position_value(OnigEncoding enc, int i)
-{
- static const short int ByteValTable[] = {
- 5, 1, 1, 1, 1, 1, 1, 1, 1, 10, 10, 1, 1, 10, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 12, 4, 7, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5,
- 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 5, 5,
- 5, 6, 6, 6, 6, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 5, 6, 5, 5, 5,
- 5, 6, 6, 6, 6, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 1
- };
-
- if (i < (int )(sizeof(ByteValTable)/sizeof(ByteValTable[0]))) {
- if (i == 0 && ONIGENC_MBC_MINLEN(enc) > 1)
- return 20;
- else
- return (int )ByteValTable[i];
- }
- else
- return 4; /* Take it easy. */
-}
-
-static int
-distance_value(MinMaxLen* mm)
-{
- /* 1000 / (min-max-dist + 1) */
- static const short int dist_vals[] = {
- 1000, 500, 333, 250, 200, 167, 143, 125, 111, 100,
- 91, 83, 77, 71, 67, 63, 59, 56, 53, 50,
- 48, 45, 43, 42, 40, 38, 37, 36, 34, 33,
- 32, 31, 30, 29, 29, 28, 27, 26, 26, 25,
- 24, 24, 23, 23, 22, 22, 21, 21, 20, 20,
- 20, 19, 19, 19, 18, 18, 18, 17, 17, 17,
- 16, 16, 16, 16, 15, 15, 15, 15, 14, 14,
- 14, 14, 14, 14, 13, 13, 13, 13, 13, 13,
- 12, 12, 12, 12, 12, 12, 11, 11, 11, 11,
- 11, 11, 11, 11, 11, 10, 10, 10, 10, 10
- };
-
- int d;
-
- if (mm->max == ONIG_INFINITE_DISTANCE) return 0;
-
- d = mm->max - mm->min;
- if (d < (int )(sizeof(dist_vals)/sizeof(dist_vals[0])))
- /* return dist_vals[d] * 16 / (mm->min + 12); */
- return (int )dist_vals[d];
- else
- return 1;
-}
-
-static int
-comp_distance_value(MinMaxLen* d1, MinMaxLen* d2, int v1, int v2)
-{
- if (v2 <= 0) return -1;
- if (v1 <= 0) return 1;
-
- v1 *= distance_value(d1);
- v2 *= distance_value(d2);
-
- if (v2 > v1) return 1;
- if (v2 < v1) return -1;
-
- if (d2->min < d1->min) return 1;
- if (d2->min > d1->min) return -1;
- return 0;
-}
-
-static int
-is_equal_mml(MinMaxLen* a, MinMaxLen* b)
-{
- return (a->min == b->min && a->max == b->max) ? 1 : 0;
-}
-
-
-static void
-set_mml(MinMaxLen* mml, OnigDistance min, OnigDistance max)
-{
- mml->min = min;
- mml->max = max;
-}
-
-static void
-clear_mml(MinMaxLen* mml)
-{
- mml->min = mml->max = 0;
-}
-
-static void
-copy_mml(MinMaxLen* to, MinMaxLen* from)
-{
- to->min = from->min;
- to->max = from->max;
-}
-
-static void
-add_mml(MinMaxLen* to, MinMaxLen* from)
-{
- to->min = distance_add(to->min, from->min);
- to->max = distance_add(to->max, from->max);
-}
-
-#if 0
-static void
-add_len_mml(MinMaxLen* to, OnigDistance len)
-{
- to->min = distance_add(to->min, len);
- to->max = distance_add(to->max, len);
-}
-#endif
-
-static void
-alt_merge_mml(MinMaxLen* to, MinMaxLen* from)
-{
- if (to->min > from->min) to->min = from->min;
- if (to->max < from->max) to->max = from->max;
-}
-
-static void
-copy_opt_env(OptEnv* to, OptEnv* from)
-{
- *to = *from;
-}
-
-static void
-clear_opt_anc_info(OptAncInfo* anc)
-{
- anc->left_anchor = 0;
- anc->right_anchor = 0;
-}
-
-static void
-copy_opt_anc_info(OptAncInfo* to, OptAncInfo* from)
-{
- *to = *from;
-}
-
-static void
-concat_opt_anc_info(OptAncInfo* to, OptAncInfo* left, OptAncInfo* right,
- OnigDistance left_len, OnigDistance right_len)
-{
- clear_opt_anc_info(to);
-
- to->left_anchor = left->left_anchor;
- if (left_len == 0) {
- to->left_anchor |= right->left_anchor;
- }
-
- to->right_anchor = right->right_anchor;
- if (right_len == 0) {
- to->right_anchor |= left->right_anchor;
- }
-}
-
-static int
-is_left_anchor(int anc)
-{
- if (anc == ANCHOR_END_BUF || anc == ANCHOR_SEMI_END_BUF ||
- anc == ANCHOR_END_LINE || anc == ANCHOR_PREC_READ ||
- anc == ANCHOR_PREC_READ_NOT)
- return 0;
-
- return 1;
-}
-
-static int
-is_set_opt_anc_info(OptAncInfo* to, int anc)
-{
- if ((to->left_anchor & anc) != 0) return 1;
-
- return ((to->right_anchor & anc) != 0 ? 1 : 0);
-}
-
-static void
-add_opt_anc_info(OptAncInfo* to, int anc)
-{
- if (is_left_anchor(anc))
- to->left_anchor |= anc;
- else
- to->right_anchor |= anc;
-}
-
-static void
-remove_opt_anc_info(OptAncInfo* to, int anc)
-{
- if (is_left_anchor(anc))
- to->left_anchor &= ~anc;
- else
- to->right_anchor &= ~anc;
-}
-
-static void
-alt_merge_opt_anc_info(OptAncInfo* to, OptAncInfo* add)
-{
- to->left_anchor &= add->left_anchor;
- to->right_anchor &= add->right_anchor;
-}
-
-static int
-is_full_opt_exact_info(OptExactInfo* ex)
-{
- return (ex->len >= OPT_EXACT_MAXLEN ? 1 : 0);
-}
-
-static void
-clear_opt_exact_info(OptExactInfo* ex)
-{
- clear_mml(&ex->mmd);
- clear_opt_anc_info(&ex->anc);
- ex->reach_end = 0;
- ex->ignore_case = 0;
- ex->len = 0;
- ex->s[0] = '\0';
-}
-
-static void
-copy_opt_exact_info(OptExactInfo* to, OptExactInfo* from)
-{
- *to = *from;
-}
-
-static void
-concat_opt_exact_info(OptExactInfo* to, OptExactInfo* add, OnigEncoding enc)
-{
- int i, j, len;
- UChar *p, *end;
- OptAncInfo tanc;
-
- if (! to->ignore_case && add->ignore_case) {
- if (to->len >= add->len) return ; /* avoid */
-
- to->ignore_case = 1;
- }
-
- p = add->s;
- end = p + add->len;
- for (i = to->len; p < end; ) {
- len = enclen(enc, p, end);
- if (i + len > OPT_EXACT_MAXLEN) break;
- for (j = 0; j < len && p < end; j++)
- to->s[i++] = *p++;
- }
-
- to->len = i;
- to->reach_end = (p == end ? add->reach_end : 0);
-
- concat_opt_anc_info(&tanc, &to->anc, &add->anc, 1, 1);
- if (! to->reach_end) tanc.right_anchor = 0;
- copy_opt_anc_info(&to->anc, &tanc);
-}
-
-static void
-concat_opt_exact_info_str(OptExactInfo* to, UChar* s, UChar* end,
- int raw ARG_UNUSED, OnigEncoding enc)
-{
- int i, j, len;
- UChar *p;
-
- for (i = to->len, p = s; p < end && i < OPT_EXACT_MAXLEN; ) {
- len = enclen(enc, p, end);
- if (i + len > OPT_EXACT_MAXLEN) break;
- for (j = 0; j < len && p < end; j++)
- to->s[i++] = *p++;
- }
-
- to->len = i;
-}
-
-static void
-alt_merge_opt_exact_info(OptExactInfo* to, OptExactInfo* add, OptEnv* env)
-{
- int i, j, len;
-
- if (add->len == 0 || to->len == 0) {
- clear_opt_exact_info(to);
- return ;
- }
-
- if (! is_equal_mml(&to->mmd, &add->mmd)) {
- clear_opt_exact_info(to);
- return ;
- }
-
- for (i = 0; i < to->len && i < add->len; ) {
- if (to->s[i] != add->s[i]) break;
- len = enclen(env->enc, to->s + i, to->s + to->len);
-
- for (j = 1; j < len; j++) {
- if (to->s[i+j] != add->s[i+j]) break;
- }
- if (j < len) break;
- i += len;
- }
-
- if (! add->reach_end || i < add->len || i < to->len) {
- to->reach_end = 0;
- }
- to->len = i;
- to->ignore_case |= add->ignore_case;
-
- alt_merge_opt_anc_info(&to->anc, &add->anc);
- if (! to->reach_end) to->anc.right_anchor = 0;
-}
-
-static void
-select_opt_exact_info(OnigEncoding enc, OptExactInfo* now, OptExactInfo* alt)
-{
- int v1, v2;
-
- v1 = now->len;
- v2 = alt->len;
-
- if (v2 == 0) {
- return ;
- }
- else if (v1 == 0) {
- copy_opt_exact_info(now, alt);
- return ;
- }
- else if (v1 <= 2 && v2 <= 2) {
- /* ByteValTable[x] is big value --> low price */
- v2 = map_position_value(enc, now->s[0]);
- v1 = map_position_value(enc, alt->s[0]);
-
- if (now->len > 1) v1 += 5;
- if (alt->len > 1) v2 += 5;
- }
-
- if (now->ignore_case == 0) v1 *= 2;
- if (alt->ignore_case == 0) v2 *= 2;
-
- if (comp_distance_value(&now->mmd, &alt->mmd, v1, v2) > 0)
- copy_opt_exact_info(now, alt);
-}
-
-static void
-clear_opt_map_info(OptMapInfo* map)
-{
- static const OptMapInfo clean_info = {
- {0, 0}, {0, 0}, 0,
- {
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
- }
- };
-
- xmemcpy(map, &clean_info, sizeof(OptMapInfo));
-}
-
-static void
-copy_opt_map_info(OptMapInfo* to, OptMapInfo* from)
-{
- *to = *from;
-}
-
-static void
-add_char_opt_map_info(OptMapInfo* map, UChar c, OnigEncoding enc)
-{
- if (map->map[c] == 0) {
- map->map[c] = 1;
- map->value += map_position_value(enc, c);
- }
-}
-
-static int
-add_char_amb_opt_map_info(OptMapInfo* map, UChar* p, UChar* end,
- OnigEncoding enc, OnigCaseFoldType case_fold_flag)
-{
- OnigCaseFoldCodeItem items[ONIGENC_GET_CASE_FOLD_CODES_MAX_NUM];
- UChar buf[ONIGENC_CODE_TO_MBC_MAXLEN];
- int i, n;
-
- add_char_opt_map_info(map, p[0], enc);
-
- case_fold_flag = DISABLE_CASE_FOLD_MULTI_CHAR(case_fold_flag);
- n = ONIGENC_GET_CASE_FOLD_CODES_BY_STR(enc, case_fold_flag, p, end, items);
- if (n < 0) return n;
-
- for (i = 0; i < n; i++) {
- ONIGENC_CODE_TO_MBC(enc, items[i].code[0], buf);
- add_char_opt_map_info(map, buf[0], enc);
- }
-
- return 0;
-}
-
-static void
-select_opt_map_info(OptMapInfo* now, OptMapInfo* alt)
-{
- const int z = 1<<15; /* 32768: something big value */
-
- int v1, v2;
-
- if (alt->value == 0) return ;
- if (now->value == 0) {
- copy_opt_map_info(now, alt);
- return ;
- }
-
- v1 = z / now->value;
- v2 = z / alt->value;
- if (comp_distance_value(&now->mmd, &alt->mmd, v1, v2) > 0)
- copy_opt_map_info(now, alt);
-}
-
-static int
-comp_opt_exact_or_map_info(OptExactInfo* e, OptMapInfo* m)
-{
-#define COMP_EM_BASE 20
- int ve, vm;
-
- if (m->value <= 0) return -1;
-
- ve = COMP_EM_BASE * e->len * (e->ignore_case ? 1 : 2);
- vm = COMP_EM_BASE * 5 * 2 / m->value;
- return comp_distance_value(&e->mmd, &m->mmd, ve, vm);
-}
-
-static void
-alt_merge_opt_map_info(OnigEncoding enc, OptMapInfo* to, OptMapInfo* add)
-{
- int i, val;
-
- /* if (! is_equal_mml(&to->mmd, &add->mmd)) return ; */
- if (to->value == 0) return ;
- if (add->value == 0 || to->mmd.max < add->mmd.min) {
- clear_opt_map_info(to);
- return ;
- }
-
- alt_merge_mml(&to->mmd, &add->mmd);
-
- val = 0;
- for (i = 0; i < ONIG_CHAR_TABLE_SIZE; i++) {
- if (add->map[i])
- to->map[i] = 1;
-
- if (to->map[i])
- val += map_position_value(enc, i);
- }
- to->value = val;
-
- alt_merge_opt_anc_info(&to->anc, &add->anc);
-}
-
-static void
-set_bound_node_opt_info(NodeOptInfo* opt, MinMaxLen* mmd)
-{
- copy_mml(&(opt->exb.mmd), mmd);
- copy_mml(&(opt->expr.mmd), mmd);
- copy_mml(&(opt->map.mmd), mmd);
-}
-
-static void
-clear_node_opt_info(NodeOptInfo* opt)
-{
- clear_mml(&opt->len);
- clear_opt_anc_info(&opt->anc);
- clear_opt_exact_info(&opt->exb);
- clear_opt_exact_info(&opt->exm);
- clear_opt_exact_info(&opt->expr);
- clear_opt_map_info(&opt->map);
-}
-
-static void
-copy_node_opt_info(NodeOptInfo* to, NodeOptInfo* from)
-{
- *to = *from;
-}
-
-static void
-concat_left_node_opt_info(OnigEncoding enc, NodeOptInfo* to, NodeOptInfo* add)
-{
- int exb_reach, exm_reach;
- OptAncInfo tanc;
-
- concat_opt_anc_info(&tanc, &to->anc, &add->anc, to->len.max, add->len.max);
- copy_opt_anc_info(&to->anc, &tanc);
-
- if (add->exb.len > 0 && to->len.max == 0) {
- concat_opt_anc_info(&tanc, &to->anc, &add->exb.anc,
- to->len.max, add->len.max);
- copy_opt_anc_info(&add->exb.anc, &tanc);
- }
-
- if (add->map.value > 0 && to->len.max == 0) {
- if (add->map.mmd.max == 0)
- add->map.anc.left_anchor |= to->anc.left_anchor;
- }
-
- exb_reach = to->exb.reach_end;
- exm_reach = to->exm.reach_end;
-
- if (add->len.max != 0)
- to->exb.reach_end = to->exm.reach_end = 0;
-
- if (add->exb.len > 0) {
- if (exb_reach) {
- concat_opt_exact_info(&to->exb, &add->exb, enc);
- clear_opt_exact_info(&add->exb);
- }
- else if (exm_reach) {
- concat_opt_exact_info(&to->exm, &add->exb, enc);
- clear_opt_exact_info(&add->exb);
- }
- }
- select_opt_exact_info(enc, &to->exm, &add->exb);
- select_opt_exact_info(enc, &to->exm, &add->exm);
-
- if (to->expr.len > 0) {
- if (add->len.max > 0) {
- if (to->expr.len > (int )add->len.max)
- to->expr.len = add->len.max;
-
- if (to->expr.mmd.max == 0)
- select_opt_exact_info(enc, &to->exb, &to->expr);
- else
- select_opt_exact_info(enc, &to->exm, &to->expr);
- }
- }
- else if (add->expr.len > 0) {
- copy_opt_exact_info(&to->expr, &add->expr);
- }
-
- select_opt_map_info(&to->map, &add->map);
-
- add_mml(&to->len, &add->len);
-}
-
-static void
-alt_merge_node_opt_info(NodeOptInfo* to, NodeOptInfo* add, OptEnv* env)
-{
- alt_merge_opt_anc_info (&to->anc, &add->anc);
- alt_merge_opt_exact_info(&to->exb, &add->exb, env);
- alt_merge_opt_exact_info(&to->exm, &add->exm, env);
- alt_merge_opt_exact_info(&to->expr, &add->expr, env);
- alt_merge_opt_map_info(env->enc, &to->map, &add->map);
-
- alt_merge_mml(&to->len, &add->len);
-}
-
-
-#define MAX_NODE_OPT_INFO_REF_COUNT 5
-
-static int
-optimize_node_left(Node* node, NodeOptInfo* opt, OptEnv* env)
-{
- int type;
- int r = 0;
-
- clear_node_opt_info(opt);
- set_bound_node_opt_info(opt, &env->mmd);
-
- type = NTYPE(node);
- switch (type) {
- case NT_LIST:
- {
- OptEnv nenv;
- NodeOptInfo nopt;
- Node* nd = node;
-
- copy_opt_env(&nenv, env);
- do {
- r = optimize_node_left(NCAR(nd), &nopt, &nenv);
- if (r == 0) {
- add_mml(&nenv.mmd, &nopt.len);
- concat_left_node_opt_info(env->enc, opt, &nopt);
- }
- } while (r == 0 && IS_NOT_NULL(nd = NCDR(nd)));
- }
- break;
-
- case NT_ALT:
- {
- NodeOptInfo nopt;
- Node* nd = node;
-
- do {
- r = optimize_node_left(NCAR(nd), &nopt, env);
- if (r == 0) {
- if (nd == node) copy_node_opt_info(opt, &nopt);
- else alt_merge_node_opt_info(opt, &nopt, env);
- }
- } while ((r == 0) && IS_NOT_NULL(nd = NCDR(nd)));
- }
- break;
-
- case NT_STR:
- {
- StrNode* sn = NSTR(node);
- int slen = sn->end - sn->s;
- int is_raw = NSTRING_IS_RAW(node);
-
- if (! NSTRING_IS_AMBIG(node)) {
- concat_opt_exact_info_str(&opt->exb, sn->s, sn->end,
- NSTRING_IS_RAW(node), env->enc);
- if (slen > 0) {
- add_char_opt_map_info(&opt->map, *(sn->s), env->enc);
- }
- set_mml(&opt->len, slen, slen);
- }
- else {
- int max;
-
- if (NSTRING_IS_DONT_GET_OPT_INFO(node)) {
- int n = onigenc_strlen(env->enc, sn->s, sn->end);
- max = ONIGENC_MBC_MAXLEN_DIST(env->enc) * n;
- }
- else {
- concat_opt_exact_info_str(&opt->exb, sn->s, sn->end,
- is_raw, env->enc);
- opt->exb.ignore_case = 1;
-
- if (slen > 0) {
- r = add_char_amb_opt_map_info(&opt->map, sn->s, sn->end,
- env->enc, env->case_fold_flag);
- if (r != 0) break;
- }
-
- max = slen;
- }
-
- set_mml(&opt->len, slen, max);
- }
-
- if (opt->exb.len == slen)
- opt->exb.reach_end = 1;
- }
- break;
-
- case NT_CCLASS:
- {
- int i, z;
- CClassNode* cc = NCCLASS(node);
-
- /* no need to check ignore case. (setted in setup_tree()) */
-
- if (IS_NOT_NULL(cc->mbuf) || IS_NCCLASS_NOT(cc)) {
- OnigDistance min = ONIGENC_MBC_MINLEN(env->enc);
- OnigDistance max = ONIGENC_MBC_MAXLEN_DIST(env->enc);
-
- set_mml(&opt->len, min, max);
- }
- else {
- for (i = 0; i < SINGLE_BYTE_SIZE; i++) {
- z = BITSET_AT(cc->bs, i);
- if ((z && !IS_NCCLASS_NOT(cc)) || (!z && IS_NCCLASS_NOT(cc))) {
- add_char_opt_map_info(&opt->map, (UChar )i, env->enc);
- }
- }
- set_mml(&opt->len, 1, 1);
- }
- }
- break;
-
- case NT_CTYPE:
- {
- int i, min, max;
-
- max = ONIGENC_MBC_MAXLEN_DIST(env->enc);
-
- if (max == 1) {
- min = 1;
-
- switch (NCTYPE(node)->ctype) {
- case ONIGENC_CTYPE_WORD:
- if (NCTYPE(node)->not != 0) {
- for (i = 0; i < SINGLE_BYTE_SIZE; i++) {
- if (! ONIGENC_IS_CODE_WORD(env->enc, i)) {
- add_char_opt_map_info(&opt->map, (UChar )i, env->enc);
- }
- }
- }
- else {
- for (i = 0; i < SINGLE_BYTE_SIZE; i++) {
- if (ONIGENC_IS_CODE_WORD(env->enc, i)) {
- add_char_opt_map_info(&opt->map, (UChar )i, env->enc);
- }
- }
- }
- break;
- }
- }
- else {
- min = ONIGENC_MBC_MINLEN(env->enc);
- }
- set_mml(&opt->len, min, max);
- }
- break;
-
- case NT_CANY:
- {
- OnigDistance min = ONIGENC_MBC_MINLEN(env->enc);
- OnigDistance max = ONIGENC_MBC_MAXLEN_DIST(env->enc);
- set_mml(&opt->len, min, max);
- }
- break;
-
- case NT_ANCHOR:
- switch (NANCHOR(node)->type) {
- case ANCHOR_BEGIN_BUF:
- case ANCHOR_BEGIN_POSITION:
- case ANCHOR_BEGIN_LINE:
- case ANCHOR_END_BUF:
- case ANCHOR_SEMI_END_BUF:
- case ANCHOR_END_LINE:
- add_opt_anc_info(&opt->anc, NANCHOR(node)->type);
- break;
-
- case ANCHOR_PREC_READ:
- {
- NodeOptInfo nopt;
-
- r = optimize_node_left(NANCHOR(node)->target, &nopt, env);
- if (r == 0) {
- if (nopt.exb.len > 0)
- copy_opt_exact_info(&opt->expr, &nopt.exb);
- else if (nopt.exm.len > 0)
- copy_opt_exact_info(&opt->expr, &nopt.exm);
-
- opt->expr.reach_end = 0;
-
- if (nopt.map.value > 0)
- copy_opt_map_info(&opt->map, &nopt.map);
- }
- }
- break;
-
- case ANCHOR_PREC_READ_NOT:
- case ANCHOR_LOOK_BEHIND: /* Sorry, I can't make use of it. */
- case ANCHOR_LOOK_BEHIND_NOT:
- break;
- }
- break;
-
- case NT_BREF:
- {
- int i;
- int* backs;
- OnigDistance min, max, tmin, tmax;
- Node** nodes = SCANENV_MEM_NODES(env->scan_env);
- BRefNode* br = NBREF(node);
-
- if (br->state & NST_RECURSION) {
- set_mml(&opt->len, 0, ONIG_INFINITE_DISTANCE);
- break;
- }
- backs = BACKREFS_P(br);
- r = get_min_match_length(nodes[backs[0]], &min, env->scan_env);
- if (r != 0) break;
- r = get_max_match_length(nodes[backs[0]], &max, env->scan_env);
- if (r != 0) break;
- for (i = 1; i < br->back_num; i++) {
- r = get_min_match_length(nodes[backs[i]], &tmin, env->scan_env);
- if (r != 0) break;
- r = get_max_match_length(nodes[backs[i]], &tmax, env->scan_env);
- if (r != 0) break;
- if (min > tmin) min = tmin;
- if (max < tmax) max = tmax;
- }
- if (r == 0) set_mml(&opt->len, min, max);
- }
- break;
-
-#ifdef USE_SUBEXP_CALL
- case NT_CALL:
- if (IS_CALL_RECURSION(NCALL(node)))
- set_mml(&opt->len, 0, ONIG_INFINITE_DISTANCE);
- else {
- OnigOptionType save = env->options;
- env->options = NENCLOSE(NCALL(node)->target)->option;
- r = optimize_node_left(NCALL(node)->target, opt, env);
- env->options = save;
- }
- break;
-#endif
-
- case NT_QTFR:
- {
- int i;
- OnigDistance min, max;
- NodeOptInfo nopt;
- QtfrNode* qn = NQTFR(node);
-
- r = optimize_node_left(qn->target, &nopt, env);
- if (r) break;
-
- if (qn->lower == 0 && IS_REPEAT_INFINITE(qn->upper)) {
- if (env->mmd.max == 0 &&
- NTYPE(qn->target) == NT_CANY && qn->greedy) {
- if (IS_MULTILINE(env->options))
- add_opt_anc_info(&opt->anc, ANCHOR_ANYCHAR_STAR_ML);
- else
- add_opt_anc_info(&opt->anc, ANCHOR_ANYCHAR_STAR);
- }
- }
- else {
- if (qn->lower > 0) {
- copy_node_opt_info(opt, &nopt);
- if (nopt.exb.len > 0) {
- if (nopt.exb.reach_end) {
- for (i = 2; i < qn->lower &&
- ! is_full_opt_exact_info(&opt->exb); i++) {
- concat_opt_exact_info(&opt->exb, &nopt.exb, env->enc);
- }
- if (i < qn->lower) {
- opt->exb.reach_end = 0;
- }
- }
- }
-
- if (qn->lower != qn->upper) {
- opt->exb.reach_end = 0;
- opt->exm.reach_end = 0;
- }
- if (qn->lower > 1)
- opt->exm.reach_end = 0;
- }
- }
-
- min = distance_multiply(nopt.len.min, qn->lower);
- if (IS_REPEAT_INFINITE(qn->upper))
- max = (nopt.len.max > 0 ? ONIG_INFINITE_DISTANCE : 0);
- else
- max = distance_multiply(nopt.len.max, qn->upper);
-
- set_mml(&opt->len, min, max);
- }
- break;
-
- case NT_ENCLOSE:
- {
- EncloseNode* en = NENCLOSE(node);
-
- switch (en->type) {
- case ENCLOSE_OPTION:
- {
- OnigOptionType save = env->options;
-
- env->options = en->option;
- r = optimize_node_left(en->target, opt, env);
- env->options = save;
- }
- break;
-
- case ENCLOSE_MEMORY:
-#ifdef USE_SUBEXP_CALL
- en->opt_count++;
- if (en->opt_count > MAX_NODE_OPT_INFO_REF_COUNT) {
- OnigDistance min, max;
-
- min = 0;
- max = ONIG_INFINITE_DISTANCE;
- if (IS_ENCLOSE_MIN_FIXED(en)) min = en->min_len;
- if (IS_ENCLOSE_MAX_FIXED(en)) max = en->max_len;
- set_mml(&opt->len, min, max);
- }
- else
-#endif
- {
- r = optimize_node_left(en->target, opt, env);
-
- if (is_set_opt_anc_info(&opt->anc, ANCHOR_ANYCHAR_STAR_MASK)) {
- if (BIT_STATUS_AT(env->scan_env->backrefed_mem, en->regnum))
- remove_opt_anc_info(&opt->anc, ANCHOR_ANYCHAR_STAR_MASK);
- }
- }
- break;
-
- case ENCLOSE_STOP_BACKTRACK:
- r = optimize_node_left(en->target, opt, env);
- break;
- }
- }
- break;
-
- default:
-#ifdef ONIG_DEBUG
- fprintf(stderr, "optimize_node_left: undefined node type %d\n",
- NTYPE(node));
-#endif
- r = ONIGERR_TYPE_BUG;
- break;
- }
-
- return r;
-}
-
-static int
-set_optimize_exact_info(regex_t* reg, OptExactInfo* e)
-{
- int r;
-
- if (e->len == 0) return 0;
-
- if (e->ignore_case) {
- reg->exact = (UChar* )xmalloc(e->len);
- CHECK_NULL_RETURN_MEMERR(reg->exact);
- xmemcpy(reg->exact, e->s, e->len);
- reg->exact_end = reg->exact + e->len;
- reg->optimize = ONIG_OPTIMIZE_EXACT_IC;
- }
- else {
- int allow_reverse;
-
- reg->exact = str_dup(e->s, e->s + e->len);
- CHECK_NULL_RETURN_MEMERR(reg->exact);
- reg->exact_end = reg->exact + e->len;
-
- allow_reverse =
- ONIGENC_IS_ALLOWED_REVERSE_MATCH(reg->enc, reg->exact, reg->exact_end);
-
- if (e->len >= 3 || (e->len >= 2 && allow_reverse)) {
- r = set_bm_skip(reg->exact, reg->exact_end, reg->enc,
- reg->map, &(reg->int_map));
- if (r) return r;
-
- reg->optimize = (allow_reverse != 0
- ? ONIG_OPTIMIZE_EXACT_BM : ONIG_OPTIMIZE_EXACT_BM_NOT_REV);
- }
- else {
- reg->optimize = ONIG_OPTIMIZE_EXACT;
- }
- }
-
- reg->dmin = e->mmd.min;
- reg->dmax = e->mmd.max;
-
- if (reg->dmin != ONIG_INFINITE_DISTANCE) {
- reg->threshold_len = reg->dmin + (reg->exact_end - reg->exact);
- }
-
- return 0;
-}
-
-static void
-set_optimize_map_info(regex_t* reg, OptMapInfo* m)
-{
- int i;
-
- for (i = 0; i < ONIG_CHAR_TABLE_SIZE; i++)
- reg->map[i] = m->map[i];
-
- reg->optimize = ONIG_OPTIMIZE_MAP;
- reg->dmin = m->mmd.min;
- reg->dmax = m->mmd.max;
-
- if (reg->dmin != ONIG_INFINITE_DISTANCE) {
- reg->threshold_len = reg->dmin + 1;
- }
-}
-
-static void
-set_sub_anchor(regex_t* reg, OptAncInfo* anc)
-{
- reg->sub_anchor |= anc->left_anchor & ANCHOR_BEGIN_LINE;
- reg->sub_anchor |= anc->right_anchor & ANCHOR_END_LINE;
-}
-
-#ifdef ONIG_DEBUG
-static void print_optimize_info(FILE* f, regex_t* reg);
-#endif
-
-static int
-set_optimize_info_from_tree(Node* node, regex_t* reg, ScanEnv* scan_env)
-{
-
- int r;
- NodeOptInfo opt;
- OptEnv env;
-
- env.enc = reg->enc;
- env.options = reg->options;
- env.case_fold_flag = reg->case_fold_flag;
- env.scan_env = scan_env;
- clear_mml(&env.mmd);
-
- r = optimize_node_left(node, &opt, &env);
- if (r) return r;
-
- reg->anchor = opt.anc.left_anchor & (ANCHOR_BEGIN_BUF |
- ANCHOR_BEGIN_POSITION | ANCHOR_ANYCHAR_STAR | ANCHOR_ANYCHAR_STAR_ML);
-
- reg->anchor |= opt.anc.right_anchor & (ANCHOR_END_BUF | ANCHOR_SEMI_END_BUF);
-
- if (reg->anchor & (ANCHOR_END_BUF | ANCHOR_SEMI_END_BUF)) {
- reg->anchor_dmin = opt.len.min;
- reg->anchor_dmax = opt.len.max;
- }
-
- if (opt.exb.len > 0 || opt.exm.len > 0) {
- select_opt_exact_info(reg->enc, &opt.exb, &opt.exm);
- if (opt.map.value > 0 &&
- comp_opt_exact_or_map_info(&opt.exb, &opt.map) > 0) {
- goto set_map;
- }
- else {
- r = set_optimize_exact_info(reg, &opt.exb);
- set_sub_anchor(reg, &opt.exb.anc);
- }
- }
- else if (opt.map.value > 0) {
- set_map:
- set_optimize_map_info(reg, &opt.map);
- set_sub_anchor(reg, &opt.map.anc);
- }
- else {
- reg->sub_anchor |= opt.anc.left_anchor & ANCHOR_BEGIN_LINE;
- if (opt.len.max == 0)
- reg->sub_anchor |= opt.anc.right_anchor & ANCHOR_END_LINE;
- }
-
-#if defined(ONIG_DEBUG_COMPILE) || defined(ONIG_DEBUG_MATCH)
- print_optimize_info(stderr, reg);
-#endif
- return r;
-}
-
-static void
-clear_optimize_info(regex_t* reg)
-{
- reg->optimize = ONIG_OPTIMIZE_NONE;
- reg->anchor = 0;
- reg->anchor_dmin = 0;
- reg->anchor_dmax = 0;
- reg->sub_anchor = 0;
- reg->exact_end = (UChar* )NULL;
- reg->threshold_len = 0;
- if (IS_NOT_NULL(reg->exact)) {
- xfree(reg->exact);
- reg->exact = (UChar* )NULL;
- }
-}
-
-#ifdef ONIG_DEBUG
-
-static void print_enc_string(FILE* fp, OnigEncoding enc,
- const UChar *s, const UChar *end)
-{
- fprintf(fp, "\nPATTERN: /");
-
- if (ONIGENC_MBC_MINLEN(enc) > 1) {
- const UChar *p;
- OnigCodePoint code;
-
- p = s;
- while (p < end) {
- code = ONIGENC_MBC_TO_CODE(enc, p, end);
- if (code >= 0x80) {
- fprintf(fp, " 0x%04x ", (int )code);
- }
- else {
- fputc((int )code, fp);
- }
-
- p += enclen(enc, p);
- }
- }
- else {
- while (s < end) {
- fputc((int )*s, fp);
- s++;
- }
- }
-
- fprintf(fp, "/\n");
-}
-
-static void
-print_distance_range(FILE* f, OnigDistance a, OnigDistance b)
-{
- if (a == ONIG_INFINITE_DISTANCE)
- fputs("inf", f);
- else
- fprintf(f, "(%u)", a);
-
- fputs("-", f);
-
- if (b == ONIG_INFINITE_DISTANCE)
- fputs("inf", f);
- else
- fprintf(f, "(%u)", b);
-}
-
-static void
-print_anchor(FILE* f, int anchor)
-{
- int q = 0;
-
- fprintf(f, "[");
-
- if (anchor & ANCHOR_BEGIN_BUF) {
- fprintf(f, "begin-buf");
- q = 1;
- }
- if (anchor & ANCHOR_BEGIN_LINE) {
- if (q) fprintf(f, ", ");
- q = 1;
- fprintf(f, "begin-line");
- }
- if (anchor & ANCHOR_BEGIN_POSITION) {
- if (q) fprintf(f, ", ");
- q = 1;
- fprintf(f, "begin-pos");
- }
- if (anchor & ANCHOR_END_BUF) {
- if (q) fprintf(f, ", ");
- q = 1;
- fprintf(f, "end-buf");
- }
- if (anchor & ANCHOR_SEMI_END_BUF) {
- if (q) fprintf(f, ", ");
- q = 1;
- fprintf(f, "semi-end-buf");
- }
- if (anchor & ANCHOR_END_LINE) {
- if (q) fprintf(f, ", ");
- q = 1;
- fprintf(f, "end-line");
- }
- if (anchor & ANCHOR_ANYCHAR_STAR) {
- if (q) fprintf(f, ", ");
- q = 1;
- fprintf(f, "anychar-star");
- }
- if (anchor & ANCHOR_ANYCHAR_STAR_ML) {
- if (q) fprintf(f, ", ");
- fprintf(f, "anychar-star-pl");
- }
-
- fprintf(f, "]");
-}
-
-static void
-print_optimize_info(FILE* f, regex_t* reg)
-{
- static const char* on[] = { "NONE", "EXACT", "EXACT_BM", "EXACT_BM_NOT_REV",
- "EXACT_IC", "MAP" };
-
- fprintf(f, "optimize: %s\n", on[reg->optimize]);
- fprintf(f, " anchor: "); print_anchor(f, reg->anchor);
- if ((reg->anchor & ANCHOR_END_BUF_MASK) != 0)
- print_distance_range(f, reg->anchor_dmin, reg->anchor_dmax);
- fprintf(f, "\n");
-
- if (reg->optimize) {
- fprintf(f, " sub anchor: "); print_anchor(f, reg->sub_anchor);
- fprintf(f, "\n");
- }
- fprintf(f, "\n");
-
- if (reg->exact) {
- UChar *p;
- fprintf(f, "exact: [");
- for (p = reg->exact; p < reg->exact_end; p++) {
- fputc(*p, f);
- }
- fprintf(f, "]: length: %d\n", (reg->exact_end - reg->exact));
- }
- else if (reg->optimize & ONIG_OPTIMIZE_MAP) {
- int c, i, n = 0;
-
- for (i = 0; i < ONIG_CHAR_TABLE_SIZE; i++)
- if (reg->map[i]) n++;
-
- fprintf(f, "map: n=%d\n", n);
- if (n > 0) {
- c = 0;
- fputc('[', f);
- for (i = 0; i < ONIG_CHAR_TABLE_SIZE; i++) {
- if (reg->map[i] != 0) {
- if (c > 0) fputs(", ", f);
- c++;
- if (ONIGENC_MBC_MAXLEN(reg->enc) == 1 &&
- ONIGENC_IS_CODE_PRINT(reg->enc, (OnigCodePoint )i))
- fputc(i, f);
- else
- fprintf(f, "%d", i);
- }
- }
- fprintf(f, "]\n");
- }
- }
-}
-#endif /* ONIG_DEBUG */
-
-
-static void
-onig_free_body(regex_t* reg)
-{
- if (IS_NOT_NULL(reg->p)) xfree(reg->p);
- if (IS_NOT_NULL(reg->exact)) xfree(reg->exact);
- if (IS_NOT_NULL(reg->int_map)) xfree(reg->int_map);
- if (IS_NOT_NULL(reg->int_map_backward)) xfree(reg->int_map_backward);
- if (IS_NOT_NULL(reg->repeat_range)) xfree(reg->repeat_range);
- if (IS_NOT_NULL(reg->chain)) onig_free(reg->chain);
-
-#ifdef USE_NAMED_GROUP
- onig_names_free(reg);
-#endif
-}
-
-extern void
-onig_free(regex_t* reg)
-{
- if (IS_NOT_NULL(reg)) {
- onig_free_body(reg);
- xfree(reg);
- }
-}
-
-size_t
-onig_memsize(regex_t *reg)
-{
- size_t size = sizeof(regex_t);
- if (IS_NOT_NULL(reg->p)) size += reg->alloc;
- if (IS_NOT_NULL(reg->exact)) size += reg->exact_end - reg->exact;
- if (IS_NOT_NULL(reg->int_map)) size += sizeof(int) * ONIG_CHAR_TABLE_SIZE;
- if (IS_NOT_NULL(reg->int_map_backward)) size += sizeof(int) * ONIG_CHAR_TABLE_SIZE;
- if (IS_NOT_NULL(reg->repeat_range)) size += reg->repeat_range_alloc * sizeof(OnigRepeatRange);
- if (IS_NOT_NULL(reg->chain)) size += onig_memsize(reg->chain);
-
- return size;
-}
-
-#define REGEX_TRANSFER(to,from) do {\
- (to)->state = ONIG_STATE_MODIFY;\
- onig_free_body(to);\
- xmemcpy(to, from, sizeof(regex_t));\
- xfree(from);\
-} while (0)
-
-extern void
-onig_transfer(regex_t* to, regex_t* from)
-{
- THREAD_ATOMIC_START;
- REGEX_TRANSFER(to, from);
- THREAD_ATOMIC_END;
-}
-
-#define REGEX_CHAIN_HEAD(reg) do {\
- while (IS_NOT_NULL((reg)->chain)) {\
- (reg) = (reg)->chain;\
- }\
-} while (0)
-
-extern void
-onig_chain_link_add(regex_t* to, regex_t* add)
-{
- THREAD_ATOMIC_START;
- REGEX_CHAIN_HEAD(to);
- to->chain = add;
- THREAD_ATOMIC_END;
-}
-
-extern void
-onig_chain_reduce(regex_t* reg)
-{
- regex_t *head, *prev;
-
- prev = reg;
- head = prev->chain;
- if (IS_NOT_NULL(head)) {
- reg->state = ONIG_STATE_MODIFY;
- while (IS_NOT_NULL(head->chain)) {
- prev = head;
- head = head->chain;
- }
- prev->chain = (regex_t* )NULL;
- REGEX_TRANSFER(reg, head);
- }
-}
-
-#if 0
-extern int
-onig_clone(regex_t** to, regex_t* from)
-{
- int r, size;
- regex_t* reg;
-
-#ifdef USE_MULTI_THREAD_SYSTEM
- if (ONIG_STATE(from) >= ONIG_STATE_NORMAL) {
- ONIG_STATE_INC(from);
- if (IS_NOT_NULL(from->chain) && ONIG_STATE(reg) == ONIG_STATE_NORMAL) {
- onig_chain_reduce(from);
- ONIG_STATE_INC(from);
- }
- }
- else {
- int n = 0;
- while (ONIG_STATE(from) < ONIG_STATE_NORMAL) {
- if (++n > THREAD_PASS_LIMIT_COUNT)
- return ONIGERR_OVER_THREAD_PASS_LIMIT_COUNT;
- THREAD_PASS;
- }
- ONIG_STATE_INC(from);
- }
-#endif /* USE_MULTI_THREAD_SYSTEM */
-
- r = onig_alloc_init(&reg, ONIG_OPTION_NONE, ONIGENC_CASE_FOLD_DEFAULT,
- from->enc, ONIG_SYNTAX_DEFAULT);
- if (r != 0) {
- ONIG_STATE_DEC(from);
- return r;
- }
-
- xmemcpy(reg, from, sizeof(onig_t));
- reg->chain = (regex_t* )NULL;
- reg->state = ONIG_STATE_NORMAL;
-
- if (from->p) {
- reg->p = (UChar* )xmalloc(reg->alloc);
- if (IS_NULL(reg->p)) goto mem_error;
- xmemcpy(reg->p, from->p, reg->alloc);
- }
-
- if (from->exact) {
- reg->exact = (UChar* )xmalloc(from->exact_end - from->exact);
- if (IS_NULL(reg->exact)) goto mem_error;
- reg->exact_end = reg->exact + (from->exact_end - from->exact);
- xmemcpy(reg->exact, from->exact, reg->exact_end - reg->exact);
- }
-
- if (from->int_map) {
- size = sizeof(int) * ONIG_CHAR_TABLE_SIZE;
- reg->int_map = (int* )xmalloc(size);
- if (IS_NULL(reg->int_map)) goto mem_error;
- xmemcpy(reg->int_map, from->int_map, size);
- }
-
- if (from->int_map_backward) {
- size = sizeof(int) * ONIG_CHAR_TABLE_SIZE;
- reg->int_map_backward = (int* )xmalloc(size);
- if (IS_NULL(reg->int_map_backward)) goto mem_error;
- xmemcpy(reg->int_map_backward, from->int_map_backward, size);
- }
-
-#ifdef USE_NAMED_GROUP
- reg->name_table = names_clone(from); /* names_clone is not implemented */
-#endif
-
- ONIG_STATE_DEC(from);
- *to = reg;
- return 0;
-
- mem_error:
- ONIG_STATE_DEC(from);
- return ONIGERR_MEMORY;
-}
-#endif
-
-#ifdef ONIG_DEBUG
-static void print_compiled_byte_code_list P_((FILE* f, regex_t* reg));
-#endif
-#ifdef ONIG_DEBUG_PARSE_TREE
-static void print_tree P_((FILE* f, Node* node));
-#endif
-
-extern int
-onig_compile(regex_t* reg, const UChar* pattern, const UChar* pattern_end,
- OnigErrorInfo* einfo)
-{
-#define COMPILE_INIT_SIZE 20
-
- int r, init_size;
- Node* root;
- ScanEnv scan_env;
-#ifdef USE_SUBEXP_CALL
- UnsetAddrList uslist;
-#endif
-
- reg->state = ONIG_STATE_COMPILING;
-
-#ifdef ONIG_DEBUG
- print_enc_string(stderr, reg->enc, pattern, pattern_end);
-#endif
-
- if (reg->alloc == 0) {
- init_size = (pattern_end - pattern) * 2;
- if (init_size <= 0) init_size = COMPILE_INIT_SIZE;
- r = BBUF_INIT(reg, init_size);
- if (r != 0) goto end;
- }
- else
- reg->used = 0;
-
- reg->num_mem = 0;
- reg->num_repeat = 0;
- reg->num_null_check = 0;
- reg->repeat_range_alloc = 0;
- reg->repeat_range = (OnigRepeatRange* )NULL;
-#ifdef USE_COMBINATION_EXPLOSION_CHECK
- reg->num_comb_exp_check = 0;
-#endif
-
- r = onig_parse_make_tree(&root, pattern, pattern_end, reg, &scan_env);
- if (r != 0) goto err;
-
-#ifdef USE_NAMED_GROUP
- /* mixed use named group and no-named group */
- if (scan_env.num_named > 0 &&
- IS_SYNTAX_BV(scan_env.syntax, ONIG_SYN_CAPTURE_ONLY_NAMED_GROUP) &&
- !ONIG_IS_OPTION_ON(reg->options, ONIG_OPTION_CAPTURE_GROUP)) {
- if (scan_env.num_named != scan_env.num_mem)
- r = disable_noname_group_capture(&root, reg, &scan_env);
- else
- r = numbered_ref_check(root);
-
- if (r != 0) goto err;
- }
-#endif
-
-#ifdef USE_SUBEXP_CALL
- if (scan_env.num_call > 0) {
- r = unset_addr_list_init(&uslist, scan_env.num_call);
- if (r != 0) goto err;
- scan_env.unset_addr_list = &uslist;
- r = setup_subexp_call(root, &scan_env);
- if (r != 0) goto err_unset;
- r = subexp_recursive_check_trav(root, &scan_env);
- if (r < 0) goto err_unset;
- r = subexp_inf_recursive_check_trav(root, &scan_env);
- if (r != 0) goto err_unset;
-
- reg->num_call = scan_env.num_call;
- }
- else
- reg->num_call = 0;
-#endif
-
- r = setup_tree(root, reg, 0, &scan_env);
- if (r != 0) goto err_unset;
-
-#ifdef ONIG_DEBUG_PARSE_TREE
- print_tree(stderr, root);
-#endif
-
- reg->capture_history = scan_env.capture_history;
- reg->bt_mem_start = scan_env.bt_mem_start;
- reg->bt_mem_start |= reg->capture_history;
- if (IS_FIND_CONDITION(reg->options))
- BIT_STATUS_ON_ALL(reg->bt_mem_end);
- else {
- reg->bt_mem_end = scan_env.bt_mem_end;
- reg->bt_mem_end |= reg->capture_history;
- }
-
-#ifdef USE_COMBINATION_EXPLOSION_CHECK
- if (scan_env.backrefed_mem == 0
-#ifdef USE_SUBEXP_CALL
- || scan_env.num_call == 0
-#endif
- ) {
- setup_comb_exp_check(root, 0, &scan_env);
-#ifdef USE_SUBEXP_CALL
- if (scan_env.has_recursion != 0) {
- scan_env.num_comb_exp_check = 0;
- }
- else
-#endif
- if (scan_env.comb_exp_max_regnum > 0) {
- int i;
- for (i = 1; i <= scan_env.comb_exp_max_regnum; i++) {
- if (BIT_STATUS_AT(scan_env.backrefed_mem, i) != 0) {
- scan_env.num_comb_exp_check = 0;
- break;
- }
- }
- }
- }
-
- reg->num_comb_exp_check = scan_env.num_comb_exp_check;
-#endif
-
- clear_optimize_info(reg);
-#ifndef ONIG_DONT_OPTIMIZE
- r = set_optimize_info_from_tree(root, reg, &scan_env);
- if (r != 0) goto err_unset;
-#endif
-
- if (IS_NOT_NULL(scan_env.mem_nodes_dynamic)) {
- xfree(scan_env.mem_nodes_dynamic);
- scan_env.mem_nodes_dynamic = (Node** )NULL;
- }
-
- r = compile_tree(root, reg);
- if (r == 0) {
- r = add_opcode(reg, OP_END);
-#ifdef USE_SUBEXP_CALL
- if (scan_env.num_call > 0) {
- r = unset_addr_list_fix(&uslist, reg);
- unset_addr_list_end(&uslist);
- if (r) goto err;
- }
-#endif
-
- if ((reg->num_repeat != 0) || (reg->bt_mem_end != 0))
- reg->stack_pop_level = STACK_POP_LEVEL_ALL;
- else {
- if (reg->bt_mem_start != 0)
- reg->stack_pop_level = STACK_POP_LEVEL_MEM_START;
- else
- reg->stack_pop_level = STACK_POP_LEVEL_FREE;
- }
- }
-#ifdef USE_SUBEXP_CALL
- else if (scan_env.num_call > 0) {
- unset_addr_list_end(&uslist);
- }
-#endif
- onig_node_free(root);
-
-#ifdef ONIG_DEBUG_COMPILE
-#ifdef USE_NAMED_GROUP
- onig_print_names(stderr, reg);
-#endif
- print_compiled_byte_code_list(stderr, reg);
-#endif
-
- end:
- reg->state = ONIG_STATE_NORMAL;
- return r;
-
- err_unset:
-#ifdef USE_SUBEXP_CALL
- if (scan_env.num_call > 0) {
- unset_addr_list_end(&uslist);
- }
-#endif
- err:
- if (IS_NOT_NULL(scan_env.error)) {
- if (IS_NOT_NULL(einfo)) {
- einfo->enc = scan_env.enc;
- einfo->par = scan_env.error;
- einfo->par_end = scan_env.error_end;
- }
- }
-
- onig_node_free(root);
- if (IS_NOT_NULL(scan_env.mem_nodes_dynamic))
- xfree(scan_env.mem_nodes_dynamic);
- return r;
-}
-
-#ifdef USE_RECOMPILE_API
-extern int
-onig_recompile(regex_t* reg, const UChar* pattern, const UChar* pattern_end,
- OnigOptionType option, OnigEncoding enc, OnigSyntaxType* syntax,
- OnigErrorInfo* einfo)
-{
- int r;
- regex_t *new_reg;
-
- r = onig_new(&new_reg, pattern, pattern_end, option, enc, syntax, einfo);
- if (r) return r;
- if (ONIG_STATE(reg) == ONIG_STATE_NORMAL) {
- onig_transfer(reg, new_reg);
- }
- else {
- onig_chain_link_add(reg, new_reg);
- }
- return 0;
-}
-#endif
-
-static int onig_inited = 0;
-
-extern int
-onig_alloc_init(regex_t** reg, OnigOptionType option,
- OnigCaseFoldType case_fold_flag,
- OnigEncoding enc, const OnigSyntaxType* syntax)
-{
- if (! onig_inited)
- onig_init();
-
- if (ONIGENC_IS_UNDEF(enc))
- return ONIGERR_DEFAULT_ENCODING_IS_NOT_SETTED;
-
- if ((option & (ONIG_OPTION_DONT_CAPTURE_GROUP|ONIG_OPTION_CAPTURE_GROUP))
- == (ONIG_OPTION_DONT_CAPTURE_GROUP|ONIG_OPTION_CAPTURE_GROUP)) {
- return ONIGERR_INVALID_COMBINATION_OF_OPTIONS;
- }
-
- *reg = (regex_t* )xmalloc(sizeof(regex_t));
- if (IS_NULL(*reg)) return ONIGERR_MEMORY;
- (*reg)->state = ONIG_STATE_MODIFY;
-
- if ((option & ONIG_OPTION_NEGATE_SINGLELINE) != 0) {
- option |= syntax->options;
- option &= ~ONIG_OPTION_SINGLELINE;
- }
- else
- option |= syntax->options;
-
- (*reg)->enc = enc;
- (*reg)->options = option;
- (*reg)->syntax = syntax;
- (*reg)->optimize = 0;
- (*reg)->exact = (UChar* )NULL;
- (*reg)->int_map = (int* )NULL;
- (*reg)->int_map_backward = (int* )NULL;
- (*reg)->chain = (regex_t* )NULL;
-
- (*reg)->p = (UChar* )NULL;
- (*reg)->alloc = 0;
- (*reg)->used = 0;
- (*reg)->name_table = (void* )NULL;
-
- (*reg)->case_fold_flag = case_fold_flag;
- return 0;
-}
-
-extern int
-onig_new(regex_t** reg, const UChar* pattern, const UChar* pattern_end,
- OnigOptionType option, OnigEncoding enc, const OnigSyntaxType* syntax,
- OnigErrorInfo* einfo)
-{
- int r;
-
- if (IS_NOT_NULL(einfo)) einfo->par = (UChar* )NULL;
-
- r = onig_alloc_init(reg, option, ONIGENC_CASE_FOLD_DEFAULT,
- enc, syntax);
- if (r) return r;
-
- r = onig_compile(*reg, pattern, pattern_end, einfo);
- if (r) {
- onig_free(*reg);
- *reg = NULL;
- }
- return r;
-}
-
-extern int
-onig_init(void)
-{
- if (onig_inited != 0)
- return 0;
-
- THREAD_SYSTEM_INIT;
- THREAD_ATOMIC_START;
-
- onig_inited = 1;
-
- onigenc_init();
- /* onigenc_set_default_caseconv_table((UChar* )0); */
-
-#ifdef ONIG_DEBUG_STATISTICS
- onig_statistics_init();
-#endif
-
- THREAD_ATOMIC_END;
- return 0;
-}
-
-
-extern int
-onig_end(void)
-{
- THREAD_ATOMIC_START;
-
-#ifdef ONIG_DEBUG_STATISTICS
- onig_print_statistics(stderr);
-#endif
-
-#ifdef USE_SHARED_CCLASS_TABLE
- onig_free_shared_cclass_table();
-#endif
-
-#ifdef USE_PARSE_TREE_NODE_RECYCLE
- onig_free_node_list();
-#endif
-
- onig_inited = 0;
-
- THREAD_ATOMIC_END;
- THREAD_SYSTEM_END;
- return 0;
-}
-
-extern int
-onig_is_in_code_range(const UChar* p, OnigCodePoint code)
-{
- OnigCodePoint n, *data;
- OnigCodePoint low, high, x;
-
- GET_CODE_POINT(n, p);
- data = (OnigCodePoint* )p;
- data++;
-
- for (low = 0, high = n; low < high; ) {
- x = (low + high) >> 1;
- if (code > data[x * 2 + 1])
- low = x + 1;
- else
- high = x;
- }
-
- return ((low < n && code >= data[low * 2]) ? 1 : 0);
-}
-
-extern int
-onig_is_code_in_cc_len(int elen, OnigCodePoint code, CClassNode* cc)
-{
- int found;
-
- if (elen > 1 || (code >= SINGLE_BYTE_SIZE)) {
- if (IS_NULL(cc->mbuf)) {
- found = 0;
- }
- else {
- found = (onig_is_in_code_range(cc->mbuf->p, code) != 0 ? 1 : 0);
- }
- }
- else {
- found = (BITSET_AT(cc->bs, code) == 0 ? 0 : 1);
- }
-
- if (IS_NCCLASS_NOT(cc))
- return !found;
- else
- return found;
-}
-
-extern int
-onig_is_code_in_cc(OnigEncoding enc, OnigCodePoint code, CClassNode* cc)
-{
- int len;
-
- if (ONIGENC_MBC_MINLEN(enc) > 1) {
- len = 2;
- }
- else {
- len = ONIGENC_CODE_TO_MBCLEN(enc, code);
- }
- return onig_is_code_in_cc_len(len, code, cc);
-}
-
-
-#ifdef ONIG_DEBUG
-
-/* arguments type */
-#define ARG_SPECIAL -1
-#define ARG_NON 0
-#define ARG_RELADDR 1
-#define ARG_ABSADDR 2
-#define ARG_LENGTH 3
-#define ARG_MEMNUM 4
-#define ARG_OPTION 5
-#define ARG_STATE_CHECK 6
-
-OnigOpInfoType OnigOpInfo[] = {
- { OP_FINISH, "finish", ARG_NON },
- { OP_END, "end", ARG_NON },
- { OP_EXACT1, "exact1", ARG_SPECIAL },
- { OP_EXACT2, "exact2", ARG_SPECIAL },
- { OP_EXACT3, "exact3", ARG_SPECIAL },
- { OP_EXACT4, "exact4", ARG_SPECIAL },
- { OP_EXACT5, "exact5", ARG_SPECIAL },
- { OP_EXACTN, "exactn", ARG_SPECIAL },
- { OP_EXACTMB2N1, "exactmb2-n1", ARG_SPECIAL },
- { OP_EXACTMB2N2, "exactmb2-n2", ARG_SPECIAL },
- { OP_EXACTMB2N3, "exactmb2-n3", ARG_SPECIAL },
- { OP_EXACTMB2N, "exactmb2-n", ARG_SPECIAL },
- { OP_EXACTMB3N, "exactmb3n" , ARG_SPECIAL },
- { OP_EXACTMBN, "exactmbn", ARG_SPECIAL },
- { OP_EXACT1_IC, "exact1-ic", ARG_SPECIAL },
- { OP_EXACTN_IC, "exactn-ic", ARG_SPECIAL },
- { OP_CCLASS, "cclass", ARG_SPECIAL },
- { OP_CCLASS_MB, "cclass-mb", ARG_SPECIAL },
- { OP_CCLASS_MIX, "cclass-mix", ARG_SPECIAL },
- { OP_CCLASS_NOT, "cclass-not", ARG_SPECIAL },
- { OP_CCLASS_MB_NOT, "cclass-mb-not", ARG_SPECIAL },
- { OP_CCLASS_MIX_NOT, "cclass-mix-not", ARG_SPECIAL },
- { OP_CCLASS_NODE, "cclass-node", ARG_SPECIAL },
- { OP_ANYCHAR, "anychar", ARG_NON },
- { OP_ANYCHAR_ML, "anychar-ml", ARG_NON },
- { OP_ANYCHAR_STAR, "anychar*", ARG_NON },
- { OP_ANYCHAR_ML_STAR, "anychar-ml*", ARG_NON },
- { OP_ANYCHAR_STAR_PEEK_NEXT, "anychar*-peek-next", ARG_SPECIAL },
- { OP_ANYCHAR_ML_STAR_PEEK_NEXT, "anychar-ml*-peek-next", ARG_SPECIAL },
- { OP_WORD, "word", ARG_NON },
- { OP_NOT_WORD, "not-word", ARG_NON },
- { OP_WORD_BOUND, "word-bound", ARG_NON },
- { OP_NOT_WORD_BOUND, "not-word-bound", ARG_NON },
- { OP_WORD_BEGIN, "word-begin", ARG_NON },
- { OP_WORD_END, "word-end", ARG_NON },
- { OP_BEGIN_BUF, "begin-buf", ARG_NON },
- { OP_END_BUF, "end-buf", ARG_NON },
- { OP_BEGIN_LINE, "begin-line", ARG_NON },
- { OP_END_LINE, "end-line", ARG_NON },
- { OP_SEMI_END_BUF, "semi-end-buf", ARG_NON },
- { OP_BEGIN_POSITION, "begin-position", ARG_NON },
- { OP_BACKREF1, "backref1", ARG_NON },
- { OP_BACKREF2, "backref2", ARG_NON },
- { OP_BACKREFN, "backrefn", ARG_MEMNUM },
- { OP_BACKREFN_IC, "backrefn-ic", ARG_SPECIAL },
- { OP_BACKREF_MULTI, "backref_multi", ARG_SPECIAL },
- { OP_BACKREF_MULTI_IC, "backref_multi-ic", ARG_SPECIAL },
- { OP_BACKREF_WITH_LEVEL, "backref_at_level", ARG_SPECIAL },
- { OP_MEMORY_START_PUSH, "mem-start-push", ARG_MEMNUM },
- { OP_MEMORY_START, "mem-start", ARG_MEMNUM },
- { OP_MEMORY_END_PUSH, "mem-end-push", ARG_MEMNUM },
- { OP_MEMORY_END_PUSH_REC, "mem-end-push-rec", ARG_MEMNUM },
- { OP_MEMORY_END, "mem-end", ARG_MEMNUM },
- { OP_MEMORY_END_REC, "mem-end-rec", ARG_MEMNUM },
- { OP_SET_OPTION_PUSH, "set-option-push", ARG_OPTION },
- { OP_SET_OPTION, "set-option", ARG_OPTION },
- { OP_FAIL, "fail", ARG_NON },
- { OP_JUMP, "jump", ARG_RELADDR },
- { OP_PUSH, "push", ARG_RELADDR },
- { OP_POP, "pop", ARG_NON },
- { OP_PUSH_OR_JUMP_EXACT1, "push-or-jump-e1", ARG_SPECIAL },
- { OP_PUSH_IF_PEEK_NEXT, "push-if-peek-next", ARG_SPECIAL },
- { OP_REPEAT, "repeat", ARG_SPECIAL },
- { OP_REPEAT_NG, "repeat-ng", ARG_SPECIAL },
- { OP_REPEAT_INC, "repeat-inc", ARG_MEMNUM },
- { OP_REPEAT_INC_NG, "repeat-inc-ng", ARG_MEMNUM },
- { OP_REPEAT_INC_SG, "repeat-inc-sg", ARG_MEMNUM },
- { OP_REPEAT_INC_NG_SG, "repeat-inc-ng-sg", ARG_MEMNUM },
- { OP_NULL_CHECK_START, "null-check-start", ARG_MEMNUM },
- { OP_NULL_CHECK_END, "null-check-end", ARG_MEMNUM },
- { OP_NULL_CHECK_END_MEMST,"null-check-end-memst", ARG_MEMNUM },
- { OP_NULL_CHECK_END_MEMST_PUSH,"null-check-end-memst-push", ARG_MEMNUM },
- { OP_PUSH_POS, "push-pos", ARG_NON },
- { OP_POP_POS, "pop-pos", ARG_NON },
- { OP_PUSH_POS_NOT, "push-pos-not", ARG_RELADDR },
- { OP_FAIL_POS, "fail-pos", ARG_NON },
- { OP_PUSH_STOP_BT, "push-stop-bt", ARG_NON },
- { OP_POP_STOP_BT, "pop-stop-bt", ARG_NON },
- { OP_LOOK_BEHIND, "look-behind", ARG_SPECIAL },
- { OP_PUSH_LOOK_BEHIND_NOT, "push-look-behind-not", ARG_SPECIAL },
- { OP_FAIL_LOOK_BEHIND_NOT, "fail-look-behind-not", ARG_NON },
- { OP_CALL, "call", ARG_ABSADDR },
- { OP_RETURN, "return", ARG_NON },
- { OP_STATE_CHECK_PUSH, "state-check-push", ARG_SPECIAL },
- { OP_STATE_CHECK_PUSH_OR_JUMP, "state-check-push-or-jump", ARG_SPECIAL },
- { OP_STATE_CHECK, "state-check", ARG_STATE_CHECK },
- { OP_STATE_CHECK_ANYCHAR_STAR, "state-check-anychar*", ARG_STATE_CHECK },
- { OP_STATE_CHECK_ANYCHAR_ML_STAR,
- "state-check-anychar-ml*", ARG_STATE_CHECK },
- { -1, "", ARG_NON }
-};
-
-static char*
-op2name(int opcode)
-{
- int i;
-
- for (i = 0; OnigOpInfo[i].opcode >= 0; i++) {
- if (opcode == OnigOpInfo[i].opcode)
- return OnigOpInfo[i].name;
- }
- return "";
-}
-
-static int
-op2arg_type(int opcode)
-{
- int i;
-
- for (i = 0; OnigOpInfo[i].opcode >= 0; i++) {
- if (opcode == OnigOpInfo[i].opcode)
- return OnigOpInfo[i].arg_type;
- }
- return ARG_SPECIAL;
-}
-
-static void
-Indent(FILE* f, int indent)
-{
- int i;
- for (i = 0; i < indent; i++) putc(' ', f);
-}
-
-static void
-p_string(FILE* f, int len, UChar* s)
-{
- fputs(":", f);
- while (len-- > 0) { fputc(*s++, f); }
-}
-
-static void
-p_len_string(FILE* f, LengthType len, int mb_len, UChar* s)
-{
- int x = len * mb_len;
-
- fprintf(f, ":%d:", len);
- while (x-- > 0) { fputc(*s++, f); }
-}
-
-extern void
-onig_print_compiled_byte_code(FILE* f, UChar* bp, UChar** nextp,
- OnigEncoding enc)
-{
- int i, n, arg_type;
- RelAddrType addr;
- LengthType len;
- MemNumType mem;
- StateCheckNumType scn;
- OnigCodePoint code;
- UChar *q;
-
- fprintf(f, "[%s", op2name(*bp));
- arg_type = op2arg_type(*bp);
- if (arg_type != ARG_SPECIAL) {
- bp++;
- switch (arg_type) {
- case ARG_NON:
- break;
- case ARG_RELADDR:
- GET_RELADDR_INC(addr, bp);
- fprintf(f, ":(%d)", addr);
- break;
- case ARG_ABSADDR:
- GET_ABSADDR_INC(addr, bp);
- fprintf(f, ":(%d)", addr);
- break;
- case ARG_LENGTH:
- GET_LENGTH_INC(len, bp);
- fprintf(f, ":%d", len);
- break;
- case ARG_MEMNUM:
- mem = *((MemNumType* )bp);
- bp += SIZE_MEMNUM;
- fprintf(f, ":%d", mem);
- break;
- case ARG_OPTION:
- {
- OnigOptionType option = *((OnigOptionType* )bp);
- bp += SIZE_OPTION;
- fprintf(f, ":%d", option);
- }
- break;
-
- case ARG_STATE_CHECK:
- scn = *((StateCheckNumType* )bp);
- bp += SIZE_STATE_CHECK_NUM;
- fprintf(f, ":%d", scn);
- break;
- }
- }
- else {
- switch (*bp++) {
- case OP_EXACT1:
- case OP_ANYCHAR_STAR_PEEK_NEXT:
- case OP_ANYCHAR_ML_STAR_PEEK_NEXT:
- p_string(f, 1, bp++); break;
- case OP_EXACT2:
- p_string(f, 2, bp); bp += 2; break;
- case OP_EXACT3:
- p_string(f, 3, bp); bp += 3; break;
- case OP_EXACT4:
- p_string(f, 4, bp); bp += 4; break;
- case OP_EXACT5:
- p_string(f, 5, bp); bp += 5; break;
- case OP_EXACTN:
- GET_LENGTH_INC(len, bp);
- p_len_string(f, len, 1, bp);
- bp += len;
- break;
-
- case OP_EXACTMB2N1:
- p_string(f, 2, bp); bp += 2; break;
- case OP_EXACTMB2N2:
- p_string(f, 4, bp); bp += 4; break;
- case OP_EXACTMB2N3:
- p_string(f, 6, bp); bp += 6; break;
- case OP_EXACTMB2N:
- GET_LENGTH_INC(len, bp);
- p_len_string(f, len, 2, bp);
- bp += len * 2;
- break;
- case OP_EXACTMB3N:
- GET_LENGTH_INC(len, bp);
- p_len_string(f, len, 3, bp);
- bp += len * 3;
- break;
- case OP_EXACTMBN:
- {
- int mb_len;
-
- GET_LENGTH_INC(mb_len, bp);
- GET_LENGTH_INC(len, bp);
- fprintf(f, ":%d:%d:", mb_len, len);
- n = len * mb_len;
- while (n-- > 0) { fputc(*bp++, f); }
- }
- break;
-
- case OP_EXACT1_IC:
- len = enclen(enc, bp);
- p_string(f, len, bp);
- bp += len;
- break;
- case OP_EXACTN_IC:
- GET_LENGTH_INC(len, bp);
- p_len_string(f, len, 1, bp);
- bp += len;
- break;
-
- case OP_CCLASS:
- n = bitset_on_num((BitSetRef )bp);
- bp += SIZE_BITSET;
- fprintf(f, ":%d", n);
- break;
-
- case OP_CCLASS_NOT:
- n = bitset_on_num((BitSetRef )bp);
- bp += SIZE_BITSET;
- fprintf(f, ":%d", n);
- break;
-
- case OP_CCLASS_MB:
- case OP_CCLASS_MB_NOT:
- GET_LENGTH_INC(len, bp);
- q = bp;
-#ifndef PLATFORM_UNALIGNED_WORD_ACCESS
- ALIGNMENT_RIGHT(q);
-#endif
- GET_CODE_POINT(code, q);
- bp += len;
- fprintf(f, ":%d:%d", (int )code, len);
- break;
-
- case OP_CCLASS_MIX:
- case OP_CCLASS_MIX_NOT:
- n = bitset_on_num((BitSetRef )bp);
- bp += SIZE_BITSET;
- GET_LENGTH_INC(len, bp);
- q = bp;
-#ifndef PLATFORM_UNALIGNED_WORD_ACCESS
- ALIGNMENT_RIGHT(q);
-#endif
- GET_CODE_POINT(code, q);
- bp += len;
- fprintf(f, ":%d:%d:%d", n, (int )code, len);
- break;
-
- case OP_CCLASS_NODE:
- {
- CClassNode *cc;
-
- GET_POINTER_INC(cc, bp);
- n = bitset_on_num(cc->bs);
- fprintf(f, ":%u:%d", (unsigned int )cc, n);
- }
- break;
-
- case OP_BACKREFN_IC:
- mem = *((MemNumType* )bp);
- bp += SIZE_MEMNUM;
- fprintf(f, ":%d", mem);
- break;
-
- case OP_BACKREF_MULTI_IC:
- case OP_BACKREF_MULTI:
- fputs(" ", f);
- GET_LENGTH_INC(len, bp);
- for (i = 0; i < len; i++) {
- GET_MEMNUM_INC(mem, bp);
- if (i > 0) fputs(", ", f);
- fprintf(f, "%d", mem);
- }
- break;
-
- case OP_BACKREF_WITH_LEVEL:
- {
- OnigOptionType option;
- LengthType level;
-
- GET_OPTION_INC(option, bp);
- fprintf(f, ":%d", option);
- GET_LENGTH_INC(level, bp);
- fprintf(f, ":%d", level);
-
- fputs(" ", f);
- GET_LENGTH_INC(len, bp);
- for (i = 0; i < len; i++) {
- GET_MEMNUM_INC(mem, bp);
- if (i > 0) fputs(", ", f);
- fprintf(f, "%d", mem);
- }
- }
- break;
-
- case OP_REPEAT:
- case OP_REPEAT_NG:
- {
- mem = *((MemNumType* )bp);
- bp += SIZE_MEMNUM;
- addr = *((RelAddrType* )bp);
- bp += SIZE_RELADDR;
- fprintf(f, ":%d:%d", mem, addr);
- }
- break;
-
- case OP_PUSH_OR_JUMP_EXACT1:
- case OP_PUSH_IF_PEEK_NEXT:
- addr = *((RelAddrType* )bp);
- bp += SIZE_RELADDR;
- fprintf(f, ":(%d)", addr);
- p_string(f, 1, bp);
- bp += 1;
- break;
-
- case OP_LOOK_BEHIND:
- GET_LENGTH_INC(len, bp);
- fprintf(f, ":%d", len);
- break;
-
- case OP_PUSH_LOOK_BEHIND_NOT:
- GET_RELADDR_INC(addr, bp);
- GET_LENGTH_INC(len, bp);
- fprintf(f, ":%d:(%d)", len, addr);
- break;
-
- case OP_STATE_CHECK_PUSH:
- case OP_STATE_CHECK_PUSH_OR_JUMP:
- scn = *((StateCheckNumType* )bp);
- bp += SIZE_STATE_CHECK_NUM;
- addr = *((RelAddrType* )bp);
- bp += SIZE_RELADDR;
- fprintf(f, ":%d:(%d)", scn, addr);
- break;
-
- default:
- fprintf(stderr, "onig_print_compiled_byte_code: undefined code %d\n",
- *--bp);
- }
- }
- fputs("]", f);
- if (nextp) *nextp = bp;
-}
-
-static void
-print_compiled_byte_code_list(FILE* f, regex_t* reg)
-{
- int ncode;
- UChar* bp = reg->p;
- UChar* end = reg->p + reg->used;
-
- fprintf(f, "code length: %d\n", reg->used);
-
- ncode = 0;
- while (bp < end) {
- ncode++;
- if (bp > reg->p) {
- if (ncode % 5 == 0)
- fprintf(f, "\n");
- else
- fputs(" ", f);
- }
- onig_print_compiled_byte_code(f, bp, &bp, reg->enc);
- }
-
- fprintf(f, "\n");
-}
-
-static void
-print_indent_tree(FILE* f, Node* node, int indent)
-{
- int i, type;
- int add = 3;
- UChar* p;
-
- Indent(f, indent);
- if (IS_NULL(node)) {
- fprintf(f, "ERROR: null node!!!\n");
- exit (0);
- }
-
- type = NTYPE(node);
- switch (type) {
- case NT_LIST:
- case NT_ALT:
- if (NTYPE(node) == NT_LIST)
- fprintf(f, "<list:%x>\n", (int )node);
- else
- fprintf(f, "<alt:%x>\n", (int )node);
-
- print_indent_tree(f, NCAR(node), indent + add);
- while (IS_NOT_NULL(node = NCDR(node))) {
- if (NTYPE(node) != type) {
- fprintf(f, "ERROR: list/alt right is not a cons. %d\n", NTYPE(node));
- exit(0);
- }
- print_indent_tree(f, NCAR(node), indent + add);
- }
- break;
-
- case NT_STR:
- fprintf(f, "<string%s:%x>",
- (NSTRING_IS_RAW(node) ? "-raw" : ""), (int )node);
- for (p = NSTR(node)->s; p < NSTR(node)->end; p++) {
- if (*p >= 0x20 && *p < 0x7f)
- fputc(*p, f);
- else {
- fprintf(f, " 0x%02x", *p);
- }
- }
- break;
-
- case NT_CCLASS:
- fprintf(f, "<cclass:%x>", (int )node);
- if (IS_NCCLASS_NOT(NCCLASS(node))) fputs(" not", f);
- if (NCCLASS(node)->mbuf) {
- BBuf* bbuf = NCCLASS(node)->mbuf;
- for (i = 0; i < bbuf->used; i++) {
- if (i > 0) fprintf(f, ",");
- fprintf(f, "%0x", bbuf->p[i]);
- }
- }
- break;
-
- case NT_CTYPE:
- fprintf(f, "<ctype:%x> ", (int )node);
- switch (NCTYPE(node)->ctype) {
- case ONIGENC_CTYPE_WORD:
- if (NCTYPE(node)->not != 0)
- fputs("not word", f);
- else
- fputs("word", f);
- break;
-
- default:
- fprintf(f, "ERROR: undefined ctype.\n");
- exit(0);
- }
- break;
-
- case NT_CANY:
- fprintf(f, "<anychar:%x>", (int )node);
- break;
-
- case NT_ANCHOR:
- fprintf(f, "<anchor:%x> ", (int )node);
- switch (NANCHOR(node)->type) {
- case ANCHOR_BEGIN_BUF: fputs("begin buf", f); break;
- case ANCHOR_END_BUF: fputs("end buf", f); break;
- case ANCHOR_BEGIN_LINE: fputs("begin line", f); break;
- case ANCHOR_END_LINE: fputs("end line", f); break;
- case ANCHOR_SEMI_END_BUF: fputs("semi end buf", f); break;
- case ANCHOR_BEGIN_POSITION: fputs("begin position", f); break;
-
- case ANCHOR_WORD_BOUND: fputs("word bound", f); break;
- case ANCHOR_NOT_WORD_BOUND: fputs("not word bound", f); break;
-#ifdef USE_WORD_BEGIN_END
- case ANCHOR_WORD_BEGIN: fputs("word begin", f); break;
- case ANCHOR_WORD_END: fputs("word end", f); break;
-#endif
- case ANCHOR_PREC_READ: fputs("prec read", f); break;
- case ANCHOR_PREC_READ_NOT: fputs("prec read not", f); break;
- case ANCHOR_LOOK_BEHIND: fputs("look_behind", f); break;
- case ANCHOR_LOOK_BEHIND_NOT: fputs("look_behind_not",f); break;
-
- default:
- fprintf(f, "ERROR: undefined anchor type.\n");
- break;
- }
- break;
-
- case NT_BREF:
- {
- int* p;
- BRefNode* br = NBREF(node);
- p = BACKREFS_P(br);
- fprintf(f, "<backref:%x>", (int )node);
- for (i = 0; i < br->back_num; i++) {
- if (i > 0) fputs(", ", f);
- fprintf(f, "%d", p[i]);
- }
- }
- break;
-
-#ifdef USE_SUBEXP_CALL
- case NT_CALL:
- {
- CallNode* cn = NCALL(node);
- fprintf(f, "<call:%x>", (int )node);
- p_string(f, cn->name_end - cn->name, cn->name);
- }
- break;
-#endif
-
- case NT_QTFR:
- fprintf(f, "<quantifier:%x>{%d,%d}%s\n", (int )node,
- NQTFR(node)->lower, NQTFR(node)->upper,
- (NQTFR(node)->greedy ? "" : "?"));
- print_indent_tree(f, NQTFR(node)->target, indent + add);
- break;
-
- case NT_ENCLOSE:
- fprintf(f, "<enclose:%x> ", (int )node);
- switch (NENCLOSE(node)->type) {
- case ENCLOSE_OPTION:
- fprintf(f, "option:%d\n", NENCLOSE(node)->option);
- print_indent_tree(f, NENCLOSE(node)->target, indent + add);
- break;
- case ENCLOSE_MEMORY:
- fprintf(f, "memory:%d", NENCLOSE(node)->regnum);
- break;
- case ENCLOSE_STOP_BACKTRACK:
- fprintf(f, "stop-bt");
- break;
-
- default:
- break;
- }
- fprintf(f, "\n");
- print_indent_tree(f, NENCLOSE(node)->target, indent + add);
- break;
-
- default:
- fprintf(f, "print_indent_tree: undefined node type %d\n", NTYPE(node));
- break;
- }
-
- if (type != NT_LIST && type != NT_ALT && type != NT_QTFR &&
- type != NT_ENCLOSE)
- fprintf(f, "\n");
- fflush(f);
-}
-#endif /* ONIG_DEBUG */
-
-#ifdef ONIG_DEBUG_PARSE_TREE
-static void
-print_tree(FILE* f, Node* node)
-{
- print_indent_tree(f, node, 0);
-}
-#endif
diff --git a/regenc.c b/regenc.c
deleted file mode 100644
index bb180367da..0000000000
--- a/regenc.c
+++ /dev/null
@@ -1,931 +0,0 @@
-/**********************************************************************
- regenc.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 "regint.h"
-
-OnigEncoding OnigEncDefaultCharEncoding = ONIG_ENCODING_INIT_DEFAULT;
-
-extern int
-onigenc_init(void)
-{
- return 0;
-}
-
-extern OnigEncoding
-onigenc_get_default_encoding(void)
-{
- return OnigEncDefaultCharEncoding;
-}
-
-extern int
-onigenc_set_default_encoding(OnigEncoding enc)
-{
- OnigEncDefaultCharEncoding = enc;
- return 0;
-}
-
-extern int
-onigenc_mbclen_approximate(const OnigUChar* p,const OnigUChar* e, struct OnigEncodingTypeST* enc)
-{
- int ret = ONIGENC_PRECISE_MBC_ENC_LEN(enc,p,e);
- if (ONIGENC_MBCLEN_CHARFOUND_P(ret))
- return ONIGENC_MBCLEN_CHARFOUND_LEN(ret);
- else if (ONIGENC_MBCLEN_NEEDMORE_P(ret))
- return (int)(e-p)+ONIGENC_MBCLEN_NEEDMORE_LEN(ret);
- return 1;
-}
-
-extern UChar*
-onigenc_get_right_adjust_char_head(OnigEncoding enc, const UChar* start, const UChar* s, const UChar* end)
-{
- UChar* p = ONIGENC_LEFT_ADJUST_CHAR_HEAD(enc, start, s, end);
- if (p < s) {
- p += enclen(enc, p, end);
- }
- return p;
-}
-
-extern UChar*
-onigenc_get_right_adjust_char_head_with_prev(OnigEncoding enc,
- const UChar* start, const UChar* s, const UChar* end, const UChar** prev)
-{
- UChar* p = ONIGENC_LEFT_ADJUST_CHAR_HEAD(enc, start, s, end);
-
- if (p < s) {
- if (prev) *prev = (const UChar* )p;
- p += enclen(enc, p, end);
- }
- else {
- if (prev) *prev = (const UChar* )NULL; /* Sorry */
- }
- return p;
-}
-
-extern UChar*
-onigenc_get_prev_char_head(OnigEncoding enc, const UChar* start, const UChar* s, const UChar* end)
-{
- if (s <= start)
- return (UChar* )NULL;
-
- return ONIGENC_LEFT_ADJUST_CHAR_HEAD(enc, start, s - 1, end);
-}
-
-extern UChar*
-onigenc_step_back(OnigEncoding enc, const UChar* start, const UChar* s, const UChar* end, int n)
-{
- while (ONIG_IS_NOT_NULL(s) && n-- > 0) {
- if (s <= start)
- return (UChar* )NULL;
-
- s = ONIGENC_LEFT_ADJUST_CHAR_HEAD(enc, start, s - 1, end);
- }
- return (UChar* )s;
-}
-
-extern UChar*
-onigenc_step(OnigEncoding enc, const UChar* p, const UChar* end, int n)
-{
- UChar* q = (UChar* )p;
- while (n-- > 0) {
- q += ONIGENC_MBC_ENC_LEN(enc, q, end);
- }
- return (q <= end ? q : NULL);
-}
-
-extern int
-onigenc_strlen(OnigEncoding enc, const UChar* p, const UChar* end)
-{
- int n = 0;
- UChar* q = (UChar* )p;
-
- while (q < end) {
- q += ONIGENC_MBC_ENC_LEN(enc, q, end);
- n++;
- }
- return n;
-}
-
-extern int
-onigenc_strlen_null(OnigEncoding enc, const UChar* s)
-{
- int n = 0;
- UChar* p = (UChar* )s;
- UChar* e = p + strlen((const char *)s);
-
- while (1) {
- if (*p == '\0') {
- UChar* q;
- int len = ONIGENC_MBC_MINLEN(enc);
-
- if (len == 1) return n;
- q = p + 1;
- while (len > 1) {
- if (*q != '\0') break;
- q++;
- len--;
- }
- if (len == 1) return n;
- }
- p += ONIGENC_MBC_ENC_LEN(enc, p, e);
- n++;
- }
-}
-
-extern int
-onigenc_str_bytelen_null(OnigEncoding enc, const UChar* s)
-{
- UChar* start = (UChar* )s;
- UChar* p = (UChar* )s;
- UChar* e = p + strlen((const char *)s);
-
- while (1) {
- if (*p == '\0') {
- UChar* q;
- int len = ONIGENC_MBC_MINLEN(enc);
-
- if (len == 1) return (int )(p - start);
- q = p + 1;
- while (len > 1) {
- if (*q != '\0') break;
- q++;
- len--;
- }
- if (len == 1) return (int )(p - start);
- }
- p += ONIGENC_MBC_ENC_LEN(enc, p, e);
- }
-}
-
-const UChar OnigEncAsciiToLowerCaseTable[] = {
- '\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',
- '\250', '\251', '\252', '\253', '\254', '\255', '\256', '\257',
- '\260', '\261', '\262', '\263', '\264', '\265', '\266', '\267',
- '\270', '\271', '\272', '\273', '\274', '\275', '\276', '\277',
- '\300', '\301', '\302', '\303', '\304', '\305', '\306', '\307',
- '\310', '\311', '\312', '\313', '\314', '\315', '\316', '\317',
- '\320', '\321', '\322', '\323', '\324', '\325', '\326', '\327',
- '\330', '\331', '\332', '\333', '\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',
-};
-
-#ifdef USE_UPPER_CASE_TABLE
-const UChar OnigEncAsciiToUpperCaseTable[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', '\101', '\102', '\103', '\104', '\105', '\106', '\107',
- '\110', '\111', '\112', '\113', '\114', '\115', '\116', '\117',
- '\120', '\121', '\122', '\123', '\124', '\125', '\126', '\127',
- '\130', '\131', '\132', '\133', '\134', '\135', '\136', '\137',
- '\140', '\101', '\102', '\103', '\104', '\105', '\106', '\107',
- '\110', '\111', '\112', '\113', '\114', '\115', '\116', '\117',
- '\120', '\121', '\122', '\123', '\124', '\125', '\126', '\127',
- '\130', '\131', '\132', '\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',
- '\250', '\251', '\252', '\253', '\254', '\255', '\256', '\257',
- '\260', '\261', '\262', '\263', '\264', '\265', '\266', '\267',
- '\270', '\271', '\272', '\273', '\274', '\275', '\276', '\277',
- '\300', '\301', '\302', '\303', '\304', '\305', '\306', '\307',
- '\310', '\311', '\312', '\313', '\314', '\315', '\316', '\317',
- '\320', '\321', '\322', '\323', '\324', '\325', '\326', '\327',
- '\330', '\331', '\332', '\333', '\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',
-};
-#endif
-
-const unsigned short OnigEncAsciiCtypeTable[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,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000
-};
-
-const UChar OnigEncISO_8859_1_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',
- '\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', '\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'
-};
-
-#ifdef USE_UPPER_CASE_TABLE
-const UChar OnigEncISO_8859_1_ToUpperCaseTable[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', '\101', '\102', '\103', '\104', '\105', '\106', '\107',
- '\110', '\111', '\112', '\113', '\114', '\115', '\116', '\117',
- '\120', '\121', '\122', '\123', '\124', '\125', '\126', '\127',
- '\130', '\131', '\132', '\133', '\134', '\135', '\136', '\137',
- '\140', '\101', '\102', '\103', '\104', '\105', '\106', '\107',
- '\110', '\111', '\112', '\113', '\114', '\115', '\116', '\117',
- '\120', '\121', '\122', '\123', '\124', '\125', '\126', '\127',
- '\130', '\131', '\132', '\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',
- '\250', '\251', '\252', '\253', '\254', '\255', '\256', '\257',
- '\260', '\261', '\262', '\263', '\264', '\265', '\266', '\267',
- '\270', '\271', '\272', '\273', '\274', '\275', '\276', '\277',
- '\300', '\301', '\302', '\303', '\304', '\305', '\306', '\307',
- '\310', '\311', '\312', '\313', '\314', '\315', '\316', '\317',
- '\320', '\321', '\322', '\323', '\324', '\325', '\326', '\327',
- '\330', '\331', '\332', '\333', '\334', '\335', '\336', '\337',
- '\300', '\301', '\302', '\303', '\304', '\305', '\306', '\307',
- '\310', '\311', '\312', '\313', '\314', '\315', '\316', '\317',
- '\320', '\321', '\322', '\323', '\324', '\325', '\326', '\367',
- '\330', '\331', '\332', '\333', '\334', '\335', '\336', '\377',
-};
-#endif
-
-extern void
-onigenc_set_default_caseconv_table(const UChar* table ARG_UNUSED)
-{
- /* nothing */
- /* obsoleted. */
-}
-
-extern UChar*
-onigenc_get_left_adjust_char_head(OnigEncoding enc, const UChar* start, const UChar* s, const UChar* end)
-{
- return ONIGENC_LEFT_ADJUST_CHAR_HEAD(enc, start, s, end);
-}
-
-const OnigPairCaseFoldCodes OnigAsciiLowerMap[] = {
- { 0x41, 0x61 },
- { 0x42, 0x62 },
- { 0x43, 0x63 },
- { 0x44, 0x64 },
- { 0x45, 0x65 },
- { 0x46, 0x66 },
- { 0x47, 0x67 },
- { 0x48, 0x68 },
- { 0x49, 0x69 },
- { 0x4a, 0x6a },
- { 0x4b, 0x6b },
- { 0x4c, 0x6c },
- { 0x4d, 0x6d },
- { 0x4e, 0x6e },
- { 0x4f, 0x6f },
- { 0x50, 0x70 },
- { 0x51, 0x71 },
- { 0x52, 0x72 },
- { 0x53, 0x73 },
- { 0x54, 0x74 },
- { 0x55, 0x75 },
- { 0x56, 0x76 },
- { 0x57, 0x77 },
- { 0x58, 0x78 },
- { 0x59, 0x79 },
- { 0x5a, 0x7a }
-};
-
-extern int
-onigenc_ascii_apply_all_case_fold(OnigCaseFoldType flag ARG_UNUSED,
- OnigApplyAllCaseFoldFunc f, void* arg,
- OnigEncoding enc ARG_UNUSED)
-{
- OnigCodePoint code;
- int i, r;
-
- for (i = 0;
- i < (int )(sizeof(OnigAsciiLowerMap)/sizeof(OnigPairCaseFoldCodes));
- i++) {
- code = OnigAsciiLowerMap[i].to;
- r = (*f)(OnigAsciiLowerMap[i].from, &code, 1, arg);
- if (r != 0) return r;
-
- code = OnigAsciiLowerMap[i].from;
- r = (*f)(OnigAsciiLowerMap[i].to, &code, 1, arg);
- if (r != 0) return r;
- }
-
- return 0;
-}
-
-extern int
-onigenc_ascii_get_case_fold_codes_by_str(OnigCaseFoldType flag ARG_UNUSED,
- const OnigUChar* p, const OnigUChar* end ARG_UNUSED, OnigCaseFoldCodeItem items[],
- OnigEncoding enc ARG_UNUSED)
-{
- if (0x41 <= *p && *p <= 0x5a) {
- items[0].byte_len = 1;
- items[0].code_len = 1;
- items[0].code[0] = (OnigCodePoint )(*p + 0x20);
- return 1;
- }
- else if (0x61 <= *p && *p <= 0x7a) {
- items[0].byte_len = 1;
- items[0].code_len = 1;
- items[0].code[0] = (OnigCodePoint )(*p - 0x20);
- return 1;
- }
- else
- return 0;
-}
-
-static int
-ss_apply_all_case_fold(OnigCaseFoldType flag ARG_UNUSED,
- OnigApplyAllCaseFoldFunc f, void* arg)
-{
- OnigCodePoint ss[] = { 0x73, 0x73 };
-
- return (*f)((OnigCodePoint )0xdf, ss, 2, arg);
-}
-
-extern int
-onigenc_apply_all_case_fold_with_map(int map_size,
- const OnigPairCaseFoldCodes map[],
- int ess_tsett_flag, OnigCaseFoldType flag,
- OnigApplyAllCaseFoldFunc f, void* arg)
-{
- OnigCodePoint code;
- int i, r;
-
- r = onigenc_ascii_apply_all_case_fold(flag, f, arg, 0);
- if (r != 0) return r;
-
- for (i = 0; i < map_size; i++) {
- code = map[i].to;
- r = (*f)(map[i].from, &code, 1, arg);
- if (r != 0) return r;
-
- code = map[i].from;
- r = (*f)(map[i].to, &code, 1, arg);
- if (r != 0) return r;
- }
-
- if (ess_tsett_flag != 0)
- return ss_apply_all_case_fold(flag, f, arg);
-
- return 0;
-}
-
-extern int
-onigenc_get_case_fold_codes_by_str_with_map(int map_size,
- const OnigPairCaseFoldCodes map[],
- int ess_tsett_flag, OnigCaseFoldType flag ARG_UNUSED,
- const OnigUChar* p, const OnigUChar* end, OnigCaseFoldCodeItem items[])
-{
- if (0x41 <= *p && *p <= 0x5a) {
- items[0].byte_len = 1;
- items[0].code_len = 1;
- items[0].code[0] = (OnigCodePoint )(*p + 0x20);
- if (*p == 0x53 && ess_tsett_flag != 0 && end > p + 1
- && (*(p+1) == 0x53 || *(p+1) == 0x73)) {
- /* SS */
- items[1].byte_len = 2;
- items[1].code_len = 1;
- items[1].code[0] = (OnigCodePoint )0xdf;
- return 2;
- }
- else
- return 1;
- }
- else if (0x61 <= *p && *p <= 0x7a) {
- items[0].byte_len = 1;
- items[0].code_len = 1;
- items[0].code[0] = (OnigCodePoint )(*p - 0x20);
- if (*p == 0x73 && ess_tsett_flag != 0 && end > p + 1
- && (*(p+1) == 0x73 || *(p+1) == 0x53)) {
- /* ss */
- items[1].byte_len = 2;
- items[1].code_len = 1;
- items[1].code[0] = (OnigCodePoint )0xdf;
- return 2;
- }
- else
- return 1;
- }
- else if (*p == 0xdf && ess_tsett_flag != 0) {
- items[0].byte_len = 1;
- items[0].code_len = 2;
- items[0].code[0] = (OnigCodePoint )'s';
- items[0].code[1] = (OnigCodePoint )'s';
-
- items[1].byte_len = 1;
- items[1].code_len = 2;
- items[1].code[0] = (OnigCodePoint )'S';
- items[1].code[1] = (OnigCodePoint )'S';
-
- items[2].byte_len = 1;
- items[2].code_len = 2;
- items[2].code[0] = (OnigCodePoint )'s';
- items[2].code[1] = (OnigCodePoint )'S';
-
- items[3].byte_len = 1;
- items[3].code_len = 2;
- items[3].code[0] = (OnigCodePoint )'S';
- items[3].code[1] = (OnigCodePoint )'s';
-
- return 4;
- }
- else {
- int i;
-
- for (i = 0; i < map_size; i++) {
- if (*p == map[i].from) {
- items[0].byte_len = 1;
- items[0].code_len = 1;
- items[0].code[0] = map[i].to;
- return 1;
- }
- else if (*p == map[i].to) {
- items[0].byte_len = 1;
- items[0].code_len = 1;
- items[0].code[0] = map[i].from;
- return 1;
- }
- }
- }
-
- return 0;
-}
-
-
-extern int
-onigenc_not_support_get_ctype_code_range(OnigCtype ctype,
- OnigCodePoint* sb_out, const OnigCodePoint* ranges[],
- OnigEncoding enc)
-{
- return ONIG_NO_SUPPORT_CONFIG;
-}
-
-extern int
-onigenc_is_mbc_newline_0x0a(const UChar* p, const UChar* end, OnigEncoding enc ARG_UNUSED)
-{
- if (p < end) {
- if (*p == 0x0a) return 1;
- }
- return 0;
-}
-
-/* for single byte encodings */
-extern int
-onigenc_ascii_mbc_case_fold(OnigCaseFoldType flag ARG_UNUSED, const UChar** p,
- const UChar*end, UChar* lower, OnigEncoding enc ARG_UNUSED)
-{
- *lower = ONIGENC_ASCII_CODE_TO_LOWER_CASE(**p);
-
- (*p)++;
- return 1; /* return byte length of converted char to lower */
-}
-
-#if 0
-extern int
-onigenc_ascii_is_mbc_ambiguous(OnigCaseFoldType flag ARG_UNUSED,
- const UChar** pp, const UChar* end ARG_UNUSED)
-{
- const UChar* p = *pp;
-
- (*pp)++;
- return ONIGENC_IS_ASCII_CODE_CASE_AMBIG(*p);
-}
-#endif
-
-extern int
-onigenc_single_byte_mbc_enc_len(const UChar* p ARG_UNUSED, const UChar* e ARG_UNUSED,
- OnigEncoding enc ARG_UNUSED)
-{
- return 1;
-}
-
-extern OnigCodePoint
-onigenc_single_byte_mbc_to_code(const UChar* p, const UChar* end ARG_UNUSED,
- OnigEncoding enc ARG_UNUSED)
-{
- return (OnigCodePoint )(*p);
-}
-
-extern int
-onigenc_single_byte_code_to_mbclen(OnigCodePoint code ARG_UNUSED, OnigEncoding enc ARG_UNUSED)
-{
- return 1;
-}
-
-extern int
-onigenc_single_byte_code_to_mbc(OnigCodePoint code, UChar *buf, OnigEncoding enc ARG_UNUSED)
-{
- if (code > 0xff)
- rb_raise(rb_eRangeError, "%u out of char range", code);
- *buf = (UChar )(code & 0xff);
- return 1;
-}
-
-extern UChar*
-onigenc_single_byte_left_adjust_char_head(const UChar* start ARG_UNUSED, const UChar* s,
- const UChar* end,
- OnigEncoding enc ARG_UNUSED)
-{
- return (UChar* )s;
-}
-
-extern int
-onigenc_always_true_is_allowed_reverse_match(const UChar* s ARG_UNUSED, const UChar* end ARG_UNUSED,
- OnigEncoding enc ARG_UNUSED)
-{
- return TRUE;
-}
-
-extern int
-onigenc_always_false_is_allowed_reverse_match(const UChar* s ARG_UNUSED, const UChar* end ARG_UNUSED,
- OnigEncoding enc ARG_UNUSED)
-{
- return FALSE;
-}
-
-extern int
-onigenc_ascii_is_code_ctype(OnigCodePoint code, unsigned int ctype,
- OnigEncoding enc ARG_UNUSED)
-{
- if (code < 128)
- return ONIGENC_IS_ASCII_CODE_CTYPE(code, ctype);
- else
- return FALSE;
-}
-
-extern OnigCodePoint
-onigenc_mbn_mbc_to_code(OnigEncoding enc, const UChar* p, const UChar* end)
-{
- int c, i, len;
- OnigCodePoint n;
-
- len = enclen(enc, p, end);
- n = (OnigCodePoint )(*p++);
- if (len == 1) return n;
-
- for (i = 1; i < len; i++) {
- if (p >= end) break;
- c = *p++;
- n <<= 8; n += c;
- }
- return n;
-}
-
-extern int
-onigenc_mbn_mbc_case_fold(OnigEncoding enc, OnigCaseFoldType flag ARG_UNUSED,
- const UChar** pp, const UChar* end ARG_UNUSED,
- UChar* lower)
-{
- int len;
- const UChar *p = *pp;
-
- if (ONIGENC_IS_MBC_ASCII(p)) {
- *lower = ONIGENC_ASCII_CODE_TO_LOWER_CASE(*p);
- (*pp)++;
- return 1;
- }
- else {
- int i;
-
- len = enclen(enc, p, end);
- for (i = 0; i < len; i++) {
- *lower++ = *p++;
- }
- (*pp) += len;
- return len; /* return byte length of converted to lower char */
- }
-}
-
-#if 0
-extern int
-onigenc_mbn_is_mbc_ambiguous(OnigEncoding enc, OnigCaseFoldType flag,
- const UChar** pp ARG_UNUSED, const UChar* end ARG_UNUSED)
-{
- const UChar* p = *pp;
-
- if (ONIGENC_IS_MBC_ASCII(p)) {
- (*pp)++;
- return ONIGENC_IS_ASCII_CODE_CASE_AMBIG(*p);
- }
-
- (*pp) += enclen(enc, p);
- return FALSE;
-}
-#endif
-
-extern int
-onigenc_mb2_code_to_mbclen(OnigCodePoint code, OnigEncoding enc ARG_UNUSED)
-{
- if ((code & 0xff00) != 0) return 2;
- else return 1;
-}
-
-extern int
-onigenc_mb4_code_to_mbclen(OnigCodePoint code, OnigEncoding enc ARG_UNUSED)
-{
- if ((code & 0xff000000) != 0) return 4;
- else if ((code & 0xff0000) != 0) return 3;
- else if ((code & 0xff00) != 0) return 2;
- else return 1;
-}
-
-extern int
-onigenc_mb2_code_to_mbc(OnigEncoding enc, OnigCodePoint code, UChar *buf)
-{
- UChar *p = buf;
-
- if ((code & 0xff00) != 0) {
- *p++ = (UChar )((code >> 8) & 0xff);
- }
- *p++ = (UChar )(code & 0xff);
-
-#if 1
- if (enclen(enc, buf, p) != (p - buf))
- return ONIGERR_INVALID_CODE_POINT_VALUE;
-#endif
- return (int)(p - buf);
-}
-
-extern int
-onigenc_mb4_code_to_mbc(OnigEncoding enc, OnigCodePoint code, UChar *buf)
-{
- UChar *p = buf;
-
- if ((code & 0xff000000) != 0) {
- *p++ = (UChar )((code >> 24) & 0xff);
- }
- if ((code & 0xff0000) != 0 || p != buf) {
- *p++ = (UChar )((code >> 16) & 0xff);
- }
- if ((code & 0xff00) != 0 || p != buf) {
- *p++ = (UChar )((code >> 8) & 0xff);
- }
- *p++ = (UChar )(code & 0xff);
-
-#if 1
- if (enclen(enc, buf, p) != (p - buf))
- return ONIGERR_INVALID_CODE_POINT_VALUE;
-#endif
- return (int)(p - buf);
-}
-
-extern int
-onigenc_minimum_property_name_to_ctype(OnigEncoding enc, UChar* p, UChar* end)
-{
- static const PosixBracketEntryType PBS[] = {
- { (UChar* )"Alnum", ONIGENC_CTYPE_ALNUM, 5 },
- { (UChar* )"Alpha", ONIGENC_CTYPE_ALPHA, 5 },
- { (UChar* )"Blank", ONIGENC_CTYPE_BLANK, 5 },
- { (UChar* )"Cntrl", ONIGENC_CTYPE_CNTRL, 5 },
- { (UChar* )"Digit", ONIGENC_CTYPE_DIGIT, 5 },
- { (UChar* )"Graph", ONIGENC_CTYPE_GRAPH, 5 },
- { (UChar* )"Lower", ONIGENC_CTYPE_LOWER, 5 },
- { (UChar* )"Print", ONIGENC_CTYPE_PRINT, 5 },
- { (UChar* )"Punct", ONIGENC_CTYPE_PUNCT, 5 },
- { (UChar* )"Space", ONIGENC_CTYPE_SPACE, 5 },
- { (UChar* )"Upper", ONIGENC_CTYPE_UPPER, 5 },
- { (UChar* )"XDigit", ONIGENC_CTYPE_XDIGIT, 6 },
- { (UChar* )"ASCII", ONIGENC_CTYPE_ASCII, 5 },
- { (UChar* )"Word", ONIGENC_CTYPE_WORD, 4 },
- { (UChar* )NULL, -1, 0 }
- };
-
- const PosixBracketEntryType *pb;
- int len;
-
- len = onigenc_strlen(enc, p, end);
- for (pb = PBS; IS_NOT_NULL(pb->name); pb++) {
- if (len == pb->len &&
- onigenc_with_ascii_strncmp(enc, p, end, pb->name, pb->len) == 0)
- return pb->ctype;
- }
-
- return ONIGERR_INVALID_CHAR_PROPERTY_NAME;
-}
-
-extern int
-onigenc_mb2_is_code_ctype(OnigEncoding enc, 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 (ONIGENC_CODE_TO_MBCLEN(enc, code) > 1 ? TRUE : FALSE);
- }
- }
-
- return FALSE;
-}
-
-extern int
-onigenc_mb4_is_code_ctype(OnigEncoding enc, 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 (ONIGENC_CODE_TO_MBCLEN(enc, code) > 1 ? TRUE : FALSE);
- }
- }
-
- return FALSE;
-}
-
-extern int
-onigenc_with_ascii_strncmp(OnigEncoding enc, const UChar* p, const UChar* end,
- const UChar* sascii /* ascii */, int n)
-{
- int x, c;
-
- while (n-- > 0) {
- if (p >= end) return (int )(*sascii);
-
- c = (int )ONIGENC_MBC_TO_CODE(enc, p, end);
- x = *sascii - c;
- if (x) return x;
-
- sascii++;
- p += enclen(enc, p, end);
- }
- return 0;
-}
-
-/* Property management */
-static int
-resize_property_list(int new_size, const OnigCodePoint*** plist, int* psize)
-{
- size_t size;
- const OnigCodePoint **list = *plist;
-
- size = sizeof(OnigCodePoint*) * new_size;
- if (IS_NULL(list)) {
- list = (const OnigCodePoint** )xmalloc(size);
- }
- else {
- list = (const OnigCodePoint** )xrealloc((void* )list, size);
- }
-
- if (IS_NULL(list)) return ONIGERR_MEMORY;
-
- *plist = list;
- *psize = new_size;
-
- return 0;
-}
-
-extern int
-onigenc_property_list_add_property(UChar* name, const OnigCodePoint* prop,
- hash_table_type **table, const OnigCodePoint*** plist, int *pnum,
- int *psize)
-{
-#define PROP_INIT_SIZE 16
-
- int r;
-
- if (*psize <= *pnum) {
- int new_size = (*psize == 0 ? PROP_INIT_SIZE : *psize * 2);
- r = resize_property_list(new_size, plist, psize);
- if (r != 0) return r;
- }
-
- (*plist)[*pnum] = prop;
-
- if (ONIG_IS_NULL(*table)) {
- *table = onig_st_init_strend_table_with_size(PROP_INIT_SIZE);
- if (ONIG_IS_NULL(*table)) return ONIGERR_MEMORY;
- }
-
- *pnum = *pnum + 1;
- onig_st_insert_strend(*table, name, name + strlen((char* )name),
- (hash_data_type )(*pnum + ONIGENC_MAX_STD_CTYPE));
- return 0;
-}
-
-extern int
-onigenc_property_list_init(int (*f)(void))
-{
- int r;
-
- THREAD_ATOMIC_START;
-
- r = f();
-
- THREAD_ATOMIC_END;
- return r;
-}
diff --git a/regenc.h b/regenc.h
deleted file mode 100644
index c1d705b01a..0000000000
--- a/regenc.h
+++ /dev/null
@@ -1,207 +0,0 @@
-#ifndef ONIGURUMA_REGENC_H
-#define ONIGURUMA_REGENC_H
-/**********************************************************************
- regenc.h - 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.
- */
-#ifndef REGINT_H
-#ifndef RUBY_EXTERN
-#include "ruby/config.h"
-#include "ruby/defines.h"
-#endif
-#ifdef ONIG_ESCAPE_UCHAR_COLLISION
-#undef ONIG_ESCAPE_UCHAR_COLLISION
-#endif
-#endif
-#include "ruby/oniguruma.h"
-
-typedef struct {
- OnigCodePoint from;
- OnigCodePoint to;
-} OnigPairCaseFoldCodes;
-
-
-#ifndef NULL
-#define NULL ((void* )0)
-#endif
-
-#ifndef TRUE
-#define TRUE 1
-#endif
-
-#ifndef FALSE
-#define FALSE 0
-#endif
-
-#ifndef ARG_UNUSED
-#if defined(__GNUC__)
-# define ARG_UNUSED __attribute__ ((unused))
-#else
-# define ARG_UNUSED
-#endif
-#endif
-
-#define ONIG_IS_NULL(p) (((void*)(p)) == (void*)0)
-#define ONIG_IS_NOT_NULL(p) (((void*)(p)) != (void*)0)
-#define ONIG_CHECK_NULL_RETURN(p) if (ONIG_IS_NULL(p)) return NULL
-#define ONIG_CHECK_NULL_RETURN_VAL(p,val) if (ONIG_IS_NULL(p)) return (val)
-
-#define enclen(enc,p,e) ((enc->max_enc_len == enc->min_enc_len) ? enc->min_enc_len : ONIGENC_MBC_ENC_LEN(enc,p,e))
-
-/* character types bit flag */
-#define BIT_CTYPE_NEWLINE (1<< ONIGENC_CTYPE_NEWLINE)
-#define BIT_CTYPE_ALPHA (1<< ONIGENC_CTYPE_ALPHA)
-#define BIT_CTYPE_BLANK (1<< ONIGENC_CTYPE_BLANK)
-#define BIT_CTYPE_CNTRL (1<< ONIGENC_CTYPE_CNTRL)
-#define BIT_CTYPE_DIGIT (1<< ONIGENC_CTYPE_DIGIT)
-#define BIT_CTYPE_GRAPH (1<< ONIGENC_CTYPE_GRAPH)
-#define BIT_CTYPE_LOWER (1<< ONIGENC_CTYPE_LOWER)
-#define BIT_CTYPE_PRINT (1<< ONIGENC_CTYPE_PRINT)
-#define BIT_CTYPE_PUNCT (1<< ONIGENC_CTYPE_PUNCT)
-#define BIT_CTYPE_SPACE (1<< ONIGENC_CTYPE_SPACE)
-#define BIT_CTYPE_UPPER (1<< ONIGENC_CTYPE_UPPER)
-#define BIT_CTYPE_XDIGIT (1<< ONIGENC_CTYPE_XDIGIT)
-#define BIT_CTYPE_WORD (1<< ONIGENC_CTYPE_WORD)
-#define BIT_CTYPE_ALNUM (1<< ONIGENC_CTYPE_ALNUM)
-#define BIT_CTYPE_ASCII (1<< ONIGENC_CTYPE_ASCII)
-
-#define CTYPE_TO_BIT(ctype) (1<<(ctype))
-#define CTYPE_IS_WORD_GRAPH_PRINT(ctype) \
- ((ctype) == ONIGENC_CTYPE_WORD || (ctype) == ONIGENC_CTYPE_GRAPH ||\
- (ctype) == ONIGENC_CTYPE_PRINT)
-
-
-typedef struct {
- UChar *name;
- int ctype;
- short int len;
-} PosixBracketEntryType;
-
-
-/* #define USE_CRNL_AS_LINE_TERMINATOR */
-#define USE_UNICODE_PROPERTIES
-/* #define USE_UNICODE_CASE_FOLD_TURKISH_AZERI */
-/* #define USE_UNICODE_ALL_LINE_TERMINATORS */ /* see Unicode.org UTF#18 */
-
-
-#define ONIG_ENCODING_INIT_DEFAULT ONIG_ENCODING_ASCII
-
-/* for encoding system implementation (internal) */
-ONIG_EXTERN int onigenc_ascii_apply_all_case_fold P_((OnigCaseFoldType flag, OnigApplyAllCaseFoldFunc f, void* arg, OnigEncoding enc));
-ONIG_EXTERN int onigenc_ascii_get_case_fold_codes_by_str P_((OnigCaseFoldType flag, const OnigUChar* p, const OnigUChar* end, OnigCaseFoldCodeItem items[], OnigEncoding enc));
-ONIG_EXTERN int onigenc_apply_all_case_fold_with_map P_((int map_size, const OnigPairCaseFoldCodes map[], int ess_tsett_flag, OnigCaseFoldType flag, OnigApplyAllCaseFoldFunc f, void* arg));
-ONIG_EXTERN int onigenc_get_case_fold_codes_by_str_with_map P_((int map_size, const OnigPairCaseFoldCodes map[], int ess_tsett_flag, OnigCaseFoldType flag, const OnigUChar* p, const OnigUChar* end, OnigCaseFoldCodeItem items[]));
-ONIG_EXTERN int onigenc_not_support_get_ctype_code_range P_((OnigCtype ctype, OnigCodePoint* sb_out, const OnigCodePoint* ranges[], OnigEncoding enc));
-ONIG_EXTERN int onigenc_is_mbc_newline_0x0a P_((const UChar* p, const UChar* end, OnigEncoding enc));
-
-
-/* methods for single byte encoding */
-ONIG_EXTERN int onigenc_ascii_mbc_case_fold P_((OnigCaseFoldType flag, const UChar** p, const UChar* end, UChar* lower, OnigEncoding enc));
-ONIG_EXTERN int onigenc_single_byte_mbc_enc_len P_((const UChar* p, const UChar* e, OnigEncoding enc));
-ONIG_EXTERN OnigCodePoint onigenc_single_byte_mbc_to_code P_((const UChar* p, const UChar* end, OnigEncoding enc));
-ONIG_EXTERN int onigenc_single_byte_code_to_mbclen P_((OnigCodePoint code, OnigEncoding enc));
-ONIG_EXTERN int onigenc_single_byte_code_to_mbc P_((OnigCodePoint code, UChar *buf, OnigEncoding enc));
-ONIG_EXTERN UChar* onigenc_single_byte_left_adjust_char_head P_((const UChar* start, const UChar* s, const OnigUChar* end, OnigEncoding enc));
-ONIG_EXTERN int onigenc_always_true_is_allowed_reverse_match P_((const UChar* s, const UChar* end, OnigEncoding enc));
-ONIG_EXTERN int onigenc_always_false_is_allowed_reverse_match P_((const UChar* s, const UChar* end, OnigEncoding enc));
-ONIG_EXTERN int onigenc_ascii_is_code_ctype P_((OnigCodePoint code, unsigned int ctype, OnigEncoding enc));
-
-/* methods for multi byte encoding */
-ONIG_EXTERN OnigCodePoint onigenc_mbn_mbc_to_code P_((OnigEncoding enc, const UChar* p, const UChar* end));
-ONIG_EXTERN int onigenc_mbn_mbc_case_fold P_((OnigEncoding enc, OnigCaseFoldType flag, const UChar** p, const UChar* end, UChar* lower));
-ONIG_EXTERN int onigenc_mb2_code_to_mbclen P_((OnigCodePoint code, OnigEncoding enc));
-ONIG_EXTERN int onigenc_mb2_code_to_mbc P_((OnigEncoding enc, OnigCodePoint code, UChar *buf));
-ONIG_EXTERN int onigenc_minimum_property_name_to_ctype P_((OnigEncoding enc, UChar* p, UChar* end));
-ONIG_EXTERN int onigenc_unicode_property_name_to_ctype P_((OnigEncoding enc, UChar* p, UChar* end));
-ONIG_EXTERN int onigenc_mb2_is_code_ctype P_((OnigEncoding enc, OnigCodePoint code, unsigned int ctype));
-ONIG_EXTERN int onigenc_mb4_code_to_mbclen P_((OnigCodePoint code, OnigEncoding enc));
-ONIG_EXTERN int onigenc_mb4_code_to_mbc P_((OnigEncoding enc, OnigCodePoint code, UChar *buf));
-ONIG_EXTERN int onigenc_mb4_is_code_ctype P_((OnigEncoding enc, OnigCodePoint code, unsigned int ctype));
-
-
-/* in enc/unicode.c */
-ONIG_EXTERN int onigenc_unicode_is_code_ctype P_((OnigCodePoint code, unsigned int ctype, OnigEncoding enc));
-ONIG_EXTERN int onigenc_utf16_32_get_ctype_code_range P_((OnigCtype ctype, OnigCodePoint *sb_out, const OnigCodePoint* ranges[], OnigEncoding enc));
-ONIG_EXTERN int onigenc_unicode_ctype_code_range P_((int ctype, const OnigCodePoint* ranges[]));
-ONIG_EXTERN int onigenc_unicode_get_case_fold_codes_by_str P_((OnigEncoding enc, OnigCaseFoldType flag, const OnigUChar* p, const OnigUChar* end, OnigCaseFoldCodeItem items[]));
-ONIG_EXTERN int onigenc_unicode_mbc_case_fold P_((OnigEncoding enc, OnigCaseFoldType flag, const UChar** pp, const UChar* end, UChar* fold));
-ONIG_EXTERN int onigenc_unicode_apply_all_case_fold P_((OnigCaseFoldType flag, OnigApplyAllCaseFoldFunc f, void* arg, OnigEncoding enc));
-
-
-#define ONIGENC_ISO_8859_1_TO_LOWER_CASE(c) \
- OnigEncISO_8859_1_ToLowerCaseTable[c]
-#define ONIGENC_ISO_8859_1_TO_UPPER_CASE(c) \
- OnigEncISO_8859_1_ToUpperCaseTable[c]
-
-ONIG_EXTERN const UChar OnigEncISO_8859_1_ToLowerCaseTable[];
-ONIG_EXTERN const UChar OnigEncISO_8859_1_ToUpperCaseTable[];
-
-ONIG_EXTERN int
-onigenc_with_ascii_strncmp P_((OnigEncoding enc, const UChar* p, const UChar* end, const UChar* sascii /* ascii */, int n));
-ONIG_EXTERN UChar*
-onigenc_step P_((OnigEncoding enc, const UChar* p, const UChar* end, int n));
-
-/* defined in regexec.c, but used in enc/xxx.c */
-extern int onig_is_in_code_range P_((const UChar* p, OnigCodePoint code));
-
-ONIG_EXTERN OnigEncoding OnigEncDefaultCharEncoding;
-ONIG_EXTERN const UChar OnigEncAsciiToLowerCaseTable[];
-ONIG_EXTERN const UChar OnigEncAsciiToUpperCaseTable[];
-ONIG_EXTERN const unsigned short OnigEncAsciiCtypeTable[];
-
-#define ONIGENC_IS_ASCII_CODE(code) ((code) < 0x80)
-#define ONIGENC_ASCII_CODE_TO_LOWER_CASE(c) OnigEncAsciiToLowerCaseTable[c]
-#define ONIGENC_ASCII_CODE_TO_UPPER_CASE(c) OnigEncAsciiToUpperCaseTable[c]
-#define ONIGENC_IS_ASCII_CODE_CTYPE(code,ctype) \
- ((OnigEncAsciiCtypeTable[code] & CTYPE_TO_BIT(ctype)) != 0)
-#define ONIGENC_IS_ASCII_CODE_CASE_AMBIG(code) \
- (ONIGENC_IS_ASCII_CODE_CTYPE(code, ONIGENC_CTYPE_UPPER) ||\
- ONIGENC_IS_ASCII_CODE_CTYPE(code, ONIGENC_CTYPE_LOWER))
-
-#ifdef ONIG_ENC_REGISTER
-extern int ONIG_ENC_REGISTER(const char *, OnigEncodingType*);
-#define OnigEncodingName(n) encoding_##n
-#define OnigEncodingDeclare(n) static OnigEncodingType OnigEncodingName(n)
-#define OnigEncodingDefine(f,n) \
- OnigEncodingDeclare(n); \
- void Init_##f(void) { \
- ONIG_ENC_REGISTER(OnigEncodingName(n).name, \
- &OnigEncodingName(n)); \
- } \
- OnigEncodingDeclare(n)
-#else
-#define OnigEncodingName(n) OnigEncoding##n
-#define OnigEncodingDeclare(n) OnigEncodingType OnigEncodingName(n)
-#define OnigEncodingDefine(f,n) OnigEncodingDeclare(n)
-#endif
-
-/* macros for define replica encoding and encoding alias */
-#define ENC_REPLICATE(name, orig)
-#define ENC_ALIAS(name, orig)
-#define ENC_DUMMY(name)
-
-#endif /* ONIGURUMA_REGENC_H */
diff --git a/regerror.c b/regerror.c
deleted file mode 100644
index eb671386f1..0000000000
--- a/regerror.c
+++ /dev/null
@@ -1,389 +0,0 @@
-/**********************************************************************
- regerror.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 "regint.h"
-#include <stdio.h> /* for vsnprintf() */
-
-#ifdef HAVE_STDARG_PROTOTYPES
-#include <stdarg.h>
-#define va_init_list(a,b) va_start(a,b)
-#else
-#include <varargs.h>
-#define va_init_list(a,b) va_start(a)
-#endif
-
-extern UChar*
-onig_error_code_to_format(int code)
-{
- const char *p;
-
- if (code >= 0) return (UChar* )0;
-
- switch (code) {
- case ONIG_MISMATCH:
- p = "mismatch"; break;
- case ONIG_NO_SUPPORT_CONFIG:
- p = "no support in this configuration"; break;
- case ONIGERR_MEMORY:
- p = "failed to allocate memory"; break;
- case ONIGERR_MATCH_STACK_LIMIT_OVER:
- p = "match-stack limit over"; break;
- case ONIGERR_TYPE_BUG:
- p = "undefined type (bug)"; break;
- case ONIGERR_PARSER_BUG:
- p = "internal parser error (bug)"; break;
- case ONIGERR_STACK_BUG:
- p = "stack error (bug)"; break;
- case ONIGERR_UNDEFINED_BYTECODE:
- p = "undefined bytecode (bug)"; break;
- case ONIGERR_UNEXPECTED_BYTECODE:
- p = "unexpected bytecode (bug)"; break;
- case ONIGERR_DEFAULT_ENCODING_IS_NOT_SETTED:
- p = "default multibyte-encoding is not setted"; break;
- case ONIGERR_SPECIFIED_ENCODING_CANT_CONVERT_TO_WIDE_CHAR:
- p = "can't convert to wide-char on specified multibyte-encoding"; break;
- case ONIGERR_INVALID_ARGUMENT:
- p = "invalid argument"; break;
- case ONIGERR_END_PATTERN_AT_LEFT_BRACE:
- p = "end pattern at left brace"; break;
- case ONIGERR_END_PATTERN_AT_LEFT_BRACKET:
- p = "end pattern at left bracket"; break;
- case ONIGERR_EMPTY_CHAR_CLASS:
- p = "empty char-class"; break;
- case ONIGERR_PREMATURE_END_OF_CHAR_CLASS:
- p = "premature end of char-class"; break;
- case ONIGERR_END_PATTERN_AT_ESCAPE:
- p = "end pattern at escape"; break;
- case ONIGERR_END_PATTERN_AT_META:
- p = "end pattern at meta"; break;
- case ONIGERR_END_PATTERN_AT_CONTROL:
- p = "end pattern at control"; break;
- case ONIGERR_META_CODE_SYNTAX:
- p = "invalid meta-code syntax"; break;
- case ONIGERR_CONTROL_CODE_SYNTAX:
- p = "invalid control-code syntax"; break;
- case ONIGERR_CHAR_CLASS_VALUE_AT_END_OF_RANGE:
- p = "char-class value at end of range"; break;
- case ONIGERR_CHAR_CLASS_VALUE_AT_START_OF_RANGE:
- p = "char-class value at start of range"; break;
- case ONIGERR_UNMATCHED_RANGE_SPECIFIER_IN_CHAR_CLASS:
- p = "unmatched range specifier in char-class"; break;
- case ONIGERR_TARGET_OF_REPEAT_OPERATOR_NOT_SPECIFIED:
- p = "target of repeat operator is not specified"; break;
- case ONIGERR_TARGET_OF_REPEAT_OPERATOR_INVALID:
- p = "target of repeat operator is invalid"; break;
- case ONIGERR_NESTED_REPEAT_OPERATOR:
- p = "nested repeat operator"; break;
- case ONIGERR_UNMATCHED_CLOSE_PARENTHESIS:
- p = "unmatched close parenthesis"; break;
- case ONIGERR_END_PATTERN_WITH_UNMATCHED_PARENTHESIS:
- p = "end pattern with unmatched parenthesis"; break;
- case ONIGERR_END_PATTERN_IN_GROUP:
- p = "end pattern in group"; break;
- case ONIGERR_UNDEFINED_GROUP_OPTION:
- p = "undefined group option"; break;
- case ONIGERR_INVALID_POSIX_BRACKET_TYPE:
- p = "invalid POSIX bracket type"; break;
- case ONIGERR_INVALID_LOOK_BEHIND_PATTERN:
- p = "invalid pattern in look-behind"; break;
- case ONIGERR_INVALID_REPEAT_RANGE_PATTERN:
- p = "invalid repeat range {lower,upper}"; break;
- case ONIGERR_TOO_BIG_NUMBER:
- p = "too big number"; break;
- case ONIGERR_TOO_BIG_NUMBER_FOR_REPEAT_RANGE:
- p = "too big number for repeat range"; break;
- case ONIGERR_UPPER_SMALLER_THAN_LOWER_IN_REPEAT_RANGE:
- p = "upper is smaller than lower in repeat range"; break;
- case ONIGERR_EMPTY_RANGE_IN_CHAR_CLASS:
- p = "empty range in char class"; break;
- case ONIGERR_MISMATCH_CODE_LENGTH_IN_CLASS_RANGE:
- p = "mismatch multibyte code length in char-class range"; break;
- case ONIGERR_TOO_MANY_MULTI_BYTE_RANGES:
- p = "too many multibyte code ranges are specified"; break;
- case ONIGERR_TOO_SHORT_MULTI_BYTE_STRING:
- p = "too short multibyte code string"; break;
- case ONIGERR_TOO_BIG_BACKREF_NUMBER:
- p = "too big backref number"; break;
- case ONIGERR_INVALID_BACKREF:
-#ifdef USE_NAMED_GROUP
- p = "invalid backref number/name"; break;
-#else
- p = "invalid backref number"; break;
-#endif
- case ONIGERR_NUMBERED_BACKREF_OR_CALL_NOT_ALLOWED:
- p = "numbered backref/call is not allowed. (use name)"; break;
- case ONIGERR_TOO_BIG_WIDE_CHAR_VALUE:
- p = "too big wide-char value"; break;
- case ONIGERR_TOO_LONG_WIDE_CHAR_VALUE:
- p = "too long wide-char value"; break;
- case ONIGERR_INVALID_CODE_POINT_VALUE:
- p = "invalid code point value"; break;
- case ONIGERR_EMPTY_GROUP_NAME:
- p = "group name is empty"; break;
- case ONIGERR_INVALID_GROUP_NAME:
- p = "invalid group name <%n>"; break;
- case ONIGERR_INVALID_CHAR_IN_GROUP_NAME:
-#ifdef USE_NAMED_GROUP
- p = "invalid char in group name <%n>"; break;
-#else
- p = "invalid char in group number <%n>"; break;
-#endif
- case ONIGERR_UNDEFINED_NAME_REFERENCE:
- p = "undefined name <%n> reference"; break;
- case ONIGERR_UNDEFINED_GROUP_REFERENCE:
- p = "undefined group <%n> reference"; break;
- case ONIGERR_MULTIPLEX_DEFINED_NAME:
- p = "multiplex defined name <%n>"; break;
- case ONIGERR_MULTIPLEX_DEFINITION_NAME_CALL:
- p = "multiplex definition name <%n> call"; break;
- case ONIGERR_NEVER_ENDING_RECURSION:
- p = "never ending recursion"; break;
- case ONIGERR_GROUP_NUMBER_OVER_FOR_CAPTURE_HISTORY:
- p = "group number is too big for capture history"; break;
- case ONIGERR_INVALID_CHAR_PROPERTY_NAME:
- p = "invalid character property name {%n}"; break;
- case ONIGERR_NOT_SUPPORTED_ENCODING_COMBINATION:
- p = "not supported encoding combination"; break;
- case ONIGERR_INVALID_COMBINATION_OF_OPTIONS:
- p = "invalid combination of options"; break;
- case ONIGERR_OVER_THREAD_PASS_LIMIT_COUNT:
- p = "over thread pass limit count"; break;
-
- default:
- p = "undefined error code"; break;
- }
-
- return (UChar* )p;
-}
-
-static void sprint_byte(char* s, unsigned int v)
-{
- sprintf(s, "%02x", (v & 0377));
-}
-
-static void sprint_byte_with_x(char* s, unsigned int v)
-{
- sprintf(s, "\\x%02x", (v & 0377));
-}
-
-static int to_ascii(OnigEncoding enc, UChar *s, UChar *end,
- UChar buf[], int buf_size, int *is_over)
-{
- int len;
- UChar *p;
- OnigCodePoint code;
-
- if (ONIGENC_MBC_MINLEN(enc) > 1) {
- p = s;
- len = 0;
- while (p < end) {
- code = ONIGENC_MBC_TO_CODE(enc, p, end);
- if (code >= 0x80) {
- if (code > 0xffff && len + 10 <= buf_size) {
- sprint_byte_with_x((char*)(&(buf[len])), (unsigned int)(code >> 24));
- sprint_byte((char*)(&(buf[len+4])), (unsigned int)(code >> 16));
- sprint_byte((char*)(&(buf[len+6])), (unsigned int)(code >> 8));
- sprint_byte((char*)(&(buf[len+8])), (unsigned int)code);
- len += 10;
- }
- else if (len + 6 <= buf_size) {
- sprint_byte_with_x((char*)(&(buf[len])), (unsigned int)(code >> 8));
- sprint_byte((char*)(&(buf[len+4])), (unsigned int)code);
- len += 6;
- }
- else {
- break;
- }
- }
- else {
- buf[len++] = (UChar )code;
- }
-
- p += enclen(enc, p, end);
- if (len >= buf_size) break;
- }
-
- *is_over = ((p < end) ? 1 : 0);
- }
- else {
- len = (int)MIN((end - s), buf_size);
- xmemcpy(buf, s, (size_t )len);
- *is_over = ((buf_size < (end - s)) ? 1 : 0);
- }
-
- return len;
-}
-
-
-/* for ONIG_MAX_ERROR_MESSAGE_LEN */
-#define MAX_ERROR_PAR_LEN 30
-
-extern int
-#ifdef HAVE_STDARG_PROTOTYPES
-onig_error_code_to_str(UChar* s, int code, ...)
-#else
-onig_error_code_to_str(s, code, va_alist)
- UChar* s;
- int code;
- va_dcl
-#endif
-{
- UChar *p, *q;
- OnigErrorInfo* einfo;
- size_t len;
- int is_over;
- UChar parbuf[MAX_ERROR_PAR_LEN];
- va_list vargs;
-
- va_init_list(vargs, code);
-
- switch (code) {
- case ONIGERR_UNDEFINED_NAME_REFERENCE:
- case ONIGERR_UNDEFINED_GROUP_REFERENCE:
- case ONIGERR_MULTIPLEX_DEFINED_NAME:
- case ONIGERR_MULTIPLEX_DEFINITION_NAME_CALL:
- case ONIGERR_INVALID_GROUP_NAME:
- case ONIGERR_INVALID_CHAR_IN_GROUP_NAME:
- case ONIGERR_INVALID_CHAR_PROPERTY_NAME:
- einfo = va_arg(vargs, OnigErrorInfo*);
- len = to_ascii(einfo->enc, einfo->par, einfo->par_end,
- parbuf, MAX_ERROR_PAR_LEN - 3, &is_over);
- q = onig_error_code_to_format(code);
- p = s;
- while (*q != '\0') {
- if (*q == '%') {
- q++;
- if (*q == 'n') { /* '%n': name */
- xmemcpy(p, parbuf, len);
- p += len;
- if (is_over != 0) {
- xmemcpy(p, "...", 3);
- p += 3;
- }
- q++;
- }
- else
- goto normal_char;
- }
- else {
- normal_char:
- *p++ = *q++;
- }
- }
- *p = '\0';
- len = p - s;
- break;
-
- default:
- q = onig_error_code_to_format(code);
- len = onigenc_str_bytelen_null(ONIG_ENCODING_ASCII, q);
- xmemcpy(s, q, len);
- s[len] = '\0';
- break;
- }
-
- va_end(vargs);
- return len;
-}
-
-
-void
-#ifdef HAVE_STDARG_PROTOTYPES
-onig_snprintf_with_pattern(UChar buf[], int bufsize, OnigEncoding enc,
- UChar* pat, UChar* pat_end, const UChar *fmt, ...)
-#else
-onig_snprintf_with_pattern(buf, bufsize, enc, pat, pat_end, fmt, va_alist)
- UChar buf[];
- int bufsize;
- OnigEncoding enc;
- UChar* pat;
- UChar* pat_end;
- const UChar *fmt;
- va_dcl
-#endif
-{
- size_t need;
- int n, len;
- UChar *p, *s, *bp;
- UChar bs[6];
- va_list args;
-
- va_init_list(args, fmt);
- n = xvsnprintf((char* )buf, bufsize, (const char* )fmt, args);
- va_end(args);
-
- need = (pat_end - pat) * 4 + 4;
-
- if (n + need < bufsize) {
- strcat((char* )buf, ": /");
- s = buf + onigenc_str_bytelen_null(ONIG_ENCODING_ASCII, buf);
-
- p = pat;
- while (p < pat_end) {
- if (*p == '\\') {
- *s++ = *p++;
- len = enclen(enc, p, pat_end);
- while (len-- > 0) *s++ = *p++;
- }
- else if (*p == '/') {
- *s++ = (unsigned char )'\\';
- *s++ = *p++;
- }
- else if (ONIGENC_IS_MBC_HEAD(enc, p, pat_end)) {
- len = enclen(enc, p, pat_end);
- if (ONIGENC_MBC_MINLEN(enc) == 1) {
- while (len-- > 0) *s++ = *p++;
- }
- else { /* for UTF16 */
- int blen;
-
- while (len-- > 0) {
- sprint_byte_with_x((char* )bs, (unsigned int )(*p++));
- blen = onigenc_str_bytelen_null(ONIG_ENCODING_ASCII, bs);
- bp = bs;
- while (blen-- > 0) *s++ = *bp++;
- }
- }
- }
- else if (!ONIGENC_IS_CODE_PRINT(enc, *p) &&
- !ONIGENC_IS_CODE_SPACE(enc, *p)) {
- sprint_byte_with_x((char* )bs, (unsigned int )(*p++));
- len = onigenc_str_bytelen_null(ONIG_ENCODING_ASCII, bs);
- bp = bs;
- while (len-- > 0) *s++ = *bp++;
- }
- else {
- *s++ = *p++;
- }
- }
-
- *s++ = '/';
- *s = '\0';
- }
-}
diff --git a/regex.c b/regex.c
new file mode 100644
index 0000000000..b92978fdbb
--- /dev/null
+++ b/regex.c
@@ -0,0 +1,4693 @@
+/* Extended regular expression matching and search library.
+ Copyright (C) 1993, 94, 95, 96, 97, 98 Free Software Foundation, Inc.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+
+ The GNU C Library 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
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file LGPL. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+/* Multi-byte extension added May, 1993 by t^2 (Takahiro Tanimoto)
+ Last change: May 21, 1993 by t^2 */
+/* removed gapped buffer support, multiple syntax support by matz <matz@nts.co.jp> */
+/* Perl5 extension added by matz <matz@caelum.co.jp> */
+/* UTF-8 extension added Jan 16 1999 by Yoshida Masato <yoshidam@tau.bekkoame.ne.jp> */
+
+#include "config.h"
+
+#ifdef HAVE_STRING_H
+# include <string.h>
+#else
+# include <strings.h>
+#endif
+
+/* We write fatal error messages on standard error. */
+#include <stdio.h>
+
+/* isalpha(3) etc. are used for the character classes. */
+#include <ctype.h>
+#include <sys/types.h>
+
+#ifndef PARAMS
+# if defined __GNUC__ || (defined __STDC__ && __STDC__)
+# define PARAMS(args) args
+# else
+# define PARAMS(args) ()
+# endif /* GCC. */
+#endif /* Not PARAMS. */
+
+#if defined(STDC_HEADERS)
+# include <stddef.h>
+#else
+/* We need this for `regex.h', and perhaps for the Emacs include files. */
+# include <sys/types.h>
+#endif
+#ifdef HAVE_STDLIB_H
+# include <stdlib.h>
+#endif
+
+#if !defined(__STDC__) && !defined(_MSC_VER)
+# define volatile
+#endif
+
+#ifdef HAVE_PROTOTYPES
+# define _(args) args
+#else
+# define _(args) ()
+#endif
+
+#ifdef RUBY_PLATFORM
+#include "defines.h"
+#undef xmalloc
+#undef xrealloc
+#undef xcalloc
+#undef xfree
+
+# define RUBY
+extern int rb_prohibit_interrupt;
+extern int rb_trap_pending;
+void rb_trap_exec _((void));
+
+# define CHECK_INTS do {\
+ if (!rb_prohibit_interrupt) {\
+ if (rb_trap_pending) rb_trap_exec();\
+ }\
+} while (0)
+#endif
+
+/* Make alloca work the best possible way. */
+#ifdef __GNUC__
+# ifndef atarist
+# ifndef alloca
+# define alloca __builtin_alloca
+# endif
+# endif /* atarist */
+#else
+# ifdef HAVE_ALLOCA_H
+# include <alloca.h>
+# else
+# ifdef _AIX
+ #pragma alloca
+# else
+# ifndef alloca /* predefined by HP cc +Olibcalls */
+void *alloca ();
+# endif
+# endif /* AIX */
+# endif /* HAVE_ALLOCA_H */
+
+#endif /* __GNUC__ */
+
+#ifdef HAVE_STRING_H
+# include <string.h>
+#else
+# include <strings.h>
+#endif
+
+#define xmalloc malloc
+#define xrealloc realloc
+#define xcalloc calloc
+#define xfree free
+
+#ifdef C_ALLOCA
+#define FREE_VARIABLES() alloca(0)
+#else
+#define FREE_VARIABLES()
+#endif
+
+#define FREE_AND_RETURN_VOID(stackb) do { \
+ FREE_VARIABLES(); \
+ if (stackb != stacka) xfree(stackb); \
+ return; \
+} while(0)
+
+#define FREE_AND_RETURN(stackb,val) do { \
+ FREE_VARIABLES(); \
+ if (stackb != stacka) xfree(stackb); \
+ return(val); \
+} while(0)
+
+#define DOUBLE_STACK(type) do { \
+ type *stackx; \
+ unsigned int xlen = stacke - stackb; \
+ if (stackb == stacka) { \
+ stackx = (type*)xmalloc(2 * xlen * sizeof(type)); \
+ if (!stackx) goto memory_exhausted; \
+ memcpy(stackx, stackb, xlen * sizeof (type)); \
+ } \
+ else { \
+ stackx = (type*)xrealloc(stackb, 2 * xlen * sizeof(type)); \
+ if (!stackx) goto memory_exhausted; \
+ } \
+ /* Rearrange the pointers. */ \
+ stackp = stackx + (stackp - stackb); \
+ stackb = stackx; \
+ stacke = stackb + 2 * xlen; \
+} while (0)
+
+#define RE_TALLOC(n,t) ((t*)alloca((n)*sizeof(t)))
+#define TMALLOC(n,t) ((t*)xmalloc((n)*sizeof(t)))
+#define TREALLOC(s,n,t) (s=((t*)xrealloc(s,(n)*sizeof(t))))
+
+#define EXPAND_FAIL_STACK() DOUBLE_STACK(unsigned char*)
+#define ENSURE_FAIL_STACK(n) \
+ do { \
+ if (stacke - stackp <= (n)) { \
+ /* if (len > re_max_failures * MAX_NUM_FAILURE_ITEMS) \
+ { \
+ FREE_AND_RETURN(stackb,(-2)); \
+ }*/ \
+ \
+ /* Roughly double the size of the stack. */ \
+ EXPAND_FAIL_STACK(); \
+ } \
+ } while (0)
+
+/* Get the interface, including the syntax bits. */
+#include "regex.h"
+
+/* Subroutines for re_compile_pattern. */
+static void store_jump _((char*, int, char*));
+static void insert_jump _((int, char*, char*, char*));
+static void store_jump_n _((char*, int, char*, unsigned));
+static void insert_jump_n _((int, char*, char*, char*, unsigned));
+/*static void insert_op _((int, char*, char*));*/
+static void insert_op_2 _((int, char*, char*, int, int));
+static int memcmp_translate _((unsigned char*, unsigned char*, int));
+
+/* Define the syntax stuff, so we can do the \<, \>, etc. */
+
+/* This must be nonzero for the wordchar and notwordchar pattern
+ commands in re_match. */
+#define Sword 1
+#define Sword2 2
+
+#define SYNTAX(c) re_syntax_table[c]
+
+static char re_syntax_table[256];
+static void init_syntax_once _((void));
+static const unsigned char *translate = 0;
+static void init_regs _((struct re_registers*, unsigned int));
+static void bm_init_skip _((int *, unsigned char*, int, const unsigned char*));
+static int current_mbctype = MBCTYPE_ASCII;
+
+#undef P
+
+#ifdef RUBY
+#include "util.h"
+void rb_warn _((const char*, ...));
+# define re_warning(x) rb_warn(x)
+#endif
+
+#ifndef re_warning
+# define re_warning(x)
+#endif
+
+static void
+init_syntax_once()
+{
+ register int c;
+ static int done = 0;
+
+ if (done)
+ return;
+
+ memset(re_syntax_table, 0, sizeof re_syntax_table);
+
+ for (c=0; c<=0x7f; c++)
+ if (isalnum(c))
+ re_syntax_table[c] = Sword;
+ re_syntax_table['_'] = Sword;
+
+ for (c=0x80; c<=0xff; c++)
+ if (isalnum(c))
+ re_syntax_table[c] = Sword2;
+ done = 1;
+}
+
+void
+re_set_casetable(table)
+ const char *table;
+{
+ translate = (const unsigned char*)table;
+}
+
+/* Jim Meyering writes:
+
+ "... Some ctype macros are valid only for character codes that
+ isascii says are ASCII (SGI's IRIX-4.0.5 is one such system --when
+ using /bin/cc or gcc but without giving an ansi option). So, all
+ ctype uses should be through macros like ISPRINT... If
+ STDC_HEADERS is defined, then autoconf has verified that the ctype
+ macros don't need to be guarded with references to isascii. ...
+ Defining isascii to 1 should let any compiler worth its salt
+ eliminate the && through constant folding."
+ Solaris defines some of these symbols so we must undefine them first. */
+
+#undef ISASCII
+#if defined STDC_HEADERS || (!defined isascii && !defined HAVE_ISASCII)
+# define ISASCII(c) 1
+#else
+# define ISASCII(c) isascii(c)
+#endif
+
+#ifdef isblank
+# define ISBLANK(c) (ISASCII(c) && isblank(c))
+#else
+# define ISBLANK(c) ((c) == ' ' || (c) == '\t')
+#endif
+#ifdef isgraph
+# define ISGRAPH(c) (ISASCII(c) && isgraph(c))
+#else
+# define ISGRAPH(c) (ISASCII(c) && isprint(c) && !isspace(c))
+#endif
+
+#undef ISPRINT
+#define ISPRINT(c) (ISASCII(c) && isprint(c))
+#define ISDIGIT(c) (ISASCII(c) && isdigit(c))
+#define ISALNUM(c) (ISASCII(c) && isalnum(c))
+#define ISALPHA(c) (ISASCII(c) && isalpha(c))
+#define ISCNTRL(c) (ISASCII(c) && iscntrl(c))
+#define ISLOWER(c) (ISASCII(c) && islower(c))
+#define ISPUNCT(c) (ISASCII(c) && ispunct(c))
+#define ISSPACE(c) (ISASCII(c) && isspace(c))
+#define ISUPPER(c) (ISASCII(c) && isupper(c))
+#define ISXDIGIT(c) (ISASCII(c) && isxdigit(c))
+
+#ifndef NULL
+# define NULL (void *)0
+#endif
+
+/* We remove any previous definition of `SIGN_EXTEND_CHAR',
+ since ours (we hope) works properly with all combinations of
+ machines, compilers, `char' and `unsigned char' argument types.
+ (Per Bothner suggested the basic approach.) */
+#undef SIGN_EXTEND_CHAR
+#if __STDC__
+# define SIGN_EXTEND_CHAR(c) ((signed char)(c))
+#else /* not __STDC__ */
+/* As in Harbison and Steele. */
+# define SIGN_EXTEND_CHAR(c) ((((unsigned char)(c)) ^ 128) - 128)
+#endif
+
+/* These are the command codes that appear in compiled regular
+ expressions, one per byte. Some command codes are followed by
+ argument bytes. A command code can specify any interpretation
+ whatsoever for its arguments. Zero-bytes may appear in the compiled
+ regular expression.
+
+ The value of `exactn' is needed in search.c (search_buffer) in emacs.
+ So regex.h defines a symbol `RE_EXACTN_VALUE' to be 1; the value of
+ `exactn' we use here must also be 1. */
+
+enum regexpcode
+ {
+ unused=0,
+ exactn=1, /* Followed by one byte giving n, then by n literal bytes. */
+ begline, /* Fail unless at beginning of line. */
+ endline, /* Fail unless at end of line. */
+ begbuf, /* Succeeds if at beginning of buffer (if emacs) or at beginning
+ of string to be matched (if not). */
+ endbuf, /* Analogously, for end of buffer/string. */
+ endbuf2, /* End of buffer/string, or newline just before it. */
+ begpos, /* Matches where last scan//gsub left off. */
+ jump, /* Followed by two bytes giving relative address to jump to. */
+ jump_past_alt,/* Same as jump, but marks the end of an alternative. */
+ on_failure_jump, /* Followed by two bytes giving relative address of
+ place to resume at in case of failure. */
+ finalize_jump, /* Throw away latest failure point and then jump to
+ address. */
+ maybe_finalize_jump, /* Like jump but finalize if safe to do so.
+ This is used to jump back to the beginning
+ of a repeat. If the command that follows
+ this jump is clearly incompatible with the
+ one at the beginning of the repeat, such that
+ we can be sure that there is no use backtracking
+ out of repetitions already completed,
+ then we finalize. */
+ dummy_failure_jump, /* Jump, and push a dummy failure point. This
+ failure point will be thrown away if an attempt
+ is made to use it for a failure. A + construct
+ makes this before the first repeat. Also
+ use it as an intermediary kind of jump when
+ compiling an or construct. */
+ push_dummy_failure, /* Push a dummy failure point and continue. Used at the end of
+ alternatives. */
+ succeed_n, /* Used like on_failure_jump except has to succeed n times;
+ then gets turned into an on_failure_jump. The relative
+ address following it is useless until then. The
+ address is followed by two bytes containing n. */
+ jump_n, /* Similar to jump, but jump n times only; also the relative
+ address following is in turn followed by yet two more bytes
+ containing n. */
+ try_next, /* Jump to next pattern for the first time,
+ leaving this pattern on the failure stack. */
+ finalize_push, /* Finalize stack and push the beginning of the pattern
+ on the stack to retry (used for non-greedy match) */
+ finalize_push_n, /* Similar to finalize_push, buf finalize n time only */
+ set_number_at, /* Set the following relative location to the
+ subsequent number. */
+ anychar, /* Matches any (more or less) one character excluding newlines. */
+ anychar_repeat, /* Matches sequence of characters excluding newlines. */
+ charset, /* Matches any one char belonging to specified set.
+ First following byte is number of bitmap bytes.
+ Then come bytes for a bitmap saying which chars are in.
+ Bits in each byte are ordered low-bit-first.
+ A character is in the set if its bit is 1.
+ A character too large to have a bit in the map
+ is automatically not in the set. */
+ charset_not, /* Same parameters as charset, but match any character
+ that is not one of those specified. */
+ start_memory, /* Start remembering the text that is matched, for
+ storing in a memory register. Followed by one
+ byte containing the register number. Register numbers
+ must be in the range 0 through RE_NREGS. */
+ stop_memory, /* Stop remembering the text that is matched
+ and store it in a memory register. Followed by
+ one byte containing the register number. Register
+ numbers must be in the range 0 through RE_NREGS. */
+ start_paren, /* Place holder at the start of (?:..). */
+ stop_paren, /* Place holder at the end of (?:..). */
+ casefold_on, /* Turn on casefold flag. */
+ casefold_off, /* Turn off casefold flag. */
+ option_set, /* Turn on multi line match (match with newlines). */
+ start_nowidth, /* Save string point to the stack. */
+ stop_nowidth, /* Restore string place at the point start_nowidth. */
+ pop_and_fail, /* Fail after popping nowidth entry from stack. */
+ stop_backtrack, /* Restore backtrack stack at the point start_nowidth. */
+ duplicate, /* Match a duplicate of something remembered.
+ Followed by one byte containing the index of the memory
+ register. */
+ wordchar, /* Matches any word-constituent character. */
+ notwordchar, /* Matches any char that is not a word-constituent. */
+ wordbeg, /* Succeeds if at word beginning. */
+ wordend, /* Succeeds if at word end. */
+ wordbound, /* Succeeds if at a word boundary. */
+ notwordbound /* Succeeds if not at a word boundary. */
+ };
+
+
+/* Number of failure points to allocate space for initially,
+ when matching. If this number is exceeded, more space is allocated,
+ so it is not a hard limit. */
+
+#ifndef NFAILURES
+#define NFAILURES 160
+#endif
+
+/* Store NUMBER in two contiguous bytes starting at DESTINATION. */
+#define STORE_NUMBER(destination, number) \
+ do { (destination)[0] = (number) & 0377; \
+ (destination)[1] = (number) >> 8; } while (0)
+
+/* Same as STORE_NUMBER, except increment the destination pointer to
+ the byte after where the number is stored. Watch out that values for
+ DESTINATION such as p + 1 won't work, whereas p will. */
+#define STORE_NUMBER_AND_INCR(destination, number) \
+ do { STORE_NUMBER(destination, number); \
+ (destination) += 2; } while (0)
+
+
+/* Put into DESTINATION a number stored in two contingous bytes starting
+ at SOURCE. */
+#define EXTRACT_NUMBER(destination, source) \
+ do { (destination) = *(source) & 0377; \
+ (destination) += SIGN_EXTEND_CHAR(*(char*)((source) + 1)) << 8; } while (0)
+
+/* Same as EXTRACT_NUMBER, except increment the pointer for source to
+ point to second byte of SOURCE. Note that SOURCE has to be a value
+ such as p, not, e.g., p + 1. */
+#define EXTRACT_NUMBER_AND_INCR(destination, source) \
+ do { EXTRACT_NUMBER(destination, source); \
+ (source) += 2; } while (0)
+
+
+/* Specify the precise syntax of regexps for compilation. This provides
+ for compatibility for various utilities which historically have
+ different, incompatible syntaxes.
+
+ The argument SYNTAX is a bit-mask comprised of the various bits
+ defined in regex.h. */
+
+long
+re_set_syntax(syntax)
+ long syntax;
+{
+ /* obsolete */
+ return 0;
+}
+
+/* Macros for re_compile_pattern, which is found below these definitions. */
+
+#define TRANSLATE_P() ((options&RE_OPTION_IGNORECASE) && translate)
+#define MAY_TRANSLATE() ((bufp->options&(RE_OPTION_IGNORECASE|RE_MAY_IGNORECASE)) && translate)
+/* Fetch the next character in the uncompiled pattern---translating it
+ if necessary. Also cast from a signed character in the constant
+ string passed to us by the user to an unsigned char that we can use
+ as an array index (in, e.g., `translate'). */
+#define PATFETCH(c) \
+ do {if (p == pend) goto end_of_pattern; \
+ c = (unsigned char) *p++; \
+ if (TRANSLATE_P()) c = (unsigned char)translate[c]; \
+ } while (0)
+
+/* Fetch the next character in the uncompiled pattern, with no
+ translation. */
+#define PATFETCH_RAW(c) \
+ do {if (p == pend) goto end_of_pattern; \
+ c = (unsigned char)*p++; \
+ } while (0)
+
+/* Go backwards one character in the pattern. */
+#define PATUNFETCH p--
+
+#define MBC2WC(c, p) \
+ do { \
+ if (current_mbctype == MBCTYPE_UTF8) { \
+ int n = mbclen(c) - 1; \
+ c &= (1<<(BYTEWIDTH-2-n)) - 1; \
+ while (n--) { \
+ c = c << 6 | (*p++ & ((1<<6)-1)); \
+ } \
+ } \
+ else { \
+ c <<= 8; \
+ c |= (unsigned char)*(p)++; \
+ } \
+ } while (0)
+
+#define PATFETCH_MBC(c) \
+ do { \
+ if (p + mbclen(c) - 1 >= pend) goto end_of_pattern; \
+ MBC2WC(c, p); \
+ } while(0)
+
+#define WC2MBC1ST(c) \
+ ((current_mbctype != MBCTYPE_UTF8) ? ((c<0x100) ? (c) : (((c)>>8)&0xff)) : utf8_firstbyte(c))
+
+typedef unsigned int (*mbc_startpos_func_t) _((const char *string, unsigned int pos));
+
+static unsigned int asc_startpos _((const char *string, unsigned int pos));
+static unsigned int euc_startpos _((const char *string, unsigned int pos));
+static unsigned int sjis_startpos _((const char *string, unsigned int pos));
+static unsigned int utf8_startpos _((const char *string, unsigned int pos));
+
+static const mbc_startpos_func_t mbc_startpos_func[4] = {
+ asc_startpos, euc_startpos, sjis_startpos, utf8_startpos
+};
+
+#define mbc_startpos(start, pos) (*mbc_startpos_func[current_mbctype])((start), (pos))
+
+static unsigned int
+utf8_firstbyte(c)
+ unsigned long c;
+{
+ if (c < 0x80) return c;
+ if (c <= 0x7ff) return ((c>>6)&0xff)|0xc0;
+ if (c <= 0xffff) return ((c>>12)&0xff)|0xe0;
+ if (c <= 0x1fffff) return ((c>>18)&0xff)|0xf0;
+ if (c <= 0x3ffffff) return ((c>>24)&0xff)|0xf8;
+ if (c <= 0x7fffffff) return ((c>>30)&0xff)|0xfc;
+#if SIZEOF_INT > 4
+ if (c <= 0xfffffffff) return 0xfe;
+#else
+ return 0xfe;
+#endif
+}
+
+#if 0
+static void
+print_mbc(c)
+ unsigned int c;
+{
+ if (current_mbctype == MBCTYPE_UTF8) {
+ if (c < 0x80)
+ printf("%c", (int)c);
+ else if (c <= 0x7ff)
+ printf("%c%c", (int)utf8_firstbyte(c), (int)(c & 0x3f));
+ else if (c <= 0xffff)
+ printf("%c%c%c", (int)utf8_firstbyte(c), (int)((c >> 6) & 0x3f),
+ (int)(c & 0x3f));
+ else if (c <= 0x1fffff)
+ printf("%c%c%c%c", (int)utf8_firstbyte(c), (int)((c >> 12) & 0x3f),
+ (int)((c >> 6) & 0x3f), (int)(c & 0x3f));
+ else if (c <= 0x3ffffff)
+ printf("%c%c%c%c%c", (int)utf8_firstbyte(c), (int)((c >> 18) & 0x3f),
+ (int)((c >> 12) & 0x3f), (int)((c >> 6) & 0x3f), (int)(c & 0x3f));
+ else if (c <= 0x7fffffff)
+ printf("%c%c%c%c%c%c", (int)utf8_firstbyte(c), (int)((c >> 24) & 0x3f),
+ (int)((c >> 18) & 0x3f), (int)((c >> 12) & 0x3f),
+ (int)((c >> 6) & 0x3f), (int)(c & 0x3f));
+ }
+ else if (c < 0xff) {
+ printf("\\%o", (int)c);
+ }
+ else {
+ printf("%c%c", (int)(c >> BYTEWIDTH), (int)(c &0xff));
+ }
+}
+#endif
+
+/* If the buffer isn't allocated when it comes in, use this. */
+#define INIT_BUF_SIZE 28
+
+/* Make sure we have at least N more bytes of space in buffer. */
+#define GET_BUFFER_SPACE(n) \
+ do { \
+ while (b - bufp->buffer + (n) >= bufp->allocated) \
+ EXTEND_BUFFER; \
+ } while (0)
+
+/* Make sure we have one more byte of buffer space and then add CH to it. */
+#define BUFPUSH(ch) \
+ do { \
+ GET_BUFFER_SPACE(1); \
+ *b++ = (char)(ch); \
+ } while (0)
+
+/* Extend the buffer by twice its current size via reallociation and
+ reset the pointers that pointed into the old allocation to point to
+ the correct places in the new allocation. If extending the buffer
+ results in it being larger than 1 << 16, then flag memory exhausted. */
+#define EXTEND_BUFFER \
+ do { char *old_buffer = bufp->buffer; \
+ if (bufp->allocated == (1L<<16)) goto too_big; \
+ bufp->allocated *= 2; \
+ if (bufp->allocated > (1L<<16)) bufp->allocated = (1L<<16); \
+ bufp->buffer = (char*)xrealloc(bufp->buffer, bufp->allocated); \
+ if (bufp->buffer == 0) \
+ goto memory_exhausted; \
+ b = (b - old_buffer) + bufp->buffer; \
+ if (fixup_alt_jump) \
+ fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer; \
+ if (laststart) \
+ laststart = (laststart - old_buffer) + bufp->buffer; \
+ begalt = (begalt - old_buffer) + bufp->buffer; \
+ if (pending_exact) \
+ pending_exact = (pending_exact - old_buffer) + bufp->buffer; \
+ } while (0)
+
+
+/* Set the bit for character C in a character set list. */
+#define SET_LIST_BIT(c) \
+ (b[(unsigned char)(c) / BYTEWIDTH] \
+ |= 1 << ((unsigned char)(c) % BYTEWIDTH))
+
+/* Get the next unsigned number in the uncompiled pattern. */
+#define GET_UNSIGNED_NUMBER(num) \
+ do { if (p != pend) { \
+ PATFETCH(c); \
+ while (ISDIGIT(c)) { \
+ if (num < 0) \
+ num = 0; \
+ num = num * 10 + c - '0'; \
+ if (p == pend) \
+ break; \
+ PATFETCH(c); \
+ } \
+ } \
+ } while (0)
+
+#define STREQ(s1, s2) ((strcmp(s1, s2) == 0))
+
+#define CHAR_CLASS_MAX_LENGTH 6 /* Namely, `xdigit'. */
+
+#define IS_CHAR_CLASS(string) \
+ (STREQ(string, "alpha") || STREQ(string, "upper") \
+ || STREQ(string, "lower") || STREQ(string, "digit") \
+ || STREQ(string, "alnum") || STREQ(string, "xdigit") \
+ || STREQ(string, "space") || STREQ(string, "print") \
+ || STREQ(string, "punct") || STREQ(string, "graph") \
+ || STREQ(string, "cntrl") || STREQ(string, "blank"))
+
+#define STORE_MBC(p, c) \
+ do { \
+ (p)[0] = (unsigned char)(((c) >>24) & 0xff); \
+ (p)[1] = (unsigned char)(((c) >>16) & 0xff); \
+ (p)[2] = (unsigned char)(((c) >> 8) & 0xff); \
+ (p)[3] = (unsigned char)(((c) >> 0) & 0xff); \
+ } while (0)
+
+#define STORE_MBC_AND_INCR(p, c) \
+ do { \
+ *(p)++ = (unsigned char)(((c) >>24) & 0xff); \
+ *(p)++ = (unsigned char)(((c) >>16) & 0xff); \
+ *(p)++ = (unsigned char)(((c) >> 8) & 0xff); \
+ *(p)++ = (unsigned char)(((c) >> 0) & 0xff); \
+ } while (0)
+
+#define EXTRACT_MBC(p) \
+ ((unsigned int)((unsigned char)(p)[0] << 24 | \
+ (unsigned char)(p)[1] << 16 | \
+ (unsigned char)(p)[2] << 8 | \
+ (unsigned char)(p)[3]))
+
+#define EXTRACT_MBC_AND_INCR(p) \
+ ((unsigned int)((p) += 4, \
+ (unsigned char)(p)[-4] << 24 | \
+ (unsigned char)(p)[-3] << 16 | \
+ (unsigned char)(p)[-2] << 8 | \
+ (unsigned char)(p)[-1]))
+
+#define EXTRACT_UNSIGNED(p) \
+ ((unsigned char)(p)[0] | (unsigned char)(p)[1] << 8)
+#define EXTRACT_UNSIGNED_AND_INCR(p) \
+ ((p) += 2, (unsigned char)(p)[-2] | (unsigned char)(p)[-1] << 8)
+
+/* Handle (mb)?charset(_not)?.
+
+ Structure of mbcharset(_not)? in compiled pattern.
+
+ struct {
+ unsinged char id; mbcharset(_not)?
+ unsigned char sbc_size;
+ unsigned char sbc_map[sbc_size]; same as charset(_not)? up to here.
+ unsigned short mbc_size; number of intervals.
+ struct {
+ unsigned long beg; beginning of interval.
+ unsigned long end; end of interval.
+ } intervals[mbc_size];
+ }; */
+
+static void
+set_list_bits(c1, c2, b)
+ unsigned long c1, c2;
+ unsigned char *b;
+{
+ unsigned char sbc_size = b[-1];
+ unsigned short mbc_size = EXTRACT_UNSIGNED(&b[sbc_size]);
+ unsigned short beg, end, upb;
+
+ if (c1 > c2)
+ return;
+ b = &b[sbc_size + 2];
+
+ for (beg = 0, upb = mbc_size; beg < upb; ) {
+ unsigned short mid = (unsigned short)(beg + upb) >> 1;
+
+ if ((int)c1 - 1 > (int)EXTRACT_MBC(&b[mid*8+4]))
+ beg = mid + 1;
+ else
+ upb = mid;
+ }
+
+ for (end = beg, upb = mbc_size; end < upb; ) {
+ unsigned short mid = (unsigned short)(end + upb) >> 1;
+
+ if ((int)c2 >= (int)EXTRACT_MBC(&b[mid*8]) - 1)
+ end = mid + 1;
+ else
+ upb = mid;
+ }
+
+ if (beg != end) {
+ if (c1 > EXTRACT_MBC(&b[beg*8]))
+ c1 = EXTRACT_MBC(&b[beg*8]);
+ if (c2 < EXTRACT_MBC(&b[(end - 1)*8+4]))
+ c2 = EXTRACT_MBC(&b[(end - 1)*8+4]);
+ }
+ if (end < mbc_size && end != beg + 1)
+ /* NOTE: memcpy() would not work here. */
+ memmove(&b[(beg + 1)*8], &b[end*8], (mbc_size - end)*8);
+ STORE_MBC(&b[beg*8 + 0], c1);
+ STORE_MBC(&b[beg*8 + 4], c2);
+ mbc_size += beg - end + 1;
+ STORE_NUMBER(&b[-2], mbc_size);
+}
+
+static int
+is_in_list_sbc(c, b)
+ unsigned long c;
+ const unsigned char *b;
+{
+ unsigned short size;
+
+ size = *b++;
+ return ((int)c / BYTEWIDTH < (int)size && b[c / BYTEWIDTH] & 1 << c % BYTEWIDTH);
+}
+
+static int
+is_in_list_mbc(c, b)
+ unsigned long c;
+ const unsigned char *b;
+{
+ unsigned short size;
+ unsigned short i, j;
+
+ size = *b++;
+ b += size + 2;
+ size = EXTRACT_UNSIGNED(&b[-2]);
+ if (size == 0) return 0;
+
+ for (i = 0, j = size; i < j; ) {
+ unsigned short k = (unsigned short)(i + j) >> 1;
+
+ if (c > EXTRACT_MBC(&b[k*8+4]))
+ i = k + 1;
+ else
+ j = k;
+ }
+ if (i < size && EXTRACT_MBC(&b[i*8]) <= c)
+ return 1;
+
+ return 0;
+}
+
+static int
+is_in_list(c, b)
+ unsigned long c;
+ const unsigned char *b;
+{
+ return is_in_list_sbc(c, b) || (current_mbctype ? is_in_list_mbc(c, b) : 0);
+}
+
+#if 0
+static void
+print_partial_compiled_pattern(start, end)
+ unsigned char *start;
+ unsigned char *end;
+{
+ int mcnt, mcnt2;
+ unsigned char *p = start;
+ unsigned char *pend = end;
+
+ if (start == NULL) {
+ printf("(null)\n");
+ return;
+ }
+
+ /* Loop over pattern commands. */
+ while (p < pend) {
+ switch ((enum regexpcode)*p++) {
+ case unused:
+ printf("/unused");
+ break;
+
+ case exactn:
+ mcnt = *p++;
+ printf("/exactn/%d", mcnt);
+ do {
+ putchar('/');
+ printf("%c", *p++);
+ }
+ while (--mcnt);
+ break;
+
+ case start_memory:
+ mcnt = *p++;
+ printf("/start_memory/%d/%d", mcnt, *p++);
+ break;
+
+ case stop_memory:
+ mcnt = *p++;
+ printf("/stop_memory/%d/%d", mcnt, *p++);
+ break;
+
+ case start_paren:
+ printf("/start_paren");
+ break;
+
+ case stop_paren:
+ printf("/stop_paren");
+ break;
+
+ case casefold_on:
+ printf("/casefold_on");
+ break;
+
+ case casefold_off:
+ printf("/casefold_off");
+ break;
+
+ case option_set:
+ printf("/option_set/%d", *p++);
+ break;
+
+ case start_nowidth:
+ EXTRACT_NUMBER_AND_INCR(mcnt, p);
+ printf("/start_nowidth//%d", mcnt);
+ break;
+
+ case stop_nowidth:
+ printf("/stop_nowidth//");
+ p += 2;
+ break;
+
+ case pop_and_fail:
+ printf("/pop_and_fail");
+ break;
+
+ case stop_backtrack:
+ printf("/stop_backtrack//");
+ p += 2;
+ break;
+
+ case duplicate:
+ printf("/duplicate/%d", *p++);
+ break;
+
+ case anychar:
+ printf("/anychar");
+ break;
+
+ case anychar_repeat:
+ printf("/anychar_repeat");
+ break;
+
+ case charset:
+ case charset_not:
+ {
+ register int c;
+
+ printf("/charset%s",
+ (enum regexpcode)*(p - 1) == charset_not ? "_not" : "");
+
+ mcnt = *p++;
+ printf("/%d", mcnt);
+ for (c = 0; c < mcnt; c++) {
+ unsigned bit;
+ unsigned char map_byte = p[c];
+
+ putchar('/');
+
+ for (bit = 0; bit < BYTEWIDTH; bit++)
+ if (map_byte & (1 << bit))
+ printf("%c", c * BYTEWIDTH + bit);
+ }
+ p += mcnt;
+ mcnt = EXTRACT_UNSIGNED_AND_INCR(p);
+ putchar('/');
+ while (mcnt--) {
+ print_mbc(EXTRACT_MBC_AND_INCR(p));
+ putchar('-');
+ print_mbc(EXTRACT_MBC_AND_INCR(p));
+ }
+ break;
+ }
+
+ case begline:
+ printf("/begline");
+ break;
+
+ case endline:
+ printf("/endline");
+ break;
+
+ case on_failure_jump:
+ EXTRACT_NUMBER_AND_INCR(mcnt, p);
+ printf("/on_failure_jump//%d", mcnt);
+ break;
+
+ case dummy_failure_jump:
+ EXTRACT_NUMBER_AND_INCR(mcnt, p);
+ printf("/dummy_failure_jump//%d", mcnt);
+ break;
+
+ case push_dummy_failure:
+ printf("/push_dummy_failure");
+ break;
+
+ case finalize_jump:
+ EXTRACT_NUMBER_AND_INCR(mcnt, p);
+ printf("/finalize_jump//%d", mcnt);
+ break;
+
+ case maybe_finalize_jump:
+ EXTRACT_NUMBER_AND_INCR(mcnt, p);
+ printf("/maybe_finalize_jump//%d", mcnt);
+ break;
+
+ case jump_past_alt:
+ EXTRACT_NUMBER_AND_INCR(mcnt, p);
+ printf("/jump_past_alt//%d", mcnt);
+ break;
+
+ case jump:
+ EXTRACT_NUMBER_AND_INCR(mcnt, p);
+ printf("/jump//%d", mcnt);
+ break;
+
+ case succeed_n:
+ EXTRACT_NUMBER_AND_INCR(mcnt, p);
+ EXTRACT_NUMBER_AND_INCR(mcnt2, p);
+ printf("/succeed_n//%d//%d", mcnt, mcnt2);
+ break;
+
+ case jump_n:
+ EXTRACT_NUMBER_AND_INCR(mcnt, p);
+ EXTRACT_NUMBER_AND_INCR(mcnt2, p);
+ printf("/jump_n//%d//%d", mcnt, mcnt2);
+ break;
+
+ case set_number_at:
+ EXTRACT_NUMBER_AND_INCR(mcnt, p);
+ EXTRACT_NUMBER_AND_INCR(mcnt2, p);
+ printf("/set_number_at//%d//%d", mcnt, mcnt2);
+ break;
+
+ case try_next:
+ EXTRACT_NUMBER_AND_INCR(mcnt, p);
+ printf("/try_next//%d", mcnt);
+ break;
+
+ case finalize_push:
+ EXTRACT_NUMBER_AND_INCR(mcnt, p);
+ printf("/finalize_push//%d", mcnt);
+ break;
+
+ case finalize_push_n:
+ EXTRACT_NUMBER_AND_INCR(mcnt, p);
+ EXTRACT_NUMBER_AND_INCR(mcnt2, p);
+ printf("/finalize_push_n//%d//%d", mcnt, mcnt2);
+ break;
+
+ case wordbound:
+ printf("/wordbound");
+ break;
+
+ case notwordbound:
+ printf("/notwordbound");
+ break;
+
+ case wordbeg:
+ printf("/wordbeg");
+ break;
+
+ case wordend:
+ printf("/wordend");
+
+ case wordchar:
+ printf("/wordchar");
+ break;
+
+ case notwordchar:
+ printf("/notwordchar");
+ break;
+
+ case begbuf:
+ printf("/begbuf");
+ break;
+
+ case endbuf:
+ printf("/endbuf");
+ break;
+
+ case endbuf2:
+ printf("/endbuf2");
+ break;
+
+ case begpos:
+ printf("/begpos");
+ break;
+
+ default:
+ printf("?%d", *(p-1));
+ }
+ }
+ printf("/\n");
+}
+
+
+static void
+print_compiled_pattern(bufp)
+ struct re_pattern_buffer *bufp;
+{
+ unsigned char *buffer = (unsigned char*)bufp->buffer;
+
+ print_partial_compiled_pattern(buffer, buffer + bufp->used);
+}
+#endif
+
+static char*
+calculate_must_string(start, end)
+ char *start;
+ char *end;
+{
+ int mcnt;
+ int max = 0;
+ unsigned char *p = (unsigned char *)start;
+ unsigned char *pend = (unsigned char *)end;
+ char *must = 0;
+
+ if (start == NULL) return 0;
+
+ /* Loop over pattern commands. */
+ while (p < pend) {
+ switch ((enum regexpcode)*p++) {
+ case unused:
+ break;
+
+ case exactn:
+ mcnt = *p;
+ if (mcnt > max) {
+ must = (char *)p;
+ max = mcnt;
+ }
+ p += mcnt+1;
+ break;
+
+ case start_memory:
+ case stop_memory:
+ p += 2;
+ break;
+
+ case duplicate:
+ case option_set:
+ p++;
+ break;
+
+ case casefold_on:
+ case casefold_off:
+ return 0; /* should not check must_string */
+
+ case pop_and_fail:
+ case anychar:
+ case anychar_repeat:
+ case begline:
+ case endline:
+ case wordbound:
+ case notwordbound:
+ case wordbeg:
+ case wordend:
+ case wordchar:
+ case notwordchar:
+ case begbuf:
+ case endbuf:
+ case endbuf2:
+ case begpos:
+ case push_dummy_failure:
+ case start_paren:
+ case stop_paren:
+ break;
+
+ case charset:
+ case charset_not:
+ mcnt = *p++;
+ p += mcnt;
+ mcnt = EXTRACT_UNSIGNED_AND_INCR(p);
+ while (mcnt--) {
+ p += 8;
+ }
+ break;
+
+ case on_failure_jump:
+ EXTRACT_NUMBER_AND_INCR(mcnt, p);
+ if (mcnt > 0) p += mcnt;
+ if ((enum regexpcode)p[-3] == jump) {
+ p -= 2;
+ EXTRACT_NUMBER_AND_INCR(mcnt, p);
+ if (mcnt > 0) p += mcnt;
+ }
+ break;
+
+ case dummy_failure_jump:
+ case succeed_n:
+ case try_next:
+ case jump:
+ EXTRACT_NUMBER_AND_INCR(mcnt, p);
+ if (mcnt > 0) p += mcnt;
+ break;
+
+ case start_nowidth:
+ case stop_nowidth:
+ case stop_backtrack:
+ case finalize_jump:
+ case maybe_finalize_jump:
+ case finalize_push:
+ p += 2;
+ break;
+
+ case jump_n:
+ case set_number_at:
+ case finalize_push_n:
+ p += 4;
+ break;
+
+ default:
+ break;
+ }
+ }
+ return must;
+}
+
+static unsigned int
+read_backslash(c)
+ int c;
+{
+ switch (c) {
+ case 'n':
+ return '\n';
+
+ case 't':
+ return '\t';
+
+ case 'r':
+ return '\r';
+
+ case 'f':
+ return '\f';
+
+ case 'v':
+ return '\v';
+
+ case 'a':
+ return '\007';
+
+ case 'b':
+ return '\010';
+
+ case 'e':
+ return '\033';
+ }
+ return c;
+}
+
+static unsigned int
+read_special(p, pend, pp)
+ const char *p, *pend, **pp;
+{
+ int c;
+
+ PATFETCH_RAW(c);
+ switch (c) {
+ case 'M':
+ PATFETCH_RAW(c);
+ if (c != '-') return -1;
+ PATFETCH_RAW(c);
+ *pp = p;
+ if (c == '\\') {
+ return read_special(--p, pend, pp) | 0x80;
+ }
+ else if (c == -1) return ~0;
+ else {
+ return ((c & 0xff) | 0x80);
+ }
+
+ case 'C':
+ PATFETCH_RAW(c);
+ if (c != '-') return ~0;
+ case 'c':
+ PATFETCH_RAW(c);
+ *pp = p;
+ if (c == '\\') {
+ c = read_special(--p, pend, pp);
+ }
+ else if (c == '?') return 0177;
+ else if (c == -1) return ~0;
+ return c & 0x9f;
+ default:
+ *pp = p + 1;
+ return read_backslash(c);
+ }
+
+ end_of_pattern:
+ return ~0;
+}
+
+/* re_compile_pattern takes a regular-expression string
+ and converts it into a buffer full of byte commands for matching.
+
+ PATTERN is the address of the pattern string
+ SIZE is the length of it.
+ BUFP is a struct re_pattern_buffer * which points to the info
+ on where to store the byte commands.
+ This structure contains a char * which points to the
+ actual space, which should have been obtained with malloc.
+ re_compile_pattern may use realloc to grow the buffer space.
+
+ The number of bytes of commands can be found out by looking in
+ the `struct re_pattern_buffer' that bufp pointed to, after
+ re_compile_pattern returns. */
+
+const char *
+re_compile_pattern(pattern, size, bufp)
+ const char *pattern;
+ int size;
+ struct re_pattern_buffer *bufp;
+{
+ register char *b = bufp->buffer;
+ register const char *p = pattern;
+ const char *nextp;
+ const char *pend = pattern + size;
+ register unsigned int c, c1 = 0;
+ const char *p0;
+ int numlen;
+#define ERROR_MSG_MAX_SIZE 200
+ static char error_msg[ERROR_MSG_MAX_SIZE+1];
+
+ /* Address of the count-byte of the most recently inserted `exactn'
+ command. This makes it possible to tell whether a new exact-match
+ character can be added to that command or requires a new `exactn'
+ command. */
+
+ char *pending_exact = 0;
+
+ /* Address of the place where a forward-jump should go to the end of
+ the containing expression. Each alternative of an `or', except the
+ last, ends with a forward-jump of this sort. */
+
+ char *fixup_alt_jump = 0;
+
+ /* Address of start of the most recently finished expression.
+ This tells postfix * where to find the start of its operand. */
+
+ char *laststart = 0;
+
+ /* In processing a repeat, 1 means zero matches is allowed. */
+
+ char zero_times_ok;
+
+ /* In processing a repeat, 1 means many matches is allowed. */
+
+ char many_times_ok;
+
+ /* In processing a repeat, 1 means non-greedy matches. */
+
+ char greedy;
+
+ /* Address of beginning of regexp, or inside of last (. */
+
+ char *begalt = b;
+
+ /* Place in the uncompiled pattern (i.e., the {) to
+ which to go back if the interval is invalid. */
+ const char *beg_interval;
+
+ /* In processing an interval, at least this many matches must be made. */
+ int lower_bound;
+
+ /* In processing an interval, at most this many matches can be made. */
+ int upper_bound;
+
+ /* Stack of information saved by ( and restored by ).
+ Five stack elements are pushed by each (:
+ First, the value of b.
+ Second, the value of fixup_alt_jump.
+ Third, the value of begalt.
+ Fourth, the value of regnum.
+ Fifth, the type of the paren. */
+
+ int stacka[40];
+ int *stackb = stacka;
+ int *stackp = stackb;
+ int *stacke = stackb + 40;
+
+ /* Counts ('s as they are encountered. Remembered for the matching ),
+ where it becomes the register number to put in the stop_memory
+ command. */
+
+ int regnum = 1;
+
+ int range = 0;
+ int had_mbchar = 0;
+ int had_num_literal = 0;
+ int had_char_class = 0;
+
+ int options = bufp->options;
+
+ bufp->fastmap_accurate = 0;
+ bufp->must = 0;
+ bufp->must_skip = 0;
+
+ /* Initialize the syntax table. */
+ init_syntax_once();
+
+ if (bufp->allocated == 0) {
+ bufp->allocated = INIT_BUF_SIZE;
+ /* EXTEND_BUFFER loses when bufp->allocated is 0. */
+ bufp->buffer = (char*)xrealloc(bufp->buffer, INIT_BUF_SIZE);
+ if (!bufp->buffer) goto memory_exhausted; /* this not happen */
+ begalt = b = bufp->buffer;
+ }
+
+ while (p != pend) {
+ PATFETCH(c);
+
+ switch (c) {
+ case '$':
+ if (bufp->options & RE_OPTION_SINGLELINE) {
+ BUFPUSH(endbuf);
+ }
+ else {
+ p0 = p;
+ /* When testing what follows the $,
+ look past the \-constructs that don't consume anything. */
+
+ while (p0 != pend) {
+ if (*p0 == '\\' && p0 + 1 != pend
+ && (p0[1] == 'b' || p0[1] == 'B'))
+ p0 += 2;
+ else
+ break;
+ }
+ BUFPUSH(endline);
+ }
+ break;
+
+ case '^':
+ if (bufp->options & RE_OPTION_SINGLELINE)
+ BUFPUSH(begbuf);
+ else
+ BUFPUSH(begline);
+ break;
+
+ case '+':
+ case '?':
+ case '*':
+ /* If there is no previous pattern, char not special. */
+ if (!laststart) {
+ snprintf(error_msg, ERROR_MSG_MAX_SIZE,
+ "invalid regular expression; there's no previous pattern, to which '%c' would define cardinality at %d",
+ c, p-pattern);
+ FREE_AND_RETURN(stackb, error_msg);
+ }
+ /* If there is a sequence of repetition chars,
+ collapse it down to just one. */
+ zero_times_ok = c != '+';
+ many_times_ok = c != '?';
+ greedy = 1;
+ if (p != pend) {
+ PATFETCH(c);
+ switch (c) {
+ case '?':
+ greedy = 0;
+ break;
+ case '*':
+ case '+':
+ goto nested_meta;
+ default:
+ PATUNFETCH;
+ break;
+ }
+ }
+
+ repeat:
+ /* Star, etc. applied to an empty pattern is equivalent
+ to an empty pattern. */
+ if (!laststart)
+ break;
+
+ if (greedy && many_times_ok && *laststart == anychar && b - laststart <= 2) {
+ if (b[-1] == stop_paren)
+ b--;
+ if (zero_times_ok)
+ *laststart = anychar_repeat;
+ else {
+ BUFPUSH(anychar_repeat);
+ }
+ break;
+ }
+ /* Now we know whether or not zero matches is allowed
+ and also whether or not two or more matches is allowed. */
+ if (many_times_ok) {
+ /* If more than one repetition is allowed, put in at the
+ end a backward relative jump from b to before the next
+ jump we're going to put in below (which jumps from
+ laststart to after this jump). */
+ GET_BUFFER_SPACE(3);
+ store_jump(b,greedy?maybe_finalize_jump:finalize_push,laststart-3);
+ b += 3; /* Because store_jump put stuff here. */
+ }
+
+ /* On failure, jump from laststart to next pattern, which will be the
+ end of the buffer after this jump is inserted. */
+ GET_BUFFER_SPACE(3);
+ insert_jump(on_failure_jump, laststart, b + 3, b);
+ b += 3;
+
+ if (zero_times_ok) {
+ if (greedy == 0) {
+ GET_BUFFER_SPACE(3);
+ insert_jump(try_next, laststart, b + 3, b);
+ b += 3;
+ }
+ }
+ else {
+ /* At least one repetition is required, so insert a
+ `dummy_failure_jump' before the initial
+ `on_failure_jump' instruction of the loop. This
+ effects a skip over that instruction the first time
+ we hit that loop. */
+ GET_BUFFER_SPACE(3);
+ insert_jump(dummy_failure_jump, laststart, laststart + 6, b);
+ b += 3;
+ }
+ break;
+
+ case '.':
+ laststart = b;
+ BUFPUSH(anychar);
+ break;
+
+ case '[':
+ if (p == pend)
+ FREE_AND_RETURN(stackb, "invalid regular expression; '[' can't be the last character ie. can't start range at the end of pattern");
+ while ((b - bufp->buffer + 9 + (1 << BYTEWIDTH) / BYTEWIDTH)
+ > bufp->allocated)
+ EXTEND_BUFFER;
+
+ laststart = b;
+ if (*p == '^') {
+ BUFPUSH(charset_not);
+ p++;
+ }
+ else
+ BUFPUSH(charset);
+ p0 = p;
+
+ BUFPUSH((1 << BYTEWIDTH) / BYTEWIDTH);
+ /* Clear the whole map */
+ memset(b, 0, (1 << BYTEWIDTH) / BYTEWIDTH + 2);
+
+ had_mbchar = 0;
+ had_num_literal = 0;
+ had_char_class = 0;
+
+ /* Read in characters and ranges, setting map bits. */
+ for (;;) {
+ int size;
+ unsigned last = (unsigned)-1;
+
+ if ((size = EXTRACT_UNSIGNED(&b[(1 << BYTEWIDTH) / BYTEWIDTH])) || current_mbctype) {
+ /* Ensure the space is enough to hold another interval
+ of multi-byte chars in charset(_not)?. */
+ size = (1 << BYTEWIDTH) / BYTEWIDTH + 2 + size*8 + 8;
+ while (b + size + 1 > bufp->buffer + bufp->allocated)
+ EXTEND_BUFFER;
+ }
+ range_retry:
+ if (range && had_char_class) {
+ FREE_AND_RETURN(stackb, "invalid regular expression; can't use character class as an end value of range");
+ }
+ PATFETCH_RAW(c);
+
+ if (c == ']') {
+ if (p == p0 + 1) {
+ if (p == pend)
+ FREE_AND_RETURN(stackb, "invalid regular expression; empty character class");
+ re_warning("character class has `]' without escape");
+ }
+ else
+ /* Stop if this isn't merely a ] inside a bracket
+ expression, but rather the end of a bracket
+ expression. */
+ break;
+ }
+ /* Look ahead to see if it's a range when the last thing
+ was a character class. */
+ if (had_char_class && c == '-' && *p != ']')
+ FREE_AND_RETURN(stackb, "invalid regular expression; can't use character class as a start value of range");
+ if (ismbchar(c)) {
+ PATFETCH_MBC(c);
+ had_mbchar++;
+ }
+ had_char_class = 0;
+
+ if (c == '-' && ((p != p0 + 1 && *p != ']') ||
+ (p[0] == '-' && p[1] != ']') ||
+ range))
+ re_warning("character class has `-' without escape");
+ if (c == '[' && *p != ':')
+ re_warning("character class has `[' without escape");
+
+ /* \ escapes characters when inside [...]. */
+ if (c == '\\') {
+ PATFETCH_RAW(c);
+ switch (c) {
+ case 'w':
+ for (c = 0; c < (1 << BYTEWIDTH); c++) {
+ if (SYNTAX(c) == Sword ||
+ (!current_mbctype && SYNTAX(c) == Sword2))
+ SET_LIST_BIT(c);
+ }
+ if (current_mbctype) {
+ set_list_bits(0x80, 0xffffffff, b);
+ }
+ had_char_class = 1;
+ last = -1;
+ continue;
+
+ case 'W':
+ for (c = 0; c < (1 << BYTEWIDTH); c++) {
+ if (SYNTAX(c) != Sword &&
+ ((current_mbctype && !re_mbctab[c]) ||
+ (!current_mbctype && SYNTAX(c) != Sword2)))
+ SET_LIST_BIT(c);
+ }
+ had_char_class = 1;
+ last = -1;
+ continue;
+
+ case 's':
+ for (c = 0; c < 256; c++)
+ if (ISSPACE(c))
+ SET_LIST_BIT(c);
+ had_char_class = 1;
+ last = -1;
+ continue;
+
+ case 'S':
+ for (c = 0; c < 256; c++)
+ if (!ISSPACE(c))
+ SET_LIST_BIT(c);
+ if (current_mbctype)
+ set_list_bits(0x80, 0xffffffff, b);
+ had_char_class = 1;
+ last = -1;
+ continue;
+
+ case 'd':
+ for (c = '0'; c <= '9'; c++)
+ SET_LIST_BIT(c);
+ had_char_class = 1;
+ last = -1;
+ continue;
+
+ case 'D':
+ for (c = 0; c < 256; c++)
+ if (!ISDIGIT(c))
+ SET_LIST_BIT(c);
+ if (current_mbctype)
+ set_list_bits(0x80, 0xffffffff, b);
+ had_char_class = 1;
+ last = -1;
+ continue;
+
+ case 'x':
+ c = scan_hex(p, 2, &numlen);
+ if (numlen == 0) goto invalid_escape;
+ p += numlen;
+ had_num_literal = 1;
+ break;
+
+ case '0': case '1': case '2': case '3': case '4':
+ case '5': case '6': case '7': case '8': case '9':
+ PATUNFETCH;
+ c = scan_oct(p, 3, &numlen);
+ p += numlen;
+ had_num_literal = 1;
+ break;
+
+ case 'M':
+ case 'C':
+ case 'c':
+ {
+ const char *pp;
+
+ --p;
+ c = read_special(p, pend, &pp);
+ if (c > 255) goto invalid_escape;
+ p = pp;
+ had_num_literal = 1;
+ }
+ break;
+
+ default:
+ c = read_backslash(c);
+ if (ismbchar(c)) {
+ PATFETCH_MBC(c);
+ had_mbchar++;
+ }
+ break;
+ }
+ }
+ else if (c == '[' && *p == ':') { /* [:...:] */
+ /* Leave room for the null. */
+ char str[CHAR_CLASS_MAX_LENGTH + 1];
+
+ PATFETCH_RAW(c);
+ c1 = 0;
+
+ /* If pattern is `[[:'. */
+ if (p == pend)
+ FREE_AND_RETURN(stackb, "invalid regular expression; re can't end '[[:'");
+
+ for (;;) {
+ PATFETCH_RAW(c);
+ if (c == ':' || c == ']' || p == pend
+ || c1 == CHAR_CLASS_MAX_LENGTH)
+ break;
+ str[c1++] = c;
+ }
+ str[c1] = '\0';
+
+ /* If isn't a word bracketed by `[:' and `:]':
+ undo the ending character, the letters, and
+ the leading `:' and `['. */
+ if (c == ':' && *p == ']') {
+ int ch;
+ char is_alnum = STREQ(str, "alnum");
+ char is_alpha = STREQ(str, "alpha");
+ char is_blank = STREQ(str, "blank");
+ char is_cntrl = STREQ(str, "cntrl");
+ char is_digit = STREQ(str, "digit");
+ char is_graph = STREQ(str, "graph");
+ char is_lower = STREQ(str, "lower");
+ char is_print = STREQ(str, "print");
+ char is_punct = STREQ(str, "punct");
+ char is_space = STREQ(str, "space");
+ char is_upper = STREQ(str, "upper");
+ char is_xdigit = STREQ(str, "xdigit");
+
+ if (!IS_CHAR_CLASS(str)){
+ snprintf(error_msg, ERROR_MSG_MAX_SIZE,
+ "invalid regular expression; [:%s:] is not a character class", str);
+ FREE_AND_RETURN(stackb, error_msg);
+ }
+
+ /* Throw away the ] at the end of the character class. */
+ PATFETCH(c);
+
+ if (p == pend)
+ FREE_AND_RETURN(stackb, "invalid regular expression; range doesn't have ending ']' after a character class");
+
+ for (ch = 0; ch < 1 << BYTEWIDTH; ch++) {
+ if ( (is_alnum && ISALNUM(ch))
+ || (is_alpha && ISALPHA(ch))
+ || (is_blank && ISBLANK(ch))
+ || (is_cntrl && ISCNTRL(ch))
+ || (is_digit && ISDIGIT(ch))
+ || (is_graph && ISGRAPH(ch))
+ || (is_lower && ISLOWER(ch))
+ || (is_print && ISPRINT(ch))
+ || (is_punct && ISPUNCT(ch))
+ || (is_space && ISSPACE(ch))
+ || (is_upper && ISUPPER(ch))
+ || (is_xdigit && ISXDIGIT(ch)))
+ SET_LIST_BIT(ch);
+ }
+ had_char_class = 1;
+ continue;
+ }
+ else {
+ c1 += 2;
+ while (c1--)
+ PATUNFETCH;
+ re_warning("character class has `[' without escape");
+ c = '[';
+ }
+ }
+
+ /* Get a range. */
+ if (range) {
+ if (last > c)
+ goto invalid_pattern;
+
+ range = 0;
+ if (had_mbchar == 0) {
+ if (TRANSLATE_P()) {
+ for (;last<=c;last++)
+ SET_LIST_BIT(translate[last]);
+ }
+ else {
+ for (;last<=c;last++)
+ SET_LIST_BIT(last);
+ }
+ }
+ else if (had_mbchar == 2) {
+ set_list_bits(last, c, b);
+ }
+ else {
+ /* restriction: range between sbc and mbc */
+ goto invalid_pattern;
+ }
+ }
+ else if (p[0] == '-' && p[1] != ']') {
+ last = c;
+ PATFETCH_RAW(c1);
+ range = 1;
+ goto range_retry;
+ }
+ else {
+ if (TRANSLATE_P() && c < 0x100) c = (unsigned char)translate[c];
+ if (had_mbchar == 0 && (!current_mbctype || !had_num_literal)) {
+ SET_LIST_BIT(c);
+ had_num_literal = 0;
+ }
+ else {
+ set_list_bits(c, c, b);
+ }
+ }
+ had_mbchar = 0;
+ }
+
+ /* Discard any character set/class bitmap bytes that are all
+ 0 at the end of the map. Decrement the map-length byte too. */
+ while ((int)b[-1] > 0 && b[b[-1] - 1] == 0)
+ b[-1]--;
+ if (b[-1] != (1 << BYTEWIDTH) / BYTEWIDTH)
+ memmove(&b[(unsigned char)b[-1]], &b[(1 << BYTEWIDTH) / BYTEWIDTH],
+ 2 + EXTRACT_UNSIGNED(&b[(1 << BYTEWIDTH) / BYTEWIDTH])*8);
+ b += b[-1] + 2 + EXTRACT_UNSIGNED(&b[(unsigned char)b[-1]])*8;
+ had_num_literal = 0;
+ break;
+
+ case '(':
+ {
+ int old_options = options;
+ int push_option = 0;
+ int casefold = 0;
+
+ PATFETCH(c);
+ if (c == '?') {
+ int negative = 0;
+
+ PATFETCH_RAW(c);
+ switch (c) {
+ case 'x': case 'm': case 'i': case '-':
+ for (;;) {
+ switch (c) {
+ case '-':
+ negative = 1;
+ break;
+
+ case ':':
+ case ')':
+ break;
+
+ case 'x':
+ if (negative)
+ options &= ~RE_OPTION_EXTENDED;
+ else
+ options |= RE_OPTION_EXTENDED;
+ break;
+
+ case 'm':
+ if (negative) {
+ if (options&RE_OPTION_MULTILINE) {
+ options &= ~RE_OPTION_MULTILINE;
+ }
+ }
+ else if (!(options&RE_OPTION_MULTILINE)) {
+ options |= RE_OPTION_MULTILINE;
+ }
+ push_option = 1;
+ break;
+
+ case 'i':
+ if (negative) {
+ if (options&RE_OPTION_IGNORECASE) {
+ options &= ~RE_OPTION_IGNORECASE;
+ }
+ }
+ else if (!(options&RE_OPTION_IGNORECASE)) {
+ options |= RE_OPTION_IGNORECASE;
+ }
+ casefold = 1;
+ break;
+
+ default:
+ FREE_AND_RETURN(stackb, "undefined (?...) inline option");
+ }
+ if (c == ')') {
+ c = '#'; /* read whole in-line options */
+ break;
+ }
+ if (c == ':') break;
+ PATFETCH_RAW(c);
+ }
+ break;
+
+ case '#':
+ for (;;) {
+ PATFETCH(c);
+ if (c == ')') break;
+ }
+ c = '#';
+ break;
+
+ case ':':
+ case '=':
+ case '!':
+ case '>':
+ break;
+
+ default:
+ FREE_AND_RETURN(stackb, "undefined (?...) sequence");
+ }
+ }
+ else {
+ PATUNFETCH;
+ c = '(';
+ }
+ if (c == '#') {
+ if (push_option) {
+ BUFPUSH(option_set);
+ BUFPUSH(options);
+ }
+ if (casefold) {
+ if (options & RE_OPTION_IGNORECASE)
+ BUFPUSH(casefold_on);
+ else
+ BUFPUSH(casefold_off);
+ }
+ break;
+ }
+ if (stackp+8 >= stacke) {
+ DOUBLE_STACK(int);
+ }
+
+ /* Laststart should point to the start_memory that we are about
+ to push (unless the pattern has RE_NREGS or more ('s). */
+ /* obsolete: now RE_NREGS is just a default register size. */
+ *stackp++ = b - bufp->buffer;
+ *stackp++ = fixup_alt_jump ? fixup_alt_jump - bufp->buffer + 1 : 0;
+ *stackp++ = begalt - bufp->buffer;
+ switch (c) {
+ case '(':
+ BUFPUSH(start_memory);
+ BUFPUSH(regnum);
+ *stackp++ = regnum++;
+ *stackp++ = b - bufp->buffer;
+ BUFPUSH(0);
+ /* too many ()'s to fit in a byte. (max 254) */
+ if (regnum >= RE_REG_MAX) goto too_big;
+ break;
+
+ case '=':
+ case '!':
+ case '>':
+ BUFPUSH(start_nowidth);
+ *stackp++ = b - bufp->buffer;
+ BUFPUSH(0); /* temporary value */
+ BUFPUSH(0);
+ if (c != '!') break;
+
+ BUFPUSH(on_failure_jump);
+ *stackp++ = b - bufp->buffer;
+ BUFPUSH(0); /* temporary value */
+ BUFPUSH(0);
+ break;
+
+ case ':':
+ BUFPUSH(start_paren);
+ pending_exact = 0;
+ default:
+ break;
+ }
+ if (push_option) {
+ BUFPUSH(option_set);
+ BUFPUSH(options);
+ }
+ if (casefold) {
+ if (options & RE_OPTION_IGNORECASE)
+ BUFPUSH(casefold_on);
+ else
+ BUFPUSH(casefold_off);
+ }
+ *stackp++ = c;
+ *stackp++ = old_options;
+ fixup_alt_jump = 0;
+ laststart = 0;
+ begalt = b;
+ }
+ break;
+
+ case ')':
+ if (stackp == stackb)
+ FREE_AND_RETURN(stackb, "unmatched )");
+
+ pending_exact = 0;
+ if (fixup_alt_jump) {
+ /* Push a dummy failure point at the end of the
+ alternative for a possible future
+ `finalize_jump' to pop. See comments at
+ `push_dummy_failure' in `re_match'. */
+ BUFPUSH(push_dummy_failure);
+
+ /* We allocated space for this jump when we assigned
+ to `fixup_alt_jump', in the `handle_alt' case below. */
+ store_jump(fixup_alt_jump, jump, b);
+ }
+ if (options != stackp[-1]) {
+ if ((options ^ stackp[-1]) & RE_OPTION_IGNORECASE) {
+ BUFPUSH((options&RE_OPTION_IGNORECASE)?casefold_off:casefold_on);
+ }
+ if ((options ^ stackp[-1]) != RE_OPTION_IGNORECASE) {
+ BUFPUSH(option_set);
+ BUFPUSH(stackp[-1]);
+ }
+ }
+ p0 = b;
+ options = *--stackp;
+ switch (c = *--stackp) {
+ case '(':
+ {
+ char *loc = bufp->buffer + *--stackp;
+ *loc = regnum - stackp[-1];
+ BUFPUSH(stop_memory);
+ BUFPUSH(stackp[-1]);
+ BUFPUSH(regnum - stackp[-1]);
+ stackp--;
+ }
+ break;
+
+ case '!':
+ BUFPUSH(pop_and_fail);
+ /* back patch */
+ STORE_NUMBER(bufp->buffer+stackp[-1], b - bufp->buffer - stackp[-1] - 2);
+ stackp--;
+ /* fall through */
+ case '=':
+ BUFPUSH(stop_nowidth);
+ /* tell stack-pos place to start_nowidth */
+ STORE_NUMBER(bufp->buffer+stackp[-1], b - bufp->buffer - stackp[-1] - 2);
+ BUFPUSH(0); /* space to hold stack pos */
+ BUFPUSH(0);
+ stackp--;
+ break;
+
+ case '>':
+ BUFPUSH(stop_backtrack);
+ /* tell stack-pos place to start_nowidth */
+ STORE_NUMBER(bufp->buffer+stackp[-1], b - bufp->buffer - stackp[-1] - 2);
+ BUFPUSH(0); /* space to hold stack pos */
+ BUFPUSH(0);
+ stackp--;
+ break;
+
+ case ':':
+ BUFPUSH(stop_paren);
+ break;
+
+ default:
+ break;
+ }
+ begalt = *--stackp + bufp->buffer;
+ stackp--;
+ fixup_alt_jump = *stackp ? *stackp + bufp->buffer - 1 : 0;
+ laststart = *--stackp + bufp->buffer;
+ if (c == '!' || c == '=') laststart = b;
+ break;
+
+ case '|':
+ /* Insert before the previous alternative a jump which
+ jumps to this alternative if the former fails. */
+ GET_BUFFER_SPACE(3);
+ insert_jump(on_failure_jump, begalt, b + 6, b);
+ pending_exact = 0;
+ b += 3;
+ /* The alternative before this one has a jump after it
+ which gets executed if it gets matched. Adjust that
+ jump so it will jump to this alternative's analogous
+ jump (put in below, which in turn will jump to the next
+ (if any) alternative's such jump, etc.). The last such
+ jump jumps to the correct final destination. A picture:
+ _____ _____
+ | | | |
+ | v | v
+ a | b | c
+
+ If we are at `b', then fixup_alt_jump right now points to a
+ three-byte space after `a'. We'll put in the jump, set
+ fixup_alt_jump to right after `b', and leave behind three
+ bytes which we'll fill in when we get to after `c'. */
+
+ if (fixup_alt_jump)
+ store_jump(fixup_alt_jump, jump_past_alt, b);
+
+ /* Mark and leave space for a jump after this alternative,
+ to be filled in later either by next alternative or
+ when know we're at the end of a series of alternatives. */
+ fixup_alt_jump = b;
+ GET_BUFFER_SPACE(3);
+ b += 3;
+
+ laststart = 0;
+ begalt = b;
+ break;
+
+ case '{':
+ /* If there is no previous pattern, this is an invalid pattern. */
+ if (!laststart) {
+ snprintf(error_msg, ERROR_MSG_MAX_SIZE,
+ "invalid regular expression; there's no previous pattern, to which '{' would define cardinality at %d",
+ p-pattern);
+ FREE_AND_RETURN(stackb, error_msg);
+ }
+ if( p == pend)
+ FREE_AND_RETURN(stackb, "invalid regular expression; '{' can't be last character" );
+
+ beg_interval = p - 1;
+
+ lower_bound = -1; /* So can see if are set. */
+ upper_bound = -1;
+ GET_UNSIGNED_NUMBER(lower_bound);
+ if (c == ',') {
+ GET_UNSIGNED_NUMBER(upper_bound);
+ }
+ else
+ /* Interval such as `{1}' => match exactly once. */
+ upper_bound = lower_bound;
+
+ if (lower_bound < 0 || c != '}')
+ goto unfetch_interval;
+
+ if (lower_bound >= RE_DUP_MAX || upper_bound >= RE_DUP_MAX)
+ FREE_AND_RETURN(stackb, "too big quantifier in {,}");
+ if (upper_bound < 0) upper_bound = RE_DUP_MAX;
+ if (lower_bound > upper_bound)
+ FREE_AND_RETURN(stackb, "can't do {n,m} with n > m");
+
+ beg_interval = 0;
+ pending_exact = 0;
+
+ greedy = 1;
+ if (p != pend) {
+ PATFETCH(c);
+ if (c == '?') greedy = 0;
+ else PATUNFETCH;
+ }
+
+ if (lower_bound == 0) {
+ zero_times_ok = 1;
+ if (upper_bound == RE_DUP_MAX) {
+ many_times_ok = 1;
+ goto repeat;
+ }
+ if (upper_bound == 1) {
+ many_times_ok = 0;
+ goto repeat;
+ }
+ }
+ if (lower_bound == 1) {
+ if (upper_bound == 1) {
+ /* No need to repeat */
+ break;
+ }
+ if (upper_bound == RE_DUP_MAX) {
+ many_times_ok = 1;
+ zero_times_ok = 0;
+ goto repeat;
+ }
+ }
+
+ /* If upper_bound is zero, don't want to succeed at all;
+ jump from laststart to b + 3, which will be the end of
+ the buffer after this jump is inserted. */
+
+ if (upper_bound == 0) {
+ GET_BUFFER_SPACE(3);
+ insert_jump(jump, laststart, b + 3, b);
+ b += 3;
+ break;
+ }
+
+ /* If lower_bound == upper_bound, repeat count can be removed */
+ if (lower_bound == upper_bound) {
+ int mcnt;
+ int skip_stop_paren = 0;
+
+ if (b[-1] == stop_paren) {
+ skip_stop_paren = 1;
+ b--;
+ }
+
+ if (*laststart == exactn && laststart[1]+2 == b - laststart
+ && laststart[1]*lower_bound < 256) {
+ mcnt = laststart[1];
+ GET_BUFFER_SPACE((lower_bound-1)*mcnt);
+ laststart[1] = lower_bound*mcnt;
+ while (--lower_bound) {
+ memcpy(b, laststart+2, mcnt);
+ b += mcnt;
+ }
+ if (skip_stop_paren) BUFPUSH(stop_paren);
+ break;
+ }
+
+ if (lower_bound < 5 && b - laststart < 10) {
+ /* 5 and 10 are the magic numbers */
+
+ mcnt = b - laststart;
+ GET_BUFFER_SPACE((lower_bound-1)*mcnt);
+ while (--lower_bound) {
+ memcpy(b, laststart, mcnt);
+ b += mcnt;
+ }
+ if (skip_stop_paren) BUFPUSH(stop_paren);
+ break;
+ }
+ if (skip_stop_paren) b++; /* push back stop_paren */
+ }
+
+ /* Otherwise, we have a nontrivial interval. When
+ we're all done, the pattern will look like:
+ set_number_at <jump count> <upper bound>
+ set_number_at <succeed_n count> <lower bound>
+ succeed_n <after jump addr> <succed_n count>
+ <body of loop>
+ jump_n <succeed_n addr> <jump count>
+ (The upper bound and `jump_n' are omitted if
+ `upper_bound' is 1, though.) */
+ { /* If the upper bound is > 1, we need to insert
+ more at the end of the loop. */
+ unsigned nbytes = upper_bound == 1 ? 10 : 20;
+
+ GET_BUFFER_SPACE(nbytes);
+ /* Initialize lower bound of the `succeed_n', even
+ though it will be set during matching by its
+ attendant `set_number_at' (inserted next),
+ because `re_compile_fastmap' needs to know.
+ Jump to the `jump_n' we might insert below. */
+ insert_jump_n(succeed_n, laststart, b + (nbytes/2),
+ b, lower_bound);
+ b += 5; /* Just increment for the succeed_n here. */
+
+ /* Code to initialize the lower bound. Insert
+ before the `succeed_n'. The `5' is the last two
+ bytes of this `set_number_at', plus 3 bytes of
+ the following `succeed_n'. */
+ insert_op_2(set_number_at, laststart, b, 5, lower_bound);
+ b += 5;
+
+ if (upper_bound > 1) {
+ /* More than one repetition is allowed, so
+ append a backward jump to the `succeed_n'
+ that starts this interval.
+
+ When we've reached this during matching,
+ we'll have matched the interval once, so
+ jump back only `upper_bound - 1' times. */
+ GET_BUFFER_SPACE(5);
+ store_jump_n(b, greedy?jump_n:finalize_push_n, laststart + 5,
+ upper_bound - 1);
+ b += 5;
+
+ /* The location we want to set is the second
+ parameter of the `jump_n'; that is `b-2' as
+ an absolute address. `laststart' will be
+ the `set_number_at' we're about to insert;
+ `laststart+3' the number to set, the source
+ for the relative address. But we are
+ inserting into the middle of the pattern --
+ so everything is getting moved up by 5.
+ Conclusion: (b - 2) - (laststart + 3) + 5,
+ i.e., b - laststart.
+
+ We insert this at the beginning of the loop
+ so that if we fail during matching, we'll
+ reinitialize the bounds. */
+ insert_op_2(set_number_at, laststart, b, b - laststart,
+ upper_bound - 1);
+ b += 5;
+ }
+ }
+ break;
+
+ unfetch_interval:
+ /* If an invalid interval, match the characters as literals. */
+ re_warning("regexp has invalid interval");
+ p = beg_interval;
+ beg_interval = 0;
+
+ /* normal_char and normal_backslash need `c'. */
+ PATFETCH(c);
+ goto normal_char;
+
+ case '\\':
+ if (p == pend)
+ FREE_AND_RETURN(stackb, "invalid regular expression; '\\' can't be last character");
+ /* Do not translate the character after the \, so that we can
+ distinguish, e.g., \B from \b, even if we normally would
+ translate, e.g., B to b. */
+ PATFETCH_RAW(c);
+ switch (c) {
+ case 's':
+ case 'S':
+ case 'd':
+ case 'D':
+ while (b - bufp->buffer + 9 + (1 << BYTEWIDTH) / BYTEWIDTH
+ > bufp->allocated)
+ EXTEND_BUFFER;
+
+ laststart = b;
+ if (c == 's' || c == 'd') {
+ BUFPUSH(charset);
+ }
+ else {
+ BUFPUSH(charset_not);
+ }
+
+ BUFPUSH((1 << BYTEWIDTH) / BYTEWIDTH);
+ memset(b, 0, (1 << BYTEWIDTH) / BYTEWIDTH + 2);
+ if (c == 's' || c == 'S') {
+ SET_LIST_BIT(' ');
+ SET_LIST_BIT('\t');
+ SET_LIST_BIT('\n');
+ SET_LIST_BIT('\r');
+ SET_LIST_BIT('\f');
+ }
+ else {
+ char cc;
+
+ for (cc = '0'; cc <= '9'; cc++) {
+ SET_LIST_BIT(cc);
+ }
+ }
+
+ while ((int)b[-1] > 0 && b[b[-1] - 1] == 0)
+ b[-1]--;
+ if (b[-1] != (1 << BYTEWIDTH) / BYTEWIDTH)
+ memmove(&b[(unsigned char)b[-1]], &b[(1 << BYTEWIDTH) / BYTEWIDTH],
+ 2 + EXTRACT_UNSIGNED(&b[(1 << BYTEWIDTH) / BYTEWIDTH])*8);
+ b += b[-1] + 2 + EXTRACT_UNSIGNED(&b[(unsigned char)b[-1]])*8;
+ break;
+
+ case 'w':
+ laststart = b;
+ BUFPUSH(wordchar);
+ break;
+
+ case 'W':
+ laststart = b;
+ BUFPUSH(notwordchar);
+ break;
+
+#ifndef RUBY
+ case '<':
+ BUFPUSH(wordbeg);
+ break;
+
+ case '>':
+ BUFPUSH(wordend);
+ break;
+#endif
+
+ case 'b':
+ BUFPUSH(wordbound);
+ break;
+
+ case 'B':
+ BUFPUSH(notwordbound);
+ break;
+
+ case 'A':
+ BUFPUSH(begbuf);
+ break;
+
+ case 'Z':
+ if ((bufp->options & RE_OPTION_SINGLELINE) == 0) {
+ BUFPUSH(endbuf2);
+ break;
+ }
+ /* fall through */
+ case 'z':
+ BUFPUSH(endbuf);
+ break;
+
+ case 'G':
+ BUFPUSH(begpos);
+ break;
+
+ /* hex */
+ case 'x':
+ had_mbchar = 0;
+ c = scan_hex(p, 2, &numlen);
+ if (numlen == 0) goto invalid_escape;
+ p += numlen;
+ had_num_literal = 1;
+ goto numeric_char;
+
+ /* octal */
+ case '0':
+ had_mbchar = 0;
+ c = scan_oct(p, 2, &numlen);
+ p += numlen;
+ had_num_literal = 1;
+ goto numeric_char;
+
+ /* back-ref or octal */
+ case '1': case '2': case '3':
+ case '4': case '5': case '6':
+ case '7': case '8': case '9':
+ PATUNFETCH;
+ p0 = p;
+
+ had_mbchar = 0;
+ c1 = 0;
+ GET_UNSIGNED_NUMBER(c1);
+ if (!ISDIGIT(c)) PATUNFETCH;
+
+ if (9 < c1 && c1 >= regnum) {
+ /* need to get octal */
+ c = scan_oct(p0, 3, &numlen) & 0xff;
+ p = p0 + numlen;
+ c1 = 0;
+ had_num_literal = 1;
+ goto numeric_char;
+ }
+
+ laststart = b;
+ BUFPUSH(duplicate);
+ BUFPUSH(c1);
+ break;
+
+ case 'M':
+ case 'C':
+ case 'c':
+ p0 = --p;
+ c = read_special(p, pend, &p0);
+ if (c > 255) goto invalid_escape;
+ p = p0;
+ had_num_literal = 1;
+ goto numeric_char;
+
+ default:
+ c = read_backslash(c);
+ goto normal_char;
+ }
+ break;
+
+ case '#':
+ if (options & RE_OPTION_EXTENDED) {
+ while (p != pend) {
+ PATFETCH(c);
+ if (c == '\n') break;
+ }
+ break;
+ }
+ goto normal_char;
+
+ case ' ':
+ case '\t':
+ case '\f':
+ case '\r':
+ case '\n':
+ if (options & RE_OPTION_EXTENDED)
+ break;
+
+ default:
+ if (c == ']')
+ re_warning("regexp has `]' without escape");
+ else if (c == '}')
+ re_warning("regexp has `}' without escape");
+ normal_char: /* Expects the character in `c'. */
+ had_mbchar = 0;
+ if (ismbchar(c)) {
+ had_mbchar = 1;
+ c1 = p - pattern;
+ }
+ numeric_char:
+ nextp = p + mbclen(c) - 1;
+ if (!pending_exact || pending_exact + *pending_exact + 1 != b
+ || *pending_exact >= (c1 ? 0176 : 0177)
+ || (nextp < pend &&
+ ( *nextp == '+' || *nextp == '?'
+ || *nextp == '*' || *nextp == '^'
+ || *nextp == '{'))) {
+ laststart = b;
+ BUFPUSH(exactn);
+ pending_exact = b;
+ BUFPUSH(0);
+ }
+ if (had_num_literal || c == 0xff) {
+ BUFPUSH(0xff);
+ (*pending_exact)++;
+ had_num_literal = 0;
+ }
+ BUFPUSH(c);
+ (*pending_exact)++;
+ if (had_mbchar) {
+ int len = mbclen(c) - 1;
+ while (len--) {
+ PATFETCH_RAW(c);
+ BUFPUSH(c);
+ (*pending_exact)++;
+ }
+ }
+ }
+ }
+
+ if (fixup_alt_jump)
+ store_jump(fixup_alt_jump, jump, b);
+
+ if (stackp != stackb)
+ FREE_AND_RETURN(stackb, "unmatched (");
+
+ /* set optimize flags */
+ laststart = bufp->buffer;
+ if (laststart != b) {
+ if (*laststart == dummy_failure_jump) laststart += 3;
+ else if (*laststart == try_next) laststart += 3;
+ if (*laststart == anychar_repeat) {
+ bufp->options |= RE_OPTIMIZE_ANCHOR;
+ }
+ }
+
+ bufp->used = b - bufp->buffer;
+ bufp->re_nsub = regnum;
+ laststart = bufp->buffer;
+ if (laststart != b) {
+ if (*laststart == start_memory) laststart += 3;
+ if (*laststart == exactn) {
+ bufp->options |= RE_OPTIMIZE_EXACTN;
+ bufp->must = laststart+1;
+ }
+ }
+ if (!bufp->must) {
+ bufp->must = calculate_must_string(bufp->buffer, b);
+ }
+ if (current_mbctype == MBCTYPE_SJIS) bufp->options |= RE_OPTIMIZE_NO_BM;
+ else if (bufp->must) {
+ int i;
+ int len = (unsigned char)bufp->must[0];
+
+ for (i=1; i<len; i++) {
+ if ((unsigned char)bufp->must[i] == 0xff ||
+ (current_mbctype && ismbchar(bufp->must[i]))) {
+ bufp->options |= RE_OPTIMIZE_NO_BM;
+ break;
+ }
+ }
+ if (!(bufp->options & RE_OPTIMIZE_NO_BM)) {
+ bufp->must_skip = (int *) xmalloc((1 << BYTEWIDTH)*sizeof(int));
+ bm_init_skip(bufp->must_skip, (unsigned char*)bufp->must+1,
+ (unsigned char)bufp->must[0],
+ (unsigned char*)(MAY_TRANSLATE()?translate:0));
+ }
+ }
+
+ bufp->regstart = TMALLOC(regnum, unsigned char*);
+ bufp->regend = TMALLOC(regnum, unsigned char*);
+ bufp->old_regstart = TMALLOC(regnum, unsigned char*);
+ bufp->old_regend = TMALLOC(regnum, unsigned char*);
+ bufp->reg_info = TMALLOC(regnum, register_info_type);
+ bufp->best_regstart = TMALLOC(regnum, unsigned char*);
+ bufp->best_regend = TMALLOC(regnum, unsigned char*);
+ FREE_AND_RETURN(stackb, 0);
+
+ invalid_pattern:
+ FREE_AND_RETURN(stackb, "invalid regular expression");
+
+ end_of_pattern:
+ FREE_AND_RETURN(stackb, "premature end of regular expression");
+
+ too_big:
+ FREE_AND_RETURN(stackb, "regular expression too big");
+
+ memory_exhausted:
+ FREE_AND_RETURN(stackb, "memory exhausted");
+
+ nested_meta:
+ FREE_AND_RETURN(stackb, "nested *?+ in regexp");
+
+ invalid_escape:
+ FREE_AND_RETURN(stackb, "Invalid escape character syntax");
+}
+
+void
+re_free_pattern(bufp)
+ struct re_pattern_buffer *bufp;
+{
+ xfree(bufp->buffer);
+ xfree(bufp->fastmap);
+ if (bufp->must_skip) xfree(bufp->must_skip);
+
+ xfree(bufp->regstart);
+ xfree(bufp->regend);
+ xfree(bufp->old_regstart);
+ xfree(bufp->old_regend);
+ xfree(bufp->best_regstart);
+ xfree(bufp->best_regend);
+ xfree(bufp->reg_info);
+ xfree(bufp);
+}
+
+/* Store a jump of the form <OPCODE> <relative address>.
+ Store in the location FROM a jump operation to jump to relative
+ address FROM - TO. OPCODE is the opcode to store. */
+
+static void
+store_jump(from, opcode, to)
+ char *from, *to;
+ int opcode;
+{
+ from[0] = (char)opcode;
+ STORE_NUMBER(from + 1, to - (from + 3));
+}
+
+
+/* Open up space before char FROM, and insert there a jump to TO.
+ CURRENT_END gives the end of the storage not in use, so we know
+ how much data to copy up. OP is the opcode of the jump to insert.
+
+ If you call this function, you must zero out pending_exact. */
+
+static void
+insert_jump(op, from, to, current_end)
+ int op;
+ char *from, *to, *current_end;
+{
+ register char *pfrom = current_end; /* Copy from here... */
+ register char *pto = current_end + 3; /* ...to here. */
+
+ while (pfrom != from)
+ *--pto = *--pfrom;
+ store_jump(from, op, to);
+}
+
+
+/* Store a jump of the form <opcode> <relative address> <n> .
+
+ Store in the location FROM a jump operation to jump to relative
+ address FROM - TO. OPCODE is the opcode to store, N is a number the
+ jump uses, say, to decide how many times to jump.
+
+ If you call this function, you must zero out pending_exact. */
+
+static void
+store_jump_n(from, opcode, to, n)
+ char *from, *to;
+ int opcode;
+ unsigned n;
+{
+ from[0] = (char)opcode;
+ STORE_NUMBER(from + 1, to - (from + 3));
+ STORE_NUMBER(from + 3, n);
+}
+
+
+/* Similar to insert_jump, but handles a jump which needs an extra
+ number to handle minimum and maximum cases. Open up space at
+ location FROM, and insert there a jump to TO. CURRENT_END gives the
+ end of the storage in use, so we know how much data to copy up. OP is
+ the opcode of the jump to insert.
+
+ If you call this function, you must zero out pending_exact. */
+
+static void
+insert_jump_n(op, from, to, current_end, n)
+ int op;
+ char *from, *to, *current_end;
+ unsigned n;
+{
+ register char *pfrom = current_end; /* Copy from here... */
+ register char *pto = current_end + 5; /* ...to here. */
+
+ while (pfrom != from)
+ *--pto = *--pfrom;
+ store_jump_n(from, op, to, n);
+}
+
+
+#if 0
+/* Open up space at location THERE, and insert operation OP.
+ CURRENT_END gives the end of the storage in use, so
+ we know how much data to copy up.
+
+ If you call this function, you must zero out pending_exact. */
+
+static void
+insert_op(op, there, current_end)
+ int op;
+ char *there, *current_end;
+{
+ register char *pfrom = current_end; /* Copy from here... */
+ register char *pto = current_end + 1; /* ...to here. */
+
+ while (pfrom != there)
+ *--pto = *--pfrom;
+
+ there[0] = (char)op;
+}
+#endif
+
+
+/* Open up space at location THERE, and insert operation OP followed by
+ NUM_1 and NUM_2. CURRENT_END gives the end of the storage in use, so
+ we know how much data to copy up.
+
+ If you call this function, you must zero out pending_exact. */
+
+static void
+insert_op_2(op, there, current_end, num_1, num_2)
+ int op;
+ char *there, *current_end;
+ int num_1, num_2;
+{
+ register char *pfrom = current_end; /* Copy from here... */
+ register char *pto = current_end + 5; /* ...to here. */
+
+ while (pfrom != there)
+ *--pto = *--pfrom;
+
+ there[0] = (char)op;
+ STORE_NUMBER(there + 1, num_1);
+ STORE_NUMBER(there + 3, num_2);
+}
+
+
+#define trans_eq(c1, c2, translate) (translate?(translate[c1]==translate[c2]):((c1)==(c2)))
+static int
+slow_match(little, lend, big, bend, translate)
+ const unsigned char *little, *lend;
+ const unsigned char *big, *bend;
+ const unsigned char *translate;
+{
+ int c;
+
+ while (little < lend && big < bend) {
+ c = *little++;
+ if (c == 0xff)
+ c = *little++;
+ if (!trans_eq(*big++, c, translate)) break;
+ }
+ if (little == lend) return 1;
+ return 0;
+}
+
+static int
+slow_search(little, llen, big, blen, translate)
+ const unsigned char *little;
+ int llen;
+ const unsigned char *big;
+ int blen;
+ const char *translate;
+{
+ const unsigned char *bsave = big;
+ const unsigned char *bend = big + blen;
+ register int c;
+ int fescape = 0;
+
+ c = *little;
+ if (c == 0xff) {
+ c = little[1];
+ fescape = 1;
+ }
+ else if (translate && !ismbchar(c)) {
+ c = translate[c];
+ }
+
+ while (big < bend) {
+ /* look for first character */
+ if (fescape) {
+ while (big < bend) {
+ if (*big == c) break;
+ big++;
+ }
+ }
+ else if (translate && !ismbchar(c)) {
+ while (big < bend) {
+ if (ismbchar(*big)) big+=mbclen(*big)-1;
+ else if (translate[*big] == c) break;
+ big++;
+ }
+ }
+ else {
+ while (big < bend) {
+ if (*big == c) break;
+ if (ismbchar(*big)) big+=mbclen(*big)-1;
+ big++;
+ }
+ }
+
+ if (slow_match(little, little+llen, big, bend, (unsigned char *)translate))
+ return big - bsave;
+
+ big+=mbclen(*big);
+ }
+ return -1;
+}
+
+static void
+bm_init_skip(skip, pat, m, translate)
+ int *skip;
+ unsigned char *pat;
+ int m;
+ const unsigned char *translate;
+{
+ int j, c;
+
+ for (c=0; c<256; c++) {
+ skip[c] = m;
+ }
+ if (translate) {
+ for (j=0; j<m-1; j++) {
+ skip[translate[pat[j]]] = m-1-j;
+ }
+ }
+ else {
+ for (j=0; j<m-1; j++) {
+ skip[pat[j]] = m-1-j;
+ }
+ }
+}
+
+static int
+bm_search(little, llen, big, blen, skip, translate)
+ const unsigned char *little;
+ int llen;
+ const unsigned char *big;
+ int blen;
+ int *skip;
+ const unsigned char *translate;
+{
+ int i, j, k;
+
+ i = llen-1;
+ if (translate) {
+ while (i < blen) {
+ k = i;
+ j = llen-1;
+ while (j >= 0 && translate[big[k]] == translate[little[j]]) {
+ k--;
+ j--;
+ }
+ if (j < 0) return k+1;
+
+ i += skip[translate[big[i]]];
+ }
+ return -1;
+ }
+ while (i < blen) {
+ k = i;
+ j = llen-1;
+ while (j >= 0 && big[k] == little[j]) {
+ k--;
+ j--;
+ }
+ if (j < 0) return k+1;
+
+ i += skip[big[i]];
+ }
+ return -1;
+}
+
+/* Given a pattern, compute a fastmap from it. The fastmap records
+ which of the (1 << BYTEWIDTH) possible characters can start a string
+ that matches the pattern. This fastmap is used by re_search to skip
+ quickly over totally implausible text.
+
+ The caller must supply the address of a (1 << BYTEWIDTH)-byte data
+ area as bufp->fastmap.
+ The other components of bufp describe the pattern to be used. */
+static int
+re_compile_fastmap0(bufp)
+ struct re_pattern_buffer *bufp;
+{
+ unsigned char *pattern = (unsigned char*)bufp->buffer;
+ int size = bufp->used;
+ register char *fastmap = bufp->fastmap;
+ register unsigned char *p = pattern;
+ register unsigned char *pend = pattern + size;
+ register int j, k;
+ unsigned is_a_succeed_n;
+
+
+ unsigned char *stacka[NFAILURES];
+ unsigned char **stackb = stacka;
+ unsigned char **stackp = stackb;
+ unsigned char **stacke = stackb + NFAILURES;
+ int options = bufp->options;
+
+ memset(fastmap, 0, (1 << BYTEWIDTH));
+ bufp->fastmap_accurate = 1;
+ bufp->can_be_null = 0;
+
+ while (p) {
+ is_a_succeed_n = 0;
+ if (p == pend) {
+ bufp->can_be_null = 1;
+ break;
+ }
+#ifdef SWITCH_ENUM_BUG
+ switch ((int)((enum regexpcode)*p++))
+#else
+ switch ((enum regexpcode)*p++)
+#endif
+ {
+ case exactn:
+ if (p[1] == 0xff) {
+ if (TRANSLATE_P())
+ fastmap[translate[p[2]]] = 2;
+ else
+ fastmap[p[2]] = 2;
+ bufp->options |= RE_OPTIMIZE_BMATCH;
+ }
+ else if (TRANSLATE_P())
+ fastmap[translate[p[1]]] = 1;
+ else
+ fastmap[p[1]] = 1;
+ break;
+
+ case begline:
+ case begbuf:
+ case begpos:
+ case endbuf:
+ case endbuf2:
+ case wordbound:
+ case notwordbound:
+ case wordbeg:
+ case wordend:
+ case pop_and_fail:
+ case push_dummy_failure:
+ case start_paren:
+ case stop_paren:
+ continue;
+
+ case casefold_on:
+ bufp->options |= RE_MAY_IGNORECASE;
+ options |= RE_OPTION_IGNORECASE;
+ continue;
+
+ case casefold_off:
+ options &= ~RE_OPTION_IGNORECASE;
+ continue;
+
+ case option_set:
+ options = *p++;
+ continue;
+
+ case endline:
+ if (TRANSLATE_P())
+ fastmap[translate['\n']] = 1;
+ else
+ fastmap['\n'] = 1;
+ if ((options & RE_OPTION_SINGLELINE) == 0 && bufp->can_be_null == 0)
+ bufp->can_be_null = 2;
+ break;
+
+ case jump_n:
+ case finalize_jump:
+ case maybe_finalize_jump:
+ case jump:
+ case jump_past_alt:
+ case dummy_failure_jump:
+ case finalize_push:
+ case finalize_push_n:
+ EXTRACT_NUMBER_AND_INCR(j, p);
+ p += j;
+ if (j > 0)
+ continue;
+ /* Jump backward reached implies we just went through
+ the body of a loop and matched nothing.
+ Opcode jumped to should be an on_failure_jump.
+ Just treat it like an ordinary jump.
+ For a * loop, it has pushed its failure point already;
+ If so, discard that as redundant. */
+
+ if ((enum regexpcode)*p != on_failure_jump
+ && (enum regexpcode)*p != try_next
+ && (enum regexpcode)*p != succeed_n)
+ continue;
+ p++;
+ EXTRACT_NUMBER_AND_INCR(j, p);
+ p += j;
+ if (stackp != stackb && *stackp == p)
+ stackp--; /* pop */
+ continue;
+
+ case try_next:
+ case start_nowidth:
+ case stop_nowidth:
+ case stop_backtrack:
+ p += 2;
+ continue;
+
+ case succeed_n:
+ is_a_succeed_n = 1;
+ /* Get to the number of times to succeed. */
+ EXTRACT_NUMBER(k, p + 2);
+ /* Increment p past the n for when k != 0. */
+ if (k != 0) {
+ p += 4;
+ continue;
+ }
+ /* fall through */
+
+ case on_failure_jump:
+ EXTRACT_NUMBER_AND_INCR(j, p);
+ if (p + j < pend) {
+ if (stackp == stacke) {
+ EXPAND_FAIL_STACK();
+ }
+ *++stackp = p + j; /* push */
+ }
+ else {
+ bufp->can_be_null = 1;
+ }
+ if (is_a_succeed_n)
+ EXTRACT_NUMBER_AND_INCR(k, p); /* Skip the n. */
+ continue;
+
+ case set_number_at:
+ p += 4;
+ continue;
+
+ case start_memory:
+ case stop_memory:
+ p += 2;
+ continue;
+
+ case duplicate:
+ bufp->can_be_null = 1;
+ if (*p >= bufp->re_nsub) break;
+ fastmap['\n'] = 1;
+ case anychar_repeat:
+ case anychar:
+ for (j = 0; j < (1 << BYTEWIDTH); j++) {
+ if (j != '\n' || (options & RE_OPTION_MULTILINE))
+ fastmap[j] = 1;
+ }
+ if (bufp->can_be_null) {
+ FREE_AND_RETURN(stackb, 0);
+ }
+ /* Don't return; check the alternative paths
+ so we can set can_be_null if appropriate. */
+ if ((enum regexpcode)p[-1] == anychar_repeat) {
+ continue;
+ }
+ break;
+
+ case wordchar:
+ for (j = 0; j < 0x80; j++) {
+ if (SYNTAX(j) == Sword)
+ fastmap[j] = 1;
+ }
+ switch (current_mbctype) {
+ case MBCTYPE_ASCII:
+ for (j = 0x80; j < (1 << BYTEWIDTH); j++) {
+ if (SYNTAX(j) == Sword2)
+ fastmap[j] = 1;
+ }
+ break;
+ case MBCTYPE_EUC:
+ case MBCTYPE_SJIS:
+ case MBCTYPE_UTF8:
+ for (j = 0x80; j < (1 << BYTEWIDTH); j++) {
+ if (re_mbctab[j])
+ fastmap[j] = 1;
+ }
+ break;
+ }
+ break;
+
+ case notwordchar:
+ for (j = 0; j < 0x80; j++)
+ if (SYNTAX(j) != Sword)
+ fastmap[j] = 1;
+ switch (current_mbctype) {
+ case MBCTYPE_ASCII:
+ for (j = 0x80; j < (1 << BYTEWIDTH); j++) {
+ if (SYNTAX(j) != Sword2)
+ fastmap[j] = 1;
+ }
+ break;
+ case MBCTYPE_EUC:
+ case MBCTYPE_SJIS:
+ case MBCTYPE_UTF8:
+ for (j = 0x80; j < (1 << BYTEWIDTH); j++) {
+ if (!re_mbctab[j])
+ fastmap[j] = 1;
+ }
+ break;
+ }
+ break;
+
+ case charset:
+ /* NOTE: Charset for single-byte chars never contain
+ multi-byte char. See set_list_bits(). */
+ for (j = *p++ * BYTEWIDTH - 1; j >= 0; j--)
+ if (p[j / BYTEWIDTH] & (1 << (j % BYTEWIDTH))) {
+ int tmp = TRANSLATE_P()?translate[j]:j;
+ fastmap[tmp] = 1;
+ }
+ {
+ unsigned short size;
+ unsigned long c, beg, end;
+
+ p += p[-1] + 2;
+ size = EXTRACT_UNSIGNED(&p[-2]);
+ for (j = 0; j < (int)size; j++) {
+ c = EXTRACT_MBC(&p[j*8]);
+ beg = WC2MBC1ST(c);
+ c = EXTRACT_MBC(&p[j*8+4]);
+ end = WC2MBC1ST(c);
+ /* set bits for 1st bytes of multi-byte chars. */
+ while (beg <= end) {
+ /* NOTE: Charset for multi-byte chars might contain
+ single-byte chars. We must reject them. */
+ if (c < 0x100) {
+ fastmap[beg] = 2;
+ bufp->options |= RE_OPTIMIZE_BMATCH;
+ }
+ else if (ismbchar(beg))
+ fastmap[beg] = 1;
+ beg++;
+ }
+ }
+ }
+ break;
+
+ case charset_not:
+ /* S: set of all single-byte chars.
+ M: set of all first bytes that can start multi-byte chars.
+ s: any set of single-byte chars.
+ m: any set of first bytes that can start multi-byte chars.
+
+ We assume S+M = U.
+ ___ _ _
+ s+m = (S*s+M*m). */
+ /* Chars beyond end of map must be allowed */
+ /* NOTE: Charset_not for single-byte chars might contain
+ multi-byte chars. See set_list_bits(). */
+ for (j = *p * BYTEWIDTH; j < (1 << BYTEWIDTH); j++)
+ if (!ismbchar(j))
+ fastmap[j] = 1;
+
+ for (j = *p++ * BYTEWIDTH - 1; j >= 0; j--)
+ if (!(p[j / BYTEWIDTH] & (1 << (j % BYTEWIDTH)))) {
+ if (!ismbchar(j))
+ fastmap[j] = 1;
+ }
+ {
+ unsigned short size;
+ unsigned long c, beg;
+ int num_literal = 0;
+
+ p += p[-1] + 2;
+ size = EXTRACT_UNSIGNED(&p[-2]);
+ if (size == 0) {
+ for (j = 0x80; j < (1 << BYTEWIDTH); j++)
+ if (ismbchar(j))
+ fastmap[j] = 1;
+ break;
+ }
+ for (j = 0,c = 0;j < (int)size; j++) {
+ unsigned int cc = EXTRACT_MBC(&p[j*8]);
+ beg = WC2MBC1ST(cc);
+ while (c <= beg) {
+ if (ismbchar(c))
+ fastmap[c] = 1;
+ c++;
+ }
+
+ cc = EXTRACT_MBC(&p[j*8+4]);
+ if (cc < 0xff) {
+ num_literal = 1;
+ while (c <= cc) {
+ if (ismbchar(c))
+ fastmap[c] = 1;
+ c++;
+ }
+ }
+ c = WC2MBC1ST(cc);
+ }
+
+ for (j = c; j < (1 << BYTEWIDTH); j++) {
+ if (num_literal)
+ fastmap[j] = 1;
+ if (ismbchar(j))
+ fastmap[j] = 1;
+ }
+ }
+ break;
+
+ case unused: /* pacify gcc -Wall */
+ break;
+ }
+
+ /* Get here means we have successfully found the possible starting
+ characters of one path of the pattern. We need not follow this
+ path any farther. Instead, look at the next alternative
+ remembered in the stack. */
+ if (stackp != stackb)
+ p = *stackp--; /* pop */
+ else
+ break;
+ }
+ FREE_AND_RETURN(stackb, 0);
+ memory_exhausted:
+ FREE_AND_RETURN(stackb, -2);
+}
+
+void
+re_compile_fastmap(bufp)
+ struct re_pattern_buffer *bufp;
+{
+ (void)re_compile_fastmap0(bufp);
+}
+
+/* adjust startpos value to the position between characters. */
+int
+re_mbc_startpos(string, size, startpos, range)
+ const char *string;
+ int size, startpos, range;
+{
+ int i = mbc_startpos(string, startpos);
+
+ if (i < startpos) {
+ if (range > 0) {
+ startpos = i + mbclen(string[i]);
+ }
+ else {
+ int len = mbclen(string[i]);
+ if (i + len <= startpos)
+ startpos = i + len;
+ else
+ startpos = i;
+ }
+ }
+ return startpos;
+}
+
+int
+re_adjust_startpos(bufp, string, size, startpos, range)
+ struct re_pattern_buffer *bufp;
+ const char *string;
+ int size, startpos, range;
+{
+ /* Update the fastmap now if not correct already. */
+ if (!bufp->fastmap_accurate) {
+ int ret = re_compile_fastmap0(bufp);
+ if (ret) return ret;
+ }
+
+ /* Adjust startpos for mbc string */
+ if (current_mbctype && startpos>0 && !(bufp->options&RE_OPTIMIZE_BMATCH)) {
+ startpos = re_mbc_startpos(string, size, startpos, range);
+ }
+ return startpos;
+}
+
+
+static int re_match_exec _((struct re_pattern_buffer *, const char *, int, int, int,
+ struct re_registers *));
+
+/* Using the compiled pattern in BUFP->buffer, first tries to match
+ STRING, starting first at index STARTPOS, then at STARTPOS + 1, and
+ so on. RANGE is the number of places to try before giving up. If
+ RANGE is negative, it searches backwards, i.e., the starting
+ positions tried are STARTPOS, STARTPOS - 1, etc. STRING is of SIZE.
+ In REGS, return the indices of STRING that matched the entire
+ BUFP->buffer and its contained subexpressions.
+
+ The value returned is the position in the strings at which the match
+ was found, or -1 if no match was found, or -2 if error (such as
+ failure stack overflow). */
+
+int
+re_search(bufp, string, size, startpos, range, regs)
+ struct re_pattern_buffer *bufp;
+ const char *string;
+ int size, startpos, range;
+ struct re_registers *regs;
+{
+ register char *fastmap = bufp->fastmap;
+ int val, anchor = 0, initpos = startpos;
+
+ /* Check for out-of-range starting position. */
+ if (startpos < 0 || startpos > size)
+ return -1;
+ if (!string) {
+ if (size == 0) string = "";
+ else return -1;
+ }
+
+ /* Update the fastmap now if not correct already. */
+ if (fastmap && !bufp->fastmap_accurate) {
+ int ret = re_compile_fastmap0(bufp);
+ if (ret) return ret;
+ }
+
+
+ /* If the search isn't to be a backwards one, don't waste time in a
+ search for a pattern that must be anchored. */
+ if (bufp->used > 0) {
+ switch ((enum regexpcode)bufp->buffer[0]) {
+ case begbuf:
+ begbuf_match:
+ if (range > 0) {
+ if (startpos > 0) return -1;
+ else {
+ val = re_match(bufp, string, size, 0, regs);
+ if (val >= 0) return 0;
+ return val;
+ }
+ }
+ break;
+
+ case begline:
+ anchor = 1;
+ break;
+
+ case begpos:
+ val = re_match(bufp, string, size, startpos, regs);
+ if (val >= 0) return startpos;
+ return val;
+
+ default:
+ break;
+ }
+ }
+ if (bufp->options & RE_OPTIMIZE_ANCHOR) {
+ if (bufp->options&RE_OPTION_MULTILINE && range > 0) {
+ goto begbuf_match;
+ }
+ anchor = 1;
+ }
+
+ if (bufp->must) {
+ int len = ((unsigned char*)bufp->must)[0];
+ int pos, pbeg, pend;
+
+ pbeg = startpos;
+ pend = startpos + range;
+ if (pbeg > pend) { /* swap pbeg,pend */
+ pos = pend; pend = pbeg; pbeg = pos;
+ }
+ pend = size;
+ if (bufp->options & RE_OPTIMIZE_NO_BM) {
+ pos = slow_search((unsigned char *)(bufp->must+1), len,
+ (unsigned char*)(string+pbeg), pend-pbeg,
+ (char *)(MAY_TRANSLATE()?translate:0));
+ }
+ else {
+ pos = bm_search((unsigned char *)(bufp->must+1), len,
+ (unsigned char *)(string+pbeg), pend-pbeg,
+ bufp->must_skip,
+ MAY_TRANSLATE()?translate:0);
+ }
+ if (pos == -1) return -1;
+ if (range > 0 && (bufp->options & RE_OPTIMIZE_EXACTN)) {
+ startpos += pos;
+ range -= pos;
+ if (range < 0) return -1;
+ }
+ }
+
+ for (;;) {
+ /* If a fastmap is supplied, skip quickly over characters that
+ cannot possibly be the start of a match. Note, however, that
+ if the pattern can possibly match the null string, we must
+ test it at each starting point so that we take the first null
+ string we get. */
+
+ if (fastmap && startpos < size
+ && bufp->can_be_null != 1 && !(anchor && startpos == 0)) {
+ if (range > 0) { /* Searching forwards. */
+ register unsigned char *p, c;
+ int irange = range;
+
+ p = (unsigned char*)string+startpos;
+
+ while (range > 0) {
+ c = *p++;
+ if (ismbchar(c)) {
+ int len;
+
+ if (fastmap[c])
+ break;
+ len = mbclen(c) - 1;
+ while (len--) {
+ c = *p++;
+ range--;
+ if (fastmap[c] == 2)
+ goto startpos_adjust;
+ }
+ }
+ else {
+ if (fastmap[MAY_TRANSLATE() ? translate[c] : c])
+ break;
+ }
+ range--;
+ }
+ startpos_adjust:
+ startpos += irange - range;
+ }
+ else { /* Searching backwards. */
+ register unsigned char c;
+
+ c = string[startpos];
+ c &= 0xff;
+ if (MAY_TRANSLATE() ? !fastmap[translate[c]] : !fastmap[c])
+ goto advance;
+ }
+ }
+
+ if (startpos > size) return -1;
+ if ((anchor || !bufp->can_be_null) && range > 0 && size > 0 && startpos == size)
+ return -1;
+ val = re_match_exec(bufp, string, size, startpos, initpos, regs);
+ if (val >= 0) return startpos;
+ if (val == -2) return -2;
+
+#ifndef NO_ALLOCA
+#ifdef C_ALLOCA
+ alloca(0);
+#endif /* C_ALLOCA */
+#endif /* NO_ALLOCA */
+
+ if (range > 0) {
+ if (anchor && startpos < size &&
+ (startpos < 1 || string[startpos-1] != '\n')) {
+ while (range > 0 && string[startpos] != '\n') {
+ range--;
+ startpos++;
+ }
+ }
+ }
+
+ advance:
+ if (!range)
+ break;
+ else if (range > 0) {
+ const char *d = string + startpos;
+
+ if (ismbchar(*d)) {
+ int len = mbclen(*d) - 1;
+ range-=len, startpos+=len;
+ if (!range)
+ break;
+ }
+ range--, startpos++;
+ }
+ else {
+ range++, startpos--;
+ {
+ const char *s, *d, *p;
+
+ s = string; d = string + startpos;
+ for (p = d; p-- > s && ismbchar(*p); )
+ /* --p >= s would not work on 80[12]?86.
+ (when the offset of s equals 0 other than huge model.) */
+ ;
+ if (!((d - p) & 1)) {
+ if (!range)
+ break;
+ range++, startpos--;
+ }
+ }
+ }
+ }
+ return -1;
+}
+
+
+
+
+/* The following are used for re_match, defined below: */
+
+/* Accessing macros used in re_match: */
+
+#define IS_ACTIVE(R) ((R).bits.is_active)
+#define MATCHED_SOMETHING(R) ((R).bits.matched_something)
+
+
+/* Macros used by re_match: */
+
+/* I.e., regstart, regend, and reg_info. */
+#define NUM_REG_ITEMS 3
+
+/* I.e., ptr and count. */
+#define NUM_COUNT_ITEMS 2
+
+/* Individual items aside from the registers. */
+#define NUM_NONREG_ITEMS 4
+
+/* We push at most this many things on the stack whenever we
+ fail. The `+ 2' refers to PATTERN_PLACE and STRING_PLACE, which are
+ arguments to the PUSH_FAILURE_POINT macro. */
+#define MAX_NUM_FAILURE_ITEMS (num_regs * NUM_REG_ITEMS + NUM_NONREG_ITEMS)
+
+/* We push this many things on the stack whenever we fail. */
+#define NUM_FAILURE_ITEMS (last_used_reg * NUM_REG_ITEMS + NUM_NONREG_ITEMS + 1)
+
+/* This pushes counter information for succeed_n and jump_n */
+#define PUSH_FAILURE_COUNT(ptr) \
+ do { \
+ int c; \
+ EXTRACT_NUMBER(c, ptr); \
+ ENSURE_FAIL_STACK(NUM_COUNT_ITEMS); \
+ *stackp++ = (unsigned char*)(long)c; \
+ *stackp++ = (ptr); \
+ num_failure_counts++; \
+ } while (0)
+
+/* This pushes most of the information about the current state we will want
+ if we ever fail back to it. */
+
+#define PUSH_FAILURE_POINT(pattern_place, string_place) \
+ do { \
+ long last_used_reg, this_reg; \
+ \
+ /* Find out how many registers are active or have been matched. \
+ (Aside from register zero, which is only set at the end.) */ \
+ for (last_used_reg = num_regs-1; last_used_reg > 0; last_used_reg--)\
+ if (!REG_UNSET(regstart[last_used_reg])) \
+ break; \
+ \
+ ENSURE_FAIL_STACK(NUM_FAILURE_ITEMS); \
+ *stackp++ = (unsigned char*)(long)num_failure_counts; \
+ num_failure_counts = 0; \
+ \
+ /* Now push the info for each of those registers. */ \
+ for (this_reg = 1; this_reg <= last_used_reg; this_reg++) { \
+ *stackp++ = regstart[this_reg]; \
+ *stackp++ = regend[this_reg]; \
+ *stackp++ = reg_info[this_reg].word; \
+ } \
+ \
+ /* Push how many registers we saved. */ \
+ *stackp++ = (unsigned char*)last_used_reg; \
+ \
+ *stackp++ = pattern_place; \
+ *stackp++ = string_place; \
+ *stackp++ = (unsigned char*)(long)options; /* current option status */ \
+ *stackp++ = (unsigned char*)0; /* non-greedy flag */ \
+ } while(0)
+
+#define NON_GREEDY ((unsigned char*)1)
+
+#define POP_FAILURE_COUNT() \
+ do { \
+ unsigned char *ptr = *--stackp; \
+ int count = (long)*--stackp; \
+ STORE_NUMBER(ptr, count); \
+ } while (0)
+
+/* This pops what PUSH_FAILURE_POINT pushes. */
+
+#define POP_FAILURE_POINT() \
+ do { \
+ long temp; \
+ stackp -= NUM_NONREG_ITEMS; /* Remove failure points (and flag). */ \
+ temp = (long)*--stackp; /* How many regs pushed. */ \
+ temp *= NUM_REG_ITEMS; /* How much to take off the stack. */ \
+ stackp -= temp; /* Remove the register info. */ \
+ temp = (long)*--stackp; /* How many counters pushed. */ \
+ while (temp--) { \
+ POP_FAILURE_COUNT(); /* Remove the counter info. */ \
+ } \
+ num_failure_counts = 0; /* Reset num_failure_counts. */ \
+ } while(0)
+
+ /* Registers are set to a sentinel when they haven't yet matched. */
+#define REG_UNSET_VALUE ((unsigned char*)-1)
+#define REG_UNSET(e) ((e) == REG_UNSET_VALUE)
+
+#define PREFETCH if (d == dend) goto fail
+
+ /* Call this when have matched something; it sets `matched' flags for the
+ registers corresponding to the subexpressions of which we currently
+ are inside. */
+#define SET_REGS_MATCHED \
+ do { unsigned this_reg; \
+ for (this_reg = 0; this_reg < num_regs; this_reg++) { \
+ if (IS_ACTIVE(reg_info[this_reg])) \
+ MATCHED_SOMETHING(reg_info[this_reg]) = 1; \
+ else \
+ MATCHED_SOMETHING(reg_info[this_reg]) = 0; \
+ } \
+ } while(0)
+
+#define AT_STRINGS_BEG(d) ((d) == string)
+#define AT_STRINGS_END(d) ((d) == dend)
+
+#define IS_A_LETTER(d) (SYNTAX(*(d)) == Sword || \
+ (current_mbctype ? \
+ (re_mbctab[*(d)] && ((d)+mbclen(*(d)))<=dend): \
+ SYNTAX(*(d)) == Sword2))
+
+#define PREV_IS_A_LETTER(d) ((current_mbctype == MBCTYPE_SJIS)? \
+ IS_A_LETTER((d)-(!AT_STRINGS_BEG((d)-1)&& \
+ ismbchar((d)[-2])?2:1)): \
+ ((current_mbctype && ((d)[-1] >= 0x80)) || \
+ IS_A_LETTER((d)-1)))
+
+static void
+init_regs(regs, num_regs)
+ struct re_registers *regs;
+ unsigned int num_regs;
+{
+ int i;
+
+ regs->num_regs = num_regs;
+ if (num_regs < RE_NREGS)
+ num_regs = RE_NREGS;
+
+ if (regs->allocated == 0) {
+ regs->beg = TMALLOC(num_regs, int);
+ regs->end = TMALLOC(num_regs, int);
+ regs->allocated = num_regs;
+ }
+ else if (regs->allocated < num_regs) {
+ TREALLOC(regs->beg, num_regs, int);
+ TREALLOC(regs->end, num_regs, int);
+ regs->allocated = num_regs;
+ }
+ for (i=0; i<num_regs; i++) {
+ regs->beg[i] = regs->end[i] = -1;
+ }
+}
+
+/* Match the pattern described by BUFP against STRING, which is of
+ SIZE. Start the match at index POS in STRING. In REGS, return the
+ indices of STRING that matched the entire BUFP->buffer and its
+ contained subexpressions.
+
+ If bufp->fastmap is nonzero, then it had better be up to date.
+
+ The reason that the data to match are specified as two components
+ which are to be regarded as concatenated is so this function can be
+ used directly on the contents of an Emacs buffer.
+
+ -1 is returned if there is no match. -2 is returned if there is an
+ error (such as match stack overflow). Otherwise the value is the
+ length of the substring which was matched. */
+
+int
+re_match(bufp, string_arg, size, pos, regs)
+ struct re_pattern_buffer *bufp;
+ const char *string_arg;
+ int size, pos;
+ struct re_registers *regs;
+{
+ return re_match_exec(bufp, string_arg, size, pos, pos, regs);
+}
+
+static int
+re_match_exec(bufp, string_arg, size, pos, beg, regs)
+ struct re_pattern_buffer *bufp;
+ const char *string_arg;
+ int size, pos, beg;
+ struct re_registers *regs;
+{
+ register unsigned char *p = (unsigned char*)bufp->buffer;
+ unsigned char *p1;
+
+ /* Pointer to beyond end of buffer. */
+ register unsigned char *pend = p + bufp->used;
+
+ unsigned num_regs = bufp->re_nsub;
+
+ unsigned char *string = (unsigned char*)string_arg;
+
+ register unsigned char *d, *dend;
+ register int mcnt; /* Multipurpose. */
+ int options = bufp->options;
+
+ /* Failure point stack. Each place that can handle a failure further
+ down the line pushes a failure point on this stack. It consists of
+ restart, regend, and reg_info for all registers corresponding to the
+ subexpressions we're currently inside, plus the number of such
+ registers, and, finally, two char *'s. The first char * is where to
+ resume scanning the pattern; the second one is where to resume
+ scanning the strings. If the latter is zero, the failure point is a
+ ``dummy''; if a failure happens and the failure point is a dummy, it
+ gets discarded and the next next one is tried. */
+
+ unsigned char **const stacka = 0;
+ unsigned char **stackb;
+ unsigned char **stackp;
+ unsigned char **stacke;
+
+ /* Information on the contents of registers. These are pointers into
+ the input strings; they record just what was matched (on this
+ attempt) by a subexpression part of the pattern, that is, the
+ regnum-th regstart pointer points to where in the pattern we began
+ matching and the regnum-th regend points to right after where we
+ stopped matching the regnum-th subexpression. (The zeroth register
+ keeps track of what the whole pattern matches.) */
+
+ unsigned char **regstart = bufp->regstart;
+ unsigned char **regend = bufp->regend;
+
+ /* If a group that's operated upon by a repetition operator fails to
+ match anything, then the register for its start will need to be
+ restored because it will have been set to wherever in the string we
+ are when we last see its open-group operator. Similarly for a
+ register's end. */
+ unsigned char **old_regstart = bufp->old_regstart;
+ unsigned char **old_regend = bufp->old_regend;
+
+ /* The is_active field of reg_info helps us keep track of which (possibly
+ nested) subexpressions we are currently in. The matched_something
+ field of reg_info[reg_num] helps us tell whether or not we have
+ matched any of the pattern so far this time through the reg_num-th
+ subexpression. These two fields get reset each time through any
+ loop their register is in. */
+
+ register_info_type *reg_info = bufp->reg_info;
+
+ /* The following record the register info as found in the above
+ variables when we find a match better than any we've seen before.
+ This happens as we backtrack through the failure points, which in
+ turn happens only if we have not yet matched the entire string. */
+
+ unsigned best_regs_set = 0;
+ unsigned char **best_regstart = bufp->best_regstart;
+ unsigned char **best_regend = bufp->best_regend;
+
+ int num_failure_counts = 0;
+
+ if (regs) {
+ init_regs(regs, num_regs);
+ }
+
+ /* Initialize the stack. */
+ stackb = TMALLOC(MAX_NUM_FAILURE_ITEMS * NFAILURES, unsigned char*);
+ stackp = stackb;
+ stacke = &stackb[MAX_NUM_FAILURE_ITEMS * NFAILURES];
+
+#ifdef DEBUG_REGEX
+ fprintf(stderr, "Entering re_match(%s)\n", string_arg);
+#endif
+
+ /* Initialize subexpression text positions to -1 to mark ones that no
+ ( or ( and ) or ) has been seen for. Also set all registers to
+ inactive and mark them as not having matched anything or ever
+ failed. */
+ for (mcnt = 0; mcnt < num_regs; mcnt++) {
+ regstart[mcnt] = regend[mcnt]
+ = old_regstart[mcnt] = old_regend[mcnt]
+ = best_regstart[mcnt] = best_regend[mcnt] = REG_UNSET_VALUE;
+#ifdef __CHECKER__
+ reg_info[mcnt].word = 0;
+#endif
+ IS_ACTIVE (reg_info[mcnt]) = 0;
+ MATCHED_SOMETHING (reg_info[mcnt]) = 0;
+ }
+
+ /* Set up pointers to ends of strings.
+ Don't allow the second string to be empty unless both are empty. */
+
+
+ /* `p' scans through the pattern as `d' scans through the data. `dend'
+ is the end of the input string that `d' points within. `d' is
+ advanced into the following input string whenever necessary, but
+ this happens before fetching; therefore, at the beginning of the
+ loop, `d' can be pointing at the end of a string, but it cannot
+ equal string2. */
+
+ d = string + pos, dend = string + size;
+
+ /* This loops over pattern commands. It exits by returning from the
+ function if match is complete, or it drops through if match fails
+ at this starting point in the input data. */
+
+ for (;;) {
+#ifdef DEBUG_REGEX
+ fprintf(stderr,
+ "regex loop(%d): matching 0x%02d\n",
+ p - (unsigned char*)bufp->buffer,
+ *p);
+#endif
+ /* End of pattern means we might have succeeded. */
+ if (p == pend) {
+ /* If not end of string, try backtracking. Otherwise done. */
+ if ((bufp->options & RE_OPTION_LONGEST) && d != dend) {
+ if (best_regs_set) /* non-greedy, no need to backtrack */
+ goto restore_best_regs;
+ while (stackp != stackb && stackp[-1] == NON_GREEDY) {
+ if (best_regs_set) /* non-greedy, no need to backtrack */
+ goto restore_best_regs;
+ POP_FAILURE_POINT();
+ }
+ if (stackp != stackb) {
+ /* More failure points to try. */
+
+ /* If exceeds best match so far, save it. */
+ if (! best_regs_set || (d > best_regend[0])) {
+ best_regs_set = 1;
+ best_regend[0] = d; /* Never use regstart[0]. */
+
+ for (mcnt = 1; mcnt < num_regs; mcnt++) {
+ best_regstart[mcnt] = regstart[mcnt];
+ best_regend[mcnt] = regend[mcnt];
+ }
+ }
+ goto fail;
+ }
+ /* If no failure points, don't restore garbage. */
+ else if (best_regs_set) {
+ restore_best_regs:
+ /* Restore best match. */
+ d = best_regend[0];
+
+ for (mcnt = 0; mcnt < num_regs; mcnt++) {
+ regstart[mcnt] = best_regstart[mcnt];
+ regend[mcnt] = best_regend[mcnt];
+ }
+ }
+ }
+
+ /* If caller wants register contents data back, convert it
+ to indices. */
+ if (regs) {
+ regs->beg[0] = pos;
+ regs->end[0] = d - string;
+ for (mcnt = 1; mcnt < num_regs; mcnt++) {
+ if (REG_UNSET(regend[mcnt])) {
+ regs->beg[mcnt] = -1;
+ regs->end[mcnt] = -1;
+ continue;
+ }
+ regs->beg[mcnt] = regstart[mcnt] - string;
+ regs->end[mcnt] = regend[mcnt] - string;
+ }
+ }
+ FREE_AND_RETURN(stackb, (d - pos - string));
+ }
+
+ /* Otherwise match next pattern command. */
+#ifdef SWITCH_ENUM_BUG
+ switch ((int)((enum regexpcode)*p++))
+#else
+ switch ((enum regexpcode)*p++)
+#endif
+ {
+ /* ( [or `(', as appropriate] is represented by start_memory,
+ ) by stop_memory. Both of those commands are followed by
+ a register number in the next byte. The text matched
+ within the ( and ) is recorded under that number. */
+ case start_memory:
+ old_regstart[*p] = regstart[*p];
+ regstart[*p] = d;
+ IS_ACTIVE(reg_info[*p]) = 1;
+ MATCHED_SOMETHING(reg_info[*p]) = 0;
+ p += 2;
+ continue;
+
+ case stop_memory:
+ old_regend[*p] = regend[*p];
+ regend[*p] = d;
+ IS_ACTIVE(reg_info[*p]) = 0;
+ p += 2;
+ continue;
+
+ case start_paren:
+ case stop_paren:
+ break;
+
+ /* \<digit> has been turned into a `duplicate' command which is
+ followed by the numeric value of <digit> as the register number. */
+ case duplicate:
+ {
+ int regno = *p++; /* Get which register to match against */
+ register unsigned char *d2, *dend2;
+
+ /* Check if there's corresponding group */
+ if (regno >= num_regs) goto fail;
+ /* Check if corresponding group is still open */
+ if (IS_ACTIVE(reg_info[regno])) goto fail;
+
+ /* Where in input to try to start matching. */
+ d2 = regstart[regno];
+ if (REG_UNSET(d2)) goto fail;
+
+ /* Where to stop matching; if both the place to start and
+ the place to stop matching are in the same string, then
+ set to the place to stop, otherwise, for now have to use
+ the end of the first string. */
+
+ dend2 = regend[regno];
+ if (REG_UNSET(dend2)) goto fail;
+ for (;;) {
+ /* At end of register contents => success */
+ if (d2 == dend2) break;
+
+ /* If necessary, advance to next segment in data. */
+ PREFETCH;
+
+ /* How many characters left in this segment to match. */
+ mcnt = dend - d;
+
+ /* Want how many consecutive characters we can match in
+ one shot, so, if necessary, adjust the count. */
+ if (mcnt > dend2 - d2)
+ mcnt = dend2 - d2;
+
+ /* Compare that many; failure if mismatch, else move
+ past them. */
+ if ((options & RE_OPTION_IGNORECASE)
+ ? memcmp_translate(d, d2, mcnt)
+ : memcmp((char*)d, (char*)d2, mcnt))
+ goto fail;
+ d += mcnt, d2 += mcnt;
+ }
+ }
+ break;
+
+ case start_nowidth:
+ PUSH_FAILURE_POINT(0, d);
+ if (stackp - stackb > RE_DUP_MAX) {
+ FREE_AND_RETURN(stackb,(-2));
+ }
+ EXTRACT_NUMBER_AND_INCR(mcnt, p);
+ STORE_NUMBER(p+mcnt, stackp - stackb);
+ continue;
+
+ case stop_nowidth:
+ EXTRACT_NUMBER_AND_INCR(mcnt, p);
+ stackp = stackb + mcnt;
+ d = stackp[-3];
+ POP_FAILURE_POINT();
+ continue;
+
+ case stop_backtrack:
+ EXTRACT_NUMBER_AND_INCR(mcnt, p);
+ stackp = stackb + mcnt;
+ POP_FAILURE_POINT();
+ continue;
+
+ case pop_and_fail:
+ EXTRACT_NUMBER(mcnt, p+1);
+ stackp = stackb + mcnt;
+ POP_FAILURE_POINT();
+ goto fail;
+
+ case anychar:
+ PREFETCH;
+ if (ismbchar(*d)) {
+ if (d + mbclen(*d) > dend)
+ goto fail;
+ SET_REGS_MATCHED;
+ d += mbclen(*d);
+ break;
+ }
+ if (!(options&RE_OPTION_MULTILINE)
+ && (TRANSLATE_P() ? translate[*d] : *d) == '\n')
+ goto fail;
+ SET_REGS_MATCHED;
+ d++;
+ break;
+
+ case anychar_repeat:
+ for (;;) {
+ PUSH_FAILURE_POINT(p, d);
+ PREFETCH;
+ if (ismbchar(*d)) {
+ if (d + mbclen(*d) > dend)
+ goto fail;
+ SET_REGS_MATCHED;
+ d += mbclen(*d);
+ continue;
+ }
+ if (!(options&RE_OPTION_MULTILINE) &&
+ (TRANSLATE_P() ? translate[*d] : *d) == '\n')
+ goto fail;
+ SET_REGS_MATCHED;
+ d++;
+ }
+ break;
+
+ case charset:
+ case charset_not:
+ {
+ int not; /* Nonzero for charset_not. */
+ int part = 0; /* true if matched part of mbc */
+ unsigned char *dsave = d + 1;
+ int cc, c;
+
+ PREFETCH;
+ c = (unsigned char)*d++;
+ if (ismbchar(c)) {
+ if (d + mbclen(c) - 1 <= dend) {
+ cc = c;
+ MBC2WC(c, d);
+ not = is_in_list_mbc(c, p);
+ if (!not) {
+ part = not = is_in_list_sbc(cc, p);
+ }
+ } else {
+ not = is_in_list(c, p);
+ }
+ }
+ else {
+ if (TRANSLATE_P())
+ c = (unsigned char)translate[c];
+ not = is_in_list(c, p);
+ }
+
+ if (*(p - 1) == (unsigned char)charset_not) {
+ not = !not;
+ }
+ if (!not) goto fail;
+
+ p += 1 + *p + 2 + EXTRACT_UNSIGNED(&p[1 + *p])*8;
+ SET_REGS_MATCHED;
+
+ if (part) d = dsave;
+ break;
+ }
+
+ case begline:
+ if (size == 0 || AT_STRINGS_BEG(d))
+ break;
+ if (d[-1] == '\n' && !AT_STRINGS_END(d))
+ break;
+ goto fail;
+
+ case endline:
+ if (AT_STRINGS_END(d)) {
+ break;
+ }
+ else if (*d == '\n')
+ break;
+ goto fail;
+
+ /* Match at the very beginning of the string. */
+ case begbuf:
+ if (AT_STRINGS_BEG(d))
+ break;
+ goto fail;
+
+ /* Match at the very end of the data. */
+ case endbuf:
+ if (AT_STRINGS_END(d))
+ break;
+ goto fail;
+
+ /* Match at the very end of the data. */
+ case endbuf2:
+ if (AT_STRINGS_END(d)) {
+ break;
+ }
+ /* .. or newline just before the end of the data. */
+ if (*d == '\n' && AT_STRINGS_END(d+1))
+ break;
+ goto fail;
+
+ /* `or' constructs are handled by starting each alternative with
+ an on_failure_jump that points to the start of the next
+ alternative. Each alternative except the last ends with a
+ jump to the joining point. (Actually, each jump except for
+ the last one really jumps to the following jump, because
+ tensioning the jumps is a hassle.) */
+
+ /* The start of a stupid repeat has an on_failure_jump that points
+ past the end of the repeat text. This makes a failure point so
+ that on failure to match a repetition, matching restarts past
+ as many repetitions have been found with no way to fail and
+ look for another one. */
+
+ /* A smart repeat is similar but loops back to the on_failure_jump
+ so that each repetition makes another failure point. */
+
+ /* Match at the starting position. */
+ case begpos:
+ if (d - string == beg)
+ break;
+ goto fail;
+
+ case on_failure_jump:
+ on_failure:
+ EXTRACT_NUMBER_AND_INCR(mcnt, p);
+ PUSH_FAILURE_POINT(p + mcnt, d);
+ continue;
+
+ /* The end of a smart repeat has a maybe_finalize_jump back.
+ Change it either to a finalize_jump or an ordinary jump. */
+ case maybe_finalize_jump:
+ EXTRACT_NUMBER_AND_INCR(mcnt, p);
+ p1 = p;
+
+ /* Compare the beginning of the repeat with what in the
+ pattern follows its end. If we can establish that there
+ is nothing that they would both match, i.e., that we
+ would have to backtrack because of (as in, e.g., `a*a')
+ then we can change to finalize_jump, because we'll
+ never have to backtrack.
+
+ This is not true in the case of alternatives: in
+ `(a|ab)*' we do need to backtrack to the `ab' alternative
+ (e.g., if the string was `ab'). But instead of trying to
+ detect that here, the alternative has put on a dummy
+ failure point which is what we will end up popping. */
+
+ /* Skip over open/close-group commands. */
+ while (p1 + 2 < pend) {
+ if ((enum regexpcode)*p1 == stop_memory ||
+ (enum regexpcode)*p1 == start_memory)
+ p1 += 3; /* Skip over args, too. */
+ else if (/*(enum regexpcode)*p1 == start_paren ||*/
+ (enum regexpcode)*p1 == stop_paren)
+ p1 += 1;
+ else
+ break;
+ }
+
+ if (p1 == pend)
+ p[-3] = (unsigned char)finalize_jump;
+ else if (*p1 == (unsigned char)exactn ||
+ *p1 == (unsigned char)endline) {
+ register int c = *p1 == (unsigned char)endline ? '\n' : p1[2];
+ register unsigned char *p2 = p + mcnt;
+ /* p2[0] ... p2[2] are an on_failure_jump.
+ Examine what follows that. */
+ if (p2[3] == (unsigned char)exactn && p2[5] != c)
+ p[-3] = (unsigned char)finalize_jump;
+ else if (p2[3] == (unsigned char)charset ||
+ p2[3] == (unsigned char)charset_not) {
+ int not;
+ if (ismbchar(c)) {
+ unsigned char *pp = p1+3;
+ MBC2WC(c, pp);
+ }
+ /* `is_in_list()' is TRUE if c would match */
+ /* That means it is not safe to finalize. */
+ not = is_in_list(c, p2 + 4);
+ if (p2[3] == (unsigned char)charset_not)
+ not = !not;
+ if (!not)
+ p[-3] = (unsigned char)finalize_jump;
+ }
+ }
+ p -= 2; /* Point at relative address again. */
+ if (p[-1] != (unsigned char)finalize_jump) {
+ p[-1] = (unsigned char)jump;
+ goto nofinalize;
+ }
+ /* Note fall through. */
+
+ /* The end of a stupid repeat has a finalize_jump back to the
+ start, where another failure point will be made which will
+ point to after all the repetitions found so far. */
+
+ /* Take off failure points put on by matching on_failure_jump
+ because didn't fail. Also remove the register information
+ put on by the on_failure_jump. */
+ case finalize_jump:
+ if (stackp > stackb && stackp[-3] == d) {
+ p = stackp[-4];
+ POP_FAILURE_POINT();
+ continue;
+ }
+ POP_FAILURE_POINT();
+ /* Note fall through. */
+
+ /* We need this opcode so we can detect where alternatives end
+ in `group_match_null_string_p' et al. */
+ case jump_past_alt:
+ /* fall through */
+
+ /* Jump without taking off any failure points. */
+ case jump:
+ nofinalize:
+ EXTRACT_NUMBER_AND_INCR(mcnt, p);
+ if (mcnt < 0 && stackp > stackb && stackp[-3] == d) /* avoid infinite loop */
+ goto fail;
+ p += mcnt;
+ continue;
+
+ case dummy_failure_jump:
+ /* Normally, the on_failure_jump pushes a failure point, which
+ then gets popped at finalize_jump. We will end up at
+ finalize_jump, also, and with a pattern of, say, `a+', we
+ are skipping over the on_failure_jump, so we have to push
+ something meaningless for finalize_jump to pop. */
+ PUSH_FAILURE_POINT(0, 0);
+ goto nofinalize;
+
+ /* At the end of an alternative, we need to push a dummy failure
+ point in case we are followed by a `finalize_jump', because
+ we don't want the failure point for the alternative to be
+ popped. For example, matching `(a|ab)*' against `aab'
+ requires that we match the `ab' alternative. */
+ case push_dummy_failure:
+ /* See comments just above at `dummy_failure_jump' about the
+ two zeroes. */
+ p1 = p;
+ /* Skip over open/close-group commands. */
+ while (p1 + 2 < pend) {
+ if ((enum regexpcode)*p1 == stop_memory ||
+ (enum regexpcode)*p1 == start_memory)
+ p1 += 3; /* Skip over args, too. */
+ else if (/*(enum regexpcode)*p1 == start_paren ||*/
+ (enum regexpcode)*p1 == stop_paren)
+ p1 += 1;
+ else
+ break;
+ }
+ if (p1 < pend && (enum regexpcode)*p1 == jump)
+ p[-1] = unused;
+ else
+ PUSH_FAILURE_POINT(0, 0);
+ break;
+
+ /* Have to succeed matching what follows at least n times. Then
+ just handle like an on_failure_jump. */
+ case succeed_n:
+ EXTRACT_NUMBER(mcnt, p + 2);
+ /* Originally, this is how many times we HAVE to succeed. */
+ if (mcnt != 0) {
+ mcnt--;
+ p += 2;
+ PUSH_FAILURE_COUNT(p);
+ STORE_NUMBER_AND_INCR(p, mcnt);
+ PUSH_FAILURE_POINT(0, 0);
+ }
+ else {
+ goto on_failure;
+ }
+ continue;
+
+ case jump_n:
+ EXTRACT_NUMBER(mcnt, p + 2);
+ /* Originally, this is how many times we CAN jump. */
+ if (mcnt) {
+ mcnt--;
+ PUSH_FAILURE_COUNT(p + 2);
+ STORE_NUMBER(p + 2, mcnt);
+ goto nofinalize; /* Do the jump without taking off
+ any failure points. */
+ }
+ /* If don't have to jump any more, skip over the rest of command. */
+ else
+ p += 4;
+ continue;
+
+ case set_number_at:
+ EXTRACT_NUMBER_AND_INCR(mcnt, p);
+ p1 = p + mcnt;
+ EXTRACT_NUMBER_AND_INCR(mcnt, p);
+ STORE_NUMBER(p1, mcnt);
+ continue;
+
+ case try_next:
+ EXTRACT_NUMBER_AND_INCR(mcnt, p);
+ if (p + mcnt < pend) {
+ PUSH_FAILURE_POINT(p, d);
+ stackp[-1] = NON_GREEDY;
+ }
+ p += mcnt;
+ continue;
+
+ case finalize_push:
+ POP_FAILURE_POINT();
+ EXTRACT_NUMBER_AND_INCR(mcnt, p);
+ if (mcnt < 0 && stackp > stackb && stackp[-3] == d) /* avoid infinite loop */
+ goto fail;
+ PUSH_FAILURE_POINT(p + mcnt, d);
+ stackp[-1] = NON_GREEDY;
+ continue;
+
+ case finalize_push_n:
+ EXTRACT_NUMBER(mcnt, p + 2);
+ /* Originally, this is how many times we CAN jump. */
+ if (mcnt) {
+ int pos, i;
+
+ mcnt--;
+ STORE_NUMBER(p + 2, mcnt);
+ EXTRACT_NUMBER(pos, p);
+ EXTRACT_NUMBER(i, p+pos+5);
+ if (i > 0) goto nofinalize;
+ POP_FAILURE_POINT();
+ EXTRACT_NUMBER_AND_INCR(mcnt, p);
+ PUSH_FAILURE_POINT(p + mcnt, d);
+ stackp[-1] = NON_GREEDY;
+ p += 2; /* skip n */
+ }
+ /* If don't have to push any more, skip over the rest of command. */
+ else
+ p += 4;
+ continue;
+
+ /* Ignore these. Used to ignore the n of succeed_n's which
+ currently have n == 0. */
+ case unused:
+ continue;
+
+ case casefold_on:
+ options |= RE_OPTION_IGNORECASE;
+ continue;
+
+ case casefold_off:
+ options &= ~RE_OPTION_IGNORECASE;
+ continue;
+
+ case option_set:
+ options = *p++;
+ continue;
+
+ case wordbound:
+ if (AT_STRINGS_BEG(d)) {
+ if (AT_STRINGS_END(d)) goto fail;
+ if (IS_A_LETTER(d)) break;
+ else goto fail;
+ }
+ if (AT_STRINGS_END(d)) {
+ if (PREV_IS_A_LETTER(d)) break;
+ else goto fail;
+ }
+ if (PREV_IS_A_LETTER(d) != IS_A_LETTER(d))
+ break;
+ goto fail;
+
+ case notwordbound:
+ if (AT_STRINGS_BEG(d)) {
+ if (IS_A_LETTER(d)) goto fail;
+ else break;
+ }
+ if (AT_STRINGS_END(d)) {
+ if (PREV_IS_A_LETTER(d)) goto fail;
+ else break;
+ }
+ if (PREV_IS_A_LETTER(d) != IS_A_LETTER(d))
+ goto fail;
+ break;
+
+ case wordbeg:
+ if (IS_A_LETTER(d) && (AT_STRINGS_BEG(d) || !PREV_IS_A_LETTER(d)))
+ break;
+ goto fail;
+
+ case wordend:
+ if (!AT_STRINGS_BEG(d) && PREV_IS_A_LETTER(d)
+ && (!IS_A_LETTER(d) || AT_STRINGS_END(d)))
+ break;
+ goto fail;
+
+ case wordchar:
+ PREFETCH;
+ if (!IS_A_LETTER(d))
+ goto fail;
+ if (ismbchar(*d) && d + mbclen(*d) - 1 < dend)
+ d += mbclen(*d) - 1;
+ d++;
+ SET_REGS_MATCHED;
+ break;
+
+ case notwordchar:
+ PREFETCH;
+ if (IS_A_LETTER(d))
+ goto fail;
+ if (ismbchar(*d) && d + mbclen(*d) - 1 < dend)
+ d += mbclen(*d) - 1;
+ d++;
+ SET_REGS_MATCHED;
+ break;
+
+ case exactn:
+ /* Match the next few pattern characters exactly.
+ mcnt is how many characters to match. */
+ mcnt = *p++;
+ /* This is written out as an if-else so we don't waste time
+ testing `translate' inside the loop. */
+ if (TRANSLATE_P()) {
+ do {
+ unsigned char c;
+
+ PREFETCH;
+ if (*p == 0xff) {
+ p++;
+ if (!--mcnt
+ || AT_STRINGS_END(d)
+ || (unsigned char)*d++ != (unsigned char)*p++)
+ goto fail;
+ continue;
+ }
+ c = *d++;
+ if (ismbchar(c)) {
+ int n;
+
+ if (c != (unsigned char)*p++)
+ goto fail;
+ for (n = mbclen(c) - 1; n > 0; n--)
+ if (!--mcnt /* redundant check if pattern was
+ compiled properly. */
+ || AT_STRINGS_END(d)
+ || (unsigned char)*d++ != (unsigned char)*p++)
+ goto fail;
+ continue;
+ }
+ /* compiled code translation needed for ruby */
+ if ((unsigned char)translate[c] != (unsigned char)translate[*p++])
+ goto fail;
+ }
+ while (--mcnt);
+ }
+ else {
+ do {
+ PREFETCH;
+ if (*p == 0xff) {p++; mcnt--;}
+ if (*d++ != *p++) goto fail;
+ }
+ while (--mcnt);
+ }
+ SET_REGS_MATCHED;
+ break;
+ }
+#ifdef RUBY
+ CHECK_INTS;
+#endif
+ continue; /* Successfully executed one pattern command; keep going. */
+
+ /* Jump here if any matching operation fails. */
+ fail:
+ if (stackp != stackb) {
+ /* A restart point is known. Restart there and pop it. */
+ short last_used_reg, this_reg;
+
+ /* If this failure point is from a dummy_failure_point, just
+ skip it. */
+ if (stackp[-4] == 0 || (best_regs_set && stackp[-1] == NON_GREEDY)) {
+ POP_FAILURE_POINT();
+ goto fail;
+ }
+ stackp--; /* discard greedy flag */
+ options = (long)*--stackp;
+ d = *--stackp;
+ p = *--stackp;
+ /* Restore register info. */
+ last_used_reg = (long)*--stackp;
+
+ /* Make the ones that weren't saved -1 or 0 again. */
+ for (this_reg = num_regs - 1; this_reg > last_used_reg; this_reg--) {
+ regend[this_reg] = REG_UNSET_VALUE;
+ regstart[this_reg] = REG_UNSET_VALUE;
+ IS_ACTIVE(reg_info[this_reg]) = 0;
+ MATCHED_SOMETHING(reg_info[this_reg]) = 0;
+ }
+
+ /* And restore the rest from the stack. */
+ for ( ; this_reg > 0; this_reg--) {
+ reg_info[this_reg].word = *--stackp;
+ regend[this_reg] = *--stackp;
+ regstart[this_reg] = *--stackp;
+ }
+ mcnt = (long)*--stackp;
+ while (mcnt--) {
+ POP_FAILURE_COUNT();
+ }
+ if (p < pend) {
+ int is_a_jump_n = 0;
+ int failed_paren = 0;
+
+ p1 = p;
+ /* If failed to a backwards jump that's part of a repetition
+ loop, need to pop this failure point and use the next one. */
+ switch ((enum regexpcode)*p1) {
+ case jump_n:
+ case finalize_push_n:
+ is_a_jump_n = 1;
+ case maybe_finalize_jump:
+ case finalize_jump:
+ case finalize_push:
+ case jump:
+ p1++;
+ EXTRACT_NUMBER_AND_INCR(mcnt, p1);
+
+ if (mcnt >= 0) break; /* should be backward jump */
+ p1 += mcnt;
+
+ if (( is_a_jump_n && (enum regexpcode)*p1 == succeed_n) ||
+ (!is_a_jump_n && (enum regexpcode)*p1 == on_failure_jump)) {
+ if (failed_paren) {
+ p1++;
+ EXTRACT_NUMBER_AND_INCR(mcnt, p1);
+ PUSH_FAILURE_POINT(p1 + mcnt, d);
+ }
+ goto fail;
+ }
+ break;
+ default:
+ /* do nothing */;
+ }
+ }
+ }
+ else
+ break; /* Matching at this starting point really fails. */
+ }
+
+ if (best_regs_set)
+ goto restore_best_regs;
+
+ FREE_AND_RETURN(stackb,(-1)); /* Failure to match. */
+ memory_exhausted:
+ FREE_AND_RETURN(stackb,(-2));
+}
+
+
+static int
+memcmp_translate(s1, s2, len)
+ unsigned char *s1, *s2;
+ register int len;
+{
+ register unsigned char *p1 = s1, *p2 = s2, c;
+ while (len) {
+ c = *p1++;
+ if (ismbchar(c)) {
+ int n;
+
+ if (c != *p2++) return 1;
+ for (n = mbclen(c) - 1; n > 0; n--)
+ if (!--len || *p1++ != *p2++)
+ return 1;
+ }
+ else
+ if (translate[c] != translate[*p2++])
+ return 1;
+ len--;
+ }
+ return 0;
+}
+
+void
+re_copy_registers(regs1, regs2)
+ struct re_registers *regs1, *regs2;
+{
+ int i;
+
+ if (regs1 == regs2) return;
+ if (regs1->allocated == 0) {
+ regs1->beg = TMALLOC(regs2->num_regs, int);
+ regs1->end = TMALLOC(regs2->num_regs, int);
+ regs1->allocated = regs2->num_regs;
+ }
+ else if (regs1->allocated < regs2->num_regs) {
+ TREALLOC(regs1->beg, regs2->num_regs, int);
+ TREALLOC(regs1->end, regs2->num_regs, int);
+ regs1->allocated = regs2->num_regs;
+ }
+ for (i=0; i<regs2->num_regs; i++) {
+ regs1->beg[i] = regs2->beg[i];
+ regs1->end[i] = regs2->end[i];
+ }
+ regs1->num_regs = regs2->num_regs;
+}
+
+void
+re_free_registers(regs)
+ struct re_registers *regs;
+{
+ if (regs->allocated == 0) return;
+ if (regs->beg) xfree(regs->beg);
+ if (regs->end) xfree(regs->end);
+}
+
+/* Functions for multi-byte support.
+ Created for grep multi-byte extension Jul., 1993 by t^2 (Takahiro Tanimoto)
+ Last change: Jul. 9, 1993 by t^2 */
+static const unsigned char mbctab_ascii[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 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 char mbctab_euc[] = { /* 0xA1-0xFE */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 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,
+ 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,
+ 1, 1, 1, 1, 1, 1, 1, 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,
+};
+
+static const unsigned char mbctab_sjis[] = { /* 0x81-0x9F,0xE0-0xFC */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0
+};
+
+static const unsigned char mbctab_sjis_trail[] = { /* 0x40-0x7E,0x80-0xFC */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0
+};
+
+static const unsigned char mbctab_utf8[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 0, 0,
+};
+
+const unsigned char *re_mbctab = mbctab_ascii;
+
+void
+re_mbcinit(mbctype)
+ int mbctype;
+{
+ switch (mbctype) {
+ case MBCTYPE_ASCII:
+ re_mbctab = mbctab_ascii;
+ current_mbctype = MBCTYPE_ASCII;
+ break;
+ case MBCTYPE_EUC:
+ re_mbctab = mbctab_euc;
+ current_mbctype = MBCTYPE_EUC;
+ break;
+ case MBCTYPE_SJIS:
+ re_mbctab = mbctab_sjis;
+ current_mbctype = MBCTYPE_SJIS;
+ break;
+ case MBCTYPE_UTF8:
+ re_mbctab = mbctab_utf8;
+ current_mbctype = MBCTYPE_UTF8;
+ break;
+ }
+}
+
+#define mbc_isfirst(t, c) (t)[(unsigned char)(c)]
+#define mbc_len(t, c) ((t)[(unsigned char)(c)]+1)
+
+static unsigned int
+asc_startpos(string, pos)
+ const char *string;
+ unsigned int pos;
+{
+ return pos;
+}
+
+#define euc_islead(c) ((unsigned char)((c) - 0xa1) > 0xfe - 0xa1)
+#define euc_mbclen(c) mbc_len(mbctab_euc, (c))
+static unsigned int
+euc_startpos(string, pos)
+ const char *string;
+ unsigned int pos;
+{
+ unsigned int i = pos, w;
+
+ while (i > 0 && !euc_islead(string[i])) {
+ --i;
+ }
+ if (i == pos || i + (w = euc_mbclen(string[i])) > pos) {
+ return i;
+ }
+ i += w;
+ return i + ((pos - i) & ~1);
+}
+
+#define sjis_isfirst(c) mbc_isfirst(mbctab_sjis, (c))
+#define sjis_istrail(c) mbctab_sjis_trail[(unsigned char)(c)]
+#define sjis_mbclen(c) mbc_len(mbctab_sjis, (c))
+static unsigned int
+sjis_startpos(string, pos)
+ const char *string;
+ unsigned int pos;
+{
+ unsigned int i = pos, w;
+
+ if (i > 0 && sjis_istrail(string[i])) {
+ do {
+ if (!sjis_isfirst(string[--i])) {
+ ++i;
+ break;
+ }
+ } while (i > 0);
+ }
+ if (i == pos || i + (w = sjis_mbclen(string[i])) > pos) {
+ return i;
+ }
+ i += w;
+ return i + ((pos - i) & ~1);
+}
+
+#define utf8_islead(c) ((unsigned char)((c) & 0xc0) != 0x80)
+#define utf8_mbclen(c) mbc_len(mbctab_utf8, (c))
+static unsigned int
+utf8_startpos(string, pos)
+ const char *string;
+ unsigned int pos;
+{
+ unsigned int i = pos, w;
+
+ while (i > 0 && !utf8_islead(string[i])) {
+ --i;
+ }
+ if (i == pos || i + (w = utf8_mbclen(string[i])) > pos) {
+ return i;
+ }
+ return i + w;
+}
+
+/*
+ vi: sw=2 ts=8
+ Local variables:
+ mode : C
+ c-file-style : "gnu"
+ tab-width : 8
+ End
+*/
diff --git a/regex.h b/regex.h
new file mode 100644
index 0000000000..fe4dbbb9ab
--- /dev/null
+++ b/regex.h
@@ -0,0 +1,221 @@
+/* Definitions for data structures and routines for the regular
+ expression library, version 0.12.
+ Copyright (C) 1985,89,90,91,92,93,95,96,97,98 Free Software Foundation, Inc.
+
+ This file is part of the GNU C Library. Its master source is NOT part of
+ the C library, however. The master source lives in /gd/gnu/lib.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+
+ The GNU C Library 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
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file LGPL. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+/* Multi-byte extension added May, 1993 by t^2 (Takahiro Tanimoto)
+ Last change: May 21, 1993 by t^2 */
+/* modified for Ruby by matz@netlab.co.jp */
+
+#ifndef REGEX_H
+#define REGEX_H
+
+/* symbol mangling for ruby */
+#ifdef RUBY
+# define re_adjust_startpos ruby_re_adjust_startpos
+# define re_compile_fastmap ruby_re_compile_fastmap
+# define re_compile_pattern ruby_re_compile_pattern
+# define re_copy_registers ruby_re_copy_registers
+# define re_free_pattern ruby_re_free_pattern
+# define re_free_registers ruby_re_free_registers
+# define re_match ruby_re_match
+# define re_mbcinit ruby_re_mbcinit
+# define re_search ruby_re_search
+# define re_set_casetable ruby_re_set_casetable
+# define register_info_type ruby_register_info_type
+#endif
+
+#include <stddef.h>
+
+/* Define number of parens for which we record the beginnings and ends.
+ This affects how much space the `struct re_registers' type takes up. */
+#ifndef RE_NREGS
+#define RE_NREGS 10
+#endif
+
+#define BYTEWIDTH 8
+
+#define RE_REG_MAX ((1<<BYTEWIDTH)-1)
+
+/* Maximum number of duplicates an interval can allow. */
+#ifndef RE_DUP_MAX
+#define RE_DUP_MAX ((1 << 15) - 1)
+#endif
+
+
+/* If this bit is set, then character classes are supported; they are:
+ [:alpha:], [:upper:], [:lower:], [:digit:], [:alnum:], [:xdigit:],
+ [:space:], [:print:], [:punct:], [:graph:], and [:cntrl:].
+ If not set, then character classes are not supported. */
+#define RE_CHAR_CLASSES (1L << 9)
+
+/* match will be done case insensetively */
+#define RE_OPTION_IGNORECASE (1L)
+/* perl-style extended pattern available */
+#define RE_OPTION_EXTENDED (RE_OPTION_IGNORECASE<<1)
+/* newline will be included for . */
+#define RE_OPTION_MULTILINE (RE_OPTION_EXTENDED<<1)
+/* ^ and $ ignore newline */
+#define RE_OPTION_SINGLELINE (RE_OPTION_MULTILINE<<1)
+/* search for longest match, in accord with POSIX regexp */
+#define RE_OPTION_LONGEST (RE_OPTION_SINGLELINE<<1)
+
+#define RE_MAY_IGNORECASE (RE_OPTION_LONGEST<<1)
+#define RE_OPTIMIZE_ANCHOR (RE_MAY_IGNORECASE<<1)
+#define RE_OPTIMIZE_EXACTN (RE_OPTIMIZE_ANCHOR<<1)
+#define RE_OPTIMIZE_NO_BM (RE_OPTIMIZE_EXACTN<<1)
+#define RE_OPTIMIZE_BMATCH (RE_OPTIMIZE_NO_BM<<1)
+
+/* For multi-byte char support */
+#define MBCTYPE_ASCII 0
+#define MBCTYPE_EUC 1
+#define MBCTYPE_SJIS 2
+#define MBCTYPE_UTF8 3
+
+extern
+#if defined _WIN32 && !defined __GNUC__ && !defined RUBY_EXPORT
+__declspec(dllimport)
+# endif
+const unsigned char *re_mbctab;
+#if defined(__STDC__)
+void re_mbcinit (int);
+#else
+void re_mbcinit ();
+#endif
+
+#undef ismbchar
+#define ismbchar(c) re_mbctab[(unsigned char)(c)]
+#define mbclen(c) (re_mbctab[(unsigned char)(c)]+1)
+
+/* Structure used in re_match() */
+
+typedef union
+{
+ unsigned char *word;
+ struct {
+ unsigned is_active : 1;
+ unsigned matched_something : 1;
+ } bits;
+} register_info_type;
+
+/* This data structure is used to represent a compiled pattern. */
+
+struct re_pattern_buffer
+ {
+ char *buffer; /* Space holding the compiled pattern commands. */
+ int allocated; /* Size of space that `buffer' points to. */
+ int used; /* Length of portion of buffer actually occupied */
+ char *fastmap; /* Pointer to fastmap, if any, or zero if none. */
+ /* re_search uses the fastmap, if there is one,
+ to skip over totally implausible characters. */
+ char *must; /* Pointer to exact pattern which strings should have
+ to be matched. */
+ int *must_skip; /* Pointer to exact pattern skip table for bm_search */
+ long options; /* Flags for options such as extended_pattern. */
+ long re_nsub; /* Number of subexpressions found by the compiler. */
+ char fastmap_accurate;
+ /* Set to zero when a new pattern is stored,
+ set to one when the fastmap is updated from it. */
+ char can_be_null; /* Set to one by compiling fastmap
+ if this pattern might match the null string.
+ It does not necessarily match the null string
+ in that case, but if this is zero, it cannot.
+ 2 as value means can match null string
+ but at end of range or before a character
+ listed in the fastmap. */
+
+ /* stack & working area for re_match() */
+ unsigned char **regstart;
+ unsigned char **regend;
+ unsigned char **old_regstart;
+ unsigned char **old_regend;
+ register_info_type *reg_info;
+ unsigned char **best_regstart;
+ unsigned char **best_regend;
+ };
+
+typedef struct re_pattern_buffer regex_t;
+
+/* Structure to store register contents data in.
+
+ Pass the address of such a structure as an argument to re_match, etc.,
+ if you want this information back.
+
+ For i from 1 to RE_NREGS - 1, start[i] records the starting index in
+ the string of where the ith subexpression matched, and end[i] records
+ one after the ending index. start[0] and end[0] are analogous, for
+ the entire pattern. */
+
+struct re_registers
+ {
+ int allocated;
+ int num_regs;
+ int *beg;
+ int *end;
+ };
+
+/* Type for byte offsets within the string. POSIX mandates this. */
+typedef size_t regoff_t;
+
+/* POSIX specification for registers. Aside from the different names than
+ `re_registers', POSIX uses an array of structures, instead of a
+ structure of arrays. */
+typedef struct
+{
+ regoff_t rm_so; /* Byte offset from string's start to substring's start. */
+ regoff_t rm_eo; /* Byte offset from string's start to substring's end. */
+} regmatch_t;
+
+#ifdef __STDC__
+
+extern const char *re_compile_pattern (const char *, int, struct re_pattern_buffer *);
+void re_free_pattern (struct re_pattern_buffer *);
+/* Is this really advertised? */
+extern int re_adjust_startpos (struct re_pattern_buffer *, const char*, int, int, int);
+extern void re_compile_fastmap (struct re_pattern_buffer *);
+extern int re_search (struct re_pattern_buffer *, const char*, int, int, int,
+ struct re_registers *);
+extern int re_match (struct re_pattern_buffer *, const char *, int, int,
+ struct re_registers *);
+extern void re_set_casetable (const char *table);
+extern void re_copy_registers (struct re_registers*, struct re_registers*);
+extern void re_free_registers (struct re_registers*);
+
+#ifndef RUBY
+/* 4.2 bsd compatibility. */
+extern char *re_comp (const char *);
+extern int re_exec (const char *);
+#endif
+
+#else /* !__STDC__ */
+
+extern const char *re_compile_pattern ();
+void re_free_regexp ();
+/* Is this really advertised? */
+extern int re_adjust_startpos ();
+extern void re_compile_fastmap ();
+extern int re_search ();
+extern int re_match ();
+extern void re_set_casetable ();
+extern void re_copy_registers ();
+extern void re_free_registers ();
+
+#endif /* __STDC__ */
+
+#endif /* !REGEX_H */
diff --git a/regexec.c b/regexec.c
deleted file mode 100644
index cfe28836ba..0000000000
--- a/regexec.c
+++ /dev/null
@@ -1,3822 +0,0 @@
-/**********************************************************************
- regexec.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 "regint.h"
-
-/* #define USE_MATCH_RANGE_MUST_BE_INSIDE_OF_SPECIFIED_RANGE */
-
-#ifdef USE_CRNL_AS_LINE_TERMINATOR
-#define ONIGENC_IS_MBC_CRNL(enc,p,end) \
- (ONIGENC_MBC_TO_CODE(enc,p,end) == 13 && \
- ONIGENC_IS_MBC_NEWLINE(enc,(p+enclen(enc,p)),end))
-#endif
-
-#ifdef USE_CAPTURE_HISTORY
-static void history_tree_free(OnigCaptureTreeNode* node);
-
-static void
-history_tree_clear(OnigCaptureTreeNode* node)
-{
- int i;
-
- if (IS_NOT_NULL(node)) {
- for (i = 0; i < node->num_childs; i++) {
- if (IS_NOT_NULL(node->childs[i])) {
- history_tree_free(node->childs[i]);
- }
- }
- for (i = 0; i < node->allocated; i++) {
- node->childs[i] = (OnigCaptureTreeNode* )0;
- }
- node->num_childs = 0;
- node->beg = ONIG_REGION_NOTPOS;
- node->end = ONIG_REGION_NOTPOS;
- node->group = -1;
- }
-}
-
-static void
-history_tree_free(OnigCaptureTreeNode* node)
-{
- history_tree_clear(node);
- xfree(node);
-}
-
-static void
-history_root_free(OnigRegion* r)
-{
- if (IS_NOT_NULL(r->history_root)) {
- history_tree_free(r->history_root);
- r->history_root = (OnigCaptureTreeNode* )0;
- }
-}
-
-static OnigCaptureTreeNode*
-history_node_new(void)
-{
- OnigCaptureTreeNode* node;
-
- node = (OnigCaptureTreeNode* )xmalloc(sizeof(OnigCaptureTreeNode));
- CHECK_NULL_RETURN(node);
- node->childs = (OnigCaptureTreeNode** )0;
- node->allocated = 0;
- node->num_childs = 0;
- node->group = -1;
- node->beg = ONIG_REGION_NOTPOS;
- node->end = ONIG_REGION_NOTPOS;
-
- return node;
-}
-
-static int
-history_tree_add_child(OnigCaptureTreeNode* parent, OnigCaptureTreeNode* child)
-{
-#define HISTORY_TREE_INIT_ALLOC_SIZE 8
-
- if (parent->num_childs >= parent->allocated) {
- int n, i;
-
- if (IS_NULL(parent->childs)) {
- n = HISTORY_TREE_INIT_ALLOC_SIZE;
- parent->childs =
- (OnigCaptureTreeNode** )xmalloc(sizeof(OnigCaptureTreeNode*) * n);
- }
- else {
- n = parent->allocated * 2;
- parent->childs =
- (OnigCaptureTreeNode** )xrealloc(parent->childs,
- sizeof(OnigCaptureTreeNode*) * n);
- }
- CHECK_NULL_RETURN_MEMERR(parent->childs);
- for (i = parent->allocated; i < n; i++) {
- parent->childs[i] = (OnigCaptureTreeNode* )0;
- }
- parent->allocated = n;
- }
-
- parent->childs[parent->num_childs] = child;
- parent->num_childs++;
- return 0;
-}
-
-static OnigCaptureTreeNode*
-history_tree_clone(OnigCaptureTreeNode* node)
-{
- int i;
- OnigCaptureTreeNode *clone, *child;
-
- clone = history_node_new();
- CHECK_NULL_RETURN(clone);
-
- clone->beg = node->beg;
- clone->end = node->end;
- for (i = 0; i < node->num_childs; i++) {
- child = history_tree_clone(node->childs[i]);
- if (IS_NULL(child)) {
- history_tree_free(clone);
- return (OnigCaptureTreeNode* )0;
- }
- history_tree_add_child(clone, child);
- }
-
- return clone;
-}
-
-extern OnigCaptureTreeNode*
-onig_get_capture_tree(OnigRegion* region)
-{
- return region->history_root;
-}
-#endif /* USE_CAPTURE_HISTORY */
-
-extern void
-onig_region_clear(OnigRegion* region)
-{
- int i;
-
- for (i = 0; i < region->num_regs; i++) {
- region->beg[i] = region->end[i] = ONIG_REGION_NOTPOS;
- }
-#ifdef USE_CAPTURE_HISTORY
- history_root_free(region);
-#endif
-}
-
-extern int
-onig_region_resize(OnigRegion* region, int n)
-{
- region->num_regs = n;
-
- if (n < ONIG_NREGION)
- n = ONIG_NREGION;
-
- if (region->allocated == 0) {
- region->beg = (int* )xmalloc(n * sizeof(int));
- if (region->beg == 0)
- return ONIGERR_MEMORY;
-
- region->end = (int* )xmalloc(n * sizeof(int));
- if (region->end == 0) {
- xfree(region->beg);
- return ONIGERR_MEMORY;
- }
-
- region->allocated = n;
- }
- else if (region->allocated < n) {
- int *tmp;
-
- region->allocated = 0;
- tmp = (int* )xrealloc(region->beg, n * sizeof(int));
- if (tmp == 0) {
- xfree(region->beg);
- xfree(region->end);
- return ONIGERR_MEMORY;
- }
- region->beg = tmp;
- tmp = (int* )xrealloc(region->end, n * sizeof(int));
- if (tmp == 0) {
- xfree(region->beg);
- return ONIGERR_MEMORY;
- }
- region->end = tmp;
-
- if (region->beg == 0 || region->end == 0)
- return ONIGERR_MEMORY;
-
- region->allocated = n;
- }
-
- return 0;
-}
-
-static int
-onig_region_resize_clear(OnigRegion* region, int n)
-{
- int r;
-
- r = onig_region_resize(region, n);
- if (r != 0) return r;
- onig_region_clear(region);
- return 0;
-}
-
-extern int
-onig_region_set(OnigRegion* region, int at, int beg, int end)
-{
- if (at < 0) return ONIGERR_INVALID_ARGUMENT;
-
- if (at >= region->allocated) {
- int r = onig_region_resize(region, at + 1);
- if (r < 0) return r;
- }
-
- region->beg[at] = beg;
- region->end[at] = end;
- return 0;
-}
-
-extern void
-onig_region_init(OnigRegion* region)
-{
- region->num_regs = 0;
- region->allocated = 0;
- region->beg = (int* )0;
- region->end = (int* )0;
- region->history_root = (OnigCaptureTreeNode* )0;
-}
-
-extern OnigRegion*
-onig_region_new(void)
-{
- OnigRegion* r;
-
- r = (OnigRegion* )xmalloc(sizeof(OnigRegion));
- if (r)
- onig_region_init(r);
- return r;
-}
-
-extern void
-onig_region_free(OnigRegion* r, int free_self)
-{
- if (r) {
- if (r->allocated > 0) {
- if (r->beg) xfree(r->beg);
- if (r->end) xfree(r->end);
- r->allocated = 0;
- }
-#ifdef USE_CAPTURE_HISTORY
- history_root_free(r);
-#endif
- if (free_self) xfree(r);
- }
-}
-
-extern void
-onig_region_copy(OnigRegion* to, OnigRegion* from)
-{
-#define RREGC_SIZE (sizeof(int) * from->num_regs)
- int i;
-
- if (to == from) return;
-
- onig_region_resize(to, from->num_regs);
- for (i = 0; i < from->num_regs; i++) {
- to->beg[i] = from->beg[i];
- to->end[i] = from->end[i];
- }
- to->num_regs = from->num_regs;
-
-#ifdef USE_CAPTURE_HISTORY
- history_root_free(to);
-
- if (IS_NOT_NULL(from->history_root)) {
- to->history_root = history_tree_clone(from->history_root);
- }
-#endif
-}
-
-
-/** stack **/
-#define INVALID_STACK_INDEX -1
-
-/* stack type */
-/* used by normal-POP */
-#define STK_ALT 0x0001
-#define STK_LOOK_BEHIND_NOT 0x0002
-#define STK_POS_NOT 0x0003
-/* handled by normal-POP */
-#define STK_MEM_START 0x0100
-#define STK_MEM_END 0x8200
-#define STK_REPEAT_INC 0x0300
-#define STK_STATE_CHECK_MARK 0x1000
-/* avoided by normal-POP */
-#define STK_NULL_CHECK_START 0x3000
-#define STK_NULL_CHECK_END 0x5000 /* for recursive call */
-#define STK_MEM_END_MARK 0x8400
-#define STK_POS 0x0500 /* used when POP-POS */
-#define STK_STOP_BT 0x0600 /* mark for "(?>...)" */
-#define STK_REPEAT 0x0700
-#define STK_CALL_FRAME 0x0800
-#define STK_RETURN 0x0900
-#define STK_VOID 0x0a00 /* for fill a blank */
-
-/* stack type check mask */
-#define STK_MASK_POP_USED 0x00ff
-#define STK_MASK_TO_VOID_TARGET 0x10ff
-#define STK_MASK_MEM_END_OR_MARK 0x8000 /* MEM_END or MEM_END_MARK */
-
-#ifdef USE_FIND_LONGEST_SEARCH_ALL_OF_RANGE
-#define MATCH_ARG_INIT(msa, arg_option, arg_region, arg_start) do {\
- (msa).stack_p = (void* )0;\
- (msa).options = (arg_option);\
- (msa).region = (arg_region);\
- (msa).start = (arg_start);\
- (msa).best_len = ONIG_MISMATCH;\
-} while(0)
-#else
-#define MATCH_ARG_INIT(msa, arg_option, arg_region, arg_start) do {\
- (msa).stack_p = (void* )0;\
- (msa).options = (arg_option);\
- (msa).region = (arg_region);\
- (msa).start = (arg_start);\
-} while(0)
-#endif
-
-#ifdef USE_COMBINATION_EXPLOSION_CHECK
-
-#define STATE_CHECK_BUFF_MALLOC_THRESHOLD_SIZE 16
-
-#define STATE_CHECK_BUFF_INIT(msa, str_len, offset, state_num) do { \
- if ((state_num) > 0 && str_len >= STATE_CHECK_STRING_THRESHOLD_LEN) {\
- unsigned int size = (unsigned int )(((str_len) + 1) * (state_num) + 7) >> 3;\
- offset = ((offset) * (state_num)) >> 3;\
- if (size > 0 && offset < size && size < STATE_CHECK_BUFF_MAX_SIZE) {\
- if (size >= STATE_CHECK_BUFF_MALLOC_THRESHOLD_SIZE) {\
- (msa).state_check_buff = (void* )xmalloc(size);\
- CHECK_NULL_RETURN_MEMERR((msa).state_check_buff);\
- }\
- else \
- (msa).state_check_buff = (void* )xalloca(size);\
- xmemset(((char* )((msa).state_check_buff)+(offset)), 0, \
- (size_t )(size - (offset))); \
- (msa).state_check_buff_size = size;\
- }\
- else {\
- (msa).state_check_buff = (void* )0;\
- (msa).state_check_buff_size = 0;\
- }\
- }\
- else {\
- (msa).state_check_buff = (void* )0;\
- (msa).state_check_buff_size = 0;\
- }\
- } while(0)
-
-#define MATCH_ARG_FREE(msa) do {\
- if ((msa).stack_p) xfree((msa).stack_p);\
- if ((msa).state_check_buff_size >= STATE_CHECK_BUFF_MALLOC_THRESHOLD_SIZE) { \
- if ((msa).state_check_buff) xfree((msa).state_check_buff);\
- }\
-} while(0)
-#else
-#define MATCH_ARG_FREE(msa) if ((msa).stack_p) xfree((msa).stack_p)
-#endif
-
-
-
-#define STACK_INIT(alloc_addr, ptr_num, stack_num) do {\
- if (msa->stack_p) {\
- alloc_addr = (char* )xalloca(sizeof(char*) * (ptr_num));\
- stk_alloc = (OnigStackType* )(msa->stack_p);\
- stk_base = stk_alloc;\
- stk = stk_base;\
- stk_end = stk_base + msa->stack_n;\
- }\
- else {\
- alloc_addr = (char* )xalloca(sizeof(char*) * (ptr_num)\
- + sizeof(OnigStackType) * (stack_num));\
- stk_alloc = (OnigStackType* )(alloc_addr + sizeof(char*) * (ptr_num));\
- stk_base = stk_alloc;\
- stk = stk_base;\
- stk_end = stk_base + (stack_num);\
- }\
-} while(0)
-
-#define STACK_SAVE do{\
- if (stk_base != stk_alloc) {\
- msa->stack_p = stk_base;\
- msa->stack_n = stk_end - stk_base; /* TODO: check overflow */\
- };\
-} while(0)
-
-static unsigned int MatchStackLimitSize = DEFAULT_MATCH_STACK_LIMIT_SIZE;
-
-extern unsigned int
-onig_get_match_stack_limit_size(void)
-{
- return MatchStackLimitSize;
-}
-
-extern int
-onig_set_match_stack_limit_size(unsigned int size)
-{
- MatchStackLimitSize = size;
- return 0;
-}
-
-static int
-stack_double(OnigStackType** arg_stk_base, OnigStackType** arg_stk_end,
- OnigStackType** arg_stk, OnigStackType* stk_alloc, OnigMatchArg* msa)
-{
- size_t n;
- OnigStackType *x, *stk_base, *stk_end, *stk;
-
- stk_base = *arg_stk_base;
- stk_end = *arg_stk_end;
- stk = *arg_stk;
-
- n = stk_end - stk_base;
- if (stk_base == stk_alloc && IS_NULL(msa->stack_p)) {
- x = (OnigStackType* )xmalloc(sizeof(OnigStackType) * n * 2);
- if (IS_NULL(x)) {
- STACK_SAVE;
- return ONIGERR_MEMORY;
- }
- xmemcpy(x, stk_base, n * sizeof(OnigStackType));
- n *= 2;
- }
- else {
- unsigned int limit_size = MatchStackLimitSize;
- n *= 2;
- if (limit_size != 0 && n > limit_size) {
- if ((unsigned int )(stk_end - stk_base) == limit_size)
- return ONIGERR_MATCH_STACK_LIMIT_OVER;
- else
- n = limit_size;
- }
- x = (OnigStackType* )xrealloc(stk_base, sizeof(OnigStackType) * n);
- if (IS_NULL(x)) {
- STACK_SAVE;
- return ONIGERR_MEMORY;
- }
- }
- *arg_stk = x + (stk - stk_base);
- *arg_stk_base = x;
- *arg_stk_end = x + n;
- return 0;
-}
-
-#define STACK_ENSURE(n) do {\
- if (stk_end - stk < (n)) {\
- int r = stack_double(&stk_base, &stk_end, &stk, stk_alloc, msa);\
- if (r != 0) { STACK_SAVE; return r; } \
- }\
-} while(0)
-
-#define STACK_AT(index) (stk_base + (index))
-#define GET_STACK_INDEX(stk) ((stk) - stk_base)
-
-#define STACK_PUSH_TYPE(stack_type) do {\
- STACK_ENSURE(1);\
- stk->type = (stack_type);\
- STACK_INC;\
-} while(0)
-
-#define IS_TO_VOID_TARGET(stk) (((stk)->type & STK_MASK_TO_VOID_TARGET) != 0)
-
-#ifdef USE_COMBINATION_EXPLOSION_CHECK
-#define STATE_CHECK_POS(s,snum) \
- (((s) - str) * num_comb_exp_check + ((snum) - 1))
-#define STATE_CHECK_VAL(v,snum) do {\
- if (state_check_buff != NULL) {\
- int x = STATE_CHECK_POS(s,snum);\
- (v) = state_check_buff[x/8] & (1<<(x%8));\
- }\
- else (v) = 0;\
-} while(0)
-
-
-#define ELSE_IF_STATE_CHECK_MARK(stk) \
- else if ((stk)->type == STK_STATE_CHECK_MARK) { \
- int x = STATE_CHECK_POS(stk->u.state.pstr, stk->u.state.state_check);\
- state_check_buff[x/8] |= (1<<(x%8)); \
- }
-
-#define STACK_PUSH(stack_type,pat,s,sprev) do {\
- STACK_ENSURE(1);\
- stk->type = (stack_type);\
- stk->u.state.pcode = (pat);\
- stk->u.state.pstr = (s);\
- stk->u.state.pstr_prev = (sprev);\
- stk->u.state.state_check = 0;\
- STACK_INC;\
-} while(0)
-
-#define STACK_PUSH_ENSURED(stack_type,pat) do {\
- stk->type = (stack_type);\
- stk->u.state.pcode = (pat);\
- stk->u.state.state_check = 0;\
- STACK_INC;\
-} while(0)
-
-#define STACK_PUSH_ALT_WITH_STATE_CHECK(pat,s,sprev,snum) do {\
- STACK_ENSURE(1);\
- stk->type = STK_ALT;\
- stk->u.state.pcode = (pat);\
- stk->u.state.pstr = (s);\
- stk->u.state.pstr_prev = (sprev);\
- stk->u.state.state_check = ((state_check_buff != NULL) ? (snum) : 0);\
- STACK_INC;\
-} while(0)
-
-#define STACK_PUSH_STATE_CHECK(s,snum) do {\
- if (state_check_buff != NULL) {\
- STACK_ENSURE(1);\
- stk->type = STK_STATE_CHECK_MARK;\
- stk->u.state.pstr = (s);\
- stk->u.state.state_check = (snum);\
- STACK_INC;\
- }\
-} while(0)
-
-#else /* USE_COMBINATION_EXPLOSION_CHECK */
-
-#define ELSE_IF_STATE_CHECK_MARK(stk)
-
-#define STACK_PUSH(stack_type,pat,s,sprev) do {\
- STACK_ENSURE(1);\
- stk->type = (stack_type);\
- stk->u.state.pcode = (pat);\
- stk->u.state.pstr = (s);\
- stk->u.state.pstr_prev = (sprev);\
- STACK_INC;\
-} while(0)
-
-#define STACK_PUSH_ENSURED(stack_type,pat) do {\
- stk->type = (stack_type);\
- stk->u.state.pcode = (pat);\
- STACK_INC;\
-} while(0)
-#endif /* USE_COMBINATION_EXPLOSION_CHECK */
-
-#define STACK_PUSH_ALT(pat,s,sprev) STACK_PUSH(STK_ALT,pat,s,sprev)
-#define STACK_PUSH_POS(s,sprev) STACK_PUSH(STK_POS,NULL_UCHARP,s,sprev)
-#define STACK_PUSH_POS_NOT(pat,s,sprev) STACK_PUSH(STK_POS_NOT,pat,s,sprev)
-#define STACK_PUSH_STOP_BT STACK_PUSH_TYPE(STK_STOP_BT)
-#define STACK_PUSH_LOOK_BEHIND_NOT(pat,s,sprev) \
- STACK_PUSH(STK_LOOK_BEHIND_NOT,pat,s,sprev)
-
-#define STACK_PUSH_REPEAT(id, pat) do {\
- STACK_ENSURE(1);\
- stk->type = STK_REPEAT;\
- stk->u.repeat.num = (id);\
- stk->u.repeat.pcode = (pat);\
- stk->u.repeat.count = 0;\
- STACK_INC;\
-} while(0)
-
-#define STACK_PUSH_REPEAT_INC(sindex) do {\
- STACK_ENSURE(1);\
- stk->type = STK_REPEAT_INC;\
- stk->u.repeat_inc.si = (sindex);\
- STACK_INC;\
-} while(0)
-
-#define STACK_PUSH_MEM_START(mnum, s) do {\
- STACK_ENSURE(1);\
- stk->type = STK_MEM_START;\
- stk->u.mem.num = (mnum);\
- stk->u.mem.pstr = (s);\
- stk->u.mem.start = mem_start_stk[mnum];\
- stk->u.mem.end = mem_end_stk[mnum];\
- mem_start_stk[mnum] = GET_STACK_INDEX(stk);\
- mem_end_stk[mnum] = INVALID_STACK_INDEX;\
- STACK_INC;\
-} while(0)
-
-#define STACK_PUSH_MEM_END(mnum, s) do {\
- STACK_ENSURE(1);\
- stk->type = STK_MEM_END;\
- stk->u.mem.num = (mnum);\
- stk->u.mem.pstr = (s);\
- stk->u.mem.start = mem_start_stk[mnum];\
- stk->u.mem.end = mem_end_stk[mnum];\
- mem_end_stk[mnum] = GET_STACK_INDEX(stk);\
- STACK_INC;\
-} while(0)
-
-#define STACK_PUSH_MEM_END_MARK(mnum) do {\
- STACK_ENSURE(1);\
- stk->type = STK_MEM_END_MARK;\
- stk->u.mem.num = (mnum);\
- STACK_INC;\
-} while(0)
-
-#define STACK_GET_MEM_START(mnum, k) do {\
- int level = 0;\
- k = stk;\
- while (k > stk_base) {\
- k--;\
- if ((k->type & STK_MASK_MEM_END_OR_MARK) != 0 \
- && k->u.mem.num == (mnum)) {\
- level++;\
- }\
- else if (k->type == STK_MEM_START && k->u.mem.num == (mnum)) {\
- if (level == 0) break;\
- level--;\
- }\
- }\
-} while(0)
-
-#define STACK_GET_MEM_RANGE(k, mnum, start, end) do {\
- int level = 0;\
- while (k < stk) {\
- if (k->type == STK_MEM_START && k->u.mem.num == (mnum)) {\
- if (level == 0) (start) = k->u.mem.pstr;\
- level++;\
- }\
- else if (k->type == STK_MEM_END && k->u.mem.num == (mnum)) {\
- level--;\
- if (level == 0) {\
- (end) = k->u.mem.pstr;\
- break;\
- }\
- }\
- k++;\
- }\
-} while(0)
-
-#define STACK_PUSH_NULL_CHECK_START(cnum, s) do {\
- STACK_ENSURE(1);\
- stk->type = STK_NULL_CHECK_START;\
- stk->u.null_check.num = (cnum);\
- stk->u.null_check.pstr = (s);\
- STACK_INC;\
-} while(0)
-
-#define STACK_PUSH_NULL_CHECK_END(cnum) do {\
- STACK_ENSURE(1);\
- stk->type = STK_NULL_CHECK_END;\
- stk->u.null_check.num = (cnum);\
- STACK_INC;\
-} while(0)
-
-#define STACK_PUSH_CALL_FRAME(pat) do {\
- STACK_ENSURE(1);\
- stk->type = STK_CALL_FRAME;\
- stk->u.call_frame.ret_addr = (pat);\
- STACK_INC;\
-} while(0)
-
-#define STACK_PUSH_RETURN do {\
- STACK_ENSURE(1);\
- stk->type = STK_RETURN;\
- STACK_INC;\
-} while(0)
-
-
-#ifdef ONIG_DEBUG
-#define STACK_BASE_CHECK(p, at) \
- if ((p) < stk_base) {\
- fprintf(stderr, "at %s\n", at);\
- goto stack_error;\
- }
-#else
-#define STACK_BASE_CHECK(p, at)
-#endif
-
-#define STACK_POP_ONE do {\
- stk--;\
- STACK_BASE_CHECK(stk, "STACK_POP_ONE"); \
-} while(0)
-
-#define STACK_POP do {\
- switch (pop_level) {\
- case STACK_POP_LEVEL_FREE:\
- while (1) {\
- stk--;\
- STACK_BASE_CHECK(stk, "STACK_POP"); \
- if ((stk->type & STK_MASK_POP_USED) != 0) break;\
- ELSE_IF_STATE_CHECK_MARK(stk);\
- }\
- break;\
- case STACK_POP_LEVEL_MEM_START:\
- while (1) {\
- stk--;\
- STACK_BASE_CHECK(stk, "STACK_POP 2"); \
- if ((stk->type & STK_MASK_POP_USED) != 0) break;\
- else if (stk->type == STK_MEM_START) {\
- mem_start_stk[stk->u.mem.num] = stk->u.mem.start;\
- mem_end_stk[stk->u.mem.num] = stk->u.mem.end;\
- }\
- ELSE_IF_STATE_CHECK_MARK(stk);\
- }\
- break;\
- default:\
- while (1) {\
- stk--;\
- STACK_BASE_CHECK(stk, "STACK_POP 3"); \
- if ((stk->type & STK_MASK_POP_USED) != 0) break;\
- else if (stk->type == STK_MEM_START) {\
- mem_start_stk[stk->u.mem.num] = stk->u.mem.start;\
- mem_end_stk[stk->u.mem.num] = stk->u.mem.end;\
- }\
- else if (stk->type == STK_REPEAT_INC) {\
- STACK_AT(stk->u.repeat_inc.si)->u.repeat.count--;\
- }\
- else if (stk->type == STK_MEM_END) {\
- mem_start_stk[stk->u.mem.num] = stk->u.mem.start;\
- mem_end_stk[stk->u.mem.num] = stk->u.mem.end;\
- }\
- ELSE_IF_STATE_CHECK_MARK(stk);\
- }\
- break;\
- }\
-} while(0)
-
-#define STACK_POP_TIL_POS_NOT do {\
- while (1) {\
- stk--;\
- STACK_BASE_CHECK(stk, "STACK_POP_TIL_POS_NOT"); \
- if (stk->type == STK_POS_NOT) break;\
- else if (stk->type == STK_MEM_START) {\
- mem_start_stk[stk->u.mem.num] = stk->u.mem.start;\
- mem_end_stk[stk->u.mem.num] = stk->u.mem.end;\
- }\
- else if (stk->type == STK_REPEAT_INC) {\
- STACK_AT(stk->u.repeat_inc.si)->u.repeat.count--;\
- }\
- else if (stk->type == STK_MEM_END) {\
- mem_start_stk[stk->u.mem.num] = stk->u.mem.start;\
- mem_end_stk[stk->u.mem.num] = stk->u.mem.end;\
- }\
- ELSE_IF_STATE_CHECK_MARK(stk);\
- }\
-} while(0)
-
-#define STACK_POP_TIL_LOOK_BEHIND_NOT do {\
- while (1) {\
- stk--;\
- STACK_BASE_CHECK(stk, "STACK_POP_TIL_LOOK_BEHIND_NOT"); \
- if (stk->type == STK_LOOK_BEHIND_NOT) break;\
- else if (stk->type == STK_MEM_START) {\
- mem_start_stk[stk->u.mem.num] = stk->u.mem.start;\
- mem_end_stk[stk->u.mem.num] = stk->u.mem.end;\
- }\
- else if (stk->type == STK_REPEAT_INC) {\
- STACK_AT(stk->u.repeat_inc.si)->u.repeat.count--;\
- }\
- else if (stk->type == STK_MEM_END) {\
- mem_start_stk[stk->u.mem.num] = stk->u.mem.start;\
- mem_end_stk[stk->u.mem.num] = stk->u.mem.end;\
- }\
- ELSE_IF_STATE_CHECK_MARK(stk);\
- }\
-} while(0)
-
-#define STACK_POS_END(k) do {\
- k = stk;\
- while (1) {\
- k--;\
- STACK_BASE_CHECK(k, "STACK_POS_END"); \
- if (IS_TO_VOID_TARGET(k)) {\
- k->type = STK_VOID;\
- }\
- else if (k->type == STK_POS) {\
- k->type = STK_VOID;\
- break;\
- }\
- }\
-} while(0)
-
-#define STACK_STOP_BT_END do {\
- OnigStackType *k = stk;\
- while (1) {\
- k--;\
- STACK_BASE_CHECK(k, "STACK_STOP_BT_END"); \
- if (IS_TO_VOID_TARGET(k)) {\
- k->type = STK_VOID;\
- }\
- else if (k->type == STK_STOP_BT) {\
- k->type = STK_VOID;\
- break;\
- }\
- }\
-} while(0)
-
-#define STACK_NULL_CHECK(isnull,id,s) do {\
- OnigStackType* k = stk;\
- while (1) {\
- k--;\
- STACK_BASE_CHECK(k, "STACK_NULL_CHECK"); \
- if (k->type == STK_NULL_CHECK_START) {\
- if (k->u.null_check.num == (id)) {\
- (isnull) = (k->u.null_check.pstr == (s));\
- break;\
- }\
- }\
- }\
-} while(0)
-
-#define STACK_NULL_CHECK_REC(isnull,id,s) do {\
- int level = 0;\
- OnigStackType* k = stk;\
- while (1) {\
- k--;\
- STACK_BASE_CHECK(k, "STACK_NULL_CHECK_REC"); \
- if (k->type == STK_NULL_CHECK_START) {\
- if (k->u.null_check.num == (id)) {\
- if (level == 0) {\
- (isnull) = (k->u.null_check.pstr == (s));\
- break;\
- }\
- else level--;\
- }\
- }\
- else if (k->type == STK_NULL_CHECK_END) {\
- level++;\
- }\
- }\
-} while(0)
-
-#define STACK_NULL_CHECK_MEMST(isnull,id,s,reg) do {\
- OnigStackType* k = stk;\
- while (1) {\
- k--;\
- STACK_BASE_CHECK(k, "STACK_NULL_CHECK_MEMST"); \
- if (k->type == STK_NULL_CHECK_START) {\
- if (k->u.null_check.num == (id)) {\
- if (k->u.null_check.pstr != (s)) {\
- (isnull) = 0;\
- break;\
- }\
- else {\
- UChar* endp;\
- (isnull) = 1;\
- while (k < stk) {\
- if (k->type == STK_MEM_START) {\
- if (k->u.mem.end == INVALID_STACK_INDEX) {\
- (isnull) = 0; break;\
- }\
- if (BIT_STATUS_AT(reg->bt_mem_end, k->u.mem.num))\
- endp = STACK_AT(k->u.mem.end)->u.mem.pstr;\
- else\
- endp = (UChar* )k->u.mem.end;\
- if (STACK_AT(k->u.mem.start)->u.mem.pstr != endp) {\
- (isnull) = 0; break;\
- }\
- else if (endp != s) {\
- (isnull) = -1; /* empty, but position changed */ \
- }\
- }\
- k++;\
- }\
- break;\
- }\
- }\
- }\
- }\
-} while(0)
-
-#define STACK_NULL_CHECK_MEMST_REC(isnull,id,s,reg) do {\
- int level = 0;\
- OnigStackType* k = stk;\
- while (1) {\
- k--;\
- STACK_BASE_CHECK(k, "STACK_NULL_CHECK_MEMST_REC"); \
- if (k->type == STK_NULL_CHECK_START) {\
- if (k->u.null_check.num == (id)) {\
- if (level == 0) {\
- if (k->u.null_check.pstr != (s)) {\
- (isnull) = 0;\
- break;\
- }\
- else {\
- UChar* endp;\
- (isnull) = 1;\
- while (k < stk) {\
- if (k->type == STK_MEM_START) {\
- if (k->u.mem.end == INVALID_STACK_INDEX) {\
- (isnull) = 0; break;\
- }\
- if (BIT_STATUS_AT(reg->bt_mem_end, k->u.mem.num))\
- endp = STACK_AT(k->u.mem.end)->u.mem.pstr;\
- else\
- endp = (UChar* )k->u.mem.end;\
- if (STACK_AT(k->u.mem.start)->u.mem.pstr != endp) {\
- (isnull) = 0; break;\
- }\
- else if (endp != s) {\
- (isnull) = -1; /* empty, but position changed */ \
- }\
- }\
- k++;\
- }\
- break;\
- }\
- }\
- else {\
- level--;\
- }\
- }\
- }\
- else if (k->type == STK_NULL_CHECK_END) {\
- if (k->u.null_check.num == (id)) level++;\
- }\
- }\
-} while(0)
-
-#define STACK_GET_REPEAT(id, k) do {\
- int level = 0;\
- k = stk;\
- while (1) {\
- k--;\
- STACK_BASE_CHECK(k, "STACK_GET_REPEAT"); \
- if (k->type == STK_REPEAT) {\
- if (level == 0) {\
- if (k->u.repeat.num == (id)) {\
- break;\
- }\
- }\
- }\
- else if (k->type == STK_CALL_FRAME) level--;\
- else if (k->type == STK_RETURN) level++;\
- }\
-} while(0)
-
-#define STACK_RETURN(addr) do {\
- int level = 0;\
- OnigStackType* k = stk;\
- while (1) {\
- k--;\
- STACK_BASE_CHECK(k, "STACK_RETURN"); \
- if (k->type == STK_CALL_FRAME) {\
- if (level == 0) {\
- (addr) = k->u.call_frame.ret_addr;\
- break;\
- }\
- else level--;\
- }\
- else if (k->type == STK_RETURN)\
- level++;\
- }\
-} while(0)
-
-
-#define STRING_CMP(s1,s2,len) do {\
- while (len-- > 0) {\
- if (*s1++ != *s2++) goto fail;\
- }\
-} while(0)
-
-#define STRING_CMP_IC(case_fold_flag,s1,ps2,len,text_end) do {\
- if (string_cmp_ic(encode, case_fold_flag, s1, ps2, len, text_end) == 0) \
- goto fail; \
-} while(0)
-
-static int string_cmp_ic(OnigEncoding enc, int case_fold_flag,
- UChar* s1, UChar** ps2, int mblen, const UChar* text_end)
-{
- UChar buf1[ONIGENC_MBC_CASE_FOLD_MAXLEN];
- UChar buf2[ONIGENC_MBC_CASE_FOLD_MAXLEN];
- UChar *p1, *p2, *end1, *s2;
- int len1, len2;
-
- s2 = *ps2;
- end1 = s1 + mblen;
- while (s1 < end1) {
- len1 = ONIGENC_MBC_CASE_FOLD(enc, case_fold_flag, &s1, text_end, buf1);
- len2 = ONIGENC_MBC_CASE_FOLD(enc, case_fold_flag, &s2, text_end, buf2);
- if (len1 != len2) return 0;
- p1 = buf1;
- p2 = buf2;
- while (len1-- > 0) {
- if (*p1 != *p2) return 0;
- p1++;
- p2++;
- }
- }
-
- *ps2 = s2;
- return 1;
-}
-
-#define STRING_CMP_VALUE(s1,s2,len,is_fail) do {\
- is_fail = 0;\
- while (len-- > 0) {\
- if (*s1++ != *s2++) {\
- is_fail = 1; break;\
- }\
- }\
-} while(0)
-
-#define STRING_CMP_VALUE_IC(case_fold_flag,s1,ps2,len,text_end,is_fail) do {\
- if (string_cmp_ic(encode, case_fold_flag, s1, ps2, len, text_end) == 0) \
- is_fail = 1; \
- else \
- is_fail = 0; \
-} while(0)
-
-
-#define IS_EMPTY_STR (str == end)
-#define ON_STR_BEGIN(s) ((s) == str)
-#define ON_STR_END(s) ((s) == end)
-#ifdef USE_MATCH_RANGE_MUST_BE_INSIDE_OF_SPECIFIED_RANGE
-#define DATA_ENSURE_CHECK1 (s < right_range)
-#define DATA_ENSURE_CHECK(n) (s + (n) <= right_range)
-#define DATA_ENSURE(n) if (s + (n) > right_range) goto fail
-#else
-#define DATA_ENSURE_CHECK1 (s < end)
-#define DATA_ENSURE_CHECK(n) (s + (n) <= end)
-#define DATA_ENSURE(n) if (s + (n) > end) goto fail
-#endif /* USE_MATCH_RANGE_MUST_BE_INSIDE_OF_SPECIFIED_RANGE */
-
-
-#ifdef USE_CAPTURE_HISTORY
-static int
-make_capture_history_tree(OnigCaptureTreeNode* node, OnigStackType** kp,
- OnigStackType* stk_top, UChar* str, regex_t* reg)
-{
- int n, r;
- OnigCaptureTreeNode* child;
- OnigStackType* k = *kp;
-
- while (k < stk_top) {
- if (k->type == STK_MEM_START) {
- n = k->u.mem.num;
- if (n <= ONIG_MAX_CAPTURE_HISTORY_GROUP &&
- BIT_STATUS_AT(reg->capture_history, n) != 0) {
- child = history_node_new();
- CHECK_NULL_RETURN_MEMERR(child);
- child->group = n;
- child->beg = (int )(k->u.mem.pstr - str);
- r = history_tree_add_child(node, child);
- if (r != 0) return r;
- *kp = (k + 1);
- r = make_capture_history_tree(child, kp, stk_top, str, reg);
- if (r != 0) return r;
-
- k = *kp;
- child->end = (int )(k->u.mem.pstr - str);
- }
- }
- else if (k->type == STK_MEM_END) {
- if (k->u.mem.num == node->group) {
- node->end = (int )(k->u.mem.pstr - str);
- *kp = k;
- return 0;
- }
- }
- k++;
- }
-
- return 1; /* 1: root node ending. */
-}
-#endif
-
-#ifdef USE_BACKREF_WITH_LEVEL
-static int mem_is_in_memp(int mem, int num, UChar* memp)
-{
- int i;
- MemNumType m;
-
- for (i = 0; i < num; i++) {
- GET_MEMNUM_INC(m, memp);
- if (mem == (int )m) return 1;
- }
- return 0;
-}
-
-static int backref_match_at_nested_level(regex_t* reg
- , OnigStackType* top, OnigStackType* stk_base
- , int ignore_case, int case_fold_flag
- , int nest, int mem_num, UChar* memp, UChar** s, const UChar* send)
-{
- UChar *ss, *p, *pstart, *pend = NULL_UCHARP;
- int level;
- OnigStackType* k;
-
- level = 0;
- k = top;
- k--;
- while (k >= stk_base) {
- if (k->type == STK_CALL_FRAME) {
- level--;
- }
- else if (k->type == STK_RETURN) {
- level++;
- }
- else if (level == nest) {
- if (k->type == STK_MEM_START) {
- if (mem_is_in_memp(k->u.mem.num, mem_num, memp)) {
- pstart = k->u.mem.pstr;
- if (pend != NULL_UCHARP) {
- if (pend - pstart > send - *s) return 0; /* or goto next_mem; */
- p = pstart;
- ss = *s;
-
- if (ignore_case != 0) {
- if (string_cmp_ic(reg->enc, case_fold_flag,
- pstart, &ss, (int )(pend - pstart), send) == 0)
- return 0; /* or goto next_mem; */
- }
- else {
- while (p < pend) {
- if (*p++ != *ss++) return 0; /* or goto next_mem; */
- }
- }
-
- *s = ss;
- return 1;
- }
- }
- }
- else if (k->type == STK_MEM_END) {
- if (mem_is_in_memp(k->u.mem.num, mem_num, memp)) {
- pend = k->u.mem.pstr;
- }
- }
- }
- k--;
- }
-
- return 0;
-}
-#endif /* USE_BACKREF_WITH_LEVEL */
-
-
-#ifdef ONIG_DEBUG_STATISTICS
-
-#define USE_TIMEOFDAY
-
-#ifdef USE_TIMEOFDAY
-#ifdef HAVE_SYS_TIME_H
-#include <sys/time.h>
-#endif
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-static struct timeval ts, te;
-#define GETTIME(t) gettimeofday(&(t), (struct timezone* )0)
-#define TIMEDIFF(te,ts) (((te).tv_usec - (ts).tv_usec) + \
- (((te).tv_sec - (ts).tv_sec)*1000000))
-#else
-#ifdef HAVE_SYS_TIMES_H
-#include <sys/times.h>
-#endif
-static struct tms ts, te;
-#define GETTIME(t) times(&(t))
-#define TIMEDIFF(te,ts) ((te).tms_utime - (ts).tms_utime)
-#endif
-
-static int OpCounter[256];
-static int OpPrevCounter[256];
-static unsigned long OpTime[256];
-static int OpCurr = OP_FINISH;
-static int OpPrevTarget = OP_FAIL;
-static int MaxStackDepth = 0;
-
-#define MOP_IN(opcode) do {\
- if (opcode == OpPrevTarget) OpPrevCounter[OpCurr]++;\
- OpCurr = opcode;\
- OpCounter[opcode]++;\
- GETTIME(ts);\
-} while(0)
-
-#define MOP_OUT do {\
- GETTIME(te);\
- OpTime[OpCurr] += TIMEDIFF(te, ts);\
-} while(0)
-
-extern void
-onig_statistics_init(void)
-{
- int i;
- for (i = 0; i < 256; i++) {
- OpCounter[i] = OpPrevCounter[i] = 0; OpTime[i] = 0;
- }
- MaxStackDepth = 0;
-}
-
-extern void
-onig_print_statistics(FILE* f)
-{
- int i;
- fprintf(f, " count prev time\n");
- for (i = 0; OnigOpInfo[i].opcode >= 0; i++) {
- fprintf(f, "%8d: %8d: %10ld: %s\n",
- OpCounter[i], OpPrevCounter[i], OpTime[i], OnigOpInfo[i].name);
- }
- fprintf(f, "\nmax stack depth: %d\n", MaxStackDepth);
-}
-
-#define STACK_INC do {\
- stk++;\
- if (stk - stk_base > MaxStackDepth) \
- MaxStackDepth = stk - stk_base;\
-} while(0)
-
-#else
-#define STACK_INC stk++
-
-#define MOP_IN(opcode)
-#define MOP_OUT
-#endif
-
-
-/* matching region of POSIX API */
-typedef int regoff_t;
-
-typedef struct {
- regoff_t rm_so;
- regoff_t rm_eo;
-} posix_regmatch_t;
-
-/* match data(str - end) from position (sstart). */
-/* if sstart == str then set sprev to NULL. */
-static long
-match_at(regex_t* reg, const UChar* str, const UChar* end,
-#ifdef USE_MATCH_RANGE_MUST_BE_INSIDE_OF_SPECIFIED_RANGE
- const UChar* right_range,
-#endif
- const UChar* sstart, UChar* sprev, OnigMatchArg* msa)
-{
- static const UChar FinishCode[] = { OP_FINISH };
-
- int i, n, num_mem, best_len, pop_level;
- LengthType tlen, tlen2;
- MemNumType mem;
- RelAddrType addr;
- OnigOptionType option = reg->options;
- OnigEncoding encode = reg->enc;
- OnigCaseFoldType case_fold_flag = reg->case_fold_flag;
- UChar *s, *q, *sbegin;
- UChar *p = reg->p;
- char *alloca_base;
- OnigStackType *stk_alloc, *stk_base, *stk, *stk_end;
- OnigStackType *stkp; /* used as any purpose. */
- OnigStackIndex si;
- OnigStackIndex *repeat_stk;
- OnigStackIndex *mem_start_stk, *mem_end_stk;
-#ifdef USE_COMBINATION_EXPLOSION_CHECK
- int scv;
- unsigned char* state_check_buff = msa->state_check_buff;
- int num_comb_exp_check = reg->num_comb_exp_check;
-#endif
- n = reg->num_repeat + reg->num_mem * 2;
-
- STACK_INIT(alloca_base, n, INIT_MATCH_STACK_SIZE);
- pop_level = reg->stack_pop_level;
- num_mem = reg->num_mem;
- repeat_stk = (OnigStackIndex* )alloca_base;
-
- mem_start_stk = (OnigStackIndex* )(repeat_stk + reg->num_repeat);
- mem_end_stk = mem_start_stk + num_mem;
- mem_start_stk--; /* for index start from 1,
- mem_start_stk[1]..mem_start_stk[num_mem] */
- mem_end_stk--; /* for index start from 1,
- mem_end_stk[1]..mem_end_stk[num_mem] */
- for (i = 1; i <= num_mem; i++) {
- mem_start_stk[i] = mem_end_stk[i] = INVALID_STACK_INDEX;
- }
-
-#ifdef ONIG_DEBUG_MATCH
- fprintf(stderr, "match_at: str: %d, end: %d, start: %d, sprev: %d\n",
- (int )str, (int )end, (int )sstart, (int )sprev);
- fprintf(stderr, "size: %d, start offset: %d\n",
- (int )(end - str), (int )(sstart - str));
-#endif
-
- STACK_PUSH_ENSURED(STK_ALT, (UChar *)FinishCode); /* bottom stack */
- best_len = ONIG_MISMATCH;
- s = (UChar* )sstart;
- while (1) {
-#ifdef ONIG_DEBUG_MATCH
- {
- UChar *q, *bp, buf[50];
- int len;
- fprintf(stderr, "%4d> \"", (int )(s - str));
- bp = buf;
- for (i = 0, q = s; i < 7 && q < end; i++) {
- len = enclen(encode, q);
- while (len-- > 0) *bp++ = *q++;
- }
- if (q < end) { xmemcpy(bp, "...\"", 4); bp += 4; }
- else { xmemcpy(bp, "\"", 1); bp += 1; }
- *bp = 0;
- fputs((char* )buf, stderr);
- for (i = 0; i < 20 - (bp - buf); i++) fputc(' ', stderr);
- onig_print_compiled_byte_code(stderr, p, NULL, encode);
- fprintf(stderr, "\n");
- }
-#endif
-
- sbegin = s;
- switch (*p++) {
- case OP_END: MOP_IN(OP_END);
- n = s - sstart;
- if (n > best_len) {
- OnigRegion* region;
-#ifdef USE_FIND_LONGEST_SEARCH_ALL_OF_RANGE
- if (IS_FIND_LONGEST(option)) {
- if (n > msa->best_len) {
- msa->best_len = n;
- msa->best_s = (UChar* )sstart;
- }
- else
- goto end_best_len;
- }
-#endif
- best_len = n;
- region = msa->region;
- if (region) {
-#ifdef USE_POSIX_API_REGION_OPTION
- if (IS_POSIX_REGION(msa->options)) {
- posix_regmatch_t* rmt = (posix_regmatch_t* )region;
-
- rmt[0].rm_so = sstart - str;
- rmt[0].rm_eo = s - str;
- for (i = 1; i <= num_mem; i++) {
- if (mem_end_stk[i] != INVALID_STACK_INDEX) {
- if (BIT_STATUS_AT(reg->bt_mem_start, i))
- rmt[i].rm_so = STACK_AT(mem_start_stk[i])->u.mem.pstr - str;
- else
- rmt[i].rm_so = (UChar* )((void* )(mem_start_stk[i])) - str;
-
- rmt[i].rm_eo = (BIT_STATUS_AT(reg->bt_mem_end, i)
- ? STACK_AT(mem_end_stk[i])->u.mem.pstr
- : (UChar* )((void* )mem_end_stk[i])) - str;
- }
- else {
- rmt[i].rm_so = rmt[i].rm_eo = ONIG_REGION_NOTPOS;
- }
- }
- }
- else {
-#endif /* USE_POSIX_API_REGION_OPTION */
- region->beg[0] = sstart - str;
- region->end[0] = s - str;
- for (i = 1; i <= num_mem; i++) {
- if (mem_end_stk[i] != INVALID_STACK_INDEX) {
- if (BIT_STATUS_AT(reg->bt_mem_start, i))
- region->beg[i] = STACK_AT(mem_start_stk[i])->u.mem.pstr - str;
- else
- region->beg[i] = (UChar* )((void* )mem_start_stk[i]) - str;
-
- region->end[i] = (BIT_STATUS_AT(reg->bt_mem_end, i)
- ? STACK_AT(mem_end_stk[i])->u.mem.pstr
- : (UChar* )((void* )mem_end_stk[i])) - str;
- }
- else {
- region->beg[i] = region->end[i] = ONIG_REGION_NOTPOS;
- }
- }
-
-#ifdef USE_CAPTURE_HISTORY
- if (reg->capture_history != 0) {
- int r;
- OnigCaptureTreeNode* node;
-
- if (IS_NULL(region->history_root)) {
- region->history_root = node = history_node_new();
- CHECK_NULL_RETURN_MEMERR(node);
- }
- else {
- node = region->history_root;
- history_tree_clear(node);
- }
-
- node->group = 0;
- node->beg = sstart - str;
- node->end = s - str;
-
- stkp = stk_base;
- r = make_capture_history_tree(region->history_root, &stkp,
- stk, (UChar* )str, reg);
- if (r < 0) {
- best_len = r; /* error code */
- goto finish;
- }
- }
-#endif /* USE_CAPTURE_HISTORY */
-#ifdef USE_POSIX_API_REGION_OPTION
- } /* else IS_POSIX_REGION() */
-#endif
- } /* if (region) */
- } /* n > best_len */
-
-#ifdef USE_FIND_LONGEST_SEARCH_ALL_OF_RANGE
- end_best_len:
-#endif
- MOP_OUT;
-
- if (IS_FIND_CONDITION(option)) {
- if (IS_FIND_NOT_EMPTY(option) && s == sstart) {
- best_len = ONIG_MISMATCH;
- goto fail; /* for retry */
- }
- if (IS_FIND_LONGEST(option) && DATA_ENSURE_CHECK1) {
- goto fail; /* for retry */
- }
- }
-
- /* default behavior: return first-matching result. */
- goto finish;
- break;
-
- case OP_EXACT1: MOP_IN(OP_EXACT1);
-#if 0
- DATA_ENSURE(1);
- if (*p != *s) goto fail;
- p++; s++;
-#endif
- if (*p != *s++) goto fail;
- DATA_ENSURE(0);
- p++;
- MOP_OUT;
- break;
-
- case OP_EXACT1_IC: MOP_IN(OP_EXACT1_IC);
- {
- int len;
- UChar *q, lowbuf[ONIGENC_MBC_CASE_FOLD_MAXLEN];
-
- DATA_ENSURE(1);
- len = ONIGENC_MBC_CASE_FOLD(encode,
- /* DISABLE_CASE_FOLD_MULTI_CHAR(case_fold_flag), */
- case_fold_flag,
- &s, end, lowbuf);
- DATA_ENSURE(0);
- q = lowbuf;
- while (len-- > 0) {
- if (*p != *q) {
- goto fail;
- }
- p++; q++;
- }
- }
- MOP_OUT;
- break;
-
- case OP_EXACT2: MOP_IN(OP_EXACT2);
- DATA_ENSURE(2);
- if (*p != *s) goto fail;
- p++; s++;
- if (*p != *s) goto fail;
- sprev = s;
- p++; s++;
- MOP_OUT;
- continue;
- break;
-
- case OP_EXACT3: MOP_IN(OP_EXACT3);
- DATA_ENSURE(3);
- if (*p != *s) goto fail;
- p++; s++;
- if (*p != *s) goto fail;
- p++; s++;
- if (*p != *s) goto fail;
- sprev = s;
- p++; s++;
- MOP_OUT;
- continue;
- break;
-
- case OP_EXACT4: MOP_IN(OP_EXACT4);
- DATA_ENSURE(4);
- if (*p != *s) goto fail;
- p++; s++;
- if (*p != *s) goto fail;
- p++; s++;
- if (*p != *s) goto fail;
- p++; s++;
- if (*p != *s) goto fail;
- sprev = s;
- p++; s++;
- MOP_OUT;
- continue;
- break;
-
- case OP_EXACT5: MOP_IN(OP_EXACT5);
- DATA_ENSURE(5);
- if (*p != *s) goto fail;
- p++; s++;
- if (*p != *s) goto fail;
- p++; s++;
- if (*p != *s) goto fail;
- p++; s++;
- if (*p != *s) goto fail;
- p++; s++;
- if (*p != *s) goto fail;
- sprev = s;
- p++; s++;
- MOP_OUT;
- continue;
- break;
-
- case OP_EXACTN: MOP_IN(OP_EXACTN);
- GET_LENGTH_INC(tlen, p);
- DATA_ENSURE(tlen);
- while (tlen-- > 0) {
- if (*p++ != *s++) goto fail;
- }
- sprev = s - 1;
- MOP_OUT;
- continue;
- break;
-
- case OP_EXACTN_IC: MOP_IN(OP_EXACTN_IC);
- {
- int len;
- UChar *q, *endp, lowbuf[ONIGENC_MBC_CASE_FOLD_MAXLEN];
-
- GET_LENGTH_INC(tlen, p);
- endp = p + tlen;
-
- while (p < endp) {
- sprev = s;
- DATA_ENSURE(1);
- len = ONIGENC_MBC_CASE_FOLD(encode,
- /* DISABLE_CASE_FOLD_MULTI_CHAR(case_fold_flag), */
- case_fold_flag,
- &s, end, lowbuf);
- DATA_ENSURE(0);
- q = lowbuf;
- while (len-- > 0) {
- if (*p != *q) goto fail;
- p++; q++;
- }
- }
- }
-
- MOP_OUT;
- continue;
- break;
-
- case OP_EXACTMB2N1: MOP_IN(OP_EXACTMB2N1);
- DATA_ENSURE(2);
- if (*p != *s) goto fail;
- p++; s++;
- if (*p != *s) goto fail;
- p++; s++;
- MOP_OUT;
- break;
-
- case OP_EXACTMB2N2: MOP_IN(OP_EXACTMB2N2);
- DATA_ENSURE(4);
- if (*p != *s) goto fail;
- p++; s++;
- if (*p != *s) goto fail;
- p++; s++;
- sprev = s;
- if (*p != *s) goto fail;
- p++; s++;
- if (*p != *s) goto fail;
- p++; s++;
- MOP_OUT;
- continue;
- break;
-
- case OP_EXACTMB2N3: MOP_IN(OP_EXACTMB2N3);
- DATA_ENSURE(6);
- if (*p != *s) goto fail;
- p++; s++;
- if (*p != *s) goto fail;
- p++; s++;
- if (*p != *s) goto fail;
- p++; s++;
- if (*p != *s) goto fail;
- p++; s++;
- sprev = s;
- if (*p != *s) goto fail;
- p++; s++;
- if (*p != *s) goto fail;
- p++; s++;
- MOP_OUT;
- continue;
- break;
-
- case OP_EXACTMB2N: MOP_IN(OP_EXACTMB2N);
- GET_LENGTH_INC(tlen, p);
- DATA_ENSURE(tlen * 2);
- while (tlen-- > 0) {
- if (*p != *s) goto fail;
- p++; s++;
- if (*p != *s) goto fail;
- p++; s++;
- }
- sprev = s - 2;
- MOP_OUT;
- continue;
- break;
-
- case OP_EXACTMB3N: MOP_IN(OP_EXACTMB3N);
- GET_LENGTH_INC(tlen, p);
- DATA_ENSURE(tlen * 3);
- while (tlen-- > 0) {
- if (*p != *s) goto fail;
- p++; s++;
- if (*p != *s) goto fail;
- p++; s++;
- if (*p != *s) goto fail;
- p++; s++;
- }
- sprev = s - 3;
- MOP_OUT;
- continue;
- break;
-
- case OP_EXACTMBN: MOP_IN(OP_EXACTMBN);
- GET_LENGTH_INC(tlen, p); /* mb-len */
- GET_LENGTH_INC(tlen2, p); /* string len */
- tlen2 *= tlen;
- DATA_ENSURE(tlen2);
- while (tlen2-- > 0) {
- if (*p != *s) goto fail;
- p++; s++;
- }
- sprev = s - tlen;
- MOP_OUT;
- continue;
- break;
-
- case OP_CCLASS: MOP_IN(OP_CCLASS);
- DATA_ENSURE(1);
- if (BITSET_AT(((BitSetRef )p), *s) == 0) goto fail;
- p += SIZE_BITSET;
- s += enclen(encode, s, end); /* OP_CCLASS can match mb-code. \D, \S */
- MOP_OUT;
- break;
-
- case OP_CCLASS_MB: MOP_IN(OP_CCLASS_MB);
- if (! ONIGENC_IS_MBC_HEAD(encode, s, end)) goto fail;
-
- cclass_mb:
- GET_LENGTH_INC(tlen, p);
- {
- OnigCodePoint code;
- UChar *ss;
- int mb_len;
-
- DATA_ENSURE(1);
- mb_len = enclen(encode, s, end);
- DATA_ENSURE(mb_len);
- ss = s;
- s += mb_len;
- code = ONIGENC_MBC_TO_CODE(encode, ss, s);
-
-#ifdef PLATFORM_UNALIGNED_WORD_ACCESS
- if (! onig_is_in_code_range(p, code)) goto fail;
-#else
- q = p;
- ALIGNMENT_RIGHT(q);
- if (! onig_is_in_code_range(q, code)) goto fail;
-#endif
- }
- p += tlen;
- MOP_OUT;
- break;
-
- case OP_CCLASS_MIX: MOP_IN(OP_CCLASS_MIX);
- DATA_ENSURE(1);
- if (ONIGENC_IS_MBC_HEAD(encode, s, end)) {
- p += SIZE_BITSET;
- goto cclass_mb;
- }
- else {
- if (BITSET_AT(((BitSetRef )p), *s) == 0)
- goto fail;
-
- p += SIZE_BITSET;
- GET_LENGTH_INC(tlen, p);
- p += tlen;
- s++;
- }
- MOP_OUT;
- break;
-
- case OP_CCLASS_NOT: MOP_IN(OP_CCLASS_NOT);
- DATA_ENSURE(1);
- if (BITSET_AT(((BitSetRef )p), *s) != 0) goto fail;
- p += SIZE_BITSET;
- s += enclen(encode, s, end);
- MOP_OUT;
- break;
-
- case OP_CCLASS_MB_NOT: MOP_IN(OP_CCLASS_MB_NOT);
- DATA_ENSURE(1);
- if (! ONIGENC_IS_MBC_HEAD(encode, s, end)) {
- s++;
- GET_LENGTH_INC(tlen, p);
- p += tlen;
- goto cc_mb_not_success;
- }
-
- cclass_mb_not:
- GET_LENGTH_INC(tlen, p);
- {
- OnigCodePoint code;
- UChar *ss;
- int mb_len = enclen(encode, s, end);
-
- if (! DATA_ENSURE_CHECK(mb_len)) {
- DATA_ENSURE(1);
- s = (UChar* )end;
- p += tlen;
- goto cc_mb_not_success;
- }
-
- ss = s;
- s += mb_len;
- code = ONIGENC_MBC_TO_CODE(encode, ss, s);
-
-#ifdef PLATFORM_UNALIGNED_WORD_ACCESS
- if (onig_is_in_code_range(p, code)) goto fail;
-#else
- q = p;
- ALIGNMENT_RIGHT(q);
- if (onig_is_in_code_range(q, code)) goto fail;
-#endif
- }
- p += tlen;
-
- cc_mb_not_success:
- MOP_OUT;
- break;
-
- case OP_CCLASS_MIX_NOT: MOP_IN(OP_CCLASS_MIX_NOT);
- DATA_ENSURE(1);
- if (ONIGENC_IS_MBC_HEAD(encode, s, end)) {
- p += SIZE_BITSET;
- goto cclass_mb_not;
- }
- else {
- if (BITSET_AT(((BitSetRef )p), *s) != 0)
- goto fail;
-
- p += SIZE_BITSET;
- GET_LENGTH_INC(tlen, p);
- p += tlen;
- s++;
- }
- MOP_OUT;
- break;
-
- case OP_CCLASS_NODE: MOP_IN(OP_CCLASS_NODE);
- {
- OnigCodePoint code;
- void *node;
- int mb_len;
- UChar *ss;
-
- DATA_ENSURE(1);
- GET_POINTER_INC(node, p);
- mb_len = enclen(encode, s, end);
- ss = s;
- s += mb_len;
- DATA_ENSURE(0);
- code = ONIGENC_MBC_TO_CODE(encode, ss, s);
- if (onig_is_code_in_cc_len(mb_len, code, node) == 0) goto fail;
- }
- MOP_OUT;
- break;
-
- case OP_ANYCHAR: MOP_IN(OP_ANYCHAR);
- DATA_ENSURE(1);
- n = enclen(encode, s, end);
- DATA_ENSURE(n);
- if (ONIGENC_IS_MBC_NEWLINE(encode, s, end)) goto fail;
- s += n;
- MOP_OUT;
- break;
-
- case OP_ANYCHAR_ML: MOP_IN(OP_ANYCHAR_ML);
- DATA_ENSURE(1);
- n = enclen(encode, s, end);
- DATA_ENSURE(n);
- s += n;
- MOP_OUT;
- break;
-
- case OP_ANYCHAR_STAR: MOP_IN(OP_ANYCHAR_STAR);
- while (DATA_ENSURE_CHECK1) {
- STACK_PUSH_ALT(p, s, sprev);
- n = enclen(encode, s, end);
- DATA_ENSURE(n);
- if (ONIGENC_IS_MBC_NEWLINE(encode, s, end)) goto fail;
- sprev = s;
- s += n;
- }
- MOP_OUT;
- break;
-
- case OP_ANYCHAR_ML_STAR: MOP_IN(OP_ANYCHAR_ML_STAR);
- while (DATA_ENSURE_CHECK1) {
- STACK_PUSH_ALT(p, s, sprev);
- n = enclen(encode, s, end);
- if (n > 1) {
- DATA_ENSURE(n);
- sprev = s;
- s += n;
- }
- else {
- sprev = s;
- s++;
- }
- }
- MOP_OUT;
- break;
-
- case OP_ANYCHAR_STAR_PEEK_NEXT: MOP_IN(OP_ANYCHAR_STAR_PEEK_NEXT);
- while (DATA_ENSURE_CHECK1) {
- if (*p == *s) {
- STACK_PUSH_ALT(p + 1, s, sprev);
- }
- n = enclen(encode, s, end);
- DATA_ENSURE(n);
- if (ONIGENC_IS_MBC_NEWLINE(encode, s, end)) goto fail;
- sprev = s;
- s += n;
- }
- p++;
- MOP_OUT;
- break;
-
- case OP_ANYCHAR_ML_STAR_PEEK_NEXT:MOP_IN(OP_ANYCHAR_ML_STAR_PEEK_NEXT);
- while (DATA_ENSURE_CHECK1) {
- if (*p == *s) {
- STACK_PUSH_ALT(p + 1, s, sprev);
- }
- n = enclen(encode, s, end);
- if (n > 1) {
- DATA_ENSURE(n);
- sprev = s;
- s += n;
- }
- else {
- sprev = s;
- s++;
- }
- }
- p++;
- MOP_OUT;
- break;
-
-#ifdef USE_COMBINATION_EXPLOSION_CHECK
- case OP_STATE_CHECK_ANYCHAR_STAR: MOP_IN(OP_STATE_CHECK_ANYCHAR_STAR);
- GET_STATE_CHECK_NUM_INC(mem, p);
- while (DATA_ENSURE_CHECK1) {
- STATE_CHECK_VAL(scv, mem);
- if (scv) goto fail;
-
- STACK_PUSH_ALT_WITH_STATE_CHECK(p, s, sprev, mem);
- n = enclen(encode, s);
- DATA_ENSURE(n);
- if (ONIGENC_IS_MBC_NEWLINE(encode, s, end)) goto fail;
- sprev = s;
- s += n;
- }
- MOP_OUT;
- break;
-
- case OP_STATE_CHECK_ANYCHAR_ML_STAR:
- MOP_IN(OP_STATE_CHECK_ANYCHAR_ML_STAR);
-
- GET_STATE_CHECK_NUM_INC(mem, p);
- while (DATA_ENSURE_CHECK1) {
- STATE_CHECK_VAL(scv, mem);
- if (scv) goto fail;
-
- STACK_PUSH_ALT_WITH_STATE_CHECK(p, s, sprev, mem);
- n = enclen(encode, s);
- if (n > 1) {
- DATA_ENSURE(n);
- sprev = s;
- s += n;
- }
- else {
- sprev = s;
- s++;
- }
- }
- MOP_OUT;
- break;
-#endif /* USE_COMBINATION_EXPLOSION_CHECK */
-
- case OP_WORD: MOP_IN(OP_WORD);
- DATA_ENSURE(1);
- if (! ONIGENC_IS_MBC_WORD(encode, s, end))
- goto fail;
-
- s += enclen(encode, s, end);
- MOP_OUT;
- break;
-
- case OP_NOT_WORD: MOP_IN(OP_NOT_WORD);
- DATA_ENSURE(1);
- if (ONIGENC_IS_MBC_WORD(encode, s, end))
- goto fail;
-
- s += enclen(encode, s, end);
- MOP_OUT;
- break;
-
- case OP_WORD_BOUND: MOP_IN(OP_WORD_BOUND);
- if (ON_STR_BEGIN(s)) {
- DATA_ENSURE(1);
- if (! ONIGENC_IS_MBC_WORD(encode, s, end))
- goto fail;
- }
- else if (ON_STR_END(s)) {
- if (! ONIGENC_IS_MBC_WORD(encode, sprev, end))
- goto fail;
- }
- else {
- if (ONIGENC_IS_MBC_WORD(encode, s, end)
- == ONIGENC_IS_MBC_WORD(encode, sprev, end))
- goto fail;
- }
- MOP_OUT;
- continue;
- break;
-
- case OP_NOT_WORD_BOUND: MOP_IN(OP_NOT_WORD_BOUND);
- if (ON_STR_BEGIN(s)) {
- if (DATA_ENSURE_CHECK1 && ONIGENC_IS_MBC_WORD(encode, s, end))
- goto fail;
- }
- else if (ON_STR_END(s)) {
- if (ONIGENC_IS_MBC_WORD(encode, sprev, end))
- goto fail;
- }
- else {
- if (ONIGENC_IS_MBC_WORD(encode, s, end)
- != ONIGENC_IS_MBC_WORD(encode, sprev, end))
- goto fail;
- }
- MOP_OUT;
- continue;
- break;
-
-#ifdef USE_WORD_BEGIN_END
- case OP_WORD_BEGIN: MOP_IN(OP_WORD_BEGIN);
- if (DATA_ENSURE_CHECK1 && ONIGENC_IS_MBC_WORD(encode, s, end)) {
- if (ON_STR_BEGIN(s) || !ONIGENC_IS_MBC_WORD(encode, sprev, end)) {
- MOP_OUT;
- continue;
- }
- }
- goto fail;
- break;
-
- case OP_WORD_END: MOP_IN(OP_WORD_END);
- if (!ON_STR_BEGIN(s) && ONIGENC_IS_MBC_WORD(encode, sprev, end)) {
- if (ON_STR_END(s) || !ONIGENC_IS_MBC_WORD(encode, s, end)) {
- MOP_OUT;
- continue;
- }
- }
- goto fail;
- break;
-#endif
-
- case OP_BEGIN_BUF: MOP_IN(OP_BEGIN_BUF);
- if (! ON_STR_BEGIN(s)) goto fail;
-
- MOP_OUT;
- continue;
- break;
-
- case OP_END_BUF: MOP_IN(OP_END_BUF);
- if (! ON_STR_END(s)) goto fail;
-
- MOP_OUT;
- continue;
- break;
-
- case OP_BEGIN_LINE: MOP_IN(OP_BEGIN_LINE);
- if (ON_STR_BEGIN(s)) {
- if (IS_NOTBOL(msa->options)) goto fail;
- MOP_OUT;
- continue;
- }
- else if (ONIGENC_IS_MBC_NEWLINE(encode, sprev, end) && !ON_STR_END(s)) {
- MOP_OUT;
- continue;
- }
- goto fail;
- break;
-
- case OP_END_LINE: MOP_IN(OP_END_LINE);
- if (ON_STR_END(s)) {
-#ifndef USE_NEWLINE_AT_END_OF_STRING_HAS_EMPTY_LINE
- if (IS_EMPTY_STR || !ONIGENC_IS_MBC_NEWLINE(encode, sprev, end)) {
-#endif
- if (IS_NOTEOL(msa->options)) goto fail;
- MOP_OUT;
- continue;
-#ifndef USE_NEWLINE_AT_END_OF_STRING_HAS_EMPTY_LINE
- }
-#endif
- }
- else if (ONIGENC_IS_MBC_NEWLINE(encode, s, end)) {
- MOP_OUT;
- continue;
- }
-#ifdef USE_CRNL_AS_LINE_TERMINATOR
- else if (ONIGENC_IS_MBC_CRNL(encode, s, end)) {
- MOP_OUT;
- continue;
- }
-#endif
- goto fail;
- break;
-
- case OP_SEMI_END_BUF: MOP_IN(OP_SEMI_END_BUF);
- if (ON_STR_END(s)) {
-#ifndef USE_NEWLINE_AT_END_OF_STRING_HAS_EMPTY_LINE
- if (IS_EMPTY_STR || !ONIGENC_IS_MBC_NEWLINE(encode, sprev, end)) {
-#endif
- if (IS_NOTEOL(msa->options)) goto fail;
- MOP_OUT;
- continue;
-#ifndef USE_NEWLINE_AT_END_OF_STRING_HAS_EMPTY_LINE
- }
-#endif
- }
- else if (ONIGENC_IS_MBC_NEWLINE(encode, s, end) &&
- ON_STR_END(s + enclen(encode, s, end))) {
- MOP_OUT;
- continue;
- }
-#ifdef USE_CRNL_AS_LINE_TERMINATOR
- else if (ONIGENC_IS_MBC_CRNL(encode, s, end)) {
- UChar* ss = s + enclen(encode, s);
- ss += enclen(encode, ss);
- if (ON_STR_END(ss)) {
- MOP_OUT;
- continue;
- }
- }
-#endif
- goto fail;
- break;
-
- case OP_BEGIN_POSITION: MOP_IN(OP_BEGIN_POSITION);
- if (s != msa->start)
- goto fail;
-
- MOP_OUT;
- continue;
- break;
-
- case OP_MEMORY_START_PUSH: MOP_IN(OP_MEMORY_START_PUSH);
- GET_MEMNUM_INC(mem, p);
- STACK_PUSH_MEM_START(mem, s);
- MOP_OUT;
- continue;
- break;
-
- case OP_MEMORY_START: MOP_IN(OP_MEMORY_START);
- GET_MEMNUM_INC(mem, p);
- mem_start_stk[mem] = (OnigStackIndex )((void* )s);
- MOP_OUT;
- continue;
- break;
-
- case OP_MEMORY_END_PUSH: MOP_IN(OP_MEMORY_END_PUSH);
- GET_MEMNUM_INC(mem, p);
- STACK_PUSH_MEM_END(mem, s);
- MOP_OUT;
- continue;
- break;
-
- case OP_MEMORY_END: MOP_IN(OP_MEMORY_END);
- GET_MEMNUM_INC(mem, p);
- mem_end_stk[mem] = (OnigStackIndex )((void* )s);
- MOP_OUT;
- continue;
- break;
-
-#ifdef USE_SUBEXP_CALL
- case OP_MEMORY_END_PUSH_REC: MOP_IN(OP_MEMORY_END_PUSH_REC);
- GET_MEMNUM_INC(mem, p);
- STACK_GET_MEM_START(mem, stkp); /* should be before push mem-end. */
- STACK_PUSH_MEM_END(mem, s);
- mem_start_stk[mem] = GET_STACK_INDEX(stkp);
- MOP_OUT;
- continue;
- break;
-
- case OP_MEMORY_END_REC: MOP_IN(OP_MEMORY_END_REC);
- GET_MEMNUM_INC(mem, p);
- mem_end_stk[mem] = (OnigStackIndex )((void* )s);
- STACK_GET_MEM_START(mem, stkp);
-
- if (BIT_STATUS_AT(reg->bt_mem_start, mem))
- mem_start_stk[mem] = GET_STACK_INDEX(stkp);
- else
- mem_start_stk[mem] = (OnigStackIndex )((void* )stkp->u.mem.pstr);
-
- STACK_PUSH_MEM_END_MARK(mem);
- MOP_OUT;
- continue;
- break;
-#endif
-
- case OP_BACKREF1: MOP_IN(OP_BACKREF1);
- mem = 1;
- goto backref;
- break;
-
- case OP_BACKREF2: MOP_IN(OP_BACKREF2);
- mem = 2;
- goto backref;
- break;
-
- case OP_BACKREFN: MOP_IN(OP_BACKREFN);
- GET_MEMNUM_INC(mem, p);
- backref:
- {
- int len;
- UChar *pstart, *pend;
-
- /* if you want to remove following line,
- you should check in parse and compile time. */
- if (mem > num_mem) goto fail;
- if (mem_end_stk[mem] == INVALID_STACK_INDEX) goto fail;
- if (mem_start_stk[mem] == INVALID_STACK_INDEX) goto fail;
-
- if (BIT_STATUS_AT(reg->bt_mem_start, mem))
- pstart = STACK_AT(mem_start_stk[mem])->u.mem.pstr;
- else
- pstart = (UChar* )((void* )mem_start_stk[mem]);
-
- pend = (BIT_STATUS_AT(reg->bt_mem_end, mem)
- ? STACK_AT(mem_end_stk[mem])->u.mem.pstr
- : (UChar* )((void* )mem_end_stk[mem]));
- n = pend - pstart;
- DATA_ENSURE(n);
- sprev = s;
- STRING_CMP(pstart, s, n);
- while (sprev + (len = enclen(encode, sprev, end)) < s)
- sprev += len;
-
- MOP_OUT;
- continue;
- }
- break;
-
- case OP_BACKREFN_IC: MOP_IN(OP_BACKREFN_IC);
- GET_MEMNUM_INC(mem, p);
- {
- int len;
- UChar *pstart, *pend;
-
- /* if you want to remove following line,
- you should check in parse and compile time. */
- if (mem > num_mem) goto fail;
- if (mem_end_stk[mem] == INVALID_STACK_INDEX) goto fail;
- if (mem_start_stk[mem] == INVALID_STACK_INDEX) goto fail;
-
- if (BIT_STATUS_AT(reg->bt_mem_start, mem))
- pstart = STACK_AT(mem_start_stk[mem])->u.mem.pstr;
- else
- pstart = (UChar* )((void* )mem_start_stk[mem]);
-
- pend = (BIT_STATUS_AT(reg->bt_mem_end, mem)
- ? STACK_AT(mem_end_stk[mem])->u.mem.pstr
- : (UChar* )((void* )mem_end_stk[mem]));
- n = pend - pstart;
- DATA_ENSURE(n);
- sprev = s;
- STRING_CMP_IC(case_fold_flag, pstart, &s, n, end);
- while (sprev + (len = enclen(encode, sprev, end)) < s)
- sprev += len;
-
- MOP_OUT;
- continue;
- }
- break;
-
- case OP_BACKREF_MULTI: MOP_IN(OP_BACKREF_MULTI);
- {
- int len, is_fail;
- UChar *pstart, *pend, *swork;
-
- GET_LENGTH_INC(tlen, p);
- for (i = 0; i < tlen; i++) {
- GET_MEMNUM_INC(mem, p);
-
- if (mem_end_stk[mem] == INVALID_STACK_INDEX) continue;
- if (mem_start_stk[mem] == INVALID_STACK_INDEX) continue;
-
- if (BIT_STATUS_AT(reg->bt_mem_start, mem))
- pstart = STACK_AT(mem_start_stk[mem])->u.mem.pstr;
- else
- pstart = (UChar* )((void* )mem_start_stk[mem]);
-
- pend = (BIT_STATUS_AT(reg->bt_mem_end, mem)
- ? STACK_AT(mem_end_stk[mem])->u.mem.pstr
- : (UChar* )((void* )mem_end_stk[mem]));
- n = pend - pstart;
- DATA_ENSURE(n);
- sprev = s;
- swork = s;
- STRING_CMP_VALUE(pstart, swork, n, is_fail);
- if (is_fail) continue;
- s = swork;
- while (sprev + (len = enclen(encode, sprev, end)) < s)
- sprev += len;
-
- p += (SIZE_MEMNUM * (tlen - i - 1));
- break; /* success */
- }
- if (i == tlen) goto fail;
- MOP_OUT;
- continue;
- }
- break;
-
- case OP_BACKREF_MULTI_IC: MOP_IN(OP_BACKREF_MULTI_IC);
- {
- int len, is_fail;
- UChar *pstart, *pend, *swork;
-
- GET_LENGTH_INC(tlen, p);
- for (i = 0; i < tlen; i++) {
- GET_MEMNUM_INC(mem, p);
-
- if (mem_end_stk[mem] == INVALID_STACK_INDEX) continue;
- if (mem_start_stk[mem] == INVALID_STACK_INDEX) continue;
-
- if (BIT_STATUS_AT(reg->bt_mem_start, mem))
- pstart = STACK_AT(mem_start_stk[mem])->u.mem.pstr;
- else
- pstart = (UChar* )((void* )mem_start_stk[mem]);
-
- pend = (BIT_STATUS_AT(reg->bt_mem_end, mem)
- ? STACK_AT(mem_end_stk[mem])->u.mem.pstr
- : (UChar* )((void* )mem_end_stk[mem]));
- n = pend - pstart;
- DATA_ENSURE(n);
- sprev = s;
- swork = s;
- STRING_CMP_VALUE_IC(case_fold_flag, pstart, &swork, n, end, is_fail);
- if (is_fail) continue;
- s = swork;
- while (sprev + (len = enclen(encode, sprev, end)) < s)
- sprev += len;
-
- p += (SIZE_MEMNUM * (tlen - i - 1));
- break; /* success */
- }
- if (i == tlen) goto fail;
- MOP_OUT;
- continue;
- }
- break;
-
-#ifdef USE_BACKREF_WITH_LEVEL
- case OP_BACKREF_WITH_LEVEL:
- {
- int len;
- OnigOptionType ic;
- LengthType level;
-
- GET_OPTION_INC(ic, p);
- GET_LENGTH_INC(level, p);
- GET_LENGTH_INC(tlen, p);
-
- sprev = s;
- if (backref_match_at_nested_level(reg, stk, stk_base, ic
- , case_fold_flag, (int )level, (int )tlen, p, &s, end)) {
- while (sprev + (len = enclen(encode, sprev, end)) < s)
- sprev += len;
-
- p += (SIZE_MEMNUM * tlen);
- }
- else
- goto fail;
-
- MOP_OUT;
- continue;
- }
-
- break;
-#endif
-
-#if 0 /* no need: IS_DYNAMIC_OPTION() == 0 */
- case OP_SET_OPTION_PUSH: MOP_IN(OP_SET_OPTION_PUSH);
- GET_OPTION_INC(option, p);
- STACK_PUSH_ALT(p, s, sprev);
- p += SIZE_OP_SET_OPTION + SIZE_OP_FAIL;
- MOP_OUT;
- continue;
- break;
-
- case OP_SET_OPTION: MOP_IN(OP_SET_OPTION);
- GET_OPTION_INC(option, p);
- MOP_OUT;
- continue;
- break;
-#endif
-
- case OP_NULL_CHECK_START: MOP_IN(OP_NULL_CHECK_START);
- GET_MEMNUM_INC(mem, p); /* mem: null check id */
- STACK_PUSH_NULL_CHECK_START(mem, s);
- MOP_OUT;
- continue;
- break;
-
- case OP_NULL_CHECK_END: MOP_IN(OP_NULL_CHECK_END);
- {
- int isnull;
-
- GET_MEMNUM_INC(mem, p); /* mem: null check id */
- STACK_NULL_CHECK(isnull, mem, s);
- if (isnull) {
-#ifdef ONIG_DEBUG_MATCH
- fprintf(stderr, "NULL_CHECK_END: skip id:%d, s:%d\n",
- (int )mem, (int )s);
-#endif
- null_check_found:
- /* empty loop founded, skip next instruction */
- switch (*p++) {
- case OP_JUMP:
- case OP_PUSH:
- p += SIZE_RELADDR;
- break;
- case OP_REPEAT_INC:
- case OP_REPEAT_INC_NG:
- case OP_REPEAT_INC_SG:
- case OP_REPEAT_INC_NG_SG:
- p += SIZE_MEMNUM;
- break;
- default:
- goto unexpected_bytecode_error;
- break;
- }
- }
- }
- MOP_OUT;
- continue;
- break;
-
-#ifdef USE_MONOMANIAC_CHECK_CAPTURES_IN_ENDLESS_REPEAT
- case OP_NULL_CHECK_END_MEMST: MOP_IN(OP_NULL_CHECK_END_MEMST);
- {
- int isnull;
-
- GET_MEMNUM_INC(mem, p); /* mem: null check id */
- STACK_NULL_CHECK_MEMST(isnull, mem, s, reg);
- if (isnull) {
-#ifdef ONIG_DEBUG_MATCH
- fprintf(stderr, "NULL_CHECK_END_MEMST: skip id:%d, s:%d\n",
- (int )mem, (int )s);
-#endif
- if (isnull == -1) goto fail;
- goto null_check_found;
- }
- }
- MOP_OUT;
- continue;
- break;
-#endif
-
-#ifdef USE_SUBEXP_CALL
- case OP_NULL_CHECK_END_MEMST_PUSH:
- MOP_IN(OP_NULL_CHECK_END_MEMST_PUSH);
- {
- int isnull;
-
- GET_MEMNUM_INC(mem, p); /* mem: null check id */
-#ifdef USE_MONOMANIAC_CHECK_CAPTURES_IN_ENDLESS_REPEAT
- STACK_NULL_CHECK_MEMST_REC(isnull, mem, s, reg);
-#else
- STACK_NULL_CHECK_REC(isnull, mem, s);
-#endif
- if (isnull) {
-#ifdef ONIG_DEBUG_MATCH
- fprintf(stderr, "NULL_CHECK_END_MEMST_PUSH: skip id:%d, s:%d\n",
- (int )mem, (int )s);
-#endif
- if (isnull == -1) goto fail;
- goto null_check_found;
- }
- else {
- STACK_PUSH_NULL_CHECK_END(mem);
- }
- }
- MOP_OUT;
- continue;
- break;
-#endif
-
- case OP_JUMP: MOP_IN(OP_JUMP);
- GET_RELADDR_INC(addr, p);
- p += addr;
- MOP_OUT;
- CHECK_INTERRUPT_IN_MATCH_AT;
- continue;
- break;
-
- case OP_PUSH: MOP_IN(OP_PUSH);
- GET_RELADDR_INC(addr, p);
- STACK_PUSH_ALT(p + addr, s, sprev);
- MOP_OUT;
- continue;
- break;
-
-#ifdef USE_COMBINATION_EXPLOSION_CHECK
- case OP_STATE_CHECK_PUSH: MOP_IN(OP_STATE_CHECK_PUSH);
- GET_STATE_CHECK_NUM_INC(mem, p);
- STATE_CHECK_VAL(scv, mem);
- if (scv) goto fail;
-
- GET_RELADDR_INC(addr, p);
- STACK_PUSH_ALT_WITH_STATE_CHECK(p + addr, s, sprev, mem);
- MOP_OUT;
- continue;
- break;
-
- case OP_STATE_CHECK_PUSH_OR_JUMP: MOP_IN(OP_STATE_CHECK_PUSH_OR_JUMP);
- GET_STATE_CHECK_NUM_INC(mem, p);
- GET_RELADDR_INC(addr, p);
- STATE_CHECK_VAL(scv, mem);
- if (scv) {
- p += addr;
- }
- else {
- STACK_PUSH_ALT_WITH_STATE_CHECK(p + addr, s, sprev, mem);
- }
- MOP_OUT;
- continue;
- break;
-
- case OP_STATE_CHECK: MOP_IN(OP_STATE_CHECK);
- GET_STATE_CHECK_NUM_INC(mem, p);
- STATE_CHECK_VAL(scv, mem);
- if (scv) goto fail;
-
- STACK_PUSH_STATE_CHECK(s, mem);
- MOP_OUT;
- continue;
- break;
-#endif /* USE_COMBINATION_EXPLOSION_CHECK */
-
- case OP_POP: MOP_IN(OP_POP);
- STACK_POP_ONE;
- MOP_OUT;
- continue;
- break;
-
- case OP_PUSH_OR_JUMP_EXACT1: MOP_IN(OP_PUSH_OR_JUMP_EXACT1);
- GET_RELADDR_INC(addr, p);
- if (*p == *s && DATA_ENSURE_CHECK1) {
- p++;
- STACK_PUSH_ALT(p + addr, s, sprev);
- MOP_OUT;
- continue;
- }
- p += (addr + 1);
- MOP_OUT;
- continue;
- break;
-
- case OP_PUSH_IF_PEEK_NEXT: MOP_IN(OP_PUSH_IF_PEEK_NEXT);
- GET_RELADDR_INC(addr, p);
- if (*p == *s) {
- p++;
- STACK_PUSH_ALT(p + addr, s, sprev);
- MOP_OUT;
- continue;
- }
- p++;
- MOP_OUT;
- continue;
- break;
-
- case OP_REPEAT: MOP_IN(OP_REPEAT);
- {
- GET_MEMNUM_INC(mem, p); /* mem: OP_REPEAT ID */
- GET_RELADDR_INC(addr, p);
-
- STACK_ENSURE(1);
- repeat_stk[mem] = GET_STACK_INDEX(stk);
- STACK_PUSH_REPEAT(mem, p);
-
- if (reg->repeat_range[mem].lower == 0) {
- STACK_PUSH_ALT(p + addr, s, sprev);
- }
- }
- MOP_OUT;
- continue;
- break;
-
- case OP_REPEAT_NG: MOP_IN(OP_REPEAT_NG);
- {
- GET_MEMNUM_INC(mem, p); /* mem: OP_REPEAT ID */
- GET_RELADDR_INC(addr, p);
-
- STACK_ENSURE(1);
- repeat_stk[mem] = GET_STACK_INDEX(stk);
- STACK_PUSH_REPEAT(mem, p);
-
- if (reg->repeat_range[mem].lower == 0) {
- STACK_PUSH_ALT(p, s, sprev);
- p += addr;
- }
- }
- MOP_OUT;
- continue;
- break;
-
- case OP_REPEAT_INC: MOP_IN(OP_REPEAT_INC);
- GET_MEMNUM_INC(mem, p); /* mem: OP_REPEAT ID */
- si = repeat_stk[mem];
- stkp = STACK_AT(si);
-
- repeat_inc:
- stkp->u.repeat.count++;
- if (stkp->u.repeat.count >= reg->repeat_range[mem].upper) {
- /* end of repeat. Nothing to do. */
- }
- else if (stkp->u.repeat.count >= reg->repeat_range[mem].lower) {
- STACK_PUSH_ALT(p, s, sprev);
- p = STACK_AT(si)->u.repeat.pcode; /* Don't use stkp after PUSH. */
- }
- else {
- p = stkp->u.repeat.pcode;
- }
- STACK_PUSH_REPEAT_INC(si);
- MOP_OUT;
- CHECK_INTERRUPT_IN_MATCH_AT;
- continue;
- break;
-
- case OP_REPEAT_INC_SG: MOP_IN(OP_REPEAT_INC_SG);
- GET_MEMNUM_INC(mem, p); /* mem: OP_REPEAT ID */
- STACK_GET_REPEAT(mem, stkp);
- si = GET_STACK_INDEX(stkp);
- goto repeat_inc;
- break;
-
- case OP_REPEAT_INC_NG: MOP_IN(OP_REPEAT_INC_NG);
- GET_MEMNUM_INC(mem, p); /* mem: OP_REPEAT ID */
- si = repeat_stk[mem];
- stkp = STACK_AT(si);
-
- repeat_inc_ng:
- stkp->u.repeat.count++;
- if (stkp->u.repeat.count < reg->repeat_range[mem].upper) {
- if (stkp->u.repeat.count >= reg->repeat_range[mem].lower) {
- UChar* pcode = stkp->u.repeat.pcode;
-
- STACK_PUSH_REPEAT_INC(si);
- STACK_PUSH_ALT(pcode, s, sprev);
- }
- else {
- p = stkp->u.repeat.pcode;
- STACK_PUSH_REPEAT_INC(si);
- }
- }
- else if (stkp->u.repeat.count == reg->repeat_range[mem].upper) {
- STACK_PUSH_REPEAT_INC(si);
- }
- MOP_OUT;
- CHECK_INTERRUPT_IN_MATCH_AT;
- continue;
- break;
-
- case OP_REPEAT_INC_NG_SG: MOP_IN(OP_REPEAT_INC_NG_SG);
- GET_MEMNUM_INC(mem, p); /* mem: OP_REPEAT ID */
- STACK_GET_REPEAT(mem, stkp);
- si = GET_STACK_INDEX(stkp);
- goto repeat_inc_ng;
- break;
-
- case OP_PUSH_POS: MOP_IN(OP_PUSH_POS);
- STACK_PUSH_POS(s, sprev);
- MOP_OUT;
- continue;
- break;
-
- case OP_POP_POS: MOP_IN(OP_POP_POS);
- {
- STACK_POS_END(stkp);
- s = stkp->u.state.pstr;
- sprev = stkp->u.state.pstr_prev;
- }
- MOP_OUT;
- continue;
- break;
-
- case OP_PUSH_POS_NOT: MOP_IN(OP_PUSH_POS_NOT);
- GET_RELADDR_INC(addr, p);
- STACK_PUSH_POS_NOT(p + addr, s, sprev);
- MOP_OUT;
- continue;
- break;
-
- case OP_FAIL_POS: MOP_IN(OP_FAIL_POS);
- STACK_POP_TIL_POS_NOT;
- goto fail;
- break;
-
- case OP_PUSH_STOP_BT: MOP_IN(OP_PUSH_STOP_BT);
- STACK_PUSH_STOP_BT;
- MOP_OUT;
- continue;
- break;
-
- case OP_POP_STOP_BT: MOP_IN(OP_POP_STOP_BT);
- STACK_STOP_BT_END;
- MOP_OUT;
- continue;
- break;
-
- case OP_LOOK_BEHIND: MOP_IN(OP_LOOK_BEHIND);
- GET_LENGTH_INC(tlen, p);
- s = (UChar* )ONIGENC_STEP_BACK(encode, str, s, end, (int )tlen);
- if (IS_NULL(s)) goto fail;
- sprev = (UChar* )onigenc_get_prev_char_head(encode, str, s, end);
- MOP_OUT;
- continue;
- break;
-
- case OP_PUSH_LOOK_BEHIND_NOT: MOP_IN(OP_PUSH_LOOK_BEHIND_NOT);
- GET_RELADDR_INC(addr, p);
- GET_LENGTH_INC(tlen, p);
- q = (UChar* )ONIGENC_STEP_BACK(encode, str, s, end, (int )tlen);
- if (IS_NULL(q)) {
- /* too short case -> success. ex. /(?<!XXX)a/.match("a")
- If you want to change to fail, replace following line. */
- p += addr;
- /* goto fail; */
- }
- else {
- STACK_PUSH_LOOK_BEHIND_NOT(p + addr, s, sprev);
- s = q;
- sprev = (UChar* )onigenc_get_prev_char_head(encode, str, s, end);
- }
- MOP_OUT;
- continue;
- break;
-
- case OP_FAIL_LOOK_BEHIND_NOT: MOP_IN(OP_FAIL_LOOK_BEHIND_NOT);
- STACK_POP_TIL_LOOK_BEHIND_NOT;
- goto fail;
- break;
-
-#ifdef USE_SUBEXP_CALL
- case OP_CALL: MOP_IN(OP_CALL);
- GET_ABSADDR_INC(addr, p);
- STACK_PUSH_CALL_FRAME(p);
- p = reg->p + addr;
- MOP_OUT;
- continue;
- break;
-
- case OP_RETURN: MOP_IN(OP_RETURN);
- STACK_RETURN(p);
- STACK_PUSH_RETURN;
- MOP_OUT;
- continue;
- break;
-#endif
-
- case OP_FINISH:
- goto finish;
- break;
-
- fail:
- MOP_OUT;
- /* fall */
- case OP_FAIL: MOP_IN(OP_FAIL);
- STACK_POP;
- p = stk->u.state.pcode;
- s = stk->u.state.pstr;
- sprev = stk->u.state.pstr_prev;
-
-#ifdef USE_COMBINATION_EXPLOSION_CHECK
- if (stk->u.state.state_check != 0) {
- stk->type = STK_STATE_CHECK_MARK;
- stk++;
- }
-#endif
-
- MOP_OUT;
- continue;
- break;
-
- default:
- goto bytecode_error;
-
- } /* end of switch */
- sprev = sbegin;
- } /* end of while(1) */
-
- finish:
- STACK_SAVE;
- return best_len;
-
-#ifdef ONIG_DEBUG
- stack_error:
- STACK_SAVE;
- return ONIGERR_STACK_BUG;
-#endif
-
- bytecode_error:
- STACK_SAVE;
- return ONIGERR_UNDEFINED_BYTECODE;
-
- unexpected_bytecode_error:
- STACK_SAVE;
- return ONIGERR_UNEXPECTED_BYTECODE;
-}
-
-
-static UChar*
-slow_search(OnigEncoding enc, UChar* target, UChar* target_end,
- const UChar* text, const UChar* text_end, UChar* text_range)
-{
- UChar *t, *p, *s, *end;
-
- end = (UChar* )text_end;
- end -= target_end - target - 1;
- if (end > text_range)
- end = text_range;
-
- s = (UChar* )text;
-
- if (enc->max_enc_len == enc->min_enc_len) {
- int n = enc->max_enc_len;
-
- while (s < end) {
- if (*s == *target) {
- p = s + 1;
- t = target + 1;
- if (target_end == t || memcmp(t, p, target_end - t) == 0)
- return s;
- }
- s += n;
- }
- return (UChar*)NULL;
- }
- while (s < end) {
- if (*s == *target) {
- p = s + 1;
- t = target + 1;
- if (target_end == t || memcmp(t, p, target_end - t) == 0)
- return s;
- }
- s += enclen(enc, s, text_end);
- }
-
- return (UChar* )NULL;
-}
-
-static int
-str_lower_case_match(OnigEncoding enc, int case_fold_flag,
- const UChar* t, const UChar* tend,
- const UChar* p, const UChar* end)
-{
- int lowlen;
- UChar *q, lowbuf[ONIGENC_MBC_CASE_FOLD_MAXLEN];
-
- while (t < tend) {
- lowlen = ONIGENC_MBC_CASE_FOLD(enc, case_fold_flag, &p, end, lowbuf);
- q = lowbuf;
- while (lowlen > 0) {
- if (*t++ != *q++) return 0;
- lowlen--;
- }
- }
-
- return 1;
-}
-
-static UChar*
-slow_search_ic(OnigEncoding enc, int case_fold_flag,
- UChar* target, UChar* target_end,
- const UChar* text, const UChar* text_end, UChar* text_range)
-{
- UChar *s, *end;
-
- end = (UChar* )text_end;
- end -= target_end - target - 1;
- if (end > text_range)
- end = text_range;
-
- s = (UChar* )text;
-
- while (s < end) {
- if (str_lower_case_match(enc, case_fold_flag, target, target_end,
- s, text_end))
- return s;
-
- s += enclen(enc, s, text_end);
- }
-
- return (UChar* )NULL;
-}
-
-static UChar*
-slow_search_backward(OnigEncoding enc, UChar* target, UChar* target_end,
- const UChar* text, const UChar* adjust_text,
- const UChar* text_end, const UChar* text_start)
-{
- UChar *t, *p, *s;
-
- s = (UChar* )text_end;
- s -= (target_end - target);
- if (s > text_start)
- s = (UChar* )text_start;
- else
- s = ONIGENC_LEFT_ADJUST_CHAR_HEAD(enc, adjust_text, s, text_end);
-
- while (s >= text) {
- if (*s == *target) {
- p = s + 1;
- t = target + 1;
- while (t < target_end) {
- if (*t != *p++)
- break;
- t++;
- }
- if (t == target_end)
- return s;
- }
- s = (UChar* )onigenc_get_prev_char_head(enc, adjust_text, s, text_end);
- }
-
- return (UChar* )NULL;
-}
-
-static UChar*
-slow_search_backward_ic(OnigEncoding enc, int case_fold_flag,
- UChar* target, UChar* target_end,
- const UChar* text, const UChar* adjust_text,
- const UChar* text_end, const UChar* text_start)
-{
- UChar *s;
-
- s = (UChar* )text_end;
- s -= (target_end - target);
- if (s > text_start)
- s = (UChar* )text_start;
- else
- s = ONIGENC_LEFT_ADJUST_CHAR_HEAD(enc, adjust_text, s, text_end);
-
- while (s >= text) {
- if (str_lower_case_match(enc, case_fold_flag,
- target, target_end, s, text_end))
- return s;
-
- s = (UChar* )onigenc_get_prev_char_head(enc, adjust_text, s, text_end);
- }
-
- return (UChar* )NULL;
-}
-
-static UChar*
-bm_search_notrev(regex_t* reg, const UChar* target, const UChar* target_end,
- const UChar* text, const UChar* text_end,
- const UChar* text_range)
-{
- const UChar *s, *se, *t, *p, *end;
- const UChar *tail;
- int skip, tlen1;
-
-#ifdef ONIG_DEBUG_SEARCH
- fprintf(stderr, "bm_search_notrev: text: %d, text_end: %d, text_range: %d\n",
- (int )text, (int )text_end, (int )text_range);
-#endif
-
- tail = target_end - 1;
- tlen1 = tail - target;
- end = text_range;
- if (end + tlen1 > text_end)
- end = text_end - tlen1;
-
- s = text;
-
- if (IS_NULL(reg->int_map)) {
- while (s < end) {
- p = se = s + tlen1;
- t = tail;
- while (t >= target && *p == *t) {
- p--; t--;
- }
- if (t < target) return (UChar* )s;
-
- skip = reg->map[*se];
- t = s;
- do {
- s += enclen(reg->enc, s, end);
- } while ((s - t) < skip && s < end);
- }
- }
- else {
- while (s < end) {
- p = se = s + tlen1;
- t = tail;
- while (t >= target && *p == *t) {
- p--; t--;
- }
- if (t < target) return (UChar* )s;
-
- skip = reg->int_map[*se];
- t = s;
- do {
- s += enclen(reg->enc, s, end);
- } while ((s - t) < skip && s < end);
- }
- }
-
- return (UChar* )NULL;
-}
-
-static UChar*
-bm_search(regex_t* reg, const UChar* target, const UChar* target_end,
- const UChar* text, const UChar* text_end, const UChar* text_range)
-{
- const UChar *s, *t, *p, *end;
- const UChar *tail;
-
- end = text_range + (target_end - target) - 1;
- if (end > text_end)
- end = text_end;
-
- tail = target_end - 1;
- s = text + (target_end - target) - 1;
- if (IS_NULL(reg->int_map)) {
- while (s < end) {
- p = s;
- t = tail;
- while (t >= target && *p == *t) {
- p--; t--;
- }
- if (t < target) return (UChar* )(p + 1);
- s += reg->map[*s];
- }
- }
- else { /* see int_map[] */
- while (s < end) {
- p = s;
- t = tail;
- while (t >= target && *p == *t) {
- p--; t--;
- }
- if (t < target) return (UChar* )(p + 1);
- s += reg->int_map[*s];
- }
- }
- return (UChar* )NULL;
-}
-
-static int
-set_bm_backward_skip(UChar* s, UChar* end, OnigEncoding enc ARG_UNUSED,
- int** skip)
-
-{
- int i, len;
-
- if (IS_NULL(*skip)) {
- *skip = (int* )xmalloc(sizeof(int) * ONIG_CHAR_TABLE_SIZE);
- if (IS_NULL(*skip)) return ONIGERR_MEMORY;
- }
-
- len = end - s;
- for (i = 0; i < ONIG_CHAR_TABLE_SIZE; i++)
- (*skip)[i] = len;
-
- for (i = len - 1; i > 0; i--)
- (*skip)[s[i]] = i;
-
- return 0;
-}
-
-static UChar*
-bm_search_backward(regex_t* reg, const UChar* target, const UChar* target_end,
- const UChar* text, const UChar* adjust_text,
- const UChar* text_end, const UChar* text_start)
-{
- const UChar *s, *t, *p;
-
- s = text_end - (target_end - target);
- if (text_start < s)
- s = text_start;
- else
- s = ONIGENC_LEFT_ADJUST_CHAR_HEAD(reg->enc, adjust_text, s, text_end);
-
- while (s >= text) {
- p = s;
- t = target;
- while (t < target_end && *p == *t) {
- p++; t++;
- }
- if (t == target_end)
- return (UChar* )s;
-
- s -= reg->int_map_backward[*s];
- s = ONIGENC_LEFT_ADJUST_CHAR_HEAD(reg->enc, adjust_text, s, text_end);
- }
-
- return (UChar* )NULL;
-}
-
-static UChar*
-map_search(OnigEncoding enc, UChar map[],
- const UChar* text, const UChar* text_range, const UChar* text_end)
-{
- const UChar *s = text;
-
- while (s < text_range) {
- if (map[*s]) return (UChar* )s;
-
- s += enclen(enc, s, text_end);
- }
- return (UChar* )NULL;
-}
-
-static UChar*
-map_search_backward(OnigEncoding enc, UChar map[],
- const UChar* text, const UChar* adjust_text,
- const UChar* text_start, const UChar* text_end)
-{
- const UChar *s = text_start;
-
- while (s >= text) {
- if (map[*s]) return (UChar* )s;
-
- s = onigenc_get_prev_char_head(enc, adjust_text, s, text_end);
- }
- return (UChar* )NULL;
-}
-
-extern long
-onig_match(regex_t* reg, const UChar* str, const UChar* end, const UChar* at, OnigRegion* region,
- OnigOptionType option)
-{
- long r;
- UChar *prev;
- OnigMatchArg msa;
-
-#if defined(USE_RECOMPILE_API) && defined(USE_MULTI_THREAD_SYSTEM)
- start:
- THREAD_ATOMIC_START;
- if (ONIG_STATE(reg) >= ONIG_STATE_NORMAL) {
- ONIG_STATE_INC(reg);
- if (IS_NOT_NULL(reg->chain) && ONIG_STATE(reg) == ONIG_STATE_NORMAL) {
- onig_chain_reduce(reg);
- ONIG_STATE_INC(reg);
- }
- }
- else {
- int n;
-
- THREAD_ATOMIC_END;
- n = 0;
- while (ONIG_STATE(reg) < ONIG_STATE_NORMAL) {
- if (++n > THREAD_PASS_LIMIT_COUNT)
- return ONIGERR_OVER_THREAD_PASS_LIMIT_COUNT;
- THREAD_PASS;
- }
- goto start;
- }
- THREAD_ATOMIC_END;
-#endif /* USE_RECOMPILE_API && USE_MULTI_THREAD_SYSTEM */
-
- MATCH_ARG_INIT(msa, option, region, at);
-#ifdef USE_COMBINATION_EXPLOSION_CHECK
- {
- int offset = at - str;
- STATE_CHECK_BUFF_INIT(msa, end - str, offset, reg->num_comb_exp_check);
- }
-#endif
-
- if (region
-#ifdef USE_POSIX_API_REGION_OPTION
- && !IS_POSIX_REGION(option)
-#endif
- ) {
- r = onig_region_resize_clear(region, reg->num_mem + 1);
- }
- else
- r = 0;
-
- if (r == 0) {
- prev = (UChar* )onigenc_get_prev_char_head(reg->enc, str, at, end);
- r = match_at(reg, str, end,
-#ifdef USE_MATCH_RANGE_MUST_BE_INSIDE_OF_SPECIFIED_RANGE
- end,
-#endif
- at, prev, &msa);
- }
-
- MATCH_ARG_FREE(msa);
- ONIG_STATE_DEC_THREAD(reg);
- return r;
-}
-
-static int
-forward_search_range(regex_t* reg, const UChar* str, const UChar* end, UChar* s,
- UChar* range, UChar** low, UChar** high, UChar** low_prev)
-{
- UChar *p, *pprev = (UChar* )NULL;
-
-#ifdef ONIG_DEBUG_SEARCH
- fprintf(stderr, "forward_search_range: str: %d, end: %d, s: %d, range: %d\n",
- (int )str, (int )end, (int )s, (int )range);
-#endif
-
- p = s;
- if (reg->dmin > 0) {
- if (ONIGENC_IS_SINGLEBYTE(reg->enc)) {
- p += reg->dmin;
- }
- else {
- UChar *q = p + reg->dmin;
- while (p < q) p += enclen(reg->enc, p, end);
- }
- }
-
- retry:
- switch (reg->optimize) {
- case ONIG_OPTIMIZE_EXACT:
- p = slow_search(reg->enc, reg->exact, reg->exact_end, p, end, range);
- break;
- case ONIG_OPTIMIZE_EXACT_IC:
- p = slow_search_ic(reg->enc, reg->case_fold_flag,
- reg->exact, reg->exact_end, p, end, range);
- break;
-
- case ONIG_OPTIMIZE_EXACT_BM:
- p = bm_search(reg, reg->exact, reg->exact_end, p, end, range);
- break;
-
- case ONIG_OPTIMIZE_EXACT_BM_NOT_REV:
- p = bm_search_notrev(reg, reg->exact, reg->exact_end, p, end, range);
- break;
-
- case ONIG_OPTIMIZE_MAP:
- p = map_search(reg->enc, reg->map, p, range, end);
- break;
- }
-
- if (p && p < range) {
- if (p - reg->dmin < s) {
- retry_gate:
- pprev = p;
- p += enclen(reg->enc, p, end);
- goto retry;
- }
-
- if (reg->sub_anchor) {
- UChar* prev;
-
- switch (reg->sub_anchor) {
- case ANCHOR_BEGIN_LINE:
- if (!ON_STR_BEGIN(p)) {
- prev = onigenc_get_prev_char_head(reg->enc,
- (pprev ? pprev : str), p, end);
- if (!ONIGENC_IS_MBC_NEWLINE(reg->enc, prev, end))
- goto retry_gate;
- }
- break;
-
- case ANCHOR_END_LINE:
- if (ON_STR_END(p)) {
-#ifndef USE_NEWLINE_AT_END_OF_STRING_HAS_EMPTY_LINE
- prev = (UChar* )onigenc_get_prev_char_head(reg->enc,
- (pprev ? pprev : str), p);
- if (prev && ONIGENC_IS_MBC_NEWLINE(reg->enc, prev, end))
- goto retry_gate;
-#endif
- }
- else if (! ONIGENC_IS_MBC_NEWLINE(reg->enc, p, end)
-#ifdef USE_CRNL_AS_LINE_TERMINATOR
- && ! ONIGENC_IS_MBC_CRNL(reg->enc, p, end)
-#endif
- )
- goto retry_gate;
- break;
- }
- }
-
- if (reg->dmax == 0) {
- *low = p;
- if (low_prev) {
- if (*low > s)
- *low_prev = onigenc_get_prev_char_head(reg->enc, s, p, end);
- else
- *low_prev = onigenc_get_prev_char_head(reg->enc,
- (pprev ? pprev : str), p, end);
- }
- }
- else {
- if (reg->dmax != ONIG_INFINITE_DISTANCE) {
- *low = p - reg->dmax;
- if (*low > s) {
- *low = onigenc_get_right_adjust_char_head_with_prev(reg->enc, s,
- *low, end, (const UChar** )low_prev);
- if (low_prev && IS_NULL(*low_prev))
- *low_prev = onigenc_get_prev_char_head(reg->enc,
- (pprev ? pprev : s), *low, end);
- }
- else {
- if (low_prev)
- *low_prev = onigenc_get_prev_char_head(reg->enc,
- (pprev ? pprev : str), *low, end);
- }
- }
- }
- /* no needs to adjust *high, *high is used as range check only */
- *high = p - reg->dmin;
-
-#ifdef ONIG_DEBUG_SEARCH
- fprintf(stderr,
- "forward_search_range success: low: %d, high: %d, dmin: %d, dmax: %d\n",
- (int )(*low - str), (int )(*high - str), reg->dmin, reg->dmax);
-#endif
- return 1; /* success */
- }
-
- return 0; /* fail */
-}
-
-static int set_bm_backward_skip P_((UChar* s, UChar* end, OnigEncoding enc,
- int** skip));
-
-#define BM_BACKWARD_SEARCH_LENGTH_THRESHOLD 100
-
-static long
-backward_search_range(regex_t* reg, const UChar* str, const UChar* end,
- UChar* s, const UChar* range, UChar* adjrange,
- UChar** low, UChar** high)
-{
- int r;
- UChar *p;
-
- range += reg->dmin;
- p = s;
-
- retry:
- switch (reg->optimize) {
- case ONIG_OPTIMIZE_EXACT:
- exact_method:
- p = slow_search_backward(reg->enc, reg->exact, reg->exact_end,
- range, adjrange, end, p);
- break;
-
- case ONIG_OPTIMIZE_EXACT_IC:
- p = slow_search_backward_ic(reg->enc, reg->case_fold_flag,
- reg->exact, reg->exact_end,
- range, adjrange, end, p);
- break;
-
- case ONIG_OPTIMIZE_EXACT_BM:
- case ONIG_OPTIMIZE_EXACT_BM_NOT_REV:
- if (IS_NULL(reg->int_map_backward)) {
- if (s - range < BM_BACKWARD_SEARCH_LENGTH_THRESHOLD)
- goto exact_method;
-
- r = set_bm_backward_skip(reg->exact, reg->exact_end, reg->enc,
- &(reg->int_map_backward));
- if (r) return r;
- }
- p = bm_search_backward(reg, reg->exact, reg->exact_end, range, adjrange,
- end, p);
- break;
-
- case ONIG_OPTIMIZE_MAP:
- p = map_search_backward(reg->enc, reg->map, range, adjrange, p, end);
- break;
- }
-
- if (p) {
- if (reg->sub_anchor) {
- UChar* prev;
-
- switch (reg->sub_anchor) {
- case ANCHOR_BEGIN_LINE:
- if (!ON_STR_BEGIN(p)) {
- prev = onigenc_get_prev_char_head(reg->enc, str, p, end);
- if (!ONIGENC_IS_MBC_NEWLINE(reg->enc, prev, end)) {
- p = prev;
- goto retry;
- }
- }
- break;
-
- case ANCHOR_END_LINE:
- if (ON_STR_END(p)) {
-#ifndef USE_NEWLINE_AT_END_OF_STRING_HAS_EMPTY_LINE
- prev = onigenc_get_prev_char_head(reg->enc, adjrange, p);
- if (IS_NULL(prev)) goto fail;
- if (ONIGENC_IS_MBC_NEWLINE(reg->enc, prev, end)) {
- p = prev;
- goto retry;
- }
-#endif
- }
- else if (! ONIGENC_IS_MBC_NEWLINE(reg->enc, p, end)
-#ifdef USE_CRNL_AS_LINE_TERMINATOR
- && ! ONIGENC_IS_MBC_CRNL(reg->enc, p, end)
-#endif
- ) {
- p = onigenc_get_prev_char_head(reg->enc, adjrange, p, end);
- if (IS_NULL(p)) goto fail;
- goto retry;
- }
- break;
- }
- }
-
- /* no needs to adjust *high, *high is used as range check only */
- if (reg->dmax != ONIG_INFINITE_DISTANCE) {
- *low = p - reg->dmax;
- *high = p - reg->dmin;
- *high = onigenc_get_right_adjust_char_head(reg->enc, adjrange, *high, end);
- }
-
-#ifdef ONIG_DEBUG_SEARCH
- fprintf(stderr, "backward_search_range: low: %d, high: %d\n",
- (int )(*low - str), (int )(*high - str));
-#endif
- return 1; /* success */
- }
-
- fail:
-#ifdef ONIG_DEBUG_SEARCH
- fprintf(stderr, "backward_search_range: fail.\n");
-#endif
- return 0; /* fail */
-}
-
-
-extern long
-onig_search(regex_t* reg, const UChar* str, const UChar* end,
- const UChar* start, const UChar* range, OnigRegion* region, OnigOptionType option)
-{
- int r;
- UChar *s, *prev;
- OnigMatchArg msa;
- const UChar *orig_start = start;
-#ifdef USE_MATCH_RANGE_MUST_BE_INSIDE_OF_SPECIFIED_RANGE
- const UChar *orig_range = range;
-#endif
-
-#if defined(USE_RECOMPILE_API) && defined(USE_MULTI_THREAD_SYSTEM)
- start:
- THREAD_ATOMIC_START;
- if (ONIG_STATE(reg) >= ONIG_STATE_NORMAL) {
- ONIG_STATE_INC(reg);
- if (IS_NOT_NULL(reg->chain) && ONIG_STATE(reg) == ONIG_STATE_NORMAL) {
- onig_chain_reduce(reg);
- ONIG_STATE_INC(reg);
- }
- }
- else {
- int n;
-
- THREAD_ATOMIC_END;
- n = 0;
- while (ONIG_STATE(reg) < ONIG_STATE_NORMAL) {
- if (++n > THREAD_PASS_LIMIT_COUNT)
- return ONIGERR_OVER_THREAD_PASS_LIMIT_COUNT;
- THREAD_PASS;
- }
- goto start;
- }
- THREAD_ATOMIC_END;
-#endif /* USE_RECOMPILE_API && USE_MULTI_THREAD_SYSTEM */
-
-#ifdef ONIG_DEBUG_SEARCH
- fprintf(stderr,
- "onig_search (entry point): str: %d, end: %d, start: %d, range: %d\n",
- (int )str, (int )(end - str), (int )(start - str), (int )(range - str));
-#endif
-
- if (region
-#ifdef USE_POSIX_API_REGION_OPTION
- && !IS_POSIX_REGION(option)
-#endif
- ) {
- r = onig_region_resize_clear(region, reg->num_mem + 1);
- if (r) goto finish_no_msa;
- }
-
- if (start > end || start < str) goto mismatch_no_msa;
-
-
-#ifdef USE_MATCH_RANGE_MUST_BE_INSIDE_OF_SPECIFIED_RANGE
-#ifdef USE_FIND_LONGEST_SEARCH_ALL_OF_RANGE
-#define MATCH_AND_RETURN_CHECK(upper_range) \
- r = match_at(reg, str, end, (upper_range), s, prev, &msa); \
- if (r != ONIG_MISMATCH) {\
- if (r >= 0) {\
- if (! IS_FIND_LONGEST(reg->options)) {\
- goto match;\
- }\
- }\
- else goto finish; /* error */ \
- }
-#else
-#define MATCH_AND_RETURN_CHECK(upper_range) \
- r = match_at(reg, str, end, (upper_range), s, prev, &msa); \
- if (r != ONIG_MISMATCH) {\
- if (r >= 0) {\
- goto match;\
- }\
- else goto finish; /* error */ \
- }
-#endif /* USE_FIND_LONGEST_SEARCH_ALL_OF_RANGE */
-#else
-#ifdef USE_FIND_LONGEST_SEARCH_ALL_OF_RANGE
-#define MATCH_AND_RETURN_CHECK(none) \
- r = match_at(reg, str, end, s, prev, &msa);\
- if (r != ONIG_MISMATCH) {\
- if (r >= 0) {\
- if (! IS_FIND_LONGEST(reg->options)) {\
- goto match;\
- }\
- }\
- else goto finish; /* error */ \
- }
-#else
-#define MATCH_AND_RETURN_CHECK(none) \
- r = match_at(reg, str, end, s, prev, &msa);\
- if (r != ONIG_MISMATCH) {\
- if (r >= 0) {\
- goto match;\
- }\
- else goto finish; /* error */ \
- }
-#endif /* USE_FIND_LONGEST_SEARCH_ALL_OF_RANGE */
-#endif /* USE_MATCH_RANGE_MUST_BE_INSIDE_OF_SPECIFIED_RANGE */
-
-
- /* anchor optimize: resume search range */
- if (reg->anchor != 0 && str < end) {
- UChar *min_semi_end, *max_semi_end;
-
- if (reg->anchor & ANCHOR_BEGIN_POSITION) {
- /* search start-position only */
- begin_position:
- if (range > start)
- range = start + 1;
- else
- range = start;
- }
- else if (reg->anchor & ANCHOR_BEGIN_BUF) {
- /* search str-position only */
- if (range > start) {
- if (start != str) goto mismatch_no_msa;
- range = str + 1;
- }
- else {
- if (range <= str) {
- start = str;
- range = str;
- }
- else
- goto mismatch_no_msa;
- }
- }
- else if (reg->anchor & ANCHOR_END_BUF) {
- min_semi_end = max_semi_end = (UChar* )end;
-
- end_buf:
- if ((OnigDistance )(max_semi_end - str) < reg->anchor_dmin)
- goto mismatch_no_msa;
-
- if (range > start) {
- if ((OnigDistance )(min_semi_end - start) > reg->anchor_dmax) {
- start = min_semi_end - reg->anchor_dmax;
- if (start < end)
- start = onigenc_get_right_adjust_char_head(reg->enc, str, start, end);
- else { /* match with empty at end */
- start = onigenc_get_prev_char_head(reg->enc, str, end, end);
- }
- }
- if ((OnigDistance )(max_semi_end - (range - 1)) < reg->anchor_dmin) {
- range = max_semi_end - reg->anchor_dmin + 1;
- }
-
- if (start >= range) goto mismatch_no_msa;
- }
- else {
- if ((OnigDistance )(min_semi_end - range) > reg->anchor_dmax) {
- range = min_semi_end - reg->anchor_dmax;
- }
- if ((OnigDistance )(max_semi_end - start) < reg->anchor_dmin) {
- start = max_semi_end - reg->anchor_dmin;
- start = ONIGENC_LEFT_ADJUST_CHAR_HEAD(reg->enc, str, start, end);
- }
- if (range > start) goto mismatch_no_msa;
- }
- }
- else if (reg->anchor & ANCHOR_SEMI_END_BUF) {
- UChar* pre_end = ONIGENC_STEP_BACK(reg->enc, str, end, end, 1);
-
- max_semi_end = (UChar* )end;
- if (ONIGENC_IS_MBC_NEWLINE(reg->enc, pre_end, end)) {
- min_semi_end = pre_end;
-
-#ifdef USE_CRNL_AS_LINE_TERMINATOR
- pre_end = ONIGENC_STEP_BACK(reg->enc, str, pre_end, end, 1);
- if (IS_NOT_NULL(pre_end) &&
- ONIGENC_IS_MBC_CRNL(reg->enc, pre_end, end)) {
- min_semi_end = pre_end;
- }
-#endif
- if (min_semi_end > str && start <= min_semi_end) {
- goto end_buf;
- }
- }
- else {
- min_semi_end = (UChar* )end;
- goto end_buf;
- }
- }
- else if ((reg->anchor & ANCHOR_ANYCHAR_STAR_ML)) {
- goto begin_position;
- }
- }
- else if (str == end) { /* empty string */
- static const UChar address_for_empty_string[] = "";
-
-#ifdef ONIG_DEBUG_SEARCH
- fprintf(stderr, "onig_search: empty string.\n");
-#endif
-
- if (reg->threshold_len == 0) {
- start = end = str = address_for_empty_string;
- s = (UChar* )start;
- prev = (UChar* )NULL;
-
- MATCH_ARG_INIT(msa, option, region, start);
-#ifdef USE_COMBINATION_EXPLOSION_CHECK
- msa.state_check_buff = (void* )0;
- msa.state_check_buff_size = 0; /* NO NEED, for valgrind */
-#endif
- MATCH_AND_RETURN_CHECK(end);
- goto mismatch;
- }
- goto mismatch_no_msa;
- }
-
-#ifdef ONIG_DEBUG_SEARCH
- fprintf(stderr, "onig_search(apply anchor): end: %d, start: %d, range: %d\n",
- (int )(end - str), (int )(start - str), (int )(range - str));
-#endif
-
- MATCH_ARG_INIT(msa, option, region, orig_start);
-#ifdef USE_COMBINATION_EXPLOSION_CHECK
- {
- int offset = (MIN(start, range) - str);
- STATE_CHECK_BUFF_INIT(msa, end - str, offset, reg->num_comb_exp_check);
- }
-#endif
-
- s = (UChar* )start;
- if (range > start) { /* forward search */
- if (s > str)
- prev = onigenc_get_prev_char_head(reg->enc, str, s, end);
- else
- prev = (UChar* )NULL;
-
- if (reg->optimize != ONIG_OPTIMIZE_NONE) {
- UChar *sch_range, *low, *high, *low_prev;
-
- sch_range = (UChar* )range;
- if (reg->dmax != 0) {
- if (reg->dmax == ONIG_INFINITE_DISTANCE)
- sch_range = (UChar* )end;
- else {
- sch_range += reg->dmax;
- if (sch_range > end) sch_range = (UChar* )end;
- }
- }
-
- if ((end - start) < reg->threshold_len)
- goto mismatch;
-
- if (reg->dmax != ONIG_INFINITE_DISTANCE) {
- do {
- if (! forward_search_range(reg, str, end, s, sch_range,
- &low, &high, &low_prev)) goto mismatch;
- if (s < low) {
- s = low;
- prev = low_prev;
- }
- while (s <= high) {
- MATCH_AND_RETURN_CHECK(orig_range);
- prev = s;
- s += enclen(reg->enc, s, end);
- }
- } while (s < range);
- goto mismatch;
- }
- else { /* check only. */
- if (! forward_search_range(reg, str, end, s, sch_range,
- &low, &high, (UChar** )NULL)) goto mismatch;
-
- if ((reg->anchor & ANCHOR_ANYCHAR_STAR) != 0) {
- do {
- MATCH_AND_RETURN_CHECK(orig_range);
- prev = s;
- s += enclen(reg->enc, s, end);
-
- while (!ONIGENC_IS_MBC_NEWLINE(reg->enc, prev, end) && s < range) {
- prev = s;
- s += enclen(reg->enc, s, end);
- }
- } while (s < range);
- goto mismatch;
- }
- }
- }
-
- do {
- MATCH_AND_RETURN_CHECK(orig_range);
- prev = s;
- s += enclen(reg->enc, s, end);
- } while (s < range);
-
- if (s == range) { /* because empty match with /$/. */
- MATCH_AND_RETURN_CHECK(orig_range);
- }
- }
- else { /* backward search */
-#ifdef USE_MATCH_RANGE_MUST_BE_INSIDE_OF_SPECIFIED_RANGE
- if (orig_start < end)
- orig_start += enclen(reg->enc, orig_start, end); /* is upper range */
-#endif
-
- if (reg->optimize != ONIG_OPTIMIZE_NONE) {
- UChar *low, *high, *adjrange, *sch_start;
-
- if (range < end)
- adjrange = ONIGENC_LEFT_ADJUST_CHAR_HEAD(reg->enc, str, range, end);
- else
- adjrange = (UChar* )end;
-
- if (reg->dmax != ONIG_INFINITE_DISTANCE &&
- (end - range) >= reg->threshold_len) {
- do {
- sch_start = s + reg->dmax;
- if (sch_start > end) sch_start = (UChar* )end;
- if (backward_search_range(reg, str, end, sch_start, range, adjrange,
- &low, &high) <= 0)
- goto mismatch;
-
- if (s > high)
- s = high;
-
- while (s >= low) {
- prev = onigenc_get_prev_char_head(reg->enc, str, s, end);
- MATCH_AND_RETURN_CHECK(orig_start);
- s = prev;
- }
- } while (s >= range);
- goto mismatch;
- }
- else { /* check only. */
- if ((end - range) < reg->threshold_len) goto mismatch;
-
- sch_start = s;
- if (reg->dmax != 0) {
- if (reg->dmax == ONIG_INFINITE_DISTANCE)
- sch_start = (UChar* )end;
- else {
- sch_start += reg->dmax;
- if (sch_start > end) sch_start = (UChar* )end;
- else
- sch_start = ONIGENC_LEFT_ADJUST_CHAR_HEAD(reg->enc,
- start, sch_start, end);
- }
- }
- if (backward_search_range(reg, str, end, sch_start, range, adjrange,
- &low, &high) <= 0) goto mismatch;
- }
- }
-
- do {
- prev = onigenc_get_prev_char_head(reg->enc, str, s, end);
- MATCH_AND_RETURN_CHECK(orig_start);
- s = prev;
- } while (s >= range);
- }
-
- mismatch:
-#ifdef USE_FIND_LONGEST_SEARCH_ALL_OF_RANGE
- if (IS_FIND_LONGEST(reg->options)) {
- if (msa.best_len >= 0) {
- s = msa.best_s;
- goto match;
- }
- }
-#endif
- r = ONIG_MISMATCH;
-
- finish:
- MATCH_ARG_FREE(msa);
- ONIG_STATE_DEC_THREAD(reg);
-
- /* If result is mismatch and no FIND_NOT_EMPTY option,
- then the region is not setted in match_at(). */
- if (IS_FIND_NOT_EMPTY(reg->options) && region
-#ifdef USE_POSIX_API_REGION_OPTION
- && !IS_POSIX_REGION(option)
-#endif
- ) {
- onig_region_clear(region);
- }
-
-#ifdef ONIG_DEBUG
- if (r != ONIG_MISMATCH)
- fprintf(stderr, "onig_search: error %d\n", r);
-#endif
- return r;
-
- mismatch_no_msa:
- r = ONIG_MISMATCH;
- finish_no_msa:
- ONIG_STATE_DEC_THREAD(reg);
-#ifdef ONIG_DEBUG
- if (r != ONIG_MISMATCH)
- fprintf(stderr, "onig_search: error %d\n", r);
-#endif
- return r;
-
- match:
- ONIG_STATE_DEC_THREAD(reg);
- MATCH_ARG_FREE(msa);
- return s - str;
-}
-
-extern OnigEncoding
-onig_get_encoding(regex_t* reg)
-{
- return reg->enc;
-}
-
-extern OnigOptionType
-onig_get_options(regex_t* reg)
-{
- return reg->options;
-}
-
-extern OnigCaseFoldType
-onig_get_case_fold_flag(regex_t* reg)
-{
- return reg->case_fold_flag;
-}
-
-extern const OnigSyntaxType*
-onig_get_syntax(regex_t* reg)
-{
- return reg->syntax;
-}
-
-extern int
-onig_number_of_captures(regex_t* reg)
-{
- return reg->num_mem;
-}
-
-extern int
-onig_number_of_capture_histories(regex_t* reg)
-{
-#ifdef USE_CAPTURE_HISTORY
- int i, n;
-
- n = 0;
- for (i = 0; i <= ONIG_MAX_CAPTURE_HISTORY_GROUP; i++) {
- if (BIT_STATUS_AT(reg->capture_history, i) != 0)
- n++;
- }
- return n;
-#else
- return 0;
-#endif
-}
-
-extern void
-onig_copy_encoding(OnigEncoding to, OnigEncoding from)
-{
- *to = *from;
-}
-
diff --git a/regint.h b/regint.h
deleted file mode 100644
index db698de5d2..0000000000
--- a/regint.h
+++ /dev/null
@@ -1,842 +0,0 @@
-#ifndef ONIGURUMA_REGINT_H
-#define ONIGURUMA_REGINT_H
-/**********************************************************************
- regint.h - 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.
- */
-
-/* for debug */
-/* #define ONIG_DEBUG_PARSE_TREE */
-/* #define ONIG_DEBUG_COMPILE */
-/* #define ONIG_DEBUG_SEARCH */
-/* #define ONIG_DEBUG_MATCH */
-/* #define ONIG_DONT_OPTIMIZE */
-
-/* for byte-code statistical data. */
-/* #define ONIG_DEBUG_STATISTICS */
-
-#if defined(ONIG_DEBUG_PARSE_TREE) || defined(ONIG_DEBUG_MATCH) || \
- defined(ONIG_DEBUG_SEARCH) || defined(ONIG_DEBUG_COMPILE) || \
- defined(ONIG_DEBUG_STATISTICS)
-#ifndef ONIG_DEBUG
-#define ONIG_DEBUG
-#endif
-#endif
-
-#if defined(__i386) || defined(__i386__) || defined(_M_IX86) || \
- (defined(__ppc__) && defined(__APPLE__)) || \
- defined(__x86_64) || defined(__x86_64__) || defined(_M_AMD86) || \
- defined(__mc68020__)
-#define PLATFORM_UNALIGNED_WORD_ACCESS
-#endif
-
-/* config */
-/* spec. config */
-#define USE_NAMED_GROUP
-#define USE_SUBEXP_CALL
-#define USE_BACKREF_WITH_LEVEL /* \k<name+n>, \k<name-n> */
-#define USE_MONOMANIAC_CHECK_CAPTURES_IN_ENDLESS_REPEAT /* /(?:()|())*\2/ */
-#define USE_NEWLINE_AT_END_OF_STRING_HAS_EMPTY_LINE /* /\n$/ =~ "\n" */
-#define USE_WARNING_REDUNDANT_NESTED_REPEAT_OPERATOR
-/* #define USE_RECOMPILE_API */
-/* !!! moved to regenc.h. */ /* #define USE_CRNL_AS_LINE_TERMINATOR */
-
-/* internal config */
-#define USE_PARSE_TREE_NODE_RECYCLE
-#define USE_OP_PUSH_OR_JUMP_EXACT
-#define USE_QTFR_PEEK_NEXT
-#define USE_ST_LIBRARY
-#define USE_SHARED_CCLASS_TABLE
-
-#define INIT_MATCH_STACK_SIZE 160
-#define DEFAULT_MATCH_STACK_LIMIT_SIZE 0 /* unlimited */
-
-#if defined(__GNUC__)
-# define ARG_UNUSED __attribute__ ((unused))
-#else
-# define ARG_UNUSED
-#endif
-
-/* */
-/* escape other system UChar definition */
-#ifndef RUBY_DEFINES_H
-#include "ruby/ruby.h"
-#undef xmalloc
-#undef xrealloc
-#undef xcalloc
-#undef xfree
-#endif
-#ifdef ONIG_ESCAPE_UCHAR_COLLISION
-#undef ONIG_ESCAPE_UCHAR_COLLISION
-#endif
-#undef USE_MATCH_RANGE_IS_COMPLETE_RANGE
-#undef USE_CAPTURE_HISTORY
-#define USE_VARIABLE_META_CHARS
-#define USE_WORD_BEGIN_END /* "\<": word-begin, "\>": word-end */
-#define USE_POSIX_REGION_OPTION /* needed for POSIX API support */
-#define USE_FIND_LONGEST_SEARCH_ALL_OF_RANGE
-/* #define USE_COMBINATION_EXPLOSION_CHECK */ /* (X*)* */
-/* #define USE_MULTI_THREAD_SYSTEM */
-#define THREAD_SYSTEM_INIT /* depend on thread system */
-#define THREAD_SYSTEM_END /* depend on thread system */
-#define THREAD_ATOMIC_START /* depend on thread system */
-#define THREAD_ATOMIC_END /* depend on thread system */
-#define THREAD_PASS /* depend on thread system */
-#ifndef xmalloc
-#define xmalloc malloc
-#define xrealloc realloc
-#define xcalloc calloc
-#define xfree free
-#endif
-
-#ifdef RUBY
-
-#define CHECK_INTERRUPT_IN_MATCH_AT rb_thread_check_ints()
-#define onig_st_init_table st_init_table
-#define onig_st_init_table_with_size st_init_table_with_size
-#define onig_st_init_numtable st_init_numtable
-#define onig_st_init_numtable_with_size st_init_numtable_with_size
-#define onig_st_init_strtable st_init_strtable
-#define onig_st_init_strtable_with_size st_init_strtable_with_size
-#define onig_st_delete st_delete
-#define onig_st_delete_safe st_delete_safe
-#define onig_st_insert st_insert
-#define onig_st_lookup st_lookup
-#define onig_st_foreach st_foreach
-#define onig_st_add_direct st_add_direct
-#define onig_st_free_table st_free_table
-#define onig_st_cleanup_safe st_cleanup_safe
-#define onig_st_copy st_copy
-#define onig_st_nothing_key_clone st_nothing_key_clone
-#define onig_st_nothing_key_free st_nothing_key_free
-#define onig_st_is_member st_is_member
-
-#define USE_UPPER_CASE_TABLE
-#else
-
-#define st_init_table onig_st_init_table
-#define st_init_table_with_size onig_st_init_table_with_size
-#define st_init_numtable onig_st_init_numtable
-#define st_init_numtable_with_size onig_st_init_numtable_with_size
-#define st_init_strtable onig_st_init_strtable
-#define st_init_strtable_with_size onig_st_init_strtable_with_size
-#define st_delete onig_st_delete
-#define st_delete_safe onig_st_delete_safe
-#define st_insert onig_st_insert
-#define st_lookup onig_st_lookup
-#define st_foreach onig_st_foreach
-#define st_add_direct onig_st_add_direct
-#define st_free_table onig_st_free_table
-#define st_cleanup_safe onig_st_cleanup_safe
-#define st_copy onig_st_copy
-#define st_nothing_key_clone onig_st_nothing_key_clone
-#define st_nothing_key_free onig_st_nothing_key_free
-/* */
-#define onig_st_is_member st_is_member
-
-#define CHECK_INTERRUPT_IN_MATCH_AT
-
-#endif
-
-#define STATE_CHECK_STRING_THRESHOLD_LEN 7
-#define STATE_CHECK_BUFF_MAX_SIZE 0x4000
-
-#define THREAD_PASS_LIMIT_COUNT 8
-#define xmemset memset
-#define xmemcpy memcpy
-#define xmemmove memmove
-
-#if defined(_WIN32) && !defined(__GNUC__)
-#define xalloca _alloca
-#define xvsnprintf _vsnprintf
-#else
-#define xalloca alloca
-#define xvsnprintf vsnprintf
-#endif
-
-
-#if defined(USE_RECOMPILE_API) && defined(USE_MULTI_THREAD_SYSTEM)
-#define ONIG_STATE_INC(reg) (reg)->state++
-#define ONIG_STATE_DEC(reg) (reg)->state--
-
-#define ONIG_STATE_INC_THREAD(reg) do {\
- THREAD_ATOMIC_START;\
- (reg)->state++;\
- THREAD_ATOMIC_END;\
-} while(0)
-#define ONIG_STATE_DEC_THREAD(reg) do {\
- THREAD_ATOMIC_START;\
- (reg)->state--;\
- THREAD_ATOMIC_END;\
-} while(0)
-#else
-#define ONIG_STATE_INC(reg) /* Nothing */
-#define ONIG_STATE_DEC(reg) /* Nothing */
-#define ONIG_STATE_INC_THREAD(reg) /* Nothing */
-#define ONIG_STATE_DEC_THREAD(reg) /* Nothing */
-#endif /* USE_RECOMPILE_API && USE_MULTI_THREAD_SYSTEM */
-
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-
-#if defined(HAVE_ALLOCA_H) && (defined(_AIX) || !defined(__GNUC__))
-#include <alloca.h>
-#endif
-
-#ifdef HAVE_STRING_H
-# include <string.h>
-#else
-# include <strings.h>
-#endif
-
-#include <ctype.h>
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-
-#ifdef ONIG_DEBUG
-# include <stdio.h>
-#endif
-
-#include "regenc.h"
-
-#ifdef MIN
-#undef MIN
-#endif
-#ifdef MAX
-#undef MAX
-#endif
-#define MIN(a,b) (((a)>(b))?(b):(a))
-#define MAX(a,b) (((a)<(b))?(b):(a))
-
-#define IS_NULL(p) (((void*)(p)) == (void*)0)
-#define IS_NOT_NULL(p) (((void*)(p)) != (void*)0)
-#define CHECK_NULL_RETURN(p) if (IS_NULL(p)) return NULL
-#define CHECK_NULL_RETURN_MEMERR(p) if (IS_NULL(p)) return ONIGERR_MEMORY
-#define NULL_UCHARP ((UChar* )0)
-
-#ifdef PLATFORM_UNALIGNED_WORD_ACCESS
-
-#define PLATFORM_GET_INC(val,p,type) do{\
- val = *(type* )p;\
- (p) += sizeof(type);\
-} while(0)
-
-#else
-
-#define PLATFORM_GET_INC(val,p,type) do{\
- xmemcpy(&val, (p), sizeof(type));\
- (p) += sizeof(type);\
-} while(0)
-
-/* sizeof(OnigCodePoint) */
-#define WORD_ALIGNMENT_SIZE SIZEOF_LONG
-
-#define GET_ALIGNMENT_PAD_SIZE(addr,pad_size) do {\
- (pad_size) = WORD_ALIGNMENT_SIZE \
- - ((uintptr_t )(addr) % WORD_ALIGNMENT_SIZE);\
- if ((pad_size) == WORD_ALIGNMENT_SIZE) (pad_size) = 0;\
-} while (0)
-
-#define ALIGNMENT_RIGHT(addr) do {\
- (addr) += (WORD_ALIGNMENT_SIZE - 1);\
- (addr) -= ((uintptr_t )(addr) % WORD_ALIGNMENT_SIZE);\
-} while (0)
-
-#endif /* PLATFORM_UNALIGNED_WORD_ACCESS */
-
-/* stack pop level */
-#define STACK_POP_LEVEL_FREE 0
-#define STACK_POP_LEVEL_MEM_START 1
-#define STACK_POP_LEVEL_ALL 2
-
-/* optimize flags */
-#define ONIG_OPTIMIZE_NONE 0
-#define ONIG_OPTIMIZE_EXACT 1 /* Slow Search */
-#define ONIG_OPTIMIZE_EXACT_BM 2 /* Boyer Moore Search */
-#define ONIG_OPTIMIZE_EXACT_BM_NOT_REV 3 /* BM (but not simple match) */
-#define ONIG_OPTIMIZE_EXACT_IC 4 /* Slow Search (ignore case) */
-#define ONIG_OPTIMIZE_MAP 5 /* char map */
-
-/* bit status */
-typedef unsigned int BitStatusType;
-
-#define BIT_STATUS_BITS_NUM (sizeof(BitStatusType) * 8)
-#define BIT_STATUS_CLEAR(stats) (stats) = 0
-#define BIT_STATUS_ON_ALL(stats) (stats) = ~((BitStatusType )0)
-#define BIT_STATUS_AT(stats,n) \
- ((n) < (int )BIT_STATUS_BITS_NUM ? ((stats) & (1 << n)) : ((stats) & 1))
-
-#define BIT_STATUS_ON_AT(stats,n) do {\
- if ((n) < (int )BIT_STATUS_BITS_NUM) \
- (stats) |= (1 << (n));\
- else\
- (stats) |= 1;\
-} while (0)
-
-#define BIT_STATUS_ON_AT_SIMPLE(stats,n) do {\
- if ((n) < (int )BIT_STATUS_BITS_NUM)\
- (stats) |= (1 << (n));\
-} while (0)
-
-
-#define INT_MAX_LIMIT ((1UL << (SIZEOF_INT * 8 - 1)) - 1)
-
-#define DIGITVAL(code) ((code) - '0')
-#define ODIGITVAL(code) DIGITVAL(code)
-#define XDIGITVAL(enc,code) \
- (ONIGENC_IS_CODE_DIGIT(enc,code) ? DIGITVAL(code) \
- : (ONIGENC_IS_CODE_UPPER(enc,code) ? (code) - 'A' + 10 : (code) - 'a' + 10))
-
-#define IS_SINGLELINE(option) ((option) & ONIG_OPTION_SINGLELINE)
-#define IS_MULTILINE(option) ((option) & ONIG_OPTION_MULTILINE)
-#define IS_IGNORECASE(option) ((option) & ONIG_OPTION_IGNORECASE)
-#define IS_EXTEND(option) ((option) & ONIG_OPTION_EXTEND)
-#define IS_FIND_LONGEST(option) ((option) & ONIG_OPTION_FIND_LONGEST)
-#define IS_FIND_NOT_EMPTY(option) ((option) & ONIG_OPTION_FIND_NOT_EMPTY)
-#define IS_FIND_CONDITION(option) ((option) & \
- (ONIG_OPTION_FIND_LONGEST | ONIG_OPTION_FIND_NOT_EMPTY))
-#define IS_NOTBOL(option) ((option) & ONIG_OPTION_NOTBOL)
-#define IS_NOTEOL(option) ((option) & ONIG_OPTION_NOTEOL)
-#define IS_POSIX_REGION(option) ((option) & ONIG_OPTION_POSIX_REGION)
-
-/* OP_SET_OPTION is required for these options.
-#define IS_DYNAMIC_OPTION(option) \
- (((option) & (ONIG_OPTION_MULTILINE | ONIG_OPTION_IGNORECASE)) != 0)
-*/
-/* ignore-case and multibyte status are included in compiled code. */
-#define IS_DYNAMIC_OPTION(option) 0
-
-#define DISABLE_CASE_FOLD_MULTI_CHAR(case_fold_flag) \
- ((case_fold_flag) & ~INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR)
-
-#define REPEAT_INFINITE -1
-#define IS_REPEAT_INFINITE(n) ((n) == REPEAT_INFINITE)
-
-/* bitset */
-#define BITS_PER_BYTE 8
-#define SINGLE_BYTE_SIZE (1 << BITS_PER_BYTE)
-#define BITS_IN_ROOM (sizeof(Bits) * BITS_PER_BYTE)
-#define BITSET_SIZE (SINGLE_BYTE_SIZE / BITS_IN_ROOM)
-
-#ifdef PLATFORM_UNALIGNED_WORD_ACCESS
-typedef unsigned int Bits;
-#else
-typedef unsigned char Bits;
-#endif
-typedef Bits BitSet[BITSET_SIZE];
-typedef Bits* BitSetRef;
-
-#define SIZE_BITSET (int)sizeof(BitSet)
-
-#define BITSET_CLEAR(bs) do {\
- int i;\
- for (i = 0; i < (int )BITSET_SIZE; i++) { (bs)[i] = 0; } \
-} while (0)
-
-#define BS_ROOM(bs,pos) (bs)[pos / BITS_IN_ROOM]
-#define BS_BIT(pos) (1 << (pos % BITS_IN_ROOM))
-
-#define BITSET_AT(bs, pos) (BS_ROOM(bs,pos) & BS_BIT(pos))
-#define BITSET_SET_BIT(bs, pos) BS_ROOM(bs,pos) |= BS_BIT(pos)
-#define BITSET_CLEAR_BIT(bs, pos) BS_ROOM(bs,pos) &= ~(BS_BIT(pos))
-#define BITSET_INVERT_BIT(bs, pos) BS_ROOM(bs,pos) ^= BS_BIT(pos)
-
-/* bytes buffer */
-typedef struct _BBuf {
- UChar* p;
- unsigned int used;
- unsigned int alloc;
-} BBuf;
-
-#define BBUF_INIT(buf,size) onig_bbuf_init((BBuf* )(buf), (size))
-
-#define BBUF_SIZE_INC(buf,inc) do{\
- (buf)->alloc += (inc);\
- (buf)->p = (UChar* )xrealloc((buf)->p, (buf)->alloc);\
- if (IS_NULL((buf)->p)) return(ONIGERR_MEMORY);\
-} while (0)
-
-#define BBUF_EXPAND(buf,low) do{\
- do { (buf)->alloc *= 2; } while ((buf)->alloc < (unsigned int )low);\
- (buf)->p = (UChar* )xrealloc((buf)->p, (buf)->alloc);\
- if (IS_NULL((buf)->p)) return(ONIGERR_MEMORY);\
-} while (0)
-
-#define BBUF_ENSURE_SIZE(buf,size) do{\
- unsigned int new_alloc = (buf)->alloc;\
- while (new_alloc < (unsigned int )(size)) { new_alloc *= 2; }\
- if ((buf)->alloc != new_alloc) {\
- (buf)->p = (UChar* )xrealloc((buf)->p, new_alloc);\
- if (IS_NULL((buf)->p)) return(ONIGERR_MEMORY);\
- (buf)->alloc = new_alloc;\
- }\
-} while (0)
-
-#define BBUF_WRITE(buf,pos,bytes,n) do{\
- int used = (pos) + (n);\
- if ((buf)->alloc < (unsigned int )used) BBUF_EXPAND((buf),used);\
- xmemcpy((buf)->p + (pos), (bytes), (n));\
- if ((buf)->used < (unsigned int )used) (buf)->used = used;\
-} while (0)
-
-#define BBUF_WRITE1(buf,pos,byte) do{\
- int used = (pos) + 1;\
- if ((buf)->alloc < (unsigned int )used) BBUF_EXPAND((buf),used);\
- (buf)->p[(pos)] = (byte);\
- if ((buf)->used < (unsigned int )used) (buf)->used = used;\
-} while (0)
-
-#define BBUF_ADD(buf,bytes,n) BBUF_WRITE((buf),(buf)->used,(bytes),(n))
-#define BBUF_ADD1(buf,byte) BBUF_WRITE1((buf),(buf)->used,(byte))
-#define BBUF_GET_ADD_ADDRESS(buf) ((buf)->p + (buf)->used)
-#define BBUF_GET_OFFSET_POS(buf) ((buf)->used)
-
-/* from < to */
-#define BBUF_MOVE_RIGHT(buf,from,to,n) do {\
- if ((unsigned int )((to)+(n)) > (buf)->alloc) BBUF_EXPAND((buf),(to) + (n));\
- xmemmove((buf)->p + (to), (buf)->p + (from), (n));\
- if ((unsigned int )((to)+(n)) > (buf)->used) (buf)->used = (to) + (n);\
-} while (0)
-
-/* from > to */
-#define BBUF_MOVE_LEFT(buf,from,to,n) do {\
- xmemmove((buf)->p + (to), (buf)->p + (from), (n));\
-} while (0)
-
-/* from > to */
-#define BBUF_MOVE_LEFT_REDUCE(buf,from,to) do {\
- xmemmove((buf)->p + (to), (buf)->p + (from), (buf)->used - (from));\
- (buf)->used -= (from - to);\
-} while (0)
-
-#define BBUF_INSERT(buf,pos,bytes,n) do {\
- if (pos >= (buf)->used) {\
- BBUF_WRITE(buf,pos,bytes,n);\
- }\
- else {\
- BBUF_MOVE_RIGHT((buf),(pos),(pos) + (n),((buf)->used - (pos)));\
- xmemcpy((buf)->p + (pos), (bytes), (n));\
- }\
-} while (0)
-
-#define BBUF_GET_BYTE(buf, pos) (buf)->p[(pos)]
-
-
-#define ANCHOR_BEGIN_BUF (1<<0)
-#define ANCHOR_BEGIN_LINE (1<<1)
-#define ANCHOR_BEGIN_POSITION (1<<2)
-#define ANCHOR_END_BUF (1<<3)
-#define ANCHOR_SEMI_END_BUF (1<<4)
-#define ANCHOR_END_LINE (1<<5)
-
-#define ANCHOR_WORD_BOUND (1<<6)
-#define ANCHOR_NOT_WORD_BOUND (1<<7)
-#define ANCHOR_WORD_BEGIN (1<<8)
-#define ANCHOR_WORD_END (1<<9)
-#define ANCHOR_PREC_READ (1<<10)
-#define ANCHOR_PREC_READ_NOT (1<<11)
-#define ANCHOR_LOOK_BEHIND (1<<12)
-#define ANCHOR_LOOK_BEHIND_NOT (1<<13)
-
-#define ANCHOR_ANYCHAR_STAR (1<<14) /* ".*" optimize info */
-#define ANCHOR_ANYCHAR_STAR_ML (1<<15) /* ".*" optimize info (multi-line) */
-
-/* operation code */
-enum OpCode {
- OP_FINISH = 0, /* matching process terminator (no more alternative) */
- OP_END = 1, /* pattern code terminator (success end) */
-
- OP_EXACT1 = 2, /* single byte, N = 1 */
- OP_EXACT2, /* single byte, N = 2 */
- OP_EXACT3, /* single byte, N = 3 */
- OP_EXACT4, /* single byte, N = 4 */
- OP_EXACT5, /* single byte, N = 5 */
- OP_EXACTN, /* single byte */
- OP_EXACTMB2N1, /* mb-length = 2 N = 1 */
- OP_EXACTMB2N2, /* mb-length = 2 N = 2 */
- OP_EXACTMB2N3, /* mb-length = 2 N = 3 */
- OP_EXACTMB2N, /* mb-length = 2 */
- OP_EXACTMB3N, /* mb-length = 3 */
- OP_EXACTMBN, /* other length */
-
- OP_EXACT1_IC, /* single byte, N = 1, ignore case */
- OP_EXACTN_IC, /* single byte, ignore case */
-
- OP_CCLASS,
- OP_CCLASS_MB,
- OP_CCLASS_MIX,
- OP_CCLASS_NOT,
- OP_CCLASS_MB_NOT,
- OP_CCLASS_MIX_NOT,
- OP_CCLASS_NODE, /* pointer to CClassNode node */
-
- OP_ANYCHAR, /* "." */
- OP_ANYCHAR_ML, /* "." multi-line */
- OP_ANYCHAR_STAR, /* ".*" */
- OP_ANYCHAR_ML_STAR, /* ".*" multi-line */
- OP_ANYCHAR_STAR_PEEK_NEXT,
- OP_ANYCHAR_ML_STAR_PEEK_NEXT,
-
- OP_WORD,
- OP_NOT_WORD,
- OP_WORD_BOUND,
- OP_NOT_WORD_BOUND,
- OP_WORD_BEGIN,
- OP_WORD_END,
-
- OP_BEGIN_BUF,
- OP_END_BUF,
- OP_BEGIN_LINE,
- OP_END_LINE,
- OP_SEMI_END_BUF,
- OP_BEGIN_POSITION,
-
- OP_BACKREF1,
- OP_BACKREF2,
- OP_BACKREFN,
- OP_BACKREFN_IC,
- OP_BACKREF_MULTI,
- OP_BACKREF_MULTI_IC,
- OP_BACKREF_WITH_LEVEL, /* \k<xxx+n>, \k<xxx-n> */
-
- OP_MEMORY_START,
- OP_MEMORY_START_PUSH, /* push back-tracker to stack */
- OP_MEMORY_END_PUSH, /* push back-tracker to stack */
- OP_MEMORY_END_PUSH_REC, /* push back-tracker to stack */
- OP_MEMORY_END,
- OP_MEMORY_END_REC, /* push marker to stack */
-
- OP_FAIL, /* pop stack and move */
- OP_JUMP,
- OP_PUSH,
- OP_POP,
- OP_PUSH_OR_JUMP_EXACT1, /* if match exact then push, else jump. */
- OP_PUSH_IF_PEEK_NEXT, /* if match exact then push, else none. */
- OP_REPEAT, /* {n,m} */
- OP_REPEAT_NG, /* {n,m}? (non greedy) */
- OP_REPEAT_INC,
- OP_REPEAT_INC_NG, /* non greedy */
- OP_REPEAT_INC_SG, /* search and get in stack */
- OP_REPEAT_INC_NG_SG, /* search and get in stack (non greedy) */
- OP_NULL_CHECK_START, /* null loop checker start */
- OP_NULL_CHECK_END, /* null loop checker end */
- OP_NULL_CHECK_END_MEMST, /* null loop checker end (with capture status) */
- OP_NULL_CHECK_END_MEMST_PUSH, /* with capture status and push check-end */
-
- OP_PUSH_POS, /* (?=...) start */
- OP_POP_POS, /* (?=...) end */
- OP_PUSH_POS_NOT, /* (?!...) start */
- OP_FAIL_POS, /* (?!...) end */
- OP_PUSH_STOP_BT, /* (?>...) start */
- OP_POP_STOP_BT, /* (?>...) end */
- OP_LOOK_BEHIND, /* (?<=...) start (no needs end opcode) */
- OP_PUSH_LOOK_BEHIND_NOT, /* (?<!...) start */
- OP_FAIL_LOOK_BEHIND_NOT, /* (?<!...) end */
-
- OP_CALL, /* \g<name> */
- OP_RETURN,
-
- OP_STATE_CHECK_PUSH, /* combination explosion check and push */
- OP_STATE_CHECK_PUSH_OR_JUMP, /* check ok -> push, else jump */
- OP_STATE_CHECK, /* check only */
- OP_STATE_CHECK_ANYCHAR_STAR,
- OP_STATE_CHECK_ANYCHAR_ML_STAR,
-
- /* no need: IS_DYNAMIC_OPTION() == 0 */
- OP_SET_OPTION_PUSH, /* set option and push recover option */
- OP_SET_OPTION /* set option */
-};
-
-typedef int RelAddrType;
-typedef int AbsAddrType;
-typedef int LengthType;
-typedef int RepeatNumType;
-typedef short int MemNumType;
-typedef short int StateCheckNumType;
-typedef void* PointerType;
-
-#define SIZE_OPCODE 1
-#define SIZE_RELADDR (int)sizeof(RelAddrType)
-#define SIZE_ABSADDR (int)sizeof(AbsAddrType)
-#define SIZE_LENGTH (int)sizeof(LengthType)
-#define SIZE_MEMNUM (int)sizeof(MemNumType)
-#define SIZE_STATE_CHECK_NUM (int)sizeof(StateCheckNumType)
-#define SIZE_REPEATNUM (int)sizeof(RepeatNumType)
-#define SIZE_OPTION (int)sizeof(OnigOptionType)
-#define SIZE_CODE_POINT (int)sizeof(OnigCodePoint)
-#define SIZE_POINTER (int)sizeof(PointerType)
-
-
-#define GET_RELADDR_INC(addr,p) PLATFORM_GET_INC(addr, p, RelAddrType)
-#define GET_ABSADDR_INC(addr,p) PLATFORM_GET_INC(addr, p, AbsAddrType)
-#define GET_LENGTH_INC(len,p) PLATFORM_GET_INC(len, p, LengthType)
-#define GET_MEMNUM_INC(num,p) PLATFORM_GET_INC(num, p, MemNumType)
-#define GET_REPEATNUM_INC(num,p) PLATFORM_GET_INC(num, p, RepeatNumType)
-#define GET_OPTION_INC(option,p) PLATFORM_GET_INC(option, p, OnigOptionType)
-#define GET_POINTER_INC(ptr,p) PLATFORM_GET_INC(ptr, p, PointerType)
-#define GET_STATE_CHECK_NUM_INC(num,p) PLATFORM_GET_INC(num, p, StateCheckNumType)
-
-/* code point's address must be aligned address. */
-#define GET_CODE_POINT(code,p) code = *((OnigCodePoint* )(p))
-#define GET_BYTE_INC(byte,p) do{\
- byte = *(p);\
- (p)++;\
-} while(0)
-
-
-/* op-code + arg size */
-#define SIZE_OP_ANYCHAR_STAR SIZE_OPCODE
-#define SIZE_OP_ANYCHAR_STAR_PEEK_NEXT (SIZE_OPCODE + 1)
-#define SIZE_OP_JUMP (SIZE_OPCODE + SIZE_RELADDR)
-#define SIZE_OP_PUSH (SIZE_OPCODE + SIZE_RELADDR)
-#define SIZE_OP_POP SIZE_OPCODE
-#define SIZE_OP_PUSH_OR_JUMP_EXACT1 (SIZE_OPCODE + SIZE_RELADDR + 1)
-#define SIZE_OP_PUSH_IF_PEEK_NEXT (SIZE_OPCODE + SIZE_RELADDR + 1)
-#define SIZE_OP_REPEAT_INC (SIZE_OPCODE + SIZE_MEMNUM)
-#define SIZE_OP_REPEAT_INC_NG (SIZE_OPCODE + SIZE_MEMNUM)
-#define SIZE_OP_PUSH_POS SIZE_OPCODE
-#define SIZE_OP_PUSH_POS_NOT (SIZE_OPCODE + SIZE_RELADDR)
-#define SIZE_OP_POP_POS SIZE_OPCODE
-#define SIZE_OP_FAIL_POS SIZE_OPCODE
-#define SIZE_OP_SET_OPTION (SIZE_OPCODE + SIZE_OPTION)
-#define SIZE_OP_SET_OPTION_PUSH (SIZE_OPCODE + SIZE_OPTION)
-#define SIZE_OP_FAIL SIZE_OPCODE
-#define SIZE_OP_MEMORY_START (SIZE_OPCODE + SIZE_MEMNUM)
-#define SIZE_OP_MEMORY_START_PUSH (SIZE_OPCODE + SIZE_MEMNUM)
-#define SIZE_OP_MEMORY_END_PUSH (SIZE_OPCODE + SIZE_MEMNUM)
-#define SIZE_OP_MEMORY_END_PUSH_REC (SIZE_OPCODE + SIZE_MEMNUM)
-#define SIZE_OP_MEMORY_END (SIZE_OPCODE + SIZE_MEMNUM)
-#define SIZE_OP_MEMORY_END_REC (SIZE_OPCODE + SIZE_MEMNUM)
-#define SIZE_OP_PUSH_STOP_BT SIZE_OPCODE
-#define SIZE_OP_POP_STOP_BT SIZE_OPCODE
-#define SIZE_OP_NULL_CHECK_START (SIZE_OPCODE + SIZE_MEMNUM)
-#define SIZE_OP_NULL_CHECK_END (SIZE_OPCODE + SIZE_MEMNUM)
-#define SIZE_OP_LOOK_BEHIND (SIZE_OPCODE + SIZE_LENGTH)
-#define SIZE_OP_PUSH_LOOK_BEHIND_NOT (SIZE_OPCODE + SIZE_RELADDR + SIZE_LENGTH)
-#define SIZE_OP_FAIL_LOOK_BEHIND_NOT SIZE_OPCODE
-#define SIZE_OP_CALL (SIZE_OPCODE + SIZE_ABSADDR)
-#define SIZE_OP_RETURN SIZE_OPCODE
-
-#ifdef USE_COMBINATION_EXPLOSION_CHECK
-#define SIZE_OP_STATE_CHECK (SIZE_OPCODE + SIZE_STATE_CHECK_NUM)
-#define SIZE_OP_STATE_CHECK_PUSH (SIZE_OPCODE + SIZE_STATE_CHECK_NUM + SIZE_RELADDR)
-#define SIZE_OP_STATE_CHECK_PUSH_OR_JUMP (SIZE_OPCODE + SIZE_STATE_CHECK_NUM + SIZE_RELADDR)
-#define SIZE_OP_STATE_CHECK_ANYCHAR_STAR (SIZE_OPCODE + SIZE_STATE_CHECK_NUM)
-#endif
-
-#define MC_ESC(syn) (syn)->meta_char_table.esc
-#define MC_ANYCHAR(syn) (syn)->meta_char_table.anychar
-#define MC_ANYTIME(syn) (syn)->meta_char_table.anytime
-#define MC_ZERO_OR_ONE_TIME(syn) (syn)->meta_char_table.zero_or_one_time
-#define MC_ONE_OR_MORE_TIME(syn) (syn)->meta_char_table.one_or_more_time
-#define MC_ANYCHAR_ANYTIME(syn) (syn)->meta_char_table.anychar_anytime
-
-#define IS_MC_ESC_CODE(code, syn) \
- ((code) == MC_ESC(syn) && \
- !IS_SYNTAX_OP2((syn), ONIG_SYN_OP2_INEFFECTIVE_ESCAPE))
-
-
-#define SYN_POSIX_COMMON_OP \
- ( ONIG_SYN_OP_DOT_ANYCHAR | ONIG_SYN_OP_POSIX_BRACKET | \
- ONIG_SYN_OP_DECIMAL_BACKREF | \
- ONIG_SYN_OP_BRACKET_CC | ONIG_SYN_OP_ASTERISK_ZERO_INF | \
- ONIG_SYN_OP_LINE_ANCHOR | \
- ONIG_SYN_OP_ESC_CONTROL_CHARS )
-
-#define SYN_GNU_REGEX_OP \
- ( ONIG_SYN_OP_DOT_ANYCHAR | ONIG_SYN_OP_BRACKET_CC | \
- ONIG_SYN_OP_POSIX_BRACKET | ONIG_SYN_OP_DECIMAL_BACKREF | \
- ONIG_SYN_OP_BRACE_INTERVAL | ONIG_SYN_OP_LPAREN_SUBEXP | \
- ONIG_SYN_OP_VBAR_ALT | \
- ONIG_SYN_OP_ASTERISK_ZERO_INF | ONIG_SYN_OP_PLUS_ONE_INF | \
- ONIG_SYN_OP_QMARK_ZERO_ONE | \
- ONIG_SYN_OP_ESC_AZ_BUF_ANCHOR | ONIG_SYN_OP_ESC_CAPITAL_G_BEGIN_ANCHOR | \
- ONIG_SYN_OP_ESC_W_WORD | \
- ONIG_SYN_OP_ESC_B_WORD_BOUND | ONIG_SYN_OP_ESC_LTGT_WORD_BEGIN_END | \
- ONIG_SYN_OP_ESC_S_WHITE_SPACE | ONIG_SYN_OP_ESC_D_DIGIT | \
- ONIG_SYN_OP_LINE_ANCHOR )
-
-#define SYN_GNU_REGEX_BV \
- ( ONIG_SYN_CONTEXT_INDEP_ANCHORS | ONIG_SYN_CONTEXT_INDEP_REPEAT_OPS | \
- ONIG_SYN_CONTEXT_INVALID_REPEAT_OPS | ONIG_SYN_ALLOW_INVALID_INTERVAL | \
- ONIG_SYN_BACKSLASH_ESCAPE_IN_CC | ONIG_SYN_ALLOW_DOUBLE_RANGE_OP_IN_CC )
-
-
-#define NCCLASS_FLAGS(cc) ((cc)->flags)
-#define NCCLASS_FLAG_SET(cc,flag) (NCCLASS_FLAGS(cc) |= (flag))
-#define NCCLASS_FLAG_CLEAR(cc,flag) (NCCLASS_FLAGS(cc) &= ~(flag))
-#define IS_NCCLASS_FLAG_ON(cc,flag) ((NCCLASS_FLAGS(cc) & (flag)) != 0)
-
-/* cclass node */
-#define FLAG_NCCLASS_NOT (1<<0)
-#define FLAG_NCCLASS_SHARE (1<<1)
-
-#define NCCLASS_SET_NOT(nd) NCCLASS_FLAG_SET(nd, FLAG_NCCLASS_NOT)
-#define NCCLASS_SET_SHARE(nd) NCCLASS_FLAG_SET(nd, FLAG_NCCLASS_SHARE)
-#define NCCLASS_CLEAR_NOT(nd) NCCLASS_FLAG_CLEAR(nd, FLAG_NCCLASS_NOT)
-#define IS_NCCLASS_NOT(nd) IS_NCCLASS_FLAG_ON(nd, FLAG_NCCLASS_NOT)
-#define IS_NCCLASS_SHARE(nd) IS_NCCLASS_FLAG_ON(nd, FLAG_NCCLASS_SHARE)
-
-typedef struct {
- int type;
- /* struct _Node* next; */
- /* unsigned int flags; */
-} NodeBase;
-
-typedef struct {
- NodeBase base;
- unsigned int flags;
- BitSet bs;
- BBuf* mbuf; /* multi-byte info or NULL */
-} CClassNode;
-
-typedef long OnigStackIndex;
-
-typedef struct _OnigStackType {
- unsigned int type;
- union {
- struct {
- UChar *pcode; /* byte code position */
- UChar *pstr; /* string position */
- UChar *pstr_prev; /* previous char position of pstr */
-#ifdef USE_COMBINATION_EXPLOSION_CHECK
- unsigned int state_check;
-#endif
- } state;
- struct {
- int count; /* for OP_REPEAT_INC, OP_REPEAT_INC_NG */
- UChar *pcode; /* byte code position (head of repeated target) */
- int num; /* repeat id */
- } repeat;
- struct {
- OnigStackIndex si; /* index of stack */
- } repeat_inc;
- struct {
- int num; /* memory num */
- UChar *pstr; /* start/end position */
- /* Following information is setted, if this stack type is MEM-START */
- OnigStackIndex start; /* prev. info (for backtrack "(...)*" ) */
- OnigStackIndex end; /* prev. info (for backtrack "(...)*" ) */
- } mem;
- struct {
- int num; /* null check id */
- UChar *pstr; /* start position */
- } null_check;
-#ifdef USE_SUBEXP_CALL
- struct {
- UChar *ret_addr; /* byte code position */
- int num; /* null check id */
- UChar *pstr; /* string position */
- } call_frame;
-#endif
- } u;
-} OnigStackType;
-
-typedef struct {
- void* stack_p;
- size_t stack_n;
- OnigOptionType options;
- OnigRegion* region;
- const UChar* start; /* search start position (for \G: BEGIN_POSITION) */
-#ifdef USE_FIND_LONGEST_SEARCH_ALL_OF_RANGE
- int best_len; /* for ONIG_OPTION_FIND_LONGEST */
- UChar* best_s;
-#endif
-#ifdef USE_COMBINATION_EXPLOSION_CHECK
- void* state_check_buff;
- int state_check_buff_size;
-#endif
-} OnigMatchArg;
-
-
-#define IS_CODE_SB_WORD(enc,code) \
- (ONIGENC_IS_CODE_ASCII(code) && ONIGENC_IS_CODE_WORD(enc,code))
-
-#ifdef ONIG_DEBUG
-
-typedef struct {
- short int opcode;
- char* name;
- short int arg_type;
-} OnigOpInfoType;
-
-extern OnigOpInfoType OnigOpInfo[];
-
-extern void onig_print_compiled_byte_code P_((FILE* f, UChar* bp, UChar** nextp, OnigEncoding enc));
-
-#ifdef ONIG_DEBUG_STATISTICS
-extern void onig_statistics_init P_((void));
-extern void onig_print_statistics P_((FILE* f));
-#endif
-#endif
-
-extern UChar* onig_error_code_to_format P_((int code));
-extern void onig_snprintf_with_pattern PV_((UChar buf[], int bufsize, OnigEncoding enc, UChar* pat, UChar* pat_end, const UChar *fmt, ...));
-extern int onig_bbuf_init P_((BBuf* buf, int size));
-extern int onig_alloc_init P_((regex_t** reg, OnigOptionType option, OnigCaseFoldType case_fold_flag, OnigEncoding enc, const OnigSyntaxType* syntax));
-extern int onig_compile P_((regex_t* reg, const UChar* pattern, const UChar* pattern_end, OnigErrorInfo* einfo));
-extern void onig_chain_reduce P_((regex_t* reg));
-extern void onig_chain_link_add P_((regex_t* to, regex_t* add));
-extern void onig_transfer P_((regex_t* to, regex_t* from));
-extern int onig_is_code_in_cc P_((OnigEncoding enc, OnigCodePoint code, CClassNode* cc));
-extern int onig_is_code_in_cc_len P_((int enclen, OnigCodePoint code, CClassNode* cc));
-
-/* strend hash */
-typedef void hash_table_type;
-#ifdef RUBY
-#include "ruby/st.h"
-typedef st_data_t hash_data_type;
-#else
-typedef unsigned long hash_data_type;
-#endif
-
-extern hash_table_type* onig_st_init_strend_table_with_size P_((int size));
-extern int onig_st_lookup_strend P_((hash_table_type* table, const UChar* str_key, const UChar* end_key, hash_data_type *value));
-extern int onig_st_insert_strend P_((hash_table_type* table, const UChar* str_key, const UChar* end_key, hash_data_type value));
-
-/* encoding property management */
-#define PROPERTY_LIST_ADD_PROP(Name, CR) \
- r = onigenc_property_list_add_property((UChar* )Name, CR,\
- &PropertyNameTable, &PropertyList, &PropertyListNum,\
- &PropertyListSize);\
- if (r != 0) goto end
-
-#define PROPERTY_LIST_INIT_CHECK \
- if (PropertyInited == 0) {\
- int r = onigenc_property_list_init(init_property_list);\
- if (r != 0) return r;\
- }
-
-extern int onigenc_property_list_add_property P_((UChar* name, const OnigCodePoint* prop, hash_table_type **table, const OnigCodePoint*** plist, int *pnum, int *psize));
-
-typedef int (*ONIGENC_INIT_PROPERTY_LIST_FUNC_TYPE)(void);
-
-extern int onigenc_property_list_init P_((ONIGENC_INIT_PROPERTY_LIST_FUNC_TYPE));
-
-#endif /* ONIGURUMA_REGINT_H */
diff --git a/regparse.c b/regparse.c
deleted file mode 100644
index 2a8f984372..0000000000
--- a/regparse.c
+++ /dev/null
@@ -1,5552 +0,0 @@
-/**********************************************************************
- regparse.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 "regparse.h"
-
-#define WARN_BUFSIZE 256
-
-#define CASE_FOLD_IS_APPLIED_INSIDE_NEGATIVE_CCLASS
-
-
-const OnigSyntaxType OnigSyntaxRuby = {
- (( SYN_GNU_REGEX_OP | ONIG_SYN_OP_QMARK_NON_GREEDY |
- ONIG_SYN_OP_ESC_OCTAL3 | ONIG_SYN_OP_ESC_X_HEX2 |
- ONIG_SYN_OP_ESC_X_BRACE_HEX8 | ONIG_SYN_OP_ESC_CONTROL_CHARS |
- ONIG_SYN_OP_ESC_C_CONTROL )
- & ~ONIG_SYN_OP_ESC_LTGT_WORD_BEGIN_END )
- , ( ONIG_SYN_OP2_QMARK_GROUP_EFFECT |
- ONIG_SYN_OP2_OPTION_RUBY |
- ONIG_SYN_OP2_QMARK_LT_NAMED_GROUP | ONIG_SYN_OP2_ESC_K_NAMED_BACKREF |
- ONIG_SYN_OP2_ESC_G_SUBEXP_CALL |
- ONIG_SYN_OP2_ESC_P_BRACE_CHAR_PROPERTY |
- ONIG_SYN_OP2_ESC_P_BRACE_CIRCUMFLEX_NOT |
- ONIG_SYN_OP2_PLUS_POSSESSIVE_REPEAT |
- ONIG_SYN_OP2_CCLASS_SET_OP | ONIG_SYN_OP2_ESC_CAPITAL_C_BAR_CONTROL |
- ONIG_SYN_OP2_ESC_CAPITAL_M_BAR_META | ONIG_SYN_OP2_ESC_V_VTAB |
- ONIG_SYN_OP2_ESC_H_XDIGIT )
- , ( SYN_GNU_REGEX_BV |
- ONIG_SYN_ALLOW_INTERVAL_LOW_ABBREV |
- ONIG_SYN_DIFFERENT_LEN_ALT_LOOK_BEHIND |
- ONIG_SYN_CAPTURE_ONLY_NAMED_GROUP |
- ONIG_SYN_ALLOW_MULTIPLEX_DEFINITION_NAME |
- ONIG_SYN_FIXED_INTERVAL_IS_GREEDY_ONLY |
- ONIG_SYN_WARN_CC_OP_NOT_ESCAPED |
- ONIG_SYN_WARN_REDUNDANT_NESTED_REPEAT )
- , ONIG_OPTION_NONE
- ,
- {
- (OnigCodePoint )'\\' /* esc */
- , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anychar '.' */
- , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anytime '*' */
- , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* zero or one time '?' */
- , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* one or more time '+' */
- , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anychar anytime */
- }
-};
-
-const OnigSyntaxType* OnigDefaultSyntax = ONIG_SYNTAX_RUBY;
-
-extern void onig_null_warn(const char* s ARG_UNUSED) { }
-
-#ifdef DEFAULT_WARN_FUNCTION
-static OnigWarnFunc onig_warn = (OnigWarnFunc )DEFAULT_WARN_FUNCTION;
-#else
-static OnigWarnFunc onig_warn = onig_null_warn;
-#endif
-
-#ifdef DEFAULT_VERB_WARN_FUNCTION
-static OnigWarnFunc onig_verb_warn = (OnigWarnFunc )DEFAULT_VERB_WARN_FUNCTION;
-#else
-static OnigWarnFunc onig_verb_warn = onig_null_warn;
-#endif
-
-extern void onig_set_warn_func(OnigWarnFunc f)
-{
- onig_warn = f;
-}
-
-extern void onig_set_verb_warn_func(OnigWarnFunc f)
-{
- onig_verb_warn = f;
-}
-
-static void
-bbuf_free(BBuf* bbuf)
-{
- if (IS_NOT_NULL(bbuf)) {
- if (IS_NOT_NULL(bbuf->p)) xfree(bbuf->p);
- xfree(bbuf);
- }
-}
-
-static int
-bbuf_clone(BBuf** rto, BBuf* from)
-{
- int r;
- BBuf *to;
-
- *rto = to = (BBuf* )xmalloc(sizeof(BBuf));
- CHECK_NULL_RETURN_MEMERR(to);
- r = BBUF_INIT(to, from->alloc);
- if (r != 0) return r;
- to->used = from->used;
- xmemcpy(to->p, from->p, from->used);
- return 0;
-}
-
-#define BACKREF_REL_TO_ABS(rel_no, env) \
- ((env)->num_mem + 1 + (rel_no))
-
-#define ONOFF(v,f,negative) (negative) ? ((v) &= ~(f)) : ((v) |= (f))
-
-#define MBCODE_START_POS(enc) \
- (OnigCodePoint )(ONIGENC_MBC_MINLEN(enc) > 1 ? 0 : 0x80)
-
-#define SET_ALL_MULTI_BYTE_RANGE(enc, pbuf) \
- add_code_range_to_buf(pbuf, MBCODE_START_POS(enc), ~((OnigCodePoint )0))
-
-#define ADD_ALL_MULTI_BYTE_RANGE(enc, mbuf) do {\
- if (! ONIGENC_IS_SINGLEBYTE(enc)) {\
- r = SET_ALL_MULTI_BYTE_RANGE(enc, &(mbuf));\
- if (r) return r;\
- }\
-} while (0)
-
-
-#define BITSET_IS_EMPTY(bs,empty) do {\
- int i;\
- empty = 1;\
- for (i = 0; i < (int )BITSET_SIZE; i++) {\
- if ((bs)[i] != 0) {\
- empty = 0; break;\
- }\
- }\
-} while (0)
-
-static void
-bitset_set_range(BitSetRef bs, int from, int to)
-{
- int i;
- for (i = from; i <= to && i < SINGLE_BYTE_SIZE; i++) {
- BITSET_SET_BIT(bs, i);
- }
-}
-
-#if 0
-static void
-bitset_set_all(BitSetRef bs)
-{
- int i;
- for (i = 0; i < BITSET_SIZE; i++) { bs[i] = ~((Bits )0); }
-}
-#endif
-
-static void
-bitset_invert(BitSetRef bs)
-{
- int i;
- for (i = 0; i < (int )BITSET_SIZE; i++) { bs[i] = ~(bs[i]); }
-}
-
-static void
-bitset_invert_to(BitSetRef from, BitSetRef to)
-{
- int i;
- for (i = 0; i < (int )BITSET_SIZE; i++) { to[i] = ~(from[i]); }
-}
-
-static void
-bitset_and(BitSetRef dest, BitSetRef bs)
-{
- int i;
- for (i = 0; i < (int )BITSET_SIZE; i++) { dest[i] &= bs[i]; }
-}
-
-static void
-bitset_or(BitSetRef dest, BitSetRef bs)
-{
- int i;
- for (i = 0; i < (int )BITSET_SIZE; i++) { dest[i] |= bs[i]; }
-}
-
-static void
-bitset_copy(BitSetRef dest, BitSetRef bs)
-{
- int i;
- for (i = 0; i < (int )BITSET_SIZE; i++) { dest[i] = bs[i]; }
-}
-
-extern int
-onig_strncmp(const UChar* s1, const UChar* s2, int n)
-{
- int x;
-
- while (n-- > 0) {
- x = *s2++ - *s1++;
- if (x) return x;
- }
- return 0;
-}
-
-extern void
-onig_strcpy(UChar* dest, const UChar* src, const UChar* end)
-{
- ptrdiff_t len = end - src;
- if (len > 0) {
- xmemcpy(dest, src, len);
- dest[len] = (UChar )0;
- }
-}
-
-#ifdef USE_NAMED_GROUP
-static UChar*
-strdup_with_null(OnigEncoding enc, UChar* s, UChar* end)
-{
- ptrdiff_t slen;
- int term_len, i;
- UChar *r;
-
- slen = end - s;
- term_len = ONIGENC_MBC_MINLEN(enc);
-
- r = (UChar* )xmalloc(slen + term_len);
- CHECK_NULL_RETURN(r);
- xmemcpy(r, s, slen);
-
- for (i = 0; i < term_len; i++)
- r[slen + i] = (UChar )0;
-
- return r;
-}
-#endif
-
-/* scan pattern methods */
-#define PEND_VALUE 0
-
-#define PFETCH_READY UChar* pfetch_prev
-#define PEND (p < end ? 0 : 1)
-#define PUNFETCH p = pfetch_prev
-#define PINC do { \
- pfetch_prev = p; \
- p += enclen(enc, p, end); \
-} while (0)
-#define PFETCH(c) do { \
- c = ((enc->max_enc_len == 1) ? *p : ONIGENC_MBC_TO_CODE(enc, p, end)); \
- pfetch_prev = p; \
- p += enclen(enc, p, end); \
-} while (0)
-
-#define PPEEK (p < end ? ONIGENC_MBC_TO_CODE(enc, p, end) : PEND_VALUE)
-#define PPEEK_IS(c) (PPEEK == (OnigCodePoint )c)
-
-static UChar*
-strcat_capa(UChar* dest, UChar* dest_end, const UChar* src, const UChar* src_end,
- int capa)
-{
- UChar* r;
-
- if (dest)
- r = (UChar* )xrealloc(dest, capa + 1);
- else
- r = (UChar* )xmalloc(capa + 1);
-
- CHECK_NULL_RETURN(r);
- onig_strcpy(r + (dest_end - dest), src, src_end);
- return r;
-}
-
-/* dest on static area */
-static UChar*
-strcat_capa_from_static(UChar* dest, UChar* dest_end,
- const UChar* src, const UChar* src_end, int capa)
-{
- UChar* r;
-
- r = (UChar* )xmalloc(capa + 1);
- CHECK_NULL_RETURN(r);
- onig_strcpy(r, dest, dest_end);
- onig_strcpy(r + (dest_end - dest), src, src_end);
- return r;
-}
-
-
-#ifdef USE_ST_LIBRARY
-
-#include "ruby/st.h"
-
-typedef struct {
- UChar* s;
- UChar* end;
-} st_str_end_key;
-
-static int
-str_end_cmp(st_str_end_key* x, st_str_end_key* y)
-{
- UChar *p, *q;
- int c;
-
- if ((x->end - x->s) != (y->end - y->s))
- return 1;
-
- p = x->s;
- q = y->s;
- while (p < x->end) {
- c = (int )*p - (int )*q;
- if (c != 0) return c;
-
- p++; q++;
- }
-
- return 0;
-}
-
-static int
-str_end_hash(st_str_end_key* x)
-{
- UChar *p;
- int val = 0;
-
- p = x->s;
- while (p < x->end) {
- val = val * 997 + (int )*p++;
- }
-
- return val + (val >> 5);
-}
-
-extern hash_table_type*
-onig_st_init_strend_table_with_size(int size)
-{
- static const struct st_hash_type hashType = {
- str_end_cmp,
- str_end_hash,
- };
-
- return (hash_table_type* )
- onig_st_init_table_with_size(&hashType, size);
-}
-
-extern int
-onig_st_lookup_strend(hash_table_type* table, const UChar* str_key,
- const UChar* end_key, hash_data_type *value)
-{
- st_str_end_key key;
-
- key.s = (UChar* )str_key;
- key.end = (UChar* )end_key;
-
- return onig_st_lookup(table, (st_data_t )(&key), value);
-}
-
-extern int
-onig_st_insert_strend(hash_table_type* table, const UChar* str_key,
- const UChar* end_key, hash_data_type value)
-{
- st_str_end_key* key;
- int result;
-
- key = (st_str_end_key* )xmalloc(sizeof(st_str_end_key));
- key->s = (UChar* )str_key;
- key->end = (UChar* )end_key;
- result = onig_st_insert(table, (st_data_t )key, value);
- if (result) {
- xfree(key);
- }
- return result;
-}
-
-#endif /* USE_ST_LIBRARY */
-
-
-#ifdef USE_NAMED_GROUP
-
-#define INIT_NAME_BACKREFS_ALLOC_NUM 8
-
-typedef struct {
- UChar* name;
- size_t name_len; /* byte length */
- int back_num; /* number of backrefs */
- int back_alloc;
- int back_ref1;
- int* back_refs;
-} NameEntry;
-
-#ifdef USE_ST_LIBRARY
-
-typedef st_table NameTable;
-typedef st_data_t HashDataType; /* 1.6 st.h doesn't define st_data_t type */
-
-#define NAMEBUF_SIZE 24
-#define NAMEBUF_SIZE_1 25
-
-#ifdef ONIG_DEBUG
-static int
-i_print_name_entry(UChar* key, NameEntry* e, void* arg)
-{
- int i;
- FILE* fp = (FILE* )arg;
-
- fprintf(fp, "%s: ", e->name);
- if (e->back_num == 0)
- fputs("-", fp);
- else if (e->back_num == 1)
- fprintf(fp, "%d", e->back_ref1);
- else {
- for (i = 0; i < e->back_num; i++) {
- if (i > 0) fprintf(fp, ", ");
- fprintf(fp, "%d", e->back_refs[i]);
- }
- }
- fputs("\n", fp);
- return ST_CONTINUE;
-}
-
-extern int
-onig_print_names(FILE* fp, regex_t* reg)
-{
- NameTable* t = (NameTable* )reg->name_table;
-
- if (IS_NOT_NULL(t)) {
- fprintf(fp, "name table\n");
- onig_st_foreach(t, i_print_name_entry, (HashDataType )fp);
- fputs("\n", fp);
- }
- return 0;
-}
-#endif /* ONIG_DEBUG */
-
-static int
-i_free_name_entry(UChar* key, NameEntry* e, void* arg ARG_UNUSED)
-{
- xfree(e->name);
- if (IS_NOT_NULL(e->back_refs)) xfree(e->back_refs);
- xfree(key);
- xfree(e);
- return ST_DELETE;
-}
-
-static int
-names_clear(regex_t* reg)
-{
- NameTable* t = (NameTable* )reg->name_table;
-
- if (IS_NOT_NULL(t)) {
- onig_st_foreach(t, i_free_name_entry, 0);
- }
- return 0;
-}
-
-extern int
-onig_names_free(regex_t* reg)
-{
- int r;
- NameTable* t;
-
- r = names_clear(reg);
- if (r) return r;
-
- t = (NameTable* )reg->name_table;
- if (IS_NOT_NULL(t)) onig_st_free_table(t);
- reg->name_table = (void* )NULL;
- return 0;
-}
-
-static NameEntry*
-name_find(regex_t* reg, const UChar* name, const UChar* name_end)
-{
- NameEntry* e;
- NameTable* t = (NameTable* )reg->name_table;
-
- e = (NameEntry* )NULL;
- if (IS_NOT_NULL(t)) {
- onig_st_lookup_strend(t, name, name_end, (HashDataType* )((void* )(&e)));
- }
- return e;
-}
-
-typedef struct {
- int (*func)(const UChar*, const UChar*,int,int*,regex_t*,void*);
- regex_t* reg;
- void* arg;
- int ret;
- OnigEncoding enc;
-} INamesArg;
-
-static int
-i_names(UChar* key ARG_UNUSED, NameEntry* e, INamesArg* arg)
-{
- int r = (*(arg->func))(e->name,
- e->name + e->name_len,
- e->back_num,
- (e->back_num > 1 ? e->back_refs : &(e->back_ref1)),
- arg->reg, arg->arg);
- if (r != 0) {
- arg->ret = r;
- return ST_STOP;
- }
- return ST_CONTINUE;
-}
-
-extern int
-onig_foreach_name(regex_t* reg,
- int (*func)(const UChar*, const UChar*,int,int*,regex_t*,void*), void* arg)
-{
- INamesArg narg;
- NameTable* t = (NameTable* )reg->name_table;
-
- narg.ret = 0;
- if (IS_NOT_NULL(t)) {
- narg.func = func;
- narg.reg = reg;
- narg.arg = arg;
- narg.enc = reg->enc; /* should be pattern encoding. */
- onig_st_foreach(t, i_names, (HashDataType )&narg);
- }
- return narg.ret;
-}
-
-static int
-i_renumber_name(UChar* key ARG_UNUSED, NameEntry* e, GroupNumRemap* map)
-{
- int i;
-
- if (e->back_num > 1) {
- for (i = 0; i < e->back_num; i++) {
- e->back_refs[i] = map[e->back_refs[i]].new_val;
- }
- }
- else if (e->back_num == 1) {
- e->back_ref1 = map[e->back_ref1].new_val;
- }
-
- return ST_CONTINUE;
-}
-
-extern int
-onig_renumber_name_table(regex_t* reg, GroupNumRemap* map)
-{
- NameTable* t = (NameTable* )reg->name_table;
-
- if (IS_NOT_NULL(t)) {
- onig_st_foreach(t, i_renumber_name, (HashDataType )map);
- }
- return 0;
-}
-
-
-extern int
-onig_number_of_names(regex_t* reg)
-{
- NameTable* t = (NameTable* )reg->name_table;
-
- if (IS_NOT_NULL(t))
- return t->num_entries;
- else
- return 0;
-}
-
-#else /* USE_ST_LIBRARY */
-
-#define INIT_NAMES_ALLOC_NUM 8
-
-typedef struct {
- NameEntry* e;
- int num;
- int alloc;
-} NameTable;
-
-#ifdef ONIG_DEBUG
-extern int
-onig_print_names(FILE* fp, regex_t* reg)
-{
- int i, j;
- NameEntry* e;
- NameTable* t = (NameTable* )reg->name_table;
-
- if (IS_NOT_NULL(t) && t->num > 0) {
- fprintf(fp, "name table\n");
- for (i = 0; i < t->num; i++) {
- e = &(t->e[i]);
- fprintf(fp, "%s: ", e->name);
- if (e->back_num == 0) {
- fputs("-", fp);
- }
- else if (e->back_num == 1) {
- fprintf(fp, "%d", e->back_ref1);
- }
- else {
- for (j = 0; j < e->back_num; j++) {
- if (j > 0) fprintf(fp, ", ");
- fprintf(fp, "%d", e->back_refs[j]);
- }
- }
- fputs("\n", fp);
- }
- fputs("\n", fp);
- }
- return 0;
-}
-#endif
-
-static int
-names_clear(regex_t* reg)
-{
- int i;
- NameEntry* e;
- NameTable* t = (NameTable* )reg->name_table;
-
- if (IS_NOT_NULL(t)) {
- for (i = 0; i < t->num; i++) {
- e = &(t->e[i]);
- if (IS_NOT_NULL(e->name)) {
- xfree(e->name);
- e->name = NULL;
- e->name_len = 0;
- e->back_num = 0;
- e->back_alloc = 0;
- if (IS_NOT_NULL(e->back_refs)) xfree(e->back_refs);
- e->back_refs = (int* )NULL;
- }
- }
- if (IS_NOT_NULL(t->e)) {
- xfree(t->e);
- t->e = NULL;
- }
- t->num = 0;
- }
- return 0;
-}
-
-extern int
-onig_names_free(regex_t* reg)
-{
- int r;
- NameTable* t;
-
- r = names_clear(reg);
- if (r) return r;
-
- t = (NameTable* )reg->name_table;
- if (IS_NOT_NULL(t)) xfree(t);
- reg->name_table = NULL;
- return 0;
-}
-
-static NameEntry*
-name_find(regex_t* reg, UChar* name, UChar* name_end)
-{
- int i, len;
- NameEntry* e;
- NameTable* t = (NameTable* )reg->name_table;
-
- if (IS_NOT_NULL(t)) {
- len = name_end - name;
- for (i = 0; i < t->num; i++) {
- e = &(t->e[i]);
- if (len == e->name_len && onig_strncmp(name, e->name, len) == 0)
- return e;
- }
- }
- return (NameEntry* )NULL;
-}
-
-extern int
-onig_foreach_name(regex_t* reg,
- int (*func)(const UChar*, const UChar*,int,int*,regex_t*,void*), void* arg)
-{
- int i, r;
- NameEntry* e;
- NameTable* t = (NameTable* )reg->name_table;
-
- if (IS_NOT_NULL(t)) {
- for (i = 0; i < t->num; i++) {
- e = &(t->e[i]);
- r = (*func)(e->name, e->name + e->name_len, e->back_num,
- (e->back_num > 1 ? e->back_refs : &(e->back_ref1)),
- reg, arg);
- if (r != 0) return r;
- }
- }
- return 0;
-}
-
-extern int
-onig_number_of_names(regex_t* reg)
-{
- NameTable* t = (NameTable* )reg->name_table;
-
- if (IS_NOT_NULL(t))
- return t->num;
- else
- return 0;
-}
-
-#endif /* else USE_ST_LIBRARY */
-
-static int
-name_add(regex_t* reg, UChar* name, UChar* name_end, int backref, ScanEnv* env)
-{
- int alloc;
- NameEntry* e;
- NameTable* t = (NameTable* )reg->name_table;
-
- if (name_end - name <= 0)
- return ONIGERR_EMPTY_GROUP_NAME;
-
- e = name_find(reg, name, name_end);
- if (IS_NULL(e)) {
-#ifdef USE_ST_LIBRARY
- if (IS_NULL(t)) {
- t = onig_st_init_strend_table_with_size(5);
- reg->name_table = (void* )t;
- }
- e = (NameEntry* )xmalloc(sizeof(NameEntry));
- CHECK_NULL_RETURN_MEMERR(e);
-
- e->name = strdup_with_null(reg->enc, name, name_end);
- if (IS_NULL(e->name)) {
- xfree(e);
- return ONIGERR_MEMORY;
- }
- onig_st_insert_strend(t, e->name, (e->name + (name_end - name)),
- (HashDataType )e);
-
- e->name_len = name_end - name;
- e->back_num = 0;
- e->back_alloc = 0;
- e->back_refs = (int* )NULL;
-
-#else
-
- if (IS_NULL(t)) {
- alloc = INIT_NAMES_ALLOC_NUM;
- t = (NameTable* )xmalloc(sizeof(NameTable));
- CHECK_NULL_RETURN_MEMERR(t);
- t->e = NULL;
- t->alloc = 0;
- t->num = 0;
-
- t->e = (NameEntry* )xmalloc(sizeof(NameEntry) * alloc);
- if (IS_NULL(t->e)) {
- xfree(t);
- return ONIGERR_MEMORY;
- }
- t->alloc = alloc;
- reg->name_table = t;
- goto clear;
- }
- else if (t->num == t->alloc) {
- int i;
-
- alloc = t->alloc * 2;
- t->e = (NameEntry* )xrealloc(t->e, sizeof(NameEntry) * alloc);
- CHECK_NULL_RETURN_MEMERR(t->e);
- t->alloc = alloc;
-
- clear:
- for (i = t->num; i < t->alloc; i++) {
- t->e[i].name = NULL;
- t->e[i].name_len = 0;
- t->e[i].back_num = 0;
- t->e[i].back_alloc = 0;
- t->e[i].back_refs = (int* )NULL;
- }
- }
- e = &(t->e[t->num]);
- t->num++;
- e->name = strdup_with_null(reg->enc, name, name_end);
- e->name_len = name_end - name;
-#endif
- }
-
- if (e->back_num >= 1 &&
- ! IS_SYNTAX_BV(env->syntax, ONIG_SYN_ALLOW_MULTIPLEX_DEFINITION_NAME)) {
- onig_scan_env_set_error_string(env, ONIGERR_MULTIPLEX_DEFINED_NAME,
- name, name_end);
- return ONIGERR_MULTIPLEX_DEFINED_NAME;
- }
-
- e->back_num++;
- if (e->back_num == 1) {
- e->back_ref1 = backref;
- }
- else {
- if (e->back_num == 2) {
- alloc = INIT_NAME_BACKREFS_ALLOC_NUM;
- e->back_refs = (int* )xmalloc(sizeof(int) * alloc);
- CHECK_NULL_RETURN_MEMERR(e->back_refs);
- e->back_alloc = alloc;
- e->back_refs[0] = e->back_ref1;
- e->back_refs[1] = backref;
- }
- else {
- if (e->back_num > e->back_alloc) {
- alloc = e->back_alloc * 2;
- e->back_refs = (int* )xrealloc(e->back_refs, sizeof(int) * alloc);
- CHECK_NULL_RETURN_MEMERR(e->back_refs);
- e->back_alloc = alloc;
- }
- e->back_refs[e->back_num - 1] = backref;
- }
- }
-
- return 0;
-}
-
-extern int
-onig_name_to_group_numbers(regex_t* reg, const UChar* name,
- const UChar* name_end, int** nums)
-{
- NameEntry* e = name_find(reg, name, name_end);
-
- if (IS_NULL(e)) return ONIGERR_UNDEFINED_NAME_REFERENCE;
-
- switch (e->back_num) {
- case 0:
- *nums = 0;
- break;
- case 1:
- *nums = &(e->back_ref1);
- break;
- default:
- *nums = e->back_refs;
- break;
- }
- return e->back_num;
-}
-
-extern int
-onig_name_to_backref_number(regex_t* reg, const UChar* name,
- const UChar* name_end, OnigRegion *region)
-{
- int i, n, *nums;
-
- n = onig_name_to_group_numbers(reg, name, name_end, &nums);
- if (n < 0)
- return n;
- else if (n == 0)
- return ONIGERR_PARSER_BUG;
- else if (n == 1)
- return nums[0];
- else {
- if (IS_NOT_NULL(region)) {
- for (i = n - 1; i >= 0; i--) {
- if (region->beg[nums[i]] != ONIG_REGION_NOTPOS)
- return nums[i];
- }
- }
- return nums[n - 1];
- }
-}
-
-#else /* USE_NAMED_GROUP */
-
-extern int
-onig_name_to_group_numbers(regex_t* reg, const UChar* name,
- const UChar* name_end, int** nums)
-{
- return ONIG_NO_SUPPORT_CONFIG;
-}
-
-extern int
-onig_name_to_backref_number(regex_t* reg, const UChar* name,
- const UChar* name_end, OnigRegion* region)
-{
- return ONIG_NO_SUPPORT_CONFIG;
-}
-
-extern int
-onig_foreach_name(regex_t* reg,
- int (*func)(const UChar*, const UChar*,int,int*,regex_t*,void*), void* arg)
-{
- return ONIG_NO_SUPPORT_CONFIG;
-}
-
-extern int
-onig_number_of_names(regex_t* reg)
-{
- return 0;
-}
-#endif /* else USE_NAMED_GROUP */
-
-extern int
-onig_noname_group_capture_is_active(regex_t* reg)
-{
- if (ONIG_IS_OPTION_ON(reg->options, ONIG_OPTION_DONT_CAPTURE_GROUP))
- return 0;
-
-#ifdef USE_NAMED_GROUP
- if (onig_number_of_names(reg) > 0 &&
- IS_SYNTAX_BV(reg->syntax, ONIG_SYN_CAPTURE_ONLY_NAMED_GROUP) &&
- !ONIG_IS_OPTION_ON(reg->options, ONIG_OPTION_CAPTURE_GROUP)) {
- return 0;
- }
-#endif
-
- return 1;
-}
-
-
-#define INIT_SCANENV_MEMNODES_ALLOC_SIZE 16
-
-static void
-scan_env_clear(ScanEnv* env)
-{
- int i;
-
- BIT_STATUS_CLEAR(env->capture_history);
- BIT_STATUS_CLEAR(env->bt_mem_start);
- BIT_STATUS_CLEAR(env->bt_mem_end);
- BIT_STATUS_CLEAR(env->backrefed_mem);
- env->error = (UChar* )NULL;
- env->error_end = (UChar* )NULL;
- env->num_call = 0;
- env->num_mem = 0;
-#ifdef USE_NAMED_GROUP
- env->num_named = 0;
-#endif
- env->mem_alloc = 0;
- env->mem_nodes_dynamic = (Node** )NULL;
-
- for (i = 0; i < SCANENV_MEMNODES_SIZE; i++)
- env->mem_nodes_static[i] = NULL_NODE;
-
-#ifdef USE_COMBINATION_EXPLOSION_CHECK
- env->num_comb_exp_check = 0;
- env->comb_exp_max_regnum = 0;
- env->curr_max_regnum = 0;
- env->has_recursion = 0;
-#endif
-}
-
-static int
-scan_env_add_mem_entry(ScanEnv* env)
-{
- int i, need, alloc;
- Node** p;
-
- need = env->num_mem + 1;
- if (need >= SCANENV_MEMNODES_SIZE) {
- if (env->mem_alloc <= need) {
- if (IS_NULL(env->mem_nodes_dynamic)) {
- alloc = INIT_SCANENV_MEMNODES_ALLOC_SIZE;
- p = (Node** )xmalloc(sizeof(Node*) * alloc);
- xmemcpy(p, env->mem_nodes_static,
- sizeof(Node*) * SCANENV_MEMNODES_SIZE);
- }
- else {
- alloc = env->mem_alloc * 2;
- p = (Node** )xrealloc(env->mem_nodes_dynamic, sizeof(Node*) * alloc);
- }
- CHECK_NULL_RETURN_MEMERR(p);
-
- for (i = env->num_mem + 1; i < alloc; i++)
- p[i] = NULL_NODE;
-
- env->mem_nodes_dynamic = p;
- env->mem_alloc = alloc;
- }
- }
-
- env->num_mem++;
- return env->num_mem;
-}
-
-static int
-scan_env_set_mem_node(ScanEnv* env, int num, Node* node)
-{
- if (env->num_mem >= num)
- SCANENV_MEM_NODES(env)[num] = node;
- else
- return ONIGERR_PARSER_BUG;
- return 0;
-}
-
-
-#ifdef USE_PARSE_TREE_NODE_RECYCLE
-typedef struct _FreeNode {
- struct _FreeNode* next;
-} FreeNode;
-
-static FreeNode* FreeNodeList = (FreeNode* )NULL;
-#endif
-
-extern void
-onig_node_free(Node* node)
-{
- start:
- if (IS_NULL(node)) return ;
-
- switch (NTYPE(node)) {
- case NT_STR:
- if (NSTR(node)->capa != 0 &&
- IS_NOT_NULL(NSTR(node)->s) && NSTR(node)->s != NSTR(node)->buf) {
- xfree(NSTR(node)->s);
- }
- break;
-
- case NT_LIST:
- case NT_ALT:
- onig_node_free(NCAR(node));
- {
- Node* next_node = NCDR(node);
-
-#ifdef USE_PARSE_TREE_NODE_RECYCLE
- {
- FreeNode* n = (FreeNode* )node;
-
- THREAD_ATOMIC_START;
- n->next = FreeNodeList;
- FreeNodeList = n;
- THREAD_ATOMIC_END;
- }
-#else
- xfree(node);
-#endif
- node = next_node;
- goto start;
- }
- break;
-
- case NT_CCLASS:
- {
- CClassNode* cc = NCCLASS(node);
-
- if (IS_NCCLASS_SHARE(cc)) return ;
- if (cc->mbuf)
- bbuf_free(cc->mbuf);
- }
- break;
-
- case NT_QTFR:
- if (NQTFR(node)->target)
- onig_node_free(NQTFR(node)->target);
- break;
-
- case NT_ENCLOSE:
- if (NENCLOSE(node)->target)
- onig_node_free(NENCLOSE(node)->target);
- break;
-
- case NT_BREF:
- if (IS_NOT_NULL(NBREF(node)->back_dynamic))
- xfree(NBREF(node)->back_dynamic);
- break;
-
- case NT_ANCHOR:
- if (NANCHOR(node)->target)
- onig_node_free(NANCHOR(node)->target);
- break;
- }
-
-#ifdef USE_PARSE_TREE_NODE_RECYCLE
- {
- FreeNode* n = (FreeNode* )node;
-
- THREAD_ATOMIC_START;
- n->next = FreeNodeList;
- FreeNodeList = n;
- THREAD_ATOMIC_END;
- }
-#else
- xfree(node);
-#endif
-}
-
-#ifdef USE_PARSE_TREE_NODE_RECYCLE
-extern int
-onig_free_node_list(void)
-{
- FreeNode* n;
-
- /* THREAD_ATOMIC_START; */
- while (IS_NOT_NULL(FreeNodeList)) {
- n = FreeNodeList;
- FreeNodeList = FreeNodeList->next;
- xfree(n);
- }
- /* THREAD_ATOMIC_END; */
- return 0;
-}
-#endif
-
-static Node*
-node_new(void)
-{
- Node* node;
-
-#ifdef USE_PARSE_TREE_NODE_RECYCLE
- THREAD_ATOMIC_START;
- if (IS_NOT_NULL(FreeNodeList)) {
- node = (Node* )FreeNodeList;
- FreeNodeList = FreeNodeList->next;
- THREAD_ATOMIC_END;
- return node;
- }
- THREAD_ATOMIC_END;
-#endif
-
- node = (Node* )xmalloc(sizeof(Node));
- /* xmemset(node, 0, sizeof(Node)); */
- return node;
-}
-
-
-static void
-initialize_cclass(CClassNode* cc)
-{
- BITSET_CLEAR(cc->bs);
- /* cc->base.flags = 0; */
- cc->flags = 0;
- cc->mbuf = NULL;
-}
-
-static Node*
-node_new_cclass(void)
-{
- Node* node = node_new();
- CHECK_NULL_RETURN(node);
-
- SET_NTYPE(node, NT_CCLASS);
- initialize_cclass(NCCLASS(node));
- return node;
-}
-
-static Node*
-node_new_cclass_by_codepoint_range(int not, OnigCodePoint sb_out,
- const OnigCodePoint ranges[])
-{
- int n, i;
- CClassNode* cc;
- OnigCodePoint j;
-
- Node* node = node_new_cclass();
- CHECK_NULL_RETURN(node);
-
- cc = NCCLASS(node);
- if (not != 0) NCCLASS_SET_NOT(cc);
-
- BITSET_CLEAR(cc->bs);
- if (sb_out > 0 && IS_NOT_NULL(ranges)) {
- n = ONIGENC_CODE_RANGE_NUM(ranges);
- for (i = 0; i < n; i++) {
- for (j = ONIGENC_CODE_RANGE_FROM(ranges, i);
- j <= (OnigCodePoint )ONIGENC_CODE_RANGE_TO(ranges, i); j++) {
- if (j >= sb_out) goto sb_end;
-
- BITSET_SET_BIT(cc->bs, j);
- }
- }
- }
-
- sb_end:
- if (IS_NULL(ranges)) {
- is_null:
- cc->mbuf = NULL;
- }
- else {
- BBuf* bbuf;
-
- n = ONIGENC_CODE_RANGE_NUM(ranges);
- if (n == 0) goto is_null;
-
- bbuf = (BBuf* )xmalloc(sizeof(BBuf));
- CHECK_NULL_RETURN(bbuf);
- bbuf->alloc = n + 1;
- bbuf->used = n + 1;
- bbuf->p = (UChar* )((void* )ranges);
-
- cc->mbuf = bbuf;
- }
-
- return node;
-}
-
-static Node*
-node_new_ctype(int type, int not)
-{
- Node* node = node_new();
- CHECK_NULL_RETURN(node);
-
- SET_NTYPE(node, NT_CTYPE);
- NCTYPE(node)->ctype = type;
- NCTYPE(node)->not = not;
- return node;
-}
-
-static Node*
-node_new_anychar(void)
-{
- Node* node = node_new();
- CHECK_NULL_RETURN(node);
-
- SET_NTYPE(node, NT_CANY);
- return node;
-}
-
-static Node*
-node_new_list(Node* left, Node* right)
-{
- Node* node = node_new();
- CHECK_NULL_RETURN(node);
-
- SET_NTYPE(node, NT_LIST);
- NCAR(node) = left;
- NCDR(node) = right;
- return node;
-}
-
-extern Node*
-onig_node_new_list(Node* left, Node* right)
-{
- return node_new_list(left, right);
-}
-
-extern Node*
-onig_node_list_add(Node* list, Node* x)
-{
- Node *n;
-
- n = onig_node_new_list(x, NULL);
- if (IS_NULL(n)) return NULL_NODE;
-
- if (IS_NOT_NULL(list)) {
- while (IS_NOT_NULL(NCDR(list)))
- list = NCDR(list);
-
- NCDR(list) = n;
- }
-
- return n;
-}
-
-extern Node*
-onig_node_new_alt(Node* left, Node* right)
-{
- Node* node = node_new();
- CHECK_NULL_RETURN(node);
-
- SET_NTYPE(node, NT_ALT);
- NCAR(node) = left;
- NCDR(node) = right;
- return node;
-}
-
-extern Node*
-onig_node_new_anchor(int type)
-{
- Node* node = node_new();
- CHECK_NULL_RETURN(node);
-
- SET_NTYPE(node, NT_ANCHOR);
- NANCHOR(node)->type = type;
- NANCHOR(node)->target = NULL;
- NANCHOR(node)->char_len = -1;
- return node;
-}
-
-static Node*
-node_new_backref(int back_num, int* backrefs, int by_name,
-#ifdef USE_BACKREF_WITH_LEVEL
- int exist_level, int nest_level,
-#endif
- ScanEnv* env)
-{
- int i;
- Node* node = node_new();
-
- CHECK_NULL_RETURN(node);
-
- SET_NTYPE(node, NT_BREF);
- NBREF(node)->state = 0;
- NBREF(node)->back_num = back_num;
- NBREF(node)->back_dynamic = (int* )NULL;
- if (by_name != 0)
- NBREF(node)->state |= NST_NAME_REF;
-
-#ifdef USE_BACKREF_WITH_LEVEL
- if (exist_level != 0) {
- NBREF(node)->state |= NST_NEST_LEVEL;
- NBREF(node)->nest_level = nest_level;
- }
-#endif
-
- for (i = 0; i < back_num; i++) {
- if (backrefs[i] <= env->num_mem &&
- IS_NULL(SCANENV_MEM_NODES(env)[backrefs[i]])) {
- NBREF(node)->state |= NST_RECURSION; /* /...(\1).../ */
- break;
- }
- }
-
- if (back_num <= NODE_BACKREFS_SIZE) {
- for (i = 0; i < back_num; i++)
- NBREF(node)->back_static[i] = backrefs[i];
- }
- else {
- int* p = (int* )xmalloc(sizeof(int) * back_num);
- if (IS_NULL(p)) {
- onig_node_free(node);
- return NULL;
- }
- NBREF(node)->back_dynamic = p;
- for (i = 0; i < back_num; i++)
- p[i] = backrefs[i];
- }
- return node;
-}
-
-#ifdef USE_SUBEXP_CALL
-static Node*
-node_new_call(UChar* name, UChar* name_end, int gnum)
-{
- Node* node = node_new();
- CHECK_NULL_RETURN(node);
-
- SET_NTYPE(node, NT_CALL);
- NCALL(node)->state = 0;
- NCALL(node)->target = NULL_NODE;
- NCALL(node)->name = name;
- NCALL(node)->name_end = name_end;
- NCALL(node)->group_num = gnum; /* call by number if gnum != 0 */
- return node;
-}
-#endif
-
-static Node*
-node_new_quantifier(int lower, int upper, int by_number)
-{
- Node* node = node_new();
- CHECK_NULL_RETURN(node);
-
- SET_NTYPE(node, NT_QTFR);
- NQTFR(node)->state = 0;
- NQTFR(node)->target = NULL;
- NQTFR(node)->lower = lower;
- NQTFR(node)->upper = upper;
- NQTFR(node)->greedy = 1;
- NQTFR(node)->target_empty_info = NQ_TARGET_ISNOT_EMPTY;
- NQTFR(node)->head_exact = NULL_NODE;
- NQTFR(node)->next_head_exact = NULL_NODE;
- NQTFR(node)->is_refered = 0;
- if (by_number != 0)
- NQTFR(node)->state |= NST_BY_NUMBER;
-
-#ifdef USE_COMBINATION_EXPLOSION_CHECK
- NQTFR(node)->comb_exp_check_num = 0;
-#endif
-
- return node;
-}
-
-static Node*
-node_new_enclose(int type)
-{
- Node* node = node_new();
- CHECK_NULL_RETURN(node);
-
- SET_NTYPE(node, NT_ENCLOSE);
- NENCLOSE(node)->type = type;
- NENCLOSE(node)->state = 0;
- NENCLOSE(node)->regnum = 0;
- NENCLOSE(node)->option = 0;
- NENCLOSE(node)->target = NULL;
- NENCLOSE(node)->call_addr = -1;
- NENCLOSE(node)->opt_count = 0;
- return node;
-}
-
-extern Node*
-onig_node_new_enclose(int type)
-{
- return node_new_enclose(type);
-}
-
-static Node*
-node_new_enclose_memory(OnigOptionType option, int is_named)
-{
- Node* node = node_new_enclose(ENCLOSE_MEMORY);
- CHECK_NULL_RETURN(node);
- if (is_named != 0)
- SET_ENCLOSE_STATUS(node, NST_NAMED_GROUP);
-
-#ifdef USE_SUBEXP_CALL
- NENCLOSE(node)->option = option;
-#endif
- return node;
-}
-
-static Node*
-node_new_option(OnigOptionType option)
-{
- Node* node = node_new_enclose(ENCLOSE_OPTION);
- CHECK_NULL_RETURN(node);
- NENCLOSE(node)->option = option;
- return node;
-}
-
-extern int
-onig_node_str_cat(Node* node, const UChar* s, const UChar* end)
-{
- ptrdiff_t addlen = end - s;
-
- if (addlen > 0) {
- ptrdiff_t len = NSTR(node)->end - NSTR(node)->s;
-
- if (NSTR(node)->capa > 0 || (len + addlen > NODE_STR_BUF_SIZE - 1)) {
- UChar* p;
- int capa = len + addlen + NODE_STR_MARGIN;
-
- if (capa <= NSTR(node)->capa) {
- onig_strcpy(NSTR(node)->s + len, s, end);
- }
- else {
- if (NSTR(node)->s == NSTR(node)->buf)
- p = strcat_capa_from_static(NSTR(node)->s, NSTR(node)->end,
- s, end, capa);
- else
- p = strcat_capa(NSTR(node)->s, NSTR(node)->end, s, end, capa);
-
- CHECK_NULL_RETURN_MEMERR(p);
- NSTR(node)->s = p;
- NSTR(node)->capa = capa;
- }
- }
- else {
- onig_strcpy(NSTR(node)->s + len, s, end);
- }
- NSTR(node)->end = NSTR(node)->s + len + addlen;
- }
-
- return 0;
-}
-
-extern int
-onig_node_str_set(Node* node, const UChar* s, const UChar* end)
-{
- onig_node_str_clear(node);
- return onig_node_str_cat(node, s, end);
-}
-
-static int
-node_str_cat_char(Node* node, UChar c)
-{
- UChar s[1];
-
- s[0] = c;
- return onig_node_str_cat(node, s, s + 1);
-}
-
-extern void
-onig_node_conv_to_str_node(Node* node, int flag)
-{
- SET_NTYPE(node, NT_STR);
- NSTR(node)->flag = flag;
- NSTR(node)->capa = 0;
- NSTR(node)->s = NSTR(node)->buf;
- NSTR(node)->end = NSTR(node)->buf;
-}
-
-extern void
-onig_node_str_clear(Node* node)
-{
- if (NSTR(node)->capa != 0 &&
- IS_NOT_NULL(NSTR(node)->s) && NSTR(node)->s != NSTR(node)->buf) {
- xfree(NSTR(node)->s);
- }
-
- NSTR(node)->capa = 0;
- NSTR(node)->flag = 0;
- NSTR(node)->s = NSTR(node)->buf;
- NSTR(node)->end = NSTR(node)->buf;
-}
-
-static Node*
-node_new_str(const UChar* s, const UChar* end)
-{
- Node* node = node_new();
- CHECK_NULL_RETURN(node);
-
- SET_NTYPE(node, NT_STR);
- NSTR(node)->capa = 0;
- NSTR(node)->flag = 0;
- NSTR(node)->s = NSTR(node)->buf;
- NSTR(node)->end = NSTR(node)->buf;
- if (onig_node_str_cat(node, s, end)) {
- onig_node_free(node);
- return NULL;
- }
- return node;
-}
-
-extern Node*
-onig_node_new_str(const UChar* s, const UChar* end)
-{
- return node_new_str(s, end);
-}
-
-static Node*
-node_new_str_raw(UChar* s, UChar* end)
-{
- Node* node = node_new_str(s, end);
- NSTRING_SET_RAW(node);
- return node;
-}
-
-static Node*
-node_new_empty(void)
-{
- return node_new_str(NULL, NULL);
-}
-
-static Node*
-node_new_str_raw_char(UChar c)
-{
- UChar p[1];
-
- p[0] = c;
- return node_new_str_raw(p, p + 1);
-}
-
-static Node*
-str_node_split_last_char(StrNode* sn, OnigEncoding enc)
-{
- const UChar *p;
- Node* n = NULL_NODE;
-
- if (sn->end > sn->s) {
- p = onigenc_get_prev_char_head(enc, sn->s, sn->end, sn->end);
- if (p && p > sn->s) { /* can be splitted. */
- n = node_new_str(p, sn->end);
- if ((sn->flag & NSTR_RAW) != 0)
- NSTRING_SET_RAW(n);
- sn->end = (UChar* )p;
- }
- }
- return n;
-}
-
-static int
-str_node_can_be_split(StrNode* sn, OnigEncoding enc)
-{
- if (sn->end > sn->s) {
- return ((enclen(enc, sn->s, sn->end) < sn->end - sn->s) ? 1 : 0);
- }
- return 0;
-}
-
-#ifdef USE_PAD_TO_SHORT_BYTE_CHAR
-static int
-node_str_head_pad(StrNode* sn, int num, UChar val)
-{
- UChar buf[NODE_STR_BUF_SIZE];
- int i, len;
-
- len = sn->end - sn->s;
- onig_strcpy(buf, sn->s, sn->end);
- onig_strcpy(&(sn->s[num]), buf, buf + len);
- sn->end += num;
-
- for (i = 0; i < num; i++) {
- sn->s[i] = val;
- }
-}
-#endif
-
-extern int
-onig_scan_unsigned_number(UChar** src, const UChar* end, OnigEncoding enc)
-{
- unsigned int num, val;
- OnigCodePoint c;
- UChar* p = *src;
- PFETCH_READY;
-
- num = 0;
- while (!PEND) {
- PFETCH(c);
- if (ONIGENC_IS_CODE_DIGIT(enc, c)) {
- val = (unsigned int )DIGITVAL(c);
- if ((INT_MAX_LIMIT - val) / 10UL < num)
- return -1; /* overflow */
-
- num = num * 10 + val;
- }
- else {
- PUNFETCH;
- break;
- }
- }
- *src = p;
- return num;
-}
-
-static int
-scan_unsigned_hexadecimal_number(UChar** src, UChar* end, int maxlen,
- OnigEncoding enc)
-{
- OnigCodePoint c;
- unsigned int num, val;
- UChar* p = *src;
- PFETCH_READY;
-
- num = 0;
- while (!PEND && maxlen-- != 0) {
- PFETCH(c);
- if (ONIGENC_IS_CODE_XDIGIT(enc, c)) {
- val = (unsigned int )XDIGITVAL(enc,c);
- if ((INT_MAX_LIMIT - val) / 16UL < num)
- return -1; /* overflow */
-
- num = (num << 4) + XDIGITVAL(enc,c);
- }
- else {
- PUNFETCH;
- break;
- }
- }
- *src = p;
- return num;
-}
-
-static int
-scan_unsigned_octal_number(UChar** src, UChar* end, int maxlen,
- OnigEncoding enc)
-{
- OnigCodePoint c;
- unsigned int num, val;
- UChar* p = *src;
- PFETCH_READY;
-
- num = 0;
- while (!PEND && maxlen-- != 0) {
- PFETCH(c);
- if (ONIGENC_IS_CODE_DIGIT(enc, c) && c < '8') {
- val = ODIGITVAL(c);
- if ((INT_MAX_LIMIT - val) / 8UL < num)
- return -1; /* overflow */
-
- num = (num << 3) + val;
- }
- else {
- PUNFETCH;
- break;
- }
- }
- *src = p;
- return num;
-}
-
-
-#define BBUF_WRITE_CODE_POINT(bbuf,pos,code) \
- BBUF_WRITE(bbuf, pos, &(code), SIZE_CODE_POINT)
-
-/* data format:
- [n][from-1][to-1][from-2][to-2] ... [from-n][to-n]
- (all data size is OnigCodePoint)
- */
-static int
-new_code_range(BBuf** pbuf)
-{
-#define INIT_MULTI_BYTE_RANGE_SIZE (SIZE_CODE_POINT * 5)
- int r;
- OnigCodePoint n;
- BBuf* bbuf;
-
- bbuf = *pbuf = (BBuf* )xmalloc(sizeof(BBuf));
- CHECK_NULL_RETURN_MEMERR(*pbuf);
- r = BBUF_INIT(*pbuf, INIT_MULTI_BYTE_RANGE_SIZE);
- if (r) return r;
-
- n = 0;
- BBUF_WRITE_CODE_POINT(bbuf, 0, n);
- return 0;
-}
-
-static int
-add_code_range_to_buf(BBuf** pbuf, OnigCodePoint from, OnigCodePoint to)
-{
- int r, inc_n, pos;
- int low, high, bound, x;
- OnigCodePoint n, *data;
- BBuf* bbuf;
-
- if (from > to) {
- n = from; from = to; to = n;
- }
-
- if (IS_NULL(*pbuf)) {
- r = new_code_range(pbuf);
- if (r) return r;
- bbuf = *pbuf;
- n = 0;
- }
- else {
- bbuf = *pbuf;
- GET_CODE_POINT(n, bbuf->p);
- }
- data = (OnigCodePoint* )(bbuf->p);
- data++;
-
- for (low = 0, bound = n; low < bound; ) {
- x = (low + bound) >> 1;
- if (from > data[x*2 + 1])
- low = x + 1;
- else
- bound = x;
- }
-
- for (high = low, bound = n; high < bound; ) {
- x = (high + bound) >> 1;
- if (to >= data[x*2] - 1)
- high = x + 1;
- else
- bound = x;
- }
-
- inc_n = low + 1 - high;
- if (n + inc_n > ONIG_MAX_MULTI_BYTE_RANGES_NUM)
- return ONIGERR_TOO_MANY_MULTI_BYTE_RANGES;
-
- if (inc_n != 1) {
- if (from > data[low*2])
- from = data[low*2];
- if (to < data[(high - 1)*2 + 1])
- to = data[(high - 1)*2 + 1];
- }
-
- if (inc_n != 0 && (OnigCodePoint )high < n) {
- int from_pos = SIZE_CODE_POINT * (1 + high * 2);
- int to_pos = SIZE_CODE_POINT * (1 + (low + 1) * 2);
- int size = (n - high) * 2 * SIZE_CODE_POINT;
-
- if (inc_n > 0) {
- BBUF_MOVE_RIGHT(bbuf, from_pos, to_pos, size);
- }
- else {
- BBUF_MOVE_LEFT_REDUCE(bbuf, from_pos, to_pos);
- }
- }
-
- pos = SIZE_CODE_POINT * (1 + low * 2);
- BBUF_ENSURE_SIZE(bbuf, pos + SIZE_CODE_POINT * 2);
- BBUF_WRITE_CODE_POINT(bbuf, pos, from);
- BBUF_WRITE_CODE_POINT(bbuf, pos + SIZE_CODE_POINT, to);
- n += inc_n;
- BBUF_WRITE_CODE_POINT(bbuf, 0, n);
-
- return 0;
-}
-
-static int
-add_code_range(BBuf** pbuf, ScanEnv* env, OnigCodePoint from, OnigCodePoint to)
-{
- if (from > to) {
- if (IS_SYNTAX_BV(env->syntax, ONIG_SYN_ALLOW_EMPTY_RANGE_IN_CC))
- return 0;
- else
- return ONIGERR_EMPTY_RANGE_IN_CHAR_CLASS;
- }
-
- return add_code_range_to_buf(pbuf, from, to);
-}
-
-static int
-not_code_range_buf(OnigEncoding enc, BBuf* bbuf, BBuf** pbuf)
-{
- int r, i, n;
- OnigCodePoint pre, from, *data, to = 0;
-
- *pbuf = (BBuf* )NULL;
- if (IS_NULL(bbuf)) {
- set_all:
- return SET_ALL_MULTI_BYTE_RANGE(enc, pbuf);
- }
-
- data = (OnigCodePoint* )(bbuf->p);
- GET_CODE_POINT(n, data);
- data++;
- if (n <= 0) goto set_all;
-
- r = 0;
- pre = MBCODE_START_POS(enc);
- for (i = 0; i < n; i++) {
- from = data[i*2];
- to = data[i*2+1];
- if (pre <= from - 1) {
- r = add_code_range_to_buf(pbuf, pre, from - 1);
- if (r != 0) return r;
- }
- if (to == ~((OnigCodePoint )0)) break;
- pre = to + 1;
- }
- if (to < ~((OnigCodePoint )0)) {
- r = add_code_range_to_buf(pbuf, to + 1, ~((OnigCodePoint )0));
- }
- return r;
-}
-
-#define SWAP_BBUF_NOT(bbuf1, not1, bbuf2, not2) do {\
- BBuf *tbuf; \
- int tnot; \
- tnot = not1; not1 = not2; not2 = tnot; \
- tbuf = bbuf1; bbuf1 = bbuf2; bbuf2 = tbuf; \
-} while (0)
-
-static int
-or_code_range_buf(OnigEncoding enc, BBuf* bbuf1, int not1,
- BBuf* bbuf2, int not2, BBuf** pbuf)
-{
- int r;
- OnigCodePoint i, n1, *data1;
- OnigCodePoint from, to;
-
- *pbuf = (BBuf* )NULL;
- if (IS_NULL(bbuf1) && IS_NULL(bbuf2)) {
- if (not1 != 0 || not2 != 0)
- return SET_ALL_MULTI_BYTE_RANGE(enc, pbuf);
- return 0;
- }
-
- r = 0;
- if (IS_NULL(bbuf2))
- SWAP_BBUF_NOT(bbuf1, not1, bbuf2, not2);
-
- if (IS_NULL(bbuf1)) {
- if (not1 != 0) {
- return SET_ALL_MULTI_BYTE_RANGE(enc, pbuf);
- }
- else {
- if (not2 == 0) {
- return bbuf_clone(pbuf, bbuf2);
- }
- else {
- return not_code_range_buf(enc, bbuf2, pbuf);
- }
- }
- }
-
- if (not1 != 0)
- SWAP_BBUF_NOT(bbuf1, not1, bbuf2, not2);
-
- data1 = (OnigCodePoint* )(bbuf1->p);
- GET_CODE_POINT(n1, data1);
- data1++;
-
- if (not2 == 0 && not1 == 0) { /* 1 OR 2 */
- r = bbuf_clone(pbuf, bbuf2);
- }
- else if (not1 == 0) { /* 1 OR (not 2) */
- r = not_code_range_buf(enc, bbuf2, pbuf);
- }
- if (r != 0) return r;
-
- for (i = 0; i < n1; i++) {
- from = data1[i*2];
- to = data1[i*2+1];
- r = add_code_range_to_buf(pbuf, from, to);
- if (r != 0) return r;
- }
- return 0;
-}
-
-static int
-and_code_range1(BBuf** pbuf, OnigCodePoint from1, OnigCodePoint to1,
- OnigCodePoint* data, int n)
-{
- int i, r;
- OnigCodePoint from2, to2;
-
- for (i = 0; i < n; i++) {
- from2 = data[i*2];
- to2 = data[i*2+1];
- if (from2 < from1) {
- if (to2 < from1) continue;
- else {
- from1 = to2 + 1;
- }
- }
- else if (from2 <= to1) {
- if (to2 < to1) {
- if (from1 <= from2 - 1) {
- r = add_code_range_to_buf(pbuf, from1, from2-1);
- if (r != 0) return r;
- }
- from1 = to2 + 1;
- }
- else {
- to1 = from2 - 1;
- }
- }
- else {
- from1 = from2;
- }
- if (from1 > to1) break;
- }
- if (from1 <= to1) {
- r = add_code_range_to_buf(pbuf, from1, to1);
- if (r != 0) return r;
- }
- return 0;
-}
-
-static int
-and_code_range_buf(BBuf* bbuf1, int not1, BBuf* bbuf2, int not2, BBuf** pbuf)
-{
- int r;
- OnigCodePoint i, j, n1, n2, *data1, *data2;
- OnigCodePoint from, to, from1, to1, from2, to2;
-
- *pbuf = (BBuf* )NULL;
- if (IS_NULL(bbuf1)) {
- if (not1 != 0 && IS_NOT_NULL(bbuf2)) /* not1 != 0 -> not2 == 0 */
- return bbuf_clone(pbuf, bbuf2);
- return 0;
- }
- else if (IS_NULL(bbuf2)) {
- if (not2 != 0)
- return bbuf_clone(pbuf, bbuf1);
- return 0;
- }
-
- if (not1 != 0)
- SWAP_BBUF_NOT(bbuf1, not1, bbuf2, not2);
-
- data1 = (OnigCodePoint* )(bbuf1->p);
- data2 = (OnigCodePoint* )(bbuf2->p);
- GET_CODE_POINT(n1, data1);
- GET_CODE_POINT(n2, data2);
- data1++;
- data2++;
-
- if (not2 == 0 && not1 == 0) { /* 1 AND 2 */
- for (i = 0; i < n1; i++) {
- from1 = data1[i*2];
- to1 = data1[i*2+1];
- for (j = 0; j < n2; j++) {
- from2 = data2[j*2];
- to2 = data2[j*2+1];
- if (from2 > to1) break;
- if (to2 < from1) continue;
- from = MAX(from1, from2);
- to = MIN(to1, to2);
- r = add_code_range_to_buf(pbuf, from, to);
- if (r != 0) return r;
- }
- }
- }
- else if (not1 == 0) { /* 1 AND (not 2) */
- for (i = 0; i < n1; i++) {
- from1 = data1[i*2];
- to1 = data1[i*2+1];
- r = and_code_range1(pbuf, from1, to1, data2, n2);
- if (r != 0) return r;
- }
- }
-
- return 0;
-}
-
-static int
-and_cclass(CClassNode* dest, CClassNode* cc, OnigEncoding enc)
-{
- int r, not1, not2;
- BBuf *buf1, *buf2, *pbuf;
- BitSetRef bsr1, bsr2;
- BitSet bs1, bs2;
-
- not1 = IS_NCCLASS_NOT(dest);
- bsr1 = dest->bs;
- buf1 = dest->mbuf;
- not2 = IS_NCCLASS_NOT(cc);
- bsr2 = cc->bs;
- buf2 = cc->mbuf;
-
- if (not1 != 0) {
- bitset_invert_to(bsr1, bs1);
- bsr1 = bs1;
- }
- if (not2 != 0) {
- bitset_invert_to(bsr2, bs2);
- bsr2 = bs2;
- }
- bitset_and(bsr1, bsr2);
- if (bsr1 != dest->bs) {
- bitset_copy(dest->bs, bsr1);
- bsr1 = dest->bs;
- }
- if (not1 != 0) {
- bitset_invert(dest->bs);
- }
-
- if (! ONIGENC_IS_SINGLEBYTE(enc)) {
- if (not1 != 0 && not2 != 0) {
- r = or_code_range_buf(enc, buf1, 0, buf2, 0, &pbuf);
- }
- else {
- r = and_code_range_buf(buf1, not1, buf2, not2, &pbuf);
- if (r == 0 && not1 != 0) {
- BBuf *tbuf;
- r = not_code_range_buf(enc, pbuf, &tbuf);
- if (r != 0) {
- bbuf_free(pbuf);
- return r;
- }
- bbuf_free(pbuf);
- pbuf = tbuf;
- }
- }
- if (r != 0) return r;
-
- dest->mbuf = pbuf;
- bbuf_free(buf1);
- return r;
- }
- return 0;
-}
-
-static int
-or_cclass(CClassNode* dest, CClassNode* cc, OnigEncoding enc)
-{
- int r, not1, not2;
- BBuf *buf1, *buf2, *pbuf;
- BitSetRef bsr1, bsr2;
- BitSet bs1, bs2;
-
- not1 = IS_NCCLASS_NOT(dest);
- bsr1 = dest->bs;
- buf1 = dest->mbuf;
- not2 = IS_NCCLASS_NOT(cc);
- bsr2 = cc->bs;
- buf2 = cc->mbuf;
-
- if (not1 != 0) {
- bitset_invert_to(bsr1, bs1);
- bsr1 = bs1;
- }
- if (not2 != 0) {
- bitset_invert_to(bsr2, bs2);
- bsr2 = bs2;
- }
- bitset_or(bsr1, bsr2);
- if (bsr1 != dest->bs) {
- bitset_copy(dest->bs, bsr1);
- bsr1 = dest->bs;
- }
- if (not1 != 0) {
- bitset_invert(dest->bs);
- }
-
- if (! ONIGENC_IS_SINGLEBYTE(enc)) {
- if (not1 != 0 && not2 != 0) {
- r = and_code_range_buf(buf1, 0, buf2, 0, &pbuf);
- }
- else {
- r = or_code_range_buf(enc, buf1, not1, buf2, not2, &pbuf);
- if (r == 0 && not1 != 0) {
- BBuf *tbuf;
- r = not_code_range_buf(enc, pbuf, &tbuf);
- if (r != 0) {
- bbuf_free(pbuf);
- return r;
- }
- bbuf_free(pbuf);
- pbuf = tbuf;
- }
- }
- if (r != 0) return r;
-
- dest->mbuf = pbuf;
- bbuf_free(buf1);
- return r;
- }
- else
- return 0;
-}
-
-static int
-conv_backslash_value(int c, ScanEnv* env)
-{
- if (IS_SYNTAX_OP(env->syntax, ONIG_SYN_OP_ESC_CONTROL_CHARS)) {
- switch (c) {
- case 'n': return '\n';
- case 't': return '\t';
- case 'r': return '\r';
- case 'f': return '\f';
- case 'a': return '\007';
- case 'b': return '\010';
- case 'e': return '\033';
- case 'v':
- if (IS_SYNTAX_OP2(env->syntax, ONIG_SYN_OP2_ESC_V_VTAB))
- return '\v';
- break;
-
- default:
- break;
- }
- }
- return c;
-}
-
-#if 0 /* no invalid quantifier */
-static int
-is_invalid_quantifier_target(Node* node)
-{
- switch (NTYPE(node)) {
- case NT_ANCHOR:
- return 1;
- break;
-
- case NT_ENCLOSE:
- /* allow enclosed elements */
- /* return is_invalid_quantifier_target(NENCLOSE(node)->target); */
- break;
-
- case NT_LIST:
- do {
- if (! is_invalid_quantifier_target(NCAR(node))) return 0;
- } while (IS_NOT_NULL(node = NCDR(node)));
- return 0;
- break;
-
- case NT_ALT:
- do {
- if (is_invalid_quantifier_target(NCAR(node))) return 1;
- } while (IS_NOT_NULL(node = NCDR(node)));
- break;
-
- default:
- break;
- }
- return 0;
-}
-#else
-#define is_invalid_quantifier_target(node) 0
-#endif
-
-/* ?:0, *:1, +:2, ??:3, *?:4, +?:5 */
-static int
-popular_quantifier_num(QtfrNode* q)
-{
- if (q->greedy) {
- if (q->lower == 0) {
- if (q->upper == 1) return 0;
- else if (IS_REPEAT_INFINITE(q->upper)) return 1;
- }
- else if (q->lower == 1) {
- if (IS_REPEAT_INFINITE(q->upper)) return 2;
- }
- }
- else {
- if (q->lower == 0) {
- if (q->upper == 1) return 3;
- else if (IS_REPEAT_INFINITE(q->upper)) return 4;
- }
- else if (q->lower == 1) {
- if (IS_REPEAT_INFINITE(q->upper)) return 5;
- }
- }
- return -1;
-}
-
-
-enum ReduceType {
- RQ_ASIS = 0, /* as is */
- RQ_DEL = 1, /* delete parent */
- RQ_A, /* to '*' */
- RQ_AQ, /* to '*?' */
- RQ_QQ, /* to '??' */
- RQ_P_QQ, /* to '+)??' */
- RQ_PQ_Q /* to '+?)?' */
-};
-
-static enum ReduceType const ReduceTypeTable[6][6] = {
- {RQ_DEL, RQ_A, RQ_A, RQ_QQ, RQ_AQ, RQ_ASIS}, /* '?' */
- {RQ_DEL, RQ_DEL, RQ_DEL, RQ_P_QQ, RQ_P_QQ, RQ_DEL}, /* '*' */
- {RQ_A, RQ_A, RQ_DEL, RQ_ASIS, RQ_P_QQ, RQ_DEL}, /* '+' */
- {RQ_DEL, RQ_AQ, RQ_AQ, RQ_DEL, RQ_AQ, RQ_AQ}, /* '??' */
- {RQ_DEL, RQ_DEL, RQ_DEL, RQ_DEL, RQ_DEL, RQ_DEL}, /* '*?' */
- {RQ_ASIS, RQ_PQ_Q, RQ_DEL, RQ_AQ, RQ_AQ, RQ_DEL} /* '+?' */
-};
-
-extern void
-onig_reduce_nested_quantifier(Node* pnode, Node* cnode)
-{
- int pnum, cnum;
- QtfrNode *p, *c;
-
- p = NQTFR(pnode);
- c = NQTFR(cnode);
- pnum = popular_quantifier_num(p);
- cnum = popular_quantifier_num(c);
- if (pnum < 0 || cnum < 0) return ;
-
- switch(ReduceTypeTable[cnum][pnum]) {
- case RQ_DEL:
- *pnode = *cnode;
- break;
- case RQ_A:
- p->target = c->target;
- p->lower = 0; p->upper = REPEAT_INFINITE; p->greedy = 1;
- break;
- case RQ_AQ:
- p->target = c->target;
- p->lower = 0; p->upper = REPEAT_INFINITE; p->greedy = 0;
- break;
- case RQ_QQ:
- p->target = c->target;
- p->lower = 0; p->upper = 1; p->greedy = 0;
- break;
- case RQ_P_QQ:
- p->target = cnode;
- p->lower = 0; p->upper = 1; p->greedy = 0;
- c->lower = 1; c->upper = REPEAT_INFINITE; c->greedy = 1;
- return ;
- break;
- case RQ_PQ_Q:
- p->target = cnode;
- p->lower = 0; p->upper = 1; p->greedy = 1;
- c->lower = 1; c->upper = REPEAT_INFINITE; c->greedy = 0;
- return ;
- break;
- case RQ_ASIS:
- p->target = cnode;
- return ;
- break;
- }
-
- c->target = NULL_NODE;
- onig_node_free(cnode);
-}
-
-
-enum TokenSyms {
- TK_EOT = 0, /* end of token */
- TK_RAW_BYTE = 1,
- TK_CHAR,
- TK_STRING,
- TK_CODE_POINT,
- TK_ANYCHAR,
- TK_CHAR_TYPE,
- TK_BACKREF,
- TK_CALL,
- TK_ANCHOR,
- TK_OP_REPEAT,
- TK_INTERVAL,
- TK_ANYCHAR_ANYTIME, /* SQL '%' == .* */
- TK_ALT,
- TK_SUBEXP_OPEN,
- TK_SUBEXP_CLOSE,
- TK_CC_OPEN,
- TK_QUOTE_OPEN,
- TK_CHAR_PROPERTY, /* \p{...}, \P{...} */
- /* in cc */
- TK_CC_CLOSE,
- TK_CC_RANGE,
- TK_POSIX_BRACKET_OPEN,
- TK_CC_AND, /* && */
- TK_CC_CC_OPEN /* [ */
-};
-
-typedef struct {
- enum TokenSyms type;
- int escaped;
- int base; /* is number: 8, 16 (used in [....]) */
- UChar* backp;
- union {
- UChar* s;
- int c;
- OnigCodePoint code;
- int anchor;
- int subtype;
- struct {
- int lower;
- int upper;
- int greedy;
- int possessive;
- } repeat;
- struct {
- int num;
- int ref1;
- int* refs;
- int by_name;
-#ifdef USE_BACKREF_WITH_LEVEL
- int exist_level;
- int level; /* \k<name+n> */
-#endif
- } backref;
- struct {
- UChar* name;
- UChar* name_end;
- int gnum;
- } call;
- struct {
- int ctype;
- int not;
- } prop;
- } u;
-} OnigToken;
-
-
-static int
-fetch_range_quantifier(UChar** src, UChar* end, OnigToken* tok, ScanEnv* env)
-{
- int low, up, syn_allow, non_low = 0;
- int r = 0;
- OnigCodePoint c;
- OnigEncoding enc = env->enc;
- UChar* p = *src;
- PFETCH_READY;
-
- syn_allow = IS_SYNTAX_BV(env->syntax, ONIG_SYN_ALLOW_INVALID_INTERVAL);
-
- if (PEND) {
- if (syn_allow)
- return 1; /* "....{" : OK! */
- else
- return ONIGERR_END_PATTERN_AT_LEFT_BRACE; /* "....{" syntax error */
- }
-
- if (! syn_allow) {
- c = PPEEK;
- if (c == ')' || c == '(' || c == '|') {
- return ONIGERR_END_PATTERN_AT_LEFT_BRACE;
- }
- }
-
- low = onig_scan_unsigned_number(&p, end, env->enc);
- if (low < 0) return ONIGERR_TOO_BIG_NUMBER_FOR_REPEAT_RANGE;
- if (low > ONIG_MAX_REPEAT_NUM)
- return ONIGERR_TOO_BIG_NUMBER_FOR_REPEAT_RANGE;
-
- if (p == *src) { /* can't read low */
- if (IS_SYNTAX_BV(env->syntax, ONIG_SYN_ALLOW_INTERVAL_LOW_ABBREV)) {
- /* allow {,n} as {0,n} */
- low = 0;
- non_low = 1;
- }
- else
- goto invalid;
- }
-
- if (PEND) goto invalid;
- PFETCH(c);
- if (c == ',') {
- UChar* prev = p;
- up = onig_scan_unsigned_number(&p, end, env->enc);
- if (up < 0) return ONIGERR_TOO_BIG_NUMBER_FOR_REPEAT_RANGE;
- if (up > ONIG_MAX_REPEAT_NUM)
- return ONIGERR_TOO_BIG_NUMBER_FOR_REPEAT_RANGE;
-
- if (p == prev) {
- if (non_low != 0)
- goto invalid;
- up = REPEAT_INFINITE; /* {n,} : {n,infinite} */
- }
- }
- else {
- if (non_low != 0)
- goto invalid;
-
- PUNFETCH;
- up = low; /* {n} : exact n times */
- r = 2; /* fixed */
- }
-
- if (PEND) goto invalid;
- PFETCH(c);
- if (IS_SYNTAX_OP(env->syntax, ONIG_SYN_OP_ESC_BRACE_INTERVAL)) {
- if (c != MC_ESC(env->syntax)) goto invalid;
- PFETCH(c);
- }
- if (c != '}') goto invalid;
-
- if (!IS_REPEAT_INFINITE(up) && low > up) {
- return ONIGERR_UPPER_SMALLER_THAN_LOWER_IN_REPEAT_RANGE;
- }
-
- tok->type = TK_INTERVAL;
- tok->u.repeat.lower = low;
- tok->u.repeat.upper = up;
- *src = p;
- return r; /* 0: normal {n,m}, 2: fixed {n} */
-
- invalid:
- if (syn_allow)
- return 1; /* OK */
- else
- return ONIGERR_INVALID_REPEAT_RANGE_PATTERN;
-}
-
-/* \M-, \C-, \c, or \... */
-static int
-fetch_escaped_value(UChar** src, UChar* end, ScanEnv* env)
-{
- int v;
- OnigCodePoint c;
- OnigEncoding enc = env->enc;
- UChar* p = *src;
- PFETCH_READY;
-
- if (PEND) return ONIGERR_END_PATTERN_AT_ESCAPE;
-
- PFETCH(c);
- switch (c) {
- case 'M':
- if (IS_SYNTAX_OP2(env->syntax, ONIG_SYN_OP2_ESC_CAPITAL_M_BAR_META)) {
- if (PEND) return ONIGERR_END_PATTERN_AT_META;
- PFETCH(c);
- if (c != '-') return ONIGERR_META_CODE_SYNTAX;
- if (PEND) return ONIGERR_END_PATTERN_AT_META;
- PFETCH(c);
- if (c == MC_ESC(env->syntax)) {
- v = fetch_escaped_value(&p, end, env);
- if (v < 0) return v;
- c = (OnigCodePoint )v;
- }
- c = ((c & 0xff) | 0x80);
- }
- else
- goto backslash;
- break;
-
- case 'C':
- if (IS_SYNTAX_OP2(env->syntax, ONIG_SYN_OP2_ESC_CAPITAL_C_BAR_CONTROL)) {
- if (PEND) return ONIGERR_END_PATTERN_AT_CONTROL;
- PFETCH(c);
- if (c != '-') return ONIGERR_CONTROL_CODE_SYNTAX;
- goto control;
- }
- else
- goto backslash;
-
- case 'c':
- if (IS_SYNTAX_OP(env->syntax, ONIG_SYN_OP_ESC_C_CONTROL)) {
- control:
- if (PEND) return ONIGERR_END_PATTERN_AT_CONTROL;
- PFETCH(c);
- if (c == '?') {
- c = 0177;
- }
- else {
- if (c == MC_ESC(env->syntax)) {
- v = fetch_escaped_value(&p, end, env);
- if (v < 0) return v;
- c = (OnigCodePoint )v;
- }
- c &= 0x9f;
- }
- break;
- }
- /* fall through */
-
- default:
- {
- backslash:
- c = conv_backslash_value(c, env);
- }
- break;
- }
-
- *src = p;
- return c;
-}
-
-static int fetch_token(OnigToken* tok, UChar** src, UChar* end, ScanEnv* env);
-
-static OnigCodePoint
-get_name_end_code_point(OnigCodePoint start)
-{
- switch (start) {
- case '<': return (OnigCodePoint )'>'; break;
- case '\'': return (OnigCodePoint )'\''; break;
- default:
- break;
- }
-
- return (OnigCodePoint )0;
-}
-
-#ifdef USE_NAMED_GROUP
-#ifdef USE_BACKREF_WITH_LEVEL
-/*
- \k<name+n>, \k<name-n>
- \k<num+n>, \k<num-n>
- \k<-num+n>, \k<-num-n>
-*/
-static int
-fetch_name_with_level(OnigCodePoint start_code, UChar** src, UChar* end,
- UChar** rname_end, ScanEnv* env,
- int* rback_num, int* rlevel)
-{
- int r, sign, is_num, exist_level;
- OnigCodePoint end_code;
- OnigCodePoint c = 0;
- OnigEncoding enc = env->enc;
- UChar *name_end;
- UChar *pnum_head;
- UChar *p = *src;
- PFETCH_READY;
-
- *rback_num = 0;
- is_num = exist_level = 0;
- sign = 1;
- pnum_head = *src;
-
- end_code = get_name_end_code_point(start_code);
-
- name_end = end;
- r = 0;
- if (PEND) {
- return ONIGERR_EMPTY_GROUP_NAME;
- }
- else {
- PFETCH(c);
- if (c == end_code)
- return ONIGERR_EMPTY_GROUP_NAME;
-
- if (ONIGENC_IS_CODE_DIGIT(enc, c)) {
- is_num = 1;
- }
- else if (c == '-') {
- is_num = 2;
- sign = -1;
- pnum_head = p;
- }
- else if (!ONIGENC_IS_CODE_WORD(enc, c)) {
- r = ONIGERR_INVALID_CHAR_IN_GROUP_NAME;
- }
- }
-
- while (!PEND) {
- name_end = p;
- PFETCH(c);
- if (c == end_code || c == ')' || c == '+' || c == '-') {
- if (is_num == 2) r = ONIGERR_INVALID_GROUP_NAME;
- break;
- }
-
- if (is_num != 0) {
- if (ONIGENC_IS_CODE_DIGIT(enc, c)) {
- is_num = 1;
- }
- else {
- r = ONIGERR_INVALID_GROUP_NAME;
- is_num = 0;
- }
- }
- else if (!ONIGENC_IS_CODE_WORD(enc, c)) {
- r = ONIGERR_INVALID_CHAR_IN_GROUP_NAME;
- }
- }
-
- if (r == 0 && c != end_code) {
- if (c == '+' || c == '-') {
- int level;
- int flag = (c == '-' ? -1 : 1);
-
- PFETCH(c);
- if (! ONIGENC_IS_CODE_DIGIT(enc, c)) goto err;
- PUNFETCH;
- level = onig_scan_unsigned_number(&p, end, enc);
- if (level < 0) return ONIGERR_TOO_BIG_NUMBER;
- *rlevel = (level * flag);
- exist_level = 1;
-
- PFETCH(c);
- if (c == end_code)
- goto end;
- }
-
- err:
- r = ONIGERR_INVALID_GROUP_NAME;
- name_end = end;
- }
-
- end:
- if (r == 0) {
- if (is_num != 0) {
- *rback_num = onig_scan_unsigned_number(&pnum_head, name_end, enc);
- if (*rback_num < 0) return ONIGERR_TOO_BIG_NUMBER;
- else if (*rback_num == 0) goto err;
-
- *rback_num *= sign;
- }
-
- *rname_end = name_end;
- *src = p;
- return (exist_level ? 1 : 0);
- }
- else {
- onig_scan_env_set_error_string(env, r, *src, name_end);
- return r;
- }
-}
-#endif /* USE_BACKREF_WITH_LEVEL */
-
-/*
- def: 0 -> define name (don't allow number name)
- 1 -> reference name (allow number name)
-*/
-static int
-fetch_name(OnigCodePoint start_code, UChar** src, UChar* end,
- UChar** rname_end, ScanEnv* env, int* rback_num, int ref)
-{
- int r, is_num, sign;
- OnigCodePoint end_code;
- OnigCodePoint c = 0;
- OnigEncoding enc = env->enc;
- UChar *name_end;
- UChar *pnum_head;
- UChar *p = *src;
- PFETCH_READY;
-
- *rback_num = 0;
-
- end_code = get_name_end_code_point(start_code);
-
- name_end = end;
- pnum_head = *src;
- r = 0;
- is_num = 0;
- sign = 1;
- if (PEND) {
- return ONIGERR_EMPTY_GROUP_NAME;
- }
- else {
- PFETCH(c);
- if (c == end_code)
- return ONIGERR_EMPTY_GROUP_NAME;
-
- if (ONIGENC_IS_CODE_DIGIT(enc, c)) {
- if (ref == 1)
- is_num = 1;
- else {
- r = ONIGERR_INVALID_GROUP_NAME;
- is_num = 0;
- }
- }
- else if (c == '-') {
- if (ref == 1) {
- is_num = 2;
- sign = -1;
- pnum_head = p;
- }
- else {
- r = ONIGERR_INVALID_GROUP_NAME;
- is_num = 0;
- }
- }
- else if (!ONIGENC_IS_CODE_WORD(enc, c)) {
- r = ONIGERR_INVALID_CHAR_IN_GROUP_NAME;
- }
- }
-
- if (r == 0) {
- while (!PEND) {
- name_end = p;
- PFETCH(c);
- if (c == end_code || c == ')') {
- if (is_num == 2) r = ONIGERR_INVALID_GROUP_NAME;
- break;
- }
-
- if (is_num != 0) {
- if (ONIGENC_IS_CODE_DIGIT(enc, c)) {
- is_num = 1;
- }
- else {
- if (!ONIGENC_IS_CODE_WORD(enc, c))
- r = ONIGERR_INVALID_CHAR_IN_GROUP_NAME;
- else
- r = ONIGERR_INVALID_GROUP_NAME;
-
- is_num = 0;
- }
- }
- else {
- if (!ONIGENC_IS_CODE_WORD(enc, c)) {
- r = ONIGERR_INVALID_CHAR_IN_GROUP_NAME;
- }
- }
- }
-
- if (c != end_code) {
- r = ONIGERR_INVALID_GROUP_NAME;
- name_end = end;
- }
-
- if (is_num != 0) {
- *rback_num = onig_scan_unsigned_number(&pnum_head, name_end, enc);
- if (*rback_num < 0) return ONIGERR_TOO_BIG_NUMBER;
- else if (*rback_num == 0) {
- r = ONIGERR_INVALID_GROUP_NAME;
- goto err;
- }
-
- *rback_num *= sign;
- }
-
- *rname_end = name_end;
- *src = p;
- return 0;
- }
- else {
- while (!PEND) {
- name_end = p;
- PFETCH(c);
- if (c == end_code || c == ')')
- break;
- }
- if (PEND)
- name_end = end;
-
- err:
- onig_scan_env_set_error_string(env, r, *src, name_end);
- return r;
- }
-}
-#else
-static int
-fetch_name(OnigCodePoint start_code, UChar** src, UChar* end,
- UChar** rname_end, ScanEnv* env, int* rback_num, int ref)
-{
- int r, is_num, sign;
- OnigCodePoint end_code;
- OnigCodePoint c = 0;
- UChar *name_end;
- OnigEncoding enc = env->enc;
- UChar *pnum_head;
- UChar *p = *src;
- PFETCH_READY;
-
- *rback_num = 0;
-
- end_code = get_name_end_code_point(start_code);
-
- *rname_end = name_end = end;
- r = 0;
- pnum_head = *src;
- is_num = 0;
- sign = 1;
-
- if (PEND) {
- return ONIGERR_EMPTY_GROUP_NAME;
- }
- else {
- PFETCH(c);
- if (c == end_code)
- return ONIGERR_EMPTY_GROUP_NAME;
-
- if (ONIGENC_IS_CODE_DIGIT(enc, c)) {
- is_num = 1;
- }
- else if (c == '-') {
- is_num = 2;
- sign = -1;
- pnum_head = p;
- }
- else {
- r = ONIGERR_INVALID_CHAR_IN_GROUP_NAME;
- }
- }
-
- while (!PEND) {
- name_end = p;
-
- PFETCH(c);
- if (c == end_code || c == ')') break;
- if (! ONIGENC_IS_CODE_DIGIT(enc, c))
- r = ONIGERR_INVALID_CHAR_IN_GROUP_NAME;
- }
- if (r == 0 && c != end_code) {
- r = ONIGERR_INVALID_GROUP_NAME;
- name_end = end;
- }
-
- if (r == 0) {
- *rback_num = onig_scan_unsigned_number(&pnum_head, name_end, enc);
- if (*rback_num < 0) return ONIGERR_TOO_BIG_NUMBER;
- else if (*rback_num == 0) {
- r = ONIGERR_INVALID_GROUP_NAME;
- goto err;
- }
- *rback_num *= sign;
-
- *rname_end = name_end;
- *src = p;
- return 0;
- }
- else {
- err:
- onig_scan_env_set_error_string(env, r, *src, name_end);
- return r;
- }
-}
-#endif /* USE_NAMED_GROUP */
-
-static void
-CC_ESC_WARN(ScanEnv* env, UChar *c)
-{
- if (onig_warn == onig_null_warn) return ;
-
- if (IS_SYNTAX_BV(env->syntax, ONIG_SYN_WARN_CC_OP_NOT_ESCAPED) &&
- IS_SYNTAX_BV(env->syntax, ONIG_SYN_BACKSLASH_ESCAPE_IN_CC)) {
- UChar buf[WARN_BUFSIZE];
- onig_snprintf_with_pattern(buf, WARN_BUFSIZE, env->enc,
- env->pattern, env->pattern_end,
- (UChar* )"character class has '%s' without escape", c);
- (*onig_warn)((char* )buf);
- }
-}
-
-static void
-CLOSE_BRACKET_WITHOUT_ESC_WARN(ScanEnv* env, UChar* c)
-{
- if (onig_warn == onig_null_warn) return ;
-
- if (IS_SYNTAX_BV((env)->syntax, ONIG_SYN_WARN_CC_OP_NOT_ESCAPED)) {
- UChar buf[WARN_BUFSIZE];
- onig_snprintf_with_pattern(buf, WARN_BUFSIZE, (env)->enc,
- (env)->pattern, (env)->pattern_end,
- (UChar* )"regular expression has '%s' without escape", c);
- (*onig_warn)((char* )buf);
- }
-}
-
-static UChar*
-find_str_position(OnigCodePoint s[], int n, UChar* from, UChar* to,
- UChar **next, OnigEncoding enc)
-{
- int i;
- OnigCodePoint x;
- UChar *q;
- UChar *p = from;
-
- while (p < to) {
- x = ONIGENC_MBC_TO_CODE(enc, p, to);
- q = p + enclen(enc, p, to);
- if (x == s[0]) {
- for (i = 1; i < n && q < to; i++) {
- x = ONIGENC_MBC_TO_CODE(enc, q, to);
- if (x != s[i]) break;
- q += enclen(enc, q, to);
- }
- if (i >= n) {
- if (IS_NOT_NULL(next))
- *next = q;
- return p;
- }
- }
- p = q;
- }
- return NULL_UCHARP;
-}
-
-static int
-str_exist_check_with_esc(OnigCodePoint s[], int n, UChar* from, UChar* to,
- OnigCodePoint bad, OnigEncoding enc, const OnigSyntaxType* syn)
-{
- int i, in_esc;
- OnigCodePoint x;
- UChar *q;
- UChar *p = from;
-
- in_esc = 0;
- while (p < to) {
- if (in_esc) {
- in_esc = 0;
- p += enclen(enc, p, to);
- }
- else {
- x = ONIGENC_MBC_TO_CODE(enc, p, to);
- q = p + enclen(enc, p, to);
- if (x == s[0]) {
- for (i = 1; i < n && q < to; i++) {
- x = ONIGENC_MBC_TO_CODE(enc, q, to);
- if (x != s[i]) break;
- q += enclen(enc, q, to);
- }
- if (i >= n) return 1;
- p += enclen(enc, p, to);
- }
- else {
- x = ONIGENC_MBC_TO_CODE(enc, p, to);
- if (x == bad) return 0;
- else if (x == MC_ESC(syn)) in_esc = 1;
- p = q;
- }
- }
- }
- return 0;
-}
-
-static int
-fetch_token_in_cc(OnigToken* tok, UChar** src, UChar* end, ScanEnv* env)
-{
- int num;
- OnigCodePoint c, c2;
- const OnigSyntaxType* syn = env->syntax;
- OnigEncoding enc = env->enc;
- UChar* prev;
- UChar* p = *src;
- PFETCH_READY;
-
- if (PEND) {
- tok->type = TK_EOT;
- return tok->type;
- }
-
- PFETCH(c);
- tok->type = TK_CHAR;
- tok->base = 0;
- tok->u.c = c;
- tok->escaped = 0;
-
- if (c == ']') {
- tok->type = TK_CC_CLOSE;
- }
- else if (c == '-') {
- tok->type = TK_CC_RANGE;
- }
- else if (c == MC_ESC(syn)) {
- if (! IS_SYNTAX_BV(syn, ONIG_SYN_BACKSLASH_ESCAPE_IN_CC))
- goto end;
-
- if (PEND) return ONIGERR_END_PATTERN_AT_ESCAPE;
-
- PFETCH(c);
- tok->escaped = 1;
- tok->u.c = c;
- switch (c) {
- case 'w':
- tok->type = TK_CHAR_TYPE;
- tok->u.prop.ctype = ONIGENC_CTYPE_WORD;
- tok->u.prop.not = 0;
- break;
- case 'W':
- tok->type = TK_CHAR_TYPE;
- tok->u.prop.ctype = ONIGENC_CTYPE_WORD;
- tok->u.prop.not = 1;
- break;
- case 'd':
- tok->type = TK_CHAR_TYPE;
- tok->u.prop.ctype = ONIGENC_CTYPE_DIGIT;
- tok->u.prop.not = 0;
- break;
- case 'D':
- tok->type = TK_CHAR_TYPE;
- tok->u.prop.ctype = ONIGENC_CTYPE_DIGIT;
- tok->u.prop.not = 1;
- break;
- case 's':
- tok->type = TK_CHAR_TYPE;
- tok->u.prop.ctype = ONIGENC_CTYPE_SPACE;
- tok->u.prop.not = 0;
- break;
- case 'S':
- tok->type = TK_CHAR_TYPE;
- tok->u.prop.ctype = ONIGENC_CTYPE_SPACE;
- tok->u.prop.not = 1;
- break;
- case 'h':
- if (! IS_SYNTAX_OP2(syn, ONIG_SYN_OP2_ESC_H_XDIGIT)) break;
- tok->type = TK_CHAR_TYPE;
- tok->u.prop.ctype = ONIGENC_CTYPE_XDIGIT;
- tok->u.prop.not = 0;
- break;
- case 'H':
- if (! IS_SYNTAX_OP2(syn, ONIG_SYN_OP2_ESC_H_XDIGIT)) break;
- tok->type = TK_CHAR_TYPE;
- tok->u.prop.ctype = ONIGENC_CTYPE_XDIGIT;
- tok->u.prop.not = 1;
- break;
-
- case 'p':
- case 'P':
- c2 = PPEEK;
- if (c2 == '{' &&
- IS_SYNTAX_OP2(syn, ONIG_SYN_OP2_ESC_P_BRACE_CHAR_PROPERTY)) {
- PINC;
- tok->type = TK_CHAR_PROPERTY;
- tok->u.prop.not = (c == 'P' ? 1 : 0);
-
- if (IS_SYNTAX_OP2(syn, ONIG_SYN_OP2_ESC_P_BRACE_CIRCUMFLEX_NOT)) {
- PFETCH(c2);
- if (c2 == '^') {
- tok->u.prop.not = (tok->u.prop.not == 0 ? 1 : 0);
- }
- else
- PUNFETCH;
- }
- }
- break;
-
- case 'x':
- if (PEND) break;
-
- prev = p;
- if (PPEEK_IS('{') && IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_X_BRACE_HEX8)) {
- PINC;
- num = scan_unsigned_hexadecimal_number(&p, end, 8, enc);
- if (num < 0) return ONIGERR_TOO_BIG_WIDE_CHAR_VALUE;
- if (!PEND) {
- c2 = PPEEK;
- if (ONIGENC_IS_CODE_XDIGIT(enc, c2))
- return ONIGERR_TOO_LONG_WIDE_CHAR_VALUE;
- }
-
- if (p > prev + enclen(enc, prev, end) && !PEND && (PPEEK_IS('}'))) {
- PINC;
- tok->type = TK_CODE_POINT;
- tok->base = 16;
- tok->u.code = (OnigCodePoint )num;
- }
- else {
- /* can't read nothing or invalid format */
- p = prev;
- }
- }
- else if (IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_X_HEX2)) {
- num = scan_unsigned_hexadecimal_number(&p, end, 2, enc);
- if (num < 0) return ONIGERR_TOO_BIG_NUMBER;
- if (p == prev) { /* can't read nothing. */
- num = 0; /* but, it's not error */
- }
- tok->type = TK_RAW_BYTE;
- tok->base = 16;
- tok->u.c = num;
- }
- break;
-
- case 'u':
- if (PEND) break;
-
- prev = p;
- if (IS_SYNTAX_OP2(syn, ONIG_SYN_OP2_ESC_U_HEX4)) {
- num = scan_unsigned_hexadecimal_number(&p, end, 4, enc);
- if (num < 0) return ONIGERR_TOO_BIG_NUMBER;
- if (p == prev) { /* can't read nothing. */
- num = 0; /* but, it's not error */
- }
- tok->type = TK_CODE_POINT;
- tok->base = 16;
- tok->u.code = (OnigCodePoint )num;
- }
- break;
-
- case '0':
- case '1': case '2': case '3': case '4': case '5': case '6': case '7':
- if (IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_OCTAL3)) {
- PUNFETCH;
- prev = p;
- num = scan_unsigned_octal_number(&p, end, 3, enc);
- if (num < 0) return ONIGERR_TOO_BIG_NUMBER;
- if (p == prev) { /* can't read nothing. */
- num = 0; /* but, it's not error */
- }
- tok->type = TK_RAW_BYTE;
- tok->base = 8;
- tok->u.c = num;
- }
- break;
-
- default:
- PUNFETCH;
- num = fetch_escaped_value(&p, end, env);
- if (num < 0) return num;
- if (tok->u.c != num) {
- tok->u.code = (OnigCodePoint )num;
- tok->type = TK_CODE_POINT;
- }
- break;
- }
- }
- else if (c == '[') {
- if (IS_SYNTAX_OP(syn, ONIG_SYN_OP_POSIX_BRACKET) && (PPEEK_IS(':'))) {
- OnigCodePoint send[] = { (OnigCodePoint )':', (OnigCodePoint )']' };
- tok->backp = p; /* point at '[' is readed */
- PINC;
- if (str_exist_check_with_esc(send, 2, p, end,
- (OnigCodePoint )']', enc, syn)) {
- tok->type = TK_POSIX_BRACKET_OPEN;
- }
- else {
- PUNFETCH;
- goto cc_in_cc;
- }
- }
- else {
- cc_in_cc:
- if (IS_SYNTAX_OP2(syn, ONIG_SYN_OP2_CCLASS_SET_OP)) {
- tok->type = TK_CC_CC_OPEN;
- }
- else {
- CC_ESC_WARN(env, (UChar* )"[");
- }
- }
- }
- else if (c == '&') {
- if (IS_SYNTAX_OP2(syn, ONIG_SYN_OP2_CCLASS_SET_OP) &&
- !PEND && (PPEEK_IS('&'))) {
- PINC;
- tok->type = TK_CC_AND;
- }
- }
-
- end:
- *src = p;
- return tok->type;
-}
-
-static int
-fetch_token(OnigToken* tok, UChar** src, UChar* end, ScanEnv* env)
-{
- int r, num;
- OnigCodePoint c;
- OnigEncoding enc = env->enc;
- const OnigSyntaxType* syn = env->syntax;
- UChar* prev;
- UChar* p = *src;
- PFETCH_READY;
-
- start:
- if (PEND) {
- tok->type = TK_EOT;
- return tok->type;
- }
-
- tok->type = TK_STRING;
- tok->base = 0;
- tok->backp = p;
-
- PFETCH(c);
- if (IS_MC_ESC_CODE(c, syn)) {
- if (PEND) return ONIGERR_END_PATTERN_AT_ESCAPE;
-
- tok->backp = p;
- PFETCH(c);
-
- tok->u.c = c;
- tok->escaped = 1;
- switch (c) {
- case '*':
- if (! IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_ASTERISK_ZERO_INF)) break;
- tok->type = TK_OP_REPEAT;
- tok->u.repeat.lower = 0;
- tok->u.repeat.upper = REPEAT_INFINITE;
- goto greedy_check;
- break;
-
- case '+':
- if (! IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_PLUS_ONE_INF)) break;
- tok->type = TK_OP_REPEAT;
- tok->u.repeat.lower = 1;
- tok->u.repeat.upper = REPEAT_INFINITE;
- goto greedy_check;
- break;
-
- case '?':
- if (! IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_QMARK_ZERO_ONE)) break;
- tok->type = TK_OP_REPEAT;
- tok->u.repeat.lower = 0;
- tok->u.repeat.upper = 1;
- greedy_check:
- if (!PEND && PPEEK_IS('?') &&
- IS_SYNTAX_OP(syn, ONIG_SYN_OP_QMARK_NON_GREEDY)) {
- PFETCH(c);
- tok->u.repeat.greedy = 0;
- tok->u.repeat.possessive = 0;
- }
- else {
- possessive_check:
- if (!PEND && PPEEK_IS('+') &&
- ((IS_SYNTAX_OP2(syn, ONIG_SYN_OP2_PLUS_POSSESSIVE_REPEAT) &&
- tok->type != TK_INTERVAL) ||
- (IS_SYNTAX_OP2(syn, ONIG_SYN_OP2_PLUS_POSSESSIVE_INTERVAL) &&
- tok->type == TK_INTERVAL))) {
- PFETCH(c);
- tok->u.repeat.greedy = 1;
- tok->u.repeat.possessive = 1;
- }
- else {
- tok->u.repeat.greedy = 1;
- tok->u.repeat.possessive = 0;
- }
- }
- break;
-
- case '{':
- if (! IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_BRACE_INTERVAL)) break;
- r = fetch_range_quantifier(&p, end, tok, env);
- if (r < 0) return r; /* error */
- if (r == 0) goto greedy_check;
- else if (r == 2) { /* {n} */
- if (IS_SYNTAX_BV(syn, ONIG_SYN_FIXED_INTERVAL_IS_GREEDY_ONLY))
- goto possessive_check;
-
- goto greedy_check;
- }
- /* r == 1 : normal char */
- break;
-
- case '|':
- if (! IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_VBAR_ALT)) break;
- tok->type = TK_ALT;
- break;
-
- case '(':
- if (! IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_LPAREN_SUBEXP)) break;
- tok->type = TK_SUBEXP_OPEN;
- break;
-
- case ')':
- if (! IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_LPAREN_SUBEXP)) break;
- tok->type = TK_SUBEXP_CLOSE;
- break;
-
- case 'w':
- if (! IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_W_WORD)) break;
- tok->type = TK_CHAR_TYPE;
- tok->u.prop.ctype = ONIGENC_CTYPE_WORD;
- tok->u.prop.not = 0;
- break;
-
- case 'W':
- if (! IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_W_WORD)) break;
- tok->type = TK_CHAR_TYPE;
- tok->u.prop.ctype = ONIGENC_CTYPE_WORD;
- tok->u.prop.not = 1;
- break;
-
- case 'b':
- if (! IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_B_WORD_BOUND)) break;
- tok->type = TK_ANCHOR;
- tok->u.anchor = ANCHOR_WORD_BOUND;
- break;
-
- case 'B':
- if (! IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_B_WORD_BOUND)) break;
- tok->type = TK_ANCHOR;
- tok->u.anchor = ANCHOR_NOT_WORD_BOUND;
- break;
-
-#ifdef USE_WORD_BEGIN_END
- case '<':
- if (! IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_LTGT_WORD_BEGIN_END)) break;
- tok->type = TK_ANCHOR;
- tok->u.anchor = ANCHOR_WORD_BEGIN;
- break;
-
- case '>':
- if (! IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_LTGT_WORD_BEGIN_END)) break;
- tok->type = TK_ANCHOR;
- tok->u.anchor = ANCHOR_WORD_END;
- break;
-#endif
-
- case 's':
- if (! IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_S_WHITE_SPACE)) break;
- tok->type = TK_CHAR_TYPE;
- tok->u.prop.ctype = ONIGENC_CTYPE_SPACE;
- tok->u.prop.not = 0;
- break;
-
- case 'S':
- if (! IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_S_WHITE_SPACE)) break;
- tok->type = TK_CHAR_TYPE;
- tok->u.prop.ctype = ONIGENC_CTYPE_SPACE;
- tok->u.prop.not = 1;
- break;
-
- case 'd':
- if (! IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_D_DIGIT)) break;
- tok->type = TK_CHAR_TYPE;
- tok->u.prop.ctype = ONIGENC_CTYPE_DIGIT;
- tok->u.prop.not = 0;
- break;
-
- case 'D':
- if (! IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_D_DIGIT)) break;
- tok->type = TK_CHAR_TYPE;
- tok->u.prop.ctype = ONIGENC_CTYPE_DIGIT;
- tok->u.prop.not = 1;
- break;
-
- case 'h':
- if (! IS_SYNTAX_OP2(syn, ONIG_SYN_OP2_ESC_H_XDIGIT)) break;
- tok->type = TK_CHAR_TYPE;
- tok->u.prop.ctype = ONIGENC_CTYPE_XDIGIT;
- tok->u.prop.not = 0;
- break;
-
- case 'H':
- if (! IS_SYNTAX_OP2(syn, ONIG_SYN_OP2_ESC_H_XDIGIT)) break;
- tok->type = TK_CHAR_TYPE;
- tok->u.prop.ctype = ONIGENC_CTYPE_XDIGIT;
- tok->u.prop.not = 1;
- break;
-
- case 'A':
- if (! IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_AZ_BUF_ANCHOR)) break;
- begin_buf:
- tok->type = TK_ANCHOR;
- tok->u.subtype = ANCHOR_BEGIN_BUF;
- break;
-
- case 'Z':
- if (! IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_AZ_BUF_ANCHOR)) break;
- tok->type = TK_ANCHOR;
- tok->u.subtype = ANCHOR_SEMI_END_BUF;
- break;
-
- case 'z':
- if (! IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_AZ_BUF_ANCHOR)) break;
- end_buf:
- tok->type = TK_ANCHOR;
- tok->u.subtype = ANCHOR_END_BUF;
- break;
-
- case 'G':
- if (! IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_CAPITAL_G_BEGIN_ANCHOR)) break;
- tok->type = TK_ANCHOR;
- tok->u.subtype = ANCHOR_BEGIN_POSITION;
- break;
-
- case '`':
- if (! IS_SYNTAX_OP2(syn, ONIG_SYN_OP2_ESC_GNU_BUF_ANCHOR)) break;
- goto begin_buf;
- break;
-
- case '\'':
- if (! IS_SYNTAX_OP2(syn, ONIG_SYN_OP2_ESC_GNU_BUF_ANCHOR)) break;
- goto end_buf;
- break;
-
- case 'x':
- if (PEND) break;
-
- prev = p;
- if (PPEEK_IS('{') && IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_X_BRACE_HEX8)) {
- PINC;
- num = scan_unsigned_hexadecimal_number(&p, end, 8, enc);
- if (num < 0) return ONIGERR_TOO_BIG_WIDE_CHAR_VALUE;
- if (!PEND) {
- if (ONIGENC_IS_CODE_XDIGIT(enc, PPEEK))
- return ONIGERR_TOO_LONG_WIDE_CHAR_VALUE;
- }
-
- if ((p > prev + enclen(enc, prev, end)) && !PEND && PPEEK_IS('}')) {
- PINC;
- tok->type = TK_CODE_POINT;
- tok->u.code = (OnigCodePoint )num;
- }
- else {
- /* can't read nothing or invalid format */
- p = prev;
- }
- }
- else if (IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_X_HEX2)) {
- num = scan_unsigned_hexadecimal_number(&p, end, 2, enc);
- if (num < 0) return ONIGERR_TOO_BIG_NUMBER;
- if (p == prev) { /* can't read nothing. */
- num = 0; /* but, it's not error */
- }
- tok->type = TK_RAW_BYTE;
- tok->base = 16;
- tok->u.c = num;
- }
- break;
-
- case 'u':
- if (PEND) break;
-
- prev = p;
- if (IS_SYNTAX_OP2(syn, ONIG_SYN_OP2_ESC_U_HEX4)) {
- num = scan_unsigned_hexadecimal_number(&p, end, 4, enc);
- if (num < 0) return ONIGERR_TOO_BIG_NUMBER;
- if (p == prev) { /* can't read nothing. */
- num = 0; /* but, it's not error */
- }
- tok->type = TK_CODE_POINT;
- tok->base = 16;
- tok->u.code = (OnigCodePoint )num;
- }
- break;
-
- case '1': case '2': case '3': case '4':
- case '5': case '6': case '7': case '8': case '9':
- PUNFETCH;
- prev = p;
- num = onig_scan_unsigned_number(&p, end, enc);
- if (num < 0 || num > ONIG_MAX_BACKREF_NUM) {
- goto skip_backref;
- }
-
- if (IS_SYNTAX_OP(syn, ONIG_SYN_OP_DECIMAL_BACKREF) &&
- (num <= env->num_mem || num <= 9)) { /* This spec. from GNU regex */
- if (IS_SYNTAX_BV(syn, ONIG_SYN_STRICT_CHECK_BACKREF)) {
- if (num > env->num_mem || IS_NULL(SCANENV_MEM_NODES(env)[num]))
- return ONIGERR_INVALID_BACKREF;
- }
-
- tok->type = TK_BACKREF;
- tok->u.backref.num = 1;
- tok->u.backref.ref1 = num;
- tok->u.backref.by_name = 0;
-#ifdef USE_BACKREF_WITH_LEVEL
- tok->u.backref.exist_level = 0;
-#endif
- break;
- }
-
- skip_backref:
- if (c == '8' || c == '9') {
- /* normal char */
- p = prev; PINC;
- break;
- }
-
- p = prev;
- /* fall through */
- case '0':
- if (IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_OCTAL3)) {
- prev = p;
- num = scan_unsigned_octal_number(&p, end, (c == '0' ? 2:3), enc);
- if (num < 0) return ONIGERR_TOO_BIG_NUMBER;
- if (p == prev) { /* can't read nothing. */
- num = 0; /* but, it's not error */
- }
- tok->type = TK_RAW_BYTE;
- tok->base = 8;
- tok->u.c = num;
- }
- else if (c != '0') {
- PINC;
- }
- break;
-
-#ifdef USE_NAMED_GROUP
- case 'k':
- if (IS_SYNTAX_OP2(syn, ONIG_SYN_OP2_ESC_K_NAMED_BACKREF)) {
- PFETCH(c);
- if (c == '<' || c == '\'') {
- UChar* name_end;
- int* backs;
- int back_num;
-
- prev = p;
-
-#ifdef USE_BACKREF_WITH_LEVEL
- name_end = NULL_UCHARP; /* no need. escape gcc warning. */
- r = fetch_name_with_level((OnigCodePoint )c, &p, end, &name_end,
- env, &back_num, &tok->u.backref.level);
- if (r == 1) tok->u.backref.exist_level = 1;
- else tok->u.backref.exist_level = 0;
-#else
- r = fetch_name(&p, end, &name_end, env, &back_num, 1);
-#endif
- if (r < 0) return r;
-
- if (back_num != 0) {
- if (back_num < 0) {
- back_num = BACKREF_REL_TO_ABS(back_num, env);
- if (back_num <= 0)
- return ONIGERR_INVALID_BACKREF;
- }
-
- if (IS_SYNTAX_BV(syn, ONIG_SYN_STRICT_CHECK_BACKREF)) {
- if (back_num > env->num_mem ||
- IS_NULL(SCANENV_MEM_NODES(env)[back_num]))
- return ONIGERR_INVALID_BACKREF;
- }
- tok->type = TK_BACKREF;
- tok->u.backref.by_name = 0;
- tok->u.backref.num = 1;
- tok->u.backref.ref1 = back_num;
- }
- else {
- num = onig_name_to_group_numbers(env->reg, prev, name_end, &backs);
- if (num <= 0) {
- onig_scan_env_set_error_string(env,
- ONIGERR_UNDEFINED_NAME_REFERENCE, prev, name_end);
- return ONIGERR_UNDEFINED_NAME_REFERENCE;
- }
- if (IS_SYNTAX_BV(syn, ONIG_SYN_STRICT_CHECK_BACKREF)) {
- int i;
- for (i = 0; i < num; i++) {
- if (backs[i] > env->num_mem ||
- IS_NULL(SCANENV_MEM_NODES(env)[backs[i]]))
- return ONIGERR_INVALID_BACKREF;
- }
- }
-
- tok->type = TK_BACKREF;
- tok->u.backref.by_name = 1;
- if (num == 1) {
- tok->u.backref.num = 1;
- tok->u.backref.ref1 = backs[0];
- }
- else {
- tok->u.backref.num = num;
- tok->u.backref.refs = backs;
- }
- }
- }
- else
- PUNFETCH;
- }
- break;
-#endif
-
-#ifdef USE_SUBEXP_CALL
- case 'g':
- if (IS_SYNTAX_OP2(syn, ONIG_SYN_OP2_ESC_G_SUBEXP_CALL)) {
- PFETCH(c);
- if (c == '<' || c == '\'') {
- int gnum;
- UChar* name_end;
-
- prev = p;
- r = fetch_name((OnigCodePoint )c, &p, end, &name_end, env, &gnum, 1);
- if (r < 0) return r;
-
- tok->type = TK_CALL;
- tok->u.call.name = prev;
- tok->u.call.name_end = name_end;
- tok->u.call.gnum = gnum;
- }
- else
- PUNFETCH;
- }
- break;
-#endif
-
- case 'Q':
- if (IS_SYNTAX_OP2(syn, ONIG_SYN_OP2_ESC_CAPITAL_Q_QUOTE)) {
- tok->type = TK_QUOTE_OPEN;
- }
- break;
-
- case 'p':
- case 'P':
- if (PPEEK_IS('{') &&
- IS_SYNTAX_OP2(syn, ONIG_SYN_OP2_ESC_P_BRACE_CHAR_PROPERTY)) {
- PINC;
- tok->type = TK_CHAR_PROPERTY;
- tok->u.prop.not = (c == 'P' ? 1 : 0);
-
- if (IS_SYNTAX_OP2(syn, ONIG_SYN_OP2_ESC_P_BRACE_CIRCUMFLEX_NOT)) {
- PFETCH(c);
- if (c == '^') {
- tok->u.prop.not = (tok->u.prop.not == 0 ? 1 : 0);
- }
- else
- PUNFETCH;
- }
- }
- break;
-
- default:
- PUNFETCH;
- num = fetch_escaped_value(&p, end, env);
- if (num < 0) return num;
- /* set_raw: */
- if (tok->u.c != num) {
- tok->type = TK_CODE_POINT;
- tok->u.code = (OnigCodePoint )num;
- }
- else { /* string */
- p = tok->backp + enclen(enc, tok->backp, end);
- }
- break;
- }
- }
- else {
- tok->u.c = c;
- tok->escaped = 0;
-
-#ifdef USE_VARIABLE_META_CHARS
- if ((c != ONIG_INEFFECTIVE_META_CHAR) &&
- IS_SYNTAX_OP(syn, ONIG_SYN_OP_VARIABLE_META_CHARACTERS)) {
- if (c == MC_ANYCHAR(syn))
- goto any_char;
- else if (c == MC_ANYTIME(syn))
- goto anytime;
- else if (c == MC_ZERO_OR_ONE_TIME(syn))
- goto zero_or_one_time;
- else if (c == MC_ONE_OR_MORE_TIME(syn))
- goto one_or_more_time;
- else if (c == MC_ANYCHAR_ANYTIME(syn)) {
- tok->type = TK_ANYCHAR_ANYTIME;
- goto out;
- }
- }
-#endif
-
- switch (c) {
- case '.':
- if (! IS_SYNTAX_OP(syn, ONIG_SYN_OP_DOT_ANYCHAR)) break;
-#ifdef USE_VARIABLE_META_CHARS
- any_char:
-#endif
- tok->type = TK_ANYCHAR;
- break;
-
- case '*':
- if (! IS_SYNTAX_OP(syn, ONIG_SYN_OP_ASTERISK_ZERO_INF)) break;
-#ifdef USE_VARIABLE_META_CHARS
- anytime:
-#endif
- tok->type = TK_OP_REPEAT;
- tok->u.repeat.lower = 0;
- tok->u.repeat.upper = REPEAT_INFINITE;
- goto greedy_check;
- break;
-
- case '+':
- if (! IS_SYNTAX_OP(syn, ONIG_SYN_OP_PLUS_ONE_INF)) break;
-#ifdef USE_VARIABLE_META_CHARS
- one_or_more_time:
-#endif
- tok->type = TK_OP_REPEAT;
- tok->u.repeat.lower = 1;
- tok->u.repeat.upper = REPEAT_INFINITE;
- goto greedy_check;
- break;
-
- case '?':
- if (! IS_SYNTAX_OP(syn, ONIG_SYN_OP_QMARK_ZERO_ONE)) break;
-#ifdef USE_VARIABLE_META_CHARS
- zero_or_one_time:
-#endif
- tok->type = TK_OP_REPEAT;
- tok->u.repeat.lower = 0;
- tok->u.repeat.upper = 1;
- goto greedy_check;
- break;
-
- case '{':
- if (! IS_SYNTAX_OP(syn, ONIG_SYN_OP_BRACE_INTERVAL)) break;
- r = fetch_range_quantifier(&p, end, tok, env);
- if (r < 0) return r; /* error */
- if (r == 0) goto greedy_check;
- else if (r == 2) { /* {n} */
- if (IS_SYNTAX_BV(syn, ONIG_SYN_FIXED_INTERVAL_IS_GREEDY_ONLY))
- goto possessive_check;
-
- goto greedy_check;
- }
- /* r == 1 : normal char */
- break;
-
- case '|':
- if (! IS_SYNTAX_OP(syn, ONIG_SYN_OP_VBAR_ALT)) break;
- tok->type = TK_ALT;
- break;
-
- case '(':
- if (PPEEK_IS('?') &&
- IS_SYNTAX_OP2(syn, ONIG_SYN_OP2_QMARK_GROUP_EFFECT)) {
- PINC;
- if (PPEEK_IS('#')) {
- PFETCH(c);
- while (1) {
- if (PEND) return ONIGERR_END_PATTERN_IN_GROUP;
- PFETCH(c);
- if (c == MC_ESC(syn)) {
- if (!PEND) PFETCH(c);
- }
- else {
- if (c == ')') break;
- }
- }
- goto start;
- }
- PUNFETCH;
- }
-
- if (! IS_SYNTAX_OP(syn, ONIG_SYN_OP_LPAREN_SUBEXP)) break;
- tok->type = TK_SUBEXP_OPEN;
- break;
-
- case ')':
- if (! IS_SYNTAX_OP(syn, ONIG_SYN_OP_LPAREN_SUBEXP)) break;
- tok->type = TK_SUBEXP_CLOSE;
- break;
-
- case '^':
- if (! IS_SYNTAX_OP(syn, ONIG_SYN_OP_LINE_ANCHOR)) break;
- tok->type = TK_ANCHOR;
- tok->u.subtype = (IS_SINGLELINE(env->option)
- ? ANCHOR_BEGIN_BUF : ANCHOR_BEGIN_LINE);
- break;
-
- case '$':
- if (! IS_SYNTAX_OP(syn, ONIG_SYN_OP_LINE_ANCHOR)) break;
- tok->type = TK_ANCHOR;
- tok->u.subtype = (IS_SINGLELINE(env->option)
- ? ANCHOR_SEMI_END_BUF : ANCHOR_END_LINE);
- break;
-
- case '[':
- if (! IS_SYNTAX_OP(syn, ONIG_SYN_OP_BRACKET_CC)) break;
- tok->type = TK_CC_OPEN;
- break;
-
- case ']':
- if (*src > env->pattern) /* /].../ is allowed. */
- CLOSE_BRACKET_WITHOUT_ESC_WARN(env, (UChar* )"]");
- break;
-
- case '#':
- if (IS_EXTEND(env->option)) {
- while (!PEND) {
- PFETCH(c);
- if (ONIGENC_IS_CODE_NEWLINE(enc, c))
- break;
- }
- goto start;
- break;
- }
- break;
-
- case ' ': case '\t': case '\n': case '\r': case '\f':
- if (IS_EXTEND(env->option))
- goto start;
- break;
-
- default:
- /* string */
- break;
- }
- }
-
-#ifdef USE_VARIABLE_META_CHARS
- out:
-#endif
- *src = p;
- return tok->type;
-}
-
-static int
-add_ctype_to_cc_by_range(CClassNode* cc, int ctype ARG_UNUSED, int not,
- OnigEncoding enc ARG_UNUSED,
- OnigCodePoint sb_out, const OnigCodePoint mbr[])
-{
- int i, r;
- OnigCodePoint j;
-
- int n = ONIGENC_CODE_RANGE_NUM(mbr);
-
- if (not == 0) {
- for (i = 0; i < n; i++) {
- for (j = ONIGENC_CODE_RANGE_FROM(mbr, i);
- j <= ONIGENC_CODE_RANGE_TO(mbr, i); j++) {
- if (j >= sb_out) {
- if (j == ONIGENC_CODE_RANGE_TO(mbr, i)) i++;
- else if (j > ONIGENC_CODE_RANGE_FROM(mbr, i)) {
- r = add_code_range_to_buf(&(cc->mbuf), j,
- ONIGENC_CODE_RANGE_TO(mbr, i));
- if (r != 0) return r;
- i++;
- }
-
- goto sb_end;
- }
- BITSET_SET_BIT(cc->bs, j);
- }
- }
-
- sb_end:
- for ( ; i < n; i++) {
- r = add_code_range_to_buf(&(cc->mbuf),
- ONIGENC_CODE_RANGE_FROM(mbr, i),
- ONIGENC_CODE_RANGE_TO(mbr, i));
- if (r != 0) return r;
- }
- }
- else {
- OnigCodePoint prev = 0;
-
- for (i = 0; i < n; i++) {
- for (j = prev;
- j < ONIGENC_CODE_RANGE_FROM(mbr, i); j++) {
- if (j >= sb_out) {
- goto sb_end2;
- }
- BITSET_SET_BIT(cc->bs, j);
- }
- prev = ONIGENC_CODE_RANGE_TO(mbr, i) + 1;
- }
- for (j = prev; j < sb_out; j++) {
- BITSET_SET_BIT(cc->bs, j);
- }
-
- sb_end2:
- prev = sb_out;
-
- for (i = 0; i < n; i++) {
- if (prev < ONIGENC_CODE_RANGE_FROM(mbr, i)) {
- r = add_code_range_to_buf(&(cc->mbuf), prev,
- ONIGENC_CODE_RANGE_FROM(mbr, i) - 1);
- if (r != 0) return r;
- }
- prev = ONIGENC_CODE_RANGE_TO(mbr, i) + 1;
- }
- if (prev < 0x7fffffff) {
- r = add_code_range_to_buf(&(cc->mbuf), prev, 0x7fffffff);
- if (r != 0) return r;
- }
- }
-
- return 0;
-}
-
-static int
-add_ctype_to_cc(CClassNode* cc, int ctype, int not, ScanEnv* env)
-{
- int c, r;
- const OnigCodePoint *ranges;
- OnigCodePoint sb_out;
- OnigEncoding enc = env->enc;
-
- r = ONIGENC_GET_CTYPE_CODE_RANGE(enc, ctype, &sb_out, &ranges);
- if (r == 0) {
- return add_ctype_to_cc_by_range(cc, ctype, not, env->enc, sb_out, ranges);
- }
- else if (r != ONIG_NO_SUPPORT_CONFIG) {
- return r;
- }
-
- r = 0;
- switch (ctype) {
- case ONIGENC_CTYPE_ALPHA:
- case ONIGENC_CTYPE_BLANK:
- case ONIGENC_CTYPE_CNTRL:
- case ONIGENC_CTYPE_DIGIT:
- case ONIGENC_CTYPE_LOWER:
- case ONIGENC_CTYPE_PUNCT:
- case ONIGENC_CTYPE_SPACE:
- case ONIGENC_CTYPE_UPPER:
- case ONIGENC_CTYPE_XDIGIT:
- case ONIGENC_CTYPE_ASCII:
- case ONIGENC_CTYPE_ALNUM:
- if (not != 0) {
- for (c = 0; c < SINGLE_BYTE_SIZE; c++) {
- if (! ONIGENC_IS_CODE_CTYPE(enc, (OnigCodePoint )c, ctype))
- BITSET_SET_BIT(cc->bs, c);
- }
- ADD_ALL_MULTI_BYTE_RANGE(enc, cc->mbuf);
- }
- else {
- for (c = 0; c < SINGLE_BYTE_SIZE; c++) {
- if (ONIGENC_IS_CODE_CTYPE(enc, (OnigCodePoint )c, ctype))
- BITSET_SET_BIT(cc->bs, c);
- }
- }
- break;
-
- case ONIGENC_CTYPE_GRAPH:
- case ONIGENC_CTYPE_PRINT:
- if (not != 0) {
- for (c = 0; c < SINGLE_BYTE_SIZE; c++) {
- if (! ONIGENC_IS_CODE_CTYPE(enc, (OnigCodePoint )c, ctype))
- BITSET_SET_BIT(cc->bs, c);
- }
- }
- else {
- for (c = 0; c < SINGLE_BYTE_SIZE; c++) {
- if (ONIGENC_IS_CODE_CTYPE(enc, (OnigCodePoint )c, ctype))
- BITSET_SET_BIT(cc->bs, c);
- }
- ADD_ALL_MULTI_BYTE_RANGE(enc, cc->mbuf);
- }
- break;
-
- case ONIGENC_CTYPE_WORD:
- if (not == 0) {
- for (c = 0; c < SINGLE_BYTE_SIZE; c++) {
- if (IS_CODE_SB_WORD(enc, c)) BITSET_SET_BIT(cc->bs, c);
- }
- ADD_ALL_MULTI_BYTE_RANGE(enc, cc->mbuf);
- }
- else {
- for (c = 0; c < SINGLE_BYTE_SIZE; c++) {
- if ((ONIGENC_CODE_TO_MBCLEN(enc, c) > 0) /* check invalid code point */
- && ! ONIGENC_IS_CODE_WORD(enc, c))
- BITSET_SET_BIT(cc->bs, c);
- }
- }
- break;
-
- default:
- return ONIGERR_PARSER_BUG;
- break;
- }
-
- return r;
-}
-
-static int
-parse_posix_bracket(CClassNode* cc, UChar** src, UChar* end, ScanEnv* env)
-{
-#define POSIX_BRACKET_CHECK_LIMIT_LENGTH 20
-#define POSIX_BRACKET_NAME_MIN_LEN 4
-
- static const PosixBracketEntryType PBS[] = {
- { (UChar* )"alnum", ONIGENC_CTYPE_ALNUM, 5 },
- { (UChar* )"alpha", ONIGENC_CTYPE_ALPHA, 5 },
- { (UChar* )"blank", ONIGENC_CTYPE_BLANK, 5 },
- { (UChar* )"cntrl", ONIGENC_CTYPE_CNTRL, 5 },
- { (UChar* )"digit", ONIGENC_CTYPE_DIGIT, 5 },
- { (UChar* )"graph", ONIGENC_CTYPE_GRAPH, 5 },
- { (UChar* )"lower", ONIGENC_CTYPE_LOWER, 5 },
- { (UChar* )"print", ONIGENC_CTYPE_PRINT, 5 },
- { (UChar* )"punct", ONIGENC_CTYPE_PUNCT, 5 },
- { (UChar* )"space", ONIGENC_CTYPE_SPACE, 5 },
- { (UChar* )"upper", ONIGENC_CTYPE_UPPER, 5 },
- { (UChar* )"xdigit", ONIGENC_CTYPE_XDIGIT, 6 },
- { (UChar* )"ascii", ONIGENC_CTYPE_ASCII, 5 },
- { (UChar* )"word", ONIGENC_CTYPE_WORD, 4 },
- { (UChar* )NULL, -1, 0 }
- };
-
- const PosixBracketEntryType *pb;
- int not, i, r;
- OnigCodePoint c;
- OnigEncoding enc = env->enc;
- UChar *p = *src;
- PFETCH_READY;
-
- if (PPEEK_IS('^')) {
- PINC;
- not = 1;
- }
- else
- not = 0;
-
- if (onigenc_strlen(enc, p, end) < POSIX_BRACKET_NAME_MIN_LEN + 3)
- goto not_posix_bracket;
-
- for (pb = PBS; IS_NOT_NULL(pb->name); pb++) {
- if (onigenc_with_ascii_strncmp(enc, p, end, pb->name, pb->len) == 0) {
- p = (UChar* )onigenc_step(enc, p, end, pb->len);
- if (onigenc_with_ascii_strncmp(enc, p, end, (UChar* )":]", 2) != 0)
- return ONIGERR_INVALID_POSIX_BRACKET_TYPE;
-
- r = add_ctype_to_cc(cc, pb->ctype, not, env);
- if (r != 0) return r;
-
- PINC; PINC;
- *src = p;
- return 0;
- }
- }
-
- not_posix_bracket:
- c = 0;
- i = 0;
- while (!PEND && ((c = PPEEK) != ':') && c != ']') {
- PINC;
- if (++i > POSIX_BRACKET_CHECK_LIMIT_LENGTH) break;
- }
- if (c == ':' && ! PEND) {
- PINC;
- if (! PEND) {
- PFETCH(c);
- if (c == ']')
- return ONIGERR_INVALID_POSIX_BRACKET_TYPE;
- }
- }
-
- return 1; /* 1: is not POSIX bracket, but no error. */
-}
-
-static int
-fetch_char_property_to_ctype(UChar** src, UChar* end, ScanEnv* env)
-{
- int r;
- OnigCodePoint c;
- OnigEncoding enc = env->enc;
- UChar *prev, *start, *p = *src;
- PFETCH_READY;
-
- r = 0;
- start = prev = p;
-
- while (!PEND) {
- prev = p;
- PFETCH(c);
- if (c == '}') {
- r = ONIGENC_PROPERTY_NAME_TO_CTYPE(enc, start, prev);
- if (r < 0) break;
-
- *src = p;
- return r;
- }
- else if (c == '(' || c == ')' || c == '{' || c == '|') {
- r = ONIGERR_INVALID_CHAR_PROPERTY_NAME;
- break;
- }
- }
-
- onig_scan_env_set_error_string(env, r, *src, prev);
- return r;
-}
-
-static int
-parse_char_property(Node** np, OnigToken* tok, UChar** src, UChar* end,
- ScanEnv* env)
-{
- int r, ctype;
- CClassNode* cc;
-
- ctype = fetch_char_property_to_ctype(src, end, env);
- if (ctype < 0) return ctype;
-
- *np = node_new_cclass();
- CHECK_NULL_RETURN_MEMERR(*np);
- cc = NCCLASS(*np);
- r = add_ctype_to_cc(cc, ctype, 0, env);
- if (r != 0) return r;
- if (tok->u.prop.not != 0) NCCLASS_SET_NOT(cc);
-
- return 0;
-}
-
-
-enum CCSTATE {
- CCS_VALUE,
- CCS_RANGE,
- CCS_COMPLETE,
- CCS_START
-};
-
-enum CCVALTYPE {
- CCV_SB,
- CCV_CODE_POINT,
- CCV_CLASS
-};
-
-static int
-next_state_class(CClassNode* cc, OnigCodePoint* vs, enum CCVALTYPE* type,
- enum CCSTATE* state, ScanEnv* env)
-{
- int r;
-
- if (*state == CCS_RANGE)
- return ONIGERR_CHAR_CLASS_VALUE_AT_END_OF_RANGE;
-
- if (*state == CCS_VALUE && *type != CCV_CLASS) {
- if (*type == CCV_SB)
- BITSET_SET_BIT(cc->bs, (int )(*vs));
- else if (*type == CCV_CODE_POINT) {
- r = add_code_range(&(cc->mbuf), env, *vs, *vs);
- if (r < 0) return r;
- }
- }
-
- *state = CCS_VALUE;
- *type = CCV_CLASS;
- return 0;
-}
-
-static int
-next_state_val(CClassNode* cc, OnigCodePoint *vs, OnigCodePoint v,
- int* vs_israw, int v_israw,
- enum CCVALTYPE intype, enum CCVALTYPE* type,
- enum CCSTATE* state, ScanEnv* env)
-{
- int r;
-
- switch (*state) {
- case CCS_VALUE:
- if (*type == CCV_SB)
- BITSET_SET_BIT(cc->bs, (int )(*vs));
- else if (*type == CCV_CODE_POINT) {
- r = add_code_range(&(cc->mbuf), env, *vs, *vs);
- if (r < 0) return r;
- }
- break;
-
- case CCS_RANGE:
- if (intype == *type) {
- if (intype == CCV_SB) {
- if (*vs > 0xff || v > 0xff)
- return ONIGERR_INVALID_CODE_POINT_VALUE;
-
- if (*vs > v) {
- if (IS_SYNTAX_BV(env->syntax, ONIG_SYN_ALLOW_EMPTY_RANGE_IN_CC))
- goto ccs_range_end;
- else
- return ONIGERR_EMPTY_RANGE_IN_CHAR_CLASS;
- }
- bitset_set_range(cc->bs, (int )*vs, (int )v);
- }
- else {
- r = add_code_range(&(cc->mbuf), env, *vs, v);
- if (r < 0) return r;
- }
- }
- else {
-#if 0
- if (intype == CCV_CODE_POINT && *type == CCV_SB) {
-#endif
- if (*vs > v) {
- if (IS_SYNTAX_BV(env->syntax, ONIG_SYN_ALLOW_EMPTY_RANGE_IN_CC))
- goto ccs_range_end;
- else
- return ONIGERR_EMPTY_RANGE_IN_CHAR_CLASS;
- }
- bitset_set_range(cc->bs, (int )*vs, (int )(v < 0xff ? v : 0xff));
- r = add_code_range(&(cc->mbuf), env, (OnigCodePoint )*vs, v);
- if (r < 0) return r;
-#if 0
- }
- else
- return ONIGERR_MISMATCH_CODE_LENGTH_IN_CLASS_RANGE;
-#endif
- }
- ccs_range_end:
- *state = CCS_COMPLETE;
- break;
-
- case CCS_COMPLETE:
- case CCS_START:
- *state = CCS_VALUE;
- break;
-
- default:
- break;
- }
-
- *vs_israw = v_israw;
- *vs = v;
- *type = intype;
- return 0;
-}
-
-static int
-code_exist_check(OnigCodePoint c, UChar* from, UChar* end, int ignore_escaped,
- ScanEnv* env)
-{
- int in_esc;
- OnigCodePoint code;
- OnigEncoding enc = env->enc;
- UChar* p = from;
- PFETCH_READY;
-
- in_esc = 0;
- while (! PEND) {
- if (ignore_escaped && in_esc) {
- in_esc = 0;
- }
- else {
- PFETCH(code);
- if (code == c) return 1;
- if (code == MC_ESC(env->syntax)) in_esc = 1;
- }
- }
- return 0;
-}
-
-static int
-parse_char_class(Node** np, OnigToken* tok, UChar** src, UChar* end,
- ScanEnv* env)
-{
- int r, neg, len, fetched, and_start;
- OnigCodePoint v, vs;
- UChar *p;
- Node* node;
- CClassNode *cc, *prev_cc;
- CClassNode work_cc;
-
- enum CCSTATE state;
- enum CCVALTYPE val_type, in_type;
- int val_israw, in_israw;
-
- prev_cc = (CClassNode* )NULL;
- *np = NULL_NODE;
- r = fetch_token_in_cc(tok, src, end, env);
- if (r == TK_CHAR && tok->u.c == '^' && tok->escaped == 0) {
- neg = 1;
- r = fetch_token_in_cc(tok, src, end, env);
- }
- else {
- neg = 0;
- }
-
- if (r < 0) return r;
- if (r == TK_CC_CLOSE) {
- if (! code_exist_check((OnigCodePoint )']',
- *src, env->pattern_end, 1, env))
- return ONIGERR_EMPTY_CHAR_CLASS;
-
- CC_ESC_WARN(env, (UChar* )"]");
- r = tok->type = TK_CHAR; /* allow []...] */
- }
-
- *np = node = node_new_cclass();
- CHECK_NULL_RETURN_MEMERR(node);
- cc = NCCLASS(node);
-
- and_start = 0;
- state = CCS_START;
- p = *src;
- while (r != TK_CC_CLOSE) {
- fetched = 0;
- switch (r) {
- case TK_CHAR:
- if ((tok->u.code >= SINGLE_BYTE_SIZE) ||
- (len = ONIGENC_CODE_TO_MBCLEN(env->enc, tok->u.c)) > 1) {
- in_type = CCV_CODE_POINT;
- }
- else if (len < 0) {
- r = len;
- goto err;
- }
- else {
- sb_char:
- in_type = CCV_SB;
- }
- v = (OnigCodePoint )tok->u.c;
- in_israw = 0;
- goto val_entry2;
- break;
-
- case TK_RAW_BYTE:
- /* tok->base != 0 : octal or hexadec. */
- if (! ONIGENC_IS_SINGLEBYTE(env->enc) && tok->base != 0) {
- UChar buf[ONIGENC_CODE_TO_MBC_MAXLEN];
- UChar* bufe = buf + ONIGENC_CODE_TO_MBC_MAXLEN;
- UChar* psave = p;
- int i, base = tok->base;
-
- buf[0] = tok->u.c;
- for (i = 1; i < ONIGENC_MBC_MAXLEN(env->enc); i++) {
- r = fetch_token_in_cc(tok, &p, end, env);
- if (r < 0) goto err;
- if (r != TK_RAW_BYTE || tok->base != base) {
- fetched = 1;
- break;
- }
- buf[i] = tok->u.c;
- }
-
- if (i < ONIGENC_MBC_MINLEN(env->enc)) {
- r = ONIGERR_TOO_SHORT_MULTI_BYTE_STRING;
- goto err;
- }
-
- len = enclen(env->enc, buf, buf+i);
- if (i < len) {
- r = ONIGERR_TOO_SHORT_MULTI_BYTE_STRING;
- goto err;
- }
- else if (i > len) { /* fetch back */
- p = psave;
- for (i = 1; i < len; i++) {
- r = fetch_token_in_cc(tok, &p, end, env);
- }
- fetched = 0;
- }
-
- if (i == 1) {
- v = (OnigCodePoint )buf[0];
- goto raw_single;
- }
- else {
- v = ONIGENC_MBC_TO_CODE(env->enc, buf, bufe);
- in_type = CCV_CODE_POINT;
- }
- }
- else {
- v = (OnigCodePoint )tok->u.c;
- raw_single:
- in_type = CCV_SB;
- }
- in_israw = 1;
- goto val_entry2;
- break;
-
- case TK_CODE_POINT:
- v = tok->u.code;
- in_israw = 1;
- val_entry:
- len = ONIGENC_CODE_TO_MBCLEN(env->enc, v);
- if (len < 0) {
- r = len;
- goto err;
- }
- in_type = (len == 1 ? CCV_SB : CCV_CODE_POINT);
- val_entry2:
- r = next_state_val(cc, &vs, v, &val_israw, in_israw, in_type, &val_type,
- &state, env);
- if (r != 0) goto err;
- break;
-
- case TK_POSIX_BRACKET_OPEN:
- r = parse_posix_bracket(cc, &p, end, env);
- if (r < 0) goto err;
- if (r == 1) { /* is not POSIX bracket */
- CC_ESC_WARN(env, (UChar* )"[");
- p = tok->backp;
- v = (OnigCodePoint )tok->u.c;
- in_israw = 0;
- goto val_entry;
- }
- goto next_class;
- break;
-
- case TK_CHAR_TYPE:
- r = add_ctype_to_cc(cc, tok->u.prop.ctype, tok->u.prop.not, env);
- if (r != 0) return r;
-
- next_class:
- r = next_state_class(cc, &vs, &val_type, &state, env);
- if (r != 0) goto err;
- break;
-
- case TK_CHAR_PROPERTY:
- {
- int ctype;
-
- ctype = fetch_char_property_to_ctype(&p, end, env);
- if (ctype < 0) return ctype;
- r = add_ctype_to_cc(cc, ctype, tok->u.prop.not, env);
- if (r != 0) return r;
- goto next_class;
- }
- break;
-
- case TK_CC_RANGE:
- if (state == CCS_VALUE) {
- r = fetch_token_in_cc(tok, &p, end, env);
- if (r < 0) goto err;
- fetched = 1;
- if (r == TK_CC_CLOSE) { /* allow [x-] */
- range_end_val:
- v = (OnigCodePoint )'-';
- in_israw = 0;
- goto val_entry;
- }
- else if (r == TK_CC_AND) {
- CC_ESC_WARN(env, (UChar* )"-");
- goto range_end_val;
- }
- state = CCS_RANGE;
- }
- else if (state == CCS_START) {
- /* [-xa] is allowed */
- v = (OnigCodePoint )tok->u.c;
- in_israw = 0;
-
- r = fetch_token_in_cc(tok, &p, end, env);
- if (r < 0) goto err;
- fetched = 1;
- /* [--x] or [a&&-x] is warned. */
- if (r == TK_CC_RANGE || and_start != 0)
- CC_ESC_WARN(env, (UChar* )"-");
-
- goto val_entry;
- }
- else if (state == CCS_RANGE) {
- CC_ESC_WARN(env, (UChar* )"-");
- goto sb_char; /* [!--x] is allowed */
- }
- else { /* CCS_COMPLETE */
- r = fetch_token_in_cc(tok, &p, end, env);
- if (r < 0) goto err;
- fetched = 1;
- if (r == TK_CC_CLOSE) goto range_end_val; /* allow [a-b-] */
- else if (r == TK_CC_AND) {
- CC_ESC_WARN(env, (UChar* )"-");
- goto range_end_val;
- }
-
- if (IS_SYNTAX_BV(env->syntax, ONIG_SYN_ALLOW_DOUBLE_RANGE_OP_IN_CC)) {
- CC_ESC_WARN(env, (UChar* )"-");
- goto sb_char; /* [0-9-a] is allowed as [0-9\-a] */
- }
- r = ONIGERR_UNMATCHED_RANGE_SPECIFIER_IN_CHAR_CLASS;
- goto err;
- }
- break;
-
- case TK_CC_CC_OPEN: /* [ */
- {
- Node *anode;
- CClassNode* acc;
-
- r = parse_char_class(&anode, tok, &p, end, env);
- if (r != 0) goto cc_open_err;
- acc = NCCLASS(anode);
- r = or_cclass(cc, acc, env->enc);
-
- onig_node_free(anode);
- cc_open_err:
- if (r != 0) goto err;
- }
- break;
-
- case TK_CC_AND: /* && */
- {
- if (state == CCS_VALUE) {
- r = next_state_val(cc, &vs, 0, &val_israw, 0, val_type,
- &val_type, &state, env);
- if (r != 0) goto err;
- }
- /* initialize local variables */
- and_start = 1;
- state = CCS_START;
-
- if (IS_NOT_NULL(prev_cc)) {
- r = and_cclass(prev_cc, cc, env->enc);
- if (r != 0) goto err;
- bbuf_free(cc->mbuf);
- }
- else {
- prev_cc = cc;
- cc = &work_cc;
- }
- initialize_cclass(cc);
- }
- break;
-
- case TK_EOT:
- r = ONIGERR_PREMATURE_END_OF_CHAR_CLASS;
- goto err;
- break;
- default:
- r = ONIGERR_PARSER_BUG;
- goto err;
- break;
- }
-
- if (fetched)
- r = tok->type;
- else {
- r = fetch_token_in_cc(tok, &p, end, env);
- if (r < 0) goto err;
- }
- }
-
- if (state == CCS_VALUE) {
- r = next_state_val(cc, &vs, 0, &val_israw, 0, val_type,
- &val_type, &state, env);
- if (r != 0) goto err;
- }
-
- if (IS_NOT_NULL(prev_cc)) {
- r = and_cclass(prev_cc, cc, env->enc);
- if (r != 0) goto err;
- bbuf_free(cc->mbuf);
- cc = prev_cc;
- }
-
- if (neg != 0)
- NCCLASS_SET_NOT(cc);
- else
- NCCLASS_CLEAR_NOT(cc);
- if (IS_NCCLASS_NOT(cc) &&
- IS_SYNTAX_BV(env->syntax, ONIG_SYN_NOT_NEWLINE_IN_NEGATIVE_CC)) {
- int is_empty;
-
- is_empty = (IS_NULL(cc->mbuf) ? 1 : 0);
- if (is_empty != 0)
- BITSET_IS_EMPTY(cc->bs, is_empty);
-
- if (is_empty == 0) {
-#define NEWLINE_CODE 0x0a
-
- if (ONIGENC_IS_CODE_NEWLINE(env->enc, NEWLINE_CODE)) {
- if (ONIGENC_CODE_TO_MBCLEN(env->enc, NEWLINE_CODE) == 1)
- BITSET_SET_BIT(cc->bs, NEWLINE_CODE);
- else
- add_code_range(&(cc->mbuf), env, NEWLINE_CODE, NEWLINE_CODE);
- }
- }
- }
- *src = p;
- return 0;
-
- err:
- if (cc != NCCLASS(*np))
- bbuf_free(cc->mbuf);
- onig_node_free(*np);
- return r;
-}
-
-static int parse_subexp(Node** top, OnigToken* tok, int term,
- UChar** src, UChar* end, ScanEnv* env);
-
-static int
-parse_enclose(Node** np, OnigToken* tok, int term, UChar** src, UChar* end,
- ScanEnv* env)
-{
- int r, num;
- Node *target;
- OnigOptionType option;
- OnigCodePoint c;
- OnigEncoding enc = env->enc;
-
-#ifdef USE_NAMED_GROUP
- int list_capture;
-#endif
-
- UChar* p = *src;
- PFETCH_READY;
-
- *np = NULL;
- if (PEND) return ONIGERR_END_PATTERN_WITH_UNMATCHED_PARENTHESIS;
-
- option = env->option;
- if (PPEEK_IS('?') &&
- IS_SYNTAX_OP2(env->syntax, ONIG_SYN_OP2_QMARK_GROUP_EFFECT)) {
- PINC;
- if (PEND) return ONIGERR_END_PATTERN_IN_GROUP;
-
- PFETCH(c);
- switch (c) {
- case ':': /* (?:...) grouping only */
- group:
- r = fetch_token(tok, &p, end, env);
- if (r < 0) return r;
- r = parse_subexp(np, tok, term, &p, end, env);
- if (r < 0) return r;
- *src = p;
- return 1; /* group */
- break;
-
- case '=':
- *np = onig_node_new_anchor(ANCHOR_PREC_READ);
- break;
- case '!': /* preceding read */
- *np = onig_node_new_anchor(ANCHOR_PREC_READ_NOT);
- break;
- case '>': /* (?>...) stop backtrack */
- *np = node_new_enclose(ENCLOSE_STOP_BACKTRACK);
- break;
-
-#ifdef USE_NAMED_GROUP
- case '\'':
- if (IS_SYNTAX_OP2(env->syntax, ONIG_SYN_OP2_QMARK_LT_NAMED_GROUP)) {
- goto named_group1;
- }
- else
- return ONIGERR_UNDEFINED_GROUP_OPTION;
- break;
-#endif
-
- case '<': /* look behind (?<=...), (?<!...) */
- PFETCH(c);
- if (c == '=')
- *np = onig_node_new_anchor(ANCHOR_LOOK_BEHIND);
- else if (c == '!')
- *np = onig_node_new_anchor(ANCHOR_LOOK_BEHIND_NOT);
-#ifdef USE_NAMED_GROUP
- else {
- if (IS_SYNTAX_OP2(env->syntax, ONIG_SYN_OP2_QMARK_LT_NAMED_GROUP)) {
- UChar *name;
- UChar *name_end;
-
- PUNFETCH;
- c = '<';
-
- named_group1:
- list_capture = 0;
-
- named_group2:
- name = p;
- r = fetch_name((OnigCodePoint )c, &p, end, &name_end, env, &num, 0);
- if (r < 0) return r;
-
- num = scan_env_add_mem_entry(env);
- if (num < 0) return num;
- if (list_capture != 0 && num >= (int )BIT_STATUS_BITS_NUM)
- return ONIGERR_GROUP_NUMBER_OVER_FOR_CAPTURE_HISTORY;
-
- r = name_add(env->reg, name, name_end, num, env);
- if (r != 0) return r;
- *np = node_new_enclose_memory(env->option, 1);
- CHECK_NULL_RETURN_MEMERR(*np);
- NENCLOSE(*np)->regnum = num;
- if (list_capture != 0)
- BIT_STATUS_ON_AT_SIMPLE(env->capture_history, num);
- env->num_named++;
- }
- else {
- return ONIGERR_UNDEFINED_GROUP_OPTION;
- }
- }
-#else
- else {
- return ONIGERR_UNDEFINED_GROUP_OPTION;
- }
-#endif
- break;
-
- case '@':
- if (IS_SYNTAX_OP2(env->syntax, ONIG_SYN_OP2_ATMARK_CAPTURE_HISTORY)) {
-#ifdef USE_NAMED_GROUP
- if (IS_SYNTAX_OP2(env->syntax, ONIG_SYN_OP2_QMARK_LT_NAMED_GROUP)) {
- PFETCH(c);
- if (c == '<' || c == '\'') {
- list_capture = 1;
- goto named_group2; /* (?@<name>...) */
- }
- PUNFETCH;
- }
-#endif
- *np = node_new_enclose_memory(env->option, 0);
- CHECK_NULL_RETURN_MEMERR(*np);
- num = scan_env_add_mem_entry(env);
- if (num < 0) {
- onig_node_free(*np);
- return num;
- }
- else if (num >= (int )BIT_STATUS_BITS_NUM) {
- onig_node_free(*np);
- return ONIGERR_GROUP_NUMBER_OVER_FOR_CAPTURE_HISTORY;
- }
- NENCLOSE(*np)->regnum = num;
- BIT_STATUS_ON_AT_SIMPLE(env->capture_history, num);
- }
- else {
- return ONIGERR_UNDEFINED_GROUP_OPTION;
- }
- break;
-
-#ifdef USE_POSIXLINE_OPTION
- case 'p':
-#endif
- case '-': case 'i': case 'm': case 's': case 'x':
- {
- int neg = 0;
-
- while (1) {
- switch (c) {
- case ':':
- case ')':
- break;
-
- case '-': neg = 1; break;
- case 'x': ONOFF(option, ONIG_OPTION_EXTEND, neg); break;
- case 'i': ONOFF(option, ONIG_OPTION_IGNORECASE, neg); break;
- case 's':
- if (IS_SYNTAX_OP2(env->syntax, ONIG_SYN_OP2_OPTION_PERL)) {
- ONOFF(option, ONIG_OPTION_MULTILINE, neg);
- }
- else
- return ONIGERR_UNDEFINED_GROUP_OPTION;
- break;
-
- case 'm':
- if (IS_SYNTAX_OP2(env->syntax, ONIG_SYN_OP2_OPTION_PERL)) {
- ONOFF(option, ONIG_OPTION_SINGLELINE, (neg == 0 ? 1 : 0));
- }
- else if (IS_SYNTAX_OP2(env->syntax, ONIG_SYN_OP2_OPTION_RUBY)) {
- ONOFF(option, ONIG_OPTION_MULTILINE, neg);
- }
- else
- return ONIGERR_UNDEFINED_GROUP_OPTION;
- break;
-#ifdef USE_POSIXLINE_OPTION
- case 'p':
- ONOFF(option, ONIG_OPTION_MULTILINE|ONIG_OPTION_SINGLELINE, neg);
- break;
-#endif
- default:
- return ONIGERR_UNDEFINED_GROUP_OPTION;
- }
-
- if (c == ')') {
- *np = node_new_option(option);
- CHECK_NULL_RETURN_MEMERR(*np);
- *src = p;
- return 2; /* option only */
- }
- else if (c == ':') {
- OnigOptionType prev = env->option;
-
- env->option = option;
- r = fetch_token(tok, &p, end, env);
- if (r < 0) return r;
- r = parse_subexp(&target, tok, term, &p, end, env);
- env->option = prev;
- if (r < 0) return r;
- *np = node_new_option(option);
- CHECK_NULL_RETURN_MEMERR(*np);
- NENCLOSE(*np)->target = target;
- *src = p;
- return 0;
- }
-
- if (PEND) return ONIGERR_END_PATTERN_IN_GROUP;
- PFETCH(c);
- }
- }
- break;
-
- default:
- return ONIGERR_UNDEFINED_GROUP_OPTION;
- }
- }
- else {
- if (ONIG_IS_OPTION_ON(env->option, ONIG_OPTION_DONT_CAPTURE_GROUP))
- goto group;
-
- *np = node_new_enclose_memory(env->option, 0);
- CHECK_NULL_RETURN_MEMERR(*np);
- num = scan_env_add_mem_entry(env);
- if (num < 0) return num;
- NENCLOSE(*np)->regnum = num;
- }
-
- CHECK_NULL_RETURN_MEMERR(*np);
- r = fetch_token(tok, &p, end, env);
- if (r < 0) return r;
- r = parse_subexp(&target, tok, term, &p, end, env);
- if (r < 0) return r;
-
- if (NTYPE(*np) == NT_ANCHOR)
- NANCHOR(*np)->target = target;
- else {
- NENCLOSE(*np)->target = target;
- if (NENCLOSE(*np)->type == ENCLOSE_MEMORY) {
- /* Don't move this to previous of parse_subexp() */
- r = scan_env_set_mem_node(env, NENCLOSE(*np)->regnum, *np);
- if (r != 0) return r;
- }
- }
-
- *src = p;
- return 0;
-}
-
-static const char* const PopularQStr[] = {
- "?", "*", "+", "??", "*?", "+?"
-};
-
-static const char* const ReduceQStr[] = {
- "", "", "*", "*?", "??", "+ and ??", "+? and ?"
-};
-
-static int
-set_quantifier(Node* qnode, Node* target, int group, ScanEnv* env)
-{
- QtfrNode* qn;
-
- qn = NQTFR(qnode);
- if (qn->lower == 1 && qn->upper == 1) {
- return 1;
- }
-
- switch (NTYPE(target)) {
- case NT_STR:
- if (! group) {
- StrNode* sn = NSTR(target);
- if (str_node_can_be_split(sn, env->enc)) {
- Node* n = str_node_split_last_char(sn, env->enc);
- if (IS_NOT_NULL(n)) {
- qn->target = n;
- return 2;
- }
- }
- }
- break;
-
- case NT_QTFR:
- { /* check redundant double repeat. */
- /* verbose warn (?:.?)? etc... but not warn (.?)? etc... */
- QtfrNode* qnt = NQTFR(target);
- int nestq_num = popular_quantifier_num(qn);
- int targetq_num = popular_quantifier_num(qnt);
-
-#ifdef USE_WARNING_REDUNDANT_NESTED_REPEAT_OPERATOR
- if (!IS_QUANTIFIER_BY_NUMBER(qn) && !IS_QUANTIFIER_BY_NUMBER(qnt) &&
- IS_SYNTAX_BV(env->syntax, ONIG_SYN_WARN_REDUNDANT_NESTED_REPEAT)) {
- UChar buf[WARN_BUFSIZE];
-
- switch(ReduceTypeTable[targetq_num][nestq_num]) {
- case RQ_ASIS:
- break;
-
- case RQ_DEL:
- if (onig_verb_warn != onig_null_warn) {
- onig_snprintf_with_pattern(buf, WARN_BUFSIZE, env->enc,
- env->pattern, env->pattern_end,
- (UChar* )"redundant nested repeat operator");
- (*onig_verb_warn)((char* )buf);
- }
- goto warn_exit;
- break;
-
- default:
- if (onig_verb_warn != onig_null_warn) {
- onig_snprintf_with_pattern(buf, WARN_BUFSIZE, env->enc,
- env->pattern, env->pattern_end,
- (UChar* )"nested repeat operator %s and %s was replaced with '%s'",
- PopularQStr[targetq_num], PopularQStr[nestq_num],
- ReduceQStr[ReduceTypeTable[targetq_num][nestq_num]]);
- (*onig_verb_warn)((char* )buf);
- }
- goto warn_exit;
- break;
- }
- }
-
- warn_exit:
-#endif
- if (targetq_num >= 0) {
- if (nestq_num >= 0) {
- onig_reduce_nested_quantifier(qnode, target);
- goto q_exit;
- }
- else if (targetq_num == 1 || targetq_num == 2) { /* * or + */
- /* (?:a*){n,m}, (?:a+){n,m} => (?:a*){n,n}, (?:a+){n,n} */
- if (! IS_REPEAT_INFINITE(qn->upper) && qn->upper > 1 && qn->greedy) {
- qn->upper = (qn->lower == 0 ? 1 : qn->lower);
- }
- }
- }
- }
- break;
-
- default:
- break;
- }
-
- qn->target = target;
- q_exit:
- return 0;
-}
-
-
-#ifdef USE_SHARED_CCLASS_TABLE
-
-#define THRESHOLD_RANGE_NUM_FOR_SHARE_CCLASS 8
-
-/* for ctype node hash table */
-
-typedef struct {
- OnigEncoding enc;
- int not;
- int type;
-} type_cclass_key;
-
-static int type_cclass_cmp(type_cclass_key* x, type_cclass_key* y)
-{
- if (x->type != y->type) return 1;
- if (x->enc != y->enc) return 1;
- if (x->not != y->not) return 1;
- return 0;
-}
-
-static int type_cclass_hash(type_cclass_key* key)
-{
- int i, val;
- UChar *p;
-
- val = 0;
-
- p = (UChar* )&(key->enc);
- for (i = 0; i < (int )sizeof(key->enc); i++) {
- val = val * 997 + (int )*p++;
- }
-
- p = (UChar* )(&key->type);
- for (i = 0; i < (int )sizeof(key->type); i++) {
- val = val * 997 + (int )*p++;
- }
-
- val += key->not;
- return val + (val >> 5);
-}
-
-static const struct st_hash_type type_type_cclass_hash = {
- type_cclass_cmp,
- type_cclass_hash,
-};
-
-static st_table* OnigTypeCClassTable;
-
-
-static int
-i_free_shared_class(type_cclass_key* key, Node* node, void* arg ARG_UNUSED)
-{
- if (IS_NOT_NULL(node)) {
- CClassNode* cc = NCCLASS(node);
- if (IS_NOT_NULL(cc->mbuf)) xfree(cc->mbuf);
- xfree(node);
- }
-
- if (IS_NOT_NULL(key)) xfree(key);
- return ST_DELETE;
-}
-
-extern int
-onig_free_shared_cclass_table(void)
-{
- THREAD_ATOMIC_START;
- if (IS_NOT_NULL(OnigTypeCClassTable)) {
- onig_st_foreach(OnigTypeCClassTable, i_free_shared_class, 0);
- onig_st_free_table(OnigTypeCClassTable);
- OnigTypeCClassTable = NULL;
- }
- THREAD_ATOMIC_END;
-
- return 0;
-}
-
-#endif /* USE_SHARED_CCLASS_TABLE */
-
-
-#ifndef CASE_FOLD_IS_APPLIED_INSIDE_NEGATIVE_CCLASS
-static int
-clear_not_flag_cclass(CClassNode* cc, OnigEncoding enc)
-{
- BBuf *tbuf;
- int r;
-
- if (IS_NCCLASS_NOT(cc)) {
- bitset_invert(cc->bs);
-
- if (! ONIGENC_IS_SINGLEBYTE(enc)) {
- r = not_code_range_buf(enc, cc->mbuf, &tbuf);
- if (r != 0) return r;
-
- bbuf_free(cc->mbuf);
- cc->mbuf = tbuf;
- }
-
- NCCLASS_CLEAR_NOT(cc);
- }
-
- return 0;
-}
-#endif /* CASE_FOLD_IS_APPLIED_INSIDE_NEGATIVE_CCLASS */
-
-typedef struct {
- ScanEnv* env;
- CClassNode* cc;
- Node* alt_root;
- Node** ptail;
-} IApplyCaseFoldArg;
-
-static int
-i_apply_case_fold(OnigCodePoint from, OnigCodePoint to[],
- int to_len, void* arg)
-{
- IApplyCaseFoldArg* iarg;
- ScanEnv* env;
- CClassNode* cc;
- BitSetRef bs;
-
- iarg = (IApplyCaseFoldArg* )arg;
- env = iarg->env;
- cc = iarg->cc;
- bs = cc->bs;
-
- if (to_len == 1) {
- int is_in = onig_is_code_in_cc(env->enc, from, cc);
-#ifdef CASE_FOLD_IS_APPLIED_INSIDE_NEGATIVE_CCLASS
- if ((is_in != 0 && !IS_NCCLASS_NOT(cc)) ||
- (is_in == 0 && IS_NCCLASS_NOT(cc))) {
- if (ONIGENC_MBC_MINLEN(env->enc) > 1 || *to >= SINGLE_BYTE_SIZE) {
- add_code_range(&(cc->mbuf), env, *to, *to);
- }
- else {
- BITSET_SET_BIT(bs, *to);
- }
- }
-#else
- if (is_in != 0) {
- if (ONIGENC_MBC_MINLEN(env->enc) > 1 || *to >= SINGLE_BYTE_SIZE) {
- if (IS_NCCLASS_NOT(cc)) clear_not_flag_cclass(cc, env->enc);
- add_code_range(&(cc->mbuf), env, *to, *to);
- }
- else {
- if (IS_NCCLASS_NOT(cc)) {
- BITSET_CLEAR_BIT(bs, *to);
- }
- else
- BITSET_SET_BIT(bs, *to);
- }
- }
-#endif /* CASE_FOLD_IS_APPLIED_INSIDE_NEGATIVE_CCLASS */
- }
- else {
- int r, i, len;
- UChar buf[ONIGENC_CODE_TO_MBC_MAXLEN];
- Node *snode = NULL_NODE;
-
- if (onig_is_code_in_cc(env->enc, from, cc)
-#ifdef CASE_FOLD_IS_APPLIED_INSIDE_NEGATIVE_CCLASS
- && !IS_NCCLASS_NOT(cc)
-#endif
- ) {
- for (i = 0; i < to_len; i++) {
- len = ONIGENC_CODE_TO_MBC(env->enc, to[i], buf);
- if (i == 0) {
- snode = onig_node_new_str(buf, buf + len);
- CHECK_NULL_RETURN_MEMERR(snode);
-
- /* char-class expanded multi-char only
- compare with string folded at match time. */
- NSTRING_SET_AMBIG(snode);
- }
- else {
- r = onig_node_str_cat(snode, buf, buf + len);
- if (r < 0) {
- onig_node_free(snode);
- return r;
- }
- }
- }
-
- *(iarg->ptail) = onig_node_new_alt(snode, NULL_NODE);
- CHECK_NULL_RETURN_MEMERR(*(iarg->ptail));
- iarg->ptail = &(NCDR((*(iarg->ptail))));
- }
- }
-
- return 0;
-}
-
-static int
-parse_exp(Node** np, OnigToken* tok, int term,
- UChar** src, UChar* end, ScanEnv* env)
-{
- int r, len, group = 0;
- Node* qn;
- Node** targetp;
-
- *np = NULL;
- if (tok->type == (enum TokenSyms )term)
- goto end_of_token;
-
- switch (tok->type) {
- case TK_ALT:
- case TK_EOT:
- end_of_token:
- *np = node_new_empty();
- return tok->type;
- break;
-
- case TK_SUBEXP_OPEN:
- r = parse_enclose(np, tok, TK_SUBEXP_CLOSE, src, end, env);
- if (r < 0) return r;
- if (r == 1) group = 1;
- else if (r == 2) { /* option only */
- Node* target;
- OnigOptionType prev = env->option;
-
- env->option = NENCLOSE(*np)->option;
- r = fetch_token(tok, src, end, env);
- if (r < 0) return r;
- r = parse_subexp(&target, tok, term, src, end, env);
- env->option = prev;
- if (r < 0) return r;
- NENCLOSE(*np)->target = target;
- return tok->type;
- }
- break;
-
- case TK_SUBEXP_CLOSE:
- if (! IS_SYNTAX_BV(env->syntax, ONIG_SYN_ALLOW_UNMATCHED_CLOSE_SUBEXP))
- return ONIGERR_UNMATCHED_CLOSE_PARENTHESIS;
-
- if (tok->escaped) goto tk_raw_byte;
- else goto tk_byte;
- break;
-
- case TK_STRING:
- tk_byte:
- {
- *np = node_new_str(tok->backp, *src);
- CHECK_NULL_RETURN_MEMERR(*np);
-
- while (1) {
- r = fetch_token(tok, src, end, env);
- if (r < 0) return r;
- if (r != TK_STRING) break;
-
- r = onig_node_str_cat(*np, tok->backp, *src);
- if (r < 0) return r;
- }
-
- string_end:
- targetp = np;
- goto repeat;
- }
- break;
-
- case TK_RAW_BYTE:
- tk_raw_byte:
- {
- *np = node_new_str_raw_char((UChar )tok->u.c);
- CHECK_NULL_RETURN_MEMERR(*np);
- len = 1;
- while (1) {
- if (len >= ONIGENC_MBC_MINLEN(env->enc)) {
- if (len == enclen(env->enc, NSTR(*np)->s, NSTR(*np)->end)) {
- r = fetch_token(tok, src, end, env);
- NSTRING_CLEAR_RAW(*np);
- goto string_end;
- }
- }
-
- r = fetch_token(tok, src, end, env);
- if (r < 0) return r;
- if (r != TK_RAW_BYTE) {
- /* Don't use this, it is wrong for little endian encodings. */
-#ifdef USE_PAD_TO_SHORT_BYTE_CHAR
- int rem;
- if (len < ONIGENC_MBC_MINLEN(env->enc)) {
- rem = ONIGENC_MBC_MINLEN(env->enc) - len;
- (void )node_str_head_pad(NSTR(*np), rem, (UChar )0);
- if (len + rem == enclen(env->enc, NSTR(*np)->s)) {
- NSTRING_CLEAR_RAW(*np);
- goto string_end;
- }
- }
-#endif
- return ONIGERR_TOO_SHORT_MULTI_BYTE_STRING;
- }
-
- r = node_str_cat_char(*np, (UChar )tok->u.c);
- if (r < 0) return r;
-
- len++;
- }
- }
- break;
-
- case TK_CODE_POINT:
- {
- UChar buf[ONIGENC_CODE_TO_MBC_MAXLEN];
- int num = ONIGENC_CODE_TO_MBC(env->enc, tok->u.code, buf);
- if (num < 0) return num;
-#ifdef NUMBERED_CHAR_IS_NOT_CASE_AMBIG
- *np = node_new_str_raw(buf, buf + num);
-#else
- *np = node_new_str(buf, buf + num);
-#endif
- CHECK_NULL_RETURN_MEMERR(*np);
- }
- break;
-
- case TK_QUOTE_OPEN:
- {
- OnigCodePoint end_op[2];
- UChar *qstart, *qend, *nextp;
-
- end_op[0] = (OnigCodePoint )MC_ESC(env->syntax);
- end_op[1] = (OnigCodePoint )'E';
- qstart = *src;
- qend = find_str_position(end_op, 2, qstart, end, &nextp, env->enc);
- if (IS_NULL(qend)) {
- nextp = qend = end;
- }
- *np = node_new_str(qstart, qend);
- CHECK_NULL_RETURN_MEMERR(*np);
- *src = nextp;
- }
- break;
-
- case TK_CHAR_TYPE:
- {
- switch (tok->u.prop.ctype) {
- case ONIGENC_CTYPE_WORD:
- *np = node_new_ctype(tok->u.prop.ctype, tok->u.prop.not);
- CHECK_NULL_RETURN_MEMERR(*np);
- break;
-
- case ONIGENC_CTYPE_SPACE:
- case ONIGENC_CTYPE_DIGIT:
- case ONIGENC_CTYPE_XDIGIT:
- {
- CClassNode* cc;
-
-#ifdef USE_SHARED_CCLASS_TABLE
- const OnigCodePoint *mbr;
- OnigCodePoint sb_out;
-
- r = ONIGENC_GET_CTYPE_CODE_RANGE(env->enc, tok->u.prop.ctype,
- &sb_out, &mbr);
- if (r == 0 &&
- ONIGENC_CODE_RANGE_NUM(mbr)
- >= THRESHOLD_RANGE_NUM_FOR_SHARE_CCLASS) {
- type_cclass_key key;
- type_cclass_key* new_key;
-
- key.enc = env->enc;
- key.not = tok->u.prop.not;
- key.type = tok->u.prop.ctype;
-
- THREAD_ATOMIC_START;
-
- if (IS_NULL(OnigTypeCClassTable)) {
- OnigTypeCClassTable
- = onig_st_init_table_with_size(&type_type_cclass_hash, 10);
- if (IS_NULL(OnigTypeCClassTable)) {
- THREAD_ATOMIC_END;
- return ONIGERR_MEMORY;
- }
- }
- else {
- if (onig_st_lookup(OnigTypeCClassTable, (st_data_t )&key,
- (st_data_t* )np)) {
- THREAD_ATOMIC_END;
- break;
- }
- }
-
- *np = node_new_cclass_by_codepoint_range(tok->u.prop.not,
- sb_out, mbr);
- if (IS_NULL(*np)) {
- THREAD_ATOMIC_END;
- return ONIGERR_MEMORY;
- }
-
- cc = NCCLASS(*np);
- NCCLASS_SET_SHARE(cc);
- new_key = (type_cclass_key* )xmalloc(sizeof(type_cclass_key));
- xmemcpy(new_key, &key, sizeof(type_cclass_key));
- onig_st_add_direct(OnigTypeCClassTable, (st_data_t )new_key,
- (st_data_t )*np);
-
- THREAD_ATOMIC_END;
- }
- else {
-#endif
- *np = node_new_cclass();
- CHECK_NULL_RETURN_MEMERR(*np);
- cc = NCCLASS(*np);
- add_ctype_to_cc(cc, tok->u.prop.ctype, 0, env);
- if (tok->u.prop.not != 0) NCCLASS_SET_NOT(cc);
-#ifdef USE_SHARED_CCLASS_TABLE
- }
-#endif
- }
- break;
-
- default:
- return ONIGERR_PARSER_BUG;
- break;
- }
- }
- break;
-
- case TK_CHAR_PROPERTY:
- r = parse_char_property(np, tok, src, end, env);
- if (r != 0) return r;
- break;
-
- case TK_CC_OPEN:
- {
- CClassNode* cc;
-
- r = parse_char_class(np, tok, src, end, env);
- if (r != 0) return r;
-
- cc = NCCLASS(*np);
- if (IS_IGNORECASE(env->option)) {
- IApplyCaseFoldArg iarg;
-
- iarg.env = env;
- iarg.cc = cc;
- iarg.alt_root = NULL_NODE;
- iarg.ptail = &(iarg.alt_root);
-
- r = ONIGENC_APPLY_ALL_CASE_FOLD(env->enc, env->case_fold_flag,
- i_apply_case_fold, &iarg);
- if (r != 0) {
- onig_node_free(iarg.alt_root);
- return r;
- }
- if (IS_NOT_NULL(iarg.alt_root)) {
- Node* work = onig_node_new_alt(*np, iarg.alt_root);
- if (IS_NULL(work)) {
- onig_node_free(iarg.alt_root);
- return ONIGERR_MEMORY;
- }
- *np = work;
- }
- }
- }
- break;
-
- case TK_ANYCHAR:
- *np = node_new_anychar();
- CHECK_NULL_RETURN_MEMERR(*np);
- break;
-
- case TK_ANYCHAR_ANYTIME:
- *np = node_new_anychar();
- CHECK_NULL_RETURN_MEMERR(*np);
- qn = node_new_quantifier(0, REPEAT_INFINITE, 0);
- CHECK_NULL_RETURN_MEMERR(qn);
- NQTFR(qn)->target = *np;
- *np = qn;
- break;
-
- case TK_BACKREF:
- len = tok->u.backref.num;
- *np = node_new_backref(len,
- (len > 1 ? tok->u.backref.refs : &(tok->u.backref.ref1)),
- tok->u.backref.by_name,
-#ifdef USE_BACKREF_WITH_LEVEL
- tok->u.backref.exist_level,
- tok->u.backref.level,
-#endif
- env);
- CHECK_NULL_RETURN_MEMERR(*np);
- break;
-
-#ifdef USE_SUBEXP_CALL
- case TK_CALL:
- {
- int gnum = tok->u.call.gnum;
-
- if (gnum < 0) {
- gnum = BACKREF_REL_TO_ABS(gnum, env);
- if (gnum <= 0)
- return ONIGERR_INVALID_BACKREF;
- }
- *np = node_new_call(tok->u.call.name, tok->u.call.name_end, gnum);
- CHECK_NULL_RETURN_MEMERR(*np);
- env->num_call++;
- }
- break;
-#endif
-
- case TK_ANCHOR:
- *np = onig_node_new_anchor(tok->u.anchor);
- break;
-
- case TK_OP_REPEAT:
- case TK_INTERVAL:
- if (IS_SYNTAX_BV(env->syntax, ONIG_SYN_CONTEXT_INDEP_REPEAT_OPS)) {
- if (IS_SYNTAX_BV(env->syntax, ONIG_SYN_CONTEXT_INVALID_REPEAT_OPS))
- return ONIGERR_TARGET_OF_REPEAT_OPERATOR_NOT_SPECIFIED;
- else
- *np = node_new_empty();
- }
- else {
- goto tk_byte;
- }
- break;
-
- default:
- return ONIGERR_PARSER_BUG;
- break;
- }
-
- {
- targetp = np;
-
- re_entry:
- r = fetch_token(tok, src, end, env);
- if (r < 0) return r;
-
- repeat:
- if (r == TK_OP_REPEAT || r == TK_INTERVAL) {
- if (is_invalid_quantifier_target(*targetp))
- return ONIGERR_TARGET_OF_REPEAT_OPERATOR_INVALID;
-
- qn = node_new_quantifier(tok->u.repeat.lower, tok->u.repeat.upper,
- (r == TK_INTERVAL ? 1 : 0));
- CHECK_NULL_RETURN_MEMERR(qn);
- NQTFR(qn)->greedy = tok->u.repeat.greedy;
- r = set_quantifier(qn, *targetp, group, env);
- if (r < 0) return r;
-
- if (tok->u.repeat.possessive != 0) {
- Node* en;
- en = node_new_enclose(ENCLOSE_STOP_BACKTRACK);
- if (IS_NULL(en)) {
- onig_node_free(qn);
- return ONIGERR_MEMORY;
- }
- NENCLOSE(en)->target = qn;
- qn = en;
- }
-
- if (r == 0) {
- *targetp = qn;
- }
- else if (r == 1) {
- onig_node_free(qn);
- }
- else if (r == 2) { /* split case: /abc+/ */
- Node *tmp;
-
- *targetp = node_new_list(*targetp, NULL);
- CHECK_NULL_RETURN_MEMERR(*targetp);
- tmp = NCDR(*targetp) = node_new_list(qn, NULL);
- CHECK_NULL_RETURN_MEMERR(tmp);
- targetp = &(NCAR(tmp));
- }
- goto re_entry;
- }
- }
-
- return r;
-}
-
-static int
-parse_branch(Node** top, OnigToken* tok, int term,
- UChar** src, UChar* end, ScanEnv* env)
-{
- int r;
- Node *node, **headp;
-
- *top = NULL;
- r = parse_exp(&node, tok, term, src, end, env);
- if (r < 0) return r;
-
- if (r == TK_EOT || r == term || r == TK_ALT) {
- *top = node;
- }
- else {
- *top = node_new_list(node, NULL);
- headp = &(NCDR(*top));
- while (r != TK_EOT && r != term && r != TK_ALT) {
- r = parse_exp(&node, tok, term, src, end, env);
- if (r < 0) return r;
-
- if (NTYPE(node) == NT_LIST) {
- *headp = node;
- while (IS_NOT_NULL(NCDR(node))) node = NCDR(node);
- headp = &(NCDR(node));
- }
- else {
- *headp = node_new_list(node, NULL);
- headp = &(NCDR(*headp));
- }
- }
- }
-
- return r;
-}
-
-/* term_tok: TK_EOT or TK_SUBEXP_CLOSE */
-static int
-parse_subexp(Node** top, OnigToken* tok, int term,
- UChar** src, UChar* end, ScanEnv* env)
-{
- int r;
- Node *node, **headp;
-
- *top = NULL;
- r = parse_branch(&node, tok, term, src, end, env);
- if (r < 0) {
- onig_node_free(node);
- return r;
- }
-
- if (r == term) {
- *top = node;
- }
- else if (r == TK_ALT) {
- *top = onig_node_new_alt(node, NULL);
- headp = &(NCDR(*top));
- while (r == TK_ALT) {
- r = fetch_token(tok, src, end, env);
- if (r < 0) return r;
- r = parse_branch(&node, tok, term, src, end, env);
- if (r < 0) return r;
-
- *headp = onig_node_new_alt(node, NULL);
- headp = &(NCDR(*headp));
- }
-
- if (tok->type != (enum TokenSyms )term)
- goto err;
- }
- else {
- err:
- if (term == TK_SUBEXP_CLOSE)
- return ONIGERR_END_PATTERN_WITH_UNMATCHED_PARENTHESIS;
- else
- return ONIGERR_PARSER_BUG;
- }
-
- return r;
-}
-
-static int
-parse_regexp(Node** top, UChar** src, UChar* end, ScanEnv* env)
-{
- int r;
- OnigToken tok;
-
- r = fetch_token(&tok, src, end, env);
- if (r < 0) return r;
- r = parse_subexp(top, &tok, TK_EOT, src, end, env);
- if (r < 0) return r;
- return 0;
-}
-
-extern int
-onig_parse_make_tree(Node** root, const UChar* pattern, const UChar* end,
- regex_t* reg, ScanEnv* env)
-{
- int r;
- UChar* p;
-
-#ifdef USE_NAMED_GROUP
- names_clear(reg);
-#endif
-
- scan_env_clear(env);
- env->option = reg->options;
- env->case_fold_flag = reg->case_fold_flag;
- env->enc = reg->enc;
- env->syntax = reg->syntax;
- env->pattern = (UChar* )pattern;
- env->pattern_end = (UChar* )end;
- env->reg = reg;
-
- *root = NULL;
- p = (UChar* )pattern;
- r = parse_regexp(root, &p, (UChar* )end, env);
- reg->num_mem = env->num_mem;
- return r;
-}
-
-extern void
-onig_scan_env_set_error_string(ScanEnv* env, int ecode ARG_UNUSED,
- UChar* arg, UChar* arg_end)
-{
- env->error = arg;
- env->error_end = arg_end;
-}
diff --git a/regparse.h b/regparse.h
deleted file mode 100644
index b6783264f2..0000000000
--- a/regparse.h
+++ /dev/null
@@ -1,351 +0,0 @@
-#ifndef ONIGURUMA_REGPARSE_H
-#define ONIGURUMA_REGPARSE_H
-/**********************************************************************
- regparse.h - 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 "regint.h"
-
-/* node type */
-#define NT_STR 0
-#define NT_CCLASS 1
-#define NT_CTYPE 2
-#define NT_CANY 3
-#define NT_BREF 4
-#define NT_QTFR 5
-#define NT_ENCLOSE 6
-#define NT_ANCHOR 7
-#define NT_LIST 8
-#define NT_ALT 9
-#define NT_CALL 10
-
-/* node type bit */
-#define NTYPE2BIT(type) (1<<(type))
-
-#define BIT_NT_STR NTYPE2BIT(NT_STR)
-#define BIT_NT_CCLASS NTYPE2BIT(NT_CCLASS)
-#define BIT_NT_CTYPE NTYPE2BIT(NT_CTYPE)
-#define BIT_NT_CANY NTYPE2BIT(NT_CANY)
-#define BIT_NT_BREF NTYPE2BIT(NT_BREF)
-#define BIT_NT_QTFR NTYPE2BIT(NT_QTFR)
-#define BIT_NT_ENCLOSE NTYPE2BIT(NT_ENCLOSE)
-#define BIT_NT_ANCHOR NTYPE2BIT(NT_ANCHOR)
-#define BIT_NT_LIST NTYPE2BIT(NT_LIST)
-#define BIT_NT_ALT NTYPE2BIT(NT_ALT)
-#define BIT_NT_CALL NTYPE2BIT(NT_CALL)
-
-#define IS_NODE_TYPE_SIMPLE(type) \
- ((NTYPE2BIT(type) & (BIT_NT_STR | BIT_NT_CCLASS | BIT_NT_CTYPE |\
- BIT_NT_CANY | BIT_NT_BREF)) != 0)
-
-#define NTYPE(node) ((node)->u.base.type)
-#define SET_NTYPE(node, ntype) (node)->u.base.type = (ntype)
-
-#define NSTR(node) (&((node)->u.str))
-#define NCCLASS(node) (&((node)->u.cclass))
-#define NCTYPE(node) (&((node)->u.ctype))
-#define NBREF(node) (&((node)->u.bref))
-#define NQTFR(node) (&((node)->u.qtfr))
-#define NENCLOSE(node) (&((node)->u.enclose))
-#define NANCHOR(node) (&((node)->u.anchor))
-#define NCONS(node) (&((node)->u.cons))
-#define NCALL(node) (&((node)->u.call))
-
-#define NCAR(node) (NCONS(node)->car)
-#define NCDR(node) (NCONS(node)->cdr)
-
-
-
-#define ANCHOR_ANYCHAR_STAR_MASK (ANCHOR_ANYCHAR_STAR | ANCHOR_ANYCHAR_STAR_ML)
-#define ANCHOR_END_BUF_MASK (ANCHOR_END_BUF | ANCHOR_SEMI_END_BUF)
-
-#define ENCLOSE_MEMORY (1<<0)
-#define ENCLOSE_OPTION (1<<1)
-#define ENCLOSE_STOP_BACKTRACK (1<<2)
-
-#define NODE_STR_MARGIN 16
-#define NODE_STR_BUF_SIZE 24 /* sizeof(CClassNode) - sizeof(int)*4 */
-#define NODE_BACKREFS_SIZE 6
-
-#define NSTR_RAW (1<<0) /* by backslashed number */
-#define NSTR_AMBIG (1<<1)
-#define NSTR_DONT_GET_OPT_INFO (1<<2)
-
-#define NSTRING_LEN(node) ((node)->u.str.end - (node)->u.str.s)
-#define NSTRING_SET_RAW(node) (node)->u.str.flag |= NSTR_RAW
-#define NSTRING_CLEAR_RAW(node) (node)->u.str.flag &= ~NSTR_RAW
-#define NSTRING_SET_AMBIG(node) (node)->u.str.flag |= NSTR_AMBIG
-#define NSTRING_SET_DONT_GET_OPT_INFO(node) \
- (node)->u.str.flag |= NSTR_DONT_GET_OPT_INFO
-#define NSTRING_IS_RAW(node) (((node)->u.str.flag & NSTR_RAW) != 0)
-#define NSTRING_IS_AMBIG(node) (((node)->u.str.flag & NSTR_AMBIG) != 0)
-#define NSTRING_IS_DONT_GET_OPT_INFO(node) \
- (((node)->u.str.flag & NSTR_DONT_GET_OPT_INFO) != 0)
-
-#define BACKREFS_P(br) \
- (IS_NOT_NULL((br)->back_dynamic) ? (br)->back_dynamic : (br)->back_static);
-
-#define NQ_TARGET_ISNOT_EMPTY 0
-#define NQ_TARGET_IS_EMPTY 1
-#define NQ_TARGET_IS_EMPTY_MEM 2
-#define NQ_TARGET_IS_EMPTY_REC 3
-
-/* status bits */
-#define NST_MIN_FIXED (1<<0)
-#define NST_MAX_FIXED (1<<1)
-#define NST_CLEN_FIXED (1<<2)
-#define NST_MARK1 (1<<3)
-#define NST_MARK2 (1<<4)
-#define NST_MEM_BACKREFED (1<<5)
-#define NST_STOP_BT_SIMPLE_REPEAT (1<<6)
-#define NST_RECURSION (1<<7)
-#define NST_CALLED (1<<8)
-#define NST_ADDR_FIXED (1<<9)
-#define NST_NAMED_GROUP (1<<10)
-#define NST_NAME_REF (1<<11)
-#define NST_IN_REPEAT (1<<12) /* STK_REPEAT is nested in stack. */
-#define NST_NEST_LEVEL (1<<13)
-#define NST_BY_NUMBER (1<<14) /* {n,m} */
-
-#define SET_ENCLOSE_STATUS(node,f) (node)->u.enclose.state |= (f)
-#define CLEAR_ENCLOSE_STATUS(node,f) (node)->u.enclose.state &= ~(f)
-
-#define IS_ENCLOSE_CALLED(en) (((en)->state & NST_CALLED) != 0)
-#define IS_ENCLOSE_ADDR_FIXED(en) (((en)->state & NST_ADDR_FIXED) != 0)
-#define IS_ENCLOSE_RECURSION(en) (((en)->state & NST_RECURSION) != 0)
-#define IS_ENCLOSE_MARK1(en) (((en)->state & NST_MARK1) != 0)
-#define IS_ENCLOSE_MARK2(en) (((en)->state & NST_MARK2) != 0)
-#define IS_ENCLOSE_MIN_FIXED(en) (((en)->state & NST_MIN_FIXED) != 0)
-#define IS_ENCLOSE_MAX_FIXED(en) (((en)->state & NST_MAX_FIXED) != 0)
-#define IS_ENCLOSE_CLEN_FIXED(en) (((en)->state & NST_CLEN_FIXED) != 0)
-#define IS_ENCLOSE_STOP_BT_SIMPLE_REPEAT(en) \
- (((en)->state & NST_STOP_BT_SIMPLE_REPEAT) != 0)
-#define IS_ENCLOSE_NAMED_GROUP(en) (((en)->state & NST_NAMED_GROUP) != 0)
-
-#define SET_CALL_RECURSION(node) (node)->u.call.state |= NST_RECURSION
-#define IS_CALL_RECURSION(cn) (((cn)->state & NST_RECURSION) != 0)
-#define IS_CALL_NAME_REF(cn) (((cn)->state & NST_NAME_REF) != 0)
-#define IS_BACKREF_NAME_REF(bn) (((bn)->state & NST_NAME_REF) != 0)
-#define IS_BACKREF_NEST_LEVEL(bn) (((bn)->state & NST_NEST_LEVEL) != 0)
-#define IS_QUANTIFIER_IN_REPEAT(qn) (((qn)->state & NST_IN_REPEAT) != 0)
-#define IS_QUANTIFIER_BY_NUMBER(qn) (((qn)->state & NST_BY_NUMBER) != 0)
-
-#define CALLNODE_REFNUM_UNDEF -1
-
-typedef struct {
- NodeBase base;
- UChar* s;
- UChar* end;
- unsigned int flag;
- int capa; /* (allocated size - 1) or 0: use buf[] */
- UChar buf[NODE_STR_BUF_SIZE];
-} StrNode;
-
-typedef struct {
- NodeBase base;
- int state;
- struct _Node* target;
- int lower;
- int upper;
- int greedy;
- int target_empty_info;
- struct _Node* head_exact;
- struct _Node* next_head_exact;
- int is_refered; /* include called node. don't eliminate even if {0} */
-#ifdef USE_COMBINATION_EXPLOSION_CHECK
- int comb_exp_check_num; /* 1,2,3...: check, 0: no check */
-#endif
-} QtfrNode;
-
-typedef struct {
- NodeBase base;
- int state;
- int type;
- int regnum;
- OnigOptionType option;
- struct _Node* target;
- AbsAddrType call_addr;
- /* for multiple call reference */
- OnigDistance min_len; /* min length (byte) */
- OnigDistance max_len; /* max length (byte) */
- int char_len; /* character length */
- int opt_count; /* referenced count in optimize_node_left() */
-} EncloseNode;
-
-#ifdef USE_SUBEXP_CALL
-
-typedef struct {
- int offset;
- struct _Node* target;
-} UnsetAddr;
-
-typedef struct {
- int num;
- int alloc;
- UnsetAddr* us;
-} UnsetAddrList;
-
-typedef struct {
- NodeBase base;
- int state;
- int group_num;
- UChar* name;
- UChar* name_end;
- struct _Node* target; /* EncloseNode : ENCLOSE_MEMORY */
- UnsetAddrList* unset_addr_list;
-} CallNode;
-
-#endif
-
-typedef struct {
- NodeBase base;
- int state;
- int back_num;
- int back_static[NODE_BACKREFS_SIZE];
- int* back_dynamic;
- int nest_level;
-} BRefNode;
-
-typedef struct {
- NodeBase base;
- int type;
- struct _Node* target;
- int char_len;
-} AnchorNode;
-
-typedef struct {
- NodeBase base;
- struct _Node* car;
- struct _Node* cdr;
-} ConsAltNode;
-
-typedef struct {
- NodeBase base;
- int ctype;
- int not;
-} CtypeNode;
-
-typedef struct _Node {
- union {
- NodeBase base;
- StrNode str;
- CClassNode cclass;
- QtfrNode qtfr;
- EncloseNode enclose;
- BRefNode bref;
- AnchorNode anchor;
- ConsAltNode cons;
- CtypeNode ctype;
-#ifdef USE_SUBEXP_CALL
- CallNode call;
-#endif
- } u;
-} Node;
-
-
-#define NULL_NODE ((Node* )0)
-
-#define SCANENV_MEMNODES_SIZE 8
-#define SCANENV_MEM_NODES(senv) \
- (IS_NOT_NULL((senv)->mem_nodes_dynamic) ? \
- (senv)->mem_nodes_dynamic : (senv)->mem_nodes_static)
-
-typedef struct {
- OnigOptionType option;
- OnigCaseFoldType case_fold_flag;
- OnigEncoding enc;
- const OnigSyntaxType* syntax;
- BitStatusType capture_history;
- BitStatusType bt_mem_start;
- BitStatusType bt_mem_end;
- BitStatusType backrefed_mem;
- UChar* pattern;
- UChar* pattern_end;
- UChar* error;
- UChar* error_end;
- regex_t* reg; /* for reg->names only */
- int num_call;
-#ifdef USE_SUBEXP_CALL
- UnsetAddrList* unset_addr_list;
-#endif
- int num_mem;
-#ifdef USE_NAMED_GROUP
- int num_named;
-#endif
- int mem_alloc;
- Node* mem_nodes_static[SCANENV_MEMNODES_SIZE];
- Node** mem_nodes_dynamic;
-#ifdef USE_COMBINATION_EXPLOSION_CHECK
- int num_comb_exp_check;
- int comb_exp_max_regnum;
- int curr_max_regnum;
- int has_recursion;
-#endif
-} ScanEnv;
-
-
-#define IS_SYNTAX_OP(syn, opm) (((syn)->op & (opm)) != 0)
-#define IS_SYNTAX_OP2(syn, opm) (((syn)->op2 & (opm)) != 0)
-#define IS_SYNTAX_BV(syn, bvm) (((syn)->behavior & (bvm)) != 0)
-
-#ifdef USE_NAMED_GROUP
-typedef struct {
- int new_val;
-} GroupNumRemap;
-
-extern int onig_renumber_name_table P_((regex_t* reg, GroupNumRemap* map));
-#endif
-
-extern int onig_strncmp P_((const UChar* s1, const UChar* s2, int n));
-extern void onig_strcpy P_((UChar* dest, const UChar* src, const UChar* end));
-extern void onig_scan_env_set_error_string P_((ScanEnv* env, int ecode, UChar* arg, UChar* arg_end));
-extern int onig_scan_unsigned_number P_((UChar** src, const UChar* end, OnigEncoding enc));
-extern void onig_reduce_nested_quantifier P_((Node* pnode, Node* cnode));
-extern void onig_node_conv_to_str_node P_((Node* node, int raw));
-extern int onig_node_str_cat P_((Node* node, const UChar* s, const UChar* end));
-extern int onig_node_str_set P_((Node* node, const UChar* s, const UChar* end));
-extern void onig_node_free P_((Node* node));
-extern Node* onig_node_new_enclose P_((int type));
-extern Node* onig_node_new_anchor P_((int type));
-extern Node* onig_node_new_str P_((const UChar* s, const UChar* end));
-extern Node* onig_node_new_list P_((Node* left, Node* right));
-extern Node* onig_node_list_add P_((Node* list, Node* x));
-extern Node* onig_node_new_alt P_((Node* left, Node* right));
-extern void onig_node_str_clear P_((Node* node));
-extern int onig_free_node_list P_((void));
-extern int onig_names_free P_((regex_t* reg));
-extern int onig_parse_make_tree P_((Node** root, const UChar* pattern, const UChar* end, regex_t* reg, ScanEnv* env));
-extern int onig_free_shared_cclass_table P_((void));
-
-#ifdef ONIG_DEBUG
-#ifdef USE_NAMED_GROUP
-extern int onig_print_names(FILE*, regex_t*);
-#endif
-#endif
-
-#endif /* ONIGURUMA_REGPARSE_H */
diff --git a/regsyntax.c b/regsyntax.c
deleted file mode 100644
index fc639dfcdf..0000000000
--- a/regsyntax.c
+++ /dev/null
@@ -1,315 +0,0 @@
-/**********************************************************************
- regsyntax.c - Oniguruma (regular expression library)
-**********************************************************************/
-/*-
- * Copyright (c) 2002-2006 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 "regint.h"
-
-const OnigSyntaxType OnigSyntaxASIS = {
- 0
- , ONIG_SYN_OP2_INEFFECTIVE_ESCAPE
- , 0
- , ONIG_OPTION_NONE
- ,
- {
- (OnigCodePoint )'\\' /* esc */
- , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anychar '.' */
- , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anytime '*' */
- , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* zero or one time '?' */
- , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* one or more time '+' */
- , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anychar anytime */
- }
-};
-
-const OnigSyntaxType OnigSyntaxPosixBasic = {
- ( SYN_POSIX_COMMON_OP | ONIG_SYN_OP_ESC_LPAREN_SUBEXP |
- ONIG_SYN_OP_ESC_BRACE_INTERVAL )
- , 0
- , 0
- , ( ONIG_OPTION_SINGLELINE | ONIG_OPTION_MULTILINE )
- ,
- {
- (OnigCodePoint )'\\' /* esc */
- , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anychar '.' */
- , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anytime '*' */
- , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* zero or one time '?' */
- , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* one or more time '+' */
- , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anychar anytime */
- }
-};
-
-const OnigSyntaxType OnigSyntaxPosixExtended = {
- ( SYN_POSIX_COMMON_OP | ONIG_SYN_OP_LPAREN_SUBEXP |
- ONIG_SYN_OP_BRACE_INTERVAL |
- ONIG_SYN_OP_PLUS_ONE_INF | ONIG_SYN_OP_QMARK_ZERO_ONE | ONIG_SYN_OP_VBAR_ALT )
- , 0
- , ( ONIG_SYN_CONTEXT_INDEP_ANCHORS |
- ONIG_SYN_CONTEXT_INDEP_REPEAT_OPS | ONIG_SYN_CONTEXT_INVALID_REPEAT_OPS |
- ONIG_SYN_ALLOW_UNMATCHED_CLOSE_SUBEXP |
- ONIG_SYN_ALLOW_DOUBLE_RANGE_OP_IN_CC )
- , ( ONIG_OPTION_SINGLELINE | ONIG_OPTION_MULTILINE )
- ,
- {
- (OnigCodePoint )'\\' /* esc */
- , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anychar '.' */
- , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anytime '*' */
- , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* zero or one time '?' */
- , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* one or more time '+' */
- , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anychar anytime */
- }
-};
-
-const OnigSyntaxType OnigSyntaxEmacs = {
- ( ONIG_SYN_OP_DOT_ANYCHAR | ONIG_SYN_OP_BRACKET_CC |
- ONIG_SYN_OP_ESC_BRACE_INTERVAL |
- ONIG_SYN_OP_ESC_LPAREN_SUBEXP | ONIG_SYN_OP_ESC_VBAR_ALT |
- ONIG_SYN_OP_ASTERISK_ZERO_INF | ONIG_SYN_OP_PLUS_ONE_INF |
- ONIG_SYN_OP_QMARK_ZERO_ONE | ONIG_SYN_OP_DECIMAL_BACKREF |
- ONIG_SYN_OP_LINE_ANCHOR | ONIG_SYN_OP_ESC_CONTROL_CHARS )
- , ONIG_SYN_OP2_ESC_GNU_BUF_ANCHOR
- , ONIG_SYN_ALLOW_EMPTY_RANGE_IN_CC
- , ONIG_OPTION_NONE
- ,
- {
- (OnigCodePoint )'\\' /* esc */
- , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anychar '.' */
- , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anytime '*' */
- , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* zero or one time '?' */
- , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* one or more time '+' */
- , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anychar anytime */
- }
-};
-
-const OnigSyntaxType OnigSyntaxGrep = {
- ( ONIG_SYN_OP_DOT_ANYCHAR | ONIG_SYN_OP_BRACKET_CC | ONIG_SYN_OP_POSIX_BRACKET |
- ONIG_SYN_OP_ESC_BRACE_INTERVAL | ONIG_SYN_OP_ESC_LPAREN_SUBEXP |
- ONIG_SYN_OP_ESC_VBAR_ALT |
- ONIG_SYN_OP_ASTERISK_ZERO_INF | ONIG_SYN_OP_ESC_PLUS_ONE_INF |
- ONIG_SYN_OP_ESC_QMARK_ZERO_ONE | ONIG_SYN_OP_LINE_ANCHOR |
- ONIG_SYN_OP_ESC_W_WORD | ONIG_SYN_OP_ESC_B_WORD_BOUND |
- ONIG_SYN_OP_ESC_LTGT_WORD_BEGIN_END | ONIG_SYN_OP_DECIMAL_BACKREF )
- , 0
- , ( ONIG_SYN_ALLOW_EMPTY_RANGE_IN_CC | ONIG_SYN_NOT_NEWLINE_IN_NEGATIVE_CC )
- , ONIG_OPTION_NONE
- ,
- {
- (OnigCodePoint )'\\' /* esc */
- , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anychar '.' */
- , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anytime '*' */
- , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* zero or one time '?' */
- , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* one or more time '+' */
- , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anychar anytime */
- }
-};
-
-const OnigSyntaxType OnigSyntaxGnuRegex = {
- SYN_GNU_REGEX_OP
- , 0
- , SYN_GNU_REGEX_BV
- , ONIG_OPTION_NONE
- ,
- {
- (OnigCodePoint )'\\' /* esc */
- , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anychar '.' */
- , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anytime '*' */
- , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* zero or one time '?' */
- , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* one or more time '+' */
- , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anychar anytime */
- }
-};
-
-const OnigSyntaxType OnigSyntaxJava = {
- (( SYN_GNU_REGEX_OP | ONIG_SYN_OP_QMARK_NON_GREEDY |
- ONIG_SYN_OP_ESC_CONTROL_CHARS | ONIG_SYN_OP_ESC_C_CONTROL |
- ONIG_SYN_OP_ESC_OCTAL3 | ONIG_SYN_OP_ESC_X_HEX2 )
- & ~ONIG_SYN_OP_ESC_LTGT_WORD_BEGIN_END )
- , ( ONIG_SYN_OP2_ESC_CAPITAL_Q_QUOTE | ONIG_SYN_OP2_QMARK_GROUP_EFFECT |
- ONIG_SYN_OP2_OPTION_PERL | ONIG_SYN_OP2_PLUS_POSSESSIVE_REPEAT |
- ONIG_SYN_OP2_PLUS_POSSESSIVE_INTERVAL | ONIG_SYN_OP2_CCLASS_SET_OP |
- ONIG_SYN_OP2_ESC_V_VTAB | ONIG_SYN_OP2_ESC_U_HEX4 |
- ONIG_SYN_OP2_ESC_P_BRACE_CHAR_PROPERTY )
- , ( SYN_GNU_REGEX_BV | ONIG_SYN_DIFFERENT_LEN_ALT_LOOK_BEHIND )
- , ONIG_OPTION_SINGLELINE
- ,
- {
- (OnigCodePoint )'\\' /* esc */
- , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anychar '.' */
- , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anytime '*' */
- , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* zero or one time '?' */
- , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* one or more time '+' */
- , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anychar anytime */
- }
-};
-
-const OnigSyntaxType OnigSyntaxPerl = {
- (( SYN_GNU_REGEX_OP | ONIG_SYN_OP_QMARK_NON_GREEDY |
- ONIG_SYN_OP_ESC_OCTAL3 | ONIG_SYN_OP_ESC_X_HEX2 |
- ONIG_SYN_OP_ESC_X_BRACE_HEX8 | ONIG_SYN_OP_ESC_CONTROL_CHARS |
- ONIG_SYN_OP_ESC_C_CONTROL )
- & ~ONIG_SYN_OP_ESC_LTGT_WORD_BEGIN_END )
- , ( ONIG_SYN_OP2_ESC_CAPITAL_Q_QUOTE |
- ONIG_SYN_OP2_QMARK_GROUP_EFFECT | ONIG_SYN_OP2_OPTION_PERL |
- ONIG_SYN_OP2_ESC_P_BRACE_CHAR_PROPERTY |
- ONIG_SYN_OP2_ESC_P_BRACE_CIRCUMFLEX_NOT )
- , SYN_GNU_REGEX_BV
- , ONIG_OPTION_SINGLELINE
- ,
- {
- (OnigCodePoint )'\\' /* esc */
- , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anychar '.' */
- , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anytime '*' */
- , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* zero or one time '?' */
- , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* one or more time '+' */
- , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anychar anytime */
- }
-};
-
-/* Perl + named group */
-const OnigSyntaxType OnigSyntaxPerl_NG = {
- (( SYN_GNU_REGEX_OP | ONIG_SYN_OP_QMARK_NON_GREEDY |
- ONIG_SYN_OP_ESC_OCTAL3 | ONIG_SYN_OP_ESC_X_HEX2 |
- ONIG_SYN_OP_ESC_X_BRACE_HEX8 | ONIG_SYN_OP_ESC_CONTROL_CHARS |
- ONIG_SYN_OP_ESC_C_CONTROL )
- & ~ONIG_SYN_OP_ESC_LTGT_WORD_BEGIN_END )
- , ( ONIG_SYN_OP2_ESC_CAPITAL_Q_QUOTE |
- ONIG_SYN_OP2_QMARK_GROUP_EFFECT | ONIG_SYN_OP2_OPTION_PERL |
- ONIG_SYN_OP2_ESC_P_BRACE_CHAR_PROPERTY |
- ONIG_SYN_OP2_ESC_P_BRACE_CIRCUMFLEX_NOT |
- ONIG_SYN_OP2_QMARK_LT_NAMED_GROUP |
- ONIG_SYN_OP2_ESC_K_NAMED_BACKREF |
- ONIG_SYN_OP2_ESC_G_SUBEXP_CALL )
- , ( SYN_GNU_REGEX_BV |
- ONIG_SYN_CAPTURE_ONLY_NAMED_GROUP |
- ONIG_SYN_ALLOW_MULTIPLEX_DEFINITION_NAME )
- , ONIG_OPTION_SINGLELINE
- ,
- {
- (OnigCodePoint )'\\' /* esc */
- , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anychar '.' */
- , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anytime '*' */
- , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* zero or one time '?' */
- , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* one or more time '+' */
- , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anychar anytime */
- }
-};
-
-
-
-extern int
-onig_set_default_syntax(const OnigSyntaxType* syntax)
-{
- if (IS_NULL(syntax))
- syntax = ONIG_SYNTAX_RUBY;
-
- OnigDefaultSyntax = syntax;
- return 0;
-}
-
-extern void
-onig_copy_syntax(OnigSyntaxType* to, const OnigSyntaxType* from)
-{
- *to = *from;
-}
-
-extern void
-onig_set_syntax_op(OnigSyntaxType* syntax, unsigned int op)
-{
- syntax->op = op;
-}
-
-extern void
-onig_set_syntax_op2(OnigSyntaxType* syntax, unsigned int op2)
-{
- syntax->op2 = op2;
-}
-
-extern void
-onig_set_syntax_behavior(OnigSyntaxType* syntax, unsigned int behavior)
-{
- syntax->behavior = behavior;
-}
-
-extern void
-onig_set_syntax_options(OnigSyntaxType* syntax, OnigOptionType options)
-{
- syntax->options = options;
-}
-
-extern unsigned int
-onig_get_syntax_op(OnigSyntaxType* syntax)
-{
- return syntax->op;
-}
-
-extern unsigned int
-onig_get_syntax_op2(OnigSyntaxType* syntax)
-{
- return syntax->op2;
-}
-
-extern unsigned int
-onig_get_syntax_behavior(OnigSyntaxType* syntax)
-{
- return syntax->behavior;
-}
-
-extern OnigOptionType
-onig_get_syntax_options(OnigSyntaxType* syntax)
-{
- return syntax->options;
-}
-
-#ifdef USE_VARIABLE_META_CHARS
-extern int onig_set_meta_char(OnigSyntaxType* enc,
- unsigned int what, OnigCodePoint code)
-{
- switch (what) {
- case ONIG_META_CHAR_ESCAPE:
- enc->meta_char_table.esc = code;
- break;
- case ONIG_META_CHAR_ANYCHAR:
- enc->meta_char_table.anychar = code;
- break;
- case ONIG_META_CHAR_ANYTIME:
- enc->meta_char_table.anytime = code;
- break;
- case ONIG_META_CHAR_ZERO_OR_ONE_TIME:
- enc->meta_char_table.zero_or_one_time = code;
- break;
- case ONIG_META_CHAR_ONE_OR_MORE_TIME:
- enc->meta_char_table.one_or_more_time = code;
- break;
- case ONIG_META_CHAR_ANYCHAR_ANYTIME:
- enc->meta_char_table.anychar_anytime = code;
- break;
- default:
- return ONIGERR_INVALID_ARGUMENT;
- break;
- }
- return 0;
-}
-#endif /* USE_VARIABLE_META_CHARS */
diff --git a/ruby.1 b/ruby.1
new file mode 100644
index 0000000000..f240f2f22b
--- /dev/null
+++ b/ruby.1
@@ -0,0 +1,351 @@
+.\"Ruby is copyrighted by Yukihiro Matsumoto <matz@netlab.jp>.
+.Dd December 31, 2002
+.Dt RUBY(1) "" "Ruby Programmers Reference Guide"
+.\".Dt RUBY 1
+.Os UNIX
+.Sh NAME
+.Nm ruby
+.Nd Interpreted object-oriented scripting language
+.Sh SYNOPSIS
+.Nm
+.Op Fl -copyright
+.Op Fl -version
+.Op Fl Sacdlnpswvy
+.Op Fl 0 Ns Op Ar octal
+.Op Fl C Ar directory
+.Op Fl F Ar pattern
+.Op Fl I Ar directory
+.Op Fl K Ar c
+.Op Fl T Ns Op Ar level
+.Op Fl e Ar command
+.Op Fl i Ns Op Ar extension
+.Op Fl r Ar library
+.Op Fl x Ns Op Ar directory
+.Op Fl -
+.Op Ar program_file
+.Op Ar argument ...
+.Sh DESCRIPTION
+Ruby is an 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.
+.Pp
+If you want a language for easy object-oriented programming, or you
+don't like the Perl ugliness, or you do like the concept of LISP, but
+don't like too much parentheses, Ruby may be the language of your
+choice.
+.Sh FEATURES
+Ruby's features are as follows:
+.Bl -tag -width 6n
+.It Sy "Interpretive"
+Ruby is an interpreted language, so you don't have to recompile
+programs written in Ruby to execute them.
+.Pp
+.It Sy "Variables have no type (dynamic typing)"
+Variables in Ruby can contain data of any type. You don't have to
+worry about variable typing. Consequently, it has a weaker compile
+time check.
+.Pp
+.It Sy "No declaration needed"
+You can use variables in your Ruby programs without any declarations.
+Variable names denote their scope, local, global, instance, etc.
+.Pp
+.It Sy "Simple syntax"
+Ruby has a simple syntax influenced slightly from Eiffel.
+.Pp
+.It Sy "No user-level memory management"
+Ruby has automatic memory management. Objects no longer referenced
+from anywhere are automatically collected by the garbage collector
+built into the interpreter.
+.Pp
+.It Sy "Everything is an object"
+Ruby is the purely object-oriented language, and was so since its
+creation. Even such basic data as integers are seen as objects.
+.Pp
+.It Sy "Class, inheritance, and methods"
+Of course, as an object-oriented language, Ruby has such basic
+features like classes, inheritance, and methods.
+.Pp
+.It Sy "Singleton methods"
+Ruby has the ability to define methods for certain objects. For
+example, you can define a press-button action for certain widget by
+defining a singleton method for the button. Or, you can make up your
+own prototype based object system using singleton methods, if you want
+to.
+.Pp
+.It Sy "Mix-in by modules"
+Ruby intentionally does not have the multiple inheritance as it is a
+source of confusion. Instead, Ruby has the ability to share
+implementations across the inheritance tree. This is often called
+.Sq Mix-in .
+.Pp
+.It Sy "Iterators"
+Ruby has iterators for loop abstraction.
+.Pp
+.It Sy "Closures"
+In Ruby, you can objectify the procedure.
+.Pp
+.It Sy "Text processing and regular expression"
+Ruby has a bunch of text processing features like in Perl.
+.Pp
+.It Sy "Bignums"
+With built-in bignums, you can for example calculate factorial(400).
+.Pp
+.It Sy "Exception handling"
+As in Java(tm).
+.Pp
+.It Sy "Direct access to the OS"
+Ruby can use most
+.Ux
+system calls, often used in system programming.
+.Pp
+.It Sy "Dynamic loading"
+On most
+.Ux
+systems, you can load object files into the Ruby interpreter
+on-the-fly.
+.El
+.Pp
+.Sh OPTIONS
+Ruby interpreter accepts following command-line options (switches).
+They are quite similar to those of
+.Xr perl 1 .
+.Bl -tag -width "1234567890123" -compact
+.Pp
+.It Fl -copyright
+Prints the copyright notice.
+.Pp
+.It Fl -version
+Prints the version of Ruby interpreter.
+.Pp
+.It Fl 0 Ns Op Ar octal
+(The digit
+.Dq zero . )
+Specifies the input record separator
+.Pf ( Li "$/" )
+as an octal number. If no digit is given, the null character is taken
+as the separator. Other switches may follow the digits.
+.Fl 00
+turns Ruby into paragraph mode.
+.Fl 0777
+makes Ruby read whole file at once as a single string since there is
+no legal character with that value.
+.Pp
+.It Fl C Ar directory
+Causes Ruby to switch to the directory.
+.Pp
+.It Fl F Ar pattern
+Specifies input field separator
+.Pf ( Li "$;" ) .
+.Pp
+.It Fl I Ar directory
+Used to tell Ruby where to load the library scripts. Directory path
+will be added to the load-path variable
+.Pf ( Li "$:" ) .
+.Pp
+.It Fl K Ar kcode
+Specifies KANJI (Japanese) encoding.
+.Pp
+.It Fl S
+Makes Ruby use the
+.Ev PATH
+environment variable to search for script, unless if its name begins
+with a slash. This is used to emulate
+.Li #!
+on machines that don't support it, in the following manner:
+.Bd -literal -offset indent
+#! /usr/local/bin/ruby
+# This line makes the next one a comment in Ruby \e
+ exec /usr/local/bin/ruby -S $0 $*
+.Ed
+.Pp
+.It Fl T Ns Op Ar level
+Turns on taint checks at the specified level (default 1).
+.Pp
+.It Fl a
+Turns on auto-split mode when used with
+.Fl n
+or
+.Fl p .
+In auto-split mode, Ruby executes
+.Dl $F = $_.split
+at beginning of each loop.
+.Pp
+.It Fl c
+Causes Ruby to check the syntax of the script and exit without
+executing. If there are no syntax errors, Ruby will print
+.Dq Syntax OK
+to the standard output.
+.Pp
+.It Fl d
+.It Fl -debug
+Turns on debug mode.
+.Li "$DEBUG"
+will be set to true.
+.Pp
+.It Fl e Ar command
+Specifies script from command-line while telling Ruby not to search
+the rest of arguments for a script file name.
+.Pp
+.It Fl h
+.It Fl -help
+Prints a summary of the options.
+.Pp
+.It Fl i Ar extension
+Specifies in-place-edit mode. The extension, if specified, is added
+to old file name to make a backup copy. For example:
+.Bd -literal -offset indent
+% echo matz > /tmp/junk
+% cat /tmp/junk
+matz
+% ruby -p -i.bak -e '$_.upcase!' /tmp/junk
+% cat /tmp/junk
+MATZ
+% cat /tmp/junk.bak
+matz
+.Ed
+.Pp
+.It Fl l
+(The lowercase letter
+.Dq ell . )
+Enables automatic line-ending processing, which means to firstly set
+.Li "$\e"
+to the value of
+.Li "$/" ,
+and secondly chops every line read using
+.Li chop! .
+.Pp
+.It Fl n
+Causes Ruby to assume the following loop around your script, which
+makes it iterate over file name arguments somewhat like
+.Nm sed
+.Fl n
+or
+.Nm awk .
+.Bd -literal -offset indent
+while gets
+ ...
+end
+.Ed
+.Pp
+.It Fl p
+Acts mostly same as -n switch, but print the value of variable
+.Li "$_"
+at the each end of the loop. For example:
+.Bd -literal -offset indent
+% echo matz | ruby -p -e '$_.tr! "a-z", "A-Z"'
+MATZ
+.Ed
+.Pp
+.It Fl r Ar library
+Causes Ruby to load the library using require. It is useful when using
+.Fl n
+or
+.Fl p .
+.Pp
+.It Fl s
+Enables some switch parsing for switches after script name but before
+any file name arguments (or before a
+.Fl - ) .
+Any switches found there are removed from
+.Li ARGV
+and set the corresponding variable in the script. For example:
+.Bd -literal -offset indent
+#! /usr/local/bin/ruby -s
+# prints "true" if invoked with `-xyz' switch.
+print "true\en" if $xyz
+.Ed
+.Pp
+On some systems
+.Li "$0"
+does not always contain the full pathname, so you need the
+.Fl S
+switch to tell Ruby to search for the script if necessary. To handle
+embedded spaces or such. A better construct than
+.Li "$*"
+would be
+.Li ${1+"$@"} ,
+but it does not work if the script is being interpreted by
+.Xr csh 1 .
+.Pp
+.It Fl v
+.It Fl -verbose
+Enables verbose mode. Ruby will print its version at the beginning,
+and set the variable
+.Li "$VERBOSE"
+to true. Some methods print extra messages if this variable is true.
+If this switch is given, and no other switches are present, Ruby quits
+after printing its version.
+.Pp
+.It Fl w
+Enables verbose mode without printing version message at the
+beginning. It sets the
+.Li "$VERBOSE"
+variable to true.
+.Pp
+.It Fl x Ns Op Ar directory
+Tells Ruby that the script is embedded in a message. Leading garbage
+will be discarded until the first that starts with
+.Dq #!
+and contains the string,
+.Dq ruby .
+Any meaningful switches on that line will applied. The end of script
+must be specified with either
+.Li EOF ,
+.Li "^D" ( Li "control-D" ) ,
+.Li "^Z" ( Li "control-Z" ) ,
+or reserved word
+.Li __END__ .
+If the directory name is specified, Ruby will switch to that directory
+before executing script.
+.Pp
+.It Fl y
+.It Fl -yydebug
+Turns on compiler debug mode. Ruby will print a bunch of internal
+state messages during compiling scripts. You don't have to specify
+this switch, unless you are going to debug the Ruby interpreter.
+.El
+.Pp
+.Sh ENVIRONMENT
+.Bl -tag -width "RUBYLIB_PREFIX" -compact
+.It Ev RUBYLIB
+A colon-separated list of directories that are added to Ruby's
+library load path
+.Pf ( Li "$:" ) . Directories from this environment variable are searched
+before the standard load path is searched.
+.Pp
+e.g.:
+.Dl RUBYLIB="$HOME/lib/ruby:$HOME/lib/rubyext"
+.Pp
+.It Ev RUBYOPT
+Additional Ruby options.
+.Pp
+e.g.
+.Dl RUBYOPT="-w -Ke"
+.Pp
+.It Ev RUBYPATH
+A colon-separated list of directories that Ruby searches for
+Ruby programs when the
+.Fl S
+flag is specified. This variable precedes the
+.Ev PATH
+environment variable.
+.Pp
+.It Ev RUBYSHELL
+The path to the system shell command. This environment variable is
+enabled for only mswin32, mingw32, and OS/2 platforms. If this
+variable is not defined, Ruby refers to
+.Ev COMSPEC .
+.Pp
+.It Ev PATH
+Ruby refers to the
+.Ev PATH
+environment variable on calling Kernel#system.
+.Pp
+.It Ev RUBYLIB_PREFIX
+This variable is obsolete.
+.El
+.Pp
+.Sh AUTHORS
+Ruby is designed and implemented by
+.An Yukihiro Matsumoto Aq matz@netlab.jp .
diff --git a/ruby.c b/ruby.c
index 180455e92d..fab9cc47d7 100644
--- a/ruby.c
+++ b/ruby.c
@@ -3,22 +3,28 @@
ruby.c -
$Author$
+ $Date$
created at: Tue Aug 10 12:47:31 JST 1993
- Copyright (C) 1993-2007 Yukihiro Matsumoto
+ Copyright (C) 1993-2003 Yukihiro Matsumoto
Copyright (C) 2000 Network Applied Communication Laboratory, Inc.
Copyright (C) 2000 Information-technology Promotion Agency, Japan
**********************************************************************/
-#ifdef __CYGWIN__
+#if defined _WIN32 || defined __CYGWIN__
#include <windows.h>
+#endif
+#if defined __CYGWIN__
#include <sys/cygwin.h>
#endif
-#include "ruby/ruby.h"
-#include "ruby/encoding.h"
-#include "eval_intern.h"
+#ifdef _WIN32_WCE
+#include <winsock.h>
+#include "wince.h"
+#endif
+#include "ruby.h"
#include "dln.h"
+#include "node.h"
#include <stdio.h>
#include <sys/types.h>
#include <ctype.h>
@@ -26,136 +32,77 @@
#ifdef __hpux
#include <sys/pstat.h>
#endif
-#if defined(LOAD_RELATIVE) && defined(HAVE_DLADDR)
-#include <dlfcn.h>
-#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
-#if defined(HAVE_FCNTL_H)
-#include <fcntl.h>
-#elif defined(HAVE_SYS_FCNTL_H)
-#include <sys/fcntl.h>
-#endif
-#ifdef HAVE_SYS_PARAM_H
-# include <sys/param.h>
-#endif
-#ifndef MAXPATHLEN
-# define MAXPATHLEN 1024
+
+#ifndef HAVE_STRING_H
+char *strchr _((const char*,const char));
+char *strrchr _((const char*,const char));
+char *strstr _((const char*,const char*));
#endif
-#include "ruby/util.h"
+#include "util.h"
#ifndef HAVE_STDLIB_H
char *getenv();
#endif
-VALUE rb_parser_get_yydebug(VALUE);
-VALUE rb_parser_set_yydebug(VALUE, VALUE);
+VALUE ruby_debug = Qfalse;
+VALUE ruby_verbose = Qfalse;
+static int sflag = 0;
+static int xflag = 0;
+extern int ruby_yydebug;
-const char *ruby_get_inplace_mode(void);
-void ruby_set_inplace_mode(const char *);
+char *ruby_inplace_mode = Qfalse;
-#define DISABLE_BIT(bit) (1U << disable_##bit)
-enum disable_flag_bits {
- disable_gems,
- disable_rubyopt,
- disable_flag_count
-};
+static void load_stdin _((void));
+static void load_file _((const char *, int));
+static void forbid_setid _((const char *));
-#define DUMP_BIT(bit) (1U << dump_##bit)
-enum dump_flag_bits {
- dump_version,
- dump_copyright,
- dump_usage,
- dump_yydebug,
- dump_syntax,
- dump_insns,
- dump_flag_count
-};
+static VALUE do_loop = Qfalse, do_print = Qfalse;
+static VALUE do_check = Qfalse, do_line = Qfalse;
+static VALUE do_split = Qfalse;
-struct cmdline_options {
- int sflag, xflag;
- int do_loop, do_print;
- int do_line, do_split;
- int do_search;
- unsigned int disable;
- int verbose;
- int safe_level;
- unsigned int setids;
- unsigned int dump;
- const char *script;
- VALUE script_name;
- VALUE e_script;
- struct {
- struct {
- VALUE name;
- int index;
- } enc;
- } src, ext, intern;
- VALUE req_list;
-};
+static const char *script;
-static void init_ids(struct cmdline_options *);
-
-#define src_encoding_index GET_VM()->src_encoding_index
-
-static struct cmdline_options *
-cmdline_options_init(struct cmdline_options *opt)
-{
- MEMZERO(opt, *opt, 1);
- init_ids(opt);
- opt->src.enc.index = src_encoding_index;
- opt->ext.enc.index = -1;
- opt->intern.enc.index = -1;
- return opt;
-}
-
-static NODE *load_file(VALUE, const char *, int, struct cmdline_options *);
-static void forbid_setid(const char *, struct cmdline_options *);
-#define forbid_setid(s) forbid_setid(s, opt)
-
-static struct {
- int argc;
- char **argv;
-#if !defined(PSTAT_SETCMD) && !defined(HAVE_SETPROCTITLE)
- size_t len;
-#endif
-} origarg;
+static int origargc;
+static char **origargv;
static void
-usage(const char *name)
+usage(name)
+ const char *name;
{
/* This message really ought to be max 23 lines.
* Removed -h because the user already knows that option. Others? */
static const char *const usage_msg[] = {
- "-0[octal] specify record separator (\\0, if no argument)",
- "-a autosplit mode with -n or -p (splits $_ into $F)",
- "-c check syntax only",
- "-Cdirectory cd to directory, before executing your script",
- "-d set debugging flags (set $DEBUG to true)",
- "-e 'command' one line of script. Several -e's allowed. Omit [programfile]",
- "-Eex[:in] specify the default external and internal character encodings",
- "-Fpattern split() pattern for autosplit (-a)",
- "-i[extension] edit ARGV files in place (make backup if extension supplied)",
- "-Idirectory specify $LOAD_PATH directory (may be used more than once)",
- "-l enable line ending processing",
- "-n assume 'while gets(); ... end' loop around your script",
- "-p assume loop like -n but print line also like sed",
- "-rlibrary require the library, before executing your script",
- "-s enable some switch parsing for switches after script name",
- "-S look for the script using PATH environment variable",
- "-T[level] turn on tainting checks",
- "-v print version number, then turn on verbose mode",
- "-w turn warnings on for your script",
- "-W[level] set warning level; 0=silence, 1=medium, 2=verbose (default for level)",
- "-x[directory] strip off text before #!ruby line and perhaps cd to directory",
- "--copyright print the copyright",
- "--version print the version",
- NULL
- };
+"-0[octal] specify record separator (\\0, if no argument)",
+"-a autosplit mode with -n or -p (splits $_ into $F)",
+"-c check syntax only",
+"-Cdirectory cd to directory, before executing your script",
+"-d set debugging flags (set $DEBUG to true)",
+"-e 'command' one line of script. Several -e's allowed. Omit [programfile]",
+"-Fpattern split() pattern for autosplit (-a)",
+"-i[extension] edit ARGV files in place (make backup if extension supplied)",
+"-Idirectory specify $LOAD_PATH directory (may be used more than once)",
+"-Kkcode specifies KANJI (Japanese) code-set",
+"-l enable line ending processing",
+"-n assume 'while gets(); ... end' loop around your script",
+"-p assume loop like -n but print line also like sed",
+"-rlibrary require the library, before executing your script",
+"-s enable some switch parsing for switches after script name",
+"-S look for the script using PATH environment variable",
+"-T[level] turn on tainting checks",
+"-v print version number, then turn on verbose mode",
+"-w turn warnings on for your script",
+"-W[level] set warning level; 0=silence, 1=medium, 2=verbose (default)",
+"-x[directory] strip off text before #!ruby line and perhaps cd to directory",
+"--copyright print the copyright",
+"--version print the version",
+NULL
+};
const char *const *p = usage_msg;
printf("Usage: %s [switches] [--] [programfile] [arguments]\n", name);
@@ -163,9 +110,25 @@ usage(const char *name)
printf(" %s\n", *p++);
}
-VALUE rb_get_load_path(void);
+extern VALUE rb_load_path;
+
+#ifndef CharNext /* defined as CharNext[AW] on Windows. */
+#define CharNext(p) ((p) + mblen(p, RUBY_MBCHAR_MAXSIZE))
+#endif
+
+#if defined DOSISH || defined __CYGWIN__
+static inline void
+translate_char(char *p, int from, int to)
+{
+ while (*p) {
+ if ((unsigned char)*p == from)
+ *p = to;
+ p = CharNext(p);
+ }
+}
+#endif
-#ifdef MANGLED_PATH
+#if defined _WIN32 || defined __CYGWIN__ || defined __DJGPP__
static VALUE
rubylib_mangled_path(const char *s, unsigned int l)
{
@@ -189,13 +152,13 @@ rubylib_mangled_path(const char *s, unsigned int l)
if (newl == 0 || oldl == 0) {
rb_fatal("malformed RUBYLIB_PREFIX");
}
- translit_char(newp, '\\', '/');
+ translate_char(newp, '\\', '/');
}
else {
notfound = 1;
}
}
- if (!newp || l < oldl || STRNCASECMP(oldp, s, oldl) != 0) {
+ if (!newp || l < oldl || strncasecmp(oldp, s, oldl) != 0) {
return rb_str_new(s, l);
}
ret = rb_str_new(0, l + newl - oldl);
@@ -205,16 +168,25 @@ rubylib_mangled_path(const char *s, unsigned int l)
ptr[l + newl - oldl] = 0;
return ret;
}
+
+static VALUE
+rubylib_mangled_path2(const char *s)
+{
+ return rubylib_mangled_path(s, strlen(s));
+}
#else
#define rubylib_mangled_path rb_str_new
+#define rubylib_mangled_path2 rb_str_new2
#endif
+static void push_include _((const char *path));
+
static void
-push_include(const char *path, VALUE (*filter)(VALUE))
+push_include(path)
+ const char *path;
{
const char sep = PATH_SEP_CHAR;
const char *p, *s;
- VALUE load_path = GET_VM()->load_path;
p = path;
while (*p) {
@@ -222,14 +194,14 @@ push_include(const char *path, VALUE (*filter)(VALUE))
p++;
if (!*p) break;
for (s = p; *s && *s != sep; s = CharNext(s));
- rb_ary_push(load_path, (*filter)(rubylib_mangled_path(p, s - p)));
+ rb_ary_push(rb_load_path, rubylib_mangled_path(p, s - p));
p = s;
}
}
#ifdef __CYGWIN__
static void
-push_include_cygwin(const char *path, VALUE (*filter)(VALUE))
+push_include_cygwin(const char *path)
{
const char *p, *s;
char rubylib[FILENAME_MAX];
@@ -255,7 +227,7 @@ push_include_cygwin(const char *path, VALUE (*filter)(VALUE))
}
if (cygwin_conv_to_posix_path(p, rubylib) == 0)
p = rubylib;
- push_include(p, filter);
+ push_include(p);
if (!*s) break;
p = s + 1;
}
@@ -265,242 +237,187 @@ push_include_cygwin(const char *path, VALUE (*filter)(VALUE))
#endif
void
-ruby_push_include(const char *path, VALUE (*filter)(VALUE))
+ruby_incpush(path)
+ const char *path;
{
if (path == 0)
return;
- push_include(path, filter);
+ push_include(path);
}
-static VALUE
-identical_path(VALUE path)
-{
- return path;
-}
-static VALUE
-locale_path(VALUE path)
-{
- rb_enc_associate(path, rb_locale_encoding());
- return path;
-}
-
-void
-ruby_incpush(const char *path)
-{
- ruby_push_include(path, locale_path);
-}
-
-static VALUE
-expand_include_path(VALUE path)
-{
- char *p = RSTRING_PTR(path);
- if (!p)
- return path;
- if (*p == '.' && p[1] == '/')
- return path;
- return rb_file_expand_path(path, Qnil);
-}
-
-void
-ruby_incpush_expand(const char *path)
-{
- ruby_push_include(path, expand_include_path);
-}
-
-#if defined _WIN32 || defined __CYGWIN__
-static HMODULE libruby;
-
-BOOL WINAPI
-DllMain(HINSTANCE dll, DWORD reason, LPVOID reserved)
-{
- if (reason == DLL_PROCESS_ATTACH)
- libruby = dll;
- return TRUE;
-}
-
-HANDLE
-rb_libruby_handle(void)
-{
- return libruby;
-}
+#if defined DOSISH || defined __CYGWIN__
+#define LOAD_RELATIVE 1
#endif
-void ruby_init_loadpath_safe(int safe_level);
-
void
-ruby_init_loadpath(void)
+ruby_init_loadpath()
{
- ruby_init_loadpath_safe(0);
-}
-
-void
-ruby_init_loadpath_safe(int safe_level)
-{
- VALUE load_path;
- extern const char ruby_initial_load_paths[];
- const char *paths = ruby_initial_load_paths;
#if defined LOAD_RELATIVE
-# if defined HAVE_DLADDR || (defined __CYGWIN__ && defined CCP_WIN_A_TO_POSIX)
-# define VARIABLE_LIBPATH 1
-# else
-# define VARIABLE_LIBPATH 0
-# endif
-# if VARIABLE_LIBPATH
- char *libpath;
- VALUE sopath;
-# else
- char libpath[MAXPATHLEN + 1];
- size_t baselen;
-# endif
+ char libpath[FILENAME_MAX+1];
char *p;
-
+ int rest;
#if defined _WIN32 || defined __CYGWIN__
-# if VARIABLE_LIBPATH
- sopath = rb_str_tmp_new(MAXPATHLEN);
- libpath = RSTRING_PTR(sopath);
- GetModuleFileName(libruby, libpath, MAXPATHLEN);
-# else
+ HMODULE libruby = NULL;
+ MEMORY_BASIC_INFORMATION m;
+
+#ifndef _WIN32_WCE
+ memset(&m, 0, sizeof(m));
+ if (VirtualQuery(ruby_init_loadpath, &m, sizeof(m)) && m.State == MEM_COMMIT)
+ libruby = (HMODULE)m.AllocationBase;
+#endif
GetModuleFileName(libruby, libpath, sizeof libpath);
-# endif
+#elif defined(DJGPP)
+ extern char *__dos_argv0;
+ strncpy(libpath, __dos_argv0, FILENAME_MAX);
+#elif defined(__human68k__)
+ extern char **_argv;
+ strncpy(libpath, _argv[0], FILENAME_MAX);
#elif defined(__EMX__)
- _execname(libpath, sizeof(libpath) - 1);
-#elif defined(HAVE_DLADDR)
- Dl_info dli;
- if (dladdr(expand_include_path, &dli)) {
- VALUE fname = rb_str_new_cstr(dli.dli_fname);
- sopath = rb_file_absolute_path(fname, Qnil);
- rb_str_resize(fname, 0);
- libpath = RSTRING_PTR(sopath);
- }
+ _execname(libpath, FILENAME_MAX);
#endif
-#if !VARIABLE_LIBPATH
- libpath[sizeof(libpath) - 1] = '\0';
-#endif
+ libpath[FILENAME_MAX] = '\0';
#if defined DOSISH
- translit_char(libpath, '\\', '/');
+ translate_char(libpath, '\\', '/');
#elif defined __CYGWIN__
{
-# if VARIABLE_LIBPATH
- const int win_to_posix = CCP_WIN_A_TO_POSIX | CCP_RELATIVE;
- size_t newsize = cygwin_conv_path(win_to_posix, libpath, 0, 0);
- if (newsize > 0) {
- VALUE rubylib = rb_str_tmp_new(newsize);
- p = RSTRING_PTR(rubylib);
- if (cygwin_conv_path(win_to_posix, libpath, p, newsize) == 0) {
- rb_str_resize(sopath, 0);
- sopath = rubylib;
- libpath = p;
- }
- }
-# else
char rubylib[FILENAME_MAX];
cygwin_conv_to_posix_path(libpath, rubylib);
strncpy(libpath, rubylib, sizeof(libpath));
-# endif
}
#endif
p = strrchr(libpath, '/');
if (p) {
*p = 0;
- if (p - libpath > 3 && !(STRCASECMP(p - 4, "/bin") && strcmp(p - 4, "/lib"))) {
+ if (p - libpath > 3 && !strcasecmp(p - 4, "/bin")) {
p -= 4;
*p = 0;
}
}
-#if !VARIABLE_LIBPATH
else {
- strlcpy(libpath, ".", sizeof(libpath));
+ strcpy(libpath, ".");
p = libpath + 1;
}
- baselen = p - libpath;
+ rest = FILENAME_MAX - (p - libpath);
-#define BASEPATH() rb_str_buf_cat(rb_str_buf_new(baselen+len), libpath, baselen)
+#define RUBY_RELATIVE(path) (strncpy(p, (path), rest), libpath)
#else
- rb_str_set_len(sopath, p - libpath);
+#define RUBY_RELATIVE(path) (path)
+#endif
+#define incpush(path) rb_ary_push(rb_load_path, rubylib_mangled_path2(path))
+
+ if (rb_safe_level() == 0) {
+ ruby_incpush(getenv("RUBYLIB"));
+ }
-#define BASEPATH() rb_str_dup(sopath)
+#ifdef RUBY_SEARCH_PATH
+ incpush(RUBY_RELATIVE(RUBY_SEARCH_PATH));
#endif
-#define RUBY_RELATIVE(path, len) rb_str_buf_cat(BASEPATH(), path, len)
-#else
-#define RUBY_RELATIVE(path, len) rubylib_mangled_path(path, len)
+ incpush(RUBY_RELATIVE(RUBY_SITE_LIB2));
+#ifdef RUBY_SITE_THIN_ARCHLIB
+ incpush(RUBY_RELATIVE(RUBY_SITE_THIN_ARCHLIB));
#endif
-#define incpush(path) rb_ary_push(load_path, (path))
- load_path = GET_VM()->load_path;
+ incpush(RUBY_RELATIVE(RUBY_SITE_ARCHLIB));
+ incpush(RUBY_RELATIVE(RUBY_SITE_LIB));
- if (safe_level == 0) {
- ruby_push_include(getenv("RUBYLIB"), identical_path);
- }
+ incpush(RUBY_RELATIVE(RUBY_VENDOR_LIB2));
+#ifdef RUBY_VENDOR_THIN_ARCHLIB
+ incpush(RUBY_RELATIVE(RUBY_VENDOR_THIN_ARCHLIB));
+#endif
+ incpush(RUBY_RELATIVE(RUBY_VENDOR_ARCHLIB));
+ incpush(RUBY_RELATIVE(RUBY_VENDOR_LIB));
- while (*paths) {
- size_t len = strlen(paths);
- incpush(RUBY_RELATIVE(paths, len));
- paths += len + 1;
+ incpush(RUBY_RELATIVE(RUBY_LIB));
+#ifdef RUBY_THIN_ARCHLIB
+ incpush(RUBY_RELATIVE(RUBY_THIN_ARCHLIB));
+#endif
+ incpush(RUBY_RELATIVE(RUBY_ARCHLIB));
+
+ if (rb_safe_level() == 0) {
+ incpush(".");
}
}
+struct req_list {
+ char *name;
+ struct req_list *next;
+};
+static struct req_list req_list_head, *req_list_last = &req_list_head;
static void
-add_modules(VALUE *req_list, const char *mod)
+add_modules(mod)
+ const char *mod;
{
- VALUE list = *req_list;
-
- if (!list) {
- *req_list = list = rb_ary_new();
- RBASIC(list)->klass = 0;
- }
- rb_ary_push(list, rb_obj_freeze(rb_str_new2(mod)));
+ struct req_list *list;
+
+ list = ALLOC(struct req_list);
+ list->name = ALLOC_N(char, strlen(mod)+1);
+ strcpy(list->name, mod);
+ list->next = 0;
+ req_list_last->next = list;
+ req_list_last = list;
}
-extern void Init_ext(void);
-extern VALUE rb_vm_top_self(void);
+extern void Init_ext _((void));
static void
-require_libraries(VALUE *req_list)
+require_libraries()
{
- VALUE list = *req_list;
- ID require;
- rb_thread_t *th = GET_THREAD();
- rb_block_t *prev_base_block = th->base_block;
- int prev_parse_in_eval = th->parse_in_eval;
- th->base_block = 0;
- th->parse_in_eval = 0;
-
+ extern NODE *ruby_eval_tree;
+ extern NODE *ruby_eval_tree_begin;
+ NODE *save[3];
+ struct req_list *list = req_list_head.next;
+ struct req_list *tmp;
+
+ save[0] = ruby_eval_tree;
+ save[1] = ruby_eval_tree_begin;
+ save[2] = NEW_NEWLINE(0);
+ ruby_eval_tree = ruby_eval_tree_begin = 0;
+ ruby_current_node = 0;
Init_ext(); /* should be called here for some reason :-( */
- CONST_ID(require, "require");
- while (list && RARRAY_LEN(list) > 0) {
- VALUE feature = rb_ary_shift(list);
- rb_funcall2(rb_vm_top_self(), require, 1, &feature);
- }
- *req_list = 0;
-
- th->parse_in_eval = prev_parse_in_eval;
- th->base_block = prev_base_block;
+ ruby_current_node = save[2];
+ ruby_set_current_source();
+ req_list_last = 0;
+ while (list) {
+ int state;
+
+ ruby_current_node = 0;
+ rb_protect((VALUE (*)(VALUE))rb_require, (VALUE)list->name, &state);
+ if (state) rb_jump_tag(state);
+ tmp = list->next;
+ free(list->name);
+ free(list);
+ list = tmp;
+ ruby_current_node = save[2];
+ ruby_set_current_source();
+ }
+ req_list_head.next = 0;
+ ruby_eval_tree = save[0];
+ ruby_eval_tree_begin = save[1];
+ rb_gc_force_recycle((VALUE)save[2]);
+ ruby_current_node = 0;
}
static void
-process_sflag(int *sflag)
+process_sflag()
{
- if (*sflag > 0) {
+ if (sflag) {
long n;
VALUE *args;
- VALUE argv = rb_argv;
- n = RARRAY_LEN(argv);
- args = RARRAY_PTR(argv);
+ n = RARRAY(rb_argv)->len;
+ args = RARRAY(rb_argv)->ptr;
while (n > 0) {
VALUE v = *args++;
char *s = StringValuePtr(v);
char *p;
int hyphen = Qfalse;
- if (s[0] != '-')
- break;
+ if (s[0] != '-') break;
n--;
- if (s[1] == '-' && s[2] == '\0')
- break;
+ if (s[1] == '-' && s[2] == '\0') break;
v = Qtrue;
/* check if valid name before replacing - with _ */
@@ -515,8 +432,7 @@ process_sflag(int *sflag)
}
else if (*p != '_' && !ISALNUM(*p)) {
VALUE name_error[2];
- name_error[0] =
- rb_str_new2("invalid name for global variable - ");
+ name_error[0] = rb_str_new2("invalid name for global variable - ");
if (!(p = strchr(p, '='))) {
rb_str_cat2(name_error[0], s);
}
@@ -530,179 +446,76 @@ process_sflag(int *sflag)
s[0] = '$';
if (hyphen) {
for (p = s + 1; *p; ++p) {
- if (*p == '-')
- *p = '_';
+ if (*p == '-') *p = '_';
}
}
rb_gv_set(s, v);
}
- n = RARRAY_LEN(argv) - n;
+ n = RARRAY(rb_argv)->len - n;
while (n--) {
- rb_ary_shift(argv);
+ rb_ary_shift(rb_argv);
}
- *sflag = -1;
}
+ sflag = 0;
}
-NODE *rb_parser_append_print(VALUE, NODE *);
-NODE *rb_parser_while_loop(VALUE, NODE *, int, int);
-static long proc_options(long argc, char **argv, struct cmdline_options *opt, int envopt);
+static void proc_options _((int argc, char **argv));
-static void
-moreswitches(const char *s, struct cmdline_options *opt, int envopt)
-{
- long argc, i, len;
- char **argv, *p;
- const char *ap = 0;
- VALUE argstr, argary;
-
- while (ISSPACE(*s)) s++;
- if (!*s) return;
- argstr = rb_str_tmp_new((len = strlen(s)) + 2);
- argary = rb_str_tmp_new(0);
-
- p = RSTRING_PTR(argstr);
- *p++ = ' ';
- memcpy(p, s, len + 1);
- ap = 0;
- rb_str_cat(argary, (char *)&ap, sizeof(ap));
- while (*p) {
- ap = p;
- rb_str_cat(argary, (char *)&ap, sizeof(ap));
- while (*p && !ISSPACE(*p)) ++p;
- if (!*p) break;
- *p++ = '\0';
- while (ISSPACE(*p)) ++p;
- }
- argc = RSTRING_LEN(argary) / sizeof(ap);
- ap = 0;
- rb_str_cat(argary, (char *)&ap, sizeof(ap));
- argv = (char **)RSTRING_PTR(argary);
-
- while ((i = proc_options(argc, argv, opt, envopt)) > 1 && (argc -= i) > 0) {
- argv += i;
- if (**argv != '-') {
- *--*argv = '-';
- }
- if ((*argv)[1]) {
- ++argc;
- --argv;
- }
- }
-
- /* get rid of GC */
- rb_str_resize(argary, 0);
- rb_str_resize(argstr, 0);
-}
-
-#define NAME_MATCH_P(name, str, len) \
- ((len) < (int)sizeof(name) && strncmp((str), name, (len)) == 0)
-
-#define UNSET_WHEN(name, bit, str, len) \
- if (NAME_MATCH_P(name, str, len)) { \
- *(unsigned int *)arg &= ~(bit); \
- return; \
- }
-
-#define SET_WHEN(name, bit, str, len) \
- if (NAME_MATCH_P(name, str, len)) { \
- *(unsigned int *)arg |= (bit); \
- return; \
- }
-
-static void
-enable_option(const char *str, int len, void *arg)
-{
-#define UNSET_WHEN_DISABLE(bit) UNSET_WHEN(#bit, DISABLE_BIT(bit), str, len)
- UNSET_WHEN_DISABLE(gems);
- UNSET_WHEN_DISABLE(rubyopt);
- if (NAME_MATCH_P("all", str, len)) {
- *(unsigned int *)arg = 0U;
- return;
- }
- rb_warn("unknown argument for --enable: `%.*s'", len, str);
-}
-
-static void
-disable_option(const char *str, int len, void *arg)
-{
-#define SET_WHEN_DISABLE(bit) SET_WHEN(#bit, DISABLE_BIT(bit), str, len)
- SET_WHEN_DISABLE(gems);
- SET_WHEN_DISABLE(rubyopt);
- if (NAME_MATCH_P("all", str, len)) {
- *(unsigned int *)arg = ~0U;
- return;
- }
- rb_warn("unknown argument for --disable: `%.*s'", len, str);
-}
-
-static void
-dump_option(const char *str, int len, void *arg)
+static char*
+moreswitches(s)
+ char *s;
{
-#define SET_WHEN_DUMP(bit) SET_WHEN(#bit, DUMP_BIT(bit), str, len)
- SET_WHEN_DUMP(version);
- SET_WHEN_DUMP(copyright);
- SET_WHEN_DUMP(usage);
- SET_WHEN_DUMP(yydebug);
- SET_WHEN_DUMP(syntax);
- SET_WHEN_DUMP(insns);
- rb_warn("don't know how to dump `%.*s',", len, str);
- rb_warn("but only [version, copyright, usage, yydebug, syntax, insns].");
+ int argc; char *argv[3];
+ char *p = s;
+
+ argc = 2; argv[0] = argv[2] = 0;
+ while (*s && !ISSPACE(*s))
+ s++;
+ argv[1] = ALLOCA_N(char, s-p+2);
+ argv[1][0] = '-';
+ strncpy(argv[1]+1, p, s-p);
+ argv[1][s-p+1] = '\0';
+ proc_options(argc, argv);
+ while (*s && ISSPACE(*s))
+ s++;
+ return s;
}
static void
-set_option_encoding_once(const char *type, VALUE *name, const char *e, long elen)
+proc_options(argc, argv)
+ int argc;
+ char **argv;
{
- VALUE ename;
-
- if (!elen) elen = strlen(e);
- ename = rb_str_new(e, elen);
-
- if (*name &&
- rb_funcall(ename, rb_intern("casecmp"), 1, *name) != INT2FIX(0)) {
- rb_raise(rb_eRuntimeError,
- "%s already set to %s", type, RSTRING_PTR(*name));
- }
- *name = ename;
-}
+ char *argv0 = argv[0];
+ int do_search;
+ char *s;
+ NODE *volatile script_node = 0;
-#define set_internal_encoding_once(opt, e, elen) \
- set_option_encoding_once("default_intenal", &opt->intern.enc.name, e, elen)
-#define set_external_encoding_once(opt, e, elen) \
- set_option_encoding_once("default_extenal", &opt->ext.enc.name, e, elen)
-#define set_source_encoding_once(opt, e, elen) \
- set_option_encoding_once("source", &opt->src.enc.name, e, elen)
+ int version = 0;
+ int copyright = 0;
+ int verbose = 0;
+ VALUE e_script = Qfalse;
-static long
-proc_options(long argc, char **argv, struct cmdline_options *opt, int envopt)
-{
- long n, argc0 = argc;
- const char *s;
+ if (argc == 0) return;
- if (argc == 0)
- return 0;
+ do_search = Qfalse;
- for (argc--, argv++; argc > 0; argc--, argv++) {
- const char *const arg = argv[0];
- if (arg[0] != '-' || !arg[1])
- break;
+ for (argc--,argv++; argc > 0; argc--,argv++) {
+ if (argv[0][0] != '-' || !argv[0][1]) break;
- s = arg + 1;
+ s = argv[0]+1;
reswitch:
switch (*s) {
case 'a':
- if (envopt) goto noenvopt;
- opt->do_split = Qtrue;
+ do_split = Qtrue;
s++;
goto reswitch;
case 'p':
- if (envopt) goto noenvopt;
- opt->do_print = Qtrue;
+ do_print = Qtrue;
/* through */
case 'n':
- if (envopt) goto noenvopt;
- opt->do_loop = Qtrue;
+ do_loop = Qtrue;
s++;
goto reswitch;
@@ -713,18 +526,17 @@ proc_options(long argc, char **argv, struct cmdline_options *opt, int envopt)
goto reswitch;
case 'y':
- if (envopt) goto noenvopt;
- opt->dump |= DUMP_BIT(yydebug);
+ ruby_yydebug = 1;
s++;
goto reswitch;
case 'v':
- if (opt->verbose) {
+ if (argv0 == 0 || verbose) {
s++;
goto reswitch;
}
ruby_show_version();
- opt->verbose = 1;
+ verbose = 1;
case 'w':
ruby_verbose = Qtrue;
s++;
@@ -732,100 +544,89 @@ proc_options(long argc, char **argv, struct cmdline_options *opt, int envopt)
case 'W':
{
- size_t numlen;
+ int numlen;
int v = 2; /* -W as -W2 */
if (*++s) {
v = scan_oct(s, 1, &numlen);
- if (numlen == 0)
- v = 1;
+ if (numlen == 0) v = 1;
s += numlen;
}
switch (v) {
case 0:
- ruby_verbose = Qnil;
- break;
+ ruby_verbose = Qnil; break;
case 1:
- ruby_verbose = Qfalse;
- break;
+ ruby_verbose = Qfalse; break;
default:
- ruby_verbose = Qtrue;
- break;
+ ruby_verbose = Qtrue; break;
}
}
goto reswitch;
case 'c':
- if (envopt) goto noenvopt;
- opt->dump |= DUMP_BIT(syntax);
+ do_check = Qtrue;
s++;
goto reswitch;
case 's':
- if (envopt) goto noenvopt;
forbid_setid("-s");
- if (!opt->sflag) opt->sflag = 1;
+ sflag = 1;
s++;
goto reswitch;
case 'h':
- if (envopt) goto noenvopt;
- opt->dump |= DUMP_BIT(usage);
- goto switch_end;
+ usage(origargv[0]);
+ exit(0);
case 'l':
- if (envopt) goto noenvopt;
- opt->do_line = Qtrue;
+ do_line = Qtrue;
rb_output_rs = rb_rs;
s++;
goto reswitch;
case 'S':
- if (envopt) goto noenvopt;
forbid_setid("-S");
- opt->do_search = Qtrue;
+ do_search = Qtrue;
s++;
goto reswitch;
case 'e':
- if (envopt) goto noenvopt;
forbid_setid("-e");
if (!*++s) {
s = argv[1];
- argc--, argv++;
+ argc--,argv++;
}
if (!s) {
- rb_raise(rb_eRuntimeError, "no code specified for -e");
+ fprintf(stderr, "%s: no code specified for -e\n", origargv[0]);
+ exit(2);
}
- if (!opt->e_script) {
- opt->e_script = rb_str_new(0, 0);
- if (opt->script == 0)
- opt->script = "-e";
+ if (!e_script) {
+ e_script = rb_str_new(0,0);
+ if (script == 0) script = "-e";
}
- rb_str_cat2(opt->e_script, s);
- rb_str_cat2(opt->e_script, "\n");
+ rb_str_cat2(e_script, s);
+ rb_str_cat2(e_script, "\n");
break;
case 'r':
forbid_setid("-r");
if (*++s) {
- add_modules(&opt->req_list, s);
+ add_modules(s);
}
else if (argv[1]) {
- add_modules(&opt->req_list, argv[1]);
- argc--, argv++;
+ add_modules(argv[1]);
+ argc--,argv++;
}
break;
case 'i':
- if (envopt) goto noenvopt;
forbid_setid("-i");
- ruby_set_inplace_mode(s + 1);
+ if (ruby_inplace_mode) free(ruby_inplace_mode);
+ ruby_inplace_mode = strdup(s+1);
break;
case 'x':
- if (envopt) goto noenvopt;
- opt->xflag = Qtrue;
+ xflag = Qtrue;
s++;
if (*s && chdir(s) < 0) {
rb_fatal("Can't chdir to %s", s);
@@ -834,11 +635,10 @@ proc_options(long argc, char **argv, struct cmdline_options *opt, int envopt)
case 'C':
case 'X':
- if (envopt) goto noenvopt;
s++;
if (!*s) {
s = argv[1];
- argc--, argv++;
+ argc--,argv++;
}
if (!s || !*s) {
rb_fatal("Can't chdir");
@@ -849,85 +649,51 @@ proc_options(long argc, char **argv, struct cmdline_options *opt, int envopt)
break;
case 'F':
- if (envopt) goto noenvopt;
if (*++s) {
rb_fs = rb_reg_new(s, strlen(s), 0);
}
break;
- case 'E':
- if (!*++s && (!--argc || !(s = *++argv))) {
- rb_raise(rb_eRuntimeError, "missing argument for -E");
- }
- goto encoding;
-
- case 'U':
- set_internal_encoding_once(opt, "UTF-8", 0);
- ++s;
- goto reswitch;
-
case 'K':
if (*++s) {
- const char *enc_name = 0;
- switch (*s) {
- case 'E': case 'e':
- enc_name = "EUC-JP";
- break;
- case 'S': case 's':
- enc_name = "Windows-31J";
- break;
- case 'U': case 'u':
- enc_name = "UTF-8";
- break;
- case 'N': case 'n': case 'A': case 'a':
- enc_name = "ASCII-8BIT";
- break;
- }
- if (enc_name) {
- opt->src.enc.name = rb_str_new2(enc_name);
- if (!opt->ext.enc.name)
- opt->ext.enc.name = opt->src.enc.name;
- }
+ rb_set_kcode(s);
s++;
}
goto reswitch;
case 'T':
{
- size_t numlen;
+ int numlen;
int v = 1;
if (*++s) {
v = scan_oct(s, 2, &numlen);
- if (numlen == 0)
- v = 1;
+ if (numlen == 0) v = 1;
s += numlen;
}
- if (v > opt->safe_level) opt->safe_level = v;
+ rb_set_safe_level(v);
}
goto reswitch;
case 'I':
forbid_setid("-I");
if (*++s)
- ruby_incpush_expand(s);
+ ruby_incpush(s);
else if (argv[1]) {
- ruby_incpush_expand(argv[1]);
- argc--, argv++;
+ ruby_incpush(argv[1]);
+ argc--,argv++;
}
break;
case '0':
- if (envopt) goto noenvopt;
{
- size_t numlen;
+ int numlen;
int v;
char c;
v = scan_oct(s, 4, &numlen);
s += numlen;
- if (v > 0377)
- rb_rs = Qnil;
+ if (v > 0377) rb_rs = Qnil;
else if (v == 0 && numlen >= 2) {
rb_rs = rb_str_new2("\n\n");
}
@@ -940,579 +706,209 @@ proc_options(long argc, char **argv, struct cmdline_options *opt, int envopt)
case '-':
if (!s[1] || (s[1] == '\r' && !s[2])) {
- argc--, argv++;
+ argc--,argv++;
goto switch_end;
}
s++;
-
-# define is_option_end(c, allow_hyphen) \
- (!(c) || (allow_hyphen && (c) == '-') || (c) == '=')
-# define check_envopt(name, allow_envopt) \
- ((allow_envopt || !envopt) ? (void)0 : \
- rb_raise(rb_eRuntimeError, "invalid switch in RUBYOPT: --" name))
-# define need_argument(name, s) \
- ((*s++ ? !*s : (!--argc || !(s = *++argv))) ? \
- rb_raise(rb_eRuntimeError, "missing argument for --" name) \
- : (void)0)
-# define is_option_with_arg(name, allow_hyphen, allow_envopt) \
- (strncmp(name, s, n = sizeof(name) - 1) == 0 && is_option_end(s[n], allow_hyphen) ? \
- (check_envopt(name, allow_envopt), s += n, need_argument(name, s), 1) : 0)
-
- if (strcmp("copyright", s) == 0) {
- if (envopt) goto noenvopt_long;
- opt->dump |= DUMP_BIT(copyright);
- }
+ if (strcmp("copyright", s) == 0)
+ copyright = 1;
else if (strcmp("debug", s) == 0) {
ruby_debug = Qtrue;
ruby_verbose = Qtrue;
}
- else if (is_option_with_arg("enable", Qtrue, Qtrue)) {
- ruby_each_words(s, enable_option, &opt->disable);
- }
- else if (is_option_with_arg("disable", Qtrue, Qtrue)) {
- ruby_each_words(s, disable_option, &opt->disable);
- }
- else if (is_option_with_arg("encoding", Qfalse, Qtrue)) {
- char *p;
- encoding:
- do {
-# define set_encoding_part(type) \
- if (!(p = strchr(s, ':'))) { \
- set_##type##_encoding_once(opt, s, 0); \
- break; \
- } \
- else if (p > s) { \
- set_##type##_encoding_once(opt, s, p-s); \
- }
- set_encoding_part(external);
- if (!*(s = ++p)) break;
- set_encoding_part(internal);
- if (!*(s = ++p)) break;
-#if ALLOW_DEFAULT_SOURCE_ENCODING
- set_encoding_part(source);
- if (!*(s = ++p)) break;
-#endif
- rb_raise(rb_eRuntimeError, "extra argument for %s: %s",
- (arg[1] == '-' ? "--encoding" : "-E"), s);
-# undef set_encoding_part
- } while (0);
- }
- else if (is_option_with_arg("internal-encoding", Qfalse, Qtrue)) {
- set_internal_encoding_once(opt, s, 0);
- }
- else if (is_option_with_arg("external-encoding", Qfalse, Qtrue)) {
- set_external_encoding_once(opt, s, 0);
- }
-#if ALLOW_DEFAULT_SOURCE_ENCODING
- else if (is_option_with_arg("source-encoding", Qfalse, Qtrue)) {
- set_source_encoding_once(opt, s, 0);
- }
-#endif
- else if (strcmp("version", s) == 0) {
- if (envopt) goto noenvopt_long;
- opt->dump |= DUMP_BIT(version);
- }
+ else if (strcmp("version", s) == 0)
+ version = 1;
else if (strcmp("verbose", s) == 0) {
- opt->verbose = 1;
+ verbose = 1;
ruby_verbose = Qtrue;
}
- else if (strcmp("yydebug", s) == 0) {
- if (envopt) goto noenvopt_long;
- opt->dump |= DUMP_BIT(yydebug);
- }
- else if (is_option_with_arg("dump", Qfalse, Qfalse)) {
- ruby_each_words(s, dump_option, &opt->dump);
- }
+ else if (strcmp("yydebug", s) == 0)
+ ruby_yydebug = 1;
else if (strcmp("help", s) == 0) {
- if (envopt) goto noenvopt_long;
- opt->dump |= DUMP_BIT(usage);
- goto switch_end;
+ usage(origargv[0]);
+ exit(0);
}
else {
- rb_raise(rb_eRuntimeError,
- "invalid option --%s (-h will show valid options)", s);
+ fprintf(stderr, "%s: invalid option --%s (-h will show valid options)\n",
+ origargv[0], s);
+ exit(2);
}
break;
case '\r':
- if (!s[1])
- break;
+ if (!s[1]) break;
default:
{
+ const char *format;
if (ISPRINT(*s)) {
- rb_raise(rb_eRuntimeError,
- "invalid option -%c (-h will show valid options)",
- (int)(unsigned char)*s);
+ format = "%s: invalid option -%c (-h will show valid options)\n";
}
else {
- rb_raise(rb_eRuntimeError,
- "invalid option -\\x%02X (-h will show valid options)",
- (int)(unsigned char)*s);
+ format = "%s: invalid option -\\%03o (-h will show valid options)\n";
}
+ fprintf(stderr, format, origargv[0], (int)(unsigned char)*s);
}
- goto switch_end;
-
- noenvopt:
- /* "EIdvwWrKU" only */
- rb_raise(rb_eRuntimeError, "invalid switch in RUBYOPT: -%c", *s);
- break;
-
- noenvopt_long:
- rb_raise(rb_eRuntimeError, "invalid switch in RUBYOPT: --%s", s);
- break;
+ exit(2);
case 0:
break;
-# undef is_option_end
-# undef check_envopt
-# undef need_argument
-# undef is_option_with_arg
}
}
switch_end:
- return argc0 - argc;
-}
-
-void Init_prelude(void);
-
-static void
-ruby_init_gems(int enable)
-{
- if (enable) rb_define_module("Gem");
- Init_prelude();
-}
-
-static int
-opt_enc_index(VALUE enc_name)
-{
- const char *s = RSTRING_PTR(enc_name);
- int i = rb_enc_find_index(s);
-
- if (i < 0) {
- rb_raise(rb_eRuntimeError, "unknown encoding name - %s", s);
- }
- else if (rb_enc_dummy_p(rb_enc_from_index(i))) {
- rb_raise(rb_eRuntimeError, "dummy encoding is not acceptable - %s ", s);
- }
- return i;
-}
+ if (argv0 == 0) return;
-#define rb_progname (GET_VM()->progname)
-VALUE rb_argv0;
-
-static VALUE
-false_value(void)
-{
- return Qfalse;
-}
+ if (rb_safe_level() == 0 && (s = getenv("RUBYOPT"))) {
+ while (ISSPACE(*s)) s++;
+ if (*s == 'T' || (*s == '-' && *(s+1) == 'T')) {
+ int numlen;
+ int v = 1;
-static VALUE
-true_value(void)
-{
- return Qtrue;
-}
-
-#define rb_define_readonly_boolean(name, val) \
- rb_define_virtual_variable((name), (val) ? true_value : false_value, 0)
-
-static VALUE
-uscore_get(void)
-{
- VALUE line;
-
- line = rb_lastline_get();
- if (TYPE(line) != T_STRING) {
- rb_raise(rb_eTypeError, "$_ value need to be String (%s given)",
- NIL_P(line) ? "nil" : rb_obj_classname(line));
- }
- return line;
-}
-
-/*
- * call-seq:
- * sub(pattern, replacement) => $_
- * sub(pattern) { block } => $_
- *
- * Equivalent to <code>$_.sub(<i>args</i>)</code>, except that
- * <code>$_</code> will be updated if substitution occurs.
- * Available only when -p/-n command line option specified.
- */
-
-static VALUE
-rb_f_sub(argc, argv)
- int argc;
- VALUE *argv;
-{
- VALUE str = rb_funcall3(uscore_get(), rb_intern("sub"), argc, argv);
- rb_lastline_set(str);
- return str;
-}
-
-/*
- * call-seq:
- * gsub(pattern, replacement) => string
- * gsub(pattern) {|...| block } => string
- *
- * Equivalent to <code>$_.gsub...</code>, except that <code>$_</code>
- * receives the modified result.
- * Available only when -p/-n command line option specified.
- *
- */
-
-static VALUE
-rb_f_gsub(argc, argv)
- int argc;
- VALUE *argv;
-{
- VALUE str = rb_funcall3(uscore_get(), rb_intern("gsub"), argc, argv);
- rb_lastline_set(str);
- return str;
-}
-
-/*
- * call-seq:
- * chop => string
- *
- * Equivalent to <code>($_.dup).chop!</code>, except <code>nil</code>
- * is never returned. See <code>String#chop!</code>.
- * Available only when -p/-n command line option specified.
- *
- */
-
-static VALUE
-rb_f_chop(void)
-{
- VALUE str = rb_funcall3(uscore_get(), rb_intern("chop"), 0, 0);
- rb_lastline_set(str);
- return str;
-}
-
-
-/*
- * call-seq:
- * chomp => $_
- * chomp(string) => $_
- *
- * Equivalent to <code>$_ = $_.chomp(<em>string</em>)</code>. See
- * <code>String#chomp</code>.
- * Available only when -p/-n command line option specified.
- *
- */
-
-static VALUE
-rb_f_chomp(argc, argv)
- int argc;
- VALUE *argv;
-{
- VALUE str = rb_funcall3(uscore_get(), rb_intern("chomp"), argc, argv);
- rb_lastline_set(str);
- return str;
-}
-
-static VALUE
-process_options(int argc, char **argv, struct cmdline_options *opt)
-{
- NODE *tree = 0;
- VALUE parser;
- VALUE iseq;
- rb_encoding *enc, *lenc;
- const char *s;
- char fbuf[MAXPATHLEN];
- int i = (int)proc_options(argc, argv, opt, 0);
- rb_thread_t *th = GET_THREAD();
- rb_env_t *env = 0;
-
- argc -= i;
- argv += i;
-
- if (opt->dump & DUMP_BIT(usage)) {
- usage(origarg.argv[0]);
- return Qtrue;
- }
-
- if (!(opt->disable & DISABLE_BIT(rubyopt)) &&
- opt->safe_level == 0 && (s = getenv("RUBYOPT"))) {
- VALUE src_enc_name = opt->src.enc.name;
- VALUE ext_enc_name = opt->ext.enc.name;
- VALUE int_enc_name = opt->intern.enc.name;
-
- opt->src.enc.name = opt->ext.enc.name = opt->intern.enc.name = 0;
- moreswitches(s, opt, 1);
- if (src_enc_name)
- opt->src.enc.name = src_enc_name;
- if (ext_enc_name)
- opt->ext.enc.name = ext_enc_name;
- if (int_enc_name)
- opt->intern.enc.name = int_enc_name;
+ if (*s != 'T') ++s;
+ if (*++s) {
+ v = scan_oct(s, 2, &numlen);
+ if (numlen == 0) v = 1;
+ }
+ rb_set_safe_level(v);
+ }
+ else {
+ while (s && *s) {
+ if (*s == '-') {
+ s++;
+ if (ISSPACE(*s)) {
+ do {s++;} while (ISSPACE(*s));
+ continue;
+ }
+ }
+ if (!*s) break;
+ if (!strchr("IdvwWrK", *s))
+ rb_raise(rb_eRuntimeError, "illegal switch in RUBYOPT: -%c", *s);
+ s = moreswitches(s);
+ }
+ }
}
- if (opt->dump & DUMP_BIT(version)) {
+ if (version) {
ruby_show_version();
- return Qtrue;
+ exit(0);
}
- if (opt->dump & DUMP_BIT(copyright)) {
+ if (copyright) {
ruby_show_copyright();
}
- if (opt->safe_level >= 4) {
+ if (rb_safe_level() >= 4) {
OBJ_TAINT(rb_argv);
- OBJ_TAINT(GET_VM()->load_path);
+ OBJ_TAINT(rb_load_path);
}
- if (!opt->e_script) {
+ if (!e_script) {
if (argc == 0) { /* no more args */
- if (opt->verbose)
- return Qtrue;
- opt->script = "-";
+ if (verbose) exit(0);
+ script = "-";
}
else {
- opt->script = argv[0];
- if (opt->script[0] == '\0') {
- opt->script = "-";
+ script = argv[0];
+#if defined DOSISH || defined __CYGWIN__
+ translate_char(argv[0], '\\', '/');
+#endif
+ if (script[0] == '\0') {
+ script = "-";
}
- else if (opt->do_search) {
+ else if (do_search) {
char *path = getenv("RUBYPATH");
- opt->script = 0;
+ script = 0;
if (path) {
- opt->script = dln_find_file_r(argv[0], path, fbuf, sizeof(fbuf));
+ script = dln_find_file(argv[0], path);
}
- if (!opt->script) {
- opt->script = dln_find_file_r(argv[0], getenv(PATH_ENV), fbuf, sizeof(fbuf));
+ if (!script) {
+ script = dln_find_file(argv[0], getenv(PATH_ENV));
}
- if (!opt->script)
- opt->script = argv[0];
- }
- argc--;
- argv++;
- }
- }
-
- opt->script_name = rb_str_new_cstr(opt->script);
- opt->script = RSTRING_PTR(opt->script_name);
+ if (!script) script = argv[0];
+ script = ruby_sourcefile = rb_source_filename(script);
+ script_node = NEW_NEWLINE(0);
#if defined DOSISH || defined __CYGWIN__
- translit_char(RSTRING_PTR(opt->script_name), '\\', '/');
+ translate_char(ruby_sourcefile, '\\', '/');
#endif
- rb_obj_freeze(opt->script_name);
-
- ruby_init_loadpath_safe(opt->safe_level);
- rb_enc_find_index("encdb");
- lenc = rb_locale_encoding();
- rb_enc_associate(rb_progname, lenc);
- parser = rb_parser_new();
- if (opt->dump & DUMP_BIT(yydebug)) {
- rb_parser_set_yydebug(parser, Qtrue);
- }
- if (opt->ext.enc.name != 0) {
- opt->ext.enc.index = opt_enc_index(opt->ext.enc.name);
- }
- if (opt->intern.enc.name != 0) {
- opt->intern.enc.index = opt_enc_index(opt->intern.enc.name);
- }
- if (opt->src.enc.name != 0) {
- opt->src.enc.index = opt_enc_index(opt->src.enc.name);
- src_encoding_index = opt->src.enc.index;
- }
- if (opt->ext.enc.index >= 0) {
- enc = rb_enc_from_index(opt->ext.enc.index);
- }
- else {
- enc = lenc;
- }
- rb_enc_set_default_external(rb_enc_from_encoding(enc));
- if (opt->intern.enc.index >= 0) {
- enc = rb_enc_from_index(opt->intern.enc.index);
- rb_enc_set_default_internal(rb_enc_from_encoding(enc));
- opt->intern.enc.index = -1;
- }
- rb_enc_associate(opt->script_name, lenc);
- {
- long i;
- VALUE load_path = GET_VM()->load_path;
- for (i = 0; i < RARRAY_LEN(load_path); ++i) {
- rb_enc_associate(RARRAY_PTR(load_path)[i], lenc);
+ }
+ argc--; argv++;
}
}
- ruby_init_gems(!(opt->disable & DISABLE_BIT(gems)));
- rb_progname = opt->script_name;
- rb_vm_set_progname(rb_progname);
- ruby_set_argv(argc, argv);
- process_sflag(&opt->sflag);
-
- {
- /* set eval context */
- VALUE toplevel_binding = rb_const_get(rb_cObject, rb_intern("TOPLEVEL_BINDING"));
- rb_binding_t *bind;
- GetBindingPtr(toplevel_binding, bind);
- GetEnvPtr(bind->env, env);
- }
-
-#define PREPARE_PARSE_MAIN(expr) do { \
- th->parse_in_eval--; \
- th->base_block = &env->block; \
- expr; \
- th->parse_in_eval++; \
- th->base_block = 0; \
-} while (0)
-
- if (opt->e_script) {
- rb_encoding *eenc;
- if (opt->src.enc.index >= 0) {
- eenc = rb_enc_from_index(opt->src.enc.index);
- }
- else {
- eenc = lenc;
- }
- rb_enc_associate(opt->e_script, eenc);
- require_libraries(&opt->req_list);
-
- PREPARE_PARSE_MAIN({
- tree = rb_parser_compile_string(parser, opt->script, opt->e_script, 1);
- });
- }
- else {
- if (opt->script[0] == '-' && !opt->script[1]) {
- forbid_setid("program input from stdin");
- }
+ ruby_script(script);
+ ruby_set_argv(argc, argv);
+ process_sflag();
- PREPARE_PARSE_MAIN({
- tree = load_file(parser, opt->script, 1, opt);
- });
+ ruby_init_loadpath();
+ ruby_sourcefile = rb_source_filename(argv0);
+ if (e_script) {
+ require_libraries();
+ rb_compile_string(script, e_script, 1);
}
- if (opt->dump & DUMP_BIT(yydebug)) return Qtrue;
-
- if (opt->ext.enc.index >= 0) {
- enc = rb_enc_from_index(opt->ext.enc.index);
+ else if (strlen(script) == 1 && script[0] == '-') {
+ load_stdin();
}
else {
- enc = lenc;
+ load_file(script, 1);
}
- rb_enc_set_default_external(rb_enc_from_encoding(enc));
- if (opt->intern.enc.index >= 0) {
- /* Set in the shebang line */
- enc = rb_enc_from_index(opt->intern.enc.index);
- rb_enc_set_default_internal(rb_enc_from_encoding(enc));
- }
- else if (!rb_default_internal_encoding())
- /* Freeze default_internal */
- rb_enc_set_default_internal(Qnil);
-
- if (!tree) return Qfalse;
- process_sflag(&opt->sflag);
- opt->xflag = 0;
+ process_sflag();
+ xflag = 0;
- if (opt->safe_level >= 4) {
+ if (rb_safe_level() >= 4) {
FL_UNSET(rb_argv, FL_TAINT);
- FL_UNSET(GET_VM()->load_path, FL_TAINT);
- }
-
- if (opt->dump & DUMP_BIT(syntax)) {
- printf("Syntax OK\n");
- return Qtrue;
- }
-
- if (opt->do_print) {
- PREPARE_PARSE_MAIN({
- tree = rb_parser_append_print(parser, tree);
- });
- }
- if (opt->do_loop) {
- PREPARE_PARSE_MAIN({
- tree = rb_parser_while_loop(parser, tree, opt->do_line, opt->do_split);
- });
- rb_define_global_function("sub", rb_f_sub, -1);
- rb_define_global_function("gsub", rb_f_gsub, -1);
- rb_define_global_function("chop", rb_f_chop, 0);
- rb_define_global_function("chomp", rb_f_chomp, -1);
- }
-
- PREPARE_PARSE_MAIN({
- iseq = rb_iseq_new_main(tree, opt->script_name);
- });
-
- if (opt->dump & DUMP_BIT(insns)) {
- rb_io_write(rb_stdout, rb_iseq_disasm(iseq));
- rb_io_flush(rb_stdout);
- return Qtrue;
+ FL_UNSET(rb_load_path, FL_TAINT);
}
-
- rb_define_readonly_boolean("$-p", opt->do_print);
- rb_define_readonly_boolean("$-l", opt->do_line);
- rb_define_readonly_boolean("$-a", opt->do_split);
-
- rb_set_safe_level(opt->safe_level);
-
- return iseq;
}
-struct load_file_arg {
- VALUE parser;
+extern int ruby__end__seen;
+
+static void
+load_file(fname, script)
const char *fname;
int script;
- struct cmdline_options *opt;
-};
-
-static VALUE
-load_file_internal(VALUE arg)
{
extern VALUE rb_stdin;
- struct load_file_arg *argp = (struct load_file_arg *)arg;
- VALUE parser = argp->parser;
- const char *fname = argp->fname;
- int script = argp->script;
- struct cmdline_options *opt = argp->opt;
VALUE f;
int line_start = 1;
- NODE *tree = 0;
- rb_encoding *enc;
- ID set_encoding;
- if (!fname)
- rb_load_fail(fname);
+ if (!fname) rb_load_fail(fname);
if (strcmp(fname, "-") == 0) {
f = rb_stdin;
}
else {
- int fd, mode = O_RDONLY;
+ FILE *fp = fopen(fname, "r");
+
+ if (fp == NULL) {
+ rb_load_fail(fname);
+ }
+ fclose(fp);
+
+ f = rb_file_open(fname, "r");
#if defined DOSISH || defined __CYGWIN__
{
- const char *ext = strrchr(fname, '.');
- if (ext && STRCASECMP(ext, ".exe") == 0)
- mode |= O_BINARY;
+ char *ext = strrchr(fname, '.');
+ if (ext && strcasecmp(ext, ".exe") == 0)
+ rb_io_binmode(f);
}
#endif
- if ((fd = open(fname, mode)) < 0) {
- rb_load_fail(fname);
- }
-
- f = rb_io_fdopen(fd, mode, fname);
}
- CONST_ID(set_encoding, "set_encoding");
if (script) {
VALUE c = 1; /* something not nil */
VALUE line;
char *p;
- int no_src_enc = !opt->src.enc.name;
- int no_ext_enc = !opt->ext.enc.name;
- int no_int_enc = !opt->intern.enc.name;
- enc = rb_ascii8bit_encoding();
- rb_funcall(f, set_encoding, 1, rb_enc_from_encoding(enc));
-
- if (opt->xflag) {
+ if (xflag) {
forbid_setid("-x");
- opt->xflag = Qfalse;
+ xflag = Qfalse;
while (!NIL_P(line = rb_io_gets(f))) {
line_start++;
- if (RSTRING_LEN(line) > 2
- && RSTRING_PTR(line)[0] == '#'
- && RSTRING_PTR(line)[1] == '!') {
- if ((p = strstr(RSTRING_PTR(line), "ruby")) != 0) {
+ if (RSTRING(line)->len > 2
+ && RSTRING(line)->ptr[0] == '#'
+ && RSTRING(line)->ptr[1] == '!') {
+ if ((p = strstr(RSTRING(line)->ptr, "ruby")) != 0) {
goto start_read;
}
}
@@ -1520,26 +916,22 @@ load_file_internal(VALUE arg)
rb_raise(rb_eLoadError, "no Ruby script found in input");
}
- c = rb_io_getbyte(f);
+ c = rb_io_getc(f);
if (c == INT2FIX('#')) {
- c = rb_io_getbyte(f);
- if (c == INT2FIX('!')) {
- line = rb_io_gets(f);
- if (NIL_P(line))
- return 0;
-
- if ((p = strstr(RSTRING_PTR(line), "ruby")) == 0) {
- void rb_thread_stop_timer_thread(void);
+ line = rb_io_gets(f);
+ if (NIL_P(line)) return;
+ line_start++;
+
+ if (RSTRING(line)->len > 2 && RSTRING(line)->ptr[0] == '!') {
+ if ((p = strstr(RSTRING(line)->ptr, "ruby")) == 0) {
/* not ruby script, kick the program */
char **argv;
char *path;
- char *pend = RSTRING_PTR(line) + RSTRING_LEN(line);
+ char *pend = RSTRING(line)->ptr + RSTRING(line)->len;
- p = RSTRING_PTR(line); /* skip `#!' */
- if (pend[-1] == '\n')
- pend--; /* chomp line */
- if (pend[-1] == '\r')
- pend--;
+ p = RSTRING(line)->ptr + 1; /* skip `#!' */
+ if (pend[-1] == '\n') pend--; /* chomp line */
+ if (pend[-1] == '\r') pend--;
*pend = '\0';
while (p < pend && ISSPACE(*p))
p++;
@@ -1548,111 +940,106 @@ load_file_internal(VALUE arg)
p++;
*p++ = '\0';
if (p < pend) {
- argv = ALLOCA_N(char *, origarg.argc + 3);
+ argv = ALLOCA_N(char*, origargc+3);
argv[1] = p;
- MEMCPY(argv + 2, origarg.argv + 1, char *, origarg.argc);
+ MEMCPY(argv+2, origargv+1, char*, origargc);
}
else {
- argv = origarg.argv;
+ argv = origargv;
}
argv[0] = path;
- rb_thread_stop_timer_thread();
execv(path, argv);
+ ruby_sourcefile = rb_source_filename(fname);
+ ruby_sourceline = 1;
rb_fatal("Can't exec %s", path);
}
start_read:
p += 4;
- RSTRING_PTR(line)[RSTRING_LEN(line) - 1] = '\0';
- if (RSTRING_PTR(line)[RSTRING_LEN(line) - 2] == '\r')
- RSTRING_PTR(line)[RSTRING_LEN(line) - 2] = '\0';
+ RSTRING(line)->ptr[RSTRING(line)->len-1] = '\0';
+ if (RSTRING(line)->ptr[RSTRING(line)->len-2] == '\r')
+ RSTRING(line)->ptr[RSTRING(line)->len-2] = '\0';
if ((p = strstr(p, " -")) != 0) {
- moreswitches(p + 1, opt, 0);
+ p++; /* skip space before `-' */
+ while (*p == '-') {
+ p = moreswitches(p+1);
+ }
}
-
- /* push back shebang for pragma may exist in next line */
- rb_io_ungetbyte(f, rb_str_new2("!\n"));
- }
- else if (!NIL_P(c)) {
- rb_io_ungetbyte(f, c);
- }
- rb_io_ungetbyte(f, INT2FIX('#'));
- if (no_src_enc && opt->src.enc.name) {
- opt->src.enc.index = opt_enc_index(opt->src.enc.name);
- src_encoding_index = opt->src.enc.index;
- }
- if (no_ext_enc && opt->ext.enc.name) {
- opt->ext.enc.index = opt_enc_index(opt->ext.enc.name);
- }
- if (no_int_enc && opt->intern.enc.name) {
- opt->intern.enc.index = opt_enc_index(opt->intern.enc.name);
}
}
else if (!NIL_P(c)) {
- rb_io_ungetbyte(f, c);
+ rb_io_ungetc(f, c);
}
- require_libraries(&opt->req_list); /* Why here? unnatural */
+ require_libraries(); /* Why here? unnatural */
+ if (NIL_P(c)) return;
}
- if (opt->src.enc.index >= 0) {
- enc = rb_enc_from_index(opt->src.enc.index);
- }
- else if (f == rb_stdin) {
- enc = rb_locale_encoding();
- }
- else {
- enc = rb_usascii_encoding();
- }
- rb_funcall(f, set_encoding, 2, rb_enc_from_encoding(enc), rb_str_new_cstr("-"));
- tree = rb_parser_compile_file(parser, fname, f, line_start);
- rb_funcall(f, set_encoding, 1, rb_parser_encoding(parser));
- if (script && rb_parser_end_seen_p(parser)) {
+ rb_compile_file(fname, f, line_start);
+ if (script && ruby__end__seen) {
rb_define_global_const("DATA", f);
}
else if (f != rb_stdin) {
rb_io_close(f);
}
- else {
- rb_io_ungetbyte(f, Qnil);
+
+ if (ruby_parser_stack_on_heap()) {
+ rb_gc();
}
- return (VALUE)tree;
}
-static VALUE
-restore_lineno(VALUE lineno)
+void
+rb_load_file(fname)
+ const char *fname;
{
- return rb_gv_set("$.", lineno);
+ load_file(fname, 0);
}
-static NODE *
-load_file(VALUE parser, const char *fname, int script, struct cmdline_options *opt)
+static void
+load_stdin()
{
- struct load_file_arg arg;
- arg.parser = parser;
- arg.fname = fname;
- arg.script = script;
- arg.opt = opt;
- return (NODE *)rb_ensure(load_file_internal, (VALUE)&arg, restore_lineno, rb_gv_get("$."));
+ forbid_setid("program input from stdin");
+ load_file("-", 1);
}
-void *
-rb_load_file(const char *fname)
-{
- struct cmdline_options opt;
-
- return load_file(rb_parser_new(), fname, 0, cmdline_options_init(&opt));
-}
+VALUE rb_progname;
+VALUE rb_argv;
+VALUE rb_argv0;
-#if !defined(PSTAT_SETCMD) && !defined(HAVE_SETPROCTITLE)
-#if !defined(_WIN32) && !(defined(HAVE_SETENV) && defined(HAVE_UNSETENV))
+#if defined(PSTAT_SETCMD) || defined(HAVE_SETPROCTITLE)
+#elif defined(_WIN32)
+#elif defined(HAVE_SETENV) && defined(HAVE_UNSETENV)
+#else
#define USE_ENVSPACE_FOR_ARG0
#endif
#ifdef USE_ENVSPACE_FOR_ARG0
+static struct {
+ char *begin, *end;
+} envspace;
extern char **environ;
+
+static void
+set_arg0space()
+{
+ char *s;
+ int i;
+
+ if (!environ || (s = environ[0]) == NULL) return;
+ envspace.begin = s;
+ s += strlen(s);
+ for (i = 1; environ[i]; i++) {
+ if (environ[i] == s + 1) {
+ s++;
+ s += strlen(s); /* this one is ok too */
+ }
+ }
+ envspace.end = s;
+}
+#else
+#define set_arg0space() ((void)0)
#endif
-static size_t
+static int
get_arglen(int argc, char **argv)
{
char *s = argv[0];
@@ -1684,179 +1071,188 @@ get_arglen(int argc, char **argv)
#endif
return s - argv[0];
}
-#endif
static void
-set_arg0(VALUE val, ID id)
+set_arg0(val, id)
+ VALUE val;
+ ID id;
{
+ VALUE progname;
char *s;
long i;
+ int j;
+#if !defined(PSTAT_SETCMD) && !defined(HAVE_SETPROCTITLE)
+ static int len = 0;
+#endif
- if (origarg.argv == 0)
- rb_raise(rb_eRuntimeError, "$0 not initialized");
+ if (origargv == 0) rb_raise(rb_eRuntimeError, "$0 not initialized");
StringValue(val);
- s = RSTRING_PTR(val);
- i = RSTRING_LEN(val);
+ s = RSTRING(val)->ptr;
+ i = RSTRING(val)->len;
#if defined(PSTAT_SETCMD)
- if (i > PST_CLEN) {
- union pstun un;
- char buf[PST_CLEN + 1]; /* PST_CLEN is 64 (HP-UX 11.23) */
- strlcpy(buf, s, sizeof(buf));
- un.pst_command = buf;
- pstat(PSTAT_SETCMD, un, PST_CLEN, 0, 0);
+ if (i >= PST_CLEN) {
+ union pstun j;
+ j.pst_command = s;
+ i = PST_CLEN;
+ RSTRING(val)->len = i;
+ *(s + i) = '\0';
+ pstat(PSTAT_SETCMD, j, PST_CLEN, 0, 0);
}
else {
- union pstun un;
- un.pst_command = s;
- pstat(PSTAT_SETCMD, un, i, 0, 0);
+ union pstun j;
+ j.pst_command = s;
+ pstat(PSTAT_SETCMD, j, i, 0, 0);
}
+ progname = rb_tainted_str_new(s, i);
#elif defined(HAVE_SETPROCTITLE)
setproctitle("%.*s", (int)i, s);
+ progname = rb_tainted_str_new(s, i);
#else
-
- if ((size_t)i >= origarg.len) {
- i = (long)(origarg.len - 1);
+ if (len == 0) {
+ len = get_arglen(origargc, origargv);
}
- memcpy(origarg.argv[0], s, i);
-
- {
- int j;
- char *t = origarg.argv[0] + i;
- *t = '\0';
-
- if ((size_t)(i + 1) < origarg.len) {
- memset(t + 1, ' ', origarg.len - i - 1);
- }
- for (j = 1; j < origarg.argc; j++) {
- origarg.argv[j] = t;
- }
+ if (i >= len) {
+ i = len;
}
+ memcpy(origargv[0], s, i);
+ s = origargv[0] + i;
+ *s = '\0';
+ if (++i < len) memset(s + 1, ' ', len - i);
+ for (i = len-1, j = origargc-1; j > 0 && i >= 0; --i, --j) {
+ origargv[j] = origargv[0] + i;
+ *origargv[j] = '\0';
+ }
+ progname = rb_tainted_str_new2(origargv[0]);
#endif
- rb_progname = rb_obj_freeze(rb_external_str_new(s, i));
+ rb_progname = rb_obj_freeze(progname);
}
void
-ruby_script(const char *name)
+ruby_script(name)
+ const char *name;
{
if (name) {
- rb_progname = rb_obj_freeze(rb_external_str_new(name, strlen(name)));
- rb_vm_set_progname(rb_progname);
+ rb_progname = rb_obj_freeze(rb_tainted_str_new2(name));
+ ruby_sourcefile = rb_source_filename(name);
}
}
+static int uid, euid, gid, egid;
+
static void
-init_ids(struct cmdline_options *opt)
+init_ids()
{
- rb_uid_t uid = getuid();
- rb_uid_t euid = geteuid();
- rb_gid_t gid = getgid();
- rb_gid_t egid = getegid();
-
- if (uid != euid) opt->setids |= 1;
- if (egid != gid) opt->setids |= 2;
- if (uid && opt->setids) {
- if (opt->safe_level < 1) opt->safe_level = 1;
+ uid = (int)getuid();
+ euid = (int)geteuid();
+ gid = (int)getgid();
+ egid = (int)getegid();
+#ifdef VMS
+ uid |= gid << 16;
+ euid |= egid << 16;
+#endif
+ if (uid && (euid != uid || egid != gid)) {
+ rb_set_safe_level(1);
}
}
-#undef forbid_setid
static void
-forbid_setid(const char *s, struct cmdline_options *opt)
+forbid_setid(s)
+ const char *s;
{
- if (opt->setids & 1)
+ if (euid != uid)
rb_raise(rb_eSecurityError, "no %s allowed while running setuid", s);
- if (opt->setids & 2)
+ if (egid != gid)
rb_raise(rb_eSecurityError, "no %s allowed while running setgid", s);
- if (opt->safe_level > 0)
+ if (rb_safe_level() > 0)
rb_raise(rb_eSecurityError, "no %s allowed in tainted mode", s);
}
static void
-verbose_setter(VALUE val, ID id, void *data)
+verbose_setter(val, id, variable)
+ VALUE val;
+ ID id;
+ VALUE *variable;
{
- VALUE *variable = data;
- *variable = RTEST(val) ? Qtrue : val;
-}
-
-static VALUE
-opt_W_getter(ID id, void *data)
-{
- VALUE *variable = data;
- switch (*variable) {
- case Qnil:
- return INT2FIX(0);
- case Qfalse:
- return INT2FIX(1);
- case Qtrue:
- return INT2FIX(2);
- }
- return Qnil; /* not reached */
+ ruby_verbose = RTEST(val) ? Qtrue : val;
}
void
-ruby_prog_init(void)
+ruby_prog_init()
{
+ init_ids();
+
+ ruby_sourcefile = rb_source_filename("ruby");
rb_define_hooked_variable("$VERBOSE", &ruby_verbose, 0, verbose_setter);
rb_define_hooked_variable("$-v", &ruby_verbose, 0, verbose_setter);
rb_define_hooked_variable("$-w", &ruby_verbose, 0, verbose_setter);
- rb_define_hooked_variable("$-W", &ruby_verbose, opt_W_getter, rb_gvar_readonly_setter);
rb_define_variable("$DEBUG", &ruby_debug);
rb_define_variable("$-d", &ruby_debug);
+ rb_define_readonly_variable("$-p", &do_print);
+ rb_define_readonly_variable("$-l", &do_line);
rb_define_hooked_variable("$0", &rb_progname, 0, set_arg0);
rb_define_hooked_variable("$PROGRAM_NAME", &rb_progname, 0, set_arg0);
+ rb_define_readonly_variable("$*", &rb_argv);
+ rb_argv = rb_ary_new();
rb_define_global_const("ARGV", rb_argv);
+ rb_define_readonly_variable("$-a", &do_split);
+ rb_global_variable(&rb_argv0);
+
+#ifdef MSDOS
+ /*
+ * There is no way we can refer to them from ruby, so close them to save
+ * space.
+ */
+ (void)fclose(stdaux);
+ (void)fclose(stdprn);
+#endif
}
void
-ruby_set_argv(int argc, char **argv)
+ruby_set_argv(argc, argv)
+ int argc;
+ char **argv;
{
int i;
- VALUE av = rb_argv;
#if defined(USE_DLN_A_OUT)
- if (origarg.argv)
- dln_argv0 = origarg.argv[0];
- else
- dln_argv0 = argv[0];
+ if (origargv) dln_argv0 = origargv[0];
+ else dln_argv0 = argv[0];
#endif
- rb_ary_clear(av);
- for (i = 0; i < argc; i++) {
- VALUE arg = rb_external_str_new(argv[i], strlen(argv[i]));
+ rb_ary_clear(rb_argv);
+ for (i=0; i < argc; i++) {
+ VALUE arg = rb_tainted_str_new2(argv[i]);
OBJ_FREEZE(arg);
- rb_ary_push(av, arg);
+ rb_ary_push(rb_argv, arg);
}
}
-void *
-ruby_process_options(int argc, char **argv)
-{
- struct cmdline_options opt;
- VALUE iseq;
-
- ruby_script(argv[0]); /* for the time being */
- rb_argv0 = rb_str_new4(rb_progname);
- rb_gc_register_mark_object(rb_argv0);
- iseq = process_options(argc, argv, cmdline_options_init(&opt));
- return (void*)(struct RData*)iseq;
-}
-
void
-ruby_sysinit(int *argc, char ***argv)
+ruby_process_options(argc, argv)
+ int argc;
+ char **argv;
{
-#if defined(_WIN32)
- void rb_w32_sysinit(int *argc, char ***argv);
- rb_w32_sysinit(argc, argv);
-#endif
- origarg.argc = *argc;
- origarg.argv = *argv;
-#if !defined(PSTAT_SETCMD) && !defined(HAVE_SETPROCTITLE)
- origarg.len = get_arglen(origarg.argc, origarg.argv);
-#endif
+ origargc = argc; origargv = argv;
+
+ ruby_script(argv[0]); /* for the time being */
+ rb_argv0 = rb_progname;
#if defined(USE_DLN_A_OUT)
- dln_argv0 = origarg.argv[0];
+ dln_argv0 = argv[0];
#endif
+ set_arg0space();
+ proc_options(argc, argv);
+
+ if (do_check && ruby_nerrs == 0) {
+ printf("Syntax OK\n");
+ exit(0);
+ }
+ if (do_print) {
+ rb_parser_append_print();
+ }
+ if (do_loop) {
+ rb_parser_while_loop(do_line, do_split);
+ }
}
diff --git a/ruby.h b/ruby.h
new file mode 100644
index 0000000000..4281ad4a0e
--- /dev/null
+++ b/ruby.h
@@ -0,0 +1,776 @@
+/**********************************************************************
+
+ ruby.h -
+
+ $Author$
+ created at: Thu Jun 10 14:26:32 JST 1993
+
+ Copyright (C) 1993-2003 Yukihiro Matsumoto
+ Copyright (C) 2000 Network Applied Communication Laboratory, Inc.
+ Copyright (C) 2000 Information-technology Promotion Agency, Japan
+
+**********************************************************************/
+
+#ifndef RUBY_H
+#define RUBY_H
+
+#if defined(__cplusplus)
+extern "C" {
+#if 0
+} /* satisfy cc-mode */
+#endif
+#endif
+
+#include "config.h"
+#ifdef RUBY_EXTCONF_H
+#include RUBY_EXTCONF_H
+#endif
+
+#define NORETURN_STYLE_NEW 1
+#ifndef NORETURN
+# define NORETURN(x) x
+#endif
+#ifndef NOINLINE
+# define NOINLINE(x) x
+#endif
+
+#include "defines.h"
+
+#ifdef HAVE_STDLIB_H
+# include <stdlib.h>
+#endif
+
+#ifdef HAVE_STRING_H
+# include <string.h>
+#else
+# include <strings.h>
+#endif
+
+#ifdef HAVE_INTRINSICS_H
+# include <intrinsics.h>
+#endif
+
+#include <stddef.h>
+#include <stdio.h>
+
+/* need to include <ctype.h> to use these macros */
+#ifndef ISPRINT
+#define ISASCII(c) isascii((int)(unsigned char)(c))
+#undef ISPRINT
+#define ISPRINT(c) (ISASCII(c) && isprint((int)(unsigned char)(c)))
+#define ISSPACE(c) (ISASCII(c) && isspace((int)(unsigned char)(c)))
+#define ISUPPER(c) (ISASCII(c) && isupper((int)(unsigned char)(c)))
+#define ISLOWER(c) (ISASCII(c) && islower((int)(unsigned char)(c)))
+#define ISALNUM(c) (ISASCII(c) && isalnum((int)(unsigned char)(c)))
+#define ISALPHA(c) (ISASCII(c) && isalpha((int)(unsigned char)(c)))
+#define ISDIGIT(c) (ISASCII(c) && isdigit((int)(unsigned char)(c)))
+#define ISXDIGIT(c) (ISASCII(c) && isxdigit((int)(unsigned char)(c)))
+#endif
+
+#if defined(HAVE_ALLOCA_H)
+#include <alloca.h>
+#else
+# ifdef _AIX
+#pragma alloca
+# endif
+#endif
+
+#if defined(__VMS)
+# pragma builtins
+# define alloca __alloca
+#endif
+
+#if SIZEOF_LONG != SIZEOF_VOIDP
+# error ---->> ruby requires sizeof(void*) == sizeof(long) to be compiled. <<----
+#else
+typedef unsigned long VALUE;
+typedef unsigned long ID;
+#endif
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# ifndef LONG_MAX
+# ifdef HAVE_LIMITS_H
+# include <limits.h>
+# else
+ /* assuming 32bit(2's compliment) long */
+# define LONG_MAX 2147483647
+# endif
+# endif
+# ifndef LONG_MIN
+# define LONG_MIN (-LONG_MAX-1)
+# endif
+# ifndef CHAR_BIT
+# define CHAR_BIT 8
+# endif
+#endif
+
+#ifdef HAVE_LONG_LONG
+# ifndef LLONG_MAX
+# ifdef LONG_LONG_MAX
+# define LLONG_MAX LONG_LONG_MAX
+# else
+# ifdef _I64_MAX
+# define LLONG_MAX _I64_MAX
+# else
+ /* assuming 64bit(2's complement) long long */
+# define LLONG_MAX 9223372036854775807LL
+# endif
+# endif
+# endif
+# ifndef LLONG_MIN
+# ifdef LONG_LONG_MIN
+# define LLONG_MIN LONG_LONG_MIN
+# else
+# ifdef _I64_MIN
+# define LLONG_MIN _I64_MIN
+# else
+# define LLONG_MIN (-LLONG_MAX-1)
+# endif
+# endif
+# endif
+#endif
+
+#define FIXNUM_MAX (LONG_MAX>>1)
+#define FIXNUM_MIN RSHIFT((long)LONG_MIN,1)
+
+#define FIXNUM_FLAG 0x01
+#define INT2FIX(i) ((VALUE)(((long)(i))<<1 | FIXNUM_FLAG))
+#define LONG2FIX(i) INT2FIX(i)
+#define rb_fix_new(v) INT2FIX(v)
+VALUE rb_int2inum _((long));
+#define INT2NUM(v) rb_int2inum(v)
+#define LONG2NUM(v) INT2NUM(v)
+#define rb_int_new(v) rb_int2inum(v)
+VALUE rb_uint2inum _((unsigned long));
+#define UINT2NUM(v) rb_uint2inum(v)
+#define ULONG2NUM(v) UINT2NUM(v)
+#define rb_uint_new(v) rb_uint2inum(v)
+
+#ifdef HAVE_LONG_LONG
+VALUE rb_ll2inum _((LONG_LONG));
+#define LL2NUM(v) rb_ll2inum(v)
+VALUE rb_ull2inum _((unsigned LONG_LONG));
+#define ULL2NUM(v) rb_ull2inum(v)
+#endif
+
+#if SIZEOF_OFF_T > SIZEOF_LONG && defined(HAVE_LONG_LONG)
+# define OFFT2NUM(v) LL2NUM(v)
+#elif SIZEOF_OFF_T == SIZEOF_LONG
+# define OFFT2NUM(v) LONG2NUM(v)
+#else
+# define OFFT2NUM(v) INT2NUM(v)
+#endif
+
+#define FIX2LONG(x) RSHIFT((long)x,1)
+#define FIX2ULONG(x) (((unsigned long)(x))>>1)
+#define FIXNUM_P(f) (((long)(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_MASK 0x03
+#define IMMEDIATE_P(x) ((VALUE)(x) & IMMEDIATE_MASK)
+
+#define SYMBOL_FLAG 0x0e
+#define SYMBOL_P(x) (((VALUE)(x)&0xff)==SYMBOL_FLAG)
+#define ID2SYM(x) ((VALUE)(((long)(x))<<8|SYMBOL_FLAG))
+#define SYM2ID(x) RSHIFT((unsigned long)x,8)
+
+/* special contants - i.e. non-zero and non-fixnum constants */
+#define Qfalse ((VALUE)0)
+#define Qtrue ((VALUE)2)
+#define Qnil ((VALUE)4)
+#define Qundef ((VALUE)6) /* undefined value for placeholder */
+
+#define RTEST(v) (((VALUE)(v) & ~Qnil) != 0)
+#define NIL_P(v) ((VALUE)(v) == Qnil)
+
+#define CLASS_OF(v) rb_class_of((VALUE)(v))
+
+#define T_NONE 0x00
+
+#define T_NIL 0x01
+#define T_OBJECT 0x02
+#define T_CLASS 0x03
+#define T_ICLASS 0x04
+#define T_MODULE 0x05
+#define T_FLOAT 0x06
+#define T_STRING 0x07
+#define T_REGEXP 0x08
+#define T_ARRAY 0x09
+#define T_FIXNUM 0x0a
+#define T_HASH 0x0b
+#define T_STRUCT 0x0c
+#define T_BIGNUM 0x0d
+#define T_FILE 0x0e
+
+#define T_TRUE 0x20
+#define T_FALSE 0x21
+#define T_DATA 0x22
+#define T_MATCH 0x23
+#define T_SYMBOL 0x24
+
+#define T_BLKTAG 0x3b
+#define T_UNDEF 0x3c
+#define T_VARMAP 0x3d
+#define T_SCOPE 0x3e
+#define T_NODE 0x3f
+
+#define T_MASK 0x3f
+
+#define BUILTIN_TYPE(x) (((struct RBasic*)(x))->flags & T_MASK)
+
+#define TYPE(x) rb_type((VALUE)(x))
+
+#define RB_GC_GUARD(v) (*(volatile VALUE *)&(v))
+
+void rb_check_type _((VALUE,int));
+#define Check_Type(v,t) rb_check_type((VALUE)(v),t)
+
+VALUE rb_str_to_str _((VALUE));
+VALUE rb_string_value _((volatile VALUE*));
+char *rb_string_value_ptr _((volatile VALUE*));
+char *rb_string_value_cstr _((volatile VALUE*));
+
+#define StringValue(v) rb_string_value(&(v))
+#define StringValuePtr(v) rb_string_value_ptr(&(v))
+#define StringValueCStr(v) rb_string_value_cstr(&(v))
+
+void rb_check_safe_obj _((VALUE));
+void rb_check_safe_str _((VALUE));
+#define SafeStringValue(v) do {\
+ StringValue(v);\
+ rb_check_safe_obj(v);\
+} while (0)
+/* obsolete macro - use SafeStringValue(v) */
+#define Check_SafeStr(v) rb_check_safe_str((VALUE)(v))
+
+void rb_secure _((int));
+RUBY_EXTERN int ruby_safe_level;
+#define rb_safe_level() (ruby_safe_level)
+void rb_set_safe_level _((int));
+void rb_secure_update _((VALUE));
+
+long rb_num2long _((VALUE));
+unsigned long rb_num2ulong _((VALUE));
+#define NUM2LONG(x) (FIXNUM_P(x)?FIX2LONG(x):rb_num2long((VALUE)x))
+#define NUM2ULONG(x) rb_num2ulong((VALUE)x)
+#if SIZEOF_INT < SIZEOF_LONG
+long rb_num2int _((VALUE));
+#define NUM2INT(x) (FIXNUM_P(x)?FIX2INT(x):rb_num2int((VALUE)x))
+long rb_fix2int _((VALUE));
+#define FIX2INT(x) rb_fix2int((VALUE)x)
+unsigned long rb_num2uint _((VALUE));
+#define NUM2UINT(x) rb_num2uint(x)
+unsigned long rb_fix2uint _((VALUE));
+#define FIX2UINT(x) rb_fix2uint(x)
+#else
+#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
+
+#ifdef HAVE_LONG_LONG
+LONG_LONG rb_num2ll _((VALUE));
+unsigned LONG_LONG rb_num2ull _((VALUE));
+# define NUM2LL(x) (FIXNUM_P(x)?FIX2LONG(x):rb_num2ll((VALUE)x))
+# define NUM2ULL(x) rb_num2ull((VALUE)x)
+#endif
+
+#if defined(HAVE_LONG_LONG) && SIZEOF_OFF_T > SIZEOF_LONG
+# define NUM2OFFT(x) ((off_t)NUM2LL(x))
+#else
+# define NUM2OFFT(x) NUM2LONG(x)
+#endif
+
+double rb_num2dbl _((VALUE));
+#define NUM2DBL(x) rb_num2dbl((VALUE)(x))
+
+/* obsolete API - use StringValue() */
+char *rb_str2cstr _((VALUE,long*));
+/* obsolete API - use StringValuePtr() */
+#define STR2CSTR(x) rb_str2cstr((VALUE)(x),0)
+
+#define NUM2CHR(x) (((TYPE(x) == T_STRING)&&(RSTRING(x)->len>=1))?\
+ RSTRING(x)->ptr[0]:(char)(NUM2INT(x)&0xff))
+#define CHR2FIX(x) INT2FIX((long)((x)&0xff))
+
+VALUE rb_newobj _((void));
+#define NEWOBJ(obj,type) type *obj = (type*)rb_newobj()
+#define OBJSETUP(obj,c,t) do {\
+ RBASIC(obj)->flags = (t);\
+ RBASIC(obj)->klass = (c);\
+ if (rb_safe_level() >= 3) FL_SET(obj, FL_TAINT);\
+} while (0)
+#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)
+
+struct RBasic {
+ unsigned long flags;
+ VALUE klass;
+};
+
+struct RObject {
+ struct RBasic basic;
+ struct st_table *iv_tbl;
+};
+
+struct RClass {
+ struct RBasic basic;
+ struct st_table *iv_tbl;
+ struct st_table *m_tbl;
+ VALUE super;
+};
+#define RCLASS_IV_TBL(c) (RCLASS(c)->iv_tbl)
+#define RCLASS_M_TBL(c) (RCLASS(c)->m_tbl)
+#define RCLASS_SUPER(c) (RCLASS(c)->super)
+#define RMODULE_IV_TBL(m) RCLASS_IV_TBL(m)
+#define RMODULE_M_TBL(m) RCLASS_M_TBL(m)
+#define RMODULE_SUPER(m) RCLASS_SUPER(m)
+
+struct RFloat {
+ struct RBasic basic;
+ double value;
+};
+
+#define ELTS_SHARED FL_USER2
+
+struct RString {
+ struct RBasic basic;
+ long len;
+ char *ptr;
+ union {
+ long capa;
+ VALUE shared;
+ } aux;
+};
+#define RSTRING_PTR(s) (RSTRING(s)->ptr)
+#define RSTRING_LEN(s) (RSTRING(s)->len)
+
+struct RArray {
+ struct RBasic basic;
+ long len;
+ union {
+ long capa;
+ VALUE shared;
+ } aux;
+ VALUE *ptr;
+};
+#define RARRAY_PTR(s) (RARRAY(s)->ptr)
+#define RARRAY_LEN(s) (RARRAY(s)->len)
+
+struct RRegexp {
+ struct RBasic basic;
+ struct re_pattern_buffer *ptr;
+ long len;
+ char *str;
+};
+
+struct RHash {
+ struct RBasic basic;
+ struct st_table *tbl;
+ int iter_lev;
+ VALUE ifnone;
+};
+#define RHASH_TBL(h) (RHASH(h)->tbl)
+#define RHASH_ITER_LEV(h) (RHASH(h)->iter_lev)
+#define RHASH_IFNONE(h) (RHASH(h)->ifnone)
+#define RHASH_SIZE(h) (RHASH(h)->tbl->num_entries)
+#define RHASH_EMPTY_P(h) (RHASH_SIZE(h) == 0)
+
+struct RFile {
+ struct RBasic basic;
+ struct rb_io_t *fptr;
+};
+
+struct RData {
+ struct RBasic basic;
+ void (*dmark) _((void*));
+ void (*dfree) _((void*));
+ void *data;
+};
+
+#define DATA_PTR(dta) (RDATA(dta)->data)
+
+/*
+#define RUBY_DATA_FUNC(func) ((void (*)_((void*)))func)
+*/
+typedef void (*RUBY_DATA_FUNC) _((void*));
+
+VALUE rb_data_object_alloc _((VALUE,void*,RUBY_DATA_FUNC,RUBY_DATA_FUNC));
+
+#define Data_Wrap_Struct(klass,mark,free,sval)\
+ rb_data_object_alloc(klass,sval,(RUBY_DATA_FUNC)mark,(RUBY_DATA_FUNC)free)
+
+#define Data_Make_Struct(klass,type,mark,free,sval) (\
+ sval = ALLOC(type),\
+ memset(sval, 0, sizeof(type)),\
+ Data_Wrap_Struct(klass,mark,free,sval)\
+)
+
+#define Data_Get_Struct(obj,type,sval) do {\
+ Check_Type(obj, T_DATA); \
+ sval = (type*)DATA_PTR(obj);\
+} while (0)
+
+struct RStruct {
+ struct RBasic basic;
+ long len;
+ VALUE *ptr;
+};
+#define RSTRUCT_LEN(st) (RSTRUCT(st)->len)
+#define RSTRUCT_PTR(st) (RSTRUCT(st)->ptr)
+
+struct RBignum {
+ struct RBasic basic;
+ char sign;
+ long len;
+ void *digits;
+};
+
+#define R_CAST(st) (struct st*)
+#define RBASIC(obj) (R_CAST(RBasic)(obj))
+#define ROBJECT(obj) (R_CAST(RObject)(obj))
+#define RCLASS(obj) (R_CAST(RClass)(obj))
+#define RMODULE(obj) RCLASS(obj)
+#define RFLOAT(obj) (R_CAST(RFloat)(obj))
+#define RSTRING(obj) (R_CAST(RString)(obj))
+#define RREGEXP(obj) (R_CAST(RRegexp)(obj))
+#define RARRAY(obj) (R_CAST(RArray)(obj))
+#define RHASH(obj) (R_CAST(RHash)(obj))
+#define RDATA(obj) (R_CAST(RData)(obj))
+#define RSTRUCT(obj) (R_CAST(RStruct)(obj))
+#define RBIGNUM(obj) (R_CAST(RBignum)(obj))
+#define RFILE(obj) (R_CAST(RFile)(obj))
+
+#define FL_SINGLETON FL_USER0
+#define FL_MARK (1<<6)
+#define FL_FINALIZE (1<<7)
+#define FL_TAINT (1<<8)
+#define FL_EXIVAR (1<<9)
+#define FL_FREEZE (1<<10)
+
+#define FL_USHIFT 11
+
+#define FL_USER0 (1<<(FL_USHIFT+0))
+#define FL_USER1 (1<<(FL_USHIFT+1))
+#define FL_USER2 (1<<(FL_USHIFT+2))
+#define FL_USER3 (1<<(FL_USHIFT+3))
+#define FL_USER4 (1<<(FL_USHIFT+4))
+#define FL_USER5 (1<<(FL_USHIFT+5))
+#define FL_USER6 (1<<(FL_USHIFT+6))
+#define FL_USER7 (1<<(FL_USHIFT+7))
+
+#define FL_UMASK (0xff<<FL_USHIFT)
+
+#define SPECIAL_CONST_P(x) (IMMEDIATE_P(x) || !RTEST(x))
+
+#define FL_ABLE(x) (!SPECIAL_CONST_P(x))
+#define FL_TEST(x,f) (FL_ABLE(x)?(RBASIC(x)->flags&(f)):0)
+#define FL_SET(x,f) do {if (FL_ABLE(x)) RBASIC(x)->flags |= (f);} while (0)
+#define FL_UNSET(x,f) do {if (FL_ABLE(x)) RBASIC(x)->flags &= ~(f);} while (0)
+#define FL_REVERSE(x,f) do {if (FL_ABLE(x)) RBASIC(x)->flags ^= (f);} while (0)
+
+#define OBJ_TAINTED(x) FL_TEST((x), FL_TAINT)
+#define OBJ_TAINT(x) FL_SET((x), FL_TAINT)
+#define OBJ_INFECT(x,s) do {if (FL_ABLE(x) && FL_ABLE(s)) RBASIC(x)->flags |= RBASIC(s)->flags & FL_TAINT;} while (0)
+
+#define OBJ_FROZEN(x) FL_TEST((x), FL_FREEZE)
+#define OBJ_FREEZE(x) FL_SET((x), FL_FREEZE)
+
+#define ALLOC_N(type,n) (type*)xmalloc(sizeof(type)*(n))
+#define ALLOC(type) (type*)xmalloc(sizeof(type))
+#define REALLOC_N(var,type,n) (var)=(type*)xrealloc((char*)(var),sizeof(type)*(n))
+
+#define ALLOCA_N(type,n) (type*)alloca(sizeof(type)*(n))
+
+#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 rb_glob _((const char*,void(*)(const char*,VALUE),VALUE));
+void rb_globi _((const char*,void(*)(const char*,VALUE),VALUE));
+int ruby_brace_expand _((const char*,int,ruby_glob_func*,VALUE));
+int ruby_brace_glob _((const char*,int,ruby_glob_func*,VALUE));
+
+VALUE rb_define_class _((const char*,VALUE));
+VALUE rb_define_module _((const char*));
+VALUE rb_define_class_under _((VALUE, const char*, VALUE));
+VALUE rb_define_module_under _((VALUE, const char*));
+
+void rb_include_module _((VALUE,VALUE));
+void rb_extend_object _((VALUE,VALUE));
+
+void rb_define_variable _((const char*,VALUE*));
+void rb_define_virtual_variable _((const char*,VALUE(*)(ANYARGS),void(*)(ANYARGS)));
+void rb_define_hooked_variable _((const char*,VALUE*,VALUE(*)(ANYARGS),void(*)(ANYARGS)));
+int ruby_glob _((const char*,int,int(*)(const char*,VALUE),VALUE));
+int ruby_globi _((const char*,int,int(*)(const char*,VALUE),VALUE));
+void rb_define_readonly_variable _((const char*,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));
+
+void rb_undef_method _((VALUE,const char*));
+void rb_define_alias _((VALUE,const char*,const char*));
+void rb_define_attr _((VALUE,const char*,int,int));
+
+void rb_global_variable _((VALUE*));
+void rb_gc_register_address _((VALUE*));
+void rb_gc_unregister_address _((VALUE*));
+
+ID rb_intern _((const char*));
+const char *rb_id2name _((ID));
+ID rb_to_id _((VALUE));
+
+const char *rb_class2name _((VALUE));
+const char *rb_obj_classname _((VALUE));
+
+void rb_p _((VALUE));
+
+VALUE rb_eval_string _((const char*));
+VALUE rb_eval_string_protect _((const char*, int*));
+VALUE rb_eval_string_wrap _((const char*, int*));
+VALUE rb_funcall __((VALUE, ID, int, ...));
+VALUE rb_funcall2 _((VALUE, ID, int, const VALUE*));
+VALUE rb_funcall3 _((VALUE, ID, int, const VALUE*));
+int rb_scan_args __((int, const VALUE*, const char*, ...));
+VALUE rb_call_super _((int, const VALUE*));
+
+VALUE rb_gv_set _((const char*, VALUE));
+VALUE rb_gv_get _((const char*));
+VALUE rb_iv_get _((VALUE, const char*));
+VALUE rb_iv_set _((VALUE, const char*, VALUE));
+
+VALUE rb_equal _((VALUE,VALUE));
+
+RUBY_EXTERN VALUE ruby_verbose, ruby_debug;
+
+NORETURN(void rb_raise __((VALUE, const char*, ...)));
+NORETURN(void rb_fatal __((const char*, ...)));
+NORETURN(void rb_bug __((const char*, ...)));
+NORETURN(void rb_sys_fail _((const char*)));
+NORETURN(void rb_iter_break _((void)));
+NORETURN(void rb_exit _((int)));
+NORETURN(void rb_notimplement _((void)));
+
+void rb_warning __((const char*, ...)); /* reports if `-w' specified */
+void rb_sys_warning __((const char*, ...)); /* reports if `-w' specified */
+void rb_warn __((const char*, ...)); /* reports always */
+
+typedef VALUE rb_block_call_func _((VALUE, VALUE));
+
+VALUE rb_each _((VALUE));
+VALUE rb_yield _((VALUE));
+VALUE rb_yield_values __((int n, ...));
+VALUE rb_yield_splat _((VALUE));
+int rb_block_given_p _((void));
+void rb_need_block _((void));
+VALUE rb_iterate _((VALUE(*)(VALUE),VALUE,VALUE(*)(ANYARGS),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));
+NORETURN(void rb_throw _((const char*,VALUE)));
+
+VALUE rb_require _((const char*));
+
+#ifdef __ia64
+void ruby_init_stack(VALUE*, void*);
+#define RUBY_INIT_STACK \
+ VALUE variable_in_this_stack_frame; \
+ ruby_init_stack(&variable_in_this_stack_frame, rb_ia64_bsp());
+#else
+void ruby_init_stack(VALUE*);
+#define RUBY_INIT_STACK \
+ VALUE variable_in_this_stack_frame; \
+ ruby_init_stack(&variable_in_this_stack_frame);
+#endif
+void ruby_init _((void));
+void ruby_options _((int, char**));
+NORETURN(void ruby_run _((void)));
+
+RUBY_EXTERN VALUE rb_mKernel;
+RUBY_EXTERN VALUE rb_mComparable;
+RUBY_EXTERN VALUE rb_mEnumerable;
+RUBY_EXTERN VALUE rb_mPrecision;
+RUBY_EXTERN VALUE rb_mErrno;
+RUBY_EXTERN VALUE rb_mFileTest;
+RUBY_EXTERN VALUE rb_mGC;
+RUBY_EXTERN VALUE rb_mMath;
+RUBY_EXTERN VALUE rb_mProcess;
+
+RUBY_EXTERN VALUE rb_cObject;
+RUBY_EXTERN VALUE rb_cArray;
+RUBY_EXTERN VALUE rb_cBignum;
+RUBY_EXTERN VALUE rb_cBinding;
+RUBY_EXTERN VALUE rb_cClass;
+RUBY_EXTERN VALUE rb_cCont;
+RUBY_EXTERN VALUE rb_cDir;
+RUBY_EXTERN VALUE rb_cData;
+RUBY_EXTERN VALUE rb_cEnumerator;
+RUBY_EXTERN VALUE rb_cFalseClass;
+RUBY_EXTERN VALUE rb_cFile;
+RUBY_EXTERN VALUE rb_cFixnum;
+RUBY_EXTERN VALUE rb_cFloat;
+RUBY_EXTERN VALUE rb_cHash;
+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;
+RUBY_EXTERN VALUE rb_cNameErrorMesg;
+RUBY_EXTERN VALUE rb_cNilClass;
+RUBY_EXTERN VALUE rb_cNumeric;
+RUBY_EXTERN VALUE rb_cProc;
+RUBY_EXTERN VALUE rb_cRange;
+RUBY_EXTERN VALUE rb_cRegexp;
+RUBY_EXTERN VALUE rb_cStat;
+RUBY_EXTERN VALUE rb_cString;
+RUBY_EXTERN VALUE rb_cStruct;
+RUBY_EXTERN VALUE rb_cSymbol;
+RUBY_EXTERN VALUE rb_cThread;
+RUBY_EXTERN VALUE rb_cTime;
+RUBY_EXTERN VALUE rb_cTrueClass;
+RUBY_EXTERN VALUE rb_cUnboundMethod;
+
+RUBY_EXTERN VALUE rb_eException;
+RUBY_EXTERN VALUE rb_eStandardError;
+RUBY_EXTERN VALUE rb_eSystemExit;
+RUBY_EXTERN VALUE rb_eInterrupt;
+RUBY_EXTERN VALUE rb_eSignal;
+RUBY_EXTERN VALUE rb_eFatal;
+RUBY_EXTERN VALUE rb_eArgError;
+RUBY_EXTERN VALUE rb_eEOFError;
+RUBY_EXTERN VALUE rb_eIndexError;
+RUBY_EXTERN VALUE rb_eStopIteration;
+RUBY_EXTERN VALUE rb_eRangeError;
+RUBY_EXTERN VALUE rb_eIOError;
+RUBY_EXTERN VALUE rb_eRuntimeError;
+RUBY_EXTERN VALUE rb_eSecurityError;
+RUBY_EXTERN VALUE rb_eSystemCallError;
+RUBY_EXTERN VALUE rb_eThreadError;
+RUBY_EXTERN VALUE rb_eTypeError;
+RUBY_EXTERN VALUE rb_eZeroDivError;
+RUBY_EXTERN VALUE rb_eNotImpError;
+RUBY_EXTERN VALUE rb_eNoMemError;
+RUBY_EXTERN VALUE rb_eNoMethodError;
+RUBY_EXTERN VALUE rb_eFloatDomainError;
+RUBY_EXTERN VALUE rb_eLocalJumpError;
+RUBY_EXTERN VALUE rb_eSysStackError;
+RUBY_EXTERN VALUE rb_eRegexpError;
+
+RUBY_EXTERN VALUE rb_eScriptError;
+RUBY_EXTERN VALUE rb_eNameError;
+RUBY_EXTERN VALUE rb_eSyntaxError;
+RUBY_EXTERN VALUE rb_eLoadError;
+
+RUBY_EXTERN VALUE rb_stdin, rb_stdout, rb_stderr;
+RUBY_EXTERN VALUE ruby_errinfo;
+
+static inline VALUE
+#if defined(HAVE_PROTOTYPES)
+rb_class_of(VALUE obj)
+#else
+rb_class_of(obj)
+ VALUE obj;
+#endif
+{
+ if (FIXNUM_P(obj)) return rb_cFixnum;
+ if (obj == Qnil) return rb_cNilClass;
+ if (obj == Qfalse) return rb_cFalseClass;
+ if (obj == Qtrue) return rb_cTrueClass;
+ if (SYMBOL_P(obj)) return rb_cSymbol;
+
+ return RBASIC(obj)->klass;
+}
+
+static inline int
+#if defined(HAVE_PROTOTYPES)
+rb_type(VALUE obj)
+#else
+rb_type(obj)
+ VALUE obj;
+#endif
+{
+ if (FIXNUM_P(obj)) return T_FIXNUM;
+ if (obj == Qnil) return T_NIL;
+ if (obj == Qfalse) return T_FALSE;
+ if (obj == Qtrue) return T_TRUE;
+ if (obj == Qundef) return T_UNDEF;
+ if (SYMBOL_P(obj)) return T_SYMBOL;
+ return BUILTIN_TYPE(obj);
+}
+
+static inline int
+#if defined(HAVE_PROTOTYPES)
+rb_special_const_p(VALUE obj)
+#else
+rb_special_const_p(obj)
+ VALUE obj;
+#endif
+{
+ if (SPECIAL_CONST_P(obj)) return Qtrue;
+ return Qfalse;
+}
+
+#include "missing.h"
+#include "intern.h"
+
+#if defined(EXTLIB) && defined(USE_DLN_A_OUT)
+/* hook for external modules */
+static char *dln_libs_to_be_linked[] = { EXTLIB, 0 };
+#endif
+
+#if defined(HAVE_LIBPTHREAD)
+#ifdef HAVE_PTHREAD_H
+#include <pthread.h>
+#endif
+typedef pthread_t rb_nativethread_t;
+# define NATIVETHREAD_CURRENT() pthread_self()
+# define NATIVETHREAD_EQUAL(t1,t2) pthread_equal((t1),(t2))
+# define HAVE_NATIVETHREAD
+
+# define NATIVETHREAD_KILL(th,sig) pthread_kill((th),(sig))
+# define HAVE_NATIVETHREAD_KILL
+#elif defined(_WIN32) || defined(_WIN32_WCE)
+typedef DWORD rb_nativethread_t;
+# define NATIVETHREAD_CURRENT() GetCurrentThreadId()
+# define NATIVETHREAD_EQUAL(t1,t2) ((t1) == (t2))
+# define HAVE_NATIVETHREAD
+#endif
+#ifdef HAVE_NATIVETHREAD
+int is_ruby_native_thread _((void));
+#else
+#define is_ruby_native_thread() (1)
+#endif
+#ifdef HAVE_NATIVETHREAD_KILL
+void ruby_native_thread_kill _((int));
+#endif
+
+#if defined(__cplusplus)
+#if 0
+{ /* satisfy cc-mode */
+#endif
+} /* extern "C" { */
+#endif
+
+#endif /* ifndef RUBY_H */
diff --git a/rubyio.h b/rubyio.h
new file mode 100644
index 0000000000..a1ac885500
--- /dev/null
+++ b/rubyio.h
@@ -0,0 +1,91 @@
+/**********************************************************************
+
+ rubyio.h -
+
+ $Author$
+ $Date$
+ created at: Fri Nov 12 16:47:09 JST 1993
+
+ Copyright (C) 1993-2003 Yukihiro Matsumoto
+
+**********************************************************************/
+
+#ifndef RUBYIO_H
+#define RUBYIO_H
+
+#include <stdio.h>
+#include <errno.h>
+
+#if defined(HAVE_STDIO_EXT_H)
+#include <stdio_ext.h>
+#endif
+
+typedef struct rb_io_t {
+ FILE *f; /* stdio ptr for read/write */
+ FILE *f2; /* additional ptr for rw pipes */
+ int mode; /* mode flags */
+ int pid; /* child's pid (for pipes) */
+ int lineno; /* number of lines read */
+ char *path; /* pathname for file */
+ void (*finalize) _((struct rb_io_t*,int)); /* finalize proc */
+} rb_io_t;
+
+#define HAVE_RB_IO_T 1
+#define OpenFile rb_io_t /* for backward compatibility */
+
+#define FMODE_READABLE 1
+#define FMODE_WRITABLE 2
+#define FMODE_READWRITE 3
+#define FMODE_APPEND 64
+#define FMODE_CREATE 128
+#define FMODE_BINMODE 4
+#define FMODE_SYNC 8
+#define FMODE_WBUF 16
+#define FMODE_RBUF 32
+#define FMODE_WSPLIT 0x200
+#define FMODE_WSPLIT_INITIALIZED 0x400
+
+#define GetOpenFile(obj,fp) rb_io_check_closed((fp) = RFILE(rb_io_taint_check(obj))->fptr)
+
+#define MakeOpenFile(obj, fp) do {\
+ if (RFILE(obj)->fptr) {\
+ rb_io_close(obj);\
+ free(RFILE(obj)->fptr);\
+ RFILE(obj)->fptr = 0;\
+ }\
+ fp = 0;\
+ fp = RFILE(obj)->fptr = ALLOC(rb_io_t);\
+ fp->f = fp->f2 = NULL;\
+ fp->mode = 0;\
+ fp->pid = 0;\
+ fp->lineno = 0;\
+ fp->path = NULL;\
+ fp->finalize = 0;\
+} while (0)
+
+#define GetReadFile(fptr) ((fptr)->f)
+#define GetWriteFile(fptr) (((fptr)->f2) ? (fptr)->f2 : (fptr)->f)
+
+FILE *rb_fopen _((const char*, const char*));
+FILE *rb_fdopen _((int, const char*));
+int rb_getc _((FILE*));
+long rb_io_fread _((char *, long, FILE *));
+long rb_io_fwrite _((const char *, long, FILE *));
+int rb_io_mode_flags _((const char*));
+int rb_io_modenum_flags _((int));
+void rb_io_check_writable _((rb_io_t*));
+void rb_io_check_readable _((rb_io_t*));
+void rb_io_fptr_finalize _((rb_io_t*));
+void rb_io_synchronized _((rb_io_t*));
+void rb_io_check_initialized _((rb_io_t*));
+void rb_io_check_closed _((rb_io_t*));
+int rb_io_wait_readable _((int));
+int rb_io_wait_writable _((int));
+void rb_io_set_nonblock(rb_io_t *fptr);
+
+VALUE rb_io_taint_check _((VALUE));
+NORETURN(void rb_eof_error _((void)));
+
+void rb_read_check _((FILE*));
+int rb_read_pending _((FILE*));
+#endif
diff --git a/rubysig.h b/rubysig.h
new file mode 100644
index 0000000000..3eb877855e
--- /dev/null
+++ b/rubysig.h
@@ -0,0 +1,105 @@
+/**********************************************************************
+
+ rubysig.h -
+
+ $Author$
+ $Date$
+ created at: Wed Aug 16 01:15:38 JST 1995
+
+ Copyright (C) 1993-2003 Yukihiro Matsumoto
+
+**********************************************************************/
+
+#ifndef SIG_H
+#define SIG_H
+#include <errno.h>
+
+#ifdef _WIN32
+typedef LONG rb_atomic_t;
+
+# define ATOMIC_TEST(var) InterlockedExchange(&(var), 0)
+# define ATOMIC_SET(var, val) InterlockedExchange(&(var), (val))
+# define ATOMIC_INC(var) InterlockedIncrement(&(var))
+# define ATOMIC_DEC(var) InterlockedDecrement(&(var))
+
+/* Windows doesn't allow interrupt while system calls */
+# define TRAP_BEG do {\
+ int saved_errno = 0;\
+ rb_atomic_t trap_immediate = ATOMIC_SET(rb_trap_immediate, 1)
+# define TRAP_END\
+ ATOMIC_SET(rb_trap_immediate, trap_immediate);\
+ saved_errno = errno;\
+ CHECK_INTS;\
+ errno = saved_errno;\
+} while (0)
+# define RUBY_CRITICAL(statements) do {\
+ rb_w32_enter_critical();\
+ statements;\
+ rb_w32_leave_critical();\
+} while (0)
+#else
+typedef int rb_atomic_t;
+
+# define ATOMIC_TEST(var) ((var) ? ((var) = 0, 1) : 0)
+# define ATOMIC_SET(var, val) ((var) = (val))
+# define ATOMIC_INC(var) (++(var))
+# define ATOMIC_DEC(var) (--(var))
+
+# define TRAP_BEG do {\
+ int saved_errno = 0;\
+ int trap_immediate = rb_trap_immediate;\
+ rb_trap_immediate = 1
+# define TRAP_END rb_trap_immediate = trap_immediate;\
+ saved_errno = errno;\
+ CHECK_INTS;\
+ errno = saved_errno;\
+} while (0)
+
+# define RUBY_CRITICAL(statements) do {\
+ int trap_immediate = rb_trap_immediate;\
+ rb_trap_immediate = 0;\
+ statements;\
+ rb_trap_immediate = trap_immediate;\
+} while (0)
+#endif
+RUBY_EXTERN rb_atomic_t rb_trap_immediate;
+
+RUBY_EXTERN int rb_prohibit_interrupt;
+#define DEFER_INTS (rb_prohibit_interrupt++)
+#define ALLOW_INTS do {\
+ rb_prohibit_interrupt--;\
+ CHECK_INTS;\
+} while (0)
+#define ENABLE_INTS (rb_prohibit_interrupt--)
+
+VALUE rb_with_disable_interrupt _((VALUE(*)(ANYARGS),VALUE));
+
+RUBY_EXTERN rb_atomic_t rb_trap_pending;
+void rb_trap_restore_mask _((void));
+
+RUBY_EXTERN int rb_thread_critical;
+RUBY_EXTERN int rb_thread_pending;
+void rb_thread_schedule _((void));
+#if defined(HAVE_SETITIMER) || defined(_THREAD_SAFE)
+# define CHECK_INTS do {\
+ if (!(rb_prohibit_interrupt || rb_thread_critical)) {\
+ if (rb_thread_pending) rb_thread_schedule();\
+ if (rb_trap_pending) rb_trap_exec();\
+ }\
+} while (0)
+#else
+/* pseudo preemptive thread switching */
+RUBY_EXTERN int rb_thread_tick;
+#define THREAD_TICK 500
+#define CHECK_INTS do {\
+ if (!(rb_prohibit_interrupt || rb_thread_critical)) {\
+ if (rb_thread_pending || rb_thread_tick-- <= 0) {\
+ rb_thread_tick = THREAD_TICK;\
+ rb_thread_schedule();\
+ }\
+ }\
+ if (rb_trap_pending) rb_trap_exec();\
+} while (0)
+#endif
+
+#endif
diff --git a/rubytest.rb b/rubytest.rb
new file mode 100755
index 0000000000..8ae637c00e
--- /dev/null
+++ b/rubytest.rb
@@ -0,0 +1,49 @@
+#! ./miniruby
+
+exit if defined?(CROSS_COMPILING)
+load './rbconfig.rb'
+include Config
+
+ruby = "./#{CONFIG['ruby_install_name']}#{CONFIG['EXEEXT']}"
+unless File.exist? ruby
+ print "#{ruby} is not found.\n"
+ print "Try `make' first, then `make test', please.\n"
+ exit false
+end
+
+if File.exist? CONFIG['LIBRUBY_SO']
+ case RUBY_PLATFORM
+ when /-hpux/
+ dldpath = "SHLIB_PATH"
+ when /-aix/
+ dldpath = "LIBPATH"
+ when /-beos/
+ dldpath = "LIBRARY_PATH"
+ when /-darwin/
+ dldpath = "DYLD_LIBRARY_PATH"
+ else
+ dldpath = "LD_LIBRARY_PATH"
+ end
+ x = ENV[dldpath]
+ x = x ? ".:"+x : "."
+ ENV[dldpath] = x
+end
+
+if /linux/ =~ RUBY_PLATFORM and File.exist? CONFIG['LIBRUBY_SO']
+ ENV["LD_PRELOAD"] = "./#{CONFIG['LIBRUBY_SO']}"
+end
+
+$stderr.reopen($stdout)
+error = ''
+
+srcdir = File.dirname(__FILE__)
+`#{ruby} -I#{srcdir}/lib #{srcdir}/sample/test.rb`.each do |line|
+ if line =~ /^end of test/
+ print "test succeeded\n"
+ exit 0
+ end
+ error << line if line =~ %r:^(sample/test.rb|not):
+end
+print error
+print "test failed\n"
+exit 1
diff --git a/runruby.rb b/runruby.rb
new file mode 100755
index 0000000000..8b0e9c20e5
--- /dev/null
+++ b/runruby.rb
@@ -0,0 +1,71 @@
+#!./miniruby
+
+pure = true
+while arg = ARGV[0]
+ break ARGV.shift if arg == '--'
+ /\A--([-\w]+)(?:=(.*))?\z/ =~ arg or break
+ arg, value = $1, $2
+ re = Regexp.new('\A'+arg.gsub(/\w+\b/, '\&\\w*')+'\z', "i")
+ case
+ when re =~ "srcdir"
+ srcdir = value
+ when re =~ "archdir"
+ archdir = value
+ when re =~ "extout"
+ extout = value
+ when re =~ "pure"
+ pure = (value != "no")
+ when re =~ "debugger"
+ debugger = value ? (value.split unless value == "no") : %w"gdb --args"
+ else
+ break
+ end
+ ARGV.shift
+end
+
+srcdir ||= File.dirname(__FILE__)
+archdir ||= '.'
+
+abs_archdir = File.expand_path(archdir)
+$:.unshift(abs_archdir)
+
+require 'rbconfig'
+config = RbConfig::CONFIG
+
+ruby = File.join(archdir, config["RUBY_INSTALL_NAME"]+config['EXEEXT'])
+unless File.exist?(ruby)
+ abort "#{ruby} is not found.\nTry `make' first, then `make test', please.\n"
+end
+
+libs = [abs_archdir]
+if extout
+ abs_extout = File.expand_path(extout)
+ libs << File.expand_path("common", abs_extout) << File.expand_path(RUBY_PLATFORM, abs_extout)
+end
+libs << File.expand_path("lib", srcdir)
+config["bindir"] = abs_archdir
+ENV["RUBY"] = File.expand_path(ruby)
+ENV["PATH"] = [abs_archdir, ENV["PATH"]].compact.join(File::PATH_SEPARATOR)
+
+if pure
+ libs << File.expand_path("ext", srcdir) << "-"
+elsif e = ENV["RUBYLIB"]
+ libs |= e.split(File::PATH_SEPARATOR)
+end
+ENV["RUBYLIB"] = $:.replace(libs).join(File::PATH_SEPARATOR)
+
+libruby_so = File.join(abs_archdir, config['LIBRUBY_SO'])
+if File.file?(libruby_so)
+ if e = config['LIBPATHENV'] and !e.empty?
+ ENV[e] = [abs_archdir, ENV[e]].compact.join(File::PATH_SEPARATOR)
+ end
+ if /linux/ =~ RUBY_PLATFORM
+ ENV["LD_PRELOAD"] = [libruby_so, ENV["LD_PRELOAD"]].compact.join(' ')
+ end
+end
+
+cmd = [ruby]
+cmd << "-rpurelib.rb" if pure
+cmd.concat(ARGV)
+cmd.unshift(*debugger) if debugger
+exec(*cmd)
diff --git a/safe.c b/safe.c
deleted file mode 100644
index bb725e1394..0000000000
--- a/safe.c
+++ /dev/null
@@ -1,135 +0,0 @@
-/**********************************************************************
-
- eval.c -
-
- $Author$
- created at: Tue Sep 23 09:44:32 JST 2008
-
- Copyright (C) 2008 Yukihiro Matsumoto
-
-**********************************************************************/
-
-/* safe-level:
- 0 - strings from streams/environment/ARGV are tainted (default)
- 1 - no dangerous operation by tainted value
- 2 - process/file operations prohibited
- 3 - all generated objects are tainted
- 4 - no global (non-tainted) variable modification/no direct output
-*/
-
-#define SAFE_LEVEL_MAX 4
-
-#include "ruby/ruby.h"
-#include "vm_core.h"
-
-/* $SAFE accessor */
-
-int
-rb_safe_level(void)
-{
- return GET_THREAD()->safe_level;
-}
-
-void
-rb_set_safe_level_force(int safe)
-{
- GET_THREAD()->safe_level = safe;
-}
-
-void
-rb_set_safe_level(int level)
-{
- rb_thread_t *th = GET_THREAD();
-
- if (level > th->safe_level) {
- if (level > SAFE_LEVEL_MAX) {
- level = SAFE_LEVEL_MAX;
- }
- th->safe_level = level;
- }
-}
-
-static VALUE
-safe_getter(void)
-{
- return INT2NUM(rb_safe_level());
-}
-
-static void
-safe_setter(VALUE val)
-{
- int level = NUM2INT(val);
- rb_thread_t *th = GET_THREAD();
-
- if (level < th->safe_level) {
- rb_raise(rb_eSecurityError,
- "tried to downgrade safe level from %d to %d",
- th->safe_level, level);
- }
- if (level == 3) {
- rb_warning("$SAFE=3 does no sandboxing; you might want to use $SAFE=4");
- }
- if (level > SAFE_LEVEL_MAX) {
- level = SAFE_LEVEL_MAX;
- }
- th->safe_level = level;
-}
-
-void
-rb_secure(int level)
-{
- if (level <= rb_safe_level()) {
- if (rb_frame_callee()) {
- rb_raise(rb_eSecurityError, "Insecure operation `%s' at level %d",
- rb_id2name(rb_frame_callee()), rb_safe_level());
- }
- else {
- rb_raise(rb_eSecurityError, "Insecure operation at level %d",
- rb_safe_level());
- }
- }
-}
-
-void
-rb_secure_update(VALUE obj)
-{
- if (!OBJ_TAINTED(obj))
- rb_secure(4);
-}
-
-void
-rb_insecure_operation(void)
-{
- if (rb_frame_callee()) {
- rb_raise(rb_eSecurityError, "Insecure operation - %s",
- rb_id2name(rb_frame_callee()));
- }
- else {
- rb_raise(rb_eSecurityError, "Insecure operation: -r");
- }
-}
-
-void
-rb_check_safe_obj(VALUE x)
-{
- if (rb_safe_level() > 0 && OBJ_TAINTED(x)) {
- rb_insecure_operation();
- }
- rb_secure(4);
-}
-
-void
-rb_check_safe_str(VALUE x)
-{
- rb_check_safe_obj(x);
- if (TYPE(x) != T_STRING) {
- rb_raise(rb_eTypeError, "wrong argument type %s (expected String)",
- rb_obj_classname(x));
- }
-}
-
-void
-Init_safe(void)
-{
- rb_define_virtual_variable("$SAFE", safe_getter, safe_setter);
-}
diff --git a/sample/README b/sample/README
index 9187a9df2a..bc38a8b2d0 100644
--- a/sample/README
+++ b/sample/README
@@ -3,6 +3,7 @@ biorhythm.rb biorhythm calculator
cal.rb cal(1) clone
cbreak.rb no echo done by ioctl
clnt.rb socket client
+dbmtest.rb test for dbm
dir.rb directory access
dualstack-fetch.rb IPv6 demo
dualstack-httpd.rb IPv6 demo
@@ -19,6 +20,7 @@ fib.scm Fibonacci number (Scheme)
freq.rb count word occurrence
from.rb scan mail spool
fullpath.rb convert ls -lR to fullpath format
+getopts.test test fot getopt.rb
io.rb io test
irb.rb interactive ruby
less.rb front end for less
@@ -28,6 +30,7 @@ list3.rb stupid object sample
mine.rb simple mine sweeper
mkproto.rb extract prototype from C
mpart.rb split file int multi part
+mrshtest.rb test marshal
observ.rb observer design pattern sample
occur.pl count word occurrence (Perl)
occur.rb count word occurrence (Ruby)
@@ -38,6 +41,7 @@ rcs.awk random character stereogram (AWK)
rcs.rb random character stereogram (Ruby)
rcs.dat data for random character stereogram
rd2html.rb rd (Ruby Document) to HTML translator
+regx.rb regular expression tester
sieve.rb sieve of Eratosthenes
svr.rb socket server
test.rb test suite used by `make test'
diff --git a/sample/biorhythm.rb b/sample/biorhythm.rb
index 6465daa29f..c7e26c4fff 100644
--- a/sample/biorhythm.rb
+++ b/sample/biorhythm.rb
@@ -3,6 +3,7 @@
# biorhythm.rb -
# $Release Version: $
# $Revision$
+# $Date$
# by Yasuo OHBA(STAFS Development Room)
#
# --
@@ -26,8 +27,21 @@
include Math
require "date.rb"
-require "optparse"
-require "optparse/date"
+require "parsearg.rb"
+require "parsedate.rb"
+
+def usage()
+ print "Usage:\n"
+ print "biorhythm.rb [options]\n"
+ print " options...\n"
+ print " -D YYYYMMDD(birthday) : use default values.\n"
+ print " --sdate | --date YYYYMMDD : use system date; use specified date.\n"
+ print " --birthday YYYYMMDD : specifies your birthday.\n"
+ print " -v | -g : show values or graph.\n"
+ print " --days DAYS : graph range (only in effect for graphs).\n"
+ print " --help : help\n"
+end
+$USAGE = 'usage'
def printHeader(y, m, d, p, w)
print "\n>>> Biorhythm <<<\n"
@@ -44,52 +58,60 @@ def getPosition(z)
return phys, emot, geist
end
-def prompt(msg)
- $stderr.print msg
- return gets.chomp
+def parsedate(s)
+ ParseDate::parsedate(s).values_at(0, 1, 2)
+end
+
+def name_of_week(date)
+ Date::DAYNAMES[date.wday]
end
#
# main program
#
-options = {
- :graph => true,
- :date => Date.today,
- :days => 9,
-}
-ARGV.options do |opts|
- opts.on("-b", "--birthday=DATE", Date, "specify your birthday"){|v|
- options[:birthday] = v
- }
- opts.on("--date=DATE", Date, "specify date to show"){|v|
- options[:date] = v
- }
- opts.on("-g", "--show-graph", TrueClass, "show graph (default)"){|v|
- options[:graph] = v
- }
- opts.on("-v", "--show-values", TrueClass, "show values"){|v|
- options[:graph] = !v
- }
- opts.on("--days=DAYS", Integer, "graph range (only in effect for graph)"){|v|
- options[:days] = v - 1
- }
- opts.on_tail("-h", "--help", "show this message"){puts opts; exit}
- begin
- opts.parse!
- rescue => ex
- puts "Error: #{ex.message}"
- puts opts
- exit
+parseArgs(0, nil, "vg", "D:", "sdate", "date:", "birthday:", "days:")
+
+if $OPT_D
+ dd = Date.today
+ bd = Date.new(*parsedate($OPT_D))
+ ausgabeart = "g"
+else
+ if $OPT_birthday
+ bd = Date.new(*parsedate($OPT_birthday))
+ else
+ STDERR.print("Birthday (YYYYMMDD) : ")
+ unless (si = STDIN.gets.chop).empty?
+ bd = Date.new(*parsedate(si))
+ end
+ end
+ if !bd
+ STDERR.print "BAD Input Birthday!!\n"
+ exit()
end
-end
-bd = options[:birthday] || Date.parse(prompt("Your birthday (YYYYMMDD): "))
-dd = options[:date] || Date.today
-ausgabeart = options[:graph] ? "g" : "v"
-display_period = options[:days]
+ if $OPT_sdate
+ dd = Date.today
+ elsif $OPT_date
+ dd = Date.new(*parsedate($OPT_date))
+ else
+ STDERR.print("Date [<RETURN> for Systemdate] (YYYYMMDD) : ")
+ unless (si = STDIN.gets.chop).empty?
+ dd = Date.new(*parsedate(si))
+ end
+ end
+ dd ||= Date.today
+ if $OPT_v
+ ausgabeart = "v"
+ elsif $OPT_g
+ ausgabeart = "g"
+ else
+ STDERR.print("Values for today or Graph (v/g) [default g] : ")
+ ausgabeart = STDIN.gets.chop
+ end
+end
if ausgabeart == "v"
- printHeader(bd.year, bd.month, bd.day, dd - bd, bd.strftime("%a"))
+ printHeader(bd.year, bd.month, bd.day, dd - bd, name_of_week(bd))
print "\n"
phys, emot, geist = getPosition(dd - bd)
@@ -99,7 +121,21 @@ if ausgabeart == "v"
printf "Mental: %d%%\n", geist
print "\n"
else
- printHeader(bd.year, bd.month, bd.day, dd - bd, bd.strftime("%a"))
+ if $OPT_days
+ display_period = $OPT_days.to_i
+ elsif $OPT_D
+ display_period = 9
+ else
+ STDERR.printf("Graph for how many days [default 10] : ")
+ display_period = STDIN.gets.chop
+ if display_period.empty?
+ display_period = 9
+ else
+ display_period = display_period.to_i - 1
+ end
+ end
+
+ printHeader(bd.year, bd.month, bd.day, dd - bd, name_of_week(bd))
print " P=physical, E=emotional, M=mental\n"
print " -------------------------+-------------------------\n"
print " Bad Condition | Good Condition\n"
diff --git a/sample/coverage.rb b/sample/coverage.rb
deleted file mode 100644
index 3f45e9fc98..0000000000
--- a/sample/coverage.rb
+++ /dev/null
@@ -1,60 +0,0 @@
-require "coverage.so"
-
-Coverage.start
-
-ext = ENV["COVERUBY_EXT"] || ".cov"
-accum = ENV["COVERUBY_ACCUM"]
-accum = !accum || accum == "" || !(%w(f n 0).include?(accum[0]))
-pwd = Dir.pwd
-
-at_exit do
- Dir.chdir(pwd) do
- Coverage.result.each do |sfile, covs|
- cfile = sfile + ext
-
- writable = proc do |f|
- File.writable?(f) || File.writable?(File.dirname(f))
- end
- unless writable[cfile]
- cfile = cfile.gsub(File.PATH_SEPARATOR, "#")
- next unless writable[cfile]
- end
-
- readlines = proc do |f|
- File.read(f).force_encoding("ASCII-8BIT").lines.to_a
- end
-
- sources = (readlines[sfile] rescue [])
-
- pcovs = []
- if accum
- pcovs = (readlines[cfile] rescue []).map.with_index do |line, idx|
- if line[/^\s*(?:(#####)|(\d+)|-):\s*\d+:(.*)$/n]
- cov, line = $1 ? 0 : ($2 ? $2.to_i : nil), $3
- if !sources[idx] || sources[idx].chomp != line.chomp
- warn("source file changed, ignoring: `#{ cfile }'")
- break []
- end
- cov
- else
- p line
- warn("coverage file corrupted, ignoring: #{ cfile }")
- break []
- end
- end
- unless pcovs.empty? || pcovs.size == covs.size
- warn("coverage file changed, ignoring: `#{ cfile }'")
- pcovs = []
- end
- end
-
- open(cfile, "w") do |out|
- covs.zip(sources, pcovs).each_with_index do |(cov, line, pcov), idx|
- cov += pcov || 0 if cov
- cov = (cov ? (cov == 0 ? "#####" : cov.to_s) : "-").rjust(9)
- out.puts("%s:% 5d:%s" % [cov, idx + 1, line])
- end
- end
- end
- end
-end
diff --git a/sample/dbmtest.rb b/sample/dbmtest.rb
new file mode 100644
index 0000000000..c77cc2065b
--- /dev/null
+++ b/sample/dbmtest.rb
@@ -0,0 +1,14 @@
+# ruby dbm acess
+require "dbm"
+
+d = DBM.open("test")
+keys = d.keys
+if keys.length > 0 then
+ for k in keys; print k, "\n"; end
+ for v in d.values; print v, "\n"; end
+else
+ d['foobar'] = 'FB'
+ d['baz'] = 'BZ'
+ d['quux'] = 'QX'
+end
+
diff --git a/sample/drb/darrayc.rb b/sample/drb/darrayc.rb
index b181d22699..6f5ff6bb5d 100644
--- a/sample/drb/darrayc.rb
+++ b/sample/drb/darrayc.rb
@@ -45,3 +45,15 @@ ro.each do |x|
puts count
redo if count == 3
end
+
+puts "# each, retry"
+retried = false
+ro.each do |x|
+ puts x
+ if x == 4 && !retried
+ puts 'retry'
+ retried = true
+ retry
+ end
+end
+
diff --git a/sample/drb/dhasenc.rb b/sample/drb/dhasenc.rb
index 2774feba5a..8114e9228d 100644
--- a/sample/drb/dhasenc.rb
+++ b/sample/drb/dhasenc.rb
@@ -1,4 +1,3 @@
-# -*- encoding: euc-jp -*-
=begin
distributed Ruby --- dRuby Sample Client -- chasen client
Copyright (c) 1999-2001 Masatoshi SEKI
diff --git a/sample/erb/erb4html.rb b/sample/erb/erb4html.rb
new file mode 100644
index 0000000000..df0ffae44f
--- /dev/null
+++ b/sample/erb/erb4html.rb
@@ -0,0 +1,60 @@
+require 'erb'
+
+class ERB
+ class ERBString < String
+ def to_s; self; end
+
+ def erb_concat(s)
+ if self.class === s
+ concat(s)
+ else
+ concat(erb_quote(s))
+ end
+ end
+
+ def erb_quote(s); s; end
+ end
+end
+
+class ERB4Html < ERB
+ def self.quoted(s)
+ HtmlString.new(s)
+ end
+
+ class HtmlString < ERB::ERBString
+ def erb_quote(s)
+ ERB::Util::html_escape(s)
+ end
+ end
+
+ def set_eoutvar(compiler, eoutvar = '_erbout')
+ compiler.put_cmd = "#{eoutvar}.concat"
+ compiler.insert_cmd = "#{eoutvar}.erb_concat"
+
+ cmd = []
+ cmd.push "#{eoutvar} = ERB4Html.quoted('')"
+
+ compiler.pre_cmd = cmd
+
+ cmd = []
+ cmd.push(eoutvar)
+
+ compiler.post_cmd = cmd
+ end
+end
+
+if __FILE__ == $0
+ page = <<EOP
+<title><%=title%></title>
+<p><%=para%></p>
+EOP
+ erb = ERB4Html.new(page)
+
+ title = "<auto-quote>"
+ para = "&lt;quoted&gt;"
+ puts erb.result
+
+ title = "<auto-quote>"
+ para = ERB4Html.quoted("&lt;quoted&gt;")
+ puts erb.result
+end
diff --git a/sample/exyacc.rb b/sample/exyacc.rb
index c96ebfd676..5818825e25 100644
--- a/sample/exyacc.rb
+++ b/sample/exyacc.rb
@@ -2,19 +2,21 @@
# usage: exyacc.rb [yaccfiles]
# this is coverted from exyacc.pl in the camel book
-ARGF.each(nil) do |source|
- sbeg = source.index("\n%%") + 1
- send = source.rindex("\n%%") + 1
- grammer = source[sbeg, send-sbeg]
- grammer.sub!(/.*\n/, "")
- grammer.gsub!(/'\{'/, "'\001'")
- grammer.gsub!(/'\}'/, "'\002'")
- grammer.gsub!(%r{\*/}, "\003\003")
- grammer.gsub!(%r{/\*[^\003]*\003\003}, '')
- while grammer.gsub!(/\{[^{}]*\}/, ''); end
- grammer.gsub!(/'\001'/, "'{'")
- grammer.gsub!(/'\002'/, "'}'")
- while grammer.gsub!(/^[ \t]*\n(\s)/, '\1'); end
- grammer.gsub!(/([:|])[ \t\n]+(\w)/, '\1 \2')
- print grammer
+$/ = nil
+
+while gets()
+ sbeg = $_.index("\n%%") + 1
+ send = $_.rindex("\n%%") + 1
+ $_ = $_[sbeg, send-sbeg]
+ sub!(/.*\n/, "")
+ gsub!(/'\{'/, "'\001'")
+ gsub!(/'\}'/, "'\002'")
+ gsub!(%r{\*/}, "\003\003")
+ gsub!(%r{/\*[^\003]*\003\003}, '')
+ while gsub!(/\{[^{}]*\}/, ''); end
+ gsub!(/'\001'/, "'{'")
+ gsub!(/'\002'/, "'}'")
+ while gsub!(/^[ \t]*\n(\s)/, '\1'); end
+ gsub!(/([:|])[ \t\n]+(\w)/, '\1 \2')
+ print $_
end
diff --git a/sample/from.rb b/sample/from.rb
index aa93e6726a..6b0c702bb7 100644
--- a/sample/from.rb
+++ b/sample/from.rb
@@ -1,113 +1,98 @@
#! /usr/local/bin/ruby
-require "time"
+require "parsedate"
require "kconv"
+require "mailread"
+
+include ParseDate
+include Kconv
class String
+
+ def kconv(code = Kconv::EUC)
+ Kconv.kconv(self, code, Kconv::AUTO)
+ end
+
def kjust(len)
- res = ''
- rlen = 0
- self.each_char do |char|
- delta = char.bytesize > 1 ? 2 : 1
- break if rlen + delta > len
- rlen += delta
- res += char
+ len += 1
+ me = self[0, len].ljust(len)
+ if me =~ /.$/ and $&.size == 2
+ me[-2..-1] = ' '
+ me[-2, 2] = ' '
end
- res += ' ' * (len - rlen) if rlen < len
- res
+ me.chop!
end
+
end
-def fromout(date, from, subj)
- return 0 if !date
- y, m, d = Time.parse(date).to_a.reverse[4, 3] if date
- y ||= 0; m ||= 0; d ||= 0
- from ||= "sombody@somewhere"
- from.delete!("\r\n")
- from = from.kconv(Encoding.default_external).kjust(28)
- subj ||= "(nil)"
- subj.delete!("\r\n")
- subj = subj.kconv(Encoding.default_external).kjust(40)
- printf "%02d/%02d/%02d [%s] %s\n", y%100, m, d, from, subj
- return 1
+if ARGV[0] == '-w'
+ wait = true
+ ARGV.shift
end
-def get_mailfile(user)
- file = user
- unless user
- file = ENV['MAIL']
- user = ENV['USER'] || ENV['USERNAME'] || ENV['LOGNAME']
- end
+if ARGV.length == 0
+ file = ENV['MAIL']
+ user = ENV['USER'] || ENV['USERNAME'] || ENV['LOGNAME']
+else
+ file = user = ARGV[0]
+ ARGV.clear
+end
- if file == nil or !File.exist?(file)
- [ENV['SPOOLDIR'], '/usr/spool', '/var/spool', '/usr', '/var'].each do |m|
- path = "#{m}/mail/#{user}"
- if File.exist?(path)
- file = path
- break
- end
+if file == nil or !File.exist? file
+ [ENV['SPOOLDIR'], '/usr/spool', '/var/spool', '/usr', '/var'].each do |m|
+ if File.exist? f = "#{m}/mail/#{user}"
+ file = f
+ break
end
end
- file
end
-def from_main
- if ARGV[0] == '-w'
- wait = true
- ARGV.shift
+$outcount = 0;
+def fromout(date, from, subj)
+ return if !date
+ y, m, d = parsedate(date) if date
+ y ||= 0; m ||= 0; d ||= 0
+ if from
+ from.gsub! /\n/, ""
+ else
+ from = "sombody@somewhere"
end
- file = get_mailfile(ARGV[0])
-
- outcount = 0
- if File.exist?(file)
- atime = File.atime(file)
- mtime = File.mtime(file)
- open(file, "r") do |f|
- until f.eof?
- header = {}
- f.each_line do |line|
- next if /^From / =~ line # skip From-line
- break if /^$/ =~ line # end of header
-
- if /^(?<attr>\S+?):\s*(?<value>.*)/ =~ line
- attr.capitalize!
- header[attr] = value
- elsif attr
- header[attr] += "\n" + line.lstrip
- end
- end
+ if subj
+ subj.gsub! /\n/, ""
+ else
+ subj = "(nil)"
+ end
+ if ENV['LANG'] =~ /sjis/i
+ lang = Kconv::SJIS
+ else
+ lang = Kconv::EUC
+ end
+ from = from.kconv(lang).kjust(28)
+ subj = subj.kconv(lang).kjust(40)
+ printf "%02d/%02d/%02d [%s] %s\n",y%100,m,d,from,subj
+ $outcount += 1
+end
- f.each_line do |line|
- break if /^From / =~ line
- end
- outcount += fromout(header['Date'], header['From'], header['Subject'])
- end
+if File.exist?(file)
+ atime = File.atime(file)
+ mtime = File.mtime(file)
+ f = open(file, "r")
+ begin
+ until f.eof?
+ mail = Mail.new(f)
+ fromout mail.header['Date'],mail.header['From'],mail.header['Subject']
end
+ ensure
+ f.close
File.utime(atime, mtime, file)
end
-
- if outcount == 0
- print "You have no mail.\n"
- sleep 2 if wait
- elsif wait
- system "stty cbreak -echo"
- $stdin.getc
- system "stty cooked echo"
- end
end
-if __FILE__ == $0
- from_main
+if $outcount == 0
+ print "You have no mail.\n"
+ sleep 2 if wait
+elsif wait
+ system "stty cbreak -echo"
+ getc()
+ system "stty cooked echo"
end
-
-__END__
-
-=begin
-
-= from.rb
-
-== USAGE
-
-ruby from.rb [-w] [username_or_filename]
-
-=end
diff --git a/sample/getopts.test b/sample/getopts.test
new file mode 100644
index 0000000000..2866bccea8
--- /dev/null
+++ b/sample/getopts.test
@@ -0,0 +1,36 @@
+#! /usr/local/bin/ruby
+
+load("parsearg.rb")
+
+def usage()
+ printf "Usage:\n"
+ printf "%s -d [-x x] [-y y] [--geometry geom] [--version] [string ...]\n", $0
+end
+
+$USAGE = 'usage'
+parseArgs(0, "d&(x|y)", "dfg", "x:", "y:", "geometry:800x600", "version")
+if ($OPT_d)
+ if $OPT_version
+ printf "version 1.0\n"
+ end
+ if ($OPT_x)
+ printf("x = %d\n", $OPT_x.to_i)
+ end
+ if ($OPT_y)
+ printf("y = %d\n", $OPT_y.to_i)
+ end
+ if ($OPT_geometry)
+ printf("geometry = %s\n", $OPT_geometry)
+ end
+ if $OPT_f
+ printf "f = TRUE\n"
+ end
+ if $OPT_g
+ printf "g = TRUE\n"
+ end
+end
+
+while (ARGV.length != 0)
+ print "other = ", ARGV[0], "\n"
+ ARGV.shift
+end
diff --git a/sample/mine.rb b/sample/mine.rb
index 4ef006685e..8fc27e0c6d 100644
--- a/sample/mine.rb
+++ b/sample/mine.rb
@@ -1,5 +1,4 @@
#! /usr/bin/ruby -Ke
-# -*- encoding: euc-jp -*-
class Board
def clr
diff --git a/sample/mrshtest.rb b/sample/mrshtest.rb
new file mode 100644
index 0000000000..8d2dc9936b
--- /dev/null
+++ b/sample/mrshtest.rb
@@ -0,0 +1,13 @@
+include Marshal
+a = 25.6;
+pt = Struct.new('Point', :x,:y);
+x = pt.new(10, 10)
+y = pt.new(20, 20)
+rt = Struct.new('Rectangle', :origin,:corner);
+z = rt.new(x, y)
+c = Object.new
+s = [a, x, z, c, c, "fff"];
+p s
+d = dump(s);
+p d
+p load(d)
diff --git a/sample/occur.rb b/sample/occur.rb
index 4ec6ae479b..8bb09e15ad 100644
--- a/sample/occur.rb
+++ b/sample/occur.rb
@@ -1,8 +1,8 @@
# word occurrence listing
# usege: ruby occur.rb file..
freq = Hash.new(0)
-while line = gets()
- for word in line.split(/\W+/)
+while gets()
+ for word in split(/\W+/)
freq[word] += 1
end
end
diff --git a/sample/openssl/cert_store_view.rb b/sample/openssl/cert_store_view.rb
new file mode 100644
index 0000000000..26c4d527f7
--- /dev/null
+++ b/sample/openssl/cert_store_view.rb
@@ -0,0 +1,911 @@
+#!/usr/bin/env ruby
+
+require 'fox'
+require 'openssl'
+require 'time'
+require 'certstore'
+require 'getopts'
+
+include Fox
+
+module CertDumpSupport
+ def cert_label(cert)
+ subject_alt_name =
+ cert.extensions.find { |ext| ext.oid == 'subjectAltName' }
+ if subject_alt_name
+ subject_alt_name.value.split(/\s*,\s/).each do |alt_name_pair|
+ alt_tag, alt_name = alt_name_pair.split(/:/)
+ return alt_name
+ end
+ end
+ name_label(cert.subject)
+ end
+
+ def name_label(name)
+ ary = name.to_a
+ if (cn = ary.find { |rdn| rdn[0] == 'CN' })
+ return cn[1]
+ end
+ if ary.last[0] == 'OU'
+ return ary.last[1]
+ end
+ name.to_s
+ end
+
+ def name_text(name)
+ name.to_a.collect { |tag, value|
+ "#{tag} = #{value}"
+ }.reverse.join("\n")
+ end
+
+ def bn_label(bn)
+ ("0" << sprintf("%X", bn)).scan(/../).join(" ")
+ end
+end
+
+class CertDump
+ include CertDumpSupport
+
+ def initialize(cert)
+ @cert = cert
+ end
+
+ def get_dump(tag)
+ case tag
+ when 'Version'
+ version
+ when 'Serial'
+ serial
+ when 'Signature Algorithm'
+ signature_algorithm
+ when 'Issuer'
+ issuer
+ when 'Validity'
+ validity
+ when 'Not before'
+ not_before
+ when 'Not after'
+ not_after
+ when 'Subject'
+ subject
+ when 'Public key'
+ public_key
+ else
+ ext(tag)
+ end
+ end
+
+ def get_dump_line(tag)
+ case tag
+ when 'Version'
+ version_line
+ when 'Serial'
+ serial_line
+ when 'Signature Algorithm'
+ signature_algorithm_line
+ when 'Subject'
+ subject_line
+ when 'Issuer'
+ issuer_line
+ when 'Validity'
+ validity_line
+ when 'Not before'
+ not_before_line
+ when 'Not after'
+ not_after_line
+ when 'Public key'
+ public_key_line
+ else
+ ext_line(tag)
+ end
+ end
+
+private
+
+ def version
+ "Version: #{@cert.version + 1}"
+ end
+
+ def version_line
+ version
+ end
+
+ def serial
+ bn_label(@cert.serial)
+ end
+
+ def serial_line
+ serial
+ end
+
+ def signature_algorithm
+ @cert.signature_algorithm
+ end
+
+ def signature_algorithm_line
+ signature_algorithm
+ end
+
+ def subject
+ name_text(@cert.subject)
+ end
+
+ def subject_line
+ @cert.subject.to_s
+ end
+
+ def issuer
+ name_text(@cert.issuer)
+ end
+
+ def issuer_line
+ @cert.issuer.to_s
+ end
+
+ def validity
+ <<EOS
+Not before: #{not_before}
+Not after: #{not_after}
+EOS
+ end
+
+ def validity_line
+ "from #{@cert.not_before.iso8601} to #{@cert.not_after.iso8601}"
+ end
+
+ def not_before
+ @cert.not_before.to_s
+ end
+
+ def not_before_line
+ not_before
+ end
+
+ def not_after
+ @cert.not_after.to_s
+ end
+
+ def not_after_line
+ not_after
+ end
+
+ def public_key
+ @cert.public_key.to_text
+ end
+
+ def public_key_line
+ "#{@cert.public_key.class} -- " << public_key.scan(/\A[^\n]*/)[0] << '...'
+ end
+
+ def ext(tag)
+ @cert.extensions.each do |ext|
+ if ext.oid == tag
+ return ext_detail(tag, ext.value)
+ end
+ end
+ "(unknown)"
+ end
+
+ def ext_line(tag)
+ ext(tag).tr("\r\n", '')
+ end
+
+ def ext_detail(tag, value)
+ value
+ end
+end
+
+class CrlDump
+ include CertDumpSupport
+
+ def initialize(crl)
+ @crl = crl
+ end
+
+ def get_dump(tag)
+ case tag
+ when 'Version'
+ version
+ when 'Signature Algorithm'
+ signature_algorithm
+ when 'Issuer'
+ issuer
+ when 'Last update'
+ last_update
+ when 'Next update'
+ next_update
+ else
+ ext(tag)
+ end
+ end
+
+ def get_dump_line(tag)
+ case tag
+ when 'Version'
+ version_line
+ when 'Signature Algorithm'
+ signature_algorithm_line
+ when 'Issuer'
+ issuer_line
+ when 'Last update'
+ last_update_line
+ when 'Next update'
+ next_update_line
+ else
+ ext_line(tag)
+ end
+ end
+
+private
+
+ def version
+ "Version: #{@crl.version + 1}"
+ end
+
+ def version_line
+ version
+ end
+
+ def signature_algorithm
+ @crl.signature_algorithm
+ end
+
+ def signature_algorithm_line
+ signature_algorithm
+ end
+
+ def issuer
+ name_text(@crl.issuer)
+ end
+
+ def issuer_line
+ @crl.issuer.to_s
+ end
+
+ def last_update
+ @crl.last_update.to_s
+ end
+
+ def last_update_line
+ last_update
+ end
+
+ def next_update
+ @crl.next_update.to_s
+ end
+
+ def next_update_line
+ next_update
+ end
+
+ def ext(tag)
+ @crl.extensions.each do |ext|
+ if ext.oid == tag
+ return ext_detail(tag, ext.value)
+ end
+ end
+ "(unknown)"
+ end
+
+ def ext_line(tag)
+ ext(tag).tr("\r\n", '')
+ end
+
+ def ext_detail(tag, value)
+ value
+ end
+end
+
+class RevokedDump
+ include CertDumpSupport
+
+ def initialize(revoked)
+ @revoked = revoked
+ end
+
+ def get_dump(tag)
+ case tag
+ when 'Serial'
+ serial
+ when 'Time'
+ time
+ else
+ ext(tag)
+ end
+ end
+
+ def get_dump_line(tag)
+ case tag
+ when 'Serial'
+ serial_line
+ when 'Time'
+ time_line
+ else
+ ext_line(tag)
+ end
+ end
+
+private
+
+ def serial
+ bn_label(@revoked.serial)
+ end
+
+ def serial_line
+ serial
+ end
+
+ def time
+ @revoked.time.to_s
+ end
+
+ def time_line
+ time
+ end
+
+ def ext(tag)
+ @revoked.extensions.each do |ext|
+ if ext.oid == tag
+ return ext_detail(tag, ext.value)
+ end
+ end
+ "(unknown)"
+ end
+
+ def ext_line(tag)
+ ext(tag).tr("\r\n", '')
+ end
+
+ def ext_detail(tag, value)
+ value
+ end
+end
+
+class RequestDump
+ include CertDumpSupport
+
+ def initialize(req)
+ @req = req
+ end
+
+ def get_dump(tag)
+ case tag
+ when 'Version'
+ version
+ when 'Signature Algorithm'
+ signature_algorithm
+ when 'Subject'
+ subject
+ when 'Public key'
+ public_key
+ else
+ attributes(tag)
+ end
+ end
+
+ def get_dump_line(tag)
+ case tag
+ when 'Version'
+ version_line
+ when 'Signature Algorithm'
+ signature_algorithm_line
+ when 'Subject'
+ subject_line
+ when 'Public key'
+ public_key_line
+ else
+ attributes_line(tag)
+ end
+ end
+
+private
+
+ def version
+ "Version: #{@req.version + 1}"
+ end
+
+ def version_line
+ version
+ end
+
+ def signature_algorithm
+ @req.signature_algorithm
+ end
+
+ def signature_algorithm_line
+ signature_algorithm
+ end
+
+ def subject
+ name_text(@req.subject)
+ end
+
+ def subject_line
+ @req.subject.to_s
+ end
+
+ def public_key
+ @req.public_key.to_text
+ end
+
+ def public_key_line
+ "#{@req.public_key.class} -- " << public_key.scan(/\A[^\n]*/)[0] << '...'
+ end
+
+ def attributes(tag)
+ "(unknown)"
+ end
+
+ def attributes_line(tag)
+ attributes(tag).tr("\r\n", '')
+ end
+end
+
+class CertStoreView < FXMainWindow
+ class CertTree
+ include CertDumpSupport
+
+ def initialize(observer, tree)
+ @observer = observer
+ @tree = tree
+ @tree.connect(SEL_COMMAND) do |sender, sel, item|
+ if item.data
+ @observer.getApp().beginWaitCursor do
+ @observer.show_item(item.data)
+ end
+ else
+ @observer.show_item(nil)
+ end
+ end
+ end
+
+ def show(cert_store)
+ @tree.clearItems
+ @self_signed_ca_node = add_item_last(nil, "Trusted root CA")
+ @other_ca_node = add_item_last(nil, "Intermediate CA")
+ @ee_node = add_item_last(nil, "Personal")
+ @crl_node = add_item_last(nil, "CRL")
+ @request_node = add_item_last(nil, "Request")
+ @verify_path_node = add_item_last(nil, "Certification path")
+ show_certs(cert_store)
+ end
+
+ def show_certs(cert_store)
+ remove_items(@self_signed_ca_node)
+ remove_items(@other_ca_node)
+ remove_items(@ee_node)
+ remove_items(@crl_node)
+ remove_items(@request_node)
+ import_certs(cert_store)
+ end
+
+ def show_request(req)
+ node = add_item_last(@request_node, name_label(req.subject), req)
+ @tree.selectItem(node)
+ @observer.show_item(req)
+ end
+
+ def show_verify_path(verify_path)
+ add_verify_path(verify_path)
+ end
+
+ private
+
+ def open_node(node)
+ node.expanded = node.opened = true
+ end
+
+ def close_node(node)
+ node.expanded = node.opened = false
+ end
+
+ def import_certs(cert_store)
+ cert_store.self_signed_ca.each do |cert|
+ add_item_last(@self_signed_ca_node, cert_label(cert), cert)
+ end
+ cert_store.other_ca.each do |cert|
+ add_item_last(@other_ca_node, cert_label(cert), cert)
+ end
+ cert_store.ee.each do |cert|
+ add_item_last(@ee_node, cert_label(cert), cert)
+ end
+ cert_store.crl.each do |crl|
+ node = add_item_last(@crl_node, name_label(crl.issuer), crl)
+ close_node(node)
+ crl.revoked.each do |revoked|
+ add_item_last(node, bn_label(revoked.serial), revoked)
+ end
+ end
+ cert_store.request.each do |req|
+ add_item_last(@requestnode, name_label(req.subject), req)
+ end
+ end
+
+ def add_verify_path(verify_path)
+ node = @verify_path_node
+ last_cert = nil
+ verify_path.reverse_each do |ok, cert, crl_check, error_string|
+ warn = []
+ if @observer.cert_store.is_ca?(cert)
+ warn << 'NO ARL' unless crl_check
+ else
+ warn << 'NO CRL' unless crl_check
+ end
+ warn_str = '(' << warn.join(", ") << ')'
+ warn_mark = warn.empty? ? '' : '!'
+ label = if ok
+ "OK#{warn_mark}..." + cert_label(cert)
+ else
+ "NG(#{error_string})..." + cert_label(cert)
+ end
+ label << warn_str unless warn.empty?
+ node = add_item_last(node, label, cert)
+ node.expanded = true
+ last_cert = cert
+ end
+ if last_cert
+ @tree.selectItem(node)
+ @observer.show_item(last_cert)
+ end
+ end
+
+ def add_item_last(parent, label, obj = nil)
+ node = @tree.addItemLast(parent, FXTreeItem.new(label))
+ node.data = obj if obj
+ open_node(node)
+ node
+ end
+
+ def remove_items(node)
+ while node.getNumChildren > 0
+ @tree.removeItem(node.getFirst)
+ end
+ end
+ end
+
+ class CertInfo
+ def initialize(observer, table)
+ @observer = observer
+ @table = table
+ @table.leadingRows = 0
+ @table.leadingCols = 0
+ @table.trailingRows = 0
+ @table.trailingCols = 0
+ @table.showVertGrid(false)
+ @table.showHorzGrid(false)
+ @table.setTableSize(1, 2)
+ @table.setColumnWidth(0, 125)
+ @table.setColumnWidth(1, 350)
+ end
+
+ def show(item)
+ @observer.show_detail(nil, nil)
+ if item.nil?
+ set_column_size(1)
+ return
+ end
+ case item
+ when OpenSSL::X509::Certificate
+ show_cert(item)
+ when OpenSSL::X509::CRL
+ show_crl(item)
+ when OpenSSL::X509::Revoked
+ show_revoked(item)
+ when OpenSSL::X509::Request
+ show_request(item)
+ else
+ raise NotImplementedError.new("Unknown item type #{item.class}.")
+ end
+ end
+
+ private
+
+ def show_cert(cert)
+ wrap = CertDump.new(cert)
+ items = []
+ items << ['Version', wrap.get_dump_line('Version')]
+ items << ['Signature Algorithm', wrap.get_dump_line('Signature Algorithm')]
+ items << ['Issuer', wrap.get_dump_line('Issuer')]
+ items << ['Serial', wrap.get_dump_line('Serial')]
+ #items << ['Not before', wrap.get_dump_line('Not before')]
+ #items << ['Not after', wrap.get_dump_line('Not after')]
+ items << ['Subject', wrap.get_dump_line('Subject')]
+ items << ['Public key', wrap.get_dump_line('Public key')]
+ items << ['Validity', wrap.get_dump_line('Validity')]
+ (cert.extensions.sort { |a, b| a.oid <=> b.oid }).each do |ext|
+ items << [ext.oid, wrap.get_dump_line(ext.oid)]
+ end
+ show_items(cert, items)
+ end
+
+ def show_crl(crl)
+ wrap = CrlDump.new(crl)
+ items = []
+ items << ['Version', wrap.get_dump_line('Version')]
+ items << ['Signature Algorithm', wrap.get_dump_line('Signature Algorithm')]
+ items << ['Issuer', wrap.get_dump_line('Issuer')]
+ items << ['Last update', wrap.get_dump_line('Last update')]
+ items << ['Next update', wrap.get_dump_line('Next update')]
+ crl.extensions.each do |ext|
+ items << [ext.oid, wrap.get_dump_line(ext.oid)]
+ end
+ show_items(crl, items)
+ end
+
+ def show_revoked(revoked)
+ wrap = RevokedDump.new(revoked)
+ items = []
+ items << ['Serial', wrap.get_dump_line('Serial')]
+ items << ['Time', wrap.get_dump_line('Time')]
+ revoked.extensions.each do |ext|
+ items << [ext.oid, wrap.get_dump_line(ext.oid)]
+ end
+ show_items(revoked, items)
+ end
+
+ def show_request(req)
+ wrap = RequestDump.new(req)
+ items = []
+ items << ['Version', wrap.get_dump_line('Version')]
+ items << ['Signature Algorithm', wrap.get_dump_line('Signature Algorithm')]
+ items << ['Subject', wrap.get_dump_line('Subject')]
+ items << ['Public key', wrap.get_dump_line('Public key')]
+ req.attributes.each do |attr|
+ items << [attr.attr, wrap.get_dump_line(attr.oid)]
+ end
+ show_items(req, items)
+ end
+
+ def show_items(obj, items)
+ set_column_size(items.size)
+ items.each_with_index do |ele, idx|
+ tag, value = ele
+ @table.setItemText(idx, 0, tag)
+ @table.getItem(idx, 0).data = tag
+ @table.setItemText(idx, 1, value.to_s)
+ @table.getItem(idx, 1).data = tag
+ end
+ @table.connect(SEL_COMMAND) do |sender, sel, loc|
+ item = @table.getItem(loc.row, loc.col)
+ @observer.show_detail(obj, item.data)
+ end
+ justify_table
+ end
+
+ def set_column_size(size)
+ col0_width = @table.getColumnWidth(0)
+ col1_width = @table.getColumnWidth(1)
+ @table.setTableSize(size, 2)
+ @table.setColumnWidth(0, col0_width)
+ @table.setColumnWidth(1, col1_width)
+ end
+
+ def justify_table
+ for col in 0..@table.numCols-1
+ for row in 0..@table.numRows-1
+ @table.getItem(row, col).justify = FXTableItem::LEFT
+ end
+ end
+ end
+ end
+
+ class CertDetail
+ def initialize(observer, detail)
+ @observer = observer
+ @detail = detail
+ end
+
+ def show(item, tag)
+ if item.nil?
+ @detail.text = ''
+ return
+ end
+ case item
+ when OpenSSL::X509::Certificate
+ show_cert(item, tag)
+ when OpenSSL::X509::CRL
+ show_crl(item, tag)
+ when OpenSSL::X509::Revoked
+ show_revoked(item, tag)
+ when OpenSSL::X509::Request
+ show_request(item, tag)
+ else
+ raise NotImplementedError.new("Unknown item type #{item.class}.")
+ end
+ end
+
+ private
+
+ def show_cert(cert, tag)
+ wrap = CertDump.new(cert)
+ @detail.text = wrap.get_dump(tag)
+ end
+
+ def show_crl(crl, tag)
+ wrap = CrlDump.new(crl)
+ @detail.text = wrap.get_dump(tag)
+ end
+
+ def show_revoked(revoked, tag)
+ wrap = RevokedDump.new(revoked)
+ @detail.text = wrap.get_dump(tag)
+ end
+
+ def show_request(request, tag)
+ wrap = RequestDump.new(request)
+ @detail.text = wrap.get_dump(tag)
+ end
+ end
+
+ attr_reader :cert_store
+
+ def initialize(app, cert_store)
+ @cert_store = cert_store
+ @verify_filter = 0
+ @verify_filename = nil
+ full_width = 800
+ full_height = 500
+ horz_pos = 300
+
+ super(app, "Certificate store", nil, nil, DECOR_ALL, 0, 0, full_width,
+ full_height)
+
+ FXTooltip.new(self.getApp())
+
+ menubar = FXMenubar.new(self, LAYOUT_SIDE_TOP|LAYOUT_FILL_X)
+ file_menu = FXMenuPane.new(self)
+ FXMenuTitle.new(menubar, "&File", nil, file_menu)
+ file_open_menu = FXMenuPane.new(self)
+ FXMenuCommand.new(file_open_menu, "&Directory\tCtl-O").connect(SEL_COMMAND,
+ method(:on_cmd_file_open_dir))
+ FXMenuCascade.new(file_menu, "&Open\tCtl-O", nil, file_open_menu)
+ FXMenuCommand.new(file_menu, "&Quit\tCtl-Q", nil, getApp(), FXApp::ID_QUIT)
+
+ tool_menu = FXMenuPane.new(self)
+ FXMenuTitle.new(menubar, "&Tool", nil, tool_menu)
+ FXMenuCommand.new(tool_menu, "&Verify\tCtl-N").connect(SEL_COMMAND,
+ method(:on_cmd_tool_verify))
+ FXMenuCommand.new(tool_menu, "&Show Request\tCtl-R").connect(SEL_COMMAND,
+ method(:on_cmd_tool_request))
+
+ base_frame = FXHorizontalFrame.new(self, LAYOUT_FILL_X | LAYOUT_FILL_Y)
+ splitter_horz = FXSplitter.new(base_frame, LAYOUT_SIDE_TOP | LAYOUT_FILL_X |
+ LAYOUT_FILL_Y | SPLITTER_TRACKING | SPLITTER_HORIZONTAL)
+
+ # Cert tree
+ cert_tree_frame = FXHorizontalFrame.new(splitter_horz, LAYOUT_FILL_X |
+ LAYOUT_FILL_Y | FRAME_SUNKEN | FRAME_THICK)
+ cert_tree_frame.setWidth(horz_pos)
+ cert_tree = FXTreeList.new(cert_tree_frame, 0, nil, 0,
+ TREELIST_BROWSESELECT | TREELIST_SHOWS_LINES | TREELIST_SHOWS_BOXES |
+ TREELIST_ROOT_BOXES | LAYOUT_FILL_X | LAYOUT_FILL_Y)
+ @cert_tree = CertTree.new(self, cert_tree)
+
+ # Cert info
+ splitter_vert = FXSplitter.new(splitter_horz, LAYOUT_SIDE_TOP |
+ LAYOUT_FILL_X | LAYOUT_FILL_Y | SPLITTER_TRACKING | SPLITTER_VERTICAL |
+ SPLITTER_REVERSED)
+ cert_list_base = FXVerticalFrame.new(splitter_vert, LAYOUT_FILL_X |
+ LAYOUT_FILL_Y, 0,0,0,0, 0,0,0,0)
+ cert_list_frame = FXHorizontalFrame.new(cert_list_base, FRAME_SUNKEN |
+ FRAME_THICK | LAYOUT_FILL_X | LAYOUT_FILL_Y)
+ cert_info = FXTable.new(cert_list_frame, 2, 10, nil, 0, FRAME_SUNKEN |
+ TABLE_COL_SIZABLE | LAYOUT_FILL_X | LAYOUT_FILL_Y, 0, 0, 0, 0, 2, 2, 2, 2)
+ @cert_info = CertInfo.new(self, cert_info)
+
+ cert_detail_base = FXVerticalFrame.new(splitter_vert, LAYOUT_FILL_X |
+ LAYOUT_FILL_Y, 0,0,0,0, 0,0,0,0)
+ cert_detail_frame = FXHorizontalFrame.new(cert_detail_base, FRAME_SUNKEN |
+ FRAME_THICK | LAYOUT_FILL_X | LAYOUT_FILL_Y)
+ cert_detail = FXText.new(cert_detail_frame, nil, 0, TEXT_READONLY |
+ LAYOUT_FILL_X | LAYOUT_FILL_Y)
+ @cert_detail = CertDetail.new(self, cert_detail)
+
+ show_init
+ end
+
+ def create
+ super
+ show(PLACEMENT_SCREEN)
+ end
+
+ def show_init
+ @cert_tree.show(@cert_store)
+ show_item(nil)
+ end
+
+ def show_certs
+ @cert_tree.show_certs(@cert_store)
+ end
+
+ def show_request(req)
+ @cert_tree.show_request(req)
+ end
+
+ def show_verify_path(verify_path)
+ @cert_tree.show_verify_path(verify_path)
+ end
+
+ def show_item(item)
+ @cert_info.show(item) if @cert_info
+ end
+
+ def show_detail(item, tag)
+ @cert_detail.show(item, tag) if @cert_detail
+ end
+
+ def verify(certfile)
+ path = verify_certfile(certfile)
+ show_certs # CRL could be change.
+ show_verify_path(path)
+ end
+
+private
+
+ def on_cmd_file_open_dir(sender, sel, ptr)
+ dir = FXFileDialog.getOpenDirectory(self, "Open certificate directory", ".")
+ unless dir.empty?
+ begin
+ @cert_store = CertStore.new(dir)
+ rescue
+ show_error($!)
+ end
+ show_init
+ end
+ 1
+ end
+
+ def on_cmd_tool_verify(sender, sel, ptr)
+ dialog = FXFileDialog.new(self, "Verify certificate")
+ dialog.filename = ''
+ dialog.patternList = ["All Files (*)", "PEM formatted certificate (*.pem)"]
+ dialog.currentPattern = @verify_filter
+ if dialog.execute != 0
+ @verify_filename = dialog.filename
+ verify(@verify_filename)
+ end
+ @verify_filter = dialog.currentPattern
+ 1
+ end
+
+ def on_cmd_tool_request(sender, sel, ptr)
+ dialog = FXFileDialog.new(self, "Show request")
+ dialog.filename = ''
+ dialog.patternList = ["All Files (*)", "PEM formatted certificate (*.pem)"]
+ if dialog.execute != 0
+ req = @cert_store.generate_cert(dialog.filename)
+ show_request(req)
+ end
+ 1
+ end
+
+ def verify_certfile(filename)
+ begin
+ cert = @cert_store.generate_cert(filename)
+ result = @cert_store.verify(cert)
+ @cert_store.scan_certs
+ result
+ rescue
+ show_error($!)
+ []
+ end
+ end
+
+ def show_error(e)
+ msg = e.inspect + "\n" + e.backtrace.join("\n")
+ FXMessageBox.error(self, MBOX_OK, "Error", msg)
+ end
+end
+
+getopts nil, "cert:"
+
+certs_dir = ARGV.shift or raise "#{$0} cert_dir"
+certfile = $OPT_cert
+app = FXApp.new("CertStore", "FoxTest")
+cert_store = CertStore.new(certs_dir)
+w = CertStoreView.new(app, cert_store)
+app.create
+if certfile
+ w.verify(certfile)
+end
+app.run
diff --git a/sample/openssl/cipher.rb b/sample/openssl/cipher.rb
index 58b10d6046..6e8cdb9427 100644
--- a/sample/openssl/cipher.rb
+++ b/sample/openssl/cipher.rb
@@ -1,54 +1,33 @@
#!/usr/bin/env ruby
require 'openssl'
-def crypt_by_password(alg, pass, salt, text)
- puts "--Setup--"
- puts %(cipher alg: "#{alg}")
- puts %(plain text: "#{text}")
- puts %(password: "#{pass}")
- puts %(salt: "#{salt}")
- puts
-
- puts "--Encrypting--"
- enc = OpenSSL::Cipher::Cipher.new(alg)
- enc.encrypt
- enc.pkcs5_keyivgen(pass, salt)
- cipher = enc.update(text)
- cipher << enc.final
- puts %(encrypted text: #{cipher.inspect})
- puts
-
- puts "--Decrypting--"
- dec = OpenSSL::Cipher::Cipher.new(alg)
- dec.decrypt
- dec.pkcs5_keyivgen(pass, salt)
- plain = dec.update(cipher)
- plain << dec.final
- puts %(decrypted text: "#{plain}")
- puts
-end
-
-def ciphers
- ciphers = OpenSSL::Cipher.ciphers.sort
- ciphers.each{|i|
- if i.upcase != i && ciphers.include?(i.upcase)
- ciphers.delete(i)
- end
- }
- return ciphers
-end
+text = "abcdefghijklmnopqrstuvwxyz"
+pass = "secret password"
+salt = "8 octets" # or nil
+alg = "DES-EDE3-CBC"
+#alg = "AES-128-CBC"
-puts "Supported ciphers in #{OpenSSL::OPENSSL_VERSION}:"
-ciphers.each_with_index{|name, i|
- printf("%-15s", name)
- puts if (i + 1) % 5 == 0
-}
-puts
+puts "--Setup--"
+puts %(clear text: "#{text}")
+puts %(password: "#{pass}")
+puts %(salt: "#{salt}")
+puts %(cipher alg: "#{alg}")
puts
-alg = ARGV.shift || ciphers.first
-pass = "secret password"
-salt = "8 octets" # or nil
-text = "abcdefghijklmnopqrstuvwxyz"
+puts "--Encrypting--"
+des = OpenSSL::Cipher::Cipher.new(alg)
+des.pkcs5_keyivgen(pass, salt)
+des.encrypt
+cipher = des.update(text)
+cipher << des.final
+puts %(encrypted text: #{cipher.inspect})
+puts
-crypt_by_password(alg, pass, salt, text)
+puts "--Decrypting--"
+des = OpenSSL::Cipher::Cipher.new(alg)
+des.pkcs5_keyivgen(pass, salt)
+des.decrypt
+out = des.update(cipher)
+out << des.final
+puts %(decrypted text: "#{out}")
+puts
diff --git a/sample/openssl/echo_cli.rb b/sample/openssl/echo_cli.rb
index 069a21ec94..29b356a7ad 100644
--- a/sample/openssl/echo_cli.rb
+++ b/sample/openssl/echo_cli.rb
@@ -2,15 +2,15 @@
require 'socket'
require 'openssl'
-require 'optparse'
+require 'getopts'
-options = ARGV.getopts("p:c:k:C:")
+getopts nil, "p:2000", "c:", "k:", "C:"
host = ARGV[0] || "localhost"
-port = options["p"] || "2000"
-cert_file = options["c"]
-key_file = options["k"]
-ca_path = options["C"]
+port = $OPT_p
+cert_file = $OPT_c
+key_file = $OPT_k
+ca_path = $OPT_C
ctx = OpenSSL::SSL::SSLContext.new()
if cert_file && key_file
@@ -27,18 +27,11 @@ end
s = TCPSocket.new(host, port)
ssl = OpenSSL::SSL::SSLSocket.new(s, ctx)
ssl.connect # start SSL session
-p ssl.peer_cert
-errors = Hash.new
-OpenSSL::X509.constants.grep(/^V_(ERR_|OK)/).each do |name|
- errors[OpenSSL::X509.const_get(name)] = name
-end
-p errors[ssl.verify_result]
-
ssl.sync_close = true # if true the underlying socket will be
# closed in SSLSocket#close. (default: false)
while line = $stdin.gets
ssl.write line
- puts ssl.gets.inspect
+ print ssl.gets
end
ssl.close
diff --git a/sample/openssl/echo_svr.rb b/sample/openssl/echo_svr.rb
index 719de6be84..be8e10fa26 100644
--- a/sample/openssl/echo_svr.rb
+++ b/sample/openssl/echo_svr.rb
@@ -2,14 +2,14 @@
require 'socket'
require 'openssl'
-require 'optparse'
+require 'getopts'
-options = ARGV.getopts("p:c:k:C:")
+getopts nil, "p:2000", "c:", "k:", "C:"
-port = options["p"] || "2000"
-cert_file = options["c"]
-key_file = options["k"]
-ca_path = options["C"]
+port = $OPT_p
+cert_file = $OPT_c
+key_file = $OPT_k
+ca_path = $OPT_C
if cert_file && key_file
cert = OpenSSL::X509::Certificate.new(File::read(cert_file))
@@ -55,11 +55,8 @@ tcps = TCPServer.new(port)
ssls = OpenSSL::SSL::SSLServer.new(tcps, ctx)
loop do
ns = ssls.accept
- puts "connected from #{ns.peeraddr}"
while line = ns.gets
- puts line.inspect
ns.write line
end
- puts "connection closed"
ns.close
end
diff --git a/sample/openssl/gen_csr.rb b/sample/openssl/gen_csr.rb
index 4228707fdb..5858acd9f2 100644
--- a/sample/openssl/gen_csr.rb
+++ b/sample/openssl/gen_csr.rb
@@ -1,6 +1,6 @@
#!/usr/bin/env ruby
-require 'optparse'
+require 'getopts'
require 'openssl'
include OpenSSL
@@ -14,13 +14,14 @@ EOS
exit
end
-options = ARGV.getopts(nil, "key:", "csrout:", "keyout:")
-keypair_file = options["key"]
-csrout = options["csrout"] || "csr.pem"
-keyout = options["keyout"] || "keypair.pem"
+getopts nil, "key:", "csrout:", "keyout:"
+keypair_file = $OPT_key
+csrout = $OPT_csrout || "csr.pem"
+keyout = $OPT_keyout || "keypair.pem"
$stdout.sync = true
name_str = ARGV.shift or usage()
+p name_str
name = X509::Name.parse(name_str)
keypair = nil
@@ -47,5 +48,3 @@ puts "Writing #{csrout}..."
File.open(csrout, "w") do |f|
f << req.to_pem
end
-puts req.to_text
-puts req.to_pem
diff --git a/sample/openssl/smime_read.rb b/sample/openssl/smime_read.rb
index 17394f9b8d..0f08f54f7e 100644
--- a/sample/openssl/smime_read.rb
+++ b/sample/openssl/smime_read.rb
@@ -1,12 +1,12 @@
-require 'optparse'
+require 'getopts'
require 'openssl'
include OpenSSL
-options = ARGV.getopts("c:k:C:")
+getopts nil, "c:", "k:", "C:"
-cert_file = options["c"]
-key_file = options["k"]
-ca_path = options["C"]
+cert_file = $OPT_c
+key_file = $OPT_k
+ca_path = $OPT_C
data = $stdin.read
diff --git a/sample/openssl/smime_write.rb b/sample/openssl/smime_write.rb
index 535b3d6685..ce32cd8146 100644
--- a/sample/openssl/smime_write.rb
+++ b/sample/openssl/smime_write.rb
@@ -1,12 +1,12 @@
require 'openssl'
-require 'optparse'
+require 'getopts'
include OpenSSL
-options = ARGV.getopts("c:k:r:")
+getopts nil, "c:", "k:", "r:"
-cert_file = options["c"]
-key_file = options["k"]
-rcpt_file = options["r"]
+cert_file = $OPT_c
+key_file = $OPT_k
+rcpt_file = $OPT_r
cert = X509::Certificate.new(File::read(cert_file))
key = PKey::RSA.new(File::read(key_file))
diff --git a/sample/openssl/wget.rb b/sample/openssl/wget.rb
index ee637204db..0362ab980d 100644
--- a/sample/openssl/wget.rb
+++ b/sample/openssl/wget.rb
@@ -1,11 +1,11 @@
#!/usr/bin/env ruby
require 'net/https'
-require 'optparse'
+require 'getopts'
-options = ARGV.getopts('C:')
+getopts nil, 'C:'
-cert_store = options["C"]
+ca_path = $OPT_C
uri = URI.parse(ARGV[0])
if proxy = ENV['HTTP_PROXY']
@@ -18,12 +18,11 @@ h = Net::HTTP.new(uri.host, uri.port, prx_host, prx_port)
h.set_debug_output($stderr) if $DEBUG
if uri.scheme == "https"
h.use_ssl = true
- if cert_store
- if File.directory?(cert_store)
- h.ca_path = cert_store
- else
- h.ca_file = cert_store
- end
+ if ca_path
+ h.verify_mode = OpenSSL::SSL::VERIFY_PEER
+ h.ca_path = ca_path
+ else
+ $stderr.puts "!!! WARNING: PEER CERTIFICATE WON'T BE VERIFIED !!!"
end
end
diff --git a/sample/optparse/opttest.rb b/sample/optparse/opttest.rb
index 9247af494f..61b157bce5 100644
--- a/sample/optparse/opttest.rb
+++ b/sample/optparse/opttest.rb
@@ -13,7 +13,7 @@ ARGV.options do
|opts|
opts.banner << " argv..."
- # separator
+ # separater
opts.on_tail
opts.on_tail("common options:")
@@ -23,49 +23,49 @@ ARGV.options do
# mandatory argument
opts.on("-r", "--require=LIBRARY", String,
"require the LIBRARY, before",
- "executing your script") {|lib|@library=lib}
+ "executing your script") {|@library|}
# optional argument
opts.on("-i", "--inplace=[EXTENSION]",
"edit ARGV files in place", # multiline description
- "(make backup if EXTENSION supplied)") {|inplace| @inplace = inplace || ''}
+ "(make backup if EXTENSION supplied)") {|@inplace| @inplace ||= ''}
- opts.on("-N=[NUM]", Integer) {|num|@number=num}
+ opts.on("-N=[NUM]", Integer) {|@number|}
# additional class
- opts.on("-t", "--[no-]time[=TIME]", Time, "it's the time") {|time|@time=time}
+ opts.on("-t", "--[no-]time[=TIME]", Time, "it's the time") {|@time|}
# limit argument syntax
opts.on("-[0-7]", "-F", "--irs=[OCTAL]", OptionParser::OctalInteger,
- "specify record separator", "(\\0, if no argument)") {|irs|@irs=irs}
+ "specify record separator", "(\\0, if no argument)") {|@irs|}
# boolean switch(default true)
@exec = true
- opts.on("-n", "--no-exec[=FLAG]", TrueClass, "not really execute") {|exec|@exec=exec}
+ opts.on("-n", "--no-exec[=FLAG]", TrueClass, "not really execute") {|@exec|}
# array
- opts.on("-a", "--list[=LIST,LIST]", Array, "list") {|list|@list=list}
+ opts.on("-a", "--list[=LIST,LIST]", Array, "list") {|@list|}
# fixed size array
- opts.on("--pair[=car,cdr]", Array, "pair") {|x,y|@x=x; @y=y}
+ opts.on("--pair[=car,cdr]", Array, "pair") {|@x, @y|}
# keyword completion
opts.on("--code=CODE", CODES, CODE_ALIASES, "select coding system",
- "("+CODES.join(",")+",", " "+CODE_ALIASES.keys.join(",")+")") {|c|@code=c}
+ "("+CODES.join(",")+",", " "+CODE_ALIASES.keys.join(",")+")") {|@code|}
# optional argument with keyword completion
- opts.on("--type[=TYPE]", [:text, :binary], "select type(text, binary)") {|t|@type=t}
+ opts.on("--type[=TYPE]", [:text, :binary], "select type(text, binary)") {|@type|}
# boolean switch with optional argument(default false)
- opts.on("-v", "--[no-]verbose=[FLAG]", "run verbosely") {|v|@verbose=v}
+ opts.on("-v", "--[no-]verbose=[FLAG]", "run verbosely") {|@verbose|}
# easy way, set local variable
- opts.on("-q", "--quit", "quit when ARGV is empty") {|q|@quit=q}
+ opts.on("-q", "--quit", "quit when ARGV is empty") {|@quit|}
# adding on the fly
opts.on("--add=SWITCH=[ARG]", "add option on the fly", /\A(\w+)(?:=.+)?\Z/) do
|opt, var|
- opts.on("--#{opt}", "added in runtime", &eval("proc {|x|@#{var}=x}"))
+ opts.on("--#{opt}", "added in runtime", &eval("proc {|@#{var}|}"))
end
opts.on_head("specific options:")
@@ -79,7 +79,7 @@ ARGV.options do
end
pp self
-begin print ARGV.options; exit end if @quit
+(print ARGV.options; exit) if @quit
ARGV.options = nil # no more parse
puts "ARGV = #{ARGV.join(' ')}" if !ARGV.empty?
#opts.variable.each {|sym| puts "#{sym} = #{opts.send(sym).inspect}"}
diff --git a/sample/rdoc/markup/rdoc2latex.rb b/sample/rdoc/markup/rdoc2latex.rb
deleted file mode 100644
index aa8079eb90..0000000000
--- a/sample/rdoc/markup/rdoc2latex.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/usr/local/bin/ruby
-# Illustration of a script to convert an RDoc-style file to a LaTeX document
-
-require 'rdoc/markup'
-require 'rdoc/markup/to_latex'
-
-p = RDoc::Markup.new
-h = RDoc::Markup::ToLaTeX.new
-
-#puts "\\documentclass{report}"
-#puts "\\usepackage{tabularx}"
-#puts "\\usepackage{parskip}"
-#puts "\\begin{document}"
-puts p.convert(ARGF.read, h)
-#puts "\\end{document}"
diff --git a/sample/rdoc/markup/sample.rb b/sample/rdoc/markup/sample.rb
deleted file mode 100644
index db5d88d150..0000000000
--- a/sample/rdoc/markup/sample.rb
+++ /dev/null
@@ -1,40 +0,0 @@
-# This program illustrates the basic use of the SimpleMarkup
-# class. It extracts the first comment block from the
-# simple_markup.rb file and converts it into HTML on
-# standard output. Run it using
-#
-# % ruby sample.rb
-#
-# You should be in the sample/rdoc/markup/ directory when you do this,
-# as it hardwires the path to the files it needs to require.
-# This isn't necessary in the code you write once you've
-# installed the package.
-#
-# For a better way of formatting code comment blocks (and more)
-# see the rdoc package.
-#
-
-require 'rdoc/markup/simple_markup'
-require 'rdoc/markup/simple_markup/to_html'
-
-# Extract the comment block from the source file
-
-input_string = ""
-
-File.foreach("../../../lib/rdoc/markup/simple_markup.rb") do |line|
- break unless line.gsub!(/^\# ?/, '')
- input_string << line
-end
-
-# Create a markup object
-markup = SM::SimpleMarkup.new
-
-# Attach it to an HTML formatter
-h = SM::ToHtml.new
-
-# And convert out comment block to html. Wrap it a body
-# tag pair to let browsers view it
-
-puts "<html><body>"
-puts markup.convert(input_string, h)
-puts "</body></html>"
diff --git a/sample/regx.rb b/sample/regx.rb
new file mode 100644
index 0000000000..6d90b7f293
--- /dev/null
+++ b/sample/regx.rb
@@ -0,0 +1,23 @@
+st = "\033[7m"
+en = "\033[m"
+#st = "<<"
+#en = ">>"
+
+while true
+ print "str> "
+ STDOUT.flush
+ input = gets
+ break if not input
+ if input != ""
+ str = input
+ str.chop!
+ end
+ print "pat> "
+ STDOUT.flush
+ re = gets
+ break if not re
+ re.chop!
+ str.gsub! re, "#{st}\\&#{en}"
+ print str, "\n"
+end
+print "\n"
diff --git a/sample/ripper/ruby2html.rb b/sample/ripper/ruby2html.rb
deleted file mode 100644
index 8f64f5a713..0000000000
--- a/sample/ripper/ruby2html.rb
+++ /dev/null
@@ -1,112 +0,0 @@
-#!/usr/bin/env ruby
-# $originalId: ruby2html.rb,v 1.2 2005/09/23 22:53:47 aamine Exp $
-
-TEMPLATE_LINE = __LINE__ + 2
-TEMPLATE = <<-EndTemplate
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=<%= encoding %>">
-<% if css %>
- <link rel="stylesheet" type="text/css" href="<%= css %>">
-<% end %>
- <title><%= File.basename(f.path) %></title>
-</head>
-<body>
-<pre>
-<%
- if print_line_number
- Ruby2HTML.compile(f).each_with_index do |line, idx|
-%><%= sprintf('%4d %s', idx+1, line) %><%
- end
- else
-%><%= Ruby2HTML.compile(f) %><%
- end
-%>
-</pre>
-</body>
-</html>
-EndTemplate
-
-require 'ripper'
-require 'stringio'
-require 'cgi'
-require 'erb'
-require 'optparse'
-
-def main
- encoding = 'us-ascii'
- css = nil
- print_line_number = false
- parser = OptionParser.new
- parser.banner = "Usage: #{File.basename($0)} [-l] [<file>...]"
- parser.on('--encoding=NAME', 'Character encoding [us-ascii].') {|name|
- encoding = name
- }
- parser.on('--css=URL', 'Set a link to CSS.') {|url|
- css = url
- }
- parser.on('-l', '--line-number', 'Show line number.') {
- print_line_number = true
- }
- parser.on('--help', 'Prints this message and quit.') {
- puts parser.help
- exit 0
- }
- begin
- parser.parse!
- rescue OptionParser::ParseError => err
- $stderr.puts err
- $stderr.puts parser.help
- exit 1
- end
- puts ruby2html(ARGF, encoding, css, print_line_number)
-end
-
-class ERB
- attr_accessor :lineno
-
- remove_method :result
- def result(b)
- eval(@src, b, (@filename || '(erb)'), (@lineno || 1))
- end
-end
-
-def ruby2html(f, encoding, css, print_line_number)
- erb = ERB.new(TEMPLATE, nil, '>')
- erb.filename = __FILE__
- erb.lineno = TEMPLATE_LINE
- erb.result(binding())
-end
-
-class Ruby2HTML < Ripper::Filter
- def Ruby2HTML.compile(f)
- buf = StringIO.new
- Ruby2HTML.new(f).parse(buf)
- buf.string
- end
-
- def on_default(event, tok, f)
- f << CGI.escapeHTML(tok)
- end
-
- def on_kw(tok, f)
- f << %Q[<span class="resword">#{CGI.escapeHTML(tok)}</span>]
- end
-
- def on_comment(tok, f)
- f << %Q[<span class="comment">#{CGI.escapeHTML(tok.rstrip)}</span>\n]
- end
-
- def on_tstring_beg(tok, f)
- f << %Q[<span class="string">#{CGI.escapeHTML(tok)}]
- end
-
- def on_tstring_end(tok, f)
- f << %Q[#{CGI.escapeHTML(tok)}</span>]
- end
-end
-
-if $0 == __FILE__
- main
-end
diff --git a/sample/ripper/strip-comment.rb b/sample/ripper/strip-comment.rb
deleted file mode 100644
index bd26b6a377..0000000000
--- a/sample/ripper/strip-comment.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-# $Id$
-
-require 'ripper/filter'
-
-class CommentStripper < Ripper::Filter
- def CommentStripper.strip(src)
- new(src).parse(nil)
- end
-
- def on_default(event, token, data)
- print token
- end
-
- def on_comment(token, data)
- puts
- end
-end
-
-CommentStripper.strip(ARGF)
diff --git a/sample/rss/list_description.rb b/sample/rss/list_description.rb
index 990974d8f5..d4b98a9ac6 100755
--- a/sample/rss/list_description.rb
+++ b/sample/rss/list_description.rb
@@ -4,7 +4,7 @@ require "nkf"
class String
# From tdiary.rb
def shorten( len = 120 )
- lines = NKF::nkf( "-t -m0 -f#{len}", self.gsub( /\n/, ' ' ) ).split( /\n/ )
+ lines = NKF::nkf( "-e -m0 -f#{len}", self.gsub( /\n/, ' ' ) ).split( /\n/ )
lines[0].concat( '...' ) if lines[0] and lines[1]
lines[0]
end
@@ -52,7 +52,7 @@ ARGV.each do |fname|
puts "#{fname} does not include RSS 1.0 or 0.9x/2.0"
else
begin
- rss.output_encoding = "utf-8"
+ rss.output_encoding = "euc-jp"
rescue RSS::UnknownConversionMethodError
error($!) if verbose
end
diff --git a/sample/rss/rss_recent.rb b/sample/rss/rss_recent.rb
index 14c861284e..38b57c37fa 100755
--- a/sample/rss/rss_recent.rb
+++ b/sample/rss/rss_recent.rb
@@ -4,7 +4,7 @@ require "nkf"
class String
# From tdiary.rb
def shorten( len = 120 )
- lines = NKF::nkf( "-t -m0 -f#{len}", self.gsub( /\n/, ' ' ) ).split( /\n/ )
+ lines = NKF::nkf( "-e -m0 -f#{len}", self.gsub( /\n/, ' ' ) ).split( /\n/ )
lines[0].concat( '...' ) if lines[0] and lines[1]
lines[0]
end
@@ -51,7 +51,7 @@ ARGV.each do |fname|
puts "#{fname} does not include RSS 1.0 or 0.9x/2.0"
else
begin
- rss.output_encoding = "utf-8"
+ rss.output_encoding = "euc-jp"
rescue RSS::UnknownConversionMethodError
error($!) if verbose
end
diff --git a/sample/test.rb b/sample/test.rb
index f3ac9c4a49..eb0791b3de 100644
--- a/sample/test.rb
+++ b/sample/test.rb
@@ -1,12 +1,12 @@
#! /usr/bin/env ruby
-# -*- coding: us-ascii -*-
+$KCODE = "none"
$testnum=0
$ntest=0
$failed = 0
def test_check(what)
- STDERR.print "\nsample/test.rb:#{what} "
+ printf "%s\n", what
$what = what
$testnum = 0
end
@@ -14,17 +14,13 @@ 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
- STDERR.print "."
- printf "ok %d (%s)\n", $testnum, where
+ printf "ok %d\n", $testnum
else
- STDERR.print "F"
+ where = caller(n)[0]
printf "not ok %s %d -- %s\n", $what, $testnum, where
$failed+=1
end
- STDOUT.flush
- STDERR.flush
end
# make sure conditional operators work
@@ -58,13 +54,15 @@ 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 = *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,2])
-a = *[*[]]; test_ok(a == [])
-a = *[*[1]]; test_ok(a == [1])
+a = *[*[]]; test_ok(a == nil)
+a = *[*[1]]; test_ok(a == 1)
a = *[*[1,2]]; test_ok(a == [1,2])
a, = nil; test_ok(a == nil)
@@ -80,6 +78,8 @@ a, = [*[1]]; test_ok(a == 1)
a, = *[1,2]; 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 == nil)
a, = *[1]; test_ok(a == 1)
a, = *[nil]; test_ok(a == nil)
@@ -91,15 +91,17 @@ 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 = *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])
@@ -120,6 +122,8 @@ 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 = *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,[]])
@@ -138,13 +142,13 @@ 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 *nil; end; f {|a| test_ok(a == nil)}
+def f; yield *1; end; f {|a| test_ok(a == 1)}
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)}
@@ -157,10 +161,12 @@ 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 *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 == 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)}
@@ -177,6 +183,8 @@ 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 *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])}
@@ -196,10 +204,12 @@ 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 *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,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,[]])}
@@ -215,40 +225,58 @@ 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 *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 == nil)
+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 == nil)
+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 *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 == nil)
+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 == nil)
+def r; return *[*[]]; end; a = *r(); test_ok(a == nil)
+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 == [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 []; 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 *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 == [nil])
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,2]; end; *a = r(); test_ok(a == [[1,2]])
+def r; return *[*[]]; end; *a = r(); test_ok(a == [nil])
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 *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 == [nil])
+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 == [nil])
+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,b,*c = r(); test_ok([a,b,c] == [nil,nil,[]])
@@ -263,10 +291,12 @@ 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 *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 *[[]]; end; a,b,*c = r(); test_ok([a,b,c] == [nil,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,[]])
@@ -297,64 +327,6 @@ 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]]
@@ -380,37 +352,48 @@ 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 *nil; end; test_ok(a == nil)
+a = loop do break *1; end; test_ok(a == 1)
+a = loop do break *[]; end; test_ok(a == nil)
+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 == nil)
+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 []; 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 *nil; end; test_ok(a == [nil])
+*a = loop do break *1; end; test_ok(a == [1])
+*a = loop do break *[]; end; test_ok(a == [nil])
*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,2]; end; test_ok(a == [[1,2]])
+*a = loop do break *[*[]]; end; test_ok(a == [nil])
*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 *nil; end; test_ok(a == [nil])
+*a = *loop do break *1; end; test_ok(a == [1])
+*a = *loop do break *[]; end; test_ok(a == [nil])
+*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 == [nil])
+*a = *loop do break *[*[1]]; end; test_ok(a == [1])
*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,[]])
@@ -425,10 +408,12 @@ 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 *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 *[[]]; end; test_ok([a,b,c] == [nil,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,[]])
@@ -446,30 +431,39 @@ 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(nil){next *nil}
+r(1){next *1}
+r(nil){next *[]}
+r(1){next *[1]}
+r(nil){next *[nil]}
+r([]){next *[[]]}
+r(nil){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]]}
+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([nil]){next *nil}
+r([1]){next *1}
+r([nil]){next *[]}
+r([1]){next *[1]}
+r([nil]){next *[nil]}
+r([]){next *[[]]}
r([1,2]){next *[1,2]}
+r([nil]){next *[*[]]}
+r([1]){next *[*[1]]}
r([1,2]){next *[*[1,2]]}
def r(val); a,b,*c = yield(); test_ok([a,b,c] == val, 2); end
@@ -486,8 +480,15 @@ 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([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,nil,[]]){next *[[]]}
r([1,2,[]]){next *[1,2]}
+r([nil,nil,[]]){next *[*[]]}
+r([1,nil,[]]){next *[*[1]]}
r([1,2,[]]){next *[*[1,2]]}
test_check "condition"
@@ -584,15 +585,15 @@ 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')
+while tmp.gets()
+ line = $_
+ gsub(/vt100/, 'VT100')
+ if $_ != line
+ $_.gsub!('VT100', 'Vt100')
redo
end
- $bad = 1 if /vt100/ =~ line
- $bad = 1 if /VT100/ =~ line
+ $bad = 1 if /vt100/ =~ $_
+ $bad = 1 if /VT100/ =~ $_
end
test_ok(tmp.eof? && !$bad)
tmp.close
@@ -661,12 +662,10 @@ begin
raise $string
end
test_ok(false)
-rescue => e
- test_ok($! == e)
- test_ok(e.message == $string)
- test_ok(e != $string)
+rescue
+ test_ok(true) if $! == $string
end
-
+
# exception in ensure clause
begin
begin
@@ -814,11 +813,12 @@ test_ok($x == [1,2,3,1,2,3])
test_check "hash"
$x = {1=>2, 2=>4, 3=>6}
+$y = {1, 2, 2, 4, 3, 6}
test_ok($x[1] == 2)
test_ok(begin
- for k,v in $x
+ for k,v in $y
raise if k*2 != v
end
true
@@ -832,19 +832,19 @@ 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(":")
+$z = $y.keys.sort.join(":")
test_ok($z == "1:2:3")
-$z = $x.values.sort.join(":")
+$z = $y.values.sort.join(":")
test_ok($z == "2:4:6")
-test_ok($x == $x)
+test_ok($x == $y)
-$x.shift
-test_ok($x.length == 2)
+$y.shift
+test_ok($y.length == 2)
$z = [1,2]
-$x[$z] = 256
-test_ok($x[$z] == 256)
+$y[$z] = 256
+test_ok($y[$z] == 256)
$x = Hash.new(0)
$x[1] = 1
@@ -909,9 +909,8 @@ def tt
}
end
-i=0
tt{|i| break if i == 5}
-test_ok(i == 0)
+test_ok(i == 5)
def tt2(dummy)
yield 1
@@ -977,6 +976,18 @@ end
test_ok($x.size == 7)
test_ok($x == [1, 2, 3, 4, 5, 6, 7])
+$done = false
+$x = []
+for i in 1 .. 7 # see how retry works in iterator loop
+ if i == 4 and not $done
+ $done = true
+ retry
+ end
+ $x.push(i)
+end
+test_ok($x.size == 10)
+test_ok($x == [1, 2, 3, 1, 2, 3, 4, 5, 6, 7])
+
# append method to built-in class
class Array
def iter_test1
@@ -1014,11 +1025,11 @@ 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([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([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])}
@@ -1031,8 +1042,8 @@ 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]])}
+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
@@ -1045,7 +1056,7 @@ test_ok(m1{p 'test'})
test_ok(!m1)
def m
- m0(block_given?,&Proc.new{})
+ m0(block_given?,&proc{})
end
test_ok(m1{p 'test'})
test_ok(!m1)
@@ -1072,7 +1083,7 @@ end
block_test(NilClass)
block_test(Proc){}
-def call_argument_test(state, proc, *args)
+def argument_test(state, proc, *args)
x = state
begin
proc.call(*args)
@@ -1082,48 +1093,42 @@ def call_argument_test(state, proc, *args)
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)
+argument_test(true, lambda{||})
+argument_test(false, lambda{||}, 1)
+argument_test(true, lambda{|a,|}, 1)
+argument_test(false, lambda{|a,|})
+argument_test(false, lambda{|a,|}, 1,2)
-def block_get(&block)
+def get_block(&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)
+test_ok(Proc == get_block{}.class)
+argument_test(true, get_block{||})
+argument_test(true, get_block{||}, 1)
+argument_test(true, get_block{|a,|}, 1)
+argument_test(true, get_block{|a,|})
+argument_test(true, get_block{|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)
+argument_test(true, get_block(&lambda{||}))
+argument_test(false, get_block(&lambda{||}),1)
+argument_test(true, get_block(&lambda{|a,|}),1)
+argument_test(false, get_block(&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)
+block = get_block{11}
+test_ok(block.class == Proc)
+test_ok(block.to_proc.class == Proc)
+test_ok(block.clone.call == 11)
+test_ok(get_block(&block).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)
+lambda = lambda{44}
+test_ok(lambda.class == Proc)
+test_ok(lambda.to_proc.class == Proc)
+test_ok(lambda.clone.call == 44)
+test_ok(get_block(&lambda).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{|a,| a}.call(1,2,3) == 1)
+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)
@@ -1131,7 +1136,7 @@ test_ok(Proc.new{|a,&b| b.call(a)}.call(12) {|x| x} == 12)
def test_return1
Proc.new {
return 55
- }.yield + 5
+ }.call + 5
end
test_ok(test_return1() == 55)
def test_return2
@@ -1148,23 +1153,15 @@ 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
+test_ok(proc_return1() == 42)
+def proc_return2
proc_yield{return 42}+1
end
-test_ok(proc_return4() == 42)
+test_ok(proc_return2() == 42)
-def ljump_test(state, proc, *args)
+def ljump_test(state, proc, *args)
x = state
begin
proc.call(*args)
@@ -1174,165 +1171,26 @@ def ljump_test(state, proc, *args)
test_ok(x,2)
end
-ljump_test(false, block_get{break})
+ljump_test(false, get_block{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)
+test_ok(block.arity == -1)
+test_ok(lambda.arity == -1)
+test_ok(lambda{||}.arity == 0)
+test_ok(lambda{|a|}.arity == 1)
+test_ok(lambda{|a,|}.arity == 1)
+test_ok(lambda{|a,b|}.arity == 2)
def marity_test(m)
method = method(m)
- test_ok(method.arity == method.to_proc.arity, 2)
+ test_ok(method.arity == method.to_proc.arity)
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)
+lambda(&get_block{|a,n| test_ok(a,n)}).call(true, 2)
class ITER_TEST1
def a
@@ -1364,37 +1222,6 @@ 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)
@@ -1485,6 +1312,7 @@ $good = true;
for i in 4000..4096
n1 = 1 << i;
if (n1**2-1) / (n1+1) != (n1-1)
+ p i
$good = false
end
end
@@ -1556,7 +1384,7 @@ $x = <<END;
ABCD
ABCD
END
-$x.gsub!(/((.|\n)*?)B((.|\n)*?)D/, '\1\3')
+$x.gsub!(/((.|\n)*?)B((.|\n)*?)D/){$1+$3}
test_ok($x == "AC\nAC\n")
test_ok("foobar" =~ /foo(?=(bar)|(baz))/)
@@ -1588,9 +1416,9 @@ 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(?\C-a == 1)
+test_ok(?\M-a == 225)
+test_ok(?\M-\C-a == 129)
test_ok("a".upcase![0] == ?A)
test_ok("A".downcase![0] == ?a)
test_ok("abc".tr!("a-z", "A-Z") == "ABC")
@@ -1602,7 +1430,7 @@ $x = "abcdef"
$y = [ ?a, ?b, ?c, ?d, ?e, ?f ]
$bad = false
$x.each_byte {|i|
- if i.chr != $y.shift
+ if i != $y.shift
$bad = true
break
end
@@ -1691,20 +1519,20 @@ 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}
+$proc = proc{|i| i}
test_ok($proc.call(2) == 2)
test_ok($proc.call(3) == 3)
-$proc = Proc.new{|i| i*2}
+$proc = proc{|i| i*2}
test_ok($proc.call(2) == 4)
test_ok($proc.call(3) == 6)
-Proc.new{
+proc{
iii=5 # nested local variable
- $proc = Proc.new{|i|
+ $proc = proc{|i|
iii = i
}
- $proc2 = Proc.new {
+ $proc2 = proc {
$x = iii # nested variables shared by procs
}
# scope of nested variables
@@ -1733,15 +1561,12 @@ if defined? Process.kill
test_check "signal"
$x = 0
- trap "SIGINT", Proc.new{|sig| $x = 2}
+ trap "SIGINT", proc{|sig| $x = 2}
Process.kill "SIGINT", $$
- 100.times {
- sleep 0.1
- break if $x != 0
- }
+ sleep 0.1
test_ok($x == 2)
- trap "SIGINT", Proc.new{raise "Interrupt"}
+ trap "SIGINT", proc{raise "Interrupt"}
x = false
begin
@@ -1815,53 +1640,51 @@ rescue NameError # must raise error
end
test_ok(!$bad)
-x = binding #! YARV Limitation: Proc.new{}
+x = proc{}
eval "i4 = 1", x
test_ok(eval("i4", x) == 1)
-x = Proc.new{binding}.call #! YARV Limitation: Proc.new{Proc.new{}}.call
+x = proc{proc{}}.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
+x = proc{proc{}}.call
+eval "(0..9).each{|i5| $x[i5] = proc{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
+x = proc{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
+x = proc{binding}.call
+eval "(0..9).each{|i5| $x[i5] = proc{i5*2}}", x
test_ok($x[4].call == 8)
-x = Proc.new{binding}.call
+x = proc{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 {
+proc {
p = binding
eval "foo11 = 1", p
foo22 = 5
- Proc.new{foo11=22}.call
- Proc.new{foo22=55}.call
+ proc{foo11=22}.call
+ proc{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
+}.call
-#! 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)
+p1 = proc{i7 = 0; proc{i7}}.call
+test_ok(p1.call == 0)
eval "i7=5", p1
-#! YARV Limitation: test_ok(p1.call == 5)
+test_ok(p1.call == 5)
test_ok(!defined?(i7))
-if false #! YARV Limitation
-p1 = Proc.new{i7 = 0; Proc.new{i7}}.call
+p1 = proc{i7 = 0; proc{i7}}.call
i7 = nil
test_ok(p1.call == 0)
eval "i7=1", p1
@@ -1869,7 +1692,6 @@ 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")
@@ -1897,7 +1719,7 @@ 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` == 'nil')
test_ok(`./miniruby -x script_tmp -zzz=555` == '555')
tmp = open("script_tmp", "w")
@@ -1906,7 +1728,7 @@ for i in 1..5
end
tmp.close
-`./miniruby -i.bak -pe '$_.sub!(/^[0-9]+$/){$&.to_i * 5}' script_tmp`
+`./miniruby -i.bak -pe 'sub(/^[0-9]+$/){$&.to_i * 5}' script_tmp`
done = true
tmp = open("script_tmp", "r")
while tmp.gets
@@ -1917,33 +1739,29 @@ while tmp.gets
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"`
$bad = false
-if (dir = File.dirname(File.dirname(__FILE__))) == '.'
+if (dir = File.dirname(File.dirname($0))) == '.'
dir = ""
else
dir << "/"
end
def valid_syntax?(code, fname)
- p fname
- code = code.dup.force_encoding("ascii-8bit")
- code.sub!(/\A(?:\xef\xbb\xbf)?(\s*\#.*$)*(\n)?/n) {
- "#$&#{"\n" if $1 && !$2}BEGIN{throw tag, :ok}\n"
+ code = code.sub(/\A(?:\s*\#.*$)*(\n)?/n) {
+ "#$&#{"\n" if $1 && !$2}BEGIN{return true}\n"
}
- code.force_encoding("us-ascii")
- catch {|tag| eval(code, binding, fname, 0)}
+ eval(code, nil, fname, 0)
rescue Exception
- STDERR.puts $!.message
+ puts $!.message
false
end
-for script in Dir["#{dir}{lib,sample,ext,test}/**/*.rb"]
+for script in Dir["#{dir}{lib,sample,ext}/**/*.rb"]
unless valid_syntax? IO::read(script), script
- STDERR.puts script
$bad = true
end
end
@@ -2075,7 +1893,7 @@ $_ = foobar
test_ok($_ == foobar)
class Gods
- @@rule = "Uranus" # private to Gods
+ @@rule = "Uranus"
def ruler0
@@rule
end
@@ -2091,18 +1909,15 @@ class Gods
end
module Olympians
- @@rule ="Zeus"
- def ruler3
+ @@rule ="Zeus"
+ def ruler3
@@rule
end
end
class Titans < Gods
- @@rule = "Cronus" # do not affect @@rule in Gods
- include Olympians
- def ruler4
- @@rule
- end
+ @@rule = "Cronus"
+ include Olympians # OK to cause warning (intentional)
end
test_ok(Gods.new.ruler0 == "Cronus")
@@ -2113,12 +1928,11 @@ 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}
+trace_var :$x, proc{$y = $x}
$x = 40414
test_ok($y == $x)
@@ -2126,7 +1940,7 @@ untrace_var :$x
$x = 19660208
test_ok($y != $x)
-trace_var :$x, Proc.new{$x *= 2}
+trace_var :$x, proc{$x *= 2}
$x = 5
test_ok($x == 10)
@@ -2244,15 +2058,6 @@ 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) {
@@ -2281,14 +2086,8 @@ 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
-
if $failed > 0
- printf "not ok/test: %d failed %d\n", $ntest, $failed
+ printf "test: %d failed %d\n", $ntest, $failed
else
printf "end of test(test: %d)\n", $ntest
end
diff --git a/signal.c b/signal.c
index b1773bc4d5..fb21fd34fe 100644
--- a/signal.c
+++ b/signal.c
@@ -3,36 +3,19 @@
signal.c -
$Author$
+ $Date$
created at: Tue Dec 20 10:13:44 JST 1994
- Copyright (C) 1993-2007 Yukihiro Matsumoto
+ Copyright (C) 1993-2003 Yukihiro Matsumoto
Copyright (C) 2000 Network Applied Communication Laboratory, Inc.
Copyright (C) 2000 Information-technology Promotion Agency, Japan
**********************************************************************/
-#include "ruby/ruby.h"
-#include "vm_core.h"
+#include "ruby.h"
+#include "rubysig.h"
#include <signal.h>
#include <stdio.h>
-#include <errno.h>
-
-#ifdef _WIN32
-typedef LONG rb_atomic_t;
-
-# define ATOMIC_TEST(var) InterlockedExchange(&(var), 0)
-# define ATOMIC_SET(var, val) InterlockedExchange(&(var), (val))
-# define ATOMIC_INC(var) InterlockedIncrement(&(var))
-# define ATOMIC_DEC(var) InterlockedDecrement(&(var))
-
-#else
-typedef int rb_atomic_t;
-
-# define ATOMIC_TEST(var) ((var) ? ((var) = 0, 1) : 0)
-# define ATOMIC_SET(var, val) ((var) = (val))
-# define ATOMIC_INC(var) (++(var))
-# define ATOMIC_DEC(var) (--(var))
-#endif
#ifdef __BEOS__
#undef SIGBUS
@@ -45,10 +28,14 @@ typedef int rb_atomic_t;
#endif
#ifndef NSIG
-# define NSIG (_SIGMAX + 1) /* For QNX */
+# ifdef DJGPP
+# define NSIG SIGMAX
+# else
+# define NSIG (_SIGMAX + 1) /* For QNX */
+# endif
#endif
-static const struct signals {
+static struct signals {
const char *signm;
int signo;
} siglist [] = {
@@ -188,9 +175,10 @@ static const struct signals {
};
static int
-signm2signo(const char *nm)
+signm2signo(nm)
+ const char *nm;
{
- const struct signals *sigs;
+ struct signals *sigs;
for (sigs = siglist; sigs->signm; sigs++)
if (strcmp(sigs->signm, nm) == 0)
@@ -199,9 +187,10 @@ signm2signo(const char *nm)
}
static const char*
-signo2signm(int no)
+signo2signm(no)
+ int no;
{
- const struct signals *sigs;
+ struct signals *sigs;
for (sigs = siglist; sigs->signm; sigs++)
if (sigs->signo == no)
@@ -210,7 +199,8 @@ signo2signm(int no)
}
const char *
-ruby_signal_name(int no)
+ruby_signal_name(no)
+ int no;
{
return signo2signm(no);
}
@@ -224,24 +214,27 @@ ruby_signal_name(int no)
*/
static VALUE
-esignal_init(int argc, VALUE *argv, VALUE self)
+esignal_init(argc, argv, self)
+ int argc;
+ VALUE *argv;
+ VALUE self;
{
int argnum = 1;
VALUE sig = Qnil;
int signo;
const char *signm;
+ char tmpnm[(sizeof(int)*CHAR_BIT)/3+4];
if (argc > 0) {
- sig = rb_check_to_integer(argv[0], "to_int");
- if (!NIL_P(sig)) argnum = 2;
- else sig = argv[0];
+ sig = argv[0];
+ if (FIXNUM_P(sig)) argnum = 2;
}
if (argc < 1 || argnum < argc) {
rb_raise(rb_eArgError, "wrong number of arguments (%d for %d)",
argc, argnum);
}
if (argnum == 2) {
- signo = NUM2INT(sig);
+ signo = FIX2INT(sig);
if (signo < 0 || signo > NSIG) {
rb_raise(rb_eArgError, "invalid signal number (%d)", signo);
}
@@ -251,11 +244,12 @@ esignal_init(int argc, VALUE *argv, VALUE self)
else {
signm = signo2signm(signo);
if (signm) {
- sig = rb_sprintf("SIG%s", signm);
+ snprintf(tmpnm, sizeof(tmpnm), "SIG%s", signm);
}
else {
- sig = rb_sprintf("SIG%u", signo);
+ snprintf(tmpnm, sizeof(tmpnm), "SIG%u", signo);
}
+ sig = rb_str_new2(signm = tmpnm);
}
}
else {
@@ -265,7 +259,9 @@ esignal_init(int argc, VALUE *argv, VALUE self)
if (!signo) {
rb_raise(rb_eArgError, "unsupported name `SIG%s'", signm);
}
- sig = rb_sprintf("SIG%s", signm);
+ if (SYMBOL_P(sig)) {
+ sig = rb_str_new2(signm);
+ }
}
rb_call_super(1, &sig);
rb_iv_set(self, "signo", INT2NUM(signo));
@@ -273,47 +269,43 @@ esignal_init(int argc, VALUE *argv, VALUE self)
return self;
}
-/*
- * call-seq:
- * signal_exception.signo => num
- *
- * Returns a signal number.
- */
-
static VALUE
-esignal_signo(VALUE self)
-{
- return rb_iv_get(self, "signo");
-}
-
-static VALUE
-interrupt_init(int argc, VALUE *argv, VALUE self)
+interrupt_init(argc, argv, self)
+ int argc;
+ VALUE *argv;
+ VALUE self;
{
VALUE args[2];
args[0] = INT2FIX(SIGINT);
rb_scan_args(argc, argv, "01", &args[1]);
+
return rb_call_super(2, args);
}
void
-ruby_default_signal(int sig)
+ruby_default_signal(sig)
+ int sig;
{
+#ifndef MACOS_UNUSE_SIGNAL
+ extern rb_pid_t getpid _((void));
+
signal(sig, SIG_DFL);
- raise(sig);
+ kill(getpid(), sig);
+#endif
}
/*
* call-seq:
* Process.kill(signal, pid, ...) => fixnum
- *
+ *
* Sends the given signal to the specified process id(s), or to the
* current process if _pid_ is zero. _signal_ may be an
* integer signal number or a POSIX signal name (either with or without
* a +SIG+ prefix). If _signal_ is negative (or starts
* with a minus sign), kills process groups instead of
* processes. Not all signals are available on all platforms.
- *
+ *
* pid = fork do
* Signal.trap("HUP") { puts "Ouch!"; exit }
* # ... do some work ...
@@ -321,18 +313,17 @@ ruby_default_signal(int sig)
* # ...
* Process.kill("HUP", pid)
* Process.wait
- *
+ *
* <em>produces:</em>
- *
+ *
* Ouch!
*/
VALUE
-rb_f_kill(int argc, VALUE *argv)
+rb_f_kill(argc, argv)
+ int argc;
+ VALUE *argv;
{
-#ifndef HAS_KILLPG
-#define killpg(pg, sig) kill(-(pg), sig)
-#endif
int negative = 0;
int sig;
int i;
@@ -352,7 +343,7 @@ rb_f_kill(int argc, VALUE *argv)
goto str_signal;
case T_STRING:
- s = RSTRING_PTR(argv[0]);
+ s = RSTRING(argv[0])->ptr;
if (s[0] == '-') {
negative++;
s++;
@@ -373,7 +364,7 @@ rb_f_kill(int argc, VALUE *argv)
str = rb_check_string_type(argv[0]);
if (!NIL_P(str)) {
- s = RSTRING_PTR(str);
+ s = RSTRING(str)->ptr;
goto str_signal;
}
rb_raise(rb_eArgError, "bad signal type %s",
@@ -385,114 +376,113 @@ rb_f_kill(int argc, VALUE *argv)
if (sig < 0) {
sig = -sig;
for (i=1; i<argc; i++) {
- if (killpg(NUM2PIDT(argv[i]), sig) < 0)
+ int pid = NUM2INT(argv[i]);
+#ifdef HAS_KILLPG
+ if (killpg(pid, sig) < 0)
+#else
+ if (kill(-pid, sig) < 0)
+#endif
rb_sys_fail(0);
}
}
else {
for (i=1; i<argc; i++) {
- if (kill(NUM2PIDT(argv[i]), sig) < 0)
+ Check_Type(argv[i], T_FIXNUM);
+ if (kill(FIX2INT(argv[i]), sig) < 0)
rb_sys_fail(0);
}
}
- rb_thread_polling();
return INT2FIX(i-1);
}
static struct {
- rb_atomic_t cnt[RUBY_NSIG];
- rb_atomic_t size;
-} signal_buff;
+ VALUE cmd;
+ int safe;
+} trap_list[NSIG];
+static rb_atomic_t trap_pending_list[NSIG];
+static char rb_trap_accept_nativethreads[NSIG];
+rb_atomic_t rb_trap_pending;
+rb_atomic_t rb_trap_immediate;
+int rb_prohibit_interrupt = 1;
+
+void
+rb_gc_mark_trap_list()
+{
+#ifndef MACOS_UNUSE_SIGNAL
+ int i;
+
+ for (i=0; i<NSIG; i++) {
+ if (trap_list[i].cmd)
+ rb_gc_mark(trap_list[i].cmd);
+ }
+#endif /* MACOS_UNUSE_SIGNAL */
+}
#ifdef __dietlibc__
#define sighandler_t sh_t
#endif
-typedef RETSIGTYPE (*sighandler_t)(int);
-#if defined SA_SIGINFO && !defined __SYMBIAN32__
-typedef void ruby_sigaction_t(int, siginfo_t*, void*);
-#define SIGINFO_ARG , siginfo_t *info, void *ctx
-#else
-typedef RETSIGTYPE ruby_sigaction_t(int);
-#define SIGINFO_ARG
-#endif
+typedef RETSIGTYPE (*sighandler_t)_((int));
#ifdef POSIX_SIGNAL
-#if defined(SIGSEGV) && defined(HAVE_SIGALTSTACK)
-#define USE_SIGALTSTACK
-#endif
-
-#ifdef USE_SIGALTSTACK
-#ifdef SIGSTKSZ
-#define ALT_STACK_SIZE (SIGSTKSZ*2)
-#else
-#define ALT_STACK_SIZE (4*1024)
-#endif
-/* alternate stack for SIGSEGV */
-static void
-register_sigaltstack(void)
-{
- static void *altstack = 0;
- stack_t newSS, oldSS;
-
- if (altstack) return;
-
- newSS.ss_sp = altstack = malloc(ALT_STACK_SIZE);
- if (newSS.ss_sp == NULL)
- /* should handle error */
- rb_bug("register_sigaltstack. malloc error\n");
- newSS.ss_size = ALT_STACK_SIZE;
- newSS.ss_flags = 0;
-
- sigaltstack(&newSS, &oldSS); /* ignore error. */
-}
-#endif
-
static sighandler_t
-ruby_signal(int signum, sighandler_t handler)
+ruby_signal(signum, handler)
+ int signum;
+ sighandler_t handler;
{
struct sigaction sigact, old;
-#if 0
rb_trap_accept_nativethreads[signum] = 0;
-#endif
- sigemptyset(&sigact.sa_mask);
-#ifdef SA_SIGINFO
- sigact.sa_sigaction = (ruby_sigaction_t*)handler;
- sigact.sa_flags = SA_SIGINFO;
-#else
sigact.sa_handler = handler;
+ sigemptyset(&sigact.sa_mask);
sigact.sa_flags = 0;
-#endif
-
-#ifdef SA_NOCLDWAIT
+# ifdef SA_NOCLDWAIT
if (signum == SIGCHLD && handler == SIG_IGN)
sigact.sa_flags |= SA_NOCLDWAIT;
-#endif
-#if defined(SA_ONSTACK) && defined(USE_SIGALTSTACK)
- if (signum == SIGSEGV)
- sigact.sa_flags |= SA_ONSTACK;
-#endif
- if (sigaction(signum, &sigact, &old) < 0) {
- if (errno != 0 && errno != EINVAL) {
- rb_bug("sigaction error.\n");
- }
- }
+# endif
+ sigaction(signum, &sigact, &old);
return old.sa_handler;
}
-sighandler_t
-posix_signal(int signum, sighandler_t handler)
+void
+posix_signal(signum, handler)
+ int signum;
+ sighandler_t handler;
+{
+ ruby_signal(signum, handler);
+}
+
+# ifdef HAVE_NATIVETHREAD
+static sighandler_t
+ruby_nativethread_signal(signum, handler)
+ int signum;
+ sighandler_t handler;
+{
+ sighandler_t old;
+
+ old = ruby_signal(signum, handler);
+ rb_trap_accept_nativethreads[signum] = 1;
+ return old;
+}
+
+void
+posix_nativethread_signal(signum, handler)
+ int signum;
+ sighandler_t handler;
{
- return ruby_signal(signum, handler);
+ ruby_nativethread_signal(signum, handler);
}
+# endif
#else /* !POSIX_SIGNAL */
-#define ruby_signal(sig,handler) (/* rb_trap_accept_nativethreads[sig] = 0,*/ signal((sig),(handler)))
-#if 0 /* def HAVE_NATIVETHREAD */
+#define ruby_signal(sig,handler) (rb_trap_accept_nativethreads[sig] = 0, signal((sig),(handler)))
+
+# ifdef HAVE_NATIVETHREAD
static sighandler_t
-ruby_nativethread_signal(int signum, sighandler_t handler)
+ruby_nativethread_signal(signum, handler)
+ int signum;
+ sighandler_t handler;
{
sighandler_t old;
@@ -500,180 +490,188 @@ ruby_nativethread_signal(int signum, sighandler_t handler)
rb_trap_accept_nativethreads[signum] = 1;
return old;
}
-#endif
-#endif
+# endif
+#endif /* POSIX_SIGNAL */
-static RETSIGTYPE
-sighandler(int sig)
+static void signal_exec _((int sig));
+static void
+signal_exec(sig)
+ int sig;
{
- ATOMIC_INC(signal_buff.cnt[sig]);
- ATOMIC_INC(signal_buff.size);
-#if !defined(BSD_SIGNAL) && !defined(POSIX_SIGNAL)
- ruby_signal(sig, sighandler);
+ if (trap_list[sig].cmd == 0) {
+ switch (sig) {
+ case SIGINT:
+ rb_thread_interrupt();
+ break;
+#ifdef SIGHUP
+ case SIGHUP:
+#endif
+#ifdef SIGQUIT
+ case SIGQUIT:
+#endif
+#ifdef SIGTERM
+ case SIGTERM:
+#endif
+#ifdef SIGALRM
+ case SIGALRM:
+#endif
+#ifdef SIGUSR1
+ case SIGUSR1:
+#endif
+#ifdef SIGUSR2
+ case SIGUSR2:
#endif
+ rb_thread_signal_raise(sig);
+ break;
+ }
+ }
+ else if (trap_list[sig].cmd == Qundef) {
+ rb_thread_signal_exit();
+ }
+ else {
+ rb_thread_trap_eval(trap_list[sig].cmd, sig, trap_list[sig].safe);
+ }
}
-int
-rb_signal_buff_size(void)
+#if defined(HAVE_NATIVETHREAD) && defined(HAVE_NATIVETHREAD_KILL)
+static void
+sigsend_to_ruby_thread(int sig)
{
- return signal_buff.size;
-}
+# ifdef HAVE_SIGPROCMASK
+ sigset_t mask, old_mask;
+# else
+ int mask, old_mask;
+# endif
-#if USE_TRAP_MASK
# ifdef HAVE_SIGPROCMASK
-static sigset_t trap_last_mask;
+ sigfillset(&mask);
+ sigprocmask(SIG_BLOCK, &mask, &old_mask);
# else
-static int trap_last_mask;
+ mask = sigblock(~0);
+ sigsetmask(mask);
# endif
-#endif
-#if HAVE_PTHREAD_H
-#include <pthread.h>
+ ruby_native_thread_kill(sig);
+}
#endif
-void
-rb_disable_interrupt(void)
+static RETSIGTYPE sighandler _((int));
+static RETSIGTYPE
+sighandler(sig)
+ int sig;
{
-#if USE_TRAP_MASK
- sigset_t mask;
- sigfillset(&mask);
- sigdelset(&mask, SIGVTALRM);
- sigdelset(&mask, SIGSEGV);
- pthread_sigmask(SIG_SETMASK, &mask, NULL);
+#ifdef _WIN32
+#define IN_MAIN_CONTEXT(f, a) (rb_w32_main_context(a, f) ? (void)0 : f(a))
+#else
+#define IN_MAIN_CONTEXT(f, a) f(a)
#endif
-}
-void
-rb_enable_interrupt(void)
-{
-#if USE_TRAP_MASK
- sigset_t mask;
- sigemptyset(&mask);
- pthread_sigmask(SIG_SETMASK, &mask, NULL);
+ if (sig >= NSIG) {
+ rb_bug("trap_handler: Bad signal %d", sig);
+ }
+
+#if defined(HAVE_NATIVETHREAD) && defined(HAVE_NATIVETHREAD_KILL)
+ if (!is_ruby_native_thread() && !rb_trap_accept_nativethreads[sig]) {
+ sigsend_to_ruby_thread(sig);
+ return;
+ }
#endif
-}
-int
-rb_get_next_signal(void)
-{
- int i, sig = 0;
-
- for (i=1; i<RUBY_NSIG; i++) {
- if (signal_buff.cnt[i] > 0) {
- rb_disable_interrupt();
- {
- ATOMIC_DEC(signal_buff.cnt[i]);
- ATOMIC_DEC(signal_buff.size);
- }
- rb_enable_interrupt();
- sig = i;
- break;
- }
+#if !defined(BSD_SIGNAL) && !defined(POSIX_SIGNAL)
+ if (rb_trap_accept_nativethreads[sig]) {
+ ruby_nativethread_signal(sig, sighandler);
+ }
+ else {
+ ruby_signal(sig, sighandler);
+ }
+#endif
+
+ if (trap_list[sig].cmd == 0 && ATOMIC_TEST(rb_trap_immediate)) {
+ IN_MAIN_CONTEXT(signal_exec, sig);
+ ATOMIC_SET(rb_trap_immediate, 1);
+ }
+ else {
+ ATOMIC_INC(rb_trap_pending);
+ ATOMIC_INC(trap_pending_list[sig]);
+#ifdef _WIN32
+ rb_w32_interrupted();
+#endif
}
- return sig;
}
#ifdef SIGBUS
+static RETSIGTYPE sigbus _((int));
static RETSIGTYPE
-sigbus(int sig)
+sigbus(sig)
+ int sig;
{
+#if defined(HAVE_NATIVETHREAD) && defined(HAVE_NATIVETHREAD_KILL)
+ if (!is_ruby_native_thread() && !rb_trap_accept_nativethreads[sig]) {
+ sigsend_to_ruby_thread(sig);
+ return;
+ }
+#endif
+
rb_bug("Bus Error");
}
#endif
#ifdef SIGSEGV
-static int segv_received = 0;
+static RETSIGTYPE sigsegv _((int));
static RETSIGTYPE
-sigsegv(int sig SIGINFO_ARG)
+sigsegv(sig)
+ int sig;
{
-#ifdef USE_SIGALTSTACK
- int ruby_stack_overflowed_p(const rb_thread_t *, const void *);
- NORETURN(void ruby_thread_stack_overflow(rb_thread_t *th));
- rb_thread_t *th = GET_THREAD();
- if (ruby_stack_overflowed_p(th, info->si_addr)) {
- ruby_thread_stack_overflow(th);
+#if defined(HAVE_NATIVETHREAD) && defined(HAVE_NATIVETHREAD_KILL)
+ if (!is_ruby_native_thread() && !rb_trap_accept_nativethreads[sig]) {
+ sigsend_to_ruby_thread(sig);
+ return;
}
#endif
- if (segv_received) {
- fprintf(stderr, "SEGV recieved in SEGV handler\n");
- exit(EXIT_FAILURE);
- }
- else {
- extern int ruby_disable_gc_stress;
- segv_received = 1;
- ruby_disable_gc_stress = 1;
- rb_bug("Segmentation fault");
- }
+
+ extern int ruby_gc_stress;
+ ruby_gc_stress = 0;
+ rb_bug("Segmentation fault");
}
#endif
#ifdef SIGPIPE
+static RETSIGTYPE sigpipe _((int));
static RETSIGTYPE
-sigpipe(int sig)
+sigpipe(sig)
+ int sig;
{
/* do nothing */
}
#endif
-static void
-signal_exec(VALUE cmd, int safe, int sig)
-{
- VALUE signum = INT2NUM(sig);
- rb_eval_cmd(cmd, rb_ary_new3(1, signum), safe);
-}
-
void
-rb_trap_exit(void)
+rb_trap_exit()
{
- rb_vm_t *vm = GET_VM();
- VALUE trap_exit = vm->trap_list[0].cmd;
+#ifndef MACOS_UNUSE_SIGNAL
+ if (trap_list[0].cmd) {
+ VALUE trap_exit = trap_list[0].cmd;
- if (trap_exit) {
- vm->trap_list[0].cmd = 0;
- signal_exec(trap_exit, vm->trap_list[0].safe, 0);
+ trap_list[0].cmd = 0;
+ rb_eval_cmd(trap_exit, rb_ary_new3(1, INT2FIX(0)), trap_list[0].safe);
}
+#endif
}
void
-rb_signal_exec(rb_thread_t *th, int sig)
+rb_trap_exec()
{
- rb_vm_t *vm = GET_VM();
- VALUE cmd = vm->trap_list[sig].cmd;
- int safe = vm->trap_list[sig].safe;
+#ifndef MACOS_UNUSE_SIGNAL
+ int i;
- if (cmd == 0) {
- switch (sig) {
- case SIGINT:
- rb_interrupt();
- break;
-#ifdef SIGHUP
- case SIGHUP:
-#endif
-#ifdef SIGQUIT
- case SIGQUIT:
-#endif
-#ifdef SIGTERM
- case SIGTERM:
-#endif
-#ifdef SIGALRM
- case SIGALRM:
-#endif
-#ifdef SIGUSR1
- case SIGUSR1:
-#endif
-#ifdef SIGUSR2
- case SIGUSR2:
-#endif
- rb_threadptr_signal_raise(th, sig);
- break;
+ for (i=0; i<NSIG; i++) {
+ if (trap_pending_list[i]) {
+ trap_pending_list[i] = 0;
+ signal_exec(i);
}
}
- else if (cmd == Qundef) {
- rb_threadptr_signal_exit(th);
- }
- else {
- signal_exec(cmd, safe, sig);
- }
+#endif /* MACOS_UNUSE_SIGNAL */
+ rb_trap_pending = 0;
}
struct trap_arg {
@@ -684,148 +682,82 @@ struct trap_arg {
int mask;
# endif
#endif
- int sig;
- sighandler_t func;
- VALUE cmd;
+ VALUE sig, cmd;
};
-static sighandler_t
-default_handler(int sig)
-{
- sighandler_t func;
- switch (sig) {
- case SIGINT:
-#ifdef SIGHUP
- case SIGHUP:
-#endif
-#ifdef SIGQUIT
- case SIGQUIT:
-#endif
-#ifdef SIGTERM
- case SIGTERM:
-#endif
-#ifdef SIGALRM
- case SIGALRM:
-#endif
-#ifdef SIGUSR1
- case SIGUSR1:
-#endif
-#ifdef SIGUSR2
- case SIGUSR2:
-#endif
- func = sighandler;
- break;
-#ifdef SIGBUS
- case SIGBUS:
- func = sigbus;
- break;
-#endif
-#ifdef SIGSEGV
- case SIGSEGV:
- func = (sighandler_t)sigsegv;
-# ifdef USE_SIGALTSTACK
- register_sigaltstack();
+#if USE_TRAP_MASK
+# ifdef HAVE_SIGPROCMASK
+static sigset_t trap_last_mask;
+# else
+static int trap_last_mask;
# endif
- break;
#endif
-#ifdef SIGPIPE
- case SIGPIPE:
- func = sigpipe;
- break;
-#endif
- default:
- func = SIG_DFL;
- break;
- }
- return func;
+static RETSIGTYPE sigexit _((int));
+static RETSIGTYPE
+sigexit(sig)
+ int sig;
+{
+ rb_thread_signal_exit();
}
-static sighandler_t
-trap_handler(VALUE *cmd, int sig)
+static VALUE
+trap(arg)
+ struct trap_arg *arg;
{
- sighandler_t func = sighandler;
- VALUE command;
+ sighandler_t func, oldfunc;
+ VALUE command, oldcmd;
+ int sig = -1;
+ const char *s;
- if (NIL_P(*cmd)) {
+ func = sighandler;
+ command = arg->cmd;
+ if (NIL_P(command)) {
func = SIG_IGN;
}
- else {
- command = rb_check_string_type(*cmd);
- if (NIL_P(command) && SYMBOL_P(*cmd)) {
- command = rb_id2str(SYM2ID(*cmd));
- if (!command) rb_raise(rb_eArgError, "bad handler");
+ else if (TYPE(command) == T_STRING) {
+ SafeStringValue(command); /* taint check */
+ if (RSTRING(command)->len == 0) {
+ func = SIG_IGN;
+ }
+ else if (RSTRING(command)->len == 7) {
+ if (strncmp(RSTRING(command)->ptr, "SIG_IGN", 7) == 0) {
+ func = SIG_IGN;
+ }
+ else if (strncmp(RSTRING(command)->ptr, "SIG_DFL", 7) == 0) {
+ func = SIG_DFL;
+ }
+ else if (strncmp(RSTRING(command)->ptr, "DEFAULT", 7) == 0) {
+ func = SIG_DFL;
+ }
}
- if (!NIL_P(command)) {
- SafeStringValue(command); /* taint check */
- *cmd = command;
- switch (RSTRING_LEN(command)) {
- case 0:
- goto sig_ign;
- break;
- case 14:
- if (strncmp(RSTRING_PTR(command), "SYSTEM_DEFAULT", 14) == 0) {
- func = SIG_DFL;
- *cmd = 0;
- }
- break;
- case 7:
- if (strncmp(RSTRING_PTR(command), "SIG_IGN", 7) == 0) {
-sig_ign:
- func = SIG_IGN;
- *cmd = 0;
- }
- else if (strncmp(RSTRING_PTR(command), "SIG_DFL", 7) == 0) {
-sig_dfl:
- func = default_handler(sig);
- *cmd = 0;
- }
- else if (strncmp(RSTRING_PTR(command), "DEFAULT", 7) == 0) {
- goto sig_dfl;
- }
- break;
- case 6:
- if (strncmp(RSTRING_PTR(command), "IGNORE", 6) == 0) {
- goto sig_ign;
- }
- break;
- case 4:
- if (strncmp(RSTRING_PTR(command), "EXIT", 4) == 0) {
- *cmd = Qundef;
- }
- break;
+ else if (RSTRING(command)->len == 6) {
+ if (strncmp(RSTRING(command)->ptr, "IGNORE", 6) == 0) {
+ func = SIG_IGN;
}
}
- else {
- rb_proc_t *proc;
- GetProcPtr(*cmd, proc);
+ else if (RSTRING(command)->len == 4) {
+ if (strncmp(RSTRING(command)->ptr, "EXIT", 4) == 0) {
+ func = sigexit;
+ }
}
}
+ if (func == SIG_IGN || func == SIG_DFL) {
+ command = 0;
+ }
- return func;
-}
-
-static int
-trap_signm(VALUE vsig)
-{
- int sig = -1;
- const char *s;
-
- switch (TYPE(vsig)) {
+ switch (TYPE(arg->sig)) {
case T_FIXNUM:
- sig = FIX2INT(vsig);
- if (sig < 0 || sig >= NSIG) {
- rb_raise(rb_eArgError, "invalid signal number (%d)", sig);
- }
+ sig = FIX2INT(arg->sig);
break;
case T_SYMBOL:
- s = rb_id2name(SYM2ID(vsig));
+ s = rb_id2name(SYM2ID(arg->sig));
if (!s) rb_raise(rb_eArgError, "bad signal");
goto str_signal;
- default:
- s = StringValuePtr(vsig);
+ case T_STRING:
+ s = RSTRING(arg->sig)->ptr;
str_signal:
if (strncmp("SIG", s, 3) == 0)
@@ -834,32 +766,65 @@ trap_signm(VALUE vsig)
if (sig == 0 && strcmp(s, "EXIT") != 0)
rb_raise(rb_eArgError, "unsupported signal SIG%s", s);
}
- return sig;
-}
-
-static VALUE
-trap(struct trap_arg *arg)
-{
- sighandler_t oldfunc, func = arg->func;
- VALUE oldcmd, command = arg->cmd;
- int sig = arg->sig;
- rb_vm_t *vm = GET_VM();
+ if (sig < 0 || sig >= NSIG) {
+ rb_raise(rb_eArgError, "invalid signal number (%d)", sig);
+ }
+#if defined(HAVE_SETITIMER)
+ if (sig == SIGVTALRM) {
+ rb_raise(rb_eArgError, "SIGVTALRM reserved for Thread; can't set handler");
+ }
+#endif
+ if (func == SIG_DFL) {
+ switch (sig) {
+ case SIGINT:
+#ifdef SIGHUP
+ case SIGHUP:
+#endif
+#ifdef SIGQUIT
+ case SIGQUIT:
+#endif
+#ifdef SIGTERM
+ case SIGTERM:
+#endif
+#ifdef SIGALRM
+ case SIGALRM:
+#endif
+#ifdef SIGUSR1
+ case SIGUSR1:
+#endif
+#ifdef SIGUSR2
+ case SIGUSR2:
+#endif
+ func = sighandler;
+ break;
+#ifdef SIGBUS
+ case SIGBUS:
+ func = sigbus;
+ break;
+#endif
+#ifdef SIGSEGV
+ case SIGSEGV:
+ func = sigsegv;
+ break;
+#endif
+#ifdef SIGPIPE
+ case SIGPIPE:
+ func = sigpipe;
+ break;
+#endif
+ }
+ }
oldfunc = ruby_signal(sig, func);
- oldcmd = vm->trap_list[sig].cmd;
- switch (oldcmd) {
- case 0:
+ oldcmd = trap_list[sig].cmd;
+ if (!oldcmd) {
if (oldfunc == SIG_IGN) oldcmd = rb_str_new2("IGNORE");
else if (oldfunc == sighandler) oldcmd = rb_str_new2("DEFAULT");
else oldcmd = Qnil;
- break;
- case Qundef:
- oldcmd = rb_str_new2("EXIT");
- break;
}
- vm->trap_list[sig].cmd = command;
- vm->trap_list[sig].safe = rb_safe_level();
+ trap_list[sig].cmd = command;
+ trap_list[sig].safe = ruby_safe_level;
/* enable at least specified signal. */
#if USE_TRAP_MASK
#ifdef HAVE_SIGPROCMASK
@@ -873,7 +838,8 @@ trap(struct trap_arg *arg)
#if USE_TRAP_MASK
static VALUE
-trap_ensure(struct trap_arg *arg)
+trap_ensure(arg)
+ struct trap_arg *arg;
{
/* enable interrupt */
#ifdef HAVE_SIGPROCMASK
@@ -887,7 +853,7 @@ trap_ensure(struct trap_arg *arg)
#endif
void
-rb_trap_restore_mask(void)
+rb_trap_restore_mask()
{
#if USE_TRAP_MASK
# ifdef HAVE_SIGPROCMASK
@@ -900,22 +866,19 @@ rb_trap_restore_mask(void)
/*
* call-seq:
- * Signal.trap( signal, command ) => obj
+ * Signal.trap( signal, proc ) => obj
* Signal.trap( signal ) {| | block } => obj
*
* Specifies the handling of signals. The first parameter is a signal
* name (a string such as ``SIGALRM'', ``SIGUSR1'', and so on) or a
* signal number. The characters ``SIG'' may be omitted from the
* signal name. The command or block specifies code to be run when the
- * signal is raised.
- * If the command is the string ``IGNORE'' or ``SIG_IGN'', the signal
- * will be ignored.
- * If the command is ``DEFAULT'' or ``SIG_DFL'', the Ruby's default handler
- * will be invoked.
- * If the command is ``EXIT'', the script will be terminated by the signal.
- * If the command is ``SYSTEM_DEFAULT'', the operating system's default
- * handler will be invoked.
- * Otherwise, the given command or block will be run.
+ * signal is raised. If the command is the string ``IGNORE'' or
+ * ``SIG_IGN'', the signal will be ignored. If the command is
+ * ``DEFAULT'' or ``SIG_DFL'', the operating system's default handler
+ * will be invoked. If the command is ``EXIT'', the script will be
+ * terminated by the signal. Otherwise, the given command or block
+ * will be run.
* The special signal name ``EXIT'' or signal number zero will be
* invoked just prior to program termination.
* trap returns the previous handler for the given signal.
@@ -930,23 +893,23 @@ rb_trap_restore_mask(void)
* Terminating: 27460
*/
static VALUE
-sig_trap(int argc, VALUE *argv)
+sig_trap(argc, argv)
+ int argc;
+ VALUE *argv;
{
struct trap_arg arg;
rb_secure(2);
- if (argc < 1 || argc > 2) {
+ if (argc == 0 || argc > 2) {
rb_raise(rb_eArgError, "wrong number of arguments -- trap(sig, cmd)/trap(sig){...}");
}
- arg.sig = trap_signm(argv[0]);
+ arg.sig = argv[0];
if (argc == 1) {
arg.cmd = rb_block_proc();
- arg.func = sighandler;
}
- else {
+ else if (argc == 2) {
arg.cmd = argv[1];
- arg.func = trap_handler(&arg.cmd, arg.sig);
}
if (OBJ_TAINTED(arg.cmd)) {
@@ -974,13 +937,13 @@ sig_trap(int argc, VALUE *argv)
* Returns a list of signal names mapped to the corresponding
* underlying signal numbers.
*
- * Signal.list #=> {"EXIT"=>0, "HUP"=>1, "INT"=>2, "QUIT"=>3, "ILL"=>4, "TRAP"=>5, "IOT"=>6, "ABRT"=>6, "FPE"=>8, "KILL"=>9, "BUS"=>7, "SEGV"=>11, "SYS"=>31, "PIPE"=>13, "ALRM"=>14, "TERM"=>15, "URG"=>23, "STOP"=>19, "TSTP"=>20, "CONT"=>18, "CHLD"=>17, "CLD"=>17, "TTIN"=>21, "TTOU"=>22, "IO"=>29, "XCPU"=>24, "XFSZ"=>25, "VTALRM"=>26, "PROF"=>27, "WINCH"=>28, "USR1"=>10, "USR2"=>12, "PWR"=>30, "POLL"=>29}
+ * Signal.list #=> {"ABRT"=>6, "ALRM"=>14, "BUS"=>7, "CHLD"=>17, "CLD"=>17, "CONT"=>18, "FPE"=>8, "HUP"=>1, "ILL"=>4, "INT"=>2, "IO"=>29, "IOT"=>6, "KILL"=>9, "PIPE"=>13, "POLL"=>29, "PROF"=>27, "PWR"=>30, "QUIT"=>3, "SEGV"=>11, "STOP"=>19, "SYS"=>31, "TERM"=>15, "TRAP"=>5, "TSTP"=>20, "TTIN"=>21, "TTOU"=>22, "URG"=>23, "USR1"=>10, "USR2"=>12, "VTALRM"=>26, "WINCH"=>28, "XCPU"=>24, "XFSZ"=>25}
*/
static VALUE
-sig_list(void)
+sig_list()
{
VALUE h = rb_hash_new();
- const struct signals *sigs;
+ struct signals *sigs;
for (sigs = siglist; sigs->signm; sigs++) {
rb_hash_aset(h, rb_str_new2(sigs->signm), INT2FIX(sigs->signo));
@@ -989,7 +952,9 @@ sig_list(void)
}
static void
-install_sighandler(int signum, sighandler_t handler)
+install_sighandler(signum, handler)
+ int signum;
+ sighandler_t handler;
{
sighandler_t old;
@@ -999,9 +964,39 @@ install_sighandler(int signum, sighandler_t handler)
}
}
+#if 0
+/*
+ * If you write a handler which works on any native thread
+ * (even if the thread is NOT a ruby's one), please enable
+ * this function and use it to install the handler, instead
+ * of `install_sighandler()'.
+ */
+#ifdef HAVE_NATIVETHREAD
+static void
+install_nativethread_sighandler(signum, handler)
+ int signum;
+ sighandler_t handler;
+{
+ sighandler_t old;
+ int old_st;
+
+ old_st = rb_trap_accept_nativethreads[signum];
+ old = ruby_nativethread_signal(signum, handler);
+ if (old != SIG_DFL) {
+ if (old_st) {
+ ruby_nativethread_signal(signum, old);
+ } else {
+ ruby_signal(signum, old);
+ }
+ }
+}
+#endif
+#endif
+
#if defined(SIGCLD) || defined(SIGCHLD)
static void
-init_sigchld(int sig)
+init_sigchld(sig)
+ int sig;
{
sighandler_t oldfunc;
#if USE_TRAP_MASK
@@ -1026,7 +1021,7 @@ init_sigchld(int sig)
if (oldfunc != SIG_DFL && oldfunc != SIG_IGN) {
ruby_signal(sig, oldfunc);
} else {
- GET_VM()->trap_list[sig].cmd = 0;
+ trap_list[sig].cmd = 0;
}
#if USE_TRAP_MASK
@@ -1042,22 +1037,6 @@ init_sigchld(int sig)
}
#endif
-void
-ruby_sig_finalize(void)
-{
- sighandler_t oldfunc;
-
- oldfunc = ruby_signal(SIGINT, SIG_IGN);
- if (oldfunc == sighandler) {
- ruby_signal(SIGINT, SIG_DFL);
- }
-}
-
-
-#ifdef RUBY_DEBUG_ENV
-int ruby_enable_coredump = 0;
-#endif
-
/*
* Many operating systems allow signals to be sent to running
* processes. Some signals have a defined effect on the process, while
@@ -1096,8 +1075,9 @@ int ruby_enable_coredump = 0;
* systems; in particular signal delivery may not always be reliable.
*/
void
-Init_signal(void)
+Init_signal()
{
+#ifndef MACOS_UNUSE_SIGNAL
VALUE mSignal = rb_define_module("Signal");
rb_define_global_function("trap", sig_trap, -1);
@@ -1105,7 +1085,7 @@ Init_signal(void)
rb_define_module_function(mSignal, "list", sig_list, 0);
rb_define_method(rb_eSignal, "initialize", esignal_init, -1);
- rb_define_method(rb_eSignal, "signo", esignal_signo, 0);
+ rb_attr(rb_eSignal, rb_intern("signo"), 1, 0, 0);
rb_alias(rb_eSignal, rb_intern("signm"), rb_intern("message"));
rb_define_method(rb_eInterrupt, "initialize", interrupt_init, -1);
@@ -1129,20 +1109,12 @@ Init_signal(void)
install_sighandler(SIGUSR2, sighandler);
#endif
-#ifdef RUBY_DEBUG_ENV
- if (!ruby_enable_coredump)
-#endif
- {
#ifdef SIGBUS
install_sighandler(SIGBUS, sigbus);
#endif
#ifdef SIGSEGV
-# ifdef USE_SIGALTSTACK
- register_sigaltstack();
-# endif
- install_sighandler(SIGSEGV, (sighandler_t)sigsegv);
+ install_sighandler(SIGSEGV, sigsegv);
#endif
- }
#ifdef SIGPIPE
install_sighandler(SIGPIPE, sigpipe);
#endif
@@ -1152,4 +1124,6 @@ Init_signal(void)
#elif defined(SIGCHLD)
init_sigchld(SIGCHLD);
#endif
+
+#endif /* MACOS_UNUSE_SIGNAL */
}
diff --git a/spec/README b/spec/README
deleted file mode 100644
index 3ba87445e9..0000000000
--- a/spec/README
+++ /dev/null
@@ -1,30 +0,0 @@
-= RubySpec
-
-RubySpec (http://rubyspec.org) provides the Ruby langauge specification in an
-executable format. The make task `update-rubyspec' retrieves the specification
-and put it into this directory.
-
-== Directory structure
- spec
- +-- mspec driver library for executing the specification.
- +-- rubyspec
- +-- core specification for core libraries
- | +-- array
- | +-- bignum
- | +-- ...
- |
- +-- fixtures example classes for writing specs
- +-- language specification for Ruby language itself
- +-- library specification for standard libraries
- +-- addrev
- +-- ...
-
-== How to run
-:make target
- verifies all specs.
- $ make test-rubyspec
-:mspec command
- verifies the specified spec.
- $ mspec {language|core|language}
- or
- $ mspec spec/path/to/some_spec.rb
diff --git a/spec/default.mspec b/spec/default.mspec
deleted file mode 100644
index 1d99004171..0000000000
--- a/spec/default.mspec
+++ /dev/null
@@ -1,22 +0,0 @@
-load File.dirname(__FILE__) + '/rubyspec/ruby.1.9.mspec'
-class MSpecScript
- builddir = Dir.pwd
- srcdir = ENV['SRCDIR']
- if !srcdir and File.exist?("#{builddir}/Makefile") then
- File.open("#{builddir}/Makefile", "r:US-ASCII") {|f|
- f.read[/^\s*srcdir\s*=\s*(.+)/i] and srcdir = $1
- }
- end
- config = proc{|name| `#{builddir}/miniruby -I#{srcdir} -rrbconfig -e 'print RbConfig::CONFIG["#{name}"]'`}
-
- # The default implementation to run the specs.
- set :target, File.join(builddir, "miniruby#{config['exeext']}")
- set :prefix, File.expand_path('rubyspec', File.dirname(__FILE__))
- set :flags, %W[
- -I#{srcdir}/lib
- -I#{srcdir}/#{config['EXTOUT']}/common
- -I#{srcdir}/-
- -r#{srcdir}/ext/purelib.rb
- #{srcdir}/tool/runruby.rb --extout=#{config['EXTOUT']}
- ]
-end
diff --git a/sprintf.c b/sprintf.c
index 6cb024fdd2..d39352b922 100644
--- a/sprintf.c
+++ b/sprintf.c
@@ -3,35 +3,33 @@
sprintf.c -
$Author$
+ $Date$
created at: Fri Oct 15 10:39:26 JST 1993
- Copyright (C) 1993-2007 Yukihiro Matsumoto
+ Copyright (C) 1993-2003 Yukihiro Matsumoto
Copyright (C) 2000 Network Applied Communication Laboratory, Inc.
Copyright (C) 2000 Information-technology Promotion Agency, Japan
**********************************************************************/
-#include "ruby/ruby.h"
-#include "ruby/re.h"
-#include "ruby/encoding.h"
+#include "ruby.h"
+#include "re.h"
+#include <ctype.h>
#include <math.h>
-#include <stdarg.h>
-
-#ifdef HAVE_IEEEFP_H
-#include <ieeefp.h>
-#endif
#define BIT_DIGITS(N) (((N)*146)/485 + 1) /* log2(10) =~ 146/485 */
#define BITSPERDIG (SIZEOF_BDIGITS*CHAR_BIT)
#define EXTENDSIGN(n, l) (((~0 << (n)) >> (((n)*(l)) % BITSPERDIG)) & ~(~0 << (n)))
-static void fmt_setup(char*,size_t,int,int,int,int);
+static void fmt_setup _((char*,int,int,int,int));
static char*
-remove_sign_bits(char *str, int base)
+remove_sign_bits(str, base)
+ char *str;
+ int base;
{
char *s, *t;
-
+
s = t = str;
if (base == 16) {
@@ -50,12 +48,18 @@ remove_sign_bits(char *str, int base)
t++;
}
}
+ if (t > s) {
+ while (*t) *s++ = *t++;
+ *s = '\0';
+ }
- return t;
+ return str;
}
static char
-sign_bits(int base, const char *p)
+sign_bits(base, p)
+ int base;
+ const char *p;
{
char c = '.';
@@ -83,13 +87,11 @@ sign_bits(int base, const char *p)
#define FPREC0 128
#define CHECK(l) do {\
- int cr = ENC_CODERANGE(result);\
while (blen + (l) >= bsiz) {\
bsiz*=2;\
}\
rb_str_resize(result, bsiz);\
- ENC_CODERANGE_SET(result, cr);\
- buf = RSTRING_PTR(result);\
+ buf = RSTRING(result)->ptr;\
} while (0)
#define PUSH(s, l) do { \
@@ -98,38 +100,21 @@ sign_bits(int base, const char *p)
blen += (l);\
} while (0)
-#define FILL(c, l) do { \
- CHECK(l);\
- memset(&buf[blen], c, l);\
- blen += (l);\
-} while (0)
-
#define GETARG() (nextvalue != Qundef ? nextvalue : \
- posarg == -1 ? \
+ posarg < 0 ? \
(rb_raise(rb_eArgError, "unnumbered(%d) mixed with numbered", nextarg), 0) : \
- posarg == -2 ? \
- (rb_raise(rb_eArgError, "unnumbered(%d) mixed with named", nextarg), 0) : \
(posarg = nextarg++, GETNTHARG(posarg)))
#define GETPOSARG(n) (posarg > 0 ? \
(rb_raise(rb_eArgError, "numbered(%d) after unnumbered(%d)", n, posarg), 0) : \
- posarg == -2 ? \
- (rb_raise(rb_eArgError, "numbered(%d) after named", n), 0) : \
((n < 1) ? (rb_raise(rb_eArgError, "invalid index - %d$", n), 0) : \
(posarg = -1, GETNTHARG(n))))
#define GETNTHARG(nth) \
((nth >= argc) ? (rb_raise(rb_eArgError, "too few arguments"), 0) : argv[nth])
-#define GETNAMEARG(id, name, len) ( \
- posarg > 0 ? \
- (rb_raise(rb_eArgError, "named%.*s after unnumbered(%d)", (len), (name), posarg), 0) : \
- posarg == -1 ? \
- (rb_raise(rb_eArgError, "named%.*s after numbered", (len), (name)), 0) : \
- (posarg = -2, rb_hash_lookup2(get_hash(&hash, argc, argv), id, Qundef)))
-
#define GETNUM(n, val) \
- for (; p < end && rb_enc_isdigit(*p, enc); p++) { \
+ for (; p < end && ISDIGIT(*p); p++) { \
int next_n = 10 * n + (*p - '0'); \
if (next_n / 10 != n) {\
rb_raise(rb_eArgError, #val " too big"); \
@@ -154,260 +139,101 @@ sign_bits(int base, const char *p)
val = NUM2INT(tmp); \
} while (0)
-static VALUE
-get_hash(volatile VALUE *hash, int argc, const VALUE *argv)
-{
- VALUE tmp;
-
- if (*hash != Qundef) return *hash;
- if (argc != 2) {
- rb_raise(rb_eArgError, "one hash required");
- }
- tmp = rb_check_convert_type(argv[1], T_HASH, "Hash", "to_hash");
- if (NIL_P(tmp)) {
- rb_raise(rb_eArgError, "one hash required");
- }
- return (*hash = tmp);
-}
/*
* call-seq:
* format(format_string [, arguments...] ) => string
* sprintf(format_string [, arguments...] ) => string
- *
+ *
* Returns the string resulting from applying <i>format_string</i> to
- * any additional arguments. Within the format string, any characters
- * other than format sequences are copied to the result.
- *
- * The syntax of a format sequence is follows.
- *
- * %[flags][width][.precision]type
- *
- * A format
+ * any additional arguments. Within the format string, any characters
+ * other than format sequences are copied to the result. A format
* sequence consists of a percent sign, followed by optional flags,
* width, and precision indicators, then terminated with a field type
- * character. The field type controls how the corresponding
+ * character. The field type controls how the corresponding
* <code>sprintf</code> argument is to be interpreted, while the flags
- * modify that interpretation.
+ * modify that interpretation. The field type characters are listed
+ * in the table at the end of this section. The flag characters are:
+ *
+ * Flag | Applies to | Meaning
+ * ---------+--------------+-----------------------------------------
+ * space | bdeEfgGiouxX | Leave a space at the start of
+ * | | positive numbers.
+ * ---------+--------------+-----------------------------------------
+ * (digit)$ | all | Specifies the absolute argument number
+ * | | for this field. Absolute and relative
+ * | | argument numbers cannot be mixed in a
+ * | | sprintf string.
+ * ---------+--------------+-----------------------------------------
+ * # | beEfgGoxX | Use an alternative format. For the
+ * | | conversions `o', `x', `X', and `b',
+ * | | prefix the result with ``0'', ``0x'', ``0X'',
+ * | | and ``0b'', respectively. For `e',
+ * | | `E', `f', `g', and 'G', force a decimal
+ * | | point to be added, even if no digits follow.
+ * | | For `g' and 'G', do not remove trailing zeros.
+ * ---------+--------------+-----------------------------------------
+ * + | bdeEfgGiouxX | Add a leading plus sign to positive numbers.
+ * ---------+--------------+-----------------------------------------
+ * - | all | Left-justify the result of this conversion.
+ * ---------+--------------+-----------------------------------------
+ * 0 (zero) | bdeEfgGiouxX | Pad with zeros, not spaces.
+ * ---------+--------------+-----------------------------------------
+ * * | all | Use the next argument as the field width.
+ * | | If negative, left-justify the result. If the
+ * | | asterisk is followed by a number and a dollar
+ * | | sign, use the indicated argument as the width.
+ *
+ *
+ * The field width is an optional integer, followed optionally by a
+ * period and a precision. The width specifies the minimum number of
+ * characters that will be written to the result for this field. For
+ * numeric fields, the precision controls the number of decimal places
+ * displayed. For string fields, the precision determines the maximum
+ * number of characters to be copied from the string. (Thus, the format
+ * sequence <code>%10.10s</code> will always contribute exactly ten
+ * characters to the result.)
*
- * The field type characters are:
+ * The field types are:
*
- * Field | Integer Format
+ * Field | Conversion
* ------+--------------------------------------------------------------
* b | Convert argument as a binary number.
- * | Negative numbers will be displayed as a two's complement
- * | prefixed with `..1'.
- * B | Equivalent to `b', but uses an uppercase 0B for prefix
- * | in the alternative format by #.
+ * c | Argument is the numeric code for a single character.
* d | Convert argument as a decimal number.
- * i | Identical to `d'.
- * o | Convert argument as an octal number.
- * | Negative numbers will be displayed as a two's complement
- * | prefixed with `..7'.
- * u | Identical to `d'.
- * x | Convert argument as a hexadecimal number.
- * | Negative numbers will be displayed as a two's complement
- * | prefixed with `..f' (representing an infinite string of
- * | leading 'ff's).
- * X | Equivalent to `x', but uses uppercase letters.
- *
- * Field | Float Format
- * ------+--------------------------------------------------------------
- * e | Convert floating point argument into exponential notation
- * | with one digit before the decimal point as [-]d.dddddde[+-]dd.
- * | The precision specifies the number of digits after the decimal
- * | point (defaulting to six).
* E | Equivalent to `e', but uses an uppercase E to indicate
* | the exponent.
- * f | Convert floating point argument as [-]ddd.dddddd,
- * | where the precision specifies the number of digits after
+ * e | Convert floating point argument into exponential notation
+ * | with one digit before the decimal point. The precision
+ * | determines the number of fractional digits (defaulting to six).
+ * f | Convert floating point argument as [-]ddd.ddd,
+ * | where the precision determines the number of digits after
* | the decimal point.
+ * G | Equivalent to `g', but use an uppercase `E' in exponent form.
* g | Convert a floating point number using exponential form
* | if the exponent is less than -4 or greater than or
- * | equal to the precision, or in dd.dddd form otherwise.
- * | The precision specifies the number of significant digits.
- * G | Equivalent to `g', but use an uppercase `E' in exponent form.
- *
- * Field | Other Format
- * ------+--------------------------------------------------------------
- * c | Argument is the numeric code for a single character or
- * | a single character string itself.
+ * | equal to the precision, or in d.dddd form otherwise.
+ * i | Identical to `d'.
+ * o | Convert argument as an octal number.
* p | The valuing of argument.inspect.
- * s | Argument is a string to be substituted. If the format
+ * s | Argument is a string to be substituted. If the format
* | sequence contains a precision, at most that many characters
* | will be copied.
- * % | A percent sign itself will be displayed. No argument taken.
- *
- * The flags modifies the behavior of the formats.
- * The flag characters are:
- *
- * Flag | Applies to | Meaning
- * ---------+---------------+-----------------------------------------
- * space | bBdiouxX | Leave a space at the start of
- * | eEfgG | non-negative numbers.
- * | (numeric fmt) | For `o', `x', `X', `b' and `B', use
- * | | a minus sign with absolute value for
- * | | negative values.
- * ---------+---------------+-----------------------------------------
- * (digit)$ | all | Specifies the absolute argument number
- * | | for this field. Absolute and relative
- * | | argument numbers cannot be mixed in a
- * | | sprintf string.
- * ---------+---------------+-----------------------------------------
- * # | bBoxX | Use an alternative format.
- * | eEfgG | For the conversions `o', increase the precision
- * | | until the first digit will be `0' if
- * | | it is not formatted as complements.
- * | | For the conversions `x', `X', `b' and `B'
- * | | on non-zero, prefix the result with ``0x'',
- * | | ``0X'', ``0b'' and ``0B'', respectively.
- * | | For `e', `E', `f', `g', and 'G',
- * | | force a decimal point to be added,
- * | | even if no digits follow.
- * | | For `g' and 'G', do not remove trailing zeros.
- * ---------+---------------+-----------------------------------------
- * + | bBdiouxX | Add a leading plus sign to non-negative
- * | eEfgG | numbers.
- * | (numeric fmt) | For `o', `x', `X', `b' and `B', use
- * | | a minus sign with absolute value for
- * | | negative values.
- * ---------+---------------+-----------------------------------------
- * - | all | Left-justify the result of this conversion.
- * ---------+---------------+-----------------------------------------
- * 0 (zero) | bBdiouxX | Pad with zeros, not spaces.
- * | eEfgG | For `o', `x', `X', `b' and `B', radix-1
- * | (numeric fmt) | is used for negative numbers formatted as
- * | | complements.
- * ---------+---------------+-----------------------------------------
- * * | all | Use the next argument as the field width.
- * | | If negative, left-justify the result. If the
- * | | asterisk is followed by a number and a dollar
- * | | sign, use the indicated argument as the width.
- *
- * Examples of flags:
- *
- * # `+' and space flag specifies the sign of non-negative numbers.
- * sprintf("%d", 123) #=> "123"
- * sprintf("%+d", 123) #=> "+123"
- * sprintf("% d", 123) #=> " 123"
- *
- * # `#' flag for `o' increases number of digits to show `0'.
- * # `+' and space flag changes format of negative numbers.
- * sprintf("%o", 123) #=> "173"
- * sprintf("%#o", 123) #=> "0173"
- * sprintf("%+o", -123) #=> "-173"
- * sprintf("%o", -123) #=> "..7605"
- * sprintf("%#o", -123) #=> "..7605"
- *
- * # `#' flag for `x' add a prefix `0x' for non-zero numbers.
- * # `+' and space flag disables complements for negative numbers.
- * sprintf("%x", 123) #=> "7b"
- * sprintf("%#x", 123) #=> "0x7b"
- * sprintf("%+x", -123) #=> "-7b"
- * sprintf("%x", -123) #=> "..f85"
- * sprintf("%#x", -123) #=> "0x..f85"
- * sprintf("%#x", 0) #=> "0"
- *
- * # `#' for `X' uses the prefix `0X'.
- * sprintf("%X", 123) #=> "7B"
- * sprintf("%#X", 123) #=> "0X7B"
- *
- * # `#' flag for `b' add a prefix `0b' for non-zero numbers.
- * # `+' and space flag disables complements for negative numbers.
- * sprintf("%b", 123) #=> "1111011"
- * sprintf("%#b", 123) #=> "0b1111011"
- * sprintf("%+b", -123) #=> "-1111011"
- * sprintf("%b", -123) #=> "..10000101"
- * sprintf("%#b", -123) #=> "0b..10000101"
- * sprintf("%#b", 0) #=> "0"
- *
- * # `#' for `B' uses the prefix `0B'.
- * sprintf("%B", 123) #=> "1111011"
- * sprintf("%#B", 123) #=> "0B1111011"
- *
- * # `#' for `e' forces to show the decimal point.
- * sprintf("%.0e", 1) #=> "1e+00"
- * sprintf("%#.0e", 1) #=> "1.e+00"
- *
- * # `#' for `f' forces to show the decimal point.
- * sprintf("%.0f", 1234) #=> "1234"
- * sprintf("%#.0f", 1234) #=> "1234."
- *
- * # `#' for `g' forces to show the decimal point.
- * # It also disables stripping lowest zeros.
- * sprintf("%g", 123.4) #=> "123.4"
- * sprintf("%#g", 123.4) #=> "123.400"
- * sprintf("%g", 123456) #=> "123456"
- * sprintf("%#g", 123456) #=> "123456."
- *
- * The field width is an optional integer, followed optionally by a
- * period and a precision. The width specifies the minimum number of
- * characters that will be written to the result for this field.
- *
- * Examples of width:
- *
- * # padding is done by spaces, width=20
- * # 0 or radix-1. <------------------>
- * sprintf("%20d", 123) #=> " 123"
- * sprintf("%+20d", 123) #=> " +123"
- * sprintf("%020d", 123) #=> "00000000000000000123"
- * sprintf("%+020d", 123) #=> "+0000000000000000123"
- * sprintf("% 020d", 123) #=> " 0000000000000000123"
- * sprintf("%-20d", 123) #=> "123 "
- * sprintf("%-+20d", 123) #=> "+123 "
- * sprintf("%- 20d", 123) #=> " 123 "
- * sprintf("%020x", -123) #=> "..ffffffffffffffff85"
- *
- * For
- * numeric fields, the precision controls the number of decimal places
- * displayed. For string fields, the precision determines the maximum
- * number of characters to be copied from the string. (Thus, the format
- * sequence <code>%10.10s</code> will always contribute exactly ten
- * characters to the result.)
- *
- * Examples of precisions:
- *
- * # precision for `d', 'o', 'x' and 'b' is
- * # minimum number of digits <------>
- * sprintf("%20.8d", 123) #=> " 00000123"
- * sprintf("%20.8o", 123) #=> " 00000173"
- * sprintf("%20.8x", 123) #=> " 0000007b"
- * sprintf("%20.8b", 123) #=> " 01111011"
- * sprintf("%20.8d", -123) #=> " -00000123"
- * sprintf("%20.8o", -123) #=> " ..777605"
- * sprintf("%20.8x", -123) #=> " ..ffff85"
- * sprintf("%20.8b", -11) #=> " ..110101"
- *
- * # "0x" and "0b" for `#x' and `#b' is not counted for
- * # precision but "0" for `#o' is counted. <------>
- * sprintf("%#20.8d", 123) #=> " 00000123"
- * sprintf("%#20.8o", 123) #=> " 00000173"
- * sprintf("%#20.8x", 123) #=> " 0x0000007b"
- * sprintf("%#20.8b", 123) #=> " 0b01111011"
- * sprintf("%#20.8d", -123) #=> " -00000123"
- * sprintf("%#20.8o", -123) #=> " ..777605"
- * sprintf("%#20.8x", -123) #=> " 0x..ffff85"
- * sprintf("%#20.8b", -11) #=> " 0b..110101"
- *
- * # precision for `e' is number of
- * # digits after the decimal point <------>
- * sprintf("%20.8e", 1234.56789) #=> " 1.23456789e+03"
- *
- * # precision for `f' is number of
- * # digits after the decimal point <------>
- * sprintf("%20.8f", 1234.56789) #=> " 1234.56789000"
- *
- * # precision for `g' is number of
- * # significant digits <------->
- * sprintf("%20.8g", 1234.56789) #=> " 1234.5679"
- *
- * # <------->
- * sprintf("%20.8g", 123456789) #=> " 1.2345679e+08"
- *
- * # precision for `s' is
- * # maximum number of characters <------>
- * sprintf("%20.8s", "string test") #=> " string t"
- *
+ * u | Treat argument as an unsigned decimal number. Negative integers
+ * | are displayed as a 32 bit two's complement plus one for the
+ * | underlying architecture; that is, 2 ** 32 + n. However, since
+ * | Ruby has no inherent limit on bits used to represent the
+ * | integer, this value is preceded by two dots (..) in order to
+ * | indicate a infinite number of leading sign bits.
+ * X | Convert argument as a hexadecimal number using uppercase
+ * | letters. Negative numbers will be displayed with two
+ * | leading periods (representing an infinite string of
+ * | leading 'FF's.
+ * x | Convert argument as a hexadecimal number.
+ * | Negative numbers will be displayed with two
+ * | leading periods (representing an infinite string of
+ * | leading 'ff's.
+ *
* Examples:
*
* sprintf("%d %04x", 123, 123) #=> "123 007b"
@@ -415,26 +241,28 @@ get_hash(volatile VALUE *hash, int argc, const VALUE *argv)
* sprintf("%1$*2$s %2$d %1$s", "hello", 8) #=> " hello 8 hello"
* sprintf("%1$*2$s %2$d", "hello", -8) #=> "hello -8"
* sprintf("%+g:% g:%-g", 1.23, 1.23, 1.23) #=> "+1.23: 1.23:1.23"
- * sprintf("%u", -123) #=> "-123"
+ * sprintf("%u", -123) #=> "..4294967173"
*/
VALUE
-rb_f_sprintf(int argc, const VALUE *argv)
+rb_f_sprintf(argc, argv)
+ int argc;
+ VALUE *argv;
{
return rb_str_format(argc - 1, argv + 1, GETNTHARG(0));
}
VALUE
-rb_str_format(int argc, const VALUE *argv, VALUE fmt)
+rb_str_format(argc, argv, fmt)
+ int argc;
+ VALUE *argv;
+ VALUE fmt;
{
- rb_encoding *enc;
const char *p, *end;
char *buf;
int blen, bsiz;
VALUE result;
- long scanned = 0;
- int coderange = ENC_CODERANGE_7BIT;
int width, prec, flags = FNONE;
int nextarg = 1;
int posarg = 0;
@@ -442,7 +270,6 @@ rb_str_format(int argc, const VALUE *argv, VALUE fmt)
VALUE nextvalue;
VALUE tmp;
VALUE str;
- volatile VALUE hash = Qundef;
#define CHECK_FOR_WIDTH(f) \
if ((f) & FWIDTH) { \
@@ -463,22 +290,17 @@ rb_str_format(int argc, const VALUE *argv, VALUE fmt)
--argv;
if (OBJ_TAINTED(fmt)) tainted = 1;
StringValue(fmt);
- enc = rb_enc_get(fmt);
fmt = rb_str_new4(fmt);
- p = RSTRING_PTR(fmt);
- end = p + RSTRING_LEN(fmt);
+ p = RSTRING(fmt)->ptr;
+ end = p + RSTRING(fmt)->len;
blen = 0;
bsiz = 120;
result = rb_str_buf_new(bsiz);
- rb_enc_copy(result, fmt);
- buf = RSTRING_PTR(result);
- memset(buf, 0, bsiz);
- ENC_CODERANGE_SET(result, coderange);
+ buf = RSTRING(result)->ptr;
for (; p < end; p++) {
const char *t;
int n;
- ID id = 0;
for (t = p; t < end && *t != '%'; t++) ;
PUSH(p, t - p);
@@ -493,7 +315,7 @@ rb_str_format(int argc, const VALUE *argv, VALUE fmt)
retry:
switch (*p) {
default:
- if (rb_enc_isprint(*p, enc))
+ if (ISPRINT(*p))
rb_raise(rb_eArgError, "malformed format string - %%%c", *p);
else
rb_raise(rb_eArgError, "malformed format string");
@@ -546,32 +368,6 @@ rb_str_format(int argc, const VALUE *argv, VALUE fmt)
flags |= FWIDTH;
goto retry;
- case '<':
- case '{':
- {
- const char *start = p;
- char term = (*p == '<') ? '>' : '}';
-
- for (; p < end && *p != term; ) {
- p += rb_enc_mbclen(p, end, enc);
- }
- if (p >= end) {
- rb_raise(rb_eArgError, "malformed name - unmatched parenthesis");
- }
- if (id) {
- rb_raise(rb_eArgError, "name%.*s after <%s>",
- (int)(p - start + 1), start, rb_id2name(id));
- }
- id = rb_intern3(start + 1, p - start - 1, enc);
- nextvalue = GETNAMEARG(ID2SYM(id), start, (int)(p - start + 1));
- if (nextvalue == Qundef) {
- rb_raise(rb_eKeyError, "key%.*s not found", (int)(p - start + 1), start);
- }
- if (term == '}') goto format_s;
- p++;
- goto retry;
- }
-
case '*':
CHECK_FOR_WIDTH(flags);
flags |= FWIDTH;
@@ -608,7 +404,7 @@ rb_str_format(int argc, const VALUE *argv, VALUE fmt)
p--;
case '%':
if (flags != FNONE) {
- rb_raise(rb_eArgError, "invalid format character - %%");
+ rb_raise(rb_eArgError, "illegal format character - %%");
}
PUSH("%", 1);
break;
@@ -616,99 +412,54 @@ rb_str_format(int argc, const VALUE *argv, VALUE fmt)
case 'c':
{
VALUE val = GETARG();
- VALUE tmp;
- unsigned int c;
- int n;
-
- tmp = rb_check_string_type(val);
- if (!NIL_P(tmp)) {
- if (rb_enc_strlen(RSTRING_PTR(tmp),RSTRING_END(tmp),enc) != 1) {
- rb_raise(rb_eArgError, "%%c requires a character");
- }
- c = rb_enc_codepoint_len(RSTRING_PTR(tmp), RSTRING_END(tmp), &n, enc);
- }
- else {
- c = NUM2INT(val);
- n = rb_enc_codelen(c, enc);
- }
- if (n <= 0) {
- rb_raise(rb_eArgError, "invalid character");
- }
- if (!(flags & FWIDTH)) {
- CHECK(n);
- rb_enc_mbcput(c, &buf[blen], enc);
- blen += n;
- }
- else if ((flags & FMINUS)) {
- CHECK(n);
- rb_enc_mbcput(c, &buf[blen], enc);
- blen += n;
- FILL(' ', width-1);
- }
- else {
- FILL(' ', width-1);
- CHECK(n);
- rb_enc_mbcput(c, &buf[blen], enc);
- blen += n;
- }
+ char c;
+
+ if (!(flags & FMINUS))
+ while (--width > 0)
+ PUSH(" ", 1);
+ c = NUM2INT(val) & 0xff;
+ PUSH(&c, 1);
+ while (--width > 0)
+ PUSH(" ", 1);
}
break;
case 's':
case 'p':
- format_s:
{
VALUE arg = GETARG();
- long len, slen;
+ long len;
if (*p == 'p') arg = rb_inspect(arg);
str = rb_obj_as_string(arg);
if (OBJ_TAINTED(str)) tainted = 1;
- len = RSTRING_LEN(str);
- rb_str_set_len(result, blen);
- if (coderange != ENC_CODERANGE_BROKEN && scanned < blen) {
- int cr = coderange;
- scanned = rb_str_coderange_scan_restartable(buf+scanned, buf+blen, enc, &cr);
- ENC_CODERANGE_SET(result,
- (cr == ENC_CODERANGE_UNKNOWN ?
- ENC_CODERANGE_BROKEN : (coderange = cr)));
- }
- enc = rb_enc_check(result, str);
- if (flags&(FPREC|FWIDTH)) {
- slen = rb_enc_strlen(RSTRING_PTR(str),RSTRING_END(str),enc);
- if (slen < 0) {
- rb_raise(rb_eArgError, "invalid mbstring sequence");
- }
- if ((flags&FPREC) && (prec < slen)) {
- char *p = rb_enc_nth(RSTRING_PTR(str), RSTRING_END(str),
- prec, enc);
- slen = prec;
- len = p - RSTRING_PTR(str);
+ len = RSTRING(str)->len;
+ if (flags&FPREC) {
+ if (prec < len) {
+ len = prec;
}
- /* need to adjust multi-byte string pos */
- if ((flags&FWIDTH) && (width > slen)) {
- width -= slen;
+ }
+ /* need to adjust multi-byte string pos */
+ if (flags&FWIDTH) {
+ if (width > len) {
+ CHECK(width);
+ width -= len;
if (!(flags&FMINUS)) {
- CHECK(width);
while (width--) {
buf[blen++] = ' ';
}
}
- CHECK(len);
memcpy(&buf[blen], RSTRING_PTR(str), len);
blen += len;
if (flags&FMINUS) {
- CHECK(width);
while (width--) {
buf[blen++] = ' ';
}
}
- rb_enc_associate(result, enc);
break;
}
}
- PUSH(RSTRING_PTR(str), len);
- rb_enc_associate(result, enc);
+ PUSH(RSTRING(str)->ptr, len);
}
break;
@@ -721,26 +472,28 @@ rb_str_format(int argc, const VALUE *argv, VALUE fmt)
case 'B':
case 'u':
{
- volatile VALUE tmp1;
volatile VALUE val = GETARG();
- char fbuf[32], nbuf[64], *s;
+ char fbuf[32], nbuf[64], *s, *t;
const char *prefix = 0;
- int sign = 0, dots = 0;
+ int sign = 0;
char sc = 0;
long v = 0;
int base, bignum = 0;
int len, pos;
+ volatile VALUE tmp;
+ volatile VALUE tmp1;
switch (*p) {
case 'd':
case 'i':
- case 'u':
sign = 1; break;
case 'o':
case 'x':
case 'X':
case 'b':
case 'B':
+ case 'u':
+ default:
if (flags&(FPLUS|FSPACE)) sign = 1;
break;
}
@@ -757,16 +510,15 @@ rb_str_format(int argc, const VALUE *argv, VALUE fmt)
case 'B':
prefix = "0B"; break;
}
+ if (prefix) {
+ width -= strlen(prefix);
+ }
}
bin_retry:
switch (TYPE(val)) {
case T_FLOAT:
- if (FIXABLE(RFLOAT_VALUE(val))) {
- val = LONG2FIX((long)RFLOAT_VALUE(val));
- goto bin_retry;
- }
- val = rb_dbl2big(RFLOAT_VALUE(val));
+ val = rb_dbl2big(RFLOAT(val)->value);
if (FIXNUM_P(val)) goto bin_retry;
bignum = 1;
break;
@@ -821,118 +573,107 @@ rb_str_format(int argc, const VALUE *argv, VALUE fmt)
sc = ' ';
width--;
}
- snprintf(fbuf, sizeof(fbuf), "%%l%c", c);
- snprintf(nbuf, sizeof(nbuf), fbuf, v);
+ sprintf(fbuf, "%%l%c", c);
+ sprintf(nbuf, fbuf, v);
s = nbuf;
+ goto format_integer;
}
- else {
- s = nbuf;
- if (v < 0) {
- dots = 1;
+ s = nbuf;
+ if (v < 0) {
+ if (base == 10) {
+ rb_warning("negative number for %%u specifier");
}
- snprintf(fbuf, sizeof(fbuf), "%%l%c", *p == 'X' ? 'x' : *p);
- snprintf(++s, sizeof(nbuf) - 1, fbuf, v);
- if (v < 0) {
- char d = 0;
-
- s = remove_sign_bits(s, base);
- switch (base) {
- case 16:
- d = 'f'; break;
- case 8:
- d = '7'; break;
- }
- if (d && *s != d) {
- *--s = d;
- }
+ if (!(flags&(FPREC|FZERO))) {
+ strcpy(s, "..");
+ s += 2;
}
}
- }
- else {
- if (sign) {
- tmp = rb_big2str(val, base);
- s = RSTRING_PTR(tmp);
- if (s[0] == '-') {
- s++;
- sc = '-';
- width--;
+ sprintf(fbuf, "%%l%c", *p == 'X' ? 'x' : *p);
+ sprintf(s, fbuf, v);
+ if (v < 0) {
+ char d = 0;
+
+ remove_sign_bits(s, base);
+ switch (base) {
+ case 16:
+ d = 'f'; break;
+ case 8:
+ d = '7'; break;
}
- else if (flags & FPLUS) {
- sc = '+';
- width--;
- }
- else if (flags & FSPACE) {
- sc = ' ';
- width--;
+ if (d && *s != d) {
+ memmove(s+1, s, strlen(s)+1);
+ *s = d;
}
}
- else {
- if (!RBIGNUM_SIGN(val)) {
- val = rb_big_clone(val);
- rb_big_2comp(val);
- }
- tmp1 = tmp = rb_big2str0(val, base, RBIGNUM_SIGN(val));
- s = RSTRING_PTR(tmp);
- if (*s == '-') {
- dots = 1;
- if (base == 10) {
- rb_warning("negative number for %%u specifier");
- }
- s = remove_sign_bits(++s, base);
- switch (base) {
- case 16:
- if (s[0] != 'f') *--s = 'f'; break;
- case 8:
- if (s[0] != '7') *--s = '7'; break;
- case 2:
- if (s[0] != '1') *--s = '1'; break;
- }
- }
+ s = nbuf;
+ goto format_integer;
+ }
+
+ if (sign) {
+ tmp = rb_big2str(val, base);
+ s = RSTRING(tmp)->ptr;
+ if (s[0] == '-') {
+ s++;
+ sc = '-';
+ width--;
}
+ else if (flags & FPLUS) {
+ sc = '+';
+ width--;
+ }
+ else if (flags & FSPACE) {
+ sc = ' ';
+ width--;
+ }
+ goto format_integer;
+ }
+ if (!RBIGNUM(val)->sign) {
+ val = rb_big_clone(val);
+ rb_big_2comp(val);
}
+ tmp1 = tmp = rb_big2str0(val, base, RBIGNUM(val)->sign);
+ s = RSTRING(tmp)->ptr;
+ if (*s == '-') {
+ if (base == 10) {
+ rb_warning("negative number for %%u specifier");
+ }
+ remove_sign_bits(++s, base);
+ tmp = rb_str_new(0, 3+strlen(s));
+ t = RSTRING(tmp)->ptr;
+ if (!(flags&(FPREC|FZERO))) {
+ strcpy(t, "..");
+ t += 2;
+ }
+ switch (base) {
+ case 16:
+ if (s[0] != 'f') strcpy(t++, "f"); break;
+ case 8:
+ if (s[0] != '7') strcpy(t++, "7"); break;
+ case 2:
+ if (s[0] != '1') strcpy(t++, "1"); break;
+ }
+ strcpy(t, s);
+ bignum = 2;
+ }
+ s = RSTRING(tmp)->ptr;
+ format_integer:
pos = -1;
len = strlen(s);
- if (dots) {
- prec -= 2;
- width -= 2;
- }
if (*p == 'X') {
char *pp = s;
- int c;
- while ((c = (int)(unsigned char)*pp) != 0) {
- *pp = rb_enc_toupper(c, enc);
+ while (*pp) {
+ *pp = toupper(*pp);
pp++;
}
}
- if (prefix && !prefix[1]) { /* octal */
- if (dots) {
- prefix = 0;
- }
- else if (len == 1 && *s == '0') {
- len = 0;
- if (flags & FPREC) prec--;
- }
- else if ((flags & FPREC) && (prec > len)) {
- prefix = 0;
- }
- }
- else if (len == 1 && *s == '0') {
- prefix = 0;
- }
- if (prefix) {
- width -= strlen(prefix);
- }
- if ((flags & (FZERO|FMINUS|FPREC)) == FZERO) {
+ if ((flags&(FZERO|FPREC)) == FZERO) {
prec = width;
width = 0;
}
else {
- if (prec < len) {
- if (!prefix && prec == 0 && len == 1 && *s == '0') len = 0;
- prec = len;
- }
+ if (prec < len) prec = len;
width -= prec;
}
if (!(flags&FMINUS)) {
@@ -947,17 +688,16 @@ rb_str_format(int argc, const VALUE *argv, VALUE fmt)
PUSH(prefix, plen);
}
CHECK(prec - len);
- if (dots) PUSH("..", 2);
if (!bignum && v < 0) {
char c = sign_bits(base, p);
while (len < prec--) {
buf[blen++] = c;
}
}
- else if ((flags & (FMINUS|FPREC)) != FMINUS) {
+ else {
char c;
- if (!sign && bignum && !RBIGNUM_SIGN(val))
+ if (!sign && bignum && !RBIGNUM(val)->sign)
c = sign_bits(base, p);
else
c = '0';
@@ -984,11 +724,12 @@ rb_str_format(int argc, const VALUE *argv, VALUE fmt)
int i, need = 6;
char fbuf[32];
- fval = RFLOAT_VALUE(rb_Float(val));
+ fval = RFLOAT(rb_Float(val))->value;
+#if defined(_WIN32) && !defined(__BORLANDC__)
if (isnan(fval) || isinf(fval)) {
const char *expr;
- if (isnan(fval)) {
+ if (isnan(fval)) {
expr = "NaN";
}
else {
@@ -997,11 +738,13 @@ rb_str_format(int argc, const VALUE *argv, VALUE fmt)
need = strlen(expr);
if ((!isnan(fval) && fval < 0.0) || (flags & FPLUS))
need++;
+ else if (flags & FSPACE)
+ need++;
if ((flags & FWIDTH) && need < width)
need = width;
- CHECK(need + 1);
- snprintf(&buf[blen], need + 1, "%*s", need, "");
+ CHECK(need);
+ sprintf(&buf[blen], "%*s", need, "");
if (flags & FMINUS) {
if (!isnan(fval) && fval < 0.0)
buf[blen++] = '-';
@@ -1009,23 +752,39 @@ rb_str_format(int argc, const VALUE *argv, VALUE fmt)
buf[blen++] = '+';
else if (flags & FSPACE)
blen++;
- memcpy(&buf[blen], expr, strlen(expr));
+ strncpy(&buf[blen], expr, strlen(expr));
+ }
+ else if (flags & FZERO) {
+ if (!isnan(fval) && fval < 0.0) {
+ buf[blen++] = '-';
+ need--;
+ }
+ else if (flags & FPLUS) {
+ buf[blen++] = '+';
+ need--;
+ }
+ else if (flags & FSPACE) {
+ blen++;
+ need--;
+ }
+ while (need-- - strlen(expr) > 0) {
+ buf[blen++] = '0';
+ }
+ strncpy(&buf[blen], expr, strlen(expr));
}
else {
if (!isnan(fval) && fval < 0.0)
buf[blen + need - strlen(expr) - 1] = '-';
else if (flags & FPLUS)
buf[blen + need - strlen(expr) - 1] = '+';
- else if ((flags & FSPACE) && need > width)
- blen++;
- memcpy(&buf[blen + need - strlen(expr)], expr,
- strlen(expr));
+ strncpy(&buf[blen + need - strlen(expr)], expr,
+ strlen(expr));
}
blen += strlen(&buf[blen]);
break;
}
-
- fmt_setup(fbuf, sizeof(fbuf), *p, flags, width, prec);
+#endif /* defined(_WIN32) && !defined(__BORLANDC__) */
+ fmt_setup(fbuf, *p, flags, width, prec);
need = 0;
if (*p != 'e' && *p != 'E') {
i = INT_MIN;
@@ -1039,7 +798,7 @@ rb_str_format(int argc, const VALUE *argv, VALUE fmt)
need += 20;
CHECK(need);
- snprintf(&buf[blen], need, fbuf, fval);
+ sprintf(&buf[blen], fbuf, fval);
blen += strlen(&buf[blen]);
}
break;
@@ -1048,16 +807,12 @@ rb_str_format(int argc, const VALUE *argv, VALUE fmt)
}
sprint_exit:
- /* XXX - We cannot validate the number of arguments if (digit)$ style used.
+ /* XXX - We cannot validiate the number of arguments if (digit)$ style used.
*/
if (posarg >= 0 && nextarg < argc) {
const char *mesg = "too many arguments for format string";
- if (RTEST(ruby_debug)) rb_raise(rb_eArgError, "%s", mesg);
- if (RTEST(ruby_verbose)) rb_warn("%s", mesg);
- }
- if (scanned < blen) {
- rb_str_coderange_scan_restartable(buf+scanned, buf+blen, enc, &coderange);
- ENC_CODERANGE_SET(result, coderange);
+ if (RTEST(ruby_debug)) rb_raise(rb_eArgError, mesg);
+ if (RTEST(ruby_verbose)) rb_warn(mesg);
}
rb_str_resize(result, blen);
@@ -1066,9 +821,11 @@ rb_str_format(int argc, const VALUE *argv, VALUE fmt)
}
static void
-fmt_setup(char *buf, size_t size, int c, int flags, int width, int prec)
+fmt_setup(buf, c, flags, width, prec)
+ char *buf;
+ int c;
+ int flags, width, prec;
{
- char *end = buf + size;
*buf++ = '%';
if (flags & FSHARP) *buf++ = '#';
if (flags & FPLUS) *buf++ = '+';
@@ -1077,151 +834,15 @@ fmt_setup(char *buf, size_t size, int c, int flags, int width, int prec)
if (flags & FSPACE) *buf++ = ' ';
if (flags & FWIDTH) {
- snprintf(buf, end - buf, "%d", width);
+ sprintf(buf, "%d", width);
buf += strlen(buf);
}
if (flags & FPREC) {
- snprintf(buf, end - buf, ".%d", prec);
+ sprintf(buf, ".%d", prec);
buf += strlen(buf);
}
*buf++ = c;
*buf = '\0';
}
-
-#undef FILE
-#define FILE rb_printf_buffer
-#define __sbuf rb_printf_sbuf
-#define __sFILE rb_printf_sfile
-#undef feof
-#undef ferror
-#undef clearerr
-#undef fileno
-#if SIZEOF_LONG < SIZEOF_VOIDP
-# if SIZEOF_LONG_LONG == SIZEOF_VOIDP
-# define _HAVE_SANE_QUAD_
-# define _HAVE_LLP64_
-# define quad_t LONG_LONG
-# define u_quad_t unsigned LONG_LONG
-# endif
-#endif
-#undef snprintf
-#define FLOATING_POINT 1
-#define BSD__dtoa ruby_dtoa
-#include "missing/vsnprintf.c"
-
-static int
-ruby__sfvwrite(register rb_printf_buffer *fp, register struct __suio *uio)
-{
- struct __siov *iov;
- VALUE result = (VALUE)fp->_bf._base;
- char *buf = (char*)fp->_p;
- size_t len, n;
- size_t blen = buf - RSTRING_PTR(result), bsiz = fp->_w;
-
- if (RBASIC(result)->klass) {
- rb_raise(rb_eRuntimeError, "rb_vsprintf reentered");
- }
- if ((len = uio->uio_resid) == 0)
- return 0;
- CHECK(len);
- buf += blen;
- fp->_w = bsiz;
- for (iov = uio->uio_iov; len > 0; ++iov) {
- MEMCPY(buf, iov->iov_base, char, n = iov->iov_len);
- buf += n;
- len -= n;
- }
- fp->_p = (unsigned char *)buf;
- return 0;
-}
-
-VALUE
-rb_enc_vsprintf(rb_encoding *enc, const char *fmt, va_list ap)
-{
- rb_printf_buffer f;
- VALUE result;
-
- f._flags = __SWR | __SSTR;
- f._bf._size = 0;
- f._w = 120;
- result = rb_str_buf_new(f._w);
- if (enc) rb_enc_associate(result, enc);
- f._bf._base = (unsigned char *)result;
- f._p = (unsigned char *)RSTRING_PTR(result);
- RBASIC(result)->klass = 0;
- f.vwrite = ruby__sfvwrite;
- BSD_vfprintf(&f, fmt, ap);
- RBASIC(result)->klass = rb_cString;
- rb_str_resize(result, (char *)f._p - RSTRING_PTR(result));
-
- return result;
-}
-
-VALUE
-rb_enc_sprintf(rb_encoding *enc, const char *format, ...)
-{
- VALUE result;
- va_list ap;
-
- va_start(ap, format);
- result = rb_enc_vsprintf(enc, format, ap);
- va_end(ap);
-
- return result;
-}
-
-VALUE
-rb_vsprintf(const char *fmt, va_list ap)
-{
- return rb_enc_vsprintf(NULL, fmt, ap);
-}
-
-VALUE
-rb_sprintf(const char *format, ...)
-{
- VALUE result;
- va_list ap;
-
- va_start(ap, format);
- result = rb_vsprintf(format, ap);
- va_end(ap);
-
- return result;
-}
-
-VALUE
-rb_str_vcatf(VALUE str, const char *fmt, va_list ap)
-{
- rb_printf_buffer f;
- VALUE klass;
-
- StringValue(str);
- rb_str_modify(str);
- f._flags = __SWR | __SSTR;
- f._bf._size = 0;
- f._w = rb_str_capacity(str);
- f._bf._base = (unsigned char *)str;
- f._p = (unsigned char *)RSTRING_END(str);
- klass = RBASIC(str)->klass;
- RBASIC(str)->klass = 0;
- f.vwrite = ruby__sfvwrite;
- BSD_vfprintf(&f, fmt, ap);
- RBASIC(str)->klass = klass;
- rb_str_resize(str, (char *)f._p - RSTRING_PTR(str));
-
- return str;
-}
-
-VALUE
-rb_str_catf(VALUE str, const char *format, ...)
-{
- va_list ap;
-
- va_start(ap, format);
- str = rb_str_vcatf(str, format, ap);
- va_end(ap);
-
- return str;
-}
diff --git a/st.c b/st.c
index 01f2a43dc4..c16c3109a8 100644
--- a/st.c
+++ b/st.c
@@ -2,18 +2,14 @@
/* static char sccsid[] = "@(#) st.c 5.1 89/12/14 Crucible"; */
-#ifdef NOT_RUBY
-#include "regint.h"
-#include "st.h"
-#else
-#include "ruby/ruby.h"
-#endif
-
+#include "config.h"
+#include "defines.h"
#include <stdio.h>
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
#include <string.h>
+#include "st.h"
typedef struct st_table_entry st_table_entry;
@@ -22,7 +18,6 @@ struct st_table_entry {
st_data_t key;
st_data_t record;
st_table_entry *next;
- st_table_entry *fore, *back;
};
#define ST_DEFAULT_MAX_DENSITY 5
@@ -37,34 +32,28 @@ struct st_table_entry {
* allocated initially
*
*/
-
-static const struct st_hash_type type_numhash = {
- st_numcmp,
- st_numhash,
+static int numcmp(long, long);
+static int numhash(long);
+static struct st_hash_type type_numhash = {
+ numcmp,
+ numhash,
};
/* extern int strcmp(const char *, const char *); */
static int strhash(const char *);
-static const struct st_hash_type type_strhash = {
+static struct st_hash_type type_strhash = {
strcmp,
strhash,
};
-static int strcasehash(const char *);
-static const struct st_hash_type type_strcasehash = {
- st_strcasecmp,
- strcasehash,
-};
-
static void rehash(st_table *);
#ifdef RUBY
#define malloc xmalloc
#define calloc xcalloc
-#define free(x) xfree(x)
#endif
-#define alloc(type) (type*)malloc((size_t)sizeof(type))
+#define alloc(type) (type*)malloc((unsigned)sizeof(type))
#define Calloc(n,s) (char*)calloc((n),(s))
#define EQUAL(table,x,y) ((x)==(y) || (*table->type->compare)((x),(y)) == 0)
@@ -81,7 +70,7 @@ static void rehash(st_table *);
/*
Table of prime numbers 2^n+a, 2<=n<=30.
*/
-static const long primes[] = {
+static long primes[] = {
8 + 3,
16 + 3,
32 + 5,
@@ -114,7 +103,8 @@ static const long primes[] = {
};
static int
-new_size(int size)
+new_size(size)
+ int size;
{
int i;
@@ -127,15 +117,12 @@ new_size(int size)
int newsize;
for (i = 0, newsize = MINSIZE;
- i < (int )(sizeof(primes)/sizeof(primes[0]));
+ i < sizeof(primes)/sizeof(primes[0]);
i++, newsize <<= 1)
{
if (newsize > size) return primes[i];
}
/* Ran out of polynomials */
-#ifndef NOT_RUBY
- rb_raise(rb_eRuntimeError, "st_table too big");
-#endif
return -1; /* should raise exception */
#endif
}
@@ -145,7 +132,7 @@ static int collision = 0;
static int init_st = 0;
static void
-stat_col(void)
+stat_col()
{
FILE *f = fopen("/tmp/col", "w");
fprintf(f, "collision: %d\n", collision);
@@ -153,10 +140,10 @@ stat_col(void)
}
#endif
-#define MAX_PACKED_NUMHASH 5
-
st_table*
-st_init_table_with_size(const struct st_hash_type *type, int size)
+st_init_table_with_size(type, size)
+ struct st_hash_type *type;
+ int size;
{
st_table *tbl;
@@ -172,17 +159,15 @@ st_init_table_with_size(const struct st_hash_type *type, int size)
tbl = alloc(st_table);
tbl->type = type;
tbl->num_entries = 0;
- tbl->entries_packed = type == &type_numhash && size/2 <= MAX_PACKED_NUMHASH;
tbl->num_bins = size;
tbl->bins = (st_table_entry **)Calloc(size, sizeof(st_table_entry*));
- tbl->head = 0;
- tbl->tail = 0;
return tbl;
}
st_table*
-st_init_table(const struct st_hash_type *type)
+st_init_table(type)
+ struct st_hash_type *type;
{
return st_init_table_with_size(type, 0);
}
@@ -194,7 +179,8 @@ st_init_numtable(void)
}
st_table*
-st_init_numtable_with_size(int size)
+st_init_numtable_with_size(size)
+ int size;
{
return st_init_table_with_size(&type_numhash, size);
}
@@ -206,67 +192,31 @@ st_init_strtable(void)
}
st_table*
-st_init_strtable_with_size(int size)
+st_init_strtable_with_size(size)
+ int size;
{
return st_init_table_with_size(&type_strhash, size);
}
-st_table*
-st_init_strcasetable(void)
-{
- return st_init_table(&type_strcasehash);
-}
-
-st_table*
-st_init_strcasetable_with_size(int size)
-{
- return st_init_table_with_size(&type_strcasehash, size);
-}
-
void
-st_clear(st_table *table)
+st_free_table(table)
+ st_table *table;
{
register st_table_entry *ptr, *next;
- st_index_t i;
-
- if (table->entries_packed) {
- table->num_entries = 0;
- return;
- }
+ int i;
for(i = 0; i < table->num_bins; i++) {
ptr = table->bins[i];
- table->bins[i] = 0;
while (ptr != 0) {
next = ptr->next;
free(ptr);
ptr = next;
}
}
- table->num_entries = 0;
- table->head = 0;
- table->tail = 0;
-}
-
-void
-st_free_table(st_table *table)
-{
- st_clear(table);
free(table->bins);
free(table);
}
-size_t
-st_memsize(st_table *table)
-{
- if (table->entries_packed) {
- return table->num_bins * sizeof (void *) + sizeof(st_table);
- }
- else {
- return table->num_entries * sizeof(struct st_table_entry) + table->num_bins * sizeof (void *) + sizeof(st_table);
- }
-}
-
#define PTR_NOT_EQUAL(table, ptr, hash_val, key) \
((ptr) != 0 && (ptr->hash != (hash_val) || !EQUAL((table), (key), (ptr)->key)))
@@ -289,22 +239,14 @@ st_memsize(st_table *table)
} while (0)
int
-st_lookup(st_table *table, register st_data_t key, st_data_t *value)
+st_lookup(table, key, value)
+ st_table *table;
+ register st_data_t key;
+ st_data_t *value;
{
unsigned int hash_val, bin_pos;
register st_table_entry *ptr;
- if (table->entries_packed) {
- st_index_t i;
- for (i = 0; i < table->num_entries; i++) {
- if ((st_data_t)table->bins[i*2] == key) {
- if (value !=0) *value = (st_data_t)table->bins[i*2+1];
- return 1;
- }
- }
- return 0;
- }
-
hash_val = do_hash(key, table);
FIND_ENTRY(table, ptr, hash_val, bin_pos);
@@ -317,35 +259,6 @@ st_lookup(st_table *table, register st_data_t key, st_data_t *value)
}
}
-int
-st_get_key(st_table *table, register st_data_t key, st_data_t *result)
-{
- unsigned int hash_val, bin_pos;
- register st_table_entry *ptr;
-
- if (table->entries_packed) {
- st_index_t i;
- for (i = 0; i < table->num_entries; i++) {
- if ((st_data_t)table->bins[i*2] == key) {
- if (result !=0) *result = (st_data_t)table->bins[i*2];
- return 1;
- }
- }
- return 0;
- }
-
- hash_val = do_hash(key, table);
- FIND_ENTRY(table, ptr, hash_val, bin_pos);
-
- if (ptr == 0) {
- return 0;
- }
- else {
- if (result != 0) *result = ptr->key;
- return 1;
- }
-}
-
#define ADD_DIRECT(table, key, value, hash_val, bin_pos)\
do {\
st_table_entry *entry;\
@@ -360,60 +273,19 @@ do {\
entry->key = key;\
entry->record = value;\
entry->next = table->bins[bin_pos];\
- if (table->head != 0) {\
- entry->fore = 0;\
- (entry->back = table->tail)->fore = entry;\
- table->tail = entry;\
- }\
- else {\
- table->head = table->tail = entry;\
- entry->fore = entry->back = 0;\
- }\
table->bins[bin_pos] = entry;\
table->num_entries++;\
} while (0)
-static void
-unpack_entries(register st_table *table)
-{
- int i;
- struct st_table_entry *packed_bins[MAX_PACKED_NUMHASH*2];
- int num_entries = table->num_entries;
-
- memcpy(packed_bins, table->bins, sizeof(struct st_table_entry *) * num_entries*2);
- table->entries_packed = 0;
- table->num_entries = 0;
- memset(table->bins, 0, sizeof(struct st_table_entry *) * table->num_bins);
- for (i = 0; i < num_entries; i++) {
- st_insert(table, (st_data_t)packed_bins[i*2], (st_data_t)packed_bins[i*2+1]);
- }
-}
-
int
-st_insert(register st_table *table, register st_data_t key, st_data_t value)
+st_insert(table, key, value)
+ register st_table *table;
+ register st_data_t key;
+ st_data_t value;
{
unsigned int hash_val, bin_pos;
register st_table_entry *ptr;
- if (table->entries_packed) {
- st_index_t i;
- for (i = 0; i < table->num_entries; i++) {
- if ((st_data_t)table->bins[i*2] == key) {
- table->bins[i*2+1] = (struct st_table_entry*)value;
- return 1;
- }
- }
- if ((table->num_entries+1) * 2 <= table->num_bins && table->num_entries+1 <= MAX_PACKED_NUMHASH) {
- i = table->num_entries++;
- table->bins[i*2] = (struct st_table_entry*)key;
- table->bins[i*2+1] = (struct st_table_entry*)value;
- return 0;
- }
- else {
- unpack_entries(table);
- }
- }
-
hash_val = do_hash(key, table);
FIND_ENTRY(table, ptr, hash_val, bin_pos);
@@ -427,99 +299,52 @@ st_insert(register st_table *table, register st_data_t key, st_data_t value)
}
}
-int
-st_insert2(register st_table *table, register st_data_t key, st_data_t value,
- st_data_t (*func)(st_data_t))
-{
- unsigned int hash_val, bin_pos;
- register st_table_entry *ptr;
-
- if (table->entries_packed) {
- st_index_t i;
- for (i = 0; i < table->num_entries; i++) {
- if ((st_data_t)table->bins[i*2] == key) {
- table->bins[i*2+1] = (struct st_table_entry*)value;
- return 1;
- }
- }
- if ((table->num_entries+1) * 2 <= table->num_bins && table->num_entries+1 <= MAX_PACKED_NUMHASH) {
- i = table->num_entries++;
- table->bins[i*2] = (struct st_table_entry*)key;
- table->bins[i*2+1] = (struct st_table_entry*)value;
- return 0;
- }
- else {
- unpack_entries(table);
- }
- }
-
- hash_val = do_hash(key, table);
- FIND_ENTRY(table, ptr, hash_val, bin_pos);
-
- if (ptr == 0) {
- key = (*func)(key);
- ADD_DIRECT(table, key, value, hash_val, bin_pos);
- return 0;
- }
- else {
- ptr->record = value;
- return 1;
- }
-}
-
void
-st_add_direct(st_table *table, st_data_t key, st_data_t value)
+st_add_direct(table, key, value)
+ st_table *table;
+ st_data_t key;
+ st_data_t value;
{
unsigned int hash_val, bin_pos;
- if (table->entries_packed) {
- int i;
- if ((table->num_entries+1) * 2 <= table->num_bins && table->num_entries+1 <= MAX_PACKED_NUMHASH) {
- i = table->num_entries++;
- table->bins[i*2] = (struct st_table_entry*)key;
- table->bins[i*2+1] = (struct st_table_entry*)value;
- return;
- }
- else {
- unpack_entries(table);
- }
- }
-
hash_val = do_hash(key, table);
bin_pos = hash_val % table->num_bins;
ADD_DIRECT(table, key, value, hash_val, bin_pos);
}
static void
-rehash(register st_table *table)
+rehash(table)
+ register st_table *table;
{
- register st_table_entry *ptr, **new_bins;
- int i, new_num_bins;
+ register st_table_entry *ptr, *next, **new_bins;
+ int i, old_num_bins = table->num_bins, new_num_bins;
unsigned int hash_val;
- new_num_bins = new_size(table->num_bins+1);
- new_bins = (st_table_entry**)
- xrealloc(table->bins, new_num_bins * sizeof(st_table_entry*));
- for (i = 0; i < new_num_bins; ++i) new_bins[i] = 0;
- table->num_bins = new_num_bins;
- table->bins = new_bins;
+ new_num_bins = new_size(old_num_bins+1);
+ new_bins = (st_table_entry**)Calloc(new_num_bins, sizeof(st_table_entry*));
- if ((ptr = table->head) != 0) {
- do {
+ for(i = 0; i < old_num_bins; i++) {
+ ptr = table->bins[i];
+ while (ptr != 0) {
+ next = ptr->next;
hash_val = ptr->hash % new_num_bins;
ptr->next = new_bins[hash_val];
new_bins[hash_val] = ptr;
- } while ((ptr = ptr->fore) != 0);
+ ptr = next;
+ }
}
+ free(table->bins);
+ table->num_bins = new_num_bins;
+ table->bins = new_bins;
}
st_table*
-st_copy(st_table *old_table)
+st_copy(old_table)
+ st_table *old_table;
{
st_table *new_table;
- st_table_entry *ptr, *entry, *prev, **tail;
- int num_bins = old_table->num_bins;
- unsigned int hash_val;
+ st_table_entry *ptr, *entry;
+ int i, num_bins = old_table->num_bins;
new_table = alloc(st_table);
if (new_table == 0) {
@@ -535,91 +360,73 @@ st_copy(st_table *old_table)
return 0;
}
- if (old_table->entries_packed) {
- memcpy(new_table->bins, old_table->bins, sizeof(struct st_table_entry *) * old_table->num_bins);
- return new_table;
- }
-
- if ((ptr = old_table->head) != 0) {
- prev = 0;
- tail = &new_table->head;
- do {
+ for(i = 0; i < num_bins; i++) {
+ new_table->bins[i] = 0;
+ ptr = old_table->bins[i];
+ while (ptr != 0) {
entry = alloc(st_table_entry);
if (entry == 0) {
- st_free_table(new_table);
+ free(new_table->bins);
+ free(new_table);
return 0;
}
*entry = *ptr;
- hash_val = entry->hash % num_bins;
- entry->next = new_table->bins[hash_val];
- new_table->bins[hash_val] = entry;
- entry->back = prev;
- *tail = prev = entry;
- tail = &entry->fore;
- } while ((ptr = ptr->fore) != 0);
- new_table->tail = prev;
+ entry->next = new_table->bins[i];
+ new_table->bins[i] = entry;
+ ptr = ptr->next;
+ }
}
-
return new_table;
}
-#define REMOVE_ENTRY(table, ptr) do \
- { \
- if (ptr->fore == 0 && ptr->back == 0) { \
- table->head = 0; \
- table->tail = 0; \
- } \
- else { \
- st_table_entry *fore = ptr->fore, *back = ptr->back; \
- if (fore) fore->back = back; \
- if (back) back->fore = fore; \
- if (ptr == table->head) table->head = fore; \
- if (ptr == table->tail) table->tail = back; \
- } \
- table->num_entries--; \
- } while (0)
-
int
-st_delete(register st_table *table, register st_data_t *key, st_data_t *value)
+st_delete(table, key, value)
+ register st_table *table;
+ register st_data_t *key;
+ st_data_t *value;
{
unsigned int hash_val;
- st_table_entry **prev;
+ st_table_entry *tmp;
register st_table_entry *ptr;
- if (table->entries_packed) {
- st_index_t i;
- for (i = 0; i < table->num_entries; i++) {
- if ((st_data_t)table->bins[i*2] == *key) {
- if (value != 0) *value = (st_data_t)table->bins[i*2+1];
- table->num_entries--;
- memmove(&table->bins[i*2], &table->bins[(i+1)*2],
- sizeof(struct st_table_entry*) * 2*(table->num_entries-i));
- return 1;
- }
- }
- if (value != 0) *value = 0;
- return 0;
+ hash_val = do_hash_bin(*key, table);
+ ptr = table->bins[hash_val];
+
+ if (ptr == 0) {
+ if (value != 0) *value = 0;
+ return 0;
}
- hash_val = do_hash_bin(*key, table);
+ if (EQUAL(table, *key, ptr->key)) {
+ table->bins[hash_val] = ptr->next;
+ table->num_entries--;
+ if (value != 0) *value = ptr->record;
+ *key = ptr->key;
+ free(ptr);
+ return 1;
+ }
- for (prev = &table->bins[hash_val]; (ptr = *prev) != 0; prev = &ptr->next) {
- if (EQUAL(table, *key, ptr->key)) {
- *prev = ptr->next;
- REMOVE_ENTRY(table, ptr);
- if (value != 0) *value = ptr->record;
- *key = ptr->key;
- free(ptr);
+ for(; ptr->next != 0; ptr = ptr->next) {
+ if (EQUAL(table, ptr->next->key, *key)) {
+ tmp = ptr->next;
+ ptr->next = ptr->next->next;
+ table->num_entries--;
+ if (value != 0) *value = tmp->record;
+ *key = tmp->key;
+ free(tmp);
return 1;
}
}
- if (value != 0) *value = 0;
return 0;
}
int
-st_delete_safe(register st_table *table, register st_data_t *key, st_data_t *value, st_data_t never)
+st_delete_safe(table, key, value, never)
+ register st_table *table;
+ register st_data_t *key;
+ st_data_t *value;
+ st_data_t never;
{
unsigned int hash_val;
register st_table_entry *ptr;
@@ -627,9 +434,14 @@ st_delete_safe(register st_table *table, register st_data_t *key, st_data_t *val
hash_val = do_hash_bin(*key, table);
ptr = table->bins[hash_val];
- for (; ptr != 0; ptr = ptr->next) {
+ if (ptr == 0) {
+ if (value != 0) *value = 0;
+ return 0;
+ }
+
+ for(; ptr != 0; ptr = ptr->next) {
if ((ptr->key != never) && EQUAL(table, ptr->key, *key)) {
- REMOVE_ENTRY(table, ptr);
+ table->num_entries--;
*key = ptr->key;
if (value != 0) *value = ptr->record;
ptr->key = ptr->record = never;
@@ -637,362 +449,127 @@ st_delete_safe(register st_table *table, register st_data_t *key, st_data_t *val
}
}
- if (value != 0) *value = 0;
return 0;
}
-void
-st_cleanup_safe(st_table *table, st_data_t never)
+static int
+delete_never(key, value, never)
+ st_data_t key, value, never;
{
- st_table_entry *ptr, **last, *tmp;
- st_index_t i;
-
- for (i = 0; i < table->num_bins; i++) {
- ptr = *(last = &table->bins[i]);
- while (ptr != 0) {
- if (ptr->key == never) {
- tmp = ptr;
- *last = ptr = ptr->next;
- free(tmp);
- }
- else {
- ptr = *(last = &ptr->next);
- }
- }
- }
+ if (value == never) return ST_DELETE;
+ return ST_CONTINUE;
}
-int
-st_foreach(st_table *table, int (*func)(ANYARGS), st_data_t arg)
+void
+st_cleanup_safe(table, never)
+ st_table *table;
+ st_data_t never;
{
- st_table_entry *ptr, **last, *tmp;
- enum st_retval retval;
- st_index_t i;
-
- if (table->entries_packed) {
- for (i = 0; i < table->num_entries; i++) {
- st_index_t j;
- st_data_t key, val;
- key = (st_data_t)table->bins[i*2];
- val = (st_data_t)table->bins[i*2+1];
- retval = (*func)(key, val, arg);
- switch (retval) {
- case ST_CHECK: /* check if hash is modified during iteration */
- for (j = 0; j < table->num_entries; j++) {
- if ((st_data_t)table->bins[j*2] == key)
- break;
- }
- if (j == table->num_entries) {
- /* call func with error notice */
- retval = (*func)(0, 0, arg, 1);
- return 1;
- }
- /* fall through */
- case ST_CONTINUE:
- break;
- case ST_STOP:
- return 0;
- case ST_DELETE:
- table->num_entries--;
- memmove(&table->bins[i*2], &table->bins[(i+1)*2],
- sizeof(struct st_table_entry*) * 2*(table->num_entries-i));
- i--;
- break;
- }
- }
- return 0;
- }
+ int num_entries = table->num_entries;
- if ((ptr = table->head) != 0) {
- do {
- retval = (*func)(ptr->key, ptr->record, arg);
- switch (retval) {
- case ST_CHECK: /* check if hash is modified during iteration */
- i = ptr->hash % table->num_bins;
- for (tmp = table->bins[i]; tmp != ptr; tmp = tmp->next) {
- if (!tmp) {
- /* call func with error notice */
- retval = (*func)(0, 0, arg, 1);
- return 1;
- }
- }
- /* fall through */
- case ST_CONTINUE:
- ptr = ptr->fore;
- break;
- case ST_STOP:
- return 0;
- case ST_DELETE:
- last = &table->bins[ptr->hash % table->num_bins];
- for (; (tmp = *last) != 0; last = &tmp->next) {
- if (ptr == tmp) {
- tmp = ptr->fore;
- *last = ptr->next;
- REMOVE_ENTRY(table, ptr);
- free(ptr);
- if (ptr == tmp) return 0;
- ptr = tmp;
- break;
- }
- }
- }
- } while (ptr && table->head);
- }
- return 0;
+ st_foreach(table, delete_never, never);
+ table->num_entries = num_entries;
}
-#if 0 /* unused right now */
int
-st_reverse_foreach(st_table *table, int (*func)(ANYARGS), st_data_t arg)
+st_foreach(table, func, arg)
+ st_table *table;
+ int (*func)();
+ st_data_t arg;
{
- st_table_entry *ptr, **last, *tmp;
+ st_table_entry *ptr, *last, *tmp;
enum st_retval retval;
int i;
- if (table->entries_packed) {
- for (i = table->num_entries-1; 0 <= i; i--) {
- int j;
- st_data_t key, val;
- key = (st_data_t)table->bins[i*2];
- val = (st_data_t)table->bins[i*2+1];
- retval = (*func)(key, val, arg);
- switch (retval) {
- case ST_CHECK: /* check if hash is modified during iteration */
- for (j = 0; j < table->num_entries; j++) {
- if ((st_data_t)table->bins[j*2] == key)
- break;
- }
- if (j == table->num_entries) {
- /* call func with error notice */
- retval = (*func)(0, 0, arg, 1);
- return 1;
- }
- /* fall through */
- case ST_CONTINUE:
- break;
- case ST_STOP:
- return 0;
- case ST_DELETE:
- table->num_entries--;
- memmove(&table->bins[i*2], &table->bins[(i+1)*2],
- sizeof(struct st_table_entry*) * 2*(table->num_entries-i));
- break;
- }
- }
- return 0;
- }
-
- if ((ptr = table->head) != 0) {
- ptr = ptr->back;
- do {
- retval = (*func)(ptr->key, ptr->record, arg, 0);
+ for(i = 0; i < table->num_bins; i++) {
+ last = 0;
+ for(ptr = table->bins[i]; ptr != 0;) {
+ retval = (*func)(ptr->key, ptr->record, arg);
switch (retval) {
- case ST_CHECK: /* check if hash is modified during iteration */
- i = ptr->hash % table->num_bins;
- for (tmp = table->bins[i]; tmp != ptr; tmp = tmp->next) {
- if (!tmp) {
- /* call func with error notice */
- retval = (*func)(0, 0, arg, 1);
- return 1;
+ case ST_CHECK: /* check if hash is modified during iteration */
+ tmp = 0;
+ if (i < table->num_bins) {
+ for (tmp = table->bins[i]; tmp; tmp=tmp->next) {
+ if (tmp == ptr) break;
}
}
+ if (!tmp) {
+ /* call func with error notice */
+ return 1;
+ }
/* fall through */
- case ST_CONTINUE:
- ptr = ptr->back;
+ case ST_CONTINUE:
+ last = ptr;
+ ptr = ptr->next;
break;
- case ST_STOP:
- return 0;
- case ST_DELETE:
- last = &table->bins[ptr->hash % table->num_bins];
- for (; (tmp = *last) != 0; last = &tmp->next) {
- if (ptr == tmp) {
- tmp = ptr->back;
- *last = ptr->next;
- REMOVE_ENTRY(table, ptr);
- free(ptr);
- ptr = tmp;
- break;
- }
+ case ST_STOP:
+ return 0;
+ case ST_DELETE:
+ tmp = ptr;
+ if (last == 0) {
+ table->bins[i] = ptr->next;
+ }
+ else {
+ last->next = ptr->next;
}
ptr = ptr->next;
free(tmp);
table->num_entries--;
}
- } while (ptr && table->head);
+ }
}
return 0;
}
-#endif
-
-/*
- * hash_32 - 32 bit Fowler/Noll/Vo FNV-1a hash code
- *
- * @(#) $Hash32: Revision: 1.1 $
- * @(#) $Hash32: Id: hash_32a.c,v 1.1 2003/10/03 20:38:53 chongo Exp $
- * @(#) $Hash32: Source: /usr/local/src/cmd/fnv/RCS/hash_32a.c,v $
- *
- ***
- *
- * Fowler/Noll/Vo hash
- *
- * The basis of this hash algorithm was taken from an idea sent
- * as reviewer comments to the IEEE POSIX P1003.2 committee by:
- *
- * Phong Vo (http://www.research.att.com/info/kpv/)
- * Glenn Fowler (http://www.research.att.com/~gsf/)
- *
- * In a subsequent ballot round:
- *
- * Landon Curt Noll (http://www.isthe.com/chongo/)
- *
- * improved on their algorithm. Some people tried this hash
- * and found that it worked rather well. In an EMail message
- * to Landon, they named it the ``Fowler/Noll/Vo'' or FNV hash.
- *
- * FNV hashes are designed to be fast while maintaining a low
- * collision rate. The FNV speed allows one to quickly hash lots
- * of data while maintaining a reasonable collision rate. See:
- *
- * http://www.isthe.com/chongo/tech/comp/fnv/index.html
- *
- * for more details as well as other forms of the FNV hash.
- ***
- *
- * To use the recommended 32 bit FNV-1a hash, pass FNV1_32A_INIT as the
- * Fnv32_t hashval argument to fnv_32a_buf() or fnv_32a_str().
- *
- ***
- *
- * Please do not copyright this code. This code is in the public domain.
- *
- * LANDON CURT NOLL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO
- * EVENT SHALL LANDON CURT NOLL 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 TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- *
- * By:
- * chongo <Landon Curt Noll> /\oo/\
- * http://www.isthe.com/chongo/
- *
- * Share and Enjoy! :-)
- */
-
-/*
- * 32 bit FNV-1 and FNV-1a non-zero initial basis
- *
- * The FNV-1 initial basis is the FNV-0 hash of the following 32 octets:
- *
- * chongo <Landon Curt Noll> /\../\
- *
- * NOTE: The \'s above are not back-slashing escape characters.
- * They are literal ASCII backslash 0x5c characters.
- *
- * NOTE: The FNV-1a initial basis is the same value as FNV-1 by definition.
- */
-#define FNV1_32A_INIT 0x811c9dc5
-
-/*
- * 32 bit magic FNV-1a prime
- */
-#define FNV_32_PRIME 0x01000193
static int
-strhash(register const char *string)
+strhash(string)
+ register const char *string;
{
- register unsigned int hval = FNV1_32A_INIT;
+ register int c;
- /*
- * FNV-1a hash each octet in the buffer
- */
- while (*string) {
- /* xor the bottom with the current octet */
- hval ^= (unsigned int)*string++;
-
- /* multiply by the 32 bit FNV magic prime mod 2^32 */
- hval *= FNV_32_PRIME;
- }
- return hval;
-}
+#ifdef HASH_ELFHASH
+ register unsigned int h = 0, g;
-int
-st_strcasecmp(const char *s1, const char *s2)
-{
- unsigned int c1, c2;
-
- while (1) {
- c1 = (unsigned char)*s1++;
- c2 = (unsigned char)*s2++;
- if (c1 == '\0' || c2 == '\0') {
- if (c1 != '\0') return 1;
- if (c2 != '\0') return -1;
- return 0;
- }
- if ((unsigned int)(c1 - 'A') <= ('Z' - 'A')) c1 += 'a' - 'A';
- if ((unsigned int)(c2 - 'A') <= ('Z' - 'A')) c2 += 'a' - 'A';
- if (c1 != c2) {
- if (c1 > c2)
- return 1;
- else
- return -1;
- }
+ while ((c = *string++) != '\0') {
+ h = ( h << 4 ) + c;
+ if ( g = h & 0xF0000000 )
+ h ^= g >> 24;
+ h &= ~g;
}
-}
+ return h;
+#elif defined(HASH_PERL)
+ register int val = 0;
-int
-st_strncasecmp(const char *s1, const char *s2, size_t n)
-{
- unsigned int c1, c2;
-
- while (n--) {
- c1 = (unsigned char)*s1++;
- c2 = (unsigned char)*s2++;
- if (c1 == '\0' || c2 == '\0') {
- if (c1 != '\0') return 1;
- if (c2 != '\0') return -1;
- return 0;
- }
- if ((unsigned int)(c1 - 'A') <= ('Z' - 'A')) c1 += 'a' - 'A';
- if ((unsigned int)(c2 - 'A') <= ('Z' - 'A')) c2 += 'a' - 'A';
- if (c1 != c2) {
- if (c1 > c2)
- return 1;
- else
- return -1;
- }
+ while ((c = *string++) != '\0') {
+ val += c;
+ val += (val << 10);
+ val ^= (val >> 6);
}
- return 0;
-}
+ val += (val << 3);
+ val ^= (val >> 11);
-static int
-strcasehash(register const char *string)
-{
- register unsigned int hval = FNV1_32A_INIT;
-
- /*
- * FNV-1a hash each octet in the buffer
- */
- while (*string) {
- unsigned int c = (unsigned char)*string++;
- if ((unsigned int)(c - 'A') <= ('Z' - 'A')) c += 'a' - 'A';
- hval ^= c;
+ return val + (val << 15);
+#else
+ register int val = 0;
- /* multiply by the 32 bit FNV magic prime mod 2^32 */
- hval *= FNV_32_PRIME;
+ while ((c = *string++) != '\0') {
+ val = val*997 + c;
}
- return hval;
+
+ return val + (val>>5);
+#endif
}
-int
-st_numcmp(st_data_t x, st_data_t y)
+static int
+numcmp(x, y)
+ long x, y;
{
return x != y;
}
-int
-st_numhash(st_data_t n)
+static int
+numhash(n)
+ long n;
{
- return (int)n;
+ return n;
}
diff --git a/st.h b/st.h
new file mode 100644
index 0000000000..fb56f5ffad
--- /dev/null
+++ b/st.h
@@ -0,0 +1,72 @@
+/* This is a public domain general purpose hash table package written by Peter Moore @ UCB. */
+
+/* @(#) st.h 5.1 89/12/14 */
+
+#ifndef ST_INCLUDED
+
+#define ST_INCLUDED
+
+#if SIZEOF_LONG == SIZEOF_VOIDP
+typedef unsigned long st_data_t;
+#elif SIZEOF_LONG_LONG == SIZEOF_VOIDP
+typedef unsigned LONG_LONG st_data_t;
+#else
+# error ---->> st.c requires sizeof(void*) == sizeof(long) to be compiled. <<---
+-
+#endif
+#define ST_DATA_T_DEFINED
+
+typedef struct st_table st_table;
+
+struct st_hash_type {
+ int (*compare)();
+ int (*hash)();
+};
+
+struct st_table {
+ struct st_hash_type *type;
+ int num_bins;
+ int num_entries;
+ struct st_table_entry **bins;
+};
+
+#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};
+
+#ifndef _
+# define _(args) args
+#endif
+#ifndef ANYARGS
+# ifdef __cplusplus
+# define ANYARGS ...
+# else
+# define ANYARGS
+# endif
+#endif
+
+st_table *st_init_table _((struct st_hash_type *));
+st_table *st_init_table_with_size _((struct st_hash_type *, int));
+st_table *st_init_numtable _((void));
+st_table *st_init_numtable_with_size _((int));
+st_table *st_init_strtable _((void));
+st_table *st_init_strtable_with_size _((int));
+int st_delete _((st_table *, st_data_t *, st_data_t *));
+int st_delete_safe _((st_table *, st_data_t *, st_data_t *, st_data_t));
+int st_insert _((st_table *, st_data_t, st_data_t));
+int st_lookup _((st_table *, st_data_t, st_data_t *));
+int st_foreach _((st_table *, int (*)(ANYARGS), st_data_t));
+void st_add_direct _((st_table *, st_data_t, st_data_t));
+void st_free_table _((st_table *));
+void st_cleanup_safe _((st_table *, st_data_t));
+st_table *st_copy _((st_table *));
+
+#define ST_NUMCMP ((int (*)()) 0)
+#define ST_NUMHASH ((int (*)()) -2)
+
+#define st_numcmp ST_NUMCMP
+#define st_numhash ST_NUMHASH
+
+int st_strhash();
+
+#endif /* ST_INCLUDED */
diff --git a/strftime.c b/strftime.c
deleted file mode 100644
index 076822742b..0000000000
--- a/strftime.c
+++ /dev/null
@@ -1,1205 +0,0 @@
-/* -*- c-file-style: "linux" -*- */
-
-/*
- * strftime.c
- *
- * Public-domain implementation of ANSI C library routine.
- *
- * It's written in old-style C for maximal portability.
- * However, since I'm used to prototypes, I've included them too.
- *
- * If you want stuff in the System V ascftime routine, add the SYSV_EXT define.
- * For extensions from SunOS, add SUNOS_EXT.
- * For stuff needed to implement the P1003.2 date command, add POSIX2_DATE.
- * For VMS dates, add VMS_EXT.
- * For a an RFC822 time format, add MAILHEADER_EXT.
- * For ISO week years, add ISO_DATE_EXT.
- * For complete POSIX semantics, add POSIX_SEMANTICS.
- *
- * The code for %c, %x, and %X now follows the 1003.2 specification for
- * the POSIX locale.
- * This version ignores LOCALE information.
- * It also doesn't worry about multi-byte characters.
- * So there.
- *
- * This file is also shipped with GAWK (GNU Awk), gawk specific bits of
- * code are included if GAWK is defined.
- *
- * Arnold Robbins
- * January, February, March, 1991
- * Updated March, April 1992
- * Updated April, 1993
- * Updated February, 1994
- * Updated May, 1994
- * Updated January, 1995
- * Updated September, 1995
- * Updated January, 1996
- *
- * Fixes from ado@elsie.nci.nih.gov
- * February 1991, May 1992
- * Fixes from Tor Lillqvist tml@tik.vtt.fi
- * May, 1993
- * Further fixes from ado@elsie.nci.nih.gov
- * February 1994
- * %z code from chip@chinacat.unicom.com
- * Applied September 1995
- * %V code fixed (again) and %G, %g added,
- * January 1996
- */
-
-#include "ruby/ruby.h"
-#include "timev.h"
-
-#ifndef GAWK
-#include <stdio.h>
-#include <ctype.h>
-#include <string.h>
-#include <time.h>
-#include <sys/types.h>
-#include <errno.h>
-#endif
-#if defined(TM_IN_SYS_TIME) || !defined(GAWK)
-#include <sys/types.h>
-#if HAVE_SYS_TIME_H
-#include <sys/time.h>
-#endif
-#endif
-#include <math.h>
-
-/* defaults: season to taste */
-#define SYSV_EXT 1 /* stuff in System V ascftime routine */
-#define SUNOS_EXT 1 /* stuff in SunOS strftime routine */
-#define POSIX2_DATE 1 /* stuff in Posix 1003.2 date command */
-#define VMS_EXT 1 /* include %v for VMS date format */
-#define MAILHEADER_EXT 1 /* add %z for HHMM format */
-#define ISO_DATE_EXT 1 /* %G and %g for year of ISO week */
-#ifndef GAWK
-#define POSIX_SEMANTICS 1 /* call tzset() if TZ changes */
-#endif
-
-#if defined(ISO_DATE_EXT)
-#if ! defined(POSIX2_DATE)
-#define POSIX2_DATE 1
-#endif
-#endif
-
-#if defined(POSIX2_DATE)
-#if ! defined(SYSV_EXT)
-#define SYSV_EXT 1
-#endif
-#if ! defined(SUNOS_EXT)
-#define SUNOS_EXT 1
-#endif
-#endif
-
-#if defined(POSIX2_DATE)
-#define adddecl(stuff) stuff
-#else
-#define adddecl(stuff)
-#endif
-
-#undef strchr /* avoid AIX weirdness */
-
-#if !defined __STDC__ && !defined _WIN32
-#define const /**/
-static int weeknumber();
-adddecl(static int iso8601wknum();)
-static int weeknumber_v();
-adddecl(static int iso8601wknum_v();)
-#else
-static int weeknumber(const struct tm *timeptr, int firstweekday);
-adddecl(static int iso8601wknum(const struct tm *timeptr);)
-static int weeknumber_v(const struct vtm *vtm, int firstweekday);
-adddecl(static int iso8601wknum_v(const struct vtm *vtm);)
-#endif
-
-#ifdef STDC_HEADERS
-#include <stdlib.h>
-#include <string.h>
-#else
-extern void *malloc();
-extern void *realloc();
-extern char *getenv();
-extern char *strchr();
-#endif
-
-#define range(low, item, hi) max(low, min(item, hi))
-
-#if defined __WIN32__ || defined _WIN32
-#define DLL_IMPORT __declspec(dllimport)
-#endif
-#ifndef DLL_IMPORT
-#define DLL_IMPORT
-#endif
-#if !defined(OS2) && defined(HAVE_TZNAME)
-extern DLL_IMPORT char *tzname[2];
-#ifdef HAVE_DAYLIGHT
-extern DLL_IMPORT int daylight;
-#endif
-#ifdef HAVE_VAR_TIMEZONE
-extern DLL_IMPORT TYPEOF_VAR_TIMEZONE timezone;
-#endif
-#ifdef HAVE_VAR_ALTZONE
-extern DLL_IMPORT TYPEOF_VAR_ALTZONE altzone;
-#endif
-#endif
-
-#undef min /* just in case */
-
-/* min --- return minimum of two numbers */
-
-#ifndef __STDC__
-static inline int
-min(a, b)
-int a, b;
-#else
-static inline int
-min(int a, int b)
-#endif
-{
- return (a < b ? a : b);
-}
-
-#undef max /* also, just in case */
-
-/* max --- return maximum of two numbers */
-
-#ifndef __STDC__
-static inline int
-max(a, b)
-int a, b;
-#else
-static inline int
-max(int a, int b)
-#endif
-{
- return (a > b ? a : b);
-}
-
-#ifdef NO_STRING_LITERAL_CONCATENATION
-#error No string literal concatenation
-#endif
-
-#define add(x,y) (rb_funcall((x), '+', 1, (y)))
-#define sub(x,y) (rb_funcall((x), '-', 1, (y)))
-#define mul(x,y) (rb_funcall((x), '*', 1, (y)))
-#define quo(x,y) (rb_funcall((x), rb_intern("quo"), 1, (y)))
-#define div(x,y) (rb_funcall((x), rb_intern("div"), 1, (y)))
-#define mod(x,y) (rb_funcall((x), '%', 1, (y)))
-
-/* strftime --- produce formatted time */
-
-size_t
-rb_strftime(char *s, size_t maxsize, const char *format, const struct vtm *vtm, VALUE timev, int gmt)
-{
- char *endp = s + maxsize;
- char *start = s;
- const char *sp, *tp;
- auto char tbuf[100];
- long off;
- int i, w;
- long y;
- static short first = 1;
-#ifdef POSIX_SEMANTICS
- static char *savetz = NULL;
- static size_t savetzlen = 0;
- char *tz;
-#endif /* POSIX_SEMANTICS */
-#ifndef HAVE_TM_ZONE
-#ifndef HAVE_TM_NAME
-#if ((defined(MAILHEADER_EXT) && !HAVE_VAR_TIMEZONE && HAVE_GETTIMEOFDAY) || \
- (!HAVE_TZNAME && HAVE_TIMEZONE))
- struct timeval tv;
- struct timezone zone;
-#endif
-#endif /* HAVE_TM_NAME */
-#endif /* HAVE_TM_ZONE */
- int precision, flags;
- char padding;
- enum {LEFT, CHCASE, LOWER, UPPER, LOCALE_O, LOCALE_E};
-#define BIT_OF(n) (1U<<(n))
-
- /* various tables, useful in North America */
- static const char days_l[][10] = {
- "Sunday", "Monday", "Tuesday", "Wednesday",
- "Thursday", "Friday", "Saturday",
- };
- static const char months_l[][10] = {
- "January", "February", "March", "April",
- "May", "June", "July", "August", "September",
- "October", "November", "December",
- };
- static const char ampm[][3] = { "AM", "PM", };
-
- if (s == NULL || format == NULL || vtm == NULL || maxsize == 0)
- return 0;
-
- /* quick check if we even need to bother */
- if (strchr(format, '%') == NULL && strlen(format) + 1 >= maxsize) {
- err:
- errno = ERANGE;
- return 0;
- }
-
-#ifndef POSIX_SEMANTICS
- if (first) {
- tzset();
- first = 0;
- }
-#else /* POSIX_SEMANTICS */
- tz = getenv("TZ");
- if (first) {
- if (tz != NULL) {
- size_t tzlen = strlen(tz);
-
- savetz = (char *) malloc(tzlen + 1);
- if (savetz != NULL) {
- savetzlen = tzlen + 1;
- memcpy(savetz, tz, savetzlen);
- }
- }
- tzset();
- first = 0;
- }
- /* if we have a saved TZ, and it is different, recapture and reset */
- if (tz && savetz && (tz[0] != savetz[0] || strcmp(tz, savetz) != 0)) {
- size_t i = strlen(tz) + 1;
- if (i > savetzlen) {
- savetz = (char *) realloc(savetz, i);
- if (savetz) {
- savetzlen = i;
- memcpy(savetz, tz, i);
- }
- } else
- memcpy(savetz, tz, i);
- tzset();
- }
-#endif /* POSIX_SEMANTICS */
-
- for (; *format && s < endp - 1; format++) {
-#define FLAG_FOUND() do { \
- if (precision > 0 || flags & (BIT_OF(LOCALE_E)|BIT_OF(LOCALE_O))) \
- goto unknown; \
- } while (0)
-#define NEEDS(n) do if (s + (n) >= endp - 1) goto err; while (0)
-#define FILL_PADDING(i) do { \
- if (!(flags & BIT_OF(LEFT)) && precision > i) { \
- NEEDS(precision); \
- memset(s, padding ? padding : ' ', precision - i); \
- s += precision - i; \
- } \
- else { \
- NEEDS(i); \
- } \
-} while (0);
-#define FMT(def_pad, def_prec, fmt, val) \
- do { \
- int l; \
- if (precision <= 0) precision = (def_prec); \
- if (flags & BIT_OF(LEFT)) precision = 1; \
- l = snprintf(s, endp - s, \
- ((padding == '0' || (!padding && def_pad == '0')) ? "%0*"fmt : "%*"fmt), \
- precision, val); \
- if (l < 0) goto err; \
- s += l; \
- } while (0)
-#define STRFTIME(fmt) \
- do { \
- i = rb_strftime(s, endp - s, fmt, vtm, timev, gmt); \
- if (!i) return 0; \
- if (precision > i) {\
- memmove(s + precision - i, s, i);\
- memset(s, padding ? padding : ' ', precision - i); \
- s += precision; \
- }\
- else s += i; \
- } while (0)
-#define FMTV(def_pad, def_prec, fmt, val) \
- do { \
- VALUE tmp = (val); \
- if (FIXNUM_P(tmp)) { \
- FMT((def_pad), (def_prec), "l"fmt, FIX2LONG(tmp)); \
- } \
- else { \
- VALUE args[2], result; \
- size_t l; \
- if (precision <= 0) precision = (def_prec); \
- if (flags & BIT_OF(LEFT)) precision = 1; \
- args[0] = INT2FIX(precision); \
- args[1] = val; \
- if (padding == '0' || (!padding && def_pad == '0')) \
- result = rb_str_format(2, args, rb_str_new2("%0*"fmt)); \
- else \
- result = rb_str_format(2, args, rb_str_new2("%*"fmt)); \
- l = strlcpy(s, StringValueCStr(result), endp-s); \
- if ((size_t)(endp-s) <= l) \
- goto err; \
- s += l; \
- } \
- } while (0)
-
- if (*format != '%') {
- *s++ = *format;
- continue;
- }
- tp = tbuf;
- sp = format;
- precision = -1;
- flags = 0;
- padding = 0;
- again:
- switch (*++format) {
- case '\0':
- format--;
- goto unknown;
-
- case '%':
- FILL_PADDING(1);
- *s++ = '%';
- continue;
-
- case 'a': /* abbreviated weekday name */
- if (flags & BIT_OF(CHCASE)) {
- flags &= ~(BIT_OF(LOWER)|BIT_OF(CHCASE));
- flags |= BIT_OF(UPPER);
- }
- if (vtm->wday < 0 || vtm->wday > 6)
- i = 1, tp = "?";
- else
- i = 3, tp = days_l[vtm->wday];
- break;
-
- case 'A': /* full weekday name */
- if (flags & BIT_OF(CHCASE)) {
- flags &= ~(BIT_OF(LOWER)|BIT_OF(CHCASE));
- flags |= BIT_OF(UPPER);
- }
- if (vtm->wday < 0 || vtm->wday > 6)
- i = 1, tp = "?";
- else
- i = strlen(tp = days_l[vtm->wday]);
- break;
-
-#ifdef SYSV_EXT
- case 'h': /* abbreviated month name */
-#endif
- case 'b': /* abbreviated month name */
- if (flags & BIT_OF(CHCASE)) {
- flags &= ~(BIT_OF(LOWER)|BIT_OF(CHCASE));
- flags |= BIT_OF(UPPER);
- }
- if (vtm->mon < 1 || vtm->mon > 12)
- i = 1, tp = "?";
- else
- i = 3, tp = months_l[vtm->mon-1];
- break;
-
- case 'B': /* full month name */
- if (flags & BIT_OF(CHCASE)) {
- flags &= ~(BIT_OF(LOWER)|BIT_OF(CHCASE));
- flags |= BIT_OF(UPPER);
- }
- if (vtm->mon < 1 || vtm->mon > 12)
- i = 1, tp = "?";
- else
- i = strlen(tp = months_l[vtm->mon-1]);
- break;
-
- case 'c': /* appropriate date and time representation */
- STRFTIME("%a %b %e %H:%M:%S %Y");
- continue;
-
- case 'd': /* day of the month, 01 - 31 */
- i = range(1, vtm->mday, 31);
- FMT('0', 2, "d", i);
- continue;
-
- case 'H': /* hour, 24-hour clock, 00 - 23 */
- i = range(0, vtm->hour, 23);
- FMT('0', 2, "d", i);
- continue;
-
- case 'I': /* hour, 12-hour clock, 01 - 12 */
- i = range(0, vtm->hour, 23);
- if (i == 0)
- i = 12;
- else if (i > 12)
- i -= 12;
- FMT('0', 2, "d", i);
- continue;
-
- case 'j': /* day of the year, 001 - 366 */
- FMT('0', 3, "d", vtm->yday);
- continue;
-
- case 'm': /* month, 01 - 12 */
- i = range(1, vtm->mon, 12);
- FMT('0', 2, "d", i);
- continue;
-
- case 'M': /* minute, 00 - 59 */
- i = range(0, vtm->min, 59);
- FMT('0', 2, "d", i);
- continue;
-
- case 'p': /* AM or PM based on 12-hour clock */
- case 'P': /* am or pm based on 12-hour clock */
- if ((*format == 'p' && (flags & BIT_OF(CHCASE))) ||
- (*format == 'P' && !(flags & (BIT_OF(CHCASE)|BIT_OF(UPPER))))) {
- flags &= ~(BIT_OF(UPPER)|BIT_OF(CHCASE));
- flags |= BIT_OF(LOWER);
- }
- i = range(0, vtm->hour, 23);
- if (i < 12)
- tp = ampm[0];
- else
- tp = ampm[1];
- i = 2;
- break;
-
- case 's':
- {
- VALUE sec = div(timev, INT2FIX(1));
- FMTV('0', 1, "d", sec);
- continue;
- }
-
- case 'S': /* second, 00 - 60 */
- i = range(0, vtm->sec, 60);
- FMT('0', 2, "d", i);
- continue;
-
- case 'U': /* week of year, Sunday is first day of week */
- FMT('0', 2, "d", weeknumber_v(vtm, 0));
- continue;
-
- case 'w': /* weekday, Sunday == 0, 0 - 6 */
- i = range(0, vtm->wday, 6);
- FMT('0', 1, "d", i);
- continue;
-
- case 'W': /* week of year, Monday is first day of week */
- FMT('0', 2, "d", weeknumber_v(vtm, 1));
- continue;
-
- case 'x': /* appropriate date representation */
- STRFTIME("%m/%d/%y");
- continue;
-
- case 'X': /* appropriate time representation */
- STRFTIME("%H:%M:%S");
- continue;
-
- case 'y': /* year without a century, 00 - 99 */
- i = NUM2INT(mod(vtm->year, INT2FIX(100)));
- FMT('0', 2, "d", i);
- continue;
-
- case 'Y': /* year with century */
- FMTV('0', 1, "d", vtm->year);
- continue;
-
-#ifdef MAILHEADER_EXT
- /*
- * From: Chip Rosenthal <chip@chinacat.unicom.com>
- * Date: Sun, 19 Mar 1995 00:33:29 -0600 (CST)
- *
- * Warning: the %z [code] is implemented by inspecting the
- * timezone name conditional compile settings, and
- * inferring a method to get timezone offsets. I've tried
- * this code on a couple of machines, but I don't doubt
- * there is some system out there that won't like it.
- * Maybe the easiest thing to do would be to bracket this
- * with an #ifdef that can turn it off. The %z feature
- * would be an admittedly obscure one that most folks can
- * live without, but it would be a great help to those of
- * us that muck around with various message processors.
- */
- case 'z': /* time zone offset east of GMT e.g. -0600 */
- if (precision < 4) precision = 4;
- NEEDS(precision + 1);
- if (gmt) {
- off = 0;
- }
- else {
- off = NUM2LONG(rb_funcall(quo(vtm->utc_offset, INT2FIX(60)), rb_intern("round"), 0));
-#if 0
-#ifdef HAVE_TM_NAME
- /*
- * Systems with tm_name probably have tm_tzadj as
- * secs west of GMT. Convert to mins east of GMT.
- */
- off = -timeptr->tm_tzadj / 60;
-#else /* !HAVE_TM_NAME */
-#ifdef HAVE_TM_ZONE
- /*
- * Systems with tm_zone probably have tm_gmtoff as
- * secs east of GMT. Convert to mins east of GMT.
- */
- off = timeptr->tm_gmtoff / 60;
-#else /* !HAVE_TM_ZONE */
-#if HAVE_VAR_TIMEZONE
-#if HAVE_VAR_ALTZONE
- off = -(daylight ? timezone : altzone) / 60;
-#else
- off = -timezone / 60;
-#endif
-#else /* !HAVE_VAR_TIMEZONE */
-#ifdef HAVE_GETTIMEOFDAY
- gettimeofday(&tv, &zone);
- off = -zone.tz_minuteswest;
-#else
- /* no timezone info, then calc by myself */
- {
- struct tm utc;
- time_t now;
- time(&now);
- utc = *gmtime(&now);
- off = (long)((now - mktime(&utc)) / 60);
- }
-#endif
-#endif /* !HAVE_VAR_TIMEZONE */
-#endif /* !HAVE_TM_ZONE */
-#endif /* !HAVE_TM_NAME */
-#endif /* 0 */
- }
- if (off < 0) {
- off = -off;
- *s++ = '-';
- } else {
- *s++ = '+';
- }
- off = off/60*100 + off%60;
- i = snprintf(s, endp - s, (padding == ' ' ? "%*ld" : "%.*ld"),
- precision - (precision > 4), off);
- if (i < 0) goto err;
- s += i;
- continue;
-#endif /* MAILHEADER_EXT */
-
- case 'Z': /* time zone name or abbrevation */
- if (flags & BIT_OF(CHCASE)) {
- flags &= ~(BIT_OF(UPPER)|BIT_OF(CHCASE));
- flags |= BIT_OF(LOWER);
- }
- if (gmt) {
- i = 3;
- tp = "UTC";
- break;
- }
-#if 0
-#ifdef HAVE_TZNAME
- i = (daylight && timeptr->tm_isdst > 0); /* 0 or 1 */
- tp = tzname[i];
-#else
-#ifdef HAVE_TM_ZONE
- tp = timeptr->tm_zone;
-#else
-#ifdef HAVE_TM_NAME
- tp = timeptr->tm_name;
-#else
-#ifdef HAVE_TIMEZONE
- gettimeofday(& tv, & zone);
-#ifdef TIMEZONE_VOID
- tp = timezone();
-#else
- tp = timezone(zone.tz_minuteswest, timeptr->tm_isdst > 0);
-#endif /* TIMEZONE_VOID */
-#endif /* HAVE_TIMEZONE */
-#endif /* HAVE_TM_NAME */
-#endif /* HAVE_TM_ZONE */
-#endif /* HAVE_TZNAME */
-#endif /* 0 */
- if (vtm->zone == NULL)
- tp = "";
- else
- tp = vtm->zone;
- i = strlen(tp);
- break;
-
-#ifdef SYSV_EXT
- case 'n': /* same as \n */
- FILL_PADDING(1);
- *s++ = '\n';
- continue;
-
- case 't': /* same as \t */
- FILL_PADDING(1);
- *s++ = '\t';
- continue;
-
- case 'D': /* date as %m/%d/%y */
- STRFTIME("%m/%d/%y");
- continue;
-
- case 'e': /* day of month, blank padded */
- FMT(' ', 2, "d", range(1, vtm->mday, 31));
- continue;
-
- case 'r': /* time as %I:%M:%S %p */
- STRFTIME("%I:%M:%S %p");
- continue;
-
- case 'R': /* time as %H:%M */
- STRFTIME("%H:%M");
- continue;
-
- case 'T': /* time as %H:%M:%S */
- STRFTIME("%H:%M:%S");
- continue;
-#endif
-
-#ifdef SUNOS_EXT
- case 'k': /* hour, 24-hour clock, blank pad */
- i = range(0, vtm->hour, 23);
- FMT(' ', 2, "d", i);
- continue;
-
- case 'l': /* hour, 12-hour clock, 1 - 12, blank pad */
- i = range(0, vtm->hour, 23);
- if (i == 0)
- i = 12;
- else if (i > 12)
- i -= 12;
- FMT(' ', 2, "d", i);
- continue;
-#endif
-
-
-#ifdef VMS_EXT
- case 'v': /* date as dd-bbb-YYYY */
- STRFTIME("%e-%^b-%4Y");
- continue;
-#endif
-
-
-#ifdef POSIX2_DATE
- case 'C':
- FMTV('0', 2, "d", div(vtm->year, INT2FIX(100)));
- continue;
-
- case 'E':
- /* POSIX locale extensions, ignored for now */
- flags |= BIT_OF(LOCALE_E);
- goto again;
- case 'O':
- /* POSIX locale extensions, ignored for now */
- flags |= BIT_OF(LOCALE_O);
- goto again;
-
- case 'V': /* week of year according ISO 8601 */
- FMT('0', 2, "d", iso8601wknum_v(vtm));
- continue;
-
- case 'u':
- /* ISO 8601: Weekday as a decimal number [1 (Monday) - 7] */
- FMT('0', 1, "d", vtm->wday == 0 ? 7 : vtm->wday);
- continue;
-#endif /* POSIX2_DATE */
-
-#ifdef ISO_DATE_EXT
- case 'G':
- case 'g':
- /*
- * Year of ISO week.
- *
- * If it's December but the ISO week number is one,
- * that week is in next year.
- * If it's January but the ISO week number is 52 or
- * 53, that week is in last year.
- * Otherwise, it's this year.
- */
- {
- VALUE yv = vtm->year;
- w = iso8601wknum_v(vtm);
- if (vtm->mon == 12 && w == 1)
- yv = add(yv, INT2FIX(1));
- else if (vtm->mon == 1 && w >= 52)
- yv = sub(yv, INT2FIX(1));
-
- if (*format == 'G') {
- FMTV('0', 1, "d", yv);
- }
- else {
- yv = mod(yv, INT2FIX(100));
- y = FIX2LONG(yv);
- FMT('0', 2, "ld", y);
- }
- continue;
- }
-
-#endif /* ISO_DATE_EXT */
-
-
- case 'L':
- w = 3;
- goto subsec;
-
- case 'N':
- /*
- * fractional second digits. default is 9 digits
- * (nanosecond).
- *
- * %3N millisecond (3 digits)
- * %6N microsecond (6 digits)
- * %9N nanosecond (9 digits)
- */
- w = 9;
- subsec:
- {
- VALUE subsec = mod(timev, INT2FIX(1));
- int ww;
- long n;
-
- if (precision <= 0) {
- precision = w;
- }
- NEEDS(precision);
-
- ww = precision;
- while (9 <= ww) {
- subsec = mul(subsec, INT2FIX(1000000000));
- ww -= 9;
- }
- n = 1;
- for (; 0 < ww; ww--)
- n *= 10;
- if (n != 1)
- subsec = mul(subsec, INT2FIX(n));
- subsec = div(subsec, INT2FIX(1));
-
- if (FIXNUM_P(subsec)) {
- int l;
- l = snprintf(s, endp - s, "%0*ld", precision, FIX2LONG(subsec));
- s += precision;
- }
- else {
- VALUE args[2], result;
- size_t l;
- args[0] = INT2FIX(precision);
- args[1] = subsec;
- result = rb_str_format(2, args, rb_str_new2("%0*d"));
- l = strlcpy(s, StringValueCStr(result), endp-s);
- s += precision;
- }
- }
- continue;
-
- case 'F': /* Equivalent to %Y-%m-%d */
- STRFTIME("%Y-%m-%d");
- continue;
-
- case '-':
- FLAG_FOUND();
- flags |= BIT_OF(LEFT);
- padding = precision = 0;
- goto again;
-
- case '^':
- FLAG_FOUND();
- flags |= BIT_OF(UPPER);
- goto again;
-
- case '#':
- FLAG_FOUND();
- flags |= BIT_OF(CHCASE);
- goto again;
-
- case '_':
- FLAG_FOUND();
- padding = ' ';
- goto again;
-
- case '0':
- padding = '0';
- case '1': case '2': case '3': case '4':
- case '5': case '6': case '7': case '8': case '9':
- {
- char *e;
- precision = (int)strtoul(format, &e, 10);
- format = e - 1;
- goto again;
- }
-
- default:
- unknown:
- i = format - sp + 1;
- tp = sp;
- precision = -1;
- flags = 0;
- padding = 0;
- break;
- }
- if (i) {
- FILL_PADDING(i);
- memcpy(s, tp, i);
- switch (flags & (BIT_OF(UPPER)|BIT_OF(LOWER))) {
- case BIT_OF(UPPER):
- do {
- if (ISLOWER(*s)) *s = TOUPPER(*s);
- } while (s++, --i);
- break;
- case BIT_OF(LOWER):
- do {
- if (ISUPPER(*s)) *s = TOLOWER(*s);
- } while (s++, --i);
- break;
- default:
- s += i;
- break;
- }
- }
- }
- if (s >= endp) {
- goto err;
- }
- if (*format == '\0') {
- *s = '\0';
- return (s - start);
- } else
- return 0;
-}
-
-/* isleap --- is a year a leap year? */
-
-#ifndef __STDC__
-static int
-isleap(year)
-long year;
-#else
-static int
-isleap(long year)
-#endif
-{
- return ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0);
-}
-
-
-static void
-vtm2tm_noyear(const struct vtm *vtm, struct tm *result)
-{
- struct tm tm;
-
- /* for isleap() in iso8601wknum. +100 is -1900 (mod 400). */
- tm.tm_year = FIX2INT(mod(vtm->year, INT2FIX(400))) + 100;
-
- tm.tm_mon = vtm->mon-1;
- tm.tm_mday = vtm->mday;
- tm.tm_hour = vtm->hour;
- tm.tm_min = vtm->min;
- tm.tm_sec = vtm->sec;
- tm.tm_wday = vtm->wday;
- tm.tm_yday = vtm->yday-1;
- tm.tm_isdst = vtm->isdst;
-#if defined(HAVE_STRUCT_TM_TM_GMTOFF)
- tm.tm_gmtoff = NUM2LONG(vtm->utc_offset);
-#endif
-#if defined(HAVE_TM_ZONE)
- tm.tm_zone = (char *)vtm->zone;
-#endif
- *result = tm;
-}
-
-#ifdef POSIX2_DATE
-/* iso8601wknum --- compute week number according to ISO 8601 */
-
-#ifndef __STDC__
-static int
-iso8601wknum(timeptr)
-const struct tm *timeptr;
-#else
-static int
-iso8601wknum(const struct tm *timeptr)
-#endif
-{
- /*
- * From 1003.2:
- * If the week (Monday to Sunday) containing January 1
- * has four or more days in the new year, then it is week 1;
- * otherwise it is the highest numbered week of the previous
- * year (52 or 53), and the next week is week 1.
- *
- * ADR: This means if Jan 1 was Monday through Thursday,
- * it was week 1, otherwise week 52 or 53.
- *
- * XPG4 erroneously included POSIX.2 rationale text in the
- * main body of the standard. Thus it requires week 53.
- */
-
- int weeknum, jan1day;
-
- /* get week number, Monday as first day of the week */
- weeknum = weeknumber(timeptr, 1);
-
- /*
- * With thanks and tip of the hatlo to tml@tik.vtt.fi
- *
- * What day of the week does January 1 fall on?
- * We know that
- * (timeptr->tm_yday - jan1.tm_yday) MOD 7 ==
- * (timeptr->tm_wday - jan1.tm_wday) MOD 7
- * and that
- * jan1.tm_yday == 0
- * and that
- * timeptr->tm_wday MOD 7 == timeptr->tm_wday
- * from which it follows that. . .
- */
- jan1day = timeptr->tm_wday - (timeptr->tm_yday % 7);
- if (jan1day < 0)
- jan1day += 7;
-
- /*
- * If Jan 1 was a Monday through Thursday, it was in
- * week 1. Otherwise it was last year's highest week, which is
- * this year's week 0.
- *
- * What does that mean?
- * If Jan 1 was Monday, the week number is exactly right, it can
- * never be 0.
- * If it was Tuesday through Thursday, the weeknumber is one
- * less than it should be, so we add one.
- * Otherwise, Friday, Saturday or Sunday, the week number is
- * OK, but if it is 0, it needs to be 52 or 53.
- */
- switch (jan1day) {
- case 1: /* Monday */
- break;
- case 2: /* Tuesday */
- case 3: /* Wednesday */
- case 4: /* Thursday */
- weeknum++;
- break;
- case 5: /* Friday */
- case 6: /* Saturday */
- case 0: /* Sunday */
- if (weeknum == 0) {
-#ifdef USE_BROKEN_XPG4
- /* XPG4 (as of March 1994) says 53 unconditionally */
- weeknum = 53;
-#else
- /* get week number of last week of last year */
- struct tm dec31ly; /* 12/31 last year */
- dec31ly = *timeptr;
- dec31ly.tm_year--;
- dec31ly.tm_mon = 11;
- dec31ly.tm_mday = 31;
- dec31ly.tm_wday = (jan1day == 0) ? 6 : jan1day - 1;
- dec31ly.tm_yday = 364 + isleap(dec31ly.tm_year + 1900L);
- weeknum = iso8601wknum(& dec31ly);
-#endif
- }
- break;
- }
-
- if (timeptr->tm_mon == 11) {
- /*
- * The last week of the year
- * can be in week 1 of next year.
- * Sigh.
- *
- * This can only happen if
- * M T W
- * 29 30 31
- * 30 31
- * 31
- */
- int wday, mday;
-
- wday = timeptr->tm_wday;
- mday = timeptr->tm_mday;
- if ( (wday == 1 && (mday >= 29 && mday <= 31))
- || (wday == 2 && (mday == 30 || mday == 31))
- || (wday == 3 && mday == 31))
- weeknum = 1;
- }
-
- return weeknum;
-}
-
-static int
-iso8601wknum_v(const struct vtm *vtm)
-{
- struct tm tm;
- vtm2tm_noyear(vtm, &tm);
- return iso8601wknum(&tm);
-}
-
-#endif
-
-/* weeknumber --- figure how many weeks into the year */
-
-/* With thanks and tip of the hatlo to ado@elsie.nci.nih.gov */
-
-#ifndef __STDC__
-static int
-weeknumber(timeptr, firstweekday)
-const struct tm *timeptr;
-int firstweekday;
-#else
-static int
-weeknumber(const struct tm *timeptr, int firstweekday)
-#endif
-{
- int wday = timeptr->tm_wday;
- int ret;
-
- if (firstweekday == 1) {
- if (wday == 0) /* sunday */
- wday = 6;
- else
- wday--;
- }
- ret = ((timeptr->tm_yday + 7 - wday) / 7);
- if (ret < 0)
- ret = 0;
- return ret;
-}
-
-static int
-weeknumber_v(const struct vtm *vtm, int firstweekday)
-{
- struct tm tm;
- vtm2tm_noyear(vtm, &tm);
- return weeknumber(&tm, firstweekday);
-}
-
-#if 0
-/* ADR --- I'm loathe to mess with ado's code ... */
-
-Date: Wed, 24 Apr 91 20:54:08 MDT
-From: Michal Jaegermann <audfax!emory!vm.ucs.UAlberta.CA!NTOMCZAK>
-To: arnold@audiofax.com
-
-Hi Arnold,
-in a process of fixing of strftime() in libraries on Atari ST I grabbed
-some pieces of code from your own strftime. When doing that it came
-to mind that your weeknumber() function compiles a little bit nicer
-in the following form:
-/*
- * firstweekday is 0 if starting in Sunday, non-zero if in Monday
- */
-{
- return (timeptr->tm_yday - timeptr->tm_wday +
- (firstweekday ? (timeptr->tm_wday ? 8 : 1) : 7)) / 7;
-}
-How nicer it depends on a compiler, of course, but always a tiny bit.
-
- Cheers,
- Michal
- ntomczak@vm.ucs.ualberta.ca
-#endif
-
-#ifdef TEST_STRFTIME
-
-/*
- * NAME:
- * tst
- *
- * SYNOPSIS:
- * tst
- *
- * DESCRIPTION:
- * "tst" is a test driver for the function "strftime".
- *
- * OPTIONS:
- * None.
- *
- * AUTHOR:
- * Karl Vogel
- * Control Data Systems, Inc.
- * vogelke@c-17igp.wpafb.af.mil
- *
- * BUGS:
- * None noticed yet.
- *
- * COMPILE:
- * cc -o tst -DTEST_STRFTIME strftime.c
- */
-
-/* ADR: I reformatted this to my liking, and deleted some unneeded code. */
-
-#ifndef NULL
-#include <stdio.h>
-#endif
-#include <sys/time.h>
-#include <string.h>
-
-#define MAXTIME 132
-
-/*
- * Array of time formats.
- */
-
-static char *array[] =
-{
- "(%%A) full weekday name, var length (Sunday..Saturday) %A",
- "(%%B) full month name, var length (January..December) %B",
- "(%%C) Century %C",
- "(%%D) date (%%m/%%d/%%y) %D",
- "(%%E) Locale extensions (ignored) %E",
- "(%%H) hour (24-hour clock, 00..23) %H",
- "(%%I) hour (12-hour clock, 01..12) %I",
- "(%%M) minute (00..59) %M",
- "(%%O) Locale extensions (ignored) %O",
- "(%%R) time, 24-hour (%%H:%%M) %R",
- "(%%S) second (00..60) %S",
- "(%%T) time, 24-hour (%%H:%%M:%%S) %T",
- "(%%U) week of year, Sunday as first day of week (00..53) %U",
- "(%%V) week of year according to ISO 8601 %V",
- "(%%W) week of year, Monday as first day of week (00..53) %W",
- "(%%X) appropriate locale time representation (%H:%M:%S) %X",
- "(%%Y) year with century (1970...) %Y",
- "(%%Z) timezone (EDT), or blank if timezone not determinable %Z",
- "(%%a) locale's abbreviated weekday name (Sun..Sat) %a",
- "(%%b) locale's abbreviated month name (Jan..Dec) %b",
- "(%%c) full date (Sat Nov 4 12:02:33 1989)%n%t%t%t %c",
- "(%%d) day of the month (01..31) %d",
- "(%%e) day of the month, blank-padded ( 1..31) %e",
- "(%%h) should be same as (%%b) %h",
- "(%%j) day of the year (001..366) %j",
- "(%%k) hour, 24-hour clock, blank pad ( 0..23) %k",
- "(%%l) hour, 12-hour clock, blank pad ( 0..12) %l",
- "(%%m) month (01..12) %m",
- "(%%p) locale's AM or PM based on 12-hour clock %p",
- "(%%r) time, 12-hour (same as %%I:%%M:%%S %%p) %r",
- "(%%u) ISO 8601: Weekday as decimal number [1 (Monday) - 7] %u",
- "(%%v) VMS date (dd-bbb-YYYY) %v",
- "(%%w) day of week (0..6, Sunday == 0) %w",
- "(%%x) appropriate locale date representation %x",
- "(%%y) last two digits of year (00..99) %y",
- "(%%z) timezone offset east of GMT as HHMM (e.g. -0500) %z",
- (char *) NULL
-};
-
-/* main routine. */
-
-int
-main(argc, argv)
-int argc;
-char **argv;
-{
- long time();
-
- char *next;
- char string[MAXTIME];
-
- int k;
- int length;
-
- struct tm *tm;
-
- long clock;
-
- /* Call the function. */
-
- clock = time((long *) 0);
- tm = localtime(&clock);
-
- for (k = 0; next = array[k]; k++) {
- length = strftime(string, MAXTIME, next, tm);
- printf("%s\n", string);
- }
-
- exit(0);
-}
-#endif /* TEST_STRFTIME */
diff --git a/string.c b/string.c
index 493ef5d87b..4de0954a46 100644
--- a/string.c
+++ b/string.c
@@ -3,18 +3,17 @@
string.c -
$Author$
+ $Date$
created at: Mon Aug 9 17:12:58 JST 1993
- Copyright (C) 1993-2007 Yukihiro Matsumoto
+ Copyright (C) 1993-2003 Yukihiro Matsumoto
Copyright (C) 2000 Network Applied Communication Laboratory, Inc.
Copyright (C) 2000 Information-technology Promotion Agency, Japan
**********************************************************************/
-#include "ruby/ruby.h"
-#include "ruby/re.h"
-#include "ruby/encoding.h"
-#include <assert.h>
+#include "ruby.h"
+#include "re.h"
#define BEG(no) regs->beg[no]
#define END(no) regs->end[no]
@@ -26,365 +25,60 @@
#include <unistd.h>
#endif
-#undef rb_str_new_cstr
-#undef rb_tainted_str_new_cstr
-#undef rb_usascii_str_new_cstr
-#undef rb_external_str_new_cstr
-#undef rb_locale_str_new_cstr
-#undef rb_str_new2
-#undef rb_str_new3
-#undef rb_str_new4
-#undef rb_str_new5
-#undef rb_tainted_str_new2
-#undef rb_usascii_str_new2
-#undef rb_str_dup_frozen
-#undef rb_str_buf_new_cstr
-#undef rb_str_buf_new2
-#undef rb_str_buf_cat2
-#undef rb_str_cat2
-
VALUE rb_cString;
-VALUE rb_cSymbol;
-#define RUBY_MAX_CHAR_LEN 16
-#define STR_TMPLOCK FL_USER7
-#define STR_NOEMBED FL_USER1
-#define STR_SHARED FL_USER2 /* = ELTS_SHARED */
+#define STR_TMPLOCK FL_USER1
#define STR_ASSOC FL_USER3
-#define STR_SHARED_P(s) FL_ALL(s, STR_NOEMBED|ELTS_SHARED)
-#define STR_ASSOC_P(s) FL_ALL(s, STR_NOEMBED|STR_ASSOC)
-#define STR_NOCAPA (STR_NOEMBED|ELTS_SHARED|STR_ASSOC)
-#define STR_NOCAPA_P(s) (FL_TEST(s,STR_NOEMBED) && FL_ANY(s,ELTS_SHARED|STR_ASSOC))
-#define STR_UNSET_NOCAPA(s) do {\
- if (FL_TEST(s,STR_NOEMBED)) FL_UNSET(s,(ELTS_SHARED|STR_ASSOC));\
-} while (0)
-
-
-#define STR_SET_NOEMBED(str) do {\
- FL_SET(str, STR_NOEMBED);\
- STR_SET_EMBED_LEN(str, 0);\
-} while (0)
-#define STR_SET_EMBED(str) FL_UNSET(str, STR_NOEMBED)
-#define STR_EMBED_P(str) (!FL_TEST(str, STR_NOEMBED))
-#define STR_SET_EMBED_LEN(str, n) do { \
- long tmp_n = (n);\
- RBASIC(str)->flags &= ~RSTRING_EMBED_LEN_MASK;\
- RBASIC(str)->flags |= (tmp_n) << RSTRING_EMBED_LEN_SHIFT;\
-} while (0)
-
-#define STR_SET_LEN(str, n) do { \
- if (STR_EMBED_P(str)) {\
- STR_SET_EMBED_LEN(str, n);\
- }\
- else {\
- RSTRING(str)->as.heap.len = (n);\
- }\
-} while (0)
-
-#define STR_DEC_LEN(str) do {\
- if (STR_EMBED_P(str)) {\
- long n = RSTRING_LEN(str);\
- n--;\
- STR_SET_EMBED_LEN(str, n);\
- }\
- else {\
- RSTRING(str)->as.heap.len--;\
- }\
-} while (0)
+#define STR_NOCAPA (ELTS_SHARED|STR_ASSOC)
#define RESIZE_CAPA(str,capacity) do {\
- if (STR_EMBED_P(str)) {\
- if ((capacity) > RSTRING_EMBED_LEN_MAX) {\
- char *tmp = ALLOC_N(char, capacity+1);\
- memcpy(tmp, RSTRING_PTR(str), RSTRING_LEN(str));\
- RSTRING(str)->as.heap.ptr = tmp;\
- RSTRING(str)->as.heap.len = RSTRING_LEN(str);\
- STR_SET_NOEMBED(str);\
- RSTRING(str)->as.heap.aux.capa = (capacity);\
- }\
- }\
- else {\
- REALLOC_N(RSTRING(str)->as.heap.ptr, char, (capacity)+1);\
- if (!STR_NOCAPA_P(str))\
- RSTRING(str)->as.heap.aux.capa = (capacity);\
- }\
+ REALLOC_N(RSTRING(str)->ptr, char, (capacity)+1);\
+ if (!FL_TEST(str, STR_NOCAPA))\
+ RSTRING(str)->aux.capa = (capacity);\
} while (0)
-#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)
-
-#define STR_ENC_GET(str) rb_enc_from_index(ENCODING_GET(str))
-
-static inline int
-single_byte_optimizable(VALUE str)
-{
- rb_encoding *enc;
-
- /* Conservative. It may be ENC_CODERANGE_UNKNOWN. */
- if (ENC_CODERANGE(str) == ENC_CODERANGE_7BIT)
- return 1;
-
- enc = STR_ENC_GET(str);
- if (rb_enc_mbmaxlen(enc) == 1)
- return 1;
-
- /* Conservative. Possibly single byte.
- * "\xa1" in Shift_JIS for example. */
- return 0;
-}
-
VALUE rb_fs;
-static inline const char *
-search_nonascii(const char *p, const char *e)
-{
-#if SIZEOF_VALUE == 8
-# define NONASCII_MASK 0x8080808080808080LL
-#elif SIZEOF_VALUE == 4
-# define NONASCII_MASK 0x80808080UL
-#endif
-#ifdef NONASCII_MASK
- if ((int)sizeof(VALUE) * 2 < e - p) {
- const VALUE *s, *t;
- const VALUE lowbits = sizeof(VALUE) - 1;
- s = (const VALUE*)(~lowbits & ((VALUE)p + lowbits));
- while (p < (const char *)s) {
- if (!ISASCII(*p))
- return p;
- p++;
- }
- t = (const VALUE*)(~lowbits & (VALUE)e);
- while (s < t) {
- if (*s & NONASCII_MASK) {
- t = s;
- break;
- }
- s++;
- }
- p = (const char *)t;
- }
-#endif
- while (p < e) {
- if (!ISASCII(*p))
- return p;
- p++;
- }
- return NULL;
-}
-
-static int
-coderange_scan(const char *p, long len, rb_encoding *enc)
-{
- const char *e = p + len;
-
- if (rb_enc_to_index(enc) == 0) {
- /* enc is ASCII-8BIT. ASCII-8BIT string never be broken. */
- p = search_nonascii(p, e);
- return p ? ENC_CODERANGE_VALID : ENC_CODERANGE_7BIT;
- }
-
- if (rb_enc_asciicompat(enc)) {
- p = search_nonascii(p, e);
- if (!p) {
- return ENC_CODERANGE_7BIT;
- }
- while (p < e) {
- int ret = rb_enc_precise_mbclen(p, e, enc);
- if (!MBCLEN_CHARFOUND_P(ret)) {
- return ENC_CODERANGE_BROKEN;
- }
- p += MBCLEN_CHARFOUND_LEN(ret);
- if (p < e) {
- p = search_nonascii(p, e);
- if (!p) {
- return ENC_CODERANGE_VALID;
- }
- }
- }
- if (e < p) {
- return ENC_CODERANGE_BROKEN;
- }
- return ENC_CODERANGE_VALID;
- }
-
- while (p < e) {
- int ret = rb_enc_precise_mbclen(p, e, enc);
-
- if (!MBCLEN_CHARFOUND_P(ret)) {
- return ENC_CODERANGE_BROKEN;
- }
- p += MBCLEN_CHARFOUND_LEN(ret);
- }
- if (e < p) {
- return ENC_CODERANGE_BROKEN;
- }
- return ENC_CODERANGE_VALID;
-}
-
-long
-rb_str_coderange_scan_restartable(const char *s, const char *e, rb_encoding *enc, int *cr)
-{
- const char *p = s;
-
- if (*cr == ENC_CODERANGE_BROKEN)
- return e - s;
-
- if (rb_enc_to_index(enc) == 0) {
- /* enc is ASCII-8BIT. ASCII-8BIT string never be broken. */
- p = search_nonascii(p, e);
- *cr = (!p && *cr != ENC_CODERANGE_VALID) ? ENC_CODERANGE_7BIT : ENC_CODERANGE_VALID;
- return e - s;
- }
- else if (rb_enc_asciicompat(enc)) {
- p = search_nonascii(p, e);
- if (!p) {
- if (*cr != ENC_CODERANGE_VALID) *cr = ENC_CODERANGE_7BIT;
- return e - s;
- }
- while (p < e) {
- int ret = rb_enc_precise_mbclen(p, e, enc);
- if (!MBCLEN_CHARFOUND_P(ret)) {
- *cr = MBCLEN_INVALID_P(ret) ? ENC_CODERANGE_BROKEN: ENC_CODERANGE_UNKNOWN;
- return p - s;
- }
- p += MBCLEN_CHARFOUND_LEN(ret);
- if (p < e) {
- p = search_nonascii(p, e);
- if (!p) {
- *cr = ENC_CODERANGE_VALID;
- return e - s;
- }
- }
- }
- *cr = e < p ? ENC_CODERANGE_BROKEN: ENC_CODERANGE_VALID;
- return p - s;
- }
- else {
- while (p < e) {
- int ret = rb_enc_precise_mbclen(p, e, enc);
- if (!MBCLEN_CHARFOUND_P(ret)) {
- *cr = MBCLEN_INVALID_P(ret) ? ENC_CODERANGE_BROKEN: ENC_CODERANGE_UNKNOWN;
- return p - s;
- }
- p += MBCLEN_CHARFOUND_LEN(ret);
- }
- *cr = e < p ? ENC_CODERANGE_BROKEN: ENC_CODERANGE_VALID;
- return p - s;
- }
-}
-
-static inline void
-str_enc_copy(VALUE str1, VALUE str2)
-{
- rb_enc_set_index(str1, ENCODING_GET(str2));
-}
-
-static void
-rb_enc_cr_str_copy_for_substr(VALUE dest, VALUE src)
-{
- /* this function is designed for copying encoding and coderange
- * from src to new string "dest" which is made from the part of src.
- */
- str_enc_copy(dest, src);
- switch (ENC_CODERANGE(src)) {
- case ENC_CODERANGE_7BIT:
- ENC_CODERANGE_SET(dest, ENC_CODERANGE_7BIT);
- break;
- case ENC_CODERANGE_VALID:
- if (!rb_enc_asciicompat(STR_ENC_GET(src)) ||
- search_nonascii(RSTRING_PTR(dest), RSTRING_END(dest)))
- ENC_CODERANGE_SET(dest, ENC_CODERANGE_VALID);
- else
- ENC_CODERANGE_SET(dest, ENC_CODERANGE_7BIT);
- break;
- default:
- if (RSTRING_LEN(dest) == 0) {
- if (!rb_enc_asciicompat(STR_ENC_GET(src)))
- ENC_CODERANGE_SET(dest, ENC_CODERANGE_VALID);
- else
- ENC_CODERANGE_SET(dest, ENC_CODERANGE_7BIT);
- }
- break;
- }
-}
-
-static void
-rb_enc_cr_str_exact_copy(VALUE dest, VALUE src)
-{
- str_enc_copy(dest, src);
- ENC_CODERANGE_SET(dest, ENC_CODERANGE(src));
-}
-
-int
-rb_enc_str_coderange(VALUE str)
-{
- int cr = ENC_CODERANGE(str);
-
- if (cr == ENC_CODERANGE_UNKNOWN) {
- rb_encoding *enc = STR_ENC_GET(str);
- cr = coderange_scan(RSTRING_PTR(str), RSTRING_LEN(str), enc);
- ENC_CODERANGE_SET(str, cr);
- }
- return cr;
-}
-
-int
-rb_enc_str_asciionly_p(VALUE str)
-{
- rb_encoding *enc = STR_ENC_GET(str);
-
- if (!rb_enc_asciicompat(enc))
- return Qfalse;
- else if (rb_enc_str_coderange(str) == ENC_CODERANGE_7BIT)
- return Qtrue;
- return Qfalse;
-}
-
static inline void
-str_mod_check(VALUE s, const char *p, long len)
+str_mod_check(s, p, len)
+ VALUE s;
+ char *p;
+ long len;
{
- if (RSTRING_PTR(s) != p || RSTRING_LEN(s) != len){
+ if (RSTRING(s)->ptr != p || RSTRING(s)->len != len) {
rb_raise(rb_eRuntimeError, "string modified");
}
}
static inline void
-str_frozen_check(VALUE s)
+str_frozen_check(s)
+ VALUE s;
{
if (OBJ_FROZEN(s)) {
rb_raise(rb_eRuntimeError, "string frozen");
}
}
-size_t
-rb_str_capacity(VALUE str)
-{
- if (STR_EMBED_P(str)) {
- return RSTRING_EMBED_LEN_MAX;
- }
- else if (STR_NOCAPA_P(str)) {
- return RSTRING(str)->as.heap.len;
- }
- else {
- return RSTRING(str)->as.heap.aux.capa;
- }
-}
-
-static inline VALUE
-str_alloc(VALUE klass)
+static VALUE str_alloc _((VALUE));
+static VALUE
+str_alloc(klass)
+ VALUE klass;
{
NEWOBJ(str, struct RString);
OBJSETUP(str, klass, T_STRING);
- str->as.heap.ptr = 0;
- str->as.heap.len = 0;
- str->as.heap.aux.capa = 0;
+ str->ptr = 0;
+ str->len = 0;
+ str->aux.capa = 0;
return (VALUE)str;
}
static VALUE
-str_new(VALUE klass, const char *ptr, long len)
+str_new(klass, ptr, len)
+ VALUE klass;
+ const char *ptr;
+ long len;
{
VALUE str;
@@ -393,46 +87,27 @@ str_new(VALUE klass, const char *ptr, long len)
}
str = str_alloc(klass);
- if (len > RSTRING_EMBED_LEN_MAX) {
- RSTRING(str)->as.heap.aux.capa = len;
- RSTRING(str)->as.heap.ptr = ALLOC_N(char,len+1);
- STR_SET_NOEMBED(str);
- }
- else if (len == 0) {
- ENC_CODERANGE_SET(str, ENC_CODERANGE_7BIT);
- }
+ RSTRING(str)->len = len;
+ RSTRING(str)->aux.capa = len;
+ RSTRING(str)->ptr = ALLOC_N(char,len+1);
if (ptr) {
- memcpy(RSTRING_PTR(str), ptr, len);
+ memcpy(RSTRING(str)->ptr, ptr, len);
}
- STR_SET_LEN(str, len);
- RSTRING_PTR(str)[len] = '\0';
+ RSTRING(str)->ptr[len] = '\0';
return str;
}
VALUE
-rb_str_new(const char *ptr, long len)
+rb_str_new(ptr, len)
+ const char *ptr;
+ long len;
{
return str_new(rb_cString, ptr, len);
}
VALUE
-rb_usascii_str_new(const char *ptr, long len)
-{
- VALUE str = rb_str_new(ptr, len);
- ENCODING_CODERANGE_SET(str, rb_usascii_encindex(), ENC_CODERANGE_7BIT);
- return str;
-}
-
-VALUE
-rb_enc_str_new(const char *ptr, long len, rb_encoding *enc)
-{
- VALUE str = rb_str_new(ptr, len);
- rb_enc_associate(str, enc);
- return str;
-}
-
-VALUE
-rb_str_new_cstr(const char *ptr)
+rb_str_new2(ptr)
+ const char *ptr;
{
if (!ptr) {
rb_raise(rb_eArgError, "NULL pointer given");
@@ -440,22 +115,10 @@ rb_str_new_cstr(const char *ptr)
return rb_str_new(ptr, strlen(ptr));
}
-RUBY_ALIAS_FUNCTION(rb_str_new2(const char *ptr), rb_str_new_cstr, (ptr))
-#define rb_str_new2 rb_str_new_cstr
-
-VALUE
-rb_usascii_str_new_cstr(const char *ptr)
-{
- VALUE str = rb_str_new2(ptr);
- ENCODING_CODERANGE_SET(str, rb_usascii_encindex(), ENC_CODERANGE_7BIT);
- return str;
-}
-
-RUBY_ALIAS_FUNCTION(rb_usascii_str_new2(const char *ptr), rb_usascii_str_new_cstr, (ptr))
-#define rb_usascii_str_new2 rb_usascii_str_new_cstr
-
VALUE
-rb_tainted_str_new(const char *ptr, long len)
+rb_tainted_str_new(ptr, len)
+ const char *ptr;
+ long len;
{
VALUE str = rb_str_new(ptr, len);
@@ -464,7 +127,8 @@ rb_tainted_str_new(const char *ptr, long len)
}
VALUE
-rb_tainted_str_new_cstr(const char *ptr)
+rb_tainted_str_new2(ptr)
+ const char *ptr;
{
VALUE str = rb_str_new2(ptr);
@@ -472,159 +136,23 @@ rb_tainted_str_new_cstr(const char *ptr)
return str;
}
-RUBY_ALIAS_FUNCTION(rb_tainted_str_new2(const char *ptr), rb_tainted_str_new_cstr, (ptr))
-#define rb_tainted_str_new2 rb_tainted_str_new_cstr
-
-VALUE
-rb_str_conv_enc_opts(VALUE str, rb_encoding *from, rb_encoding *to, int ecflags, VALUE ecopts)
-{
- rb_econv_t *ec;
- rb_econv_result_t ret;
- long len;
- VALUE newstr;
- const unsigned char *sp;
- unsigned char *dp;
-
- if (!to) return str;
- if (from == to) return str;
- if ((rb_enc_asciicompat(to) && ENC_CODERANGE(str) == ENC_CODERANGE_7BIT) ||
- to == rb_ascii8bit_encoding()) {
- if (STR_ENC_GET(str) != to) {
- str = rb_str_dup(str);
- rb_enc_associate(str, to);
- }
- return str;
- }
-
- len = RSTRING_LEN(str);
- newstr = rb_str_new(0, len);
-
- retry:
- ec = rb_econv_open_opts(from->name, to->name, ecflags, ecopts);
- if (!ec) return str;
-
- sp = (unsigned char*)RSTRING_PTR(str);
- dp = (unsigned char*)RSTRING_PTR(newstr);
- ret = rb_econv_convert(ec, &sp, (unsigned char*)RSTRING_END(str),
- &dp, (unsigned char*)RSTRING_END(newstr), 0);
- rb_econv_close(ec);
- switch (ret) {
- case econv_destination_buffer_full:
- /* destination buffer short */
- len *= 2;
- rb_str_resize(newstr, len);
- goto retry;
-
- case econv_finished:
- len = dp - (unsigned char*)RSTRING_PTR(newstr);
- rb_str_set_len(newstr, len);
- rb_enc_associate(newstr, to);
- return newstr;
-
- default:
- /* some error, return original */
- return str;
- }
-}
-
-VALUE
-rb_str_conv_enc(VALUE str, rb_encoding *from, rb_encoding *to)
-{
- return rb_str_conv_enc_opts(str, from, to, 0, Qnil);
-}
-
-VALUE
-rb_external_str_new_with_enc(const char *ptr, long len, rb_encoding *eenc)
-{
- VALUE str;
-
- str = rb_tainted_str_new(ptr, len);
- if (eenc == rb_usascii_encoding() &&
- rb_enc_str_coderange(str) != ENC_CODERANGE_7BIT) {
- rb_enc_associate(str, rb_ascii8bit_encoding());
- return str;
- }
- rb_enc_associate(str, eenc);
- return rb_str_conv_enc(str, eenc, rb_default_internal_encoding());
-}
-
-VALUE
-rb_external_str_new(const char *ptr, long len)
-{
- return rb_external_str_new_with_enc(ptr, len, rb_default_external_encoding());
-}
-
-VALUE
-rb_external_str_new_cstr(const char *ptr)
-{
- return rb_external_str_new_with_enc(ptr, strlen(ptr), rb_default_external_encoding());
-}
-
-VALUE
-rb_locale_str_new(const char *ptr, long len)
-{
- return rb_external_str_new_with_enc(ptr, len, rb_locale_encoding());
-}
-
-VALUE
-rb_locale_str_new_cstr(const char *ptr)
-{
- return rb_external_str_new_with_enc(ptr, strlen(ptr), rb_locale_encoding());
-}
-
-VALUE
-rb_str_export(VALUE str)
-{
- return rb_str_conv_enc(str, STR_ENC_GET(str), rb_default_external_encoding());
-}
-
-VALUE
-rb_str_export_locale(VALUE str)
-{
- return rb_str_conv_enc(str, STR_ENC_GET(str), rb_locale_encoding());
-}
-
-VALUE
-rb_str_export_to_enc(VALUE str, rb_encoding *enc)
-{
- return rb_str_conv_enc(str, STR_ENC_GET(str), enc);
-}
-
static VALUE
-str_replace_shared(VALUE str2, VALUE str)
+str_new3(klass, str)
+ VALUE klass, str;
{
- if (RSTRING_LEN(str) <= RSTRING_EMBED_LEN_MAX) {
- STR_SET_EMBED(str2);
- memcpy(RSTRING_PTR(str2), RSTRING_PTR(str), RSTRING_LEN(str)+1);
- STR_SET_EMBED_LEN(str2, RSTRING_LEN(str));
- }
- else {
- FL_SET(str2, STR_NOEMBED);
- str = rb_str_new_frozen(str);
- RSTRING(str2)->as.heap.len = RSTRING_LEN(str);
- RSTRING(str2)->as.heap.ptr = RSTRING_PTR(str);
- RSTRING(str2)->as.heap.aux.shared = str;
- FL_SET(str2, ELTS_SHARED);
- }
- rb_enc_cr_str_exact_copy(str2, str);
+ VALUE str2 = str_alloc(klass);
- return str2;
-}
-
-static VALUE
-str_new_shared(VALUE klass, VALUE str)
-{
- return str_replace_shared(str_alloc(klass), str);
-}
+ RSTRING(str2)->len = RSTRING(str)->len;
+ RSTRING(str2)->ptr = RSTRING(str)->ptr;
+ RSTRING(str2)->aux.shared = str;
+ FL_SET(str2, ELTS_SHARED);
-static VALUE
-str_new3(VALUE klass, VALUE str)
-{
- return str_new_shared(klass, str);
+ return str2;
}
VALUE
-rb_str_new_shared(VALUE str)
+rb_str_new3(str)
+ VALUE str;
{
VALUE str2 = str_new3(rb_obj_class(str), str);
@@ -632,105 +160,86 @@ rb_str_new_shared(VALUE str)
return str2;
}
-RUBY_ALIAS_FUNCTION(rb_str_new3(VALUE str), rb_str_new_shared, (str))
-#define rb_str_new3 rb_str_new_shared
-
static VALUE
-str_new4(VALUE klass, VALUE str)
+str_new4(klass, str)
+ VALUE klass, str;
{
- VALUE str2;
+ VALUE str2 = str_alloc(klass);
- str2 = str_alloc(klass);
- STR_SET_NOEMBED(str2);
- RSTRING(str2)->as.heap.len = RSTRING_LEN(str);
- RSTRING(str2)->as.heap.ptr = RSTRING_PTR(str);
- if (STR_SHARED_P(str)) {
- VALUE shared = RSTRING(str)->as.heap.aux.shared;
- assert(OBJ_FROZEN(shared));
+ RSTRING(str2)->len = RSTRING(str)->len;
+ RSTRING(str2)->ptr = RSTRING(str)->ptr;
+ if (FL_TEST(str, ELTS_SHARED)) {
FL_SET(str2, ELTS_SHARED);
- RSTRING(str2)->as.heap.aux.shared = shared;
+ RSTRING(str2)->aux.shared = RSTRING(str)->aux.shared;
}
else {
FL_SET(str, ELTS_SHARED);
- RSTRING(str)->as.heap.aux.shared = str2;
+ RSTRING(str)->aux.shared = str2;
}
- rb_enc_cr_str_exact_copy(str2, str);
- OBJ_INFECT(str2, str);
+
return str2;
}
VALUE
-rb_str_new_frozen(VALUE orig)
+rb_str_new4(orig)
+ VALUE orig;
{
VALUE klass, str;
if (OBJ_FROZEN(orig)) return orig;
klass = rb_obj_class(orig);
- if (STR_SHARED_P(orig) && (str = RSTRING(orig)->as.heap.aux.shared)) {
+ if (FL_TEST(orig, ELTS_SHARED) && (str = RSTRING(orig)->aux.shared) && klass == RBASIC(str)->klass) {
long ofs;
- assert(OBJ_FROZEN(str));
- ofs = RSTRING_LEN(str) - RSTRING_LEN(orig);
- if ((ofs > 0) || (klass != RBASIC(str)->klass) ||
- (!OBJ_TAINTED(str) && OBJ_TAINTED(orig))) {
+ ofs = RSTRING(str)->len - RSTRING(orig)->len;
+ if ((ofs > 0) || (!OBJ_TAINTED(str) && OBJ_TAINTED(orig))) {
str = str_new3(klass, str);
- RSTRING(str)->as.heap.ptr += ofs;
- RSTRING(str)->as.heap.len -= ofs;
+ RSTRING(str)->ptr += ofs;
+ RSTRING(str)->len -= ofs;
}
- rb_enc_cr_str_exact_copy(str, orig);
- OBJ_INFECT(str, orig);
- }
- else if (STR_EMBED_P(orig)) {
- str = str_new(klass, RSTRING_PTR(orig), RSTRING_LEN(orig));
- rb_enc_cr_str_exact_copy(str, orig);
- OBJ_INFECT(str, orig);
}
- else if (STR_ASSOC_P(orig)) {
- VALUE assoc = RSTRING(orig)->as.heap.aux.shared;
- FL_UNSET(orig, STR_ASSOC);
- str = str_new4(klass, orig);
- FL_SET(str, STR_ASSOC);
- RSTRING(str)->as.heap.aux.shared = assoc;
+ else if (FL_TEST(orig, STR_ASSOC)) {
+ str = str_new(klass, RSTRING(orig)->ptr, RSTRING(orig)->len);
}
else {
str = str_new4(klass, orig);
}
+ OBJ_INFECT(str, orig);
OBJ_FREEZE(str);
return str;
}
-RUBY_ALIAS_FUNCTION(rb_str_new4(VALUE orig), rb_str_new_frozen, (orig))
-#define rb_str_new4 rb_str_new_frozen
-
VALUE
-rb_str_new_with_class(VALUE obj, const char *ptr, long len)
+rb_str_new5(obj, ptr, len)
+ VALUE obj;
+ const char *ptr;
+ long len;
{
return str_new(rb_obj_class(obj), ptr, len);
}
-RUBY_ALIAS_FUNCTION(rb_str_new5(VALUE obj, const char *ptr, long len),
- rb_str_new_with_class, (obj, ptr, len))
-#define rb_str_new5 rb_str_new_with_class
-
#define STR_BUF_MIN_SIZE 128
VALUE
-rb_str_buf_new(long capa)
+rb_str_buf_new(capa)
+ long capa;
{
VALUE str = str_alloc(rb_cString);
if (capa < STR_BUF_MIN_SIZE) {
capa = STR_BUF_MIN_SIZE;
}
- FL_SET(str, STR_NOEMBED);
- RSTRING(str)->as.heap.aux.capa = capa;
- RSTRING(str)->as.heap.ptr = ALLOC_N(char, capa+1);
- RSTRING(str)->as.heap.ptr[0] = '\0';
+ RSTRING(str)->ptr = 0;
+ RSTRING(str)->len = 0;
+ RSTRING(str)->aux.capa = capa;
+ RSTRING(str)->ptr = ALLOC_N(char, capa+1);
+ RSTRING(str)->ptr[0] = '\0';
return str;
}
VALUE
-rb_str_buf_new_cstr(const char *ptr)
+rb_str_buf_new2(ptr)
+ const char *ptr;
{
VALUE str;
long len = strlen(ptr);
@@ -741,82 +250,56 @@ rb_str_buf_new_cstr(const char *ptr)
return str;
}
-RUBY_ALIAS_FUNCTION(rb_str_buf_new2(const char *ptr), rb_str_buf_new_cstr, (ptr))
-#define rb_str_buf_new2 rb_str_buf_new_cstr
-
VALUE
-rb_str_tmp_new(long len)
+rb_str_tmp_new(len)
+ long len;
{
return str_new(0, 0, len);
}
-void
-rb_str_free(VALUE str)
-{
- if (!STR_EMBED_P(str) && !STR_SHARED_P(str)) {
- xfree(RSTRING(str)->as.heap.ptr);
- }
-}
-
-size_t
-rb_str_memsize(VALUE str)
-{
- if (!STR_EMBED_P(str) && !STR_SHARED_P(str)) {
- return RSTRING(str)->as.heap.aux.capa;
- }
- else {
- return 0;
- }
-}
-
VALUE
-rb_str_to_str(VALUE str)
+rb_str_to_str(str)
+ VALUE str;
{
return rb_convert_type(str, T_STRING, "String", "to_str");
}
-static inline void str_discard(VALUE str);
-
-void
-rb_str_shared_replace(VALUE str, VALUE str2)
+static void
+rb_str_shared_replace(str, str2)
+ VALUE str, str2;
{
- rb_encoding *enc;
- int cr;
if (str == str2) return;
- enc = STR_ENC_GET(str2);
- cr = ENC_CODERANGE(str2);
- str_discard(str);
- OBJ_INFECT(str, str2);
- if (RSTRING_LEN(str2) <= RSTRING_EMBED_LEN_MAX) {
- STR_SET_EMBED(str);
- memcpy(RSTRING_PTR(str), RSTRING_PTR(str2), RSTRING_LEN(str2)+1);
- STR_SET_EMBED_LEN(str, RSTRING_LEN(str2));
- rb_enc_associate(str, enc);
- ENC_CODERANGE_SET(str, cr);
+ rb_str_modify(str);
+ if (!FL_TEST(str, ELTS_SHARED)) free(RSTRING(str)->ptr);
+ if (NIL_P(str2)) {
+ RSTRING(str)->ptr = 0;
+ RSTRING(str)->len = 0;
+ RSTRING(str)->aux.capa = 0;
+ FL_UNSET(str, STR_NOCAPA);
return;
}
- STR_SET_NOEMBED(str);
- STR_UNSET_NOCAPA(str);
- RSTRING(str)->as.heap.ptr = RSTRING_PTR(str2);
- RSTRING(str)->as.heap.len = RSTRING_LEN(str2);
- if (STR_NOCAPA_P(str2)) {
+ RSTRING(str)->ptr = RSTRING(str2)->ptr;
+ RSTRING(str)->len = RSTRING(str2)->len;
+ FL_UNSET(str, STR_NOCAPA);
+ if (FL_TEST(str2, STR_NOCAPA)) {
FL_SET(str, RBASIC(str2)->flags & STR_NOCAPA);
- RSTRING(str)->as.heap.aux.shared = RSTRING(str2)->as.heap.aux.shared;
+ RSTRING(str)->aux.shared = RSTRING(str2)->aux.shared;
}
else {
- RSTRING(str)->as.heap.aux.capa = RSTRING(str2)->as.heap.aux.capa;
+ RSTRING(str)->aux.capa = RSTRING(str2)->aux.capa;
}
- STR_SET_EMBED(str2); /* abandon str2 */
- RSTRING_PTR(str2)[0] = 0;
- STR_SET_EMBED_LEN(str2, 0);
- rb_enc_associate(str, enc);
- ENC_CODERANGE_SET(str, cr);
+ RSTRING(str2)->ptr = 0; /* abandon str2 */
+ RSTRING(str2)->len = 0;
+ RSTRING(str2)->aux.capa = 0;
+ FL_UNSET(str2, STR_NOCAPA);
+ if (OBJ_TAINTED(str2)) OBJ_TAINT(str);
}
static ID id_to_s;
VALUE
-rb_obj_as_string(VALUE obj)
+rb_obj_as_string(obj)
+ VALUE obj;
{
VALUE str;
@@ -830,284 +313,68 @@ rb_obj_as_string(VALUE obj)
return str;
}
-static VALUE
-str_replace(VALUE str, VALUE str2)
-{
- long len;
-
- len = RSTRING_LEN(str2);
- if (STR_ASSOC_P(str2)) {
- str2 = rb_str_new4(str2);
- }
- if (STR_SHARED_P(str2)) {
- VALUE shared = RSTRING(str2)->as.heap.aux.shared;
- assert(OBJ_FROZEN(shared));
- STR_SET_NOEMBED(str);
- RSTRING(str)->as.heap.len = len;
- RSTRING(str)->as.heap.ptr = RSTRING_PTR(str2);
- FL_SET(str, ELTS_SHARED);
- FL_UNSET(str, STR_ASSOC);
- RSTRING(str)->as.heap.aux.shared = shared;
- }
- else {
- str_replace_shared(str, str2);
- }
-
- OBJ_INFECT(str, str2);
- rb_enc_cr_str_exact_copy(str, str2);
- return str;
-}
-
-static VALUE
-str_duplicate(VALUE klass, VALUE str)
-{
- VALUE dup = str_alloc(klass);
- str_replace(dup, str);
- return dup;
-}
+static VALUE rb_str_s_alloc _((VALUE));
+static VALUE rb_str_replace _((VALUE, VALUE));
VALUE
-rb_str_dup(VALUE str)
+rb_str_dup(str)
+ VALUE str;
{
- return str_duplicate(rb_obj_class(str), str);
+ VALUE dup = str_alloc(rb_obj_class(str));
+ rb_str_replace(dup, str);
+ return dup;
}
-VALUE
-rb_str_resurrect(VALUE str)
-{
- return str_replace(str_alloc(rb_cString), str);
-}
/*
* call-seq:
* String.new(str="") => new_str
- *
+ *
* Returns a new string object containing a copy of <i>str</i>.
*/
static VALUE
-rb_str_init(int argc, VALUE *argv, VALUE str)
+rb_str_init(argc, argv, str)
+ int argc;
+ VALUE *argv;
+ VALUE str;
{
VALUE orig;
- if (argc > 0 && rb_scan_args(argc, argv, "01", &orig) == 1)
+ if (rb_scan_args(argc, argv, "01", &orig) == 1)
rb_str_replace(str, orig);
return str;
}
-static inline long
-enc_strlen(const char *p, const char *e, rb_encoding *enc, int cr)
-{
- long c;
- const char *q;
-
- if (rb_enc_mbmaxlen(enc) == rb_enc_mbminlen(enc)) {
- return (e - p + rb_enc_mbminlen(enc) - 1) / rb_enc_mbminlen(enc);
- }
- else if (rb_enc_asciicompat(enc)) {
- c = 0;
- if (cr == ENC_CODERANGE_7BIT || cr == ENC_CODERANGE_VALID) {
- while (p < e) {
- if (ISASCII(*p)) {
- q = search_nonascii(p, e);
- if (!q)
- return c + (e - p);
- c += q - p;
- p = q;
- }
- p += rb_enc_fast_mbclen(p, e, enc);
- c++;
- }
- }
- else {
- while (p < e) {
- if (ISASCII(*p)) {
- q = search_nonascii(p, e);
- if (!q)
- return c + (e - p);
- c += q - p;
- p = q;
- }
- p += rb_enc_mbclen(p, e, enc);
- c++;
- }
- }
- return c;
- }
-
- for (c=0; p<e; c++) {
- p += rb_enc_mbclen(p, e, enc);
- }
- return c;
-}
-
-long
-rb_enc_strlen(const char *p, const char *e, rb_encoding *enc)
-{
- return enc_strlen(p, e, enc, ENC_CODERANGE_UNKNOWN);
-}
-
-long
-rb_enc_strlen_cr(const char *p, const char *e, rb_encoding *enc, int *cr)
-{
- long c;
- const char *q;
- int ret;
-
- *cr = 0;
- if (rb_enc_mbmaxlen(enc) == rb_enc_mbminlen(enc)) {
- return (e - p + rb_enc_mbminlen(enc) - 1) / rb_enc_mbminlen(enc);
- }
- else if (rb_enc_asciicompat(enc)) {
- c = 0;
- while (p < e) {
- if (ISASCII(*p)) {
- q = search_nonascii(p, e);
- if (!q) {
- if (!*cr) *cr = ENC_CODERANGE_7BIT;
- return c + (e - p);
- }
- c += q - p;
- p = q;
- }
- ret = rb_enc_precise_mbclen(p, e, enc);
- if (MBCLEN_CHARFOUND_P(ret)) {
- *cr |= ENC_CODERANGE_VALID;
- p += MBCLEN_CHARFOUND_LEN(ret);
- }
- else {
- *cr = ENC_CODERANGE_BROKEN;
- p++;
- }
- c++;
- }
- if (!*cr) *cr = ENC_CODERANGE_7BIT;
- return c;
- }
-
- for (c=0; p<e; c++) {
- ret = rb_enc_precise_mbclen(p, e, enc);
- if (MBCLEN_CHARFOUND_P(ret)) {
- *cr |= ENC_CODERANGE_VALID;
- p += MBCLEN_CHARFOUND_LEN(ret);
- }
- else {
- *cr = ENC_CODERANGE_BROKEN;
- p++;
- }
- }
- if (!*cr) *cr = ENC_CODERANGE_7BIT;
- return c;
-}
-
-#ifdef NONASCII_MASK
-#define is_utf8_lead_byte(c) (((c)&0xC0) != 0x80)
-static inline VALUE
-count_utf8_lead_bytes_with_word(const VALUE *s)
-{
- VALUE d = *s;
- d |= ~(d>>1);
- d >>= 6;
- d &= NONASCII_MASK >> 7;
- d += (d>>8);
- d += (d>>16);
-#if SIZEOF_VALUE == 8
- d += (d>>32);
-#endif
- return (d&0xF);
-}
-#endif
-
-static long
-str_strlen(VALUE str, rb_encoding *enc)
-{
- const char *p, *e;
- long n;
- int cr;
-
- if (single_byte_optimizable(str)) return RSTRING_LEN(str);
- if (!enc) enc = STR_ENC_GET(str);
- p = RSTRING_PTR(str);
- e = RSTRING_END(str);
- cr = ENC_CODERANGE(str);
-#ifdef NONASCII_MASK
- if (ENC_CODERANGE(str) == ENC_CODERANGE_VALID &&
- enc == rb_utf8_encoding()) {
-
- VALUE len = 0;
- if ((int)sizeof(VALUE) * 2 < e - p) {
- const VALUE *s, *t;
- const VALUE lowbits = sizeof(VALUE) - 1;
- s = (const VALUE*)(~lowbits & ((VALUE)p + lowbits));
- t = (const VALUE*)(~lowbits & (VALUE)e);
- while (p < (const char *)s) {
- if (is_utf8_lead_byte(*p)) len++;
- p++;
- }
- while (s < t) {
- len += count_utf8_lead_bytes_with_word(s);
- s++;
- }
- p = (const char *)s;
- }
- while (p < e) {
- if (is_utf8_lead_byte(*p)) len++;
- p++;
- }
- return (long)len;
- }
-#endif
- n = rb_enc_strlen_cr(p, e, enc, &cr);
- if (cr) {
- ENC_CODERANGE_SET(str, cr);
- }
- return n;
-}
-
/*
* call-seq:
* str.length => integer
- * str.size => integer
- *
- * Returns the character length of <i>str</i>.
- */
-
-VALUE
-rb_str_length(VALUE str)
-{
- long len;
-
- len = str_strlen(str, STR_ENC_GET(str));
- return LONG2NUM(len);
-}
-
-/*
- * call-seq:
- * str.bytesize => integer
- *
- * Returns the length of <i>str</i> in bytes.
+ *
+ * Returns the length of <i>str</i>.
*/
static VALUE
-rb_str_bytesize(VALUE str)
+rb_str_length(str)
+ VALUE str;
{
- return INT2NUM(RSTRING_LEN(str));
+ return LONG2NUM(RSTRING(str)->len);
}
/*
* call-seq:
* str.empty? => true or false
- *
+ *
* Returns <code>true</code> if <i>str</i> has a length of zero.
- *
+ *
* "hello".empty? #=> false
* "".empty? #=> true
*/
static VALUE
-rb_str_empty(VALUE str)
+rb_str_empty(str)
+ VALUE str;
{
- if (RSTRING_LEN(str) == 0)
+ if (RSTRING(str)->len == 0)
return Qtrue;
return Qfalse;
}
@@ -1115,71 +382,65 @@ rb_str_empty(VALUE str)
/*
* call-seq:
* str + other_str => new_str
- *
+ *
* Concatenation---Returns a new <code>String</code> containing
* <i>other_str</i> concatenated to <i>str</i>.
- *
+ *
* "Hello from " + self.to_s #=> "Hello from main"
*/
VALUE
-rb_str_plus(VALUE str1, VALUE str2)
+rb_str_plus(str1, str2)
+ VALUE str1, str2;
{
VALUE str3;
- rb_encoding *enc;
StringValue(str2);
- enc = rb_enc_check(str1, str2);
- str3 = rb_str_new(0, RSTRING_LEN(str1)+RSTRING_LEN(str2));
- memcpy(RSTRING_PTR(str3), RSTRING_PTR(str1), RSTRING_LEN(str1));
- memcpy(RSTRING_PTR(str3) + RSTRING_LEN(str1),
- RSTRING_PTR(str2), RSTRING_LEN(str2));
- RSTRING_PTR(str3)[RSTRING_LEN(str3)] = '\0';
+ str3 = rb_str_new(0, RSTRING(str1)->len+RSTRING(str2)->len);
+ memcpy(RSTRING(str3)->ptr, RSTRING(str1)->ptr, RSTRING(str1)->len);
+ memcpy(RSTRING(str3)->ptr + RSTRING(str1)->len,
+ RSTRING(str2)->ptr, RSTRING(str2)->len);
+ RSTRING(str3)->ptr[RSTRING(str3)->len] = '\0';
if (OBJ_TAINTED(str1) || OBJ_TAINTED(str2))
OBJ_TAINT(str3);
- ENCODING_CODERANGE_SET(str3, rb_enc_to_index(enc),
- ENC_CODERANGE_AND(ENC_CODERANGE(str1), ENC_CODERANGE(str2)));
return str3;
}
/*
* call-seq:
* str * integer => new_str
- *
+ *
* Copy---Returns a new <code>String</code> containing <i>integer</i> copies of
* the receiver.
- *
+ *
* "Ho! " * 3 #=> "Ho! Ho! Ho! "
*/
VALUE
-rb_str_times(VALUE str, VALUE times)
+rb_str_times(str, times)
+ VALUE str;
+ VALUE times;
{
VALUE str2;
- long n, len;
+ long i, len;
len = NUM2LONG(times);
if (len < 0) {
rb_raise(rb_eArgError, "negative argument");
}
- if (len && LONG_MAX/len < RSTRING_LEN(str)) {
+ if (len && LONG_MAX/len < RSTRING(str)->len) {
rb_raise(rb_eArgError, "argument too big");
}
- str2 = rb_str_new5(str, 0, len *= RSTRING_LEN(str));
- if (len) {
- n = RSTRING_LEN(str);
- memcpy(RSTRING_PTR(str2), RSTRING_PTR(str), n);
- while (n <= len/2) {
- memcpy(RSTRING_PTR(str2) + n, RSTRING_PTR(str2), n);
- n *= 2;
- }
- memcpy(RSTRING_PTR(str2) + n, RSTRING_PTR(str2), len-n);
- }
- RSTRING_PTR(str2)[RSTRING_LEN(str2)] = '\0';
+ str2 = rb_str_new5(str,0, len *= RSTRING(str)->len);
+ for (i = 0; i < len; i += RSTRING(str)->len) {
+ memcpy(RSTRING(str2)->ptr + i,
+ RSTRING(str)->ptr, RSTRING(str)->len);
+ }
+ RSTRING(str2)->ptr[RSTRING(str2)->len] = '\0';
+
OBJ_INFECT(str2, str);
- rb_enc_cr_str_copy_for_substr(str2, str);
return str2;
}
@@ -1187,19 +448,20 @@ rb_str_times(VALUE str, VALUE times)
/*
* call-seq:
* str % arg => new_str
- *
+ *
* Format---Uses <i>str</i> as a format specification, and returns the result
* of applying it to <i>arg</i>. If the format specification contains more than
* one substitution, then <i>arg</i> must be an <code>Array</code> containing
* the values to be substituted. See <code>Kernel::sprintf</code> for details
* of the format string.
- *
- * "%05d" % 123 #=> "00123"
- * "%-5s: %08x" % [ "ID", self.object_id ] #=> "ID : 200e14d6"
+ *
+ * "%05d" % 123 #=> "00123"
+ * "%-5s: %08x" % [ "ID", self.id ] #=> "ID : 200e14d6"
*/
static VALUE
-rb_str_format_m(VALUE str, VALUE arg)
+rb_str_format_m(str, arg)
+ VALUE str, arg;
{
volatile VALUE tmp = rb_check_array_type(arg);
@@ -1209,421 +471,202 @@ rb_str_format_m(VALUE str, VALUE arg)
return rb_str_format(1, &arg, str);
}
-static inline void
-str_modifiable(VALUE str)
+static const char null_str[] = "";
+
+static int
+str_independent(str)
+ VALUE str;
{
if (FL_TEST(str, STR_TMPLOCK)) {
rb_raise(rb_eRuntimeError, "can't modify string; temporarily locked");
}
if (OBJ_FROZEN(str)) rb_error_frozen("string");
- if (!OBJ_UNTRUSTED(str) && rb_safe_level() >= 4)
+ if (!OBJ_TAINTED(str) && rb_safe_level() >= 4)
rb_raise(rb_eSecurityError, "Insecure: can't modify string");
-}
-
-static inline int
-str_independent(VALUE str)
-{
- str_modifiable(str);
- if (!STR_SHARED_P(str)) return 1;
- if (STR_EMBED_P(str)) return 1;
+ if (RSTRING(str)->ptr == null_str) return 0;
+ if (!FL_TEST(str, ELTS_SHARED)) return 1;
return 0;
}
static void
-str_make_independent(VALUE str)
+str_make_independent(str)
+ VALUE str;
{
char *ptr;
- long len = RSTRING_LEN(str);
- ptr = ALLOC_N(char, len+1);
- if (RSTRING_PTR(str)) {
- memcpy(ptr, RSTRING_PTR(str), len);
+ ptr = ALLOC_N(char, RSTRING(str)->len+1);
+ if (RSTRING(str)->ptr) {
+ memcpy(ptr, RSTRING(str)->ptr, RSTRING(str)->len);
}
- STR_SET_NOEMBED(str);
- ptr[len] = 0;
- RSTRING(str)->as.heap.ptr = ptr;
- RSTRING(str)->as.heap.len = len;
- RSTRING(str)->as.heap.aux.capa = len;
- STR_UNSET_NOCAPA(str);
+ ptr[RSTRING(str)->len] = 0;
+ RSTRING(str)->ptr = ptr;
+ RSTRING(str)->aux.capa = RSTRING(str)->len;
+ FL_UNSET(str, STR_NOCAPA);
}
void
-rb_str_modify(VALUE str)
-{
- if (!str_independent(str))
- str_make_independent(str);
- ENC_CODERANGE_CLEAR(str);
-}
-
-/* As rb_str_modify(), but don't clear coderange */
-static void
-str_modify_keep_cr(VALUE str)
+rb_str_modify(str)
+ VALUE str;
{
if (!str_independent(str))
str_make_independent(str);
- if (ENC_CODERANGE(str) == ENC_CODERANGE_BROKEN)
- /* Force re-scan later */
- ENC_CODERANGE_CLEAR(str);
-}
-
-static inline void
-str_discard(VALUE str)
-{
- str_modifiable(str);
- if (!STR_SHARED_P(str) && !STR_EMBED_P(str)) {
- xfree(RSTRING_PTR(str));
- RSTRING(str)->as.heap.ptr = 0;
- RSTRING(str)->as.heap.len = 0;
- }
}
void
-rb_str_associate(VALUE str, VALUE add)
+rb_str_associate(str, add)
+ VALUE str, add;
{
- /* sanity check */
- if (OBJ_FROZEN(str)) rb_error_frozen("string");
- if (STR_ASSOC_P(str)) {
+ if (FL_TEST(str, STR_ASSOC)) {
/* already associated */
- rb_ary_concat(RSTRING(str)->as.heap.aux.shared, add);
+ rb_ary_concat(RSTRING(str)->aux.shared, add);
}
else {
- if (STR_SHARED_P(str)) {
- VALUE assoc = RSTRING(str)->as.heap.aux.shared;
- str_make_independent(str);
- if (STR_ASSOC_P(assoc)) {
- assoc = RSTRING(assoc)->as.heap.aux.shared;
- rb_ary_concat(assoc, add);
- add = assoc;
- }
- }
- else if (STR_EMBED_P(str)) {
+ if (FL_TEST(str, ELTS_SHARED)) {
str_make_independent(str);
}
- else if (RSTRING(str)->as.heap.aux.capa != RSTRING_LEN(str)) {
- RESIZE_CAPA(str, RSTRING_LEN(str));
+ else if (RSTRING(str)->aux.capa != RSTRING(str)->len) {
+ RESIZE_CAPA(str, RSTRING(str)->len);
}
+ RSTRING(str)->aux.shared = add;
FL_SET(str, STR_ASSOC);
- RBASIC(add)->klass = 0;
- RSTRING(str)->as.heap.aux.shared = add;
}
}
VALUE
-rb_str_associated(VALUE str)
+rb_str_associated(str)
+ VALUE str;
{
- if (STR_SHARED_P(str)) str = RSTRING(str)->as.heap.aux.shared;
- if (STR_ASSOC_P(str)) {
- return RSTRING(str)->as.heap.aux.shared;
+ if (FL_TEST(str, STR_ASSOC)) {
+ return RSTRING(str)->aux.shared;
}
return Qfalse;
}
+#define make_null_str(s) do { \
+ FL_SET(s, ELTS_SHARED); \
+ RSTRING(s)->ptr = (char *)null_str; \
+ RSTRING(s)->aux.shared = 0; \
+ } while (0)
+
+static VALUE
+rb_str_s_alloc(klass)
+ VALUE klass;
+{
+ VALUE str = str_alloc(klass);
+ make_null_str(str);
+ return str;
+}
+
VALUE
-rb_string_value(volatile VALUE *ptr)
+rb_string_value(ptr)
+ volatile VALUE *ptr;
{
VALUE s = *ptr;
if (TYPE(s) != T_STRING) {
- if (SYMBOL_P(s)) {
- s = rb_sym_to_s(s);
- }
- else {
- s = rb_str_to_str(s);
- }
+ s = rb_str_to_str(s);
*ptr = s;
}
+ if (!RSTRING(s)->ptr) {
+ make_null_str(s);
+ }
return s;
}
char *
-rb_string_value_ptr(volatile VALUE *ptr)
+rb_string_value_ptr(ptr)
+ volatile VALUE *ptr;
{
- VALUE str = rb_string_value(ptr);
- return RSTRING_PTR(str);
+ return RSTRING(rb_string_value(ptr))->ptr;
}
char *
-rb_string_value_cstr(volatile VALUE *ptr)
+rb_string_value_cstr(ptr)
+ volatile VALUE *ptr;
{
VALUE str = rb_string_value(ptr);
- char *s = RSTRING_PTR(str);
+ char *s = RSTRING(str)->ptr;
- if (!s || RSTRING_LEN(str) != (long)strlen(s)) {
+ if (!s || RSTRING(str)->len != strlen(s)) {
rb_raise(rb_eArgError, "string contains null byte");
}
return s;
}
VALUE
-rb_check_string_type(VALUE str)
+rb_check_string_type(str)
+ VALUE str;
{
str = rb_check_convert_type(str, T_STRING, "String", "to_str");
- return str;
-}
-
-/*
- * call-seq:
- * String.try_convert(obj) -> string or nil
- *
- * Try to convert <i>obj</i> into a String, using to_str method.
- * Returns converted regexp or nil if <i>obj</i> cannot be converted
- * for any reason.
- *
- * String.try_convert("str") # => str
- * String.try_convert(/re/) # => nil
- */
-static VALUE
-rb_str_s_try_convert(VALUE dummy, VALUE str)
-{
- return rb_check_string_type(str);
-}
-
-char*
-rb_enc_nth(const char *p, const char *e, long nth, rb_encoding *enc)
-{
- if (rb_enc_mbmaxlen(enc) == 1) {
- p += nth;
- }
- else if (rb_enc_mbmaxlen(enc) == rb_enc_mbminlen(enc)) {
- p += nth * rb_enc_mbmaxlen(enc);
- }
- else if (rb_enc_asciicompat(enc)) {
- const char *p2, *e2;
- int n;
-
- while (p < e && 0 < nth) {
- e2 = p + nth;
- if (e < e2)
- return (char *)e;
- if (ISASCII(*p)) {
- p2 = search_nonascii(p, e2);
- if (!p2)
- return (char *)e2;
- nth -= p2 - p;
- p = p2;
- }
- n = rb_enc_mbclen(p, e, enc);
- p += n;
- nth--;
- }
- if (nth != 0)
- return (char *)e;
- return (char *)p;
- }
- else {
- while (p<e && nth--) {
- p += rb_enc_mbclen(p, e, enc);
- }
- }
- if (p > e) p = e;
- return (char*)p;
-}
-
-static char*
-str_nth(const char *p, const char *e, long nth, rb_encoding *enc, int singlebyte)
-{
- if (singlebyte)
- p += nth;
- else {
- p = rb_enc_nth(p, e, nth, enc);
- }
- if (!p) return 0;
- if (p > e) p = e;
- return (char *)p;
-}
-
-/* char offset to byte offset */
-static long
-str_offset(const char *p, const char *e, long nth, rb_encoding *enc, int singlebyte)
-{
- const char *pp = str_nth(p, e, nth, enc, singlebyte);
- if (!pp) return e - p;
- return pp - p;
-}
-
-long
-rb_str_offset(VALUE str, long pos)
-{
- return str_offset(RSTRING_PTR(str), RSTRING_END(str), pos,
- STR_ENC_GET(str), single_byte_optimizable(str));
-}
-
-#ifdef NONASCII_MASK
-static char *
-str_utf8_nth(const char *p, const char *e, long nth)
-{
- if ((int)SIZEOF_VALUE * 2 < nth) {
- const VALUE *s, *t;
- const VALUE lowbits = sizeof(VALUE) - 1;
- s = (const VALUE*)(~lowbits & ((VALUE)p + lowbits));
- t = (const VALUE*)(~lowbits & (VALUE)e);
- while (p < (const char *)s) {
- if (is_utf8_lead_byte(*p)) nth--;
- p++;
- }
- do {
- nth -= count_utf8_lead_bytes_with_word(s);
- s++;
- } while (s < t && (int)sizeof(VALUE) <= nth);
- p = (char *)s;
+ if (!NIL_P(str) && !RSTRING(str)->ptr) {
+ make_null_str(str);
}
- while (p < e) {
- if (is_utf8_lead_byte(*p)) {
- if (nth == 0) break;
- nth--;
- }
- p++;
- }
- return (char *)p;
-}
-
-static long
-str_utf8_offset(const char *p, const char *e, long nth)
-{
- const char *pp = str_utf8_nth(p, e, nth);
- if (!pp) return e - p;
- return pp - p;
-}
-#endif
-
-/* byte offset to char offset */
-long
-rb_str_sublen(VALUE str, long pos)
-{
- if (single_byte_optimizable(str) || pos < 0)
- return pos;
- else {
- char *p = RSTRING_PTR(str);
- return enc_strlen(p, p + pos, STR_ENC_GET(str), ENC_CODERANGE(str));
- }
-}
-
-VALUE
-rb_str_subseq(VALUE str, long beg, long len)
-{
- VALUE str2;
-
- if (RSTRING_LEN(str) == beg + len &&
- RSTRING_EMBED_LEN_MAX < len) {
- str2 = rb_str_new_shared(rb_str_new_frozen(str));
- rb_str_drop_bytes(str2, beg);
- }
- else {
- str2 = rb_str_new5(str, RSTRING_PTR(str)+beg, len);
- }
-
- rb_enc_cr_str_copy_for_substr(str2, str);
- OBJ_INFECT(str2, str);
-
- return str2;
+ return str;
}
VALUE
-rb_str_substr(VALUE str, long beg, long len)
+rb_str_substr(str, beg, len)
+ VALUE str;
+ long beg, len;
{
- rb_encoding *enc = STR_ENC_GET(str);
VALUE str2;
- char *p, *s = RSTRING_PTR(str), *e = s + RSTRING_LEN(str);
if (len < 0) return Qnil;
- if (!RSTRING_LEN(str)) {
- len = 0;
- }
- if (single_byte_optimizable(str)) {
- if (beg > RSTRING_LEN(str)) return Qnil;
- if (beg < 0) {
- beg += RSTRING_LEN(str);
- if (beg < 0) return Qnil;
- }
- if (beg + len > RSTRING_LEN(str))
- len = RSTRING_LEN(str) - beg;
- if (len <= 0) {
- len = 0;
- p = 0;
- }
- else
- p = s + beg;
- goto sub;
- }
+ if (beg > RSTRING(str)->len) return Qnil;
if (beg < 0) {
- if (len > -beg) len = -beg;
- if (-beg * rb_enc_mbmaxlen(enc) < RSTRING_LEN(str) / 8) {
- beg = -beg;
- while (beg-- > len && (e = rb_enc_prev_char(s, e, e, enc)) != 0);
- p = e;
- if (!p) return Qnil;
- while (len-- > 0 && (p = rb_enc_prev_char(s, p, e, enc)) != 0);
- if (!p) return Qnil;
- len = e - p;
- goto sub;
- }
- else {
- beg += str_strlen(str, enc);
- if (beg < 0) return Qnil;
- }
- }
- else if (beg > 0 && beg > str_strlen(str, enc)) {
- return Qnil;
+ beg += RSTRING(str)->len;
+ if (beg < 0) return Qnil;
}
- if (len == 0) {
- p = 0;
+ if (beg + len > RSTRING(str)->len) {
+ len = RSTRING(str)->len - beg;
}
-#ifdef NONASCII_MASK
- else if (ENC_CODERANGE(str) == ENC_CODERANGE_VALID &&
- enc == rb_utf8_encoding()) {
- p = str_utf8_nth(s, e, beg);
- len = str_utf8_offset(p, e, len);
- }
-#endif
- else if (rb_enc_mbmaxlen(enc) == rb_enc_mbminlen(enc)) {
- int char_sz = rb_enc_mbmaxlen(enc);
-
- p = s + beg * char_sz;
- if (p > e) {
- p = e;
- len = 0;
- }
- else if (len * char_sz > e - p)
- len = e - p;
- else
- len *= char_sz;
- }
- else if ((p = str_nth(s, e, beg, enc, 0)) == e) {
+ if (len < 0) {
len = 0;
}
- else {
- len = str_offset(p, e, len, enc, 0);
+ if (len == 0) {
+ str2 = rb_str_new5(str,0,0);
}
- sub:
- if (len > RSTRING_EMBED_LEN_MAX && beg + len == RSTRING_LEN(str)) {
+ else if (len > sizeof(struct RString)/2 &&
+ beg + len == RSTRING(str)->len && !FL_TEST(str, STR_ASSOC)) {
str2 = rb_str_new4(str);
str2 = str_new3(rb_obj_class(str2), str2);
- RSTRING(str2)->as.heap.ptr += RSTRING(str2)->as.heap.len - len;
- RSTRING(str2)->as.heap.len = len;
+ RSTRING(str2)->ptr += RSTRING(str2)->len - len;
+ RSTRING(str2)->len = len;
}
else {
- str2 = rb_str_new5(str, p, len);
- rb_enc_cr_str_copy_for_substr(str2, str);
- OBJ_INFECT(str2, str);
+ str2 = rb_str_new5(str, RSTRING(str)->ptr+beg, len);
}
+ OBJ_INFECT(str2, str);
return str2;
}
VALUE
-rb_str_freeze(VALUE str)
+rb_str_freeze(str)
+ VALUE str;
{
- if (STR_ASSOC_P(str)) {
- VALUE ary = RSTRING(str)->as.heap.aux.shared;
- OBJ_FREEZE(ary);
- }
return rb_obj_freeze(str);
}
-RUBY_ALIAS_FUNCTION(rb_str_dup_frozen(VALUE str), rb_str_new_frozen, (str))
-#define rb_str_dup_frozen rb_str_new_frozen
+VALUE
+rb_str_dup_frozen(str)
+ VALUE str;
+{
+ if (FL_TEST(str, ELTS_SHARED) && RSTRING(str)->aux.shared) {
+ VALUE shared = RSTRING(str)->aux.shared;
+ if (RSTRING(shared)->len == RSTRING(str)->len) {
+ OBJ_FREEZE(shared);
+ return shared;
+ }
+ }
+ if (OBJ_FROZEN(str)) return str;
+ str = rb_str_dup(str);
+ OBJ_FREEZE(str);
+ return str;
+}
VALUE
-rb_str_locktmp(VALUE str)
+rb_str_locktmp(str)
+ VALUE str;
{
if (FL_TEST(str, STR_TMPLOCK)) {
rb_raise(rb_eRuntimeError, "temporal locking already locked string");
@@ -1633,7 +676,8 @@ rb_str_locktmp(VALUE str)
}
VALUE
-rb_str_unlocktmp(VALUE str)
+rb_str_unlocktmp(str)
+ VALUE str;
{
if (!FL_TEST(str, STR_TMPLOCK)) {
rb_raise(rb_eRuntimeError, "temporal unlocking already unlocked string");
@@ -1645,83 +689,61 @@ rb_str_unlocktmp(VALUE str)
void
rb_str_set_len(VALUE str, long len)
{
- STR_SET_LEN(str, len);
- RSTRING_PTR(str)[len] = '\0';
+ RSTRING(str)->len = len;
+ RSTRING(str)->ptr[len] = '\0';
}
VALUE
-rb_str_resize(VALUE str, long len)
+rb_str_resize(str, len)
+ VALUE str;
+ long len;
{
- long slen;
-
if (len < 0) {
rb_raise(rb_eArgError, "negative string size (or size too big)");
}
rb_str_modify(str);
- slen = RSTRING_LEN(str);
- if (len != slen) {
- if (STR_EMBED_P(str)) {
- char *ptr;
- if (len <= RSTRING_EMBED_LEN_MAX) {
- STR_SET_EMBED_LEN(str, len);
- RSTRING(str)->as.ary[len] = '\0';
- return str;
+ if (len != RSTRING(str)->len) {
+ if (RSTRING(str)->len < len || RSTRING(str)->len - len > 1024) {
+ REALLOC_N(RSTRING(str)->ptr, char, len+1);
+ if (!FL_TEST(str, STR_NOCAPA)) {
+ RSTRING(str)->aux.capa = len;
}
- ptr = ALLOC_N(char,len+1);
- MEMCPY(ptr, RSTRING(str)->as.ary, char, slen);
- RSTRING(str)->as.heap.ptr = ptr;
- STR_SET_NOEMBED(str);
- }
- else if (len <= RSTRING_EMBED_LEN_MAX) {
- char *ptr = RSTRING(str)->as.heap.ptr;
- STR_SET_EMBED(str);
- if (slen > 0) MEMCPY(RSTRING(str)->as.ary, ptr, char, len);
- RSTRING(str)->as.ary[len] = '\0';
- STR_SET_EMBED_LEN(str, len);
- xfree(ptr);
- return str;
- }
- else if (slen < len || slen - len > 1024) {
- REALLOC_N(RSTRING(str)->as.heap.ptr, char, len+1);
}
- if (!STR_NOCAPA_P(str)) {
- RSTRING(str)->as.heap.aux.capa = len;
- }
- RSTRING(str)->as.heap.len = len;
- RSTRING(str)->as.heap.ptr[len] = '\0'; /* sentinel */
+ RSTRING(str)->len = len;
+ RSTRING(str)->ptr[len] = '\0'; /* sentinel */
}
return str;
}
static VALUE
-str_buf_cat(VALUE str, const char *ptr, long len)
+str_buf_cat(str, ptr, len)
+ VALUE str;
+ const char *ptr;
+ long len;
{
- long capa, total, off = -1;
+ long capa, total, off = -1;;
- if (ptr >= RSTRING_PTR(str) && ptr <= RSTRING_END(str)) {
- off = ptr - RSTRING_PTR(str);
- }
rb_str_modify(str);
+ if (ptr >= RSTRING(str)->ptr && ptr <= RSTRING(str)->ptr + RSTRING(str)->len) {
+ off = ptr - RSTRING(str)->ptr;
+ }
if (len == 0) return 0;
- if (STR_ASSOC_P(str)) {
+ if (FL_TEST(str, STR_ASSOC)) {
FL_UNSET(str, STR_ASSOC);
- capa = RSTRING(str)->as.heap.aux.capa = RSTRING_LEN(str);
- }
- else if (STR_EMBED_P(str)) {
- capa = RSTRING_EMBED_LEN_MAX;
+ capa = RSTRING(str)->aux.capa = RSTRING(str)->len;
}
else {
- capa = RSTRING(str)->as.heap.aux.capa;
+ capa = RSTRING(str)->aux.capa;
}
- if (RSTRING_LEN(str) >= LONG_MAX - len) {
+ if (RSTRING(str)->len >= LONG_MAX - len) {
rb_raise(rb_eArgError, "string sizes too big");
}
- total = RSTRING_LEN(str)+len;
+ total = RSTRING(str)->len+len;
if (capa <= total) {
while (total > capa) {
if (capa + 1 >= LONG_MAX / 2) {
- capa = (total + 4095) / 4096;
+ capa = total;
break;
}
capa = (capa + 1) * 2;
@@ -1729,17 +751,20 @@ str_buf_cat(VALUE str, const char *ptr, long len)
RESIZE_CAPA(str, capa);
}
if (off != -1) {
- ptr = RSTRING_PTR(str) + off;
+ ptr = RSTRING(str)->ptr + off;
}
- memcpy(RSTRING_PTR(str) + RSTRING_LEN(str), ptr, len);
- STR_SET_LEN(str, total);
- RSTRING_PTR(str)[total] = '\0'; /* sentinel */
+ memcpy(RSTRING(str)->ptr + RSTRING(str)->len, ptr, len);
+ RSTRING(str)->len = total;
+ RSTRING(str)->ptr[total] = '\0'; /* sentinel */
return str;
}
VALUE
-rb_str_buf_cat(VALUE str, const char *ptr, long len)
+rb_str_buf_cat(str, ptr, len)
+ VALUE str;
+ const char *ptr;
+ long len;
{
if (len == 0) return str;
if (len < 0) {
@@ -1749,24 +774,28 @@ rb_str_buf_cat(VALUE str, const char *ptr, long len)
}
VALUE
-rb_str_buf_cat2(VALUE str, const char *ptr)
+rb_str_buf_cat2(str, ptr)
+ VALUE str;
+ const char *ptr;
{
return rb_str_buf_cat(str, ptr, strlen(ptr));
}
VALUE
-rb_str_cat(VALUE str, const char *ptr, long len)
+rb_str_cat(str, ptr, len)
+ VALUE str;
+ const char *ptr;
+ long len;
{
if (len < 0) {
rb_raise(rb_eArgError, "negative string size (or size too big)");
}
- if (STR_ASSOC_P(str)) {
+ if (FL_TEST(str, STR_ASSOC)) {
rb_str_modify(str);
- if (STR_EMBED_P(str)) str_make_independent(str);
- REALLOC_N(RSTRING(str)->as.heap.ptr, char, RSTRING(str)->as.heap.len+len+1);
- memcpy(RSTRING(str)->as.heap.ptr + RSTRING(str)->as.heap.len, ptr, len);
- RSTRING(str)->as.heap.len += len;
- RSTRING(str)->as.heap.ptr[RSTRING(str)->as.heap.len] = '\0'; /* sentinel */
+ REALLOC_N(RSTRING(str)->ptr, char, RSTRING(str)->len+len+1);
+ memcpy(RSTRING(str)->ptr + RSTRING(str)->len, ptr, len);
+ RSTRING(str)->len += len;
+ RSTRING(str)->ptr[RSTRING(str)->len] = '\0'; /* sentinel */
return str;
}
@@ -1774,479 +803,112 @@ rb_str_cat(VALUE str, const char *ptr, long len)
}
VALUE
-rb_str_cat2(VALUE str, const char *ptr)
+rb_str_cat2(str, ptr)
+ VALUE str;
+ const char *ptr;
{
return rb_str_cat(str, ptr, strlen(ptr));
}
-static VALUE
-rb_enc_cr_str_buf_cat(VALUE str, const char *ptr, long len,
- int ptr_encindex, int ptr_cr, int *ptr_cr_ret)
-{
- int str_encindex = ENCODING_GET(str);
- int res_encindex;
- int str_cr, res_cr;
- int str_a8 = ENCODING_IS_ASCII8BIT(str);
- int ptr_a8 = ptr_encindex == 0;
-
- str_cr = ENC_CODERANGE(str);
-
- if (str_encindex == ptr_encindex) {
- if (str_cr == ENC_CODERANGE_UNKNOWN ||
- (ptr_a8 && str_cr != ENC_CODERANGE_7BIT)) {
- ptr_cr = ENC_CODERANGE_UNKNOWN;
- }
- else if (ptr_cr == ENC_CODERANGE_UNKNOWN) {
- ptr_cr = coderange_scan(ptr, len, rb_enc_from_index(ptr_encindex));
- }
- }
- else {
- rb_encoding *str_enc = rb_enc_from_index(str_encindex);
- rb_encoding *ptr_enc = rb_enc_from_index(ptr_encindex);
- if (!rb_enc_asciicompat(str_enc) || !rb_enc_asciicompat(ptr_enc)) {
- if (len == 0)
- return str;
- if (RSTRING_LEN(str) == 0) {
- rb_str_buf_cat(str, ptr, len);
- ENCODING_CODERANGE_SET(str, ptr_encindex, ptr_cr);
- return str;
- }
- goto incompatible;
- }
- if (ptr_cr == ENC_CODERANGE_UNKNOWN) {
- ptr_cr = coderange_scan(ptr, len, ptr_enc);
- }
- if (str_cr == ENC_CODERANGE_UNKNOWN) {
- if (str_a8 || ptr_cr != ENC_CODERANGE_7BIT) {
- str_cr = rb_enc_str_coderange(str);
- }
- }
- }
- if (ptr_cr_ret)
- *ptr_cr_ret = ptr_cr;
-
- if (str_encindex != ptr_encindex &&
- str_cr != ENC_CODERANGE_7BIT &&
- ptr_cr != ENC_CODERANGE_7BIT) {
- incompatible:
- rb_raise(rb_eEncCompatError, "incompatible character encodings: %s and %s",
- rb_enc_name(rb_enc_from_index(str_encindex)),
- rb_enc_name(rb_enc_from_index(ptr_encindex)));
- }
-
- if (str_cr == ENC_CODERANGE_UNKNOWN) {
- res_encindex = str_encindex;
- res_cr = ENC_CODERANGE_UNKNOWN;
- }
- else if (str_cr == ENC_CODERANGE_7BIT) {
- if (ptr_cr == ENC_CODERANGE_7BIT) {
- res_encindex = !str_a8 ? str_encindex : ptr_encindex;
- res_cr = ENC_CODERANGE_7BIT;
- }
- else {
- res_encindex = ptr_encindex;
- res_cr = ptr_cr;
- }
- }
- else if (str_cr == ENC_CODERANGE_VALID) {
- res_encindex = str_encindex;
- res_cr = str_cr;
- }
- else { /* str_cr == ENC_CODERANGE_BROKEN */
- res_encindex = str_encindex;
- res_cr = str_cr;
- if (0 < len) res_cr = ENC_CODERANGE_UNKNOWN;
- }
-
- if (len < 0) {
- rb_raise(rb_eArgError, "negative string size (or size too big)");
- }
- str_buf_cat(str, ptr, len);
- ENCODING_CODERANGE_SET(str, res_encindex, res_cr);
- return str;
-}
-
-VALUE
-rb_enc_str_buf_cat(VALUE str, const char *ptr, long len, rb_encoding *ptr_enc)
-{
- return rb_enc_cr_str_buf_cat(str, ptr, len,
- rb_enc_to_index(ptr_enc), ENC_CODERANGE_UNKNOWN, NULL);
-}
-
-VALUE
-rb_str_buf_cat_ascii(VALUE str, const char *ptr)
-{
- /* ptr must reference NUL terminated ASCII string. */
- int encindex = ENCODING_GET(str);
- rb_encoding *enc = rb_enc_from_index(encindex);
- if (rb_enc_asciicompat(enc)) {
- return rb_enc_cr_str_buf_cat(str, ptr, strlen(ptr),
- encindex, ENC_CODERANGE_7BIT, 0);
- }
- else {
- char *buf = ALLOCA_N(char, rb_enc_mbmaxlen(enc));
- while (*ptr) {
- unsigned int c = (unsigned char)*ptr;
- int len = rb_enc_codelen(c, enc);
- rb_enc_mbcput(c, buf, enc);
- rb_enc_cr_str_buf_cat(str, buf, len,
- encindex, ENC_CODERANGE_VALID, 0);
- ptr++;
- }
- return str;
- }
-}
-
VALUE
-rb_str_buf_append(VALUE str, VALUE str2)
+rb_str_buf_append(str, str2)
+ VALUE str, str2;
{
- int str2_cr;
-
- str2_cr = ENC_CODERANGE(str2);
-
- rb_enc_cr_str_buf_cat(str, RSTRING_PTR(str2), RSTRING_LEN(str2),
- ENCODING_GET(str2), str2_cr, &str2_cr);
-
+ str_buf_cat(str, RSTRING(str2)->ptr, RSTRING(str2)->len);
OBJ_INFECT(str, str2);
- ENC_CODERANGE_SET(str2, str2_cr);
-
return str;
}
VALUE
-rb_str_append(VALUE str, VALUE str2)
+rb_str_append(str, str2)
+ VALUE str, str2;
{
- rb_encoding *enc;
- int cr, cr2;
-
StringValue(str2);
- if (RSTRING_LEN(str2) > 0 && STR_ASSOC_P(str)) {
- long len = RSTRING_LEN(str)+RSTRING_LEN(str2);
- enc = rb_enc_check(str, str2);
- cr = ENC_CODERANGE(str);
- if ((cr2 = ENC_CODERANGE(str2)) > cr) cr = cr2;
- rb_str_modify(str);
- REALLOC_N(RSTRING(str)->as.heap.ptr, char, len+1);
- memcpy(RSTRING(str)->as.heap.ptr + RSTRING(str)->as.heap.len,
- RSTRING_PTR(str2), RSTRING_LEN(str2)+1);
- RSTRING(str)->as.heap.len = len;
- rb_enc_associate(str, enc);
- ENC_CODERANGE_SET(str, cr);
- OBJ_INFECT(str, str2);
- return str;
+ rb_str_modify(str);
+ if (RSTRING(str2)->len > 0) {
+ if (FL_TEST(str, STR_ASSOC)) {
+ long len = RSTRING(str)->len+RSTRING(str2)->len;
+ REALLOC_N(RSTRING(str)->ptr, char, len+1);
+ memcpy(RSTRING(str)->ptr + RSTRING(str)->len,
+ RSTRING(str2)->ptr, RSTRING(str2)->len);
+ RSTRING(str)->ptr[len] = '\0'; /* sentinel */
+ RSTRING(str)->len = len;
+ }
+ else {
+ return rb_str_buf_append(str, str2);
+ }
}
- return rb_str_buf_append(str, str2);
+ OBJ_INFECT(str, str2);
+ return str;
}
/*
* call-seq:
- * str << integer => str
- * str.concat(integer) => str
+ * str << fixnum => str
+ * str.concat(fixnum) => str
* str << obj => str
* str.concat(obj) => str
- *
+ *
* Append---Concatenates the given object to <i>str</i>. If the object is a
- * <code>Integer</code>, it is considered as a codepoint, and is converted
- * to a character before concatenation.
- *
+ * <code>Fixnum</code> between 0 and 255, it is converted to a character before
+ * concatenation.
+ *
* a = "hello "
* a << "world" #=> "hello world"
* a.concat(33) #=> "hello world!"
*/
VALUE
-rb_str_concat(VALUE str1, VALUE str2)
-{
- if (FIXNUM_P(str2) || TYPE(str2) == T_BIGNUM) {
- rb_encoding *enc = STR_ENC_GET(str1);
- unsigned int c = NUM2UINT(str2);
- long pos = RSTRING_LEN(str1);
- int len = rb_enc_codelen(c, enc);
- int cr = ENC_CODERANGE(str1);
-
- rb_str_resize(str1, pos+len);
- rb_enc_mbcput(c, RSTRING_PTR(str1)+pos, enc);
- ENC_CODERANGE_SET(str1, cr);
- return str1;
- }
- return rb_str_append(str1, str2);
-}
-
-#ifndef UNALIGNED_WORD_ACCESS
-# if defined __i386__ || defined _M_IX86
-# define UNALIGNED_WORD_ACCESS 1
-# endif
-#endif
-#ifndef UNALIGNED_WORD_ACCESS
-# define UNALIGNED_WORD_ACCESS 0
-#endif
-
-/* MurmurHash described in http://murmurhash.googlepages.com/ */
-#ifndef MURMUR
-#define MURMUR 2
-#endif
-
-#define MurmurMagic 0x7fd652ad
-
-static inline unsigned long
-murmur(unsigned long h, unsigned long k, int r)
-{
- const unsigned int m = MurmurMagic;
-#if MURMUR == 1
- h += k;
- h *= m;
- h ^= h >> r;
-#elif MURMUR == 2
- k *= m;
- k ^= k >> r;
- k *= m;
-
- h *= m;
- h ^= k;
-#endif
- return h;
-}
-#define murmur16(h) murmur_step(h, 16)
-
-static inline unsigned long
-murmur_finish(unsigned long h)
-{
-#if MURMUR == 1
- h = murmur(h, 0, 10);
- h = murmur(h, 0, 17);
-#elif MURMUR == 2
- h ^= h >> 13;
- h *= MurmurMagic;
- h ^= h >> 15;
-#endif
- return h;
-}
-
-#define murmur_step(h, k) murmur(h, k, 16)
-
-static VALUE
-hash(const unsigned char * data, size_t len, VALUE h)
+rb_str_concat(str1, str2)
+ VALUE str1, str2;
{
- uint32_t t = 0;
-
- h += 0xdeadbeef;
-
-#ifdef WORDS_BIGENDIAN
-# define SHIFT_OFFSET(i) ((i)*CHAR_BIT)
-#else
-# define SHIFT_OFFSET(i) (32-(i)*CHAR_BIT)
-#endif
- if (len >= sizeof(uint32_t)) {
-#if !UNALIGNED_WORD_ACCESS
- int align = (int)((VALUE)data % sizeof(uint32_t));
- if (align) {
- uint32_t d = 0;
- int sl, sr, pack;
-
- switch (align) {
-#ifdef WORDS_BIGENDIAN
- case 1: t |= data[2];
- case 2: t |= data[1] << CHAR_BIT;
- case 3: t |= data[0] << CHAR_BIT*2;
-#else
- case 1: t |= data[2] << CHAR_BIT*2;
- case 2: t |= data[1] << CHAR_BIT;
- case 3: t |= data[0];
-#endif
- }
-
-#ifdef WORDS_BIGENDIAN
- t >>= (CHAR_BIT * align) - CHAR_BIT;
-#else
- t <<= (CHAR_BIT * align);
-#endif
-
- data += sizeof(uint32_t)-align;
- len -= sizeof(uint32_t)-align;
-
- sl = CHAR_BIT * ((int)sizeof(uint32_t)-align);
- sr = CHAR_BIT * align;
-
- while (len >= sizeof(uint32_t)) {
- d = *(uint32_t *)data;
-#ifdef WORDS_BIGENDIAN
- t = (t << sr) | (d >> sl);
-#else
- t = (t >> sr) | (d << sl);
-#endif
- h = murmur_step(h, t);
- t = d;
- data += sizeof(uint32_t);
- len -= sizeof(uint32_t);
- }
-
- pack = len < (size_t)align ? (int)len : align;
- d = 0;
- switch (pack) {
-#ifdef WORDS_BIGENDIAN
- case 3: d |= data[2] << CHAR_BIT;
- case 2: d |= data[1] << CHAR_BIT*2;
- case 1: d |= data[0] << CHAR_BIT*3;
-#else
- case 3: d |= data[2] << CHAR_BIT*2;
- case 2: d |= data[1] << CHAR_BIT;
- case 1: d |= data[0];
-#endif
- }
-#ifdef WORDS_BIGENDIAN
- t = (t << sr) | (d >> sl);
-#else
- t = (t >> sr) | (d << sl);
-#endif
-
-#if MURMUR == 2
- if (len < (size_t)align) goto skip_tail;
-#endif
- h = murmur_step(h, t);
- data += pack;
- len -= pack;
+ if (FIXNUM_P(str2)) {
+ int i = FIX2INT(str2);
+ if (0 <= i && i <= 0xff) { /* byte */
+ char c = i;
+ return rb_str_cat(str1, &c, 1);
}
- else
-#endif
- {
- do {
- h = murmur_step(h, *(uint32_t *)data);
- data += sizeof(uint32_t);
- len -= sizeof(uint32_t);
- } while (len >= sizeof(uint32_t));
- }
- }
-
- t = 0;
- switch (len) {
-#ifdef WORDS_BIGENDIAN
- case 3:
- t |= data[2] << CHAR_BIT;
- case 2:
- t |= data[1] << CHAR_BIT*2;
- case 1:
- t |= data[0] << CHAR_BIT*3;
-#else
- case 3:
- t |= data[2] << CHAR_BIT*2;
- case 2:
- t |= data[1] << CHAR_BIT;
- case 1:
- t |= data[0];
-#endif
-#if MURMUR == 1
- h = murmur_step(h, t);
-#elif MURMUR == 2
-# if !UNALIGNED_WORD_ACCESS
- skip_tail:
-# endif
- h ^= t;
- h *= MurmurMagic;
-#endif
}
+ str1 = rb_str_append(str1, str2);
- return murmur_finish(h);
-}
-
-VALUE
-rb_hash_uint32(VALUE h, unsigned int i)
-{
- return murmur_step(h + i, 16);
-}
-
-VALUE
-rb_hash_uint(VALUE h, VALUE i)
-{
- unsigned long v = 0;
- h += i;
-#ifdef WORDS_BIGENDIAN
-#if SIZEOF_VALUE*CHAR_BIT > 12*8
- v = murmur16(v + (h >> 12*8));
-#endif
-#if SIZEOF_VALUE*CHAR_BIT > 8*8
- v = murmur16(v + (h >> 8*8));
-#endif
-#if SIZEOF_VALUE*CHAR_BIT > 4*8
- v = murmur16(v + (h >> 4*8));
-#endif
-#endif
- v = murmur16(v + h);
-#ifndef WORDS_BIGENDIAN
-#if SIZEOF_VALUE*CHAR_BIT > 4*8
- v = murmur16(v + (h >> 4*8));
-#endif
-#if SIZEOF_VALUE*CHAR_BIT > 8*8
- v = murmur16(v + (h >> 8*8));
-#endif
-#if SIZEOF_VALUE*CHAR_BIT > 12*8
- v = murmur16(v + (h >> 12*8));
-#endif
-#endif
- return v;
+ return str1;
}
-VALUE
-rb_hash_end(VALUE h)
+int
+rb_str_hash(str)
+ VALUE str;
{
- h = murmur_step(h, 10);
- h = murmur_step(h, 17);
- return h;
-}
+ register long len = RSTRING(str)->len;
+ register char *p = RSTRING(str)->ptr;
+ register int key = 0;
-VALUE
-rb_hash_start(VALUE h)
-{
- static int hashseed_init = 0;
- static VALUE hashseed;
+#if defined(HASH_ELFHASH)
+ register unsigned int g;
- if (!hashseed_init) {
- hashseed = rb_genrand_int32();
-#if SIZEOF_VALUE*CHAR_BIT > 4*8
- hashseed <<= 4*8;
- hashseed |= rb_genrand_int32();
-#endif
-#if SIZEOF_VALUE*CHAR_BIT > 8*8
- hashseed <<= 8*8;
- hashseed |= rb_genrand_int32();
-#endif
-#if SIZEOF_VALUE*CHAR_BIT > 12*8
- hashseed <<= 12*8;
- hashseed |= rb_genrand_int32();
-#endif
- hashseed_init = 1;
+ while (len--) {
+ key = (key << 4) + *p++;
+ if (g = key & 0xF0000000)
+ key ^= g >> 24;
+ key &= ~g;
}
-
- return hashseed + h;
-}
-
-int
-rb_memhash(const void *ptr, long len)
-{
- return (int)hash(ptr, len, rb_hash_start(0));
-}
-
-int
-rb_str_hash(VALUE str)
-{
- int e = ENCODING_GET(str);
- if (e && rb_enc_str_coderange(str) == ENC_CODERANGE_7BIT) {
- e = 0;
+#elif defined(HASH_PERL)
+ while (len--) {
+ key += *p++;
+ key += (key << 10);
+ key ^= (key >> 6);
}
- return (int)rb_memhash((const void *)RSTRING_PTR(str), RSTRING_LEN(str)) ^ e;
-}
-
-int
-rb_str_hash_cmp(VALUE str1, VALUE str2)
-{
- int len;
-
- if (!rb_str_comparable(str1, str2)) return 1;
- if (RSTRING_LEN(str1) == (len = RSTRING_LEN(str2)) &&
- memcmp(RSTRING_PTR(str1), RSTRING_PTR(str2), len) == 0) {
- return 0;
+ key += (key << 3);
+ key ^= (key >> 11);
+ key += (key << 15);
+#else
+ while (len--) {
+ key = key*65599 + *p;
+ p++;
}
- return 1;
+ key = key + (key>>5);
+#endif
+ return key;
}
/*
@@ -2257,86 +919,46 @@ rb_str_hash_cmp(VALUE str1, VALUE str2)
*/
static VALUE
-rb_str_hash_m(VALUE str)
+rb_str_hash_m(str)
+ VALUE str;
{
- int hval = rb_str_hash(str);
- return INT2FIX(hval);
+ int key = rb_str_hash(str);
+ return INT2FIX(key);
}
#define lesser(a,b) (((a)>(b))?(b):(a))
int
-rb_str_comparable(VALUE str1, VALUE str2)
-{
- int idx1, idx2;
- int rc1, rc2;
-
- if (RSTRING_LEN(str1) == 0) return Qtrue;
- if (RSTRING_LEN(str2) == 0) return Qtrue;
- idx1 = ENCODING_GET(str1);
- idx2 = ENCODING_GET(str2);
- if (idx1 == idx2) return Qtrue;
- rc1 = rb_enc_str_coderange(str1);
- rc2 = rb_enc_str_coderange(str2);
- if (rc1 == ENC_CODERANGE_7BIT) {
- if (rc2 == ENC_CODERANGE_7BIT) return Qtrue;
- if (rb_enc_asciicompat(rb_enc_from_index(idx2)))
- return Qtrue;
- }
- if (rc2 == ENC_CODERANGE_7BIT) {
- if (rb_enc_asciicompat(rb_enc_from_index(idx1)))
- return Qtrue;
- }
- return Qfalse;
-}
-
-int
-rb_str_cmp(VALUE str1, VALUE str2)
+rb_str_cmp(str1, str2)
+ VALUE str1, str2;
{
long len;
int retval;
- len = lesser(RSTRING_LEN(str1), RSTRING_LEN(str2));
- retval = memcmp(RSTRING_PTR(str1), RSTRING_PTR(str2), len);
+ len = lesser(RSTRING(str1)->len, RSTRING(str2)->len);
+ retval = rb_memcmp(RSTRING(str1)->ptr, RSTRING(str2)->ptr, len);
if (retval == 0) {
- if (RSTRING_LEN(str1) == RSTRING_LEN(str2)) {
- if (!rb_str_comparable(str1, str2)) {
- if (ENCODING_GET(str1) > ENCODING_GET(str2))
- return 1;
- return -1;
- }
- return 0;
- }
- if (RSTRING_LEN(str1) > RSTRING_LEN(str2)) return 1;
+ if (RSTRING(str1)->len == RSTRING(str2)->len) return 0;
+ if (RSTRING(str1)->len > RSTRING(str2)->len) return 1;
return -1;
}
if (retval > 0) return 1;
return -1;
}
-/* expect tail call optimization */
-static VALUE
-str_eql(const VALUE str1, const VALUE str2)
-{
- const long len = RSTRING_LEN(str1);
- if (len != RSTRING_LEN(str2)) return Qfalse;
- if (!rb_str_comparable(str1, str2)) return Qfalse;
- if (memcmp(RSTRING_PTR(str1), RSTRING_PTR(str2), len) == 0)
- return Qtrue;
- return Qfalse;
-}
/*
* call-seq:
* str == obj => true or false
- *
+ *
* Equality---If <i>obj</i> is not a <code>String</code>, returns
* <code>false</code>. Otherwise, returns <code>true</code> if <i>str</i>
* <code><=></code> <i>obj</i> returns zero.
*/
-VALUE
-rb_str_equal(VALUE str1, VALUE str2)
+static VALUE
+rb_str_equal(str1, str2)
+ VALUE str1, str2;
{
if (str1 == str2) return Qtrue;
if (TYPE(str2) != T_STRING) {
@@ -2345,9 +967,15 @@ rb_str_equal(VALUE str1, VALUE str2)
}
return rb_equal(str2, str1);
}
- return str_eql(str1, str2);
+ if (RSTRING(str1)->len == RSTRING(str2)->len &&
+ rb_str_cmp(str1, str2) == 0) {
+ return Qtrue;
+ }
+ return Qfalse;
}
+#define IS_EVSTR(p,e) ((p) < (e) && (*(p) == '$' || *(p) == '@' || *(p) == '{'))
+
/*
* call-seq:
* str.eql?(other) => true or false
@@ -2356,21 +984,30 @@ rb_str_equal(VALUE str1, VALUE str2)
*/
static VALUE
-rb_str_eql(VALUE str1, VALUE str2)
+rb_str_eql(str1, str2)
+ VALUE str1, str2;
{
- if (TYPE(str2) != T_STRING) return Qfalse;
- return str_eql(str1, str2);
+ if (TYPE(str2) != T_STRING || RSTRING(str1)->len != RSTRING(str2)->len)
+ return Qfalse;
+
+ if (memcmp(RSTRING(str1)->ptr, RSTRING(str2)->ptr,
+ lesser(RSTRING(str1)->len, RSTRING(str2)->len)) == 0)
+ return Qtrue;
+
+ return Qfalse;
}
/*
* call-seq:
* str <=> other_str => -1, 0, +1
- *
- * Comparison---Returns -1 if <i>other_str</i> is greater than, 0 if
- * <i>other_str</i> is equal to, and +1 if <i>other_str</i> is less than
+ *
+ * Comparison---Returns -1 if <i>other_str</i> is less than, 0 if
+ * <i>other_str</i> is equal to, and +1 if <i>other_str</i> is greater than
* <i>str</i>. If the strings are of different lengths, and the strings are
* equal when compared up to the shortest length, then the longer string is
- * considered greater than the shorter one. In older versions of Ruby, setting
+ * considered greater than the shorter one. If the variable <code>$=</code> is
+ * <code>false</code>, the comparison is based on comparing the binary values
+ * of each character in the string. In older versions of Ruby, setting
* <code>$=</code> allowed case-insensitive comparisons; this is now deprecated
* in favor of using <code>String#casecmp</code>.
*
@@ -2378,7 +1015,7 @@ rb_str_eql(VALUE str1, VALUE str2)
* <code><=</code>, <code>></code>, <code>>=</code>, and <code>between?</code>,
* included from module <code>Comparable</code>. The method
* <code>String#==</code> does not use <code>Comparable#==</code>.
- *
+ *
* "abcdef" <=> "abcde" #=> 1
* "abcdef" <=> "abcdef" #=> 0
* "abcdef" <=> "abcdefg" #=> -1
@@ -2386,7 +1023,8 @@ rb_str_eql(VALUE str1, VALUE str2)
*/
static VALUE
-rb_str_cmp_m(VALUE str1, VALUE str2)
+rb_str_cmp_m(str1, str2)
+ VALUE str1, str2;
{
long result;
@@ -2416,9 +1054,9 @@ rb_str_cmp_m(VALUE str1, VALUE str2)
/*
* call-seq:
* str.casecmp(other_str) => -1, 0, +1
- *
+ *
* Case-insensitive version of <code>String#<=></code>.
- *
+ *
* "abcdef".casecmp("abcde") #=> 1
* "aBcDeF".casecmp("abcdef") #=> 0
* "abcdef".casecmp("abcdefg") #=> -1
@@ -2426,103 +1064,41 @@ rb_str_cmp_m(VALUE str1, VALUE str2)
*/
static VALUE
-rb_str_casecmp(VALUE str1, VALUE str2)
+rb_str_casecmp(str1, str2)
+ VALUE str1, str2;
{
long len;
- rb_encoding *enc;
- char *p1, *p1end, *p2, *p2end;
+ int retval;
StringValue(str2);
- enc = rb_enc_compatible(str1, str2);
- if (!enc) {
- return Qnil;
- }
-
- p1 = RSTRING_PTR(str1); p1end = RSTRING_END(str1);
- p2 = RSTRING_PTR(str2); p2end = RSTRING_END(str2);
- if (single_byte_optimizable(str1) && single_byte_optimizable(str2)) {
- while (p1 < p1end && p2 < p2end) {
- if (*p1 != *p2) {
- unsigned int c1 = TOUPPER(*p1 & 0xff);
- unsigned int c2 = TOUPPER(*p2 & 0xff);
- if (c1 != c2)
- return INT2FIX(c1 < c2 ? -1 : 1);
- }
- p1++;
- p2++;
- }
+ len = lesser(RSTRING(str1)->len, RSTRING(str2)->len);
+ retval = rb_memcicmp(RSTRING(str1)->ptr, RSTRING(str2)->ptr, len);
+ if (retval == 0) {
+ if (RSTRING(str1)->len == RSTRING(str2)->len) return INT2FIX(0);
+ if (RSTRING(str1)->len > RSTRING(str2)->len) return INT2FIX(1);
+ return INT2FIX(-1);
}
- else {
- while (p1 < p1end && p2 < p2end) {
- int l1, c1 = rb_enc_ascget(p1, p1end, &l1, enc);
- int l2, c2 = rb_enc_ascget(p2, p2end, &l2, enc);
-
- if (0 <= c1 && 0 <= c2) {
- c1 = TOUPPER(c1);
- c2 = TOUPPER(c2);
- if (c1 != c2)
- return INT2FIX(c1 < c2 ? -1 : 1);
- }
- else {
- int r;
- l1 = rb_enc_mbclen(p1, p1end, enc);
- l2 = rb_enc_mbclen(p2, p2end, enc);
- len = l1 < l2 ? l1 : l2;
- r = memcmp(p1, p2, len);
- if (r != 0)
- return INT2FIX(r < 0 ? -1 : 1);
- if (l1 != l2)
- return INT2FIX(l1 < l2 ? -1 : 1);
- }
- p1 += l1;
- p2 += l2;
- }
- }
- if (RSTRING_LEN(str1) == RSTRING_LEN(str2)) return INT2FIX(0);
- if (RSTRING_LEN(str1) > RSTRING_LEN(str2)) return INT2FIX(1);
+ if (retval == 0) return INT2FIX(0);
+ if (retval > 0) return INT2FIX(1);
return INT2FIX(-1);
}
static long
-rb_str_index(VALUE str, VALUE sub, long offset)
+rb_str_index(str, sub, offset)
+ VALUE str, sub;
+ long offset;
{
long pos;
- char *s, *sptr, *e;
- long len, slen;
- rb_encoding *enc;
- enc = rb_enc_check(str, sub);
- if (is_broken_string(sub)) {
- return -1;
- }
- len = str_strlen(str, enc);
- slen = str_strlen(sub, enc);
if (offset < 0) {
- offset += len;
+ offset += RSTRING(str)->len;
if (offset < 0) return -1;
}
- if (len - offset < slen) return -1;
- s = RSTRING_PTR(str);
- e = s + RSTRING_LEN(str);
- if (offset) {
- offset = str_offset(s, RSTRING_END(str), offset, enc, single_byte_optimizable(str));
- s += offset;
- }
- if (slen == 0) return offset;
- /* need proceed one character at a time */
- sptr = RSTRING_PTR(sub);
- slen = RSTRING_LEN(sub);
- len = RSTRING_LEN(str) - offset;
- for (;;) {
- char *t;
- pos = rb_memsearch(sptr, slen, s, len, enc);
- if (pos < 0) return pos;
- t = rb_enc_right_char_head(s, s+pos, e, enc);
- if (t == s + pos) break;
- if ((len -= t - s) <= 0) return -1;
- offset += t - s;
- s = t;
- }
+ if (RSTRING(str)->len - offset < RSTRING(sub)->len) return -1;
+ if (RSTRING(sub)->len == 0) return offset;
+ pos = rb_memsearch(RSTRING(sub)->ptr, RSTRING(sub)->len,
+ RSTRING(str)->ptr+offset, RSTRING(str)->len-offset);
+ if (pos < 0) return pos;
return pos + offset;
}
@@ -2530,22 +1106,26 @@ rb_str_index(VALUE str, VALUE sub, long offset)
/*
* call-seq:
* str.index(substring [, offset]) => fixnum or nil
+ * str.index(fixnum [, offset]) => fixnum or nil
* str.index(regexp [, offset]) => fixnum or nil
- *
- * Returns the index of the first occurrence of the given <i>substring</i> or
- * pattern (<i>regexp</i>) in <i>str</i>. Returns <code>nil</code> if not
- * found. If the second parameter is present, it specifies the position in the
- * string to begin the search.
- *
+ *
+ * Returns the index of the first occurrence of the given <i>substring</i>,
+ * character (<i>fixnum</i>), or pattern (<i>regexp</i>) in <i>str</i>. Returns
+ * <code>nil</code> if not found. If the second parameter is present, it
+ * specifies the position in the string to begin the search.
+ *
* "hello".index('e') #=> 1
* "hello".index('lo') #=> 3
* "hello".index('a') #=> nil
- * "hello".index(?e) #=> 1
+ * "hello".index(101) #=> 1
* "hello".index(/[aeiou]/, -3) #=> 4
*/
static VALUE
-rb_str_index_m(int argc, VALUE *argv, VALUE str)
+rb_str_index_m(argc, argv, str)
+ int argc;
+ VALUE *argv;
+ VALUE str;
{
VALUE sub;
VALUE initpos;
@@ -2558,7 +1138,7 @@ rb_str_index_m(int argc, VALUE *argv, VALUE str)
pos = 0;
}
if (pos < 0) {
- pos += str_strlen(str, STR_ENC_GET(str));
+ pos += RSTRING(str)->len;
if (pos < 0) {
if (TYPE(sub) == T_REGEXP) {
rb_backref_set(Qnil);
@@ -2569,15 +1149,21 @@ rb_str_index_m(int argc, VALUE *argv, VALUE str)
switch (TYPE(sub)) {
case T_REGEXP:
- if (pos > str_strlen(str, STR_ENC_GET(str)))
- return Qnil;
- pos = str_offset(RSTRING_PTR(str), RSTRING_END(str), pos,
- rb_enc_check(str, sub), single_byte_optimizable(str));
-
+ pos = rb_reg_adjust_startpos(sub, str, pos, 0);
pos = rb_reg_search(sub, str, pos, 0);
- pos = rb_str_sublen(str, pos);
break;
+ case T_FIXNUM: {
+ int c = FIX2INT(sub);
+ long len = RSTRING(str)->len;
+ unsigned char *p = (unsigned char*)RSTRING(str)->ptr;
+
+ for (;pos<len;pos++) {
+ if (p[pos] == c) return LONG2NUM(pos);
+ }
+ return Qnil;
+ }
+
default: {
VALUE tmp;
@@ -2591,7 +1177,6 @@ rb_str_index_m(int argc, VALUE *argv, VALUE str)
/* fall through */
case T_STRING:
pos = rb_str_index(str, sub, pos);
- pos = rb_str_sublen(str, pos);
break;
}
@@ -2600,74 +1185,69 @@ rb_str_index_m(int argc, VALUE *argv, VALUE str)
}
static long
-rb_str_rindex(VALUE str, VALUE sub, long pos)
+rb_str_rindex(str, sub, pos)
+ VALUE str, sub;
+ long pos;
{
- long len, slen;
- char *s, *sbeg, *e, *t;
- rb_encoding *enc;
- int singlebyte = single_byte_optimizable(str);
+ long len = RSTRING(sub)->len;
+ char *s, *sbeg, *t;
- enc = rb_enc_check(str, sub);
- if (is_broken_string(sub)) {
- return -1;
- }
- len = str_strlen(str, enc);
- slen = str_strlen(sub, enc);
/* substring longer than string */
- if (len < slen) return -1;
- if (len - pos < slen) {
- pos = len - slen;
- }
- if (len == 0) {
- return pos;
+ if (RSTRING(str)->len < len) return -1;
+ if (RSTRING(str)->len - pos < len) {
+ pos = RSTRING(str)->len - len;
}
- sbeg = RSTRING_PTR(str);
- e = RSTRING_END(str);
- t = RSTRING_PTR(sub);
- slen = RSTRING_LEN(sub);
- for (;;) {
- s = str_nth(sbeg, e, pos, enc, singlebyte);
- if (!s) return -1;
- if (memcmp(s, t, slen) == 0) {
- return pos;
+ sbeg = RSTRING(str)->ptr;
+ s = RSTRING(str)->ptr + pos;
+ t = RSTRING(sub)->ptr;
+ if (len) {
+ while (sbeg <= s) {
+ if (rb_memcmp(s, t, len) == 0) {
+ return s - RSTRING(str)->ptr;
+ }
+ s--;
}
- if (pos == 0) break;
- pos--;
+ return -1;
+ }
+ else {
+ return pos;
}
- return -1;
}
/*
* call-seq:
* str.rindex(substring [, fixnum]) => fixnum or nil
+ * str.rindex(fixnum [, fixnum]) => fixnum or nil
* str.rindex(regexp [, fixnum]) => fixnum or nil
- *
- * Returns the index of the last occurrence of the given <i>substring</i> or
- * pattern (<i>regexp</i>) in <i>str</i>. Returns <code>nil</code> if not
- * found. If the second parameter is present, it specifies the position in the
- * string to end the search---characters beyond this point will not be
- * considered.
- *
+ *
+ * Returns the index of the last occurrence of the given <i>substring</i>,
+ * character (<i>fixnum</i>), or pattern (<i>regexp</i>) in <i>str</i>. Returns
+ * <code>nil</code> if not found. If the second parameter is present, it
+ * specifies the position in the string to end the search---characters beyond
+ * this point will not be considered.
+ *
* "hello".rindex('e') #=> 1
* "hello".rindex('l') #=> 3
* "hello".rindex('a') #=> nil
- * "hello".rindex(?e) #=> 1
+ * "hello".rindex(101) #=> 1
* "hello".rindex(/[aeiou]/, -2) #=> 1
*/
static VALUE
-rb_str_rindex_m(int argc, VALUE *argv, VALUE str)
+rb_str_rindex_m(argc, argv, str)
+ int argc;
+ VALUE *argv;
+ VALUE str;
{
VALUE sub;
- VALUE vpos;
- rb_encoding *enc = STR_ENC_GET(str);
- long pos, len = str_strlen(str, enc);
+ VALUE position;
+ long pos;
- if (rb_scan_args(argc, argv, "11", &sub, &vpos) == 2) {
- pos = NUM2LONG(vpos);
+ if (rb_scan_args(argc, argv, "11", &sub, &position) == 2) {
+ pos = NUM2LONG(position);
if (pos < 0) {
- pos += len;
+ pos += RSTRING(str)->len;
if (pos < 0) {
if (TYPE(sub) == T_REGEXP) {
rb_backref_set(Qnil);
@@ -2675,21 +1255,17 @@ rb_str_rindex_m(int argc, VALUE *argv, VALUE str)
return Qnil;
}
}
- if (pos > len) pos = len;
+ if (pos > RSTRING(str)->len) pos = RSTRING(str)->len;
}
else {
- pos = len;
+ pos = RSTRING(str)->len;
}
switch (TYPE(sub)) {
case T_REGEXP:
- /* enc = rb_get_check(str, sub); */
- pos = str_offset(RSTRING_PTR(str), RSTRING_END(str), pos,
- STR_ENC_GET(str), single_byte_optimizable(str));
-
- if (!RREGEXP(sub)->ptr || RREGEXP_SRC_LEN(sub)) {
+ if (RREGEXP(sub)->len) {
+ pos = rb_reg_adjust_startpos(sub, str, pos, 1);
pos = rb_reg_search(sub, str, pos, 1);
- pos = rb_str_sublen(str, pos);
}
if (pos >= 0) return LONG2NUM(pos);
break;
@@ -2709,6 +1285,22 @@ rb_str_rindex_m(int argc, VALUE *argv, VALUE str)
pos = rb_str_rindex(str, sub, pos);
if (pos >= 0) return LONG2NUM(pos);
break;
+
+ case T_FIXNUM: {
+ int c = FIX2INT(sub);
+ unsigned char *p = (unsigned char*)RSTRING(str)->ptr + pos;
+ unsigned char *pbeg = (unsigned char*)RSTRING(str)->ptr;
+
+ if (pos == RSTRING(str)->len) {
+ if (pos == 0) return Qnil;
+ --p;
+ }
+ while (pbeg <= p) {
+ if (*p == c) return LONG2NUM((char*)p - RSTRING(str)->ptr);
+ p--;
+ }
+ return Qnil;
+ }
}
return Qnil;
}
@@ -2716,19 +1308,20 @@ rb_str_rindex_m(int argc, VALUE *argv, VALUE str)
/*
* call-seq:
* str =~ obj => fixnum or nil
- *
+ *
* Match---If <i>obj</i> is a <code>Regexp</code>, use it as a pattern to match
- * against <i>str</i>,and returns the position the match starts, or
+ * against <i>str</i>,and returns the position the match starts, or
* <code>nil</code> if there is no match. Otherwise, invokes
* <i>obj.=~</i>, passing <i>str</i> as an argument. The default
* <code>=~</code> in <code>Object</code> returns <code>false</code>.
- *
+ *
* "cat o' 9 tails" =~ /\d/ #=> 7
- * "cat o' 9 tails" =~ 9 #=> nil
+ * "cat o' 9 tails" =~ 9 #=> false
*/
static VALUE
-rb_str_match(VALUE x, VALUE y)
+rb_str_match(x, y)
+ VALUE x, y;
{
switch (TYPE(y)) {
case T_STRING:
@@ -2743,185 +1336,52 @@ rb_str_match(VALUE x, VALUE y)
}
-static VALUE get_pat(VALUE, int);
+static VALUE get_pat _((VALUE, int));
/*
* call-seq:
* str.match(pattern) => matchdata or nil
- *
+ *
* Converts <i>pattern</i> to a <code>Regexp</code> (if it isn't already one),
- * then invokes its <code>match</code> method on <i>str</i>. If the second
- * parameter is present, it specifies the position in the string to begin the
- * search.
- *
- * 'hello'.match('(.)\1') #=> #<MatchData "ll" 1:"l">
+ * then invokes its <code>match</code> method on <i>str</i>.
+ *
+ * 'hello'.match('(.)\1') #=> #<MatchData:0x401b3d30>
* 'hello'.match('(.)\1')[0] #=> "ll"
* 'hello'.match(/(.)\1/)[0] #=> "ll"
* 'hello'.match('xx') #=> nil
- *
- * If a block is given, invoke the block with MatchData if match succeed, so
- * that you can write
- *
- * str.match(pat) {|m| ...}
- *
- * instead of
- *
- * if m = str.match(pat)
- * ...
- * end
- *
- * The return value is a value from block execution in this case.
*/
static VALUE
-rb_str_match_m(int argc, VALUE *argv, VALUE str)
+rb_str_match_m(str, re)
+ VALUE str, re;
{
- VALUE re, result;
- if (argc < 1)
- rb_raise(rb_eArgError, "wrong number of arguments (%d for 1)", argc);
- re = argv[0];
- argv[0] = str;
- result = rb_funcall2(get_pat(re, 0), rb_intern("match"), argc, argv);
- if (!NIL_P(result) && rb_block_given_p()) {
- return rb_yield(result);
- }
- return result;
+ return rb_funcall(get_pat(re, 0), rb_intern("match"), 1, str);
}
-enum neighbor_char {
- NEIGHBOR_NOT_CHAR,
- NEIGHBOR_FOUND,
- NEIGHBOR_WRAPPED
-};
+static char
+succ_char(s)
+ char *s;
+{
+ char c = *s;
-static enum neighbor_char
-enc_succ_char(char *p, int len, rb_encoding *enc)
-{
- int i, l;
- while (1) {
- for (i = len-1; 0 <= i && (unsigned char)p[i] == 0xff; i--)
- p[i] = '\0';
- if (i < 0)
- return NEIGHBOR_WRAPPED;
- ++((unsigned char*)p)[i];
- l = rb_enc_precise_mbclen(p, p+len, enc);
- if (MBCLEN_CHARFOUND_P(l)) {
- l = MBCLEN_CHARFOUND_LEN(l);
- if (l == len) {
- return NEIGHBOR_FOUND;
- }
- else {
- memset(p+l, 0xff, len-l);
- }
- }
- if (MBCLEN_INVALID_P(l) && i < len-1) {
- int len2, l2;
- for (len2 = len-1; 0 < len2; len2--) {
- l2 = rb_enc_precise_mbclen(p, p+len2, enc);
- if (!MBCLEN_INVALID_P(l2))
- break;
- }
- memset(p+len2+1, 0xff, len-(len2+1));
- }
- }
-}
-
-static enum neighbor_char
-enc_pred_char(char *p, int len, rb_encoding *enc)
-{
- int i, l;
- while (1) {
- for (i = len-1; 0 <= i && (unsigned char)p[i] == 0; i--)
- p[i] = '\xff';
- if (i < 0)
- return NEIGHBOR_WRAPPED;
- --((unsigned char*)p)[i];
- l = rb_enc_precise_mbclen(p, p+len, enc);
- if (MBCLEN_CHARFOUND_P(l)) {
- l = MBCLEN_CHARFOUND_LEN(l);
- if (l == len) {
- return NEIGHBOR_FOUND;
- }
- else {
- memset(p+l, 0, len-l);
- }
- }
- if (MBCLEN_INVALID_P(l) && i < len-1) {
- int len2, l2;
- for (len2 = len-1; 0 < len2; len2--) {
- l2 = rb_enc_precise_mbclen(p, p+len2, enc);
- if (!MBCLEN_INVALID_P(l2))
- break;
- }
- memset(p+len2+1, 0, len-(len2+1));
- }
+ /* numerics */
+ if ('0' <= c && c < '9') (*s)++;
+ else if (c == '9') {
+ *s = '0';
+ return '1';
}
-}
-
-/*
- overwrite +p+ by succeeding letter in +enc+ and returns
- NEIGHBOR_FOUND or NEIGHBOR_WRAPPED.
- When NEIGHBOR_WRAPPED, carried-out letter is stored into carry.
- assuming each ranges are successive, and mbclen
- never change in each ranges.
- NEIGHBOR_NOT_CHAR is returned if invalid character or the range has only one
- character.
- */
-static enum neighbor_char
-enc_succ_alnum_char(char *p, int len, rb_encoding *enc, char *carry)
-{
- enum neighbor_char ret;
- unsigned int c;
- int ctype;
- int range;
- char save[ONIGENC_CODE_TO_MBC_MAXLEN];
-
- c = rb_enc_mbc_to_codepoint(p, p+len, enc);
- if (rb_enc_isctype(c, ONIGENC_CTYPE_DIGIT, enc))
- ctype = ONIGENC_CTYPE_DIGIT;
- else if (rb_enc_isctype(c, ONIGENC_CTYPE_ALPHA, enc))
- ctype = ONIGENC_CTYPE_ALPHA;
- else
- return NEIGHBOR_NOT_CHAR;
-
- MEMCPY(save, p, char, len);
- ret = enc_succ_char(p, len, enc);
- if (ret == NEIGHBOR_FOUND) {
- c = rb_enc_mbc_to_codepoint(p, p+len, enc);
- if (rb_enc_isctype(c, ctype, enc))
- return NEIGHBOR_FOUND;
- }
- MEMCPY(p, save, char, len);
- range = 1;
- while (1) {
- MEMCPY(save, p, char, len);
- ret = enc_pred_char(p, len, enc);
- if (ret == NEIGHBOR_FOUND) {
- c = rb_enc_mbc_to_codepoint(p, p+len, enc);
- if (!rb_enc_isctype(c, ctype, enc)) {
- MEMCPY(p, save, char, len);
- break;
- }
- }
- else {
- MEMCPY(p, save, char, len);
- break;
- }
- range++;
- }
- if (range == 1) {
- return NEIGHBOR_NOT_CHAR;
- }
-
- if (ctype != ONIGENC_CTYPE_DIGIT) {
- MEMCPY(carry, p, char, len);
- return NEIGHBOR_WRAPPED;
- }
-
- MEMCPY(carry, p, char, len);
- enc_succ_char(carry, len, enc);
- return NEIGHBOR_WRAPPED;
+ /* small alphabets */
+ else if ('a' <= c && c < 'z') (*s)++;
+ else if (c == 'z') {
+ return *s = 'a';
+ }
+ /* capital alphabets */
+ else if ('A' <= c && c < 'Z') (*s)++;
+ else if (c == 'Z') {
+ return *s = 'A';
+ }
+ return 0;
}
@@ -2929,7 +1389,7 @@ enc_succ_alnum_char(char *p, int len, rb_encoding *enc, char *carry)
* call-seq:
* str.succ => new_str
* str.next => new_str
- *
+ *
* Returns the successor to <i>str</i>. The successor is calculated by
* incrementing characters starting from the rightmost alphanumeric (or
* the rightmost character if there are no alphanumerics) in the
@@ -2937,11 +1397,11 @@ enc_succ_alnum_char(char *p, int len, rb_encoding *enc, char *carry)
* incrementing a letter results in another letter of the same case.
* Incrementing nonalphanumerics uses the underlying character set's
* collating sequence.
- *
+ *
* If the increment generates a ``carry,'' the character to the left of
* it is incremented. This process repeats until there is no carry,
* adding an additional character if necessary.
- *
+ *
* "abcd".succ #=> "abce"
* "THX1138".succ #=> "THX1139"
* "<<koala>>".succ #=> "<<koalb>>"
@@ -2950,76 +1410,45 @@ enc_succ_alnum_char(char *p, int len, rb_encoding *enc, char *carry)
* "***".succ #=> "**+"
*/
-VALUE
-rb_str_succ(VALUE orig)
+static VALUE
+rb_str_succ(orig)
+ VALUE orig;
{
- rb_encoding *enc;
VALUE str;
- char *sbeg, *s, *e, *last_alnum = 0;
+ char *sbeg, *s;
int c = -1;
- long l;
- char carry[ONIGENC_CODE_TO_MBC_MAXLEN] = "\1";
- int carry_pos = 0, carry_len = 1;
- enum neighbor_char neighbor = NEIGHBOR_FOUND;
+ long n = 0;
- str = rb_str_new5(orig, RSTRING_PTR(orig), RSTRING_LEN(orig));
- rb_enc_cr_str_copy_for_substr(str, orig);
+ str = rb_str_new5(orig, RSTRING(orig)->ptr, RSTRING(orig)->len);
OBJ_INFECT(str, orig);
- if (RSTRING_LEN(str) == 0) return str;
+ if (RSTRING(str)->len == 0) return str;
- enc = STR_ENC_GET(orig);
- sbeg = RSTRING_PTR(str);
- s = e = sbeg + RSTRING_LEN(str);
+ sbeg = RSTRING(str)->ptr; s = sbeg + RSTRING(str)->len - 1;
- while ((s = rb_enc_prev_char(sbeg, s, e, enc)) != 0) {
- if (neighbor == NEIGHBOR_NOT_CHAR && last_alnum) {
- if (ISALPHA(*last_alnum) ? ISDIGIT(*s) :
- ISDIGIT(*last_alnum) ? ISALPHA(*s) : 0) {
- s = last_alnum;
- break;
- }
- }
- if ((l = rb_enc_precise_mbclen(s, e, enc)) <= 0) continue;
- neighbor = enc_succ_alnum_char(s, l, enc, carry);
- switch (neighbor) {
- case NEIGHBOR_NOT_CHAR:
- continue;
- case NEIGHBOR_FOUND:
- return str;
- case NEIGHBOR_WRAPPED:
- last_alnum = s;
- break;
+ while (sbeg <= s) {
+ if (ISALNUM(*s)) {
+ if ((c = succ_char(s)) == 0) break;
+ n = s - sbeg;
}
- c = 1;
- carry_pos = s - sbeg;
- carry_len = l;
+ s--;
}
if (c == -1) { /* str contains no alnum */
- s = e;
- while ((s = rb_enc_prev_char(sbeg, s, e, enc)) != 0) {
- enum neighbor_char neighbor;
- if ((l = rb_enc_precise_mbclen(s, e, enc)) <= 0) continue;
- neighbor = enc_succ_char(s, l, enc);
- if (neighbor == NEIGHBOR_FOUND)
- return str;
- if (rb_enc_precise_mbclen(s, s+l, enc) != l) {
- /* wrapped to \0...\0. search next valid char. */
- enc_succ_char(s, l, enc);
- }
- if (!rb_enc_asciicompat(enc)) {
- MEMCPY(carry, s, char, l);
- carry_len = l;
- }
- carry_pos = s - sbeg;
- }
- }
- RESIZE_CAPA(str, RSTRING_LEN(str) + carry_len);
- s = RSTRING_PTR(str) + carry_pos;
- memmove(s + carry_len, s, RSTRING_LEN(str) - carry_pos);
- memmove(s, carry, carry_len);
- STR_SET_LEN(str, RSTRING_LEN(str) + carry_len);
- RSTRING_PTR(str)[RSTRING_LEN(str)] = '\0';
- rb_enc_str_coderange(str);
+ sbeg = RSTRING(str)->ptr; s = sbeg + RSTRING(str)->len - 1;
+ c = '\001';
+ while (sbeg <= s) {
+ if ((*s += 1) != 0) break;
+ s--;
+ }
+ }
+ if (s < sbeg) {
+ RESIZE_CAPA(str, RSTRING(str)->len + 1);
+ s = RSTRING(str)->ptr + n;
+ memmove(s+1, s, RSTRING(str)->len - n);
+ *s = c;
+ RSTRING(str)->len += 1;
+ RSTRING(str)->ptr[RSTRING(str)->len] = '\0';
+ }
+
return str;
}
@@ -3028,101 +1457,98 @@ rb_str_succ(VALUE orig)
* call-seq:
* str.succ! => str
* str.next! => str
- *
+ *
* Equivalent to <code>String#succ</code>, but modifies the receiver in
* place.
*/
static VALUE
-rb_str_succ_bang(VALUE str)
+rb_str_succ_bang(str)
+ VALUE str;
{
rb_str_shared_replace(str, rb_str_succ(str));
return str;
}
+VALUE
+rb_str_upto(beg, end, excl)
+ VALUE beg, end;
+ int excl;
+{
+ VALUE current, after_end;
+ ID succ = rb_intern("succ");
+ int n;
+
+ StringValue(end);
+ n = rb_str_cmp(beg, end);
+ if (n > 0 || (excl && n == 0)) return beg;
+ after_end = rb_funcall(end, succ, 0, 0);
+ current = beg;
+ while (!rb_str_equal(current, after_end)) {
+ rb_yield(current);
+ if (!excl && rb_str_equal(current, end)) break;
+ current = rb_funcall(current, succ, 0, 0);
+ StringValue(current);
+ if (excl && rb_str_equal(current, end)) break;
+ StringValue(current);
+ if (RSTRING(current)->len > RSTRING(end)->len || RSTRING(current)->len == 0)
+ break;
+ }
+
+ return beg;
+}
+
/*
* call-seq:
* str.upto(other_str, exclusive=false) {|s| block } => str
- *
+ *
* Iterates through successive values, starting at <i>str</i> and
* ending at <i>other_str</i> inclusive, passing each value in turn to
* the block. The <code>String#succ</code> method is used to generate
* each value. If optional second argument exclusive is omitted or is <code>false</code>,
* the last value will be included; otherwise it will be excluded.
- *
+ *
* "a8".upto("b6") {|s| print s, ' ' }
* for s in "a8".."b6"
* print s, ' '
* end
- *
+ *
* <em>produces:</em>
- *
+ *
* a8 a9 b0 b1 b2 b3 b4 b5 b6
* a8 a9 b0 b1 b2 b3 b4 b5 b6
*/
static VALUE
-rb_str_upto(int argc, VALUE *argv, VALUE beg)
+rb_str_upto_m(argc, argv, beg)
+ int argc;
+ VALUE *argv;
+ VALUE beg;
{
VALUE end, exclusive;
- VALUE current, after_end;
- ID succ;
- int n, excl;
- rb_encoding *enc;
rb_scan_args(argc, argv, "11", &end, &exclusive);
- RETURN_ENUMERATOR(beg, argc, argv);
- excl = RTEST(exclusive);
- CONST_ID(succ, "succ");
- StringValue(end);
- enc = rb_enc_check(beg, end);
- if (RSTRING_LEN(beg) == 1 && RSTRING_LEN(end) == 1 &&
- is_ascii_string(beg) && is_ascii_string(end)) {
- char c = RSTRING_PTR(beg)[0];
- char e = RSTRING_PTR(end)[0];
-
- if (c > e || (excl && c == e)) return beg;
- for (;;) {
- rb_yield(rb_enc_str_new(&c, 1, enc));
- if (!excl && c == e) break;
- c++;
- if (excl && c == e) break;
- }
- return beg;
- }
- n = rb_str_cmp(beg, end);
- if (n > 0 || (excl && n == 0)) return beg;
-
- after_end = rb_funcall(end, succ, 0, 0);
- current = beg;
- while (!rb_str_equal(current, after_end)) {
- rb_yield(current);
- if (!excl && rb_str_equal(current, end)) break;
- current = rb_funcall(current, succ, 0, 0);
- StringValue(current);
- if (excl && rb_str_equal(current, end)) break;
- if (RSTRING_LEN(current) > RSTRING_LEN(end) || RSTRING_LEN(current) == 0)
- break;
- }
- return beg;
+ return rb_str_upto(beg, end, RTEST(exclusive));
}
static VALUE
-rb_str_subpat(VALUE str, VALUE re, VALUE backref)
+rb_str_subpat(str, re, nth)
+ VALUE str, re;
+ int nth;
{
if (rb_reg_search(re, str, 0, 0) >= 0) {
- VALUE match = rb_backref_get();
- int nth = rb_reg_backref_number(match, backref);
- return rb_reg_nth_match(nth, match);
+ return rb_reg_nth_match(nth, rb_backref_get());
}
return Qnil;
}
static VALUE
-rb_str_aref(VALUE str, VALUE indx)
+rb_str_aref(str, indx)
+ VALUE str;
+ VALUE indx;
{
long idx;
@@ -3131,12 +1557,16 @@ rb_str_aref(VALUE str, VALUE indx)
idx = FIX2LONG(indx);
num_index:
- str = rb_str_substr(str, idx, 1);
- if (!NIL_P(str) && RSTRING_LEN(str) == 0) return Qnil;
- return str;
+ if (idx < 0) {
+ idx = RSTRING(str)->len + idx;
+ }
+ if (idx < 0 || RSTRING(str)->len <= idx) {
+ return Qnil;
+ }
+ return INT2FIX(RSTRING(str)->ptr[idx] & 0xff);
case T_REGEXP:
- return rb_str_subpat(str, indx, INT2FIX(0));
+ return rb_str_subpat(str, indx, 0);
case T_STRING:
if (rb_str_index(str, indx, 0) != -1)
@@ -3149,14 +1579,14 @@ rb_str_aref(VALUE str, VALUE indx)
long beg, len;
VALUE tmp;
- len = str_strlen(str, STR_ENC_GET(str));
- switch (rb_range_beg_len(indx, &beg, &len, len, 0)) {
+ switch (rb_range_beg_len(indx, &beg, &len, RSTRING(str)->len, 0)) {
case Qfalse:
break;
case Qnil:
return Qnil;
default:
tmp = rb_str_substr(str, beg, len);
+ OBJ_INFECT(tmp, indx);
return tmp;
}
}
@@ -3169,38 +1599,37 @@ rb_str_aref(VALUE str, VALUE indx)
/*
* call-seq:
- * str[fixnum] => new_str or nil
+ * str[fixnum] => fixnum or nil
* str[fixnum, fixnum] => new_str or nil
* str[range] => new_str or nil
* str[regexp] => new_str or nil
* str[regexp, fixnum] => new_str or nil
* str[other_str] => new_str or nil
- * str.slice(fixnum) => new_str or nil
+ * str.slice(fixnum) => fixnum or nil
* str.slice(fixnum, fixnum) => new_str or nil
* str.slice(range) => new_str or nil
* str.slice(regexp) => new_str or nil
* str.slice(regexp, fixnum) => new_str or nil
- * str.slice(regexp, capname) => new_str or nil
* str.slice(other_str) => new_str or nil
- *
- * Element Reference---If passed a single <code>Fixnum</code>, returns a
- * substring of one character at that position. If passed two <code>Fixnum</code>
+ *
+ * Element Reference---If passed a single <code>Fixnum</code>, returns the code
+ * of the character at that position. If passed two <code>Fixnum</code>
* objects, returns a substring starting at the offset given by the first, and
* a length given by the second. If given a range, a substring containing
* characters at offsets given by the range is returned. In all three cases, if
* an offset is negative, it is counted from the end of <i>str</i>. Returns
* <code>nil</code> if the initial offset falls outside the string, the length
* is negative, or the beginning of the range is greater than the end.
- *
+ *
* If a <code>Regexp</code> is supplied, the matching portion of <i>str</i> is
- * returned. If a numeric or name parameter follows the regular expression, that
+ * returned. If a numeric parameter follows the regular expression, that
* component of the <code>MatchData</code> is returned instead. If a
* <code>String</code> is given, that string is returned if it occurs in
* <i>str</i>. In both cases, <code>nil</code> is returned if there is no
* match.
- *
+ *
* a = "hello there"
- * a[1] #=> "e"
+ * a[1] #=> 101
* a[1,3] #=> "ell"
* a[1..3] #=> "ell"
* a[-3,2] #=> "er"
@@ -3216,11 +1645,14 @@ rb_str_aref(VALUE str, VALUE indx)
*/
static VALUE
-rb_str_aref_m(int argc, VALUE *argv, VALUE str)
+rb_str_aref_m(argc, argv, str)
+ int argc;
+ VALUE *argv;
+ VALUE str;
{
if (argc == 2) {
if (TYPE(argv[0]) == T_REGEXP) {
- return rb_str_subpat(str, argv[0], argv[1]);
+ return rb_str_subpat(str, argv[0], NUM2INT(argv[1]));
}
return rb_str_substr(str, NUM2LONG(argv[0]), NUM2LONG(argv[1]));
}
@@ -3230,156 +1662,100 @@ rb_str_aref_m(int argc, VALUE *argv, VALUE str)
return rb_str_aref(str, argv[0]);
}
-VALUE
-rb_str_drop_bytes(VALUE str, long len)
-{
- char *ptr = RSTRING_PTR(str);
- long olen = RSTRING_LEN(str), nlen;
-
- str_modifiable(str);
- if (len > olen) len = olen;
- nlen = olen - len;
- if (nlen <= RSTRING_EMBED_LEN_MAX) {
- char *oldptr = ptr;
- int fl = (RBASIC(str)->flags & (STR_NOEMBED|ELTS_SHARED));
- STR_SET_EMBED(str);
- STR_SET_EMBED_LEN(str, nlen);
- ptr = RSTRING(str)->as.ary;
- memmove(ptr, oldptr + len, nlen);
- if (fl == STR_NOEMBED) xfree(oldptr);
- }
- else {
- if (!STR_SHARED_P(str)) rb_str_new4(str);
- ptr = RSTRING(str)->as.heap.ptr += len;
- RSTRING(str)->as.heap.len = nlen;
- }
- ptr[nlen] = 0;
- ENC_CODERANGE_CLEAR(str);
- return str;
-}
-
-static void
-rb_str_splice_0(VALUE str, long beg, long len, VALUE val)
-{
- if (beg == 0 && RSTRING_LEN(val) == 0) {
- rb_str_drop_bytes(str, len);
- OBJ_INFECT(str, val);
- return;
- }
-
- rb_str_modify(str);
- if (len < RSTRING_LEN(val)) {
- /* expand string */
- RESIZE_CAPA(str, RSTRING_LEN(str) + RSTRING_LEN(val) - len + 1);
- }
-
- if (RSTRING_LEN(val) != len) {
- memmove(RSTRING_PTR(str) + beg + RSTRING_LEN(val),
- RSTRING_PTR(str) + beg + len,
- RSTRING_LEN(str) - (beg + len));
- }
- if (RSTRING_LEN(val) < beg && len < 0) {
- MEMZERO(RSTRING_PTR(str) + RSTRING_LEN(str), char, -len);
- }
- if (RSTRING_LEN(val) > 0) {
- memmove(RSTRING_PTR(str)+beg, RSTRING_PTR(val), RSTRING_LEN(val));
- }
- STR_SET_LEN(str, RSTRING_LEN(str) + RSTRING_LEN(val) - len);
- if (RSTRING_PTR(str)) {
- RSTRING_PTR(str)[RSTRING_LEN(str)] = '\0';
- }
- OBJ_INFECT(str, val);
-}
-
static void
-rb_str_splice(VALUE str, long beg, long len, VALUE val)
+rb_str_splice(str, beg, len, val)
+ VALUE str;
+ long beg, len;
+ VALUE val;
{
- long slen;
- char *p, *e;
- rb_encoding *enc;
- int singlebyte = single_byte_optimizable(str);
- int cr;
-
if (len < 0) rb_raise(rb_eIndexError, "negative length %ld", len);
StringValue(val);
- enc = rb_enc_check(str, val);
- slen = str_strlen(str, enc);
+ rb_str_modify(str);
- if (slen < beg) {
+ if (RSTRING(str)->len < beg) {
out_of_range:
rb_raise(rb_eIndexError, "index %ld out of string", beg);
}
if (beg < 0) {
- if (-beg > slen) {
+ if (-beg > RSTRING(str)->len) {
goto out_of_range;
}
- beg += slen;
+ beg += RSTRING(str)->len;
+ }
+ if (RSTRING(str)->len < len || RSTRING(str)->len < beg + len) {
+ len = RSTRING(str)->len - beg;
+ }
+
+ if (len < RSTRING(val)->len) {
+ /* expand string */
+ RESIZE_CAPA(str, RSTRING(str)->len + RSTRING(val)->len - len + 1);
+ }
+
+ if (RSTRING(val)->len != len) {
+ memmove(RSTRING(str)->ptr + beg + RSTRING(val)->len,
+ RSTRING(str)->ptr + beg + len,
+ RSTRING(str)->len - (beg + len));
+ }
+ if (RSTRING(str)->len < beg && len < 0) {
+ MEMZERO(RSTRING(str)->ptr + RSTRING(str)->len, char, -len);
}
- if (slen < len || slen < beg + len) {
- len = slen - beg;
+ if (RSTRING(val)->len > 0) {
+ memmove(RSTRING(str)->ptr+beg, RSTRING(val)->ptr, RSTRING(val)->len);
}
- str_modify_keep_cr(str);
- p = str_nth(RSTRING_PTR(str), RSTRING_END(str), beg, enc, singlebyte);
- if (!p) p = RSTRING_END(str);
- e = str_nth(p, RSTRING_END(str), len, enc, singlebyte);
- if (!e) e = RSTRING_END(str);
- /* error check */
- beg = p - RSTRING_PTR(str); /* physical position */
- len = e - p; /* physical length */
- rb_str_splice_0(str, beg, len, val);
- rb_enc_associate(str, enc);
- cr = ENC_CODERANGE_AND(ENC_CODERANGE(str), ENC_CODERANGE(val));
- if (cr != ENC_CODERANGE_BROKEN)
- ENC_CODERANGE_SET(str, cr);
+ RSTRING(str)->len += RSTRING(val)->len - len;
+ if (RSTRING(str)->ptr) {
+ RSTRING(str)->ptr[RSTRING(str)->len] = '\0';
+ }
+ OBJ_INFECT(str, val);
}
void
-rb_str_update(VALUE str, long beg, long len, VALUE val)
+rb_str_update(str, beg, len, val)
+ VALUE str;
+ long beg, len;
+ VALUE val;
{
rb_str_splice(str, beg, len, val);
}
static void
-rb_str_subpat_set(VALUE str, VALUE re, VALUE backref, VALUE val)
-{
+rb_str_subpat_set(str, re, nth, val)
+ VALUE str, re;
int nth;
+ VALUE val;
+{
VALUE match;
long start, end, len;
- rb_encoding *enc;
- struct re_registers *regs;
if (rb_reg_search(re, str, 0, 0) < 0) {
rb_raise(rb_eIndexError, "regexp not matched");
}
match = rb_backref_get();
- nth = rb_reg_backref_number(match, backref);
- regs = RMATCH_REGS(match);
- if (nth >= regs->num_regs) {
+ if (nth >= RMATCH(match)->regs->num_regs) {
out_of_range:
rb_raise(rb_eIndexError, "index %d out of regexp", nth);
}
if (nth < 0) {
- if (-nth >= regs->num_regs) {
+ if (-nth >= RMATCH(match)->regs->num_regs) {
goto out_of_range;
}
- nth += regs->num_regs;
+ nth += RMATCH(match)->regs->num_regs;
}
- start = BEG(nth);
+ start = RMATCH(match)->BEG(nth);
if (start == -1) {
rb_raise(rb_eIndexError, "regexp group %d not matched", nth);
}
- end = END(nth);
+ end = RMATCH(match)->END(nth);
len = end - start;
- StringValue(val);
- enc = rb_enc_check(str, val);
- rb_str_splice_0(str, start, len, val);
- rb_enc_associate(str, enc);
+ rb_str_splice(str, start, len, val);
}
static VALUE
-rb_str_aset(VALUE str, VALUE indx, VALUE val)
+rb_str_aset(str, indx, val)
+ VALUE str;
+ VALUE indx, val;
{
long idx, beg;
@@ -3387,11 +1763,30 @@ rb_str_aset(VALUE str, VALUE indx, VALUE val)
case T_FIXNUM:
idx = FIX2LONG(indx);
num_index:
- rb_str_splice(str, idx, 1, val);
+ if (RSTRING(str)->len <= idx) {
+ out_of_range:
+ rb_raise(rb_eIndexError, "index %ld out of string", idx);
+ }
+ if (idx < 0) {
+ if (-idx > RSTRING(str)->len)
+ goto out_of_range;
+ idx += RSTRING(str)->len;
+ }
+ if (FIXNUM_P(val)) {
+ rb_str_modify(str);
+ if (RSTRING(str)->len == idx) {
+ RSTRING(str)->len += 1;
+ RESIZE_CAPA(str, RSTRING(str)->len);
+ }
+ RSTRING(str)->ptr[idx] = FIX2INT(val) & 0xff;
+ }
+ else {
+ rb_str_splice(str, idx, 1, val);
+ }
return val;
case T_REGEXP:
- rb_str_subpat_set(str, indx, INT2FIX(0), val);
+ rb_str_subpat_set(str, indx, 0, val);
return val;
case T_STRING:
@@ -3399,15 +1794,14 @@ rb_str_aset(VALUE str, VALUE indx, VALUE val)
if (beg < 0) {
rb_raise(rb_eIndexError, "string not matched");
}
- beg = rb_str_sublen(str, beg);
- rb_str_splice(str, beg, str_strlen(indx, 0), val);
+ rb_str_splice(str, beg, RSTRING(indx)->len, val);
return val;
default:
/* check if indx is Range */
{
long beg, len;
- if (rb_range_beg_len(indx, &beg, &len, str_strlen(str, 0), 2)) {
+ if (rb_range_beg_len(indx, &beg, &len, RSTRING(str)->len, 2)) {
rb_str_splice(str, beg, len, val);
return val;
}
@@ -3419,14 +1813,14 @@ rb_str_aset(VALUE str, VALUE indx, VALUE val)
/*
* call-seq:
+ * str[fixnum] = fixnum
* str[fixnum] = new_str
* str[fixnum, fixnum] = new_str
* str[range] = aString
* str[regexp] = new_str
* str[regexp, fixnum] = new_str
- * str[regexp, name] = new_str
* str[other_str] = new_str
- *
+ *
* Element Assignment---Replaces some or all of the content of <i>str</i>. The
* portion of the string affected is determined using the same criteria as
* <code>String#[]</code>. If the replacement string is not the same length as
@@ -3443,11 +1837,14 @@ rb_str_aset(VALUE str, VALUE indx, VALUE val)
*/
static VALUE
-rb_str_aset_m(int argc, VALUE *argv, VALUE str)
+rb_str_aset_m(argc, argv, str)
+ int argc;
+ VALUE *argv;
+ VALUE str;
{
if (argc == 3) {
if (TYPE(argv[0]) == T_REGEXP) {
- rb_str_subpat_set(str, argv[0], argv[1], argv[2]);
+ rb_str_subpat_set(str, argv[0], NUM2INT(argv[1]), argv[2]);
}
else {
rb_str_splice(str, NUM2LONG(argv[0]), NUM2LONG(argv[1]), argv[2]);
@@ -3463,13 +1860,13 @@ rb_str_aset_m(int argc, VALUE *argv, VALUE str)
/*
* call-seq:
* str.insert(index, other_str) => str
- *
+ *
* Inserts <i>other_str</i> before the character at the given
* <i>index</i>, modifying <i>str</i>. Negative indices count from the
* end of the string, and insert <em>after</em> the given character.
* The intent is insert <i>aString</i> so that it starts at the given
* <i>index</i>.
- *
+ *
* "abcd".insert(0, 'X') #=> "Xabcd"
* "abcd".insert(3, 'X') #=> "abcXd"
* "abcd".insert(4, 'X') #=> "abcdX"
@@ -3478,12 +1875,13 @@ rb_str_aset_m(int argc, VALUE *argv, VALUE str)
*/
static VALUE
-rb_str_insert(VALUE str, VALUE idx, VALUE str2)
+rb_str_insert(str, idx, str2)
+ VALUE str, idx, str2;
{
long pos = NUM2LONG(idx);
if (pos == -1) {
- return rb_str_append(str, str2);
+ pos = RSTRING(str)->len;
}
else if (pos < 0) {
pos++;
@@ -3492,7 +1890,6 @@ rb_str_insert(VALUE str, VALUE idx, VALUE str2)
return str;
}
-
/*
* call-seq:
* str.slice!(fixnum) => fixnum or nil
@@ -3500,12 +1897,15 @@ rb_str_insert(VALUE str, VALUE idx, VALUE str2)
* str.slice!(range) => new_str or nil
* str.slice!(regexp) => new_str or nil
* str.slice!(other_str) => new_str or nil
- *
+ *
* Deletes the specified portion from <i>str</i>, and returns the portion
- * deleted.
- *
+ * deleted. The forms that take a <code>Fixnum</code> will raise an
+ * <code>IndexError</code> if the value is out of range; the <code>Range</code>
+ * form will raise a <code>RangeError</code>, and the <code>Regexp</code> and
+ * <code>String</code> forms will silently ignore the assignment.
+ *
* string = "this is a string"
- * string.slice!(2) #=> "i"
+ * string.slice!(2) #=> 105
* string.slice!(3..6) #=> " is "
* string.slice!(/s.*t/) #=> "sa st"
* string.slice!("r") #=> "r"
@@ -3513,7 +1913,10 @@ rb_str_insert(VALUE str, VALUE idx, VALUE str2)
*/
static VALUE
-rb_str_slice_bang(int argc, VALUE *argv, VALUE str)
+rb_str_slice_bang(argc, argv, str)
+ int argc;
+ VALUE *argv;
+ VALUE str;
{
VALUE result;
VALUE buf[3];
@@ -3525,7 +1928,6 @@ rb_str_slice_bang(int argc, VALUE *argv, VALUE str)
for (i=0; i<argc; i++) {
buf[i] = argv[i];
}
- str_modify_keep_cr(str);
buf[i] = rb_str_new(0,0);
result = rb_str_aref_m(argc, buf, str);
if (!NIL_P(result)) {
@@ -3535,7 +1937,9 @@ rb_str_slice_bang(int argc, VALUE *argv, VALUE str)
}
static VALUE
-get_pat(VALUE pat, int quote)
+get_pat(pat, quote)
+ VALUE pat;
+ int quote;
{
VALUE val;
@@ -3561,24 +1965,51 @@ get_pat(VALUE pat, int quote)
return rb_reg_regcomp(pat);
}
+static VALUE
+get_pat_quoted(pat)
+ VALUE pat;
+{
+ return get_pat(pat, 1);
+}
+
+static VALUE
+regcomp_failed(str)
+ VALUE str;
+{
+ rb_raise(rb_eArgError, "invalid byte sequence");
+ /*NOTREACHED*/
+ return Qundef;
+}
+
+static VALUE
+get_arg_pat(pat, quote)
+ VALUE pat;
+{
+ return rb_rescue2(get_pat_quoted, pat,
+ regcomp_failed, pat,
+ rb_eRegexpError, (VALUE)0);
+}
/*
* call-seq:
* str.sub!(pattern, replacement) => str or nil
* str.sub!(pattern) {|match| block } => str or nil
- *
+ *
* Performs the substitutions of <code>String#sub</code> in place,
* returning <i>str</i>, or <code>nil</code> if no substitutions were
* performed.
*/
static VALUE
-rb_str_sub_bang(int argc, VALUE *argv, VALUE str)
+rb_str_sub_bang(argc, argv, str)
+ int argc;
+ VALUE *argv;
+ VALUE str;
{
- VALUE pat, repl, hash = Qnil;
+ VALUE pat, repl, match;
+ struct re_registers *regs;
int iter = 0;
int tainted = 0;
- int untrusted = 0;
long plen;
if (argc == 1 && rb_block_given_p()) {
@@ -3586,12 +2017,8 @@ rb_str_sub_bang(int argc, VALUE *argv, VALUE str)
}
else if (argc == 2) {
repl = argv[1];
- hash = rb_check_convert_type(argv[1], T_HASH, "Hash", "to_hash");
- if (NIL_P(hash)) {
- StringValue(repl);
- }
+ StringValue(repl);
if (OBJ_TAINTED(repl)) tainted = 1;
- if (OBJ_UNTRUSTED(repl)) untrusted = 1;
}
else {
rb_raise(rb_eArgError, "wrong number of arguments (%d for 2)", argc);
@@ -3599,69 +2026,37 @@ rb_str_sub_bang(int argc, VALUE *argv, VALUE str)
pat = get_pat(argv[0], 1);
if (rb_reg_search(pat, str, 0, 0) >= 0) {
- rb_encoding *enc;
- int cr = ENC_CODERANGE(str);
- VALUE match = rb_backref_get();
- struct re_registers *regs = RMATCH_REGS(match);
- long beg0 = BEG(0);
- long end0 = END(0);
-
- if (iter || !NIL_P(hash)) {
- char *p = RSTRING_PTR(str); long len = RSTRING_LEN(str);
-
- if (iter) {
- repl = rb_obj_as_string(rb_yield(rb_reg_nth_match(0, match)));
- }
- else {
- repl = rb_hash_aref(hash, rb_str_subseq(str, beg0, end0 - beg0));
- repl = rb_obj_as_string(repl);
- }
+ match = rb_backref_get();
+ regs = RMATCH(match)->regs;
+
+ if (iter) {
+ char *p = RSTRING(str)->ptr; long len = RSTRING(str)->len;
+
+ rb_match_busy(match);
+ repl = rb_obj_as_string(rb_yield(rb_reg_nth_match(0, match)));
str_mod_check(str, p, len);
str_frozen_check(str);
+ rb_backref_set(match);
}
else {
- repl = rb_reg_regsub(repl, str, regs, pat);
- }
- enc = rb_enc_compatible(str, repl);
- if (!enc) {
- rb_encoding *str_enc = STR_ENC_GET(str);
- if (coderange_scan(RSTRING_PTR(str), beg0, str_enc) != ENC_CODERANGE_7BIT ||
- coderange_scan(RSTRING_PTR(str)+end0,
- RSTRING_LEN(str)-end0, str_enc) != ENC_CODERANGE_7BIT) {
- rb_raise(rb_eEncCompatError, "incompatible character encodings: %s and %s",
- rb_enc_name(str_enc),
- rb_enc_name(STR_ENC_GET(repl)));
- }
- enc = STR_ENC_GET(repl);
- }
+ repl = rb_reg_regsub(repl, str, regs);
+ }
rb_str_modify(str);
- rb_enc_associate(str, enc);
if (OBJ_TAINTED(repl)) tainted = 1;
- if (OBJ_UNTRUSTED(repl)) untrusted = 1;
- if (ENC_CODERANGE_UNKNOWN < cr && cr < ENC_CODERANGE_BROKEN) {
- int cr2 = ENC_CODERANGE(repl);
- if (cr2 == ENC_CODERANGE_BROKEN ||
- (cr == ENC_CODERANGE_VALID && cr2 == ENC_CODERANGE_7BIT))
- cr = ENC_CODERANGE_UNKNOWN;
- else
- cr = cr2;
- }
- plen = end0 - beg0;
- if (RSTRING_LEN(repl) > plen) {
- RESIZE_CAPA(str, RSTRING_LEN(str) + RSTRING_LEN(repl) - plen);
- }
- if (RSTRING_LEN(repl) != plen) {
- memmove(RSTRING_PTR(str) + beg0 + RSTRING_LEN(repl),
- RSTRING_PTR(str) + beg0 + plen,
- RSTRING_LEN(str) - beg0 - plen);
- }
- memcpy(RSTRING_PTR(str) + beg0,
- RSTRING_PTR(repl), RSTRING_LEN(repl));
- STR_SET_LEN(str, RSTRING_LEN(str) + RSTRING_LEN(repl) - plen);
- RSTRING_PTR(str)[RSTRING_LEN(str)] = '\0';
- ENC_CODERANGE_SET(str, cr);
+ plen = END(0) - BEG(0);
+ if (RSTRING(repl)->len > plen) {
+ RESIZE_CAPA(str, RSTRING(str)->len + RSTRING(repl)->len - plen);
+ }
+ if (RSTRING(repl)->len != plen) {
+ memmove(RSTRING(str)->ptr + BEG(0) + RSTRING(repl)->len,
+ RSTRING(str)->ptr + BEG(0) + plen,
+ RSTRING(str)->len - BEG(0) - plen);
+ }
+ memcpy(RSTRING(str)->ptr + BEG(0),
+ RSTRING(repl)->ptr, RSTRING(repl)->len);
+ RSTRING(str)->len += RSTRING(repl)->len - plen;
+ RSTRING(str)->ptr[RSTRING(str)->len] = '\0';
if (tainted) OBJ_TAINT(str);
- if (untrusted) OBJ_UNTRUST(str);
return str;
}
@@ -3673,35 +2068,37 @@ rb_str_sub_bang(int argc, VALUE *argv, VALUE str)
* call-seq:
* str.sub(pattern, replacement) => new_str
* str.sub(pattern) {|match| block } => new_str
- *
+ *
* Returns a copy of <i>str</i> with the <em>first</em> occurrence of
* <i>pattern</i> replaced with either <i>replacement</i> or the value of the
* block. The <i>pattern</i> will typically be a <code>Regexp</code>; if it is
* a <code>String</code> then no regular expression metacharacters will be
* interpreted (that is <code>/\d/</code> will match a digit, but
* <code>'\d'</code> will match a backslash followed by a 'd').
- *
+ *
* If the method call specifies <i>replacement</i>, special variables such as
* <code>$&</code> will not be useful, as substitution into the string occurs
* before the pattern match starts. However, the sequences <code>\1</code>,
- * <code>\2</code>, <code>\k<group_name></code>, etc., may be used.
- *
+ * <code>\2</code>, etc., may be used.
+ *
* In the block form, the current match string is passed in as a parameter, and
* variables such as <code>$1</code>, <code>$2</code>, <code>$`</code>,
* <code>$&</code>, and <code>$'</code> will be set appropriately. The value
* returned by the block will be substituted for the match on each call.
- *
+ *
* The result inherits any tainting in the original string or any supplied
* replacement string.
- *
- * "hello".sub(/[aeiou]/, '*') #=> "h*llo"
- * "hello".sub(/([aeiou])/, '<\1>') #=> "h<e>llo"
- * "hello".sub(/./) {|s| s[0].ord.to_s + ' ' } #=> "104 ello"
- * "hello".sub(/(?<foo>[aeiou])/, '*\k<foo>*') #=> "h*e*llo"
+ *
+ * "hello".sub(/[aeiou]/, '*') #=> "h*llo"
+ * "hello".sub(/([aeiou])/, '<\1>') #=> "h<e>llo"
+ * "hello".sub(/./) {|s| s[0].to_s + ' ' } #=> "104 ello"
*/
static VALUE
-rb_str_sub(int argc, VALUE *argv, VALUE str)
+rb_str_sub(argc, argv, str)
+ int argc;
+ VALUE *argv;
+ VALUE str;
{
str = rb_str_dup(str);
rb_str_sub_bang(argc, argv, str);
@@ -3709,111 +2106,127 @@ rb_str_sub(int argc, VALUE *argv, VALUE str)
}
static VALUE
-str_gsub(int argc, VALUE *argv, VALUE str, int bang)
+str_gsub(argc, argv, str, bang)
+ int argc;
+ VALUE *argv;
+ VALUE str;
+ int bang;
{
- VALUE pat, val, repl, match, dest, hash = Qnil;
+ VALUE pat, val, repl, match, dest;
struct re_registers *regs;
long beg, n;
- long beg0, end0;
- long offset, blen, slen, len, last;
+ long offset, blen, slen, len;
int iter = 0;
- char *sp, *cp;
+ char *buf, *bp, *sp, *cp;
int tainted = 0;
- rb_encoding *str_enc;
- switch (argc) {
- case 1:
- RETURN_ENUMERATOR(str, argc, argv);
+ if (argc == 1) {
+ RETURN_ENUMERATOR(str, argc, argv);
iter = 1;
- break;
- case 2:
+ }
+ else if (argc == 2) {
repl = argv[1];
- hash = rb_check_convert_type(argv[1], T_HASH, "Hash", "to_hash");
- if (NIL_P(hash)) {
- StringValue(repl);
- }
+ StringValue(repl);
if (OBJ_TAINTED(repl)) tainted = 1;
- break;
- default:
+ }
+ else {
rb_raise(rb_eArgError, "wrong number of arguments (%d for 2)", argc);
}
pat = get_pat(argv[0], 1);
+ offset=0; n=0;
beg = rb_reg_search(pat, str, 0, 0);
if (beg < 0) {
if (bang) return Qnil; /* no match, no substitution */
return rb_str_dup(str);
}
- offset = 0;
- n = 0;
- blen = RSTRING_LEN(str) + 30; /* len + margin */
- dest = rb_str_buf_new(blen);
- sp = RSTRING_PTR(str);
- slen = RSTRING_LEN(str);
- cp = sp;
- str_enc = STR_ENC_GET(str);
+ blen = RSTRING(str)->len + 30; /* len + margin */
+ dest = str_new(0, 0, blen);
+ buf = RSTRING(dest)->ptr;
+ bp = buf;
+ sp = cp = RSTRING(str)->ptr;
+ slen = RSTRING(str)->len;
- do {
+ rb_str_locktmp(dest);
+ while (beg >= 0) {
n++;
match = rb_backref_get();
- regs = RMATCH_REGS(match);
- beg0 = BEG(0);
- end0 = END(0);
- if (iter || !NIL_P(hash)) {
- if (iter) {
- val = rb_obj_as_string(rb_yield(rb_reg_nth_match(0, match)));
- }
- else {
- val = rb_hash_aref(hash, rb_str_subseq(str, BEG(0), END(0) - BEG(0)));
- val = rb_obj_as_string(val);
- }
+ regs = RMATCH(match)->regs;
+ if (iter) {
+ rb_match_busy(match);
+ val = rb_obj_as_string(rb_yield(rb_reg_nth_match(0, match)));
str_mod_check(str, sp, slen);
- if (val == dest) { /* paranoid check [ruby-dev:24827] */
+ if (bang) str_frozen_check(str);
+ if (val == dest) { /* paranoid chack [ruby-dev:24827] */
rb_raise(rb_eRuntimeError, "block should not cheat");
}
+ rb_backref_set(match);
}
else {
- val = rb_reg_regsub(repl, str, regs, pat);
+ val = rb_reg_regsub(repl, str, regs);
}
-
if (OBJ_TAINTED(val)) tainted = 1;
-
+ len = (bp - buf) + (beg - offset) + RSTRING(val)->len + 3;
+ if (blen < len) {
+ while (blen < len) blen *= 2;
+ len = bp - buf;
+ RESIZE_CAPA(dest, blen);
+ RSTRING(dest)->len = blen;
+ buf = RSTRING(dest)->ptr;
+ bp = buf + len;
+ }
len = beg - offset; /* copy pre-match substr */
- if (len) {
- rb_enc_str_buf_cat(dest, cp, len, str_enc);
- }
-
- rb_str_buf_append(dest, val);
-
- last = offset;
- offset = end0;
- if (beg0 == end0) {
+ memcpy(bp, cp, len);
+ bp += len;
+ memcpy(bp, RSTRING(val)->ptr, RSTRING(val)->len);
+ bp += RSTRING(val)->len;
+ offset = END(0);
+ if (BEG(0) == END(0)) {
/*
* Always consume at least one character of the input string
* in order to prevent infinite loops.
*/
- if (RSTRING_LEN(str) <= end0) break;
- len = rb_enc_fast_mbclen(RSTRING_PTR(str)+end0, RSTRING_END(str), str_enc);
- rb_enc_str_buf_cat(dest, RSTRING_PTR(str)+end0, len, str_enc);
- offset = end0 + len;
- }
- cp = RSTRING_PTR(str) + offset;
- if (offset > RSTRING_LEN(str)) break;
+ if (RSTRING(str)->len <= END(0)) break;
+ len = mbclen2(RSTRING(str)->ptr[END(0)], pat);
+ memcpy(bp, RSTRING(str)->ptr+END(0), len);
+ bp += len;
+ offset = END(0) + len;
+ }
+ cp = RSTRING(str)->ptr + offset;
+ if (offset > RSTRING(str)->len) break;
beg = rb_reg_search(pat, str, offset, 0);
- } while (beg >= 0);
- if (RSTRING_LEN(str) > offset) {
- rb_enc_str_buf_cat(dest, cp, RSTRING_LEN(str) - offset, str_enc);
}
- rb_reg_search(pat, str, last, 0);
+ if (RSTRING(str)->len > offset) {
+ len = bp - buf;
+ if (blen - len < RSTRING(str)->len - offset) {
+ blen = len + RSTRING(str)->len - offset;
+ RESIZE_CAPA(dest, blen);
+ buf = RSTRING(dest)->ptr;
+ bp = buf + len;
+ }
+ memcpy(bp, cp, RSTRING(str)->len - offset);
+ bp += RSTRING(str)->len - offset;
+ }
+ rb_backref_set(match);
+ *bp = '\0';
+ rb_str_unlocktmp(dest);
if (bang) {
- rb_str_shared_replace(str, dest);
+ if (str_independent(str)) {
+ free(RSTRING(str)->ptr);
+ }
+ FL_UNSET(str, STR_NOCAPA);
+ RSTRING(str)->ptr = buf;
+ RSTRING(str)->aux.capa = blen;
+ RSTRING(dest)->ptr = 0;
+ RSTRING(dest)->len = 0;
}
else {
RBASIC(dest)->klass = rb_obj_class(str);
OBJ_INFECT(dest, str);
str = dest;
}
+ RSTRING(str)->len = bp - buf;
if (tainted) OBJ_TAINT(str);
return str;
@@ -3824,15 +2237,17 @@ str_gsub(int argc, VALUE *argv, VALUE str, int bang)
* call-seq:
* str.gsub!(pattern, replacement) => str or nil
* str.gsub!(pattern) {|match| block } => str or nil
- *
+ *
* Performs the substitutions of <code>String#gsub</code> in place, returning
* <i>str</i>, or <code>nil</code> if no substitutions were performed.
*/
static VALUE
-rb_str_gsub_bang(int argc, VALUE *argv, VALUE str)
+rb_str_gsub_bang(argc, argv, str)
+ int argc;
+ VALUE *argv;
+ VALUE str;
{
- str_modify_keep_cr(str);
return str_gsub(argc, argv, str, 1);
}
@@ -3841,37 +2256,38 @@ rb_str_gsub_bang(int argc, VALUE *argv, VALUE str)
* call-seq:
* str.gsub(pattern, replacement) => new_str
* str.gsub(pattern) {|match| block } => new_str
- *
+ *
* Returns a copy of <i>str</i> with <em>all</em> occurrences of <i>pattern</i>
* replaced with either <i>replacement</i> or the value of the block. The
* <i>pattern</i> will typically be a <code>Regexp</code>; if it is a
* <code>String</code> then no regular expression metacharacters will be
* interpreted (that is <code>/\d/</code> will match a digit, but
* <code>'\d'</code> will match a backslash followed by a 'd').
- *
+ *
* If a string is used as the replacement, special variables from the match
* (such as <code>$&</code> and <code>$1</code>) cannot be substituted into it,
* as substitution into the string occurs before the pattern match
- * starts. However, the sequences <code>\1</code>, <code>\2</code>,
- * <code>\k<group_name></code>, and so on may be used to interpolate
- * successive groups in the match.
- *
+ * starts. However, the sequences <code>\1</code>, <code>\2</code>, and so on
+ * may be used to interpolate successive groups in the match.
+ *
* In the block form, the current match string is passed in as a parameter, and
* variables such as <code>$1</code>, <code>$2</code>, <code>$`</code>,
* <code>$&</code>, and <code>$'</code> will be set appropriately. The value
* returned by the block will be substituted for the match on each call.
- *
+ *
* The result inherits any tainting in the original string or any supplied
* replacement string.
- *
- * "hello".gsub(/[aeiou]/, '*') #=> "h*ll*"
- * "hello".gsub(/([aeiou])/, '<\1>') #=> "h<e>ll<o>"
- * "hello".gsub(/./) {|s| s[0].ord.to_s + ' '} #=> "104 101 108 108 111 "
- * "hello".gsub(/(?<foo>[aeiou])/, '{\k<foo>}') #=> "h{e}ll{o}"
+ *
+ * "hello".gsub(/[aeiou]/, '*') #=> "h*ll*"
+ * "hello".gsub(/([aeiou])/, '<\1>') #=> "h<e>ll<o>"
+ * "hello".gsub(/./) {|s| s[0].to_s + ' '} #=> "104 101 108 108 111 "
*/
static VALUE
-rb_str_gsub(int argc, VALUE *argv, VALUE str)
+rb_str_gsub(argc, argv, str)
+ int argc;
+ VALUE *argv;
+ VALUE str;
{
return str_gsub(argc, argv, str, 0);
}
@@ -3880,224 +2296,237 @@ rb_str_gsub(int argc, VALUE *argv, VALUE str)
/*
* call-seq:
* str.replace(other_str) => str
- *
+ *
* Replaces the contents and taintedness of <i>str</i> with the corresponding
* values in <i>other_str</i>.
- *
+ *
* s = "hello" #=> "hello"
* s.replace "world" #=> "world"
*/
-VALUE
-rb_str_replace(VALUE str, VALUE str2)
+static VALUE
+rb_str_replace(str, str2)
+ VALUE str, str2;
{
if (str == str2) return str;
StringValue(str2);
- str_discard(str);
- return str_replace(str, str2);
+ if (FL_TEST(str2, ELTS_SHARED)) {
+ if (str_independent(str)) {
+ free(RSTRING(str)->ptr);
+ }
+ RSTRING(str)->len = RSTRING(str2)->len;
+ RSTRING(str)->ptr = RSTRING(str2)->ptr;
+ FL_SET(str, ELTS_SHARED);
+ FL_UNSET(str, STR_ASSOC);
+ RSTRING(str)->aux.shared = RSTRING(str2)->aux.shared;
+ }
+ else {
+ if (str_independent(str)) {
+ rb_str_resize(str, RSTRING(str2)->len);
+ memcpy(RSTRING(str)->ptr, RSTRING(str2)->ptr, RSTRING(str2)->len);
+ if (!RSTRING(str)->ptr) {
+ make_null_str(str);
+ }
+ }
+ else {
+ RSTRING(str)->ptr = RSTRING(str2)->ptr;
+ RSTRING(str)->len = RSTRING(str2)->len;
+ str_make_independent(str);
+ }
+ if (FL_TEST(str2, STR_ASSOC)) {
+ FL_SET(str, STR_ASSOC);
+ RSTRING(str)->aux.shared = RSTRING(str2)->aux.shared;
+ }
+ }
+
+ OBJ_INFECT(str, str2);
+ return str;
+}
+
+static VALUE
+uscore_get()
+{
+ VALUE line;
+
+ line = rb_lastline_get();
+ if (TYPE(line) != T_STRING) {
+ rb_raise(rb_eTypeError, "$_ value need to be String (%s given)",
+ NIL_P(line) ? "nil" : rb_obj_classname(line));
+ }
+ return line;
}
/*
* call-seq:
- * string.clear -> string
- *
- * Makes string empty.
- *
- * a = "abcde"
- * a.clear #=> ""
+ * sub!(pattern, replacement) => $_ or nil
+ * sub!(pattern) {|...| block } => $_ or nil
+ *
+ * Equivalent to <code>$_.sub!(<i>args</i>)</code>.
*/
static VALUE
-rb_str_clear(VALUE str)
-{
- str_discard(str);
- STR_SET_EMBED(str);
- STR_SET_EMBED_LEN(str, 0);
- RSTRING_PTR(str)[0] = 0;
- if (rb_enc_asciicompat(STR_ENC_GET(str)))
- ENC_CODERANGE_SET(str, ENC_CODERANGE_7BIT);
- else
- ENC_CODERANGE_SET(str, ENC_CODERANGE_VALID);
- return str;
+rb_f_sub_bang(argc, argv)
+ int argc;
+ VALUE *argv;
+{
+ return rb_str_sub_bang(argc, argv, uscore_get());
}
/*
* call-seq:
- * string.chr -> string
- *
- * Returns a one-character string at the beginning of the string.
- *
- * a = "abcde"
- * a.chr #=> "a"
+ * sub(pattern, replacement) => $_
+ * sub(pattern) { block } => $_
+ *
+ * Equivalent to <code>$_.sub(<i>args</i>)</code>, except that
+ * <code>$_</code> will be updated if substitution occurs.
*/
static VALUE
-rb_str_chr(VALUE str)
+rb_f_sub(argc, argv)
+ int argc;
+ VALUE *argv;
{
- return rb_str_substr(str, 0, 1);
+ VALUE str = rb_str_dup(uscore_get());
+
+ if (NIL_P(rb_str_sub_bang(argc, argv, str)))
+ return str;
+ rb_lastline_set(str);
+ return str;
}
/*
* call-seq:
- * str.getbyte(index) => 0 .. 255
- *
- * returns the <i>index</i>th byte as an integer.
+ * gsub!(pattern, replacement) => string or nil
+ * gsub!(pattern) {|...| block } => string or nil
+ *
+ * Equivalent to <code>Kernel::gsub</code>, except <code>nil</code> is
+ * returned if <code>$_</code> is not modified.
+ *
+ * $_ = "quick brown fox"
+ * gsub! /cat/, '*' #=> nil
+ * $_ #=> "quick brown fox"
*/
+
static VALUE
-rb_str_getbyte(VALUE str, VALUE index)
+rb_f_gsub_bang(argc, argv)
+ int argc;
+ VALUE *argv;
{
- long pos = NUM2LONG(index);
-
- if (pos < 0)
- pos += RSTRING_LEN(str);
- if (pos < 0 || RSTRING_LEN(str) <= pos)
- return Qnil;
-
- return INT2FIX((unsigned char)RSTRING_PTR(str)[pos]);
+ return rb_str_gsub_bang(argc, argv, uscore_get());
}
/*
* call-seq:
- * str.setbyte(index, int) => int
- *
- * modifies the <i>index</i>th byte as <i>int</i>.
+ * gsub(pattern, replacement) => string
+ * gsub(pattern) {|...| block } => string
+ *
+ * Equivalent to <code>$_.gsub...</code>, except that <code>$_</code>
+ * receives the modified result.
+ *
+ * $_ = "quick brown fox"
+ * gsub /[aeiou]/, '*' #=> "q**ck br*wn f*x"
+ * $_ #=> "q**ck br*wn f*x"
*/
+
static VALUE
-rb_str_setbyte(VALUE str, VALUE index, VALUE value)
+rb_f_gsub(argc, argv)
+ int argc;
+ VALUE *argv;
{
- long pos = NUM2LONG(index);
- int byte = NUM2INT(value);
+ VALUE str = rb_str_dup(uscore_get());
- rb_str_modify(str);
-
- if (pos < -RSTRING_LEN(str) || RSTRING_LEN(str) <= pos)
- rb_raise(rb_eIndexError, "index %ld out of string", pos);
- if (pos < 0)
- pos += RSTRING_LEN(str);
-
- RSTRING_PTR(str)[pos] = byte;
-
- return value;
+ if (NIL_P(rb_str_gsub_bang(argc, argv, str)))
+ return str;
+ rb_lastline_set(str);
+ return str;
}
+
/*
* call-seq:
- * str.reverse => new_str
- *
- * Returns a new string with the characters from <i>str</i> in reverse order.
- *
- * "stressed".reverse #=> "desserts"
+ * str.reverse! => str
+ *
+ * Reverses <i>str</i> in place.
*/
static VALUE
-rb_str_reverse(VALUE str)
+rb_str_reverse_bang(str)
+ VALUE str;
{
- rb_encoding *enc;
- VALUE rev;
- char *s, *e, *p;
- int single = 1;
-
- if (RSTRING_LEN(str) <= 1) return rb_str_dup(str);
- enc = STR_ENC_GET(str);
- rev = rb_str_new5(str, 0, RSTRING_LEN(str));
- s = RSTRING_PTR(str); e = RSTRING_END(str);
- p = RSTRING_END(rev);
-
- if (RSTRING_LEN(str) > 1) {
- if (single_byte_optimizable(str)) {
- while (s < e) {
- *--p = *s++;
- }
- }
- else if (ENC_CODERANGE(str) == ENC_CODERANGE_VALID) {
- while (s < e) {
- int clen = rb_enc_fast_mbclen(s, e, enc);
-
- if (clen > 1 || (*s & 0x80)) single = 0;
- p -= clen;
- memcpy(p, s, clen);
- s += clen;
- }
- }
- else {
- while (s < e) {
- int clen = rb_enc_mbclen(s, e, enc);
+ char *s, *e;
+ char c;
- if (clen > 1 || (*s & 0x80)) single = 0;
- p -= clen;
- memcpy(p, s, clen);
- s += clen;
- }
- }
- }
- STR_SET_LEN(rev, RSTRING_LEN(str));
- OBJ_INFECT(rev, str);
- if (ENC_CODERANGE(str) == ENC_CODERANGE_UNKNOWN) {
- if (single) {
- ENC_CODERANGE_SET(str, ENC_CODERANGE_7BIT);
- }
- else {
- ENC_CODERANGE_SET(str, ENC_CODERANGE_VALID);
+ if (RSTRING(str)->len > 1) {
+ rb_str_modify(str);
+ s = RSTRING(str)->ptr;
+ e = s + RSTRING(str)->len - 1;
+ while (s < e) {
+ c = *s;
+ *s++ = *e;
+ *e-- = c;
}
}
- rb_enc_cr_str_copy_for_substr(rev, str);
-
- return rev;
+ return str;
}
/*
* call-seq:
- * str.reverse! => str
- *
- * Reverses <i>str</i> in place.
+ * str.reverse => new_str
+ *
+ * Returns a new string with the characters from <i>str</i> in reverse order.
+ *
+ * "stressed".reverse #=> "desserts"
*/
static VALUE
-rb_str_reverse_bang(VALUE str)
-{
- if (RSTRING_LEN(str) > 1) {
- if (single_byte_optimizable(str)) {
- char *s, *e, c;
-
- str_modify_keep_cr(str);
- s = RSTRING_PTR(str);
- e = RSTRING_END(str) - 1;
- while (s < e) {
- c = *s;
- *s++ = *e;
- *e-- = c;
- }
- }
- else {
- rb_str_shared_replace(str, rb_str_reverse(str));
- }
- }
- else {
- str_modify_keep_cr(str);
+rb_str_reverse(str)
+ VALUE str;
+{
+ VALUE obj;
+ char *s, *e, *p;
+
+ if (RSTRING(str)->len <= 1) return rb_str_dup(str);
+
+ obj = rb_str_new5(str, 0, RSTRING(str)->len);
+ s = RSTRING(str)->ptr; e = s + RSTRING(str)->len - 1;
+ p = RSTRING(obj)->ptr;
+
+ while (e >= s) {
+ *p++ = *e--;
}
- return str;
+ OBJ_INFECT(obj, str);
+
+ return obj;
}
/*
* call-seq:
* str.include? other_str => true or false
- *
+ * str.include? fixnum => true or false
+ *
* Returns <code>true</code> if <i>str</i> contains the given string or
* character.
- *
+ *
* "hello".include? "lo" #=> true
* "hello".include? "ol" #=> false
* "hello".include? ?h #=> true
*/
static VALUE
-rb_str_include(VALUE str, VALUE arg)
+rb_str_include(str, arg)
+ VALUE str, arg;
{
long i;
+ if (FIXNUM_P(arg)) {
+ if (memchr(RSTRING(str)->ptr, FIX2INT(arg), RSTRING(str)->len))
+ return Qtrue;
+ return Qfalse;
+ }
+
StringValue(arg);
i = rb_str_index(str, arg, 0);
@@ -4109,13 +2538,13 @@ rb_str_include(VALUE str, VALUE arg)
/*
* call-seq:
* str.to_i(base=10) => integer
- *
+ *
* Returns the result of interpreting leading characters in <i>str</i> as an
* integer base <i>base</i> (between 2 and 36). Extraneous characters past the
* end of a valid number are ignored. If there is not a valid number at the
* start of <i>str</i>, <code>0</code> is returned. This method never raises an
* exception.
- *
+ *
* "12345".to_i #=> 12345
* "99 red balloons".to_i #=> 99
* "0a".to_i #=> 0
@@ -4128,19 +2557,20 @@ rb_str_include(VALUE str, VALUE arg)
*/
static VALUE
-rb_str_to_i(int argc, VALUE *argv, VALUE str)
+rb_str_to_i(argc, argv, str)
+ int argc;
+ VALUE *argv;
+ VALUE str;
{
+ VALUE b;
int base;
+ rb_scan_args(argc, argv, "01", &b);
if (argc == 0) base = 10;
- else {
- VALUE b;
+ else base = NUM2INT(b);
- rb_scan_args(argc, argv, "01", &b);
- base = NUM2INT(b);
- }
if (base < 0) {
- rb_raise(rb_eArgError, "invalid radix %d", base);
+ rb_raise(rb_eArgError, "illegal radix %d", base);
}
return rb_str_to_inum(str, base, Qfalse);
}
@@ -4149,21 +2579,22 @@ rb_str_to_i(int argc, VALUE *argv, VALUE str)
/*
* call-seq:
* str.to_f => float
- *
+ *
* Returns the result of interpreting leading characters in <i>str</i> as a
* floating point number. Extraneous characters past the end of a valid number
* are ignored. If there is not a valid number at the start of <i>str</i>,
* <code>0.0</code> is returned. This method never raises an exception.
- *
+ *
* "123.45e1".to_f #=> 1234.5
* "45.67 degrees".to_f #=> 45.67
* "thx1138".to_f #=> 0.0
*/
static VALUE
-rb_str_to_f(VALUE str)
+rb_str_to_f(str)
+ VALUE str;
{
- return DBL2NUM(rb_str_to_dbl(str, Qfalse));
+ return rb_float_new(rb_str_to_dbl(str, Qfalse));
}
@@ -4171,153 +2602,123 @@ rb_str_to_f(VALUE str)
* call-seq:
* str.to_s => str
* str.to_str => str
- *
+ *
* Returns the receiver.
*/
static VALUE
-rb_str_to_s(VALUE str)
+rb_str_to_s(str)
+ VALUE str;
{
if (rb_obj_class(str) != rb_cString) {
- return str_duplicate(rb_cString, str);
+ VALUE dup = str_alloc(rb_cString);
+ rb_str_replace(dup, str);
+ return dup;
}
return str;
}
-static void
-str_cat_char(VALUE str, unsigned int c, rb_encoding *enc)
-{
- char s[RUBY_MAX_CHAR_LEN];
- int n = rb_enc_codelen(c, enc);
-
- rb_enc_mbcput(c, s, enc);
- rb_enc_str_buf_cat(str, s, n, enc);
-}
-
-static void
-prefix_escape(VALUE str, unsigned int c, rb_encoding *enc)
-{
- str_cat_char(str, '\\', enc);
- str_cat_char(str, c, enc);
-}
-
/*
* call-seq:
* str.inspect => string
*
- * Returns a printable version of _str_, surrounded by quote marks,
- * with special characters escaped.
+ * Returns a printable version of _str_, with special characters
+ * escaped.
*
* str = "hello"
- * str[3] = "\b"
- * str.inspect #=> "\"hel\\bo\""
+ * str[3] = 8
+ * str.inspect #=> "hel\010o"
*/
VALUE
-rb_str_inspect(VALUE str)
+rb_str_inspect(str)
+ VALUE str;
{
- rb_encoding *enc = STR_ENC_GET(str);
char *p, *pend;
- VALUE result = rb_str_buf_new(0);
+ VALUE result = rb_str_buf_new2("\"");
+ char s[5];
- if (!rb_enc_asciicompat(enc)) enc = rb_usascii_encoding();
- rb_enc_associate(result, enc);
- str_cat_char(result, '"', enc);
- p = RSTRING_PTR(str); pend = RSTRING_END(str);
+ p = RSTRING(str)->ptr; pend = p + RSTRING(str)->len;
while (p < pend) {
- unsigned int c, cc;
- int n;
-
- n = rb_enc_precise_mbclen(p, pend, enc);
- if (!MBCLEN_CHARFOUND_P(n)) {
- p++;
- n = 1;
- goto escape_codepoint;
- }
- n = MBCLEN_CHARFOUND_LEN(n);
-
- c = rb_enc_codepoint_len(p, pend, &n, enc);
- p += n;
- if (c == '"'|| c == '\\' ||
- (c == '#' &&
- p < pend &&
- MBCLEN_CHARFOUND_P(rb_enc_precise_mbclen(p,pend,enc)) &&
- (cc = rb_enc_codepoint(p,pend,enc),
- (cc == '$' || cc == '@' || cc == '{')))) {
- prefix_escape(result, c, enc);
+ char c = *p++;
+ if (ismbchar(c) && p < pend) {
+ int len = mbclen(c);
+ rb_str_buf_cat(result, p - 1, len);
+ p += len - 1;
+ }
+ else if (c == '"'|| c == '\\' || (c == '#' && IS_EVSTR(p, pend))) {
+ s[0] = '\\'; s[1] = c;
+ rb_str_buf_cat(result, s, 2);
+ }
+ else if (ISPRINT(c)) {
+ s[0] = c;
+ rb_str_buf_cat(result, s, 1);
}
else if (c == '\n') {
- prefix_escape(result, 'n', enc);
+ s[0] = '\\'; s[1] = 'n';
+ rb_str_buf_cat(result, s, 2);
}
else if (c == '\r') {
- prefix_escape(result, 'r', enc);
+ s[0] = '\\'; s[1] = 'r';
+ rb_str_buf_cat(result, s, 2);
}
else if (c == '\t') {
- prefix_escape(result, 't', enc);
+ s[0] = '\\'; s[1] = 't';
+ rb_str_buf_cat(result, s, 2);
}
else if (c == '\f') {
- prefix_escape(result, 'f', enc);
+ s[0] = '\\'; s[1] = 'f';
+ rb_str_buf_cat(result, s, 2);
}
else if (c == '\013') {
- prefix_escape(result, 'v', enc);
+ s[0] = '\\'; s[1] = 'v';
+ rb_str_buf_cat(result, s, 2);
}
else if (c == '\010') {
- prefix_escape(result, 'b', enc);
+ s[0] = '\\'; s[1] = 'b';
+ rb_str_buf_cat(result, s, 2);
}
else if (c == '\007') {
- prefix_escape(result, 'a', enc);
+ s[0] = '\\'; s[1] = 'a';
+ rb_str_buf_cat(result, s, 2);
}
else if (c == 033) {
- prefix_escape(result, 'e', enc);
- }
- else if (rb_enc_isprint(c, enc)) {
- rb_enc_str_buf_cat(result, p-n, n, enc);
+ s[0] = '\\'; s[1] = 'e';
+ rb_str_buf_cat(result, s, 2);
}
else {
- char buf[5];
- char *s;
- char *q;
-
- escape_codepoint:
- for (q = p-n; q < p; q++) {
- s = buf;
- sprintf(buf, "\\x%02X", *q & 0377);
- while (*s) {
- str_cat_char(result, *s++, enc);
- }
- }
+ sprintf(s, "\\%03o", c & 0377);
+ rb_str_buf_cat2(result, s);
}
}
- str_cat_char(result, '"', enc);
+ rb_str_buf_cat2(result, "\"");
OBJ_INFECT(result, str);
return result;
}
-#define IS_EVSTR(p,e) ((p) < (e) && (*(p) == '$' || *(p) == '@' || *(p) == '{'))
/*
* call-seq:
* str.dump => new_str
- *
+ *
* Produces a version of <i>str</i> with all nonprinting characters replaced by
* <code>\nnn</code> notation and all special characters escaped.
*/
VALUE
-rb_str_dump(VALUE str)
+rb_str_dump(str)
+ VALUE str;
{
- rb_encoding *enc = rb_enc_get(str);
long len;
- const char *p, *pend;
+ char *p, *pend;
char *q, *qend;
VALUE result;
- int u8 = (enc == rb_utf8_encoding());
len = 2; /* "" */
- p = RSTRING_PTR(str); pend = p + RSTRING_LEN(str);
+ p = RSTRING(str)->ptr; pend = p + RSTRING(str)->len;
while (p < pend) {
- unsigned char c = *p++;
+ char c = *p++;
switch (c) {
case '"': case '\\':
case '\n': case '\r':
@@ -4335,34 +2736,19 @@ rb_str_dump(VALUE str)
len++;
}
else {
- if (u8) { /* \u{NN} */
- char buf[32];
- int n = rb_enc_precise_mbclen(p-1, pend, enc);
- if (MBCLEN_CHARFOUND_P(n)) {
- int cc = rb_enc_mbc_to_codepoint(p-1, pend, enc);
- sprintf(buf, "%x", cc);
- len += strlen(buf)+4;
- p += MBCLEN_CHARFOUND_LEN(n)-1;
- break;
- }
- }
- len += 4; /* \xNN */
+ len += 4; /* \nnn */
}
break;
}
}
- if (!rb_enc_asciicompat(enc)) {
- len += 19; /* ".force_encoding('')" */
- len += strlen(enc->name);
- }
result = rb_str_new5(str, 0, len);
- p = RSTRING_PTR(str); pend = p + RSTRING_LEN(str);
- q = RSTRING_PTR(result); qend = q + len + 1;
+ p = RSTRING(str)->ptr; pend = p + RSTRING(str)->len;
+ q = RSTRING(result)->ptr; qend = q + len;
*q++ = '"';
while (p < pend) {
- unsigned char c = *p++;
+ char c = *p++;
if (c == '"' || c == '\\') {
*q++ = '\\';
@@ -4372,6 +2758,9 @@ rb_str_dump(VALUE str)
if (IS_EVSTR(p, pend)) *q++ = '\\';
*q++ = '#';
}
+ else if (ISPRINT(c)) {
+ *q++ = c;
+ }
else if (c == '\n') {
*q++ = '\\';
*q++ = 'n';
@@ -4404,103 +2793,45 @@ rb_str_dump(VALUE str)
*q++ = '\\';
*q++ = 'e';
}
- else if (ISPRINT(c)) {
- *q++ = c;
- }
else {
*q++ = '\\';
- if (u8) {
- int n = rb_enc_precise_mbclen(p-1, pend, enc) - 1;
- if (MBCLEN_CHARFOUND_P(n)) {
- int cc = rb_enc_mbc_to_codepoint(p-1, pend, enc);
- p += n;
- snprintf(q, qend-q, "u{%x}", cc);
- q += strlen(q);
- continue;
- }
- }
- snprintf(q, qend-q, "x%02X", c);
+ sprintf(q, "%03o", c&0xff);
q += 3;
}
}
*q++ = '"';
- *q = '\0';
- if (!rb_enc_asciicompat(enc)) {
- snprintf(q, qend-q, ".force_encoding(\"%s\")", enc->name);
- enc = rb_ascii8bit_encoding();
- }
+
OBJ_INFECT(result, str);
- /* result from dump is ASCII */
- rb_enc_associate(result, enc);
- ENC_CODERANGE_SET(result, ENC_CODERANGE_7BIT);
return result;
}
-static void
-rb_str_check_dummy_enc(rb_encoding *enc)
-{
- if (rb_enc_dummy_p(enc)) {
- rb_raise(rb_eEncCompatError, "incompatible encoding with this operation: %s",
- rb_enc_name(enc));
- }
-}
-
/*
* call-seq:
* str.upcase! => str or nil
- *
+ *
* Upcases the contents of <i>str</i>, returning <code>nil</code> if no changes
* were made.
- * Note: case replacement is effective only in ASCII region.
*/
static VALUE
-rb_str_upcase_bang(VALUE str)
+rb_str_upcase_bang(str)
+ VALUE str;
{
- rb_encoding *enc;
char *s, *send;
int modify = 0;
- int n;
- str_modify_keep_cr(str);
- enc = STR_ENC_GET(str);
- rb_str_check_dummy_enc(enc);
- s = RSTRING_PTR(str); send = RSTRING_END(str);
- if (single_byte_optimizable(str)) {
- while (s < send) {
- unsigned int c = *(unsigned char*)s;
-
- if (rb_enc_isascii(c, enc) && 'a' <= c && c <= 'z') {
- *s = 'A' + (c - 'a');
- modify = 1;
- }
- s++;
+ rb_str_modify(str);
+ s = RSTRING(str)->ptr; send = s + RSTRING(str)->len;
+ while (s < send) {
+ if (ismbchar(*s)) {
+ s+=mbclen(*s) - 1;
}
- }
- else {
- int ascompat = rb_enc_asciicompat(enc);
-
- while (s < send) {
- unsigned int c;
-
- if (ascompat && (c = *(unsigned char*)s) < 0x80) {
- if (rb_enc_isascii(c, enc) && 'a' <= c && c <= 'z') {
- *s = 'A' + (c - 'a');
- modify = 1;
- }
- s++;
- }
- else {
- c = rb_enc_codepoint_len(s, send, &n, enc);
- if (rb_enc_islower(c, enc)) {
- /* assuming toupper returns codepoint with same size */
- rb_enc_mbcput(rb_enc_toupper(c, enc), s, enc);
- modify = 1;
- }
- s += n;
- }
+ else if (ISLOWER(*s)) {
+ *s = toupper(*s);
+ modify = 1;
}
+ s++;
}
if (modify) return str;
@@ -4511,17 +2842,17 @@ rb_str_upcase_bang(VALUE str)
/*
* call-seq:
* str.upcase => new_str
- *
+ *
* Returns a copy of <i>str</i> with all lowercase letters replaced with their
* uppercase counterparts. The operation is locale insensitive---only
* characters ``a'' to ``z'' are affected.
- * Note: case replacement is effective only in ASCII region.
- *
+ *
* "hEllO".upcase #=> "HELLO"
*/
static VALUE
-rb_str_upcase(VALUE str)
+rb_str_upcase(str)
+ VALUE str;
{
str = rb_str_dup(str);
rb_str_upcase_bang(str);
@@ -4532,58 +2863,29 @@ rb_str_upcase(VALUE str)
/*
* call-seq:
* str.downcase! => str or nil
- *
+ *
* Downcases the contents of <i>str</i>, returning <code>nil</code> if no
* changes were made.
- * Note: case replacement is effective only in ASCII region.
*/
static VALUE
-rb_str_downcase_bang(VALUE str)
+rb_str_downcase_bang(str)
+ VALUE str;
{
- rb_encoding *enc;
char *s, *send;
int modify = 0;
- str_modify_keep_cr(str);
- enc = STR_ENC_GET(str);
- rb_str_check_dummy_enc(enc);
- s = RSTRING_PTR(str); send = RSTRING_END(str);
- if (single_byte_optimizable(str)) {
- while (s < send) {
- unsigned int c = *(unsigned char*)s;
-
- if (rb_enc_isascii(c, enc) && 'A' <= c && c <= 'Z') {
- *s = 'a' + (c - 'A');
- modify = 1;
- }
- s++;
+ rb_str_modify(str);
+ s = RSTRING(str)->ptr; send = s + RSTRING(str)->len;
+ while (s < send) {
+ if (ismbchar(*s)) {
+ s+=mbclen(*s) - 1;
}
- }
- else {
- int ascompat = rb_enc_asciicompat(enc);
-
- while (s < send) {
- unsigned int c;
- int n;
-
- if (ascompat && (c = *(unsigned char*)s) < 0x80) {
- if (rb_enc_isascii(c, enc) && 'A' <= c && c <= 'Z') {
- *s = 'a' + (c - 'A');
- modify = 1;
- }
- s++;
- }
- else {
- c = rb_enc_codepoint_len(s, send, &n, enc);
- if (rb_enc_isupper(c, enc)) {
- /* assuming toupper returns codepoint with same size */
- rb_enc_mbcput(rb_enc_tolower(c, enc), s, enc);
- modify = 1;
- }
- s += n;
- }
+ else if (ISUPPER(*s)) {
+ *s = tolower(*s);
+ modify = 1;
}
+ s++;
}
if (modify) return str;
@@ -4594,17 +2896,17 @@ rb_str_downcase_bang(VALUE str)
/*
* call-seq:
* str.downcase => new_str
- *
+ *
* Returns a copy of <i>str</i> with all uppercase letters replaced with their
* lowercase counterparts. The operation is locale insensitive---only
* characters ``A'' to ``Z'' are affected.
- * Note: case replacement is effective only in ASCII region.
- *
+ *
* "hEllO".downcase #=> "hello"
*/
static VALUE
-rb_str_downcase(VALUE str)
+rb_str_downcase(str)
+ VALUE str;
{
str = rb_str_dup(str);
rb_str_downcase_bang(str);
@@ -4615,11 +2917,10 @@ rb_str_downcase(VALUE str)
/*
* call-seq:
* str.capitalize! => str or nil
- *
+ *
* Modifies <i>str</i> by converting the first character to uppercase and the
* remainder to lowercase. Returns <code>nil</code> if no changes are made.
- * Note: case conversion is effective only in ASCII region.
- *
+ *
* a = "hello"
* a.capitalize! #=> "Hello"
* a #=> "Hello"
@@ -4627,35 +2928,28 @@ rb_str_downcase(VALUE str)
*/
static VALUE
-rb_str_capitalize_bang(VALUE str)
+rb_str_capitalize_bang(str)
+ VALUE str;
{
- rb_encoding *enc;
char *s, *send;
int modify = 0;
- unsigned int c;
- int n;
- str_modify_keep_cr(str);
- enc = STR_ENC_GET(str);
- rb_str_check_dummy_enc(enc);
- if (RSTRING_LEN(str) == 0 || !RSTRING_PTR(str)) return Qnil;
- s = RSTRING_PTR(str); send = RSTRING_END(str);
-
- c = rb_enc_codepoint_len(s, send, &n, enc);
- if (rb_enc_islower(c, enc)) {
- rb_enc_mbcput(rb_enc_toupper(c, enc), s, enc);
+ rb_str_modify(str);
+ if (RSTRING(str)->len == 0 || !RSTRING(str)->ptr) return Qnil;
+ s = RSTRING(str)->ptr; send = s + RSTRING(str)->len;
+ if (ISLOWER(*s)) {
+ *s = toupper(*s);
modify = 1;
}
- s += n;
- while (s < send) {
- c = rb_enc_codepoint_len(s, send, &n, enc);
- if (rb_enc_isupper(c, enc)) {
- rb_enc_mbcput(rb_enc_tolower(c, enc), s, enc);
+ while (++s < send) {
+ if (ismbchar(*s)) {
+ s+=mbclen(*s) - 1;
+ }
+ else if (ISUPPER(*s)) {
+ *s = tolower(*s);
modify = 1;
}
- s += n;
}
-
if (modify) return str;
return Qnil;
}
@@ -4664,18 +2958,18 @@ rb_str_capitalize_bang(VALUE str)
/*
* call-seq:
* str.capitalize => new_str
- *
+ *
* Returns a copy of <i>str</i> with the first character converted to uppercase
* and the remainder to lowercase.
- * Note: case conversion is effective only in ASCII region.
- *
+ *
* "hello".capitalize #=> "Hello"
* "HELLO".capitalize #=> "Hello"
* "123ABC".capitalize #=> "123abc"
*/
static VALUE
-rb_str_capitalize(VALUE str)
+rb_str_capitalize(str)
+ VALUE str;
{
str = rb_str_dup(str);
rb_str_capitalize_bang(str);
@@ -4685,39 +2979,34 @@ rb_str_capitalize(VALUE str)
/*
* call-seq:
-* str.swapcase! => str or nil
- *
+ * str.swapcase! => str or nil
+ *
* Equivalent to <code>String#swapcase</code>, but modifies the receiver in
* place, returning <i>str</i>, or <code>nil</code> if no changes were made.
- * Note: case conversion is effective only in ASCII region.
*/
static VALUE
-rb_str_swapcase_bang(VALUE str)
+rb_str_swapcase_bang(str)
+ VALUE str;
{
- rb_encoding *enc;
char *s, *send;
int modify = 0;
- int n;
- str_modify_keep_cr(str);
- enc = STR_ENC_GET(str);
- rb_str_check_dummy_enc(enc);
- s = RSTRING_PTR(str); send = RSTRING_END(str);
+ rb_str_modify(str);
+ s = RSTRING(str)->ptr; send = s + RSTRING(str)->len;
while (s < send) {
- unsigned int c = rb_enc_codepoint_len(s, send, &n, enc);
-
- if (rb_enc_isupper(c, enc)) {
- /* assuming toupper returns codepoint with same size */
- rb_enc_mbcput(rb_enc_tolower(c, enc), s, enc);
+ if (ismbchar(*s)) {
+ s+=mbclen(*s) - 1;
+ }
+ else if (ISUPPER(*s)) {
+ *s = tolower(*s);
modify = 1;
}
- else if (rb_enc_islower(c, enc)) {
- /* assuming tolower returns codepoint with same size */
- rb_enc_mbcput(rb_enc_toupper(c, enc), s, enc);
+ else if (ISLOWER(*s)) {
+ *s = toupper(*s);
modify = 1;
}
- s += n;
+ s++;
}
if (modify) return str;
@@ -4728,17 +3017,17 @@ rb_str_swapcase_bang(VALUE str)
/*
* call-seq:
* str.swapcase => new_str
- *
+ *
* Returns a copy of <i>str</i> with uppercase alphabetic characters converted
* to lowercase and lowercase characters converted to uppercase.
- * Note: case conversion is effective only in ASCII region.
- *
+ *
* "Hello".swapcase #=> "hELLO"
* "cYbEr_PuNk11".swapcase #=> "CyBeR_pUnK11"
*/
static VALUE
-rb_str_swapcase(VALUE str)
+rb_str_swapcase(str)
+ VALUE str;
{
str = rb_str_dup(str);
rb_str_swapcase_bang(str);
@@ -4748,32 +3037,30 @@ rb_str_swapcase(VALUE str)
typedef unsigned char *USTR;
struct tr {
- int gen;
- unsigned int now, max;
+ int gen, now, max;
char *p, *pend;
};
-static unsigned int
-trnext(struct tr *t, rb_encoding *enc)
+static int
+trnext(t)
+ struct tr *t;
{
- int n;
-
for (;;) {
if (!t->gen) {
if (t->p == t->pend) return -1;
if (t->p < t->pend - 1 && *t->p == '\\') {
t->p++;
}
- t->now = rb_enc_codepoint_len(t->p, t->pend, &n, enc);
- t->p += n;
+ t->now = *(USTR)t->p++;
if (t->p < t->pend - 1 && *t->p == '-') {
t->p++;
if (t->p < t->pend) {
- unsigned int c = rb_enc_codepoint_len(t->p, t->pend, &n, enc);
- t->p += n;
- if (t->now > c) continue;
+ if (t->now > *(USTR)t->p) {
+ t->p++;
+ continue;
+ }
t->gen = 1;
- t->max = c;
+ t->max = *(USTR)t->p++;
}
}
return t->now;
@@ -4788,52 +3075,32 @@ trnext(struct tr *t, rb_encoding *enc)
}
}
-static VALUE rb_str_delete_bang(int,VALUE*,VALUE);
+static VALUE rb_str_delete_bang _((int,VALUE*,VALUE));
static VALUE
-tr_trans(VALUE str, VALUE src, VALUE repl, int sflag)
+tr_trans(str, src, repl, sflag)
+ VALUE str, src, repl;
+ int sflag;
{
- const unsigned int errc = -1;
- unsigned int trans[256];
- rb_encoding *enc, *e1, *e2;
struct tr trsrc, trrepl;
int cflag = 0;
- unsigned int c, c0;
- int last = 0, modify = 0, i, l;
+ int trans[256];
+ int i, c, modify = 0;
char *s, *send;
- VALUE hash = 0;
- int singlebyte = single_byte_optimizable(str);
- int cr;
-
-#define CHECK_IF_ASCII(c) \
- (void)((cr == ENC_CODERANGE_7BIT && !rb_isascii(c)) ? \
- (cr = ENC_CODERANGE_VALID) : 0)
StringValue(src);
StringValue(repl);
- if (RSTRING_LEN(str) == 0 || !RSTRING_PTR(str)) return Qnil;
- if (RSTRING_LEN(repl) == 0) {
- return rb_str_delete_bang(1, &src, str);
- }
-
- cr = ENC_CODERANGE(str);
- e1 = rb_enc_check(str, src);
- e2 = rb_enc_check(str, repl);
- if (e1 == e2) {
- enc = e1;
- }
- else {
- enc = rb_enc_check(src, repl);
+ if (RSTRING(str)->len == 0 || !RSTRING(str)->ptr) return Qnil;
+ trsrc.p = RSTRING(src)->ptr; trsrc.pend = trsrc.p + RSTRING(src)->len;
+ if (RSTRING(src)->len >= 2 && RSTRING(src)->ptr[0] == '^') {
+ cflag++;
+ trsrc.p++;
}
- trsrc.p = RSTRING_PTR(src); trsrc.pend = trsrc.p + RSTRING_LEN(src);
- if (RSTRING_LEN(src) > 1 &&
- rb_enc_ascget(trsrc.p, trsrc.pend, &l, enc) == '^' &&
- trsrc.p + l < trsrc.pend) {
- cflag = 1;
- trsrc.p += l;
+ if (RSTRING(repl)->len == 0) {
+ return rb_str_delete_bang(1, &src, str);
}
- trrepl.p = RSTRING_PTR(repl);
- trrepl.pend = trrepl.p + RSTRING_LEN(repl);
+ trrepl.p = RSTRING(repl)->ptr;
+ trrepl.pend = trrepl.p + RSTRING(repl)->len;
trsrc.gen = trrepl.gen = 0;
trsrc.now = trrepl.now = 0;
trsrc.max = trrepl.max = 0;
@@ -4842,191 +3109,66 @@ tr_trans(VALUE str, VALUE src, VALUE repl, int sflag)
for (i=0; i<256; i++) {
trans[i] = 1;
}
- while ((c = trnext(&trsrc, enc)) != errc) {
- if (c < 256) {
- trans[c] = errc;
- }
- else {
- if (!hash) hash = rb_hash_new();
- rb_hash_aset(hash, UINT2NUM(c), Qtrue);
- }
+ while ((c = trnext(&trsrc)) >= 0) {
+ trans[c & 0xff] = -1;
}
- while ((c = trnext(&trrepl, enc)) != errc)
+ while ((c = trnext(&trrepl)) >= 0)
/* retrieve last replacer */;
- last = trrepl.now;
for (i=0; i<256; i++) {
- if (trans[i] != errc) {
- trans[i] = last;
+ if (trans[i] >= 0) {
+ trans[i] = trrepl.now;
}
}
}
else {
- unsigned int r;
+ int r;
for (i=0; i<256; i++) {
- trans[i] = errc;
- }
- while ((c = trnext(&trsrc, enc)) != errc) {
- r = trnext(&trrepl, enc);
- if (r == errc) r = trrepl.now;
- if (c < 256) {
- trans[c] = r;
- if (r > 255) singlebyte = 0;
- }
- else {
- if (!hash) hash = rb_hash_new();
- rb_hash_aset(hash, UINT2NUM(c), UINT2NUM(r));
- }
+ trans[i] = -1;
+ }
+ while ((c = trnext(&trsrc)) >= 0) {
+ r = trnext(&trrepl);
+ if (r == -1) r = trrepl.now;
+ trans[c & 0xff] = r;
}
}
- if (cr == ENC_CODERANGE_VALID)
- cr = ENC_CODERANGE_7BIT;
- str_modify_keep_cr(str);
- s = RSTRING_PTR(str); send = RSTRING_END(str);
+ rb_str_modify(str);
+ s = RSTRING(str)->ptr; send = s + RSTRING(str)->len;
if (sflag) {
- int offset, clen, tlen, max = RSTRING_LEN(str);
- unsigned int save = -1;
- char *buf = ALLOC_N(char, max), *t = buf;
+ char *t = s;
+ int c0, last = -1;
while (s < send) {
- int may_modify = 0;
-
- c0 = c = rb_enc_codepoint_len(s, send, &clen, e1);
- tlen = enc == e1 ? clen : rb_enc_codelen(c, enc);
-
- s += clen;
- if (c < 256) {
- c = trans[c];
- }
- else if (hash) {
- VALUE tmp = rb_hash_lookup(hash, UINT2NUM(c));
- if (NIL_P(tmp)) {
- if (cflag) c = last;
- else c = errc;
- }
- else if (cflag) c = errc;
- else c = NUM2INT(tmp);
- }
- else {
- c = errc;
- }
- if (c != (unsigned int)-1) {
- if (save == c) {
- CHECK_IF_ASCII(c);
- continue;
- }
- save = c;
- tlen = rb_enc_codelen(c, enc);
+ c0 = *s++;
+ if ((c = trans[c0 & 0xff]) >= 0) {
+ if (last == c) continue;
+ last = c;
+ *t++ = c & 0xff;
modify = 1;
}
else {
- save = -1;
- c = c0;
- if (enc != e1) may_modify = 1;
- }
- while (t - buf + tlen >= max) {
- offset = t - buf;
- max *= 2;
- REALLOC_N(buf, char, max);
- t = buf + offset;
+ last = -1;
+ *t++ = c0;
}
- rb_enc_mbcput(c, t, enc);
- if (may_modify && memcmp(s, t, tlen) != 0) {
- modify = 1;
- }
- CHECK_IF_ASCII(c);
- t += tlen;
}
- *t = '\0';
- RSTRING(str)->as.heap.ptr = buf;
- RSTRING(str)->as.heap.len = t - buf;
- STR_SET_NOEMBED(str);
- RSTRING(str)->as.heap.aux.capa = max;
- }
- else if (rb_enc_mbmaxlen(enc) == 1 || (singlebyte && !hash)) {
- while (s < send) {
- c = (unsigned char)*s;
- if (trans[c] != errc) {
- if (!cflag) {
- c = trans[c];
- *s = c;
- modify = 1;
- }
- else {
- *s = last;
- modify = 1;
- }
- }
- CHECK_IF_ASCII(c);
- s++;
+ if (RSTRING(str)->len > (t - RSTRING(str)->ptr)) {
+ RSTRING(str)->len = (t - RSTRING(str)->ptr);
+ modify = 1;
+ *t = '\0';
}
}
else {
- int clen, tlen, max = (int)(RSTRING_LEN(str) * 1.2);
- int offset;
- char *buf = ALLOC_N(char, max), *t = buf;
-
while (s < send) {
- int may_modify = 0;
- c0 = c = rb_enc_codepoint_len(s, send, &clen, e1);
- tlen = enc == e1 ? clen : rb_enc_codelen(c, enc);
-
- if (c < 256) {
- c = trans[c];
- }
- else if (hash) {
- VALUE tmp = rb_hash_lookup(hash, UINT2NUM(c));
- if (NIL_P(tmp)) {
- if (cflag) c = last;
- else c = errc;
- }
- else if (cflag) c = errc;
- else c = NUM2INT(tmp);
- }
- else {
- c = errc;
- }
- if (c != errc) {
- tlen = rb_enc_codelen(c, enc);
+ if ((c = trans[*s & 0xff]) >= 0) {
+ *s = c & 0xff;
modify = 1;
}
- else {
- c = c0;
- if (enc != e1) may_modify = 1;
- }
- while (t - buf + tlen >= max) {
- offset = t - buf;
- max *= 2;
- REALLOC_N(buf, char, max);
- t = buf + offset;
- }
- if (s != t) {
- rb_enc_mbcput(c, t, enc);
- if (may_modify && memcmp(s, t, tlen) != 0) {
- modify = 1;
- }
- }
- CHECK_IF_ASCII(c);
- s += clen;
- t += tlen;
- }
- if (!STR_EMBED_P(str)) {
- xfree(RSTRING(str)->as.heap.ptr);
+ s++;
}
- *t = '\0';
- RSTRING(str)->as.heap.ptr = buf;
- RSTRING(str)->as.heap.len = t - buf;
- STR_SET_NOEMBED(str);
- RSTRING(str)->as.heap.aux.capa = max;
}
- if (modify) {
- if (cr != ENC_CODERANGE_BROKEN)
- ENC_CODERANGE_SET(str, cr);
- rb_enc_associate(str, enc);
- return str;
- }
+ if (modify) return str;
return Qnil;
}
@@ -5034,14 +3176,15 @@ tr_trans(VALUE str, VALUE src, VALUE repl, int sflag)
/*
* call-seq:
* str.tr!(from_str, to_str) => str or nil
- *
+ *
* Translates <i>str</i> in place, using the same rules as
* <code>String#tr</code>. Returns <i>str</i>, or <code>nil</code> if no
* changes were made.
*/
static VALUE
-rb_str_tr_bang(VALUE str, VALUE src, VALUE repl)
+rb_str_tr_bang(str, src, repl)
+ VALUE str, src, repl;
{
return tr_trans(str, src, repl, 0);
}
@@ -5050,14 +3193,14 @@ rb_str_tr_bang(VALUE str, VALUE src, VALUE repl)
/*
* call-seq:
* str.tr(from_str, to_str) => new_str
- *
+ *
* Returns a copy of <i>str</i> with the characters in <i>from_str</i> replaced
* by the corresponding characters in <i>to_str</i>. If <i>to_str</i> is
* shorter than <i>from_str</i>, it is padded with its last character. Both
* strings may use the c1--c2 notation to denote ranges of characters, and
* <i>from_str</i> may start with a <code>^</code>, which denotes all
* characters except those listed.
- *
+ *
* "hello".tr('aeiou', '*') #=> "h*ll*"
* "hello".tr('^aeiou', '*') #=> "*e**o"
* "hello".tr('el', 'ip') #=> "hippo"
@@ -5065,7 +3208,8 @@ rb_str_tr_bang(VALUE str, VALUE src, VALUE repl)
*/
static VALUE
-rb_str_tr(VALUE str, VALUE src, VALUE repl)
+rb_str_tr(str, src, repl)
+ VALUE str, src, repl;
{
str = rb_str_dup(str);
tr_trans(str, src, repl, 0);
@@ -5073,98 +3217,60 @@ rb_str_tr(VALUE str, VALUE src, VALUE repl)
}
static void
-tr_setup_table(VALUE str, char stable[256], int first,
- VALUE *tablep, VALUE *ctablep, rb_encoding *enc)
+tr_setup_table(str, table, init)
+ VALUE str;
+ char table[256];
+ int init;
{
- const unsigned int errc = -1;
char buf[256];
struct tr tr;
- unsigned int c;
- VALUE table = 0, ptable = 0;
- int i, l, cflag = 0;
+ int i, c;
+ int cflag = 0;
- tr.p = RSTRING_PTR(str); tr.pend = tr.p + RSTRING_LEN(str);
+ tr.p = RSTRING(str)->ptr; tr.pend = tr.p + RSTRING(str)->len;
tr.gen = tr.now = tr.max = 0;
-
- if (RSTRING_LEN(str) > 1 && rb_enc_ascget(tr.p, tr.pend, &l, enc) == '^') {
+ if (RSTRING(str)->len > 1 && RSTRING(str)->ptr[0] == '^') {
cflag = 1;
- tr.p += l;
+ tr.p++;
}
- if (first) {
+
+ if (init) {
for (i=0; i<256; i++) {
- stable[i] = 1;
+ table[i] = 1;
}
}
for (i=0; i<256; i++) {
buf[i] = cflag;
}
-
- while ((c = trnext(&tr, enc)) != errc) {
- if (c < 256) {
- buf[c & 0xff] = !cflag;
- }
- else {
- VALUE key = UINT2NUM(c);
-
- if (!table) {
- table = rb_hash_new();
- if (cflag) {
- ptable = *ctablep;
- *ctablep = table;
- }
- else {
- ptable = *tablep;
- *tablep = table;
- }
- }
- if (!ptable || !NIL_P(rb_hash_aref(ptable, key))) {
- rb_hash_aset(table, key, Qtrue);
- }
- }
+ while ((c = trnext(&tr)) >= 0) {
+ buf[c & 0xff] = !cflag;
}
for (i=0; i<256; i++) {
- stable[i] = stable[i] && buf[i];
+ table[i] = table[i] && buf[i];
}
}
-static int
-tr_find(unsigned int c, char table[256], VALUE del, VALUE nodel)
-{
- if (c < 256) {
- return table[c] ? Qtrue : Qfalse;
- }
- else {
- VALUE v = UINT2NUM(c);
-
- if (del && !NIL_P(rb_hash_lookup(del, v))) {
- if (!nodel || NIL_P(rb_hash_lookup(nodel, v))) {
- return Qtrue;
- }
- }
- return Qfalse;
- }
-}
-
/*
* call-seq:
- * str.delete!([other_str]+) => str or nil
- *
+ * str.delete!([other_str]+>) => str or nil
+ *
* Performs a <code>delete</code> operation in place, returning <i>str</i>, or
* <code>nil</code> if <i>str</i> was not modified.
*/
static VALUE
-rb_str_delete_bang(int argc, VALUE *argv, VALUE str)
+rb_str_delete_bang(argc, argv, str)
+ int argc;
+ VALUE *argv;
+ VALUE str;
{
- char squeez[256];
- rb_encoding *enc = 0;
char *s, *send, *t;
- VALUE del = 0, nodel = 0;
+ char squeez[256];
int modify = 0;
- int i, ascompat, cr;
+ int init = 1;
+ int i;
- if (RSTRING_LEN(str) == 0 || !RSTRING_PTR(str)) return Qnil;
if (argc < 1) {
rb_raise(rb_eArgError, "wrong number of arguments");
}
@@ -5172,46 +3278,23 @@ rb_str_delete_bang(int argc, VALUE *argv, VALUE str)
VALUE s = argv[i];
StringValue(s);
- enc = rb_enc_check(str, s);
- tr_setup_table(s, squeez, i==0, &del, &nodel, enc);
+ tr_setup_table(s, squeez, init);
+ init = 0;
}
- str_modify_keep_cr(str);
- ascompat = rb_enc_asciicompat(enc);
- s = t = RSTRING_PTR(str);
- send = RSTRING_END(str);
- cr = ascompat ? ENC_CODERANGE_7BIT : ENC_CODERANGE_VALID;
+ rb_str_modify(str);
+ s = t = RSTRING(str)->ptr;
+ if (!s || RSTRING(str)->len == 0) return Qnil;
+ send = s + RSTRING(str)->len;
while (s < send) {
- unsigned int c;
- int clen;
-
- if (ascompat && (c = *(unsigned char*)s) < 0x80) {
- if (squeez[c]) {
- modify = 1;
- }
- else {
- if (t != s) *t = c;
- t++;
- }
- s++;
- }
- else {
- c = rb_enc_codepoint_len(s, send, &clen, enc);
-
- if (tr_find(c, squeez, del, nodel)) {
- modify = 1;
- }
- else {
- if (t != s) rb_enc_mbcput(c, t, enc);
- t += clen;
- if (cr == ENC_CODERANGE_7BIT) cr = ENC_CODERANGE_VALID;
- }
- s += clen;
- }
+ if (squeez[*s & 0xff])
+ modify = 1;
+ else
+ *t++ = *s;
+ s++;
}
*t = '\0';
- STR_SET_LEN(str, t - RSTRING_PTR(str));
- ENC_CODERANGE_SET(str, cr);
+ RSTRING(str)->len = t - RSTRING(str)->ptr;
if (modify) return str;
return Qnil;
@@ -5221,11 +3304,11 @@ rb_str_delete_bang(int argc, VALUE *argv, VALUE str)
/*
* call-seq:
* str.delete([other_str]+) => new_str
- *
+ *
* Returns a copy of <i>str</i> with all characters in the intersection of its
* arguments deleted. Uses the same rules for building the set of characters as
* <code>String#count</code>.
- *
+ *
* "hello".delete "l","lo" #=> "heo"
* "hello".delete "lo" #=> "he"
* "hello".delete "aeiou", "^e" #=> "hell"
@@ -5233,7 +3316,10 @@ rb_str_delete_bang(int argc, VALUE *argv, VALUE str)
*/
static VALUE
-rb_str_delete(int argc, VALUE *argv, VALUE str)
+rb_str_delete(argc, argv, str)
+ int argc;
+ VALUE *argv;
+ VALUE str;
{
str = rb_str_dup(str);
rb_str_delete_bang(argc, argv, str);
@@ -5244,78 +3330,52 @@ rb_str_delete(int argc, VALUE *argv, VALUE str)
/*
* call-seq:
* str.squeeze!([other_str]*) => str or nil
- *
+ *
* Squeezes <i>str</i> in place, returning either <i>str</i>, or
* <code>nil</code> if no changes were made.
*/
static VALUE
-rb_str_squeeze_bang(int argc, VALUE *argv, VALUE str)
+rb_str_squeeze_bang(argc, argv, str)
+ int argc;
+ VALUE *argv;
+ VALUE str;
{
char squeez[256];
- rb_encoding *enc = 0;
- VALUE del = 0, nodel = 0;
char *s, *send, *t;
- int i, modify = 0;
- int ascompat, singlebyte = single_byte_optimizable(str);
- unsigned int save;
+ int c, save, modify = 0;
+ int init = 1;
+ int i;
if (argc == 0) {
- enc = STR_ENC_GET(str);
+ for (i=0; i<256; i++) {
+ squeez[i] = 1;
+ }
}
else {
for (i=0; i<argc; i++) {
VALUE s = argv[i];
StringValue(s);
- enc = rb_enc_check(str, s);
- if (singlebyte && !single_byte_optimizable(s))
- singlebyte = 0;
- tr_setup_table(s, squeez, i==0, &del, &nodel, enc);
+ tr_setup_table(s, squeez, init);
+ init = 0;
}
}
- str_modify_keep_cr(str);
- s = t = RSTRING_PTR(str);
- if (!s || RSTRING_LEN(str) == 0) return Qnil;
- send = RSTRING_END(str);
+ rb_str_modify(str);
+ s = t = RSTRING(str)->ptr;
+ if (!s || RSTRING(str)->len == 0) return Qnil;
+ send = s + RSTRING(str)->len;
save = -1;
- ascompat = rb_enc_asciicompat(enc);
-
- if (singlebyte) {
- while (s < send) {
- unsigned int c = *(unsigned char*)s++;
- if (c != save || (argc > 0 && !squeez[c])) {
- *t++ = save = c;
- }
- }
- } else {
- while (s < send) {
- unsigned int c;
- int clen;
-
- if (ascompat && (c = *(unsigned char*)s) < 0x80) {
- if (c != save || (argc > 0 && !squeez[c])) {
- *t++ = save = c;
- }
- s++;
- }
- else {
- c = rb_enc_codepoint_len(s, send, &clen, enc);
-
- if (c != save || (argc > 0 && !tr_find(c, squeez, del, nodel))) {
- if (t != s) rb_enc_mbcput(c, t, enc);
- save = c;
- t += clen;
- }
- s += clen;
- }
+ while (s < send) {
+ c = *s++ & 0xff;
+ if (c != save || !squeez[c]) {
+ *t++ = save = c;
}
}
-
*t = '\0';
- if (t - RSTRING_PTR(str) != RSTRING_LEN(str)) {
- STR_SET_LEN(str, t - RSTRING_PTR(str));
+ if (t - RSTRING(str)->ptr != RSTRING(str)->len) {
+ RSTRING(str)->len = t - RSTRING(str)->ptr;
modify = 1;
}
@@ -5327,20 +3387,23 @@ rb_str_squeeze_bang(int argc, VALUE *argv, VALUE str)
/*
* call-seq:
* str.squeeze([other_str]*) => new_str
- *
+ *
* Builds a set of characters from the <i>other_str</i> parameter(s) using the
* procedure described for <code>String#count</code>. Returns a new string
* where runs of the same character that occur in this set are replaced by a
* single character. If no arguments are given, all runs of identical
* characters are replaced by a single character.
- *
+ *
* "yellow moon".squeeze #=> "yelow mon"
* " now is the".squeeze(" ") #=> " now is the"
* "putters shoot balls".squeeze("m-z") #=> "puters shot balls"
*/
static VALUE
-rb_str_squeeze(int argc, VALUE *argv, VALUE str)
+rb_str_squeeze(argc, argv, str)
+ int argc;
+ VALUE *argv;
+ VALUE str;
{
str = rb_str_dup(str);
rb_str_squeeze_bang(argc, argv, str);
@@ -5351,13 +3414,14 @@ rb_str_squeeze(int argc, VALUE *argv, VALUE str)
/*
* call-seq:
* str.tr_s!(from_str, to_str) => str or nil
- *
+ *
* Performs <code>String#tr_s</code> processing on <i>str</i> in place,
* returning <i>str</i>, or <code>nil</code> if no changes were made.
*/
static VALUE
-rb_str_tr_s_bang(VALUE str, VALUE src, VALUE repl)
+rb_str_tr_s_bang(str, src, repl)
+ VALUE str, src, repl;
{
return tr_trans(str, src, repl, 1);
}
@@ -5366,18 +3430,19 @@ rb_str_tr_s_bang(VALUE str, VALUE src, VALUE repl)
/*
* call-seq:
* str.tr_s(from_str, to_str) => new_str
- *
+ *
* Processes a copy of <i>str</i> as described under <code>String#tr</code>,
* then removes duplicate characters in regions that were affected by the
* translation.
- *
+ *
* "hello".tr_s('l', 'r') #=> "hero"
* "hello".tr_s('el', '*') #=> "h*o"
* "hello".tr_s('el', 'hx') #=> "hhxo"
*/
static VALUE
-rb_str_tr_s(VALUE str, VALUE src, VALUE repl)
+rb_str_tr_s(str, src, repl)
+ VALUE str, src, repl;
{
str = rb_str_dup(str);
tr_trans(str, src, repl, 1);
@@ -5388,12 +3453,12 @@ rb_str_tr_s(VALUE str, VALUE src, VALUE repl)
/*
* call-seq:
* str.count([other_str]+) => fixnum
- *
+ *
* Each <i>other_str</i> parameter defines a set of characters to count. The
* intersection of these sets defines the characters to count in
* <i>str</i>. Any <i>other_str</i> that starts with a caret (^) is
* negated. The sequence c1--c2 means all characters between c1 and c2.
- *
+ *
* a = "hello world"
* a.count "lo" #=> 5
* a.count "lo", "o" #=> 2
@@ -5402,116 +3467,67 @@ rb_str_tr_s(VALUE str, VALUE src, VALUE repl)
*/
static VALUE
-rb_str_count(int argc, VALUE *argv, VALUE str)
+rb_str_count(argc, argv, str)
+ int argc;
+ VALUE *argv;
+ VALUE str;
{
char table[256];
- rb_encoding *enc = 0;
- VALUE del = 0, nodel = 0;
char *s, *send;
+ int init = 1;
int i;
- int ascompat;
if (argc < 1) {
rb_raise(rb_eArgError, "wrong number of arguments");
}
for (i=0; i<argc; i++) {
- VALUE tstr = argv[i];
- unsigned char c;
-
- StringValue(tstr);
- enc = rb_enc_check(str, tstr);
- if (argc == 1 && RSTRING_LEN(tstr) == 1 && rb_enc_asciicompat(enc) &&
- (c = RSTRING_PTR(tstr)[0]) < 0x80 && !is_broken_string(str)) {
- int n = 0;
-
- s = RSTRING_PTR(str);
- if (!s || RSTRING_LEN(str) == 0) return INT2FIX(0);
- send = RSTRING_END(str);
- while (s < send) {
- if (*(unsigned char*)s++ == c) n++;
- }
- return INT2NUM(n);
- }
- tr_setup_table(tstr, table, i==0, &del, &nodel, enc);
+ VALUE s = argv[i];
+
+ StringValue(s);
+ tr_setup_table(s, table, init);
+ init = 0;
}
- s = RSTRING_PTR(str);
- if (!s || RSTRING_LEN(str) == 0) return INT2FIX(0);
- send = RSTRING_END(str);
- ascompat = rb_enc_asciicompat(enc);
+ s = RSTRING(str)->ptr;
+ if (!s || RSTRING(str)->len == 0) return INT2FIX(0);
+ send = s + RSTRING(str)->len;
i = 0;
while (s < send) {
- unsigned int c;
- int clen;
-
- if (ascompat && (c = *(unsigned char*)s) < 0x80) {
- clen = 1;
- if (table[c]) {
- i++;
- }
- s++;
- }
- else {
- c = rb_enc_codepoint_len(s, send, &clen, enc);
- if (tr_find(c, table, del, nodel)) {
- i++;
- }
- s += clen;
+ if (table[*s++ & 0xff]) {
+ i++;
}
}
-
return INT2NUM(i);
}
-static const char isspacetable[256] = {
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
-};
-
-#define ascii_isspace(c) isspacetable[(unsigned char)(c)]
/*
* call-seq:
* str.split(pattern=$;, [limit]) => anArray
- *
+ *
* Divides <i>str</i> into substrings based on a delimiter, returning an array
* of these substrings.
- *
+ *
* If <i>pattern</i> is a <code>String</code>, then its contents are used as
* the delimiter when splitting <i>str</i>. If <i>pattern</i> is a single
* space, <i>str</i> is split on whitespace, with leading whitespace and runs
* of contiguous whitespace characters ignored.
- *
+ *
* If <i>pattern</i> is a <code>Regexp</code>, <i>str</i> is divided where the
* pattern matches. Whenever the pattern matches a zero-length string,
- * <i>str</i> is split into individual characters. If <i>pattern</i> contains
- * groups, the respective matches will be returned in the array as well.
- *
+ * <i>str</i> is split into individual characters.
+ *
* If <i>pattern</i> is omitted, the value of <code>$;</code> is used. If
* <code>$;</code> is <code>nil</code> (which is the default), <i>str</i> is
* split on whitespace as if ` ' were specified.
- *
+ *
* If the <i>limit</i> parameter is omitted, trailing null fields are
* suppressed. If <i>limit</i> is a positive number, at most that number of
* fields will be returned (if <i>limit</i> is <code>1</code>, the entire
* string is returned as the only entry in an array). If negative, there is no
* limit to the number of fields returned, and trailing null fields are not
* suppressed.
- *
+ *
* " now's the time".split #=> ["now's", "the", "time"]
* " now's the time".split(' ') #=> ["now's", "the", "time"]
* " now's the time".split(/ /) #=> ["", "now's", "", "the", "time"]
@@ -5519,7 +3535,7 @@ static const char isspacetable[256] = {
* "hello".split(//) #=> ["h", "e", "l", "l", "o"]
* "hello".split(//, 3) #=> ["h", "e", "llo"]
* "hi mom".split(%r{\s*}) #=> ["h", "i", "m", "o", "m"]
- *
+ *
* "mellow yellow".split("ello") #=> ["m", "w y", "w"]
* "1,2,,3,4,,".split(',') #=> ["1", "2", "", "3", "4"]
* "1,2,,3,4,,".split(',', 4) #=> ["1", "2", "", "3,4,,"]
@@ -5527,12 +3543,14 @@ static const char isspacetable[256] = {
*/
static VALUE
-rb_str_split_m(int argc, VALUE *argv, VALUE str)
+rb_str_split_m(argc, argv, str)
+ int argc;
+ VALUE *argv;
+ VALUE str;
{
- rb_encoding *enc;
VALUE spat;
VALUE limit;
- enum {awk, string, regexp} split_type;
+ int awk_split = Qfalse;
long beg, end, i = 0;
int lim = 0;
VALUE result, tmp;
@@ -5541,140 +3559,67 @@ rb_str_split_m(int argc, VALUE *argv, VALUE str)
lim = NUM2INT(limit);
if (lim <= 0) limit = Qnil;
else if (lim == 1) {
- if (RSTRING_LEN(str) == 0)
+ if (RSTRING(str)->len == 0)
return rb_ary_new2(0);
return rb_ary_new3(1, str);
}
i = 1;
}
- enc = STR_ENC_GET(str);
if (NIL_P(spat)) {
if (!NIL_P(rb_fs)) {
spat = rb_fs;
goto fs_set;
}
- split_type = awk;
+ awk_split = Qtrue;
}
else {
fs_set:
- if (TYPE(spat) == T_STRING) {
- rb_encoding *enc2 = STR_ENC_GET(spat);
-
- split_type = string;
- if (RSTRING_LEN(spat) == 0) {
- /* Special case - split into chars */
- spat = rb_reg_regcomp(spat);
- split_type = regexp;
- }
- else if (rb_enc_asciicompat(enc2) == 1) {
- if (RSTRING_LEN(spat) == 1 && RSTRING_PTR(spat)[0] == ' '){
- split_type = awk;
- }
+ if (TYPE(spat) == T_STRING && RSTRING(spat)->len == 1) {
+ if (RSTRING(spat)->ptr[0] == ' ') {
+ awk_split = Qtrue;
}
else {
- int l;
- if (rb_enc_ascget(RSTRING_PTR(spat), RSTRING_END(spat), &l, enc2) == ' ' &&
- RSTRING_LEN(spat) == l) {
- split_type = awk;
- }
+ spat = rb_reg_regcomp(rb_reg_quote(spat));
}
}
else {
spat = get_pat(spat, 1);
- split_type = regexp;
}
}
result = rb_ary_new();
beg = 0;
- if (split_type == awk) {
- char *ptr = RSTRING_PTR(str);
- char *eptr = RSTRING_END(str);
- char *bptr = ptr;
+ if (awk_split) {
+ char *ptr = RSTRING(str)->ptr;
+ long len = RSTRING(str)->len;
+ char *eptr = ptr + len;
int skip = 1;
- unsigned int c;
-
- end = beg;
- if (is_ascii_string(str)) {
- while (ptr < eptr) {
- c = (unsigned char)*ptr++;
- if (skip) {
- if (ascii_isspace(c)) {
- beg = ptr - bptr;
- }
- else {
- end = ptr - bptr;
- skip = 0;
- if (!NIL_P(limit) && lim <= i) break;
- }
- }
- else if (ascii_isspace(c)) {
- rb_ary_push(result, rb_str_subseq(str, beg, end-beg));
- skip = 1;
- beg = ptr - bptr;
- if (!NIL_P(limit)) ++i;
+
+ for (end = beg = 0; ptr<eptr; ptr++) {
+ if (skip) {
+ if (ISSPACE(*ptr)) {
+ beg++;
}
else {
- end = ptr - bptr;
+ end = beg+1;
+ skip = 0;
+ if (!NIL_P(limit) && lim <= i) break;
}
}
- }
- else {
- while (ptr < eptr) {
- int n;
-
- c = rb_enc_codepoint_len(ptr, eptr, &n, enc);
- ptr += n;
- if (skip) {
- if (rb_enc_isspace(c, enc)) {
- beg = ptr - bptr;
- }
- else {
- end = ptr - bptr;
- skip = 0;
- if (!NIL_P(limit) && lim <= i) break;
- }
- }
- else if (rb_enc_isspace(c, enc)) {
- rb_ary_push(result, rb_str_subseq(str, beg, end-beg));
+ else {
+ if (ISSPACE(*ptr)) {
+ rb_ary_push(result, rb_str_substr(str, beg, end-beg));
skip = 1;
- beg = ptr - bptr;
+ beg = end + 1;
if (!NIL_P(limit)) ++i;
}
else {
- end = ptr - bptr;
+ end++;
}
}
}
}
- else if (split_type == string) {
- char *ptr = RSTRING_PTR(str);
- char *eptr = RSTRING_END(str);
- char *sptr = RSTRING_PTR(spat);
- int slen = RSTRING_LEN(spat);
-
- if (is_broken_string(str)) {
- rb_raise(rb_eArgError, "invalid byte sequence in %s", rb_enc_name(STR_ENC_GET(str)));
- }
- if (is_broken_string(spat)) {
- rb_raise(rb_eArgError, "invalid byte sequence in %s", rb_enc_name(STR_ENC_GET(spat)));
- }
- enc = rb_enc_check(str, spat);
- while (ptr < eptr &&
- (end = rb_memsearch(sptr, slen, ptr, eptr - ptr, enc)) >= 0) {
- /* Check we are at the start of a char */
- char *t = rb_enc_right_char_head(ptr, ptr + end, eptr, enc);
- if (t != ptr + end) {
- ptr = t;
- continue;
- }
- rb_ary_push(result, rb_str_subseq(str, ptr - RSTRING_PTR(str), end));
- ptr += end + slen;
- if (!NIL_P(limit) && lim <= ++i) break;
- }
- beg = ptr - RSTRING_PTR(str);
- }
else {
long start = beg;
long idx;
@@ -5682,30 +3627,24 @@ rb_str_split_m(int argc, VALUE *argv, VALUE str)
struct re_registers *regs;
while ((end = rb_reg_search(spat, str, start, 0)) >= 0) {
- regs = RMATCH_REGS(rb_backref_get());
+ regs = RMATCH(rb_backref_get())->regs;
if (start == end && BEG(0) == END(0)) {
- if (!RSTRING_PTR(str)) {
+ if (!RSTRING(str)->ptr) {
rb_ary_push(result, rb_str_new("", 0));
break;
}
else if (last_null == 1) {
- rb_ary_push(result, rb_str_subseq(str, beg,
- rb_enc_fast_mbclen(RSTRING_PTR(str)+beg,
- RSTRING_END(str),
- enc)));
+ rb_ary_push(result, rb_str_substr(str, beg, mbclen2(RSTRING(str)->ptr[beg],spat)));
beg = start;
}
else {
- if (RSTRING_PTR(str)+start == RSTRING_END(str))
- start++;
- else
- start += rb_enc_fast_mbclen(RSTRING_PTR(str)+start,RSTRING_END(str),enc);
+ start += mbclen2(RSTRING(str)->ptr[start],spat);
last_null = 1;
continue;
}
}
else {
- rb_ary_push(result, rb_str_subseq(str, beg, end-beg));
+ rb_ary_push(result, rb_str_substr(str, beg, end-beg));
beg = start = END(0);
}
last_null = 0;
@@ -5715,23 +3654,22 @@ rb_str_split_m(int argc, VALUE *argv, VALUE str)
if (BEG(idx) == END(idx))
tmp = rb_str_new5(str, 0, 0);
else
- tmp = rb_str_subseq(str, BEG(idx), END(idx)-BEG(idx));
+ tmp = rb_str_substr(str, BEG(idx), END(idx)-BEG(idx));
rb_ary_push(result, tmp);
}
if (!NIL_P(limit) && lim <= ++i) break;
}
}
- if (RSTRING_LEN(str) > 0 && (!NIL_P(limit) || RSTRING_LEN(str) > beg || lim < 0)) {
- if (RSTRING_LEN(str) == beg)
+ if (RSTRING(str)->len > 0 && (!NIL_P(limit) || RSTRING(str)->len > beg || lim < 0)) {
+ if (RSTRING(str)->len == beg)
tmp = rb_str_new5(str, 0, 0);
else
- tmp = rb_str_subseq(str, beg, RSTRING_LEN(str)-beg);
+ tmp = rb_str_substr(str, beg, RSTRING(str)->len-beg);
rb_ary_push(result, tmp);
}
if (NIL_P(limit) && lim == 0) {
- long len;
- while ((len = RARRAY_LEN(result)) > 0 &&
- (tmp = RARRAY_PTR(result)[len-1], RSTRING_LEN(tmp) == 0))
+ while (RARRAY(result)->len > 0 &&
+ RSTRING(RARRAY(result)->ptr[RARRAY(result)->len-1])->len == 0)
rb_ary_pop(result);
}
@@ -5739,7 +3677,9 @@ rb_str_split_m(int argc, VALUE *argv, VALUE str)
}
VALUE
-rb_str_split(VALUE str, const char *sep0)
+rb_str_split(str, sep0)
+ VALUE str;
+ const char *sep0;
{
VALUE sep;
@@ -5748,39 +3688,54 @@ rb_str_split(VALUE str, const char *sep0)
return rb_str_split_m(1, &sep, str);
}
+/*
+ * call-seq:
+ * split([pattern [, limit]]) => array
+ *
+ * Equivalent to <code>$_.split(<i>pattern</i>, <i>limit</i>)</code>.
+ * See <code>String#split</code>.
+ */
+
+static VALUE
+rb_f_split(argc, argv)
+ int argc;
+ VALUE *argv;
+{
+ return rb_str_split_m(argc, argv, uscore_get());
+}
/*
* Document-method: lines
* call-seq:
* str.lines(separator=$/) => anEnumerator
* str.lines(separator=$/) {|substr| block } => str
- *
+ *
* Returns an enumerator that gives each line in the string. If a block is
* given, it iterates over each line in the string.
- *
+ *
* "foo\nbar\n".lines.to_a #=> ["foo\n", "bar\n"]
* "foo\nb ar".lines.sort #=> ["b ar", "foo\n"]
*/
/*
- * Document-method: each_line
* call-seq:
+ * str.each(separator=$/) {|substr| block } => str
* str.each_line(separator=$/) {|substr| block } => str
- *
+ *
* Splits <i>str</i> using the supplied parameter as the record separator
* (<code>$/</code> by default), passing each substring in turn to the supplied
* block. If a zero-length record separator is supplied, the string is split
* into paragraphs delimited by multiple successive newlines.
- *
+ *
* print "Example one\n"
* "hello\nworld".each {|s| p s}
* print "Example two\n"
* "hello\nworld".each('l') {|s| p s}
* print "Example three\n"
* "hello\n\n\nworld".each('') {|s| p s}
- *
+ *
* <em>produces:</em>
- *
+ *
* Example one
* "hello\n"
* "world"
@@ -5795,100 +3750,59 @@ rb_str_split(VALUE str, const char *sep0)
*/
static VALUE
-rb_str_each_line(int argc, VALUE *argv, VALUE str)
+rb_str_each_line(argc, argv, str)
+ int argc;
+ VALUE *argv;
+ VALUE str;
{
- rb_encoding *enc;
VALUE rs;
- unsigned int newline;
- const char *p, *pend, *s, *ptr;
- long len, rslen;
+ int newline;
+ char *p = RSTRING(str)->ptr, *pend = p + RSTRING(str)->len, *s;
+ char *ptr = p;
+ long len = RSTRING(str)->len, rslen;
VALUE line;
- int n;
- VALUE orig = str;
- if (argc == 0) {
+ if (rb_scan_args(argc, argv, "01", &rs) == 0) {
rs = rb_rs;
}
- else {
- rb_scan_args(argc, argv, "01", &rs);
- }
RETURN_ENUMERATOR(str, argc, argv);
if (NIL_P(rs)) {
rb_yield(str);
- return orig;
+ return str;
}
- str = rb_str_new4(str);
- ptr = p = s = RSTRING_PTR(str);
- pend = p + RSTRING_LEN(str);
- len = RSTRING_LEN(str);
StringValue(rs);
- if (rs == rb_default_rs) {
- enc = rb_enc_get(str);
- while (p < pend) {
- char *p0;
-
- p = memchr(p, '\n', pend - p);
- if (!p) break;
- p0 = rb_enc_left_char_head(s, p, pend, enc);
- if (!rb_enc_is_newline(p0, pend, enc)) {
- p++;
- continue;
- }
- p = p0 + rb_enc_mbclen(p0, pend, enc);
- line = rb_str_new5(str, s, p - s);
- OBJ_INFECT(line, str);
- rb_enc_cr_str_copy_for_substr(line, str);
- rb_yield(line);
- str_mod_check(str, ptr, len);
- s = p;
- }
- goto finish;
- }
-
- enc = rb_enc_check(str, rs);
- rslen = RSTRING_LEN(rs);
+ rslen = RSTRING(rs)->len;
if (rslen == 0) {
newline = '\n';
}
else {
- newline = rb_enc_codepoint(RSTRING_PTR(rs), RSTRING_END(rs), enc);
+ newline = RSTRING(rs)->ptr[rslen-1];
}
- while (p < pend) {
- unsigned int c = rb_enc_codepoint_len(p, pend, &n, enc);
-
- again:
- if (rslen == 0 && c == newline) {
- p += n;
- if (p < pend && (c = rb_enc_codepoint_len(p, pend, &n, enc)) != newline) {
- goto again;
- }
- while (p < pend && rb_enc_codepoint(p, pend, enc) == newline) {
- p += n;
- }
- p -= n;
+ for (s = p, p += rslen; p < pend; p++) {
+ if (rslen == 0 && *p == '\n') {
+ if (*++p != '\n') continue;
+ while (*p == '\n') p++;
}
- if (c == newline &&
- (rslen <= 1 || memcmp(RSTRING_PTR(rs), p, rslen) == 0)) {
- line = rb_str_new5(str, s, p - s + (rslen ? rslen : n));
+ if (RSTRING(str)->ptr < p && p[-1] == newline &&
+ (rslen <= 1 ||
+ rb_memcmp(RSTRING(rs)->ptr, p-rslen, rslen) == 0)) {
+ line = rb_str_new5(str, s, p - s);
OBJ_INFECT(line, str);
- rb_enc_cr_str_copy_for_substr(line, str);
rb_yield(line);
str_mod_check(str, ptr, len);
- s = p + (rslen ? rslen : n);
+ s = p;
}
- p += n;
}
- finish:
if (s != pend) {
- line = rb_str_new5(str, s, pend - s);
+ if (p > pend) p = pend;
+ line = rb_str_new5(str, s, p - s);
OBJ_INFECT(line, str);
- rb_enc_cr_str_copy_for_substr(line, str);
rb_yield(line);
}
- return orig;
+ return str;
}
@@ -5897,35 +3811,35 @@ rb_str_each_line(int argc, VALUE *argv, VALUE str)
* call-seq:
* str.bytes => anEnumerator
* str.bytes {|fixnum| block } => str
- *
+ *
* Returns an enumerator that gives each byte in the string. If a block is
* given, it iterates over each byte in the string.
- *
+ *
* "hello".bytes.to_a #=> [104, 101, 108, 108, 111]
*/
/*
- * Document-method: each_byte
* call-seq:
* str.each_byte {|fixnum| block } => str
- *
+ *
* Passes each byte in <i>str</i> to the given block.
- *
+ *
* "hello".each_byte {|c| print c, ' ' }
- *
+ *
* <em>produces:</em>
- *
+ *
* 104 101 108 108 111
*/
static VALUE
-rb_str_each_byte(VALUE str)
+rb_str_each_byte(str)
+ VALUE str;
{
long i;
RETURN_ENUMERATOR(str, 0, 0);
- for (i=0; i<RSTRING_LEN(str); i++) {
- rb_yield(INT2FIX(RSTRING_PTR(str)[i] & 0xff));
+ for (i=0; i<RSTRING(str)->len; i++) {
+ rb_yield(INT2FIX(RSTRING(str)->ptr[i] & 0xff));
}
return str;
}
@@ -5936,10 +3850,10 @@ rb_str_each_byte(VALUE str)
* call-seq:
* str.chars => anEnumerator
* str.chars {|substr| block } => str
- *
+ *
* Returns an enumerator that gives each character in the string.
* If a block is given, it iterates over each character in the string.
- *
+ *
* "foo".chars.to_a #=> ["f","o","o"]
*/
@@ -5947,140 +3861,57 @@ rb_str_each_byte(VALUE str)
* Document-method: each_char
* call-seq:
* str.each_char {|cstr| block } => str
- *
+ *
* Passes each character in <i>str</i> to the given block.
- *
+ *
* "hello".each_char {|c| print c, ' ' }
- *
+ *
* <em>produces:</em>
- *
- * h e l l o
+ *
+ * h e l l o
*/
static VALUE
rb_str_each_char(VALUE str)
{
- VALUE orig = str;
- long i, len, n;
+ int i, len, n;
const char *ptr;
- rb_encoding *enc;
RETURN_ENUMERATOR(str, 0, 0);
str = rb_str_new4(str);
- ptr = RSTRING_PTR(str);
- len = RSTRING_LEN(str);
- enc = rb_enc_get(str);
- switch (ENC_CODERANGE(str)) {
- case ENC_CODERANGE_VALID:
- case ENC_CODERANGE_7BIT:
- for (i = 0; i < len; i += n) {
- n = rb_enc_fast_mbclen(ptr + i, ptr + len, enc);
- rb_yield(rb_str_subseq(str, i, n));
- }
- break;
- default:
- for (i = 0; i < len; i += n) {
- n = rb_enc_mbclen(ptr + i, ptr + len, enc);
- rb_yield(rb_str_subseq(str, i, n));
- }
- }
- return orig;
-}
-
-/*
- * Document-method: codepoints
- * call-seq:
- * str.codepoints => anEnumerator
- * str.codepoints {|fixnum| block } => str
- *
- * Returns an enumerator that gives the <code>Integer</code> ordinal
- * of each character in the string, also known as a <i>codepoint</i>
- * when applied to Unicode strings. If a block is given, it iterates
- * over each character in the string.
- *
- * "foo\u0635".codepoints.to_a #=> [102, 111, 111, 1589]
- */
-
-/*
- * Document-method: each_codepoint
- * call-seq:
- * str.each_codepoint {|integer| block } => str
- *
- * Passes the <code>Integer</code> ordinal of each character in <i>str</i>,
- * also known as a <i>codepoint</i> when applied to Unicode strings to the
- * given block.
- *
- * "hello\u0639".each_codepoint {|c| print c, ' ' }
- *
- * <em>produces:</em>
- *
- * 104 101 108 108 111 1593
- */
-
-static VALUE
-rb_str_each_codepoint(VALUE str)
-{
- VALUE orig = str;
- long len;
- int n;
- unsigned int c;
- const char *ptr, *end;
- rb_encoding *enc;
-
- if (single_byte_optimizable(str)) return rb_str_each_byte(str);
- RETURN_ENUMERATOR(str, 0, 0);
- str = rb_str_new4(str);
- ptr = RSTRING_PTR(str);
- len = RSTRING_LEN(str);
- end = RSTRING_END(str);
- enc = STR_ENC_GET(str);
- while (ptr < end) {
- c = rb_enc_codepoint_len(ptr, end, &n, enc);
- rb_yield(UINT2NUM(c));
- ptr += n;
+ ptr = RSTRING(str)->ptr;
+ len = RSTRING(str)->len;
+ for (i = 0; i < len; i += n) {
+ n = mbclen(ptr[i]);
+ rb_yield(rb_str_substr(str, i, n));
}
- return orig;
+ return str;
}
-static long
-chopped_length(VALUE str)
-{
- rb_encoding *enc = STR_ENC_GET(str);
- const char *p, *p2, *beg, *end;
-
- beg = RSTRING_PTR(str);
- end = beg + RSTRING_LEN(str);
- if (beg > end) return 0;
- p = rb_enc_prev_char(beg, end, end, enc);
- if (!p) return 0;
- if (p > beg && rb_enc_codepoint(p, end, enc) == '\n') {
- p2 = rb_enc_prev_char(beg, p, end, enc);
- if (p2 && rb_enc_codepoint(p2, end, enc) == '\r') p = p2;
- }
- return p - beg;
-}
/*
* call-seq:
* str.chop! => str or nil
- *
+ *
* Processes <i>str</i> as for <code>String#chop</code>, returning <i>str</i>,
* or <code>nil</code> if <i>str</i> is the empty string. See also
* <code>String#chomp!</code>.
*/
static VALUE
-rb_str_chop_bang(VALUE str)
+rb_str_chop_bang(str)
+ VALUE str;
{
- str_modify_keep_cr(str);
- if (RSTRING_LEN(str) > 0) {
- long len;
- len = chopped_length(str);
- STR_SET_LEN(str, len);
- RSTRING_PTR(str)[len] = '\0';
- if (ENC_CODERANGE(str) != ENC_CODERANGE_7BIT) {
- ENC_CODERANGE_CLEAR(str);
+ if (RSTRING(str)->len > 0) {
+ rb_str_modify(str);
+ RSTRING(str)->len--;
+ if (RSTRING(str)->ptr[RSTRING(str)->len] == '\n') {
+ if (RSTRING(str)->len > 0 &&
+ RSTRING(str)->ptr[RSTRING(str)->len-1] == '\r') {
+ RSTRING(str)->len--;
+ }
}
+ RSTRING(str)->ptr[RSTRING(str)->len] = '\0';
return str;
}
return Qnil;
@@ -6090,13 +3921,13 @@ rb_str_chop_bang(VALUE str)
/*
* call-seq:
* str.chop => new_str
- *
+ *
* Returns a new <code>String</code> with the last character removed. If the
* string ends with <code>\r\n</code>, both characters are removed. Applying
* <code>chop</code> to an empty string returns an empty
* string. <code>String#chomp</code> is often a safer alternative, as it leaves
* the string unchanged if it doesn't end in a record separator.
- *
+ *
* "string\r\n".chop #=> "string"
* "string\n\r".chop #=> "string\n"
* "string\n".chop #=> "string"
@@ -6105,118 +3936,146 @@ rb_str_chop_bang(VALUE str)
*/
static VALUE
-rb_str_chop(VALUE str)
+rb_str_chop(str)
+ VALUE str;
{
- VALUE str2 = rb_str_new5(str, RSTRING_PTR(str), chopped_length(str));
- rb_enc_cr_str_copy_for_substr(str2, str);
- OBJ_INFECT(str2, str);
- return str2;
+ str = rb_str_dup(str);
+ rb_str_chop_bang(str);
+ return str;
+}
+
+
+/*
+ * call-seq:
+ * chop! => $_ or nil
+ *
+ * Equivalent to <code>$_.chop!</code>.
+ *
+ * a = "now\r\n"
+ * $_ = a
+ * chop! #=> "now"
+ * chop! #=> "no"
+ * chop! #=> "n"
+ * chop! #=> ""
+ * chop! #=> nil
+ * $_ #=> ""
+ * a #=> ""
+ */
+
+static VALUE
+rb_f_chop_bang(str)
+ VALUE str;
+{
+ return rb_str_chop_bang(uscore_get());
+}
+
+/*
+ * call-seq:
+ * chop => string
+ *
+ * Equivalent to <code>($_.dup).chop!</code>, except <code>nil</code>
+ * is never returned. See <code>String#chop!</code>.
+ *
+ * a = "now\r\n"
+ * $_ = a
+ * chop #=> "now"
+ * $_ #=> "now"
+ * chop #=> "no"
+ * chop #=> "n"
+ * chop #=> ""
+ * chop #=> ""
+ * a #=> "now\r\n"
+ */
+
+static VALUE
+rb_f_chop()
+{
+ VALUE str = uscore_get();
+
+ if (RSTRING(str)->len > 0) {
+ str = rb_str_dup(str);
+ rb_str_chop_bang(str);
+ rb_lastline_set(str);
+ }
+ return str;
}
/*
* call-seq:
* str.chomp!(separator=$/) => str or nil
- *
+ *
* Modifies <i>str</i> in place as described for <code>String#chomp</code>,
* returning <i>str</i>, or <code>nil</code> if no modifications were made.
*/
static VALUE
-rb_str_chomp_bang(int argc, VALUE *argv, VALUE str)
+rb_str_chomp_bang(argc, argv, str)
+ int argc;
+ VALUE *argv;
+ VALUE str;
{
- rb_encoding *enc;
VALUE rs;
int newline;
- char *p, *pp, *e;
+ char *p;
long len, rslen;
- str_modify_keep_cr(str);
- len = RSTRING_LEN(str);
- if (len == 0) return Qnil;
- p = RSTRING_PTR(str);
- e = p + len;
- if (argc == 0) {
+ if (rb_scan_args(argc, argv, "01", &rs) == 0) {
+ len = RSTRING(str)->len;
+ if (len == 0) return Qnil;
+ p = RSTRING(str)->ptr;
rs = rb_rs;
if (rs == rb_default_rs) {
smart_chomp:
- enc = rb_enc_get(str);
- if (rb_enc_mbminlen(enc) > 1) {
- pp = rb_enc_left_char_head(p, e-rb_enc_mbminlen(enc), e, enc);
- if (rb_enc_is_newline(pp, e, enc)) {
- e = pp;
- }
- pp = e - rb_enc_mbminlen(enc);
- if (pp >= p) {
- pp = rb_enc_left_char_head(p, pp, e, enc);
- if (rb_enc_ascget(pp, e, 0, enc) == '\r') {
- e = pp;
- }
- }
- if (e == RSTRING_END(str)) {
- return Qnil;
+ rb_str_modify(str);
+ if (RSTRING(str)->ptr[len-1] == '\n') {
+ RSTRING(str)->len--;
+ if (RSTRING(str)->len > 0 &&
+ RSTRING(str)->ptr[RSTRING(str)->len-1] == '\r') {
+ RSTRING(str)->len--;
}
- len = e - RSTRING_PTR(str);
- STR_SET_LEN(str, len);
+ }
+ else if (RSTRING(str)->ptr[len-1] == '\r') {
+ RSTRING(str)->len--;
}
else {
- if (RSTRING_PTR(str)[len-1] == '\n') {
- STR_DEC_LEN(str);
- if (RSTRING_LEN(str) > 0 &&
- RSTRING_PTR(str)[RSTRING_LEN(str)-1] == '\r') {
- STR_DEC_LEN(str);
- }
- }
- else if (RSTRING_PTR(str)[len-1] == '\r') {
- STR_DEC_LEN(str);
- }
- else {
- return Qnil;
- }
+ return Qnil;
}
- RSTRING_PTR(str)[RSTRING_LEN(str)] = '\0';
+ RSTRING(str)->ptr[RSTRING(str)->len] = '\0';
return str;
}
}
- else {
- rb_scan_args(argc, argv, "01", &rs);
- }
if (NIL_P(rs)) return Qnil;
StringValue(rs);
- rslen = RSTRING_LEN(rs);
+ len = RSTRING(str)->len;
+ if (len == 0) return Qnil;
+ p = RSTRING(str)->ptr;
+ rslen = RSTRING(rs)->len;
if (rslen == 0) {
while (len>0 && p[len-1] == '\n') {
len--;
if (len>0 && p[len-1] == '\r')
len--;
}
- if (len < RSTRING_LEN(str)) {
- STR_SET_LEN(str, len);
- RSTRING_PTR(str)[len] = '\0';
+ if (len < RSTRING(str)->len) {
+ rb_str_modify(str);
+ RSTRING(str)->len = len;
+ RSTRING(str)->ptr[len] = '\0';
return str;
}
return Qnil;
}
if (rslen > len) return Qnil;
- newline = RSTRING_PTR(rs)[rslen-1];
+ newline = RSTRING(rs)->ptr[rslen-1];
if (rslen == 1 && newline == '\n')
goto smart_chomp;
- enc = rb_enc_check(str, rs);
- if (is_broken_string(rs)) {
- return Qnil;
- }
- pp = e - rslen;
if (p[len-1] == newline &&
(rslen <= 1 ||
- memcmp(RSTRING_PTR(rs), pp, rslen) == 0)) {
- if (rb_enc_left_char_head(p, pp, e, enc) != pp)
- return Qnil;
- if (ENC_CODERANGE(str) != ENC_CODERANGE_7BIT) {
- ENC_CODERANGE_CLEAR(str);
- }
- STR_SET_LEN(str, RSTRING_LEN(str) - rslen);
- RSTRING_PTR(str)[RSTRING_LEN(str)] = '\0';
+ rb_memcmp(RSTRING(rs)->ptr, p+len-rslen, rslen) == 0)) {
+ rb_str_modify(str);
+ RSTRING(str)->len -= rslen;
+ RSTRING(str)->ptr[RSTRING(str)->len] = '\0';
return str;
}
return Qnil;
@@ -6226,13 +4085,13 @@ rb_str_chomp_bang(int argc, VALUE *argv, VALUE str)
/*
* call-seq:
* str.chomp(separator=$/) => new_str
- *
+ *
* Returns a new <code>String</code> with the given record separator removed
* from the end of <i>str</i> (if present). If <code>$/</code> has not been
* changed from the default Ruby record separator, then <code>chomp</code> also
* removes carriage return characters (that is it will remove <code>\n</code>,
* <code>\r</code>, and <code>\r\n</code>).
- *
+ *
* "hello".chomp #=> "hello"
* "hello\n".chomp #=> "hello"
* "hello\r\n".chomp #=> "hello"
@@ -6243,7 +4102,10 @@ rb_str_chomp_bang(int argc, VALUE *argv, VALUE str)
*/
static VALUE
-rb_str_chomp(int argc, VALUE *argv, VALUE str)
+rb_str_chomp(argc, argv, str)
+ int argc;
+ VALUE *argv;
+ VALUE str;
{
str = rb_str_dup(str);
rb_str_chomp_bang(argc, argv, str);
@@ -6252,40 +4114,88 @@ rb_str_chomp(int argc, VALUE *argv, VALUE str)
/*
* call-seq:
+ * chomp! => $_ or nil
+ * chomp!(string) => $_ or nil
+ *
+ * Equivalent to <code>$_.chomp!(<em>string</em>)</code>. See
+ * <code>String#chomp!</code>
+ *
+ * $_ = "now\n"
+ * chomp! #=> "now"
+ * $_ #=> "now"
+ * chomp! "x" #=> nil
+ * $_ #=> "now"
+ */
+
+static VALUE
+rb_f_chomp_bang(argc, argv)
+ int argc;
+ VALUE *argv;
+{
+ return rb_str_chomp_bang(argc, argv, uscore_get());
+}
+
+/*
+ * call-seq:
+ * chomp => $_
+ * chomp(string) => $_
+ *
+ * Equivalent to <code>$_ = $_.chomp(<em>string</em>)</code>. See
+ * <code>String#chomp</code>.
+ *
+ * $_ = "now\n"
+ * chomp #=> "now"
+ * $_ #=> "now"
+ * chomp "ow" #=> "n"
+ * $_ #=> "n"
+ * chomp "xxx" #=> "n"
+ * $_ #=> "n"
+ */
+
+static VALUE
+rb_f_chomp(argc, argv)
+ int argc;
+ VALUE *argv;
+{
+ VALUE str = uscore_get();
+ VALUE dup = rb_str_dup(str);
+
+ if (NIL_P(rb_str_chomp_bang(argc, argv, dup)))
+ return str;
+ rb_lastline_set(dup);
+ return dup;
+}
+
+
+/*
+ * call-seq:
* str.lstrip! => self or nil
- *
+ *
* Removes leading whitespace from <i>str</i>, returning <code>nil</code> if no
* change was made. See also <code>String#rstrip!</code> and
* <code>String#strip!</code>.
- *
+ *
* " hello ".lstrip #=> "hello "
* "hello".lstrip! #=> nil
*/
static VALUE
-rb_str_lstrip_bang(VALUE str)
+rb_str_lstrip_bang(str)
+ VALUE str;
{
- rb_encoding *enc;
char *s, *t, *e;
- str_modify_keep_cr(str);
- enc = STR_ENC_GET(str);
- s = RSTRING_PTR(str);
- if (!s || RSTRING_LEN(str) == 0) return Qnil;
- e = t = RSTRING_END(str);
+ s = RSTRING(str)->ptr;
+ if (!s || RSTRING(str)->len == 0) return Qnil;
+ e = t = s + RSTRING(str)->len;
/* remove spaces at head */
- while (s < e) {
- int n;
- unsigned int cc = rb_enc_codepoint_len(s, e, &n, enc);
-
- if (!rb_enc_isspace(cc, enc)) break;
- s += n;
- }
+ while (s < t && ISSPACE(*s)) s++;
- if (s > RSTRING_PTR(str)) {
- STR_SET_LEN(str, t-s);
- memmove(RSTRING_PTR(str), s, RSTRING_LEN(str));
- RSTRING_PTR(str)[RSTRING_LEN(str)] = '\0';
+ if (s > RSTRING(str)->ptr) {
+ rb_str_modify(str);
+ RSTRING(str)->len = t-s;
+ memmove(RSTRING(str)->ptr, s, RSTRING(str)->len);
+ RSTRING(str)->ptr[RSTRING(str)->len] = '\0';
return str;
}
return Qnil;
@@ -6295,16 +4205,17 @@ rb_str_lstrip_bang(VALUE str)
/*
* call-seq:
* str.lstrip => new_str
- *
+ *
* Returns a copy of <i>str</i> with leading whitespace removed. See also
* <code>String#rstrip</code> and <code>String#strip</code>.
- *
+ *
* " hello ".lstrip #=> "hello "
* "hello".lstrip #=> "hello"
*/
static VALUE
-rb_str_lstrip(VALUE str)
+rb_str_lstrip(str)
+ VALUE str;
{
str = rb_str_dup(str);
rb_str_lstrip_bang(str);
@@ -6315,47 +4226,35 @@ rb_str_lstrip(VALUE str)
/*
* call-seq:
* str.rstrip! => self or nil
- *
+ *
* Removes trailing whitespace from <i>str</i>, returning <code>nil</code> if
* no change was made. See also <code>String#lstrip!</code> and
* <code>String#strip!</code>.
- *
+ *
* " hello ".rstrip #=> " hello"
* "hello".rstrip! #=> nil
*/
static VALUE
-rb_str_rstrip_bang(VALUE str)
+rb_str_rstrip_bang(str)
+ VALUE str;
{
- rb_encoding *enc;
char *s, *t, *e;
- str_modify_keep_cr(str);
- enc = STR_ENC_GET(str);
- rb_str_check_dummy_enc(enc);
- s = RSTRING_PTR(str);
- if (!s || RSTRING_LEN(str) == 0) return Qnil;
- t = e = RSTRING_END(str);
+ s = RSTRING(str)->ptr;
+ if (!s || RSTRING(str)->len == 0) return Qnil;
+ e = t = s + RSTRING(str)->len;
- /* remove trailing spaces or '\0's */
- if (single_byte_optimizable(str)) {
- unsigned char c;
- while (s < t && ((c = *(t-1)) == '\0' || rb_enc_isspace(c, enc))) t--;
- }
- else {
- char *tp;
+ /* remove trailing '\0's */
+ while (s < t && t[-1] == '\0') t--;
- while ((tp = rb_enc_prev_char(s, t, e, enc)) != NULL) {
- unsigned int c = rb_enc_codepoint(tp, e, enc);
- if (c && !rb_enc_isspace(c, enc)) break;
- t = tp;
- }
- }
- if (t < e) {
- int len = t-RSTRING_PTR(str);
+ /* remove trailing spaces */
+ while (s < t && ISSPACE(*(t-1))) t--;
- STR_SET_LEN(str, len);
- RSTRING_PTR(str)[len] = '\0';
+ if (t < e) {
+ rb_str_modify(str);
+ RSTRING(str)->len = t-s;
+ RSTRING(str)->ptr[RSTRING(str)->len] = '\0';
return str;
}
return Qnil;
@@ -6365,16 +4264,17 @@ rb_str_rstrip_bang(VALUE str)
/*
* call-seq:
* str.rstrip => new_str
- *
+ *
* Returns a copy of <i>str</i> with trailing whitespace removed. See also
* <code>String#lstrip</code> and <code>String#strip</code>.
- *
+ *
* " hello ".rstrip #=> " hello"
* "hello".rstrip #=> "hello"
*/
static VALUE
-rb_str_rstrip(VALUE str)
+rb_str_rstrip(str)
+ VALUE str;
{
str = rb_str_dup(str);
rb_str_rstrip_bang(str);
@@ -6385,13 +4285,14 @@ rb_str_rstrip(VALUE str)
/*
* call-seq:
* str.strip! => str or nil
- *
+ *
* Removes leading and trailing whitespace from <i>str</i>. Returns
* <code>nil</code> if <i>str</i> was not altered.
*/
static VALUE
-rb_str_strip_bang(VALUE str)
+rb_str_strip_bang(str)
+ VALUE str;
{
VALUE l = rb_str_lstrip_bang(str);
VALUE r = rb_str_rstrip_bang(str);
@@ -6404,15 +4305,16 @@ rb_str_strip_bang(VALUE str)
/*
* call-seq:
* str.strip => new_str
- *
+ *
* Returns a copy of <i>str</i> with leading and trailing whitespace removed.
- *
+ *
* " hello ".strip #=> "hello"
* "\tgoodbye\r\n".strip #=> "goodbye"
*/
static VALUE
-rb_str_strip(VALUE str)
+rb_str_strip(str)
+ VALUE str;
{
str = rb_str_dup(str);
rb_str_strip_bang(str);
@@ -6420,7 +4322,9 @@ rb_str_strip(VALUE str)
}
static VALUE
-scan_once(VALUE str, VALUE pat, long *start)
+scan_once(str, pat, start)
+ VALUE str, pat;
+ long *start;
{
VALUE result, match;
struct re_registers *regs;
@@ -6428,15 +4332,13 @@ scan_once(VALUE str, VALUE pat, long *start)
if (rb_reg_search(pat, str, *start, 0) >= 0) {
match = rb_backref_get();
- regs = RMATCH_REGS(match);
+ regs = RMATCH(match)->regs;
if (BEG(0) == END(0)) {
- rb_encoding *enc = STR_ENC_GET(str);
/*
* Always consume at least one character of the input string
*/
- if (RSTRING_LEN(str) > END(0))
- *start = END(0)+rb_enc_fast_mbclen(RSTRING_PTR(str)+END(0),
- RSTRING_END(str), enc);
+ if (RSTRING(str)->len > END(0))
+ *start = END(0)+mbclen2(RSTRING(str)->ptr[END(0)],pat);
else
*start = END(0)+1;
}
@@ -6461,73 +4363,90 @@ scan_once(VALUE str, VALUE pat, long *start)
* call-seq:
* str.scan(pattern) => array
* str.scan(pattern) {|match, ...| block } => str
- *
+ *
* Both forms iterate through <i>str</i>, matching the pattern (which may be a
* <code>Regexp</code> or a <code>String</code>). For each match, a result is
* generated and either added to the result array or passed to the block. If
* the pattern contains no groups, each individual result consists of the
* matched string, <code>$&</code>. If the pattern contains groups, each
* individual result is itself an array containing one entry per group.
- *
+ *
* a = "cruel world"
* a.scan(/\w+/) #=> ["cruel", "world"]
* a.scan(/.../) #=> ["cru", "el ", "wor"]
* a.scan(/(...)/) #=> [["cru"], ["el "], ["wor"]]
* a.scan(/(..)(..)/) #=> [["cr", "ue"], ["l ", "wo"]]
- *
+ *
* And the block form:
- *
+ *
* a.scan(/\w+/) {|w| print "<<#{w}>> " }
* print "\n"
* a.scan(/(.)(.)/) {|x,y| print y, x }
* print "\n"
- *
+ *
* <em>produces:</em>
- *
+ *
* <<cruel>> <<world>>
* rceu lowlr
*/
static VALUE
-rb_str_scan(VALUE str, VALUE pat)
+rb_str_scan(str, pat)
+ VALUE str, pat;
{
VALUE result;
long start = 0;
- long last = -1, prev = 0;
- char *p = RSTRING_PTR(str); long len = RSTRING_LEN(str);
+ VALUE match = Qnil;
+ char *p = RSTRING(str)->ptr; long len = RSTRING(str)->len;
pat = get_pat(pat, 1);
if (!rb_block_given_p()) {
VALUE ary = rb_ary_new();
while (!NIL_P(result = scan_once(str, pat, &start))) {
- last = prev;
- prev = start;
+ match = rb_backref_get();
rb_ary_push(ary, result);
}
- if (last >= 0) rb_reg_search(pat, str, last, 0);
+ rb_backref_set(match);
return ary;
}
while (!NIL_P(result = scan_once(str, pat, &start))) {
- last = prev;
- prev = start;
+ match = rb_backref_get();
+ rb_match_busy(match);
rb_yield(result);
str_mod_check(str, p, len);
+ rb_backref_set(match); /* restore $~ value */
}
- if (last >= 0) rb_reg_search(pat, str, last, 0);
+ rb_backref_set(match);
return str;
}
+/*
+ * call-seq:
+ * scan(pattern) => array
+ * scan(pattern) {|///| block } => $_
+ *
+ * Equivalent to calling <code>$_.scan</code>. See
+ * <code>String#scan</code>.
+ */
+
+static VALUE
+rb_f_scan(self, pat)
+ VALUE self, pat;
+{
+ return rb_str_scan(uscore_get(), pat);
+}
+
/*
* call-seq:
* str.hex => integer
- *
+ *
* Treats leading characters from <i>str</i> as a string of hexadecimal digits
* (with an optional sign and an optional <code>0x</code>) and returns the
* corresponding number. Zero is returned on error.
- *
+ *
* "0x0a".hex #=> 10
* "-1234".hex #=> -4660
* "0".hex #=> 0
@@ -6535,13 +4454,9 @@ rb_str_scan(VALUE str, VALUE pat)
*/
static VALUE
-rb_str_hex(VALUE str)
+rb_str_hex(str)
+ VALUE str;
{
- rb_encoding *enc = rb_enc_get(str);
-
- if (!rb_enc_asciicompat(enc)) {
- rb_raise(rb_eEncCompatError, "ASCII incompatible encoding: %s", rb_enc_name(enc));
- }
return rb_str_to_inum(str, 16, Qfalse);
}
@@ -6549,11 +4464,11 @@ rb_str_hex(VALUE str)
/*
* call-seq:
* str.oct => integer
- *
+ *
* Treats leading characters of <i>str</i> as a string of octal digits (with an
* optional sign) and returns the corresponding number. Returns 0 if the
* conversion fails.
- *
+ *
* "123".oct #=> 83
* "-377".oct #=> -255
* "bad".oct #=> 0
@@ -6561,13 +4476,9 @@ rb_str_hex(VALUE str)
*/
static VALUE
-rb_str_oct(VALUE str)
+rb_str_oct(str)
+ VALUE str;
{
- rb_encoding *enc = rb_enc_get(str);
-
- if (!rb_enc_asciicompat(enc)) {
- rb_raise(rb_eEncCompatError, "ASCII incompatible encoding: %s", rb_enc_name(enc));
- }
return rb_str_to_inum(str, -8, Qfalse);
}
@@ -6575,7 +4486,7 @@ rb_str_oct(VALUE str)
/*
* call-seq:
* str.crypt(other_str) => new_str
- *
+ *
* Applies a one-way cryptographic hash to <i>str</i> by invoking the standard
* library function <code>crypt</code>. The argument is the salt string, which
* should be two characters long, each character drawn from
@@ -6583,31 +4494,20 @@ rb_str_oct(VALUE str)
*/
static VALUE
-rb_str_crypt(VALUE str, VALUE salt)
+rb_str_crypt(str, salt)
+ VALUE str, salt;
{
- extern char *crypt(const char *, const char *);
+ extern char *crypt _((const char *, const char*));
VALUE result;
- const char *s, *saltp;
-#ifdef BROKEN_CRYPT
- char salt_8bit_clean[3];
-#endif
+ const char *s;
StringValue(salt);
- if (RSTRING_LEN(salt) < 2)
- rb_raise(rb_eArgError, "salt too short (need >=2 bytes)");
-
- s = RSTRING_PTR(str);
- if (!s) s = "";
- saltp = RSTRING_PTR(salt);
-#ifdef BROKEN_CRYPT
- if (!ISASCII((unsigned char)saltp[0]) || !ISASCII((unsigned char)saltp[1])) {
- salt_8bit_clean[0] = saltp[0] & 0x7f;
- salt_8bit_clean[1] = saltp[1] & 0x7f;
- salt_8bit_clean[2] = '\0';
- saltp = salt_8bit_clean;
- }
-#endif
- result = rb_str_new2(crypt(s, saltp));
+ if (RSTRING(salt)->len < 2)
+ rb_raise(rb_eArgError, "salt too short(need >=2 bytes)");
+
+ if (RSTRING(str)->ptr) s = RSTRING(str)->ptr;
+ else s = "";
+ result = rb_str_new2(crypt(s, RSTRING(salt)->ptr));
OBJ_INFECT(result, str);
OBJ_INFECT(result, salt);
return result;
@@ -6618,10 +4518,10 @@ rb_str_crypt(VALUE str, VALUE salt)
* call-seq:
* str.intern => symbol
* str.to_sym => symbol
- *
+ *
* Returns the <code>Symbol</code> corresponding to <i>str</i>, creating the
* symbol if it did not previously exist. See <code>Symbol#id2name</code>.
- *
+ *
* "Koala".intern #=> :Koala
* s = 'cat'.to_sym #=> :cat
* s == :cat #=> true
@@ -6630,57 +4530,34 @@ rb_str_crypt(VALUE str, VALUE salt)
*
* This can also be used to create symbols that cannot be represented using the
* <code>:xxx</code> notation.
- *
+ *
* 'cat and dog'.to_sym #=> :"cat and dog"
*/
VALUE
-rb_str_intern(VALUE s)
+rb_str_intern(s)
+ VALUE s;
{
- VALUE str = RB_GC_GUARD(s);
- VALUE sym;
- ID id, id2;
-
- id = rb_intern_str(str);
- sym = ID2SYM(id);
- id2 = SYM2ID(sym);
- if (id != id2) {
- const char *name = rb_id2name(id2);
+ volatile VALUE str = s;
+ ID id;
- if (name) {
- rb_raise(rb_eRuntimeError, "symbol table overflow (%s given for %s)",
- name, RSTRING_PTR(str));
- }
- else {
- rb_raise(rb_eRuntimeError, "symbol table overflow (symbol %s)",
- RSTRING_PTR(str));
- }
+ if (!RSTRING(str)->ptr || RSTRING(str)->len == 0) {
+ rb_raise(rb_eArgError, "interning empty string");
}
- return sym;
+ if (strlen(RSTRING(str)->ptr) != RSTRING(str)->len)
+ rb_raise(rb_eArgError, "symbol string may not contain `\\0'");
+ if (OBJ_TAINTED(str) && rb_safe_level() >= 1 && !rb_sym_interned_p(str)) {
+ rb_raise(rb_eSecurityError, "Insecure: can't intern tainted string");
+ }
+ id = rb_intern(RSTRING(str)->ptr);
+ return ID2SYM(id);
}
/*
* call-seq:
- * str.ord => integer
- *
- * Return the <code>Integer</code> ordinal of a one-character string.
- *
- * "a".ord #=> 97
- */
-
-VALUE
-rb_str_ord(VALUE s)
-{
- unsigned int c;
-
- c = rb_enc_codepoint(RSTRING_PTR(s), RSTRING_END(s), STR_ENC_GET(s));
- return UINT2NUM(c);
-}
-/*
- * call-seq:
* str.sum(n=16) => integer
- *
+ *
* Returns a basic <em>n</em>-bit checksum of the characters in <i>str</i>,
* where <em>n</em> is the optional <code>Fixnum</code> parameter, defaulting
* to 16. The result is simply the sum of the binary value of each character in
@@ -6689,24 +4566,25 @@ rb_str_ord(VALUE s)
*/
static VALUE
-rb_str_sum(int argc, VALUE *argv, VALUE str)
+rb_str_sum(argc, argv, str)
+ int argc;
+ VALUE *argv;
+ VALUE str;
{
VALUE vbits;
int bits;
char *ptr, *p, *pend;
long len;
- if (argc == 0) {
+ if (rb_scan_args(argc, argv, "01", &vbits) == 0) {
bits = 16;
}
- else {
- rb_scan_args(argc, argv, "01", &vbits);
- bits = NUM2INT(vbits);
- }
- ptr = p = RSTRING_PTR(str);
- len = RSTRING_LEN(str);
+ else bits = NUM2INT(vbits);
+
+ ptr = p = RSTRING(str)->ptr;
+ len = RSTRING(str)->len;
pend = p + len;
- if (bits >= (int)sizeof(long)*CHAR_BIT) {
+ if (bits >= sizeof(long)*CHAR_BIT) {
VALUE sum = INT2FIX(0);
while (p < pend) {
@@ -6739,87 +4617,72 @@ rb_str_sum(int argc, VALUE *argv, VALUE str)
}
static VALUE
-rb_str_justify(int argc, VALUE *argv, VALUE str, char jflag)
+rb_str_justify(argc, argv, str, jflag)
+ int argc;
+ VALUE *argv;
+ VALUE str;
+ char jflag;
{
- rb_encoding *enc;
VALUE w;
- long width, len, flen = 1, fclen = 1;
+ long width, flen = 0;
VALUE res;
- char *p;
+ char *p, *pend;
const char *f = " ";
- long n, llen, rlen;
- volatile VALUE pad;
- int singlebyte = 1, cr;
+ long n;
+ VALUE pad;
rb_scan_args(argc, argv, "11", &w, &pad);
- enc = STR_ENC_GET(str);
width = NUM2LONG(w);
if (argc == 2) {
StringValue(pad);
- enc = rb_enc_check(str, pad);
- f = RSTRING_PTR(pad);
- flen = RSTRING_LEN(pad);
- fclen = str_strlen(pad, enc);
- singlebyte = single_byte_optimizable(pad);
- if (flen == 0 || fclen == 0) {
+ f = RSTRING(pad)->ptr;
+ flen = RSTRING(pad)->len;
+ if (flen == 0) {
rb_raise(rb_eArgError, "zero width padding");
}
}
- len = str_strlen(str, enc);
- if (width < 0 || len >= width) return rb_str_dup(str);
- n = width - len;
- llen = (jflag == 'l') ? 0 : ((jflag == 'r') ? n : n/2);
- rlen = n - llen;
- cr = ENC_CODERANGE(str);
- res = rb_str_new5(str, 0, RSTRING_LEN(str)+n*flen/fclen+2);
- p = RSTRING_PTR(res);
- while (llen) {
+ if (width < 0 || RSTRING(str)->len >= width) return rb_str_dup(str);
+ res = rb_str_new5(str, 0, width);
+ p = RSTRING(res)->ptr;
+ if (jflag != 'l') {
+ n = width - RSTRING(str)->len;
+ pend = p + ((jflag == 'r') ? n : n/2);
if (flen <= 1) {
- *p++ = *f;
- llen--;
- }
- else if (llen > fclen) {
- memcpy(p,f,flen);
- p += flen;
- llen -= fclen;
+ while (p < pend) {
+ *p++ = *f;
+ }
}
else {
- char *fp = str_nth(f, f+flen, llen, enc, singlebyte);
- n = fp - f;
- memcpy(p,f,n);
- p+=n;
- break;
+ const char *q = f;
+ while (p + flen <= pend) {
+ memcpy(p,f,flen);
+ p += flen;
+ }
+ while (p < pend) {
+ *p++ = *q++;
+ }
}
}
- memcpy(p, RSTRING_PTR(str), RSTRING_LEN(str));
- p+=RSTRING_LEN(str);
- while (rlen) {
+ memcpy(p, RSTRING(str)->ptr, RSTRING(str)->len);
+ if (jflag != 'r') {
+ p += RSTRING(str)->len; pend = RSTRING(res)->ptr + width;
if (flen <= 1) {
- *p++ = *f;
- rlen--;
- }
- else if (rlen > fclen) {
- memcpy(p,f,flen);
- p += flen;
- rlen -= fclen;
+ while (p < pend) {
+ *p++ = *f;
+ }
}
else {
- char *fp = str_nth(f, f+flen, rlen, enc, singlebyte);
- n = fp - f;
- memcpy(p,f,n);
- p+=n;
- break;
+ while (p + flen <= pend) {
+ memcpy(p,f,flen);
+ p += flen;
+ }
+ while (p < pend) {
+ *p++ = *f++;
+ }
}
}
- *p = '\0';
- STR_SET_LEN(res, p-RSTRING_PTR(res));
OBJ_INFECT(res, str);
- if (!NIL_P(pad)) OBJ_INFECT(res, pad);
- rb_enc_associate(res, enc);
- if (argc == 2)
- cr = ENC_CODERANGE_AND(cr, ENC_CODERANGE(pad));
- if (cr != ENC_CODERANGE_BROKEN)
- ENC_CODERANGE_SET(res, cr);
+ if (flen > 0) OBJ_INFECT(res, pad);
return res;
}
@@ -6827,18 +4690,21 @@ rb_str_justify(int argc, VALUE *argv, VALUE str, char jflag)
/*
* call-seq:
* str.ljust(integer, padstr=' ') => new_str
- *
+ *
* If <i>integer</i> is greater than the length of <i>str</i>, returns a new
* <code>String</code> of length <i>integer</i> with <i>str</i> left justified
* and padded with <i>padstr</i>; otherwise, returns <i>str</i>.
- *
+ *
* "hello".ljust(4) #=> "hello"
* "hello".ljust(20) #=> "hello "
* "hello".ljust(20, '1234') #=> "hello123412341234123"
*/
static VALUE
-rb_str_ljust(int argc, VALUE *argv, VALUE str)
+rb_str_ljust(argc, argv, str)
+ int argc;
+ VALUE *argv;
+ VALUE str;
{
return rb_str_justify(argc, argv, str, 'l');
}
@@ -6847,18 +4713,21 @@ rb_str_ljust(int argc, VALUE *argv, VALUE str)
/*
* call-seq:
* str.rjust(integer, padstr=' ') => new_str
- *
+ *
* If <i>integer</i> is greater than the length of <i>str</i>, returns a new
* <code>String</code> of length <i>integer</i> with <i>str</i> right justified
* and padded with <i>padstr</i>; otherwise, returns <i>str</i>.
- *
+ *
* "hello".rjust(4) #=> "hello"
* "hello".rjust(20) #=> " hello"
* "hello".rjust(20, '1234') #=> "123412341234123hello"
*/
static VALUE
-rb_str_rjust(int argc, VALUE *argv, VALUE str)
+rb_str_rjust(argc, argv, str)
+ int argc;
+ VALUE *argv;
+ VALUE str;
{
return rb_str_justify(argc, argv, str, 'r');
}
@@ -6867,18 +4736,21 @@ rb_str_rjust(int argc, VALUE *argv, VALUE str)
/*
* call-seq:
* str.center(integer, padstr) => new_str
- *
+ *
* If <i>integer</i> is greater than the length of <i>str</i>, returns a new
* <code>String</code> of length <i>integer</i> with <i>str</i> centered and
* padded with <i>padstr</i>; otherwise, returns <i>str</i>.
- *
+ *
* "hello".center(4) #=> "hello"
* "hello".center(20) #=> " hello "
* "hello".center(20, '123') #=> "1231231hello12312312"
*/
static VALUE
-rb_str_center(int argc, VALUE *argv, VALUE str)
+rb_str_center(argc, argv, str)
+ int argc;
+ VALUE *argv;
+ VALUE str;
{
return rb_str_justify(argc, argv, str, 'c');
}
@@ -6886,29 +4758,28 @@ rb_str_center(int argc, VALUE *argv, VALUE str)
/*
* call-seq:
* str.partition(sep) => [head, sep, tail]
- * str.partition(regexp) => [head, match, tail]
- *
- * Searches <i>sep</i> or pattern (<i>regexp</i>) in the string
- * and returns the part before it, the match, and the part
- * after it.
- * If it is not found, returns two empty strings and <i>str</i>.
- *
+ *
+ * Searches the string for <i>sep</i> and returns the part before it,
+ * the <i>sep</i>, and the part after it. If <i>sep</i> is not
+ * found, returns <i>str</i> and two empty strings. If no argument
+ * is given, Enumerable#partition is called.
+ *
* "hello".partition("l") #=> ["he", "l", "lo"]
* "hello".partition("x") #=> ["hello", "", ""]
- * "hello".partition(/.l/) #=> ["h", "el", "lo"]
*/
static VALUE
-rb_str_partition(VALUE str, VALUE sep)
+rb_str_partition(argc, argv, str)
+ int argc;
+ VALUE *argv;
+ VALUE str;
{
+ VALUE sep;
long pos;
- int regex = Qfalse;
- if (TYPE(sep) == T_REGEXP) {
- pos = rb_reg_search(sep, str, 0, 0);
- regex = Qtrue;
- }
- else {
+ if (argc == 0) return rb_call_super(argc, argv);
+ rb_scan_args(argc, argv, "1", &sep);
+ if (TYPE(sep) != T_REGEXP) {
VALUE tmp;
tmp = rb_check_string_type(sep);
@@ -6916,49 +4787,42 @@ rb_str_partition(VALUE str, VALUE sep)
rb_raise(rb_eTypeError, "type mismatch: %s given",
rb_obj_classname(sep));
}
- sep = tmp;
- pos = rb_str_index(str, sep, 0);
+ sep = get_arg_pat(tmp);
}
+ pos = rb_reg_search(sep, str, 0, 0);
if (pos < 0) {
failed:
return rb_ary_new3(3, str, rb_str_new(0,0),rb_str_new(0,0));
}
- if (regex) {
- sep = rb_str_subpat(str, sep, INT2FIX(0));
- if (pos == 0 && RSTRING_LEN(sep) == 0) goto failed;
- }
- return rb_ary_new3(3, rb_str_subseq(str, 0, pos),
+ sep = rb_str_subpat(str, sep, 0);
+ if (pos == 0 && RSTRING(sep)->len == 0) goto failed;
+ return rb_ary_new3(3, rb_str_substr(str, 0, pos),
sep,
- rb_str_subseq(str, pos+RSTRING_LEN(sep),
- RSTRING_LEN(str)-pos-RSTRING_LEN(sep)));
+ rb_str_substr(str, pos+RSTRING(sep)->len,
+ RSTRING(str)->len-pos-RSTRING(sep)->len));
}
/*
* call-seq:
- * str.rpartition(sep) => [head, sep, tail]
- * str.rpartition(regexp) => [head, match, tail]
- *
- * Searches <i>sep</i> or pattern (<i>regexp</i>) in the string from the end
- * of the string, and returns the part before it, the match, and the part
- * after it.
- * If it is not found, returns two empty strings and <i>str</i>.
- *
+ * str.rpartition(sep) => [head, sep, tail]
+ *
+ * Searches <i>sep</i> in the string from the end of the string, and
+ * returns the part before it, the <i>sep</i>, and the part after it.
+ * If <i>sep</i> is not found, returns two empty strings and
+ * <i>str</i>.
+ *
* "hello".rpartition("l") #=> ["hel", "l", "o"]
* "hello".rpartition("x") #=> ["", "", "hello"]
- * "hello".rpartition(/.l/) #=> ["he", "ll", "o"]
*/
static VALUE
-rb_str_rpartition(VALUE str, VALUE sep)
+rb_str_rpartition(str, sep)
+ VALUE str;
+ VALUE sep;
{
- long pos = RSTRING_LEN(str);
- int regex = Qfalse;
+ long pos = RSTRING(str)->len;
- if (TYPE(sep) == T_REGEXP) {
- pos = rb_reg_search(sep, str, pos, 1);
- regex = Qtrue;
- }
- else {
+ if (TYPE(sep) != T_REGEXP) {
VALUE tmp;
tmp = rb_check_string_type(sep);
@@ -6966,48 +4830,41 @@ rb_str_rpartition(VALUE str, VALUE sep)
rb_raise(rb_eTypeError, "type mismatch: %s given",
rb_obj_classname(sep));
}
- sep = tmp;
- pos = rb_str_sublen(str, pos);
- pos = rb_str_rindex(str, sep, pos);
+ sep = get_arg_pat(tmp);
}
+ pos = rb_reg_search(sep, str, pos, 1);
if (pos < 0) {
return rb_ary_new3(3, rb_str_new(0,0),rb_str_new(0,0), str);
}
- if (regex) {
- sep = rb_reg_nth_match(0, rb_backref_get());
- }
+ sep = rb_reg_nth_match(0, rb_backref_get());
return rb_ary_new3(3, rb_str_substr(str, 0, pos),
sep,
- rb_str_substr(str,pos+str_strlen(sep,STR_ENC_GET(sep)),RSTRING_LEN(str)));
+ rb_str_substr(str, pos+RSTRING(sep)->len,
+ RSTRING(str)->len-pos-RSTRING(sep)->len));
}
/*
* call-seq:
* str.start_with?([prefix]+) => true or false
- *
- * Returns true if <i>str</i> starts with a prefix given.
- *
- * p "hello".start_with?("hell") #=> true
- *
- * # returns true if one of prefix matches.
- * p "hello".start_with?("heaven", "hell") #=> true
- * p "hello".start_with?("heaven", "paradice") #=> false
- *
- *
- *
+ *
+ * Returns true if <i>str</i> starts with the prefix given.
*/
static VALUE
-rb_str_start_with(int argc, VALUE *argv, VALUE str)
+rb_str_start_with(argc, argv, str)
+ int argc;
+ VALUE *argv;
+ VALUE str;
{
int i;
+ VALUE pat;
for (i=0; i<argc; i++) {
- VALUE tmp = rb_check_string_type(argv[i]);
- if (NIL_P(tmp)) continue;
- rb_enc_check(str, tmp);
- if (RSTRING_LEN(str) < RSTRING_LEN(tmp)) continue;
- if (memcmp(RSTRING_PTR(str), RSTRING_PTR(tmp), RSTRING_LEN(tmp)) == 0)
+ VALUE prefix = rb_check_string_type(argv[i]);
+ if (NIL_P(prefix)) continue;
+ if (RSTRING(str)->len < RSTRING(prefix)->len) continue;
+ pat = get_arg_pat(prefix);
+ if (rb_reg_search(pat, str, 0, 1) >= 0)
return Qtrue;
}
return Qfalse;
@@ -7016,35 +4873,37 @@ rb_str_start_with(int argc, VALUE *argv, VALUE str)
/*
* call-seq:
* str.end_with?([suffix]+) => true or false
- *
- * Returns true if <i>str</i> ends with a suffix given.
+ *
+ * Returns true if <i>str</i> ends with the suffix given.
*/
static VALUE
-rb_str_end_with(int argc, VALUE *argv, VALUE str)
+rb_str_end_with(argc, argv, str)
+ int argc;
+ VALUE *argv;
+ VALUE str;
{
int i;
- char *p, *s, *e;
- rb_encoding *enc;
+ long pos;
+ VALUE pat;
for (i=0; i<argc; i++) {
- VALUE tmp = rb_check_string_type(argv[i]);
- if (NIL_P(tmp)) continue;
- enc = rb_enc_check(str, tmp);
- if (RSTRING_LEN(str) < RSTRING_LEN(tmp)) continue;
- p = RSTRING_PTR(str);
- e = p + RSTRING_LEN(str);
- s = e - RSTRING_LEN(tmp);
- if (rb_enc_left_char_head(p, s, e, enc) != s)
- continue;
- if (memcmp(s, RSTRING_PTR(tmp), RSTRING_LEN(tmp)) == 0)
- return Qtrue;
+ VALUE suffix = rb_check_string_type(argv[i]);
+ if (NIL_P(suffix)) continue;
+ if (RSTRING(str)->len < RSTRING(suffix)->len) continue;
+ pat = get_arg_pat(suffix);
+ pos = rb_reg_adjust_startpos(pat, str, RSTRING(str)->len - RSTRING(suffix)->len, 0);
+ if (rb_reg_search(pat, str, pos, 0) >= 0)
+ return Qtrue;
}
return Qfalse;
}
void
-rb_str_setter(VALUE val, ID id, VALUE *var)
+rb_str_setter(val, id, var)
+ VALUE val;
+ ID id;
+ VALUE *var;
{
if (!NIL_P(val) && TYPE(val) != T_STRING) {
rb_raise(rb_eTypeError, "value of %s must be String", rb_id2name(id));
@@ -7054,365 +4913,25 @@ rb_str_setter(VALUE val, ID id, VALUE *var)
/*
- * call-seq:
- * str.force_encoding(encoding) => str
- *
- * Changes the encoding to +encoding+ and returns self.
- */
-
-static VALUE
-rb_str_force_encoding(VALUE str, VALUE enc)
-{
- str_modifiable(str);
- rb_enc_associate(str, rb_to_encoding(enc));
- ENC_CODERANGE_CLEAR(str);
- return str;
-}
-
-/*
- * call-seq:
- * str.valid_encoding? => true or false
- *
- * Returns true for a string which encoded correctly.
- *
- * "\xc2\xa1".force_encoding("UTF-8").valid_encoding? => true
- * "\xc2".force_encoding("UTF-8").valid_encoding? => false
- * "\x80".force_encoding("UTF-8").valid_encoding? => false
- */
-
-static VALUE
-rb_str_valid_encoding_p(VALUE str)
-{
- int cr = rb_enc_str_coderange(str);
-
- return cr == ENC_CODERANGE_BROKEN ? Qfalse : Qtrue;
-}
-
-/*
- * call-seq:
- * str.ascii_only? => true or false
- *
- * Returns true for a string which has only ASCII characters.
- *
- * "abc".force_encoding("UTF-8").ascii_only? => true
- * "abc\u{6666}".force_encoding("UTF-8").ascii_only? => false
- */
-
-static VALUE
-rb_str_is_ascii_only_p(VALUE str)
-{
- int cr = rb_enc_str_coderange(str);
-
- return cr == ENC_CODERANGE_7BIT ? Qtrue : Qfalse;
-}
-
-/**********************************************************************
- * Document-class: Symbol
- *
- * <code>Symbol</code> objects represent names and some strings
- * inside the Ruby
- * interpreter. They are generated using the <code>:name</code> and
- * <code>:"string"</code> literals
- * syntax, and by the various <code>to_sym</code> methods. The same
- * <code>Symbol</code> object will be created for a given name or string
- * for the duration of a program's execution, regardless of the context
- * or meaning of that name. Thus if <code>Fred</code> is a constant in
- * one context, a method in another, and a class in a third, the
- * <code>Symbol</code> <code>:Fred</code> will be the same object in
- * all three contexts.
- *
- * module One
- * class Fred
- * end
- * $f1 = :Fred
- * end
- * module Two
- * Fred = 1
- * $f2 = :Fred
- * end
- * def Fred()
- * end
- * $f3 = :Fred
- * $f1.object_id #=> 2514190
- * $f2.object_id #=> 2514190
- * $f3.object_id #=> 2514190
- *
- */
-
-
-/*
- * call-seq:
- * sym == obj => true or false
- *
- * Equality---If <i>sym</i> and <i>obj</i> are exactly the same
- * symbol, returns <code>true</code>.
- */
-
-static VALUE
-sym_equal(VALUE sym1, VALUE sym2)
-{
- if (sym1 == sym2) return Qtrue;
- return Qfalse;
-}
-
-
-static int
-sym_printable(const char *s, const char *send, rb_encoding *enc)
-{
- while (s < send) {
- int n;
- int c = rb_enc_codepoint_len(s, send, &n, enc);
-
- if (!rb_enc_isprint(c, enc)) return Qfalse;
- s += n;
- }
- return Qtrue;
-}
-
-/*
- * call-seq:
- * sym.inspect => string
- *
- * Returns the representation of <i>sym</i> as a symbol literal.
- *
- * :fred.inspect #=> ":fred"
- */
-
-static VALUE
-sym_inspect(VALUE sym)
-{
- VALUE str;
- ID id = SYM2ID(sym);
- rb_encoding *enc;
-
- sym = rb_id2str(id);
- enc = STR_ENC_GET(sym);
- str = rb_enc_str_new(0, RSTRING_LEN(sym)+1, enc);
- RSTRING_PTR(str)[0] = ':';
- memcpy(RSTRING_PTR(str)+1, RSTRING_PTR(sym), RSTRING_LEN(sym));
- if (RSTRING_LEN(sym) != (long)strlen(RSTRING_PTR(sym)) ||
- !rb_enc_symname_p(RSTRING_PTR(sym), enc) ||
- !sym_printable(RSTRING_PTR(sym), RSTRING_END(sym), enc)) {
- str = rb_str_inspect(str);
- memcpy(RSTRING_PTR(str), ":\"", 2);
- }
- return str;
-}
-
-
-/*
- * call-seq:
- * sym.id2name => string
- * sym.to_s => string
- *
- * Returns the name or string corresponding to <i>sym</i>.
- *
- * :fred.id2name #=> "fred"
- */
-
-
-VALUE
-rb_sym_to_s(VALUE sym)
-{
- ID id = SYM2ID(sym);
-
- return str_new3(rb_cString, rb_id2str(id));
-}
-
-
-/*
- * call-seq:
- * sym.to_sym => sym
- * sym.intern => sym
- *
- * In general, <code>to_sym</code> returns the <code>Symbol</code> corresponding
- * to an object. As <i>sym</i> is already a symbol, <code>self</code> is returned
- * in this case.
- */
-
-static VALUE
-sym_to_sym(VALUE sym)
-{
- return sym;
-}
-
-static VALUE
-sym_call(VALUE args, VALUE sym, int argc, VALUE *argv)
-{
- VALUE obj;
-
- if (argc < 1) {
- rb_raise(rb_eArgError, "no receiver given");
- }
- obj = argv[0];
- return rb_funcall3(obj, (ID)sym, argc - 1, argv + 1);
-}
-
-/*
- * call-seq:
- * sym.to_proc
- *
- * Returns a _Proc_ object which respond to the given method by _sym_.
- *
- * (1..3).collect(&:to_s) #=> ["1", "2", "3"]
- */
-
-static VALUE
-sym_to_proc(VALUE sym)
-{
- static VALUE sym_proc_cache = Qfalse;
- enum {SYM_PROC_CACHE_SIZE = 67};
- VALUE proc;
- long id, index;
- VALUE *aryp;
-
- if (!sym_proc_cache) {
- sym_proc_cache = rb_ary_tmp_new(SYM_PROC_CACHE_SIZE * 2);
- rb_gc_register_mark_object(sym_proc_cache);
- rb_ary_store(sym_proc_cache, SYM_PROC_CACHE_SIZE*2 - 1, Qnil);
- }
-
- id = SYM2ID(sym);
- index = (id % SYM_PROC_CACHE_SIZE) << 1;
-
- aryp = RARRAY_PTR(sym_proc_cache);
- if (aryp[index] == sym) {
- return aryp[index + 1];
- }
- else {
- proc = rb_proc_new(sym_call, (VALUE)id);
- aryp[index] = sym;
- aryp[index + 1] = proc;
- return proc;
- }
-}
-
-static VALUE
-sym_succ(VALUE sym)
-{
- return rb_str_intern(rb_str_succ(rb_sym_to_s(sym)));
-}
-
-static VALUE
-sym_cmp(VALUE sym, VALUE other)
-{
- if (!SYMBOL_P(other)) {
- return Qnil;
- }
- return rb_str_cmp_m(rb_sym_to_s(sym), rb_sym_to_s(other));
-}
-
-static VALUE
-sym_casecmp(VALUE sym, VALUE other)
-{
- if (!SYMBOL_P(other)) {
- return Qnil;
- }
- return rb_str_casecmp(rb_sym_to_s(sym), rb_sym_to_s(other));
-}
-
-static VALUE
-sym_match(VALUE sym, VALUE other)
-{
- return rb_str_match(rb_sym_to_s(sym), other);
-}
-
-static VALUE
-sym_aref(int argc, VALUE *argv, VALUE sym)
-{
- return rb_str_aref_m(argc, argv, rb_sym_to_s(sym));
-}
-
-static VALUE
-sym_length(VALUE sym)
-{
- return rb_str_length(rb_id2str(SYM2ID(sym)));
-}
-
-static VALUE
-sym_empty(VALUE sym)
-{
- return rb_str_empty(rb_id2str(SYM2ID(sym)));
-}
-
-static VALUE
-sym_upcase(VALUE sym)
-{
- return rb_str_intern(rb_str_upcase(rb_id2str(SYM2ID(sym))));
-}
-
-static VALUE
-sym_downcase(VALUE sym)
-{
- return rb_str_intern(rb_str_downcase(rb_id2str(SYM2ID(sym))));
-}
-
-static VALUE
-sym_capitalize(VALUE sym)
-{
- return rb_str_intern(rb_str_capitalize(rb_id2str(SYM2ID(sym))));
-}
-
-static VALUE
-sym_swapcase(VALUE sym)
-{
- return rb_str_intern(rb_str_swapcase(rb_id2str(SYM2ID(sym))));
-}
-
-static VALUE
-sym_encoding(VALUE sym)
-{
- return rb_obj_encoding(rb_id2str(SYM2ID(sym)));
-}
-
-ID
-rb_to_id(VALUE name)
-{
- VALUE tmp;
- ID id;
-
- switch (TYPE(name)) {
- default:
- tmp = rb_check_string_type(name);
- if (NIL_P(tmp)) {
- tmp = rb_inspect(name);
- rb_raise(rb_eTypeError, "%s is not a symbol",
- RSTRING_PTR(tmp));
- }
- name = tmp;
- /* fall through */
- case T_STRING:
- name = rb_str_intern(name);
- /* fall through */
- case T_SYMBOL:
- return SYM2ID(name);
- }
- return id;
-}
-
-/*
* A <code>String</code> object holds and manipulates an arbitrary sequence of
* bytes, typically representing characters. String objects may be created
* using <code>String::new</code> or as literals.
- *
+ *
* Because of aliasing issues, users of strings should be aware of the methods
* that modify the contents of a <code>String</code> object. Typically,
* methods with names ending in ``!'' modify their receiver, while those
* without a ``!'' return a new <code>String</code>. However, there are
* exceptions, such as <code>String#[]=</code>.
- *
+ *
*/
void
-Init_String(void)
+Init_String()
{
-#undef rb_intern
-#define rb_intern(str) rb_intern_const(str)
-
rb_cString = rb_define_class("String", rb_cObject);
rb_include_module(rb_cString, rb_mComparable);
- rb_define_alloc_func(rb_cString, str_alloc);
- rb_define_singleton_method(rb_cString, "try_convert", rb_str_s_try_convert, 1);
+ rb_include_module(rb_cString, rb_mEnumerable);
+ rb_define_alloc_func(rb_cString, rb_str_s_alloc);
rb_define_method(rb_cString, "initialize", rb_str_init, -1);
rb_define_method(rb_cString, "initialize_copy", rb_str_replace, 1);
rb_define_method(rb_cString, "<=>", rb_str_cmp_m, 1);
@@ -7428,22 +4947,18 @@ Init_String(void)
rb_define_method(rb_cString, "insert", rb_str_insert, 2);
rb_define_method(rb_cString, "length", rb_str_length, 0);
rb_define_method(rb_cString, "size", rb_str_length, 0);
- rb_define_method(rb_cString, "bytesize", rb_str_bytesize, 0);
+ rb_define_method(rb_cString, "bytesize", rb_str_length, 0);
rb_define_method(rb_cString, "empty?", rb_str_empty, 0);
rb_define_method(rb_cString, "=~", rb_str_match, 1);
- rb_define_method(rb_cString, "match", rb_str_match_m, -1);
+ rb_define_method(rb_cString, "match", rb_str_match_m, 1);
rb_define_method(rb_cString, "succ", rb_str_succ, 0);
rb_define_method(rb_cString, "succ!", rb_str_succ_bang, 0);
rb_define_method(rb_cString, "next", rb_str_succ, 0);
rb_define_method(rb_cString, "next!", rb_str_succ_bang, 0);
- rb_define_method(rb_cString, "upto", rb_str_upto, -1);
+ rb_define_method(rb_cString, "upto", rb_str_upto_m, -1);
rb_define_method(rb_cString, "index", rb_str_index_m, -1);
rb_define_method(rb_cString, "rindex", rb_str_rindex_m, -1);
rb_define_method(rb_cString, "replace", rb_str_replace, 1);
- rb_define_method(rb_cString, "clear", rb_str_clear, 0);
- rb_define_method(rb_cString, "chr", rb_str_chr, 0);
- rb_define_method(rb_cString, "getbyte", rb_str_getbyte, 1);
- rb_define_method(rb_cString, "setbyte", rb_str_setbyte, 2);
rb_define_method(rb_cString, "to_i", rb_str_to_i, -1);
rb_define_method(rb_cString, "to_f", rb_str_to_f, 0);
@@ -7465,10 +4980,6 @@ Init_String(void)
rb_define_method(rb_cString, "hex", rb_str_hex, 0);
rb_define_method(rb_cString, "oct", rb_str_oct, 0);
rb_define_method(rb_cString, "split", rb_str_split_m, -1);
- rb_define_method(rb_cString, "lines", rb_str_each_line, -1);
- rb_define_method(rb_cString, "bytes", rb_str_each_byte, 0);
- rb_define_method(rb_cString, "chars", rb_str_each_char, 0);
- rb_define_method(rb_cString, "codepoints", rb_str_each_codepoint, 0);
rb_define_method(rb_cString, "reverse", rb_str_reverse, 0);
rb_define_method(rb_cString, "reverse!", rb_str_reverse_bang, 0);
rb_define_method(rb_cString, "concat", rb_str_concat, 1);
@@ -7476,7 +4987,6 @@ Init_String(void)
rb_define_method(rb_cString, "crypt", rb_str_crypt, 1);
rb_define_method(rb_cString, "intern", rb_str_intern, 0);
rb_define_method(rb_cString, "to_sym", rb_str_intern, 0);
- rb_define_method(rb_cString, "ord", rb_str_ord, 0);
rb_define_method(rb_cString, "include?", rb_str_include, 1);
rb_define_method(rb_cString, "start_with?", rb_str_start_with, -1);
@@ -7516,60 +5026,40 @@ Init_String(void)
rb_define_method(rb_cString, "squeeze!", rb_str_squeeze_bang, -1);
rb_define_method(rb_cString, "each_line", rb_str_each_line, -1);
+ rb_define_method(rb_cString, "each", rb_str_each_line, -1);
rb_define_method(rb_cString, "each_byte", rb_str_each_byte, 0);
rb_define_method(rb_cString, "each_char", rb_str_each_char, 0);
- rb_define_method(rb_cString, "each_codepoint", rb_str_each_codepoint, 0);
+
+ rb_define_method(rb_cString, "lines", rb_str_each_line, -1);
+ rb_define_method(rb_cString, "bytes", rb_str_each_byte, 0);
+ rb_define_method(rb_cString, "chars", rb_str_each_char, 0);
rb_define_method(rb_cString, "sum", rb_str_sum, -1);
+ rb_define_global_function("sub", rb_f_sub, -1);
+ rb_define_global_function("gsub", rb_f_gsub, -1);
+
+ rb_define_global_function("sub!", rb_f_sub_bang, -1);
+ rb_define_global_function("gsub!", rb_f_gsub_bang, -1);
+
+ rb_define_global_function("chop", rb_f_chop, 0);
+ rb_define_global_function("chop!", rb_f_chop_bang, 0);
+
+ rb_define_global_function("chomp", rb_f_chomp, -1);
+ rb_define_global_function("chomp!", rb_f_chomp_bang, -1);
+
+ rb_define_global_function("split", rb_f_split, -1);
+ rb_define_global_function("scan", rb_f_scan, 1);
+
rb_define_method(rb_cString, "slice", rb_str_aref_m, -1);
rb_define_method(rb_cString, "slice!", rb_str_slice_bang, -1);
- rb_define_method(rb_cString, "partition", rb_str_partition, 1);
+ rb_define_method(rb_cString, "partition", rb_str_partition, -1);
rb_define_method(rb_cString, "rpartition", rb_str_rpartition, 1);
- rb_define_method(rb_cString, "encoding", rb_obj_encoding, 0); /* in encoding.c */
- rb_define_method(rb_cString, "force_encoding", rb_str_force_encoding, 1);
- rb_define_method(rb_cString, "valid_encoding?", rb_str_valid_encoding_p, 0);
- rb_define_method(rb_cString, "ascii_only?", rb_str_is_ascii_only_p, 0);
-
id_to_s = rb_intern("to_s");
rb_fs = Qnil;
rb_define_variable("$;", &rb_fs);
rb_define_variable("$-F", &rb_fs);
-
- rb_cSymbol = rb_define_class("Symbol", rb_cObject);
- rb_include_module(rb_cSymbol, rb_mComparable);
- rb_undef_alloc_func(rb_cSymbol);
- rb_undef_method(CLASS_OF(rb_cSymbol), "new");
- rb_define_singleton_method(rb_cSymbol, "all_symbols", rb_sym_all_symbols, 0); /* in parse.y */
-
- rb_define_method(rb_cSymbol, "==", sym_equal, 1);
- rb_define_method(rb_cSymbol, "inspect", sym_inspect, 0);
- rb_define_method(rb_cSymbol, "to_s", rb_sym_to_s, 0);
- rb_define_method(rb_cSymbol, "id2name", rb_sym_to_s, 0);
- rb_define_method(rb_cSymbol, "intern", sym_to_sym, 0);
- rb_define_method(rb_cSymbol, "to_sym", sym_to_sym, 0);
- rb_define_method(rb_cSymbol, "to_proc", sym_to_proc, 0);
- rb_define_method(rb_cSymbol, "succ", sym_succ, 0);
- rb_define_method(rb_cSymbol, "next", sym_succ, 0);
-
- rb_define_method(rb_cSymbol, "<=>", sym_cmp, 1);
- rb_define_method(rb_cSymbol, "casecmp", sym_casecmp, 1);
- rb_define_method(rb_cSymbol, "=~", sym_match, 1);
-
- rb_define_method(rb_cSymbol, "[]", sym_aref, -1);
- rb_define_method(rb_cSymbol, "slice", sym_aref, -1);
- rb_define_method(rb_cSymbol, "length", sym_length, 0);
- rb_define_method(rb_cSymbol, "size", sym_length, 0);
- rb_define_method(rb_cSymbol, "empty?", sym_empty, 0);
- rb_define_method(rb_cSymbol, "match", sym_match, 1);
-
- rb_define_method(rb_cSymbol, "upcase", sym_upcase, 0);
- rb_define_method(rb_cSymbol, "downcase", sym_downcase, 0);
- rb_define_method(rb_cSymbol, "capitalize", sym_capitalize, 0);
- rb_define_method(rb_cSymbol, "swapcase", sym_swapcase, 0);
-
- rb_define_method(rb_cSymbol, "encoding", sym_encoding, 0);
}
diff --git a/struct.c b/struct.c
index e4b6da0e76..9417c1c347 100644
--- a/struct.c
+++ b/struct.c
@@ -3,41 +3,42 @@
struct.c -
$Author$
+ $Date$
created at: Tue Mar 22 18:44:30 JST 1995
- Copyright (C) 1993-2007 Yukihiro Matsumoto
+ Copyright (C) 1993-2003 Yukihiro Matsumoto
**********************************************************************/
-#include "ruby/ruby.h"
+#include "ruby.h"
+#include "env.h"
VALUE rb_cStruct;
-static ID id_members;
-static VALUE struct_alloc(VALUE);
+static VALUE struct_alloc _((VALUE));
-static inline VALUE
-struct_ivar_get(VALUE c, ID id)
+VALUE
+rb_struct_iv_get(c, name)
+ VALUE c;
+ const char *name;
{
+ ID id;
+
+ id = rb_intern(name);
for (;;) {
if (rb_ivar_defined(c, id))
return rb_ivar_get(c, id);
- c = RCLASS_SUPER(c);
+ c = RCLASS(c)->super;
if (c == 0 || c == rb_cStruct)
return Qnil;
}
}
VALUE
-rb_struct_iv_get(VALUE c, const char *name)
-{
- return struct_ivar_get(c, rb_intern(name));
-}
-
-VALUE
-rb_struct_s_members(VALUE klass)
+rb_struct_s_members(klass)
+ VALUE klass;
{
- VALUE members = struct_ivar_get(klass, id_members);
+ VALUE members = rb_struct_iv_get(klass, "__members__");
if (NIL_P(members)) {
rb_raise(rb_eTypeError, "uninitialized struct");
@@ -49,28 +50,30 @@ rb_struct_s_members(VALUE klass)
}
VALUE
-rb_struct_members(VALUE s)
+rb_struct_members(s)
+ VALUE s;
{
VALUE members = rb_struct_s_members(rb_obj_class(s));
- if (RSTRUCT_LEN(s) != RARRAY_LEN(members)) {
- rb_raise(rb_eTypeError, "struct size differs (%ld required %ld given)",
- RARRAY_LEN(members), RSTRUCT_LEN(s));
+ if (RSTRUCT(s)->len != RARRAY(members)->len) {
+ rb_raise(rb_eTypeError, "struct size differs (%d required %d given)",
+ RARRAY(members)->len, RSTRUCT(s)->len);
}
return members;
}
static VALUE
-rb_struct_s_members_m(VALUE klass)
+rb_struct_s_members_m(klass)
+ VALUE klass;
{
VALUE members, ary;
VALUE *p, *pend;
members = rb_struct_s_members(klass);
- ary = rb_ary_new2(RARRAY_LEN(members));
- p = RARRAY_PTR(members); pend = p + RARRAY_LEN(members);
+ ary = rb_ary_new2(RARRAY(members)->len);
+ p = RARRAY(members)->ptr; pend = p + RARRAY(members)->len;
while (p < pend) {
- rb_ary_push(ary, *p);
+ rb_ary_push(ary, rb_str_new2(rb_id2name(SYM2ID(*p))));
p++;
}
@@ -80,32 +83,35 @@ rb_struct_s_members_m(VALUE klass)
/*
* call-seq:
* struct.members => array
- *
+ *
* Returns an array of strings representing the names of the instance
* variables.
- *
+ *
* Customer = Struct.new(:name, :address, :zip)
* joe = Customer.new("Joe Smith", "123 Maple, Anytown NC", 12345)
- * joe.members #=> [:name, :address, :zip]
+ * joe.members #=> ["name", "address", "zip"]
*/
static VALUE
-rb_struct_members_m(VALUE obj)
+rb_struct_members_m(obj)
+ VALUE obj;
{
return rb_struct_s_members_m(rb_obj_class(obj));
}
VALUE
-rb_struct_getmember(VALUE obj, ID id)
+rb_struct_getmember(obj, id)
+ VALUE obj;
+ ID id;
{
VALUE members, slot;
long i;
members = rb_struct_members(obj);
slot = ID2SYM(id);
- for (i=0; i<RARRAY_LEN(members); i++) {
- if (RARRAY_PTR(members)[i] == slot) {
- return RSTRUCT_PTR(obj)[i];
+ for (i=0; i<RARRAY(members)->len; i++) {
+ if (RARRAY(members)->ptr[i] == slot) {
+ return RSTRUCT(obj)->ptr[i];
}
}
rb_name_error(id, "%s is not struct member", rb_id2name(id));
@@ -113,26 +119,24 @@ rb_struct_getmember(VALUE obj, ID id)
}
static VALUE
-rb_struct_ref(VALUE obj)
+rb_struct_ref(obj)
+ VALUE obj;
{
- return rb_struct_getmember(obj, rb_frame_this_func());
+ return rb_struct_getmember(obj, ruby_frame->orig_func);
}
-static VALUE rb_struct_ref0(VALUE obj) {return RSTRUCT_PTR(obj)[0];}
-static VALUE rb_struct_ref1(VALUE obj) {return RSTRUCT_PTR(obj)[1];}
-static VALUE rb_struct_ref2(VALUE obj) {return RSTRUCT_PTR(obj)[2];}
-static VALUE rb_struct_ref3(VALUE obj) {return RSTRUCT_PTR(obj)[3];}
-static VALUE rb_struct_ref4(VALUE obj) {return RSTRUCT_PTR(obj)[4];}
-static VALUE rb_struct_ref5(VALUE obj) {return RSTRUCT_PTR(obj)[5];}
-static VALUE rb_struct_ref6(VALUE obj) {return RSTRUCT_PTR(obj)[6];}
-static VALUE rb_struct_ref7(VALUE obj) {return RSTRUCT_PTR(obj)[7];}
-static VALUE rb_struct_ref8(VALUE obj) {return RSTRUCT_PTR(obj)[8];}
-static VALUE rb_struct_ref9(VALUE obj) {return RSTRUCT_PTR(obj)[9];}
-
-#define numberof(array) (int)(sizeof(array) / sizeof((array)[0]))
-#define N_REF_FUNC numberof(ref_func)
+static VALUE rb_struct_ref0(obj) VALUE obj; {return RSTRUCT(obj)->ptr[0];}
+static VALUE rb_struct_ref1(obj) VALUE obj; {return RSTRUCT(obj)->ptr[1];}
+static VALUE rb_struct_ref2(obj) VALUE obj; {return RSTRUCT(obj)->ptr[2];}
+static VALUE rb_struct_ref3(obj) VALUE obj; {return RSTRUCT(obj)->ptr[3];}
+static VALUE rb_struct_ref4(obj) VALUE obj; {return RSTRUCT(obj)->ptr[4];}
+static VALUE rb_struct_ref5(obj) VALUE obj; {return RSTRUCT(obj)->ptr[5];}
+static VALUE rb_struct_ref6(obj) VALUE obj; {return RSTRUCT(obj)->ptr[6];}
+static VALUE rb_struct_ref7(obj) VALUE obj; {return RSTRUCT(obj)->ptr[7];}
+static VALUE rb_struct_ref8(obj) VALUE obj; {return RSTRUCT(obj)->ptr[8];}
+static VALUE rb_struct_ref9(obj) VALUE obj; {return RSTRUCT(obj)->ptr[9];}
-static VALUE (*const ref_func[])(VALUE) = {
+static VALUE (*ref_func[10])() = {
rb_struct_ref0,
rb_struct_ref1,
rb_struct_ref2,
@@ -146,34 +150,39 @@ static VALUE (*const ref_func[])(VALUE) = {
};
static void
-rb_struct_modify(VALUE s)
+rb_struct_modify(s)
+ VALUE s;
{
if (OBJ_FROZEN(s)) rb_error_frozen("Struct");
- if (!OBJ_UNTRUSTED(s) && rb_safe_level() >= 4)
+ if (!OBJ_TAINTED(s) && rb_safe_level() >= 4)
rb_raise(rb_eSecurityError, "Insecure: can't modify Struct");
}
static VALUE
-rb_struct_set(VALUE obj, VALUE val)
+rb_struct_set(obj, val)
+ VALUE obj, val;
{
VALUE members, slot;
+ ID id;
long i;
members = rb_struct_members(obj);
rb_struct_modify(obj);
- for (i=0; i<RARRAY_LEN(members); i++) {
- slot = RARRAY_PTR(members)[i];
- if (rb_id_attrset(SYM2ID(slot)) == rb_frame_this_func()) {
- return RSTRUCT_PTR(obj)[i] = val;
+ id = ruby_frame->orig_func;
+ for (i=0; i<RARRAY(members)->len; i++) {
+ slot = RARRAY(members)->ptr[i];
+ if (rb_id_attrset(SYM2ID(slot)) == id) {
+ return RSTRUCT(obj)->ptr[i] = val;
}
}
- rb_name_error(rb_frame_this_func(), "`%s' is not a struct member",
- rb_id2name(rb_frame_this_func()));
+ rb_name_error(ruby_frame->last_func, "`%s' is not a struct member",
+ rb_id2name(id));
return Qnil; /* not reached */
}
static VALUE
-make_struct(VALUE name, VALUE members, VALUE klass)
+make_struct(name, members, klass)
+ VALUE name, members, klass;
{
VALUE nstr;
ID id;
@@ -186,28 +195,28 @@ make_struct(VALUE name, VALUE members, VALUE klass)
rb_class_inherited(klass, nstr);
}
else {
- /* old style: should we warn? */
- name = rb_str_to_str(name);
- id = rb_to_id(name);
+ char *cname = StringValuePtr(name);
+ id = rb_intern(cname);
if (!rb_is_const_id(id)) {
- rb_name_error(id, "identifier %s needs to be constant", StringValuePtr(name));
+ rb_name_error(id, "identifier %s needs to be constant", cname);
}
if (rb_const_defined_at(klass, id)) {
- rb_warn("redefining constant Struct::%s", StringValuePtr(name));
+ rb_warn("redefining constant Struct::%s", cname);
rb_mod_remove_const(klass, ID2SYM(id));
}
nstr = rb_define_class_under(klass, rb_id2name(id), klass);
}
- rb_ivar_set(nstr, id_members, members);
+ rb_iv_set(nstr, "__size__", LONG2NUM(RARRAY(members)->len));
+ rb_iv_set(nstr, "__members__", members);
rb_define_alloc_func(nstr, struct_alloc);
rb_define_singleton_method(nstr, "new", rb_class_new_instance, -1);
rb_define_singleton_method(nstr, "[]", rb_class_new_instance, -1);
rb_define_singleton_method(nstr, "members", rb_struct_s_members_m, 0);
- for (i=0; i< RARRAY_LEN(members); i++) {
- ID id = SYM2ID(RARRAY_PTR(members)[i]);
+ for (i=0; i< RARRAY(members)->len; i++) {
+ ID id = SYM2ID(RARRAY(members)->ptr[i]);
if (rb_is_local_id(id) || rb_is_const_id(id)) {
- if (i < N_REF_FUNC) {
+ if (i<10) {
rb_define_method_id(nstr, id, ref_func[i], 0);
}
else {
@@ -220,51 +229,22 @@ make_struct(VALUE name, VALUE members, VALUE klass)
return nstr;
}
-VALUE
-rb_struct_alloc_noinit(VALUE klass)
-{
- return struct_alloc(klass);
-}
-
-VALUE
-rb_struct_define_without_accessor(const char *class_name, VALUE super, rb_alloc_func_t alloc, ...)
-{
- VALUE klass;
- va_list ar;
- VALUE members;
- long i;
- char *name;
-
- members = rb_ary_new2(0);
- va_start(ar, alloc);
- i = 0;
- while ((name = va_arg(ar, char*)) != NULL) {
- rb_ary_push(members, ID2SYM(rb_intern(name)));
- }
- va_end(ar);
- OBJ_FREEZE(members);
-
- if (class_name) {
- klass = rb_define_class(class_name, super);
- }
- else {
- klass = rb_class_new(super);
- rb_make_metaclass(klass, RBASIC(super)->klass);
- rb_class_inherited(super, klass);
- }
-
- rb_ivar_set(klass, id_members, members);
-
- if (alloc)
- rb_define_alloc_func(klass, alloc);
- else
- rb_define_alloc_func(klass, struct_alloc);
-
- return klass;
-}
+#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
VALUE
+#ifdef HAVE_STDARG_PROTOTYPES
rb_struct_define(const char *name, ...)
+#else
+rb_struct_define(name, va_alist)
+ const char *name;
+ va_dcl
+#endif
{
va_list ar;
VALUE nm, ary;
@@ -274,7 +254,7 @@ rb_struct_define(const char *name, ...)
else nm = rb_str_new2(name);
ary = rb_ary_new();
- va_start(ar, name);
+ va_init_list(ar, name);
while ((mem = va_arg(ar, char*)) != 0) {
ID slot = rb_intern(mem);
rb_ary_push(ary, ID2SYM(slot));
@@ -298,28 +278,31 @@ rb_struct_define(const char *name, ...)
* <code>Struct</code>s in the system and should start with a capital
* letter. Assigning a structure class to a constant effectively gives
* the class the name of the constant.
- *
+ *
* <code>Struct::new</code> returns a new <code>Class</code> object,
* which can then be used to create specific instances of the new
* structure. The number of actual parameters must be
* less than or equal to the number of attributes defined for this
- * class; unset parameters default to <code>nil</code>. Passing too many
- * parameters will raise an <code>ArgumentError</code>.
+ * class; unset parameters default to \nil{}. Passing too many
+ * parameters will raise an \E{ArgumentError}.
*
* The remaining methods listed in this section (class and instance)
- * are defined for this generated class.
- *
+ * are defined for this generated class.
+ *
* # Create a structure with a name in Struct
* Struct.new("Customer", :name, :address) #=> Struct::Customer
- * Struct::Customer.new("Dave", "123 Main") #=> #<struct Struct::Customer name="Dave", address="123 Main">
- *
+ * Struct::Customer.new("Dave", "123 Main") #=> #<Struct::Customer name="Dave", address="123 Main">
+ *
* # Create a structure named by its constant
* Customer = Struct.new(:name, :address) #=> Customer
- * Customer.new("Dave", "123 Main") #=> #<struct Customer name="Dave", address="123 Main">
+ * Customer.new("Dave", "123 Main") #=> #<Customer name="Dave", address="123 Main">
*/
static VALUE
-rb_struct_s_def(int argc, VALUE *argv, VALUE klass)
+rb_struct_s_def(argc, argv, klass)
+ int argc;
+ VALUE *argv;
+ VALUE klass;
{
VALUE name, rest;
long i;
@@ -331,9 +314,9 @@ rb_struct_s_def(int argc, VALUE *argv, VALUE klass)
rb_ary_unshift(rest, name);
name = Qnil;
}
- for (i=0; i<RARRAY_LEN(rest); i++) {
- id = rb_to_id(RARRAY_PTR(rest)[i]);
- RARRAY_PTR(rest)[i] = ID2SYM(id);
+ for (i=0; i<RARRAY(rest)->len; i++) {
+ id = rb_to_id(RARRAY(rest)->ptr[i]);
+ RARRAY(rest)->ptr[i] = ID2SYM(id);
}
st = make_struct(name, rest, klass);
if (rb_block_given_p()) {
@@ -343,86 +326,74 @@ rb_struct_s_def(int argc, VALUE *argv, VALUE klass)
return st;
}
-static long
-num_members(VALUE klass)
-{
- VALUE members;
- members = struct_ivar_get(klass, id_members);
- if (TYPE(members) != T_ARRAY) {
- rb_raise(rb_eTypeError, "broken members");
- }
- return RARRAY_LEN(members);
-}
-
/*
*/
static VALUE
-rb_struct_initialize_m(int argc, VALUE *argv, VALUE self)
+rb_struct_initialize(self, values)
+ VALUE self, values;
{
VALUE klass = rb_obj_class(self);
+ VALUE size;
long n;
rb_struct_modify(self);
- n = num_members(klass);
- if (n < argc) {
+ size = rb_struct_iv_get(klass, "__size__");
+ n = FIX2LONG(size);
+ if (n < RARRAY(values)->len) {
rb_raise(rb_eArgError, "struct size differs");
}
- MEMCPY(RSTRUCT_PTR(self), argv, VALUE, argc);
- if (n > argc) {
- rb_mem_clear(RSTRUCT_PTR(self)+argc, n-argc);
+ MEMCPY(RSTRUCT(self)->ptr, RARRAY(values)->ptr, VALUE, RARRAY(values)->len);
+ if (n > RARRAY(values)->len) {
+ rb_mem_clear(RSTRUCT(self)->ptr+RARRAY(values)->len,
+ n-RARRAY(values)->len);
}
return Qnil;
}
-VALUE
-rb_struct_initialize(VALUE self, VALUE values)
-{
- return rb_struct_initialize_m(RARRAY_LENINT(values), RARRAY_PTR(values), self);
-}
-
static VALUE
-struct_alloc(VALUE klass)
+struct_alloc(klass)
+ VALUE klass;
{
+ VALUE size;
long n;
NEWOBJ(st, struct RStruct);
OBJSETUP(st, klass, T_STRUCT);
- n = num_members(klass);
+ size = rb_struct_iv_get(klass, "__size__");
+ n = FIX2LONG(size);
- if (0 < n && n <= RSTRUCT_EMBED_LEN_MAX) {
- RBASIC(st)->flags &= ~RSTRUCT_EMBED_LEN_MASK;
- RBASIC(st)->flags |= n << RSTRUCT_EMBED_LEN_SHIFT;
- rb_mem_clear(st->as.ary, n);
- }
- else {
- st->as.heap.ptr = ALLOC_N(VALUE, n);
- rb_mem_clear(st->as.heap.ptr, n);
- st->as.heap.len = n;
- }
+ st->ptr = ALLOC_N(VALUE, n);
+ rb_mem_clear(st->ptr, n);
+ st->len = n;
return (VALUE)st;
}
VALUE
-rb_struct_alloc(VALUE klass, VALUE values)
+rb_struct_alloc(klass, values)
+ VALUE klass, values;
{
- return rb_class_new_instance(RARRAY_LEN(values), RARRAY_PTR(values), klass);
+ return rb_class_new_instance(RARRAY(values)->len, RARRAY(values)->ptr, klass);
}
VALUE
+#ifdef HAVE_STDARG_PROTOTYPES
rb_struct_new(VALUE klass, ...)
+#else
+rb_struct_new(klass, va_alist)
+ VALUE klass;
+ va_dcl
+#endif
{
- VALUE tmpargs[N_REF_FUNC], *mem = tmpargs;
- int size, i;
+ VALUE sz, *mem;
+ long size, i;
va_list args;
- size = rb_long2int(num_members(klass));
- if (size > numberof(tmpargs)) {
- tmpargs[0] = rb_ary_tmp_new(size);
- mem = RARRAY_PTR(tmpargs[0]);
- }
- va_start(args, klass);
+ sz = rb_struct_iv_get(klass, "__size__");
+ size = FIX2LONG(sz);
+ mem = ALLOCA_N(VALUE, size);
+ va_init_list(args, klass);
for (i=0; i<size; i++) {
mem[i] = va_arg(args, VALUE);
}
@@ -434,29 +405,30 @@ rb_struct_new(VALUE klass, ...)
/*
* call-seq:
* struct.each {|obj| block } => struct
- *
+ *
* Calls <i>block</i> once for each instance variable, passing the
* value as a parameter.
- *
+ *
* Customer = Struct.new(:name, :address, :zip)
* joe = Customer.new("Joe Smith", "123 Maple, Anytown NC", 12345)
* joe.each {|x| puts(x) }
- *
+ *
* <em>produces:</em>
- *
+ *
* Joe Smith
* 123 Maple, Anytown NC
* 12345
*/
static VALUE
-rb_struct_each(VALUE s)
+rb_struct_each(s)
+ VALUE s;
{
long i;
RETURN_ENUMERATOR(s, 0, 0);
- for (i=0; i<RSTRUCT_LEN(s); i++) {
- rb_yield(RSTRUCT_PTR(s)[i]);
+ for (i=0; i<RSTRUCT(s)->len; i++) {
+ rb_yield(RSTRUCT(s)->ptr[i]);
}
return s;
}
@@ -464,70 +436,67 @@ rb_struct_each(VALUE s)
/*
* call-seq:
* struct.each_pair {|sym, obj| block } => struct
- *
+ *
* Calls <i>block</i> once for each instance variable, passing the name
* (as a symbol) and the value as parameters.
- *
+ *
* Customer = Struct.new(:name, :address, :zip)
* joe = Customer.new("Joe Smith", "123 Maple, Anytown NC", 12345)
* joe.each_pair {|name, value| puts("#{name} => #{value}") }
- *
+ *
* <em>produces:</em>
- *
+ *
* name => Joe Smith
* address => 123 Maple, Anytown NC
* zip => 12345
*/
static VALUE
-rb_struct_each_pair(VALUE s)
+rb_struct_each_pair(s)
+ VALUE s;
{
VALUE members;
long i;
RETURN_ENUMERATOR(s, 0, 0);
members = rb_struct_members(s);
- for (i=0; i<RSTRUCT_LEN(s); i++) {
- rb_yield_values(2, rb_ary_entry(members, i), RSTRUCT_PTR(s)[i]);
+ for (i=0; i<RSTRUCT(s)->len; i++) {
+ rb_yield_values(2, rb_ary_entry(members, i), RSTRUCT(s)->ptr[i]);
}
return s;
}
static VALUE
-inspect_struct(VALUE s, VALUE dummy, int recur)
+inspect_struct(s)
+ VALUE s;
{
const char *cname = rb_class2name(rb_obj_class(s));
VALUE str, members;
long i;
- if (recur) {
- return rb_sprintf("#<struct %s:...>", cname);
- }
-
members = rb_struct_members(s);
- if (cname[0] == '#') {
- str = rb_str_new2("#<struct ");
- }
- else {
- str = rb_sprintf("#<struct %s ", cname);
- }
- for (i=0; i<RSTRUCT_LEN(s); i++) {
+ str = rb_str_buf_new2("#<struct ");
+ rb_str_cat2(str, cname);
+ rb_str_cat2(str, " ");
+ for (i=0; i<RSTRUCT(s)->len; i++) {
VALUE slot;
ID id;
+ const char *p;
if (i > 0) {
rb_str_cat2(str, ", ");
}
- slot = RARRAY_PTR(members)[i];
+ slot = RARRAY(members)->ptr[i];
id = SYM2ID(slot);
if (rb_is_local_id(id) || rb_is_const_id(id)) {
- rb_str_append(str, rb_id2str(id));
+ p = rb_id2name(id);
+ rb_str_cat2(str, p);
}
else {
rb_str_append(str, rb_inspect(slot));
}
rb_str_cat2(str, "=");
- rb_str_append(str, rb_inspect(RSTRUCT_PTR(s)[i]));
+ rb_str_append(str, rb_inspect(RSTRUCT(s)->ptr[i]));
}
rb_str_cat2(str, ">");
OBJ_INFECT(str, s);
@@ -544,57 +513,71 @@ inspect_struct(VALUE s, VALUE dummy, int recur)
*/
static VALUE
-rb_struct_inspect(VALUE s)
+rb_struct_inspect(s)
+ VALUE s;
{
- return rb_exec_recursive(inspect_struct, s, 0);
+ if (rb_inspecting_p(s)) {
+ const char *cname = rb_class2name(rb_obj_class(s));
+ size_t len = strlen(cname) + 14;
+ VALUE str = rb_str_new(0, len);
+
+ snprintf(RSTRING(str)->ptr, len+1, "#<struct %s:...>", cname);
+ RSTRING(str)->len = strlen(RSTRING(str)->ptr);
+ return str;
+ }
+ return rb_protect_inspect(inspect_struct, s, 0);
}
/*
* call-seq:
* struct.to_a => array
* struct.values => array
- *
+ *
* Returns the values for this instance as an array.
- *
+ *
* Customer = Struct.new(:name, :address, :zip)
* joe = Customer.new("Joe Smith", "123 Maple, Anytown NC", 12345)
* joe.to_a[1] #=> "123 Maple, Anytown NC"
*/
static VALUE
-rb_struct_to_a(VALUE s)
+rb_struct_to_a(s)
+ VALUE s;
{
- return rb_ary_new4(RSTRUCT_LEN(s), RSTRUCT_PTR(s));
+ return rb_ary_new4(RSTRUCT(s)->len, RSTRUCT(s)->ptr);
}
/* :nodoc: */
-VALUE
-rb_struct_init_copy(VALUE copy, VALUE s)
+static VALUE
+rb_struct_init_copy(copy, s)
+ VALUE copy, s;
{
if (copy == s) return copy;
rb_check_frozen(copy);
if (!rb_obj_is_instance_of(s, rb_obj_class(copy))) {
rb_raise(rb_eTypeError, "wrong argument class");
}
- if (RSTRUCT_LEN(copy) != RSTRUCT_LEN(s)) {
+ if (RSTRUCT(copy)->len != RSTRUCT(s)->len) {
rb_raise(rb_eTypeError, "struct size mismatch");
}
- MEMCPY(RSTRUCT_PTR(copy), RSTRUCT_PTR(s), VALUE, RSTRUCT_LEN(copy));
+ MEMCPY(RSTRUCT(copy)->ptr, RSTRUCT(s)->ptr, VALUE, RSTRUCT(copy)->len);
return copy;
}
static VALUE
-rb_struct_aref_id(VALUE s, ID id)
+rb_struct_aref_id(s, id)
+ VALUE s;
+ ID id;
{
VALUE members;
long i, len;
members = rb_struct_members(s);
- len = RARRAY_LEN(members);
+ len = RARRAY(members)->len;
for (i=0; i<len; i++) {
- if (SYM2ID(RARRAY_PTR(members)[i]) == id) {
- return RSTRUCT_PTR(s)[i];
+ if (SYM2ID(RARRAY(members)->ptr[i]) == id) {
+ return RSTRUCT(s)->ptr[i];
}
}
rb_name_error(id, "no member '%s' in struct", rb_id2name(id));
@@ -604,24 +587,25 @@ rb_struct_aref_id(VALUE s, ID id)
/*
* call-seq:
* struct[symbol] => anObject
- * struct[fixnum] => anObject
- *
+ * struct[fixnum] => anObject
+ *
* Attribute Reference---Returns the value of the instance variable
* named by <i>symbol</i>, or indexed (0..length-1) by
* <i>fixnum</i>. Will raise <code>NameError</code> if the named
* variable does not exist, or <code>IndexError</code> if the index is
* out of range.
- *
+ *
* Customer = Struct.new(:name, :address, :zip)
* joe = Customer.new("Joe Smith", "123 Maple, Anytown NC", 12345)
- *
+ *
* joe["name"] #=> "Joe Smith"
* joe[:name] #=> "Joe Smith"
* joe[0] #=> "Joe Smith"
*/
VALUE
-rb_struct_aref(VALUE s, VALUE idx)
+rb_struct_aref(s, idx)
+ VALUE s, idx;
{
long i;
@@ -630,32 +614,34 @@ rb_struct_aref(VALUE s, VALUE idx)
}
i = NUM2LONG(idx);
- if (i < 0) i = RSTRUCT_LEN(s) + i;
+ if (i < 0) i = RSTRUCT(s)->len + i;
if (i < 0)
rb_raise(rb_eIndexError, "offset %ld too small for struct(size:%ld)",
- i, RSTRUCT_LEN(s));
- if (RSTRUCT_LEN(s) <= i)
+ i, RSTRUCT(s)->len);
+ if (RSTRUCT(s)->len <= i)
rb_raise(rb_eIndexError, "offset %ld too large for struct(size:%ld)",
- i, RSTRUCT_LEN(s));
- return RSTRUCT_PTR(s)[i];
+ i, RSTRUCT(s)->len);
+ return RSTRUCT(s)->ptr[i];
}
static VALUE
-rb_struct_aset_id(VALUE s, ID id, VALUE val)
+rb_struct_aset_id(s, id, val)
+ VALUE s, val;
+ ID id;
{
VALUE members;
long i, len;
members = rb_struct_members(s);
rb_struct_modify(s);
- len = RARRAY_LEN(members);
- if (RSTRUCT_LEN(s) != RARRAY_LEN(members)) {
- rb_raise(rb_eTypeError, "struct size differs (%ld required %ld given)",
- RARRAY_LEN(members), RSTRUCT_LEN(s));
+ len = RARRAY(members)->len;
+ if (RSTRUCT(s)->len != RARRAY(members)->len) {
+ rb_raise(rb_eTypeError, "struct size differs (%d required %d given)",
+ RARRAY(members)->len, RSTRUCT(s)->len);
}
for (i=0; i<len; i++) {
- if (SYM2ID(RARRAY_PTR(members)[i]) == id) {
- RSTRUCT_PTR(s)[i] = val;
+ if (SYM2ID(RARRAY(members)->ptr[i]) == id) {
+ RSTRUCT(s)->ptr[i] = val;
return val;
}
}
@@ -666,25 +652,26 @@ rb_struct_aset_id(VALUE s, ID id, VALUE val)
* call-seq:
* struct[symbol] = obj => obj
* struct[fixnum] = obj => obj
- *
+ *
* Attribute Assignment---Assigns to the instance variable named by
* <i>symbol</i> or <i>fixnum</i> the value <i>obj</i> and
* returns it. Will raise a <code>NameError</code> if the named
* variable does not exist, or an <code>IndexError</code> if the index
* is out of range.
- *
+ *
* Customer = Struct.new(:name, :address, :zip)
* joe = Customer.new("Joe Smith", "123 Maple, Anytown NC", 12345)
- *
+ *
* joe["name"] = "Luke"
* joe[:zip] = "90210"
- *
+ *
* joe.name #=> "Luke"
* joe.zip #=> "90210"
*/
VALUE
-rb_struct_aset(VALUE s, VALUE idx, VALUE val)
+rb_struct_aset(s, idx, val)
+ VALUE s, idx, val;
{
long i;
@@ -693,34 +680,37 @@ rb_struct_aset(VALUE s, VALUE idx, VALUE val)
}
i = NUM2LONG(idx);
- if (i < 0) i = RSTRUCT_LEN(s) + i;
+ if (i < 0) i = RSTRUCT(s)->len + i;
if (i < 0) {
rb_raise(rb_eIndexError, "offset %ld too small for struct(size:%ld)",
- i, RSTRUCT_LEN(s));
+ i, RSTRUCT(s)->len);
}
- if (RSTRUCT_LEN(s) <= i) {
+ if (RSTRUCT(s)->len <= i) {
rb_raise(rb_eIndexError, "offset %ld too large for struct(size:%ld)",
- i, RSTRUCT_LEN(s));
+ i, RSTRUCT(s)->len);
}
rb_struct_modify(s);
- return RSTRUCT_PTR(s)[i] = val;
+ return RSTRUCT(s)->ptr[i] = val;
}
+static VALUE struct_entry _((VALUE, long));
static VALUE
-struct_entry(VALUE s, long n)
+struct_entry(s, n)
+ VALUE s;
+ long n;
{
return rb_struct_aref(s, LONG2NUM(n));
}
-/*
+/*
* call-seq:
* struct.values_at(selector,... ) => an_array
*
* Returns an array containing the elements in
* _self_ corresponding to the given selector(s). The selectors
- * may be either integer indices or ranges.
+ * may be either integer indices or ranges.
* See also </code>.select<code>.
- *
+ *
* a = %w{ a b c d e f }
* a.values_at(1, 3, 5)
* a.values_at(1, 3, 5, 7)
@@ -729,27 +719,33 @@ struct_entry(VALUE s, long n)
*/
static VALUE
-rb_struct_values_at(int argc, VALUE *argv, VALUE s)
+rb_struct_values_at(argc, argv, s)
+ int argc;
+ VALUE *argv;
+ VALUE s;
{
- return rb_get_values_at(s, RSTRUCT_LEN(s), argc, argv, struct_entry);
+ return rb_values_at(s, RSTRUCT(s)->len, argc, argv, struct_entry);
}
/*
* call-seq:
* struct.select {|i| block } => array
- *
+ *
* Invokes the block passing in successive elements from
* <i>struct</i>, returning an array containing those elements
* for which the block returns a true value (equivalent to
* <code>Enumerable#select</code>).
- *
+ *
* Lots = Struct.new(:a, :b, :c, :d, :e, :f)
* l = Lots.new(11, 22, 33, 44, 55, 66)
* l.select {|v| (v % 2).zero? } #=> [22, 44, 66]
*/
static VALUE
-rb_struct_select(int argc, VALUE *argv, VALUE s)
+rb_struct_select(argc, argv, s)
+ int argc;
+ VALUE *argv;
+ VALUE s;
{
VALUE result;
long i;
@@ -758,9 +754,9 @@ rb_struct_select(int argc, VALUE *argv, VALUE s)
rb_raise(rb_eArgError, "wrong number of arguments (%d for 0)", argc);
}
result = rb_ary_new();
- for (i = 0; i < RSTRUCT_LEN(s); i++) {
- if (RTEST(rb_yield(RSTRUCT_PTR(s)[i]))) {
- rb_ary_push(result, RSTRUCT_PTR(s)[i]);
+ for (i = 0; i < RSTRUCT(s)->len; i++) {
+ if (RTEST(rb_yield(RSTRUCT(s)->ptr[i]))) {
+ rb_ary_push(result, RSTRUCT(s)->ptr[i]);
}
}
@@ -770,12 +766,12 @@ rb_struct_select(int argc, VALUE *argv, VALUE s)
/*
* call-seq:
* struct == other_struct => true or false
- *
+ *
* Equality---Returns <code>true</code> if <i>other_struct</i> is
* equal to this one: they must be of the same class as generated by
* <code>Struct::new</code>, and the values of all instance variables
* must be equal (according to <code>Object#==</code>).
- *
+ *
* Customer = Struct.new(:name, :address, :zip)
* joe = Customer.new("Joe Smith", "123 Maple, Anytown NC", 12345)
* joejr = Customer.new("Joe Smith", "123 Maple, Anytown NC", 12345)
@@ -785,42 +781,24 @@ rb_struct_select(int argc, VALUE *argv, VALUE s)
*/
static VALUE
-rb_struct_equal(VALUE s, VALUE s2)
+rb_struct_equal(s, s2)
+ VALUE s, s2;
{
long i;
if (s == s2) return Qtrue;
if (TYPE(s2) != T_STRUCT) return Qfalse;
if (rb_obj_class(s) != rb_obj_class(s2)) return Qfalse;
- if (RSTRUCT_LEN(s) != RSTRUCT_LEN(s2)) {
+ if (RSTRUCT(s)->len != RSTRUCT(s2)->len) {
rb_bug("inconsistent struct"); /* should never happen */
}
- for (i=0; i<RSTRUCT_LEN(s); i++) {
- if (!rb_equal(RSTRUCT_PTR(s)[i], RSTRUCT_PTR(s2)[i])) return Qfalse;
+ for (i=0; i<RSTRUCT(s)->len; i++) {
+ if (!rb_equal(RSTRUCT(s)->ptr[i], RSTRUCT(s2)->ptr[i])) return Qfalse;
}
return Qtrue;
}
-static VALUE
-recursive_hash(VALUE s, VALUE dummy, int recur)
-{
- long i;
- unsigned long h;
- VALUE n;
-
- if (recur) {
- rb_raise(rb_eArgError, "recursive key for hash");
- }
- h = rb_hash_start(rb_hash(rb_obj_class(s)));
- for (i = 0; i < RSTRUCT_LEN(s); i++) {
- n = rb_hash(RSTRUCT_PTR(s)[i]);
- h = rb_hash_uint(h, NUM2LONG(n));
- }
- h = rb_hash_end(h);
- return INT2FIX(h);
-}
-
/*
* call-seq:
* struct.hash => fixnum
@@ -829,9 +807,19 @@ recursive_hash(VALUE s, VALUE dummy, int recur)
*/
static VALUE
-rb_struct_hash(VALUE s)
+rb_struct_hash(s)
+ VALUE s;
{
- return rb_exec_recursive(recursive_hash, s, 0);
+ long i, h;
+ VALUE n;
+
+ h = rb_hash(rb_obj_class(s));
+ for (i = 0; i < RSTRUCT(s)->len; i++) {
+ h = (h << 1) | (h<0 ? 1 : 0);
+ n = rb_hash(RSTRUCT(s)->ptr[i]);
+ h ^= NUM2LONG(n);
+ }
+ return LONG2FIX(h);
}
/*
@@ -843,19 +831,20 @@ rb_struct_hash(VALUE s)
*/
static VALUE
-rb_struct_eql(VALUE s, VALUE s2)
+rb_struct_eql(s, s2)
+ VALUE s, s2;
{
long i;
if (s == s2) return Qtrue;
if (TYPE(s2) != T_STRUCT) return Qfalse;
if (rb_obj_class(s) != rb_obj_class(s2)) return Qfalse;
- if (RSTRUCT_LEN(s) != RSTRUCT_LEN(s2)) {
+ if (RSTRUCT(s)->len != RSTRUCT(s2)->len) {
rb_bug("inconsistent struct"); /* should never happen */
}
- for (i=0; i<RSTRUCT_LEN(s); i++) {
- if (!rb_eql(RSTRUCT_PTR(s)[i], RSTRUCT_PTR(s2)[i])) return Qfalse;
+ for (i=0; i<RSTRUCT(s)->len; i++) {
+ if (!rb_eql(RSTRUCT(s)->ptr[i], RSTRUCT(s2)->ptr[i])) return Qfalse;
}
return Qtrue;
}
@@ -864,37 +853,38 @@ rb_struct_eql(VALUE s, VALUE s2)
* call-seq:
* struct.length => fixnum
* struct.size => fixnum
- *
+ *
* Returns the number of instance variables.
- *
+ *
* Customer = Struct.new(:name, :address, :zip)
* joe = Customer.new("Joe Smith", "123 Maple, Anytown NC", 12345)
* joe.length #=> 3
*/
static VALUE
-rb_struct_size(VALUE s)
+rb_struct_size(s)
+ VALUE s;
{
- return LONG2FIX(RSTRUCT_LEN(s));
+ return LONG2FIX(RSTRUCT(s)->len);
}
/*
* A <code>Struct</code> is a convenient way to bundle a number of
* attributes together, using accessor methods, without having to write
* an explicit class.
- *
+ *
* The <code>Struct</code> class is a generator of specific classes,
* each one of which is defined to hold a set of variables and their
* accessors. In these examples, we'll call the generated class
* ``<i>Customer</i>Class,'' and we'll show an example instance of that
* class as ``<i>Customer</i>Inst.''
- *
+ *
* In the descriptions that follow, the parameter <i>symbol</i> refers
* to a symbol, which is either a quoted string or a
* <code>Symbol</code> (such as <code>:name</code>).
*/
void
-Init_Struct(void)
+Init_Struct()
{
rb_cStruct = rb_define_class("Struct", rb_cObject);
rb_include_module(rb_cStruct, rb_mEnumerable);
@@ -902,15 +892,15 @@ Init_Struct(void)
rb_undef_alloc_func(rb_cStruct);
rb_define_singleton_method(rb_cStruct, "new", rb_struct_s_def, -1);
- rb_define_method(rb_cStruct, "initialize", rb_struct_initialize_m, -1);
+ rb_define_method(rb_cStruct, "initialize", rb_struct_initialize, -2);
rb_define_method(rb_cStruct, "initialize_copy", rb_struct_init_copy, 1);
rb_define_method(rb_cStruct, "==", rb_struct_equal, 1);
rb_define_method(rb_cStruct, "eql?", rb_struct_eql, 1);
rb_define_method(rb_cStruct, "hash", rb_struct_hash, 0);
+ rb_define_method(rb_cStruct, "to_s", rb_struct_inspect, 0);
rb_define_method(rb_cStruct, "inspect", rb_struct_inspect, 0);
- rb_define_alias(rb_cStruct, "to_s", "inspect");
rb_define_method(rb_cStruct, "to_a", rb_struct_to_a, 0);
rb_define_method(rb_cStruct, "values", rb_struct_to_a, 0);
rb_define_method(rb_cStruct, "size", rb_struct_size, 0);
@@ -924,5 +914,4 @@ Init_Struct(void)
rb_define_method(rb_cStruct, "values_at", rb_struct_values_at, -1);
rb_define_method(rb_cStruct, "members", rb_struct_members_m, 0);
- id_members = rb_intern("__members__");
}
diff --git a/symbian/README.SYMBIAN b/symbian/README.SYMBIAN
deleted file mode 100644
index 03c1f0b234..0000000000
--- a/symbian/README.SYMBIAN
+++ /dev/null
@@ -1,100 +0,0 @@
-=begin
-
-= How to build ruby using Symbian SDK
-
-== Requirement
-
-(1) Nokia S60 SDK version 3.1 or later from http://www.forum.nokia.com/Resources_and_Information/Tools/Platforms/S60_Platform_SDKs/ with OpenC plugin installed.
-
- Note: if you want to build dynamic extensions support you need to install the latest version of GCC compiler from http://www.codesourcery.com/gnu_toolchains/arm/portal/release643. After that you need to apply a patch below to a header file (SDK_ROOT)\epoc32\include\gcce\gcce.h
-
-11c11
-<
----
-> @released
-18a19
->
-21a23
->
-24a27,29
-> #define IMPORT_D __declspec(dllimport)
-> #define EXPORT_D __declspec(dllexport)
->
-81,82c86,87
-< #define __NAKED__ __asm
-< #define ____ONLY_USE_NAKED_IN_CIA____ __asm
----
-> #define __NAKED__ __declspec(naked)
-> #define ____ONLY_USE_NAKED_IN_CIA____ __declspec(naked)
-92,96c97,98
-< namespace std {
-< extern "C" {
-< #endif /* __cplusplus */
-<
-< typedef struct __va_list { void *__ap; } va_list;
----
-> namespace std { extern "C" {
-> #endif
-97a100,104
-> #if __GNUC__ < 4
-> typedef struct __va_list { void *__ap; } va_list;
-> #else
-> typedef __builtin_va_list va_list;
-> #endif
-100,102c107
-< } /* extern "C" */
-< } /* namespace std */
-<
----
-> } }
-105a111
-> #if __GNUC__ < 4
-107,109c113,119
-< #define va_arg(ap, type) __builtin_va_arg(ap.__ap, type)
-< #define va_end(ap) __builtin_va_end(ap.__ap)
-<
----
-> #define va_arg(ap, type) __builtin_va_arg(ap.__ap, type)
-> #define va_end(ap) __builtin_va_end(ap.__ap)
-> #else
-> #define va_start(ap, parmN) __builtin_va_start(ap, parmN)
-> #define va_arg(ap, type) __builtin_va_arg(ap, type)
-> #define va_end(ap) __builtin_va_end(ap)
-> #endif
-140,141c150,152
-< // Deal with operator new issues here
-< #include "../symcpp.h"
----
-> #ifndef __SYMBIAN_STDCPP_SUPPORT__
-> #include "../symcpp.h"
-> #endif
-151a163
->
-
-
-(2) If you want to build from SVN source, following command line binaries are required that are not a part of Symbain SDK.
- * sed
- * ruby 1.8
- * svn
-
-== How to compile and install
-
-(1) Execute symbian\configure.bat on your build directory (symbian is default).
-
-(2) Run the following commands from symbian\group directory
- 'bldmake bldfiles'
- 'abld makefile gcce'
- 'abld build gcce urel ruby'
- 'abld freeze gcce ruby'
- 'abld build gcce urel'
-
-(3) Run `makesis ruby.pkg' from symbian\sis directory
- This command will create unsigned installation file ruby.sis. To sign it follow the guidlines from www.symbiansigned.com
-
-== Known problems
-
-Currently gems are not supported.
-Currently signals are not supported.
-
-=end
-
diff --git a/symbian/configure.bat b/symbian/configure.bat
deleted file mode 100644
index 22b03acee3..0000000000
--- a/symbian/configure.bat
+++ /dev/null
@@ -1,121 +0,0 @@
-@echo off
-
-setlocal
-
-echo> ~tmp~.mak ####
-echo> ~ver~.mak ####
-
-:loop
-if "%1" == "" goto :end
-if "%1" == "--srcdir" goto :srcdir
-if "%1" == "srcdir" goto :srcdir
-if "%1" == "--target" goto :target
-if "%1" == "target" goto :target
-if "%1" == "--with-static-linked-ext" goto :extstatic
-if "%1" == "--extout" goto :extout
-if "%1" == "--with-baseruby" goto :baseruby
-if "%1" == "-h" goto :help
-if "%1" == "--help" goto :help
- shift
-goto :loop
-:srcdir
- echo>> ~tmp~.mak srcdir=%2
- echo> ~ver~.mak srcdir=%2
- set srcdir=%2
- shift
- shift
-goto :loop
-:target
- echo>> ~tmp~.mak arch=%2
- set arch=%2
- shift
- shift
-goto :loop
-:extstatic
- echo>> ~tmp~.mak EXTSTATIC=static
- shift
-goto :loop
-:extout
- echo>> ~tmp~.mak EXTOUT=%2
- set EXTOUT=%2
- shift
- shift
-goto :loop
-:baseruby
- echo>> ~tmp~.mak BASERUBY=%2
- set BASERUBY=%2
- shift
- shift
-goto :loop
-:help
- echo Configuration:
- echo --help display this help
- echo --srcdir=DIR find the sources in DIR [configure dir or ..]
- echo System types:
- echo --target=TARGET configure for TARGET [arm-symbianelf]
- echo Optional Package:
- echo --with-baseruby=RUBY use RUBY as baseruby [ruby]
- echo --with-static-linked-ext link external modules statically
- del ~tmp~.mak > nul
-goto :exit
-:end
-
-echo>> ~ver~.mak CC = arm-none-symbianelf-gcc
-echo>> ~ver~.mak CPP = $(CC) -E
-if "%srcdir%" == "" echo>> ~ver~.mak srcdir=..
-echo>> ~ver~.mak all:
-echo>> ~ver~.mak ^ @echo^> ~tmp~.c #define RUBY_REVISION 0
-echo>> ~ver~.mak ^ @echo^>^> ~tmp~.c #include "version.h"
-echo>> ~ver~.mak ^ @echo^>^> ~tmp~.c MAJOR = RUBY_VERSION_MAJOR
-echo>> ~ver~.mak ^ @echo^>^> ~tmp~.c MINOR = RUBY_VERSION_MINOR
-echo>> ~ver~.mak ^ @echo^>^> ~tmp~.c TEENY = RUBY_VERSION_TEENY
-echo>> ~ver~.mak ^ @$(CPP) -I$(srcdir) ~tmp~.c ^| find "=" ^>^>~tmp~.mak
-echo>> ~ver~.mak ^ @del /Q ~tmp~.c
-
-make -f ~ver~.mak
-del /Q ~ver~.mak
-
-:: Defaults
-if "%srcdir%" == "" echo>> ~tmp~.mak srcdir=..
-if "%arch%" == "" echo>> ~tmp~.mak arch=arm-symbianelf
-if "%EXTOUT%" == "" echo>> ~tmp~.mak EXTOUT=$(srcdir)/.ext
-if "%BASERUBY%" == "" echo>> ~tmp~.mak BASERUBY=ruby
-::
-
-echo>> ~tmp~.mak arch_hdrdir = $(EXTOUT)/include/$(arch)
-echo>> ~tmp~.mak hdrdir = $(srcdir)/include
-
-echo>> ~tmp~.mak ifndef EXTSTATIC
-echo>> ~tmp~.mak EXT_LIST=stringio bigdecimal zlib
-echo>> ~tmp~.mak endif
-
-echo>> ~tmp~.mak all:
-echo>> ~tmp~.mak ^ @if not exist $(subst /,\,$(arch_hdrdir))\ruby\nul md $(subst /,\,$(arch_hdrdir)\ruby)
-echo>> ~tmp~.mak ^ $(call config_h,$(subst /,\,$(arch_hdrdir))\ruby\config.h)
-echo>> ~tmp~.mak ^ @if not exist group\nul md group
-echo>> ~tmp~.mak ^ $(call pre_build_mk,pre-build.mk)
-echo>> ~tmp~.mak ^ $(call bld_inf,group\bld.inf)
-echo>> ~tmp~.mak ^ $(call ruby_mmp,group\ruby.mmp,64000,2000000,16000000)
-echo>> ~tmp~.mak ifndef EXTSTATIC
-echo>> ~tmp~.mak ^ $(call ext_mmp,group\,stringio,$(STRINGIO_UID))
-echo>> ~tmp~.mak ^ $(call ext_mmp,group\,bigdecimal,$(BIGDECIMAL_UID),,libm.lib)
-echo>> ~tmp~.mak ^ $(call ext_mmp,group\,zlib,$(ZLIB_UID),,libz.lib)
-echo>> ~tmp~.mak endif
-echo>> ~tmp~.mak ^ @if not exist sis\nul md sis
-echo>> ~tmp~.mak ^ $(call ruby_pkg,sis\ruby.pkg)
-echo>> ~tmp~.mak ifndef EXTSTATIC
-echo>> ~tmp~.mak ^ $(call ext_bigdecimal,sis\ruby.pkg)
-echo>> ~tmp~.mak ^ $(call ext_pkg,sis\ruby.pkg,stringio)
-echo>> ~tmp~.mak ^ $(call ext_pkg,sis\ruby.pkg,zlib)
-echo>> ~tmp~.mak ^ @if not exist eabi\nul md eabi
-echo>> ~tmp~.mak ^ $(call ext_def,eabi\,stringio)
-echo>> ~tmp~.mak ^ $(call ext_def,eabi\,bigdecimal)
-echo>> ~tmp~.mak ^ $(call ext_def,eabi\,zlib)
-echo>> ~tmp~.mak endif
-
-echo>> ~tmp~.mak include setup
-
-make -f ~tmp~.mak
-del /Q ~tmp~.mak
-
-:exit
diff --git a/symbian/missing-aeabi.c b/symbian/missing-aeabi.c
deleted file mode 100644
index f8d7a85039..0000000000
--- a/symbian/missing-aeabi.c
+++ /dev/null
@@ -1,18 +0,0 @@
-#if __GNUC__ > 3
-
-/* GCCE 4.3.2 generates these functions which are are missing from exports (they are simple aliases) */
-extern int __aeabi_uidivmod(unsigned int a, unsigned int b);
-extern int __aeabi_idivmod(int a, int b);
-int __aeabi_idiv(int a, int b)
-{
- return __aeabi_idivmod(a, b);
-}
-
-int __aeabi_uidiv(unsigned int a, unsigned int b)
-{
- return __aeabi_uidivmod(a, b);
-}
-
-#endif
-
-
diff --git a/symbian/missing-pips.c b/symbian/missing-pips.c
deleted file mode 100644
index ed0d90de8b..0000000000
--- a/symbian/missing-pips.c
+++ /dev/null
@@ -1,106 +0,0 @@
-#include <sys/signal.h>
-#include <sys/resource.h>
-#include <fcntl.h>
-#include <pthreadtypes.h>
-
-char **environ = 0;
-
-typedef void (*sighandler_t)(int);
-sighandler_t signal(int signum, sighandler_t handler);
-
-int sigfillset(sigset_t *set);
-int sigdelset(sigset_t *set, int signum);
-int sigprocmask(int how, const sigset_t *set, sigset_t *oldset);
-int raise(int sig);
-int kill(pid_t pid, int sig);
-int pthread_sigmask(int how, const sigset_t *set, sigset_t *oset);
-int execl(const char *path, const char *arg0, ... /*, (char *)0 */);
-int execv(const char *path, char *const argv[]);
-int pthread_kill(pthread_t thread, int sig);
-
-sighandler_t signal(int signum, sighandler_t handler)
-{
- return (sighandler_t)0;
-}
-
-int sigfillset(sigset_t *set)
-{
- return 0;
-}
-
-int sigdelset(sigset_t *set, int signum)
-{
- return 0;
-}
-
-int sigprocmask(int how, const sigset_t *set, sigset_t *oldset)
-{
- return 0;
-}
-
-int raise(int sig)
-{
- return 0;
-}
-
-int kill(pid_t pid, int sig)
-{
- return 0;
-}
-
-int pthread_sigmask(int how, const sigset_t *set, sigset_t *oset)
-{
- return -1;
-}
-
-int execl(const char *path, const char *arg0, ...)
-{
- return 0;
-}
-
-int execv(const char *path, char *const argv[])
-{
- return 0;
-}
-
-int pthread_kill(pthread_t thread, int sig)
-{
- return -1;
-}
-
-
-int sigmask(int signum) {
- return -1;
-}
-
-int sigblock(int mask) {
- return -1;
-}
-
-int sigsetmask(int mask) {
- return -1;
-}
-
-sighandler_t posix_signal(int signum, sighandler_t handler)
-{
- return signal((signum),(handler));
-}
-
-int getrlimit(int resource, struct rlimit *rlp)
-{
- return 0;
-}
-
-int setrlimit(int resource, const struct rlimit *rlp)
-{
- return 0;
-}
-
-int getrusage(int who, struct rusage *r_usage)
-{
- return 0;
-}
-
-
-
-
diff --git a/symbian/pre-build b/symbian/pre-build
deleted file mode 100644
index 16a2248a5a..0000000000
--- a/symbian/pre-build
+++ /dev/null
@@ -1,78 +0,0 @@
-YACC = bison
-IFCHANGE = cmd /C $(srcdir)\win32\ifchange.bat
-RM = del
-MV = cmd /C move
-VCS = svn
-
-
-parse.c: $(srcdir)\parse.y $(srcdir)\tool\ytab.sed
- $(YACC) -d $(YFLAGS) -o y.tab.c $(<:\\=/)
- sed -f $(srcdir)/tool/ytab.sed -e "/^#/s!y\.tab\.c!$@!" y.tab.c > $@.new
- @$(MV) $@.new $(@)
- sed -e "/^#line.*y\.tab\.h/d;/^#line.*parse\.y/d" y.tab.h > $(@:.c=.h).new
- @$(IFCHANGE) $(@:.c=.h) $(@:.c=.h).new
- @$(RM) y.tab.c y.tab.h
-
-INSNS = optinsn.inc insns.inc insns_info.inc vmtc.inc vm.inc
-
-INSNS2VMOPT = --srcdir="$(srcdir)"
-
-$(INSNS): $(srcdir)/insns.def $(srcdir)/vm_opts.h $(srcdir)/defs/opt_operand.def $(srcdir)/defs/opt_insn_unif.def
- $(BASERUBY) -Ks $(srcdir)/tool/insns2vm.rb $(INSNS2VMOPT) $@
-
-minsns.inc: $(srcdir)/template/minsns.inc.tmpl
-
-opt_sc.inc: $(srcdir)/template/opt_sc.inc.tmpl
-
-optinsn.inc: $(srcdir)/template/optinsn.inc.tmpl
-
-optunifs.inc: $(srcdir)/template/optunifs.inc.tmpl
-
-insns.inc: $(srcdir)/template/insns.inc.tmpl
-
-insns_info.inc: $(srcdir)/template/insns_info.inc.tmpl
-
-vmtc.inc: $(srcdir)/template/vmtc.inc.tmpl
-
-vm.inc: $(srcdir)/template/vm.inc.tmpl
-
-node_name.inc: $(srcdir)/node.h
- $(BASERUBY) -n $(srcdir)/tool/node_name.rb $? > $@
-
-known_errors.inc: $(srcdir)/template/known_errors.inc.tmpl $(srcdir)/defs/known_errors.def
- $(BASERUBY) $(srcdir)/tool/generic_erb.rb -c -o $@ $(srcdir)/template/known_errors.inc.tmpl $(srcdir)/defs/known_errors.def
-
-newline.c:
- $(BASERUBY) "$(srcdir)/tool/transcode-tblgen.rb" -vo newline.c $(srcdir)/enc/trans/newline.trans
-
-miniprelude.c: $(srcdir)/tool/compile_prelude.rb $(srcdir)/prelude.rb
- $(BASERUBY) -I$(srcdir) $(srcdir)/tool/compile_prelude.rb $(srcdir)/prelude.rb $@
-
-$(srcdir)/ext/socket/constants.h: $(srcdir)/ext/socket/mkconstants.rb
- $(BASERUBY) $(srcdir)/ext/socket/mkconstants.rb >$@
-
-
-
-$(srcdir)/revision.h: $(srcdir)/version.h $(srcdir)/ChangeLog
- @set LC_MESSAGES=C
- -@$(SET_LC_MESSAGES) $(VCS) info "$(@D)" | \
- sed -n "s/.*Rev:/#define RUBY_REVISION/p" > "$@.tmp"
- @$(IFCHANGE) "$@" "$@.tmp"
-
-incs: $(srcdir)/revision.h $(INSNS) node_name.inc known_errors.inc
-
-srcs: parse.c newline.c lex.c miniprelude.c
-
-lex.c: $(srcdir)\lex.c.blt
- copy $(?:/=\) $@
-
-socket_const: $(srcdir)/ext/socket/constants.h
-
-MAKMAKE: incs srcs socket_const
-
-CLEAN :
- del $(INSNS) node_name.inc known_errors.inc
- $(RM) parse.c parse.h newline.c lex.c miniprelude.c
-
-BLD LIB CLEANLIB RESOURCE FREEZE SAVESPACE RELEASABLES FINAL :
-
diff --git a/symbian/setup b/symbian/setup
deleted file mode 100644
index 52738ef76a..0000000000
--- a/symbian/setup
+++ /dev/null
@@ -1,408 +0,0 @@
-define config_h
-@echo>$(1) #define HAVE_PIPS 1
-@echo>>$(1) #define STDC_HEADERS 1
-@echo>>$(1) #define HAVE_SYS_TYPES_H 1
-@echo>>$(1) #define HAVE_SYS_STAT_H 1
-@echo>>$(1) #define HAVE_STDLIB_H 1
-@echo>>$(1) #define HAVE_STRING_H 1
-@echo>>$(1) #define HAVE_MEMORY_H 1
-@echo>>$(1) #define HAVE_STRINGS_H 1
-@echo>>$(1) #define HAVE_INTTYPES_H 1
-@echo>>$(1) #define HAVE_STDINT_H 1
-@echo>>$(1) #define HAVE_UNISTD_H 1
-@echo>>$(1) #define HAVE_LONG_LONG 1
-@echo>>$(1) #define HAVE_OFF_T 1
-@echo>>$(1) #define SIZEOF_INT 4
-@echo>>$(1) #define SIZEOF_SHORT 2
-@echo>>$(1) #define SIZEOF_LONG 4
-@echo>>$(1) #define SIZEOF_LONG_LONG 8
-@echo>>$(1) #define SIZEOF___INT64 8
-@echo>>$(1) #define SIZEOF_OFF_T 8
-@echo>>$(1) #define SIZEOF_VOIDP 4
-@echo>>$(1) #define SIZEOF_FLOAT 4
-@echo>>$(1) #define SIZEOF_DOUBLE 8
-@echo>>$(1) #define SIZEOF_TIME_T 4
-@echo>>$(1) #define TIMET2NUM(v) LONG2NUM(v)
-@echo>>$(1) #define NUM2TIMET(v) NUM2LONG(v)
-@echo>>$(1) #define SIZEOF_SIZE_T 4
-@echo>>$(1) #define SIZEOF_PTRDIFF_T 4
-@echo>>$(1) #define rb_pid_t pid_t
-@echo>>$(1) #define PIDT2NUM(v) LONG2NUM(v)
-@echo>>$(1) #define NUM2PIDT(v) NUM2LONG(v)
-@echo>>$(1) #define rb_uid_t uid_t
-@echo>>$(1) #define UIDT2NUM(v) ULONG2NUM(v)
-@echo>>$(1) #define NUM2UIDT(v) NUM2ULONG(v)
-@echo>>$(1) #define rb_gid_t gid_t
-@echo>>$(1) #define GIDT2NUM(v) ULONG2NUM(v)
-@echo>>$(1) #define NUM2GIDT(v) NUM2ULONG(v)
-@echo>>$(1) #define HAVE_PROTOTYPES 1
-@echo>>$(1) #define TOKEN_PASTE(x,y) x##y
-@echo>>$(1) #define STRINGIZE(expr) STRINGIZE0(expr)
-@echo>>$(1) #define HAVE_STDARG_PROTOTYPES 1
-@echo>>$(1) #define NORETURN(x) __attribute__ ((noreturn)) x
-@echo>>$(1) #define DEPRECATED(x) __attribute__ ((deprecated)) x
-@echo>>$(1) #define NOINLINE(x) __attribute__ ((noinline)) x
-@echo>>$(1) #define FUNC_STDCALL(x) x
-@echo>>$(1) #define FUNC_CDECL(x) x
-@echo>>$(1) #define FUNC_FASTCALL(x) x
-@echo>>$(1) #define HAVE_DECL_SYS_NERR 0
-@echo>>$(1) #define HAVE_LIBDL 1
-@echo>>$(1) #define HAVE_DIRENT_H 1
-@echo>>$(1) #define STDC_HEADERS 1
-@echo>>$(1) #define HAVE_SYS_WAIT_H 1
-@echo>>$(1) #define HAVE_STDLIB_H 1
-@echo>>$(1) #define HAVE_STRING_H 1
-@echo>>$(1) #define HAVE_UNISTD_H 1
-@echo>>$(1) #define HAVE_LIMITS_H 1
-@echo>>$(1) #define HAVE_SYS_IOCTL_H 1
-@echo>>$(1) #define HAVE_FCNTL_H 1
-@echo>>$(1) #define HAVE_SYS_FCNTL_H 1
-@echo>>$(1) #define HAVE_SYS_SELECT_H 1
-@echo>>$(1) #define HAVE_SYS_TIME_H 1
-@echo>>$(1) #define HAVE_SYS_PARAM_H 1
-@echo>>$(1) #define HAVE_PWD_H 1
-@echo>>$(1) #define HAVE_GRP_H 1
-@echo>>$(1) #define HAVE_UTIME_H 1
-@echo>>$(1) #define HAVE_MEMORY_H 1
-@echo>>$(1) #define HAVE_SYS_RESOURCE_H 1
-@echo>>$(1) #define HAVE_FLOAT_H 1
-@echo>>$(1) #define HAVE_PTHREAD_H 1
-@echo>>$(1) #define HAVE_LANGINFO_H 1
-@echo>>$(1) #define HAVE_LOCALE_H 1
-@echo>>$(1) #define HAVE_STRUCT_STAT_ST_BLKSIZE 1
-@echo>>$(1) #define HAVE_ST_BLKSIZE 1
-@echo>>$(1) #define HAVE_STRUCT_STAT_ST_BLOCKS 1
-@echo>>$(1) #define HAVE_ST_BLOCKS 1
-@echo>>$(1) #define HAVE_STRUCT_STAT_ST_RDEV 1
-@echo>>$(1) #define HAVE_ST_RDEV 1
-@echo>>$(1) #define HAVE_STRUCT_STAT_ST_ATIMESPEC 1
-@echo>>$(1) #define HAVE_STRUCT_STAT_ST_MTIMESPEC 1
-@echo>>$(1) #define HAVE_STRUCT_STAT_ST_CTIMESPEC 1
-@echo>>$(1) #define HAVE_STRUCT_TIMESPEC 1
-@echo>>$(1) #define HAVE_RB_FD_INIT 1
-@echo>>$(1) #define GETGROUPS_T gid_t
-@echo>>$(1) #define RETSIGTYPE void
-@echo>>$(1) #define C_ALLOCA 1
-@echo>>$(1) #define HAVE_DUP2 1
-@echo>>$(1) #define HAVE_MEMMOVE 1
-@echo>>$(1) #define HAVE_STRCASECMP 1
-@echo>>$(1) #define HAVE_STRNCASECMP 1
-@echo>>$(1) #define HAVE_STRERROR 1
-@echo>>$(1) #define HAVE_STRFTIME 1
-@echo>>$(1) #define HAVE_STRCHR 1
-@echo>>$(1) #define HAVE_STRSTR 1
-@echo>>$(1) #define HAVE_STRTOUL 1
-@echo>>$(1) #define HAVE_VSNPRINTF 1
-@echo>>$(1) #define HAVE_ISNAN 1
-@echo>>$(1) #define HAVE_FINITE 1
-@echo>>$(1) #define HAVE_ISINF 1
-@echo>>$(1) #define HAVE_HYPOT 1
-@echo>>$(1) #define HAVE_ACOSH 1
-@echo>>$(1) #define HAVE_ERF 1
-@echo>>$(1) #define HAVE_STRLCPY 1
-@echo>>$(1) #define HAVE_STRLCAT 1
-@echo>>$(1) #define HAVE_FMOD 1
-@echo>>$(1) #define HAVE_WAITPID 1
-@echo>>$(1) #define HAVE_FSYNC 1
-@echo>>$(1) #define HAVE_GETCWD 1
-@echo>>$(1) #define HAVE_TRUNCATE 1
-@echo>>$(1) #define HAVE_UTIMES 1
-@echo>>$(1) #define HAVE_FCNTL 1
-@echo>>$(1) #define HAVE_LSTAT 1
-@echo>>$(1) #define HAVE_LINK 1
-@echo>>$(1) #define HAVE_SYMLINK 1
-@echo>>$(1) #define HAVE_READLINK 1
-@echo>>$(1) #define HAVE_SETEUID 1
-@echo>>$(1) #define HAVE_SETREUID 1
-@echo>>$(1) #define HAVE_SETEGID 1
-@echo>>$(1) #define HAVE_SETREGID 1
-@echo>>$(1) #define HAVE_ISSETUGID 1
-@echo>>$(1) #define HAVE_LCHOWN 1
-@echo>>$(1) #define HAVE_GETPGRP 1
-@echo>>$(1) #define HAVE_SETPGRP 1
-@echo>>$(1) #define HAVE_GETPGID 1
-@echo>>$(1) #define HAVE_SETPGID 1
-@echo>>$(1) #define HAVE_INITGROUPS 1
-@echo>>$(1) #define HAVE_GETGROUPS 1
-@echo>>$(1) #define HAVE_SETGROUPS 1
-@echo>>$(1) #define HAVE_GETPRIORITY 1
-@echo>>$(1) #define HAVE_SYSCONF 1
-@echo>>$(1) #define HAVE_DLOPEN 1
-@echo>>$(1) #define HAVE_SIGACTION 1
-@echo>>$(1) #define HAVE_VSNPRINTF 1
-@echo>>$(1) #define HAVE_SNPRINTF 1
-@echo>>$(1) #define HAVE_SETSID 1
-@echo>>$(1) #define HAVE_TELLDIR 1
-@echo>>$(1) #define HAVE_SEEKDIR 1
-@echo>>$(1) #define HAVE_FCHMOD 1
-@echo>>$(1) #define HAVE_COSH 1
-@echo>>$(1) #define HAVE_SINH 1
-@echo>>$(1) #define HAVE_TANH 1
-@echo>>$(1) #define HAVE_ROUND 1
-@echo>>$(1) #define HAVE_SETUID 1
-@echo>>$(1) #define HAVE_SETGID 1
-@echo>>$(1) #define HAVE_SETENV 1
-@echo>>$(1) #define HAVE_UNSETENV 1
-@echo>>$(1) #define HAVE_MKTIME 1
-@echo>>$(1) #define HAVE_CLOCK_GETTIME 1
-@echo>>$(1) #define HAVE_GETTIMEOFDAY 1
-@echo>>$(1) #define HAVE_STRUCT_TM_TM_ZONE 1
-@echo>>$(1) #define HAVE_TM_ZONE 1
-@echo>>$(1) #define HAVE_STRUCT_TM_TM_GMTOFF 1
-@echo>>$(1) #define NEGATIVE_TIME_T 1
-@echo>>$(1) #define RSHIFT(x,y) ((x)^>^>(int)y)
-@echo>>$(1) #define DOSISH 1
-@echo>>$(1) #define DOSISH_DRIVE_LETTER
-@echo>>$(1) #define RUBY_JMP_BUF jmp_buf
-@echo>>$(1) #define RUBY_SETJMP(env) _setjmp(env)
-@echo>>$(1) #define RUBY_LONGJMP(env,val) _longjmp(env,val)
-@echo>>$(1) #define FILE_COUNT _r
-@echo>>$(1) #define FILE_READPTR _p
-@echo>>$(1) #define HAVE__SC_CLK_TCK 1
-@echo>>$(1) #define STACK_GROW_DIRECTION -1
-@echo>>$(1) #define _REENTRANT 1
-@echo>>$(1) #define _THREAD_SAFE 1
-@echo>>$(1) #define HAVE_LIBPTHREAD 1
-@echo>>$(1) #define HAVE_NANOSLEEP 1
-@echo>>$(1) #define USE_ELF 1
-@echo>>$(1) #define MANGLED_PATH 1
-@echo>>$(1) #define DLEXT_MAXLEN 4
-@echo>>$(1) #define DLEXT ".dll"
-@echo>>$(1) #define DLN_NEEDS_ALT_SEPARATOR 1
-@echo>>$(1) #define RUBY_LIB "C:/Data/Ruby/lib/$(MAJOR).$(MINOR).$(TEENY)"
-@echo>>$(1) #define RUBY_SITE_LIB "E:/Data/Ruby/lib"
-@echo>>$(1) #define RUBY_SITE_LIB2 "E:/Data/Ruby/lib/$(MAJOR).$(MINOR).$(TEENY)"
-@echo>>$(1) #define RUBY_VENDOR_LIB "C:/Data/Ruby/lib"
-@echo>>$(1) #define RUBY_VENDOR_LIB2 "C:/Data/Ruby/lib/$(MAJOR).$(MINOR).$(TEENY)"
-@echo>>$(1) #define RUBY_PLATFORM "$(arch)"
-@echo>>$(1) #define RUBY_ARCHLIB "C:/Data/Ruby/$(MAJOR).$(MINOR).$(TEENY)/$(arch)"
-@echo>>$(1) #define RUBY_SITE_ARCHLIB "E:/Data/Ruby/lib/$(MAJOR).$(MINOR).$(TEENY)/$(arch)"
-@echo>>$(1) #define RUBY_VENDOR_ARCHLIB "C:/Data/Ruby/lib/$(MAJOR).$(MINOR).$(TEENY)/$(arch)"
-endef
-
-define pre_build_mk
-@echo>$(1) srcdir = $(srcdir)
-@echo>>$(1) BASERUBY = $(BASERUBY)
-@echo>>$(1) include pre-build
-endef
-
-define bld_inf
-@echo>$(1) PRJ_PLATFORMS
-@echo>>$(1) GCCE $(2)
-@echo>>$(1) PRJ_MMPFILES
-@echo>>$(1) gnumakefile ..\pre-build.mk
-@echo>>$(1) ruby.mmp
-@if not "$(EXT_LIST)" == "" for %%f in ($(EXT_LIST)) do echo>>$(1) %%f.mmp
-endef
-
-
-ifndef EXTSTATIC
-DLN=dln
-else
-DLN=dmydln
-endif
-
-define ruby_mmp
-@echo>$(1) TARGET Ruby.exe
-@echo>>$(1) TARGETTYPE EXEXP
-
-@echo>>$(1) UID 0x100039CE $(RUBY_UID)
-@echo>>$(1) VENDORID 0
-@echo>>$(1) SECUREID $(RUBY_UID)
-@echo>>$(1) CAPABILITY LocalServices NetworkServices ReadUserData UserEnvironment WriteUserData
-
-
-@echo>>$(1) USERINCLUDE ..\$(subst /,\,$(arch_hdrdir))
-@echo>>$(1) USERINCLUDE ..
-@echo>>$(1) USERINCLUDE ..\$(subst /,\,$(srcdir))
-@echo>>$(1) USERINCLUDE ..\$(subst /,\,$(hdrdir))
-@echo>>$(1) USERINCLUDE ..\$(subst /,\,$(hdrdir))\ruby
-@echo>>$(1) USERINCLUDE ..\$(subst /,\,$(srcdir))\missing
-
-@echo>>$(1) SYSTEMINCLUDE ..\$(subst /,\,$(arch_hdrdir))
-@echo>>$(1) SYSTEMINCLUDE ..
-@echo>>$(1) SYSTEMINCLUDE ..\$(subst /,\,$(srcdir))
-@echo>>$(1) SYSTEMINCLUDE ..\$(subst /,\,$(hdrdir))
-@echo>>$(1) SYSTEMINCLUDE ..\$(subst /,\,$(hdrdir))\ruby
-@echo>>$(1) SYSTEMINCLUDE ..\$(subst /,\,$(srcdir))\missing
-
-@echo>>$(1) SYSTEMINCLUDE \epoc32\include
-@echo>>$(1) SYSTEMINCLUDE \epoc32\include\stdapis
-
-@echo>>$(1) SOURCEPATH ..\$(subst /,\,$(srcdir))
-@echo>>$(1) SOURCE array.c
-@echo>>$(1) SOURCE bignum.c
-@echo>>$(1) SOURCE blockinlining.c
-@echo>>$(1) SOURCE class.c
-@echo>>$(1) SOURCE compar.c
-@echo>>$(1) SOURCE compile.c
-@echo>>$(1) SOURCE cont.c
-@echo>>$(1) SOURCE debug.c
-@echo>>$(1) SOURCE dir.c
-@echo>>$(1) SOURCE $(DLN).c
-@echo>>$(1) SOURCE dmyext.c
-@echo>>$(1) SOURCE encoding.c
-@echo>>$(1) SOURCE enum.c
-@echo>>$(1) SOURCE enumerator.c
-@echo>>$(1) SOURCE error.c
-@echo>>$(1) SOURCE eval.c
-@echo>>$(1) SOURCE file.c
-@echo>>$(1) SOURCE gc.c
-@echo>>$(1) SOURCE hash.c
-@echo>>$(1) SOURCE inits.c
-@echo>>$(1) SOURCE io.c
-@echo>>$(1) SOURCE iseq.c
-@echo>>$(1) SOURCE load.c
-@echo>>$(1) SOURCE main.c
-@echo>>$(1) SOURCE marshal.c
-@echo>>$(1) SOURCE math.c
-@echo>>$(1) SOURCE numeric.c
-@echo>>$(1) SOURCE object.c
-@echo>>$(1) SOURCE pack.c
-@echo>>$(1) SOURCE proc.c
-@echo>>$(1) SOURCE process.c
-@echo>>$(1) SOURCE random.c
-@echo>>$(1) SOURCE range.c
-@echo>>$(1) SOURCE re.c
-@echo>>$(1) SOURCE regcomp.c
-@echo>>$(1) SOURCE regenc.c
-@echo>>$(1) SOURCE regerror.c
-@echo>>$(1) SOURCE regexec.c
-@echo>>$(1) SOURCE regparse.c
-@echo>>$(1) SOURCE regsyntax.c
-@echo>>$(1) SOURCE ruby.c
-@echo>>$(1) SOURCE signal.c
-@echo>>$(1) SOURCE sprintf.c
-@echo>>$(1) SOURCE st.c
-@echo>>$(1) SOURCE string.c
-@echo>>$(1) SOURCE struct.c
-@echo>>$(1) SOURCE thread.c
-@echo>>$(1) SOURCE time.c
-@echo>>$(1) SOURCE transcode.c
-@echo>>$(1) SOURCE util.c
-@echo>>$(1) SOURCE variable.c
-@echo>>$(1) SOURCE version.c
-@echo>>$(1) SOURCE vm.c
-@echo>>$(1) SOURCE vm_dump.c
-@echo>>$(1) SOURCE safe.c
-@echo>>$(1) SOURCE rational.c
-@echo>>$(1) SOURCE strftime.c
-@echo>>$(1) SOURCE complex.c
-
-@echo>>$(1) SOURCEPATH ..\$(subst /,\,$(srcdir))\missing
-@echo>>$(1) SOURCE alloca.c
-@echo>>$(1) SOURCE crypt.c
-@echo>>$(1) SOURCE tgamma.c
-@echo>>$(1) SOURCE flock.c
-
-@echo>>$(1) SOURCEPATH ..\$(subst /,\,$(srcdir))\enc
-@echo>>$(1) SOURCE ascii.c
-@echo>>$(1) SOURCE unicode.c
-@echo>>$(1) SOURCE utf_8.c
-@echo>>$(1) SOURCE us_ascii.c
-
-@echo>>$(1) SOURCEPATH ..
-@echo>>$(1) SOURCE miniprelude.c
-@echo>>$(1) SOURCE parse.c
-@echo>>$(1) SOURCE newline.c
-@echo>>$(1) SOURCE missing-pips.c
-@echo>>$(1) SOURCE missing-aeabi.c
-
-
-@echo>>$(1) LIBRARY euser.lib
-@echo>>$(1) LIBRARY libc.lib
-@echo>>$(1) LIBRARY libm.lib
-@echo>>$(1) LIBRARY libpthread.lib
-@echo>>$(1) LIBRARY libdl.lib
-
-@echo>>$(1) STATICLIBRARY libcrt0.lib
-
-@echo>>$(1) EPOCSTACKSIZE $(2)
-@echo>>$(1) EPOCHEAPSIZE $(3) $(4)
-
-@if "$(EXTSTATIC)" == "" echo>>$(1) OPTION GCCE -fvisibility=default
-endef
-
-define ext_mmp
-@echo>$(1)$(2).mmp TARGET $(2).dll
-@echo>>$(1)$(2).mmp TARGETTYPE DLL
-@echo>>$(1)$(2).mmp UID 0x10004262 $(3)
-@echo>>$(1)$(2).mmp VENDORID 0
-@echo>>$(1)$(2).mmp SECUREID $(3)
-@echo>>$(1)$(2).mmp CAPABILITY LocalServices NetworkServices ReadUserData UserEnvironment WriteUserData
-
-@echo>>$(1)$(2).mmp USERINCLUDE ..\$(subst /,\,$(arch_hdrdir))
-@echo>>$(1)$(2).mmp USERINCLUDE ..\$(subst /,\,$(srcdir))
-@echo>>$(1)$(2).mmp USERINCLUDE ..\$(subst /,\,$(hdrdir))
-@echo>>$(1)$(2).mmp USERINCLUDE ..\$(subst /,\,$(hdrdir))\ruby
-@echo>>$(1)$(2).mmp USERINCLUDE ..\$(subst /,\,$(srcdir))\missing
-
-@echo>>$(1)$(2).mmp SYSTEMINCLUDE ..\$(subst /,\,$(arch_hdrdir))
-@echo>>$(1)$(2).mmp SYSTEMINCLUDE ..\$(subst /,\,$(srcdir))
-@echo>>$(1)$(2).mmp SYSTEMINCLUDE ..\$(subst /,\,$(hdrdir))
-@echo>>$(1)$(2).mmp SYSTEMINCLUDE ..\$(subst /,\,$(hdrdir))\ruby
-@echo>>$(1)$(2).mmp SYSTEMINCLUDE ..\$(subst /,\,$(srcdir))\missing
-
-@echo>>$(1)$(2).mmp SYSTEMINCLUDE \epoc32\include\stdapis
-
-@echo>>$(1)$(2).mmp SOURCEPATH ..\$(subst /,\,$(srcdir))\ext\$(2)
-@echo>>$(1)$(2).mmp SOURCE $(2).c $(4)
-
-@echo>>$(1)$(2).mmp LIBRARY euser.lib
-@echo>>$(1)$(2).mmp LIBRARY libc.lib $(5)
-@echo>>$(1)$(2).mmp LIBRARY Ruby.lib
-
-@echo>>$(1)$(2).mmp OPTION GCCE -fvisibility=default
-endef
-
-define ext_def
-@echo>$(1)$(2)u.def EXPORTS
-@echo>>$(1)$(2)u.def ^ Init_$(2) @ 1 NONAME
-endef
-
-define ruby_pkg
-@echo>$(1) ^&EN
-
-@echo>>$(1) #{"Ruby Core"},($(RUBY_UID)),$(MAJOR),$(MINOR),$(TEENY)
-
-@echo>>$(1) %%{"Symbian Research"}
-
-@echo>>$(1) :"Symbian Research"
-
-@echo>>$(1) (0x20013851), 1, 3, 0, {"Symbian OS PIPS"}
-
-@echo>>$(1) [0x101F7961], 0, 0, 0, {"S60ProductID"}
-
-@echo>>$(1) "$(EPOCROOT)epoc32\release\gcce\urel\Ruby.exe"-"!:\sys\bin\Ruby.exe"
-endef
-
-
-define ext_pkg
-@echo>>$(1) "$(EPOCROOT)epoc32\release\gcce\urel\$(2).dll"-"!:\sys\bin\$(2).dll"
-@echo>>$(1) "$(EPOCROOT)epoc32\release\gcce\urel\$(2).dll"-"!:\Data\Ruby\$(MAJOR).$(MINOR).$(TEENY)\$(arch)\$(2).dll"
-endef
-
-define ext_bigdecimal
-$(call ext_pkg,$(1),bigdecimal)
-@echo>>$(1) "..\$(subst /,\,$(srcdir))\ext\bigdecimal\lib\bigdecimal\jacobian.rb"-"!:\Data\Ruby\lib\bigdecimal\jacobian.rb"
-@echo>>$(1) "..\$(subst /,\,$(srcdir))\ext\bigdecimal\lib\bigdecimal\ludcmp.rb"-"!:\Data\Ruby\lib\bigdecimal\ludcmp.rb"
-@echo>>$(1) "..\$(subst /,\,$(srcdir))\ext\bigdecimal\lib\bigdecimal\math.rb"-"!:\Data\Ruby\lib\bigdecimal\math.rb"
-@echo>>$(1) "..\$(subst /,\,$(srcdir))\ext\bigdecimal\lib\bigdecimal\newton.rb"-"!:\Data\Ruby\lib\bigdecimal\newton.rb"
-@echo>>$(1) "..\$(subst /,\,$(srcdir))\ext\bigdecimal\lib\bigdecimal\util.rb"-"!:\Data\Ruby\lib\bigdecimal\util.rb"
-endef
-
-EPOCROOT := $(addsuffix \,$(word 3,$(shell devices -info @$(word 3,$(shell devices -default)) | find "Root")))
-
-ifndef SIGNED
-RUBY_UID=0xA0001BC6
-STRINGIO_UID=0xA0001BC7
-BIGDECIMAL_UID=0xA0001BC8
-ZLIB_UID=0xA0001BCB
-else
-RUBY_UID=0x200205CC
-STRINGIO_UID=0x200205CD
-BIGDECIMAL_UID=0x200205CE
-ZLIB_UID=0x200205D0
-endif
-
-
diff --git a/template/Doxyfile.tmpl b/template/Doxyfile.tmpl
deleted file mode 100644
index 0fd9462c69..0000000000
--- a/template/Doxyfile.tmpl
+++ /dev/null
@@ -1,267 +0,0 @@
-# Doxyfile 1.5.7
-<%
-srcdir = miniruby = nil
-opt = OptionParser.new do |o|
- o.on('--srcdir=SRCDIR') {|v| srcdir = v}
- o.on('--miniruby=MINIRUBY') {|v| miniruby = v}
- o.order!(ARGV)
-end
-srcdir ||= File.dirname(File.dirname(__FILE__))
-load 'rbconfig.rb'
-unless miniruby
- miniruby = './miniruby$(EXEEXT) -I$(srcdir)/lib -I$(EXTOUT)/common -I./- -r$(srcdir)/ext/purelib.rb'
- RbConfig.expand(miniruby, RbConfig::CONFIG.merge("srcdir"=>srcdir))
-end
-dot = RbConfig::CONFIG['DOT']
-have_dot = dot.empty? ? "NO" : "YES"
-%>
-#---------------------------------------------------------------------------
-# Project related configuration options
-#---------------------------------------------------------------------------
-PROJECT_NAME = Ruby
-PROJECT_NUMBER = <%=RUBY_VERSION%><%= RUBY_PATCHLEVEL < 0 ? 'dev' : "p#{RUBY_PATCHLEVEL}" %> (<%=RUBY_RELEASE_DATE%> revision <%=RUBY_REVISION%>)
-STRIP_FROM_PATH = <%=srcdir%>
-FILE_VERSION_FILTER = "<%=miniruby%> <%=srcdir%>/tool/file2lastrev.rb -q"
-INPUT = <%=srcdir%> .
-INPUT_FILTER = "<%=miniruby%> <%=srcdir%>/tool/strip-rdoc.rb"
-
-DOXYFILE_ENCODING = UTF-8
-OUTPUT_DIRECTORY = doc/capi
-CREATE_SUBDIRS = YES
-OUTPUT_LANGUAGE = English
-BRIEF_MEMBER_DESC = YES
-REPEAT_BRIEF = YES
-ABBREVIATE_BRIEF =
-ALWAYS_DETAILED_SEC = YES
-INLINE_INHERITED_MEMB = NO
-FULL_PATH_NAMES = YES
-STRIP_FROM_INC_PATH =
-SHORT_NAMES = NO
-JAVADOC_AUTOBRIEF = YES
-QT_AUTOBRIEF = YES
-MULTILINE_CPP_IS_BRIEF = NO
-INHERIT_DOCS = YES
-SEPARATE_MEMBER_PAGES = NO
-TAB_SIZE = 8
-ALIASES =
-OPTIMIZE_OUTPUT_FOR_C = YES
-OPTIMIZE_OUTPUT_JAVA = NO
-OPTIMIZE_FOR_FORTRAN = NO
-OPTIMIZE_OUTPUT_VHDL = NO
-BUILTIN_STL_SUPPORT = NO
-CPP_CLI_SUPPORT = NO
-SIP_SUPPORT = NO
-IDL_PROPERTY_SUPPORT = NO
-DISTRIBUTE_GROUP_DOC = NO
-SUBGROUPING = YES
-TYPEDEF_HIDES_STRUCT = NO
-SYMBOL_CACHE_SIZE = 0
-#---------------------------------------------------------------------------
-# Build related configuration options
-#---------------------------------------------------------------------------
-EXTRACT_ALL = YES
-EXTRACT_PRIVATE = NO
-EXTRACT_STATIC = YES
-EXTRACT_LOCAL_CLASSES = YES
-EXTRACT_LOCAL_METHODS = NO
-EXTRACT_ANON_NSPACES = NO
-HIDE_UNDOC_MEMBERS = NO
-HIDE_UNDOC_CLASSES = NO
-HIDE_FRIEND_COMPOUNDS = NO
-HIDE_IN_BODY_DOCS = YES
-INTERNAL_DOCS = YES
-CASE_SENSE_NAMES = NO
-HIDE_SCOPE_NAMES = NO
-SHOW_INCLUDE_FILES = YES
-INLINE_INFO = YES
-SORT_MEMBER_DOCS = YES
-SORT_BRIEF_DOCS = NO
-SORT_GROUP_NAMES = NO
-SORT_BY_SCOPE_NAME = NO
-GENERATE_TODOLIST = YES
-GENERATE_TESTLIST = YES
-GENERATE_BUGLIST = YES
-GENERATE_DEPRECATEDLIST= YES
-ENABLED_SECTIONS =
-MAX_INITIALIZER_LINES = 30
-SHOW_USED_FILES = YES
-SHOW_DIRECTORIES = NO
-SHOW_FILES = YES
-SHOW_NAMESPACES = YES
-LAYOUT_FILE =
-#---------------------------------------------------------------------------
-# configuration options related to warning and progress messages
-#---------------------------------------------------------------------------
-QUIET = NO
-WARNINGS = YES
-WARN_IF_UNDOCUMENTED = YES
-WARN_IF_DOC_ERROR = YES
-WARN_NO_PARAMDOC = NO
-WARN_FORMAT = "$file:$line: $text"
-WARN_LOGFILE =
-#---------------------------------------------------------------------------
-# configuration options related to the input files
-#---------------------------------------------------------------------------
-INPUT_ENCODING = UTF-8
-FILE_PATTERNS = *.c *.h *.y *.inc
-RECURSIVE = YES
-EXCLUDE =
-EXCLUDE_SYMLINKS = YES
-EXCLUDE_PATTERNS = *.src doc build tmp test yarvtest lib bootstraptest spec .ext .git .svn
-EXCLUDE_SYMBOLS =
-EXAMPLE_PATH =
-EXAMPLE_PATTERNS =
-EXAMPLE_RECURSIVE = NO
-IMAGE_PATH = <%= "#{srcdir}/doc/images" %>
-FILTER_PATTERNS =
-FILTER_SOURCE_FILES = YES
-#---------------------------------------------------------------------------
-# configuration options related to source browsing
-#---------------------------------------------------------------------------
-SOURCE_BROWSER = YES
-INLINE_SOURCES = NO
-STRIP_CODE_COMMENTS = YES
-REFERENCED_BY_RELATION = YES
-REFERENCES_RELATION = YES
-REFERENCES_LINK_SOURCE = YES
-USE_HTAGS = NO
-VERBATIM_HEADERS = YES
-#---------------------------------------------------------------------------
-# configuration options related to the alphabetical class index
-#---------------------------------------------------------------------------
-COLS_IN_ALPHA_INDEX = 5
-IGNORE_PREFIX =
-#---------------------------------------------------------------------------
-# configuration options related to the HTML output
-#---------------------------------------------------------------------------
-GENERATE_HTML = YES
-HTML_OUTPUT = html
-HTML_FILE_EXTENSION = .html
-HTML_HEADER =
-HTML_FOOTER =
-HTML_STYLESHEET =
-HTML_ALIGN_MEMBERS = YES
-HTML_DYNAMIC_SECTIONS = NO
-GENERATE_DOCSET = NO
-DOCSET_FEEDNAME = "Doxygen generated docs"
-DOCSET_BUNDLE_ID = org.doxygen.Project
-GENERATE_HTMLHELP = NO
-CHM_FILE =
-HHC_LOCATION =
-GENERATE_CHI = NO
-CHM_INDEX_ENCODING =
-BINARY_TOC = NO
-TOC_EXPAND = NO
-GENERATE_QHP = NO
-QCH_FILE =
-QHP_NAMESPACE = org.doxygen.Project
-QHP_VIRTUAL_FOLDER = doc
-QHG_LOCATION =
-DISABLE_INDEX = NO
-ENUM_VALUES_PER_LINE = 4
-GENERATE_TREEVIEW = NO
-TREEVIEW_WIDTH = 250
-FORMULA_FONTSIZE = 10
-#---------------------------------------------------------------------------
-# configuration options related to the LaTeX output
-#---------------------------------------------------------------------------
-GENERATE_LATEX = NO
-LATEX_OUTPUT = latex
-LATEX_CMD_NAME = latex
-MAKEINDEX_CMD_NAME = makeindex
-COMPACT_LATEX = NO
-PAPER_TYPE = a4wide
-EXTRA_PACKAGES =
-LATEX_HEADER =
-PDF_HYPERLINKS = YES
-USE_PDFLATEX = YES
-LATEX_BATCHMODE = NO
-LATEX_HIDE_INDICES = NO
-#---------------------------------------------------------------------------
-# configuration options related to the RTF output
-#---------------------------------------------------------------------------
-GENERATE_RTF = NO
-RTF_OUTPUT = rtf
-COMPACT_RTF = NO
-RTF_HYPERLINKS = NO
-RTF_STYLESHEET_FILE =
-RTF_EXTENSIONS_FILE =
-#---------------------------------------------------------------------------
-# configuration options related to the man page output
-#---------------------------------------------------------------------------
-GENERATE_MAN = NO
-MAN_OUTPUT = man
-MAN_EXTENSION = .3
-MAN_LINKS = NO
-#---------------------------------------------------------------------------
-# configuration options related to the XML output
-#---------------------------------------------------------------------------
-GENERATE_XML = NO
-XML_OUTPUT = xml
-XML_SCHEMA =
-XML_DTD =
-XML_PROGRAMLISTING = YES
-#---------------------------------------------------------------------------
-# configuration options for the AutoGen Definitions output
-#---------------------------------------------------------------------------
-GENERATE_AUTOGEN_DEF = NO
-#---------------------------------------------------------------------------
-# configuration options related to the Perl module output
-#---------------------------------------------------------------------------
-GENERATE_PERLMOD = NO
-PERLMOD_LATEX = NO
-PERLMOD_PRETTY = YES
-PERLMOD_MAKEVAR_PREFIX =
-#---------------------------------------------------------------------------
-# Configuration options related to the preprocessor
-#---------------------------------------------------------------------------
-ENABLE_PREPROCESSING = YES
-MACRO_EXPANSION = NO
-EXPAND_ONLY_PREDEF = NO
-SEARCH_INCLUDES = YES
-INCLUDE_PATH =
-INCLUDE_FILE_PATTERNS =
-PREDEFINED =
-EXPAND_AS_DEFINED =
-SKIP_FUNCTION_MACROS = YES
-#---------------------------------------------------------------------------
-# Configuration::additions related to external references
-#---------------------------------------------------------------------------
-TAGFILES =
-GENERATE_TAGFILE =
-ALLEXTERNALS = NO
-EXTERNAL_GROUPS = YES
-PERL_PATH = /usr/bin/perl
-#---------------------------------------------------------------------------
-# Configuration options related to the dot tool
-#---------------------------------------------------------------------------
-CLASS_DIAGRAMS = NO
-MSCGEN_PATH =
-HIDE_UNDOC_RELATIONS = YES
-HAVE_DOT = <%= have_dot %>
-DOT_FONTNAME = FreeSans
-DOT_FONTPATH =
-CLASS_GRAPH = NO
-COLLABORATION_GRAPH = NO
-GROUP_GRAPHS = YES
-UML_LOOK = NO
-TEMPLATE_RELATIONS = NO
-INCLUDE_GRAPH = YES
-INCLUDED_BY_GRAPH = YES
-CALL_GRAPH = NO
-CALLER_GRAPH = NO
-GRAPHICAL_HIERARCHY = NO
-DIRECTORY_GRAPH = NO
-DOT_IMAGE_FORMAT = png
-DOT_PATH =
-DOTFILE_DIRS =
-DOT_GRAPH_MAX_NODES = 50
-MAX_DOT_GRAPH_DEPTH = 0
-DOT_TRANSPARENT = NO
-DOT_MULTI_TARGETS = NO
-GENERATE_LEGEND = YES
-DOT_CLEANUP = YES
-#---------------------------------------------------------------------------
-# Configuration::additions related to the search engine
-#---------------------------------------------------------------------------
-SEARCHENGINE = NO
diff --git a/template/encdb.h.tmpl b/template/encdb.h.tmpl
deleted file mode 100644
index e65b651050..0000000000
--- a/template/encdb.h.tmpl
+++ /dev/null
@@ -1,79 +0,0 @@
-<%
-#
-# OnigEncodingDefine(foo, Foo) = {
-# ..
-# "Shift_JIS", /* Canonical Name */
-# ..
-# };
-# ENC_ALIAS("SJIS", "Shift_JIS")
-# ENC_REPLICATE("Windows-31J", "Shift_JIS")
-# ENC_ALIAS("CP932", "Windows-31J")
-#
-
-def check_duplication(defs, name, fn, line)
- if defs[name]
- raise ArgumentError, "%s:%d: encoding %s is already registered(%s:%d)" %
- [fn, line, name, *defs[name]]
- else
- defs[name.upcase] = [fn,line]
- end
-end
-
-count = 0
-lines = []
-encodings = []
-defs = {}
-encdirs = ARGV.dup
-encdirs << 'enc' if encdirs.empty?
-files = {}
-encdirs.each do |encdir|
- next unless File.directory?(encdir)
- Dir.open(encdir) {|d| d.grep(/.+\.[ch]\z/)}.sort_by {|e|
- e.scan(/(\d+)|(\D+)/).map {|n,a| a||[n.size,n.to_i]}.flatten
- }.each do |fn|
- next if files[fn]
- files[fn] = true
- open(File.join(encdir,fn)) do |f|
- orig = nil
- name = nil
- f.each_line do |line|
- if (/^OnigEncodingDefine/ =~ line)..(/"(.*?)"/ =~ line)
- if $1
- check_duplication(defs, $1, fn, $.)
- encodings << $1
- count += 1
- end
- else
- case line
- when /^\s*rb_enc_register\(\s*"([^"]+)"/
- count += 1
- line = nil
- when /^ENC_REPLICATE\(\s*"([^"]+)"\s*,\s*"([^"]+)"/
- raise ArgumentError,
- '%s:%d: ENC_REPLICATE: %s is not defined yet. (replica %s)' %
- [fn, $., $2, $1] unless defs[$2.upcase]
- count += 1
- when /^ENC_ALIAS\(\s*"([^"]+)"\s*,\s*"([^"]+)"/
- raise ArgumentError,
- '%s:%d: ENC_ALIAS: %s is not defined yet. (alias %s)' %
- [fn, $., $2, $1] unless defs[$2.upcase]
- when /^ENC_DUMMY\(\s*"([^"]+)"/
- count += 1
- else
- next
- end
- check_duplication(defs, $1, fn, $.)
- lines << line.sub(/;.*/m, "").chomp + ";" if line
- end
- end
- end
- end
-end
-encodings.each do |e|
-%>ENC_DEFINE("<%=e%>");
-% end
-% lines.each do |line|
-<%=line%>
-% end
-
-#define ENCODING_COUNT <%=count%>
diff --git a/template/fake.rb.in b/template/fake.rb.in
deleted file mode 100644
index ed9416a16f..0000000000
--- a/template/fake.rb.in
+++ /dev/null
@@ -1,15 +0,0 @@
-class Object
- CROSS_COMPILING = RUBY_PLATFORM
- remove_const :RUBY_PLATFORM
- remove_const :RUBY_VERSION
- remove_const :RUBY_DESCRIPTION if defined?(RUBY_DESCRIPTION)
- RUBY_PLATFORM = "@arch@"
- RUBY_VERSION = "@MAJOR@.@MINOR@.@TEENY@"
- RUBY_DESCRIPTION = "ruby #{RUBY_VERSION} (#{Time.now.strftime("%Y-%m-%d")}) [#{RUBY_PLATFORM}]"
-end
-if RUBY_PLATFORM =~ /mswin|bccwin|mingw/
- class File
- remove_const :ALT_SEPARATOR
- ALT_SEPARATOR = "\\"
- end
-end
diff --git a/template/id.h.tmpl b/template/id.h.tmpl
deleted file mode 100644
index fccb5cf059..0000000000
--- a/template/id.h.tmpl
+++ /dev/null
@@ -1,134 +0,0 @@
-%# -*- c -*-
-/* DO NOT EDIT THIS FILE DIRECTLY */
-/**********************************************************************
-
- id.h -
-
- $Author$
- created at: Sun Oct 19 21:12:51 2008
-
- Copyright (C) 2007 Koichi Sasada
-
-**********************************************************************/
-<%
-require 'optparse'
-vpath = ["."]
-input = nil
-opt = OptionParser.new do |o|
- o.on('-v', '--vpath=DIR') {|dirs| vpath.concat dirs.split(File::PATH_SEPARATOR)}
- input, = o.order!(ARGV)
-end or abort opt.opt_s
-
-tokens = nil
-vpath.find do |dir|
- begin
- if line = File.read(File.join(dir, input))[/^\s*enum\s+yytokentype\s*\{([^{}]*)\s*\};/m, 1]
- tokens = line.scan(/\b(t(?:LAST_TOKEN|U(?:PLUS|MINUS)|POW|CMP|EQQ?|[NGL]EQ|(?:AND|OR)OP|N?MATCH|DOT\d|AREF|ASET|[LR]SHFT|LAMBDA)|id\w+)\s*=\s*(\d+),?/m)
- end
- rescue Errno::ENOENT
- nil
- else
- true
- end
-end
-%>
-#ifndef RUBY_ID_H
-#define RUBY_ID_H
-
-#define ID_SCOPE_SHIFT 3
-#define ID_SCOPE_MASK 0x07
-#define ID_LOCAL 0x00
-#define ID_INSTANCE 0x01
-#define ID_GLOBAL 0x03
-#define ID_ATTRSET 0x04
-#define ID_CONST 0x05
-#define ID_CLASS 0x06
-#define ID_JUNK 0x07
-#define ID_INTERNAL ID_JUNK
-
-#ifdef USE_PARSE_H
-#include "parse.h"
-#endif
-
-#define symIFUNC ID2SYM(idIFUNC)
-#define symCFUNC ID2SYM(idCFUNC)
-
-#if !defined tLAST_TOKEN && defined YYTOKENTYPE
-#define tLAST_TOKEN tLAST_TOKEN
-#endif
-
-enum ruby_method_ids {
-#ifndef tLAST_TOKEN
-% tokens.each do |token, value|
- <%=token%> = <%=value%>,
-% end
-#endif
- idDot2 = tDOT2,
- idDot3 = tDOT3,
- idUPlus = tUPLUS,
- idUMinus = tUMINUS,
- idPow = tPOW,
- idCmp = tCMP,
- idPLUS = '+',
- idMINUS = '-',
- idMULT = '*',
- idDIV = '/',
- idMOD = '%',
- idLT = '<',
- idLTLT = tLSHFT,
- idLE = tLEQ,
- idGT = '>',
- idGE = tGEQ,
- idEq = tEQ,
- idEqq = tEQQ,
- idNeq = tNEQ,
- idNot = '!',
- idBackquote = '`',
- idEqTilde = tMATCH,
- idNeqTilde = tNMATCH,
- idAREF = tAREF,
- idASET = tASET,
- idLAST_TOKEN = tLAST_TOKEN >> ID_SCOPE_SHIFT,
- tIntern,
- tMethodMissing,
- tLength,
- tGets,
- tSucc,
- tEach,
- tLambda,
- tSend,
- t__send__,
- tInitialize,
-#if SUPPORT_JOKE
- tBitblt,
- tAnswer,
-#endif
- tLAST_ID,
-#define TOKEN2ID(n) id##n = ((t##n<<ID_SCOPE_SHIFT)|ID_LOCAL)
-#if SUPPORT_JOKE
- TOKEN2ID(Bitblt),
- TOKEN2ID(Answer),
-#endif
- TOKEN2ID(Intern),
- TOKEN2ID(MethodMissing),
- TOKEN2ID(Length),
- TOKEN2ID(Gets),
- TOKEN2ID(Succ),
- TOKEN2ID(Each),
- TOKEN2ID(Lambda),
- TOKEN2ID(Send),
- TOKEN2ID(__send__),
- TOKEN2ID(Initialize)
-};
-
-#ifdef tLAST_TOKEN
-struct ruby_method_ids_check {
-#define ruby_method_id_check_for(name, value) \
- int checking_for_##name[name == value ? 1 : -1]
-% tokens.map do |token, value|
-ruby_method_id_check_for(<%=token%>, <%=value%>);
-% end
-};
-#endif
-
-#endif /* RUBY_ID_H */
diff --git a/template/insns.inc.tmpl b/template/insns.inc.tmpl
deleted file mode 100644
index 6543686003..0000000000
--- a/template/insns.inc.tmpl
+++ /dev/null
@@ -1,20 +0,0 @@
-/** -*-c-*-
- This file contains YARV instructions list.
-
- ----
- This file is auto generated by insns2vm.rb
- DO NOT TOUCH!
-
- If you want to fix something, you must edit 'template/insns.inc.tmpl'
- or insns2vm.rb
- */
-
-
-/* BIN : Basic Instruction Name */
-#define BIN(n) YARVINSN_##n
-
-enum ruby_vminsn_type {
-<%= insns %>
- VM_INSTRUCTION_SIZE = <%= @insns.size %>
-};
-
diff --git a/template/insns_info.inc.tmpl b/template/insns_info.inc.tmpl
deleted file mode 100644
index 1093e10d0a..0000000000
--- a/template/insns_info.inc.tmpl
+++ /dev/null
@@ -1,95 +0,0 @@
-/** -*-c-*-
- This file contains instruction information for yarv instruction sequence.
-
- ----
- This file is auto generated by insns2vm.rb
- DO NOT TOUCH!
-
- If you want to fix something, you must edit 'template/insns_info.inc.tmpl'
- or insns2vm.rb
- */
-
-<%= insn_type_chars %>
-
-static const char *const insn_name_info[] = {
-<%= insn_names %>
-};
-
-static const char *const insn_operand_info[] = {
-<%= operands_info %>
-};
-
-static const int insn_len_info[] = {
-<%= operands_num_info %>
-};
-
-static const int insn_iclen_info[] = {
-<%= icoperands_num_info %>
-};
-
-#ifdef USE_INSN_RET_NUM
-static const int insn_stack_push_num_info[] = {
-<%= stack_num_info %>
-};
-#endif
-
-#ifdef USE_INSN_STACK_INCREASE
-static int
-insn_stack_increase(int depth, int insn, VALUE *opes)
-{
- switch(insn){
-<%= stack_increase %>
- default:
- rb_bug("insn_sp_increase: unreachable");
- }
- return 0;
-}
-#endif
-
-/* some utilities */
-
-static int
-insn_len(int insn)
-{
- return insn_len_info[insn];
-}
-
-static const char *
-insn_name(int insn)
-{
- return insn_name_info[insn];
-}
-
-static const char *
-insn_op_types(int insn)
-{
- return insn_operand_info[insn];
-}
-
-static int
-insn_op_type(int insn, int pos)
-{
- int len = insn_len(insn) - 1;
- if(pos < len){
- return insn_operand_info[insn][pos];
- }
- else{
- return 0;
- }
-}
-
-#ifdef USE_INSN_RET_NUM
-static int
-insn_ret_num(int insn)
-{
- return insn_stack_push_num_info[insn];
-}
-#endif
-
-#ifdef USE_INSN_ICLEN
-static int
-insn_iclen(int insn)
-{
- return insn_iclen_info[insn];
-}
-#endif
diff --git a/template/known_errors.inc.tmpl b/template/known_errors.inc.tmpl
deleted file mode 100644
index c62114464f..0000000000
--- a/template/known_errors.inc.tmpl
+++ /dev/null
@@ -1,14 +0,0 @@
-/** -*-c-*-
- * DO NOT EDIT
- * This file is automatically generated by tools/generic_erb.rb from
- * template/known_errors.inc.tmpl and defs/known_errors.def.
- */
-
-% error_names = ARGF.read.split(/\s+/)
-% error_names.each do |name|
-#ifdef <%=name%>
- set_syserr(<%=name%>, "<%=name%>");
-#else
- set_syserr(0, "<%=name%>");
-#endif
-% end
diff --git a/template/minsns.inc.tmpl b/template/minsns.inc.tmpl
deleted file mode 100644
index b9e037e978..0000000000
--- a/template/minsns.inc.tmpl
+++ /dev/null
@@ -1,14 +0,0 @@
-/** -*-c-*-
- This file contains YARV instructions list, to define YARVCore::Instructions.
-
- ----
- This file is auto generated by insns2vm.rb
- DO NOT TOUCH!
-
- If you want to fix something, you must edit 'template/minsns.inc.tmpl'
- or insns2vm.rb
- */
-
-<%= defs %>
-
-
diff --git a/template/opt_sc.inc.tmpl b/template/opt_sc.inc.tmpl
deleted file mode 100644
index 7d7ce717dc..0000000000
--- a/template/opt_sc.inc.tmpl
+++ /dev/null
@@ -1,32 +0,0 @@
-/* -*-c-*- *********************************************************/
-/*******************************************************************/
-/*******************************************************************/
-/**
- This file is for threaded code.
-
- ----
- This file is auto generated by insns2vm.rb
- DO NOT TOUCH!
-
- If you want to fix something, you must edit 'template/opt_sc.inc.tmpl'
- or rb/insns2vm.rb
- */
-
-#define SC_STATE_SIZE 6
-
-#define SCS_XX 1
-#define SCS_AX 2
-#define SCS_BX 3
-#define SCS_AB 4
-#define SCS_BA 5
-
-#define SC_ERROR 0xffffffff
-
-static const VALUE sc_insn_info[][SC_STATE_SIZE] = {
-<%= sc_insn_info %>
-};
-
-static const VALUE sc_insn_next[] = {
-<%= sc_insn_next %>
-};
-
diff --git a/template/optinsn.inc.tmpl b/template/optinsn.inc.tmpl
deleted file mode 100644
index b4b4b6b05a..0000000000
--- a/template/optinsn.inc.tmpl
+++ /dev/null
@@ -1,30 +0,0 @@
-/* -*-c-*- *********************************************************/
-/*******************************************************************/
-/*******************************************************************/
-/**
- This file is for threaded code.
-
- ----
- This file is auto generated by insns2vm.rb
- DO NOT TOUCH!
-
- If you want to fix something, you must edit 'template/optinsn.inc.tmpl'
- or rb/insns2vm.rb
- */
-
-static INSN *
-insn_operands_unification(INSN *insnobj){
-#ifdef OPT_OPERANDS_UNIFICATION
- /* optimize rule */
- switch(insnobj->insn_id){
-
-<%= rule %>
-
- default:
- /* do nothing */;
- break;
- }
-#endif
- return insnobj;
-}
-
diff --git a/template/optunifs.inc.tmpl b/template/optunifs.inc.tmpl
deleted file mode 100644
index 61364a3bd4..0000000000
--- a/template/optunifs.inc.tmpl
+++ /dev/null
@@ -1,35 +0,0 @@
-/* -*-c-*- *********************************************************/
-/*******************************************************************/
-/*******************************************************************/
-/**
- This file is for threaded code.
-
- ----
- This file is auto generated by insns2vm.rb
- DO NOT TOUCH!
-
- If you want to fix something, you must edit 'template/optunifs.inc.tmpl'
- or rb/insns2vm.rb
- */
-
-/*
- static const int UNIFIED_insn_name_1[] = {id, size, ...};
- static const int UNIFIED_insn_name_2[] = {id, size, ...};
- ...
-
- static const int *const UNIFIED_insn_name[] = {size,
- UNIFIED_insn_name_1,
- UNIFIED_insn_name_2, ...};
- ...
-
- static const int *const *const unified_insns_data[] = {
- UNIFIED_insn_nameA,
- UNIFIED_insn_nameB, ...};
- */
-
-<%= unif_insns_each %>
-<%= unif_insns %>
-<%= unif_insns_data %>
-
-#undef GET_INSN_NAME
-
diff --git a/template/transdb.h.tmpl b/template/transdb.h.tmpl
deleted file mode 100644
index d0cf101344..0000000000
--- a/template/transdb.h.tmpl
+++ /dev/null
@@ -1,59 +0,0 @@
-<%
-#
-# static const rb_transcoder
-# rb_from_US_ASCII = {
-# "US-ASCII", "UTF-8", &from_US_ASCII, 1, 0,
-# NULL, NULL,
-# };
-#
-
-count = 0
-converters = {}
-transdirs = ARGV.dup
-transdirs << 'enc/trans' if transdirs.empty?
-
-transdirs = transdirs.sort_by {|td|
- -td.length
-}.inject([]) {|tds, td|
- next tds unless File.directory?(td)
- tds << td if tds.all? {|td2| !File.identical?(td2, td) }
- tds
-}
-
-files = {}
-names_t = []
-converter_list = []
-transdirs.each do |transdir|
- names = Dir.entries(transdir)
- names_t += names.map {|n| /(?!\A)\.trans\z/ =~ n ? $` : nil }.compact
- names_c = names.map {|n| /(?!\A)\.c\z/ =~ n ? $` : nil }.compact
- (names_t & names_c).map {|n|
- "#{n}.c"
- }.sort_by {|e|
- e.scan(/(\d+)|(\D+)/).map {|n,a| a||[n.size,n.to_i]}.flatten
- }.each do |fn|
- next if files[fn]
- files[fn] = true
- path = File.join(transdir,fn)
- open(path) do |f|
- f.each_line do |line|
- if (/^static const rb_transcoder/ =~ line)..(/"(.*?)"\s*,\s*"(.*?)"/ =~ line)
- if $1 && $2
- from_to = "%s to %s" % [$1, $2]
- if converters[from_to]
- raise ArgumentError, '%s:%d: transcode "%s" is already registered at %s:%d' %
- [path, $., from_to, *converters[from_to].values_at(3, 4)]
- else
- converters[from_to] = [$1, $2, fn[0..-3], path, $.]
- converter_list << from_to
- end
- end
- end
- end
- end
- end
-end
-converter_list.each do |from_to|
- from, to, fn = *converters[from_to]
-%>rb_declare_transcoder("<%=from%>", "<%=to%>", "<%=fn%>");
-% end
diff --git a/template/vm.inc.tmpl b/template/vm.inc.tmpl
deleted file mode 100644
index c21b3a83eb..0000000000
--- a/template/vm.inc.tmpl
+++ /dev/null
@@ -1,29 +0,0 @@
-/* -*-c-*- *********************************************************/
-/*******************************************************************/
-/*******************************************************************/
-/**
- This file is VM main loop.
-
- ----
- This file is auto generated by insns2vm.rb
- DO NOT TOUCH!
-
- If you want to fix something, you must edit 'insns.c'
- */
-
-<%=
-line = 15
-vm_body.gsub(/\n|__CURRENT_LINE__|__CURRENT_FILE__/){
- e = $&
- case e
- when '__CURRENT_LINE__'
- line.to_s
- when '__CURRENT_FILE__'
- "vm.inc"
- else
- line += 1
- e
- end
-}
-%>
-
diff --git a/template/vmtc.inc.tmpl b/template/vmtc.inc.tmpl
deleted file mode 100644
index 5f1f51a08b..0000000000
--- a/template/vmtc.inc.tmpl
+++ /dev/null
@@ -1,18 +0,0 @@
-/* -*-c-*- *********************************************************/
-/*******************************************************************/
-/*******************************************************************/
-/**
- This file is for threaded code.
-
- ----
- This file is auto generated by insns2vm.rb
- DO NOT TOUCH!
-
- If you want to fix something, you must edit 'template/vmtc.inc.tmpl'
- or insns2vm.rb
- */
-
-static const void *const insns_address_table[] = {
-<%= insns_table %>
-};
-
diff --git a/template/yarvarch.en b/template/yarvarch.en
deleted file mode 100644
index 7a76e25b7e..0000000000
--- a/template/yarvarch.en
+++ /dev/null
@@ -1,7 +0,0 @@
-#title YARV: Yet another RubyVM - Software Architecture
-
-maybe writing.
-
-* YARV instruction set
-
-<%= d %>
diff --git a/template/yarvarch.ja b/template/yarvarch.ja
deleted file mode 100644
index c332c20811..0000000000
--- a/template/yarvarch.ja
+++ /dev/null
@@ -1,454 +0,0 @@
-#title YARVA[LeN`
-#set author { Ruby ̉
-
-
-- 2005-03-03(Thu) 00:31:12 +0900 낢Ə
-
-----
-
-* ́H
-
-[[YARV: Yet Another RubyVM|http://www.atdot.net/yarv]] ݌vłB
-
-
-YARV ́ARuby vÔ߂̎̋@\񋟂܂B
-
-- Compiler
-- VM Generator
-- VM (Virtual Machine)
-- Assembler
-- Dis-Assembler
-- (experimental) JIT Compiler
-- (experimental) AOT Compiler
-
-
-݂ YARV Ruby C^v^̊gCuƂĎĂ܂B
-ɂARuby C^v^̕Kvȋ@\ip[TAIuWFNgǗA
-̊gCujȂǂقڂ̂܂ܗpł܂B
-
-A‚̃pb` Ruby C^v^ɓĂȂ΂Ȃ܂B
-
-́ARuby {̂̃C^v^ieval.cju邱Ƃڎw
-Jp\łB
-
-
-* Compiler (compile.h, compile.c)
-
-RpĆARuby C^v^̃p[TɂĐꂽ\؁iRNode
-f[^ɂ؁j YARV ߗɕϊ܂BYARV ߂ɂ‚Ă͌q
-B
-
-ƂɓƂ͂Ă܂񂪁AXR[vȂǂ̊JnɃ[Jϐ̏
-ȂǂsAƂ͍\؂HϊĂ܂B
-
-ϊ Ruby Array IuWFNg YARV ߃IuWFNgAуIy
-hi[ĂAŌɎsł`ɕϊ܂BRpCł́AR
-pCɐ郁̈̊ǗɂȂ邱Ƃ܂AYARV
-̏ꍇARuby C^v^ׂĖʓ|݂Ă̂ł͔̕Ɋy
-ɍ邱Ƃł܂iK[x[WRN^ɂĎIɃǗ
-Ă邽߁jB
-
-YARV ߂́A߂ʎqAIyhȂǁAׂ 1 word i}V
-\ł鎩RȒlBC ł̓|C^̃TCYBRuby C^v^p
- VALUE ̃TCYjŕ\܂B̂߁AYARV ߂͂uoCg
-R[hvł͂܂B̂߁AYARV ̐Ȃǂł́uߗvƂp
-gĂ܂B
-
-1 word ł邽߁A̗p͑Ȃ܂AANZXx
-ǂlƁA{ԂƍlĂ܂BƂ΃IyhR
-X^gv[Ɋi[ACfbNX݂̂IyhŎƂ”\
-AԐڃANZXɂȂĂ܂̂Ő\ɉeo邽߁Ap܂B
-
-
-* VM Generator (rb/insns2vm.rb, insns.def)
-
-rb/insns2vm.rb ƂXNvǵAinsns.def Ƃt@Cǂݍ݁A
-VM ̂߂ɕKvȃt@C𐶐܂B̓Iɂ́A߂s镔
-܂AقɂRpCɕKvȏAœKɕKvȏAAZ
-uAtAZuɕKvȏt@C܂B
-
-
-** ߋLq
-
-insns.def ɂ́Ae߂ǂ̂悤Ȗ߂ł邩Lq܂B̓Iɂ͎
-̏Lq܂B
-
-- ߂̖O
-- ̖߂̃JeSARgipA{j
-- Iyh̖O
-- ̖ߎsOɃX^bN|bvl
-- ̖ߎsɃX^bNɃvbVl
-- ̖߂̃WbNiC ŋLqj
-
-Ƃ΁AX^bN self putself Ƃ߂͎̂悤ɋLq
-B
-
-#code
-/**
- @c put
- @e put self.
- @j self uB
- */
-DEFINE_INSN
-putself
-()
-()
-(VALUE val)
-{
- val = GET_SELF();
-}
-#end
-
-̏ꍇAIyhƁAX^bN|bvl͖ƂɂȂ܂B
-ߏIAself X^bNgbvɒu킯łA val ƂA
-X^bNɃvbVlƂĐ錾ĂϐɑĂƂŁA
-ϊƃX^bNgbvɒu C vO܂B
-
-ׂtH[}bg insns.def ̖`QƂĂBȂɓ
-ȂƎv܂B
-
-insnhelper.h Ƃt@CɁA߃WbNLq邽߂ɕKvȃ}N
-`Ă܂B܂AVM ̓\Ɋւ` vm.h Ƃt@C
-ɂ܂B
-
-
-* VM (Virtual Machine, vm.h, vm.c)
-
-VM ́AۂɃRpCʐ YARV ߗs܂B܂
-ɁA̕ YARV ̃LɂȂAIɂ eval.c VM Œu
-ƍlĂ܂B
-
-݂ Ruby C^v^Ŏsł邷ׂĂ̂ƂA VM Ŏł
-悤ɍĂ܂iiKł͂܂Sł͂܂񂪁AȂׂłjB
-
-VM ́APȃX^bN}VƂĎĂ܂BXbhЂƂ‚ɃX^b
-NЂƂ‚ێ܂BX^bN̗̈̓q[v擾̂ŁA_ȗ̈
-ݒ肪”\łB
-
-
-** WX^
-
-VM 5 ‚̉zIȃWX^ɂĐ䂳܂B
-
-- PC (Program Counter)
-- SP (Stack Pointer)
-- CFP (Control Frame Pointer)
-- LFP (Local Frame Pointer)
-- DFP (Dynamic Frame Pointer)
-
-PC ͌ݎs̖ߗ̈ʒu܂BSP ̓X^bNgbv̈ʒu
-܂BCFPALFPADFP ͂ꂼt[̏܂Bڍׂ͌q܂B
-
-
-** X^bNt[
-
-obsolete (update soon)
-
-
-** t[fUCɂ‚Ă̕⑫
-
-Lisp ̏nȂǂ񂪂ƁA킴킴ubN[Jt[ƃ\
-bh[Jt[̂悤Ȃ̂pӂ̂͊قɌ邩܂B
-t[Aq\ɂāA[Jϐ̃ANZX͂̓qO
-ɒHΕKǂ蒅Ƃł邩łi‚܂Alfp ͕KvȂjB
-
-ARuby ł͂‚󋵂Ⴂ܂B܂A\bh[Jȏ
-邱ƁA̓Iɂ̓ubNselficallee ݂ recieverjłB
-̏ꂼ̃t[ɂ͖̂ʂłB
-
-܂ARuby2.0 ̓ubN[Jϐ͂ȂȂ܂iubN[J
-͎ĉŁA\̂͂܂ς܂jB̂߁A\bh[J
-ϐւ̃ANZXp邱Ƃ\z܂B
-
-̂ƂA\bh[Jϐւ̃ANZX̂тɃt[iXR[vj
-Xgǂ͖̂ʂłƔfAIɃ\bh[JXR[v
-ubNt[𕪗AubNt[̓\bh[Jt[
- lfpWX^ɂėeՂɃANZXł悤ɂ܂B
-
-
-** \bhĂяoɂ‚
-
-\bhĂяóAYARV ߗŋLqꂽ\bhAC ŋLqꂽ
-\bhɂăfBXpb`@ς܂B
-
-YARV ߗłꍇAqX^bNt[쐬Ė߂p
-܂BƂ VM ̊֐ċAĂяo邱Ƃ͍sȂ܂B
-
-C ŋLqꂽ\bhꍇAPɂ̊֐Ăяo܂iA
-obNg[X𐳂邽߂Ƀ\bhĂяȍtĂ
-sȂ܂jB
-
-̂߁AVM pX^bNʓrpӂ̂́AvOɂĂ̓}V
-X^bNg؂Ă܂”\܂iC -> Ruby -> C -> ... Ƃ
-ĂяoꍇjB́A݂ł͔ȂdlƂȂĂ܂B
-
-
-** O
-
-ÓAJava JVM ƓlɗOe[upӂ邱ƂŎ܂BO
-AYt[AOe[u܂BŁAO
-Ƃ PC ̒lɍvGgꍇÃGgɏ]
-삵܂BGg‚ȂꍇAX^bNT߂Ă܂
-lɂ̃XR[v̗Oe[u܂B
-
-܂AbreakAreturniubNjAretry Ȃǂl̎dg݂Ŏ܂B
-
-*** Oe[u
-
-Oe[uGg͋̓Iɂ͎̏񂪊i[Ă܂B
-
-- ΏۂƂ PC ͈̔
-- ΏۂƂO̎
-- ΏۂƂȂƂɃWviނɂj
-- ΏۂƂȂƂɋNubN iseq
-
-
-*** rescue
-
-rescue ߂̓ubNƂĎĂ܂B$! ̒lB̈ƂĎ
-B
-
-#code
-begin
-rescue A
-rescue B
-rescue C
-end
-#end
-
-́Â悤 Ruby XNvgɕϊ܂B
-
-#code
-{|err|
- case err
- when A === err
- when B === err
- when C === err
- else
- raise # yarv ̖߂ł throw
- end
-}
-#end
-
-
-*** ensure
-
-niOȂꍇjƈُniOƂȂǁj2
-ނ̖ߗ񂪐܂Bnł́A̘AR[ḧƂăR
-pC܂B܂Aُnł̓ubNƂĎ܂BŌ͕K
-throw ߂Œ߂邱ƂɂȂ܂B
-
-
-*** break, returniubNjAretry
-
-break AubN return Aretry throw ߂ƂăRpC
-܂Bǂ܂Ŗ߂邩́Abreak tbNOe[ũGg
-f܂B
-
-
-** 萔̌
-
-萔ƂOȂ̂ɁARuby ł̓RpCɌ肵܂BƂA
-‚܂łĒ`”\ɂȂĂ܂B
-
-萔ANZX̂߂RubyLq͎̂悤ɂȂ܂B
-
-#code
-Ruby\:
-expr::ID::...::ID
-#end
-
-́Ayarv߃Zbgł͎̂悤ɂȂ܂B
-
-#code
-(expr)
-getconstant ID
-...
-getconstant ID
-#end
-
-
-*** 萔pX
-
- expr nil ꍇA萔pXɏ]Ē萔܂B
-͍ Ruby 2.0 ɌĕύXꍇ܂B
-
-+ NXAW[̓IlXg֌WivO̎ʏj[g܂ŒH
-+ p֌W[giObjectj܂ŒH
-
-̂߁ANXAW[̓IlXg֌WۑȂ΂Ȃ܂B
-̂߂ɁAthread_object ɂ klass_nest_stack Ƃ̂pӂ܂B
-́Ã݂lXg̏ۑ܂B
-
-\bh`Ǎ݂̃lXg\bh`Ɂidupāj
-ƂŁÃ\bh̎sÃlXgQƂ邱Ƃ”\ɂȂ
-B
-
-gbvxł́Ȁ͂ȂƂɂȂ܂B
-
-NX/W[`śȀ݂񂻂̂̂QƂ邱ƂɂȂ
-܂B́ANXXR[v˓ȀNX`ɃRs[܂
-iłɃRs[Ă΁As܂jB
-
-ɂAIȃlXg𓝈IɈƂł܂B
-
-
-** œK@
-
-YARV ł͍ړIƂĂ̂ŁA܂܂ȍœK@𗘗pĂ
-Bڍׂ͊܂AȉɏqׂœKȂǂsȂĂ܂B
-
-
-*** threaded code
-
-GCC C głlƂẴx𗘗p direct threaded code
-Ă܂B
-
-
-*** Peephole optimization
-
-‚̊ȒPȍœKĂ܂B
-
-
-*** inline method cache
-
-ߗ̒Ƀ\bhʂ𖄂ߍ݂܂B
-
-
-*** inline constant cache
-
-ߗ̒ɒ萔ʂ𖄂ߍ݂܂B
-
-
-*** ubN Proc IuWFNg̕
-
-ubNt\bhĂяosȂꂽƂɂ͂ɂ̓ubN Proc
-IuWFNgƂĐ܂BɂAKvȂ Proc IuWFNg
-}Ă܂B
-
-Proc \bh́AۂɕKvɂȂ_ōÂƂɊ‹iXR[
-vɊmۂꂽϐȂǁjq[vɕۑ܂B
-
-
-***
-
-Fixnum m̉ZȂǂ𐳒Ɋ֐ĂяoɂčsȂƁARXg
-̂ŁÃv~eBuȑsȂ߂̃\bhĂяo͐p
-߂pӂ܂B
-
-
-*** ߗZ
-
-̖߂ 1 ߂ɕϊ܂BZ߂ opt_insn_unif.def ̋Lqɂ
-莩Iɐ܂B
-
-
-*** IyhZ
-
-̃Iyh܂߂߂𐶐܂BZ߂ opt_operand.def
-LqɂĎIɐ܂B
-
-
-*** stack caching
-
-X^bNgbvzWX^ɕێ悤ɂ܂B݂ 2 ‚̉z
-WX^z肵A5Ԃ̃X^bNLbVOsȂ܂BX^bNLb
-VO閽߂͎Iɐ܂B
-
-
-*** JIT Compile
-
-@B؂\肵܂BɎIȃR[ĥĂ܂B
-Ƃǂ̃vO͓܂B
-
-
-*** AOT Compile
-
-YARV ߗ C ɕϊ܂B܂\ȍœKsȂĂ܂񂪁A
-Ȃɓ܂Brb/aotc.rb RpCłB
-
-
-* Assembler (rb/yasm.rb)
-
-YARV ߗ̃AZupӂ܂Bg rb/yasm.rb QƂĂ
-i܂AᎦĂ鐶@ׂ̂ĂT|[gĂ킯ł͂
-܂jB
-
-
-* Dis-Assembler (disasm.c)
-
-YARV ߗIuWFNg YARVCore::InstructionSequence ɂ disasm
-\bh܂B́AߗtAZuԂ܂B
-
-
-* YARV ߃Zbg
-
-<%= d %>
-
-* ̑
-
-** eXg
-
-test/test_* eXgP[XłBꉞA~XȂ͂łBtɂƁA
-̃eXgɋLqĂł͂Ɠ삷ƂƂłB
-
-
-** x`}[N
-
-benchmark/bm_* Ƀx`}[NvOĂ܂B
-
-
-** ̗\
-
-܂܂Ȃ΂ȂƁA񂠂܂ł
-Ȃ΂Ȃ܂Bԑ傫ȖڕW eval.c u邱Ƃł傤
-B
-
-
-*** Verifier
-
-YARV ߗ́A~XĂĂ܂ߊ댯ł”\
-B̂߁AX^bN̗pԂƎOɌ؂悤ȃxt@C
-ApӂȂ΂ȂȂƍlĂ܂B
-
-
-*** Compiled File ̍\z
-
-Ruby vO̖߃ZbgɃVACYf[^\t@C
-o͂ł悤ɂƍlĂ܂B𗘗pĈxRpC
-ߗt@CɕۑĂ΁A񃍁[hɂ̓RpC̎ԁARXg
-ȂƂł܂B
-
-
-**** S̍\
-
-̂悤ȃt@C\lĂ܂A܂łB
-
-#code
-u4 : 4 byte unsigned storage
-u2 : 2 byte unsigned storage
-u1 : 1 byte unsigned storage
-
-every storages are little endian :-)
-
-CompiledFile{
- u4 magic;
-
- u2 major;
- u2 minor;
-
- u4 character_code;
-
- u4 constants_pool_count;
- ConstantEntry constants_pool[constants_pool_count];
-
- u4 block_count;
- blockEntry blocks[block_count];
-
- u4 method_count;
- MethodEntry methods[method_count];
-}
-#end
-
-Java classfile ̃pNB
-
diff --git a/template/yasmdata.rb.tmpl b/template/yasmdata.rb.tmpl
deleted file mode 100644
index a11df0a712..0000000000
--- a/template/yasmdata.rb.tmpl
+++ /dev/null
@@ -1,20 +0,0 @@
-# -*-ruby-*-
-#
-
-class VM
- class InstructionSequence
- class Instruction
- InsnID2NO = {
-<%= insn_id2no %>
- }
-
- def self.id2insn_no id
- if InsnID2NO.has_key? id
- InsnID2NO[id]
- end
- end
- end
- end
-end
-
-
diff --git a/test/base64/test_base64.rb b/test/base64/test_base64.rb
deleted file mode 100644
index 9ae54cb405..0000000000
--- a/test/base64/test_base64.rb
+++ /dev/null
@@ -1,99 +0,0 @@
-require "test/unit"
-require "base64"
-
-class TestBase64 < Test::Unit::TestCase
- def test_sample
- assert_equal("U2VuZCByZWluZm9yY2VtZW50cw==\n", Base64.encode64('Send reinforcements'))
- assert_equal('Send reinforcements', Base64.decode64("U2VuZCByZWluZm9yY2VtZW50cw==\n"))
- assert_equal(
- "Tm93IGlzIHRoZSB0aW1lIGZvciBhbGwgZ29vZCBjb2RlcnMKdG8gbGVhcm4g\nUnVieQ==\n",
- Base64.encode64("Now is the time for all good coders\nto learn Ruby"))
- assert_equal(
- "Now is the time for all good coders\nto learn Ruby",
- Base64.decode64("Tm93IGlzIHRoZSB0aW1lIGZvciBhbGwgZ29vZCBjb2RlcnMKdG8gbGVhcm4g\nUnVieQ==\n"))
- assert_equal(
- "VGhpcyBpcyBsaW5lIG9uZQpUaGlzIGlzIGxpbmUgdHdvClRoaXMgaXMgbGlu\nZSB0aHJlZQpBbmQgc28gb24uLi4K\n",
- Base64.encode64("This is line one\nThis is line two\nThis is line three\nAnd so on...\n"))
- assert_equal(
- "This is line one\nThis is line two\nThis is line three\nAnd so on...\n",
- Base64.decode64("VGhpcyBpcyBsaW5lIG9uZQpUaGlzIGlzIGxpbmUgdHdvClRoaXMgaXMgbGluZSB0aHJlZQpBbmQgc28gb24uLi4K"))
- end
-
- def test_encode64
- assert_equal("", Base64.encode64(""))
- assert_equal("AA==\n", Base64.encode64("\0"))
- assert_equal("AAA=\n", Base64.encode64("\0\0"))
- assert_equal("AAAA\n", Base64.encode64("\0\0\0"))
- assert_equal("/w==\n", Base64.encode64("\377"))
- assert_equal("//8=\n", Base64.encode64("\377\377"))
- assert_equal("////\n", Base64.encode64("\377\377\377"))
- assert_equal("/+8=\n", Base64.encode64("\xff\xef"))
- end
-
- def test_decode64
- assert_equal("", Base64.decode64(""))
- assert_equal("\0", Base64.decode64("AA==\n"))
- assert_equal("\0\0", Base64.decode64("AAA=\n"))
- assert_equal("\0\0\0", Base64.decode64("AAAA\n"))
- assert_equal("\377", Base64.decode64("/w==\n"))
- assert_equal("\377\377", Base64.decode64("//8=\n"))
- assert_equal("\377\377\377", Base64.decode64("////\n"))
- assert_equal("\xff\xef", Base64.decode64("/+8=\n"))
- end
-
- def test_strict_encode64
- assert_equal("", Base64.strict_encode64(""))
- assert_equal("AA==", Base64.strict_encode64("\0"))
- assert_equal("AAA=", Base64.strict_encode64("\0\0"))
- assert_equal("AAAA", Base64.strict_encode64("\0\0\0"))
- assert_equal("/w==", Base64.strict_encode64("\377"))
- assert_equal("//8=", Base64.strict_encode64("\377\377"))
- assert_equal("////", Base64.strict_encode64("\377\377\377"))
- assert_equal("/+8=", Base64.strict_encode64("\xff\xef"))
- end
-
- def test_strict_decode64
- assert_equal("", Base64.strict_decode64(""))
- assert_equal("\0", Base64.strict_decode64("AA=="))
- assert_equal("\0\0", Base64.strict_decode64("AAA="))
- assert_equal("\0\0\0", Base64.strict_decode64("AAAA"))
- assert_equal("\377", Base64.strict_decode64("/w=="))
- assert_equal("\377\377", Base64.strict_decode64("//8="))
- assert_equal("\377\377\377", Base64.strict_decode64("////"))
- assert_equal("\xff\xef", Base64.strict_decode64("/+8="))
-
- assert_raise(ArgumentError) { Base64.strict_decode64("^") }
- assert_raise(ArgumentError) { Base64.strict_decode64("A") }
- assert_raise(ArgumentError) { Base64.strict_decode64("A^") }
- assert_raise(ArgumentError) { Base64.strict_decode64("AA") }
- assert_raise(ArgumentError) { Base64.strict_decode64("AA=") }
- assert_raise(ArgumentError) { Base64.strict_decode64("AA===") }
- assert_raise(ArgumentError) { Base64.strict_decode64("AA=x") }
- assert_raise(ArgumentError) { Base64.strict_decode64("AAA") }
- assert_raise(ArgumentError) { Base64.strict_decode64("AAA^") }
- assert_raise(ArgumentError) { Base64.strict_decode64("AB==") }
- assert_raise(ArgumentError) { Base64.strict_decode64("AAB=") }
- end
-
- def test_urlsafe_encode64
- assert_equal("", Base64.urlsafe_encode64(""))
- assert_equal("AA==", Base64.urlsafe_encode64("\0"))
- assert_equal("AAA=", Base64.urlsafe_encode64("\0\0"))
- assert_equal("AAAA", Base64.urlsafe_encode64("\0\0\0"))
- assert_equal("_w==", Base64.urlsafe_encode64("\377"))
- assert_equal("__8=", Base64.urlsafe_encode64("\377\377"))
- assert_equal("____", Base64.urlsafe_encode64("\377\377\377"))
- assert_equal("_-8=", Base64.urlsafe_encode64("\xff\xef"))
- end
-
- def test_urlsafe_decode64
- assert_equal("", Base64.urlsafe_decode64(""))
- assert_equal("\0", Base64.urlsafe_decode64("AA=="))
- assert_equal("\0\0", Base64.urlsafe_decode64("AAA="))
- assert_equal("\0\0\0", Base64.urlsafe_decode64("AAAA"))
- assert_equal("\377", Base64.urlsafe_decode64("_w=="))
- assert_equal("\377\377", Base64.urlsafe_decode64("__8="))
- assert_equal("\377\377\377", Base64.urlsafe_decode64("____"))
- assert_equal("\xff\xef", Base64.urlsafe_decode64("_+8="))
- end
-end
diff --git a/test/bigdecimal/test_bigdecimal.rb b/test/bigdecimal/test_bigdecimal.rb
deleted file mode 100644
index 7eecc1ade1..0000000000
--- a/test/bigdecimal/test_bigdecimal.rb
+++ /dev/null
@@ -1,694 +0,0 @@
-require "test/unit"
-require "bigdecimal"
-
-class TestBigDecimal < Test::Unit::TestCase
- def setup
- BigDecimal.mode(BigDecimal::EXCEPTION_ALL, true)
- BigDecimal.mode(BigDecimal::EXCEPTION_UNDERFLOW, true)
- BigDecimal.mode(BigDecimal::EXCEPTION_OVERFLOW, true)
- BigDecimal.mode(BigDecimal::ROUND_MODE, BigDecimal::ROUND_HALF_UP)
- BigDecimal.limit(0)
- end
-
- def test_version
- assert_equal("1.0.1", BigDecimal.ver)
- end
-
- def test_global_new
- assert_equal(1, BigDecimal("1"))
- assert_equal(1, BigDecimal("1", 1))
- assert_raise(ArgumentError) { BigDecimal("1", -1) }
- end
-
- def test_new
- assert_equal(1, BigDecimal.new("1"))
- assert_equal(1, BigDecimal.new("1", 1))
- assert_equal(1, BigDecimal.new(" 1 "))
- assert_equal(111, BigDecimal.new("1_1_1_"))
- assert_equal(0, BigDecimal.new("_1_1_1"))
-
- BigDecimal.mode(BigDecimal::EXCEPTION_OVERFLOW, false)
- BigDecimal.mode(BigDecimal::EXCEPTION_NaN, false)
- assert_equal( 1, BigDecimal.new("Infinity").infinite?)
- assert_equal(-1, BigDecimal.new("-Infinity").infinite?)
- assert_equal(true, BigDecimal.new("NaN").nan?)
- end
-
- def _test_mode(type)
- BigDecimal.mode(type, true)
- assert_raise(FloatDomainError) { yield }
-
- BigDecimal.mode(type, false)
- assert_nothing_raised { yield }
- end
-
- def test_mode
- assert_raise(TypeError) { BigDecimal.mode(BigDecimal::EXCEPTION_ALL, 1) }
- assert_raise(TypeError) { BigDecimal.mode(BigDecimal::ROUND_MODE, 256) }
- assert_raise(TypeError) { BigDecimal.mode(0xf000, true) }
- end
-
- def test_exception_nan
- _test_mode(BigDecimal::EXCEPTION_NaN) { BigDecimal.new("NaN") }
- end
-
- def test_exception_infinity
- _test_mode(BigDecimal::EXCEPTION_INFINITY) { BigDecimal.new("Infinity") }
- end
-
- def test_exception_underflow
- _test_mode(BigDecimal::EXCEPTION_UNDERFLOW) do
- x = BigDecimal.new("0.1")
- 100.times do
- x *= x
- break if x == false
- end
- end
- end
-
- def test_exception_overflow
- _test_mode(BigDecimal::EXCEPTION_OVERFLOW) do
- x = BigDecimal.new("10")
- 100.times do
- x *= x
- break if x == false
- end
- end
- end
-
- def test_exception_zerodivide
- BigDecimal.mode(BigDecimal::EXCEPTION_OVERFLOW, false)
- _test_mode(BigDecimal::EXCEPTION_ZERODIVIDE) { 1 / BigDecimal.new("0") }
- _test_mode(BigDecimal::EXCEPTION_ZERODIVIDE) { -1 / BigDecimal.new("0") }
- end
-
- def test_round_up
- n4 = BigDecimal.new("4") # n4 / 9 = 0.44444...
- n5 = BigDecimal.new("5") # n5 / 9 = 0.55555...
- n6 = BigDecimal.new("6") # n6 / 9 = 0.66666...
- m4, m5, m6 = -n4, -n5, -n6
- n2h = BigDecimal.new("2.5")
- n3h = BigDecimal.new("3.5")
- m2h, m3h = -n2h, -n3h
-
- BigDecimal.mode(BigDecimal::ROUND_MODE, BigDecimal::ROUND_UP)
- assert_operator(n4, :<, n4 / 9 * 9)
- assert_operator(n5, :<, n5 / 9 * 9)
- assert_operator(n6, :<, n6 / 9 * 9)
- assert_operator(m4, :>, m4 / 9 * 9)
- assert_operator(m5, :>, m5 / 9 * 9)
- assert_operator(m6, :>, m6 / 9 * 9)
- assert_equal(3, n2h.round)
- assert_equal(4, n3h.round)
- assert_equal(-3, m2h.round)
- assert_equal(-4, m3h.round)
-
- BigDecimal.mode(BigDecimal::ROUND_MODE, BigDecimal::ROUND_DOWN)
- assert_operator(n4, :>, n4 / 9 * 9)
- assert_operator(n5, :>, n5 / 9 * 9)
- assert_operator(n6, :>, n6 / 9 * 9)
- assert_operator(m4, :<, m4 / 9 * 9)
- assert_operator(m5, :<, m5 / 9 * 9)
- assert_operator(m6, :<, m6 / 9 * 9)
- assert_equal(2, n2h.round)
- assert_equal(3, n3h.round)
- assert_equal(-2, m2h.round)
- assert_equal(-3, m3h.round)
-
- BigDecimal.mode(BigDecimal::ROUND_MODE, BigDecimal::ROUND_HALF_UP)
- assert_operator(n4, :>, n4 / 9 * 9)
- assert_operator(n5, :<, n5 / 9 * 9)
- assert_operator(n6, :<, n6 / 9 * 9)
- assert_operator(m4, :<, m4 / 9 * 9)
- assert_operator(m5, :>, m5 / 9 * 9)
- assert_operator(m6, :>, m6 / 9 * 9)
- assert_equal(3, n2h.round)
- assert_equal(4, n3h.round)
- assert_equal(-3, m2h.round)
- assert_equal(-4, m3h.round)
-
- BigDecimal.mode(BigDecimal::ROUND_MODE, BigDecimal::ROUND_HALF_DOWN)
- assert_operator(n4, :>, n4 / 9 * 9)
- assert_operator(n5, :>, n5 / 9 * 9)
- assert_operator(n6, :<, n6 / 9 * 9)
- assert_operator(m4, :<, m4 / 9 * 9)
- assert_operator(m5, :<, m5 / 9 * 9)
- assert_operator(m6, :>, m6 / 9 * 9)
- assert_equal(2, n2h.round)
- assert_equal(3, n3h.round)
- assert_equal(-2, m2h.round)
- assert_equal(-3, m3h.round)
-
- BigDecimal.mode(BigDecimal::ROUND_MODE, BigDecimal::ROUND_HALF_EVEN)
- assert_operator(n4, :>, n4 / 9 * 9)
- assert_operator(n5, :<, n5 / 9 * 9)
- assert_operator(n6, :<, n6 / 9 * 9)
- assert_operator(m4, :<, m4 / 9 * 9)
- assert_operator(m5, :>, m5 / 9 * 9)
- assert_operator(m6, :>, m6 / 9 * 9)
- assert_equal(2, n2h.round)
- assert_equal(4, n3h.round)
- assert_equal(-2, m2h.round)
- assert_equal(-4, m3h.round)
-
- BigDecimal.mode(BigDecimal::ROUND_MODE, BigDecimal::ROUND_CEILING)
- assert_operator(n4, :<, n4 / 9 * 9)
- assert_operator(n5, :<, n5 / 9 * 9)
- assert_operator(n6, :<, n6 / 9 * 9)
- assert_operator(m4, :<, m4 / 9 * 9)
- assert_operator(m5, :<, m5 / 9 * 9)
- assert_operator(m6, :<, m6 / 9 * 9)
- assert_equal(3, n2h.round)
- assert_equal(4, n3h.round)
- assert_equal(-2, m2h.round)
- assert_equal(-3, m3h.round)
-
- BigDecimal.mode(BigDecimal::ROUND_MODE, BigDecimal::ROUND_FLOOR)
- assert_operator(n4, :>, n4 / 9 * 9)
- assert_operator(n5, :>, n5 / 9 * 9)
- assert_operator(n6, :>, n6 / 9 * 9)
- assert_operator(m4, :>, m4 / 9 * 9)
- assert_operator(m5, :>, m5 / 9 * 9)
- assert_operator(m6, :>, m6 / 9 * 9)
- assert_equal(2, n2h.round)
- assert_equal(3, n3h.round)
- assert_equal(-3, m2h.round)
- assert_equal(-4, m3h.round)
- end
-
- def test_zero_p
- assert_equal(true, BigDecimal.new("0").zero?)
- assert_equal(false, BigDecimal.new("1").zero?)
- end
-
- def test_nonzero_p
- assert_equal(nil, BigDecimal.new("0").nonzero?)
- assert_equal(BigDecimal.new("1"), BigDecimal.new("1").nonzero?)
- end
-
- def test_double_fig
- assert_kind_of(Integer, BigDecimal.double_fig)
- end
-
- def test_cmp
- n1 = BigDecimal.new("1")
- n2 = BigDecimal.new("2")
- assert_equal( 0, n1 <=> n1)
- assert_equal( 1, n2 <=> n1)
- assert_equal(-1, n1 <=> n2)
- assert_operator(n1, :==, n1)
- assert_operator(n1, :!=, n2)
- assert_operator(n1, :<, n2)
- assert_operator(n1, :<=, n1)
- assert_operator(n1, :<=, n2)
- assert_operator(n2, :>, n1)
- assert_operator(n2, :>=, n1)
- assert_operator(n1, :>=, n1)
-
- assert_operator(BigDecimal.new("-0"), :==, BigDecimal.new("0"))
- assert_operator(BigDecimal.new("0"), :<, BigDecimal.new("1"))
- assert_operator(BigDecimal.new("1"), :>, BigDecimal.new("0"))
- assert_operator(BigDecimal.new("1"), :>, BigDecimal.new("-1"))
- assert_operator(BigDecimal.new("-1"), :<, BigDecimal.new("1"))
- assert_operator(BigDecimal.new((2**100).to_s), :>, BigDecimal.new("1"))
- assert_operator(BigDecimal.new("1"), :<, BigDecimal.new((2**100).to_s))
-
- BigDecimal.mode(BigDecimal::EXCEPTION_OVERFLOW, false)
- inf = BigDecimal.new("Infinity")
- assert_operator(inf, :>, 1)
- assert_operator(1, :<, inf)
- end
-
- def test_cmp_corece
- n1 = BigDecimal.new("1")
- n2 = BigDecimal.new("2")
- o1 = Object.new; def o1.coerce(x); [x, BigDecimal.new("1")]; end
- o2 = Object.new; def o2.coerce(x); [x, BigDecimal.new("2")]; end
- assert_equal( 0, n1 <=> o1)
- assert_equal( 1, n2 <=> o1)
- assert_equal(-1, n1 <=> o2)
- assert_operator(n1, :==, o1)
- assert_operator(n1, :!=, o2)
- assert_operator(n1, :<, o2)
- assert_operator(n1, :<=, o1)
- assert_operator(n1, :<=, o2)
- assert_operator(n2, :>, o1)
- assert_operator(n2, :>=, o1)
- assert_operator(n1, :>=, 1)
- end
-
- def test_cmp_bignum
- assert_operator(BigDecimal.new((2**100).to_s), :==, 2**100)
- end
-
- def test_cmp_data
- d = Time.now; def d.coerce(x); [x, x]; end
- assert_operator(BigDecimal.new((2**100).to_s), :==, d)
- end
-
- def test_precs
- a = BigDecimal.new("1").precs
- assert_instance_of(Array, a)
- assert_equal(2, a.size)
- assert_kind_of(Integer, a[0])
- assert_kind_of(Integer, a[1])
- end
-
- def test_hash
- a = []
- b = BigDecimal.new("1")
- 10.times { a << b *= 10 }
- h = {}
- a.each_with_index {|x, i| h[x] = i }
- a.each_with_index do |x, i|
- assert_equal(i, h[x])
- end
- end
-
- def test_marshal
- s = Marshal.dump(BigDecimal("1", 1))
- assert_equal(BigDecimal("1", 1), Marshal.load(s))
-
- # corrupt data
- s = s.gsub(/BigDecimal.*\z/m) {|x| x.gsub(/\d/m, "-") }
- assert_raise(TypeError) { Marshal.load(s) }
- end
-
- def test_finite_infinite_nan
- BigDecimal.mode(BigDecimal::EXCEPTION_OVERFLOW, false)
- BigDecimal.mode(BigDecimal::EXCEPTION_ZERODIVIDE, false)
-
- x = BigDecimal.new("0")
- assert_equal(true, x.finite?)
- assert_equal(nil, x.infinite?)
- assert_equal(false, x.nan?)
- y = 1 / x
- assert_equal(false, y.finite?)
- assert_equal(1, y.infinite?)
- assert_equal(false, y.nan?)
- y = -1 / x
- assert_equal(false, y.finite?)
- assert_equal(-1, y.infinite?)
- assert_equal(false, y.nan?)
-
- BigDecimal.mode(BigDecimal::EXCEPTION_NaN, false)
- y = 0 / x
- assert_equal(false, y.finite?)
- assert_equal(nil, y.infinite?)
- assert_equal(true, y.nan?)
- end
-
- def test_to_i
- BigDecimal.mode(BigDecimal::EXCEPTION_OVERFLOW, false)
- BigDecimal.mode(BigDecimal::EXCEPTION_NaN, false)
-
- x = BigDecimal.new("0")
- assert_kind_of(Integer, x.to_i)
- assert_equal(0, x.to_i)
- assert_raise(FloatDomainError){( 1 / x).to_i}
- assert_raise(FloatDomainError){(-1 / x).to_i}
- assert_raise(FloatDomainError) {( 0 / x).to_i}
- x = BigDecimal.new("1")
- assert_equal(1, x.to_i)
- x = BigDecimal.new((2**100).to_s)
- assert_equal(2**100, x.to_i)
- end
-
- def test_to_f
- BigDecimal.mode(BigDecimal::EXCEPTION_OVERFLOW, false)
- BigDecimal.mode(BigDecimal::EXCEPTION_NaN, false)
- BigDecimal.mode(BigDecimal::EXCEPTION_ZERODIVIDE, false)
-
- x = BigDecimal.new("0")
- assert_instance_of(Float, x.to_f)
- assert_equal(0.0, x.to_f)
- assert_equal( 1.0 / 0.0, ( 1 / x).to_f)
- assert_equal(-1.0 / 0.0, (-1 / x).to_f)
- assert_equal(true, ( 0 / x).to_f.nan?)
- x = BigDecimal.new("1")
- assert_equal(1.0, x.to_f)
- x = BigDecimal.new((2**100).to_s)
- assert_equal((2**100).to_f, x.to_f)
- x = BigDecimal.new("1" + "0" * 10000)
- assert_equal(0, BigDecimal.new("-0").to_f)
-
- BigDecimal.mode(BigDecimal::EXCEPTION_OVERFLOW, true)
- assert_raise(FloatDomainError) { x.to_f }
- BigDecimal.mode(BigDecimal::EXCEPTION_OVERFLOW, false)
- assert_kind_of(Float, x .to_f)
- assert_kind_of(Float, (-x).to_f)
- end
-
- def test_coerce
- a, b = BigDecimal.new("1").coerce(1.0)
- assert_instance_of(Float, a)
- assert_instance_of(Float, b)
- end
-
- def test_uplus
- x = BigDecimal.new("1")
- assert_equal(x, x.send(:+@))
- end
-
- def test_add
- x = BigDecimal.new("1")
- assert_equal(BigDecimal.new("2"), x + x)
- assert_equal(1, BigDecimal.new("0") + 1)
- assert_equal(1, x + 0)
-
- assert_equal(BigDecimal::SIGN_POSITIVE_ZERO, (BigDecimal.new("0") + 0).sign)
- assert_equal(BigDecimal::SIGN_POSITIVE_ZERO, (BigDecimal.new("-0") + 0).sign)
- assert_equal(BigDecimal::SIGN_NEGATIVE_ZERO, (BigDecimal.new("-0") + BigDecimal.new("-0")).sign)
-
- x = BigDecimal.new((2**100).to_s)
- assert_equal(BigDecimal.new((2**100+1).to_s), x + 1)
- end
-
- def test_sub
- x = BigDecimal.new("1")
- assert_equal(BigDecimal.new("0"), x - x)
- assert_equal(-1, BigDecimal.new("0") - 1)
- assert_equal(1, x - 0)
-
- assert_equal(BigDecimal::SIGN_POSITIVE_ZERO, (BigDecimal.new("0") - 0).sign)
- assert_equal(BigDecimal::SIGN_NEGATIVE_ZERO, (BigDecimal.new("-0") - 0).sign)
- assert_equal(BigDecimal::SIGN_POSITIVE_ZERO, (BigDecimal.new("-0") - BigDecimal.new("-0")).sign)
-
- x = BigDecimal.new((2**100).to_s)
- assert_equal(BigDecimal.new((2**100-1).to_s), x - 1)
- end
-
- def test_mult
- x = BigDecimal.new((2**100).to_s)
- assert_equal(BigDecimal.new((2**100 * 3).to_s), (x * 3).to_i)
- assert_equal(x, (x * 1).to_i)
- assert_equal(x, (BigDecimal("1") * x).to_i)
- assert_equal(BigDecimal.new((2**200).to_s), (x * x).to_i)
- end
-
- def test_div
- x = BigDecimal.new((2**100).to_s)
- assert_equal(BigDecimal.new((2**100 / 3).to_s), (x / 3).to_i)
- assert_equal(BigDecimal::SIGN_POSITIVE_ZERO, (BigDecimal.new("0") / 1).sign)
- assert_equal(BigDecimal::SIGN_NEGATIVE_ZERO, (BigDecimal.new("-0") / 1).sign)
- assert_equal(2, BigDecimal.new("2") / 1)
- assert_equal(-2, BigDecimal.new("2") / -1)
- end
-
- def test_mod
- x = BigDecimal.new((2**100).to_s)
- assert_equal(1, x % 3)
- assert_equal(2, (-x) % 3)
- assert_equal(-2, x % -3)
- assert_equal(-1, (-x) % -3)
- end
-
- def test_remainder
- x = BigDecimal.new((2**100).to_s)
- assert_equal(1, x.remainder(3))
- assert_equal(-1, (-x).remainder(3))
- assert_equal(1, x.remainder(-3))
- assert_equal(-1, (-x).remainder(-3))
- end
-
- def test_divmod
- x = BigDecimal.new((2**100).to_s)
- assert_equal([(x / 3).floor, 1], x.divmod(3))
- assert_equal([(-x / 3).floor, 2], (-x).divmod(3))
-
- assert_equal([0, 0], BigDecimal.new("0").divmod(2))
-
- BigDecimal.mode(BigDecimal::EXCEPTION_NaN, false)
- assert_raise(ZeroDivisionError){BigDecimal.new("0").divmod(0)}
- end
-
- def test_add_bigdecimal
- x = BigDecimal.new((2**100).to_s)
- assert_equal(3000000000000000000000000000000, x.add(x, 1))
- assert_equal(2500000000000000000000000000000, x.add(x, 2))
- assert_equal(2540000000000000000000000000000, x.add(x, 3))
- end
-
- def test_sub_bigdecimal
- x = BigDecimal.new((2**100).to_s)
- assert_equal(1000000000000000000000000000000, x.sub(1, 1))
- assert_equal(1300000000000000000000000000000, x.sub(1, 2))
- assert_equal(1270000000000000000000000000000, x.sub(1, 3))
- end
-
- def test_mult_bigdecimal
- x = BigDecimal.new((2**100).to_s)
- assert_equal(4000000000000000000000000000000, x.mult(3, 1))
- assert_equal(3800000000000000000000000000000, x.mult(3, 2))
- assert_equal(3800000000000000000000000000000, x.mult(3, 3))
- end
-
- def test_div_bigdecimal
- x = BigDecimal.new((2**100).to_s)
- assert_equal(422550200076076467165567735125, x.div(3))
- assert_equal(400000000000000000000000000000, x.div(3, 1))
- assert_equal(420000000000000000000000000000, x.div(3, 2))
- assert_equal(423000000000000000000000000000, x.div(3, 3))
- end
-
- def test_abs_bigdecimal
- x = BigDecimal.new((2**100).to_s)
- assert_equal(1267650600228229401496703205376, x.abs)
- x = BigDecimal.new("-" + (2**100).to_s)
- assert_equal(1267650600228229401496703205376, x.abs)
- x = BigDecimal.new("0")
- assert_equal(0, x.abs)
- BigDecimal.mode(BigDecimal::EXCEPTION_NaN, false)
- x = BigDecimal.new("NaN")
- assert_equal(true, x.abs.nan?)
- end
-
- def test_sqrt_bigdecimal
- x = BigDecimal.new("0.09")
- assert_in_delta(0.3, x.sqrt(1), 0.001)
- x = BigDecimal.new((2**100).to_s)
- y = BigDecimal("1125899906842624")
- e = y.exponent
- assert_equal(true, (x.sqrt(100) - y).abs < BigDecimal("1E#{e-100}"))
- assert_equal(true, (x.sqrt(200) - y).abs < BigDecimal("1E#{e-200}"))
- assert_equal(true, (x.sqrt(300) - y).abs < BigDecimal("1E#{e-300}"))
- x = BigDecimal.new("-" + (2**100).to_s)
- assert_raise(FloatDomainError) { x.sqrt(1) }
- x = BigDecimal.new((2**200).to_s)
- assert_equal(2**100, x.sqrt(1))
-
- BigDecimal.mode(BigDecimal::EXCEPTION_OVERFLOW, false)
- BigDecimal.mode(BigDecimal::EXCEPTION_NaN, false)
- assert_raise(FloatDomainError) { BigDecimal.new("NaN").sqrt(1) }
-
- assert_equal(0, BigDecimal.new("0").sqrt(1))
- assert_equal(1, BigDecimal.new("1").sqrt(1))
- end
-
- def test_fix
- x = BigDecimal.new("1.1")
- assert_equal(1, x.fix)
- end
-
- def test_frac
- x = BigDecimal.new("1.1")
- assert_equal(0.1, x.frac)
- assert_equal(0.1, BigDecimal.new("0.1").frac)
- BigDecimal.mode(BigDecimal::EXCEPTION_NaN, false)
- assert_equal(true, BigDecimal.new("NaN").frac.nan?)
- end
-
- def test_round
- assert_equal(3, BigDecimal.new("3.14159").round)
- assert_equal(9, BigDecimal.new("8.7").round)
- assert_equal(3.142, BigDecimal.new("3.14159").round(3))
- assert_equal(13300.0, BigDecimal.new("13345.234").round(-2))
-
- x = BigDecimal.new("111.111")
- assert_equal(111 , x.round)
- assert_equal(111.1 , x.round(1))
- assert_equal(111.11 , x.round(2))
- assert_equal(111.111, x.round(3))
- assert_equal(111.111, x.round(4))
- assert_equal(110 , x.round(-1))
- assert_equal(100 , x.round(-2))
- assert_equal( 0 , x.round(-3))
- assert_equal( 0 , x.round(-4))
-
- x = BigDecimal.new("2.5")
- assert_equal(3, x.round(0, BigDecimal::ROUND_UP))
- assert_equal(2, x.round(0, BigDecimal::ROUND_DOWN))
- assert_equal(3, x.round(0, BigDecimal::ROUND_HALF_UP))
- assert_equal(2, x.round(0, BigDecimal::ROUND_HALF_DOWN))
- assert_equal(2, x.round(0, BigDecimal::ROUND_HALF_EVEN))
- assert_equal(3, x.round(0, BigDecimal::ROUND_CEILING))
- assert_equal(2, x.round(0, BigDecimal::ROUND_FLOOR))
- assert_raise(TypeError) { x.round(0, 256) }
- end
-
- def test_truncate
- assert_equal(3, BigDecimal.new("3.14159").truncate)
- assert_equal(8, BigDecimal.new("8.7").truncate)
- assert_equal(3.141, BigDecimal.new("3.14159").truncate(3))
- assert_equal(13300.0, BigDecimal.new("13345.234").truncate(-2))
- end
-
- def test_floor
- assert_equal(3, BigDecimal.new("3.14159").floor)
- assert_equal(-10, BigDecimal.new("-9.1").floor)
- assert_equal(3.141, BigDecimal.new("3.14159").floor(3))
- assert_equal(13300.0, BigDecimal.new("13345.234").floor(-2))
- end
-
- def test_ceil
- assert_equal(4, BigDecimal.new("3.14159").ceil)
- assert_equal(-9, BigDecimal.new("-9.1").ceil)
- assert_equal(3.142, BigDecimal.new("3.14159").ceil(3))
- assert_equal(13400.0, BigDecimal.new("13345.234").ceil(-2))
- end
-
- def test_to_s
- assert_equal('-123.45678 90123 45678 9', BigDecimal.new('-123.45678901234567890').to_s('5F'))
- assert_equal('+123.45678901 23456789', BigDecimal.new('123.45678901234567890').to_s('+8F'))
- assert_equal(' 123.4567890123456789', BigDecimal.new('123.45678901234567890').to_s(' F'))
- assert_equal('0.1234567890123456789E3', BigDecimal.new('123.45678901234567890').to_s)
- assert_equal('0.12345 67890 12345 6789E3', BigDecimal.new('123.45678901234567890').to_s(5))
- end
-
- def test_split
- x = BigDecimal.new('-123.45678901234567890')
- assert_equal([-1, "1234567890123456789", 10, 3], x.split)
- assert_equal([1, "0", 10, 0], BigDecimal.new("0").split)
- assert_equal([-1, "0", 10, 0], BigDecimal.new("-0").split)
-
- BigDecimal.mode(BigDecimal::EXCEPTION_OVERFLOW, false)
- BigDecimal.mode(BigDecimal::EXCEPTION_NaN, false)
- assert_equal([0, "NaN", 10, 0], BigDecimal.new("NaN").split)
- assert_equal([1, "Infinity", 10, 0], BigDecimal.new("Infinity").split)
- assert_equal([-1, "Infinity", 10, 0], BigDecimal.new("-Infinity").split)
- end
-
- def test_exponent
- x = BigDecimal.new('-123.45678901234567890')
- assert_equal(3, x.exponent)
- end
-
- def test_inspect
- x = BigDecimal.new("1234.5678")
- prec, maxprec = x.precs
- assert_match(/^#<BigDecimal:[0-9a-f]+,'0.12345678E4',#{prec}\(#{maxprec}\)>$/, x.inspect)
- end
-
- def test_power
- x = BigDecimal.new("3")
- assert_equal(81, x ** 4)
- assert_equal(1.0/81, x ** -4)
- assert_equal(1, x ** 0)
- assert_raise(TypeError) { x ** x }
- assert_equal(0, BigDecimal.new("0") ** 4)
- assert_equal(1, BigDecimal.new("0") ** 0)
- BigDecimal.mode(BigDecimal::EXCEPTION_OVERFLOW, false)
- assert_equal(BigDecimal.new("Infinity"), BigDecimal.new("0") ** -1)
- assert_equal(BigDecimal.new("-Infinity"), BigDecimal.new("-0") ** -1)
- BigDecimal.mode(BigDecimal::EXCEPTION_NaN, false)
- assert_equal(true, (BigDecimal.new("NaN") ** 1).nan?)
-
- assert_equal(BigDecimal::SIGN_POSITIVE_INFINITE, (BigDecimal.new("Infinity") ** 2).sign)
- assert_equal(BigDecimal::SIGN_POSITIVE_INFINITE, (BigDecimal.new("Infinity") ** 1).sign)
- assert_equal(1, BigDecimal.new("Infinity") ** 0)
- assert_equal(BigDecimal::SIGN_POSITIVE_ZERO, (BigDecimal.new("Infinity") ** -1).sign)
- assert_equal(BigDecimal::SIGN_POSITIVE_ZERO, (BigDecimal.new("Infinity") ** -2).sign)
-
- assert_equal(BigDecimal::SIGN_POSITIVE_INFINITE, (BigDecimal.new("-Infinity") ** 2).sign)
- assert_equal(BigDecimal::SIGN_NEGATIVE_INFINITE, (BigDecimal.new("-Infinity") ** 1).sign)
- assert_equal(1, BigDecimal.new("-Infinity") ** 0)
- assert_equal(BigDecimal::SIGN_NEGATIVE_ZERO, (BigDecimal.new("-Infinity") ** -1).sign)
- assert_equal(BigDecimal::SIGN_POSITIVE_ZERO, (BigDecimal.new("-Infinity") ** -2).sign)
- end
-
- def test_limit
- BigDecimal.limit(1)
- x = BigDecimal.new("3")
- assert_equal(90, x ** 4) # OK? must it be 80?
- # 3 * 3 * 3 * 3 = 10 * 3 * 3 = 30 * 3 = 90 ???
- assert_raise(ArgumentError) { BigDecimal.limit(-1) }
- end
-
- def test_sign
- BigDecimal.mode(BigDecimal::EXCEPTION_OVERFLOW, false)
- BigDecimal.mode(BigDecimal::EXCEPTION_NaN, false)
- BigDecimal.mode(BigDecimal::EXCEPTION_ZERODIVIDE, false)
-
- assert_equal(BigDecimal::SIGN_POSITIVE_ZERO, BigDecimal.new("0").sign)
- assert_equal(BigDecimal::SIGN_NEGATIVE_ZERO, BigDecimal.new("-0").sign)
- assert_equal(BigDecimal::SIGN_POSITIVE_FINITE, BigDecimal.new("1").sign)
- assert_equal(BigDecimal::SIGN_NEGATIVE_FINITE, BigDecimal.new("-1").sign)
- assert_equal(BigDecimal::SIGN_POSITIVE_INFINITE, (BigDecimal.new("1") / 0).sign)
- assert_equal(BigDecimal::SIGN_NEGATIVE_INFINITE, (BigDecimal.new("-1") / 0).sign)
- assert_equal(BigDecimal::SIGN_NaN, (BigDecimal.new("0") / 0).sign)
- end
-
- def test_inf
- BigDecimal.mode(BigDecimal::EXCEPTION_OVERFLOW, false)
- BigDecimal.mode(BigDecimal::EXCEPTION_NaN, false)
- inf = BigDecimal.new("Infinity")
-
- assert_equal(inf, inf + inf)
- assert_equal(true, (inf + (-inf)).nan?)
- assert_equal(true, (inf - inf).nan?)
- assert_equal(inf, inf - (-inf))
- assert_equal(inf, inf * inf)
- assert_equal(true, (inf / inf).nan?)
-
- assert_equal(inf, inf + 1)
- assert_equal(inf, inf - 1)
- assert_equal(inf, inf * 1)
- assert_equal(true, (inf * 0).nan?)
- assert_equal(inf, inf / 1)
-
- assert_equal(inf, 1 + inf)
- assert_equal(-inf, 1 - inf)
- assert_equal(inf, 1 * inf)
- assert_equal(-inf, -1 * inf)
- assert_equal(true, (0 * inf).nan?)
- assert_equal(BigDecimal::SIGN_POSITIVE_ZERO, (1 / inf).sign)
- assert_equal(BigDecimal::SIGN_NEGATIVE_ZERO, (-1 / inf).sign)
- end
-
- def test_to_special_string
- BigDecimal.mode(BigDecimal::EXCEPTION_OVERFLOW, false)
- BigDecimal.mode(BigDecimal::EXCEPTION_NaN, false)
- nan = BigDecimal.new("NaN")
- assert_equal("NaN", nan.to_s)
- inf = BigDecimal.new("Infinity")
- assert_equal("Infinity", inf.to_s)
- assert_equal(" Infinity", inf.to_s(" "))
- assert_equal("+Infinity", inf.to_s("+"))
- assert_equal("-Infinity", (-inf).to_s)
- pzero = BigDecimal.new("0")
- assert_equal("0.0", pzero.to_s)
- assert_equal(" 0.0", pzero.to_s(" "))
- assert_equal("+0.0", pzero.to_s("+"))
- assert_equal("-0.0", (-pzero).to_s)
- end
-
- def test_to_string
- assert_equal("0.01", BigDecimal("0.01").to_s("F"))
- s = "0." + "0" * 100 + "1"
- assert_equal(s, BigDecimal(s).to_s("F"))
- s = "1" + "0" * 100 + ".0"
- assert_equal(s, BigDecimal(s).to_s("F"))
- end
-
- def test_ctov
- assert_equal(0.1, BigDecimal.new("1E-1"))
- assert_equal(10, BigDecimal.new("1E+1"))
- assert_equal(1, BigDecimal.new("+1"))
- BigDecimal.mode(BigDecimal::EXCEPTION_OVERFLOW, false)
-
- assert_equal(BigDecimal::SIGN_POSITIVE_INFINITE, BigDecimal.new("1E1" + "0" * 10000).sign)
- assert_equal(BigDecimal::SIGN_NEGATIVE_INFINITE, BigDecimal.new("-1E1" + "0" * 10000).sign)
- assert_equal(BigDecimal::SIGN_POSITIVE_ZERO, BigDecimal.new("1E-1" + "0" * 10000).sign)
- assert_equal(BigDecimal::SIGN_NEGATIVE_ZERO, BigDecimal.new("-1E-1" + "0" * 10000).sign)
- end
-end
diff --git a/test/cgi/test_cgi_cookie.rb b/test/cgi/test_cgi_cookie.rb
deleted file mode 100644
index f9950d1fb1..0000000000
--- a/test/cgi/test_cgi_cookie.rb
+++ /dev/null
@@ -1,107 +0,0 @@
-require 'test/unit'
-require 'cgi'
-require 'stringio'
-
-
-class CGICookieTest < Test::Unit::TestCase
-
-
- def setup
- ENV['REQUEST_METHOD'] = 'GET'
- end
-
- def teardown
- %W[REQUEST_METHOD SCRIPT_NAME].each do |name|
- ENV.delete(name)
- end
- end
-
-
- def test_cgi_cookie_new_simple
- cookie = CGI::Cookie.new('name1', 'val1', '&<>"', "\245\340\245\271\245\253")
- assert_equal('name1', cookie.name)
- assert_equal(['val1', '&<>"', "\245\340\245\271\245\253"], cookie.value)
- assert_nil(cookie.domain)
- assert_nil(cookie.expires)
- assert_equal('', cookie.path)
- assert_equal(false, cookie.secure)
- assert_equal("name1=val1&%26%3C%3E%22&%A5%E0%A5%B9%A5%AB; path=", cookie.to_s)
- end
-
-
- def test_cgi_cookie_new_complex
- t = Time.gm(2030, 12, 31, 23, 59, 59)
- value = ['val1', '&<>"', "\245\340\245\271\245\253"]
- cookie = CGI::Cookie.new('name'=>'name1',
- 'value'=>value,
- 'path'=>'/cgi-bin/myapp/',
- 'domain'=>'www.example.com',
- 'expires'=>t,
- 'secure'=>true
- )
- assert_equal('name1', cookie.name)
- assert_equal(value, cookie.value)
- assert_equal('www.example.com', cookie.domain)
- assert_equal(t, cookie.expires)
- assert_equal('/cgi-bin/myapp/', cookie.path)
- assert_equal(true, cookie.secure)
- assert_equal('name1=val1&%26%3C%3E%22&%A5%E0%A5%B9%A5%AB; domain=www.example.com; path=/cgi-bin/myapp/; expires=Tue, 31 Dec 2030 23:59:59 GMT; secure', cookie.to_s)
- end
-
-
- def test_cgi_cookie_scriptname
- cookie = CGI::Cookie.new('name1', 'value1')
- assert_equal('', cookie.path)
- cookie = CGI::Cookie.new('name'=>'name1', 'value'=>'value1')
- assert_equal('', cookie.path)
- ## when ENV['SCRIPT_NAME'] is set, cookie.path is set automatically
- ENV['SCRIPT_NAME'] = '/cgi-bin/app/example.cgi'
- cookie = CGI::Cookie.new('name1', 'value1')
- assert_equal('/cgi-bin/app/', cookie.path)
- cookie = CGI::Cookie.new('name'=>'name1', 'value'=>'value1')
- assert_equal('/cgi-bin/app/', cookie.path)
- end
-
-
- def test_cgi_cookie_parse
- ## ';' separator
- cookie_str = 'name1=val1&val2; name2=val2&%26%3C%3E%22;_session_id=12345'
- cookies = CGI::Cookie.parse(cookie_str)
- list = [
- ['name1', ['val1', 'val2']],
- ['name2', ['val2', '&<>"']],
- ['_session_id', ['12345']],
- ]
- list.each do |name, value|
- cookie = cookies[name]
- assert_equal(name, cookie.name)
- assert_equal(value, cookie.value)
- end
- ## ',' separator
- cookie_str = 'name1=val1&val2, name2=val2&%26%3C%3E%22,_session_id=12345'
- cookies = CGI::Cookie.parse(cookie_str)
- list.each do |name, value|
- cookie = cookies[name]
- assert_equal(name, cookie.name)
- assert_equal(value, cookie.value)
- end
- end
-
-
- def test_cgi_cookie_arrayinterface
- cookie = CGI::Cookie.new('name1', 'a', 'b', 'c')
- assert_equal('a', cookie[0])
- assert_equal('c', cookie[2])
- assert_nil(cookie[3])
- assert_equal('a', cookie.first)
- assert_equal('c', cookie.last)
- assert_equal(['A', 'B', 'C'], cookie.collect{|e| e.upcase})
- end
-
-
-
- instance_methods.each do |method|
- private method if method =~ /^test_(.*)/ && $1 != ENV['TEST']
- end if ENV['TEST']
-
-end
diff --git a/test/cgi/test_cgi_core.rb b/test/cgi/test_cgi_core.rb
deleted file mode 100644
index 3f75b04fd4..0000000000
--- a/test/cgi/test_cgi_core.rb
+++ /dev/null
@@ -1,363 +0,0 @@
-require 'test/unit'
-require 'cgi'
-require 'stringio'
-
-
-class CGICoreTest < Test::Unit::TestCase
-
-
- def setup
- #@environ = {
- # 'SERVER_PROTOCOL' => 'HTTP/1.1',
- # 'REQUEST_METHOD' => 'GET',
- # 'SERVER_SOFTWARE' => 'Apache 2.2.0',
- #}
- #ENV.update(@environ)
- end
-
-
- def teardown
- @environ.each do |key, val| ENV.delete(key) end
- $stdout = STDOUT
- end
-
- def test_cgi_parse_illegal_query
- @environ = {
- 'REQUEST_METHOD' => 'GET',
- 'QUERY_STRING' => 'a=111&&b=222&c&d=',
- 'HTTP_COOKIE' => '_session_id=12345; name1=val1&val2;',
- 'SERVER_SOFTWARE' => 'Apache 2.2.0',
- 'SERVER_PROTOCOL' => 'HTTP/1.1',
- }
- ENV.update(@environ)
- cgi = CGI.new
- assert_equal(["a","b","c","d"],cgi.keys.sort) if RUBY_VERSION>="1.9"
- assert_equal("",cgi["d"])
- end
-
- def test_cgi_core_params_GET
- @environ = {
- 'REQUEST_METHOD' => 'GET',
- 'QUERY_STRING' => 'id=123&id=456&id=&str=%40h+%3D%7E+%2F%5E%24%2F',
- 'HTTP_COOKIE' => '_session_id=12345; name1=val1&val2;',
- 'SERVER_SOFTWARE' => 'Apache 2.2.0',
- 'SERVER_PROTOCOL' => 'HTTP/1.1',
- }
- ENV.update(@environ)
- cgi = CGI.new
- ## cgi[]
- assert_equal('123', cgi['id'])
- assert_equal('@h =~ /^$/', cgi['str'])
- ## cgi[][], cgi[].first, cgi[].to_ary (obsolete 1.9)
- if RUBY_VERSION<"1.9"
- $stderr = StringIO.new
- begin
- assert_equal('123', cgi['id'][0])
- assert_equal('456', cgi['id'][1])
- assert_equal('', cgi['id'][2])
- assert_nil(cgi['id'][3])
- assert_equal('@h =~ /^$/', cgi['str'][0])
- assert_nil(cgi['str'][1])
- assert_equal('123', cgi['id'].first)
- assert_equal('123', cgi['id'].last) # should be '' ?
- id1, id2, id3 = cgi['id']
- assert_equal(['123', '456', ''], [id1, id2, id3])
- str1, = cgi['str']
- assert_equal('@h =~ /^$/', str1)
- assert_not_same(str1, cgi['str']) # necessary?
- ensure
- $stderr = STDERR
- end
- end
- ## cgi.params
- assert_equal(['123', '456', ''], cgi.params['id'])
- assert_equal(['@h =~ /^$/'], cgi.params['str'])
- ## cgi.keys
- assert_equal(['id', 'str'], cgi.keys.sort)
- ## cgi.key?, cgi.has_key?, cgi.include?
- assert_equal(true, cgi.key?('id'))
- assert_equal(true, cgi.has_key?('id'))
- assert_equal(true, cgi.include?('id'))
- assert_equal(false, cgi.key?('foo'))
- assert_equal(false, cgi.has_key?('foo'))
- assert_equal(false, cgi.include?('foo'))
- ## invalid parameter name
- assert_equal('', cgi['*notfound*']) # [ruby-dev:30740]
- assert_equal([], cgi.params['*notfound*'])
- end
-
-
- def test_cgi_core_params_POST
- query_str = 'id=123&id=456&id=&str=%40h+%3D%7E+%2F%5E%24%2F'
- @environ = {
- 'REQUEST_METHOD' => 'POST',
- 'CONTENT_LENGTH' => query_str.length.to_s,
- 'HTTP_COOKIE' => '_session_id=12345; name1=val1&val2;',
- 'SERVER_SOFTWARE' => 'Apache 2.2.0',
- 'SERVER_PROTOCOL' => 'HTTP/1.1',
- }
- ENV.update(@environ)
- $stdin = StringIO.new
- $stdin << query_str
- $stdin.rewind
- cgi = CGI.new
- ## cgi[]
- assert_equal('123', cgi['id'])
- assert_equal('@h =~ /^$/', cgi['str'])
- ## cgi.params
- assert_equal(['123', '456', ''], cgi.params['id'])
- assert_equal(['@h =~ /^$/'], cgi.params['str'])
- ## invalid parameter name
- assert_equal('', cgi['*notfound*'])
- assert_equal([], cgi.params['*notfound*'])
- end
-
- def test_cgi_core_params_encoding_check
- query_str = 'str=%BE%BE%B9%BE'
- @environ = {
- 'REQUEST_METHOD' => 'POST',
- 'CONTENT_LENGTH' => query_str.length.to_s,
- 'SERVER_SOFTWARE' => 'Apache 2.2.0',
- 'SERVER_PROTOCOL' => 'HTTP/1.1',
- }
- ENV.update(@environ)
- $stdin = StringIO.new
- $stdin << query_str
- $stdin.rewind
- if RUBY_VERSION>="1.9.0"
- hash={}
- cgi = CGI.new(:accept_charset=>"UTF-8"){|key,val|hash[key]=val}
- ## cgi[]
- assert_equal("\xBE\xBE\xB9\xBE".force_encoding("UTF-8"), cgi['str'])
- ## cgi.params
- assert_equal(["\xBE\xBE\xB9\xBE".force_encoding("UTF-8")], cgi.params['str'])
- ## accept-charset error
- assert_equal({"str"=>"\xBE\xBE\xB9\xBE".force_encoding("UTF-8")},hash)
-
- $stdin.rewind
- assert_raise(CGI::InvalidEncoding) do
- cgi = CGI.new(:accept_charset=>"UTF-8")
- end
-
- $stdin.rewind
- cgi = CGI.new(:accept_charset=>"EUC-JP")
- ## cgi[]
- assert_equal("\xBE\xBE\xB9\xBE".force_encoding("EUC-JP"), cgi['str'])
- ## cgi.params
- assert_equal(["\xBE\xBE\xB9\xBE".force_encoding("EUC-JP")], cgi.params['str'])
- else
- assert(true)
- end
- end
-
-
- def test_cgi_core_cookie
- @environ = {
- 'REQUEST_METHOD' => 'GET',
- 'QUERY_STRING' => 'id=123&id=456&id=&str=%40h+%3D%7E+%2F%5E%24%2F',
- 'HTTP_COOKIE' => '_session_id=12345; name1=val1&val2;',
- 'SERVER_SOFTWARE' => 'Apache 2.2.0',
- 'SERVER_PROTOCOL' => 'HTTP/1.1',
- }
- ENV.update(@environ)
- cgi = CGI.new
- assert_not_equal(nil,cgi.cookies)
- [ ['_session_id', ['12345'], ],
- ['name1', ['val1', 'val2'], ],
- ].each do |key, expected|
- cookie = cgi.cookies[key]
- assert_kind_of(CGI::Cookie, cookie)
- assert_equal(expected, cookie.value)
- assert_equal(false, cookie.secure)
- assert_nil(cookie.expires)
- assert_nil(cookie.domain)
- assert_equal('', cookie.path)
- end
- end
-
-
- def test_cgi_core_maxcontentlength
- @environ = {
- 'REQUEST_METHOD' => 'POST',
- 'CONTENT_LENGTH' => (64 * 1024 * 1024).to_s
- }
- ENV.update(@environ)
- ex = assert_raise(StandardError) do
- cgi = CGI.new
- end
- assert_equal("too large post data.", ex.message)
- end if CGI.const_defined?(:MAX_CONTENT_LENGTH)
-
-
- def test_cgi_core_out
- @environ = {
- 'REQUEST_METHOD' => 'GET',
- 'QUERY_STRING' => 'id=123&id=456&id=&str=%40h+%3D%7E+%2F%5E%24%2F',
- 'HTTP_COOKIE' => '_session_id=12345; name1=val1&val2;',
- 'SERVER_SOFTWARE' => 'Apache 2.2.0',
- 'SERVER_PROTOCOL' => 'HTTP/1.1',
- }
- ENV.update(@environ)
- cgi = CGI.new
- ## jis, euc, sjis string
- jis_str = "\e$B8+$m!\"?M$,%4%_$N$h$&$@\e(B"
- euc_str = "\270\253\244\355\241\242\277\315\244\254\245\264\245\337\244\316\244\350\244\246\244\300"
- sjis_str = "\214\251\202\353\201A\220l\202\252\203S\203~\202\314\202\346\202\244\202\276"
- if RUBY_VERSION<"1.9"
- ## iso-2022-jp
- options = { 'charset'=>'iso-2022-jp' }
- $stdout = StringIO.new
- cgi.out(options) { euc_str }
- assert_equal('ja', options['language'])
- actual = $stdout.string
- expected = "Content-Type: text/html; charset=iso-2022-jp\r\n" +
- "Content-Length: 28\r\n" +
- "Content-Language: ja\r\n" +
- "\r\n" +
- jis_str
- assert_equal(expected,actual)
- ## euc-jp
- options = { 'charset'=>'EUC-JP' }
- $stdout = StringIO.new
- cgi.out(options) { euc_str }
- assert_equal('ja', options['language'])
- actual = $stdout.string
- expected = "Content-Type: text/html; charset=EUC-JP\r\n" +
- "Content-Length: 22\r\n" +
- "Content-Language: ja\r\n" +
- "\r\n" +
- euc_str
- assert_equal(expected, actual)
- ## shift_jis
- options = { 'charset'=>'Shift_JIS' }
- $stdout = StringIO.new
- cgi.out(options) { euc_str }
- assert_equal('ja', options['language'])
- actual = $stdout.string
- expected = "Content-Type: text/html; charset=Shift_JIS\r\n" +
- "Content-Length: 22\r\n" +
- "Content-Language: ja\r\n" +
- "\r\n" +
- sjis_str
- assert_equal(expected, actual)
- end
- ## utf8 (not converted)
- options = { 'charset'=>'utf8' }
- $stdout = StringIO.new
- cgi.out(options) { euc_str }
- assert_nil(options['language'])
- actual = $stdout.string
- expected = "Content-Type: text/html; charset=utf8\r\n" +
- "Content-Length: 22\r\n" +
- "\r\n" +
- euc_str
- if RUBY_VERSION>="1.9"
- actual.force_encoding("ASCII-8BIT")
- expected.force_encoding("ASCII-8BIT")
- end
- assert_equal(expected, actual)
- ## language is keeped
- options = { 'charset'=>'Shift_JIS', 'language'=>'en' }
- $stdout = StringIO.new
- cgi.out(options) { euc_str }
- assert_equal('en', options['language'])
- ## HEAD method
- ENV['REQUEST_METHOD'] = 'HEAD'
- options = { 'charset'=>'utf8' }
- $stdout = StringIO.new
- cgi.out(options) { euc_str }
- actual = $stdout.string
- expected = "Content-Type: text/html; charset=utf8\r\n" +
- "Content-Length: 22\r\n" +
- "\r\n"
- assert_equal(expected, actual)
- end
-
-
- def test_cgi_core_print
- @environ = {
- 'REQUEST_METHOD' => 'GET',
- }
- ENV.update(@environ)
- cgi = CGI.new
- $stdout = StringIO.new
- str = "foobar"
- cgi.print(str)
- expected = str
- actual = $stdout.string
- assert_equal(expected, actual)
- end
-
-
- def test_cgi_core_environs
- @environ = {
- 'REQUEST_METHOD' => 'GET',
- }
- ENV.update(@environ)
- cgi = CGI.new
- ##
- list1 = %w[ AUTH_TYPE CONTENT_TYPE GATEWAY_INTERFACE PATH_INFO
- PATH_TRANSLATED QUERY_STRING REMOTE_ADDR REMOTE_HOST
- REMOTE_IDENT REMOTE_USER REQUEST_METHOD SCRIPT_NAME
- SERVER_NAME SERVER_PROTOCOL SERVER_SOFTWARE
- 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
- ]
- list2 = %w[ CONTENT_LENGTH SERVER_PORT ]
- ## string expected
- list1.each do |name|
- @environ[name] = "**#{name}**"
- end
- ENV.update(@environ)
- list1.each do |name|
- method = name.sub(/\AHTTP_/, '').downcase
- actual = cgi.__send__ method
- expected = "**#{name}**"
- assert_equal(expected, actual)
- end
- ## integer expected
- ENV['CONTENT_LENGTH'] = '123'
- ENV['SERVER_PORT'] = '8080'
- assert_equal(123, cgi.content_length)
- assert_equal(8080, cgi.server_port)
- ## raw cookie
- ENV['HTTP_COOKIE'] = 'name1=val1'
- ENV['HTTP_COOKIE2'] = 'name2=val2'
- assert_equal('name1=val1', cgi.raw_cookie)
- assert_equal('name2=val2', cgi.raw_cookie2)
- end
-
-
- def test_cgi_core_htmltype
- @environ = {
- 'REQUEST_METHOD' => 'GET',
- }
- ENV.update(@environ)
- ## no htmltype
- cgi = CGI.new
- assert_raise(NoMethodError) do cgi.doctype end
- ## html3
- cgi = CGI.new('html3')
- expected = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">'
- assert_equal(expected, cgi.doctype)
- ## html4
- cgi = CGI.new('html4')
- expected = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">'
- assert_equal(expected, cgi.doctype)
- ## html4 transitional
- cgi = CGI.new('html4Tr')
- expected = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">'
- assert_equal(expected, cgi.doctype)
- ## html4 frameset
- cgi = CGI.new('html4Fr')
- expected = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">'
- assert_equal(expected, cgi.doctype)
- end
-
-
- instance_methods.each do |method|
- private method if method =~ /^test_(.*)/ && $1 != ENV['TEST']
- end if ENV['TEST']
-
-end
diff --git a/test/cgi/test_cgi_header.rb b/test/cgi/test_cgi_header.rb
deleted file mode 100644
index 58f82ba3bc..0000000000
--- a/test/cgi/test_cgi_header.rb
+++ /dev/null
@@ -1,177 +0,0 @@
-require 'test/unit'
-require 'cgi'
-
-
-class CGIHeaderTest < Test::Unit::TestCase
-
-
- def setup
- @environ = {
- 'SERVER_PROTOCOL' => 'HTTP/1.1',
- 'REQUEST_METHOD' => 'GET',
- 'SERVER_SOFTWARE' => 'Apache 2.2.0',
- }
- ENV.update(@environ)
- end
-
-
- def teardown
- @environ.each do |key, val| ENV.delete(key) end
- end
-
-
- def test_cgi_header_simple
- cgi = CGI.new
- ## default content type
- expected = "Content-Type: text/html\r\n\r\n"
- actual = cgi.header
- assert_equal(expected, actual)
- ## content type specified as string
- expected = "Content-Type: text/xhtml; charset=utf8\r\n\r\n"
- actual = cgi.header('text/xhtml; charset=utf8')
- assert_equal(expected, actual)
- ## content type specified as hash
- expected = "Content-Type: image/png\r\n\r\n"
- actual = cgi.header('type'=>'image/png')
- assert_equal(expected, actual)
- ## charset specified
- expected = "Content-Type: text/html; charset=utf8\r\n\r\n"
- actual = cgi.header('charset'=>'utf8')
- assert_equal(expected, actual)
- end
-
-
- def test_cgi_header_complex
- cgi = CGI.new
- options = {
- 'type' => 'text/xhtml',
- 'charset' => 'utf8',
- 'status' => 'REDIRECT',
- 'server' => 'webrick',
- 'connection' => 'close',
- 'length' => 123,
- 'language' => 'ja',
- 'expires' => Time.gm(2000, 1, 23, 12, 34, 56),
- 'location' => 'http://www.ruby-lang.org/',
- }
- expected = "Status: 302 Found\r\n"
- expected << "Server: webrick\r\n"
- expected << "Connection: close\r\n"
- expected << "Content-Type: text/xhtml; charset=utf8\r\n"
- expected << "Content-Length: 123\r\n"
- expected << "Content-Language: ja\r\n"
- expected << "Expires: Sun, 23 Jan 2000 12:34:56 GMT\r\n"
- expected << "location: http://www.ruby-lang.org/\r\n"
- expected << "\r\n"
- actual = cgi.header(options)
- assert_equal(expected, actual)
- end
-
-
- def test_cgi_header_argerr
- cgi = CGI.new
- #expected = NoMethodError # must be ArgumentError
- if RUBY_VERSION>="1.9.0"
- expected = ArgumentError # for CGIAlt
- else
- expected = NoMethodError # for Ruby1.8
- end
- ex = assert_raise(expected) do
- cgi.header(nil)
- end
- end
-
-
- def test_cgi_header_cookie
- cgi = CGI.new
- cookie1 = CGI::Cookie.new('name1', 'abc', '123')
- cookie2 = CGI::Cookie.new('name'=>'name2', 'value'=>'value2', 'secure'=>true)
- ctype = "Content-Type: text/html\r\n"
- sep = "\r\n"
- c1 = "Set-Cookie: name1=abc&123; path=\r\n"
- c2 = "Set-Cookie: name2=value2; path=; secure\r\n"
- ## CGI::Cookie object
- actual = cgi.header('cookie'=>cookie1)
- expected = ctype + c1 + sep
- assert_equal(expected, actual)
- ## String
- actual = cgi.header('cookie'=>cookie2.to_s)
- expected = ctype + c2 + sep
- assert_equal(expected, actual)
- ## Array
- actual = cgi.header('cookie'=>[cookie1, cookie2])
- expected = ctype + c1 + c2 + sep
- assert_equal(expected, actual)
- ## Hash
- actual = cgi.header('cookie'=>{'name1'=>cookie1, 'name2'=>cookie2})
- expected = ctype + c1 + c2 + sep
- assert_equal(expected, actual)
- end
-
-
- def test_cgi_header_output_cookies
- cgi = CGI.new
- ## output cookies
- cookies = [ CGI::Cookie.new('name1', 'abc', '123'),
- CGI::Cookie.new('name'=>'name2', 'value'=>'value2', 'secure'=>true),
- ]
- cgi.instance_variable_set('@output_cookies', cookies)
- expected = "Content-Type: text/html; charset=utf8\r\n"
- expected << "Set-Cookie: name1=abc&123; path=\r\n"
- expected << "Set-Cookie: name2=value2; path=; secure\r\n"
- expected << "\r\n"
- ## header when string
- actual = cgi.header('text/html; charset=utf8')
- assert_equal(expected, actual)
- ## _header_for_string
- actual = cgi.header('type'=>'text/html', 'charset'=>'utf8')
- assert_equal(expected, actual)
- end
-
-
- def test_cgi_header_nph
- cgi = CGI.new
- ## 'nph' is true
- ENV['SERVER_SOFTWARE'] = 'Apache 2.2.0'
- actual1 = cgi.header('nph'=>true)
- ## when old IIS, NPH-mode is forced
- ENV['SERVER_SOFTWARE'] = 'IIS/4.0'
- actual2 = cgi.header
- actual3 = cgi.header('status'=>'REDIRECT', 'location'=>'http://www.example.com/')
- ## newer IIS doesn't require NPH-mode ## [ruby-dev:30537]
- ENV['SERVER_SOFTWARE'] = 'IIS/5.0'
- actual4 = cgi.header
- actual5 = cgi.header('status'=>'REDIRECT', 'location'=>'http://www.example.com/')
- ## assertion
- now = Time.now
- expected = "HTTP/1.1 200 OK\r\n"
- expected << "Date: #{CGI.rfc1123_date(now)}\r\n"
- expected << "Server: Apache 2.2.0\r\n"
- expected << "Connection: close\r\n"
- expected << "Content-Type: text/html\r\n"
- expected << "\r\n"
- assert_equal(expected, actual1)
- expected.sub!(/^Server: .*?\r\n/, "Server: IIS/4.0\r\n")
- assert_equal(expected, actual2)
- expected.sub!(/^HTTP\/1.1 200 OK\r\n/, "HTTP/1.1 302 Found\r\n")
- expected.sub!(/\r\n\r\n/, "\r\nlocation: http://www.example.com/\r\n\r\n")
- assert_equal(expected, actual3)
- expected = "Content-Type: text/html\r\n"
- expected << "\r\n"
- assert_equal(expected, actual4)
- expected = "Status: 302 Found\r\n"
- expected << "Content-Type: text/html\r\n"
- expected << "location: http://www.example.com/\r\n"
- expected << "\r\n"
- assert_equal(expected, actual5)
- ensure
- ENV.delete('SERVER_SOFTWARE')
- end
-
-
-
- instance_methods.each do |method|
- private method if method =~ /^test_(.*)/ && $1 != ENV['TEST']
- end if ENV['TEST']
-
-end
diff --git a/test/cgi/test_cgi_modruby.rb b/test/cgi/test_cgi_modruby.rb
deleted file mode 100644
index 4eb02fac56..0000000000
--- a/test/cgi/test_cgi_modruby.rb
+++ /dev/null
@@ -1,145 +0,0 @@
-require 'test/unit'
-require 'cgi'
-
-
-class CGIModrubyTest < Test::Unit::TestCase
-
-
- def setup
- @environ = {
- 'SERVER_PROTOCOL' => 'HTTP/1.1',
- 'REQUEST_METHOD' => 'GET',
- #'QUERY_STRING' => 'a=foo&b=bar',
- }
- ENV.update(@environ)
- CGI.class_eval { const_set(:MOD_RUBY, true) }
- Apache._reset()
- #@cgi = CGI.new
- #@req = Apache.request
- end
-
-
- def teardown
- @environ.each do |key, val| ENV.delete(key) end
- CGI.class_eval { remove_const(:MOD_RUBY) }
- end
-
-
- def test_cgi_modruby_simple
- req = Apache.request
- cgi = CGI.new
- assert(req._setup_cgi_env_invoked?)
- assert(! req._send_http_header_invoked?)
- actual = cgi.header
- assert_equal('', actual)
- assert_equal('text/html', req.content_type)
- assert(req._send_http_header_invoked?)
- end
-
-
- def test_cgi_modruby_complex
- req = Apache.request
- cgi = CGI.new
- options = {
- 'status' => 'FORBIDDEN',
- 'location' => 'http://www.example.com/',
- 'type' => 'image/gif',
- 'content-encoding' => 'deflate',
- 'cookie' => [ CGI::Cookie.new('name1', 'abc', '123'),
- CGI::Cookie.new('name'=>'name2', 'value'=>'value2', 'secure'=>true),
- ],
- }
- assert(req._setup_cgi_env_invoked?)
- assert(! req._send_http_header_invoked?)
- actual = cgi.header(options)
- assert_equal('', actual)
- assert_equal('image/gif', req.content_type)
- assert_equal('403 Forbidden', req.status_line)
- assert_equal(403, req.status)
- assert_equal('deflate', req.content_encoding)
- assert_equal('http://www.example.com/', req.headers_out['location'])
- assert_equal(["name1=abc&123; path=", "name2=value2; path=; secure"],
- req.headers_out['Set-Cookie'])
- assert(req._send_http_header_invoked?)
- end
-
-
- def test_cgi_modruby_location
- req = Apache.request
- cgi = CGI.new
- options = {
- 'status' => '200 OK',
- 'location' => 'http://www.example.com/',
- }
- actual = cgi.header(options)
- assert_equal('200 OK', req.status_line) # should be '302 Found' ?
- assert_equal(302, req.status)
- assert_equal('http://www.example.com/', req.headers_out['location'])
- end
-
-
- def test_cgi_modruby_requestparams
- req = Apache.request
- req.args = 'a=foo&b=bar'
- cgi = CGI.new
- assert_equal('foo', cgi['a'])
- assert_equal('bar', cgi['b'])
- end
-
-
- instance_methods.each do |method|
- private method if method =~ /^test_(.*)/ && $1 != ENV['TEST']
- end if ENV['TEST']
-
-end
-
-
-
-## dummy class for mod_ruby
-class Apache #:nodoc:
-
- def self._reset
- @request = Request.new
- end
-
- def self.request
- return @request
- end
-
- class Request
-
- def initialize
- hash = {}
- def hash.add(name, value)
- (self[name] ||= []) << value
- end
- @headers_out = hash
- @status_line = nil
- @status = nil
- @content_type = nil
- @content_encoding = nil
- end
- attr_accessor :headers_out, :status_line, :status, :content_type, :content_encoding
-
- attr_accessor :args
- #def args
- # return ENV['QUERY_STRING']
- #end
-
- def send_http_header
- @http_header = '*invoked*'
- end
- def _send_http_header_invoked?
- @http_header ? true : false
- end
-
- def setup_cgi_env
- @cgi_env = '*invoked*'
- end
- def _setup_cgi_env_invoked?
- @cgi_env ? true : false
- end
-
- end
-
-end
diff --git a/test/cgi/test_cgi_multipart.rb b/test/cgi/test_cgi_multipart.rb
deleted file mode 100644
index 86bbc0d28c..0000000000
--- a/test/cgi/test_cgi_multipart.rb
+++ /dev/null
@@ -1,322 +0,0 @@
-require 'test/unit'
-require 'cgi'
-require 'tempfile'
-require 'stringio'
-
-
-##
-## usage:
-## boundary = 'foobar1234' # or nil
-## multipart = MultiPart.new(boundary)
-## multipart.append('name1', 'value1')
-## multipart.append('file1', File.read('file1.html'), 'file1.html')
-## str = multipart.close()
-## str.each_line {|line| p line }
-## ## output:
-## # "--foobar1234\r\n"
-## # "Content-Disposition: form-data: name=\"name1\"\r\n"
-## # "\r\n"
-## # "value1\r\n"
-## # "--foobar1234\r\n"
-## # "Content-Disposition: form-data: name=\"file1\"; filename=\"file1.html\"\r\n"
-## # "Content-Type: text/html\r\n"
-## # "\r\n"
-## # "<html>\n"
-## # "<body><p>Hello</p></body>\n"
-## # "</html>\n"
-## # "\r\n"
-## # "--foobar1234--\r\n"
-##
-class MultiPart
-
- def initialize(boundary=nil)
- @boundary = boundary || create_boundary()
- @buf = ''
- @buf.force_encoding("ascii-8bit") if RUBY_VERSION>="1.9"
- end
- attr_reader :boundary
-
- def append(name, value, filename=nil, content_type=nil)
- content_type = detect_content_type(filename) if filename && content_type.nil?
- s = filename ? "; filename=\"#{filename}\"" : ''
- buf = @buf
- buf << "--#{boundary}\r\n"
- buf << "Content-Disposition: form-data: name=\"#{name}\"#{s}\r\n"
- buf << "Content-Type: #{content_type}\r\n" if content_type
- buf << "\r\n"
- if RUBY_VERSION>="1.9"
- buf << value.dup.force_encoding("ASCII-8BIT")
- else
- buf << value
- end
- buf << "\r\n"
- return self
- end
-
- def close
- buf = @buf
- @buf = ''
- return buf << "--#{boundary}--\r\n"
- end
-
- def create_boundary() #:nodoc:
- return "--boundary#{rand().to_s[2..-1]}"
- end
-
- def detect_content_type(filename) #:nodoc:
- filename =~ /\.(\w+)\z/
- return MIME_TYPES[$1] || 'application/octet-stream'
- end
-
- MIME_TYPES = {
- 'gif' => 'image/gif',
- 'jpg' => 'image/jpeg',
- 'jpeg' => 'image/jpeg',
- 'png' => 'image/png',
- 'bmp' => 'image/bmp',
- 'tif' => 'image/tiff',
- 'tiff' => 'image/tiff',
- 'htm' => 'text/html',
- 'html' => 'text/html',
- 'xml' => 'text/xml',
- 'txt' => 'text/plain',
- 'text' => 'text/plain',
- 'css' => 'text/css',
- 'mpg' => 'video/mpeg',
- 'mpeg' => 'video/mpeg',
- 'mov' => 'video/quicktime',
- 'avi' => 'video/x-msvideo',
- 'mp3' => 'audio/mpeg',
- 'mid' => 'audio/midi',
- 'wav' => 'audio/x-wav',
- 'zip' => 'application/zip',
- #'tar.gz' => 'application/gtar',
- 'gz' => 'application/gzip',
- 'bz2' => 'application/bzip2',
- 'rtf' => 'application/rtf',
- 'pdf' => 'application/pdf',
- 'ps' => 'application/postscript',
- 'js' => 'application/x-javascript',
- 'xls' => 'application/vnd.ms-excel',
- 'doc' => 'application/msword',
- 'ppt' => 'application/vnd.ms-powerpoint',
- }
-
-end
-
-
-
-class CGIMultipartTest < Test::Unit::TestCase
-
- def setup
- ENV['REQUEST_METHOD'] = 'POST'
- end
-
- def teardown
- %w[ REQUEST_METHOD CONTENT_TYPE CONTENT_LENGTH REQUEST_METHOD ].each do |name|
- ENV.delete(name)
- end
- $stdin.close() if $stdin.is_a?(Tempfile)
- $stdin = STDIN
- end
-
- def _prepare(data)
- ## create multipart input
- multipart = MultiPart.new(@boundary)
- data.each do |hash|
- multipart.append(hash[:name], hash[:value], hash[:filename])
- end
- input = multipart.close()
- input = yield(input) if block_given?
- #$stderr.puts "*** debug: input=\n#{input.collect{|line| line.inspect}.join("\n")}"
- @boundary ||= multipart.boundary
- ## set environment
- ENV['CONTENT_TYPE'] = "multipart/form-data; boundary=#{@boundary}"
- ENV['CONTENT_LENGTH'] = input.length.to_s
- ENV['REQUEST_METHOD'] = 'POST'
- ## set $stdin
- tmpfile = if RUBY_VERSION >="1.9"
- Tempfile.new('test_cgi_multipart', :binmode => true)
- else
- Tempfile.new('test_cgi_multipart')
- end
- tmpfile << input
- tmpfile.rewind()
- $stdin = tmpfile
- end
-
- def _test_multipart
- caller(0).find {|s| s =~ /in `test_(.*?)'/ }
- testname = $1
- #$stderr.puts "*** debug: testname=#{testname.inspect}"
- _prepare(@data)
- cgi = RUBY_VERSION>="1.9" ? CGI.new(:accept_charset=>"UTF-8") : CGI.new
- expected_names = @data.collect{|hash| hash[:name] }.sort
- assert_equal(expected_names, cgi.params.keys.sort)
- threshold = 1024*10
- @data.each do |hash|
- name = hash[:name]
- expected = hash[:value]
- if RUBY_VERSION>="1.9"
- if hash[:filename] #if file
- expected_class = @expected_class || (hash[:value].length < threshold ? StringIO : Tempfile)
- assert(cgi.files.keys.member?(hash[:name]))
- else
- expected_class = String
- assert_equal(expected, cgi[name])
- assert_equal(false,cgi.files.keys.member?(hash[:name]))
- end
- else
- expected_class = @expected_class || (hash[:value].length < threshold ? StringIO : Tempfile)
- end
- assert_kind_of(expected_class, cgi[name])
- assert_equal(expected, cgi[name].read())
- assert_equal(hash[:filename] || '', cgi[name].original_filename) #if hash[:filename]
- assert_equal(hash[:content_type] || '', cgi[name].content_type) #if hash[:content_type]
- end
- end
-
-
- def _read(basename)
- filename = File.join(File.dirname(__FILE__), 'testdata', basename)
- if RUBY_VERSION>="1.9"
- s = File.open(filename, 'r:ascii-8bit') {|f| f.read() }
- else
- s = File.open(filename, 'rb') {|f| f.read() }
- end
-
- return s
- end
-
-
- def test_cgi_multipart_stringio
- @boundary = '----WebKitFormBoundaryAAfvAII+YL9102cX'
- @data = [
- {:name=>'hidden1', :value=>'foobar'},
- {:name=>'text1', :value=>"\xE3\x81\x82\xE3\x81\x84\xE3\x81\x86\xE3\x81\x88\xE3\x81\x8A"},
- {:name=>'file1', :value=>_read('file1.html'),
- :filename=>'file1.html', :content_type=>'text/html'},
- {:name=>'image1', :value=>_read('small.png'),
- :filename=>'small.png', :content_type=>'image/png'}, # small image
- ]
- @data[1][:value].force_encoding("UTF-8") if RUBY_VERSION>="1.9"
- @expected_class = StringIO
- _test_multipart()
- end
-
-
- def test_cgi_multipart_tempfile
- @boundary = '----WebKitFormBoundaryAAfvAII+YL9102cX'
- @data = [
- {:name=>'hidden1', :value=>'foobar'},
- {:name=>'text1', :value=>"\xE3\x81\x82\xE3\x81\x84\xE3\x81\x86\xE3\x81\x88\xE3\x81\x8A"},
- {:name=>'file1', :value=>_read('file1.html'),
- :filename=>'file1.html', :content_type=>'text/html'},
- {:name=>'image1', :value=>_read('large.png'),
- :filename=>'large.png', :content_type=>'image/png'}, # large image
- ]
- @data[1][:value].force_encoding("UTF-8") if RUBY_VERSION>="1.9"
- @expected_class = Tempfile
- _test_multipart()
- end
-
-
- def _set_const(klass, name, value)
- old = nil
- klass.class_eval do
- old = const_get(name)
- remove_const(name)
- const_set(name, value)
- end
- return old
- end
-
-
- def test_cgi_multipart_maxmultipartlength
- @data = [
- {:name=>'image1', :value=>_read('large.png'),
- :filename=>'large.png', :content_type=>'image/png'}, # large image
- ]
- original = _set_const(CGI, :MAX_MULTIPART_LENGTH, 2 * 1024)
- begin
- ex = assert_raise(StandardError) do
- _test_multipart()
- end
- assert_equal("too large multipart data.", ex.message)
- ensure
- _set_const(CGI, :MAX_MULTIPART_LENGTH, original)
- end
- end if CGI.const_defined?(:MAX_MULTIPART_LENGTH)
-
-
- def test_cgi_multipart_maxmultipartcount
- @data = [
- {:name=>'file1', :value=>_read('file1.html'),
- :filename=>'file1.html', :content_type=>'text/html'},
- ]
- item = @data.first
- 500.times { @data << item }
- #original = _set_const(CGI, :MAX_MULTIPART_COUNT, 128)
- begin
- ex = assert_raise(StandardError) do
- _test_multipart()
- end
- assert_equal("too many parameters.", ex.message)
- ensure
- #_set_const(CGI, :MAX_MULTIPART_COUNT, original)
- end
- end if CGI.const_defined?(:MAX_MULTIPART_COUNT)
-
-
- def test_cgi_multipart_badbody ## [ruby-dev:28470]
- @data = [
- {:name=>'file1', :value=>_read('file1.html'),
- :filename=>'file1.html', :content_type=>'text/html'},
- ]
- _prepare(@data) do |input|
- input2 = input.sub(/--(\r\n)?\z/, "\r\n")
- assert input2 != input
- #p input2
- input2
- end
- ex = assert_raise(EOFError) do
- cgi = RUBY_VERSION>="1.9" ? CGI.new(:accept_charset=>"UTF-8") : CGI.new
- end
- assert_equal("bad boundary end of body part", ex.message)
- #
- _prepare(@data) do |input|
- input2 = input.sub(/--(\r\n)?\z/, "")
- assert input2 != input
- #p input2
- input2
- end
- ex = assert_raise(EOFError) do
- cgi = RUBY_VERSION>="1.9" ? CGI.new(:accept_charset=>"UTF-8") : CGI.new
- end
- assert_equal("bad content body", ex.message)
- end
-
-
- def test_cgi_multipart_quoteboundary ## [JVN#84798830]
- @boundary = '(.|\n)*'
- @data = [
- {:name=>'hidden1', :value=>'foobar'},
- {:name=>'text1', :value=>"\xE3\x81\x82\xE3\x81\x84\xE3\x81\x86\xE3\x81\x88\xE3\x81\x8A"},
- {:name=>'file1', :value=>_read('file1.html'),
- :filename=>'file1.html', :content_type=>'text/html'},
- {:name=>'image1', :value=>_read('small.png'),
- :filename=>'small.png', :content_type=>'image/png'}, # small image
- ]
- @data[1][:value].force_encoding("UTF-8") if RUBY_VERSION>="1.9"
- _prepare(@data)
- cgi = RUBY_VERSION>="1.9" ? CGI.new(:accept_charset=>"UTF-8") : CGI.new
- assert_equal('file1.html', cgi['file1'].original_filename)
- end
-
- ###
-
- self.instance_methods.each do |method|
- private method if method =~ /^test_(.*)/ && $1 != ENV['TEST']
- end if ENV['TEST']
-
-end
diff --git a/test/cgi/test_cgi_session.rb b/test/cgi/test_cgi_session.rb
deleted file mode 100644
index 6cccb22240..0000000000
--- a/test/cgi/test_cgi_session.rb
+++ /dev/null
@@ -1,173 +0,0 @@
-require 'test/unit'
-require 'cgi'
-require 'cgi/session'
-require 'cgi/session/pstore'
-require 'stringio'
-require 'tmpdir'
-
-class CGISessionTest < Test::Unit::TestCase
- def setup
- @session_dir = File.join(Dir.mktmpdir('__test_dir__'), 'session_dir')
- FileUtils.mkdir_p @session_dir
- end
-
- def teardown
- @environ.each do |key, val| ENV.delete(key) end
- $stdout = STDOUT
- FileUtils.rm_rf(File.dirname(@session_dir))
- end
-
- def test_cgi_session_filestore
- @environ = {
- 'REQUEST_METHOD' => 'GET',
- # 'QUERY_STRING' => 'id=123&id=456&id=&str=%40h+%3D%7E+%2F%5E%24%2F',
- # 'HTTP_COOKIE' => '_session_id=12345; name1=val1&val2;',
- 'SERVER_SOFTWARE' => 'Apache 2.2.0',
- 'SERVER_PROTOCOL' => 'HTTP/1.1',
- }
- value1="value1"
- value2="\x8F\xBC\x8D]"
- value2.force_encoding("SJIS") if RUBY_VERSION>="1.9"
- ENV.update(@environ)
- cgi = CGI.new
- session = CGI::Session.new(cgi,"tmpdir"=>@session_dir)
- session["key1"]=value1
- session["key2"]=value2
- assert_equal(value1,session["key1"])
- assert_equal(value2,session["key2"])
- session.close
- $stdout = StringIO.new
- cgi.out{""}
-
- @environ = {
- 'REQUEST_METHOD' => 'GET',
- # 'HTTP_COOKIE' => "_session_id=#{session_id}",
- 'QUERY_STRING' => "_session_id=#{session.session_id}",
- 'SERVER_SOFTWARE' => 'Apache 2.2.0',
- 'SERVER_PROTOCOL' => 'HTTP/1.1',
- }
- ENV.update(@environ)
- cgi = CGI.new
- session = CGI::Session.new(cgi,"tmpdir"=>@session_dir)
- $stdout = StringIO.new
- assert_equal(value1,session["key1"])
- assert_equal(value2,session["key2"])
- session.close
-
- end
- def test_cgi_session_pstore
- @environ = {
- 'REQUEST_METHOD' => 'GET',
- # 'QUERY_STRING' => 'id=123&id=456&id=&str=%40h+%3D%7E+%2F%5E%24%2F',
- # 'HTTP_COOKIE' => '_session_id=12345; name1=val1&val2;',
- 'SERVER_SOFTWARE' => 'Apache 2.2.0',
- 'SERVER_PROTOCOL' => 'HTTP/1.1',
- }
- value1="value1"
- value2="\x8F\xBC\x8D]"
- value2.force_encoding("SJIS") if RUBY_VERSION>="1.9"
- ENV.update(@environ)
- cgi = CGI.new
- session = CGI::Session.new(cgi,"tmpdir"=>@session_dir,"database_manager"=>CGI::Session::PStore)
- session["key1"]=value1
- session["key2"]=value2
- assert_equal(value1,session["key1"])
- assert_equal(value2,session["key2"])
- session.close
- $stdout = StringIO.new
- cgi.out{""}
-
- @environ = {
- 'REQUEST_METHOD' => 'GET',
- # 'HTTP_COOKIE' => "_session_id=#{session_id}",
- 'QUERY_STRING' => "_session_id=#{session.session_id}",
- 'SERVER_SOFTWARE' => 'Apache 2.2.0',
- 'SERVER_PROTOCOL' => 'HTTP/1.1',
- }
- ENV.update(@environ)
- cgi = CGI.new
- session = CGI::Session.new(cgi,"tmpdir"=>@session_dir,"database_manager"=>CGI::Session::PStore)
- $stdout = StringIO.new
- assert_equal(value1,session["key1"])
- assert_equal(value2,session["key2"])
- session.close
- end
- def test_cgi_session_specify_session_id
- @environ = {
- 'REQUEST_METHOD' => 'GET',
- # 'QUERY_STRING' => 'id=123&id=456&id=&str=%40h+%3D%7E+%2F%5E%24%2F',
- # 'HTTP_COOKIE' => '_session_id=12345; name1=val1&val2;',
- 'SERVER_SOFTWARE' => 'Apache 2.2.0',
- 'SERVER_PROTOCOL' => 'HTTP/1.1',
- }
- value1="value1"
- value2="\x8F\xBC\x8D]"
- value2.force_encoding("SJIS") if RUBY_VERSION>="1.9"
- ENV.update(@environ)
- cgi = CGI.new
- session = CGI::Session.new(cgi,"tmpdir"=>@session_dir,"session_id"=>"foo")
- session["key1"]=value1
- session["key2"]=value2
- assert_equal(value1,session["key1"])
- assert_equal(value2,session["key2"])
- assert_equal("foo",session.session_id)
- session_id=session.session_id
- session.close
- $stdout = StringIO.new
- cgi.out{""}
-
- @environ = {
- 'REQUEST_METHOD' => 'GET',
- # 'HTTP_COOKIE' => "_session_id=#{session_id}",
- 'QUERY_STRING' => "_session_id=#{session.session_id}",
- 'SERVER_SOFTWARE' => 'Apache 2.2.0',
- 'SERVER_PROTOCOL' => 'HTTP/1.1',
- }
- ENV.update(@environ)
- cgi = CGI.new
- session = CGI::Session.new(cgi,"tmpdir"=>@session_dir)
- $stdout = StringIO.new
- assert_equal(value1,session["key1"])
- assert_equal(value2,session["key2"])
- assert_equal("foo",session.session_id)
- session.close
- end
- def test_cgi_session_specify_session_key
- @environ = {
- 'REQUEST_METHOD' => 'GET',
- # 'QUERY_STRING' => 'id=123&id=456&id=&str=%40h+%3D%7E+%2F%5E%24%2F',
- # 'HTTP_COOKIE' => '_session_id=12345; name1=val1&val2;',
- 'SERVER_SOFTWARE' => 'Apache 2.2.0',
- 'SERVER_PROTOCOL' => 'HTTP/1.1',
- }
- value1="value1"
- value2="\x8F\xBC\x8D]"
- value2.force_encoding("SJIS") if RUBY_VERSION>="1.9"
- ENV.update(@environ)
- cgi = CGI.new
- session = CGI::Session.new(cgi,"tmpdir"=>@session_dir,"session_key"=>"bar")
- session["key1"]=value1
- session["key2"]=value2
- assert_equal(value1,session["key1"])
- assert_equal(value2,session["key2"])
- session_id=session.session_id
- session.close
- $stdout = StringIO.new
- cgi.out{""}
-
- @environ = {
- 'REQUEST_METHOD' => 'GET',
- 'HTTP_COOKIE' => "bar=#{session_id}",
- # 'QUERY_STRING' => "bar=#{session.session_id}",
- 'SERVER_SOFTWARE' => 'Apache 2.2.0',
- 'SERVER_PROTOCOL' => 'HTTP/1.1',
- }
- ENV.update(@environ)
- cgi = CGI.new
- session = CGI::Session.new(cgi,"tmpdir"=>@session_dir,"session_key"=>"bar")
- $stdout = StringIO.new
- assert_equal(value1,session["key1"])
- assert_equal(value2,session["key2"])
- session.close
- end
-end
diff --git a/test/cgi/test_cgi_tag_helper.rb b/test/cgi/test_cgi_tag_helper.rb
deleted file mode 100644
index 29306578b0..0000000000
--- a/test/cgi/test_cgi_tag_helper.rb
+++ /dev/null
@@ -1,341 +0,0 @@
-require 'test/unit'
-require 'cgi'
-require 'stringio'
-
-
-class CGITagHelperTest < Test::Unit::TestCase
-
-
- def setup
- #@environ = {
- # 'SERVER_PROTOCOL' => 'HTTP/1.1',
- # 'REQUEST_METHOD' => 'GET',
- # 'SERVER_SOFTWARE' => 'Apache 2.2.0',
- #}
- #ENV.update(@environ)
- end
-
-
- def teardown
- @environ.each do |key, val| ENV.delete(key) end
- $stdout = STDOUT
- end
-
-
- def test_cgi_tag_helper_html3
- @environ = {
- 'REQUEST_METHOD' => 'GET',
- }
- ENV.update(@environ)
- ## html3
- cgi = CGI.new('html3')
- assert_equal('<A HREF=""></A>',cgi.a)
- assert_equal('<A HREF="bar"></A>',cgi.a('bar'))
- assert_equal('<A HREF="">foo</A>',cgi.a{'foo'})
- assert_equal('<A HREF="bar">foo</A>',cgi.a('bar'){'foo'})
- assert_equal('<TT></TT>',cgi.tt)
- assert_equal('<TT></TT>',cgi.tt('bar'))
- assert_equal('<TT>foo</TT>',cgi.tt{'foo'})
- assert_equal('<TT>foo</TT>',cgi.tt('bar'){'foo'})
- assert_equal('<I></I>',cgi.i)
- assert_equal('<I></I>',cgi.i('bar'))
- assert_equal('<I>foo</I>',cgi.i{'foo'})
- assert_equal('<I>foo</I>',cgi.i('bar'){'foo'})
- assert_equal('<B></B>',cgi.b)
- assert_equal('<B></B>',cgi.b('bar'))
- assert_equal('<B>foo</B>',cgi.b{'foo'})
- assert_equal('<B>foo</B>',cgi.b('bar'){'foo'})
- assert_equal('<U></U>',cgi.u)
- assert_equal('<U></U>',cgi.u('bar'))
- assert_equal('<U>foo</U>',cgi.u{'foo'})
- assert_equal('<U>foo</U>',cgi.u('bar'){'foo'})
- assert_equal('<STRIKE></STRIKE>',cgi.strike)
- assert_equal('<STRIKE></STRIKE>',cgi.strike('bar'))
- assert_equal('<STRIKE>foo</STRIKE>',cgi.strike{'foo'})
- assert_equal('<STRIKE>foo</STRIKE>',cgi.strike('bar'){'foo'})
- assert_equal('<BIG></BIG>',cgi.big)
- assert_equal('<BIG></BIG>',cgi.big('bar'))
- assert_equal('<BIG>foo</BIG>',cgi.big{'foo'})
- assert_equal('<BIG>foo</BIG>',cgi.big('bar'){'foo'})
- assert_equal('<SMALL></SMALL>',cgi.small)
- assert_equal('<SMALL></SMALL>',cgi.small('bar'))
- assert_equal('<SMALL>foo</SMALL>',cgi.small{'foo'})
- assert_equal('<SMALL>foo</SMALL>',cgi.small('bar'){'foo'})
- assert_equal('<SUB></SUB>',cgi.sub)
- assert_equal('<SUB></SUB>',cgi.sub('bar'))
- assert_equal('<SUB>foo</SUB>',cgi.sub{'foo'})
- assert_equal('<SUB>foo</SUB>',cgi.sub('bar'){'foo'})
- assert_equal('<SUP></SUP>',cgi.sup)
- assert_equal('<SUP></SUP>',cgi.sup('bar'))
- assert_equal('<SUP>foo</SUP>',cgi.sup{'foo'})
- assert_equal('<SUP>foo</SUP>',cgi.sup('bar'){'foo'})
- assert_equal('<EM></EM>',cgi.em)
- assert_equal('<EM></EM>',cgi.em('bar'))
- assert_equal('<EM>foo</EM>',cgi.em{'foo'})
- assert_equal('<EM>foo</EM>',cgi.em('bar'){'foo'})
- assert_equal('<STRONG></STRONG>',cgi.strong)
- assert_equal('<STRONG></STRONG>',cgi.strong('bar'))
- assert_equal('<STRONG>foo</STRONG>',cgi.strong{'foo'})
- assert_equal('<STRONG>foo</STRONG>',cgi.strong('bar'){'foo'})
- assert_equal('<DFN></DFN>',cgi.dfn)
- assert_equal('<DFN></DFN>',cgi.dfn('bar'))
- assert_equal('<DFN>foo</DFN>',cgi.dfn{'foo'})
- assert_equal('<DFN>foo</DFN>',cgi.dfn('bar'){'foo'})
- assert_equal('<CODE></CODE>',cgi.code)
- assert_equal('<CODE></CODE>',cgi.code('bar'))
- assert_equal('<CODE>foo</CODE>',cgi.code{'foo'})
- assert_equal('<CODE>foo</CODE>',cgi.code('bar'){'foo'})
- assert_equal('<SAMP></SAMP>',cgi.samp)
- assert_equal('<SAMP></SAMP>',cgi.samp('bar'))
- assert_equal('<SAMP>foo</SAMP>',cgi.samp{'foo'})
- assert_equal('<SAMP>foo</SAMP>',cgi.samp('bar'){'foo'})
- assert_equal('<KBD></KBD>',cgi.kbd)
- assert_equal('<KBD></KBD>',cgi.kbd('bar'))
- assert_equal('<KBD>foo</KBD>',cgi.kbd{'foo'})
- assert_equal('<KBD>foo</KBD>',cgi.kbd('bar'){'foo'})
- assert_equal('<VAR></VAR>',cgi.var)
- assert_equal('<VAR></VAR>',cgi.var('bar'))
- assert_equal('<VAR>foo</VAR>',cgi.var{'foo'})
- assert_equal('<VAR>foo</VAR>',cgi.var('bar'){'foo'})
- assert_equal('<CITE></CITE>',cgi.cite)
- assert_equal('<CITE></CITE>',cgi.cite('bar'))
- assert_equal('<CITE>foo</CITE>',cgi.cite{'foo'})
- assert_equal('<CITE>foo</CITE>',cgi.cite('bar'){'foo'})
- assert_equal('<FONT></FONT>',cgi.font)
- assert_equal('<FONT></FONT>',cgi.font('bar'))
- assert_equal('<FONT>foo</FONT>',cgi.font{'foo'})
- assert_equal('<FONT>foo</FONT>',cgi.font('bar'){'foo'})
- assert_equal('<ADDRESS></ADDRESS>',cgi.address)
- assert_equal('<ADDRESS></ADDRESS>',cgi.address('bar'))
- assert_equal('<ADDRESS>foo</ADDRESS>',cgi.address{'foo'})
- assert_equal('<ADDRESS>foo</ADDRESS>',cgi.address('bar'){'foo'})
- assert_equal('<DIV></DIV>',cgi.div)
- assert_equal('<DIV></DIV>',cgi.div('bar'))
- assert_equal('<DIV>foo</DIV>',cgi.div{'foo'})
- assert_equal('<DIV>foo</DIV>',cgi.div('bar'){'foo'})
- assert_equal('<CENTER></CENTER>',cgi.center)
- assert_equal('<CENTER></CENTER>',cgi.center('bar'))
- assert_equal('<CENTER>foo</CENTER>',cgi.center{'foo'})
- assert_equal('<CENTER>foo</CENTER>',cgi.center('bar'){'foo'})
- assert_equal('<MAP></MAP>',cgi.map)
- assert_equal('<MAP></MAP>',cgi.map('bar'))
- assert_equal('<MAP>foo</MAP>',cgi.map{'foo'})
- assert_equal('<MAP>foo</MAP>',cgi.map('bar'){'foo'})
- assert_equal('<APPLET></APPLET>',cgi.applet)
- assert_equal('<APPLET></APPLET>',cgi.applet('bar'))
- assert_equal('<APPLET>foo</APPLET>',cgi.applet{'foo'})
- assert_equal('<APPLET>foo</APPLET>',cgi.applet('bar'){'foo'})
- assert_equal('<PRE></PRE>',cgi.pre)
- assert_equal('<PRE></PRE>',cgi.pre('bar'))
- assert_equal('<PRE>foo</PRE>',cgi.pre{'foo'})
- assert_equal('<PRE>foo</PRE>',cgi.pre('bar'){'foo'})
- assert_equal('<XMP></XMP>',cgi.xmp)
- assert_equal('<XMP></XMP>',cgi.xmp('bar'))
- assert_equal('<XMP>foo</XMP>',cgi.xmp{'foo'})
- assert_equal('<XMP>foo</XMP>',cgi.xmp('bar'){'foo'})
- assert_equal('<LISTING></LISTING>',cgi.listing)
- assert_equal('<LISTING></LISTING>',cgi.listing('bar'))
- assert_equal('<LISTING>foo</LISTING>',cgi.listing{'foo'})
- assert_equal('<LISTING>foo</LISTING>',cgi.listing('bar'){'foo'})
- assert_equal('<DL></DL>',cgi.dl)
- assert_equal('<DL></DL>',cgi.dl('bar'))
- assert_equal('<DL>foo</DL>',cgi.dl{'foo'})
- assert_equal('<DL>foo</DL>',cgi.dl('bar'){'foo'})
- assert_equal('<OL></OL>',cgi.ol)
- assert_equal('<OL></OL>',cgi.ol('bar'))
- assert_equal('<OL>foo</OL>',cgi.ol{'foo'})
- assert_equal('<OL>foo</OL>',cgi.ol('bar'){'foo'})
- assert_equal('<UL></UL>',cgi.ul)
- assert_equal('<UL></UL>',cgi.ul('bar'))
- assert_equal('<UL>foo</UL>',cgi.ul{'foo'})
- assert_equal('<UL>foo</UL>',cgi.ul('bar'){'foo'})
- assert_equal('<DIR></DIR>',cgi.dir)
- assert_equal('<DIR></DIR>',cgi.dir('bar'))
- assert_equal('<DIR>foo</DIR>',cgi.dir{'foo'})
- assert_equal('<DIR>foo</DIR>',cgi.dir('bar'){'foo'})
- assert_equal('<MENU></MENU>',cgi.menu)
- assert_equal('<MENU></MENU>',cgi.menu('bar'))
- assert_equal('<MENU>foo</MENU>',cgi.menu{'foo'})
- assert_equal('<MENU>foo</MENU>',cgi.menu('bar'){'foo'})
- assert_equal('<SELECT></SELECT>',cgi.select)
- assert_equal('<SELECT></SELECT>',cgi.select('bar'))
- assert_equal('<SELECT>foo</SELECT>',cgi.select{'foo'})
- assert_equal('<SELECT>foo</SELECT>',cgi.select('bar'){'foo'})
- assert_equal('<TABLE></TABLE>',cgi.table)
- assert_equal('<TABLE></TABLE>',cgi.table('bar'))
- assert_equal('<TABLE>foo</TABLE>',cgi.table{'foo'})
- assert_equal('<TABLE>foo</TABLE>',cgi.table('bar'){'foo'})
- assert_equal('<TITLE></TITLE>',cgi.title)
- assert_equal('<TITLE></TITLE>',cgi.title('bar'))
- assert_equal('<TITLE>foo</TITLE>',cgi.title{'foo'})
- assert_equal('<TITLE>foo</TITLE>',cgi.title('bar'){'foo'})
- assert_equal('<STYLE></STYLE>',cgi.style)
- assert_equal('<STYLE></STYLE>',cgi.style('bar'))
- assert_equal('<STYLE>foo</STYLE>',cgi.style{'foo'})
- assert_equal('<STYLE>foo</STYLE>',cgi.style('bar'){'foo'})
- assert_equal('<SCRIPT></SCRIPT>',cgi.script)
- assert_equal('<SCRIPT></SCRIPT>',cgi.script('bar'))
- assert_equal('<SCRIPT>foo</SCRIPT>',cgi.script{'foo'})
- assert_equal('<SCRIPT>foo</SCRIPT>',cgi.script('bar'){'foo'})
- assert_equal('<H1></H1>',cgi.h1)
- assert_equal('<H1></H1>',cgi.h1('bar'))
- assert_equal('<H1>foo</H1>',cgi.h1{'foo'})
- assert_equal('<H1>foo</H1>',cgi.h1('bar'){'foo'})
- assert_equal('<H2></H2>',cgi.h2)
- assert_equal('<H2></H2>',cgi.h2('bar'))
- assert_equal('<H2>foo</H2>',cgi.h2{'foo'})
- assert_equal('<H2>foo</H2>',cgi.h2('bar'){'foo'})
- assert_equal('<H3></H3>',cgi.h3)
- assert_equal('<H3></H3>',cgi.h3('bar'))
- assert_equal('<H3>foo</H3>',cgi.h3{'foo'})
- assert_equal('<H3>foo</H3>',cgi.h3('bar'){'foo'})
- assert_equal('<H4></H4>',cgi.h4)
- assert_equal('<H4></H4>',cgi.h4('bar'))
- assert_equal('<H4>foo</H4>',cgi.h4{'foo'})
- assert_equal('<H4>foo</H4>',cgi.h4('bar'){'foo'})
- assert_equal('<H5></H5>',cgi.h5)
- assert_equal('<H5></H5>',cgi.h5('bar'))
- assert_equal('<H5>foo</H5>',cgi.h5{'foo'})
- assert_equal('<H5>foo</H5>',cgi.h5('bar'){'foo'})
- assert_equal('<H6></H6>',cgi.h6)
- assert_equal('<H6></H6>',cgi.h6('bar'))
- assert_equal('<H6>foo</H6>',cgi.h6{'foo'})
- assert_equal('<H6>foo</H6>',cgi.h6('bar'){'foo'})
- assert_match(/^<TEXTAREA .*><\/TEXTAREA>$/,cgi.textarea)
- assert_match(/COLS="70"/,cgi.textarea)
- assert_match(/ROWS="10"/,cgi.textarea)
- assert_match(/NAME=""/,cgi.textarea)
- assert_match(/^<TEXTAREA .*><\/TEXTAREA>$/,cgi.textarea("bar"))
- assert_match(/COLS="70"/,cgi.textarea("bar"))
- assert_match(/ROWS="10"/,cgi.textarea("bar"))
- assert_match(/NAME="bar"/,cgi.textarea("bar"))
- assert_match(/^<TEXTAREA .*>foo<\/TEXTAREA>$/,cgi.textarea{"foo"})
- assert_match(/COLS="70"/,cgi.textarea{"foo"})
- assert_match(/ROWS="10"/,cgi.textarea{"foo"})
- assert_match(/NAME=""/,cgi.textarea{"foo"})
- assert_match(/^<TEXTAREA .*>foo<\/TEXTAREA>$/,cgi.textarea("bar"){"foo"})
- assert_match(/COLS="70"/,cgi.textarea("bar"){"foo"})
- assert_match(/ROWS="10"/,cgi.textarea("bar"){"foo"})
- assert_match(/NAME="bar"/,cgi.textarea("bar"){"foo"})
- assert_match(/^<FORM .*><\/FORM>$/,cgi.form)
- assert_match(/METHOD="post"/,cgi.form)
- assert_match(/ENCTYPE="application\/x-www-form-urlencoded"/,cgi.form)
- assert_match(/^<FORM .*><\/FORM>$/,cgi.form("bar"))
- assert_match(/METHOD="bar"/,cgi.form("bar"))
- assert_match(/ENCTYPE="application\/x-www-form-urlencoded"/,cgi.form("bar"))
- assert_match(/^<FORM .*>foo<\/FORM>$/,cgi.form{"foo"})
- assert_match(/METHOD="post"/,cgi.form{"foo"})
- assert_match(/ENCTYPE="application\/x-www-form-urlencoded"/,cgi.form{"foo"})
- assert_match(/^<FORM .*>foo<\/FORM>$/,cgi.form("bar"){"foo"})
- assert_match(/METHOD="bar"/,cgi.form("bar"){"foo"})
- assert_match(/ENCTYPE="application\/x-www-form-urlencoded"/,cgi.form("bar"){"foo"})
- assert_equal('<BLOCKQUOTE></BLOCKQUOTE>',cgi.blockquote)
- assert_equal('<BLOCKQUOTE CITE="bar"></BLOCKQUOTE>',cgi.blockquote('bar'))
- assert_equal('<BLOCKQUOTE>foo</BLOCKQUOTE>',cgi.blockquote{'foo'})
- assert_equal('<BLOCKQUOTE CITE="bar">foo</BLOCKQUOTE>',cgi.blockquote('bar'){'foo'})
- assert_equal('<CAPTION></CAPTION>',cgi.caption)
- assert_equal('<CAPTION ALIGN="bar"></CAPTION>',cgi.caption('bar'))
- assert_equal('<CAPTION>foo</CAPTION>',cgi.caption{'foo'})
- assert_equal('<CAPTION ALIGN="bar">foo</CAPTION>',cgi.caption('bar'){'foo'})
- assert_equal('<IMG SRC="" ALT="">',cgi.img)
- assert_equal('<IMG SRC="bar" ALT="">',cgi.img('bar'))
- assert_equal('<IMG SRC="" ALT="">',cgi.img{'foo'})
- assert_equal('<IMG SRC="bar" ALT="">',cgi.img('bar'){'foo'})
- assert_equal('<BASE HREF="">',cgi.base)
- assert_equal('<BASE HREF="bar">',cgi.base('bar'))
- assert_equal('<BASE HREF="">',cgi.base{'foo'})
- assert_equal('<BASE HREF="bar">',cgi.base('bar'){'foo'})
- assert_equal('<BASEFONT>',cgi.basefont)
- assert_equal('<BASEFONT>',cgi.basefont('bar'))
- assert_equal('<BASEFONT>',cgi.basefont{'foo'})
- assert_equal('<BASEFONT>',cgi.basefont('bar'){'foo'})
- assert_equal('<BR>',cgi.br)
- assert_equal('<BR>',cgi.br('bar'))
- assert_equal('<BR>',cgi.br{'foo'})
- assert_equal('<BR>',cgi.br('bar'){'foo'})
- assert_equal('<AREA>',cgi.area)
- assert_equal('<AREA>',cgi.area('bar'))
- assert_equal('<AREA>',cgi.area{'foo'})
- assert_equal('<AREA>',cgi.area('bar'){'foo'})
- assert_equal('<LINK>',cgi.link)
- assert_equal('<LINK>',cgi.link('bar'))
- assert_equal('<LINK>',cgi.link{'foo'})
- assert_equal('<LINK>',cgi.link('bar'){'foo'})
- assert_equal('<PARAM>',cgi.param)
- assert_equal('<PARAM>',cgi.param('bar'))
- assert_equal('<PARAM>',cgi.param{'foo'})
- assert_equal('<PARAM>',cgi.param('bar'){'foo'})
- assert_equal('<HR>',cgi.hr)
- assert_equal('<HR>',cgi.hr('bar'))
- assert_equal('<HR>',cgi.hr{'foo'})
- assert_equal('<HR>',cgi.hr('bar'){'foo'})
- assert_equal('<INPUT>',cgi.input)
- assert_equal('<INPUT>',cgi.input('bar'))
- assert_equal('<INPUT>',cgi.input{'foo'})
- assert_equal('<INPUT>',cgi.input('bar'){'foo'})
- assert_equal('<ISINDEX>',cgi.isindex)
- assert_equal('<ISINDEX>',cgi.isindex('bar'))
- assert_equal('<ISINDEX>',cgi.isindex{'foo'})
- assert_equal('<ISINDEX>',cgi.isindex('bar'){'foo'})
- assert_equal('<META>',cgi.meta)
- assert_equal('<META>',cgi.meta('bar'))
- assert_equal('<META>',cgi.meta{'foo'})
- assert_equal('<META>',cgi.meta('bar'){'foo'})
- assert_equal('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><HTML>',cgi.html)
- assert_equal('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><HTML>foo</HTML>',cgi.html{'foo'})
- assert_equal('<HEAD>',cgi.head)
- assert_equal('<HEAD>foo</HEAD>',cgi.head{'foo'})
- assert_equal('<BODY>',cgi.body)
- assert_equal('<BODY>foo</BODY>',cgi.body{'foo'})
- assert_equal('<P>',cgi.p)
- assert_equal('<P>foo</P>',cgi.p{'foo'})
- assert_equal('<PLAINTEXT>',cgi.plaintext)
- assert_equal('<PLAINTEXT>foo</PLAINTEXT>',cgi.plaintext{'foo'})
- assert_equal('<DT>',cgi.dt)
- assert_equal('<DT>foo</DT>',cgi.dt{'foo'})
- assert_equal('<DD>',cgi.dd)
- assert_equal('<DD>foo</DD>',cgi.dd{'foo'})
- assert_equal('<LI>',cgi.li)
- assert_equal('<LI>foo</LI>',cgi.li{'foo'})
- assert_equal('<OPTION>',cgi.option)
- assert_equal('<OPTION>foo</OPTION>',cgi.option{'foo'})
- assert_equal('<TR>',cgi.tr)
- assert_equal('<TR>foo</TR>',cgi.tr{'foo'})
- assert_equal('<TH>',cgi.th)
- assert_equal('<TH>foo</TH>',cgi.th{'foo'})
- assert_equal('<TD>',cgi.td)
- assert_equal('<TD>foo</TD>',cgi.td{'foo'})
- str=cgi.checkbox_group("foo",["aa","bb"],["cc","dd"])
- assert_match(/^<INPUT .*VALUE="aa".*>bb<INPUT .*VALUE="cc".*>dd$/,str)
- assert_match(/^<INPUT .*TYPE="checkbox".*>bb<INPUT .*TYPE="checkbox".*>dd$/,str)
- assert_match(/^<INPUT .*NAME="foo".*>bb<INPUT .*NAME="foo".*>dd$/,str)
- str=cgi.radio_group("foo",["aa","bb"],["cc","dd"])
- assert_match(/^<INPUT .*VALUE="aa".*>bb<INPUT .*VALUE="cc".*>dd$/,str)
- assert_match(/^<INPUT .*TYPE="radio".*>bb<INPUT .*TYPE="radio".*>dd$/,str)
- assert_match(/^<INPUT .*NAME="foo".*>bb<INPUT .*NAME="foo".*>dd$/,str)
- str=cgi.checkbox_group("foo",["aa","bb"],["cc","dd",true])
- assert_match(/^<INPUT .*VALUE="aa".*>bb<INPUT .*VALUE="cc".*>dd$/,str)
- assert_match(/^<INPUT .*TYPE="checkbox".*>bb<INPUT .*TYPE="checkbox".*>dd$/,str)
- assert_match(/^<INPUT .*NAME="foo".*>bb<INPUT .*NAME="foo".*>dd$/,str)
- assert_match(/^<INPUT .*>bb<INPUT .*CHECKED.*>dd$/,str)
- assert_match(/<INPUT .*TYPE="text".*>/,cgi.text_field(:name=>"name",:value=>"value")) if RUBY_VERSION>="1.9"
- if RUBY_VERSION>="1.9"
- str=cgi.radio_group("foo",["aa","bb"],["cc","dd",false])
- assert_match(/^<INPUT .*VALUE="aa".*>bb<INPUT .*VALUE="cc".*>dd$/,str)
- assert_match(/^<INPUT .*TYPE="radio".*>bb<INPUT .*TYPE="radio".*>dd$/,str)
- assert_match(/^<INPUT .*NAME="foo".*>bb<INPUT .*NAME="foo".*>dd$/,str)
- end
- end
-
-=begin
- def test_cgi_tag_helper_html4
- ## html4
- cgi = CGI.new('html4')
- ## html4 transitional
- cgi = CGI.new('html4Tr')
- ## html4 frameset
- cgi = CGI.new('html4Fr')
- end
-=end
-
-end
diff --git a/test/cgi/testdata/file1.html b/test/cgi/testdata/file1.html
deleted file mode 100644
index 2ceaf6bc39..0000000000
--- a/test/cgi/testdata/file1.html
+++ /dev/null
@@ -1,10 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
- <head>
- <title>ムスカ大佐のひとりごと</title>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF8">
- </head>
- <body>
- <p>バカどもにはちょうどいい目くらましだ。</p>
- </body>
-</html>
diff --git a/test/cgi/testdata/large.png b/test/cgi/testdata/large.png
deleted file mode 100644
index d716396fa3..0000000000
--- a/test/cgi/testdata/large.png
+++ /dev/null
Binary files differ
diff --git a/test/cgi/testdata/small.png b/test/cgi/testdata/small.png
deleted file mode 100644
index 753d58e3cb..0000000000
--- a/test/cgi/testdata/small.png
+++ /dev/null
Binary files differ
diff --git a/test/csv/line_endings.gz b/test/csv/line_endings.gz
deleted file mode 100644
index 39e1729ee4..0000000000
--- a/test/csv/line_endings.gz
+++ /dev/null
Binary files differ
diff --git a/test/csv/test_csv.rb b/test/csv/test_csv.rb
new file mode 100644
index 0000000000..1db540921b
--- /dev/null
+++ b/test/csv/test_csv.rb
@@ -0,0 +1,1753 @@
+require 'test/unit'
+require 'tempfile'
+require 'fileutils'
+
+require 'csv'
+
+class CSV
+ class StreamBuf
+ # Let buffer work hard.
+ remove_const("BufSize")
+ BufSize = 2
+ end
+end
+
+
+module CSVTestSupport
+ def d(data)
+ data
+ end
+end
+
+
+class TestCSV < Test::Unit::TestCase
+ file = Tempfile.new("crlf")
+ file << "\n"
+ file.open
+ file.binmode
+ RSEP = file.read
+ file.close
+
+ include CSVTestSupport
+
+ class << self
+ include CSVTestSupport
+ end
+
+ @@simpleCSVData = {
+ [nil] => '',
+ [''] => '""',
+ [nil, nil] => ',',
+ [nil, nil, nil] => ',,',
+ ['foo'] => 'foo',
+ [','] => '","',
+ [',', ','] => '",",","',
+ [';'] => ';',
+ [';', ';'] => ';,;',
+ ["\"\r", "\"\r"] => "\"\"\"\r\",\"\"\"\r\"",
+ ["\"\n", "\"\n"] => "\"\"\"\n\",\"\"\"\n\"",
+ ["\t"] => "\t",
+ ["\t", "\t"] => "\t,\t",
+ ['foo', 'bar'] => 'foo,bar',
+ ['foo', '"bar"', 'baz'] => 'foo,"""bar""",baz',
+ ['foo', 'foo,bar', 'baz'] => 'foo,"foo,bar",baz',
+ ['foo', '""', 'baz'] => 'foo,"""""",baz',
+ ['foo', '', 'baz'] => 'foo,"",baz',
+ ['foo', nil, 'baz'] => 'foo,,baz',
+ [nil, 'foo', 'bar'] => ',foo,bar',
+ ['foo', 'bar', nil] => 'foo,bar,',
+ ['foo', "\r", 'baz'] => "foo,\"\r\",baz",
+ ['foo', "\n", 'baz'] => "foo,\"\n\",baz",
+ ['foo', "\r\n\r", 'baz'] => "foo,\"\r\n\r\",baz",
+ ['foo', "\r\n", 'baz'] => "foo,\"\r\n\",baz",
+ ['foo', "\r.\n", 'baz'] => "foo,\"\r.\n\",baz",
+ ['foo', "\r\n\n", 'baz'] => "foo,\"\r\n\n\",baz",
+ ['foo', '"', 'baz'] => 'foo,"""",baz',
+ }
+
+ @@fullCSVData = {
+ [d(nil)] => '',
+ [d('')] => '""',
+ [d(nil), d(nil)] => ',',
+ [d(nil), d(nil), d(nil)] => ',,',
+ [d('foo')] => 'foo',
+ [d('foo'), d('bar')] => 'foo,bar',
+ [d('foo'), d('"bar"'), d('baz')] => 'foo,"""bar""",baz',
+ [d('foo'), d('foo,bar'), d('baz')] => 'foo,"foo,bar",baz',
+ [d('foo'), d('""'), d('baz')] => 'foo,"""""",baz',
+ [d('foo'), d(''), d('baz')] => 'foo,"",baz',
+ [d('foo'), d(nil), d('baz')] => 'foo,,baz',
+ [d('foo'), d("\r"), d('baz')] => "foo,\"\r\",baz",
+ [d('foo'), d("\n"), d('baz')] => "foo,\"\n\",baz",
+ [d('foo'), d("\r\n"), d('baz')] => "foo,\"\r\n\",baz",
+ [d('foo'), d("\r.\n"), d('baz')] => "foo,\"\r.\n\",baz",
+ [d('foo'), d("\r\n\n"), d('baz')] => "foo,\"\r\n\n\",baz",
+ [d('foo'), d('"'), d('baz')] => 'foo,"""",baz',
+ }
+
+ @@fullCSVDataArray = @@fullCSVData.collect { |key, value| key }
+
+ def ssv2csv(ssvStr, row_sep = nil)
+ sepConv(ssvStr, ?;, ?,, row_sep)
+ end
+
+ def csv2ssv(csvStr, row_sep = nil)
+ sepConv(csvStr, ?,, ?;, row_sep)
+ end
+
+ def tsv2csv(tsvStr, row_sep = nil)
+ sepConv(tsvStr, ?\t, ?,, row_sep)
+ end
+
+ def csv2tsv(csvStr, row_sep = nil)
+ sepConv(csvStr, ?,, ?\t, row_sep)
+ end
+
+ def sepConv(srcStr, srcSep, destSep, row_sep = nil)
+ rows = []
+ cols, idx = CSV.parse_row(srcStr, 0, rows, srcSep, row_sep)
+ destStr = ''
+ cols = CSV.generate_row(rows, rows.size, destStr, destSep, row_sep)
+ destStr
+ end
+
+public
+
+ def setup
+ @tmpdir = File.join(Dir.tmpdir, "ruby_test_csv_tmp_#{$$}")
+ Dir.mkdir(@tmpdir)
+ @infile = File.join(@tmpdir, 'in.csv')
+ @infiletsv = File.join(@tmpdir, 'in.tsv')
+ @emptyfile = File.join(@tmpdir, 'empty.csv')
+ @outfile = File.join(@tmpdir, 'out.csv')
+ @bomfile = File.join(@tmpdir, "bom.csv")
+ @macfile = File.join(@tmpdir, "mac.csv")
+
+ CSV.open(@infile, "wb") do |writer|
+ @@fullCSVDataArray.each do |row|
+ writer.add_row(row)
+ end
+ end
+
+ CSV.open(@infiletsv, "wb", ?\t) do |writer|
+ @@fullCSVDataArray.each do |row|
+ writer.add_row(row)
+ end
+ end
+
+ CSV.generate(@emptyfile) do |writer|
+ # Create empty file.
+ end
+
+ File.open(@bomfile, "wb") do |f|
+ f.write("\357\273\277\"foo\"\r\n\"bar\"\r\n")
+ end
+
+ File.open(@macfile, "wb") do |f|
+ f.write("\"Avenches\",\"aus Umgebung\"\r\"Bad Hersfeld\",\"Ausgrabung\"")
+ end
+ end
+
+ def teardown
+ FileUtils.rm_rf(@tmpdir)
+ end
+
+ #### CSV::Reader unit test
+
+ def test_Reader_each
+ file = File.open(@infile, "rb")
+ begin
+ reader = CSV::Reader.create(file)
+ expectedArray = @@fullCSVDataArray.dup
+ first = true
+ ret = reader.each { |row|
+ if first
+ assert_instance_of(Array, row)
+ first = false
+ end
+ expected = expectedArray.shift
+ assert_equal(expected, row)
+ }
+ assert_nil(ret, "Return is nil")
+ assert(expectedArray.empty?)
+ ensure
+ file.close
+ end
+
+ # Illegal format.
+ reader = CSV::Reader.create("a,b\r\na,b,\"c\"\ra")
+ assert_raises(CSV::IllegalFormatError) do
+ reader.each do |row|
+ end
+ end
+
+ reader = CSV::Reader.create("a,b\r\n\"")
+ assert_raises(CSV::IllegalFormatError) do
+ reader.each do |row|
+ end
+ end
+ end
+
+ def test_Reader_shift
+ file = File.open(@infile, "rb")
+ begin
+ reader = CSV::Reader.create(file)
+ first = true
+ checked = 0
+ @@fullCSVDataArray.each do |expected|
+ actual = reader.shift
+ if first
+ assert_instance_of(Array, actual)
+ first = false
+ end
+ assert_equal(expected, actual)
+ checked += 1
+ end
+ assert(checked == @@fullCSVDataArray.size)
+ ensure
+ file.close
+ end
+
+ # Illegal format.
+ reader = CSV::Reader.create("a,b\r\na,b,\"c\"\ra")
+ assert_raises(CSV::IllegalFormatError) do
+ reader.shift
+ reader.shift
+ end
+
+ reader = CSV::Reader.create("a,b\r\na,b,\"c\"\ra")
+ assert_raises(CSV::IllegalFormatError) do
+ reader.shift
+ reader.shift
+ end
+ end
+
+ def test_Reader_getRow
+ if CSV::Reader.respond_to?(:allocate)
+ obj = CSV::Reader.allocate
+ assert_raises(NotImplementedError) do
+ row = []
+ obj.shift
+ end
+ end
+ end
+
+ def test_IOReader_close_on_terminate
+ f = File.open(@infile, "r")
+ reader = CSV::IOReader.create(f)
+ reader.close
+ assert(!f.closed?)
+ f.close
+
+ f = File.open(@infile, "r")
+ writer = CSV::IOReader.create(f)
+ writer.close_on_terminate
+ writer.close
+ assert(f.closed?)
+ end
+
+ def test_Reader_close
+ f = File.open(@infile, "r")
+ reader = CSV::IOReader.create(f)
+ reader.close_on_terminate
+ reader.close
+ assert(f.closed?)
+ end
+
+ def test_Reader_s_new
+ assert_raises(RuntimeError) do
+ CSV::Reader.new(nil)
+ end
+ end
+
+ def test_Reader_s_create
+ reader = CSV::Reader.create("abc")
+ assert_instance_of(CSV::StringReader, reader, "With a String")
+
+ file = File.open(@infile, "rb")
+ reader = CSV::Reader.create(file)
+ assert_instance_of(CSV::IOReader, reader, 'With an IO')
+
+ obj = Object.new
+ def obj.sysread(size)
+ "abc"
+ end
+ def obj.read(size)
+ "abc"
+ end
+ reader = CSV::Reader.create(obj)
+ assert_instance_of(CSV::IOReader, reader, "With not an IO or String")
+
+ # No need to test Tempfile because it's a pseudo IO. I test this here
+ # fors other tests.
+ reader = CSV::Reader.create(Tempfile.new("in.csv"))
+ assert_instance_of(CSV::IOReader, reader, "With an pseudo IO.")
+ file.close
+ end
+
+ def test_IOReader_s_create_binmode
+ file = File.open(@outfile, "wb")
+ file << "\"\r\n\",\"\r\",\"\n\"\r1,2,3"
+ file.close
+
+ file = File.open(@outfile, "rb")
+ begin
+ reader = CSV::IOReader.new(file, ?,, ?\r)
+ assert_equal(["\r\n", "\r", "\n"], reader.shift.to_a)
+ assert_equal(["1", "2", "3"], reader.shift.to_a)
+ reader.close
+ ensure
+ file.close
+ end
+
+ file = File.open(@outfile, "r") # not "rb"
+ begin
+ lfincell = (RSEP == "\n" ? "\r\n" : "\n")
+ reader = CSV::IOReader.new(file, ?,, ?\r)
+ assert_equal([lfincell, "\r", "\n"], reader.shift.to_a)
+ assert_equal(["1", "2", "3"], reader.shift.to_a)
+ reader.close
+ ensure
+ file.close
+ end
+ end
+
+ def test_Reader_s_parse
+ ret = CSV::Reader.parse("a,b,c") { |row|
+ assert_instance_of(Array, row, "Block parameter")
+ }
+ assert_nil(ret, "Return is nil")
+
+ ret = CSV::Reader.parse("a;b;c", ?;) { |row|
+ assert_instance_of(Array, row, "Block parameter")
+ }
+
+ file = Tempfile.new("in.csv")
+ file << "a,b,c"
+ file.open
+ ret = CSV::Reader.parse(file) { |row|
+ assert_instance_of(Array, row, "Block parameter")
+ }
+ assert_nil(ret, "Return is nil")
+
+ file = Tempfile.new("in.csv")
+ file << "a,b,c"
+ file.open
+ ret = CSV::Reader.parse(file, ?,) { |row|
+ assert_instance_of(Array, row, "Block parameter")
+ }
+
+ # Illegal format.
+ assert_raises(CSV::IllegalFormatError) do
+ CSV::Reader.parse("a,b\r\na,b,\"c\"\ra") do |row|
+ end
+ end
+
+ assert_raises(CSV::IllegalFormatError) do
+ CSV::Reader.parse("a,b\r\na,b\"") do |row|
+ end
+ end
+ end
+
+
+ #### CSV::Writer unit test
+
+ def test_Writer_s_new
+ assert_raises(RuntimeError) do
+ CSV::Writer.new(nil)
+ end
+ end
+
+ def test_Writer_s_generate
+ ret = CSV::Writer.generate(STDOUT) { |writer|
+ assert_instance_of(CSV::BasicWriter, writer, "Block parameter")
+ }
+
+ ret = CSV::Writer.generate(STDOUT, ?;) { |writer|
+ assert_instance_of(CSV::BasicWriter, writer, "Block parameter")
+ }
+
+ assert_nil(ret, "Return is nil")
+ end
+
+ def test_Writer_s_create
+ writer = CSV::Writer.create(STDERR)
+ assert_instance_of(CSV::BasicWriter, writer, "String")
+
+ writer = CSV::Writer.create(STDERR, ?;)
+ assert_instance_of(CSV::BasicWriter, writer, "String")
+
+ writer = CSV::Writer.create(Tempfile.new("out.csv"))
+ assert_instance_of(CSV::BasicWriter, writer, "IO")
+ end
+
+ def test_Writer_LSHIFT # '<<'
+ file = Tempfile.new("out.csv")
+ CSV::Writer.generate(file) do |writer|
+ ret = writer << ['a', 'b', 'c']
+ assert_instance_of(CSV::BasicWriter, ret, 'Return is self')
+
+ writer << [nil, 'e', 'f'] << [nil, nil, '']
+ end
+ file.open
+ file.binmode
+ str = file.read
+ assert_equal("a,b,c#{RSEP},e,f#{RSEP},,\"\"#{RSEP}", str, 'Normal')
+
+ file = Tempfile.new("out2.csv")
+ CSV::Writer.generate(file) do |writer|
+ ret = writer << [d('a'), d('b'), d('c')]
+ assert_instance_of(CSV::BasicWriter, ret, 'Return is self')
+
+ writer << [d(nil), d('e'), d('f')] << [d(nil), d(nil), d('')]
+ end
+ file.open
+ file.binmode
+ str = file.read
+ assert_equal("a,b,c#{RSEP},e,f#{RSEP},,\"\"#{RSEP}", str, 'Normal')
+ end
+
+ def test_Writer_add_row
+ file = Tempfile.new("out.csv")
+ CSV::Writer.generate(file) do |writer|
+ ret = writer.add_row(
+ [d('a'), d('b'), d('c')])
+ assert_instance_of(CSV::BasicWriter, ret, 'Return is self')
+
+ writer.add_row(
+ [d(nil), d('e'), d('f')]
+ ).add_row(
+ [d(nil), d(nil), d('')]
+ )
+ end
+ file.open
+ file.binmode
+ str = file.read
+ assert_equal("a,b,c#{RSEP},e,f#{RSEP},,\"\"#{RSEP}", str, 'Normal')
+ end
+
+ def test_Writer_close
+ f = File.open(@outfile, "w")
+ writer = CSV::BasicWriter.create(f)
+ writer.close_on_terminate
+ writer.close
+ assert(f.closed?)
+ end
+
+ def test_BasicWriter_close_on_terminate
+ f = File.open(@outfile, "w")
+ writer = CSV::BasicWriter.create(f)
+ writer.close
+ assert(!f.closed?)
+ f.close
+
+ f = File.open(@outfile, "w")
+ writer = CSV::BasicWriter.new(f)
+ writer.close_on_terminate
+ writer.close
+ assert(f.closed?)
+ end
+
+ def test_BasicWriter_s_create_binmode
+ file = File.open(@outfile, "w") # not "wb"
+ begin
+ writer = CSV::BasicWriter.new(file, ?,, ?\r)
+ writer << ["\r\n", "\r", "\n"]
+ writer << ["1", "2", "3"]
+ writer.close
+ ensure
+ file.close
+ end
+
+ file = File.open(@outfile, "rb")
+ str = file.read
+ file.close
+ assert_equal("\"\r#{RSEP}\",\"\r\",\"#{RSEP}\"\r1,2,3\r", str)
+ end
+
+ #### CSV unit test
+
+ def test_s_open_reader
+ assert_raises(ArgumentError, 'Illegal mode') do
+ CSV.open("temp", "a")
+ end
+
+ assert_raises(ArgumentError, 'Illegal mode') do
+ CSV.open("temp", "a", ?;)
+ end
+
+ reader = CSV.open(@infile, "r")
+ assert_instance_of(CSV::IOReader, reader)
+ reader.close
+
+ reader = CSV.open(@infile, "rb")
+ assert_instance_of(CSV::IOReader, reader)
+ reader.close
+
+ reader = CSV.open(@infile, "r", ?;)
+ assert_instance_of(CSV::IOReader, reader)
+ reader.close
+
+ CSV.open(@infile, "r") do |row|
+ assert_instance_of(Array, row)
+ break
+ end
+
+ CSV.open(@infiletsv, "r", ?\t) do |row|
+ assert_instance_of(Array, row)
+ break
+ end
+
+ assert_raises(Errno::ENOENT) do
+ CSV.open("NoSuchFileOrDirectory", "r")
+ end
+
+ assert_raises(Errno::ENOENT) do
+ CSV.open("NoSuchFileOrDirectory", "r", ?;)
+ end
+
+ # Illegal format.
+ File.open(@outfile, "wb") do |f|
+ f << "a,b\r\na,b,\"c\"\ra"
+ end
+ assert_raises(CSV::IllegalFormatError) do
+ CSV.open(@outfile, "r") do |row|
+ end
+ end
+
+ File.open(@outfile, "wb") do |f|
+ f << "a,b\r\na,b\""
+ end
+ assert_raises(CSV::IllegalFormatError) do
+ CSV.open(@outfile, "r") do |row|
+ end
+ end
+
+ CSV.open(@emptyfile, "r") do |row|
+ assert_fail("Must not reach here")
+ end
+ end
+
+ def test_s_parse
+ result = CSV.parse(File.read(@infile))
+ assert_instance_of(Array, result)
+ assert_instance_of(Array, result[0])
+
+ result = CSV.parse(File.read(@infile))
+ assert_instance_of(Array, result)
+ assert_instance_of(Array, result[0])
+
+ assert_equal([], CSV.parse(""))
+ assert_equal([[nil]], CSV.parse("\n"))
+
+ CSV.parse(File.read(@infile)) do |row|
+ assert_instance_of(Array, row)
+ break
+ end
+
+ CSV.parse(File.read(@infiletsv), ?\t) do |row|
+ assert_instance_of(Array, row)
+ break
+ end
+
+ CSV.parse("") do |row|
+ assert(false)
+ end
+
+ count = 0
+ CSV.parse("\n") do |row|
+ assert_equal([nil], row)
+ count += 1
+ end
+ assert_equal(1, count)
+
+ assert_equal([["a|b-c|d"]], CSV.parse("a|b-c|d"))
+ assert_equal([["a", "b"], ["c", "d"]], CSV.parse("a|b-c|d", "|", "-"))
+ end
+
+ def test_s_open_writer
+ writer = CSV.open(@outfile, "w")
+ assert_instance_of(CSV::BasicWriter, writer)
+ writer.close
+
+ writer = CSV.open(@outfile, "wb")
+ assert_instance_of(CSV::BasicWriter, writer)
+ writer.close
+
+ writer = CSV.open(@outfile, "wb", ?;)
+ assert_instance_of(CSV::BasicWriter, writer)
+ writer.close
+
+ CSV.open(@outfile, "w") do |writer|
+ assert_instance_of(CSV::BasicWriter, writer)
+ end
+
+ CSV.open(@outfile, "w", ?;) do |writer|
+ assert_instance_of(CSV::BasicWriter, writer)
+ end
+
+ begin
+ CSV.open(@tmpdir, "w")
+ assert(false)
+ rescue Exception => ex
+ assert(ex.is_a?(Errno::EEXIST) || ex.is_a?(Errno::EISDIR) || ex.is_a?(Errno::EACCES))
+ end
+ end
+
+ def test_s_generate
+ writer = CSV.generate(@outfile)
+ assert_instance_of(CSV::BasicWriter, writer)
+ writer.close
+
+ writer = CSV.generate(@outfile, ?;)
+ assert_instance_of(CSV::BasicWriter, writer)
+ writer.close
+
+ CSV.generate(@outfile) do |writer|
+ assert_instance_of(CSV::BasicWriter, writer)
+ end
+
+ CSV.generate(@outfile, ?;) do |writer|
+ assert_instance_of(CSV::BasicWriter, writer)
+ end
+
+ begin
+ CSV.generate(@tmpdir)
+ assert(false)
+ rescue Exception => ex
+ assert(ex.is_a?(Errno::EEXIST) || ex.is_a?(Errno::EISDIR) || ex.is_a?(Errno::EACCES))
+ end
+ end
+
+ def test_s_generate_line
+ str = CSV.generate_line([])
+ assert_equal('', str, "Extra boundary check.")
+
+ str = CSV.generate_line([], ?;)
+ assert_equal('', str, "Extra boundary check.")
+
+ @@simpleCSVData.each do |col, str|
+ buf = CSV.generate_line(col)
+ assert_equal(str, buf)
+ end
+
+ @@simpleCSVData.each do |col, str|
+ buf = CSV.generate_line(col, ?;)
+ assert_equal(str + "\n", ssv2csv(buf))
+ end
+
+ @@simpleCSVData.each do |col, str|
+ buf = CSV.generate_line(col, ?\t)
+ assert_equal(str + "\n", tsv2csv(buf))
+ end
+
+ str = CSV.generate_line(['a', 'b'], nil, ?|)
+ assert_equal('a,b', str)
+
+ str = CSV.generate_line(['a', 'b'], nil, "a")
+ assert_equal('"a",b', str)
+ end
+
+ def test_s_generate_row
+ buf = ''
+ cols = CSV.generate_row([], 0, buf)
+ assert_equal(0, cols)
+ assert_equal("\n", buf, "Extra boundary check.")
+
+ buf = ''
+ cols = CSV.generate_row([], 0, buf, ?;)
+ assert_equal(0, cols)
+ assert_equal("\n", buf, "Extra boundary check.")
+
+ buf = ''
+ cols = CSV.generate_row([], 0, buf, ?\t)
+ assert_equal(0, cols)
+ assert_equal("\n", buf, "Extra boundary check.")
+
+ buf = ''
+ cols = CSV.generate_row([], 0, buf, ?\t, ?|)
+ assert_equal(0, cols)
+ assert_equal("|", buf, "Extra boundary check.")
+
+ buf = ''
+ cols = CSV.generate_row([d('1')], 2, buf)
+ assert_equal('1,', buf)
+
+ buf = ''
+ cols = CSV.generate_row([d('1')], 2, buf, ?;)
+ assert_equal('1;', buf)
+
+ buf = ''
+ cols = CSV.generate_row([d('1')], 2, buf, ?\t)
+ assert_equal("1\t", buf)
+
+ buf = ''
+ cols = CSV.generate_row([d('1')], 2, buf, ?\t, ?|)
+ assert_equal("1\t", buf)
+
+ buf = ''
+ cols = CSV.generate_row([d('1'), d('2')], 1, buf)
+ assert_equal("1\n", buf)
+
+ buf = ''
+ cols = CSV.generate_row([d('1'), d('2')], 1, buf, ?;)
+ assert_equal("1\n", buf)
+
+ buf = ''
+ cols = CSV.generate_row([d('1'), d('2')], 1, buf, ?\t)
+ assert_equal("1\n", buf)
+
+ buf = ''
+ cols = CSV.generate_row([d('1'), d('2')], 1, buf, ?\t, ?\n)
+ assert_equal("1\n", buf)
+
+ buf = ''
+ cols = CSV.generate_row([d('1'), d('2')], 1, buf, ?\t, ?\r)
+ assert_equal("1\r", buf)
+
+ buf = ''
+ cols = CSV.generate_row([d('1'), d('2')], 1, buf, ?\t, ?|)
+ assert_equal("1|", buf)
+
+ @@fullCSVData.each do |col, str|
+ buf = ''
+ cols = CSV.generate_row(col, col.size, buf)
+ assert_equal(col.size, cols)
+ assert_equal(str + "\n", buf)
+ end
+
+ @@fullCSVData.each do |col, str|
+ buf = ''
+ cols = CSV.generate_row(col, col.size, buf, ?;)
+ assert_equal(col.size, cols)
+ assert_equal(str + "\n", ssv2csv(buf))
+ end
+
+ @@fullCSVData.each do |col, str|
+ buf = ''
+ cols = CSV.generate_row(col, col.size, buf, ?\t)
+ assert_equal(col.size, cols)
+ assert_equal(str + "\n", tsv2csv(buf))
+ end
+
+ # row separator
+ @@fullCSVData.each do |col, str|
+ buf = ''
+ cols = CSV.generate_row(col, col.size, buf, ?,, ?|)
+ assert_equal(col.size, cols)
+ assert_equal(str + "|", buf)
+ end
+
+ # col and row separator
+ @@fullCSVData.each do |col, str|
+ buf = ''
+ cols = CSV.generate_row(col, col.size, buf, ?\t, ?|)
+ assert_equal(col.size, cols)
+ assert_equal(str + "|", tsv2csv(buf, ?|))
+ end
+
+ buf = ''
+ toBe = ''
+ cols = 0
+ colsToBe = 0
+ @@fullCSVData.each do |col, str|
+ cols += CSV.generate_row(col, col.size, buf)
+ toBe << str << "\n"
+ colsToBe += col.size
+ end
+ assert_equal(colsToBe, cols)
+ assert_equal(toBe, buf)
+
+ buf = ''
+ toBe = ''
+ cols = 0
+ colsToBe = 0
+ @@fullCSVData.each do |col, str|
+ lineBuf = ''
+ cols += CSV.generate_row(col, col.size, lineBuf, ?;)
+ buf << ssv2csv(lineBuf) << "\n"
+ toBe << ssv2csv(lineBuf) << "\n"
+ colsToBe += col.size
+ end
+ assert_equal(colsToBe, cols)
+ assert_equal(toBe, buf)
+
+ buf = ''
+ toBe = ''
+ cols = 0
+ colsToBe = 0
+ @@fullCSVData.each do |col, str|
+ lineBuf = ''
+ cols += CSV.generate_row(col, col.size, lineBuf, ?\t)
+ buf << tsv2csv(lineBuf) << "\n"
+ toBe << tsv2csv(lineBuf) << "\n"
+ colsToBe += col.size
+ end
+ assert_equal(colsToBe, cols)
+ assert_equal(toBe, buf)
+
+ buf = ''
+ toBe = ''
+ cols = 0
+ colsToBe = 0
+ @@fullCSVData.each do |col, str|
+ lineBuf = ''
+ cols += CSV.generate_row(col, col.size, lineBuf, ?|)
+ buf << tsv2csv(lineBuf, ?|)
+ toBe << tsv2csv(lineBuf, ?|)
+ colsToBe += col.size
+ end
+ assert_equal(colsToBe, cols)
+ assert_equal(toBe, buf)
+ end
+
+ def test_s_parse_line
+ @@simpleCSVData.each do |col, str|
+ row = CSV.parse_line(str)
+ assert_instance_of(Array, row)
+ assert_equal(col.size, row.size)
+ assert_equal(col, row)
+ end
+
+ @@simpleCSVData.each do |col, str|
+ str = csv2ssv(str)
+ row = CSV.parse_line(str, ?;)
+ assert_instance_of(Array, row)
+ assert_equal(col.size, row.size, str.inspect)
+ assert_equal(col, row, str.inspect)
+ end
+
+ @@simpleCSVData.each do |col, str|
+ str = csv2tsv(str)
+ row = CSV.parse_line(str, ?\t)
+ assert_instance_of(Array, row)
+ assert_equal(col.size, row.size)
+ assert_equal(col, row)
+ end
+
+ assert_equal(['a', 'b', 'c'], CSV.parse_line("a,b,c", nil, nil))
+ assert_equal(['a', nil], CSV.parse_line("a,b,c", nil, ?b))
+ assert_equal(['a', 'b', nil], CSV.parse_line("a,b,c", nil, "c"))
+ assert_equal([nil], CSV.parse_line(""))
+ assert_equal([nil], CSV.parse_line("\n"))
+ assert_equal([""], CSV.parse_line("\"\"\n"))
+
+ # Illegal format.
+ buf = []
+ row = CSV.parse_line("a,b,\"c\"\ra")
+ assert_instance_of(Array, row)
+ assert_equal(0, row.size)
+
+ buf = Array.new
+ row = CSV.parse_line("a;b;\"c\"\ra", ?;)
+ assert_instance_of(Array, row)
+ assert_equal(0, row.size)
+
+ buf = Array.new
+ row = CSV.parse_line("a\tb\t\"c\"\ra", ?\t)
+ assert_instance_of(Array, row)
+ assert_equal(0, row.size)
+
+ row = CSV.parse_line("a,b\"")
+ assert_instance_of(Array, row)
+ assert_equal(0, row.size)
+
+ row = CSV.parse_line("a;b\"", ?;)
+ assert_instance_of(Array, row)
+ assert_equal(0, row.size)
+
+ row = CSV.parse_line("a\tb\"", ?\t)
+ assert_instance_of(Array, row)
+ assert_equal(0, row.size)
+
+ row = CSV.parse_line("\"a,b\"\r,")
+ assert_instance_of(Array, row)
+ assert_equal(0, row.size)
+
+ row = CSV.parse_line("\"a;b\"\r;", ?;)
+ assert_instance_of(Array, row)
+ assert_equal(0, row.size)
+
+ row = CSV.parse_line("\"a\tb\"\r\t", ?\t)
+ assert_instance_of(Array, row)
+ assert_equal(0, row.size)
+
+ row = CSV.parse_line("\"a,b\"\r\"")
+ assert_instance_of(Array, row)
+ assert_equal(0, row.size)
+
+ row = CSV.parse_line("\"a;b\"\r\"", ?;)
+ assert_instance_of(Array, row)
+ assert_equal(0, row.size)
+
+ row = CSV.parse_line("\"a\tb\"\r\"", ?\t)
+ assert_instance_of(Array, row)
+ assert_equal(0, row.size)
+ end
+
+ def test_s_parse_row
+ @@fullCSVData.each do |col, str|
+ buf = Array.new
+ cols, idx = CSV.parse_row(str + "\r\n", 0, buf)
+ assert_equal(cols, buf.size, "Reported size.")
+ assert_equal(col.size, buf.size, "Size.")
+ assert_equal(col, buf, str.inspect)
+
+ buf = Array.new
+ cols, idx = CSV.parse_row(str + "\n", 0, buf, ?,, ?\n)
+ assert_equal(cols, buf.size, "Reported size.")
+ assert_equal(col.size, buf.size, "Size.")
+ assert_equal(col, buf, str.inspect)
+
+ # separator: |
+ buf = Array.new
+ cols, idx = CSV.parse_row(str + "|", 0, buf, ?,)
+ assert_not_equal(col, buf)
+ buf = Array.new
+ cols, idx = CSV.parse_row(str + "|", 0, buf, ?,, ?|)
+ assert_equal(cols, buf.size, "Reported size.")
+ assert_equal(col.size, buf.size, "Size.")
+ assert_equal(col, buf, str.inspect)
+ end
+
+ @@fullCSVData.each do |col, str|
+ str = csv2ssv(str)
+ buf = Array.new
+ cols, idx = CSV.parse_row(str + "\r\n", 0, buf, ?;)
+ assert_equal(cols, buf.size, "Reported size.")
+ assert_equal(col.size, buf.size, "Size.")
+ assert_equal(col, buf, str)
+ end
+
+ @@fullCSVData.each do |col, str|
+ str = csv2tsv(str)
+ buf = Array.new
+ cols, idx = CSV.parse_row(str + "\r\n", 0, buf, ?\t)
+ assert_equal(cols, buf.size, "Reported size.")
+ assert_equal(col.size, buf.size, "Size.")
+ assert_equal(col, buf, str)
+ end
+
+ @@fullCSVData.each do |col, str|
+ str = csv2tsv(str, ?|)
+ buf = Array.new
+ cols, idx = CSV.parse_row(str + "|", 0, buf, ?\t, ?|)
+ assert_equal(cols, buf.size, "Reported size.")
+ assert_equal(col.size, buf.size, "Size.")
+ assert_equal(col, buf, str)
+ end
+
+ buf = []
+ CSV.parse_row("a,b,c", 0, buf, nil, nil)
+ assert_equal(['a', 'b', 'c'], buf)
+
+ buf = []
+ CSV.parse_row("a,b,c", 0, buf, nil, ?b)
+ assert_equal(['a', nil], buf)
+
+ buf = []
+ CSV.parse_row("a,b,c", 0, buf, nil, "c")
+ assert_equal(['a', 'b', nil], buf)
+
+ buf = Array.new
+ cols, idx = CSV.parse_row("a,b,\"c\r\"", 0, buf)
+ assert_equal(["a", "b", "c\r"], buf.to_a)
+
+ buf = Array.new
+ cols, idx = CSV.parse_row("a;b;\"c\r\"", 0, buf, ?;)
+ assert_equal(["a", "b", "c\r"], buf.to_a)
+
+ buf = Array.new
+ cols, idx = CSV.parse_row("a\tb\t\"c\r\"", 0, buf, ?\t)
+ assert_equal(["a", "b", "c\r"], buf.to_a)
+
+ buf = Array.new
+ cols, idx = CSV.parse_row("a,b,c\n", 0, buf, ?,, ?\n)
+ assert_equal(["a", "b", "c"], buf.to_a)
+
+ buf = Array.new
+ cols, idx = CSV.parse_row("a\tb\tc\n", 0, buf, ?\t, ?\n)
+ assert_equal(["a", "b", "c"], buf.to_a)
+
+ # Illegal format.
+ buf = Array.new
+ cols, idx = CSV.parse_row("a,b,c\"", 0, buf)
+ assert_equal(0, cols, "Illegal format; unbalanced double-quote.")
+
+ buf = Array.new
+ cols, idx = CSV.parse_row("a;b;c\"", 0, buf, ?;)
+ assert_equal(0, cols, "Illegal format; unbalanced double-quote.")
+
+ buf = Array.new
+ cols, idx = CSV.parse_row("a,b,\"c\"\ra", 0, buf)
+ assert_equal(0, cols)
+ assert_equal(0, idx)
+
+ buf = Array.new
+ cols, idx = CSV.parse_row("a,b,\"c\"\ra", 0, buf, ?;)
+ assert_equal(0, cols)
+ assert_equal(0, idx)
+
+ buf = Array.new
+ cols, idx = CSV.parse_row("a,b\"", 0, buf)
+ assert_equal(0, cols)
+ assert_equal(0, idx)
+
+ buf = Array.new
+ cols, idx = CSV.parse_row("a;b\"", 0, buf, ?;)
+ assert_equal(0, cols)
+ assert_equal(0, idx)
+
+ buf = Array.new
+ cols, idx = CSV.parse_row("\"a,b\"\r,", 0, buf)
+ assert_equal(0, cols)
+ assert_equal(0, idx)
+
+ buf = Array.new
+ cols, idx = CSV.parse_row("a\r,", 0, buf)
+ assert_equal(0, cols)
+ assert_equal(0, idx)
+
+ buf = Array.new
+ cols, idx = CSV.parse_row("a\r", 0, buf)
+ assert_equal(0, cols)
+ assert_equal(0, idx)
+
+ buf = Array.new
+ cols, idx = CSV.parse_row("a\rbc", 0, buf)
+ assert_equal(0, cols)
+ assert_equal(0, idx)
+
+ buf = Array.new
+ cols, idx = CSV.parse_row("a\r\"\"", 0, buf)
+ assert_equal(0, cols)
+ assert_equal(0, idx)
+
+ buf = Array.new
+ cols, idx = CSV.parse_row("a\r\rabc,", 0, buf)
+ assert_equal(0, cols)
+ assert_equal(0, idx)
+
+ buf = Array.new
+ cols, idx = CSV.parse_row("\"a;b\"\r;", 0, buf, ?;)
+ assert_equal(0, cols)
+ assert_equal(0, idx)
+
+ buf = Array.new
+ cols, idx = CSV.parse_row("\"a,b\"\r\"", 0, buf)
+ assert_equal(0, cols)
+ assert_equal(0, idx)
+
+ buf = Array.new
+ cols, idx = CSV.parse_row("\"a;b\"\r\"", 0, buf, ?;)
+ assert_equal(0, cols)
+ assert_equal(0, idx)
+ end
+
+ def test_s_parse_rowEOF
+ @@fullCSVData.each do |col, str|
+ if str == ''
+ # String "" is not allowed.
+ next
+ end
+ buf = Array.new
+ cols, idx = CSV.parse_row(str, 0, buf)
+ assert_equal(col.size, cols, "Reported size.")
+ assert_equal(col.size, buf.size, "Size.")
+ assert_equal(col, buf)
+ end
+ end
+
+ def test_s_parse_rowConcat
+ buf = ''
+ toBe = []
+ @@fullCSVData.each do |col, str|
+ buf << str << "\r\n"
+ toBe.concat(col)
+ end
+ idx = 0
+ cols = 0
+ parsed = Array.new
+ parsedCols = 0
+ begin
+ cols, idx = CSV.parse_row(buf, idx, parsed)
+ parsedCols += cols
+ end while cols > 0
+ assert_equal(toBe.size, parsedCols)
+ assert_equal(toBe.size, parsed.size)
+ assert_equal(toBe, parsed)
+
+ buf = ''
+ toBe = []
+ @@fullCSVData.each do |col, str|
+ buf << str << "\n"
+ toBe.concat(col)
+ end
+ idx = 0
+ cols = 0
+ parsed = Array.new
+ parsedCols = 0
+ begin
+ cols, idx = CSV.parse_row(buf, idx, parsed, ?,, ?\n)
+ parsedCols += cols
+ end while cols > 0
+ assert_equal(toBe.size, parsedCols)
+ assert_equal(toBe.size, parsed.size)
+ assert_equal(toBe, parsed)
+
+ buf = ''
+ toBe = []
+ @@fullCSVData.sort { |a, b|
+ a[0].length <=> b[0].length
+ }.each do |col, str|
+ buf << str << "\n"
+ toBe.concat(col)
+ end
+ idx = 0
+ cols = 0
+ parsed = Array.new
+ parsedCols = 0
+ begin
+ cols, idx = CSV.parse_row(buf, idx, parsed, ?,, ?\n)
+ parsedCols += cols
+ end while cols > 0
+ assert_equal(toBe.size, parsedCols)
+ assert_equal(toBe.size, parsed.size)
+ assert_equal(toBe, parsed)
+
+ buf = ''
+ toBe = []
+ @@fullCSVData.each do |col, str|
+ buf << str << "|"
+ toBe.concat(col)
+ end
+ idx = 0
+ cols = 0
+ parsed = []
+ parsedCols = 0
+ begin
+ cols, idx = CSV.parse_row(buf, idx, parsed, ?,, ?|)
+ parsedCols += cols
+ end while cols > 0
+ assert_equal(toBe.size, parsedCols)
+ assert_equal(toBe.size, parsed.size)
+ assert_equal(toBe, parsed)
+ end
+
+ def test_utf8
+ rows = []
+ CSV.open(@bomfile, "r") do |row|
+ rows << row.to_a
+ end
+ assert_equal([["foo"], ["bar"]], rows)
+
+ rows = []
+ file = File.open(@bomfile)
+ CSV::Reader.parse(file) do |row|
+ rows << row.to_a
+ end
+ assert_equal([["foo"], ["bar"]], rows)
+ file.close
+ end
+
+ def test_macCR
+ rows = []
+ CSV.open(@macfile, "r", ?,, ?\r) do |row|
+ rows << row.to_a
+ end
+ assert_equal([["Avenches", "aus Umgebung"], ["Bad Hersfeld", "Ausgrabung"]], rows)
+
+ rows = []
+ assert_raises(CSV::IllegalFormatError) do
+ CSV.open(@macfile, "r") do |row|
+ rows << row.to_a
+ end
+ assert_equal([["Avenches", "aus Umgebung\r\"Bad Hersfeld", "Ausgrabung"]], rows)
+ end
+
+ rows = []
+ file = File.open(@macfile)
+ begin
+ CSV::Reader.parse(file, ?,, ?\r) do |row|
+ rows << row.to_a
+ end
+ assert_equal([["Avenches", "aus Umgebung"], ["Bad Hersfeld", "Ausgrabung"]], rows)
+ ensure
+ file.close
+ end
+
+ rows = []
+ file = File.open(@macfile)
+ begin
+ assert_raises(CSV::IllegalFormatError) do
+ CSV::Reader.parse(file, ?,) do |row|
+ rows << row.to_a
+ end
+ assert_equal([["Avenches", "aus Umgebung\r\"Bad Hersfeld", "Ausgrabung"]], rows)
+ end
+ ensure
+ file.close
+ end
+ end
+
+
+ #### CSV unit test
+
+ InputStreamPattern = '0123456789'
+ InputStreamPatternSize = InputStreamPattern.size
+ def expChar(idx)
+ InputStreamPattern[idx % InputStreamPatternSize]
+ end
+
+ def expStr(idx, n)
+ if n > InputStreamPatternSize
+ InputStreamPattern + expStr(0, n - InputStreamPatternSize)
+ else
+ InputStreamPattern[idx % InputStreamPatternSize, n]
+ end
+ end
+
+ def setupInputStream(size, bufSize = nil)
+ setBufSize(bufSize) if bufSize
+ m = ((size / InputStreamPatternSize) + 1).to_i
+ File.open(@outfile, "wb") do |f|
+ f << (InputStreamPattern * m)[0, size]
+ end
+ file = File.open(@outfile, "rb")
+ buf = CSV::IOBuf.new(file)
+ if block_given?
+ yield(buf)
+ file.close
+ nil
+ else
+ buf
+ end
+ end
+
+ def setBufSize(size)
+ CSV::StreamBuf.module_eval('remove_const("BufSize")')
+ CSV::StreamBuf.module_eval("BufSize = #{ size }")
+ end
+
+ class StrBuf < CSV::StreamBuf
+ private
+ def initialize(string)
+ @str = string
+ @idx = 0
+ super()
+ end
+
+ def read(size)
+ str = @str[@idx, size]
+ if str.empty?
+ nil
+ else
+ @idx += str.size
+ str
+ end
+ end
+ end
+
+ class ErrBuf < CSV::StreamBuf
+ class Error < RuntimeError; end
+ private
+ def initialize
+ @first = true
+ super()
+ end
+
+ def read(size)
+ if @first
+ @first = false
+ "a" * size
+ else
+ raise ErrBuf::Error.new
+ end
+ end
+ end
+
+ def test_StreamBuf_MyBuf
+ # At first, check ruby's behaviour.
+ s = "abc"
+ assert_equal(?a, s[0])
+ assert_equal(?b, s[1])
+ assert_equal(?c, s[2])
+ assert_equal(nil, s[3])
+ assert_equal("a", s[0, 1])
+ assert_equal("b", s[1, 1])
+ assert_equal("c", s[2, 1])
+ assert_equal("", s[3, 1])
+ assert_equal(nil, s[4, 1])
+
+ s = StrBuf.new("abc")
+ assert_equal(?a, s[0])
+ assert_equal(?b, s.get(1))
+ assert_equal(?c, s[2])
+ assert_equal(nil, s.get(3))
+ assert_equal("a", s[0, 1])
+ assert_equal("b", s.get(1, 1))
+ assert_equal("c", s[2, 1])
+ assert_equal("", s.get(3, 1))
+ assert_equal(nil, s[4, 1])
+
+ dropped = s.drop(1)
+ assert_equal(1, dropped)
+ assert_equal(?b, s[0])
+ assert(!s.is_eos?)
+ dropped = s.drop(1)
+ assert_equal(1, dropped)
+ assert_equal(?c, s[0])
+ assert(!s.is_eos?)
+ dropped = s.drop(1)
+ assert_equal(1, dropped)
+ assert_equal(nil, s[0])
+ assert(s.is_eos?)
+ dropped = s.drop(1)
+ assert_equal(0, dropped)
+ assert_equal(nil, s[0])
+ assert(s.is_eos?)
+
+ s = StrBuf.new("")
+ assert_equal(nil, s[0])
+
+ s = StrBuf.new("")
+ dropped = s.drop(1)
+ assert_equal(0, dropped)
+
+ assert_raises(TestCSV::ErrBuf::Error) do
+ s = ErrBuf.new
+ s[1024]
+ end
+
+ assert_raises(TestCSV::ErrBuf::Error) do
+ s = ErrBuf.new
+ s.drop(1024)
+ end
+ end
+
+ def test_StreamBuf_AREF # '[idx]'
+ setupInputStream(22, 1024) do |s|
+ [0, 1, 9, 10, 19, 20, 21].each do |idx|
+ assert_equal(expChar(idx), s[idx], idx.to_s)
+ end
+ [22, 23].each do |idx|
+ assert_equal(nil, s[idx], idx.to_s)
+ end
+ assert_equal(nil, s[-1])
+ end
+
+ setupInputStream(22, 1) do |s|
+ [0, 1, 9, 10, 19, 20, 21].each do |idx|
+ assert_equal(expChar(idx), s[idx], idx.to_s)
+ end
+ [22, 23].each do |idx|
+ assert_equal(nil, s[idx], idx.to_s)
+ end
+ end
+
+ setupInputStream(1024, 1) do |s|
+ [1023, 0].each do |idx|
+ assert_equal(expChar(idx), s[idx], idx.to_s)
+ end
+ [1024, 1025].each do |idx|
+ assert_equal(nil, s[idx], idx.to_s)
+ end
+ end
+
+ setupInputStream(1, 1) do |s|
+ [0].each do |idx|
+ assert_equal(expChar(idx), s[idx], idx.to_s)
+ end
+ [1, 2].each do |idx|
+ assert_equal(nil, s[idx], idx.to_s)
+ end
+ end
+ end
+
+ def test_StreamBuf_AREF_n # '[idx, n]'
+ # At first, check ruby's behaviour.
+ assert_equal("", "abc"[3, 1])
+ assert_equal(nil, "abc"[4, 1])
+
+ setupInputStream(22, 1024) do |s|
+ [0, 1, 9, 10, 19, 20, 21].each do |idx|
+ assert_equal(expStr(idx, 1), s[idx, 1], idx.to_s)
+ end
+ assert_equal("", s[22, 1])
+ assert_equal(nil, s[23, 1])
+ end
+
+ setupInputStream(22, 1) do |s|
+ [0, 1, 9, 10, 19, 20, 21].each do |idx|
+ assert_equal(expStr(idx, 1), s[idx, 1], idx.to_s)
+ end
+ assert_equal("", s[22, 1])
+ assert_equal(nil, s[23, 1])
+ end
+
+ setupInputStream(1024, 1) do |s|
+ [1023, 0].each do |idx|
+ assert_equal(expStr(idx, 1), s[idx, 1], idx.to_s)
+ end
+ assert_equal("", s[1024, 1])
+ assert_equal(nil, s[1025, 1])
+ end
+
+ setupInputStream(1, 1) do |s|
+ [0].each do |idx|
+ assert_equal(expStr(idx, 1), s[idx, 1], idx.to_s)
+ end
+ assert_equal("", s[1, 1])
+ assert_equal(nil, s[2, 1])
+ end
+
+ setupInputStream(22, 11) do |s|
+ [0, 1, 10, 11, 20].each do |idx|
+ assert_equal(expStr(idx, 2), s[idx, 2], idx.to_s)
+ end
+ assert_equal(expStr(21, 1), s[21, 2])
+
+ assert_equal(expStr(0, 12), s[0, 12])
+ assert_equal(expStr(10, 12), s[10, 12])
+ assert_equal(expStr(10, 12), s[10, 13])
+ assert_equal(expStr(10, 12), s[10, 14])
+ assert_equal(expStr(10, 12), s[10, 1024])
+
+ assert_equal(nil, s[0, -1])
+ assert_equal(nil, s[21, -1])
+
+ assert_equal(nil, s[-1, 10])
+ assert_equal(nil, s[-1, -1])
+ end
+ end
+
+ def test_StreamBuf_get
+ setupInputStream(22, 1024) do |s|
+ [0, 1, 9, 10, 19, 20, 21].each do |idx|
+ assert_equal(expChar(idx), s.get(idx), idx.to_s)
+ end
+ [22, 23].each do |idx|
+ assert_equal(nil, s.get(idx), idx.to_s)
+ end
+ assert_equal(nil, s.get(-1))
+ end
+ end
+
+ def test_StreamBuf_get_n
+ setupInputStream(22, 1024) do |s|
+ [0, 1, 9, 10, 19, 20, 21].each do |idx|
+ assert_equal(expStr(idx, 1), s.get(idx, 1), idx.to_s)
+ end
+ assert_equal("", s.get(22, 1))
+ assert_equal(nil, s.get(23, 1))
+
+ assert_equal(nil, s.get(-1, 1))
+ assert_equal(nil, s.get(-1, -1))
+ end
+ end
+
+ def test_StreamBuf_drop
+ setupInputStream(22, 1024) do |s|
+ assert_equal(expChar(0), s[0])
+ assert_equal(expChar(21), s[21])
+ assert_equal(nil, s[22])
+
+ dropped = s.drop(-1)
+ assert_equal(0, dropped)
+ assert_equal(expChar(0), s[0])
+
+ dropped = s.drop(0)
+ assert_equal(0, dropped)
+ assert_equal(expChar(0), s[0])
+
+ dropped = s.drop(1)
+ assert_equal(1, dropped)
+ assert_equal(expChar(1), s[0])
+ assert_equal(expChar(2), s[1])
+
+ dropped = s.drop(1)
+ assert_equal(1, dropped)
+ assert_equal(expChar(2), s[0])
+ assert_equal(expChar(3), s[1])
+ end
+
+ setupInputStream(4, 2) do |s|
+ dropped = s.drop(2)
+ assert_equal(2, dropped)
+ assert_equal(expChar(2), s[0])
+ assert_equal(expChar(3), s[1])
+ dropped = s.drop(1)
+ assert_equal(1, dropped)
+ assert_equal(expChar(3), s[0])
+ assert_equal(nil, s[1])
+ dropped = s.drop(1)
+ assert_equal(1, dropped)
+ assert_equal(nil, s[0])
+ assert_equal(nil, s[1])
+ dropped = s.drop(0)
+ assert_equal(0, dropped)
+ assert_equal(nil, s[0])
+ assert_equal(nil, s[1])
+ end
+
+ setupInputStream(6, 3) do |s|
+ dropped = s.drop(2)
+ assert_equal(2, dropped)
+ dropped = s.drop(2)
+ assert_equal(2, dropped)
+ assert_equal(expChar(4), s[0])
+ assert_equal(expChar(5), s[1])
+ dropped = s.drop(3)
+ assert_equal(2, dropped)
+ assert_equal(nil, s[0])
+ assert_equal(nil, s[1])
+ end
+ end
+
+ def test_StreamBuf_is_eos?
+ setupInputStream(3, 1024) do |s|
+ assert(!s.is_eos?)
+ s.drop(1)
+ assert(!s.is_eos?)
+ s.drop(1)
+ assert(!s.is_eos?)
+ s.drop(1)
+ assert(s.is_eos?)
+ s.drop(1)
+ assert(s.is_eos?)
+ end
+
+ setupInputStream(3, 2) do |s|
+ assert(!s.is_eos?)
+ s.drop(1)
+ assert(!s.is_eos?)
+ s.drop(1)
+ assert(!s.is_eos?)
+ s.drop(1)
+ assert(s.is_eos?)
+ s.drop(1)
+ assert(s.is_eos?)
+ end
+ end
+
+ def test_StreamBuf_s_new
+ # NotImplementedError should be raised from StreamBuf#read.
+ assert_raises(NotImplementedError) do
+ CSV::StreamBuf.new
+ end
+ end
+
+ def test_IOBuf_close
+ f = File.open(@outfile, "wb")
+ f << "tst"
+ f.close
+
+ f = File.open(@outfile, "rb")
+ iobuf = CSV::IOBuf.new(f)
+ iobuf.close
+ assert(true) # iobuf.close does not raise any exception.
+ f.close
+ end
+
+ def test_IOBuf_s_new
+ iobuf = CSV::IOBuf.new(Tempfile.new("in.csv"))
+ assert_instance_of(CSV::IOBuf, iobuf)
+ end
+
+
+ #### CSV functional test
+
+ # sample data
+ #
+ # 1 2 3 4 5 6 7 8
+ # +------+-------+---------+-------+--------+------+----+------+
+ # | foo | "foo" | foo,bar | "" |(empty) |(null)| \r | \r\n |
+ # +------+-------+---------+-------+--------+------+----+------+
+ # | NaHi | "Na" | Na,Hi | \r.\n | \r\n\n | " | \n | \r\n |
+ # +------+-------+---------+-------+--------+------+----+------+
+ #
+ def test_s_parseAndCreate
+ colSize = 8
+ csvStr = "foo,!!!foo!!!,!foo,bar!,!!!!!!,!!,,!\r!,!\r\n!\nNaHi,!!!Na!!!,!Na,Hi!,!\r.\n!,!\r\n\n!,!!!!,!\n!,!\r\n!".gsub!('!', '"')
+ csvStrTerminated = csvStr + "\n"
+
+ myStr = csvStr.dup
+ res1 = []; res2 = []
+ idx = 0
+ col, idx = CSV::parse_row(myStr, 0, res1)
+ col, idx = CSV::parse_row(myStr, idx, res2)
+
+ buf = ''
+ col = CSV::generate_row(res1, colSize, buf)
+ col = CSV::generate_row(res2, colSize, buf)
+ assert_equal(csvStrTerminated, buf)
+
+ parsed = []
+ CSV::Reader.parse(csvStrTerminated) do |row|
+ parsed << row
+ end
+
+ buf = ''
+ CSV::Writer.generate(buf) do |writer|
+ parsed.each do |row|
+ writer.add_row(row)
+ end
+ end
+ assert_equal(csvStrTerminated, buf)
+
+ buf = ''
+ CSV::Writer.generate(buf) do |writer|
+ parsed.each do |row|
+ writer << row
+ end
+ end
+ assert_equal(csvStrTerminated, buf)
+ end
+
+ def test_writer_fs_rs_generate
+ buf = ''
+ CSV::Writer.generate(buf, ",,") do |writer|
+ writer << []
+ end
+ assert_equal("\n", buf)
+
+ buf = ''
+ CSV::Writer.generate(buf, ",,") do |writer|
+ writer << [] << []
+ end
+ assert_equal("\n\n", buf)
+
+ buf = ''
+ CSV::Writer.generate(buf, ",,") do |writer|
+ writer << [1]
+ end
+ assert_equal("1\n", buf)
+
+ buf = ''
+ CSV::Writer.generate(buf, ",,") do |writer|
+ writer << [1, 2, 3]
+ writer << [4, ",,", 5]
+ end
+ assert_equal("1,,2,,3\n4,,\",,\",,5\n", buf)
+
+ buf = ''
+ CSV::Writer.generate(buf, ",,:", ",,;") do |writer|
+ writer << [nil, nil, nil]
+ writer << [nil, ",,", nil]
+ end
+ assert_equal(",,:,,:,,;,,:,,,,:,,;", buf)
+
+ buf = ''
+ CSV::Writer.generate(buf, "---") do |writer|
+ writer << [1, 2, 3]
+ writer << [4, "---\"---", 5]
+ end
+ assert_equal("1---2---3\n4---\"---\"\"---\"---5\n", buf)
+
+ buf = ''
+ CSV::Writer.generate(buf, nil) do |writer|
+ writer << [1, 2, 3]
+ writer << [4, ",\",", 5]
+ end
+ assert_equal("1,2,3\n4,\",\"\",\",5\n", buf)
+ end
+
+ def test_writer_fs_rs_parse
+ reader = CSV::Reader.create('a||b--c||d', '||', '--')
+ assert_equal(['a', 'b'], reader.shift)
+ assert_equal(['c', 'd'], reader.shift)
+
+ reader = CSV::Reader.create("a@|b@-c@|d", "@|", "@-")
+ assert_equal(['a', 'b'], reader.shift)
+ assert_equal(['c', 'd'], reader.shift)
+
+ reader = CSV::Reader.create("ababfsababrs", "abfs", "abrs")
+ assert_equal(['ab', 'ab'], reader.shift)
+
+ reader = CSV::Reader.create('"ab"abfsababrs', "abfs", "abrs")
+ assert_equal(['ab', 'ab'], reader.shift)
+
+ reader = CSV::Reader.create('"ab"aabfsababrs', "abfs", "abrs")
+ assert_raises(CSV::IllegalFormatError) do
+ reader.shift
+ end
+
+ # fs match while matching rs progress
+ reader = CSV::Reader.create("ab,ababrs", nil, "abrs")
+ assert_equal(['ab', 'ab'], reader.shift)
+
+ reader = CSV::Reader.create(',ababrs', nil, "abrs")
+ assert_equal([nil, 'ab'], reader.shift)
+
+ reader = CSV::Reader.create('"",ababrs', nil, "abrs")
+ assert_equal(['', 'ab'], reader.shift)
+
+ reader = CSV::Reader.create('ab,"ab"abrs', nil, "abrs")
+ assert_equal(['ab', 'ab'], reader.shift)
+
+ reader = CSV::Reader.create('ab,"ab"aabrs', nil, "abrs")
+ assert_raises(CSV::IllegalFormatError) do
+ reader.shift
+ end
+
+ # rs match while matching fs progress
+ reader = CSV::Reader.create("ab|abc", 'ab-', "ab|")
+ assert_equal([nil], reader.shift)
+ assert_equal(['abc'], reader.shift)
+
+ reader = CSV::Reader.create("ab\ncdabcef", "abc", "\n")
+ assert_equal(['ab'], reader.shift)
+ assert_equal(['cd', "ef"], reader.shift)
+
+ # EOF while fs/rs matching
+ reader = CSV::Reader.create("ab", 'ab-', "xyz")
+ assert_equal(['ab'], reader.shift)
+
+ reader = CSV::Reader.create("ab", 'xyz', "ab|")
+ assert_equal(['ab'], reader.shift)
+
+ reader = CSV::Reader.create("ab", 'ab-', "ab|")
+ assert_equal(['ab'], reader.shift)
+
+ reader = CSV::Reader.create(",,:,,:,,;,,:,,,,:,,;", ",,:", ",,;")
+ assert_equal([nil, nil, nil], reader.shift)
+ assert_equal([nil, ",,", nil], reader.shift)
+ end
+
+ def test_s_foreach
+ File.open(@outfile, "w") do |f|
+ f << "1,2,3\n4,5,6"
+ end
+ row = []
+ CSV.foreach(@outfile) { |line|
+ row << line
+ }
+ assert_equal([['1', '2', '3'], ['4', '5', '6']], row)
+
+ File.open(@outfile, "w") do |f|
+ f << "1,2,3\r4,5,6"
+ end
+ row = []
+ CSV.foreach(@outfile, "\r") { |line|
+ row << line
+ }
+ assert_equal([['1', '2', '3'], ['4', '5', '6']], row)
+ end
+
+ def test_s_readlines
+ File.open(@outfile, "w") do |f|
+ f << "1,2,3\n4,5,6"
+ end
+ assert_equal([["1", "2", "3"], ["4", "5", "6"]], CSV.readlines(@outfile))
+ assert_equal([["1", "2", nil], [nil, "5", "6"]], CSV.readlines(@outfile, "3\n4"))
+ end
+
+ def test_s_read
+ File.open(@outfile, "w") do |f|
+ f << "1,2,3\n4,5,6"
+ end
+ assert_equal([["1", "2", "3"], ["4", "5", "6"]], CSV.read(@outfile))
+ assert_equal([["1", "2"]], CSV.read(@outfile, 3))
+ assert_equal([[nil], ["4", nil]], CSV.read(@outfile, 3, 5))
+ end
+end
diff --git a/test/csv/test_csv_parsing.rb b/test/csv/test_csv_parsing.rb
deleted file mode 100644
index a9e6cd400c..0000000000
--- a/test/csv/test_csv_parsing.rb
+++ /dev/null
@@ -1,192 +0,0 @@
-#!/usr/bin/env ruby -w
-# encoding: UTF-8
-
-# tc_csv_parsing.rb
-#
-# 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.
-
-require "test/unit"
-require "timeout"
-
-require "csv"
-
-#
-# Following tests are my interpretation of the
-# {CSV RCF}[http://www.ietf.org/rfc/rfc4180.txt]. I only deviate from that
-# document in one place (intentionally) and that is to make the default row
-# separator <tt>$/</tt>.
-#
-class TestCSVParsing < Test::Unit::TestCase
- BIG_DATA = "123456789\n" * 1024
-
- def test_mastering_regex_example
- ex = %Q{Ten Thousand,10000, 2710 ,,"10,000","It's ""10 Grand"", baby",10K}
- assert_equal( [ "Ten Thousand", "10000", " 2710 ", nil, "10,000",
- "It's \"10 Grand\", baby", "10K" ],
- CSV.parse_line(ex) )
- end
-
- # Old Ruby 1.8 CSV library tests.
- def test_std_lib_csv
- [ ["\t", ["\t"]],
- ["foo,\"\"\"\"\"\",baz", ["foo", "\"\"", "baz"]],
- ["foo,\"\"\"bar\"\"\",baz", ["foo", "\"bar\"", "baz"]],
- ["\"\"\"\n\",\"\"\"\n\"", ["\"\n", "\"\n"]],
- ["foo,\"\r\n\",baz", ["foo", "\r\n", "baz"]],
- ["\"\"", [""]],
- ["foo,\"\"\"\",baz", ["foo", "\"", "baz"]],
- ["foo,\"\r.\n\",baz", ["foo", "\r.\n", "baz"]],
- ["foo,\"\r\",baz", ["foo", "\r", "baz"]],
- ["foo,\"\",baz", ["foo", "", "baz"]],
- ["\",\"", [","]],
- ["foo", ["foo"]],
- [",,", [nil, nil, nil]],
- [",", [nil, nil]],
- ["foo,\"\n\",baz", ["foo", "\n", "baz"]],
- ["foo,,baz", ["foo", nil, "baz"]],
- ["\"\"\"\r\",\"\"\"\r\"", ["\"\r", "\"\r"]],
- ["\",\",\",\"", [",", ","]],
- ["foo,bar,", ["foo", "bar", nil]],
- [",foo,bar", [nil, "foo", "bar"]],
- ["foo,bar", ["foo", "bar"]],
- [";", [";"]],
- ["\t,\t", ["\t", "\t"]],
- ["foo,\"\r\n\r\",baz", ["foo", "\r\n\r", "baz"]],
- ["foo,\"\r\n\n\",baz", ["foo", "\r\n\n", "baz"]],
- ["foo,\"foo,bar\",baz", ["foo", "foo,bar", "baz"]],
- [";,;", [";", ";"]] ].each do |csv_test|
- assert_equal(csv_test.last, CSV.parse_line(csv_test.first))
- end
-
- [ ["foo,\"\"\"\"\"\",baz", ["foo", "\"\"", "baz"]],
- ["foo,\"\"\"bar\"\"\",baz", ["foo", "\"bar\"", "baz"]],
- ["foo,\"\r\n\",baz", ["foo", "\r\n", "baz"]],
- ["\"\"", [""]],
- ["foo,\"\"\"\",baz", ["foo", "\"", "baz"]],
- ["foo,\"\r.\n\",baz", ["foo", "\r.\n", "baz"]],
- ["foo,\"\r\",baz", ["foo", "\r", "baz"]],
- ["foo,\"\",baz", ["foo", "", "baz"]],
- ["foo", ["foo"]],
- [",,", [nil, nil, nil]],
- [",", [nil, nil]],
- ["foo,\"\n\",baz", ["foo", "\n", "baz"]],
- ["foo,,baz", ["foo", nil, "baz"]],
- ["foo,bar", ["foo", "bar"]],
- ["foo,\"\r\n\n\",baz", ["foo", "\r\n\n", "baz"]],
- ["foo,\"foo,bar\",baz", ["foo", "foo,bar", "baz"]] ].each do |csv_test|
- assert_equal(csv_test.last, CSV.parse_line(csv_test.first))
- end
- end
-
- # From: http://ruby-talk.org/cgi-bin/scat.rb/ruby/ruby-core/6496
- def test_aras_edge_cases
- [ [%Q{a,b}, ["a", "b"]],
- [%Q{a,"""b"""}, ["a", "\"b\""]],
- [%Q{a,"""b"}, ["a", "\"b"]],
- [%Q{a,"b"""}, ["a", "b\""]],
- [%Q{a,"\nb"""}, ["a", "\nb\""]],
- [%Q{a,"""\nb"}, ["a", "\"\nb"]],
- [%Q{a,"""\nb\n"""}, ["a", "\"\nb\n\""]],
- [%Q{a,"""\nb\n""",\nc}, ["a", "\"\nb\n\"", nil]],
- [%Q{a,,,}, ["a", nil, nil, nil]],
- [%Q{,}, [nil, nil]],
- [%Q{"",""}, ["", ""]],
- [%Q{""""}, ["\""]],
- [%Q{"""",""}, ["\"",""]],
- [%Q{,""}, [nil,""]],
- [%Q{,"\r"}, [nil,"\r"]],
- [%Q{"\r\n,"}, ["\r\n,"]],
- [%Q{"\r\n,",}, ["\r\n,", nil]] ].each do |edge_case|
- assert_equal(edge_case.last, CSV.parse_line(edge_case.first))
- end
- end
-
- def test_james_edge_cases
- # A read at eof? should return nil.
- assert_equal(nil, CSV.parse_line(""))
- #
- # With Ruby 1.8 CSV it's impossible to tell an empty line from a line
- # containing a single +nil+ field. The old CSV library returns
- # <tt>[nil]</tt> in these cases, but <tt>Array.new</tt> makes more sense to
- # me.
- #
- assert_equal(Array.new, CSV.parse_line("\n1,2,3\n"))
- end
-
- def test_malformed_csv
- assert_raise(CSV::MalformedCSVError) do
- CSV.parse_line("1,2\r,3", row_sep: "\n")
- end
-
- bad_data = <<-END_DATA.gsub(/^ +/, "")
- line,1,abc
- line,2,"def\nghi"
-
- line,4,some\rjunk
- line,5,jkl
- END_DATA
- lines = bad_data.lines.to_a
- assert_equal(6, lines.size)
- assert_match(/\Aline,4/, lines.find { |l| l =~ /some\rjunk/ })
-
- csv = CSV.new(bad_data)
- begin
- loop do
- assert_not_nil(csv.shift)
- assert_send([csv.lineno, :<, 4])
- end
- rescue CSV::MalformedCSVError
- assert_equal( "Unquoted fields do not allow \\r or \\n (line 4).",
- $!.message )
- end
-
- assert_raise(CSV::MalformedCSVError) { CSV.parse_line('1,2,"3...') }
-
- bad_data = <<-END_DATA.gsub(/^ +/, "")
- line,1,abc
- line,2,"def\nghi"
-
- line,4,8'10"
- line,5,jkl
- END_DATA
- lines = bad_data.lines.to_a
- assert_equal(6, lines.size)
- assert_match(/\Aline,4/, lines.find { |l| l =~ /8'10"/ })
-
- csv = CSV.new(bad_data)
- begin
- loop do
- assert_not_nil(csv.shift)
- assert_send([csv.lineno, :<, 4])
- end
- rescue CSV::MalformedCSVError
- assert_equal("Illegal quoting on line 4.", $!.message)
- end
- end
-
- def test_the_parse_fails_fast_when_it_can_for_unquoted_fields
- assert_parse_errors_out('valid,fields,bad start"' + BIG_DATA)
- end
-
- def test_the_parse_fails_fast_when_it_can_for_unescaped_quotes
- assert_parse_errors_out('valid,fields,"bad start"unescaped' + BIG_DATA)
- end
-
- def test_field_size_limit_controls_lookahead
- assert_parse_errors_out( 'valid,fields,"' + BIG_DATA + '"',
- field_size_limit: 2048 )
- end
-
- private
-
- def assert_parse_errors_out(*args)
- assert_raise(CSV::MalformedCSVError) do
- Timeout.timeout(0.2) do
- CSV.parse(*args)
- fail("Parse didn't error out")
- end
- end
- end
-end
diff --git a/test/csv/test_csv_writing.rb b/test/csv/test_csv_writing.rb
deleted file mode 100644
index eacba49613..0000000000
--- a/test/csv/test_csv_writing.rb
+++ /dev/null
@@ -1,97 +0,0 @@
-#!/usr/bin/env ruby -w
-# encoding: UTF-8
-
-# tc_csv_writing.rb
-#
-# 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.
-
-require "test/unit"
-
-require "csv"
-
-class TestCSVWriting < Test::Unit::TestCase
- def test_writing
- [ ["\t", ["\t"]],
- ["foo,\"\"\"\"\"\",baz", ["foo", "\"\"", "baz"]],
- ["foo,\"\"\"bar\"\"\",baz", ["foo", "\"bar\"", "baz"]],
- ["\"\"\"\n\",\"\"\"\n\"", ["\"\n", "\"\n"]],
- ["foo,\"\r\n\",baz", ["foo", "\r\n", "baz"]],
- ["\"\"", [""]],
- ["foo,\"\"\"\",baz", ["foo", "\"", "baz"]],
- ["foo,\"\r.\n\",baz", ["foo", "\r.\n", "baz"]],
- ["foo,\"\r\",baz", ["foo", "\r", "baz"]],
- ["foo,\"\",baz", ["foo", "", "baz"]],
- ["\",\"", [","]],
- ["foo", ["foo"]],
- [",,", [nil, nil, nil]],
- [",", [nil, nil]],
- ["foo,\"\n\",baz", ["foo", "\n", "baz"]],
- ["foo,,baz", ["foo", nil, "baz"]],
- ["\"\"\"\r\",\"\"\"\r\"", ["\"\r", "\"\r"]],
- ["\",\",\",\"", [",", ","]],
- ["foo,bar,", ["foo", "bar", nil]],
- [",foo,bar", [nil, "foo", "bar"]],
- ["foo,bar", ["foo", "bar"]],
- [";", [";"]],
- ["\t,\t", ["\t", "\t"]],
- ["foo,\"\r\n\r\",baz", ["foo", "\r\n\r", "baz"]],
- ["foo,\"\r\n\n\",baz", ["foo", "\r\n\n", "baz"]],
- ["foo,\"foo,bar\",baz", ["foo", "foo,bar", "baz"]],
- [";,;", [";", ";"]],
- ["foo,\"\"\"\"\"\",baz", ["foo", "\"\"", "baz"]],
- ["foo,\"\"\"bar\"\"\",baz", ["foo", "\"bar\"", "baz"]],
- ["foo,\"\r\n\",baz", ["foo", "\r\n", "baz"]],
- ["\"\"", [""]],
- ["foo,\"\"\"\",baz", ["foo", "\"", "baz"]],
- ["foo,\"\r.\n\",baz", ["foo", "\r.\n", "baz"]],
- ["foo,\"\r\",baz", ["foo", "\r", "baz"]],
- ["foo,\"\",baz", ["foo", "", "baz"]],
- ["foo", ["foo"]],
- [",,", [nil, nil, nil]],
- [",", [nil, nil]],
- ["foo,\"\n\",baz", ["foo", "\n", "baz"]],
- ["foo,,baz", ["foo", nil, "baz"]],
- ["foo,bar", ["foo", "bar"]],
- ["foo,\"\r\n\n\",baz", ["foo", "\r\n\n", "baz"]],
- ["foo,\"foo,bar\",baz", ["foo", "foo,bar", "baz"]],
- [%Q{a,b}, ["a", "b"]],
- [%Q{a,"""b"""}, ["a", "\"b\""]],
- [%Q{a,"""b"}, ["a", "\"b"]],
- [%Q{a,"b"""}, ["a", "b\""]],
- [%Q{a,"\nb"""}, ["a", "\nb\""]],
- [%Q{a,"""\nb"}, ["a", "\"\nb"]],
- [%Q{a,"""\nb\n"""}, ["a", "\"\nb\n\""]],
- [%Q{a,"""\nb\n""",}, ["a", "\"\nb\n\"", nil]],
- [%Q{a,,,}, ["a", nil, nil, nil]],
- [%Q{,}, [nil, nil]],
- [%Q{"",""}, ["", ""]],
- [%Q{""""}, ["\""]],
- [%Q{"""",""}, ["\"",""]],
- [%Q{,""}, [nil,""]],
- [%Q{,"\r"}, [nil,"\r"]],
- [%Q{"\r\n,"}, ["\r\n,"]],
- [%Q{"\r\n,",}, ["\r\n,", nil]] ].each do |test_case|
- assert_equal(test_case.first + $/, CSV.generate_line(test_case.last))
- end
- end
-
- def test_col_sep
- assert_equal( "a;b;;c\n", CSV.generate_line( ["a", "b", nil, "c"],
- col_sep: ";" ) )
- assert_equal( "a\tb\t\tc\n", CSV.generate_line( ["a", "b", nil, "c"],
- col_sep: "\t" ) )
- end
-
- def test_row_sep
- assert_equal( "a,b,,c\r\n", CSV.generate_line( ["a", "b", nil, "c"],
- row_sep: "\r\n" ) )
- end
-
- def test_force_quotes
- assert_equal( %Q{"1","b","","already ""quoted"""\n},
- CSV.generate_line( [1, "b", nil, %Q{already "quoted"}],
- force_quotes: true ) )
- end
-end
diff --git a/test/csv/test_data_converters.rb b/test/csv/test_data_converters.rb
deleted file mode 100644
index 1ad5093424..0000000000
--- a/test/csv/test_data_converters.rb
+++ /dev/null
@@ -1,261 +0,0 @@
-#!/usr/bin/env ruby -w
-# encoding: UTF-8
-
-# tc_data_converters.rb
-#
-# 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.
-
-require "test/unit"
-
-require "csv"
-
-class TestDataConverters < Test::Unit::TestCase
- def setup
- @data = "Numbers,:integer,1,:float,3.015"
- @parser = CSV.new(@data)
-
- @custom = lambda { |field| field =~ /\A:(\S.*?)\s*\Z/ ? $1.to_sym : field }
-
- @win_safe_time_str = Time.now.strftime("%a %b %d %H:%M:%S %Y")
- end
-
- def test_builtin_integer_converter
- # does convert
- [-5, 1, 10000000000].each do |n|
- assert_equal(n, CSV::Converters[:integer][n.to_s])
- end
-
- # does not convert
- (%w{junk 1.0} + [""]).each do |str|
- assert_equal(str, CSV::Converters[:integer][str])
- end
- end
-
- def test_builtin_float_converter
- # does convert
- [-5.1234, 0, 2.3e-11].each do |n|
- assert_equal(n, CSV::Converters[:float][n.to_s])
- end
-
- # does not convert
- (%w{junk 1..0 .015F} + [""]).each do |str|
- assert_equal(str, CSV::Converters[:float][str])
- end
- end
-
- def test_builtin_date_converter
- # does convert
- assert_instance_of(
- Date,
- CSV::Converters[:date][@win_safe_time_str.sub(/\d+:\d+:\d+ /, "")]
- )
-
- # does not convert
- assert_instance_of(String, CSV::Converters[:date]["junk"])
- end
-
- def test_builtin_date_time_converter
- # does convert
- assert_instance_of( DateTime,
- CSV::Converters[:date_time][@win_safe_time_str] )
-
- # does not convert
- assert_instance_of(String, CSV::Converters[:date_time]["junk"])
- end
-
- def test_convert_with_builtin
- # setup parser...
- assert(@parser.respond_to?(:convert))
- assert_nothing_raised(Exception) { @parser.convert(:integer) }
-
- # and use
- assert_equal(["Numbers", ":integer", 1, ":float", "3.015"], @parser.shift)
-
- setup # reset
-
- # setup parser...
- assert_nothing_raised(Exception) { @parser.convert(:float) }
-
- # and use
- assert_equal(["Numbers", ":integer", 1.0, ":float", 3.015], @parser.shift)
- end
-
- def test_convert_order
- # floats first, then integers...
- assert_nothing_raised(Exception) do
- @parser.convert(:float)
- @parser.convert(:integer)
- end
-
- # gets us nothing but floats
- assert_equal( [String, String, Float, String, Float],
- @parser.shift.map { |field| field.class } )
-
- setup # reset
-
- # integers have precendance...
- assert_nothing_raised(Exception) do
- @parser.convert(:integer)
- @parser.convert(:float)
- end
-
- # gives us proper number conversion
- assert_equal( [String, String, Fixnum, String, Float],
- @parser.shift.map { |field| field.class } )
- end
-
- def test_builtin_numeric_combo_converter
- # setup parser...
- assert_nothing_raised(Exception) { @parser.convert(:numeric) }
-
- # and use
- assert_equal( [String, String, Fixnum, String, Float],
- @parser.shift.map { |field| field.class } )
- end
-
- def test_builtin_all_nested_combo_converter
- # setup parser...
- @data << ",#{@win_safe_time_str}" # add a DateTime field
- @parser = CSV.new(@data) # reset parser
- assert_nothing_raised(Exception) { @parser.convert(:all) }
-
- # and use
- assert_equal( [String, String, Fixnum, String, Float, DateTime],
- @parser.shift.map { |field| field.class } )
- end
-
- def test_convert_with_custom_code
- # define custom converter...
- assert_nothing_raised(Exception) do
- @parser.convert { |field| field =~ /\A:(\S.*?)\s*\Z/ ? $1.to_sym : field }
- end
-
- # and use
- assert_equal(["Numbers", :integer, "1", :float, "3.015"], @parser.shift)
-
- setup # reset
-
- # mix built-in and custom...
- assert_nothing_raised(Exception) { @parser.convert(:numeric) }
- assert_nothing_raised(Exception) { @parser.convert(&@custom) }
-
- # and use
- assert_equal(["Numbers", :integer, 1, :float, 3.015], @parser.shift)
- end
-
- def test_convert_with_custom_code_using_field_info
- # define custom converter that uses field information...
- assert_nothing_raised(Exception) do
- @parser.convert do |field, info|
- assert_equal(1, info.line)
- info.index == 4 ? Float(field).floor : field
- end
- end
-
- # and use
- assert_equal(["Numbers", ":integer", "1", ":float", 3], @parser.shift)
- end
-
- def test_convert_with_custom_code_using_field_info_header
- @parser = CSV.new(@data, headers: %w{one two three four five})
-
- # define custom converter that uses field header information...
- assert_nothing_raised(Exception) do
- @parser.convert do |field, info|
- info.header == "three" ? Integer(field) * 100 : field
- end
- end
-
- # and use
- assert_equal( ["Numbers", ":integer", 100, ":float", "3.015"],
- @parser.shift.fields )
- end
-
- def test_shortcut_interface
- assert_equal( ["Numbers", ":integer", 1, ":float", 3.015],
- CSV.parse_line(@data, converters: :numeric) )
-
- assert_equal( ["Numbers", ":integer", 1, ":float", 3.015],
- CSV.parse_line(@data, converters: [:integer, :float]) )
-
- assert_equal( ["Numbers", :integer, 1, :float, 3.015],
- CSV.parse_line(@data, converters: [:numeric, @custom]) )
- end
-
- def test_unconverted_fields
- [ [ @data,
- ["Numbers", :integer, 1, :float, 3.015],
- %w{Numbers :integer 1 :float 3.015} ],
- ["\n", Array.new, Array.new] ].each do |test, fields, unconverted|
- row = nil
- assert_nothing_raised(Exception) do
- row = CSV.parse_line( test,
- converters: [:numeric, @custom],
- unconverted_fields: true )
- end
- assert_not_nil(row)
- assert_equal(fields, row)
- assert_respond_to(row, :unconverted_fields)
- assert_equal(unconverted, row.unconverted_fields)
- end
-
- data = <<-END_CSV.gsub(/^\s+/, "")
- first,second,third
- 1,2,3
- END_CSV
- row = nil
- assert_nothing_raised(Exception) do
- row = CSV.parse_line( data,
- converters: :numeric,
- unconverted_fields: true,
- headers: :first_row )
- end
- assert_not_nil(row)
- assert_equal([["first", 1], ["second", 2], ["third", 3]], row.to_a)
- assert_respond_to(row, :unconverted_fields)
- assert_equal(%w{1 2 3}, row.unconverted_fields)
-
- assert_nothing_raised(Exception) do
- row = CSV.parse_line( data,
- converters: :numeric,
- unconverted_fields: true,
- headers: :first_row,
- return_headers: true )
- end
- assert_not_nil(row)
- assert_equal( [%w{first first}, %w{second second}, %w{third third}],
- row.to_a )
- assert_respond_to(row, :unconverted_fields)
- assert_equal(%w{first second third}, row.unconverted_fields)
-
- assert_nothing_raised(Exception) do
- row = CSV.parse_line( data,
- converters: :numeric,
- unconverted_fields: true,
- headers: :first_row,
- return_headers: true,
- header_converters: :symbol )
- end
- assert_not_nil(row)
- assert_equal( [[:first, "first"], [:second, "second"], [:third, "third"]],
- row.to_a )
- assert_respond_to(row, :unconverted_fields)
- assert_equal(%w{first second third}, row.unconverted_fields)
-
- assert_nothing_raised(Exception) do
- row = CSV.parse_line( data,
- converters: :numeric,
- unconverted_fields: true,
- headers: %w{my new headers},
- return_headers: true,
- header_converters: :symbol )
- end
- assert_not_nil(row)
- assert_equal( [[:my, "my"], [:new, "new"], [:headers, "headers"]],
- row.to_a )
- assert_respond_to(row, :unconverted_fields)
- assert_equal(Array.new, row.unconverted_fields)
- end
-end
diff --git a/test/csv/test_encodings.rb b/test/csv/test_encodings.rb
deleted file mode 100644
index 63f7207c29..0000000000
--- a/test/csv/test_encodings.rb
+++ /dev/null
@@ -1,256 +0,0 @@
-#!/usr/bin/env ruby -w
-# encoding: UTF-8
-
-# tc_encodings.rb
-#
-# Created by James Edward Gray II on 2008-09-13.
-# Copyright 2008 James Edward Gray II. You can redistribute or modify this code
-# under the terms of Ruby's license.
-
-require "test/unit"
-
-require "csv"
-
-class TestEncodings < Test::Unit::TestCase
- def setup
- @temp_csv_path = File.join(File.dirname(__FILE__), "temp.csv")
- end
-
- def teardown
- File.unlink(@temp_csv_path) if File.exist? @temp_csv_path
- end
-
- ########################################
- ### Hand Test Some Popular Encodings ###
- ########################################
-
- def test_parses_utf8_encoding
- assert_parses( [ %w[ one two … ],
- %w[ 1 … 3 ],
- %w[ … 5 6 ] ], "UTF-8" )
- end
-
- def test_parses_latin1_encoding
- assert_parses( [ %w[ one two Résumé ],
- %w[ 1 Résumé 3 ],
- %w[ Résumé 5 6 ] ], "ISO-8859-1" )
- end
-
- def test_parses_utf16be_encoding
- assert_parses( [ %w[ one two … ],
- %w[ 1 … 3 ],
- %w[ … 5 6 ] ], "UTF-16BE" )
- end
-
- def test_parses_shift_jis_encoding
- assert_parses( [ %w[ 一 二 三 ],
- %w[ 四 五 六 ],
- %w[ 七 八 九 ] ], "Shift_JIS" )
- end
-
- ###########################################################
- ### Try Simple Reading for All Non-dummy Ruby Encodings ###
- ###########################################################
-
- def test_reading_with_most_encodings
- each_encoding do |encoding|
- begin
- assert_parses( [ %w[ abc def ],
- %w[ ghi jkl ] ], encoding )
- rescue Encoding::ConverterNotFoundError
- fail("Failed to support #{encoding.name}.")
- end
- end
- end
-
- def test_regular_expression_escaping
- each_encoding do |encoding|
- begin
- assert_parses( [ %w[ abc def ],
- %w[ ghi jkl ] ], encoding, col_sep: "|" )
- rescue Encoding::ConverterNotFoundError
- fail("Failed to properly escape #{encoding.name}.")
- end
- end
- end
-
- #######################################################################
- ### Stress Test ASCII Compatible and Non-ASCII Compatible Encodings ###
- #######################################################################
-
- def test_auto_line_ending_detection
- # arrange data to place a \r at the end of CSV's read ahead point
- encode_for_tests([["a" * 509]], row_sep: "\r\n") do |data|
- assert_equal("\r\n".encode(data.encoding), CSV.new(data).row_sep)
- end
- end
-
- def test_csv_chars_are_transcoded
- encode_for_tests([%w[abc def]]) do |data|
- %w[col_sep row_sep quote_char].each do |csv_char|
- assert_equal( "|".encode(data.encoding),
- CSV.new(data, csv_char.to_sym => "|").send(csv_char) )
- end
- end
- end
-
- def test_parser_works_with_encoded_headers
- encode_for_tests([%w[one two three], %w[1 2 3]]) do |data|
- parsed = CSV.parse(data, headers: true)
- assert( parsed.headers.all? { |h| h.encoding == data.encoding },
- "Wrong data encoding." )
- parsed.each do |row|
- assert( row.fields.all? { |f| f.encoding == data.encoding },
- "Wrong data encoding." )
- end
- end
- end
-
- def test_built_in_converters_transcode_to_utf_8_then_convert
- encode_for_tests([%w[one two three], %w[1 2 3]]) do |data|
- parsed = CSV.parse(data, converters: :integer)
- assert( parsed[0].all? { |f| f.encoding == data.encoding },
- "Wrong data encoding." )
- assert_equal([1, 2, 3], parsed[1])
- end
- end
-
- def test_built_in_header_converters_transcode_to_utf_8_then_convert
- encode_for_tests([%w[one two three], %w[1 2 3]]) do |data|
- parsed = CSV.parse( data, headers: true,
- header_converters: :downcase )
- assert( parsed.headers.all? { |h| h.encoding.name == "UTF-8" },
- "Wrong data encoding." )
- assert( parsed[0].fields.all? { |f| f.encoding == data.encoding },
- "Wrong data encoding." )
- end
- end
-
- def test_open_allows_you_to_set_encodings
- encode_for_tests([%w[abc def]]) do |data|
- # read and write in encoding
- File.open(@temp_csv_path, "wb:#{data.encoding.name}") { |f| f << data }
- CSV.open(@temp_csv_path, "rb:#{data.encoding.name}") do |csv|
- csv.each do |row|
- assert( row.all? { |f| f.encoding == data.encoding },
- "Wrong data encoding." )
- end
- end
-
- # read and write with transcoding
- File.open(@temp_csv_path, "wb:UTF-32BE:#{data.encoding.name}") do |f|
- f << data
- end
- CSV.open(@temp_csv_path, "rb:UTF-32BE:#{data.encoding.name}") do |csv|
- csv.each do |row|
- assert( row.all? { |f| f.encoding == data.encoding },
- "Wrong data encoding." )
- end
- end
- end
- end
-
- def test_foreach_allows_you_to_set_encodings
- encode_for_tests([%w[abc def]]) do |data|
- # read and write in encoding
- File.open(@temp_csv_path, "wb:#{data.encoding.name}") { |f| f << data }
- CSV.foreach(@temp_csv_path, encoding: data.encoding.name) do |row|
- assert( row.all? { |f| f.encoding == data.encoding },
- "Wrong data encoding." )
- end
-
- # read and write with transcoding
- File.open(@temp_csv_path, "wb:UTF-32BE:#{data.encoding.name}") do |f|
- f << data
- end
- CSV.foreach( @temp_csv_path,
- encoding: "UTF-32BE:#{data.encoding.name}" ) do |row|
- assert( row.all? { |f| f.encoding == data.encoding },
- "Wrong data encoding." )
- end
- end
- end
-
- def test_read_allows_you_to_set_encodings
- encode_for_tests([%w[abc def]]) do |data|
- # read and write in encoding
- File.open(@temp_csv_path, "wb:#{data.encoding.name}") { |f| f << data }
- rows = CSV.read(@temp_csv_path, encoding: data.encoding.name)
- assert( rows.flatten.all? { |f| f.encoding == data.encoding },
- "Wrong data encoding." )
-
- # read and write with transcoding
- File.open(@temp_csv_path, "wb:UTF-32BE:#{data.encoding.name}") do |f|
- f << data
- end
- rows = CSV.read( @temp_csv_path,
- encoding: "UTF-32BE:#{data.encoding.name}" )
- assert( rows.flatten.all? { |f| f.encoding == data.encoding },
- "Wrong data encoding." )
- end
- end
-
- #################################
- ### Write CSV in any Encoding ###
- #################################
-
- def test_can_write_csv_in_any_encoding
- each_encoding do |encoding|
- # test generate_line with encoding hint
- csv = %w[abc d|ef].map { |f| f.encode(encoding) }.
- to_csv(col_sep: "|", encoding: encoding.name)
- assert_equal(encoding, csv.encoding)
-
- # test generate_line with encoding guessing from fields
- csv = %w[abc d|ef].map { |f| f.encode(encoding) }.to_csv(col_sep: "|")
- assert_equal(encoding, csv.encoding)
-
- # writing to files
- data = encode_ary([%w[abc d,ef], %w[123 456 ]], encoding)
- CSV.open(@temp_csv_path, "wb:#{encoding.name}") do |f|
- data.each { |row| f << row }
- end
- assert_equal(data, CSV.read(@temp_csv_path, encoding: encoding.name))
- end
- end
-
- private
-
- def assert_parses(fields, encoding, options = { })
- encoding = Encoding.find(encoding) unless encoding.is_a? Encoding
- fields = encode_ary(fields, encoding)
- parsed = CSV.parse(ary_to_data(fields, options), options)
- assert_equal(fields, parsed)
- parsed.flatten.each_with_index do |field, i|
- assert_equal(encoding, field.encoding, "Field[#{i + 1}] was transcoded.")
- end
- end
-
- def encode_ary(ary, encoding)
- ary.map { |row| row.map { |field| field.encode(encoding) } }
- end
-
- def ary_to_data(ary, options = { })
- encoding = ary.flatten.first.encoding
- quote_char = (options[:quote_char] || '"').encode(encoding)
- col_sep = (options[:col_sep] || ",").encode(encoding)
- row_sep = (options[:row_sep] || "\n").encode(encoding)
- ary.map { |row|
- row.map { |field|
- [quote_char, field.encode(encoding), quote_char].join
- }.join(col_sep) + row_sep
- }.join.encode(encoding)
- end
-
- def encode_for_tests(data, options = { })
- yield ary_to_data(encode_ary(data, "UTF-8"), options)
- yield ary_to_data(encode_ary(data, "UTF-16BE"), options)
- end
-
- def each_encoding
- Encoding.list.each do |encoding|
- next if encoding.dummy? # skip "dummy" encodings
- yield encoding
- end
- end
-end
diff --git a/test/csv/test_features.rb b/test/csv/test_features.rb
deleted file mode 100644
index 58efd1c9b3..0000000000
--- a/test/csv/test_features.rb
+++ /dev/null
@@ -1,267 +0,0 @@
-#!/usr/bin/env ruby -w
-# encoding: UTF-8
-
-# tc_features.rb
-#
-# 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.
-
-require "test/unit"
-require "zlib"
-
-require "csv"
-
-class TestCSVFeatures < Test::Unit::TestCase
- TEST_CASES = [ [%Q{a,b}, ["a", "b"]],
- [%Q{a,"""b"""}, ["a", "\"b\""]],
- [%Q{a,"""b"}, ["a", "\"b"]],
- [%Q{a,"b"""}, ["a", "b\""]],
- [%Q{a,"\nb"""}, ["a", "\nb\""]],
- [%Q{a,"""\nb"}, ["a", "\"\nb"]],
- [%Q{a,"""\nb\n"""}, ["a", "\"\nb\n\""]],
- [%Q{a,"""\nb\n""",\nc}, ["a", "\"\nb\n\"", nil]],
- [%Q{a,,,}, ["a", nil, nil, nil]],
- [%Q{,}, [nil, nil]],
- [%Q{"",""}, ["", ""]],
- [%Q{""""}, ["\""]],
- [%Q{"""",""}, ["\"",""]],
- [%Q{,""}, [nil,""]],
- [%Q{,"\r"}, [nil,"\r"]],
- [%Q{"\r\n,"}, ["\r\n,"]],
- [%Q{"\r\n,",}, ["\r\n,", nil]] ]
-
- def setup
- @sample_data = <<-END_DATA.gsub(/^ +/, "")
- line,1,abc
- line,2,"def\nghi"
-
- line,4,jkl
- END_DATA
- @csv = CSV.new(@sample_data)
- end
-
- def test_col_sep
- [";", "\t"].each do |sep|
- TEST_CASES.each do |test_case|
- assert_equal( test_case.last.map { |t| t.tr(",", sep) unless t.nil? },
- CSV.parse_line( test_case.first.tr(",", sep),
- col_sep: sep ) )
- end
- end
- assert_equal([",,,", nil], CSV.parse_line(",,,;", col_sep: ";"))
- end
-
- def test_row_sep
- assert_raise(CSV::MalformedCSVError) do
- CSV.parse_line("1,2,3\n,4,5\r\n", row_sep: "\r\n")
- end
- assert_equal( ["1", "2", "3\n", "4", "5"],
- CSV.parse_line(%Q{1,2,"3\n",4,5\r\n}, row_sep: "\r\n"))
- end
-
- def test_quote_char
- TEST_CASES.each do |test_case|
- assert_equal( test_case.last.map { |t| t.tr('"', "'") unless t.nil? },
- CSV.parse_line( test_case.first.tr('"', "'"),
- quote_char: "'" ) )
- end
- end
-
- def test_csv_char_readers
- %w[col_sep row_sep quote_char].each do |reader|
- csv = CSV.new("abc,def", reader.to_sym => "|")
- assert_equal("|", csv.send(reader))
- end
- end
-
- def test_row_sep_auto_discovery
- ["\r\n", "\n", "\r"].each do |line_end|
- data = "1,2,3#{line_end}4,5#{line_end}"
- discovered = CSV.new(data).row_sep
- assert_equal(line_end, discovered)
- end
-
- assert_equal("\n", CSV.new("\n\r\n\r").row_sep)
-
- assert_equal($/, CSV.new("").row_sep)
-
- assert_equal($/, CSV.new(STDERR).row_sep)
- end
-
- def test_lineno
- assert_equal(5, @sample_data.lines.to_a.size)
-
- 4.times do |line_count|
- assert_equal(line_count, @csv.lineno)
- assert_not_nil(@csv.shift)
- assert_equal(line_count + 1, @csv.lineno)
- end
- assert_nil(@csv.shift)
- end
-
- def test_readline
- test_lineno
-
- @csv.rewind
-
- test_lineno
- end
-
- def test_unknown_options
- assert_raise(ArgumentError) { CSV.new(String.new, unknown: :error) }
- end
-
- def test_skip_blanks
- assert_equal(4, @csv.to_a.size)
-
- @csv = CSV.new(@sample_data, skip_blanks: true)
-
- count = 0
- @csv.each do |row|
- count += 1
- assert_equal("line", row.first)
- end
- assert_equal(3, count)
- end
-
- def test_csv_behavior_readers
- %w[ unconverted_fields return_headers write_headers
- skip_blanks force_quotes ].each do |behavior|
- assert( !CSV.new("abc,def").send("#{behavior}?"),
- "Behavior defaulted to on." )
- csv = CSV.new("abc,def", behavior.to_sym => true)
- assert(csv.send("#{behavior}?"), "Behavior change now registered.")
- end
- end
-
- def test_converters_reader
- # no change
- assert_equal( [:integer],
- CSV.new("abc,def", converters: [:integer]).converters )
-
- # just one
- assert_equal( [:integer],
- CSV.new("abc,def", converters: :integer).converters )
-
- # expanded
- assert_equal( [:integer, :float],
- CSV.new("abc,def", converters: :numeric).converters )
-
- # custom
- csv = CSV.new("abc,def", converters: [:integer, lambda { }])
- assert_equal(2, csv.converters.size)
- assert_equal(:integer, csv.converters.first)
- assert_instance_of(Proc, csv.converters.last)
- end
-
- def test_header_converters_reader
- # no change
- hc = :header_converters
- assert_equal([:downcase], CSV.new("abc,def", hc => [:downcase]).send(hc))
-
- # just one
- assert_equal([:downcase], CSV.new("abc,def", hc => :downcase).send(hc))
-
- # custom
- csv = CSV.new("abc,def", hc => [:symbol, lambda { }])
- assert_equal(2, csv.send(hc).size)
- assert_equal(:symbol, csv.send(hc).first)
- assert_instance_of(Proc, csv.send(hc).last)
- end
-
- # reported by Kev Jackson
- def test_failing_to_escape_col_sep_bug_fix
- assert_nothing_raised(Exception) { CSV.new(String.new, col_sep: "|") }
- end
-
- # reported by Chris Roos
- def test_failing_to_reset_headers_in_rewind_bug_fix
- csv = CSV.new("forename,surname", headers: true, return_headers: true)
- csv.each { |row| assert row.header_row? }
- csv.rewind
- csv.each { |row| assert row.header_row? }
- end
-
- # reported by Dave Burt
- def test_leading_empty_fields_with_multibyte_col_sep_bug_fix
- data = <<-END_DATA.gsub(/^\s+/, "")
- <=><=>A<=>B<=>C
- 1<=>2<=>3
- END_DATA
- parsed = CSV.parse(data, col_sep: "<=>")
- assert_equal([[nil, nil, "A", "B", "C"], ["1", "2", "3"]], parsed)
- end
-
- def test_gzip_reader_bug_fix
- zipped = nil
- assert_nothing_raised(NoMethodError) do
- zipped = CSV.new(
- Zlib::GzipReader.open(
- File.join(File.dirname(__FILE__), "line_endings.gz")
- )
- )
- end
- assert_equal("\r\n", zipped.row_sep)
- end
-
- def test_gzip_writer_bug_fix
- file = File.join(File.dirname(__FILE__), "temp.gz")
- zipped = nil
- assert_nothing_raised(NoMethodError) do
- zipped = CSV.new(Zlib::GzipWriter.open(file))
- end
- zipped << %w[one two three]
- zipped << [1, 2, 3]
- zipped.close
-
- assert( Zlib::GzipReader.open(file) { |f| f.read }.
- include?($INPUT_RECORD_SEPARATOR),
- "@row_sep did not default" )
- File.unlink(file)
- end
-
- def test_inspect_is_smart_about_io_types
- str = CSV.new("string,data").inspect
- assert(str.include?("io_type:StringIO"), "IO type not detected.")
-
- str = CSV.new($stderr).inspect
- assert(str.include?("io_type:$stderr"), "IO type not detected.")
-
- path = File.join(File.dirname(__FILE__), "temp.csv")
- File.open(path, "w") { |csv| csv << "one,two,three\n1,2,3\n" }
- str = CSV.open(path) { |csv| csv.inspect }
- assert(str.include?("io_type:File"), "IO type not detected.")
- File.unlink(path)
- end
-
- def test_inspect_shows_key_attributes
- str = @csv.inspect
- %w[lineno col_sep row_sep quote_char].each do |attr_name|
- assert_match(/\b#{attr_name}:[^\s>]+/, str)
- end
- end
-
- def test_inspect_shows_headers_when_available
- CSV.new("one,two,three\n1,2,3\n", headers: true) do |csv|
- assert(csv.inspect.include?("headers:true"), "Header hint not shown.")
- csv.shift # load headers
- assert_match(/headers:\[[^\]]+\]/, csv.inspect)
- end
- end
-
- def test_inspect_encoding_is_ascii_compatible
- CSV.new("one,two,three\n1,2,3\n".encode("UTF-16BE")) do |csv|
- assert( Encoding.compatible?( Encoding.find("US-ASCII"),
- csv.inspect.encoding ),
- "inspect() was not ASCII compatible." )
- end
- end
-
- def test_version
- assert_not_nil(CSV::VERSION)
- assert_instance_of(String, CSV::VERSION)
- assert(CSV::VERSION.frozen?)
- assert_match(/\A\d\.\d\.\d\Z/, CSV::VERSION)
- end
-end
diff --git a/test/csv/test_headers.rb b/test/csv/test_headers.rb
deleted file mode 100644
index 6e56ffc27c..0000000000
--- a/test/csv/test_headers.rb
+++ /dev/null
@@ -1,288 +0,0 @@
-#!/usr/bin/env ruby -w
-# encoding: UTF-8
-
-# tc_headers.rb
-#
-# 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.
-
-require "test/unit"
-
-require "csv"
-
-class TestCSVHeaders < Test::Unit::TestCase
- def setup
- @data = <<-END_CSV.gsub(/^\s+/, "")
- first,second,third
- A,B,C
- 1,2,3
- END_CSV
- end
-
- def test_first_row
- [:first_row, true].each do |setting| # two names for the same setting
- # activate headers
- csv = nil
- assert_nothing_raised(Exception) do
- csv = CSV.parse(@data, headers: setting)
- end
-
- # first data row - skipping headers
- row = csv[0]
- assert_not_nil(row)
- assert_instance_of(CSV::Row, row)
- assert_equal([%w{first A}, %w{second B}, %w{third C}], row.to_a)
-
- # second data row
- row = csv[1]
- assert_not_nil(row)
- assert_instance_of(CSV::Row, row)
- assert_equal([%w{first 1}, %w{second 2}, %w{third 3}], row.to_a)
-
- # empty
- assert_nil(csv[2])
- end
- end
-
- def test_array_of_headers
- # activate headers
- csv = nil
- assert_nothing_raised(Exception) do
- csv = CSV.parse(@data, headers: [:my, :new, :headers])
- end
-
- # first data row - skipping headers
- row = csv[0]
- assert_not_nil(row)
- assert_instance_of(CSV::Row, row)
- assert_equal( [[:my, "first"], [:new, "second"], [:headers, "third"]],
- row.to_a )
-
- # second data row
- row = csv[1]
- assert_not_nil(row)
- assert_instance_of(CSV::Row, row)
- assert_equal([[:my, "A"], [:new, "B"], [:headers, "C"]], row.to_a)
-
- # third data row
- row = csv[2]
- assert_not_nil(row)
- assert_instance_of(CSV::Row, row)
- assert_equal([[:my, "1"], [:new, "2"], [:headers, "3"]], row.to_a)
-
- # empty
- assert_nil(csv[3])
-
- # with return and convert
- assert_nothing_raised(Exception) do
- csv = CSV.parse( @data, headers: [:my, :new, :headers],
- return_headers: true,
- header_converters: lambda { |h| h.to_s } )
- end
- row = csv[0]
- assert_not_nil(row)
- assert_instance_of(CSV::Row, row)
- assert_equal([["my", :my], ["new", :new], ["headers", :headers]], row.to_a)
- assert(row.header_row?)
- assert(!row.field_row?)
- end
-
- def test_csv_header_string
- # activate headers
- csv = nil
- assert_nothing_raised(Exception) do
- csv = CSV.parse(@data, headers: "my,new,headers")
- end
-
- # first data row - skipping headers
- row = csv[0]
- assert_not_nil(row)
- assert_instance_of(CSV::Row, row)
- assert_equal([%w{my first}, %w{new second}, %w{headers third}], row.to_a)
-
- # second data row
- row = csv[1]
- assert_not_nil(row)
- assert_instance_of(CSV::Row, row)
- assert_equal([%w{my A}, %w{new B}, %w{headers C}], row.to_a)
-
- # third data row
- row = csv[2]
- assert_not_nil(row)
- assert_instance_of(CSV::Row, row)
- assert_equal([%w{my 1}, %w{new 2}, %w{headers 3}], row.to_a)
-
- # empty
- assert_nil(csv[3])
-
- # with return and convert
- assert_nothing_raised(Exception) do
- csv = CSV.parse( @data, headers: "my,new,headers",
- return_headers: true,
- header_converters: :symbol )
- end
- row = csv[0]
- assert_not_nil(row)
- assert_instance_of(CSV::Row, row)
- assert_equal([[:my, "my"], [:new, "new"], [:headers, "headers"]], row.to_a)
- assert(row.header_row?)
- assert(!row.field_row?)
- end
-
- def test_csv_header_string_inherits_separators
- # parse with custom col_sep
- csv = nil
- assert_nothing_raised(Exception) do
- csv = CSV.parse( @data.tr(",", "|"), col_sep: "|",
- headers: "my|new|headers" )
- end
-
- # verify headers were recognized
- row = csv[0]
- assert_not_nil(row)
- assert_instance_of(CSV::Row, row)
- assert_equal([%w{my first}, %w{new second}, %w{headers third}], row.to_a)
- end
-
- def test_return_headers
- # activate headers and request they are returned
- csv = nil
- assert_nothing_raised(Exception) do
- csv = CSV.parse(@data, headers: true, return_headers: true)
- end
-
- # header row
- row = csv[0]
- assert_not_nil(row)
- assert_instance_of(CSV::Row, row)
- assert_equal( [%w{first first}, %w{second second}, %w{third third}],
- row.to_a )
- assert(row.header_row?)
- assert(!row.field_row?)
-
- # first data row - skipping headers
- row = csv[1]
- assert_not_nil(row)
- assert_instance_of(CSV::Row, row)
- assert_equal([%w{first A}, %w{second B}, %w{third C}], row.to_a)
- assert(!row.header_row?)
- assert(row.field_row?)
-
- # second data row
- row = csv[2]
- assert_not_nil(row)
- assert_instance_of(CSV::Row, row)
- assert_equal([%w{first 1}, %w{second 2}, %w{third 3}], row.to_a)
- assert(!row.header_row?)
- assert(row.field_row?)
-
- # empty
- assert_nil(csv[3])
- end
-
- def test_converters
- # create test data where headers and fields look alike
- data = <<-END_MATCHING_CSV.gsub(/^\s+/, "")
- 1,2,3
- 1,2,3
- END_MATCHING_CSV
-
- # normal converters do not affect headers
- csv = CSV.parse( data, headers: true,
- return_headers: true,
- converters: :numeric )
- assert_equal([%w{1 1}, %w{2 2}, %w{3 3}], csv[0].to_a)
- assert_equal([["1", 1], ["2", 2], ["3", 3]], csv[1].to_a)
- assert_nil(csv[2])
-
- # header converters do affect headers (only)
- assert_nothing_raised(Exception) do
- csv = CSV.parse( data, headers: true,
- return_headers: true,
- converters: :numeric,
- header_converters: :symbol )
- end
- assert_equal([[:"1", "1"], [:"2", "2"], [:"3", "3"]], csv[0].to_a)
- assert_equal([[:"1", 1], [:"2", 2], [:"3", 3]], csv[1].to_a)
- assert_nil(csv[2])
- end
-
- def test_builtin_downcase_converter
- csv = CSV.parse( "One,TWO Three", headers: true,
- return_headers: true,
- header_converters: :downcase )
- assert_equal(%w{one two\ three}, csv.headers)
- end
-
- def test_builtin_symbol_converter
- csv = CSV.parse( "One,TWO Three", headers: true,
- return_headers: true,
- header_converters: :symbol )
- assert_equal([:one, :two_three], csv.headers)
- end
-
- def test_custom_converter
- converter = lambda { |header| header.tr(" ", "_") }
- csv = CSV.parse( "One,TWO Three",
- headers: true,
- return_headers: true,
- header_converters: converter )
- assert_equal(%w{One TWO_Three}, csv.headers)
- end
-
- def test_table_support
- csv = nil
- assert_nothing_raised(Exception) do
- csv = CSV.parse(@data, headers: true)
- end
-
- assert_instance_of(CSV::Table, csv)
- end
-
- def test_skip_blanks
- @data = <<-END_CSV.gsub(/^ +/, "")
-
-
- A,B,C
-
- 1,2,3
-
-
-
- END_CSV
-
- expected = [%w[1 2 3]]
- CSV.parse(@data, headers: true, skip_blanks: true) do |row|
- assert_equal(expected.shift, row.fields)
- end
-
- expected = [%w[A B C], %w[1 2 3]]
- CSV.parse( @data,
- headers: true,
- return_headers: true,
- skip_blanks: true ) do |row|
- assert_equal(expected.shift, row.fields)
- end
- end
-
- def test_headers_reader
- # no headers
- assert_nil(CSV.new(@data).headers)
-
- # headers
- csv = CSV.new(@data, headers: true)
- assert_equal(true, csv.headers) # before headers are read
- csv.shift # set headers
- assert_equal(%w[first second third], csv.headers) # after headers are read
- end
-
- def test_blank_row_bug_fix
- @data += "\n#{@data}" # add a blank row
-
- # ensure that everything returned is a Row object
- CSV.parse(@data, headers: true) do |row|
- assert_instance_of(CSV::Row, row)
- end
- end
-end
diff --git a/test/csv/test_interface.rb b/test/csv/test_interface.rb
deleted file mode 100644
index 5aedbbb075..0000000000
--- a/test/csv/test_interface.rb
+++ /dev/null
@@ -1,304 +0,0 @@
-#!/usr/bin/env ruby -w
-# encoding: UTF-8
-
-# tc_interface.rb
-#
-# 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.
-
-require "test/unit"
-
-require "csv"
-
-class TestCSVInterface < Test::Unit::TestCase
- def setup
- @path = File.join(File.dirname(__FILE__), "temp_test_data.csv")
-
- File.open(@path, "wb") do |file|
- file << "1\t2\t3\r\n"
- file << "4\t5\r\n"
- end
-
- @expected = [%w{1 2 3}, %w{4 5}]
- end
-
- def teardown
- File.unlink(@path)
- end
-
- ### Test Read Interface ###
-
- def test_foreach
- CSV.foreach(@path, col_sep: "\t", row_sep: "\r\n") do |row|
- assert_equal(@expected.shift, row)
- end
- end
-
- def test_open_and_close
- csv = CSV.open(@path, "r+", col_sep: "\t", row_sep: "\r\n")
- assert_not_nil(csv)
- assert_instance_of(CSV, csv)
- assert_equal(false, csv.closed?)
- csv.close
- assert(csv.closed?)
-
- ret = CSV.open(@path) do |new_csv|
- csv = new_csv
- assert_instance_of(CSV, new_csv)
- "Return value."
- end
- assert(csv.closed?)
- assert_equal("Return value.", ret)
- end
-
- def test_parse
- data = File.binread(@path)
- assert_equal( @expected,
- CSV.parse(data, col_sep: "\t", row_sep: "\r\n") )
-
- CSV.parse(data, col_sep: "\t", row_sep: "\r\n") do |row|
- assert_equal(@expected.shift, row)
- end
- end
-
- def test_parse_line
- row = CSV.parse_line("1;2;3", col_sep: ";")
- assert_not_nil(row)
- assert_instance_of(Array, row)
- assert_equal(%w{1 2 3}, row)
-
- # shortcut interface
- row = "1;2;3".parse_csv(col_sep: ";")
- assert_not_nil(row)
- assert_instance_of(Array, row)
- assert_equal(%w{1 2 3}, row)
- end
-
- def test_read_and_readlines
- assert_equal( @expected,
- CSV.read(@path, col_sep: "\t", row_sep: "\r\n") )
- assert_equal( @expected,
- CSV.readlines(@path, col_sep: "\t", row_sep: "\r\n") )
-
-
- data = CSV.open(@path, col_sep: "\t", row_sep: "\r\n") do |csv|
- csv.read
- end
- assert_equal(@expected, data)
- data = CSV.open(@path, col_sep: "\t", row_sep: "\r\n") do |csv|
- csv.readlines
- end
- assert_equal(@expected, data)
- end
-
- def test_table
- table = CSV.table(@path, col_sep: "\t", row_sep: "\r\n")
- assert_instance_of(CSV::Table, table)
- assert_equal([[:"1", :"2", :"3"], [4, 5, nil]], table.to_a)
- end
-
- def test_shift # aliased as gets() and readline()
- CSV.open(@path, "rb+", col_sep: "\t", row_sep: "\r\n") do |csv|
- assert_equal(@expected.shift, csv.shift)
- assert_equal(@expected.shift, csv.shift)
- assert_equal(nil, csv.shift)
- end
- end
-
- ### Test Write Interface ###
-
- def test_generate
- str = CSV.generate do |csv| # default empty String
- assert_instance_of(CSV, csv)
- assert_equal(csv, csv << [1, 2, 3])
- assert_equal(csv, csv << [4, nil, 5])
- end
- assert_not_nil(str)
- assert_instance_of(String, str)
- assert_equal("1,2,3\n4,,5\n", str)
-
- CSV.generate(str) do |csv| # appending to a String
- assert_equal(csv, csv << ["last", %Q{"row"}])
- end
- assert_equal(%Q{1,2,3\n4,,5\nlast,"""row"""\n}, str)
- end
-
- def test_generate_line
- line = CSV.generate_line(%w{1 2 3}, col_sep: ";")
- assert_not_nil(line)
- assert_instance_of(String, line)
- assert_equal("1;2;3\n", line)
-
- # shortcut interface
- line = %w{1 2 3}.to_csv(col_sep: ";")
- assert_not_nil(line)
- assert_instance_of(String, line)
- assert_equal("1;2;3\n", line)
- end
-
- def test_write_header_detection
- File.unlink(@path)
-
- headers = %w{a b c}
- CSV.open(@path, "w", headers: true) do |csv|
- csv << headers
- csv << %w{1 2 3}
- assert_equal(headers, csv.instance_variable_get(:@headers))
- end
- end
-
- def test_write_lineno
- File.unlink(@path)
-
- CSV.open(@path, "w") do |csv|
- lines = 20
- lines.times { csv << %w{a b c} }
- assert_equal(lines, csv.lineno)
- end
- end
-
- def test_write_hash
- File.unlink(@path)
-
- lines = [{a: 1, b: 2, c: 3}, {a: 4, b: 5, c: 6}]
- CSV.open( @path, "w", headers: true,
- header_converters: :symbol ) do |csv|
- csv << lines.first.keys
- lines.each { |line| csv << line }
- end
- CSV.open( @path, "w", headers: true,
- converters: :all,
- header_converters: :symbol ) do |csv|
- csv.each { |line| assert_equal(lines.shift, line.to_hash) }
- end
- end
-
- def test_write_hash_with_headers_array
- File.unlink(@path)
-
- lines = [{a: 1, b: 2, c: 3}, {a: 4, b: 5, c: 6}]
- CSV.open(@path, "wb", headers: [:b, :a, :c]) do |csv|
- lines.each { |line| csv << line }
- end
-
- # test writing fields in the correct order
- File.open(@path, "rb") do |f|
- assert_equal("2,1,3", f.gets.strip)
- assert_equal("5,4,6", f.gets.strip)
- end
-
- # test reading CSV with headers
- CSV.open( @path, "rb", headers: [:b, :a, :c],
- converters: :all ) do |csv|
- csv.each { |line| assert_equal(lines.shift, line.to_hash) }
- end
- end
-
- def test_write_hash_with_headers_string
- File.unlink(@path)
-
- lines = [{"a" => 1, "b" => 2, "c" => 3}, {"a" => 4, "b" => 5, "c" => 6}]
- CSV.open(@path, "wb", headers: "b|a|c", col_sep: "|") do |csv|
- lines.each { |line| csv << line }
- end
-
- # test writing fields in the correct order
- File.open(@path, "rb") do |f|
- assert_equal("2|1|3", f.gets.strip)
- assert_equal("5|4|6", f.gets.strip)
- end
-
- # test reading CSV with headers
- CSV.open( @path, "rb", headers: "b|a|c",
- col_sep: "|",
- converters: :all ) do |csv|
- csv.each { |line| assert_equal(lines.shift, line.to_hash) }
- end
- end
-
- def test_write_headers
- File.unlink(@path)
-
- lines = [{"a" => 1, "b" => 2, "c" => 3}, {"a" => 4, "b" => 5, "c" => 6}]
- CSV.open( @path, "wb", headers: "b|a|c",
- write_headers: true,
- col_sep: "|" ) do |csv|
- lines.each { |line| csv << line }
- end
-
- # test writing fields in the correct order
- File.open(@path, "rb") do |f|
- assert_equal("b|a|c", f.gets.strip)
- assert_equal("2|1|3", f.gets.strip)
- assert_equal("5|4|6", f.gets.strip)
- end
-
- # test reading CSV with headers
- CSV.open( @path, "rb", headers: true,
- col_sep: "|",
- converters: :all ) do |csv|
- csv.each { |line| assert_equal(lines.shift, line.to_hash) }
- end
- end
-
- def test_append # aliased add_row() and puts()
- File.unlink(@path)
-
- CSV.open(@path, "wb", col_sep: "\t", row_sep: "\r\n") do |csv|
- @expected.each { |row| csv << row }
- end
-
- test_shift
-
- # same thing using CSV::Row objects
- File.unlink(@path)
-
- CSV.open(@path, "wb", col_sep: "\t", row_sep: "\r\n") do |csv|
- @expected.each { |row| csv << CSV::Row.new(Array.new, row) }
- end
-
- test_shift
- end
-
- ### Test Read and Write Interface ###
-
- def test_filter
- assert_respond_to(CSV, :filter)
-
- expected = [[1, 2, 3], [4, 5]]
- CSV.filter( "1;2;3\n4;5\n", (result = String.new),
- in_col_sep: ";", out_col_sep: ",",
- converters: :all ) do |row|
- assert_equal(row, expected.shift)
- row.map! { |n| n * 2 }
- row << "Added\r"
- end
- assert_equal("2,4,6,\"Added\r\"\n8,10,\"Added\r\"\n", result)
- end
-
- def test_instance
- csv = String.new
-
- first = nil
- assert_nothing_raised(Exception) do
- first = CSV.instance(csv, col_sep: ";")
- first << %w{a b c}
- end
-
- assert_equal("a;b;c\n", csv)
-
- second = nil
- assert_nothing_raised(Exception) do
- second = CSV.instance(csv, col_sep: ";")
- second << [1, 2, 3]
- end
-
- assert_equal(first.object_id, second.object_id)
- assert_equal("a;b;c\n1;2;3\n", csv)
-
- # shortcuts
- assert_equal(STDOUT, CSV.instance.instance_eval { @io })
- assert_equal(STDOUT, CSV { |new_csv| new_csv.instance_eval { @io } })
- end
-end
diff --git a/test/csv/test_row.rb b/test/csv/test_row.rb
deleted file mode 100644
index f9aa959701..0000000000
--- a/test/csv/test_row.rb
+++ /dev/null
@@ -1,312 +0,0 @@
-#!/usr/bin/env ruby -w
-# encoding: UTF-8
-
-# tc_row.rb
-#
-# 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.
-
-require "test/unit"
-
-require "csv"
-
-class TestCSVRow < Test::Unit::TestCase
- def setup
- @row = CSV::Row.new(%w{A B C A A}, [1, 2, 3, 4])
- end
-
- def test_initialize
- # basic
- row = CSV::Row.new(%w{A B C}, [1, 2, 3])
- assert_not_nil(row)
- assert_instance_of(CSV::Row, row)
- assert_equal([["A", 1], ["B", 2], ["C", 3]], row.to_a)
-
- # missing headers
- row = CSV::Row.new(%w{A}, [1, 2, 3])
- assert_not_nil(row)
- assert_instance_of(CSV::Row, row)
- assert_equal([["A", 1], [nil, 2], [nil, 3]], row.to_a)
-
- # missing fields
- row = CSV::Row.new(%w{A B C}, [1, 2])
- assert_not_nil(row)
- assert_instance_of(CSV::Row, row)
- assert_equal([["A", 1], ["B", 2], ["C", nil]], row.to_a)
- end
-
- def test_row_type
- # field rows
- row = CSV::Row.new(%w{A B C}, [1, 2, 3]) # implicit
- assert(!row.header_row?)
- assert(row.field_row?)
- row = CSV::Row.new(%w{A B C}, [1, 2, 3], false) # explicit
- assert(!row.header_row?)
- assert(row.field_row?)
-
- # header row
- row = CSV::Row.new(%w{A B C}, [1, 2, 3], true)
- assert(row.header_row?)
- assert(!row.field_row?)
- end
-
- def test_headers
- assert_equal(%w{A B C A A}, @row.headers)
- end
-
- def test_field
- # by name
- assert_equal(2, @row.field("B"))
- assert_equal(2, @row["B"]) # alias
-
- # by index
- assert_equal(3, @row.field(2))
-
- # missing
- assert_nil(@row.field("Missing"))
- assert_nil(@row.field(10))
-
- # minimum index
- assert_equal(1, @row.field("A"))
- assert_equal(1, @row.field("A", 0))
- assert_equal(4, @row.field("A", 1))
- assert_equal(4, @row.field("A", 2))
- assert_equal(4, @row.field("A", 3))
- assert_equal(nil, @row.field("A", 4))
- assert_equal(nil, @row.field("A", 5))
- end
-
- def test_set_field
- # set field by name
- assert_equal(100, @row["A"] = 100)
-
- # set field by index
- assert_equal(300, @row[3] = 300)
-
- # set field by name and minimum index
- assert_equal([:a, :b, :c], @row["A", 4] = [:a, :b, :c])
-
- # verify the changes
- assert_equal( [ ["A", 100],
- ["B", 2],
- ["C", 3],
- ["A", 300],
- ["A", [:a, :b, :c]] ], @row.to_a )
-
- # assigning an index past the end
- assert_equal("End", @row[10] = "End")
- assert_equal( [ ["A", 100],
- ["B", 2],
- ["C", 3],
- ["A", 300],
- ["A", [:a, :b, :c]],
- [nil, nil],
- [nil, nil],
- [nil, nil],
- [nil, nil],
- [nil, nil],
- [nil, "End"] ], @row.to_a )
-
- # assigning a new field by header
- assert_equal("New", @row[:new] = "New")
- assert_equal( [ ["A", 100],
- ["B", 2],
- ["C", 3],
- ["A", 300],
- ["A", [:a, :b, :c]],
- [nil, nil],
- [nil, nil],
- [nil, nil],
- [nil, nil],
- [nil, nil],
- [nil, "End"],
- [:new, "New"] ], @row.to_a )
- end
-
- def test_append
- # add a value
- assert_equal(@row, @row << "Value")
- assert_equal( [ ["A", 1],
- ["B", 2],
- ["C", 3],
- ["A", 4],
- ["A", nil],
- [nil, "Value"] ], @row.to_a )
-
- # add a pair
- assert_equal(@row, @row << %w{Header Field})
- assert_equal( [ ["A", 1],
- ["B", 2],
- ["C", 3],
- ["A", 4],
- ["A", nil],
- [nil, "Value"],
- %w{Header Field} ], @row.to_a )
-
- # a pair with Hash syntax
- assert_equal(@row, @row << {key: :value})
- assert_equal( [ ["A", 1],
- ["B", 2],
- ["C", 3],
- ["A", 4],
- ["A", nil],
- [nil, "Value"],
- %w{Header Field},
- [:key, :value] ], @row.to_a )
-
- # multiple fields at once
- assert_equal(@row, @row.push(100, 200, [:last, 300]))
- assert_equal( [ ["A", 1],
- ["B", 2],
- ["C", 3],
- ["A", 4],
- ["A", nil],
- [nil, "Value"],
- %w{Header Field},
- [:key, :value],
- [nil, 100],
- [nil, 200],
- [:last, 300] ], @row.to_a )
- end
-
- def test_delete
- # by index
- assert_equal(["B", 2], @row.delete(1))
-
- # by header
- assert_equal(["C", 3], @row.delete("C"))
-
- # using a block
- assert_equal(@row, @row.delete_if { |h, f| h == "A" and not f.nil? })
- assert_equal([["A", nil]], @row.to_a)
- end
-
- def test_fields
- # all fields
- assert_equal([1, 2, 3, 4, nil], @row.fields)
-
- # by header
- assert_equal([1, 3], @row.fields("A", "C"))
-
- # by index
- assert_equal([2, 3, nil], @row.fields(1, 2, 10))
-
- # by both
- assert_equal([2, 3, 4], @row.fields("B", "C", 3))
-
- # with minimum indices
- assert_equal([2, 3, 4], @row.fields("B", "C", ["A", 3]))
-
- # by header range
- assert_equal([2, 3], @row.values_at("B".."C"))
- end
-
- def test_index
- # basic usage
- assert_equal(0, @row.index("A"))
- assert_equal(1, @row.index("B"))
- assert_equal(2, @row.index("C"))
- assert_equal(nil, @row.index("Z"))
-
- # with minimum index
- assert_equal(0, @row.index("A"))
- assert_equal(0, @row.index("A", 0))
- assert_equal(3, @row.index("A", 1))
- assert_equal(3, @row.index("A", 2))
- assert_equal(3, @row.index("A", 3))
- assert_equal(4, @row.index("A", 4))
- assert_equal(nil, @row.index("A", 5))
- end
-
- def test_queries
- # headers
- assert(@row.header?("A"))
- assert(@row.header?("C"))
- assert(!@row.header?("Z"))
- assert(@row.include?("A")) # alias
-
- # fields
- assert(@row.field?(4))
- assert(@row.field?(nil))
- assert(!@row.field?(10))
- end
-
- def test_each
- # array style
- ary = @row.to_a
- @row.each do |pair|
- assert_equal(ary.first.first, pair.first)
- assert_equal(ary.shift.last, pair.last)
- end
-
- # hash style
- ary = @row.to_a
- @row.each do |header, field|
- assert_equal(ary.first.first, header)
- assert_equal(ary.shift.last, field)
- end
-
- # verify that we can chain the call
- assert_equal(@row, @row.each { })
- end
-
- def test_enumerable
- assert_equal( [["A", 1], ["A", 4], ["A", nil]],
- @row.select { |pair| pair.first == "A" } )
-
- assert_equal(10, @row.inject(0) { |sum, (header, n)| sum + (n || 0) })
- end
-
- def test_to_a
- row = CSV::Row.new(%w{A B C}, [1, 2, 3]).to_a
- assert_instance_of(Array, row)
- row.each do |pair|
- assert_instance_of(Array, pair)
- assert_equal(2, pair.size)
- end
- assert_equal([["A", 1], ["B", 2], ["C", 3]], row)
- end
-
- def test_to_hash
- assert_equal({"A" => nil, "B" => 2, "C" => 3}, @row.to_hash)
- end
-
- def test_to_csv
- # normal conversion
- assert_equal("1,2,3,4,\n", @row.to_csv)
- assert_equal("1,2,3,4,\n", @row.to_s) # alias
-
- # with options
- assert_equal( "1|2|3|4|\r\n",
- @row.to_csv(col_sep: "|", row_sep: "\r\n") )
- end
-
- def test_array_delegation
- assert(!@row.empty?, "Row was empty.")
-
- assert_equal([@row.headers.size, @row.fields.size].max, @row.size)
- end
-
- def test_inspect_shows_header_field_pairs
- str = @row.inspect
- @row.each do |header, field|
- assert( str.include?("#{header.inspect}:#{field.inspect}"),
- "Header field pair not found." )
- end
- end
-
- def test_inspect_encoding_is_ascii_compatible
- assert( Encoding.compatible?( Encoding.find("US-ASCII"),
- @row.inspect.encoding ),
- "inspect() was not ASCII compatible." )
- end
-
- def test_inspect_shows_symbol_headers_as_bare_attributes
- str = CSV::Row.new(@row.headers.map { |h| h.to_sym }, @row.fields).inspect
- @row.each do |header, field|
- assert( str.include?("#{header}:#{field.inspect}"),
- "Header field pair not found." )
- end
- end
-end
diff --git a/test/csv/test_serialization.rb b/test/csv/test_serialization.rb
deleted file mode 100644
index 5f0201ed90..0000000000
--- a/test/csv/test_serialization.rb
+++ /dev/null
@@ -1,156 +0,0 @@
-#!/usr/bin/env ruby -w
-# encoding: UTF-8
-
-# tc_serialization.rb
-#
-# 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.
-
-require "test/unit"
-
-require "csv"
-
-# An example of how to provide custom CSV serialization.
-class Hash
- def self.csv_load( meta, headers, fields )
- self[*headers.zip(fields).to_a.flatten.map { |e| eval(e) }]
- end
-
- def csv_headers
- keys.map { |key| key.inspect }
- end
-
- def csv_dump( headers )
- headers.map { |header| fetch(eval(header)).inspect }
- end
-end
-
-class TestSerialization < Test::Unit::TestCase
-
- ### Classes Used to Test Serialization ###
-
- class ReadOnlyName
- def initialize( first, last )
- @first, @last = first, last
- end
-
- attr_reader :first, :last
-
- def ==( other )
- %w{first last}.all? { |att| send(att) == other.send(att) }
- end
- end
-
- Name = Struct.new(:first, :last)
-
- class FullName < Name
- def initialize( first, last, suffix = nil )
- super(first, last)
-
- @suffix = suffix
- end
-
- attr_accessor :suffix
-
- def ==( other )
- %w{first last suffix}.all? { |att| send(att) == other.send(att) }
- end
- end
-
- ### Tests ###
-
- def test_class_dump
- @names = [ %w{James Gray},
- %w{Dana Gray},
- %w{Greg Brown} ].map do |first, last|
- ReadOnlyName.new(first, last)
- end
-
- assert_nothing_raised(Exception) do
- @data = CSV.dump(@names)
- end
- assert_equal(<<-END_CLASS_DUMP.gsub(/^\s*/, ""), @data)
- class,TestSerialization::ReadOnlyName
- @first,@last
- James,Gray
- Dana,Gray
- Greg,Brown
- END_CLASS_DUMP
- end
-
- def test_struct_dump
- @names = [ %w{James Gray},
- %w{Dana Gray},
- %w{Greg Brown} ].map do |first, last|
- Name.new(first, last)
- end
-
- assert_nothing_raised(Exception) do
- @data = CSV.dump(@names)
- end
- assert_equal(<<-END_STRUCT_DUMP.gsub(/^\s*/, ""), @data)
- class,TestSerialization::Name
- first=,last=
- James,Gray
- Dana,Gray
- Greg,Brown
- END_STRUCT_DUMP
- end
-
- def test_inherited_struct_dump
- @names = [ %w{James Gray II},
- %w{Dana Gray},
- %w{Greg Brown} ].map do |first, last, suffix|
- FullName.new(first, last, suffix)
- end
-
- assert_nothing_raised(Exception) do
- @data = CSV.dump(@names)
- end
- assert_equal(<<-END_STRUCT_DUMP.gsub(/^\s*/, ""), @data)
- class,TestSerialization::FullName
- @suffix,first=,last=
- II,James,Gray
- ,Dana,Gray
- ,Greg,Brown
- END_STRUCT_DUMP
- end
-
- def test_load
- %w{ test_class_dump
- test_struct_dump
- test_inherited_struct_dump }.each do |test|
- send(test)
- CSV.load(@data).each do |loaded|
- assert_instance_of(@names.first.class, loaded)
- assert_equal(@names.shift, loaded)
- end
- end
- end
-
- def test_io
- test_class_dump
-
- data_file = File.join(File.dirname(__FILE__), "temp_test_data.csv")
- CSV.dump(@names, File.open(data_file, "wb"))
-
- assert(File.exist?(data_file))
- assert_equal(<<-END_IO_DUMP.gsub(/^\s*/, ""), File.read(data_file))
- class,TestSerialization::ReadOnlyName
- @first,@last
- James,Gray
- Dana,Gray
- Greg,Brown
- END_IO_DUMP
-
- assert_equal(@names, CSV.load(File.open(data_file)))
-
- File.unlink(data_file)
- end
-
- def test_custom_dump_and_load
- obj = {1 => "simple", test: Hash}
- assert_equal(obj, CSV.load(CSV.dump([obj])).first)
- end
-end
diff --git a/test/csv/test_table.rb b/test/csv/test_table.rb
deleted file mode 100644
index e87f1b2545..0000000000
--- a/test/csv/test_table.rb
+++ /dev/null
@@ -1,408 +0,0 @@
-#!/usr/bin/env ruby -w
-# encoding: UTF-8
-
-# tc_table.rb
-#
-# 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.
-
-require "test/unit"
-
-require "csv"
-
-class TestCSVTable < Test::Unit::TestCase
- def setup
- @rows = [ CSV::Row.new(%w{A B C}, [1, 2, 3]),
- CSV::Row.new(%w{A B C}, [4, 5, 6]),
- CSV::Row.new(%w{A B C}, [7, 8, 9]) ]
- @table = CSV::Table.new(@rows)
-
- @header_table = CSV::Table.new(
- [CSV::Row.new(%w{A B C}, %w{A B C}, true)] + @rows
- )
- end
-
- def test_initialze
- assert_not_nil(@table)
- assert_instance_of(CSV::Table, @table)
- end
-
- def test_modes
- assert_equal(:col_or_row, @table.mode)
-
- # non-destructive changes, intended for one shot calls
- cols = @table.by_col
- assert_equal(:col_or_row, @table.mode)
- assert_equal(:col, cols.mode)
- assert_equal(@table, cols)
-
- rows = @table.by_row
- assert_equal(:col_or_row, @table.mode)
- assert_equal(:row, rows.mode)
- assert_equal(@table, rows)
-
- # destructive mode changing calls
- assert_equal(@table, @table.by_row!)
- assert_equal(:row, @table.mode)
- assert_equal(@table, @table.by_col_or_row!)
- assert_equal(:col_or_row, @table.mode)
- end
-
- def test_headers
- assert_equal(@rows.first.headers, @table.headers)
- end
-
- def test_index
- ##################
- ### Mixed Mode ###
- ##################
- # by row
- @rows.each_index { |i| assert_equal(@rows[i], @table[i]) }
- assert_equal(nil, @table[100]) # empty row
-
- # by col
- @rows.first.headers.each do |header|
- assert_equal(@rows.map { |row| row[header] }, @table[header])
- end
- assert_equal([nil] * @rows.size, @table["Z"]) # empty col
-
- # by cell, row then col
- assert_equal(2, @table[0][1])
- assert_equal(6, @table[1]["C"])
-
- # by cell, col then row
- assert_equal(5, @table["B"][1])
- assert_equal(9, @table["C"][2])
-
- # with headers (by col)
- assert_equal(["B", 2, 5, 8], @header_table["B"])
-
- ###################
- ### Column Mode ###
- ###################
- @table.by_col!
-
- assert_equal([2, 5, 8], @table[1])
- assert_equal([2, 5, 8], @table["B"])
-
- ################
- ### Row Mode ###
- ################
- @table.by_row!
-
- assert_equal(@rows[1], @table[1])
- assert_raise(TypeError) { @table["B"] }
-
- ############################
- ### One Shot Mode Change ###
- ############################
- assert_equal(@rows[1], @table[1])
- assert_equal([2, 5, 8], @table.by_col[1])
- assert_equal(@rows[1], @table[1])
- end
-
- def test_set_row_or_column
- ##################
- ### Mixed Mode ###
- ##################
- # set row
- @table[2] = [10, 11, 12]
- assert_equal([%w[A B C], [1, 2, 3], [4, 5, 6], [10, 11, 12]], @table.to_a)
-
- @table[3] = CSV::Row.new(%w[A B C], [13, 14, 15])
- assert_equal( [%w[A B C], [1, 2, 3], [4, 5, 6], [10, 11, 12], [13, 14, 15]],
- @table.to_a )
-
- # set col
- @table["Type"] = "data"
- assert_equal( [ %w[A B C Type],
- [1, 2, 3, "data"],
- [4, 5, 6, "data"],
- [10, 11, 12, "data"],
- [13, 14, 15, "data"] ],
- @table.to_a )
-
- @table["Index"] = [1, 2, 3]
- assert_equal( [ %w[A B C Type Index],
- [1, 2, 3, "data", 1],
- [4, 5, 6, "data", 2],
- [10, 11, 12, "data", 3],
- [13, 14, 15, "data", nil] ],
- @table.to_a )
-
- @table["B"] = [100, 200]
- assert_equal( [ %w[A B C Type Index],
- [1, 100, 3, "data", 1],
- [4, 200, 6, "data", 2],
- [10, nil, 12, "data", 3],
- [13, nil, 15, "data", nil] ],
- @table.to_a )
-
- # verify resulting table
- assert_equal(<<-END_RESULT.gsub(/^\s+/, ""), @table.to_csv)
- A,B,C,Type,Index
- 1,100,3,data,1
- 4,200,6,data,2
- 10,,12,data,3
- 13,,15,data,
- END_RESULT
-
- # with headers
- @header_table["Type"] = "data"
- assert_equal(%w[Type data data data], @header_table["Type"])
-
- ###################
- ### Column Mode ###
- ###################
- @table.by_col!
-
- @table[1] = [2, 5, 11, 14]
- assert_equal( [ %w[A B C Type Index],
- [1, 2, 3, "data", 1],
- [4, 5, 6, "data", 2],
- [10, 11, 12, "data", 3],
- [13, 14, 15, "data", nil] ],
- @table.to_a )
-
- @table["Extra"] = "new stuff"
- assert_equal( [ %w[A B C Type Index Extra],
- [1, 2, 3, "data", 1, "new stuff"],
- [4, 5, 6, "data", 2, "new stuff"],
- [10, 11, 12, "data", 3, "new stuff"],
- [13, 14, 15, "data", nil, "new stuff"] ],
- @table.to_a )
-
- ################
- ### Row Mode ###
- ################
- @table.by_row!
-
- @table[1] = (1..6).to_a
- assert_equal( [ %w[A B C Type Index Extra],
- [1, 2, 3, "data", 1, "new stuff"],
- [1, 2, 3, 4, 5, 6],
- [10, 11, 12, "data", 3, "new stuff"],
- [13, 14, 15, "data", nil, "new stuff"] ],
- @table.to_a )
-
- assert_raise(TypeError) { @table["Extra"] = nil }
- end
-
- def test_each
- ######################
- ### Mixed/Row Mode ###
- ######################
- i = 0
- @table.each do |row|
- assert_equal(@rows[i], row)
- i += 1
- end
-
- # verify that we can chain the call
- assert_equal(@table, @table.each { })
-
- ###################
- ### Column Mode ###
- ###################
- @table.by_col!
-
- headers = @table.headers
- @table.each do |header, column|
- assert_equal(headers.shift, header)
- assert_equal(@table[header], column)
- end
-
- ############################
- ### One Shot Mode Change ###
- ############################
- @table.by_col_or_row!
-
- @table.each { |row| assert_instance_of(CSV::Row, row) }
- @table.by_col.each { |tuple| assert_instance_of(Array, tuple) }
- @table.each { |row| assert_instance_of(CSV::Row, row) }
- end
-
- def test_enumerable
- assert_equal( @rows.values_at(0, 2),
- @table.select { |row| (row["B"] % 2).zero? } )
-
- assert_equal(@rows[1], @table.find { |row| row["C"] > 5 })
- end
-
- def test_to_a
- assert_equal([%w[A B C], [1, 2, 3], [4, 5, 6], [7, 8, 9]], @table.to_a)
-
- # with headers
- assert_equal( [%w[A B C], [1, 2, 3], [4, 5, 6], [7, 8, 9]],
- @header_table.to_a )
- end
-
- def test_to_csv
- csv = <<-END_CSV.gsub(/^\s+/, "")
- A,B,C
- 1,2,3
- 4,5,6
- 7,8,9
- END_CSV
-
- # normal conversion
- assert_equal(csv, @table.to_csv)
- assert_equal(csv, @table.to_s) # alias
-
- # with options
- assert_equal( csv.gsub(",", "|").gsub("\n", "\r\n"),
- @table.to_csv(col_sep: "|", row_sep: "\r\n") )
-
- # with headers
- assert_equal(csv, @header_table.to_csv)
- end
-
- def test_append
- # verify that we can chain the call
- assert_equal(@table, @table << [10, 11, 12])
-
- # Array append
- assert_equal(CSV::Row.new(%w[A B C], [10, 11, 12]), @table[-1])
-
- # Row append
- assert_equal(@table, @table << CSV::Row.new(%w[A B C], [13, 14, 15]))
- assert_equal(CSV::Row.new(%w[A B C], [13, 14, 15]), @table[-1])
- end
-
- def test_delete
- ##################
- ### Mixed Mode ###
- ##################
- # delete a row
- assert_equal(@rows[1], @table.delete(1))
-
- # delete a col
- assert_equal(@rows.map { |row| row["A"] }, @table.delete("A"))
-
- # verify resulting table
- assert_equal(<<-END_RESULT.gsub(/^\s+/, ""), @table.to_csv)
- B,C
- 2,3
- 8,9
- END_RESULT
-
- ###################
- ### Column Mode ###
- ###################
- setup
- @table.by_col!
-
- assert_equal(@rows.map { |row| row[0] }, @table.delete(0))
- assert_equal(@rows.map { |row| row["C"] }, @table.delete("C"))
-
- # verify resulting table
- assert_equal(<<-END_RESULT.gsub(/^\s+/, ""), @table.to_csv)
- B
- 2
- 5
- 8
- END_RESULT
-
- ################
- ### Row Mode ###
- ################
- setup
- @table.by_row!
-
- assert_equal(@rows[1], @table.delete(1))
- assert_raise(TypeError) { @table.delete("C") }
-
- # verify resulting table
- assert_equal(<<-END_RESULT.gsub(/^\s+/, ""), @table.to_csv)
- A,B,C
- 1,2,3
- 7,8,9
- END_RESULT
- end
-
- def test_delete_if
- ######################
- ### Mixed/Row Mode ###
- ######################
- # verify that we can chain the call
- assert_equal(@table, @table.delete_if { |row| (row["B"] % 2).zero? })
-
- # verify resulting table
- assert_equal(<<-END_RESULT.gsub(/^\s+/, ""), @table.to_csv)
- A,B,C
- 4,5,6
- END_RESULT
-
- ###################
- ### Column Mode ###
- ###################
- setup
- @table.by_col!
-
- assert_equal(@table, @table.delete_if { |h, v| h > "A" })
- assert_equal(<<-END_RESULT.gsub(/^\s+/, ""), @table.to_csv)
- A
- 1
- 4
- 7
- END_RESULT
- end
-
- def test_values_at
- ##################
- ### Mixed Mode ###
- ##################
- # rows
- assert_equal(@rows.values_at(0, 2), @table.values_at(0, 2))
- assert_equal(@rows.values_at(1..2), @table.values_at(1..2))
-
- # cols
- assert_equal([[1, 3], [4, 6], [7, 9]], @table.values_at("A", "C"))
- assert_equal([[2, 3], [5, 6], [8, 9]], @table.values_at("B".."C"))
-
- ###################
- ### Column Mode ###
- ###################
- @table.by_col!
-
- assert_equal([[1, 3], [4, 6], [7, 9]], @table.values_at(0, 2))
- assert_equal([[1, 3], [4, 6], [7, 9]], @table.values_at("A", "C"))
-
- ################
- ### Row Mode ###
- ################
- @table.by_row!
-
- assert_equal(@rows.values_at(0, 2), @table.values_at(0, 2))
- assert_raise(TypeError) { @table.values_at("A", "C") }
-
- ############################
- ### One Shot Mode Change ###
- ############################
- assert_equal(@rows.values_at(0, 2), @table.values_at(0, 2))
- assert_equal([[1, 3], [4, 6], [7, 9]], @table.by_col.values_at(0, 2))
- assert_equal(@rows.values_at(0, 2), @table.values_at(0, 2))
- end
-
- def test_array_delegation
- assert(!@table.empty?, "Table was empty.")
-
- assert_equal(@rows.size, @table.size)
- end
-
- def test_inspect_shows_current_mode
- str = @table.inspect
- assert(str.include?("mode:#{@table.mode}"), "Mode not shown.")
-
- @table.by_col!
- str = @table.inspect
- assert(str.include?("mode:#{@table.mode}"), "Mode not shown.")
- end
-
- def test_inspect_encoding_is_ascii_compatible
- assert( Encoding.compatible?( Encoding.find("US-ASCII"),
- @table.inspect.encoding ),
- "inspect() was not ASCII compatible." )
- end
-end
diff --git a/test/csv/ts_all.rb b/test/csv/ts_all.rb
deleted file mode 100644
index 4fadbb46e9..0000000000
--- a/test/csv/ts_all.rb
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/usr/bin/env ruby -w
-# encoding: UTF-8
-
-# ts_all.rb
-#
-# 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.
-
-require "test/unit"
-
-require "test_csv_parsing"
-require "test_features"
-require "test_interface"
-require "test_csv_writing"
-require "test_data_converters"
-require "test_row"
-require "test_table"
-require "test_headers"
-require "test_serialization"
-require "test_encodings"
diff --git a/test/date/test_date.rb b/test/date/test_date.rb
deleted file mode 100644
index f2be9e24c4..0000000000
--- a/test/date/test_date.rb
+++ /dev/null
@@ -1,144 +0,0 @@
-require 'test/unit'
-require 'date'
-
-class DateSub < Date; end
-class DateTimeSub < DateTime; end
-
-class TestDate < Test::Unit::TestCase
-
- def test__const
- assert_nil(Date::MONTHNAMES[0])
- assert_equal('January', Date::MONTHNAMES[1])
- assert_equal(13, Date::MONTHNAMES.size)
- assert_equal('Sunday', Date::DAYNAMES[0])
- assert_equal(7, Date::DAYNAMES.size)
-
- assert_nil(Date::ABBR_MONTHNAMES[0])
- assert_equal('Jan', Date::ABBR_MONTHNAMES[1])
- assert_equal(13, Date::ABBR_MONTHNAMES.size)
- assert_equal('Sun', Date::ABBR_DAYNAMES[0])
- assert_equal(7, Date::ABBR_DAYNAMES.size)
-
- assert(Date::MONTHNAMES.frozen?)
- assert(!Date::MONTHNAMES[0].frozen?)
- assert(Date::MONTHNAMES[1].frozen?)
- assert(Date::DAYNAMES.frozen?)
- assert(Date::DAYNAMES[0].frozen?)
-
- assert(Date::ABBR_MONTHNAMES.frozen?)
- assert(Date::ABBR_MONTHNAMES[1].frozen?)
- assert(Date::ABBR_DAYNAMES.frozen?)
- assert(Date::ABBR_DAYNAMES[0].frozen?)
- end
-
- def test_sub
- d = DateSub.new
- dt = DateTimeSub.new
-
- assert_instance_of(DateSub, d)
- assert_instance_of(DateTimeSub, dt)
-
- assert_instance_of(DateSub, DateSub.today)
- assert_instance_of(DateTimeSub, DateTimeSub.now)
-
- assert_equal('#<DateSub: -4712-01-01 (-1/2,0,2299161)>', d.inspect)
- assert_equal('-4712-01-01', d.to_s)
- assert_equal('#<DateTimeSub: -4712-01-01T00:00:00+00:00 (-1/2,0,2299161)>', dt.inspect)
- assert_equal('-4712-01-01T00:00:00+00:00', dt.to_s)
-
- d2 = d + 1
- assert_instance_of(DateSub, d2)
- d2 = d - 1
- assert_instance_of(DateSub, d2)
- d2 = d >> 1
- assert_instance_of(DateSub, d2)
- d2 = d << 1
- assert_instance_of(DateSub, d2)
- d2 = d.succ
- assert_instance_of(DateSub, d2)
- d2 = d.next
- assert_instance_of(DateSub, d2)
- d2 = d.italy
- assert_instance_of(DateSub, d2)
- d2 = d.england
- assert_instance_of(DateSub, d2)
- d2 = d.julian
- assert_instance_of(DateSub, d2)
- d2 = d.gregorian
- assert_instance_of(DateSub, d2)
- s = Marshal.dump(d)
- d2 = Marshal.load(s)
- assert_equal(d2, d)
- assert_instance_of(DateSub, d2)
-
- dt2 = dt + 1
- assert_instance_of(DateTimeSub, dt2)
- dt2 = dt - 1
- assert_instance_of(DateTimeSub, dt2)
- dt2 = dt >> 1
- assert_instance_of(DateTimeSub, dt2)
- dt2 = dt << 1
- assert_instance_of(DateTimeSub, dt2)
- dt2 = dt.succ
- assert_instance_of(DateTimeSub, dt2)
- dt2 = dt.next
- assert_instance_of(DateTimeSub, dt2)
- dt2 = dt.italy
- assert_instance_of(DateTimeSub, dt2)
- dt2 = dt.england
- assert_instance_of(DateTimeSub, dt2)
- dt2 = dt.julian
- assert_instance_of(DateTimeSub, dt2)
- dt2 = dt.gregorian
- assert_instance_of(DateTimeSub, dt2)
- s = Marshal.dump(dt)
- dt2 = Marshal.load(s)
- assert_equal(dt2, dt)
- assert_instance_of(DateTimeSub, dt2)
- end
-
- def test_eql_p
- d = Date.jd(0)
- d2 = Date.jd(0)
- dt = DateTime.jd(0)
- dt2 = DateTime.jd(0)
-
- assert_equal(d, d2)
- assert_not_equal(d, 0)
-
- assert_equal(dt, dt2)
- assert_not_equal(dt, 0)
-
- assert_equal(d, dt)
- assert_equal(d2, dt2)
- end
-
- def test_hash
- h = {}
- h[Date.new(1999,5,23)] = 0
- h[Date.new(1999,5,24)] = 1
- h[Date.new(1999,5,25)] = 2
- h[Date.new(1999,5,25)] = 9
- assert_equal(3, h.size)
- assert_equal(9, h[Date.new(1999,5,25)])
- assert_equal(9, h[DateTime.new(1999,5,25)])
-
- h = {}
- h[DateTime.new(1999,5,23)] = 0
- h[DateTime.new(1999,5,24)] = 1
- h[DateTime.new(1999,5,25)] = 2
- h[DateTime.new(1999,5,25)] = 9
- assert_equal(3, h.size)
- assert_equal(9, h[Date.new(1999,5,25)])
- assert_equal(9, h[DateTime.new(1999,5,25)])
- end
-
- def test_freeze
- d = Date.new
- d.freeze
- assert_equal(true, d.frozen?)
- assert_instance_of(Fixnum, d.yday)
- assert_instance_of(String, d.to_s)
- end
-
-end
diff --git a/test/date/test_date_arith.rb b/test/date/test_date_arith.rb
deleted file mode 100644
index 745ddbd16c..0000000000
--- a/test/date/test_date_arith.rb
+++ /dev/null
@@ -1,286 +0,0 @@
-require 'test/unit'
-require 'date'
-
-class TestDateArith < Test::Unit::TestCase
-
- def new_offset
- d = DateTime.new(2002, 3, 14)
- assert_equal(Rational(9, 24), d.new_offset(Rational(9, 24)).offset)
- assert_equal(Rational(9, 24), d.new_offset('+0900').offset)
- end
-
- def test__plus
- d = Date.new(2000,2,29) + -1
- assert_equal([2000, 2, 28], [d.year, d.mon, d.mday])
- d = Date.new(2000,2,29) + 0
- assert_equal([2000, 2, 29], [d.year, d.mon, d.mday])
- d = Date.new(2000,2,29) + 1
- assert_equal([2000, 3, 1], [d.year, d.mon, d.mday])
-
- d = DateTime.new(2000,2,29) + 1.to_r/2
- assert_equal([2000, 2, 29, 12, 0, 0],
- [d.year, d.mon, d.mday, d.hour, d.min, d.sec])
- end
-
- def test__plus__ex
- e = TypeError
- assert_raise(e) do
- Date.new(2000,2,29) + 'foo'
- end
- assert_raise(e) do
- DateTime.new(2000,2,29) + 'foo'
- end
- assert_raise(e) do
- Date.new(2000,2,29) + Time.mktime(2000,2,29)
- end
- assert_raise(e) do
- DateTime.new(2000,2,29) + Time.mktime(2000,2,29)
- end
- end
-
- def test__minus
- d = Date.new(2000,3,1) - -1
- assert_equal([2000, 3, 2], [d.year, d.mon, d.mday])
- d = Date.new(2000,3,1) - 0
- assert_equal([2000, 3, 1], [d.year, d.mon, d.mday])
- d = Date.new(2000,3,1) - 1
- assert_equal([2000, 2, 29], [d.year, d.mon, d.mday])
-
- d = Date.new(2000,3,1) - Date.new(2000,2,29)
- assert_equal(1, d)
- d = Date.new(2000,2,29) - Date.new(2000,3,1)
- assert_equal(-1, d)
-
- d = DateTime.new(2000,3,1) - 1.to_r/2
- assert_equal([2000, 2, 29, 12, 0, 0],
- [d.year, d.mon, d.mday, d.hour, d.min, d.sec])
- end
-
- def test__minus__ex
- e = TypeError
- assert_raise(e) do
- Date.new(2000,2,29) - 'foo'
- end
- assert_raise(e) do
- DateTime.new(2000,2,29) - 'foo'
- end
- assert_raise(e) do
- Date.new(2000,2,29) - Time.mktime(2000,2,29)
- end
- assert_raise(e) do
- DateTime.new(2000,2,29) - Time.mktime(2000,2,29)
- end
- end
-
- def test__compare
- assert_equal(0, (Date.new(2000,1,1) <=> Date.new(2000,1,1)))
- assert_equal(-1, (Date.new(2000,1,1) <=> Date.new(2000,1,2)))
- assert_equal(1, (Date.new(2000,1,2) <=> Date.new(2000,1,1)))
- assert_equal(0, (Date.new(2001,1,4,Date::JULIAN) <=>
- Date.new(2001,1,17, Date::GREGORIAN)))
- assert_equal(0, (DateTime.new(2001,1,4,0,0,0,0,Date::JULIAN) <=>
- DateTime.new(2001,1,17,0,0,0,0,Date::GREGORIAN)))
- end
-
- def test_prev
- d = Date.new(2000,1,1)
- assert_raise(NoMethodError) do
- d.prev
- end
- end
-
- def test_prev_day
- d = Date.new(2001,1,1).prev_day
- assert_equal([2000, 12, 31], [d.year, d.mon, d.mday])
- d = Date.new(2001,1,1).prev_day(2)
- assert_equal([2000, 12, 30], [d.year, d.mon, d.mday])
- d = Date.new(2000,12,31).prev_day(-2)
- assert_equal([2001, 1, 2], [d.year, d.mon, d.mday])
-
- d = DateTime.new(2000,3,1).prev_day(1.to_r/2)
- assert_equal([2000, 2, 29, 12, 0, 0], [d.year, d.mon, d.mday, d.hour, d.min, d.sec])
- end
-
- def test_prev_month
- d = Date.new(2000,1,31) << -1
- assert_equal([2000, 2, 29], [d.year, d.mon, d.mday])
- d = Date.new(2000,1,31) << 1
- assert_equal([1999, 12, 31], [d.year, d.mon, d.mday])
- d = Date.new(2000,1,31) << 12
- assert_equal([1999, 1, 31], [d.year, d.mon, d.mday])
- d = Date.new(2000,1,31) << 14
- assert_equal([1998, 11, 30], [d.year, d.mon, d.mday])
-
- end
-
- def test_prev_month__2
- d = Date.new(2000,1,31).prev_month(-1)
- assert_equal([2000, 2, 29], [d.year, d.mon, d.mday])
- d = Date.new(2000,1,31).prev_month
- assert_equal([1999, 12, 31], [d.year, d.mon, d.mday])
- d = Date.new(2000,1,31).prev_month(12)
- assert_equal([1999, 1, 31], [d.year, d.mon, d.mday])
- d = Date.new(2000,1,31).prev_month(14)
- assert_equal([1998, 11, 30], [d.year, d.mon, d.mday])
- end
-
- def test_prev_year
- d = Date.new(2000,1,31).prev_year(-1)
- assert_equal([2001, 1, 31], [d.year, d.mon, d.mday])
- d = Date.new(2000,1,31).prev_year
- assert_equal([1999, 1, 31], [d.year, d.mon, d.mday])
- d = Date.new(2000,1,31).prev_year(10)
- assert_equal([1990, 1, 31], [d.year, d.mon, d.mday])
- d = Date.new(2000,1,31).prev_year(100)
- assert_equal([1900, 1, 31], [d.year, d.mon, d.mday])
- end
-
- def test_next
- d = Date.new(2000,12,31).next
- assert_equal([2001, 1, 1], [d.year, d.mon, d.mday])
- d = Date.new(2000,12,31).succ
- assert_equal([2001, 1, 1], [d.year, d.mon, d.mday])
-
- d = Date.today
- d2 = d.next
- assert_equal(d, (d2 - 1))
- d = Date.today
- d2 = d.succ
- assert_equal(d, (d2 - 1))
-
- d = DateTime.now
- d2 = d.next
- assert_equal(d, (d2 - 1))
- d = DateTime.now
- d2 = d.succ
- assert_equal(d, (d2 - 1))
- end
-
- def test_next_day
- d = Date.new(2000,12,31).next_day
- assert_equal([2001, 1, 1], [d.year, d.mon, d.mday])
- d = Date.new(2000,12,31).next_day(2)
- assert_equal([2001, 1, 2], [d.year, d.mon, d.mday])
- d = Date.new(2001,1,1).next_day(-2)
- assert_equal([2000, 12, 30], [d.year, d.mon, d.mday])
-
- d = DateTime.new(2000,2,29).next_day(1.to_r/2)
- assert_equal([2000, 2, 29, 12, 0, 0], [d.year, d.mon, d.mday, d.hour, d.min, d.sec])
- end
-
- def test_next_month
- d = Date.new(2000,1,31) >> -1
- assert_equal([1999, 12, 31], [d.year, d.mon, d.mday])
- d = Date.new(2000,1,31) >> 1
- assert_equal([2000, 2, 29], [d.year, d.mon, d.mday])
- d = Date.new(2000,1,31) >> 12
- assert_equal([2001, 1, 31], [d.year, d.mon, d.mday])
- d = Date.new(2000,1,31) >> 13
- assert_equal([2001, 2, 28], [d.year, d.mon, d.mday])
- end
-
- def test_next_month__2
- d = Date.new(2000,1,31).next_month(-1)
- assert_equal([1999, 12, 31], [d.year, d.mon, d.mday])
- d = Date.new(2000,1,31).next_month
- assert_equal([2000, 2, 29], [d.year, d.mon, d.mday])
- d = Date.new(2000,1,31).next_month(12)
- assert_equal([2001, 1, 31], [d.year, d.mon, d.mday])
- d = Date.new(2000,1,31).next_month(13)
- assert_equal([2001, 2, 28], [d.year, d.mon, d.mday])
- end
-
- def test_next_year
- d = Date.new(2000,1,31).next_year(-1)
- assert_equal([1999, 1, 31], [d.year, d.mon, d.mday])
- d = Date.new(2000,1,31).next_year
- assert_equal([2001, 1, 31], [d.year, d.mon, d.mday])
- d = Date.new(2000,1,31).next_year(10)
- assert_equal([2010, 1, 31], [d.year, d.mon, d.mday])
- d = Date.new(2000,1,31).next_year(100)
- assert_equal([2100, 1, 31], [d.year, d.mon, d.mday])
- end
-
- def test_downto
- p = Date.new(2001,1,14)
- q = Date.new(2001,1,7)
- i = 0
- p.downto(q) do |d|
- i += 1
- end
- assert_equal(8, i)
- end
-
- def test_downto__noblock
- p = Date.new(2001,1,14)
- q = Date.new(2001,1,7)
- e = p.downto(q)
- assert_equal(8, e.to_a.size)
- end
-
- def test_upto
- p = Date.new(2001,1,14)
- q = Date.new(2001,1,21)
- i = 0
- p.upto(q) do |d|
- i += 1
- end
- assert_equal(8, i)
- end
-
- def test_upto__noblock
- p = Date.new(2001,1,14)
- q = Date.new(2001,1,21)
- e = p.upto(q)
- assert_equal(8, e.to_a.size)
- end
-
- def test_step
- p = Date.new(2001,1,14)
- q = Date.new(2001,1,21)
- i = 0
- p.step(q, 2) do |d|
- i += 1
- end
- assert_equal(4, i)
-
- i = 0
- p.step(q) do |d|
- i += 1
- end
- assert_equal(8, i)
- end
-
- def test_step__noblock
- p = Date.new(2001,1,14)
- q = Date.new(2001,1,21)
- e = p.step(q, 2)
- assert_equal(4, e.to_a.size)
-
- e = p.step(q)
- assert_equal(8, e.to_a.size)
- end
-
-=begin
- def test_step__inf
- p = Date.new(2001,1,14)
- q = Date.new(2001,1,21)
- inf = 1.0/0
-
- if inf.infinite?
- [p, q].each do |a|
- [p, q].each do |b|
- [inf, -inf].each do |c|
- i = 0
- a.step(b, c) do |d|
- i += 1
- end
- assert_equal(0, i)
- end
- end
- end
- end
- end
-=end
-
-end
diff --git a/test/date/test_date_attr.rb b/test/date/test_date_attr.rb
deleted file mode 100644
index 5187d5d3e5..0000000000
--- a/test/date/test_date_attr.rb
+++ /dev/null
@@ -1,109 +0,0 @@
-require 'test/unit'
-require 'date'
-
-class TestDateAttr < Test::Unit::TestCase
-
- def test__attr
- date = Date.new(1965, 5, 23)
- datetime = DateTime.new(1965, 5, 23, 22, 31, 59)
-
- [date, datetime].each_with_index do |d, i|
- if i == 0
- assert_match(/\#<Date\d?: 1965-05-23 \(4877807\/2,0,2299161\)>/,
- d.inspect)
- else
- assert_match(/\#<DateTime\d?: 1965-05-23T22:31:59\+00:00 \(210721343519\/86400,0,2299161\)>/,
- d.inspect)
- end
-
- if i == 0
- assert_equal('1965-05-23', d.to_s)
- else
- assert_equal('1965-05-23T22:31:59+00:00', d.to_s)
- end
-
- assert_equal('', d.inspect.gsub!(/./,''))
- assert_equal('', d.to_s.gsub!(/./,''))
-
- assert_equal(2438904, d.jd)
-
- if i == 0
- assert_equal(0, d.day_fraction)
- else
- assert_equal(22.to_r/24 + 31.to_r/1440 + 59.to_r/86400, d.day_fraction)
- end
-
- assert_equal(38903, d.mjd)
- assert_equal(139744, d.ld)
-
- assert_equal(1965, d.year)
- assert_equal(143, d.yday)
- assert_equal(5, d.mon)
- assert_equal(d.mon, d.month)
- assert_equal(23, d.mday)
- assert_equal(d.mday, d.day)
-
- if i == 0
- assert_equal(false, d.respond_to?(:hour))
- assert_equal(false, d.respond_to?(:min))
- assert_equal(false, d.respond_to?(:sec))
- assert_equal(false, d.respond_to?(:sec_fraction))
- assert_equal(false, d.respond_to?(:zone))
- assert_equal(false, d.respond_to?(:offset))
- else
- assert_equal(22, d.hour)
- assert_equal(31, d.min)
- assert_equal(59, d.sec)
- assert_equal(0, d.sec_fraction)
- assert_equal('+00:00', d.zone)
- assert_equal(0, d.offset)
- end
-
- assert_equal(1965, d.cwyear)
- assert_equal(20, d.cweek)
- assert_equal(7, d.cwday)
-
- assert_equal(0, d.wday)
- assert_equal(false, d.leap?)
- assert_equal(false, d.julian?)
- assert_equal(true, d.gregorian?)
-
- assert_equal(Date::ITALY, d.start)
- assert_equal(d.start, d.start)
- end
-
- d = DateTime.new(1965, 5, 23, 22, 31, 59) + 1.to_r/(86400*2)
- assert_equal(1.to_r/2, d.sec_fraction)
- end
-
- def test__wday_predicate
- d = Date.new(2005, 10, 23)
- assert_equal(true, d.sunday?)
- assert_equal(false, d.monday?)
- assert_equal(false, d.tuesday?)
- assert_equal(false, d.wednesday?)
- assert_equal(false, d.thursday?)
- assert_equal(false, d.friday?)
- assert_equal(false, d.saturday?)
-
- d = Date.new(2005, 10, 30)
- 14.times do |i|
- assert((d + i).__send__(%w(sunday? monday? tuesday? wednesday?
- thursday? friday? saturday?)[i % 7]))
- end
- end
-
- def test_nth_kday
- assert_equal(false, Date.new(2001,1,14).__send__(:nth_kday?, 1,0))
- assert_equal(true, Date.new(2001,1,14).__send__(:nth_kday?, 2,0))
- assert_equal(false, Date.new(2001,1,14).__send__(:nth_kday?, 3,0))
- assert_equal(false, Date.new(2001,1,14).__send__(:nth_kday?, 4,0))
- assert_equal(false, Date.new(2001,1,14).__send__(:nth_kday?, 5,0))
- assert_equal(false, Date.new(2001,1,14).__send__(:nth_kday?, -1,0))
- assert_equal(false, Date.new(2001,1,14).__send__(:nth_kday?, -2,0))
- assert_equal(true, Date.new(2001,1,14).__send__(:nth_kday?, -3,0))
- assert_equal(false, Date.new(2001,1,14).__send__(:nth_kday?, -4,0))
- assert_equal(false, Date.new(2001,1,14).__send__(:nth_kday?, -5,0))
- end
-
-end
diff --git a/test/date/test_date_base.rb b/test/date/test_date_base.rb
deleted file mode 100644
index a8dc2ee6b2..0000000000
--- a/test/date/test_date_base.rb
+++ /dev/null
@@ -1,435 +0,0 @@
-require 'test/unit'
-require 'date'
-
-begin
- require 'calendar'
- include Calendar
-rescue LoadError
-end
-
-class TestDateBase < Test::Unit::TestCase
-
- def setup
- if defined?(Calendar)
- @from ||= julian_day_number_from_absolute(absolute_from_julian(1, 1, 1601))
- @to ||= julian_day_number_from_absolute(absolute_from_julian(12, 31, 2400))
- @from4t ||= julian_day_number_from_absolute(absolute_from_julian(1, 1, 1970))
- @to4t ||= julian_day_number_from_absolute(absolute_from_julian(12, 31, 2037))
- end
- end
-
- def test__inf
- assert_equal(0, Date::Infinity.new(-1) <=> Date::Infinity.new(-1))
- assert_equal(-1, Date::Infinity.new(-1) <=> Date::Infinity.new(+1))
- assert_equal(-1, Date::Infinity.new(-1) <=> 0)
-
- assert_equal(1, Date::Infinity.new(+1) <=> Date::Infinity.new(-1))
- assert_equal(0, Date::Infinity.new(+1) <=> Date::Infinity.new(+1))
- assert_equal(1, Date::Infinity.new(+1) <=> 0)
-
- assert_equal(1, 0 <=> Date::Infinity.new(-1))
- assert_equal(-1, 0 <=> Date::Infinity.new(+1))
- assert_equal(0, 0 <=> 0)
-
- assert_equal(0, Date::ITALY <=> Date::ITALY)
- assert_equal(-1, Date::ITALY <=> Date::ENGLAND)
- assert_equal(-1, Date::ITALY <=> Date::JULIAN)
- assert_equal(1, Date::ITALY <=> Date::GREGORIAN)
-
- assert_equal(1, Date::ENGLAND <=> Date::ITALY)
- assert_equal(0, Date::ENGLAND <=> Date::ENGLAND)
- assert_equal(-1, Date::ENGLAND <=> Date::JULIAN)
- assert_equal(1, Date::ENGLAND <=> Date::GREGORIAN)
-
- assert_equal(1, Date::JULIAN <=> Date::ITALY)
- assert_equal(1, Date::JULIAN <=> Date::ENGLAND)
- assert_equal(0, Date::JULIAN <=> Date::JULIAN)
- assert_equal(1, Date::JULIAN <=> Date::GREGORIAN)
-
- assert_equal(-1, Date::GREGORIAN <=> Date::ITALY)
- assert_equal(-1, Date::GREGORIAN <=> Date::ENGLAND)
- assert_equal(-1, Date::GREGORIAN <=> Date::JULIAN)
- assert_equal(0, Date::GREGORIAN <=> Date::GREGORIAN)
- end
-
- def test_ordinal__julian
- unless defined?(Calendar)
- return
- end
- for j in @from..@to
- m, d, y = julian_from_absolute(absolute_from_julian_day_number(j))
- j0 = julian_day_number_from_absolute(absolute_from_julian(12, 31, y - 1))
- j2 = julian_day_number_from_absolute(absolute_from_julian(m, d, y))
- assert_equal(j, j2)
- oy, od = Date.__send__(:jd_to_ordinal, j, Date::JULIAN)
- assert_equal(y, oy)
- assert_equal(j2 - j0, od)
- oj = Date.__send__(:ordinal_to_jd, oy, od, Date::JULIAN)
- assert_equal(j, oj)
- end
- end
-
- def test_ordinal__gregorian
- unless defined?(Calendar)
- return
- end
- for j in @from..@to
- m, d, y = gregorian_from_absolute(absolute_from_julian_day_number(j))
- j0 =
- julian_day_number_from_absolute(absolute_from_gregorian(12, 31, y - 1))
- j2 = julian_day_number_from_absolute(absolute_from_gregorian(m, d, y))
- assert_equal(j, j2)
- oy, od = Date.__send__(:jd_to_ordinal, j, Date::GREGORIAN)
- assert_equal(y, oy)
- assert_equal(j2 - j0, od)
- oj = Date.__send__(:ordinal_to_jd, oy, od, Date::GREGORIAN)
- assert_equal(j, oj)
- end
- end
-
- def test_civil__julian
- unless defined?(Calendar)
- return
- end
- for j in @from..@to
- m, d, y = julian_from_absolute(absolute_from_julian_day_number(j))
- j2 = julian_day_number_from_absolute(absolute_from_julian(m, d, y))
- assert_equal(j2, j)
- cy, cm, cd = Date.__send__(:jd_to_civil, j, Date::JULIAN)
- assert_equal(y, cy)
- assert_equal(m, cm)
- assert_equal(d, cd)
- cj = Date.__send__(:civil_to_jd, cy, cm, cd, Date::JULIAN)
- assert_equal(j, cj)
- end
- end
-
- def test_civil__gregorian
- unless defined?(Calendar)
- return
- end
- for j in @from..@to
- m, d, y = gregorian_from_absolute(absolute_from_julian_day_number(j))
- j2 = julian_day_number_from_absolute(absolute_from_gregorian(m, d, y))
- assert_equal(j2, j)
- cy, cm, cd = Date.__send__(:jd_to_civil, j, Date::GREGORIAN)
- assert_equal(y, cy)
- assert_equal(m, cm)
- assert_equal(d, cd)
- cj = Date.__send__(:civil_to_jd, cy, cm, cd, Date::GREGORIAN)
- assert_equal(j, cj)
- end
- end
-
- def test_commercial__gregorian
- unless defined?(Calendar)
- return
- end
- for j in @from..@to
- w, d, y = iso_from_absolute(absolute_from_julian_day_number(j))
- j2 = julian_day_number_from_absolute(absolute_from_iso(w, d, y))
- assert_equal(j2, j)
- cy, cw, cd = Date.__send__(:jd_to_commercial, j, Date::GREGORIAN)
- assert_equal(y, cy)
- assert_equal(w, cw)
- assert_equal(d, cd)
- cj = Date.__send__(:commercial_to_jd, cy, cw, cd, Date::GREGORIAN)
- assert_equal(j, cj)
- end
- end
-
- def test_weeknum
- unless defined?(Calendar)
- return
- end
- for j in @from..@to
- for k in 0..1
- wy, ww, wd = Date.__send__(:jd_to_weeknum, j, k, Date::GREGORIAN)
- wj = Date.__send__(:weeknum_to_jd, wy, ww, wd, k, Date::GREGORIAN)
- assert_equal(j, wj)
- end
- end
- end
-
- def test_weeknum__2
- unless defined?(Calendar)
- return
- end
- for j in @from4t..@to4t
- d = Date.jd(j)
- t = Time.mktime(d.year, d.mon, d.mday)
- [
- '%Y %U %w',
- '%Y %U %u',
- '%Y %W %w',
- '%Y %W %u'
- ].each do |fmt|
- s = t.strftime(fmt)
- d2 = Date.strptime(s, fmt)
- assert_equal(j, d2.jd)
- end
- end
- end
-
- def test_nth_kday
- unless defined?(Calendar)
- return
- end
- for y in 1601..2401
- for m in 1..12
- for n in -5..5
- next if n == 0
- for k in 0..6
- j = julian_day_number_from_absolute(Nth_Kday(n, k, m, y))
- j2 = Date.__send__(:nth_kday_to_jd, y, m, n, k, Date::GREGORIAN)
- assert_equal(j, j2)
-
- d1 = Date.__send__(:jd_to_nth_kday, j2, Date::GREGORIAN)
- j3 = Date.__send__(:nth_kday_to_jd, *d1)
- assert_equal(j, j3)
- end
- end
- end
- end
- end
-
- def test_mjd
- jd = Date.__send__(:mjd_to_jd, 51321)
- mjd = Date.__send__(:jd_to_mjd, jd)
- assert_equal(51321, mjd)
- end
-
- def test_ld
- jd = Date.__send__(:ld_to_jd, 152162)
- ld = Date.__send__(:jd_to_ld, jd)
- assert_equal(152162, ld)
- end
-
- def test_wday
- assert_equal(4, Date.__send__(:jd_to_wday, 3))
- assert_equal(3, Date.__send__(:jd_to_wday, 2))
- assert_equal(2, Date.__send__(:jd_to_wday, 1))
- assert_equal(1, Date.__send__(:jd_to_wday, 0))
- assert_equal(0, Date.__send__(:jd_to_wday, -1))
- assert_equal(6, Date.__send__(:jd_to_wday, -2))
- assert_equal(5, Date.__send__(:jd_to_wday, -3))
- end
-
- def test_leap?
- assert_equal(true, Date.julian_leap?(1900))
- assert_equal(false, Date.julian_leap?(1999))
- assert_equal(true, Date.julian_leap?(2000))
-
- assert_equal(false, Date.gregorian_leap?(1900))
- assert_equal(false, Date.gregorian_leap?(1999))
- assert_equal(true, Date.gregorian_leap?(2000))
-
- assert_equal(Date.leap?(1990), Date.gregorian_leap?(1900))
- assert_equal(Date.leap?(1999), Date.gregorian_leap?(1999))
- assert_equal(Date.leap?(2000), Date.gregorian_leap?(2000))
- end
-
- def test_valid_jd
- valid_jd_p = :_valid_jd?
- assert_equal(-1, Date.__send__(valid_jd_p, -1))
- assert_equal(0, Date.__send__(valid_jd_p, 0))
- assert_equal(1, Date.__send__(valid_jd_p, 1))
- assert_equal(2452348, Date.__send__(valid_jd_p, 2452348))
- end
-
- def test_valid_ordinal
- valid_ordinal_p = :_valid_ordinal?
- assert_nil(Date.__send__(valid_ordinal_p, 1999,366))
- assert_equal(2451910, Date.__send__(valid_ordinal_p, 2000,366))
- assert_nil(Date.__send__(valid_ordinal_p, 1999,-366))
- assert_equal(2451545, Date.__send__(valid_ordinal_p, 2000,-366))
- assert_equal(2452275, Date.__send__(valid_ordinal_p, 2001,365))
- assert_nil(Date.__send__(valid_ordinal_p, 2001,366))
- assert_equal(Date.__send__(valid_ordinal_p, 2001,1),
- Date.__send__(valid_ordinal_p, 2001,-365))
- assert_nil(Date.__send__(valid_ordinal_p, 2001,-366))
- assert_equal(2452348, Date.__send__(valid_ordinal_p, 2002,73))
- end
-
- def test_valid_ordinal__edge
- valid_ordinal_p = :_valid_ordinal?
- (1601..2400).each do |y|
- d = if Date.leap?(y) then 366 else 365 end
- assert_not_nil(Date.__send__(valid_ordinal_p, y,d))
- assert_nil(Date.__send__(valid_ordinal_p, y,d + 1))
- assert_not_nil(Date.__send__(valid_ordinal_p, y,-d))
- assert_nil(Date.__send__(valid_ordinal_p, y,-(d + 1)))
- end
- end
-
- # October 1582
- # S M Tu W Th F S
- # 274 275 276 277 288 289
- # 290 291 292 293 294 295 296
- # 297 298 299 300 301 302 303
- # 304
-
- # October 1582
- # S M Tu W Th F S
- # -92 -91 -90 -89 -78 -77
- # -76 -75 -74 -73 -72 -71 -70
- # -69 -68 -67 -66 -65 -64 -63
- # -62
-
- def test_valid_ordinal__italy
- valid_ordinal_p = :_valid_ordinal?
- (1..355).each do |d|
- assert_not_nil(Date.__send__(valid_ordinal_p, 1582,d,Date::ITALY))
- end
- (356..365).each do |d|
- assert_nil(Date.__send__(valid_ordinal_p, 1582,d,Date::ITALY))
- end
- end
-
- # September 1752
- # S M Tu W Th F S
- # 245 246 258 259 260
- # 261 262 263 264 265 266 267
- # 268 269 270 271 272 273 274
-
- def test_valid_ordinal__england
- valid_ordinal_p = :_valid_ordinal?
- (1..355).each do |d|
- assert_not_nil(Date.__send__(valid_ordinal_p, 1752,d,Date::ENGLAND))
- end
- (356..366).each do |d|
- assert_nil(Date.__send__(valid_ordinal_p, 1752,d,Date::ENGLAND))
- end
- end
-
- def test_valid_civil
- valid_civil_p = :_valid_civil?
- assert_nil(Date.__send__(valid_civil_p, 1999,2,29))
- assert_equal(2451604, Date.__send__(valid_civil_p, 2000,2,29))
- assert_nil(Date.__send__(valid_civil_p, 1999,2,-29))
- assert_equal(2451576, Date.__send__(valid_civil_p, 2000,2,-29))
- assert_equal(2451941, Date.__send__(valid_civil_p, 2001,1,31))
- assert_nil(Date.__send__(valid_civil_p, 2001,1,32))
- assert_equal(Date.__send__(valid_civil_p, 2001,1,1),
- Date.__send__(valid_civil_p, 2001,1,-31))
- assert_nil(Date.__send__(valid_civil_p, 2001,1,-32))
- assert_equal(2452348, Date.__send__(valid_civil_p, 2002,3,14))
- end
-
- def test_valid_civil__edge
- valid_civil_p = :_valid_civil?
- (1601..2400).each do |y|
- d = if Date.leap?(y) then 29 else 28 end
- assert_not_nil(Date.__send__(valid_civil_p, y,2,d))
- assert_nil(Date.__send__(valid_civil_p, y,2,d + 1))
- assert_not_nil(Date.__send__(valid_civil_p, y,2,-d))
- assert_nil(Date.__send__(valid_civil_p, y,2,-(d + 1)))
- end
- end
-
- # October 1582
- # S M Tu W Th F S
- # 1 2 3 4 15 16
- # 17 18 19 20 21 22 23
- # 24 25 26 27 28 29 30
- # 31
-
- def test_valid_civil__italy
- valid_civil_p = :_valid_civil?
- (1..4).each do |d|
- assert_not_nil(Date.__send__(valid_civil_p, 1582,10,d,Date::ITALY))
- end
- (5..14).each do |d|
- assert_nil(Date.__send__(valid_civil_p, 1582,10,d,Date::ITALY))
- end
- (15..31).each do |d|
- assert_not_nil(Date.__send__(valid_civil_p, 1582,10,d,Date::ITALY))
- end
- (32..100).each do |d|
- assert_nil(Date.__send__(valid_civil_p, 1582,10,d,Date::ITALY))
- end
- (-31..-22).each do |d|
- assert_nil(Date.__send__(valid_civil_p, 1582,10,d,Date::ITALY))
- end
- (-21..-1).each do |d|
- assert_not_nil(Date.__send__(valid_civil_p, 1582,10,d,Date::ITALY))
- end
- end
-
- # September 1752
- # S M Tu W Th F S
- # 1 2 14 15 16
- # 17 18 19 20 21 22 23
- # 24 25 26 27 28 29 30
-
- def test_valid_civil__england
- valid_civil_p = :_valid_civil?
- (1..2).each do |d|
- assert_not_nil(Date.__send__(valid_civil_p, 1752,9,d,Date::ENGLAND))
- end
- (3..13).each do |d|
- assert_nil(Date.__send__(valid_civil_p, 1752,9,d,Date::ENGLAND))
- end
- (14..30).each do |d|
- assert_not_nil(Date.__send__(valid_civil_p, 1752,9,d,Date::ENGLAND))
- end
- (31..100).each do |d|
- assert_nil(Date.__send__(valid_civil_p, 1752,9,d,Date::ENGLAND))
- end
- (-31..-20).each do |d|
- assert_nil(Date.__send__(valid_civil_p, 1752,9,d,Date::ENGLAND))
- end
- (-19..-1).each do |d|
- assert_not_nil(Date.__send__(valid_civil_p, 1752,9,d,Date::ENGLAND))
- end
- end
-
- def test_valid_commercial
- valid_commercial_p = :_valid_commercial?
- assert_nil(Date.__send__(valid_commercial_p, 1999,53,1))
- assert_equal(2453367, Date.__send__(valid_commercial_p, 2004,53,1))
- assert_nil(Date.__send__(valid_commercial_p, 1999,-53,-1))
- assert_equal(2453009, Date.__send__(valid_commercial_p, 2004,-53,-1))
- assert_equal(2452348, Date.__send__(valid_commercial_p, 2002,11,4))
- end
-
- def test_valid_weeknum
- valid_weeknum_p = :_valid_weeknum?
- assert_nil(Date.__send__(valid_weeknum_p, 1999,53,0, 0))
- assert_equal(2454101, Date.__send__(valid_weeknum_p, 2006,53,0, 0))
- assert_nil(Date.__send__(valid_weeknum_p, 1999,-53,-1, 0))
- assert_equal(2453743, Date.__send__(valid_weeknum_p, 2006,-53,-1, 0))
- assert_equal(2452355, Date.__send__(valid_weeknum_p, 2002,11,4, 0))
- assert_nil(Date.__send__(valid_weeknum_p, 1999,53,0, 1))
- assert_equal(2454101, Date.__send__(valid_weeknum_p, 2006,52,6, 1))
- assert_nil(Date.__send__(valid_weeknum_p, 1999,-53,-1, 1))
- assert_equal(2453743, Date.__send__(valid_weeknum_p, 2006,-52,-2, 1))
- assert_equal(2452355, Date.__send__(valid_weeknum_p, 2002,11,3, 1))
- end
-
- def test_valid_nth_kday
- valid_nth_kday_p = :_valid_nth_kday?
- assert_nil(Date.__send__(valid_nth_kday_p, 1992,2, 5,0))
- assert_equal(2448682, Date.__send__(valid_nth_kday_p, 1992,2, 5,6))
- assert_equal(2448682, Date.__send__(valid_nth_kday_p, 1992,2, 5,-1))
- assert_equal(2448682, Date.__send__(valid_nth_kday_p, 1992,2, -1,6))
- assert_equal(2448682, Date.__send__(valid_nth_kday_p, 1992,2, -1,-1))
- end
-
- def test_valid_time
- valid_time_p = :_valid_time?
- assert_equal(Rational(0), DateTime.__send__(valid_time_p, 0,0,0))
- assert_nil(DateTime.__send__(valid_time_p, 25,59,59))
- assert_nil(DateTime.__send__(valid_time_p, 23,60,59))
- assert_nil(DateTime.__send__(valid_time_p, 23,59,60))
- assert_equal(Rational(86399, 86400),
- DateTime.__send__(valid_time_p, 23,59,59))
- assert_equal(Rational(86399, 86400),
- DateTime.__send__(valid_time_p, -1,-1,-1))
- assert_equal(Rational(1), DateTime.__send__(valid_time_p, 24,0,0))
- assert_nil(DateTime.__send__(valid_time_p, 24,0,1))
- assert_nil(DateTime.__send__(valid_time_p, 24,1,0))
- assert_nil(DateTime.__send__(valid_time_p, 24,1,1))
- end
-
-end
diff --git a/test/date/test_date_compat.rb b/test/date/test_date_compat.rb
deleted file mode 100644
index 8284007407..0000000000
--- a/test/date/test_date_compat.rb
+++ /dev/null
@@ -1,21 +0,0 @@
-require 'test/unit'
-require 'date'
-
-class TestDateCompat < Test::Unit::TestCase
-
- def test_compat
- assert_equal(DateTime.new, Date.new)
- assert_equal(DateTime.new(2002,3,19), Date.new(2002,3,19))
- assert_equal(DateTime.new(2002,3,19, 0,0,0), Date.new(2002,3,19))
- assert_equal(DateTime.new(2002,3,19, 0,0,0, 0), Date.new(2002,3,19))
- assert_equal(DateTime.new(2002,3,19, 0,0,0, 0.to_r), Date.new(2002,3,19))
- assert_equal(DateTime.new(2002,3,19, 0,0,0, 0, Date::GREGORIAN), Date.new(2002,3,19, Date::GREGORIAN))
- assert_equal(DateTime.new(2002,3,19, 0,0,0, 0, Date::JULIAN), Date.new(2002,3,19, Date::JULIAN))
-
- assert(Date.new(2002,3,19) != DateTime.new(2002,3,19, 12,0,0))
- assert(Date.new(2002,3,19) != DateTime.new(2002,3,19, 0,0,1))
- assert(Date.new(2002,3,19) === DateTime.new(2002,3,19, 12,0,0))
- assert(Date.new(2002,3,19) === DateTime.new(2002,3,19, 0,0,1))
- end
-
-end
diff --git a/test/date/test_date_conv.rb b/test/date/test_date_conv.rb
deleted file mode 100644
index daf0374294..0000000000
--- a/test/date/test_date_conv.rb
+++ /dev/null
@@ -1,137 +0,0 @@
-require 'test/unit'
-require 'date'
-
-class TestDateConv < Test::Unit::TestCase
-
- def test_to_class
- [Time.now, Date.today, DateTime.now].each do |o|
- assert_instance_of(Time, o.to_time)
- assert_instance_of(Date, o.to_date)
- assert_instance_of(DateTime, o.to_datetime)
- end
- end
-
- def test_to_time__from_time
- t = Time.mktime(2004, 9, 19, 1, 2, 3, 456789)
- t2 = t.to_time
- assert_equal([2004, 9, 19, 1, 2, 3, 456789],
- [t2.year, t2.mon, t2.mday, t2.hour, t2.min, t2.sec, t2.usec])
-
- t = Time.utc(2004, 9, 19, 1, 2, 3, 456789)
- t2 = t.to_time.utc
- assert_equal([2004, 9, 19, 1, 2, 3, 456789],
- [t2.year, t2.mon, t2.mday, t2.hour, t2.min, t2.sec, t2.usec])
- end
-
- def test_to_time__from_date
- d = Date.new(2004, 9, 19)
- t = d.to_time
- assert_equal([2004, 9, 19, 0, 0, 0, 0],
- [t.year, t.mon, t.mday, t.hour, t.min, t.sec, t.usec])
- end
-
- def test_to_time__from_datetime
- d = DateTime.new(2004, 9, 19, 1, 2, 3, 9.to_r/24) + 456789.to_r/86400000000
- t = d.to_time
- if t.utc_offset == 9*60*60
- assert_equal([2004, 9, 19, 1, 2, 3, 456789],
- [t.year, t.mon, t.mday, t.hour, t.min, t.sec, t.usec])
- end
-
- d = DateTime.new(2004, 9, 19, 1, 2, 3, 0) + 456789.to_r/86400000000
- t = d.to_time.utc
- assert_equal([2004, 9, 19, 1, 2, 3, 456789],
- [t.year, t.mon, t.mday, t.hour, t.min, t.sec, t.usec])
-
- if Time.allocate.respond_to?(:nsec)
- d = DateTime.new(2004, 9, 19, 1, 2, 3, 0) + 456789123.to_r/86400000000000
- t = d.to_time.utc
- assert_equal([2004, 9, 19, 1, 2, 3, 456789123],
- [t.year, t.mon, t.mday, t.hour, t.min, t.sec, t.nsec])
- end
-
- if Time.allocate.respond_to?(:subsec)
- d = DateTime.new(2004, 9, 19, 1, 2, 3, 0) + 456789123456789123.to_r/86400000000000000000000
- t = d.to_time.utc
- assert_equal([2004, 9, 19, 1, 2, 3, Rational(456789123456789123,1000000000000000000)],
- [t.year, t.mon, t.mday, t.hour, t.min, t.sec, t.subsec])
- end
- end
-
- def test_to_date__from_time
- t = Time.mktime(2004, 9, 19, 1, 2, 3, 456789)
- d = t.to_date
- assert_equal([2004, 9, 19, 0], [d.year, d.mon, d.mday, d.day_fraction])
-
- t = Time.utc(2004, 9, 19, 1, 2, 3, 456789)
- d = t.to_date
- assert_equal([2004, 9, 19, 0], [d.year, d.mon, d.mday, d.day_fraction])
- end
-
- def test_to_date__from_date
- d = Date.new(2004, 9, 19) + 1.to_r/2
- d2 = d.to_date
- assert_equal([2004, 9, 19, 1.to_r/2],
- [d2.year, d2.mon, d2.mday, d2.day_fraction])
- end
-
- def test_to_date__from_datetime
- d = DateTime.new(2004, 9, 19, 1, 2, 3, 9.to_r/24) + 456789.to_r/86400000000
- d2 = d.to_date
- assert_equal([2004, 9, 19, 0], [d2.year, d2.mon, d2.mday, d2.day_fraction])
-
- d = DateTime.new(2004, 9, 19, 1, 2, 3, 0) + 456789.to_r/86400000000
- d2 = d.to_date
- assert_equal([2004, 9, 19, 0], [d2.year, d2.mon, d2.mday, d2.day_fraction])
- end
-
- def test_to_datetime__from_time
- t = Time.mktime(2004, 9, 19, 1, 2, 3, 456789)
- d = t.to_datetime
- assert_equal([2004, 9, 19, 1, 2, 3,
- 456789.to_r/1000000,
- t.utc_offset.to_r/86400],
- [d.year, d.mon, d.mday, d.hour, d.min, d.sec,
- d.sec_fraction, d.offset])
-
- t = Time.utc(2004, 9, 19, 1, 2, 3, 456789)
- d = t.to_datetime
- assert_equal([2004, 9, 19, 1, 2, 3,
- 456789.to_r/1000000,
- 0],
- [d.year, d.mon, d.mday, d.hour, d.min, d.sec,
- d.sec_fraction, d.offset])
-
- t = Time.now
- d = t.to_datetime
- require 'time'
- assert_equal(t.iso8601(10), d.iso8601(10))
- end
-
- def test_to_datetime__from_date
- d = Date.new(2004, 9, 19) + 1.to_r/2
- d2 = d.to_datetime
- assert_equal([2004, 9, 19, 0, 0, 0, 0, 0],
- [d2.year, d2.mon, d2.mday, d2.hour, d2.min, d2.sec,
- d2.sec_fraction, d2.offset])
- end
-
- def test_to_datetime__from_datetime
- d = DateTime.new(2004, 9, 19, 1, 2, 3, 9.to_r/24) + 456789.to_r/86400000000
- d2 = d.to_datetime
- assert_equal([2004, 9, 19, 1, 2, 3,
- 456789.to_r/1000000,
- 9.to_r/24],
- [d2.year, d2.mon, d2.mday, d2.hour, d2.min, d2.sec,
- d2.sec_fraction, d2.offset])
-
- d = DateTime.new(2004, 9, 19, 1, 2, 3, 0) + 456789.to_r/86400000000
- d2 = d.to_datetime
- assert_equal([2004, 9, 19, 1, 2, 3,
- 456789.to_r/1000000,
- 0],
- [d2.year, d2.mon, d2.mday, d2.hour, d2.min, d2.sec,
- d2.sec_fraction, d2.offset])
- end
-
-end
diff --git a/test/date/test_date_marshal.rb b/test/date/test_date_marshal.rb
deleted file mode 100644
index 2f86a8c8c2..0000000000
--- a/test/date/test_date_marshal.rb
+++ /dev/null
@@ -1,29 +0,0 @@
-require 'test/unit'
-require 'date'
-
-class TestDateMarshal < Test::Unit::TestCase
-
- def test_marshal
- d = Date.new
- m = Marshal.dump(d)
- d2 = Marshal.load(m)
- assert_equal(d, d2)
- assert_equal(d.start, d2.start)
- assert_instance_of(String, d2.to_s)
-
- d = Date.today
- m = Marshal.dump(d)
- d2 = Marshal.load(m)
- assert_equal(d, d2)
- assert_equal(d.start, d2.start)
- assert_instance_of(String, d2.to_s)
-
- d = DateTime.now
- m = Marshal.dump(d)
- d2 = Marshal.load(m)
- assert_equal(d, d2)
- assert_equal(d.start, d2.start)
- assert_instance_of(String, d2.to_s)
- end
-
-end
diff --git a/test/date/test_date_new.rb b/test/date/test_date_new.rb
deleted file mode 100644
index 14ff247294..0000000000
--- a/test/date/test_date_new.rb
+++ /dev/null
@@ -1,278 +0,0 @@
-require 'test/unit'
-require 'date'
-
-class TestDateNew < Test::Unit::TestCase
-
- def test_jd
- d = Date.jd
- dt = DateTime.jd
- assert_equal([-4712, 1, 1], [d.year, d.mon, d.mday])
- assert_equal([-4712, 1, 1], [dt.year, dt.mon, dt.mday])
- assert_equal([0, 0, 0], [dt.hour, dt.min, dt.sec])
-
- d2 = Date.jd
- dt2 = DateTime.jd
- assert_equal(d, d2)
- assert_equal(dt, dt2)
-
- d = Date.jd(0)
- assert_equal([-4712, 1, 1], [d.year, d.mon, d.mday])
- d = DateTime.jd(0, 0,0,0, 0)
- assert_equal([-4712, 1, 1, 0, 0, 0, 0],
- [d.year, d.mon, d.mday, d.hour, d.min, d.sec, d.offset])
- d = DateTime.jd(0, 0,0,0, '+0900')
- assert_equal([-4712, 1, 1, 0, 0, 0, 9.to_r/24],
- [d.year, d.mon, d.mday, d.hour, d.min, d.sec, d.offset])
- end
-
- def test_jd__ex
- assert_raise(ArgumentError) do
- DateTime.jd(0, 23,59,60,0)
- end
- end
-
- def test_ordinal
- d = Date.ordinal
- dt = DateTime.ordinal
- assert_equal([-4712, 1, 1], [d.year, d.mon, d.mday])
- assert_equal([-4712, 1, 1], [dt.year, dt.mon, dt.mday])
- assert_equal([0, 0, 0], [dt.hour, dt.min, dt.sec])
-
- d2 = Date.ordinal
- dt2 = DateTime.ordinal
- assert_equal(d, d2)
- assert_equal(dt, dt2)
-
- d = Date.ordinal(-4712,1)
- assert_equal([-4712, 1, 1], [d.year, d.mon, d.mday])
-
- d = Date.ordinal(-4712,1.0)
- assert_equal([-4712, 1, 1], [d.year, d.mon, d.mday])
-
- d = DateTime.ordinal(-4712,1, 0,0,0, 0)
- assert_equal([-4712, 1, 1, 0, 0, 0, 0],
- [d.year, d.mon, d.mday, d.hour, d.min, d.sec, d.offset])
- d = DateTime.ordinal(-4712,1, 0,0,0, '+0900')
- assert_equal([-4712, 1, 1, 0, 0, 0, 9.to_r/24],
- [d.year, d.mon, d.mday, d.hour, d.min, d.sec, d.offset])
- end
-
- def test_ordinal__neg
- d = Date.ordinal(-1,-1)
- assert_equal([-1, 365], [d.year, d.yday])
-
- d = DateTime.ordinal(-1,-1, -1,-1,-1, 0)
- assert_equal([-1, 365, 23, 59, 59, 0],
- [d.year, d.yday, d.hour, d.min, d.sec, d.offset])
- end
-
- def test_ordinal__ex
- assert_raise(ArgumentError) do
- Date.ordinal(2001,1.1)
- end
- assert_raise(ArgumentError) do
- Date.ordinal(2001,366)
- end
- assert_raise(ArgumentError) do
- DateTime.ordinal(2001,365, 23,59,60, 0)
- end
- end
-
- def test_civil
- d = Date.civil
- dt = DateTime.civil
- assert_equal([-4712, 1, 1], [d.year, d.mon, d.mday])
- assert_equal([-4712, 1, 1], [dt.year, dt.mon, dt.mday])
- assert_equal([0, 0, 0], [dt.hour, dt.min, dt.sec])
-
- d2 = Date.civil
- dt2 = DateTime.civil
- assert_equal(d, d2)
- assert_equal(dt, dt2)
-
- d = Date.civil(-4712,1,1)
- assert_equal([-4712, 1, 1], [d.year, d.mon, d.mday])
-
- d = Date.civil(-4712,1,1.0)
- assert_equal([-4712, 1, 1], [d.year, d.mon, d.mday])
-
- d = DateTime.civil(-4712,1,1, 0,0,0, 0)
- assert_equal([-4712, 1, 1, 0, 0, 0, 0],
- [d.year, d.mon, d.mday, d.hour, d.min, d.sec, d.offset])
- d = DateTime.civil(-4712,1,1, 0,0,0, '+0900')
- assert_equal([-4712, 1, 1, 0, 0, 0, 9.to_r/24],
- [d.year, d.mon, d.mday, d.hour, d.min, d.sec, d.offset])
-
-
- d = DateTime.civil(2001,2,3 + 1.to_r/2)
- assert_equal([2001, 2, 3, 12, 0, 0, 0],
- [d.year, d.mon, d.mday, d.hour, d.min, d.sec, d.offset])
- d = DateTime.civil(2001,2,3, 4 + 1.to_r/2)
- assert_equal([2001, 2, 3, 4, 30, 0, 0],
- [d.year, d.mon, d.mday, d.hour, d.min, d.sec, d.offset])
- d = DateTime.civil(2001,2,3, 4,5 + 1.to_r/2)
- assert_equal([2001, 2, 3, 4, 5, 30, 0],
- [d.year, d.mon, d.mday, d.hour, d.min, d.sec, d.offset])
- d = DateTime.civil(2001,2,3, 4,5,6 + 1.to_r/2)
- assert_equal([2001, 2, 3, 4, 5, 6, 0],
- [d.year, d.mon, d.mday, d.hour, d.min, d.sec, d.offset])
- assert_equal(1.to_r/2, d.sec_fraction)
- end
-
- def test_civil__neg
- d = Date.civil(-1,-1,-1)
- assert_equal([-1, 12, 31], [d.year, d.mon, d.mday])
-
- d = DateTime.civil(-1,-1,-1, -1,-1,-1, 0)
- assert_equal([-1, 12, 31, 23, 59, 59, 0],
- [d.year, d.mon, d.mday, d.hour, d.min, d.sec, d.offset])
- end
-
- def test_civil__ex
- assert_raise(ArgumentError) do
- Date.civil(2001,2,1.1)
- end
- assert_raise(ArgumentError) do
- Date.civil(2001,2,29)
- end
- assert_raise(ArgumentError) do
- DateTime.civil(2001,2,28, 23,59,60, 0)
- end
- assert_raise(ArgumentError) do
- DateTime.civil(2001,2,28, 24,59,59, 0)
- end
- end
-
- def test_civil__reform
- d = Date.jd(Date::ENGLAND, Date::ENGLAND)
- dt = DateTime.jd(Date::ENGLAND, 0,0,0,0, Date::ENGLAND)
- assert_equal([1752, 9, 14], [d.year, d.mon, d.mday])
- assert_equal([1752, 9, 14], [dt.year, dt.mon, dt.mday])
- d -= 1
- dt -= 1
- assert_equal([1752, 9, 2], [d.year, d.mon, d.mday])
- assert_equal([1752, 9, 2], [dt.year, dt.mon, dt.mday])
-
- d = Date.jd(Date::ITALY, Date::ITALY)
- dt = DateTime.jd(Date::ITALY, 0,0,0,0, Date::ITALY)
- assert_equal([1582, 10, 15], [d.year, d.mon, d.mday])
- assert_equal([1582, 10, 15], [dt.year, dt.mon, dt.mday])
- d -= 1
- dt -= 1
- assert_equal([1582, 10, 4], [d.year, d.mon, d.mday])
- assert_equal([1582, 10, 4], [dt.year, dt.mon, dt.mday])
- end
-
- def test_commercial
- d = Date.commercial
- dt = DateTime.commercial
- assert_equal([-4712, 1, 1], [d.year, d.mon, d.mday])
- assert_equal([-4712, 1, 1], [dt.year, dt.mon, dt.mday])
- assert_equal([0, 0, 0], [dt.hour, dt.min, dt.sec])
-
- d2 = Date.commercial
- dt2 = DateTime.commercial
- assert_equal(d, d2)
- assert_equal(dt, dt2)
-
- d = Date.commercial(1582,40,5)
- assert_equal([1582, 10, 15], [d.year, d.mon, d.mday])
-
- d = Date.commercial(1582,40,5.0)
- assert_equal([1582, 10, 15], [d.year, d.mon, d.mday])
-
- d = DateTime.commercial(1582,40,5, 0,0,0, 0)
- assert_equal([1582, 10, 15, 0, 0, 0, 0],
- [d.year, d.mon, d.mday, d.hour, d.min, d.sec, d.offset])
- d = DateTime.commercial(1582,40,5, 0,0,0, '+0900')
- assert_equal([1582, 10, 15, 0, 0, 0, 9.to_r/24],
- [d.year, d.mon, d.mday, d.hour, d.min, d.sec, d.offset])
- end
-
- def test_commercial__neg
- d = Date.commercial(1998,-1,-1)
- assert_equal([1999, 1, 3], [d.year, d.mon, d.mday])
-
- d = DateTime.commercial(1998,-1,-1, -1,-1,-1, 0)
- assert_equal([1999, 1, 3, 23, 59, 59, 0],
- [d.year, d.mon, d.mday, d.hour, d.min, d.sec, d.offset])
- end
-
- def test_commercial__ex
- assert_raise(ArgumentError) do
- Date.commercial(1997,1,1.1)
- end
- assert_raise(ArgumentError) do
- Date.commercial(1997,53,1)
- end
- assert_raise(ArgumentError) do
- DateTime.commercial(1997,52,1, 23,59,60, 0)
- end
- end
-
- def test_weeknum
- d = Date.__send__(:weeknum)
- dt = DateTime.__send__(:weeknum)
- assert_equal([-4712, 1, 1], [d.year, d.mon, d.mday])
- assert_equal([-4712, 1, 1], [dt.year, dt.mon, dt.mday])
- assert_equal([0, 0, 0], [dt.hour, dt.min, dt.sec])
-
- d = Date.__send__(:weeknum, 2002,11,4, 0)
- assert_equal(2452355, d.jd)
-
- d = DateTime.__send__(:weeknum, 2002,11,4, 0, 11,22,33)
- assert_equal(2452355, d.jd)
- assert_equal([11,22,33], [d.hour, d.min, d.sec])
-
- assert_raise(ArgumentError) do
- Date.__send__(:weeknum, 1999,53,0, 0)
- end
- assert_raise(ArgumentError) do
- Date.__send__(:weeknum, 1999,-53,-1, 0)
- end
- end
-
- def test_nth_kday
- d = Date.__send__(:nth_kday)
- dt = DateTime.__send__(:nth_kday)
- assert_equal([-4712, 1, 1], [d.year, d.mon, d.mday])
- assert_equal([-4712, 1, 1], [dt.year, dt.mon, dt.mday])
- assert_equal([0, 0, 0], [dt.hour, dt.min, dt.sec])
-
- d = Date.__send__(:nth_kday, 1992,2, 5,6)
- assert_equal(2448682, d.jd)
-
- d = DateTime.__send__(:nth_kday, 1992,2, 5,6, 11,22,33)
- assert_equal(2448682, d.jd)
- assert_equal([11,22,33], [d.hour, d.min, d.sec])
-
- assert_raise(ArgumentError) do
- Date.__send__(:nth_kday, 2006,5, 5,0)
- end
- assert_raise(ArgumentError) do
- Date.__send__(:nth_kday, 2006,5, -5,0)
- end
- end
-
- def test_today
- z = Time.now
- d = Date.today
- t = Time.now
- t2 = Time.utc(t.year, t.mon, t.mday)
- t3 = Time.utc(d.year, d.mon, d.mday)
- assert_in_delta(t2, t3, t - z + 2)
-
- assert_equal(false, DateTime.respond_to?(:today))
- end
-
- def test_now
- assert_equal(false, Date.respond_to?(:now))
-
- z = Time.now
- d = DateTime.now
- t = Time.now
- t2 = Time.local(d.year, d.mon, d.mday, d.hour, d.min, d.sec)
- assert_in_delta(t, t2, t - z + 2)
- end
-
-end
diff --git a/test/date/test_date_parse.rb b/test/date/test_date_parse.rb
deleted file mode 100644
index 959a6e5d95..0000000000
--- a/test/date/test_date_parse.rb
+++ /dev/null
@@ -1,973 +0,0 @@
-require 'test/unit'
-require 'date'
-
-class TestDateParse < Test::Unit::TestCase
-
- def test__parse
- [
- # ctime(3), asctime(3)
- [['Sat Aug 28 02:55:50 1999',false],[1999,8,28,2,55,50,nil,nil,6]],
- [['Sat Aug 28 02:55:50 02',false],[2,8,28,2,55,50,nil,nil,6]],
- [['Sat Aug 28 02:55:50 02',true],[2002,8,28,2,55,50,nil,nil,6]],
- [['Sat Aug 28 02:55:50 0002',false],[2,8,28,2,55,50,nil,nil,6]],
- [['Sat Aug 28 02:55:50 0002',true],[2,8,28,2,55,50,nil,nil,6]],
-
- # date(1)
- [['Sat Aug 28 02:29:34 JST 1999',false],[1999,8,28,2,29,34,'JST',9*3600,6]],
- [['Sat Aug 28 02:29:34 MET DST 1999',false],[1999,8,28,2,29,34,'MET DST',2*3600,6]],
- [['Sat Aug 28 02:29:34 AMT 1999',false],[1999,8,28,2,29,34,'AMT',nil,6]],
- [['Sat Aug 28 02:29:34 PMT 1999',false],[1999,8,28,2,29,34,'PMT',nil,6]],
- [['Sat Aug 28 02:29:34 PMT -1999',false],[-1999,8,28,2,29,34,'PMT',nil,6]],
-
- [['Sat Aug 28 02:29:34 JST 02',false],[2,8,28,2,29,34,'JST',9*3600,6]],
- [['Sat Aug 28 02:29:34 JST 02',true],[2002,8,28,2,29,34,'JST',9*3600,6]],
- [['Sat Aug 28 02:29:34 JST 0002',false],[2,8,28,2,29,34,'JST',9*3600,6]],
- [['Sat Aug 28 02:29:34 JST 0002',true],[2,8,28,2,29,34,'JST',9*3600,6]],
-
- [['Sat Aug 28 02:29:34 GMT+09 0002',false],[2,8,28,2,29,34,'GMT+09',9*3600,6]],
- [['Sat Aug 28 02:29:34 GMT+0900 0002',false],[2,8,28,2,29,34,'GMT+0900',9*3600,6]],
- [['Sat Aug 28 02:29:34 GMT+09:00 0002',false],[2,8,28,2,29,34,'GMT+09:00',9*3600,6]],
- [['Sat Aug 28 02:29:34 GMT-09 0002',false],[2,8,28,2,29,34,'GMT-09',-9*3600,6]],
- [['Sat Aug 28 02:29:34 GMT-0900 0002',false],[2,8,28,2,29,34,'GMT-0900',-9*3600,6]],
- [['Sat Aug 28 02:29:34 GMT-09:00 0002',false],[2,8,28,2,29,34,'GMT-09:00',-9*3600,6]],
- [['Sat Aug 28 02:29:34 GMT-090102 0002',false],[2,8,28,2,29,34,'GMT-090102',-9*3600-60-2,6]],
- [['Sat Aug 28 02:29:34 GMT-09:01:02 0002',false],[2,8,28,2,29,34,'GMT-09:01:02',-9*3600-60-2,6]],
-
- [['Sat Aug 28 02:29:34 GMT Standard Time 2000',false],[2000,8,28,2,29,34,'GMT Standard Time',0*3600,6]],
- [['Sat Aug 28 02:29:34 Mountain Standard Time 2000',false],[2000,8,28,2,29,34,'Mountain Standard Time',-7*3600,6]],
- [['Sat Aug 28 02:29:34 Mountain Daylight Time 2000',false],[2000,8,28,2,29,34,'Mountain Daylight Time',-6*3600,6]],
- [['Sat Aug 28 02:29:34 Mexico Standard Time 2000',false],[2000,8,28,2,29,34,'Mexico Standard Time',-6*3600,6]],
-# [['Sat Aug 28 02:29:34 Mexico Standard Time 2 2000',false],[2000,8,28,2,29,34,'Mexico Standard Time 2',-7*3600,6]], # cp
- [['Sat Aug 28 02:29:34 E. Australia Standard Time 2000',false],[2000,8,28,2,29,34,'E. Australia Standard Time',10*3600,6]],
-
- # part of iso 8601
- [['1999-05-23 23:55:21',false],[1999,5,23,23,55,21,nil,nil,nil]],
- [['1999-05-23 23:55:21+0900',false],[1999,5,23,23,55,21,'+0900',9*3600,nil]],
- [['1999-05-23 23:55:21-0900',false],[1999,5,23,23,55,21,'-0900',-9*3600,nil]],
- [['1999-05-23 23:55:21+09:00',false],[1999,5,23,23,55,21,'+09:00',9*3600,nil]],
- [['1999-05-23T23:55:21-09:00',false],[1999,5,23,23,55,21,'-09:00',-9*3600,nil]],
- [['1999-05-23 23:55:21Z',false],[1999,5,23,23,55,21,'Z',0,nil]],
- [['1999-05-23T23:55:21Z',false],[1999,5,23,23,55,21,'Z',0,nil]],
- [['-1999-05-23T23:55:21Z',false],[-1999,5,23,23,55,21,'Z',0,nil]],
- [['-1999-05-23T23:55:21Z',true],[-1999,5,23,23,55,21,'Z',0,nil]],
- [['19990523T23:55:21Z',false],[1999,5,23,23,55,21,'Z',0,nil]],
-
- [['+011985-04-12',false],[11985,4,12,nil,nil,nil,nil,nil,nil]],
- [['+011985-04-12T10:15:30',false],[11985,4,12,10,15,30,nil,nil,nil]],
- [['-011985-04-12',false],[-11985,4,12,nil,nil,nil,nil,nil,nil]],
- [['-011985-04-12T10:15:30',false],[-11985,4,12,10,15,30,nil,nil,nil]],
-
- [['02-04-12',false],[2,4,12,nil,nil,nil,nil,nil,nil]],
- [['02-04-12',true],[2002,4,12,nil,nil,nil,nil,nil,nil]],
- [['0002-04-12',false],[2,4,12,nil,nil,nil,nil,nil,nil]],
- [['0002-04-12',true],[2,4,12,nil,nil,nil,nil,nil,nil]],
-
- [['19990523',true],[1999,5,23,nil,nil,nil,nil,nil,nil]],
- [['-19990523',true],[-1999,5,23,nil,nil,nil,nil,nil,nil]],
- [['990523',true],[1999,5,23,nil,nil,nil,nil,nil,nil]],
- [['0523',false],[nil,5,23,nil,nil,nil,nil,nil,nil]],
- [['23',false],[nil,nil,23,nil,nil,nil,nil,nil,nil]],
-
- [['19990523 235521',true],[1999,5,23,23,55,21,nil,nil,nil]],
- [['990523 235521',true],[1999,5,23,23,55,21,nil,nil,nil]],
- [['0523 2355',false],[nil,5,23,23,55,nil,nil,nil,nil]],
- [['23 2355',false],[nil,nil,23,23,55,nil,nil,nil,nil]],
-
- [['19990523T235521',true],[1999,5,23,23,55,21,nil,nil,nil]],
- [['990523T235521',true],[1999,5,23,23,55,21,nil,nil,nil]],
- [['19990523T235521.99',true],[1999,5,23,23,55,21,nil,nil,nil]],
- [['990523T235521.99',true],[1999,5,23,23,55,21,nil,nil,nil]],
- [['0523T2355',false],[nil,5,23,23,55,nil,nil,nil,nil]],
-
- [['19990523T235521+0900',true],[1999,5,23,23,55,21,'+0900',9*3600,nil]],
- [['990523T235521-0900',true],[1999,5,23,23,55,21,'-0900',-9*3600,nil]],
- [['19990523T235521.99+0900',true],[1999,5,23,23,55,21,'+0900',9*3600,nil]],
- [['990523T235521.99-0900',true],[1999,5,23,23,55,21,'-0900',-9*3600,nil]],
- [['0523T2355Z',false],[nil,5,23,23,55,nil,'Z',0,nil]],
-
- [['19990523235521.123456+0900',true],[1999,5,23,23,55,21,'+0900',9*3600,nil]],
- [['19990523235521.123456-0900',true],[1999,5,23,23,55,21,'-0900',-9*3600,nil]],
- [['19990523235521,123456+0900',true],[1999,5,23,23,55,21,'+0900',9*3600,nil]],
- [['19990523235521,123456-0900',true],[1999,5,23,23,55,21,'-0900',-9*3600,nil]],
-
- [['990523235521,123456-0900',false],[99,5,23,23,55,21,'-0900',-9*3600,nil]],
- [['0523235521,123456-0900',false],[nil,5,23,23,55,21,'-0900',-9*3600,nil]],
- [['23235521,123456-0900',false],[nil,nil,23,23,55,21,'-0900',-9*3600,nil]],
- [['235521,123456-0900',false],[nil,nil,nil,23,55,21,'-0900',-9*3600,nil]],
- [['5521,123456-0900',false],[nil,nil,nil,nil,55,21,'-0900',-9*3600,nil]],
- [['21,123456-0900',false],[nil,nil,nil,nil,nil,21,'-0900',-9*3600,nil]],
-
- [['3235521,123456-0900',false],[nil,nil,3,23,55,21,'-0900',-9*3600,nil]],
- [['35521,123456-0900',false],[nil,nil,nil,3,55,21,'-0900',-9*3600,nil]],
- [['521,123456-0900',false],[nil,nil,nil,nil,5,21,'-0900',-9*3600,nil]],
-
- # reversed iso 8601 (?)
- [['23-05-1999',false],[1999,5,23,nil,nil,nil,nil,nil,nil]],
- [['23-05-1999 23:55:21',false],[1999,5,23,23,55,21,nil,nil,nil]],
- [['23-05--1999 23:55:21',false],[-1999,5,23,23,55,21,nil,nil,nil]],
- [["23-05-'99",false],[99,5,23,nil,nil,nil,nil,nil,nil]],
- [["23-05-'99",true],[1999,5,23,nil,nil,nil,nil,nil,nil]],
-
- # broken iso 8601 (?)
-# [['1999-05-23T235521Z',false],[1999,5,23,23,55,21,'Z',0,nil]], # cp
- [['19990523T23:55:21Z',false],[1999,5,23,23,55,21,'Z',0,nil]],
- [['19990523235521.1234-100',true],[1999,5,23,23,55,21,'-100',-1*3600,nil]],
- [['19990523235521.1234-10',true],[1999,5,23,23,55,21,'-10',-10*3600,nil]],
-
- # part of jis x0301
- [['M11.05.23',false],[1878,5,23,nil,nil,nil,nil,nil,nil]],
- [['T11.05.23 23:55:21+0900',false],[1922,5,23,23,55,21,'+0900',9*3600,nil]],
- [['S11.05.23 23:55:21-0900',false],[1936,5,23,23,55,21,'-0900',-9*3600,nil]],
- [['S40.05.23 23:55:21+09:00',false],[1965,5,23,23,55,21,'+09:00',9*3600,nil]],
- [['S40.05.23T23:55:21-09:00',false],[1965,5,23,23,55,21,'-09:00',-9*3600,nil]],
- [['H11.05.23 23:55:21Z',false],[1999,5,23,23,55,21,'Z',0,nil]],
- [['H11.05.23T23:55:21Z',false],[1999,5,23,23,55,21,'Z',0,nil]],
-
- # ofx date
- [['19990523235521',false],[1999,5,23,23,55,21,nil,nil,nil]],
- [['19990523235521.123',false],[1999,5,23,23,55,21,nil,nil,nil]],
- [['19990523235521.123[-9]',false],[1999,5,23,23,55,21,'-9',-(9*3600),nil]],
- [['19990523235521.123[+9]',false],[1999,5,23,23,55,21,'+9',+(9*3600),nil]],
- [['19990523235521.123[9]',false],[1999,5,23,23,55,21,'9',+(9*3600),nil]],
- [['19990523235521.123[-9.50]',false],[1999,5,23,23,55,21,'-9.50',-(9*3600+30*60),nil]],
- [['19990523235521.123[+9.50]',false],[1999,5,23,23,55,21,'+9.50',+(9*3600+30*60),nil]],
- [['19990523235521.123[-5:EST]',false],[1999,5,23,23,55,21,'EST',-5*3600,nil]],
- [['19990523235521.123[+9:JST]',false],[1999,5,23,23,55,21,'JST',9*3600,nil]],
- [['19990523235521.123[+12:XXX YYY ZZZ]',false],[1999,5,23,23,55,21,'XXX YYY ZZZ',12*3600,nil]],
-# [['235521',false],[nil,nil,nil,23,55,21,nil,nil,nil]], # cp
- [['235521.123',false],[nil,nil,nil,23,55,21,nil,nil,nil]],
- [['235521.123[-9]',false],[nil,nil,nil,23,55,21,'-9',-9*3600,nil]],
- [['235521.123[+9]',false],[nil,nil,nil,23,55,21,'+9',+9*3600,nil]],
- [['235521.123[-5:EST]',false],[nil,nil,nil,23,55,21,'EST',-5*3600,nil]],
- [['235521.123[+9:JST]',false],[nil,nil,nil,23,55,21,'JST',+9*3600,nil]],
-
- # rfc 2822
- [['Sun, 22 Aug 1999 00:45:29 -0400',false],[1999,8,22,0,45,29,'-0400',-4*3600,0]],
- [['Sun, 22 Aug 1999 00:45:29 -9959',false],[1999,8,22,0,45,29,'-9959',-(99*3600+59*60),0]],
- [['Sun, 22 Aug 1999 00:45:29 +9959',false],[1999,8,22,0,45,29,'+9959',+(99*3600+59*60),0]],
- [['Sun, 22 Aug 05 00:45:29 -0400',true],[2005,8,22,0,45,29,'-0400',-4*3600,0]],
- [['Sun, 22 Aug 49 00:45:29 -0400',true],[2049,8,22,0,45,29,'-0400',-4*3600,0]],
-# [['Sun, 22 Aug 50 00:45:29 -0400',true],[1950,8,22,0,45,29,'-0400',-4*3600,0]],
-# [['Sun, 22 Aug 111 00:45:29 -0400',true],[2011,8,22,0,45,29,'-0400',-4*3600,0]],
- [['Sun, 22 Aug 1999 00:45:29 GMT',false],[1999,8,22,0,45,29,'GMT',0,0]],
- [["Sun,\00022\r\nAug\r\n1999\r\n00:45:29\r\nGMT",false],[1999,8,22,0,45,29,'GMT',0,0]],
- [['Sun, 22 Aug 1999 00:45 GMT',false],[1999,8,22,0,45,nil,'GMT',0,0]],
- [['Sun, 22 Aug -1999 00:45 GMT',false],[-1999,8,22,0,45,nil,'GMT',0,0]],
- [['Sun, 22 Aug 99 00:45:29 UT',true],[1999,8,22,0,45,29,'UT',0,0]],
- [['Sun, 22 Aug 0099 00:45:29 UT',true],[99,8,22,0,45,29,'UT',0,0]],
-
- # rfc 850, obsoleted by rfc 1036
- [['Tuesday, 02-Mar-99 11:20:32 GMT',true],[1999,3,2,11,20,32,'GMT',0,2]],
-
- # W3C Working Draft - XForms - 4.8 Time
- [['2000-01-31 13:20:00-5',false],[2000,1,31,13,20,0,'-5',-5*3600,nil]],
-
- # [-+]\d+.\d+
- [['2000-01-31 13:20:00-5.5',false],[2000,1,31,13,20,0,'-5.5',-5*3600-30*60,nil]],
- [['2000-01-31 13:20:00-5,5',false],[2000,1,31,13,20,0,'-5,5',-5*3600-30*60,nil]],
- [['2000-01-31 13:20:00+3.5',false],[2000,1,31,13,20,0,'+3.5',3*3600+30*60,nil]],
- [['2000-01-31 13:20:00+3,5',false],[2000,1,31,13,20,0,'+3,5',3*3600+30*60,nil]],
-
- # mil
- [['2000-01-31 13:20:00 Z',false],[2000,1,31,13,20,0,'Z',0*3600,nil]],
- [['2000-01-31 13:20:00 H',false],[2000,1,31,13,20,0,'H',8*3600,nil]],
- [['2000-01-31 13:20:00 M',false],[2000,1,31,13,20,0,'M',12*3600,nil]],
- [['2000-01-31 13:20 M',false],[2000,1,31,13,20,nil,'M',12*3600,nil]],
- [['2000-01-31 13:20:00 S',false],[2000,1,31,13,20,0,'S',-6*3600,nil]],
- [['2000-01-31 13:20:00 A',false],[2000,1,31,13,20,0,'A',1*3600,nil]],
- [['2000-01-31 13:20:00 P',false],[2000,1,31,13,20,0,'P',-3*3600,nil]],
-
- # dot
- [['1999.5.2',false],[1999,5,2,nil,nil,nil,nil,nil,nil]],
- [['1999.05.02',false],[1999,5,2,nil,nil,nil,nil,nil,nil]],
- [['-1999.05.02',false],[-1999,5,2,nil,nil,nil,nil,nil,nil]],
-# [['05.02',false],[nil,5,2,nil,nil,nil,nil,nil,nil]], # not support
-# [[' 5. 2',false],[nil,5,2,nil,nil,nil,nil,nil,nil]], # not support
-
- [['0099.5.2',false],[99,5,2,nil,nil,nil,nil,nil,nil]],
- [['0099.5.2',true],[99,5,2,nil,nil,nil,nil,nil,nil]],
-
- [["'99.5.2",false],[99,5,2,nil,nil,nil,nil,nil,nil]],
- [["'99.5.2",true],[1999,5,2,nil,nil,nil,nil,nil,nil]],
-
- # reversed dot
- [['2.5.1999',false],[1999,5,2,nil,nil,nil,nil,nil,nil]],
- [['02.05.1999',false],[1999,5,2,nil,nil,nil,nil,nil,nil]],
- [['02.05.-1999',false],[-1999,5,2,nil,nil,nil,nil,nil,nil]],
-
- [['2.5.0099',false],[99,5,2,nil,nil,nil,nil,nil,nil]],
- [['2.5.0099',true],[99,5,2,nil,nil,nil,nil,nil,nil]],
-
- [["2.5.'99",false],[99,5,2,nil,nil,nil,nil,nil,nil]],
- [["2.5.'99",true],[1999,5,2,nil,nil,nil,nil,nil,nil]],
-
- # vms
- [['08-DEC-1988',false],[1988,12,8,nil,nil,nil,nil,nil,nil]],
- [['31-JAN-1999',false],[1999,1,31,nil,nil,nil,nil,nil,nil]],
- [['31-JAN--1999',false],[-1999,1,31,nil,nil,nil,nil,nil,nil]],
-
- [['08-DEC-88',false],[88,12,8,nil,nil,nil,nil,nil,nil]],
- [['08-DEC-88',true],[1988,12,8,nil,nil,nil,nil,nil,nil]],
- [['08-DEC-0088',false],[88,12,8,nil,nil,nil,nil,nil,nil]],
- [['08-DEC-0088',true],[88,12,8,nil,nil,nil,nil,nil,nil]],
-
- # swaped vms
- [['DEC-08-1988',false],[1988,12,8,nil,nil,nil,nil,nil,nil]],
- [['JAN-31-1999',false],[1999,1,31,nil,nil,nil,nil,nil,nil]],
- [['JAN-31--1999',false],[-1999,1,31,nil,nil,nil,nil,nil,nil]],
- [['JAN-1999',false],[1999,1,nil,nil,nil,nil,nil,nil,nil]],
- [['JAN--1999',false],[-1999,1,nil,nil,nil,nil,nil,nil,nil]],
-
- # reversed vms
- [['1988-DEC-08',false],[1988,12,8,nil,nil,nil,nil,nil,nil]],
- [['1999-JAN-31',false],[1999,1,31,nil,nil,nil,nil,nil,nil]],
- [['-1999-JAN-31',false],[-1999,1,31,nil,nil,nil,nil,nil,nil]],
-
- [['0088-DEC-08',false],[88,12,8,nil,nil,nil,nil,nil,nil]],
- [['0088-DEC-08',true],[88,12,8,nil,nil,nil,nil,nil,nil]],
-
- [["'88/12/8",false],[88,12,8,nil,nil,nil,nil,nil,nil]],
- [["'88/12/8",true],[1988,12,8,nil,nil,nil,nil,nil,nil]],
-
- # non-spaced eu
- [['08/dec/1988',false],[1988,12,8,nil,nil,nil,nil,nil,nil]],
- [['31/jan/1999',false],[1999,1,31,nil,nil,nil,nil,nil,nil]],
- [['31/jan/-1999',false],[-1999,1,31,nil,nil,nil,nil,nil,nil]],
- [['08.dec.1988',false],[1988,12,8,nil,nil,nil,nil,nil,nil]],
- [['31.jan.1999',false],[1999,1,31,nil,nil,nil,nil,nil,nil]],
- [['31.jan.-1999',false],[-1999,1,31,nil,nil,nil,nil,nil,nil]],
-
- # non-spaced us
- [['dec/08/1988',false],[1988,12,8,nil,nil,nil,nil,nil,nil]],
- [['jan/31/1999',false],[1999,1,31,nil,nil,nil,nil,nil,nil]],
- [['jan/31/-1999',false],[-1999,1,31,nil,nil,nil,nil,nil,nil]],
- [['jan/31',false],[nil,1,31,nil,nil,nil,nil,nil,nil]],
- [['jan/1988',false],[1988,1,nil,nil,nil,nil,nil,nil,nil]],
- [['dec.08.1988',false],[1988,12,8,nil,nil,nil,nil,nil,nil]],
- [['jan.31.1999',false],[1999,1,31,nil,nil,nil,nil,nil,nil]],
- [['jan.31.-1999',false],[-1999,1,31,nil,nil,nil,nil,nil,nil]],
- [['jan.31',false],[nil,1,31,nil,nil,nil,nil,nil,nil]],
- [['jan.1988',false],[1988,1,nil,nil,nil,nil,nil,nil,nil]],
-
- # month and day of month
- [['Jan 1',false],[nil,1,1,nil,nil,nil,nil,nil,nil]],
- [['Jul 11',false],[nil,7,11,nil,nil,nil,nil,nil,nil]],
- [['July 11',false],[nil,7,11,nil,nil,nil,nil,nil,nil]],
- [['Sept 23',false],[nil,9,23,nil,nil,nil,nil,nil,nil]],
- [['Sep. 23',false],[nil,9,23,nil,nil,nil,nil,nil,nil]],
- [['Sept. 23',false],[nil,9,23,nil,nil,nil,nil,nil,nil]],
- [['September 23',false],[nil,9,23,nil,nil,nil,nil,nil,nil]],
- [['October 1st',false],[nil,10,1,nil,nil,nil,nil,nil,nil]],
- [['October 23rd',false],[nil,10,23,nil,nil,nil,nil,nil,nil]],
- [['October 25th 1999',false],[1999,10,25,nil,nil,nil,nil,nil,nil]],
- [['October 25th -1999',false],[-1999,10,25,nil,nil,nil,nil,nil,nil]],
- [['october 25th 1999',false],[1999,10,25,nil,nil,nil,nil,nil,nil]],
- [['OCTOBER 25th 1999',false],[1999,10,25,nil,nil,nil,nil,nil,nil]],
- [['oCtoBer 25th 1999',false],[1999,10,25,nil,nil,nil,nil,nil,nil]],
- [['aSep 23',false],[nil,nil,23,nil,nil,nil,nil,nil,nil]],
-
- # month and year
- [['Sept 1990',false],[1990,9,nil,nil,nil,nil,nil,nil,nil]],
- [["Sept '90",false],[90,9,nil,nil,nil,nil,nil,nil,nil]],
- [["Sept '90",true],[1990,9,nil,nil,nil,nil,nil,nil,nil]],
- [['1990/09',false],[1990,9,nil,nil,nil,nil,nil,nil,nil]],
- [['09/1990',false],[1990,9,nil,nil,nil,nil,nil,nil,nil]],
- [["aSep '90",false],[90,nil,nil,nil,nil,nil,nil,nil,nil]],
-
- # year
- [["'90",false],[90,nil,nil,nil,nil,nil,nil,nil,nil]],
- [["'90",true],[1990,nil,nil,nil,nil,nil,nil,nil,nil]],
-
- # month
- [['Jun',false],[nil,6,nil,nil,nil,nil,nil,nil,nil]],
- [['June',false],[nil,6,nil,nil,nil,nil,nil,nil,nil]],
- [['Sep',false],[nil,9,nil,nil,nil,nil,nil,nil,nil]],
- [['Sept',false],[nil,9,nil,nil,nil,nil,nil,nil,nil]],
- [['September',false],[nil,9,nil,nil,nil,nil,nil,nil,nil]],
- [['aSep',false],[nil,nil,nil,nil,nil,nil,nil,nil,nil]],
-
- # day of month
- [['1st',false],[nil,nil,1,nil,nil,nil,nil,nil,nil]],
- [['2nd',false],[nil,nil,2,nil,nil,nil,nil,nil,nil]],
- [['3rd',false],[nil,nil,3,nil,nil,nil,nil,nil,nil]],
- [['4th',false],[nil,nil,4,nil,nil,nil,nil,nil,nil]],
- [['29th',false],[nil,nil,29,nil,nil,nil,nil,nil,nil]],
- [['31st',false],[nil,nil,31,nil,nil,nil,nil,nil,nil]],
- [['1sta',false],[nil,nil,nil,nil,nil,nil,nil,nil,nil]],
-
- # era
- [['Sat Aug 28 02:29:34 GMT CE 2000',false],[2000,8,28,2,29,34,'GMT',0,6]],
- [['Sat Aug 28 02:29:34 GMT C.E. 2000',false],[2000,8,28,2,29,34,'GMT',0,6]],
- [['Sat Aug 28 02:29:34 GMT BCE 2000',false],[-1999,8,28,2,29,34,'GMT',0,6]],
- [['Sat Aug 28 02:29:34 GMT B.C.E. 2000',false],[-1999,8,28,2,29,34,'GMT',0,6]],
- [['Sat Aug 28 02:29:34 GMT AD 2000',false],[2000,8,28,2,29,34,'GMT',0,6]],
- [['Sat Aug 28 02:29:34 GMT A.D. 2000',false],[2000,8,28,2,29,34,'GMT',0,6]],
- [['Sat Aug 28 02:29:34 GMT BC 2000',false],[-1999,8,28,2,29,34,'GMT',0,6]],
- [['Sat Aug 28 02:29:34 GMT B.C. 2000',false],[-1999,8,28,2,29,34,'GMT',0,6]],
- [['Sat Aug 28 02:29:34 GMT 2000 BC',false],[-1999,8,28,2,29,34,'GMT',0,6]],
- [['Sat Aug 28 02:29:34 GMT 2000 BCE',false],[-1999,8,28,2,29,34,'GMT',0,6]],
- [['Sat Aug 28 02:29:34 GMT 2000 B.C.',false],[-1999,8,28,2,29,34,'GMT',0,6]],
- [['Sat Aug 28 02:29:34 GMT 2000 B.C.E.',false],[-1999,8,28,2,29,34,'GMT',0,6]],
-
- # collection
-# [['le ler juillet 1982',false],[1982,7,1,nil,nil,nil,nil,nil,nil]], # bih 1982
-# [['30 June 1982 , 23h 59m 59s',false],[1982,6,30,23,59,59,nil,nil,nil]], # bih 1982
- [['Tuesday, May 18, 1999 Published at 13:36 GMT 14:36 UK',false],[1999,5,18,13,36,nil,'GMT',0,2]], # bbc.co.uk
- [['July 20, 2000 Web posted at: 3:37 p.m. EDT (1937 GMT)',false],[2000,7,20,15,37,nil,'EDT',-4*3600,nil]], # cnn.com
- [['12:54 p.m. EDT, September 11, 2006',false],[2006,9,11,12,54,nil,'EDT',-4*3600,nil]], # cnn.com
- [['February 04, 2001 at 10:59 AM PST',false],[2001,2,4,10,59,nil,'PST',-8*3600,nil]], # old amazon.com
- [['Monday May 08, @01:55PM',false],[nil,5,8,13,55,nil,nil,nil,1]], # slashdot.org
- [['06.June 2005',false],[2005,6,6,nil,nil,nil,nil,nil,nil]], # dhl.com
-
- # etc.
- [['8:00 pm lt',false],[nil,nil,nil,20,0,nil,'lt',nil,nil]],
- [['4:00 AM, Jan. 12, 1990',false],[1990,1,12,4,0,nil,nil,nil,nil]],
- [['Jan. 12 4:00 AM 1990',false],[1990,1,12,4,0,nil,nil,nil,nil]],
-# [['Jan. 12 4:00 -1990',false],[-1990,1,12,4,0,nil,nil,nil,nil]], # cp
- [['1990-01-12 04:00:00+00',false],[1990,1,12,4,0,0,'+00',0,nil]],
- [['1990-01-11 20:00:00-08',false],[1990,1,11,20,0,0,'-08',-8*3600,nil]],
- [['1990/01/12 04:00:00',false],[1990,1,12,4,0,0,nil,nil,nil]],
-# [['Thu Jan 11 20:00:00 1990 LT',false], [1990,1,11,20,0,0,'LT',nil,4]], # cp
- [['Thu Jan 11 20:00:00 PST 1990',false],[1990,1,11,20,0,0,'PST',-8*3600,4]],
- [['Fri Jan 12 04:00:00 GMT 1990',false],[1990,1,12,4,0,0,'GMT',0,5]],
- [['Thu, 11 Jan 1990 20:00:00 -0800',false],[1990,1,11,20,0,0,'-0800',-8*3600,4]],
- [['12-January-1990, 04:00 WET',false],[1990,1,12,4,0,nil,'WET',0*3600,nil]],
- [['jan 2 3 am +4 5',false],[5,1,2,3,nil,nil,'+4',4*3600,nil]],
- [['jan 2 3 am +4 5',true],[2005,1,2,3,nil,nil,'+4',4*3600,nil]],
- [['fri1feb3bc4pm+5',false],[-2,2,1,16,nil,nil,'+5',5*3600,5]],
- [['fri1feb3bc4pm+5',true],[-2,2,1,16,nil,nil,'+5',5*3600,5]],
- [['03 feb 1st',false],[03,2,1,nil,nil,nil,nil,nil,nil]],
-
- # apostrophe
- [["July 4, '79",true],[1979,7,4,nil,nil,nil,nil,nil,nil]],
- [["4th July '79",true],[1979,7,4,nil,nil,nil,nil,nil,nil]],
-
- # day of week
- [['Sunday',false],[nil,nil,nil,nil,nil,nil,nil,nil,0]],
- [['Mon',false],[nil,nil,nil,nil,nil,nil,nil,nil,1]],
- [['Tue',false],[nil,nil,nil,nil,nil,nil,nil,nil,2]],
- [['Wed',false],[nil,nil,nil,nil,nil,nil,nil,nil,3]],
- [['Thurs',false],[nil,nil,nil,nil,nil,nil,nil,nil,4]],
- [['Friday',false],[nil,nil,nil,nil,nil,nil,nil,nil,5]],
- [['Sat.',false],[nil,nil,nil,nil,nil,nil,nil,nil,6]],
- [['sat.',false],[nil,nil,nil,nil,nil,nil,nil,nil,6]],
- [['SAT.',false],[nil,nil,nil,nil,nil,nil,nil,nil,6]],
- [['sAt.',false],[nil,nil,nil,nil,nil,nil,nil,nil,6]],
-# [['su',false],[nil,nil,nil,nil,nil,nil,nil,nil,0]],
-# [['mo',false],[nil,nil,nil,nil,nil,nil,nil,nil,1]],
-
- # time
- [['09:55',false],[nil,nil,nil,9,55,nil,nil,nil,nil]],
- [['09:55:30',false],[nil,nil,nil,9,55,30,nil,nil,nil]],
- [['09:55:30am',false],[nil,nil,nil,9,55,30,nil,nil,nil]],
- [['09:55:30pm',false],[nil,nil,nil,21,55,30,nil,nil,nil]],
- [['09:55:30a.m.',false],[nil,nil,nil,9,55,30,nil,nil,nil]],
- [['09:55:30p.m.',false],[nil,nil,nil,21,55,30,nil,nil,nil]],
- [['09:55:30pm GMT',false],[nil,nil,nil,21,55,30,'GMT',0,nil]],
- [['09:55:30p.m. GMT',false],[nil,nil,nil,21,55,30,'GMT',0,nil]],
- [['09:55+0900',false],[nil,nil,nil,9,55,nil,'+0900',9*3600,nil]],
- [['09 AM',false],[nil,nil,nil,9,nil,nil,nil,nil,nil]],
- [['09am',false],[nil,nil,nil,9,nil,nil,nil,nil,nil]],
- [['09 A.M.',false],[nil,nil,nil,9,nil,nil,nil,nil,nil]],
- [['09 PM',false],[nil,nil,nil,21,nil,nil,nil,nil,nil]],
- [['09pm',false],[nil,nil,nil,21,nil,nil,nil,nil,nil]],
- [['09 P.M.',false],[nil,nil,nil,21,nil,nil,nil,nil,nil]],
-
- [['9h22m23s',false],[nil,nil,nil,9,22,23,nil,nil,nil]],
- [['9h 22m 23s',false],[nil,nil,nil,9,22,23,nil,nil,nil]],
- [['9h22m',false],[nil,nil,nil,9,22,nil,nil,nil,nil]],
- [['9h 22m',false],[nil,nil,nil,9,22,nil,nil,nil,nil]],
- [['9h',false],[nil,nil,nil,9,nil,nil,nil,nil,nil]],
- [['9h 22m 23s am',false],[nil,nil,nil,9,22,23,nil,nil,nil]],
- [['9h 22m 23s pm',false],[nil,nil,nil,21,22,23,nil,nil,nil]],
- [['9h 22m am',false],[nil,nil,nil,9,22,nil,nil,nil,nil]],
- [['9h 22m pm',false],[nil,nil,nil,21,22,nil,nil,nil,nil]],
- [['9h am',false],[nil,nil,nil,9,nil,nil,nil,nil,nil]],
- [['9h pm',false],[nil,nil,nil,21,nil,nil,nil,nil,nil]],
-
- [['00:00',false],[nil,nil,nil,0,0,nil,nil,nil,nil]],
- [['01:00',false],[nil,nil,nil,1,0,nil,nil,nil,nil]],
- [['11:00',false],[nil,nil,nil,11,0,nil,nil,nil,nil]],
- [['12:00',false],[nil,nil,nil,12,0,nil,nil,nil,nil]],
- [['13:00',false],[nil,nil,nil,13,0,nil,nil,nil,nil]],
- [['23:00',false],[nil,nil,nil,23,0,nil,nil,nil,nil]],
- [['24:00',false],[nil,nil,nil,24,0,nil,nil,nil,nil]],
-
- [['00:00 AM',false],[nil,nil,nil,0,0,nil,nil,nil,nil]],
- [['12:00 AM',false],[nil,nil,nil,0,0,nil,nil,nil,nil]],
- [['01:00 AM',false],[nil,nil,nil,1,0,nil,nil,nil,nil]],
- [['11:00 AM',false],[nil,nil,nil,11,0,nil,nil,nil,nil]],
- [['00:00 PM',false],[nil,nil,nil,12,0,nil,nil,nil,nil]],
- [['12:00 PM',false],[nil,nil,nil,12,0,nil,nil,nil,nil]],
- [['01:00 PM',false],[nil,nil,nil,13,0,nil,nil,nil,nil]],
- [['11:00 PM',false],[nil,nil,nil,23,0,nil,nil,nil,nil]],
-
- # pick up the rest
- [['2000-01-02 1',false],[2000,1,2,1,nil,nil,nil,nil,nil]],
- [['2000-01-02 23',false],[2000,1,2,23,nil,nil,nil,nil,nil]],
- [['2000-01-02 24',false],[2000,1,2,24,nil,nil,nil,nil,nil]],
- [['1 03:04:05',false],[nil,nil,1,3,4,5,nil,nil,nil]],
- [['02 03:04:05',false],[nil,nil,2,3,4,5,nil,nil,nil]],
- [['31 03:04:05',false],[nil,nil,31,3,4,5,nil,nil,nil]],
-
- # null, space
- [['',false],[nil,nil,nil,nil,nil,nil,nil,nil,nil]],
- [["\s",false],[nil,nil,nil,nil,nil,nil,nil,nil,nil]],
- [["\s" * 10, true],[nil,nil,nil,nil,nil,nil,nil,nil,nil]],
- [["\t",false],[nil,nil,nil,nil,nil,nil,nil,nil,nil]],
- [["\n",false],[nil,nil,nil,nil,nil,nil,nil,nil,nil]],
- [["\v",false],[nil,nil,nil,nil,nil,nil,nil,nil,nil]],
- [["\f",false],[nil,nil,nil,nil,nil,nil,nil,nil,nil]],
- [["\r",false],[nil,nil,nil,nil,nil,nil,nil,nil,nil]],
- [["\t\n\v\f\r\s",false],[nil,nil,nil,nil,nil,nil,nil,nil,nil]],
- [["1999-05-23\t\n\v\f\r\s21:34:56",false],[1999,5,23,21,34,56,nil,nil,nil]],
- [["1999-05-23\n\n\n\n\n\n21:34:56",false],[1999,5,23,21,34,56,nil,nil,nil]],
- ].each do |x,y|
- h = Date._parse(*x)
- a = h.values_at(:year,:mon,:mday,:hour,:min,:sec,:zone,:offset,:wday)
- if y[1] == -1
- a[1] = -1
- a[2] = h[:yday]
- end
- assert_equal(y, a, [x, y, a].inspect)
- end
- end
-
- def test__parse_slash_exp
- [
- # little
- [['2/5/1999',false],[1999,5,2,nil,nil,nil,nil,nil,nil]],
- [['02/05/1999',false],[1999,5,2,nil,nil,nil,nil,nil,nil]],
- [['02/05/-1999',false],[-1999,5,2,nil,nil,nil,nil,nil,nil]],
- [['05/02',false],[nil,5,2,nil,nil,nil,nil,nil,nil]],
- [[' 5/ 2',false],[nil,5,2,nil,nil,nil,nil,nil,nil]],
-
- [["2/5/'99",true],[1999,5,2,nil,nil,nil,nil,nil,nil]],
- [['2/5/0099',false],[99,5,2,nil,nil,nil,nil,nil,nil]],
- [['2/5/0099',true],[99,5,2,nil,nil,nil,nil,nil,nil]],
-
- [['2/5 1999',false],[1999,5,2,nil,nil,nil,nil,nil,nil]],
- [['2/5-1999',false],[1999,5,2,nil,nil,nil,nil,nil,nil]],
- [['2/5--1999',false],[-1999,5,2,nil,nil,nil,nil,nil,nil]],
-
- # big
- [['99/5/2',false],[99,5,2,nil,nil,nil,nil,nil,nil]],
- [['99/5/2',true],[1999,5,2,nil,nil,nil,nil,nil,nil]],
-
- [['1999/5/2',false],[1999,5,2,nil,nil,nil,nil,nil,nil]],
- [['1999/05/02',false],[1999,5,2,nil,nil,nil,nil,nil,nil]],
- [['-1999/05/02',false],[-1999,5,2,nil,nil,nil,nil,nil,nil]],
-
- [['0099/5/2',false],[99,5,2,nil,nil,nil,nil,nil,nil]],
- [['0099/5/2',true],[99,5,2,nil,nil,nil,nil,nil,nil]],
-
- [["'99/5/2",false],[99,5,2,nil,nil,nil,nil,nil,nil]],
- [["'99/5/2",true],[1999,5,2,nil,nil,nil,nil,nil,nil]],
- ].each do |x,y|
- h = Date._parse(*x)
- a = h.values_at(:year,:mon,:mday,:hour,:min,:sec,:zone,:offset,:wday)
- if y[1] == -1
- a[1] = -1
- a[2] = h[:yday]
- end
- assert_equal(y, a, [x, y, a].inspect)
- end
- end
-
- def test__parse__2
- h = Date._parse('22:45:59.5')
- assert_equal([22, 45, 59, 5.to_r/10**1], h.values_at(:hour, :min, :sec, :sec_fraction))
- h = Date._parse('22:45:59.05')
- assert_equal([22, 45, 59, 5.to_r/10**2], h.values_at(:hour, :min, :sec, :sec_fraction))
- h = Date._parse('22:45:59.005')
- assert_equal([22, 45, 59, 5.to_r/10**3], h.values_at(:hour, :min, :sec, :sec_fraction))
- h = Date._parse('22:45:59.0123')
- assert_equal([22, 45, 59, 123.to_r/10**4], h.values_at(:hour, :min, :sec, :sec_fraction))
-
- h = Date._parse('224559.5')
- assert_equal([22, 45, 59, 5.to_r/10**1], h.values_at(:hour, :min, :sec, :sec_fraction))
- h = Date._parse('224559.05')
- assert_equal([22, 45, 59, 5.to_r/10**2], h.values_at(:hour, :min, :sec, :sec_fraction))
- h = Date._parse('224559.005')
- assert_equal([22, 45, 59, 5.to_r/10**3], h.values_at(:hour, :min, :sec, :sec_fraction))
- h = Date._parse('224559.0123')
- assert_equal([22, 45, 59, 123.to_r/10**4], h.values_at(:hour, :min, :sec, :sec_fraction))
-
- h = Date._parse('2006-w15-5')
- assert_equal([2006, 15, 5], h.values_at(:cwyear, :cweek, :cwday))
- h = Date._parse('2006w155')
- assert_equal([2006, 15, 5], h.values_at(:cwyear, :cweek, :cwday))
- h = Date._parse('06w155', false)
- assert_equal([6, 15, 5], h.values_at(:cwyear, :cweek, :cwday))
- h = Date._parse('06w155', true)
- assert_equal([2006, 15, 5], h.values_at(:cwyear, :cweek, :cwday))
-
- h = Date._parse('2006-w15')
- assert_equal([2006, 15, nil], h.values_at(:cwyear, :cweek, :cwday))
- h = Date._parse('2006w15')
- assert_equal([2006, 15, nil], h.values_at(:cwyear, :cweek, :cwday))
-
- h = Date._parse('-w15-5')
- assert_equal([nil, 15, 5], h.values_at(:cwyear, :cweek, :cwday))
- h = Date._parse('-w155')
- assert_equal([nil, 15, 5], h.values_at(:cwyear, :cweek, :cwday))
-
- h = Date._parse('-w15')
- assert_equal([nil, 15, nil], h.values_at(:cwyear, :cweek, :cwday))
- h = Date._parse('-w15')
- assert_equal([nil, 15, nil], h.values_at(:cwyear, :cweek, :cwday))
-
- h = Date._parse('-w-5')
- assert_equal([nil, nil, 5], h.values_at(:cwyear, :cweek, :cwday))
-
- h = Date._parse('--11-29')
- assert_equal([nil, 11, 29], h.values_at(:year, :mon, :mday))
- h = Date._parse('--1129')
- assert_equal([nil, 11, 29], h.values_at(:year, :mon, :mday))
- h = Date._parse('--11')
- assert_equal([nil, 11, nil], h.values_at(:year, :mon, :mday))
- h = Date._parse('---29')
- assert_equal([nil, nil, 29], h.values_at(:year, :mon, :mday))
- h = Date._parse('-333')
- assert_equal([nil, 333], h.values_at(:year, :yday))
-
- h = Date._parse('2006-333')
- assert_equal([2006, 333], h.values_at(:year, :yday))
- h = Date._parse('2006333')
- assert_equal([2006, 333], h.values_at(:year, :yday))
- h = Date._parse('06333', false)
- assert_equal([6, 333], h.values_at(:year, :yday))
- h = Date._parse('06333', true)
- assert_equal([2006, 333], h.values_at(:year, :yday))
- h = Date._parse('333')
- assert_equal([nil, 333], h.values_at(:year, :yday))
- end
-
- def test_parse
- assert_equal(Date.new, Date.parse)
- assert_equal(Date.new(2002,3,14), Date.parse('2002-03-14'))
-
- assert_equal(DateTime.new(2002,3,14,11,22,33, 0),
- DateTime.parse('2002-03-14T11:22:33Z'))
- assert_equal(DateTime.new(2002,3,14,11,22,33, 9.to_r/24),
- DateTime.parse('2002-03-14T11:22:33+09:00'))
- assert_equal(DateTime.new(2002,3,14,11,22,33, -9.to_r/24),
- DateTime.parse('2002-03-14T11:22:33-09:00'))
- assert_equal(DateTime.new(2002,3,14,11,22,33, -9.to_r/24) + 123456789.to_r/1000000000/86400,
- DateTime.parse('2002-03-14T11:22:33.123456789-09:00'))
- end
-
- def test_parse__2
- d1 = DateTime.parse('2004-03-13T22:45:59.5')
- d2 = DateTime.parse('2004-03-13T22:45:59')
- assert_equal(d2 + 5.to_r/10**1/86400, d1)
- d1 = DateTime.parse('2004-03-13T22:45:59.05')
- d2 = DateTime.parse('2004-03-13T22:45:59')
- assert_equal(d2 + 5.to_r/10**2/86400, d1)
- d1 = DateTime.parse('2004-03-13T22:45:59.005')
- d2 = DateTime.parse('2004-03-13T22:45:59')
- assert_equal(d2 + 5.to_r/10**3/86400, d1)
- d1 = DateTime.parse('2004-03-13T22:45:59.0123')
- d2 = DateTime.parse('2004-03-13T22:45:59')
- assert_equal(d2 + 123.to_r/10**4/86400, d1)
- d1 = DateTime.parse('2004-03-13T22:45:59.5')
- d1 += 1.to_r/2/86400
- d2 = DateTime.parse('2004-03-13T22:46:00')
- assert_equal(d2, d1)
- end
-
- require 'time'
-
- def test_parse__time
- methods = [:to_s, :asctime, :iso8601, :rfc2822, :httpdate, :xmlschema]
-
- t = Time.utc(2001,2,3,4,5,6)
- methods.each do |m|
- d = DateTime.parse(t.__send__(m))
- assert_equal([2001, 2, 3, 4, 5, 6],
- [d.year, d.mon, d.mday, d.hour, d.min, d.sec],
- [m, t.__send__(m)].inspect)
- end
-
- t = Time.mktime(2001,2,3,4,5,6)
- methods.each do |m|
- next if m == :httpdate
- d = DateTime.parse(t.__send__(m))
- assert_equal([2001, 2, 3, 4, 5, 6],
- [d.year, d.mon, d.mday, d.hour, d.min, d.sec],
- [m, t.__send__(m)].inspect)
- end
- end
-
- def test_parse__comp
- n = DateTime.now
-
- d = DateTime.parse('073')
- assert_equal([n.year, 73, 0, 0, 0],
- [d.year, d.yday, d.hour, d.min, d.sec])
- d = DateTime.parse('13')
- assert_equal([n.year, n.mon, 13, 0, 0, 0],
- [d.year, d.mon, d.mday, d.hour, d.min, d.sec])
-
- d = DateTime.parse('Mar 13')
- assert_equal([n.year, 3, 13, 0, 0, 0],
- [d.year, d.mon, d.mday, d.hour, d.min, d.sec])
- d = DateTime.parse('Mar 2004')
- assert_equal([2004, 3, 1, 0, 0, 0],
- [d.year, d.mon, d.mday, d.hour, d.min, d.sec])
- d = DateTime.parse('23:55')
- assert_equal([n.year, n.mon, n.mday, 23, 55, 0],
- [d.year, d.mon, d.mday, d.hour, d.min, d.sec])
- d = DateTime.parse('23:55:30')
- assert_equal([n.year, n.mon, n.mday, 23, 55, 30],
- [d.year, d.mon, d.mday, d.hour, d.min, d.sec])
-
- d = DateTime.parse('Sun 23:55')
- d2 = d - d.wday
- assert_equal([d2.year, d2.mon, d2.mday, 23, 55, 0],
- [d.year, d.mon, d.mday, d.hour, d.min, d.sec])
- d = DateTime.parse('Aug 23:55')
- assert_equal([n.year, 8, 1, 23, 55, 0],
- [d.year, d.mon, d.mday, d.hour, d.min, d.sec])
- end
-
- def test_parse__d_to_s
- d = Date.new(2002,3,14)
- assert_equal(d, Date.parse(d.to_s))
-
- d = DateTime.new(2002,3,14,11,22,33, 9.to_r/24)
- assert_equal(d, DateTime.parse(d.to_s))
- end
-
- def test_parse__ex
- assert_raise(ArgumentError) do
- Date.parse('')
- end
- assert_raise(ArgumentError) do
- Date.parse('2001-02-29')
- end
- assert_raise(ArgumentError) do
- DateTime.parse('2001-02-29T23:59:60')
- end
- assert_raise(ArgumentError) do
- Date.parse('23:55')
- end
- end
-
- def test__iso8601
- h = Date._iso8601('01-02-03')
- assert_equal([2001, 2, 3, nil, nil, nil, nil],
- h.values_at(:year, :mon, :mday, :hour, :min, :sec, :offset))
- h = Date._iso8601('2001-02-03')
- assert_equal([2001, 2, 3, nil, nil, nil, nil],
- h.values_at(:year, :mon, :mday, :hour, :min, :sec, :offset))
- h = Date._iso8601('--02-03')
- assert_equal([nil, 2, 3, nil, nil, nil, nil],
- h.values_at(:year, :mon, :mday, :hour, :min, :sec, :offset))
-
- h = Date._iso8601('2001-02-03T04:05')
- assert_equal([2001, 2, 3, 4, 5, nil, nil],
- h.values_at(:year, :mon, :mday, :hour, :min, :sec, :offset))
- h = Date._iso8601('2001-02-03T04:05:06')
- assert_equal([2001, 2, 3, 4, 5, 6, nil],
- h.values_at(:year, :mon, :mday, :hour, :min, :sec, :offset))
- h = Date._iso8601('2001-02-03T04:05:06,07')
- assert_equal([2001, 2, 3, 4, 5, 6, nil],
- h.values_at(:year, :mon, :mday, :hour, :min, :sec, :offset))
- h = Date._iso8601('2001-02-03T04:05:06Z')
- assert_equal([2001, 2, 3, 4, 5, 6, 0],
- h.values_at(:year, :mon, :mday, :hour, :min, :sec, :offset))
- h = Date._iso8601('2001-02-03T04:05:06.07+01:00')
- assert_equal([2001, 2, 3, 4, 5, 6, 3600],
- h.values_at(:year, :mon, :mday, :hour, :min, :sec, :offset))
-
- h = Date._iso8601('010203')
- assert_equal([2001, 2, 3, nil, nil, nil, nil],
- h.values_at(:year, :mon, :mday, :hour, :min, :sec, :offset))
- h = Date._iso8601('20010203')
- assert_equal([2001, 2, 3, nil, nil, nil, nil],
- h.values_at(:year, :mon, :mday, :hour, :min, :sec, :offset))
- h = Date._iso8601('--0203')
- assert_equal([nil, 2, 3, nil, nil, nil, nil],
- h.values_at(:year, :mon, :mday, :hour, :min, :sec, :offset))
-
- h = Date._iso8601('010203T0405')
- assert_equal([2001, 2, 3, 4, 5, nil, nil],
- h.values_at(:year, :mon, :mday, :hour, :min, :sec, :offset))
- h = Date._iso8601('20010203T0405')
- assert_equal([2001, 2, 3, 4, 5, nil, nil],
- h.values_at(:year, :mon, :mday, :hour, :min, :sec, :offset))
- h = Date._iso8601('20010203T040506')
- assert_equal([2001, 2, 3, 4, 5, 6, nil],
- h.values_at(:year, :mon, :mday, :hour, :min, :sec, :offset))
- h = Date._iso8601('20010203T040506,07')
- assert_equal([2001, 2, 3, 4, 5, 6, nil],
- h.values_at(:year, :mon, :mday, :hour, :min, :sec, :offset))
- h = Date._iso8601('20010203T040506Z')
- assert_equal([2001, 2, 3, 4, 5, 6, 0],
- h.values_at(:year, :mon, :mday, :hour, :min, :sec, :offset))
- h = Date._iso8601('20010203T040506.07+0100')
- assert_equal([2001, 2, 3, 4, 5, 6, 3600],
- h.values_at(:year, :mon, :mday, :hour, :min, :sec, :offset))
-
- h = Date._iso8601('200102030405')
- assert_equal([2001, 2, 3, 4, 5, nil, nil],
- h.values_at(:year, :mon, :mday, :hour, :min, :sec, :offset))
- h = Date._iso8601('20010203040506')
- assert_equal([2001, 2, 3, 4, 5, 6, nil],
- h.values_at(:year, :mon, :mday, :hour, :min, :sec, :offset))
- h = Date._iso8601('20010203040506,07')
- assert_equal([2001, 2, 3, 4, 5, 6, nil],
- h.values_at(:year, :mon, :mday, :hour, :min, :sec, :offset))
- h = Date._iso8601('20010203040506Z')
- assert_equal([2001, 2, 3, 4, 5, 6, 0],
- h.values_at(:year, :mon, :mday, :hour, :min, :sec, :offset))
- h = Date._iso8601('20010203040506.07+0100')
- assert_equal([2001, 2, 3, 4, 5, 6, 3600],
- h.values_at(:year, :mon, :mday, :hour, :min, :sec, :offset))
-
- h = Date._iso8601('01-023')
- assert_equal([2001, 23, nil, nil, nil, nil],
- h.values_at(:year, :yday, :hour, :min, :sec, :offset))
- h = Date._iso8601('2001-023')
- assert_equal([2001, 23, nil, nil, nil, nil],
- h.values_at(:year, :yday, :hour, :min, :sec, :offset))
- h = Date._iso8601('-023')
- assert_equal([nil, 23, nil, nil, nil, nil],
- h.values_at(:year, :yday, :hour, :min, :sec, :offset))
-
- h = Date._iso8601('04:05')
- assert_equal([nil, nil, nil, 4, 5, nil, nil],
- h.values_at(:year, :mon, :mday, :hour, :min, :sec, :offset))
- h = Date._iso8601('04:05:06')
- assert_equal([nil, nil, nil, 4, 5, 6, nil],
- h.values_at(:year, :mon, :mday, :hour, :min, :sec, :offset))
- h = Date._iso8601('04:05:06,07')
- assert_equal([nil, nil, nil, 4, 5, 6, nil],
- h.values_at(:year, :mon, :mday, :hour, :min, :sec, :offset))
- h = Date._iso8601('04:05:06Z')
- assert_equal([nil, nil, nil, 4, 5, 6, 0],
- h.values_at(:year, :mon, :mday, :hour, :min, :sec, :offset))
- h = Date._iso8601('04:05:06.07+01:00')
- assert_equal([nil, nil, nil, 4, 5, 6, 3600],
- h.values_at(:year, :mon, :mday, :hour, :min, :sec, :offset))
-
- h = Date._iso8601('040506,07')
- assert_equal([nil, nil, nil, 4, 5, 6, nil],
- h.values_at(:year, :mon, :mday, :hour, :min, :sec, :offset))
- h = Date._iso8601('040506.07+0100')
- assert_equal([nil, nil, nil, 4, 5, 6, 3600],
- h.values_at(:year, :mon, :mday, :hour, :min, :sec, :offset))
-
- h = Date._iso8601('01-w02-3')
- assert_equal([2001, 2, 3, nil, nil, nil, nil],
- h.values_at(:cwyear, :cweek, :cwday, :hour, :min, :sec, :offset))
- h = Date._iso8601('2001-w02-3')
- assert_equal([2001, 2, 3, nil, nil, nil, nil],
- h.values_at(:cwyear, :cweek, :cwday, :hour, :min, :sec, :offset))
- h = Date._iso8601('2001w023')
- assert_equal([2001, 2, 3, nil, nil, nil, nil],
- h.values_at(:cwyear, :cweek, :cwday, :hour, :min, :sec, :offset))
- h = Date._iso8601('-w02-3')
- assert_equal([nil, 2, 3, nil, nil, nil, nil],
- h.values_at(:cwyear, :cweek, :cwday, :hour, :min, :sec, :offset))
- h = Date._iso8601('-w-3')
- assert_equal([nil, nil, 3, nil, nil, nil, nil],
- h.values_at(:cwyear, :cweek, :cwday, :hour, :min, :sec, :offset))
- end
-
- def test__rfc3339
- h = Date._rfc3339('2001-02-03T04:05:06Z')
- assert_equal([2001, 2, 3, 4, 5, 6, 0],
- h.values_at(:year, :mon, :mday, :hour, :min, :sec, :offset))
- h = Date._rfc3339('2001-02-03 04:05:06Z')
- assert_equal([2001, 2, 3, 4, 5, 6, 0],
- h.values_at(:year, :mon, :mday, :hour, :min, :sec, :offset))
- h = Date._rfc3339('2001-02-03T04:05:06.07+01:00')
- assert_equal([2001, 2, 3, 4, 5, 6, 3600],
- h.values_at(:year, :mon, :mday, :hour, :min, :sec, :offset))
- end
-
- def test__xmlschema
- h = Date._xmlschema('2001-02-03')
- assert_equal([2001, 2, 3, nil, nil, nil, nil],
- h.values_at(:year, :mon, :mday, :hour, :min, :sec, :offset))
- h = Date._xmlschema('2001-02-03Z')
- assert_equal([2001, 2, 3, nil, nil, nil, 0],
- h.values_at(:year, :mon, :mday, :hour, :min, :sec, :offset))
- h = Date._xmlschema('2001-02-03+01:00')
- assert_equal([2001, 2, 3, nil, nil, nil, 3600],
- h.values_at(:year, :mon, :mday, :hour, :min, :sec, :offset))
-
- h = Date._xmlschema('2001-02-03T04:05:06')
- assert_equal([2001, 2, 3, 4, 5, 6, nil],
- h.values_at(:year, :mon, :mday, :hour, :min, :sec, :offset))
- h = Date._xmlschema('2001-02-03T04:05:06.07')
- assert_equal([2001, 2, 3, 4, 5, 6, nil],
- h.values_at(:year, :mon, :mday, :hour, :min, :sec, :offset))
- h = Date._xmlschema('2001-02-03T04:05:06.07Z')
- assert_equal([2001, 2, 3, 4, 5, 6, 0],
- h.values_at(:year, :mon, :mday, :hour, :min, :sec, :offset))
- h = Date._xmlschema('2001-02-03T04:05:06.07+01:00')
- assert_equal([2001, 2, 3, 4, 5, 6, 3600],
- h.values_at(:year, :mon, :mday, :hour, :min, :sec, :offset))
-
- h = Date._xmlschema('04:05:06')
- assert_equal([nil, nil, nil, 4, 5, 6, nil],
- h.values_at(:year, :mon, :mday, :hour, :min, :sec, :offset))
- h = Date._xmlschema('04:05:06Z')
- assert_equal([nil, nil, nil, 4, 5, 6, 0],
- h.values_at(:year, :mon, :mday, :hour, :min, :sec, :offset))
- h = Date._xmlschema('04:05:06+01:00')
- assert_equal([nil, nil, nil, 4, 5, 6, 3600],
- h.values_at(:year, :mon, :mday, :hour, :min, :sec, :offset))
-
- h = Date._xmlschema('2001-02')
- assert_equal([2001, 2, nil, nil, nil, nil, nil],
- h.values_at(:year, :mon, :mday, :hour, :min, :sec, :offset))
- h = Date._xmlschema('2001-02Z')
- assert_equal([2001, 2, nil, nil, nil, nil, 0],
- h.values_at(:year, :mon, :mday, :hour, :min, :sec, :offset))
- h = Date._xmlschema('2001-02+01:00')
- assert_equal([2001, 2, nil, nil, nil, nil, 3600],
- h.values_at(:year, :mon, :mday, :hour, :min, :sec, :offset))
- h = Date._xmlschema('2001-02-01:00')
- assert_equal([2001, 2, nil, nil, nil, nil, -3600],
- h.values_at(:year, :mon, :mday, :hour, :min, :sec, :offset))
-
- h = Date._xmlschema('2001')
- assert_equal([2001, nil, nil, nil, nil, nil, nil],
- h.values_at(:year, :mon, :mday, :hour, :min, :sec, :offset))
- h = Date._xmlschema('2001Z')
- assert_equal([2001, nil, nil, nil, nil, nil, 0],
- h.values_at(:year, :mon, :mday, :hour, :min, :sec, :offset))
- h = Date._xmlschema('2001+01:00')
- assert_equal([2001, nil, nil, nil, nil, nil, 3600],
- h.values_at(:year, :mon, :mday, :hour, :min, :sec, :offset))
- h = Date._xmlschema('2001-01:00')
- assert_equal([2001, nil, nil, nil, nil, nil, -3600],
- h.values_at(:year, :mon, :mday, :hour, :min, :sec, :offset))
-
- h = Date._xmlschema('--02')
- assert_equal([nil, 2, nil, nil, nil, nil, nil],
- h.values_at(:year, :mon, :mday, :hour, :min, :sec, :offset))
- h = Date._xmlschema('--02Z')
- assert_equal([nil, 2, nil, nil, nil, nil, 0],
- h.values_at(:year, :mon, :mday, :hour, :min, :sec, :offset))
- h = Date._xmlschema('--02+01:00')
- assert_equal([nil, 2, nil, nil, nil, nil, 3600],
- h.values_at(:year, :mon, :mday, :hour, :min, :sec, :offset))
-
- h = Date._xmlschema('92001-02-03T04:05:06.07+01:00')
- assert_equal([92001, 2, 3, 4, 5, 6, 3600],
- h.values_at(:year, :mon, :mday, :hour, :min, :sec, :offset))
-
- h = Date._xmlschema('-92001-02-03T04:05:06.07+01:00')
- assert_equal([-92001, 2, 3, 4, 5, 6, 3600],
- h.values_at(:year, :mon, :mday, :hour, :min, :sec, :offset))
- end
-
- def test__rfc2822
- h = Date._rfc2822('Sat, 3 Feb 2001 04:05:06 UT')
- assert_equal([2001, 2, 3, 4, 5, 6, 0],
- h.values_at(:year, :mon, :mday, :hour, :min, :sec, :offset))
- h = Date._rfc2822('Sat, 3 Feb 2001 04:05:06 EST')
- assert_equal([2001, 2, 3, 4, 5, 6, -5*3600],
- h.values_at(:year, :mon, :mday, :hour, :min, :sec, :offset))
- h = Date._rfc2822('Sat, 3 Feb 2001 04:05:06 +0000')
- assert_equal([2001, 2, 3, 4, 5, 6, 0],
- h.values_at(:year, :mon, :mday, :hour, :min, :sec, :offset))
- h = Date._rfc2822('Sat, 3 Feb 2001 04:05:06 +0100')
- assert_equal([2001, 2, 3, 4, 5, 6, 3600],
- h.values_at(:year, :mon, :mday, :hour, :min, :sec, :offset))
-
- h = Date._rfc2822('Sat, 03 Feb 50 04:05:06 +0100')
- assert_equal([1950, 2, 3, 4, 5, 6, 3600],
- h.values_at(:year, :mon, :mday, :hour, :min, :sec, :offset))
- h = Date._rfc2822('Sat, 03 Feb 49 04:05:06 +0100')
- assert_equal([2049, 2, 3, 4, 5, 6, 3600],
- h.values_at(:year, :mon, :mday, :hour, :min, :sec, :offset))
- h = Date._rfc2822('Sat, 03 Feb 100 04:05:06 +0100')
- assert_equal([2000, 2, 3, 4, 5, 6, 3600],
- h.values_at(:year, :mon, :mday, :hour, :min, :sec, :offset))
-
- h1 = Date._rfc2822('Sat, 3 Feb 2001 04:05:06 UT')
- h2 = Date._rfc822('Sat, 3 Feb 2001 04:05:06 UT')
- assert_equal(h1, h2)
- end
-
- def test__httpdate
- h = Date._httpdate('Sat, 03 Feb 2001 04:05:06 GMT')
- assert_equal([2001, 2, 3, 4, 5, 6, 0],
- h.values_at(:year, :mon, :mday, :hour, :min, :sec, :offset))
-
- h = Date._httpdate('Saturday, 03-Feb-01 04:05:06 GMT')
- assert_equal([2001, 2, 3, 4, 5, 6, 0],
- h.values_at(:year, :mon, :mday, :hour, :min, :sec, :offset))
-
- h = Date._httpdate('Sat Feb 3 04:05:06 2001')
- assert_equal([2001, 2, 3, 4, 5, 6, nil],
- h.values_at(:year, :mon, :mday, :hour, :min, :sec, :offset))
- h = Date._httpdate('Sat Feb 03 04:05:06 2001')
- assert_equal([2001, 2, 3, 4, 5, 6, nil],
- h.values_at(:year, :mon, :mday, :hour, :min, :sec, :offset))
- end
-
- def test__jisx0301
- h = Date._jisx0301('13.02.03')
- assert_equal([2001, 2, 3, nil, nil, nil, nil],
- h.values_at(:year, :mon, :mday, :hour, :min, :sec, :offset))
- h = Date._jisx0301('H13.02.03')
- assert_equal([2001, 2, 3, nil, nil, nil, nil],
- h.values_at(:year, :mon, :mday, :hour, :min, :sec, :offset))
- h = Date._jisx0301('S63.02.03')
- assert_equal([1988, 2, 3, nil, nil, nil, nil],
- h.values_at(:year, :mon, :mday, :hour, :min, :sec, :offset))
-
- h = Date._jisx0301('H13.02.03T04:05:06')
- assert_equal([2001, 2, 3, 4, 5, 6, nil],
- h.values_at(:year, :mon, :mday, :hour, :min, :sec, :offset))
- h = Date._jisx0301('H13.02.03T04:05:06,07')
- assert_equal([2001, 2, 3, 4, 5, 6, nil],
- h.values_at(:year, :mon, :mday, :hour, :min, :sec, :offset))
- h = Date._jisx0301('H13.02.03T04:05:06Z')
- assert_equal([2001, 2, 3, 4, 5, 6, 0],
- h.values_at(:year, :mon, :mday, :hour, :min, :sec, :offset))
- h = Date._jisx0301('H13.02.03T04:05:06.07+0100')
- assert_equal([2001, 2, 3, 4, 5, 6, 3600],
- h.values_at(:year, :mon, :mday, :hour, :min, :sec, :offset))
- end
-
- def test_iso8601
- assert_instance_of(Date, Date.iso8601)
- assert_instance_of(DateTime, DateTime.iso8601)
- end
-
- def test_rfc3339
- assert_instance_of(Date, Date.rfc3339)
- assert_instance_of(DateTime, DateTime.rfc3339)
- end
-
- def test_xmlschema
- assert_instance_of(Date, Date.xmlschema)
- assert_instance_of(DateTime, DateTime.xmlschema)
- end
-
- def test_rfc2822
- assert_instance_of(Date, Date.rfc2822)
- assert_instance_of(DateTime, DateTime.rfc2822)
- assert_instance_of(Date, Date.rfc822)
- assert_instance_of(DateTime, DateTime.rfc822)
- end
-
- def test_httpdate
- assert_instance_of(Date, Date.httpdate)
- assert_instance_of(DateTime, DateTime.httpdate)
- end
-
- def test_jisx0301
- assert_instance_of(Date, Date.jisx0301)
- assert_instance_of(DateTime, DateTime.jisx0301)
- end
-
-end
diff --git a/test/date/test_date_strftime.rb b/test/date/test_date_strftime.rb
deleted file mode 100644
index 117517256c..0000000000
--- a/test/date/test_date_strftime.rb
+++ /dev/null
@@ -1,388 +0,0 @@
-require 'test/unit'
-require 'date'
-
-class TestDateStrftime < Test::Unit::TestCase
-
- STRFTIME_2001_02_03 = {
- '%A'=>['Saturday',{:wday=>6}],
- '%a'=>['Sat',{:wday=>6}],
- '%B'=>['February',{:mon=>2}],
- '%b'=>['Feb',{:mon=>2}],
- '%c'=>['Sat Feb 3 00:00:00 2001',
- {:wday=>6,:mon=>2,:mday=>3,:hour=>0,:min=>0,:sec=>0,:year=>2001}],
- '%d'=>['03',{:mday=>3}],
- '%e'=>[' 3',{:mday=>3}],
- '%H'=>['00',{:hour=>0}],
- '%I'=>['12',{:hour=>0}],
- '%j'=>['034',{:yday=>34}],
- '%M'=>['00',{:min=>0}],
- '%m'=>['02',{:mon=>2}],
- '%p'=>['AM',{}],
- '%S'=>['00',{:sec=>0}],
- '%U'=>['04',{:wnum0=>4}],
- '%W'=>['05',{:wnum1=>5}],
- '%X'=>['00:00:00',{:hour=>0,:min=>0,:sec=>0}],
- '%x'=>['02/03/01',{:mon=>2,:mday=>3,:year=>2001}],
- '%Y'=>['2001',{:year=>2001}],
- '%y'=>['01',{:year=>2001}],
- '%Z'=>['+00:00',{:zone=>'+00:00',:offset=>0}],
- '%%'=>['%',{}],
- '%C'=>['20',{}],
- '%D'=>['02/03/01',{:mon=>2,:mday=>3,:year=>2001}],
- '%F'=>['2001-02-03',{:year=>2001,:mon=>2,:mday=>3}],
- '%G'=>['2001',{:cwyear=>2001}],
- '%g'=>['01',{:cwyear=>2001}],
- '%h'=>['Feb',{:mon=>2}],
- '%k'=>[' 0',{:hour=>0}],
- '%L'=>['000',{:sec_fraction=>0}],
- '%l'=>['12',{:hour=>0}],
- '%N'=>['000000000',{:sec_fraction=>0}],
- '%n'=>["\n",{}],
- '%P'=>['am',{}],
- '%Q'=>['981158400000',{:seconds=>981158400.to_r}],
- '%R'=>['00:00',{:hour=>0,:min=>0}],
- '%r'=>['12:00:00 AM',{:hour=>0,:min=>0,:sec=>0}],
- '%s'=>['981158400',{:seconds=>981158400}],
- '%T'=>['00:00:00',{:hour=>0,:min=>0,:sec=>0}],
- '%t'=>["\t",{}],
- '%u'=>['6',{:cwday=>6}],
- '%V'=>['05',{:cweek=>5}],
- '%v'=>[' 3-Feb-2001',{:mday=>3,:mon=>2,:year=>2001}],
- '%z'=>['+0000',{:zone=>'+0000',:offset=>0}],
- '%+'=>['Sat Feb 3 00:00:00 +00:00 2001',
- {:wday=>6,:mon=>2,:mday=>3,
- :hour=>0,:min=>0,:sec=>0,:zone=>'+00:00',:offset=>0,:year=>2001}],
- }
-
- STRFTIME_2001_02_03_CVS19 = {
- }
-
- STRFTIME_2001_02_03_GNUext = {
- '%:z'=>['+00:00',{:zone=>'+00:00',:offset=>0}],
- '%::z'=>['+00:00:00',{:zone=>'+00:00:00',:offset=>0}],
- '%:::z'=>['+00',{:zone=>'+00',:offset=>0}],
- }
-
- STRFTIME_2001_02_03.update(STRFTIME_2001_02_03_CVS19)
- STRFTIME_2001_02_03.update(STRFTIME_2001_02_03_GNUext)
-
- def test_strftime
- d = Date.new(2001,2,3)
- STRFTIME_2001_02_03.each do |f, s|
- assert_equal(s[0], d.strftime(f), [f, s].inspect)
- case f[-1,1]
- when 'c', 'C', 'x', 'X', 'y', 'Y'
- f2 = f.sub(/\A%/, '%E')
- assert_equal(s[0], d.strftime(f2), [f2, s].inspect)
- else
- f2 = f.sub(/\A%/, '%E')
- assert_equal(f2, d.strftime(f2), [f2, s].inspect)
- end
- case f[-1,1]
- when 'd', 'e', 'H', 'I', 'm', 'M', 'S', 'u', 'U', 'V', 'w', 'W', 'y'
- f2 = f.sub(/\A%/, '%O')
- assert_equal(s[0], d.strftime(f2), [f2, s].inspect)
- else
- f2 = f.sub(/\A%/, '%O')
- assert_equal(f2, d.strftime(f2), [f2, s].inspect)
- end
- end
- end
-
- def test_strftime__2
- d = Date.new(2001,2,3)
- assert_equal('2001-02-03', d.strftime)
-
- d = DateTime.new(2001,2,3)
- assert_equal('2001-02-03T00:00:00+00:00', d.strftime)
-
- assert_equal('', d.strftime(''))
- assert_equal("\s"*3, d.strftime("\s"*3))
- assert_equal("\tfoo\n\000\r", d.strftime("\tfoo\n\000\r"))
- assert_equal("%\n", d.strftime("%\n")) # gnu
- assert_equal('Saturday'*1024 + ',', d.strftime('%A'*1024 + ','))
- assert_equal('%%', d.strftime('%%%'))
- assert_equal('Anton von Webern', d.strftime('Anton von Webern'))
-
- d = DateTime.new(2001,2,3, 1,2,3)
- assert_equal('2001-02-03T01:02:03+00:00', d.strftime)
- assert_equal('AM', d.strftime('%p'))
- assert_equal('am', d.strftime('%P'))
- d = DateTime.new(2001,2,3, 13,14,15)
- assert_equal('2001-02-03T13:14:15+00:00', d.strftime)
- assert_equal('PM', d.strftime('%p'))
- assert_equal('pm', d.strftime('%P'))
- end
-
- def test_strftime__3_1
- (Date.new(1970,1,1)..Date.new(2037,12,31)).each do |d|
- t = Time.utc(d.year,d.mon,d.mday)
- assert_equal(t.strftime('%U'), d.strftime('%U'))
- assert_equal(t.strftime('%W'), d.strftime('%W'))
- end
- end
-
- def test_strftime__3_2
- s = Time.now.strftime('%G')
- if s.empty? || s == '%G'
- return
- end
- (Date.new(1970,1,1)..Date.new(2037,12,31)).each do |d|
- t = Time.utc(d.year,d.mon,d.mday)
- assert_equal(t.strftime('%G'), d.strftime('%G'))
- assert_equal(t.strftime('%g'), d.strftime('%g'))
- assert_equal(t.strftime('%V'), d.strftime('%V'))
- assert_equal(t.strftime('%u'), d.strftime('%u'))
- end
- end
-
- def test_strftime__4
- s = '2006-08-08T23:15:33.123456789'
- f = '%FT%T.%N'
- d = DateTime.parse(s)
- assert_equal(s, d.strftime(f))
- d = DateTime.strptime(s, f)
- assert_equal(s, d.strftime(f))
-
- s = '2006-08-08T23:15:33.123456789'
- f = '%FT%T.%N'
- d = DateTime.parse(s + '123456789')
- assert_equal(s, d.strftime(f))
- d = DateTime.strptime(s + '123456789', f)
- assert_equal(s, d.strftime(f))
-
- si = '2006-08-08T23:15:33.9'
- so = '2006-08-08T23:15:33.900000000'
- f = '%FT%T.%N'
- d = DateTime.parse(si)
- assert_equal(so, d.strftime(f))
- d = DateTime.strptime(si, f)
- assert_equal(so, d.strftime(f))
-
- s = '2006-08-08T23:15:33.123'
- f = '%FT%T.%L'
- d = DateTime.parse(s)
- assert_equal(s, d.strftime(f))
- d = DateTime.strptime(s, f)
- assert_equal(s, d.strftime(f))
-
- s = '2006-08-08T23:15:33.123'
- f = '%FT%T.%L'
- d = DateTime.parse(s + '123')
- assert_equal(s, d.strftime(f))
- d = DateTime.strptime(s + '123', f)
- assert_equal(s, d.strftime(f))
-
- si = '2006-08-08T23:15:33.9'
- so = '2006-08-08T23:15:33.900'
- f = '%FT%T.%L'
- d = DateTime.parse(si)
- assert_equal(so, d.strftime(f))
- d = DateTime.strptime(si, f)
- assert_equal(so, d.strftime(f))
- end
-
- def test_strftime__offset
- s = '2006-08-08T23:15:33'
- (-24..24).collect{|x| '%+.2d' % x}.each do |hh|
- %w(00 30).each do |mm|
- d = DateTime.parse(s + hh + mm)
- assert_equal(hh + mm, d.strftime('%z'))
- end
- end
- end
-
- def test_strftime__minus
- d = DateTime.new(1969, 12, 31, 23, 59, 59)
- assert_equal('-1', d.strftime('%s'))
- assert_equal('-1000', d.strftime('%Q'))
- end
-
- def test_strftime__gnuext # coreutils
- d = DateTime.new(2006,8,8,23,15,33,9.to_r/24)
-
- assert_equal('2006', d.strftime('%-Y'))
- assert_equal('2006', d.strftime('%-5Y'))
- assert_equal('02006', d.strftime('%5Y'))
- assert_equal('2006', d.strftime('%_Y'))
- assert_equal(' 2006', d.strftime('%_5Y'))
- assert_equal('02006', d.strftime('%05Y'))
-
- assert_equal('8', d.strftime('%-d'))
- assert_equal('8', d.strftime('%-3d'))
- assert_equal('008', d.strftime('%3d'))
- assert_equal(' 8', d.strftime('%_d'))
- assert_equal(' 8', d.strftime('%_3d'))
- assert_equal('008', d.strftime('%03d'))
-
- assert_equal('8', d.strftime('%-e'))
- assert_equal('8', d.strftime('%-3e'))
- assert_equal(' 8', d.strftime('%3e'))
- assert_equal(' 8', d.strftime('%_e'))
- assert_equal(' 8', d.strftime('%_3e'))
- assert_equal('008', d.strftime('%03e'))
-
- assert_equal('Tuesday', d.strftime('%-10A'))
- assert_equal(' Tuesday', d.strftime('%10A'))
- assert_equal(' Tuesday', d.strftime('%_10A'))
- assert_equal('000Tuesday', d.strftime('%010A'))
- assert_equal('TUESDAY', d.strftime('%^A'))
- assert_equal('TUESDAY', d.strftime('%#A'))
-
- assert_equal('Tue', d.strftime('%-6a'))
- assert_equal(' Tue', d.strftime('%6a'))
- assert_equal(' Tue', d.strftime('%_6a'))
- assert_equal('000Tue', d.strftime('%06a'))
- assert_equal('TUE', d.strftime('%^a'))
- assert_equal('TUE', d.strftime('%#a'))
- assert_equal(' TUE', d.strftime('%#6a'))
-
- assert_equal('August', d.strftime('%-10B'))
- assert_equal(' August', d.strftime('%10B'))
- assert_equal(' August', d.strftime('%_10B'))
- assert_equal('0000August', d.strftime('%010B'))
- assert_equal('AUGUST', d.strftime('%^B'))
- assert_equal('AUGUST', d.strftime('%#B'))
-
- assert_equal('Aug', d.strftime('%-6b'))
- assert_equal(' Aug', d.strftime('%6b'))
- assert_equal(' Aug', d.strftime('%_6b'))
- assert_equal('000Aug', d.strftime('%06b'))
- assert_equal('AUG', d.strftime('%^b'))
- assert_equal('AUG', d.strftime('%#b'))
- assert_equal(' AUG', d.strftime('%#6b'))
-
- assert_equal('Aug', d.strftime('%-6h'))
- assert_equal(' Aug', d.strftime('%6h'))
- assert_equal(' Aug', d.strftime('%_6h'))
- assert_equal('000Aug', d.strftime('%06h'))
- assert_equal('AUG', d.strftime('%^h'))
- assert_equal('AUG', d.strftime('%#h'))
- assert_equal(' AUG', d.strftime('%#6h'))
-
- assert_equal('PM', d.strftime('%^p'))
- assert_equal('pm', d.strftime('%#p'))
- assert_equal('PM', d.strftime('%^P'))
- assert_equal('PM', d.strftime('%#P'))
-
- assert_equal('+000900', d.strftime('%7z'))
- assert_equal(' +900', d.strftime('%_7z'))
- assert_equal('+09:00', d.strftime('%:z'))
- assert_equal('+0009:00', d.strftime('%8:z'))
- assert_equal(' +9:00', d.strftime('%_8:z'))
- assert_equal('+09:00:00', d.strftime('%::z'))
- assert_equal('+0009:00:00', d.strftime('%11::z'))
- assert_equal(' +9:00:00', d.strftime('%_11::z'))
- assert_equal('+09', d.strftime('%:::z'))
- assert_equal('+0009', d.strftime('%5:::z'))
- assert_equal(' +9', d.strftime('%_5:::z'))
- assert_equal('+9', d.strftime('%-:::z'))
-
- d = DateTime.new(-200,8,8,23,15,33,9.to_r/24)
-
- assert_equal('-0200', d.strftime('%Y'))
- assert_equal('-200', d.strftime('%-Y'))
- assert_equal('-200', d.strftime('%-5Y'))
- assert_equal('-0200', d.strftime('%5Y'))
- assert_equal(' -200', d.strftime('%_Y'))
- assert_equal(' -200', d.strftime('%_5Y'))
- assert_equal('-0200', d.strftime('%05Y'))
-
- d = DateTime.new(-2000,8,8,23,15,33,9.to_r/24)
-
- assert_equal('-2000', d.strftime('%Y'))
- assert_equal('-2000', d.strftime('%-Y'))
- assert_equal('-2000', d.strftime('%-5Y'))
- assert_equal('-2000', d.strftime('%5Y'))
- assert_equal('-2000', d.strftime('%_Y'))
- assert_equal('-2000', d.strftime('%_5Y'))
- assert_equal('-2000', d.strftime('%05Y'))
- end
-
- def test_strftime__gnuext_LN # coreutils
- d = DateTime.parse('2008-11-25T00:11:22.0123456789')
- assert_equal('012', d.strftime('%L'))
- assert_equal('012', d.strftime('%0L'))
- assert_equal('0', d.strftime('%1L'))
- assert_equal('01', d.strftime('%2L'))
- assert_equal('01234567890', d.strftime('%11L'))
- assert_equal('01234567890', d.strftime('%011L'))
- assert_equal('01234567890', d.strftime('%_11L'))
- assert_equal('012345678', d.strftime('%N'))
- assert_equal('012345678', d.strftime('%0N'))
- assert_equal('0', d.strftime('%1N'))
- assert_equal('01', d.strftime('%2N'))
- assert_equal('01234567890', d.strftime('%11N'))
- assert_equal('01234567890', d.strftime('%011N'))
- assert_equal('01234567890', d.strftime('%_11N'))
- end
-
- def test_strftime__gnuext_z # coreutils
- d = DateTime.parse('2006-08-08T23:15:33+09:08:07')
- assert_equal('+0908', d.strftime('%z'))
- assert_equal('+09:08', d.strftime('%:z'))
- assert_equal('+09:08:07', d.strftime('%::z'))
- assert_equal('+09:08:07', d.strftime('%:::z'))
- end
-
- def test__different_format
- d = Date.new(2001,2,3)
-
- assert_equal('Sat Feb 3 00:00:00 2001', d.ctime)
- assert_equal(d.ctime, d.asctime)
-
- assert_equal('2001-02-03', d.iso8601)
- assert_equal(d.rfc3339, d.iso8601)
- assert_equal(d.xmlschema, d.iso8601)
- assert_equal('Sat, 3 Feb 2001 00:00:00 +0000', d.rfc2822)
- assert_equal(d.rfc822, d.rfc2822)
- assert_equal('Sat, 03 Feb 2001 00:00:00 GMT', d.httpdate)
- assert_equal('H13.02.03', d.jisx0301)
-
- d = DateTime.new(2001,2,3)
-
- assert_equal('Sat Feb 3 00:00:00 2001', d.ctime)
- assert_equal(d.ctime, d.asctime)
-
- assert_equal('2001-02-03T00:00:00+00:00', d.iso8601)
- assert_equal(d.rfc3339, d.iso8601)
- assert_equal(d.xmlschema, d.iso8601)
- assert_equal('Sat, 3 Feb 2001 00:00:00 +0000', d.rfc2822)
- assert_equal(d.rfc822, d.rfc2822)
- assert_equal('Sat, 03 Feb 2001 00:00:00 GMT', d.httpdate)
- assert_equal('H13.02.03T00:00:00+00:00', d.jisx0301)
-
- d2 = DateTime.parse('2001-02-03T04:05:06.123456')
- assert_equal('2001-02-03T04:05:06.123+00:00', d2.iso8601(3))
- assert_equal('2001-02-03T04:05:06.123+00:00', d2.rfc3339(3))
- assert_equal('H13.02.03T04:05:06.123+00:00', d2.jisx0301(3))
- assert_equal('2001-02-03T04:05:06.123456000+00:00', d2.iso8601(9))
- assert_equal('2001-02-03T04:05:06.123456000+00:00', d2.rfc3339(9))
- assert_equal('H13.02.03T04:05:06.123456000+00:00', d2.jisx0301(9))
-
- assert_equal('1868-01-25', Date.parse('1868-01-25').jisx0301)
- assert_equal('1872-12-31', Date.parse('1872-12-31').jisx0301)
-
- assert_equal('M06.01.01', Date.parse('1873-01-01').jisx0301)
- assert_equal('M45.07.29', Date.parse('1912-07-29').jisx0301)
- assert_equal('T01.07.30', Date.parse('1912-07-30').jisx0301)
- assert_equal('T15.12.24', Date.parse('1926-12-24').jisx0301)
- assert_equal('S01.12.25', Date.parse('1926-12-25').jisx0301)
- assert_equal('S64.01.07', Date.parse('1989-01-07').jisx0301)
- assert_equal('H01.01.08', Date.parse('1989-01-08').jisx0301)
- assert_equal('H18.09.01', Date.parse('2006-09-01').jisx0301)
-
- %w(M06.01.01
- M45.07.29
- T01.07.30
- T15.12.24
- S01.12.25
- S64.01.07
- H01.01.08
- H18.09.01).each do |s|
- assert_equal(s, Date.parse(s).jisx0301)
- end
-
- end
-
-end
diff --git a/test/date/test_date_strptime.rb b/test/date/test_date_strptime.rb
deleted file mode 100644
index 572d1ea42a..0000000000
--- a/test/date/test_date_strptime.rb
+++ /dev/null
@@ -1,469 +0,0 @@
-require 'test/unit'
-require 'date'
-
-class TestDateStrptime < Test::Unit::TestCase
-
- STRFTIME_2001_02_03 = {
- '%A'=>['Saturday',{:wday=>6}],
- '%a'=>['Sat',{:wday=>6}],
- '%B'=>['February',{:mon=>2}],
- '%b'=>['Feb',{:mon=>2}],
- '%c'=>['Sat Feb 3 00:00:00 2001',
- {:wday=>6,:mon=>2,:mday=>3,:hour=>0,:min=>0,:sec=>0,:year=>2001}],
- '%d'=>['03',{:mday=>3}],
- '%e'=>[' 3',{:mday=>3}],
- '%H'=>['00',{:hour=>0}],
- '%I'=>['12',{:hour=>0}],
- '%j'=>['034',{:yday=>34}],
- '%M'=>['00',{:min=>0}],
- '%m'=>['02',{:mon=>2}],
- '%p'=>['AM',{}],
- '%S'=>['00',{:sec=>0}],
- '%U'=>['04',{:wnum0=>4}],
- '%W'=>['05',{:wnum1=>5}],
- '%X'=>['00:00:00',{:hour=>0,:min=>0,:sec=>0}],
- '%x'=>['02/03/01',{:mon=>2,:mday=>3,:year=>2001}],
- '%Y'=>['2001',{:year=>2001}],
- '%y'=>['01',{:year=>2001}],
- '%Z'=>['+00:00',{:zone=>'+00:00',:offset=>0}],
- '%%'=>['%',{}],
- '%C'=>['20',{}],
- '%D'=>['02/03/01',{:mon=>2,:mday=>3,:year=>2001}],
- '%F'=>['2001-02-03',{:year=>2001,:mon=>2,:mday=>3}],
- '%G'=>['2001',{:cwyear=>2001}],
- '%g'=>['01',{:cwyear=>2001}],
- '%h'=>['Feb',{:mon=>2}],
- '%k'=>[' 0',{:hour=>0}],
- '%L'=>['000',{:sec_fraction=>0}],
- '%l'=>['12',{:hour=>0}],
- '%N'=>['000000000',{:sec_fraction=>0}],
- '%n'=>["\n",{}],
- '%P'=>['am',{}],
- '%Q'=>['981158400000',{:seconds=>981158400.to_r}],
- '%R'=>['00:00',{:hour=>0,:min=>0}],
- '%r'=>['12:00:00 AM',{:hour=>0,:min=>0,:sec=>0}],
- '%s'=>['981158400',{:seconds=>981158400}],
- '%T'=>['00:00:00',{:hour=>0,:min=>0,:sec=>0}],
- '%t'=>["\t",{}],
- '%u'=>['6',{:cwday=>6}],
- '%V'=>['05',{:cweek=>5}],
- '%v'=>[' 3-Feb-2001',{:mday=>3,:mon=>2,:year=>2001}],
- '%z'=>['+0000',{:zone=>'+0000',:offset=>0}],
- '%+'=>['Sat Feb 3 00:00:00 +00:00 2001',
- {:wday=>6,:mon=>2,:mday=>3,
- :hour=>0,:min=>0,:sec=>0,:zone=>'+00:00',:offset=>0,:year=>2001}],
- }
-
- STRFTIME_2001_02_03_CVS19 = {
- }
-
- STRFTIME_2001_02_03_GNUext = {
- '%:z'=>['+00:00',{:zone=>'+00:00',:offset=>0}],
- '%::z'=>['+00:00:00',{:zone=>'+00:00:00',:offset=>0}],
- '%:::z'=>['+00',{:zone=>'+00',:offset=>0}],
- }
-
- STRFTIME_2001_02_03.update(STRFTIME_2001_02_03_CVS19)
- STRFTIME_2001_02_03.update(STRFTIME_2001_02_03_GNUext)
-
- def test__strptime
- STRFTIME_2001_02_03.each do |f, s|
- if (f == '%I' and s[0] == '12') or
- (f == '%l' and s[0] == '12') # hour w/o merid
- s[1][:hour] = 12
- end
- assert_equal(s[1], Date._strptime(s[0], f), [f, s].inspect)
- case f[-1,1]
- when 'c', 'C', 'x', 'X', 'y', 'Y'
- f2 = f.sub(/\A%/, '%E')
- assert_equal(s[1], Date._strptime(s[0], f2), [f2, s].inspect)
- else
- f2 = f.sub(/\A%/, '%E')
- assert_equal(nil, Date._strptime(s[0], f2), [f2, s].inspect)
- assert_equal({}, Date._strptime(f2, f2), [f2, s].inspect)
- end
- case f[-1,1]
- when 'd', 'e', 'H', 'I', 'm', 'M', 'S', 'u', 'U', 'V', 'w', 'W', 'y'
- f2 = f.sub(/\A%/, '%O')
- assert_equal(s[1], Date._strptime(s[0], f2), [f2, s].inspect)
- else
- f2 = f.sub(/\A%/, '%O')
- assert_equal(nil, Date._strptime(s[0], f2), [f2, s].inspect)
- assert_equal({}, Date._strptime(f2, f2), [f2, s].inspect)
- end
- end
- end
-
- def test__strptime__2
- h = Date._strptime('2001-02-03')
- assert_equal([2001,2,3], h.values_at(:year,:mon,:mday))
-
- h = DateTime._strptime('2001-02-03T12:13:14Z')
- assert_equal([2001,2,3,12,13,14],
- h.values_at(:year,:mon,:mday,:hour,:min,:sec))
-
- assert_equal({}, Date._strptime('', ''))
- assert_equal({:leftover=>"\s"*3}, Date._strptime("\s"*3, ''))
- assert_equal({:leftover=>'x'}, Date._strptime("\nx", "\n"))
- assert_equal({}, Date._strptime('', "\s"*3))
- assert_equal({}, Date._strptime("\s"*3, "\s"*3))
- assert_equal({}, Date._strptime("\tfoo\n\000\r", "\tfoo\n\000\r"))
- assert_equal({}, Date._strptime("foo\n\nbar", "foo\sbar"))
- assert_equal({}, Date._strptime("%\n", "%\n")) # gnu
- assert_equal({}, Date._strptime('%%', '%%%'))
- assert_equal({:wday=>6}, Date._strptime('Saturday'*1024 + ',', '%A'*1024 + ','))
- assert_equal({:wday=>6}, Date._strptime('Saturday'*1024 + ',', '%a'*1024 + ','))
- assert_equal({}, Date._strptime('Anton von Webern', 'Anton von Webern'))
- end
-
- def test__strptime__3
- [
- # iso8601
- [['2001-02-03', '%Y-%m-%d'], [2001,2,3,nil,nil,nil,nil,nil,nil]],
- [['2001-02-03T23:59:60', '%Y-%m-%dT%H:%M:%S'], [2001,2,3,23,59,60,nil,nil,nil]],
- [['2001-02-03T23:59:60+09:00', '%Y-%m-%dT%H:%M:%S%Z'], [2001,2,3,23,59,60,'+09:00',9*3600,nil]],
- [['-2001-02-03T23:59:60+09:00', '%Y-%m-%dT%H:%M:%S%Z'], [-2001,2,3,23,59,60,'+09:00',9*3600,nil]],
- [['+012345-02-03T23:59:60+09:00', '%Y-%m-%dT%H:%M:%S%Z'], [12345,2,3,23,59,60,'+09:00',9*3600,nil]],
- [['-012345-02-03T23:59:60+09:00', '%Y-%m-%dT%H:%M:%S%Z'], [-12345,2,3,23,59,60,'+09:00',9*3600,nil]],
-
- # ctime(3), asctime(3)
- [['Thu Jul 29 14:47:19 1999', '%c'], [1999,7,29,14,47,19,nil,nil,4]],
- [['Thu Jul 29 14:47:19 -1999', '%c'], [-1999,7,29,14,47,19,nil,nil,4]],
-
- # date(1)
- [['Thu Jul 29 16:39:41 EST 1999', '%a %b %d %H:%M:%S %Z %Y'], [1999,7,29,16,39,41,'EST',-5*3600,4]],
- [['Thu Jul 29 16:39:41 MET DST 1999', '%a %b %d %H:%M:%S %Z %Y'], [1999,7,29,16,39,41,'MET DST',2*3600,4]],
- [['Thu Jul 29 16:39:41 AMT 1999', '%a %b %d %H:%M:%S %Z %Y'], [1999,7,29,16,39,41,'AMT',nil,4]],
- [['Thu Jul 29 16:39:41 AMT -1999', '%a %b %d %H:%M:%S %Z %Y'], [-1999,7,29,16,39,41,'AMT',nil,4]],
- [['Thu Jul 29 16:39:41 GMT+09 1999', '%a %b %d %H:%M:%S %Z %Y'], [1999,7,29,16,39,41,'GMT+09',9*3600,4]],
- [['Thu Jul 29 16:39:41 GMT+0908 1999', '%a %b %d %H:%M:%S %Z %Y'], [1999,7,29,16,39,41,'GMT+0908',9*3600+8*60,4]],
- [['Thu Jul 29 16:39:41 GMT+090807 1999', '%a %b %d %H:%M:%S %Z %Y'], [1999,7,29,16,39,41,'GMT+090807',9*3600+8*60+7,4]],
- [['Thu Jul 29 16:39:41 GMT-09 1999', '%a %b %d %H:%M:%S %Z %Y'], [1999,7,29,16,39,41,'GMT-09',-9*3600,4]],
- [['Thu Jul 29 16:39:41 GMT-09:08 1999', '%a %b %d %H:%M:%S %Z %Y'], [1999,7,29,16,39,41,'GMT-09:08',-9*3600-8*60,4]],
- [['Thu Jul 29 16:39:41 GMT-09:08:07 1999', '%a %b %d %H:%M:%S %Z %Y'], [1999,7,29,16,39,41,'GMT-09:08:07',-9*3600-8*60-7,4]],
- [['Thu Jul 29 16:39:41 GMT-3.5 1999', '%a %b %d %H:%M:%S %Z %Y'], [1999,7,29,16,39,41,'GMT-3.5',-3*3600-30*60,4]],
- [['Thu Jul 29 16:39:41 GMT-3,5 1999', '%a %b %d %H:%M:%S %Z %Y'], [1999,7,29,16,39,41,'GMT-3,5',-3*3600-30*60,4]],
- [['Thu Jul 29 16:39:41 Mountain Daylight Time 1999', '%a %b %d %H:%M:%S %Z %Y'], [1999,7,29,16,39,41,'Mountain Daylight Time',-6*3600,4]],
- [['Thu Jul 29 16:39:41 E. Australia Standard Time 1999', '%a %b %d %H:%M:%S %Z %Y'], [1999,7,29,16,39,41,'E. Australia Standard Time',10*3600,4]],
-
- # rfc822
- [['Thu, 29 Jul 1999 09:54:21 UT', '%a, %d %b %Y %H:%M:%S %Z'], [1999,7,29,9,54,21,'UT',0,4]],
- [['Thu, 29 Jul 1999 09:54:21 GMT', '%a, %d %b %Y %H:%M:%S %Z'], [1999,7,29,9,54,21,'GMT',0,4]],
- [['Thu, 29 Jul 1999 09:54:21 PDT', '%a, %d %b %Y %H:%M:%S %Z'], [1999,7,29,9,54,21,'PDT',-7*3600,4]],
- [['Thu, 29 Jul 1999 09:54:21 z', '%a, %d %b %Y %H:%M:%S %Z'], [1999,7,29,9,54,21,'z',0,4]],
- [['Thu, 29 Jul 1999 09:54:21 +0900', '%a, %d %b %Y %H:%M:%S %Z'], [1999,7,29,9,54,21,'+0900',9*3600,4]],
- [['Thu, 29 Jul 1999 09:54:21 +0430', '%a, %d %b %Y %H:%M:%S %Z'], [1999,7,29,9,54,21,'+0430',4*3600+30*60,4]],
- [['Thu, 29 Jul 1999 09:54:21 -0430', '%a, %d %b %Y %H:%M:%S %Z'], [1999,7,29,9,54,21,'-0430',-4*3600-30*60,4]],
- [['Thu, 29 Jul -1999 09:54:21 -0430', '%a, %d %b %Y %H:%M:%S %Z'], [-1999,7,29,9,54,21,'-0430',-4*3600-30*60,4]],
-
- # etc
- [['06-DEC-99', '%d-%b-%y'], [1999,12,6,nil,nil,nil,nil,nil,nil]],
- [['sUnDay oCtoBer 31 01', '%A %B %d %y'], [2001,10,31,nil,nil,nil,nil,nil,0]],
- [["October\t\n\v\f\r 15,\t\n\v\f\r99", '%B %d, %y'], [1999,10,15,nil,nil,nil,nil,nil,nil]],
- [["October\t\n\v\f\r 15,\t\n\v\f\r99", '%B%t%d,%n%y'], [1999,10,15,nil,nil,nil,nil,nil,nil]],
-
- [['09:02:11 AM', '%I:%M:%S %p'], [nil,nil,nil,9,2,11,nil,nil,nil]],
- [['09:02:11 A.M.', '%I:%M:%S %p'], [nil,nil,nil,9,2,11,nil,nil,nil]],
- [['09:02:11 PM', '%I:%M:%S %p'], [nil,nil,nil,21,2,11,nil,nil,nil]],
- [['09:02:11 P.M.', '%I:%M:%S %p'], [nil,nil,nil,21,2,11,nil,nil,nil]],
-
- [['12:33:44 AM', '%r'], [nil,nil,nil,0,33,44,nil,nil,nil]],
- [['01:33:44 AM', '%r'], [nil,nil,nil,1,33,44,nil,nil,nil]],
- [['11:33:44 AM', '%r'], [nil,nil,nil,11,33,44,nil,nil,nil]],
- [['12:33:44 PM', '%r'], [nil,nil,nil,12,33,44,nil,nil,nil]],
- [['01:33:44 PM', '%r'], [nil,nil,nil,13,33,44,nil,nil,nil]],
- [['11:33:44 PM', '%r'], [nil,nil,nil,23,33,44,nil,nil,nil]],
-
- [['11:33:44 PM AMT', '%I:%M:%S %p %Z'], [nil,nil,nil,23,33,44,'AMT',nil,nil]],
- [['11:33:44 P.M. AMT', '%I:%M:%S %p %Z'], [nil,nil,nil,23,33,44,'AMT',nil,nil]],
-
- [['fri1feb034pm+5', '%a%d%b%y%H%p%Z'], [2003,2,1,16,nil,nil,'+5',5*3600,5]]
- ].each do |x, y|
- h = Date._strptime(*x)
- a = h.values_at(:year,:mon,:mday,:hour,:min,:sec,:zone,:offset,:wday)
- if y[1] == -1
- a[1] = -1
- a[2] = h[:yday]
- end
- assert_equal(y, a, [x, y, a].inspect)
- end
- end
-
- def test__strptime__width
- [
- [['99', '%y'], [1999,nil,nil,nil,nil,nil,nil,nil,nil]],
- [['01', '%y'], [2001,nil,nil,nil,nil,nil,nil,nil,nil]],
- [['19 99', '%C %y'], [1999,nil,nil,nil,nil,nil,nil,nil,nil]],
- [['20 01', '%C %y'], [2001,nil,nil,nil,nil,nil,nil,nil,nil]],
- [['1999', '%C%y'], [1999,nil,nil,nil,nil,nil,nil,nil,nil]],
- [['2001', '%C%y'], [2001,nil,nil,nil,nil,nil,nil,nil,nil]],
-
- [['20060806', '%Y'], [20060806,nil,nil,nil,nil,nil,nil,nil,nil]],
- [['20060806', "%Y\s"], [20060806,nil,nil,nil,nil,nil,nil,nil,nil]],
- [['20060806', '%Y%m%d'], [2006,8,6,nil,nil,nil,nil,nil,nil]],
- [['2006908906', '%Y9%m9%d'], [2006,8,6,nil,nil,nil,nil,nil,nil]],
- [['12006 08 06', '%Y %m %d'], [12006,8,6,nil,nil,nil,nil,nil,nil]],
- [['12006-08-06', '%Y-%m-%d'], [12006,8,6,nil,nil,nil,nil,nil,nil]],
- [['200608 6', '%Y%m%e'], [2006,8,6,nil,nil,nil,nil,nil,nil]],
-
- [['2006333', '%Y%j'], [2006,-1,333,nil,nil,nil,nil,nil,nil]],
- [['20069333', '%Y9%j'], [2006,-1,333,nil,nil,nil,nil,nil,nil]],
- [['12006 333', '%Y %j'], [12006,-1,333,nil,nil,nil,nil,nil,nil]],
- [['12006-333', '%Y-%j'], [12006,-1,333,nil,nil,nil,nil,nil,nil]],
-
- [['232425', '%H%M%S'], [nil,nil,nil,23,24,25,nil,nil,nil]],
- [['23924925', '%H9%M9%S'], [nil,nil,nil,23,24,25,nil,nil,nil]],
- [['23 24 25', '%H %M %S'], [nil,nil,nil,23,24,25,nil,nil,nil]],
- [['23:24:25', '%H:%M:%S'], [nil,nil,nil,23,24,25,nil,nil,nil]],
- [[' 32425', '%k%M%S'], [nil,nil,nil,3,24,25,nil,nil,nil]],
- [[' 32425', '%l%M%S'], [nil,nil,nil,3,24,25,nil,nil,nil]],
-
- [['FriAug', '%a%b'], [nil,8,nil,nil,nil,nil,nil,nil,5]],
- [['FriAug', '%A%B'], [nil,8,nil,nil,nil,nil,nil,nil,5]],
- [['FridayAugust', '%A%B'], [nil,8,nil,nil,nil,nil,nil,nil,5]],
- [['FridayAugust', '%a%b'], [nil,8,nil,nil,nil,nil,nil,nil,5]]
- ].each do |x, y|
- h = Date._strptime(*x)
- a = h.values_at(:year,:mon,:mday,:hour,:min,:sec,:zone,:offset,:wday)
- if y[1] == -1
- a[1] = -1
- a[2] = h[:yday]
- end
- assert_equal(y, a, [x, y, a].inspect)
- end
- end
-
- def test__strptime__fail
- assert_not_nil(Date._strptime('2001.', '%Y.'))
- assert_not_nil(Date._strptime("2001.\s", '%Y.'))
- assert_not_nil(Date._strptime('2001.', "%Y.\s"))
- assert_not_nil(Date._strptime("2001.\s", "%Y.\s"))
-
- assert_nil(Date._strptime('2001', '%Y.'))
- assert_nil(Date._strptime("2001\s", '%Y.'))
- assert_nil(Date._strptime('2001', "%Y.\s"))
- assert_nil(Date._strptime("2001\s", "%Y.\s"))
-
- assert_nil(Date._strptime('2001-13-31', '%Y-%m-%d'))
- assert_nil(Date._strptime('2001-12-00', '%Y-%m-%d'))
- assert_nil(Date._strptime('2001-12-32', '%Y-%m-%d'))
- assert_nil(Date._strptime('2001-12-00', '%Y-%m-%e'))
- assert_nil(Date._strptime('2001-12-32', '%Y-%m-%e'))
- assert_nil(Date._strptime('2001-12-31', '%y-%m-%d'))
-
- assert_nil(Date._strptime('2004-000', '%Y-%j'))
- assert_nil(Date._strptime('2004-367', '%Y-%j'))
- assert_nil(Date._strptime('2004-366', '%y-%j'))
-
- assert_not_nil(Date._strptime('24:59:59', '%H:%M:%S'))
- assert_not_nil(Date._strptime('24:59:59', '%k:%M:%S'))
- assert_not_nil(Date._strptime('24:59:60', '%H:%M:%S'))
- assert_not_nil(Date._strptime('24:59:60', '%k:%M:%S'))
-
- assert_nil(Date._strptime('24:60:59', '%H:%M:%S'))
- assert_nil(Date._strptime('24:60:59', '%k:%M:%S'))
- assert_nil(Date._strptime('24:59:61', '%H:%M:%S'))
- assert_nil(Date._strptime('24:59:61', '%k:%M:%S'))
- assert_nil(Date._strptime('00:59:59', '%I:%M:%S'))
- assert_nil(Date._strptime('13:59:59', '%I:%M:%S'))
- assert_nil(Date._strptime('00:59:59', '%l:%M:%S'))
- assert_nil(Date._strptime('13:59:59', '%l:%M:%S'))
-
- assert_not_nil(Date._strptime('0', '%U'))
- assert_nil(Date._strptime('54', '%U'))
- assert_not_nil(Date._strptime('0', '%W'))
- assert_nil(Date._strptime('54', '%W'))
- assert_nil(Date._strptime('0', '%V'))
- assert_nil(Date._strptime('54', '%V'))
- assert_nil(Date._strptime('0', '%u'))
- assert_not_nil(Date._strptime('7', '%u'))
- assert_not_nil(Date._strptime('0', '%w'))
- assert_nil(Date._strptime('7', '%w'))
-
- assert_nil(Date._strptime('Sanday', '%A'))
- assert_nil(Date._strptime('Jenuary', '%B'))
- assert_not_nil(Date._strptime('Sundai', '%A'))
- assert_not_nil(Date._strptime('Januari', '%B'))
- assert_nil(Date._strptime('Sundai,', '%A,'))
- assert_nil(Date._strptime('Januari,', '%B,'))
- end
-
- def test_strptime
- assert_equal(Date.new, Date.strptime)
- d = Date.new(2002,3,14)
- assert_equal(d, Date.strptime(d.to_s))
- assert_equal(Date.new(2002,3,14), Date.strptime('2002-03-14'))
-
- d = DateTime.new(2002,3,14,11,22,33, 0)
- assert_equal(d, DateTime.strptime(d.to_s))
- assert_equal(DateTime.new(2002,3,14,11,22,33, 0),
- DateTime.strptime('2002-03-14T11:22:33Z'))
- assert_equal(DateTime.new(2002,3,14,11,22,33, 0),
- DateTime.strptime('2002-03-14T11:22:33Z', '%Y-%m-%dT%H:%M:%S%Z'))
- assert_equal(DateTime.new(2002,3,14,11,22,33, 9.to_r/24),
- DateTime.strptime('2002-03-14T11:22:33+09:00', '%Y-%m-%dT%H:%M:%S%Z'))
- assert_equal(DateTime.new(2002,3,14,11,22,33, -9.to_r/24),
- DateTime.strptime('2002-03-14T11:22:33-09:00', '%FT%T%Z'))
- assert_equal(DateTime.new(2002,3,14,11,22,33, -9.to_r/24) + 123456789.to_r/1000000000/86400,
- DateTime.strptime('2002-03-14T11:22:33.123456789-09:00', '%FT%T.%N%Z'))
- end
-
- def test_strptime__2
- n = 10**9
- (Date.new(2006,6,1)..Date.new(2007,6,1)).each do |d|
- [
- '%Y %m %d',
- '%C %y %m %d',
-
- '%Y %j',
- '%C %y %j',
-
- '%G %V %w',
- '%G %V %u',
- '%C %g %V %w',
- '%C %g %V %u',
-
- '%Y %U %w',
- '%Y %U %u',
- '%Y %W %w',
- '%Y %W %u',
- '%C %y %U %w',
- '%C %y %U %u',
- '%C %y %W %w',
- '%C %y %W %u',
- ].each do |fmt|
- s = d.strftime(fmt)
- d2 = Date.strptime(s, fmt)
- assert_equal(d, d2, [fmt, d.to_s, d2.to_s].inspect)
- end
-
- [
- '%Y %m %d %H %M %S',
- '%Y %m %d %H %M %S %N',
- '%C %y %m %d %H %M %S',
- '%C %y %m %d %H %M %S %N',
-
- '%Y %j %H %M %S',
- '%Y %j %H %M %S %N',
- '%C %y %j %H %M %S',
- '%C %y %j %H %M %S %N',
-
- '%s',
- '%s %N',
- '%Q',
- '%Q %N',
- ].each do |fmt|
- s = d.strftime(fmt)
- d2 = DateTime.strptime(s, fmt)
- assert_equal(d, d2, [fmt, d.to_s, d2.to_s].inspect)
- end
- end
- end
-
- def test_strptime__minus
- d = DateTime.strptime('-1', '%s')
- assert_equal([1969, 12, 31, 23, 59, 59],
- [d.year, d.mon, d.mday, d.hour, d.min, d.sec])
- d = DateTime.strptime('-86400', '%s')
- assert_equal([1969, 12, 31, 0, 0, 0],
- [d.year, d.mon, d.mday, d.hour, d.min, d.sec])
-
- d = DateTime.strptime('-999', '%Q')
- assert_equal([1969, 12, 31, 23, 59, 59, 1.to_r/10**3],
- [d.year, d.mon, d.mday, d.hour, d.min, d.sec, d.sec_fraction])
- d = DateTime.strptime('-1000', '%Q')
- assert_equal([1969, 12, 31, 23, 59, 59, 0],
- [d.year, d.mon, d.mday, d.hour, d.min, d.sec, d.sec_fraction])
- end
-
- def test_strptime__comp
- n = DateTime.now
-
- d = DateTime.strptime('073', '%j')
- assert_equal([n.year, 73, 0, 0, 0],
- [d.year, d.yday, d.hour, d.min, d.sec])
- d = DateTime.strptime('13', '%d')
- assert_equal([n.year, n.mon, 13, 0, 0, 0],
- [d.year, d.mon, d.mday, d.hour, d.min, d.sec])
-
- d = DateTime.strptime('Mar', '%b')
- assert_equal([n.year, 3, 1, 0, 0, 0],
- [d.year, d.mon, d.mday, d.hour, d.min, d.sec])
- d = DateTime.strptime('2004', '%Y')
- assert_equal([2004, 1, 1, 0, 0, 0],
- [d.year, d.mon, d.mday, d.hour, d.min, d.sec])
-
- d = DateTime.strptime('Mar 13', '%b %d')
- assert_equal([n.year, 3, 13, 0, 0, 0],
- [d.year, d.mon, d.mday, d.hour, d.min, d.sec])
- d = DateTime.strptime('Mar 2004', '%b %Y')
- assert_equal([2004, 3, 1, 0, 0, 0],
- [d.year, d.mon, d.mday, d.hour, d.min, d.sec])
- d = DateTime.strptime('23:55', '%H:%M')
- assert_equal([n.year, n.mon, n.mday, 23, 55, 0],
- [d.year, d.mon, d.mday, d.hour, d.min, d.sec])
- d = DateTime.strptime('23:55:30', '%H:%M:%S')
- assert_equal([n.year, n.mon, n.mday, 23, 55, 30],
- [d.year, d.mon, d.mday, d.hour, d.min, d.sec])
-
- d = DateTime.strptime('Sun 23:55', '%a %H:%M')
- d2 = d - d.wday
- assert_equal([d2.year, d2.mon, d2.mday, 23, 55, 0],
- [d.year, d.mon, d.mday, d.hour, d.min, d.sec])
- d = DateTime.strptime('Aug 23:55', '%b %H:%M')
- assert_equal([n.year, 8, 1, 23, 55, 0],
- [d.year, d.mon, d.mday, d.hour, d.min, d.sec])
-
- d = DateTime.strptime('2004', '%G')
- assert_equal([2004, 1, 1, 0, 0, 0],
- [d.cwyear, d.cweek, d.cwday, d.hour, d.min, d.sec])
- d = DateTime.strptime('11', '%V')
- assert_equal([n.cwyear, 11, 1, 0, 0, 0],
- [d.cwyear, d.cweek, d.cwday, d.hour, d.min, d.sec])
- d = DateTime.strptime('6', '%u')
- assert_equal([n.cwyear, n.cweek, 6, 0, 0, 0],
- [d.cwyear, d.cweek, d.cwday, d.hour, d.min, d.sec])
-
- d = DateTime.strptime('11-6', '%V-%u')
- assert_equal([n.cwyear, 11, 6, 0, 0, 0],
- [d.cwyear, d.cweek, d.cwday, d.hour, d.min, d.sec])
- d = DateTime.strptime('2004-11', '%G-%V')
- assert_equal([2004, 11, 1, 0, 0, 0],
- [d.cwyear, d.cweek, d.cwday, d.hour, d.min, d.sec])
-
- d = DateTime.strptime('11-6', '%U-%w')
- assert_equal([n.year, 11, 6, 0, 0, 0],
- [d.year, d.strftime('%U').to_i, d.wday, d.hour, d.min, d.sec])
- d = DateTime.strptime('2004-11', '%Y-%U')
- assert_equal([2004, 11, 0, 0, 0, 0],
- [d.year, d.strftime('%U').to_i, d.wday, d.hour, d.min, d.sec])
-
- d = DateTime.strptime('11-6', '%W-%w')
- assert_equal([n.year, 11, 6, 0, 0, 0],
- [d.year, d.strftime('%W').to_i, d.wday, d.hour, d.min, d.sec])
- d = DateTime.strptime('2004-11', '%Y-%W')
- assert_equal([2004, 11, 0, 0, 0, 0],
- [d.year, d.strftime('%W').to_i, d.wday, d.hour, d.min, d.sec])
- end
-
- def test_strptime__d_to_s
- d = Date.new(2002,3,14)
- assert_equal(d, Date.strptime(d.to_s))
-
- d = DateTime.new(2002,3,14,11,22,33, 9.to_r/24)
- assert_equal(d, DateTime.strptime(d.to_s))
- end
-
- def test_strptime__ex
- assert_raise(ArgumentError) do
- Date.strptime('2001-02-29', '%F')
- end
- assert_raise(ArgumentError) do
- DateTime.strptime('2001-02-29T23:59:60', '%FT%T')
- end
- assert_raise(ArgumentError) do
- Date.strptime('23:55', '%H:%M')
- end
- end
-
-end
diff --git a/test/dbm/test_dbm.rb b/test/dbm/test_dbm.rb
index 14fd83899e..941e139946 100644
--- a/test/dbm/test_dbm.rb
+++ b/test/dbm/test_dbm.rb
@@ -1,5 +1,4 @@
require 'test/unit'
-require 'tmpdir'
begin
require 'dbm'
@@ -13,7 +12,7 @@ if defined? DBM
class TestDBM < Test::Unit::TestCase
def TestDBM.uname_s
require 'rbconfig'
- case RbConfig::CONFIG['target_os']
+ case Config::CONFIG['target_os']
when 'cygwin'
require 'Win32API'
uname = Win32API.new('cygwin1', 'uname', 'P', 'I')
@@ -22,25 +21,23 @@ if defined? DBM
utsname.unpack('A20' * 5)[0]
else
- RbConfig::CONFIG['target_os']
+ Config::CONFIG['target_os']
end
end
SYSTEM = uname_s
def setup
- @tmpdir = Dir.mktmpdir("tmptest_dbm")
- @prefix = "tmptest_dbm_#{$$}"
- @path = "#{@tmpdir}/#{@prefix}_"
+ @path = "tmptest_dbm_"
assert_instance_of(DBM, @dbm = DBM.new(@path))
# prepare to make readonly DBM file
- DBM.open("#{@tmpdir}/#{@prefix}_rdonly") {|dbm|
+ DBM.open("tmptest_dbm_rdonly") {|dbm|
dbm['foo'] = 'FOO'
}
+
+ File.chmod(0400, *Dir.glob("tmptest_dbm_rdonly.*"))
- File.chmod(0400, *Dir.glob("#{@tmpdir}/#{@prefix}_rdonly.*"))
-
- assert_instance_of(DBM, @dbm_rdonly = DBM.new("#{@tmpdir}/#{@prefix}_rdonly", nil))
+ assert_instance_of(DBM, @dbm_rdonly = DBM.new("tmptest_dbm_rdonly", nil))
end
def teardown
assert_nil(@dbm.close)
@@ -48,7 +45,8 @@ if defined? DBM
ObjectSpace.each_object(DBM) do |obj|
obj.close unless obj.closed?
end
- FileUtils.remove_entry_secure @tmpdir
+ File.delete *Dir.glob("tmptest_dbm*").to_a
+ p Dir.glob("tmptest_dbm*") if $DEBUG
end
def check_size(expect, dbm=@dbm)
@@ -75,21 +73,21 @@ if defined? DBM
def test_s_new_has_no_block
# DBM.new ignore the block
foo = true
- assert_instance_of(DBM, dbm = DBM.new("#{@tmpdir}/#{@prefix}") { foo = false })
+ assert_instance_of(DBM, dbm = DBM.new("tmptest_dbm") { foo = false })
assert_equal(foo, true)
assert_nil(dbm.close)
end
def test_s_open_no_create
- assert_nil(dbm = DBM.open("#{@tmpdir}/#{@prefix}", nil))
+ assert_nil(dbm = DBM.open("tmptest_dbm", nil))
ensure
dbm.close if dbm
end
def test_s_open_with_block
- assert_equal(DBM.open("#{@tmpdir}/#{@prefix}") { :foo }, :foo)
+ assert_equal(DBM.open("tmptest_dbm") { :foo }, :foo)
end
def test_close
- assert_instance_of(DBM, dbm = DBM.open("#{@tmpdir}/#{@prefix}"))
+ assert_instance_of(DBM, dbm = DBM.open("tmptest_dbm"))
assert_nil(dbm.close)
# closed DBM file
@@ -160,12 +158,19 @@ if defined? DBM
}
end
- def test_key
+ def test_index
assert_equal('bar', @dbm['foo'] = 'bar')
- assert_equal('foo', @dbm.key('bar'))
+ assert_equal('foo', @dbm.index('bar'))
assert_nil(@dbm['bar'])
end
+ def test_indexes
+ keys = %w(foo bar baz)
+ values = %w(FOO BAR BAZ)
+ @dbm[keys[0]], @dbm[keys[1]], @dbm[keys[2]] = values
+ assert_equal(values.reverse, @dbm.indexes(*keys.reverse))
+ end
+
def test_values_at
keys = %w(foo bar baz)
values = %w(FOO BAR BAZ)
@@ -238,7 +243,7 @@ if defined? DBM
n = 0
ret = @dbm.each_value {|val|
- assert_not_nil(key = @dbm.key(val))
+ assert_not_nil(key = @dbm.index(val))
assert_not_nil(i = keys.index(key))
assert_equal(val, values[i])
@@ -334,11 +339,14 @@ if defined? DBM
def test_delete_with_block
key = 'no called block'
@dbm[key] = 'foo'
- assert_equal('foo', @dbm.delete(key) {|k| k.replace 'called block'; :blockval})
+ assert_equal('foo', @dbm.delete(key) {|k| k.replace 'called block'})
+ assert_equal('no called block', key)
assert_equal(0, @dbm.size)
key = 'no called block'
- assert_equal(:blockval, @dbm.delete(key) {|k| k.replace 'called block'; :blockval})
+ assert_equal(:blockval,
+ @dbm.delete(key) {|k| k.replace 'called block'; :blockval})
+ assert_equal('called block', key)
assert_equal(0, @dbm.size)
end
@@ -494,54 +502,32 @@ if defined? DBM
end
class TestDBM2 < Test::Unit::TestCase
+ TMPROOT = "#{Dir.tmpdir}/ruby-dbm.#{$$}"
+
def setup
- @tmproot = Dir.mktmpdir('ruby-dbm')
+ Dir.mkdir TMPROOT
end
def teardown
- FileUtils.remove_entry_secure @tmproot if File.directory?(@tmproot)
- end
-
- def test_reader_open_notexist
- assert_raise(Errno::ENOENT) {
- DBM.open("#{@tmproot}/a", 0666, DBM::READER)
- }
- end
-
- def test_writer_open_notexist
- assert_raise(Errno::ENOENT) {
- DBM.open("#{@tmproot}/a", 0666, DBM::WRITER)
- }
- end
-
- def test_wrcreat_open_notexist
- v = DBM.open("#{@tmproot}/a", 0666, DBM::WRCREAT)
- assert_instance_of(DBM, v)
- v.close
- end
-
- def test_newdb_open_notexist
- v = DBM.open("#{@tmproot}/a", 0666, DBM::NEWDB)
- assert_instance_of(DBM, v)
- v.close
+ FileUtils.rm_rf TMPROOT if File.directory?(TMPROOT)
end
def test_reader_open
- DBM.open("#{@tmproot}/a") {} # create a db.
- v = DBM.open("#{@tmproot}/a", nil, DBM::READER) {|d|
+ DBM.open("#{TMPROOT}/a") {}
+ v = DBM.open("#{TMPROOT}/a", nil, DBM::READER) {|d|
# Errno::EPERM is raised on Solaris which use ndbm.
- # DBMError is raised on Debian which use gdbm.
- assert_raise(Errno::EPERM, DBMError) { d["k"] = "v" }
+ # DBMError is raised on Debian which use gdbm.
+ assert_raises(Errno::EPERM, DBMError) { d["k"] = "v" }
true
}
assert(v)
end
def test_newdb_open
- DBM.open("#{@tmproot}/a") {|dbm|
+ DBM.open("#{TMPROOT}/a") {|dbm|
dbm["k"] = "v"
}
- v = DBM.open("#{@tmproot}/a", nil, DBM::NEWDB) {|d|
+ v = DBM.open("#{TMPROOT}/a", nil, DBM::NEWDB) {|d|
assert_equal(0, d.length)
assert_nil(d["k"])
true
@@ -550,9 +536,9 @@ if defined? DBM
end
def test_freeze
- DBM.open("#{@tmproot}/a") {|d|
+ DBM.open("#{TMPROOT}/a") {|d|
d.freeze
- assert_raise(RuntimeError) { d["k"] = "v" }
+ assert_raises(TypeError) { d["k"] = "v" }
}
end
end
diff --git a/test/digest/test_digest_hmac.rb b/test/digest/test_digest_hmac.rb
deleted file mode 100644
index a0d5d2f244..0000000000
--- a/test/digest/test_digest_hmac.rb
+++ /dev/null
@@ -1,3 +0,0 @@
-require 'pathname'
-require Pathname.new(__FILE__).dirname.join('../inlinetest.rb')
-InlineTest.loadtest__END__part('digest/hmac.rb')
diff --git a/test/dl/test_base.rb b/test/dl/test_base.rb
deleted file mode 100644
index 7eddbf8226..0000000000
--- a/test/dl/test_base.rb
+++ /dev/null
@@ -1,87 +0,0 @@
-require 'test/unit'
-require 'dl'
-require_relative '../ruby/envutil'
-
-libc_so = libm_so = nil
-
-case RUBY_PLATFORM
-when /cygwin/
- libc_so = "cygwin1.dll"
- libm_so = "cygwin1.dll"
-when /x86_64-linux/
- libc_so = "/lib64/libc.so.6"
- libm_so = "/lib64/libm.so.6"
-when /linux/
- libdir = '/lib'
- case [0].pack('L!').size
- when 4
- # 32-bit ruby
- libdir = '/lib32' if File.directory? '/lib32'
- when 8
- # 64-bit ruby
- libdir = '/lib64' if File.directory? '/lib64'
- end
- libc_so = File.join(libdir, "libc.so.6")
- libm_so = File.join(libdir, "libm.so.6")
-when /mingw/, /mswin/
- require "rbconfig"
- libc_so = libm_so = RbConfig::CONFIG["RUBY_SO_NAME"].split(/-/, 2)[0] + ".dll"
-when /darwin/
- libc_so = "/usr/lib/libc.dylib"
- libm_so = "/usr/lib/libm.dylib"
-when /bsd|dragonfly/
- libc_so = "/usr/lib/libc.so"
- libm_so = "/usr/lib/libm.so"
-else
- libc_so = ARGV[0] if ARGV[0] && ARGV[0][0] == ?/
- libm_so = ARGV[1] if ARGV[1] && ARGV[1][0] == ?/
- if( !(libc_so && libm_so) )
- $stderr.puts("libc and libm not found: #{$0} <libc> <libm>")
- end
-end
-
-libc_so = nil if !libc_so || (libc_so[0] == ?/ && !File.file?(libc_so))
-libm_so = nil if !libm_so || (libm_so[0] == ?/ && !File.file?(libm_so))
-
-if !libc_so || !libm_so
- ruby = EnvUtil.rubybin
- ldd = `ldd #{ruby}`
- #puts ldd
- libc_so = $& if !libc_so && %r{/\S*/libc\.so\S*} =~ ldd
- libm_so = $& if !libm_so && %r{/\S*/libm\.so\S*} =~ ldd
- #p [libc_so, libm_so]
-end
-
-DL::LIBC_SO = libc_so
-DL::LIBM_SO = libm_so
-
-module DL
- class TestBase < Test::Unit::TestCase
- include Math
- include DL
-
- def setup
- @libc = dlopen(LIBC_SO)
- @libm = dlopen(LIBM_SO)
- end
-
- def assert_match(expected, actual, message="")
- assert(expected === actual, message)
- end
-
- def assert_positive(actual)
- assert(actual > 0)
- end
-
- def assert_zero(actual)
- assert(actual == 0)
- end
-
- def assert_negative(actual)
- assert(actual < 0)
- end
-
- def test_empty()
- end
- end
-end
diff --git a/test/dl/test_dl2.rb b/test/dl/test_dl2.rb
deleted file mode 100644
index 3c854aea8f..0000000000
--- a/test/dl/test_dl2.rb
+++ /dev/null
@@ -1,111 +0,0 @@
-require 'test_base.rb'
-require 'dl/callback'
-
-module DL
-class TestDL < TestBase
- def test_call_int()
- cfunc = CFunc.new(@libc['atoi'], TYPE_INT, 'atoi')
- x = cfunc.call(["100"].pack("p").unpack("l!*"))
- assert_equal(100, x)
-
- cfunc = CFunc.new(@libc['atoi'], TYPE_INT, 'atoi')
- x = cfunc.call(["-100"].pack("p").unpack("l!*"))
- assert_equal(-100, x)
- end
-
- def test_call_long()
- cfunc = CFunc.new(@libc['atol'], TYPE_LONG, 'atol')
- x = cfunc.call(["100"].pack("p").unpack("l!*"))
- assert_equal(100, x)
- cfunc = CFunc.new(@libc['atol'], TYPE_LONG, 'atol')
- x = cfunc.call(["-100"].pack("p").unpack("l!*"))
- assert_equal(-100, x)
- end
-
- def test_call_double()
- cfunc = CFunc.new(@libc['atof'], TYPE_DOUBLE, 'atof')
- x = cfunc.call(["0.1"].pack("p").unpack("l!*"))
- assert_match(0.09..0.11, x)
-
- cfunc = CFunc.new(@libc['atof'], TYPE_DOUBLE, 'atof')
- x = cfunc.call(["-0.1"].pack("p").unpack("l!*"))
- assert_match(-0.11 .. -0.09, x)
- end
-
- def test_sin()
- cfunc = CFunc.new(@libm['sin'], TYPE_DOUBLE, 'sin')
- x = cfunc.call([3.14/2].pack("d").unpack("l!*"))
- assert_equal(x, Math.sin(3.14/2))
-
- cfunc = CFunc.new(@libm['sin'], TYPE_DOUBLE, 'sin')
- x = cfunc.call([-3.14/2].pack("d").unpack("l!*"))
- assert_equal(Math.sin(-3.14/2), x)
- end
-
- def test_strlen()
- cfunc = CFunc.new(@libc['strlen'], TYPE_INT, 'strlen')
- x = cfunc.call(["abc"].pack("p").unpack("l!*"))
- assert_equal("abc".size, x)
- end
-
- def test_strcpy()
- buff = "xxxx"
- str = "abc"
- cfunc = CFunc.new(@libc['strcpy'], TYPE_VOIDP, 'strcpy')
- x = cfunc.call([buff,str].pack("pp").unpack("l!*"))
- assert_equal("abc\0", buff)
- assert_equal("abc\0", CPtr.new(x).to_s(4))
-
- buff = "xxxx"
- str = "abc"
- cfunc = CFunc.new(@libc['strncpy'], TYPE_VOIDP, 'strncpy')
- x = cfunc.call([buff,str,3].pack("ppL!").unpack("l!*"))
- assert_equal("abcx", buff)
- assert_equal("abcx", CPtr.new(x).to_s(4))
-
- ptr = CPtr.malloc(4)
- str = "abc"
- cfunc = CFunc.new(@libc['strcpy'], TYPE_VOIDP, 'strcpy')
- x = cfunc.call([ptr.to_i,str].pack("l!p").unpack("l!*"))
- assert_equal("abc\0", ptr[0,4])
- assert_equal("abc\0", CPtr.new(x).to_s(4))
- end
-
- def test_callback()
- buff = "foobarbaz"
- cb = set_callback(TYPE_INT,2){|x,y| CPtr.new(x)[0] <=> CPtr.new(y)[0]}
- cfunc = CFunc.new(@libc['qsort'], TYPE_VOID, 'qsort')
- cfunc.call([buff, buff.size, 1, cb].pack("pL!L!L!").unpack("l!*"))
- assert_equal('aabbfoorz', buff)
- end
-
- def test_dlwrap()
- ary = [0,1,2,4,5]
- addr = dlwrap(ary)
- ary2 = dlunwrap(addr)
- assert_equal(ary, ary2)
- end
-
- def test_cptr()
- check = Proc.new{|str,ptr|
- assert_equal(str.size(), ptr.size())
- assert_equal(str, ptr.to_s())
- assert_equal(str[0,2], ptr.to_s(2))
- assert_equal(str[0,2], ptr[0,2])
- assert_equal(str[1,2], ptr[1,2])
- assert_equal(str[1,0], ptr[1,0])
- assert_equal(str[0].ord, ptr[0])
- assert_equal(str[1].ord, ptr[1])
- }
- str = 'abc'
- ptr = CPtr[str]
- check.call(str, ptr)
- str[0] = "c"
- ptr[0] = "c".ord
- check.call(str, ptr)
- str[0,2] = "aa"
- ptr[0,2] = "aa"
- check.call(str, ptr)
- end
-end
-end # module DL
diff --git a/test/dl/test_func.rb b/test/dl/test_func.rb
deleted file mode 100644
index be937719df..0000000000
--- a/test/dl/test_func.rb
+++ /dev/null
@@ -1,62 +0,0 @@
-require 'test_base'
-require 'dl/func'
-
-module DL
- class TestFunc < TestBase
- def test_strcpy()
- f = Function.new(CFunc.new(@libc['strcpy'], TYPE_VOIDP, 'strcpy'),
- [TYPE_VOIDP, TYPE_VOIDP])
- buff = "000"
- str = f.call(buff, "123")
- assert_equal("123", buff)
- assert_equal("123", str.to_s)
- end
-
- def test_isdigit()
- f = Function.new(CFunc.new(@libc['isdigit'], TYPE_INT, 'isdigit'),
- [TYPE_INT])
- r1 = f.call(?1.ord)
- r2 = f.call(?2.ord)
- rr = f.call(?r.ord)
- assert_positive(r1)
- assert_positive(r2)
- assert_zero(rr)
- end
-
- def test_atof()
- f = Function.new(CFunc.new(@libc['atof'], TYPE_DOUBLE, 'atof'),
- [TYPE_VOIDP])
- r = f.call("12.34")
- assert_match(12.00..13.00, r)
- end
-
- def test_strtod()
- f = Function.new(CFunc.new(@libc['strtod'], TYPE_DOUBLE, 'strtod'),
- [TYPE_VOIDP, TYPE_VOIDP])
- buff1 = "12.34"
- buff2 = " "
- r = f.call(buff1, buff2)
- assert_match(12.00..13.00, r)
- end
-
- def test_qsort1()
- cb = Function.new(CFunc.new(0, TYPE_INT, '<callback>qsort'),
- [TYPE_VOIDP, TYPE_VOIDP]){|x,y| CPtr.new(x)[0] <=> CPtr.new(y)[0]}
- qsort = Function.new(CFunc.new(@libc['qsort'], TYPE_VOID, 'qsort'),
- [TYPE_VOIDP, TYPE_INT, TYPE_INT, TYPE_VOIDP])
- buff = "9341"
- qsort.call(buff, buff.size, 1, cb)
- assert_equal("1349", buff)
- end
-
- def test_qsort2()
- cb = TempFunction.new(CFunc.new(0, TYPE_INT, '<callback>qsort'),
- [TYPE_VOIDP, TYPE_VOIDP])
- qsort = Function.new(CFunc.new(@libc['qsort'], TYPE_VOID, 'qsort'),
- [TYPE_VOIDP, TYPE_INT, TYPE_INT, TYPE_VOIDP])
- buff = "9341"
- qsort.call(buff, buff.size, 1, cb){|x,y| CPtr.new(x)[0] <=> CPtr.new(y)[0]}
- assert_equal("1349", buff)
- end
- end
-end
diff --git a/test/dl/test_import.rb b/test/dl/test_import.rb
deleted file mode 100644
index c70cb9a6d0..0000000000
--- a/test/dl/test_import.rb
+++ /dev/null
@@ -1,154 +0,0 @@
-require 'test_base'
-require 'dl/import'
-
-module DL
- module LIBC
- extend Importer
- dlload LIBC_SO, LIBM_SO
-
- typealias 'string', 'char*'
- typealias 'FILE*', 'void*'
-
- extern "void *strcpy(char*, char*)"
- extern "int isdigit(int)"
- extern "double atof(string)"
- extern "unsigned long strtoul(char*, char **, int)"
- extern "int qsort(void*, unsigned long, unsigned long, void*)"
- extern "int fprintf(FILE*, char*)"
- extern "int gettimeofday(timeval*, timezone*)" rescue nil
-
- QsortCallback = bind("void *qsort_callback(void*, void*)", :temp)
- BoundQsortCallback = bind("void *qsort_callback(void*, void*)"){|ptr1,ptr2| ptr1[0] <=> ptr2[0]}
- Timeval = struct [
- "long tv_sec",
- "long tv_usec",
- ]
- Timezone = struct [
- "int tz_minuteswest",
- "int tz_dsttime",
- ]
- MyStruct = struct [
- "short num[5]",
- "char c",
- "unsigned char buff[7]",
- ]
-
- CallCallback = bind("void call_callback(void*, void*)"){|ptr1, ptr2|
- f = Function.new(CFunc.new(ptr1.to_i, DL::TYPE_VOID, "<anonymous>"), [TYPE_VOIDP])
- f.call(ptr2)
- }
- CarriedFunction = bind("void callback_function(void*)", :carried, 0)
- end
-
- class TestImport < TestBase
- def test_malloc()
- s1 = LIBC::Timeval.malloc()
- s2 = LIBC::Timeval.malloc()
- assert_not_equal(s1.to_ptr.to_i, s2.to_ptr.to_i)
- end
-
- def test_sizeof()
- assert_equal(DL::SIZEOF_VOIDP, LIBC.sizeof("FILE*"))
- assert_equal(LIBC::MyStruct.size(), LIBC.sizeof(LIBC::MyStruct))
- end
-
- def test_unsigned_result()
- d = (2 ** 31) + 1
-
- r = LIBC.strtoul(d.to_s, 0, 0)
- assert_equal(d, r)
- end
-
- def test_io()
- if( RUBY_PLATFORM != DL::BUILD_RUBY_PLATFORM )
- return
- end
- io_in,io_out = IO.pipe()
- LIBC.fprintf(io_out, "hello")
- io_out.flush()
- io_out.close()
- str = io_in.read()
- io_in.close()
- assert_equal("hello", str)
- end
-
- def test_value()
- i = LIBC.value('int', 2)
- assert_equal(2, i.value)
-
- d = LIBC.value('double', 2.0)
- assert_equal(2.0, d.value)
-
- ary = LIBC.value('int[3]', [0,1,2])
- assert_equal([0,1,2], ary.value)
- end
-
- def test_carried_function()
- data1 = "data"
- data2 = nil
- LIBC.call_callback(LIBC::CarriedFunction, LIBC::CarriedFunction.create_carrier(data1)){|d|
- data2 = d
- }
- assert_equal(data1, data2)
- end
-
- def test_struct()
- s = LIBC::MyStruct.malloc()
- s.num = [0,1,2,3,4]
- s.c = ?a.ord
- s.buff = "012345\377"
- assert_equal([0,1,2,3,4], s.num)
- assert_equal(?a.ord, s.c)
- assert_equal([?0.ord,?1.ord,?2.ord,?3.ord,?4.ord,?5.ord,?\377.ord], s.buff)
- end
-
- def test_gettimeofday()
- if( defined?(LIBC.gettimeofday) )
- timeval = LIBC::Timeval.malloc()
- timezone = LIBC::Timezone.malloc()
- LIBC.gettimeofday(timeval, timezone)
- cur = Time.now()
- assert(cur.to_i - 2 <= timeval.tv_sec && timeval.tv_sec <= cur.to_i)
- end
- end
-
- def test_strcpy()
- buff = "000"
- str = LIBC.strcpy(buff, "123")
- assert_equal("123", buff)
- assert_equal("123", str.to_s)
- end
-
- def test_isdigit()
- r1 = LIBC.isdigit(?1.ord)
- r2 = LIBC.isdigit(?2.ord)
- rr = LIBC.isdigit(?r.ord)
- assert_positive(r1)
- assert_positive(r2)
- assert_zero(rr)
- end
-
- def test_atof()
- r = LIBC.atof("12.34")
- assert_match(12.00..13.00, r)
- end
-
- def test_strtod()
- f = Function.new(CFunc.new(@libc['strtod'], TYPE_DOUBLE, 'strtod'),
- [TYPE_VOIDP, TYPE_VOIDP])
- buff1 = "12.34"
- buff2 = " "
- r = f.call(buff1, buff2)
- assert_match(12.00..13.00, r)
- end
-
- def test_qsort()
- buff = "9341"
- LIBC.qsort(buff, buff.size, 1, LIBC::QsortCallback){|ptr1,ptr2| ptr1[0] <=> ptr2[0]}
- assert_equal("1349", buff)
- buff = "9341"
- LIBC.qsort(buff, buff.size, 1, LIBC::BoundQsortCallback)
- assert_equal("1349", buff)
- end
- end
-end
diff --git a/test/dl/test_win32.rb b/test/dl/test_win32.rb
deleted file mode 100644
index 32beb2703f..0000000000
--- a/test/dl/test_win32.rb
+++ /dev/null
@@ -1,54 +0,0 @@
-require 'test_base'
-require 'dl/import'
-require 'dl/types'
-
-class DL::TestWin32 < DL::TestBase
-module Win32API
- extend DL::Importer
-
- dlload "kernel32.dll"
-
- include DL::Win32Types
-
- OSVERSIONINFO = struct [
- "DWORD dwOSVersionInfoSize",
- "DWORD dwMajorVersion",
- "DWORD dwMinorVersion",
- "DWORD dwBuildNumber",
- "DWORD dwPlatformId",
- "UCHAR szCSDVersion[128]",
- ]
-
- typealias "POSVERSIONINFO", "OSVERSIONINFO*"
-
- extern "BOOL GetVersionEx(POSVERSIONINFO)", :stdcall
-
- def get_version_ex()
- ptr = OSVERSIONINFO.malloc()
- ptr.dwOSVersionInfoSize = OSVERSIONINFO.size
- ret = GetVersionEx(ptr)
- if( ret )
- ptr
- else
- nil
- end
- end
- module_function :get_version_ex
-rescue DL::DLError
-end
-
-if defined?(Win32API::OSVERSIONINFO)
- def test_version()
- platform = Win32API.get_version_ex().dwPlatformId
- case ENV['OS']
- when 'Windows_NT'
- expect = 2
- when /Windows.+/
- expect = 1
- else
- expect = 0
- end
- assert_equal(expect, platform)
- end
-end
-end
diff --git a/test/drb/drbtest.rb b/test/drb/drbtest.rb
index e1d3aeedf2..bc16ab1ca2 100644
--- a/test/drb/drbtest.rb
+++ b/test/drb/drbtest.rb
@@ -98,7 +98,7 @@ module DRbCore
assert_equal(6, @there.sample(onecky, 1, 2))
ary = @there.to_a
assert_kind_of(DRb::DRbObject, ary)
-
+
assert(@there.respond_to?(:to_a, true))
assert(@there.respond_to?(:eval, true))
assert(! @there.respond_to?(:eval, false))
@@ -127,23 +127,23 @@ module DRbCore
assert_equal('DRbEx', obj.name)
end
- assert_raise(DRb::DRbUnknownError) do
+ assert_raises(DRb::DRbUnknownError) do
@there.unknown_error
end
onecky = FailOnecky.new('3')
- assert_raise(FailOnecky::OneckyError) do
+ assert_raises(FailOnecky::OneckyError) do
@there.sample(onecky, 1, 2)
end
end
def test_03
assert_equal(8, @there.sum(1, 1, 1, 1, 1, 1, 1, 1))
- assert_raise(ArgumentError) do
+ assert_raises(ArgumentError) do
@there.sum(1, 1, 1, 1, 1, 1, 1, 1, 1)
end
- assert_raise(DRb::DRbConnError) do
+ assert_raises(DRb::DRbConnError) do
@there.sum('1' * 4096)
end
end
@@ -168,10 +168,10 @@ module DRbCore
def test_06_timeout
ten = Onecky.new(10)
- assert_raise(TimeoutError) do
+ assert_raises(TimeoutError) do
@there.do_timeout(ten)
end
- assert_raise(TimeoutError) do
+ assert_raises(TimeoutError) do
@there.do_timeout(ten)
end
end
@@ -179,7 +179,7 @@ module DRbCore
def test_07_public_private_protected_missing
assert_nothing_raised() {
begin
- @there.method_missing(:eval, 'nil')
+ @there.method_missing(:eval)
rescue NoMethodError
assert_match(/^private method \`eval\'/, $!.message)
end
@@ -208,7 +208,7 @@ module DRbCore
assert_match(/^undefined method \`undefined_method_test\'/, $!.message)
end
}
- assert_raise(DRb::DRbConnError) do
+ assert_raises(SecurityError) do
@there.method_missing(:__send__, :to_s)
end
assert_equal(true, @there.missing)
@@ -261,7 +261,7 @@ module DRbCore
end
def test_11_remote_no_method_error
- assert_raise(DRb::DRbRemoteError) do
+ assert_raises(DRb::DRbRemoteError) do
@there.remote_no_method_error
end
begin
@@ -305,19 +305,18 @@ module DRbAry
assert_equal([1, 2, 'III', 'III', 4, 'five', 6], ary)
end
- # retry in block is not supported on ruby 1.9
- #def test_04_retry
- # retried = false
- # ary = []
- # @there.each do |x|
- # ary.push x
- # if x == 4 && !retried
- # retried = true
- # retry
- # end
- # end
- # assert_equal([1, 2, 'III', 4, 1, 2, 'III', 4, 'five', 6], ary)
- #end
+ def test_04_retry
+ retried = false
+ ary = []
+ @there.each do |x|
+ ary.push x
+ if x == 4 && !retried
+ retried = true
+ retry
+ end
+ end
+ assert_equal([1, 2, 'III', 4, 1, 2, 'III', 4, 'five', 6], ary)
+ end
def test_05_break
ary = []
diff --git a/test/drb/test_acl.rb b/test/drb/test_acl.rb
index 7fe30f4c4a..d8955e0e75 100644
--- a/test/drb/test_acl.rb
+++ b/test/drb/test_acl.rb
@@ -192,4 +192,4 @@ class ACLTest < Test::Unit::TestCase
end
end
-
+
diff --git a/test/drb/test_drb.rb b/test/drb/test_drb.rb
index 0548dc7aa0..5719f60b80 100644
--- a/test/drb/test_drb.rb
+++ b/test/drb/test_drb.rb
@@ -18,11 +18,11 @@ class TestDRbYield < Test::Unit::TestCase
@there.echo_yield_1([]) {|one|
assert_equal([], one)
}
-
+
@there.echo_yield_1(1) {|one|
assert_equal(1, one)
}
-
+
@there.echo_yield_1(nil) {|one|
assert_equal(nil, one)
}
@@ -113,7 +113,7 @@ class TestDRbYield < Test::Unit::TestCase
end
end
-class TestDRbRubyYield < TestDRbYield
+class TestRubyYield < TestDRbYield
def echo_yield(*arg)
yield(*arg)
end
@@ -140,25 +140,25 @@ class TestDRbRubyYield < TestDRbYield
def setup
@there = self
end
-
+
def teardown
end
end
-class TestDRbRuby18Yield < TestDRbRubyYield
+class TestRuby18Yield < TestRubyYield
class YieldTest18
def echo_yield(*arg, &proc)
proc.call(*arg)
end
-
+
def echo_yield_0(&proc)
proc.call
end
-
+
def echo_yield_1(a, &proc)
proc.call(a)
end
-
+
def echo_yield_2(a, b, &proc)
proc.call(a, b)
end
@@ -207,7 +207,7 @@ class TestDRbSafe1 < TestDRbAry
end
end
-class TestDRbEval # < Test::Unit::TestCase
+class TestDRbEval < Test::Unit::TestCase
def setup
super
@ext = DRbService.ext_service('ut_eval.rb')
@@ -217,40 +217,40 @@ class TestDRbEval # < Test::Unit::TestCase
def teardown
@ext.stop_service if @ext
end
-
+
def test_01_safe1_safe4_eval
- assert_raise(SecurityError) do
+ assert_raises(SecurityError) do
@there.method_missing(:instance_eval, 'ENV.inspect')
end
- assert_raise(SecurityError) do
+ assert_raises(SecurityError) do
@there.method_missing(:send, :eval, 'ENV.inspect')
end
remote_class = @there.remote_class
- assert_raise(SecurityError) do
+ assert_raises(SecurityError) do
remote_class.class_eval('ENV.inspect')
end
- assert_raise(SecurityError) do
+ assert_raises(SecurityError) do
remote_class.module_eval('ENV.inspect')
end
four = @there.four
assert_equal(1, four.method_missing(:send, :eval, '1'))
-
+
remote_class = four.remote_class
assert_equal(1, remote_class.class_eval('1'))
assert_equal(1, remote_class.module_eval('1'))
- assert_raise(SecurityError) do
+ assert_raises(SecurityError) do
remote_class.class_eval('ENV = {}')
end
- assert_raise(SecurityError) do
+ assert_raises(SecurityError) do
remote_class.module_eval('ENV = {}')
end
end
@@ -283,7 +283,7 @@ class TestDRbLarge < Test::Unit::TestCase
end
def test_04_many_arg
- assert_raise(ArgumentError) {
+ assert_raises(ArgumentError) {
@there.arg_test(1, 2, 3, 4, 5, 6, 7, 8, 9, 0)
}
end
@@ -292,7 +292,7 @@ class TestDRbLarge < Test::Unit::TestCase
ary = ["Hello, World"] * 102400
exception = nil
begin
- @there.size(ary)
+ @there.size(ary)
rescue StandardError
exception = $!
end
diff --git a/test/drb/ut_large.rb b/test/drb/ut_large.rb
index 9545f78f4b..d6717c5589 100644
--- a/test/drb/ut_large.rb
+++ b/test/drb/ut_large.rb
@@ -6,7 +6,7 @@ class DRbLarge
include DRbUndumped
def size(ary)
- ary.size
+ ary.size
end
def sum(ary)
diff --git a/test/drb/ut_safe1.rb b/test/drb/ut_safe1.rb
index 97b4df24ab..4df8e1e5a1 100644
--- a/test/drb/ut_safe1.rb
+++ b/test/drb/ut_safe1.rb
@@ -8,7 +8,7 @@ if __FILE__ == $0
it
end
- DRb.start_service('druby://localhost:0', [1, 2, 'III', 4, "five", 6],
+ DRb.start_service('druby://localhost:0', [1, 2, 'III', 4, "five", 6],
{:safe_level => 1})
es = DRb::ExtServ.new(ARGV.shift, ARGV.shift)
DRb.thread.join
diff --git a/test/drb/ut_timerholder.rb b/test/drb/ut_timerholder.rb
index 6f66dd3393..141cb73302 100644
--- a/test/drb/ut_timerholder.rb
+++ b/test/drb/ut_timerholder.rb
@@ -34,7 +34,7 @@ class TimerHolderTest < RUNIT::TestCase
assert(!holder.include?(key))
holder.delete(key)
end
-
+
def test_00
do_test(0.5)
end
diff --git a/test/erb/test_erb.rb b/test/erb/test_erb.rb
index 05d255623a..4f2f5bec19 100644
--- a/test/erb/test_erb.rb
+++ b/test/erb/test_erb.rb
@@ -9,7 +9,7 @@ class TestERB < Test::Unit::TestCase
e = assert_raise(MyError) {
erb.result
}
- assert_match(/\A\(erb\):1\b/, e.backtrace[0])
+ assert_equal("(erb):1", e.backtrace[0])
end
def test_with_filename
@@ -18,7 +18,7 @@ class TestERB < Test::Unit::TestCase
e = assert_raise(MyError) {
erb.result
}
- assert_match(/\Atest filename:1\b/, e.backtrace[0])
+ assert_equal("test filename:1", e.backtrace[0])
end
def test_without_filename_with_safe_level
@@ -26,7 +26,7 @@ class TestERB < Test::Unit::TestCase
e = assert_raise(MyError) {
erb.result
}
- assert_match(/\A\(erb\):1\b/, e.backtrace[0])
+ assert_equal("(erb):1", e.backtrace[0])
end
def test_with_filename_and_safe_level
@@ -35,7 +35,7 @@ class TestERB < Test::Unit::TestCase
e = assert_raise(MyError) {
erb.result
}
- assert_match(/\Atest filename:1\b/, e.backtrace[0])
+ assert_equal("test filename:1", e.backtrace[0])
end
end
@@ -73,7 +73,7 @@ class TestERBCore < Test::Unit::TestCase
* <%= n %>
<% end %>
EOS
-
+
ans = <<EOS
%% hi
= hello
@@ -118,7 +118,7 @@ EOS
% n=0
* 2
EOS
-
+
erb = @erb.new(src, safe, 2)
assert_equal(ans, erb.result)
erb = @erb.new(src, safe, '<>')
@@ -220,7 +220,7 @@ EOS
assert_equal(ans, ERB.new(src, nil, '%').result)
end
- def test_def_erb_method
+ def test_def_method
klass = Class.new
klass.module_eval do
extend ERB::DefMethod
@@ -234,31 +234,7 @@ EOS
klass.module_eval do
def_erb_method('hello_world', erb)
end
- assert(klass.new.respond_to?('hello_world'))
- end
-
- def test_def_method_without_filename
- klass = Class.new
- erb = ERB.new("<% raise ::TestERB::MyError %>")
- erb.filename = "test filename"
- assert(! klass.new.respond_to?('my_error'))
- erb.def_method(klass, 'my_error')
- e = assert_raise(::TestERB::MyError) {
- klass.new.my_error
- }
- assert_match(/\A\(ERB\):1\b/, e.backtrace[0])
- end
-
- def test_def_method_with_fname
- klass = Class.new
- erb = ERB.new("<% raise ::TestERB::MyError %>")
- erb.filename = "test filename"
- assert(! klass.new.respond_to?('my_error'))
- erb.def_method(klass, 'my_error', 'test fname')
- e = assert_raise(::TestERB::MyError) {
- klass.new.my_error
- }
- assert_match(/\Atest fname:1\b/, e.backtrace[0])
+ assert(klass.new.respond_to?('hello_world'))
end
def test_escape
@@ -311,7 +287,7 @@ EOS
erb.result
assert(false)
rescue
- assert_match(/\A\(erb\):4\b/, $@[0].to_s)
+ assert_equal("(erb):4", $@[0].to_s)
end
src = <<EOS
@@ -358,7 +334,7 @@ EOS
erb.result
assert(false)
rescue
- assert_match(/\A\(erb\):5\b/, $@[0].to_s)
+ assert_equal("(erb):5", $@[0].to_s)
end
erb = ERB.new(src, nil, '>')
@@ -366,7 +342,7 @@ EOS
erb.result
assert(false)
rescue
- assert_match(/\A\(erb\):5\b/, $@[0].to_s)
+ assert_equal("(erb):5", $@[0].to_s)
end
erb = ERB.new(src, nil, '<>')
@@ -374,7 +350,7 @@ EOS
erb.result
assert(false)
rescue
- assert_match(/\A\(erb\):5\b/, $@[0].to_s)
+ assert_equal("(erb):5", $@[0].to_s)
end
src = <<EOS
@@ -390,7 +366,7 @@ EOS
erb.result
assert(false)
rescue
- assert_match(/\A\(erb\):5\b/, $@[0].to_s)
+ assert_equal("(erb):5", $@[0].to_s)
end
erb = ERB.new(src, nil, '%-')
@@ -398,7 +374,7 @@ EOS
erb.result
assert(false)
rescue
- assert_match(/\A\(erb\):5\b/, $@[0].to_s)
+ assert_equal("(erb):5", $@[0].to_s)
end
end
@@ -435,14 +411,6 @@ EOS
assert_equal(ans, ERB.new(src, nil, '-%').result)
end
- def test_url_encode
- assert_equal("Programming%20Ruby%3A%20%20The%20Pragmatic%20Programmer%27s%20Guide",
- ERB::Util.url_encode("Programming Ruby: The Pragmatic Programmer's Guide"))
-
- assert_equal("%A5%B5%A5%F3%A5%D7%A5%EB",
- ERB::Util.url_encode("\xA5\xB5\xA5\xF3\xA5\xD7\xA5\xEB".force_encoding("EUC-JP")))
- end
-
def test_percent_after_etag
assert_equal("1%", @erb.new("<%= 1 %>%", nil, "%").result)
end
diff --git a/test/erb/test_erb_m17n.rb b/test/erb/test_erb_m17n.rb
deleted file mode 100644
index 640b1e6c51..0000000000
--- a/test/erb/test_erb_m17n.rb
+++ /dev/null
@@ -1,123 +0,0 @@
-# -*- coding: UTF-8 -*-
-require 'test/unit'
-require 'erb'
-
-class TestERB < Test::Unit::TestCase
- def test_result_encoding
- erb = ERB.new("hello")
- assert_equal __ENCODING__, erb.result.encoding
-
- erb = ERB.new("こんにちは".encode("EUC-JP"))
- assert_equal Encoding::EUC_JP, erb.result.encoding
-
- erb = ERB.new("\xC4\xE3\xBA\xC3".force_encoding("EUC-CN"))
- assert_equal Encoding::EUC_CN, erb.result.encoding
-
- erb = ERB.new("γεια σας".encode("ISO-8859-7"))
- assert_equal Encoding::ISO_8859_7, erb.result.encoding
-
- assert_raise(ArgumentError, /ASCII compatible/) {
- ERB.new("こんにちは".force_encoding("ISO-2022-JP")) # dummy encoding
- }
- end
-
- def test_generate_magic_comment
- erb = ERB.new("hello")
- assert_match /#coding:UTF-8/, erb.src
-
- erb = ERB.new("hello".force_encoding("EUC-JP"))
- assert_match /#coding:EUC-JP/, erb.src
-
- erb = ERB.new("hello".force_encoding("ISO-8859-9"))
- assert_match /#coding:ISO-8859-9/, erb.src
- end
-
- def test_literal_encoding
- erb = ERB.new("literal encoding is <%= 'hello'.encoding %>")
- assert_match /literal encoding is UTF-8/, erb.result
-
- erb = ERB.new("literal encoding is <%= 'こんにちは'.encoding %>".encode("EUC-JP"))
- assert_match /literal encoding is EUC-JP/, erb.result
-
- erb = ERB.new("literal encoding is <%= '\xC4\xE3\xBA\xC3'.encoding %>".force_encoding("EUC-CN"))
- assert_match /literal encoding is GB2312/, erb.result
- end
-
- def test___ENCODING__
- erb = ERB.new("__ENCODING__ is <%= __ENCODING__ %>")
- assert_match /__ENCODING__ is UTF-8/, erb.result
-
- erb = ERB.new("__ENCODING__ is <%= __ENCODING__ %>".force_encoding("EUC-JP"))
- assert_match /__ENCODING__ is EUC-JP/, erb.result
-
- erb = ERB.new("__ENCODING__ is <%= __ENCODING__ %>".force_encoding("Big5"))
- assert_match /__ENCODING__ is Big5/, erb.result
- end
-
- def test_recognize_magic_comment
- erb = ERB.new(<<-EOS.encode("EUC-KR"))
-<%# -*- coding: EUC-KR -*- %>
-안녕하세요
- EOS
- assert_match /#coding:EUC-KR/, erb.src
- assert_equal Encoding::EUC_KR, erb.result.encoding
-
- erb = ERB.new(<<-EOS.encode("EUC-KR").force_encoding("ASCII-8BIT"))
-<%#-*- coding: EUC-KR -*-%>
-안녕하세요
- EOS
- assert_match /#coding:EUC-KR/, erb.src
- assert_equal Encoding::EUC_KR, erb.result.encoding
-
- erb = ERB.new(<<-EOS.encode("EUC-KR").force_encoding("ASCII-8BIT"))
-<%# vim: tabsize=8 encoding=EUC-KR shiftwidth=2 expandtab %>
-안녕하세요
- EOS
- assert_match /#coding:EUC-KR/, erb.src
- assert_equal Encoding::EUC_KR, erb.result.encoding
-
- erb = ERB.new(<<-EOS.encode("EUC-KR").force_encoding("ASCII-8BIT"))
-<%#coding:EUC-KR %>
-안녕하세요
- EOS
- assert_match /#coding:EUC-KR/, erb.src
- assert_equal Encoding::EUC_KR, erb.result.encoding
-
- erb = ERB.new(<<-EOS.encode("EUC-KR").force_encoding("EUC-JP"))
-<%#coding:EUC-KR %>
-안녕하세요
- EOS
- assert_match /#coding:EUC-KR/, erb.src
- assert_equal Encoding::EUC_KR, erb.result.encoding
- end
-
- module M; end
- def test_method_with_encoding
- obj = Object.new
- obj.extend(M)
-
- erb = ERB.new(<<-EOS.encode("EUC-JP").force_encoding("ASCII-8BIT"))
-<%#coding:EUC-JP %>
-literal encoding is <%= 'こんにちは'.encoding %>
-__ENCODING__ is <%= __ENCODING__ %>
- EOS
- erb.def_method(M, :m_from_magic_comment)
-
- result = obj.m_from_magic_comment
- assert_equal Encoding::EUC_JP, result.encoding
- assert_match /literal encoding is EUC-JP/, result
- assert_match /__ENCODING__ is EUC-JP/, result
-
- erb = ERB.new(<<-EOS.encode("EUC-KR"))
-literal encoding is <%= '안녕하세요'.encoding %>
-__ENCODING__ is <%= __ENCODING__ %>
-EOS
- erb.def_method(M, :m_from_eval_encoding)
- result = obj.m_from_eval_encoding
- assert_equal Encoding::EUC_KR, result.encoding
- assert_match /literal encoding is EUC-KR/, result
- assert_match /__ENCODING__ is EUC-KR/, result
- end
-end
-
-# vim:fileencoding=UTF-8
diff --git a/test/etc/test_etc.rb b/test/etc/test_etc.rb
deleted file mode 100644
index 9196b139da..0000000000
--- a/test/etc/test_etc.rb
+++ /dev/null
@@ -1,101 +0,0 @@
-require "test/unit"
-require "etc"
-
-class TestEtc < Test::Unit::TestCase
- def test_getlogin
- s = Etc.getlogin
- assert(s.is_a?(String) || s == nil, "getlogin must return a String or nil")
- end
-
- def test_passwd
- Etc.passwd do |s|
- assert_instance_of(String, s.name)
- assert_instance_of(String, s.passwd) if s.respond_to?(:passwd)
- assert_kind_of(Integer, s.uid)
- assert_kind_of(Integer, s.gid)
- assert_instance_of(String, s.gecos) if s.respond_to?(:gecos)
- assert_instance_of(String, s.dir)
- assert_instance_of(String, s.shell)
- assert_kind_of(Integer, s.change) if s.respond_to?(:change)
- assert_kind_of(Integer, s.quota) if s.respond_to?(:quota)
- assert(s.age.is_a?(Integer) || s.age.is_a?(String)) if s.respond_to?(:age)
- assert_instance_of(String, s.uclass) if s.respond_to?(:uclass)
- assert_instance_of(String, s.comment) if s.respond_to?(:comment)
- assert_kind_of(Integer, s.expire) if s.respond_to?(:expire)
- end
-
- assert_raise(RuntimeError) { Etc.passwd { Etc.passwd { } } }
- end
-
- def test_getpwuid
- passwd = {}
- Etc.passwd {|s| passwd[s.uid] ||= s }
- passwd.each_value do |s|
- assert_equal(s, Etc.getpwuid(s.uid))
- assert_equal(s, Etc.getpwuid) if Process.euid == s.uid
- end
- end
-
- def test_getpwnam
- passwd = {}
- Etc.passwd {|s| passwd[s.name] ||= s }
- passwd.each_value do |s|
- assert_equal(s, Etc.getpwnam(s.name))
- end
- end
-
- def test_passwd_with_low_level_api
- a = []
- Etc.passwd {|s| a << s }
- b = []
- Etc.setpwent
- while s = Etc.getpwent
- b << s
- end
- Etc.endpwent
- assert_equal(a, b)
- end
-
- def test_group
- Etc.group do |s|
- assert_instance_of(String, s.name)
- assert_instance_of(String, s.passwd) if s.respond_to?(:passwd)
- assert_kind_of(Integer, s.gid)
- end
-
- assert_raise(RuntimeError) { Etc.group { Etc.group { } } }
- end
-
- def test_getgrgid
- groups = {}
- Etc.group do |s|
- groups[s.gid] ||= s
- end
- groups.each_value do |s|
- assert_equal(s, Etc.getgrgid(s.gid))
- assert_equal(s, Etc.getgrgid) if Process.egid == s.gid
- end
- end
-
- def test_getgrnam
- groups = {}
- Etc.group do |s|
- groups[s.name] ||= s
- end
- groups.each_value do |s|
- assert_equal(s, Etc.getgrnam(s.name))
- end
- end
-
- def test_group_with_low_level_api
- a = []
- Etc.group {|s| a << s }
- b = []
- Etc.setgrent
- while s = Etc.getgrent
- b << s
- end
- Etc.endgrent
- assert_equal(a, b)
- end
-end
diff --git a/test/fileutils/fileasserts.rb b/test/fileutils/fileasserts.rb
index bad87e9ce0..c2e9244a96 100644
--- a/test/fileutils/fileasserts.rb
+++ b/test/fileutils/fileasserts.rb
@@ -4,10 +4,6 @@ module Test
module Unit
module Assertions # redefine
- def _wrap_assertion
- yield
- end
-
def assert_same_file(from, to)
_wrap_assertion {
assert_block("file #{from} != #{to}") {
@@ -21,7 +17,7 @@ module Test
b = File.stat(to)
assert_equal a.mode, b.mode, "mode #{a.mode} != #{b.mode}"
#assert_equal a.atime, b.atime
- assert_equal_timestamp a.mtime, b.mtime, "mtime #{a.mtime} != #{b.mtime}"
+ assert_equal a.mtime, b.mtime, "mtime #{a.mtime} != #{b.mtime}"
assert_equal a.uid, b.uid, "uid #{a.uid} != #{b.uid}"
assert_equal a.gid, b.gid, "gid #{a.gid} != #{b.gid}"
end
@@ -66,39 +62,6 @@ module Test
}
end
- def assert_equal_time(expected, actual, message=nil)
- _wrap_assertion {
- expected_str = expected.to_s
- actual_str = actual.to_s
- if expected_str == actual_str
- expected_str << " (nsec=#{expected.nsec})"
- actual_str << " (nsec=#{actual.nsec})"
- end
- full_message = build_message(message, <<EOT)
-<#{expected_str}> expected but was
-<#{actual_str}>.
-EOT
- assert_block(full_message) { expected == actual }
- }
- end
-
- def assert_equal_timestamp(expected, actual, message=nil)
- _wrap_assertion {
- expected_str = expected.to_s
- actual_str = actual.to_s
- if expected_str == actual_str
- expected_str << " (nsec=#{expected.nsec})"
- actual_str << " (nsec=#{actual.nsec})"
- end
- full_message = build_message(message, <<EOT)
-<#{expected_str}> expected but was
-<#{actual_str}>.
-EOT
- # subsecond timestamp is not portable.
- assert_block(full_message) { expected.tv_sec == actual.tv_sec }
- }
- end
-
end
end
end
diff --git a/test/fileutils/test_fileutils.rb b/test/fileutils/test_fileutils.rb
index 3117193385..cab51c9e8c 100644
--- a/test/fileutils/test_fileutils.rb
+++ b/test/fileutils/test_fileutils.rb
@@ -16,11 +16,11 @@ Dir.mkdir tmproot unless File.directory?(tmproot)
Dir.chdir tmproot
def have_drive_letter?
- /mswin(?!ce)|mingw|bcc|emx/ =~ RUBY_PLATFORM
+ /djgpp|mswin(?!ce)|mingw|bcc|emx/ =~ RUBY_PLATFORM
end
def have_file_perm?
- /mswin|mingw|bcc|emx/ !~ RUBY_PLATFORM
+ /djgpp|mswin|mingw|bcc|wince|emx/ !~ RUBY_PLATFORM
end
$fileutils_rb_have_symlink = nil
@@ -77,7 +77,7 @@ class TestFileUtils
include FileUtils
def check_singleton(name)
- assert_equal true, ::FileUtils.public_methods.include?(name.to_sym)
+ assert_equal true, ::FileUtils.public_methods.include?(name.to_s)
end
def my_rm_rf(path)
@@ -192,7 +192,7 @@ end
TARGETS.each do |fname|
assert cmp(fname, fname), 'not same?'
end
- assert_raise(ArgumentError) {
+ assert_raises(ArgumentError) {
cmp TARGETS[0], TARGETS[0], :undefinedoption => true
}
@@ -225,21 +225,21 @@ end
# src==dest (1) same path
touch 'tmp/cptmp'
- assert_raise(ArgumentError) {
+ assert_raises(ArgumentError) {
cp 'tmp/cptmp', 'tmp/cptmp'
}
if have_symlink?
# src==dest (2) symlink and its target
File.symlink 'cptmp', 'tmp/cptmp_symlink'
- assert_raise(ArgumentError) {
+ assert_raises(ArgumentError) {
cp 'tmp/cptmp', 'tmp/cptmp_symlink'
}
- assert_raise(ArgumentError) {
+ assert_raises(ArgumentError) {
cp 'tmp/cptmp_symlink', 'tmp/cptmp'
}
# src==dest (3) looped symlink
File.symlink 'symlink', 'tmp/symlink'
- assert_raise(Errno::ELOOP) {
+ assert_raises(Errno::ELOOP) {
cp 'tmp/symlink', 'tmp/symlink'
}
end
@@ -296,7 +296,10 @@ if have_symlink?
cp_r 'tmp/cpr_src2', 'tmp/cpr_dest2'
assert_directory 'tmp/cpr_dest2'
#assert_not_symlink 'tmp/cpr_dest2'
- assert_symlink 'tmp/cpr_dest2' # 2005-05-26: feature change
+ # * 2005-05-26: feature change on trunk
+ #assert_symlink 'tmp/cpr_dest2'
+ # * 2005-09-19: revert for 1.8 (:dereference_root => true by default)
+ assert_not_symlink 'tmp/cpr_dest2'
assert_symlink 'tmp/cpr_dest2/symlink'
assert_equal 'SLdest', File.readlink('tmp/cpr_dest2/symlink')
end
@@ -326,33 +329,34 @@ end
assert_same_file fname, 'tmp/mvdest'
end
+ # [ruby-talk:124368]
mkdir 'tmp/tmpdir'
mkdir_p 'tmp/dest2/tmpdir'
- assert_raise(Errno::EEXIST) {
+ assert_raises(Errno::EEXIST) {
mv 'tmp/tmpdir', 'tmp/dest2'
}
mkdir 'tmp/dest2/tmpdir/junk'
- assert_raise(Errno::EEXIST, "[ruby-talk:124368]") {
+ assert_raises(Errno::EEXIST) {
mv 'tmp/tmpdir', 'tmp/dest2'
}
# src==dest (1) same path
touch 'tmp/cptmp'
- assert_raise(ArgumentError) {
+ assert_raises(ArgumentError) {
mv 'tmp/cptmp', 'tmp/cptmp'
}
if have_symlink?
# src==dest (2) symlink and its target
File.symlink 'cptmp', 'tmp/cptmp_symlink'
- assert_raise(ArgumentError) {
+ assert_raises(ArgumentError) {
mv 'tmp/cptmp', 'tmp/cptmp_symlink'
}
- assert_raise(ArgumentError) {
+ assert_raises(ArgumentError) {
mv 'tmp/cptmp_symlink', 'tmp/cptmp'
}
# src==dest (3) looped symlink
File.symlink 'symlink', 'tmp/symlink'
- assert_raise(Errno::ELOOP) {
+ assert_raises(Errno::ELOOP) {
mv 'tmp/symlink', 'tmp/symlink'
}
end
@@ -589,16 +593,16 @@ if have_hardlink?
# src==dest (1) same path
touch 'tmp/cptmp'
- assert_raise(Errno::EEXIST) {
+ assert_raises(Errno::EEXIST) {
ln 'tmp/cptmp', 'tmp/cptmp'
}
if have_symlink?
# src==dest (2) symlink and its target
File.symlink 'cptmp', 'tmp/symlink'
- assert_raise(Errno::EEXIST) {
+ assert_raises(Errno::EEXIST) {
ln 'tmp/cptmp', 'tmp/symlink' # normal file -> symlink
}
- assert_raise(Errno::EEXIST) {
+ assert_raises(Errno::EEXIST) {
ln 'tmp/symlink', 'tmp/cptmp' # symlink -> normal file
}
# src==dest (3) looped symlink
@@ -789,28 +793,28 @@ end
install 'tmp/aaa', 'tmp/bbb'
assert_equal "aaa\n", File.read('tmp/bbb')
assert_equal 0600, (File.stat('tmp/bbb').mode & 0777) if have_file_perm?
- assert_equal_time t, File.mtime('tmp/bbb')
+ assert_equal t, File.mtime('tmp/bbb')
File.unlink 'tmp/aaa'
File.unlink 'tmp/bbb'
# src==dest (1) same path
touch 'tmp/cptmp'
- assert_raise(ArgumentError) {
+ assert_raises(ArgumentError) {
install 'tmp/cptmp', 'tmp/cptmp'
}
if have_symlink?
# src==dest (2) symlink and its target
File.symlink 'cptmp', 'tmp/cptmp_symlink'
- assert_raise(ArgumentError) {
+ assert_raises(ArgumentError) {
install 'tmp/cptmp', 'tmp/cptmp_symlink'
}
- assert_raise(ArgumentError) {
+ assert_raises(ArgumentError) {
install 'tmp/cptmp_symlink', 'tmp/cptmp'
}
# src==dest (3) looped symlink
File.symlink 'symlink', 'tmp/symlink'
- assert_raise(Errno::ELOOP) {
+ assert_raises(Errno::ELOOP) {
# File#install invokes open(2), always ELOOP must be raised
install 'tmp/symlink', 'tmp/symlink'
}
@@ -977,8 +981,8 @@ end
@f = f
end
- def read(*args)
- @f.read(*args)
+ def read(n)
+ @f.read(n)
end
def write(str)
diff --git a/test/gdbm/test_gdbm.rb b/test/gdbm/test_gdbm.rb
index 03b5eb792b..5b25497211 100644
--- a/test/gdbm/test_gdbm.rb
+++ b/test/gdbm/test_gdbm.rb
@@ -1,5 +1,4 @@
require 'test/unit'
-require 'tmpdir'
begin
require 'gdbm'
@@ -13,7 +12,7 @@ if defined? GDBM
class TestGDBM < Test::Unit::TestCase
def TestGDBM.uname_s
require 'rbconfig'
- case RbConfig::CONFIG['target_os']
+ case Config::CONFIG['target_os']
when 'cygwin'
require 'Win32API'
uname = Win32API.new('cygwin1', 'uname', 'P', 'I')
@@ -22,22 +21,20 @@ if defined? GDBM
utsname.unpack('A20' * 5)[0]
else
- RbConfig::CONFIG['target_os']
+ Config::CONFIG['target_os']
end
end
SYSTEM = uname_s
def setup
- @tmpdir = Dir.mktmpdir("tmptest_gdbm")
- @prefix = "tmptest_gdbm_#{$$}"
- @path = "#{@tmpdir}/#{@prefix}_"
+ @path = "tmptest_gdbm_"
assert_instance_of(GDBM, @gdbm = GDBM.new(@path))
# prepare to make readonly GDBM file
- GDBM.open("#{@tmpdir}/#{@prefix}_rdonly", 0400) {|gdbm|
+ GDBM.open("tmptest_gdbm_rdonly", 0400) {|gdbm|
gdbm['foo'] = 'FOO'
}
- assert_instance_of(GDBM, @gdbm_rdonly = GDBM.new("#{@tmpdir}/#{@prefix}_rdonly", nil))
+ assert_instance_of(GDBM, @gdbm_rdonly = GDBM.new("tmptest_gdbm_rdonly", nil))
end
def teardown
assert_nil(@gdbm.close)
@@ -45,7 +42,8 @@ if defined? GDBM
ObjectSpace.each_object(GDBM) do |obj|
obj.close unless obj.closed?
end
- FileUtils.remove_entry_secure @tmpdir
+ File.delete *Dir.glob("*tmptest_gdbm*").to_a
+ p Dir.glob("*tmptest_gdbm*") if $DEBUG
end
def check_size(expect, gdbm=@gdbm)
@@ -72,7 +70,7 @@ if defined? GDBM
def test_s_new_has_no_block
# GDBM.new ignore the block
foo = true
- assert_instance_of(GDBM, gdbm = GDBM.new("#{@tmpdir}/#{@prefix}") { foo = false })
+ assert_instance_of(GDBM, gdbm = GDBM.new("tmptest_gdbm") { foo = false })
assert_equal(foo, true)
assert_nil(gdbm.close)
end
@@ -81,54 +79,54 @@ if defined? GDBM
save_mask = File.umask(0)
begin
- assert_instance_of(GDBM, gdbm = GDBM.open("#{@tmpdir}/#{@prefix}"))
+ assert_instance_of(GDBM, gdbm = GDBM.open("tmptest_gdbm"))
gdbm.close
- assert_equal(File.stat("#{@tmpdir}/#{@prefix}").mode & 0777, 0666)
- assert_instance_of(GDBM, gdbm = GDBM.open("#{@tmpdir}/#{@prefix}2", 0644))
+ assert_equal(File.stat("tmptest_gdbm").mode & 0777, 0666)
+ assert_instance_of(GDBM, gdbm = GDBM.open("tmptest_gdbm2", 0644))
gdbm.close
- assert_equal(File.stat("#{@tmpdir}/#{@prefix}2").mode & 0777, 0644)
+ assert_equal(File.stat("tmptest_gdbm2").mode & 0777, 0644)
ensure
File.umask save_mask
end
end
def test_s_open_no_create
- assert_nil(gdbm = GDBM.open("#{@tmpdir}/#{@prefix}", nil),
+ assert_nil(gdbm = GDBM.open("tmptest_gdbm", nil),
"this test is failed on libgdbm 1.8.0")
ensure
gdbm.close if gdbm
end
def test_s_open_3rd_arg
- assert_instance_of(GDBM, gdbm = GDBM.open("#{@tmpdir}/#{@prefix}", 0644,
+ assert_instance_of(GDBM, gdbm = GDBM.open("tmptest_gdbm", 0644,
GDBM::FAST))
gdbm.close
# gdbm 1.8.0 specific
if defined? GDBM::SYNC
- assert_instance_of(GDBM, gdbm = GDBM.open("#{@tmpdir}/#{@prefix}", 0644,
+ assert_instance_of(GDBM, gdbm = GDBM.open("tmptest_gdbm", 0644,
GDBM::SYNC))
gdbm.close
end
# gdbm 1.8.0 specific
if defined? GDBM::NOLOCK
- assert_instance_of(GDBM, gdbm = GDBM.open("#{@tmpdir}/#{@prefix}", 0644,
+ assert_instance_of(GDBM, gdbm = GDBM.open("tmptest_gdbm", 0644,
GDBM::NOLOCK))
gdbm.close
end
end
def test_s_open_with_block
- assert_equal(GDBM.open("#{@tmpdir}/#{@prefix}") { :foo }, :foo)
+ assert_equal(GDBM.open("tmptest_gdbm") { :foo }, :foo)
end
def test_s_open_lock
return unless have_fork? # snip this test
pid = fork() {
- assert_instance_of(GDBM, gdbm = GDBM.open("#{@tmpdir}/#{@prefix}", 0644))
+ assert_instance_of(GDBM, gdbm = GDBM.open("tmptest_gdbm", 0644))
sleep 2
}
begin
sleep 1
assert_raise(Errno::EWOULDBLOCK) {
begin
- assert_instance_of(GDBM, gdbm2 = GDBM.open("#{@tmpdir}/#{@prefix}", 0644))
+ assert_instance_of(GDBM, gdbm2 = GDBM.open("tmptest_gdbm", 0644))
rescue Errno::EAGAIN, Errno::EACCES
raise Errno::EWOULDBLOCK
end
@@ -142,10 +140,10 @@ if defined? GDBM
# Is it guaranteed on many OS?
def test_s_open_lock_one_process
# locking on one process
- assert_instance_of(GDBM, gdbm = GDBM.open("#{@tmpdir}/#{@prefix}", 0644))
+ assert_instance_of(GDBM, gdbm = GDBM.open("tmptest_gdbm", 0644))
assert_raise(Errno::EWOULDBLOCK) {
begin
- GDBM.open("#{@tmpdir}/#{@prefix}", 0644)
+ GDBM.open("tmptest_gdbm", 0644)
rescue Errno::EAGAIN
raise Errno::EWOULDBLOCK
end
@@ -161,7 +159,7 @@ if defined? GDBM
return unless have_fork? # snip this test
pid = fork() {
- assert_instance_of(GDBM, gdbm = GDBM.open("#{@tmpdir}/#{@prefix}", 0644,
+ assert_instance_of(GDBM, gdbm = GDBM.open("tmptest_gdbm", 0644,
GDBM::NOLOCK))
sleep 2
}
@@ -169,17 +167,17 @@ if defined? GDBM
begin
gdbm2 = nil
assert_nothing_raised(Errno::EWOULDBLOCK, Errno::EAGAIN, Errno::EACCES) {
- assert_instance_of(GDBM, gdbm2 = GDBM.open("#{@tmpdir}/#{@prefix}", 0644))
+ assert_instance_of(GDBM, gdbm2 = GDBM.open("tmptest_gdbm", 0644))
}
ensure
Process.wait pid
gdbm2.close if gdbm2
end
- p Dir.glob("#{@tmpdir}/#{@prefix}*") if $DEBUG
+ p Dir.glob("tmptest_gdbm*") if $DEBUG
- pid = fork() {
- assert_instance_of(GDBM, gdbm = GDBM.open("#{@tmpdir}/#{@prefix}", 0644))
+ pid = Process.fork() {
+ assert_instance_of(GDBM, gdbm = GDBM.open("tmptest_gdbm", 0644))
sleep 2
}
begin
@@ -187,7 +185,7 @@ if defined? GDBM
gdbm2 = nil
assert_nothing_raised(Errno::EWOULDBLOCK, Errno::EAGAIN, Errno::EACCES) {
# this test is failed on Cygwin98 (???)
- assert_instance_of(GDBM, gdbm2 = GDBM.open("#{@tmpdir}/#{@prefix}", 0644,
+ assert_instance_of(GDBM, gdbm2 = GDBM.open("tmptest_gdbm", 0644,
GDBM::NOLOCK))
}
ensure
@@ -197,15 +195,16 @@ if defined? GDBM
end
def test_s_open_error
- assert_instance_of(GDBM, gdbm = GDBM.open("#{@tmpdir}/#{@prefix}", 0))
+ return if /(ms|bcc)win|mingw|djgpp/ =~ RUBY_PLATFORM
+ assert_instance_of(GDBM, gdbm = GDBM.open("tmptest_gdbm", 0))
assert_raise(Errno::EACCES) {
- GDBM.open("#{@tmpdir}/#{@prefix}", 0)
+ GDBM.open("tmptest_gdbm", 0)
}
gdbm.close
end
def test_close
- assert_instance_of(GDBM, gdbm = GDBM.open("#{@tmpdir}/#{@prefix}"))
+ assert_instance_of(GDBM, gdbm = GDBM.open("tmptest_gdbm"))
assert_nil(gdbm.close)
# closed GDBM file
@@ -276,9 +275,9 @@ if defined? GDBM
}
end
- def test_key
+ def test_index
assert_equal('bar', @gdbm['foo'] = 'bar')
- assert_equal('foo', @gdbm.key('bar'))
+ assert_equal('foo', @gdbm.index('bar'))
assert_nil(@gdbm['bar'])
end
@@ -354,7 +353,7 @@ if defined? GDBM
n = 0
ret = @gdbm.each_value {|val|
- assert_not_nil(key = @gdbm.key(val))
+ assert_not_nil(key = @gdbm.index(val))
assert_not_nil(i = keys.index(key))
assert_equal(val, values[i])
@@ -594,10 +593,10 @@ if defined? GDBM
end
def test_sync
- assert_instance_of(GDBM, gdbm = GDBM.open("#{@tmpdir}/#{@prefix}", 0666, GDBM::FAST))
+ assert_instance_of(GDBM, gdbm = GDBM.open('tmptest_gdbm', 0666, GDBM::FAST))
assert_equal(gdbm.sync, gdbm)
gdbm.close
- assert_instance_of(GDBM, gdbm = GDBM.open("#{@tmpdir}/#{@prefix}", 0666))
+ assert_instance_of(GDBM, gdbm = GDBM.open('tmptest_gdbm', 0666))
assert_equal(gdbm.sync, gdbm)
gdbm.close
end
@@ -652,52 +651,30 @@ if defined? GDBM
end
class TestGDBM2 < Test::Unit::TestCase
+ TMPROOT = "#{Dir.tmpdir}/ruby-gdbm.#{$$}"
+
def setup
- @tmproot = Dir.mktmpdir('ruby-gdbm')
+ Dir.mkdir TMPROOT
end
def teardown
- FileUtils.remove_entry_secure @tmproot if File.directory?(@tmproot)
- end
-
- def test_reader_open_notexist
- assert_raise(Errno::ENOENT) {
- GDBM.open("#{@tmproot}/a", 0666, GDBM::READER)
- }
- end
-
- def test_writer_open_notexist
- assert_raise(Errno::ENOENT) {
- GDBM.open("#{@tmproot}/a", 0666, GDBM::WRITER)
- }
- end
-
- def test_wrcreat_open_notexist
- v = GDBM.open("#{@tmproot}/a", 0666, GDBM::WRCREAT)
- assert_instance_of(GDBM, v)
- v.close
- end
-
- def test_newdb_open_notexist
- v = GDBM.open("#{@tmproot}/a", 0666, GDBM::NEWDB)
- assert_instance_of(GDBM, v)
- v.close
+ FileUtils.rm_rf TMPROOT if File.directory?(TMPROOT)
end
def test_reader_open
- GDBM.open("#{@tmproot}/a.dbm") {} # create a db.
- v = GDBM.open("#{@tmproot}/a.dbm", nil, GDBM::READER) {|d|
- assert_raise(GDBMError) { d["k"] = "v" }
+ GDBM.open("#{TMPROOT}/a.dbm") {}
+ v = GDBM.open("#{TMPROOT}/a.dbm", nil, GDBM::READER) {|d|
+ assert_raises(GDBMError) { d["k"] = "v" }
true
}
assert(v)
end
def test_newdb_open
- GDBM.open("#{@tmproot}/a.dbm") {|dbm|
+ GDBM.open("#{TMPROOT}/a.dbm") {|dbm|
dbm["k"] = "v"
- }
- v = GDBM.open("#{@tmproot}/a.dbm", nil, GDBM::NEWDB) {|d|
+ }
+ v = GDBM.open("#{TMPROOT}/a.dbm", nil, GDBM::NEWDB) {|d|
assert_equal(0, d.length)
assert_nil(d["k"])
true
@@ -706,9 +683,9 @@ if defined? GDBM
end
def test_freeze
- GDBM.open("#{@tmproot}/a.dbm") {|d|
+ GDBM.open("#{TMPROOT}/a.dbm") {|d|
d.freeze
- assert_raise(RuntimeError) { d["k"] = "v" }
+ assert_raises(TypeError) { d["k"] = "v" }
}
end
end
diff --git a/test/iconv/test_basic.rb b/test/iconv/test_basic.rb
index 394d271bc1..ea564e91f1 100644
--- a/test/iconv/test_basic.rb
+++ b/test/iconv/test_basic.rb
@@ -43,13 +43,6 @@ class TestIconv::Basic < TestIconv
assert_equal("#{SJIS_STR}\n"*2, output)
end
- def test_invalid_arguments
- assert_raise(TypeError) { Iconv.new(nil, 'Shift_JIS') }
- assert_raise(TypeError) { Iconv.new('Shift_JIS', nil) }
- assert_raise(TypeError) { Iconv.open(nil, 'Shift_JIS') }
- assert_raise(TypeError) { Iconv.open('Shift_JIS', nil) }
- end
-
def test_unknown_encoding
assert_raise(Iconv::InvalidEncoding) { Iconv.iconv("utf-8", "X-UKNOWN", "heh") }
end
diff --git a/test/iconv/test_option.rb b/test/iconv/test_option.rb
index b899ba2db1..a1f3457c31 100644
--- a/test/iconv/test_option.rb
+++ b/test/iconv/test_option.rb
@@ -2,12 +2,6 @@ require File.join(File.dirname(__FILE__), "utils.rb")
class TestIconv::Option < TestIconv
def test_ignore_option
- begin
- iconv = Iconv.new('SHIFT_JIS', 'EUC-JP')
- iconv.transliterate?
- rescue NotImplementedError
- return
- end
iconv = Iconv.new('SHIFT_JIS', 'EUC-JP//ignore')
str = iconv.iconv(EUCJ_STR)
str << iconv.iconv(nil)
@@ -22,12 +16,6 @@ class TestIconv::Option < TestIconv
end
def test_translit_option
- begin
- iconv = Iconv.new('SHIFT_JIS', 'EUC-JP')
- iconv.transliterate?
- rescue NotImplementedError
- return
- end
iconv = Iconv.new('SHIFT_JIS', 'EUC-JP//ignore')
str = iconv.iconv(EUCJ_STR)
str << iconv.iconv(nil)
diff --git a/test/inlinetest.rb b/test/inlinetest.rb
deleted file mode 100644
index 46287364a9..0000000000
--- a/test/inlinetest.rb
+++ /dev/null
@@ -1,55 +0,0 @@
-module InlineTest
- def eval_part(libname, sep, part)
- path = libpath(libname)
- program = File.open(path) { |f| f.read }
- mainpart, endpart = program.split(sep)
- if endpart.nil?
- raise RuntimeError.new("No #{part} part in the library '#{path}'")
- end
- eval(endpart, TOPLEVEL_BINDING, path, mainpart.count("\n")+1)
- end
- module_function :eval_part
-
- def loadtest(libname)
- require(libname)
- in_critical do
- in_progname(libpath(libname)) do
- eval_part(libname, /^(?=if\s+(?:\$0\s*==\s*__FILE__|__FILE__\s*==\s*\$0)(?:[\#\s]|$))/, '$0 == __FILE__')
- end
- end
- end
- module_function :loadtest
-
- def loadtest__END__part(libname)
- require(libname)
- eval_part(libname, /^__END__\r?$/, '__END__')
- end
- module_function :loadtest__END__part
-
- @mutex = Mutex.new
-
- def self.in_critical(&block)
- @mutex.synchronize(&block)
- end
-
- def self.in_progname(progname)
- $program_name = progname
- alias $0 $program_name
- begin
- yield
- ensure
- alias $0 $PROGRAM_NAME
- end
- end
-
- def self.libpath(libname)
- libpath = nil
- $:.find do |path|
- File.file?(testname = File.join(path, libname)) && libpath = testname
- end
- if libpath.nil?
- raise RuntimeError.new("'#{libname}' not found")
- end
- libpath
- end
-end
diff --git a/test/io/nonblock/test_flush.rb b/test/io/nonblock/test_flush.rb
index 2217dbcec9..2afbba300e 100644
--- a/test/io/nonblock/test_flush.rb
+++ b/test/io/nonblock/test_flush.rb
@@ -1,36 +1,28 @@
require 'test/unit'
-require 'timeout'
begin
require 'io/nonblock'
rescue LoadError
end
class TestIONonblock < Test::Unit::TestCase
- def test_flush
+ def test_flush # [ruby-dev:24985]
r,w = IO.pipe
w.nonblock = true
w.sync = false
w << "b"
w.flush
w << "a" * 4096
+ Thread.new {
+ Thread.pass
+ w.close
+ }
result = ""
- timeout(10) {
- Thread.new {
- Thread.pass
- w.close
- }
- t = Thread.new {
- while (Thread.pass; s = r.read(4096))
- result << s
- end
- }
- begin
- w.flush # assert_raise(IOError, "[ruby-dev:24985]") {w.flush}
- rescue Errno::EBADF, IOError
- # ignore [ruby-dev:35638]
+ t = Thread.new {
+ while (Thread.pass; s = r.read(4096))
+ result << s
end
- assert_nothing_raised {t.join}
}
- assert_equal(4097, result.size)
+ assert_raise(IOError) {w.flush}
+ assert_nothing_raised {t.join}
end
end if IO.method_defined?(:nonblock)
diff --git a/test/json/fixtures/fail1.json b/test/json/fixtures/fail1.json
deleted file mode 100644
index 6216b865f1..0000000000
--- a/test/json/fixtures/fail1.json
+++ /dev/null
@@ -1 +0,0 @@
-"A JSON payload should be an object or array, not a string." \ No newline at end of file
diff --git a/test/json/fixtures/fail10.json b/test/json/fixtures/fail10.json
deleted file mode 100644
index 5d8c0047bd..0000000000
--- a/test/json/fixtures/fail10.json
+++ /dev/null
@@ -1 +0,0 @@
-{"Extra value after close": true} "misplaced quoted value" \ No newline at end of file
diff --git a/test/json/fixtures/fail11.json b/test/json/fixtures/fail11.json
deleted file mode 100644
index 76eb95b458..0000000000
--- a/test/json/fixtures/fail11.json
+++ /dev/null
@@ -1 +0,0 @@
-{"Illegal expression": 1 + 2} \ No newline at end of file
diff --git a/test/json/fixtures/fail12.json b/test/json/fixtures/fail12.json
deleted file mode 100644
index 77580a4522..0000000000
--- a/test/json/fixtures/fail12.json
+++ /dev/null
@@ -1 +0,0 @@
-{"Illegal invocation": alert()} \ No newline at end of file
diff --git a/test/json/fixtures/fail13.json b/test/json/fixtures/fail13.json
deleted file mode 100644
index 379406b59b..0000000000
--- a/test/json/fixtures/fail13.json
+++ /dev/null
@@ -1 +0,0 @@
-{"Numbers cannot have leading zeroes": 013} \ No newline at end of file
diff --git a/test/json/fixtures/fail14.json b/test/json/fixtures/fail14.json
deleted file mode 100644
index 0ed366b38a..0000000000
--- a/test/json/fixtures/fail14.json
+++ /dev/null
@@ -1 +0,0 @@
-{"Numbers cannot be hex": 0x14} \ No newline at end of file
diff --git a/test/json/fixtures/fail18.json b/test/json/fixtures/fail18.json
deleted file mode 100644
index e2d130c6eb..0000000000
--- a/test/json/fixtures/fail18.json
+++ /dev/null
@@ -1 +0,0 @@
-[[[[[[[[[[[[[[[[[[[["Too deep"]]]]]]]]]]]]]]]]]]]]
diff --git a/test/json/fixtures/fail19.json b/test/json/fixtures/fail19.json
deleted file mode 100644
index 3b9c46fa9a..0000000000
--- a/test/json/fixtures/fail19.json
+++ /dev/null
@@ -1 +0,0 @@
-{"Missing colon" null} \ No newline at end of file
diff --git a/test/json/fixtures/fail2.json b/test/json/fixtures/fail2.json
deleted file mode 100644
index 6b7c11e5a5..0000000000
--- a/test/json/fixtures/fail2.json
+++ /dev/null
@@ -1 +0,0 @@
-["Unclosed array" \ No newline at end of file
diff --git a/test/json/fixtures/fail20.json b/test/json/fixtures/fail20.json
deleted file mode 100644
index 27c1af3e72..0000000000
--- a/test/json/fixtures/fail20.json
+++ /dev/null
@@ -1 +0,0 @@
-{"Double colon":: null} \ No newline at end of file
diff --git a/test/json/fixtures/fail21.json b/test/json/fixtures/fail21.json
deleted file mode 100644
index 62474573b2..0000000000
--- a/test/json/fixtures/fail21.json
+++ /dev/null
@@ -1 +0,0 @@
-{"Comma instead of colon", null} \ No newline at end of file
diff --git a/test/json/fixtures/fail22.json b/test/json/fixtures/fail22.json
deleted file mode 100644
index a7752581bc..0000000000
--- a/test/json/fixtures/fail22.json
+++ /dev/null
@@ -1 +0,0 @@
-["Colon instead of comma": false] \ No newline at end of file
diff --git a/test/json/fixtures/fail23.json b/test/json/fixtures/fail23.json
deleted file mode 100644
index 494add1ca1..0000000000
--- a/test/json/fixtures/fail23.json
+++ /dev/null
@@ -1 +0,0 @@
-["Bad value", truth] \ No newline at end of file
diff --git a/test/json/fixtures/fail24.json b/test/json/fixtures/fail24.json
deleted file mode 100644
index caff239bfc..0000000000
--- a/test/json/fixtures/fail24.json
+++ /dev/null
@@ -1 +0,0 @@
-['single quote'] \ No newline at end of file
diff --git a/test/json/fixtures/fail25.json b/test/json/fixtures/fail25.json
deleted file mode 100644
index 2dfbd259ee..0000000000
--- a/test/json/fixtures/fail25.json
+++ /dev/null
@@ -1 +0,0 @@
-["tab character in string "]
diff --git a/test/json/fixtures/fail27.json b/test/json/fixtures/fail27.json
deleted file mode 100644
index 6b01a2ca4a..0000000000
--- a/test/json/fixtures/fail27.json
+++ /dev/null
@@ -1,2 +0,0 @@
-["line
-break"] \ No newline at end of file
diff --git a/test/json/fixtures/fail28.json b/test/json/fixtures/fail28.json
deleted file mode 100644
index 621a0101c6..0000000000
--- a/test/json/fixtures/fail28.json
+++ /dev/null
@@ -1,2 +0,0 @@
-["line\
-break"] \ No newline at end of file
diff --git a/test/json/fixtures/fail3.json b/test/json/fixtures/fail3.json
deleted file mode 100644
index 168c81eb78..0000000000
--- a/test/json/fixtures/fail3.json
+++ /dev/null
@@ -1 +0,0 @@
-{unquoted_key: "keys must be quoted"} \ No newline at end of file
diff --git a/test/json/fixtures/fail4.json b/test/json/fixtures/fail4.json
deleted file mode 100644
index 9de168bf34..0000000000
--- a/test/json/fixtures/fail4.json
+++ /dev/null
@@ -1 +0,0 @@
-["extra comma",] \ No newline at end of file
diff --git a/test/json/fixtures/fail5.json b/test/json/fixtures/fail5.json
deleted file mode 100644
index ddf3ce3d24..0000000000
--- a/test/json/fixtures/fail5.json
+++ /dev/null
@@ -1 +0,0 @@
-["double extra comma",,] \ No newline at end of file
diff --git a/test/json/fixtures/fail6.json b/test/json/fixtures/fail6.json
deleted file mode 100644
index ed91580e1b..0000000000
--- a/test/json/fixtures/fail6.json
+++ /dev/null
@@ -1 +0,0 @@
-[ , "<-- missing value"] \ No newline at end of file
diff --git a/test/json/fixtures/fail7.json b/test/json/fixtures/fail7.json
deleted file mode 100644
index 8a96af3e4e..0000000000
--- a/test/json/fixtures/fail7.json
+++ /dev/null
@@ -1 +0,0 @@
-["Comma after the close"], \ No newline at end of file
diff --git a/test/json/fixtures/fail8.json b/test/json/fixtures/fail8.json
deleted file mode 100644
index b28479c6ec..0000000000
--- a/test/json/fixtures/fail8.json
+++ /dev/null
@@ -1 +0,0 @@
-["Extra close"]] \ No newline at end of file
diff --git a/test/json/fixtures/fail9.json b/test/json/fixtures/fail9.json
deleted file mode 100644
index 5815574f36..0000000000
--- a/test/json/fixtures/fail9.json
+++ /dev/null
@@ -1 +0,0 @@
-{"Extra comma": true,} \ No newline at end of file
diff --git a/test/json/fixtures/pass1.json b/test/json/fixtures/pass1.json
deleted file mode 100644
index 7828fcc137..0000000000
--- a/test/json/fixtures/pass1.json
+++ /dev/null
@@ -1,56 +0,0 @@
-[
- "JSON Test Pattern pass1",
- {"object with 1 member":["array with 1 element"]},
- {},
- [],
- -42,
- true,
- false,
- null,
- {
- "integer": 1234567890,
- "real": -9876.543210,
- "e": 0.123456789e-12,
- "E": 1.234567890E+34,
- "": 23456789012E666,
- "zero": 0,
- "one": 1,
- "space": " ",
- "quote": "\"",
- "backslash": "\\",
- "controls": "\b\f\n\r\t",
- "slash": "/ & \/",
- "alpha": "abcdefghijklmnopqrstuvwyz",
- "ALPHA": "ABCDEFGHIJKLMNOPQRSTUVWYZ",
- "digit": "0123456789",
- "special": "`1~!@#$%^&*()_+-={':[,]}|;.</>?",
- "hex": "\u0123\u4567\u89AB\uCDEF\uabcd\uef4A",
- "true": true,
- "false": false,
- "null": null,
- "array":[ ],
- "object":{ },
- "address": "50 St. James Street",
- "url": "http://www.JSON.org/",
- "comment": "// /* <!-- --",
- "# -- --> */": " ",
- " s p a c e d " :[1,2 , 3
-
-,
-
-4 , 5 , 6 ,7 ],
- "compact": [1,2,3,4,5,6,7],
- "jsontext": "{\"object with 1 member\":[\"array with 1 element\"]}",
- "quotes": "&#34; \u0022 %22 0x22 034 &#x22;",
- "\/\\\"\uCAFE\uBABE\uAB98\uFCDE\ubcda\uef4A\b\f\n\r\t`1~!@#$%^&*()_+-=[]{}|;:',./<>?"
-: "A key can be any string"
- },
- 0.5 ,98.6
-,
-99.44
-,
-
-1066
-
-
-,"rosebud"] \ No newline at end of file
diff --git a/test/json/fixtures/pass15.json b/test/json/fixtures/pass15.json
deleted file mode 100644
index fc8376b605..0000000000
--- a/test/json/fixtures/pass15.json
+++ /dev/null
@@ -1 +0,0 @@
-["Illegal backslash escape: \x15"] \ No newline at end of file
diff --git a/test/json/fixtures/pass16.json b/test/json/fixtures/pass16.json
deleted file mode 100644
index c43ae3c286..0000000000
--- a/test/json/fixtures/pass16.json
+++ /dev/null
@@ -1 +0,0 @@
-["Illegal backslash escape: \'"] \ No newline at end of file
diff --git a/test/json/fixtures/pass17.json b/test/json/fixtures/pass17.json
deleted file mode 100644
index 62b9214aed..0000000000
--- a/test/json/fixtures/pass17.json
+++ /dev/null
@@ -1 +0,0 @@
-["Illegal backslash escape: \017"] \ No newline at end of file
diff --git a/test/json/fixtures/pass2.json b/test/json/fixtures/pass2.json
deleted file mode 100644
index d3c63c7ad8..0000000000
--- a/test/json/fixtures/pass2.json
+++ /dev/null
@@ -1 +0,0 @@
-[[[[[[[[[[[[[[[[[[["Not too deep"]]]]]]]]]]]]]]]]]]] \ No newline at end of file
diff --git a/test/json/fixtures/pass26.json b/test/json/fixtures/pass26.json
deleted file mode 100644
index 845d26a6a5..0000000000
--- a/test/json/fixtures/pass26.json
+++ /dev/null
@@ -1 +0,0 @@
-["tab\ character\ in\ string\ "] \ No newline at end of file
diff --git a/test/json/fixtures/pass3.json b/test/json/fixtures/pass3.json
deleted file mode 100644
index 4528d51f1a..0000000000
--- a/test/json/fixtures/pass3.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "JSON Test Pattern pass3": {
- "The outermost value": "must be an object or array.",
- "In this test": "It is an object."
- }
-}
diff --git a/test/json/test_json.rb b/test/json/test_json.rb
deleted file mode 100755
index ae77f7b14f..0000000000
--- a/test/json/test_json.rb
+++ /dev/null
@@ -1,284 +0,0 @@
-#!/usr/bin/env ruby
-# -*- coding: utf-8 -*-
-
-require 'test/unit'
-require 'json'
-require 'stringio'
-
-class TC_JSON < Test::Unit::TestCase
- include JSON
-
- def setup
- @ary = [1, "foo", 3.14, 4711.0, 2.718, nil, [1,-2,3], false, true].map do
- |x| [x]
- end
- @ary_to_parse = ["1", '"foo"', "3.14", "4711.0", "2.718", "null",
- "[1,-2,3]", "false", "true"].map do
- |x| "[#{x}]"
- end
- @hash = {
- 'a' => 2,
- 'b' => 3.141,
- 'c' => 'c',
- 'd' => [ 1, "b", 3.14 ],
- 'e' => { 'foo' => 'bar' },
- 'g' => "\"\0\037",
- 'h' => 1000.0,
- 'i' => 0.001
- }
- @json = '{"a":2,"b":3.141,"c":"c","d":[1,"b",3.14],"e":{"foo":"bar"},' +
- '"g":"\\"\\u0000\\u001f","h":1.0E3,"i":1.0E-3}'
- end
-
- def test_construction
- parser = JSON::Parser.new('test')
- assert_equal 'test', parser.source
- end
-
- def assert_equal_float(expected, is)
- assert_in_delta(expected.first, is.first, 1e-2)
- end
-
- def test_parse_simple_arrays
- assert_equal([], parse('[]'))
- assert_equal([], parse(' [ ] '))
- assert_equal([nil], parse('[null]'))
- assert_equal([false], parse('[false]'))
- assert_equal([true], parse('[true]'))
- assert_equal([-23], parse('[-23]'))
- assert_equal([23], parse('[23]'))
- assert_equal([0.23], parse('[0.23]'))
- assert_equal([0.0], parse('[0e0]'))
- assert_raise(JSON::ParserError) { parse('[+23.2]') }
- assert_raise(JSON::ParserError) { parse('[+23]') }
- assert_raise(JSON::ParserError) { parse('[.23]') }
- assert_raise(JSON::ParserError) { parse('[023]') }
- assert_equal_float [3.141], parse('[3.141]')
- assert_equal_float [-3.141], parse('[-3.141]')
- assert_equal_float [3.141], parse('[3141e-3]')
- assert_equal_float [3.141], parse('[3141.1e-3]')
- assert_equal_float [3.141], parse('[3141E-3]')
- assert_equal_float [3.141], parse('[3141.0E-3]')
- assert_equal_float [-3.141], parse('[-3141.0e-3]')
- assert_equal_float [-3.141], parse('[-3141e-3]')
- assert_raise(ParserError) { parse('[NaN]') }
- assert parse('[NaN]', :allow_nan => true).first.nan?
- assert_raise(ParserError) { parse('[Infinity]') }
- assert_equal [1.0/0], parse('[Infinity]', :allow_nan => true)
- assert_raise(ParserError) { parse('[-Infinity]') }
- assert_equal [-1.0/0], parse('[-Infinity]', :allow_nan => true)
- assert_equal([""], parse('[""]'))
- assert_equal(["foobar"], parse('["foobar"]'))
- assert_equal([{}], parse('[{}]'))
- end
-
- def test_parse_simple_objects
- assert_equal({}, parse('{}'))
- assert_equal({}, parse(' { } '))
- assert_equal({ "a" => nil }, parse('{ "a" : null}'))
- assert_equal({ "a" => nil }, parse('{"a":null}'))
- assert_equal({ "a" => false }, parse('{ "a" : false } '))
- assert_equal({ "a" => false }, parse('{"a":false}'))
- assert_raise(JSON::ParserError) { parse('{false}') }
- assert_equal({ "a" => true }, parse('{"a":true}'))
- assert_equal({ "a" => true }, parse(' { "a" : true } '))
- assert_equal({ "a" => -23 }, parse(' { "a" : -23 } '))
- assert_equal({ "a" => -23 }, parse(' { "a" : -23 } '))
- assert_equal({ "a" => 23 }, parse('{"a":23 } '))
- assert_equal({ "a" => 23 }, parse(' { "a" : 23 } '))
- assert_equal({ "a" => 0.23 }, parse(' { "a" : 0.23 } '))
- assert_equal({ "a" => 0.23 }, parse(' { "a" : 0.23 } '))
- end
-
- def test_parse_more_complex_arrays
- a = [ nil, false, true, "foßbar", [ "n€st€d", true ], { "nested" => true, "n€ßt€ð2" => {} }]
- a.permutation do |orig_ary|
- json = pretty_generate(orig_ary)
- assert_equal orig_ary, parse(json)
- end
- end
-
- def test_parse_complex_objects
- a = [ nil, false, true, "foßbar", [ "n€st€d", true ], { "nested" => true, "n€ßt€ð2" => {} }]
- a.permutation do |orig_ary|
- s = "a"
- orig_obj = orig_ary.inject({}) { |h, x| h[s.dup] = x; s = s.succ; h }
- json = pretty_generate(orig_obj)
- assert_equal orig_obj, parse(json)
- end
- end
-
- def test_parse_arrays
- assert_equal([1,2,3], parse('[1,2,3]'))
- assert_equal([1.2,2,3], parse('[1.2,2,3]'))
- assert_equal([[],[[],[]]], parse('[[],[[],[]]]'))
- end
-
- def test_parse_values
- assert_equal([""], parse('[""]'))
- assert_equal(["\\"], parse('["\\\\"]'))
- assert_equal(['"'], parse('["\""]'))
- assert_equal(['\\"\\'], parse('["\\\\\\"\\\\"]'))
- assert_equal(["\"\b\n\r\t\0\037"],
- parse('["\"\b\n\r\t\u0000\u001f"]'))
- for i in 0 ... @ary.size
- assert_equal(@ary[i], parse(@ary_to_parse[i]))
- end
- end
-
- def test_parse_array
- assert_equal([], parse('[]'))
- assert_equal([], parse(' [ ] '))
- assert_equal([1], parse('[1]'))
- assert_equal([1], parse(' [ 1 ] '))
- assert_equal(@ary,
- parse('[[1],["foo"],[3.14],[47.11e+2],[2718.0E-3],[null],[[1,-2,3]]'\
- ',[false],[true]]'))
- assert_equal(@ary, parse(%Q{ [ [1] , ["foo"] , [3.14] \t , [47.11e+2]
- , [2718.0E-3 ],\r[ null] , [[1, -2, 3 ]], [false ],[ true]\n ] }))
- end
-
- def test_parse_object
- assert_equal({}, parse('{}'))
- assert_equal({}, parse(' { } '))
- assert_equal({'foo'=>'bar'}, parse('{"foo":"bar"}'))
- assert_equal({'foo'=>'bar'}, parse(' { "foo" : "bar" } '))
- end
-
- def test_parser_reset
- parser = Parser.new(@json)
- assert_equal(@hash, parser.parse)
- assert_equal(@hash, parser.parse)
- end
-
- def test_comments
- json = <<EOT
-{
- "key1":"value1", // eol comment
- "key2":"value2" /* multi line
- * comment */,
- "key3":"value3" /* multi line
- // nested eol comment
- * comment */
-}
-EOT
- assert_equal(
- { "key1" => "value1", "key2" => "value2", "key3" => "value3" },
- parse(json))
- json = <<EOT
-{
- "key1":"value1" /* multi line
- // nested eol comment
- /* illegal nested multi line comment */
- * comment */
-}
-EOT
- assert_raise(ParserError) { parse(json) }
- json = <<EOT
-{
- "key1":"value1" /* multi line
- // nested eol comment
- closed multi comment */
- and again, throw an Error */
-}
-EOT
- assert_raise(ParserError) { parse(json) }
- json = <<EOT
-{
- "key1":"value1" /*/*/
-}
-EOT
- assert_equal({ "key1" => "value1" }, parse(json))
- end
-
- def test_backslash
- data = [ '\\.(?i:gif|jpe?g|png)$' ]
- json = '["\\\\.(?i:gif|jpe?g|png)$"]'
- assert_equal json, JSON.unparse(data)
- assert_equal data, JSON.parse(json)
- #
- data = [ '\\"' ]
- json = '["\\\\\""]'
- assert_equal json, JSON.unparse(data)
- assert_equal data, JSON.parse(json)
- #
- json = '["\/"]'
- data = JSON.parse(json)
- assert_equal ['/'], data
- assert_equal json, JSON.unparse(data)
- #
- json = '["\""]'
- data = JSON.parse(json)
- assert_equal ['"'], data
- assert_equal json, JSON.unparse(data)
- json = '["\\\'"]'
- data = JSON.parse(json)
- assert_equal ["'"], data
- assert_equal '["\'"]', JSON.unparse(data)
- end
-
- def test_wrong_inputs
- assert_raise(ParserError) { JSON.parse('"foo"') }
- assert_raise(ParserError) { JSON.parse('123') }
- assert_raise(ParserError) { JSON.parse('[] bla') }
- assert_raise(ParserError) { JSON.parse('[] 1') }
- assert_raise(ParserError) { JSON.parse('[] []') }
- assert_raise(ParserError) { JSON.parse('[] {}') }
- assert_raise(ParserError) { JSON.parse('{} []') }
- assert_raise(ParserError) { JSON.parse('{} {}') }
- assert_raise(ParserError) { JSON.parse('[NULL]') }
- assert_raise(ParserError) { JSON.parse('[FALSE]') }
- assert_raise(ParserError) { JSON.parse('[TRUE]') }
- assert_raise(ParserError) { JSON.parse('[07] ') }
- assert_raise(ParserError) { JSON.parse('[0a]') }
- assert_raise(ParserError) { JSON.parse('[1.]') }
- assert_raise(ParserError) { JSON.parse(' ') }
- end
-
- def test_nesting
- assert_raise(JSON::NestingError) { JSON.parse '[[]]', :max_nesting => 1 }
- assert_raise(JSON::NestingError) { JSON.parser.new('[[]]', :max_nesting => 1).parse }
- assert_equal [[]], JSON.parse('[[]]', :max_nesting => 2)
- too_deep = '[[[[[[[[[[[[[[[[[[[["Too deep"]]]]]]]]]]]]]]]]]]]]'
- too_deep_ary = eval too_deep
- assert_raise(JSON::NestingError) { JSON.parse too_deep }
- assert_raise(JSON::NestingError) { JSON.parser.new(too_deep).parse }
- assert_raise(JSON::NestingError) { JSON.parse too_deep, :max_nesting => 19 }
- ok = JSON.parse too_deep, :max_nesting => 20
- assert_equal too_deep_ary, ok
- ok = JSON.parse too_deep, :max_nesting => nil
- assert_equal too_deep_ary, ok
- ok = JSON.parse too_deep, :max_nesting => false
- assert_equal too_deep_ary, ok
- ok = JSON.parse too_deep, :max_nesting => 0
- assert_equal too_deep_ary, ok
- assert_raise(JSON::NestingError) { JSON.generate [[]], :max_nesting => 1 }
- assert_equal '[[]]', JSON.generate([[]], :max_nesting => 2)
- assert_raise(JSON::NestingError) { JSON.generate too_deep_ary }
- assert_raise(JSON::NestingError) { JSON.generate too_deep_ary, :max_nesting => 19 }
- ok = JSON.generate too_deep_ary, :max_nesting => 20
- assert_equal too_deep, ok
- ok = JSON.generate too_deep_ary, :max_nesting => nil
- assert_equal too_deep, ok
- ok = JSON.generate too_deep_ary, :max_nesting => false
- assert_equal too_deep, ok
- ok = JSON.generate too_deep_ary, :max_nesting => 0
- assert_equal too_deep, ok
- end
-
- def test_load_dump
- too_deep = '[[[[[[[[[[[[[[[[[[[[]]]]]]]]]]]]]]]]]]]]'
- assert_equal too_deep, JSON.dump(eval(too_deep))
- assert_kind_of String, Marshal.dump(eval(too_deep))
- assert_raise(ArgumentError) { JSON.dump(eval(too_deep), 19) }
- assert_raise(ArgumentError) { Marshal.dump(eval(too_deep), 19) }
- assert_equal too_deep, JSON.dump(eval(too_deep), 20)
- assert_kind_of String, Marshal.dump(eval(too_deep), 20)
- output = StringIO.new
- JSON.dump(eval(too_deep), output)
- assert_equal too_deep, output.string
- output = StringIO.new
- JSON.dump(eval(too_deep), output, 20)
- assert_equal too_deep, output.string
- end
-end
diff --git a/test/json/test_json_addition.rb b/test/json/test_json_addition.rb
deleted file mode 100755
index 2650db68f0..0000000000
--- a/test/json/test_json_addition.rb
+++ /dev/null
@@ -1,157 +0,0 @@
-#!/usr/bin/env ruby
-
-require 'test/unit'
-require 'json/add/core'
-require 'date'
-
-class TC_JSONAddition < Test::Unit::TestCase
- include JSON
-
- class A
- def initialize(a)
- @a = a
- end
-
- attr_reader :a
-
- def ==(other)
- a == other.a
- end
-
- def self.json_create(object)
- new(*object['args'])
- end
-
- def to_json(*args)
- {
- 'json_class' => self.class.name,
- 'args' => [ @a ],
- }.to_json(*args)
- end
- end
-
- class B
- def self.json_creatable?
- false
- end
-
- def to_json(*args)
- {
- 'json_class' => self.class.name,
- }.to_json(*args)
- end
- end
-
- class C
- def self.json_creatable?
- false
- end
-
- def to_json(*args)
- {
- 'json_class' => 'TC_JSONAddition::Nix',
- }.to_json(*args)
- end
- end
-
- def test_extended_json
- a = A.new(666)
- assert A.json_creatable?
- json = generate(a)
- a_again = JSON.parse(json)
- assert_kind_of a.class, a_again
- assert_equal a, a_again
- end
-
- def test_extended_json_disabled
- a = A.new(666)
- assert A.json_creatable?
- json = generate(a)
- a_again = JSON.parse(json, :create_additions => true)
- assert_kind_of a.class, a_again
- assert_equal a, a_again
- a_hash = JSON.parse(json, :create_additions => false)
- assert_kind_of Hash, a_hash
- assert_equal(
- {"args"=>[666], "json_class"=>"TC_JSONAddition::A"}.sort_by { |k,| k },
- a_hash.sort_by { |k,| k }
- )
- end
-
- def test_extended_json_fail1
- b = B.new
- assert !B.json_creatable?
- json = generate(b)
- assert_equal({ "json_class"=>"TC_JSONAddition::B" }, JSON.parse(json))
- end
-
- def test_extended_json_fail2
- c = C.new
- assert !C.json_creatable?
- json = generate(c)
- assert_raise(ArgumentError) { JSON.parse(json) }
- end
-
- def test_raw_strings
- raw = ''
- raw_array = []
- for i in 0..255
- raw << i
- raw_array << i
- end
- json = raw.to_json_raw
- json_raw_object = raw.to_json_raw_object
- hash = { 'json_class' => 'String', 'raw'=> raw_array }
- assert_equal hash, json_raw_object
- json_raw = <<EOT.chomp
-{\"json_class\":\"String\",\"raw\":[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,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,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]}
-EOT
-# "
- assert_equal json_raw, json
- raw_again = JSON.parse(json)
- assert_equal raw, raw_again
- end
-
- MyJsonStruct = Struct.new 'MyJsonStruct', :foo, :bar
-
- def test_core
- t = Time.now
- assert_equal t.inspect, JSON(JSON(t)).inspect
- d = Date.today
- assert_equal d, JSON(JSON(d))
- d = DateTime.civil(2007, 6, 14, 14, 57, 10, Rational(1, 12), 2299161)
- assert_equal d, JSON(JSON(d))
- assert_equal 1..10, JSON(JSON(1..10))
- assert_equal 1...10, JSON(JSON(1...10))
- assert_equal "a".."c", JSON(JSON("a".."c"))
- assert_equal "a"..."c", JSON(JSON("a"..."c"))
- s = MyJsonStruct.new 4711, 'foot'
- assert_equal s, JSON(JSON(s))
- struct = Struct.new :foo, :bar
- s = struct.new 4711, 'foot'
- assert_raise(JSONError) { JSON(s) }
- begin
- raise TypeError, "test me"
- rescue TypeError => e
- e_json = JSON.generate e
- e_again = JSON e_json
- assert_kind_of TypeError, e_again
- assert_equal e.message, e_again.message
- assert_equal e.backtrace, e_again.backtrace
- end
- assert_equal(/foo/, JSON(JSON(/foo/)))
- assert_equal(/foo/i, JSON(JSON(/foo/i)))
- end
-
- def test_utc_datetime
- now = Time.now
- d = DateTime.parse(now.to_s) # usual case
- assert d, JSON.parse(d.to_json)
- d = DateTime.parse(now.utc.to_s) # of = 0
- assert d, JSON.parse(d.to_json)
- d = DateTime.civil(2008, 6, 17, 11, 48, 32, 1) # of = 1 / 12 => 1/12
- assert d, JSON.parse(d.to_json)
- d = DateTime.civil(2008, 6, 17, 11, 48, 32, 12) # of = 12 / 12 => 12
- assert d, JSON.parse(d.to_json)
- end
-end
diff --git a/test/json/test_json_fixtures.rb b/test/json/test_json_fixtures.rb
deleted file mode 100755
index 6cc1bfc6fa..0000000000
--- a/test/json/test_json_fixtures.rb
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/usr/bin/env ruby
-
-require 'test/unit'
-require 'json'
-
-class TC_JSONFixtures < Test::Unit::TestCase
- def setup
- fixtures = File.join(File.dirname(__FILE__), 'fixtures/*.json')
- passed, failed = Dir[fixtures].partition { |f| f['pass'] }
- @passed = passed.inject([]) { |a, f| a << [ f, File.read(f) ] }.sort
- @failed = failed.inject([]) { |a, f| a << [ f, File.read(f) ] }.sort
- end
-
- def test_passing
- for name, source in @passed
- assert JSON.parse(source),
- "Did not pass for fixture '#{name}'"
- end
- end
-
- def test_failing
- for name, source in @failed
- assert_raise(JSON::ParserError, JSON::NestingError,
- "Did not fail for fixture '#{name}'") do
- JSON.parse(source)
- end
- end
- end
-end
diff --git a/test/json/test_json_generate.rb b/test/json/test_json_generate.rb
deleted file mode 100644
index 8c55a409cd..0000000000
--- a/test/json/test_json_generate.rb
+++ /dev/null
@@ -1,99 +0,0 @@
-require 'test/unit'
-require 'json'
-
-class TC_JSONGenerate < Test::Unit::TestCase
- include JSON
-
- def setup
- @hash = {
- 'a' => 2,
- 'b' => 3.141,
- 'c' => 'c',
- 'd' => [ 1, "b", 3.14 ],
- 'e' => { 'foo' => 'bar' },
- 'g' => "\"\0\037",
- 'h' => 1000.0,
- 'i' => 0.001
- }
- @json2 = '{"a":2,"b":3.141,"c":"c","d":[1,"b",3.14],"e":{"foo":"bar"},' +
- '"g":"\\"\\u0000\\u001f","h":1000.0,"i":0.001}'
- @json3 = <<'EOT'.chomp
-{
- "a": 2,
- "b": 3.141,
- "c": "c",
- "d": [
- 1,
- "b",
- 3.14
- ],
- "e": {
- "foo": "bar"
- },
- "g": "\"\u0000\u001f",
- "h": 1000.0,
- "i": 0.001
-}
-EOT
- end
-
- def test_unparse
- json = unparse(@hash)
- assert_equal(JSON.parse(@json2), JSON.parse(json))
- parsed_json = parse(json)
- assert_equal(@hash, parsed_json)
- json = generate({1=>2})
- assert_equal('{"1":2}', json)
- parsed_json = parse(json)
- assert_equal({"1"=>2}, parsed_json)
- end
-
- def test_unparse_pretty
- json = pretty_unparse(@hash)
- assert_equal(JSON.parse(@json3), JSON.parse(json))
- parsed_json = parse(json)
- assert_equal(@hash, parsed_json)
- json = pretty_generate({1=>2})
- assert_equal(<<'EOT'.chomp, json)
-{
- "1": 2
-}
-EOT
- parsed_json = parse(json)
- assert_equal({"1"=>2}, parsed_json)
- end
-
- def test_states
- json = generate({1=>2}, nil)
- assert_equal('{"1":2}', json)
- s = JSON.state.new(:check_circular => true)
- #assert s.check_circular
- h = { 1=>2 }
- h[3] = h
- assert_raise(JSON::CircularDatastructure) { generate(h) }
- assert_raise(JSON::CircularDatastructure) { generate(h, s) }
- s = JSON.state.new(:check_circular => true)
- #assert s.check_circular
- a = [ 1, 2 ]
- a << a
- assert_raise(JSON::CircularDatastructure) { generate(a, s) }
- end
-
- def test_allow_nan
- assert_raise(GeneratorError) { generate([JSON::NaN]) }
- assert_equal '[NaN]', generate([JSON::NaN], :allow_nan => true)
- assert_equal '[NaN]', fast_generate([JSON::NaN])
- assert_raise(GeneratorError) { pretty_generate([JSON::NaN]) }
- assert_equal "[\n NaN\n]", pretty_generate([JSON::NaN], :allow_nan => true)
- assert_raise(GeneratorError) { generate([JSON::Infinity]) }
- assert_equal '[Infinity]', generate([JSON::Infinity], :allow_nan => true)
- assert_equal '[Infinity]', fast_generate([JSON::Infinity])
- assert_raise(GeneratorError) { pretty_generate([JSON::Infinity]) }
- assert_equal "[\n Infinity\n]", pretty_generate([JSON::Infinity], :allow_nan => true)
- assert_raise(GeneratorError) { generate([JSON::MinusInfinity]) }
- assert_equal '[-Infinity]', generate([JSON::MinusInfinity], :allow_nan => true)
- assert_equal '[-Infinity]', fast_generate([JSON::MinusInfinity])
- assert_raise(GeneratorError) { pretty_generate([JSON::MinusInfinity]) }
- assert_equal "[\n -Infinity\n]", pretty_generate([JSON::MinusInfinity], :allow_nan => true)
- end
-end
diff --git a/test/json/test_json_rails.rb b/test/json/test_json_rails.rb
deleted file mode 100644
index 91eb9ee9ea..0000000000
--- a/test/json/test_json_rails.rb
+++ /dev/null
@@ -1,114 +0,0 @@
-#!/usr/bin/env ruby
-
-require 'test/unit'
-require 'json/add/rails'
-require 'date'
-
-class TC_JSONRails < Test::Unit::TestCase
- include JSON
-
- class A
- def initialize(a)
- @a = a
- end
-
- attr_reader :a
-
- def ==(other)
- a == other.a
- end
-
- def self.json_create(object)
- new(*object['args'])
- end
-
- def to_json(*args)
- {
- 'json_class' => self.class.name,
- 'args' => [ @a ],
- }.to_json(*args)
- end
- end
-
- class B
- def self.json_creatable?
- false
- end
-
- def to_json(*args)
- {
- 'json_class' => self.class.name,
- }.to_json(*args)
- end
- end
-
- class C
- def to_json(*args)
- {
- 'json_class' => 'TC_JSONRails::Nix',
- }.to_json(*args)
- end
- end
-
- def test_extended_json
- a = A.new(666)
- assert A.json_creatable?
- json = generate(a)
- a_again = JSON.parse(json)
- assert_kind_of a.class, a_again
- assert_equal a, a_again
- end
-
- def test_extended_json_disabled
- a = A.new(666)
- assert A.json_creatable?
- json = generate(a)
- a_again = JSON.parse(json, :create_additions => true)
- assert_kind_of a.class, a_again
- assert_equal a, a_again
- a_hash = JSON.parse(json, :create_additions => false)
- assert_kind_of Hash, a_hash
- assert_equal(
- {"args"=>[666], "json_class"=>"TC_JSONRails::A"}.sort_by { |k,| k },
- a_hash.sort_by { |k,| k }
- )
- end
-
- def test_extended_json_fail1
- b = B.new
- assert !B.json_creatable?
- json = generate(b)
- assert_equal({ 'json_class' => B.name }, JSON.parse(json))
- end
-
- def test_extended_json_fail2
- c = C.new # with rails addition all objects are theoretically creatable
- assert C.json_creatable?
- json = generate(c)
- assert_raise(ArgumentError) { JSON.parse(json) }
- end
-
- def test_raw_strings
- raw = ''
- raw_array = []
- for i in 0..255
- raw << i
- raw_array << i
- end
- json = raw.to_json_raw
- json_raw_object = raw.to_json_raw_object
- hash = { 'json_class' => 'String', 'raw'=> raw_array }
- assert_equal hash, json_raw_object
- json_raw = <<EOT.chomp
-{\"json_class\":\"String\",\"raw\":[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,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,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]}
-EOT
-# "
- assert_equal json_raw, json
- raw_again = JSON.parse(json)
- assert_equal raw, raw_again
- end
-
- def test_symbol
- assert_equal '"foo"', JSON(:foo) # we don't want an object here
- end
-end
diff --git a/test/json/test_json_unicode.rb b/test/json/test_json_unicode.rb
deleted file mode 100755
index b8a37c8b8d..0000000000
--- a/test/json/test_json_unicode.rb
+++ /dev/null
@@ -1,58 +0,0 @@
-#!/usr/bin/env ruby
-# -*- coding: utf-8 -*-
-
-require 'test/unit'
-require 'json'
-
-class TC_JSONUnicode < Test::Unit::TestCase
- include JSON
-
- def test_unicode
- assert_equal '""', ''.to_json
- assert_equal '"\\b"', "\b".to_json
- assert_equal '"\u0001"', 0x1.chr.to_json
- assert_equal '"\u001f"', 0x1f.chr.to_json
- assert_equal '" "', ' '.to_json
- assert_equal "\"#{0x7f.chr}\"", 0x7f.chr.to_json
- utf8 = [ "© ≠ €! \01" ]
- json = '["\u00a9 \u2260 \u20ac! \u0001"]'
- assert_equal json, utf8.to_json
- assert_equal utf8, parse(json)
- utf8 = ["\343\201\202\343\201\204\343\201\206\343\201\210\343\201\212"]
- json = "[\"\\u3042\\u3044\\u3046\\u3048\\u304a\"]"
- assert_equal json, utf8.to_json
- assert_equal utf8, parse(json)
- utf8 = ['საქართველო']
- json = "[\"\\u10e1\\u10d0\\u10e5\\u10d0\\u10e0\\u10d7\\u10d5\\u10d4\\u10da\\u10dd\"]"
- assert_equal json, utf8.to_json
- assert_equal utf8, parse(json)
- assert_equal '["\\u00c3"]', JSON.generate(["Ã"])
- assert_equal ["€"], JSON.parse('["\u20ac"]')
- utf8 = ["\xf0\xa0\x80\x81"]
- json = '["\ud840\udc01"]'
- assert_equal json, JSON.generate(utf8)
- assert_equal utf8, JSON.parse(json)
- end
-
- def test_chars
- (0..0x7f).each do |i|
- json = '["\u%04x"]' % i
- if RUBY_VERSION >= "1.9."
- i = i.chr
- end
- assert_equal i, JSON.parse(json).first[0]
- if i == ?\b
- generated = JSON.generate(["" << i])
- assert '["\b"]' == generated || '["\10"]' == generated
- elsif [?\n, ?\r, ?\t, ?\f].include?(i)
- assert_equal '[' << ('' << i).dump << ']', JSON.generate(["" << i])
- elsif i.chr < 0x20.chr
- assert_equal json, JSON.generate(["" << i])
- end
- end
- assert_raise(JSON::GeneratorError) do
- JSON.generate(["\x80"])
- end
- assert_equal "\302\200", JSON.parse('["\u0080"]').first
- end
-end
diff --git a/test/logger/test_logger.rb b/test/logger/test_logger.rb
index a6c132d0f3..5969854976 100644
--- a/test/logger/test_logger.rb
+++ b/test/logger/test_logger.rb
@@ -6,7 +6,7 @@ require 'tempfile'
class TestLoggerSeverity < Test::Unit::TestCase
def test_enum
logger_levels = Logger.constants
- levels = [:WARN, :UNKNOWN, :INFO, :FATAL, :DEBUG, :ERROR]
+ levels = ["WARN", "UNKNOWN", "INFO", "FATAL", "DEBUG", "ERROR"]
Logger::Severity.constants.each do |level|
assert(levels.include?(level))
assert(logger_levels.include?(level))
@@ -30,7 +30,7 @@ class TestLogger < Test::Unit::TestCase
class Log
attr_reader :label, :datetime, :pid, :severity, :progname, :msg
def initialize(line)
- /\A(\w+), \[([^#]*)#(\d+)\]\s+(\w+) -- (\w*): ([\x0-\xff]*)/n =~ line
+ /\A(\w+), \[([^#]*)#(\d+)\]\s+(\w+) -- (\w*): ([\x0-\xff]*)/ =~ line
@label, @datetime, @pid, @severity, @progname, @msg = $1, $2, $3, $4, $5, $6
end
end
@@ -270,7 +270,7 @@ class TestLogDevice < Test::Unit::TestCase
logdev = d(STDERR)
assert_equal(STDERR, logdev.dev)
assert_nil(logdev.filename)
- assert_raise(TypeError) do
+ assert_raises(TypeError) do
d(nil)
end
#
diff --git a/test/matrix/test_matrix.rb b/test/matrix/test_matrix.rb
index 0850117b86..9e132efa5e 100644
--- a/test/matrix/test_matrix.rb
+++ b/test/matrix/test_matrix.rb
@@ -6,7 +6,7 @@ class TestMatrix < Test::Unit::TestCase
@m1 = Matrix[[1,2,3], [4,5,6]]
@m2 = Matrix[[1,2,3], [4,5,6]]
@m3 = @m1.clone
- @m4 = Matrix[[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]]
+ @m4 = Matrix[[1,0, 2.0, 3.0], [4.0, 5.0, 6.0]]
@n1 = Matrix[[2,3,4], [5,6,7]]
end
@@ -22,7 +22,7 @@ class TestMatrix < Test::Unit::TestCase
assert_equal @m1, @m1
assert_equal @m1, @m2
assert_equal @m1, @m3
- assert_equal @m1, @m4
+ assert_not_equal @m1, @m4
assert_not_equal @m1, @n1
end
@@ -40,10 +40,4 @@ class TestMatrix < Test::Unit::TestCase
assert !hash.key?(@m4)
assert !hash.key?(@n1)
end
-
- def test_hash
- assert_equal @m1.hash, @m1.hash
- assert_equal @m1.hash, @m2.hash
- assert_equal @m1.hash, @m3.hash
- end
end
diff --git a/test/matrix/test_vector.rb b/test/matrix/test_vector.rb
index 95a39693fc..d8f5c778c3 100644
--- a/test/matrix/test_vector.rb
+++ b/test/matrix/test_vector.rb
@@ -6,7 +6,7 @@ class TestVector < Test::Unit::TestCase
@v1 = Vector[1,2,3]
@v2 = Vector[1,2,3]
@v3 = @v1.clone
- @v4 = Vector[1.0, 2.0, 3.0]
+ @v4 = Vector[1,0, 2.0, 3.0]
@w1 = Vector[2,3,4]
end
@@ -22,7 +22,7 @@ class TestVector < Test::Unit::TestCase
assert_equal @v1, @v1
assert_equal @v1, @v2
assert_equal @v1, @v3
- assert_equal @v1, @v4
+ assert_not_equal @v1, @v4
assert_not_equal @v1, @w1
end
@@ -40,10 +40,4 @@ class TestVector < Test::Unit::TestCase
assert !hash.key?(@v4)
assert !hash.key?(@w1)
end
-
- def test_hash
- assert_equal @v1.hash, @v1.hash
- assert_equal @v1.hash, @v2.hash
- assert_equal @v1.hash, @v3.hash
- end
end
diff --git a/test/minitest/test_mini_mock.rb b/test/minitest/test_mini_mock.rb
deleted file mode 100644
index 0f16ae930e..0000000000
--- a/test/minitest/test_mini_mock.rb
+++ /dev/null
@@ -1,83 +0,0 @@
-############################################################
-# This file is imported from a different project.
-# DO NOT make modifications in this repo.
-# File a patch instead and assign it to Ryan Davis
-############################################################
-
-require 'minitest/mock'
-require 'minitest/unit'
-
-MiniTest::Unit.autorun
-
-class TestMiniMock < MiniTest::Unit::TestCase
- def setup
- @mock = MiniTest::Mock.new.expect(:foo, nil)
- @mock.expect(:meaning_of_life, 42)
- end
-
- def test_should_create_stub_method
- assert_nil @mock.foo
- end
-
- def test_should_allow_return_value_specification
- assert_equal 42, @mock.meaning_of_life
- end
-
- def test_should_blow_up_if_not_called
- @mock.foo
-
- util_verify_bad
- end
-
- def test_should_not_blow_up_if_everything_called
- @mock.foo
- @mock.meaning_of_life
-
- assert @mock.verify
- end
-
- def test_should_allow_expectations_to_be_added_after_creation
- @mock.expect(:bar, true)
- assert @mock.bar
- end
-
- def test_should_not_verify_if_new_expected_method_is_not_called
- @mock.foo
- @mock.meaning_of_life
- @mock.expect(:bar, true)
-
- util_verify_bad
- end
-
- def test_should_not_verify_if_unexpected_method_is_called
- assert_raises NoMethodError do
- @mock.unexpected
- end
- end
-
- def test_should_blow_up_on_wrong_number_of_arguments
- @mock.foo
- @mock.meaning_of_life
- @mock.expect(:sum, 3, [1, 2])
-
- assert_raises ArgumentError do
- @mock.sum
- end
- end
-
- def test_should_blow_up_on_wrong_arguments
- @mock.foo
- @mock.meaning_of_life
- @mock.expect(:sum, 3, [1, 2])
-
- @mock.sum(2, 4)
-
- util_verify_bad
- end
-
- def util_verify_bad
- assert_raises MockExpectationError do
- @mock.verify
- end
- end
-end
diff --git a/test/minitest/test_mini_spec.rb b/test/minitest/test_mini_spec.rb
deleted file mode 100644
index 89c552308f..0000000000
--- a/test/minitest/test_mini_spec.rb
+++ /dev/null
@@ -1,169 +0,0 @@
-############################################################
-# This file is imported from a different project.
-# DO NOT make modifications in this repo.
-# File a patch instead and assign it to Ryan Davis
-############################################################
-
-require 'minitest/spec'
-
-MiniTest::Unit.autorun
-
-describe MiniTest::Spec do
- before do
- @assertion_count = 4
- end
-
- after do
- self._assertions.must_equal @assertion_count
- end
-
- it "needs to have all methods named well" do
- @assertion_count = 2
-
- methods = Object.public_instance_methods.find_all { |n| n =~ /^must|^wont/ }
- methods.map! { |m| m.to_s } if Symbol === methods.first
-
- musts, wonts = methods.sort.partition { |m| m =~ /^must/ }
-
- expected_musts = %w(must_be
- must_be_close_to
- must_be_empty
- must_be_instance_of
- must_be_kind_of
- must_be_nil
- must_be_same_as
- must_be_within_delta
- must_be_within_epsilon
- must_equal
- must_include
- must_match
- must_raise
- must_respond_to
- must_send
- must_throw)
-
- expected_wonts = expected_musts.map { |m| m.sub(/^must/, 'wont') }
- expected_wonts.reject! { |m| m =~ /wont_(not|raise|throw|send)/ }
-
- musts.must_equal expected_musts
- wonts.must_equal expected_wonts
- end
-
- it "needs to verify equality" do
- (6 * 7).must_equal(42).must_equal true
- proc { (6 * 9).must_equal(42) }.must_raise MiniTest::Assertion
- end
-
- it "needs to verify floats within a delta" do
- (6.0 * 7).must_be_close_to(42.0).must_equal true
- proc { 42.002.must_be_close_to 42.0 }.must_raise MiniTest::Assertion
- end
-
- it "needs to verify types of objects" do
- (6 * 7).must_be_instance_of(Fixnum).must_equal true
- proc { (6 * 7).must_be_instance_of String }.must_raise MiniTest::Assertion
- end
-
- it "needs to verify kinds of objects" do
- @assertion_count = 6
-
- (6 * 7).must_be_kind_of(Fixnum).must_equal true
- (6 * 7).must_be_kind_of(Numeric).must_equal true
- proc { (6 * 7).must_be_kind_of String }.must_raise MiniTest::Assertion
- end
-
- it "needs to verify regexp matches" do
- @assertion_count = 6
-
- "blah".must_match(/\w+/).must_equal true
- proc { "blah".must_match(/\d+/) }.must_raise MiniTest::Assertion
- end
-
- it "needs to verify nil" do
- nil.must_be_nil.must_equal true
- proc { 42.must_be_nil }.must_raise MiniTest::Assertion
- end
-
- it "needs to verify using any operator" do
- 41.must_be(:<, 42).must_equal true
- proc { 42.must_be(:<, 41) }.must_raise MiniTest::Assertion
- end
-
- it "needs to catch an expected exception" do
- @assertion_count = 2
-
- proc { raise "blah" }.must_raise RuntimeError
- proc { raise MiniTest::Assertion }.must_raise MiniTest::Assertion
- end
-
- it "needs to catch an unexpected exception" do
- @assertion_count = 2
-
- proc {
- proc { raise MiniTest::Assertion }.must_raise(RuntimeError)
- }.must_raise MiniTest::Assertion
- end
-
- it "needs raise if an expected exception is not raised" do
- @assertion_count = 2
-
- proc { proc { 42 }.must_raise(RuntimeError) }.must_raise MiniTest::Assertion
- end
-
- it "needs to be able to catch a MiniTest::Assertion exception" do
- @assertion_count = 2
-
- proc { 1.wont_equal 1 }.must_raise MiniTest::Assertion
- end
-
- it "needs to verify using respond_to" do
- 42.must_respond_to(:+).must_equal true
- proc { 42.must_respond_to(:clear) }.must_raise MiniTest::Assertion
- end
-
- it "needs to verify identity" do
- 1.must_be_same_as(1).must_equal true
- proc { 1.must_be_same_as 2 }.must_raise MiniTest::Assertion
- end
-
- it "needs to verify throw" do
- @assertion_count = 6
-
- proc { throw :blah }.must_throw(:blah).must_equal true
- proc { proc { }.must_throw(:blah) }.must_raise MiniTest::Assertion
- proc { proc { throw :xxx }.must_throw(:blah) }.must_raise MiniTest::Assertion
- end
-
- it "needs to verify inequality" do
- 42.wont_equal(6 * 9).must_equal false
- proc { 1.wont_equal 1 }.must_raise MiniTest::Assertion
- end
-
- it "needs to verify mismatch" do
- @assertion_count = 6
- "blah".wont_match(/\d+/).must_equal false
- proc { "blah".wont_match(/\w+/) }.must_raise MiniTest::Assertion
- end
-
- it "needs to verify non-nil" do
- 42.wont_be_nil.must_equal false
- proc { nil.wont_be_nil }.must_raise MiniTest::Assertion
- end
-
- it "needs to verify non-identity" do
- 1.wont_be_same_as(2).must_equal false
- proc { 1.wont_be_same_as 1 }.must_raise MiniTest::Assertion
- end
-
- it "needs to be sensible about must_include order" do
- @assertion_count = 6
- [1, 2, 3].must_include(2).must_equal true
- proc { [1, 2, 3].must_include 5 }.must_raise MiniTest::Assertion
- end
-
- it "needs to be sensible about wont_include order" do
- @assertion_count = 6
- [1, 2, 3].wont_include(5).must_equal false
- proc { [1, 2, 3].wont_include 2 }.must_raise MiniTest::Assertion
- end
-end
diff --git a/test/minitest/test_mini_test.rb b/test/minitest/test_mini_test.rb
deleted file mode 100644
index d8d5dfe7b3..0000000000
--- a/test/minitest/test_mini_test.rb
+++ /dev/null
@@ -1,986 +0,0 @@
-############################################################
-# This file is imported from a different project.
-# DO NOT make modifications in this repo.
-# File a patch instead and assign it to Ryan Davis
-############################################################
-
-require 'stringio'
-require 'pathname'
-require 'minitest/unit'
-
-MiniTest::Unit.autorun
-
-module M; end
-class E < StandardError; include M; end
-
-class TestMiniTest < MiniTest::Unit::TestCase
- def setup
- srand 42
- MiniTest::Unit::TestCase.reset
- @tu = MiniTest::Unit.new
- @output = StringIO.new("")
- MiniTest::Unit.output = @output
- assert_equal [0, 0], @tu.run_test_suites
- end
-
- def teardown
- MiniTest::Unit.output = $stdout
- Object.send :remove_const, :ATestCase if defined? ATestCase
- end
-
- pwd = Pathname.new(File.expand_path(Dir.pwd))
- basedir = Pathname.new(File.expand_path(MiniTest::MINI_DIR)) + 'mini'
- basedir = basedir.relative_path_from(pwd).to_s
- MINITEST_BASE_DIR = basedir[/\A\./] ? basedir : "./#{basedir}"
- BT_MIDDLE = ["#{MINITEST_BASE_DIR}/test.rb:165:in `run_test_suites'",
- "#{MINITEST_BASE_DIR}/test.rb:161:in `each'",
- "#{MINITEST_BASE_DIR}/test.rb:161:in `run_test_suites'",
- "#{MINITEST_BASE_DIR}/test.rb:158:in `each'",
- "#{MINITEST_BASE_DIR}/test.rb:158:in `run_test_suites'",
- "#{MINITEST_BASE_DIR}/test.rb:139:in `run'",
- "#{MINITEST_BASE_DIR}/test.rb:106:in `run'"]
-
- def test_filter_backtrace
- # this is a semi-lame mix of relative paths.
- # I cheated by making the autotest parts not have ./
- bt = (["lib/autotest.rb:571:in `add_exception'",
- "test/test_autotest.rb:62:in `test_add_exception'",
- "#{MINITEST_BASE_DIR}/test.rb:165:in `__send__'"] +
- BT_MIDDLE +
- ["#{MINITEST_BASE_DIR}/test.rb:29",
- "test/test_autotest.rb:422"])
- bt = util_expand_bt bt
-
- ex = ["lib/autotest.rb:571:in `add_exception'",
- "test/test_autotest.rb:62:in `test_add_exception'"]
- ex = util_expand_bt ex
-
- fu = MiniTest::filter_backtrace(bt)
-
- assert_equal ex, fu
- end
-
- def util_expand_bt bt
- if RUBY_VERSION =~ /^1\.9/ then
- bt.map { |f| (f =~ /^\./) ? File.expand_path(f) : f }
- else
- bt
- end
- end
-
- def test_filter_backtrace_all_unit
- bt = (["#{MINITEST_BASE_DIR}/test.rb:165:in `__send__'"] +
- BT_MIDDLE +
- ["#{MINITEST_BASE_DIR}/test.rb:29"])
- ex = bt.clone
- fu = MiniTest::filter_backtrace(bt)
- assert_equal ex, fu
- end
-
- def test_filter_backtrace_unit_starts
- bt = (["#{MINITEST_BASE_DIR}/test.rb:165:in `__send__'"] +
- BT_MIDDLE +
- ["#{MINITEST_BASE_DIR}/mini/test.rb:29",
- "-e:1"])
-
- bt = util_expand_bt bt
-
- ex = ["-e:1"]
- fu = MiniTest::filter_backtrace(bt)
- assert_equal ex, fu
- end
-
- def test_class_puke_with_assertion_failed
- exception = MiniTest::Assertion.new "Oh no!"
- exception.set_backtrace ["unhappy"]
- assert_equal 'F', @tu.puke('SomeClass', 'method_name', exception)
- assert_equal 1, @tu.failures
- assert_match(/^Failure.*Oh no!/m, @tu.report.first)
- assert_match("method_name(SomeClass) [unhappy]", @tu.report.first)
- end
-
- def test_class_puke_with_failure_and_flunk_in_backtrace
- exception = begin
- MiniTest::Unit::TestCase.new('fake tc').flunk
- rescue MiniTest::Assertion => failure
- failure
- end
- assert_equal 'F', @tu.puke('SomeClass', 'method_name', exception)
- refute @tu.report.any?{|line| line =~ /in .flunk/}
- end
-
- def test_class_puke_with_assertion_failed_and_long_backtrace
- bt = (["test/test_some_class.rb:615:in `method_name'",
- "#{MINITEST_BASE_DIR}/unit.rb:140:in `assert_raises'",
- "test/test_some_class.rb:615:in `each'",
- "test/test_some_class.rb:614:in `test_method_name'",
- "#{MINITEST_BASE_DIR}/test.rb:165:in `__send__'"] +
- BT_MIDDLE +
- ["#{MINITEST_BASE_DIR}/test.rb:29"])
- bt = util_expand_bt bt
-
- ex_location = util_expand_bt(["test/test_some_class.rb:615"]).first
-
- exception = MiniTest::Assertion.new "Oh no!"
- exception.set_backtrace bt
- assert_equal 'F', @tu.puke('TestSomeClass', 'test_method_name', exception)
- assert_equal 1, @tu.failures
- assert_match(/^Failure.*Oh no!/m, @tu.report.first)
- assert_match("test_method_name(TestSomeClass) [#{ex_location}]", @tu.report.first)
- end
-
- def test_class_puke_with_assertion_failed_and_user_defined_assertions
- bt = (["lib/test/my/util.rb:16:in `another_method_name'",
- "#{MINITEST_BASE_DIR}/unit.rb:140:in `assert_raises'",
- "lib/test/my/util.rb:15:in `block in assert_something'",
- "lib/test/my/util.rb:14:in `each'",
- "lib/test/my/util.rb:14:in `assert_something'",
- "test/test_some_class.rb:615:in `each'",
- "test/test_some_class.rb:614:in `test_method_name'",
- "#{MINITEST_BASE_DIR}/test.rb:165:in `__send__'"] +
- BT_MIDDLE +
- ["#{MINITEST_BASE_DIR}/test.rb:29"])
- bt = util_expand_bt bt
-
- ex_location = util_expand_bt(["test/test_some_class.rb:615"]).first
-
- exception = MiniTest::Assertion.new "Oh no!"
- exception.set_backtrace bt
- assert_equal 'F', @tu.puke('TestSomeClass', 'test_method_name', exception)
- assert_equal 1, @tu.failures
- assert_match(/^Failure.*Oh no!/m, @tu.report.first)
- assert_match("test_method_name(TestSomeClass) [#{ex_location}]", @tu.report.first)
- end
-
- def test_class_puke_with_flunk_and_user_defined_assertions
- bt = (["lib/test/my/util.rb:16:in `flunk'",
- "#{MINITEST_BASE_DIR}/unit.rb:140:in `assert_raises'",
- "lib/test/my/util.rb:15:in `block in assert_something'",
- "lib/test/my/util.rb:14:in `each'",
- "lib/test/my/util.rb:14:in `assert_something'",
- "test/test_some_class.rb:615:in `each'",
- "test/test_some_class.rb:614:in `test_method_name'",
- "#{MINITEST_BASE_DIR}/test.rb:165:in `__send__'"] +
- BT_MIDDLE +
- ["#{MINITEST_BASE_DIR}/test.rb:29"])
- bt = util_expand_bt bt
-
- ex_location = util_expand_bt(["test/test_some_class.rb:615"]).first
-
- exception = MiniTest::Assertion.new "Oh no!"
- exception.set_backtrace bt
- assert_equal 'F', @tu.puke('TestSomeClass', 'test_method_name', exception)
- assert_equal 1, @tu.failures
- assert_match(/^Failure.*Oh no!/m, @tu.report.first)
- assert_match("test_method_name(TestSomeClass) [#{ex_location}]", @tu.report.first)
- end
-
- def test_class_puke_with_non_failure_exception
- exception = Exception.new("Oh no again!")
- assert_equal 'E', @tu.puke('SomeClass', 'method_name', exception)
- assert_equal 1, @tu.errors
- assert_match(/^Exception.*Oh no again!/m, @tu.report.first)
- end
-
- def test_class_run_test_suites
- tc = Class.new(MiniTest::Unit::TestCase) do
- def test_something
- assert true
- end
- end
-
- Object.const_set(:ATestCase, tc)
-
- assert_equal [1, 1], @tu.run_test_suites
- end
-
- def test_run_failing # TODO: add error test
- tc = Class.new(MiniTest::Unit::TestCase) do
- def test_something
- assert true
- end
-
- def test_failure
- assert false
- end
- end
-
- Object.const_set(:ATestCase, tc)
-
- @tu.run
-
- expected = "Loaded suite blah
-Started
-F.
-Finished in 0.00
-
- 1) Failure:
-test_failure(ATestCase) [FILE:LINE]:
-Failed assertion, no message given.
-
-2 tests, 2 assertions, 1 failures, 0 errors, 0 skips
-"
- util_assert_report expected
- end
-
- def test_run_error
- tc = Class.new(MiniTest::Unit::TestCase) do
- def test_something
- assert true
- end
-
- def test_error
- raise "unhandled exception"
- end
- end
-
- Object.const_set(:ATestCase, tc)
-
- @tu.run
-
- expected = "Loaded suite blah
-Started
-E.
-Finished in 0.00
-
- 1) Error:
-test_error(ATestCase):
-RuntimeError: unhandled exception
- FILE:LINE:in `test_error'
-
-2 tests, 1 assertions, 0 failures, 1 errors, 0 skips
-"
- util_assert_report expected
- end
-
- def test_run_error_teardown
- tc = Class.new(MiniTest::Unit::TestCase) do
- def test_something
- assert true
- end
-
- def teardown
- raise "unhandled exception"
- end
- end
-
- Object.const_set(:ATestCase, tc)
-
- @tu.run
-
- expected = "Loaded suite blah
-Started
-E
-Finished in 0.00
-
- 1) Error:
-test_something(ATestCase):
-RuntimeError: unhandled exception
- FILE:LINE:in `teardown'
-
-1 tests, 1 assertions, 0 failures, 1 errors, 0 skips
-"
- util_assert_report expected
- end
-
- def test_run_skip
- tc = Class.new(MiniTest::Unit::TestCase) do
- def test_something
- assert true
- end
-
- def test_skip
- skip "not yet"
- end
- end
-
- Object.const_set(:ATestCase, tc)
-
- @tu.run
-
- expected = "Loaded suite blah
-Started
-S.
-Finished in 0.00
-
- 1) Skipped:
-test_skip(ATestCase) [FILE:LINE]:
-not yet
-
-2 tests, 1 assertions, 0 failures, 0 errors, 1 skips
-"
- util_assert_report expected
- end
-
- def util_assert_report expected = nil
- expected ||= "Loaded suite blah
-Started
-.
-Finished in 0.00
-
-1 tests, 1 assertions, 0 failures, 0 errors, 0 skips
-"
- output = @output.string.sub(/Finished in .*/, "Finished in 0.00")
- output.sub!(/Loaded suite .*/, 'Loaded suite blah')
- output.sub!(/^(\s+)(?:#{Regexp.union(__FILE__, File.expand_path(__FILE__))}):\d+:/o, '\1FILE:LINE:')
- output.sub!(/\[(?:#{Regexp.union(__FILE__, File.expand_path(__FILE__))}):\d+\]/o, '[FILE:LINE]')
- assert_equal(expected, output)
- end
-
- def test_run_failing_filtered
- tc = Class.new(MiniTest::Unit::TestCase) do
- def test_something
- assert true
- end
-
- def test_failure
- assert false
- end
- end
-
- Object.const_set(:ATestCase, tc)
-
- @tu.run(%w(-n /something/))
-
- util_assert_report
- end
-
- def test_run_passing
- tc = Class.new(MiniTest::Unit::TestCase) do
- def test_something
- assert true
- end
- end
-
- Object.const_set(:ATestCase, tc)
-
- @tu.run
-
- util_assert_report
- end
-end
-
-class TestMiniTestTestCase < MiniTest::Unit::TestCase
- def setup
- MiniTest::Unit::TestCase.reset
-
- @tc = MiniTest::Unit::TestCase.new 'fake tc'
- @zomg = "zomg ponies!"
- @assertion_count = 1
- end
-
- def teardown
- assert_equal(@assertion_count, @tc._assertions,
- "expected #{@assertion_count} assertions to be fired during the test, not #{@tc._assertions}") if @tc._assertions
- Object.send :remove_const, :ATestCase if defined? ATestCase
- end
-
- def test_class_inherited
- @assertion_count = 0
-
- Object.const_set(:ATestCase, Class.new(MiniTest::Unit::TestCase))
-
- assert_equal [ATestCase], MiniTest::Unit::TestCase.test_suites
- end
-
- def test_class_test_suites
- @assertion_count = 0
-
- Object.const_set(:ATestCase, Class.new(MiniTest::Unit::TestCase))
-
- assert_equal 1, MiniTest::Unit::TestCase.test_suites.size
- assert_equal [ATestCase], MiniTest::Unit::TestCase.test_suites
- end
-
- def test_class_asserts_match_refutes
- @assertion_count = 0
-
- methods = MiniTest::Assertions.public_instance_methods
- methods.map! { |m| m.to_s } if Symbol === methods.first
-
- ignores = %w(assert_block assert_no_match assert_not_equal assert_not_nil
- assert_not_same assert_nothing_thrown assert_raise
- assert_nothing_raised assert_raises assert_throws assert_send)
- asserts = methods.grep(/^assert/).sort - ignores
- refutes = methods.grep(/^refute/).sort - ignores
-
- assert_empty refutes.map { |n| n.sub(/^refute/, 'assert') } - asserts
- assert_empty asserts.map { |n| n.sub(/^assert/, 'refute') } - refutes
- end
-
- def test_assert
- @assertion_count = 2
-
- @tc.assert_equal true, @tc.assert(true), "returns true on success"
- end
-
- def test_assert__triggered
- util_assert_triggered "Failed assertion, no message given." do
- @tc.assert false
- end
- end
-
- def test_assert__triggered_message
- util_assert_triggered @zomg do
- @tc.assert false, @zomg
- end
- end
-
- def test_assert_block
- @tc.assert_block do
- true
- end
- end
-
- def test_assert_block_triggered
- util_assert_triggered 'Expected block to return true value.' do
- @tc.assert_block do
- false
- end
- end
- end
-
- def test_assert_empty
- @assertion_count = 2
-
- @tc.assert_empty []
- end
-
- def test_assert_empty_triggered
- @assertion_count = 2
-
- util_assert_triggered "Expected [1] to be empty." do
- @tc.assert_empty [1]
- end
- end
-
- def test_assert_equal
- @tc.assert_equal 1, 1
- end
-
- def test_assert_equal_different
- util_assert_triggered "Expected 1, not 2." do
- @tc.assert_equal 1, 2
- end
- end
-
- def test_assert_in_delta
- @tc.assert_in_delta 0.0, 1.0 / 1000, 0.1
- end
-
- def test_assert_in_delta_triggered
- util_assert_triggered 'Expected 0.0 - 0.001 (0.001) to be < 1.0e-06.' do
- @tc.assert_in_delta 0.0, 1.0 / 1000, 0.000001
- end
- end
-
- def test_assert_in_epsilon
- @assertion_count = 8
-
- @tc.assert_in_epsilon 10000, 9991
- @tc.assert_in_epsilon 9991, 10000
- @tc.assert_in_epsilon 1.0, 1.001
- @tc.assert_in_epsilon 1.001, 1.0
-
- @tc.assert_in_epsilon 10000, 9999.1, 0.0001
- @tc.assert_in_epsilon 9999.1, 10000, 0.0001
- @tc.assert_in_epsilon 1.0, 1.0001, 0.0001
- @tc.assert_in_epsilon 1.0001, 1.0, 0.0001
- end
-
- def test_assert_in_epsilon_triggered
- util_assert_triggered 'Expected 10000 - 9990 (10) to be < 9.99.' do
- @tc.assert_in_epsilon 10000, 9990
- end
- end
-
- def test_assert_includes
- @assertion_count = 2
-
- @tc.assert_includes [true], true
- end
-
- def test_assert_includes_triggered
- @assertion_count = 3
-
- e = @tc.assert_raises MiniTest::Assertion do
- @tc.assert_includes [true], false
- end
-
- expected = "Expected [true] to include false."
- assert_equal expected, e.message
- end
-
- def test_assert_instance_of
- @tc.assert_instance_of String, "blah"
- end
-
- def test_assert_instance_of_triggered
- util_assert_triggered 'Expected "blah" to be an instance of Array, not String.' do
- @tc.assert_instance_of Array, "blah"
- end
- end
-
- def test_assert_kind_of
- @tc.assert_kind_of String, "blah"
- end
-
- def test_assert_kind_of_triggered
- util_assert_triggered 'Expected "blah" to be a kind of Array, not String.' do
- @tc.assert_kind_of Array, "blah"
- end
- end
-
- def test_assert_match
- @assertion_count = 2
- @tc.assert_match(/\w+/, "blah blah blah")
- end
-
- def test_assert_match_object
- @assertion_count = 2
-
- pattern = Object.new
- def pattern.=~(other) true end
-
- @tc.assert_match pattern, 5
- end
-
- def test_assert_match_object_triggered
- @assertion_count = 2
-
- pattern = Object.new
- def pattern.=~(other) false end
- def pattern.inspect; "<<Object>>" end
-
- util_assert_triggered 'Expected <<Object>> to match 5.' do
- @tc.assert_match pattern, 5
- end
- end
-
- def test_assert_match_triggered
- @assertion_count = 2
- util_assert_triggered 'Expected /\d+/ to match "blah blah blah".' do
- @tc.assert_match(/\d+/, "blah blah blah")
- end
- end
-
- def test_assert_nil
- @tc.assert_nil nil
- end
-
- def test_assert_nil_triggered
- util_assert_triggered 'Expected 42 to be nil.' do
- @tc.assert_nil 42
- end
- end
-
- def test_assert_operator
- @tc.assert_operator 2, :>, 1
- end
-
- def test_assert_operator_triggered
- util_assert_triggered "Expected 2 to be < 1." do
- @tc.assert_operator 2, :<, 1
- end
- end
-
- def test_assert_raises
- @tc.assert_raises RuntimeError do
- raise "blah"
- end
- end
-
- def test_assert_raises_module
- @tc.assert_raises M do
- raise E
- end
- end
-
- def test_assert_raises_triggered_different
- e = assert_raises MiniTest::Assertion do
- @tc.assert_raises RuntimeError do
- raise SyntaxError, "icky"
- end
- end
-
- expected = "[RuntimeError] exception expected, not
-Class: <SyntaxError>
-Message: <\"icky\">
----Backtrace---
-FILE:LINE:in `test_assert_raises_triggered_different'
----------------"
-
- actual = e.message.gsub(/^.+:\d+/, 'FILE:LINE')
- actual.gsub!(/block \(\d+ levels\) in /, '') if RUBY_VERSION =~ /^1\.9/
-
- assert_equal expected, actual
- end
-
- def test_assert_raises_triggered_none
- e = assert_raises MiniTest::Assertion do
- @tc.assert_raises MiniTest::Assertion do
- # do nothing
- end
- end
-
- expected = "MiniTest::Assertion expected but nothing was raised."
-
- assert_equal expected, e.message
- end
-
- def test_assert_raises_triggered_subclass
- e = assert_raises MiniTest::Assertion do
- @tc.assert_raises StandardError do
- raise E
- end
- end
-
- expected = "[StandardError] exception expected, not
-Class: <E>
-Message: <\"E\">
----Backtrace---
-FILE:LINE:in `test_assert_raises_triggered_subclass'
----------------"
-
- actual = e.message.gsub(/^.+:\d+/, 'FILE:LINE')
- actual.gsub!(/block \(\d+ levels\) in /, '') if RUBY_VERSION =~ /^1\.9/
-
- assert_equal expected, actual
- end
-
- def test_assert_respond_to
- @tc.assert_respond_to "blah", :empty?
- end
-
- def test_assert_respond_to_triggered
- util_assert_triggered 'Expected "blah" (String) to respond to #rawr!.' do
- @tc.assert_respond_to "blah", :rawr!
- end
- end
-
- def test_assert_same
- @assertion_count = 3
-
- o = "blah"
- @tc.assert_same 1, 1
- @tc.assert_same :blah, :blah
- @tc.assert_same o, o
- end
-
- def test_assert_same_triggered
- @assertion_count = 2
-
- util_assert_triggered 'Expected 2 (0xXXX) to be the same as 1 (0xXXX).' do
- @tc.assert_same 1, 2
- end
-
- s1 = "blah"
- s2 = "blah"
-
- util_assert_triggered 'Expected "blah" (0xXXX) to be the same as "blah" (0xXXX).' do
- @tc.assert_same s1, s2
- end
- end
-
- def test_assert_send
- @tc.assert_send [1, :<, 2]
- end
-
- def test_assert_send_bad
- util_assert_triggered "Expected 1.>(*[2]) to return true." do
- @tc.assert_send [1, :>, 2]
- end
- end
-
- def test_assert_throws
- @tc.assert_throws(:blah) do
- throw :blah
- end
- end
-
- def test_assert_throws_different
- util_assert_triggered 'Expected :blah to have been thrown, not :not_blah.' do
- @tc.assert_throws(:blah) do
- throw :not_blah
- end
- end
- end
-
- def test_assert_throws_unthrown
- util_assert_triggered 'Expected :blah to have been thrown.' do
- @tc.assert_throws(:blah) do
- # do nothing
- end
- end
- end
-
- def test_capture_io
- @assertion_count = 0
-
- out, err = capture_io do
- puts 'hi'
- warn 'bye!'
- end
-
- assert_equal "hi\n", out
- assert_equal "bye!\n", err
- end
-
- def test_flunk
- util_assert_triggered 'Epic Fail!' do
- @tc.flunk
- end
- end
-
- def test_flunk_message
- util_assert_triggered @zomg do
- @tc.flunk @zomg
- end
- end
-
- def test_message
- @assertion_count = 0
-
- assert_equal "blah2.", @tc.message { "blah2" }.call
- assert_equal "blah2.", @tc.message("") { "blah2" }.call
- assert_equal "blah1.\nblah2.", @tc.message("blah1") { "blah2" }.call
- end
-
- def test_pass
- @tc.pass
- end
-
- def test_test_methods_sorted
- @assertion_count = 0
-
- sample_test_case = Class.new(MiniTest::Unit::TestCase)
-
- class << sample_test_case
- def test_order; :sorted end
- end
-
- sample_test_case.instance_eval do
- define_method :test_test3 do assert "does not matter" end
- define_method :test_test2 do assert "does not matter" end
- define_method :test_test1 do assert "does not matter" end
- end
-
- expected = %w(test_test1 test_test2 test_test3)
- assert_equal expected, sample_test_case.test_methods
- end
-
- def test_test_methods_random
- @assertion_count = 0
-
- sample_test_case = Class.new(MiniTest::Unit::TestCase)
-
- class << sample_test_case
- def test_order; :random end
- end
-
- sample_test_case.instance_eval do
- define_method :test_test1 do assert "does not matter" end
- define_method :test_test2 do assert "does not matter" end
- define_method :test_test3 do assert "does not matter" end
- end
-
- srand 42
- expected = %w(test_test1 test_test2 test_test3)
- max = expected.size
- expected = expected.sort_by { rand(max) }
-
- srand 42
- result = sample_test_case.test_methods
-
- assert_equal expected, result
- end
-
- def test_refute
- @assertion_count = 2
-
- @tc.assert_equal false, @tc.refute(false), "returns false on success"
- end
-
- def test_refute_empty
- @assertion_count = 2
-
- @tc.refute_empty [1]
- end
-
- def test_refute_empty_triggered
- @assertion_count = 2
-
- util_assert_triggered "Expected [] to not be empty." do
- @tc.refute_empty []
- end
- end
-
- def test_refute_equal
- @tc.refute_equal "blah", "yay"
- end
-
- def test_refute_equal_triggered
- util_assert_triggered 'Expected "blah" to not be equal to "blah".' do
- @tc.refute_equal "blah", "blah"
- end
- end
-
- def test_refute_in_delta
- @tc.refute_in_delta 0.0, 1.0 / 1000, 0.000001
- end
-
- def test_refute_in_delta_triggered
- util_assert_triggered 'Expected 0.0 - 0.001 (0.001) to not be < 0.1.' do
- @tc.refute_in_delta 0.0, 1.0 / 1000, 0.1
- end
- end
-
- def test_refute_in_epsilon
- @tc.refute_in_epsilon 10000, 9990
- end
-
- def test_refute_in_epsilon_triggered
- util_assert_triggered 'Expected 10000 - 9991 (9) to not be < 10.0.' do
- @tc.refute_in_epsilon 10000, 9991
- fail
- end
- end
-
- def test_refute_includes
- @assertion_count = 2
-
- @tc.refute_includes [true], false
- end
-
- def test_refute_includes_triggered
- @assertion_count = 3
-
- e = @tc.assert_raises MiniTest::Assertion do
- @tc.refute_includes [true], true
- end
-
- expected = "Expected [true] to not include true."
- assert_equal expected, e.message
- end
-
- def test_refute_instance_of
- @tc.refute_instance_of Array, "blah"
- end
-
- def test_refute_instance_of_triggered
- util_assert_triggered 'Expected "blah" to not be an instance of String.' do
- @tc.refute_instance_of String, "blah"
- end
- end
-
- def test_refute_kind_of
- @tc.refute_kind_of Array, "blah"
- end
-
- def test_refute_kind_of_triggered
- util_assert_triggered 'Expected "blah" to not be a kind of String.' do
- @tc.refute_kind_of String, "blah"
- end
- end
-
- def test_refute_match
- @assertion_count = 2
- @tc.refute_match(/\d+/, "blah blah blah")
- end
-
- def test_refute_match_object
- @assertion_count = 2
- @tc.refute_match Object.new, 5 # default #=~ returns false
- end
-
- def test_assert_object_triggered
- @assertion_count = 2
-
- pattern = Object.new
- def pattern.=~(other) false end
- def pattern.inspect; "<<Object>>" end
-
- util_assert_triggered 'Expected <<Object>> to match 5.' do
- @tc.assert_match pattern, 5
- end
- end
-
- def test_refute_match_object_triggered
- @assertion_count = 2
-
- pattern = Object.new
- def pattern.=~(other) true end
- def pattern.inspect; "<<Object>>" end
-
- util_assert_triggered 'Expected <<Object>> to not match 5.' do
- @tc.refute_match pattern, 5
- end
- end
-
- def test_refute_match_triggered
- @assertion_count = 2
- util_assert_triggered 'Expected /\w+/ to not match "blah blah blah".' do
- @tc.refute_match(/\w+/, "blah blah blah")
- end
- end
-
- def test_refute_nil
- @tc.refute_nil 42
- end
-
- def test_refute_nil_triggered
- util_assert_triggered 'Expected nil to not be nil.' do
- @tc.refute_nil nil
- end
- end
-
- def test_refute_operator
- @tc.refute_operator 2, :<, 1
- end
-
- def test_refute_operator_triggered
- util_assert_triggered "Expected 2 to not be > 1." do
- @tc.refute_operator 2, :>, 1
- end
- end
-
- def test_refute_respond_to
- @tc.refute_respond_to "blah", :rawr!
- end
-
- def test_refute_respond_to_triggered
- util_assert_triggered 'Expected "blah" to not respond to empty?.' do
- @tc.refute_respond_to "blah", :empty?
- end
- end
-
- def test_refute_same
- @tc.refute_same 1, 2
- end
-
- # TODO: "with id <id>" crap from assertions.rb
- def test_refute_same_triggered
- util_assert_triggered 'Expected 1 to not be the same as 1.' do
- @tc.refute_same 1, 1
- end
- end
-
- def test_skip
- @assertion_count = 0
-
- util_assert_triggered "haha!", MiniTest::Skip do
- @tc.skip "haha!"
- end
- end
-
- def util_assert_triggered expected, klass = MiniTest::Assertion
- e = assert_raises(klass) do
- yield
- end
-
- msg = e.message.sub(/(---Backtrace---).*/m, '\1')
- msg.gsub!(/\(0x[0-9a-f]+\)/, '(0xXXX)')
-
- assert_equal expected, msg
- end
-end
diff --git a/test/monitor/test_monitor.rb b/test/monitor/test_monitor.rb
index 064471eecb..b539cb3cca 100644
--- a/test/monitor/test_monitor.rb
+++ b/test/monitor/test_monitor.rb
@@ -94,9 +94,7 @@ class TestMonitor < Test::Unit::TestCase
assert_equal(true, result1)
assert_equal("bar", a)
end
- end
- def _test_timedwait
b = "foo"
queue2 = Queue.new
Thread.start do
diff --git a/test/net/http/test_http.rb b/test/net/http/test_http.rb
deleted file mode 100644
index 271c50e802..0000000000
--- a/test/net/http/test_http.rb
+++ /dev/null
@@ -1,320 +0,0 @@
-# $Id$
-
-require 'test/unit'
-require 'net/http'
-require 'stringio'
-require File.expand_path("utils", File.dirname(__FILE__))
-
-module TestNetHTTP_version_1_1_methods
-
- def test_s_get
- assert_equal $test_net_http_data,
- Net::HTTP.get(config('host'), '/', config('port'))
- end
-
- def test_head
- start {|http|
- res = http.head('/')
- assert_kind_of Net::HTTPResponse, res
- assert_equal $test_net_http_data_type, res['Content-Type']
- assert_equal $test_net_http_data.size, res['Content-Length'].to_i
- }
- end
-
- def test_get
- start {|http|
- _test_get__get http
- _test_get__iter http
- _test_get__chunked http
- }
- end
-
- def _test_get__get(http)
- res, body = http.get('/')
- assert_kind_of Net::HTTPResponse, res
- assert_kind_of String, res.body
- assert_kind_of String, body
- assert_not_nil res['content-length']
- assert_equal $test_net_http_data.size, res['content-length'].to_i
- assert_equal $test_net_http_data_type, res['Content-Type']
- assert_equal $test_net_http_data.size, body.size
- assert_equal $test_net_http_data, body
- assert_equal $test_net_http_data.size, res.body.size
- assert_equal $test_net_http_data, res.body
- end
-
- def _test_get__iter(http)
- buf = ''
- res, body = http.get('/') {|s| buf << s }
- assert_kind_of Net::HTTPResponse, res
- # assert_kind_of String, res.body
- # assert_kind_of String, body
- assert_not_nil res['content-length']
- assert_equal $test_net_http_data.size, res['content-length'].to_i
- assert_equal $test_net_http_data_type, res['Content-Type']
- assert_equal $test_net_http_data.size, buf.size
- assert_equal $test_net_http_data, buf
- # assert_equal $test_net_http_data.size, res.body.size
- # assert_equal $test_net_http_data, res.body
- end
-
- def _test_get__chunked(http)
- buf = ''
- res, body = http.get('/') {|s| buf << s }
- assert_kind_of Net::HTTPResponse, res
- # assert_kind_of String, res.body
- # assert_kind_of String, body
- assert_not_nil res['content-length']
- assert_equal $test_net_http_data.size, res['content-length'].to_i
- assert_equal $test_net_http_data_type, res['Content-Type']
- assert_equal $test_net_http_data.size, buf.size
- assert_equal $test_net_http_data, buf
- # assert_equal $test_net_http_data.size, res.body.size
- # assert_equal $test_net_http_data, res.body
- end
-
- def test_get__break
- i = 0
- start {|http|
- http.get('/') do |str|
- i += 1
- break
- end
- }
- assert_equal 1, i
- end
-
- def test_get__implicit_start
- res, body = new().get('/')
- assert_kind_of Net::HTTPResponse, res
- assert_kind_of String, body
- assert_kind_of String, res.body
- assert_not_nil res['content-length']
- assert_equal $test_net_http_data_type, res['Content-Type']
- assert_equal $test_net_http_data.size, res.body.size
- assert_equal $test_net_http_data, res.body
- end
-
- def test_get2
- start {|http|
- http.get2('/') {|res|
- assert_kind_of Net::HTTPResponse, res
- assert_kind_of Net::HTTPResponse, res.header
- assert_not_nil res['content-length']
- assert_equal $test_net_http_data_type, res['Content-Type']
- assert_kind_of String, res.body
- assert_kind_of String, res.entity
- assert_equal $test_net_http_data.size, res.body.size
- assert_equal $test_net_http_data, res.body
- assert_equal $test_net_http_data, res.entity
- }
- }
- end
-
- def test_post
- start {|http|
- _test_post__base http
- _test_post__file http
- }
- end
-
- def _test_post__base(http)
- uheader = {}
- uheader['Accept'] = 'application/octet-stream'
- data = 'post data'
- res, body = http.post('/', data)
- assert_kind_of Net::HTTPResponse, res
- assert_kind_of String, body
- assert_kind_of String, res.body
- assert_equal data, body
- assert_equal data, res.body
- assert_equal data, res.entity
- end
-
- def _test_post__file(http)
- data = 'post data'
- f = StringIO.new
- http.post('/', data, nil, f)
- assert_equal data, f.string
- end
-
- def test_s_post_form
- res = Net::HTTP.post_form(
- URI.parse("http://#{config('host')}:#{config('port')}/"),
- "a" => "x")
- assert_equal ["a=x"], res.body.split(/[;&]/).sort
-
- res = Net::HTTP.post_form(
- URI.parse("http://#{config('host')}:#{config('port')}/"),
- "a" => "x",
- "b" => "y")
- assert_equal ["a=x", "b=y"], res.body.split(/[;&]/).sort
-
- res = Net::HTTP.post_form(
- URI.parse("http://#{config('host')}:#{config('port')}/"),
- "a" => ["x1", "x2"],
- "b" => "y")
- assert_equal ["a=x1", "a=x2", "b=y"], res.body.split(/[;&]/).sort
- end
-
-end
-
-
-module TestNetHTTP_version_1_2_methods
-
- def test_request
- start {|http|
- _test_request__GET http
- _test_request__file http
- # _test_request__range http # WEBrick does not support Range: header.
- _test_request__HEAD http
- _test_request__POST http
- _test_request__stream_body http
- }
- end
-
- def _test_request__GET(http)
- req = Net::HTTP::Get.new('/')
- http.request(req) {|res|
- assert_kind_of Net::HTTPResponse, res
- assert_kind_of String, res.body
- assert_not_nil res['content-length']
- assert_equal $test_net_http_data.size, res['content-length'].to_i
- assert_equal $test_net_http_data.size, res.body.size
- assert_equal $test_net_http_data, res.body
- }
- end
-
- def _test_request__file(http)
- req = Net::HTTP::Get.new('/')
- http.request(req) {|res|
- assert_kind_of Net::HTTPResponse, res
- assert_not_nil res['content-length']
- assert_equal $test_net_http_data.size, res['content-length'].to_i
- f = StringIO.new("".force_encoding("ASCII-8BIT"))
- res.read_body f
- assert_equal $test_net_http_data.bytesize, f.string.bytesize
- assert_equal $test_net_http_data.encoding, f.string.encoding
- assert_equal $test_net_http_data, f.string
- }
- end
-
- def _test_request__range(http)
- req = Net::HTTP::Get.new('/')
- req['range'] = 'bytes=0-5'
- assert_equal $test_net_http_data[0,6], http.request(req).body
- end
-
- def _test_request__HEAD(http)
- req = Net::HTTP::Head.new('/')
- http.request(req) {|res|
- assert_kind_of Net::HTTPResponse, res
- assert_not_nil res['content-length']
- assert_equal $test_net_http_data.size, res['content-length'].to_i
- assert_nil res.body
- }
- end
-
- def _test_request__POST(http)
- data = 'post data'
- req = Net::HTTP::Post.new('/')
- req['Accept'] = $test_net_http_data_type
- http.request(req, data) {|res|
- assert_kind_of Net::HTTPResponse, res
- assert_equal data.size, res['content-length'].to_i
- assert_kind_of String, res.body
- assert_equal data, res.body
- }
- end
-
- def _test_request__stream_body(http)
- req = Net::HTTP::Post.new('/')
- data = $test_net_http_data
- req.content_length = data.size
- req.body_stream = StringIO.new(data)
- res = http.request(req)
- assert_kind_of Net::HTTPResponse, res
- assert_kind_of String, res.body
- assert_equal data.size, res.body.size
- assert_equal data, res.body
- end
-
- def test_send_request
- start {|http|
- _test_send_request__GET http
- _test_send_request__POST http
- }
- end
-
- def _test_send_request__GET(http)
- res = http.send_request('GET', '/')
- assert_kind_of Net::HTTPResponse, res
- assert_equal $test_net_http_data.size, res['content-length'].to_i
- assert_kind_of String, res.body
- assert_equal $test_net_http_data, res.body
- end
-
- def _test_send_request__POST(http)
- data = 'aaabbb cc ddddddddddd lkjoiu4j3qlkuoa'
- res = http.send_request('POST', '/', data)
- assert_kind_of Net::HTTPResponse, res
- assert_kind_of String, res.body
- assert_equal data.size, res.body.size
- assert_equal data, res.body
- end
-end
-
-class TestNetHTTP_version_1_1 < Test::Unit::TestCase
- CONFIG = {
- 'host' => '127.0.0.1',
- 'port' => 10081,
- 'proxy_host' => nil,
- 'proxy_port' => nil,
- }
-
- include TestNetHTTPUtils
- include TestNetHTTP_version_1_1_methods
-
- def new
- Net::HTTP.version_1_1
- super
- end
-end
-
-class TestNetHTTP_v1_2 < Test::Unit::TestCase
- CONFIG = {
- 'host' => '127.0.0.1',
- 'port' => 10081,
- 'proxy_host' => nil,
- 'proxy_port' => nil,
- }
-
- include TestNetHTTPUtils
- include TestNetHTTP_version_1_1_methods
- include TestNetHTTP_version_1_2_methods
-
- def new
- Net::HTTP.version_1_2
- super
- end
-end
-
-=begin
-class TestNetHTTP_proxy < Test::Unit::TestCase
- CONFIG = {
- 'host' => '127.0.0.1',
- 'port' => 10081,
- 'proxy_host' => '127.0.0.1',
- 'proxy_port' => 10082,
- }
-
- include TestNetHTTPUtils
- include TestNetHTTP_version_1_1_methods
- include TestNetHTTP_version_1_2_methods
-
- def new
- Net::HTTP.version_1_2
- super
- end
-end
-=end
diff --git a/test/net/http/test_httpheader.rb b/test/net/http/test_httpheader.rb
index 379c9bd1ad..3ba1b217c0 100644
--- a/test/net/http/test_httpheader.rb
+++ b/test/net/http/test_httpheader.rb
@@ -215,7 +215,7 @@ class HTTPHeaderTest < Test::Unit::TestCase
try_content_length 123, ' 123'
try_content_length 1, '1 23'
try_content_length 500, '(OK)500'
- assert_raise(Net::HTTPHeaderSyntaxError, 'here is no digit, but') {
+ assert_raises(Net::HTTPHeaderSyntaxError, 'here is no digit, but') {
@c['content-length'] = 'no digit'
@c.content_length
}
diff --git a/test/net/http/test_https.rb b/test/net/http/test_https.rb
deleted file mode 100644
index adb50c58fb..0000000000
--- a/test/net/http/test_https.rb
+++ /dev/null
@@ -1,97 +0,0 @@
-require "test/unit"
-begin
- require 'net/https'
- require 'stringio'
- require File.expand_path("../../openssl/utils", File.dirname(__FILE__))
- require File.expand_path("utils", File.dirname(__FILE__))
-rescue LoadError
- # should skip this test
-end
-
-class TestNetHTTPS < Test::Unit::TestCase
- include TestNetHTTPUtils
-
- subject = OpenSSL::X509::Name.parse("/DC=org/DC=ruby-lang/CN=localhost")
- exts = [
- ["keyUsage", "keyEncipherment,digitalSignature", true],
- ]
- key = OpenSSL::TestUtils::TEST_KEY_RSA1024
- cert = OpenSSL::TestUtils.issue_cert(
- subject, key, 1, Time.now, Time.now + 3600, exts,
- nil, nil, OpenSSL::Digest::SHA1.new
- )
-
- CONFIG = {
- 'host' => '127.0.0.1',
- 'port' => 10081,
- 'proxy_host' => nil,
- 'proxy_port' => nil,
- 'ssl_enable' => true,
- 'ssl_certificate' => cert,
- 'ssl_private_key' => key,
- }
-
- def test_get
- http = Net::HTTP.new("localhost", config("port"))
- http.use_ssl = true
- http.verify_callback = Proc.new do |preverify_ok, store_ctx|
- store_ctx.current_cert.to_der == config('ssl_certificate').to_der
- end
- http.request_get("/") {|res|
- assert_equal($test_net_http_data, res.body)
- }
- end
-
- def test_post
- http = Net::HTTP.new("localhost", config("port"))
- http.use_ssl = true
- http.verify_callback = Proc.new do |preverify_ok, store_ctx|
- store_ctx.current_cert.to_der == config('ssl_certificate').to_der
- end
- data = config('ssl_private_key').to_der
- http.request_post("/", data) {|res|
- assert_equal(data, res.body)
- }
- end
-
- if ENV["RUBY_OPENSSL_TEST_ALL"]
- def test_verify
- http = Net::HTTP.new("ssl.netlab.jp", 443)
- http.use_ssl = true
- assert(
- (http.request_head("/"){|res| } rescue false),
- "The system may not have default CA certificate store."
- )
- end
- end
-
- def test_verify_none
- http = Net::HTTP.new("localhost", config("port"))
- http.use_ssl = true
- http.verify_mode = OpenSSL::SSL::VERIFY_NONE
- http.request_get("/") {|res|
- assert_equal($test_net_http_data, res.body)
- }
- end
-
- def test_certificate_verify_failure
- http = Net::HTTP.new("localhost", config("port"))
- http.use_ssl = true
- ex = assert_raise(OpenSSL::SSL::SSLError){
- http.request_get("/") {|res| }
- }
- assert_match(/certificate verify failed/, ex.message)
- end
-
- def test_identity_verify_failure
- http = Net::HTTP.new("127.0.0.1", config("port"))
- http.use_ssl = true
- http.verify_callback = Proc.new do |preverify_ok, store_ctx|
- store_ctx.current_cert.to_der == config('ssl_certificate').to_der
- end
- ex = assert_raise(OpenSSL::SSL::SSLError){
- http.request_get("/") {|res| }
- }
- assert_match(/hostname was not match/, ex.message)
- end
-end if defined?(OpenSSL)
diff --git a/test/net/http/test_https_proxy.rb b/test/net/http/test_https_proxy.rb
index 5618830587..4f26342339 100644
--- a/test/net/http/test_https_proxy.rb
+++ b/test/net/http/test_https_proxy.rb
@@ -34,4 +34,4 @@ class HTTPSProxyTest < Test::Unit::TestCase
t.join if t
end
end if defined?(OpenSSL)
-
+
diff --git a/test/net/http/utils.rb b/test/net/http/utils.rb
deleted file mode 100644
index e685a8ff61..0000000000
--- a/test/net/http/utils.rb
+++ /dev/null
@@ -1,96 +0,0 @@
-require 'webrick'
-begin
- require "webrick/https"
-rescue LoadError
- # SSL features cannot be tested
-end
-require 'webrick/httpservlet/abstract'
-
-module TestNetHTTPUtils
- def start(&block)
- new().start(&block)
- end
-
- def new
- klass = Net::HTTP::Proxy(config('proxy_host'), config('proxy_port'))
- http = klass.new(config('host'), config('port'))
- http.set_debug_output logfile()
- http
- end
-
- def config(key)
- self.class::CONFIG[key]
- end
-
- def logfile
- $DEBUG ? $stderr : NullWriter.new
- end
-
- def setup
- spawn_server
- end
-
- def teardown
- @server.shutdown
- until @server.status == :Stop
- sleep 0.1
- end
- # resume global state
- Net::HTTP.version_1_2
- end
-
- def spawn_server
- server_config = {
- :BindAddress => config('host'),
- :Port => config('port'),
- :Logger => WEBrick::Log.new(NullWriter.new),
- :AccessLog => [],
- :ShutdownSocketWithoutClose => true,
- :ServerType => Thread,
- }
- if defined?(OpenSSL) and config('ssl_enable')
- server_config.update({
- :SSLEnable => true,
- :SSLCertificate => config('ssl_certificate'),
- :SSLPrivateKey => config('ssl_private_key'),
- })
- end
- @server = WEBrick::HTTPServer.new(server_config)
- @server.mount('/', Servlet)
- @server.start
- n_try_max = 5
- begin
- TCPSocket.open(config('host'), config('port')).close
- rescue Errno::ECONNREFUSED
- sleep 0.2
- n_try_max -= 1
- raise 'cannot spawn server; give up' if n_try_max < 0
- retry
- end
- end
-
- $test_net_http = nil
- $test_net_http_data = (0...256).to_a.map {|i| i.chr }.join('') * 64
- $test_net_http_data.force_encoding("ASCII-8BIT")
- $test_net_http_data_type = 'application/octet-stream'
-
- class Servlet < WEBrick::HTTPServlet::AbstractServlet
- def do_GET(req, res)
- res['Content-Type'] = $test_net_http_data_type
- res.body = $test_net_http_data
- end
-
- # echo server
- def do_POST(req, res)
- res['Content-Type'] = req['Content-Type']
- res.body = req.body
- end
- end
-
- class NullWriter
- def <<(s) end
- def puts(*args) end
- def print(*args) end
- def printf(*args) end
- end
-end
diff --git a/test/net/imap/cacert.pem b/test/net/imap/cacert.pem
deleted file mode 100644
index 8a48e07a90..0000000000
--- a/test/net/imap/cacert.pem
+++ /dev/null
@@ -1,62 +0,0 @@
-Certificate:
- Data:
- Version: 3 (0x2)
- Serial Number:
- d2:9c:5c:81:a3:b0:3b:ec
- Signature Algorithm: sha1WithRSAEncryption
- Issuer: C=JP, ST=Shimane, O=Ruby Core Team, CN=Ruby Test CA
- Validity
- Not Before: Dec 22 08:35:19 2007 GMT
- Not After : Dec 21 08:35:19 2010 GMT
- Subject: C=JP, ST=Shimane, O=Ruby Core Team, CN=Ruby Test CA
- Subject Public Key Info:
- Public Key Algorithm: rsaEncryption
- RSA Public Key: (1024 bit)
- Modulus (1024 bit):
- 00:ee:b1:1a:06:25:1f:29:80:a1:59:ef:0f:0d:8b:
- 5a:88:40:73:56:95:d9:db:b4:71:3c:36:7f:b4:fc:
- 68:51:54:8b:8d:9e:41:27:fb:31:d1:7a:6c:5c:21:
- 30:3d:22:f6:7a:92:c3:fa:b3:85:36:44:76:22:6c:
- 08:82:78:89:7d:c3:19:d4:ec:7d:05:5b:75:cd:38:
- 1c:89:03:ef:02:aa:7e:6d:5b:36:ea:ad:e2:0b:ec:
- 4b:e2:36:bf:c0:49:44:93:a6:cc:da:40:be:5f:c0:
- 75:3b:be:c0:28:db:42:57:90:3b:83:af:2d:60:9a:
- c6:b1:bc:5c:68:12:2d:70:25
- Exponent: 65537 (0x10001)
- X509v3 extensions:
- X509v3 Subject Key Identifier:
- AE:F5:39:FE:D2:35:A2:2C:1E:CB:0E:08:4C:0E:5A:DC:44:99:E2:9C
- X509v3 Authority Key Identifier:
- keyid:AE:F5:39:FE:D2:35:A2:2C:1E:CB:0E:08:4C:0E:5A:DC:44:99:E2:9C
- DirName:/C=JP/ST=Shimane/O=Ruby Core Team/CN=Ruby Test CA
- serial:D2:9C:5C:81:A3:B0:3B:EC
-
- X509v3 Basic Constraints:
- CA:TRUE
- Signature Algorithm: sha1WithRSAEncryption
- 9e:28:89:81:83:55:1b:38:cb:85:86:ec:ee:cc:f4:cf:f0:47:
- 61:72:07:f2:2e:ca:67:f7:c8:29:b5:3c:34:d2:cf:c2:f7:9c:
- 4d:ce:8d:37:24:57:85:c1:0e:27:86:81:15:99:ec:af:05:ae:
- 09:96:f6:f7:5a:c0:d2:a4:82:ed:d6:d3:26:e9:3d:50:50:0c:
- 71:c2:6e:9a:50:30:73:8a:94:0d:c1:9c:1a:da:76:80:b8:8b:
- 46:ec:10:93:6c:8d:cb:ab:eb:12:5d:e0:6f:1a:5a:ac:5c:34:
- 12:df:7b:a7:dc:b6:0f:d6:3e:ac:2f:69:db:11:aa:1d:c4:90:
- f6:fa
------BEGIN CERTIFICATE-----
-MIICzjCCAjegAwIBAgIJANKcXIGjsDvsMA0GCSqGSIb3DQEBBQUAME8xCzAJBgNV
-BAYTAkpQMRAwDgYDVQQIEwdTaGltYW5lMRcwFQYDVQQKEw5SdWJ5IENvcmUgVGVh
-bTEVMBMGA1UEAxMMUnVieSBUZXN0IENBMB4XDTA3MTIyMjA4MzUxOVoXDTEwMTIy
-MTA4MzUxOVowTzELMAkGA1UEBhMCSlAxEDAOBgNVBAgTB1NoaW1hbmUxFzAVBgNV
-BAoTDlJ1YnkgQ29yZSBUZWFtMRUwEwYDVQQDEwxSdWJ5IFRlc3QgQ0EwgZ8wDQYJ
-KoZIhvcNAQEBBQADgY0AMIGJAoGBAO6xGgYlHymAoVnvDw2LWohAc1aV2du0cTw2
-f7T8aFFUi42eQSf7MdF6bFwhMD0i9nqSw/qzhTZEdiJsCIJ4iX3DGdTsfQVbdc04
-HIkD7wKqfm1bNuqt4gvsS+I2v8BJRJOmzNpAvl/AdTu+wCjbQleQO4OvLWCaxrG8
-XGgSLXAlAgMBAAGjgbEwga4wHQYDVR0OBBYEFK71Of7SNaIsHssOCEwOWtxEmeKc
-MH8GA1UdIwR4MHaAFK71Of7SNaIsHssOCEwOWtxEmeKcoVOkUTBPMQswCQYDVQQG
-EwJKUDEQMA4GA1UECBMHU2hpbWFuZTEXMBUGA1UEChMOUnVieSBDb3JlIFRlYW0x
-FTATBgNVBAMTDFJ1YnkgVGVzdCBDQYIJANKcXIGjsDvsMAwGA1UdEwQFMAMBAf8w
-DQYJKoZIhvcNAQEFBQADgYEAniiJgYNVGzjLhYbs7sz0z/BHYXIH8i7KZ/fIKbU8
-NNLPwvecTc6NNyRXhcEOJ4aBFZnsrwWuCZb291rA0qSC7dbTJuk9UFAMccJumlAw
-c4qUDcGcGtp2gLiLRuwQk2yNy6vrEl3gbxparFw0Et97p9y2D9Y+rC9p2xGqHcSQ
-9vo=
------END CERTIFICATE-----
diff --git a/test/net/imap/server.crt b/test/net/imap/server.crt
deleted file mode 100644
index 77803ee385..0000000000
--- a/test/net/imap/server.crt
+++ /dev/null
@@ -1,12 +0,0 @@
------BEGIN CERTIFICATE-----
-MIIB0jCCATsCAQIwDQYJKoZIhvcNAQEFBQAwTzELMAkGA1UEBhMCSlAxEDAOBgNV
-BAgTB1NoaW1hbmUxFzAVBgNVBAoTDlJ1YnkgQ29yZSBUZWFtMRUwEwYDVQQDEwxS
-dWJ5IFRlc3QgQ0EwHhcNMDcxMjIyMDg0MDA1WhcNMTcxMjE5MDg0MDA1WjAUMRIw
-EAYDVQQDEwlsb2NhbGhvc3QwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBANt1
-0EXesd+/caAOsKXmvPQcneUlZ2TFe8vxr8a+mqrqfg/MBa/vQGkGsskTnX7rogbi
-6n0Hx8eZx/vVuOtjd2IrGBLDU1jQ9cdADAHRJoI0Fgnj3GX03LtdpUFg56l0utdM
-tqOcxYyJr8vonwX+6v5kJL/n7eP20PzW6/wGghD7AgMBAAEwDQYJKoZIhvcNAQEF
-BQADgYEA2zl2U40/ogkC3k1ccoO4n/szaGW/wfxFREjn9BCvSB8iGRYNCGO/MdZ6
-maaSuAPdIw6RdFncL6dC3xf5IrriCyOmdZM/O8hgC/sNOnWtRAA/+XJqs0UnZ/A2
-f06bSqE1BTSiUU5wY4UraN2aDgnbFonCrY5RipZgLYaWyEbRtF8=
------END CERTIFICATE-----
diff --git a/test/net/imap/server.key b/test/net/imap/server.key
deleted file mode 100644
index 7c57546ece..0000000000
--- a/test/net/imap/server.key
+++ /dev/null
@@ -1,15 +0,0 @@
------BEGIN RSA PRIVATE KEY-----
-MIICXQIBAAKBgQDbddBF3rHfv3GgDrCl5rz0HJ3lJWdkxXvL8a/Gvpqq6n4PzAWv
-70BpBrLJE51+66IG4up9B8fHmcf71bjrY3diKxgSw1NY0PXHQAwB0SaCNBYJ49xl
-9Ny7XaVBYOepdLrXTLajnMWMia/L6J8F/ur+ZCS/5+3j9tD81uv8BoIQ+wIDAQAB
-AoGAGtYHR+P5gFDaxiXFuCPFC1zMeg7e29XCU6gURIteQnQ2QhxCvcbV64HkLu51
-HeYWhB0Pa4aeCWxmpgb2e+JH4MEoIjeJSGyZQeqwkQLgWJDdvkgWx5am58QzA60I
-ipkZ9QHcPffSs5RiGx4yfr58KqAmwFphGCY8W7v4LqaENdECQQD9H5VTW9g4gj1c
-j3uNYvSI/D7a9P7gfI+ziczuwMm5xsBx3D/t5TAr3SJKNne3sl1E6ZERCUbzxf+C
-k58EiHx1AkEA3fRLGqDOq7EcQhbjTcA/v/t5MwlGEUsS9+XrqOWn50YuoIwRZJ3v
-qHRQzfQfFNklGtfBvwQ4md3irXjMeGVprwJBAMEAuwiDiHuV+xm/ofKtmE13IKot
-ksYy1BOOp/8IawhHXueyi+BmF/PqOkIiA+jCjNGF0oIN89beizPSQbbgJx0CQG/K
-qL1bu1ys0y/SeWBi8XkP/0aeaCUzq/UiYCTsrzoEll2UzvnftqMhGsXxLGqCyHaR
-r2s3hA6zvIVlL4+AfM8CQQClq+WDrC5VKciLYakZNWJjV1m+H2Ut/0fXdUjKHajE
-FWLcsrOhADf6bkTb71GwPxnKRkkRmud5upP0ZYYTqM4X
------END RSA PRIVATE KEY-----
diff --git a/test/net/imap/test_imap.rb b/test/net/imap/test_imap.rb
index cff09d3cbc..0ee217965c 100644
--- a/test/net/imap/test_imap.rb
+++ b/test/net/imap/test_imap.rb
@@ -2,194 +2,10 @@ require "net/imap"
require "test/unit"
class IMAPTest < Test::Unit::TestCase
- CA_FILE = File.expand_path("cacert.pem", File.dirname(__FILE__))
- SERVER_KEY = File.expand_path("server.key", File.dirname(__FILE__))
- SERVER_CERT = File.expand_path("server.crt", File.dirname(__FILE__))
-
- def test_encode_utf7
- utf8 = "\357\274\241\357\274\242\357\274\243".force_encoding("UTF-8")
- s = Net::IMAP.encode_utf7(utf8)
- assert_equal("&,yH,Iv8j-".force_encoding("UTF-8"), s)
- end
-
- def test_decode_utf7
- s = Net::IMAP.decode_utf7("&,yH,Iv8j-")
- utf8 = "\357\274\241\357\274\242\357\274\243".force_encoding("UTF-8")
- assert_equal(utf8, s)
- end
-
- def test_imaps_unknown_ca
- if defined?(OpenSSL)
- assert_raise(OpenSSL::SSL::SSLError) do
- imaps_test do |port|
- Net::IMAP.new("localhost",
- :port => port,
- :ssl => true)
- end
- end
- end
- end
-
- def test_imaps_with_ca_file
- if defined?(OpenSSL)
- assert_nothing_raised do
- imaps_test do |port|
- Net::IMAP.new("localhost",
- :port => port,
- :ssl => { :ca_file => CA_FILE })
- end
- end
- end
- end
-
- def test_imaps_verify_none
- if defined?(OpenSSL)
- assert_nothing_raised do
- imaps_test do |port|
- Net::IMAP.new("localhost",
- :port => port,
- :ssl => { :verify_mode => OpenSSL::SSL::VERIFY_NONE })
- end
- end
- end
- end
-
- def test_imaps_post_connection_check
- if defined?(OpenSSL)
- assert_raise(OpenSSL::SSL::SSLError) do
- imaps_test do |port|
- Net::IMAP.new("127.0.0.1",
- :port => port,
- :ssl => { :ca_file => CA_FILE })
- end
- end
- end
- end
-
- def test_starttls
- imap = nil
- if defined?(OpenSSL)
- starttls_test do |port|
- imap = Net::IMAP.new("localhost", :port => port)
- imap.starttls(:ca_file => CA_FILE)
- imap
- end
- end
- ensure
- if imap && !imap.disconnected?
- imap.disconnect
- end
- end
-
- def test_unexpected_eof
- server = TCPServer.new(0)
- port = server.addr[1]
- Thread.start do
- begin
- sock = server.accept
- begin
- sock.print("* OK test server\r\n")
- sock.gets
-# sock.print("* BYE terminating connection\r\n")
-# sock.print("RUBY0001 OK LOGOUT completed\r\n")
- ensure
- sock.close
- end
- rescue
- end
- end
- begin
- begin
- imap = Net::IMAP.new("localhost", :port => port)
- assert_raise(EOFError) do
- imap.logout
- end
- ensure
- imap.disconnect if imap
- end
- ensure
- server.close
- end
- end
-
- private
-
- def imaps_test
- server = TCPServer.new(0)
- port = server.addr[1]
- ctx = OpenSSL::SSL::SSLContext.new
- ctx.ca_file = CA_FILE
- ctx.key = File.open(SERVER_KEY) { |f|
- OpenSSL::PKey::RSA.new(f)
- }
- ctx.cert = File.open(SERVER_CERT) { |f|
- OpenSSL::X509::Certificate.new(f)
- }
- ssl_server = OpenSSL::SSL::SSLServer.new(server, ctx)
- Thread.start do
- begin
- sock = ssl_server.accept
- begin
- sock.print("* OK test server\r\n")
- sock.gets
- sock.print("* BYE terminating connection\r\n")
- sock.print("RUBY0001 OK LOGOUT completed\r\n")
- ensure
- sock.close
- end
- rescue
- end
- end
- begin
- begin
- imap = yield(port)
- imap.logout
- ensure
- imap.disconnect if imap
- end
- ensure
- ssl_server.close
- end
- end
-
- def starttls_test
- server = TCPServer.new(0)
- port = server.addr[1]
- Thread.start do
- begin
- sock = server.accept
- sock.print("* OK test server\r\n")
- sock.gets
- sock.print("RUBY0001 OK completed\r\n")
- ctx = OpenSSL::SSL::SSLContext.new
- ctx.ca_file = CA_FILE
- ctx.key = File.open(SERVER_KEY) { |f|
- OpenSSL::PKey::RSA.new(f)
- }
- ctx.cert = File.open(SERVER_CERT) { |f|
- OpenSSL::X509::Certificate.new(f)
- }
- sock = OpenSSL::SSL::SSLSocket.new(sock, ctx)
- begin
- sock.accept
- sock.gets
- sock.print("* BYE terminating connection\r\n")
- sock.print("RUBY0002 OK LOGOUT completed\r\n")
- ensure
- sock.close
- end
- rescue
- end
- end
- begin
- begin
- imap = yield(port)
- imap.logout
- ensure
- imap.disconnect if imap
- end
- ensure
- server.close
- end
+ def test_parse_nomodesq
+ parser = Net::IMAP::ResponseParser.new
+ r = parser.parse(%Q'* OK [NOMODSEQ] Sorry, modsequences have not been enabled on this mailbox\r\n')
+ assert_equal("OK", r.name)
+ assert_equal("NOMODSEQ", r.data.code.name)
end
end
diff --git a/test/nkf/test_kconv.rb b/test/nkf/test_kconv.rb
index 8581f10e4e..2533424705 100644
--- a/test/nkf/test_kconv.rb
+++ b/test/nkf/test_kconv.rb
@@ -2,73 +2,70 @@ require 'test/unit'
require 'kconv'
class TestKconv < Test::Unit::TestCase
- def setup
- @euc_str = "\
+ EUC_STR = "\
\xa5\xaa\xa5\xd6\xa5\xb8\xa5\xa7\xa5\xaf\xa5\xc8\xbb\xd8\xb8\xfe\
\xa5\xd7\xa5\xed\xa5\xb0\xa5\xe9\xa5\xdf\xa5\xf3\xa5\xb0\xb8\xc0\xb8\xec
-\x52\x75\x62\x79".force_encoding('EUC-JP')
- @utf8_str = "\
+\x52\x75\x62\x79"
+ UTF8_STR = "\
\xe3\x82\xaa\xe3\x83\x96\xe3\x82\xb8\xe3\x82\xa7\
\xe3\x82\xaf\xe3\x83\x88\xe6\x8c\x87\xe5\x90\x91\
\xe3\x83\x97\xe3\x83\xad\xe3\x82\xb0\xe3\x83\xa9\xe3\x83\x9f\
\xe3\x83\xb3\xe3\x82\xb0\xe8\xa8\x80\xe8\xaa\x9e
-\x52\x75\x62\x79".force_encoding('UTF-8')
- @sjis_str = "\
+\x52\x75\x62\x79"
+ SJIS_STR = "\
\x83\x49\x83\x75\x83\x57\x83\x46\x83\x4e\x83\x67\x8e\x77\x8c\xfc\
\x83\x76\x83\x8d\x83\x4f\x83\x89\x83\x7e\x83\x93\x83\x4f\x8c\xbe\x8c\xea
-\x52\x75\x62\x79".force_encoding('Shift_JIS')
- @jis_str = "\
+\x52\x75\x62\x79"
+ JIS_STR = "\
\x1b\x24\x42\x25\x2a\x25\x56\x25\x38\x25\x27\x25\x2f\x25\x48\x3b\x58\x38\x7e\
\x25\x57\x25\x6d\x25\x30\x25\x69\x25\x5f\x25\x73\x25\x30\x38\x40\x38\x6c\x1b\x28\x42
-\x52\x75\x62\x79".force_encoding('ISO-2022-JP')
- end
-
+\x52\x75\x62\x79"
def test_eucjp
- assert(@euc_str.iseuc)
- assert_equal(::Kconv::EUC, Kconv.guess(@euc_str))
- assert_equal(@euc_str, @euc_str.toeuc)
- assert_equal(@euc_str, @sjis_str.toeuc)
- assert_equal(@euc_str, @utf8_str.toeuc)
- assert_equal(@euc_str, @jis_str.toeuc)
- assert_equal(@euc_str, @euc_str.kconv(::NKF::EUC))
- assert_equal(@euc_str, @sjis_str.kconv(::NKF::EUC))
- assert_equal(@euc_str, @utf8_str.kconv(::NKF::EUC))
- assert_equal(@euc_str, @jis_str.kconv(::NKF::EUC))
+ assert(EUC_STR.iseuc)
+ assert_equal(::Kconv::EUC, Kconv.guess(EUC_STR))
+ assert_equal(EUC_STR, EUC_STR.toeuc)
+ assert_equal(EUC_STR, SJIS_STR.toeuc)
+ assert_equal(EUC_STR, UTF8_STR.toeuc)
+ assert_equal(EUC_STR, JIS_STR.toeuc)
+ assert_equal(EUC_STR, EUC_STR.kconv(::NKF::EUC))
+ assert_equal(EUC_STR, SJIS_STR.kconv(::NKF::EUC))
+ assert_equal(EUC_STR, UTF8_STR.kconv(::NKF::EUC))
+ assert_equal(EUC_STR, JIS_STR.kconv(::NKF::EUC))
end
def test_shiftjis
- assert(@sjis_str.issjis)
- assert_equal(::Kconv::SJIS, Kconv.guess(@sjis_str))
- assert_equal(@sjis_str, @euc_str.tosjis)
- assert_equal(@sjis_str, @sjis_str.tosjis)
- assert_equal(@sjis_str, @utf8_str.tosjis)
- assert_equal(@sjis_str, @jis_str.tosjis)
- assert_equal(@sjis_str, @euc_str.kconv(::NKF::SJIS))
- assert_equal(@sjis_str, @sjis_str.kconv(::NKF::SJIS))
- assert_equal(@sjis_str, @utf8_str.kconv(::NKF::SJIS))
- assert_equal(@sjis_str, @jis_str.kconv(::NKF::SJIS))
+ assert(SJIS_STR.issjis)
+ assert_equal(::Kconv::SJIS, Kconv.guess(SJIS_STR))
+ assert_equal(SJIS_STR, EUC_STR.tosjis)
+ assert_equal(SJIS_STR, SJIS_STR.tosjis)
+ assert_equal(SJIS_STR, UTF8_STR.tosjis)
+ assert_equal(SJIS_STR, JIS_STR.tosjis)
+ assert_equal(SJIS_STR, EUC_STR.kconv(::NKF::SJIS))
+ assert_equal(SJIS_STR, SJIS_STR.kconv(::NKF::SJIS))
+ assert_equal(SJIS_STR, UTF8_STR.kconv(::NKF::SJIS))
+ assert_equal(SJIS_STR, JIS_STR.kconv(::NKF::SJIS))
end
def test_utf8
- assert(@utf8_str.isutf8)
- assert_equal(::Kconv::UTF8, Kconv.guess(@utf8_str))
- assert_equal(@utf8_str, @euc_str.toutf8)
- assert_equal(@utf8_str, @sjis_str.toutf8)
- assert_equal(@utf8_str, @utf8_str.toutf8)
- assert_equal(@utf8_str, @jis_str.toutf8)
- assert_equal(@utf8_str, @euc_str.kconv(::NKF::UTF8))
- assert_equal(@utf8_str, @sjis_str.kconv(::NKF::UTF8))
- assert_equal(@utf8_str, @utf8_str.kconv(::NKF::UTF8))
- assert_equal(@utf8_str, @jis_str.kconv(::NKF::UTF8))
+ assert(UTF8_STR.isutf8)
+ assert_equal(::Kconv::UTF8, Kconv.guess(UTF8_STR))
+ assert_equal(UTF8_STR, EUC_STR.toutf8)
+ assert_equal(UTF8_STR, SJIS_STR.toutf8)
+ assert_equal(UTF8_STR, UTF8_STR.toutf8)
+ assert_equal(UTF8_STR, JIS_STR.toutf8)
+ assert_equal(UTF8_STR, EUC_STR.kconv(::NKF::UTF8))
+ assert_equal(UTF8_STR, SJIS_STR.kconv(::NKF::UTF8))
+ assert_equal(UTF8_STR, UTF8_STR.kconv(::NKF::UTF8))
+ assert_equal(UTF8_STR, JIS_STR.kconv(::NKF::UTF8))
end
def test_jis
- assert_equal(::Kconv::JIS, Kconv.guess(@jis_str))
- assert_equal(@jis_str, @euc_str.tojis)
- assert_equal(@jis_str, @sjis_str.tojis)
- assert_equal(@jis_str, @utf8_str.tojis)
- assert_equal(@jis_str, @jis_str.tojis)
- assert_equal(@jis_str, @euc_str.kconv(::NKF::JIS))
- assert_equal(@jis_str, @sjis_str.kconv(::NKF::JIS))
- assert_equal(@jis_str, @utf8_str.kconv(::NKF::JIS))
- assert_equal(@jis_str, @jis_str.kconv(::NKF::JIS))
+ assert_equal(::Kconv::JIS, Kconv.guess(JIS_STR))
+ assert_equal(JIS_STR, EUC_STR.tojis)
+ assert_equal(JIS_STR, SJIS_STR.tojis)
+ assert_equal(JIS_STR, UTF8_STR.tojis)
+ assert_equal(JIS_STR, JIS_STR.tojis)
+ assert_equal(JIS_STR, EUC_STR.kconv(::NKF::JIS))
+ assert_equal(JIS_STR, SJIS_STR.kconv(::NKF::JIS))
+ assert_equal(JIS_STR, UTF8_STR.kconv(::NKF::JIS))
+ assert_equal(JIS_STR, JIS_STR.kconv(::NKF::JIS))
end
end
diff --git a/test/nkf/test_nkf.rb b/test/nkf/test_nkf.rb
index 2c6b964eb9..279ad59e1a 100644
--- a/test/nkf/test_nkf.rb
+++ b/test/nkf/test_nkf.rb
@@ -13,10 +13,4 @@ Ruby"
assert_equal(::NKF::EUC, NKF.guess(str_euc))
end
- def test_ruby_dev_36909
- assert_nothing_raised do
- 1000.times { NKF.nkf("--oc=eucJP-nkf", "foo") }
- end
- end
-
end
diff --git a/test/openssl/ssl_server.rb b/test/openssl/ssl_server.rb
index d3ad55d236..6e620629c5 100644
--- a/test/openssl/ssl_server.rb
+++ b/test/openssl/ssl_server.rb
@@ -53,7 +53,7 @@ tcps = nil
port = port + i
break
rescue Errno::EADDRINUSE
- next
+ next
end
}
ssls = OpenSSL::SSL::SSLServer.new(tcps, ctx)
diff --git a/test/openssl/test_asn1.rb b/test/openssl/test_asn1.rb
index 86811a464c..f196bc48fb 100644
--- a/test/openssl/test_asn1.rb
+++ b/test/openssl/test_asn1.rb
@@ -169,7 +169,7 @@ class OpenSSL::TestASN1 < Test::Unit::TestCase
assert_equal(OpenSSL::ASN1::OctetString, ext.value[2].class)
extv = OpenSSL::ASN1.decode(ext.value[2].value)
assert_equal(OpenSSL::ASN1::BitString, extv.class)
- str = "\000"; str[0] = 0b00000110.chr
+ str = "\000"; str[0] = 0b00000110
assert_equal(str, extv.value)
ext = extensions.value[0].value[2] # subjetKeyIdentifier
diff --git a/test/openssl/test_cipher.rb b/test/openssl/test_cipher.rb
index cc21e818ed..d671908165 100644
--- a/test/openssl/test_cipher.rb
+++ b/test/openssl/test_cipher.rb
@@ -65,7 +65,7 @@ class OpenSSL::TestCipher < Test::Unit::TestCase
def test_empty_data
@c1.encrypt
- assert_raise(ArgumentError){ @c1.update("") }
+ assert_raises(ArgumentError){ @c1.update("") }
end
if OpenSSL::OPENSSL_VERSION_NUMBER > 0x00907000
diff --git a/test/openssl/test_ec.rb b/test/openssl/test_ec.rb
index 282bb67624..671901ca36 100644
--- a/test/openssl/test_ec.rb
+++ b/test/openssl/test_ec.rb
@@ -88,8 +88,8 @@ class OpenSSL::TestEC < Test::Unit::TestCase
for key in @keys
sig = key.dsa_sign_asn1(@data1)
assert_equal(key.dsa_verify_asn1(@data1, sig), true)
-
- assert_raise(OpenSSL::PKey::ECError) { key.dsa_sign_asn1(@data2) }
+
+ assert_raises(OpenSSL::PKey::ECError) { key.dsa_sign_asn1(@data2) }
end
end
diff --git a/test/openssl/test_pair.rb b/test/openssl/test_pair.rb
index fb0662f501..7273554362 100644
--- a/test/openssl/test_pair.rb
+++ b/test/openssl/test_pair.rb
@@ -54,11 +54,6 @@ module SSLPair
else
return c, s
end
- ensure
- if th && th.alive?
- th.kill
- th.join
- end
end
end
@@ -144,110 +139,6 @@ class OpenSSL::TestPair < Test::Unit::TestCase
}
end
- def test_read_nonblock
- ssl_pair {|s1, s2|
- err = nil
- assert_raise(OpenSSL::SSL::SSLError) {
- begin
- s2.read_nonblock(10)
- ensure
- err = $!
- end
- }
- assert_kind_of(IO::WaitReadable, err)
- s1.write "abc\ndef\n"
- IO.select([s2])
- assert_equal("ab", s2.read_nonblock(2))
- assert_equal("c\n", s2.gets)
- ret = nil
- assert_nothing_raised("[ruby-core:20298]") { ret = s2.read_nonblock(10) }
- assert_equal("def\n", ret)
- }
- end
-
- def test_write_nonblock
- ssl_pair {|s1, s2|
- n = 0
- begin
- n += s1.write_nonblock("a" * 100000)
- n += s1.write_nonblock("b" * 100000)
- n += s1.write_nonblock("c" * 100000)
- n += s1.write_nonblock("d" * 100000)
- n += s1.write_nonblock("e" * 100000)
- n += s1.write_nonblock("f" * 100000)
- rescue IO::WaitWritable
- end
- s1.close
- assert_equal(n, s2.read.length)
- }
- end
-
- def test_write_nonblock_with_buffered_data
- ssl_pair {|s1, s2|
- s1.write "foo"
- s1.write_nonblock("bar")
- s1.write "baz"
- s1.close
- assert_equal("foobarbaz", s2.read)
- }
- end
-
- def test_connect_accept_nonblock
- host = "127.0.0.1"
- port = 0
- ctx = OpenSSL::SSL::SSLContext.new()
- ctx.ciphers = "ADH"
- serv = TCPServer.new(host, port)
- ssls = OpenSSL::SSL::SSLServer.new(serv, ctx)
-
- port = serv.connect_address.ip_port
-
- sock1 = TCPSocket.new(host, port)
- sock2 = serv.accept
- serv.close
-
- th = Thread.new {
- s2 = OpenSSL::SSL::SSLSocket.new(sock2, ctx)
- s2.sync_close = true
- begin
- sleep 0.2
- s2.accept_nonblock
- rescue IO::WaitReadable
- IO.select([s2])
- retry
- rescue IO::WaitWritable
- IO.select(nil, [s2])
- retry
- end
- s2
- }
-
- sleep 0.1
- ctx = OpenSSL::SSL::SSLContext.new()
- ctx.ciphers = "ADH"
- s1 = OpenSSL::SSL::SSLSocket.new(sock1, ctx)
- begin
- sleep 0.2
- s1.connect_nonblock
- rescue IO::WaitReadable
- IO.select([s1])
- retry
- rescue IO::WaitWritable
- IO.select(nil, [s1])
- retry
- end
- s1.sync_close = true
-
- s2 = th.value
-
- s1.print "a\ndef"
- assert_equal("a\n", s2.gets)
- ensure
- serv.close if serv && !serv.closed?
- sock1.close if sock1 && !sock1.closed?
- sock2.close if sock2 && !sock2.closed?
- end
-
end
end
diff --git a/test/openssl/test_pkcs7.rb b/test/openssl/test_pkcs7.rb
index d86de36cc7..9b472c1795 100644
--- a/test/openssl/test_pkcs7.rb
+++ b/test/openssl/test_pkcs7.rb
@@ -35,7 +35,7 @@ class OpenSSL::TestPKCS7 < Test::Unit::TestCase
@ca_cert, @rsa2048, OpenSSL::Digest::SHA1.new)
end
- def issue_cert(*args)
+ def issue_cert(*args)
OpenSSL::TestUtils.issue_cert(*args)
end
@@ -46,7 +46,7 @@ class OpenSSL::TestPKCS7 < Test::Unit::TestCase
data = "aaaaa\r\nbbbbb\r\nccccc\r\n"
tmp = OpenSSL::PKCS7.sign(@ee1_cert, @rsa1024, data, ca_certs)
- p7 = OpenSSL::PKCS7.new(tmp.to_der)
+ p7 = OpenSSL::PKCS7::PKCS7.new(tmp.to_der)
certs = p7.certificates
signers = p7.signers
assert(p7.verify([], store))
@@ -65,7 +65,7 @@ class OpenSSL::TestPKCS7 < Test::Unit::TestCase
data = "aaaaa\nbbbbb\nccccc\n"
flag = OpenSSL::PKCS7::BINARY
tmp = OpenSSL::PKCS7.sign(@ee1_cert, @rsa1024, data, ca_certs, flag)
- p7 = OpenSSL::PKCS7.new(tmp.to_der)
+ p7 = OpenSSL::PKCS7::PKCS7.new(tmp.to_der)
certs = p7.certificates
signers = p7.signers
assert(p7.verify([], store))
@@ -77,7 +77,7 @@ class OpenSSL::TestPKCS7 < Test::Unit::TestCase
assert_equal(@ee1_cert.serial, signers[0].serial)
assert_equal(@ee1_cert.issuer.to_s, signers[0].issuer.to_s)
- # A signed-data which have multiple signatures can be created
+ # A signed-data which have multiple signatures can be created
# through the following steps.
# 1. create two signed-data
# 2. copy signerInfo and certificate from one to another
@@ -85,9 +85,9 @@ class OpenSSL::TestPKCS7 < Test::Unit::TestCase
tmp1 = OpenSSL::PKCS7.sign(@ee1_cert, @rsa1024, data, [], flag)
tmp2 = OpenSSL::PKCS7.sign(@ee2_cert, @rsa1024, data, [], flag)
tmp1.add_signer(tmp2.signers[0])
- tmp1.add_certificate(@ee2_cert)
+ tmp1.add_certificate(@ee2_cert)
- p7 = OpenSSL::PKCS7.new(tmp1.to_der)
+ p7 = OpenSSL::PKCS7::PKCS7.new(tmp1.to_der)
certs = p7.certificates
signers = p7.signers
assert(p7.verify([], store))
@@ -108,7 +108,7 @@ class OpenSSL::TestPKCS7 < Test::Unit::TestCase
data = "aaaaa\nbbbbb\nccccc\n"
flag = OpenSSL::PKCS7::BINARY|OpenSSL::PKCS7::DETACHED
tmp = OpenSSL::PKCS7.sign(@ee1_cert, @rsa1024, data, ca_certs, flag)
- p7 = OpenSSL::PKCS7.new(tmp.to_der)
+ p7 = OpenSSL::PKCS7::PKCS7.new(tmp.to_der)
a1 = OpenSSL::ASN1.decode(p7)
certs = p7.certificates
@@ -136,7 +136,7 @@ class OpenSSL::TestPKCS7 < Test::Unit::TestCase
data = "aaaaa\nbbbbb\nccccc\n"
tmp = OpenSSL::PKCS7.encrypt(certs, data, cipher, OpenSSL::PKCS7::BINARY)
- p7 = OpenSSL::PKCS7.new(tmp.to_der)
+ p7 = OpenSSL::PKCS7::PKCS7.new(tmp.to_der)
recip = p7.recipients
assert_equal(:enveloped, p7.type)
assert_equal(2, recip.size)
diff --git a/test/openssl/test_ssl.rb b/test/openssl/test_ssl.rb
index 4688552cd3..29d3d19edc 100644
--- a/test/openssl/test_ssl.rb
+++ b/test/openssl/test_ssl.rb
@@ -82,18 +82,18 @@ class OpenSSL::TestSSL < Test::Unit::TestCase
end
Thread.start do
- Thread.current.abort_on_exception = true
+ Thread.current.abort_on_exception = true
server_proc.call(ctx, ssl)
end
end
- rescue Errno::EBADF, IOError, Errno::EINVAL, Errno::ECONNABORTED
+ rescue Errno::EBADF, IOError
end
def start_server(port0, verify_mode, start_immediately, args = {}, &block)
ctx_proc = args[:ctx_proc]
server_proc = args[:server_proc]
server_proc ||= method(:readwrite_loop)
-
+
store = OpenSSL::X509::Store.new
store.add_cert(@ca_cert)
store.purpose = OpenSSL::X509::PURPOSE_SSL_CLIENT
@@ -120,7 +120,7 @@ class OpenSSL::TestSSL < Test::Unit::TestCase
begin
server = Thread.new do
- Thread.current.abort_on_exception = true
+ Thread.current.abort_on_exception = true
server_loop(ctx, ssls, server_proc)
end
@@ -128,25 +128,14 @@ class OpenSSL::TestSSL < Test::Unit::TestCase
block.call(server, port.to_i)
ensure
- begin
- begin
- tcps.shutdown
- rescue Errno::ENOTCONN
- # when `Errno::ENOTCONN: Socket is not connected' on some platforms,
- # call #close instead of #shutdown.
- tcps.close
- tcps = nil
- end if (tcps)
- if (server)
- server.join(5)
- if server.alive?
- server.kill
- server.join
- flunk("TCPServer was closed and SSLServer is still alive") unless $!
- end
+ tcps.close if (tcps)
+ if (server)
+ server.join(5)
+ if server.alive?
+ server.kill
+ server.join
+ flunk("TCPServer was closed and SSLServer is still alive") unless $!
end
- ensure
- tcps.close if (tcps)
end
end
end
@@ -166,21 +155,6 @@ class OpenSSL::TestSSL < Test::Unit::TestCase
assert_equal(ctx.setup, nil)
end
- def test_ssl_read_nonblock
- start_server(PORT, OpenSSL::SSL::VERIFY_NONE, true) { |server, port|
- sock = TCPSocket.new("127.0.0.1", port)
- ssl = OpenSSL::SSL::SSLSocket.new(sock)
- ssl.sync_close = true
- ssl.connect
- assert_raise(IO::WaitReadable) { ssl.read_nonblock(100) }
- ssl.write("abc\n")
- IO.select [ssl]
- assert_equal('a', ssl.read_nonblock(1))
- assert_equal("bc\n", ssl.read_nonblock(100))
- assert_raise(IO::WaitReadable) { ssl.read_nonblock(100) }
- }
- end
-
def test_connect_and_close
start_server(PORT, OpenSSL::SSL::VERIFY_NONE, true){|server, port|
sock = TCPSocket.new("127.0.0.1", port)
@@ -219,18 +193,6 @@ class OpenSSL::TestSSL < Test::Unit::TestCase
assert_equal(str, buf)
}
- # puts and gets
- ITERATIONS.times{
- str = "x" * 100 + "\n"
- ssl.puts(str)
- assert_equal(str, ssl.gets)
-
- str = "x" * 100
- ssl.puts(str)
- assert_equal(str, ssl.gets("\n", 100))
- assert_equal("\n", ssl.gets)
- }
-
# read and write
ITERATIONS.times{|i|
str = "x" * 100 + "\n"
@@ -251,7 +213,7 @@ class OpenSSL::TestSSL < Test::Unit::TestCase
def test_client_auth
vflag = OpenSSL::SSL::VERIFY_PEER|OpenSSL::SSL::VERIFY_FAIL_IF_NO_PEER_CERT
start_server(PORT, vflag, true){|server, port|
- assert_raise(OpenSSL::SSL::SSLError){
+ assert_raises(OpenSSL::SSL::SSLError){
sock = TCPSocket.new("127.0.0.1", port)
ssl = OpenSSL::SSL::SSLSocket.new(sock)
ssl.connect
@@ -390,10 +352,10 @@ class OpenSSL::TestSSL < Test::Unit::TestCase
sock = TCPSocket.new("127.0.0.1", port)
ssl = OpenSSL::SSL::SSLSocket.new(sock)
ssl.connect
- assert_raise(sslerr){ssl.post_connection_check("localhost.localdomain")}
- assert_raise(sslerr){ssl.post_connection_check("127.0.0.1")}
+ assert_raises(sslerr){ssl.post_connection_check("localhost.localdomain")}
+ assert_raises(sslerr){ssl.post_connection_check("127.0.0.1")}
assert(ssl.post_connection_check("localhost"))
- assert_raise(sslerr){ssl.post_connection_check("foo.example.com")}
+ assert_raises(sslerr){ssl.post_connection_check("foo.example.com")}
cert = ssl.peer_cert
assert(!OpenSSL::SSL.verify_certificate_identity(cert, "localhost.localdomain"))
@@ -416,8 +378,8 @@ class OpenSSL::TestSSL < Test::Unit::TestCase
ssl.connect
assert(ssl.post_connection_check("localhost.localdomain"))
assert(ssl.post_connection_check("127.0.0.1"))
- assert_raise(sslerr){ssl.post_connection_check("localhost")}
- assert_raise(sslerr){ssl.post_connection_check("foo.example.com")}
+ assert_raises(sslerr){ssl.post_connection_check("localhost")}
+ assert_raises(sslerr){ssl.post_connection_check("foo.example.com")}
cert = ssl.peer_cert
assert(OpenSSL::SSL.verify_certificate_identity(cert, "localhost.localdomain"))
@@ -438,9 +400,9 @@ class OpenSSL::TestSSL < Test::Unit::TestCase
ssl = OpenSSL::SSL::SSLSocket.new(sock)
ssl.connect
assert(ssl.post_connection_check("localhost.localdomain"))
- assert_raise(sslerr){ssl.post_connection_check("127.0.0.1")}
- assert_raise(sslerr){ssl.post_connection_check("localhost")}
- assert_raise(sslerr){ssl.post_connection_check("foo.example.com")}
+ assert_raises(sslerr){ssl.post_connection_check("127.0.0.1")}
+ assert_raises(sslerr){ssl.post_connection_check("localhost")}
+ assert_raises(sslerr){ssl.post_connection_check("foo.example.com")}
cert = ssl.peer_cert
assert(OpenSSL::SSL.verify_certificate_identity(cert, "localhost.localdomain"))
assert(!OpenSSL::SSL.verify_certificate_identity(cert, "127.0.0.1"))
@@ -454,10 +416,7 @@ class OpenSSL::TestSSL < Test::Unit::TestCase
start_server(PORT, OpenSSL::SSL::VERIFY_NONE, true) do |server, port|
2.times do
sock = TCPSocket.new("127.0.0.1", port)
- # Debian's openssl 0.9.8g-13 failed at assert(ssl.session_reused?),
- # when use default SSLContext. [ruby-dev:36167]
- ctx = OpenSSL::SSL::SSLContext.new("TLSv1")
- ssl = OpenSSL::SSL::SSLSocket.new(sock, ctx)
+ ssl = OpenSSL::SSL::SSLSocket.new(sock)
ssl.sync_close = true
ssl.session = last_session if last_session
ssl.connect
@@ -532,7 +491,7 @@ class OpenSSL::TestSSL < Test::Unit::TestCase
ctx.session_add(saved_session)
end
connections += 1
-
+
readwrite_loop(ctx, ssl)
end
@@ -570,50 +529,6 @@ class OpenSSL::TestSSL < Test::Unit::TestCase
end
end
end
-
- def test_tlsext_hostname
- return unless OpenSSL::SSL::SSLSocket.instance_methods.include?(:hostname)
-
- ctx_proc = Proc.new do |ctx, ssl|
- foo_ctx = ctx.dup
-
- ctx.servername_cb = Proc.new do |ssl, hostname|
- case hostname
- when 'foo.example.com'
- foo_ctx
- when 'bar.example.com'
- nil
- else
- raise "unknown hostname #{hostname.inspect}"
- end
- end
- end
-
- server_proc = Proc.new do |ctx, ssl|
- readwrite_loop(ctx, ssl)
- end
-
- start_server(PORT, OpenSSL::SSL::VERIFY_NONE, true, :ctx_proc => ctx_proc, :server_proc => server_proc) do |server, port|
- 2.times do |i|
- sock = TCPSocket.new("127.0.0.1", port)
- ctx = OpenSSL::SSL::SSLContext.new
- if defined?(OpenSSL::SSL::OP_NO_TICKET)
- # disable RFC4507 support
- ctx.options = OpenSSL::SSL::OP_NO_TICKET
- end
- ssl = OpenSSL::SSL::SSLSocket.new(sock, ctx)
- ssl.sync_close = true
- ssl.hostname = (i & 1 == 0) ? 'foo.example.com' : 'bar.example.com'
- ssl.connect
-
- str = "x" * 100 + "\n"
- ssl.puts(str)
- assert_equal(str, ssl.gets)
-
- ssl.close
- end
- end
- end
end
end
diff --git a/test/openssl/test_x509cert.rb b/test/openssl/test_x509cert.rb
index 398ab2ff34..a5a75ff1b6 100644
--- a/test/openssl/test_x509cert.rb
+++ b/test/openssl/test_x509cert.rb
@@ -28,7 +28,7 @@ class OpenSSL::TestX509Certificate < Test::Unit::TestCase
def test_serial
[1, 2**32, 2**100].each{|s|
cert = issue_cert(@ca, @rsa2048, s, Time.now, Time.now+3600, [],
- nil, nil, OpenSSL::Digest::SHA1.new)
+ nil, nil, OpenSSL::Digest::SHA1.new)
assert_equal(s, cert.serial)
cert = OpenSSL::X509::Certificate.new(cert.to_der)
assert_equal(s, cert.serial)
@@ -60,25 +60,25 @@ class OpenSSL::TestX509Certificate < Test::Unit::TestCase
def test_validity
now = Time.now until now && now.usec != 0
cert = issue_cert(@ca, @rsa2048, 1, now, now+3600, [],
- nil, nil, OpenSSL::Digest::SHA1.new)
+ nil, nil, OpenSSL::Digest::SHA1.new)
assert_not_equal(now, cert.not_before)
assert_not_equal(now+3600, cert.not_after)
now = Time.at(now.to_i)
cert = issue_cert(@ca, @rsa2048, 1, now, now+3600, [],
- nil, nil, OpenSSL::Digest::SHA1.new)
+ nil, nil, OpenSSL::Digest::SHA1.new)
assert_equal(now.getutc, cert.not_before)
assert_equal((now+3600).getutc, cert.not_after)
now = Time.at(0)
cert = issue_cert(@ca, @rsa2048, 1, now, now, [],
- nil, nil, OpenSSL::Digest::SHA1.new)
+ nil, nil, OpenSSL::Digest::SHA1.new)
assert_equal(now.getutc, cert.not_before)
assert_equal(now.getutc, cert.not_after)
now = Time.at(0x7fffffff)
cert = issue_cert(@ca, @rsa2048, 1, now, now, [],
- nil, nil, OpenSSL::Digest::SHA1.new)
+ nil, nil, OpenSSL::Digest::SHA1.new)
assert_equal(now.getutc, cert.not_before)
assert_equal(now.getutc, cert.not_after)
end
@@ -91,7 +91,7 @@ class OpenSSL::TestX509Certificate < Test::Unit::TestCase
["authorityKeyIdentifier","keyid:always",false],
]
ca_cert = issue_cert(@ca, @rsa2048, 1, Time.now, Time.now+3600, ca_exts,
- nil, nil, OpenSSL::Digest::SHA1.new)
+ nil, nil, OpenSSL::Digest::SHA1.new)
ca_cert.extensions.each_with_index{|ext, i|
assert_equal(ca_exts[i].first, ext.oid)
assert_equal(ca_exts[i].last, ext.critical?)
@@ -105,7 +105,7 @@ class OpenSSL::TestX509Certificate < Test::Unit::TestCase
["subjectAltName","email:ee1@ruby-lang.org",false],
]
ee1_cert = issue_cert(@ee1, @rsa1024, 2, Time.now, Time.now+1800, ee1_exts,
- ca_cert, @rsa2048, OpenSSL::Digest::SHA1.new)
+ ca_cert, @rsa2048, OpenSSL::Digest::SHA1.new)
assert_equal(ca_cert.subject.to_der, ee1_cert.issuer.to_der)
ee1_cert.extensions.each_with_index{|ext, i|
assert_equal(ee1_exts[i].first, ext.oid)
@@ -120,7 +120,7 @@ class OpenSSL::TestX509Certificate < Test::Unit::TestCase
["subjectAltName","email:ee2@ruby-lang.org",false],
]
ee2_cert = issue_cert(@ee2, @rsa1024, 3, Time.now, Time.now+1800, ee2_exts,
- ca_cert, @rsa2048, OpenSSL::Digest::MD5.new)
+ ca_cert, @rsa2048, OpenSSL::Digest::MD5.new)
assert_equal(ca_cert.subject.to_der, ee2_cert.issuer.to_der)
ee2_cert.extensions.each_with_index{|ext, i|
assert_equal(ee2_exts[i].first, ext.oid)
@@ -131,7 +131,7 @@ class OpenSSL::TestX509Certificate < Test::Unit::TestCase
def test_sign_and_verify
cert = issue_cert(@ca, @rsa2048, 1, Time.now, Time.now+3600, [],
- nil, nil, OpenSSL::Digest::SHA1.new)
+ nil, nil, OpenSSL::Digest::SHA1.new)
assert_equal(false, cert.verify(@rsa1024))
assert_equal(true, cert.verify(@rsa2048))
assert_equal(false, cert.verify(@dsa256))
@@ -140,7 +140,7 @@ class OpenSSL::TestX509Certificate < Test::Unit::TestCase
assert_equal(false, cert.verify(@rsa2048))
cert = issue_cert(@ca, @rsa2048, 1, Time.now, Time.now+3600, [],
- nil, nil, OpenSSL::Digest::MD5.new)
+ nil, nil, OpenSSL::Digest::MD5.new)
assert_equal(false, cert.verify(@rsa1024))
assert_equal(true, cert.verify(@rsa2048))
assert_equal(false, cert.verify(@dsa256))
@@ -149,25 +149,25 @@ class OpenSSL::TestX509Certificate < Test::Unit::TestCase
assert_equal(false, cert.verify(@rsa2048))
cert = issue_cert(@ca, @dsa512, 1, Time.now, Time.now+3600, [],
- nil, nil, OpenSSL::Digest::DSS1.new)
+ nil, nil, OpenSSL::Digest::DSS1.new)
assert_equal(false, cert.verify(@rsa1024))
assert_equal(false, cert.verify(@rsa2048))
assert_equal(false, cert.verify(@dsa256))
assert_equal(true, cert.verify(@dsa512))
- cert.not_after = Time.now
+ cert.not_after = Time.now
assert_equal(false, cert.verify(@dsa512))
- assert_raise(OpenSSL::X509::CertificateError){
+ assert_raises(OpenSSL::X509::CertificateError){
cert = issue_cert(@ca, @rsa2048, 1, Time.now, Time.now+3600, [],
- nil, nil, OpenSSL::Digest::DSS1.new)
+ nil, nil, OpenSSL::Digest::DSS1.new)
}
- assert_raise(OpenSSL::X509::CertificateError){
+ assert_raises(OpenSSL::X509::CertificateError){
cert = issue_cert(@ca, @dsa512, 1, Time.now, Time.now+3600, [],
- nil, nil, OpenSSL::Digest::MD5.new)
+ nil, nil, OpenSSL::Digest::MD5.new)
}
- assert_raise(OpenSSL::X509::CertificateError){
+ assert_raises(OpenSSL::X509::CertificateError){
cert = issue_cert(@ca, @dsa512, 1, Time.now, Time.now+3600, [],
- nil, nil, OpenSSL::Digest::SHA1.new)
+ nil, nil, OpenSSL::Digest::SHA1.new)
}
end
end
diff --git a/test/openssl/test_x509crl.rb b/test/openssl/test_x509crl.rb
index e1f4e009cd..444a00a586 100644
--- a/test/openssl/test_x509crl.rb
+++ b/test/openssl/test_x509crl.rb
@@ -125,13 +125,13 @@ class OpenSSL::TestX509CRL < Test::Unit::TestCase
def test_extension
cert_exts = [
["basicConstraints", "CA:TRUE", true],
- ["subjectKeyIdentifier", "hash", false],
- ["authorityKeyIdentifier", "keyid:always", false],
+ ["subjectKeyIdentifier", "hash", false],
+ ["authorityKeyIdentifier", "keyid:always", false],
["subjectAltName", "email:xyzzy@ruby-lang.org", false],
["keyUsage", "cRLSign, keyCertSign", true],
]
crl_exts = [
- ["authorityKeyIdentifier", "keyid:always", false],
+ ["authorityKeyIdentifier", "keyid:always", false],
["issuerAltName", "issuer:copy", false],
]
diff --git a/test/openssl/test_x509store.rb b/test/openssl/test_x509store.rb
index fc7c35e3dd..b0fe597262 100644
--- a/test/openssl/test_x509store.rb
+++ b/test/openssl/test_x509store.rb
@@ -198,7 +198,7 @@ class OpenSSL::TestX509Store < Test::Unit::TestCase
nil, nil, OpenSSL::Digest::SHA1.new)
store = OpenSSL::X509::Store.new
store.add_cert(ca1_cert)
- assert_raise(OpenSSL::X509::StoreError){
+ assert_raises(OpenSSL::X509::StoreError){
store.add_cert(ca1_cert) # add same certificate twice
}
@@ -209,7 +209,7 @@ class OpenSSL::TestX509Store < Test::Unit::TestCase
crl2 = issue_crl(revoke_info, 2, now+1800, now+3600, [],
ca1_cert, @rsa2048, OpenSSL::Digest::SHA1.new)
store.add_crl(crl1)
- assert_raise(OpenSSL::X509::StoreError){
+ assert_raises(OpenSSL::X509::StoreError){
store.add_crl(crl2) # add CRL issued by same CA twice.
}
end
diff --git a/test/openssl/utils.rb b/test/openssl/utils.rb
index 2edb7b0c99..c923705b86 100644
--- a/test/openssl/utils.rb
+++ b/test/openssl/utils.rb
@@ -96,16 +96,16 @@ Q1VB8qkJN7rA7/2HrCR3gTsWNb1YhAsnFsoeRscC+LxXoXi9OAIUBG98h4tilg6S
cert
end
- def issue_crl(revoke_info, serial, lastup, nextup, extensions,
+ def issue_crl(revoke_info, serial, lastup, nextup, extensions,
issuer, issuer_key, digest)
crl = OpenSSL::X509::CRL.new
crl.issuer = issuer.subject
crl.version = 1
crl.last_update = lastup
crl.next_update = nextup
- revoke_info.each{|rserial, time, reason_code|
+ revoke_info.each{|serial, time, reason_code|
revoked = OpenSSL::X509::Revoked.new
- revoked.serial = rserial
+ revoked.serial = serial
revoked.time = time
enum = OpenSSL::ASN1::Enumerated(reason_code)
ext = OpenSSL::X509::Extension.new("CRLReason", enum)
diff --git a/test/optparse/test_noarg.rb b/test/optparse/test_noarg.rb
index 329956a61a..28c469093d 100644
--- a/test/optparse/test_noarg.rb
+++ b/test/optparse/test_noarg.rb
@@ -18,7 +18,7 @@ module TestOptionParser::NoArg
end
def test_short
- assert_raise(OptionParser::InvalidOption) {@opt.parse!(%w"-xq")}
+ assert_raises(OptionParser::InvalidOption) {@opt.parse!(%w"-xq")}
assert_equal(%w"", no_error {@opt.parse!(%w"-x")})
assert_equal(true, @flag)
@flag = nil
@@ -27,11 +27,11 @@ module TestOptionParser::NoArg
end
def test_abbrev
- assert_raise(OptionParser::InvalidOption) {@opt.parse!(%w"-oq")}
+ assert_raises(OptionParser::InvalidOption) {@opt.parse!(%w"-oq")}
assert_equal(%w"", no_error {@opt.parse!(%w"-o")})
assert_equal(true, @flag)
@flag = nil
- assert_raise(OptionParser::InvalidOption) {@opt.parse!(%w"-O")}
+ assert_raises(OptionParser::InvalidOption) {@opt.parse!(%w"-O")}
assert_nil(@flag)
@flag = nil
assert_equal(%w"foo", no_error {@opt.parse!(%w"-o foo")})
@@ -39,7 +39,7 @@ module TestOptionParser::NoArg
end
def test_long
- assert_raise(OptionParser::NeedlessArgument) {@opt.parse!(%w"--option=x")}
+ assert_raises(OptionParser::NeedlessArgument) {@opt.parse!(%w"--option=x")}
assert_equal(%w"", no_error {@opt.parse!(%w"--opt")})
assert_equal(true, @flag)
@flag = nil
@@ -49,8 +49,8 @@ module TestOptionParser::NoArg
def test_ambiguous
@opt.def_option("--open") {|x|}
- assert_raise(OptionParser::AmbiguousOption) {@opt.parse!(%w"--op")}
- assert_raise(OptionParser::AmbiguousOption) {@opt.parse!(%w"-o")}
+ assert_raises(OptionParser::AmbiguousOption) {@opt.parse!(%w"--op")}
+ assert_raises(OptionParser::AmbiguousOption) {@opt.parse!(%w"-o")}
assert_equal(%w"", no_error {@opt.parse!(%w"--opt")})
assert_equal(true, @flag)
end
diff --git a/test/optparse/test_optparse.rb b/test/optparse/test_optparse.rb
index 6aa8fac757..9c73399f5b 100644
--- a/test/optparse/test_optparse.rb
+++ b/test/optparse/test_optparse.rb
@@ -8,8 +8,6 @@ class TestOptionParser < Test::Unit::TestCase
end
def no_error(*args)
assert_nothing_raised(*args) {return yield}
- ensure
- $!.backtrace.delete_if {|e| /\A#{Regexp.quote(__FILE__)}:#{__LINE__-2}/o =~ e} if $!
end
def test_permute
diff --git a/test/optparse/test_placearg.rb b/test/optparse/test_placearg.rb
index ea5810cbc5..f4fd249b7f 100644
--- a/test/optparse/test_placearg.rb
+++ b/test/optparse/test_placearg.rb
@@ -5,7 +5,6 @@ class TestOptionParser::PlaceArg < TestOptionParser
super
@opt.def_option("-x [VAL]") {|x| @flag = x}
@opt.def_option("--option [VAL]") {|x| @flag = x}
- @opt.def_option("-T [level]", /^[0-4]$/, Integer) {|x| @topt = x}
@opt.def_option("-n") {}
end
@@ -43,11 +42,4 @@ class TestOptionParser::PlaceArg < TestOptionParser
assert_equal(%w"", no_error {@opt.parse!(%w"--opt bar")})
assert_equal("bar", @flag)
end
-
- def test_conv
- assert_equal(%w"te.rb", no_error('[ruby-dev:38333]') {@opt.parse!(%w"-T te.rb")})
- assert_nil(@topt)
- assert_equal(%w"te.rb", no_error('[ruby-dev:38333]') {@opt.parse!(%w"-T1 te.rb")})
- assert_equal(1, @topt)
- end
end
diff --git a/test/optparse/test_reqarg.rb b/test/optparse/test_reqarg.rb
index 579794695a..0999e5e603 100644
--- a/test/optparse/test_reqarg.rb
+++ b/test/optparse/test_reqarg.rb
@@ -32,7 +32,7 @@ module TestOptionParser::ReqArg
end
def test_short
- assert_raise(OptionParser::MissingArgument) {@opt.parse!(%w"-x")}
+ assert_raises(OptionParser::MissingArgument) {@opt.parse!(%w"-x")}
assert_equal(%w"", no_error {@opt.parse!(%w"-x foo")})
assert_equal("foo", @flag)
assert_equal(%w"", no_error {@opt.parse!(%w"-xbar")})
@@ -42,7 +42,7 @@ module TestOptionParser::ReqArg
end
def test_abbrev
- assert_raise(OptionParser::MissingArgument) {@opt.parse!(%w"-o")}
+ assert_raises(OptionParser::MissingArgument) {@opt.parse!(%w"-o")}
assert_equal(%w"", no_error {@opt.parse!(%w"-o foo")})
assert_equal("foo", @flag)
assert_equal(%w"", no_error {@opt.parse!(%w"-obar")})
@@ -52,7 +52,7 @@ module TestOptionParser::ReqArg
end
def test_long
- assert_raise(OptionParser::MissingArgument) {@opt.parse!(%w"--opt")}
+ assert_raises(OptionParser::MissingArgument) {@opt.parse!(%w"--opt")}
assert_equal(%w"", no_error {@opt.parse!(%w"--opt foo")})
assert_equal("foo", @flag)
assert_equal(%w"foo", no_error {@opt.parse!(%w"--opt= foo")})
@@ -60,16 +60,4 @@ module TestOptionParser::ReqArg
assert_equal(%w"", no_error {@opt.parse!(%w"--opt=foo")})
assert_equal("foo", @flag)
end
-
- class TestOptionParser::WithPattern < TestOptionParser
- def test_pattern
- pat = num = nil
- @opt.def_option("--pattern=VAL", /(\w+)(?:\s*:\s*(\w+))?/) {|x, y, z| pat = [x, y, z]}
- @opt.def_option("-T NUM", /\A[1-4]\z/) {|n| num = n}
- no_error {@opt.parse!(%w"--pattern=key:val")}
- assert_equal(%w"key:val key val", pat, '[ruby-list:45645]')
- no_error {@opt.parse!(%w"-T 4")}
- assert_equal("4", num, '[ruby-dev:37514]')
- end
- end
end
diff --git a/test/ostruct/test_ostruct.rb b/test/ostruct/test_ostruct.rb
index d92092339a..24ed17f800 100644
--- a/test/ostruct/test_ostruct.rb
+++ b/test/ostruct/test_ostruct.rb
@@ -20,32 +20,4 @@ class TC_OpenStruct < Test::Unit::TestCase
o2.instance_eval{@table = {:a => 'b'}}
assert_not_equal(o1, o2)
end
-
- def test_inspect
- foo = OpenStruct.new
- assert_equal("#<OpenStruct>", foo.inspect)
- foo.bar = 1
- foo.baz = 2
- assert_equal("#<OpenStruct bar=1, baz=2>", foo.inspect)
-
- foo = OpenStruct.new
- foo.bar = OpenStruct.new
- assert_equal('#<OpenStruct bar=#<OpenStruct>>', foo.inspect)
- foo.bar.foo = foo
- assert_equal('#<OpenStruct bar=#<OpenStruct foo=#<OpenStruct ...>>>', foo.inspect)
- end
-
- def test_frozen
- o = OpenStruct.new
- o.a = 'a'
- o.freeze
- assert_raise(TypeError) {o.b = 'b'}
- assert_not_respond_to(o, :b)
- assert_raise(TypeError) {o.a = 'z'}
- assert_equal('a', o.a)
- o = OpenStruct.new :a => 42
- def o.frozen?; nil end
- o.freeze
- assert_raise(TypeError, '[ruby-core:22559]') {o.a = 1764}
- end
end
diff --git a/test/pathname/test_pathname.rb b/test/pathname/test_pathname.rb
index a9f7149633..9b0b9c01e8 100644
--- a/test/pathname/test_pathname.rb
+++ b/test/pathname/test_pathname.rb
@@ -269,101 +269,22 @@ class TestPathname < Test::Unit::TestCase
defassert_raise(:relative_path_from, ArgumentError, "a", "..")
defassert_raise(:relative_path_from, ArgumentError, ".", "..")
- def with_tmpchdir(base=nil)
- Dir.mktmpdir(base) {|d|
- d = Pathname.new(d).realpath.to_s
- Dir.chdir(d) {
- yield d
- }
- }
+ def realpath(path)
+ Pathname.new(path).realpath.to_s
end
- def has_symlink?
+ def test_realpath
begin
File.symlink(nil, nil)
rescue NotImplementedError
- return false
+ return
rescue TypeError
end
- return true
- end
-
- def realpath(path)
- Pathname.new(path).realpath.to_s
- end
-
- def test_realpath
- return if !has_symlink?
- with_tmpchdir('rubytest-pathname') {|dir|
- assert_raise(Errno::ENOENT) { realpath("#{dir}/not-exist") }
+ Dir.mktmpdir('rubytest-pathname') {|dir|
File.symlink("not-exist-target", "#{dir}/not-exist")
assert_raise(Errno::ENOENT) { realpath("#{dir}/not-exist") }
-
File.symlink("loop", "#{dir}/loop")
assert_raise(Errno::ELOOP) { realpath("#{dir}/loop") }
-
- File.symlink("../#{File.basename(dir)}/./not-exist-target", "#{dir}/not-exist2")
- assert_raise(Errno::ENOENT) { realpath("#{dir}/not-exist2") }
-
- File.open("#{dir}/exist-target", "w") {}
- File.symlink("../#{File.basename(dir)}/./exist-target", "#{dir}/exist2")
- assert_nothing_raised { realpath("#{dir}/exist2") }
-
- File.symlink("loop-relative", "loop-relative")
- assert_raise(Errno::ELOOP) { realpath("#{dir}/loop-relative") }
-
- Dir.mkdir("exist")
- assert_equal("#{dir}/exist", realpath("exist"))
-
- File.symlink("loop1/loop1", "loop1")
- assert_raise(Errno::ELOOP) { realpath("#{dir}/loop1") }
-
- File.symlink("loop2", "loop3")
- File.symlink("loop3", "loop2")
- assert_raise(Errno::ELOOP) { realpath("#{dir}/loop2") }
-
- Dir.mkdir("b")
-
- File.symlink("b", "c")
- assert_equal("#{dir}/b", realpath("c"))
- assert_equal("#{dir}/b", realpath("c/../c"))
- assert_equal("#{dir}/b", realpath("c/../c/../c/."))
-
- File.symlink("..", "b/d")
- assert_equal("#{dir}/b", realpath("c/d/c/d/c"))
-
- File.symlink("#{dir}/b", "e")
- assert_equal("#{dir}/b", realpath("e"))
-
- Dir.mkdir("f")
- Dir.mkdir("f/g")
- File.symlink("f/g", "h")
- assert_equal("#{dir}/f/g", realpath("h"))
- File.chmod(0000, "f")
- assert_raise(Errno::EACCES) { realpath("h") }
- File.chmod(0755, "f")
- }
- end
-
- def realdirpath(path)
- Pathname.new(path).realdirpath.to_s
- end
-
- def test_realdirpath
- return if !has_symlink?
- Dir.mktmpdir('rubytest-pathname') {|dir|
- rdir = realpath(dir)
- assert_equal("#{rdir}/not-exist", realdirpath("#{dir}/not-exist"))
- assert_raise(Errno::ENOENT) { realdirpath("#{dir}/not-exist/not-exist-child") }
- File.symlink("not-exist-target", "#{dir}/not-exist")
- assert_equal("#{rdir}/not-exist-target", realdirpath("#{dir}/not-exist"))
- File.symlink("../#{File.basename(dir)}/./not-exist-target", "#{dir}/not-exist2")
- assert_equal("#{rdir}/not-exist-target", realdirpath("#{dir}/not-exist2"))
- File.open("#{dir}/exist-target", "w") {}
- File.symlink("../#{File.basename(dir)}/./exist-target", "#{dir}/exist")
- assert_equal("#{rdir}/exist-target", realdirpath("#{dir}/exist"))
- File.symlink("loop", "#{dir}/loop")
- assert_raise(Errno::ELOOP) { realdirpath("#{dir}/loop") }
}
end
@@ -460,26 +381,6 @@ class TestPathname < Test::Unit::TestCase
def pathsub(path, pat, repl) Pathname.new(path).sub(pat, repl).to_s end
defassert(:pathsub, "a.o", "a.c", /\.c\z/, ".o")
- def pathsubext(path, repl) Pathname.new(path).sub_ext(repl).to_s end
- defassert(:pathsubext, 'a.o', 'a.c', '.o')
- defassert(:pathsubext, 'a.o', 'a.c++', '.o')
- defassert(:pathsubext, 'a.png', 'a.gif', '.png')
- defassert(:pathsubext, 'ruby.tar.bz2', 'ruby.tar.gz', '.bz2')
- defassert(:pathsubext, 'd/a.o', 'd/a.c', '.o')
- defassert(:pathsubext, 'foo', 'foo.exe', '')
- defassert(:pathsubext, 'lex.yy.o', 'lex.yy.c', '.o')
- defassert(:pathsubext, 'fooaa.o', 'fooaa', '.o')
- defassert(:pathsubext, 'd.e/aa.o', 'd.e/aa', '.o')
-
- def test_sub_matchdata
- result = Pathname("abc.gif").sub(/\..*/) {
- assert_not_nil($~)
- assert_equal(".gif", $~[0])
- ".png"
- }
- assert_equal("abc.png", result.to_s)
- end
-
def root?(path)
Pathname.new(path).root?
end
@@ -569,38 +470,9 @@ class TestPathname < Test::Unit::TestCase
result = []
Pathname.new("/usr/bin/ruby").each_filename {|f| result << f }
assert_equal(%w[usr bin ruby], result)
- assert_equal(%w[usr bin ruby], Pathname.new("/usr/bin/ruby").each_filename.to_a)
end
def test_kernel_pathname
assert_equal(Pathname.new("a"), Pathname("a"))
end
-
- def test_file_basename
- assert_equal("bar", File.basename(Pathname.new("foo/bar")))
- end
-
- def test_file_dirname
- assert_equal("foo", File.dirname(Pathname.new("foo/bar")))
- end
-
- def test_file_split
- assert_equal(["foo", "bar"], File.split(Pathname.new("foo/bar")))
- end
-
- def test_file_extname
- assert_equal(".baz", File.extname(Pathname.new("bar.baz")))
- end
-
- def test_file_fnmatch
- assert(File.fnmatch("*.*", Pathname.new("bar.baz")))
- end
-
- def test_file_join
- assert_equal("foo/bar", File.join(Pathname.new("foo"), Pathname.new("bar")))
- lambda {
- $SAFE = 1
- assert_equal("foo/bar", File.join(Pathname.new("foo"), Pathname.new("bar").taint))
- }.call
- end
end
diff --git a/test/rdoc/binary.dat b/test/rdoc/binary.dat
deleted file mode 100644
index 371950efe6..0000000000
--- a/test/rdoc/binary.dat
+++ /dev/null
Binary files differ
diff --git a/test/rdoc/parsers/test_parse_c.rb b/test/rdoc/parsers/test_parse_c.rb
new file mode 100644
index 0000000000..6157a9e1d4
--- /dev/null
+++ b/test/rdoc/parsers/test_parse_c.rb
@@ -0,0 +1,261 @@
+require 'stringio'
+require 'tempfile'
+require 'test/unit'
+require 'rdoc/parsers/parse_c'
+
+class RDoc::C_Parser
+ attr_accessor :classes
+
+ public :do_classes, :do_constants
+end
+
+class TestRdocC_Parser < Test::Unit::TestCase
+
+ def setup
+ @tempfile = Tempfile.new self.class.name
+ filename = @tempfile.path
+
+ @top_level = RDoc::TopLevel.new filename
+ @fn = filename
+ @options = Options.instance
+ @stats = RDoc::Stats.new
+
+ @progress = StringIO.new
+ end
+
+ def teardown
+ @tempfile.unlink
+ end
+
+ def test_do_classes_boot_class
+ content = <<-EOF
+/* Document-class: Foo
+ * this is the Foo boot class
+ */
+VALUE cFoo = boot_defclass("Foo", 0);
+ EOF
+
+ klass = util_get_class content, 'cFoo'
+ assert_equal " this is the Foo boot class\n ", klass.comment
+ end
+
+ def test_do_classes_class
+ content = <<-EOF
+/* Document-class: Foo
+ * this is the Foo class
+ */
+VALUE cFoo = rb_define_class("Foo", rb_cObject);
+ EOF
+
+ klass = util_get_class content, 'cFoo'
+ assert_equal " this is the Foo class\n ", klass.comment
+ end
+
+ def test_do_classes_class_under
+ content = <<-EOF
+/* Document-class: Kernel::Foo
+ * this is the Foo class under Kernel
+ */
+VALUE cFoo = rb_define_class_under(rb_mKernel, "Foo", rb_cObject);
+ EOF
+
+ klass = util_get_class content, 'cFoo'
+ assert_equal " this is the Foo class under Kernel\n ", klass.comment
+ end
+
+ def test_do_classes_module
+ content = <<-EOF
+/* Document-module: Foo
+ * this is the Foo module
+ */
+VALUE mFoo = rb_define_module("Foo");
+ EOF
+
+ klass = util_get_class content, 'mFoo'
+ assert_equal " this is the Foo module\n ", klass.comment
+ end
+
+ def test_do_classes_module_under
+ content = <<-EOF
+/* Document-module: Kernel::Foo
+ * this is the Foo module under Kernel
+ */
+VALUE mFoo = rb_define_module_under(rb_mKernel, "Foo");
+ EOF
+
+ klass = util_get_class content, 'mFoo'
+ assert_equal " this is the Foo module under Kernel\n ", klass.comment
+ end
+
+ def test_do_constants
+ content = <<-EOF
+#include <ruby.h>
+
+void Init_foo(){
+ VALUE cFoo = rb_define_class("Foo", rb_cObject);
+
+ /* 300: The highest possible score in bowling */
+ rb_define_const(cFoo, "PERFECT", INT2FIX(300));
+
+ /* Huzzah!: What you cheer when you roll a perfect game */
+ rb_define_const(cFoo, "CHEER", rb_str_new2("Huzzah!"));
+
+ /* TEST\:TEST: Checking to see if escaped semicolon works */
+ rb_define_const(cFoo, "TEST", rb_str_new2("TEST:TEST"));
+
+ /* \\: The file separator on MS Windows */
+ rb_define_const(cFoo, "MSEPARATOR", rb_str_new2("\\"));
+
+ /* /: The file separator on Unix */
+ rb_define_const(cFoo, "SEPARATOR", rb_str_new2("/"));
+
+ /* C:\\Program Files\\Stuff: A directory on MS Windows */
+ rb_define_const(cFoo, "STUFF", rb_str_new2("C:\\Program Files\\Stuff"));
+
+ /* Default definition */
+ rb_define_const(cFoo, "NOSEMI", INT2FIX(99));
+
+ rb_define_const(cFoo, "NOCOMMENT", rb_str_new2("No comment"));
+
+ /*
+ * Multiline comment goes here because this comment spans multiple lines.
+ * Multiline comment goes here because this comment spans multiple lines.
+ */
+ rb_define_const(cFoo, "MULTILINE", INT2FIX(1));
+
+ /*
+ * 1: Multiline comment goes here because this comment spans multiple lines.
+ * Multiline comment goes here because this comment spans multiple lines.
+ */
+ rb_define_const(cFoo, "MULTILINE_VALUE", INT2FIX(1));
+
+ /* Multiline comment goes here because this comment spans multiple lines.
+ * Multiline comment goes here because this comment spans multiple lines.
+ */
+ rb_define_const(cFoo, "MULTILINE_NOT_EMPTY", INT2FIX(1));
+
+}
+ EOF
+
+ parser = util_parser content
+
+ parser.do_classes
+ parser.do_constants
+
+ klass = parser.classes['cFoo']
+ assert klass
+
+ constants = klass.constants
+ assert !klass.constants.empty?
+
+ constants = constants.map { |c| [c.name, c.value, c.comment] }
+
+ assert_equal ['PERFECT', '300',
+ "\n The highest possible score in bowling \n "],
+ constants.shift
+ assert_equal ['CHEER', 'Huzzah!',
+ "\n What you cheer when you roll a perfect game \n "],
+ constants.shift
+ assert_equal ['TEST', 'TEST:TEST',
+ "\n Checking to see if escaped semicolon works \n "],
+ constants.shift
+ assert_equal ['MSEPARATOR', '\\',
+ "\n The file separator on MS Windows \n "],
+ constants.shift
+ assert_equal ['SEPARATOR', '/',
+ "\n The file separator on Unix \n "],
+ constants.shift
+ assert_equal ['STUFF', 'C:\\Program Files\\Stuff',
+ "\n A directory on MS Windows \n "],
+ constants.shift
+ assert_equal ['NOSEMI', 'INT2FIX(99)',
+ "\n Default definition \n "],
+ constants.shift
+ assert_equal ['NOCOMMENT', 'rb_str_new2("No comment")', nil],
+ constants.shift
+
+ comment = <<-EOF.chomp
+
+
+ Multiline comment goes here because this comment spans multiple lines.
+ Multiline comment goes here because this comment spans multiple lines.
+
+
+ EOF
+ assert_equal ['MULTILINE', 'INT2FIX(1)', comment], constants.shift
+ assert_equal ['MULTILINE_VALUE', '1', comment], constants.shift
+
+ comment = <<-EOF.chomp
+
+ Multiline comment goes here because this comment spans multiple lines.
+ Multiline comment goes here because this comment spans multiple lines.
+
+
+ EOF
+ assert_equal ['MULTILINE_NOT_EMPTY', 'INT2FIX(1)', comment], constants.shift
+
+ assert constants.empty?, constants.inspect
+ end
+
+ def test_find_class_comment_init
+ content = <<-EOF
+/*
+ * a comment for class Foo
+ */
+void
+Init_Foo(void) {
+ VALUE foo = rb_define_class("Foo", rb_cObject);
+}
+ EOF
+
+ klass = util_get_class content, 'foo'
+
+ assert_equal " \n a comment for class Foo\n \n", klass.comment
+ end
+
+ def test_find_class_comment_define_class
+ content = <<-EOF
+/*
+ * a comment for class Foo
+ */
+VALUE foo = rb_define_class("Foo", rb_cObject);
+ EOF
+
+ klass = util_get_class content, 'foo'
+
+ assert_equal " \n a comment for class Foo\n ", klass.comment
+ end
+
+ def test_find_class_comment_define_class
+ content = <<-EOF
+/*
+ * a comment for class Foo on Init
+ */
+void
+Init_Foo(void) {
+ /*
+ * a comment for class Foo on rb_define_class
+ */
+ VALUE foo = rb_define_class("Foo", rb_cObject);
+}
+ EOF
+
+ klass = util_get_class content, 'foo'
+
+ assert_equal " \n a comment for class Foo on Init\n \n", klass.comment
+ end
+
+ def util_get_class(content, name)
+ parser = util_parser content
+ parser.do_classes
+ parser.classes[name]
+ end
+
+ def util_parser(content)
+ parser = RDoc::C_Parser.new @top_level, @fn, content, @options, @stats
+ parser.progress = @progress
+ parser
+ end
+
+end
+
diff --git a/test/rdoc/rdoc_markup_to_html_crossref_reference.rb b/test/rdoc/rdoc_markup_to_html_crossref_reference.rb
deleted file mode 100644
index cbf6734b28..0000000000
--- a/test/rdoc/rdoc_markup_to_html_crossref_reference.rb
+++ /dev/null
@@ -1,31 +0,0 @@
-#
-# This file is parsed by test_rdoc_markup_to_html_crossref.rb
-# during its tests.
-#
-class Ref_Class1
-end
-
-class Ref_Class2
- class Ref_Class3
- def method
- end
-
- class Helper1
- def method?
- end
- end
- end
-end
-
-class Ref_Class3
- class Helper1
- end
-
- class Helper2
- end
-end
-
-class Ref_Class4
- class Ref_Class4
- end
-end
diff --git a/test/rdoc/test_attribute_manager.rb b/test/rdoc/test_attribute_manager.rb
deleted file mode 100644
index ee45c0596f..0000000000
--- a/test/rdoc/test_attribute_manager.rb
+++ /dev/null
@@ -1,76 +0,0 @@
-require 'rubygems'
-require 'minitest/unit'
-require 'rdoc/markup/attribute_manager'
-
-class TestAttributeManager < MiniTest::Unit::TestCase
-
- def setup
- @am = RDoc::Markup::AttributeManager.new
- @klass = RDoc::Markup::AttributeManager
- end
-
- def teardown
- silently do
- @klass.const_set(:MATCHING_WORD_PAIRS, {})
- @klass.const_set(:WORD_PAIR_MAP, {})
- @klass.const_set(:HTML_TAGS, {})
- end
- end
-
- def test_initial_word_pairs
- word_pairs = @klass::MATCHING_WORD_PAIRS
- assert word_pairs.is_a?(Hash)
- assert_equal(3, word_pairs.size)
- end
-
- def test_initial_html
- html_tags = @klass::HTML_TAGS
- assert html_tags.is_a?(Hash)
- assert_equal(5, html_tags.size)
- end
-
- def test_add_matching_word_pair
- @am.add_word_pair("x","x", :TEST)
- word_pairs = @klass::MATCHING_WORD_PAIRS
- assert_equal(4,word_pairs.size)
- assert(word_pairs.has_key?("x"))
- end
-
- def test_add_invalid_word_pair
- assert_raises ArgumentError do
- @am.add_word_pair("<", "<", :TEST)
- end
- end
-
- def test_add_word_pair_map
- @am.add_word_pair("x", "y", :TEST)
- word_pair_map = @klass::WORD_PAIR_MAP
- assert_equal(1,word_pair_map.size)
- assert_equal(word_pair_map. keys.first.source, "(x)(\\S+)(y)")
- end
-
- def test_add_html_tag
- @am.add_html("Test", :TEST)
- tags = @klass::HTML_TAGS
- assert_equal(6, tags.size)
- assert(tags.has_key?("test"))
- end
-
- def test_add_special
- @am.add_special("WikiWord", :WIKIWORD)
- specials = @klass::SPECIAL
- assert_equal(1,specials.size)
- assert(specials.has_key?("WikiWord"))
- end
-
- def silently(&block)
- warn_level = $VERBOSE
- $VERBOSE = nil
- result = block.call
- $VERBOSE = warn_level
- result
- end
-
-end
-
-MiniTest::Unit.autorun
diff --git a/test/rdoc/test_rdoc_info_formatting.rb b/test/rdoc/test_rdoc_info_formatting.rb
deleted file mode 100644
index 110c84b2d1..0000000000
--- a/test/rdoc/test_rdoc_info_formatting.rb
+++ /dev/null
@@ -1,179 +0,0 @@
-require 'fileutils'
-require 'tmpdir'
-require 'rubygems'
-require 'minitest/unit'
-
-require 'rdoc/generator/texinfo'
-
-# From chapter 18 of the Pickaxe 3rd ed. and the TexInfo manual.
-class TestRDocInfoFormatting < MiniTest::Unit::TestCase
- def setup
- @output_dir = File.join Dir.mktmpdir("test_rdoc_"), "info_formatting"
- @output_file = File.join @output_dir, 'rdoc.texinfo'
-
- RDoc::RDoc.new.document(['--fmt=texinfo', '--quiet',
- File.expand_path(__FILE__),
- "--op=#{@output_dir}"])
- @text = File.read @output_file
-
- # File.open('rdoc.texinfo', 'w') { |f| f.puts @text }
- end
-
- def teardown
- FileUtils.rm_rf File.dirname(@output_dir)
- end
-
- # Make sure tags like *this* do not make HTML
- def test_descriptions_are_not_html
- refute_match Regexp.new("\<b\>this\<\/b\>"), @text,
- "We had some HTML; icky!"
- end
-
- # Ensure we get a reasonable amount
- #
- # of space in between paragraphs.
- def test_paragraphs_are_spaced
- assert_match(/amount\n\n\nof space/, @text)
- end
-
- # @ and {} should be at-sign-prefixed
- def test_escaping
- assert_match(/@@ and @\{@\} should be at-sign-prefixed/)
- end
-
- # This tests that *bold* and <b>bold me</b> become @strong{bolded}
- def test_bold
- # Seems like a limitation of the Info format: @strong{bold}
- # becomes *bold* when read in Info or M-x info. highly lame!
- assert_match(/@strong\{bold\}/)
- assert_match(/@strong\{bold me\}/)
- end
-
- # Test that _italics_ and <em>italicize me</em> becomes @emph{italicized}
- def test_italics
- assert_match(/@emph\{italics\}/)
- assert_match(/@emph\{italicize me\}/)
- end
-
- # And that typewriter +text+ and <tt>typewriter me</tt> becomes @code{typewriter}
- def test_tt
- assert_match(/@code\{text\}/)
- assert_match(/@code\{typewriter me\}/)
- end
-
- # Check that
- # anything indented is
- # verbatim @verb{|foo bar baz|}
- def test_literal_code
- assert_match("@verb{| anything indented is
- verbatim @@verb@{|foo bar baz|@}
-|}")
- end
-
- # = Huge heading should be a @majorheading
- # == There is also @chapheading
- # === Everything deeper becomes a regular @heading
- # ====== Regardless of its nesting level
- def test_headings
- assert_match(/@majorheading Huge heading should be a @@majorheading/)
- assert_match(/@chapheading There is also @@chapheading/)
- assert_match(/@heading Everything deeper becomes a regular @@heading/)
- assert_match(/@heading Regardless of its nesting level/)
- end
-
- # * list item
- # * list item2
- #
- # with a paragraph in between
- #
- # - hyphen lists
- # - are also allowed
- # and items may flow over lines
- def test_bullet_lists
- assert_match("@itemize @bullet
-@item
-list item
-@item
-list item2
-@end itemize")
- assert_match("@itemize @bullet
-@item
-hyphen lists
-@item
-are also allowed and items may flow over lines
-@end itemize")
- end
-
- # 2. numbered lists
- # 8. are made by
- # 9. a digit followed by a period
- def test_numbered_lists
- end
-
- # a. alpha lists
- # b. should be parsed too
- def test_alpha_lists
- end
-
- # [cat] small domestic animal
- # [+cat+] command to copy standard input
- # to standard output
- def test_labelled_lists
- end
-
- # * First item.
- # * Inner item.
- # * Second inner item.
- # * Second outer item.
- def test_nested_lists
- assert_match("@itemize @bullet
-@item
-First item.
-@itemize @bullet
-@item
-Inner item.
-@item
-Second inner item.
-@end itemize
-@item
-Second outer item.
-@end itemize")
- end
-
- def test_internal_hyperlinks
- # be sure to test multi-word hyperlinks as well.
- end
-
- def test_hyperlink_targets
- end
-
- def test_web_links
- # An example of the two-argument form: The official
- # @uref{ftp://ftp.gnu.org/gnu, GNU ftp site} holds programs and texts.
-
- # produces:
- # The official GNU ftp site (ftp://ftp.gnu.org/gnu)
- # holds programs and texts.
- # and the HTML output is this:
- # The official <a href="ftp://ftp.gnu.org/gnu">GNU ftp site</a>
- # holds programs and texts.
- end
-
- # three or more hyphens
- # ----
- # should produce a horizontal rule
- def test_horizontal_rule
- # gah; not sure texinfo supports horizontal rules
- end
-
- private
-
- # We don't want the whole string inspected if we pass our own
- # message in.
- def assert_match(regex, string = @text,
- message = "Didn't find #{regex.inspect} in #{string}.")
- assert string[regex] #, message
- end
-end
-
-MiniTest::Unit.autorun
diff --git a/test/rdoc/test_rdoc_info_sections.rb b/test/rdoc/test_rdoc_info_sections.rb
deleted file mode 100644
index 9571cd611e..0000000000
--- a/test/rdoc/test_rdoc_info_sections.rb
+++ /dev/null
@@ -1,139 +0,0 @@
-require 'fileutils'
-require 'tempfile'
-require 'rubygems'
-require 'minitest/unit'
-require 'tmpdir'
-
-require 'rdoc/generator/texinfo'
-
-# give us access to check this stuff before it's rendered
-class RDoc::Generator::TEXINFO; attr_reader :files, :classes; end
-class RDoc::RDoc; attr_reader :options; attr_reader :gen; end
-
-class TestRDocInfoSections < MiniTest::Unit::TestCase
-
- def setup
- @output_dir = File.join Dir.tmpdir, "test_rdoc_info_sections_#{$$}"
- @output_file = File.join @output_dir, 'rdoc.texinfo'
-
- @input_file = Tempfile.new 'my_file.rb'
-
- open @input_file.path, 'w' do |io|
- io.write TEST_DOC
- end
-
- RDoc::Parser.alias_extension '.rb', File.extname(@input_file.path)
-
- @rdoc = RDoc::RDoc.new
- @rdoc.document(['--fmt=texinfo', '--quiet', @input_file.path,
- "--op=#{@output_dir}"])
-
- @text = File.read @output_file
- end
-
- def teardown
- @input_file.close
- FileUtils.rm_rf @output_dir
- end
-
- def test_output_exists
- assert ! @text.empty?
- end
-
- def test_each_class_has_a_chapter
- assert_section "Class MyClass", '@chapter'
- end
-
- def test_class_descriptions_are_given
- assert_match(/Documentation for my class/, @text.gsub("\n", ' '))
- end
-
- def test_included_modules_are_given
- assert_match(/Includes.* MyModule/m, @text)
- end
-
- def test_class_methods_are_given
- assert_match(/my_class_method\(my_first_argument\)/, @text)
- end
-
- def test_classes_instance_methods_are_given
- assert_section 'Class MyClass#my_method'
- assert_match(/my_method\(my_first_argument\)/, @text)
- end
-
- def test_each_module_has_a_chapter
- assert_section 'MyModule', '@chapter'
- end
-
- def test_methods_are_shown_only_once
- methods = @rdoc.gen.classes.map do |c|
- c.methods.map do |m|
- c.name + '#' + m.name
- end
- end.flatten
-
- assert_equal methods, methods.uniq
- end
-
-# if system "makeinfo --version > /dev/null"
-# def test_compiles_to_info
-# makeinfo_output = `cd #{@output_dir} && makeinfo rdoc.texinfo`
-# assert(File.exist?(File.join(@output_dir, 'rdoc.info')),
-# "Info file was not compiled: #{makeinfo_output}")
-# end
-# end
-
-# def test_constants_are_documented_somehow
-# assert_section 'DEFAULT_FILENAME' # what kind of section?
-# assert_section 'DEFAULT_INFO_FILENAME'
-# end
-
-# def test_oh_yeah_dont_forget_files
-# end
-
- def assert_section(name, command = '@section')
- assert_match Regexp.new("^#{command}.*#{Regexp.escape name}"), @text, "Could not find a #{command} #{name}"
- end
-
- TEST_DOC = <<-DOC
-##
-# Documentation for my module
-
-module MyModule
-
- ##
- # Documentation for my included method
-
- def my_included_method() end
-
-end
-
-##
-# Documentation for my class
-
-class MyClass
-
- include MyModule
-
- ##
- # Documentation for my constant
-
- MY_CONSTANT = 'my value'
-
- ##
- # Documentation for my class method
-
- def self.my_class_method(my_first_argument) end
-
- ##
- # Documentation for my method
-
- def my_method(my_first_argument) end
-
-end
-
- DOC
-
-end
-
-MiniTest::Unit.autorun
diff --git a/test/rdoc/test_rdoc_markup.rb b/test/rdoc/test_rdoc_markup.rb
deleted file mode 100644
index 7004fe50ec..0000000000
--- a/test/rdoc/test_rdoc_markup.rb
+++ /dev/null
@@ -1,615 +0,0 @@
-require 'rubygems'
-require 'minitest/unit'
-require 'rdoc/markup'
-require 'rdoc/markup/to_test'
-
-class TestRDocMarkup < MiniTest::Unit::TestCase
-
- def basic_conv(str)
- sm = RDoc::Markup.new
- mock = RDoc::Markup::ToTest.new
- sm.convert(str, mock)
- sm.content
- end
-
- def line_groups(str, expected)
- m = RDoc::Markup.new
- mock = RDoc::Markup::ToTest.new
-
- block = m.convert(str, mock)
-
- if block != expected
- rows = (0...([expected.size, block.size].max)).collect{|i|
- [expected[i]||"nil", block[i]||"nil"]
- }
- printf "\n\n%35s %35s\n", "Expected", "Got"
- rows.each {|e,g| printf "%35s %35s\n", e.dump, g.dump }
- end
-
- assert_equal(expected, block)
- end
-
- def line_types(str, expected)
- m = RDoc::Markup.new
- mock = RDoc::Markup::ToTest.new
- m.convert(str, mock)
- assert_equal(expected, m.get_line_types.map{|type| type.to_s[0,1]}.join(''))
- end
-
- def test_groups
- str = "now is the time"
- line_groups(str, ["L0: Paragraph\nnow is the time"] )
-
- str = "now is the time\nfor all good men"
- line_groups(str, ["L0: Paragraph\nnow is the time for all good men"] )
-
- str = %{\
- now is the time
- code _line_ here
- for all good men}
-
- line_groups(str,
- [ "L0: Paragraph\nnow is the time",
- "L0: Verbatim\n code _line_ here\n",
- "L0: Paragraph\nfor all good men"
- ] )
-
- str = "now is the time\n code\n more code\nfor all good men"
- line_groups(str,
- [ "L0: Paragraph\nnow is the time",
- "L0: Verbatim\n code\n more code\n",
- "L0: Paragraph\nfor all good men"
- ] )
-
- str = %{\
- now is
- * l1
- * l2
- the time}
- line_groups(str,
- [ "L0: Paragraph\nnow is",
- "L1: ListStart\n",
- "L1: BULLET ListItem\nl1",
- "L1: BULLET ListItem\nl2",
- "L1: ListEnd\n",
- "L0: Paragraph\nthe time"
- ])
-
- str = %{\
- now is
- * l1
- l1+
- * l2
- the time}
- line_groups(str,
- [ "L0: Paragraph\nnow is",
- "L1: ListStart\n",
- "L1: BULLET ListItem\nl1 l1+",
- "L1: BULLET ListItem\nl2",
- "L1: ListEnd\n",
- "L0: Paragraph\nthe time"
- ])
-
- str = %{\
- now is
- * l1
- * l1.1
- * l2
- the time}
- line_groups(str,
- [ "L0: Paragraph\nnow is",
- "L1: ListStart\n",
- "L1: BULLET ListItem\nl1",
- "L2: ListStart\n",
- "L2: BULLET ListItem\nl1.1",
- "L2: ListEnd\n",
- "L1: BULLET ListItem\nl2",
- "L1: ListEnd\n",
- "L0: Paragraph\nthe time"
- ])
-
-
- str = %{\
- now is
- * l1
- * l1.1
- text
- code
- code
-
- text
- * l2
- the time}
- line_groups(str,
- [ "L0: Paragraph\nnow is",
- "L1: ListStart\n",
- "L1: BULLET ListItem\nl1",
- "L2: ListStart\n",
- "L2: BULLET ListItem\nl1.1 text",
- "L2: Verbatim\n code\n code\n",
- "L2: Paragraph\ntext",
- "L2: ListEnd\n",
- "L1: BULLET ListItem\nl2",
- "L1: ListEnd\n",
- "L0: Paragraph\nthe time"
- ])
-
-
- str = %{\
- now is
- 1. l1
- * l1.1
- 2. l2
- the time}
- line_groups(str,
- [ "L0: Paragraph\nnow is",
- "L1: ListStart\n",
- "L1: NUMBER ListItem\nl1",
- "L2: ListStart\n",
- "L2: BULLET ListItem\nl1.1",
- "L2: ListEnd\n",
- "L1: NUMBER ListItem\nl2",
- "L1: ListEnd\n",
- "L0: Paragraph\nthe time"
- ])
-
- str = %{\
- now is
- [cat] l1
- * l1.1
- [dog] l2
- the time}
- line_groups(str,
- [ "L0: Paragraph\nnow is",
- "L1: ListStart\n",
- "L1: LABELED ListItem\ncat: l1",
- "L2: ListStart\n",
- "L2: BULLET ListItem\nl1.1",
- "L2: ListEnd\n",
- "L1: LABELED ListItem\ndog: l2",
- "L1: ListEnd\n",
- "L0: Paragraph\nthe time"
- ])
-
- str = %{\
- now is
- [cat] l1
- continuation
- [dog] l2
- the time}
- line_groups(str,
- [ "L0: Paragraph\nnow is",
- "L1: ListStart\n",
- "L1: LABELED ListItem\ncat: l1 continuation",
- "L1: LABELED ListItem\ndog: l2",
- "L1: ListEnd\n",
- "L0: Paragraph\nthe time"
- ])
- end
-
- def test_headings
- str = "= heading one"
- line_groups(str,
- [ "L0: Heading\nheading one"
- ])
-
- str = "=== heading three"
- line_groups(str,
- [ "L0: Heading\nheading three"
- ])
-
- str = "text\n === heading three"
- line_groups(str,
- [ "L0: Paragraph\ntext",
- "L0: Verbatim\n === heading three\n"
- ])
-
- str = "text\n code\n === heading three"
- line_groups(str,
- [ "L0: Paragraph\ntext",
- "L0: Verbatim\n code\n === heading three\n"
- ])
-
- str = "text\n code\n=== heading three"
- line_groups(str,
- [ "L0: Paragraph\ntext",
- "L0: Verbatim\n code\n",
- "L0: Heading\nheading three"
- ])
-
- end
-
- def test_list_alpha
- str = "a. alpha\nb. baker\nB. ALPHA\nA. BAKER"
-
- line_groups(str,
- [ "L1: ListStart\n",
- "L1: LOWERALPHA ListItem\nalpha",
- "L1: LOWERALPHA ListItem\nbaker",
- "L1: ListEnd\n",
- "L1: ListStart\n",
- "L1: UPPERALPHA ListItem\nALPHA",
- "L1: UPPERALPHA ListItem\nBAKER",
- "L1: ListEnd\n" ])
- end
-
- def test_list_bullet_dash
- str = "- one\n- two\n"
-
- line_groups(str,
- [ "L1: ListStart\n",
- "L1: BULLET ListItem\none",
- "L1: BULLET ListItem\ntwo",
- "L1: ListEnd\n" ])
- end
-
- def test_list_bullet_star
- str = "* one\n* two\n"
-
- line_groups(str,
- [ "L1: ListStart\n",
- "L1: BULLET ListItem\none",
- "L1: BULLET ListItem\ntwo",
- "L1: ListEnd\n" ])
- end
-
- def test_list_labeled_bracket
- str = "[one] item one\n[two] item two"
-
- line_groups(str,
- [ "L1: ListStart\n",
- "L1: LABELED ListItem\none: item one",
- "L1: LABELED ListItem\ntwo: item two",
- "L1: ListEnd\n" ])
- end
-
- def test_list_labeled_bracket_continued
- str = "[one]\n item one\n[two]\n item two"
-
- line_groups(str,
- [ "L1: ListStart\n",
- "L1: LABELED ListItem\none: item one",
- "L1: LABELED ListItem\ntwo: item two",
- "L1: ListEnd\n" ])
- end
-
- def test_list_labeled_colon
- str = "one:: item one\ntwo:: item two"
-
- line_groups(str,
- [ "L1: ListStart\n",
- "L1: NOTE ListItem\none:: item one",
- "L1: NOTE ListItem\ntwo:: item two",
- "L1: ListEnd\n" ])
- end
-
- def test_list_labeled_colon_continued
- str = "one::\n item one\ntwo::\n item two"
-
- line_groups(str,
- [ "L1: ListStart\n",
- "L1: NOTE ListItem\none:: item one",
- "L1: NOTE ListItem\ntwo:: item two",
- "L1: ListEnd\n" ])
- end
-
- def test_list_nested_bullet_bullet
- str = "* one\n* two\n * cat\n * dog"
-
- line_groups(str,
- [ "L1: ListStart\n",
- "L1: BULLET ListItem\none",
- "L1: BULLET ListItem\ntwo",
- "L2: ListStart\n",
- "L2: BULLET ListItem\ncat",
- "L2: BULLET ListItem\ndog",
- "L2: ListEnd\n",
- "L1: ListEnd\n" ])
- end
-
- def test_list_nested_labeled_bullet
- str = "[one]\n * cat\n * dog"
-
- line_groups(str,
- [ "L1: ListStart\n",
- "L1: LABELED ListItem\none: ",
- "L2: ListStart\n",
- "L2: BULLET ListItem\ncat",
- "L2: BULLET ListItem\ndog",
- "L2: ListEnd\n",
- "L1: ListEnd\n" ])
- end
-
- def test_list_nested_labeled_bullet_bullet
- str = "[one]\n * cat\n * dog"
-
- line_groups(str,
- [ "L1: ListStart\n",
- "L1: LABELED ListItem\none: ",
- "L2: ListStart\n",
- "L2: BULLET ListItem\ncat",
- "L3: ListStart\n",
- "L3: BULLET ListItem\ndog",
- "L3: ListEnd\n",
- "L2: ListEnd\n",
- "L1: ListEnd\n" ])
- end
-
- def test_list_nested_number_number
- str = "1. one\n1. two\n 1. cat\n 1. dog"
-
- line_groups(str,
- [ "L1: ListStart\n",
- "L1: NUMBER ListItem\none",
- "L1: NUMBER ListItem\ntwo",
- "L2: ListStart\n",
- "L2: NUMBER ListItem\ncat",
- "L2: NUMBER ListItem\ndog",
- "L2: ListEnd\n",
- "L1: ListEnd\n" ])
- end
-
- def test_list_number
- str = "1. one\n2. two\n1. three"
-
- line_groups(str,
- [ "L1: ListStart\n",
- "L1: NUMBER ListItem\none",
- "L1: NUMBER ListItem\ntwo",
- "L1: NUMBER ListItem\nthree",
- "L1: ListEnd\n" ])
- end
-
- def test_list_split
- str = %{\
- now is
- * l1
- 1. n1
- 2. n2
- * l2
- the time}
- line_groups(str,
- [ "L0: Paragraph\nnow is",
- "L1: ListStart\n",
- "L1: BULLET ListItem\nl1",
- "L1: ListEnd\n",
- "L1: ListStart\n",
- "L1: NUMBER ListItem\nn1",
- "L1: NUMBER ListItem\nn2",
- "L1: ListEnd\n",
- "L1: ListStart\n",
- "L1: BULLET ListItem\nl2",
- "L1: ListEnd\n",
- "L0: Paragraph\nthe time"
- ])
-
- end
-
- def test_paragraph
- str = "paragraph\n\n*bold* paragraph\n"
-
- line_groups str, [
- "L0: Paragraph\nparagraph",
- "L0: BlankLine\n",
- "L0: Paragraph\n*bold* paragraph"
- ]
- end
-
- def test_tabs
- str = "hello\n dave"
- assert_equal(str, basic_conv(str))
- str = "hello\n\tdave"
- assert_equal("hello\n dave", basic_conv(str))
- str = "hello\n \tdave"
- assert_equal("hello\n dave", basic_conv(str))
- str = "hello\n \tdave"
- assert_equal("hello\n dave", basic_conv(str))
- str = "hello\n \tdave"
- assert_equal("hello\n dave", basic_conv(str))
- str = "hello\n \tdave"
- assert_equal("hello\n dave", basic_conv(str))
- str = "hello\n \tdave"
- assert_equal("hello\n dave", basic_conv(str))
- str = "hello\n \tdave"
- assert_equal("hello\n dave", basic_conv(str))
- str = "hello\n \tdave"
- assert_equal("hello\n dave", basic_conv(str))
- str = "hello\n \tdave"
- assert_equal("hello\n dave", basic_conv(str))
- str = ".\t\t."
- assert_equal(". .", basic_conv(str))
- end
-
- def test_types
- str = "now is the time"
- line_types(str, 'P')
-
- str = "now is the time\nfor all good men"
- line_types(str, 'PP')
-
- str = "now is the time\n code\nfor all good men"
- line_types(str, 'PVP')
-
- str = "now is the time\n code\n more code\nfor all good men"
- line_types(str, 'PVVP')
-
- str = "now is\n---\nthe time"
- line_types(str, 'PRP')
-
- str = %{\
- now is
- * l1
- * l2
- the time}
- line_types(str, 'PLLP')
-
- str = %{\
- now is
- * l1
- l1+
- * l2
- the time}
- line_types(str, 'PLPLP')
-
- str = %{\
- now is
- * l1
- * l1.1
- * l2
- the time}
- line_types(str, 'PLLLP')
-
- str = %{\
- now is
- * l1
- * l1.1
- text
- code
- code
-
- text
- * l2
- the time}
- line_types(str, 'PLLPVVBPLP')
-
- str = %{\
- now is
- 1. l1
- * l1.1
- 2. l2
- the time}
- line_types(str, 'PLLLP')
-
- str = %{\
- now is
- [cat] l1
- * l1.1
- [dog] l2
- the time}
- line_types(str, 'PLLLP')
-
- str = %{\
- now is
- [cat] l1
- continuation
- [dog] l2
- the time}
- line_types(str, 'PLPLP')
- end
-
- def test_verbatim
- str = "paragraph\n *bold* verbatim\n"
-
- line_groups str, [
- "L0: Paragraph\nparagraph",
- "L0: Verbatim\n *bold* verbatim\n"
- ]
- end
-
- def test_verbatim_merge
- str = %{\
- now is
- code
- the time}
-
- line_groups(str,
- [ "L0: Paragraph\nnow is",
- "L0: Verbatim\n code\n",
- "L0: Paragraph\nthe time"
- ])
-
-
- str = %{\
- now is
- code
- code1
- the time}
-
- line_groups(str,
- [ "L0: Paragraph\nnow is",
- "L0: Verbatim\n code\n code1\n",
- "L0: Paragraph\nthe time"
- ])
-
-
- str = %{\
- now is
- code
-
- code1
- the time}
-
- line_groups(str,
- [ "L0: Paragraph\nnow is",
- "L0: Verbatim\n code\n\n code1\n",
- "L0: Paragraph\nthe time"
- ])
-
-
- str = %{\
- now is
- code
-
- code1
-
- the time}
-
- line_groups(str,
- [ "L0: Paragraph\nnow is",
- "L0: Verbatim\n code\n\n code1\n",
- "L0: Paragraph\nthe time"
- ])
-
-
- str = %{\
- now is
- code
-
- code1
-
- code2
- the time}
-
- line_groups(str,
- [ "L0: Paragraph\nnow is",
- "L0: Verbatim\n code\n\n code1\n\n code2\n",
- "L0: Paragraph\nthe time"
- ])
-
-
- # Folds multiple blank lines
- str = %{\
- now is
- code
-
-
- code1
-
- the time}
-
- line_groups(str,
- [ "L0: Paragraph\nnow is",
- "L0: Verbatim\n code\n\n code1\n",
- "L0: Paragraph\nthe time"
- ])
-
-
- end
-
- def test_whitespace
- assert_equal("hello", basic_conv("hello"))
- assert_equal("hello", basic_conv(" hello "))
- assert_equal("hello", basic_conv(" \t \t hello\t\t"))
-
- assert_equal("1\n 2\n 3", basic_conv("1\n 2\n 3"))
- assert_equal("1\n 2\n 3", basic_conv(" 1\n 2\n 3"))
-
- assert_equal("1\n 2\n 3\n1\n 2", basic_conv("1\n 2\n 3\n1\n 2"))
- assert_equal("1\n 2\n 3\n1\n 2", basic_conv(" 1\n 2\n 3\n 1\n 2"))
-
- assert_equal("1\n 2\n\n 3", basic_conv(" 1\n 2\n\n 3"))
- end
-
-end
-
-MiniTest::Unit.autorun
diff --git a/test/rdoc/test_rdoc_markup_attribute_manager.rb b/test/rdoc/test_rdoc_markup_attribute_manager.rb
deleted file mode 100644
index 520470a8cc..0000000000
--- a/test/rdoc/test_rdoc_markup_attribute_manager.rb
+++ /dev/null
@@ -1,234 +0,0 @@
-require "rubygems"
-require "minitest/unit"
-require "rdoc/markup/inline"
-require "rdoc/markup/to_html_crossref"
-
-class TestRDocMarkupAttributeManager < MiniTest::Unit::TestCase
-
- def setup
- @orig_special = RDoc::Markup::AttributeManager::SPECIAL
- RDoc::Markup::AttributeManager::SPECIAL.replace Hash.new
-
- @am = RDoc::Markup::AttributeManager.new
-
- @bold_on = @am.changed_attribute_by_name([], [:BOLD])
- @bold_off = @am.changed_attribute_by_name([:BOLD], [])
-
- @tt_on = @am.changed_attribute_by_name([], [:TT])
- @tt_off = @am.changed_attribute_by_name([:TT], [])
-
- @em_on = @am.changed_attribute_by_name([], [:EM])
- @em_off = @am.changed_attribute_by_name([:EM], [])
-
- @bold_em_on = @am.changed_attribute_by_name([], [:BOLD] | [:EM])
- @bold_em_off = @am.changed_attribute_by_name([:BOLD] | [:EM], [])
-
- @em_then_bold = @am.changed_attribute_by_name([:EM], [:EM] | [:BOLD])
-
- @em_to_bold = @am.changed_attribute_by_name([:EM], [:BOLD])
-
- @am.add_word_pair("{", "}", :WOMBAT)
- @wombat_on = @am.changed_attribute_by_name([], [:WOMBAT])
- @wombat_off = @am.changed_attribute_by_name([:WOMBAT], [])
- end
-
- def teardown
- RDoc::Markup::AttributeManager::SPECIAL.replace @orig_special
- end
-
- def crossref(text)
- crossref_bitmap = RDoc::Markup::Attribute.bitmap_for(:_SPECIAL_) |
- RDoc::Markup::Attribute.bitmap_for(:CROSSREF)
-
- [ @am.changed_attribute_by_name([], [:CROSSREF, :_SPECIAL_]),
- RDoc::Markup::Special.new(crossref_bitmap, text),
- @am.changed_attribute_by_name([:CROSSREF, :_SPECIAL_], [])
- ]
- end
-
- def test_adding
- assert_equal(["cat ", @wombat_on, "and", @wombat_off, " dog" ],
- @am.flow("cat {and} dog"))
- #assert_equal(["cat {and} dog" ], @am.flow("cat \\{and} dog"))
- end
-
- def test_add_word_pair
- @am.add_word_pair '%', '&', 'percent and'
-
- assert RDoc::Markup::AttributeManager::WORD_PAIR_MAP.include?(/(%)(\S+)(&)/)
- assert RDoc::Markup::AttributeManager::PROTECTABLE.include?('%')
- assert !RDoc::Markup::AttributeManager::PROTECTABLE.include?('&')
- end
-
- def test_add_word_pair_angle
- e = assert_raises ArgumentError do
- @am.add_word_pair '<', '>', 'angles'
- end
-
- assert_equal "Word flags may not start with '<'", e.message
- end
-
- def test_add_word_pair_matching
- @am.add_word_pair '^', '^', 'caret'
-
- assert RDoc::Markup::AttributeManager::MATCHING_WORD_PAIRS.include?('^')
- assert RDoc::Markup::AttributeManager::PROTECTABLE.include?('^')
- end
-
- def test_basic
- assert_equal(["cat"], @am.flow("cat"))
-
- assert_equal(["cat ", @bold_on, "and", @bold_off, " dog"],
- @am.flow("cat *and* dog"))
-
- assert_equal(["cat ", @bold_on, "AND", @bold_off, " dog"],
- @am.flow("cat *AND* dog"))
-
- assert_equal(["cat ", @em_on, "And", @em_off, " dog"],
- @am.flow("cat _And_ dog"))
-
- assert_equal(["cat *and dog*"], @am.flow("cat *and dog*"))
-
- assert_equal(["*cat and* dog"], @am.flow("*cat and* dog"))
-
- assert_equal(["cat *and ", @bold_on, "dog", @bold_off],
- @am.flow("cat *and *dog*"))
-
- assert_equal(["cat ", @em_on, "and", @em_off, " dog"],
- @am.flow("cat _and_ dog"))
-
- assert_equal(["cat_and_dog"],
- @am.flow("cat_and_dog"))
-
- assert_equal(["cat ", @tt_on, "and", @tt_off, " dog"],
- @am.flow("cat +and+ dog"))
-
- assert_equal(["cat ", @bold_on, "a_b_c", @bold_off, " dog"],
- @am.flow("cat *a_b_c* dog"))
-
- assert_equal(["cat __ dog"],
- @am.flow("cat __ dog"))
-
- assert_equal(["cat ", @em_on, "_", @em_off, " dog"],
- @am.flow("cat ___ dog"))
- end
-
- def test_bold
- assert_equal [@bold_on, 'bold', @bold_off],
- @am.flow("*bold*")
-
- assert_equal [@bold_on, 'Bold:', @bold_off],
- @am.flow("*Bold:*")
-
- assert_equal [@bold_on, '\\bold', @bold_off],
- @am.flow("*\\bold*")
- end
-
- def test_combined
- assert_equal(["cat ", @em_on, "and", @em_off, " ", @bold_on, "dog", @bold_off],
- @am.flow("cat _and_ *dog*"))
-
- assert_equal(["cat ", @em_on, "a__nd", @em_off, " ", @bold_on, "dog", @bold_off],
- @am.flow("cat _a__nd_ *dog*"))
- end
-
- def test_convert_attrs
- str = '+foo+'
- attrs = RDoc::Markup::AttrSpan.new str.length
-
- @am.convert_attrs str, attrs
-
- assert_equal "\000foo\000", str
-
- str = '+:foo:+'
- attrs = RDoc::Markup::AttrSpan.new str.length
-
- @am.convert_attrs str, attrs
-
- assert_equal "\000:foo:\000", str
-
- str = '+x-y+'
- attrs = RDoc::Markup::AttrSpan.new str.length
-
- @am.convert_attrs str, attrs
-
- assert_equal "\000x-y\000", str
- end
-
- def test_html_like_em_bold
- assert_equal ["cat ", @em_on, "and ", @em_to_bold, "dog", @bold_off],
- @am.flow("cat <i>and </i><b>dog</b>")
- end
-
- def test_html_like_em_bold_SGML
- assert_equal ["cat ", @em_on, "and ", @em_to_bold, "dog", @bold_off],
- @am.flow("cat <i>and <b></i>dog</b>")
- end
-
- def test_html_like_em_bold_nested_1
- assert_equal(["cat ", @bold_em_on, "and", @bold_em_off, " dog"],
- @am.flow("cat <i><b>and</b></i> dog"))
- end
-
- def test_html_like_em_bold_nested_2
- assert_equal ["cat ", @em_on, "and ", @em_then_bold, "dog", @bold_em_off],
- @am.flow("cat <i>and <b>dog</b></i>")
- end
-
- def test_html_like_em_bold_nested_mixed_case
- assert_equal ["cat ", @em_on, "and ", @em_then_bold, "dog", @bold_em_off],
- @am.flow("cat <i>and <B>dog</B></I>")
- end
-
- def test_html_like_em_bold_mixed_case
- assert_equal ["cat ", @em_on, "and", @em_off, " ", @bold_on, "dog", @bold_off],
- @am.flow("cat <i>and</i> <B>dog</b>")
- end
-
- def test_html_like_teletype
- assert_equal ["cat ", @tt_on, "dog", @tt_off],
- @am.flow("cat <tt>dog</Tt>")
- end
-
- def test_html_like_teletype_em_bold_SGML
- assert_equal [@tt_on, "cat", @tt_off, " ", @em_on, "and ", @em_to_bold, "dog", @bold_off],
- @am.flow("<tt>cat</tt> <i>and <b></i>dog</b>")
- end
-
- def test_protect
- assert_equal(['cat \\ dog'], @am.flow('cat \\ dog'))
-
- assert_equal(["cat <tt>dog</Tt>"], @am.flow("cat \\<tt>dog</Tt>"))
-
- assert_equal(["cat ", @em_on, "and", @em_off, " <B>dog</b>"],
- @am.flow("cat <i>and</i> \\<B>dog</b>"))
-
- assert_equal(["*word* or <b>text</b>"], @am.flow("\\*word* or \\<b>text</b>"))
-
- assert_equal(["_cat_", @em_on, "dog", @em_off],
- @am.flow("\\_cat_<i>dog</i>"))
- end
-
- def test_special
- @am.add_special(RDoc::Markup::ToHtmlCrossref::CROSSREF_REGEXP, :CROSSREF)
-
- #
- # The apostrophes in "cats'" and "dogs'" suppress the flagging of these
- # words as potential cross-references, which is necessary for the unit
- # tests. Unfortunately, the markup engine right now does not actually
- # check whether a cross-reference is valid before flagging it.
- #
- assert_equal(["cats'"], @am.flow("cats'"))
-
- assert_equal(["cats' ", crossref("#fred"), " dogs'"].flatten,
- @am.flow("cats' #fred dogs'"))
-
- assert_equal([crossref("#fred"), " dogs'"].flatten,
- @am.flow("#fred dogs'"))
-
- assert_equal(["cats' ", crossref("#fred")].flatten, @am.flow("cats' #fred"))
- end
-
-end
-
-MiniTest::Unit.autorun
diff --git a/test/rdoc/test_rdoc_markup_to_html.rb b/test/rdoc/test_rdoc_markup_to_html.rb
deleted file mode 100644
index b611b768a3..0000000000
--- a/test/rdoc/test_rdoc_markup_to_html.rb
+++ /dev/null
@@ -1,45 +0,0 @@
-require 'rubygems'
-require 'minitest/unit'
-require 'rdoc/markup'
-require 'rdoc/markup/to_html'
-
-class TestRDocMarkupToHtml < MiniTest::Unit::TestCase
-
- def setup
- @am = RDoc::Markup::AttributeManager.new
- @th = RDoc::Markup::ToHtml.new
- end
-
- def test_tt_formatting
- assert_equal "<p>\n<tt>--</tt> &#8212; <tt>cats'</tt> cats&#8217;\n</p>\n",
- util_format("<tt>--</tt> -- <tt>cats'</tt> cats'")
- assert_equal "<p>\n<b>&#8212;</b>\n</p>\n", util_format("<b>--</b>")
- end
-
- def test_convert_string_fancy
- #
- # The HTML typesetting is broken in a number of ways, but I have fixed
- # the most glaring issues for single and double quotes. Note that
- # "strange" symbols (periods or dashes) need to be at the end of the
- # test case strings in order to suppress cross-references.
- #
- assert_equal "<p>\n&#8220;cats&#8221;.\n</p>\n", util_format("\"cats\".")
- assert_equal "<p>\n&#8216;cats&#8217;.\n</p>\n", util_format("\'cats\'.")
- assert_equal "<p>\ncat&#8217;s-\n</p>\n", util_format("cat\'s-")
- end
-
- def util_fragment(text)
- RDoc::Markup::Fragment.new 0, nil, nil, text
- end
-
- def util_format(text)
- fragment = util_fragment text
-
- @th.start_accepting
- @th.accept_paragraph @am, fragment
- @th.end_accepting
- end
-
-end
-
-MiniTest::Unit.autorun
diff --git a/test/rdoc/test_rdoc_markup_to_html_crossref.rb b/test/rdoc/test_rdoc_markup_to_html_crossref.rb
deleted file mode 100644
index f3a64f203b..0000000000
--- a/test/rdoc/test_rdoc_markup_to_html_crossref.rb
+++ /dev/null
@@ -1,299 +0,0 @@
-require 'rubygems'
-require 'minitest/unit'
-require 'rdoc/generator'
-require 'rdoc/stats'
-require 'rdoc/code_objects'
-require 'rdoc/markup/to_html_crossref'
-require 'rdoc/parser/ruby'
-
-require 'pathname'
-
-class TestRDocMarkupToHtmlCrossref < MiniTest::Unit::TestCase
-
- #
- # This method parses a source file and returns a Hash mapping
- # class names (Strings) to RDoc::Generator::Class instances
- # (classes), which can be used to create RDoc::Markup::ToHtmlCrossref
- # instances. The unit tests only test against classes starting with
- # Ref_, so this method only includes such classes in the Hash.
- #
- def create_class_hash
- # The relative gem would help here...
- # @source_file_name must be cleaned because rdoc does not deal
- # well with paths containing "." or "..".
- curr_file = Pathname.new(__FILE__)
- @source_file_name = curr_file.dirname + "rdoc_markup_to_html_crossref_reference.rb"
- @source_file_name = @source_file_name.cleanpath.to_s
-
- RDoc::TopLevel.reset
-
- # Reset RDoc::Generator::Method so that the method sequence number starts
- # at 1, making the method sequence numbers for the methods in the Ref_
- # predicable.
- RDoc::Generator::Method.reset
- top_level = RDoc::TopLevel.new @source_file_name
-
- options = RDoc::Options.new
- options.quiet = true
-
- # If this is false, then RDoc::Generator::Method will attempt to create
- # an HTML file containing the method source code when being instantiated,
- # which does not work in the context of this unit test.
- #
- # RDoc::Generator::Method needs to be refactored so that this does *not*
- # happen as part of instantiation.
- options.inline_source = true
-
- stats = RDoc::Stats.new 0
-
- parser = RDoc::Parser::Ruby.new(top_level,
- @source_file_name,
- IO.read(@source_file_name),
- options,
- stats)
- top_levels = []
- top_levels.push(parser.scan())
-
- files, classes = RDoc::Generator::Context.build_indices(top_levels, options)
-
- class_hash = {}
- classes.each do |klass|
- if(klass.name.include?("Ref_"))
- class_hash[klass.name] = klass
- end
- end
-
- return class_hash
- end
-
- #
- # This method uses xref to cross-reference String reference and
- # asserts that xref.convert(reference) is equal
- # to String expected_result.
- #
- def verify_convert(xref, reference, expected_result)
- # Everything converted in the tests will be within paragraph markup, so
- # add paragraph markup to the expected result.
- actual_expected_result = "<p>\n#{expected_result}\n</p>\n"
-
- result = xref.convert(reference)
-
- # RDoc::Markup::ToHtml word-wraps lines. It is tricky to predict where
- # a line will be wrapped except that it will happen on a space, so replace
- # all newlines with spaces in order to not have to worry about this.
- actual_expected_result.gsub!(/\n/, " ")
- result.gsub!(/\n/, " ")
-
- begin
- assert_equal actual_expected_result, result
- rescue MiniTest::Assertion => e
- bt = caller(2)
- raise e, [e.message, *bt.grep(/\A#{Regexp.quote(__FILE__)}:/o)].join("\n"), bt
- end
- end
-
- #
- # This method verifies that xref generates no cross-reference link for
- # String reference.
- #
- def verify_no_crossref(xref, reference)
- if(reference[0, 1] == "\\") # Remove the markup suppression character
- expected_result = reference[1, reference.length() - 1]
- else
- expected_result = reference
- end
-
- verify_convert(xref, reference, expected_result)
- end
-
- #
- # This method verifies that xref generates a cross-reference link to
- # class_name (String) for String reference.
- #
- def verify_class_crossref(xref, reference, class_name)
- class_file_name = class_name.gsub(/::/, "/")
-
- result = "<a href=\"../classes/#{class_file_name}.html\">#{reference}</a>"
-
- verify_convert xref, reference, result
- end
-
- #
- # This method verifies that xref generates a cross-reference link to method
- # method_seq (String, e.g, "M000001") in class_name (String) for
- # String reference.
- #
- def verify_method_crossref(xref, reference, class_name, method_seq)
- class_file_name = class_name.gsub(/::/, "/")
-
- result = "<a href=\"../classes/#{class_file_name}.html##{method_seq}\">#{reference}</a>"
-
- verify_convert xref, reference, result
- end
-
- #
- # This method verifies that xref generates a cross-reference link to
- # file_name (String) for String reference.
- #
- def verify_file_crossref(xref, reference, file_name)
- generated_document_path = Pathname.new("../files/#{file_name.gsub(/\./, '_')}.html").cleanpath.to_s
- result = "<a href=\"#{generated_document_path}\">#{reference}</a>"
-
- verify_convert xref, reference, result
- end
-
- #
- # This method verifies that several invariant cross-references are
- # (or are not) generated.
- #
- def verify_invariant_crossrefs(xref)
- # bogus does not exist and so no cross-reference should be generated.
- verify_no_crossref xref, "bogus"
- verify_no_crossref xref, "\\bogus"
-
- # Ref_Class1 is in the top-level namespace, and so a cross-reference always
- # should be generated, unless markup is suppressed.
- verify_class_crossref xref, "Ref_Class1", "Ref_Class1"
- verify_no_crossref xref, "\\Ref_Class1"
-
- # Ref_Class2 is in the top-level namespace, and so a cross-reference always
- # should be generated for it and for its nested classes.
- verify_class_crossref xref, "Ref_Class2", "Ref_Class2"
- verify_class_crossref xref, "Ref_Class2::Ref_Class3", "Ref_Class2::Ref_Class3"
- verify_method_crossref xref, "Ref_Class2::Ref_Class3#method", "Ref_Class2::Ref_Class3", "M000001"
- verify_method_crossref xref, "Ref_Class2::Ref_Class3#method()", "Ref_Class2::Ref_Class3", "M000001"
- verify_method_crossref xref, "Ref_Class2::Ref_Class3.method()", "Ref_Class2::Ref_Class3", "M000001"
- verify_method_crossref xref, "Ref_Class2::Ref_Class3.method(*)", "Ref_Class2::Ref_Class3", "M000001"
- verify_class_crossref xref, "Ref_Class2::Ref_Class3::Helper1", "Ref_Class2::Ref_Class3::Helper1"
- verify_method_crossref xref, "Ref_Class2::Ref_Class3::Helper1#method?", "Ref_Class2::Ref_Class3::Helper1", "M000002"
-
- # The hyphen character is not a valid class/method separator character, so
- # rdoc just generates a class cross-reference (perhaps it should not
- # generate anything?).
- result = "<a href=\"../classes/Ref_Class2/Ref_Class3.html\">Ref_Class2::Ref_Class3</a>;method(*)"
- verify_convert xref, "Ref_Class2::Ref_Class3;method(*)", result
-
- # There is one Ref_Class3 nested in Ref_Class2 and one defined in the
- # top-level namespace; regardless, ::Ref_Class3 (Ref_Class3 relative
- # to the top-level namespace) always should generate a link to the
- # top-level Ref_Class3 (unless of course cross-references are suppressed).
- verify_class_crossref xref, "::Ref_Class3", "Ref_Class3"
- verify_no_crossref xref, "\\::Ref_Class3"
- verify_class_crossref xref, "::Ref_Class3::Helper1", "Ref_Class3::Helper1"
- verify_class_crossref xref, "::Ref_Class3::Helper2", "Ref_Class3::Helper2"
-
- #
- # Ref_Class3::Helper1 does not have method method.
- #
- verify_no_crossref xref, "::Ref_Class3::Helper1#method"
- verify_no_crossref xref, "\\::Ref_Class3::Helper1#method"
-
- # References to Ref_Class2 relative to the top-level namespace always should
- # generate links to Ref_Class2.
- verify_method_crossref xref, "::Ref_Class2::Ref_Class3#method", "Ref_Class2::Ref_Class3", "M000001"
- verify_method_crossref xref, "::Ref_Class2::Ref_Class3#method()", "Ref_Class2::Ref_Class3", "M000001"
- verify_method_crossref xref, "::Ref_Class2::Ref_Class3#method(*)", "Ref_Class2::Ref_Class3", "M000001"
- verify_class_crossref xref, "::Ref_Class2::Ref_Class3::Helper1", "Ref_Class2::Ref_Class3::Helper1"
- verify_no_crossref xref, "\\::Ref_Class2::Ref_Class3#method(*)"
-
- # Suppressing cross-references always should suppress the generation of
- # links.
- verify_no_crossref xref, "\\#method"
- verify_no_crossref xref, "\\#method()"
- verify_no_crossref xref, "\\#method(*)"
-
- # Links never should be generated for words solely consisting of lowercase
- # letters, because too many links would get generated by mistake (i.e., the
- # word "new" always would be a link).
- verify_no_crossref xref, "method"
-
- # A link always should be generated for a file name.
- verify_file_crossref xref, @source_file_name, @source_file_name
-
- # References should be generated correctly for a class scoped within
- # a class of the same name.
- verify_class_crossref xref, "Ref_Class4::Ref_Class4", "Ref_Class4::Ref_Class4"
- end
-
- def test_handle_special_CROSSREF_no_underscore
- class_hash = create_class_hash
-
- # Note that we instruct the ToHtmlCrossref instance to show hashes so that
- # an exception won't have to be made for words starting with a '#'.
- # I'm also not convinced that the current behavior of the rdoc code
- # is correct since, without this, it strips the leading # from all
- # words, whether or not they end up as cross-references.
- #
- # After the behavior has been sorted out, this can be changed.
- #
- # Create a variety of RDoc::Markup::ToHtmlCrossref instances, for
- # different classes, and test the cross-references generated by
- # each.
- klass = class_hash["Ref_Class1"]
- xref = RDoc::Markup::ToHtmlCrossref.new 'from_path', klass, true
- verify_invariant_crossrefs xref
- verify_class_crossref xref, "Ref_Class3", "Ref_Class3"
- verify_no_crossref xref, "Ref_Class3#method"
- verify_no_crossref xref, "#method"
- verify_class_crossref xref, "Ref_Class3::Helper1", "Ref_Class3::Helper1"
- verify_class_crossref xref, "Ref_Class3::Helper2", "Ref_Class3::Helper2"
- verify_no_crossref xref, "Helper1"
- verify_class_crossref xref, "Ref_Class4", "Ref_Class4"
-
- klass = class_hash["Ref_Class2"]
- xref = RDoc::Markup::ToHtmlCrossref.new 'from_path', klass, true
- verify_invariant_crossrefs xref
- verify_class_crossref xref, "Ref_Class3", "Ref_Class2::Ref_Class3"
- verify_method_crossref xref, "Ref_Class3#method", "Ref_Class2::Ref_Class3", "M000001"
- verify_no_crossref xref, "#method"
- verify_class_crossref xref, "Ref_Class3::Helper1", "Ref_Class2::Ref_Class3::Helper1"
- verify_class_crossref xref, "Ref_Class4", "Ref_Class4"
-
- # This one possibly is an rdoc bug...
- # Ref_Class2 has a nested Ref_Class3, but
- # Ref_Class2::Ref_Class3::Helper2 does not exist.
- # On the other hand, there is a Ref_Class3::Helper2
- # in the top-level namespace... Should rdoc stop
- # looking if it finds one class match?
- verify_no_crossref xref, "Ref_Class3::Helper2"
- verify_no_crossref xref, "Helper1"
-
- klass = class_hash["Ref_Class2::Ref_Class3"]
- xref = RDoc::Markup::ToHtmlCrossref.new 'from_path', klass, true
- verify_invariant_crossrefs xref
- verify_class_crossref xref, "Ref_Class3", "Ref_Class2::Ref_Class3"
- verify_method_crossref xref, "Ref_Class3#method", "Ref_Class2::Ref_Class3", "M000001"
- verify_method_crossref xref, "#method", "Ref_Class2::Ref_Class3", "M000001"
- verify_class_crossref xref, "Ref_Class3::Helper1", "Ref_Class2::Ref_Class3::Helper1"
- verify_no_crossref xref, "Ref_Class3::Helper2"
- verify_class_crossref xref, "Helper1", "Ref_Class2::Ref_Class3::Helper1"
- verify_class_crossref xref, "Ref_Class4", "Ref_Class4"
-
- klass = class_hash["Ref_Class3"]
- xref = RDoc::Markup::ToHtmlCrossref.new 'from_path', klass, true
- verify_invariant_crossrefs xref
- verify_class_crossref xref, "Ref_Class3", "Ref_Class3"
- verify_no_crossref xref, "Ref_Class3#method"
- verify_no_crossref xref, "#method"
- verify_class_crossref xref, "Ref_Class3::Helper1", "Ref_Class3::Helper1"
- verify_class_crossref xref, "Ref_Class3::Helper2", "Ref_Class3::Helper2"
- verify_class_crossref xref, "Helper1", "Ref_Class3::Helper1"
- verify_class_crossref xref, "Ref_Class4", "Ref_Class4"
-
- klass = class_hash["Ref_Class4"]
- xref = RDoc::Markup::ToHtmlCrossref.new 'from_path', klass, true
- verify_invariant_crossrefs xref
- # A Ref_Class4 reference inside a Ref_Class4 class containing a
- # Ref_Class4 class should resolve to the contained class.
- verify_class_crossref xref, "Ref_Class4", "Ref_Class4::Ref_Class4"
-
- klass = class_hash["Ref_Class4::Ref_Class4"]
- xref = RDoc::Markup::ToHtmlCrossref.new 'from_path', klass, true
- verify_invariant_crossrefs xref
- # A Ref_Class4 reference inside a Ref_Class4 class contained within
- # a Ref_Class4 class should resolve to the inner Ref_Class4 class.
- verify_class_crossref xref, "Ref_Class4", "Ref_Class4::Ref_Class4"
- end
-end
-
-MiniTest::Unit.autorun
diff --git a/test/rdoc/test_rdoc_parser.rb b/test/rdoc/test_rdoc_parser.rb
deleted file mode 100644
index d6420d20f1..0000000000
--- a/test/rdoc/test_rdoc_parser.rb
+++ /dev/null
@@ -1,23 +0,0 @@
-require 'rubygems'
-require 'minitest/unit'
-require 'rdoc/parser'
-require 'rdoc/parser/ruby'
-
-class TestRDocParser < MiniTest::Unit::TestCase
- def test_can_parse
- assert_equal(RDoc::Parser.can_parse(__FILE__), RDoc::Parser::Ruby)
-
- readme_file_name = File.join(File.dirname(__FILE__), "..", "README.txt")
-
- unless File.exist? readme_file_name then # HACK for tests in trunk :/
- readme_file_name = File.join File.dirname(__FILE__), '..', '..', 'README'
- end
-
- assert_equal(RDoc::Parser.can_parse(readme_file_name), RDoc::Parser::Simple)
-
- binary_file_name = File.join(File.dirname(__FILE__), "binary.dat")
- assert_equal(RDoc::Parser.can_parse(binary_file_name), nil)
- end
-end
-
-MiniTest::Unit.autorun
diff --git a/test/rdoc/test_rdoc_parser_c.rb b/test/rdoc/test_rdoc_parser_c.rb
deleted file mode 100644
index ebf96594c8..0000000000
--- a/test/rdoc/test_rdoc_parser_c.rb
+++ /dev/null
@@ -1,287 +0,0 @@
-require 'stringio'
-require 'tempfile'
-require 'rubygems'
-require 'minitest/unit'
-require 'rdoc/options'
-require 'rdoc/parser/c'
-
-class RDoc::Parser::C
- attr_accessor :classes
-
- public :do_classes, :do_constants
-end
-
-class TestRDocParserC < MiniTest::Unit::TestCase
-
- def setup
- @tempfile = Tempfile.new self.class.name
- filename = @tempfile.path
-
- @top_level = RDoc::TopLevel.new filename
- @fn = filename
- @options = RDoc::Options.new
- @stats = RDoc::Stats.new 0
- end
-
- def teardown
- @tempfile.close
- end
-
- def test_do_classes_boot_class
- content = <<-EOF
-/* Document-class: Foo
- * this is the Foo boot class
- */
-VALUE cFoo = boot_defclass("Foo", 0);
- EOF
-
- klass = util_get_class content, 'cFoo'
- assert_equal " this is the Foo boot class\n ", klass.comment
- end
-
- def test_do_classes_class
- content = <<-EOF
-/* Document-class: Foo
- * this is the Foo class
- */
-VALUE cFoo = rb_define_class("Foo", rb_cObject);
- EOF
-
- klass = util_get_class content, 'cFoo'
- assert_equal " this is the Foo class\n ", klass.comment
- end
-
- def test_do_classes_class_under
- content = <<-EOF
-/* Document-class: Kernel::Foo
- * this is the Foo class under Kernel
- */
-VALUE cFoo = rb_define_class_under(rb_mKernel, "Foo", rb_cObject);
- EOF
-
- klass = util_get_class content, 'cFoo'
- assert_equal " this is the Foo class under Kernel\n ", klass.comment
- end
-
- def test_do_classes_module
- content = <<-EOF
-/* Document-module: Foo
- * this is the Foo module
- */
-VALUE mFoo = rb_define_module("Foo");
- EOF
-
- klass = util_get_class content, 'mFoo'
- assert_equal " this is the Foo module\n ", klass.comment
- end
-
- def test_do_classes_module_under
- content = <<-EOF
-/* Document-module: Kernel::Foo
- * this is the Foo module under Kernel
- */
-VALUE mFoo = rb_define_module_under(rb_mKernel, "Foo");
- EOF
-
- klass = util_get_class content, 'mFoo'
- assert_equal " this is the Foo module under Kernel\n ", klass.comment
- end
-
- def test_do_constants
- content = <<-EOF
-#include <ruby.h>
-
-void Init_foo(){
- VALUE cFoo = rb_define_class("Foo", rb_cObject);
-
- /* 300: The highest possible score in bowling */
- rb_define_const(cFoo, "PERFECT", INT2FIX(300));
-
- /* Huzzah!: What you cheer when you roll a perfect game */
- rb_define_const(cFoo, "CHEER", rb_str_new2("Huzzah!"));
-
- /* TEST\:TEST: Checking to see if escaped semicolon works */
- rb_define_const(cFoo, "TEST", rb_str_new2("TEST:TEST"));
-
- /* \\: The file separator on MS Windows */
- rb_define_const(cFoo, "MSEPARATOR", rb_str_new2("\\"));
-
- /* /: The file separator on Unix */
- rb_define_const(cFoo, "SEPARATOR", rb_str_new2("/"));
-
- /* C:\\Program Files\\Stuff: A directory on MS Windows */
- rb_define_const(cFoo, "STUFF", rb_str_new2("C:\\Program Files\\Stuff"));
-
- /* Default definition */
- rb_define_const(cFoo, "NOSEMI", INT2FIX(99));
-
- rb_define_const(cFoo, "NOCOMMENT", rb_str_new2("No comment"));
-
- /*
- * Multiline comment goes here because this comment spans multiple lines.
- * Multiline comment goes here because this comment spans multiple lines.
- */
- rb_define_const(cFoo, "MULTILINE", INT2FIX(1));
-
- /*
- * 1: Multiline comment goes here because this comment spans multiple lines.
- * Multiline comment goes here because this comment spans multiple lines.
- */
- rb_define_const(cFoo, "MULTILINE_VALUE", INT2FIX(1));
-
- /* Multiline comment goes here because this comment spans multiple lines.
- * Multiline comment goes here because this comment spans multiple lines.
- */
- rb_define_const(cFoo, "MULTILINE_NOT_EMPTY", INT2FIX(1));
-
-}
- EOF
-
- parser = util_parser content
-
- parser.do_classes
- parser.do_constants
-
- klass = parser.classes['cFoo']
- assert klass
-
- constants = klass.constants
- assert !klass.constants.empty?
-
- constants = constants.map { |c| [c.name, c.value, c.comment] }
-
- assert_equal ['PERFECT', '300',
- "\n The highest possible score in bowling \n "],
- constants.shift
- assert_equal ['CHEER', 'Huzzah!',
- "\n What you cheer when you roll a perfect game \n "],
- constants.shift
- assert_equal ['TEST', 'TEST:TEST',
- "\n Checking to see if escaped semicolon works \n "],
- constants.shift
- assert_equal ['MSEPARATOR', '\\',
- "\n The file separator on MS Windows \n "],
- constants.shift
- assert_equal ['SEPARATOR', '/',
- "\n The file separator on Unix \n "],
- constants.shift
- assert_equal ['STUFF', 'C:\\Program Files\\Stuff',
- "\n A directory on MS Windows \n "],
- constants.shift
- assert_equal ['NOSEMI', 'INT2FIX(99)',
- "\n Default definition \n "],
- constants.shift
- assert_equal ['NOCOMMENT', 'rb_str_new2("No comment")', nil],
- constants.shift
-
- comment = <<-EOF.chomp
-
-
- Multiline comment goes here because this comment spans multiple lines.
- Multiline comment goes here because this comment spans multiple lines.
-
-
- EOF
- assert_equal ['MULTILINE', 'INT2FIX(1)', comment], constants.shift
- assert_equal ['MULTILINE_VALUE', '1', comment], constants.shift
-
- comment = <<-EOF.chomp
-
- Multiline comment goes here because this comment spans multiple lines.
- Multiline comment goes here because this comment spans multiple lines.
-
-
- EOF
- assert_equal ['MULTILINE_NOT_EMPTY', 'INT2FIX(1)', comment], constants.shift
-
- assert constants.empty?, constants.inspect
- end
-
- def test_find_class_comment_init
- content = <<-EOF
-/*
- * a comment for class Foo
- */
-void
-Init_Foo(void) {
- VALUE foo = rb_define_class("Foo", rb_cObject);
-}
- EOF
-
- klass = util_get_class content, 'foo'
-
- assert_equal " \n a comment for class Foo\n \n", klass.comment
- end
-
- def test_find_class_comment_define_class
- content = <<-EOF
-/*
- * a comment for class Foo
- */
-VALUE foo = rb_define_class("Foo", rb_cObject);
- EOF
-
- klass = util_get_class content, 'foo'
-
- assert_equal " \n a comment for class Foo\n ", klass.comment
- end
-
- def test_find_class_comment_define_class_Init_Foo
- content = <<-EOF
-/*
- * a comment for class Foo on Init
- */
-void
-Init_Foo(void) {
- /*
- * a comment for class Foo on rb_define_class
- */
- VALUE foo = rb_define_class("Foo", rb_cObject);
-}
- EOF
-
- klass = util_get_class content, 'foo'
-
- assert_equal " \n a comment for class Foo on Init\n \n", klass.comment
- end
-
- def test_define_method
- content = <<-EOF
-/*Method Comment! */
-static VALUE
-rb_io_s_read(argc, argv, io)
- int argc;
- VALUE *argv;
- VALUE io;
-{
-}
-
-void
-Init_IO(void) {
- /*
- * a comment for class Foo on rb_define_class
- */
- VALUE rb_cIO = rb_define_class("IO", rb_cObject);
- rb_define_singleton_method(rb_cIO, "read", rb_io_s_read, -1);
-}
- EOF
-
- klass = util_get_class content, 'rb_cIO'
- read_method = klass.method_list.first
- assert_equal "read", read_method.name
- assert_equal " Method Comment! \n", read_method.comment
- end
-
- def util_get_class(content, name)
- parser = util_parser content
- parser.scan
- parser.classes[name]
- end
-
- def util_parser(content)
- RDoc::Parser::C.new @top_level, @fn, content, @options, @stats
- end
-
-end
-
-MiniTest::Unit.autorun
diff --git a/test/rdoc/test_rdoc_parser_perl.rb b/test/rdoc/test_rdoc_parser_perl.rb
deleted file mode 100644
index 165cadaa5d..0000000000
--- a/test/rdoc/test_rdoc_parser_perl.rb
+++ /dev/null
@@ -1,74 +0,0 @@
-require 'stringio'
-require 'tempfile'
-require 'rubygems'
-require 'minitest/unit'
-require 'rdoc/options'
-require 'rdoc/parser/perl'
-
-class TestRdocParserPerlPOD < MiniTest::Unit::TestCase
-
- def setup
- @tempfile = Tempfile.new self.class.name
- filename = @tempfile.path
-
- @top_level = RDoc::TopLevel.new filename
- @fn = filename
- @options = RDoc::Options.new
- @stats = RDoc::Stats.new 0
- end
-
- def teardown
- @tempfile.close
- end
-
- def test_uncommented_perl
- content = <<-EOF
-while (<>) {
- tr/a-z/A-Z;
- print
-}
- EOF
-
- comment = util_get_comment content
- assert_equal "", comment
- end
-
- def test_perl_without_pod
- content = <<-EOF
-#!/usr/local/bin/perl
-#
-#This is a pointless perl program because it does -p.
-#
-while(<>) {print;}:
- EOF
-
- comment = util_get_comment content
- assert_equal "", comment
- end
-
- def test_simple_pod_no_structure
- content = <<-EOF
-=begin pod
-
-This just contains plain old documentation
-
-=end
- EOF
- comment = util_get_comment content
- assert_equal "\nThis just contains plain old documentation\n\n", comment
- end
-
- # Get the comment of the @top_level when it has processed the input.
- def util_get_comment(content)
- parser = util_parser content
- parser.scan.comment
- end
-
- # create a new parser with the supplied content.
- def util_parser(content)
- RDoc::Parser::PerlPOD.new @top_level, @fn, content, @options, @stats
- end
-
-end
-
-MiniTest::Unit.autorun
diff --git a/test/rdoc/test_rdoc_parser_ruby.rb b/test/rdoc/test_rdoc_parser_ruby.rb
deleted file mode 100644
index 7fe626c302..0000000000
--- a/test/rdoc/test_rdoc_parser_ruby.rb
+++ /dev/null
@@ -1,751 +0,0 @@
-require 'stringio'
-require 'tempfile'
-require 'rubygems'
-require 'minitest/unit'
-
-require 'rdoc/options'
-require 'rdoc/parser/ruby'
-require 'rdoc/stats'
-
-class TestRDocParserRuby < MiniTest::Unit::TestCase
-
- def setup
- @tempfile = Tempfile.new self.class.name
- @filename = @tempfile.path
-
- # Some tests need two paths.
- @tempfile2 = Tempfile.new self.class.name
- @filename2 = @tempfile2.path
-
- util_toplevel
- @options = RDoc::Options.new
- @options.quiet = true
- @stats = RDoc::Stats.new 0
- end
-
- def teardown
- @tempfile.close
- @tempfile2.close
- end
-
- def test_look_for_directives_in_commented
- util_parser ""
-
- comment = "# how to make a section:\n# # :section: new section\n"
-
- @parser.look_for_directives_in @top_level, comment
-
- section = @top_level.current_section
- assert_equal nil, section.title
- assert_equal nil, section.comment
-
- assert_equal "# how to make a section:\n# # :section: new section\n",
- comment
- end
-
- def test_look_for_directives_in_enddoc
- util_parser ""
-
- assert_throws :enddoc do
- @parser.look_for_directives_in @top_level, "# :enddoc:\n"
- end
- end
-
- def test_look_for_directives_in_main
- util_parser ""
-
- @parser.look_for_directives_in @top_level, "# :main: new main page\n"
-
- assert_equal 'new main page', @options.main_page
- end
-
- def test_look_for_directives_in_method
- util_parser ""
-
- comment = "# :method: my_method\n"
-
- @parser.look_for_directives_in @top_level, comment
-
- assert_equal "# :method: my_method\n", comment
-
- comment = "# :singleton-method: my_method\n"
-
- @parser.look_for_directives_in @top_level, comment
-
- assert_equal "# :singleton-method: my_method\n", comment
- end
-
- def test_look_for_directives_in_startdoc
- util_parser ""
-
- @top_level.stop_doc
- assert !@top_level.document_self
- assert !@top_level.document_children
- assert !@top_level.force_documentation
-
- @parser.look_for_directives_in @top_level, "# :startdoc:\n"
-
- assert @top_level.document_self
- assert @top_level.document_children
- assert @top_level.force_documentation
- end
-
- def test_look_for_directives_in_stopdoc
- util_parser ""
-
- assert @top_level.document_self
- assert @top_level.document_children
-
- @parser.look_for_directives_in @top_level, "# :stopdoc:\n"
-
- assert !@top_level.document_self
- assert !@top_level.document_children
- end
-
- def test_look_for_directives_in_section
- util_parser ""
-
- comment = "# :section: new section\n# woo stuff\n"
-
- @parser.look_for_directives_in @top_level, comment
-
- section = @top_level.current_section
- assert_equal 'new section', section.title
- assert_equal "# woo stuff\n", section.comment
-
- assert_equal '', comment
- end
-
- def test_look_for_directives_in_title
- util_parser ""
-
- @parser.look_for_directives_in @top_level, "# :title: new title\n"
-
- assert_equal 'new title', @options.title
- end
-
- def test_look_for_directives_in_unhandled
- util_parser ""
-
- comment = "# :unhandled: \n# :title: hi\n"
-
- @parser.look_for_directives_in @top_level, comment
-
- assert_equal "# :unhandled: \n", comment
-
- assert_equal 'hi', @options.title
- end
-
- def test_parse_class
- comment = "##\n# my method\n"
-
- util_parser 'class Foo; end'
-
- tk = @parser.get_tk
-
- @parser.parse_class @top_level, RDoc::Parser::Ruby::NORMAL, tk, comment
-
- foo = @top_level.classes.first
- assert_equal 'Foo', foo.full_name
- assert_equal comment, foo.comment
- end
-
- def test_parse_class_nested_superclass
- foo = RDoc::NormalModule.new 'Foo'
- foo.parent = @top_level
-
- util_parser "class Bar < Super\nend"
-
- tk = @parser.get_tk
-
- @parser.parse_class foo, RDoc::Parser::Ruby::NORMAL, tk, ''
-
- bar = foo.classes.first
- assert_equal 'Super', bar.superclass
- end
-
- def test_parse_module
- comment = "##\n# my module\n"
-
- util_parser 'module Foo; end'
-
- tk = @parser.get_tk
-
- @parser.parse_module @top_level, RDoc::Parser::Ruby::NORMAL, tk, comment
-
- foo = @top_level.modules.first
- assert_equal 'Foo', foo.full_name
- assert_equal comment, foo.comment
- end
-
- def test_parse_class_mistaken_for_module
-#
-# The code below is not strictly legal Ruby (Foo must have been defined
-# before Foo::Bar is encountered), but RDoc might encounter Foo::Bar before
-# Foo if they live in different files.
-#
- code = <<-EOF
-class Foo::Bar
-end
-
-module Foo::Baz
-end
-
-class Foo
-end
-EOF
-
- util_parser code
-
- @parser.scan()
-
- assert(@top_level.modules.empty?)
- foo = @top_level.classes.first
- assert_equal 'Foo', foo.full_name
-
- bar = foo.classes.first
- assert_equal 'Foo::Bar', bar.full_name
-
- baz = foo.modules.first
- assert_equal 'Foo::Baz', baz.full_name
- end
-
- def test_parse_class_definition_encountered_after_class_reference
-#
-# The code below is not strictly legal Ruby (Foo must have been defined
-# before Foo.bar is encountered), but RDoc might encounter Foo.bar before
-# Foo if they live in different files.
-#
- code = <<-EOF
-def Foo.bar
-end
-
-class Foo < IO
-end
-EOF
-
- util_parser code
-
- @parser.scan()
-
- assert(@top_level.modules.empty?)
-
- foo = @top_level.classes.first
- assert_equal 'Foo', foo.full_name
- assert_equal 'IO', foo.superclass
-
- bar = foo.method_list.first
- assert_equal 'bar', bar.name
- end
-
- def test_parse_module_relative_to_top_level_namespace
- comment = <<-EOF
-#
-# Weirdly named module
-#
-EOF
-
- code = comment + <<-EOF
-module ::Foo
- class Helper
- end
-end
-EOF
-
- util_parser code
- @parser.scan()
-
- foo = @top_level.modules.first
- assert_equal 'Foo', foo.full_name
- assert_equal comment, foo.comment
-
- helper = foo.classes.first
- assert_equal 'Foo::Helper', helper.full_name
- end
-
- def test_parse_comment
- content = <<-EOF
-class Foo
- ##
- # :method: my_method
- # my method comment
-
-end
- EOF
- klass = RDoc::NormalClass.new 'Foo'
- klass.parent = @top_level
-
- comment = "##\n# :method: foo\n# my method\n"
-
- util_parser "\n"
-
- tk = @parser.get_tk
-
- @parser.parse_comment klass, tk, comment
-
- foo = klass.method_list.first
- assert_equal 'foo', foo.name
- assert_equal comment, foo.comment
-
- assert_equal [], foo.aliases
- assert_equal nil, foo.block_params
- assert_equal nil, foo.call_seq
- assert_equal nil, foo.is_alias_for
- assert_equal nil, foo.viewer
- assert_equal true, foo.document_children
- assert_equal true, foo.document_self
- assert_equal '', foo.params
- assert_equal false, foo.done_documenting
- assert_equal false, foo.dont_rename_initialize
- assert_equal false, foo.force_documentation
- assert_equal klass, foo.parent
- assert_equal false, foo.singleton
- assert_equal :public, foo.visibility
- assert_equal "\n", foo.text
- assert_equal klass.current_section, foo.section
-
- stream = [
- tk(:COMMENT, 1, 1, nil, "# File #{@top_level.file_absolute_name}, line 1"),
- RDoc::Parser::Ruby::NEWLINE_TOKEN,
- tk(:SPACE, 1, 1, nil, ''),
- ]
-
- assert_equal stream, foo.token_stream
- end
-
- def test_parse_meta_method
- klass = RDoc::NormalClass.new 'Foo'
- klass.parent = @top_level
-
- comment = "##\n# my method\n"
-
- util_parser "add_my_method :foo, :bar\nadd_my_method :baz"
-
- tk = @parser.get_tk
-
- @parser.parse_meta_method klass, RDoc::Parser::Ruby::NORMAL, tk, comment
-
- foo = klass.method_list.first
- assert_equal 'foo', foo.name
- assert_equal comment, foo.comment
-
- assert_equal [], foo.aliases
- assert_equal nil, foo.block_params
- assert_equal nil, foo.call_seq
- assert_equal true, foo.document_children
- assert_equal true, foo.document_self
- assert_equal false, foo.done_documenting
- assert_equal false, foo.dont_rename_initialize
- assert_equal false, foo.force_documentation
- assert_equal nil, foo.is_alias_for
- assert_equal '', foo.params
- assert_equal klass, foo.parent
- assert_equal false, foo.singleton
- assert_equal 'add_my_method :foo', foo.text
- assert_equal nil, foo.viewer
- assert_equal :public, foo.visibility
- assert_equal klass.current_section, foo.section
-
- stream = [
- tk(:COMMENT, 1, 1, nil, "# File #{@top_level.file_absolute_name}, line 1"),
- RDoc::Parser::Ruby::NEWLINE_TOKEN,
- tk(:SPACE, 1, 1, nil, ''),
- tk(:IDENTIFIER, 1, 0, 'add_my_method', 'add_my_method'),
- tk(:SPACE, 1, 13, nil, ' '),
- tk(:SYMBOL, 1, 14, nil, ':foo'),
- tk(:COMMA, 1, 18, nil, ','),
- tk(:SPACE, 1, 19, nil, ' '),
- tk(:SYMBOL, 1, 20, nil, ':bar'),
- tk(:NL, 1, 24, nil, "\n"),
- ]
-
- assert_equal stream, foo.token_stream
- end
-
- def test_parse_meta_method_name
- klass = RDoc::NormalClass.new 'Foo'
- klass.parent = @top_level
-
- comment = "##\n# :method: woo_hoo!\n# my method\n"
-
- util_parser "add_my_method :foo, :bar\nadd_my_method :baz"
-
- tk = @parser.get_tk
-
- @parser.parse_meta_method klass, RDoc::Parser::Ruby::NORMAL, tk, comment
-
- foo = klass.method_list.first
- assert_equal 'woo_hoo!', foo.name
- assert_equal "##\n# my method\n", foo.comment
- end
-
- def test_parse_meta_method_singleton
- klass = RDoc::NormalClass.new 'Foo'
- klass.parent = @top_level
-
- comment = "##\n# :singleton-method:\n# my method\n"
-
- util_parser "add_my_method :foo, :bar\nadd_my_method :baz"
-
- tk = @parser.get_tk
-
- @parser.parse_meta_method klass, RDoc::Parser::Ruby::NORMAL, tk, comment
-
- foo = klass.method_list.first
- assert_equal 'foo', foo.name
- assert_equal true, foo.singleton, 'singleton method'
- assert_equal "##\n# my method\n", foo.comment
- end
-
- def test_parse_meta_method_singleton_name
- klass = RDoc::NormalClass.new 'Foo'
- klass.parent = @top_level
-
- comment = "##\n# :singleton-method: woo_hoo!\n# my method\n"
-
- util_parser "add_my_method :foo, :bar\nadd_my_method :baz"
-
- tk = @parser.get_tk
-
- @parser.parse_meta_method klass, RDoc::Parser::Ruby::NORMAL, tk, comment
-
- foo = klass.method_list.first
- assert_equal 'woo_hoo!', foo.name
- assert_equal true, foo.singleton, 'singleton method'
- assert_equal "##\n# my method\n", foo.comment
- end
-
- def test_parse_meta_method_string_name
- klass = RDoc::NormalClass.new 'Foo'
- comment = "##\n# my method\n"
-
- util_parser "add_my_method 'foo'"
-
- tk = @parser.get_tk
-
- @parser.parse_meta_method klass, RDoc::Parser::Ruby::NORMAL, tk, comment
-
- foo = klass.method_list.first
- assert_equal 'foo', foo.name
- assert_equal comment, foo.comment
- end
-
- def test_parse_method
- klass = RDoc::NormalClass.new 'Foo'
- klass.parent = @top_level
-
- comment = "##\n# my method\n"
-
- util_parser "def foo() :bar end"
-
- tk = @parser.get_tk
-
- @parser.parse_method klass, RDoc::Parser::Ruby::NORMAL, tk, comment
-
- foo = klass.method_list.first
- assert_equal 'foo', foo.name
- assert_equal comment, foo.comment
-
- assert_equal [], foo.aliases
- assert_equal nil, foo.block_params
- assert_equal nil, foo.call_seq
- assert_equal nil, foo.is_alias_for
- assert_equal nil, foo.viewer
- assert_equal true, foo.document_children
- assert_equal true, foo.document_self
- assert_equal '()', foo.params
- assert_equal false, foo.done_documenting
- assert_equal false, foo.dont_rename_initialize
- assert_equal false, foo.force_documentation
- assert_equal klass, foo.parent
- assert_equal false, foo.singleton
- assert_equal :public, foo.visibility
- assert_equal 'def foo', foo.text
- assert_equal klass.current_section, foo.section
-
- stream = [
- tk(:COMMENT, 1, 1, nil, "# File #{@top_level.file_absolute_name}, line 1"),
- RDoc::Parser::Ruby::NEWLINE_TOKEN,
- tk(:SPACE, 1, 1, nil, ''),
- tk(:DEF, 1, 0, 'def', 'def'),
- tk(:SPACE, 1, 3, nil, ' '),
- tk(:IDENTIFIER, 1, 4, 'foo', 'foo'),
- tk(:LPAREN, 1, 7, nil, '('),
- tk(:RPAREN, 1, 8, nil, ')'),
- tk(:SPACE, 1, 9, nil, ' '),
- tk(:COLON, 1, 10, nil, ':'),
- tk(:IDENTIFIER, 1, 11, 'bar', 'bar'),
- tk(:SPACE, 1, 14, nil, ' '),
- tk(:END, 1, 15, 'end', 'end'),
- ]
-
- assert_equal stream, foo.token_stream
- end
-
- def test_parse_statements_class_nested
- comment = "##\n# my method\n"
-
- util_parser "module Foo\n#{comment}class Bar\nend\nend"
-
- @parser.parse_statements @top_level, RDoc::Parser::Ruby::NORMAL, nil, ''
-
- foo = @top_level.modules.first
- assert_equal 'Foo', foo.full_name, 'module Foo'
-
- bar = foo.classes.first
- assert_equal 'Foo::Bar', bar.full_name, 'class Foo::Bar'
- assert_equal comment, bar.comment
- end
-
- def test_parse_statements_identifier_meta_method
- content = <<-EOF
-class Foo
- ##
- # this is my method
- add_my_method :foo
-end
- EOF
-
- util_parser content
-
- @parser.parse_statements @top_level, RDoc::Parser::Ruby::NORMAL, nil, ''
-
- foo = @top_level.classes.first.method_list.first
- assert_equal 'foo', foo.name
- end
-
- def test_parse_statements_identifier_alias_method
- content = "class Foo def foo() end; alias_method :foo2, :foo end"
-
- util_parser content
-
- @parser.parse_statements @top_level, RDoc::Parser::Ruby::NORMAL, nil, ''
-
- foo = @top_level.classes.first.method_list[0]
- assert_equal 'foo', foo.name
-
- foo2 = @top_level.classes.first.method_list.last
- assert_equal 'foo2', foo2.name
- assert_equal 'foo', foo2.is_alias_for.name
- assert @top_level.classes.first.aliases.empty?
- end
-
- def test_parse_statements_identifier_alias_method_before_original_method
- # This is not strictly legal Ruby code, but it simulates finding an alias
- # for a method before finding the original method, which might happen
- # to rdoc if the alias is in a different file than the original method
- # and rdoc processes the alias' file first.
- content = <<-EOF
-class Foo
- alias_method :foo2, :foo
-
- alias_method :foo3, :foo
-
- def foo()
- end
-
- alias_method :foo4, :foo
-
- alias_method :foo5, :unknown
-end
-EOF
-
- util_parser content
-
- @parser.parse_statements @top_level, RDoc::Parser::Ruby::NORMAL, nil, ''
-
- foo = @top_level.classes.first.method_list[0]
- assert_equal 'foo', foo.name
-
- foo2 = @top_level.classes.first.method_list[1]
- assert_equal 'foo2', foo2.name
- assert_equal 'foo', foo2.is_alias_for.name
-
- foo3 = @top_level.classes.first.method_list[2]
- assert_equal 'foo3', foo3.name
- assert_equal 'foo', foo3.is_alias_for.name
-
- foo4 = @top_level.classes.first.method_list.last
- assert_equal 'foo4', foo4.name
- assert_equal 'foo', foo4.is_alias_for.name
-
- assert_equal 'unknown', @top_level.classes.first.aliases[0].old_name
- end
-
- def test_parse_statements_identifier_constant
- content = <<-EOF
-class Foo
- FIRST_CONSTANT = 5
-
- SECOND_CONSTANT = [
- 1,
- 2,
- 3
- ]
-
- THIRD_CONSTANT = {
- :foo => 'bar',
- :x => 'y'
- }
-
- FOURTH_CONSTANT = SECOND_CONSTANT.map do |element|
- element + 1
- element + 2
- end
-
- FIFTH_CONSTANT = SECOND_CONSTANT.map { |element| element + 1 }
-end
-EOF
-
- util_parser content
-
- @parser.parse_statements @top_level, RDoc::Parser::Ruby::NORMAL, nil, ''
-
- constants = @top_level.classes.first.constants
-
- constant = constants[0]
- assert_equal 'FIRST_CONSTANT', constant.name
- assert_equal '5', constant.value
-
- constant = constants[1]
- assert_equal 'SECOND_CONSTANT', constant.name
- assert_equal '[ 1, 2, 3 ]', constant.value
-
- constant = constants[2]
- assert_equal 'THIRD_CONSTANT', constant.name
- assert_equal "{ :foo => 'bar', :x => 'y' }", constant.value
-
- constant = constants[3]
- assert_equal 'FOURTH_CONSTANT', constant.name
- assert_equal 'SECOND_CONSTANT.map do |element| element + 1 element + 2 end', constant.value
-
- constant = constants.last
- assert_equal 'FIFTH_CONSTANT', constant.name
- assert_equal 'SECOND_CONSTANT.map { |element| element + 1 }', constant.value
- end
-
- def test_parse_statements_identifier_attr
- content = "class Foo; attr :foo; end"
-
- util_parser content
-
- @parser.parse_statements @top_level, RDoc::Parser::Ruby::NORMAL, nil, ''
-
- foo = @top_level.classes.first.attributes.first
- assert_equal 'foo', foo.name
- assert_equal 'R', foo.rw
- end
-
- def test_parse_statements_identifier_attr_accessor
- content = "class Foo; attr_accessor :foo; end"
-
- util_parser content
-
- @parser.parse_statements @top_level, RDoc::Parser::Ruby::NORMAL, nil, ''
-
- foo = @top_level.classes.first.attributes.first
- assert_equal 'foo', foo.name
- assert_equal 'RW', foo.rw
- end
-
- def test_parse_statements_identifier_extra_accessors
- @options.extra_accessors = /^my_accessor$/
-
- content = "class Foo; my_accessor :foo; end"
-
- util_parser content
-
- @parser.parse_statements @top_level, RDoc::Parser::Ruby::NORMAL, nil, ''
-
- foo = @top_level.classes.first.attributes.first
- assert_equal 'foo', foo.name
- assert_equal '?', foo.rw
- end
-
- def test_parse_statements_identifier_include
- content = "class Foo; include Bar; end"
-
- util_parser content
-
- @parser.parse_statements @top_level, RDoc::Parser::Ruby::NORMAL, nil, ''
-
- foo = @top_level.classes.first
- assert_equal 'Foo', foo.name
- assert_equal 1, foo.includes.length
- end
-
- def test_parse_statements_identifier_module_function
- content = "module Foo def foo() end; module_function :foo; end"
-
- util_parser content
-
- @parser.parse_statements @top_level, RDoc::Parser::Ruby::NORMAL, nil, ''
-
- foo, s_foo = @top_level.modules.first.method_list
- assert_equal 'foo', foo.name, 'instance method name'
- assert_equal :private, foo.visibility, 'instance method visibility'
- assert_equal false, foo.singleton, 'instance method singleton'
-
- assert_equal 'foo', s_foo.name, 'module function name'
- assert_equal :public, s_foo.visibility, 'module function visibility'
- assert_equal true, s_foo.singleton, 'module function singleton'
- end
-
- def test_parse_statements_identifier_private
- content = "class Foo private; def foo() end end"
-
- util_parser content
-
- @parser.parse_statements @top_level, RDoc::Parser::Ruby::NORMAL, nil, ''
-
- foo = @top_level.classes.first.method_list.first
- assert_equal 'foo', foo.name
- assert_equal :private, foo.visibility
- end
-
- def test_parse_statements_identifier_require
- content = "require 'bar'"
-
- util_parser content
-
- @parser.parse_statements @top_level, RDoc::Parser::Ruby::NORMAL, nil, ''
-
- assert_equal 1, @top_level.requires.length
- end
-
- def tk(klass, line, char, name, text)
- klass = RDoc::RubyToken.const_get "Tk#{klass.to_s.upcase}"
-
- token = if klass.instance_method(:initialize).arity == 2 then
- raise ArgumentError, "name not used for #{klass}" unless name.nil?
- klass.new line, char
- else
- klass.new line, char, name
- end
-
- token.set_text text
-
- token
- end
-
- def util_parser(content)
- @parser = RDoc::Parser::Ruby.new @top_level, @filename, content, @options,
- @stats
- end
-
- def util_two_parsers(first_file_content, second_file_content)
- util_parser first_file_content
-
- @parser2 = RDoc::Parser::Ruby.new @top_level2, @filename,
- second_file_content, @options, @stats
- end
-
- def util_toplevel
- RDoc::TopLevel.reset
- @top_level = RDoc::TopLevel.new @filename
- @top_level2 = RDoc::TopLevel.new @filename2
- end
-
-end
-
-MiniTest::Unit.autorun
diff --git a/test/rdoc/test_rdoc_ri_attribute_formatter.rb b/test/rdoc/test_rdoc_ri_attribute_formatter.rb
deleted file mode 100644
index a86312618b..0000000000
--- a/test/rdoc/test_rdoc_ri_attribute_formatter.rb
+++ /dev/null
@@ -1,44 +0,0 @@
-require 'stringio'
-require 'rubygems'
-require 'minitest/unit'
-require 'rdoc/ri/formatter'
-
-class TestRDocRIAttributeFormatter < MiniTest::Unit::TestCase
-
- def setup
- @output = StringIO.new
- @width = 78
- @indent = ' '
-
- @f = RDoc::RI::AttributeFormatter.new @output, @width, @indent
- end
-
- def test_wrap_empty
- @f.wrap ''
- assert_equal '', @output.string
- end
-
- def test_wrap_long
- @f.wrap 'a ' * (@width / 2)
- assert_equal " 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 a a a a a \n a \n",
- @output.string
- end
-
- def test_wrap_markup
- @f.wrap 'a <tt>b</tt> c'
- assert_equal " a b c\n", @output.string
- end
-
- def test_wrap_nil
- @f.wrap nil
- assert_equal '', @output.string
- end
-
- def test_wrap_short
- @f.wrap 'a b c'
- assert_equal " a b c\n", @output.string
- end
-
-end
-
-MiniTest::Unit.autorun
diff --git a/test/rdoc/test_rdoc_ri_default_display.rb b/test/rdoc/test_rdoc_ri_default_display.rb
deleted file mode 100644
index 1182b046c3..0000000000
--- a/test/rdoc/test_rdoc_ri_default_display.rb
+++ /dev/null
@@ -1,301 +0,0 @@
-require 'stringio'
-require 'rubygems'
-require 'minitest/unit'
-require 'rdoc/ri/formatter'
-require 'rdoc/ri/display'
-require 'rdoc/ri/driver'
-
-class TestRDocRiDefaultDisplay < MiniTest::Unit::TestCase
-
- def setup
- @output = StringIO.new
- @width = 78
- @indent = ' '
-
- @dd = RDoc::RI::DefaultDisplay.new RDoc::RI::Formatter, @width, true,
- @output
-
- @some_method = h \
- 'aliases' => [{'name' => 'some_method_alias'}],
- 'block_params' => 'block_param',
- 'comment' => [RDoc::Markup::Flow::P.new('some comment')],
- 'full_name' => 'SomeClass#some_method',
- 'is_singleton' => false,
- 'name' => 'some_method',
- 'params' => '(arg1, arg2) {|block_param| ...}',
- 'source_path' => '/nonexistent',
- 'visibility' => 'public'
- end
-
- def test_display_class_info
- klass = h \
- 'attributes' => [
- { 'name' => 'attribute', 'rw' => 'RW',
- 'comment' => [RDoc::Markup::Flow::P.new('attribute comment')] },
- { 'name' => 'attribute_no_comment', 'rw' => 'RW',
- 'comment' => nil },
- ],
- 'class_methods' => [
- { 'name' => 'class_method' },
- ],
- 'class_method_extensions' => [
- { 'name' => 'class_method_extension' },
- ],
- 'comment' => [RDoc::Markup::Flow::P.new('SomeClass comment')],
- 'constants' => [
- { 'name' => 'CONSTANT', 'value' => '"value1"',
- 'comment' => [RDoc::Markup::Flow::P.new('CONSTANT value')] },
- { 'name' => 'CONSTANT_NOCOMMENT', 'value' => '"value2"',
- 'comment' => nil },
- ],
- 'display_name' => 'Class',
- 'full_name' => 'SomeClass',
- 'includes' => [],
- 'instance_methods' => [
- { 'name' => 'instance_method' },
- { 'name' => 'instance_method2' },
- ],
- 'instance_method_extensions' => [
- { 'name' => 'instance_method_extension' },
- ],
- 'superclass' => 'Object'
-
- @dd.display_class_info klass
-
- expected = <<-EOF
----------------------------------------------------- Class: SomeClass < Object
- SomeClass comment
-
-------------------------------------------------------------------------------
-
-
-Constants:
-----------
-
- CONSTANT = "value1"
- CONSTANT value
-
- CONSTANT_NOCOMMENT = "value2"
-
-
-Attributes:
------------
-
- attribute (RW):
- attribute comment
-
- attribute_no_comment (RW)
-
-
-Class methods:
---------------
-
- class_method
-
-
-Class method extensions:
-------------------------
-
- class_method_extension
-
-
-Instance methods:
------------------
-
- instance_method, instance_method2
-
-
-Instance method extensions:
----------------------------
-
- instance_method_extension
- EOF
-
- assert_equal expected, @output.string
- end
-
- def test_display_flow
- flow = [RDoc::Markup::Flow::P.new('flow')]
-
- @dd.display_flow flow
-
- assert_equal " flow\n\n", @output.string
- end
-
- def test_display_flow_empty
- @dd.display_flow []
-
- assert_equal " [no description]\n", @output.string
- end
-
- def test_display_flow_nil
- @dd.display_flow nil
-
- assert_equal " [no description]\n", @output.string
- end
-
- def test_display_method_info
- @dd.display_method_info @some_method
-
- expected = <<-EOF
--------------------------------------------------------- SomeClass#some_method
- some_method(arg1, arg2) {|block_param| ...}
-
- From /nonexistent
-------------------------------------------------------------------------------
- some comment
-
-
- (also known as some_method_alias)
- EOF
-
- assert_equal expected, @output.string
- end
-
- def test_display_method_info_singleton
- method = RDoc::RI::Driver::OpenStructHash.new.update \
- 'aliases' => [],
- 'block_params' => nil,
- 'comment' => nil,
- 'full_name' => 'SomeClass::some_method',
- 'is_singleton' => true,
- 'name' => 'some_method',
- 'params' => '(arg1, arg2)',
- 'visibility' => 'public'
-
- @dd.display_method_info method
-
- expected = <<-EOF
-------------------------------------------------------- SomeClass::some_method
- SomeClass::some_method(arg1, arg2)
-
- From
-------------------------------------------------------------------------------
- [no description]
- EOF
-
- assert_equal expected, @output.string
- end
-
- def test_display_method_list
- methods = [
- RDoc::RI::Driver::OpenStructHash.new.update(
- "aliases" => [],
- "block_params" => nil,
- "comment" => nil,
- "full_name" => "SomeClass#some_method",
- "is_singleton" => false,
- "name" => "some_method",
- "params" => "()",
- "visibility" => "public"
- ),
- RDoc::RI::Driver::OpenStructHash.new.update(
- "aliases" => [],
- "block_params" => nil,
- "comment" => nil,
- "full_name" => "SomeClass#some_other_method",
- "is_singleton" => false,
- "name" => "some_other_method",
- "params" => "()",
- "visibility" => "public"
- ),
- ]
-
- @dd.display_method_list methods
-
- expected = <<-EOF
- More than one method matched your request. You can refine your search by
- asking for information on one of:
-
-SomeClass#some_method []
-SomeClass#some_other_method []
- EOF
-
- assert_equal expected, @output.string
- end
-
- def test_display_params
- @dd.display_params @some_method
-
- expected = <<-EOF
- some_method(arg1, arg2) {|block_param| ...}
-
- From /nonexistent
- EOF
-
- assert_equal expected, @output.string
- end
-
- def test_display_params_multiple
- @some_method['params'] = <<-EOF
-some_method(index)
-some_method(start, length)
- EOF
-
- @dd.display_params @some_method
-
- expected = <<-EOF
- some_method(index)
- some_method(start, length)
-
- From /nonexistent
- EOF
-
- assert_equal expected, @output.string
- end
-
- def test_display_params_singleton
- @some_method['is_singleton'] = true
- @some_method['full_name'] = 'SomeClass::some_method'
-
- @dd.display_params @some_method
-
- expected = <<-EOF
- SomeClass::some_method(arg1, arg2) {|block_param| ...}
-
- From /nonexistent
- EOF
-
- assert_equal expected, @output.string
- end
-
- def test_list_known_classes
- klasses = %w[SomeClass SomeModule]
-
- @dd.list_known_classes klasses
-
- expected = <<-EOF
----------------------------------------------------- Known classes and modules
-
- SomeClass, SomeModule
- EOF
-
- assert_equal expected, @output.string
- end
-
- def test_list_known_classes_empty
- @dd.list_known_classes []
-
- expected = <<-EOF
-No ri data found
-
-If you've installed Ruby yourself, you need to generate documentation using:
-
- make install-doc
-
-from the same place you ran `make` to build ruby.
-
-If you installed Ruby from a packaging system, then you may need to
-install an additional package, or ask the packager to enable ri generation.
- EOF
-
- assert_equal expected, @output.string
- end
-
- def h(hash)
- RDoc::RI::Driver::OpenStructHash.convert hash
- end
-
-end
-
-MiniTest::Unit.autorun
diff --git a/test/rdoc/test_rdoc_ri_driver.rb b/test/rdoc/test_rdoc_ri_driver.rb
deleted file mode 100644
index f160492057..0000000000
--- a/test/rdoc/test_rdoc_ri_driver.rb
+++ /dev/null
@@ -1,94 +0,0 @@
-require 'rubygems'
-require 'minitest/unit'
-require 'tmpdir'
-require 'rdoc/ri/driver'
-
-class TestRDocRIDriver < MiniTest::Unit::TestCase
-
- def setup
- @tmpdir = File.join Dir.tmpdir, "test_rdoc_ri_driver_#{$$}"
- @home_ri = File.join @tmpdir, 'dot_ri'
- @cache_dir = File.join @home_ri, 'cache'
- @class_cache = File.join @cache_dir, 'classes'
-
- FileUtils.mkdir_p @tmpdir
- FileUtils.mkdir_p @home_ri
- FileUtils.mkdir_p @cache_dir
-
- @driver = RDoc::RI::Driver.new(RDoc::RI::Driver.process_args([]))
- @driver.homepath = @home_ri
- end
-
- def teardown
- FileUtils.rm_rf @tmpdir
- end
-
- def test_lookup_method
- def @driver.load_cache_for(klassname)
- { 'Foo#bar' => :found }
- end
-
- assert @driver.lookup_method('Foo#bar', 'Foo')
- end
-
- def test_lookup_method_class_method
- def @driver.load_cache_for(klassname)
- { 'Foo::Bar' => :found }
- end
-
- assert @driver.lookup_method('Foo::Bar', 'Foo::Bar')
- end
-
- def test_lookup_method_class_missing
- def @driver.load_cache_for(klassname) end
-
- assert_nil @driver.lookup_method('Foo#bar', 'Foo')
- end
-
- def test_lookup_method_dot_instance
- def @driver.load_cache_for(klassname)
- { 'Foo#bar' => :instance, 'Foo::bar' => :klass }
- end
-
- assert_equal :instance, @driver.lookup_method('Foo.bar', 'Foo')
- end
-
- def test_lookup_method_dot_class
- def @driver.load_cache_for(klassname)
- { 'Foo::bar' => :found }
- end
-
- assert @driver.lookup_method('Foo.bar', 'Foo')
- end
-
- def test_lookup_method_method_missing
- def @driver.load_cache_for(klassname) {} end
-
- assert_nil @driver.lookup_method('Foo#bar', 'Foo')
- end
-
- def test_parse_name
- klass, meth = @driver.parse_name 'Foo::Bar'
-
- assert_equal 'Foo::Bar', klass, 'Foo::Bar class'
- assert_equal nil, meth, 'Foo::Bar method'
-
- klass, meth = @driver.parse_name 'Foo#Bar'
-
- assert_equal 'Foo', klass, 'Foo#Bar class'
- assert_equal 'Bar', meth, 'Foo#Bar method'
-
- klass, meth = @driver.parse_name 'Foo.Bar'
-
- assert_equal 'Foo', klass, 'Foo#Bar class'
- assert_equal 'Bar', meth, 'Foo#Bar method'
-
- klass, meth = @driver.parse_name 'Foo::bar'
-
- assert_equal 'Foo', klass, 'Foo::bar class'
- assert_equal 'bar', meth, 'Foo::bar method'
- end
-
-end
-
-MiniTest::Unit.autorun
diff --git a/test/rdoc/test_rdoc_ri_formatter.rb b/test/rdoc/test_rdoc_ri_formatter.rb
deleted file mode 100644
index a70f9dcba7..0000000000
--- a/test/rdoc/test_rdoc_ri_formatter.rb
+++ /dev/null
@@ -1,320 +0,0 @@
-require 'stringio'
-require 'rubygems'
-require 'minitest/unit'
-require 'rdoc/ri/formatter'
-require 'rdoc/markup/to_flow'
-
-class TestRDocRIFormatter < MiniTest::Unit::TestCase
-
- def setup
- @output = StringIO.new
- @width = 78
- @indent = ' '
-
- @f = RDoc::RI::Formatter.new @output, @width, @indent
- @markup = RDoc::Markup.new
- @flow = RDoc::Markup::ToFlow.new
- end
-
- def test_blankline
- @f.blankline
-
- assert_equal "\n", @output.string
- end
-
- def test_bold_print
- @f.bold_print 'a b c'
-
- assert_equal 'a b c', @output.string
- end
-
- def test_break_to_newline
- @f.break_to_newline
-
- assert_equal '', @output.string
- end
-
- def test_conv_html
- assert_equal '> < " &', @f.conv_html('&gt; &lt; &quot; &amp;')
- end
-
- def test_conv_markup
- text = '<tt>a</tt> <code>b</code> <b>c</b> <em>d</em>'
-
- expected = '+a+ +b+ *c* _d_'
-
- assert_equal expected, @f.conv_markup(text)
- end
-
- def test_display_flow
- flow = [
- RDoc::Markup::Flow::H.new(1, 'heading'),
- RDoc::Markup::Flow::P.new('paragraph'),
- ]
-
- @f.display_flow flow
-
- assert_equal "\nHEADING\n=======\n\n paragraph\n\n", @output.string
- end
-
- def test_display_flow_item_h
- item = RDoc::Markup::Flow::H.new 1, 'heading'
-
- @f.display_flow_item item
-
- assert_equal "\nHEADING\n=======\n\n", @output.string
- end
-
- def test_display_flow_item_li
- item = RDoc::Markup::Flow::LI.new nil, 'paragraph'
-
- @f.display_flow_item item
-
- assert_equal " paragraph\n\n", @output.string
- end
-
- def test_display_flow_item_list
- item = RDoc::Markup::Flow::LIST.new :NUMBER
-
- @f.display_flow_item item
-
- assert_equal "", @output.string
- end
-
- def test_display_flow_item_p
- item = RDoc::Markup::Flow::P.new 'paragraph'
-
- @f.display_flow_item item
-
- assert_equal " paragraph\n\n", @output.string
- end
-
- def test_display_flow_item_rule
- item = RDoc::Markup::Flow::RULE.new 1
-
- @f.display_flow_item item
-
- assert_equal "#{'-' * 78}\n", @output.string
- end
-
- def test_display_flow_item_unknown
- e = assert_raises RDoc::Error do
- @f.display_flow_item Object.new
- end
-
- assert_equal "Unknown flow element: Object", e.message
- end
-
- def test_display_flow_item_verb
- item = RDoc::Markup::Flow::VERB.new 'a b c'
-
- @f.display_flow_item item
-
- assert_equal " a b c\n\n", @output.string
- end
-
- def test_display_heading_1
- @f.display_heading 'heading', 1, ' '
-
- assert_equal "\nHEADING\n=======\n\n", @output.string
- end
-
- def test_display_heading_2
- @f.display_heading 'heading', 2, ' '
-
- assert_equal "\nheading\n-------\n\n", @output.string
- end
-
- def test_display_heading_3
- @f.display_heading 'heading', 3, ' '
-
- assert_equal " heading\n\n", @output.string
- end
-
- def test_display_list
- list = RDoc::Markup::Flow::LIST.new :NUMBER
- list << RDoc::Markup::Flow::LI.new(nil, 'a b c')
- list << RDoc::Markup::Flow::LI.new(nil, 'd e f')
-
- @f.display_list list
-
- assert_equal " 1. a b c\n\n 2. d e f\n\n", @output.string
- end
-
- def test_display_list_bullet
- list = RDoc::Markup::Flow::LIST.new :BULLET
- list << RDoc::Markup::Flow::LI.new(nil, 'a b c')
-
- @f.display_list list
-
- assert_equal " * a b c\n\n", @output.string
- end
-
- def test_display_list_labeled
- list = RDoc::Markup::Flow::LIST.new :LABELED
- list << RDoc::Markup::Flow::LI.new('label', 'a b c')
-
- @f.display_list list
-
- assert_equal " label a b c\n\n", @output.string
- end
-
- def test_display_list_lower_alpha
- list = RDoc::Markup::Flow::LIST.new :LOWERALPHA
- list << RDoc::Markup::Flow::LI.new(nil, 'a b c')
-
- @f.display_list list
-
- assert_equal " a. a b c\n\n", @output.string
- end
-
- def test_display_list_note
- list = RDoc::Markup::Flow::LIST.new :NOTE
- list << RDoc::Markup::Flow::LI.new('note:', 'a b c')
-
- @f.display_list list
-
- assert_equal " note: a b c\n\n", @output.string
- end
-
- def test_display_list_number
- list = RDoc::Markup::Flow::LIST.new :NUMBER
- list << RDoc::Markup::Flow::LI.new(nil, 'a b c')
-
- @f.display_list list
-
- assert_equal " 1. a b c\n\n", @output.string
- end
-
- def test_display_list_unknown
- list = RDoc::Markup::Flow::LIST.new :UNKNOWN
- list << RDoc::Markup::Flow::LI.new(nil, 'a b c')
-
- e = assert_raises ArgumentError do
- @f.display_list list
- end
-
- assert_equal 'unknown list type UNKNOWN', e.message
- end
-
- def test_display_list_upper_alpha
- list = RDoc::Markup::Flow::LIST.new :UPPERALPHA
- list << RDoc::Markup::Flow::LI.new(nil, 'a b c')
-
- @f.display_list list
-
- assert_equal " A. a b c\n\n", @output.string
- end
-
- def test_display_verbatim_flow_item
- verbatim = RDoc::Markup::Flow::VERB.new "a b c\nd e f"
-
- @f.display_verbatim_flow_item verbatim
-
- assert_equal " a b c\n d e f\n\n", @output.string
- end
-
- def test_display_verbatim_flow_item_bold
- verbatim = RDoc::Markup::Flow::VERB.new "*a* b c"
-
- @f.display_verbatim_flow_item verbatim
-
- assert_equal " *a* b c\n\n", @output.string
- end
-
- def test_draw_line
- @f.draw_line
-
- expected = '-' * @width + "\n"
- assert_equal expected, @output.string
- end
-
- def test_draw_line_label
- @f.draw_line 'label'
-
- expected = '-' * (@width - 6) + " label\n"
- assert_equal expected, @output.string
- end
-
- def test_draw_line_label_long
- @f.draw_line 'a' * @width
-
- expected = '-' * @width + "\n" + ('a' * @width) + "\n"
- assert_equal expected, @output.string
- end
-
- def test_raw_print_line
- @f.raw_print_line 'a b c'
-
- assert_equal "a b c", @output.string
- end
-
- def test_strip_attributes_b
- text = @f.strip_attributes 'hello <b>world</b>'
-
- expected = 'hello world'
-
- assert_equal expected, text
- end
-
- def test_strip_attributes_code
- text = @f.strip_attributes 'hello <code>world</code>'
-
- expected = 'hello world'
-
- assert_equal expected, text
- end
-
- def test_strip_attributes_em
- text = @f.strip_attributes 'hello <em>world</em>'
-
- expected = 'hello world'
-
- assert_equal expected, text
- end
-
- def test_strip_attributes_i
- text = @f.strip_attributes 'hello <i>world</i>'
-
- expected = 'hello world'
-
- assert_equal expected, text
- end
-
- def test_strip_attributes_tt
- text = @f.strip_attributes 'hello <tt>world</tt>'
-
- expected = 'hello world'
-
- assert_equal expected, text
- end
-
- def test_wrap_empty
- @f.wrap ''
- assert_equal '', @output.string
- end
-
- def test_wrap_long
- @f.wrap 'a ' * (@width / 2)
- assert_equal " 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 a a a a a\n a \n",
- @output.string
- end
-
- def test_wrap_markup
- @f.wrap 'a <tt>b</tt> c'
- assert_equal " a +b+ c\n", @output.string
- end
-
- def test_wrap_nil
- @f.wrap nil
- assert_equal '', @output.string
- end
-
- def test_wrap_short
- @f.wrap 'a b c'
- assert_equal " a b c\n", @output.string
- end
-
-end
-
-MiniTest::Unit.autorun
diff --git a/test/rdoc/test_rdoc_ri_overstrike_formatter.rb b/test/rdoc/test_rdoc_ri_overstrike_formatter.rb
deleted file mode 100644
index 38b95414dd..0000000000
--- a/test/rdoc/test_rdoc_ri_overstrike_formatter.rb
+++ /dev/null
@@ -1,71 +0,0 @@
-require 'stringio'
-require 'rubygems'
-require 'minitest/unit'
-require 'rdoc/ri/formatter'
-require 'rdoc/markup/fragments'
-require 'rdoc/markup/to_flow'
-
-class TestRDocRIOverstrikeFormatter < MiniTest::Unit::TestCase
-
- def setup
- @output = StringIO.new
- @width = 78
- @indent = ' '
-
- @f = RDoc::RI::OverstrikeFormatter.new @output, @width, @indent
- @markup = RDoc::Markup.new
- @flow = RDoc::Markup::ToFlow.new
-
- @af = RDoc::RI::AttributeFormatter
- end
-
- def test_display_verbatim_flow_item_bold
- verbatim = RDoc::Markup::Flow::VERB.new "*a* b c"
-
- @f.display_verbatim_flow_item verbatim
-
- assert_equal " *a* b c\n\n", @output.string
- end
-
- def test_write_attribute_text_bold
- line = [RDoc::RI::AttributeFormatter::AttrChar.new('b', @af::BOLD)]
-
- @f.write_attribute_text ' ', line
-
- assert_equal " b\bb\n", @output.string
- end
-
- def test_write_attribute_text_bold_italic
- attr = @af::BOLD | @af::ITALIC
- line = [RDoc::RI::AttributeFormatter::AttrChar.new('d', attr)]
-
- @f.write_attribute_text ' ', line
-
- assert_equal " _\bd\bd\n", @output.string
- end
-
- def test_write_attribute_text_code
- line = [RDoc::RI::AttributeFormatter::AttrChar.new('c', @af::CODE)]
-
- @f.write_attribute_text ' ', line
-
- assert_equal " _\bc\n", @output.string
- end
-
- def test_write_attribute_text_italic
- line = [RDoc::RI::AttributeFormatter::AttrChar.new('a', @af::ITALIC)]
-
- @f.write_attribute_text ' ', line
-
- assert_equal " _\ba\n", @output.string
- end
-
- def test_bold_print
- @f.bold_print 'a b c'
-
- assert_equal "a\ba \b b\bb \b c\bc", @output.string
- end
-
-end
-
-MiniTest::Unit.autorun
diff --git a/test/readline/test_readline.rb b/test/readline/test_readline.rb
index 5871f4c2bb..edc3aa09b9 100644
--- a/test/readline/test_readline.rb
+++ b/test/readline/test_readline.rb
@@ -1,286 +1,64 @@
begin
require "readline"
-=begin
- class << Readline
- [
- "line_buffer",
- "point",
- "set_screen_size",
- "get_screen_size",
- "vi_editing_mode",
- "emacs_editing_mode",
- "completion_append_character=",
- "completion_append_character",
- "basic_word_break_characters=",
- "basic_word_break_characters",
- "completer_word_break_characters=",
- "completer_word_break_characters",
- "basic_quote_characters=",
- "basic_quote_characters",
- "completer_quote_characters=",
- "completer_quote_characters",
- "filename_quote_characters=",
- "filename_quote_characters",
- "refresh_line",
- ].each do |method_name|
- define_method(method_name.to_sym) do |*args|
- raise NotImplementedError
- end
- end
- end
-=end
rescue LoadError
-else
- require "test/unit"
- require "tempfile"
end
-class TestReadline < Test::Unit::TestCase
- def teardown
- Readline.instance_variable_set("@completion_proc", nil)
- end
+if defined?(Readline) && !/EditLine/n.match(Readline::VERSION)
+
+require "test/unit"
+require "tempfile"
- def test_safe_level_4
- method_args =
- [
- ["readline"],
- ["input=", $stdin],
- ["output=", $stdout],
- ["completion_proc=", proc {}],
- ["completion_proc"],
- ["completion_case_fold=", true],
- ["completion_case_fold"],
- ["vi_editing_mode"],
- ["vi_editing_mode?"],
- ["emacs_editing_mode"],
- ["emacs_editing_mode?"],
- ["completion_append_character=", "s"],
- ["completion_append_character"],
- ["basic_word_break_characters=", "s"],
- ["basic_word_break_characters"],
- ["completer_word_break_characters=", "s"],
- ["completer_word_break_characters"],
- ["basic_quote_characters=", "\\"],
- ["basic_quote_characters"],
- ["completer_quote_characters=", "\\"],
- ["completer_quote_characters"],
- ["filename_quote_characters=", "\\"],
- ["filename_quote_characters"],
- ["line_buffer"],
- ["point"],
- ["set_screen_size", 1, 1],
- ["get_screen_size"],
- ]
- method_args.each do |method_name, *args|
- assert_raise(SecurityError, NotImplementedError,
- "method=<#{method_name}>") do
+class TestReadline < Test::Unit::TestCase
+ def test_readline
+ stdin = Tempfile.new("test_readline_stdin")
+ stdout = Tempfile.new("test_readline_stdout")
+ begin
+ stdin.write("hello\n")
+ stdin.close
+ stdout.close
+ line = replace_stdio(stdin.path, stdout.path) {
+ Readline.readline("> ", true)
+ }
+ assert_equal("hello", line)
+ assert_equal(true, line.tainted?)
+ stdout.open
+ assert_equal("> ", stdout.read(2))
+ assert_equal(1, Readline::HISTORY.length)
+ assert_equal("hello", Readline::HISTORY[0])
+ assert_raises(SecurityError) do
Thread.start {
- $SAFE = 4
- Readline.send(method_name.to_sym, *args)
- assert(true)
+ $SAFE = 1
+ replace_stdio(stdin.path, stdout.path) do
+ Readline.readline("> ".taint)
+ end
}.join
end
- end
- end
-
- if !/EditLine/n.match(Readline::VERSION)
- def test_readline
- stdin = Tempfile.new("test_readline_stdin")
- stdout = Tempfile.new("test_readline_stdout")
- begin
- stdin.write("hello\n")
- stdin.close
- stdout.close
- line = replace_stdio(stdin.path, stdout.path) {
- Readline.readline("> ", true)
- }
- assert_equal("hello", line)
- assert_equal(true, line.tainted?)
- stdout.open
- assert_equal("> ", stdout.read(2))
- assert_equal(1, Readline::HISTORY.length)
- assert_equal("hello", Readline::HISTORY[0])
- assert_raise(SecurityError) do
- Thread.start {
- $SAFE = 1
- replace_stdio(stdin.path, stdout.path) do
- Readline.readline("> ".taint)
- end
- }.join
- end
- assert_raise(SecurityError) do
- Thread.start {
- $SAFE = 4
- replace_stdio(stdin.path, stdout.path) { Readline.readline("> ") }
- }.join
- end
- ensure
- stdin.close(true)
- stdout.close(true)
- end
- end
-
- # line_buffer
- # point
- def test_line_buffer__point
- begin
- Readline.line_buffer
- Readline.point
- rescue NotImplementedError
- return
- end
-
- stdin = Tempfile.new("test_readline_stdin")
- stdout = Tempfile.new("test_readline_stdout")
- begin
- actual_text = nil
- actual_line_buffer = nil
- actual_point = nil
- Readline.completion_proc = proc { |text|
- actual_text = text
- actual_point = Readline.point
- actual_buffer_line = Readline.line_buffer
- stdin.write(" finish\n")
- stdin.close
- stdout.close
- return ["complete"]
- }
- stdin.write("first second\t")
- stdin.flush
- line = replace_stdio(stdin.path, stdout.path) {
- Readline.readline("> ", false)
- }
- assert_equal("first second", actual_line_buffer)
- assert_equal(12, actual_point)
- assert_equal("first complete finish", Readline.line_buffer)
- assert_equal(21, Readline.point)
- ensure
- stdin.close(true)
- stdout.close(true)
+ assert_raises(SecurityError) do
+ Thread.start {
+ $SAFE = 4
+ replace_stdio(stdin.path, stdout.path) { Readline.readline("> ") }
+ }.join
end
- end
- end
-
- def test_input=
- assert_raise(TypeError) do
- Readline.input = "This is not a file."
- end
- end
-
- def test_output=
- assert_raise(TypeError) do
- Readline.output = "This is not a file."
- end
- end
-
- def test_completion_proc
- expected = proc { |input| input }
- Readline.completion_proc = expected
- assert_equal(expected, Readline.completion_proc)
-
- assert_raise(ArgumentError) do
- Readline.completion_proc = "This does not have call method."
- end
- end
-
- def test_completion_case_fold
- expected = [true, false, "string", {"a" => "b"}]
- expected.each do |e|
- Readline.completion_case_fold = e
- assert_equal(e, Readline.completion_case_fold)
- end
- end
-
- def test_get_screen_size
- begin
- res = Readline.get_screen_size
- assert(res.is_a?(Array))
- rows, columns = *res
- assert(rows.is_a?(Integer))
- assert(rows >= 0)
- assert(columns.is_a?(Integer))
- assert(columns >= 0)
- rescue NotImplementedError
- end
- end
-
- # vi_editing_mode
- # emacs_editing_mode
- def test_editing_mode
- begin
- assert_equal(false, Readline.vi_editing_mode?)
- assert_equal(true, Readline.emacs_editing_mode?)
-
- assert_equal(nil, Readline.vi_editing_mode)
- assert_equal(true, Readline.vi_editing_mode?)
- assert_equal(false, Readline.emacs_editing_mode?)
- assert_equal(nil, Readline.vi_editing_mode)
- assert_equal(true, Readline.vi_editing_mode?)
- assert_equal(false, Readline.emacs_editing_mode?)
-
- assert_equal(nil, Readline.emacs_editing_mode)
- assert_equal(false, Readline.vi_editing_mode?)
- assert_equal(true, Readline.emacs_editing_mode?)
- assert_equal(nil, Readline.emacs_editing_mode)
- assert_equal(false, Readline.vi_editing_mode?)
- assert_equal(true, Readline.emacs_editing_mode?)
- rescue NotImplementedError
+ ensure
+ stdin.close(true)
+ stdout.close(true)
end
end
def test_completion_append_character
begin
- enc = get_default_internal_encoding
- data_expected = [
- ["x", "x"],
- ["xyx", "x"],
- [" ", " "],
- ["\t", "\t"],
- ]
- data_expected.each do |(data, expected)|
- Readline.completion_append_character = data
- assert_equal(expected, Readline.completion_append_character)
- assert_equal(enc, Readline.completion_append_character.encoding)
- end
+ Readline.completion_append_character = "x"
+ assert_equal("x", Readline.completion_append_character)
+ Readline.completion_append_character = "xyz"
+ assert_equal("x", Readline.completion_append_character)
+ Readline.completion_append_character = nil
+ assert_equal(nil, Readline.completion_append_character)
Readline.completion_append_character = ""
assert_equal(nil, Readline.completion_append_character)
rescue NotImplementedError
end
end
- # basic_word_break_characters
- # completer_word_break_characters
- # basic_quote_characters
- # completer_quote_characters
- # filename_quote_characters
- def test_some_characters_methods
- method_names = [
- "basic_word_break_characters",
- "completer_word_break_characters",
- "basic_quote_characters",
- "completer_quote_characters",
- "filename_quote_characters",
- ]
- method_names.each do |method_name|
- begin
- begin
- enc = get_default_internal_encoding
- saved = Readline.send(method_name.to_sym)
- expecteds = [" ", " .,|\t", ""]
- expecteds.each do |e|
- Readline.send((method_name + "=").to_sym, e)
- res = Readline.send(method_name.to_sym)
- assert_equal(e, res)
- assert_equal(enc, res.encoding)
- end
- ensure
- Readline.send((method_name + "=").to_sym, saved) if saved
- end
- rescue NotImplementedError
- end
- end
- end
-
private
def replace_stdio(stdin_path, stdout_path)
@@ -291,8 +69,6 @@ class TestReadline < Test::Unit::TestCase
STDIN.reopen(stdin)
STDOUT.reopen(stdout)
begin
- Readline.input = STDIN
- Readline.output = STDOUT
yield
ensure
STDIN.reopen(orig_stdin)
@@ -303,8 +79,6 @@ class TestReadline < Test::Unit::TestCase
}
}
end
+end
- def get_default_internal_encoding
- return Encoding.default_internal || Encoding.find("locale")
- end
-end if defined?(::Readline)
+end
diff --git a/test/readline/test_readline_history.rb b/test/readline/test_readline_history.rb
deleted file mode 100644
index a5d8c686da..0000000000
--- a/test/readline/test_readline_history.rb
+++ /dev/null
@@ -1,327 +0,0 @@
-begin
- require "readline"
-=begin
- class << Readline::HISTORY
- def []=(index, str)
- raise NotImplementedError
- end
-
- def pop
- raise NotImplementedError
- end
-
- def shift
- raise NotImplementedError
- end
-
- def delete_at(index)
- raise NotImplementedError
- end
- end
-=end
-
-=begin
- class << Readline::HISTORY
- def clear
- raise NotImplementedError
- end
- end
-=end
-rescue LoadError
-else
- require "test/unit"
-end
-
-class Readline::TestHistory < Test::Unit::TestCase
- include Readline
-
- def setup
- HISTORY.clear
- end
-
- def test_safe_level_4
- method_args =
- [
- ["[]", [0]],
- ["[]=", [0, "s"]],
- ["\<\<", ["s"]],
- ["push", ["s"]],
- ["pop", []],
- ["shift", []],
- ["length", []],
- ["delete_at", [0]],
- ["clear", []],
- ]
- method_args.each do |method_name, args|
- assert_raise(SecurityError, NotImplementedError,
- "method=<#{method_name}>") do
- Thread.start {
- $SAFE = 4
- HISTORY.send(method_name.to_sym, *args)
- assert(true)
- }.join
- end
- end
-
- assert_raise(SecurityError, NotImplementedError,
- "method=<each>") do
- Thread.start {
- $SAFE = 4
- HISTORY.each { |s|
- assert(true)
- }
- }.join
- end
- end
-
- def test_to_s
- expected = "HISTORY"
- assert_equal(expected, HISTORY.to_s)
- end
-
- def test_get
- lines = push_history(5)
- lines.each_with_index do |s, i|
- assert_external_string_equal(s, HISTORY[i])
- end
- end
-
- def test_get__negative
- lines = push_history(5)
- (1..5).each do |i|
- assert_equal(lines[-i], HISTORY[-i])
- end
- end
-
- def test_get__out_of_range
- lines = push_history(5)
- invalid_indexes = [5, 6, 100, -6, -7, -100]
- invalid_indexes.each do |i|
- assert_raise(IndexError, "i=<#{i}>") do
- HISTORY[i]
- end
- end
-
- invalid_indexes = [100_000_000_000_000_000_000,
- -100_000_000_000_000_000_000]
- invalid_indexes.each do |i|
- assert_raise(RangeError, "i=<#{i}>") do
- HISTORY[i]
- end
- end
- end
-
- def test_set
- begin
- lines = push_history(5)
- 5.times do |i|
- expected = "set: #{i}"
- HISTORY[i] = expected
- assert_external_string_equal(expected, HISTORY[i])
- end
- rescue NotImplementedError
- end
- end
-
- def test_set__out_of_range
- assert_raise(IndexError, NotImplementedError, "index=<0>") do
- HISTORY[0] = "set: 0"
- end
-
- lines = push_history(5)
- invalid_indexes = [5, 6, 100, -6, -7, -100]
- invalid_indexes.each do |i|
- assert_raise(IndexError, NotImplementedError, "index=<#{i}>") do
- HISTORY[i] = "set: #{i}"
- end
- end
-
- invalid_indexes = [100_000_000_000_000_000_000,
- -100_000_000_000_000_000_000]
- invalid_indexes.each do |i|
- assert_raise(RangeError, NotImplementedError, "index=<#{i}>") do
- HISTORY[i] = "set: #{i}"
- end
- end
- end
-
- def test_push
- 5.times do |i|
- s = i.to_s
- assert_equal(HISTORY, HISTORY.push(s))
- assert_external_string_equal(s, HISTORY[i])
- end
- assert_equal(5, HISTORY.length)
- end
-
- def test_push__operator
- 5.times do |i|
- s = i.to_s
- assert_equal(HISTORY, HISTORY << s)
- assert_external_string_equal(s, HISTORY[i])
- end
- assert_equal(5, HISTORY.length)
- end
-
- def test_push__plural
- assert_equal(HISTORY, HISTORY.push("0", "1", "2", "3", "4"))
- (0..4).each do |i|
- assert_external_string_equal(i.to_s, HISTORY[i])
- end
- assert_equal(5, HISTORY.length)
-
- assert_equal(HISTORY, HISTORY.push("5", "6", "7", "8", "9"))
- (5..9).each do |i|
- assert_external_string_equal(i.to_s, HISTORY[i])
- end
- assert_equal(10, HISTORY.length)
- end
-
- def test_pop
- begin
- assert_equal(nil, HISTORY.pop)
-
- lines = push_history(5)
- (1..5).each do |i|
- assert_external_string_equal(lines[-i], HISTORY.pop)
- assert_equal(lines.length - i, HISTORY.length)
- end
-
- assert_equal(nil, HISTORY.pop)
- rescue NotImplementedError
- end
- end
-
- def test_shift
- begin
- assert_equal(nil, HISTORY.shift)
-
- lines = push_history(5)
- (0..4).each do |i|
- assert_external_string_equal(lines[i], HISTORY.shift)
- assert_equal(lines.length - (i + 1), HISTORY.length)
- end
-
- assert_equal(nil, HISTORY.shift)
- rescue NotImplementedError
- end
- end
-
- def test_each
- e = HISTORY.each do |s|
- assert(false) # not reachable
- end
- assert_equal(HISTORY, e)
- lines = push_history(5)
- i = 0
- e = HISTORY.each do |s|
- assert_external_string_equal(HISTORY[i], s)
- assert_external_string_equal(lines[i], s)
- i += 1
- end
- assert_equal(HISTORY, e)
- end
-
- def test_each__enumerator
- e = HISTORY.each
- assert_instance_of(Enumerator, e)
- end
-
- def test_length
- assert_equal(0, HISTORY.length)
- push_history(1)
- assert_equal(1, HISTORY.length)
- push_history(4)
- assert_equal(5, HISTORY.length)
- HISTORY.clear
- assert_equal(0, HISTORY.length)
- end
-
- def test_empty_p
- 2.times do
- assert(HISTORY.empty?)
- HISTORY.push("s")
- assert_equal(false, HISTORY.empty?)
- HISTORY.clear
- assert(HISTORY.empty?)
- end
- end
-
- def test_delete_at
- begin
- lines = push_history(5)
- (0..4).each do |i|
- assert_external_string_equal(lines[i], HISTORY.delete_at(0))
- end
- assert(HISTORY.empty?)
-
- lines = push_history(5)
- (1..5).each do |i|
- assert_external_string_equal(lines[lines.length - i], HISTORY.delete_at(-1))
- end
- assert(HISTORY.empty?)
-
- lines = push_history(5)
- assert_external_string_equal(lines[0], HISTORY.delete_at(0))
- assert_external_string_equal(lines[4], HISTORY.delete_at(3))
- assert_external_string_equal(lines[1], HISTORY.delete_at(0))
- assert_external_string_equal(lines[3], HISTORY.delete_at(1))
- assert_external_string_equal(lines[2], HISTORY.delete_at(0))
- assert(HISTORY.empty?)
- rescue NotImplementedError
- end
- end
-
- def test_delete_at__out_of_range
- assert_raise(IndexError, NotImplementedError, "index=<0>") do
- HISTORY.delete_at(0)
- end
-
- lines = push_history(5)
- invalid_indexes = [5, 6, 100, -6, -7, -100]
- invalid_indexes.each do |i|
- assert_raise(IndexError, NotImplementedError, "index=<#{i}>") do
- HISTORY.delete_at(i)
- end
- end
-
- invalid_indexes = [100_000_000_000_000_000_000,
- -100_000_000_000_000_000_000]
- invalid_indexes.each do |i|
- assert_raise(RangeError, NotImplementedError, "index=<#{i}>") do
- HISTORY.delete_at(i)
- end
- end
- end
-
- private
-
- def push_history(num)
- lines = []
- num.times do |i|
- s = "a"
- i.times do
- s = s.succ
- end
- lines.push("#{i + 1}:#{s}")
- end
- HISTORY.push(*lines)
- return lines
- end
-
- def assert_external_string_equal(expected, actual)
- assert_equal(expected, actual)
- assert_equal(get_default_internal_encoding, actual.encoding)
- end
-
- def get_default_internal_encoding
- return Encoding.default_internal || Encoding.find("locale")
- end
-end if defined?(::Readline) && defined?(::Readline::HISTORY) &&
- (
- begin
- Readline::HISTORY.clear
- rescue NotImplementedError
- false
- end
- )
diff --git a/test/rinda/test_rinda.rb b/test/rinda/test_rinda.rb
index 0d94cf70da..056c699190 100644
--- a/test/rinda/test_rinda.rb
+++ b/test/rinda/test_rinda.rb
@@ -16,7 +16,7 @@ class MockClock
nil
end
end
-
+
def initialize
@now = 2
@reso = 1
@@ -32,7 +32,7 @@ class MockClock
def at(n)
n
end
-
+
def _forward(n=nil)
now ,= @ts.take([nil, :now])
@now = now + n
@@ -114,7 +114,7 @@ module TupleSpaceTestModule
end
th.value
end
-
+
def test_00_tuple
tuple = Rinda::TupleEntry.new([1,2,3])
assert(!tuple.canceled?)
@@ -149,7 +149,7 @@ module TupleSpaceTestModule
assert(!tmpl.match({"message"=>"Hi", "name"=>"Foo", "age"=>1}))
assert(!tmpl.match({"message"=>"Hello", "no_name"=>"Foo"}))
- assert_raise(Rinda::InvalidHashTupleKey) do
+ assert_raises(Rinda::InvalidHashTupleKey) do
tmpl = Rinda::Template.new({:message=>String, "name"=>String})
end
tmpl = Rinda::Template.new({"name"=>String})
@@ -182,7 +182,7 @@ module TupleSpaceTestModule
assert(!tmpl.match({"message"=>"Hi", "name"=>"Foo", "age"=>1}))
assert(!tmpl.match({"message"=>"Hello", "no_name"=>"Foo"}))
- assert_raise(Rinda::InvalidHashTupleKey) do
+ assert_raises(Rinda::InvalidHashTupleKey) do
@ts.write({:message=>String, "name"=>String})
end
@@ -193,7 +193,7 @@ module TupleSpaceTestModule
assert_equal({'1'=>1, '2'=>2, '3'=>3}, @ts.take({'1'=>1, '2'=>2, '3'=>3}))
entry = @ts.write(['1'=>1, '2'=>2, '3'=>3])
- assert_raise(Rinda::RequestExpiredError) do
+ assert_raises(Rinda::RequestExpiredError) do
assert_equal({'1'=>1, '2'=>2, '3'=>3}, @ts.read({'1'=>1}, 0))
end
entry.cancel
@@ -230,11 +230,11 @@ module TupleSpaceTestModule
end
def test_inp_rdp
- assert_raise(Rinda::RequestExpiredError) do
+ assert_raises(Rinda::RequestExpiredError) do
@ts.take([:empty], 0)
end
- assert_raise(Rinda::RequestExpiredError) do
+ assert_raises(Rinda::RequestExpiredError) do
@ts.read([:empty], 0)
end
end
@@ -242,13 +242,13 @@ module TupleSpaceTestModule
def test_ruby_talk_264062
th = Thread.new { @ts.take([:empty], 1) }
sleep(10)
- assert_raise(Rinda::RequestExpiredError) do
+ assert_raises(Rinda::RequestExpiredError) do
thread_join(th)
end
th = Thread.new { @ts.read([:empty], 1) }
sleep(10)
- assert_raise(Rinda::RequestExpiredError) do
+ assert_raises(Rinda::RequestExpiredError) do
thread_join(th)
end
end
@@ -283,7 +283,7 @@ module TupleSpaceTestModule
@ts.write([:ans, s])
s
end
-
+
assert_equal(10, thread_join(taker))
tuple = @ts.take([:ans, nil])
assert_equal(10, tuple[1])
@@ -314,7 +314,7 @@ module TupleSpaceTestModule
assert_equal(10, tuple[1])
assert_equal([], @ts.read_all([nil, nil]))
end
-
+
def test_core_03_notify
notify1 = @ts.notify(nil, [:req, Integer])
notify2 = @ts.notify(nil, [:ans, Integer], 8)
@@ -355,6 +355,7 @@ module TupleSpaceTestModule
lv = lv - 1
elsif ev == 'close'
result = [lv, n]
+ else
break
end
assert(lv >= 0)
@@ -417,25 +418,24 @@ module TupleSpaceTestModule
assert_equal([[:removeme, 1]], @ts.read_all([nil, nil]))
entry.cancel
assert_equal([], @ts.read_all([nil, nil]))
-
+
template = nil
taker = Thread.new do
- @ts.take([:take, nil], 10) do |t|
- template = t
+ @ts.take([:take, nil], 10) do |template|
Thread.new do
template.cancel
end
end
end
-
+
sleep(2)
- assert_raise(Rinda::RequestCanceledError) do
+ assert_raises(Rinda::RequestCanceledError) do
assert_nil(thread_join(taker))
end
assert(template.canceled?)
-
+
@ts.write([:take, 1])
assert_equal([[:take, 1]], @ts.read_all([nil, nil]))
@@ -449,8 +449,7 @@ module TupleSpaceTestModule
template = nil
reader = Thread.new do
- @ts.read([:take, nil], 10) do |t|
- template = t
+ @ts.read([:take, nil], 10) do |template|
Thread.new do
template.cancel
end
@@ -459,12 +458,12 @@ module TupleSpaceTestModule
sleep(2)
- assert_raise(Rinda::RequestCanceledError) do
+ assert_raises(Rinda::RequestCanceledError) do
assert_nil(thread_join(reader))
end
assert(template.canceled?)
-
+
@ts.write([:take, 1])
assert_equal([[:take, 1]], @ts.read_all([nil, nil]))
@@ -475,7 +474,7 @@ module TupleSpaceTestModule
@sec = sec
@n = n
end
-
+
def renew
return -1 if @n <= 0
@n -= 1
@@ -488,7 +487,7 @@ module TupleSpaceTestModule
assert(!tuple.canceled?)
assert(tuple.expired?)
assert(!tuple.alive?)
-
+
tuple = Rinda::TupleEntry.new([1,2,3], 1)
assert(!tuple.canceled?)
assert(!tuple.expired?)
diff --git a/test/rinda/test_tuplebag.rb b/test/rinda/test_tuplebag.rb
deleted file mode 100644
index 3e30127f0f..0000000000
--- a/test/rinda/test_tuplebag.rb
+++ /dev/null
@@ -1,172 +0,0 @@
-require 'test/unit'
-require 'rinda/tuplespace'
-
-class TestTupleBag < Test::Unit::TestCase
-
- def setup
- @tb = Rinda::TupleBag.new
- end
-
- def test_delete
- assert_nothing_raised do
- val = @tb.delete tup(:val, 1)
- assert_equal nil, val
- end
-
- t = tup(:val, 1)
- @tb.push t
-
- val = @tb.delete t
-
- assert_equal t, val
-
- assert_equal [], @tb.find_all(tem(:val, 1))
-
- t1 = tup(:val, 1)
- t2 = tup(:val, 1)
- @tb.push t1
- @tb.push t2
-
- val = @tb.delete t1
-
- assert_equal t1, val
-
- assert_equal [t2], @tb.find_all(tem(:val, 1))
- end
-
- def test_delete_unless_alive
- assert_equal [], @tb.delete_unless_alive
-
- t1 = tup(:val, nil)
- t2 = tup(:val, nil)
-
- @tb.push t1
- @tb.push t2
-
- assert_equal [], @tb.delete_unless_alive
-
- t1.cancel
-
- assert_equal [t1], @tb.delete_unless_alive, 'canceled'
-
- t2.renew Object.new
-
- assert_equal [t2], @tb.delete_unless_alive, 'expired'
- end
-
- def test_find
- template = tem(:val, nil)
-
- assert_equal nil, @tb.find(template)
-
- t1 = tup(:other, 1)
- @tb.push t1
-
- assert_equal nil, @tb.find(template)
-
- t2 = tup(:val, 1)
- @tb.push t2
-
- assert_equal t2, @tb.find(template)
-
- t2.cancel
-
- assert_equal nil, @tb.find(template), 'canceled'
-
- t3 = tup(:val, 3)
- @tb.push t3
-
- assert_equal t3, @tb.find(template)
-
- t3.renew Object.new
-
- assert_equal nil, @tb.find(template), 'expired'
- end
-
- def test_find_all
- template = tem(:val, nil)
-
- t1 = tup(:other, 1)
- @tb.push t1
-
- assert_equal [], @tb.find_all(template)
-
- t2 = tup(:val, 2)
- t3 = tup(:val, 3)
-
- @tb.push t2
- @tb.push t3
-
- assert_equal [t2, t3], @tb.find_all(template)
-
- t2.cancel
-
- assert_equal [t3], @tb.find_all(template), 'canceled'
-
- t3.renew Object.new
-
- assert_equal [], @tb.find_all(template), 'expired'
- end
-
- def test_find_all_template
- tuple = tup(:val, 1)
-
- t1 = tem(:other, nil)
- @tb.push t1
-
- assert_equal [], @tb.find_all_template(tuple)
-
- t2 = tem(:val, nil)
- t3 = tem(:val, nil)
-
- @tb.push t2
- @tb.push t3
-
- assert_equal [t2, t3], @tb.find_all_template(tuple)
-
- t2.cancel
-
- assert_equal [t3], @tb.find_all_template(tuple), 'canceled'
-
- t3.renew Object.new
-
- assert_equal [], @tb.find_all_template(tuple), 'expired'
- end
-
- def test_has_expires_eh
- assert !@tb.has_expires?
-
- t = tup(:val, 1)
- @tb.push t
-
- assert @tb.has_expires?
-
- t.renew Object.new
-
- assert !@tb.has_expires?
- end
-
- def test_push
- t = tup(:val, 1)
-
- @tb.push t
-
- assert_equal t, @tb.find(tem(:val, 1))
- end
-
- ##
- # Create a tuple with +ary+ for its contents
-
- def tup(*ary)
- Rinda::TupleEntry.new ary
- end
-
- ##
- # Create a template with +ary+ for its contents
-
- def tem(*ary)
- Rinda::TemplateEntry.new ary
- end
-
-end
-
diff --git a/test/ripper/dummyparser.rb b/test/ripper/dummyparser.rb
deleted file mode 100644
index 483ac0d013..0000000000
--- a/test/ripper/dummyparser.rb
+++ /dev/null
@@ -1,571 +0,0 @@
-#
-# dummyparser.rb
-#
-
-require 'ripper'
-
-class Node
- def initialize(name, *nodes)
- @name = name
- @children = nodes
- end
-
- attr_reader :children
-
- def to_s
- "#{@name}(#{@children.map {|n| n.to_s }.join(',')})"
- end
-end
-
-class NodeList
- def initialize
- @list = []
- end
-
- attr_reader :list
-
- def push(item)
- @list.push item
- self
- end
-
- def prepend(items)
- @list.unshift items
- end
-
- def to_s
- '[' + @list.join(',') + ']'
- end
-end
-
-class DummyParser < Ripper
-
- def on_program(stmts)
- $thru_program = true
- stmts
- end
-
- def on_stmts_new
- NodeList.new
- end
-
- def on_stmts_add(stmts, st)
- stmts.push st
- stmts
- end
-
- def on_void_stmt
- Node.new('void')
- end
-
- def on_BEGIN(stmts)
- Node.new('BEGIN', stmts)
- end
-
- def on_END(stmts)
- Node.new('END', stmts)
- end
-
- def on_var_ref(name)
- Node.new('ref', name)
- end
-
- def on_alias(a, b)
- Node.new('alias', a, b)
- end
-
- def on_var_alias(a, b)
- Node.new('valias', a, b)
- end
-
- def on_alias_error(a)
- Node.new('aliaserr', a)
- end
-
- def on_aref(a, b)
- Node.new('aref', a, b)
- end
-
- def on_aref_field(a, b)
- Node.new('aref_field', a, b)
- end
-
- def on_arg_ambiguous
- Node.new('arg_ambiguous')
- end
-
- def on_arg_paren(args)
- args
- end
-
- def on_args_new
- NodeList.new
- end
-
- def on_args_add(list, arg)
- list.push(arg)
- end
-
- def on_args_add_block(list, blk)
- if blk
- list.push('&' + blk.to_s)
- else
- list
- end
- end
-
- def on_args_add_star(list, arg)
- list.push('*' + arg.to_s)
- end
-
- def on_args_prepend(list, args)
- list.prepend args
- list
- end
-
- def on_method_add_arg(m, arg)
- if arg == nil
- arg = on_args_new
- end
- m.children.push arg
- m
- end
-
- def on_method_add_block(m, b)
- on_args_add_block(m.children, b)
- m
- end
-
- def on_assoc_new(a, b)
- Node.new('assoc', a, b)
- end
-
- def on_bare_assoc_hash(assoc_list)
- Node.new('assocs', *assoc_list)
- end
-
- def on_assoclist_from_args(a)
- Node.new('assocs', *a.list)
- end
-
- ######## untested
-
- def on_array(a)
- Node.new('array', a)
- end
-
- def on_assign(a, b)
- Node.new('assign', a, b)
- end
-
- def on_assign_error(a)
- Node.new('assign_error', a)
- end
-
- def on_begin(a)
- Node.new('begin', a)
- end
-
- def on_binary(a, b, c)
- Node.new('binary', a, b, c)
- end
-
- def on_block_var(a)
- Node.new('block_var', a)
- end
-
- def on_bodystmt(a, b, c, d)
- Node.new('bodystmt', a, b, c, d)
- end
-
- def on_brace_block(a, b)
- Node.new('brace_block', a, b)
- end
-
- def on_break(a)
- Node.new('break', a)
- end
-
- def on_call(a, b, c)
- Node.new('call', a, b, c)
- end
-
- def on_case(a, b)
- Node.new('case', a, b)
- end
-
- def on_class(a, b, c)
- Node.new('class', a, b, c)
- end
-
- def on_class_name_error(a)
- Node.new('class_name_error', a)
- end
-
- def on_command(a, b)
- Node.new('command', a, b)
- end
-
- def on_command_call(a, b, c, d)
- Node.new('command_call', a, b, c, d)
- end
-
- def on_const_ref(a)
- Node.new('const_ref', a)
- end
-
- def on_constpath_field(a, b)
- Node.new('constpath_field', a, b)
- end
-
- def on_constpath_ref(a, b)
- Node.new('constpath_ref', a, b)
- end
-
- def on_def(a, b, c)
- Node.new('def', a, b, c)
- end
-
- def on_defined(a)
- Node.new('defined', a)
- end
-
- def on_defs(a, b, c, d, e)
- Node.new('defs', a, b, c, d, e)
- end
-
- def on_do_block(a, b)
- Node.new('do_block', a, b)
- end
-
- def on_dot2(a, b)
- Node.new('dot2', a, b)
- end
-
- def on_dot3(a, b)
- Node.new('dot3', a, b)
- end
-
- def on_dyna_symbol(a)
- Node.new('dyna_symbol', a)
- end
-
- def on_else(a)
- Node.new('else', a)
- end
-
- def on_elsif(a, b, c)
- Node.new('elsif', a, b, c)
- end
-
- def on_ensure(a)
- Node.new('ensure', a)
- end
-
- def on_fcall(a)
- Node.new('fcall', a)
- end
-
- def on_field(a, b, c)
- Node.new('field', a, b, c)
- end
-
- def on_for(a, b, c)
- Node.new('for', a, b, c)
- end
-
- def on_hash(a)
- Node.new('hash', a)
- end
-
- def on_if(a, b, c)
- Node.new('if', a, b, c)
- end
-
- def on_if_mod(a, b)
- Node.new('if_mod', a, b)
- end
-
- def on_ifop(a, b, c)
- Node.new('ifop', a, b, c)
- end
-
- def on_iter_block(a, b)
- Node.new('iter_block', a, b)
- end
-
- def on_massign(a, b)
- Node.new('massign', a, b)
- end
-
- def on_mlhs_add(a, b)
- Node.new('mlhs_add', a, b)
- end
-
- def on_mlhs_add_star(a, b)
- Node.new('mlhs_add_star', a, b)
- end
-
- def on_mlhs_new
- Node.new('mlhs_new')
- end
-
- def on_mlhs_paren(a)
- Node.new('mlhs_paren', a)
- end
-
- def on_module(a, b)
- Node.new('module', a, b)
- end
-
- def on_mrhs_add(a, b)
- Node.new('mrhs_add', a, b)
- end
-
- def on_mrhs_add_star(a, b)
- Node.new('mrhs_add_star', a, b)
- end
-
- def on_mrhs_new
- Node.new('mrhs_new')
- end
-
- def on_mrhs_new_from_arglist(a)
- Node.new('mrhs_new_from_arglist', a)
- end
-
- def on_next(a)
- Node.new('next', a)
- end
-
- def on_opassign(a, b, c)
- Node.new('opassign', a, b, c)
- end
-
- def on_param_error(a)
- Node.new('param_error', a)
- end
-
- def on_params(a, b, c, d)
- Node.new('params', a, b, c, d)
- end
-
- def on_paren(a)
- Node.new('paren', a)
- end
-
- def on_parse_error(a)
- Node.new('parse_error', a)
- end
-
- def on_qwords_add(a, b)
- Node.new('qwords_add', a, b)
- end
-
- def on_qwords_new
- Node.new('qwords_new')
- end
-
- def on_redo
- Node.new('redo')
- end
-
- def on_regexp_literal(a)
- Node.new('regexp_literal', a)
- end
-
- def on_rescue(a, b, c, d)
- Node.new('rescue', a, b, c, d)
- end
-
- def on_rescue_mod(a, b)
- Node.new('rescue_mod', a, b)
- end
-
- def on_restparam(a)
- Node.new('restparam', a)
- end
-
- def on_retry
- Node.new('retry')
- end
-
- def on_return(a)
- Node.new('return', a)
- end
-
- def on_return0
- Node.new('return0')
- end
-
- def on_sclass(a, b)
- Node.new('sclass', a, b)
- end
-
- def on_sp(a)
- Node.new('space', a)
- end
-
- def on_string_add(a, b)
- Node.new('string_add', a, b)
- end
-
- def on_string_concat(a, b)
- Node.new('string_concat', a, b)
- end
-
- def on_string_content
- Node.new('string_content')
- end
-
- def on_string_dvar(a)
- Node.new('string_dvar', a)
- end
-
- def on_string_embexpr(a)
- Node.new('string_embexpr', a)
- end
-
- def on_string_literal(a)
- Node.new('string_literal', a)
- end
-
- def on_super(a)
- Node.new('super', a)
- end
-
- def on_symbol(a)
- Node.new('symbol', a)
- end
-
- def on_symbol_literal(a)
- Node.new('symbol_literal', a)
- end
-
- def on_topconst_field(a)
- Node.new('topconst_field', a)
- end
-
- def on_topconst_ref(a)
- Node.new('topconst_ref', a)
- end
-
- def on_unary(a, b)
- Node.new('unary', a, b)
- end
-
- def on_undef(a)
- Node.new('undef', a)
- end
-
- def on_unless(a, b, c)
- Node.new('unless', a, b, c)
- end
-
- def on_unless_mod(a, b)
- Node.new('unless_mod', a, b)
- end
-
- def on_until_mod(a, b)
- Node.new('until_mod', a, b)
- end
-
- def on_var_field(a)
- Node.new('var_field', a)
- end
-
- def on_when(a, b, c)
- Node.new('when', a, b, c)
- end
-
- def on_while(a, b)
- Node.new('while', a, b)
- end
-
- def on_while_mod(a, b)
- Node.new('while_mod', a, b)
- end
-
- def on_word_add(a, b)
- Node.new('word_add', a, b)
- end
-
- def on_word_new
- Node.new('word_new')
- end
-
- def on_words_add(a, b)
- Node.new('words_add', a, b)
- end
-
- def on_words_new
- Node.new('words_new')
- end
-
- def on_xstring_add(a, b)
- Node.new('xstring_add', a, b)
- end
-
- def on_xstring_literal(a)
- Node.new('xstring_literal', a)
- end
-
- def on_xstring_new
- Node.new('xstring_new')
- end
-
- def on_yield(a)
- Node.new('yield', a)
- end
-
- def on_yield0
- Node.new('yield0')
- end
-
- def on_zsuper
- Node.new('zsuper')
- end
-
- def on_backref(a)
- a
- end
- def on_comma(a)
- a
- end
- def on_gvar(a)
- a
- end
- def on_ident(a)
- a
- end
- def on_int(a)
- a
- end
- def on_kw(a)
- a
- end
- def on_lbrace(a)
- a
- end
- def on_rbrace(a)
- a
- end
- def on_lbracket(a)
- a
- end
- def on_rbracket(a)
- a
- end
- def on_lparen(a)
- a
- end
- def on_rparen(a)
- a
- end
- def on_op(a)
- a
- end
- def on_semicolon(a)
- a
- end
-end
diff --git a/test/ripper/test_files.rb b/test/ripper/test_files.rb
deleted file mode 100644
index f30ee8ad2a..0000000000
--- a/test/ripper/test_files.rb
+++ /dev/null
@@ -1,28 +0,0 @@
-begin
-
-require 'ripper'
-require 'find'
-require 'test/unit'
-
-class TestRipper_Generic < Test::Unit::TestCase
- SRCDIR = File.dirname(File.dirname(File.dirname(File.expand_path(__FILE__))))
-
- class Parser < Ripper
- PARSER_EVENTS.each {|n| eval "def on_#{n}(*args) r = [:#{n}, *args]; r.inspect; Object.new end" }
- SCANNER_EVENTS.each {|n| eval "def on_#{n}(*args) r = [:#{n}, *args]; r.inspect; Object.new end" }
- end
-
- TEST_RATIO = 0.05
-
- def test_parse_files
- Find.find("#{SRCDIR}/lib", "#{SRCDIR}/ext", "#{SRCDIR}/sample", "#{SRCDIR}/test") {|n|
- next if /\.rb\z/ !~ n || !File.file?(n)
- next if TEST_RATIO < rand
- assert_nothing_raised("ripper failed to parse: #{n.inspect}") { Parser.new(File.read(n)).parse }
- }
- end
-end
-
-rescue LoadError
-end
-
diff --git a/test/ripper/test_filter.rb b/test/ripper/test_filter.rb
deleted file mode 100644
index 4e9ee88dd8..0000000000
--- a/test/ripper/test_filter.rb
+++ /dev/null
@@ -1,54 +0,0 @@
-begin
-
-require 'ripper'
-require 'test/unit'
-
-class TestRipper_Filter < Test::Unit::TestCase
-
- class Filter < Ripper::Filter
- def on_default(event, token, data)
- if data.empty?
- data[:filename] = filename rescue nil
- data[:lineno] = lineno
- data[:column] = column
- data[:token] = token
- end
- data
- end
- end
-
- def filename
- File.expand_path(__FILE__)
- end
-
- def test_filter_filename
- data = {}
- Filter.new(File.read(filename)).parse(data)
- assert_equal('-', data[:filename], "[ruby-dev:37856]")
-
- data = {}
- Filter.new(File.read(filename), filename).parse(data)
- assert_equal(filename, data[:filename])
- end
-
- def test_filter_lineno
- data = {}
- Filter.new(File.read(filename)).parse(data)
- assert_equal(1, data[:lineno])
- end
-
- def test_filter_column
- data = {}
- Filter.new(File.read(filename)).parse(data)
- assert_equal(0, data[:column])
- end
-
- def test_filter_token
- data = {}
- Filter.new(File.read(filename)).parse(data)
- assert_equal("begin", data[:token])
- end
-end
-
-rescue LoadError
-end
diff --git a/test/ripper/test_parser_events.rb b/test/ripper/test_parser_events.rb
deleted file mode 100644
index fa640a37ec..0000000000
--- a/test/ripper/test_parser_events.rb
+++ /dev/null
@@ -1,498 +0,0 @@
-begin
-
-require 'dummyparser'
-require 'test/unit'
-
-class TestRipper_ParserEvents < Test::Unit::TestCase
-
- # should be enabled
-=begin
- def test_event_coverage
- dispatched = Ripper::PARSER_EVENTS.map {|event,*| event }
- dispatched.each do |e|
- assert_equal true, respond_to?("test_#{e}", true),
- "event not tested: #{e.inspect}"
- end
- end
-=end
-
- def parse(str)
- DummyParser.new(str).parse.to_s
- end
-
- $thru_program = false
-
- def test_program
- assert_equal '[void()]', parse('')
- assert_equal true, $thru_program
- end
-
- def test_stmts_new
- assert_equal '[void()]', parse('')
- end
-
- def test_stmts_add
- assert_equal '[ref(nil)]', parse('nil')
- assert_equal '[ref(nil),ref(nil)]', parse('nil;nil')
- assert_equal '[ref(nil),ref(nil),ref(nil)]', parse('nil;nil;nil')
- end
-
- def test_void_stmt
- assert_equal '[void()]', parse('')
- assert_equal '[void()]', parse('; ;')
- end
-
- def test_var_ref
- assert_equal '[ref(a)]', parse('a')
- assert_equal '[ref(nil)]', parse('nil')
- assert_equal '[ref(true)]', parse('true')
- end
-
- def test_BEGIN
- assert_equal '[BEGIN([void()])]', parse('BEGIN{}')
- assert_equal '[BEGIN([ref(nil)])]', parse('BEGIN{nil}')
- end
-
- def test_END
- assert_equal '[END([void()])]', parse('END{}')
- assert_equal '[END([ref(nil)])]', parse('END{nil}')
- end
-
- def test_alias
- assert_equal '[alias(symbol_literal(a),symbol_literal(b))]', parse('alias a b')
- end
-
- def test_var_alias
- assert_equal '[valias($a,$g)]', parse('alias $a $g')
- end
-
- def test_alias_error
- assert_equal '[aliaserr(valias($a,$1))]', parse('alias $a $1')
- end
-
- def test_arglist
- assert_equal '[fcall(m,[])]', parse('m()')
- assert_equal '[fcall(m,[1])]', parse('m(1)')
- assert_equal '[fcall(m,[1,2])]', parse('m(1,2)')
- assert_equal '[fcall(m,[*ref(r)])]', parse('m(*r)')
- assert_equal '[fcall(m,[1,*ref(r)])]', parse('m(1,*r)')
- assert_equal '[fcall(m,[1,2,*ref(r)])]', parse('m(1,2,*r)')
- assert_equal '[fcall(m,[&ref(r)])]', parse('m(&r)')
- assert_equal '[fcall(m,[1,&ref(r)])]', parse('m(1,&r)')
- assert_equal '[fcall(m,[1,2,&ref(r)])]', parse('m(1,2,&r)')
- assert_equal '[fcall(m,[*ref(a),&ref(b)])]', parse('m(*a,&b)')
- assert_equal '[fcall(m,[1,*ref(a),&ref(b)])]', parse('m(1,*a,&b)')
- assert_equal '[fcall(m,[1,2,*ref(a),&ref(b)])]', parse('m(1,2,*a,&b)')
- end
-
- def test_arg_paren
- # FIXME
- end
-
- def test_aref
- assert_equal '[aref(ref(v),[1])]', parse('v[1]')
- assert_equal '[aref(ref(v),[1,2])]', parse('v[1,2]')
- end
-
- def test_assocs
- assert_equal '[fcall(m,[assocs(assoc(1,2))])]', parse('m(1=>2)')
- assert_equal '[fcall(m,[assocs(assoc(1,2),assoc(3,4))])]', parse('m(1=>2,3=>4)')
- assert_equal '[fcall(m,[3,assocs(assoc(1,2))])]', parse('m(3,1=>2)')
- end
-
- def test_aref_field
- assert_equal '[assign(aref_field(ref(a),[1]),2)]', parse('a[1]=2')
- end
-
-=begin
- def test_arg_ambiguous
- assert_equal true, $thru__arg_ambiguous
- end
-=end
-
- def test_array # array literal
- assert_equal '[array([1,2,3])]', parse('[1,2,3]')
- end
-
- def test_assign # generic assignment
- assert_equal '[assign(var_field(v),1)]', parse('v=1')
- end
-
-=begin
- def test_assign_error
- assert_equal true, $thru__assign_error
- end
-
- def test_begin
- assert_equal true, $thru__begin
- end
-
- def test_binary
- assert_equal true, $thru__binary
- end
-
- def test_block_var
- assert_equal true, $thru__block_var
- end
-
- def test_bodystmt
- assert_equal true, $thru__bodystmt
- end
-
- def test_brace_block
- assert_equal true, $thru__brace_block
- end
-
- def test_break
- assert_equal true, $thru__break
- end
-
- def test_call
- assert_equal true, $thru__call
- end
-
- def test_case
- assert_equal true, $thru__case
- end
-
- def test_class
- assert_equal true, $thru__class
- end
-
- def test_class_name_error
- assert_equal true, $thru__class_name_error
- end
-
- def test_command
- assert_equal true, $thru__command
- end
-
- def test_command_call
- assert_equal true, $thru__command_call
- end
-
- def test_const_ref
- assert_equal true, $thru__const_ref
- end
-
- def test_constpath_field
- assert_equal true, $thru__constpath_field
- end
-
- def test_constpath_ref
- assert_equal true, $thru__constpath_ref
- end
-
- def test_def
- assert_equal true, $thru__def
- end
-
- def test_defined
- assert_equal true, $thru__defined
- end
-
- def test_defs
- assert_equal true, $thru__defs
- end
-
- def test_do_block
- assert_equal true, $thru__do_block
- end
-
- def test_dot2
- assert_equal true, $thru__dot2
- end
-
- def test_dot3
- assert_equal true, $thru__dot3
- end
-
- def test_dyna_symbol
- assert_equal true, $thru__dyna_symbol
- end
-
- def test_else
- assert_equal true, $thru__else
- end
-
- def test_elsif
- assert_equal true, $thru__elsif
- end
-
- def test_ensure
- assert_equal true, $thru__ensure
- end
-
- def test_fcall
- assert_equal true, $thru__fcall
- end
-
- def test_field
- assert_equal true, $thru__field
- end
-
- def test_for
- assert_equal true, $thru__for
- end
-
- def test_hash
- assert_equal true, $thru__hash
- end
-
- def test_if
- assert_equal true, $thru__if
- end
-
- def test_if_mod
- assert_equal true, $thru__if_mod
- end
-
- def test_ifop
- assert_equal true, $thru__ifop
- end
-
- def test_iter_block
- assert_equal true, $thru__iter_block
- end
-
- def test_massign
- assert_equal true, $thru__massign
- end
-
- def test_method_add_arg
- assert_equal true, $thru__method_add_arg
- end
-
- def test_mlhs_add
- assert_equal true, $thru__mlhs_add
- end
-
- def test_mlhs_add_star
- assert_equal true, $thru__mlhs_add_star
- end
-
- def test_mlhs_new
- assert_equal true, $thru__mlhs_new
- end
-
- def test_mlhs_paren
- assert_equal true, $thru__mlhs_paren
- end
-
- def test_module
- assert_equal true, $thru__module
- end
-
- def test_mrhs_add
- assert_equal true, $thru__mrhs_add
- end
-
- def test_mrhs_add_star
- assert_equal true, $thru__mrhs_add_star
- end
-
- def test_mrhs_new
- assert_equal true, $thru__mrhs_new
- end
-
- def test_mrhs_new_from_arglist
- assert_equal true, $thru__mrhs_new_from_arglist
- end
-
- def test_next
- assert_equal true, $thru__next
- end
-
- def test_opassign
- assert_equal true, $thru__opassign
- end
-
- def test_param_error
- assert_equal true, $thru__param_error
- end
-
- def test_params
- assert_equal true, $thru__params
- end
-
- def test_paren
- assert_equal true, $thru__paren
- end
-
- def test_parse_error
- assert_equal true, $thru__parse_error
- end
-
- def test_qwords_add
- assert_equal true, $thru__qwords_add
- end
-
- def test_qwords_new
- assert_equal true, $thru__qwords_new
- end
-
- def test_redo
- assert_equal true, $thru__redo
- end
-
- def test_regexp_literal
- assert_equal true, $thru__regexp_literal
- end
-
- def test_rescue
- assert_equal true, $thru__rescue
- end
-
- def test_rescue_mod
- assert_equal true, $thru__rescue_mod
- end
-
- def test_restparam
- assert_equal true, $thru__restparam
- end
-
- def test_retry
- assert_equal true, $thru__retry
- end
-
- def test_return
- assert_equal true, $thru__return
- end
-
- def test_return0
- assert_equal true, $thru__return0
- end
-
- def test_sclass
- assert_equal true, $thru__sclass
- end
-
- def test_space
- assert_equal true, $thru__space
- end
-
- def test_string_add
- assert_equal true, $thru__string_add
- end
-
- def test_string_concat
- assert_equal true, $thru__string_concat
- end
-
- def test_string_content
- assert_equal true, $thru__string_content
- end
-
- def test_string_dvar
- assert_equal true, $thru__string_dvar
- end
-
- def test_string_embexpr
- assert_equal true, $thru__string_embexpr
- end
-
- def test_string_literal
- assert_equal true, $thru__string_literal
- end
-
- def test_super
- assert_equal true, $thru__super
- end
-
- def test_symbol
- assert_equal true, $thru__symbol
- end
-
- def test_symbol_literal
- assert_equal true, $thru__symbol_literal
- end
-
- def test_topconst_field
- assert_equal true, $thru__topconst_field
- end
-
- def test_topconst_ref
- assert_equal true, $thru__topconst_ref
- end
-
- def test_unary
- assert_equal true, $thru__unary
- end
-
- def test_undef
- assert_equal true, $thru__undef
- end
-
- def test_unless
- assert_equal true, $thru__unless
- end
-
- def test_unless_mod
- assert_equal true, $thru__unless_mod
- end
-
- def test_until_mod
- assert_equal true, $thru__until_mod
- end
-
- def test_var_field
- assert_equal true, $thru__var_field
- end
-
- def test_when
- assert_equal true, $thru__when
- end
-
- def test_while
- assert_equal true, $thru__while
- end
-
- def test_while_mod
- assert_equal true, $thru__while_mod
- end
-
- def test_word_add
- assert_equal true, $thru__word_add
- end
-
- def test_word_new
- assert_equal true, $thru__word_new
- end
-
- def test_words_add
- assert_equal true, $thru__words_add
- end
-
- def test_words_new
- assert_equal true, $thru__words_new
- end
-
- def test_xstring_add
- assert_equal true, $thru__xstring_add
- end
-
- def test_xstring_literal
- assert_equal true, $thru__xstring_literal
- end
-
- def test_xstring_new
- assert_equal true, $thru__xstring_new
- end
-
- def test_yield
- assert_equal true, $thru__yield
- end
-
- def test_yield0
- assert_equal true, $thru__yield0
- end
-
- def test_zsuper
- assert_equal true, $thru__zsuper
- end
-=end
-
-end
-
-rescue LoadError
-end
diff --git a/test/ripper/test_scanner_events.rb b/test/ripper/test_scanner_events.rb
deleted file mode 100644
index 4389946104..0000000000
--- a/test/ripper/test_scanner_events.rb
+++ /dev/null
@@ -1,807 +0,0 @@
-#
-# test_scanner_events.rb
-#
-begin
-
-require 'ripper'
-require 'test/unit'
-
-class TestRipper_ScannerEvents < Test::Unit::TestCase
-
- def test_event_coverage
- dispatched = Ripper::SCANNER_EVENTS.map {|event,_| event }
- dispatched.each do |e|
- assert_equal true, respond_to?("test_#{e}", true), "event not tested: #{e}"
- end
- end
-
- def scan(target, str)
- sym = "on_#{target}".intern
- Ripper.lex(str).select {|_1,type,_2| type == sym }.map {|_1,_2,tok| tok }
- end
-
- def test_tokenize
- assert_equal [],
- Ripper.tokenize('')
- assert_equal ['a'],
- Ripper.tokenize('a')
- assert_equal ['1'],
- Ripper.tokenize('1')
- assert_equal ['1', ';', 'def', ' ', 'm', '(', 'arg', ')', 'end'],
- Ripper.tokenize("1;def m(arg)end")
- assert_equal ['print', '(', '<<EOS', ')', "\n", "heredoc\n", "EOS\n"],
- Ripper.tokenize("print(<<EOS)\nheredoc\nEOS\n")
- assert_equal ['print', '(', ' ', '<<EOS', ')', "\n", "heredoc\n", "EOS\n"],
- Ripper.tokenize("print( <<EOS)\nheredoc\nEOS\n")
- assert_equal ["\#\n", "\n", "\#\n", "\n", "nil", "\n"],
- Ripper.tokenize("\#\n\n\#\n\nnil\n")
- end
-
- def test_lex
- assert_equal [],
- Ripper.lex('')
- assert_equal [[[1,0], :on_ident, "a"]],
- Ripper.lex('a')
- assert_equal [[[1, 0], :on_kw, "nil"]],
- Ripper.lex("nil")
- assert_equal [[[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_kw, "end"]],
- Ripper.lex("def m(a)end")
- assert_equal [[[1, 0], :on_int, "1"],
- [[1, 1], :on_nl, "\n"],
- [[2, 0], :on_int, "2"],
- [[2, 1], :on_nl, "\n"],
- [[3, 0], :on_int, "3"]],
- Ripper.lex("1\n2\n3")
- assert_equal [[[1, 0], :on_heredoc_beg, "<<EOS"],
- [[1, 5], :on_nl, "\n"],
- [[2, 0], :on_tstring_content, "heredoc\n"],
- [[3, 0], :on_heredoc_end, "EOS"]],
- Ripper.lex("<<EOS\nheredoc\nEOS")
- end
-
- def test_location
- validate_location ""
- validate_location " "
- validate_location "@"
- validate_location "\n"
- validate_location "\r\n"
- validate_location "\n\n\n\n\n\r\n\n\n"
- validate_location "\n;\n;\n;\n;\n"
- validate_location "nil"
- validate_location "@ivar"
- validate_location "1;2;3"
- validate_location "1\n2\n3"
- validate_location "1\n2\n3\n"
- validate_location "def m(a) nil end"
- validate_location "if true then false else nil end"
- validate_location "BEGIN{print nil}"
- validate_location "%w(a b\nc\r\nd \ne )"
- validate_location %Q["a\nb\r\nc"]
- validate_location "print(<<EOS)\nheredoc\nEOS\n"
- validate_location %Q[print(<<-"EOS")\nheredoc\n EOS\n]
- end
-
- def validate_location(src)
- buf = ''
- Ripper.lex(src).each do |pos, type, tok|
- line, col = *pos
- assert_equal buf.count("\n") + 1, line,
- "wrong lineno: #{tok.inspect} (#{type}) [#{line}:#{col}]"
- assert_equal buf.sub(/\A.*\n/m, '').size, col,
- "wrong column: #{tok.inspect} (#{type}) [#{line}:#{col}]"
- buf << tok
- end
- assert_equal src, buf
- end
-
- def test_backref
- assert_equal ["$`", "$&", "$'", '$1', '$2', '$3'],
- scan('backref', %q[m($~, $`, $&, $', $1, $2, $3)])
- end
-
- def test_backtick
- assert_equal ["`"],
- scan('backtick', %q[p `make all`])
- end
-
- def test_comma
- assert_equal [','] * 6,
- scan('comma', %q[ m(0,1,2,3,4,5,6) ])
- assert_equal [],
- scan('comma', %q[".,.,.,.,.,.,.."])
- assert_equal [],
- scan('comma', %Q[<<EOS\n,,,,,,,,,,\nEOS])
- end
-
- def test_period
- assert_equal [],
- scan('period', '')
- assert_equal ['.'],
- scan('period', 'a.b')
- assert_equal ['.'],
- scan('period', 'Object.new')
- assert_equal [],
- scan('period', '"."')
- assert_equal [],
- scan('period', '1..2')
- assert_equal [],
- scan('period', '1...3')
- end
-
- def test_const
- assert_equal ['CONST'],
- scan('const', 'CONST')
- assert_equal ['C'],
- scan('const', 'C')
- assert_equal ['CONST_A'],
- scan('const', 'CONST_A')
- assert_equal ['Const', 'Const2', 'Const3'],
- scan('const', 'Const; Const2; Const3')
- assert_equal ['Const'],
- scan('const', 'Const(a)')
- assert_equal ['M', 'A', 'A2'],
- scan('const', 'M(A,A2)')
- assert_equal [],
- scan('const', '')
- assert_equal [],
- scan('const', 'm(lvar, @ivar, @@cvar, $gvar)')
- end
-
- def test_cvar
- assert_equal [],
- scan('cvar', '')
- assert_equal ['@@cvar'],
- scan('cvar', '@@cvar')
- assert_equal ['@@__cvar__'],
- scan('cvar', '@@__cvar__')
- assert_equal ['@@CVAR'],
- scan('cvar', '@@CVAR')
- assert_equal ['@@cvar'],
- scan('cvar', ' @@cvar#comment')
- assert_equal ['@@cvar'],
- scan('cvar', ':@@cvar')
- assert_equal ['@@cvar'],
- scan('cvar', 'm(lvar, @ivar, @@cvar, $gvar)')
- assert_equal [],
- scan('cvar', '"@@cvar"')
- end
-
- def test_embexpr_beg
- assert_equal [],
- scan('embexpr_beg', '')
- assert_equal ['#{'],
- scan('embexpr_beg', '"#{expr}"')
- assert_equal [],
- scan('embexpr_beg', '%q[#{expr}]')
- assert_equal ['#{'],
- scan('embexpr_beg', '%Q[#{expr}]')
- assert_equal ['#{'],
- scan('embexpr_beg', "m(<<EOS)\n\#{expr}\nEOS")
- end
-
- def test_embexpr_end
-=begin
- # currently detected as "rbrace"
- assert_equal [],
- scan('embexpr_end', '')
- assert_equal ['}'],
- scan('embexpr_end', '"#{expr}"')
- assert_equal [],
- scan('embexpr_end', '%q[#{expr}]')
- assert_equal ['}'],
- scan('embexpr_end', '%Q[#{expr}]')
- assert_equal ['}'],
- scan('embexpr_end', "m(<<EOS)\n\#{expr}\nEOS")
-=end
- end
-
- def test_embvar
- assert_equal [],
- scan('embvar', '')
- assert_equal ['#'],
- scan('embvar', '"#$gvar"')
- assert_equal ['#'],
- scan('embvar', '"#@ivar"')
- assert_equal ['#'],
- scan('embvar', '"#@@cvar"')
- assert_equal [],
- scan('embvar', '"#lvar"')
- assert_equal [],
- scan('embvar', '"#"')
- assert_equal [],
- scan('embvar', '"\#$gvar"')
- assert_equal [],
- scan('embvar', '"\#@ivar"')
- assert_equal [],
- scan('embvar', '%q[#@ivar]')
- assert_equal ['#'],
- scan('embvar', '%Q[#@ivar]')
- end
-
- def test_float
- assert_equal [],
- scan('float', '')
- assert_equal ['1.000'],
- scan('float', '1.000')
- assert_equal ['123.456'],
- scan('float', '123.456')
- assert_equal ['1.2345678901234567890123456789'],
- scan('float', '1.2345678901234567890123456789')
- assert_equal ['1.000'],
- scan('float', ' 1.000# comment')
- assert_equal ['1.234e5'],
- scan('float', '1.234e5')
- assert_equal ['1.234e1234567890'],
- scan('float', '1.234e1234567890')
- assert_equal ['1.0'],
- scan('float', 'm(a,b,1.0,c,d)')
- end
-
- def test_gvar
- assert_equal [],
- scan('gvar', '')
- assert_equal ['$a'],
- scan('gvar', '$a')
- assert_equal ['$A'],
- scan('gvar', '$A')
- assert_equal ['$gvar'],
- scan('gvar', 'm(lvar, @ivar, @@cvar, $gvar)')
- assert_equal %w($_ $~ $* $$ $? $! $@ $/ $\\ $; $, $. $= $: $< $> $"),
- scan('gvar', 'm($_, $~, $*, $$, $?, $!, $@, $/, $\\, $;, $,, $., $=, $:, $<, $>, $")')
- end
-
- def test_ident
- assert_equal [],
- scan('ident', '')
- assert_equal ['lvar'],
- scan('ident', 'lvar')
- assert_equal ['m', 'lvar'],
- scan('ident', 'm(lvar, @ivar, @@cvar, $gvar)')
- end
-
- def test_int
- assert_equal [],
- scan('int', '')
- assert_equal ['1', '10', '100000000000000'],
- scan('int', 'm(1,10,100000000000000)')
- end
-
- def test_ivar
- assert_equal [],
- scan('ivar', '')
- assert_equal ['@ivar'],
- scan('ivar', '@ivar')
- assert_equal ['@__ivar__'],
- scan('ivar', '@__ivar__')
- assert_equal ['@IVAR'],
- scan('ivar', '@IVAR')
- assert_equal ['@ivar'],
- scan('ivar', 'm(lvar, @ivar, @@cvar, $gvar)')
- end
-
- def test_kw
- assert_equal [],
- scan('kw', '')
- assert_equal %w(not),
- scan('kw', 'not 1')
- assert_equal %w(and),
- scan('kw', '1 and 2')
- assert_equal %w(or),
- scan('kw', '1 or 2')
- assert_equal %w(if then else end),
- scan('kw', 'if 1 then 2 else 3 end')
- assert_equal %w(if then elsif else end),
- scan('kw', 'if 1 then 2 elsif 3 else 4 end')
- assert_equal %w(unless then end),
- scan('kw', 'unless 1 then end')
- assert_equal %w(if true),
- scan('kw', '1 if true')
- assert_equal %w(unless false),
- scan('kw', '2 unless false')
- assert_equal %w(case when when else end),
- scan('kw', 'case n; when 1; when 2; else 3 end')
- assert_equal %w(while do nil end),
- scan('kw', 'while 1 do nil end')
- assert_equal %w(until do nil end),
- scan('kw', 'until 1 do nil end')
- assert_equal %w(while),
- scan('kw', '1 while 2')
- assert_equal %w(until),
- scan('kw', '1 until 2')
- assert_equal %w(while break next retry end),
- scan('kw', 'while 1; break; next; retry end')
- assert_equal %w(for in next break end),
- scan('kw', 'for x in obj; next 1; break 2 end')
- assert_equal %w(begin rescue retry end),
- scan('kw', 'begin 1; rescue; retry; end')
- assert_equal %w(rescue),
- scan('kw', '1 rescue 2')
- assert_equal %w(def redo return end),
- scan('kw', 'def m() redo; return end')
- assert_equal %w(def yield yield end),
- scan('kw', 'def m() yield; yield 1 end')
- assert_equal %w(def super super super end),
- scan('kw', 'def m() super; super(); super(1) end')
- assert_equal %w(alias),
- scan('kw', 'alias a b')
- assert_equal %w(undef),
- scan('kw', 'undef public')
- assert_equal %w(class end),
- scan('kw', 'class A < Object; end')
- assert_equal %w(module end),
- scan('kw', 'module M; end')
- assert_equal %w(class end),
- scan('kw', 'class << obj; end')
- assert_equal %w(BEGIN),
- scan('kw', 'BEGIN { }')
- assert_equal %w(END),
- scan('kw', 'END { }')
- assert_equal %w(self),
- scan('kw', 'self.class')
- assert_equal %w(nil true false),
- scan('kw', 'p(nil, true, false)')
- assert_equal %w(__FILE__ __LINE__),
- scan('kw', 'p __FILE__, __LINE__')
- assert_equal %w(defined?),
- scan('kw', 'defined?(Object)')
- end
-
- def test_lbrace
- assert_equal [],
- scan('lbrace', '')
- assert_equal ['{'],
- scan('lbrace', '3.times{ }')
- assert_equal ['{'],
- scan('lbrace', '3.times { }')
- assert_equal ['{'],
- scan('lbrace', '3.times{}')
- assert_equal [],
- scan('lbrace', '"{}"')
- assert_equal ['{'],
- scan('lbrace', '{1=>2}')
- end
-
- def test_rbrace
- assert_equal [],
- scan('rbrace', '')
- assert_equal ['}'],
- scan('rbrace', '3.times{ }')
- assert_equal ['}'],
- scan('rbrace', '3.times { }')
- assert_equal ['}'],
- scan('rbrace', '3.times{}')
- assert_equal [],
- scan('rbrace', '"{}"')
- assert_equal ['}'],
- scan('rbrace', '{1=>2}')
- end
-
- def test_lbracket
- assert_equal [],
- scan('lbracket', '')
- assert_equal ['['],
- scan('lbracket', '[]')
- assert_equal ['['],
- scan('lbracket', 'a[1]')
- assert_equal [],
- scan('lbracket', 'm(%q[])')
- end
-
- def test_rbracket
- assert_equal [],
- scan('rbracket', '')
- assert_equal [']'],
- scan('rbracket', '[]')
- assert_equal [']'],
- scan('rbracket', 'a[1]')
- assert_equal [],
- scan('rbracket', 'm(%q[])')
- end
-
- def test_lparen
- assert_equal [],
- scan('lparen', '')
- assert_equal ['('],
- scan('lparen', '()')
- assert_equal ['('],
- scan('lparen', 'm()')
- assert_equal ['('],
- scan('lparen', 'm (a)')
- assert_equal [],
- scan('lparen', '"()"')
- assert_equal [],
- scan('lparen', '"%w()"')
- end
-
- def test_rparen
- assert_equal [],
- scan('rparen', '')
- assert_equal [')'],
- scan('rparen', '()')
- assert_equal [')'],
- scan('rparen', 'm()')
- assert_equal [')'],
- scan('rparen', 'm (a)')
- assert_equal [],
- scan('rparen', '"()"')
- assert_equal [],
- scan('rparen', '"%w()"')
- end
-
- def test_op
- assert_equal [],
- scan('op', '')
- assert_equal ['|'],
- scan('op', '1 | 1')
- assert_equal ['^'],
- scan('op', '1 ^ 1')
- assert_equal ['&'],
- scan('op', '1 & 1')
- assert_equal ['<=>'],
- scan('op', '1 <=> 1')
- assert_equal ['=='],
- scan('op', '1 == 1')
- assert_equal ['==='],
- scan('op', '1 === 1')
- assert_equal ['=~'],
- scan('op', '1 =~ 1')
- assert_equal ['>'],
- scan('op', '1 > 1')
- assert_equal ['>='],
- scan('op', '1 >= 1')
- assert_equal ['<'],
- scan('op', '1 < 1')
- assert_equal ['<='],
- scan('op', '1 <= 1')
- assert_equal ['<<'],
- scan('op', '1 << 1')
- assert_equal ['>>'],
- scan('op', '1 >> 1')
- assert_equal ['+'],
- scan('op', '1 + 1')
- assert_equal ['-'],
- scan('op', '1 - 1')
- assert_equal ['*'],
- scan('op', '1 * 1')
- assert_equal ['/'],
- scan('op', '1 / 1')
- assert_equal ['%'],
- scan('op', '1 % 1')
- assert_equal ['**'],
- scan('op', '1 ** 1')
- assert_equal ['~'],
- scan('op', '~1')
- assert_equal ['-'],
- scan('op', '-a')
- assert_equal ['+'],
- scan('op', '+a')
- assert_equal ['[]'],
- scan('op', ':[]')
- assert_equal ['[]='],
- scan('op', ':[]=')
- assert_equal [],
- scan('op', %q[`make all`])
- end
-
- def test_symbeg
- assert_equal [],
- scan('symbeg', '')
- assert_equal [':'],
- scan('symbeg', ':sym')
- assert_equal [':'],
- scan('symbeg', '[1,2,3,:sym]')
- assert_equal [],
- scan('symbeg', '":sym"')
- assert_equal [],
- scan('symbeg', 'a ? b : c')
- end
-
- def test_tstring_beg
- assert_equal [],
- scan('tstring_beg', '')
- assert_equal ['"'],
- scan('tstring_beg', '"abcdef"')
- assert_equal ['%q['],
- scan('tstring_beg', '%q[abcdef]')
- assert_equal ['%Q['],
- scan('tstring_beg', '%Q[abcdef]')
- end
-
- def test_tstring_content
- assert_equal [],
- scan('tstring_content', '')
- assert_equal ['abcdef'],
- scan('tstring_content', '"abcdef"')
- assert_equal ['abcdef'],
- scan('tstring_content', '%q[abcdef]')
- assert_equal ['abcdef'],
- scan('tstring_content', '%Q[abcdef]')
- assert_equal ['abc', 'def'],
- scan('tstring_content', '"abc#{1}def"')
- assert_equal ['sym'],
- scan('tstring_content', ':"sym"')
- end
-
- def test_tstring_end
- assert_equal [],
- scan('tstring_end', '')
- assert_equal ['"'],
- scan('tstring_end', '"abcdef"')
- assert_equal [']'],
- scan('tstring_end', '%q[abcdef]')
- assert_equal [']'],
- scan('tstring_end', '%Q[abcdef]')
- end
-
- def test_regexp_beg
- assert_equal [],
- scan('regexp_beg', '')
- assert_equal ['/'],
- scan('regexp_beg', '/re/')
- assert_equal ['%r<'],
- scan('regexp_beg', '%r<re>')
- assert_equal [],
- scan('regexp_beg', '5 / 5')
- end
-
- def test_regexp_end
- assert_equal [],
- scan('regexp_end', '')
- assert_equal ['/'],
- scan('regexp_end', '/re/')
- assert_equal ['>'],
- scan('regexp_end', '%r<re>')
- end
-
- def test_words_beg
- assert_equal [],
- scan('words_beg', '')
- assert_equal ['%W('],
- scan('words_beg', '%W()')
- assert_equal ['%W('],
- scan('words_beg', '%W(w w w)')
- assert_equal ['%W( '],
- scan('words_beg', '%W( w w w )')
- end
-
- def test_qwords_beg
- assert_equal [],
- scan('qwords_beg', '')
- assert_equal ['%w('],
- scan('qwords_beg', '%w()')
- assert_equal ['%w('],
- scan('qwords_beg', '%w(w w w)')
- assert_equal ['%w( '],
- scan('qwords_beg', '%w( w w w )')
- end
-
- # FIXME: Close paren must not present (`words_end' scanner event?).
- def test_words_sep
- assert_equal [],
- scan('words_sep', '')
- assert_equal [')'],
- scan('words_sep', '%w()')
- assert_equal [' ', ' ', ')'],
- scan('words_sep', '%w(w w w)')
- assert_equal [' ', ' ', ' )'],
- scan('words_sep', '%w( w w w )')
- assert_equal ["\n", ' ', ' )'],
- scan('words_sep', "%w( w\nw w )")
- end
-
- def test_heredoc_beg
- assert_equal [],
- scan('heredoc_beg', '')
- assert_equal ['<<EOS'],
- scan('heredoc_beg', "<<EOS\nheredoc\nEOS")
- assert_equal ['<<EOS'],
- scan('heredoc_beg', "<<EOS\nheredoc\nEOS\n")
- assert_equal ['<<EOS'],
- scan('heredoc_beg', "<<EOS\nheredoc\nEOS \n")
- assert_equal ['<<-EOS'],
- scan('heredoc_beg', "<<-EOS\nheredoc\n\tEOS \n")
- assert_equal ['<<"EOS"'],
- scan('heredoc_beg', %Q[<<"EOS"\nheredoc\nEOS])
- assert_equal [%q(<<'EOS')],
- scan('heredoc_beg', "<<'EOS'\nheredoc\nEOS")
- assert_equal [%q(<<`EOS`)],
- scan('heredoc_beg', "<<`EOS`\nheredoc\nEOS")
- assert_equal [%q(<<" ")],
- scan('heredoc_beg', %Q[<<" "\nheredoc\nEOS])
- end
-
- def test_tstring_content_HEREDOC
- assert_equal [],
- scan('tstring_content', '')
- assert_equal ["heredoc\n"],
- scan('tstring_content', "<<EOS\nheredoc\nEOS")
- assert_equal ["heredoc\n"],
- scan('tstring_content', "<<EOS\nheredoc\nEOS\n")
- assert_equal ["heredoc \n"],
- scan('tstring_content', "<<EOS\nheredoc \nEOS \n")
- assert_equal ["heredoc\n"],
- scan('tstring_content', "<<-EOS\nheredoc\n\tEOS \n")
- end
-
- def test_heredoc_end
- assert_equal [],
- scan('heredoc_end', '')
- assert_equal ["EOS"],
- scan('heredoc_end', "<<EOS\nheredoc\nEOS")
- assert_equal ["EOS\n"],
- scan('heredoc_end', "<<EOS\nheredoc\nEOS\n")
- assert_equal ["EOS \n"],
- scan('heredoc_end', "<<EOS\nheredoc\nEOS \n")
- assert_equal ["\tEOS \n"],
- scan('heredoc_end', "<<-EOS\nheredoc\n\tEOS \n")
- end
-
- def test_semicolon
- assert_equal [],
- scan('semicolon', '')
- assert_equal %w(;),
- scan('semicolon', ';')
- assert_equal %w(; ;),
- scan('semicolon', '; ;')
- assert_equal %w(; ; ;),
- scan('semicolon', 'nil;nil;nil;')
- assert_equal %w(; ; ;),
- scan('semicolon', 'nil;nil;nil;nil')
- assert_equal [],
- scan('semicolon', '";"')
- assert_equal [],
- scan('semicolon', '%w(;)')
- assert_equal [],
- scan('semicolon', '/;/')
- end
-
- def test_comment
- assert_equal [],
- scan('comment', '')
- assert_equal ['# comment'],
- scan('comment', '# comment')
- assert_equal ["# comment\n"],
- scan('comment', "# comment\n")
- assert_equal ["# comment\n"],
- scan('comment', "# comment\n1 + 1")
- assert_equal ["# comment\n"],
- scan('comment', "1 + 1 + 1# comment\n1 + 1")
- end
-
- def test_embdoc_beg
- assert_equal [],
- scan('embdoc_beg', '')
- assert_equal ["=begin\n"],
- scan('embdoc_beg', "=begin\ndoc\n=end")
- assert_equal ["=begin \n"],
- scan('embdoc_beg', "=begin \ndoc\n=end\n")
- assert_equal ["=begin comment\n"],
- scan('embdoc_beg', "=begin comment\ndoc\n=end\n")
- end
-
- def test_embdoc
- assert_equal [],
- scan('embdoc', '')
- assert_equal ["doc\n"],
- scan('embdoc', "=begin\ndoc\n=end")
- assert_equal ["doc\n"],
- scan('embdoc', "=begin\ndoc\n=end\n")
- end
-
- def test_embdoc_end
- assert_equal [],
- scan('embdoc_end', '')
- assert_equal ["=end"],
- scan('embdoc_end', "=begin\ndoc\n=end")
- assert_equal ["=end\n"],
- scan('embdoc_end', "=begin\ndoc\n=end\n")
- end
-
- def test_sp
- assert_equal [],
- scan('sp', '')
- assert_equal [' '],
- scan('sp', ' ')
- assert_equal [' '],
- scan('sp', ' 1')
- assert_equal [],
- scan('sp', "\n")
- assert_equal [' '],
- scan('sp', " \n")
- assert_equal [' ', ' '],
- scan('sp', "1 + 1")
- assert_equal [],
- scan('sp', "' '")
- assert_equal [],
- scan('sp', "%w( )")
- assert_equal [],
- scan('sp', "%w( w )")
- assert_equal [],
- scan('sp', "p(/ /)")
- end
-
- # `nl' event always means End-Of-Statement.
- def test_nl
- assert_equal [],
- scan('nl', '')
- assert_equal [],
- scan('nl', "\n")
- assert_equal ["\n"],
- scan('nl', "1 + 1\n")
- assert_equal ["\n", "\n"],
- scan('nl', "1 + 1\n2 + 2\n")
- assert_equal [],
- scan('nl', "1 +\n1")
- assert_equal [],
- scan('nl', "1;\n")
- assert_equal ["\r\n"],
- scan('nl', "1 + 1\r\n")
- assert_equal [],
- scan('nl', "1;\r\n")
- end
-
- def test_ignored_nl
- assert_equal [],
- scan('ignored_nl', '')
- assert_equal ["\n"],
- scan('ignored_nl', "\n")
- assert_equal [],
- scan('ignored_nl', "1 + 1\n")
- assert_equal [],
- scan('ignored_nl', "1 + 1\n2 + 2\n")
- assert_equal ["\n"],
- scan('ignored_nl', "1 +\n1")
- assert_equal ["\n"],
- scan('ignored_nl', "1;\n")
- assert_equal [],
- scan('ignored_nl', "1 + 1\r\n")
- assert_equal ["\r\n"],
- scan('ignored_nl', "1;\r\n")
- end
-
- def test___end__
- assert_equal [],
- scan('__end__', "")
- assert_equal ["__END__"],
- scan('__end__', "__END__")
- assert_equal ["__END__\n"],
- scan('__end__', "__END__\n")
- assert_equal ["__END__\n"],
- Ripper.tokenize("__END__\njunk junk junk")
- assert_equal ["__END__"],
- scan('__end__', "1\n__END__")
- assert_equal [],
- scan('__end__', "print('__END__')")
- end
-
- def test_CHAR
- assert_equal [],
- scan('CHAR', "")
- assert_equal ["@"],
- scan('CHAR', "@")
- assert_equal [],
- scan('CHAR', "@ivar")
- end
-
- def test_label
- end
-
- def test_tlambda
- end
-
- def test_tlambeg
- end
-
- def test_tlambda_arg
- end
-
-end
-
-rescue LoadError
-end
diff --git a/test/rss/rss-assertions.rb b/test/rss/rss-assertions.rb
index 86f9dd87c0..0d0d2cbe4f 100644
--- a/test/rss/rss-assertions.rb
+++ b/test/rss/rss-assertions.rb
@@ -2,10 +2,6 @@ require 'erb'
module RSS
module Assertions
- def _wrap_assertion
- yield
- end
-
def assert_parse(rss, assert_method, *args)
__send__("assert_#{assert_method}", *args) do
::RSS::Parser.parse(rss)
@@ -14,7 +10,7 @@ module RSS
::RSS::Parser.parse(rss, false).validate
end
end
-
+
def assert_ns(prefix, uri)
_wrap_assertion do
begin
@@ -26,7 +22,7 @@ module RSS
end
end
end
-
+
def assert_missing_tag(tag, parent)
_wrap_assertion do
begin
@@ -38,7 +34,7 @@ module RSS
end
end
end
-
+
def assert_too_much_tag(tag, parent)
_wrap_assertion do
begin
@@ -50,7 +46,7 @@ module RSS
end
end
end
-
+
def assert_missing_attribute(tag, attrname)
_wrap_assertion do
begin
@@ -62,7 +58,7 @@ module RSS
end
end
end
-
+
def assert_not_expected_tag(tag, uri, parent)
_wrap_assertion do
begin
@@ -75,7 +71,7 @@ module RSS
end
end
end
-
+
def assert_not_available_value(tag, value, attribute=nil)
_wrap_assertion do
begin
@@ -101,7 +97,7 @@ module RSS
end
end
end
-
+
def assert_xml_declaration(version, encoding, standalone, rss)
_wrap_assertion do
assert_equal(version, rss.version)
@@ -109,7 +105,7 @@ module RSS
assert_equal(standalone, rss.standalone)
end
end
-
+
def assert_xml_stylesheet_attrs(attrs, xsl)
_wrap_assertion do
n_attrs = normalized_attrs(attrs)
@@ -118,7 +114,7 @@ module RSS
end
end
end
-
+
def assert_xml_stylesheet(target, attrs, xsl)
_wrap_assertion do
if attrs.has_key?(:href)
@@ -133,7 +129,7 @@ module RSS
end
end
end
-
+
def assert_xml_stylesheet_pis(attrs_ary, rss=nil)
_wrap_assertion do
if rss.nil?
@@ -567,9 +563,7 @@ EOA
EOA
png_file = File.join(File.dirname(__FILE__), "dot.png")
- png = File.open(png_file, "rb") do |file|
- file.read.force_encoding("binary")
- end
+ png = File.open(png_file, "rb") {|file| file.read}
base64_content = [png].pack("m").delete("\n")
[false, true].each do |with_space|
@@ -806,7 +800,7 @@ EOA
end
end
end
-
+
def assert_multiple_dublin_core(elems, target)
_wrap_assertion do
elems.each do |name, values, plural|
@@ -816,7 +810,7 @@ EOA
end
end
end
-
+
def assert_syndication(elems, target)
_wrap_assertion do
elems.each do |name, value|
@@ -826,7 +820,7 @@ EOA
end
end
end
-
+
def assert_content(elems, target)
_wrap_assertion do
elems.each do |name, value|
@@ -834,7 +828,7 @@ EOA
end
end
end
-
+
def assert_trackback(attrs, target)
_wrap_assertion do
n_attrs = normalized_attrs(attrs)
@@ -1272,32 +1266,22 @@ EOA
invalid_feed_checker=nil)
_wrap_assertion do
elements = []
- invalid_feed_exception = nil
- feed = nil
- begin
- feed = RSS::Maker.make("atom:#{feed_type}") do |maker|
- yield maker
- targets = chain_reader(maker, maker_readers)
- targets.each do |target|
- element = maker_extractor.call(target)
- elements << element if element
- end
- if invalid_feed_checker
- invalid_feed_exception = invalid_feed_checker.call(targets)
- end
+ invalid_feed = false
+ feed = RSS::Maker.make("atom:#{feed_type}") do |maker|
+ yield maker
+ targets = chain_reader(maker, maker_readers)
+ targets.each do |target|
+ element = maker_extractor.call(target)
+ elements << element if element
end
- rescue RSS::Error
- if invalid_feed_exception.is_a?(RSS::TooMuchTagError)
- assert_too_much_tag(invalid_feed_exception.tag,
- invalid_feed_exception.parent) do
- raise
- end
- else
- raise
+ if invalid_feed_checker
+ invalid_feed = invalid_feed_checker.call(targets)
end
end
- if invalid_feed_exception.nil?
+ if invalid_feed
+ assert_nil(feed)
+ else
actual_elements = chain_reader(feed, feed_readers) || []
actual_elements = actual_elements.collect do |target|
feed_extractor.call(target)
@@ -1464,7 +1448,7 @@ EOA
_assert_maker_atom_element(feed_type, maker_readers, feed_readers,
maker_extractor, feed_extractor,
&block)
- end
+ end
def assert_maker_atom_generator(feed_type, maker_readers, feed_readers,
not_set_error_name=nil, &block)
@@ -1552,24 +1536,18 @@ EOA
:length => target.length,
}
end
-
- if feed_readers.first == "entries"
- parent = "entry"
- else
- parent = feed_type
- end
invalid_feed_checker = Proc.new do |targets|
infos = {}
- invalid_exception = nil
+ invalid = false
targets.each do |target|
key = [target.hreflang, target.type]
if infos.has_key?(key)
- invalid_exception = RSS::TooMuchTagError.new("link", parent)
+ invalid = true
break
end
infos[key] = true if target.rel.nil? or target.rel == "alternate"
end
- invalid_exception
+ invalid
end
invalid_feed_checker = nil if allow_duplication
_assert_maker_atom_elements(feed_type, maker_readers, feed_readers,
diff --git a/test/rss/rss-testcase.rb b/test/rss/rss-testcase.rb
index 6a7093a8da..79f8cb87e8 100644
--- a/test/rss/rss-testcase.rb
+++ b/test/rss/rss-testcase.rb
@@ -37,11 +37,11 @@ module RSS
CLOUD_PATH = "/RPC2"
CLOUD_REGISTER_PROCEDURE = "ourFavoriteSongs.rssPleaseNotify"
CLOUD_PROTOCOL = "xml-rpc"
-
+
ENCLOSURE_URL = "http://www.scripting.com/mp3s/weatherReportSuite.mp3"
ENCLOSURE_LENGTH = "12216320"
ENCLOSURE_TYPE = "audio/mpeg"
-
+
CATEGORY_DOMAIN = "http://www.superopendirectory.com/"
FEED_TITLE = "dive into mark"
@@ -375,7 +375,7 @@ EOA
rdf.items << item
assert_not_equal("", rdf.to_s)
end
-
+
def setup_rss20(rss)
assert_equal("", rss.to_s)
@@ -389,7 +389,7 @@ EOA
rss.channel = channel
assert_not_equal("", rss.to_s)
end
-
+
def setup_dummy_channel(maker)
about = "http://hoge.com"
title = "fugafuga"
@@ -421,7 +421,7 @@ EOA
url = "http://hoge.com/hoge.png"
maker.channel.link = link if maker.channel.link.nil?
-
+
maker.image.title = title
maker.image.url = url
end
diff --git a/test/rss/test_1.0.rb b/test/rss/test_1.0.rb
index 52ad24cfcd..9cb7607590 100644
--- a/test/rss/test_1.0.rb
+++ b/test/rss/test_1.0.rb
@@ -6,32 +6,32 @@ require "rss/1.0"
module RSS
class TestRSS10Core < TestCase
-
+
def setup
@rdf_prefix = "rdf"
@rdf_uri = "http://www.w3.org/1999/02/22-rdf-syntax-ns#"
@uri = "http://purl.org/rss/1.0/"
end
-
+
def test_RDF
version = "1.0"
encoding = "UTF-8"
standalone = false
-
+
rdf = RDF.new(version, encoding, standalone)
setup_rss10(rdf)
doc = REXML::Document.new(rdf.to_s)
-
+
xmldecl = doc.xml_decl
-
+
%w(version encoding).each do |x|
assert_equal(instance_eval(x), xmldecl.__send__(x))
end
assert_equal(standalone, !xmldecl.standalone.nil?)
-
+
assert_equal(@rdf_uri, doc.root.namespace)
end
-
+
def test_not_displayed_xml_stylesheets
rdf = RDF.new()
plain_rdf = rdf.to_s
@@ -40,7 +40,7 @@ module RSS
assert_equal(plain_rdf, rdf.to_s)
end
end
-
+
def test_xml_stylesheets
[
[{:href => "a.xsl", :type => "text/xsl"}],
@@ -52,7 +52,7 @@ module RSS
assert_xml_stylesheet_pis(attrs_ary)
end
end
-
+
def test_channel
about = "http://hoge.com"
title = "fugafuga"
@@ -77,7 +77,7 @@ module RSS
%w(title link description image items textinput).each do |x|
channel.__send__("#{x}=", instance_eval(x))
end
-
+
doc = REXML::Document.new(make_RDF(<<-EOR))
#{channel}
<items>
@@ -85,7 +85,7 @@ module RSS
</items>
EOR
c = doc.root.elements[1]
-
+
assert_equal(about, c.attributes["about"])
%w(title link description image textinput).each do |x|
elem = c.elements[x]
@@ -105,52 +105,52 @@ EOR
assert_equal(@uri, c.elements["items"].namespace)
assert_equal("items", c.elements["items"].name)
end
-
+
def test_channel_image
resource = "http://hoge.com/hoge.png"
image = RDF::Channel::Image.new(resource)
-
+
doc = REXML::Document.new(make_RDF(image.to_s))
i = doc.root.elements[1]
-
+
assert_equal("image", i.name)
assert_equal(@uri, i.namespace)
-
+
res = i.attributes.get_attribute("resource")
-
+
assert_equal(@rdf_uri, res.namespace)
assert_equal(resource, res.value)
end
-
+
def test_channel_textinput
resource = "http://hoge.com/hoge.png"
textinput = RDF::Channel::Textinput.new(resource)
-
+
doc = REXML::Document.new(make_RDF(textinput.to_s))
t = doc.root.elements[1]
-
+
assert_equal("textinput", t.name)
assert_equal(@uri, t.namespace)
-
+
res = t.attributes.get_attribute("resource")
-
+
assert_equal(@rdf_uri, res.namespace)
assert_equal(resource, res.value)
end
-
+
def test_channel_items
item_link = "http://example.com/item"
items = RDF::Channel::Items.new
li = items.Seq.class::Li.new(item_link)
items.Seq.lis << li
-
+
doc = REXML::Document.new(make_RDF(items.to_s))
i = doc.root.elements[1]
-
+
assert_equal("items", i.name)
assert_equal(@uri, i.namespace)
-
+
assert_equal(1, i.elements.size)
seq = i.elements[1]
assert_equal("Seq", seq.name)
@@ -162,16 +162,16 @@ EOR
assert_equal(@rdf_uri, l.namespace)
assert_equal(item_link, l.attributes["resource"])
end
-
+
def test_seq
item_link = "http://example.com/item"
seq = RDF::Seq.new
li = seq.class::Li.new(item_link)
seq.lis << li
-
+
doc = REXML::Document.new(make_RDF(seq.to_s))
s = doc.root.elements[1]
-
+
assert_equal("Seq", s.name)
assert_equal(@rdf_uri, s.namespace)
@@ -181,37 +181,37 @@ EOR
assert_equal(@rdf_uri, l.namespace)
assert_equal(item_link, l.attributes["resource"])
end
-
+
def test_li
resource = "http://hoge.com/"
li = RDF::Li.new(resource)
-
+
doc = REXML::Document.new(make_RDF(li.to_s))
l = doc.root.elements[1]
-
+
assert_equal("li", l.name)
assert_equal(@rdf_uri, l.namespace(l.prefix))
-
+
res = l.attributes.get_attribute("resource")
-
+
assert_equal('', res.instance_eval("@prefix"))
assert_equal(resource, res.value)
end
-
+
def test_image
about = "http://hoge.com"
title = "fugafuga"
url = "http://hoge.com/hoge"
link = "http://hoge.com/fuga"
-
+
image = RDF::Image.new(about)
%w(title url link).each do |x|
image.__send__("#{x}=", instance_eval(x))
end
-
+
doc = REXML::Document.new(make_RDF(image.to_s))
i = doc.root.elements[1]
-
+
assert_equal(about, i.attributes["about"])
%w(title url link).each do |x|
elem = i.elements[x]
@@ -220,21 +220,21 @@ EOR
assert_equal(instance_eval(x), elem.text)
end
end
-
+
def test_item
about = "http://hoge.com"
title = "fugafuga"
link = "http://hoge.com/fuga"
description = "hogehogehoge"
-
+
item = RDF::Item.new(about)
%w(title link description).each do |x|
item.__send__("#{x}=", instance_eval(x))
end
-
+
doc = REXML::Document.new(make_RDF(item.to_s))
i = doc.root.elements[1]
-
+
assert_equal(about, i.attributes["about"])
%w(title link description).each do |x|
elem = i.elements[x]
@@ -243,22 +243,22 @@ EOR
assert_equal(instance_eval(x), elem.text)
end
end
-
+
def test_textinput
about = "http://hoge.com"
title = "fugafuga"
link = "http://hoge.com/fuga"
name = "foo"
description = "hogehogehoge"
-
+
textinput = RDF::Textinput.new(about)
%w(title link name description).each do |x|
textinput.__send__("#{x}=", instance_eval(x))
end
-
+
doc = REXML::Document.new(make_RDF(textinput.to_s))
t = doc.root.elements[1]
-
+
assert_equal(about, t.attributes["about"])
%w(title link name description).each do |x|
elem = t.elements[x]
diff --git a/test/rss/test_2.0.rb b/test/rss/test_2.0.rb
index 884afcc816..5a63efbcb9 100644
--- a/test/rss/test_2.0.rb
+++ b/test/rss/test_2.0.rb
@@ -8,28 +8,28 @@ module RSS
def setup
@rss_version = "2.0"
end
-
+
def test_Rss
version = "1.0"
encoding = "UTF-8"
standalone = false
-
+
rss = Rss.new(@rss_version, version, encoding, standalone)
setup_rss20(rss)
-
+
doc = REXML::Document.new(rss.to_s(false))
-
+
xmldecl = doc.xml_decl
-
+
%w(version encoding).each do |x|
assert_equal(instance_eval(x), xmldecl.__send__(x))
end
assert_equal(standalone, !xmldecl.standalone.nil?)
-
+
assert_equal("", doc.root.namespace)
assert_equal(@rss_version, doc.root.attributes["version"])
end
-
+
def test_not_displayed_xml_stylesheets
rss = Rss.new(@rss_version)
plain_rss = rss.to_s
@@ -38,7 +38,7 @@ module RSS
assert_equal(plain_rss, rss.to_s)
end
end
-
+
def test_xml_stylesheets
[
[{:href => "a.xsl", :type => "text/xsl"}],
@@ -57,7 +57,7 @@ module RSS
title = "fugafuga"
link = "http://hoge.com"
description = "fugafugafugafuga"
-
+
language = "en-us"
copyright = "Copyright 2002, Spartanburg Herald-Journal"
managingEditor = "geo@herald.com (George Matesky)"
@@ -81,7 +81,7 @@ module RSS
rating = '(PICS-1.1 "http://www.rsac.org/ratingsv01.html" l gen true comment "RSACi North America Server" for "http://www.rsac.org" on "1996.04.16T08:15-0500" r (n 0 s 0 v 0 l 0))'
channel = Rss::Channel.new
-
+
elems = %w(title link description language copyright
managingEditor webMaster pubDate lastBuildDate
generator docs ttl rating)
@@ -94,10 +94,10 @@ module RSS
channel.categories << Rss::Channel::Category.new(cat[:domain],
cat[:content])
end
-
+
doc = REXML::Document.new(make_rss20(channel.to_s))
c = doc.root.elements[1]
-
+
elems.each do |x|
elem = c.elements[x]
assert_equal(x, elem.name)
@@ -139,10 +139,10 @@ module RSS
cloud_params[:registerProcedure],
cloud_params[:protocol])
cloud_params[:port] = cloud.port
-
+
doc = REXML::Document.new(cloud.to_s)
cloud_elem = doc.root
-
+
actual = {}
cloud_elem.attributes.each do |name, value|
value = value.to_i if name == "port"
@@ -169,7 +169,7 @@ module RSS
doc = REXML::Document.new(image.to_s)
image_elem = doc.root
-
+
image_params.each do |name, value|
value = image.__send__(name)
actual = image_elem.elements[name.to_s].text
@@ -177,7 +177,7 @@ module RSS
assert_equal(value, actual)
end
end
-
+
def test_channel_textInput
textInput_params = {
:title => "fugafuga",
@@ -192,13 +192,13 @@ module RSS
doc = REXML::Document.new(textInput.to_s)
input_elem = doc.root
-
+
textInput_params.each do |name, value|
actual = input_elem.elements[name.to_s].text
assert_equal(value, actual)
end
end
-
+
def test_channel_skip_days
skipDays_values = [
"Sunday",
@@ -208,15 +208,15 @@ module RSS
skipDays_values.each do |value|
skipDays.days << Rss::Channel::SkipDays::Day.new(value)
end
-
+
doc = REXML::Document.new(skipDays.to_s)
days_elem = doc.root
-
+
skipDays_values.each_with_index do |value, i|
assert_equal(value, days_elem.elements[i + 1].text)
end
end
-
+
def test_channel_skip_hours
skipHours_values = [
"0",
@@ -229,7 +229,7 @@ module RSS
doc = REXML::Document.new(skipHours.to_s)
hours_elem = doc.root
-
+
skipHours_values.each_with_index do |value, i|
expected = skipHours.hours[i].content
assert_equal(expected, hours_elem.elements[i + 1].text.to_i)
@@ -260,7 +260,7 @@ module RSS
item = Rss::Channel::Item.new
channel.items << item
-
+
elems = %w(title link description author comments pubDate)
elems.each do |x|
value = instance_eval(x)
@@ -271,7 +271,7 @@ module RSS
item.categories << Rss::Channel::Category.new(cat[:domain],
cat[:content])
end
-
+
doc = REXML::Document.new(channel.to_s)
channel_elem = doc.root
@@ -311,7 +311,7 @@ module RSS
enclosure_params[:length],
enclosure_params[:type])
enclosure_params[:length] = enclosure.length
-
+
doc = REXML::Document.new(enclosure.to_s)
enclosure_elem = doc.root
@@ -322,7 +322,7 @@ module RSS
end
assert_equal(enclosure_params, actual)
end
-
+
def test_item_guid
test_params = [
{
@@ -345,10 +345,10 @@ module RSS
else
assert_equal(guid.isPermaLink, guid.PermaLink?)
end
-
+
doc = REXML::Document.new(guid.to_s)
guid_elem = doc.root
-
+
actual = {}
actual[:content] = guid_elem.text if guid_elem.text
guid_elem.attributes.each do |name, value|
@@ -358,7 +358,7 @@ module RSS
assert_equal(guid_params, actual)
end
end
-
+
def test_item_source
source_params = {
:url => "http://www.tomalak.org/links2.xml",
@@ -370,7 +370,7 @@ module RSS
doc = REXML::Document.new(source.to_s)
source_elem = doc.root
-
+
actual = {}
actual[:content] = source_elem.text
source_elem.attributes.each do |name, value|
diff --git a/test/rss/test_accessor.rb b/test/rss/test_accessor.rb
index f2b8508a6d..ceb31fc9c2 100644
--- a/test/rss/test_accessor.rb
+++ b/test/rss/test_accessor.rb
@@ -11,11 +11,11 @@ module RSS
channel = Rss::Channel.new
channel.pubDate = nil
assert_nil(channel.pubDate)
-
+
time = Time.now
channel.pubDate = time
assert_equal(time, channel.pubDate)
-
+
time = Time.parse(Time.now.rfc822)
channel.pubDate = time.rfc822
assert_equal(time, channel.pubDate)
@@ -25,35 +25,35 @@ module RSS
assert_not_available_value("pubDate", value) do
channel.pubDate = value
end
-
+
channel.do_validate = false
time = Time.parse(Time.now.iso8601)
value = time.iso8601
channel.pubDate = value
assert_equal(time, channel.pubDate)
-
+
channel.pubDate = nil
assert_nil(channel.pubDate)
end
-
+
def test_integer
image_item = RDF::Item::ImageItem.new
image_item.width = nil
assert_nil(image_item.width)
-
+
width = 10
image_item.width = width
assert_equal(width, image_item.width)
-
+
width = 10.0
image_item.width = width
assert_equal(width, image_item.width)
-
+
width = "10"
image_item.width = width
assert_equal(width.to_i, image_item.width)
-
+
width = "10.0"
assert_not_available_value("image:width", width) do
image_item.width = width
@@ -63,29 +63,29 @@ module RSS
width = "10.0"
image_item.width = width
assert_equal(width.to_i, image_item.width)
-
+
image_item.width = nil
assert_nil(image_item.width)
end
-
+
def test_positive_integer
channel = RDF::Channel.new
channel.sy_updateFrequency = nil
assert_nil(channel.sy_updateFrequency)
-
+
freq = 10
channel.sy_updateFrequency = freq
assert_equal(freq, channel.sy_updateFrequency)
-
+
freq = 10.0
channel.sy_updateFrequency = freq
assert_equal(freq, channel.sy_updateFrequency)
-
+
freq = "10"
channel.sy_updateFrequency = freq
assert_equal(freq.to_i, channel.sy_updateFrequency)
-
+
freq = "10.0"
assert_not_available_value("sy:updateFrequency", freq) do
channel.sy_updateFrequency = freq
@@ -95,7 +95,7 @@ module RSS
freq = "10.0"
channel.sy_updateFrequency = freq
assert_equal(freq.to_i, channel.sy_updateFrequency)
-
+
channel.sy_updateFrequency = nil
assert_nil(channel.sy_updateFrequency)
end
diff --git a/test/rss/test_atom.rb b/test/rss/test_atom.rb
index 71e0f44ea9..d573b923cc 100644
--- a/test/rss/test_atom.rb
+++ b/test/rss/test_atom.rb
@@ -643,9 +643,7 @@ module RSS
_wrap_assertion do
type = "image/png"
png_file = File.join(File.dirname(__FILE__), "dot.png")
- original_content = File.open(png_file, "rb") do |file|
- file.read.force_encoding("binary")
- end
+ original_content = File.open(png_file, "rb") {|file| file.read}
content = target_class.new
content.type = type
diff --git a/test/rss/test_content.rb b/test/rss/test_content.rb
index f59b0c8e83..02db59186b 100644
--- a/test/rss/test_content.rb
+++ b/test/rss/test_content.rb
@@ -10,15 +10,15 @@ module RSS
def setup
@prefix = "content"
@uri = "http://purl.org/rss/1.0/modules/content/"
-
+
@elems = {
:encoded => "<em>ATTENTION</em>",
}
-
+
@content_nodes = @elems.collect do |name, value|
"<#{@prefix}:#{name}>#{CGI.escapeHTML(value.to_s)}</#{@prefix}:#{name}>"
end.join("\n")
-
+
@rss10_source = make_RDF(<<-EOR, {@prefix => @uri})
#{make_channel()}
#{make_image()}
@@ -79,7 +79,7 @@ EOR
end
end
end
-
+
def test_to_s
@elems.each do |name, value|
excepted = make_element("#{@prefix}:#{name}", {}, value)
diff --git a/test/rss/test_maker_0.9.rb b/test/rss/test_maker_0.9.rb
index 32aa183756..c211bf605b 100644
--- a/test/rss/test_maker_0.9.rb
+++ b/test/rss/test_maker_0.9.rb
@@ -4,43 +4,24 @@ require "rss/maker"
module RSS
class TestMaker09 < TestCase
- def test_supported?
- assert(RSS::Maker.supported?("0.9"))
- assert(RSS::Maker.supported?("rss0.9"))
- assert(RSS::Maker.supported?("0.91"))
- assert(RSS::Maker.supported?("rss0.91"))
- assert(RSS::Maker.supported?("0.92"))
- assert(RSS::Maker.supported?("rss0.92"))
- assert(!RSS::Maker.supported?("0.93"))
- assert(!RSS::Maker.supported?("rss0.93"))
- end
-
- def test_find_class
- assert_equal(RSS::Maker::RSS091, RSS::Maker["0.91"])
- assert_equal(RSS::Maker::RSS091, RSS::Maker["rss0.91"])
- assert_equal(RSS::Maker::RSS092, RSS::Maker["0.9"])
- assert_equal(RSS::Maker::RSS092, RSS::Maker["0.92"])
- assert_equal(RSS::Maker::RSS092, RSS::Maker["rss0.92"])
- end
def test_rss
- assert_raise(LocalJumpError) do
- RSS::Maker.make("0.91")
- end
-
+ rss = RSS::Maker.make("0.91")
+ assert_nil(rss)
+
rss = RSS::Maker.make("0.9") do |maker|
setup_dummy_channel(maker)
setup_dummy_image(maker)
end
assert_equal("0.92", rss.rss_version)
-
+
rss = RSS::Maker.make("0.91") do |maker|
setup_dummy_channel(maker)
setup_dummy_image(maker)
end
assert_equal("0.91", rss.rss_version)
-
+
rss = RSS::Maker.make("0.91") do |maker|
setup_dummy_channel(maker)
setup_dummy_image(maker)
@@ -123,7 +104,7 @@ module RSS
maker.image.title = image_title
end
channel = rss.channel
-
+
assert_equal(title, channel.title)
assert_equal(link, channel.link)
assert_equal(description, channel.description)
@@ -143,7 +124,7 @@ module RSS
skipHours.each_with_index do |hour, i|
assert_equal(hour.to_i, channel.skipHours.hours[i].content)
end
-
+
assert(channel.items.empty?)
assert_equal(image_url, channel.image.url)
@@ -196,7 +177,7 @@ module RSS
end
end
end
-
+
def test_image
title = "fugafuga"
link = "http://hoge.com"
@@ -208,7 +189,7 @@ module RSS
rss = RSS::Maker.make("0.91") do |maker|
setup_dummy_channel(maker)
maker.channel.link = link
-
+
maker.image.title = title
maker.image.url = url
maker.image.width = width
@@ -227,7 +208,7 @@ module RSS
RSS::Maker.make("0.91") do |maker|
# setup_dummy_channel(maker)
maker.channel.link = link
-
+
maker.image.title = title
maker.image.url = url
maker.image.width = width
@@ -263,7 +244,7 @@ module RSS
setup_dummy_channel(maker)
# maker.channel.link = link
maker.channel.link = nil
-
+
maker.image.title = title
maker.image.url = url
maker.image.width = width
@@ -285,7 +266,7 @@ module RSS
end
end
end
-
+
def test_items(with_convenience_way=true)
title = "TITLE"
link = "http://hoge.com/"
@@ -299,7 +280,7 @@ module RSS
rss = RSS::Maker.make("0.91") do |maker|
setup_dummy_channel(maker)
-
+
maker.items.new_item do |item|
item.title = title
item.link = link
@@ -318,7 +299,7 @@ module RSS
item_size = 5
rss = RSS::Maker.make("0.91") do |maker|
setup_dummy_channel(maker)
-
+
item_size.times do |i|
maker.items.new_item do |_item|
_item.title = "#{title}#{i}"
@@ -339,7 +320,7 @@ module RSS
rss = RSS::Maker.make("0.91") do |maker|
setup_dummy_channel(maker)
-
+
item_size.times do |i|
maker.items.new_item do |_item|
_item.title = "#{title}#{i}"
@@ -402,7 +383,7 @@ module RSS
end
end
end
-
+
def test_not_valid_textInput
title = "fugafuga"
description = "text hoge fuga"
diff --git a/test/rss/test_maker_1.0.rb b/test/rss/test_maker_1.0.rb
index b465556979..60cc3708a7 100644
--- a/test/rss/test_maker_1.0.rb
+++ b/test/rss/test_maker_1.0.rb
@@ -4,29 +4,14 @@ require "rss/maker"
module RSS
class TestMaker10 < TestCase
- def test_supported?
- assert(RSS::Maker.supported?("1.0"))
- assert(RSS::Maker.supported?("rss1.0"))
- assert(!RSS::Maker.supported?("1.1"))
- assert(!RSS::Maker.supported?("rss1.1"))
- end
-
- def test_find_class
- assert_equal(RSS::Maker::RSS10, RSS::Maker["1.0"])
- assert_equal(RSS::Maker::RSS10, RSS::Maker["rss1.0"])
- end
def test_rdf
- assert_raise(LocalJumpError) do
- RSS::Maker.make("1.0")
- end
-
rss = RSS::Maker.make("1.0") do |maker|
setup_dummy_channel(maker)
setup_dummy_item(maker)
end
assert_equal("1.0", rss.rss_version)
-
+
rss = RSS::Maker.make("1.0") do |maker|
setup_dummy_channel(maker)
maker.encoding = "EUC-JP"
@@ -63,6 +48,9 @@ module RSS
link = "http://hoge.com"
description = "fugafugafugafuga"
+ rss = RSS::Maker.make("1.0")
+ assert_nil(rss)
+
rss = RSS::Maker.make("1.0") do |maker|
maker.channel.about = about
maker.channel.title = title
@@ -102,26 +90,6 @@ module RSS
assert_equal(rss.textinput.about, channel.textinput.resource)
end
- def test_channel_language
- about = "http://hoge.com"
- title = "fugafuga"
- link = "http://hoge.com"
- description = "fugafugafugafuga"
- language = "ja"
-
- rss = RSS::Maker.make("1.0") do |maker|
- maker.channel.about = about
- maker.channel.title = title
- maker.channel.link = link
- maker.channel.description = description
- maker.channel.language = language
-
- setup_dummy_item(maker)
- end
- channel = rss.channel
- assert_equal(language, channel.dc_language)
- end
-
def test_not_valid_channel
about = "http://hoge.com"
title = "fugafuga"
@@ -164,8 +132,8 @@ module RSS
end
end
end
-
-
+
+
def test_image
title = "fugafuga"
link = "http://hoge.com"
@@ -174,7 +142,7 @@ module RSS
rss = RSS::Maker.make("1.0") do |maker|
setup_dummy_channel(maker)
maker.channel.link = link
-
+
maker.image.title = title
maker.image.url = url
@@ -191,7 +159,7 @@ module RSS
RSS::Maker.make("1.0") do |maker|
# setup_dummy_channel(maker)
maker.channel.link = link
-
+
maker.image.title = title
maker.image.url = url
end
@@ -206,7 +174,7 @@ module RSS
rss = RSS::Maker.make("1.0") do |maker|
setup_dummy_channel(maker)
maker.channel.link = link
-
+
# maker.image.url = url
maker.image.title = title
@@ -218,7 +186,7 @@ module RSS
rss = RSS::Maker.make("1.0") do |maker|
setup_dummy_channel(maker)
maker.channel.link = link
-
+
maker.image.url = url
# maker.image.title = title
@@ -232,7 +200,7 @@ module RSS
setup_dummy_channel(maker)
# maker.channel.link = link
maker.channel.link = nil
-
+
maker.image.url = url
maker.image.title = title
@@ -254,7 +222,7 @@ module RSS
rss = RSS::Maker.make("1.0") do |maker|
setup_dummy_channel(maker)
-
+
maker.items.new_item do |item|
item.title = title
item.link = link
@@ -268,11 +236,11 @@ module RSS
assert_equal(link, item.link)
assert_nil(item.description)
-
+
item_size = 5
rss = RSS::Maker.make("1.0") do |maker|
setup_dummy_channel(maker)
-
+
item_size.times do |i|
maker.items.new_item do |_item|
_item.title = "#{title}#{i}"
@@ -292,7 +260,7 @@ module RSS
rss = RSS::Maker.make("1.0") do |maker|
setup_dummy_channel(maker)
-
+
item_size.times do |i|
maker.items.new_item do |_item|
_item.title = "#{title}#{i}"
@@ -319,7 +287,7 @@ module RSS
max_size = item_size / 2
rss = RSS::Maker.make("1.0") do |maker|
setup_dummy_channel(maker)
-
+
item_size.times do |i|
maker.items.new_item do |_item|
_item.title = "#{title}#{i}"
@@ -356,7 +324,7 @@ module RSS
max_size = -2
rss = RSS::Maker.make("1.0") do |maker|
setup_dummy_channel(maker)
-
+
item_size.times do |i|
maker.items.new_item do |_item|
_item.title = "#{title}#{i}"
@@ -425,7 +393,7 @@ module RSS
rss = RSS::Maker.make("1.0") do |maker|
setup_dummy_channel(maker)
-
+
maker.textinput.link = link
maker.textinput.title = title
maker.textinput.description = description
@@ -452,7 +420,7 @@ module RSS
end
end
end
-
+
def test_not_valid_textinput
title = "fugafuga"
description = "text hoge fuga"
@@ -474,7 +442,7 @@ module RSS
rss = RSS::Maker.make("1.0") do |maker|
setup_dummy_channel(maker)
-
+
maker.textinput.link = link
# maker.textinput.title = title
maker.textinput.description = description
@@ -487,7 +455,7 @@ module RSS
rss = RSS::Maker.make("1.0") do |maker|
setup_dummy_channel(maker)
-
+
maker.textinput.link = link
maker.textinput.title = title
# maker.textinput.description = description
@@ -500,7 +468,7 @@ module RSS
rss = RSS::Maker.make("1.0") do |maker|
setup_dummy_channel(maker)
-
+
maker.textinput.link = link
maker.textinput.title = title
maker.textinput.description = description
diff --git a/test/rss/test_maker_2.0.rb b/test/rss/test_maker_2.0.rb
index d4d9832373..c338e343a3 100644
--- a/test/rss/test_maker_2.0.rb
+++ b/test/rss/test_maker_2.0.rb
@@ -4,31 +4,19 @@ require "rss/maker"
module RSS
class TestMaker20 < TestCase
- def test_supported?
- assert(RSS::Maker.supported?("2.0"))
- assert(RSS::Maker.supported?("rss2.0"))
- assert(!RSS::Maker.supported?("2.2"))
- assert(!RSS::Maker.supported?("rss2.2"))
- end
-
- def test_find_class
- assert_equal(RSS::Maker::RSS20, RSS::Maker["2.0"])
- assert_equal(RSS::Maker::RSS20, RSS::Maker["rss2.0"])
- end
def test_rss
- assert_raise(LocalJumpError) do
- RSS::Maker.make("2.0")
- end
-
+ rss = RSS::Maker.make("2.0")
+ assert_nil(rss)
+
rss = RSS::Maker.make("2.0") do |maker|
setup_dummy_channel(maker)
end
assert_equal("2.0", rss.rss_version)
-
+
rss = RSS::Maker.make("2.0") do |maker|
setup_dummy_channel(maker)
-
+
maker.encoding = "EUC-JP"
end
assert_equal("2.0", rss.rss_version)
@@ -36,7 +24,7 @@ module RSS
rss = RSS::Maker.make("2.0") do |maker|
setup_dummy_channel(maker)
-
+
maker.standalone = "yes"
end
assert_equal("2.0", rss.rss_version)
@@ -44,7 +32,7 @@ module RSS
rss = RSS::Maker.make("2.0") do |maker|
setup_dummy_channel(maker)
-
+
maker.encoding = "EUC-JP"
maker.standalone = "yes"
end
@@ -79,7 +67,7 @@ module RSS
]
generator = "RSS Maker"
ttl = "60"
-
+
rss = RSS::Maker.make("2.0") do |maker|
maker.channel.title = title
maker.channel.link = link
@@ -103,18 +91,18 @@ module RSS
new_hour.content = hour
end
end
-
+
categories.each do |category|
maker.channel.categories.new_category do |new_category|
new_category.content = category
end
end
-
+
maker.channel.generator = generator
maker.channel.ttl = ttl
end
channel = rss.channel
-
+
assert_equal(title, channel.title)
assert_equal(link, channel.link)
assert_equal(description, channel.description)
@@ -134,11 +122,11 @@ module RSS
skipHours.each_with_index do |hour, i|
assert_equal(hour.to_i, channel.skipHours.hours[i].content)
end
-
+
channel.categories.each_with_index do |category, i|
assert_equal(categories[i], category.content)
end
-
+
assert_equal(generator, channel.generator)
assert_equal(ttl.to_i, channel.ttl)
@@ -152,7 +140,7 @@ module RSS
link = "http://hoge.com"
description = "fugafugafugafuga"
language = "ja"
-
+
assert_not_set_error("maker.channel", %w(title)) do
RSS::Maker.make("2.0") do |maker|
# maker.channel.title = title
@@ -189,7 +177,7 @@ module RSS
assert_not_nil(rss)
end
-
+
def test_cloud
domain = "rpc.sys.com"
port = "80"
@@ -213,7 +201,7 @@ module RSS
assert_equal(registerProcedure, cloud.registerProcedure)
assert_equal(protocol, cloud.protocol)
end
-
+
def test_not_valid_cloud
domain = "rpc.sys.com"
port = "80"
@@ -276,7 +264,7 @@ module RSS
end
assert_nil(rss.channel.cloud)
end
-
+
def test_image
title = "fugafuga"
@@ -289,7 +277,7 @@ module RSS
rss = RSS::Maker.make("2.0") do |maker|
setup_dummy_channel(maker)
maker.channel.link = link
-
+
maker.image.title = title
maker.image.url = url
maker.image.width = width
@@ -308,7 +296,7 @@ module RSS
RSS::Maker.make("2.0") do |maker|
# setup_dummy_channel(maker)
maker.channel.link = link
-
+
maker.image.title = title
maker.image.url = url
maker.image.width = width
@@ -329,7 +317,7 @@ module RSS
rss = RSS::Maker.make("2.0") do |maker|
setup_dummy_channel(maker)
maker.channel.link = link
-
+
# maker.image.title = title
maker.image.url = url
maker.image.width = width
@@ -343,7 +331,7 @@ module RSS
setup_dummy_channel(maker)
# maker.channel.link = link
maker.channel.link = nil
-
+
maker.image.title = title
maker.image.url = url
maker.image.width = width
@@ -355,7 +343,7 @@ module RSS
rss = RSS::Maker.make("2.0") do |maker|
setup_dummy_channel(maker)
maker.channel.link = link
-
+
maker.image.title = title
# maker.image.url = url
maker.image.width = width
@@ -364,7 +352,7 @@ module RSS
end
assert_nil(rss.image)
end
-
+
def test_items(with_convenience_way=true)
title = "TITLE"
link = "http://hoge.com/"
@@ -381,7 +369,7 @@ module RSS
item_size = 5
rss = RSS::Maker.make("2.0") do |maker|
setup_dummy_channel(maker)
-
+
item_size.times do |i|
maker.items.new_item do |item|
item.title = "#{title}#{i}"
@@ -407,7 +395,7 @@ module RSS
rss = RSS::Maker.make("2.0") do |maker|
setup_dummy_channel(maker)
-
+
item_size.times do |i|
maker.items.new_item do |item|
item.title = "#{title}#{i}"
@@ -474,7 +462,7 @@ module RSS
def test_guid
isPermaLink = "true"
content = "http://inessential.com/2002/09/01.php#a2"
-
+
rss = RSS::Maker.make("2.0") do |maker|
setup_dummy_channel(maker)
setup_dummy_item(maker)
@@ -488,29 +476,9 @@ module RSS
assert_equal(content, guid.content)
end
- def test_guid_permanent_link
- content = "http://inessential.com/2002/09/01.php#a2"
-
- rss = RSS::Maker.make("2.0") do |maker|
- setup_dummy_channel(maker)
- setup_dummy_item(maker)
-
- guid = maker.items.last.guid
- assert_equal(nil, guid.permanent_link?)
- assert_equal(guid.isPermaLink, guid.permanent_link?)
- guid.permanent_link = true
- assert_equal(true, guid.permanent_link?)
- assert_equal(guid.isPermaLink, guid.permanent_link?)
- guid.content = content
- end
- guid = rss.channel.items.last.guid
- assert_equal(true, guid.isPermaLink)
- assert_equal(content, guid.content)
- end
-
def test_not_valid_guid
content = "http://inessential.com/2002/09/01.php#a2"
-
+
rss = RSS::Maker.make("2.0") do |maker|
setup_dummy_channel(maker)
setup_dummy_item(maker)
@@ -520,12 +488,12 @@ module RSS
end
assert_nil(rss.channel.items.last.guid)
end
-
+
def test_enclosure
url = "http://www.scripting.com/mp3s/weatherReportSuite.mp3"
length = "12216320"
type = "audio/mpeg"
-
+
rss = RSS::Maker.make("2.0") do |maker|
setup_dummy_channel(maker)
setup_dummy_item(maker)
@@ -545,7 +513,7 @@ module RSS
url = "http://www.scripting.com/mp3s/weatherReportSuite.mp3"
length = "12216320"
type = "audio/mpeg"
-
+
rss = RSS::Maker.make("2.0") do |maker|
setup_dummy_channel(maker)
setup_dummy_item(maker)
@@ -556,7 +524,7 @@ module RSS
enclosure.type = type
end
assert_nil(rss.channel.items.last.enclosure)
-
+
rss = RSS::Maker.make("2.0") do |maker|
setup_dummy_channel(maker)
setup_dummy_item(maker)
@@ -567,7 +535,7 @@ module RSS
enclosure.type = type
end
assert_nil(rss.channel.items.last.enclosure)
-
+
rss = RSS::Maker.make("2.0") do |maker|
setup_dummy_channel(maker)
setup_dummy_item(maker)
@@ -584,7 +552,7 @@ module RSS
def test_source
url = "http://static.userland.com/tomalak/links2.xml"
content = "Tomalak's Realm"
-
+
rss = RSS::Maker.make("2.0") do |maker|
setup_dummy_channel(maker)
setup_dummy_item(maker)
@@ -601,7 +569,7 @@ module RSS
def test_not_valid_source
url = "http://static.userland.com/tomalak/links2.xml"
content = "Tomalak's Realm"
-
+
rss = RSS::Maker.make("2.0") do |maker|
setup_dummy_channel(maker)
setup_dummy_item(maker)
@@ -611,7 +579,7 @@ module RSS
source.content = content
end
assert_nil(rss.channel.items.last.source)
-
+
rss = RSS::Maker.make("2.0") do |maker|
setup_dummy_channel(maker)
setup_dummy_item(maker)
@@ -622,11 +590,11 @@ module RSS
end
assert_nil(rss.channel.items.last.source)
end
-
+
def test_category
domain = "http://www.fool.com/cusips"
content = "MSFT"
-
+
rss = RSS::Maker.make("2.0") do |maker|
setup_dummy_channel(maker)
setup_dummy_item(maker)
@@ -643,7 +611,7 @@ module RSS
def test_not_valid_category
content = "Grateful Dead"
-
+
rss = RSS::Maker.make("2.0") do |maker|
setup_dummy_channel(maker)
setup_dummy_item(maker)
@@ -654,7 +622,7 @@ module RSS
end
assert(rss.channel.items.last.categories.empty?)
end
-
+
def test_textInput
title = "fugafuga"
description = "text hoge fuga"
@@ -686,7 +654,7 @@ module RSS
end
end
end
-
+
def test_not_valid_textInput
title = "fugafuga"
description = "text hoge fuga"
@@ -705,7 +673,7 @@ module RSS
rss = RSS::Maker.make("2.0") do |maker|
setup_dummy_channel(maker)
-
+
maker.textinput.title = title
# maker.textinput.description = description
maker.textinput.name = name
@@ -715,7 +683,7 @@ module RSS
rss = RSS::Maker.make("2.0") do |maker|
setup_dummy_channel(maker)
-
+
maker.textinput.title = title
maker.textinput.description = description
# maker.textinput.name = name
@@ -725,7 +693,7 @@ module RSS
rss = RSS::Maker.make("2.0") do |maker|
setup_dummy_channel(maker)
-
+
maker.textinput.title = title
maker.textinput.description = description
maker.textinput.name = name
diff --git a/test/rss/test_maker_atom_entry.rb b/test/rss/test_maker_atom_entry.rb
index 4275bdc685..ae0ab2d09f 100644
--- a/test/rss/test_maker_atom_entry.rb
+++ b/test/rss/test_maker_atom_entry.rb
@@ -4,17 +4,6 @@ require "rss/maker"
module RSS
class TestMakerAtomEntry < TestCase
- def test_supported?
- assert(RSS::Maker.supported?("atom:entry"))
- assert(RSS::Maker.supported?("atom1.0:entry"))
- assert(!RSS::Maker.supported?("atom2.0:entry"))
- end
-
- def test_find_class
- assert_equal(RSS::Maker::Atom::Entry, RSS::Maker["atom:entry"])
- assert_equal(RSS::Maker::Atom::Entry, RSS::Maker["atom1.0:entry"])
- end
-
def test_root_element
entry = Maker.make("atom:entry") do |maker|
setup_dummy_channel_atom(maker)
@@ -374,20 +363,5 @@ module RSS
setup_dummy_item_atom(maker)
end
end
-
- def test_date
- date = Time.parse("2004/11/1 10:10")
- feed = Maker.make("atom:entry") do |maker|
- setup_dummy_channel_atom(maker)
- maker.channel.date = nil
- maker.items.new_item do |item|
- item.link = "http://example.com/article.html"
- item.title = "Sample Article"
- item.date = date
- end
- end
- assert_equal(date, feed.items[0].updated.content)
- assert_equal([date], feed.items[0].dc_dates.collect {|_date| _date.value})
- end
end
end
diff --git a/test/rss/test_maker_atom_feed.rb b/test/rss/test_maker_atom_feed.rb
index 58a55c43ff..e5bf0e23b2 100644
--- a/test/rss/test_maker_atom_feed.rb
+++ b/test/rss/test_maker_atom_feed.rb
@@ -4,22 +4,6 @@ require "rss/maker"
module RSS
class TestMakerAtomFeed < TestCase
- def test_supported?
- assert(RSS::Maker.supported?("atom"))
- assert(RSS::Maker.supported?("atom:feed"))
- assert(RSS::Maker.supported?("atom1.0"))
- assert(RSS::Maker.supported?("atom1.0:feed"))
- assert(!RSS::Maker.supported?("atom2.0"))
- assert(!RSS::Maker.supported?("atom2.0:feed"))
- end
-
- def test_find_class
- assert_equal(RSS::Maker::Atom::Feed, RSS::Maker["atom"])
- assert_equal(RSS::Maker::Atom::Feed, RSS::Maker["atom:feed"])
- assert_equal(RSS::Maker::Atom::Feed, RSS::Maker["atom1.0"])
- assert_equal(RSS::Maker::Atom::Feed, RSS::Maker["atom1.0:feed"])
- end
-
def test_root_element
feed = Maker.make("atom") do |maker|
setup_dummy_channel_atom(maker)
@@ -401,54 +385,5 @@ module RSS
setup_dummy_item_atom(maker)
end
end
-
- def test_language
- language = "ja"
- feed = Maker.make("atom") do |maker|
- setup_dummy_channel_atom(maker)
- maker.channel.language = "ja"
- end
- assert_equal(language, feed.dc_language)
- end
-
- def test_date
- date = Time.parse("2004/11/1 10:10")
- feed = Maker.make("atom") do |maker|
- setup_dummy_channel_atom(maker)
- maker.items.new_item do |item|
- item.link = "http://example.com/article.html"
- item.title = "sample article"
- item.date = date
- end
- end
- assert_equal(date, feed.items[0].updated.content)
- assert_equal([date], feed.items[0].dc_dates.collect {|_date| _date.value})
- end
-
- def test_channel_dc_date
- date = Time.parse("2004/11/1 10:10")
- feed = Maker.make("atom") do |maker|
- setup_dummy_channel_atom(maker)
- maker.channel.updated = nil
- maker.channel.dc_date = date
- setup_dummy_item_atom(maker)
- end
- assert_equal(date, feed.updated.content)
- assert_equal([date], feed.dc_dates.collect {|_date| _date.value})
- end
-
- def test_item_dc_date
- date = Time.parse("2004/11/1 10:10")
- feed = Maker.make("atom") do |maker|
- setup_dummy_channel_atom(maker)
- maker.items.new_item do |item|
- item.link = "http://example.com/article.html"
- item.title = "sample article"
- item.dc_date = date
- end
- end
- assert_equal(date, feed.items[0].updated.content)
- assert_equal([date], feed.items[0].dc_dates.collect {|_date| _date.value})
- end
end
end
diff --git a/test/rss/test_maker_content.rb b/test/rss/test_maker_content.rb
index 393adcb715..53750bb095 100644
--- a/test/rss/test_maker_content.rb
+++ b/test/rss/test_maker_content.rb
@@ -7,7 +7,7 @@ module RSS
def setup
@uri = "http://purl.org/rss/1.0/modules/content/"
-
+
@elements = {
:encoded => "<em>ATTENTION</em>",
}
diff --git a/test/rss/test_maker_dc.rb b/test/rss/test_maker_dc.rb
index 626ec8d753..c9df36a1ce 100644
--- a/test/rss/test_maker_dc.rb
+++ b/test/rss/test_maker_dc.rb
@@ -7,12 +7,12 @@ module RSS
def setup
@uri = "http://purl.org/dc/elements/1.1/"
-
+
t = Time.iso8601("2000-01-01T12:00:05+00:00")
class << t
alias_method(:to_s, :iso8601)
end
-
+
@elements = {
:title => "hoge",
:description =>
@@ -86,8 +86,9 @@ module RSS
elems.each do |name, values, plural|
dc_elems = item.__send__("dc_#{plural}")
values.each do |value|
- elem = dc_elems.__send__("new_#{name}")
- elem.value = value
+ dc_elems.__send__("new_#{name}") do |elem|
+ elem.value = value
+ end
end
end
@@ -103,7 +104,7 @@ module RSS
def test_date
t1 = Time.iso8601("2000-01-01T12:00:05+00:00")
t2 = Time.iso8601("2005-01-01T12:00:05+00:00")
-
+
rss = RSS::Maker.make("1.0") do |maker|
setup_dummy_channel(maker)
maker.channel.date = t1
@@ -121,7 +122,7 @@ module RSS
assert_equal([t1, t2], rss.channel.dc_dates.collect{|x| x.value})
assert_equal([t2, t1], rss.items.last.dc_dates.collect{|x| x.value})
end
-
+
private
def accessor_name(name)
"dc_#{name}"
diff --git a/test/rss/test_maker_image.rb b/test/rss/test_maker_image.rb
index 4fba2cf795..1fc8076c46 100644
--- a/test/rss/test_maker_image.rb
+++ b/test/rss/test_maker_image.rb
@@ -39,7 +39,7 @@ module RSS
setup_dummy_textinput(maker)
end
-
+
setup_rss = RSS::Maker.make("1.0") do |maker|
rss.setup_maker(maker)
end
@@ -49,7 +49,7 @@ module RSS
assert_equal(@favicon_infos["about"], favicon.about)
assert_equal(@favicon_infos["image_size"], favicon.image_size)
assert_equal(@favicon_infos["dc_title"], favicon.dc_title)
-
+
item = target.items.last.image_item
assert_equal(@item_infos["about"], item.about)
assert_equal(@item_infos["resource"], item.resource)
diff --git a/test/rss/test_maker_itunes.rb b/test/rss/test_maker_itunes.rb
index 21a4dd1f29..1d4e323057 100644
--- a/test/rss/test_maker_itunes.rb
+++ b/test/rss/test_maker_itunes.rb
@@ -462,7 +462,7 @@ module RSS
"all of your answers here.",
maker_readers, feed_readers)
_assert_maker_itunes_summary("This week we talk about surviving in a " +
- "Red state if you're a Blue person. Or " +
+ "Red state if you’re a Blue person. Or " +
"vice versa.",
maker_readers, feed_readers)
end
diff --git a/test/rss/test_maker_sy.rb b/test/rss/test_maker_sy.rb
index 3f026b5c9c..309a3b70fd 100644
--- a/test/rss/test_maker_sy.rb
+++ b/test/rss/test_maker_sy.rb
@@ -7,12 +7,12 @@ module RSS
def setup
@uri = "http://purl.org/rss/1.0/modules/syndication/"
-
+
t = Time.iso8601("2000-01-01T12:00:05+00:00")
class << t
alias_method(:to_s, :iso8601)
end
-
+
@elements = {
:updatePeriod => "hourly",
:updateFrequency => "2",
diff --git a/test/rss/test_maker_taxo.rb b/test/rss/test_maker_taxo.rb
index c5cf18adc1..8feb4e1d33 100644
--- a/test/rss/test_maker_taxo.rb
+++ b/test/rss/test_maker_taxo.rb
@@ -7,7 +7,7 @@ module RSS
def setup
@uri = "http://purl.org/rss/1.0/modules/taxonomy/"
-
+
@resources = [
"http://meerkat.oreillynet.com/?c=cat23",
"http://meerkat.oreillynet.com/?c=47",
@@ -52,7 +52,7 @@ module RSS
def _test_date
t1 = Time.iso8601("2000-01-01T12:00:05+00:00")
t2 = Time.iso8601("2005-01-01T12:00:05+00:00")
-
+
rss = RSS::Maker.make("1.0") do |maker|
setup_dummy_channel(maker)
maker.channel.date = t1
@@ -70,7 +70,7 @@ module RSS
assert_equal([t1, t2], rss.channel.dc_dates.collect{|x| x.value})
assert_equal([t2, t1], rss.items.last.dc_dates.collect{|x| x.value})
end
-
+
private
def set_topics(target, resources=@resources)
resources.each do |value|
diff --git a/test/rss/test_maker_trackback.rb b/test/rss/test_maker_trackback.rb
index d9fe2ad01d..58705c6f80 100644
--- a/test/rss/test_maker_trackback.rb
+++ b/test/rss/test_maker_trackback.rb
@@ -7,7 +7,7 @@ module RSS
def setup
@uri = "http://madskills.com/public/xml/rss/module/trackback/"
-
+
@elements = {
:ping => "http://bar.com/tb.cgi?tb_id=rssplustrackback",
:abouts => [
diff --git a/test/rss/test_maker_xml-stylesheet.rb b/test/rss/test_maker_xml-stylesheet.rb
index c1dd6f71ed..81d97ddc0e 100644
--- a/test/rss/test_maker_xml-stylesheet.rb
+++ b/test/rss/test_maker_xml-stylesheet.rb
@@ -35,7 +35,7 @@ module RSS
assert_equal(charset, xss.charset)
assert_equal(alternate, xss.alternate)
-
+
href = 'http://example.com/index.xsl'
type = 'text/xsl'
rss = RSS::Maker.make("1.0") do |maker|
@@ -55,7 +55,7 @@ module RSS
def test_not_valid_xml_stylesheet
href = 'xss.XXX'
type = "text/xsl"
-
+
rss = RSS::Maker.make("1.0") do |maker|
maker.xml_stylesheets.new_xml_stylesheet do |xss|
# xss.href = href
@@ -78,6 +78,6 @@ module RSS
end
assert(rss.xml_stylesheets.empty?)
end
-
+
end
end
diff --git a/test/rss/test_parser_1.0.rb b/test/rss/test_parser_1.0.rb
index dca10e6f40..819ce286a5 100644
--- a/test/rss/test_parser_1.0.rb
+++ b/test/rss/test_parser_1.0.rb
@@ -484,7 +484,7 @@ EOR
assert_not_expected_tag(name, uri, "image") do
Parser.parse(rss, true, false)
end
-
+
uri = CONTENT_URI
name = "encoded"
elem = "<#{name} xmlns='#{uri}'/>"
@@ -507,22 +507,5 @@ EOR
#{make_image}
EOR
end
-
- def test_unknown_case_insensitive_duplicated_element
- xmlns = {
- "foaf" => "http://xmlns.com/foaf/0.1/",
- "dc" => "http://purl.org/dc/elements/1.1/",
- }
- assert_parse(make_RDF(<<-EOR, xmlns), :nothing_raised)
- #{make_channel}
- #{make_item}
- #{make_image}
- <foaf:Image rdf:about="http://example.com/myself.png">
- <dc:title>Myself</dc:title>
- <dc:link>http://example.com/</dc:link>
- </foaf:Image>
- EOR
- end
end
end
-
diff --git a/test/rss/test_setup_maker_0.9.rb b/test/rss/test_setup_maker_0.9.rb
index 0bcb0cbdc9..c20186cc8a 100644
--- a/test/rss/test_setup_maker_0.9.rb
+++ b/test/rss/test_setup_maker_0.9.rb
@@ -64,7 +64,7 @@ module RSS
setup_dummy_image(maker)
end
channel = new_rss.channel
-
+
assert_equal(title, channel.title)
assert_equal(link, channel.link)
assert_equal(description, channel.description)
@@ -99,19 +99,19 @@ module RSS
rss = RSS::Maker.make("0.91") do |maker|
setup_dummy_channel(maker)
maker.channel.link = link
-
+
maker.image.title = title
maker.image.url = url
maker.image.width = width
maker.image.height = height
maker.image.description = description
end
-
+
new_rss = RSS::Maker.make("0.91") do |maker|
rss.channel.setup_maker(maker)
rss.image.setup_maker(maker)
end
-
+
image = new_rss.image
assert_equal(title, image.title)
assert_equal(link, image.link)
@@ -120,7 +120,7 @@ module RSS
assert_equal(height.to_i, image.height)
assert_equal(description, image.description)
end
-
+
def test_setup_maker_textinput
title = "fugafuga"
description = "text hoge fuga"
@@ -142,7 +142,7 @@ module RSS
rss.image.setup_maker(maker)
rss.textinput.setup_maker(maker)
end
-
+
textInput = new_rss.channel.textInput
assert_equal(title, textInput.title)
assert_equal(description, textInput.description)
@@ -156,10 +156,10 @@ module RSS
description = "text hoge fuga"
item_size = 5
-
+
rss = RSS::Maker.make("0.91") do |maker|
setup_dummy_channel(maker)
-
+
item_size.times do |i|
maker.items.new_item do |item|
item.title = "#{title}#{i}"
@@ -170,7 +170,7 @@ module RSS
setup_dummy_image(maker)
end
-
+
new_rss = RSS::Maker.make("0.91") do |maker|
rss.channel.setup_maker(maker)
@@ -196,11 +196,11 @@ module RSS
def test_setup_maker_items_backward_compatibility
test_setup_maker_items(true)
end
-
+
def test_setup_maker
encoding = "EUC-JP"
standalone = true
-
+
href = 'a.xsl'
type = 'text/xsl'
title = 'sample'
@@ -228,7 +228,7 @@ module RSS
new_rss = RSS::Maker.make("0.91") do |maker|
rss.setup_maker(maker)
end
-
+
assert_equal("0.91", new_rss.rss_version)
assert_equal(encoding, new_rss.encoding)
assert_equal(standalone, new_rss.standalone)
diff --git a/test/rss/test_setup_maker_1.0.rb b/test/rss/test_setup_maker_1.0.rb
index 9f7bb1c1e8..0b960d91c8 100644
--- a/test/rss/test_setup_maker_1.0.rb
+++ b/test/rss/test_setup_maker_1.0.rb
@@ -10,7 +10,7 @@ module RSS
class << t
alias_method(:to_s, :iso8601)
end
-
+
@dc_elems = {
:title => "hoge",
:description =>
@@ -39,7 +39,7 @@ module RSS
@content_elems = {
:encoded => "<em>ATTENTION</em>",
}
-
+
@trackback_elems = {
:ping => "http://bar.com/tb.cgi?tb_id=rssplustrackback",
:about => [
@@ -67,7 +67,7 @@ module RSS
},
]
end
-
+
def test_setup_maker_channel
about = "http://hoge.com"
title = "fugafuga"
@@ -79,7 +79,7 @@ module RSS
maker.channel.title = title
maker.channel.link = link
maker.channel.description = description
-
+
@dc_elems.each do |var, value|
maker.channel.__send__("dc_#{var}=", value)
end
@@ -98,7 +98,7 @@ module RSS
end
end
channel = new_rss.channel
-
+
assert_equal(about, channel.about)
assert_equal(title, channel.title)
assert_equal(link, channel.link)
@@ -110,23 +110,23 @@ module RSS
@dc_elems.each do |var, value|
assert_equal(value, channel.__send__("dc_#{var}"))
end
-
+
@sy_elems.each do |var, value|
value = value.to_i if var == :updateFrequency
assert_equal(value, channel.__send__("sy_#{var}"))
end
-
+
end
def test_setup_maker_image
title = "fugafuga"
link = "http://hoge.com"
url = "http://hoge.com/hoge.png"
-
+
rss = RSS::Maker.make("1.0") do |maker|
setup_dummy_channel(maker)
maker.channel.link = link
-
+
maker.image.title = title
maker.image.url = url
@@ -136,7 +136,7 @@ module RSS
setup_dummy_item(maker)
end
-
+
new_rss = RSS::Maker.make("1.0") do |maker|
rss.channel.setup_maker(maker)
rss.image.setup_maker(maker)
@@ -144,7 +144,7 @@ module RSS
item.setup_maker(maker)
end
end
-
+
image = new_rss.image
assert_equal(url, image.about)
assert_equal(url, new_rss.channel.image.resource)
@@ -156,7 +156,7 @@ module RSS
assert_equal(image.__send__("dc_#{var}"), value)
end
end
-
+
def test_setup_maker_textinput
title = "fugafuga"
description = "text hoge fuga"
@@ -165,7 +165,7 @@ module RSS
rss = RSS::Maker.make("1.0") do |maker|
setup_dummy_channel(maker)
-
+
maker.textinput.link = link
maker.textinput.title = title
maker.textinput.description = description
@@ -177,7 +177,7 @@ module RSS
setup_dummy_item(maker)
end
-
+
new_rss = RSS::Maker.make("1.0") do |maker|
rss.channel.setup_maker(maker)
rss.textinput.setup_maker(maker)
@@ -185,7 +185,7 @@ module RSS
item.setup_maker(maker)
end
end
-
+
textinput = new_rss.textinput
assert_equal(link, textinput.about)
assert_equal(link, new_rss.channel.textinput.resource)
@@ -205,10 +205,10 @@ module RSS
description = "text hoge fuga"
item_size = 5
-
+
rss = RSS::Maker.make("1.0") do |maker|
setup_dummy_channel(maker)
-
+
item_size.times do |i|
maker.items.new_item do |item|
item.title = "#{title}#{i}"
@@ -232,7 +232,7 @@ module RSS
end
end
end
-
+
new_rss = RSS::Maker.make("1.0") do |maker|
rss.channel.setup_maker(maker)
@@ -244,7 +244,7 @@ module RSS
end
end
end
-
+
assert_equal(item_size, new_rss.items.size)
new_rss.items.each_with_index do |item, i|
assert_equal("#{link}#{i}", item.about)
@@ -255,11 +255,11 @@ module RSS
@dc_elems.each do |var, value|
assert_equal(item.__send__("dc_#{var}"), value)
end
-
+
@content_elems.each do |var, value|
assert_equal(item.__send__("content_#{var}"), value)
end
-
+
assert_equal(@trackback_elems[:ping], item.trackback_ping)
assert_equal(@trackback_elems[:about].size, item.trackback_abouts.size)
item.trackback_abouts.each_with_index do |about, j|
@@ -274,10 +274,10 @@ module RSS
description = "text hoge fuga"
item_size = 5
-
+
rss = RSS::Maker.make("1.0") do |maker|
setup_dummy_channel(maker)
-
+
item_size.times do |i|
item = RSS::RDF::Item.new("#{link}#{i}")
item.title = "#{title}#{i}"
@@ -296,10 +296,10 @@ module RSS
assert_equal("#{description}#{i}", item.description)
end
-
+
rss = RSS::Maker.make("1.0") do |maker|
setup_dummy_channel(maker)
-
+
item_size.times do |i|
item = RSS::RDF::Item.new("#{link}#{i}")
item.title = "#{title}#{i}"
@@ -322,11 +322,11 @@ module RSS
def test_setup_maker_items_backward_compatibility
test_setup_maker_items(true)
end
-
+
def test_setup_maker
encoding = "EUC-JP"
standalone = true
-
+
href = 'a.xsl'
type = 'text/xsl'
title = 'sample'
@@ -350,11 +350,11 @@ module RSS
setup_dummy_channel(maker)
setup_dummy_item(maker)
end
-
+
new_rss = RSS::Maker.make("1.0") do |maker|
rss.setup_maker(maker)
end
-
+
assert_equal("1.0", new_rss.rss_version)
assert_equal(encoding, new_rss.encoding)
assert_equal(standalone, new_rss.standalone)
@@ -372,7 +372,7 @@ module RSS
def test_setup_maker_full
encoding = "EUC-JP"
standalone = true
-
+
href = 'a.xsl'
type = 'text/xsl'
title = 'sample'
@@ -387,18 +387,18 @@ module RSS
image_title = "fugafuga"
image_url = "http://hoge.com/hoge.png"
-
+
textinput_title = "fugafuga"
textinput_description = "text hoge fuga"
textinput_name = "hoge"
textinput_link = "http://hoge.com"
-
+
item_title = "TITLE"
item_link = "http://hoge.com/"
item_description = "text hoge fuga"
item_size = 5
-
+
rss = RSS::Maker.make("1.0") do |maker|
maker.encoding = encoding
maker.standalone = standalone
@@ -422,13 +422,13 @@ module RSS
@sy_elems.each do |var, value|
maker.channel.__send__("sy_#{var}=", value)
end
-
+
maker.image.title = image_title
maker.image.url = image_url
@dc_elems.each do |var, value|
maker.image.__send__("dc_#{var}=", value)
end
-
+
maker.textinput.link = textinput_link
maker.textinput.title = textinput_title
maker.textinput.description = textinput_description
@@ -436,7 +436,7 @@ module RSS
@dc_elems.each do |var, value|
maker.textinput.__send__("dc_#{var}=", value)
end
-
+
item_size.times do |i|
maker.items.new_item do |item|
item.title = "#{item_title}#{i}"
@@ -462,11 +462,11 @@ module RSS
setup_taxo_topic(maker, @taxo_topic_elems)
end
-
+
new_rss = RSS::Maker.make("1.0") do |maker|
rss.setup_maker(maker)
end
-
+
assert_equal("1.0", new_rss.rss_version)
assert_equal(encoding, new_rss.encoding)
assert_equal(standalone, new_rss.standalone)
@@ -509,7 +509,7 @@ module RSS
@dc_elems.each do |var, value|
assert_equal(image.__send__("dc_#{var}"), value)
end
-
+
textinput = new_rss.textinput
assert_equal(textinput_link, textinput.about)
assert_equal(textinput_link, new_rss.channel.textinput.resource)
@@ -531,11 +531,11 @@ module RSS
@dc_elems.each do |var, value|
assert_equal(item.__send__("dc_#{var}"), value)
end
-
+
@content_elems.each do |var, value|
assert_equal(item.__send__("content_#{var}"), value)
end
-
+
assert_equal(@trackback_elems[:ping], item.trackback_ping)
assert_equal(@trackback_elems[:about].size, item.trackback_abouts.size)
item.trackback_abouts.each_with_index do |about, j|
@@ -545,6 +545,6 @@ module RSS
assert_taxo_topic(@taxo_topic_elems, new_rss)
end
-
+
end
end
diff --git a/test/rss/test_setup_maker_2.0.rb b/test/rss/test_setup_maker_2.0.rb
index 17a066a8a0..8fb727de8d 100644
--- a/test/rss/test_setup_maker_2.0.rb
+++ b/test/rss/test_setup_maker_2.0.rb
@@ -62,7 +62,7 @@ module RSS
new_category.content = category
end
end
-
+
maker.channel.generator = generator
maker.channel.ttl = ttl
end
@@ -71,7 +71,7 @@ module RSS
rss.channel.setup_maker(maker)
end
channel = new_rss.channel
-
+
assert_equal(title, channel.title)
assert_equal(link, channel.link)
assert_equal(description, channel.description)
@@ -90,12 +90,12 @@ module RSS
skipHours.each_with_index do |hour, i|
assert_equal(hour.to_i, channel.skipHours.hours[i].content)
end
-
+
channel.categories.each_with_index do |category, i|
assert_equal(categories[i], category.content)
end
-
+
assert_equal(generator, channel.generator)
assert_equal(ttl.to_i, channel.ttl)
@@ -116,19 +116,19 @@ module RSS
rss = RSS::Maker.make("2.0") do |maker|
setup_dummy_channel(maker)
maker.channel.link = link
-
+
maker.image.title = title
maker.image.url = url
maker.image.width = width
maker.image.height = height
maker.image.description = description
end
-
+
new_rss = RSS::Maker.make("2.0") do |maker|
rss.channel.setup_maker(maker)
rss.image.setup_maker(maker)
end
-
+
image = new_rss.image
assert_equal(title, image.title)
assert_equal(link, image.link)
@@ -137,7 +137,7 @@ module RSS
assert_equal(height.to_i, image.height)
assert_equal(description, image.description)
end
-
+
def test_setup_maker_textinput
title = "fugafuga"
description = "text hoge fuga"
@@ -157,7 +157,7 @@ module RSS
rss.channel.setup_maker(maker)
rss.textinput.setup_maker(maker)
end
-
+
textInput = new_rss.channel.textInput
assert_equal(title, textInput.title)
assert_equal(description, textInput.description)
@@ -175,22 +175,22 @@ module RSS
guid_isPermaLink = "true"
guid_content = "http://inessential.com/2002/09/01.php#a2"
-
+
enclosure_url = "http://www.scripting.com/mp3s/weatherReportSuite.mp3"
enclosure_length = "12216320"
enclosure_type = "audio/mpeg"
source_url = "http://static.userland.com/tomalak/links2.xml"
source_content = "Tomalak's Realm"
-
+
category_domain = "http://www.fool.com/cusips"
category_content = "MSFT"
-
+
item_size = 5
-
+
rss = RSS::Maker.make("2.0") do |maker|
setup_dummy_channel(maker)
-
+
item_size.times do |i|
maker.items.new_item do |item|
item.title = "#{title}#{i}"
@@ -216,7 +216,7 @@ module RSS
end
end
end
-
+
new_rss = RSS::Maker.make("2.0") do |maker|
rss.channel.setup_maker(maker)
@@ -228,7 +228,7 @@ module RSS
end
end
end
-
+
assert_equal(item_size, new_rss.items.size)
new_rss.items.each_with_index do |item, i|
assert_equal("#{title}#{i}", item.title)
@@ -258,11 +258,11 @@ module RSS
def test_setup_maker_items_backward_compatibility
test_setup_maker_items(true)
end
-
+
def test_setup_maker
encoding = "EUC-JP"
standalone = true
-
+
href = 'a.xsl'
type = 'text/xsl'
title = 'sample'
@@ -285,11 +285,11 @@ module RSS
setup_dummy_channel(maker)
end
-
+
new_rss = RSS::Maker.make("2.0") do |maker|
rss.setup_maker(maker)
end
-
+
assert_equal("2.0", new_rss.rss_version)
assert_equal(encoding, new_rss.encoding)
assert_equal(standalone, new_rss.standalone)
@@ -303,6 +303,6 @@ module RSS
assert_equal(charset, xss.charset)
assert_equal(alternate, xss.alternate)
end
-
+
end
end
diff --git a/test/rss/test_setup_maker_atom_feed.rb b/test/rss/test_setup_maker_atom_feed.rb
index 978b3cf123..03d33dbb9c 100644
--- a/test/rss/test_setup_maker_atom_feed.rb
+++ b/test/rss/test_setup_maker_atom_feed.rb
@@ -299,7 +299,7 @@ module RSS
def test_setup_maker
encoding = "EUC-JP"
standalone = true
-
+
href = 'a.xsl'
type = 'text/xsl'
title = 'sample'
diff --git a/test/rss/test_syndication.rb b/test/rss/test_syndication.rb
index 69d6f44464..abd75e905e 100644
--- a/test/rss/test_syndication.rb
+++ b/test/rss/test_syndication.rb
@@ -8,28 +8,28 @@ require "rss/syndication"
module RSS
class TestSyndication < TestCase
-
+
def setup
@prefix = "sy"
@uri = "http://purl.org/rss/1.0/modules/syndication/"
-
+
@parents = %w(channel)
-
+
t = Time.iso8601("2000-01-01T12:00:05+00:00")
class << t
alias_method(:to_s, :iso8601)
end
-
+
@elems = {
:updatePeriod => "hourly",
:updateFrequency => "2",
:updateBase => t,
}
-
+
@sy_nodes = @elems.collect do |name, value|
"<#{@prefix}:#{name}>#{CGI.escapeHTML(value.to_s)}</#{@prefix}:#{name}>"
end.join("\n")
-
+
@rss_source = make_RDF(<<-EOR, {@prefix => @uri})
#{make_channel(@sy_nodes)}
#{make_image()}
@@ -39,13 +39,13 @@ EOR
@rss = Parser.parse(@rss_source)
end
-
+
def test_parser
-
+
assert_nothing_raised do
Parser.parse(@rss_source)
end
-
+
@elems.each do |tag, value|
assert_too_much_tag(tag.to_s, "channel") do
Parser.parse(make_RDF(<<-EOR, {@prefix => @uri}))
@@ -58,20 +58,20 @@ EOR
end
end
-
+
def test_accessor
-
+
t = Time.iso8601("2003-01-01T12:00:23+09:00")
class << t
alias_method(:to_s, :iso8601)
end
-
+
new_value = {
:updatePeriod => "daily",
:updateFrequency => "11",
:updateBase => t,
}
-
+
@elems.each do |name, value|
value = value.to_i if name == :updateFrequency
@parents.each do |parent|
@@ -82,7 +82,7 @@ EOR
assert_equal(new_val, @rss.__send__(parent).__send__("sy_#{name}"))
end
end
-
+
%w(hourly daily weekly monthly yearly).each do |x|
@parents.each do |parent|
assert_nothing_raised do
@@ -90,7 +90,7 @@ EOR
end
end
end
-
+
%w(-2 0.3 -0.4).each do |x|
@parents.each do |parent|
assert_not_available_value("sy:updateBase", x) do
@@ -98,11 +98,11 @@ EOR
end
end
end
-
+
end
def test_to_s
-
+
@elems.each do |name, value|
excepted = "<#{@prefix}:#{name}>#{value}</#{@prefix}:#{name}>"
@parents.each do |parent|
@@ -110,7 +110,7 @@ EOR
@rss.__send__(parent).__send__("sy_#{name}_element"))
end
end
-
+
REXML::Document.new(@rss_source).root.each_element do |parent|
if @parents.include?(parent.name)
parent.each_element do |elem|
diff --git a/test/rss/test_taxonomy.rb b/test/rss/test_taxonomy.rb
index 0370555d87..5109f3d892 100644
--- a/test/rss/test_taxonomy.rb
+++ b/test/rss/test_taxonomy.rb
@@ -8,7 +8,7 @@ require "rss/taxonomy"
module RSS
class TestTaxonomy < TestCase
-
+
def setup
@prefix = "taxo"
@uri = "http://purl.org/rss/1.0/modules/taxonomy/"
@@ -19,9 +19,9 @@ module RSS
@prefix => @uri,
@dc_prefix => @dc_uri,
}
-
+
@topics_parents = %w(channel item)
-
+
@topics_lis = [
"http://meerkat.oreillynet.com/?c=cat23",
"http://meerkat.oreillynet.com/?c=47",
@@ -81,7 +81,7 @@ module RSS
end
rv << "</#{@prefix}:topic>"
end
-
+
@rss_source = make_RDF(<<-EOR, @ns)
#{make_channel(@topics_node)}
#{make_image()}
@@ -97,7 +97,7 @@ EOR
assert_nothing_raised do
Parser.parse(@rss_source)
end
-
+
assert_too_much_tag("topics", "channel") do
Parser.parse(make_RDF(<<-EOR, @ns))
#{make_channel(@topics_node * 2)}
@@ -112,7 +112,7 @@ EOR
EOR
end
end
-
+
def test_accessor
topics = @rss.channel.taxo_topics
assert_equal(@topics_lis.sort,
@@ -136,7 +136,7 @@ EOR
end
end
end
-
+
def test_to_s
@topics_parents.each do |parent|
meth = "taxo_topics_element"
diff --git a/test/rss/test_to_s.rb b/test/rss/test_to_s.rb
index 4b38737bef..66739591ea 100644
--- a/test/rss/test_to_s.rb
+++ b/test/rss/test_to_s.rb
@@ -19,7 +19,7 @@ module RSS
"http://example.com/1",
"http://example.com/2",
]
-
+
setup_xml_declaration_info
setup_xml_stylesheet_infos
setup_channel_info
@@ -57,7 +57,7 @@ module RSS
assert_image10(@image_info, rss.image)
assert_textinput10(@textinput_info, rss.textinput)
end
-
+
def test_to_s_09
rss = RSS::Maker.make("0.91") do |maker|
setup_full(maker)
@@ -79,7 +79,7 @@ module RSS
assert_image09(@image_info, rss.image)
assert_textinput09(@textinput_info, rss.textinput)
end
-
+
def test_to_s_20
rss = RSS::Maker.make("2.0") do |maker|
setup_full(maker)
@@ -101,7 +101,7 @@ module RSS
assert_image20(@image_info, rss.image)
assert_textinput20(@textinput_info, rss.textinput)
end
-
+
private
def setup_xml_declaration_info
@version = "1.0"
@@ -278,13 +278,13 @@ module RSS
"updateBase" => Time.now - 3600,
}
end
-
+
def setup_content_info
@content_info = {
"encoded" => "<p>p</p>",
}
end
-
+
def setup_trackback_info
@trackback_info = {
"ping" => "http://example.com/tb.cgi?tb_id=XXX",
@@ -323,7 +323,7 @@ module RSS
def setup_channel(maker)
channel = maker.channel
info = @channel_info
-
+
%w(about title link description language copyright
managingEditor webMaster rating docs date
lastBuildDate generator ttl).each do |name|
@@ -341,7 +341,7 @@ module RSS
new_hour = skipHours.new_hour
new_hour.content = hour
end
-
+
cloud = channel.cloud
%w(domain port path registerProcedure protocol).each do |name|
cloud.__send__("#{name}=", info["cloud"][name])
@@ -352,7 +352,7 @@ module RSS
category.__send__("#{name}=", info["category"][name])
end
end
-
+
def setup_image(maker)
image = maker.image
info = @image_info
@@ -361,7 +361,7 @@ module RSS
image.__send__("#{name}=", info[name])
end
end
-
+
def setup_items(maker)
items = maker.items
@@ -370,7 +370,7 @@ module RSS
%w(title link description date author comments).each do |name|
item.__send__("#{name}=", info[name])
end
-
+
guid = item.guid
%w(isPermaLink content).each do |name|
guid.__send__("#{name}=", info["guid"][name])
@@ -410,7 +410,7 @@ module RSS
target.__send__("#{prefix}_#{name}=", @content_info[name])
end
end
-
+
def setup_dublin_core(target)
prefix = "dc"
%w(title description creator subject publisher
@@ -419,14 +419,14 @@ module RSS
target.__send__("#{prefix}_#{name}=", @dc_info[name])
end
end
-
+
def setup_syndicate(target)
prefix = "sy"
%w(updatePeriod updateFrequency updateBase).each do |name|
target.__send__("#{prefix}_#{name}=", @sy_info[name])
end
end
-
+
def setup_trackback(target)
target.trackback_ping = @trackback_info["ping"]
@trackback_info["abouts"].each do |about|
@@ -439,7 +439,7 @@ module RSS
def assert_channel10(attrs, channel)
_wrap_assertion do
n_attrs = normalized_attrs(attrs)
-
+
names = %w(about title link description)
assert_attributes(attrs, names, channel)
@@ -458,7 +458,7 @@ module RSS
assert_attributes(attrs, %w(resource), image)
end
end
-
+
def assert_channel10_textinput(attrs, textinput)
_wrap_assertion do
assert_attributes(attrs, %w(resource), textinput)
@@ -506,7 +506,7 @@ module RSS
copyright pubDate lastBuildDate docs
managingEditor webMaster)
assert_attributes(attrs, names, channel)
-
+
%w(skipHours skipDays).each do |name|
value = n_attrs[name]
if value
@@ -525,7 +525,7 @@ module RSS
end
end
end
-
+
def assert_channel09_skipHours(contents, skipHours)
_wrap_assertion do
hours = skipHours.hours
@@ -534,7 +534,7 @@ module RSS
end
end
end
-
+
def assert_image09(attrs, image)
_wrap_assertion do
names = %w(url link title description)
@@ -552,7 +552,7 @@ module RSS
end
end
end
-
+
def assert_textinput09(attrs, textinput)
_wrap_assertion do
names = %w(title description name link)
@@ -564,7 +564,7 @@ module RSS
def assert_channel20(attrs, channel)
_wrap_assertion do
n_attrs = normalized_attrs(attrs)
-
+
names = %w(title link description language copyright
managingEditor webMaster pubDate
lastBuildDate generator docs rating)
@@ -584,11 +584,11 @@ module RSS
def assert_channel20_skipDays(contents, skipDays)
assert_channel09_skipDays(contents, skipDays)
end
-
+
def assert_channel20_skipHours(contents, skipHours)
assert_channel09_skipHours(contents, skipHours)
end
-
+
def assert_channel20_cloud(attrs, cloud)
_wrap_assertion do
names = %w(domain path registerProcedure protocol)
@@ -596,7 +596,7 @@ module RSS
assert_attributes(attrs, names, cloud)
end
end
-
+
def assert_channel20_categories(attrs, categories)
_wrap_assertion do
names = %w(domain content)
@@ -605,7 +605,7 @@ module RSS
end
end
end
-
+
def assert_image20(attrs, image)
_wrap_assertion do
names = %w(url link title description)
@@ -639,20 +639,20 @@ module RSS
assert_attributes(attrs, %w(url content), source)
end
end
-
+
def assert_items20_enclosure(attrs, enclosure)
_wrap_assertion do
names = ["url", ["length", :integer], "type"]
assert_attributes(attrs, names, enclosure)
end
end
-
+
def assert_items20_categories(attrs, categories)
_wrap_assertion do
assert_channel20_categories(attrs, categories)
end
end
-
+
def assert_items20_guid(attrs, guid)
_wrap_assertion do
names = [["isPermaLink", :boolean], ["content"]]
diff --git a/test/rss/test_trackback.rb b/test/rss/test_trackback.rb
index 433e884deb..26812d9010 100644
--- a/test/rss/test_trackback.rb
+++ b/test/rss/test_trackback.rb
@@ -9,26 +9,26 @@ require "rss/trackback"
module RSS
class TestTrackBack < TestCase
-
+
def setup
@prefix = "trackback"
@uri = "http://madskills.com/public/xml/rss/module/trackback/"
-
+
@parents = %w(item)
-
+
@elems = {
:ping => "http://bar.com/tb.cgi?tb_id=rssplustrackback",
:about => "http://foo.com/trackback/tb.cgi?tb_id=20020923",
}
-
+
@content_nodes = @elems.collect do |name, value|
"<#{@prefix}:#{name} rdf:resource=\"#{CGI.escapeHTML(value.to_s)}\"/>"
end.join("\n")
-
+
@content_nodes2 = @elems.collect do |name, value|
"<#{@prefix}:#{name}>#{CGI.escapeHTML(value.to_s)}</#{@prefix}:#{name}>"
end.join("\n")
-
+
@rss_source = make_RDF(<<-EOR, {@prefix => @uri})
#{make_channel()}
#{make_image()}
@@ -77,14 +77,14 @@ EOR
end
end
-
+
def test_accessor
-
+
new_value = {
:ping => "http://baz.com/trackback/tb.cgi?tb_id=20030808",
:about => "http://hoge.com/trackback/tb.cgi?tb_id=90030808",
}
-
+
@elems.each do |name, value|
@parents.each do |parent|
accessor = "#{RSS::TRACKBACK_PREFIX}_#{name}"
@@ -104,11 +104,11 @@ EOR
assert_equal(new_value[name], target20.__send__(accessor))
end
end
-
+
end
def test_to_s
-
+
@elems.each do |name, value|
excepted = %Q!<#{@prefix}:#{name} rdf:resource="#{CGI.escapeHTML(value)}"/>!
@parents.each do |parent|
@@ -117,7 +117,7 @@ EOR
assert_equal(excepted, @rss.__send__(parent).__send__(meth))
end
end
-
+
REXML::Document.new(@rss_source).root.each_element do |parent|
if @parents.include?(parent.name)
parent.each_element do |elem|
@@ -127,9 +127,9 @@ EOR
end
end
end
-
+
end
-
+
end
end
diff --git a/test/rss/test_version.rb b/test/rss/test_version.rb
index 17679012d3..64f6f0482e 100644
--- a/test/rss/test_version.rb
+++ b/test/rss/test_version.rb
@@ -3,7 +3,7 @@ require "rss-testcase"
module RSS
class TestVersion < TestCase
def test_version
- assert_equal("0.2.7", ::RSS::VERSION)
+ assert_equal("0.2.4", ::RSS::VERSION)
end
end
end
diff --git a/test/rss/test_xml-stylesheet.rb b/test/rss/test_xml-stylesheet.rb
index cc19a38287..b946af1294 100644
--- a/test/rss/test_xml-stylesheet.rb
+++ b/test/rss/test_xml-stylesheet.rb
@@ -7,7 +7,7 @@ require "rss/xml-stylesheet"
module RSS
class TestXMLStyleSheet < TestCase
-
+
def test_accessor
[
{:href => "a.xsl", :type => "text/xsl"},
@@ -17,7 +17,7 @@ module RSS
assert_xml_stylesheet_attrs(attrs, XMLStyleSheet.new(attrs))
end
end
-
+
def test_to_s
[
{:href => "a.xsl", :type => "text/xsl"},
@@ -39,7 +39,7 @@ module RSS
assert_xml_stylesheet(target, attrs, XMLStyleSheet.new(contents))
end
end
-
+
def test_bad_alternate
%w(a ___ ??? BAD_ALTERNATE).each do |value|
xss = XMLStyleSheet.new
@@ -53,7 +53,7 @@ module RSS
assert_nil(xss.alternate)
end
end
-
+
def test_parse
[
[{:href => "a.xsl", :type => "text/xsl"},],
@@ -92,7 +92,7 @@ module RSS
end
end
end
-
+
def parse_pi(pi)
/\A\s*<\?(\S+)([^(?:\?>)]+)\?>\s*\z/ =~ pi
target = $1
@@ -103,6 +103,6 @@ module RSS
end
[target, contents]
end
-
+
end
end
diff --git a/test/ruby/allpairs.rb b/test/ruby/allpairs.rb
deleted file mode 100644
index 6cb2729b19..0000000000
--- a/test/ruby/allpairs.rb
+++ /dev/null
@@ -1,103 +0,0 @@
-module AllPairs
- module_function
-
- def make_prime(v)
- return 2 if v < 2
- ary = [true] * (v*2)
- 2.upto(Math.sqrt(ary.length).ceil) {|i|
- return i if ary[i] && v <= i
- (i*2).step(ary.length, i) {|j|
- ary[j] = false
- }
- }
- v.upto(ary.length-1) {|i|
- return i if ary[i]
- }
- raise "[bug] prime not found greater than #{v}"
- end
-
- def make_basic_block(prime)
- prime.times {|i|
- prime.times {|j|
- row = [i]
- 0.upto(prime-1) {|m|
- row << (i*m + j) % prime
- }
- yield row
- }
- }
- end
-
- def combine_block(tbl1, tbl2)
- result = []
- tbl2.each {|row|
- result << row * tbl1.first.length
- }
- tbl1.each_with_index {|row, k|
- next if k == 0
- result << row.map {|i| [i] * tbl2.first.length }.flatten
- }
- result
- end
-
- def make_large_block(v, prime)
- if prime <= v+1
- make_basic_block(v) {|row|
- yield row
- }
- else
- tbl = []
- make_basic_block(v) {|row|
- tbl << row
- }
- tbls = [tbl]
- while tbl.first.length ** 2 < prime
- tbl = combine_block(tbl, tbl)
- tbls << tbl
- end
- tbl1 = tbls.find {|t| prime <= t.first.length * tbl.first.length }
- tbl = combine_block(tbl, tbl1)
- tbl.each {|row|
- yield row
- }
- end
- end
-
- def each_index(*vs)
- n = vs.length
- max_v = vs.max
- prime = make_prime(max_v)
- h = {}
- make_large_block(max_v, n) {|row|
- row = vs.zip(row).map {|v, i| i % v }
- next if h[row]
- h[row] = true
- yield row
- }
- end
-
- # generate all pairs test.
- def each(*args)
- args.map! {|a| a.to_a }
- each_index(*args.map {|a| a.length}) {|is|
- yield is.zip(args).map {|i, a| a[i] }
- }
- end
-
- # generate all combination in cartesian product. (not all-pairs test)
- def exhaustive_each(*args)
- args = args.map {|a| a.to_a }
- i = 0
- while true
- n = i
- as = []
- args.reverse_each {|a|
- n, m = n.divmod(a.length)
- as.unshift a[m]
- }
- break if 0 < n
- yield as
- i += 1
- end
- end
-end
diff --git a/test/ruby/beginmainend.rb b/test/ruby/beginmainend.rb
index 6cdfb15ea6..646140dd22 100644
--- a/test/ruby/beginmainend.rb
+++ b/test/ruby/beginmainend.rb
@@ -16,7 +16,7 @@ BEGIN {
}
# for scope check
-#raise if defined?(local_begin1)
+raise if defined?(local_begin1)
raise unless defined?($global_begin1)
raise unless defined?(::ConstBegin1)
local_for_end2 = "e2"
diff --git a/test/ruby/enc/test_big5.rb b/test/ruby/enc/test_big5.rb
deleted file mode 100644
index e8fe0270a8..0000000000
--- a/test/ruby/enc/test_big5.rb
+++ /dev/null
@@ -1,28 +0,0 @@
-require "test/unit"
-
-class TestBig5 < Test::Unit::TestCase
- def s(s)
- s.force_encoding("big5")
- end
-
- def test_mbc_enc_len
- assert_equal(1, s("\xa1\xa1").size)
- end
-
- def test_mbc_to_code
- assert_equal(0xa1a1, s("\xa1\xa1").ord)
- end
-
- def test_code_to_mbc
- assert_equal(s("\xa1\xa1"), 0xa1a1.chr("big5"))
- end
-
- def test_mbc_case_fold
- r = Regexp.new(s("(\xa1\xa1)\\1"), "i")
- assert_match(r, s("\xa1\xa1\xa1\xa1"))
- end
-
- def test_left_adjust_char_head
- assert_equal(s("\xa1\xa1"), s("\xa1\xa1\xa1\xa1").chop)
- end
-end
diff --git a/test/ruby/enc/test_cp949.rb b/test/ruby/enc/test_cp949.rb
deleted file mode 100644
index e675c7b80c..0000000000
--- a/test/ruby/enc/test_cp949.rb
+++ /dev/null
@@ -1,28 +0,0 @@
-require "test/unit"
-
-class TestCP949 < Test::Unit::TestCase
- def s(s)
- s.force_encoding("cp949")
- end
-
- def test_mbc_enc_len
- assert_equal(1, s("\xa1\xa1").size)
- end
-
- def test_mbc_to_code
- assert_equal(0xa1a1, s("\xa1\xa1").ord)
- end
-
- def test_code_to_mbc
- assert_equal(s("\xa1\xa1"), 0xa1a1.chr("cp949"))
- end
-
- def test_mbc_case_fold
- r = Regexp.new(s("(\xa1\xa1)\\1"), "i")
- assert_match(r, s("\xa1\xa1\xa1\xa1"))
- end
-
- def test_left_adjust_char_head
- assert_equal(s("\xa1\xa1"), s("\xa1\xa1\xa1\xa1").chop)
- end
-end
diff --git a/test/ruby/enc/test_euc_jp.rb b/test/ruby/enc/test_euc_jp.rb
deleted file mode 100644
index 1ccc55ccb9..0000000000
--- a/test/ruby/enc/test_euc_jp.rb
+++ /dev/null
@@ -1,24 +0,0 @@
-# vim: set fileencoding=euc-jp
-
-require "test/unit"
-
-class TestEUC_JP < Test::Unit::TestCase
- def test_mbc_case_fold
- assert_match(/()(a)\1\2/i, "aA")
- assert_no_match(/()(a)\1\2/i, "aA")
- end
-
- def test_property
- assert_match(/{0}\p{Hiragana}{4}/, "Ҥ餬")
- assert_no_match(/{0}\p{Hiragana}{4}/, "")
- assert_no_match(/{0}\p{Hiragana}{4}/, "")
- assert_no_match(/{0}\p{Katakana}{4}/, "Ҥ餬")
- assert_match(/{0}\p{Katakana}{4}/, "")
- assert_no_match(/{0}\p{Katakana}{4}/, "")
- assert_raise(RegexpError) { Regexp.new('{0}\p{foobarbaz}') }
- end
-
- def test_charboundary
- assert_nil(/\xA2\xA2/ =~ "\xA1\xA2\xA2\xA3")
- end
-end
diff --git a/test/ruby/enc/test_euc_kr.rb b/test/ruby/enc/test_euc_kr.rb
deleted file mode 100644
index 087bc795f7..0000000000
--- a/test/ruby/enc/test_euc_kr.rb
+++ /dev/null
@@ -1,28 +0,0 @@
-require "test/unit"
-
-class TestEucKr < Test::Unit::TestCase
- def s(s)
- s.force_encoding("euc-kr")
- end
-
- def test_mbc_enc_len
- assert_equal(1, s("\xa1\xa1").size)
- end
-
- def test_mbc_to_code
- assert_equal(0xa1a1, s("\xa1\xa1").ord)
- end
-
- def test_code_to_mbc
- assert_equal(s("\xa1\xa1"), 0xa1a1.chr("euc-kr"))
- end
-
- def test_mbc_case_fold
- r = Regexp.new(s("(\xa1\xa1)\\1"), "i")
- assert_match(r, s("\xa1\xa1\xa1\xa1"))
- end
-
- def test_left_adjust_char_head
- assert_equal(s("\xa1\xa1"), s("\xa1\xa1\xa1\xa1").chop)
- end
-end
diff --git a/test/ruby/enc/test_euc_tw.rb b/test/ruby/enc/test_euc_tw.rb
deleted file mode 100644
index f36d86b088..0000000000
--- a/test/ruby/enc/test_euc_tw.rb
+++ /dev/null
@@ -1,28 +0,0 @@
-require "test/unit"
-
-class TestEucTw < Test::Unit::TestCase
- def s(s)
- s.force_encoding("euc-tw")
- end
-
- def test_mbc_enc_len
- assert_equal(1, s("\xa1\xa1").size)
- end
-
- def test_mbc_to_code
- assert_equal(0xa1a1, s("\xa1\xa1").ord)
- end
-
- def test_code_to_mbc
- assert_equal(s("\xa1\xa1"), 0xa1a1.chr("euc-tw"))
- end
-
- def test_mbc_case_fold
- r = Regexp.new(s("(\xa1\xa1)\\1"), "i")
- assert_match(r, s("\xa1\xa1\xa1\xa1"))
- end
-
- def test_left_adjust_char_head
- assert_equal(s("\xa1\xa1"), s("\xa1\xa1\xa1\xa1").chop)
- end
-end
diff --git a/test/ruby/enc/test_gb18030.rb b/test/ruby/enc/test_gb18030.rb
deleted file mode 100644
index a33a9eb28e..0000000000
--- a/test/ruby/enc/test_gb18030.rb
+++ /dev/null
@@ -1,125 +0,0 @@
-require "test/unit"
-
-class TestGB18030 < Test::Unit::TestCase
- def s(s)
- s.force_encoding("gb18030")
- end
-
- def test_mbc_enc_len
- assert_equal(1, s("\x81\x40").size)
- assert_equal(1, s("\x81\x30\x81\x30").size)
- end
-
- def test_mbc_to_code
- assert_equal(0x8140, s("\x81\x40").ord)
- end
-
- def test_code_to_mbc
- assert_equal(s("\x81\x40"), 0x8140.chr("gb18030"))
- end
-
- def test_mbc_case_fold
- r = Regexp.new(s("(\x81\x40)\\1"), "i")
- assert_match(r, s("\x81\x40\x81\x40"))
- end
-
- def scheck(c, i)
- assert_equal(s(c.reverse.take(c.size - i).join), s(c.reverse.join).chop)
- end
-
- def fcheck(c)
- assert_raise(ArgumentError) { s(c.reverse.join).chop }
- end
-
- def test_left_adjust_char_head
- # C1: 00-2f, 3a-3f, 7f, ff
- # C2: 40-7e, 80
- # C4: 30-39
- # CM: 81-fe
- c1 = "\x2f"
- c2 = "\x40"
- c4 = "\x30"
- cm = "\x81"
-
- # S_START-c1
- # S_START-c2-S_one_C2-0
- # S_START-c2-S_one_C2-c1
- # S_START-c2-S_one_C2-cm-S_odd_CM_one_CX-c1
- # S_START-c2-S_one_C2-cm-S_odd_CM_one_CX-cm-S_even_CM_one_CX-c1
- # S_START-c2-S_one_C2-cm-S_odd_CM_one_CX-cm-S_even_CM_one_CX-cm-S_odd_CM_one_CX(rec)
- # S_START-c4-S_one_C4-c1
- # S_START-c4-S_one_C4-cm-S_one_CMC4-c1
- # S_START-c4-S_one_C4-cm-S_one_CMC4-c4-S_one_C4_odd_CMC4-c1
- # S_START-c4-S_one_C4-cm-S_one_CMC4-c4-S_one_C4_odd_CMC4-cm-S_even_CMC4-c1
- # S_START-c4-S_one_C4-cm-S_one_CMC4-c4-S_one_C4_odd_CMC4-cm-S_even_CMC4-c4-S_one_C4_even_CMC4-c1
- # S_START-c4-S_one_C4-cm-S_one_CMC4-c4-S_one_C4_odd_CMC4-cm-S_even_CMC4-c4-S_one_C4_even_CMC4-cm-S_odd_CMC4-c1
- # S_START-c4-S_one_C4-cm-S_one_CMC4-c4-S_one_C4_odd_CMC4-cm-S_even_CMC4-c4-S_one_C4_even_CMC4-cm-S_odd_CMC4-c4-S_one_C4_odd_CMC4(rec)
- # S_START-c4-S_one_C4-cm-S_one_CMC4-c4-S_one_C4_odd_CMC4-cm-S_even_CMC4-c4-S_one_C4_even_CMC4-cm-S_odd_CMC4-cm-S_odd_CM_odd_CMC4-c1
- # S_START-c4-S_one_C4-cm-S_one_CMC4-c4-S_one_C4_odd_CMC4-cm-S_even_CMC4-c4-S_one_C4_even_CMC4-cm-S_odd_CMC4-cm-S_odd_CM_odd_CMC4-cm-S_even_CM_odd_CMC4-c1
- # S_START-c4-S_one_C4-cm-S_one_CMC4-c4-S_one_C4_odd_CMC4-cm-S_even_CMC4-c4-S_one_C4_even_CMC4-cm-S_odd_CMC4-cm-S_odd_CM_odd_CMC4-cm-S_even_CM_odd_CMC4-cm-S_odd_CM_odd_CMC4(rec)
- # S_START-c4-S_one_C4-cm-S_one_CMC4-c4-S_one_C4_odd_CMC4-cm-S_even_CMC4-cm-S_odd_CM_even_CMC4-c1
- # S_START-c4-S_one_C4-cm-S_one_CMC4-c4-S_one_C4_odd_CMC4-cm-S_even_CMC4-cm-S_odd_CM_even_CMC4-cm-S_even_CM_even_CMC4-c1
- # S_START-c4-S_one_C4-cm-S_one_CMC4-c4-S_one_C4_odd_CMC4-cm-S_even_CMC4-cm-S_odd_CM_even_CMC4-cm-S_even_CM_even_CMC4-cm-S_odd_CM_even_CMC4(rec)
- # S_START-c4-S_one_C4-cm-S_one_CMC4-cm-S_even_CM_one_CX(rec)
- # S_START-cm-S_one_CM-c1
- # S_START-cm-S_one_CM-c4-S_odd_C4CM-c1
- # S_START-cm-S_one_CM-c4-S_odd_C4CM-cm-S_one_CM_odd_C4CM-c1
- # S_START-cm-S_one_CM-c4-S_odd_C4CM-cm-S_one_CM_odd_C4CM-c4-S_even_C4CM-c1
- # S_START-cm-S_one_CM-c4-S_odd_C4CM-cm-S_one_CM_odd_C4CM-c4-S_even_C4CM-cm-S_one_CM_even_C4CM-c1
- # S_START-cm-S_one_CM-c4-S_odd_C4CM-cm-S_one_CM_odd_C4CM-c4-S_even_C4CM-cm-S_one_CM_even_C4CM-c4-S_odd_C4CM(rec)
- # S_START-cm-S_one_CM-c4-S_odd_C4CM-cm-S_one_CM_odd_C4CM-c4-S_even_C4CM-cm-S_one_CM_even_C4CM-cm-S_even_CM_even_C4CM-c1
- # S_START-cm-S_one_CM-c4-S_odd_C4CM-cm-S_one_CM_odd_C4CM-c4-S_even_C4CM-cm-S_one_CM_even_C4CM-cm-S_even_CM_even_C4CM-cm-S_odd_CM_even_C4CM-c1
- # S_START-cm-S_one_CM-c4-S_odd_C4CM-cm-S_one_CM_odd_C4CM-c4-S_even_C4CM-cm-S_one_CM_even_C4CM-cm-S_even_CM_even_C4CM-cm-S_odd_CM_even_C4CM-cm-S_even_CM_even_C4CM(rec)
- # S_START-cm-S_one_CM-c4-S_odd_C4CM-cm-S_one_CM_odd_C4CM-cm-S_even_CM_odd_C4CM-c1
- # S_START-cm-S_one_CM-c4-S_odd_C4CM-cm-S_one_CM_odd_C4CM-cm-S_even_CM_odd_C4CM-cm-S_odd_CM_odd_C4CM-c1
- # S_START-cm-S_one_CM-c4-S_odd_C4CM-cm-S_one_CM_odd_C4CM-cm-S_even_CM_odd_C4CM-cm-S_odd_CM_odd_C4CM-cm-S_even_CM_odd_C4CM(rec)
- # S_START-cm-S_one_CM-cm-S_odd_CM_one_CX(rec)
-
- scheck([c1], 1)
- scheck([c2], 1)
- scheck([c2, c1], 1)
- scheck([c2, cm, c1], 2)
- scheck([c2, cm, cm, c1], 1)
- scheck([c2, cm, cm, cm], 2)
- scheck([c4], 1)
- scheck([c4, c1], 1)
- scheck([c4, cm], 2)
- fcheck([c4, cm, c1])
- fcheck([c4, cm, c4, c1])
- scheck([c4, cm, c4, cm], 4)
- scheck([c4, cm, c4, cm, c1], 4)
- scheck([c4, cm, c4, cm, c4], 4)
- scheck([c4, cm, c4, cm, c4, c1], 4)
- fcheck([c4, cm, c4, cm, c4, cm])
- fcheck([c4, cm, c4, cm, c4, cm, c1])
- fcheck([c4, cm, c4, cm, c4, cm, c4])
- scheck([c4, cm, c4, cm, c4, cm, cm, c1], 4)
- fcheck([c4, cm, c4, cm, c4, cm, cm, cm])
- fcheck([c4, cm, c4, cm, c4, cm, cm, cm, c1])
- scheck([c4, cm, c4, cm, c4, cm, cm, cm, cm], 4)
- fcheck([c4, cm, c4, cm, cm, c1])
- scheck([c4, cm, c4, cm, cm, cm], 4)
- scheck([c4, cm, c4, cm, cm, cm, c1], 4)
- fcheck([c4, cm, c4, cm, cm, cm, cm])
- scheck([c4, cm, cm], 1)
- scheck([cm], 1)
- fcheck([cm, c1])
- fcheck([cm, c4, c1])
- scheck([cm, c4, cm], 3)
- fcheck([cm, c4, cm, c1])
- fcheck([cm, c4, cm, c4])
- fcheck([cm, c4, cm, c4, c1])
- fcheck([cm, c4, cm, c4, cm])
- fcheck([cm, c4, cm, c4, cm, c1])
- fcheck([cm, c4, cm, c4, cm, c4])
- fcheck([cm, c4, cm, c4, cm, cm, c1])
- fcheck([cm, c4, cm, c4, cm, cm, cm])
- fcheck([cm, c4, cm, c4, cm, cm, cm, c1])
- fcheck([cm, c4, cm, c4, cm, cm, cm, cm])
- fcheck([cm, c4, cm, cm, c1])
- fcheck([cm, c4, cm, cm, cm])
- fcheck([cm, c4, cm, cm, cm, c1])
- fcheck([cm, c4, cm, cm, cm, cm])
- scheck([cm, cm], 2)
- end
-end
diff --git a/test/ruby/enc/test_gbk.rb b/test/ruby/enc/test_gbk.rb
deleted file mode 100644
index d6dc5d6d1b..0000000000
--- a/test/ruby/enc/test_gbk.rb
+++ /dev/null
@@ -1,28 +0,0 @@
-require "test/unit"
-
-class TestGBK < Test::Unit::TestCase
- def s(s)
- s.force_encoding("gbk")
- end
-
- def test_mbc_enc_len
- assert_equal(1, s("\x81\x40").size)
- end
-
- def test_mbc_to_code
- assert_equal(0x8140, s("\x81\x40").ord)
- end
-
- def test_code_to_mbc
- assert_equal(s("\x81\x40"), 0x8140.chr("gbk"))
- end
-
- def test_mbc_case_fold
- r = Regexp.new(s("(\x81\x40)\\1"), "i")
- assert_match(r, s("\x81\x40\x81\x40"))
- end
-
- def test_left_adjust_char_head
- assert_equal(s("\x81\x40"), s("\x81\x40\x81\x40").chop)
- end
-end
diff --git a/test/ruby/enc/test_iso_8859.rb b/test/ruby/enc/test_iso_8859.rb
deleted file mode 100644
index 64cc7cd76d..0000000000
--- a/test/ruby/enc/test_iso_8859.rb
+++ /dev/null
@@ -1,163 +0,0 @@
-require 'test/unit'
-
-class TestISO8859 < Test::Unit::TestCase
- ASSERTS = %q(
- assert_match(/^(\xdf)\1$/i, "\xdf\xdf")
- assert_match(/^(\xdf)\1$/i, "ssss")
- # assert_match(/^(\xdf)\1$/i, "\xdfss") # this must be bug...
- assert_match(/^[\xdfz]+$/i, "sszzsszz")
- assert_match(/^SS$/i, "\xdf")
- assert_match(/^Ss$/i, "\xdf")
- ((0xc0..0xde).to_a - [0xd7]).each do |c|
- c1 = c.chr("ENCODING")
- c2 = (c + 0x20).chr("ENCODING")
- assert_match(/^(#{ c1 })\1$/i, c2 + c1)
- assert_match(/^(#{ c2 })\1$/i, c1 + c2)
- assert_match(/^[#{ c1 }]+$/i, c2 + c1)
- assert_match(/^[#{ c2 }]+$/i, c1 + c2)
- end
- assert_match(/^\xff$/i, "\xff")
- )
-
- def test_iso_8859_1
- eval("# encoding: iso8859-1\n" + ASSERTS.gsub(/ENCODING/m, "iso8859-1"))
- end
-
- def test_iso_8859_2
- eval("# encoding: iso8859-2\n" + ASSERTS.gsub(/ENCODING/m, "iso8859-2"))
- end
-
- def test_iso_8859_3
- eval(%q(# encoding: iso8859-3
- assert_match(/^(\xdf)\1$/i, "\xdf\xdf")
- assert_match(/^(\xdf)\1$/i, "ssss")
- assert_match(/^[\xdfz]+$/i, "sszzsszz")
- assert_match(/^SS$/i, "\xdf")
- assert_match(/^Ss$/i, "\xdf")
- [0xa1, 0xa6, *(0xa9..0xac), 0xaf].each do |c|
- c1 = c.chr("iso8859-3")
- c2 = (c + 0x10).chr("iso8859-3")
- assert_match(/^(#{ c1 })\1$/i, c2 + c1)
- assert_match(/^(#{ c2 })\1$/i, c1 + c2)
- assert_match(/^[#{ c1 }]+$/i, c2 + c1)
- assert_match(/^[#{ c2 }]+$/i, c1 + c2)
- end
- ([*(0xc0..0xde)] - [0xc3, 0xd0, 0xd7]).each do |c|
- c1 = c.chr("iso8859-3")
- c2 = (c + 0x20).chr("iso8859-3")
- assert_match(/^(#{ c1 })\1$/i, c2 + c1)
- assert_match(/^(#{ c2 })\1$/i, c1 + c2)
- assert_match(/^[#{ c1 }]+$/i, c2 + c1)
- assert_match(/^[#{ c2 }]+$/i, c1 + c2)
- end
- ))
- end
-
- def test_iso_8859_4
- eval("# encoding: iso8859-4\n" + ASSERTS.gsub(/ENCODING/m, "iso8859-4"))
- end
-
- def test_iso_8859_5
- eval(%q(# encoding: iso8859-5
- (0xb0..0xcf).each do |c|
- c1 = c.chr("iso8859-5")
- c2 = (c + 0x20).chr("iso8859-5")
- assert_match(/^(#{ c1 })\1$/i, c2 + c1)
- assert_match(/^(#{ c2 })\1$/i, c1 + c2)
- assert_match(/^[#{ c1 }]+$/i, c2 + c1)
- assert_match(/^[#{ c2 }]+$/i, c1 + c2)
- end
- ((0xa1..0xaf).to_a - [0xad]).each do |c|
- c1 = c.chr("iso8859-5")
- c2 = (c + 0x50).chr("iso8859-5")
- assert_match(/^(#{ c1 })\1$/i, c2 + c1)
- assert_match(/^(#{ c2 })\1$/i, c1 + c2)
- assert_match(/^[#{ c1 }]+$/i, c2 + c1)
- assert_match(/^[#{ c2 }]+$/i, c1 + c2)
- end
- ))
- end
-
- def test_iso_8859_6
- eval(%q(# encoding: iso8859-6
- [0xa4, 0xac, 0xbb, 0xbf, *(0xc1..0xda), *(0xe0..0xf2)].each do |c|
- c1 = c.chr("iso8859-6")
- assert_match(/^(#{ c1 })\1$/i, c1 * 2)
- end
- ))
- end
-
- def test_iso_8859_7
- eval(%q(# encoding: iso8859-7
- ((0xa0..0xfe).to_a - [0xae, 0xd2]).each do |c|
- c1 = c.chr("iso8859-7")
- assert_match(/^(#{ c1 })\1$/i, c1 * 2)
- end
- ((0xc1..0xd9).to_a - [0xd2]).each do |c|
- c1 = c.chr("iso8859-7")
- c2 = (c + 0x20).chr("iso8859-7")
- assert_match(/^(#{ c1 })\1$/i, c2 + c1)
- assert_match(/^(#{ c2 })\1$/i, c1 + c2)
- assert_match(/^[#{ c1 }]+$/i, c2 + c1)
- assert_match(/^[#{ c2 }]+$/i, c1 + c2)
- end
- ))
- end
-
- def test_iso_8859_8
- eval(%q(# encoding: iso8859-8
- [0xa0, *(0xa2..0xbe), *(0xdf..0xfa), 0xfc, 0xfd].each do |c|
- c1 = c.chr("iso8859-8")
- assert_match(/^(#{ c1 })\1$/i, c1 * 2)
- end
- ))
- end
-
- def test_iso_8859_9
- eval(%q(# encoding: iso8859-9
- assert_match(/^(\xdf)\1$/i, "\xdf\xdf")
- assert_match(/^(\xdf)\1$/i, "ssss")
- assert_match(/^[\xdfz]+$/i, "sszzsszz")
- assert_match(/^SS$/i, "\xdf")
- assert_match(/^Ss$/i, "\xdf")
- ([*(0xc0..0xdc)] - [0xd7]).each do |c|
- c1 = c.chr("iso8859-9")
- c2 = (c + 0x20).chr("iso8859-9")
- assert_match(/^(#{ c1 })\1$/i, c2 + c1)
- assert_match(/^(#{ c2 })\1$/i, c1 + c2)
- assert_match(/^[#{ c1 }]+$/i, c2 + c1)
- assert_match(/^[#{ c2 }]+$/i, c1 + c2)
- end
- ))
- end
-
- def test_iso_8859_10
- eval("# encoding: iso8859-10\n" + ASSERTS.gsub(/ENCODING/m, "iso8859-10"))
- end
-
- def test_iso_8859_11
- eval(%q(# encoding: iso8859-11
- [*(0xa0..0xda), *(0xdf..0xfb)].each do |c|
- c1 = c.chr("iso8859-11")
- assert_match(/^(#{ c1 })\1$/i, c1 * 2)
- end
- ))
- end
-
- def test_iso_8859_13
- eval("# encoding: iso8859-13\n" + ASSERTS.gsub(/ENCODING/m, "iso8859-13"))
- end
-
- def test_iso_8859_14
- eval("# encoding: iso8859-14\n" + ASSERTS.gsub(/ENCODING/m, "iso8859-14"))
- end
-
- def test_iso_8859_15
- eval("# encoding: iso8859-15\n" + ASSERTS.gsub(/ENCODING/m, "iso8859-15"))
- end
-
- def test_iso_8859_16
- eval("# encoding: iso8859-16\n" + ASSERTS.gsub(/ENCODING/m, "iso8859-16"))
- end
-end
-
diff --git a/test/ruby/enc/test_koi8.rb b/test/ruby/enc/test_koi8.rb
deleted file mode 100644
index ce2d8925ea..0000000000
--- a/test/ruby/enc/test_koi8.rb
+++ /dev/null
@@ -1,22 +0,0 @@
-require "test/unit"
-
-class TestKOI8 < Test::Unit::TestCase
- ASSERTS = %q(
- (0xc0..0xdf).each do |c|
- c1 = c.chr("ENCODING")
- c2 = (c + 0x20).chr("ENCODING")
- assert_match(/^(#{ c1 })\1$/i, c2 + c1)
- assert_match(/^(#{ c2 })\1$/i, c1 + c2)
- assert_match(/^[#{ c1 }]+$/i, c2 + c1)
- assert_match(/^[#{ c2 }]+$/i, c1 + c2)
- end
- )
-
- def test_koi8_r
- eval("# encoding: koi8-r\n" + ASSERTS.gsub("ENCODING", "koi8-r"))
- end
-
- def test_koi8_u
- eval("# encoding: koi8-u\n" + ASSERTS.gsub("ENCODING", "koi8-u"))
- end
-end
diff --git a/test/ruby/enc/test_shift_jis.rb b/test/ruby/enc/test_shift_jis.rb
deleted file mode 100644
index f81cb7801c..0000000000
--- a/test/ruby/enc/test_shift_jis.rb
+++ /dev/null
@@ -1,27 +0,0 @@
-# vim: set fileencoding=shift_jis
-
-require "test/unit"
-
-class TestShiftJIS < Test::Unit::TestCase
- def test_mbc_case_fold
- assert_match(/()(a)\1\2/i, "aA")
- assert_no_match(/()(a)\1\2/i, "a`A")
- end
-
- def test_property
- assert_match(/{0}\p{Hiragana}{4}/, "Ђ炪")
- assert_no_match(/{0}\p{Hiragana}{4}/, "J^Ji")
- assert_no_match(/{0}\p{Hiragana}{4}/, "")
- assert_no_match(/{0}\p{Katakana}{4}/, "Ђ炪")
- assert_match(/{0}\p{Katakana}{4}/, "J^Ji")
- assert_no_match(/{0}\p{Katakana}{4}/, "")
- assert_raise(RegexpError) { Regexp.new('{0}\p{foobarbaz}') }
- end
-
- def test_code_to_mbclen
- s = ""
- s << 0x82a9
- assert_equal("", s)
- assert_raise(ArgumentError) { s << 0x82 }
- end
-end
diff --git a/test/ruby/enc/test_utf16.rb b/test/ruby/enc/test_utf16.rb
deleted file mode 100644
index 52850e6376..0000000000
--- a/test/ruby/enc/test_utf16.rb
+++ /dev/null
@@ -1,384 +0,0 @@
-require 'test/unit'
-
-class TestUTF16 < Test::Unit::TestCase
- def encdump(obj)
- case obj
- when String
- d = obj.dump
- if /\.force_encoding\("[A-Za-z0-9.:_+-]*"\)\z/ =~ d
- d
- else
- "#{d}.force_encoding(#{obj.encoding.name.dump})"
- end
- when Regexp
- "Regexp.new(#{encdump(obj.source)}, #{obj.options})"
- else
- raise Argument, "unexpected: #{obj.inspect}"
- end
- end
-
- def enccall(recv, meth, *args)
- desc = ''
- if String === recv
- desc << encdump(recv)
- else
- desc << recv.inspect
- end
- desc << '.' << meth.to_s
- if !args.empty?
- desc << '('
- args.each_with_index {|a, i|
- desc << ',' if 0 < i
- if String === a
- desc << encdump(a)
- else
- desc << a.inspect
- end
- }
- desc << ')'
- end
- result = nil
- assert_nothing_raised(desc) {
- result = recv.send(meth, *args)
- }
- result
- end
-
- def assert_str_equal(expected, actual, message=nil)
- full_message = build_message(message, <<EOT)
-#{encdump expected} expected but not equal to
-#{encdump actual}.
-EOT
- assert_block(full_message) { expected == actual }
- end
-
- # tests start
-
- def test_utf16be_valid_encoding
- [
- "\x00\x00",
- "\xd7\xff",
- "\xd8\x00\xdc\x00",
- "\xdb\xff\xdf\xff",
- "\xe0\x00",
- "\xff\xff",
- ].each {|s|
- s.force_encoding("utf-16be")
- assert_equal(true, s.valid_encoding?, "#{encdump s}.valid_encoding?")
- }
- [
- "\x00",
- "\xd7",
- "\xd8\x00",
- "\xd8\x00\xd8\x00",
- "\xdc\x00",
- "\xdc\x00\xd8\x00",
- "\xdc\x00\xdc\x00",
- "\xe0",
- "\xff",
- ].each {|s|
- s.force_encoding("utf-16be")
- assert_equal(false, s.valid_encoding?, "#{encdump s}.valid_encoding?")
- }
- end
-
- def test_utf16le_valid_encoding
- [
- "\x00\x00",
- "\xff\xd7",
- "\x00\xd8\x00\xdc",
- "\xff\xdb\xff\xdf",
- "\x00\xe0",
- "\xff\xff",
- ].each {|s|
- s.force_encoding("utf-16le")
- assert_equal(true, s.valid_encoding?, "#{encdump s}.valid_encoding?")
- }
- [
- "\x00",
- "\xd7",
- "\x00\xd8",
- "\x00\xd8\x00\xd8",
- "\x00\xdc",
- "\x00\xdc\x00\xd8",
- "\x00\xdc\x00\xdc",
- "\xe0",
- "\xff",
- ].each {|s|
- s.force_encoding("utf-16le")
- assert_equal(false, s.valid_encoding?, "#{encdump s}.valid_encoding?")
- }
- end
-
- def test_strftime
- s = "aa".force_encoding("utf-16be")
- assert_raise(ArgumentError, "Time.now.strftime(#{encdump s})") { Time.now.strftime(s) }
- end
-
- def test_intern
- s = "aaaa".force_encoding("utf-16be")
- assert_equal(s.encoding, s.intern.to_s.encoding, "#{encdump s}.intern.to_s.encoding")
- end
-
- def test_sym_eq
- s = "aa".force_encoding("utf-16le")
- assert(s.intern != :aa, "#{encdump s}.intern != :aa")
- end
-
- def test_compatible
- s1 = "aa".force_encoding("utf-16be")
- s2 = "z".force_encoding("us-ascii")
- assert_nil(Encoding.compatible?(s1, s2), "Encoding.compatible?(#{encdump s1}, #{encdump s2})")
- end
-
- def test_casecmp
- s1 = "aa".force_encoding("utf-16be")
- s2 = "AA"
- assert_not_equal(0, s1.casecmp(s2), "#{encdump s1}.casecmp(#{encdump s2})")
- end
-
- def test_end_with
- s1 = "ab".force_encoding("utf-16be")
- s2 = "b".force_encoding("utf-16be")
- assert_equal(false, s1.end_with?(s2), "#{encdump s1}.end_with?(#{encdump s2})")
- end
-
- def test_hex
- assert_raise(Encoding::CompatibilityError) {
- "ff".encode("utf-16le").hex
- }
- assert_raise(Encoding::CompatibilityError) {
- "ff".encode("utf-16be").hex
- }
- end
-
- def test_oct
- assert_raise(Encoding::CompatibilityError) {
- "77".encode("utf-16le").oct
- }
- assert_raise(Encoding::CompatibilityError) {
- "77".encode("utf-16be").oct
- }
- end
-
- def test_count
- s1 = "aa".force_encoding("utf-16be")
- s2 = "aa"
- assert_raise(Encoding::CompatibilityError, "#{encdump s1}.count(#{encdump s2})") {
- s1.count(s2)
- }
- end
-
- def test_plus
- s1 = "a".force_encoding("us-ascii")
- s2 = "aa".force_encoding("utf-16be")
- assert_raise(Encoding::CompatibilityError, "#{encdump s1} + #{encdump s2}") {
- s1 + s2
- }
- end
-
- def test_encoding_find
- assert_raise(ArgumentError) {
- Encoding.find("utf-8".force_encoding("utf-16be"))
- }
- end
-
- def test_interpolation
- s = "aa".force_encoding("utf-16be")
- assert_raise(Encoding::CompatibilityError, "\"a\#{#{encdump s}}\"") {
- "a#{s}"
- }
- end
-
- def test_slice!
- enccall("aa".force_encoding("UTF-16BE"), :slice!, -1)
- end
-
- def test_plus_empty1
- s1 = ""
- s2 = "aa".force_encoding("utf-16be")
- assert_nothing_raised("#{encdump s1} << #{encdump s2}") {
- s1 + s2
- }
- end
-
- def test_plus_empty2
- s1 = "aa"
- s2 = "".force_encoding("utf-16be")
- assert_nothing_raised("#{encdump s1} << #{encdump s2}") {
- s1 + s2
- }
- end
-
- def test_plus_nonempty
- s1 = "aa"
- s2 = "bb".force_encoding("utf-16be")
- assert_raise(Encoding::CompatibilityError, "#{encdump s1} << #{encdump s2}") {
- s1 + s2
- }
- end
-
- def test_concat_empty1
- s1 = ""
- s2 = "aa".force_encoding("utf-16be")
- assert_nothing_raised("#{encdump s1} << #{encdump s2}") {
- s1 << s2
- }
- end
-
- def test_concat_empty2
- s1 = "aa"
- s2 = "".force_encoding("utf-16be")
- assert_nothing_raised("#{encdump s1} << #{encdump s2}") {
- s1 << s2
- }
- end
-
- def test_concat_nonempty
- s1 = "aa"
- s2 = "bb".force_encoding("utf-16be")
- assert_raise(Encoding::CompatibilityError, "#{encdump s1} << #{encdump s2}") {
- s1 << s2
- }
- end
-
- def test_chomp
- s = "\1\n".force_encoding("utf-16be")
- assert_equal(s, s.chomp, "#{encdump s}.chomp")
- s = "\0\n".force_encoding("utf-16be")
- assert_equal("", s.chomp, "#{encdump s}.chomp")
- s = "\0\r\0\n".force_encoding("utf-16be")
- assert_equal("", s.chomp, "#{encdump s}.chomp")
- end
-
- def test_succ
- s = "\xff\xff".force_encoding("utf-16be")
- assert(s.succ.valid_encoding?, "#{encdump s}.succ.valid_encoding?")
-
- s = "\xdb\xff\xdf\xff".force_encoding("utf-16be")
- assert(s.succ.valid_encoding?, "#{encdump s}.succ.valid_encoding?")
- end
-
- def test_regexp_union
- enccall(Regexp, :union, "aa".force_encoding("utf-16be"), "bb".force_encoding("utf-16be"))
- end
-
- def test_empty_regexp
- s = "".force_encoding("utf-16be")
- assert_equal(Encoding.find("utf-16be"), Regexp.new(s).encoding,
- "Regexp.new(#{encdump s}).encoding")
- end
-
- def test_regexp_match
- assert_raise(Encoding::CompatibilityError) { Regexp.new("aa".force_encoding("utf-16be")) =~ "aa" }
- end
-
- def test_gsub
- s = "abcd".force_encoding("utf-16be")
- assert_nothing_raised {
- s.gsub(Regexp.new(".".encode("utf-16be")), "xy")
- }
- s = "ab\0\ncd".force_encoding("utf-16be")
- assert_raise(Encoding::CompatibilityError) {
- s.gsub(Regexp.new(".".encode("utf-16be")), "xy")
- }
- end
-
- def test_split_awk
- s = " ab cd ".encode("utf-16be")
- r = s.split(" ".encode("utf-16be"))
- assert_equal(2, r.length)
- assert_str_equal("ab".encode("utf-16be"), r[0])
- assert_str_equal("cd".encode("utf-16be"), r[1])
- end
-
- def test_count2
- e = "abc".count("^b")
- assert_equal(e, "abc".encode("utf-16be").count("^b".encode("utf-16be")))
- assert_equal(e, "abc".encode("utf-16le").count("^b".encode("utf-16le")))
- end
-
- def test_header
- assert_raise(ArgumentError) { eval("# encoding:utf-16le\nfoo") }
- assert_raise(ArgumentError) { eval("# encoding:utf-16be\nfoo") }
- end
-
-
- def test_is_mbc_newline
- sl = "f\0o\0o\0\n\0b\0a\0r\0\n\0b\0a\0z\0\n\0".force_encoding("utf-16le")
- sb = "\0f\0o\0o\0\n\0b\0a\0r\0\n\0b\0a\0z\0\n".force_encoding("utf-16be")
- al = sl.lines.to_a
- ab = sb.lines.to_a
- assert_equal("f\0o\0o\0\n\0".force_encoding("utf-16le"), al.shift)
- assert_equal("b\0a\0r\0\n\0".force_encoding("utf-16le"), al.shift)
- assert_equal("b\0a\0z\0\n\0".force_encoding("utf-16le"), al.shift)
- assert_equal("\0f\0o\0o\0\n".force_encoding("utf-16be"), ab.shift)
- assert_equal("\0b\0a\0r\0\n".force_encoding("utf-16be"), ab.shift)
- assert_equal("\0b\0a\0z\0\n".force_encoding("utf-16be"), ab.shift)
-
- sl = "f\0o\0o\0\n\0".force_encoding("utf-16le")
- sb = "\0f\0o\0o\0\n".force_encoding("utf-16be")
- sl2 = "f\0o\0o\0".force_encoding("utf-16le")
- sb2 = "\0f\0o\0o".force_encoding("utf-16be")
- assert_equal(sl2, sl.chomp)
- assert_equal(sl2, sl.chomp.chomp)
- assert_equal(sb2, sb.chomp)
- assert_equal(sb2, sb.chomp.chomp)
-
- sl = "f\0o\0o\0\n".force_encoding("utf-16le")
- sb = "\0f\0o\0o\n".force_encoding("utf-16be")
- assert_equal(sl, sl.chomp)
- assert_equal(sb, sb.chomp)
- end
-
- def test_code_to_mbc
- assert_equal("a\0".force_encoding("utf-16le"), "a".ord.chr("utf-16le"))
- assert_equal("\0a".force_encoding("utf-16be"), "a".ord.chr("utf-16be"))
- end
-
- def utf8_to_utf16(s, e)
- s.chars.map {|c| c.ord.chr(e) }.join
- end
-
- def test_mbc_case_fold
- rl = Regexp.new(utf8_to_utf16("^(\u3042)(a)\\1\\2$", "utf-16le"), "i")
- rb = Regexp.new(utf8_to_utf16("^(\u3042)(a)\\1\\2$", "utf-16be"), "i")
- assert_equal(Encoding.find("utf-16le"), rl.encoding)
- assert_equal(Encoding.find("utf-16be"), rb.encoding)
- assert_match(rl, utf8_to_utf16("\u3042a\u3042a", "utf-16le"))
- assert_match(rb, utf8_to_utf16("\u3042a\u3042a", "utf-16be"))
- end
-
- def test_surrogate_pair
- sl = "\x42\xd8\xb7\xdf".force_encoding("utf-16le")
- sb = "\xd8\x42\xdf\xb7".force_encoding("utf-16be")
-
- assert_equal(1, sl.size)
- assert_equal(1, sb.size)
- assert_equal(0x20bb7, sl.ord)
- assert_equal(0x20bb7, sb.ord)
- assert_equal(sl, 0x20bb7.chr("utf-16le"))
- assert_equal(sb, 0x20bb7.chr("utf-16be"))
- assert_equal("", sl.chop)
- assert_equal("", sb.chop)
- end
-
- def test_regexp_escape
- s = "\0*".force_encoding("UTF-16BE")
- r = Regexp.new(Regexp.escape(s))
- assert(r =~ s, "#{encdump(r)} =~ #{encdump(s)}")
- end
-
- def test_casecmp
- assert_equal(0, "\0A".force_encoding("UTF-16BE").casecmp("\0a".force_encoding("UTF-16BE")))
- assert_not_equal(0, "\0A".force_encoding("UTF-16LE").casecmp("\0a".force_encoding("UTF-16LE")))
- assert_not_equal(0, "A\0".force_encoding("UTF-16BE").casecmp("a\0".force_encoding("UTF-16BE")))
- assert_equal(0, "A\0".force_encoding("UTF-16LE").casecmp("a\0".force_encoding("UTF-16LE")))
-
- ary = ["01".force_encoding("UTF-16LE"),
- "10".force_encoding("UTF-16LE")]
- e = ary.sort {|x,y| x <=> y }
- a = ary.sort {|x,y| x.casecmp(y) }
- assert_equal(e, a)
- end
-end
diff --git a/test/ruby/enc/test_utf32.rb b/test/ruby/enc/test_utf32.rb
deleted file mode 100644
index 3d4a458512..0000000000
--- a/test/ruby/enc/test_utf32.rb
+++ /dev/null
@@ -1,93 +0,0 @@
-require 'test/unit'
-
-class TestUTF32 < Test::Unit::TestCase
- def encdump(str)
- d = str.dump
- if /\.force_encoding\("[A-Za-z0-9.:_+-]*"\)\z/ =~ d
- d
- else
- "#{d}.force_encoding(#{str.encoding.name.dump})"
- end
- end
-
- def assert_str_equal(expected, actual, message=nil)
- full_message = build_message(message, <<EOT)
-#{encdump expected} expected but not equal to
-#{encdump actual}.
-EOT
- assert_block(full_message) { expected == actual }
- end
-
- def test_substr
- assert_str_equal(
- "abcdefgh".force_encoding("utf-32le"),
- "abcdefgh".force_encoding("utf-32le")[0,3])
- assert_str_equal(
- "abcdefgh".force_encoding("utf-32be"),
- "abcdefgh".force_encoding("utf-32be")[0,3])
- end
-
- def test_mbc_len
- al = "abcdefghijkl".force_encoding("utf-32le").each_char.to_a
- ab = "abcdefghijkl".force_encoding("utf-32be").each_char.to_a
- assert_equal("abcd".force_encoding("utf-32le"), al.shift)
- assert_equal("efgh".force_encoding("utf-32le"), al.shift)
- assert_equal("ijkl".force_encoding("utf-32le"), al.shift)
- assert_equal("abcd".force_encoding("utf-32be"), ab.shift)
- assert_equal("efgh".force_encoding("utf-32be"), ab.shift)
- assert_equal("ijkl".force_encoding("utf-32be"), ab.shift)
- end
-
- def ascii_to_utf16le(s)
- s.unpack("C*").map {|x| [x,0,0,0] }.flatten.pack("C*").force_encoding("utf-32le")
- end
-
- def ascii_to_utf16be(s)
- s.unpack("C*").map {|x| [0,0,0,x] }.flatten.pack("C*").force_encoding("utf-32be")
- end
-
- def test_mbc_newline
- al = ascii_to_utf16le("foo\nbar\nbaz\n").lines.to_a
- ab = ascii_to_utf16be("foo\nbar\nbaz\n").lines.to_a
-
- assert_equal(ascii_to_utf16le("foo\n"), al.shift)
- assert_equal(ascii_to_utf16le("bar\n"), al.shift)
- assert_equal(ascii_to_utf16le("baz\n"), al.shift)
- assert_equal(ascii_to_utf16be("foo\n"), ab.shift)
- assert_equal(ascii_to_utf16be("bar\n"), ab.shift)
- assert_equal(ascii_to_utf16be("baz\n"), ab.shift)
-
- sl = "a\0".force_encoding("utf-32le")
- sb = "a\0".force_encoding("utf-32be")
- assert_equal(sl, sl.chomp)
- assert_equal(sb, sb.chomp)
- end
-
- def test_mbc_to_code
- sl = "a\0\0\0".force_encoding("utf-32le")
- sb = "\0\0\0a".force_encoding("utf-32be")
- assert_equal("a".ord, sl.ord)
- assert_equal("a".ord, sb.ord)
- end
-
- def utf8_to_utf32(s, e)
- s.chars.map {|c| c.ord.chr(e) }.join
- end
-
- def test_mbc_case_fold
- rl = Regexp.new(utf8_to_utf32("^(\u3042)(a)\\1\\2$", "utf-32le"), "i")
- rb = Regexp.new(utf8_to_utf32("^(\u3042)(a)\\1\\2$", "utf-32be"), "i")
- assert_equal(Encoding.find("utf-32le"), rl.encoding)
- assert_equal(Encoding.find("utf-32be"), rb.encoding)
- assert_match(rl, utf8_to_utf32("\u3042a\u3042a", "utf-32le"))
- assert_match(rb, utf8_to_utf32("\u3042a\u3042a", "utf-32be"))
- end
-
- def test_code_to_mbc
- sl = "a\0\0\0".force_encoding("utf-32le")
- sb = "\0\0\0a".force_encoding("utf-32be")
- assert_equal(sl, "a".ord.chr("utf-32le"))
- assert_equal(sb, "a".ord.chr("utf-32be"))
- end
-end
-
diff --git a/test/ruby/enc/test_windows_1251.rb b/test/ruby/enc/test_windows_1251.rb
deleted file mode 100644
index 6fbf3159a1..0000000000
--- a/test/ruby/enc/test_windows_1251.rb
+++ /dev/null
@@ -1,16 +0,0 @@
-# encoding:windows-1251
-
-require "test/unit"
-
-class TestWindows1251 < Test::Unit::TestCase
- def test_windows_1251
- (0xc0..0xdf).each do |c|
- c1 = c.chr("windows-1251")
- c2 = (c + 0x20).chr("windows-1251")
- assert_match(/^(#{ c1 })\1$/i, c2 + c1)
- assert_match(/^(#{ c2 })\1$/i, c1 + c2)
- assert_match(/^[#{ c1 }]+$/i, c2 + c1)
- assert_match(/^[#{ c2 }]+$/i, c1 + c2)
- end
- end
-end
diff --git a/test/ruby/endblockwarn_rb b/test/ruby/endblockwarn.rb
index 7b7f97f597..7b7f97f597 100644
--- a/test/ruby/endblockwarn_rb
+++ b/test/ruby/endblockwarn.rb
diff --git a/test/ruby/envutil.rb b/test/ruby/envutil.rb
index 6900d03b70..c481326288 100644
--- a/test/ruby/envutil.rb
+++ b/test/ruby/envutil.rb
@@ -1,11 +1,5 @@
-require "open3"
-require "timeout"
-
module EnvUtil
def rubybin
- unless ENV["RUBYOPT"]
-
- end
if ruby = ENV["RUBY"]
return ruby
end
@@ -16,161 +10,19 @@ module EnvUtil
return File.expand_path(ruby)
end
if File.exist? rubyexe and File.executable? rubyexe
- return File.expand_path(rubyexe)
+ return File.expand_path(ruby)
end
ruby = File.join("..", ruby)
end
begin
require "rbconfig"
File.join(
- RbConfig::CONFIG["bindir"],
- RbConfig::CONFIG["ruby_install_name"] + RbConfig::CONFIG["EXEEXT"]
+ Config::CONFIG["bindir"],
+ Config::CONFIG["ruby_install_name"] + Config::CONFIG["EXEEXT"]
)
rescue LoadError
"ruby"
end
end
module_function :rubybin
-
- LANG_ENVS = %w"LANG LC_ALL LC_CTYPE"
- def rubyexec(*args)
- ruby = EnvUtil.rubybin
- c = "C"
- env = {}
- LANG_ENVS.each {|lc| env[lc], ENV[lc] = ENV[lc], c}
- stdin = stdout = stderr = nil
- Timeout.timeout(10) do
- stdin, stdout, stderr = Open3.popen3(*([ruby] + args))
- env.each_pair {|lc, v|
- if v
- ENV[lc] = v
- else
- ENV.delete(lc)
- end
- }
- env = nil
- yield(stdin, stdout, stderr)
- end
-
- ensure
- env.each_pair {|lc, v|
- if v
- ENV[lc] = v
- else
- ENV.delete(lc)
- end
- } if env
- stdin .close unless !stdin || stdin .closed?
- stdout.close unless !stdout || stdout.closed?
- stderr.close unless !stderr || stderr.closed?
- end
- module_function :rubyexec
-end
-
-module Test
- module Unit
- module Assertions
- public
- def assert_normal_exit(testsrc, message = '')
- in_c, in_p = IO.pipe
- out_p, out_c = IO.pipe
- pid = spawn(EnvUtil.rubybin, '-W0', STDIN=>in_c, STDOUT=>out_c, STDERR=>out_c)
- in_c.close
- out_c.close
- in_p.write testsrc
- in_p.close
- msg = out_p.read
- out_p.close
- Process.wait pid
- status = $?
- faildesc = nil
- if status.signaled?
- signo = status.termsig
- signame = Signal.list.invert[signo]
- sigdesc = "signal #{signo}"
- if signame
- sigdesc = "SIG#{signame} (#{sigdesc})"
- end
- if status.coredump?
- sigdesc << " (core dumped)"
- end
- if msg.empty?
- full_message = build_message(message, "pid ? killed by ?",
- pid,
- AssertionMessage::Literal.new(sigdesc))
- else
- msg << "\n" if /\n\z/ !~ msg
- full_message = build_message(message, "pid ? killed by ?\n?",
- pid,
- AssertionMessage::Literal.new(sigdesc),
- AssertionMessage::Literal.new(msg.gsub(/^/, '| ')))
- end
- end
- assert_block(full_message) { !status.signaled? }
- ensure
- in_c.close if in_c && !in_c.closed?
- in_p.close if in_p && !in_p.closed?
- out_c.close if out_c && !out_c.closed?
- out_p.close if out_p && !out_p.closed?
- end
-
- LANG_ENVS = %w"LANG LC_ALL LC_CTYPE"
- def assert_in_out_err(args, test_stdin = "", test_stdout = "", test_stderr = "", message = nil)
- in_c, in_p = IO.pipe
- out_p, out_c = IO.pipe
- err_p, err_c = IO.pipe
- c = "C"
- env = {}
- LANG_ENVS.each {|lc| env[lc], ENV[lc] = ENV[lc], c}
- pid = spawn(EnvUtil.rubybin, *args, STDIN=>in_c, STDOUT=>out_c, STDERR=>err_c)
- in_c.close
- out_c.close
- err_c.close
- in_p.write test_stdin
- in_p.close
- th_stdout = Thread.new { out_p.read }
- th_stderr = Thread.new { err_p.read }
- if th_stdout.join(10) && th_stderr.join(10)
- stdout = th_stdout.value
- stderr = th_stderr.value
- else
- flunk("timeout")
- end
- out_p.close
- err_p.close
- Process.wait pid
- if block_given?
- yield(stdout.lines.map {|l| l.chomp }, stderr.lines.map {|l| l.chomp })
- else
- if test_stdout.is_a?(Regexp)
- assert_match(test_stdout, stdout, message)
- else
- assert_equal(test_stdout, stdout.lines.map {|l| l.chomp }, message)
- end
- if test_stderr.is_a?(Regexp)
- assert_match(test_stderr, stderr, message)
- else
- assert_equal(test_stderr, stderr.lines.map {|l| l.chomp }, message)
- end
- end
- ensure
- env.each_pair {|lc, v|
- if v
- ENV[lc] = v
- else
- ENV.delete(lc)
- end
- } if env
- in_c.close if in_c && !in_c.closed?
- in_p.close if in_p && !in_p.closed?
- out_c.close if out_c && !out_c.closed?
- out_p.close if out_p && !out_p.closed?
- err_c.close if err_c && !err_c.closed?
- err_p.close if err_p && !err_p.closed?
- (th_stdout.kill; th_stdout.join) if th_stdout
- (th_stderr.kill; th_stderr.join) if th_stderr
- end
- end
- end
end
-
diff --git a/test/ruby/lbtest.rb b/test/ruby/lbtest.rb
deleted file mode 100644
index df7872dc76..0000000000
--- a/test/ruby/lbtest.rb
+++ /dev/null
@@ -1,48 +0,0 @@
-require 'thread'
-
-class LocalBarrier
- def initialize(n)
- @wait = Queue.new
- @done = Queue.new
- @keeper = begin_keeper(n)
- end
-
- def sync
- @done.push(true)
- @wait.pop
- end
-
- def join
- @keeper.join
- end
-
- private
- def begin_keeper(n)
- Thread.start do
- n.times do
- @done.pop
- end
- n.times do
- @wait.push(true)
- end
- end
- end
-end
-
-n = 10
-
-lb = LocalBarrier.new(n)
-
-(n - 1).times do |i|
- Thread.start do
- sleep((rand(n) + 1) / 10.0)
- puts "#{i}: done"
- lb.sync
- puts "#{i}: cont"
- end
-end
-
-lb.sync
-puts "#{n-1}: cone"
-
-puts "exit."
diff --git a/test/ruby/marshaltestlib.rb b/test/ruby/marshaltestlib.rb
index 8c55a086af..ae60cd8479 100644
--- a/test/ruby/marshaltestlib.rb
+++ b/test/ruby/marshaltestlib.rb
@@ -1,4 +1,3 @@
-# coding: utf-8
module MarshalTestLib
# include this module to a Test::Unit::TestCase and definde encode(o) and
# decode(s) methods. e.g.
@@ -18,7 +17,7 @@ module MarshalTestLib
def marshaltest(o1)
str = encode(o1)
- print str.dump, "\n" if $DEBUG
+ print str, "\n" if $DEBUG
o2 = decode(str)
o2
end
@@ -30,8 +29,8 @@ module MarshalTestLib
iv1 = o1.instance_variables.sort
iv2 = o2.instance_variables.sort
assert_equal(iv1, iv2)
- val1 = iv1.map {|var| o1.instance_eval {eval var.to_s}}
- val2 = iv1.map {|var| o2.instance_eval {eval var.to_s}}
+ val1 = iv1.map {|var| o1.instance_eval {eval var}}
+ val2 = iv1.map {|var| o2.instance_eval {eval var}}
assert_equal(val1, val2, msg)
if block_given?
assert_equal(yield(o1), yield(o2), msg)
@@ -129,7 +128,7 @@ module MarshalTestLib
def test_hash_default_proc
h = Hash.new {}
- assert_raise(TypeError) { marshaltest(h) }
+ assert_raises(TypeError) { marshaltest(h) }
end
def test_hash_ivar
@@ -194,6 +193,12 @@ module MarshalTestLib
1.instance_eval { remove_instance_variable("@iv") }
end
+ def test_fixnum_64bit
+ obj = [1220278665, 1220278662, 1220278661, 1220278661, 1220278656]
+
+ marshal_equal(obj)
+ end
+
def test_float
marshal_equal(-1.0)
marshal_equal(0.0)
@@ -246,12 +251,6 @@ module MarshalTestLib
marshal_equal(/a/)
marshal_equal(/A/i)
marshal_equal(/A/mx)
- marshal_equal(/a\u3042/)
- marshal_equal(/aあ/)
- assert_equal(Regexp.new("あ".force_encoding("ASCII-8BIT")),
- Marshal.load("\004\b/\b\343\201\202\000"))
- assert_equal(/au3042/, Marshal.load("\004\b/\fa\\u3042\000"))
- #assert_equal(/au3042/u, Marshal.load("\004\b/\fa\\u3042@")) # spec
end
def test_regexp_subclass
@@ -297,7 +296,7 @@ module MarshalTestLib
class MyStruct
def ==(rhs)
return true if __id__ == rhs.__id__
- return false unless rhs.is_a?(::Struct)
+ return false unless rhs.is_a?(::Struct)
return false if self.class != rhs.class
members.each do |member|
return false if self.__send__(member) != rhs.__send__(member)
@@ -390,11 +389,6 @@ module MarshalTestLib
marshal_equal(o1) {|o| o.instance_eval { @iv }}
end
- def test_time_in_array
- t = Time.now
- assert_equal([t,t], Marshal.load(Marshal.dump([t, t])), "[ruby-dev:34159]")
- end
-
def test_true
marshal_equal(true)
end
@@ -425,16 +419,16 @@ module MarshalTestLib
def test_singleton
o = Object.new
def o.m() end
- assert_raise(TypeError) { marshaltest(o) }
+ assert_raises(TypeError) { marshaltest(o) }
o = Object.new
c = class << o
@v = 1
class C; self; end
end
- assert_raise(TypeError) { marshaltest(o) }
- assert_raise(TypeError) { marshaltest(c) }
- assert_raise(TypeError) { marshaltest(ARGF) }
- assert_raise(TypeError) { marshaltest(ENV) }
+ assert_raises(TypeError) { marshaltest(o) }
+ assert_raises(TypeError) { marshaltest(c) }
+ assert_raises(TypeError) { marshaltest(ARGF) }
+ assert_raises(TypeError) { marshaltest(ENV) }
end
def test_extend
@@ -447,7 +441,7 @@ module MarshalTestLib
marshal_equal(o) {|obj| class << obj; ancestors end}
o = Object.new
o.extend Module.new
- assert_raise(TypeError) { marshaltest(o) }
+ assert_raises(TypeError) { marshaltest(o) }
end
def test_extend_string
@@ -460,16 +454,16 @@ module MarshalTestLib
marshal_equal(o) {|obj| class << obj; ancestors end}
o = ""
o.extend Module.new
- assert_raise(TypeError) { marshaltest(o) }
+ assert_raises(TypeError) { marshaltest(o) }
end
def test_anonymous
c = Class.new
- assert_raise(TypeError) { marshaltest(c) }
+ assert_raises(TypeError) { marshaltest(c) }
o = c.new
- assert_raise(TypeError) { marshaltest(o) }
+ assert_raises(TypeError) { marshaltest(o) }
m = Module.new
- assert_raise(TypeError) { marshaltest(m) }
+ assert_raises(TypeError) { marshaltest(m) }
end
def test_string_empty
@@ -490,7 +484,7 @@ module MarshalTestLib
class MyStruct2
def ==(rhs)
return true if __id__ == rhs.__id__
- return false unless rhs.is_a?(::Struct)
+ return false unless rhs.is_a?(::Struct)
return false if self.class != rhs.class
members.each do |member|
return false if self.__send__(member) != rhs.__send__(member)
diff --git a/test/ruby/sentence.rb b/test/ruby/sentence.rb
deleted file mode 100644
index 50f42d6885..0000000000
--- a/test/ruby/sentence.rb
+++ /dev/null
@@ -1,668 +0,0 @@
-# == sentence library
-#
-# = Features
-#
-# * syntax based sentences generation
-# * sentence operations such as substitution.
-#
-# = Example
-#
-# Some arithmetic expressions using "+", "-", "*" and "/" are generated as follows.
-#
-# require 'sentence'
-# Sentence.each({
-# :exp => [["num"],
-# [:exp, "+", :exp],
-# [:exp, "-", :exp],
-# [:exp, "*", :exp],
-# [:exp, "/", :exp]]
-# }, :exp, 2) {|sent| p sent }
-# #=>
-# #<Sentence: "num">
-# #<Sentence: ("num") "+" ("num")>
-# #<Sentence: ("num") "+" (("num") "+" ("num"))>
-# #<Sentence: ("num") "+" (("num") "-" ("num"))>
-# #<Sentence: ("num") "+" (("num") "*" ("num"))>
-# #<Sentence: ("num") "+" (("num") "/" ("num"))>
-# #<Sentence: (("num") "+" ("num")) "+" ("num")>
-# ...
-#
-# Sentence.each takes 3 arguments.
-# The first argument is the syntax for the expressions.
-# The second argument, :exp, is a generating nonterminal.
-# The third argument, 2, limits derivation to restrict results finitely.
-#
-# Some arithmetic expressions including parenthesis can be generated as follows.
-#
-# syntax = {
-# :factor => [["n"],
-# ["(", :exp, ")"]],
-# :term => [[:factor],
-# [:term, "*", :factor],
-# [:term, "/", :factor]],
-# :exp => [[:term],
-# [:exp, "+", :term],
-# [:exp, "-", :term]]
-# }
-# Sentence.each(syntax, :exp, 2) {|sent| p sent }
-# #=>
-# #<Sentence: (("n"))>
-# #<Sentence: (("(" ((("n"))) ")"))>
-# #<Sentence: (("(" ((("(" ((("n"))) ")"))) ")"))>
-# #<Sentence: (("(" (((("n")) "*" ("n"))) ")"))>
-# #<Sentence: (("(" (((("n")) "/" ("n"))) ")"))>
-# #<Sentence: (("(" (((("n"))) "+" (("n"))) ")"))>
-# #<Sentence: (("(" (((("n"))) "-" (("n"))) ")"))>
-# #<Sentence: ((("n")) "*" ("n"))>
-# #<Sentence: ((("n")) "*" ("(" ((("n"))) ")"))>
-# ...
-#
-# Sentence#to_s can be used to concatenate strings
-# in a sentence:
-#
-# Sentence.each(syntax, :exp, 2) {|sent| p sent.to_s }
-# #=>
-# "n"
-# "(n)"
-# "((n))"
-# "(n*n)"
-# "(n/n)"
-# "(n+n)"
-# "(n-n)"
-# "n*n"
-# "n*(n)"
-# ...
-#
-
-# Sentence() instantiates a sentence object.
-#
-# Sentence("foo", "bar")
-# #=> #<Sentence: "foo" "bar">
-#
-# Sentence("foo", ["bar", "baz"])
-# #=> #<Sentence: "foo" ("bar" "baz")>
-#
-def Sentence(*ary)
- Sentence.new(ary)
-end
-
-# Sentence class represents a tree with string leaves.
-#
-class Sentence
- # _ary_ represents a tree.
- # It should be a possibly nested array which contains strings.
- #
- # Note that _ary_ is not copied.
- # Don't modify _ary_ after the sentence object is instantiated.
- #
- # Sentence.new(["a", "pen"])
- # #<Sentence: "a" "pen">
- #
- # Sentence.new(["I", "have", ["a", "pen"]])
- # #<Sentence: "I" "have" ("a" "pen")>
- #
- def initialize(ary)
- @sent = ary
- end
-
- # returns a string which is concatenation of all strings.
- # No separator is used.
- #
- # Sentence("2", "+", "3").to_s
- # "2+3"
- #
- # Sentence("2", "+", ["3", "*", "5"]).to_s
- # "2+3*5"
- #
- def to_s
- @sent.join('')
- end
-
- # returns a string which is concatenation of all strings separated by _sep_.
- # If _sep_ is not given, single space is used.
- #
- # Sentence("I", "have", ["a", "pen"]).join
- # "I have a pen"
- #
- # Sentence("I", "have", ["a", "pen"]).join("/")
- # "I/have/a/pen"
- #
- # Sentence("a", [], "b").join("/")
- # "a/b"
- #
- def join(sep=' ')
- @sent.flatten.join(sep)
- end
-
- # returns a tree as a nested array.
- #
- # Note that the result is not copied.
- # Don't modify the result.
- #
- # Sentence(["foo", "bar"], "baz").to_a
- # #=> [["foo", "bar"], "baz"]
- #
- def to_a
- @sent
- end
-
- # returns <i>i</i>th element as a sentence or string.
- #
- # s = Sentence(["foo", "bar"], "baz")
- # s #=> #<Sentence: ("foo" "bar") "baz">
- # s[0] #=> #<Sentence: "foo" "bar">
- # s[1] #=> "baz"
- #
- def [](i)
- e = @sent[i]
- e.respond_to?(:to_ary) ? Sentence.new(e) : e
- end
-
- # returns the number of top level elements.
- #
- # Sentence.new(%w[foo bar]).length
- # #=> 2
- #
- # Sentence(%w[2 * 7], "+", %w[3 * 5]).length
- # #=> 3
- #
- def length
- @sent.length
- end
-
- # iterates over children.
- #
- # Sentence(%w[2 * 7], "+", %w[3 * 5]).each {|v| p v }
- # #=>
- # #<Sentence: "2" "*" "7">
- # "+"
- # #<Sentence: "3" "*" "5">
- #
- def each # :yield: element
- @sent.each_index {|i|
- yield self[i]
- }
- end
- include Enumerable
-
- def inspect
- "#<#{self.class}: #{inner_inspect(@sent, '')}>"
- end
-
- # :stopdoc:
- def inner_inspect(ary, r)
- first = true
- ary.each {|obj|
- r << ' ' if !first
- first = false
- if obj.respond_to? :to_ary
- r << '('
- inner_inspect(obj, r)
- r << ')'
- else
- r << obj.inspect
- end
- }
- r
- end
- # :startdoc:
-
- # returns new sentence object which
- # _target_ is substituted by the block.
- #
- # Sentence#subst invokes <tt>_target_ === _string_</tt> for each
- # string in the sentence.
- # The strings which === returns true are substituted by the block.
- # The block is invoked with the substituting string.
- #
- # Sentence.new(%w[2 + 3]).subst("+") { "*" }
- # #<Sentence: "2" "*" "3">
- #
- # Sentence.new(%w[2 + 3]).subst(/\A\d+\z/) {|s| ((s.to_i)*2).to_s }
- # #=> #<Sentence: "4" "+" "6">
- #
- def subst(target, &b) # :yield: string
- Sentence.new(subst_rec(@sent, target, &b))
- end
-
- # :stopdoc:
- def subst_rec(obj, target, &b)
- if obj.respond_to? :to_ary
- a = []
- obj.each {|e| a << subst_rec(e, target, &b) }
- a
- elsif target === obj
- yield obj
- else
- obj
- end
- end
- # :startdoc:
-
- # find a subsentence and return it.
- # The block is invoked for each subsentence in preorder manner.
- # The first subsentence which the block returns true is returned.
- #
- # Sentence(%w[2 * 7], "+", %w[3 * 5]).find_subtree {|s| s[1] == "*" }
- # #=> #<Sentence: "2" "*" "7">
- #
- def find_subtree(&b) # :yield: sentence
- find_subtree_rec(@sent, &b)
- end
-
- # :stopdoc:
- def find_subtree_rec(obj, &b)
- if obj.respond_to? :to_ary
- s = Sentence.new(obj)
- if b.call s
- return s
- else
- obj.each {|e|
- r = find_subtree_rec(e, &b)
- return r if r
- }
- end
- end
- nil
- end
- # :startdoc:
-
- # returns a new sentence object which expands according to the condition
- # given by the block.
- #
- # The block is invoked for each subsentence.
- # The subsentences which the block returns true are
- # expanded into parent.
- #
- # s = Sentence(%w[2 * 7], "+", %w[3 * 5])
- # #=> #<Sentence: ("2" "*" "7") "+" ("3" "*" "5")>
- #
- # s.expand { true }
- # #=> #<Sentence: "2" "*" "7" "+" "3" "*" "5">
- #
- # s.expand {|s| s[0] == "3" }
- # #=> #<Sentence: (("2" "*" "7") "+" "3" "*" "5")>
- #
- def expand(&b) # :yield: sentence
- Sentence.new(expand_rec(@sent, &b))
- end
-
- # :stopdoc:
- def expand_rec(obj, r=[], &b)
- if obj.respond_to? :to_ary
- obj.each {|o|
- s = Sentence.new(o)
- if b.call s
- expand_rec(o, r, &b)
- else
- a = []
- expand_rec(o, a, &b)
- r << a
- end
- }
- else
- r << obj
- end
- r
- end
- # :startdoc:
-
- # Sentence.each generates sentences
- # by deriving the start symbol _sym_ using _syntax_.
- # The derivation is restricted by an positive integer _limit_ to
- # avoid infinite generation.
- #
- # Sentence.each yields the block with a generated sentence.
- #
- # Sentence.each({
- # :exp => [["n"],
- # [:exp, "+", :exp],
- # [:exp, "*", :exp]]
- # }, :exp, 1) {|sent| p sent }
- # #=>
- # #<Sentence: "n">
- # #<Sentence: ("n") "+" ("n")>
- # #<Sentence: ("n") "*" ("n")>
- #
- # Sentence.each({
- # :exp => [["n"],
- # [:exp, "+", :exp],
- # [:exp, "*", :exp]]
- # }, :exp, 2) {|sent| p sent }
- # #=>
- # #<Sentence: "n">
- # #<Sentence: ("n") "+" ("n")>
- # #<Sentence: ("n") "+" (("n") "+" ("n"))>
- # #<Sentence: ("n") "+" (("n") "*" ("n"))>
- # #<Sentence: (("n") "+" ("n")) "+" ("n")>
- # #<Sentence: (("n") "*" ("n")) "+" ("n")>
- # #<Sentence: ("n") "*" ("n")>
- # #<Sentence: ("n") "*" (("n") "+" ("n"))>
- # #<Sentence: ("n") "*" (("n") "*" ("n"))>
- # #<Sentence: (("n") "+" ("n")) "*" ("n")>
- # #<Sentence: (("n") "*" ("n")) "*" ("n")>
- #
- def Sentence.each(syntax, sym, limit)
- Gen.new(syntax).each_tree(sym, limit) {|tree|
- yield Sentence.new(tree)
- }
- end
-
- # Sentence.expand_syntax returns an expanded syntax:
- # * No rule derives to empty sequence
- # * Underivable rule simplified
- # * No channel rule
- # * Symbols which has zero or one choices are not appered in rhs.
- #
- # Note that the rules which can derive empty and non-empty
- # sequences are modified to derive only non-empty sequences.
- #
- # Sentence.expand_syntax({
- # :underivable1 => [],
- # :underivable2 => [[:underivable1]],
- # :underivable3 => [[:underivable3]],
- # :empty_only1 => [[]],
- # :empty_only2 => [[:just_empty1, :just_empty1]],
- # :empty_or_not => [[], ["foo"]],
- # :empty_or_not_2 => [[:empty_or_not, :empty_or_not]],
- # :empty_or_not_3 => [[:empty_or_not, :empty_or_not, :empty_or_not]],
- # :empty_or_not_4 => [[:empty_or_not_2, :empty_or_not_2]],
- # :channel1 => [[:channeled_data]],
- # :channeled_data => [["a", "b"], ["c", "d"]],
- # :single_choice => [["single", "choice"]],
- # :single_choice_2 => [[:single_choice, :single_choice]],
- # })
- # #=>
- # {
- # :underivable1=>[], # underivable rules are simplified to [].
- # :underivable2=>[],
- # :underivable3=>[],
- # :empty_only1=>[], # derivation to empty sequence are removed.
- # :empty_only2=>[],
- # :empty_or_not=>[["foo"]], # empty sequences are removed too.
- # :empty_or_not_2=>[["foo"], ["foo", "foo"]],
- # :empty_or_not_3=>[["foo"], ["foo", "foo"], ["foo", "foo", "foo"]],
- # :empty_or_not_4=> [["foo"], ["foo", "foo"], [:empty_or_not_2, :empty_or_not_2]],
- # :channel1=>[["a", "b"], ["c", "d"]], # channel rules are removed.
- # :channeled_data=>[["a", "b"], ["c", "d"]],
- # :single_choice=>[["single", "choice"]], # single choice rules are expanded.
- # :single_choice_2=>[["single", "choice", "single", "choice"]],
- # }
- #
- # Sentence.expand_syntax({
- # :factor => [["n"],
- # ["(", :exp, ")"]],
- # :term => [[:factor],
- # [:term, "*", :factor],
- # [:term, "/", :factor]],
- # :exp => [[:term],
- # [:exp, "+", :term],
- # [:exp, "-", :term]]
- # })
- # #=>
- # {:exp=> [["n"],
- # ["(", :exp, ")"],
- # [:exp, "+", :term],
- # [:exp, "-", :term],
- # [:term, "*", :factor],
- # [:term, "/", :factor]],
- # :factor=> [["n"],
- # ["(", :exp, ")"]],
- # :term=> [["n"],
- # ["(", :exp, ")"],
- # [:term, "*", :factor],
- # [:term, "/", :factor]]
- # }
- #
- def Sentence.expand_syntax(syntax)
- Sentence::Gen.expand_syntax(syntax)
- end
-
- # :stopdoc:
- class Gen
- def Gen.each_tree(syntax, sym, limit, &b)
- Gen.new(syntax).each_tree(sym, limit, &b)
- end
-
- def Gen.each_string(syntax, sym, limit, &b)
- Gen.new(syntax).each_string(sym, limit, &b)
- end
-
- def initialize(syntax)
- @syntax = syntax
- end
-
- def self.expand_syntax(syntax)
- syntax = simplify_underivable_rules(syntax)
- syntax = simplify_emptyonly_rules(syntax)
- syntax = make_rules_no_empseq(syntax)
- syntax = expand_channel_rules(syntax)
-
- syntax = expand_noalt_rules(syntax)
- syntax = reorder_rules(syntax)
- end
-
- def self.simplify_underivable_rules(syntax)
- deribable_syms = {}
- changed = true
- while changed
- changed = false
- syntax.each {|sym, rules|
- next if deribable_syms[sym]
- rules.each {|rhs|
- if rhs.all? {|e| String === e || deribable_syms[e] }
- deribable_syms[sym] = true
- changed = true
- break
- end
- }
- }
- end
- result = {}
- syntax.each {|sym, rules|
- if deribable_syms[sym]
- rules2 = []
- rules.each {|rhs|
- rules2 << rhs if rhs.all? {|e| String === e || deribable_syms[e] }
- }
- result[sym] = rules2.uniq
- else
- result[sym] = []
- end
- }
- result
- end
-
- def self.simplify_emptyonly_rules(syntax)
- justempty_syms = {}
- changed = true
- while changed
- changed = false
- syntax.each {|sym, rules|
- next if justempty_syms[sym]
- if !rules.empty? && rules.all? {|rhs| rhs.all? {|e| justempty_syms[e] } }
- justempty_syms[sym] = true
- changed = true
- end
- }
- end
- result = {}
- syntax.each {|sym, rules|
- result[sym] = rules.map {|rhs| rhs.reject {|e| justempty_syms[e] } }.uniq
- }
- result
- end
-
- def self.expand_emptyable_syms(rhs, emptyable_syms)
- if rhs.empty?
- yield []
- else
- first = rhs[0]
- rest = rhs[1..-1]
- if emptyable_syms[first]
- expand_emptyable_syms(rest, emptyable_syms) {|rhs2|
- yield [first] + rhs2
- yield rhs2
- }
- else
- expand_emptyable_syms(rest, emptyable_syms) {|rhs2|
- yield [first] + rhs2
- }
- end
- end
- end
-
- def self.make_rules_no_empseq(syntax)
- emptyable_syms = {}
- changed = true
- while changed
- changed = false
- syntax.each {|sym, rules|
- next if emptyable_syms[sym]
- rules.each {|rhs|
- if rhs.all? {|e| emptyable_syms[e] }
- emptyable_syms[sym] = true
- changed = true
- break
- end
- }
- }
- end
- result = {}
- syntax.each {|sym, rules|
- rules2 = []
- rules.each {|rhs|
- expand_emptyable_syms(rhs, emptyable_syms) {|rhs2|
- next if rhs2.empty?
- rules2 << rhs2
- }
- }
- result[sym] = rules2.uniq
- }
- result
- end
-
- def self.expand_channel_rules(syntax)
- channel_rules = {}
- syntax.each {|sym, rules|
- channel_rules[sym] = {sym=>true}
- rules.each {|rhs|
- if rhs.length == 1 && Symbol === rhs[0]
- channel_rules[sym][rhs[0]] = true
- end
- }
- }
- changed = true
- while changed
- changed = false
- channel_rules.each {|sym, set|
- n1 = set.size
- set.keys.each {|s|
- set.update(channel_rules[s])
- }
- n2 = set.size
- changed = true if n1 < n2
- }
- end
- result = {}
- syntax.each {|sym, rules|
- rules2 = []
- channel_rules[sym].each_key {|s|
- syntax[s].each {|rhs|
- unless rhs.length == 1 && Symbol === rhs[0]
- rules2 << rhs
- end
- }
- }
- result[sym] = rules2.uniq
- }
- result
- end
-
- def self.expand_noalt_rules(syntax)
- noalt_syms = {}
- syntax.each {|sym, rules|
- if rules.length == 1
- noalt_syms[sym] = true
- end
- }
- result = {}
- syntax.each {|sym, rules|
- rules2 = []
- rules.each {|rhs|
- rhs2 = []
- rhs.each {|e|
- if noalt_syms[e]
- rhs2.concat syntax[e][0]
- else
- rhs2 << e
- end
- }
- rules2 << rhs2
- }
- result[sym] = rules2.uniq
- }
- result
- end
-
- def self.reorder_rules(syntax)
- result = {}
- syntax.each {|sym, rules|
- result[sym] = rules.sort_by {|rhs|
- [rhs.find_all {|e| Symbol === e }.length, rhs.length]
- }
- }
- result
- end
-
- def each_tree(sym, limit)
- generate_from_sym(sym, limit) {|_, tree|
- yield tree
- }
- nil
- end
-
- def each_string(sym, limit)
- generate_from_sym(sym, limit) {|_, tree|
- yield [tree].join('')
- }
- nil
- end
-
- def generate_from_sym(sym, limit, &b)
- return if limit < 0
- if String === sym
- yield limit, sym
- else
- rules = @syntax[sym]
- raise "undefined rule: #{sym}" if !rules
- rules.each {|rhs|
- if rhs.length == 1 || rules.length == 1
- limit1 = limit
- else
- limit1 = limit-1
- end
- generate_from_rhs(rhs, limit1, &b)
- }
- end
- nil
- end
-
- def generate_from_rhs(rhs, limit)
- return if limit < 0
- if rhs.empty?
- yield limit, []
- else
- generate_from_sym(rhs[0], limit) {|limit1, child|
- generate_from_rhs(rhs[1..-1], limit1) {|limit2, arr|
- yield limit2, [child, *arr]
- }
- }
- end
- nil
- end
- end
- # :startdoc:
-
-end
-
diff --git a/test/ruby/suicide.rb b/test/ruby/suicide.rb
new file mode 100644
index 0000000000..2687ed04cd
--- /dev/null
+++ b/test/ruby/suicide.rb
@@ -0,0 +1,2 @@
+STDERR.reopen(STDOUT)
+at_exit{Process.kill(:INT, $$)}
diff --git a/test/ruby/test_alias.rb b/test/ruby/test_alias.rb
index f66c4a6340..83f897fb00 100644
--- a/test/ruby/test_alias.rb
+++ b/test/ruby/test_alias.rb
@@ -2,71 +2,39 @@ require 'test/unit'
class TestAlias < Test::Unit::TestCase
class Alias0
- def foo
- "foo"
- end
+ def foo; "foo" end
end
-
- class Alias1 < Alias0
+ class Alias1<Alias0
alias bar foo
-
- def foo
- "foo+#{super}"
- end
+ def foo; "foo+" + super end
end
-
- class Alias2 < Alias1
+ class Alias2<Alias1
alias baz foo
undef foo
end
-
- class Alias3 < Alias2
+ class Alias3<Alias2
def foo
- super
+ defined? super
end
-
def bar
- super
+ defined? super
end
-
def quux
- super
+ defined? super
end
end
def test_alias
x = Alias2.new
- assert_equal "foo", x.bar
- assert_equal "foo+foo", x.baz
- assert_equal "foo+foo", x.baz # test_check for cache
+ assert_equal("foo", x.bar)
+ assert_equal("foo+foo", x.baz)
- x = Alias3.new
- assert_raise(NoMethodError) { x.foo }
- assert_equal "foo", x.bar
- assert_raise(NoMethodError) { x.quux }
- end
+ # test_check for cache
+ assert_equal("foo+foo", x.baz)
- class C
- def m
- $SAFE
- end
- end
-
- def test_JVN_83768862
- d = lambda {
- $SAFE = 4
- dclass = Class.new(C)
- dclass.send(:alias_method, :mm, :m)
- dclass.new
- }.call
- assert_raise(SecurityError) { d.mm }
- end
-
- def test_nonexistmethod
- assert_raise(NameError){
- Class.new{
- alias_method :foobarxyzzy, :barbaz
- }
- }
+ x = Alias3.new
+ assert(!x.foo)
+ assert(x.bar)
+ assert(!x.quux)
end
end
diff --git a/test/ruby/test_argf.rb b/test/ruby/test_argf.rb
deleted file mode 100644
index a6c224ba41..0000000000
--- a/test/ruby/test_argf.rb
+++ /dev/null
@@ -1,700 +0,0 @@
-require 'test/unit'
-require 'timeout'
-require 'tmpdir'
-require 'tempfile'
-require_relative 'envutil'
-
-class TestArgf < Test::Unit::TestCase
- def setup
- @t1 = Tempfile.new("foo")
- @t1.binmode
- @t1.puts "1"
- @t1.puts "2"
- @t1.close
- @t2 = Tempfile.new("bar")
- @t2.binmode
- @t2.puts "3"
- @t2.puts "4"
- @t2.close
- @t3 = Tempfile.new("baz")
- @t3.binmode
- @t3.puts "5"
- @t3.puts "6"
- @t3.close
- @tmps = [@t1, @t2, @t3]
- end
-
- def teardown
- @tmps.each {|t|
- bak = t.path + ".bak"
- File.unlink bak if File.file? bak
- }
- end
-
- def make_tempfile
- t = Tempfile.new("foo")
- t.puts "foo"
- t.puts "bar"
- t.puts "baz"
- t.close
- @tmps << t
- t
- end
-
- def ruby(*args)
- args = ['-e', '$>.write($<.read)'] if args.empty?
- ruby = EnvUtil.rubybin
- f = IO.popen([ruby] + args, 'r+')
- yield(f)
- ensure
- f.close unless !f || f.closed?
- end
-
- def no_safe_rename
- /cygwin|mswin|mingw|bccwin/ =~ RUBY_PLATFORM
- end
-
- def test_argf
- src = <<-SRC
- a = ARGF
- b = a.dup
- p [a.gets.chomp, a.lineno, b.gets.chomp, b.lineno] #=> ["1", 1, "1", 1]
- p [a.gets.chomp, a.lineno, b.gets.chomp, b.lineno] #=> ["2", 2, "2", 2]
- a.rewind
- b.rewind
- p [a.gets.chomp, a.lineno, b.gets.chomp, b.lineno] #=> ["1", 1, "1", 3]
- p [a.gets.chomp, a.lineno, b.gets.chomp, b.lineno] #=> ["2", 2, "2", 4]
- p [a.gets.chomp, a.lineno, b.gets.chomp, b.lineno] #=> ["3", 3, "3", 5]
- p [a.gets.chomp, a.lineno, b.gets.chomp, b.lineno] #=> ["4", 4, "4", 6]
- p [a.gets.chomp, a.lineno, b.gets.chomp, b.lineno] #=> ["5", 5, "5", 7]
- a.rewind
- b.rewind
- p [a.gets.chomp, a.lineno, b.gets.chomp, b.lineno] #=> ["5", 5, "5", 8]
- p [a.gets.chomp, a.lineno, b.gets.chomp, b.lineno] #=> ["6", 6, "6", 9]
- SRC
- expected = src.scan(/\#=> *(.*+)/).flatten
- ruby('-e', src, @t1.path, @t2.path, @t3.path) do |f|
- f.each_with_index do |a, i|
- assert_equal(expected.shift, a.chomp, "[ruby-dev:34445]: line #{i}")
- end
-
- assert_empty(expected, "[ruby-dev:34445]: remained")
-
- # is this test OK? [ruby-dev:34445]
- end
- end
-
- def test_lineno
- src = <<-SRC
- a = ARGF
- a.gets; p $. #=> 1
- a.gets; p $. #=> 2
- a.gets; p $. #=> 3
- a.rewind; p $. #=> 3
- a.gets; p $. #=> 3
- a.gets; p $. #=> 4
- a.rewind; p $. #=> 4
- a.gets; p $. #=> 3
- a.lineno = 1000; p $. #=> 1000
- a.gets; p $. #=> 1001
- a.gets; p $. #=> 1002
- $. = 2000
- a.gets; p $. #=> 2001
- a.gets; p $. #=> 2001
- SRC
- expected = src.scan(/\#=> *(.*+)/).join(",")
- ruby('-e', src, @t1.path, @t2.path, @t3.path) do |f|
- assert_equal(expected, f.read.chomp.gsub("\n", ","))
- end
- end
-
- def test_lineno2
- src = <<-SRC
- a = ARGF.dup
- a.gets; p $. #=> 1
- a.gets; p $. #=> 2
- a.gets; p $. #=> 1
- a.rewind; p $. #=> 1
- a.gets; p $. #=> 1
- a.gets; p $. #=> 2
- a.gets; p $. #=> 1
- a.lineno = 1000; p $. #=> 1
- a.gets; p $. #=> 2
- a.gets; p $. #=> 2
- $. = 2000
- a.gets; p $. #=> 2000
- a.gets; p $. #=> 2000
- SRC
- expected = src.scan(/\#=> *(.*+)/).join(",")
- ruby('-e', src, @t1.path, @t2.path, @t3.path) do |f|
- assert_equal(expected, f.read.chomp.gsub("\n", ","))
- end
- end
-
- def test_inplace
- assert_in_out_err(["-", @t1.path, @t2.path, @t3.path], <<-INPUT, [], [])
- ARGF.inplace_mode = '.bak'
- while line = ARGF.gets
- puts line.chomp + '.new'
- end
- INPUT
- assert_equal("1.new\n2.new\n", File.read(@t1.path))
- assert_equal("3.new\n4.new\n", File.read(@t2.path))
- assert_equal("5.new\n6.new\n", File.read(@t3.path))
- assert_equal("1\n2\n", File.read(@t1.path + ".bak"))
- assert_equal("3\n4\n", File.read(@t2.path + ".bak"))
- assert_equal("5\n6\n", File.read(@t3.path + ".bak"))
- end
-
- def test_inplace2
- assert_in_out_err(["-", @t1.path, @t2.path, @t3.path], <<-INPUT, [], [])
- ARGF.inplace_mode = '.bak'
- puts ARGF.gets.chomp + '.new'
- puts ARGF.gets.chomp + '.new'
- p ARGF.inplace_mode
- ARGF.inplace_mode = nil
- puts ARGF.gets.chomp + '.new'
- puts ARGF.gets.chomp + '.new'
- p ARGF.inplace_mode
- ARGF.inplace_mode = '.bak'
- puts ARGF.gets.chomp + '.new'
- p ARGF.inplace_mode
- ARGF.inplace_mode = nil
- puts ARGF.gets.chomp + '.new'
- INPUT
- assert_equal("1.new\n2.new\n\".bak\"\n3.new\n4.new\nnil\n", File.read(@t1.path))
- assert_equal("3\n4\n", File.read(@t2.path))
- assert_equal("5.new\n\".bak\"\n6.new\n", File.read(@t3.path))
- assert_equal("1\n2\n", File.read(@t1.path + ".bak"))
- assert_equal(false, File.file?(@t2.path + ".bak"))
- assert_equal("5\n6\n", File.read(@t3.path + ".bak"))
- end
-
- def test_inplace3
- assert_in_out_err(["-i.bak", "-", @t1.path, @t2.path, @t3.path], <<-INPUT, [], [])
- puts ARGF.gets.chomp + '.new'
- puts ARGF.gets.chomp + '.new'
- p $-i
- $-i = nil
- puts ARGF.gets.chomp + '.new'
- puts ARGF.gets.chomp + '.new'
- p $-i
- $-i = '.bak'
- puts ARGF.gets.chomp + '.new'
- p $-i
- $-i = nil
- puts ARGF.gets.chomp + '.new'
- INPUT
- assert_equal("1.new\n2.new\n\".bak\"\n3.new\n4.new\nnil\n", File.read(@t1.path))
- assert_equal("3\n4\n", File.read(@t2.path))
- assert_equal("5.new\n\".bak\"\n6.new\n", File.read(@t3.path))
- assert_equal("1\n2\n", File.read(@t1.path + ".bak"))
- assert_equal(false, File.file?(@t2.path + ".bak"))
- assert_equal("5\n6\n", File.read(@t3.path + ".bak"))
- end
-
- def test_inplace_rename_impossible
- t = make_tempfile
-
- assert_in_out_err(["-", t.path], <<-INPUT) do |r, e|
- ARGF.inplace_mode = '/\\\\'
- while line = ARGF.gets
- puts line.chomp + '.new'
- end
- INPUT
- if no_safe_rename
- assert_equal([], e)
- assert_equal([], r)
- assert_equal("foo.new\nbar.new\nbaz.new\n", File.read(t.path))
- else
- assert_match(/Can't rename .* to .*: .*. skipping file/, e.first) #'
- assert_equal([], r)
- assert_equal("foo\nbar\nbaz\n", File.read(t.path))
- end
- end
- end
-
- def test_inplace_no_backup
- t = make_tempfile
-
- assert_in_out_err(["-", t.path], <<-INPUT) do |r, e|
- ARGF.inplace_mode = ''
- while line = ARGF.gets
- puts line.chomp + '.new'
- end
- INPUT
- if no_safe_rename
- assert_match(/Can't do inplace edit without backup/, e.join) #'
- else
- assert_equal([], e)
- assert_equal([], r)
- assert_equal("foo.new\nbar.new\nbaz.new\n", File.read(t.path))
- end
- end
- end
-
- def test_inplace_dup
- t = make_tempfile
-
- assert_in_out_err(["-", t.path], <<-INPUT, [], [])
- ARGF.inplace_mode = '.bak'
- f = ARGF.dup
- while line = f.gets
- puts line.chomp + '.new'
- end
- INPUT
- assert_equal("foo.new\nbar.new\nbaz.new\n", File.read(t.path))
- end
-
- def test_inplace_stdin
- t = make_tempfile
-
- assert_in_out_err(["-", "-"], <<-INPUT, [], /Can't do inplace edit for stdio; skipping/)
- ARGF.inplace_mode = '.bak'
- f = ARGF.dup
- while line = f.gets
- puts line.chomp + '.new'
- end
- INPUT
- end
-
- def test_inplace_stdin2
- t = make_tempfile
-
- assert_in_out_err(["-"], <<-INPUT, [], /Can't do inplace edit for stdio/)
- ARGF.inplace_mode = '.bak'
- while line = ARGF.gets
- puts line.chomp + '.new'
- end
- INPUT
- end
-
- def test_encoding
- ruby('-e', <<-SRC, @t1.path, @t2.path, @t3.path) do |f|
- p ARGF.external_encoding.is_a?(Encoding)
- p ARGF.internal_encoding.is_a?(Encoding)
- ARGF.gets
- p ARGF.external_encoding.is_a?(Encoding)
- p ARGF.internal_encoding
- SRC
- assert_equal("true\ntrue\ntrue\nnil\n", f.read)
- end
- end
-
- def test_tell
- ruby('-e', <<-SRC, @t1.path, @t2.path, @t3.path) do |f|
- begin
- ARGF.binmode
- loop do
- p ARGF.tell
- p ARGF.gets
- end
- rescue ArgumentError
- puts "end"
- end
- SRC
- a = f.read.split("\n")
- [0, 2, 4, 2, 4, 2, 4].map {|i| i.to_s }.
- zip((1..6).map {|i| '"' + i.to_s + '\n"' } + ["nil"]).flatten.
- each do |x|
- assert_equal(x, a.shift)
- end
- assert_equal('end', a.shift)
- end
- end
-
- def test_seek
- ruby('-e', <<-SRC, @t1.path, @t2.path, @t3.path) do |f|
- ARGF.seek(4)
- p ARGF.gets #=> "3"
- ARGF.seek(0, IO::SEEK_END)
- p ARGF.gets #=> "5"
- ARGF.seek(4)
- p ARGF.gets #=> nil
- begin
- ARGF.seek(0)
- rescue
- puts "end"
- end
- SRC
- a = f.read.split("\n")
- assert_equal('"3\n"', a.shift)
- assert_equal('"5\n"', a.shift)
- assert_equal('nil', a.shift)
- assert_equal('end', a.shift)
- end
- end
-
- def test_set_pos
- ruby('-e', <<-SRC, @t1.path, @t2.path, @t3.path) do |f|
- ARGF.pos = 4
- p ARGF.gets #=> "3"
- ARGF.pos = 4
- p ARGF.gets #=> "5"
- ARGF.pos = 4
- p ARGF.gets #=> nil
- begin
- ARGF.pos = 4
- rescue
- puts "end"
- end
- SRC
- a = f.read.split("\n")
- assert_equal('"3\n"', a.shift)
- assert_equal('"5\n"', a.shift)
- assert_equal('nil', a.shift)
- assert_equal('end', a.shift)
- end
- end
-
- def test_rewind
- ruby('-e', <<-SRC, @t1.path, @t2.path, @t3.path) do |f|
- ARGF.pos = 4
- ARGF.rewind
- p ARGF.gets #=> "1"
- ARGF.pos = 4
- p ARGF.gets #=> "3"
- ARGF.pos = 4
- p ARGF.gets #=> "5"
- ARGF.pos = 4
- p ARGF.gets #=> nil
- begin
- ARGF.rewind
- rescue
- puts "end"
- end
- SRC
- a = f.read.split("\n")
- assert_equal('"1\n"', a.shift)
- assert_equal('"3\n"', a.shift)
- assert_equal('"5\n"', a.shift)
- assert_equal('nil', a.shift)
- assert_equal('end', a.shift)
- end
- end
-
- def test_fileno
- ruby('-e', <<-SRC, @t1.path, @t2.path, @t3.path) do |f|
- p ARGF.fileno
- ARGF.gets
- ARGF.gets
- p ARGF.fileno
- ARGF.gets
- ARGF.gets
- p ARGF.fileno
- ARGF.gets
- ARGF.gets
- p ARGF.fileno
- ARGF.gets
- begin
- ARGF.fileno
- rescue
- puts "end"
- end
- SRC
- a = f.read.split("\n")
- fd1, fd2, fd3, fd4, tag = a
- assert_match(/^\d+$/, fd1)
- assert_match(/^\d+$/, fd2)
- assert_match(/^\d+$/, fd3)
- assert_match(/^\d+$/, fd4)
- assert_equal('end', tag)
- end
- end
-
- def test_to_io
- ruby('-e', <<-SRC, @t1.path, @t2.path, @t3.path) do |f|
- 8.times do
- p ARGF.to_io
- ARGF.gets
- end
- SRC
- a = f.read.split("\n")
- f11, f12, f13, f21, f22, f31, f32, f4 = a
- assert_equal(f11, f12)
- assert_equal(f11, f13)
- assert_equal(f21, f22)
- assert_equal(f31, f32)
- assert_match(/\(closed\)/, f4)
- f4.sub!(/ \(closed\)/, "")
- assert_equal(f31, f4)
- end
- end
-
- def test_eof
- ruby('-e', <<-SRC, @t1.path, @t2.path, @t3.path) do |f|
- begin
- 8.times do
- p ARGF.eof?
- ARGF.gets
- end
- rescue IOError
- puts "end"
- end
- SRC
- a = f.read.split("\n")
- ((%w(true false) * 4).take(7) + %w(end)).each do |x|
- assert_equal(x, a.shift)
- end
- end
- end
-
- def test_read
- ruby('-e', "p ARGF.read(8)", @t1.path, @t2.path, @t3.path) do |f|
- assert_equal("\"1\\n2\\n3\\n4\\n\"\n", f.read)
- end
- end
-
- def test_read2
- ruby('-e', <<-SRC, @t1.path, @t2.path, @t3.path) do |f|
- s = ""
- ARGF.read(8, s)
- p s
- SRC
- assert_equal("\"1\\n2\\n3\\n4\\n\"\n", f.read)
- end
- end
-
- def test_read3
- ruby('-e', <<-SRC, @t1.path, @t2.path, @t3.path) do |f|
- nil while ARGF.gets
- p ARGF.read
- p ARGF.read(0, "")
- SRC
- assert_equal("nil\n\"\"\n", f.read)
- end
- end
-
- def test_readpartial
- ruby('-e', <<-SRC, @t1.path, @t2.path, @t3.path) do |f|
- s = ""
- begin
- loop do
- s << ARGF.readpartial(1)
- t = ""; ARGF.readpartial(1, t); s << t
- end
- rescue EOFError
- puts s
- end
- SRC
- assert_equal("1\n2\n3\n4\n5\n6\n", f.read)
- end
- end
-
- def test_readpartial2
- ruby('-e', <<-SRC) do |f|
- s = ""
- begin
- loop do
- s << ARGF.readpartial(1)
- t = ""; ARGF.readpartial(1, t); s << t
- end
- rescue EOFError
- $stdout.binmode
- puts s
- end
- SRC
- f.binmode
- f.puts("foo")
- f.puts("bar")
- f.puts("baz")
- f.close_write
- assert_equal("foo\nbar\nbaz\n", f.read)
- end
- end
-
- def test_getc
- ruby('-e', <<-SRC, @t1.path, @t2.path, @t3.path) do |f|
- s = ""
- while c = ARGF.getc
- s << c
- end
- puts s
- SRC
- assert_equal("1\n2\n3\n4\n5\n6\n", f.read)
- end
- end
-
- def test_getbyte
- ruby('-e', <<-SRC, @t1.path, @t2.path, @t3.path) do |f|
- s = []
- while c = ARGF.getbyte
- s << c
- end
- p s
- SRC
- assert_equal("[49, 10, 50, 10, 51, 10, 52, 10, 53, 10, 54, 10]\n", f.read)
- end
- end
-
- def test_readchar
- ruby('-e', <<-SRC, @t1.path, @t2.path, @t3.path) do |f|
- s = ""
- begin
- while c = ARGF.readchar
- s << c
- end
- rescue EOFError
- puts s
- end
- SRC
- assert_equal("1\n2\n3\n4\n5\n6\n", f.read)
- end
- end
-
- def test_readbyte
- ruby('-e', <<-SRC, @t1.path, @t2.path, @t3.path) do |f|
- begin
- s = []
- while c = ARGF.readbyte
- s << c
- end
- rescue EOFError
- p s
- end
- SRC
- assert_equal("[49, 10, 50, 10, 51, 10, 52, 10, 53, 10, 54, 10]\n", f.read)
- end
- end
-
- def test_each_line
- ruby('-e', <<-SRC, @t1.path, @t2.path, @t3.path) do |f|
- s = []
- ARGF.each_line {|l| s << l }
- p s
- SRC
- assert_equal("[\"1\\n\", \"2\\n\", \"3\\n\", \"4\\n\", \"5\\n\", \"6\\n\"]\n", f.read)
- end
- end
-
- def test_each_line_paragraph
- assert_in_out_err(['-e', 'ARGF.each_line("") {|para| p para}'], "a\n\nb\n",
- ["\"a\\n\\n\"", "\"b\\n\""], [])
- end
-
- def test_each_byte
- ruby('-e', <<-SRC, @t1.path, @t2.path, @t3.path) do |f|
- s = []
- ARGF.each_byte {|c| s << c }
- p s
- SRC
- assert_equal("[49, 10, 50, 10, 51, 10, 52, 10, 53, 10, 54, 10]\n", f.read)
- end
- end
-
- def test_each_char
- ruby('-e', <<-SRC, @t1.path, @t2.path, @t3.path) do |f|
- s = ""
- ARGF.each_char {|c| s << c }
- puts s
- SRC
- assert_equal("1\n2\n3\n4\n5\n6\n", f.read)
- end
- end
-
- def test_filename
- ruby('-e', <<-SRC, @t1.path, @t2.path, @t3.path) do |f|
- begin
- puts ARGF.filename.dump
- end while ARGF.gets
- puts ARGF.filename.dump
- SRC
- a = f.read.split("\n")
- assert_equal(@t1.path.dump, a.shift)
- assert_equal(@t1.path.dump, a.shift)
- assert_equal(@t1.path.dump, a.shift)
- assert_equal(@t2.path.dump, a.shift)
- assert_equal(@t2.path.dump, a.shift)
- assert_equal(@t3.path.dump, a.shift)
- assert_equal(@t3.path.dump, a.shift)
- assert_equal(@t3.path.dump, a.shift)
- end
- end
-
- def test_filename2
- ruby('-e', <<-SRC, @t1.path, @t2.path, @t3.path) do |f|
- begin
- puts $FILENAME.dump
- end while ARGF.gets
- puts $FILENAME.dump
- SRC
- a = f.read.split("\n")
- assert_equal(@t1.path.dump, a.shift)
- assert_equal(@t1.path.dump, a.shift)
- assert_equal(@t1.path.dump, a.shift)
- assert_equal(@t2.path.dump, a.shift)
- assert_equal(@t2.path.dump, a.shift)
- assert_equal(@t3.path.dump, a.shift)
- assert_equal(@t3.path.dump, a.shift)
- assert_equal(@t3.path.dump, a.shift)
- end
- end
-
- def test_file
- ruby('-e', <<-SRC, @t1.path, @t2.path, @t3.path) do |f|
- begin
- puts ARGF.file.path.dump
- end while ARGF.gets
- puts ARGF.file.path.dump
- SRC
- a = f.read.split("\n")
- assert_equal(@t1.path.dump, a.shift)
- assert_equal(@t1.path.dump, a.shift)
- assert_equal(@t1.path.dump, a.shift)
- assert_equal(@t2.path.dump, a.shift)
- assert_equal(@t2.path.dump, a.shift)
- assert_equal(@t3.path.dump, a.shift)
- assert_equal(@t3.path.dump, a.shift)
- assert_equal(@t3.path.dump, a.shift)
- end
- end
-
- def test_binmode
- ruby('-e', "ARGF.binmode; STDOUT.binmode; puts ARGF.read", @t1.path, @t2.path, @t3.path) do |f|
- f.binmode
- assert_equal("1\n2\n3\n4\n5\n6\n", f.read)
- end
- end
-
- def test_skip
- ruby('-e', <<-SRC, @t1.path, @t2.path, @t3.path) do |f|
- ARGF.skip
- puts ARGF.gets
- ARGF.skip
- puts ARGF.read
- SRC
- assert_equal("1\n3\n4\n5\n6\n", f.read)
- end
- end
-
- def test_close
- ruby('-e', <<-SRC, @t1.path, @t2.path, @t3.path) do |f|
- ARGF.close
- puts ARGF.read
- SRC
- assert_equal("3\n4\n5\n6\n", f.read)
- end
- end
-
- def test_closed
- ruby('-e', <<-SRC, @t1.path, @t2.path, @t3.path) do |f|
- 3.times do
- p ARGF.closed?
- ARGF.gets
- ARGF.gets
- end
- p ARGF.closed?
- ARGF.gets
- p ARGF.closed?
- SRC
- assert_equal("false\nfalse\nfalse\nfalse\ntrue\n", f.read)
- end
- end
-
- def test_argv
- ruby('-e', "p ARGF.argv; p $*", @t1.path, @t2.path, @t3.path) do |f|
- assert_equal([@t1.path, @t2.path, @t3.path].inspect, f.gets.chomp)
- assert_equal([@t1.path, @t2.path, @t3.path].inspect, f.gets.chomp)
- end
- end
-end
diff --git a/test/ruby/test_array.rb b/test/ruby/test_array.rb
index 2723b37c6a..4c7c3dfb6d 100644
--- a/test/ruby/test_array.rb
+++ b/test/ruby/test_array.rb
@@ -1,16 +1,6 @@
require 'test/unit'
class TestArray < Test::Unit::TestCase
- def setup
- @verbose = $VERBOSE
- $VERBOSE = nil
- @cls = Array
- end
-
- def teardown
- $VERBOSE = @verbose
- end
-
def test_0_literal
assert_equal([1, 2, 3, 4], [1, 2] + [3, 4])
assert_equal([1, 2, 1, 2], [1, 2] * 2)
@@ -74,7 +64,7 @@ class TestArray < Test::Unit::TestCase
end
def test_split_0
- x = "The Book of Mormon"
+ x = "The Boassert of Mormon"
assert_equal(x.reverse, x.split(//).reverse!.join)
assert_equal(x.reverse, x.reverse!)
assert_equal("g:n:i:r:t:s: :e:t:y:b: :1", "1 byte string".split(//).reverse.join(":"))
@@ -125,27 +115,27 @@ class TestArray < Test::Unit::TestCase
def test_beg_end_0
x = [1, 2, 3, 4, 5]
-
+
assert_equal(1, x.first)
assert_equal([1], x.first(1))
assert_equal([1, 2, 3], x.first(3))
-
+
assert_equal(5, x.last)
assert_equal([5], x.last(1))
assert_equal([3, 4, 5], x.last(3))
-
+
assert_equal(1, x.shift)
assert_equal([2, 3, 4], x.shift(3))
assert_equal([5], x)
-
+
assert_equal([2, 3, 4, 5], x.unshift(2, 3, 4))
assert_equal([1, 2, 3, 4, 5], x.unshift(1))
assert_equal([1, 2, 3, 4, 5], x)
-
+
assert_equal(5, x.pop)
assert_equal([3, 4], x.pop(2))
assert_equal([1, 2], x)
-
+
assert_equal([1, 2, 3, 4], x.push(3, 4))
assert_equal([1, 2, 3, 4, 5], x.push(5))
assert_equal([1, 2, 3, 4, 5], x)
@@ -186,6 +176,10 @@ class TestArray < Test::Unit::TestCase
# From rubicon
+ def setup
+ @cls = Array
+ end
+
def test_00_new
a = @cls.new()
assert_instance_of(@cls, a)
@@ -318,7 +312,7 @@ class TestArray < Test::Unit::TestCase
assert_equal(@cls[10, 11, 12], a[9..11])
assert_equal(@cls[10, 11, 12], a[-91..-89])
-
+
assert_nil(a[10, -3])
# Ruby 1.8 feature change:
# Array#[size..x] returns [] instead of nil.
@@ -451,20 +445,16 @@ class TestArray < Test::Unit::TestCase
def test_clone
for taint in [ false, true ]
- for untrust in [ false, true ]
- for frozen in [ false, true ]
- a = @cls[*(0..99).to_a]
- a.taint if taint
- a.untrust if untrust
- a.freeze if frozen
- b = a.clone
-
- assert_equal(a, b)
- assert(a.__id__ != b.__id__)
- assert_equal(a.frozen?, b.frozen?)
- assert_equal(a.untrusted?, b.untrusted?)
- assert_equal(a.tainted?, b.tainted?)
- end
+ for frozen in [ false, true ]
+ a = @cls[*(0..99).to_a]
+ a.taint if taint
+ a.freeze if frozen
+ b = a.clone
+
+ assert_equal(a, b)
+ assert(a.__id__ != b.__id__)
+ assert_equal(a.frozen?, b.frozen?)
+ assert_equal(a.tainted?, b.tainted?)
end
end
end
@@ -476,10 +466,7 @@ class TestArray < Test::Unit::TestCase
assert_equal([], @cls[].collect { 99 })
- # Ruby 1.9 feature change:
- # Enumerable#collect without block returns an Enumerator.
- #assert_equal([1, 2, 3], @cls[1, 2, 3].collect)
- assert_kind_of Enumerator, @cls[1, 2, 3].collect
+ assert_equal([1, 2, 3], @cls[1, 2, 3].collect)
end
# also update map!
@@ -487,7 +474,7 @@ class TestArray < Test::Unit::TestCase
a = @cls[ 1, 'cat', 1..1 ]
assert_equal([ Fixnum, String, Range], a.collect! {|e| e.class} )
assert_equal([ Fixnum, String, Range], a)
-
+
a = @cls[ 1, 'cat', 1..1 ]
assert_equal([ 99, 99, 99], a.collect! { 99 } )
assert_equal([ 99, 99, 99], a)
@@ -535,7 +522,7 @@ class TestArray < Test::Unit::TestCase
assert_equal(@cls[1, 2, 3, 4], @cls[1, 2, 3, 4].concat(@cls[]))
assert_equal(@cls[], @cls[].concat(@cls[]))
assert_equal(@cls[@cls[1, 2], @cls[3, 4]], @cls[@cls[1, 2]].concat(@cls[@cls[3, 4]]))
-
+
a = @cls[1, 2, 3]
a.concat(a)
assert_equal([1, 2, 3, 1, 2, 3], a)
@@ -708,22 +695,10 @@ class TestArray < Test::Unit::TestCase
a5 = @cls[ a1, @cls[], a3 ]
assert_equal(@cls[1, 2, 3, 4, 5, 6], a5.flatten)
assert_equal(@cls[], @cls[].flatten)
- assert_equal(@cls[],
+ assert_equal(@cls[],
@cls[@cls[@cls[@cls[],@cls[]],@cls[@cls[]],@cls[]],@cls[@cls[@cls[]]]].flatten)
assert_raise(TypeError, "[ruby-dev:31197]") { [[]].flatten("") }
-
- a6 = @cls[[1, 2], 3]
- a6.taint
- a6.untrust
- a7 = a6.flatten
- assert_equal(true, a7.tainted?)
- assert_equal(true, a7.untrusted?)
-
- a8 = @cls[[1, 2], 3]
- a9 = a8.flatten(0)
- assert_equal(a8, a9)
- assert_not_same(a8, a9)
end
def test_flatten!
@@ -736,14 +711,11 @@ class TestArray < Test::Unit::TestCase
a5 = @cls[ a1, @cls[], a3 ]
assert_equal(@cls[1, 2, 3, 4, 5, 6], a5.flatten!)
- assert_nil(a5.flatten!(0), '[ruby-core:23382]')
assert_equal(@cls[1, 2, 3, 4, 5, 6], a5)
assert_equal(@cls[], @cls[].flatten)
- assert_equal(@cls[],
+ assert_equal(@cls[],
@cls[@cls[@cls[@cls[],@cls[]],@cls[@cls[]],@cls[]],@cls[@cls[@cls[]]]].flatten)
-
- assert_nil(@cls[].flatten!(0), '[ruby-core:23382]')
end
def test_flatten_with_callcc
@@ -785,8 +757,6 @@ class TestArray < Test::Unit::TestCase
assert_equal(4, a.index([1,2,3]))
assert_nil(a.index('ca'))
assert_nil(a.index([1,2]))
-
- assert_equal(1, a.index(99) {|x| x == 'cat' })
end
def test_values_at
@@ -818,14 +788,6 @@ class TestArray < Test::Unit::TestCase
assert_equal("1,2,3", a.join(','))
$, = ""
- a = @cls[1, 2, 3]
- a.taint
- a.untrust
- s = a.join
- assert_equal(true, s.tainted?)
- assert_equal(true, s.untrusted?)
- ensure
- $, = nil
end
def test_last
@@ -847,7 +809,7 @@ class TestArray < Test::Unit::TestCase
a = @cls[ 1, 'cat', 1..1 ]
assert_equal(@cls[ Fixnum, String, Range], a.map! {|e| e.class} )
assert_equal(@cls[ Fixnum, String, Range], a)
-
+
a = @cls[ 1, 'cat', 1..1 ]
assert_equal(@cls[ 99, 99, 99], a.map! { 99 } )
assert_equal(@cls[ 99, 99, 99], a)
@@ -857,6 +819,14 @@ class TestArray < Test::Unit::TestCase
assert_equal(@cls[], a)
end
+ def test_nitems
+ assert_equal(0, @cls[].nitems)
+ assert_equal(1, @cls[1].nitems)
+ assert_equal(1, @cls[1, nil].nitems)
+ assert_equal(1, @cls[nil, 1].nitems)
+ assert_equal(3, @cls[1, nil, nil, 2, nil, 3, nil].nitems)
+ end
+
def test_pack
a = @cls[*%w( cat wombat x yy)]
assert_equal("catwomx yy ", a.pack("A3A3A3A3"))
@@ -888,17 +858,17 @@ class TestArray < Test::Unit::TestCase
assert_equal("ABC", @cls[ 65, 66, 67 ].pack("c3"))
assert_equal("\377BC", @cls[ -1, 66, 67 ].pack("c*"))
-
+
assert_equal("AB\n\x10", @cls["4142", "0a", "12"].pack("H4H2H1"))
assert_equal("AB\n\x02", @cls["1424", "a0", "21"].pack("h4h2h1"))
- assert_equal("abc=02def=\ncat=\n=01=\n",
+ assert_equal("abc=02def=\ncat=\n=01=\n",
@cls["abc\002def", "cat", "\001"].pack("M9M3M4"))
assert_equal("aGVsbG8K\n", @cls["hello\n"].pack("m"))
assert_equal(",:&5L;&\\*:&5L;&\\*\n", @cls["hello\nhello\n"].pack("u"))
- assert_equal("\u{a9 42 2260}", @cls[0xa9, 0x42, 0x2260].pack("U*"))
+ assert_equal("\xc2\xa9B\xe2\x89\xa0", @cls[0xa9, 0x42, 0x2260].pack("U*"))
format = "c2x5CCxsdils_l_a6";
@@ -1042,8 +1012,6 @@ class TestArray < Test::Unit::TestCase
assert_equal(4, a.rindex([1,2,3]))
assert_nil(a.rindex('ca'))
assert_nil(a.rindex([1,2]))
-
- assert_equal(3, a.rindex(99) {|x| x == [1,2,3] })
end
def test_shift
@@ -1094,7 +1062,7 @@ class TestArray < Test::Unit::TestCase
assert_equal(@cls[10, 11, 12], a.slice(9..11))
assert_equal(@cls[10, 11, 12], a.slice(-91..-89))
-
+
assert_nil(a.slice(-101..-1))
assert_nil(a.slice(10, -3))
@@ -1152,7 +1120,7 @@ class TestArray < Test::Unit::TestCase
a.fill(1)
assert_equal(@cls[1, 1, 1, 1], a.sort)
-
+
assert_equal(@cls[], @cls[].sort)
end
@@ -1169,43 +1137,6 @@ class TestArray < Test::Unit::TestCase
assert_equal(@cls[1], @cls[1].sort!)
assert_equal(@cls[], @cls[].sort!)
-
- a = @cls[4, 3, 2, 1]
- a.sort! {|m, n| a.replace([9, 8, 7, 6]); m <=> n }
- assert_equal([1, 2, 3, 4], a)
-
- a = @cls[4, 3, 2, 1]
- a.sort! {|m, n| a.replace([9, 8, 7]); m <=> n }
- assert_equal([1, 2, 3, 4], a)
- end
-
- def test_sort_with_callcc
- respond_to?(:callcc, true) or require 'continuation'
- n = 1000
- cont = nil
- ary = (1..100).to_a
- begin
- ary.sort! {|a,b|
- callcc {|k| cont = k} unless cont
- assert_equal(100, ary.size, '[ruby-core:16679]')
- a <=> b
- }
- rescue => e
- end
- n -= 1
- cont.call if 0 < n
- assert_instance_of(RuntimeError, e, '[ruby-core:16679]')
- assert_match(/reentered/, e.message, '[ruby-core:16679]')
- end
-
- def test_sort_with_replace
- xary = (1..100).to_a
- 100.times do
- ary = (1..100).to_a
- ary.sort! {|a,b| ary.replace(xary); a <=> b}
- GC.start
- assert_equal(xary, ary, '[ruby-dev:34732]')
- end
end
def test_to_a
@@ -1229,21 +1160,21 @@ class TestArray < Test::Unit::TestCase
def test_to_s
$, = ""
a = @cls[]
- assert_equal("[]", a.to_s)
+ assert_equal("", a.to_s)
$, = ""
a = @cls[1, 2]
- assert_equal("[1, 2]", a.to_s)
+ assert_equal("12", a.to_s)
$, = ""
a = @cls[1, 2, 3]
- assert_equal("[1, 2, 3]", a.to_s)
+ assert_equal("123", a.to_s)
$, = ":"
a = @cls[1, 2, 3]
- assert_equal("[1, 2, 3]", a.to_s)
- ensure
- $, = nil
+ assert_equal("1:2:3", a.to_s)
+
+ $, = ""
end
def test_uniq
@@ -1252,11 +1183,6 @@ class TestArray < Test::Unit::TestCase
assert_equal(@cls[1, 2, 3, 4, nil], a.uniq)
assert_equal(b, a)
- c = @cls["a:def", "a:xyz", "b:abc", "b:xyz", "c:jkl"]
- d = c.dup
- assert_equal(@cls[ "a:def", "b:abc", "c:jkl" ], c.uniq {|s| s[/^\w+/]})
- assert_equal(d, c)
-
assert_equal(@cls[1, 2, 3], @cls[1, 2, 3].uniq)
end
@@ -1265,14 +1191,6 @@ class TestArray < Test::Unit::TestCase
assert_equal(@cls[1, 2, 3, 4, nil], a.uniq!)
assert_equal(@cls[1, 2, 3, 4, nil], a)
- c = @cls["a:def", "a:xyz", "b:abc", "b:xyz", "c:jkl"]
- assert_equal(@cls[ "a:def", "b:abc", "c:jkl" ], c.uniq! {|s| s[/^\w+/]})
- assert_equal(@cls[ "a:def", "b:abc", "c:jkl" ], c)
-
- c = @cls["a:def", "b:abc", "c:jkl"]
- assert_equal(nil, c.uniq! {|s| s[/^\w+/]})
- assert_equal(@cls[ "a:def", "b:abc", "c:jkl" ], c)
-
assert_nil(@cls[1, 2, 3].uniq!)
end
@@ -1295,7 +1213,7 @@ class TestArray < Test::Unit::TestCase
assert_equal(@cls[1,2], @cls[1, 2] | @cls[1, 2])
end
- def test_combination
+ def test_combination
assert_equal(@cls[[]], @cls[1,2,3,4].combination(0).to_a)
assert_equal(@cls[[1],[2],[3],[4]], @cls[1,2,3,4].combination(1).to_a)
assert_equal(@cls[[1,2],[1,3],[1,4],[2,3],[2,4],[3,4]], @cls[1,2,3,4].combination(2).to_a)
@@ -1310,7 +1228,7 @@ class TestArray < Test::Unit::TestCase
assert_equal(@cls[[1,1],[1,2],[2,1],[2,2]], @cls[1,2].product([1,2]))
assert_equal(@cls[[1,3,5],[1,3,6],[1,4,5],[1,4,6],
- [2,3,5],[2,3,6],[2,4,5],[2,4,6]],
+ [2,3,5],[2,3,6],[2,4,5],[2,4,6]],
@cls[1,2].product([3,4],[5,6]))
assert_equal(@cls[[1],[2]], @cls[1,2].product)
assert_equal(@cls[], @cls[1,2].product([]))
@@ -1330,11 +1248,6 @@ class TestArray < Test::Unit::TestCase
"edcba".each_char.to_a.permutation(5).sort)
assert_equal(@cls[].permutation(0).to_a, @cls[[]])
- a = @cls[1, 2, 3, 4]
- b = @cls[]
- a.permutation {|x| b << x; a.replace(@cls[9, 8, 7, 6]) }
- assert_equal(@cls[9, 8, 7, 6], a)
- assert_equal(@cls[1, 2, 3, 4].permutation.to_a, b)
end
def test_take
@@ -1356,362 +1269,4 @@ class TestArray < Test::Unit::TestCase
def test_drop_while
assert_equal([3,4,5,0], [1,2,3,4,5,0].drop_while {|i| i < 3 })
end
-
- def test_modify_check
- a = []
- a.freeze
- assert_raise(RuntimeError) { a.shift }
- a = [1, 2]
- assert_raise(SecurityError) do
- Thread.new do
- $SAFE = 4
- a.shift
- end.value
- end
- end
-
- LONGP = [127, 63, 31, 15, 7].map {|x| 2**x-1 }.find do |x|
- begin
- [].first(x)
- rescue ArgumentError
- true
- rescue RangeError
- false
- end
- end
-
- def test_ary_new
- assert_raise(ArgumentError) { [].to_enum.first(-1) }
- assert_raise(ArgumentError) { [].to_enum.first(LONGP) }
- end
-
- def test_try_convert
- assert_equal([1], Array.try_convert([1]))
- assert_equal(nil, Array.try_convert("1"))
- end
-
- def test_initialize
- assert_nothing_raised { [].instance_eval { initialize } }
- assert_nothing_raised { Array.new { } }
- assert_equal([1, 2, 3], Array.new([1, 2, 3]))
- assert_raise(ArgumentError) { Array.new(-1, 1) }
- assert_raise(ArgumentError) { Array.new(LONGP, 1) }
- assert_equal([1, 1, 1], Array.new(3, 1))
- assert_equal([1, 1, 1], Array.new(3) { 1 })
- assert_equal([1, 1, 1], Array.new(3, 1) { 1 })
- end
-
- def test_aset
- assert_raise(IndexError) { [0][-2] = 1 }
- assert_raise(IndexError) { [0][LONGP] = 2 }
- assert_raise(IndexError) { [0][(LONGP + 1) / 2 - 1] = 2 }
- a = [0]
- a[2] = 4
- assert_equal([0, nil, 4], a)
- assert_raise(ArgumentError) { [0][0, 0, 0] = 0 }
- end
-
- def test_first2
- assert_equal([0], [0].first(2))
- assert_raise(ArgumentError) { [0].first(-1) }
- end
-
- def test_shift2
- assert_equal(0, ([0] * 16).shift)
- # check
- a = [0, 1, 2]
- a[3] = 3
- a.shift(2)
- assert_equal([2, 3], a)
- end
-
- def test_unshift2
- Struct.new(:a, :b, :c)
- end
-
- def test_aref
- assert_raise(ArgumentError) { [][0, 0, 0] }
- end
-
- def test_fetch
- assert_equal(1, [].fetch(0, 0) { 1 })
- assert_equal(1, [0, 1].fetch(-1))
- assert_raise(IndexError) { [0, 1].fetch(2) }
- assert_raise(IndexError) { [0, 1].fetch(-3) }
- assert_equal(2, [0, 1].fetch(2, 2))
- end
-
- def test_index2
- a = [0, 1, 2]
- assert_equal(a, a.index.to_a)
- assert_equal(1, a.index {|x| x == 1 })
- end
-
- def test_rindex2
- a = [0, 1, 2]
- assert_equal([2, 1, 0], a.rindex.to_a)
- assert_equal(1, a.rindex {|x| x == 1 })
-
- a = [0, 1]
- e = a.rindex
- assert_equal(1, e.next)
- a.clear
- assert_raise(StopIteration) { e.next }
-
- o = Object.new
- class << o; self; end.class_eval do
- define_method(:==) {|x| a.clear; false }
- end
- a = [nil, o]
- assert_equal(nil, a.rindex(0))
- end
-
- def test_ary_to_ary
- o = Object.new
- def o.to_ary; [1, 2, 3]; end
- a, b, c = o
- assert_equal([1, 2, 3], [a, b, c])
- end
-
- def test_splice
- a = [0]
- assert_raise(IndexError) { a[-2, 0] = nil }
- end
-
- def test_insert
- a = [0]
- assert_equal([0], a.insert(1))
- assert_equal([0, 1], a.insert(1, 1))
- assert_raise(ArgumentError) { a.insert }
- assert_equal([0, 1, 2], a.insert(-1, 2))
- assert_equal([0, 1, 3, 2], a.insert(-2, 3))
- end
-
- def test_join2
- a = []
- a << a
- assert_raise(ArgumentError){a.join}
-
- def (a = Object.new).to_a
- [self]
- end
- assert_raise(ArgumentError, '[ruby-core:24150]'){[a].join}
- assert_equal("12345", [1,[2,[3,4],5]].join)
- end
-
- def test_to_a2
- klass = Class.new(Array)
- a = klass.new.to_a
- assert_equal([], a)
- assert_equal(Array, a.class)
- end
-
- def test_values_at2
- a = [0, 1, 2, 3, 4, 5]
- assert_equal([1, 2, 3], a.values_at(1..3))
- assert_equal([], a.values_at(7..8))
- assert_equal([nil], a.values_at(2**31-1))
- end
-
- def test_select
- assert_equal([0, 2], [0, 1, 2, 3].select {|x| x % 2 == 0 })
- end
-
- def test_delete2
- a = [0] * 1024 + [1] + [0] * 1024
- a.delete(0)
- assert_equal([1], a)
- end
-
- def test_reject
- assert_equal([1, 3], [0, 1, 2, 3].reject {|x| x % 2 == 0 })
- end
-
- def test_zip
- assert_equal([[1, :a, "a"], [2, :b, "b"], [3, nil, "c"]],
- [1, 2, 3].zip([:a, :b], ["a", "b", "c", "d"]))
- a = []
- [1, 2, 3].zip([:a, :b], ["a", "b", "c", "d"]) {|x| a << x }
- assert_equal([[1, :a, "a"], [2, :b, "b"], [3, nil, "c"]], a)
-
- ary = Object.new
- def ary.to_a; [1, 2]; end
- assert_raise(NoMethodError){ %w(a b).zip(ary) }
- def ary.each; [3, 4].each{|e|yield e}; end
- assert_equal([['a', 3], ['b', 4]], %w(a b).zip(ary))
- def ary.to_ary; [5, 6]; end
- assert_equal([['a', 5], ['b', 6]], %w(a b).zip(ary))
- end
-
- def test_transpose
- assert_equal([[1, :a], [2, :b], [3, :c]],
- [[1, 2, 3], [:a, :b, :c]].transpose)
- assert_raise(IndexError) { [[1, 2, 3], [:a, :b]].transpose }
- end
-
- def test_clear2
- assert_equal([], ([0] * 1024).clear)
- end
-
- def test_fill2
- assert_raise(ArgumentError) { [].fill(0, 1, LONGP) }
- end
-
- def test_times
- assert_raise(ArgumentError) { [0, 0, 0, 0] * ((LONGP + 1) / 4) }
- end
-
- def test_equal
- o = Object.new
- def o.to_ary; end
- def o.==(x); :foo; end
- assert(:foo, [0, 1, 2] == o)
- assert([0, 1, 2] != [0, 1, 3])
- end
-
- def test_hash2
- a = []
- a << a
- assert_raise(ArgumentError) { a.hash }
- end
-
- def test_flatten2
- a = []
- a << a
- assert_raise(ArgumentError) { a.flatten }
- end
-
- def test_shuffle
- 100.times do
- assert_equal([0, 1, 2], [2, 1, 0].shuffle.sort)
- end
- end
-
- def test_sample
- 100.times do
- assert([0, 1, 2].include?([2, 1, 0].sample))
- samples = [2, 1, 0].sample(2)
- samples.each{|sample|
- assert([0, 1, 2].include?(sample))
- }
- end
-
- srand(0)
- a = (1..18).to_a
- (0..20).each do |n|
- 10000.times do
- b = a.sample(n)
- assert_equal([n, 18].min, b.uniq.size)
- assert_equal(a, (a | b).sort)
- assert_equal(b.sort, (a & b).sort)
- end
-
- h = Hash.new(0)
- 10000.times do
- a.sample(n).each {|x| h[x] += 1 }
- end
- assert_operator(h.values.min * 2, :>=, h.values.max) if n != 0
- end
-
- assert_raise(ArgumentError, '[ruby-core:23374]') {[1, 2].sample(-1)}
- end
-
- def test_cycle
- a = []
- [0, 1, 2].cycle do |i|
- a << i
- break if a.size == 10
- end
- assert_equal([0, 1, 2, 0, 1, 2, 0, 1, 2, 0], a)
-
- a = [0, 1, 2]
- assert_nil(a.cycle { a.clear })
-
- a = []
- [0, 1, 2].cycle(3) {|i| a << i }
- assert_equal([0, 1, 2, 0, 1, 2, 0, 1, 2], a)
- end
-
- def test_reverse_each2
- a = [0, 1, 2, 3, 4, 5]
- r = []
- a.reverse_each do |x|
- r << x
- a.pop
- a.pop
- end
- assert_equal([5, 3, 1], r)
- end
-
- def test_combination2
- assert_raise(RangeError) do
- (0..100).to_a.combination(50) {}
- end
- end
-
- def test_product2
- a = (0..100).to_a
- assert_raise(RangeError) do
- a.product(a, a, a, a, a, a, a, a, a, a) {}
- end
- end
-
- class Array2 < Array
- end
-
- def test_array_subclass
- assert_equal(Array2, Array2[1,2,3].uniq.class, "[ruby-dev:34581]")
- assert_equal(Array2, Array2[1,2][0,1].class) # embeded
- assert_equal(Array2, Array2[*(1..100)][1..99].class) #not embeded
- end
-
- def test_inspect
- a = @cls[1, 2, 3]
- a.taint
- a.untrust
- s = a.inspect
- assert_equal(true, s.tainted?)
- assert_equal(true, s.untrusted?)
- end
-
- def test_initialize2
- a = [1] * 1000
- a.instance_eval { initialize }
- assert_equal([], a)
- end
-
- def test_shift_shared_ary
- a = (1..100).to_a
- b = []
- b.replace(a)
- assert_equal((1..10).to_a, a.shift(10))
- assert_equal((11..100).to_a, a)
- end
-
- def test_replace_shared_ary
- a = [1] * 100
- b = []
- b.replace(a)
- a.replace([1, 2, 3])
- assert_equal([1, 2, 3], a)
- assert_equal([1] * 100, b)
- end
-
- def test_fill_negative_length
- a = (1..10).to_a
- a.fill(:foo, 5, -3)
- assert_equal((1..10).to_a, a)
- end
-
- def test_slice_freezed_array
- a = [1,2,3,4,5].freeze
- assert_equal([1,2,3,4], a[0,4])
- assert_equal([2,3,4,5], a[1,4])
- end
-
- def test_sort_by!
- a = [1,3,5,2,4]
- a.sort_by! {|x| -x }
- assert_equal([5,4,3,2,1], a)
- end
end
diff --git a/test/ruby/test_assignment.rb b/test/ruby/test_assignment.rb
index b82cee81d1..63f37a9d73 100644
--- a/test/ruby/test_assignment.rb
+++ b/test/ruby/test_assignment.rb
@@ -29,26 +29,30 @@ class TestAssignment < Test::Unit::TestCase
a = [*[1]]; assert_equal([1], a)
a = [*[1,2]]; assert_equal([1,2], a)
- a = *[]; assert_equal([], a)
- a = *[1]; assert_equal([1], a)
- a = *[nil]; assert_equal([nil], a)
- a = *[[]]; assert_equal([[]], a)
+ a = *nil; assert_nil(a)
+ a = *1; assert_equal(1, a)
+ a = *[]; assert_nil(a)
+ a = *[1]; assert_equal(1, a)
+ a = *[nil]; assert_nil(a)
+ a = *[[]]; assert_equal([], a)
a = *[1,2]; assert_equal([1,2], a)
- a = *[*[]]; assert_equal([], a)
- a = *[*[1]]; assert_equal([1], a)
+ a = *[*[]]; assert_nil(a)
+ a = *[*[1]]; assert_equal(1, a)
a = *[*[1,2]]; assert_equal([1,2], a)
*a = nil; assert_equal([nil], a)
*a = 1; assert_equal([1], a)
- *a = []; assert_equal([], a)
- *a = [1]; assert_equal([1], a)
- *a = [nil]; assert_equal([nil], a)
- *a = [[]]; assert_equal([[]], a)
- *a = [1,2]; assert_equal([1,2], a)
- *a = [*[]]; assert_equal([], a)
- *a = [*[1]]; assert_equal([1], a)
- *a = [*[1,2]]; assert_equal([1,2], a)
-
+ *a = []; assert_equal([[]], a)
+ *a = [1]; assert_equal([[1]], a)
+ *a = [nil]; assert_equal([[nil]], a)
+ *a = [[]]; assert_equal([[[]]], a)
+ *a = [1,2]; assert_equal([[1,2]], a)
+ *a = [*[]]; assert_equal([[]], a)
+ *a = [*[1]]; assert_equal([[1]], a)
+ *a = [*[1,2]]; assert_equal([[1,2]], a)
+
+ *a = *nil; assert_equal([nil], a)
+ *a = *1; assert_equal([1], a)
*a = *[]; assert_equal([], a)
*a = *[1]; assert_equal([1], a)
*a = *[nil]; assert_equal([nil], a)
@@ -69,6 +73,8 @@ class TestAssignment < Test::Unit::TestCase
a,b,*c = [*[1]]; assert_equal([1,nil,[]], [a,b,c])
a,b,*c = [*[1,2]]; assert_equal([1,2,[]], [a,b,c])
+ a,b,*c = *nil; assert_equal([nil,nil,[]], [a,b,c])
+ a,b,*c = *1; assert_equal([1,nil,[]], [a,b,c])
a,b,*c = *[]; assert_equal([nil,nil,[]], [a,b,c])
a,b,*c = *[1]; assert_equal([1,nil,[]], [a,b,c])
a,b,*c = *[nil]; assert_equal([nil,nil,[]], [a,b,c])
@@ -80,133 +86,155 @@ class TestAssignment < Test::Unit::TestCase
end
def test_yield
- def f; yield(nil); end; f {|a| assert_nil(a)}; undef f
- def f; yield(1); end; f {|a| assert_equal(1, a)}; undef f
- def f; yield([]); end; f {|a| assert_equal([], a)}; undef f
- def f; yield([1]); end; f {|a| assert_equal([1], a)}; undef f
- def f; yield([nil]); end; f {|a| assert_equal([nil], a)}; undef f
- def f; yield([[]]); end; f {|a| assert_equal([[]], a)}; undef f
- def f; yield([*[]]); end; f {|a| assert_equal([], a)}; undef f
- def f; yield([*[1]]); end; f {|a| assert_equal([1], a)}; undef f
- def f; yield([*[1,2]]); end; f {|a| assert_equal([1,2], a)}; undef f
-
- def f; yield(*[1]); end; f {|a| assert_equal(1, a)}; undef f
- def f; yield(*[nil]); end; f {|a| assert_equal(nil, a)}; undef f
- def f; yield(*[[]]); end; f {|a| assert_equal([], a)}; undef f
- def f; yield(*[*[1]]); end; f {|a| assert_equal(1, a)}; undef f
-
- def f; yield; end; f {|*a| assert_equal([], a)}; undef f
- def f; yield(nil); end; f {|*a| assert_equal([nil], a)}; undef f
- def f; yield(1); end; f {|*a| assert_equal([1], a)}; undef f
- def f; yield([]); end; f {|*a| assert_equal([[]], a)}; undef f
- def f; yield([1]); end; f {|*a| assert_equal([[1]], a)}; undef f
- def f; yield([nil]); end; f {|*a| assert_equal([[nil]], a)}; undef f
- def f; yield([[]]); end; f {|*a| assert_equal([[[]]], a)}; undef f
- def f; yield([1,2]); end; f {|*a| assert_equal([[1,2]], a)}; undef f
- def f; yield([*[]]); end; f {|*a| assert_equal([[]], a)}; undef f
- def f; yield([*[1]]); end; f {|*a| assert_equal([[1]], a)}; undef f
- def f; yield([*[1,2]]); end; f {|*a| assert_equal([[1,2]], a)}; undef f
-
- def f; yield(*[]); end; f {|*a| assert_equal([], a)}; undef f
- def f; yield(*[1]); end; f {|*a| assert_equal([1], a)}; undef f
- def f; yield(*[nil]); end; f {|*a| assert_equal([nil], a)}; undef f
- def f; yield(*[[]]); end; f {|*a| assert_equal([[]], a)}; undef f
- def f; yield(*[*[]]); end; f {|*a| assert_equal([], a)}; undef f
- def f; yield(*[*[1]]); end; f {|*a| assert_equal([1], a)}; undef f
- def f; yield(*[*[1,2]]); end; f {|*a| assert_equal([1,2], a)}; undef f
-
- def f; yield; end; f {|a,b,*c| assert_equal([nil,nil,[]], [a,b,c])}; undef f
- def f; yield(nil); end; f {|a,b,*c| assert_equal([nil,nil,[]], [a,b,c])}; undef f
- def f; yield(1); end; f {|a,b,*c| assert_equal([1,nil,[]], [a,b,c])}; undef f
- def f; yield([]); end; f {|a,b,*c| assert_equal([nil,nil,[]], [a,b,c])}; undef f
- def f; yield([1]); end; f {|a,b,*c| assert_equal([1,nil,[]], [a,b,c])}; undef f
- def f; yield([nil]); end; f {|a,b,*c| assert_equal([nil,nil,[]], [a,b,c])}; undef f
- def f; yield([[]]); end; f {|a,b,*c| assert_equal([[],nil,[]], [a,b,c])}; undef f
- def f; yield([*[]]); end; f {|a,b,*c| assert_equal([nil,nil,[]], [a,b,c])}; undef f
- def f; yield([*[1]]); end; f {|a,b,*c| assert_equal([1,nil,[]], [a,b,c])}; undef f
- def f; yield([*[1,2]]); end; f {|a,b,*c| assert_equal([1,2,[]], [a,b,c])}; undef f
-
- def f; yield(*[]); end; f {|a,b,*c| assert_equal([nil,nil,[]], [a,b,c])}; undef f
- def f; yield(*[1]); end; f {|a,b,*c| assert_equal([1,nil,[]], [a,b,c])}; undef f
- def f; yield(*[nil]); end; f {|a,b,*c| assert_equal([nil,nil,[]], [a,b,c])}; undef f
- def f; yield(*[[]]); end; f {|a,b,*c| assert_equal([nil,nil,[]], [a,b,c])}; undef f
- def f; yield(*[*[]]); end; f {|a,b,*c| assert_equal([nil,nil,[]], [a,b,c])}; undef f
- def f; yield(*[*[1]]); end; f {|a,b,*c| assert_equal([1,nil,[]], [a,b,c])}; undef f
- def f; yield(*[*[1,2]]); end; f {|a,b,*c| assert_equal([1,2,[]], [a,b,c])}; undef f
+ def f; yield nil; end; f {|a| assert_nil(a)}
+ def f; yield 1; end; f {|a| assert_equal(1, a)}
+ def f; yield []; end; f {|a| assert_equal([], a)}
+ def f; yield [1]; end; f {|a| assert_equal([1], a)}
+ def f; yield [nil]; end; f {|a| assert_equal([nil], a)}
+ def f; yield [[]]; end; f {|a| assert_equal([[]], a)}
+ def f; yield [*[]]; end; f {|a| assert_equal([], a)}
+ def f; yield [*[1]]; end; f {|a| assert_equal([1], a)}
+ def f; yield [*[1,2]]; end; f {|a| assert_equal([1,2], a)}
+
+ def f; yield *nil; end; f {|a| assert_nil(a)}
+ def f; yield *1; end; f {|a| assert_equal(1, a)}
+ def f; yield *[1]; end; f {|a| assert_equal(1, a)}
+ def f; yield *[nil]; end; f {|a| assert_nil(a)}
+ def f; yield *[[]]; end; f {|a| assert_equal([], a)}
+ def f; yield *[*[1]]; end; f {|a| assert_equal(1, a)}
+
+ def f; yield; end; f {|*a| assert_equal([], a)}
+ def f; yield nil; end; f {|*a| assert_equal([nil], a)}
+ def f; yield 1; end; f {|*a| assert_equal([1], a)}
+ def f; yield []; end; f {|*a| assert_equal([[]], a)}
+ def f; yield [1]; end; f {|*a| assert_equal([[1]], a)}
+ def f; yield [nil]; end; f {|*a| assert_equal([[nil]], a)}
+ def f; yield [[]]; end; f {|*a| assert_equal([[[]]], a)}
+ def f; yield [1,2]; end; f {|*a| assert_equal([[1,2]], a)}
+ def f; yield [*[]]; end; f {|*a| assert_equal([[]], a)}
+ def f; yield [*[1]]; end; f {|*a| assert_equal([[1]], a)}
+ def f; yield [*[1,2]]; end; f {|*a| assert_equal([[1,2]], a)}
+
+ def f; yield *nil; end; f {|*a| assert_equal([nil], a)}
+ def f; yield *1; end; f {|*a| assert_equal([1], a)}
+ def f; yield *[]; end; f {|*a| assert_equal([], a)}
+ def f; yield *[1]; end; f {|*a| assert_equal([1], a)}
+ def f; yield *[nil]; end; f {|*a| assert_equal([nil], a)}
+ def f; yield *[[]]; end; f {|*a| assert_equal([[]], a)}
+ def f; yield *[*[]]; end; f {|*a| assert_equal([], a)}
+ def f; yield *[*[1]]; end; f {|*a| assert_equal([1], a)}
+ def f; yield *[*[1,2]]; end; f {|*a| assert_equal([1,2], a)}
+
+ def f; yield; end; f {|a,b,*c| assert_equal([nil,nil,[]], [a,b,c])}
+ def f; yield nil; end; f {|a,b,*c| assert_equal([nil,nil,[]], [a,b,c])}
+ def f; yield 1; end; f {|a,b,*c| assert_equal([1,nil,[]], [a,b,c])}
+ def f; yield []; end; f {|a,b,*c| assert_equal([nil,nil,[]], [a,b,c])}
+ def f; yield [1]; end; f {|a,b,*c| assert_equal([1,nil,[]], [a,b,c])}
+ def f; yield [nil]; end; f {|a,b,*c| assert_equal([nil,nil,[]], [a,b,c])}
+ def f; yield [[]]; end; f {|a,b,*c| assert_equal([[],nil,[]], [a,b,c])}
+ def f; yield [*[]]; end; f {|a,b,*c| assert_equal([nil,nil,[]], [a,b,c])}
+ def f; yield [*[1]]; end; f {|a,b,*c| assert_equal([1,nil,[]], [a,b,c])}
+ def f; yield [*[1,2]]; end; f {|a,b,*c| assert_equal([1,2,[]], [a,b,c])}
+
+ def f; yield *nil; end; f {|a,b,*c| assert_equal([nil,nil,[]], [a,b,c])}
+ def f; yield *1; end; f {|a,b,*c| assert_equal([1,nil,[]], [a,b,c])}
+ def f; yield *[]; end; f {|a,b,*c| assert_equal([nil,nil,[]], [a,b,c])}
+ def f; yield *[1]; end; f {|a,b,*c| assert_equal([1,nil,[]], [a,b,c])}
+ def f; yield *[nil]; end; f {|a,b,*c| assert_equal([nil,nil,[]], [a,b,c])}
+ def f; yield *[[]]; end; f {|a,b,*c| assert_equal([[],nil,[]], [a,b,c])}
+ def f; yield *[*[]]; end; f {|a,b,*c| assert_equal([nil,nil,[]], [a,b,c])}
+ def f; yield *[*[1]]; end; f {|a,b,*c| assert_equal([1,nil,[]], [a,b,c])}
+ def f; yield *[*[1,2]]; end; f {|a,b,*c| assert_equal([1,2,[]], [a,b,c])}
end
def test_return
- def r; return; end; a = r(); assert_nil(a); undef r
- def r; return nil; end; a = r(); assert_nil(a); undef r
- def r; return 1; end; a = r(); assert_equal(1, a); undef r
- def r; return []; end; a = r(); assert_equal([], a); undef r
- def r; return [1]; end; a = r(); assert_equal([1], a); undef r
- def r; return [nil]; end; a = r(); assert_equal([nil], a); undef r
- def r; return [[]]; end; a = r(); assert_equal([[]], a); undef r
- def r; return [*[]]; end; a = r(); assert_equal([], a); undef r
- def r; return [*[1]]; end; a = r(); assert_equal([1], a); undef r
- def r; return [*[1,2]]; end; a = r(); assert_equal([1,2], a); undef r
-
- def r; return *[]; end; a = r(); assert_equal([], a); undef r
- def r; return *[1]; end; a = r(); assert_equal([1], a); undef r
- def r; return *[nil]; end; a = r(); assert_equal([nil], a); undef r
- def r; return *[[]]; end; a = r(); assert_equal([[]], a); undef r
- def r; return *[*[]]; end; a = r(); assert_equal([], a); undef r
- def r; return *[*[1]]; end; a = r(); assert_equal([1], a); undef r
- def r; return *[*[1,2]]; end; a = r(); assert_equal([1,2], a); undef r
-
- def r; return *[[]]; end; a = *r(); assert_equal([[]], a); undef r
- def r; return *[*[1,2]]; end; a = *r(); assert_equal([1,2], a); undef r
-
- def r; return; end; *a = r(); assert_equal([nil], a); undef r
- def r; return nil; end; *a = r(); assert_equal([nil], a); undef r
- def r; return 1; end; *a = r(); assert_equal([1], a); undef r
- def r; return []; end; *a = r(); assert_equal([], a); undef r
- def r; return [1]; end; *a = r(); assert_equal([1], a); undef r
- def r; return [nil]; end; *a = r(); assert_equal([nil], a); undef r
- def r; return [[]]; end; *a = r(); assert_equal([[]], a); undef r
- def r; return [1,2]; end; *a = r(); assert_equal([1,2], a); undef r
- def r; return [*[]]; end; *a = r(); assert_equal([], a); undef r
- def r; return [*[1]]; end; *a = r(); assert_equal([1], a); undef r
- def r; return [*[1,2]]; end; *a = r(); assert_equal([1,2], a); undef r
-
- def r; return *[]; end; *a = r(); assert_equal([], a); undef r
- def r; return *[1]; end; *a = r(); assert_equal([1], a); undef r
- def r; return *[nil]; end; *a = r(); assert_equal([nil], a); undef r
- def r; return *[[]]; end; *a = r(); assert_equal([[]], a); undef r
- def r; return *[1,2]; end; *a = r(); assert_equal([1,2], a); undef r
- def r; return *[*[]]; end; *a = r(); assert_equal([], a); undef r
- def r; return *[*[1]]; end; *a = r(); assert_equal([1], a); undef r
- def r; return *[*[1,2]]; end; *a = r(); assert_equal([1,2], a); undef r
-
- def r; return *[[]]; end; *a = *r(); assert_equal([[]], a); undef r
- def r; return *[1,2]; end; *a = *r(); assert_equal([1,2], a); undef r
- def r; return *[*[1,2]]; end; *a = *r(); assert_equal([1,2], a); undef r
-
- def r; return; end; a,b,*c = r(); assert_equal([nil,nil,[]], [a,b,c]); undef r
- def r; return nil; end; a,b,*c = r(); assert_equal([nil,nil,[]], [a,b,c]); undef r
- def r; return 1; end; a,b,*c = r(); assert_equal([1,nil,[]], [a,b,c]); undef r
- def r; return []; end; a,b,*c = r(); assert_equal([nil,nil,[]], [a,b,c]); undef r
- def r; return [1]; end; a,b,*c = r(); assert_equal([1,nil,[]], [a,b,c]); undef r
- def r; return [nil]; end; a,b,*c = r(); assert_equal([nil,nil,[]], [a,b,c]); undef r
- def r; return [[]]; end; a,b,*c = r(); assert_equal([[],nil,[]], [a,b,c]); undef r
- def r; return [1,2]; end; a,b,*c = r(); assert_equal([1,2,[]], [a,b,c]); undef r
- def r; return [*[]]; end; a,b,*c = r(); assert_equal([nil,nil,[]], [a,b,c]); undef r
- def r; return [*[1]]; end; a,b,*c = r(); assert_equal([1,nil,[]], [a,b,c]); undef r
- def r; return [*[1,2]]; end; a,b,*c = r(); assert_equal([1,2,[]], [a,b,c]); undef r
-
- def r; return *[]; end; a,b,*c = r(); assert_equal([nil,nil,[]], [a,b,c]); undef r
- def r; return *[1]; end; a,b,*c = r(); assert_equal([1,nil,[]], [a,b,c]); undef r
- def r; return *[nil]; end; a,b,*c = r(); assert_equal([nil,nil,[]], [a,b,c]); undef r
- def r; return *[[]]; end; a,b,*c = r(); assert_equal([[],nil,[]], [a,b,c]); undef r
- def r; return *[1,2]; end; a,b,*c = r(); assert_equal([1,2,[]], [a,b,c]); undef r
- def r; return *[*[]]; end; a,b,*c = r(); assert_equal([nil,nil,[]], [a,b,c]); undef r
- def r; return *[*[1]]; end; a,b,*c = r(); assert_equal([1,nil,[]], [a,b,c]); undef r
- def r; return *[*[1,2]]; end; a,b,*c = r(); assert_equal([1,2,[]], [a,b,c]); undef r
-
- def r; return 1, *[]; end; a,b = r(); assert_equal([1,nil], [a,b]); undef r
- def r; return 1,2,*[1]; end; a,b = r(); assert_equal([1,2], [a,b]); undef r
- def r; return 1,2,3,*[1,2]; end; a,b = r(); assert_equal([1,2], [a,b]); undef r
+ def r; return; end; a = r(); assert_nil(a)
+ def r; return nil; end; a = r(); assert_nil(a)
+ def r; return 1; end; a = r(); assert_equal(1, a)
+ def r; return []; end; a = r(); assert_equal([], a)
+ def r; return [1]; end; a = r(); assert_equal([1], a)
+ def r; return [nil]; end; a = r(); assert_equal([nil], a)
+ def r; return [[]]; end; a = r(); assert_equal([[]], a)
+ def r; return [*[]]; end; a = r(); assert_equal([], a)
+ def r; return [*[1]]; end; a = r(); assert_equal([1], a)
+ def r; return [*[1,2]]; end; a = r(); assert_equal([1,2], a)
+
+ def r; return *nil; end; a = r(); assert_nil(a)
+ def r; return *1; end; a = r(); assert_equal(1, a)
+ def r; return *[]; end; a = r(); assert_nil(a)
+ def r; return *[1]; end; a = r(); assert_equal(1, a)
+ def r; return *[nil]; end; a = r(); assert_nil(a)
+ def r; return *[[]]; end; a = r(); assert_equal([], a)
+ def r; return *[*[]]; end; a = r(); assert_nil(a)
+ def r; return *[*[1]]; end; a = r(); assert_equal(1, a)
+ def r; return *[*[1,2]]; end; a = r(); assert_equal([1,2], a)
+
+ def r; return *nil; end; a = *r(); assert_nil(a)
+ def r; return *1; end; a = *r(); assert_equal(1, a)
+ def r; return *[]; end; a = *r(); assert_nil(a)
+ def r; return *[1]; end; a = *r(); assert_equal(1, a)
+ def r; return *[nil]; end; a = *r(); assert_nil(a)
+ def r; return *[[]]; end; a = *r(); assert_nil(a)
+ def r; return *[*[]]; end; a = *r(); assert_nil(a)
+ def r; return *[*[1]]; end; a = *r(); assert_equal(1, a)
+ def r; return *[*[1,2]]; end; a = *r(); assert_equal([1,2], a)
+
+ def r; return; end; *a = r(); assert_equal([nil], a)
+ def r; return nil; end; *a = r(); assert_equal([nil], a)
+ def r; return 1; end; *a = r(); assert_equal([1], a)
+ def r; return []; end; *a = r(); assert_equal([[]], a)
+ def r; return [1]; end; *a = r(); assert_equal([[1]], a)
+ def r; return [nil]; end; *a = r(); assert_equal([[nil]], a)
+ def r; return [[]]; end; *a = r(); assert_equal([[[]]], a)
+ def r; return [1,2]; end; *a = r(); assert_equal([[1,2]], a)
+ def r; return [*[]]; end; *a = r(); assert_equal([[]], a)
+ def r; return [*[1]]; end; *a = r(); assert_equal([[1]], a)
+ def r; return [*[1,2]]; end; *a = r(); assert_equal([[1,2]], a)
+
+ def r; return *nil; end; *a = r(); assert_equal([nil], a)
+ def r; return *1; end; *a = r(); assert_equal([1], a)
+ def r; return *[]; end; *a = r(); assert_equal([nil], a)
+ def r; return *[1]; end; *a = r(); assert_equal([1], a)
+ def r; return *[nil]; end; *a = r(); assert_equal([nil], a)
+ def r; return *[[]]; end; *a = r(); assert_equal([[]], a)
+ def r; return *[1,2]; end; *a = r(); assert_equal([[1,2]], a)
+ def r; return *[*[]]; end; *a = r(); assert_equal([nil], a)
+ def r; return *[*[1]]; end; *a = r(); assert_equal([1], a)
+ def r; return *[*[1,2]]; end; *a = r(); assert_equal([[1,2]], a)
+
+ def r; return *nil; end; *a = *r(); assert_equal([nil], a)
+ def r; return *1; end; *a = *r(); assert_equal([1], a)
+ def r; return *[]; end; *a = *r(); assert_equal([nil], a)
+ def r; return *[1]; end; *a = *r(); assert_equal([1], a)
+ def r; return *[nil]; end; *a = *r(); assert_equal([nil], a)
+ def r; return *[[]]; end; *a = *r(); assert_equal([], a)
+ def r; return *[1,2]; end; *a = *r(); assert_equal([1,2], a)
+ def r; return *[*[]]; end; *a = *r(); assert_equal([nil], a)
+ def r; return *[*[1]]; end; *a = *r(); assert_equal([1], a)
+ def r; return *[*[1,2]]; end; *a = *r(); assert_equal([1,2], a)
+
+ def r; return; end; a,b,*c = r(); assert_equal([nil,nil,[]], [a,b,c])
+ def r; return nil; end; a,b,*c = r(); assert_equal([nil,nil,[]], [a,b,c])
+ def r; return 1; end; a,b,*c = r(); assert_equal([1,nil,[]], [a,b,c])
+ def r; return []; end; a,b,*c = r(); assert_equal([nil,nil,[]], [a,b,c])
+ def r; return [1]; end; a,b,*c = r(); assert_equal([1,nil,[]], [a,b,c])
+ def r; return [nil]; end; a,b,*c = r(); assert_equal([nil,nil,[]], [a,b,c])
+ def r; return [[]]; end; a,b,*c = r(); assert_equal([[],nil,[]], [a,b,c])
+ def r; return [1,2]; end; a,b,*c = r(); assert_equal([1,2,[]], [a,b,c])
+ def r; return [*[]]; end; a,b,*c = r(); assert_equal([nil,nil,[]], [a,b,c])
+ def r; return [*[1]]; end; a,b,*c = r(); assert_equal([1,nil,[]], [a,b,c])
+ def r; return [*[1,2]]; end; a,b,*c = r(); assert_equal([1,2,[]], [a,b,c])
+
+ def r; return *nil; end; a,b,*c = r(); assert_equal([nil,nil,[]], [a,b,c])
+ def r; return *1; end; a,b,*c = r(); assert_equal([1,nil,[]], [a,b,c])
+ def r; return *[]; end; a,b,*c = r(); assert_equal([nil,nil,[]], [a,b,c])
+ def r; return *[1]; end; a,b,*c = r(); assert_equal([1,nil,[]], [a,b,c])
+ def r; return *[nil]; end; a,b,*c = r(); assert_equal([nil,nil,[]], [a,b,c])
+ def r; return *[[]]; end; a,b,*c = r(); assert_equal([nil,nil,[]], [a,b,c])
+ def r; return *[1,2]; end; a,b,*c = r(); assert_equal([1,2,[]], [a,b,c])
+ def r; return *[*[]]; end; a,b,*c = r(); assert_equal([nil,nil,[]], [a,b,c])
+ def r; return *[*[1]]; end; a,b,*c = r(); assert_equal([1,nil,[]], [a,b,c])
+ def r; return *[*[1,2]]; end; a,b,*c = r(); assert_equal([1,2,[]], [a,b,c])
end
def test_lambda
@@ -264,37 +292,48 @@ class TestAssignment < Test::Unit::TestCase
a = loop do break [*[1]]; end; assert_equal([1], a)
a = loop do break [*[1,2]]; end; assert_equal([1,2], a)
- a = loop do break *[]; end; assert_equal([], a)
- a = loop do break *[1]; end; assert_equal([1], a)
- a = loop do break *[nil]; end; assert_equal([nil], a)
- a = loop do break *[[]]; end; assert_equal([[]], a)
- a = loop do break *[*[]]; end; assert_equal([], a)
- a = loop do break *[*[1]]; end; assert_equal([1], a)
+ a = loop do break *nil; end; assert_nil(a)
+ a = loop do break *1; end; assert_equal(1, a)
+ a = loop do break *[]; end; assert_nil(a)
+ a = loop do break *[1]; end; assert_equal(1, a)
+ a = loop do break *[nil]; end; assert_nil(a)
+ a = loop do break *[[]]; end; assert_equal([], a)
+ a = loop do break *[*[]]; end; assert_nil(a)
+ a = loop do break *[*[1]]; end; assert_equal(1, a)
a = loop do break *[*[1,2]]; end; assert_equal([1,2], a)
*a = loop do break; end; assert_equal([nil], a)
*a = loop do break nil; end; assert_equal([nil], a)
*a = loop do break 1; end; assert_equal([1], a)
- *a = loop do break []; end; assert_equal([], a)
- *a = loop do break [1]; end; assert_equal([1], a)
- *a = loop do break [nil]; end; assert_equal([nil], a)
- *a = loop do break [[]]; end; assert_equal([[]], a)
- *a = loop do break [1,2]; end; assert_equal([1,2], a)
- *a = loop do break [*[]]; end; assert_equal([], a)
- *a = loop do break [*[1]]; end; assert_equal([1], a)
- *a = loop do break [*[1,2]]; end; assert_equal([1,2], a)
-
- *a = loop do break *[]; end; assert_equal([], a)
+ *a = loop do break []; end; assert_equal([[]], a)
+ *a = loop do break [1]; end; assert_equal([[1]], a)
+ *a = loop do break [nil]; end; assert_equal([[nil]], a)
+ *a = loop do break [[]]; end; assert_equal([[[]]], a)
+ *a = loop do break [1,2]; end; assert_equal([[1,2]], a)
+ *a = loop do break [*[]]; end; assert_equal([[]], a)
+ *a = loop do break [*[1]]; end; assert_equal([[1]], a)
+ *a = loop do break [*[1,2]]; end; assert_equal([[1,2]], a)
+
+ *a = loop do break *nil; end; assert_equal([nil], a)
+ *a = loop do break *1; end; assert_equal([1], a)
+ *a = loop do break *[]; end; assert_equal([nil], a)
*a = loop do break *[1]; end; assert_equal([1], a)
*a = loop do break *[nil]; end; assert_equal([nil], a)
*a = loop do break *[[]]; end; assert_equal([[]], a)
- *a = loop do break *[1,2]; end; assert_equal([1,2], a)
- *a = loop do break *[*[]]; end; assert_equal([], a)
+ *a = loop do break *[1,2]; end; assert_equal([[1,2]], a)
+ *a = loop do break *[*[]]; end; assert_equal([nil], a)
*a = loop do break *[*[1]]; end; assert_equal([1], a)
- *a = loop do break *[*[1,2]]; end; assert_equal([1,2], a)
-
- *a = *loop do break *[[]]; end; assert_equal([[]], a)
+ *a = loop do break *[*[1,2]]; end; assert_equal([[1,2]], a)
+
+ *a = *loop do break *nil; end; assert_equal([nil], a)
+ *a = *loop do break *1; end; assert_equal([1], a)
+ *a = *loop do break *[]; end; assert_equal([nil], a)
+ *a = *loop do break *[1]; end; assert_equal([1], a)
+ *a = *loop do break *[nil]; end; assert_equal([nil], a)
+ *a = *loop do break *[[]]; end; assert_equal([], a)
*a = *loop do break *[1,2]; end; assert_equal([1,2], a)
+ *a = *loop do break *[*[]]; end; assert_equal([nil], a)
+ *a = *loop do break *[*[1]]; end; assert_equal([1], a)
*a = *loop do break *[*[1,2]]; end; assert_equal([1,2], a)
a,b,*c = loop do break; end; assert_equal([nil,nil,[]], [a,b,c])
@@ -309,10 +348,12 @@ class TestAssignment < Test::Unit::TestCase
a,b,*c = loop do break [*[1]]; end; assert_equal([1,nil,[]], [a,b,c])
a,b,*c = loop do break [*[1,2]]; end; assert_equal([1,2,[]], [a,b,c])
+ a,b,*c = loop do break *nil; end; assert_equal([nil,nil,[]], [a,b,c])
+ a,b,*c = loop do break *1; end; assert_equal([1,nil,[]], [a,b,c])
a,b,*c = loop do break *[]; end; assert_equal([nil,nil,[]], [a,b,c])
a,b,*c = loop do break *[1]; end; assert_equal([1,nil,[]], [a,b,c])
a,b,*c = loop do break *[nil]; end; assert_equal([nil,nil,[]], [a,b,c])
- a,b,*c = loop do break *[[]]; end; assert_equal([[],nil,[]], [a,b,c])
+ a,b,*c = loop do break *[[]]; end; assert_equal([nil,nil,[]], [a,b,c])
a,b,*c = loop do break *[1,2]; end; assert_equal([1,2,[]], [a,b,c])
a,b,*c = loop do break *[*[]]; end; assert_equal([nil,nil,[]], [a,b,c])
a,b,*c = loop do break *[*[1]]; end; assert_equal([1,nil,[]], [a,b,c])
@@ -332,34 +373,40 @@ class TestAssignment < Test::Unit::TestCase
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(nil){next *nil}
+ r(1){next *1}
+ r(nil){next *[]}
+ r(1){next *[1]}
+ r(nil){next *[nil]}
+ r([]){next *[[]]}
+ r(nil){next *[*[]]}
+ r(1){next *[*[1]]}
r([1,2]){next *[*[1,2]]}
- undef r
def r(val); *a = yield(); assert_equal(val, a); 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]]}
- undef r
+ 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(); assert_equal(val, a); end
- r([[]]){next *[[]]}
+ r([nil]){next *nil}
+ r([1]){next *1}
+ r([nil]){next *[]}
+ r([1]){next *[1]}
+ r([nil]){next *[nil]}
+ r([]){next *[[]]}
r([1,2]){next *[1,2]}
+ r([nil]){next *[*[]]}
+ r([1]){next *[*[1]]}
r([1,2]){next *[*[1,2]]}
- undef r
def r(val); a,b,*c = yield(); assert_equal(val, [a,b,c]); end
r([nil,nil,[]]){next}
@@ -373,66 +420,40 @@ class TestAssignment < Test::Unit::TestCase
r([nil,nil,[]]){next [*[]]}
r([1,nil,[]]){next [*[1]]}
r([1,2,[]]){next [*[1,2]]}
- undef r
def r(val); a,b,*c = *yield(); assert_equal(val, [a,b,c]); end
- r([[],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,nil,[]]){next *[[]]}
r([1,2,[]]){next *[1,2]}
+ r([nil,nil,[]]){next *[*[]]}
+ r([1,nil,[]]){next *[*[1]]}
r([1,2,[]]){next *[*[1,2]]}
- undef r
end
- def test_massign
+ def test_assign2
a = nil
assert(defined?(a))
assert_nil(a)
# multiple asignment
a, b = 1, 2
- assert_equal 1, a
- assert_equal 2, b
-
- a, b, c = 1, 2, 3
- assert_equal 1, a
- assert_equal 2, b
- assert_equal 3, c
+ assert(a == 1 && b == 2)
- a = 1
- b = 2
a, b = b, a
- assert_equal 2, a
- assert_equal 1, b
-
- a, = 1, 2
- assert_equal 1, a
-
- a, = 1, 2, 3
- assert_equal 1, a
+ assert(a == 2 && b == 1)
- a, * = 1, 2, 3
- assert_equal 1, a
+ a, = 1,2
+ assert_equal(1, a)
a, *b = 1, 2, 3
- assert_equal 1, a
- assert_equal [2, 3], b
-
- # not supported yet
- #a, *b, c = 1, 2, 3, 4
- #assert_equal 1, a
- #assert_equal [2,3], b
- #assert_equal 4, c
-
- a = 1, 2
- assert_equal [1, 2], a
-
- a = [1, 2], [3, 4]
- assert_equal [[1,2], [3,4]], a
+ assert(a == 1 && b == [2, 3])
a, (b, c), d = 1, [2, 3], 4
- assert_equal 1, a
- assert_equal 2, b
- assert_equal 3, c
- assert_equal 4, d
+ assert(a == 1 && b == 2 && c == 3 && d == 4)
*a = 1, 2, 3
assert_equal([1, 2, 3], a)
@@ -442,246 +463,5 @@ class TestAssignment < Test::Unit::TestCase
*a = nil
assert_equal([nil], a)
-
- a, b = 1
- assert_equal 1, a
- assert_nil b
-
- a, b = [1, 2]
- assert_equal 1, a
- assert_equal 2, b
- end
-
- def test_nested_massign
- (a, b), c = [[1, 2], 3]; assert_equal [1,2,3], [a,b,c]
- a, (b, c) = [[1, 2], 3]; assert_equal [[1,2], 3, nil], [a,b,c]
- a, (b, c) = [1, [2, 3]]; assert_equal [1,2,3], [a,b,c]
- (a, b), *c = [[1, 2], 3]; assert_equal [1,2,[3]], [a,b,c]
- (a,b),c,(d,e) = [[1,2],3,[4,5]]; assert_equal [1,2,3,4,5],[a,b,c,d,e]
- (a,*b),c,(d,e,*) = [[1,2],3,[4,5]]; assert_equal [1,[2],3,4,5],[a,b,c,d,e]
- (a,b),c,(d,*e) = [[1,2,3],4,[5,6,7,8]]; assert_equal [1,2,4,5,[6,7,8]],[a,b,c,d,e]
- (a,(b1,b2)),c,(d,e) = [[1,2],3,[4,5]]; assert_equal [1,2,nil,3,4,5],[a,b1,b2,c,d,e]
- (a,(b1,b2)),c,(d,e) = [[1,[21,22]],3,[4,5]]; assert_equal [1,21,22,3,4,5],[a,b1,b2,c,d,e]
- end
-
- class MyObj
- def to_ary
- [[1,2],[3,4]]
- end
- end
-
- def test_to_ary_splat
- a, b = MyObj.new
- assert_equal [[1,2],[3,4]], [a,b]
- end
-
- A = 1
- B = 2
- X, Y = A, B
- class Base
- A = 3
- B = 4
- end
-
- def test_const_massign
- assert_equal [1,2], [X,Y]
- a, b = Base::A, Base::B
- assert_equal [3,4], [a,b]
- end
-end
-
-require_relative 'sentence'
-class TestAssignmentGen < Test::Unit::TestCase
- Syntax = {
- :exp => [["0"],
- ["nil"],
- ["false"],
- ["[]"],
- ["[",:exps,"]"]],
- :exps => [[:exp],
- [:exp,",",:exps]],
- :arg => [[:exp]],
- :mrhs => [[:args,",",:arg],
- [:args,",","*",:arg],
- ["*",:arg]],
- :args => [[:arg],
- ["*",:arg],
- [:args,",",:arg],
- [:args,",","*",:arg]],
- :mlhs => [[:mlhs_basic],
- ["(",:mlhs_inner,")"]],
- :mlhs_inner => [[:mlhs_basic],
- ["(",:mlhs_inner,")"]],
- :mlhs_basic => [[:mlhs_head],
- [:mlhs_head,:mlhs_item],
- [:mlhs_head,"*",:mlhs_node],
- [:mlhs_head,"*",:mlhs_node,",",:mlhs_post],
- [:mlhs_head,"*"],
- [:mlhs_head,"*",",", :mlhs_post],
- [ "*",:mlhs_node],
- [ "*",:mlhs_node,",",:mlhs_post],
- [ "*"],
- [ "*",",", :mlhs_post]],
- :mlhs_head => [[:mlhs_item,","],
- [:mlhs_head,:mlhs_item,","]],
- :mlhs_post => [[:mlhs_item],
- [:mlhs_post,",",:mlhs_item]],
- :mlhs_item => [[:mlhs_node],
- ["(",:mlhs_inner,")"]],
- :mlhs_node => [["var"]],
- :xassign => [["var"," = ",:exp],
- ["var"," = ",:mrhs],
- [:mlhs," = ",:exp],
- [:mlhs," = ",:mrhs]],
- }
-
- def rename_var(obj)
- vars = []
- r = obj.subst('var') {
- var = "v#{vars.length}"
- vars << var
- var
- }
- return r, vars
- end
-
- def expand_except_paren(obj)
- return obj if obj.respond_to? :to_str
- obj.expand {|s|
- !(s[0] == '(' && s[-1] == ')') &&
- !(s[0] == '[' && s[-1] == ']')
- }
- end
-
- def extract_single_element(ary)
- raise "not a single element array: #{ary.inspect}" if ary.length != 1
- ary[0]
- end
-
- def emu_assign_ary(lhs, rv, h)
- rv = rv.respond_to?(:to_ary) ? rv : [rv]
- rv = rv.dup
- a = [[]]
- lhs.each {|e|
- if e == ','
- a << []
- else
- a.last << e
- end
- }
- a.pop if a.last == []
- pre = []
- star = post = nil
- a.each {|e|
- if post
- post << e
- elsif e[0] == '*'
- star = e
- post = []
- else
- pre << e
- end
- }
- pre.map! {|e| extract_single_element(e) }
- if star
- if star == ['*']
- star = nil
- else
- star = extract_single_element(star[1..-1])
- end
- end
- post.map! {|e| extract_single_element(e) } if post
-
- until pre.empty?
- emu_assign_single(pre.shift, rv.shift, h)
- end
-
- if post
- if rv.length < post.length
- until post.empty?
- emu_assign_single(post.shift, rv.shift, h)
- end
- else
- until post.empty?
- emu_assign_single(post.pop, rv.pop, h)
- end
- end
- end
-
- if star
- emu_assign_single(star, rv, h)
- end
- end
-
- def emu_assign_single(lhs, rv, h={})
- if lhs.respond_to? :to_str
- if /\A[a-z0-9]+\z/ =~ lhs
- h[lhs] = rv
- else
- raise "unexpected lhs string: #{lhs.inspect}"
- end
- elsif Sentence === lhs
- if lhs[0] == '(' && lhs[-1] == ')'
- emu_assign_ary(lhs[1...-1], rv, h)
- elsif lhs.length == 1 && String === lhs[0] && /\A[a-z0-9]+\z/ =~ lhs[0]
- h[lhs[0]] = rv
- else
- raise "unexpected lhs sentence: #{lhs.inspect}"
- end
- else
- raise "unexpected lhs: #{lhs.inspect}"
- end
- h
- end
-
- def emu_assign(assign)
- lhs = expand_except_paren(assign[0])
- rhs = expand_except_paren(assign[2])
- lopen = Sentence === lhs && lhs[-1] != ')' && lhs.any? {|e| e == '*' || e == ',' }
- ropen = Sentence === rhs && rhs[-1] != ']' && rhs.any? {|e| e == '*' || e == ',' }
- lhs = Sentence.new(['(']+lhs.to_a+[')']) if lopen
- begin
- rv = eval((ropen ? ["[",assign[2],"]"] : assign[2]).join(''))
- rescue Exception
- rv = $!.message
- end
- emu_assign_single(lhs, rv)
- end
-
- def do_assign(assign, vars)
- assign = assign.to_s
- code1 = "#{assign}; [#{vars.join(",")}]"
- assign.gsub!(/\bv\d+\b/, "o.a")
- code2 = "o=[];class << o; self end.send(:define_method,:a=){|v|self << v};#{assign};o"
- begin
- vals1 = eval(code1)
- rescue Exception
- return {:ex=>$!.message}
- end
- begin
- vals2 = eval(code2)
- rescue Exception
- return {:ex=>$!.message}
- end
- assert_equal(vals1, vals2, code1)
- vals = vals1
- h = {}
- [vars, vals].transpose.each {|k,v| h[k] = v }
- h
- end
-
- def check(assign)
- assign, vars = rename_var(assign)
- sent = assign.to_s
- bruby = do_assign(assign, vars).to_a.sort
- bemu = emu_assign(assign).to_a.sort
- assert_equal(bemu, bruby, sent)
- end
-
- def test_assignment
- syntax = Sentence.expand_syntax(Syntax)
- Sentence.each(syntax, :xassign, 4) {|assign|
- check(assign)
- }
end
end
diff --git a/test/ruby/test_basicinstructions.rb b/test/ruby/test_basicinstructions.rb
deleted file mode 100644
index b3145be8b5..0000000000
--- a/test/ruby/test_basicinstructions.rb
+++ /dev/null
@@ -1,628 +0,0 @@
-require 'test/unit'
-
-ConstTest = 3
-class Class
- alias _remove_const remove_const
- public :_remove_const
-end
-
-class TestBasicInstructions < Test::Unit::TestCase
-
- def test_immediates
- assert_equal((1==1), true)
- assert_equal((1==2), false)
- assert_equal [][0], nil
- assert_equal "sym".intern, :sym
- assert_equal "sym".intern, :"sym"
- assert_equal 1234 + 0, 1234
- assert_equal 1234, 1_2_3_4
- assert_equal 41, 0b0101001
- assert_equal 420, 0644
- assert_equal 18, 0x12
- assert_equal 123456789012345678901234567890 + 0,
- 123456789012345678901234567890
- assert_equal 1.234 + 0.0, 1.234
- end
-
- def test_self
- assert_equal self, self
- assert_equal false, (self == false) # Qfalse==0 in C
- assert_equal false, (self == nil)
- assert_equal false, (self == 0)
- end
-
- def test_string
- expected = "str" + "ing"
- assert_equal expected, 'string'
- assert_equal expected, "string"
- assert_equal expected, %q(string)
- assert_equal expected, %Q(string)
- assert_equal expected, %(string)
- end
-
- def test_dstring
- assert_equal "2", "#{1+1}"
- s = "OK"
- assert_equal "OK", "#{s}"
- assert_equal "OKx", "#{s}x"
- assert_equal "xOK", "x#{s}"
- assert_equal "xOKx", "x#{s}x"
- end
-
- def test_dsym
- assert_equal :a3c, :"a#{1+2}c"
- s = "sym"
- assert_equal :sym, :"#{s}"
- assert_equal :sym, :"#{"#{"#{s}"}"}"
- end
-
- def test_xstr
- assert_equal 'hoge', `echo hoge`.chomp
- assert_equal '3', `echo #{1 + 2}`.chomp
- hoge = 'huga'
- assert_equal 'huga', `echo #{hoge}`.chomp
- end
-
- def test_regexp
- assert_equal /test/, /test/
- assert_equal 'test', /test/.source
- assert_equal 'TEST', /TEST/.source
- assert_equal true, !!(/test/ =~ 'test')
- assert_equal false, !!(/test/ =~ 'does not match')
-
- re = /test/
- assert_equal re, re
- assert_equal 'test', re.source
- assert_equal true, !!(re =~ 'test')
- assert_equal false, !!(re =~ 'does not match')
-
- assert_equal /x#{1+1}x/, /x#{1+1}x/
- s = "OK"
- assert_equal /x#{s}x/, /x#{s}x/
- assert_equal true, !!(/x#{s}x/ =~ "xOKx")
- assert_equal false, !!(/x#{s}x/ =~ "does not match")
-
- s = "OK"
- prev = nil
- 3.times do
- assert_equal prev.object_id, (prev ||= /#{s}/o).object_id if prev
- end
- end
-
- def test_array
- assert_equal [], []
- assert_equal 0, [].size
- assert_equal [1, 2, 3], [1, 2, 3]
- assert_equal [3, 7, 11], [1+2, 3+4, 5+6]
- assert_equal [[1], [2], [3]], [[1], [2], [3]]
-
- a = [1, 2, 3]
- assert_equal 1, a[0]
- assert_equal 2, a[1]
- assert_equal 3, a[2]
- assert_nil a[3]
-
- a = %w( a b c )
- assert_equal 'a', a[0]
- assert_equal 'b', a[1]
- assert_equal 'c', a[2]
- assert_nil a[3]
- end
-
- def test_hash
- assert_equal({}, {})
- assert_equal({1=>2}, {1=>2})
- assert_equal({1=>2, 3=>4}, {1=>2, 3=>4})
- assert_equal({1=>2, 3=>4}, {3=>4, 1=>2})
- # assert_equal({1=>2, 3=>4}, {1,2, 3,4}) # 1.9 doesn't support
- assert_equal({"key"=>"val"}, {"key"=>"val"})
- end
-
- def test_range
- assert_equal((1..3), (1..3))
- assert_equal((1...3), (1...3))
- assert_not_equal((1...3), (1..3))
- assert_not_equal((1..3), (1...3))
- assert_equal((1..3), (1..2+1))
- assert_equal((1...3), (1...2+1))
- assert_equal(('a'..'z'), ('a'..'z'))
- end
-
- def test_not
- assert_equal true, !nil
- assert_equal true, !false
- assert_equal false, !true
- assert_equal false, !3
- assert_equal false, !(1+1)
-
- assert_equal false, !!nil
- assert_equal false, !!false
- assert_equal true, !!true
- assert_equal true, !!3
- assert_equal true, !!(1+1)
-
- assert_equal true, (not nil)
- assert_equal true, (not false)
- assert_equal false, (not true)
- assert_equal false, (not 3)
- assert_equal false, (not (1 + 1))
-
- assert_equal false, (not not nil)
- assert_equal false, (not not false)
- assert_equal true, (not not true)
- assert_equal true, (not not 3)
- assert_equal true, (not not (1+1))
- end
-
- def test_local_variable
- a = 7
- assert_equal 7, a
- assert_equal a, a
- b = 17
- assert_equal 7, a
- assert_equal 17, b
- assert_equal a, a
- assert_equal b, b
- assert_not_equal a, b
- assert_not_equal b, a
- a = b
- assert_equal 17, a
- assert_equal 17, b
- assert_equal a, a
- assert_equal b, b
- assert_equal a, b
- assert_equal b, a
- c = 28
- assert_equal 17, a
- assert_equal 17, b
- assert_equal 28, c
- assert_equal a, a
- assert_equal b, b
- assert_equal a, b
- assert_equal c, c
- assert_not_equal a, c
- assert_not_equal b, c
- a = b = c
- assert_equal 28, a
- assert_equal 28, b
- assert_equal 28, c
- assert_equal a, a
- assert_equal b, b
- assert_equal a, b
- assert_equal b, a
- assert_equal a, c
- assert_equal c, a
- assert_equal b, c
- assert_equal c, b
-
- a = 1
- b = 2
- c = 3
- set_lvar_in_another_method
- assert_equal 1, a
- assert_equal 2, b
- assert_equal 3, c
- end
-
- def set_lvar_in_another_method
- assert_raise(NameError) { a }
- assert_raise(NameError) { b }
- assert_raise(NameError) { c }
- a = "NOT OK"
- b = "NOT OK"
- c = "NOT OK"
- end
-
- class Const
- $Const = self
- C = 'Const::C'
- def self.c() C end
- def c() C end
-
- class A
- C = 'Const::A::C'
- def self.c() C end
- def c() C end
- CC = 'Const::A::CC'
- def self.cc() CC end
- def cc() CC end
-
- class B
- C = 'Const::A::B::C'
- def self.c() C end
- def c() C end
- def self.cc() CC end
- def cc() CC end
- end
- end
-
- class AA < A
- def self.cc() CC end
- def cc() CC end
- end
-
- class AAA < AA
- def self.cc() CC end
- def cc() CC end
- end
- end
- C = 0
-
- def test_const_path
- do_test_const_path
- do_test_const_path
- do_test_const_path
- end
-
- def do_test_const_path
- assert_equal 0, C
- assert_equal 0, C
- assert_equal 3, ::ConstTest
- assert_equal 3, ::ConstTest
- assert_equal $Const, Const
-
- assert_equal 'Const::C', Const::C
- assert_equal 'Const::C', Const::C
- assert_equal 'Const::A::C', Const::A::C
- assert_equal 'Const::A::C', Const::A::C
- assert_equal 'Const::A::B::C', Const::A::B::C
- assert_equal 'Const::A::B::C', Const::A::B::C
-
- Const::A::B._remove_const :C
- assert_equal 'Const::C', Const::C
- assert_equal 'Const::A::C', Const::A::C
- assert_raise(NameError) { Const::A::B::C }
-
- Const::A._remove_const :C
- assert_equal 'Const::C', Const::C
- assert_raise(NameError) { Const::A::C }
- assert_raise(NameError) { Const::A::B::C }
-
- Const._remove_const :C
- assert_raise(NameError) { Const::C }
- assert_raise(NameError) { Const::A::C }
- assert_raise(NameError) { Const::A::B::C }
-
- Const::A.const_set :C, 'Const::A::C'
- assert_raise(NameError) { Const::C }
- assert_equal 'Const::A::C', Const::A::C
- assert_raise(NameError) { Const::A::B::C }
-
- Const::A::B.const_set :C, 'Const::A::B::C'
- assert_raise(NameError) { Const::C }
- assert_equal 'Const::A::C', Const::A::C
- assert_equal 'Const::A::B::C', Const::A::B::C
-
- Const.const_set :C, 'Const::C'
- assert_equal 'Const::C', Const::C
- assert_equal 'Const::A::C', Const::A::C
- assert_equal 'Const::A::B::C', Const::A::B::C
- end
-
- def test_const_cref
- do_test_const_cref
- do_test_const_cref
- do_test_const_cref
- end
-
- def do_test_const_cref
- assert_equal 'Const::C', Const.new.c
- assert_equal 'Const::A::C', Const::A.new.c
- assert_equal 'Const::A::B::C', Const::A::B.new.c
-
- assert_equal 'Const::C', Const.c
- assert_equal 'Const::A::C', Const::A.c
- assert_equal 'Const::A::B::C', Const::A::B.c
-
- Const::A::B._remove_const :C
- assert_equal 'Const::C', Const.c
- assert_equal 'Const::A::C', Const::A.c
- assert_equal 'Const::A::C', Const::A::B.c
- assert_equal 'Const::C', Const.new.c
- assert_equal 'Const::A::C', Const::A.new.c
- assert_equal 'Const::A::C', Const::A::B.new.c
-
- Const::A._remove_const :C
- assert_equal 'Const::C', Const.c
- assert_equal 'Const::C', Const::A.c
- assert_equal 'Const::C', Const::A::B.c
- assert_equal 'Const::C', Const.new.c
- assert_equal 'Const::C', Const::A.new.c
- assert_equal 'Const::C', Const::A::B.new.c
-
- Const::A::B.const_set :C, 'Const::A::B::C'
- assert_equal 'Const::C', Const.c
- assert_equal 'Const::C', Const::A.c
- assert_equal 'Const::A::B::C', Const::A::B.c
- assert_equal 'Const::C', Const.new.c
- assert_equal 'Const::C', Const::A.new.c
- assert_equal 'Const::A::B::C', Const::A::B.new.c
-
- Const::A.const_set :C, 'Const::A::C'
- assert_equal 'Const::C', Const.c
- assert_equal 'Const::A::C', Const::A.c
- assert_equal 'Const::A::B::C', Const::A::B.c
- assert_equal 'Const::C', Const.new.c
- assert_equal 'Const::A::C', Const::A.new.c
- assert_equal 'Const::A::B::C', Const::A::B.new.c
- ensure
- # reset
- Const.const_set :C, 'Const::C' unless Const.const_defined?(:C)
- Const::A.const_set :C, 'Const::A::C' unless Const::A.const_defined?(:C)
- Const::A::B.const_set :C, 'Const::A::B::C' unless Const::A::B.const_defined?(:C)
- end
-
- def test_const_inherit
- do_test_const_inherit
- do_test_const_inherit
- do_test_const_inherit
- end
-
- def do_test_const_inherit
- assert_equal 'Const::A::CC', Const::A.cc
- assert_equal 'Const::A::CC', Const::AA.cc
- assert_equal 'Const::A::CC', Const::AAA.cc
- assert_equal 'Const::A::CC', Const::A.new.cc
- assert_equal 'Const::A::CC', Const::AA.new.cc
- assert_equal 'Const::A::CC', Const::AAA.new.cc
-
- Const::AA.const_set :CC, 'Const::AA::CC'
- assert_equal 'Const::A::CC', Const::A.cc
- assert_equal 'Const::AA::CC', Const::AA.cc
- assert_equal 'Const::AA::CC', Const::AAA.cc
- assert_equal 'Const::A::CC', Const::A.new.cc
- assert_equal 'Const::AA::CC', Const::AA.new.cc
- assert_equal 'Const::AA::CC', Const::AAA.new.cc
-
- Const::AAA.const_set :CC, 'Const::AAA::CC'
- assert_equal 'Const::A::CC', Const::A.cc
- assert_equal 'Const::AA::CC', Const::AA.cc
- assert_equal 'Const::AAA::CC', Const::AAA.cc
- assert_equal 'Const::A::CC', Const::A.new.cc
- assert_equal 'Const::AA::CC', Const::AA.new.cc
- assert_equal 'Const::AAA::CC', Const::AAA.new.cc
-
- Const::AA._remove_const :CC
- assert_equal 'Const::A::CC', Const::A.cc
- assert_equal 'Const::A::CC', Const::AA.cc
- assert_equal 'Const::AAA::CC', Const::AAA.cc
- assert_equal 'Const::A::CC', Const::A.new.cc
- assert_equal 'Const::A::CC', Const::AA.new.cc
- assert_equal 'Const::AAA::CC', Const::AAA.new.cc
-
- Const::AAA._remove_const :CC
- assert_equal 'Const::A::CC', Const::A.cc
- assert_equal 'Const::A::CC', Const::AA.cc
- assert_equal 'Const::A::CC', Const::AAA.cc
- assert_equal 'Const::A::CC', Const::A.new.cc
- assert_equal 'Const::A::CC', Const::AA.new.cc
- assert_equal 'Const::A::CC', Const::AAA.new.cc
- end
-
- def test_global_variable
- $gvar1 = 1
- assert_equal 1, $gvar1
- $gvar1 = 2
- assert_equal 2, $gvar1
- $gvar2 = 77
- assert_equal 2, $gvar1
- assert_equal 77, $gvar2
- $gvar2 = $gvar1
- assert_equal 2, $gvar1
- assert_equal 2, $gvar2
- $gvar1 = 1
- assert_equal 1, $gvar1
- assert_equal 2, $gvar2
- set_gvar_in_another_method
- assert_equal "OK1", $gvar1
- assert_equal "OK2", $gvar2
- end
-
- def set_gvar_in_another_method
- assert_equal 1, $gvar1
- assert_equal 2, $gvar2
- $gvar1 = "OK1"
- $gvar2 = "OK2"
- end
-
- class CVarA
- @@cv = 'CVarA@@cv'
- def self.cv() @@cv end
- def self.cv=(v) @@cv = v end
- class << self
- def cv2() @@cv end
- end
- def cv() @@cv end
- def cv=(v) @@cv = v end
- end
-
- class CVarB < CVarA
- def self.cvB() @@cv end
- def self.cvB=(v) @@cv = v end
- class << self
- def cvB2() @@cv end
- end
- def cvB() @@cv end
- def cvB=(v) @@cv = v end
- end
-
- def test_class_variable
- assert_equal 'CVarA@@cv', CVarA.cv
- assert_equal 'CVarA@@cv', CVarA.cv2
- assert_equal 'CVarA@@cv', CVarA.new.cv
- CVarA.cv = 'singleton'
- assert_equal 'singleton', CVarA.cv
- assert_equal 'singleton', CVarA.cv2
- assert_equal 'singleton', CVarA.new.cv
- CVarA.new.cv = 'instance'
- assert_equal 'instance', CVarA.cv
- assert_equal 'instance', CVarA.cv2
- assert_equal 'instance', CVarA.new.cv
-
- CVarA.cv = 'CVarA@@cv'
- CVarB.cv = 'B/singleton'
- assert_equal 'B/singleton', CVarB.cv
- assert_equal 'B/singleton', CVarB.cv2
- assert_equal 'B/singleton', CVarB.new.cv
- assert_equal 'B/singleton', CVarA.cv
- assert_equal 'B/singleton', CVarA.cv2
- assert_equal 'B/singleton', CVarA.new.cv
- CVarB.new.cv = 'B/instance'
- assert_equal 'B/instance', CVarB.cv
- assert_equal 'B/instance', CVarB.cv2
- assert_equal 'B/instance', CVarB.new.cv
- assert_equal 'B/instance', CVarA.cv
- assert_equal 'B/instance', CVarA.cv2
- assert_equal 'B/instance', CVarA.new.cv
-
- CVarA.cv = 'CVarA@@cv'
- assert_equal('CVarA@@cv', CVarB.cvB)
- assert_equal('CVarA@@cv', CVarB.cvB2)
- assert_equal('CVarA@@cv', CVarB.new.cvB)
- CVarB.cvB = 'B/singleton'
- assert_equal 'B/singleton', CVarB.cvB
- assert_equal 'B/singleton', CVarB.cvB2
- assert_equal 'B/singleton', CVarB.new.cvB
- assert_equal 'B/singleton', CVarA.cv
- assert_equal 'B/singleton', CVarA.cv2
- assert_equal 'B/singleton', CVarA.new.cv
- CVarB.new.cvB = 'B/instance'
- assert_equal 'B/instance', CVarB.cvB
- assert_equal 'B/instance', CVarB.cvB2
- assert_equal 'B/instance', CVarB.new.cvB
- assert_equal 'B/instance', CVarA.cv
- assert_equal 'B/instance', CVarA.cv2
- assert_equal 'B/instance', CVarA.new.cv
-
- CVarA.cv = 'CVarA@@cv'
- CVarB.cvB = 'CVarB@@cv'
- end
-
- class OP
- attr_accessor :x
- end
-
- def test_opassign
- x = nil
- x ||= 1
- assert_equal 1, x
- x &&= 2
- assert_equal 2, x
- x ||= 3
- assert_equal 2, x
- x &&= 4
- assert_equal 4, x
-
- y = OP.new
- y.x = nil
- y.x ||= 1
- assert_equal 1, y.x
- y.x &&= 2
- assert_equal 2, y.x
- y.x ||= 3
- assert_equal 2, y.x
- y.x &&= 4
- assert_equal 4, y.x
-
- z = OP.new
- z.x = y
- z.x.x = nil
- z.x.x ||= 1
- assert_equal 1, z.x.x
- z.x.x &&= 2
- assert_equal 2, z.x.x
- z.x.x ||= 3
- assert_equal 2, z.x.x
- z.x.x &&= 4
- assert_equal 4, z.x.x
-
- a = []
- a[0] = nil
- a[0] ||= 1
- assert_equal 1, a[0]
- a[0] &&= 2
- assert_equal 2, a[0]
- a[0] ||= 3
- assert_equal 2, a[0]
- a[0] &&= 4
- assert_equal 4, a[0]
- end
-
- def test_backref
- /re/ =~ 'not match'
- assert_nil $~
- assert_nil $`
- assert_nil $&
- assert_nil $'
- assert_nil $+
- assert_nil $1
- assert_nil $2
- assert_nil $3
- assert_nil $4
- assert_nil $5
- assert_nil $6
- assert_nil $7
- assert_nil $8
- assert_nil $9
-
- /(a)(b)(c)(d)(e)(f)(g)(h)(i)/ =~ 'xabcdefghiy'
- assert_not_nil $~
- assert_instance_of MatchData, $~
- assert_equal 'abcdefghi', $~[0]
- assert_equal 'a', $~[1]
- assert_equal 'b', $~[2]
- assert_equal 'c', $~[3]
- assert_equal 'd', $~[4]
- assert_equal 'e', $~[5]
- assert_equal 'f', $~[6]
- assert_equal 'g', $~[7]
- assert_equal 'h', $~[8]
- assert_equal 'i', $~[9]
- assert_equal 'x', $`
- assert_equal 'abcdefghi', $&
- assert_equal 'y', $'
- assert_equal 'i', $+
- assert_equal 'a', $1
- assert_equal 'b', $2
- assert_equal 'c', $3
- assert_equal 'd', $4
- assert_equal 'e', $5
- assert_equal 'f', $6
- assert_equal 'g', $7
- assert_equal 'h', $8
- assert_equal 'i', $9
-
- /re/ =~ 'not match'
- assert_nil $~
- assert_nil $`
- assert_nil $&
- assert_nil $'
- assert_nil $+
- assert_nil $1
- assert_nil $2
- assert_nil $3
- assert_nil $4
- assert_nil $5
- assert_nil $6
- assert_nil $7
- assert_nil $8
- assert_nil $9
- end
-
- def test_array_splat
- a = []
- assert_equal [], [*a]
- assert_equal [1], [1, *a]
- a = [2]
- assert_equal [2], [*a]
- assert_equal [1, 2], [1, *a]
- a = [2, 3]
- assert_equal [2, 3], [*a]
- assert_equal [1, 2, 3], [1, *a]
-
- a = nil
- assert_equal [], [*a]
- assert_equal [1], [1, *a]
- end
-
-end
diff --git a/test/ruby/test_beginendblock.rb b/test/ruby/test_beginendblock.rb
index 463ebd94b6..b5d898d3b6 100644
--- a/test/ruby/test_beginendblock.rb
+++ b/test/ruby/test_beginendblock.rb
@@ -1,6 +1,7 @@
require 'test/unit'
require 'tempfile'
-require_relative 'envutil'
+$:.replace([File.dirname(File.expand_path(__FILE__))] | $:)
+require 'envutil'
class TestBeginEndBlock < Test::Unit::TestCase
DIR = File.dirname(File.expand_path(__FILE__))
@@ -12,31 +13,16 @@ class TestBeginEndBlock < Test::Unit::TestCase
def test_beginendblock
ruby = EnvUtil.rubybin
target = File.join(DIR, 'beginmainend.rb')
- result = IO.popen([ruby, target]){|io|io.read}
+ result = IO.popen("#{q(ruby)} #{q(target)}"){|io|io.read}
assert_equal(%w(b1 b2-1 b2 main b3-1 b3 b4 e1 e4 e3 e2 e4-2 e4-1 e1-1 e4-1-1), result.split)
-
- input = Tempfile.new(self.class.name)
- inputpath = input.path
- input.close
- result = IO.popen([ruby, "-n", "-eBEGIN{p :begin}", "-eEND{p :end}", inputpath]){|io|io.read}
- assert_equal(%w(:begin), result.split)
- result = IO.popen([ruby, "-p", "-eBEGIN{p :begin}", "-eEND{p :end}", inputpath]){|io|io.read}
- assert_equal(%w(:begin), result.split)
- input.open
- input.puts "foo\nbar"
- input.close
- result = IO.popen([ruby, "-n", "-eBEGIN{p :begin}", "-eEND{p :end}", inputpath]){|io|io.read}
- assert_equal(%w(:begin :end), result.split)
- result = IO.popen([ruby, "-p", "-eBEGIN{p :begin}", "-eEND{p :end}", inputpath]){|io|io.read}
- assert_equal(%w(:begin foo bar :end), result.split)
end
def test_begininmethod
- assert_raise(SyntaxError) do
+ assert_raises(SyntaxError) do
eval("def foo; BEGIN {}; end")
end
- assert_raise(SyntaxError) do
+ assert_raises(SyntaxError) do
eval('eval("def foo; BEGIN {}; end")')
end
end
@@ -52,15 +38,16 @@ errout = ARGV.shift
STDERR.reopen(File.open(errout, "w"))
STDERR.sync = true
Dir.chdir(#{q(DIR)})
-system("#{ruby}", "endblockwarn_rb")
+cmd = "\\"#{ruby}\\" \\"endblockwarn.rb\\""
+system(cmd)
EOF
launcher.close
launcherpath = launcher.path
errout.close
erroutpath = errout.path
- system(ruby, launcherpath, erroutpath)
+ system("#{q(ruby)} #{q(launcherpath)} #{q(erroutpath)}")
expected = <<EOW
-endblockwarn_rb:2: warning: END in method; use at_exit
+endblockwarn.rb:2: warning: END in method; use at_exit
(eval):2: warning: END in method; use at_exit
EOW
assert_equal(expected, File.read(erroutpath))
@@ -68,14 +55,15 @@ EOW
end
def test_raise_in_at_exit
+ # [ruby-core:09675]
ruby = EnvUtil.rubybin
- out = IO.popen([ruby, '-e', 'STDERR.reopen(STDOUT)',
- '-e', 'at_exit{raise %[SomethingBad]}',
- '-e', 'raise %[SomethingElse]']) {|f|
+ out = IO.popen("#{q(ruby)} -e 'STDERR.reopen(STDOUT);" \
+ "at_exit{raise %[SomethingBad]};" \
+ "raise %[SomethingElse]'") {|f|
f.read
}
- assert_match /SomethingBad/, out, "[ruby-core:9675]"
- assert_match /SomethingElse/, out, "[ruby-core:9675]"
+ assert_match /SomethingBad/, out
+ assert_match /SomethingElse/, out
end
def test_should_propagate_exit_code
@@ -87,10 +75,7 @@ EOW
def test_should_propagate_signaled
ruby = EnvUtil.rubybin
- out = IO.popen(
- [ruby,
- '-e', 'STDERR.reopen(STDOUT)',
- '-e', 'at_exit{Process.kill(:INT, $$); loop{}}']) {|f|
+ out = IO.popen("#{ruby} #{File.dirname(__FILE__)}/suicide.rb"){|f|
f.read
}
assert_match /Interrupt$/, out
@@ -98,4 +83,16 @@ EOW
assert_nil $?.exitstatus
assert_equal Signal.list["INT"], $?.termsig
end
+
+ def test_begin_and_eval
+ $test_begin_and_eval = :ok
+ begin
+ eval("BEGIN{$test_begin_and_eval = :ng}\n_/a:a")
+ rescue SyntaxError
+ x1 = x2 = $test_begin_and_eval
+ eval("x2 = $test_begin_and_eval")
+ end
+ assert_equal(:ok, x1)
+ assert_equal(:ok, x2)
+ end
end
diff --git a/test/ruby/test_bignum.rb b/test/ruby/test_bignum.rb
index b77fd8f683..99c5952173 100644
--- a/test/ruby/test_bignum.rb
+++ b/test/ruby/test_bignum.rb
@@ -1,18 +1,6 @@
require 'test/unit'
class TestBignum < Test::Unit::TestCase
- def setup
- @verbose = $VERBOSE
- $VERBOSE = nil
- @fmax = Float::MAX.to_i
- @fmax2 = @fmax * 2
- @big = (1 << 63) - 1
- end
-
- def teardown
- $VERBOSE = @verbose
- end
-
def fact(n)
return 1 if n == 0
f = 1
@@ -97,300 +85,17 @@ class TestBignum < Test::Unit::TestCase
shift_test(-0xfffffffffffffffff)
end
- def test_to_s
- assert_equal("fvvvvvvvvvvvv" ,18446744073709551615.to_s(32), "[ruby-core:10686]")
- assert_equal("g000000000000" ,18446744073709551616.to_s(32), "[ruby-core:10686]")
- assert_equal("3w5e11264sgsf" ,18446744073709551615.to_s(36), "[ruby-core:10686]")
- assert_equal("3w5e11264sgsg" ,18446744073709551616.to_s(36), "[ruby-core:10686]")
- assert_equal("nd075ib45k86f" ,18446744073709551615.to_s(31), "[ruby-core:10686]")
- assert_equal("nd075ib45k86g" ,18446744073709551616.to_s(31), "[ruby-core:10686]")
+ def test_to_s # [ruby-core:10686]
+ assert_equal("fvvvvvvvvvvvv" ,18446744073709551615.to_s(32))
+ assert_equal("g000000000000" ,18446744073709551616.to_s(32))
+ assert_equal("3w5e11264sgsf" ,18446744073709551615.to_s(36))
+ assert_equal("3w5e11264sgsg" ,18446744073709551616.to_s(36))
+ assert_equal("nd075ib45k86f" ,18446744073709551615.to_s(31))
+ assert_equal("nd075ib45k86g" ,18446744073709551616.to_s(31))
assert_equal("1777777777777777777777" ,18446744073709551615.to_s(8))
assert_equal("-1777777777777777777777" ,-18446744073709551615.to_s(8))
end
-
- T_ZERO = (2**32).coerce(0).first
- T_ONE = (2**32).coerce(1).first
- T_MONE = (2**32).coerce(-1).first
- T31 = 2**31 # 2147483648
- T31P = T31 - 1 # 2147483647
- T32 = 2**32 # 4294967296
- T32P = T32 - 1 # 4294967295
- T64 = 2**64 # 18446744073709551616
- T64P = T64 - 1 # 18446744073709551615
-
- def test_big_2comp
- assert_equal("-4294967296", (~T32P).to_s)
- assert_equal("..f00000000", "%x" % -T32)
- end
-
- def test_int2inum
- assert_equal([T31P], [T31P].pack("I").unpack("I"))
- assert_equal([T31P], [T31P].pack("i").unpack("i"))
- end
-
- def test_quad_pack
- assert_equal([ 1], [ 1].pack("q").unpack("q"))
- assert_equal([- 1], [- 1].pack("q").unpack("q"))
- assert_equal([ T31P], [ T31P].pack("q").unpack("q"))
- assert_equal([-T31P], [-T31P].pack("q").unpack("q"))
- assert_equal([ T64P], [ T64P].pack("Q").unpack("Q"))
- assert_equal([ 0], [ T64 ].pack("Q").unpack("Q"))
- end
-
- def test_str_to_inum
- assert_equal(1, " +1".to_i)
- assert_equal(-1, " -1".to_i)
- assert_equal(0, "++1".to_i)
- assert_equal(73, "111".oct)
- assert_equal(273, "0x111".oct)
- assert_equal(7, "0b111".oct)
- assert_equal(73, "0o111".oct)
- assert_equal(111, "0d111".oct)
- assert_equal(73, "0111".oct)
- assert_equal(111, Integer("111"))
- assert_equal(13, "111".to_i(3))
- assert_raise(ArgumentError) { "111".to_i(37) }
- assert_equal(1333, "111".to_i(36))
- assert_equal(1057, "111".to_i(32))
- assert_equal(0, "00a".to_i)
- assert_equal(1, Integer("1 "))
- assert_raise(ArgumentError) { Integer("1_") }
- assert_raise(ArgumentError) { Integer("1__") }
- assert_raise(ArgumentError) { Integer("1_0 x") }
- assert_equal(T31P, "1111111111111111111111111111111".to_i(2))
- assert_equal(0_2, '0_2'.to_i)
- assert_equal(00_2, '00_2'.to_i)
- assert_equal(00_02, '00_02'.to_i)
- end
-
- def test_to_s2
- assert_raise(ArgumentError) { T31P.to_s(37) }
- assert_equal("9" * 32768, (10**32768-1).to_s)
- assert_raise(RangeError) { Process.wait(1, T64P) }
- assert_equal("0", T_ZERO.to_s)
- assert_equal("1", T_ONE.to_s)
- end
-
- def test_to_f
- assert_nothing_raised { T31P.to_f.to_i }
- assert_raise(FloatDomainError) { (1024**1024).to_f.to_i }
- end
-
- def test_cmp
- assert(T31P > 1)
- assert(T31P < 2147483648.0)
- assert(T31P < T64P)
- assert(T64P > T31P)
- assert_raise(ArgumentError) { T31P < "foo" }
- end
-
- def test_eq
- assert(T31P != 1)
- assert(T31P == 2147483647.0)
- assert(T31P != "foo")
- end
-
- def test_eql
- assert(T31P.eql?(T31P))
- end
-
- def test_convert
- assert_equal([255], [T_MONE].pack("C").unpack("C"))
- assert_equal([0], [T32].pack("C").unpack("C"))
- assert_raise(RangeError) { 0.to_s(T32) }
- end
-
- def test_sub
- assert_equal(-T31, T32 - (T32 + T31))
- x = 2**100
- assert_equal(1, (x+2) - (x+1))
- assert_equal(-1, (x+1) - (x+2))
- assert_equal(0, (2**100) - (2.0**100))
- o = Object.new
- def o.coerce(x); [2**100+2, x]; end
- assert_equal(1, (2**100+1) - o)
- end
-
- def test_plus
- assert_equal(T32.to_f, T32P + 1.0)
- assert_raise(TypeError) { T32 + "foo" }
- assert_equal(1267651809154049016125877911552, (2**100) + (2**80))
- assert_equal(1267651809154049016125877911552, (2**80) + (2**100))
- assert_equal(2**101, (2**100) + (2.0**100))
- o = Object.new
- def o.coerce(x); [2**80, x]; end
- assert_equal(1267651809154049016125877911552, (2**100) + o)
- end
-
- def test_minus
- assert_equal(T32P.to_f, T32 - 1.0)
- assert_raise(TypeError) { T32 - "foo" }
- end
-
- def test_mul
- assert_equal(T32.to_f, T32 * 1.0)
- assert_raise(TypeError) { T32 * "foo" }
- o = Object.new
- def o.coerce(x); [2**100, x]; end
- assert_equal(2**180, (2**80) * o)
- end
-
- def test_mul_balance
- assert_equal(3**7000, (3**5000) * (3**2000))
- end
-
- def test_divrem
- assert_equal(0, T32 / T64)
- end
-
- def test_div
- assert_equal(T32.to_f, T32 / 1.0)
- assert_raise(TypeError) { T32 / "foo" }
- assert_equal(0x20000000, 0x40000001.div(2.0), "[ruby-dev:34553]")
- end
-
- def test_idiv
- assert_equal(715827882, 1073741824.div(Rational(3,2)), ' [ruby-dev:34066]')
- end
-
- def test_modulo
- assert_raise(TypeError) { T32 % "foo" }
- end
-
- def test_remainder
- assert_equal(0, T32.remainder(1))
- assert_raise(TypeError) { T32.remainder("foo") }
- end
-
- def test_divmod
- assert_equal([T32, 0], T32.divmod(1))
- assert_equal([2, 0], T32.divmod(T31))
- assert_raise(TypeError) { T32.divmod("foo") }
- end
-
- def test_quo
- assert_equal(T32.to_f, T32.quo(1))
- assert_equal(T32.to_f, T32.quo(1.0))
- assert_equal(T32.to_f, T32.quo(T_ONE))
-
- assert_raise(TypeError) { T32.quo("foo") }
-
- assert_equal(1024**1024, (1024**1024).quo(1))
- assert_equal(1024**1024, (1024**1024).quo(1.0))
- assert_equal(1024**1024*2, (1024**1024*2).quo(1))
- inf = 1 / 0.0; nan = inf / inf
-
- assert((1024**1024*2).quo(nan).nan?)
- end
-
- def test_pow
- assert_equal(1.0, T32 ** 0.0)
- assert_equal(1.0 / T32, T32 ** -1)
- assert((T32 ** T32).infinite?)
- assert((T32 ** (2**30-1)).infinite?)
-
- ### rational changes the behavior of Bignum#**
- #assert_raise(TypeError) { T32**"foo" }
- assert_raise(TypeError, ArgumentError) { T32**"foo" }
- end
-
- def test_and
- assert_equal(0, T32 & 1)
- assert_equal(-T32, (-T32) & (-T31))
- assert_equal(0, T32 & T64)
- end
-
- def test_or
- assert_equal(T32 + 1, T32 | 1)
- assert_equal(T32 + T31, T32 | T31)
- assert_equal(-T31, (-T32) | (-T31))
- assert_equal(T64 + T32, T32 | T64)
- end
-
- def test_xor
- assert_equal(T32 + 1, T32 ^ 1)
- assert_equal(T32 + T31, T32 ^ T31)
- assert_equal(T31, (-T32) ^ (-T31))
- assert_equal(T64 + T32, T32 ^ T64)
- end
-
- def test_shift2
- assert_equal(2**33, (2**32) << 1)
- assert_equal(2**31, (2**32) << -1)
- assert_equal(2**33, (2**32) << 1.0)
- assert_equal(2**31, (2**32) << -1.0)
- assert_equal(2**33, (2**32) << T_ONE)
- assert_equal(2**31, (2**32) << T_MONE)
- assert_equal(2**31, (2**32) >> 1)
- assert_equal(2**33, (2**32) >> -1)
- assert_equal(2**31, (2**32) >> 1.0)
- assert_equal(2**33, (2**32) >> -1.0)
- assert_equal(2**31, (2**32) >> T_ONE)
- assert_equal(2**33, (2**32) >> T_MONE)
- assert_equal( 0, (2**32) >> (2**32))
- assert_equal(-1, -(2**32) >> (2**32))
- assert_equal( 0, (2**32) >> 128)
- assert_equal(-1, -(2**32) >> 128)
- assert_equal( 0, (2**31) >> 32)
- assert_equal(-1, -(2**31) >> 32)
- end
-
- def test_aref
- assert_equal(0, (2**32)[0])
- assert_equal(0, (2**32)[2**32])
- assert_equal(0, (2**32)[-(2**32)])
- assert_equal(0, (2**32)[T_ZERO])
- assert_equal(0, (-(2**64))[0])
- assert_equal(1, (-2**256)[256])
- end
-
- def test_hash
- assert_nothing_raised { T31P.hash }
- end
-
- def test_coerce
- assert_equal([T64P, T31P], T31P.coerce(T64P))
- assert_raise(TypeError) { T31P.coerce(nil) }
- end
-
- def test_abs
- assert_equal(T31P, (-T31P).abs)
- end
-
- def test_size
- assert(T31P.size.is_a?(Integer))
- end
-
- def test_odd
- assert_equal(true, (2**32+1).odd?)
- assert_equal(false, (2**32).odd?)
- end
-
- def test_even
- assert_equal(false, (2**32+1).even?)
- assert_equal(true, (2**32).even?)
- end
-
- def interrupt
- time = Time.now
- start_flag = false
- end_flag = false
- thread = Thread.new do
- start_flag = true
- yield
- end_flag = true
- end
- sleep 1
- thread.raise
- thread.join rescue nil
- start_flag && !end_flag && Time.now - time < 10
- end
-
- def test_interrupt
- assert(interrupt { (65536 ** 65536).to_s })
- end
-
def test_too_big_to_s
if (big = 2**31-1).is_a?(Fixnum)
return
@@ -398,19 +103,4 @@ class TestBignum < Test::Unit::TestCase
e = assert_raise(RangeError) {(1 << big).to_s}
assert_match(/too big to convert/, e.message)
end
-
- def test_fix_fdiv
- assert_not_equal(0, 1.fdiv(@fmax2))
- assert_in_delta(0.5, 1.fdiv(@fmax2) * @fmax, 0.01)
- end
-
- def test_big_fdiv
- assert_equal(1, @big.fdiv(@big))
- assert_not_equal(0, @big.fdiv(@fmax2))
- assert_not_equal(0, @fmax2.fdiv(@big))
- assert_not_equal(0, @fmax2.fdiv(@fmax2))
- assert_in_delta(0.5, @fmax.fdiv(@fmax2), 0.01)
- assert_in_delta(1.0, @fmax2.fdiv(@fmax2), 0.01)
- end
-
end
diff --git a/test/ruby/test_call.rb b/test/ruby/test_call.rb
index 8f861d96a1..da7ee93c73 100644
--- a/test/ruby/test_call.rb
+++ b/test/ruby/test_call.rb
@@ -8,8 +8,8 @@ class TestCall < Test::Unit::TestCase
end
def test_call
- assert_raise(ArgumentError) {aaa()}
- assert_raise(ArgumentError) {aaa}
+ assert_raises(ArgumentError) {aaa()}
+ assert_raises(ArgumentError) {aaa}
assert_equal([1, 100], aaa(1))
assert_equal([1, 2], aaa(1, 2))
diff --git a/test/ruby/test_case.rb b/test/ruby/test_case.rb
index 0123e7422f..41a22038a0 100644
--- a/test/ruby/test_case.rb
+++ b/test/ruby/test_case.rb
@@ -1,5 +1,4 @@
require 'test/unit'
-require 'envutil.rb'
class TestCase < Test::Unit::TestCase
def test_case
@@ -47,14 +46,4 @@ class TestCase < Test::Unit::TestCase
assert(false)
end
end
-
- def test_deoptimization
- assert_in_out_err(['-e', <<-EOS], '', %w[42], [])
- class Symbol; def ===(o); p 42; true; end; end; case :foo; when :foo; end
- EOS
-
- assert_in_out_err(['-e', <<-EOS], '', %w[42], [])
- class Fixnum; def ===(o); p 42; true; end; end; case 1; when 1; end
- EOS
- end
end
diff --git a/test/ruby/test_class.rb b/test/ruby/test_class.rb
deleted file mode 100644
index 93a19e86e9..0000000000
--- a/test/ruby/test_class.rb
+++ /dev/null
@@ -1,147 +0,0 @@
-require 'test/unit'
-require_relative 'envutil'
-
-class TestClass < Test::Unit::TestCase
- # ------------------
- # Various test classes
- # ------------------
-
- class ClassOne
- attr :num_args
- @@subs = []
- def initialize(*args)
- @num_args = args.size
- @args = args
- end
- def [](n)
- @args[n]
- end
- def ClassOne.inherited(klass)
- @@subs.push klass
- end
- def subs
- @@subs
- end
- end
-
- class ClassTwo < ClassOne
- end
-
- class ClassThree < ClassOne
- end
-
- class ClassFour < ClassThree
- end
-
- # ------------------
- # Start of tests
- # ------------------
-
- def test_s_inherited
- assert_equal([ClassTwo, ClassThree, ClassFour], ClassOne.new.subs)
- end
-
- def test_s_new
- c = Class.new
- assert_same(Class, c.class)
- assert_same(Object, c.superclass)
-
- c = Class.new(Fixnum)
- assert_same(Class, c.class)
- assert_same(Fixnum, c.superclass)
- end
-
- def test_00_new_basic
- a = ClassOne.new
- assert_equal(ClassOne, a.class)
- assert_equal(0, a.num_args)
-
- a = ClassOne.new(1, 2, 3)
- assert_equal(3, a.num_args)
- assert_equal(1, a[0])
- end
-
- def test_01_new_inherited
- a = ClassTwo.new
- assert_equal(ClassTwo, a.class)
- assert_equal(0, a.num_args)
-
- a = ClassTwo.new(1, 2, 3)
- assert_equal(3, a.num_args)
- assert_equal(1, a[0])
- end
-
- def test_superclass
- assert_equal(ClassOne, ClassTwo.superclass)
- assert_equal(Object, ClassTwo.superclass.superclass)
- assert_equal(BasicObject, ClassTwo.superclass.superclass.superclass)
- end
-
- def test_class_cmp
- assert_raise(TypeError) { Class.new <= 1 }
- assert_raise(TypeError) { Class.new >= 1 }
- assert_nil(Class.new <=> 1)
- end
-
- def test_class_initialize
- assert_raise(TypeError) do
- Class.new.instance_eval { initialize }
- end
- end
-
- def test_instanciate_singleton_class
- c = class << Object.new; self; end
- assert_raise(TypeError) { c.new }
- end
-
- def test_superclass_of_basicobject
- assert_equal(nil, BasicObject.superclass)
- end
-
- def test_module_function
- c = Class.new
- assert_raise(TypeError) do
- Module.instance_method(:module_function).bind(c).call(:foo)
- end
- end
-
- def test_check_inheritable
- assert_raise(TypeError) { Class.new(Object.new) }
-
- o = Object.new
- c = class << o; self; end
- assert_raise(TypeError) { Class.new(c) }
-
- assert_nothing_raised { Class.new(Class) } # is it OK?
- assert_raise(TypeError) { eval("class Foo < Class; end") }
- end
-
- def test_initialize_copy
- c = Class.new
- assert_raise(TypeError) { c.instance_eval { initialize_copy(1) } }
-
- o = Object.new
- c = class << o; self; end
- assert_raise(TypeError) { c.dup }
- end
-
- def test_singleton_class
- assert_raise(TypeError) { 1.extend(Module.new) }
- assert_raise(TypeError) { :foo.extend(Module.new) }
-
- assert_in_out_err([], <<-INPUT, %w(:foo :foo true true), [])
- module Foo; def foo; :foo; end; end
- false.extend(Foo)
- true.extend(Foo)
- p false.foo
- p true.foo
- p FalseClass.include?(Foo)
- p TrueClass.include?(Foo)
- INPUT
- end
-
- def test_uninitialized
- assert_raise(TypeError) { Class.allocate.new }
- assert_raise(TypeError) { Class.allocate.superclass }
- end
-end
diff --git a/test/ruby/test_clone.rb b/test/ruby/test_clone.rb
index c5e2469d10..43c0cffa1d 100644
--- a/test/ruby/test_clone.rb
+++ b/test/ruby/test_clone.rb
@@ -21,7 +21,7 @@ class TestClone < Test::Unit::TestCase
assert_equal("test", bar.test)
assert_equal("test", foo.test)
- assert_raise(NoMethodError) {foo.test2}
+ assert_raises(NoMethodError) {foo.test2}
assert_equal([M003, M002, M001], M003.ancestors)
end
diff --git a/test/ruby/test_comparable.rb b/test/ruby/test_comparable.rb
deleted file mode 100644
index e558b190f0..0000000000
--- a/test/ruby/test_comparable.rb
+++ /dev/null
@@ -1,66 +0,0 @@
-require 'test/unit'
-
-class TestComparable < Test::Unit::TestCase
- def setup
- @o = Object.new
- @o.extend(Comparable)
- end
-
- def test_equal
- def @o.<=>(x); 0; end
- assert_equal(true, @o == nil)
- def @o.<=>(x); 1; end
- assert_equal(false, @o == nil)
- def @o.<=>(x); raise; end
- assert_equal(false, @o == nil)
- end
-
- def test_gt
- def @o.<=>(x); 1; end
- assert_equal(true, @o > nil)
- def @o.<=>(x); 0; end
- assert_equal(false, @o > nil)
- def @o.<=>(x); -1; end
- assert_equal(false, @o > nil)
- end
-
- def test_ge
- def @o.<=>(x); 1; end
- assert_equal(true, @o >= nil)
- def @o.<=>(x); 0; end
- assert_equal(true, @o >= nil)
- def @o.<=>(x); -1; end
- assert_equal(false, @o >= nil)
- end
-
- def test_lt
- def @o.<=>(x); 1; end
- assert_equal(false, @o < nil)
- def @o.<=>(x); 0; end
- assert_equal(false, @o < nil)
- def @o.<=>(x); -1; end
- assert_equal(true, @o < nil)
- end
-
- def test_le
- def @o.<=>(x); 1; end
- assert_equal(false, @o <= nil)
- def @o.<=>(x); 0; end
- assert_equal(true, @o <= nil)
- def @o.<=>(x); -1; end
- assert_equal(true, @o <= nil)
- end
-
- def test_between
- def @o.<=>(x); 0 <=> x end
- assert_equal(false, @o.between?(1, 2))
- assert_equal(false, @o.between?(-2, -1))
- assert_equal(true, @o.between?(-1, 1))
- assert_equal(true, @o.between?(0, 0))
- end
-
- def test_err
- assert_raise(ArgumentError) { 1.0 < nil }
- assert_raise(ArgumentError) { 1.0 < Object.new }
- end
-end
diff --git a/test/ruby/test_complex.rb b/test/ruby/test_complex.rb
deleted file mode 100644
index ca26f45d21..0000000000
--- a/test/ruby/test_complex.rb
+++ /dev/null
@@ -1,1081 +0,0 @@
-require 'test/unit'
-
-class ComplexSub < Complex; end
-
-class Complex_Test < Test::Unit::TestCase
-
- def setup
- @rational = defined?(Rational)
- if @rational
- @keiju = Rational.instance_variable_get('@RCS_ID')
- end
- @unify = $".grep(/mathn/).size != 0
- end
-
- def test_compsub
- c = ComplexSub.__send__(:convert, 1)
-
- assert_kind_of(Numeric, c)
-
- if @unify
- assert_instance_of(Fixnum, c)
- else
- assert_instance_of(ComplexSub, c)
-
- c2 = c + 1
- assert_instance_of(ComplexSub, c2)
- c2 = c - 1
- assert_instance_of(ComplexSub, c2)
-
- c3 = c - c2
- assert_instance_of(ComplexSub, c3)
-
- s = Marshal.dump(c)
- c5 = Marshal.load(s)
- assert_equal(c, c5)
- assert_instance_of(ComplexSub, c5)
- end
-
- end
-
- def test_eql_p
- c = Complex(0)
- c2 = Complex(0)
- c3 = Complex(1)
-
- assert_equal(true, c.eql?(c2))
- assert_equal(false, c.eql?(c3))
-
- if @unify
- assert_equal(true, c.eql?(0))
- else
- assert_equal(false, c.eql?(0))
- end
- end
-
- def test_hash
- assert_instance_of(Fixnum, Complex(1,2).hash)
- assert_instance_of(Fixnum, Complex(1.0,2.0).hash)
-
- h = {}
- h[Complex(0)] = 0
- h[Complex(0,1)] = 1
- h[Complex(1,0)] = 2
- h[Complex(1,1)] = 3
-
- assert_equal(4, h.size)
- assert_equal(2, h[Complex(1,0)])
-
- h[Complex(0,0)] = 9
- assert_equal(4, h.size)
-
- h[Complex(0.0,0.0)] = 9.0
- assert_equal(5, h.size)
-
- if (0.0/0).nan? && !((0.0/0).eql?(0.0/0))
- h = {}
- 3.times{h[Complex(0.0/0)] = 1}
- assert_equal(3, h.size)
- end
- end
-
- def test_freeze
- c = Complex(1)
- c.freeze
- unless @unify
- assert_equal(true, c.frozen?)
- end
- assert_instance_of(String, c.to_s)
- end
-
- def test_conv
- c = Complex(0,0)
- assert_equal(Complex(0,0), c)
-
- c = Complex(2**32, 2**32)
- assert_equal(Complex(2**32,2**32), c)
- assert_equal([2**32,2**32], [c.real,c.imag])
-
- c = Complex(-2**32, 2**32)
- assert_equal(Complex(-2**32,2**32), c)
- assert_equal([-2**32,2**32], [c.real,c.imag])
-
- c = Complex(2**32, -2**32)
- assert_equal(Complex(2**32,-2**32), c)
- assert_equal([2**32,-2**32], [c.real,c.imag])
-
- c = Complex(-2**32, -2**32)
- assert_equal(Complex(-2**32,-2**32), c)
- assert_equal([-2**32,-2**32], [c.real,c.imag])
-
- c = Complex(Complex(1,2),2)
- assert_equal(Complex(1,4), c)
-
- c = Complex(2,Complex(1,2))
- assert_equal(Complex(0,1), c)
-
- c = Complex(Complex(1,2),Complex(1,2))
- assert_equal(Complex(-1,3), c)
-
- c = Complex::I
- assert_equal(Complex(0,1), c)
-
- assert_equal(Complex(1),Complex(1))
- assert_equal(Complex(1),Complex('1'))
- assert_equal(Complex(3.0,3.0),Complex('3.0','3.0'))
- if @rational && !@keiju
- assert_equal(Complex(1,1),Complex('3/3','3/3'))
- end
- assert_raise(TypeError){Complex(nil)}
- assert_raise(TypeError){Complex(Object.new)}
- assert_raise(ArgumentError){Complex()}
- assert_raise(ArgumentError){Complex(1,2,3)}
-
- if (0.0/0).nan?
- assert_nothing_raised{Complex(0.0/0)}
- end
- if (1.0/0).infinite?
- assert_nothing_raised{Complex(1.0/0)}
- end
- end
-
- def test_attr
- c = Complex(4)
-
- assert_equal(4, c.real)
- assert_equal(0, c.imag)
-
- c = Complex(4,5)
-
- assert_equal(4, c.real)
- assert_equal(5, c.imag)
-
- if -0.0.to_s == '-0.0'
- c = Complex(-0.0,-0.0)
-
- assert_equal('-0.0', c.real.to_s)
- assert_equal('-0.0', c.imag.to_s)
- end
-
- c = Complex(4)
-
- assert_equal(4, c.real)
- assert_equal(0, c.imag)
- assert_equal(c.imag, c.imaginary)
-
- c = Complex(4,5)
-
- assert_equal(4, c.real)
- assert_equal(5, c.imag)
- assert_equal(c.imag, c.imaginary)
-
- if -0.0.to_s == '-0.0'
- c = Complex(-0.0,-0.0)
-
- assert_equal('-0.0', c.real.to_s)
- assert_equal('-0.0', c.imag.to_s)
- assert_equal(c.imag.to_s, c.imaginary.to_s)
- end
-
- c = Complex(4)
-
- assert_equal(4, c.real)
- assert_equal(c.imag, c.imaginary)
- assert_equal(0, c.imag)
-
- c = Complex(4,5)
-
- assert_equal(4, c.real)
- assert_equal(5, c.imag)
- assert_equal(c.imag, c.imaginary)
-
- c = Complex(-0.0,-0.0)
-
- assert_equal('-0.0', c.real.to_s)
- assert_equal('-0.0', c.imag.to_s)
- assert_equal(c.imag.to_s, c.imaginary.to_s)
- end
-
- def test_attr2
- c = Complex(1)
-
- if @unify
-=begin
- assert_equal(true, c.finite?)
- assert_equal(false, c.infinite?)
- assert_equal(false, c.nan?)
- assert_equal(true, c.integer?)
- assert_equal(false, c.float?)
- assert_equal(true, c.rational?)
-=end
- assert_equal(true, c.real?)
-=begin
- assert_equal(false, c.complex?)
- assert_equal(true, c.exact?)
- assert_equal(false, c.inexact?)
-=end
- else
-=begin
- assert_equal(true, c.finite?)
- assert_equal(false, c.infinite?)
- assert_equal(false, c.nan?)
- assert_equal(false, c.integer?)
- assert_equal(false, c.float?)
- assert_equal(false, c.rational?)
-=end
- assert_equal(false, c.real?)
-=begin
- assert_equal(true, c.complex?)
- assert_equal(true, c.exact?)
- assert_equal(false, c.inexact?)
-=end
- end
-
-=begin
- assert_equal(0, Complex(0).sign)
- assert_equal(1, Complex(2).sign)
- assert_equal(-1, Complex(-2).sign)
-=end
-
- assert_equal(true, Complex(0).zero?)
- assert_equal(true, Complex(0,0).zero?)
- assert_equal(false, Complex(1,0).zero?)
- assert_equal(false, Complex(0,1).zero?)
- assert_equal(false, Complex(1,1).zero?)
-
- assert_equal(nil, Complex(0).nonzero?)
- assert_equal(nil, Complex(0,0).nonzero?)
- assert_equal(Complex(1,0), Complex(1,0).nonzero?)
- assert_equal(Complex(0,1), Complex(0,1).nonzero?)
- assert_equal(Complex(1,1), Complex(1,1).nonzero?)
- end
-
- def test_rect
- assert_equal([1,2], Complex.rectangular(1,2).rectangular)
- assert_equal([1,2], Complex.rect(1,2).rect)
- end
-
- def test_polar
- assert_equal([1,2], Complex.polar(1,2).polar)
- end
-
- def test_uplus
- assert_equal(Complex(1), +Complex(1))
- assert_equal(Complex(-1), +Complex(-1))
- assert_equal(Complex(1,1), +Complex(1,1))
- assert_equal(Complex(-1,1), +Complex(-1,1))
- assert_equal(Complex(1,-1), +Complex(1,-1))
- assert_equal(Complex(-1,-1), +Complex(-1,-1))
-
- if -0.0.to_s == '-0.0'
- c = +Complex(0.0,0.0)
- assert_equal('0.0', c.real.to_s)
- assert_equal('0.0', c.imag.to_s)
-
- c = +Complex(-0.0,-0.0)
- assert_equal('-0.0', c.real.to_s)
- assert_equal('-0.0', c.imag.to_s)
- end
- end
-
- def test_negate
- assert_equal(Complex(-1), -Complex(1))
- assert_equal(Complex(1), -Complex(-1))
- assert_equal(Complex(-1,-1), -Complex(1,1))
- assert_equal(Complex(1,-1), -Complex(-1,1))
- assert_equal(Complex(-1,1), -Complex(1,-1))
- assert_equal(Complex(1,1), -Complex(-1,-1))
-
- if -0.0.to_s == '-0.0'
- c = -Complex(0.0,0.0)
- assert_equal('-0.0', c.real.to_s)
- assert_equal('-0.0', c.imag.to_s)
-
- c = -Complex(-0.0,-0.0)
- assert_equal('0.0', c.real.to_s)
- assert_equal('0.0', c.imag.to_s)
- end
-
-=begin
- assert_equal(0, Complex(0).negate)
- assert_equal(-2, Complex(2).negate)
- assert_equal(2, Complex(-2).negate)
-=end
- end
-
- def test_add
- c = Complex(1,2)
- c2 = Complex(2,3)
-
- assert_equal(Complex(3,5), c + c2)
-
- assert_equal(Complex(3,2), c + 2)
- assert_equal(Complex(3.0,2), c + 2.0)
-
- if @rational
- assert_equal(Complex(Rational(3,1),Rational(2)), c + Rational(2))
- assert_equal(Complex(Rational(5,3),Rational(2)), c + Rational(2,3))
- end
- end
-
- def test_sub
- c = Complex(1,2)
- c2 = Complex(2,3)
-
- assert_equal(Complex(-1,-1), c - c2)
-
- assert_equal(Complex(-1,2), c - 2)
- assert_equal(Complex(-1.0,2), c - 2.0)
-
- if @rational
- assert_equal(Complex(Rational(-1,1),Rational(2)), c - Rational(2))
- assert_equal(Complex(Rational(1,3),Rational(2)), c - Rational(2,3))
- end
- end
-
- def test_mul
- c = Complex(1,2)
- c2 = Complex(2,3)
-
- assert_equal(Complex(-4,7), c * c2)
-
- assert_equal(Complex(2,4), c * 2)
- assert_equal(Complex(2.0,4.0), c * 2.0)
-
- if @rational
- assert_equal(Complex(Rational(2,1),Rational(4)), c * Rational(2))
- assert_equal(Complex(Rational(2,3),Rational(4,3)), c * Rational(2,3))
- end
-
- end
-
- def test_div
- c = Complex(1,2)
- c2 = Complex(2,3)
-
- if @rational
- assert_equal(Complex(Rational(8,13),Rational(1,13)), c / c2)
- else
- r = c / c2
- assert_in_delta(0.615, r.real, 0.001)
- assert_in_delta(0.076, r.imag, 0.001)
- end
-
- c = Complex(1.0,2.0)
- c2 = Complex(2.0,3.0)
-
- r = c / c2
- assert_in_delta(0.615, r.real, 0.001)
- assert_in_delta(0.076, r.imag, 0.001)
-
- c = Complex(1,2)
- c2 = Complex(2,3)
-
- if @rational
- assert_equal(Complex(Rational(1,2),1), c / 2)
- else
- assert_equal(Complex(0.5,1.0), c / 2)
- end
- assert_equal(Complex(0.5,1.0), c / 2.0)
-
- if @rational
- assert_equal(Complex(Rational(1,2),Rational(1)), c / Rational(2))
- assert_equal(Complex(Rational(3,2),Rational(3)), c / Rational(2,3))
- end
- end
-
- def test_quo
- c = Complex(1,2)
- c2 = Complex(2,3)
-
- if @rational
- assert_equal(Complex(Rational(8,13),Rational(1,13)), c.quo(c2))
- else
- r = c.quo(c2)
- assert_in_delta(0.615, r.real, 0.001)
- assert_in_delta(0.076, r.imag, 0.001)
- end
-
- c = Complex(1.0,2.0)
- c2 = Complex(2.0,3.0)
-
- r = c.quo(c2)
- assert_in_delta(0.615, r.real, 0.001)
- assert_in_delta(0.076, r.imag, 0.001)
-
- c = Complex(1,2)
- c2 = Complex(2,3)
-
- if @rational
- assert_equal(Complex(Rational(1,2),1), c.quo(2))
- else
- assert_equal(Complex(0.5,1.0), c.quo(2))
- end
- assert_equal(Complex(0.5,1.0), c.quo(2.0))
-
- if @rational
- assert_equal(Complex(Rational(1,2),Rational(1)), c / Rational(2))
- assert_equal(Complex(Rational(3,2),Rational(3)), c / Rational(2,3))
- end
- end
-
- def test_fdiv
- c = Complex(1,2)
- c2 = Complex(2,3)
-
- r = c.fdiv(c2)
- assert_in_delta(0.615, r.real, 0.001)
- assert_in_delta(0.076, r.imag, 0.001)
-
- c = Complex(1.0,2.0)
- c2 = Complex(2.0,3.0)
-
- r = c.fdiv(c2)
- assert_in_delta(0.615, r.real, 0.001)
- assert_in_delta(0.076, r.imag, 0.001)
-
- c = Complex(1,2)
- c2 = Complex(2,3)
-
- assert_equal(Complex(0.5,1.0), c.fdiv(2))
- assert_equal(Complex(0.5,1.0), c.fdiv(2.0))
- end
-
- def test_expt
- c = Complex(1,2)
- c2 = Complex(2,3)
-
- r = c ** c2
- assert_in_delta(-0.015, r.real, 0.001)
- assert_in_delta(-0.179, r.imag, 0.001)
-
- assert_equal(Complex(-3,4), c ** 2)
- if @rational && !@keiju
- assert_equal(Complex(Rational(-3,25),Rational(-4,25)), c ** -2)
- else
- r = c ** -2
- assert_in_delta(-0.12, r.real, 0.001)
- assert_in_delta(-0.16, r.imag, 0.001)
- end
- r = c ** 2.0
- assert_in_delta(-3.0, r.real, 0.001)
- assert_in_delta(4.0, r.imag, 0.001)
-
- r = c ** -2.0
- assert_in_delta(-0.12, r.real, 0.001)
- assert_in_delta(-0.16, r.imag, 0.001)
-
- if @rational && !@keiju
- assert_equal(Complex(-3,4), c ** Rational(2))
-#=begin
- assert_equal(Complex(Rational(-3,25),Rational(-4,25)),
- c ** Rational(-2)) # why failed?
-#=end
-
- r = c ** Rational(2,3)
- assert_in_delta(1.264, r.real, 0.001)
- assert_in_delta(1.150, r.imag, 0.001)
-
- r = c ** Rational(-2,3)
- assert_in_delta(0.432, r.real, 0.001)
- assert_in_delta(-0.393, r.imag, 0.001)
- end
- end
-
- def test_cmp
- assert_raise(NoMethodError){1 <=> Complex(1,1)}
- assert_raise(NoMethodError){Complex(1,1) <=> 1}
- assert_raise(NoMethodError){Complex(1,1) <=> Complex(1,1)}
- end
-
- def test_eqeq
- assert(Complex(1,0) == Complex(1))
- assert(Complex(-1,0) == Complex(-1))
-
- assert_equal(false, Complex(2,1) == Complex(1))
- assert_equal(true, Complex(2,1) != Complex(1))
- assert_equal(false, Complex(1) == nil)
- assert_equal(false, Complex(1) == '')
-
- nan = 0.0 / 0
- if nan.nan? && nan != nan
- assert_equal(false, Complex(nan, 0) == Complex(nan, 0))
- assert_equal(false, Complex(0, nan) == Complex(0, nan))
- assert_equal(false, Complex(nan, nan) == Complex(nan, nan))
- end
- end
-
- def test_coerce
- assert_equal([Complex(2),Complex(1)], Complex(1).coerce(2))
- assert_equal([Complex(2.2),Complex(1)], Complex(1).coerce(2.2))
- assert_equal([Complex(Rational(2)),Complex(1)],
- Complex(1).coerce(Rational(2)))
- assert_equal([Complex(2),Complex(1)], Complex(1).coerce(Complex(2)))
- end
-
- def test_unify
- if @unify
- assert_instance_of(Fixnum, Complex(1,2) + Complex(-1,-2))
- assert_instance_of(Fixnum, Complex(1,2) - Complex(1,2))
- assert_instance_of(Fixnum, Complex(1,2) * 0)
- assert_instance_of(Fixnum, Complex(1,2) / Complex(1,2))
-# assert_instance_of(Fixnum, Complex(1,2).div(Complex(1,2)))
- assert_instance_of(Fixnum, Complex(1,2).quo(Complex(1,2)))
-# assert_instance_of(Fixnum, Complex(1,2) ** 0) # mathn's bug
- end
- end
-
- def test_math
- c = Complex(1,2)
-
- assert_in_delta(2.236, c.abs, 0.001)
- assert_in_delta(2.236, c.magnitude, 0.001)
- assert_equal(5, c.abs2)
-
- assert_equal(c.abs, Math.sqrt(c * c.conj))
- assert_equal(c.abs, Math.sqrt(c.real**2 + c.imag**2))
- assert_equal(c.abs2, c * c.conj)
- assert_equal(c.abs2, c.real**2 + c.imag**2)
-
- assert_in_delta(1.107, c.arg, 0.001)
- assert_in_delta(1.107, c.angle, 0.001)
- assert_in_delta(1.107, c.phase, 0.001)
-
- r = c.polar
- assert_in_delta(2.236, r[0], 0.001)
- assert_in_delta(1.107, r[1], 0.001)
- assert_equal(Complex(1,-2), c.conjugate)
- assert_equal(Complex(1,-2), c.conj)
-# assert_equal(Complex(1,-2), ~c)
-# assert_equal(5, c * ~c)
-
- assert_equal(Complex(1,2), c.numerator)
- assert_equal(1, c.denominator)
- end
-
- def test_to_s
- c = Complex(1,2)
-
- assert_instance_of(String, c.to_s)
- assert_equal('1+2i', c.to_s)
-
- assert_equal('0+2i', Complex(0,2).to_s)
- assert_equal('0-2i', Complex(0,-2).to_s)
- assert_equal('1+2i', Complex(1,2).to_s)
- assert_equal('-1+2i', Complex(-1,2).to_s)
- assert_equal('-1-2i', Complex(-1,-2).to_s)
- assert_equal('1-2i', Complex(1,-2).to_s)
- assert_equal('-1-2i', Complex(-1,-2).to_s)
-
- assert_equal('0+2.0i', Complex(0,2.0).to_s)
- assert_equal('0-2.0i', Complex(0,-2.0).to_s)
- assert_equal('1.0+2.0i', Complex(1.0,2.0).to_s)
- assert_equal('-1.0+2.0i', Complex(-1.0,2.0).to_s)
- assert_equal('-1.0-2.0i', Complex(-1.0,-2.0).to_s)
- assert_equal('1.0-2.0i', Complex(1.0,-2.0).to_s)
- assert_equal('-1.0-2.0i', Complex(-1.0,-2.0).to_s)
-
- if @rational && !@unify && !@keiju
- assert_equal('0+2/1i', Complex(0,Rational(2)).to_s)
- assert_equal('0-2/1i', Complex(0,Rational(-2)).to_s)
- assert_equal('1+2/1i', Complex(1,Rational(2)).to_s)
- assert_equal('-1+2/1i', Complex(-1,Rational(2)).to_s)
- assert_equal('-1-2/1i', Complex(-1,Rational(-2)).to_s)
- assert_equal('1-2/1i', Complex(1,Rational(-2)).to_s)
- assert_equal('-1-2/1i', Complex(-1,Rational(-2)).to_s)
-
- assert_equal('0+2/3i', Complex(0,Rational(2,3)).to_s)
- assert_equal('0-2/3i', Complex(0,Rational(-2,3)).to_s)
- assert_equal('1+2/3i', Complex(1,Rational(2,3)).to_s)
- assert_equal('-1+2/3i', Complex(-1,Rational(2,3)).to_s)
- assert_equal('-1-2/3i', Complex(-1,Rational(-2,3)).to_s)
- assert_equal('1-2/3i', Complex(1,Rational(-2,3)).to_s)
- assert_equal('-1-2/3i', Complex(-1,Rational(-2,3)).to_s)
- end
-
- nan = 0.0 / 0
- inf = 1.0 / 0
- if nan.nan?
- assert_equal('NaN+NaN*i', Complex(nan,nan).to_s)
- end
- if inf.infinite?
- assert_equal('Infinity+Infinity*i', Complex(inf,inf).to_s)
- assert_equal('Infinity-Infinity*i', Complex(inf,-inf).to_s)
- end
- end
-
- def test_inspect
- c = Complex(1,2)
-
- assert_instance_of(String, c.inspect)
- assert_equal('(1+2i)', c.inspect)
- end
-
- def test_marshal
- c = Complex(1,2)
- c.instance_eval{@ivar = 9}
-
- s = Marshal.dump(c)
- c2 = Marshal.load(s)
- assert_equal(c, c2)
- assert_equal(9, c2.instance_variable_get(:@ivar))
- assert_instance_of(Complex, c2)
-
- if @rational
- c = Complex(Rational(1,2),Rational(2,3))
-
- s = Marshal.dump(c)
- c2 = Marshal.load(s)
- assert_equal(c, c2)
- assert_instance_of(Complex, c2)
- end
- end
-
- def test_parse
- assert_equal(Complex(5), '5'.to_c)
- assert_equal(Complex(-5), '-5'.to_c)
- assert_equal(Complex(5,3), '5+3i'.to_c)
- assert_equal(Complex(-5,3), '-5+3i'.to_c)
- assert_equal(Complex(5,-3), '5-3i'.to_c)
- assert_equal(Complex(-5,-3), '-5-3i'.to_c)
- assert_equal(Complex(0,3), '3i'.to_c)
- assert_equal(Complex(0,-3), '-3i'.to_c)
- assert_equal(Complex(5,1), '5+i'.to_c)
- assert_equal(Complex(0,1), 'i'.to_c)
- assert_equal(Complex(0,1), '+i'.to_c)
- assert_equal(Complex(0,-1), '-i'.to_c)
-
- assert_equal(Complex(5,3), '5+3I'.to_c)
- assert_equal(Complex(5,3), '5+3j'.to_c)
- assert_equal(Complex(5,3), '5+3J'.to_c)
- assert_equal(Complex(0,3), '3I'.to_c)
- assert_equal(Complex(0,3), '3j'.to_c)
- assert_equal(Complex(0,3), '3J'.to_c)
- assert_equal(Complex(0,1), 'I'.to_c)
- assert_equal(Complex(0,1), 'J'.to_c)
-
- assert_equal(Complex(5.0), '5.0'.to_c)
- assert_equal(Complex(-5.0), '-5.0'.to_c)
- assert_equal(Complex(5.0,3.0), '5.0+3.0i'.to_c)
- assert_equal(Complex(-5.0,3.0), '-5.0+3.0i'.to_c)
- assert_equal(Complex(5.0,-3.0), '5.0-3.0i'.to_c)
- assert_equal(Complex(-5.0,-3.0), '-5.0-3.0i'.to_c)
- assert_equal(Complex(0.0,3.0), '3.0i'.to_c)
- assert_equal(Complex(0.0,-3.0), '-3.0i'.to_c)
-
- assert_equal(Complex(5.0), '5e0'.to_c)
- assert_equal(Complex(-5.0), '-5e0'.to_c)
- assert_equal(Complex(5.0,3.0), '5e0+3e0i'.to_c)
- assert_equal(Complex(-5.0,3.0), '-5e0+3e0i'.to_c)
- assert_equal(Complex(5.0,-3.0), '5e0-3e0i'.to_c)
- assert_equal(Complex(-5.0,-3.0), '-5e0-3e0i'.to_c)
- assert_equal(Complex(0.0,3.0), '3e0i'.to_c)
- assert_equal(Complex(0.0,-3.0), '-3e0i'.to_c)
-
- assert_equal(Complex(0.33), '.33'.to_c)
- assert_equal(Complex(0.33), '0.33'.to_c)
- assert_equal(Complex(-0.33), '-.33'.to_c)
- assert_equal(Complex(-0.33), '-0.33'.to_c)
- assert_equal(Complex(-0.33), '-0.3_3'.to_c)
-
- assert_equal(Complex.polar(10,10), '10@10'.to_c)
- assert_equal(Complex.polar(-10,-10), '-10@-10'.to_c)
- assert_equal(Complex.polar(10.5,10.5), '10.5@10.5'.to_c)
- assert_equal(Complex.polar(-10.5,-10.5), '-10.5@-10.5'.to_c)
-
- assert_equal(Complex(5), Complex('5'))
- assert_equal(Complex(-5), Complex('-5'))
- assert_equal(Complex(5,3), Complex('5+3i'))
- assert_equal(Complex(-5,3), Complex('-5+3i'))
- assert_equal(Complex(5,-3), Complex('5-3i'))
- assert_equal(Complex(-5,-3), Complex('-5-3i'))
- assert_equal(Complex(0,3), Complex('3i'))
- assert_equal(Complex(0,-3), Complex('-3i'))
- assert_equal(Complex(5,1), Complex('5+i'))
- assert_equal(Complex(0,1), Complex('i'))
- assert_equal(Complex(0,1), Complex('+i'))
- assert_equal(Complex(0,-1), Complex('-i'))
-
- assert_equal(Complex(5,3), Complex('5+3I'))
- assert_equal(Complex(5,3), Complex('5+3j'))
- assert_equal(Complex(5,3), Complex('5+3J'))
- assert_equal(Complex(0,3), Complex('3I'))
- assert_equal(Complex(0,3), Complex('3j'))
- assert_equal(Complex(0,3), Complex('3J'))
- assert_equal(Complex(0,1), Complex('I'))
- assert_equal(Complex(0,1), Complex('J'))
-
- assert_equal(Complex(5.0), Complex('5.0'))
- assert_equal(Complex(-5.0), Complex('-5.0'))
- assert_equal(Complex(5.0,3.0), Complex('5.0+3.0i'))
- assert_equal(Complex(-5.0,3.0), Complex('-5.0+3.0i'))
- assert_equal(Complex(5.0,-3.0), Complex('5.0-3.0i'))
- assert_equal(Complex(-5.0,-3.0), Complex('-5.0-3.0i'))
- assert_equal(Complex(0.0,3.0), Complex('3.0i'))
- assert_equal(Complex(0.0,-3.0), Complex('-3.0i'))
-
- assert_equal(Complex(5.0), Complex('5e0'))
- assert_equal(Complex(-5.0), Complex('-5e0'))
- assert_equal(Complex(5.0,3.0), Complex('5e0+3e0i'))
- assert_equal(Complex(-5.0,3.0), Complex('-5e0+3e0i'))
- assert_equal(Complex(5.0,-3.0), Complex('5e0-3e0i'))
- assert_equal(Complex(-5.0,-3.0), Complex('-5e0-3e0i'))
- assert_equal(Complex(0.0,3.0), Complex('3e0i'))
- assert_equal(Complex(0.0,-3.0), Complex('-3e0i'))
-
- assert_equal(Complex(0.33), Complex('.33'))
- assert_equal(Complex(0.33), Complex('0.33'))
- assert_equal(Complex(-0.33), Complex('-.33'))
- assert_equal(Complex(-0.33), Complex('-0.33'))
- assert_equal(Complex(-0.33), Complex('-0.3_3'))
-
- assert_equal(Complex.polar(10,10), Complex('10@10'))
- assert_equal(Complex.polar(-10,-10), Complex('-10@-10'))
- assert_equal(Complex.polar(10.5,10.5), Complex('10.5@10.5'))
- assert_equal(Complex.polar(-10.5,-10.5), Complex('-10.5@-10.5'))
-
- assert_equal(Complex(0), ''.to_c)
- assert_equal(Complex(0), ' '.to_c)
- assert_equal(Complex(5), "\f\n\r\t\v5\0".to_c)
- assert_equal(Complex(0), '_'.to_c)
- assert_equal(Complex(0), '_5'.to_c)
- assert_equal(Complex(5), '5_'.to_c)
- assert_equal(Complex(5), '5x'.to_c)
- assert_equal(Complex(5), '5+_3i'.to_c)
- assert_equal(Complex(5), '5+3_i'.to_c)
- assert_equal(Complex(5,3), '5+3i_'.to_c)
- assert_equal(Complex(5,3), '5+3ix'.to_c)
- assert_raise(ArgumentError){ Complex('')}
- assert_raise(ArgumentError){ Complex('_')}
- assert_raise(ArgumentError){ Complex("\f\n\r\t\v5\0")}
- assert_raise(ArgumentError){ Complex('_5')}
- assert_raise(ArgumentError){ Complex('5_')}
- assert_raise(ArgumentError){ Complex('5x')}
- assert_raise(ArgumentError){ Complex('5+_3i')}
- assert_raise(ArgumentError){ Complex('5+3_i')}
- assert_raise(ArgumentError){ Complex('5+3i_')}
- assert_raise(ArgumentError){ Complex('5+3ix')}
-
- if @rational && defined?(''.to_r)
- assert_equal(Complex(Rational(1,5)), '1/5'.to_c)
- assert_equal(Complex(Rational(-1,5)), '-1/5'.to_c)
- assert_equal(Complex(Rational(1,5),3), '1/5+3i'.to_c)
- assert_equal(Complex(Rational(1,5),-3), '1/5-3i'.to_c)
- assert_equal(Complex(Rational(-1,5),3), '-1/5+3i'.to_c)
- assert_equal(Complex(Rational(-1,5),-3), '-1/5-3i'.to_c)
- assert_equal(Complex(Rational(1,5),Rational(3,2)), '1/5+3/2i'.to_c)
- assert_equal(Complex(Rational(1,5),Rational(-3,2)), '1/5-3/2i'.to_c)
- assert_equal(Complex(Rational(-1,5),Rational(3,2)), '-1/5+3/2i'.to_c)
- assert_equal(Complex(Rational(-1,5),Rational(-3,2)), '-1/5-3/2i'.to_c)
- assert_equal(Complex(Rational(1,5),Rational(3,2)), '1/5+3/2i'.to_c)
- assert_equal(Complex(Rational(1,5),Rational(-3,2)), '1/5-3/2i'.to_c)
- assert_equal(Complex(Rational(-1,5),Rational(3,2)), '-1/5+3/2i'.to_c)
- assert_equal(Complex(Rational(-1,5),Rational(-3,2)), '-1/5-3/2i'.to_c)
- assert_equal(Complex.polar(Rational(1,5),Rational(3,2)), Complex('1/5@3/2'))
- assert_equal(Complex.polar(Rational(-1,5),Rational(-3,2)), Complex('-1/5@-3/2'))
- end
-
- end
-
- def test_respond
- c = Complex(1,1)
- assert_equal(false, c.respond_to?(:%))
- assert_equal(false, c.respond_to?(:<))
- assert_equal(false, c.respond_to?(:<=))
- assert_equal(false, c.respond_to?(:<=>))
- assert_equal(false, c.respond_to?(:>))
- assert_equal(false, c.respond_to?(:>=))
- assert_equal(false, c.respond_to?(:between?))
- assert_equal(false, c.respond_to?(:div))
- assert_equal(false, c.respond_to?(:divmod))
- assert_equal(false, c.respond_to?(:floor))
- assert_equal(false, c.respond_to?(:ceil))
- assert_equal(false, c.respond_to?(:modulo))
- assert_equal(false, c.respond_to?(:remainder))
- assert_equal(false, c.respond_to?(:round))
- assert_equal(false, c.respond_to?(:step))
- assert_equal(false, c.respond_to?(:tunrcate))
-
- assert_equal(false, c.respond_to?(:positive?))
- assert_equal(false, c.respond_to?(:negative?))
-# assert_equal(false, c.respond_to?(:sign))
-
- assert_equal(false, c.respond_to?(:quotient))
- assert_equal(false, c.respond_to?(:quot))
- assert_equal(false, c.respond_to?(:quotrem))
-
- assert_equal(false, c.respond_to?(:gcd))
- assert_equal(false, c.respond_to?(:lcm))
- assert_equal(false, c.respond_to?(:gcdlcm))
- end
-
- def test_to_i
- assert_equal(3, Complex(3).to_i)
- assert_equal(3, Integer(Complex(3)))
- assert_raise(RangeError){Complex(3,2).to_i}
- assert_raise(RangeError){Integer(Complex(3,2))}
- end
-
- def test_to_f
- assert_equal(3.0, Complex(3).to_f)
- assert_equal(3.0, Float(Complex(3)))
- assert_raise(RangeError){Complex(3,2).to_f}
- assert_raise(RangeError){Float(Complex(3,2))}
- end
-
- def test_to_r
- if @rational && !@keiju
- assert_equal(Rational(3), Complex(3).to_r)
- assert_equal(Rational(3), Rational(Complex(3)))
- assert_raise(RangeError){Complex(3,2).to_r}
-# assert_raise(RangeError){Rational(Complex(3,2))}
- end
- end
-
- def test_to_c
- c = nil.to_c
- assert_equal([0,0], [c.real, c.imag])
-
- c = 0.to_c
- assert_equal([0,0], [c.real, c.imag])
-
- c = 1.to_c
- assert_equal([1,0], [c.real, c.imag])
-
- c = 1.1.to_c
- assert_equal([1.1, 0], [c.real, c.imag])
-
- if @rational
- c = Rational(1,2).to_c
- assert_equal([Rational(1,2), 0], [c.real, c.imag])
- end
-
- c = Complex(1,2).to_c
- assert_equal([1, 2], [c.real, c.imag])
-
- if (0.0/0).nan?
- assert_nothing_raised{(0.0/0).to_c}
- end
- if (1.0/0).infinite?
- assert_nothing_raised{(1.0/0).to_c}
- end
- end
-
- def test_supp
- assert_equal(true, 1.real?)
- assert_equal(true, 1.1.real?)
-
- assert_equal(1, 1.real)
- assert_equal(0, 1.imag)
- assert_equal(0, 1.imaginary)
-
- assert_equal(1.1, 1.1.real)
- assert_equal(0, 1.1.imag)
- assert_equal(0, 1.1.imaginary)
-
- assert_equal(1, 1.magnitude)
- assert_equal(1, -1.magnitude)
- assert_equal(1, 1.0.magnitude)
- assert_equal(1, -1.0.magnitude)
-
- assert_equal(4, 2.abs2)
- assert_equal(4, -2.abs2)
- assert_equal(4.0, 2.0.abs2)
- assert_equal(4.0, -2.0.abs2)
-
- assert_equal(0, 1.arg)
- assert_equal(0, 1.angle)
- assert_equal(0, 1.phase)
-
- assert_equal(0, 1.0.arg)
- assert_equal(0, 1.0.angle)
- assert_equal(0, 1.0.phase)
-
- if (0.0/0).nan?
- nan = 0.0/0
- assert(nan.arg.equal?(nan))
- assert(nan.angle.equal?(nan))
- assert(nan.phase.equal?(nan))
- end
-
- assert_equal(Math::PI, -1.arg)
- assert_equal(Math::PI, -1.angle)
- assert_equal(Math::PI, -1.phase)
-
- assert_equal(Math::PI, -1.0.arg)
- assert_equal(Math::PI, -1.0.angle)
- assert_equal(Math::PI, -1.0.phase)
-
- assert_equal([1,0], 1.rect)
- assert_equal([-1,0], -1.rect)
- assert_equal([1,0], 1.rectangular)
- assert_equal([-1,0], -1.rectangular)
-
- assert_equal([1.0,0], 1.0.rect)
- assert_equal([-1.0,0], -1.0.rect)
- assert_equal([1.0,0], 1.0.rectangular)
- assert_equal([-1.0,0], -1.0.rectangular)
-
- assert_equal([1,0], 1.polar)
- assert_equal([1, Math::PI], -1.polar)
-
- assert_equal([1.0,0], 1.0.polar)
- assert_equal([1.0, Math::PI], -1.0.polar)
-
- assert_equal(1, 1.conjugate)
- assert_equal(-1, -1.conjugate)
- assert_equal(1, 1.conj)
- assert_equal(-1, -1.conj)
-
- assert_equal(1.1, 1.1.conjugate)
- assert_equal(-1.1, -1.1.conjugate)
- assert_equal(1.1, 1.1.conj)
- assert_equal(-1.1, -1.1.conj)
-
- if @rational
- assert_equal(Complex(Rational(1,2),Rational(1)), Complex(1,2).quo(2))
- else
- assert_equal(Complex(0.5,1.0), Complex(1,2).quo(2))
- end
-
-=begin
- if @rational && !@keiju
- assert_equal(Complex(Rational(1,2),Rational(1)), Complex(1,2).quo(2))
- end
-=end
-
- assert_equal(0.5, 1.fdiv(2))
- assert_equal(5000000000.0, 10000000000.fdiv(2))
- assert_equal(0.5, 1.0.fdiv(2))
- if @rational
- assert_equal(0.25, Rational(1,2).fdiv(2))
- end
- assert_equal(Complex(0.5,1.0), Complex(1,2).quo(2))
-
- unless $".grep(/(\A|\/)complex/).empty?
- assert_equal(Complex(0,2), Math.sqrt(-4.0))
-# assert_equal(true, Math.sqrt(-4.0).inexact?)
- assert_equal(Complex(0,2), Math.sqrt(-4))
-# assert_equal(true, Math.sqrt(-4).exact?)
- if @rational
- assert_equal(Complex(0,2), Math.sqrt(Rational(-4)))
-# assert_equal(true, Math.sqrt(Rational(-4)).exact?)
- end
-
- assert_equal(Complex(0,3), Math.sqrt(-9.0))
-# assert_equal(true, Math.sqrt(-9.0).inexact?)
- assert_equal(Complex(0,3), Math.sqrt(-9))
-# assert_equal(true, Math.sqrt(-9).exact?)
- if @rational
- assert_equal(Complex(0,3), Math.sqrt(Rational(-9)))
-# assert_equal(true, Math.sqrt(Rational(-9)).exact?)
- end
-
- c = Math.sqrt(Complex(1, 2))
- assert_in_delta(1.272, c.real, 0.001)
- assert_in_delta(0.786, c.imag, 0.001)
-
- c = Math.sqrt(-9)
- assert_in_delta(0.0, c.real, 0.001)
- assert_in_delta(3.0, c.imag, 0.001)
-
- c = Math.exp(Complex(1, 2))
- assert_in_delta(-1.131, c.real, 0.001)
- assert_in_delta(2.471, c.imag, 0.001)
-
- c = Math.sin(Complex(1, 2))
- assert_in_delta(3.165, c.real, 0.001)
- assert_in_delta(1.959, c.imag, 0.001)
-
- c = Math.cos(Complex(1, 2))
- assert_in_delta(2.032, c.real, 0.001)
- assert_in_delta(-3.051, c.imag, 0.001)
-
- c = Math.tan(Complex(1, 2))
- assert_in_delta(0.033, c.real, 0.001)
- assert_in_delta(1.014, c.imag, 0.001)
-
- c = Math.sinh(Complex(1, 2))
- assert_in_delta(-0.489, c.real, 0.001)
- assert_in_delta(1.403, c.imag, 0.001)
-
- c = Math.cosh(Complex(1, 2))
- assert_in_delta(-0.642, c.real, 0.001)
- assert_in_delta(1.068, c.imag, 0.001)
-
- c = Math.tanh(Complex(1, 2))
- assert_in_delta(1.166, c.real, 0.001)
- assert_in_delta(-0.243, c.imag, 0.001)
-
- c = Math.log(Complex(1, 2))
- assert_in_delta(0.804, c.real, 0.001)
- assert_in_delta(1.107, c.imag, 0.001)
-
- c = Math.log(Complex(1, 2), Math::E)
- assert_in_delta(0.804, c.real, 0.001)
- assert_in_delta(1.107, c.imag, 0.001)
-
- c = Math.log(-1)
- assert_in_delta(0.0, c.real, 0.001)
- assert_in_delta(Math::PI, c.imag, 0.001)
-
- c = Math.log(8, 2)
- assert_in_delta(3.0, c.real, 0.001)
- assert_in_delta(0.0, c.imag, 0.001)
-
- c = Math.log(-8, -2)
- assert_in_delta(1.092, c.real, 0.001)
- assert_in_delta(-0.420, c.imag, 0.001)
-
- c = Math.log10(Complex(1, 2))
- assert_in_delta(0.349, c.real, 0.001)
- assert_in_delta(0.480, c.imag, 0.001)
-
- c = Math.asin(Complex(1, 2))
- assert_in_delta(0.427, c.real, 0.001)
- assert_in_delta(1.528, c.imag, 0.001)
-
- c = Math.acos(Complex(1, 2))
- assert_in_delta(1.143, c.real, 0.001)
- assert_in_delta(-1.528, c.imag, 0.001)
-
- c = Math.atan(Complex(1, 2))
- assert_in_delta(1.338, c.real, 0.001)
- assert_in_delta(0.402, c.imag, 0.001)
-
- c = Math.atan2(Complex(1, 2), 1)
- assert_in_delta(1.338, c.real, 0.001)
- assert_in_delta(0.402, c.imag, 0.001)
-
- c = Math.asinh(Complex(1, 2))
- assert_in_delta(1.469, c.real, 0.001)
- assert_in_delta(1.063, c.imag, 0.001)
-
- c = Math.acosh(Complex(1, 2))
- assert_in_delta(1.528, c.real, 0.001)
- assert_in_delta(1.143, c.imag, 0.001)
-
- c = Math.atanh(Complex(1, 2))
- assert_in_delta(0.173, c.real, 0.001)
- assert_in_delta(1.178, c.imag, 0.001)
- end
-
- end
-
- def test_ruby19
- assert_raise(NoMethodError){ Complex.new(1) }
- assert_raise(NoMethodError){ Complex.new!(1) }
- assert_raise(NoMethodError){ Complex.reduce(1) }
- end
-
- def test_fixed_bug
- if @rational && !@keiju
- assert_equal(Complex(1), 1 ** Complex(1))
- end
- assert_equal('-1.0-0.0i', Complex(-1.0, -0.0).to_s)
- end
-
- def test_known_bug
- end
-
-end
diff --git a/test/ruby/test_complex2.rb b/test/ruby/test_complex2.rb
deleted file mode 100644
index 4e960c3e36..0000000000
--- a/test/ruby/test_complex2.rb
+++ /dev/null
@@ -1,735 +0,0 @@
-require 'test/unit'
-
-class Complex_Test2 < Test::Unit::TestCase
-
- def test_kumi
- return unless defined?(Rational)
-
- assert_equal(Complex(1, 0), +Complex(1, 0))
- assert_equal(Complex(-1, 0), -Complex(1, 0))
- assert_equal(Complex(2, 0),
- Complex(1, 0) + Complex(1, 0))
- assert_equal(Complex(0, 0),
- Complex(1, 0) - Complex(1, 0))
- assert_equal(Complex(1, 0),
- Complex(1, 0) * Complex(1, 0))
- assert_equal(Complex(1, 0),
- Complex(1, 0) / Complex(1, 0))
- assert_equal(Complex(1073741790, 0),
- Complex(1, 0) + Complex(1073741789, 0))
- assert_equal(Complex(-1073741788, 0),
- Complex(1, 0) - Complex(1073741789, 0))
- assert_equal(Complex(1073741789, 0),
- Complex(1, 0) * Complex(1073741789, 0))
- assert_equal(Complex(Rational(1, 1073741789), 0),
- Complex(1, 0) / Complex(1073741789, 0))
- assert_equal(Complex(1073741828, 0),
- Complex(1, 0) + Complex(1073741827, 0))
- assert_equal(Complex(-1073741826, 0),
- Complex(1, 0) - Complex(1073741827, 0))
- assert_equal(Complex(1073741827, 0),
- Complex(1, 0) * Complex(1073741827, 0))
- assert_equal(Complex(Rational(1, 1073741827), 0),
- Complex(1, 0) / Complex(1073741827, 0))
- assert_equal(Complex(1073741790, 1073741789),
- Complex(1, 0) + Complex(1073741789, 1073741789))
- assert_equal(Complex(-1073741788, -1073741789),
- Complex(1, 0) - Complex(1073741789, 1073741789))
- assert_equal(Complex(1073741789, 1073741789),
- Complex(1, 0) * Complex(1073741789, 1073741789))
- assert_equal(Complex(Rational(1, 2147483578), Rational(-1, 2147483578)),
- Complex(1, 0) / Complex(1073741789, 1073741789))
- assert_equal(Complex(1073741790, 1073741827),
- Complex(1, 0) + Complex(1073741789, 1073741827))
- assert_equal(Complex(-1073741788, -1073741827),
- Complex(1, 0) - Complex(1073741789, 1073741827))
- assert_equal(Complex(1073741789, 1073741827),
- Complex(1, 0) * Complex(1073741789, 1073741827))
- assert_equal(Complex(Rational(1073741789, 2305842940494218450), Rational(-1073741827, 2305842940494218450)),
- Complex(1, 0) / Complex(1073741789, 1073741827))
- assert_equal(Complex(1073741828, 1073741827),
- Complex(1, 0) + Complex(1073741827, 1073741827))
- assert_equal(Complex(-1073741826, -1073741827),
- Complex(1, 0) - Complex(1073741827, 1073741827))
- assert_equal(Complex(1073741827, 1073741827),
- Complex(1, 0) * Complex(1073741827, 1073741827))
- assert_equal(Complex(Rational(1, 2147483654), Rational(-1, 2147483654)),
- Complex(1, 0) / Complex(1073741827, 1073741827))
- assert_equal(Complex(Rational(2147483616, 1073741827), Rational(1073741789, 1073741827)),
- Complex(1, 0) + Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)))
- assert_equal(Complex(Rational(38, 1073741827), Rational(-1073741789, 1073741827)),
- Complex(1, 0) - Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)))
- assert_equal(Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)),
- Complex(1, 0) * Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)))
- assert_equal(Complex(Rational(1073741827, 2147483578), Rational(-1073741827, 2147483578)),
- Complex(1, 0) / Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)))
- assert_equal(Complex(Rational(2147483616, 1073741789), Rational(1073741827, 1073741789)),
- Complex(1, 0) + Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)))
- assert_equal(Complex(Rational(-38, 1073741789), Rational(-1073741827, 1073741789)),
- Complex(1, 0) - Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)))
- assert_equal(Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)),
- Complex(1, 0) * Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)))
- assert_equal(Complex(Rational(1073741789, 2147483654), Rational(-1073741789, 2147483654)),
- Complex(1, 0) / Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)))
- assert_equal(Complex(Rational(2147483616, 1073741827), Rational(1073741827, 1073741789)),
- Complex(1, 0) + Complex(Rational(1073741789, 1073741827), Rational(1073741827, 1073741789)))
- assert_equal(Complex(Rational(38, 1073741827), Rational(-1073741827, 1073741789)),
- Complex(1, 0) - Complex(Rational(1073741789, 1073741827), Rational(1073741827, 1073741789)))
- assert_equal(Complex(Rational(1073741789, 1073741827), Rational(1073741827, 1073741789)),
- Complex(1, 0) * Complex(Rational(1073741789, 1073741827), Rational(1073741827, 1073741789)))
- assert_equal(Complex(Rational(1329227869515035739611240300898290063, 2658455833113515253509575011810600482), Rational(-1329227963598474519442525600436190287, 2658455833113515253509575011810600482)),
- Complex(1, 0) / Complex(Rational(1073741789, 1073741827), Rational(1073741827, 1073741789)))
- assert_equal(Complex(1073741789, 0), +Complex(1073741789, 0))
- assert_equal(Complex(-1073741789, 0), -Complex(1073741789, 0))
- assert_equal(Complex(1073741790, 0),
- Complex(1073741789, 0) + Complex(1, 0))
- assert_equal(Complex(1073741788, 0),
- Complex(1073741789, 0) - Complex(1, 0))
- assert_equal(Complex(1073741789, 0),
- Complex(1073741789, 0) * Complex(1, 0))
- assert_equal(Complex(1073741789, 0),
- Complex(1073741789, 0) / Complex(1, 0))
- assert_equal(Complex(2147483578, 0),
- Complex(1073741789, 0) + Complex(1073741789, 0))
- assert_equal(Complex(0, 0),
- Complex(1073741789, 0) - Complex(1073741789, 0))
- assert_equal(Complex(1152921429444920521, 0),
- Complex(1073741789, 0) * Complex(1073741789, 0))
- assert_equal(Complex(1, 0),
- Complex(1073741789, 0) / Complex(1073741789, 0))
- assert_equal(Complex(2147483616, 0),
- Complex(1073741789, 0) + Complex(1073741827, 0))
- assert_equal(Complex(-38, 0),
- Complex(1073741789, 0) - Complex(1073741827, 0))
- assert_equal(Complex(1152921470247108503, 0),
- Complex(1073741789, 0) * Complex(1073741827, 0))
- assert_equal(Complex(Rational(1073741789, 1073741827), 0),
- Complex(1073741789, 0) / Complex(1073741827, 0))
- assert_equal(Complex(2147483578, 1073741789),
- Complex(1073741789, 0) + Complex(1073741789, 1073741789))
- assert_equal(Complex(0, -1073741789),
- Complex(1073741789, 0) - Complex(1073741789, 1073741789))
- assert_equal(Complex(1152921429444920521, 1152921429444920521),
- Complex(1073741789, 0) * Complex(1073741789, 1073741789))
- assert_equal(Complex(Rational(1, 2), Rational(-1, 2)),
- Complex(1073741789, 0) / Complex(1073741789, 1073741789))
- assert_equal(Complex(2147483578, 1073741827),
- Complex(1073741789, 0) + Complex(1073741789, 1073741827))
- assert_equal(Complex(0, -1073741827),
- Complex(1073741789, 0) - Complex(1073741789, 1073741827))
- assert_equal(Complex(1152921429444920521, 1152921470247108503),
- Complex(1073741789, 0) * Complex(1073741789, 1073741827))
- assert_equal(Complex(Rational(1152921429444920521, 2305842940494218450), Rational(-1152921470247108503, 2305842940494218450)),
- Complex(1073741789, 0) / Complex(1073741789, 1073741827))
- assert_equal(Complex(2147483616, 1073741827),
- Complex(1073741789, 0) + Complex(1073741827, 1073741827))
- assert_equal(Complex(-38, -1073741827),
- Complex(1073741789, 0) - Complex(1073741827, 1073741827))
- assert_equal(Complex(1152921470247108503, 1152921470247108503),
- Complex(1073741789, 0) * Complex(1073741827, 1073741827))
- assert_equal(Complex(Rational(1073741789, 2147483654), Rational(-1073741789, 2147483654)),
- Complex(1073741789, 0) / Complex(1073741827, 1073741827))
- assert_equal(Complex(Rational(1152921471320850292, 1073741827), Rational(1073741789, 1073741827)),
- Complex(1073741789, 0) + Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)))
- assert_equal(Complex(Rational(1152921469173366714, 1073741827), Rational(-1073741789, 1073741827)),
- Complex(1073741789, 0) - Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)))
- assert_equal(Complex(Rational(1152921429444920521, 1073741827), Rational(1152921429444920521, 1073741827)),
- Complex(1073741789, 0) * Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)))
- assert_equal(Complex(Rational(1073741827, 2), Rational(-1073741827, 2)),
- Complex(1073741789, 0) / Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)))
- assert_equal(Complex(Rational(1152921430518662348, 1073741789), Rational(1073741827, 1073741789)),
- Complex(1073741789, 0) + Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)))
- assert_equal(Complex(Rational(1152921428371178694, 1073741789), Rational(-1073741827, 1073741789)),
- Complex(1073741789, 0) - Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)))
- assert_equal(Complex(1073741827, 1073741827),
- Complex(1073741789, 0) * Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)))
- assert_equal(Complex(Rational(1152921429444920521, 2147483654), Rational(-1152921429444920521, 2147483654)),
- Complex(1073741789, 0) / Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)))
- assert_equal(Complex(Rational(1152921471320850292, 1073741827), Rational(1073741827, 1073741789)),
- Complex(1073741789, 0) + Complex(Rational(1073741789, 1073741827), Rational(1073741827, 1073741789)))
- assert_equal(Complex(Rational(1152921469173366714, 1073741827), Rational(-1073741827, 1073741789)),
- Complex(1073741789, 0) - Complex(Rational(1073741789, 1073741827), Rational(1073741827, 1073741789)))
- assert_equal(Complex(Rational(1152921429444920521, 1073741827), 1073741827),
- Complex(1073741789, 0) * Complex(Rational(1073741789, 1073741827), Rational(1073741827, 1073741789)))
- assert_equal(Complex(Rational(1427247510601733037449111325195428279286542707, 2658455833113515253509575011810600482), Rational(-1427247611623052908177132720890654139107803443, 2658455833113515253509575011810600482)),
- Complex(1073741789, 0) / Complex(Rational(1073741789, 1073741827), Rational(1073741827, 1073741789)))
- assert_equal(Complex(1073741827, 0), +Complex(1073741827, 0))
- assert_equal(Complex(-1073741827, 0), -Complex(1073741827, 0))
- assert_equal(Complex(1073741828, 0),
- Complex(1073741827, 0) + Complex(1, 0))
- assert_equal(Complex(1073741826, 0),
- Complex(1073741827, 0) - Complex(1, 0))
- assert_equal(Complex(1073741827, 0),
- Complex(1073741827, 0) * Complex(1, 0))
- assert_equal(Complex(1073741827, 0),
- Complex(1073741827, 0) / Complex(1, 0))
- assert_equal(Complex(2147483616, 0),
- Complex(1073741827, 0) + Complex(1073741789, 0))
- assert_equal(Complex(38, 0),
- Complex(1073741827, 0) - Complex(1073741789, 0))
- assert_equal(Complex(1152921470247108503, 0),
- Complex(1073741827, 0) * Complex(1073741789, 0))
- assert_equal(Complex(Rational(1073741827, 1073741789), 0),
- Complex(1073741827, 0) / Complex(1073741789, 0))
- assert_equal(Complex(2147483654, 0),
- Complex(1073741827, 0) + Complex(1073741827, 0))
- assert_equal(Complex(0, 0),
- Complex(1073741827, 0) - Complex(1073741827, 0))
- assert_equal(Complex(1152921511049297929, 0),
- Complex(1073741827, 0) * Complex(1073741827, 0))
- assert_equal(Complex(1, 0),
- Complex(1073741827, 0) / Complex(1073741827, 0))
- assert_equal(Complex(2147483616, 1073741789),
- Complex(1073741827, 0) + Complex(1073741789, 1073741789))
- assert_equal(Complex(38, -1073741789),
- Complex(1073741827, 0) - Complex(1073741789, 1073741789))
- assert_equal(Complex(1152921470247108503, 1152921470247108503),
- Complex(1073741827, 0) * Complex(1073741789, 1073741789))
- assert_equal(Complex(Rational(1073741827, 2147483578), Rational(-1073741827, 2147483578)),
- Complex(1073741827, 0) / Complex(1073741789, 1073741789))
- assert_equal(Complex(2147483616, 1073741827),
- Complex(1073741827, 0) + Complex(1073741789, 1073741827))
- assert_equal(Complex(38, -1073741827),
- Complex(1073741827, 0) - Complex(1073741789, 1073741827))
- assert_equal(Complex(1152921470247108503, 1152921511049297929),
- Complex(1073741827, 0) * Complex(1073741789, 1073741827))
- assert_equal(Complex(Rational(1152921470247108503, 2305842940494218450), Rational(-1152921511049297929, 2305842940494218450)),
- Complex(1073741827, 0) / Complex(1073741789, 1073741827))
- assert_equal(Complex(2147483654, 1073741827),
- Complex(1073741827, 0) + Complex(1073741827, 1073741827))
- assert_equal(Complex(0, -1073741827),
- Complex(1073741827, 0) - Complex(1073741827, 1073741827))
- assert_equal(Complex(1152921511049297929, 1152921511049297929),
- Complex(1073741827, 0) * Complex(1073741827, 1073741827))
- assert_equal(Complex(Rational(1, 2), Rational(-1, 2)),
- Complex(1073741827, 0) / Complex(1073741827, 1073741827))
- assert_equal(Complex(Rational(1152921512123039718, 1073741827), Rational(1073741789, 1073741827)),
- Complex(1073741827, 0) + Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)))
- assert_equal(Complex(Rational(1152921509975556140, 1073741827), Rational(-1073741789, 1073741827)),
- Complex(1073741827, 0) - Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)))
- assert_equal(Complex(1073741789, 1073741789),
- Complex(1073741827, 0) * Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)))
- assert_equal(Complex(Rational(1152921511049297929, 2147483578), Rational(-1152921511049297929, 2147483578)),
- Complex(1073741827, 0) / Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)))
- assert_equal(Complex(Rational(1152921471320850330, 1073741789), Rational(1073741827, 1073741789)),
- Complex(1073741827, 0) + Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)))
- assert_equal(Complex(Rational(1152921469173366676, 1073741789), Rational(-1073741827, 1073741789)),
- Complex(1073741827, 0) - Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)))
- assert_equal(Complex(Rational(1152921511049297929, 1073741789), Rational(1152921511049297929, 1073741789)),
- Complex(1073741827, 0) * Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)))
- assert_equal(Complex(Rational(1073741789, 2), Rational(-1073741789, 2)),
- Complex(1073741827, 0) / Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)))
- assert_equal(Complex(Rational(1152921512123039718, 1073741827), Rational(1073741827, 1073741789)),
- Complex(1073741827, 0) + Complex(Rational(1073741789, 1073741827), Rational(1073741827, 1073741789)))
- assert_equal(Complex(Rational(1152921509975556140, 1073741827), Rational(-1073741827, 1073741789)),
- Complex(1073741827, 0) - Complex(Rational(1073741789, 1073741827), Rational(1073741827, 1073741789)))
- assert_equal(Complex(1073741789, Rational(1152921511049297929, 1073741789)),
- Complex(1073741827, 0) * Complex(Rational(1073741789, 1073741827), Rational(1073741827, 1073741789)))
- assert_equal(Complex(Rational(1427247561112392079020469430422559713421565101, 2658455833113515253509575011810600482), Rational(-1427247662133715524919164459706626955683034349, 2658455833113515253509575011810600482)),
- Complex(1073741827, 0) / Complex(Rational(1073741789, 1073741827), Rational(1073741827, 1073741789)))
- assert_equal(Complex(1073741789, 1073741789), +Complex(1073741789, 1073741789))
- assert_equal(Complex(-1073741789, -1073741789), -Complex(1073741789, 1073741789))
- assert_equal(Complex(1073741790, 1073741789),
- Complex(1073741789, 1073741789) + Complex(1, 0))
- assert_equal(Complex(1073741788, 1073741789),
- Complex(1073741789, 1073741789) - Complex(1, 0))
- assert_equal(Complex(1073741789, 1073741789),
- Complex(1073741789, 1073741789) * Complex(1, 0))
- assert_equal(Complex(1073741789, 1073741789),
- Complex(1073741789, 1073741789) / Complex(1, 0))
- assert_equal(Complex(2147483578, 1073741789),
- Complex(1073741789, 1073741789) + Complex(1073741789, 0))
- assert_equal(Complex(0, 1073741789),
- Complex(1073741789, 1073741789) - Complex(1073741789, 0))
- assert_equal(Complex(1152921429444920521, 1152921429444920521),
- Complex(1073741789, 1073741789) * Complex(1073741789, 0))
- assert_equal(Complex(1, 1),
- Complex(1073741789, 1073741789) / Complex(1073741789, 0))
- assert_equal(Complex(2147483616, 1073741789),
- Complex(1073741789, 1073741789) + Complex(1073741827, 0))
- assert_equal(Complex(-38, 1073741789),
- Complex(1073741789, 1073741789) - Complex(1073741827, 0))
- assert_equal(Complex(1152921470247108503, 1152921470247108503),
- Complex(1073741789, 1073741789) * Complex(1073741827, 0))
- assert_equal(Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)),
- Complex(1073741789, 1073741789) / Complex(1073741827, 0))
- assert_equal(Complex(2147483578, 2147483578),
- Complex(1073741789, 1073741789) + Complex(1073741789, 1073741789))
- assert_equal(Complex(0, 0),
- Complex(1073741789, 1073741789) - Complex(1073741789, 1073741789))
- assert_equal(Complex(0, 2305842858889841042),
- Complex(1073741789, 1073741789) * Complex(1073741789, 1073741789))
- assert_equal(Complex(1, 0),
- Complex(1073741789, 1073741789) / Complex(1073741789, 1073741789))
- assert_equal(Complex(2147483578, 2147483616),
- Complex(1073741789, 1073741789) + Complex(1073741789, 1073741827))
- assert_equal(Complex(0, -38),
- Complex(1073741789, 1073741789) - Complex(1073741789, 1073741827))
- assert_equal(Complex(-40802187982, 2305842899692029024),
- Complex(1073741789, 1073741789) * Complex(1073741789, 1073741827))
- assert_equal(Complex(Rational(1152921449846014512, 1152921470247109225), Rational(-20401093991, 1152921470247109225)),
- Complex(1073741789, 1073741789) / Complex(1073741789, 1073741827))
- assert_equal(Complex(2147483616, 2147483616),
- Complex(1073741789, 1073741789) + Complex(1073741827, 1073741827))
- assert_equal(Complex(-38, -38),
- Complex(1073741789, 1073741789) - Complex(1073741827, 1073741827))
- assert_equal(Complex(0, 2305842940494217006),
- Complex(1073741789, 1073741789) * Complex(1073741827, 1073741827))
- assert_equal(Complex(Rational(1073741789, 1073741827), 0),
- Complex(1073741789, 1073741789) / Complex(1073741827, 1073741827))
- assert_equal(Complex(Rational(1152921471320850292, 1073741827), Rational(1152921471320850292, 1073741827)),
- Complex(1073741789, 1073741789) + Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)))
- assert_equal(Complex(Rational(1152921469173366714, 1073741827), Rational(1152921469173366714, 1073741827)),
- Complex(1073741789, 1073741789) - Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)))
- assert_equal(Complex(0, Rational(2305842858889841042, 1073741827)),
- Complex(1073741789, 1073741789) * Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)))
- assert_equal(Complex(1073741827, 0),
- Complex(1073741789, 1073741789) / Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)))
- assert_equal(Complex(Rational(1152921430518662348, 1073741789), Rational(1152921430518662348, 1073741789)),
- Complex(1073741789, 1073741789) + Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)))
- assert_equal(Complex(Rational(1152921428371178694, 1073741789), Rational(1152921428371178694, 1073741789)),
- Complex(1073741789, 1073741789) - Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)))
- assert_equal(Complex(0, 2147483654),
- Complex(1073741789, 1073741789) * Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)))
- assert_equal(Complex(Rational(1152921429444920521, 1073741827), 0),
- Complex(1073741789, 1073741789) / Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)))
- assert_equal(Complex(Rational(1152921471320850292, 1073741827), Rational(1152921430518662348, 1073741789)),
- Complex(1073741789, 1073741789) + Complex(Rational(1073741789, 1073741827), Rational(1073741827, 1073741789)))
- assert_equal(Complex(Rational(1152921469173366714, 1073741827), Rational(1152921428371178694, 1073741789)),
- Complex(1073741789, 1073741789) - Complex(Rational(1073741789, 1073741827), Rational(1073741827, 1073741789)))
- assert_equal(Complex(Rational(-81604377408, 1073741827), Rational(2305842940494218450, 1073741827)),
- Complex(1073741789, 1073741789) * Complex(Rational(1073741789, 1073741827), Rational(1073741827, 1073741789)))
- assert_equal(Complex(Rational(1427247561112392972813122023043041209197173075, 1329227916556757626754787505905300241), Rational(-50510659935364010697847612929910630368, 1329227916556757626754787505905300241)),
- Complex(1073741789, 1073741789) / Complex(Rational(1073741789, 1073741827), Rational(1073741827, 1073741789)))
- assert_equal(Complex(1073741789, 1073741827), +Complex(1073741789, 1073741827))
- assert_equal(Complex(-1073741789, -1073741827), -Complex(1073741789, 1073741827))
- assert_equal(Complex(1073741790, 1073741827),
- Complex(1073741789, 1073741827) + Complex(1, 0))
- assert_equal(Complex(1073741788, 1073741827),
- Complex(1073741789, 1073741827) - Complex(1, 0))
- assert_equal(Complex(1073741789, 1073741827),
- Complex(1073741789, 1073741827) * Complex(1, 0))
- assert_equal(Complex(1073741789, 1073741827),
- Complex(1073741789, 1073741827) / Complex(1, 0))
- assert_equal(Complex(2147483578, 1073741827),
- Complex(1073741789, 1073741827) + Complex(1073741789, 0))
- assert_equal(Complex(0, 1073741827),
- Complex(1073741789, 1073741827) - Complex(1073741789, 0))
- assert_equal(Complex(1152921429444920521, 1152921470247108503),
- Complex(1073741789, 1073741827) * Complex(1073741789, 0))
- assert_equal(Complex(1, Rational(1073741827, 1073741789)),
- Complex(1073741789, 1073741827) / Complex(1073741789, 0))
- assert_equal(Complex(2147483616, 1073741827),
- Complex(1073741789, 1073741827) + Complex(1073741827, 0))
- assert_equal(Complex(-38, 1073741827),
- Complex(1073741789, 1073741827) - Complex(1073741827, 0))
- assert_equal(Complex(1152921470247108503, 1152921511049297929),
- Complex(1073741789, 1073741827) * Complex(1073741827, 0))
- assert_equal(Complex(Rational(1073741789, 1073741827), 1),
- Complex(1073741789, 1073741827) / Complex(1073741827, 0))
- assert_equal(Complex(2147483578, 2147483616),
- Complex(1073741789, 1073741827) + Complex(1073741789, 1073741789))
- assert_equal(Complex(0, 38),
- Complex(1073741789, 1073741827) - Complex(1073741789, 1073741789))
- assert_equal(Complex(-40802187982, 2305842899692029024),
- Complex(1073741789, 1073741827) * Complex(1073741789, 1073741789))
- assert_equal(Complex(Rational(1073741808, 1073741789), Rational(19, 1073741789)),
- Complex(1073741789, 1073741827) / Complex(1073741789, 1073741789))
- assert_equal(Complex(2147483578, 2147483654),
- Complex(1073741789, 1073741827) + Complex(1073741789, 1073741827))
- assert_equal(Complex(0, 0),
- Complex(1073741789, 1073741827) - Complex(1073741789, 1073741827))
- assert_equal(Complex(-81604377408, 2305842940494217006),
- Complex(1073741789, 1073741827) * Complex(1073741789, 1073741827))
- assert_equal(Complex(1, 0),
- Complex(1073741789, 1073741827) / Complex(1073741789, 1073741827))
- assert_equal(Complex(2147483616, 2147483654),
- Complex(1073741789, 1073741827) + Complex(1073741827, 1073741827))
- assert_equal(Complex(-38, 0),
- Complex(1073741789, 1073741827) - Complex(1073741827, 1073741827))
- assert_equal(Complex(-40802189426, 2305842981296406432),
- Complex(1073741789, 1073741827) * Complex(1073741827, 1073741827))
- assert_equal(Complex(Rational(1073741808, 1073741827), Rational(19, 1073741827)),
- Complex(1073741789, 1073741827) / Complex(1073741827, 1073741827))
- assert_equal(Complex(Rational(1152921471320850292, 1073741827), Rational(1152921512123039718, 1073741827)),
- Complex(1073741789, 1073741827) + Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)))
- assert_equal(Complex(Rational(1152921469173366714, 1073741827), Rational(1152921509975556140, 1073741827)),
- Complex(1073741789, 1073741827) - Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)))
- assert_equal(Complex(Rational(-40802187982, 1073741827), Rational(2305842899692029024, 1073741827)),
- Complex(1073741789, 1073741827) * Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)))
- assert_equal(Complex(Rational(1152921490648203216, 1073741789), Rational(20401094713, 1073741789)),
- Complex(1073741789, 1073741827) / Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)))
- assert_equal(Complex(Rational(1152921430518662348, 1073741789), Rational(1152921471320850330, 1073741789)),
- Complex(1073741789, 1073741827) + Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)))
- assert_equal(Complex(Rational(1152921428371178694, 1073741789), Rational(1152921469173366676, 1073741789)),
- Complex(1073741789, 1073741827) - Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)))
- assert_equal(Complex(Rational(-40802189426, 1073741789), Rational(2305842981296406432, 1073741789)),
- Complex(1073741789, 1073741827) * Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)))
- assert_equal(Complex(Rational(1152921449846014512, 1073741827), Rational(20401093991, 1073741827)),
- Complex(1073741789, 1073741827) / Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)))
- assert_equal(Complex(Rational(1152921471320850292, 1073741827), Rational(1152921471320850330, 1073741789)),
- Complex(1073741789, 1073741827) + Complex(Rational(1073741789, 1073741827), Rational(1073741827, 1073741789)))
- assert_equal(Complex(Rational(1152921469173366714, 1073741827), Rational(1152921469173366676, 1073741789)),
- Complex(1073741789, 1073741827) - Complex(Rational(1073741789, 1073741827), Rational(1073741827, 1073741789)))
- assert_equal(Complex(Rational(-131433047608170424214, 1152921470247108503), 2147483616),
- Complex(1073741789, 1073741827) * Complex(Rational(1073741789, 1073741827), Rational(1073741827, 1073741789)))
- assert_equal(Complex(Rational(1427247586367724281184137892451027617484788528, 1329227916556757626754787505905300241), Rational(-25255330414578331645234047212843119171, 1329227916556757626754787505905300241)),
- Complex(1073741789, 1073741827) / Complex(Rational(1073741789, 1073741827), Rational(1073741827, 1073741789)))
- assert_equal(Complex(1073741827, 1073741827), +Complex(1073741827, 1073741827))
- assert_equal(Complex(-1073741827, -1073741827), -Complex(1073741827, 1073741827))
- assert_equal(Complex(1073741828, 1073741827),
- Complex(1073741827, 1073741827) + Complex(1, 0))
- assert_equal(Complex(1073741826, 1073741827),
- Complex(1073741827, 1073741827) - Complex(1, 0))
- assert_equal(Complex(1073741827, 1073741827),
- Complex(1073741827, 1073741827) * Complex(1, 0))
- assert_equal(Complex(1073741827, 1073741827),
- Complex(1073741827, 1073741827) / Complex(1, 0))
- assert_equal(Complex(2147483616, 1073741827),
- Complex(1073741827, 1073741827) + Complex(1073741789, 0))
- assert_equal(Complex(38, 1073741827),
- Complex(1073741827, 1073741827) - Complex(1073741789, 0))
- assert_equal(Complex(1152921470247108503, 1152921470247108503),
- Complex(1073741827, 1073741827) * Complex(1073741789, 0))
- assert_equal(Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)),
- Complex(1073741827, 1073741827) / Complex(1073741789, 0))
- assert_equal(Complex(2147483654, 1073741827),
- Complex(1073741827, 1073741827) + Complex(1073741827, 0))
- assert_equal(Complex(0, 1073741827),
- Complex(1073741827, 1073741827) - Complex(1073741827, 0))
- assert_equal(Complex(1152921511049297929, 1152921511049297929),
- Complex(1073741827, 1073741827) * Complex(1073741827, 0))
- assert_equal(Complex(1, 1),
- Complex(1073741827, 1073741827) / Complex(1073741827, 0))
- assert_equal(Complex(2147483616, 2147483616),
- Complex(1073741827, 1073741827) + Complex(1073741789, 1073741789))
- assert_equal(Complex(38, 38),
- Complex(1073741827, 1073741827) - Complex(1073741789, 1073741789))
- assert_equal(Complex(0, 2305842940494217006),
- Complex(1073741827, 1073741827) * Complex(1073741789, 1073741789))
- assert_equal(Complex(Rational(1073741827, 1073741789), 0),
- Complex(1073741827, 1073741827) / Complex(1073741789, 1073741789))
- assert_equal(Complex(2147483616, 2147483654),
- Complex(1073741827, 1073741827) + Complex(1073741789, 1073741827))
- assert_equal(Complex(38, 0),
- Complex(1073741827, 1073741827) - Complex(1073741789, 1073741827))
- assert_equal(Complex(-40802189426, 2305842981296406432),
- Complex(1073741827, 1073741827) * Complex(1073741789, 1073741827))
- assert_equal(Complex(Rational(1152921490648203216, 1152921470247109225), Rational(-20401094713, 1152921470247109225)),
- Complex(1073741827, 1073741827) / Complex(1073741789, 1073741827))
- assert_equal(Complex(2147483654, 2147483654),
- Complex(1073741827, 1073741827) + Complex(1073741827, 1073741827))
- assert_equal(Complex(0, 0),
- Complex(1073741827, 1073741827) - Complex(1073741827, 1073741827))
- assert_equal(Complex(0, 2305843022098595858),
- Complex(1073741827, 1073741827) * Complex(1073741827, 1073741827))
- assert_equal(Complex(1, 0),
- Complex(1073741827, 1073741827) / Complex(1073741827, 1073741827))
- assert_equal(Complex(Rational(1152921512123039718, 1073741827), Rational(1152921512123039718, 1073741827)),
- Complex(1073741827, 1073741827) + Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)))
- assert_equal(Complex(Rational(1152921509975556140, 1073741827), Rational(1152921509975556140, 1073741827)),
- Complex(1073741827, 1073741827) - Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)))
- assert_equal(Complex(0, 2147483578),
- Complex(1073741827, 1073741827) * Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)))
- assert_equal(Complex(Rational(1152921511049297929, 1073741789), 0),
- Complex(1073741827, 1073741827) / Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)))
- assert_equal(Complex(Rational(1152921471320850330, 1073741789), Rational(1152921471320850330, 1073741789)),
- Complex(1073741827, 1073741827) + Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)))
- assert_equal(Complex(Rational(1152921469173366676, 1073741789), Rational(1152921469173366676, 1073741789)),
- Complex(1073741827, 1073741827) - Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)))
- assert_equal(Complex(0, Rational(2305843022098595858, 1073741789)),
- Complex(1073741827, 1073741827) * Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)))
- assert_equal(Complex(1073741789, 0),
- Complex(1073741827, 1073741827) / Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)))
- assert_equal(Complex(Rational(1152921512123039718, 1073741827), Rational(1152921471320850330, 1073741789)),
- Complex(1073741827, 1073741827) + Complex(Rational(1073741789, 1073741827), Rational(1073741827, 1073741789)))
- assert_equal(Complex(Rational(1152921509975556140, 1073741827), Rational(1152921469173366676, 1073741789)),
- Complex(1073741827, 1073741827) - Complex(Rational(1073741789, 1073741827), Rational(1073741827, 1073741789)))
- assert_equal(Complex(Rational(-81604377408, 1073741789), Rational(2305842940494218450, 1073741789)),
- Complex(1073741827, 1073741827) * Complex(Rational(1073741789, 1073741827), Rational(1073741827, 1073741789)))
- assert_equal(Complex(Rational(1427247611623053801969816945064593334552299725, 1329227916556757626754787505905300241), Rational(-50510661722949347514642033621130734624, 1329227916556757626754787505905300241)),
- Complex(1073741827, 1073741827) / Complex(Rational(1073741789, 1073741827), Rational(1073741827, 1073741789)))
- assert_equal(Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)), +Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)))
- assert_equal(Complex(Rational(-1073741789, 1073741827), Rational(-1073741789, 1073741827)), -Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)))
- assert_equal(Complex(Rational(2147483616, 1073741827), Rational(1073741789, 1073741827)),
- Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)) + Complex(1, 0))
- assert_equal(Complex(Rational(-38, 1073741827), Rational(1073741789, 1073741827)),
- Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)) - Complex(1, 0))
- assert_equal(Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)),
- Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)) * Complex(1, 0))
- assert_equal(Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)),
- Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)) / Complex(1, 0))
- assert_equal(Complex(Rational(1152921471320850292, 1073741827), Rational(1073741789, 1073741827)),
- Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)) + Complex(1073741789, 0))
- assert_equal(Complex(Rational(-1152921469173366714, 1073741827), Rational(1073741789, 1073741827)),
- Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)) - Complex(1073741789, 0))
- assert_equal(Complex(Rational(1152921429444920521, 1073741827), Rational(1152921429444920521, 1073741827)),
- Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)) * Complex(1073741789, 0))
- assert_equal(Complex(Rational(1, 1073741827), Rational(1, 1073741827)),
- Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)) / Complex(1073741789, 0))
- assert_equal(Complex(Rational(1152921512123039718, 1073741827), Rational(1073741789, 1073741827)),
- Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)) + Complex(1073741827, 0))
- assert_equal(Complex(Rational(-1152921509975556140, 1073741827), Rational(1073741789, 1073741827)),
- Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)) - Complex(1073741827, 0))
- assert_equal(Complex(1073741789, 1073741789),
- Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)) * Complex(1073741827, 0))
- assert_equal(Complex(Rational(1073741789, 1152921511049297929), Rational(1073741789, 1152921511049297929)),
- Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)) / Complex(1073741827, 0))
- assert_equal(Complex(Rational(1152921471320850292, 1073741827), Rational(1152921471320850292, 1073741827)),
- Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)) + Complex(1073741789, 1073741789))
- assert_equal(Complex(Rational(-1152921469173366714, 1073741827), Rational(-1152921469173366714, 1073741827)),
- Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)) - Complex(1073741789, 1073741789))
- assert_equal(Complex(0, Rational(2305842858889841042, 1073741827)),
- Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)) * Complex(1073741789, 1073741789))
- assert_equal(Complex(Rational(1, 1073741827), 0),
- Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)) / Complex(1073741789, 1073741789))
- assert_equal(Complex(Rational(1152921471320850292, 1073741827), Rational(1152921512123039718, 1073741827)),
- Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)) + Complex(1073741789, 1073741827))
- assert_equal(Complex(Rational(-1152921469173366714, 1073741827), Rational(-1152921509975556140, 1073741827)),
- Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)) - Complex(1073741789, 1073741827))
- assert_equal(Complex(Rational(-40802187982, 1073741827), Rational(2305842899692029024, 1073741827)),
- Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)) * Complex(1073741789, 1073741827))
- assert_equal(Complex(Rational(1152921449846014512, 1237940005850657200720054075), Rational(-20401093991, 1237940005850657200720054075)),
- Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)) / Complex(1073741789, 1073741827))
- assert_equal(Complex(Rational(1152921512123039718, 1073741827), Rational(1152921512123039718, 1073741827)),
- Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)) + Complex(1073741827, 1073741827))
- assert_equal(Complex(Rational(-1152921509975556140, 1073741827), Rational(-1152921509975556140, 1073741827)),
- Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)) - Complex(1073741827, 1073741827))
- assert_equal(Complex(0, 2147483578),
- Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)) * Complex(1073741827, 1073741827))
- assert_equal(Complex(Rational(1073741789, 1152921511049297929), 0),
- Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)) / Complex(1073741827, 1073741827))
- assert_equal(Complex(Rational(2147483578, 1073741827), Rational(2147483578, 1073741827)),
- Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)) + Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)))
- assert_equal(Complex(0, 0),
- Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)) - Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)))
- assert_equal(Complex(0, Rational(2305842858889841042, 1152921511049297929)),
- Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)) * Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)))
- assert_equal(Complex(1, 0),
- Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)) / Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)))
- assert_equal(Complex(Rational(2305842940494218450, 1152921470247108503), Rational(2305842940494218450, 1152921470247108503)),
- Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)) + Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)))
- assert_equal(Complex(Rational(-81604377408, 1152921470247108503), Rational(-81604377408, 1152921470247108503)),
- Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)) - Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)))
- assert_equal(Complex(0, 2),
- Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)) * Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)))
- assert_equal(Complex(Rational(1152921429444920521, 1152921511049297929), 0),
- Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)) / Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)))
- assert_equal(Complex(Rational(2147483578, 1073741827), Rational(2305842940494218450, 1152921470247108503)),
- Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)) + Complex(Rational(1073741789, 1073741827), Rational(1073741827, 1073741789)))
- assert_equal(Complex(0, Rational(-81604377408, 1152921470247108503)),
- Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)) - Complex(Rational(1073741789, 1073741827), Rational(1073741827, 1073741789)))
- assert_equal(Complex(Rational(-81604377408, 1152921511049297929), Rational(2305842940494218450, 1152921511049297929)),
- Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)) * Complex(Rational(1073741789, 1073741827), Rational(1073741827, 1073741789)))
- assert_equal(Complex(Rational(1329227869515036572020512360130906225, 1329227916556757626754787505905300241), Rational(-47041717725097069072123994784, 1329227916556757626754787505905300241)),
- Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)) / Complex(Rational(1073741789, 1073741827), Rational(1073741827, 1073741789)))
- assert_equal(Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)), +Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)))
- assert_equal(Complex(Rational(-1073741827, 1073741789), Rational(-1073741827, 1073741789)), -Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)))
- assert_equal(Complex(Rational(2147483616, 1073741789), Rational(1073741827, 1073741789)),
- Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)) + Complex(1, 0))
- assert_equal(Complex(Rational(38, 1073741789), Rational(1073741827, 1073741789)),
- Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)) - Complex(1, 0))
- assert_equal(Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)),
- Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)) * Complex(1, 0))
- assert_equal(Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)),
- Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)) / Complex(1, 0))
- assert_equal(Complex(Rational(1152921430518662348, 1073741789), Rational(1073741827, 1073741789)),
- Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)) + Complex(1073741789, 0))
- assert_equal(Complex(Rational(-1152921428371178694, 1073741789), Rational(1073741827, 1073741789)),
- Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)) - Complex(1073741789, 0))
- assert_equal(Complex(1073741827, 1073741827),
- Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)) * Complex(1073741789, 0))
- assert_equal(Complex(Rational(1073741827, 1152921429444920521), Rational(1073741827, 1152921429444920521)),
- Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)) / Complex(1073741789, 0))
- assert_equal(Complex(Rational(1152921471320850330, 1073741789), Rational(1073741827, 1073741789)),
- Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)) + Complex(1073741827, 0))
- assert_equal(Complex(Rational(-1152921469173366676, 1073741789), Rational(1073741827, 1073741789)),
- Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)) - Complex(1073741827, 0))
- assert_equal(Complex(Rational(1152921511049297929, 1073741789), Rational(1152921511049297929, 1073741789)),
- Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)) * Complex(1073741827, 0))
- assert_equal(Complex(Rational(1, 1073741789), Rational(1, 1073741789)),
- Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)) / Complex(1073741827, 0))
- assert_equal(Complex(Rational(1152921430518662348, 1073741789), Rational(1152921430518662348, 1073741789)),
- Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)) + Complex(1073741789, 1073741789))
- assert_equal(Complex(Rational(-1152921428371178694, 1073741789), Rational(-1152921428371178694, 1073741789)),
- Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)) - Complex(1073741789, 1073741789))
- assert_equal(Complex(0, 2147483654),
- Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)) * Complex(1073741789, 1073741789))
- assert_equal(Complex(Rational(1073741827, 1152921429444920521), 0),
- Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)) / Complex(1073741789, 1073741789))
- assert_equal(Complex(Rational(1152921430518662348, 1073741789), Rational(1152921471320850330, 1073741789)),
- Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)) + Complex(1073741789, 1073741827))
- assert_equal(Complex(Rational(-1152921428371178694, 1073741789), Rational(-1152921469173366676, 1073741789)),
- Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)) - Complex(1073741789, 1073741827))
- assert_equal(Complex(Rational(-40802189426, 1073741789), Rational(2305842981296406432, 1073741789)),
- Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)) * Complex(1073741789, 1073741827))
- assert_equal(Complex(Rational(1152921490648203216, 1237939962039641331329903525), Rational(-20401094713, 1237939962039641331329903525)),
- Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)) / Complex(1073741789, 1073741827))
- assert_equal(Complex(Rational(1152921471320850330, 1073741789), Rational(1152921471320850330, 1073741789)),
- Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)) + Complex(1073741827, 1073741827))
- assert_equal(Complex(Rational(-1152921469173366676, 1073741789), Rational(-1152921469173366676, 1073741789)),
- Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)) - Complex(1073741827, 1073741827))
- assert_equal(Complex(0, Rational(2305843022098595858, 1073741789)),
- Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)) * Complex(1073741827, 1073741827))
- assert_equal(Complex(Rational(1, 1073741789), 0),
- Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)) / Complex(1073741827, 1073741827))
- assert_equal(Complex(Rational(2305842940494218450, 1152921470247108503), Rational(2305842940494218450, 1152921470247108503)),
- Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)) + Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)))
- assert_equal(Complex(Rational(81604377408, 1152921470247108503), Rational(81604377408, 1152921470247108503)),
- Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)) - Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)))
- assert_equal(Complex(0, 2),
- Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)) * Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)))
- assert_equal(Complex(Rational(1152921511049297929, 1152921429444920521), 0),
- Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)) / Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)))
- assert_equal(Complex(Rational(2147483654, 1073741789), Rational(2147483654, 1073741789)),
- Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)) + Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)))
- assert_equal(Complex(0, 0),
- Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)) - Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)))
- assert_equal(Complex(0, Rational(2305843022098595858, 1152921429444920521)),
- Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)) * Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)))
- assert_equal(Complex(1, 0),
- Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)) / Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)))
- assert_equal(Complex(Rational(2305842940494218450, 1152921470247108503), Rational(2147483654, 1073741789)),
- Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)) + Complex(Rational(1073741789, 1073741827), Rational(1073741827, 1073741789)))
- assert_equal(Complex(Rational(81604377408, 1152921470247108503), 0),
- Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)) - Complex(Rational(1073741789, 1073741827), Rational(1073741827, 1073741789)))
- assert_equal(Complex(Rational(-81604377408, 1152921429444920521), Rational(2305842940494218450, 1152921429444920521)),
- Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)) * Complex(Rational(1073741789, 1073741827), Rational(1073741827, 1073741789)))
- assert_equal(Complex(Rational(1329227963598475351851856578029295025, 1329227916556757626754787505905300241), Rational(-47041721054734275145774394016, 1329227916556757626754787505905300241)),
- Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)) / Complex(Rational(1073741789, 1073741827), Rational(1073741827, 1073741789)))
- assert_equal(Complex(Rational(1073741789, 1073741827), Rational(1073741827, 1073741789)), +Complex(Rational(1073741789, 1073741827), Rational(1073741827, 1073741789)))
- assert_equal(Complex(Rational(-1073741789, 1073741827), Rational(-1073741827, 1073741789)), -Complex(Rational(1073741789, 1073741827), Rational(1073741827, 1073741789)))
- assert_equal(Complex(Rational(2147483616, 1073741827), Rational(1073741827, 1073741789)),
- Complex(Rational(1073741789, 1073741827), Rational(1073741827, 1073741789)) + Complex(1, 0))
- assert_equal(Complex(Rational(-38, 1073741827), Rational(1073741827, 1073741789)),
- Complex(Rational(1073741789, 1073741827), Rational(1073741827, 1073741789)) - Complex(1, 0))
- assert_equal(Complex(Rational(1073741789, 1073741827), Rational(1073741827, 1073741789)),
- Complex(Rational(1073741789, 1073741827), Rational(1073741827, 1073741789)) * Complex(1, 0))
- assert_equal(Complex(Rational(1073741789, 1073741827), Rational(1073741827, 1073741789)),
- Complex(Rational(1073741789, 1073741827), Rational(1073741827, 1073741789)) / Complex(1, 0))
- assert_equal(Complex(Rational(1152921471320850292, 1073741827), Rational(1073741827, 1073741789)),
- Complex(Rational(1073741789, 1073741827), Rational(1073741827, 1073741789)) + Complex(1073741789, 0))
- assert_equal(Complex(Rational(-1152921469173366714, 1073741827), Rational(1073741827, 1073741789)),
- Complex(Rational(1073741789, 1073741827), Rational(1073741827, 1073741789)) - Complex(1073741789, 0))
- assert_equal(Complex(Rational(1152921429444920521, 1073741827), 1073741827),
- Complex(Rational(1073741789, 1073741827), Rational(1073741827, 1073741789)) * Complex(1073741789, 0))
- assert_equal(Complex(Rational(1, 1073741827), Rational(1073741827, 1152921429444920521)),
- Complex(Rational(1073741789, 1073741827), Rational(1073741827, 1073741789)) / Complex(1073741789, 0))
- assert_equal(Complex(Rational(1152921512123039718, 1073741827), Rational(1073741827, 1073741789)),
- Complex(Rational(1073741789, 1073741827), Rational(1073741827, 1073741789)) + Complex(1073741827, 0))
- assert_equal(Complex(Rational(-1152921509975556140, 1073741827), Rational(1073741827, 1073741789)),
- Complex(Rational(1073741789, 1073741827), Rational(1073741827, 1073741789)) - Complex(1073741827, 0))
- assert_equal(Complex(1073741789, Rational(1152921511049297929, 1073741789)),
- Complex(Rational(1073741789, 1073741827), Rational(1073741827, 1073741789)) * Complex(1073741827, 0))
- assert_equal(Complex(Rational(1073741789, 1152921511049297929), Rational(1, 1073741789)),
- Complex(Rational(1073741789, 1073741827), Rational(1073741827, 1073741789)) / Complex(1073741827, 0))
- assert_equal(Complex(Rational(1152921471320850292, 1073741827), Rational(1152921430518662348, 1073741789)),
- Complex(Rational(1073741789, 1073741827), Rational(1073741827, 1073741789)) + Complex(1073741789, 1073741789))
- assert_equal(Complex(Rational(-1152921469173366714, 1073741827), Rational(-1152921428371178694, 1073741789)),
- Complex(Rational(1073741789, 1073741827), Rational(1073741827, 1073741789)) - Complex(1073741789, 1073741789))
- assert_equal(Complex(Rational(-81604377408, 1073741827), Rational(2305842940494218450, 1073741827)),
- Complex(Rational(1073741789, 1073741827), Rational(1073741827, 1073741789)) * Complex(1073741789, 1073741789))
- assert_equal(Complex(Rational(1152921470247109225, 1237939962039640556088331867), Rational(40802188704, 1237939962039640556088331867)),
- Complex(Rational(1073741789, 1073741827), Rational(1073741827, 1073741789)) / Complex(1073741789, 1073741789))
- assert_equal(Complex(Rational(1152921471320850292, 1073741827), Rational(1152921471320850330, 1073741789)),
- Complex(Rational(1073741789, 1073741827), Rational(1073741827, 1073741789)) + Complex(1073741789, 1073741827))
- assert_equal(Complex(Rational(-1152921469173366714, 1073741827), Rational(-1152921469173366676, 1073741789)),
- Complex(Rational(1073741789, 1073741827), Rational(1073741827, 1073741789)) - Complex(1073741789, 1073741827))
- assert_equal(Complex(Rational(-131433047608170424214, 1152921470247108503), 2147483616),
- Complex(Rational(1073741789, 1073741827), Rational(1073741827, 1073741789)) * Complex(1073741789, 1073741827))
- assert_equal(Complex(Rational(1237939983945150041266564176, 1329227916556755129526882950667240175), Rational(19, 1152921470247109225)),
- Complex(Rational(1073741789, 1073741827), Rational(1073741827, 1073741789)) / Complex(1073741789, 1073741827))
- assert_equal(Complex(Rational(1152921512123039718, 1073741827), Rational(1152921471320850330, 1073741789)),
- Complex(Rational(1073741789, 1073741827), Rational(1073741827, 1073741789)) + Complex(1073741827, 1073741827))
- assert_equal(Complex(Rational(-1152921509975556140, 1073741827), Rational(-1152921469173366676, 1073741789)),
- Complex(Rational(1073741789, 1073741827), Rational(1073741827, 1073741789)) - Complex(1073741827, 1073741827))
- assert_equal(Complex(Rational(-81604377408, 1073741789), Rational(2305842940494218450, 1073741789)),
- Complex(Rational(1073741789, 1073741827), Rational(1073741827, 1073741789)) * Complex(1073741827, 1073741827))
- assert_equal(Complex(Rational(1152921470247109225, 1237940005850656425478454981), Rational(40802188704, 1237940005850656425478454981)),
- Complex(Rational(1073741789, 1073741827), Rational(1073741827, 1073741789)) / Complex(1073741827, 1073741827))
- assert_equal(Complex(Rational(2147483578, 1073741827), Rational(2305842940494218450, 1152921470247108503)),
- Complex(Rational(1073741789, 1073741827), Rational(1073741827, 1073741789)) + Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)))
- assert_equal(Complex(0, Rational(81604377408, 1152921470247108503)),
- Complex(Rational(1073741789, 1073741827), Rational(1073741827, 1073741789)) - Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)))
- assert_equal(Complex(Rational(-81604377408, 1152921511049297929), Rational(2305842940494218450, 1152921511049297929)),
- Complex(Rational(1073741789, 1073741827), Rational(1073741827, 1073741789)) * Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)))
- assert_equal(Complex(Rational(1152921470247109225, 1152921429444920521), Rational(40802188704, 1152921429444920521)),
- Complex(Rational(1073741789, 1073741827), Rational(1073741827, 1073741789)) / Complex(Rational(1073741789, 1073741827), Rational(1073741789, 1073741827)))
- assert_equal(Complex(Rational(2305842940494218450, 1152921470247108503), Rational(2147483654, 1073741789)),
- Complex(Rational(1073741789, 1073741827), Rational(1073741827, 1073741789)) + Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)))
- assert_equal(Complex(Rational(-81604377408, 1152921470247108503), 0),
- Complex(Rational(1073741789, 1073741827), Rational(1073741827, 1073741789)) - Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)))
- assert_equal(Complex(Rational(-81604377408, 1152921429444920521), Rational(2305842940494218450, 1152921429444920521)),
- Complex(Rational(1073741789, 1073741827), Rational(1073741827, 1073741789)) * Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)))
- assert_equal(Complex(Rational(1152921470247109225, 1152921511049297929), Rational(40802188704, 1152921511049297929)),
- Complex(Rational(1073741789, 1073741827), Rational(1073741827, 1073741789)) / Complex(Rational(1073741827, 1073741789), Rational(1073741827, 1073741789)))
- assert_equal(Complex(Rational(2147483578, 1073741827), Rational(2147483654, 1073741789)),
- Complex(Rational(1073741789, 1073741827), Rational(1073741827, 1073741789)) + Complex(Rational(1073741789, 1073741827), Rational(1073741827, 1073741789)))
- assert_equal(Complex(0, 0),
- Complex(Rational(1073741789, 1073741827), Rational(1073741827, 1073741789)) - Complex(Rational(1073741789, 1073741827), Rational(1073741827, 1073741789)))
- assert_equal(Complex(Rational(-188166877559662688435796777600, 1329227916556754297117581432254901009), 2),
- Complex(Rational(1073741789, 1073741827), Rational(1073741827, 1073741789)) * Complex(Rational(1073741789, 1073741827), Rational(1073741827, 1073741789)))
- assert_equal(Complex(1, 0),
- Complex(Rational(1073741789, 1073741827), Rational(1073741827, 1073741789)) / Complex(Rational(1073741789, 1073741827), Rational(1073741827, 1073741789)))
- end
-
- def test_kumi2
- assert_equal('0.0+0.0i', (+Complex(+0.0, +0.0)).to_s)
- assert_equal('-0.0-0.0i', (-Complex(+0.0, +0.0)).to_s)
- assert_equal('0.0+0.0i', (Complex(+0.0, +0.0) + Complex(+0.0, +0.0)).to_s)
- assert_equal('0.0+0.0i', (Complex(+0.0, +0.0) - Complex(+0.0, +0.0)).to_s)
- assert_equal('0.0+0.0i', (Complex(+0.0, +0.0) * Complex(+0.0, +0.0)).to_s)
- assert_equal('0.0+0.0i', (Complex(+0.0, +0.0) + Complex(-0.0, +0.0)).to_s)
- assert_equal('0.0+0.0i', (Complex(+0.0, +0.0) - Complex(-0.0, +0.0)).to_s)
- assert_equal('-0.0+0.0i', (Complex(+0.0, +0.0) * Complex(-0.0, +0.0)).to_s)
- assert_equal('0.0+0.0i', (Complex(+0.0, +0.0) + Complex(+0.0, -0.0)).to_s)
- assert_equal('0.0+0.0i', (Complex(+0.0, +0.0) - Complex(+0.0, -0.0)).to_s)
- assert_equal('0.0+0.0i', (Complex(+0.0, +0.0) * Complex(+0.0, -0.0)).to_s)
- assert_equal('0.0+0.0i', (Complex(+0.0, +0.0) + Complex(-0.0, -0.0)).to_s)
- assert_equal('0.0+0.0i', (Complex(+0.0, +0.0) - Complex(-0.0, -0.0)).to_s)
- assert_equal('0.0-0.0i', (Complex(+0.0, +0.0) * Complex(-0.0, -0.0)).to_s)
- assert_equal('-0.0+0.0i', (+Complex(-0.0, +0.0)).to_s)
- assert_equal('0.0-0.0i', (-Complex(-0.0, +0.0)).to_s)
- assert_equal('0.0+0.0i', (Complex(-0.0, +0.0) + Complex(+0.0, +0.0)).to_s)
- assert_equal('-0.0+0.0i', (Complex(-0.0, +0.0) - Complex(+0.0, +0.0)).to_s)
- assert_equal('-0.0+0.0i', (Complex(-0.0, +0.0) * Complex(+0.0, +0.0)).to_s)
- assert_equal('-0.0+0.0i', (Complex(-0.0, +0.0) + Complex(-0.0, +0.0)).to_s)
- assert_equal('0.0+0.0i', (Complex(-0.0, +0.0) - Complex(-0.0, +0.0)).to_s)
- assert_equal('0.0-0.0i', (Complex(-0.0, +0.0) * Complex(-0.0, +0.0)).to_s)
- assert_equal('0.0+0.0i', (Complex(-0.0, +0.0) + Complex(+0.0, -0.0)).to_s)
- assert_equal('-0.0+0.0i', (Complex(-0.0, +0.0) - Complex(+0.0, -0.0)).to_s)
- assert_equal('0.0+0.0i', (Complex(-0.0, +0.0) * Complex(+0.0, -0.0)).to_s)
- assert_equal('-0.0+0.0i', (Complex(-0.0, +0.0) + Complex(-0.0, -0.0)).to_s)
- assert_equal('0.0+0.0i', (Complex(-0.0, +0.0) - Complex(-0.0, -0.0)).to_s)
- assert_equal('0.0+0.0i', (Complex(-0.0, +0.0) * Complex(-0.0, -0.0)).to_s)
- assert_equal('0.0-0.0i', (+Complex(+0.0, -0.0)).to_s)
- assert_equal('-0.0+0.0i', (-Complex(+0.0, -0.0)).to_s)
- assert_equal('0.0+0.0i', (Complex(+0.0, -0.0) + Complex(+0.0, +0.0)).to_s)
- assert_equal('0.0-0.0i', (Complex(+0.0, -0.0) - Complex(+0.0, +0.0)).to_s)
- assert_equal('0.0+0.0i', (Complex(+0.0, -0.0) * Complex(+0.0, +0.0)).to_s)
- assert_equal('0.0+0.0i', (Complex(+0.0, -0.0) + Complex(-0.0, +0.0)).to_s)
- assert_equal('0.0-0.0i', (Complex(+0.0, -0.0) - Complex(-0.0, +0.0)).to_s)
- assert_equal('0.0+0.0i', (Complex(+0.0, -0.0) * Complex(-0.0, +0.0)).to_s)
- assert_equal('0.0-0.0i', (Complex(+0.0, -0.0) + Complex(+0.0, -0.0)).to_s)
- assert_equal('0.0+0.0i', (Complex(+0.0, -0.0) - Complex(+0.0, -0.0)).to_s)
- assert_equal('0.0-0.0i', (Complex(+0.0, -0.0) * Complex(+0.0, -0.0)).to_s)
- assert_equal('0.0-0.0i', (Complex(+0.0, -0.0) + Complex(-0.0, -0.0)).to_s)
- assert_equal('0.0+0.0i', (Complex(+0.0, -0.0) - Complex(-0.0, -0.0)).to_s)
- assert_equal('-0.0+0.0i', (Complex(+0.0, -0.0) * Complex(-0.0, -0.0)).to_s)
- assert_equal('-0.0-0.0i', (+Complex(-0.0, -0.0)).to_s)
- assert_equal('0.0+0.0i', (-Complex(-0.0, -0.0)).to_s)
- assert_equal('0.0+0.0i', (Complex(-0.0, -0.0) + Complex(+0.0, +0.0)).to_s)
- assert_equal('-0.0-0.0i', (Complex(-0.0, -0.0) - Complex(+0.0, +0.0)).to_s)
- assert_equal('0.0-0.0i', (Complex(-0.0, -0.0) * Complex(+0.0, +0.0)).to_s)
- assert_equal('-0.0+0.0i', (Complex(-0.0, -0.0) + Complex(-0.0, +0.0)).to_s)
- assert_equal('0.0-0.0i', (Complex(-0.0, -0.0) - Complex(-0.0, +0.0)).to_s)
- assert_equal('0.0+0.0i', (Complex(-0.0, -0.0) * Complex(-0.0, +0.0)).to_s)
- assert_equal('0.0-0.0i', (Complex(-0.0, -0.0) + Complex(+0.0, -0.0)).to_s)
- assert_equal('-0.0+0.0i', (Complex(-0.0, -0.0) - Complex(+0.0, -0.0)).to_s)
- assert_equal('-0.0+0.0i', (Complex(-0.0, -0.0) * Complex(+0.0, -0.0)).to_s)
- assert_equal('-0.0-0.0i', (Complex(-0.0, -0.0) + Complex(-0.0, -0.0)).to_s)
- assert_equal('0.0+0.0i', (Complex(-0.0, -0.0) - Complex(-0.0, -0.0)).to_s)
- assert_equal('0.0+0.0i', (Complex(-0.0, -0.0) * Complex(-0.0, -0.0)).to_s)
- end
-
-end
diff --git a/test/ruby/test_complexrational.rb b/test/ruby/test_complexrational.rb
deleted file mode 100644
index 47c535fca0..0000000000
--- a/test/ruby/test_complexrational.rb
+++ /dev/null
@@ -1,407 +0,0 @@
-require 'test/unit'
-
-class ComplexRational_Test < Test::Unit::TestCase
-
- def test_rat_srat
- return unless defined?(Rational)
-
- c = SimpleRat(1,3)
- cc = Rational(3,2)
-
- assert_kind_of(Numeric, c)
- assert_kind_of(Numeric, cc)
-
- assert_instance_of(SimpleRat, c)
- assert_instance_of(Rational, cc)
-
- assert_equal(SimpleRat(1,3), +c)
- assert_equal(SimpleRat(-1,3), -c)
-
- assert_equal(SimpleRat(7,3), c + 2)
- assert_equal(SimpleRat(-5,3), c - 2)
- assert_equal(SimpleRat(2,3), c * 2)
- assert_equal(SimpleRat(1,6), c / 2)
- assert_equal(SimpleRat(1,9), c ** 2)
- assert_equal(-1, c <=> 2)
-
- assert_equal(SimpleRat(7,3), 2 + c)
- assert_equal(SimpleRat(5,3), 2 - c)
- assert_equal(SimpleRat(2,3), 2 * c)
- assert_equal(SimpleRat(6,1), 2 / c)
- assert_in_delta(1.2599, 2 ** c, 0.001)
- assert_equal(1, 2 <=> c)
-
- assert_equal(SimpleRat(11,6), c + cc)
- assert_equal(SimpleRat(-7,6), c - cc)
- assert_equal(SimpleRat(1,2), c * cc)
- assert_equal(SimpleRat(2,9), c / cc)
- assert_in_delta(0.1924, c ** cc, 0.001)
- assert_equal(-1, c <=> cc)
-
- assert_equal(SimpleRat(11,6), cc + c)
- assert_equal(SimpleRat(7,6), cc - c)
- assert_equal(SimpleRat(1,2), cc * c)
- assert_equal(SimpleRat(9,2), cc / c)
- assert_in_delta(1.1447, cc ** c, 0.001)
- assert_equal(1, cc <=> c)
-
- assert_equal(SimpleRat, (+c).class)
- assert_equal(SimpleRat, (-c).class)
-
- assert_equal(SimpleRat, (c + 2).class)
- assert_equal(SimpleRat, (c - 2).class)
- assert_equal(SimpleRat, (c * 2).class)
- assert_equal(SimpleRat, (c / 2).class)
- assert_equal(SimpleRat, (c ** 2).class)
-
- assert_equal(SimpleRat, (2 + c).class)
- assert_equal(SimpleRat, (2 - c).class)
- assert_equal(SimpleRat, (2 * c).class)
- assert_equal(SimpleRat, (2 / c).class)
- assert_equal(Float, (2 ** c).class)
-
- assert_equal(SimpleRat, (c + cc).class)
- assert_equal(SimpleRat, (c - cc).class)
- assert_equal(SimpleRat, (c * cc).class)
- assert_equal(SimpleRat, (c / cc).class)
- assert_equal(Float, (c ** cc).class)
-
- assert_equal(SimpleRat, (cc + c).class)
- assert_equal(SimpleRat, (cc - c).class)
- assert_equal(SimpleRat, (cc * c).class)
- assert_equal(SimpleRat, (cc / c).class)
- assert_equal(Float, (cc ** c).class)
-
- assert_equal(0, Rational(2,3) <=> SimpleRat(2,3))
- assert_equal(0, SimpleRat(2,3) <=> Rational(2,3))
- assert(Rational(2,3) == SimpleRat(2,3))
- assert(SimpleRat(2,3) == Rational(2,3))
-
- assert_equal(SimpleRat, (c + 0).class)
- assert_equal(SimpleRat, (c - 0).class)
- assert_equal(SimpleRat, (c * 0).class)
- assert_equal(SimpleRat, (c * 1).class)
- assert_equal(SimpleRat, (0 + c).class)
- assert_equal(SimpleRat, (0 - c).class)
- assert_equal(SimpleRat, (0 * c).class)
- assert_equal(SimpleRat, (1 * c).class)
- end
-
- def test_comp_srat
- return unless defined?(Rational)
-
- c = Complex(SimpleRat(2,3),SimpleRat(1,2))
- cc = Complex(Rational(3,2),Rational(2,1))
-
- assert_equal(Complex(SimpleRat(2,3),SimpleRat(1,2)), +c)
- assert_equal(Complex(SimpleRat(-2,3),SimpleRat(-1,2)), -c)
-
- assert_equal(Complex(SimpleRat(8,3),SimpleRat(1,2)), c + 2)
- assert_equal(Complex(SimpleRat(-4,3),SimpleRat(1,2)), c - 2)
- assert_equal(Complex(SimpleRat(4,3),SimpleRat(1,1)), c * 2)
- assert_equal(Complex(SimpleRat(1,3),SimpleRat(1,4)), c / 2)
- assert_equal(Complex(SimpleRat(7,36),SimpleRat(2,3)), c ** 2)
- assert_raise(NoMethodError){c <=> 2}
-
- assert_equal(Complex(SimpleRat(8,3),SimpleRat(1,2)), 2 + c)
- assert_equal(Complex(SimpleRat(4,3),SimpleRat(-1,2)), 2 - c)
- assert_equal(Complex(SimpleRat(4,3),SimpleRat(1,1)), 2 * c)
- assert_equal(Complex(SimpleRat(48,25),SimpleRat(-36,25)), 2 / c)
- r = 2 ** c
- assert_in_delta(1.4940, r.real, 0.001)
- assert_in_delta(0.5392, r.imag, 0.001)
- assert_raise(NoMethodError){2 <=> c}
-
- assert_equal(Complex(SimpleRat(13,6),SimpleRat(5,2)), c + cc)
- assert_equal(Complex(SimpleRat(-5,6),SimpleRat(-3,2)), c - cc)
- assert_equal(Complex(SimpleRat(0,1),SimpleRat(25,12)), c * cc)
- assert_equal(Complex(SimpleRat(8,25),SimpleRat(-7,75)), c / cc)
- r = c ** cc
- assert_in_delta(0.1732, r.real, 0.001)
- assert_in_delta(0.1186, r.imag, 0.001)
- assert_raise(NoMethodError){c <=> cc}
-
- assert_equal(Complex(SimpleRat(13,6),SimpleRat(5,2)), cc + c)
- assert_equal(Complex(SimpleRat(5,6),SimpleRat(3,2)), cc - c)
- assert_equal(Complex(SimpleRat(0,1),SimpleRat(25,12)), cc * c)
- assert_equal(Complex(SimpleRat(72,25),SimpleRat(21,25)), cc / c)
- r = cc ** c
- assert_in_delta(0.5498, r.real, 0.001)
- assert_in_delta(1.0198, r.imag, 0.001)
- assert_raise(NoMethodError){cc <=> c}
-
- assert_equal([SimpleRat,SimpleRat],
- (+c).instance_eval{[real.class, imag.class]})
- assert_equal([SimpleRat,SimpleRat],
- (-c).instance_eval{[real.class, imag.class]})
-
- assert_equal([SimpleRat,SimpleRat],
- (c + 2).instance_eval{[real.class, imag.class]})
- assert_equal([SimpleRat,SimpleRat],
- (c - 2).instance_eval{[real.class, imag.class]})
- assert_equal([SimpleRat,SimpleRat],
- (c * 2).instance_eval{[real.class, imag.class]})
- assert_equal([SimpleRat,SimpleRat],
- (c / 2).instance_eval{[real.class, imag.class]})
- assert_equal([SimpleRat,SimpleRat],
- (c ** 2).instance_eval{[real.class, imag.class]})
-
- assert_equal([SimpleRat,SimpleRat],
- (c + cc).instance_eval{[real.class, imag.class]})
- assert_equal([SimpleRat,SimpleRat],
- (c - cc).instance_eval{[real.class, imag.class]})
- assert_equal([SimpleRat,SimpleRat],
- (c * cc).instance_eval{[real.class, imag.class]})
- assert_equal([SimpleRat,SimpleRat],
- (c / cc).instance_eval{[real.class, imag.class]})
- assert_equal([Float,Float],
- (c ** cc).instance_eval{[real.class, imag.class]})
-
- assert_equal([SimpleRat,SimpleRat],
- (cc + c).instance_eval{[real.class, imag.class]})
- assert_equal([SimpleRat,SimpleRat],
- (cc - c).instance_eval{[real.class, imag.class]})
- assert_equal([SimpleRat,SimpleRat],
- (cc * c).instance_eval{[real.class, imag.class]})
- assert_equal([SimpleRat,SimpleRat],
- (cc / c).instance_eval{[real.class, imag.class]})
- assert_equal([Float,Float],
- (cc ** c).instance_eval{[real.class, imag.class]})
-
- assert(Complex(SimpleRat(2,3),SimpleRat(3,2)) ==
- Complex(Rational(2,3),Rational(3,2)))
- assert(Complex(Rational(2,3),Rational(3,2)) ==
- Complex(SimpleRat(2,3),SimpleRat(3,2)))
-
- assert_equal([SimpleRat,SimpleRat],
- (c + 0).instance_eval{[real.class, imag.class]})
- assert_equal([SimpleRat,SimpleRat],
- (c - 0).instance_eval{[real.class, imag.class]})
- assert_equal([SimpleRat,SimpleRat],
- (c * 0).instance_eval{[real.class, imag.class]})
- assert_equal([SimpleRat,SimpleRat],
- (c * 1).instance_eval{[real.class, imag.class]})
- assert_equal([SimpleRat,SimpleRat],
- (0 + c).instance_eval{[real.class, imag.class]})
- assert_equal([SimpleRat,SimpleRat],
- (0 - c).instance_eval{[real.class, imag.class]})
- assert_equal([SimpleRat,SimpleRat],
- (0 * c).instance_eval{[real.class, imag.class]})
- assert_equal([SimpleRat,SimpleRat],
- (1 * c).instance_eval{[real.class, imag.class]})
- end
-
-end
-
-def SimpleRat(*a) SimpleRat.new(*a) end
-
-class SimpleRat < Numeric
-
- def initialize(num, den = 1)
- if den == 0
- raise ZeroDivisionError, "divided by zero"
- end
- if den < 0
- num = -num
- den = -den
- end
- gcd = num.gcd(den)
- @num = num.div(gcd)
- @den = den.div(gcd)
- end
-
- def numerator() @num end
- def denominator() @den end
-
- def +@ () self end
- def -@ () self.class.new(-@num, @den) end
-
- def + (o)
- case o
- when SimpleRat, Rational
- a = @num * o.denominator
- b = o.numerator * @den
- self.class.new(a + b, @den * o.denominator)
- when Integer
- self + self.class.new(o)
- when Float
- to_f + o
- else
- x, y = o.coerce(self)
- x + y
- end
- end
-
- def - (o)
- case o
- when SimpleRat, Rational
- a = @num * o.denominator
- b = o.numerator * @den
- self.class.new(a - b, @den * o.denominator)
- when Integer
- self - self.class.new(o)
- when Float
- to_f - o
- else
- x, y = o.coerce(self)
- x - y
- end
- end
-
- def * (o)
- case o
- when SimpleRat, Rational
- a = @num * o.numerator
- b = @den * o.denominator
- self.class.new(a, b)
- when Integer
- self * self.class.new(o)
- when Float
- to_f * o
- else
- x, y = o.coerce(self)
- x * y
- end
- end
-
- def quo(o)
- case o
- when SimpleRat, Rational
- a = @num * o.denominator
- b = @den * o.numerator
- self.class.new(a, b)
- when Integer
- if o == 0
- raise raise ZeroDivisionError, "divided by zero"
- end
- self.quo(self.class.new(o))
- when Float
- to_f.quo(o)
- else
- x, y = o.coerce(self)
- x.quo(y)
- end
- end
-
- alias / quo
-
- def floor
- @num.div(@den)
- end
-
- def ceil
- -((-@num).div(@den))
- end
-
- def truncate
- if @num < 0
- return -((-@num).div(@den))
- end
- @num.div(@den)
- end
-
- alias to_i truncate
-
- def round
- if @num < 0
- num = -@num
- num = num * 2 + @den
- den = @den * 2
- -(num.div(den))
- else
- num = @num * 2 + @den
- den = @den * 2
- num.div(den)
- end
- end
-
- def div(o) (self / o).floor end
- def quot(o) (self / o).truncate end
-
- def modulo(o)
- q = div(o)
- self - o * q
- end
-
- def remainder(o)
- q = quot(o)
- self - o * q
- end
-
- alias % modulo
-
- def divmod(o) [div(o), modulo(o)] end
- def quotrem(o) [quot(o), remainder(o)] end
-
- def ** (o)
- case o
- when SimpleRat, Rational
- Float(self) ** o
- when Integer
- if o > 0
- a = @num ** o
- b = @den ** o
- elsif o < 0
- a = @den ** -o
- b = @num ** -o
- else
- a = b = 1
- end
- self.class.new(a, b)
- when Float
- to_f ** o
- else
- x, y = o.coerce(self)
- x ** y
- end
- end
-
- def <=> (o)
- case o
- when SimpleRat, Rational
- a = @num * o.denominator
- b = o.numerator * @den
- return a <=> b
- when Integer
- self <=> self.class.new(o)
- when Float
- to_f <=> o
- else
- x, y = o.coerce(self)
- x <=> y
- end
- end
-
- def == (o)
- begin
- (self <=> o) == 0
- rescue
- false
- end
- end
-
- def coerce(o)
- case o
- when Rational
- [self.class.new(o.numerator, o.denominator), self]
- when Integer
- [self.class.new(o), self]
- when Float
- [o, self.to_f]
- else
- super
- end
- end
-
- def hash() @num.hash ^ @den.hash end
-
- def to_f() @num.to_f / @den.to_f end
- def to_r() self end
- def to_s() format('%s/%s', @num, @den) end
-
- def inspect() format('#SR(%s)', to_s) end
-
- def marshal_dump() [@num, @den] end
- def marshal_load(a) @num, @den = a end
-
-end
diff --git a/test/ruby/test_const.rb b/test/ruby/test_const.rb
index 3708a5a0ca..8d01379dbd 100644
--- a/test/ruby/test_const.rb
+++ b/test/ruby/test_const.rb
@@ -15,34 +15,19 @@ class TestConst < Test::Unit::TestCase
end
def test_const
- assert defined?(TEST1)
- assert_equal 1, TEST1
- assert defined?(TEST2)
- assert_equal 2, TEST2
-
self.class.class_eval {
include Const
}
- assert defined?(TEST1)
- assert_equal 1, TEST1
- assert defined?(TEST2)
- assert_equal 2, TEST2
- assert defined?(TEST3)
- assert_equal 3, TEST3
- assert defined?(TEST4)
- assert_equal 4, TEST4
+ assert_equal([1,2,3,4], [TEST1,TEST2,TEST3,TEST4])
self.class.class_eval {
include Const2
}
STDERR.print "intentionally redefines TEST3, TEST4\n" if $VERBOSE
- assert defined?(TEST1)
- assert_equal 1, TEST1
- assert defined?(TEST2)
- assert_equal 2, TEST2
- assert defined?(TEST3)
- assert_equal 6, TEST3
- assert defined?(TEST4)
- assert_equal 8, TEST4
+ assert_equal([1,2,6,8], [TEST1,TEST2,TEST3,TEST4])
+
+ assert_equal(-1, (String <=> Object))
+ assert_equal(1, (Object <=> String))
+ assert_equal(nil, (Array <=> String))
end
end
diff --git a/test/ruby/test_continuation.rb b/test/ruby/test_continuation.rb
deleted file mode 100644
index c719db8c35..0000000000
--- a/test/ruby/test_continuation.rb
+++ /dev/null
@@ -1,81 +0,0 @@
-require 'test/unit'
-require 'continuation'
-require 'fiber'
-require_relative 'envutil'
-
-class TestContinuation < Test::Unit::TestCase
- def test_create
- assert_equal(:ok, callcc{:ok})
- assert_equal(:ok, callcc{|c| c.call :ok})
- end
-
- def test_call
- assert_equal(:ok, callcc{|c| c.call :ok})
-
- ary = []
- ary << callcc{|c|
- @cont = c
- :a
- }
- @cont.call :b if ary.length < 3
- assert_equal([:a, :b, :b], ary)
- end
-
- def test_check_localvars
- vv = 0
- @v = 0
- @ary = []
- [1, 2, 3].each{|i|
- callcc {|k| @k = k}
- @v += 1
- vv += 1
- }
- @ary << [vv, @v]
- @k.call if @v < 10
- assert_equal((3..10).map{|e| [e, e]}, @ary)
- end
-
- def test_error
- cont = callcc{|c| c}
- assert_raise(RuntimeError){
- Thread.new{cont.call}.join
- }
- assert_raise(LocalJumpError){
- callcc
- }
- assert_raise(RuntimeError){
- c = nil
- Fiber.new do
- callcc {|c2| c = c2 }
- end.resume
- c.call
- }
- end
-
- def test_ary_flatten
- assert_normal_exit %q{
- require 'continuation'
- n = 0
- o = Object.new
- def o.to_ary() callcc {|k| $k = k; [1,2,3]} end
- [10,20,o,30,o,40].flatten.inspect
- n += 1
- $k.call if n < 100
- }, '[ruby-dev:34798]'
- end
-
- def test_marshal_dump
- assert_normal_exit %q{
- require 'continuation'
- n = 0
- o = Object.new
- def o.marshal_dump() callcc {|k| $k = k }; "fofof" end
- a = [1,2,3,o,4,5,6]
- Marshal.dump(a).inspect
- n += 1
- $k.call if n < 100
- }, '[ruby-dev:34802]'
- end
-
-end
-
diff --git a/test/ruby/test_defined.rb b/test/ruby/test_defined.rb
index bfcd7fb667..8a7fcf45a9 100644
--- a/test/ruby/test_defined.rb
+++ b/test/ruby/test_defined.rb
@@ -10,8 +10,6 @@ class TestDefined < Test::Unit::TestCase
yield(defined?(self.foo))
yield(defined?(f.foo))
end
- def baz(f)
- end
end
def defined_test
@@ -36,46 +34,10 @@ class TestDefined < Test::Unit::TestCase
assert(defined?(1 == 2)) # operator expression
f = Foo.new
- assert_nil(defined?(f.foo)) # protected method
+ assert_nil(defined?(f.foo))
f.bar(f) { |v| assert(v) }
- assert_nil(defined?(f.quux)) # undefined method
- assert_nil(defined?(f.baz(x))) # undefined argument
- x = 0
- assert(defined?(f.baz(x)))
- assert_nil(defined?(f.quux(x)))
- assert(defined?(print(x)))
- assert_nil(defined?(quux(x)))
assert(defined_test) # not iterator
- assert(!defined_test{}) # called as iterator
-
- /a/ =~ ''
- assert_equal nil, defined?($&)
- assert_equal nil, defined?($`)
- assert_equal nil, defined?($')
- assert_equal nil, defined?($+)
- assert_equal nil, defined?($1)
- assert_equal nil, defined?($2)
- /a/ =~ 'a'
- assert_equal 'global-variable', defined?($&)
- assert_equal 'global-variable', defined?($`)
- assert_equal 'global-variable', defined?($')
- assert_equal nil, defined?($+)
- assert_equal nil, defined?($1)
- assert_equal nil, defined?($2)
- /(a)/ =~ 'a'
- assert_equal 'global-variable', defined?($&)
- assert_equal 'global-variable', defined?($`)
- assert_equal 'global-variable', defined?($')
- assert_equal 'global-variable', defined?($+)
- assert_equal 'global-variable', defined?($1)
- assert_equal nil, defined?($2)
- /(a)b/ =~ 'ab'
- assert_equal 'global-variable', defined?($&)
- assert_equal 'global-variable', defined?($`)
- assert_equal 'global-variable', defined?($')
- assert_equal 'global-variable', defined?($+)
- assert_equal 'global-variable', defined?($1)
- assert_equal nil, defined?($2)
+ assert(!defined_test{}) # called as iterator
end
end
diff --git a/test/ruby/test_dir.rb b/test/ruby/test_dir.rb
index 0ea28f55d8..09685bee8f 100644
--- a/test/ruby/test_dir.rb
+++ b/test/ruby/test_dir.rb
@@ -2,31 +2,28 @@ require 'test/unit'
require 'tmpdir'
require 'fileutils'
-require 'pathname'
class TestDir < Test::Unit::TestCase
+ ROOT = File.join(Dir.tmpdir, "__test_dir__#{$$}")
+
def setup
- @verbose = $VERBOSE
- $VERBOSE = nil
- @root = Pathname.new(Dir.mktmpdir('__test_dir__')).realpath.to_s
- @nodir = File.join(@root, "dummy")
+ Dir.mkdir(ROOT)
for i in ?a..?z
- if i.ord % 2 == 0
- FileUtils.touch(File.join(@root, i))
+ if i % 2 == 0
+ FileUtils.touch(File.join(ROOT, i.chr))
else
- FileUtils.mkdir(File.join(@root, i))
+ FileUtils.mkdir(File.join(ROOT, i.chr))
end
end
end
def teardown
- $VERBOSE = @verbose
- FileUtils.remove_entry_secure @root if File.directory?(@root)
+ FileUtils.rm_rf ROOT if File.directory?(ROOT)
end
def test_seek
- dir = Dir.open(@root)
+ dir = Dir.open(ROOT)
begin
cache = []
loop do
@@ -34,137 +31,12 @@ class TestDir < Test::Unit::TestCase
break unless name = dir.read
cache << [pos, name]
end
- for x,y in cache.sort_by {|z| z[0] % 3 } # shuffle
- dir.seek(x)
- assert_equal(y, dir.read)
+ for x in cache.sort_by {|x| x[0] % 3 } # shuffle
+ dir.seek(x[0])
+ assert_equal(x[1], dir.read)
end
ensure
dir.close
end
end
-
- def test_JVN_13947696
- b = lambda {
- d = Dir.open('.')
- $SAFE = 4
- d.close
- }
- assert_raise(SecurityError) { b.call }
- end
-
- def test_nodir
- assert_raise(Errno::ENOENT) { Dir.open(@nodir) }
- end
-
- def test_inspect
- d = Dir.open(@root)
- assert_match(/^#<Dir:#{ Regexp.quote(@root) }>$/, d.inspect)
- assert_match(/^#<Dir:.*>$/, Dir.allocate.inspect)
- ensure
- d.close
- end
-
- def test_path
- d = Dir.open(@root)
- assert_equal(@root, d.path)
- assert_nil(Dir.allocate.path)
- ensure
- d.close
- end
-
- def test_set_pos
- d = Dir.open(@root)
- loop do
- i = d.pos
- break unless x = d.read
- d.pos = i
- assert_equal(x, d.read)
- end
- ensure
- d.close
- end
-
- def test_rewind
- d = Dir.open(@root)
- a = (0..5).map { d.read }
- d.rewind
- b = (0..5).map { d.read }
- assert_equal(a, b)
- assert_raise(SecurityError) do
- Thread.new do
- $SAFE = 4
- d.rewind
- end.join
- end
- ensure
- d.close
- end
-
- def test_chdir
- @pwd = Dir.pwd
- @env_home = ENV["HOME"]
- @env_logdir = ENV["LOGDIR"]
- ENV.delete("HOME")
- ENV.delete("LOGDIR")
-
- assert_raise(Errno::ENOENT) { Dir.chdir(@nodir) }
- assert_raise(ArgumentError) { Dir.chdir }
- ENV["HOME"] = @pwd
- Dir.chdir do
- assert_equal(@pwd, Dir.pwd)
- Dir.chdir(@root)
- assert_equal(@root, Dir.pwd)
- end
-
- ensure
- begin
- Dir.chdir(@pwd)
- rescue
- abort("cannot return the original directory: #{ @pwd }")
- end
- if @env_home
- ENV["HOME"] = @env_home
- else
- ENV.delete("HOME")
- end
- if @env_logdir
- ENV["LOGDIR"] = @env_logdir
- else
- ENV.delete("LOGDIR")
- end
- end
-
- def test_chroot_nodir
- assert_raise(NotImplementedError, Errno::ENOENT, Errno::EPERM
- ) { Dir.chroot(File.join(@nodir, "")) }
- end
-
- def test_close
- d = Dir.open(@root)
- d.close
- assert_raise(IOError) { d.read }
- end
-
- def test_glob
- assert_equal((%w(. ..) + (?a..?z).to_a).map{|f| File.join(@root, f) },
- Dir.glob(File.join(@root, "*"), File::FNM_DOTMATCH).sort)
- assert_equal([@root] + (?a..?z).map {|f| File.join(@root, f) }.sort,
- Dir.glob([@root, File.join(@root, "*")]).sort)
- assert_equal([@root] + (?a..?z).map {|f| File.join(@root, f) }.sort,
- Dir.glob(@root + "\0\0\0" + File.join(@root, "*")).sort)
-
- assert_equal((?a..?z).step(2).map {|f| File.join(File.join(@root, f), "") }.sort,
- Dir.glob(File.join(@root, "*/")).sort)
-
- FileUtils.touch(File.join(@root, "{}"))
- assert_equal(%w({} a).map{|f| File.join(@root, f) },
- Dir.glob(File.join(@root, '{\{\},a}')))
- assert_equal([], Dir.glob(File.join(@root, '[')))
- assert_equal([], Dir.glob(File.join(@root, '[a-\\')))
- end
-
- def test_foreach
- assert_equal(Dir.foreach(@root).to_a.sort, %w(. ..) + (?a..?z).to_a)
- end
-
end
diff --git a/test/ruby/test_econv.rb b/test/ruby/test_econv.rb
deleted file mode 100644
index 5fce12da84..0000000000
--- a/test/ruby/test_econv.rb
+++ /dev/null
@@ -1,889 +0,0 @@
-require 'test/unit'
-
-class TestEncodingConverter < Test::Unit::TestCase
- def check_ec(edst, esrc, eres, dst, src, ec, off, len, opts=nil)
- res = ec.primitive_convert(src, dst, off, len, opts)
- assert_equal([edst.dup.force_encoding("ASCII-8BIT"),
- esrc.dup.force_encoding("ASCII-8BIT"),
- eres],
- [dst.dup.force_encoding("ASCII-8BIT"),
- src.dup.force_encoding("ASCII-8BIT"),
- res])
- end
-
- def assert_econv(converted, eres, obuf_bytesize, ec, consumed, rest, opts=nil)
- ec = Encoding::Converter.new(*ec) if Array === ec
- i = consumed + rest
- o = ""
- ret = ec.primitive_convert(i, o, 0, obuf_bytesize, opts)
- assert_equal([converted, eres, rest],
- [o, ret, i])
- end
-
- def assert_errinfo(e_res, e_enc1, e_enc2, e_error_bytes, e_readagain_bytes, ec)
- assert_equal([e_res, e_enc1, e_enc2,
- e_error_bytes && e_error_bytes.dup.force_encoding("ASCII-8BIT"),
- e_readagain_bytes && e_readagain_bytes.dup.force_encoding("ASCII-8BIT")],
- ec.primitive_errinfo)
- end
-
- def test_s_asciicompat_encoding
- assert_equal(Encoding::STATELESS_ISO_2022_JP, Encoding::Converter.asciicompat_encoding("ISO-2022-JP"))
- assert_equal(Encoding::STATELESS_ISO_2022_JP, Encoding::Converter.asciicompat_encoding(Encoding::ISO_2022_JP))
- assert_equal(Encoding::UTF_8, Encoding::Converter.asciicompat_encoding("UTF-16BE"))
- assert_equal(Encoding::UTF_8, Encoding::Converter.asciicompat_encoding("UTF-16LE"))
- assert_equal(Encoding::UTF_8, Encoding::Converter.asciicompat_encoding("UTF-32BE"))
- assert_equal(Encoding::UTF_8, Encoding::Converter.asciicompat_encoding("UTF-32LE"))
- assert_nil(Encoding::Converter.asciicompat_encoding("EUC-JP"))
- assert_nil(Encoding::Converter.asciicompat_encoding("UTF-8"))
- assert_nil(Encoding::Converter.asciicompat_encoding(Encoding::UTF_8))
- assert_nil(Encoding::Converter.asciicompat_encoding("xml_attr_escape"))
- assert_nil(Encoding::Converter.asciicompat_encoding("encoding-not-exist"))
- end
-
- def test_asciicompat_encoding_iso2022jp
- acenc = Encoding::Converter.asciicompat_encoding("ISO-2022-JP")
- str = "\e$B~~\(B".force_encoding("iso-2022-jp")
- str2 = str.encode(acenc)
- str3 = str.encode("ISO-2022-JP")
- assert_equal(str, str3)
- end
-
- def test_s_new
- assert_kind_of(Encoding::Converter, Encoding::Converter.new("UTF-8", "EUC-JP"))
- assert_kind_of(Encoding::Converter, Encoding::Converter.new(Encoding::UTF_8, Encoding::EUC_JP))
- end
-
- def test_s_new_convpath
- assert_equal([], Encoding::Converter.new([]).convpath)
- assert_equal([[Encoding::UTF_8, Encoding::EUC_JP]],
- Encoding::Converter.new([["UTF-8", "EUC-JP"]]).convpath)
- assert_equal([[Encoding::UTF_8, Encoding::WINDOWS_31J]],
- Encoding::Converter.new([["utf-8", "cp932"]]).convpath)
- assert_equal([[Encoding::UTF_8, Encoding::EUC_JP]],
- Encoding::Converter.new([[Encoding::UTF_8, Encoding::EUC_JP]]).convpath)
- assert_equal([[Encoding::ISO_8859_1, Encoding::UTF_8],
- [Encoding::UTF_8, Encoding::EUC_JP]],
- Encoding::Converter.new([["iso-8859-1", "euc-jp"]]).convpath)
- assert_equal([[Encoding::ISO_8859_1, Encoding::UTF_8],
- [Encoding::UTF_8, Encoding::EUC_JP],
- "universal_newline"],
- Encoding::Converter.new([["iso-8859-1", "euc-jp"], "universal_newline"]).convpath)
- assert_equal(["universal_newline",
- [Encoding::ISO_8859_1, Encoding::UTF_8],
- [Encoding::UTF_8, Encoding::EUC_JP],
- "universal_newline"],
- Encoding::Converter.new(["universal_newline", ["iso-8859-1", "euc-jp"], "universal_newline"]).convpath)
- end
-
- def test_s_new_fail
- name1 = "encoding-which-is-not-exist-1"
- name2 = "encoding-which-is-not-exist-2"
-
- assert_raise(Encoding::ConverterNotFoundError) {
- Encoding::Converter.new(name1, name2)
- }
-
- encoding_list = Encoding.list.map {|e| e.name }
- assert(!encoding_list.include?(name1))
- assert(!encoding_list.include?(name2))
- end
-
- def test_newline_converter_with_ascii_incompatible
- assert_nothing_raised {
- Encoding::Converter.new("UTF-8", "UTF-16BE", Encoding::Converter::UNIVERSAL_NEWLINE_DECORATOR)
- }
- assert_nothing_raised {
- Encoding::Converter.new("UTF-16BE", "UTF-8", Encoding::Converter::CRLF_NEWLINE_DECORATOR)
- }
- assert_nothing_raised {
- Encoding::Converter.new("UTF-16BE", "UTF-8", Encoding::Converter::CR_NEWLINE_DECORATOR)
- }
-
- assert_nothing_raised {
- Encoding::Converter.new("UTF-16BE", "UTF-8", Encoding::Converter::UNIVERSAL_NEWLINE_DECORATOR)
- }
- assert_nothing_raised {
- Encoding::Converter.new("UTF-8", "UTF-16BE", Encoding::Converter::CRLF_NEWLINE_DECORATOR)
- }
- assert_nothing_raised {
- Encoding::Converter.new("UTF-8", "UTF-16BE", Encoding::Converter::CR_NEWLINE_DECORATOR)
- }
- end
-
- def test_get_encoding
- ec = Encoding::Converter.new("UTF-8", "EUC-JP")
- assert_equal(Encoding::UTF_8, ec.source_encoding)
- assert_equal(Encoding::EUC_JP, ec.destination_encoding)
- end
-
- def test_result_encoding
- ec = Encoding::Converter.new("UTF-8", "EUC-JP")
- dst = "".force_encoding("ASCII-8BIT")
- assert_equal(Encoding::ASCII_8BIT, dst.encoding)
- ec.primitive_convert("\u{3042}", dst, nil, 10)
- assert_equal(Encoding::EUC_JP, dst.encoding)
- end
-
- def test_output_region
- ec = Encoding::Converter.new("UTF-8", "EUC-JP")
- ec.primitive_convert(src="a", dst="b", nil, 1, :partial_input=>true)
- assert_equal("ba", dst)
- ec.primitive_convert(src="a", dst="b", 0, 1, :partial_input=>true)
- assert_equal("a", dst)
- ec.primitive_convert(src="a", dst="b", 1, 1, :partial_input=>true)
- assert_equal("ba", dst)
- assert_raise(ArgumentError) {
- ec.primitive_convert(src="a", dst="b", 2, 1, :partial_input=>true)
- }
- assert_raise(ArgumentError) {
- ec.primitive_convert(src="a", dst="b", -1, 1, :partial_input=>true)
- }
- assert_raise(ArgumentError) {
- ec.primitive_convert(src="a", dst="b", 1, -1, :partial_input=>true)
- }
- end
-
- def test_nil_source_buffer
- ec = Encoding::Converter.new("UTF-8", "EUC-JP")
- ret = ec.primitive_convert(nil, dst="", nil, 10)
- assert_equal(:finished, ret)
- end
-
- def test_nil_destination_bytesize
- ec = Encoding::Converter.new("Shift_JIS", "UTF-8")
- n = 10000
- src = "\xa1".force_encoding("Shift_JIS") * n
- ret = ec.primitive_convert(src, dst="", nil, nil)
- assert_equal(:finished, ret)
- assert_equal("\xEF\xBD\xA1".force_encoding("UTF-8") * n, dst)
- end
-
- def test_nil_destination_bytesize2
- ec = Encoding::Converter.new("Shift_JIS", "UTF-8")
- n = 10000
- src = "\xa1".force_encoding("Shift_JIS") * n
- ret = ec.primitive_convert(src, dst="")
- assert_equal(:finished, ret)
- assert_equal("\xEF\xBD\xA1".force_encoding("UTF-8") * n, dst)
- end
-
- def test_nil_destination_bytesize_with_nonnil_byteoffset
- ec = Encoding::Converter.new("Shift_JIS", "UTF-8")
- n = 2000
- src = "\xa1".force_encoding("Shift_JIS") * n
- dst = "abcd" * 2000
- ret = ec.primitive_convert(src, dst, 3, nil)
- assert_equal(:finished, ret)
- assert_equal("abc" + "\xEF\xBD\xA1".force_encoding("UTF-8") * n, dst)
- end
-
- def test_partial_input
- ec = Encoding::Converter.new("UTF-8", "EUC-JP")
- ret = ec.primitive_convert(src="", dst="", nil, 10, :partial_input=>true)
- assert_equal(:source_buffer_empty, ret)
- ret = ec.primitive_convert(src="", dst="", nil, 10)
- assert_equal(:finished, ret)
- end
-
- def test_accumulate_dst1
- ec = Encoding::Converter.new("UTF-8", "EUC-JP")
- a = ["", "abc\u{3042}def", ec, nil, 1]
- check_ec("a", "c\u{3042}def", :destination_buffer_full, *a)
- check_ec("ab", "\u{3042}def", :destination_buffer_full, *a)
- check_ec("abc", "def", :destination_buffer_full, *a)
- check_ec("abc\xA4", "def", :destination_buffer_full, *a)
- check_ec("abc\xA4\xA2", "ef", :destination_buffer_full, *a)
- check_ec("abc\xA4\xA2d", "f", :destination_buffer_full, *a)
- check_ec("abc\xA4\xA2de", "", :destination_buffer_full, *a)
- check_ec("abc\xA4\xA2def", "", :finished, *a)
- end
-
- def test_accumulate_dst2
- ec = Encoding::Converter.new("UTF-8", "EUC-JP")
- a = ["", "abc\u{3042}def", ec, nil, 2]
- check_ec("ab", "\u{3042}def", :destination_buffer_full, *a)
- check_ec("abc\xA4", "def", :destination_buffer_full, *a)
- check_ec("abc\xA4\xA2d", "f", :destination_buffer_full, *a)
- check_ec("abc\xA4\xA2def", "", :finished, *a)
- end
-
- def test_eucjp_to_utf8
- assert_econv("", :finished, 100, ["UTF-8", "EUC-JP"], "", "")
- assert_econv("a", :finished, 100, ["UTF-8", "EUC-JP"], "a", "")
- end
-
- def test_iso2022jp
- assert_econv("", :finished, 100, ["Shift_JIS", "ISO-2022-JP"], "", "")
- end
-
- def test_iso2022jp_encode
- ec = Encoding::Converter.new("EUC-JP", "ISO-2022-JP")
- a = ["", src="", ec, nil, 50, :partial_input=>true]
- src << "a"; check_ec("a", "", :source_buffer_empty, *a)
- src << "\xA2"; check_ec("a", "", :source_buffer_empty, *a)
- src << "\xA4"; check_ec("a\e$B\"$", "", :source_buffer_empty, *a)
- src << "\xA1"; check_ec("a\e$B\"$", "", :source_buffer_empty, *a)
- src << "\xA2"; check_ec("a\e$B\"$!\"", "", :source_buffer_empty, *a)
- src << "b"; check_ec("a\e$B\"$!\"\e(Bb", "", :source_buffer_empty, *a)
- src << "\xA2\xA6"; check_ec("a\e$B\"$!\"\e(Bb\e$B\"&", "", :source_buffer_empty, *a)
- a[-1] = 0; check_ec("a\e$B\"$!\"\e(Bb\e$B\"&\e(B", "", :finished, *a)
- end
-
- def test_iso2022jp_decode
- ec = Encoding::Converter.new("ISO-2022-JP", "EUC-JP")
- a = ["", src="", ec, nil, 50, :partial_input=>true]
- src << "a"; check_ec("a", "", :source_buffer_empty, *a)
- src << "\e"; check_ec("a", "", :source_buffer_empty, *a)
- src << "$"; check_ec("a", "", :source_buffer_empty, *a)
- src << "B"; check_ec("a", "", :source_buffer_empty, *a)
- src << "\x21"; check_ec("a", "", :source_buffer_empty, *a)
- src << "\x22"; check_ec("a\xA1\xA2", "", :source_buffer_empty, *a)
- src << "\n"; check_ec("a\xA1\xA2", "", :invalid_byte_sequence, *a)
- src << "\x23"; check_ec("a\xA1\xA2", "", :source_buffer_empty, *a)
- src << "\x24"; check_ec("a\xA1\xA2\xA3\xA4", "", :source_buffer_empty, *a)
- src << "\e"; check_ec("a\xA1\xA2\xA3\xA4", "", :source_buffer_empty, *a)
- src << "("; check_ec("a\xA1\xA2\xA3\xA4", "", :source_buffer_empty, *a)
- src << "B"; check_ec("a\xA1\xA2\xA3\xA4", "", :source_buffer_empty, *a)
- src << "c"; check_ec("a\xA1\xA2\xA3\xA4c", "", :source_buffer_empty, *a)
- src << "\n"; check_ec("a\xA1\xA2\xA3\xA4c\n","", :source_buffer_empty, *a)
- end
-
- def test_invalid
- assert_econv("", :invalid_byte_sequence, 100, ["UTF-8", "EUC-JP"], "\x80", "")
- assert_econv("a", :invalid_byte_sequence, 100, ["UTF-8", "EUC-JP"], "a\x80", "")
- assert_econv("a", :invalid_byte_sequence, 100, ["UTF-8", "EUC-JP"], "a\x80", "\x80")
- assert_econv("abc", :invalid_byte_sequence, 100, ["UTF-8", "EUC-JP"], "abc\xFF", "def")
- assert_econv("abc", :invalid_byte_sequence, 100, ["Shift_JIS", "EUC-JP"], "abc\xFF", "def")
- assert_econv("abc", :invalid_byte_sequence, 100, ["ISO-2022-JP", "EUC-JP"], "abc\xFF", "def")
- end
-
- def test_invalid2
- ec = Encoding::Converter.new("Shift_JIS", "EUC-JP")
- a = ["", "abc\xFFdef", ec, nil, 1]
- check_ec("a", "c\xFFdef", :destination_buffer_full, *a)
- check_ec("ab", "\xFFdef", :destination_buffer_full, *a)
- check_ec("abc", "def", :invalid_byte_sequence, *a)
- check_ec("abcd", "f", :destination_buffer_full, *a)
- check_ec("abcde", "", :destination_buffer_full, *a)
- check_ec("abcdef", "", :finished, *a)
- end
-
- def test_invalid3
- ec = Encoding::Converter.new("Shift_JIS", "EUC-JP")
- a = ["", "abc\xFFdef", ec, nil, 10]
- check_ec("abc", "def", :invalid_byte_sequence, *a)
- check_ec("abcdef", "", :finished, *a)
- end
-
- def test_invalid4
- ec = Encoding::Converter.new("Shift_JIS", "EUC-JP")
- a = ["", "abc\xFFdef", ec, nil, 10, :after_output=>true]
- check_ec("a", "bc\xFFdef", :after_output, *a)
- check_ec("ab", "c\xFFdef", :after_output, *a)
- check_ec("abc", "\xFFdef", :after_output, *a)
- check_ec("abc", "def", :invalid_byte_sequence, *a)
- check_ec("abcd", "ef", :after_output, *a)
- check_ec("abcde", "f", :after_output, *a)
- check_ec("abcdef", "", :after_output, *a)
- check_ec("abcdef", "", :finished, *a)
- end
-
- def test_invalid_utf16le
- ec = Encoding::Converter.new("UTF-16LE", "UTF-8")
- a = ["", src="", ec, nil, 50, :partial_input=>true]
- src << "A"; check_ec("", "", :source_buffer_empty, *a)
- src << "\x00"; check_ec("A", "", :source_buffer_empty, *a)
- src << "\x00"; check_ec("A", "", :source_buffer_empty, *a)
- src << "\xd8"; check_ec("A", "", :source_buffer_empty, *a)
- src << "\x01"; check_ec("A", "", :source_buffer_empty, *a)
- src << "\x02"; check_ec("A", "", :invalid_byte_sequence, *a)
- src << "\x03"; check_ec("A\u{0201}", "", :source_buffer_empty, *a)
- src << "\x04"; check_ec("A\u{0201}\u{0403}", "", :source_buffer_empty, *a)
- src << "\x00"; check_ec("A\u{0201}\u{0403}", "", :source_buffer_empty, *a)
- src << "\xd8"; check_ec("A\u{0201}\u{0403}", "", :source_buffer_empty, *a)
- src << "\x00"; check_ec("A\u{0201}\u{0403}", "", :source_buffer_empty, *a)
- src << "\xd8"; check_ec("A\u{0201}\u{0403}", "", :invalid_byte_sequence, *a)
- src << "\x00"; check_ec("A\u{0201}\u{0403}", "", :source_buffer_empty, *a)
- src << "\xdc"; check_ec("A\u{0201}\u{0403}\u{10000}", "", :source_buffer_empty, *a)
- end
-
- def test_invalid_utf16be
- ec = Encoding::Converter.new("UTF-16BE", "UTF-8")
- a = ["", src="", ec, nil, 50, :partial_input=>true]
- src << "\x00"; check_ec("", "", :source_buffer_empty, *a)
- src << "A"; check_ec("A", "", :source_buffer_empty, *a)
- src << "\xd8"; check_ec("A", "", :source_buffer_empty, *a)
- src << "\x00"; check_ec("A", "", :source_buffer_empty, *a)
- src << "\x02"; check_ec("A", "", :invalid_byte_sequence, *a)
- src << "\x01"; check_ec("A\u{0201}", "", :source_buffer_empty, *a)
- src << "\x04"; check_ec("A\u{0201}", "", :source_buffer_empty, *a)
- src << "\x03"; check_ec("A\u{0201}\u{0403}", "", :source_buffer_empty, *a)
- src << "\xd8"; check_ec("A\u{0201}\u{0403}", "", :source_buffer_empty, *a)
- src << "\x00"; check_ec("A\u{0201}\u{0403}", "", :source_buffer_empty, *a)
- src << "\xd8"; check_ec("A\u{0201}\u{0403}", "", :invalid_byte_sequence, *a)
- src << "\x00"; check_ec("A\u{0201}\u{0403}", "", :source_buffer_empty, *a)
- src << "\xdc"; check_ec("A\u{0201}\u{0403}", "", :source_buffer_empty, *a)
- src << "\x00"; check_ec("A\u{0201}\u{0403}\u{10000}", "", :source_buffer_empty, *a)
- end
-
- def test_invalid_utf32be
- ec = Encoding::Converter.new("UTF-32BE", "UTF-8")
- a = ["", src="", ec, nil, 50, :partial_input=>true]
- src << "\x00"; check_ec("", "", :source_buffer_empty, *a)
- src << "\x00"; check_ec("", "", :source_buffer_empty, *a)
- src << "\x00"; check_ec("", "", :source_buffer_empty, *a)
- src << "A"; check_ec("A", "", :source_buffer_empty, *a)
-
- src << "\x00"; check_ec("A", "", :source_buffer_empty, *a)
- src << "\x00"; check_ec("A", "", :source_buffer_empty, *a)
- src << "\xdc"; check_ec("A", "", :source_buffer_empty, *a)
- src << "\x00"; check_ec("A", "", :invalid_byte_sequence, *a)
-
- src << "\x00"; check_ec("A", "", :source_buffer_empty, *a)
- src << "\x00"; check_ec("A", "", :source_buffer_empty, *a)
- src << "\x00"; check_ec("A", "", :source_buffer_empty, *a)
- src << "B"; check_ec("AB", "", :source_buffer_empty, *a)
-
- src << "\x00"; check_ec("AB", "", :source_buffer_empty, *a)
- src << "\x00"; check_ec("AB", "", :source_buffer_empty, *a)
- src << "\x00"; check_ec("AB", "", :source_buffer_empty, *a)
- src << "C"; check_ec("ABC", "", :source_buffer_empty, *a)
- end
-
- def test_invalid_utf32le
- ec = Encoding::Converter.new("UTF-32LE", "UTF-8")
- a = ["", src="", ec, nil, 50, :partial_input=>true]
- src << "A"; check_ec("", "", :source_buffer_empty, *a)
- src << "\x00"; check_ec("", "", :source_buffer_empty, *a)
- src << "\x00"; check_ec("", "", :source_buffer_empty, *a)
- src << "\x00"; check_ec("A", "", :source_buffer_empty, *a)
-
- src << "\x00"; check_ec("A", "", :source_buffer_empty, *a)
- src << "\xdc"; check_ec("A", "", :source_buffer_empty, *a)
- src << "\x00"; check_ec("A", "", :source_buffer_empty, *a)
- src << "\x00"; check_ec("A", "", :invalid_byte_sequence, *a)
-
- src << "B"; check_ec("A", "", :source_buffer_empty, *a)
- src << "\x00"; check_ec("A", "", :source_buffer_empty, *a)
- src << "\x00"; check_ec("A", "", :source_buffer_empty, *a)
- src << "\x00"; check_ec("AB", "", :source_buffer_empty, *a)
-
- src << "C"; check_ec("AB", "", :source_buffer_empty, *a)
- src << "\x00"; check_ec("AB", "", :source_buffer_empty, *a)
- src << "\x00"; check_ec("AB", "", :source_buffer_empty, *a)
- src << "\x00"; check_ec("ABC", "", :source_buffer_empty, *a)
- end
-
- def test_errors
- ec = Encoding::Converter.new("UTF-16BE", "EUC-JP")
- a = ["", "\xFF\xFE\x00A\xDC\x00\x00B", ec, nil, 10]
- check_ec("", "\x00A\xDC\x00\x00B", :undefined_conversion, *a)
- check_ec("A", "\x00B", :invalid_byte_sequence, *a) # \xDC\x00 is invalid as UTF-16BE
- check_ec("AB", "", :finished, *a)
- end
-
- def test_errors2
- ec = Encoding::Converter.new("UTF-16BE", "EUC-JP")
- a = ["", "\xFF\xFE\x00A\xDC\x00\x00B", ec, nil, 10, :after_output=>true]
- check_ec("", "\x00A\xDC\x00\x00B", :undefined_conversion, *a)
- check_ec("A", "\xDC\x00\x00B", :after_output, *a)
- check_ec("A", "\x00B", :invalid_byte_sequence, *a)
- check_ec("AB", "", :after_output, *a)
- check_ec("AB", "", :finished, *a)
- end
-
- def test_universal_newline
- ec = Encoding::Converter.new("UTF-8", "EUC-JP", universal_newline: true)
- a = ["", src="", ec, nil, 50, :partial_input=>true]
- src << "abc\r\ndef"; check_ec("abc\ndef", "", :source_buffer_empty, *a)
- src << "ghi\njkl"; check_ec("abc\ndefghi\njkl", "", :source_buffer_empty, *a)
- src << "mno\rpqr"; check_ec("abc\ndefghi\njklmno\npqr", "", :source_buffer_empty, *a)
- src << "stu\r"; check_ec("abc\ndefghi\njklmno\npqrstu\n", "", :source_buffer_empty, *a)
- src << "\nvwx"; check_ec("abc\ndefghi\njklmno\npqrstu\nvwx", "", :source_buffer_empty, *a)
- src << "\nyz"; check_ec("abc\ndefghi\njklmno\npqrstu\nvwx\nyz", "", :source_buffer_empty, *a)
- end
-
- def test_universal_newline2
- ec = Encoding::Converter.new("", "", universal_newline: true)
- a = ["", src="", ec, nil, 50, :partial_input=>true]
- src << "abc\r\ndef"; check_ec("abc\ndef", "", :source_buffer_empty, *a)
- src << "ghi\njkl"; check_ec("abc\ndefghi\njkl", "", :source_buffer_empty, *a)
- src << "mno\rpqr"; check_ec("abc\ndefghi\njklmno\npqr", "", :source_buffer_empty, *a)
- src << "stu\r"; check_ec("abc\ndefghi\njklmno\npqrstu\n", "", :source_buffer_empty, *a)
- src << "\nvwx"; check_ec("abc\ndefghi\njklmno\npqrstu\nvwx", "", :source_buffer_empty, *a)
- src << "\nyz"; check_ec("abc\ndefghi\njklmno\npqrstu\nvwx\nyz", "", :source_buffer_empty, *a)
- end
-
- def test_crlf_newline
- ec = Encoding::Converter.new("UTF-8", "EUC-JP", crlf_newline: true)
- assert_econv("abc\r\ndef", :finished, 50, ec, "abc\ndef", "")
- end
-
- def test_crlf_newline2
- ec = Encoding::Converter.new("", "", crlf_newline: true)
- assert_econv("abc\r\ndef", :finished, 50, ec, "abc\ndef", "")
- end
-
- def test_cr_newline
- ec = Encoding::Converter.new("UTF-8", "EUC-JP", cr_newline: true)
- assert_econv("abc\rdef", :finished, 50, ec, "abc\ndef", "")
- end
-
- def test_cr_newline2
- ec = Encoding::Converter.new("", "", cr_newline: true)
- assert_econv("abc\rdef", :finished, 50, ec, "abc\ndef", "")
- end
-
- def test_after_output
- ec = Encoding::Converter.new("UTF-8", "EUC-JP")
- a = ["", "abc\u{3042}def", ec, nil, 100, :after_output=>true]
- check_ec("a", "bc\u{3042}def", :after_output, *a)
- check_ec("ab", "c\u{3042}def", :after_output, *a)
- check_ec("abc", "\u{3042}def", :after_output, *a)
- check_ec("abc\xA4\xA2", "def", :after_output, *a)
- check_ec("abc\xA4\xA2d", "ef", :after_output, *a)
- check_ec("abc\xA4\xA2de", "f", :after_output, *a)
- check_ec("abc\xA4\xA2def", "", :after_output, *a)
- check_ec("abc\xA4\xA2def", "", :finished, *a)
- end
-
- def test_errinfo_invalid_euc_jp
- ec = Encoding::Converter.new("EUC-JP", "Shift_JIS")
- ec.primitive_convert(src="\xff", dst="", nil, 10)
- assert_errinfo(:invalid_byte_sequence, "EUC-JP", "Shift_JIS", "\xFF", "", ec)
- end
-
- def test_errinfo_invalid_euc_jp2
- ec = Encoding::Converter.new("EUC-JP", "ISO-8859-1")
- ec.primitive_convert(src="\xff", dst="", nil, 10)
- assert_errinfo(:invalid_byte_sequence, "EUC-JP", "UTF-8", "\xFF", "", ec)
- end
-
- def test_errinfo_undefined_hiragana
- ec = Encoding::Converter.new("EUC-JP", "ISO-8859-1")
- ec.primitive_convert(src="\xa4\xa2", dst="", nil, 10)
- assert_errinfo(:undefined_conversion, "UTF-8", "ISO-8859-1", "\xE3\x81\x82", "", ec)
- end
-
- def test_errinfo_invalid_partial_character
- ec = Encoding::Converter.new("EUC-JP", "ISO-8859-1")
- ec.primitive_convert(src="\xa4", dst="", nil, 10)
- assert_errinfo(:incomplete_input, "EUC-JP", "UTF-8", "\xA4", "", ec)
- end
-
- def test_errinfo_valid_partial_character
- ec = Encoding::Converter.new("EUC-JP", "ISO-8859-1")
- ec.primitive_convert(src="\xa4", dst="", nil, 10, :partial_input=>true)
- assert_errinfo(:source_buffer_empty, nil, nil, nil, nil, ec)
- end
-
- def test_errinfo_invalid_utf16be
- ec = Encoding::Converter.new("UTF-16BE", "UTF-8")
- ec.primitive_convert(src="\xd8\x00\x00@", dst="", nil, 10)
- assert_errinfo(:invalid_byte_sequence, "UTF-16BE", "UTF-8", "\xD8\x00", "\x00", ec)
- assert_equal("@", src)
- end
-
- def test_errinfo_invalid_utf16le
- ec = Encoding::Converter.new("UTF-16LE", "UTF-8")
- ec.primitive_convert(src="\x00\xd8@\x00", dst="", nil, 10)
- assert_errinfo(:invalid_byte_sequence, "UTF-16LE", "UTF-8", "\x00\xD8", "@\x00", ec)
- assert_equal("", src)
- end
-
- def test_output_iso2022jp
- ec = Encoding::Converter.new("EUC-JP", "ISO-2022-JP")
- ec.primitive_convert(src="\xa1\xa1", dst="", nil, 10, :partial_input=>true)
- assert_equal("\e$B!!".force_encoding("ISO-2022-JP"), dst)
- assert_equal(nil, ec.insert_output("???"))
- ec.primitive_convert("", dst, nil, 10, :partial_input=>true)
- assert_equal("\e$B!!\e(B???".force_encoding("ISO-2022-JP"), dst)
- ec.primitive_convert(src="\xa1\xa2", dst, nil, 10, :partial_input=>true)
- assert_equal("\e$B!!\e(B???\e$B!\"".force_encoding("ISO-2022-JP"), dst)
-
- assert_equal(nil, ec.insert_output("\xA1\xA1".force_encoding("EUC-JP")))
- ec.primitive_convert("", dst, nil, 10, :partial_input=>true)
- assert_equal("\e$B!!\e(B???\e$B!\"!!".force_encoding("ISO-2022-JP"), dst)
-
- ec.primitive_convert(src="\xa1\xa3", dst, nil, 10, :partial_input=>true)
- assert_equal("\e$B!!\e(B???\e$B!\"!!!\#".force_encoding("ISO-2022-JP"), dst)
-
- assert_equal(nil, ec.insert_output("\u3042"))
- ec.primitive_convert("", dst, nil, 10, :partial_input=>true)
- assert_equal("\e$B!!\e(B???\e$B!\"!!!\#$\"".force_encoding("ISO-2022-JP"), dst)
-
- assert_raise(Encoding::UndefinedConversionError) {
- ec.insert_output("\uFFFD")
- }
-
- assert_equal("\e$B!!\e(B???\e$B!\"!!!\#$\"".force_encoding("ISO-2022-JP"), dst)
-
- ec.primitive_convert("", dst, nil, 10)
- assert_equal("\e$B!!\e(B???\e$B!\"!!!\#$\"\e(B".force_encoding("ISO-2022-JP"), dst)
- end
-
- def test_exc_invalid
- err = assert_raise(Encoding::InvalidByteSequenceError) {
- "abc\xa4def".encode("ISO-8859-1", "EUC-JP")
- }
- assert_equal("EUC-JP", err.source_encoding_name)
- assert_equal("UTF-8", err.destination_encoding_name)
- assert_equal(Encoding::EUC_JP, err.source_encoding)
- assert_equal(Encoding::UTF_8, err.destination_encoding)
- assert_equal("\xA4".force_encoding("ASCII-8BIT"), err.error_bytes)
- assert_equal("d", err.readagain_bytes)
- assert_equal(false, err.incomplete_input?)
- end
-
- def test_exc_incomplete
- err = assert_raise(Encoding::InvalidByteSequenceError) {
- "abc\xa4".encode("ISO-8859-1", "EUC-JP")
- }
- assert_equal("EUC-JP", err.source_encoding_name)
- assert_equal("UTF-8", err.destination_encoding_name)
- assert_equal(Encoding::EUC_JP, err.source_encoding)
- assert_equal(Encoding::UTF_8, err.destination_encoding)
- assert_equal("\xA4".force_encoding("ASCII-8BIT"), err.error_bytes)
- assert_equal(nil, err.readagain_bytes)
- assert_equal(true, err.incomplete_input?)
- end
-
- def test_exc_undef
- err = assert_raise(Encoding::UndefinedConversionError) {
- "abc\xa4\xa2def".encode("ISO-8859-1", "EUC-JP")
- }
- assert_equal("UTF-8", err.source_encoding_name)
- assert_equal("ISO-8859-1", err.destination_encoding_name)
- assert_equal(Encoding::UTF_8, err.source_encoding)
- assert_equal(Encoding::ISO_8859_1, err.destination_encoding)
- assert_equal("\u{3042}", err.error_char)
- end
-
- def test_putback
- ec = Encoding::Converter.new("EUC-JP", "ISO-8859-1")
- ret = ec.primitive_convert(src="abc\xa1def", dst="", nil, 10)
- assert_equal(:invalid_byte_sequence, ret)
- assert_equal(["abc", "ef"], [dst, src])
- src = ec.putback + src
- assert_equal(["abc", "def"], [dst, src])
- ret = ec.primitive_convert(src, dst, nil, 10)
- assert_equal(:finished, ret)
- assert_equal(["abcdef", ""], [dst, src])
- end
-
- def test_putback2
- ec = Encoding::Converter.new("utf-16le", "euc-jp")
- ret = ec.primitive_convert(src="\x00\xd8\x21\x00", dst="", nil, nil)
- assert_equal(:invalid_byte_sequence, ret)
- assert_equal("\x00".force_encoding("utf-16le"), ec.putback(1))
- assert_equal("\x21".force_encoding("utf-16le"), ec.putback(1))
- assert_equal("", ec.putback(1))
- end
-
- def test_invalid_replace
- ec = Encoding::Converter.new("UTF-8", "EUC-JP", invalid: :replace)
- ret = ec.primitive_convert(src="abc\x80def", dst="", nil, 100)
- assert_equal(:finished, ret)
- assert_equal("", src)
- assert_equal("abc?def", dst)
- end
-
- def test_invalid_ignore
- ec = Encoding::Converter.new("UTF-8", "EUC-JP", :invalid => :replace, :replace => "")
- ret = ec.primitive_convert(src="abc\x80def", dst="", nil, 100)
- assert_equal(:finished, ret)
- assert_equal("", src)
- assert_equal("abcdef", dst)
- end
-
- def test_undef_replace
- ec = Encoding::Converter.new("UTF-8", "EUC-JP", :undef => :replace)
- ret = ec.primitive_convert(src="abc\u{fffd}def", dst="", nil, 100)
- assert_equal(:finished, ret)
- assert_equal("", src)
- assert_equal("abc?def", dst)
- end
-
- def test_undef_ignore
- ec = Encoding::Converter.new("UTF-8", "EUC-JP", :undef => :replace, :replace => "")
- ret = ec.primitive_convert(src="abc\u{fffd}def", dst="", nil, 100)
- assert_equal(:finished, ret)
- assert_equal("", src)
- assert_equal("abcdef", dst)
- end
-
- def test_noconv
- ec = Encoding::Converter.new("", "")
- assert_equal(nil, ec.source_encoding)
- assert_equal(nil, ec.destination_encoding)
- assert_equal([:source_buffer_empty, nil, nil, nil, nil], ec.primitive_errinfo)
- a = ["", "abcdefg", ec, nil, 2]
- check_ec("ab", "cdefg", :destination_buffer_full, *a)
- check_ec("abcd", "efg", :destination_buffer_full, *a)
- check_ec("abcdef", "g", :destination_buffer_full, *a)
- check_ec("abcdefg", "", :finished, *a)
- end
-
- def test_noconv_partial
- ec = Encoding::Converter.new("", "")
- a = ["", "abcdefg", ec, nil, 2, :partial_input=>true]
- check_ec("ab", "cdefg", :destination_buffer_full, *a)
- check_ec("abcd", "efg", :destination_buffer_full, *a)
- check_ec("abcdef", "g", :destination_buffer_full, *a)
- check_ec("abcdefg", "", :source_buffer_empty, *a)
- end
-
- def test_noconv_after_output
- ec = Encoding::Converter.new("", "")
- a = ["", "abcdefg", ec, nil, 2, :after_output=>true]
- check_ec("a", "bcdefg", :after_output, *a)
- check_ec("ab", "cdefg", :after_output, *a)
- check_ec("abc", "defg", :after_output, *a)
- check_ec("abcd", "efg", :after_output, *a)
- check_ec("abcde", "fg", :after_output, *a)
- check_ec("abcdef", "g", :after_output, *a)
- check_ec("abcdefg", "", :after_output, *a)
- check_ec("abcdefg", "", :finished, *a)
- end
-
- def test_noconv_insert_output
- ec = Encoding::Converter.new("", "")
- ec.insert_output("xyz")
- ret = ec.primitive_convert(src="abc", dst="", nil, 20)
- assert_equal(:finished, ret)
- assert_equal(["xyzabc", ""], [dst, src])
- end
-
- def test_convert
- ec = Encoding::Converter.new("utf-8", "euc-jp")
- assert_raise(Encoding::InvalidByteSequenceError) { ec.convert("a\x80") }
- assert_raise(Encoding::UndefinedConversionError) { ec.convert("\ufffd") }
- ret = ec.primitive_convert(nil, "", nil, nil)
- assert_equal(:finished, ret)
- assert_raise(ArgumentError) { ec.convert("a") }
- end
-
- def test_finish_iso2022jp
- ec = Encoding::Converter.new("utf-8", "iso-2022-jp")
- assert_equal("\e$B$\"".force_encoding("iso-2022-jp"), ec.convert("\u3042"))
- assert_equal("\e(B".force_encoding("iso-2022-jp"), ec.finish)
-
- end
-
- def test_finish_incomplete_error
- ec = Encoding::Converter.new("utf-8", "euc-jp")
- ec.convert("\xEF")
- assert_raise(Encoding::InvalidByteSequenceError) { ec.finish }
- end
-
- def test_last_error1
- ec = Encoding::Converter.new("sjis", "euc-jp")
- assert_equal(nil, ec.last_error)
- assert_equal(:incomplete_input, ec.primitive_convert(src="fo\x81", dst="", nil, nil))
- assert_kind_of(Encoding::InvalidByteSequenceError, ec.last_error)
- end
-
- def test_last_error2
- ec = Encoding::Converter.new("sjis", "euc-jp")
- assert_equal("fo", ec.convert(src="fo\x81"))
- assert_raise(Encoding::InvalidByteSequenceError) { ec.finish }
- assert_kind_of(Encoding::InvalidByteSequenceError, ec.last_error)
- end
-
- def test_us_ascii
- ec = Encoding::Converter.new("UTF-8", "US-ASCII")
- ec.primitive_convert(src="\u{3042}", dst="")
- err = ec.last_error
- assert_kind_of(Encoding::UndefinedConversionError, err)
- assert_equal("\u{3042}", err.error_char)
- end
-
- def test_88591
- ec = Encoding::Converter.new("UTF-8", "ISO-8859-1")
- ec.primitive_convert(src="\u{3042}", dst="")
- err = ec.last_error
- assert_kind_of(Encoding::UndefinedConversionError, err)
- assert_equal("\u{3042}", err.error_char)
- end
-
- def test_get_replacement
- ec = Encoding::Converter.new("euc-jp", "iso-8859-1")
- assert_equal("?", ec.replacement)
-
- ec = Encoding::Converter.new("euc-jp", "utf-8")
- assert_equal("\uFFFD", ec.replacement)
- end
-
- def test_set_replacement
- ec = Encoding::Converter.new("utf-8", "us-ascii", :undef => :replace)
- ec.replacement = "<undef>"
- assert_equal("a <undef> b", ec.convert("a \u3042 b"))
- end
-
- def test_econv_new_hash
- ec = Encoding::Converter.new("utf-8", "us-ascii", :undef => :replace)
- assert_equal("a ? b", ec.convert("a \u3042 b"))
- ec = Encoding::Converter.new("utf-8", "us-ascii", :undef => :replace, :replace => "X")
- assert_equal("a X b", ec.convert("a \u3042 b"))
- end
-
- def test_hex_charref
- ec = Encoding::Converter.new("UTF-8", "US-ASCII", Encoding::Converter::UNDEF_HEX_CHARREF)
- assert_equal("&#x3042;", ec.convert("\u3042"))
-
- ec = Encoding::Converter.new("UTF-8", "EUC-JP", Encoding::Converter::UNDEF_HEX_CHARREF)
- assert_equal("\xa4\xcf\xa4\xa1\xa4\xa4&#x2665;\xa1\xa3".force_encoding("euc-jp"),
- ec.convert("\u{306f 3041 3044 2665 3002}"))
-
- ec = Encoding::Converter.new("UTF-8", "ISO-2022-JP", Encoding::Converter::UNDEF_HEX_CHARREF)
- assert_equal("\e$B$O$!$$\e(B&#x2665;\e$B!#".force_encoding("ISO-2022-JP"),
- ec.convert("\u{306f 3041 3044 2665 3002}"))
- assert_equal("\e(B".force_encoding("ISO-2022-JP"),
- ec.finish)
-
- ec = Encoding::Converter.new("EUC-JP", "US-ASCII", Encoding::Converter::UNDEF_HEX_CHARREF)
- assert_equal("&#x4EA4;&#x63DB;&#x6CD5;&#x5247;: n&#xD7;m=m&#xD7;n".force_encoding("ISO-8859-1"),
- ec.convert("\xB8\xF2\xB4\xB9\xCB\xA1\xC2\xA7: n\xA1\xDFm=m\xA1\xDFn"))
-
- ec = Encoding::Converter.new("EUC-JP", "ISO-8859-1", Encoding::Converter::UNDEF_HEX_CHARREF)
- assert_equal("&#x4EA4;&#x63DB;&#x6CD5;&#x5247;: n\xD7m=m\xD7n".force_encoding("ISO-8859-1"),
- ec.convert("\xB8\xF2\xB4\xB9\xCB\xA1\xC2\xA7: n\xA1\xDFm=m\xA1\xDFn"))
-
- ec = Encoding::Converter.new("UTF-8", "US-ASCII", Encoding::Converter::UNDEF_HEX_CHARREF)
- assert_equal("&", ec.convert("&"))
- end
-
- def test_xml_escape_text
- ec = Encoding::Converter.new("", "amp_escape")
- assert_equal('&amp;<>"', ec.convert("&<>\""))
- assert_equal('', ec.finish)
-
- ec = Encoding::Converter.new("", "xml_text_escape")
- assert_equal('&amp;&lt;&gt;"', ec.convert("&<>\""))
- assert_equal('', ec.finish)
- end
-
- def test_xml_escape_attr_content
- ec = Encoding::Converter.new("", "xml_attr_content_escape")
- assert_equal('', ec.finish)
-
- ec = Encoding::Converter.new("", "xml_attr_content_escape")
- assert_equal('', ec.convert(""))
- assert_equal('', ec.finish)
-
- ec = Encoding::Converter.new("", "xml_attr_content_escape")
- assert_equal('&quot;', ec.convert('"'))
- assert_equal('', ec.finish)
-
- ec = Encoding::Converter.new("", "xml_attr_content_escape")
- assert_equal('&amp;&lt;&gt;&quot;', ec.convert("&<>\""))
- assert_equal('', ec.finish)
- end
-
- def test_xml_escape_attr_quote
- ec = Encoding::Converter.new("", "xml_attr_quote")
- assert_equal('""', ec.finish)
-
- ec = Encoding::Converter.new("", "xml_attr_quote")
- assert_equal('', ec.convert(""))
- assert_equal('""', ec.finish)
-
- ec = Encoding::Converter.new("", "xml_attr_quote")
- assert_equal('""', ec.convert('"'))
- assert_equal('"', ec.finish)
-
- ec = Encoding::Converter.new("", "xml_attr_quote")
- assert_equal('"&<>"', ec.convert("&<>\""))
- assert_equal('"', ec.finish)
- end
-
- def test_xml_escape_with_charref
- ec = Encoding::Converter.new("utf-8", "euc-jp", Encoding::Converter::XML_TEXT_DECORATOR|Encoding::Converter::UNDEF_HEX_CHARREF)
- assert_equal('&lt;&#x2665;&gt;&amp;"&#x2661;"', ec.convert("<\u2665>&\"\u2661\""))
- assert_equal('', ec.finish)
-
- ec = Encoding::Converter.new("utf-8", "euc-jp",
- Encoding::Converter::XML_ATTR_CONTENT_DECORATOR|
- Encoding::Converter::XML_ATTR_QUOTE_DECORATOR|
- Encoding::Converter::UNDEF_HEX_CHARREF)
- assert_equal('"&lt;&#x2665;&gt;&amp;&quot;&#x2661;&quot;', ec.convert("<\u2665>&\"\u2661\""))
- assert_equal('"', ec.finish)
-
- ec = Encoding::Converter.new("utf-8", "iso-2022-jp", Encoding::Converter::XML_TEXT_DECORATOR)
- assert_equal("&amp;\e$B$&\e(B&amp;".force_encoding("iso-2022-jp"), ec.convert("&\u3046&"))
- assert_equal('', ec.finish)
- end
-
- def test_xml_hasharg
- assert_equal("&amp;\e$B$&\e(B&#x2665;&amp;\"'".force_encoding("iso-2022-jp"),
- "&\u3046\u2665&\"'".encode("iso-2022-jp", xml: :text))
- assert_equal("\"&amp;\e$B$&\e(B&#x2661;&amp;&quot;'\"".force_encoding("iso-2022-jp"),
- "&\u3046\u2661&\"'".encode("iso-2022-jp", xml: :attr))
-
- assert_equal("&amp;\u3046\u2661&amp;\"'".force_encoding("utf-8"),
- "&\u3046\u2661&\"'".encode("utf-8", xml: :text))
- end
-
- def test_iso2022jp_invalid_replace
- assert_equal("?x".force_encoding("iso-2022-jp"),
- "\222\xA1x".encode("iso-2022-jp", "stateless-iso-2022-jp", :invalid => :replace))
- end
-
- def test_convpath
- eucjp = Encoding::EUC_JP
- utf8 = Encoding::UTF_8
- utf16be = Encoding::UTF_16BE
- utf16le = Encoding::UTF_16LE
- iso88591 = Encoding::ISO_8859_1
- iso2022jp = Encoding::ISO_2022_JP
- siso2022jp = Encoding::STATELESS_ISO_2022_JP
-
- assert_equal([], Encoding::Converter.new("", "").convpath)
- assert_equal([[eucjp, utf8], [utf8, iso88591]],
- Encoding::Converter.new(eucjp, iso88591).convpath)
- assert_equal([[eucjp, siso2022jp], [siso2022jp, iso2022jp]],
- Encoding::Converter.new(eucjp, iso2022jp).convpath)
- assert_equal([[iso2022jp, siso2022jp],
- [siso2022jp, eucjp],
- [eucjp, utf8],
- [utf8, iso88591]],
- Encoding::Converter.new(iso2022jp, iso88591).convpath)
- assert_equal(["universal_newline", [utf8, utf16be]],
- Encoding::Converter.new(utf8, utf16be, universal_newline: true).convpath)
- assert_equal([[utf16be, utf8], "universal_newline"],
- Encoding::Converter.new(utf16be, utf8, universal_newline: true).convpath)
- assert_equal([[utf16be, utf8], "universal_newline", [utf8, utf16le]],
- Encoding::Converter.new(utf16be, utf16le, universal_newline: true).convpath)
- end
-
- def test_search_convpath
- eucjp = Encoding::EUC_JP
- utf8 = Encoding::UTF_8
- utf32be = Encoding::UTF_32BE
- iso88591 = Encoding::ISO_8859_1
- assert_equal([[iso88591,utf8], [utf8,eucjp]],
- Encoding::Converter.search_convpath("ISO-8859-1", "EUC-JP"))
- assert_equal([[iso88591,utf8], [utf8,eucjp]],
- Encoding::Converter.search_convpath(iso88591, eucjp))
- assert_equal([[iso88591,utf8], [utf8,eucjp], "universal_newline"],
- Encoding::Converter.search_convpath("ISO-8859-1", "EUC-JP", universal_newline: true))
- assert_equal([[iso88591,utf8], "universal_newline", [utf8,utf32be]],
- Encoding::Converter.search_convpath("ISO-8859-1", "UTF-32BE", universal_newline: true))
- end
-
- def test_invalid_replace
- assert_raise(ArgumentError) {
- broken = "\x80".force_encoding("euc-jp")
- "".encode("euc-jp", :undef => :replace, :replace => broken)
- }
- end
-
- def test_utf8_mac
- assert_equal("\u{fb4d}", "\u05DB\u05BF".encode("UTF-8", "UTF8-MAC"))
- assert_equal("\u{1ff7}", "\u03C9\u0345\u0342".encode("UTF-8", "UTF8-MAC"))
-
- assert_equal("\u05DB\u05BF", "\u{fb4d}".encode("UTF8-MAC").force_encoding("UTF-8"))
- assert_equal("\u03C9\u0345\u0342", "\u{1ff7}".encode("UTF8-MAC").force_encoding("UTF-8"))
- end
-end
diff --git a/test/ruby/test_encoding.rb b/test/ruby/test_encoding.rb
deleted file mode 100644
index 6edad2418f..0000000000
--- a/test/ruby/test_encoding.rb
+++ /dev/null
@@ -1,71 +0,0 @@
-require 'test/unit'
-
-class TestEncoding < Test::Unit::TestCase
-
- # Test basic encoding methods: list, find, name
- def test_encoding
- encodings = Encoding.list
- assert_equal(encodings.empty?, false)
-
- encodings.each do |e|
- assert_equal(e, Encoding.find(e.name))
- assert_equal(e, Encoding.find(e.name.upcase))
- assert_equal(e, Encoding.find(e.name.capitalize))
- assert_equal(e, Encoding.find(e.name.downcase))
- end
- end
-
- def test_enc_names
- aliases = Encoding.aliases
- aliases.each do |a, en|
- e = Encoding.find(a)
- assert_equal(e.name, en)
- assert(e.names.include?(a))
- end
- end
-
- # Test that Encoding objects can't be copied
- # And that they can be compared by object_id
- def test_singleton
- encodings = Encoding.list
- encodings.each do |e|
- assert_raise(TypeError) { e.dup }
- assert_raise(TypeError) { e.clone }
- assert_equal(e.object_id, Marshal.load(Marshal.dump(e)).object_id)
- end
- end
-
- def test_find
- assert_raise(ArgumentError) { Encoding.find("foobarbazqux") }
- end
-
- def test_dummy_p
- assert_equal(true, Encoding::ISO_2022_JP.dummy?)
- assert_equal(false, Encoding::UTF_8.dummy?)
- end
-
- def test_name_list
- assert_instance_of(Array, Encoding.name_list)
- Encoding.name_list.each do |x|
- assert_instance_of(String, x)
- end
- end
-
- def test_aliases
- assert_instance_of(Hash, Encoding.aliases)
- Encoding.aliases.each do |k, v|
- assert(Encoding.name_list.include?(k))
- assert(Encoding.name_list.include?(v))
- assert_instance_of(String, k)
- assert_instance_of(String, v)
- end
- end
-
- def test_marshal
- str = "".force_encoding("EUC-JP")
- str2 = Marshal.load(Marshal.dump(str))
- assert_equal(str, str2)
- str2 = Marshal.load(Marshal.dump(str2))
- assert_equal(str, str2, '[ruby-dev:38596]')
- end
-end
diff --git a/test/ruby/test_enum.rb b/test/ruby/test_enum.rb
index 660c59383a..e541d566c0 100644
--- a/test/ruby/test_enum.rb
+++ b/test/ruby/test_enum.rb
@@ -1,5 +1,4 @@
require 'test/unit'
-require 'continuation'
class TestEnumerable < Test::Unit::TestCase
def setup
@@ -48,7 +47,6 @@ class TestEnumerable < Test::Unit::TestCase
assert_equal(1, @obj.find_index {|x| x % 2 == 0 })
assert_equal(nil, @obj.find_index {|x| false })
assert_raise(ArgumentError) { @obj.find_index(0, 1) }
- assert_equal(1, @obj.find_index(2) {|x| x == 1 })
end
def test_find_all
@@ -197,33 +195,11 @@ class TestEnumerable < Test::Unit::TestCase
assert_equal({"cat"=>0, "wombat"=>2, "dog"=>1}, hash)
end
- def test_each_with_object
- obj = [0, 1]
- ret = (1..10).each_with_object(obj) {|i, memo|
- memo[0] += i
- memo[1] *= i
- }
- assert_same(obj, ret)
- assert_equal([55, 3628800], ret)
- end
-
def test_zip
assert_equal([[1,1],[2,2],[3,3],[1,1],[2,2]], @obj.zip(@obj))
a = []
@obj.zip([:a, :b, :c]) {|x,y| a << [x, y] }
assert_equal([[1,:a],[2,:b],[3,:c],[1,nil],[2,nil]], a)
-
- a = []
- @obj.zip({a: "A", b: "B", c: "C"}) {|x,y| a << [x, y] }
- assert_equal([[1,[:a,"A"]],[2,[:b,"B"]],[3,[:c,"C"]],[1,nil],[2,nil]], a)
-
- ary = Object.new
- def ary.to_a; [1, 2]; end
- assert_raise(NoMethodError){ %w(a b).zip(ary) }
- def ary.each; [3, 4].each{|e|yield e}; end
- assert_equal([[1, 3], [2, 4], [3, nil], [1, nil], [2, nil]], @obj.zip(ary))
- def ary.to_ary; [5, 6]; end
- assert_equal([[1, 5], [2, 6], [3, nil], [1, nil], [2, nil]], @obj.zip(ary))
end
def test_take
@@ -279,40 +255,4 @@ class TestEnumerable < Test::Unit::TestCase
c.call
end
end
-
- def test_reverse_each
- assert_equal([2,1,3,2,1], @obj.reverse_each.to_a)
- end
-
- def test_join
- ofs = $,
- assert_equal("abc", ("a".."c").join(""))
- assert_equal("a-b-c", ("a".."c").join("-"))
- $, = "-"
- assert_equal("a-b-c", ("a".."c").join())
- $, = nil
- assert_equal("abc", ("a".."c").join())
- assert_equal("123", (1..3).join())
- assert_raise(TypeError, '[ruby-core:24172]') {("a".."c").join(1)}
- class << (e = Object.new.extend(Enumerable))
- def each
- yield self
- end
- end
- assert_equal("[...]", e.join(""), '[ruby-core:24150]')
- assert_equal("[...]", [e].join(""), '[ruby-core:24150]')
- e = Class.new {
- include Enumerable
- def initialize(*args)
- @e = args
- end
- def each
- @e.each {|e| yield e}
- end
- }
- e = e.new(1, e.new(2, e.new(3, e.new(4, 5))))
- assert_equal("1:2:3:4:5", e.join(':'), '[ruby-core:24196]')
- ensure
- $, = ofs
- end
end
diff --git a/test/ruby/test_enumerator.rb b/test/ruby/test_enumerator.rb
index 8a2417c5d5..2625791129 100644
--- a/test/ruby/test_enumerator.rb
+++ b/test/ruby/test_enumerator.rb
@@ -20,8 +20,8 @@ class TestEnumerator < Test::Unit::TestCase
def test_iterators
assert_equal [0, 1, 2], enum_test(3.times)
- assert_equal [:x, :y, :z], enum_test([:x, :y, :z].each)
- assert_equal [[:x, 1], [:y, 2]], enum_test({:x=>1, :y=>2})
+ assert_equal ["x", "y", "z"], enum_test(["z", "y", "x"].each)
+ assert_equal [["x", 1], ["y", 2]], enum_test({"y"=>2, "x"=>1})
end
## Enumerator as Iterator
@@ -57,20 +57,15 @@ class TestEnumerator < Test::Unit::TestCase
def test_initialize
assert_equal([1, 2, 3], @obj.to_enum(:foo, 1, 2, 3).to_a)
- assert_equal([1, 2, 3], Enumerator.new(@obj, :foo, 1, 2, 3).to_a)
- assert_equal([1, 2, 3], Enumerator.new { |y| i = 0; loop { y << (i += 1) } }.take(3))
- assert_raise(ArgumentError) { Enumerator.new }
+ assert_equal([1, 2, 3], Enumerable::Enumerator.new(@obj, :foo, 1, 2, 3).to_a)
+ assert_raise(ArgumentError) { Enumerable::Enumerator.new }
end
def test_initialize_copy
assert_equal([1, 2, 3], @obj.to_enum(:foo, 1, 2, 3).dup.to_a)
e = @obj.to_enum(:foo, 1, 2, 3)
assert_nothing_raised { assert_equal(1, e.next) }
- assert_raise(TypeError) { e.dup }
-
- e = Enumerator.new { |y| i = 0; loop { y << (i += 1) } }.dup
- assert_nothing_raised { assert_equal(1, e.next) }
- assert_raise(TypeError) { e.dup }
+ #assert_raise(TypeError) { e.dup }
end
def test_gc
@@ -94,30 +89,6 @@ class TestEnumerator < Test::Unit::TestCase
def test_with_index
assert_equal([[1,0],[2,1],[3,2]], @obj.to_enum(:foo, 1, 2, 3).with_index.to_a)
- assert_equal([[1,5],[2,6],[3,7]], @obj.to_enum(:foo, 1, 2, 3).with_index(5).to_a)
- end
-
- def test_with_object
- obj = [0, 1]
- ret = (1..10).each.with_object(obj) {|i, memo|
- memo[0] += i
- memo[1] *= i
- }
- assert_same(obj, ret)
- assert_equal([55, 3628800], ret)
-
- a = [2,5,2,1,5,3,4,2,1,0]
- obj = {}
- ret = a.delete_if.with_object(obj) {|i, seen|
- if seen.key?(i)
- true
- else
- seen[i] = true
- false
- end
- }
- assert_same(obj, ret)
- assert_equal([2, 5, 1, 3, 4, 0], a)
end
def test_next_rewind
diff --git a/test/ruby/test_env.rb b/test/ruby/test_env.rb
index 65fd79fa8f..3a65f91fa4 100644
--- a/test/ruby/test_env.rb
+++ b/test/ruby/test_env.rb
@@ -1,21 +1,16 @@
require 'test/unit'
class TestEnv < Test::Unit::TestCase
- IGNORE_CASE = /bccwin|mswin|mingw/ =~ RUBY_PLATFORM
- PATH_ENV = "PATH"
+ IGNORE_CASE = /djgpp|bccwin|mswin|mingw/ =~ RUBY_PLATFORM
def setup
- @verbose = $VERBOSE
- $VERBOSE = nil
- @backup = ENV.to_hash
- ENV.delete('test')
- ENV.delete('TEST')
+ @backup = ENV.delete('test')
+ @BACKUP = ENV.delete('TEST')
end
def teardown
- $VERBOSE = @verbose
- ENV.clear
- @backup.each {|k, v| ENV[k] = v }
+ ENV['test'] = @backup if @backup
+ ENV['TEST'] = @BACKUP if @BACKUP
end
def test_bracket
@@ -36,13 +31,13 @@ class TestEnv < Test::Unit::TestCase
assert_equal('foo', ENV['test'])
end
- assert_raise(TypeError) {
+ assert_raises(TypeError) {
tmp = ENV[1]
}
- assert_raise(TypeError) {
+ assert_raises(TypeError) {
ENV[1] = 'foo'
}
- assert_raise(TypeError) {
+ assert_raises(TypeError) {
ENV['test'] = 0
}
end
@@ -62,290 +57,26 @@ class TestEnv < Test::Unit::TestCase
assert_equal(true, ENV.has_value?(val.upcase))
end
- def test_key
+ def test_index
val = 'a'
val.succ! while ENV.has_value?(val) && ENV.has_value?(val.upcase)
ENV['test'] = val[0...-1]
- assert_nil(ENV.key(val))
- assert_nil(ENV.key(val.upcase))
+ assert_nil(ENV.index(val))
+ assert_nil(ENV.index(val.upcase))
ENV['test'] = val
if IGNORE_CASE
- assert_equal('TEST', ENV.key(val).upcase)
+ assert_equal('TEST', ENV.index(val).upcase)
else
- assert_equal('test', ENV.key(val))
+ assert_equal('test', ENV.index(val))
end
- assert_nil(ENV.key(val.upcase))
+ assert_nil(ENV.index(val.upcase))
ENV['test'] = val.upcase
- assert_nil(ENV.key(val))
+ assert_nil(ENV.index(val))
if IGNORE_CASE
- assert_equal('TEST', ENV.key(val.upcase).upcase)
+ assert_equal('TEST', ENV.index(val.upcase).upcase)
else
- assert_equal('test', ENV.key(val.upcase))
+ assert_equal('test', ENV.index(val.upcase))
end
end
-
- def test_delete
- assert_raise(ArgumentError) { ENV.delete("foo\0bar") }
- assert_nil(ENV.delete("TEST"))
- assert_nothing_raised { ENV.delete(PATH_ENV) }
- end
-
- def test_getenv
- assert_raise(ArgumentError) { ENV["foo\0bar"] }
- ENV[PATH_ENV] = ""
- assert_equal("", ENV[PATH_ENV])
- end
-
- def test_fetch
- ENV["test"] = "foo"
- assert_equal("foo", ENV.fetch("test"))
- ENV.delete("test")
- assert_raise(KeyError) { ENV.fetch("test") }
- assert_equal("foo", ENV.fetch("test", "foo"))
- assert_equal("bar", ENV.fetch("test") { "bar" })
- assert_equal("bar", ENV.fetch("test", "foo") { "bar" })
- assert_raise(ArgumentError) { ENV.fetch("foo\0bar") }
- assert_nothing_raised { ENV.fetch(PATH_ENV, "foo") }
- ENV[PATH_ENV] = ""
- assert_equal("", ENV.fetch(PATH_ENV))
- end
-
- def test_aset
- assert_raise(SecurityError) do
- Thread.new do
- $SAFE = 4
- ENV["test"] = "foo"
- end.join
- end
- assert_nothing_raised { ENV["test"] = nil }
- assert_equal(nil, ENV["test"])
- assert_raise(ArgumentError) { ENV["foo\0bar"] = "test" }
- assert_raise(ArgumentError) { ENV["test"] = "foo\0bar" }
- ENV[PATH_ENV] = "/tmp/".taint
- assert_equal("/tmp/", ENV[PATH_ENV])
- end
-
- def test_keys
- a = nil
- assert_block { a = ENV.keys }
- assert_kind_of(Array, a)
- a.each {|k| assert_kind_of(String, k) }
- end
-
- def test_each_key
- ENV.each_key {|k| assert_kind_of(String, k) }
- end
-
- def test_values
- a = nil
- assert_block { a = ENV.values }
- assert_kind_of(Array, a)
- a.each {|k| assert_kind_of(String, k) }
- end
-
- def test_each_value
- ENV.each_value {|k| assert_kind_of(String, k) }
- end
-
- def test_each_pair
- ENV.each_pair do |k, v|
- assert_kind_of(String, k)
- assert_kind_of(String, v)
- end
- end
-
- def test_reject_bang
- h1 = {}
- ENV.each_pair {|k, v| h1[k] = v }
- ENV["test"] = "foo"
- ENV.reject! {|k, v| IGNORE_CASE ? k.upcase == "TEST" : k == "test" }
- h2 = {}
- ENV.each_pair {|k, v| h2[k] = v }
- assert_equal(h1, h2)
-
- h1 = {}
- ENV.each_pair {|k, v| h1[k] = v }
- ENV["test"] = "foo"
- ENV.delete_if {|k, v| IGNORE_CASE ? k.upcase == "TEST" : k == "test" }
- h2 = {}
- ENV.each_pair {|k, v| h2[k] = v }
- assert_equal(h1, h2)
- end
-
- def test_values_at
- ENV["test"] = "foo"
- assert_equal(["foo", "foo"], ENV.values_at("test", "test"))
- end
-
- def test_select
- ENV["test"] = "foo"
- h = ENV.select {|k| IGNORE_CASE ? k.upcase == "TEST" : k == "test" }
- assert_equal(1, h.size)
- k = h.keys.first
- v = h.values.first
- if IGNORE_CASE
- assert_equal("TEST", k.upcase)
- assert_equal("FOO", v.upcase)
- else
- assert_equal("test", k)
- assert_equal("foo", v)
- end
- end
-
- def test_clear
- ENV.clear
- assert_equal(0, ENV.size)
- end
-
- def test_to_s
- assert_equal("ENV", ENV.to_s)
- end
-
- def test_inspect
- ENV.clear
- ENV["foo"] = "bar"
- ENV["baz"] = "qux"
- s = ENV.inspect
- if IGNORE_CASE
- s = s.upcase
- assert(s == '{"FOO"=>"BAR", "BAZ"=>"QUX"}' || s == '{"BAZ"=>"QUX", "FOO"=>"BAR"}')
- else
- assert(s == '{"foo"=>"bar", "baz"=>"qux"}' || s == '{"baz"=>"qux", "foo"=>"bar"}')
- end
- end
-
- def test_to_a
- ENV.clear
- ENV["foo"] = "bar"
- ENV["baz"] = "qux"
- a = ENV.to_a
- assert_equal(2, a.size)
- if IGNORE_CASE
- a = a.map {|x| x.map {|y| y.upcase } }
- assert(a == [%w(FOO BAR), %w(BAZ QUX)] || a == [%w(BAZ QUX), %w(FOO BAR)])
- else
- assert(a == [%w(foo bar), %w(baz qux)] || a == [%w(baz qux), %w(foo bar)])
- end
- end
-
- def test_rehash
- assert_nil(ENV.rehash)
- end
-
- def test_size
- s = ENV.size
- ENV["test"] = "foo"
- assert_equal(s + 1, ENV.size)
- end
-
- def test_empty_p
- ENV.clear
- assert(ENV.empty?)
- ENV["test"] = "foo"
- assert(!ENV.empty?)
- end
-
- def test_has_key
- assert(!ENV.has_key?("test"))
- ENV["test"] = "foo"
- assert(ENV.has_key?("test"))
- assert_raise(ArgumentError) { ENV.has_key?("foo\0bar") }
- end
-
- def test_assoc
- assert_nil(ENV.assoc("test"))
- ENV["test"] = "foo"
- k, v = ENV.assoc("test")
- if IGNORE_CASE
- assert_equal("TEST", k.upcase)
- assert_equal("FOO", v.upcase)
- else
- assert_equal("test", k)
- assert_equal("foo", v)
- end
- assert_raise(ArgumentError) { ENV.assoc("foo\0bar") }
- end
-
- def test_has_value2
- ENV.clear
- assert(!ENV.has_value?("foo"))
- ENV["test"] = "foo"
- assert(ENV.has_value?("foo"))
- end
-
- def test_rassoc
- ENV.clear
- assert_nil(ENV.rassoc("foo"))
- ENV["foo"] = "bar"
- ENV["test"] = "foo"
- ENV["baz"] = "qux"
- k, v = ENV.rassoc("foo")
- if IGNORE_CASE
- assert_equal("TEST", k.upcase)
- assert_equal("FOO", v.upcase)
- else
- assert_equal("test", k)
- assert_equal("foo", v)
- end
- end
-
- def test_to_hash
- h = {}
- ENV.each {|k, v| h[k] = v }
- assert_equal(h, ENV.to_hash)
- end
-
- def test_reject
- h1 = {}
- ENV.each_pair {|k, v| h1[k] = v }
- ENV["test"] = "foo"
- h2 = ENV.reject {|k, v| IGNORE_CASE ? k.upcase == "TEST" : k == "test" }
- assert_equal(h1, h2)
- end
-
- def check(as, bs)
- if IGNORE_CASE
- as = as.map {|xs| xs.map {|x| x.upcase } }
- bs = bs.map {|xs| xs.map {|x| x.upcase } }
- end
- assert_equal(as.sort, bs.sort)
- end
-
- def test_shift
- ENV.clear
- ENV["foo"] = "bar"
- ENV["baz"] = "qux"
- a = ENV.shift
- b = ENV.shift
- check([a, b], [%w(foo bar), %w(baz qux)])
- assert_nil(ENV.shift)
- end
-
- def test_invert
- ENV.clear
- ENV["foo"] = "bar"
- ENV["baz"] = "qux"
- check(ENV.invert.to_a, [%w(bar foo), %w(qux baz)])
- end
-
- def test_replace
- ENV["foo"] = "xxx"
- ENV.replace({"foo"=>"bar", "baz"=>"qux"})
- check(ENV.to_hash.to_a, [%w(foo bar), %w(baz qux)])
- end
-
- def test_update
- ENV.clear
- ENV["foo"] = "bar"
- ENV["baz"] = "qux"
- ENV.update({"baz"=>"quux","a"=>"b"})
- check(ENV.to_hash.to_a, [%w(foo bar), %w(baz quux), %w(a b)])
-
- ENV.clear
- ENV["foo"] = "bar"
- ENV["baz"] = "qux"
- ENV.update({"baz"=>"quux","a"=>"b"}) {|k, v1, v2| v1 ? k + "_" + v1 + "_" + v2 : v2 }
- check(ENV.to_hash.to_a, [%w(foo bar), %w(baz baz_qux_quux), %w(a b)])
- end
end
diff --git a/test/ruby/test_eval.rb b/test/ruby/test_eval.rb
index 6dd40bed84..6b3fea7bb4 100644
--- a/test/ruby/test_eval.rb
+++ b/test/ruby/test_eval.rb
@@ -1,213 +1,7 @@
require 'test/unit'
-require_relative 'envutil'
class TestEval < Test::Unit::TestCase
-
- @ivar = 12
- @@cvar = 13
- $gvar__eval = 14
- Const = 15
-
- def ruby(*args)
- args = ['-e', '$>.write($<.read)'] if args.empty?
- ruby = EnvUtil.rubybin
- f = IO.popen([ruby] + args, 'r+')
- yield(f)
- ensure
- f.close unless !f || f.closed?
- end
-
- def test_eval_basic
- assert_equal nil, eval("nil")
- assert_equal true, eval("true")
- assert_equal false, eval("false")
- assert_equal self, eval("self")
- assert_equal 1, eval("1")
- assert_equal :sym, eval(":sym")
-
- assert_equal 11, eval("11")
- @ivar = 12
- assert_equal 12, eval("@ivar")
- assert_equal 13, eval("@@cvar")
- assert_equal 14, eval("$gvar__eval")
- assert_equal 15, eval("Const")
-
- assert_equal 16, eval("7 + 9")
- assert_equal 17, eval("17.to_i")
- assert_equal "18", eval(%q("18"))
- assert_equal "19", eval(%q("1#{9}"))
-
- 1.times {
- assert_equal 12, eval("@ivar")
- assert_equal 13, eval("@@cvar")
- assert_equal 14, eval("$gvar__eval")
- assert_equal 15, eval("Const")
- }
- end
-
- def test_eval_binding_basic
- assert_equal nil, eval("nil", binding())
- assert_equal true, eval("true", binding())
- assert_equal false, eval("false", binding())
- assert_equal self, eval("self", binding())
- assert_equal 1, eval("1", binding())
- assert_equal :sym, eval(":sym", binding())
-
- assert_equal 11, eval("11", binding())
- @ivar = 12
- assert_equal 12, eval("@ivar", binding())
- assert_equal 13, eval("@@cvar", binding())
- assert_equal 14, eval("$gvar__eval", binding())
- assert_equal 15, eval("Const", binding())
-
- assert_equal 16, eval("7 + 9", binding())
- assert_equal 17, eval("17.to_i", binding())
- assert_equal "18", eval(%q("18"), binding())
- assert_equal "19", eval(%q("1#{9}"), binding())
-
- 1.times {
- assert_equal 12, eval("@ivar")
- assert_equal 13, eval("@@cvar")
- assert_equal 14, eval("$gvar__eval")
- assert_equal 15, eval("Const")
- }
- end
-
- def test_module_eval_string_basic
- c = self.class
- assert_equal nil, c.module_eval("nil")
- assert_equal true, c.module_eval("true")
- assert_equal false, c.module_eval("false")
- assert_equal c, c.module_eval("self")
- assert_equal :sym, c.module_eval(":sym")
- assert_equal 11, c.module_eval("11")
- @ivar = 12
- assert_equal 12, c.module_eval("@ivar")
- assert_equal 13, c.module_eval("@@cvar")
- assert_equal 14, c.module_eval("$gvar__eval")
- assert_equal 15, c.module_eval("Const")
- assert_equal 16, c.module_eval("7 + 9")
- assert_equal 17, c.module_eval("17.to_i")
- assert_equal "18", c.module_eval(%q("18"))
- assert_equal "19", c.module_eval(%q("1#{9}"))
-
- @ivar = 12
- 1.times {
- assert_equal 12, c.module_eval("@ivar")
- assert_equal 13, c.module_eval("@@cvar")
- assert_equal 14, c.module_eval("$gvar__eval")
- assert_equal 15, c.module_eval("Const")
- }
- end
-
- def test_module_eval_block_basic
- c = self.class
- assert_equal nil, c.module_eval { nil }
- assert_equal true, c.module_eval { true }
- assert_equal false, c.module_eval { false }
- assert_equal c, c.module_eval { self }
- assert_equal :sym, c.module_eval { :sym }
- assert_equal 11, c.module_eval { 11 }
- @ivar = 12
- assert_equal 12, c.module_eval { @ivar }
- assert_equal 13, c.module_eval { @@cvar }
- assert_equal 14, c.module_eval { $gvar__eval }
- assert_equal 15, c.module_eval { Const }
- assert_equal 16, c.module_eval { 7 + 9 }
- assert_equal 17, c.module_eval { "17".to_i }
- assert_equal "18", c.module_eval { "18" }
- assert_equal "19", c.module_eval { "1#{9}" }
-
- @ivar = 12
- 1.times {
- assert_equal 12, c.module_eval { @ivar }
- assert_equal 13, c.module_eval { @@cvar }
- assert_equal 14, c.module_eval { $gvar__eval }
- assert_equal 15, c.module_eval { Const }
- }
- end
-
- def forall_TYPE(mid)
- objects = [Object.new, [], nil, true, false, 77, :sym] # TODO: check
- objects.each do |obj|
- obj.instance_variable_set :@ivar, 12
- send mid, obj
- end
- end
-
- def test_instance_eval_string_basic
- forall_TYPE :instance_eval_string_basic_i
- end
-
- def instance_eval_string_basic_i(o)
- assert_equal nil, o.instance_eval("nil")
- assert_equal true, o.instance_eval("true")
- assert_equal false, o.instance_eval("false")
- assert_equal o, o.instance_eval("self")
- assert_equal 1, o.instance_eval("1")
- assert_equal :sym, o.instance_eval(":sym")
-
- assert_equal 11, o.instance_eval("11")
- assert_equal 12, o.instance_eval("@ivar")
- assert_equal 13, o.instance_eval("@@cvar")
- assert_equal 14, o.instance_eval("$gvar__eval")
- assert_equal 15, o.instance_eval("Const")
- assert_equal 16, o.instance_eval("7 + 9")
- assert_equal 17, o.instance_eval("17.to_i")
- assert_equal "18", o.instance_eval(%q("18"))
- assert_equal "19", o.instance_eval(%q("1#{9}"))
-
- 1.times {
- assert_equal 12, o.instance_eval("@ivar")
- assert_equal 13, o.instance_eval("@@cvar")
- assert_equal 14, o.instance_eval("$gvar__eval")
- assert_equal 15, o.instance_eval("Const")
- }
- end
-
- def test_instance_eval_block_basic
- forall_TYPE :instance_eval_block_basic_i
- end
-
- def instance_eval_block_basic_i(o)
- assert_equal nil, o.instance_eval { nil }
- assert_equal true, o.instance_eval { true }
- assert_equal false, o.instance_eval { false }
- assert_equal o, o.instance_eval { self }
- assert_equal 1, o.instance_eval { 1 }
- assert_equal :sym, o.instance_eval { :sym }
-
- assert_equal 11, o.instance_eval { 11 }
- assert_equal 12, o.instance_eval { @ivar }
- assert_equal 13, o.instance_eval { @@cvar }
- assert_equal 14, o.instance_eval { $gvar__eval }
- assert_equal 15, o.instance_eval { Const }
- assert_equal 16, o.instance_eval { 7 + 9 }
- assert_equal 17, o.instance_eval { 17.to_i }
- assert_equal "18", o.instance_eval { "18" }
- assert_equal "19", o.instance_eval { "1#{9}" }
-
- 1.times {
- assert_equal 12, o.instance_eval { @ivar }
- assert_equal 13, o.instance_eval { @@cvar }
- assert_equal 14, o.instance_eval { $gvar__eval }
- assert_equal 15, o.instance_eval { Const }
- }
- end
-
- def test_instance_eval_cvar
- [Object.new, [], 7, :sym, true, false, nil].each do |obj|
- assert_equal(13, obj.instance_eval("@@cvar"))
- assert_equal(13, obj.instance_eval{@@cvar})
- # assert_raise(NameError){obj.instance_eval("@@cvar")}
- # assert_raise(NameError){obj.instance_eval{@@cvar}}
- end
- end
-
- #
- # From ruby/test/ruby/test_eval.rb
- #
-
+ # eval with binding
def test_ev
local1 = "local1"
lambda {
@@ -216,7 +10,7 @@ class TestEval < Test::Unit::TestCase
}.call
end
- def test_eval_orig
+ def test_eval
assert_nil(eval(""))
$bad=false
eval 'while false; $bad = true; print "foo\n" end'
@@ -272,19 +66,16 @@ class TestEval < Test::Unit::TestCase
end
assert(!$bad)
- if false
- # Ruby 2.0 doesn't see Proc as Binding
- x = proc{}
- eval "i4 = 1", x
- assert_equal(1, eval("i4", x))
- x = proc{proc{}}.call
- eval "i4 = 22", x
- assert_equal(22, eval("i4", x))
- $x = []
- x = proc{proc{}}.call
- eval "(0..9).each{|i5| $x[i5] = proc{i5*2}}", x
- assert_equal(8, $x[4].call)
- end
+ x = proc{}
+ eval "i4 = 1", x
+ assert_equal(1, eval("i4", x))
+ x = proc{proc{}}.call
+ eval "i4 = 22", x
+ assert_equal(22, eval("i4", x))
+ $x = []
+ x = proc{proc{}}.call
+ eval "(0..9).each{|i5| $x[i5] = proc{i5*2}}", x
+ assert_equal(8, $x[4].call)
x = binding
eval "i = 1", x
@@ -307,62 +98,55 @@ class TestEval < Test::Unit::TestCase
foo22 = 5
proc{foo11=22}.call
proc{foo22=55}.call
- # assert_equal(eval("foo11"), eval("foo11", p))
- # assert_equal(1, eval("foo11"))
+ assert_equal(eval("foo11"), eval("foo11", p))
+ assert_equal(1, eval("foo11"))
assert_equal(eval("foo22"), eval("foo22", p))
assert_equal(55, eval("foo22"))
}.call
- if false
- # Ruby 2.0 doesn't see Proc as Binding
- p1 = proc{i7 = 0; proc{i7}}.call
- assert_equal(0, p1.call)
- eval "i7=5", p1
- assert_equal(5, p1.call)
- assert(!defined?(i7))
- end
+ p1 = proc{i7 = 0; proc{i7}}.call
+ assert_equal(0, p1.call)
+ eval "i7=5", p1
+ assert_equal(5, p1.call)
+ assert(!defined?(i7))
- if false
- # Ruby 2.0 doesn't see Proc as Binding
- p1 = proc{i7 = 0; proc{i7}}.call
- i7 = nil
- assert_equal(0, p1.call)
- eval "i7=1", p1
- assert_equal(1, p1.call)
- eval "i7=5", p1
- assert_equal(5, p1.call)
- assert_nil(i7)
- end
+ p1 = proc{i7 = 0; proc{i7}}.call
+ i7 = nil
+ assert_equal(0, p1.call)
+ eval "i7=1", p1
+ assert_equal(1, p1.call)
+ eval "i7=5", p1
+ assert_equal(5, p1.call)
+ assert_nil(i7)
end
- def test_nil_instance_eval_cvar
+ def test_nil_instance_eval_cvar # [ruby-dev:24103]
def nil.test_binding
binding
end
bb = eval("nil.instance_eval \"binding\"", nil.test_binding)
- assert_raise(NameError, "[ruby-dev:24103]") { eval("@@a", bb) }
+ assert_raise(NameError) { eval("@@a", bb) }
class << nil
remove_method :test_binding
end
end
- def test_fixnum_instance_eval_cvar
- assert_raise(NameError, "[ruby-dev:24213]") { 1.instance_eval "@@a" }
+ def test_fixnum_instance_eval_cvar # [ruby-dev:24213]
+ assert_raise(NameError) { 1.instance_eval "@@a" }
end
- def test_cvar_scope_with_instance_eval
- # TODO: check
+ def test_cvar_scope_with_instance_eval # [ruby-dev:24223]
Fixnum.class_eval "@@test_cvar_scope_with_instance_eval = 1" # depends on [ruby-dev:24229]
@@test_cvar_scope_with_instance_eval = 4
- assert_equal(4, 1.instance_eval("@@test_cvar_scope_with_instance_eval"), "[ruby-dev:24223]")
+ assert_equal(4, 1.instance_eval("@@test_cvar_scope_with_instance_eval"))
Fixnum.__send__(:remove_class_variable, :@@test_cvar_scope_with_instance_eval)
end
- def test_eval_and_define_method
- assert_nothing_raised("[ruby-dev:24228]") {
+ def test_eval_and_define_method # [ruby-dev:24228]
+ assert_nothing_raised {
def temporally_method_for_test_eval_and_define_method(&block)
lambda {
- class << Object.new; self end.send(:define_method, :zzz, &block)
+ class << Object.new; self end.__send__(:define_method, :zzz, &block)
}
end
v = eval("temporally_method_for_test_eval_and_define_method {}")
@@ -370,42 +154,4 @@ class TestEval < Test::Unit::TestCase
v.call
}
end
-
- def test_define_method_block
- cc = Class.new do
- define_method(:foo) {|&block|
- block.call if block
- }
- end
-
- c = cc.new
- x = "ng"
- c.foo() {x = "ok"}
- assert_equal("ok", x)
- end
-
- def test_eval_using_integer_as_binding
- assert_raise(TypeError) { eval("", 1) }
- end
-
- def test_eval_raise
- assert_raise(RuntimeError) { eval("raise ''") }
- end
-
- def test_eval_using_untainted_binding_under_safe4
- assert_raise(SecurityError) do
- Thread.new do
- b = binding
- $SAFE = 4
- eval("", b)
- end.join
- end
- end
-
- def test_eval_with_toplevel_binding # [ruby-dev:37142]
- ruby("-e", "x = 0; eval('p x', TOPLEVEL_BINDING)") do |f|
- f.close_write
- assert_equal("0", f.read.chomp)
- end
- end
end
diff --git a/test/ruby/test_exception.rb b/test/ruby/test_exception.rb
index 1eaeb7b3fb..4c27c52f3c 100644
--- a/test/ruby/test_exception.rb
+++ b/test/ruby/test_exception.rb
@@ -1,5 +1,4 @@
require 'test/unit'
-require_relative 'envutil'
class TestException < Test::Unit::TestCase
def test_exception
@@ -24,7 +23,7 @@ class TestException < Test::Unit::TestCase
# exception in rescue clause
$string = "this must be handled no.3"
- e = assert_raise(RuntimeError) do
+ e = assert_raises(RuntimeError) do
begin
raise "exception in rescue clause"
rescue
@@ -36,7 +35,7 @@ class TestException < Test::Unit::TestCase
# exception in ensure clause
$string = "exception in ensure clause"
- e = assert_raise(RuntimeError) do
+ e = assert_raises(RuntimeError) do
begin
raise "this must be handled no.4"
ensure
@@ -185,61 +184,4 @@ class TestException < Test::Unit::TestCase
assert(false)
end
end
-
- def test_raise_with_wrong_number_of_arguments
- assert_raise(TypeError) { raise nil }
- assert_raise(TypeError) { raise 1, 1 }
- assert_raise(ArgumentError) { raise 1, 1, 1, 1 }
- end
-
- def test_errat
- assert_in_out_err([], "p $@", %w(nil), [])
-
- assert_in_out_err([], "$@ = 1", [], /\$! not set \(ArgumentError\)$/)
-
- assert_in_out_err([], <<-INPUT, [], /backtrace must be Array of String \(TypeError\)$/)
- begin
- raise
- rescue
- $@ = 1
- end
- INPUT
-
- assert_in_out_err([], <<-INPUT, [], /^foo: unhandled exception$/)
- begin
- raise
- rescue
- $@ = 'foo'
- raise
- end
- INPUT
-
- assert_in_out_err([], <<-INPUT, [], /^foo: unhandled exception\s+from bar\s+from baz$/)
- begin
- raise
- rescue
- $@ = %w(foo bar baz)
- raise
- end
- INPUT
- end
-
- def test_safe4
- cmd = proc{raise SystemExit}
- safe0_p = proc{|*args| args}
-
- test_proc = proc {
- $SAFE = 4
- begin
- cmd.call
- rescue SystemExit => e
- safe0_p["SystemExit: #{e.inspect}"]
- raise e
- rescue Exception => e
- safe0_p["Exception (NOT SystemExit): #{e.inspect}"]
- raise e
- end
- }
- assert_raise(SystemExit, '[ruby-dev:38760]') {test_proc.call}
- end
end
diff --git a/test/ruby/test_fiber.rb b/test/ruby/test_fiber.rb
deleted file mode 100644
index e6afe55b96..0000000000
--- a/test/ruby/test_fiber.rb
+++ /dev/null
@@ -1,182 +0,0 @@
-require 'test/unit'
-require 'fiber'
-require 'continuation'
-
-class TestFiber < Test::Unit::TestCase
- def test_normal
- f = Fiber.current
- assert_equal(:ok2,
- Fiber.new{|e|
- assert_equal(:ok1, e)
- Fiber.yield :ok2
- }.resume(:ok1)
- )
- assert_equal([:a, :b], Fiber.new{|a, b| [a, b]}.resume(:a, :b))
- end
-
- def test_argument
- assert_equal(4, Fiber.new {|i=4| i}.resume)
- end
-
- def test_term
- assert_equal(:ok, Fiber.new{:ok}.resume)
- assert_equal([:a, :b, :c, :d, :e],
- Fiber.new{
- Fiber.new{
- Fiber.new{
- Fiber.new{
- [:a]
- }.resume + [:b]
- }.resume + [:c]
- }.resume + [:d]
- }.resume + [:e])
- end
-
- def test_many_fibers
- max = 10000
- assert_equal(max, max.times{
- Fiber.new{}
- })
- assert_equal(max,
- max.times{|i|
- Fiber.new{
- }.resume
- }
- )
- end
-
- def test_many_fibers_with_threads
- max = 1000
- @cnt = 0
- (1..100).map{|ti|
- Thread.new{
- max.times{|i|
- Fiber.new{
- @cnt += 1
- }.resume
- }
- }
- }.each{|t|
- t.join
- }
- assert_equal(:ok, :ok)
- end
-
- def test_error
- assert_raise(ArgumentError){
- Fiber.new # Fiber without block
- }
- assert_raise(FiberError){
- f = Fiber.new{}
- Thread.new{f.resume}.join # Fiber yielding across thread
- }
- assert_raise(FiberError){
- f = Fiber.new{}
- f.resume
- f.resume
- }
- assert_raise(RuntimeError){
- f = Fiber.new{
- @c = callcc{|c| @c = c}
- }.resume
- @c.call # cross fiber callcc
- }
- assert_raise(RuntimeError){
- Fiber.new{
- raise
- }.resume
- }
- assert_raise(FiberError){
- Fiber.yield
- }
- assert_raise(FiberError){
- fib = Fiber.new{
- fib.resume
- }
- fib.resume
- }
- assert_raise(FiberError){
- fib = Fiber.new{
- Fiber.new{
- fib.resume
- }.resume
- }
- fib.resume
- }
- end
-
- def test_return
- assert_raise(LocalJumpError){
- Fiber.new do
- return
- end.resume
- }
- end
-
- def test_throw
- assert_raise(ArgumentError){
- Fiber.new do
- throw :a
- end.resume
- }
- end
-
- def test_transfer
- ary = []
- f2 = nil
- f1 = Fiber.new{
- ary << f2.transfer(:foo)
- :ok
- }
- f2 = Fiber.new{
- ary << f1.transfer(:baz)
- :ng
- }
- assert_equal(:ok, f1.transfer)
- assert_equal([:baz], ary)
- end
-
- def test_tls
- #
- def tvar(var, val)
- old = Thread.current[var]
- begin
- Thread.current[var] = val
- yield
- ensure
- Thread.current[var] = old
- end
- end
-
- fb = Fiber.new {
- assert_equal(nil, Thread.current[:v]); tvar(:v, :x) {
- assert_equal(:x, Thread.current[:v]); Fiber.yield
- assert_equal(:x, Thread.current[:v]); }
- assert_equal(nil, Thread.current[:v]); Fiber.yield
- raise # unreachable
- }
-
- assert_equal(nil, Thread.current[:v]); tvar(:v,1) {
- assert_equal(1, Thread.current[:v]); tvar(:v,3) {
- assert_equal(3, Thread.current[:v]); fb.resume
- assert_equal(3, Thread.current[:v]); }
- assert_equal(1, Thread.current[:v]); }
- assert_equal(nil, Thread.current[:v]); fb.resume
- assert_equal(nil, Thread.current[:v]);
- end
-
- def test_alive
- fib = Fiber.new{Fiber.yield}
- assert_equal(true, fib.alive?)
- fib.resume
- assert_equal(true, fib.alive?)
- fib.resume
- assert_equal(false, fib.alive?)
- end
-
- def test_resume_self
- f = Fiber.new {f.resume}
- assert_raise(FiberError, '[ruby-core:23651]') {f.transfer}
- end
-end
-
diff --git a/test/ruby/test_file.rb b/test/ruby/test_file.rb
index b4666ad4a6..2458dde347 100644
--- a/test/ruby/test_file.rb
+++ b/test/ruby/test_file.rb
@@ -1,29 +1,34 @@
require 'test/unit'
require 'tempfile'
-require_relative 'ut_eof'
+$:.replace([File.dirname(File.expand_path(__FILE__))] | $:)
+require 'ut_eof'
class TestFile < Test::Unit::TestCase
# I don't know Ruby's spec about "unlink-before-close" exactly.
# This test asserts current behaviour.
def test_unlink_before_close
- Dir.mktmpdir('rubytest-file') {|tmpdir|
- filename = tmpdir + '/' + File.basename(__FILE__) + ".#{$$}"
- w = File.open(filename, "w")
- w << "foo"
- w.close
- r = File.open(filename, "r")
- begin
- if /(mswin|bccwin|mingw|emx)/ =~ RUBY_PLATFORM
- assert_raise(Errno::EACCES) {File.unlink(filename)}
- else
- assert_nothing_raised {File.unlink(filename)}
- end
- ensure
- r.close
- File.unlink(filename) if File.exist?(filename)
+ filename = File.basename(__FILE__) + ".#{$$}"
+ w = File.open(filename, "w")
+ w << "foo"
+ w.close
+ r = File.open(filename, "r")
+ begin
+ if /(mswin|bccwin|mingw|emx)/ =~ RUBY_PLATFORM
+ begin
+ File.unlink(filename)
+ assert(false)
+ rescue Errno::EACCES
+ assert(true)
+ end
+ else
+ File.unlink(filename)
+ assert(true)
end
- }
+ ensure
+ r.close
+ File.unlink(filename) if File.exist?(filename)
+ end
end
include TestEOF
@@ -37,17 +42,22 @@ class TestFile < Test::Unit::TestCase
include TestEOF::Seek
- def test_truncate_wbuf
+ def test_fnmatch
+ # from [ruby-dev:22815] and [ruby-dev:22819]
+ assert(true, File.fnmatch('\[1\]' , '[1]'))
+ assert(true, File.fnmatch('*?', 'a'))
+ end
+
+ def test_truncate_wbuf # [ruby-dev:24191]
f = Tempfile.new("test-truncate")
f.print "abc"
f.truncate(0)
f.print "def"
- f.flush
- assert_equal("\0\0\0def", File.read(f.path), "[ruby-dev:24191]")
f.close
+ assert_equal("\0\0\0def", File.read(f.path))
end
- def test_truncate_rbuf
+ def test_truncate_rbuf # [ruby-dev:24197]
f = Tempfile.new("test-truncate")
f.puts "abc"
f.puts "def"
@@ -55,106 +65,44 @@ class TestFile < Test::Unit::TestCase
f.open
assert_equal("abc\n", f.gets)
f.truncate(3)
- assert_equal(nil, f.gets, "[ruby-dev:24197]")
- end
-
- def test_truncate_beyond_eof
- f = Tempfile.new("test-truncate")
- f.print "abc"
- f.truncate 10
- assert_equal("\0" * 7, f.read(100), "[ruby-dev:24532]")
+ assert_equal(nil, f.gets)
end
def test_read_all_extended_file
- [nil, {:textmode=>true}, {:binmode=>true}].each do |mode|
- f = Tempfile.new("test-extended-file", mode)
- assert_nil(f.getc)
- f.print "a"
- f.rewind
- assert_equal("a", f.read, "mode = <#{mode}>")
- end
+ f = Tempfile.new("test-extended-file")
+ assert_nil(f.getc)
+ open(f.path, "w") {|g| g.print "a" }
+ assert_equal("a", f.read)
end
def test_gets_extended_file
- [nil, {:textmode=>true}, {:binmode=>true}].each do |mode|
- f = Tempfile.new("test-extended-file", mode)
- assert_nil(f.getc)
- f.print "a"
- f.rewind
- assert_equal("a", f.gets("a"), "mode = <#{mode}>")
- end
+ f = Tempfile.new("test-extended-file")
+ assert_nil(f.getc)
+ open(f.path, "w") {|g| g.print "a" }
+ assert_equal("a", f.gets("a"))
end
def test_gets_para_extended_file
- [nil, {:textmode=>true}, {:binmode=>true}].each do |mode|
- f = Tempfile.new("test-extended-file", mode)
- assert_nil(f.getc)
- f.print "\na"
- f.rewind
- assert_equal("a", f.gets(""), "mode = <#{mode}>")
- end
- end
-
- def test_each_char_extended_file
- [nil, {:textmode=>true}, {:binmode=>true}].each do |mode|
- f = Tempfile.new("test-extended-file", mode)
- assert_nil(f.getc)
- f.print "a"
- f.rewind
- result = []
- f.each_char {|b| result << b }
- assert_equal([?a], result, "mode = <#{mode}>")
- end
+ f = Tempfile.new("test-extended-file")
+ assert_nil(f.getc)
+ open(f.path, "w") {|g| g.print "\na" }
+ assert_equal("a", f.gets(""))
end
def test_each_byte_extended_file
- [nil, {:textmode=>true}, {:binmode=>true}].each do |mode|
- f = Tempfile.new("test-extended-file", mode)
- assert_nil(f.getc)
- f.print "a"
- f.rewind
- result = []
- f.each_byte {|b| result << b.chr }
- assert_equal([?a], result, "mode = <#{mode}>")
- end
+ f = Tempfile.new("test-extended-file")
+ assert_nil(f.getc)
+ open(f.path, "w") {|g| g.print "a" }
+ result = []
+ f.each_byte {|b| result << b }
+ assert_equal([?a], result)
end
def test_getc_extended_file
- [nil, {:textmode=>true}, {:binmode=>true}].each do |mode|
- f = Tempfile.new("test-extended-file", mode)
- assert_nil(f.getc)
- f.print "a"
- f.rewind
- assert_equal(?a, f.getc, "mode = <#{mode}>")
- end
- end
-
- def test_getbyte_extended_file
- [nil, {:textmode=>true}, {:binmode=>true}].each do |mode|
- f = Tempfile.new("test-extended-file", mode)
- assert_nil(f.getc)
- f.print "a"
- f.rewind
- assert_equal(?a, f.getbyte.chr, "mode = <#{mode}>")
- end
+ f = Tempfile.new("test-extended-file")
+ assert_nil(f.getc)
+ open(f.path, "w") {|g| g.print "a" }
+ assert_equal(?a, f.getc)
end
- def test_s_chown
- assert_nothing_raised { File.chown -1, -1 }
- assert_nothing_raised { File.chown nil, nil }
- end
-
- def test_chown
- assert_nothing_raised {
- File.open(__FILE__) {|f| f.chown -1, -1 }
- }
- assert_nothing_raised("[ruby-dev:27140]") {
- File.open(__FILE__) {|f| f.chown nil, nil }
- }
- end
-
- def test_uninitialized
- assert_raise(TypeError) { File::Stat.allocate.readable? }
- assert_nothing_raised { File::Stat.allocate.inspect }
- end
end
diff --git a/test/ruby/test_file_exhaustive.rb b/test/ruby/test_file_exhaustive.rb
deleted file mode 100644
index 881edb57ac..0000000000
--- a/test/ruby/test_file_exhaustive.rb
+++ /dev/null
@@ -1,753 +0,0 @@
-require "test/unit"
-require "fileutils"
-require "tmpdir"
-
-class TestFileExhaustive < Test::Unit::TestCase
- def setup
- @dir = Dir.mktmpdir("rubytest-file")
- File.chown(-1, Process.gid, @dir)
- @file = make_tmp_filename("file")
- @zerofile = make_tmp_filename("zerofile")
- @nofile = make_tmp_filename("nofile")
- @symlinkfile = make_tmp_filename("symlinkfile")
- @hardlinkfile = make_tmp_filename("hardlinkfile")
- make_file("foo", @file)
- make_file("", @zerofile)
- @time = Time.now
- begin
- File.symlink(@file, @symlinkfile)
- rescue NotImplementedError
- @symlinkfile = nil
- end
- begin
- File.link(@file, @hardlinkfile)
- rescue NotImplementedError, Errno::EINVAL # EINVAL for Windows Vista
- @hardlinkfile = nil
- end
- end
-
- def teardown
- GC.start
- FileUtils.remove_entry_secure @dir
- end
-
- def make_file(content, file = @file)
- open(file, "w") {|fh| fh << content }
- end
-
- def make_tmp_filename(prefix)
- @hardlinkfile = @dir + "/" + prefix + File.basename(__FILE__) + ".#{$$}.test"
- end
-
- def test_path
- file = @file
-
- assert_equal(file, File.open(file) {|f| f.path})
- assert_equal(file, File.path(file))
- o = Object.new
- class << o; self; end.class_eval do
- define_method(:to_path) { file }
- end
- assert_equal(file, File.path(o))
- end
-
- def assert_integer(n)
- assert(n.is_a?(Integer), n.inspect + " is not Fixnum.")
- end
-
- def assert_integer_or_nil(n)
- assert(n.is_a?(Integer) || n.equal?(nil), n.inspect + " is neither Fixnum nor nil.")
- end
-
- def test_stat
- sleep(@time - Time.now + 1.1)
- make_file("foo", @file + "2")
- fs1, fs2 = File.stat(@file), File.stat(@file + "2")
- assert_nothing_raised do
- assert_equal(0, fs1 <=> fs1)
- assert_equal(-1, fs1 <=> fs2)
- assert_equal(1, fs2 <=> fs1)
- assert_nil(fs1 <=> nil)
- assert_integer(fs1.dev)
- assert_integer_or_nil(fs1.rdev)
- assert_integer_or_nil(fs1.dev_major)
- assert_integer_or_nil(fs1.dev_minor)
- assert_integer_or_nil(fs1.rdev_major)
- assert_integer_or_nil(fs1.rdev_minor)
- assert_integer(fs1.ino)
- assert_integer(fs1.mode)
- unless /emx/ =~ RUBY_PLATFORM
- assert_equal(@hardlinkfile ? 2 : 1, fs1.nlink)
- end
- assert_integer(fs1.uid)
- assert_integer(fs1.gid)
- assert_equal(3, fs1.size)
- assert_integer_or_nil(fs1.blksize)
- assert_integer_or_nil(fs1.blocks)
- assert_kind_of(Time, fs1.atime)
- assert_kind_of(Time, fs1.mtime)
- assert_kind_of(Time, fs1.ctime)
- assert_kind_of(String, fs1.inspect)
- end
- assert_raise(Errno::ENOENT) { File.stat(@nofile) }
- assert_kind_of(File::Stat, File.open(@file) {|f| f.stat})
- assert_raise(Errno::ENOENT) { File.lstat(@nofile) }
- assert_kind_of(File::Stat, File.open(@file) {|f| f.lstat})
- end
-
- def test_directory_p
- assert(File.directory?(@dir))
- assert(!(File.directory?(@dir+"/...")))
- assert(!(File.directory?(@file)))
- assert(!(File.directory?(@nofile)))
- end
-
- def test_pipe_p ## xxx
- assert(!(File.pipe?(@dir)))
- assert(!(File.pipe?(@file)))
- assert(!(File.pipe?(@nofile)))
- end
-
- def test_symlink_p
- assert(!(File.symlink?(@dir)))
- assert(!(File.symlink?(@file)))
- assert(File.symlink?(@symlinkfile)) if @symlinkfile
- assert(!(File.symlink?(@hardlinkfile))) if @hardlinkfile
- assert(!(File.symlink?(@nofile)))
- end
-
- def test_socket_p ## xxx
- assert(!(File.socket?(@dir)))
- assert(!(File.socket?(@file)))
- assert(!(File.socket?(@nofile)))
- end
-
- def test_blockdev_p ## xxx
- assert(!(File.blockdev?(@dir)))
- assert(!(File.blockdev?(@file)))
- assert(!(File.blockdev?(@nofile)))
- end
-
- def test_chardev_p ## xxx
- assert(!(File.chardev?(@dir)))
- assert(!(File.chardev?(@file)))
- assert(!(File.chardev?(@nofile)))
- end
-
- def test_exist_p
- assert(File.exist?(@dir))
- assert(File.exist?(@file))
- assert(!(File.exist?(@nofile)))
- end
-
- def test_readable_p
- return if /cygwin|mswin|bccwin|mingw|emx/ =~ RUBY_PLATFORM
- return if Process.euid == 0
- File.chmod(0200, @file)
- assert(!(File.readable?(@file)))
- File.chmod(0600, @file)
- assert(File.readable?(@file))
- assert(!(File.readable?(@nofile)))
- end
-
- def test_readable_real_p
- return if /cygwin|mswin|bccwin|mingw|emx/ =~ RUBY_PLATFORM
- return if Process.euid == 0
- File.chmod(0200, @file)
- assert(!(File.readable_real?(@file)))
- File.chmod(0600, @file)
- assert(File.readable_real?(@file))
- assert(!(File.readable_real?(@nofile)))
- end
-
- def test_world_readable_p
- return if /cygwin|mswin|bccwin|mingw|emx/ =~ RUBY_PLATFORM
- File.chmod(0006, @file)
- assert(File.world_readable?(@file))
- File.chmod(0060, @file)
- assert(!(File.world_readable?(@file)))
- File.chmod(0600, @file)
- assert(!(File.world_readable?(@file)))
- assert(!(File.world_readable?(@nofile)))
- end
-
- def test_writable_p
- return if /cygwin|mswin|bccwin|mingw|emx/ =~ RUBY_PLATFORM
- return if Process.euid == 0
- File.chmod(0400, @file)
- assert(!(File.writable?(@file)))
- File.chmod(0600, @file)
- assert(File.writable?(@file))
- assert(!(File.writable?(@nofile)))
- end
-
- def test_writable_real_p
- return if /cygwin|mswin|bccwin|mingw|emx/ =~ RUBY_PLATFORM
- return if Process.euid == 0
- File.chmod(0400, @file)
- assert(!(File.writable_real?(@file)))
- File.chmod(0600, @file)
- assert(File.writable_real?(@file))
- assert(!(File.writable_real?(@nofile)))
- end
-
- def test_world_writable_p
- return if /cygwin|mswin|bccwin|mingw|emx/ =~ RUBY_PLATFORM
- File.chmod(0006, @file)
- assert(File.world_writable?(@file))
- File.chmod(0060, @file)
- assert(!(File.world_writable?(@file)))
- File.chmod(0600, @file)
- assert(!(File.world_writable?(@file)))
- assert(!(File.world_writable?(@nofile)))
- end
-
- def test_executable_p
- return if /cygwin|mswin|bccwin|mingw|emx/ =~ RUBY_PLATFORM
- File.chmod(0100, @file)
- assert(File.executable?(@file))
- File.chmod(0600, @file)
- assert(!(File.executable?(@file)))
- assert(!(File.executable?(@nofile)))
- end
-
- def test_executable_real_p
- return if /cygwin|mswin|bccwin|mingw|emx/ =~ RUBY_PLATFORM
- File.chmod(0100, @file)
- assert(File.executable_real?(@file))
- File.chmod(0600, @file)
- assert(!(File.executable_real?(@file)))
- assert(!(File.executable_real?(@nofile)))
- end
-
- def test_file_p
- assert(!(File.file?(@dir)))
- assert(File.file?(@file))
- assert(!(File.file?(@nofile)))
- end
-
- def test_zero_p
- assert_nothing_raised { File.zero?(@dir) }
- assert(!(File.zero?(@file)))
- assert(File.zero?(@zerofile))
- assert(!(File.zero?(@nofile)))
- end
-
- def test_size_p
- assert_nothing_raised { File.size?(@dir) }
- assert_equal(3, File.size?(@file))
- assert(!(File.size?(@zerofile)))
- assert(!(File.size?(@nofile)))
- end
-
- def test_owned_p ## xxx
- return if /cygwin|mswin|bccwin|mingw|emx/ =~ RUBY_PLATFORM
- assert(File.owned?(@file))
- assert(File.grpowned?(@file))
- end
-
- def test_suid_sgid_sticky ## xxx
- assert(!(File.setuid?(@file)))
- assert(!(File.setgid?(@file)))
- assert(!(File.sticky?(@file)))
- end
-
- def test_identical_p
- assert(File.identical?(@file, @file))
- assert(!(File.identical?(@file, @zerofile)))
- assert(!(File.identical?(@file, @nofile)))
- assert(!(File.identical?(@nofile, @file)))
- end
-
- def test_s_size
- assert_integer(File.size(@dir))
- assert_equal(3, File.size(@file))
- assert_equal(0, File.size(@zerofile))
- assert_raise(Errno::ENOENT) { File.size(@nofile) }
- end
-
- def test_ftype
- assert_equal("directory", File.ftype(@dir))
- assert_equal("file", File.ftype(@file))
- assert_equal("link", File.ftype(@symlinkfile)) if @symlinkfile
- assert_equal("file", File.ftype(@hardlinkfile)) if @hardlinkfile
- assert_raise(Errno::ENOENT) { File.ftype(@nofile) }
- end
-
- def test_atime
- t1 = File.atime(@file)
- t2 = File.open(@file) {|f| f.atime}
- assert_kind_of(Time, t1)
- assert_kind_of(Time, t2)
- assert_equal(t1, t2)
- assert_raise(Errno::ENOENT) { File.atime(@nofile) }
- end
-
- def test_mtime
- t1 = File.mtime(@file)
- t2 = File.open(@file) {|f| f.mtime}
- assert_kind_of(Time, t1)
- assert_kind_of(Time, t2)
- assert_equal(t1, t2)
- assert_raise(Errno::ENOENT) { File.mtime(@nofile) }
- end
-
- def test_ctime
- t1 = File.ctime(@file)
- t2 = File.open(@file) {|f| f.ctime}
- assert_kind_of(Time, t1)
- assert_kind_of(Time, t2)
- assert_equal(t1, t2)
- assert_raise(Errno::ENOENT) { File.ctime(@nofile) }
- end
-
- def test_chmod
- return if /cygwin|mswin|bccwin|mingw|emx/ =~ RUBY_PLATFORM
- assert_equal(1, File.chmod(0444, @file))
- assert_equal(0444, File.stat(@file).mode % 01000)
- assert_equal(0, File.open(@file) {|f| f.chmod(0222)})
- assert_equal(0222, File.stat(@file).mode % 01000)
- File.chmod(0600, @file)
- assert_raise(Errno::ENOENT) { File.chmod(0600, @nofile) }
- end
-
- def test_lchmod
- return if /cygwin|mswin|bccwin|mingw|emx/ =~ RUBY_PLATFORM
- assert_equal(1, File.lchmod(0444, @file))
- assert_equal(0444, File.stat(@file).mode % 01000)
- File.lchmod(0600, @file)
- assert_raise(Errno::ENOENT) { File.lchmod(0600, @nofile) }
- rescue NotImplementedError
- end
-
- def test_chown ## xxx
- end
-
- def test_lchown ## xxx
- end
-
- def test_symlink
- return unless @symlinkfile
- assert_equal("link", File.ftype(@symlinkfile))
- assert_raise(Errno::EEXIST) { File.symlink(@file, @file) }
- end
-
- def test_utime
- t = Time.local(2000)
- File.utime(t + 1, t + 2, @zerofile)
- assert_equal(t + 1, File.atime(@zerofile))
- assert_equal(t + 2, File.mtime(@zerofile))
- end
-
- def test_hardlink
- return unless @hardlinkfile
- assert_equal("file", File.ftype(@hardlinkfile))
- assert_raise(Errno::EEXIST) { File.link(@file, @file) }
- end
-
- def test_symlink2
- return unless @symlinkfile
- assert_equal(@file, File.readlink(@symlinkfile))
- assert_raise(Errno::EINVAL) { File.readlink(@file) }
- assert_raise(Errno::ENOENT) { File.readlink(@nofile) }
- rescue NotImplementedError
- end
-
- def test_unlink
- assert_equal(1, File.unlink(@file))
- make_file("foo", @file)
- assert_raise(Errno::ENOENT) { File.unlink(@nofile) }
- end
-
- def test_rename
- assert_equal(0, File.rename(@file, @nofile))
- assert(!(File.exist?(@file)))
- assert(File.exist?(@nofile))
- assert_equal(0, File.rename(@nofile, @file))
- assert_raise(Errno::ENOENT) { File.rename(@nofile, @file) }
- end
-
- def test_umask
- return if /cygwin|mswin|bccwin|mingw|emx/ =~ RUBY_PLATFORM
- prev = File.umask(0777)
- assert_equal(0777, File.umask)
- open(@nofile, "w") { }
- assert_equal(0, File.stat(@nofile).mode % 01000)
- File.unlink(@nofile)
- assert_equal(0777, File.umask(prev))
- assert_raise(ArgumentError) { File.umask(0, 1, 2) }
- end
-
- def test_expand_path
- assert_equal(@file, File.expand_path(File.basename(@file), File.dirname(@file)))
- if /cygwin|mingw|mswin|bccwin/ =~ RUBY_PLATFORM
- assert_equal(@file, File.expand_path(@file + " "))
- assert_equal(@file, File.expand_path(@file + "."))
- assert_equal(@file, File.expand_path(@file + "::$DATA"))
- end
- assert_kind_of(String, File.expand_path("~"))
- assert_raise(ArgumentError) { File.expand_path("~foo_bar_baz_unknown_user_wahaha") }
- assert_raise(ArgumentError) { File.expand_path("~foo_bar_baz_unknown_user_wahaha", "/") }
- end
-
- def test_basename
- assert_equal(File.basename(@file).sub(/\.test$/, ""), File.basename(@file, ".test"))
- assert_equal("", s = File.basename(""))
- assert(!s.frozen?, '[ruby-core:24199]')
- assert_equal("foo", s = File.basename("foo"))
- assert(!s.frozen?, '[ruby-core:24199]')
- assert_equal("foo", File.basename("foo", ".ext"))
- assert_equal("foo", File.basename("foo.ext", ".ext"))
- assert_equal("foo", File.basename("foo.ext", ".*"))
- if /cygwin|mingw|mswin|bccwin/ =~ RUBY_PLATFORM
- basename = File.basename(@file)
- assert_equal(basename, File.basename(@file + " "))
- assert_equal(basename, File.basename(@file + "."))
- assert_equal(basename, File.basename(@file + "::$DATA"))
- basename.chomp!(".test")
- assert_equal(basename, File.basename(@file + " ", ".test"))
- assert_equal(basename, File.basename(@file + ".", ".test"))
- assert_equal(basename, File.basename(@file + "::$DATA", ".test"))
- assert_equal(basename, File.basename(@file + " ", ".*"))
- assert_equal(basename, File.basename(@file + ".", ".*"))
- assert_equal(basename, File.basename(@file + "::$DATA", ".*"))
- end
- end
-
- def test_dirname
- assert(@file.start_with?(File.dirname(@file)))
- assert_equal(".", File.dirname(""))
- end
-
- def test_extname
- assert(".test", File.extname(@file))
- prefixes = ["", "/", ".", "/.", "bar/.", "/bar/."]
- infixes = ["", " ", "."]
- infixes2 = infixes + [".ext "]
- appendixes = [""]
- if /cygwin|mingw|mswin|bccwin/ =~ RUBY_PLATFORM
- appendixes << " " << "." << "::$DATA" << "::$DATA.bar"
- end
- prefixes.each do |prefix|
- appendixes.each do |appendix|
- infixes.each do |infix|
- path = "#{prefix}foo#{infix}#{appendix}"
- assert_equal("", File.extname(path), "File.extname(#{path.inspect})")
- end
- infixes2.each do |infix|
- path = "#{prefix}foo#{infix}.ext#{appendix}"
- assert_equal(".ext", File.extname(path), "File.extname(#{path.inspect})")
- end
- end
- end
- end
-
- def test_split
- d, b = File.split(@file)
- assert_equal(File.dirname(@file), d)
- assert_equal(File.basename(@file), b)
- end
-
- def test_join
- s = "foo" + File::SEPARATOR + "bar" + File::SEPARATOR + "baz"
- assert_equal(s, File.join("foo", "bar", "baz"))
- assert_equal(s, File.join(["foo", "bar", "baz"]))
- o = Object.new
- def o.to_path; "foo"; end
- assert_equal(s, File.join(o, "bar", "baz"))
- assert_equal(s, File.join("foo" + File::SEPARATOR, "bar", File::SEPARATOR + "baz"))
- end
-
- def test_truncate
- assert_equal(0, File.truncate(@file, 1))
- assert(File.exist?(@file))
- assert_equal(1, File.size(@file))
- assert_equal(0, File.truncate(@file, 0))
- assert(File.exist?(@file))
- assert(File.zero?(@file))
- make_file("foo", @file)
- assert_raise(Errno::ENOENT) { File.truncate(@nofile, 0) }
-
- f = File.new(@file, "w")
- assert_equal(0, f.truncate(2))
- assert(File.exist?(@file))
- assert_equal(2, File.size(@file))
- assert_equal(0, f.truncate(0))
- assert(File.exist?(@file))
- assert(File.zero?(@file))
- f.close
- make_file("foo", @file)
-
- assert_raise(IOError) { File.open(@file) {|f| f.truncate(0)} }
- rescue NotImplementedError
- end
-
- def test_flock ## xxx
- f = File.new(@file, "r+")
- f.flock(File::LOCK_EX)
- f.flock(File::LOCK_SH)
- f.flock(File::LOCK_UN)
- f.close
- rescue NotImplementedError
- end
-
- def test_test
- sleep(@time - Time.now + 1.1)
- make_file("foo", @file + "2")
- [@dir, @file, @zerofile, @symlinkfile, @hardlinkfile].compact.each do |f|
- assert_equal(File.atime(f), test(?A, f))
- assert_equal(File.ctime(f), test(?C, f))
- assert_equal(File.mtime(f), test(?M, f))
- assert_equal(File.blockdev?(f), test(?b, f))
- assert_equal(File.chardev?(f), test(?c, f))
- assert_equal(File.directory?(f), test(?d, f))
- assert_equal(File.exist?(f), test(?e, f))
- assert_equal(File.file?(f), test(?f, f))
- assert_equal(File.setgid?(f), test(?g, f))
- assert_equal(File.grpowned?(f), test(?G, f))
- assert_equal(File.sticky?(f), test(?k, f))
- assert_equal(File.symlink?(f), test(?l, f))
- assert_equal(File.owned?(f), test(?o, f))
- assert_nothing_raised { test(?O, f) }
- assert_equal(File.pipe?(f), test(?p, f))
- assert_equal(File.readable?(f), test(?r, f))
- assert_equal(File.readable_real?(f), test(?R, f))
- assert_equal(File.size?(f), test(?s, f))
- assert_equal(File.socket?(f), test(?S, f))
- assert_equal(File.setuid?(f), test(?u, f))
- assert_equal(File.writable?(f), test(?w, f))
- assert_equal(File.world_writable?(f), test(?W, f))
- assert_equal(File.executable?(f), test(?x, f))
- assert_equal(File.executable_real?(f), test(?X, f))
- assert_equal(File.zero?(f), test(?z, f))
- end
- assert_equal(false, test(?-, @dir, @file))
- assert_equal(true, test(?-, @file, @file))
- assert_equal(true, test(?=, @file, @file))
- assert_equal(false, test(?>, @file, @file))
- assert_equal(false, test(?<, @file, @file))
- unless /cygwin/ =~ RUBY_PLATFORM
- assert_equal(false, test(?=, @file, @file + "2"))
- assert_equal(false, test(?>, @file, @file + "2"))
- assert_equal(true, test(?>, @file + "2", @file))
- assert_equal(true, test(?<, @file, @file + "2"))
- assert_equal(false, test(?<, @file + "2", @file))
- end
- assert_raise(ArgumentError) { test }
- assert_raise(Errno::ENOENT) { test(?A, @nofile) }
- assert_raise(ArgumentError) { test(?a) }
- assert_raise(ArgumentError) { test("\0".ord) }
- end
-
- def test_stat_init
- sleep(@time - Time.now + 1.1)
- make_file("foo", @file + "2")
- fs1, fs2 = File::Stat.new(@file), File::Stat.new(@file + "2")
- assert_nothing_raised do
- assert_equal(0, fs1 <=> fs1)
- assert_equal(-1, fs1 <=> fs2)
- assert_equal(1, fs2 <=> fs1)
- assert_nil(fs1 <=> nil)
- assert_integer(fs1.dev)
- assert_integer_or_nil(fs1.rdev)
- assert_integer_or_nil(fs1.dev_major)
- assert_integer_or_nil(fs1.dev_minor)
- assert_integer_or_nil(fs1.rdev_major)
- assert_integer_or_nil(fs1.rdev_minor)
- assert_integer(fs1.ino)
- assert_integer(fs1.mode)
- unless /emx/ =~ RUBY_PLATFORM
- assert_equal(@hardlinkfile ? 2 : 1, fs1.nlink)
- end
- assert_integer(fs1.uid)
- assert_integer(fs1.gid)
- assert_equal(3, fs1.size)
- assert_integer_or_nil(fs1.blksize)
- assert_integer_or_nil(fs1.blocks)
- assert_kind_of(Time, fs1.atime)
- assert_kind_of(Time, fs1.mtime)
- assert_kind_of(Time, fs1.ctime)
- assert_kind_of(String, fs1.inspect)
- end
- assert_raise(Errno::ENOENT) { File::Stat.new(@nofile) }
- assert_kind_of(File::Stat, File::Stat.new(@file).dup)
- assert_raise(TypeError) do
- File::Stat.new(@file).instance_eval { initialize_copy(0) }
- end
- end
-
- def test_stat_ftype
- assert_equal("directory", File::Stat.new(@dir).ftype)
- assert_equal("file", File::Stat.new(@file).ftype)
- # File::Stat uses stat
- assert_equal("file", File::Stat.new(@symlinkfile).ftype) if @symlinkfile
- assert_equal("file", File::Stat.new(@hardlinkfile).ftype) if @hardlinkfile
- end
-
- def test_stat_directory_p
- assert(File::Stat.new(@dir).directory?)
- assert(!(File::Stat.new(@file).directory?))
- end
-
- def test_stat_pipe_p ## xxx
- assert(!(File::Stat.new(@dir).pipe?))
- assert(!(File::Stat.new(@file).pipe?))
- end
-
- def test_stat_symlink_p
- assert(!(File::Stat.new(@dir).symlink?))
- assert(!(File::Stat.new(@file).symlink?))
- # File::Stat uses stat
- assert(!(File::Stat.new(@symlinkfile).symlink?)) if @symlinkfile
- assert(!(File::Stat.new(@hardlinkfile).symlink?)) if @hardlinkfile
- end
-
- def test_stat_socket_p ## xxx
- assert(!(File::Stat.new(@dir).socket?))
- assert(!(File::Stat.new(@file).socket?))
- end
-
- def test_stat_blockdev_p ## xxx
- assert(!(File::Stat.new(@dir).blockdev?))
- assert(!(File::Stat.new(@file).blockdev?))
- end
-
- def test_stat_chardev_p ## xxx
- assert(!(File::Stat.new(@dir).chardev?))
- assert(!(File::Stat.new(@file).chardev?))
- end
-
- def test_stat_readable_p
- return if /cygwin|mswin|bccwin|mingw|emx/ =~ RUBY_PLATFORM
- return if Process.euid == 0
- File.chmod(0200, @file)
- assert(!(File::Stat.new(@file).readable?))
- File.chmod(0600, @file)
- assert(File::Stat.new(@file).readable?)
- end
-
- def test_stat_readable_real_p
- return if /cygwin|mswin|bccwin|mingw|emx/ =~ RUBY_PLATFORM
- return if Process.euid == 0
- File.chmod(0200, @file)
- assert(!(File::Stat.new(@file).readable_real?))
- File.chmod(0600, @file)
- assert(File::Stat.new(@file).readable_real?)
- end
-
- def test_stat_world_readable_p
- return if /cygwin|mswin|bccwin|mingw|emx/ =~ RUBY_PLATFORM
- File.chmod(0006, @file)
- assert(File::Stat.new(@file).world_readable?)
- File.chmod(0060, @file)
- assert(!(File::Stat.new(@file).world_readable?))
- File.chmod(0600, @file)
- assert(!(File::Stat.new(@file).world_readable?))
- end
-
- def test_stat_writable_p
- return if /cygwin|mswin|bccwin|mingw|emx/ =~ RUBY_PLATFORM
- return if Process.euid == 0
- File.chmod(0400, @file)
- assert(!(File::Stat.new(@file).writable?))
- File.chmod(0600, @file)
- assert(File::Stat.new(@file).writable?)
- end
-
- def test_stat_writable_real_p
- return if /cygwin|mswin|bccwin|mingw|emx/ =~ RUBY_PLATFORM
- return if Process.euid == 0
- File.chmod(0400, @file)
- assert(!(File::Stat.new(@file).writable_real?))
- File.chmod(0600, @file)
- assert(File::Stat.new(@file).writable_real?)
- end
-
- def test_stat_world_writable_p
- return if /cygwin|mswin|bccwin|mingw|emx/ =~ RUBY_PLATFORM
- File.chmod(0006, @file)
- assert(File::Stat.new(@file).world_writable?)
- File.chmod(0060, @file)
- assert(!(File::Stat.new(@file).world_writable?))
- File.chmod(0600, @file)
- assert(!(File::Stat.new(@file).world_writable?))
- end
-
- def test_stat_executable_p
- return if /cygwin|mswin|bccwin|mingw|emx/ =~ RUBY_PLATFORM
- File.chmod(0100, @file)
- assert(File::Stat.new(@file).executable?)
- File.chmod(0600, @file)
- assert(!(File::Stat.new(@file).executable?))
- end
-
- def test_stat_executable_real_p
- return if /cygwin|mswin|bccwin|mingw|emx/ =~ RUBY_PLATFORM
- File.chmod(0100, @file)
- assert(File::Stat.new(@file).executable_real?)
- File.chmod(0600, @file)
- assert(!(File::Stat.new(@file).executable_real?))
- end
-
- def test_stat_file_p
- assert(!(File::Stat.new(@dir).file?))
- assert(File::Stat.new(@file).file?)
- end
-
- def test_stat_zero_p
- assert_nothing_raised { File::Stat.new(@dir).zero? }
- assert(!(File::Stat.new(@file).zero?))
- assert(File::Stat.new(@zerofile).zero?)
- end
-
- def test_stat_size_p
- assert_nothing_raised { File::Stat.new(@dir).size? }
- assert_equal(3, File::Stat.new(@file).size?)
- assert(!(File::Stat.new(@zerofile).size?))
- end
-
- def test_stat_owned_p ## xxx
- return if /cygwin|mswin|bccwin|mingw|emx/ =~ RUBY_PLATFORM
- assert(File::Stat.new(@file).owned?)
- assert(File::Stat.new(@file).grpowned?)
- end
-
- def test_stat_suid_sgid_sticky ## xxx
- assert(!(File::Stat.new(@file).setuid?))
- assert(!(File::Stat.new(@file).setgid?))
- assert(!(File::Stat.new(@file).sticky?))
- end
-
- def test_stat_size
- assert_integer(File::Stat.new(@dir).size)
- assert_equal(3, File::Stat.new(@file).size)
- assert_equal(0, File::Stat.new(@zerofile).size)
- end
-
- def test_path_check
- assert_nothing_raised { ENV["PATH"] }
- end
-
- def test_find_file
- assert_raise(SecurityError) do
- Thread.new do
- $SAFE = 4
- load(@file)
- end.join
- end
- end
-
- def test_size
- assert_equal(3, File.open(@file) {|f| f.size })
- File.open(@file, "a") do |f|
- f.write("bar")
- assert_equal(6, f.size)
- end
- end
-
- def test_absolute_path
- assert_equal(File.join(Dir.pwd, "~foo"), File.absolute_path("~foo"))
- dir = File.expand_path("/bar")
- assert_equal(File.join(dir, "~foo"), File.absolute_path("~foo", dir))
- end
-end
diff --git a/test/ruby/test_fixnum.rb b/test/ruby/test_fixnum.rb
index e55e324bd1..d17b1f8d49 100644
--- a/test/ruby/test_fixnum.rb
+++ b/test/ruby/test_fixnum.rb
@@ -23,210 +23,4 @@ class TestFixnum < Test::Unit::TestCase
end
end
end
-
- def test_succ
- assert_equal(0x40000000, 0x3fffffff.succ, "[ruby-dev:31189]")
- assert_equal(0x4000000000000000, 0x3fffffffffffffff.succ, "[ruby-dev:31190]")
- end
-
- def test_pred
- assert_equal(-0x40000001, (-0x40000000).pred)
- assert_equal(-0x4000000000000001, (-0x4000000000000000).pred)
- end
-
- def test_plus
- assert_equal(0x40000000, 0x3fffffff+1)
- assert_equal(0x4000000000000000, 0x3fffffffffffffff+1)
- assert_equal(-0x40000001, (-0x40000000)+(-1))
- assert_equal(-0x4000000000000001, (-0x4000000000000000)+(-1))
- assert_equal(-0x80000000, (-0x40000000)+(-0x40000000))
- end
-
- def test_sub
- assert_equal(0x40000000, 0x3fffffff-(-1))
- assert_equal(0x4000000000000000, 0x3fffffffffffffff-(-1))
- assert_equal(-0x40000001, (-0x40000000)-1)
- assert_equal(-0x4000000000000001, (-0x4000000000000000)-1)
- assert_equal(-0x80000000, (-0x40000000)-0x40000000)
- end
-
- def test_mult
- assert_equal(0x40000000, 0x20000000*2)
- assert_equal(0x4000000000000000, 0x2000000000000000*2)
- assert_equal(-0x40000001, 33025*(-32513))
- assert_equal(-0x4000000000000001, 1380655685*(-3340214413))
- assert_equal(0x40000000, (-0x40000000)*(-1))
- end
-
- def test_div
- assert_equal(2, 5/2)
- assert_equal(0, 1/2)
- assert_equal(-1, -1/2)
- assert_equal(0, -(1/2))
- assert_equal(-1, (-1)/2)
- assert_equal(0, (-1)/(-2))
- assert_equal(-1, 1/(-2))
- assert_equal(1, -(1/(-2)))
- assert_equal(0x3fffffff, 0xbffffffd/3)
- assert_equal(0x40000000, 0xc0000000/3)
- assert_equal(0x4000000000000000, 0xc000000000000000/3)
- assert_equal(-0x40000001, 0xc0000003/(-3))
- assert_equal(-0x4000000000000001, 0xc000000000000003/(-3))
- assert_equal(0x40000000, (-0x40000000)/(-1), "[ruby-dev:31210]")
- assert_equal(0x4000000000000000, (-0x4000000000000000)/(-1))
- end
-
- def test_mod
- assert_equal(2, (-0x40000000) % 3)
- assert_equal(0, (-0x40000000) % (-1))
- end
-
- def test_divmod
- (-5).upto(5) {|a|
- (-5).upto(5) {|b|
- next if b == 0
- q, r = a.divmod(b)
- assert_equal(a, b*q+r)
- assert(r.abs < b.abs)
- assert(0 < b ? (0 <= r && r < b) : (b < r && r <= 0))
- assert_equal(q, a/b)
- assert_equal(q, a.div(b))
- assert_equal(r, a%b)
- assert_equal(r, a.modulo(b))
- }
- }
- end
-
- def test_not
- assert_equal(-0x40000000, ~0x3fffffff)
- assert_equal(0x3fffffff, ~-0x40000000)
- end
-
- def test_lshift
- assert_equal(0x40000000, 0x20000000<<1)
- assert_equal(-0x40000000, (-0x20000000)<<1)
- assert_equal(-0x80000000, (-0x40000000)<<1)
- end
-
- def test_rshift
- assert_equal(0x20000000, 0x40000000>>1)
- assert_equal(-0x20000000, (-0x40000000)>>1)
- assert_equal(-0x40000000, (-0x80000000)>>1)
- end
-
- def test_abs
- assert_equal(0x40000000, (-0x40000000).abs)
- assert_equal(0x4000000000000000, (-0x4000000000000000).abs)
- end
-
- def test_to_s
- assert_equal("1010", 10.to_s(2))
- assert_equal("a", 10.to_s(36))
- assert_raise(ArgumentError) { 10.to_s(1) }
- end
-
- def test_plus2
- assert_equal(2, 1 + 1)
- assert_equal(4294967297, 1 + 2**32)
- assert_equal(2.0, 1 + 1.0)
- assert_raise(TypeError) { 1 + nil }
- end
-
- def test_minus
- assert_equal(0, 1 - 1)
- assert_equal(-4294967295, 1 - 2**32)
- assert_equal(0.0, 1 - 1.0)
- assert_raise(TypeError) { 1 - nil }
- end
-
- def test_mul
- assert_equal(6, 2.send(:*, 3))
- a = 2**30-1
- assert_equal(1152921502459363329, a.send(:*, a))
-
- assert_equal(6.0, 2 * 3.0)
- assert_raise(TypeError) { 2 * nil }
- end
-
- def test_divide
- assert_equal(2.0, 4.quo(2))
- assert_equal(2.0, 4 / 2)
- assert_equal(2.0, 4.div(2))
-
- assert_equal(0.5**32, 1.quo(2**32))
- assert_equal(0, 1 / (2**32))
- assert_equal(0, 1.div(2**32))
-
- assert_equal(0.5, 1.quo(2.0))
- assert_equal(0.5, 1 / 2.0)
- assert_equal(0, 1.div(2.0))
-
- ### rational changes the behavior of Fixnum#quo
- #assert_raise(TypeError) { 2.quo(nil) }
- assert_raise(TypeError, NoMethodError) { 2.quo(nil) }
- assert_raise(TypeError) { 2 / nil }
- assert_raise(TypeError) { 2.div(nil) }
-
- assert_equal(0, 4.modulo(2))
- assert_equal(1, 1.modulo(2**32))
- assert_equal(1, 1.modulo(2.0))
- assert_raise(TypeError) { 2.modulo(nil) }
-
- assert_equal([2, 0], 4.divmod(2))
- assert_equal([0, 1], 1.divmod(2**32))
- assert_equal([0, 1], 1.divmod(2.0))
- assert_raise(TypeError) { 2.divmod(nil) }
- end
-
- def test_pow2
- assert_equal(65536, 2**16)
- assert_equal(4294967296, 2**32)
- assert_equal(0.5**16, 2**-16)
- assert_equal(1, (-1)**4294967296)
- assert_equal(-1, (-1)**4294967295)
- assert_equal(4, 2**((2**32).coerce(2).first))
- assert_equal(2, 4**0.5)
- assert_equal(0, 0**0.5)
- assert((0**-1.0).infinite?)
- ### rational changes the behavior of Fixnum#**
- #assert_raise(TypeError) { 1 ** nil }
- assert_raise(TypeError, NoMethodError) { 1 ** nil }
- end
-
- def test_cmp
- assert(1 != nil)
-
- assert_equal(0, 1 <=> 1)
- assert_equal(-1, 1 <=> 4294967296)
- assert_equal(0, 1 <=> 1.0)
- assert_nil(1 <=> nil)
-
- assert(1.send(:>, 0))
- assert(!(1.send(:>, 1)))
- assert(!(1.send(:>, 2)))
- assert(!(1.send(:>, 4294967296)))
- assert(1.send(:>, 0.0))
- assert_raise(ArgumentError) { 1.send(:>, nil) }
-
- assert(1.send(:>=, 0))
- assert(1.send(:>=, 1))
- assert(!(1.send(:>=, 2)))
- assert(!(1.send(:>=, 4294967296)))
- assert(1.send(:>=, 0.0))
- assert_raise(ArgumentError) { 1.send(:>=, nil) }
-
- assert(!(1.send(:<, 0)))
- assert(!(1.send(:<, 1)))
- assert(1.send(:<, 2))
- assert(1.send(:<, 4294967296))
- assert(!(1.send(:<, 0.0)))
- assert_raise(ArgumentError) { 1.send(:<, nil) }
-
- assert(!(1.send(:<=, 0)))
- assert(1.send(:<=, 1))
- assert(1.send(:<=, 2))
- assert(1.send(:<=, 4294967296))
- assert(!(1.send(:<=, 0.0)))
- assert_raise(ArgumentError) { 1.send(:<=, nil) }
- end
end
diff --git a/test/ruby/test_float.rb b/test/ruby/test_float.rb
index 15e17ad92a..cbc6a7886b 100644
--- a/test/ruby/test_float.rb
+++ b/test/ruby/test_float.rb
@@ -11,8 +11,6 @@ class TestFloat < Test::Unit::TestCase
assert_equal(3, 2.6.round)
assert_equal(-2, (-2.4).truncate)
assert((13.4 % 1 - 0.4).abs < 0.0001)
- assert_equal(36893488147419111424,
- 36893488147419107329.0.to_i)
end
def nan_test(x,y)
@@ -75,18 +73,14 @@ class TestFloat < Test::Unit::TestCase
assert(a.abs < Float::EPSILON)
a = Float("-.0")
assert(a.abs < Float::EPSILON)
- assert_raise(ArgumentError){Float("0.")}
- assert_raise(ArgumentError){Float("+0.")}
- assert_raise(ArgumentError){Float("-0.")}
+ assert(a.abs < Float::EPSILON)
assert_raise(ArgumentError){Float(".")}
assert_raise(ArgumentError){Float("+")}
assert_raise(ArgumentError){Float("+.")}
assert_raise(ArgumentError){Float("-")}
assert_raise(ArgumentError){Float("-.")}
assert_raise(ArgumentError){Float("1e")}
- assert_raise(ArgumentError){Float("1__1")}
# add expected behaviour here.
- assert_equal(10, Float("1_0"))
end
def test_divmod
@@ -117,318 +111,37 @@ class TestFloat < Test::Unit::TestCase
assert_equal(-3.5, (-11.5).remainder(-4))
end
- def test_to_s
- inf = 1.0 / 0.0
- assert_equal("Infinity", inf.to_s)
- assert_equal("-Infinity", (-inf).to_s)
- assert_equal("NaN", (inf / inf).to_s)
-
- assert_equal("1.0e+18", 1000_00000_00000_00000.0.to_s)
- end
-
- def test_coerce
- assert_equal(Float, 1.0.coerce(1).first.class)
- end
-
- def test_plus
- assert_equal(4.0, 2.0.send(:+, 2))
- assert_equal(4.0, 2.0.send(:+, (2**32).coerce(2).first))
- assert_equal(4.0, 2.0.send(:+, 2.0))
- assert_raise(TypeError) { 2.0.send(:+, nil) }
- end
-
- def test_minus
- assert_equal(0.0, 2.0.send(:-, 2))
- assert_equal(0.0, 2.0.send(:-, (2**32).coerce(2).first))
- assert_equal(0.0, 2.0.send(:-, 2.0))
- assert_raise(TypeError) { 2.0.send(:-, nil) }
- end
-
- def test_mul
- assert_equal(4.0, 2.0.send(:*, 2))
- assert_equal(4.0, 2.0.send(:*, (2**32).coerce(2).first))
- assert_equal(4.0, 2.0.send(:*, 2.0))
- assert_raise(TypeError) { 2.0.send(:*, nil) }
- end
-
- def test_div2
- assert_equal(1.0, 2.0.send(:/, 2))
- assert_equal(1.0, 2.0.send(:/, (2**32).coerce(2).first))
- assert_equal(1.0, 2.0.send(:/, 2.0))
- assert_raise(TypeError) { 2.0.send(:/, nil) }
- end
-
- def test_modulo2
- assert_equal(0.0, 2.0.send(:%, 2))
- assert_equal(0.0, 2.0.send(:%, (2**32).coerce(2).first))
- assert_equal(0.0, 2.0.send(:%, 2.0))
- assert_raise(TypeError) { 2.0.send(:%, nil) }
- end
-
- def test_divmod2
- assert_equal([1.0, 0.0], 2.0.divmod(2))
- assert_equal([1.0, 0.0], 2.0.divmod((2**32).coerce(2).first))
- assert_equal([1.0, 0.0], 2.0.divmod(2.0))
- assert_raise(TypeError) { 2.0.divmod(nil) }
-
- inf = 1.0 / 0.0
- assert_raise(ZeroDivisionError) {inf.divmod(0)}
-
- a, b = (2.0**32).divmod(1.0)
- assert_equal(2**32, a)
- assert_equal(0, b)
- end
-
- def test_pow
- assert_equal(1.0, 1.0 ** (2**32))
- assert_equal(1.0, 1.0 ** 1.0)
- assert_raise(TypeError) { 1.0 ** nil }
- end
-
- def test_eql
- inf = 1.0 / 0.0
- nan = inf / inf
- assert(1.0.eql?(1.0))
- assert(inf.eql?(inf))
- assert(!(nan.eql?(nan)))
- assert(!(1.0.eql?(nil)))
-
- assert(1.0 == 1)
- assert(1.0 != 2**32)
- assert(1.0 != nan)
- assert(1.0 != nil)
- end
-
- def test_cmp
- inf = 1.0 / 0.0
- nan = inf / inf
- assert_equal(0, 1.0 <=> 1.0)
- assert_equal(1, 1.0 <=> 0.0)
- assert_equal(-1, 1.0 <=> 2.0)
- assert_nil(1.0 <=> nil)
- assert_nil(1.0 <=> nan)
- assert_nil(nan <=> 1.0)
-
- assert_equal(0, 1.0 <=> 1)
- assert_equal(1, 1.0 <=> 0)
- assert_equal(-1, 1.0 <=> 2)
-
- assert_equal(-1, 1.0 <=> 2**32)
-
- assert_equal(1, inf <=> (Float::MAX.to_i*2))
- assert_equal(-1, -inf <=> (-Float::MAX.to_i*2))
- assert_equal(-1, (Float::MAX.to_i*2) <=> inf)
- assert_equal(1, (-Float::MAX.to_i*2) <=> -inf)
-
- assert_raise(ArgumentError) { 1.0 > nil }
- assert_raise(ArgumentError) { 1.0 >= nil }
- assert_raise(ArgumentError) { 1.0 < nil }
- assert_raise(ArgumentError) { 1.0 <= nil }
- end
-
- def test_zero_p
- assert(0.0.zero?)
- assert(!(1.0.zero?))
- end
-
- def test_infinite_p
- inf = 1.0 / 0.0
- assert(1, inf.infinite?)
- assert(1, (-inf).infinite?)
- assert_nil(1.0.infinite?)
- end
-
- def test_finite_p
- inf = 1.0 / 0.0
- assert(!(inf.finite?))
- assert(!((-inf).finite?))
- assert(1.0.finite?)
- end
-
- def test_floor_ceil_round_truncate
- assert_equal(1, 1.5.floor)
- assert_equal(2, 1.5.ceil)
- assert_equal(2, 1.5.round)
- assert_equal(1, 1.5.truncate)
-
- assert_equal(2, 2.0.floor)
- assert_equal(2, 2.0.ceil)
- assert_equal(2, 2.0.round)
- assert_equal(2, 2.0.truncate)
-
- assert_equal(-2, (-1.5).floor)
- assert_equal(-1, (-1.5).ceil)
- assert_equal(-2, (-1.5).round)
- assert_equal(-1, (-1.5).truncate)
-
- assert_equal(-2, (-2.0).floor)
- assert_equal(-2, (-2.0).ceil)
- assert_equal(-2, (-2.0).round)
- assert_equal(-2, (-2.0).truncate)
-
- inf = 1.0/0.0
- assert_raise(FloatDomainError) { inf.floor }
- assert_raise(FloatDomainError) { inf.ceil }
- assert_raise(FloatDomainError) { inf.round }
- assert_raise(FloatDomainError) { inf.truncate }
-
- assert_equal(1.100, 1.111.round(1))
- assert_equal(1.110, 1.111.round(2))
- assert_equal(11110.0, 11111.1.round(-1))
- assert_equal(11100.0, 11111.1.round(-2))
- end
-
- VS = [
- 18446744073709551617.0,
- 18446744073709551616.0,
- 18446744073709551615.8,
- 18446744073709551615.5,
- 18446744073709551615.2,
- 18446744073709551615.0,
- 18446744073709551614.0,
-
- 4611686018427387905.0,
- 4611686018427387904.0,
- 4611686018427387903.8,
- 4611686018427387903.5,
- 4611686018427387903.2,
- 4611686018427387903.0,
- 4611686018427387902.0,
-
- 4294967297.0,
- 4294967296.0,
- 4294967295.8,
- 4294967295.5,
- 4294967295.2,
- 4294967295.0,
- 4294967294.0,
-
- 1073741825.0,
- 1073741824.0,
- 1073741823.8,
- 1073741823.5,
- 1073741823.2,
- 1073741823.0,
- 1073741822.0,
-
- -1073741823.0,
- -1073741824.0,
- -1073741824.2,
- -1073741824.5,
- -1073741824.8,
- -1073741825.0,
- -1073741826.0,
-
- -4294967295.0,
- -4294967296.0,
- -4294967296.2,
- -4294967296.5,
- -4294967296.8,
- -4294967297.0,
- -4294967298.0,
-
- -4611686018427387903.0,
- -4611686018427387904.0,
- -4611686018427387904.2,
- -4611686018427387904.5,
- -4611686018427387904.8,
- -4611686018427387905.0,
- -4611686018427387906.0,
-
- -18446744073709551615.0,
- -18446744073709551616.0,
- -18446744073709551616.2,
- -18446744073709551616.5,
- -18446744073709551616.8,
- -18446744073709551617.0,
- -18446744073709551618.0,
- ]
-
- def test_truncate
- VS.each {|f|
- i = f.truncate
- assert_equal(i, f.to_i)
- if f < 0
- assert_operator(i, :<, 0)
- else
- assert_operator(i, :>, 0)
- end
- assert_operator(i.abs, :<=, f.abs)
- d = f.abs - i.abs
- assert_operator(0, :<=, d)
- assert_operator(d, :<, 1)
- }
- end
-
- def test_ceil
- VS.each {|f|
- i = f.ceil
- if f < 0
- assert_operator(i, :<, 0)
- else
- assert_operator(i, :>, 0)
- end
- assert_operator(i, :>=, f)
- d = f - i
- assert_operator(-1, :<, d)
- assert_operator(d, :<=, 0)
- }
- end
-
- def test_floor
- VS.each {|f|
- i = f.floor
- if f < 0
- assert_operator(i, :<, 0)
- else
- assert_operator(i, :>, 0)
- end
- assert_operator(i, :<=, f)
- d = f - i
- assert_operator(0, :<=, d)
- assert_operator(d, :<, 1)
- }
- end
-
- def test_round
- VS.each {|f|
- i = f.round
- if f < 0
- assert_operator(i, :<, 0)
- else
- assert_operator(i, :>, 0)
- end
- d = f - i
- assert_operator(-0.5, :<=, d)
- assert_operator(d, :<=, 0.5)
- }
- end
-
- def test_Float
- assert_in_delta(0.125, Float("0.1_2_5"), 0.00001)
- assert_in_delta(0.125, "0.1_2_5__".to_f, 0.00001)
- assert(Float(([1] * 10000).join).infinite?)
- assert(!Float(([1] * 10000).join("_")).infinite?) # is it really OK?
- assert_raise(ArgumentError) { Float("1.0\x001") }
- assert(Float("1e10_00").infinite?)
- assert_raise(TypeError) { Float(nil) }
- o = Object.new
- def o.to_f; inf = 1.0/0.0; inf/inf; end
- assert(Float(o).nan?)
- end
-
- def test_num2dbl
- assert_raise(TypeError) do
- 1.0.step(2.0, "0.5") {}
- end
- assert_raise(TypeError) do
- 1.0.step(2.0, nil) {}
- end
- end
-
- def test_sleep_with_Float
- assert_nothing_raised("[ruby-core:23282]") do
- sleep(0.1+0.1+0.1+0.1+0.1+0.1+0.1+0.1+0.1+0.1)
- end
+ def test_to_i
+ assert_operator(4611686018427387905.0.to_i, :>, 0)
+ assert_operator(4611686018427387904.0.to_i, :>, 0)
+ assert_operator(4611686018427387903.8.to_i, :>, 0)
+ assert_operator(4611686018427387903.5.to_i, :>, 0)
+ assert_operator(4611686018427387903.2.to_i, :>, 0)
+ assert_operator(4611686018427387903.0.to_i, :>, 0)
+ assert_operator(4611686018427387902.0.to_i, :>, 0)
+
+ assert_operator(1073741825.0.to_i, :>, 0)
+ assert_operator(1073741824.0.to_i, :>, 0)
+ assert_operator(1073741823.8.to_i, :>, 0)
+ assert_operator(1073741823.5.to_i, :>, 0)
+ assert_operator(1073741823.2.to_i, :>, 0)
+ assert_operator(1073741823.0.to_i, :>, 0)
+ assert_operator(1073741822.0.to_i, :>, 0)
+
+ assert_operator((-1073741823.0).to_i, :<, 0)
+ assert_operator((-1073741824.0).to_i, :<, 0)
+ assert_operator((-1073741824.2).to_i, :<, 0)
+ assert_operator((-1073741824.5).to_i, :<, 0)
+ assert_operator((-1073741824.8).to_i, :<, 0)
+ assert_operator((-1073741825.0).to_i, :<, 0)
+ assert_operator((-1073741826.0).to_i, :<, 0)
+
+ assert_operator((-4611686018427387903.0).to_i, :<, 0)
+ assert_operator((-4611686018427387904.0).to_i, :<, 0)
+ assert_operator((-4611686018427387904.2).to_i, :<, 0)
+ assert_operator((-4611686018427387904.5).to_i, :<, 0)
+ assert_operator((-4611686018427387904.8).to_i, :<, 0)
+ assert_operator((-4611686018427387905.0).to_i, :<, 0)
+ assert_operator((-4611686018427387906.0).to_i, :<, 0)
end
end
diff --git a/test/ruby/test_fnmatch.rb b/test/ruby/test_fnmatch.rb
deleted file mode 100644
index 1c1a158477..0000000000
--- a/test/ruby/test_fnmatch.rb
+++ /dev/null
@@ -1,104 +0,0 @@
-require 'test/unit'
-
-class TestFnmatch < Test::Unit::TestCase
-
- def bracket_test(s, t) # `s' should start with neither '!' nor '^'
- 0x21.upto(0x7E) do |i|
- assert_equal(t.include?(i.chr), File.fnmatch("[#{s}]", i.chr, File::FNM_DOTMATCH))
- assert_equal(t.include?(i.chr), !File.fnmatch("[^#{s}]", i.chr, File::FNM_DOTMATCH))
- assert_equal(t.include?(i.chr), !File.fnmatch("[!#{s}]", i.chr, File::FNM_DOTMATCH))
- end
- end
- def test_fnmatch
- assert(File.fnmatch('\[1\]' , '[1]'), "[ruby-dev:22819]")
- assert(File.fnmatch('*?', 'a'), "[ruby-dev:22815]")
- assert(File.fnmatch('*/', 'a/'))
- assert(File.fnmatch('\[1\]' , '[1]', File::FNM_PATHNAME))
- assert(File.fnmatch('*?', 'a', File::FNM_PATHNAME))
- assert(File.fnmatch('*/', 'a/', File::FNM_PATHNAME))
- # text
- assert(File.fnmatch('cat', 'cat'))
- assert(!File.fnmatch('cat', 'category'))
- assert(!File.fnmatch('cat', 'wildcat'))
- # '?' matches any one character
- assert(File.fnmatch('?at', 'cat'))
- assert(File.fnmatch('c?t', 'cat'))
- assert(File.fnmatch('ca?', 'cat'))
- assert(File.fnmatch('?a?', 'cat'))
- assert(!File.fnmatch('c??t', 'cat'))
- assert(!File.fnmatch('??at', 'cat'))
- assert(!File.fnmatch('ca??', 'cat'))
- # '*' matches any number (including 0) of any characters
- assert(File.fnmatch('c*', 'cats'))
- assert(File.fnmatch('c*ts', 'cats'))
- assert(File.fnmatch('*ts', 'cats'))
- assert(File.fnmatch('*c*a*t*s*', 'cats'))
- assert(!File.fnmatch('c*t', 'cats'))
- assert(!File.fnmatch('*abc', 'abcabz'))
- assert(File.fnmatch('*abz', 'abcabz'))
- assert(!File.fnmatch('a*abc', 'abc'))
- assert(File.fnmatch('a*bc', 'abc'))
- assert(!File.fnmatch('a*bc', 'abcd'))
- # [seq] : matches any character listed between bracket
- # [!seq] or [^seq] : matches any character except those listed between bracket
- bracket_test("bd-gikl-mosv-x", "bdefgiklmosvwx")
- # escaping character
- assert(File.fnmatch('\?', '?'))
- assert(!File.fnmatch('\?', '\?'))
- assert(!File.fnmatch('\?', 'a'))
- assert(!File.fnmatch('\?', '\a'))
- assert(File.fnmatch('\*', '*'))
- assert(!File.fnmatch('\*', '\*'))
- assert(!File.fnmatch('\*', 'cats'))
- assert(!File.fnmatch('\*', '\cats'))
- assert(File.fnmatch('\a', 'a'))
- assert(!File.fnmatch('\a', '\a'))
- assert(File.fnmatch('[a\-c]', 'a'))
- assert(File.fnmatch('[a\-c]', '-'))
- assert(File.fnmatch('[a\-c]', 'c'))
- assert(!File.fnmatch('[a\-c]', 'b'))
- assert(!File.fnmatch('[a\-c]', '\\'))
- # escaping character loses its meaning if FNM_NOESCAPE is set
- assert(!File.fnmatch('\?', '?', File::FNM_NOESCAPE))
- assert(File.fnmatch('\?', '\?', File::FNM_NOESCAPE))
- assert(!File.fnmatch('\?', 'a', File::FNM_NOESCAPE))
- assert(File.fnmatch('\?', '\a', File::FNM_NOESCAPE))
- assert(!File.fnmatch('\*', '*', File::FNM_NOESCAPE))
- assert(File.fnmatch('\*', '\*', File::FNM_NOESCAPE))
- assert(!File.fnmatch('\*', 'cats', File::FNM_NOESCAPE))
- assert(File.fnmatch('\*', '\cats', File::FNM_NOESCAPE))
- assert(!File.fnmatch('\a', 'a', File::FNM_NOESCAPE))
- assert(File.fnmatch('\a', '\a', File::FNM_NOESCAPE))
- assert(File.fnmatch('[a\-c]', 'a', File::FNM_NOESCAPE))
- assert(!File.fnmatch('[a\-c]', '-', File::FNM_NOESCAPE))
- assert(File.fnmatch('[a\-c]', 'c', File::FNM_NOESCAPE))
- assert(File.fnmatch('[a\-c]', 'b', File::FNM_NOESCAPE)) # '\\' < 'b' < 'c'
- assert(File.fnmatch('[a\-c]', '\\', File::FNM_NOESCAPE))
- # case is ignored if FNM_CASEFOLD is set
- assert(!File.fnmatch('cat', 'CAT'))
- assert(File.fnmatch('cat', 'CAT', File::FNM_CASEFOLD))
- assert(!File.fnmatch('[a-z]', 'D'))
- assert(File.fnmatch('[a-z]', 'D', File::FNM_CASEFOLD))
- # wildcard doesn't match '/' if FNM_PATHNAME is set
- assert(File.fnmatch('foo?boo', 'foo/boo'))
- assert(File.fnmatch('foo*', 'foo/boo'))
- assert(!File.fnmatch('foo?boo', 'foo/boo', File::FNM_PATHNAME))
- assert(!File.fnmatch('foo*', 'foo/boo', File::FNM_PATHNAME))
- # wildcard matches leading period if FNM_DOTMATCH is set
- assert(!File.fnmatch('*', '.profile'))
- assert(File.fnmatch('*', '.profile', File::FNM_DOTMATCH))
- assert(File.fnmatch('.*', '.profile'))
- assert(File.fnmatch('*', 'dave/.profile'))
- assert(File.fnmatch('*/*', 'dave/.profile'))
- assert(!File.fnmatch('*/*', 'dave/.profile', File::FNM_PATHNAME))
- assert(File.fnmatch('*/*', 'dave/.profile', File::FNM_PATHNAME | File::FNM_DOTMATCH))
- # recursive matching
- assert(File.fnmatch('**/foo', 'a/b/c/foo', File::FNM_PATHNAME))
- assert(File.fnmatch('**/foo', '/foo', File::FNM_PATHNAME))
- assert(!File.fnmatch('**/foo', 'a/.b/c/foo', File::FNM_PATHNAME))
- assert(File.fnmatch('**/foo', 'a/.b/c/foo', File::FNM_PATHNAME | File::FNM_DOTMATCH))
- assert(File.fnmatch('**/foo', '/root/foo', File::FNM_PATHNAME))
- assert(File.fnmatch('**/foo', 'c:/root/foo', File::FNM_PATHNAME))
- end
-
-end
diff --git a/test/ruby/test_gc.rb b/test/ruby/test_gc.rb
index 1bd3df4c1a..d0b4e3df77 100644
--- a/test/ruby/test_gc.rb
+++ b/test/ruby/test_gc.rb
@@ -8,9 +8,6 @@ class TestGc < Test::Unit::TestCase
end
def test_gc
- prev_stress = GC.stress
- GC.stress = false
-
assert_nothing_raised do
1.upto(10000) {
tmp = [0,1,2,3,4,5,6,7,8,9]
@@ -29,26 +26,5 @@ class TestGc < Test::Unit::TestCase
}
GC.start
assert true # reach here or dumps core
-
- GC.stress = prev_stress
- end
-
- def test_enable_disable
- GC.enable
- assert_equal(false, GC.enable)
- assert_equal(false, GC.disable)
- assert_equal(true, GC.disable)
- assert_equal(true, GC.disable)
- assert_nil(GC.start)
- assert_equal(true, GC.enable)
- assert_equal(false, GC.enable)
- ensure
- GC.enable
- end
-
- def test_count
- c = GC.count
- GC.start
- assert_operator(c, :<, GC.count)
end
end
diff --git a/test/ruby/test_hash.rb b/test/ruby/test_hash.rb
index c860b25239..4131a6bdd3 100644
--- a/test/ruby/test_hash.rb
+++ b/test/ruby/test_hash.rb
@@ -1,11 +1,10 @@
require 'test/unit'
-require 'continuation'
class TestHash < Test::Unit::TestCase
def test_hash
x = {1=>2, 2=>4, 3=>6}
- y = {1=>2, 2=>4, 3=>6} # y = {1, 2, 2, 4, 3, 6} # 1.9 doesn't support
+ y = {1, 2, 2, 4, 3, 6}
assert_equal(2, x[1])
@@ -83,12 +82,6 @@ class TestHash < Test::Unit::TestCase
self => 'self', true => 'true', nil => 'nil',
'nil' => nil
]
- @verbose = $VERBOSE
- $VERBOSE = nil
- end
-
- def teardown
- $VERBOSE = @verbose
end
def test_s_AREF
@@ -113,7 +106,7 @@ class TestHash < Test::Unit::TestCase
assert_instance_of(@cls, h)
assert_equal('default', h.default)
assert_equal('default', h['spurious'])
-
+
end
def test_AREF # '[]'
@@ -206,20 +199,16 @@ class TestHash < Test::Unit::TestCase
def test_clone
for taint in [ false, true ]
- for untrust in [ false, true ]
- for frozen in [ false, true ]
- a = @h.clone
- a.taint if taint
- a.untrust if untrust
- a.freeze if frozen
- b = a.clone
-
- assert_equal(a, b)
- assert(a.__id__ != b.__id__)
- assert_equal(a.frozen?, b.frozen?)
- assert_equal(a.untrusted?, b.untrusted?)
- assert_equal(a.tainted?, b.tainted?)
- end
+ for frozen in [ false, true ]
+ a = @h.clone
+ a.taint if taint
+ a.freeze if frozen
+ b = a.clone
+
+ assert_equal(a, b)
+ assert(a.__id__ != b.__id__)
+ assert_equal(a.frozen?, b.frozen?)
+ assert_equal(a.tainted?, b.tainted?)
end
end
end
@@ -292,19 +281,16 @@ class TestHash < Test::Unit::TestCase
def test_dup
for taint in [ false, true ]
- for untrust in [ false, true ]
- for frozen in [ false, true ]
- a = @h.dup
- a.taint if taint
- a.freeze if frozen
- b = a.dup
-
- assert_equal(a, b)
- assert(a.__id__ != b.__id__)
- assert_equal(false, b.frozen?)
- assert_equal(a.tainted?, b.tainted?)
- assert_equal(a.untrusted?, b.untrusted?)
- end
+ for frozen in [ false, true ]
+ a = @h.dup
+ a.taint if taint
+ a.freeze if frozen
+ b = a.dup
+
+ assert_equal(a, b)
+ assert(a.__id__ != b.__id__)
+ assert_equal(false, b.frozen?)
+ assert_equal(a.tainted?, b.tainted?)
end
end
end
@@ -366,8 +352,8 @@ class TestHash < Test::Unit::TestCase
end
def test_fetch
- assert_raise(KeyError) { @cls[].fetch(1) }
- assert_raise(KeyError) { @h.fetch('gumby') }
+ assert_raise(IndexError) { @cls[].fetch(1) }
+ assert_raise(IndexError) { @h.fetch('gumby') }
assert_equal('gumbygumby', @h.fetch('gumby') {|k| k * 2 })
assert_equal('pokey', @h.fetch('gumby', 'pokey'))
@@ -400,15 +386,6 @@ class TestHash < Test::Unit::TestCase
assert(!@h.include?('gumby'))
end
- def test_key
- assert_equal(1, @h.key('one'))
- assert_equal(nil, @h.key('nil'))
- assert_equal('nil', @h.key(nil))
-
- assert_equal(nil, @h.key('gumby'))
- assert_equal(nil, @cls[].key('gumby'))
- end
-
def test_values_at
res = @h.values_at('dog', 'cat', 'horse')
assert(res.length == 3)
@@ -539,7 +516,7 @@ class TestHash < Test::Unit::TestCase
def test_shift
h = @h.dup
-
+
@h.length.times {
k, v = h.shift
assert(@h.key?(k))
@@ -606,13 +583,6 @@ class TestHash < Test::Unit::TestCase
assert_equal([3,4], a.delete([3,4]))
assert_equal([5,6], a.delete([5,6]))
assert_equal(0, a.length)
-
- h = @cls[ 1=>2, 3=>4, 5=>6 ]
- h.taint
- h.untrust
- a = h.to_a
- assert_equal(true, a.tainted?)
- assert_equal(true, a.untrusted?)
end
def test_to_hash
@@ -622,12 +592,11 @@ class TestHash < Test::Unit::TestCase
def test_to_s
h = @cls[ 1 => 2, "cat" => "dog", 1.5 => :fred ]
- assert_equal(h.inspect, h.to_s)
+ assert_equal(h.to_a.join, h.to_s)
$, = ":"
- assert_equal(h.inspect, h.to_s)
+ assert_equal(h.to_a.join, h.to_s)
h = @cls[]
- assert_equal(h.inspect, h.to_s)
- ensure
+ assert_equal(h.to_a.join, h.to_s)
$, = nil
end
@@ -666,209 +635,7 @@ class TestHash < Test::Unit::TestCase
assert_equal([], expected - vals)
end
- def test_security_check
- h = {}
- assert_raise(SecurityError) do
- Thread.new do
- $SAFE = 4
- h[1] = 1
- end.join
- end
- end
-
- def test_intialize_wrong_arguments
- assert_raise(ArgumentError) do
- Hash.new(0) { }
- end
- end
-
- def test_create
- assert_equal({1=>2, 3=>4}, Hash[[[1,2],[3,4]]])
- assert_raise(ArgumentError) { Hash[0, 1, 2] }
- assert_equal({1=>2, 3=>4}, Hash[1,2,3,4])
- o = Object.new
- def o.to_hash() {1=>2} end
- assert_equal({1=>2}, Hash[o], "[ruby-dev:34555]")
- end
-
- def test_rehash2
- h = {1 => 2, 3 => 4}
- assert_equal(h.dup, h.rehash)
- assert_raise(RuntimeError) { h.each { h.rehash } }
- assert_equal({}, {}.rehash)
- end
-
- def test_fetch2
- assert_equal(:bar, @h.fetch(0, :foo) { :bar })
- end
-
- def test_default_proc
- h = Hash.new {|h, k| h + k + "baz" }
- assert_equal("foobarbaz", h.default_proc.call("foo", "bar"))
- h = {}
- assert_nil(h.default_proc)
- end
-
- def test_shift2
- h = Hash.new {|h, k| :foo }
- h[1] = 2
- assert_equal([1, 2], h.shift)
- assert_equal(:foo, h.shift)
- assert_equal(:foo, h.shift)
-
- h = Hash.new(:foo)
- h[1] = 2
- assert_equal([1, 2], h.shift)
- assert_equal(:foo, h.shift)
- assert_equal(:foo, h.shift)
-
- h = {1=>2}
- h.each { assert_equal([1, 2], h.shift) }
- end
-
- def test_reject_bang2
- assert_equal({1=>2}, {1=>2,3=>4}.reject! {|k, v| k + v == 7 })
- assert_nil({1=>2,3=>4}.reject! {|k, v| k == 5 })
- assert_nil({}.reject! { })
- end
-
- def test_select
- assert_equal({3=>4,5=>6}, {1=>2,3=>4,5=>6}.select {|k, v| k + v >= 7 })
- end
-
- def test_clear2
- assert_equal({}, {1=>2,3=>4,5=>6}.clear)
- h = {1=>2,3=>4,5=>6}
- h.each { h.clear }
- assert_equal({}, h)
- end
-
- def test_replace2
- h1 = Hash.new { :foo }
- h2 = {}
- h2.replace h1
- assert_equal(:foo, h2[0])
- end
-
- def test_size2
- assert_equal(0, {}.size)
- end
-
- def test_equal2
- assert({} != 0)
- o = Object.new
- def o.to_hash; {}; end
- def o.==(x); true; end
- assert({} == o)
- def o.==(x); false; end
- assert({} != o)
-
- h1 = {1=>2}; h2 = {3=>4}
- assert(h1 != h2)
- h1 = {1=>2}; h2 = {1=>4}
- assert(h1 != h2)
- end
-
- def test_eql
- assert(!({}.eql?(0)))
- o = Object.new
- def o.to_hash; {}; end
- def o.eql?(x); true; end
- assert({}.eql?(o))
- def o.eql?(x); false; end
- assert(!({}.eql?(o)))
- end
-
- def test_hash2
- assert_kind_of(Integer, {}.hash)
- end
-
- def test_update2
- h1 = {1=>2, 3=>4}
- h2 = {1=>3, 5=>7}
- h1.update(h2) {|k, v1, v2| k + v1 + v2 }
- assert_equal({1=>6, 3=>4, 5=>7}, h1)
- end
-
- def test_merge
- h1 = {1=>2, 3=>4}
- h2 = {1=>3, 5=>7}
- assert_equal({1=>3, 3=>4, 5=>7}, h1.merge(h2))
- assert_equal({1=>6, 3=>4, 5=>7}, h1.merge(h2) {|k, v1, v2| k + v1 + v2 })
- end
-
- def test_assoc
- assert_equal([3,4], {1=>2, 3=>4, 5=>6}.assoc(3))
- assert_nil({1=>2, 3=>4, 5=>6}.assoc(4))
- end
-
- def test_rassoc
- assert_equal([3,4], {1=>2, 3=>4, 5=>6}.rassoc(4))
- assert_nil({1=>2, 3=>4, 5=>6}.rassoc(3))
- end
-
- def test_flatten
- assert_equal([[1], [2]], {[1] => [2]}.flatten)
- end
-
- def test_callcc
- h = {1=>2}
- c = nil
- f = false
- h.each { callcc {|c2| c = c2 } }
- unless f
- f = true
- c.call
- end
- assert_raise(RuntimeError) { h.each { h.rehash } }
-
- h = {1=>2}
- c = nil
- assert_raise(RuntimeError) do
- h.each { callcc {|c2| c = c2 } }
- h.clear
- c.call
- end
- end
-
- def test_compare_by_identity
- a = "foo"
- assert(!{}.compare_by_identity?)
- h = { a => "bar" }
- assert(!h.compare_by_identity?)
- h.compare_by_identity
- assert(h.compare_by_identity?)
- #assert_equal("bar", h[a])
- assert_nil(h["foo"])
- end
-
- class ObjWithHash
- def initialize(value, hash)
- @value = value
- @hash = hash
- end
- attr_reader :value, :hash
-
- def eql?(other)
- @value == other.value
- end
- end
-
def test_hash_hash
assert_equal({0=>2,11=>1}.hash, {11=>1,0=>2}.hash)
- o1 = ObjWithHash.new(0,1)
- o2 = ObjWithHash.new(11,1)
- assert_equal({o1=>1,o2=>2}.hash, {o2=>2,o1=>1}.hash)
- end
-
- def test_hash_bignum_hash
- x = 2<<(32-3)-1
- assert_equal({x=>1}.hash, {x=>1}.hash)
- x = 2<<(64-3)-1
- assert_equal({x=>1}.hash, {x=>1}.hash)
-
- o = Object.new
- def o.hash; 2<<100; end
- assert_equal({x=>1}.hash, {x=>1}.hash)
end
end
diff --git a/test/ruby/test_integer.rb b/test/ruby/test_integer.rb
index 232a7fae30..cfda9e5985 100644
--- a/test/ruby/test_integer.rb
+++ b/test/ruby/test_integer.rb
@@ -1,6 +1,112 @@
require 'test/unit'
class TestInteger < Test::Unit::TestCase
+ VS = [
+ -0x1000000000000000000000000000000000000000000000002,
+ -0x1000000000000000000000000000000000000000000000001,
+ -0x1000000000000000000000000000000000000000000000000,
+ -0xffffffffffffffffffffffffffffffffffffffffffffffff,
+ -0x1000000000000000000000002,
+ -0x1000000000000000000000001,
+ -0x1000000000000000000000000,
+ -0xffffffffffffffffffffffff,
+ -0x10000000000000002,
+ -0x10000000000000001,
+ -0x10000000000000000,
+ -0xffffffffffffffff,
+ -0x4000000000000002,
+ -0x4000000000000001,
+ -0x4000000000000000,
+ -0x3fffffffffffffff,
+ -0x100000002,
+ -0x100000001,
+ -0x100000000,
+ -0xffffffff,
+ -0xc717a08d, # 0xc717a08d * 0x524b2245 = 0x4000000000000001
+ -0x80000002,
+ -0x80000001,
+ -0x80000000,
+ -0x7fffffff,
+ -0x524b2245,
+ -0x40000002,
+ -0x40000001,
+ -0x40000000,
+ -0x3fffffff,
+ -0x10002,
+ -0x10001,
+ -0x10000,
+ -0xffff,
+ -0x8101, # 0x8101 * 0x7f01 = 0x40000001
+ -0x8002,
+ -0x8001,
+ -0x8000,
+ -0x7fff,
+ -0x7f01,
+ -65,
+ -64,
+ -63,
+ -62,
+ -33,
+ -32,
+ -31,
+ -30,
+ -3,
+ -2,
+ -1,
+ 0,
+ 1,
+ 2,
+ 3,
+ 30,
+ 31,
+ 32,
+ 33,
+ 62,
+ 63,
+ 64,
+ 65,
+ 0x7f01,
+ 0x7ffe,
+ 0x7fff,
+ 0x8000,
+ 0x8001,
+ 0x8101,
+ 0xfffe,
+ 0xffff,
+ 0x10000,
+ 0x10001,
+ 0x3ffffffe,
+ 0x3fffffff,
+ 0x40000000,
+ 0x40000001,
+ 0x524b2245,
+ 0x7ffffffe,
+ 0x7fffffff,
+ 0x80000000,
+ 0x80000001,
+ 0xc717a08d,
+ 0xfffffffe,
+ 0xffffffff,
+ 0x100000000,
+ 0x100000001,
+ 0x3ffffffffffffffe,
+ 0x3fffffffffffffff,
+ 0x4000000000000000,
+ 0x4000000000000001,
+ 0xfffffffffffffffe,
+ 0xffffffffffffffff,
+ 0x10000000000000000,
+ 0x10000000000000001,
+ 0xffffffffffffffffffffffff,
+ 0x1000000000000000000000000,
+ 0x1000000000000000000000001,
+ 0xffffffffffffffffffffffffffffffffffffffffffffffff,
+ 0x1000000000000000000000000000000000000000000000000,
+ 0x1000000000000000000000000000000000000000000000001
+ ]
+
+ #VS.map! {|v| 0x4000000000000000.coerce(v)[0] }
+
BDSIZE = 0x4000000000000000.coerce(0)[0].size
def self.bdsize(x)
((x + 1) / 8 + BDSIZE) / BDSIZE * BDSIZE
@@ -9,7 +115,47 @@ class TestInteger < Test::Unit::TestCase
self.class.bdsize(x)
end
+ min = -1
+ min *= 2 while min.class == Fixnum
+ FIXNUM_MIN = min/2
+ max = 1
+ max *= 2 while (max-1).class == Fixnum
+ FIXNUM_MAX = max/2-1
+
+ def test_fixnum_range
+ assert_instance_of(Bignum, FIXNUM_MIN-1)
+ assert_instance_of(Fixnum, FIXNUM_MIN)
+ assert_instance_of(Fixnum, FIXNUM_MAX)
+ assert_instance_of(Bignum, FIXNUM_MAX+1)
+ end
+
+ def check_class(n)
+ if FIXNUM_MIN <= n && n <= FIXNUM_MAX
+ assert_instance_of(Fixnum, n)
+ else
+ assert_instance_of(Bignum, n)
+ end
+ end
+
def test_aref
+ VS.each {|a|
+ 100.times {|i|
+ assert_equal((a >> i).odd? ? 1 : 0, a[i], "(#{a})[#{i}]")
+ }
+ }
+ VS.each {|a|
+ VS.each {|b|
+ c = nil
+ assert_nothing_raised("(#{a})[#{b}]") { c = a[b] }
+ check_class(c)
+ if b < 0
+ assert_equal(0, c, "(#{a})[#{b}]")
+ else
+ assert_equal((a >> b).odd? ? 1 : 0, c, "(#{a})[#{b}]")
+ end
+ }
+ }
+
# assert_equal(1, (1 << 0x40000000)[0x40000000], "[ruby-dev:31271]")
# assert_equal(0, (-1 << 0x40000001)[0x40000000], "[ruby-dev:31271]")
big_zero = 0x40000000.coerce(0)[0]
@@ -17,15 +163,155 @@ class TestInteger < Test::Unit::TestCase
assert_equal(1, 0x400000001[big_zero], "[ruby-dev:31271]")
end
+ def test_plus
+ VS.each {|a|
+ VS.each {|b|
+ c = a + b
+ check_class(c)
+ assert_equal(b + a, c, "#{a} + #{b}")
+ assert_equal(a, c - b, "(#{a} + #{b}) - #{b}")
+ assert_equal(a-~b-1, c, "#{a} + #{b}") # Hacker's Delight
+ assert_equal((a^b)+2*(a&b), c, "#{a} + #{b}") # Hacker's Delight
+ assert_equal((a|b)+(a&b), c, "#{a} + #{b}") # Hacker's Delight
+ assert_equal(2*(a|b)-(a^b), c, "#{a} + #{b}") # Hacker's Delight
+ }
+ }
+ end
+
+ def test_minus
+ VS.each {|a|
+ VS.each {|b|
+ c = a - b
+ check_class(c)
+ assert_equal(a, c + b, "(#{a} - #{b}) + #{b}")
+ assert_equal(-b, c - a, "(#{a} - #{b}) - #{a}")
+ assert_equal(a+~b+1, c, "#{a} - #{b}") # Hacker's Delight
+ assert_equal((a^b)-2*(b&~a), c, "#{a} - #{b}") # Hacker's Delight
+ assert_equal((a&~b)-(b&~a), c, "#{a} - #{b}") # Hacker's Delight
+ assert_equal(2*(a&~b)-(a^b), c, "#{a} - #{b}") # Hacker's Delight
+ }
+ }
+ end
+
+ def test_mult
+ VS.each {|a|
+ VS.each {|b|
+ c = a * b
+ check_class(c)
+ assert_equal(b * a, c, "#{a} * #{b}")
+ assert_equal(b, c / a, "(#{a} * #{b}) / #{a}") if a != 0
+ assert_equal(a.abs * b.abs, (a * b).abs, "(#{a} * #{b}).abs")
+ assert_equal((a-100)*(b-100)+(a-100)*100+(b-100)*100+10000, c, "#{a} * #{b}")
+ assert_equal((a+100)*(b+100)-(a+100)*100-(b+100)*100+10000, c, "#{a} * #{b}")
+ }
+ }
+ end
+
+ def test_divmod
+ VS.each {|a|
+ VS.each {|b|
+ if b == 0
+ assert_raise(ZeroDivisionError) { a.divmod(b) }
+ else
+ q, r = a.divmod(b)
+ check_class(q)
+ check_class(r)
+ assert_equal(a, b*q+r)
+ assert(r.abs < b.abs)
+ assert(0 < b ? (0 <= r && r < b) : (b < r && r <= 0))
+ assert_equal(q, a/b)
+ assert_equal(q, a.div(b))
+ assert_equal(r, a%b)
+ assert_equal(r, a.modulo(b))
+ end
+ }
+ }
+ end
+
def test_pow
- assert_not_equal(0, begin
- 0**-1
- rescue
- nil
- end, "[ruby-dev:32084] [ruby-dev:34547]")
+ small_values = VS.find_all {|v| 0 <= v && v < 1000 }
+ VS.each {|a|
+ small_values.each {|b|
+ c = a ** b
+ check_class(c)
+ d = 1
+ b.times { d *= a }
+ assert_equal(d, c, "(#{a}) ** #{b}")
+ if a != 0
+ d = c
+ b.times { d /= a }
+ assert_equal(1, d, "((#{a}) ** #{b}) / #{a} / ...(#{b} times)...")
+ end
+ }
+ }
+
+ assert_equal(0**-1 == 0, false)
+ end
+
+ def test_not
+ VS.each {|a|
+ b = ~a
+ check_class(b)
+ assert_equal(-1 ^ a, b, "~#{a}")
+ assert_equal(-a-1, b, "~#{a}") # Hacker's Delight
+ assert_equal(0, a & b, "#{a} & ~#{a}")
+ assert_equal(-1, a | b, "#{a} | ~#{a}")
+ }
+ end
+
+ def test_or
+ VS.each {|a|
+ VS.each {|b|
+ c = a | b
+ check_class(c)
+ assert_equal(b | a, c, "#{a} | #{b}")
+ assert_equal(a + b - (a&b), c, "#{a} | #{b}")
+ assert_equal((a & ~b) + b, c, "#{a} | #{b}") # Hacker's Delight
+ assert_equal(-1, c | ~a, "(#{a} | #{b}) | ~#{a})")
+ }
+ }
+ end
+
+ def test_and
+ VS.each {|a|
+ VS.each {|b|
+ c = a & b
+ check_class(c)
+ assert_equal(b & a, c, "#{a} & #{b}")
+ assert_equal(a + b - (a|b), c, "#{a} & #{b}")
+ assert_equal((~a | b) - ~a, c, "#{a} & #{b}") # Hacker's Delight
+ assert_equal(0, c & ~a, "(#{a} & #{b}) & ~#{a}")
+ }
+ }
+ end
+
+ def test_xor
+ VS.each {|a|
+ VS.each {|b|
+ c = a ^ b
+ check_class(c)
+ assert_equal(b ^ a, c, "#{a} ^ #{b}")
+ assert_equal((a|b)-(a&b), c, "#{a} ^ #{b}") # Hacker's Delight
+ assert_equal(b, c ^ a, "(#{a} ^ #{b}) ^ #{a}")
+ }
+ }
end
def test_lshift
+ small_values = VS.find_all {|v| v < 8000 }
+ VS.each {|a|
+ small_values.each {|b|
+ c = a << b
+ check_class(c)
+ if 0 <= b
+ assert_equal(a, c >> b, "(#{a} << #{b}) >> #{b}")
+ assert_equal(a * 2**b, c, "#{a} << #{b}")
+ end
+ 0.upto(c.size*8+10) {|nth|
+ assert_equal(a[nth-b], c[nth], "(#{a} << #{b})[#{nth}]")
+ }
+ }
+ }
assert_equal(0, 1 << -0x40000000)
assert_equal(0, 1 << -0x40000001)
assert_equal(0, 1 << -0x80000000)
@@ -34,6 +320,20 @@ class TestInteger < Test::Unit::TestCase
end
def test_rshift
+ small_values = VS.find_all {|v| -8000 < v }
+ VS.each {|a|
+ small_values.each {|b|
+ c = a >> b
+ check_class(c)
+ if b <= 0
+ assert_equal(a, c << b, "(#{a} >> #{b}) << #{b}")
+ assert_equal(a * 2**(-b), c, "#{a} >> #{b}")
+ end
+ 0.upto(c.size*8+10) {|nth|
+ assert_equal(a[nth+b], c[nth], "(#{a} >> #{b})[#{nth}]")
+ }
+ }
+ }
# assert_equal(bdsize(0x40000001), (1 >> -0x40000001).size)
assert((1 >> 0x80000000).zero?)
assert((1 >> 0xffffffff).zero?)
@@ -42,6 +342,284 @@ class TestInteger < Test::Unit::TestCase
# assert_equal((1 << 0x40000001), (1 >> -0x40000001))
end
+ def test_succ
+ VS.each {|a|
+ b = a.succ
+ check_class(b)
+ assert_equal(a+1, b, "(#{a}).succ")
+ assert_equal(a, b.pred, "(#{a}).succ.pred")
+ assert_equal(a, b-1, "(#{a}).succ - 1")
+ }
+ end
+
+ def test_pred
+ VS.each {|a|
+ b = a.pred
+ check_class(b)
+ assert_equal(a-1, b, "(#{a}).pred")
+ assert_equal(a, b.succ, "(#{a}).pred.succ")
+ assert_equal(a, b + 1, "(#{a}).pred + 1")
+ }
+ end
+
+ def test_unary_plus
+ VS.each {|a|
+ b = +a
+ check_class(b)
+ assert_equal(a, b, "+(#{a})")
+ }
+ end
+
+ def test_unary_minus
+ VS.each {|a|
+ b = -a
+ check_class(b)
+ assert_equal(0-a, b, "-(#{a})")
+ assert_equal(~a+1, b, "-(#{a})")
+ assert_equal(0, a+b, "#{a}+(-(#{a}))")
+ }
+ end
+
+ def test_cmp
+ VS.each_with_index {|a, i|
+ VS.each_with_index {|b, j|
+ assert_equal(i <=> j, a <=> b, "#{a} <=> #{b}")
+ assert_equal(i < j, a < b, "#{a} < #{b}")
+ assert_equal(i <= j, a <= b, "#{a} <= #{b}")
+ assert_equal(i > j, a > b, "#{a} > #{b}")
+ assert_equal(i >= j, a >= b, "#{a} >= #{b}")
+ }
+ }
+ end
+
+ def test_eq
+ VS.each_with_index {|a, i|
+ VS.each_with_index {|b, j|
+ c = a == b
+ assert_equal(b == a, c, "#{a} == #{b}")
+ assert_equal(i == j, c, "#{a} == #{b}")
+ }
+ }
+ end
+
+ def test_abs
+ VS.each {|a|
+ b = a.abs
+ check_class(b)
+ if a < 0
+ assert_equal(-a, b, "(#{a}).abs")
+ else
+ assert_equal(a, b, "(#{a}).abs")
+ end
+ }
+ end
+
+ def test_ceil
+ VS.each {|a|
+ b = a.ceil
+ check_class(b)
+ assert_equal(a, b, "(#{a}).ceil")
+ }
+ end
+
+ def test_floor
+ VS.each {|a|
+ b = a.floor
+ check_class(b)
+ assert_equal(a, b, "(#{a}).floor")
+ }
+ end
+
+ def test_round
+ VS.each {|a|
+ b = a.round
+ check_class(b)
+ assert_equal(a, b, "(#{a}).round")
+ }
+ end
+
+ def test_truncate
+ VS.each {|a|
+ b = a.truncate
+ check_class(b)
+ assert_equal(a, b, "(#{a}).truncate")
+ }
+ end
+
+ def test_remainder
+ VS.each {|a|
+ VS.each {|b|
+ if b == 0
+ assert_raise(ZeroDivisionError) { a.divmod(b) }
+ else
+ r = a.remainder(b)
+ check_class(r)
+ if a < 0
+ assert_operator(-b.abs, :<, r, "#{a}.remainder(#{b})")
+ assert_operator(0, :>=, r, "#{a}.remainder(#{b})")
+ elsif 0 < a
+ assert_operator(0, :<=, r, "#{a}.remainder(#{b})")
+ assert_operator(b.abs, :>, r, "#{a}.remainder(#{b})")
+ else
+ assert_equal(0, r, "#{a}.remainder(#{b})")
+ end
+ end
+ }
+ }
+ end
+
+ def test_zero_nonzero
+ VS.each {|a|
+ z = a.zero?
+ n = a.nonzero?
+ if a == 0
+ assert_equal(true, z, "(#{a}).zero?")
+ assert_equal(nil, n, "(#{a}).nonzero?")
+ else
+ assert_equal(false, z, "(#{a}).zero?")
+ assert_equal(a, n, "(#{a}).nonzero?")
+ check_class(n)
+ end
+ assert(z ^ n, "(#{a}).zero? ^ (#{a}).nonzero?")
+ }
+ end
+
+ def test_even_odd
+ VS.each {|a|
+ e = a.even?
+ o = a.odd?
+ assert_equal((a % 2) == 0, e, "(#{a}).even?")
+ assert_equal((a % 2) == 1, o, "(#{a}).odd")
+ assert_equal((a & 1) == 0, e, "(#{a}).even?")
+ assert_equal((a & 1) == 1, o, "(#{a}).odd")
+ assert(e ^ o, "(#{a}).even? ^ (#{a}).odd?")
+ }
+ end
+
+ def test_to_s
+ 2.upto(36) {|radix|
+ VS.each {|a|
+ s = a.to_s(radix)
+ b = s.to_i(radix)
+ assert_equal(a, b, "(#{a}).to_s(#{radix}).to_i(#{radix})")
+ }
+ }
+ end
+
+ def test_printf_x
+ VS.reverse_each {|a|
+ s = sprintf("%x", a)
+ if /\A\.\./ =~ s
+ b = -($'.tr('0123456789abcdef', 'fedcba9876543210').to_i(16) + 1)
+ else
+ b = s.to_i(16)
+ end
+ assert_equal(a, b, "sprintf('%x', #{a}) = #{s.inspect}")
+ }
+ end
+
+ def test_printf_x_sign
+ VS.reverse_each {|a|
+ s = sprintf("%+x", a)
+ b = s.to_i(16)
+ assert_equal(a, b, "sprintf('%+x', #{a}) = #{s.inspect}")
+ s = sprintf("% x", a)
+ b = s.to_i(16)
+ assert_equal(a, b, "sprintf('% x', #{a}) = #{s.inspect}")
+ }
+ end
+
+ def test_printf_o
+ VS.reverse_each {|a|
+ s = sprintf("%o", a)
+ if /\A\.\./ =~ s
+ b = -($'.tr('01234567', '76543210').to_i(8) + 1)
+ else
+ b = s.to_i(8)
+ end
+ assert_equal(a, b, "sprintf('%o', #{a}) = #{s.inspect}")
+ }
+ end
+
+ def test_printf_o_sign
+ VS.reverse_each {|a|
+ s = sprintf("%+o", a)
+ b = s.to_i(8)
+ assert_equal(a, b, "sprintf('%+o', #{a}) = #{s.inspect}")
+ s = sprintf("% o", a)
+ b = s.to_i(8)
+ assert_equal(a, b, "sprintf('% o', #{a}) = #{s.inspect}")
+ }
+ end
+
+ def test_printf_b
+ VS.reverse_each {|a|
+ s = sprintf("%b", a)
+ if /\A\.\./ =~ s
+ b = -($'.tr('01', '10').to_i(2) + 1)
+ else
+ b = s.to_i(2)
+ end
+ assert_equal(a, b, "sprintf('%b', #{a}) = #{s.inspect}")
+ }
+ end
+
+ def test_printf_b_sign
+ VS.reverse_each {|a|
+ s = sprintf("%+b", a)
+ b = s.to_i(2)
+ assert_equal(a, b, "sprintf('%+b', #{a}) = #{s.inspect}")
+ s = sprintf("% b", a)
+ b = s.to_i(2)
+ assert_equal(a, b, "sprintf('% b', #{a}) = #{s.inspect}")
+ }
+ end
+
+ def test_printf_di
+ VS.reverse_each {|a|
+ s = sprintf("%d", a)
+ b = s.to_i
+ assert_equal(a, b, "sprintf('%d', #{a}) = #{s.inspect}")
+ s = sprintf("%i", a)
+ b = s.to_i
+ assert_equal(a, b, "sprintf('%i', #{a}) = #{s.inspect}")
+ }
+ end
+
+ def test_marshal
+ VS.reverse_each {|a|
+ s = Marshal.dump(a)
+ b = Marshal.load(s)
+ assert_equal(a, b, "Marshal.load(Marshal.dump(#{a}))")
+ }
+ end
+
+ def test_pack_ber
+ template = "w"
+ VS.reverse_each {|a|
+ if a < 0
+ assert_raise(ArgumentError) { [a].pack(template) }
+ else
+ s = [a].pack(template)
+ b = s.unpack(template)[0]
+ assert_equal(a, b, "[#{a}].pack(#{template.dump}).unpack(#{template.dump})")
+ end
+ }
+ end
+
+ def test_pack_utf8
+ template = "U"
+ VS.reverse_each {|a|
+ if a < 0 || 0x7fffffff < a
+ assert_raise(RangeError) { [a].pack(template) }
+ else
+ s = [a].pack(template)
+ b = s.unpack(template)[0]
+ assert_equal(a, b, "[#{a}].pack(#{template.dump}).unpack(#{template.dump})")
+ end
+ }
+ end
+
def test_Integer
assert_raise(ArgumentError) {Integer("0x-1")}
assert_raise(ArgumentError) {Integer("-0x-1")}
@@ -72,116 +650,4 @@ class TestInteger < Test::Unit::TestCase
}
assert_raise(ArgumentError, "[ruby-core:14139]") {Integer("0__3_7_7")}
end
-
- def test_int_p
- assert(!(1.0.integer?))
- assert(1.integer?)
- end
-
- def test_odd_p_even_p
- Fixnum.class_eval do
- alias odd_bak odd?
- alias even_bak even?
- remove_method :odd?, :even?
- end
-
- assert(1.odd?)
- assert(!(2.odd?))
- assert(!(1.even?))
- assert(2.even?)
-
- ensure
- Fixnum.class_eval do
- alias odd? odd_bak
- alias even? even_bak
- remove_method :odd_bak, :even_bak
- end
- end
-
- def test_succ
- assert_equal(2, 1.send(:succ))
-
- Fixnum.class_eval do
- alias succ_bak succ
- remove_method :succ
- end
-
- assert_equal(2, 1.succ)
- assert_equal(4294967297, 4294967296.succ)
-
- ensure
- Fixnum.class_eval do
- alias succ succ_bak
- remove_method :succ_bak
- end
- end
-
- def test_chr
- assert_equal("a", "a".ord.chr)
- assert_raise(RangeError) { (-1).chr }
- assert_raise(RangeError) { 0x100.chr }
- end
-
- def test_upto
- a = []
- 1.upto(3) {|x| a << x }
- assert_equal([1, 2, 3], a)
-
- a = []
- 1.upto(0) {|x| a << x }
- assert_equal([], a)
-
- x = 2**30 - 1
- a = []
- x.upto(x+2) {|x| a << x }
- assert_equal([x, x+1, x+2], a)
- end
-
- def test_downto
- a = []
- -1.downto(-3) {|x| a << x }
- assert_equal([-1, -2, -3], a)
-
- a = []
- 1.downto(2) {|x| a << x }
- assert_equal([], a)
-
- x = -(2**30)
- a = []
- x.downto(x-2) {|x| a << x }
- assert_equal([x, x-1, x-2], a)
- end
-
- def test_times
- (2**32).times do |i|
- break if i == 2
- end
- end
-
- def test_round
- assert_equal(11111, 11111.round)
- assert_equal(Fixnum, 11111.round.class)
- assert_equal(11111, 11111.round(0))
- assert_equal(Fixnum, 11111.round(0).class)
-
- assert_equal(11111.0, 11111.round(1))
- assert_equal(Float, 11111.round(1).class)
- assert_equal(11111.0, 11111.round(2))
- assert_equal(Float, 11111.round(2).class)
-
- assert_equal(11110, 11111.round(-1))
- assert_equal(Fixnum, 11111.round(-1).class)
- assert_equal(11100, 11111.round(-2))
- assert_equal(Fixnum, 11111.round(-2).class)
-
- assert_equal(1111_1111_1111_1111_1111_1111_1111_1110, 1111_1111_1111_1111_1111_1111_1111_1111.round(-1))
- assert_equal(Bignum, 1111_1111_1111_1111_1111_1111_1111_1111.round(-1).class)
- assert_equal(-1111_1111_1111_1111_1111_1111_1111_1110, (-1111_1111_1111_1111_1111_1111_1111_1111).round(-1))
- assert_equal(Bignum, (-1111_1111_1111_1111_1111_1111_1111_1111).round(-1).class)
- end
-
- def test_Integer2
- assert_equal(2 ** 50, Integer(2.0 ** 50))
- assert_raise(TypeError) { Integer(nil) }
- end
end
diff --git a/test/ruby/test_integer_comb.rb b/test/ruby/test_integer_comb.rb
deleted file mode 100644
index 7cac5d6ad2..0000000000
--- a/test/ruby/test_integer_comb.rb
+++ /dev/null
@@ -1,620 +0,0 @@
-require 'test/unit'
-
-class TestIntegerComb < Test::Unit::TestCase
- VS = [
- -0x1000000000000000000000000000000000000000000000002,
- -0x1000000000000000000000000000000000000000000000001,
- -0x1000000000000000000000000000000000000000000000000,
- -0xffffffffffffffffffffffffffffffffffffffffffffffff,
- -0x1000000000000000000000002,
- -0x1000000000000000000000001,
- -0x1000000000000000000000000,
- -0xffffffffffffffffffffffff,
- -0x10000000000000002,
- -0x10000000000000001,
- -0x10000000000000000,
- -0xffffffffffffffff,
- -0x4000000000000002,
- -0x4000000000000001,
- -0x4000000000000000,
- -0x3fffffffffffffff,
- -0x100000002,
- -0x100000001,
- -0x100000000,
- -0xffffffff,
- -0xc717a08d, # 0xc717a08d * 0x524b2245 = 0x4000000000000001
- -0x80000002,
- -0x80000001,
- -0x80000000,
- -0x7fffffff,
- -0x524b2245,
- -0x40000002,
- -0x40000001,
- -0x40000000,
- -0x3fffffff,
- -0x10002,
- -0x10001,
- -0x10000,
- -0xffff,
- -0x8101, # 0x8101 * 0x7f01 = 0x40000001
- -0x8002,
- -0x8001,
- -0x8000,
- -0x7fff,
- -0x7f01,
- -65,
- -64,
- -63,
- -62,
- -33,
- -32,
- -31,
- -30,
- -3,
- -2,
- -1,
- 0,
- 1,
- 2,
- 3,
- 30,
- 31,
- 32,
- 33,
- 62,
- 63,
- 64,
- 65,
- 0x7f01,
- 0x7ffe,
- 0x7fff,
- 0x8000,
- 0x8001,
- 0x8101,
- 0xfffe,
- 0xffff,
- 0x10000,
- 0x10001,
- 0x3ffffffe,
- 0x3fffffff,
- 0x40000000,
- 0x40000001,
- 0x524b2245,
- 0x7ffffffe,
- 0x7fffffff,
- 0x80000000,
- 0x80000001,
- 0xc717a08d,
- 0xfffffffe,
- 0xffffffff,
- 0x100000000,
- 0x100000001,
- 0x3ffffffffffffffe,
- 0x3fffffffffffffff,
- 0x4000000000000000,
- 0x4000000000000001,
- 0xfffffffffffffffe,
- 0xffffffffffffffff,
- 0x10000000000000000,
- 0x10000000000000001,
- 0xffffffffffffffffffffffff,
- 0x1000000000000000000000000,
- 0x1000000000000000000000001,
- 0xffffffffffffffffffffffffffffffffffffffffffffffff,
- 0x1000000000000000000000000000000000000000000000000,
- 0x1000000000000000000000000000000000000000000000001
- ]
-
- #VS.map! {|v| 0x4000000000000000.coerce(v)[0] }
-
- min = -1
- min *= 2 while min.class == Fixnum
- FIXNUM_MIN = min/2
- max = 1
- max *= 2 while (max-1).class == Fixnum
- FIXNUM_MAX = max/2-1
-
- def test_fixnum_range
- assert_instance_of(Bignum, FIXNUM_MIN-1)
- assert_instance_of(Fixnum, FIXNUM_MIN)
- assert_instance_of(Fixnum, FIXNUM_MAX)
- assert_instance_of(Bignum, FIXNUM_MAX+1)
- end
-
- def check_class(n)
- if FIXNUM_MIN <= n && n <= FIXNUM_MAX
- assert_instance_of(Fixnum, n)
- else
- assert_instance_of(Bignum, n)
- end
- end
-
- def test_aref
- VS.each {|a|
- 100.times {|i|
- assert_equal((a >> i).odd? ? 1 : 0, a[i], "(#{a})[#{i}]")
- }
- }
- VS.each {|a|
- VS.each {|b|
- c = nil
- assert_nothing_raised("(#{a})[#{b}]") { c = a[b] }
- check_class(c)
- if b < 0
- assert_equal(0, c, "(#{a})[#{b}]")
- else
- assert_equal((a >> b).odd? ? 1 : 0, c, "(#{a})[#{b}]")
- end
- }
- }
- end
-
- def test_plus
- VS.each {|a|
- VS.each {|b|
- c = a + b
- check_class(c)
- assert_equal(b + a, c, "#{a} + #{b}")
- assert_equal(a, c - b, "(#{a} + #{b}) - #{b}")
- assert_equal(a-~b-1, c, "#{a} + #{b}") # Hacker's Delight
- assert_equal((a^b)+2*(a&b), c, "#{a} + #{b}") # Hacker's Delight
- assert_equal((a|b)+(a&b), c, "#{a} + #{b}") # Hacker's Delight
- assert_equal(2*(a|b)-(a^b), c, "#{a} + #{b}") # Hacker's Delight
- }
- }
- end
-
- def test_minus
- VS.each {|a|
- VS.each {|b|
- c = a - b
- check_class(c)
- assert_equal(a, c + b, "(#{a} - #{b}) + #{b}")
- assert_equal(-b, c - a, "(#{a} - #{b}) - #{a}")
- assert_equal(a+~b+1, c, "#{a} - #{b}") # Hacker's Delight
- assert_equal((a^b)-2*(b&~a), c, "#{a} - #{b}") # Hacker's Delight
- assert_equal((a&~b)-(b&~a), c, "#{a} - #{b}") # Hacker's Delight
- assert_equal(2*(a&~b)-(a^b), c, "#{a} - #{b}") # Hacker's Delight
- }
- }
- end
-
- def test_mult
- VS.each {|a|
- VS.each {|b|
- c = a * b
- check_class(c)
- assert_equal(b * a, c, "#{a} * #{b}")
- assert_equal(b, c / a, "(#{a} * #{b}) / #{a}") if a != 0
- assert_equal(a.abs * b.abs, (a * b).abs, "(#{a} * #{b}).abs")
- assert_equal((a-100)*(b-100)+(a-100)*100+(b-100)*100+10000, c, "#{a} * #{b}")
- assert_equal((a+100)*(b+100)-(a+100)*100-(b+100)*100+10000, c, "#{a} * #{b}")
- }
- }
- end
-
- def test_divmod
- VS.each {|a|
- VS.each {|b|
- if b == 0
- assert_raise(ZeroDivisionError) { a.divmod(b) }
- else
- q, r = a.divmod(b)
- check_class(q)
- check_class(r)
- assert_equal(a, b*q+r)
- assert(r.abs < b.abs)
- assert(0 < b ? (0 <= r && r < b) : (b < r && r <= 0))
- assert_equal(q, a/b)
- assert_equal(q, a.div(b))
- assert_equal(r, a%b)
- assert_equal(r, a.modulo(b))
- end
- }
- }
- end
-
- def test_pow
- small_values = VS.find_all {|v| 0 <= v && v < 1000 }
- VS.each {|a|
- small_values.each {|b|
- c = a ** b
- check_class(c)
- d = 1
- b.times { d *= a }
- assert_equal(d, c, "(#{a}) ** #{b}")
- if a != 0
- d = c
- b.times { d /= a }
- assert_equal(1, d, "((#{a}) ** #{b}) / #{a} / ...(#{b} times)...")
- end
- }
- }
- end
-
- def test_not
- VS.each {|a|
- b = ~a
- check_class(b)
- assert_equal(-1 ^ a, b, "~#{a}")
- assert_equal(-a-1, b, "~#{a}") # Hacker's Delight
- assert_equal(0, a & b, "#{a} & ~#{a}")
- assert_equal(-1, a | b, "#{a} | ~#{a}")
- }
- end
-
- def test_or
- VS.each {|a|
- VS.each {|b|
- c = a | b
- check_class(c)
- assert_equal(b | a, c, "#{a} | #{b}")
- assert_equal(a + b - (a&b), c, "#{a} | #{b}")
- assert_equal((a & ~b) + b, c, "#{a} | #{b}") # Hacker's Delight
- assert_equal(-1, c | ~a, "(#{a} | #{b}) | ~#{a})")
- }
- }
- end
-
- def test_and
- VS.each {|a|
- VS.each {|b|
- c = a & b
- check_class(c)
- assert_equal(b & a, c, "#{a} & #{b}")
- assert_equal(a + b - (a|b), c, "#{a} & #{b}")
- assert_equal((~a | b) - ~a, c, "#{a} & #{b}") # Hacker's Delight
- assert_equal(0, c & ~a, "(#{a} & #{b}) & ~#{a}")
- }
- }
- end
-
- def test_xor
- VS.each {|a|
- VS.each {|b|
- c = a ^ b
- check_class(c)
- assert_equal(b ^ a, c, "#{a} ^ #{b}")
- assert_equal((a|b)-(a&b), c, "#{a} ^ #{b}") # Hacker's Delight
- assert_equal(b, c ^ a, "(#{a} ^ #{b}) ^ #{a}")
- }
- }
- end
-
- def test_lshift
- small_values = VS.find_all {|v| v < 8000 }
- VS.each {|a|
- small_values.each {|b|
- c = a << b
- check_class(c)
- if 0 <= b
- assert_equal(a, c >> b, "(#{a} << #{b}) >> #{b}")
- assert_equal(a * 2**b, c, "#{a} << #{b}")
- end
- 0.upto(c.size*8+10) {|nth|
- assert_equal(a[nth-b], c[nth], "(#{a} << #{b})[#{nth}]")
- }
- }
- }
- end
-
- def test_rshift
- small_values = VS.find_all {|v| -8000 < v }
- VS.each {|a|
- small_values.each {|b|
- c = a >> b
- check_class(c)
- if b <= 0
- assert_equal(a, c << b, "(#{a} >> #{b}) << #{b}")
- assert_equal(a * 2**(-b), c, "#{a} >> #{b}")
- end
- 0.upto(c.size*8+10) {|nth|
- assert_equal(a[nth+b], c[nth], "(#{a} >> #{b})[#{nth}]")
- }
- }
- }
- end
-
- def test_succ
- VS.each {|a|
- b = a.succ
- check_class(b)
- assert_equal(a+1, b, "(#{a}).succ")
- assert_equal(a, b.pred, "(#{a}).succ.pred")
- assert_equal(a, b-1, "(#{a}).succ - 1")
- }
- end
-
- def test_pred
- VS.each {|a|
- b = a.pred
- check_class(b)
- assert_equal(a-1, b, "(#{a}).pred")
- assert_equal(a, b.succ, "(#{a}).pred.succ")
- assert_equal(a, b + 1, "(#{a}).pred + 1")
- }
- end
-
- def test_unary_plus
- VS.each {|a|
- b = +a
- check_class(b)
- assert_equal(a, b, "+(#{a})")
- }
- end
-
- def test_unary_minus
- VS.each {|a|
- b = -a
- check_class(b)
- assert_equal(0-a, b, "-(#{a})")
- assert_equal(~a+1, b, "-(#{a})")
- assert_equal(0, a+b, "#{a}+(-(#{a}))")
- }
- end
-
- def test_cmp
- VS.each_with_index {|a, i|
- VS.each_with_index {|b, j|
- assert_equal(i <=> j, a <=> b, "#{a} <=> #{b}")
- assert_equal(i < j, a < b, "#{a} < #{b}")
- assert_equal(i <= j, a <= b, "#{a} <= #{b}")
- assert_equal(i > j, a > b, "#{a} > #{b}")
- assert_equal(i >= j, a >= b, "#{a} >= #{b}")
- }
- }
- end
-
- def test_eq
- VS.each_with_index {|a, i|
- VS.each_with_index {|b, j|
- c = a == b
- assert_equal(b == a, c, "#{a} == #{b}")
- assert_equal(i == j, c, "#{a} == #{b}")
- }
- }
- end
-
- def test_abs
- VS.each {|a|
- b = a.abs
- check_class(b)
- if a < 0
- assert_equal(-a, b, "(#{a}).abs")
- else
- assert_equal(a, b, "(#{a}).abs")
- end
- }
- end
-
- def test_ceil
- VS.each {|a|
- b = a.ceil
- check_class(b)
- assert_equal(a, b, "(#{a}).ceil")
- }
- end
-
- def test_floor
- VS.each {|a|
- b = a.floor
- check_class(b)
- assert_equal(a, b, "(#{a}).floor")
- }
- end
-
- def test_round
- VS.each {|a|
- b = a.round
- check_class(b)
- assert_equal(a, b, "(#{a}).round")
- }
- end
-
- def test_truncate
- VS.each {|a|
- b = a.truncate
- check_class(b)
- assert_equal(a, b, "(#{a}).truncate")
- }
- end
-
- def test_remainder
- VS.each {|a|
- VS.each {|b|
- if b == 0
- assert_raise(ZeroDivisionError) { a.divmod(b) }
- else
- r = a.remainder(b)
- check_class(r)
- if a < 0
- assert_operator(-b.abs, :<, r, "#{a}.remainder(#{b})")
- assert_operator(0, :>=, r, "#{a}.remainder(#{b})")
- elsif 0 < a
- assert_operator(0, :<=, r, "#{a}.remainder(#{b})")
- assert_operator(b.abs, :>, r, "#{a}.remainder(#{b})")
- else
- assert_equal(0, r, "#{a}.remainder(#{b})")
- end
- end
- }
- }
- end
-
- def test_zero_nonzero
- VS.each {|a|
- z = a.zero?
- n = a.nonzero?
- if a == 0
- assert_equal(true, z, "(#{a}).zero?")
- assert_equal(nil, n, "(#{a}).nonzero?")
- else
- assert_equal(false, z, "(#{a}).zero?")
- assert_equal(a, n, "(#{a}).nonzero?")
- check_class(n)
- end
- assert(z ^ n, "(#{a}).zero? ^ (#{a}).nonzero?")
- }
- end
-
- def test_even_odd
- VS.each {|a|
- e = a.even?
- o = a.odd?
- assert_equal((a % 2) == 0, e, "(#{a}).even?")
- assert_equal((a % 2) == 1, o, "(#{a}).odd")
- assert_equal((a & 1) == 0, e, "(#{a}).even?")
- assert_equal((a & 1) == 1, o, "(#{a}).odd")
- assert(e ^ o, "(#{a}).even? ^ (#{a}).odd?")
- }
- end
-
- def test_to_s
- 2.upto(36) {|radix|
- VS.each {|a|
- s = a.to_s(radix)
- b = s.to_i(radix)
- assert_equal(a, b, "(#{a}).to_s(#{radix}).to_i(#{radix})")
- }
- }
- end
-
- def test_printf_x
- VS.reverse_each {|a|
- s = sprintf("%x", a)
- if /\A\.\./ =~ s
- b = -($'.tr('0123456789abcdef', 'fedcba9876543210').to_i(16) + 1)
- else
- b = s.to_i(16)
- end
- assert_equal(a, b, "sprintf('%x', #{a}) = #{s.inspect}")
- }
- end
-
- def test_printf_x_sign
- VS.reverse_each {|a|
- s = sprintf("%+x", a)
- b = s.to_i(16)
- assert_equal(a, b, "sprintf('%+x', #{a}) = #{s.inspect}")
- s = sprintf("% x", a)
- b = s.to_i(16)
- assert_equal(a, b, "sprintf('% x', #{a}) = #{s.inspect}")
- }
- end
-
- def test_printf_o
- VS.reverse_each {|a|
- s = sprintf("%o", a)
- if /\A\.\./ =~ s
- b = -($'.tr('01234567', '76543210').to_i(8) + 1)
- else
- b = s.to_i(8)
- end
- assert_equal(a, b, "sprintf('%o', #{a}) = #{s.inspect}")
- }
- end
-
- def test_printf_o_sign
- VS.reverse_each {|a|
- s = sprintf("%+o", a)
- b = s.to_i(8)
- assert_equal(a, b, "sprintf('%+o', #{a}) = #{s.inspect}")
- s = sprintf("% o", a)
- b = s.to_i(8)
- assert_equal(a, b, "sprintf('% o', #{a}) = #{s.inspect}")
- }
- end
-
- def test_printf_b
- VS.reverse_each {|a|
- s = sprintf("%b", a)
- if /\A\.\./ =~ s
- b = -($'.tr('01', '10').to_i(2) + 1)
- else
- b = s.to_i(2)
- end
- assert_equal(a, b, "sprintf('%b', #{a}) = #{s.inspect}")
- }
- end
-
- def test_printf_b_sign
- VS.reverse_each {|a|
- s = sprintf("%+b", a)
- b = s.to_i(2)
- assert_equal(a, b, "sprintf('%+b', #{a}) = #{s.inspect}")
- s = sprintf("% b", a)
- b = s.to_i(2)
- assert_equal(a, b, "sprintf('% b', #{a}) = #{s.inspect}")
- }
- end
-
- def test_printf_diu
- VS.reverse_each {|a|
- s = sprintf("%d", a)
- b = s.to_i
- assert_equal(a, b, "sprintf('%d', #{a}) = #{s.inspect}")
- s = sprintf("%i", a)
- b = s.to_i
- assert_equal(a, b, "sprintf('%i', #{a}) = #{s.inspect}")
- s = sprintf("%u", a)
- b = s.to_i
- assert_equal(a, b, "sprintf('%u', #{a}) = #{s.inspect}")
- }
- end
-
- def test_marshal
- VS.reverse_each {|a|
- s = Marshal.dump(a)
- b = Marshal.load(s)
- assert_equal(a, b, "Marshal.load(Marshal.dump(#{a}))")
- }
- end
-
- def test_pack
- %w[c C s S s! S! i I i! I! l L l! L! q Q n N v V].each {|template|
- size = [0].pack(template).size
- mask = (1 << (size * 8)) - 1
- if /[A-Znv]/ =~ template
- min = 0
- max = (1 << (size * 8))-1
- else
- min = -(1 << (size * 8 - 1))
- max = (1 << (size * 8 - 1)) - 1
- end
- VS.reverse_each {|a|
- s = [a].pack(template)
- b = s.unpack(template)[0]
- assert_equal(a & mask, b & mask, "[#{a}].pack(#{template.dump}).unpack(#{template.dump}) & #{mask}")
- if min <= a && a <= max
- assert_equal(a, b, "[#{a}].pack(#{template.dump}).unpack(#{template.dump})")
- end
- }
- }
- end
-
- def test_pack_ber
- template = "w"
- VS.reverse_each {|a|
- if a < 0
- assert_raise(ArgumentError) { [a].pack(template) }
- else
- s = [a].pack(template)
- b = s.unpack(template)[0]
- assert_equal(a, b, "[#{a}].pack(#{template.dump}).unpack(#{template.dump})")
- end
- }
- end
-
- def test_pack_utf8
- template = "U"
- VS.reverse_each {|a|
- if a < 0 || 0x7fffffff < a
- assert_raise(RangeError) { [a].pack(template) }
- else
- s = [a].pack(template)
- b = s.unpack(template)[0]
- assert_equal(a, b, "[#{a}].pack(#{template.dump}).unpack(#{template.dump})")
- end
- }
- end
-end
diff --git a/test/ruby/test_io.rb b/test/ruby/test_io.rb
index 42614e00cb..19b4f0ebf6 100644
--- a/test/ruby/test_io.rb
+++ b/test/ruby/test_io.rb
@@ -1,832 +1,21 @@
require 'test/unit'
require 'tmpdir'
-require "fcntl"
-require 'io/nonblock'
-require 'socket'
-require 'stringio'
-require 'timeout'
-require 'tempfile'
-require_relative 'envutil'
class TestIO < Test::Unit::TestCase
- def have_close_on_exec?
- begin
- $stdin.close_on_exec?
- true
- rescue NotImplementedError
- false
- end
- end
-
- def have_nonblock?
- IO.instance_methods.index(:"nonblock=")
- end
-
- def test_pipe
- r, w = IO.pipe
- assert_instance_of(IO, r)
- assert_instance_of(IO, w)
- w.print "abc"
- w.close
- assert_equal("abc", r.read)
- r.close
- end
-
- def test_pipe_block
- x = nil
- ret = IO.pipe {|r, w|
- x = [r,w]
- assert_instance_of(IO, r)
- assert_instance_of(IO, w)
- w.print "abc"
- w.close
- assert_equal("abc", r.read)
- assert(!r.closed?)
- assert(w.closed?)
- :foooo
- }
- assert_equal(:foooo, ret)
- assert(x[0].closed?)
- assert(x[1].closed?)
- end
-
- def test_pipe_block_close
- 4.times {|i|
- x = nil
- IO.pipe {|r, w|
- x = [r,w]
- r.close if (i&1) == 0
- w.close if (i&2) == 0
+ def mkcdtmpdir
+ Dir.mktmpdir {|d|
+ Dir.chdir(d) {
+ yield
}
- assert(x[0].closed?)
- assert(x[1].closed?)
}
end
def test_gets_rs
- # default_rs
r, w = IO.pipe
- w.print "aaa\nbbb\n"
- w.close
- assert_equal "aaa\n", r.gets
- assert_equal "bbb\n", r.gets
- assert_nil r.gets
- r.close
-
- # nil
- r, w = IO.pipe
- w.print "a\n\nb\n\n"
- w.close
- assert_equal "a\n\nb\n\n", r.gets(nil)
- assert_nil r.gets("")
- r.close
-
- # "\377"
- r, w = IO.pipe('ascii-8bit')
w.print "\377xyz"
w.close
- r.binmode
assert_equal("\377", r.gets("\377"), "[ruby-dev:24460]")
r.close
-
- # ""
- r, w = IO.pipe
- w.print "a\n\nb\n\n"
- w.close
- assert_equal "a\n\n", r.gets(""), "[ruby-core:03771]"
- assert_equal "b\n\n", r.gets("")
- assert_nil r.gets("")
- r.close
- end
-
- def test_gets_limit_extra_arg
- with_pipe {|r, w|
- r, w = IO.pipe
- w << "0123456789\n0123456789"
- w.close
- assert_equal("0123456789\n0", r.gets(nil, 12))
- assert_raise(TypeError) { r.gets(3,nil) }
- }
- end
-
- # This test cause SEGV.
- def test_ungetc
- r, w = IO.pipe
- w.close
- assert_raise(IOError, "[ruby-dev:31650]") { 20000.times { r.ungetc "a" } }
- ensure
- r.close
- end
-
- def test_ungetbyte
- t = make_tempfile
- t.open
- t.ungetbyte(0x41)
- assert_equal(0x41, t.getbyte)
- t.rewind
- t.ungetbyte("qux")
- assert_equal("quxfoo\n", t.gets)
- t.set_encoding("utf-8")
- t.ungetbyte(0x89)
- t.ungetbyte(0x8e)
- t.ungetbyte("\xe7")
- t.ungetbyte("\xe7\xb4\x85")
- assert_equal("\u7d05\u7389bar\n", t.gets)
- end
-
- def test_each_byte
- r, w = IO.pipe
- w << "abc def"
- w.close
- r.each_byte {|byte| break if byte == 32 }
- assert_equal("def", r.read, "[ruby-dev:31659]")
- ensure
- r.close
- end
-
- def test_rubydev33072
- assert_raise(Errno::ENOENT, "[ruby-dev:33072]") do
- File.read("empty", nil, nil, {})
- end
- end
-
- def with_pipe
- r, w = IO.pipe
- begin
- yield r, w
- ensure
- r.close unless r.closed?
- w.close unless w.closed?
- end
- end
-
- def with_read_pipe(content)
- r, w = IO.pipe
- w << content
- w.close
- begin
- yield r
- ensure
- r.close
- end
- end
-
- def mkcdtmpdir
- Dir.mktmpdir {|d|
- Dir.chdir(d) {
- yield
- }
- }
- end
-
- def test_copy_stream
- mkcdtmpdir {
-
- content = "foobar"
- File.open("src", "w") {|f| f << content }
- ret = IO.copy_stream("src", "dst")
- assert_equal(content.bytesize, ret)
- assert_equal(content, File.read("dst"))
-
- # overwrite by smaller file.
- content = "baz"
- File.open("src", "w") {|f| f << content }
- ret = IO.copy_stream("src", "dst")
- assert_equal(content.bytesize, ret)
- assert_equal(content, File.read("dst"))
-
- ret = IO.copy_stream("src", "dst", 2)
- assert_equal(2, ret)
- assert_equal(content[0,2], File.read("dst"))
-
- ret = IO.copy_stream("src", "dst", 0)
- assert_equal(0, ret)
- assert_equal("", File.read("dst"))
-
- ret = IO.copy_stream("src", "dst", nil, 1)
- assert_equal(content.bytesize-1, ret)
- assert_equal(content[1..-1], File.read("dst"))
-
- assert_raise(Errno::ENOENT) {
- IO.copy_stream("nodir/foo", "dst")
- }
-
- assert_raise(Errno::ENOENT) {
- IO.copy_stream("src", "nodir/bar")
- }
-
- with_pipe {|r, w|
- ret = IO.copy_stream("src", w)
- assert_equal(content.bytesize, ret)
- w.close
- assert_equal(content, r.read)
- }
-
- with_pipe {|r, w|
- w.close
- assert_raise(IOError) { IO.copy_stream("src", w) }
- }
-
- pipe_content = "abc"
- with_read_pipe(pipe_content) {|r|
- ret = IO.copy_stream(r, "dst")
- assert_equal(pipe_content.bytesize, ret)
- assert_equal(pipe_content, File.read("dst"))
- }
-
- with_read_pipe("abc") {|r1|
- assert_equal("a", r1.getc)
- with_pipe {|r2, w2|
- w2.sync = false
- w2 << "def"
- ret = IO.copy_stream(r1, w2)
- assert_equal(2, ret)
- w2.close
- assert_equal("defbc", r2.read)
- }
- }
-
- with_read_pipe("abc") {|r1|
- assert_equal("a", r1.getc)
- with_pipe {|r2, w2|
- w2.sync = false
- w2 << "def"
- ret = IO.copy_stream(r1, w2, 1)
- assert_equal(1, ret)
- w2.close
- assert_equal("defb", r2.read)
- }
- }
-
- with_read_pipe("abc") {|r1|
- assert_equal("a", r1.getc)
- with_pipe {|r2, w2|
- ret = IO.copy_stream(r1, w2)
- assert_equal(2, ret)
- w2.close
- assert_equal("bc", r2.read)
- }
- }
-
- with_read_pipe("abc") {|r1|
- assert_equal("a", r1.getc)
- with_pipe {|r2, w2|
- ret = IO.copy_stream(r1, w2, 1)
- assert_equal(1, ret)
- w2.close
- assert_equal("b", r2.read)
- }
- }
-
- with_read_pipe("abc") {|r1|
- assert_equal("a", r1.getc)
- with_pipe {|r2, w2|
- ret = IO.copy_stream(r1, w2, 0)
- assert_equal(0, ret)
- w2.close
- assert_equal("", r2.read)
- }
- }
-
- with_pipe {|r1, w1|
- w1 << "abc"
- assert_equal("a", r1.getc)
- with_pipe {|r2, w2|
- w1 << "def"
- w1.close
- ret = IO.copy_stream(r1, w2)
- assert_equal(5, ret)
- w2.close
- assert_equal("bcdef", r2.read)
- }
- }
-
- with_pipe {|r, w|
- ret = IO.copy_stream("src", w, 1, 1)
- assert_equal(1, ret)
- w.close
- assert_equal(content[1,1], r.read)
- }
-
- if have_nonblock?
- with_read_pipe("abc") {|r1|
- assert_equal("a", r1.getc)
- with_pipe {|r2, w2|
- w2.nonblock = true
- s = w2.syswrite("a" * 100000)
- t = Thread.new { sleep 0.1; r2.read }
- ret = IO.copy_stream(r1, w2)
- w2.close
- assert_equal(2, ret)
- assert_equal("a" * s + "bc", t.value)
- }
- }
- end
-
- bigcontent = "abc" * 123456
- File.open("bigsrc", "w") {|f| f << bigcontent }
- ret = IO.copy_stream("bigsrc", "bigdst")
- assert_equal(bigcontent.bytesize, ret)
- assert_equal(bigcontent, File.read("bigdst"))
-
- File.unlink("bigdst")
- ret = IO.copy_stream("bigsrc", "bigdst", nil, 100)
- assert_equal(bigcontent.bytesize-100, ret)
- assert_equal(bigcontent[100..-1], File.read("bigdst"))
-
- File.unlink("bigdst")
- ret = IO.copy_stream("bigsrc", "bigdst", 30000, 100)
- assert_equal(30000, ret)
- assert_equal(bigcontent[100, 30000], File.read("bigdst"))
-
- File.open("bigsrc") {|f|
- begin
- assert_equal(0, f.pos)
- ret = IO.copy_stream(f, "bigdst", nil, 10)
- assert_equal(bigcontent.bytesize-10, ret)
- assert_equal(bigcontent[10..-1], File.read("bigdst"))
- assert_equal(0, f.pos)
- ret = IO.copy_stream(f, "bigdst", 40, 30)
- assert_equal(40, ret)
- assert_equal(bigcontent[30, 40], File.read("bigdst"))
- assert_equal(0, f.pos)
- rescue NotImplementedError
- #skip "pread(2) is not implemtented."
- end
- }
-
- with_pipe {|r, w|
- w.close
- assert_raise(IOError) { IO.copy_stream("src", w) }
- }
-
- megacontent = "abc" * 1234567
- File.open("megasrc", "w") {|f| f << megacontent }
-
- if have_nonblock?
- with_pipe {|r1, w1|
- with_pipe {|r2, w2|
- t1 = Thread.new { w1 << megacontent; w1.close }
- t2 = Thread.new { r2.read }
- r1.nonblock = true
- w2.nonblock = true
- ret = IO.copy_stream(r1, w2)
- assert_equal(megacontent.bytesize, ret)
- w2.close
- t1.join
- assert_equal(megacontent, t2.value)
- }
- }
- end
-
- with_pipe {|r1, w1|
- with_pipe {|r2, w2|
- t1 = Thread.new { w1 << megacontent; w1.close }
- t2 = Thread.new { r2.read }
- ret = IO.copy_stream(r1, w2)
- assert_equal(megacontent.bytesize, ret)
- w2.close
- t1.join
- assert_equal(megacontent, t2.value)
- }
- }
-
- with_pipe {|r, w|
- t = Thread.new { r.read }
- ret = IO.copy_stream("megasrc", w)
- assert_equal(megacontent.bytesize, ret)
- w.close
- assert_equal(megacontent, t.value)
- }
- }
- end
-
- def test_copy_stream_rbuf
- mkcdtmpdir {
- begin
- with_pipe {|r, w|
- File.open("foo", "w") {|f| f << "abcd" }
- File.open("foo") {|f|
- f.read(1)
- assert_equal(3, IO.copy_stream(f, w, 10, 1))
- }
- w.close
- assert_equal("bcd", r.read)
- }
- rescue NotImplementedError
- skip "pread(2) is not implemtented."
- end
- }
- end
-
- def with_socketpair
- s1, s2 = UNIXSocket.pair
- begin
- yield s1, s2
- ensure
- s1.close unless s1.closed?
- s2.close unless s2.closed?
- end
- end
-
- def test_copy_stream_socket
- return unless defined? UNIXSocket
- mkcdtmpdir {
-
- content = "foobar"
- File.open("src", "w") {|f| f << content }
-
- with_socketpair {|s1, s2|
- ret = IO.copy_stream("src", s1)
- assert_equal(content.bytesize, ret)
- s1.close
- assert_equal(content, s2.read)
- }
-
- bigcontent = "abc" * 123456
- File.open("bigsrc", "w") {|f| f << bigcontent }
-
- with_socketpair {|s1, s2|
- t = Thread.new { s2.read }
- ret = IO.copy_stream("bigsrc", s1)
- assert_equal(bigcontent.bytesize, ret)
- s1.close
- result = t.value
- assert_equal(bigcontent, result)
- }
-
- with_socketpair {|s1, s2|
- t = Thread.new { s2.read }
- ret = IO.copy_stream("bigsrc", s1, 10000)
- assert_equal(10000, ret)
- s1.close
- result = t.value
- assert_equal(bigcontent[0,10000], result)
- }
-
- File.open("bigsrc") {|f|
- assert_equal(0, f.pos)
- with_socketpair {|s1, s2|
- t = Thread.new { s2.read }
- ret = IO.copy_stream(f, s1, nil, 100)
- assert_equal(bigcontent.bytesize-100, ret)
- assert_equal(0, f.pos)
- s1.close
- result = t.value
- assert_equal(bigcontent[100..-1], result)
- }
- }
-
- File.open("bigsrc") {|f|
- assert_equal(bigcontent[0,100], f.read(100))
- assert_equal(100, f.pos)
- with_socketpair {|s1, s2|
- t = Thread.new { s2.read }
- ret = IO.copy_stream(f, s1)
- assert_equal(bigcontent.bytesize-100, ret)
- assert_equal(bigcontent.length, f.pos)
- s1.close
- result = t.value
- assert_equal(bigcontent[100..-1], result)
- }
- }
-
- megacontent = "abc" * 1234567
- File.open("megasrc", "w") {|f| f << megacontent }
-
- if have_nonblock?
- with_socketpair {|s1, s2|
- t = Thread.new { s2.read }
- s1.nonblock = true
- ret = IO.copy_stream("megasrc", s1)
- assert_equal(megacontent.bytesize, ret)
- s1.close
- result = t.value
- assert_equal(megacontent, result)
- }
- end
- }
- end
-
- def test_copy_stream_strio
- src = StringIO.new("abcd")
- dst = StringIO.new
- ret = IO.copy_stream(src, dst)
- assert_equal(4, ret)
- assert_equal("abcd", dst.string)
- assert_equal(4, src.pos)
- end
-
- def test_copy_stream_strio_len
- src = StringIO.new("abcd")
- dst = StringIO.new
- ret = IO.copy_stream(src, dst, 3)
- assert_equal(3, ret)
- assert_equal("abc", dst.string)
- assert_equal(3, src.pos)
- end
-
- def test_copy_stream_strio_off
- src = StringIO.new("abcd")
- with_pipe {|r, w|
- assert_raise(ArgumentError) {
- IO.copy_stream(src, w, 3, 1)
- }
- }
- end
-
- def test_copy_stream_fname_to_strio
- mkcdtmpdir {
- File.open("foo", "w") {|f| f << "abcd" }
- src = "foo"
- dst = StringIO.new
- ret = IO.copy_stream(src, dst, 3)
- assert_equal(3, ret)
- assert_equal("abc", dst.string)
- }
- end
-
- def test_copy_stream_strio_to_fname
- mkcdtmpdir {
- # StringIO to filename
- src = StringIO.new("abcd")
- ret = IO.copy_stream(src, "fooo", 3)
- assert_equal(3, ret)
- assert_equal("abc", File.read("fooo"))
- assert_equal(3, src.pos)
- }
- end
-
- def test_copy_stream_io_to_strio
- mkcdtmpdir {
- # IO to StringIO
- File.open("bar", "w") {|f| f << "abcd" }
- File.open("bar") {|src|
- dst = StringIO.new
- ret = IO.copy_stream(src, dst, 3)
- assert_equal(3, ret)
- assert_equal("abc", dst.string)
- assert_equal(3, src.pos)
- }
- }
- end
-
- def test_copy_stream_strio_to_io
- mkcdtmpdir {
- # StringIO to IO
- src = StringIO.new("abcd")
- ret = File.open("baz", "w") {|dst|
- IO.copy_stream(src, dst, 3)
- }
- assert_equal(3, ret)
- assert_equal("abc", File.read("baz"))
- assert_equal(3, src.pos)
- }
- end
-
- class Rot13IO
- def initialize(io)
- @io = io
- end
-
- def readpartial(*args)
- ret = @io.readpartial(*args)
- ret.tr!('a-zA-Z', 'n-za-mN-ZA-M')
- ret
- end
-
- def write(str)
- @io.write(str.tr('a-zA-Z', 'n-za-mN-ZA-M'))
- end
-
- def to_io
- @io
- end
- end
-
- def test_copy_stream_io_to_rot13
- mkcdtmpdir {
- File.open("bar", "w") {|f| f << "vex" }
- File.open("bar") {|src|
- File.open("baz", "w") {|dst0|
- dst = Rot13IO.new(dst0)
- ret = IO.copy_stream(src, dst, 3)
- assert_equal(3, ret)
- }
- assert_equal("irk", File.read("baz"))
- }
- }
- end
-
- def test_copy_stream_rot13_to_io
- mkcdtmpdir {
- File.open("bar", "w") {|f| f << "flap" }
- File.open("bar") {|src0|
- src = Rot13IO.new(src0)
- File.open("baz", "w") {|dst|
- ret = IO.copy_stream(src, dst, 4)
- assert_equal(4, ret)
- }
- }
- assert_equal("sync", File.read("baz"))
- }
- end
-
- def test_copy_stream_rot13_to_rot13
- mkcdtmpdir {
- File.open("bar", "w") {|f| f << "bin" }
- File.open("bar") {|src0|
- src = Rot13IO.new(src0)
- File.open("baz", "w") {|dst0|
- dst = Rot13IO.new(dst0)
- ret = IO.copy_stream(src, dst, 3)
- assert_equal(3, ret)
- }
- }
- assert_equal("bin", File.read("baz"))
- }
- end
-
- def test_copy_stream_strio_flush
- with_pipe {|r, w|
- w.sync = false
- w.write "zz"
- src = StringIO.new("abcd")
- IO.copy_stream(src, w)
- t = Thread.new {
- w.close
- }
- assert_equal("zzabcd", r.read)
- t.join
- }
- end
-
- def test_copy_stream_strio_rbuf
- with_pipe {|r, w|
- w << "abcd"
- w.close
- assert_equal("a", r.read(1))
- sio = StringIO.new
- IO.copy_stream(r, sio)
- assert_equal("bcd", sio.string)
- }
- end
-
- def test_copy_stream_src_wbuf
- mkcdtmpdir {
- with_pipe {|r, w|
- File.open("foe", "w+") {|f|
- f.write "abcd\n"
- f.rewind
- f.write "xy"
- IO.copy_stream(f, w)
- }
- assert_equal("xycd\n", File.read("foe"))
- w.close
- assert_equal("cd\n", r.read)
- r.close
- }
- }
- end
-
- def test_copy_stream_dst_rbuf
- mkcdtmpdir {
- with_pipe {|r, w|
- w << "xyz"
- w.close
- File.open("fom", "w+b") {|f|
- f.write "abcd\n"
- f.rewind
- assert_equal("abc", f.read(3))
- f.ungetc "c"
- IO.copy_stream(r, f)
- }
- assert_equal("abxyz", File.read("fom"))
- }
- }
- end
-
- def safe_4
- Thread.new do
- Timeout.timeout(10) do
- $SAFE = 4
- yield
- end
- end.join
- end
-
- def pipe(wp, rp)
- r, w = IO.pipe
- rt = Thread.new { rp.call(r) }
- wt = Thread.new { wp.call(w) }
- flunk("timeout") unless rt.join(10) && wt.join(10)
- ensure
- r.close unless !r || r.closed?
- w.close unless !w || w.closed?
- (rt.kill; rt.join) if rt
- (wt.kill; wt.join) if wt
- end
-
- def ruby(*args)
- args = ['-e', '$>.write($<.read)'] if args.empty?
- ruby = EnvUtil.rubybin
- f = IO.popen([ruby] + args, 'r+')
- yield(f)
- ensure
- f.close unless !f || f.closed?
- end
-
- def test_try_convert
- assert_equal(STDOUT, IO.try_convert(STDOUT))
- assert_equal(nil, IO.try_convert("STDOUT"))
- end
-
- def test_ungetc2
- f = false
- pipe(proc do |w|
- 0 until f
- w.write("1" * 10000)
- w.close
- end, proc do |r|
- r.ungetc("0" * 10000)
- f = true
- assert_equal("0" * 10000 + "1" * 10000, r.read)
- end)
- end
-
- def test_write_non_writable
- with_pipe do |r, w|
- assert_raise(IOError) do
- r.write "foobarbaz"
- end
- end
- end
-
- def test_dup
- ruby do |f|
- f2 = f.dup
- f.puts "foo"
- f2.puts "bar"
- f.close_write
- f2.close_write
- assert_equal("foo\nbar\n", f.read)
- assert_equal("", f2.read)
- end
- end
-
- def test_dup_many
- ruby('-e', <<-'End') {|f|
- ok = 0
- a = []
- begin
- loop {a << IO.pipe}
- rescue Errno::EMFILE, Errno::ENFILE, Errno::ENOMEM
- ok += 1
- end
- print "no" if ok != 1
- begin
- loop {a << [a[-1][0].dup, a[-1][1].dup]}
- rescue Errno::EMFILE, Errno::ENFILE, Errno::ENOMEM
- ok += 1
- end
- print "no" if ok != 2
- print "ok"
- End
- assert_equal("ok", f.read)
- }
- end
-
- def test_inspect
- with_pipe do |r, w|
- assert(r.inspect =~ /^#<IO:fd \d+>$/)
- assert_raise(SecurityError) do
- safe_4 { r.inspect }
- end
- end
- end
-
- def test_readpartial
- pipe(proc do |w|
- w.write "foobarbaz"
- w.close
- end, proc do |r|
- assert_raise(ArgumentError) { r.readpartial(-1) }
- assert_equal("fooba", r.readpartial(5))
- r.readpartial(5, s = "")
- assert_equal("rbaz", s)
- end)
- end
-
- def test_readpartial_error
- with_pipe do |r, w|
- s = ""
- t = Thread.new { r.readpartial(5, s) }
- 0 until s.size == 5
- s.clear
- w.write "foobarbaz"
- w.close
- assert_raise(RuntimeError) { t.join }
- end
end
def test_readpartial_pos
@@ -839,622 +28,4 @@ class TestIO < Test::Unit::TestCase
}
}
end
-
- def test_read
- pipe(proc do |w|
- w.write "foobarbaz"
- w.close
- end, proc do |r|
- assert_raise(ArgumentError) { r.read(-1) }
- assert_equal("fooba", r.read(5))
- r.read(nil, s = "")
- assert_equal("rbaz", s)
- end)
- end
-
- def test_read_error
- with_pipe do |r, w|
- s = ""
- t = Thread.new { r.read(5, s) }
- 0 until s.size == 5
- s.clear
- w.write "foobarbaz"
- w.close
- assert_raise(RuntimeError) { t.join }
- end
- end
-
- def test_write_nonblock
- skip "IO#write_nonblock is not supported on file/pipe." if /mswin|bccwin|mingw/ =~ RUBY_PLATFORM
- pipe(proc do |w|
- w.write_nonblock(1)
- w.close
- end, proc do |r|
- assert_equal("1", r.read)
- end)
- end
-
- def test_read_nonblock_error
- return if !have_nonblock?
- with_pipe {|r, w|
- begin
- r.read_nonblock 4096
- rescue Errno::EWOULDBLOCK
- assert_kind_of(IO::WaitReadable, $!)
- end
- }
- end
-
- def test_write_nonblock_error
- return if !have_nonblock?
- with_pipe {|r, w|
- begin
- loop {
- w.write_nonblock "a"*100000
- }
- rescue Errno::EWOULDBLOCK
- assert_kind_of(IO::WaitWritable, $!)
- end
- }
- end
-
- def test_gets
- pipe(proc do |w|
- w.write "foobarbaz"
- w.close
- end, proc do |r|
- assert_equal("", r.gets(0))
- assert_equal("foobarbaz", s = r.gets(9))
- end)
- end
-
- def test_close_read
- ruby do |f|
- f.close_read
- f.write "foobarbaz"
- assert_raise(IOError) { f.read }
- end
- end
-
- def test_close_read_pipe
- with_pipe do |r, w|
- r.close_read
- assert_raise(Errno::EPIPE) { w.write "foobarbaz" }
- end
- end
-
- def test_close_read_security_error
- with_pipe do |r, w|
- assert_raise(SecurityError) do
- safe_4 { r.close_read }
- end
- end
- end
-
- def test_close_read_non_readable
- with_pipe do |r, w|
- assert_raise(IOError) do
- w.close_read
- end
- end
- end
-
- def test_close_write
- ruby do |f|
- f.write "foobarbaz"
- f.close_write
- assert_equal("foobarbaz", f.read)
- end
- end
-
- def test_close_write_security_error
- with_pipe do |r, w|
- assert_raise(SecurityError) do
- safe_4 { r.close_write }
- end
- end
- end
-
- def test_close_write_non_readable
- with_pipe do |r, w|
- assert_raise(IOError) do
- r.close_write
- end
- end
- end
-
- def test_pid
- r, w = IO.pipe
- assert_equal(nil, r.pid)
- assert_equal(nil, w.pid)
-
- pipe = IO.popen(EnvUtil.rubybin, "r+")
- pid1 = pipe.pid
- pipe.puts "p $$"
- pipe.close_write
- pid2 = pipe.read.chomp.to_i
- assert_equal(pid2, pid1)
- assert_equal(pid2, pipe.pid)
- pipe.close
- assert_raise(IOError) { pipe.pid }
- end
-
- def make_tempfile
- t = Tempfile.new("foo")
- t.binmode
- t.puts "foo"
- t.puts "bar"
- t.puts "baz"
- t.close
- t
- end
-
- def test_set_lineno
- t = make_tempfile
-
- ruby("-e", <<-SRC, t.path) do |f|
- open(ARGV[0]) do |f|
- p $.
- f.gets; p $.
- f.gets; p $.
- f.lineno = 1000; p $.
- f.gets; p $.
- f.gets; p $.
- f.rewind; p $.
- f.gets; p $.
- f.gets; p $.
- f.gets; p $.
- f.gets; p $.
- end
- SRC
- assert_equal("0,1,2,2,1001,1001,1001,1,2,3,3", f.read.chomp.gsub("\n", ","))
- end
-
- pipe(proc do |w|
- w.puts "foo"
- w.puts "bar"
- w.puts "baz"
- w.close
- end, proc do |r|
- r.gets; assert_equal(1, $.)
- r.gets; assert_equal(2, $.)
- r.lineno = 1000; assert_equal(2, $.)
- r.gets; assert_equal(1001, $.)
- r.gets; assert_equal(1001, $.)
- end)
- end
-
- def test_readline
- pipe(proc do |w|
- w.puts "foo"
- w.puts "bar"
- w.puts "baz"
- w.close
- end, proc do |r|
- r.readline; assert_equal(1, $.)
- r.readline; assert_equal(2, $.)
- r.lineno = 1000; assert_equal(2, $.)
- r.readline; assert_equal(1001, $.)
- assert_raise(EOFError) { r.readline }
- end)
- end
-
- def test_each_char
- pipe(proc do |w|
- w.puts "foo"
- w.puts "bar"
- w.puts "baz"
- w.close
- end, proc do |r|
- a = []
- r.each_char {|c| a << c }
- assert_equal(%w(f o o) + ["\n"] + %w(b a r) + ["\n"] + %w(b a z) + ["\n"], a)
- end)
- end
-
- def test_lines
- pipe(proc do |w|
- w.puts "foo"
- w.puts "bar"
- w.puts "baz"
- w.close
- end, proc do |r|
- e = r.lines
- assert_equal("foo\n", e.next)
- assert_equal("bar\n", e.next)
- assert_equal("baz\n", e.next)
- assert_raise(StopIteration) { e.next }
- end)
- end
-
- def test_bytes
- pipe(proc do |w|
- w.binmode
- w.puts "foo"
- w.puts "bar"
- w.puts "baz"
- w.close
- end, proc do |r|
- e = r.bytes
- (%w(f o o) + ["\n"] + %w(b a r) + ["\n"] + %w(b a z) + ["\n"]).each do |c|
- assert_equal(c.ord, e.next)
- end
- assert_raise(StopIteration) { e.next }
- end)
- end
-
- def test_chars
- pipe(proc do |w|
- w.puts "foo"
- w.puts "bar"
- w.puts "baz"
- w.close
- end, proc do |r|
- e = r.chars
- (%w(f o o) + ["\n"] + %w(b a r) + ["\n"] + %w(b a z) + ["\n"]).each do |c|
- assert_equal(c, e.next)
- end
- assert_raise(StopIteration) { e.next }
- end)
- end
-
- def test_readbyte
- pipe(proc do |w|
- w.binmode
- w.puts "foo"
- w.puts "bar"
- w.puts "baz"
- w.close
- end, proc do |r|
- r.binmode
- (%w(f o o) + ["\n"] + %w(b a r) + ["\n"] + %w(b a z) + ["\n"]).each do |c|
- assert_equal(c.ord, r.readbyte)
- end
- assert_raise(EOFError) { r.readbyte }
- end)
- end
-
- def test_readchar
- pipe(proc do |w|
- w.puts "foo"
- w.puts "bar"
- w.puts "baz"
- w.close
- end, proc do |r|
- (%w(f o o) + ["\n"] + %w(b a r) + ["\n"] + %w(b a z) + ["\n"]).each do |c|
- assert_equal(c, r.readchar)
- end
- assert_raise(EOFError) { r.readchar }
- end)
- end
-
- def test_close_on_exec
- skip "IO\#close_on_exec is not implemented." unless have_close_on_exec?
- ruby do |f|
- assert_equal(false, f.close_on_exec?)
- f.close_on_exec = true
- assert_equal(true, f.close_on_exec?)
- f.close_on_exec = false
- assert_equal(false, f.close_on_exec?)
- end
-
- with_pipe do |r, w|
- assert_equal(false, r.close_on_exec?)
- r.close_on_exec = true
- assert_equal(true, r.close_on_exec?)
- r.close_on_exec = false
- assert_equal(false, r.close_on_exec?)
-
- assert_equal(false, w.close_on_exec?)
- w.close_on_exec = true
- assert_equal(true, w.close_on_exec?)
- w.close_on_exec = false
- assert_equal(false, w.close_on_exec?)
- end
- end
-
- def test_close_security_error
- with_pipe do |r, w|
- assert_raise(SecurityError) do
- safe_4 { r.close }
- end
- end
- end
-
- def test_sysseek
- t = make_tempfile
-
- open(t.path) do |f|
- f.sysseek(-4, IO::SEEK_END)
- assert_equal("baz\n", f.read)
- end
-
- open(t.path) do |f|
- a = [f.getc, f.getc, f.getc]
- a.reverse_each {|c| f.ungetc c }
- assert_raise(IOError) { f.sysseek(1) }
- end
- end
-
- def test_syswrite
- t = make_tempfile
-
- open(t.path, "w") do |f|
- o = Object.new
- def o.to_s; "FOO\n"; end
- f.syswrite(o)
- end
- assert_equal("FOO\n", File.read(t.path))
- end
-
- def test_sysread
- t = make_tempfile
-
- open(t.path) do |f|
- a = [f.getc, f.getc, f.getc]
- a.reverse_each {|c| f.ungetc c }
- assert_raise(IOError) { f.sysread(1) }
- end
- end
-
- def test_flag
- t = make_tempfile
-
- assert_raise(ArgumentError) do
- open(t.path, "z") { }
- end
-
- assert_raise(ArgumentError) do
- open(t.path, "rr") { }
- end
- end
-
- def test_sysopen
- t = make_tempfile
-
- fd = IO.sysopen(t.path)
- assert_kind_of(Integer, fd)
- f = IO.for_fd(fd)
- assert_equal("foo\nbar\nbaz\n", f.read)
- f.close
-
- fd = IO.sysopen(t.path, "w", 0666)
- assert_kind_of(Integer, fd)
- if defined?(Fcntl::F_GETFL)
- f = IO.for_fd(fd)
- else
- f = IO.for_fd(fd, 0666)
- end
- f.write("FOO\n")
- f.close
-
- fd = IO.sysopen(t.path, "r")
- assert_kind_of(Integer, fd)
- f = IO.for_fd(fd)
- assert_equal("FOO\n", f.read)
- f.close
- end
-
- def test_open_redirect
- o = Object.new
- def o.to_open; self; end
- assert_equal(o, open(o))
- o2 = nil
- open(o) do |f|
- o2 = f
- end
- assert_equal(o, o2)
- end
-
- def test_open_pipe
- open("|" + EnvUtil.rubybin, "r+") do |f|
- f.puts "puts 'foo'"
- f.close_write
- assert_equal("foo\n", f.read)
- end
- end
-
- def test_reopen
- t = make_tempfile
-
- with_pipe do |r, w|
- assert_raise(SecurityError) do
- safe_4 { r.reopen(t.path) }
- end
- end
-
- open(__FILE__) do |f|
- f.gets
- assert_nothing_raised {
- f.reopen(t.path)
- assert_equal("foo\n", f.gets)
- }
- end
-
- open(__FILE__) do |f|
- f.gets
- f2 = open(t.path)
- f2.gets
- assert_nothing_raised {
- f.reopen(f2)
- assert_equal("bar\n", f.gets, '[ruby-core:24240]')
- }
- end
- end
-
- def test_foreach
- a = []
- IO.foreach("|" + EnvUtil.rubybin + " -e 'puts :foo; puts :bar; puts :baz'") {|x| a << x }
- assert_equal(["foo\n", "bar\n", "baz\n"], a)
-
- t = make_tempfile
-
- a = []
- IO.foreach(t.path) {|x| a << x }
- assert_equal(["foo\n", "bar\n", "baz\n"], a)
-
- a = []
- IO.foreach(t.path, {:mode => "r" }) {|x| a << x }
- assert_equal(["foo\n", "bar\n", "baz\n"], a)
-
- a = []
- IO.foreach(t.path, {:open_args => [] }) {|x| a << x }
- assert_equal(["foo\n", "bar\n", "baz\n"], a)
-
- a = []
- IO.foreach(t.path, {:open_args => ["r"] }) {|x| a << x }
- assert_equal(["foo\n", "bar\n", "baz\n"], a)
-
- a = []
- IO.foreach(t.path, "b") {|x| a << x }
- assert_equal(["foo\nb", "ar\nb", "az\n"], a)
-
- a = []
- IO.foreach(t.path, 3) {|x| a << x }
- assert_equal(["foo", "\n", "bar", "\n", "baz", "\n"], a)
-
- a = []
- IO.foreach(t.path, "b", 3) {|x| a << x }
- assert_equal(["foo", "\nb", "ar\n", "b", "az\n"], a)
-
- end
-
- def test_s_readlines
- t = make_tempfile
-
- assert_equal(["foo\n", "bar\n", "baz\n"], IO.readlines(t.path))
- assert_equal(["foo\nb", "ar\nb", "az\n"], IO.readlines(t.path, "b"))
- assert_equal(["fo", "o\n", "ba", "r\n", "ba", "z\n"], IO.readlines(t.path, 2))
- assert_equal(["fo", "o\n", "b", "ar", "\nb", "az", "\n"], IO.readlines(t.path, "b", 2))
- end
-
- def test_printf
- pipe(proc do |w|
- printf(w, "foo %s baz\n", "bar")
- w.close_write
- end, proc do |r|
- assert_equal("foo bar baz\n", r.read)
- end)
- end
-
- def test_print
- t = make_tempfile
-
- assert_in_out_err(["-", t.path], "print while $<.gets", %w(foo bar baz), [])
- end
-
- def test_putc
- pipe(proc do |w|
- w.putc "A"
- w.putc "BC"
- w.putc 68
- w.close_write
- end, proc do |r|
- assert_equal("ABD", r.read)
- end)
-
- assert_in_out_err([], "putc 65", %w(A), [])
- end
-
- def test_puts_recursive_array
- a = ["foo"]
- a << a
- pipe(proc do |w|
- w.puts a
- w.close
- end, proc do |r|
- assert_equal("foo\n[...]\n", r.read)
- end)
- end
-
- def test_display
- pipe(proc do |w|
- "foo".display(w)
- w.close
- end, proc do |r|
- assert_equal("foo", r.read)
- end)
-
- assert_in_out_err([], "'foo'.display", %w(foo), [])
- end
-
- def test_set_stdout
- assert_raise(TypeError) { $> = Object.new }
-
- assert_in_out_err([], "$> = $stderr\nputs 'foo'", [], %w(foo))
- end
-
- def test_initialize
- t = make_tempfile
-
- fd = IO.sysopen(t.path, "w")
- assert_kind_of(Integer, fd)
- %w[r r+ w+ a+].each do |mode|
- assert_raise(Errno::EINVAL, '[ruby-dev:38571]') {IO.new(fd, mode)}
- end
- f = IO.new(fd, "w")
- f.write("FOO\n")
- f.close
-
- assert_equal("FOO\n", File.read(t.path))
-
- f = open(t.path)
- assert_raise(RuntimeError) do
- f.instance_eval { initialize }
- end
- end
-
- def test_new_with_block
- assert_in_out_err([], "r, w = IO.pipe; IO.new(r) {}", [], /^.+$/)
- end
-
- def test_readline2
- assert_in_out_err(["-e", <<-SRC], "foo\nbar\nbaz\n", %w(foo bar baz end), [])
- puts readline
- puts readline
- puts readline
- begin
- puts readline
- rescue EOFError
- puts "end"
- end
- SRC
- end
-
- def test_readlines
- assert_in_out_err(["-e", "p readlines"], "foo\nbar\nbaz\n",
- ["[\"foo\\n\", \"bar\\n\", \"baz\\n\"]"], [])
- end
-
- def test_s_read
- t = make_tempfile
-
- assert_equal("foo\nbar\nbaz\n", File.read(t.path))
- assert_equal("foo\nba", File.read(t.path, 6))
- assert_equal("bar\n", File.read(t.path, 4, 4))
- end
-
- def test_uninitialized
- assert_raise(IOError) { IO.allocate.print "" }
- end
-
- def test_nofollow
- # O_NOFOLLOW is not standard.
- return if /freebsd|linux/ !~ RUBY_PLATFORM
- return unless defined? File::NOFOLLOW
- mkcdtmpdir {
- open("file", "w") {|f| f << "content" }
- begin
- File.symlink("file", "slnk")
- rescue NotImplementedError
- return
- end
- assert_raise(Errno::EMLINK, Errno::ELOOP) {
- open("slnk", File::RDONLY|File::NOFOLLOW) {}
- }
- assert_raise(Errno::EMLINK, Errno::ELOOP) {
- File.foreach("slnk", :open_args=>[File::RDONLY|File::NOFOLLOW]) {}
- }
- }
- end
end
diff --git a/test/ruby/test_io_m17n.rb b/test/ruby/test_io_m17n.rb
deleted file mode 100644
index aed688e591..0000000000
--- a/test/ruby/test_io_m17n.rb
+++ /dev/null
@@ -1,1709 +0,0 @@
-require 'test/unit'
-require 'tmpdir'
-require 'timeout'
-require_relative 'envutil'
-
-class TestIO_M17N < Test::Unit::TestCase
- ENCS = [
- Encoding::ASCII_8BIT,
- Encoding::EUC_JP,
- Encoding::Shift_JIS,
- Encoding::UTF_8
- ]
-
- def with_tmpdir
- Dir.mktmpdir {|dir|
- Dir.chdir(dir) {
- yield dir
- }
- }
- end
-
- def with_pipe(*args)
- r, w = IO.pipe(*args)
- begin
- yield r, w
- ensure
- r.close if !r.closed?
- w.close if !w.closed?
- end
- end
-
- def generate_file(path, content)
- open(path, "wb") {|f| f.write content }
- end
-
- def encdump(str)
- "#{str.dump}.force_encoding(#{str.encoding.name.dump})"
- end
-
- def assert_str_equal(expected, actual, message=nil)
- full_message = build_message(message, <<EOT)
-#{encdump expected} expected but not equal to
-#{encdump actual}.
-EOT
- assert_block(full_message) { expected == actual }
- end
-
- def test_open_r
- with_tmpdir {
- generate_file('tmp', "")
- open("tmp", "r") {|f|
- assert_equal(Encoding.default_external, f.external_encoding)
- assert_equal(nil, f.internal_encoding)
- }
- }
- end
-
- def test_open_rb
- with_tmpdir {
- generate_file('tmp', "")
- open("tmp", "rb") {|f|
- assert_equal(Encoding.find("ASCII-8BIT"), f.external_encoding)
- assert_equal(nil, f.internal_encoding)
- }
- }
- end
-
- def test_open_r_enc
- with_tmpdir {
- generate_file('tmp', "")
- open("tmp", "r:euc-jp") {|f|
- assert_equal(Encoding::EUC_JP, f.external_encoding)
- assert_equal(nil, f.internal_encoding)
- }
- }
- end
-
- def test_open_r_enc_in_opt
- with_tmpdir {
- generate_file('tmp', "")
- open("tmp", "r", encoding: "euc-jp") {|f|
- assert_equal(Encoding::EUC_JP, f.external_encoding)
- assert_equal(nil, f.internal_encoding)
- }
- }
- end
-
- def test_open_r_enc_in_opt2
- with_tmpdir {
- generate_file('tmp', "")
- open("tmp", "r", external_encoding: "euc-jp") {|f|
- assert_equal(Encoding::EUC_JP, f.external_encoding)
- assert_equal(nil, f.internal_encoding)
- }
- }
- end
-
- def test_open_r_enc_enc
- with_tmpdir {
- generate_file('tmp', "")
- open("tmp", "r:euc-jp:utf-8") {|f|
- assert_equal(Encoding::EUC_JP, f.external_encoding)
- assert_equal(Encoding::UTF_8, f.internal_encoding)
- }
- }
- end
-
- def test_open_r_enc_enc_in_opt
- with_tmpdir {
- generate_file('tmp', "")
- open("tmp", "r", encoding: "euc-jp:utf-8") {|f|
- assert_equal(Encoding::EUC_JP, f.external_encoding)
- assert_equal(Encoding::UTF_8, f.internal_encoding)
- }
- }
- end
-
- def test_open_r_enc_enc_in_opt2
- with_tmpdir {
- generate_file('tmp', "")
- open("tmp", "r", external_encoding: "euc-jp", internal_encoding: "utf-8") {|f|
- assert_equal(Encoding::EUC_JP, f.external_encoding)
- assert_equal(Encoding::UTF_8, f.internal_encoding)
- }
- }
- end
-
- def test_open_w
- with_tmpdir {
- open("tmp", "w") {|f|
- assert_equal(nil, f.external_encoding)
- assert_equal(nil, f.internal_encoding)
- }
- }
- end
-
- def test_open_wb
- with_tmpdir {
- open("tmp", "wb") {|f|
- assert_equal(Encoding.find("ASCII-8BIT"), f.external_encoding)
- assert_equal(nil, f.internal_encoding)
- }
- }
- end
-
- def test_open_w_enc
- with_tmpdir {
- open("tmp", "w:euc-jp") {|f|
- assert_equal(Encoding::EUC_JP, f.external_encoding)
- assert_equal(nil, f.internal_encoding)
- }
- }
- end
-
- def test_open_w_enc_in_opt
- with_tmpdir {
- open("tmp", "w", encoding: "euc-jp") {|f|
- assert_equal(Encoding::EUC_JP, f.external_encoding)
- assert_equal(nil, f.internal_encoding)
- }
- }
- end
-
- def test_open_w_enc_in_opt2
- with_tmpdir {
- open("tmp", "w", external_encoding: "euc-jp") {|f|
- assert_equal(Encoding::EUC_JP, f.external_encoding)
- assert_equal(nil, f.internal_encoding)
- }
- }
- end
-
- def test_open_w_enc_enc
- with_tmpdir {
- open("tmp", "w:euc-jp:utf-8") {|f|
- assert_equal(Encoding::EUC_JP, f.external_encoding)
- assert_equal(Encoding::UTF_8, f.internal_encoding)
- }
- }
- end
-
- def test_open_w_enc_enc_in_opt
- with_tmpdir {
- open("tmp", "w", encoding: "euc-jp:utf-8") {|f|
- assert_equal(Encoding::EUC_JP, f.external_encoding)
- assert_equal(Encoding::UTF_8, f.internal_encoding)
- }
- }
- end
-
- def test_open_w_enc_enc_in_opt2
- with_tmpdir {
- open("tmp", "w", external_encoding: "euc-jp", internal_encoding: "utf-8") {|f|
- assert_equal(Encoding::EUC_JP, f.external_encoding)
- assert_equal(Encoding::UTF_8, f.internal_encoding)
- }
- }
- end
-
- def test_open_w_enc_enc_perm
- with_tmpdir {
- open("tmp", "w:euc-jp:utf-8", 0600) {|f|
- assert_equal(Encoding::EUC_JP, f.external_encoding)
- assert_equal(Encoding::UTF_8, f.internal_encoding)
- }
- }
- end
-
- def test_io_new_enc
- with_tmpdir {
- generate_file("tmp", "\xa1")
- fd = IO.sysopen("tmp")
- f = IO.new(fd, "r:sjis")
- begin
- assert_equal(Encoding::Shift_JIS, f.read.encoding)
- ensure
- f.close
- end
- }
- end
-
- def test_s_pipe_invalid
- r, w = IO.pipe("utf-8", "euc-jp", :invalid=>:replace)
- w << "\x80"
- w.close
- assert_equal("?", r.read)
- ensure
- r.close if r && !r.closed?
- w.close if w && !w.closed?
- end
-
- def test_s_pipe_undef
- r, w = IO.pipe("utf-8:euc-jp", :undef=>:replace)
- w << "\ufffd"
- w.close
- assert_equal("?", r.read)
- ensure
- r.close if r && !r.closed?
- w.close if w && !w.closed?
- end
-
- def test_s_pipe_undef_replace_string
- r, w = IO.pipe("utf-8:euc-jp", :undef=>:replace, :replace=>"X")
- w << "\ufffd"
- w.close
- assert_equal("X", r.read)
- ensure
- r.close if r && !r.closed?
- w.close if w && !w.closed?
- end
-
- def test_dup
- with_pipe("utf-8:euc-jp") {|r, w|
- w << "\u3042"
- w.close
- r2 = r.dup
- begin
- assert_equal("\xA4\xA2".force_encoding("euc-jp"), r2.read)
- ensure
- r2.close
- end
-
- }
- end
-
- def test_dup_undef
- with_pipe("utf-8:euc-jp", :undef=>:replace) {|r, w|
- w << "\uFFFD"
- w.close
- r2 = r.dup
- begin
- assert_equal("?", r2.read)
- ensure
- r2.close
- end
- }
- end
-
- def test_stdin
- assert_equal(Encoding.default_external, STDIN.external_encoding)
- assert_equal(nil, STDIN.internal_encoding)
- end
-
- def test_stdout
- assert_equal(nil, STDOUT.external_encoding)
- assert_equal(nil, STDOUT.internal_encoding)
- end
-
- def test_stderr
- assert_equal(nil, STDERR.external_encoding)
- assert_equal(nil, STDERR.internal_encoding)
- end
-
- def test_terminator_conversion
- with_tmpdir {
- generate_file('tmp', "before \u00FF after")
- s = open("tmp", "r:utf-8:iso-8859-1") {|f|
- f.gets("\xFF".force_encoding("iso-8859-1"))
- }
- assert_equal(Encoding.find("iso-8859-1"), s.encoding)
- assert_str_equal("before \xFF".force_encoding("iso-8859-1"), s, '[ruby-core:14288]')
- }
- end
-
- def test_terminator_conversion2
- with_tmpdir {
- generate_file('tmp', "before \xA1\xA2\xA2\xA3 after")
- s = open("tmp", "r:euc-jp:utf-8") {|f|
- f.gets("\xA2\xA2".force_encoding("euc-jp").encode("utf-8"))
- }
- assert_equal(Encoding.find("utf-8"), s.encoding)
- assert_str_equal("before \xA1\xA2\xA2\xA3 after".force_encoding("euc-jp").encode("utf-8"), s, '[ruby-core:14319]')
- }
- end
-
- def test_terminator_stateful_conversion
- with_tmpdir {
- src = "before \e$B\x23\x30\x23\x31\e(B after".force_encoding("iso-2022-jp")
- generate_file('tmp', src)
- s = open("tmp", "r:iso-2022-jp:euc-jp") {|f|
- f.gets("0".force_encoding("euc-jp"))
- }
- assert_equal(Encoding.find("euc-jp"), s.encoding)
- assert_str_equal(src.encode("euc-jp"), s)
- }
- end
-
- def test_nonascii_terminator
- with_tmpdir {
- generate_file('tmp', "before \xA2\xA2 after")
- open("tmp", "r:euc-jp") {|f|
- assert_raise(ArgumentError) {
- f.gets("\xA2\xA2".force_encoding("utf-8"))
- }
- }
- }
- end
-
- def test_pipe_terminator_conversion
- with_pipe("euc-jp:utf-8") {|r, w|
- w.write "before \xa2\xa2 after"
- rs = "\xA2\xA2".encode("utf-8", "euc-jp")
- w.close
- timeout(1) {
- assert_equal("before \xa2\xa2".encode("utf-8", "euc-jp"),
- r.gets(rs))
- }
- }
- end
-
- def test_pipe_conversion
- with_pipe("euc-jp:utf-8") {|r, w|
- w.write "\xa1\xa1"
- assert_equal("\xa1\xa1".encode("utf-8", "euc-jp"), r.getc)
- }
- end
-
- def test_pipe_convert_partial_read
- with_pipe("euc-jp:utf-8") {|r, w|
- begin
- t = Thread.new {
- w.write "\xa1"
- sleep 0.1
- w.write "\xa1"
- }
- assert_equal("\xa1\xa1".encode("utf-8", "euc-jp"), r.getc)
- ensure
- t.join if t
- end
- }
- end
-
- def test_getc_invalid
- with_pipe("euc-jp:utf-8") {|r, w|
- w << "\xa1xyz"
- w.close
- err = assert_raise(Encoding::InvalidByteSequenceError) { r.getc }
- assert_equal("\xA1".force_encoding("ascii-8bit"), err.error_bytes)
- assert_equal("xyz", r.read(10))
- }
- end
-
- def test_getc_stateful_conversion
- with_tmpdir {
- src = "\e$B\x23\x30\x23\x31\e(B".force_encoding("iso-2022-jp")
- generate_file('tmp', src)
- open("tmp", "r:iso-2022-jp:euc-jp") {|f|
- assert_equal("\xa3\xb0".force_encoding("euc-jp"), f.getc)
- assert_equal("\xa3\xb1".force_encoding("euc-jp"), f.getc)
- }
- }
- end
-
- def test_ungetc_stateful_conversion
- with_tmpdir {
- src = "before \e$B\x23\x30\x23\x31\e(B after".force_encoding("iso-2022-jp")
- generate_file('tmp', src)
- s = open("tmp", "r:iso-2022-jp:euc-jp") {|f|
- f.ungetc("0".force_encoding("euc-jp"))
- f.read
- }
- assert_equal(Encoding.find("euc-jp"), s.encoding)
- assert_str_equal("0" + src.encode("euc-jp"), s)
- }
- end
-
- def test_ungetc_stateful_conversion2
- with_tmpdir {
- src = "before \e$B\x23\x30\x23\x31\e(B after".force_encoding("iso-2022-jp")
- former = "before \e$B\x23\x30\e(B".force_encoding("iso-2022-jp")
- rs = "\e$B\x23\x30\e(B".force_encoding("iso-2022-jp")
- latter = "\e$B\x23\x31\e(B after".force_encoding("iso-2022-jp")
- generate_file('tmp', src)
- s = open("tmp", "r:iso-2022-jp:euc-jp") {|f|
- assert_equal(former.encode("euc-jp", "iso-2022-jp"),
- f.gets(rs.encode("euc-jp", "iso-2022-jp")))
- f.ungetc("0")
- f.read
- }
- assert_equal(Encoding.find("euc-jp"), s.encoding)
- assert_str_equal("0" + latter.encode("euc-jp"), s)
- }
- end
-
- def test_open_ascii
- with_tmpdir {
- src = "abc\n"
- generate_file('tmp', "abc\n")
- ENCS.each {|enc|
- s = open('tmp', "r:#{enc}") {|f| f.gets }
- assert_equal(enc, s.encoding)
- assert_str_equal(src, s)
- }
- }
- end
-
- def test_open_nonascii
- with_tmpdir {
- src = "\xc2\xa1\n"
- generate_file('tmp', src)
- ENCS.each {|enc|
- content = src.dup.force_encoding(enc)
- s = open('tmp', "r:#{enc}") {|f| f.gets }
- assert_equal(enc, s.encoding)
- assert_str_equal(content, s)
- }
- }
- end
-
- def test_read_encoding
- with_tmpdir {
- src = "\xc2\xa1\n".force_encoding("ASCII-8BIT")
- generate_file('tmp', "\xc2\xa1\n")
- ENCS.each {|enc|
- content = src.dup.force_encoding(enc)
- open('tmp', "r:#{enc}") {|f|
- s = f.getc
- assert_equal(enc, s.encoding)
- assert_str_equal(content[0], s)
- }
- open('tmp', "r:#{enc}") {|f|
- s = f.readchar
- assert_equal(enc, s.encoding)
- assert_str_equal(content[0], s)
- }
- open('tmp', "r:#{enc}") {|f|
- s = f.gets
- assert_equal(enc, s.encoding)
- assert_str_equal(content, s)
- }
- open('tmp', "r:#{enc}") {|f|
- s = f.readline
- assert_equal(enc, s.encoding)
- assert_str_equal(content, s)
- }
- open('tmp', "r:#{enc}") {|f|
- lines = f.readlines
- assert_equal(1, lines.length)
- s = lines[0]
- assert_equal(enc, s.encoding)
- assert_str_equal(content, s)
- }
- open('tmp', "r:#{enc}") {|f|
- f.each_line {|s|
- assert_equal(enc, s.encoding)
- assert_str_equal(content, s)
- }
- }
- open('tmp', "r:#{enc}") {|f|
- s = f.read
- assert_equal(enc, s.encoding)
- assert_str_equal(content, s)
- }
- open('tmp', "r:#{enc}") {|f|
- s = f.read(1)
- assert_equal(Encoding::ASCII_8BIT, s.encoding)
- assert_str_equal(src[0], s)
- }
- open('tmp', "r:#{enc}") {|f|
- s = f.readpartial(1)
- assert_equal(Encoding::ASCII_8BIT, s.encoding)
- assert_str_equal(src[0], s)
- }
- open('tmp', "r:#{enc}") {|f|
- s = f.sysread(1)
- assert_equal(Encoding::ASCII_8BIT, s.encoding)
- assert_str_equal(src[0], s)
- }
- }
- }
- end
-
- def test_write_noenc
- src = "\xc2\xa1\n".force_encoding("ascii-8bit")
- with_tmpdir {
- open('tmp', "w") {|f|
- ENCS.each {|enc|
- f.write src.dup.force_encoding(enc)
- }
- }
- open('tmp', 'r:ascii-8bit') {|f|
- assert_equal(src*ENCS.length, f.read)
- }
- }
- end
-
- def test_write_conversion
- utf8 = "\u6666"
- eucjp = "\xb3\xa2".force_encoding("EUC-JP")
- with_tmpdir {
- open('tmp', "w:EUC-JP") {|f|
- assert_equal(Encoding::EUC_JP, f.external_encoding)
- assert_equal(nil, f.internal_encoding)
- f.print utf8
- }
- assert_equal(eucjp, File.read('tmp').force_encoding("EUC-JP"))
- open('tmp', 'r:EUC-JP:UTF-8') {|f|
- assert_equal(Encoding::EUC_JP, f.external_encoding)
- assert_equal(Encoding::UTF_8, f.internal_encoding)
- assert_equal(utf8, f.read)
- }
- }
- end
-
- def test_pipe
- utf8 = "\u6666"
- eucjp = "\xb3\xa2".force_encoding("EUC-JP")
-
- with_pipe {|r,w|
- assert_equal(Encoding.default_external, r.external_encoding)
- assert_equal(nil, r.internal_encoding)
- w << utf8
- w.close
- s = r.read
- assert_equal(Encoding.default_external, s.encoding)
- assert_str_equal(utf8.dup.force_encoding(Encoding.default_external), s)
- }
-
- with_pipe("EUC-JP") {|r,w|
- assert_equal(Encoding::EUC_JP, r.external_encoding)
- assert_equal(nil, r.internal_encoding)
- w << eucjp
- w.close
- assert_equal(eucjp, r.read)
- }
-
- with_pipe("UTF-8:EUC-JP") {|r,w|
- assert_equal(Encoding::UTF_8, r.external_encoding)
- assert_equal(Encoding::EUC_JP, r.internal_encoding)
- w << utf8
- w.close
- assert_equal(eucjp, r.read)
- }
-
- ENCS.each {|enc|
- with_pipe(enc) {|r, w|
- w << "\xc2\xa1"
- w.close
- s = r.getc
- assert_equal(enc, s.encoding)
- }
- }
-
- ENCS.each {|enc|
- next if enc == Encoding::ASCII_8BIT
- next if enc == Encoding::UTF_8
- with_pipe("#{enc}:UTF-8") {|r, w|
- w << "\xc2\xa1"
- w.close
- s = r.read
- assert_equal(Encoding::UTF_8, s.encoding)
- assert_equal(s.encode("UTF-8"), s)
- }
- }
-
- end
-
- def test_marshal
- with_pipe("EUC-JP") {|r, w|
- data = 56225
- Marshal.dump(data, w)
- w.close
- result = nil
- assert_nothing_raised("[ruby-dev:33264]") { result = Marshal.load(r) }
- assert_equal(data, result)
- }
- end
-
- def test_gets_nil
- with_pipe("UTF-8:EUC-JP") {|r, w|
- w << "\u{3042}"
- w.close
- result = r.gets(nil)
- assert_equal("\u{3042}".encode("euc-jp"), result)
- }
- end
-
- def test_gets_limit
- with_pipe("euc-jp") {|r, w| w << "\xa4\xa2\xa4\xa4\xa4\xa6\n\xa4\xa8\xa4\xaa"; w.close
- assert_equal("\xa4\xa2".force_encoding("euc-jp"), r.gets(1))
- }
- with_pipe("euc-jp") {|r, w| w << "\xa4\xa2\xa4\xa4\xa4\xa6\n\xa4\xa8\xa4\xaa"; w.close
- assert_equal("\xa4\xa2".force_encoding("euc-jp"), r.gets(2))
- }
- with_pipe("euc-jp") {|r, w| w << "\xa4\xa2\xa4\xa4\xa4\xa6\n\xa4\xa8\xa4\xaa"; w.close
- assert_equal("\xa4\xa2\xa4\xa4".force_encoding("euc-jp"), r.gets(3))
- }
- with_pipe("euc-jp") {|r, w| w << "\xa4\xa2\xa4\xa4\xa4\xa6\n\xa4\xa8\xa4\xaa"; w.close
- assert_equal("\xa4\xa2\xa4\xa4".force_encoding("euc-jp"), r.gets(4))
- }
- with_pipe("euc-jp") {|r, w| w << "\xa4\xa2\xa4\xa4\xa4\xa6\n\xa4\xa8\xa4\xaa"; w.close
- assert_equal("\xa4\xa2\xa4\xa4\xa4\xa6".force_encoding("euc-jp"), r.gets(5))
- }
- with_pipe("euc-jp") {|r, w| w << "\xa4\xa2\xa4\xa4\xa4\xa6\n\xa4\xa8\xa4\xaa"; w.close
- assert_equal("\xa4\xa2\xa4\xa4\xa4\xa6".force_encoding("euc-jp"), r.gets(6))
- }
- with_pipe("euc-jp") {|r, w| w << "\xa4\xa2\xa4\xa4\xa4\xa6\n\xa4\xa8\xa4\xaa"; w.close
- assert_equal("\xa4\xa2\xa4\xa4\xa4\xa6\n".force_encoding("euc-jp"), r.gets(7))
- }
- with_pipe("euc-jp") {|r, w| w << "\xa4\xa2\xa4\xa4\xa4\xa6\n\xa4\xa8\xa4\xaa"; w.close
- assert_equal("\xa4\xa2\xa4\xa4\xa4\xa6\n".force_encoding("euc-jp"), r.gets(8))
- }
- with_pipe("euc-jp") {|r, w| w << "\xa4\xa2\xa4\xa4\xa4\xa6\n\xa4\xa8\xa4\xaa"; w.close
- assert_equal("\xa4\xa2\xa4\xa4\xa4\xa6\n".force_encoding("euc-jp"), r.gets(9))
- }
- end
-
- def test_gets_invalid
- with_pipe("utf-8:euc-jp") {|r, w|
- before = "\u{3042}\u{3044}"
- invalid = "\x80".force_encoding("utf-8")
- after = "\u{3046}\u{3048}"
- w << before + invalid + after
- w.close
- err = assert_raise(Encoding::InvalidByteSequenceError) { r.gets }
- assert_equal(invalid.force_encoding("ascii-8bit"), err.error_bytes)
- assert_equal(after.encode("euc-jp"), r.gets)
- }
- end
-
- def test_getc_invalid2
- with_pipe("utf-8:euc-jp") {|r, w|
- before1 = "\u{3042}"
- before2 = "\u{3044}"
- invalid = "\x80".force_encoding("utf-8")
- after1 = "\u{3046}"
- after2 = "\u{3048}"
- w << before1 + before2 + invalid + after1 + after2
- w.close
- assert_equal(before1.encode("euc-jp"), r.getc)
- assert_equal(before2.encode("euc-jp"), r.getc)
- err = assert_raise(Encoding::InvalidByteSequenceError) { r.getc }
- assert_equal(invalid.force_encoding("ascii-8bit"), err.error_bytes)
- assert_equal(after1.encode("euc-jp"), r.getc)
- assert_equal(after2.encode("euc-jp"), r.getc)
- }
- end
-
- def test_getc_invalid3
- with_pipe("utf-16le:euc-jp", binmode: true) {|r, w|
- before1 = "\x42\x30".force_encoding("utf-16le")
- before2 = "\x44\x30".force_encoding("utf-16le")
- invalid = "\x00\xd8".force_encoding("utf-16le")
- after1 = "\x46\x30".force_encoding("utf-16le")
- after2 = "\x48\x30".force_encoding("utf-16le")
- w << before1 + before2 + invalid + after1 + after2
- w.close
- assert_equal(before1.encode("euc-jp"), r.getc)
- assert_equal(before2.encode("euc-jp"), r.getc)
- err = assert_raise(Encoding::InvalidByteSequenceError) { r.getc }
- assert_equal(invalid.force_encoding("ascii-8bit"), err.error_bytes)
- assert_equal(after1.encode("euc-jp"), r.getc)
- assert_equal(after2.encode("euc-jp"), r.getc)
- }
- end
-
- def test_read_all
- with_pipe("utf-8:euc-jp") {|r, w|
- str = "\u3042\u3044"
- w << str
- w.close
- assert_equal(str.encode("euc-jp"), r.read)
- }
- end
-
- def test_read_all_invalid
- with_pipe("utf-8:euc-jp") {|r, w|
- before = "\u{3042}\u{3044}"
- invalid = "\x80".force_encoding("utf-8")
- after = "\u{3046}\u{3048}"
- w << before + invalid + after
- w.close
- err = assert_raise(Encoding::InvalidByteSequenceError) { r.read }
- assert_equal(invalid.force_encoding("ascii-8bit"), err.error_bytes)
- assert_equal(after.encode("euc-jp"), r.read)
- }
- end
-
- def test_file_foreach
- with_tmpdir {
- generate_file('tst', 'a' * 8191 + "\xa1\xa1")
- assert_nothing_raised {
- File.foreach('tst', :encoding=>"euc-jp") {|line| line.inspect }
- }
- }
- end
-
- def test_set_encoding
- with_pipe("utf-8:euc-jp") {|r, w|
- s = "\u3042".force_encoding("ascii-8bit")
- s << "\x82\xa0".force_encoding("ascii-8bit")
- w << s
- w.close
- assert_equal("\xa4\xa2".force_encoding("euc-jp"), r.getc)
- r.set_encoding("shift_jis:euc-jp")
- assert_equal("\xa4\xa2".force_encoding("euc-jp"), r.getc)
- }
- end
-
- def test_set_encoding2
- with_pipe("utf-8:euc-jp") {|r, w|
- s = "\u3042".force_encoding("ascii-8bit")
- s << "\x82\xa0".force_encoding("ascii-8bit")
- w << s
- w.close
- assert_equal("\xa4\xa2".force_encoding("euc-jp"), r.getc)
- r.set_encoding("shift_jis", "euc-jp")
- assert_equal("\xa4\xa2".force_encoding("euc-jp"), r.getc)
- }
- end
-
- def test_set_encoding_nil
- with_pipe("utf-8:euc-jp") {|r, w|
- s = "\u3042".force_encoding("ascii-8bit")
- s << "\x82\xa0".force_encoding("ascii-8bit")
- w << s
- w.close
- assert_equal("\xa4\xa2".force_encoding("euc-jp"), r.getc)
- r.set_encoding(nil)
- assert_equal("\x82\xa0".force_encoding(Encoding.default_external), r.read)
- }
- end
-
- def test_set_encoding_enc
- with_pipe("utf-8:euc-jp") {|r, w|
- s = "\u3042".force_encoding("ascii-8bit")
- s << "\x82\xa0".force_encoding("ascii-8bit")
- w << s
- w.close
- assert_equal("\xa4\xa2".force_encoding("euc-jp"), r.getc)
- r.set_encoding(Encoding::Shift_JIS)
- assert_equal("\x82\xa0".force_encoding(Encoding::Shift_JIS), r.getc)
- }
- end
-
- def test_set_encoding_invalid
- with_pipe {|r, w|
- w << "\x80"
- w.close
- r.set_encoding("utf-8:euc-jp", :invalid=>:replace)
- assert_equal("?", r.read)
- }
- end
-
- def test_set_encoding_undef
- with_pipe {|r, w|
- w << "\ufffd"
- w.close
- r.set_encoding("utf-8", "euc-jp", :undef=>:replace)
- assert_equal("?", r.read)
- }
- end
-
- def test_set_encoding_undef_replace
- with_pipe {|r, w|
- w << "\ufffd"
- w.close
- r.set_encoding("utf-8", "euc-jp", :undef=>:replace, :replace=>"ZZZ")
- assert_equal("ZZZ", r.read)
- }
- with_pipe {|r, w|
- w << "\ufffd"
- w.close
- r.set_encoding("utf-8:euc-jp", :undef=>:replace, :replace=>"ZZZ")
- assert_equal("ZZZ", r.read)
- }
- end
-
- def test_set_encoding_binmode
- assert_raise(ArgumentError) {
- open(__FILE__, "rt") {|f|
- f.set_encoding("iso-2022-jp")
- }
- }
- assert_raise(ArgumentError) {
- open(__FILE__, "r") {|f|
- f.set_encoding("iso-2022-jp")
- }
- }
- assert_nothing_raised {
- open(__FILE__, "rb") {|f|
- f.set_encoding("iso-2022-jp")
- }
- }
- assert_nothing_raised {
- open(__FILE__, "r") {|f|
- f.binmode
- f.set_encoding("iso-2022-jp")
- }
- }
- assert_nothing_raised {
- open(__FILE__, "rt") {|f|
- f.binmode
- f.set_encoding("iso-2022-jp")
- }
- }
- end
-
- def test_write_conversion_fixenc
- with_pipe {|r, w|
- w.set_encoding("iso-2022-jp:utf-8")
- t = Thread.new { r.read.force_encoding("ascii-8bit") }
- w << "\u3042"
- w << "\u3044"
- w.close
- assert_equal("\e$B$\"$$\e(B".force_encoding("ascii-8bit"), t.value)
- }
- end
-
- def test_write_conversion_anyenc_stateful
- with_pipe {|r, w|
- w.set_encoding("iso-2022-jp")
- t = Thread.new { r.read.force_encoding("ascii-8bit") }
- w << "\u3042"
- w << "\x82\xa2".force_encoding("sjis")
- w.close
- assert_equal("\e$B$\"$$\e(B".force_encoding("ascii-8bit"), t.value)
- }
- end
-
- def test_write_conversion_anyenc_stateless
- with_pipe {|r, w|
- w.set_encoding("euc-jp")
- t = Thread.new { r.read.force_encoding("ascii-8bit") }
- w << "\u3042"
- w << "\x82\xa2".force_encoding("sjis")
- w.close
- assert_equal("\xa4\xa2\xa4\xa4".force_encoding("ascii-8bit"), t.value)
- }
- end
-
- def test_write_conversion_anyenc_stateful_nosync
- with_pipe {|r, w|
- w.sync = false
- w.set_encoding("iso-2022-jp")
- t = Thread.new { r.read.force_encoding("ascii-8bit") }
- w << "\u3042"
- w << "\x82\xa2".force_encoding("sjis")
- w.close
- assert_equal("\e$B$\"$$\e(B".force_encoding("ascii-8bit"), t.value)
- }
- end
-
- def test_read_stateful
- with_pipe("euc-jp:iso-2022-jp") {|r, w|
- w << "\xA4\xA2"
- w.close
- assert_equal("\e$B$\"\e(B".force_encoding("iso-2022-jp"), r.read)
- }
- end
-
- def test_stdin_external_encoding_with_reopen
- with_tmpdir {
- open("tst", "w+") {|f|
- pid = spawn(EnvUtil.rubybin, '-e', <<-'End', 10=>f)
- io = IO.new(10, "r+")
- STDIN.reopen(io)
- STDIN.external_encoding
- STDIN.write "\u3042"
- STDIN.flush
- End
- Process.wait pid
- f.rewind
- result = f.read.force_encoding("ascii-8bit")
- assert_equal("\u3042".force_encoding("ascii-8bit"), result)
- }
- }
- end
-
- def test_popen_r_enc
- IO.popen("#{EnvUtil.rubybin} -e 'putc 255'", "r:ascii-8bit") {|f|
- assert_equal(Encoding::ASCII_8BIT, f.external_encoding)
- assert_equal(nil, f.internal_encoding)
- s = f.read
- assert_equal(Encoding::ASCII_8BIT, s.encoding)
- assert_equal("\xff".force_encoding("ascii-8bit"), s)
- }
- end
-
- def test_popen_r_enc_in_opt
- IO.popen("#{EnvUtil.rubybin} -e 'putc 255'", "r", encoding: "ascii-8bit") {|f|
- assert_equal(Encoding::ASCII_8BIT, f.external_encoding)
- assert_equal(nil, f.internal_encoding)
- s = f.read
- assert_equal(Encoding::ASCII_8BIT, s.encoding)
- assert_equal("\xff".force_encoding("ascii-8bit"), s)
- }
- end
-
- def test_popen_r_enc_in_opt2
- IO.popen("#{EnvUtil.rubybin} -e 'putc 255'", "r", external_encoding: "ascii-8bit") {|f|
- assert_equal(Encoding::ASCII_8BIT, f.external_encoding)
- assert_equal(nil, f.internal_encoding)
- s = f.read
- assert_equal(Encoding::ASCII_8BIT, s.encoding)
- assert_equal("\xff".force_encoding("ascii-8bit"), s)
- }
- end
-
- def test_popen_r_enc_enc
- IO.popen("#{EnvUtil.rubybin} -e 'putc 0xa1'", "r:shift_jis:euc-jp") {|f|
- assert_equal(Encoding::Shift_JIS, f.external_encoding)
- assert_equal(Encoding::EUC_JP, f.internal_encoding)
- s = f.read
- assert_equal(Encoding::EUC_JP, s.encoding)
- assert_equal("\x8e\xa1".force_encoding("euc-jp"), s)
- }
- end
-
- def test_popen_r_enc_enc_in_opt
- IO.popen("#{EnvUtil.rubybin} -e 'putc 0xa1'", "r", encoding: "shift_jis:euc-jp") {|f|
- assert_equal(Encoding::Shift_JIS, f.external_encoding)
- assert_equal(Encoding::EUC_JP, f.internal_encoding)
- s = f.read
- assert_equal(Encoding::EUC_JP, s.encoding)
- assert_equal("\x8e\xa1".force_encoding("euc-jp"), s)
- }
- end
-
- def test_popen_r_enc_enc_in_opt2
- IO.popen("#{EnvUtil.rubybin} -e 'putc 0xa1'", "r", external_encoding: "shift_jis", internal_encoding: "euc-jp") {|f|
- assert_equal(Encoding::Shift_JIS, f.external_encoding)
- assert_equal(Encoding::EUC_JP, f.internal_encoding)
- s = f.read
- assert_equal(Encoding::EUC_JP, s.encoding)
- assert_equal("\x8e\xa1".force_encoding("euc-jp"), s)
- }
- end
-
- def test_popenv_r_enc_enc_in_opt2
- IO.popen([EnvUtil.rubybin, "-e", "putc 0xa1"], "r", external_encoding: "shift_jis", internal_encoding: "euc-jp") {|f|
- assert_equal(Encoding::Shift_JIS, f.external_encoding)
- assert_equal(Encoding::EUC_JP, f.internal_encoding)
- s = f.read
- assert_equal(Encoding::EUC_JP, s.encoding)
- assert_equal("\x8e\xa1".force_encoding("euc-jp"), s)
- }
- end
-
- def test_open_pipe_r_enc
- open("|#{EnvUtil.rubybin} -e 'putc 255'", "r:ascii-8bit") {|f|
- assert_equal(Encoding::ASCII_8BIT, f.external_encoding)
- assert_equal(nil, f.internal_encoding)
- s = f.read
- assert_equal(Encoding::ASCII_8BIT, s.encoding)
- assert_equal("\xff".force_encoding("ascii-8bit"), s)
- }
- end
-
- def test_s_foreach_enc
- with_tmpdir {
- generate_file("t", "\xff")
- IO.foreach("t", :mode => "r:ascii-8bit") {|s|
- assert_equal(Encoding::ASCII_8BIT, s.encoding)
- assert_equal("\xff".force_encoding("ascii-8bit"), s)
- }
- }
- end
-
- def test_s_foreach_enc_in_opt
- with_tmpdir {
- generate_file("t", "\xff")
- IO.foreach("t", :encoding => "ascii-8bit") {|s|
- assert_equal(Encoding::ASCII_8BIT, s.encoding)
- assert_equal("\xff".force_encoding("ascii-8bit"), s)
- }
- }
- end
-
- def test_s_foreach_enc_in_opt2
- with_tmpdir {
- generate_file("t", "\xff")
- IO.foreach("t", :external_encoding => "ascii-8bit") {|s|
- assert_equal(Encoding::ASCII_8BIT, s.encoding)
- assert_equal("\xff".force_encoding("ascii-8bit"), s)
- }
- }
- end
-
- def test_s_foreach_enc_enc
- with_tmpdir {
- generate_file("t", "\u3042")
- IO.foreach("t", :mode => "r:utf-8:euc-jp") {|s|
- assert_equal(Encoding::EUC_JP, s.encoding)
- assert_equal("\xa4\xa2".force_encoding("euc-jp"), s)
- }
- }
- end
-
- def test_s_foreach_enc_enc_in_opt
- with_tmpdir {
- generate_file("t", "\u3042")
- IO.foreach("t", :mode => "r", :encoding => "utf-8:euc-jp") {|s|
- assert_equal(Encoding::EUC_JP, s.encoding)
- assert_equal("\xa4\xa2".force_encoding("euc-jp"), s)
- }
- }
- end
-
- def test_s_foreach_enc_enc_in_opt2
- with_tmpdir {
- generate_file("t", "\u3042")
- IO.foreach("t", :mode => "r", :external_encoding => "utf-8", :internal_encoding => "euc-jp") {|s|
- assert_equal(Encoding::EUC_JP, s.encoding)
- assert_equal("\xa4\xa2".force_encoding("euc-jp"), s)
- }
- }
- end
-
- def test_s_foreach_open_args_enc
- with_tmpdir {
- generate_file("t", "\xff")
- IO.foreach("t", :open_args => ["r:ascii-8bit"]) {|s|
- assert_equal(Encoding::ASCII_8BIT, s.encoding)
- assert_equal("\xff".force_encoding("ascii-8bit"), s)
- }
- }
- end
-
- def test_s_foreach_open_args_enc_in_opt
- with_tmpdir {
- generate_file("t", "\xff")
- IO.foreach("t", :open_args => ["r", encoding: "ascii-8bit"]) {|s|
- assert_equal(Encoding::ASCII_8BIT, s.encoding)
- assert_equal("\xff".force_encoding("ascii-8bit"), s)
- }
- }
- end
-
- def test_s_foreach_open_args_enc_in_opt2
- with_tmpdir {
- generate_file("t", "\xff")
- IO.foreach("t", :open_args => ["r", external_encoding: "ascii-8bit"]) {|s|
- assert_equal(Encoding::ASCII_8BIT, s.encoding)
- assert_equal("\xff".force_encoding("ascii-8bit"), s)
- }
- }
- end
-
- def test_s_foreach_open_args_enc_enc
- with_tmpdir {
- generate_file("t", "\u3042")
- IO.foreach("t", :open_args => ["r:utf-8:euc-jp"]) {|s|
- assert_equal(Encoding::EUC_JP, s.encoding)
- assert_equal("\xa4\xa2".force_encoding("euc-jp"), s)
- }
- }
- end
-
- def test_s_foreach_open_args_enc_enc_in_opt
- with_tmpdir {
- generate_file("t", "\u3042")
- IO.foreach("t", :open_args => ["r", encoding: "utf-8:euc-jp"]) {|s|
- assert_equal(Encoding::EUC_JP, s.encoding)
- assert_equal("\xa4\xa2".force_encoding("euc-jp"), s)
- }
- }
- end
-
- def test_s_foreach_open_args_enc_enc_in_opt2
- with_tmpdir {
- generate_file("t", "\u3042")
- IO.foreach("t", :open_args => ["r", external_encoding: "utf-8", internal_encoding: "euc-jp"]) {|s|
- assert_equal(Encoding::EUC_JP, s.encoding)
- assert_equal("\xa4\xa2".force_encoding("euc-jp"), s)
- }
- }
- end
-
- def test_both_textmode_binmode
- assert_raise(ArgumentError) { open("not-exist", "r", :textmode=>true, :binmode=>true) }
- end
-
- def test_textmode_decode_universal_newline_read
- with_tmpdir {
- generate_file("t.crlf", "a\r\nb\r\nc\r\n")
- assert_equal("a\nb\nc\n", File.read("t.crlf", mode:"rt:euc-jp:utf-8"))
- assert_equal("a\nb\nc\n", File.read("t.crlf", mode:"rt"))
- open("t.crlf", "rt:euc-jp:utf-8") {|f| assert_equal("a\nb\nc\n", f.read) }
- open("t.crlf", "rt") {|f| assert_equal("a\nb\nc\n", f.read) }
- open("t.crlf", "r", :textmode=>true) {|f| assert_equal("a\nb\nc\n", f.read) }
-
- generate_file("t.cr", "a\rb\rc\r")
- assert_equal("a\nb\nc\n", File.read("t.cr", mode:"rt:euc-jp:utf-8"))
- assert_equal("a\nb\nc\n", File.read("t.cr", mode:"rt"))
-
- generate_file("t.lf", "a\nb\nc\n")
- assert_equal("a\nb\nc\n", File.read("t.cr", mode:"rt:euc-jp:utf-8"))
- assert_equal("a\nb\nc\n", File.read("t.cr", mode:"rt"))
- }
- end
-
- def test_textmode_decode_universal_newline_getc
- with_tmpdir {
- generate_file("t.crlf", "a\r\nb\r\nc\r\n")
- open("t.crlf", "rt") {|f|
- assert_equal("a", f.getc)
- assert_equal("\n", f.getc)
- assert_equal("b", f.getc)
- assert_equal("\n", f.getc)
- assert_equal("c", f.getc)
- assert_equal("\n", f.getc)
- assert_equal(nil, f.getc)
- }
-
- generate_file("t.cr", "a\rb\rc\r")
- open("t.cr", "rt") {|f|
- assert_equal("a", f.getc)
- assert_equal("\n", f.getc)
- assert_equal("b", f.getc)
- assert_equal("\n", f.getc)
- assert_equal("c", f.getc)
- assert_equal("\n", f.getc)
- assert_equal(nil, f.getc)
- }
-
- generate_file("t.lf", "a\nb\nc\n")
- open("t.lf", "rt") {|f|
- assert_equal("a", f.getc)
- assert_equal("\n", f.getc)
- assert_equal("b", f.getc)
- assert_equal("\n", f.getc)
- assert_equal("c", f.getc)
- assert_equal("\n", f.getc)
- assert_equal(nil, f.getc)
- }
- }
- end
-
- def test_textmode_decode_universal_newline_gets
- with_tmpdir {
- generate_file("t.crlf", "a\r\nb\r\nc\r\n")
- open("t.crlf", "rt") {|f|
- assert_equal("a\n", f.gets)
- assert_equal("b\n", f.gets)
- assert_equal("c\n", f.gets)
- assert_equal(nil, f.gets)
- }
-
- generate_file("t.cr", "a\rb\rc\r")
- open("t.cr", "rt") {|f|
- assert_equal("a\n", f.gets)
- assert_equal("b\n", f.gets)
- assert_equal("c\n", f.gets)
- assert_equal(nil, f.gets)
- }
-
- generate_file("t.lf", "a\nb\nc\n")
- open("t.lf", "rt") {|f|
- assert_equal("a\n", f.gets)
- assert_equal("b\n", f.gets)
- assert_equal("c\n", f.gets)
- assert_equal(nil, f.gets)
- }
- }
- end
-
- def test_textmode_decode_universal_newline_utf16
- with_tmpdir {
- generate_file("t.utf16be.crlf", "\0a\0\r\0\n\0b\0\r\0\n\0c\0\r\0\n")
- assert_equal("a\nb\nc\n", File.read("t.utf16be.crlf", mode:"rt:utf-16be:utf-8"))
-
- generate_file("t.utf16le.crlf", "a\0\r\0\n\0b\0\r\0\n\0c\0\r\0\n\0")
- assert_equal("a\nb\nc\n", File.read("t.utf16le.crlf", mode:"rt:utf-16le:utf-8"))
-
- generate_file("t.utf16be.cr", "\0a\0\r\0b\0\r\0c\0\r")
- assert_equal("a\nb\nc\n", File.read("t.utf16be.cr", mode:"rt:utf-16be:utf-8"))
-
- generate_file("t.utf16le.cr", "a\0\r\0b\0\r\0c\0\r\0")
- assert_equal("a\nb\nc\n", File.read("t.utf16le.cr", mode:"rt:utf-16le:utf-8"))
-
- generate_file("t.utf16be.lf", "\0a\0\n\0b\0\n\0c\0\n")
- assert_equal("a\nb\nc\n", File.read("t.utf16be.lf", mode:"rt:utf-16be:utf-8"))
-
- generate_file("t.utf16le.lf", "a\0\n\0b\0\n\0c\0\n\0")
- assert_equal("a\nb\nc\n", File.read("t.utf16le.lf", mode:"rt:utf-16le:utf-8"))
- }
- end
-
- SYSTEM_NEWLINE = []
- def system_newline
- return SYSTEM_NEWLINE.first if !SYSTEM_NEWLINE.empty?
- with_tmpdir {
- open("newline", "wt") {|f|
- f.print "\n"
- }
- open("newline", "rb") {|f|
- SYSTEM_NEWLINE << f.read
- }
- }
- SYSTEM_NEWLINE.first
- end
-
- def test_textmode_encode_newline
- with_tmpdir {
- open("t.txt", "wt") {|f|
- f.puts "abc"
- f.puts "def"
- }
- content = File.read("t.txt", :mode=>"rb")
- nl = system_newline
- assert_equal("abc#{nl}def#{nl}", content)
- }
- end
-
- def test_textmode_encode_newline_enc
- with_tmpdir {
- open("t.txt", "wt:euc-jp") {|f|
- f.puts "abc\u3042"
- f.puts "def\u3044"
- }
- content = File.read("t.txt", :mode=>"rb:ascii-8bit")
- nl = system_newline
- assert_equal("abc\xA4\xA2#{nl}def\xA4\xA4#{nl}", content)
- }
- end
-
- def test_read_newline_conversion_with_encoding_conversion
- with_tmpdir {
- generate_file("t.utf8.crlf", "a\r\nb\r\n")
- open("t.utf8.crlf", "rb:utf-8:utf-16be") {|f|
- content = f.read
- assert_equal("\0a\0\r\0\n\0b\0\r\0\n".force_encoding("UTF-16BE"), content)
- }
- open("t.utf8.crlf", "rt:utf-8:utf-16be") {|f|
- content = f.read
- assert_equal("\0a\0\n\0b\0\n".force_encoding("UTF-16BE"), content)
- }
- open("t.utf8.crlf", "r:utf-8:utf-16be") {|f|
- content = f.read
- if system_newline == "\n"
- assert_equal("\0a\0\r\0\n\0b\0\r\0\n".force_encoding("UTF-16BE"), content)
- else
- assert_equal("\0a\0\n\0b\0\n".force_encoding("UTF-16BE"), content)
- end
- }
- }
- end
-
- def test_read_newline_conversion_without_encoding_conversion
- with_tmpdir {
- generate_file("t.utf16.crlf", "\0a\0\r\0\n\0b\0\r\0\n")
- open("t.utf16.crlf", "rb:utf-16be") {|f|
- content = f.read
- assert_equal("\0a\0\r\0\n\0b\0\r\0\n".force_encoding("UTF-16BE"),
- content)
- }
- }
- end
-
- def test_read_newline_conversion_error
- with_tmpdir {
- generate_file("empty.txt", "")
- # ascii incompatible encoding without conversion needs binmode.
- assert_raise(ArgumentError) {
- open("empty.txt", "rt:utf-16be") {|f| }
- }
- assert_raise(ArgumentError) {
- open("empty.txt", "r:utf-16be") {|f| }
- }
- }
- end
-
- def test_read_mode
- with_tmpdir {
- generate_file("t", "a\rb\r\nc\n\xc2\xa2")
- generate_file("ie", "a\rb\r\nc\n\e$B\x42\x22\e(B")
- generate_file("iu", "a\rb\r\nc\n\e$B\x21\x71\e(B")
- generate_file("be", "\0a\0\r\0b\0\r\0\n\0c\0\n\x85\x35")
- generate_file("bu", "\0a\0\r\0b\0\r\0\n\0c\0\n\0\xa2")
- # "\xc2\xa2" is valid as EUC-JP and UTF-8
- # EUC-JP UTF-8 Unicode
- # 0xC2A2 0xE894B5 U+8535
- # 0xA1F1 0xC2A2 U+00A2
-
- open("t","rt") {|f| assert_equal("a\nb\nc\n\xc2\xa2".force_encoding(Encoding.default_external), f.read) }
- open("t","rb") {|f| assert_equal("a\rb\r\nc\n\xc2\xa2".force_encoding(Encoding::ASCII_8BIT), f.read) }
-
- open("t","rt:euc-jp") {|f| assert_equal("a\nb\nc\n\xc2\xa2".force_encoding("EUC-JP"), f.read) }
- open("t","rb:euc-jp") {|f| assert_equal("a\rb\r\nc\n\xc2\xa2".force_encoding("EUC-JP"), f.read) }
- open("t","rt:utf-8") {|f| assert_equal("a\nb\nc\n\xc2\xa2".force_encoding("UTF-8"), f.read) }
- open("t","rb:utf-8") {|f| assert_equal("a\rb\r\nc\n\xc2\xa2".force_encoding("UTF-8"), f.read) }
- assert_raise(ArgumentError) { open("t", "rt:iso-2022-jp") {|f| } }
- open("t","rb:iso-2022-jp") {|f| assert_equal("a\rb\r\nc\n\xc2\xa2".force_encoding("ISO-2022-JP"), f.read) }
-
- open("t","rt:euc-jp:utf-8") {|f| assert_equal("a\nb\nc\n\u8535", f.read) }
- open("t","rt:utf-8:euc-jp") {|f| assert_equal("a\nb\nc\n\xa1\xf1".force_encoding("EUC-JP"), f.read) }
- open("t","rb:euc-jp:utf-8") {|f| assert_equal("a\rb\r\nc\n\u8535", f.read) }
- open("t","rb:utf-8:euc-jp") {|f| assert_equal("a\rb\r\nc\n\xa1\xf1".force_encoding("EUC-JP"), f.read) }
-
- open("t","rt:euc-jp:iso-2022-jp"){|f| assert_equal("a\nb\nc\n\e$B\x42\x22\e(B".force_encoding("ISO-2022-JP"), f.read) }
- open("t","rt:utf-8:iso-2022-jp"){|f| assert_equal("a\nb\nc\n\e$B\x21\x71\e(B".force_encoding("ISO-2022-JP"), f.read) }
- open("t","rt:euc-jp:utf-16be"){|f| assert_equal("\0a\0\n\0b\0\n\0c\0\n\x85\x35".force_encoding("UTF-16BE"), f.read) }
- open("t","rt:utf-8:utf-16be"){|f| assert_equal("\0a\0\n\0b\0\n\0c\0\n\0\xa2".force_encoding("UTF-16BE"), f.read) }
- open("t","rb:euc-jp:iso-2022-jp"){|f|assert_equal("a\rb\r\nc\n\e$B\x42\x22\e(B".force_encoding("ISO-2022-JP"),f.read)}
- open("t","rb:utf-8:iso-2022-jp"){|f|assert_equal("a\rb\r\nc\n\e$B\x21\x71\e(B".force_encoding("ISO-2022-JP"),f.read)}
- open("t","rb:euc-jp:utf-16be"){|f|assert_equal("\0a\0\r\0b\0\r\0\n\0c\0\n\x85\x35".force_encoding("UTF-16BE"),f.read)}
- open("t","rb:utf-8:utf-16be"){|f|assert_equal("\0a\0\r\0b\0\r\0\n\0c\0\n\0\xa2".force_encoding("UTF-16BE"),f.read)}
-
- open("ie","rt:iso-2022-jp:euc-jp"){|f| assert_equal("a\nb\nc\n\xc2\xa2".force_encoding("EUC-JP"), f.read) }
- open("iu","rt:iso-2022-jp:utf-8"){|f| assert_equal("a\nb\nc\n\xc2\xa2".force_encoding("UTF-8"), f.read) }
- open("be","rt:utf-16be:euc-jp"){|f| assert_equal("a\nb\nc\n\xc2\xa2".force_encoding("EUC-JP"), f.read) }
- open("bu","rt:utf-16be:utf-8"){|f| assert_equal("a\nb\nc\n\xc2\xa2".force_encoding("UTF-8"), f.read) }
- open("ie","rb:iso-2022-jp:euc-jp"){|f|assert_equal("a\rb\r\nc\n\xc2\xa2".force_encoding("EUC-JP"),f.read)}
- open("iu","rb:iso-2022-jp:utf-8"){|f|assert_equal("a\rb\r\nc\n\xc2\xa2".force_encoding("UTF-8"),f.read)}
- open("be","rb:utf-16be:euc-jp"){|f|assert_equal("a\rb\r\nc\n\xc2\xa2".force_encoding("EUC-JP"),f.read)}
- open("bu","rb:utf-16be:utf-8"){|f|assert_equal("a\rb\r\nc\n\xc2\xa2".force_encoding("UTF-8"),f.read)}
-
- open("ie","rt:iso-2022-jp:utf-16be"){|f|assert_equal("\0a\0\n\0b\0\n\0c\0\n\x85\x35".force_encoding("UTF-16BE"),f.read)}
- open("be","rt:utf-16be:iso-2022-jp"){|f|assert_equal("a\nb\nc\n\e$B\x42\x22\e(B".force_encoding("ISO-2022-JP"),f.read)}
- open("ie","rb:iso-2022-jp:utf-16be"){|f|assert_equal("\0a\0\r\0b\0\r\0\n\0c\0\n\x85\x35".force_encoding("UTF-16BE"),f.read)}
- open("be","rb:utf-16be:iso-2022-jp"){|f|assert_equal("a\rb\r\nc\n\e$B\x42\x22\e(B".force_encoding("ISO-2022-JP"),f.read)}
- }
- end
-
- def assert_write(expected, mode, *args)
- with_tmpdir {
- open("t", mode) {|f|
- args.each {|arg| f.print arg }
- }
- content = File.read("t", :mode=>"rb:ascii-8bit")
- assert_equal(expected.dup.force_encoding("ascii-8bit"),
- content.force_encoding("ascii-8bit"))
- }
- end
-
- def test_write_mode
- # "\xc2\xa2" is valid as EUC-JP and UTF-8
- # EUC-JP UTF-8 Unicode
- # 0xC2A2 0xE894B5 U+8535
- # 0xA1F1 0xC2A2 U+00A2
- a = "a\rb\r\nc\n"
- e = "\xc2\xa2".force_encoding("euc-jp")
- u8 = "\xc2\xa2".force_encoding("utf-8")
- u16 = "\x85\x35\0\r\x00\xa2\0\r\0\n\0\n".force_encoding("utf-16be")
- i = "\e$B\x42\x22\e(B\r\e$B\x21\x71\e(B\r\n\n".force_encoding("iso-2022-jp")
- n = system_newline
- un = n.encode("utf-16be").force_encoding("ascii-8bit")
-
- assert_write("a\rb\r#{n}c#{n}", "wt", a)
- assert_write("\xc2\xa2", "wt", e)
- assert_write("\xc2\xa2", "wt", u8)
-
- assert_write("a\rb\r\nc\n", "wb", a)
- assert_write("\xc2\xa2", "wb", e)
- assert_write("\xc2\xa2", "wb", u8)
-
- #assert_write("\x85\x35\0\r\x00\xa2\0\r\0\n\0\n", "wt", u16) should raise
- #assert_write("\e$B\x42\x22\e(B\r\e$B\x21\x71\e(B\r\n\n", "wt", i) should raise
- assert_write("\x85\x35\0\r\x00\xa2\0\r\0\n\0\n", "wb", u16)
- assert_write("\e$B\x42\x22\e(B\r\e$B\x21\x71\e(B\r\n\n", "wb", i)
-
- t_write_mode_enc
- t_write_mode_enc(":utf-8")
- end
-
- def t_write_mode_enc(enc="")
- # "\xc2\xa2" is valid as EUC-JP and UTF-8
- # EUC-JP UTF-8 Unicode
- # 0xC2A2 0xE894B5 U+8535
- # 0xA1F1 0xC2A2 U+00A2
- a = "a\rb\r\nc\n"
- e = "\xc2\xa2".force_encoding("euc-jp")
- u8 = "\xc2\xa2".force_encoding("utf-8")
- u16 = "\x85\x35\0\r\x00\xa2\0\r\0\n\0\n".force_encoding("utf-16be")
- i = "\e$B\x42\x22\e(B\r\e$B\x21\x71\e(B\r\n\n".force_encoding("iso-2022-jp")
- n = system_newline
- un = n.encode("utf-16be").force_encoding("ascii-8bit")
-
- assert_write("a\rb\r#{n}c#{n}", "wt:euc-jp#{enc}", a)
- assert_write("\xc2\xa2", "wt:euc-jp#{enc}", e)
- assert_write("\xa1\xf1", "wt:euc-jp#{enc}", u8)
-
- assert_write("a\rb\r\nc\n", "wb:euc-jp#{enc}", a)
- assert_write("\xc2\xa2", "wb:euc-jp#{enc}", e)
- assert_write("\xa1\xf1", "wb:euc-jp#{enc}", u8)
-
- assert_write("\xc2\xa2\r\xa1\xf1\r#{n}#{n}", "wt:euc-jp#{enc}", u16)
- assert_write("\xc2\xa2\r\xa1\xf1\r#{n}#{n}", "wt:euc-jp#{enc}", i)
- assert_write("\xc2\xa2\r\xa1\xf1\r\n\n", "wb:euc-jp#{enc}", u16)
- assert_write("\xc2\xa2\r\xa1\xf1\r\n\n", "wb:euc-jp#{enc}", i)
-
- assert_write("\0a\0\r\0b\0\r#{un}\0c#{un}", "wt:utf-16be#{enc}", a)
- assert_write("\x85\x35", "wt:utf-16be#{enc}", e)
- assert_write("\x00\xa2", "wt:utf-16be#{enc}", u8)
- assert_write("a\rb\r#{n}c#{n}", "wt:iso-2022-jp#{enc}", a)
- assert_write("\e$B\x42\x22\e(B", "wt:iso-2022-jp#{enc}", e)
- assert_write("\e$B\x21\x71\e(B", "wt:iso-2022-jp#{enc}", u8)
-
- assert_write("\0a\0\r\0b\0\r\0\n\0c\0\n", "wb:utf-16be#{enc}", a)
- assert_write("\x85\x35", "wb:utf-16be#{enc}", e)
- assert_write("\x00\xa2", "wb:utf-16be#{enc}", u8)
- assert_write("a\rb\r\nc\n", "wb:iso-2022-jp#{enc}", a)
- assert_write("\e$B\x42\x22\e(B", "wb:iso-2022-jp#{enc}", e)
- assert_write("\e$B\x21\x71\e(B", "wb:iso-2022-jp#{enc}", u8)
-
- assert_write("\x85\x35\0\r\x00\xa2\0\r#{un}#{un}", "wt:utf-16be#{enc}", u16)
- assert_write("\x85\x35\0\r\x00\xa2\0\r#{un}#{un}", "wt:utf-16be#{enc}", i)
- assert_write("\x85\x35\0\r\x00\xa2\0\r\0\n\0\n", "wb:utf-16be#{enc}", u16)
- assert_write("\x85\x35\0\r\x00\xa2\0\r\0\n\0\n", "wb:utf-16be#{enc}", i)
- assert_write("\e$B\x42\x22\e(B\r\e$B\x21\x71\e(B\r#{n}#{n}", "wt:iso-2022-jp#{enc}", u16)
- assert_write("\e$B\x42\x22\e(B\r\e$B\x21\x71\e(B\r#{n}#{n}", "wt:iso-2022-jp#{enc}", i)
- assert_write("\e$B\x42\x22\e(B\r\e$B\x21\x71\e(B\r\n\n", "wb:iso-2022-jp#{enc}", u16)
- assert_write("\e$B\x42\x22\e(B\r\e$B\x21\x71\e(B\r\n\n", "wb:iso-2022-jp#{enc}", i)
- end
-
- def test_write_mode_fail
- return if system_newline == "\n"
- with_tmpdir {
- open("t", "wt") {|f|
- assert_raise(ArgumentError) { f.print "\0\r\0\r\0\n\0\n".force_encoding("utf-16be") }
- }
- }
- end
-
- def test_write_ascii_incompat
- with_tmpdir {
- open("t.utf8", "wb:utf-8:utf-16be") {|f| }
- open("t.utf8", "wt:utf-8:utf-16be") {|f| }
- open("t.utf8", "w:utf-8:utf-16be") {|f| }
- open("t.utf16", "wb:utf-16be") {|f| }
- open("t.utf16", "wt:utf-16be") {|f| }
- open("t.utf16", "w:utf-16be") {|f| }
- }
- end
-
- def test_binmode_write_ascii_incompat_internal
- with_tmpdir {
- open("t.utf8.lf", "wb:utf-8:utf-16be") {|f|
- f.print "\0a\0\n\0b\0\n".force_encoding("UTF-16BE")
- }
- content = File.read("t.utf8.lf", :mode=>"rb:ascii-8bit")
- assert_equal("a\nb\n", content)
-
- open("t.utf8.lf", "wb:utf-16be") {|f|
- f.print "\0a\0\n\0b\0\n".force_encoding("UTF-16BE")
- }
- content = File.read("t.utf8.lf", :mode=>"rb:ascii-8bit")
- assert_equal("\0a\0\n\0b\0\n", content)
- }
- end
-
- def test_binary
- with_tmpdir {
- src = "a\nb\rc\r\nd\n"
- generate_file("t.txt", src)
- open("t.txt", "rb") {|f|
- assert_equal(src, f.read)
- }
- open("t.txt", "r", :binmode=>true) {|f|
- assert_equal(src, f.read)
- }
- if system_newline == "\n"
- open("t.txt", "r") {|f|
- assert_equal(src, f.read)
- }
- end
- }
- end
-
- def test_binmode
- with_tmpdir {
- src = "a\r\nb\r\nc\r\n"
- generate_file("t.txt", src)
- open("t.txt", "rt") {|f|
- assert_equal("a", f.getc)
- assert_equal("\n", f.getc)
- f.binmode
- assert_equal("\n", f.getc)
- assert_equal("b", f.getc)
- assert_equal("\r", f.getc)
- assert_equal("\n", f.getc)
- assert_equal("c", f.getc)
- assert_equal("\r", f.getc)
- assert_equal("\n", f.getc)
- assert_equal(nil, f.getc)
- }
- }
- end
-
- def test_binmode2
- with_tmpdir {
- src = "a\r\nb\r\nc\r\n"
- generate_file("t.txt", src)
- open("t.txt", "rt:euc-jp:utf-8") {|f|
- assert_equal("a", f.getc)
- assert_equal("\n", f.getc)
- f.binmode
- assert_equal("\n", f.getc)
- assert_equal("b", f.getc)
- assert_equal("\r", f.getc)
- assert_equal("\n", f.getc)
- assert_equal("c", f.getc)
- assert_equal("\r", f.getc)
- assert_equal("\n", f.getc)
- assert_equal(nil, f.getc)
- }
- }
- end
-
- def test_binmode3
- with_tmpdir {
- src = "\u3042\r\n"
- generate_file("t.txt", src)
- srcbin = src.dup.force_encoding("ascii-8bit")
- open("t.txt", "rt:utf-8:euc-jp") {|f|
- f.binmode
- result = f.read
- assert_str_equal(srcbin, result)
- assert_equal(Encoding::ASCII_8BIT, result.encoding)
- }
- }
- end
-
- def test_invalid_r
- with_tmpdir {
- generate_file("t.txt", "a\x80b")
- open("t.txt", "r:utf-8:euc-jp", :invalid => :replace) {|f|
- assert_equal("a?b", f.read)
- }
- open("t.txt", "r:utf-8:euc-jp", :invalid => :replace, :replace => "") {|f|
- assert_equal("ab", f.read)
- }
- open("t.txt", "r:utf-8:euc-jp", :undef => :replace) {|f|
- assert_raise(Encoding::InvalidByteSequenceError) { f.read }
- assert_equal("b", f.read)
- }
- open("t.txt", "r:utf-8:euc-jp", :undef => :replace, :replace => "") {|f|
- assert_raise(Encoding::InvalidByteSequenceError) { f.read }
- assert_equal("b", f.read)
- }
- }
- end
-
- def test_undef_r
- with_tmpdir {
- generate_file("t.txt", "a\uFFFDb")
- open("t.txt", "r:utf-8:euc-jp", :undef => :replace) {|f|
- assert_equal("a?b", f.read)
- }
- open("t.txt", "r:utf-8:euc-jp", :undef => :replace, :replace => "") {|f|
- assert_equal("ab", f.read)
- }
- open("t.txt", "r:utf-8:euc-jp", :invalid => :replace) {|f|
- assert_raise(Encoding::UndefinedConversionError) { f.read }
- assert_equal("b", f.read)
- }
- open("t.txt", "r:utf-8:euc-jp", :invalid => :replace, :replace => "") {|f|
- assert_raise(Encoding::UndefinedConversionError) { f.read }
- assert_equal("b", f.read)
- }
- }
- end
-
- def test_invalid_w
- with_tmpdir {
- invalid_utf8 = "a\x80b".force_encoding("utf-8")
- open("t.txt", "w:euc-jp", :invalid => :replace) {|f|
- assert_nothing_raised { f.write invalid_utf8 }
- }
- assert_equal("a?b", File.read("t.txt"))
-
- open("t.txt", "w:euc-jp", :invalid => :replace, :replace => "") {|f|
- assert_nothing_raised { f.write invalid_utf8 }
- }
- assert_equal("ab", File.read("t.txt"))
-
- open("t.txt", "w:euc-jp", :undef => :replace) {|f|
- assert_raise(Encoding::InvalidByteSequenceError) { f.write invalid_utf8 }
- }
- open("t.txt", "w:euc-jp", :undef => :replace, :replace => "") {|f|
- assert_raise(Encoding::InvalidByteSequenceError) { f.write invalid_utf8 }
- }
- }
- end
-
- def test_undef_w_stateless
- with_tmpdir {
- generate_file("t.txt", "a\uFFFDb")
- open("t.txt", "w:euc-jp:utf-8", :undef => :replace) {|f|
- assert_nothing_raised { f.write "a\uFFFDb" }
- }
- assert_equal("a?b", File.read("t.txt"))
- open("t.txt", "w:euc-jp:utf-8", :undef => :replace, :replace => "") {|f|
- assert_nothing_raised { f.write "a\uFFFDb" }
- }
- assert_equal("ab", File.read("t.txt"))
- open("t.txt", "w:euc-jp:utf-8", :invalid => :replace) {|f|
- assert_raise(Encoding::UndefinedConversionError) { f.write "a\uFFFDb" }
- }
- open("t.txt", "w:euc-jp:utf-8", :invalid => :replace, :replace => "") {|f|
- assert_raise(Encoding::UndefinedConversionError) { f.write "a\uFFFDb" }
- }
- }
- end
-
- def test_undef_w_stateful
- with_tmpdir {
- generate_file("t.txt", "a\uFFFDb")
- open("t.txt", "w:iso-2022-jp:utf-8", :undef => :replace) {|f|
- assert_nothing_raised { f.write "a\uFFFDb" }
- }
- assert_equal("a?b", File.read("t.txt"))
- open("t.txt", "w:iso-2022-jp:utf-8", :undef => :replace, :replace => "") {|f|
- assert_nothing_raised { f.write "a\uFFFDb" }
- }
- assert_equal("ab", File.read("t.txt"))
- open("t.txt", "w:iso-2022-jp:utf-8", :invalid => :replace) {|f|
- assert_raise(Encoding::UndefinedConversionError) { f.write "a\uFFFDb" }
- }
- open("t.txt", "w:iso-2022-jp:utf-8", :invalid => :replace, :replace => "") {|f|
- assert_raise(Encoding::UndefinedConversionError) { f.write "a\uFFFDb" }
- }
- }
- end
-
- def test_w_xml_attr
- with_tmpdir {
- open("raw.txt", "wb", xml: :attr) {|f| f.print '&<>"\''; f.puts "\u4E02\u3042" }
- content = File.read("raw.txt", :mode=>"rb:ascii-8bit")
- assert_equal("\"&amp;&lt;&gt;&quot;'\u4E02\u3042\n\"".force_encoding("ascii-8bit"), content)
-
- open("ascii.txt", "wb:us-ascii", xml: :attr) {|f| f.print '&<>"\''; f.puts "\u4E02\u3042" }
- content = File.read("ascii.txt", :mode=>"rb:ascii-8bit")
- assert_equal("\"&amp;&lt;&gt;&quot;'&#x4E02;&#x3042;\n\"".force_encoding("ascii-8bit"), content)
-
- open("iso-2022-jp.txt", "wb:iso-2022-jp", xml: :attr) {|f| f.print '&<>"\''; f.puts "\u4E02\u3042" }
- content = File.read("iso-2022-jp.txt", :mode=>"rb:ascii-8bit")
- assert_equal("\"&amp;&lt;&gt;&quot;'&#x4E02;\e$B$\"\e(B\n\"".force_encoding("ascii-8bit"), content)
-
- open("utf-16be.txt", "wb:utf-16be", xml: :attr) {|f| f.print '&<>"\''; f.puts "\u4E02\u3042" }
- content = File.read("utf-16be.txt", :mode=>"rb:ascii-8bit")
- assert_equal("\0\"\0&\0a\0m\0p\0;\0&\0l\0t\0;\0&\0g\0t\0;\0&\0q\0u\0o\0t\0;\0'\x4E\x02\x30\x42\0\n\0\"".force_encoding("ascii-8bit"), content)
-
- open("eucjp.txt", "w:euc-jp:utf-8", xml: :attr) {|f|
- f.print "\u4E02" # U+4E02 is 0x3021 in JIS X 0212
- }
- content = File.read("eucjp.txt", :mode=>"rb:ascii-8bit")
- assert_equal("\"\x8F\xB0\xA1\"".force_encoding("ascii-8bit"), content)
-
- open("sjis.txt", "w:sjis:utf-8", xml: :attr) {|f|
- f.print "\u4E02" # U+4E02 is 0x3021 in JIS X 0212
- }
- content = File.read("sjis.txt", :mode=>"rb:ascii-8bit")
- assert_equal("\"&#x4E02;\"".force_encoding("ascii-8bit"), content)
-
- open("iso-2022-jp.txt", "w:iso-2022-jp:utf-8", xml: :attr) {|f|
- f.print "\u4E02" # U+4E02 is 0x3021 in JIS X 0212
- }
- content = File.read("iso-2022-jp.txt", :mode=>"rb:ascii-8bit")
- assert_equal("\"&#x4E02;\"".force_encoding("ascii-8bit"), content)
- }
- end
-
- def test_strip_bom
- with_tmpdir {
- text = "\uFEFFa"
- %w/UTF-8 UTF-16BE UTF-16LE UTF-32BE UTF-32LE/.each do |name|
- path = '%s-bom.txt' % name
- content = text.encode(name)
- generate_file(path, content)
- result = File.read(path, mode: 'rb:utf-7-bom')
- assert_equal(content[1].force_encoding("ascii-8bit"),
- result.force_encoding("ascii-8bit"))
- end
- }
- end
-end
-
diff --git a/test/ruby/test_iterator.rb b/test/ruby/test_iterator.rb
index ca6022a4fb..2cd48b29a4 100644
--- a/test/ruby/test_iterator.rb
+++ b/test/ruby/test_iterator.rb
@@ -52,9 +52,9 @@ class TestIterator < Test::Unit::TestCase
def test_nested_iterator
i = 0
tt{|i| break if i == 5}
- assert_equal(0, i)
+ assert_equal(5, i)
- assert_raise(ArgumentError) do
+ assert_raises(ArgumentError) do
tt3{}
end
end
@@ -64,12 +64,12 @@ class TestIterator < Test::Unit::TestCase
end
def test_block_argument_without_paren
- assert_raise(ArgumentError) do
+ assert_raises(ArgumentError) do
tt4{}
end
end
- # iterator break/redo/next
+ # iterator break/redo/next/retry
def test_break
done = true
loop{
@@ -104,6 +104,18 @@ class TestIterator < Test::Unit::TestCase
end
assert_equal(7, $x.size)
assert_equal([1, 2, 3, 4, 5, 6, 7], $x)
+
+ $done = false
+ $x = []
+ for i in 1 .. 7 # see how retry works in iterator loop
+ if i == 4 and not $done
+ $done = true
+ retry
+ end
+ $x.push(i)
+ end
+ assert_equal(10, $x.size)
+ assert_equal([1, 2, 3, 1, 2, 3, 4, 5, 6, 7], $x)
end
def test_append_method_to_built_in_class
@@ -137,9 +149,11 @@ class TestIterator < Test::Unit::TestCase
IterTest.new([0]).each0 {|x| assert_equal(0, x)}
IterTest.new([1]).each1 {|x| assert_equal(1, x)}
IterTest.new([2]).each2 {|x| assert_equal([2], x)}
+ IterTest.new([3]).each3 {|x| assert_equal(3, x)}
IterTest.new([4]).each4 {|x| assert_equal(4, x)}
IterTest.new([5]).each5 {|x| assert_equal(5, x)}
IterTest.new([6]).each6 {|x| assert_equal([6], x)}
+ IterTest.new([7]).each7 {|x| assert_equal(7, x)}
IterTest.new([8]).each8 {|x| assert_equal(8, x)}
IterTest.new([[0]]).each0 {|x| assert_equal([0], x)}
@@ -152,8 +166,8 @@ class TestIterator < Test::Unit::TestCase
IterTest.new([[7]]).each7 {|x| assert_equal(7, x)}
IterTest.new([[8]]).each8 {|x| assert_equal([8], x)}
- IterTest.new([[0,0]]).each0 {|*x| assert_equal([[0,0]], x)}
- IterTest.new([[8,8]]).each8 {|*x| assert_equal([[8,8]], x)}
+ IterTest.new([[0,0]]).each0 {|x| assert_equal([0,0], x)}
+ IterTest.new([[8,8]]).each8 {|x| assert_equal([8,8], x)}
end
def m(var)
@@ -216,10 +230,10 @@ class TestIterator < Test::Unit::TestCase
def test_argument
assert_nothing_raised {lambda{||}.call}
- assert_raise(ArgumentError) {lambda{||}.call(1)}
+ assert_raises(ArgumentError) {lambda{||}.call(1)}
assert_nothing_raised {lambda{|a,|}.call(1)}
- assert_raise(ArgumentError) {lambda{|a,|}.call()}
- assert_raise(ArgumentError) {lambda{|a,|}.call(1,2)}
+ assert_raises(ArgumentError) {lambda{|a,|}.call()}
+ assert_raises(ArgumentError) {lambda{|a,|}.call(1,2)}
end
def get_block(&block)
@@ -235,9 +249,9 @@ class TestIterator < Test::Unit::TestCase
assert_nothing_raised {get_block{|a,|}.call(1,2)}
assert_nothing_raised {get_block(&lambda{||}).call()}
- assert_raise(ArgumentError) {get_block(&lambda{||}).call(1)}
+ assert_raises(ArgumentError) {get_block(&lambda{||}).call(1)}
assert_nothing_raised {get_block(&lambda{|a,|}).call(1)}
- assert_raise(ArgumentError) {get_block(&lambda{|a,|}).call(1,2)}
+ assert_raises(ArgumentError) {get_block(&lambda{|a,|}).call(1,2)}
block = get_block{11}
assert_instance_of(Proc, block)
@@ -245,11 +259,11 @@ class TestIterator < Test::Unit::TestCase
assert_equal(block.clone.call, 11)
assert_instance_of(Proc, get_block(&block))
- lmd = lambda{44}
- assert_instance_of(Proc, lmd)
- assert_instance_of(Proc, lmd.to_proc)
- assert_equal(lmd.clone.call, 44)
- assert_instance_of(Proc, get_block(&lmd))
+ lambda = lambda{44}
+ assert_instance_of(Proc, lambda)
+ assert_instance_of(Proc, lambda.to_proc)
+ assert_equal(lambda.clone.call, 44)
+ assert_instance_of(Proc, get_block(&lambda))
assert_equal(1, Proc.new{|a,| a}.call(1,2,3))
assert_nothing_raised {Proc.new{|a,|}.call(1,2)}
@@ -298,21 +312,14 @@ class TestIterator < Test::Unit::TestCase
end
def test_ljump
- assert_raise(LocalJumpError) {get_block{break}.call}
-
- # cannot use assert_nothing_raised due to passing block.
- begin
- val = lambda{break 11}.call
- rescue LocalJumpError
- assert(false, "LocalJumpError occurred from break in lambda")
- else
- assert(11, val)
- end
-
block = get_block{11}
- lmd = lambda{44}
- assert_equal(0, block.arity)
- assert_equal(0, lmd.arity)
+ lambda = lambda{44}
+ assert_raises(LocalJumpError) {get_block{break}.call}
+ assert_nothing_raised {lambda{break}.call}
+ assert_instance_of(LocalJumpError, (get_block{break}.call rescue $!))
+
+ assert_equal(-1, block.arity)
+ assert_equal(-1, lambda.arity)
assert_equal(0, lambda{||}.arity)
assert_equal(1, lambda{|a|}.arity)
assert_equal(1, lambda{|a,|}.arity)
@@ -320,8 +327,8 @@ class TestIterator < Test::Unit::TestCase
end
def marity_test(m)
- mobj = method(m)
- assert_equal(mobj.arity, mobj.to_proc.arity)
+ method = method(m)
+ assert_equal(method.arity, method.to_proc.arity)
end
def test_marity
@@ -334,10 +341,10 @@ class TestIterator < Test::Unit::TestCase
end
def foo
- yield(:key, :value)
+ yield([:key, :value])
end
def bar(&blk)
- blk.call(:key, :value)
+ blk.call([:key, :value])
end
def test_yield_vs_call
@@ -349,19 +356,13 @@ class TestIterator < Test::Unit::TestCase
def each
yield [:key, :value]
end
- alias each_pair each
end
def test_assoc_yield
- [{:key=>:value}, H.new].each {|h|
- h.each{|a| assert_equal([:key, :value], a)}
- h.each{|a,| assert_equal(:key, a)}
- h.each{|*a| assert_equal([[:key, :value]], a)}
- h.each{|k,v| assert_equal([:key, :value], [k,v])}
- h.each_pair{|a| assert_equal([:key, :value], a)}
- h.each_pair{|a,| assert_equal(:key, a)}
- h.each_pair{|*a| assert_equal([[:key, :value]], a)}
- h.each_pair{|k,v| assert_equal([:key, :value], [k,v])}
+ [{:key=>:value}, H.new].each {|h|
+ h.each{|a| assert_equal([:key, :value], a)}
+ h.each{|*a| assert_equal([[:key, :value]], a)}
+ h.each{|k,v| assert_equal([:key, :value], [k,v])}
}
end
@@ -473,25 +474,4 @@ class TestIterator < Test::Unit::TestCase
def test_block_given_within_iterator
assert_equal(["b"], ["a", "b", "c"].grep(IterString.new("b")) {|s| s})
end
-
- def test_enumerator
- [1,2,3].each.with_index {|x,i|
- assert_equal(x, i+1)
- }
-
- e = [1,2,3].each
- assert_equal(1, e.next)
- assert_equal(2, e.next)
- assert_equal(3, e.next)
- assert_raise(StopIteration){e.next}
- e.rewind
- assert_equal(1, e.next)
- e.rewind
- a = []
- loop{a.push e.next}
- assert_equal([1,2,3], a)
-
- assert_equal([[8, 1, 10], [6, 2, 11], [4, 3, 12]],
- [8,6,4].zip((1..10),(10..100)).to_a)
- end
end
diff --git a/test/ruby/test_lambda.rb b/test/ruby/test_lambda.rb
deleted file mode 100644
index 241042d2c7..0000000000
--- a/test/ruby/test_lambda.rb
+++ /dev/null
@@ -1,68 +0,0 @@
-require 'test/unit'
-
-class TestLambdaParameters < Test::Unit::TestCase
-
- def test_exact_parameter
- assert_raise(ArgumentError){(1..3).each(&lambda{})}
- end
-
- def test_call_simple
- assert_equal(1, lambda{|a| a}.call(1))
- assert_equal([1,2], lambda{|a, b| [a,b]}.call(1,2))
- assert_raise(ArgumentError) { lambda{|a|}.call(1,2) }
- assert_raise(ArgumentError) { lambda{|a|}.call() }
- assert_raise(ArgumentError) { lambda{}.call(1) }
- assert_raise(ArgumentError) { lambda{|a, b|}.call(1,2,3) }
-
- assert_equal(1, ->(a){ a }.call(1))
- assert_equal([1,2], ->(a,b){ [a,b] }.call(1,2))
- assert_raise(ArgumentError) { ->(a){ }.call(1,2) }
- assert_raise(ArgumentError) { ->(a){ }.call() }
- assert_raise(ArgumentError) { ->(){ }.call(1) }
- assert_raise(ArgumentError) { ->(a,b){ }.call(1,2,3) }
- end
-
-end
-
-__END__
- def test_lambda_as_iterator
- a = 0
- 2.times(&->(_){ a += 1 })
- assert_equal(a, 2)
- end
-
- def test_call_rest_args
- assert_equal([1,2], ->(*a){ a }.call(1,2))
- assert_equal([1,2,[]], ->(a,b,*c){ [a,b,c] }.call(1,2))
- assert_raise(ArgumentError){ ->(a,*b){ }.call() }
- end
-
- def test_call_opt_args
- assert_equal([1,2,3,4], ->(a,b,c=3,d=4){ [a,b,c,d] }.call(1,2))
- assert_equal([1,2,3,4], ->(a,b,c=0,d=4){ [a,b,c,d] }.call(1,2,3))
- assert_raise(ArgumentError){ ->(a,b=1){ }.call() }
- assert_raise(ArgumentError){ ->(a,b=1){ }.call(1,2,3) }
- end
-
- def test_call_rest_and_opt
- assert_equal([1,2,3,[]], ->(a,b=2,c=3,*d){ [a,b,c,d] }.call(1))
- assert_equal([1,2,3,[]], ->(a,b=0,c=3,*d){ [a,b,c,d] }.call(1,2))
- assert_equal([1,2,3,[4,5,6]], ->(a,b=0,c=0,*d){ [a,b,c,d] }.call(1,2,3,4,5,6))
- assert_raise(ArgumentError){ ->(a,b=1,*c){ }.call() }
- end
-
- def test_call_with_block
- f = ->(a,b,c=3,*d,&e){ [a,b,c,d,e.call(d + [a,b,c])] }
- assert_equal([1,2,3,[],6], f.call(1,2){|z| z.inject{|s,x| s+x} } )
- assert_equal(nil, ->(&b){ b }.call)
- foo { puts "bogus block " }
- assert_equal(1, ->(&b){ b.call }.call { 1 })
- b = nil
- assert_equal(1, ->(&b){ b.call }.call { 1 })
- assert_nil(b)
- end
-
- def foo
- assert_equal(nil, ->(&b){ b }.call)
- end
-end
diff --git a/test/ruby/test_literal.rb b/test/ruby/test_literal.rb
deleted file mode 100644
index e87769a6c8..0000000000
--- a/test/ruby/test_literal.rb
+++ /dev/null
@@ -1,241 +0,0 @@
-require 'test/unit'
-
-class TestRubyLiteral < Test::Unit::TestCase
-
- def test_special_const
- assert_equal 'true', true.inspect
- assert_instance_of TrueClass, true
- assert_equal 'false', false.inspect
- assert_instance_of FalseClass, false
- assert_equal 'nil', nil.inspect
- assert_instance_of NilClass, nil
- assert_equal ':sym', :sym.inspect
- assert_instance_of Symbol, :sym
- assert_equal '1234', 1234.inspect
- assert_instance_of Fixnum, 1234
- assert_equal '1234', 1_2_3_4.inspect
- assert_instance_of Fixnum, 1_2_3_4
- assert_equal '18', 0x12.inspect
- assert_instance_of Fixnum, 0x12
- assert_raise(SyntaxError) { eval("0x") }
- assert_equal '15', 0o17.inspect
- assert_instance_of Fixnum, 0o17
- assert_raise(SyntaxError) { eval("0o") }
- assert_equal '5', 0b101.inspect
- assert_instance_of Fixnum, 0b101
- assert_raise(SyntaxError) { eval("0b") }
- assert_equal '123456789012345678901234567890', 123456789012345678901234567890.inspect
- assert_instance_of Bignum, 123456789012345678901234567890
- assert_instance_of Float, 1.3
- end
-
- def test_self
- assert_equal self, self
- assert_instance_of TestRubyLiteral, self
- assert_respond_to self, :test_self
- end
-
- def test_string
- assert_instance_of String, ?a
- assert_equal "a", ?a
- assert_instance_of String, ?A
- assert_equal "A", ?A
- assert_instance_of String, ?\n
- assert_equal "\n", ?\n
- assert_equal " ", ?\ # space
- assert_equal '', ''
- assert_equal 'string', 'string'
- assert_equal 'string string', 'string string'
- assert_equal ' ', ' '
- assert_equal ' ', " "
- assert_equal "\0", "\0"
- assert_equal "\1", "\1"
- assert_equal "3", "\x33"
- assert_equal "\n", "\n"
- end
-
- def test_dstring
- assert_equal '2', "#{1+1}"
- assert_equal '16', "#{2 ** 4}"
- s = "string"
- assert_equal s, "#{s}"
- end
-
- def test_dsymbol
- assert_equal :a3c, :"a#{1+2}c"
- end
-
- def test_xstring
- assert_equal "foo\n", `echo foo`
- s = 'foo'
- assert_equal "foo\n", `echo #{s}`
- end
-
- def test_regexp
- assert_instance_of Regexp, //
- assert_match //, 'a'
- assert_match //, ''
- assert_instance_of Regexp, /a/
- assert_match /a/, 'a'
- assert_no_match /test/, 'tes'
- re = /test/
- assert_match re, 'test'
- str = 'test'
- assert_match re, str
- assert_match /test/, str
- assert_equal 0, (/test/ =~ 'test')
- assert_equal 0, (re =~ 'test')
- assert_equal 0, (/test/ =~ str)
- assert_equal 0, (re =~ str)
- assert_equal 0, ('test' =~ /test/)
- assert_equal 0, ('test' =~ re)
- assert_equal 0, (str =~ /test/)
- assert_equal 0, (str =~ re)
- end
-
- def test_dregexp
- assert_instance_of Regexp, /re#{'ge'}xp/
- assert_equal(/regexp/, /re#{'ge'}xp/)
- end
-
- def test_array
- assert_instance_of Array, []
- assert_equal [], []
- assert_equal 0, [].size
- assert_instance_of Array, [0]
- assert_equal [3], [3]
- assert_equal 1, [3].size
- a = [3]
- assert_equal 3, a[0]
- assert_instance_of Array, [1,2]
- assert_equal [1,2], [1,2]
- assert_instance_of Array, [1,2,3,4,5]
- assert_equal [1,2,3,4,5], [1,2,3,4,5]
- assert_equal 5, [1,2,3,4,5].size
- a = [1,2]
- assert_equal 1, a[0]
- assert_equal 2, a[1]
- a = [1 + 2, 3 + 4, 5 + 6]
- assert_instance_of Array, a
- assert_equal [3, 7, 11], a
- assert_equal 7, a[1]
- assert_equal 1, ([0][0] += 1)
- assert_equal 1, ([2][0] -= 1)
- a = [obj = Object.new]
- assert_instance_of Array, a
- assert_equal 1, a.size
- assert_equal obj, a[0]
- a = [1,2,3]
- a[1] = 5
- assert_equal 5, a[1]
- end
-
- def test_hash
- assert_instance_of Hash, {}
- assert_equal({}, {})
- assert_instance_of Hash, {1 => 2}
- assert_equal({1 => 2}, {1 => 2})
- h = {1 => 2}
- assert_equal 2, h[1]
- h = {"string" => "literal", "goto" => "hell"}
- assert_equal h, h
- assert_equal 2, h.size
- assert_equal h, h
- assert_equal "literal", h["string"]
- end
-
- def test_range
- assert_instance_of Range, (1..2)
- assert_equal(1..2, 1..2)
- r = 1..2
- assert_equal 1, r.begin
- assert_equal 2, r.end
- assert_equal false, r.exclude_end?
- assert_instance_of Range, (1...3)
- assert_equal(1...3, 1...3)
- r = 1...3
- assert_equal 1, r.begin
- assert_equal 3, r.end
- assert_equal true, r.exclude_end?
- r = 1+2 .. 3+4
- assert_instance_of Range, r
- assert_equal 3, r.begin
- assert_equal 7, r.end
- assert_equal false, r.exclude_end?
- r = 1+2 ... 3+4
- assert_instance_of Range, r
- assert_equal 3, r.begin
- assert_equal 7, r.end
- assert_equal true, r.exclude_end?
- assert_instance_of Range, 'a'..'c'
- r = 'a'..'c'
- assert_equal 'a', r.begin
- assert_equal 'c', r.end
- end
-
- def test__FILE__
- assert_instance_of String, __FILE__
- assert_equal __FILE__, __FILE__
- assert_equal 'test_literal.rb', File.basename(__FILE__)
- end
-
- def test__LINE__
- assert_instance_of Fixnum, __LINE__
- assert_equal __LINE__, __LINE__
- end
-
- def test_integer
- head = ['', '0x', '0o', '0b', '0d', '-', '+']
- chars = ['0', '1', '_', '9', 'f']
- head.each {|h|
- 4.times {|len|
- a = [h]
- len.times { a = a.product(chars).map {|x| x.join('') } }
- a.each {|s|
- next if s.empty?
- begin
- r1 = Integer(s)
- rescue ArgumentError
- r1 = :err
- end
- begin
- r2 = eval(s)
- rescue NameError, SyntaxError
- r2 = :err
- end
- assert_equal(r1, r2, "Integer(#{s.inspect}) != eval(#{s.inspect})")
- }
- }
- }
- end
-
- def test_float
- head = ['', '-', '+']
- chars = ['0', '1', '_', '9', 'f', '.']
- head.each {|h|
- 6.times {|len|
- a = [h]
- len.times { a = a.product(chars).map {|x| x.join('') } }
- a.each {|s|
- next if s.empty?
- next if /\.\z/ =~ s
- next if /\A[-+]?\./ =~ s
- next if /\A[-+]?0/ =~ s
- begin
- r1 = Float(s)
- rescue ArgumentError
- r1 = :err
- end
- begin
- r2 = eval(s)
- rescue NameError, SyntaxError
- r2 = :err
- end
- r2 = :err if Range === r2
- assert_equal(r1, r2, "Float(#{s.inspect}) != eval(#{s.inspect})")
- }
- }
- }
- end
-
-end
diff --git a/test/ruby/test_m17n.rb b/test/ruby/test_m17n.rb
deleted file mode 100644
index cbab1f6692..0000000000
--- a/test/ruby/test_m17n.rb
+++ /dev/null
@@ -1,1322 +0,0 @@
-require 'test/unit'
-require 'stringio'
-
-class TestM17N < Test::Unit::TestCase
- def assert_encoding(encname, actual, message=nil)
- assert_equal(Encoding.find(encname), actual, message)
- end
-
- module AESU
- def a(str) str.dup.force_encoding("ASCII-8BIT") end
- def e(str) str.dup.force_encoding("EUC-JP") end
- def s(str) str.dup.force_encoding("Windows-31J") end
- def u(str) str.dup.force_encoding("UTF-8") end
- end
- include AESU
- extend AESU
-
- def assert_strenc(bytes, enc, actual, message=nil)
- assert_instance_of(String, actual, message)
- enc = Encoding.find(enc) if String === enc
- assert_equal(enc, actual.encoding, message)
- assert_equal(a(bytes), a(actual), message)
- end
-
- def assert_warning(pat, mesg=nil)
- begin
- org_stderr = $stderr
- $stderr = StringIO.new(warn = '')
- yield
- ensure
- $stderr = org_stderr
- end
- assert_match(pat, warn, mesg)
- end
-
- def assert_regexp_generic_encoding(r)
- assert(!r.fixed_encoding?)
- %w[ASCII-8BIT EUC-JP Windows-31J UTF-8].each {|ename|
- # "\xc2\xa1" is a valid sequence for ASCII-8BIT, EUC-JP, Windows-31J and UTF-8.
- assert_nothing_raised { r =~ "\xc2\xa1".force_encoding(ename) }
- }
- end
-
- def assert_regexp_fixed_encoding(r)
- assert(r.fixed_encoding?)
- %w[ASCII-8BIT EUC-JP Windows-31J UTF-8].each {|ename|
- enc = Encoding.find(ename)
- if enc == r.encoding
- assert_nothing_raised { r =~ "\xc2\xa1".force_encoding(enc) }
- else
- assert_raise(Encoding::CompatibilityError) { r =~ "\xc2\xa1".force_encoding(enc) }
- end
- }
- end
-
- def assert_regexp_generic_ascii(r)
- assert_encoding("US-ASCII", r.encoding)
- assert_regexp_generic_encoding(r)
- end
-
- def assert_regexp_fixed_ascii8bit(r)
- assert_encoding("ASCII-8BIT", r.encoding)
- assert_regexp_fixed_encoding(r)
- end
-
- def assert_regexp_fixed_eucjp(r)
- assert_encoding("EUC-JP", r.encoding)
- assert_regexp_fixed_encoding(r)
- end
-
- def assert_regexp_fixed_sjis(r)
- assert_encoding("Windows-31J", r.encoding)
- assert_regexp_fixed_encoding(r)
- end
-
- def assert_regexp_fixed_utf8(r)
- assert_encoding("UTF-8", r.encoding)
- assert_regexp_fixed_encoding(r)
- end
-
- def assert_regexp_usascii_literal(r, enc, ex = nil)
- code = "# -*- encoding: US-ASCII -*-\n#{r}.encoding"
- if ex
- assert_raise(ex) { eval(code) }
- else
- assert_equal(enc, eval(code))
- end
- end
-
- def encdump(str)
- d = str.dump
- if /\.force_encoding\("[A-Za-z0-9.:_+-]*"\)\z/ =~ d
- d
- else
- "#{d}.force_encoding(#{str.encoding.name.dump})"
- end
- end
-
- def encdumpargs(args)
- r = '('
- args.each_with_index {|a, i|
- r << ',' if 0 < i
- if String === a
- r << encdump(a)
- else
- r << a.inspect
- end
- }
- r << ')'
- r
- end
-
- def assert_str_enc_propagation(t, s1, s2)
- if !s1.ascii_only?
- assert_equal(s1.encoding, t.encoding)
- elsif !s2.ascii_only?
- assert_equal(s2.encoding, t.encoding)
- else
- assert([s1.encoding, s2.encoding].include?(t.encoding))
- end
- end
-
- def assert_same_result(expected_proc, actual_proc)
- e = nil
- begin
- t = expected_proc.call
- rescue
- e = $!
- end
- if e
- assert_raise(e.class) { actual_proc.call }
- else
- assert_equal(t, actual_proc.call)
- end
- end
-
- def str_enc_compatible?(*strs)
- encs = []
- strs.each {|s|
- encs << s.encoding if !s.ascii_only?
- }
- encs.uniq!
- encs.length <= 1
- end
-
- # tests start
-
- def test_string_ascii_literal
- assert_encoding("ASCII-8BIT", eval(a(%{""})).encoding)
- assert_encoding("ASCII-8BIT", eval(a(%{"a"})).encoding)
- end
-
- def test_string_eucjp_literal
- assert_encoding("EUC-JP", eval(e(%{""})).encoding)
- assert_encoding("EUC-JP", eval(e(%{"a"})).encoding)
- assert_encoding("EUC-JP", eval(e(%{"\xa1\xa1"})).encoding)
- assert_encoding("EUC-JP", eval(e(%{"\\xa1\\xa1"})).encoding)
- assert_encoding("EUC-JP", eval(e(%{"\\x20"})).encoding)
- assert_encoding("EUC-JP", eval(e(%{"\\n"})).encoding)
- assert_encoding("EUC-JP", eval(e(%{"\\x80"})).encoding)
- end
-
- def test_utf8_literal
- assert_equal(Encoding::UTF_8, "\u3042".encoding, "[ruby-dev:33406] \"\\u3042\".encoding")
- assert_raise(SyntaxError) { eval(a('\u3052\x80')) }
- end
-
- def test_string_mixed_unicode
- assert_raise(SyntaxError) { eval(a(%{"\xc2\xa1\\u{6666}"})) }
- assert_raise(SyntaxError) { eval(e(%{"\xc2\xa1\\u{6666}"})) }
- assert_raise(SyntaxError) { eval(s(%{"\xc2\xa1\\u{6666}"})) }
- assert_nothing_raised { eval(u(%{"\xc2\xa1\\u{6666}"})) }
- assert_raise(SyntaxError) { eval(a(%{"\\u{6666}\xc2\xa1"})) }
- assert_raise(SyntaxError) { eval(e(%{"\\u{6666}\xc2\xa1"})) }
- assert_raise(SyntaxError) { eval(s(%{"\\u{6666}\xc2\xa1"})) }
- assert_nothing_raised { eval(u(%{"\\u{6666}\xc2\xa1"})) }
- end
-
- def test_string_inspect
- assert_equal('"\xFE"', e("\xfe").inspect)
- assert_equal('"\x8E"', e("\x8e").inspect)
- assert_equal('"\x8F"', e("\x8f").inspect)
- assert_equal('"\x8F\xA1"', e("\x8f\xa1").inspect)
- assert_equal('"\xEF"', s("\xef").inspect)
- assert_equal('"\xC2"', u("\xc2").inspect)
- assert_equal('"\xE0\x80"', u("\xe0\x80").inspect)
- assert_equal('"\xF0\x80\x80"', u("\xf0\x80\x80").inspect)
- assert_equal('"\xF8\x80\x80\x80"', u("\xf8\x80\x80\x80").inspect)
- assert_equal('"\xFC\x80\x80\x80\x80"', u("\xfc\x80\x80\x80\x80").inspect)
-
- assert_equal('"\xFE "', e("\xfe ").inspect)
- assert_equal('"\x8E "', e("\x8e ").inspect)
- assert_equal('"\x8F "', e("\x8f ").inspect)
- assert_equal('"\x8F\xA1 "', e("\x8f\xa1 ").inspect)
- assert_equal('"\xEF "', s("\xef ").inspect)
- assert_equal('"\xC2 "', u("\xc2 ").inspect)
- assert_equal('"\xE0\x80 "', u("\xe0\x80 ").inspect)
- assert_equal('"\xF0\x80\x80 "', u("\xf0\x80\x80 ").inspect)
- assert_equal('"\xF8\x80\x80\x80 "', u("\xf8\x80\x80\x80 ").inspect)
- assert_equal('"\xFC\x80\x80\x80\x80 "', u("\xfc\x80\x80\x80\x80 ").inspect)
-
-
- assert_equal(e("\"\\xA1\x8f\xA1\xA1\""), e("\xa1\x8f\xa1\xa1").inspect)
-
- assert_equal('"\x81."', s("\x81.").inspect)
- assert_equal(s("\"\x81@\""), s("\x81@").inspect)
-
- assert_equal('"\xFC"', u("\xfc").inspect)
- end
-
- def test_str_dump
- [
- e("\xfe"),
- e("\x8e"),
- e("\x8f"),
- e("\x8f\xa1"),
- s("\xef"),
- u("\xc2"),
- u("\xe0\x80"),
- u("\xf0\x80\x80"),
- u("\xf8\x80\x80\x80"),
- u("\xfc\x80\x80\x80\x80"),
-
- e("\xfe "),
- e("\x8e "),
- e("\x8f "),
- e("\x8f\xa1 "),
- s("\xef "),
- u("\xc2 "),
- u("\xe0\x80 "),
- u("\xf0\x80\x80 "),
- u("\xf8\x80\x80\x80 "),
- u("\xfc\x80\x80\x80\x80 "),
-
-
- e("\xa1\x8f\xa1\xa1"),
-
- s("\x81."),
- s("\x81@"),
-
- u("\xfc"),
- "\u3042",
- "ascii",
-
- "\u3042".encode("UTF-16LE"),
- "\u3042".encode("UTF-16BE"),
- ].each do |str|
- assert_equal(str, eval(str.dump), "[ruby-dev:33142]")
- end
- end
-
- def test_validate_redundant_utf8
- bits_0x10ffff = "11110100 10001111 10111111 10111111"
- [
- "0xxxxxxx",
- "110XXXXx 10xxxxxx",
- "1110XXXX 10Xxxxxx 10xxxxxx",
- "11110XXX 10XXxxxx 10xxxxxx 10xxxxxx",
- "111110XX 10XXXxxx 10xxxxxx 10xxxxxx 10xxxxxx",
- "1111110X 10XXXXxx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx",
- "11111110 10XXXXXx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx",
- "11111111 10XXXXXX 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx",
- ].each {|pat0|
- [
- pat0.gsub(/x/, '1'),
- pat0.gsub(/x/, '0')
- ].each {|pat1|
- [
- pat1.sub(/X([^X]*)\z/, '1\1').gsub(/X/, "0"),
- pat1.gsub(/X/, "1"),
- ].each {|pat2|
- s = [pat2.gsub(/ /, "")].pack("B*").force_encoding("utf-8")
- if pat2 <= bits_0x10ffff
- assert(s.valid_encoding?, "#{pat2}")
- else
- assert(!s.valid_encoding?, "#{pat2}")
- end
- }
- if / / =~ pat0
- pat3 = pat1.gsub(/X/, "0")
- s = [pat3.gsub(/ /, "")].pack("B*").force_encoding("utf-8")
- assert(!s.valid_encoding?, "#{pat3}")
- end
- }
- }
- end
-
- def test_validate_surrogate
- # 1110XXXX 10Xxxxxx 10xxxxxx : 3 bytes UTF-8
- pats = [
- "11101101 10011111 10111111", # just before surrogate high
- "11101101 1010xxxx 10xxxxxx", # surrogate high
- "11101101 1011xxxx 10xxxxxx", # surrogate low
- "11101110 10000000 10000000", # just after surrogate low
- ]
- pats.values_at(1,2).each {|pat0|
- [
- pat0.gsub(/x/, '0'),
- pat0.gsub(/x/, '1'),
- ].each {|pat1|
- s = [pat1.gsub(/ /, "")].pack("B*").force_encoding("utf-8")
- assert(!s.valid_encoding?, "#{pat1}")
- }
- }
- pats.values_at(0,3).each {|pat|
- s = [pat.gsub(/ /, "")].pack("B*").force_encoding("utf-8")
- assert(s.valid_encoding?, "#{pat}")
- }
- end
-
- def test_regexp_too_short_multibyte_character
- assert_raise(SyntaxError) { eval('/\xfe/e') }
- assert_raise(SyntaxError) { eval('/\x8e/e') }
- assert_raise(SyntaxError) { eval('/\x8f/e') }
- assert_raise(SyntaxError) { eval('/\x8f\xa1/e') }
- assert_raise(SyntaxError) { eval('/\xef/s') }
- assert_raise(SyntaxError) { eval('/\xc2/u') }
- assert_raise(SyntaxError) { eval('/\xe0\x80/u') }
- assert_raise(SyntaxError) { eval('/\xf0\x80\x80/u') }
- assert_raise(SyntaxError) { eval('/\xf8\x80\x80\x80/u') }
- assert_raise(SyntaxError) { eval('/\xfc\x80\x80\x80\x80/u') }
-
- # raw 8bit
- assert_raise(SyntaxError) { eval("/\xfe/e") }
- assert_raise(SyntaxError) { eval("/\xc2/u") }
-
- # invalid suffix
- assert_raise(SyntaxError) { eval('/\xc2\xff/u') }
- assert_raise(SyntaxError) { eval('/\xc2 /u') }
- assert_raise(SyntaxError) { eval('/\xc2\x20/u') }
- end
-
- def test_regexp_generic
- assert_regexp_generic_ascii(/a/)
- assert_regexp_generic_ascii(Regexp.new(a("a")))
- assert_regexp_generic_ascii(Regexp.new(e("a")))
- assert_regexp_generic_ascii(Regexp.new(s("a")))
- assert_regexp_generic_ascii(Regexp.new(u("a")))
-
- [/a/, Regexp.new(a("a"))].each {|r|
- assert_equal(0, r =~ a("a"))
- assert_equal(0, r =~ e("a"))
- assert_equal(0, r =~ s("a"))
- assert_equal(0, r =~ u("a"))
- assert_equal(nil, r =~ a("\xc2\xa1"))
- assert_equal(nil, r =~ e("\xc2\xa1"))
- assert_equal(nil, r =~ s("\xc2\xa1"))
- assert_equal(nil, r =~ u("\xc2\xa1"))
- }
- end
-
- def test_regexp_ascii_none
- r = /a/n
-
- assert_warning(%r{regexp match /.../n against to}) {
- assert_regexp_generic_ascii(r)
- }
-
- assert_equal(0, r =~ a("a"))
- assert_equal(0, r =~ e("a"))
- assert_equal(0, r =~ s("a"))
- assert_equal(0, r =~ u("a"))
- assert_equal(nil, r =~ a("\xc2\xa1"))
- assert_warning(%r{regexp match /.../n against to EUC-JP string}) {
- assert_equal(nil, r =~ e("\xc2\xa1"))
- }
- assert_warning(%r{regexp match /.../n against to Windows-31J string}) {
- assert_equal(nil, r =~ s("\xc2\xa1"))
- }
- assert_warning(%r{regexp match /.../n against to UTF-8 string}) {
- assert_equal(nil, r =~ u("\xc2\xa1"))
- }
-
- assert_nothing_raised { eval(e("/\\x80/n")) }
- end
-
- def test_regexp_ascii
- assert_regexp_fixed_ascii8bit(/\xc2\xa1/n)
- assert_regexp_fixed_ascii8bit(eval(a(%{/\xc2\xa1/})))
- assert_regexp_fixed_ascii8bit(eval(a(%{/\xc2\xa1/n})))
- assert_regexp_fixed_ascii8bit(eval(a(%q{/\xc2\xa1/})))
-
- assert_raise(SyntaxError) { eval("/\xa1\xa1/n".force_encoding("euc-jp")) }
-
- [/\xc2\xa1/n, eval(a(%{/\xc2\xa1/})), eval(a(%{/\xc2\xa1/n}))].each {|r|
- assert_equal(nil, r =~ a("a"))
- assert_equal(nil, r =~ e("a"))
- assert_equal(nil, r =~ s("a"))
- assert_equal(nil, r =~ u("a"))
- assert_equal(0, r =~ a("\xc2\xa1"))
- assert_raise(Encoding::CompatibilityError) { r =~ e("\xc2\xa1") }
- assert_raise(Encoding::CompatibilityError) { r =~ s("\xc2\xa1") }
- assert_raise(Encoding::CompatibilityError) { r =~ u("\xc2\xa1") }
- }
- end
-
- def test_regexp_euc
- assert_regexp_fixed_eucjp(/a/e)
- assert_regexp_fixed_eucjp(/\xc2\xa1/e)
- assert_regexp_fixed_eucjp(eval(e(%{/\xc2\xa1/})))
- assert_regexp_fixed_eucjp(eval(e(%q{/\xc2\xa1/})))
-
- [/a/e].each {|r|
- assert_equal(0, r =~ a("a"))
- assert_equal(0, r =~ e("a"))
- assert_equal(0, r =~ s("a"))
- assert_equal(0, r =~ u("a"))
- assert_raise(Encoding::CompatibilityError) { r =~ a("\xc2\xa1") }
- assert_equal(nil, r =~ e("\xc2\xa1"))
- assert_raise(Encoding::CompatibilityError) { r =~ s("\xc2\xa1") }
- assert_raise(Encoding::CompatibilityError) { r =~ u("\xc2\xa1") }
- }
-
- [/\xc2\xa1/e, eval(e(%{/\xc2\xa1/})), eval(e(%q{/\xc2\xa1/}))].each {|r|
- assert_equal(nil, r =~ a("a"))
- assert_equal(nil, r =~ e("a"))
- assert_equal(nil, r =~ s("a"))
- assert_equal(nil, r =~ u("a"))
- assert_raise(Encoding::CompatibilityError) { r =~ a("\xc2\xa1") }
- assert_equal(0, r =~ e("\xc2\xa1"))
- assert_raise(Encoding::CompatibilityError) { r =~ s("\xc2\xa1") }
- assert_raise(Encoding::CompatibilityError) { r =~ u("\xc2\xa1") }
- }
- end
-
- def test_regexp_sjis
- assert_regexp_fixed_sjis(/a/s)
- assert_regexp_fixed_sjis(/\xc2\xa1/s)
- assert_regexp_fixed_sjis(eval(s(%{/\xc2\xa1/})))
- assert_regexp_fixed_sjis(eval(s(%q{/\xc2\xa1/})))
- end
-
- def test_regexp_windows_31j
- begin
- Regexp.new("\xa1".force_encoding("windows-31j")) =~ "\xa1\xa1".force_encoding("euc-jp")
- rescue Encoding::CompatibilityError
- err = $!
- end
- assert_match(/windows-31j/i, err.message)
- end
-
- def test_regexp_embed
- r = eval(e("/\xc2\xa1/"))
- assert_raise(ArgumentError) { eval(s("/\xc2\xa1\#{r}/s")) }
- assert_raise(ArgumentError) { eval(s("/\#{r}\xc2\xa1/s")) }
-
- r = /\xc2\xa1/e
- assert_raise(ArgumentError) { eval(s("/\xc2\xa1\#{r}/s")) }
- assert_raise(ArgumentError) { eval(s("/\#{r}\xc2\xa1/s")) }
-
- r = eval(e("/\xc2\xa1/"))
- assert_raise(ArgumentError) { /\xc2\xa1#{r}/s }
-
- r = /\xc2\xa1/e
- assert_raise(ArgumentError) { /\xc2\xa1#{r}/s }
-
- r1 = Regexp.new('foo'.force_encoding("ascii-8bit"))
- r2 = eval('/bar#{r1}/'.force_encoding('ascii-8bit'))
- assert_equal(Encoding::US_ASCII, r2.encoding)
-
- r1 = Regexp.new('foo'.force_encoding("us-ascii"))
- r2 = eval('/bar#{r1}/'.force_encoding('ascii-8bit'))
- assert_equal(Encoding::US_ASCII, r2.encoding)
-
- r1 = Regexp.new('foo'.force_encoding("ascii-8bit"))
- r2 = eval('/bar#{r1}/'.force_encoding('us-ascii'))
- assert_equal(Encoding::US_ASCII, r2.encoding)
-
- r1 = Regexp.new('foo'.force_encoding("us-ascii"))
- r2 = eval('/bar#{r1}/'.force_encoding('us-ascii'))
- assert_equal(Encoding::US_ASCII, r2.encoding)
-
- r1 = Regexp.new('\xa1'.force_encoding("ascii-8bit"))
- r2 = eval('/bar#{r1}/'.force_encoding('ascii-8bit'))
- assert_equal(Encoding::ASCII_8BIT, r2.encoding)
-
- r1 = Regexp.new('\xa1'.force_encoding("ascii-8bit"))
- r2 = eval('/bar#{r1}/'.force_encoding('us-ascii'))
- assert_equal(Encoding::ASCII_8BIT, r2.encoding)
-
- r1 = Regexp.new('foo'.force_encoding("ascii-8bit"))
- r2 = eval('/\xa1#{r1}/'.force_encoding('ascii-8bit'))
- assert_equal(Encoding::ASCII_8BIT, r2.encoding)
-
- r1 = Regexp.new('foo'.force_encoding("us-ascii"))
- r2 = eval('/\xa1#{r1}/'.force_encoding('ascii-8bit'))
- assert_equal(Encoding::ASCII_8BIT, r2.encoding)
-
- r1 = Regexp.new('\xa1'.force_encoding("ascii-8bit"))
- r2 = eval('/\xa1#{r1}/'.force_encoding('ascii-8bit'))
- assert_equal(Encoding::ASCII_8BIT, r2.encoding)
- end
-
- def test_regexp_named_class
- assert_match(/[[:space:]]/u, "\u{00a0}")
- assert_match(/[[:space:]]/, "\u{00a0}")
- end
-
- def test_regexp_property
- s = '\p{Hiragana}'.force_encoding("euc-jp")
- assert_equal(Encoding::EUC_JP, s.encoding)
- r = nil
- assert_nothing_raised {
- r = Regexp.new(s)
- }
- assert(r.fixed_encoding?)
- assert_match(r, "\xa4\xa2".force_encoding("euc-jp"))
-
- r = eval('/\p{Hiragana}/'.force_encoding("euc-jp"))
- assert(r.fixed_encoding?)
- assert_match(r, "\xa4\xa2".force_encoding("euc-jp"))
-
- r = /\p{Hiragana}/e
- assert(r.fixed_encoding?)
- assert_match(r, "\xa4\xa2".force_encoding("euc-jp"))
-
- r = eval('/\u{3042}\p{Hiragana}/'.force_encoding("euc-jp"))
- assert(r.fixed_encoding?)
- assert_equal(Encoding::UTF_8, r.encoding)
-
- r = eval('/\p{Hiragana}\u{3042}/'.force_encoding("euc-jp"))
- assert(r.fixed_encoding?)
- assert_equal(Encoding::UTF_8, r.encoding)
- end
-
- def test_regexp_embed_preprocess
- r1 = /\xa4\xa2/e
- r2 = /#{r1}/
- assert(r2.source.include?(r1.source))
- end
-
- def test_begin_end_offset
- str = e("\244\242\244\244\244\246\244\250\244\252a")
- assert(/(a)/ =~ str)
- assert_equal("a", $&)
- assert_equal(5, $~.begin(0))
- assert_equal(6, $~.end(0))
- assert_equal([5,6], $~.offset(0))
- assert_equal(5, $~.begin(1))
- assert_equal(6, $~.end(1))
- assert_equal([5,6], $~.offset(1))
- end
-
- def test_begin_end_offset_sjis
- str = s("\x81@@")
- assert(/@/ =~ str)
- assert_equal(s("\x81@"), $`)
- assert_equal("@", $&)
- assert_equal("", $')
- assert_equal([1,2], $~.offset(0))
- end
-
- def test_quote
- assert_regexp_generic_ascii(/#{Regexp.quote(a("a"))}#{Regexp.quote(e("e"))}/)
-
- assert_encoding("US-ASCII", Regexp.quote(a("")).encoding)
- assert_encoding("US-ASCII", Regexp.quote(e("")).encoding)
- assert_encoding("US-ASCII", Regexp.quote(s("")).encoding)
- assert_encoding("US-ASCII", Regexp.quote(u("")).encoding)
- assert_encoding("US-ASCII", Regexp.quote(a("a")).encoding)
- assert_encoding("US-ASCII", Regexp.quote(e("a")).encoding)
- assert_encoding("US-ASCII", Regexp.quote(s("a")).encoding)
- assert_encoding("US-ASCII", Regexp.quote(u("a")).encoding)
-
- assert_encoding("ASCII-8BIT", Regexp.quote(a("\xc2\xa1")).encoding)
- assert_encoding("EUC-JP", Regexp.quote(e("\xc2\xa1")).encoding)
- assert_encoding("Windows-31J", Regexp.quote(s("\xc2\xa1")).encoding)
- assert_encoding("UTF-8", Regexp.quote(u("\xc2\xa1")).encoding)
- end
-
- def test_union_0
- r = Regexp.union
- assert_regexp_generic_ascii(r)
- assert(r !~ a(""))
- assert(r !~ e(""))
- assert(r !~ s(""))
- assert(r !~ u(""))
- end
-
- def test_union_1_asciionly_string
- assert_regexp_generic_ascii(Regexp.union(a("")))
- assert_regexp_generic_ascii(Regexp.union(e("")))
- assert_regexp_generic_ascii(Regexp.union(s("")))
- assert_regexp_generic_ascii(Regexp.union(u("")))
- assert_regexp_generic_ascii(Regexp.union(a("a")))
- assert_regexp_generic_ascii(Regexp.union(e("a")))
- assert_regexp_generic_ascii(Regexp.union(s("a")))
- assert_regexp_generic_ascii(Regexp.union(u("a")))
- assert_regexp_generic_ascii(Regexp.union(a("\t")))
- assert_regexp_generic_ascii(Regexp.union(e("\t")))
- assert_regexp_generic_ascii(Regexp.union(s("\t")))
- assert_regexp_generic_ascii(Regexp.union(u("\t")))
- end
-
- def test_union_1_nonascii_string
- assert_regexp_fixed_ascii8bit(Regexp.union(a("\xc2\xa1")))
- assert_regexp_fixed_eucjp(Regexp.union(e("\xc2\xa1")))
- assert_regexp_fixed_sjis(Regexp.union(s("\xc2\xa1")))
- assert_regexp_fixed_utf8(Regexp.union(u("\xc2\xa1")))
- end
-
- def test_union_1_regexp
- assert_regexp_generic_ascii(Regexp.union(//))
- assert_warning(%r{regexp match /.../n against to}) {
- assert_regexp_generic_ascii(Regexp.union(//n))
- }
- assert_regexp_fixed_eucjp(Regexp.union(//e))
- assert_regexp_fixed_sjis(Regexp.union(//s))
- assert_regexp_fixed_utf8(Regexp.union(//u))
- end
-
- def test_union_2
- ary = [
- a(""), e(""), s(""), u(""),
- a("\xc2\xa1"), e("\xc2\xa1"), s("\xc2\xa1"), u("\xc2\xa1")
- ]
- ary.each {|s1|
- ary.each {|s2|
- if s1.empty?
- if s2.empty?
- assert_regexp_generic_ascii(Regexp.union(s1, s2))
- else
- r = Regexp.union(s1, s2)
- assert_regexp_fixed_encoding(r)
- assert_equal(s2.encoding, r.encoding)
- end
- else
- if s2.empty?
- r = Regexp.union(s1, s2)
- assert_regexp_fixed_encoding(r)
- assert_equal(s1.encoding, r.encoding)
- else
- if s1.encoding == s2.encoding
- r = Regexp.union(s1, s2)
- assert_regexp_fixed_encoding(r)
- assert_equal(s1.encoding, r.encoding)
- else
- assert_raise(ArgumentError) { Regexp.union(s1, s2) }
- end
- end
- end
- }
- }
- end
-
- def test_dynamic_ascii_regexp
- assert_warning(%r{regexp match /.../n against to}) {
- assert_regexp_generic_ascii(/#{}/n)
- }
- assert_regexp_fixed_ascii8bit(/#{}\xc2\xa1/n)
- assert_regexp_fixed_ascii8bit(/\xc2\xa1#{}/n)
- assert_nothing_raised { s1, s2 = a('\xc2'), a('\xa1'); /#{s1}#{s2}/ }
- end
-
- def test_dynamic_eucjp_regexp
- assert_regexp_fixed_eucjp(/#{}/e)
- assert_regexp_fixed_eucjp(/#{}\xc2\xa1/e)
- assert_regexp_fixed_eucjp(/\xc2\xa1#{}/e)
- assert_raise(SyntaxError) { eval('/\xc2#{}/e') }
- assert_raise(SyntaxError) { eval('/#{}\xc2/e') }
- assert_raise(SyntaxError) { eval('/\xc2#{}\xa1/e') }
- assert_raise(ArgumentError) { s1, s2 = e('\xc2'), e('\xa1'); /#{s1}#{s2}/ }
- end
-
- def test_dynamic_sjis_regexp
- assert_regexp_fixed_sjis(/#{}/s)
- assert_regexp_fixed_sjis(/#{}\xc2\xa1/s)
- assert_regexp_fixed_sjis(/\xc2\xa1#{}/s)
- assert_raise(SyntaxError) { eval('/\x81#{}/s') }
- assert_raise(SyntaxError) { eval('/#{}\x81/s') }
- assert_raise(SyntaxError) { eval('/\x81#{}\xa1/s') }
- assert_raise(ArgumentError) { s1, s2 = s('\x81'), s('\xa1'); /#{s1}#{s2}/ }
- end
-
- def test_dynamic_utf8_regexp
- assert_regexp_fixed_utf8(/#{}/u)
- assert_regexp_fixed_utf8(/#{}\xc2\xa1/u)
- assert_regexp_fixed_utf8(/\xc2\xa1#{}/u)
- assert_raise(SyntaxError) { eval('/\xc2#{}/u') }
- assert_raise(SyntaxError) { eval('/#{}\xc2/u') }
- assert_raise(SyntaxError) { eval('/\xc2#{}\xa1/u') }
- assert_raise(ArgumentError) { s1, s2 = u('\xc2'), u('\xa1'); /#{s1}#{s2}/ }
- end
-
- def test_regexp_unicode
- assert_nothing_raised { eval '/\u{0}/u' }
- assert_nothing_raised { eval '/\u{D7FF}/u' }
- assert_raise(SyntaxError) { eval '/\u{D800}/u' }
- assert_raise(SyntaxError) { eval '/\u{DFFF}/u' }
- assert_nothing_raised { eval '/\u{E000}/u' }
- assert_nothing_raised { eval '/\u{10FFFF}/u' }
- assert_raise(SyntaxError) { eval '/\u{110000}/u' }
- end
-
- def test_regexp_mixed_unicode
- assert_raise(SyntaxError) { eval(a(%{/\xc2\xa1\\u{6666}/})) }
- assert_raise(SyntaxError) { eval(e(%{/\xc2\xa1\\u{6666}/})) }
- assert_raise(SyntaxError) { eval(s(%{/\xc2\xa1\\u{6666}/})) }
- assert_nothing_raised { eval(u(%{/\xc2\xa1\\u{6666}/})) }
- assert_raise(SyntaxError) { eval(a(%{/\\u{6666}\xc2\xa1/})) }
- assert_raise(SyntaxError) { eval(e(%{/\\u{6666}\xc2\xa1/})) }
- assert_raise(SyntaxError) { eval(s(%{/\\u{6666}\xc2\xa1/})) }
- assert_nothing_raised { eval(u(%{/\\u{6666}\xc2\xa1/})) }
-
- assert_raise(SyntaxError) { eval(a(%{/\\xc2\\xa1\\u{6666}/})) }
- assert_raise(SyntaxError) { eval(e(%{/\\xc2\\xa1\\u{6666}/})) }
- assert_raise(SyntaxError) { eval(s(%{/\\xc2\\xa1\\u{6666}/})) }
- assert_nothing_raised { eval(u(%{/\\xc2\\xa1\\u{6666}/})) }
- assert_raise(SyntaxError) { eval(a(%{/\\u{6666}\\xc2\\xa1/})) }
- assert_raise(SyntaxError) { eval(e(%{/\\u{6666}\\xc2\\xa1/})) }
- assert_raise(SyntaxError) { eval(s(%{/\\u{6666}\\xc2\\xa1/})) }
- assert_nothing_raised { eval(u(%{/\\u{6666}\\xc2\\xa1/})) }
-
- assert_raise(SyntaxError) { eval(a(%{/\xc2\xa1#{}\\u{6666}/})) }
- assert_raise(SyntaxError) { eval(e(%{/\xc2\xa1#{}\\u{6666}/})) }
- assert_raise(SyntaxError) { eval(s(%{/\xc2\xa1#{}\\u{6666}/})) }
- assert_nothing_raised { eval(u(%{/\xc2\xa1#{}\\u{6666}/})) }
- assert_raise(SyntaxError) { eval(a(%{/\\u{6666}#{}\xc2\xa1/})) }
- assert_raise(SyntaxError) { eval(e(%{/\\u{6666}#{}\xc2\xa1/})) }
- assert_raise(SyntaxError) { eval(s(%{/\\u{6666}#{}\xc2\xa1/})) }
- assert_nothing_raised { eval(u(%{/\\u{6666}#{}\xc2\xa1/})) }
-
- assert_raise(SyntaxError) { eval(a(%{/\\xc2\\xa1#{}\\u{6666}/})) }
- assert_raise(SyntaxError) { eval(e(%{/\\xc2\\xa1#{}\\u{6666}/})) }
- assert_raise(SyntaxError) { eval(s(%{/\\xc2\\xa1#{}\\u{6666}/})) }
- assert_nothing_raised { eval(u(%{/\\xc2\\xa1#{}\\u{6666}/})) }
- assert_raise(SyntaxError) { eval(a(%{/\\u{6666}#{}\\xc2\\xa1/})) }
- assert_raise(SyntaxError) { eval(e(%{/\\u{6666}#{}\\xc2\\xa1/})) }
- assert_raise(SyntaxError) { eval(s(%{/\\u{6666}#{}\\xc2\\xa1/})) }
- assert_nothing_raised { eval(u(%{/\\u{6666}#{}\\xc2\\xa1/})) }
- end
-
- def test_str_allocate
- s = String.allocate
- assert_equal(Encoding::ASCII_8BIT, s.encoding)
- end
-
- def test_str_String
- s = String(10)
- assert_equal(Encoding::US_ASCII, s.encoding)
- end
-
- def test_sprintf_c
- assert_strenc("\x80", 'ASCII-8BIT', a("%c") % 128)
- #assert_raise(ArgumentError) { a("%c") % 0xc2a1 }
- assert_strenc("\xc2\xa1", 'EUC-JP', e("%c") % 0xc2a1)
- assert_raise(ArgumentError) { e("%c") % 0xc2 }
- assert_strenc("\xc2", 'Windows-31J', s("%c") % 0xc2)
- #assert_raise(ArgumentError) { s("%c") % 0xc2a1 }
- assert_strenc("\u{c2a1}", 'UTF-8', u("%c") % 0xc2a1)
- assert_strenc("\u{c2}", 'UTF-8', u("%c") % 0xc2)
- assert_raise(Encoding::CompatibilityError) {
- "%s%s" % [s("\xc2\xa1"), e("\xc2\xa1")]
- }
- end
-
- def test_sprintf_p
- assert_strenc('""', 'ASCII-8BIT', a("%p") % a(""))
- assert_strenc('""', 'EUC-JP', e("%p") % e(""))
- assert_strenc('""', 'Windows-31J', s("%p") % s(""))
- assert_strenc('""', 'UTF-8', u("%p") % u(""))
-
- assert_strenc('"a"', 'ASCII-8BIT', a("%p") % a("a"))
- assert_strenc('"a"', 'EUC-JP', e("%p") % e("a"))
- assert_strenc('"a"', 'Windows-31J', s("%p") % s("a"))
- assert_strenc('"a"', 'UTF-8', u("%p") % u("a"))
-
- assert_strenc('"\xC2\xA1"', 'ASCII-8BIT', a("%p") % a("\xc2\xa1"))
- assert_strenc("\"\xC2\xA1\"", 'EUC-JP', e("%p") % e("\xc2\xa1"))
- #assert_strenc("\"\xC2\xA1\"", 'Windows-31J', s("%p") % s("\xc2\xa1"))
- assert_strenc("\"\xC2\xA1\"", 'UTF-8', u("%p") % u("\xc2\xa1"))
-
- assert_strenc('"\xC2\xA1"', 'ASCII-8BIT', "%10p" % a("\xc2\xa1"))
- assert_strenc(" \"\xC2\xA1\"", 'EUC-JP', "%10p" % e("\xc2\xa1"))
- #assert_strenc(" \"\xC2\xA1\"", 'Windows-31J', "%10p" % s("\xc2\xa1"))
- assert_strenc(" \"\xC2\xA1\"", 'UTF-8', "%10p" % u("\xc2\xa1"))
-
- assert_strenc('"\x00"', 'ASCII-8BIT', a("%p") % a("\x00"))
- assert_strenc('"\x00"', 'EUC-JP', e("%p") % e("\x00"))
- assert_strenc('"\x00"', 'Windows-31J', s("%p") % s("\x00"))
- assert_strenc('"\x00"', 'UTF-8', u("%p") % u("\x00"))
- end
-
- def test_sprintf_s
- assert_strenc('', 'ASCII-8BIT', a("%s") % a(""))
- assert_strenc('', 'EUC-JP', e("%s") % e(""))
- assert_strenc('', 'Windows-31J', s("%s") % s(""))
- assert_strenc('', 'UTF-8', u("%s") % u(""))
-
- assert_strenc('a', 'ASCII-8BIT', a("%s") % a("a"))
- assert_strenc('a', 'EUC-JP', e("%s") % e("a"))
- assert_strenc('a', 'Windows-31J', s("%s") % s("a"))
- assert_strenc('a', 'UTF-8', u("%s") % u("a"))
-
- assert_strenc("\xC2\xA1", 'ASCII-8BIT', a("%s") % a("\xc2\xa1"))
- assert_strenc("\xC2\xA1", 'EUC-JP', e("%s") % e("\xc2\xa1"))
- #assert_strenc("\xC2\xA1", 'Windows-31J', s("%s") % s("\xc2\xa1"))
- assert_strenc("\xC2\xA1", 'UTF-8', u("%s") % u("\xc2\xa1"))
-
- assert_strenc(" \xC2\xA1", 'ASCII-8BIT', "%10s" % a("\xc2\xa1"))
- assert_strenc(" \xA1\xA1", 'EUC-JP', "%10s" % e("\xa1\xa1"))
- #assert_strenc(" \xC2\xA1", 'Windows-31J', "%10s" % s("\xc2\xa1"))
- assert_strenc(" \xC2\xA1", 'UTF-8', "%10s" % u("\xc2\xa1"))
-
- assert_strenc("\x00", 'ASCII-8BIT', a("%s") % a("\x00"))
- assert_strenc("\x00", 'EUC-JP', e("%s") % e("\x00"))
- assert_strenc("\x00", 'Windows-31J', s("%s") % s("\x00"))
- assert_strenc("\x00", 'UTF-8', u("%s") % u("\x00"))
- assert_equal("EUC-JP", (e("\xc2\xa1 %s") % "foo").encoding.name)
- end
-
- def test_str_lt
- assert(a("a") < a("\xa1"))
- assert(a("a") < s("\xa1"))
- assert(s("a") < a("\xa1"))
- end
-
- def test_str_multiply
- str = "\u3042"
- assert_equal(true, (str * 0).ascii_only?, "[ruby-dev:33895]")
- assert_equal(false, (str * 1).ascii_only?)
- assert_equal(false, (str * 2).ascii_only?)
- end
-
- def test_str_aref
- assert_equal(a("\xc2"), a("\xc2\xa1")[0])
- assert_equal(a("\xa1"), a("\xc2\xa1")[1])
- assert_equal(nil, a("\xc2\xa1")[2])
- assert_equal(e("\xc2\xa1"), e("\xc2\xa1")[0])
- assert_equal(nil, e("\xc2\xa1")[1])
- assert_equal(s("\xc2"), s("\xc2\xa1")[0])
- assert_equal(s("\xa1"), s("\xc2\xa1")[1])
- assert_equal(nil, s("\xc2\xa1")[2])
- assert_equal(u("\xc2\xa1"), u("\xc2\xa1")[0])
- assert_equal(nil, u("\xc2\xa1")[1])
-
- str = "\u3042"
- assert_equal(true, str[0, 0].ascii_only?, "[ruby-dev:33895]")
- assert_equal(false, str[0, 1].ascii_only?)
- assert_equal(false, str[0..-1].ascii_only?)
- end
-
- def test_utf8str_aref
- s = "abcdefghijklmnopqrstuvwxyz\u{3042 3044 3046 3048 304A}"
- assert_equal("a", s[0])
- assert_equal("h", s[7])
- assert_equal("i", s[8])
- assert_equal("j", s[9])
- assert_equal("\u{3044}", s[27])
- assert_equal("\u{3046}", s[28])
- assert_equal("\u{3048}", s[29])
- s = "abcdefghijklmnopqrstuvw\u{3042 3044 3046 3048 304A}"
- assert_equal("\u{3044}", s[24])
- end
-
- def test_str_aref_len
- assert_equal(a("\xa1"), a("\xc2\xa1\xc2\xa2\xc2\xa3")[1, 1])
- assert_equal(a("\xa1\xc2"), a("\xc2\xa1\xc2\xa2\xc2\xa3")[1, 2])
-
- assert_equal(e("\xc2\xa2"), e("\xc2\xa1\xc2\xa2\xc2\xa3")[1, 1])
- assert_equal(e("\xc2\xa2\xc2\xa3"), e("\xc2\xa1\xc2\xa2\xc2\xa3")[1, 2])
-
- assert_equal(s("\xa1"), s("\xc2\xa1\xc2\xa2\xc2\xa3")[1, 1])
- assert_equal(s("\xa1\xc2"), s("\xc2\xa1\xc2\xa2\xc2\xa3")[1, 2])
-
- assert_equal(u("\xc2\xa2"), u("\xc2\xa1\xc2\xa2\xc2\xa3")[1, 1])
- assert_equal(u("\xc2\xa2\xc2\xa3"), u("\xc2\xa1\xc2\xa2\xc2\xa3")[1, 2])
- end
-
- def test_str_aref_substr
- assert_equal(a("\xa1\xc2"), a("\xc2\xa1\xc2\xa2\xc2\xa3")[a("\xa1\xc2")])
- assert_raise(Encoding::CompatibilityError) { a("\xc2\xa1\xc2\xa2\xc2\xa3")[e("\xa1\xc2")] }
-
- assert_equal(nil, e("\xc2\xa1\xc2\xa2\xc2\xa3")[e("\xa1\xc2")])
- assert_raise(Encoding::CompatibilityError) { e("\xc2\xa1\xc2\xa2\xc2\xa3")[s("\xa1\xc2")] }
-
- assert_equal(s("\xa1\xc2"), s("\xc2\xa1\xc2\xa2\xc2\xa3")[s("\xa1\xc2")])
- assert_raise(Encoding::CompatibilityError) { s("\xc2\xa1\xc2\xa2\xc2\xa3")[u("\xa1\xc2")] }
-
- assert_equal(nil, u("\xc2\xa1\xc2\xa2\xc2\xa3")[u("\xa1\xc2")])
- assert_raise(Encoding::CompatibilityError) { u("\xc2\xa1\xc2\xa2\xc2\xa3")[a("\xa1\xc2")] }
- assert_nil(e("\xa1\xa2\xa3\xa4")[e("\xa2\xa3")])
- end
-
- def test_aset
- s = e("\xa3\xb0\xa3\xb1\xa3\xb2\xa3\xb3\xa3\xb4")
- assert_raise(Encoding::CompatibilityError){s["\xb0\xa3"] = "foo"}
- end
-
- def test_str_center
- assert_encoding("EUC-JP", "a".center(5, e("\xa1\xa2")).encoding)
- assert_encoding("EUC-JP", e("\xa3\xb0").center(10).encoding)
- end
-
- def test_squeeze
- s = e("\xa3\xb0\xa3\xb1\xa3\xb1\xa3\xb3\xa3\xb4")
- assert_equal(e("\xa3\xb0\xa3\xb1\xa3\xb3\xa3\xb4"), s.squeeze)
- end
-
- def test_tr
- s = s("\x81\x41")
- assert_equal(s.tr("A", "B"), s)
- assert_equal(s.tr_s("A", "B"), s)
-
- assert_nothing_raised {
- "a".force_encoding("ASCII-8BIT").tr(a("a"), a("a"))
- }
-
- assert_equal(e("\xA1\xA1"), a("a").tr(a("a"), e("\xA1\xA1")))
-
- assert_equal("X\u3042\u3044X", "A\u3042\u3044\u3046".tr("^\u3042\u3044", "X"))
- assert_equal("\u3042\u3046" * 100, ("\u3042\u3044" * 100).tr("\u3044", "\u3046"))
- end
-
- def test_tr_s
- assert_equal("\xA1\xA1".force_encoding("EUC-JP"),
- "a".force_encoding("ASCII-8BIT").tr("a".force_encoding("ASCII-8BIT"), "\xA1\xA1".force_encoding("EUC-JP")))
- end
-
- def test_count
- assert_equal(0, e("\xa1\xa2").count("z"))
- s = e("\xa3\xb0\xa3\xb1\xa3\xb2\xa3\xb3\xa3\xb4")
- assert_raise(Encoding::CompatibilityError){s.count(a("\xa3\xb0"))}
- end
-
- def test_delete
- assert_equal(1, e("\xa1\xa2").delete("z").length)
- s = e("\xa3\xb0\xa3\xb1\xa3\xb2\xa3\xb3\xa3\xb4")
- assert_raise(Encoding::CompatibilityError){s.delete(a("\xa3\xb2"))}
-
- a = "\u3042\u3044\u3046\u3042\u3044\u3046"
- a.delete!("\u3042\u3044", "^\u3044")
- assert_equal("\u3044\u3046\u3044\u3046", a)
- end
-
- def test_include?
- assert_equal(false, e("\xa1\xa2\xa3\xa4").include?(e("\xa3")))
- s = e("\xa3\xb0\xa3\xb1\xa3\xb2\xa3\xb3\xa3\xb4")
- assert_equal(false, s.include?(e("\xb0\xa3")))
- end
-
- def test_index
- s = e("\xa3\xb0\xa3\xb1\xa3\xb2\xa3\xb3\xa3\xb4")
- assert_nil(s.index(e("\xb3\xa3")))
- assert_nil(e("\xa1\xa2\xa3\xa4").index(e("\xa3")))
- assert_nil(e("\xa1\xa2\xa3\xa4").rindex(e("\xa3")))
- s = e("\xa3\xb0\xa3\xb1\xa3\xb2\xa3\xb3\xa3\xb4")
- assert_raise(Encoding::CompatibilityError){s.rindex(a("\xb1\xa3"))}
- end
-
- def test_next
- s1 = e("\xa1\xa1")
- s2 = s1.dup
- (94*94+94).times { s2.next! }
- assert_not_equal(s1, s2)
- end
-
- def test_sub
- s = "abc".sub(/b/, "\xa1\xa1".force_encoding("euc-jp"))
- assert_encoding("EUC-JP", s.encoding)
- assert_equal(Encoding::EUC_JP, "\xa4\xa2".force_encoding("euc-jp").sub(/./, '\&').encoding)
- assert_equal(Encoding::EUC_JP, "\xa4\xa2".force_encoding("euc-jp").gsub(/./, '\&').encoding)
- end
-
- def test_sub2
- s = "\x80".force_encoding("ASCII-8BIT")
- r = Regexp.new("\x80".force_encoding("ASCII-8BIT"))
- s2 = s.sub(r, "")
- assert(s2.empty?)
- assert(s2.ascii_only?)
- end
-
- def test_sub3
- repl = "\x81".force_encoding("sjis")
- assert_equal(false, repl.valid_encoding?)
- s = "a@".sub(/a/, repl)
- assert(s.valid_encoding?)
- end
-
- def test_insert
- s = e("\xa3\xb0\xa3\xb1\xa3\xb2\xa3\xb3\xa3\xb4")
- assert_equal(e("\xa3\xb0\xa3\xb1\xa3\xb2\xa3\xb3\xa3\xb4a"), s.insert(-1, "a"))
- end
-
- def test_scan
- assert_equal(["a"], e("\xa1\xa2a\xa3\xa4").scan(/a/))
- end
-
- def test_dup_scan
- s1 = e("\xa4\xa2")*100
- s2 = s1.dup.force_encoding("ascii-8bit")
- s2.scan(/\A./n) {|f|
- assert_equal(Encoding::ASCII_8BIT, f.encoding)
- }
- end
-
- def test_dup_aref
- s1 = e("\xa4\xa2")*100
- s2 = s1.dup.force_encoding("ascii-8bit")
- assert_equal(Encoding::ASCII_8BIT, s2[10..-1].encoding)
- end
-
- def test_upto
- s1 = e("\xa1\xa2")
- s2 = s("\xa1\xa2")
- assert_raise(Encoding::CompatibilityError){s1.upto(s2) {|x| break }}
- end
-
- def test_casecmp
- s1 = s("\x81\x41")
- s2 = s("\x81\x61")
- assert_not_equal(0, s1.casecmp(s2))
- end
-
- def test_reverse
- assert_equal(u("\xf0jihgfedcba"), u("abcdefghij\xf0").reverse)
- end
-
- def test_reverse_bang
- s = u("abcdefghij\xf0")
- s.reverse!
- assert_equal(u("\xf0jihgfedcba"), s)
- end
-
- def test_plus
- assert_raise(Encoding::CompatibilityError){u("\xe3\x81\x82") + a("\xa1")}
- end
-
- def test_chomp
- s = e("\xa3\xb0\xa3\xb1\xa3\xb2\xa3\xb3\xa3\xb4")
- assert_raise(Encoding::CompatibilityError){s.chomp(s("\xa3\xb4"))}
- end
-
- def test_gsub
- s = 'abc'
- s.ascii_only?
- s.gsub!(/b/, "\x80")
- assert_equal(false, s.ascii_only?, "[ruby-core:14566] reported by Sam Ruby")
-
- s = "abc".force_encoding(Encoding::ASCII_8BIT)
- t = s.gsub(/b/, "\xa1\xa1".force_encoding("euc-jp"))
- assert_equal(Encoding::ASCII_8BIT, s.encoding)
-
- assert_raise(Encoding::CompatibilityError) {
- "abc".gsub(/[ac]/) {
- $& == "a" ? "\xc2\xa1".force_encoding("euc-jp") :
- "\xc2\xa1".force_encoding("utf-8")
- }
- }
- s = e("\xa3\xb0\xa3\xb1\xa3\xb2\xa3\xb3\xa3\xb4")
- assert_equal(e("\xa3\xb0z\xa3\xb2\xa3\xb3\xa3\xb4"), s.gsub(/\xa3\xb1/e, "z"))
-
- assert_equal(Encoding::EUC_JP, (a("").gsub(//) { e("") }.encoding))
- assert_equal(Encoding::EUC_JP, (a("a").gsub(/a/) { e("") }.encoding))
- end
-
- def test_end_with
- s1 = s("\x81\x40")
- s2 = "@"
- assert_equal(false, s1.end_with?(s2), "#{encdump s1}.end_with?(#{encdump s2})")
- end
-
- def test_each_line
- s = e("\xa3\xb0\xa3\xb1\xa3\xb2\xa3\xb3\xa3\xb4")
- assert_raise(Encoding::CompatibilityError){s.each_line(a("\xa3\xb1")) {|l| }}
- s = e("\xa4\xa2\nfoo")
-
- actual = []
- s.each_line {|line| actual << line }
- expected = [e("\xa4\xa2\n"), e("foo")]
- assert_equal(expected, actual)
- end
-
- def test_each_char
- a = [e("\xa4\xa2"), "b", e("\xa4\xa4"), "c"]
- s = "\xa4\xa2b\xa4\xa4c".force_encoding("euc-jp")
- assert_equal(a, s.each_char.to_a, "[ruby-dev:33211] #{encdump s}.each_char.to_a")
- end
-
- def test_regexp_match
- assert_equal([0,0], //.match("\xa1\xa1".force_encoding("euc-jp"),-1).offset(0))
- assert_equal(0, // =~ :a)
- end
-
- def test_split
- assert_equal(e("\xa1\xa2\xa1\xa3").split(//),
- [e("\xa1\xa2"), e("\xa1\xa3")],
- '[ruby-dev:32452]')
- end
-
- def test_nonascii_method_name
- eval(e("def \xc2\xa1() @nonascii_method_name = :e end"))
- eval(u("def \xc2\xa1() @nonascii_method_name = :u end"))
- eval(e("\xc2\xa1()"))
- assert_equal(:e, @nonascii_method_name)
- eval(u("\xc2\xa1()"))
- assert_equal(:u, @nonascii_method_name)
- me = method(e("\xc2\xa1"))
- mu = method(u("\xc2\xa1"))
- assert_not_equal(me.name, mu.name)
- assert_not_equal(me.inspect, mu.inspect)
- assert_equal(e("\xc2\xa1"), me.name.to_s)
- assert_equal(u("\xc2\xa1"), mu.name.to_s)
- end
-
- def test_symbol
- s1 = "\xc2\xa1".force_encoding("euc-jp").intern
- s2 = "\xc2\xa1".force_encoding("utf-8").intern
- assert_not_equal(s1, s2)
- end
-
- def test_symbol_op
- ops = %w"
- .. ... + - +(binary) -(binary) * / % ** +@ -@ | ^ & ! <=> > >= < <= ==
- === != =~ !~ ~ ! [] []= << >> :: `
- "
- ops.each do |op|
- assert_equal(Encoding::US_ASCII, op.intern.encoding, "[ruby-dev:33449]")
- end
- end
-
- def test_chr
- 0.upto(255) {|b|
- assert_equal([b].pack("C"), b.chr)
- }
- end
-
- def test_marshal
- s1 = "\xa1\xa1".force_encoding("euc-jp")
- s2 = Marshal.load(Marshal.dump(s1))
- assert_equal(s1, s2)
- end
-
- def test_env
- locale_encoding = Encoding.find("locale")
- ENV.each {|k, v|
- assert_equal(locale_encoding, k.encoding)
- assert_equal(locale_encoding, v.encoding)
- }
- end
-
- def test_empty_string
- assert_equal(Encoding::US_ASCII, "".encoding)
- end
-
- def test_nil_to_s
- assert_equal(Encoding::US_ASCII, nil.to_s.encoding)
- end
-
- def test_nil_inspect
- assert_equal(Encoding::US_ASCII, nil.inspect.encoding)
- end
-
- def test_true_to_s
- assert_equal(Encoding::US_ASCII, true.to_s.encoding)
- end
-
- def test_false_to_s
- assert_equal(Encoding::US_ASCII, false.to_s.encoding)
- end
-
- def test_fixnum_to_s
- assert_equal(Encoding::US_ASCII, 1.to_s.encoding)
- end
-
- def test_float_to_s
- assert_equal(Encoding::US_ASCII, 1.0.to_s.encoding)
- end
-
- def test_bignum_to_s
- assert_equal(Encoding::US_ASCII, (1 << 129).to_s.encoding)
- end
-
- def test_array_to_s
- assert_equal(Encoding::US_ASCII, [].to_s.encoding)
- assert_equal(Encoding::US_ASCII, [nil].to_s.encoding)
- assert_equal(Encoding::US_ASCII, [1].to_s.encoding)
- assert_equal(Encoding::US_ASCII, [""].to_s.encoding)
- assert_equal(Encoding::US_ASCII, ["a"].to_s.encoding)
- assert_equal(Encoding::US_ASCII, [nil,1,"","a","\x20",[]].to_s.encoding)
- end
-
- def test_hash_to_s
- assert_equal(Encoding::US_ASCII, {}.to_s.encoding)
- assert_equal(Encoding::US_ASCII, {1=>nil,"foo"=>""}.to_s.encoding)
- end
-
- def test_encoding_find
- assert_raise(TypeError) {Encoding.find(nil)}
- assert_raise(TypeError) {Encoding.find(0)}
- assert_raise(TypeError) {Encoding.find([])}
- assert_raise(TypeError) {Encoding.find({})}
- end
-
- def test_encoding_to_s
- assert_equal(Encoding::US_ASCII, Encoding::US_ASCII.to_s.encoding)
- assert_equal(Encoding::US_ASCII, Encoding::US_ASCII.inspect.encoding)
- end
-
- def test_regexp_source
- s = "\xa4\xa2".force_encoding("euc-jp")
- r = Regexp.new(s)
- t = r.source
- assert_equal(s, t, "[ruby-dev:33377] Regexp.new(#{encdump s}).source")
- end
-
- def test_magic_comment
- assert_equal(Encoding::US_ASCII, eval("__ENCODING__".force_encoding("US-ASCII")))
- assert_equal(Encoding::ASCII_8BIT, eval("__ENCODING__".force_encoding("ASCII-8BIT")))
- assert_equal(Encoding::US_ASCII, eval("# -*- encoding: US-ASCII -*-\n__ENCODING__".force_encoding("ASCII-8BIT")))
- assert_equal(Encoding::ASCII_8BIT, eval("# -*- encoding: ASCII-8BIT -*-\n__ENCODING__".force_encoding("US-ASCII")))
- end
-
- def test_magic_comment_vim
- assert_equal(Encoding::US_ASCII, eval("# vim: filetype=ruby, fileencoding: US-ASCII, ts=3, sw=3\n__ENCODING__".force_encoding("ASCII-8BIT")))
- assert_equal(Encoding::ASCII_8BIT, eval("# vim: filetype=ruby, fileencoding: ASCII-8BIT, ts=3, sw=3\n__ENCODING__".force_encoding("US-ASCII")))
- end
-
- def test_magic_comment_at_various_positions
- # after shebang
- assert_equal(Encoding::US_ASCII, eval("#!/usr/bin/ruby\n# -*- encoding: US-ASCII -*-\n__ENCODING__".force_encoding("ASCII-8BIT")))
- assert_equal(Encoding::ASCII_8BIT, eval("#!/usr/bin/ruby\n# -*- encoding: ASCII-8BIT -*-\n__ENCODING__".force_encoding("US-ASCII")))
- # wrong position
- assert_equal(Encoding::ASCII_8BIT, eval("\n# -*- encoding: US-ASCII -*-\n__ENCODING__".force_encoding("ASCII-8BIT")))
- assert_equal(Encoding::US_ASCII, eval("\n# -*- encoding: ASCII-8BIT -*-\n__ENCODING__".force_encoding("US-ASCII")))
-
- # leading expressions
- assert_equal(Encoding::ASCII_8BIT, eval("1+1 # -*- encoding: US-ASCII -*-\n__ENCODING__".force_encoding("ASCII-8BIT")))
- assert_equal(Encoding::US_ASCII, eval("1+1 # -*- encoding: ASCII-8BIT -*-\n__ENCODING__".force_encoding("US-ASCII")))
- end
-
- def test_regexp_usascii
- assert_regexp_usascii_literal('//', Encoding::US_ASCII)
- assert_regexp_usascii_literal('/#{}/', Encoding::US_ASCII)
- assert_regexp_usascii_literal('/#{"a"}/', Encoding::US_ASCII)
- assert_regexp_usascii_literal('/#{%q"\x80"}/', Encoding::ASCII_8BIT)
- assert_regexp_usascii_literal('/#{"\x80"}/', nil, SyntaxError)
-
- assert_regexp_usascii_literal('/a/', Encoding::US_ASCII)
- assert_regexp_usascii_literal('/a#{}/', Encoding::US_ASCII)
- assert_regexp_usascii_literal('/a#{"a"}/', Encoding::US_ASCII)
- assert_regexp_usascii_literal('/a#{%q"\x80"}/', Encoding::ASCII_8BIT)
- assert_regexp_usascii_literal('/a#{"\x80"}/', nil, SyntaxError)
-
- assert_regexp_usascii_literal('/\x80/', Encoding::ASCII_8BIT)
- assert_regexp_usascii_literal('/\x80#{}/', Encoding::ASCII_8BIT)
- assert_regexp_usascii_literal('/\x80#{"a"}/', Encoding::ASCII_8BIT)
- assert_regexp_usascii_literal('/\x80#{%q"\x80"}/', Encoding::ASCII_8BIT)
- assert_regexp_usascii_literal('/\x80#{"\x80"}/', nil, SyntaxError)
-
- assert_regexp_usascii_literal('/\u1234/', Encoding::UTF_8)
- assert_regexp_usascii_literal('/\u1234#{}/', Encoding::UTF_8)
- assert_regexp_usascii_literal('/\u1234#{"a"}/', Encoding::UTF_8)
- assert_regexp_usascii_literal('/\u1234#{%q"\x80"}/', nil, SyntaxError)
- assert_regexp_usascii_literal('/\u1234#{"\x80"}/', nil, SyntaxError)
- assert_regexp_usascii_literal('/\u1234\x80/', nil, SyntaxError)
- assert_regexp_usascii_literal('/\u1234#{}\x80/', nil, ArgumentError)
- end
-
- def test_gbk
- assert_equal("", "\x81\x40".force_encoding("GBK").chop)
- end
-
- def test_euc_tw
- assert_equal("a", "a\x8e\xa2\xa1\xa1".force_encoding("euc-tw").chop)
- end
-
- def test_valid_encoding
- s = "\xa1".force_encoding("euc-jp")
- assert_equal(false, s.valid_encoding?)
- assert_equal(true, (s+s).valid_encoding?, "[ruby-dev:33826]")
- assert_equal(true, (s*2).valid_encoding?, "[ruby-dev:33826]")
- assert_equal(true, ("%s%s" % [s, s]).valid_encoding?)
- assert_equal(true, (s.dup << s).valid_encoding?)
- assert_equal(true, "".center(2, s).valid_encoding?)
-
- s = "\xa1\xa1\x8f".force_encoding("euc-jp")
- assert_equal(false, s.valid_encoding?)
- assert_equal(true, s.reverse.valid_encoding?)
- end
-
- def test_getbyte
- assert_equal(0x82, u("\xE3\x81\x82\xE3\x81\x84").getbyte(2))
- assert_equal(0x82, u("\xE3\x81\x82\xE3\x81\x84").getbyte(-4))
- assert_nil(u("\xE3\x81\x82\xE3\x81\x84").getbyte(100))
- end
-
- def test_setbyte
- s = u("\xE3\x81\x82\xE3\x81\x84")
- s.setbyte(2, 0x84)
- assert_equal(u("\xE3\x81\x84\xE3\x81\x84"), s)
-
- s = u("\xE3\x81\x82\xE3\x81\x84")
- assert_raise(IndexError) { s.setbyte(100, 0) }
-
- s = u("\xE3\x81\x82\xE3\x81\x84")
- s.setbyte(-4, 0x84)
- assert_equal(u("\xE3\x81\x84\xE3\x81\x84"), s)
- end
-
- def test_compatible
- assert_nil Encoding.compatible?("",0)
- assert_equal(Encoding::UTF_8, Encoding.compatible?(Encoding::UTF_8, Encoding::UTF_8))
- assert_equal(Encoding::UTF_8, Encoding.compatible?(Encoding::UTF_8, Encoding::US_ASCII))
- assert_equal(Encoding::ASCII_8BIT,
- Encoding.compatible?(Encoding::ASCII_8BIT, Encoding::US_ASCII))
- assert_nil Encoding.compatible?(Encoding::UTF_8, Encoding::ASCII_8BIT)
- end
-
- def test_force_encoding
- assert(("".center(1, "\x80".force_encoding("utf-8")); true),
- "moved from btest/knownbug, [ruby-dev:33807]")
- a = "".force_encoding("ascii-8bit") << 0xC3 << 0xB6
- assert_equal(1, a.force_encoding("utf-8").size, '[ruby-core:22437]')
- b = "".force_encoding("ascii-8bit") << 0xC3.chr << 0xB6.chr
- assert_equal(1, b.force_encoding("utf-8").size, '[ruby-core:22437]')
- end
-
- def test_combchar_codepoint
- assert_equal([0x30BB, 0x309A], "\u30BB\u309A".codepoints.to_a)
- end
-end
diff --git a/test/ruby/test_m17n_comb.rb b/test/ruby/test_m17n_comb.rb
deleted file mode 100644
index 2d43a56ab2..0000000000
--- a/test/ruby/test_m17n_comb.rb
+++ /dev/null
@@ -1,1634 +0,0 @@
-require 'test/unit'
-require 'stringio'
-require_relative 'allpairs'
-
-class TestM17NComb < Test::Unit::TestCase
- def assert_encoding(encname, actual, message=nil)
- assert_equal(Encoding.find(encname), actual, message)
- end
-
- module AESU
- def a(str) str.dup.force_encoding("ASCII-8BIT") end
- def e(str) str.dup.force_encoding("EUC-JP") end
- def s(str) str.dup.force_encoding("Shift_JIS") end
- def u(str) str.dup.force_encoding("UTF-8") end
- end
- include AESU
- extend AESU
-
- def assert_strenc(bytes, enc, actual, message=nil)
- assert_instance_of(String, actual, message)
- enc = Encoding.find(enc) if String === enc
- assert_equal(enc, actual.encoding, message)
- assert_equal(a(bytes), a(actual), message)
- end
-
- def assert_warning(pat, mesg=nil)
- begin
- org_stderr = $stderr
- $stderr = StringIO.new(warn = '')
- yield
- ensure
- $stderr = org_stderr
- end
- assert_match(pat, warn, mesg)
- end
-
- def assert_regexp_generic_encoding(r)
- assert(!r.fixed_encoding?)
- %w[ASCII-8BIT EUC-JP Shift_JIS UTF-8].each {|ename|
- # "\xc2\xa1" is a valid sequence for ASCII-8BIT, EUC-JP, Shift_JIS and UTF-8.
- assert_nothing_raised { r =~ "\xc2\xa1".force_encoding(ename) }
- }
- end
-
- def assert_regexp_fixed_encoding(r)
- assert(r.fixed_encoding?)
- %w[ASCII-8BIT EUC-JP Shift_JIS UTF-8].each {|ename|
- enc = Encoding.find(ename)
- if enc == r.encoding
- assert_nothing_raised { r =~ "\xc2\xa1".force_encoding(enc) }
- else
- assert_raise(ArgumentError) { r =~ "\xc2\xa1".force_encoding(enc) }
- end
- }
- end
-
- def assert_regexp_generic_ascii(r)
- assert_encoding("ASCII-8BIT", r.encoding)
- assert_regexp_generic_encoding(r)
- end
-
- def assert_regexp_fixed_ascii8bit(r)
- assert_encoding("ASCII-8BIT", r.encoding)
- assert_regexp_fixed_encoding(r)
- end
-
- def assert_regexp_fixed_eucjp(r)
- assert_encoding("EUC-JP", r.encoding)
- assert_regexp_fixed_encoding(r)
- end
-
- def assert_regexp_fixed_sjis(r)
- assert_encoding("Shift_JIS", r.encoding)
- assert_regexp_fixed_encoding(r)
- end
-
- def assert_regexp_fixed_utf8(r)
- assert_encoding("UTF-8", r.encoding)
- assert_regexp_fixed_encoding(r)
- end
-
- STRINGS = [
- a(""), e(""), s(""), u(""),
- a("a"), e("a"), s("a"), u("a"),
- a("."), e("."), s("."), u("."),
-
- # single character
- a("\x80"), a("\xff"),
- e("\xa1\xa1"), e("\xfe\xfe"),
- e("\x8e\xa1"), e("\x8e\xfe"),
- e("\x8f\xa1\xa1"), e("\x8f\xfe\xfe"),
- s("\x81\x40"), s("\xfc\xfc"),
- s("\xa1"), s("\xdf"),
- u("\xc2\x80"), u("\xf4\x8f\xbf\xbf"),
-
- # same byte sequence
- a("\xc2\xa1"), e("\xc2\xa1"), s("\xc2\xa1"), u("\xc2\xa1"),
-
- s("\x81A"), # mutibyte character which contains "A"
- s("\x81a"), # mutibyte character which contains "a"
-
- # invalid
- e("\xa1"), e("\x80"),
- s("\x81"), s("\x80"),
- u("\xc2"), u("\x80"),
-
- # for transitivity test
- u("\xe0\xa0\xa1"), e("\xe0\xa0\xa1"), s("\xe0\xa0\xa1"), # [ruby-dev:32693]
- e("\xa1\xa1"), a("\xa1\xa1"), s("\xa1\xa1"), # [ruby-dev:36484]
-
- #"aa".force_encoding("utf-16be"),
- #"aaaa".force_encoding("utf-32be"),
- #"aaa".force_encoding("utf-32be"),
- ]
-
- def combination(*args, &b)
- AllPairs.each(*args, &b)
- #AllPairs.exhaustive_each(*args, &b)
- end
-
- def encdump(str)
- d = str.dump
- if /\.force_encoding\("[A-Za-z0-9.:_+-]*"\)\z/ =~ d
- d
- else
- "#{d}.force_encoding(#{str.encoding.name.dump})"
- end
- end
-
- def encdumpargs(args)
- r = '('
- args.each_with_index {|a, i|
- r << ',' if 0 < i
- if String === a
- r << encdump(a)
- else
- r << a.inspect
- end
- }
- r << ')'
- r
- end
-
- def enccall(recv, meth, *args, &block)
- desc = ''
- if String === recv
- desc << encdump(recv)
- else
- desc << recv.inspect
- end
- desc << '.' << meth.to_s
- if !args.empty?
- desc << '('
- args.each_with_index {|a, i|
- desc << ',' if 0 < i
- if String === a
- desc << encdump(a)
- else
- desc << a.inspect
- end
- }
- desc << ')'
- end
- if block
- desc << ' {}'
- end
- result = nil
- assert_nothing_raised(desc) {
- result = recv.send(meth, *args, &block)
- }
- result
- end
-
- def assert_str_enc_propagation(t, s1, s2)
- if !s1.ascii_only?
- assert_equal(s1.encoding, t.encoding)
- elsif !s2.ascii_only?
- assert_equal(s2.encoding, t.encoding)
- else
- assert([s1.encoding, s2.encoding].include?(t.encoding))
- end
- end
-
- def assert_same_result(expected_proc, actual_proc)
- e = nil
- begin
- t = expected_proc.call
- rescue
- e = $!
- end
- if e
- assert_raise(e.class) { actual_proc.call }
- else
- assert_equal(t, actual_proc.call)
- end
- end
-
- def each_slice_call
- combination(STRINGS, -2..2) {|s, nth|
- yield s, nth
- }
- combination(STRINGS, -2..2, 0..2) {|s, nth, len|
- yield s, nth, len
- }
- combination(STRINGS, STRINGS) {|s, substr|
- yield s, substr
- }
- combination(STRINGS, -2..2, 0..2) {|s, first, last|
- yield s, first..last
- yield s, first...last
- }
- combination(STRINGS, STRINGS) {|s1, s2|
- if !s2.valid_encoding?
- next
- end
- yield s1, Regexp.new(Regexp.escape(s2))
- }
- combination(STRINGS, STRINGS, 0..2) {|s1, s2, nth|
- if !s2.valid_encoding?
- next
- end
- yield s1, Regexp.new(Regexp.escape(s2)), nth
- }
- end
-
- ASCII_INCOMPATIBLE_ENCODINGS = %w[
- UTF-16BE
- UTF-16LE
- UTF-32BE
- UTF-32LE
- ]
- def str_enc_compatible?(*strs)
- encs = []
- ascii_incompatible_encodings = {}
- has_ascii_compatible = false
- strs.each {|s|
- encs << s.encoding if !s.ascii_only?
- if /\A#{Regexp.union ASCII_INCOMPATIBLE_ENCODINGS}\z/o =~ s.encoding.name
- ascii_incompatible_encodings[s.encoding] = true
- else
- has_ascii_compatible = true
- end
- }
- if ascii_incompatible_encodings.empty?
- encs.uniq!
- encs.length <= 1
- else
- !has_ascii_compatible && ascii_incompatible_encodings.size == 1
- end
- end
-
- # tests start
-
- def test_str_new
- STRINGS.each {|s|
- t = String.new(s)
- assert_strenc(a(s), s.encoding, t)
- }
- end
-
- def test_str_plus
- combination(STRINGS, STRINGS) {|s1, s2|
- if s1.encoding != s2.encoding && !s1.ascii_only? && !s2.ascii_only?
- assert_raise(Encoding::CompatibilityError) { s1 + s2 }
- else
- t = enccall(s1, :+, s2)
- assert(t.valid_encoding?) if s1.valid_encoding? && s2.valid_encoding?
- assert_equal(a(s1) + a(s2), a(t))
- assert_str_enc_propagation(t, s1, s2)
- end
- }
- end
-
- def test_str_times
- STRINGS.each {|s|
- [0,1,2].each {|n|
- t = s * n
- assert(t.valid_encoding?) if s.valid_encoding?
- assert_strenc(a(s) * n, s.encoding, t)
- }
- }
- end
-
- def test_sprintf_s
- STRINGS.each {|s|
- assert_strenc(a(s), s.encoding, "%s".force_encoding(s.encoding) % s)
- if !s.empty? # xxx
- t = enccall(a("%s"), :%, s)
- assert_strenc(a(s), s.encoding, t)
- end
- }
- end
-
- def test_str_eq_reflexive
- STRINGS.each {|s|
- assert(s == s, "#{encdump s} == #{encdump s}")
- }
- end
-
- def test_str_eq_symmetric
- combination(STRINGS, STRINGS) {|s1, s2|
- if s1 == s2
- assert(s2 == s1, "#{encdump s2} == #{encdump s1}")
- else
- assert(!(s2 == s1), "!(#{encdump s2} == #{encdump s1})")
- end
- }
- end
-
- def test_str_eq_transitive
- combination(STRINGS, STRINGS, STRINGS) {|s1, s2, s3|
- if s1 == s2 && s2 == s3
- assert(s1 == s3, "transitive: #{encdump s1} == #{encdump s2} == #{encdump s3}")
- end
- }
- end
-
- def test_str_eq
- combination(STRINGS, STRINGS) {|s1, s2|
- desc_eq = "#{encdump s1} == #{encdump s2}"
- if a(s1) == a(s2) and
- (s1.ascii_only? && s2.ascii_only? or
- s1.encoding == s2.encoding) then
- assert(s1 == s2, desc_eq)
- assert(!(s1 != s2))
- assert_equal(0, s1 <=> s2)
- assert(s1.eql?(s2), desc_eq)
- else
- assert(!(s1 == s2), "!(#{desc_eq})")
- assert(s1 != s2)
- assert_not_equal(0, s1 <=> s2)
- assert(!s1.eql?(s2))
- end
- }
- end
-
- def test_str_concat
- combination(STRINGS, STRINGS) {|s1, s2|
- s = s1.dup
- if s1.ascii_only? || s2.ascii_only? || s1.encoding == s2.encoding
- s << s2
- assert(s.valid_encoding?) if s1.valid_encoding? && s2.valid_encoding?
- assert_equal(a(s), a(s1) + a(s2))
- assert_str_enc_propagation(s, s1, s2)
- else
- assert_raise(Encoding::CompatibilityError) { s << s2 }
- end
- }
- end
-
- def test_str_aref
- STRINGS.each {|s|
- t = ''.force_encoding(s.encoding)
- 0.upto(s.length-1) {|i|
- u = s[i]
- assert(u.valid_encoding?) if s.valid_encoding?
- t << u
- }
- assert_equal(t, s)
- }
- end
-
- def test_str_aref_len
- STRINGS.each {|s|
- t = ''.force_encoding(s.encoding)
- 0.upto(s.length-1) {|i|
- u = s[i,1]
- assert(u.valid_encoding?) if s.valid_encoding?
- t << u
- }
- assert_equal(t, s)
- }
-
- STRINGS.each {|s|
- t = ''.force_encoding(s.encoding)
- 0.step(s.length-1, 2) {|i|
- u = s[i,2]
- assert(u.valid_encoding?) if s.valid_encoding?
- t << u
- }
- assert_equal(t, s)
- }
- end
-
- def test_str_aref_substr
- combination(STRINGS, STRINGS) {|s1, s2|
- if s1.ascii_only? || s2.ascii_only? || s1.encoding == s2.encoding
- t = enccall(s1, :[], s2)
- if t != nil
- assert(t.valid_encoding?) if s1.valid_encoding? && s2.valid_encoding?
- assert_equal(s2, t)
- assert_match(/#{Regexp.escape(a(s2))}/, a(s1))
- if s1.valid_encoding?
- assert_match(/#{Regexp.escape(s2)}/, s1)
- end
- end
- else
- assert_raise(Encoding::CompatibilityError) { s1[s2] }
- end
- }
- end
-
- def test_str_aref_range2
- combination(STRINGS, -2..2, -2..2) {|s, first, last|
- desc = "#{encdump s}[#{first}..#{last}]"
- t = s[first..last]
- if first < 0
- first += s.length
- if first < 0
- assert_nil(t, desc)
- next
- end
- end
- if s.length < first
- assert_nil(t, desc)
- next
- end
- assert(t.valid_encoding?) if s.valid_encoding?
- if last < 0
- last += s.length
- end
- t2 = ''
- first.upto(last) {|i|
- c = s[i]
- t2 << c if c
- }
- assert_equal(t2, t, desc)
- }
- end
-
- def test_str_aref_range3
- combination(STRINGS, -2..2, -2..2) {|s, first, last|
- desc = "#{encdump s}[#{first}..#{last}]"
- t = s[first...last]
- if first < 0
- first += s.length
- if first < 0
- assert_nil(t, desc)
- next
- end
- end
- if s.length < first
- assert_nil(t, desc)
- next
- end
- if last < 0
- last += s.length
- end
- assert(t.valid_encoding?) if s.valid_encoding?
- t2 = ''
- first.upto(last-1) {|i|
- c = s[i]
- t2 << c if c
- }
- assert_equal(t2, t, desc)
- }
- end
-
- def test_str_assign
- combination(STRINGS, STRINGS) {|s1, s2|
- (-2).upto(2) {|i|
- t = s1.dup
- if s1.ascii_only? || s2.ascii_only? || s1.encoding == s2.encoding
- if i < -s1.length || s1.length < i
- assert_raise(IndexError) { t[i] = s2 }
- else
- t[i] = s2
- assert(t.valid_encoding?) if s1.valid_encoding? && s2.valid_encoding?
- assert(a(t).index(a(s2)))
- if s1.valid_encoding? && s2.valid_encoding?
- if i == s1.length && s2.empty?
- assert_nil(t[i])
- elsif i < 0
- assert_equal(s2, t[i-s2.length+1,s2.length],
- "t = #{encdump(s1)}; t[#{i}] = #{encdump(s2)}; t[#{i-s2.length+1},#{s2.length}]")
- else
- assert_equal(s2, t[i,s2.length],
- "t = #{encdump(s1)}; t[#{i}] = #{encdump(s2)}; t[#{i},#{s2.length}]")
- end
- end
- end
- else
- assert_raise(Encoding::CompatibilityError) { t[i] = s2 }
- end
- }
- }
- end
-
- def test_str_assign_len
- combination(STRINGS, -2..2, 0..2, STRINGS) {|s1, i, len, s2|
- t = s1.dup
- if s1.ascii_only? || s2.ascii_only? || s1.encoding == s2.encoding
- if i < -s1.length || s1.length < i
- assert_raise(IndexError) { t[i,len] = s2 }
- else
- assert(t.valid_encoding?) if s1.valid_encoding? && s2.valid_encoding?
- t[i,len] = s2
- assert(a(t).index(a(s2)))
- if s1.valid_encoding? && s2.valid_encoding?
- if i == s1.length && s2.empty?
- assert_nil(t[i])
- elsif i < 0
- if -i < len
- len = -i
- end
- assert_equal(s2, t[i-s2.length+len,s2.length],
- "t = #{encdump(s1)}; t[#{i},#{len}] = #{encdump(s2)}; t[#{i-s2.length+len},#{s2.length}]")
- else
- assert_equal(s2, t[i,s2.length],
- "t = #{encdump(s1)}; t[#{i},#{len}] = #{encdump(s2)}; t[#{i},#{s2.length}]")
- end
- end
- end
- else
- assert_raise(Encoding::CompatibilityError) { t[i,len] = s2 }
- end
- }
- end
-
- def test_str_assign_substr
- combination(STRINGS, STRINGS, STRINGS) {|s1, s2, s3|
- t = s1.dup
- encs = [
- !s1.ascii_only? ? s1.encoding : nil,
- !s2.ascii_only? ? s2.encoding : nil,
- !s3.ascii_only? ? s3.encoding : nil].uniq.compact
- if 1 < encs.length
- assert_raise(Encoding::CompatibilityError, IndexError) { t[s2] = s3 }
- else
- if encs.empty?
- encs = [
- s1.encoding,
- s2.encoding,
- s3.encoding].uniq.reject {|e| e == Encoding.find("ASCII-8BIT") }
- if encs.empty?
- encs = [Encoding.find("ASCII-8BIT")]
- end
- end
- if !t[s2]
- else
- enccall(t, :[]=, s2, s3)
- assert(t.valid_encoding?) if s1.valid_encoding? && s2.valid_encoding? && s3.valid_encoding?
- end
- end
- }
- end
-
- def test_str_assign_range2
- combination(STRINGS, -2..2, -2..2, STRINGS) {|s1, first, last, s2|
- t = s1.dup
- if s1.ascii_only? || s2.ascii_only? || s1.encoding == s2.encoding
- if first < -s1.length || s1.length < first
- assert_raise(RangeError) { t[first..last] = s2 }
- else
- enccall(t, :[]=, first..last, s2)
- assert(t.valid_encoding?) if s1.valid_encoding? && s2.valid_encoding?
- assert(a(t).index(a(s2)))
- if s1.valid_encoding? && s2.valid_encoding?
- if first < 0
- assert_equal(s2, t[s1.length+first, s2.length])
- else
- assert_equal(s2, t[first, s2.length])
- end
- end
- end
- else
- assert_raise(Encoding::CompatibilityError, RangeError,
- "t=#{encdump(s1)};t[#{first}..#{last}]=#{encdump(s2)}") {
- t[first..last] = s2
- }
- end
- }
- end
-
- def test_str_assign_range3
- combination(STRINGS, -2..2, -2..2, STRINGS) {|s1, first, last, s2|
- t = s1.dup
- if s1.ascii_only? || s2.ascii_only? || s1.encoding == s2.encoding
- if first < -s1.length || s1.length < first
- assert_raise(RangeError) { t[first...last] = s2 }
- else
- enccall(t, :[]=, first...last, s2)
- assert(t.valid_encoding?) if s1.valid_encoding? && s2.valid_encoding?
- assert(a(t).index(a(s2)))
- if s1.valid_encoding? && s2.valid_encoding?
- if first < 0
- assert_equal(s2, t[s1.length+first, s2.length])
- else
- assert_equal(s2, t[first, s2.length])
- end
- end
- end
- else
- assert_raise(Encoding::CompatibilityError, RangeError,
- "t=#{encdump(s1)};t[#{first}...#{last}]=#{encdump(s2)}") {
- t[first...last] = s2
- }
- end
- }
- end
-
- def test_str_cmp
- combination(STRINGS, STRINGS) {|s1, s2|
- desc = "#{encdump s1} <=> #{encdump s2}"
- r = s1 <=> s2
- if s1 == s2
- assert_equal(0, r, desc)
- else
- assert_not_equal(0, r, desc)
- end
- }
- end
-
- def test_str_capitalize
- STRINGS.each {|s|
- begin
- t1 = s.capitalize
- rescue ArgumentError
- assert(!s.valid_encoding?)
- next
- end
- assert(t1.valid_encoding?) if s.valid_encoding?
- assert(t1.casecmp(s))
- t2 = s.dup
- t2.capitalize!
- assert_equal(t1, t2)
- r = s.downcase
- r = enccall(r, :sub, /\A[a-z]/) {|ch| a(ch).upcase }
- assert_equal(r, t1)
- }
- end
-
- def test_str_casecmp
- combination(STRINGS, STRINGS) {|s1, s2|
- #puts "#{encdump(s1)}.casecmp(#{encdump(s2)})"
- begin
- r = s1.casecmp(s2)
- rescue ArgumentError
- assert(!s1.valid_encoding? || !s2.valid_encoding?)
- next
- end
- #assert_equal(s1.upcase <=> s2.upcase, r)
- }
- end
-
- def test_str_center
- combination(STRINGS, [0,1,2,3,10]) {|s1, width|
- t = s1.center(width)
- assert(a(t).index(a(s1)))
- }
- combination(STRINGS, [0,1,2,3,10], STRINGS) {|s1, width, s2|
- if s2.empty?
- assert_raise(ArgumentError) { s1.center(width, s2) }
- next
- end
- if !s1.ascii_only? && !s2.ascii_only? && s1.encoding != s2.encoding
- assert_raise(Encoding::CompatibilityError) { s1.center(width, s2) }
- next
- end
- t = enccall(s1, :center, width, s2)
- assert(t.valid_encoding?) if s1.valid_encoding? && s2.valid_encoding?
- assert(a(t).index(a(s1)))
- assert_str_enc_propagation(t, s1, s2) if (t != s1)
- }
- end
-
- def test_str_ljust
- combination(STRINGS, [0,1,2,3,10]) {|s1, width|
- t = s1.ljust(width)
- assert(a(t).index(a(s1)))
- }
- combination(STRINGS, [0,1,2,3,10], STRINGS) {|s1, width, s2|
- if s2.empty?
- assert_raise(ArgumentError) { s1.ljust(width, s2) }
- next
- end
- if !s1.ascii_only? && !s2.ascii_only? && s1.encoding != s2.encoding
- assert_raise(Encoding::CompatibilityError) { s1.ljust(width, s2) }
- next
- end
- t = enccall(s1, :ljust, width, s2)
- assert(t.valid_encoding?) if s1.valid_encoding? && s2.valid_encoding?
- assert(a(t).index(a(s1)))
- assert_str_enc_propagation(t, s1, s2) if (t != s1)
- }
- end
-
- def test_str_rjust
- combination(STRINGS, [0,1,2,3,10]) {|s1, width|
- t = s1.rjust(width)
- assert(a(t).index(a(s1)))
- }
- combination(STRINGS, [0,1,2,3,10], STRINGS) {|s1, width, s2|
- if s2.empty?
- assert_raise(ArgumentError) { s1.rjust(width, s2) }
- next
- end
- if !s1.ascii_only? && !s2.ascii_only? && s1.encoding != s2.encoding
- assert_raise(Encoding::CompatibilityError) { s1.rjust(width, s2) }
- next
- end
- t = enccall(s1, :rjust, width, s2)
- assert(t.valid_encoding?) if s1.valid_encoding? && s2.valid_encoding?
- assert(a(t).index(a(s1)))
- assert_str_enc_propagation(t, s1, s2) if (t != s1)
- }
- end
-
- def test_str_chomp
- combination(STRINGS, STRINGS) {|s1, s2|
- if !s1.ascii_only? && !s2.ascii_only? && !Encoding.compatible?(s1,s2)
- if s1.bytesize > s2.bytesize
- assert_raise(Encoding::CompatibilityError) { s1.chomp(s2) }
- end
- next
- end
- t = enccall(s1, :chomp, s2)
- assert(t.valid_encoding?, "#{encdump(s1)}.chomp(#{encdump(s2)})") if s1.valid_encoding? && s2.valid_encoding?
- assert_equal(s1.encoding, t.encoding)
- t2 = s1.dup
- t2.chomp!(s2)
- assert_equal(t, t2)
- }
- end
-
- def test_str_chop
- STRINGS.each {|s|
- s = s.dup
- desc = "#{encdump s}.chop"
- if !s.valid_encoding?
- #assert_raise(ArgumentError, desc) { s.chop }
- begin
- s.chop
- rescue ArgumentError
- e = $!
- end
- next if e
- end
- t = nil
- assert_nothing_raised(desc) { t = s.chop }
- assert(t.valid_encoding?) if s.valid_encoding?
- assert(a(s).index(a(t)))
- t2 = s.dup
- t2.chop!
- assert_equal(t, t2)
- }
- end
-
- def test_str_clear
- STRINGS.each {|s|
- t = s.dup
- t.clear
- assert(t.valid_encoding?)
- assert(t.empty?)
- }
- end
-
- def test_str_clone
- STRINGS.each {|s|
- t = s.clone
- assert_equal(s, t)
- assert_equal(s.encoding, t.encoding)
- assert_equal(a(s), a(t))
- }
- end
-
- def test_str_dup
- STRINGS.each {|s|
- t = s.dup
- assert_equal(s, t)
- assert_equal(s.encoding, t.encoding)
- assert_equal(a(s), a(t))
- }
- end
-
- def test_str_count
- combination(STRINGS, STRINGS) {|s1, s2|
- if !s1.valid_encoding? || !s2.valid_encoding?
- assert_raise(ArgumentError, Encoding::CompatibilityError) { s1.count(s2) }
- next
- end
- if !s1.ascii_only? && !s2.ascii_only? && s1.encoding != s2.encoding
- assert_raise(Encoding::CompatibilityError) { s1.count(s2) }
- next
- end
- n = enccall(s1, :count, s2)
- n0 = a(s1).count(a(s2))
- assert_operator(n, :<=, n0)
- }
- end
-
- def test_str_crypt
- combination(STRINGS, STRINGS) {|str, salt|
- if a(salt).length < 2
- assert_raise(ArgumentError) { str.crypt(salt) }
- next
- end
- t = str.crypt(salt)
- assert_equal(a(str).crypt(a(salt)), t, "#{encdump(str)}.crypt(#{encdump(salt)})")
- assert_encoding('ASCII-8BIT', t.encoding)
- }
- end
-
- def test_str_delete
- combination(STRINGS, STRINGS) {|s1, s2|
- if s1.empty?
- assert_equal(s1, s1.delete(s2))
- next
- end
- if !s1.valid_encoding? || !s2.valid_encoding?
- assert_raise(ArgumentError, Encoding::CompatibilityError) { s1.delete(s2) }
- next
- end
- if !s1.ascii_only? && !s2.ascii_only? && s1.encoding != s2.encoding
- assert_raise(Encoding::CompatibilityError) { s1.delete(s2) }
- next
- end
- t = enccall(s1, :delete, s2)
- assert(t.valid_encoding?)
- assert_equal(t.encoding, s1.encoding)
- assert_operator(t.length, :<=, s1.length)
- t2 = s1.dup
- t2.delete!(s2)
- assert_equal(t, t2)
- }
- end
-
- def test_str_downcase
- STRINGS.each {|s|
- if !s.valid_encoding?
- assert_raise(ArgumentError) { s.downcase }
- next
- end
- t = s.downcase
- assert(t.valid_encoding?)
- assert_equal(t.encoding, s.encoding)
- assert(t.casecmp(s))
- t2 = s.dup
- t2.downcase!
- assert_equal(t, t2)
- }
- end
-
- def test_str_dump
- STRINGS.each {|s|
- t = s.dump
- assert(t.valid_encoding?)
- assert(t.ascii_only?)
- u = eval(t)
- assert_equal(a(s), a(u))
- }
- end
-
- def test_str_each_line
- combination(STRINGS, STRINGS) {|s1, s2|
- if !s1.valid_encoding? || !s2.valid_encoding?
- assert_raise(ArgumentError, Encoding::CompatibilityError) { s1.each_line(s2) {} }
- next
- end
- if !s1.ascii_only? && !s2.ascii_only? && s1.encoding != s2.encoding
- assert_raise(Encoding::CompatibilityError) { s1.each_line(s2) {} }
- next
- end
- lines = []
- enccall(s1, :each_line, s2) {|line|
- assert(line.valid_encoding?)
- assert_equal(s1.encoding, line.encoding)
- lines << line
- }
- next if lines.size == 0
- s2 = lines.join('')
- assert_equal(s1.encoding, s2.encoding)
- assert_equal(s1, s2)
- }
- end
-
- def test_str_each_byte
- STRINGS.each {|s|
- bytes = []
- s.each_byte {|b|
- bytes << b
- }
- a(s).split(//).each_with_index {|ch, i|
- assert_equal(ch.ord, bytes[i])
- }
- }
- end
-
- def test_str_empty?
- STRINGS.each {|s|
- if s.length == 0
- assert(s.empty?)
- else
- assert(!s.empty?)
- end
- }
- end
-
- def test_str_hex
- STRINGS.each {|s|
- t = s.hex
- t2 = a(s)[/\A[0-9a-fA-Fx]*/].hex
- assert_equal(t2, t)
- }
- end
-
- def test_str_include?
- combination(STRINGS, STRINGS) {|s1, s2|
- if !s1.ascii_only? && !s2.ascii_only? && s1.encoding != s2.encoding
- assert_raise(Encoding::CompatibilityError) { s1.include?(s2) }
- assert_raise(Encoding::CompatibilityError) { s1.index(s2) }
- assert_raise(Encoding::CompatibilityError) { s1.rindex(s2) }
- next
- end
- t = enccall(s1, :include?, s2)
- if t
- assert(a(s1).include?(a(s2)))
- assert(s1.index(s2))
- assert(s1.rindex(s2))
- else
- assert(!s1.index(s2))
- assert(!s1.rindex(s2), "!#{encdump(s1)}.rindex(#{encdump(s2)})")
- end
- if s2.empty?
- assert_equal(true, t)
- next
- end
- if !s1.valid_encoding? || !s2.valid_encoding?
- assert_equal(false, t, "#{encdump s1}.include?(#{encdump s2})")
- next
- end
- if t && s1.valid_encoding? && s2.valid_encoding?
- assert_match(/#{Regexp.escape(s2)}/, s1)
- else
- assert_no_match(/#{Regexp.escape(s2)}/, s1)
- end
- }
- end
-
- def test_str_index
- combination(STRINGS, STRINGS, -2..2) {|s1, s2, pos|
- if !s1.ascii_only? && !s2.ascii_only? && s1.encoding != s2.encoding
- assert_raise(Encoding::CompatibilityError) { s1.index(s2) }
- next
- end
- t = enccall(s1, :index, s2, pos)
- if s2.empty?
- if pos < 0 && pos+s1.length < 0
- assert_equal(nil, t, "#{encdump s1}.index(#{encdump s2}, #{pos})");
- elsif pos < 0
- assert_equal(s1.length+pos, t, "#{encdump s1}.index(#{encdump s2}, #{pos})");
- elsif s1.length < pos
- assert_equal(nil, t, "#{encdump s1}.index(#{encdump s2}, #{pos})");
- else
- assert_equal(pos, t, "#{encdump s1}.index(#{encdump s2}, #{pos})");
- end
- next
- end
- if !s1.valid_encoding? || !s2.valid_encoding?
- assert_equal(nil, t, "#{encdump s1}.index(#{encdump s2}, #{pos})");
- next
- end
- if t
- re = /#{Regexp.escape(s2)}/
- assert(re.match(s1, pos))
- assert_equal($`.length, t, "#{encdump s1}.index(#{encdump s2}, #{pos})")
- else
- assert_no_match(/#{Regexp.escape(s2)}/, s1[pos..-1])
- end
- }
- end
-
- def test_str_rindex
- combination(STRINGS, STRINGS, -2..2) {|s1, s2, pos|
- if !s1.ascii_only? && !s2.ascii_only? && s1.encoding != s2.encoding
- assert_raise(Encoding::CompatibilityError) { s1.rindex(s2) }
- next
- end
- t = enccall(s1, :rindex, s2, pos)
- if s2.empty?
- if pos < 0 && pos+s1.length < 0
- assert_equal(nil, t, "#{encdump s1}.rindex(#{encdump s2}, #{pos})")
- elsif pos < 0
- assert_equal(s1.length+pos, t, "#{encdump s1}.rindex(#{encdump s2}, #{pos})")
- elsif s1.length < pos
- assert_equal(s1.length, t, "#{encdump s1}.rindex(#{encdump s2}, #{pos})")
- else
- assert_equal(pos, t, "#{encdump s1}.rindex(#{encdump s2}, #{pos})")
- end
- next
- end
- if !s1.valid_encoding? || !s2.valid_encoding?
- assert_equal(nil, t, "#{encdump s1}.rindex(#{encdump s2}, #{pos})")
- next
- end
- if t
- #puts "#{encdump s1}.rindex(#{encdump s2}, #{pos}) => #{t}"
- assert(a(s1).index(a(s2)))
- pos2 = pos
- pos2 += s1.length if pos < 0
- re = /\A(.{0,#{pos2}})#{Regexp.escape(s2)}/m
- m = enccall(re, :match, s1)
- assert(m, "#{re.inspect}.match(#{encdump(s1)})")
- assert_equal(m[1].length, t, "#{encdump s1}.rindex(#{encdump s2}, #{pos})")
- else
- re = /#{Regexp.escape(s2)}/
- n = re =~ s1
- if n
- if pos < 0
- assert_operator(n, :>, s1.length+pos)
- else
- assert_operator(n, :>, pos)
- end
- end
- end
- }
- end
-
- def test_str_insert
- combination(STRINGS, 0..2, STRINGS) {|s1, nth, s2|
- t1 = s1.dup
- t2 = s1.dup
- begin
- t1[nth, 0] = s2
- rescue Encoding::CompatibilityError, IndexError => e1
- end
- begin
- t2.insert(nth, s2)
- rescue Encoding::CompatibilityError, IndexError => e2
- end
- assert_equal(t1, t2, "t=#{encdump s1}; t.insert(#{nth},#{encdump s2}); t")
- assert_equal(e1.class, e2.class, "begin #{encdump s1}.insert(#{nth},#{encdump s2}); rescue ArgumentError, IndexError => e; e end")
- }
- combination(STRINGS, -2..-1, STRINGS) {|s1, nth, s2|
- next if s1.length + nth < 0
- next unless s1.valid_encoding?
- next unless s2.valid_encoding?
- t1 = s1.dup
- begin
- t1.insert(nth, s2)
- slen = s2.length
- assert_equal(t1[nth-slen+1,slen], s2, "t=#{encdump s1}; t.insert(#{nth},#{encdump s2}); t")
- rescue Encoding::CompatibilityError, IndexError => e
- end
- }
- end
-
- def test_str_intern
- STRINGS.each {|s|
- if /\0/ =~ a(s)
- assert_raise(ArgumentError) { s.intern }
- else
- sym = s.intern
- assert_equal(s, sym.to_s, "#{encdump s}.intern.to_s")
- assert_equal(sym, s.to_sym)
- end
- }
- end
-
- def test_str_length
- STRINGS.each {|s|
- assert_operator(s.length, :<=, s.bytesize)
- }
- end
-
- def test_str_oct
- STRINGS.each {|s|
- t = s.oct
- t2 = a(s)[/\A[0-9a-fA-FxXbB]*/].oct
- assert_equal(t2, t)
- }
- end
-
- def test_str_replace
- combination(STRINGS, STRINGS) {|s1, s2|
- t = s1.dup
- t.replace s2
- assert_equal(s2, t)
- assert_equal(s2.encoding, t.encoding)
- }
- end
-
- def test_str_reverse
- STRINGS.each {|s|
- t = s.reverse
- assert_equal(s.bytesize, t.bytesize)
- if !s.valid_encoding?
- assert_operator(t.length, :<=, s.length)
- next
- end
- assert_equal(s, t.reverse)
- }
- end
-
- def test_str_scan
- combination(STRINGS, STRINGS) {|s1, s2|
- if !s2.valid_encoding?
- assert_raise(RegexpError) { s1.scan(s2) }
- next
- end
- if !s1.ascii_only? && !s2.ascii_only? && s1.encoding != s2.encoding
- if s1.valid_encoding?
- assert_raise(Encoding::CompatibilityError) { s1.scan(s2) }
- else
- assert_raise(ArgumentError, /invalid byte sequence/) { s1.scan(s2) }
- end
- next
- end
- if !s1.valid_encoding?
- assert_raise(ArgumentError) { s1.scan(s2) }
- next
- end
- r = enccall(s1, :scan, s2)
- r.each {|t|
- assert_equal(s2, t)
- }
- }
- end
-
- def test_str_slice
- each_slice_call {|obj, *args|
- assert_same_result(lambda { obj[*args] }, lambda { obj.slice(*args) })
- }
- end
-
- def test_str_slice!
- each_slice_call {|s, *args|
- desc_slice = "#{encdump s}.slice#{encdumpargs args}"
- desc_slice_bang = "#{encdump s}.slice!#{encdumpargs args}"
- t = s.dup
- begin
- r = t.slice!(*args)
- rescue
- e = $!
- end
- if e
- assert_raise(e.class, desc_slice) { s.slice(*args) }
- next
- end
- if !r
- assert_nil(s.slice(*args), desc_slice)
- next
- end
- assert_equal(s.slice(*args), r, desc_slice_bang)
- assert_equal(s.bytesize, r.bytesize + t.bytesize)
- if args.length == 1 && String === args[0]
- assert_equal(args[0].encoding, r.encoding,
- "#{encdump s}.slice!#{encdumpargs args}.encoding")
- else
- assert_equal(s.encoding, r.encoding,
- "#{encdump s}.slice!#{encdumpargs args}.encoding")
- end
- if [s, *args].all? {|o| !(String === o) || o.valid_encoding? }
- assert(r.valid_encoding?)
- assert(t.valid_encoding?)
- assert_equal(s.length, r.length + t.length)
- end
- }
- end
-
- def test_str_split
- combination(STRINGS, STRINGS) {|s1, s2|
- if !s2.valid_encoding?
- assert_raise(ArgumentError, RegexpError) { s1.split(s2) }
- next
- end
- if !s1.ascii_only? && !s2.ascii_only? && s1.encoding != s2.encoding
- assert_raise(ArgumentError, Encoding::CompatibilityError) { s1.split(s2) }
- next
- end
- if !s1.valid_encoding?
- assert_raise(ArgumentError) { s1.split(s2) }
- next
- end
- t = enccall(s1, :split, s2)
- t.each {|r|
- assert(a(s1).include?(a(r)))
- assert_equal(s1.encoding, r.encoding)
- }
- assert(a(s1).include?(t.map {|u| a(u) }.join(a(s2))))
- if s1.valid_encoding? && s2.valid_encoding?
- t.each {|r|
- assert(r.valid_encoding?)
- }
- end
- }
- end
-
- def test_str_squeeze
- combination(STRINGS, STRINGS) {|s1, s2|
- if !s1.valid_encoding? || !s2.valid_encoding?
- assert_raise(ArgumentError, Encoding::CompatibilityError, "#{encdump s1}.squeeze(#{encdump s2})") { s1.squeeze(s2) }
- next
- end
- if !s1.ascii_only? && !s2.ascii_only? && s1.encoding != s2.encoding
- assert_raise(Encoding::CompatibilityError) { s1.squeeze(s2) }
- next
- end
- t = enccall(s1, :squeeze, s2)
- assert_operator(t.length, :<=, s1.length)
- t2 = s1.dup
- t2.squeeze!(s2)
- assert_equal(t, t2)
- }
- end
-
- def test_str_strip
- STRINGS.each {|s|
- if !s.valid_encoding?
- assert_raise(ArgumentError, "#{encdump s}.strip") { s.strip }
- next
- end
- t = s.strip
- l = s.lstrip
- r = s.rstrip
- assert_operator(l.length, :<=, s.length)
- assert_operator(r.length, :<=, s.length)
- assert_operator(t.length, :<=, l.length)
- assert_operator(t.length, :<=, r.length)
- t2 = s.dup
- t2.strip!
- assert_equal(t, t2)
- l2 = s.dup
- l2.lstrip!
- assert_equal(l, l2)
- r2 = s.dup
- r2.rstrip!
- assert_equal(r, r2)
- }
- end
-
- def test_str_sum
- STRINGS.each {|s|
- assert_equal(a(s).sum, s.sum)
- }
- end
-
- def test_str_swapcase
- STRINGS.each {|s|
- if !s.valid_encoding?
- assert_raise(ArgumentError, "#{encdump s}.swapcase") { s.swapcase }
- next
- end
- t1 = s.swapcase
- assert(t1.valid_encoding?) if s.valid_encoding?
- assert(t1.casecmp(s))
- t2 = s.dup
- t2.swapcase!
- assert_equal(t1, t2)
- t3 = t1.swapcase
- assert_equal(s, t3);
- }
- end
-
-
- def test_str_to_f
- STRINGS.each {|s|
- assert_nothing_raised { s.to_f }
- }
- end
-
- def test_str_to_i
- STRINGS.each {|s|
- assert_nothing_raised { s.to_i }
- 2.upto(36) {|radix|
- assert_nothing_raised { s.to_i(radix) }
- }
- }
- end
-
- def test_str_to_s
- STRINGS.each {|s|
- assert_same(s, s.to_s)
- assert_same(s, s.to_str)
- }
- end
-
- def test_tr
- combination(STRINGS, STRINGS, STRINGS) {|s1, s2, s3|
- desc = "#{encdump s1}.tr(#{encdump s2}, #{encdump s3})"
- if s1.empty?
- assert_equal(s1, s1.tr(s2, s3), desc)
- next
- end
- if !str_enc_compatible?(s1, s2, s3)
- assert_raise(Encoding::CompatibilityError, desc) { s1.tr(s2, s3) }
- next
- end
- if !s1.valid_encoding?
- assert_raise(ArgumentError, desc) { s1.tr(s2, s3) }
- next
- end
- if s2.empty?
- t = enccall(s1, :tr, s2, s3)
- assert_equal(s1, t, desc)
- next
- end
- if !s2.valid_encoding? || !s3.valid_encoding?
- assert_raise(ArgumentError, desc) { s1.tr(s2, s3) }
- next
- end
- t = enccall(s1, :tr, s2, s3)
- assert_operator(s1.length, :>=, t.length, desc)
- }
- end
-
- def test_tr_s
- combination(STRINGS, STRINGS, STRINGS) {|s1, s2, s3|
- desc = "#{encdump s1}.tr_s(#{encdump s2}, #{encdump s3})"
- if s1.empty?
- assert_equal(s1, s1.tr_s(s2, s3), desc)
- next
- end
- if !s1.valid_encoding?
- assert_raise(ArgumentError, Encoding::CompatibilityError, desc) { s1.tr_s(s2, s3) }
- next
- end
- if !str_enc_compatible?(s1, s2, s3)
- assert_raise(Encoding::CompatibilityError, desc) { s1.tr(s2, s3) }
- next
- end
- if s2.empty?
- t = enccall(s1, :tr_s, s2, s3)
- assert_equal(s1, t, desc)
- next
- end
- if !s2.valid_encoding? || !s3.valid_encoding?
- assert_raise(ArgumentError, desc) { s1.tr_s(s2, s3) }
- next
- end
-
- t = enccall(s1, :tr_s, s2, s3)
- assert_operator(s1.length, :>=, t.length, desc)
- }
- end
-
- def test_str_upcase
- STRINGS.each {|s|
- desc = "#{encdump s}.upcase"
- if !s.valid_encoding?
- assert_raise(ArgumentError, desc) { s.upcase }
- next
- end
- t1 = s.upcase
- assert(t1.valid_encoding?)
- assert(t1.casecmp(s))
- t2 = s.dup
- t2.upcase!
- assert_equal(t1, t2)
- }
- end
-
- def test_str_succ
- STRINGS.each {|s0|
- next if s0.empty?
- s = s0.dup
- n = 1000
- h = {}
- n.times {|i|
- if h[s]
- assert(false, "#{encdump s} cycle with succ #{i-h[s]} times")
- end
- h[s] = i
- assert_operator(s.length, :<=, s0.length + Math.log2(i+1) + 1, "#{encdump s0} succ #{i} times => #{encdump s}")
- #puts encdump(s)
- t = s.succ
- if s.valid_encoding?
- assert(t.valid_encoding?, "#{encdump s}.succ.valid_encoding?")
- end
- s = t
- }
- }
- end
-
- def test_str_hash
- combination(STRINGS, STRINGS) {|s1, s2|
- if s1.eql?(s2)
- assert_equal(s1.hash, s2.hash, "#{encdump s1}.hash == #{encdump s2}.dump")
- end
- }
- end
-
- def test_marshal
- STRINGS.each {|s|
- m = Marshal.dump(s)
- t = Marshal.load(m)
- assert_equal(s, t)
- }
- end
-
- def test_str_sub
- combination(STRINGS, STRINGS, STRINGS) {|s1, s2, s3|
- if !s2.valid_encoding?
- assert_raise(RegexpError) { Regexp.new(Regexp.escape(s2)) }
- next
- end
- r2 = Regexp.new(Regexp.escape(s2))
- [
- [
- "#{encdump s1}.sub(Regexp.new(#{encdump s2}), #{encdump s3})",
- lambda { s1.sub(r2, s3) },
- false
- ],
- [
- "#{encdump s1}.sub(Regexp.new(#{encdump s2}), #{encdump s3})",
- lambda { s1.sub(r2) { s3 } },
- false
- ],
- [
- "#{encdump s1}.gsub(Regexp.new(#{encdump s2}), #{encdump s3})",
- lambda { s1.gsub(r2, s3) },
- true
- ],
- [
- "#{encdump s1}.gsub(Regexp.new(#{encdump s2}), #{encdump s3})",
- lambda { s1.gsub(r2) { s3 } },
- true
- ]
- ].each {|desc, doit, g|
- if !s1.valid_encoding?
- assert_raise(ArgumentError, desc) { doit.call }
- next
- end
- if !str_enc_compatible?(s1, s2)
- assert_raise(Encoding::CompatibilityError, desc) { doit.call }
- next
- end
- if !enccall(s1, :include?, s2)
- assert_equal(s1, doit.call)
- next
- end
- if !str_enc_compatible?(g ? s1.gsub(r2, '') : s1.sub(r2, ''), s3)
- assert_raise(Encoding::CompatibilityError, desc) { doit.call }
- next
- end
- t = nil
- assert_nothing_raised(desc) {
- t = doit.call
- }
- if s2 == s3
- assert_equal(s1, t, desc)
- else
- assert_not_equal(s1, t, desc)
- end
- }
- }
- end
-
- def test_str_sub!
- combination(STRINGS, STRINGS, STRINGS) {|s1, s2, s3|
- if !s2.valid_encoding?
- assert_raise(RegexpError) { Regexp.new(Regexp.escape(s2)) }
- next
- end
- r2 = Regexp.new(Regexp.escape(s2))
- [
- [
- "t=#{encdump s1}.dup;t.sub!(Regexp.new(#{encdump s2}), #{encdump s3})",
- lambda { t=s1.dup; [t, t.sub!(r2, s3)] },
- false
- ],
- [
- "t=#{encdump s1}.dup;t.sub!(Regexp.new(#{encdump s2}), #{encdump s3})",
- lambda { t=s1.dup; [t, t.sub!(r2) { s3 }] },
- false
- ],
- [
- "t=#{encdump s1}.dup;t.gsub!(Regexp.new(#{encdump s2}), #{encdump s3})",
- lambda { t=s1.dup; [t, t.gsub!(r2, s3)] },
- true
- ],
- [
- "t=#{encdump s1}.dup;t.gsub!(Regexp.new(#{encdump s2}), #{encdump s3})",
- lambda { t=s1.dup; [t, t.gsub!(r2) { s3 }] },
- true
- ]
- ].each {|desc, doit, g|
- if !s1.valid_encoding?
- assert_raise(ArgumentError, desc) { doit.call }
- next
- end
- if !str_enc_compatible?(s1, s2)
- assert_raise(Encoding::CompatibilityError, desc) { doit.call }
- next
- end
- if !enccall(s1, :include?, s2)
- assert_equal([s1, nil], doit.call)
- next
- end
- if !str_enc_compatible?(g ? s1.gsub(r2, '') : s1.sub(r2, ''), s3)
- assert_raise(Encoding::CompatibilityError, desc) { doit.call }
- next
- end
- t = ret = nil
- assert_nothing_raised(desc) {
- t, ret = doit.call
- }
- assert(ret)
- if s2 == s3
- assert_equal(s1, t, desc)
- else
- assert_not_equal(s1, t, desc)
- end
- }
- }
- end
-
- def test_str_bytes
- STRINGS.each {|s1|
- ary = []
- s1.bytes.each {|b|
- ary << b
- }
- assert_equal(s1.unpack("C*"), ary)
- }
- end
-
- def test_str_bytesize
- STRINGS.each {|s1|
- assert_equal(s1.unpack("C*").length, s1.bytesize)
- }
- end
-
- def test_str_chars
- STRINGS.each {|s1|
- ary = []
- s1.chars.each {|c|
- ary << c
- }
- expected = []
- s1.length.times {|i|
- expected << s1[i]
- }
- assert_equal(expected, ary)
- }
- end
-
- def test_str_chr
- STRINGS.each {|s1|
- if s1.empty?
- assert_equal("", s1.chr)
- next
- end
- assert_equal(s1[0], s1.chr)
- }
- end
-
- def test_str_end_with?
- combination(STRINGS, STRINGS) {|s1, s2|
- desc = "#{encdump s1}.end_with?(#{encdump s2})"
- if !str_enc_compatible?(s1, s2)
- assert_raise(Encoding::CompatibilityError, desc) { s1.end_with?(s2) }
- next
- end
- if s1.length < s2.length
- assert_equal(false, enccall(s1, :end_with?, s2), desc)
- next
- end
- if s1[s1.length-s2.length, s2.length] == s2
- assert_equal(true, enccall(s1, :end_with?, s2), desc)
- next
- end
- assert_equal(false, enccall(s1, :end_with?, s2), desc)
- }
- end
-
- def test_str_start_with?
- combination(STRINGS, STRINGS) {|s1, s2|
- desc = "#{encdump s1}.start_with?(#{encdump s2})"
- if !str_enc_compatible?(s1, s2)
- assert_raise(Encoding::CompatibilityError, desc) { s1.start_with?(s2) }
- next
- end
- s1 = s1.dup.force_encoding("ASCII-8BIT")
- s2 = s2.dup.force_encoding("ASCII-8BIT")
- if s1.length < s2.length
- assert_equal(false, enccall(s1, :start_with?, s2), desc)
- next
- end
- if s1[0, s2.length] == s2
- assert_equal(true, enccall(s1, :start_with?, s2), desc)
- next
- end
- assert_equal(false, enccall(s1, :start_with?, s2), desc)
- }
- end
-
- def test_str_ord
- STRINGS.each {|s1|
- if s1.empty?
- assert_raise(ArgumentError) { s1.ord }
- next
- end
- if !s1.valid_encoding?
- assert_raise(ArgumentError) { s1.ord }
- next
- end
- assert_equal(s1[0].ord, s1.ord)
- }
- end
-
- def test_str_partition
- combination(STRINGS, STRINGS) {|s1, s2|
- desc = "#{encdump s1}.partition(#{encdump s2})"
- if !str_enc_compatible?(s1, s2)
- assert_raise(Encoding::CompatibilityError, desc) { s1.partition(s2) }
- next
- end
- i = enccall(s1, :index, s2)
- if !i
- assert_equal([s1, "", ""], s1.partition(s2), desc)
- next
- end
- assert_equal([s1[0,i], s2, s1[(i+s2.length)..-1]], s1.partition(s2), desc)
- }
- end
-
- def test_str_rpartition
- combination(STRINGS, STRINGS) {|s1, s2|
- desc = "#{encdump s1}.rpartition(#{encdump s2})"
- if !str_enc_compatible?(s1, s2)
- assert_raise(Encoding::CompatibilityError, desc) { s1.rpartition(s2) }
- next
- end
- i = enccall(s1, :rindex, s2)
- if !i
- assert_equal(["", "", s1], s1.rpartition(s2), desc)
- next
- end
- assert_equal([s1[0,i], s2, s1[(i+s2.length)..-1]], s1.rpartition(s2), desc)
- }
- end
-
-end
diff --git a/test/ruby/test_marshal.rb b/test/ruby/test_marshal.rb
index 268acf2a32..68f50ff728 100644
--- a/test/ruby/test_marshal.rb
+++ b/test/ruby/test_marshal.rb
@@ -1,24 +1,28 @@
require 'test/unit'
-require_relative 'marshaltestlib'
+dir = File.dirname(File.expand_path(__FILE__))
+orgpath = $:.dup
+begin
+ $:.push(dir)
+ require 'marshaltestlib'
+ensure
+ $:.replace(orgpath)
+end
class TestMarshal < Test::Unit::TestCase
include MarshalTestLib
- def setup
- @verbose = $VERBOSE
- $VERBOSE = nil
- end
-
- def teardown
- $VERBOSE = @verbose
- end
-
def encode(o)
+ stress, GC.stress = GC.stress, true
Marshal.dump(o)
+ ensure
+ GC.stress = stress
end
def decode(s)
+ stress, GC.stress = GC.stress, true
Marshal.load(s)
+ ensure
+ GC.stress = stress
end
def fact(n)
@@ -31,34 +35,20 @@ class TestMarshal < Test::Unit::TestCase
return f
end
- def test_marshal
- x = [1, 2, 3, [4,5,"foo"], {1=>"bar"}, 2.5, fact(30)]
- assert_equal x, Marshal.load(Marshal.dump(x))
+ StrClone=String.clone;
- [[1,2,3,4], [81, 2, 118, 3146]].each { |w,x,y,z|
- obj = (x.to_f + y.to_f / z.to_f) * Math.exp(w.to_f / (x.to_f + y.to_f / z.to_f))
- assert_equal obj, Marshal.load(Marshal.dump(obj))
- }
- end
+ def test_marshal
+ $x = [1,2,3,[4,5,"foo"],{1=>"bar"},2.5,fact(30)]
+ $y = Marshal.dump($x)
+ assert_equal($x, Marshal.load($y))
- StrClone = String.clone
- def test_marshal_cloned_class
assert_instance_of(StrClone, Marshal.load(Marshal.dump(StrClone.new("abc"))))
- end
-
- def test_inconsistent_struct
- TestMarshal.const_set :StructOrNot, Struct.new(:a)
- s = Marshal.dump(StructOrNot.new(1))
- TestMarshal.instance_eval { remove_const :StructOrNot }
- TestMarshal.const_set :StructOrNot, Class.new
- assert_raise(TypeError, "[ruby-dev:31709]") { Marshal.load(s) }
- end
- def test_struct_invalid_members
- TestMarshal.const_set :StructInvalidMembers, Struct.new(:a)
- Marshal.load("\004\bIc&TestMarshal::StructInvalidMembers\006:\020__members__\"\bfoo")
- assert_raise(TypeError, "[ruby-dev:31759]") {
- TestMarshal::StructInvalidMembers.members
+ [[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)
+ assert_equal(a, b)
}
end
@@ -66,7 +56,6 @@ class TestMarshal < Test::Unit::TestCase
def initialize(str)
@str = str
end
- attr_reader :str
def _dump(limit)
@str
end
@@ -76,120 +65,10 @@ class TestMarshal < Test::Unit::TestCase
end
def test_too_long_string
- data = Marshal.dump(C.new("a".force_encoding("ascii-8bit")))
- data[-2, 1] = "\003\377\377\377"
+ (data = Marshal.dump(C.new("a")))[-2, 1] = "\003\377\377\377"
e = assert_raise(ArgumentError, "[ruby-dev:32054]") {
Marshal.load(data)
}
assert_equal("marshal data too short", e.message)
end
-
-
- def test_userdef_encoding
- s1 = "\xa4\xa4".force_encoding("euc-jp")
- o1 = C.new(s1)
- m = Marshal.dump(o1)
- o2 = Marshal.load(m)
- s2 = o2.str
- assert_equal(s1, s2)
- end
-
- def test_pipe
- o1 = C.new("a" * 10000)
-
- r, w = IO.pipe
- t = Thread.new { Marshal.load(r) }
- Marshal.dump(o1, w)
- o2 = t.value
- assert_equal(o1.str, o2.str)
-
- r, w = IO.pipe
- t = Thread.new { Marshal.load(r) }
- Marshal.dump(o1, w, 2)
- o2 = t.value
- assert_equal(o1.str, o2.str)
-
- assert_raise(TypeError) { Marshal.dump("foo", Object.new) }
- assert_raise(TypeError) { Marshal.load(Object.new) }
- end
-
- def test_limit
- assert_equal([[[]]], Marshal.load(Marshal.dump([[[]]], 3)))
- assert_raise(ArgumentError) { Marshal.dump([[[]]], 2) }
- assert_nothing_raised(ArgumentError, '[ruby-core:24100]') { Marshal.dump("\u3042", 1) }
- end
-
- def test_userdef_invalid
- o = C.new(nil)
- assert_raise(TypeError) { Marshal.dump(o) }
- end
-
- def test_class
- o = class << Object.new; self; end
- assert_raise(TypeError) { Marshal.dump(o) }
- assert_equal(Object, Marshal.load(Marshal.dump(Object)))
- assert_equal(Enumerable, Marshal.load(Marshal.dump(Enumerable)))
- end
-
- class C2
- def initialize(ary)
- @ary = ary
- end
- def _dump(s)
- @ary.clear
- "foo"
- end
- end
-
- def test_modify_array_during_dump
- a = []
- o = C2.new(a)
- a << o << nil
- assert_raise(RuntimeError) { Marshal.dump(a) }
- end
-
- def test_change_class_name
- eval("class C3; def _dump(s); 'foo'; end; end")
- m = Marshal.dump(C3.new)
- assert_raise(TypeError) { Marshal.load(m) }
- eval("C3 = nil")
- assert_raise(TypeError) { Marshal.load(m) }
- end
-
- def test_change_struct
- eval("C3 = Struct.new(:foo, :bar)")
- m = Marshal.dump(C3.new("FOO", "BAR"))
- eval("C3 = Struct.new(:foo)")
- assert_raise(TypeError) { Marshal.load(m) }
- eval("C3 = Struct.new(:foo, :baz)")
- assert_raise(TypeError) { Marshal.load(m) }
- end
-
- class C4
- def initialize(gc)
- @gc = gc
- end
- def _dump(s)
- GC.start if @gc
- "foo"
- end
- end
-
- def test_gc
- assert_nothing_raised do
- Marshal.dump((0..1000).map {|x| C4.new(x % 50 == 25) })
- end
- end
-
- def test_taint_and_untrust
- x = Object.new
- x.taint
- x.untrust
- s = Marshal.dump(x)
- assert_equal(true, s.tainted?)
- assert_equal(true, s.untrusted?)
- y = Marshal.load(s)
- assert_equal(true, y.tainted?)
- assert_equal(true, y.untrusted?)
- end
end
diff --git a/test/ruby/test_math.rb b/test/ruby/test_math.rb
index d4dbf9dbf0..e1e49dba01 100644
--- a/test/ruby/test_math.rb
+++ b/test/ruby/test_math.rb
@@ -1,240 +1,12 @@
require 'test/unit'
class TestMath < Test::Unit::TestCase
- def check(a, b)
- err = [Float::EPSILON * 4, [a.abs, b.abs].max * Float::EPSILON * 256].max
- assert_in_delta(a, b, err)
- end
-
- def test_atan2
- check(0, Math.atan2(0, 1))
- check(Math::PI / 4, Math.atan2(1, 1))
- check(Math::PI / 2, Math.atan2(1, 0))
- end
-
- def test_cos
- check(1.0, Math.cos(0 * Math::PI / 4))
- check(1.0 / Math.sqrt(2), Math.cos(1 * Math::PI / 4))
- check(0.0, Math.cos(2 * Math::PI / 4))
- check(-1.0, Math.cos(4 * Math::PI / 4))
- check(0.0, Math.cos(6 * Math::PI / 4))
- end
-
- def test_sin
- check(0.0, Math.sin(0 * Math::PI / 4))
- check(1.0 / Math.sqrt(2), Math.sin(1 * Math::PI / 4))
- check(1.0, Math.sin(2 * Math::PI / 4))
- check(0.0, Math.sin(4 * Math::PI / 4))
- check(-1.0, Math.sin(6 * Math::PI / 4))
- end
-
- def test_tan
- check(0.0, Math.tan(0 * Math::PI / 4))
- check(1.0, Math.tan(1 * Math::PI / 4))
- assert(Math.tan(2 * Math::PI / 4).abs > 1024)
- check(0.0, Math.tan(4 * Math::PI / 4))
- assert(Math.tan(6 * Math::PI / 4).abs > 1024)
- end
-
- def test_acos
- check(0 * Math::PI / 4, Math.acos( 1.0))
- check(1 * Math::PI / 4, Math.acos( 1.0 / Math.sqrt(2)))
- check(2 * Math::PI / 4, Math.acos( 0.0))
- check(4 * Math::PI / 4, Math.acos(-1.0))
- assert_raise(Errno::EDOM, Errno::ERANGE) { Math.acos(2.0) }
- end
-
- def test_asin
- check( 0 * Math::PI / 4, Math.asin( 0.0))
- check( 1 * Math::PI / 4, Math.asin( 1.0 / Math.sqrt(2)))
- check( 2 * Math::PI / 4, Math.asin( 1.0))
- check(-2 * Math::PI / 4, Math.asin(-1.0))
- assert_raise(Errno::EDOM, Errno::ERANGE) { Math.asin(2.0) }
- end
-
- def test_atan
- check( 0 * Math::PI / 4, Math.atan( 0.0))
- check( 1 * Math::PI / 4, Math.atan( 1.0))
- check( 2 * Math::PI / 4, Math.atan(1.0 / 0.0))
- check(-1 * Math::PI / 4, Math.atan(-1.0))
- end
-
- def test_cosh
- check(1, Math.cosh(0))
- check((Math::E ** 1 + Math::E ** -1) / 2, Math.cosh(1))
- check((Math::E ** 2 + Math::E ** -2) / 2, Math.cosh(2))
- end
-
- def test_sinh
- check(0, Math.sinh(0))
- check((Math::E ** 1 - Math::E ** -1) / 2, Math.sinh(1))
- check((Math::E ** 2 - Math::E ** -2) / 2, Math.sinh(2))
- end
-
- def test_tanh
- check(Math.sinh(0) / Math.cosh(0), Math.tanh(0))
- check(Math.sinh(1) / Math.cosh(1), Math.tanh(1))
- check(Math.sinh(2) / Math.cosh(2), Math.tanh(2))
- end
-
- def test_acosh
- check(0, Math.acosh(1))
- check(1, Math.acosh((Math::E ** 1 + Math::E ** -1) / 2))
- check(2, Math.acosh((Math::E ** 2 + Math::E ** -2) / 2))
- assert_raise(Errno::EDOM, Errno::ERANGE) { Math.acosh(0) }
- end
-
- def test_asinh
- check(0, Math.asinh(0))
- check(1, Math.asinh((Math::E ** 1 - Math::E ** -1) / 2))
- check(2, Math.asinh((Math::E ** 2 - Math::E ** -2) / 2))
- end
-
- def test_atanh
- check(0, Math.atanh(Math.sinh(0) / Math.cosh(0)))
- check(1, Math.atanh(Math.sinh(1) / Math.cosh(1)))
- check(2, Math.atanh(Math.sinh(2) / Math.cosh(2)))
- assert_raise(Errno::EDOM, Errno::ERANGE) { Math.atanh(-1) }
- end
-
- def test_exp
- check(1, Math.exp(0))
- check(Math.sqrt(Math::E), Math.exp(0.5))
- check(Math::E, Math.exp(1))
- check(Math::E ** 2, Math.exp(2))
- end
-
- def test_log
- check(0, Math.log(1))
- check(1, Math.log(Math::E))
- check(0, Math.log(1, 10))
- check(1, Math.log(10, 10))
- check(2, Math.log(100, 10))
- assert_equal(1.0/0, Math.log(1.0/0))
- assert_raise(Errno::EDOM, Errno::ERANGE) { Math.log(0) }
- assert_raise(Errno::EDOM, Errno::ERANGE) { Math.log(-1) }
- assert_raise(TypeError) { Math.log(1,nil) }
- end
-
- def test_log2
- check(0, Math.log2(1))
- check(1, Math.log2(2))
- check(2, Math.log2(4))
- assert_equal(1.0/0, Math.log2(1.0/0))
- assert_raise(Errno::EDOM, Errno::ERANGE) { Math.log2(0) }
- assert_raise(Errno::EDOM, Errno::ERANGE) { Math.log2(-1) }
- end
-
- def test_log10
- check(0, Math.log10(1))
- check(1, Math.log10(10))
- check(2, Math.log10(100))
- assert_equal(1.0/0, Math.log10(1.0/0))
- assert_raise(Errno::EDOM, Errno::ERANGE) { Math.log10(0) }
- assert_raise(Errno::EDOM, Errno::ERANGE) { Math.log10(-1) }
- end
-
- def test_sqrt
- check(0, Math.sqrt(0))
- check(1, Math.sqrt(1))
- check(2, Math.sqrt(4))
- assert_equal(1.0/0, Math.sqrt(1.0/0))
- assert_raise(Errno::EDOM, Errno::ERANGE) { Math.sqrt(-1) }
- end
-
- def test_frexp
- check(0.0, Math.frexp(0.0).first)
- assert_equal(0, Math.frexp(0).last)
- check(0.5, Math.frexp(0.5).first)
- assert_equal(0, Math.frexp(0.5).last)
- check(0.5, Math.frexp(1.0).first)
- assert_equal(1, Math.frexp(1.0).last)
- check(0.5, Math.frexp(2.0).first)
- assert_equal(2, Math.frexp(2.0).last)
- check(0.75, Math.frexp(3.0).first)
- assert_equal(2, Math.frexp(3.0).last)
- end
-
- def test_ldexp
- check(0.0, Math.ldexp(0.0, 0.0))
- check(0.5, Math.ldexp(0.5, 0.0))
- check(1.0, Math.ldexp(0.5, 1.0))
- check(2.0, Math.ldexp(0.5, 2.0))
- check(3.0, Math.ldexp(0.75, 2.0))
- end
-
- def test_hypot
- check(5, Math.hypot(3, 4))
- end
-
- def test_erf
- check(0, Math.erf(0))
- check(1, Math.erf(1.0 / 0.0))
- end
-
- def test_erfc
- check(1, Math.erfc(0))
- check(0, Math.erfc(1.0 / 0.0))
- end
-
- def test_gamma
- sqrt_pi = Math.sqrt(Math::PI)
- check(4 * sqrt_pi / 3, Math.gamma(-1.5))
- check(-2 * sqrt_pi, Math.gamma(-0.5))
- check(sqrt_pi, Math.gamma(0.5))
- check(1, Math.gamma(1))
- check(sqrt_pi / 2, Math.gamma(1.5))
- check(1, Math.gamma(2))
- check(3 * sqrt_pi / 4, Math.gamma(2.5))
- check(2, Math.gamma(3))
- check(15 * sqrt_pi / 8, Math.gamma(3.5))
- check(6, Math.gamma(4))
- end
-
- def test_lgamma
- sqrt_pi = Math.sqrt(Math::PI)
-
- g, s = Math.lgamma(-1.5)
- check(Math.log(4 * sqrt_pi / 3), g)
- assert_equal(s, 1)
-
- g, s = Math.lgamma(-0.5)
- check(Math.log(2 * sqrt_pi), g)
- assert_equal(s, -1)
-
- g, s = Math.lgamma(0.5)
- check(Math.log(sqrt_pi), g)
- assert_equal(s, 1)
-
- assert_equal([0, 1], Math.lgamma(1))
-
- g, s = Math.lgamma(1.5)
- check(Math.log(sqrt_pi / 2), g)
- assert_equal(s, 1)
-
- assert_equal([0, 1], Math.lgamma(2))
-
- g, s = Math.lgamma(2.5)
- check(Math.log(3 * sqrt_pi / 4), g)
- assert_equal(s, 1)
-
- g, s = Math.lgamma(3)
- check(Math.log(2), g)
- assert_equal(s, 1)
-
- g, s = Math.lgamma(3.5)
- check(Math.log(15 * sqrt_pi / 8), g)
- assert_equal(s, 1)
-
- g, s = Math.lgamma(4)
- check(Math.log(6), g)
- assert_equal(s, 1)
- end
+ def test_math
+ assert_equal(2, Math.sqrt(4))
- def test_cbrt
- check(1, Math.cbrt(1))
- check(-2, Math.cbrt(-8))
- check(3, Math.cbrt(27))
- check(-0.1, Math.cbrt(-0.001))
+ self.class.class_eval {
+ include Math
+ }
+ assert_equal(2, sqrt(4))
end
end
diff --git a/test/ruby/test_metaclass.rb b/test/ruby/test_metaclass.rb
deleted file mode 100644
index 6386a02dfa..0000000000
--- a/test/ruby/test_metaclass.rb
+++ /dev/null
@@ -1,167 +0,0 @@
-require 'test/unit'
-
-class TestMetaclass < Test::Unit::TestCase
- class Foo; end
- class Bar < Foo; end
- class Baz; end
-
- def setup
- Object.class_eval do
- def method_o; end
- end
- Module.class_eval do
- def method_m; end
- end
- Class.class_eval do
- def method_c; end
- end
- end
- def teardown
- Object.class_eval do
- remove_method :method_o rescue nil
- end
- Module.class_eval do
- remove_method :method_m rescue nil
- end
- Class.class_eval do
- remove_method :method_c rescue nil
- end
- Object.class_eval do
- class << self
- remove_method :class_method_o rescue nil
- end
- end
- Module.class_eval do
- class << self
- remove_method :class_method_m rescue nil
- end
- end
- Class.class_eval do
- class << self
- remove_method :class_method_c rescue nil
- end
- end
- Object.class_eval do
- class << self
- class << self
- remove_method :metaclass_method_o rescue nil
- end
- end
- end
- Module.class_eval do
- class << self
- class << self
- remove_method :metaclass_method_m rescue nil
- end
- end
- end
- Class.class_eval do
- class << self
- class << self
- remove_method :metaclass_method_c rescue nil
- end
- end
- end
- end
-
- def test_metaclass
- class << Object
- def class_method_o; end
- end
- class << Foo
- def class_method_f; end
- end
- class << Baz
- def class_method_b; end
- end
- assert_nothing_raised{ Bar.method_o }
- assert_nothing_raised{ Bar.method_m }
- assert_nothing_raised{ Bar.method_c }
- assert_nothing_raised{ Bar.class_method_o }
- assert_nothing_raised{ Bar.class_method_f }
- assert_raise(NoMethodError){ Bar.class_method_b }
-
- class << Module
- def class_method_m; end
- end
- class << Class
- def class_method_c; end
- end
- class << Object
- class << self
- def metaclass_method_o; end
- end
- end
- class << Foo
- class << self
- def metaclass_method_f; end
- end
- end
- class << Baz
- class << self
- def metaclass_method_b; end
- end
- end
- metaclass_of_bar = class << Bar; self end
- assert_nothing_raised{ metaclass_of_bar.method_o }
- assert_nothing_raised{ metaclass_of_bar.method_m }
- assert_nothing_raised{ metaclass_of_bar.method_c }
- assert_nothing_raised{ metaclass_of_bar.class_method_o }
- assert_raise(NoMethodError){ metaclass_of_bar.class_method_f }
- assert_raise(NoMethodError){ metaclass_of_bar.class_method_b }
- assert_nothing_raised{ metaclass_of_bar.class_method_m }
- assert_nothing_raised{ metaclass_of_bar.class_method_c }
- assert_nothing_raised{ metaclass_of_bar.metaclass_method_o }
- assert_nothing_raised{ metaclass_of_bar.metaclass_method_f }
- assert_raise(NoMethodError){ metaclass_of_bar.metaclass_method_b }
-
- class << Module
- class << self
- def metaclass_method_m; end
- end
- end
- class << Class
- class << self
- def metaclass_method_c; end
- end
- end
- class << Object
- class << self
- class << self
- def metametaclass_method_o; end
- end
- end
- end
- class << Foo
- class << self
- class << self
- def metametaclass_method_f; end
- end
- end
- end
- class << Baz
- class << self
- class << self
- def metametaclass_method_b; end
- end
- end
- end
- metametaclass_of_bar = class << metaclass_of_bar; self end
- assert_nothing_raised{ metametaclass_of_bar.method_o }
- assert_nothing_raised{ metametaclass_of_bar.method_m }
- assert_nothing_raised{ metametaclass_of_bar.method_c }
- assert_nothing_raised{ metametaclass_of_bar.class_method_o }
- assert_raise(NoMethodError){ metametaclass_of_bar.class_method_f }
- assert_raise(NoMethodError){ metametaclass_of_bar.class_method_b }
- assert_nothing_raised{ metametaclass_of_bar.class_method_m }
- assert_nothing_raised{ metametaclass_of_bar.class_method_c }
- assert_nothing_raised{ metametaclass_of_bar.metaclass_method_o }
- assert_raise(NoMethodError){ metametaclass_of_bar.metaclass_method_f }
- assert_raise(NoMethodError){ metametaclass_of_bar.metaclass_method_b }
- assert_nothing_raised{ metametaclass_of_bar.metaclass_method_m }
- assert_nothing_raised{ metametaclass_of_bar.metaclass_method_c }
- assert_nothing_raised{ metametaclass_of_bar.metametaclass_method_o }
- assert_nothing_raised{ metametaclass_of_bar.metametaclass_method_f }
- assert_raise(NoMethodError){ metametaclass_of_bar.metaclass_method_b }
- end
-end
diff --git a/test/ruby/test_method.rb b/test/ruby/test_method.rb
index dc44eee274..d721176aa0 100644
--- a/test/ruby/test_method.rb
+++ b/test/ruby/test_method.rb
@@ -1,16 +1,6 @@
require 'test/unit'
-require_relative 'envutil'
class TestMethod < Test::Unit::TestCase
- def setup
- @verbose = $VERBOSE
- $VERBOSE = nil
- end
-
- def teardown
- $VERBOSE = @verbose
- end
-
def m0() end
def m1(a) end
def m2(a, b) end
@@ -18,10 +8,6 @@ class TestMethod < Test::Unit::TestCase
def mo2(a, b = nil) end
def mo3(*a) end
def mo4(a, *b, &c) end
- def mo5(a, *b, c) end
- def mo6(a, *b, c, &d) end
- def mo7(a, b = nil, *c, d, &e) end
- def ma1((a), &b) end
class Base
def foo() :base end
@@ -29,15 +15,6 @@ class TestMethod < Test::Unit::TestCase
class Derived < Base
def foo() :derived end
end
- class T
- def initialize; end
- def normal_method; end
- end
- module M
- def func; end
- module_function :func
- def meth; end
- end
def test_arity
assert_equal(0, method(:m0).arity)
@@ -47,8 +24,6 @@ class TestMethod < Test::Unit::TestCase
assert_equal(-2, method(:mo2).arity)
assert_equal(-1, method(:mo3).arity)
assert_equal(-2, method(:mo4).arity)
- assert_equal(-3, method(:mo5).arity)
- assert_equal(-3, method(:mo6).arity)
end
def test_unbind
@@ -65,246 +40,14 @@ class TestMethod < Test::Unit::TestCase
end
end
- def test_callee
- assert_equal(:test_callee, __method__)
- assert_equal(:m, Class.new {def m; __method__; end}.new.m)
- assert_equal(:m, Class.new {def m; tap{return __method__}; end}.new.m)
- assert_equal(:m, Class.new {define_method(:m) {__method__}}.new.m)
- assert_equal(:m, Class.new {define_method(:m) {tap{return __method__}}}.new.m)
- assert_nil(eval("class TestCallee; __method__; end"))
- end
-
- def test_body
- o = Object.new
- def o.foo; end
- assert_nothing_raised { RubyVM::InstructionSequence.disasm(o.method(:foo)) }
- end
-
- def test_new
- c1 = Class.new
- c1.class_eval { def foo; :foo; end }
- c2 = Class.new(c1)
- c2.class_eval { private :foo }
- o = c2.new
- o.extend(Module.new)
- assert_raise(NameError) { o.method(:bar) }
- assert_raise(NameError) { o.public_method(:foo) }
- assert_equal(:foo, o.method(:foo).call)
- end
-
- def test_eq
- o = Object.new
- class << o
- def foo; end
- alias bar foo
- def baz; end
- end
- assert_not_equal(o.method(:foo), nil)
- m = o.method(:foo)
- def m.foo; end
- assert_not_equal(o.method(:foo), m)
- assert_equal(o.method(:foo), o.method(:foo))
- assert_equal(o.method(:foo), o.method(:bar))
- assert_not_equal(o.method(:foo), o.method(:baz))
- end
-
- def test_hash
- o = Object.new
- def o.foo; end
- assert_kind_of(Integer, o.method(:foo).hash)
- end
-
def test_receiver_name_owner
o = Object.new
def o.foo; end
m = o.method(:foo)
assert_equal(o, m.receiver)
- assert_equal(:foo, m.name)
+ assert_equal("foo", m.name)
assert_equal(class << o; self; end, m.owner)
- assert_equal(:foo, m.unbind.name)
+ assert_equal("foo", m.unbind.name)
assert_equal(class << o; self; end, m.unbind.owner)
end
-
- def test_instance_method
- c = Class.new
- c.class_eval do
- def foo; :foo; end
- private :foo
- end
- o = c.new
- o.method(:foo).unbind
- assert_raise(NoMethodError) { o.foo }
- c.instance_method(:foo).bind(o)
- assert_equal(:foo, o.instance_eval { foo })
- assert_raise(NameError) { c.public_instance_method(:foo) }
- def o.bar; end
- m = o.method(:bar).unbind
- assert_raise(TypeError) { m.bind(Object.new) }
- end
-
- def test_define_method
- c = Class.new
- c.class_eval { def foo; :foo; end }
- o = c.new
- def o.bar; :bar; end
- assert_raise(TypeError) do
- c.class_eval { define_method(:foo, :foo) }
- end
- assert_raise(ArgumentError) do
- c.class_eval { define_method }
- end
- c2 = Class.new(c)
- c2.class_eval { define_method(:baz, o.method(:foo)) }
- assert_equal(:foo, c2.new.baz)
- assert_raise(TypeError) do
- Class.new.class_eval { define_method(:foo, o.method(:foo)) }
- end
- assert_raise(TypeError) do
- Class.new.class_eval { define_method(:bar, o.method(:bar)) }
- end
-
- o = Object.new
- def o.foo(c)
- c.class_eval { define_method(:foo) }
- end
- c = Class.new
- o.foo(c) { :foo }
- assert_equal(:foo, c.new.foo)
-
- o = Object.new
- o.instance_eval { define_singleton_method(:foo) { :foo } }
- assert_equal(:foo, o.foo)
- end
-
- def test_clone
- o = Object.new
- def o.foo; :foo; end
- m = o.method(:foo)
- def m.bar; :bar; end
- assert_equal(:foo, m.clone.call)
- assert_equal(:bar, m.clone.bar)
- end
-
- def test_call
- o = Object.new
- def o.foo; p 1; end
- def o.bar(x); x; end
- m = o.method(:foo)
- m.taint
- assert_raise(SecurityError) { m.call }
- end
-
- def test_inspect
- o = Object.new
- def o.foo; end
- m = o.method(:foo)
- assert_equal("#<Method: #{ o.inspect }.foo>", m.inspect)
- m = o.method(:foo)
- assert_equal("#<UnboundMethod: #{ class << o; self; end.inspect }#foo>", m.unbind.inspect)
-
- c = Class.new
- c.class_eval { def foo; end; }
- m = c.new.method(:foo)
- assert_equal("#<Method: #{ c.inspect }#foo>", m.inspect)
- m = c.instance_method(:foo)
- assert_equal("#<UnboundMethod: #{ c.inspect }#foo>", m.inspect)
-
- c2 = Class.new(c)
- c2.class_eval { private :foo }
- m2 = c2.new.method(:foo)
- assert_equal("#<Method: #{ c2.inspect }(#{ c.inspect })#foo>", m2.inspect)
- end
-
- def test_callee_top_level
- assert_in_out_err([], "p __callee__", %w(nil), [])
- end
-
- def test_caller_negative_level
- assert_raise(ArgumentError) { caller(-1) }
- end
-
- def test_attrset_ivar
- c = Class.new
- c.class_eval { attr_accessor :foo }
- o = c.new
- o.method(:foo=).call(42)
- assert_equal(42, o.foo)
- assert_raise(ArgumentError) { o.method(:foo=).call(1, 2, 3) }
- assert_raise(ArgumentError) { o.method(:foo).call(1) }
- end
-
- def test_default_accessibility
- assert T.public_instance_methods.include?(:normal_method), 'normal methods are public by default'
- assert !T.public_instance_methods.include?(:initialize), '#initialize is private'
- assert !M.public_instance_methods.include?(:func), 'module methods are private by default'
- assert M.public_instance_methods.include?(:meth), 'normal methods are public by default'
- end
-
- define_method(:pm0) {||}
- define_method(:pm1) {|a|}
- define_method(:pm2) {|a, b|}
- define_method(:pmo1) {|a = nil, &b|}
- define_method(:pmo2) {|a, b = nil|}
- define_method(:pmo3) {|*a|}
- define_method(:pmo4) {|a, *b, &c|}
- define_method(:pmo5) {|a, *b, c|}
- define_method(:pmo6) {|a, *b, c, &d|}
- define_method(:pmo7) {|a, b = nil, *c, d, &e|}
- define_method(:pma1) {|(a), &b|}
-
- def test_bound_parameters
- assert_equal([], method(:m0).parameters)
- assert_equal([[:req, :a]], method(:m1).parameters)
- assert_equal([[:req, :a], [:req, :b]], method(:m2).parameters)
- assert_equal([[:opt, :a], [:block, :b]], method(:mo1).parameters)
- assert_equal([[:req, :a], [:opt, :b]], method(:mo2).parameters)
- assert_equal([[:rest, :a]], method(:mo3).parameters)
- assert_equal([[:req, :a], [:rest, :b], [:block, :c]], method(:mo4).parameters)
- assert_equal([[:req, :a], [:rest, :b], [:req, :c]], method(:mo5).parameters)
- assert_equal([[:req, :a], [:rest, :b], [:req, :c], [:block, :d]], method(:mo6).parameters)
- assert_equal([[:req, :a], [:opt, :b], [:rest, :c], [:req, :d], [:block, :e]], method(:mo7).parameters)
- assert_equal([[:req], [:block, :b]], method(:ma1).parameters)
- end
-
- def test_unbound_parameters
- assert_equal([], self.class.instance_method(:m0).parameters)
- assert_equal([[:req, :a]], self.class.instance_method(:m1).parameters)
- assert_equal([[:req, :a], [:req, :b]], self.class.instance_method(:m2).parameters)
- assert_equal([[:opt, :a], [:block, :b]], self.class.instance_method(:mo1).parameters)
- assert_equal([[:req, :a], [:opt, :b]], self.class.instance_method(:mo2).parameters)
- assert_equal([[:rest, :a]], self.class.instance_method(:mo3).parameters)
- assert_equal([[:req, :a], [:rest, :b], [:block, :c]], self.class.instance_method(:mo4).parameters)
- assert_equal([[:req, :a], [:rest, :b], [:req, :c]], self.class.instance_method(:mo5).parameters)
- assert_equal([[:req, :a], [:rest, :b], [:req, :c], [:block, :d]], self.class.instance_method(:mo6).parameters)
- assert_equal([[:req, :a], [:opt, :b], [:rest, :c], [:req, :d], [:block, :e]], self.class.instance_method(:mo7).parameters)
- assert_equal([[:req], [:block, :b]], self.class.instance_method(:ma1).parameters)
- end
-
- def test_bmethod_bound_parameters
- assert_equal([], method(:pm0).parameters)
- assert_equal([[:req, :a]], method(:pm1).parameters)
- assert_equal([[:req, :a], [:req, :b]], method(:pm2).parameters)
- assert_equal([[:opt, :a], [:block, :b]], method(:pmo1).parameters)
- assert_equal([[:req, :a], [:opt, :b]], method(:pmo2).parameters)
- assert_equal([[:rest, :a]], method(:pmo3).parameters)
- assert_equal([[:req, :a], [:rest, :b], [:block, :c]], method(:pmo4).parameters)
- assert_equal([[:req, :a], [:rest, :b], [:req, :c]], method(:pmo5).parameters)
- assert_equal([[:req, :a], [:rest, :b], [:req, :c], [:block, :d]], method(:pmo6).parameters)
- assert_equal([[:req, :a], [:opt, :b], [:rest, :c], [:req, :d], [:block, :e]], method(:pmo7).parameters)
- assert_equal([[:req], [:block, :b]], method(:pma1).parameters)
- end
-
- def test_bmethod_unbound_parameters
- assert_equal([], self.class.instance_method(:pm0).parameters)
- assert_equal([[:req, :a]], self.class.instance_method(:pm1).parameters)
- assert_equal([[:req, :a], [:req, :b]], self.class.instance_method(:pm2).parameters)
- assert_equal([[:opt, :a], [:block, :b]], self.class.instance_method(:pmo1).parameters)
- assert_equal([[:req, :a], [:opt, :b]], self.class.instance_method(:pmo2).parameters)
- assert_equal([[:rest, :a]], self.class.instance_method(:pmo3).parameters)
- assert_equal([[:req, :a], [:rest, :b], [:block, :c]], self.class.instance_method(:pmo4).parameters)
- assert_equal([[:req, :a], [:rest, :b], [:req, :c]], self.class.instance_method(:pmo5).parameters)
- assert_equal([[:req, :a], [:rest, :b], [:req, :c], [:block, :d]], self.class.instance_method(:pmo6).parameters)
- assert_equal([[:req, :a], [:opt, :b], [:rest, :c], [:req, :d], [:block, :e]], self.class.instance_method(:pmo7).parameters)
- assert_equal([[:req], [:block, :b]], self.class.instance_method(:pma1).parameters)
- end
end
diff --git a/test/ruby/test_mixed_unicode_escapes.rb b/test/ruby/test_mixed_unicode_escapes.rb
deleted file mode 100644
index 982b57e286..0000000000
--- a/test/ruby/test_mixed_unicode_escapes.rb
+++ /dev/null
@@ -1,25 +0,0 @@
-# -*- coding: cp932 -*-
-# This test is in a differnt file than TestUnicodeEscapes
-# So that we can have a different coding comment above
-
-require 'test/unit'
-
-class TestMixedUnicodeEscape < Test::Unit::TestCase
- def test_basic
- # Unicode escapes do work in an sjis encoded file, but only
- # if they don't contain other multi-byte chars
- assert_equal("A", "\u0041")
- # 8-bit character escapes are okay.
- assert_equal("B\xFF", "\u0042\xFF")
-
- # sjis mb chars mixed with Unicode shound not work
- assert_raise(SyntaxError) { eval %q("\u1234")}
- assert_raise(SyntaxError) { eval %q("\u{1234}")}
-
- # String interpolation turns into an expression and we get
- # a different kind of error, but we still can't mix these
- assert_raise(Encoding::CompatibilityError) { eval %q("\u{1234}#{nil}")}
- assert_raise(Encoding::CompatibilityError) { eval %q("#{nil}\u1234")}
-
- end
-end
diff --git a/test/ruby/test_module.rb b/test/ruby/test_module.rb
deleted file mode 100644
index 03fd2d9b90..0000000000
--- a/test/ruby/test_module.rb
+++ /dev/null
@@ -1,724 +0,0 @@
-require 'test/unit'
-require 'pp'
-require_relative 'envutil'
-
-$m0 = Module.nesting
-
-class TestModule < Test::Unit::TestCase
- def _wrap_assertion
- yield
- end
-
- def assert_method_defined?(klass, mid, message="")
- message = build_message(message, "#{klass}\##{mid} expected to be defined.")
- _wrap_assertion do
- klass.method_defined?(mid) or
- raise Test::Unit::AssertionFailedError, message, caller(3)
- end
- end
-
- def assert_method_not_defined?(klass, mid, message="")
- message = build_message(message, "#{klass}\##{mid} expected to not be defined.")
- _wrap_assertion do
- klass.method_defined?(mid) and
- raise Test::Unit::AssertionFailedError, message, caller(3)
- end
- end
-
- def setup
- @verbose = $VERBOSE
- $VERBOSE = nil
- end
-
- def teardown
- $VERBOSE = @verbose
- end
-
- def test_LT_0
- assert_equal true, String < Object
- assert_equal false, Object < String
- assert_nil String < Array
- assert_equal true, Array < Enumerable
- assert_equal false, Enumerable < Array
- assert_nil Proc < Comparable
- assert_nil Comparable < Proc
- end
-
- def test_GT_0
- assert_equal false, String > Object
- assert_equal true, Object > String
- assert_nil String > Array
- assert_equal false, Array > Enumerable
- assert_equal true, Enumerable > Array
- assert_nil Comparable > Proc
- assert_nil Proc > Comparable
- end
-
- def test_CMP_0
- assert_equal -1, (String <=> Object)
- assert_equal 1, (Object <=> String)
- assert_nil(Array <=> String)
- end
-
- ExpectedException = NoMethodError
-
- # Support stuff
-
- def remove_pp_mixins(list)
- list.reject {|c| c == PP::ObjectMixin }
- end
-
- def remove_json_mixins(list)
- list.reject {|c| c.to_s.start_with?("JSON") }
- end
-
- module Mixin
- MIXIN = 1
- def mixin
- end
- end
-
- module User
- USER = 2
- include Mixin
- def user
- end
- end
-
- module Other
- def other
- end
- end
-
- class AClass
- def AClass.cm1
- "cm1"
- end
- def AClass.cm2
- cm1 + "cm2" + cm3
- end
- def AClass.cm3
- "cm3"
- end
-
- private_class_method :cm1, "cm3"
-
- def aClass
- end
-
- def aClass1
- end
-
- def aClass2
- end
-
- private :aClass1
- protected :aClass2
- end
-
- class BClass < AClass
- def bClass1
- end
-
- private
-
- def bClass2
- end
-
- protected
- def bClass3
- end
- end
-
- MyClass = AClass.clone
- class MyClass
- public_class_method :cm1
- end
-
- # -----------------------------------------------------------
-
- def test_CMP # '<=>'
- assert_equal( 0, Mixin <=> Mixin)
- assert_equal(-1, User <=> Mixin)
- assert_equal( 1, Mixin <=> User)
-
- assert_equal( 0, Object <=> Object)
- assert_equal(-1, String <=> Object)
- assert_equal( 1, Object <=> String)
- end
-
- def test_GE # '>='
- assert(Mixin >= User)
- assert(Mixin >= Mixin)
- assert(!(User >= Mixin))
-
- assert(Object >= String)
- assert(String >= String)
- assert(!(String >= Object))
- end
-
- def test_GT # '>'
- assert(Mixin > User)
- assert(!(Mixin > Mixin))
- assert(!(User > Mixin))
-
- assert(Object > String)
- assert(!(String > String))
- assert(!(String > Object))
- end
-
- def test_LE # '<='
- assert(User <= Mixin)
- assert(Mixin <= Mixin)
- assert(!(Mixin <= User))
-
- assert(String <= Object)
- assert(String <= String)
- assert(!(Object <= String))
- end
-
- def test_LT # '<'
- assert(User < Mixin)
- assert(!(Mixin < Mixin))
- assert(!(Mixin < User))
-
- assert(String < Object)
- assert(!(String < String))
- assert(!(Object < String))
- end
-
- def test_VERY_EQUAL # '==='
- assert(Object === self)
- assert(Test::Unit::TestCase === self)
- assert(TestModule === self)
- assert(!(String === self))
- end
-
- def test_ancestors
- assert_equal([User, Mixin], User.ancestors)
- assert_equal([Mixin], Mixin.ancestors)
-
- assert_equal([Object, Kernel, BasicObject],
- remove_json_mixins(remove_pp_mixins(Object.ancestors)))
- assert_equal([String, Comparable, Object, Kernel, BasicObject],
- remove_json_mixins(remove_pp_mixins(String.ancestors)))
- end
-
- def test_class_eval
- Other.class_eval("CLASS_EVAL = 1")
- assert_equal(1, Other::CLASS_EVAL)
- assert(Other.constants.include?(:CLASS_EVAL))
- end
-
- def test_const_defined?
- assert(Math.const_defined?(:PI))
- assert(Math.const_defined?("PI"))
- assert(!Math.const_defined?(:IP))
- assert(!Math.const_defined?("IP"))
- end
-
- def test_const_get
- assert_equal(Math::PI, Math.const_get("PI"))
- assert_equal(Math::PI, Math.const_get(:PI))
- end
-
- def test_const_set
- assert(!Other.const_defined?(:KOALA))
- Other.const_set(:KOALA, 99)
- assert(Other.const_defined?(:KOALA))
- assert_equal(99, Other::KOALA)
- Other.const_set("WOMBAT", "Hi")
- assert_equal("Hi", Other::WOMBAT)
- end
-
- def test_constants
- assert_equal([:MIXIN], Mixin.constants)
- assert_equal([:MIXIN, :USER], User.constants.sort)
- end
-
- def test_included_modules
- assert_equal([], Mixin.included_modules)
- assert_equal([Mixin], User.included_modules)
- assert_equal([Kernel],
- remove_json_mixins(remove_pp_mixins(Object.included_modules)))
- assert_equal([Comparable, Kernel],
- remove_json_mixins(remove_pp_mixins(String.included_modules)))
- end
-
- def test_instance_methods
- assert_equal([:user], User.instance_methods(false))
- assert_equal([:user, :mixin].sort, User.instance_methods(true).sort)
- assert_equal([:mixin], Mixin.instance_methods)
- assert_equal([:mixin], Mixin.instance_methods(true))
- # Ruby 1.8 feature change:
- # #instance_methods includes protected methods.
- #assert_equal([:aClass], AClass.instance_methods(false))
- assert_equal([:aClass, :aClass2], AClass.instance_methods(false).sort)
- assert_equal([:aClass, :aClass2],
- (AClass.instance_methods(true) - Object.instance_methods(true)).sort)
- end
-
- def test_method_defined?
- assert_method_not_defined?(User, :wombat)
- assert_method_defined?(User, :user)
- assert_method_defined?(User, :mixin)
- assert_method_not_defined?(User, :wombat)
- assert_method_defined?(User, :user)
- assert_method_defined?(User, :mixin)
- end
-
- def module_exec_aux
- Proc.new do
- def dynamically_added_method_3; end
- end
- end
- def module_exec_aux_2(&block)
- User.module_exec(&block)
- end
-
- def test_module_exec
- User.module_exec do
- def dynamically_added_method_1; end
- end
- assert_method_defined?(User, :dynamically_added_method_1)
-
- block = Proc.new do
- def dynamically_added_method_2; end
- end
- User.module_exec(&block)
- assert_method_defined?(User, :dynamically_added_method_2)
-
- User.module_exec(&module_exec_aux)
- assert_method_defined?(User, :dynamically_added_method_3)
-
- module_exec_aux_2 do
- def dynamically_added_method_4; end
- end
- assert_method_defined?(User, :dynamically_added_method_4)
- end
-
- def test_module_eval
- User.module_eval("MODULE_EVAL = 1")
- assert_equal(1, User::MODULE_EVAL)
- assert(User.constants.include?(:MODULE_EVAL))
- User.instance_eval("remove_const(:MODULE_EVAL)")
- assert(!User.constants.include?(:MODULE_EVAL))
- end
-
- def test_name
- assert_equal("Fixnum", Fixnum.name)
- assert_equal("TestModule::Mixin", Mixin.name)
- assert_equal("TestModule::User", User.name)
- end
-
- def test_private_class_method
- assert_raise(ExpectedException) { AClass.cm1 }
- assert_raise(ExpectedException) { AClass.cm3 }
- assert_equal("cm1cm2cm3", AClass.cm2)
- end
-
- def test_private_instance_methods
- assert_equal([:aClass1], AClass.private_instance_methods(false))
- assert_equal([:bClass2], BClass.private_instance_methods(false))
- assert_equal([:aClass1, :bClass2],
- (BClass.private_instance_methods(true) -
- Object.private_instance_methods(true)).sort)
- end
-
- def test_protected_instance_methods
- assert_equal([:aClass2], AClass.protected_instance_methods)
- assert_equal([:bClass3], BClass.protected_instance_methods(false))
- assert_equal([:bClass3, :aClass2].sort,
- (BClass.protected_instance_methods(true) -
- Object.protected_instance_methods(true)).sort)
- end
-
- def test_public_class_method
- assert_equal("cm1", MyClass.cm1)
- assert_equal("cm1cm2cm3", MyClass.cm2)
- assert_raise(ExpectedException) { eval "MyClass.cm3" }
- end
-
- def test_public_instance_methods
- assert_equal([:aClass], AClass.public_instance_methods(false))
- assert_equal([:bClass1], BClass.public_instance_methods(false))
- end
-
- def test_s_constants
- c1 = Module.constants
- Object.module_eval "WALTER = 99"
- c2 = Module.constants
- assert_equal([:WALTER], c2 - c1)
- end
-
- module M1
- $m1 = Module.nesting
- module M2
- $m2 = Module.nesting
- end
- end
-
- def test_s_nesting
- assert_equal([], $m0)
- assert_equal([TestModule::M1, TestModule], $m1)
- assert_equal([TestModule::M1::M2,
- TestModule::M1, TestModule], $m2)
- end
-
- def test_s_new
- m = Module.new
- assert_instance_of(Module, m)
- end
-
- def test_freeze
- m = Module.new
- m.freeze
- assert_raise(RuntimeError) do
- m.module_eval do
- def foo; end
- end
- end
- end
-
- def test_attr_obsoleted_flag
- c = Class.new
- c.class_eval do
- def initialize
- @foo = :foo
- @bar = :bar
- end
- attr :foo, true
- attr :bar, false
- end
- o = c.new
- assert_equal(true, o.respond_to?(:foo))
- assert_equal(true, o.respond_to?(:foo=))
- assert_equal(true, o.respond_to?(:bar))
- assert_equal(false, o.respond_to?(:bar=))
- end
-
- def test_const_get2
- c1 = Class.new
- c2 = Class.new(c1)
-
- eval("c1::Foo = :foo")
- assert_equal(:foo, c1::Foo)
- assert_equal(:foo, c2::Foo)
- assert_equal(:foo, c2.const_get(:Foo))
- assert_raise(NameError) { c2.const_get(:Foo, false) }
-
- eval("c1::Foo = :foo")
- assert_raise(NameError) { c1::Bar }
- assert_raise(NameError) { c2::Bar }
- assert_raise(NameError) { c2.const_get(:Bar) }
- assert_raise(NameError) { c2.const_get(:Bar, false) }
-
- c1.instance_eval do
- def const_missing(x)
- x
- end
- end
-
- assert_equal(:Bar, c1::Bar)
- assert_equal(:Bar, c2::Bar)
- assert_equal(:Bar, c2.const_get(:Bar))
- assert_equal(:Bar, c2.const_get(:Bar, false))
-
- assert_raise(NameError) { c1.const_get(:foo) }
- end
-
- def test_const_set2
- c1 = Class.new
- assert_raise(NameError) { c1.const_set(:foo, :foo) }
- end
-
- def test_const_get3
- c1 = Class.new
- assert_raise(NameError) { c1.const_defined?(:foo) }
- end
-
- def test_class_variable_get
- c = Class.new
- c.class_eval { @@foo = :foo }
- assert_equal(:foo, c.class_variable_get(:@@foo))
- assert_raise(NameError) { c.class_variable_get(:@@bar) } # c.f. instance_variable_get
- assert_raise(NameError) { c.class_variable_get(:foo) }
- end
-
- def test_class_variable_set
- c = Class.new
- c.class_variable_set(:@@foo, :foo)
- assert_equal(:foo, c.class_eval { @@foo })
- assert_raise(NameError) { c.class_variable_set(:foo, 1) }
- end
-
- def test_class_variable_defined
- c = Class.new
- c.class_eval { @@foo = :foo }
- assert_equal(true, c.class_variable_defined?(:@@foo))
- assert_equal(false, c.class_variable_defined?(:@@bar))
- assert_raise(NameError) { c.class_variable_defined?(:foo) }
- end
-
- def test_remove_class_variable
- c = Class.new
- c.class_eval { @@foo = :foo }
- c.class_eval { remove_class_variable(:@@foo) }
- assert_equal(false, c.class_variable_defined?(:@@foo))
- end
-
- def test_export_method
- m = Module.new
- assert_raise(NameError) do
- m.instance_eval { public(:foo) }
- end
- end
-
- def test_attr
- assert_in_out_err([], <<-INPUT, %w(:ok nil), /warning: private attribute\?$/)
- $VERBOSE = true
- c = Class.new
- c.instance_eval do
- private
- attr_reader :foo
- end
- o = c.new
- o.foo rescue p(:ok)
- p(o.instance_eval { foo })
- INPUT
-
- c = Class.new
- assert_raise(NameError) do
- c.instance_eval { attr_reader :"$" }
- end
- end
-
- def test_undef
- assert_raise(SecurityError) do
- Thread.new do
- $SAFE = 4
- Class.instance_eval { undef_method(:foo) }
- end.join
- end
-
- c = Class.new
- assert_raise(NameError) do
- c.instance_eval { undef_method(:foo) }
- end
-
- m = Module.new
- assert_raise(NameError) do
- m.instance_eval { undef_method(:foo) }
- end
-
- o = Object.new
- assert_raise(NameError) do
- class << o; self; end.instance_eval { undef_method(:foo) }
- end
-
- %w(object_id __send__ initialize).each do |m|
- assert_in_out_err([], <<-INPUT, [], /warning: undefining `#{m}' may cause serious problems$/)
- $VERBOSE = false
- Class.new.instance_eval { undef_method(:#{m}) }
- INPUT
- end
- end
-
- def test_alias
- m = Module.new
- assert_raise(NameError) do
- m.class_eval { alias foo bar }
- end
-
- assert_in_out_err([], <<-INPUT, %w(2), /warning: discarding old foo$/)
- $VERBOSE = true
- c = Class.new
- c.class_eval do
- def foo; 1; end
- def bar; 2; end
- end
- c.class_eval { alias foo bar }
- p c.new.foo
- INPUT
- end
-
- def test_mod_constants
- m = Module.new
- m.const_set(:Foo, :foo)
- assert_equal([:Foo], m.constants(true))
- assert_equal([:Foo], m.constants(false))
- m.instance_eval { remove_const(:Foo) }
- end
-
- def test_frozen_class
- m = Module.new
- m.freeze
- assert_raise(RuntimeError) do
- m.instance_eval { undef_method(:foo) }
- end
-
- c = Class.new
- c.freeze
- assert_raise(RuntimeError) do
- c.instance_eval { undef_method(:foo) }
- end
-
- o = Object.new
- c = class << o; self; end
- c.freeze
- assert_raise(RuntimeError) do
- c.instance_eval { undef_method(:foo) }
- end
- end
-
- def test_method_defined
- c = Class.new
- c.class_eval do
- def foo; end
- def bar; end
- def baz; end
- public :foo
- protected :bar
- private :baz
- end
-
- assert_equal(true, c.public_method_defined?(:foo))
- assert_equal(false, c.public_method_defined?(:bar))
- assert_equal(false, c.public_method_defined?(:baz))
-
- assert_equal(false, c.protected_method_defined?(:foo))
- assert_equal(true, c.protected_method_defined?(:bar))
- assert_equal(false, c.protected_method_defined?(:baz))
-
- assert_equal(false, c.private_method_defined?(:foo))
- assert_equal(false, c.private_method_defined?(:bar))
- assert_equal(true, c.private_method_defined?(:baz))
- end
-
- def test_change_visibility_under_safe4
- c = Class.new
- c.class_eval do
- def foo; end
- end
- assert_raise(SecurityError) do
- Thread.new do
- $SAFE = 4
- c.class_eval { private :foo }
- end.join
- end
- end
-
- def test_top_public_private
- assert_in_out_err([], <<-INPUT, %w([:foo] [:bar]), [])
- private
- def foo; :foo; end
- public
- def bar; :bar; end
- p self.private_methods.grep(/^foo$|^bar$/)
- p self.methods.grep(/^foo$|^bar$/)
- INPUT
- end
-
- def test_append_features
- t = nil
- m = Module.new
- m.module_eval do
- def foo; :foo; end
- end
- class << m; self; end.class_eval do
- define_method(:append_features) do |mod|
- t = mod
- super(mod)
- end
- end
-
- m2 = Module.new
- m2.module_eval { include(m) }
- assert_equal(m2, t)
-
- o = Object.new
- o.extend(m2)
- assert_equal(true, o.respond_to?(:foo))
- end
-
- def test_append_features_raise
- m = Module.new
- m.module_eval do
- def foo; :foo; end
- end
- class << m; self; end.class_eval do
- define_method(:append_features) {|mod| raise }
- end
-
- m2 = Module.new
- assert_raise(RuntimeError) do
- m2.module_eval { include(m) }
- end
-
- o = Object.new
- o.extend(m2)
- assert_equal(false, o.respond_to?(:foo))
- end
-
- def test_append_features_type_error
- assert_raise(TypeError) do
- Module.new.instance_eval { append_features(1) }
- end
- end
-
- def test_included
- m = Module.new
- m.module_eval do
- def foo; :foo; end
- end
- class << m; self; end.class_eval do
- define_method(:included) {|mod| raise }
- end
-
- m2 = Module.new
- assert_raise(RuntimeError) do
- m2.module_eval { include(m) }
- end
-
- o = Object.new
- o.extend(m2)
- assert_equal(true, o.respond_to?(:foo))
- end
-
- def test_cyclic_include
- m1 = Module.new
- m2 = Module.new
- m1.instance_eval { include(m2) }
- assert_raise(ArgumentError) do
- m2.instance_eval { include(m1) }
- end
- end
-
- def test_include_p
- m = Module.new
- c1 = Class.new
- c1.instance_eval { include(m) }
- c2 = Class.new(c1)
- assert_equal(true, c1.include?(m))
- assert_equal(true, c2.include?(m))
- assert_equal(false, m.include?(m))
- end
-
- def test_include_under_safe4
- m = Module.new
- c1 = Class.new
- assert_raise(SecurityError) do
- lambda {
- $SAFE = 4
- c1.instance_eval { include(m) }
- }.call
- end
- assert_nothing_raised do
- lambda {
- $SAFE = 4
- c2 = Class.new
- c2.instance_eval { include(m) }
- }.call
- end
- end
-end
diff --git a/test/ruby/test_notimp.rb b/test/ruby/test_notimp.rb
deleted file mode 100644
index dfe51683c9..0000000000
--- a/test/ruby/test_notimp.rb
+++ /dev/null
@@ -1,64 +0,0 @@
-require 'test/unit'
-require 'tmpdir'
-
-class TestNotImplement < Test::Unit::TestCase
- def test_respond_to_fork
- assert_includes(Process.methods, :fork)
- if /linux/ =~ RUBY_PLATFORM
- assert_equal(true, Process.respond_to?(:fork))
- end
- end
-
- def test_respond_to_lchmod
- assert_includes(File.methods, :lchmod)
- if /linux/ =~ RUBY_PLATFORM
- assert_equal(false, File.respond_to?(:lchmod))
- end
- if /freebsd/ =~ RUBY_PLATFORM
- assert_equal(true, File.respond_to?(:lchmod))
- end
- end
-
- def test_call_fork
- if Process.respond_to?(:fork)
- assert_nothing_raised {
- pid = fork {}
- Process.wait pid
- }
- end
- end
-
- def test_call_lchmod
- if File.respond_to?(:lchmod)
- Dir.mktmpdir {|d|
- f = "#{d}/f"
- g = "#{d}/g"
- File.open(f, "w") {}
- File.symlink f, g
- newmode = 0444
- File.lchmod newmode, "#{d}/g"
- snew = File.lstat(g)
- assert_equal(newmode, snew.mode & 0777)
- }
- end
- end
-
- def test_method_inspect_fork
- m = Process.method(:fork)
- if Process.respond_to?(:fork)
- assert_not_match(/not-implemented/, m.inspect)
- else
- assert_match(/not-implemented/, m.inspect)
- end
- end
-
- def test_method_inspect_lchmod
- m = File.method(:lchmod)
- if File.respond_to?(:lchmod)
- assert_not_match(/not-implemented/, m.inspect)
- else
- assert_match(/not-implemented/, m.inspect)
- end
- end
-
-end
diff --git a/test/ruby/test_numeric.rb b/test/ruby/test_numeric.rb
deleted file mode 100644
index 43d53e7fcf..0000000000
--- a/test/ruby/test_numeric.rb
+++ /dev/null
@@ -1,221 +0,0 @@
-require 'test/unit'
-
-class TestNumeric < Test::Unit::TestCase
- class DummyNumeric < Numeric
- end
-
- def test_coerce
- a, b = 1.coerce(2)
- assert_equal(Fixnum, a.class)
- assert_equal(Fixnum, b.class)
-
- a, b = 1.coerce(2.0)
- assert_equal(Float, a.class)
- assert_equal(Float, b.class)
-
- assert_raise(TypeError) { -Numeric.new }
- end
-
- def test_dummynumeric
- a = DummyNumeric.new
-
- DummyNumeric.class_eval do
- def coerce(x); nil; end
- end
- assert_raise(TypeError) { -a }
- assert_nil(1 <=> a)
- assert_raise(ArgumentError) { 1 <= a }
-
- DummyNumeric.class_eval do
- def coerce(x); 1.coerce(x); end
- end
- assert_equal(2, 1 + a)
- assert_equal(0, 1 <=> a)
- assert(1 <= a)
-
- DummyNumeric.class_eval do
- def coerce(x); [x, 1]; end
- end
- assert_equal(-1, -a)
-
- ensure
- DummyNumeric.class_eval do
- remove_method :coerce
- end
- end
-
- def test_numeric
- a = Numeric.new
- assert_raise(TypeError) { def a.foo; end }
- assert_raise(TypeError) { a.dup }
- end
-
- def test_quo
- assert_raise(ArgumentError) {DummyNumeric.new.quo(1)}
- end
-
- def test_divmod
-=begin
- DummyNumeric.class_eval do
- def /(x); 42.0; end
- def %(x); :mod; end
- end
-
- assert_equal(42, DummyNumeric.new.div(1))
- assert_equal(:mod, DummyNumeric.new.modulo(1))
- assert_equal([42, :mod], DummyNumeric.new.divmod(1))
-=end
-
- assert_kind_of(Integer, 11.divmod(3.5).first, '[ruby-dev:34006]')
-
-=begin
- ensure
- DummyNumeric.class_eval do
- remove_method :/, :%
- end
-=end
- end
-
- def test_real_p
- assert(Numeric.new.real?)
- end
-
- def test_integer_p
- assert(!Numeric.new.integer?)
- end
-
- def test_abs
- a = DummyNumeric.new
- DummyNumeric.class_eval do
- def -@; :ok; end
- def <(x); true; end
- end
-
- assert_equal(:ok, a.abs)
-
- DummyNumeric.class_eval do
- def <(x); false; end
- end
-
- assert_equal(a, a.abs)
-
- ensure
- DummyNumeric.class_eval do
- remove_method :-@, :<
- end
- end
-
- def test_zero_p
- DummyNumeric.class_eval do
- def ==(x); true; end
- end
-
- assert(DummyNumeric.new.zero?)
-
- ensure
- DummyNumeric.class_eval do
- remove_method :==
- end
- end
-
- def test_to_int
- DummyNumeric.class_eval do
- def to_i; :ok; end
- end
-
- assert_equal(:ok, DummyNumeric.new.to_int)
-
- ensure
- DummyNumeric.class_eval do
- remove_method :to_i
- end
- end
-
- def test_cmp
- a = Numeric.new
- assert_equal(0, a <=> a)
- assert_nil(a <=> :foo)
- end
-
- def test_floor_ceil_round_truncate
- DummyNumeric.class_eval do
- def to_f; 1.5; end
- end
-
- a = DummyNumeric.new
- assert_equal(1, a.floor)
- assert_equal(2, a.ceil)
- assert_equal(2, a.round)
- assert_equal(1, a.truncate)
-
- DummyNumeric.class_eval do
- def to_f; 1.4; end
- end
-
- a = DummyNumeric.new
- assert_equal(1, a.floor)
- assert_equal(2, a.ceil)
- assert_equal(1, a.round)
- assert_equal(1, a.truncate)
-
- DummyNumeric.class_eval do
- def to_f; -1.5; end
- end
-
- a = DummyNumeric.new
- assert_equal(-2, a.floor)
- assert_equal(-1, a.ceil)
- assert_equal(-2, a.round)
- assert_equal(-1, a.truncate)
-
- ensure
- DummyNumeric.class_eval do
- remove_method :to_f
- end
- end
-
- def test_step
- a = []
- 1.step(10) {|x| a << x }
- assert_equal([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], a)
-
- a = []
- 1.step(10, 2) {|x| a << x }
- assert_equal([1, 3, 5, 7, 9], a)
-
- assert_raise(ArgumentError) { 1.step(10, 1, 0) { } }
- assert_raise(ArgumentError) { 1.step(10, 0) { } }
-
- a = []
- 10.step(1, -2) {|x| a << x }
- assert_equal([10, 8, 6, 4, 2], a)
-
- a = []
- 1.0.step(10.0, 2.0) {|x| a << x }
- assert_equal([1.0, 3.0, 5.0, 7.0, 9.0], a)
-
- a = []
- 1.step(10, 2**32) {|x| a << x }
- assert_equal([1], a)
-
- a = []
- 10.step(1, -(2**32)) {|x| a << x }
- assert_equal([10], a)
- end
-
- def test_num2long
- assert_raise(TypeError) { 1 & nil }
- assert_raise(TypeError) { 1 & 1.0 }
- assert_raise(TypeError) { 1 & 2147483648.0 }
- assert_raise(TypeError) { 1 & 9223372036854777856.0 }
- o = Object.new
- def o.to_int; 1; end
- assert_equal(1, 1 & o)
- end
-
- def test_eql
- assert(1 == 1.0)
- assert(!(1.eql?(1.0)))
- assert(!(1.eql?(2)))
- end
-end
diff --git a/test/ruby/test_object.rb b/test/ruby/test_object.rb
deleted file mode 100644
index 51a3cdc32b..0000000000
--- a/test/ruby/test_object.rb
+++ /dev/null
@@ -1,416 +0,0 @@
-require 'test/unit'
-require_relative 'envutil'
-
-class TestObject < Test::Unit::TestCase
- def setup
- @verbose = $VERBOSE
- $VERBOSE = nil
- end
-
- def teardown
- $VERBOSE = @verbose
- end
-
- def test_dup
- assert_raise(TypeError) { 1.dup }
- assert_raise(TypeError) { true.dup }
- assert_raise(TypeError) { nil.dup }
-
- assert_raise(TypeError) do
- Object.new.instance_eval { initialize_copy(1) }
- end
- end
-
- def test_instance_of
- assert_raise(TypeError) { 1.instance_of?(1) }
- end
-
- def test_kind_of
- assert_raise(TypeError) { 1.kind_of?(1) }
- end
-
- def test_taint_frozen_obj
- o = Object.new
- o.freeze
- assert_raise(RuntimeError) { o.taint }
-
- o = Object.new
- o.taint
- o.freeze
- assert_raise(RuntimeError) { o.untaint }
- end
-
- def test_freeze_under_safe_4
- o = Object.new
- assert_raise(SecurityError) do
- Thread.new do
- $SAFE = 4
- o.freeze
- end.join
- end
- end
-
- def test_freeze_immediate
- assert_equal(false, 1.frozen?)
- 1.freeze
- assert_equal(true, 1.frozen?)
- assert_equal(false, 2.frozen?)
- end
-
- def test_nil_to_f
- assert_equal(0.0, nil.to_f)
- end
-
- def test_not
- assert_equal(false, Object.new.send(:!))
- assert_equal(true, nil.send(:!))
- end
-
- def test_true_and
- assert_equal(true, true & true)
- assert_equal(true, true & 1)
- assert_equal(false, true & false)
- assert_equal(false, true & nil)
- end
-
- def test_true_or
- assert_equal(true, true | true)
- assert_equal(true, true | 1)
- assert_equal(true, true | false)
- assert_equal(true, true | nil)
- end
-
- def test_true_xor
- assert_equal(false, true ^ true)
- assert_equal(false, true ^ 1)
- assert_equal(true, true ^ false)
- assert_equal(true, true ^ nil)
- end
-
- def test_false_and
- assert_equal(false, false & true)
- assert_equal(false, false & 1)
- assert_equal(false, false & false)
- assert_equal(false, false & nil)
- end
-
- def test_false_or
- assert_equal(true, false | true)
- assert_equal(true, false | 1)
- assert_equal(false, false | false)
- assert_equal(false, false | nil)
- end
-
- def test_false_xor
- assert_equal(true, false ^ true)
- assert_equal(true, false ^ 1)
- assert_equal(false, false ^ false)
- assert_equal(false, false ^ nil)
- end
-
- def test_methods
- o = Object.new
- a1 = o.methods
- a2 = o.methods(false)
-
- def o.foo; end
-
- assert_equal([:foo], o.methods(true) - a1)
- assert_equal([:foo], o.methods(false) - a2)
- end
-
- def test_methods2
- c0 = Class.new
- c1 = Class.new(c0)
- c1.module_eval do
- public ; def foo; end
- protected; def bar; end
- private ; def baz; end
- end
- c2 = Class.new(c1)
- c2.module_eval do
- public ; def foo2; end
- protected; def bar2; end
- private ; def baz2; end
- end
-
- o0 = c0.new
- o2 = c2.new
-
- assert_equal([:baz, :baz2], (o2.private_methods - o0.private_methods).sort)
- assert_equal([:baz2], (o2.private_methods(false) - o0.private_methods(false)).sort)
-
- assert_equal([:bar, :bar2], (o2.protected_methods - o0.protected_methods).sort)
- assert_equal([:bar2], (o2.protected_methods(false) - o0.protected_methods(false)).sort)
-
- assert_equal([:foo, :foo2], (o2.public_methods - o0.public_methods).sort)
- assert_equal([:foo2], (o2.public_methods(false) - o0.public_methods(false)).sort)
- end
-
- def test_instance_variable_get
- o = Object.new
- o.instance_eval { @foo = :foo }
- assert_equal(:foo, o.instance_variable_get(:@foo))
- assert_equal(nil, o.instance_variable_get(:@bar))
- assert_raise(NameError) { o.instance_variable_get(:foo) }
- end
-
- def test_instance_variable_set
- o = Object.new
- o.instance_variable_set(:@foo, :foo)
- assert_equal(:foo, o.instance_eval { @foo })
- assert_raise(NameError) { o.instance_variable_set(:foo, 1) }
- end
-
- def test_instance_variable_defined
- o = Object.new
- o.instance_eval { @foo = :foo }
- assert_equal(true, o.instance_variable_defined?(:@foo))
- assert_equal(false, o.instance_variable_defined?(:@bar))
- assert_raise(NameError) { o.instance_variable_defined?(:foo) }
- end
-
- def test_remove_instance_variable
- o = Object.new
- o.instance_eval { @foo = :foo }
- o.instance_eval { remove_instance_variable(:@foo) }
- assert_equal(false, o.instance_variable_defined?(:@foo))
- end
-
- def test_convert_type
- o = Object.new
- def o.to_s; 1; end
- assert_raise(TypeError) { String(o) }
- end
-
- def test_check_convert_type
- o = Object.new
- def o.to_a; 1; end
- assert_raise(TypeError) { Array(o) }
- end
-
- def test_to_integer
- o = Object.new
- def o.to_i; nil; end
- assert_raise(TypeError) { Integer(o) }
- end
-
- class MyInteger
- def initialize(n); @num = n; end
- def to_int; @num; end
- def <=>(n); @num <=> n.to_int; end
- def <=(n); @num <= n.to_int; end
- def +(n); MyInteger.new(@num + n.to_int); end
- end
-
- def test_check_to_integer
- o1 = MyInteger.new(1)
- o9 = MyInteger.new(9)
- n = 0
- Range.new(o1, o9).step(2) {|x| n += x.to_int }
- assert_equal(1+3+5+7+9, n)
- end
-
- def test_add_method_under_safe4
- o = Object.new
- assert_raise(SecurityError) do
- Thread.new do
- $SAFE = 4
- def o.foo
- end
- end.join
- end
- end
-
- def test_redefine_method_under_verbose
- assert_in_out_err([], <<-INPUT, %w(2), /warning: method redefined; discarding old foo$/)
- $VERBOSE = true
- o = Object.new
- def o.foo; 1; end
- def o.foo; 2; end
- p o.foo
- INPUT
- end
-
- def test_redefine_method_which_may_case_serious_problem
- assert_in_out_err([], <<-INPUT, [], /warning: redefining `object_id' may cause serious problems$/)
- $VERBOSE = false
- def (Object.new).object_id; end
- INPUT
-
- assert_in_out_err([], <<-INPUT, [], /warning: redefining `__send__' may cause serious problems$/)
- $VERBOSE = false
- def (Object.new).__send__; end
- INPUT
- end
-
- def test_remove_method
- assert_raise(SecurityError) do
- Thread.new do
- $SAFE = 4
- Object.instance_eval { remove_method(:foo) }
- end.join
- end
-
- assert_raise(SecurityError) do
- Thread.new do
- $SAFE = 4
- Class.instance_eval { remove_method(:foo) }
- end.join
- end
-
- c = Class.new
- c.freeze
- assert_raise(RuntimeError) do
- c.instance_eval { remove_method(:foo) }
- end
-
- %w(object_id __send__ initialize).each do |m|
- assert_in_out_err([], <<-INPUT, %w(:ok), /warning: removing `#{m}' may cause serious problems$/)
- $VERBOSE = false
- begin
- Class.new.instance_eval { remove_method(:#{m}) }
- rescue NameError
- p :ok
- end
- INPUT
- end
- end
-
- def test_method_missing
- assert_raise(ArgumentError) do
- 1.instance_eval { method_missing }
- end
-
- c = Class.new
- c.class_eval do
- protected
- def foo; end
- end
- assert_raise(NoMethodError) do
- c.new.foo
- end
-
- assert_raise(NoMethodError) do
- 1.instance_eval { method_missing(:method_missing) }
- end
-
- c.class_eval do
- undef_method(:method_missing)
- end
-
- assert_raise(ArgumentError) do
- c.new.method_missing
- end
- end
-
- def test_send_with_no_arguments
- assert_raise(ArgumentError) { 1.send }
- end
-
- def test_specific_eval_with_wrong_arguments
- assert_raise(ArgumentError) do
- 1.instance_eval("foo") { foo }
- end
-
- assert_raise(ArgumentError) do
- 1.instance_eval
- end
-
- assert_raise(ArgumentError) do
- 1.instance_eval("", 1, 1, 1)
- end
- end
-
- def test_instance_exec
- x = 1.instance_exec(42) {|a| self + a }
- assert_equal(43, x)
-
- x = "foo".instance_exec("bar") {|a| self + a }
- assert_equal("foobar", x)
- end
-
- def test_extend
- assert_raise(ArgumentError) do
- 1.extend
- end
- end
-
- def test_untrusted
- obj = lambda {
- $SAFE = 4
- x = Object.new
- x.instance_eval { @foo = 1 }
- x
- }.call
- assert_equal(true, obj.untrusted?)
- assert_equal(true, obj.tainted?)
-
- x = Object.new
- assert_equal(false, x.untrusted?)
- assert_raise(SecurityError) do
- lambda {
- $SAFE = 4
- x.instance_eval { @foo = 1 }
- }.call
- end
-
- x = Object.new
- x.taint
- assert_raise(SecurityError) do
- lambda {
- $SAFE = 4
- x.instance_eval { @foo = 1 }
- }.call
- end
-
- x.untrust
- assert_equal(true, x.untrusted?)
- assert_nothing_raised do
- lambda {
- $SAFE = 4
- x.instance_eval { @foo = 1 }
- }.call
- end
-
- x.trust
- assert_equal(false, x.untrusted?)
- assert_raise(SecurityError) do
- lambda {
- $SAFE = 4
- x.instance_eval { @foo = 1 }
- }.call
- end
-
- a = Object.new
- a.untrust
- assert_equal(true, a.untrusted?)
- b = a.dup
- assert_equal(true, b.untrusted?)
- c = a.clone
- assert_equal(true, c.untrusted?)
-
- a = Object.new
- b = lambda {
- $SAFE = 4
- a.dup
- }.call
- assert_equal(true, b.untrusted?)
-
- a = Object.new
- b = lambda {
- $SAFE = 4
- a.clone
- }.call
- assert_equal(true, b.untrusted?)
- end
-
- def test_to_s
- x = Object.new
- x.taint
- x.untrust
- s = x.to_s
- assert_equal(true, s.untrusted?)
- assert_equal(true, s.tainted?)
- end
-end
diff --git a/test/ruby/test_objectspace.rb b/test/ruby/test_objectspace.rb
index 571c725986..a2d0164954 100644
--- a/test/ruby/test_objectspace.rb
+++ b/test/ruby/test_objectspace.rb
@@ -1,5 +1,4 @@
require 'test/unit'
-require_relative 'envutil'
class TestObjectSpace < Test::Unit::TestCase
def self.deftest_id2ref(obj)
@@ -34,34 +33,4 @@ End
deftest_id2ref(true)
deftest_id2ref(false)
deftest_id2ref(nil)
-
- def test_count_objects
- h = {}
- ObjectSpace.count_objects(h)
- assert_kind_of(Hash, h)
- assert(h.keys.all? {|x| x.is_a?(Symbol) || x.is_a?(Integer) })
- assert(h.values.all? {|x| x.is_a?(Integer) })
-
- h = ObjectSpace.count_objects
- assert_kind_of(Hash, h)
- assert(h.keys.all? {|x| x.is_a?(Symbol) || x.is_a?(Integer) })
- assert(h.values.all? {|x| x.is_a?(Integer) })
-
- assert_raise(TypeError) { ObjectSpace.count_objects(1) }
-
- h0 = {:T_FOO=>1000}
- h = ObjectSpace.count_objects(h0)
- assert_same(h0, h)
- assert_equal(0, h0[:T_FOO])
- end
-
- def test_finalizer
- assert_in_out_err(["-e", <<-END], "", %w(:ok :ok :ok :ok), [])
- a = []
- ObjectSpace.define_finalizer(a) { p :ok }
- b = a.dup
- ObjectSpace.define_finalizer(a) { p :ok }
- END
- assert_raise(ArgumentError) { ObjectSpace.define_finalizer([], Object.new) }
- end
end
diff --git a/test/ruby/test_optimization.rb b/test/ruby/test_optimization.rb
deleted file mode 100644
index 8e8311e6ef..0000000000
--- a/test/ruby/test_optimization.rb
+++ /dev/null
@@ -1,140 +0,0 @@
-require 'test/unit'
-
-class TestRubyOptimization < Test::Unit::TestCase
-
- BIGNUM_POS_MIN_32 = 1073741824 # 2 ** 30
- if BIGNUM_POS_MIN_32.kind_of?(Fixnum)
- FIXNUM_MAX = 4611686018427387903 # 2 ** 62 - 1
- else
- FIXNUM_MAX = 1073741823 # 2 ** 30 - 1
- end
-
- BIGNUM_NEG_MAX_32 = -1073741825 # -2 ** 30 - 1
- if BIGNUM_NEG_MAX_32.kind_of?(Fixnum)
- FIXNUM_MIN = -4611686018427387904 # -2 ** 62
- else
- FIXNUM_MIN = -1073741824 # -2 ** 30
- end
-
- def redefine_method(klass, method)
- (@redefine_method_seq ||= 0)
- seq = (@redefine_method_seq += 1)
- eval(<<-End, ::TOPLEVEL_BINDING)
- class #{klass}
- alias redefine_method_orig_#{seq} #{method}
- undef #{method}
- def #{method}(*args)
- args[0]
- end
- end
- End
- begin
- return yield
- ensure
- eval(<<-End, ::TOPLEVEL_BINDING)
- class #{klass}
- undef #{method}
- alias #{method} redefine_method_orig_#{seq}
- end
- End
- end
- end
-
- def test_fixnum_plus
- a, b = 1, 2
- assert_equal 3, a + b
- assert_instance_of Fixnum, FIXNUM_MAX
- assert_instance_of Bignum, FIXNUM_MAX + 1
-
- assert_equal 21, 10 + 11
- assert_equal 11, redefine_method('Fixnum', '+') { 10 + 11 }
- assert_equal 21, 10 + 11
- end
-
- def test_fixnum_minus
- assert_equal 5, 8 - 3
- assert_instance_of Fixnum, FIXNUM_MIN
- assert_instance_of Bignum, FIXNUM_MIN - 1
-
- assert_equal 5, 8 - 3
- assert_equal 3, redefine_method('Fixnum', '-') { 8 - 3 }
- assert_equal 5, 8 - 3
- end
-
- def test_fixnum_mul
- assert_equal 15, 3 * 5
- end
-
- def test_fixnum_div
- assert_equal 3, 15 / 5
- end
-
- def test_fixnum_mod
- assert_equal 1, 8 % 7
- end
-
- def test_float_plus
- assert_equal 4.0, 2.0 + 2.0
- assert_equal 2.0, redefine_method('Float', '+') { 2.0 + 2.0 }
- assert_equal 4.0, 2.0 + 2.0
- end
-
- def test_string_length
- assert_equal 6, "string".length
- assert_nil redefine_method('String', 'length') { "string".length }
- assert_equal 6, "string".length
- end
-
- def test_string_plus
- assert_equal "", "" + ""
- assert_equal "x", "x" + ""
- assert_equal "x", "" + "x"
- assert_equal "ab", "a" + "b"
- assert_equal 'b', redefine_method('String', '+') { "a" + "b" }
- assert_equal "ab", "a" + "b"
- end
-
- def test_string_succ
- assert_equal 'b', 'a'.succ
- assert_equal 'B', 'A'.succ
- end
-
- def test_string_format
- assert_equal '2', '%d' % 2
- end
-
- def test_array_plus
- assert_equal [1,2], [1]+[2]
- end
-
- def test_array_minus
- assert_equal [2], [1,2] - [1]
- end
-
- def test_array_length
- assert_equal 0, [].length
- assert_equal 3, [1,2,3].length
- end
-
- def test_hash_length
- assert_equal 0, {}.length
- assert_equal 1, {1=>1}.length
- end
-
- class MyObj
- def ==(other)
- true
- end
- end
-
- def test_eq
- assert_equal true, nil == nil
- assert_equal true, 1 == 1
- assert_equal true, 'string' == 'string'
- assert_equal true, 1 == MyObj.new
- assert_equal false, nil == MyObj.new
- assert_equal true, MyObj.new == 1
- assert_equal true, MyObj.new == nil
- end
-
-end
diff --git a/test/ruby/test_pack.rb b/test/ruby/test_pack.rb
index 6101a30219..a8f0176879 100644
--- a/test/ruby/test_pack.rb
+++ b/test/ruby/test_pack.rb
@@ -47,131 +47,15 @@ class TestPack < Test::Unit::TestCase
end
def test_pack_U
- assert_raise(RangeError) { [-0x40000001].pack("U") }
- assert_raise(RangeError) { [-0x40000000].pack("U") }
- assert_raise(RangeError) { [-1].pack("U") }
+ assert_raises(RangeError) { [-0x40000001].pack("U") }
+ assert_raises(RangeError) { [-0x40000000].pack("U") }
+ assert_raises(RangeError) { [-1].pack("U") }
assert_equal "\000", [0].pack("U")
- assert_equal "\374\277\277\277\277\277".force_encoding(Encoding::UTF_8), [0x3fffffff].pack("U")
- assert_equal "\375\200\200\200\200\200".force_encoding(Encoding::UTF_8), [0x40000000].pack("U")
- assert_equal "\375\277\277\277\277\277".force_encoding(Encoding::UTF_8), [0x7fffffff].pack("U")
- assert_raise(RangeError) { [0x80000000].pack("U") }
- assert_raise(RangeError) { [0x100000000].pack("U") }
- end
-
- def test_pack_P
- a = ["abc"]
- assert_equal a, a.pack("P").unpack("P*")
- assert_equal "a", a.pack("P").unpack("P")[0]
- assert_equal a, a.pack("P").freeze.unpack("P*")
- assert_raise(ArgumentError) { (a.pack("P") + "").unpack("P*") }
- end
-
- def test_pack_p
- a = ["abc"]
- assert_equal a, a.pack("p").unpack("p*")
- assert_equal a[0], a.pack("p").unpack("p")[0]
- assert_equal a, a.pack("p").freeze.unpack("p*")
- assert_raise(ArgumentError) { (a.pack("p") + "").unpack("p*") }
- end
-
- def test_format_string_modified
- fmt = "CC"
- o = Object.new
- class << o; self; end.class_eval do
- define_method(:to_int) { fmt.clear; 0 }
- end
- assert_raise(RuntimeError) do
- [o, o].pack(fmt)
- end
- end
-
- def test_comment
- assert_equal("\0\1", [0,1].pack(" C #foo \n C "))
- assert_equal([0,1], "\0\1".unpack(" C #foo \n C "))
- end
-
- def test_illegal_bang
- assert_raise(ArgumentError) { [].pack("a!") }
- assert_raise(ArgumentError) { "".unpack("a!") }
- end
-
- def test_pack_unpack_aA
- assert_equal("f", ["foo"].pack("A"))
- assert_equal("f", ["foo"].pack("a"))
- assert_equal("foo", ["foo"].pack("A*"))
- assert_equal("foo", ["foo"].pack("a*"))
- assert_equal("fo", ["foo"].pack("A2"))
- assert_equal("fo", ["foo"].pack("a2"))
- assert_equal("foo ", ["foo"].pack("A4"))
- assert_equal("foo\0", ["foo"].pack("a4"))
- assert_equal(" ", [nil].pack("A"))
- assert_equal("\0", [nil].pack("a"))
- assert_equal("", [nil].pack("A*"))
- assert_equal("", [nil].pack("a*"))
- assert_equal(" ", [nil].pack("A2"))
- assert_equal("\0\0", [nil].pack("a2"))
-
- assert_equal("foo" + "\0" * 27, ["foo"].pack("a30"))
-
- assert_equal(["f"], "foo\0".unpack("A"))
- assert_equal(["f"], "foo\0".unpack("a"))
- assert_equal(["foo"], "foo\0".unpack("A4"))
- assert_equal(["foo\0"], "foo\0".unpack("a4"))
- assert_equal(["foo"], "foo ".unpack("A4"))
- assert_equal(["foo "], "foo ".unpack("a4"))
- assert_equal(["foo"], "foo".unpack("A4"))
- assert_equal(["foo"], "foo".unpack("a4"))
- end
-
- def test_pack_unpack_Z
- assert_equal("f", ["foo"].pack("Z"))
- assert_equal("foo\0", ["foo"].pack("Z*"))
- assert_equal("fo", ["foo"].pack("Z2"))
- assert_equal("foo\0\0", ["foo"].pack("Z5"))
- assert_equal("\0", [nil].pack("Z"))
- assert_equal("\0", [nil].pack("Z*"))
- assert_equal("\0\0", [nil].pack("Z2"))
-
- assert_equal(["f"], "foo\0".unpack("Z"))
- assert_equal(["foo"], "foo".unpack("Z*"))
- assert_equal(["foo"], "foo\0".unpack("Z*"))
- assert_equal(["foo"], "foo".unpack("Z5"))
- end
-
- def test_pack_unpack_bB
- assert_equal("\xff\x00", ["1111111100000000"].pack("b*"))
- assert_equal("\x01\x02", ["1000000001000000"].pack("b*"))
- assert_equal("", ["1"].pack("b0"))
- assert_equal("\x01", ["1"].pack("b1"))
- assert_equal("\x01\x00", ["1"].pack("b2"))
- assert_equal("\x01\x00", ["1"].pack("b3"))
- assert_equal("\x01\x00\x00", ["1"].pack("b4"))
- assert_equal("\x01\x00\x00", ["1"].pack("b5"))
- assert_equal("\x01\x00\x00\x00", ["1"].pack("b6"))
-
- assert_equal("\xff\x00", ["1111111100000000"].pack("B*"))
- assert_equal("\x01\x02", ["0000000100000010"].pack("B*"))
- assert_equal("", ["1"].pack("B0"))
- assert_equal("\x80", ["1"].pack("B1"))
- assert_equal("\x80\x00", ["1"].pack("B2"))
- assert_equal("\x80\x00", ["1"].pack("B3"))
- assert_equal("\x80\x00\x00", ["1"].pack("B4"))
- assert_equal("\x80\x00\x00", ["1"].pack("B5"))
- assert_equal("\x80\x00\x00\x00", ["1"].pack("B6"))
-
- assert_equal(["1111111100000000"], "\xff\x00".unpack("b*"))
- assert_equal(["1000000001000000"], "\x01\x02".unpack("b*"))
- assert_equal([""], "".unpack("b0"))
- assert_equal(["1"], "\x01".unpack("b1"))
- assert_equal(["10"], "\x01".unpack("b2"))
- assert_equal(["100"], "\x01".unpack("b3"))
-
- assert_equal(["1111111100000000"], "\xff\x00".unpack("B*"))
- assert_equal(["0000000100000010"], "\x01\x02".unpack("B*"))
- assert_equal([""], "".unpack("B0"))
- assert_equal(["1"], "\x80".unpack("B1"))
- assert_equal(["10"], "\x80".unpack("B2"))
- assert_equal(["100"], "\x80".unpack("B3"))
+ assert_equal "\374\277\277\277\277\277", [0x3fffffff].pack("U")
+ assert_equal "\375\200\200\200\200\200", [0x40000000].pack("U")
+ assert_equal "\375\277\277\277\277\277", [0x7fffffff].pack("U")
+ assert_raises(RangeError) { [0x80000000].pack("U") }
+ assert_raises(RangeError) { [0x100000000].pack("U") }
end
def test_pack_unpack_hH
@@ -213,282 +97,4 @@ class TestPack < Test::Unit::TestCase
assert_equal(["10ef"], "\x10\xef".unpack("H4"))
assert_equal(["10ef"], "\x10\xef".unpack("H5"))
end
-
- def test_pack_unpack_cC
- assert_equal("\0\1\xff", [0, 1, 255].pack("c*"))
- assert_equal("\0\1\xff", [0, 1, -1].pack("c*"))
-
- assert_equal("\0\1\xff", [0, 1, 255].pack("C*"))
- assert_equal("\0\1\xff", [0, 1, -1].pack("C*"))
-
- assert_equal([0, 1, -1], "\0\1\xff".unpack("c*"))
-
- assert_equal([0, 1, 255], "\0\1\xff".unpack("C*"))
- end
-
- def test_pack_unpack_sS
- s1 = [513, -514].pack("s*")
- s2 = [513, 65022].pack("S*")
- assert_equal(s1, s2)
- assert_equal([513, -514], s2.unpack("s*"))
- assert_equal([513, 65022], s1.unpack("S*"))
-
- s1 = [513, -514].pack("s!*")
- s2 = [513, 65022].pack("S!*")
- assert_equal(s1, s2)
- assert_equal([513, -514], s2.unpack("s!*"))
- assert_equal([513, 65022], s1.unpack("S!*"))
- end
-
- def test_pack_unpack_iI
- s1 = [67305985, -50462977].pack("i*")
- s2 = [67305985, 4244504319].pack("I*")
- assert_equal(s1, s2)
- assert_equal([67305985, -50462977], s2.unpack("i*"))
- assert_equal([67305985, 4244504319], s1.unpack("I*"))
-
- s1 = [67305985, -50462977].pack("i!*")
- s2 = [67305985, 4244504319].pack("I!*")
- assert_equal([67305985, -50462977], s1.unpack("i!*"))
- assert_equal([67305985, 4244504319], s2.unpack("I!*"))
- end
-
- def test_pack_unpack_lL
- s1 = [67305985, -50462977].pack("l*")
- s2 = [67305985, 4244504319].pack("L*")
- assert_equal(s1, s2)
- assert_equal([67305985, -50462977], s2.unpack("l*"))
- assert_equal([67305985, 4244504319], s1.unpack("L*"))
-
- s1 = [67305985, -50462977].pack("l!*")
- s2 = [67305985, 4244504319].pack("L!*")
- assert_equal([67305985, -50462977], s1.unpack("l!*"))
- assert_equal([67305985, 4244504319], s2.unpack("L!*"))
- end
-
- def test_pack_unpack_qQ
- s1 = [578437695752307201, -506097522914230529].pack("q*")
- s2 = [578437695752307201, 17940646550795321087].pack("Q*")
- assert_equal(s1, s2)
- assert_equal([578437695752307201, -506097522914230529], s2.unpack("q*"))
- assert_equal([578437695752307201, 17940646550795321087], s1.unpack("Q*"))
- end
-
- def test_pack_unpack_nN
- assert_equal("\000\000\000\001\377\377\177\377\200\000\377\377", [0,1,-1,32767,-32768,65535].pack("n*"))
- assert_equal("\000\000\000\000\000\000\000\001\377\377\377\377", [0,1,-1].pack("N*"))
-
- assert_equal([0,1,65535,32767,32768,65535], "\000\000\000\001\377\377\177\377\200\000\377\377".unpack("n*"))
- assert_equal([0,1,4294967295], "\000\000\000\000\000\000\000\001\377\377\377\377".unpack("N*"))
- end
-
- def test_pack_unpack_vV
- assert_equal("\000\000\001\000\377\377\377\177\000\200\377\377", [0,1,-1,32767,-32768,65535].pack("v*"))
- assert_equal("\000\000\000\000\001\000\000\000\377\377\377\377", [0,1,-1].pack("V*"))
-
- assert_equal([0,1,65535,32767,32768,65535], "\000\000\001\000\377\377\377\177\000\200\377\377".unpack("v*"))
- assert_equal([0,1,4294967295], "\000\000\000\000\001\000\000\000\377\377\377\377".unpack("V*"))
- end
-
- def test_pack_unpack_fdeEgG
- inf = 1.0/0.0
- nan = inf/inf
- [0.0, 1.0, 3.0, inf, -inf, nan].each do |x|
- %w(f d e E g G).each do |f|
- v = [x].pack(f).unpack(f)
- if x.nan?
- assert(v.first.nan?)
- else
- assert_equal([x], v)
- end
- end
- end
- end
-
- def test_pack_unpack_x
- assert_equal("", [].pack("x0"))
- assert_equal("\0", [].pack("x"))
- assert_equal("\0" * 30, [].pack("x30"))
-
- assert_equal([0, 2], "\x00\x00\x02".unpack("CxC"))
- assert_raise(ArgumentError) { "".unpack("x") }
- end
-
- def test_pack_unpack_X
- assert_equal("\x00\x02", [0, 1, 2].pack("CCXC"))
- assert_equal("\x02", [0, 1, 2].pack("CCX2C"))
- assert_raise(ArgumentError) { [].pack("X") }
-
- assert_equal([0, 2, 2], "\x00\x02".unpack("CCXC"))
- assert_raise(ArgumentError) { "".unpack("X") }
- end
-
- def test_pack_unpack_atmark
- assert_equal("\x01\x00\x00\x02", [1, 2].pack("C@3C"))
- assert_equal("\x02", [1, 2].pack("C@0C"))
- assert_equal("\x01\x02", [1, 2].pack("C@1C"))
-
- assert_equal([1, 2], "\x01\x00\x00\x02".unpack("C@3C"))
- assert_equal([nil], "\x00".unpack("@1C")) # is it OK?
- assert_raise(ArgumentError) { "\x00".unpack("@2C") }
- end
-
- def test_pack_unpack_percent
- assert_raise(ArgumentError) { [].pack("%") }
- assert_raise(ArgumentError) { "".unpack("%") }
- end
-
- def test_pack_unpack_U
- assert_equal([0], [0].pack("U").unpack("U"))
- assert_equal([0x80], [0x80].pack("U").unpack("U"))
- assert_equal([0x800], [0x800].pack("U").unpack("U"))
- assert_equal([0x10000], [0x10000].pack("U").unpack("U"))
- assert_equal([0x400000], [0x400000].pack("U").unpack("U"))
-
- assert_raise(ArgumentError) { "\x80".unpack("U") }
- assert_raise(ArgumentError) { "\xff".unpack("U") }
- assert_raise(ArgumentError) { "\xfc\x00".unpack("U") }
- assert_raise(ArgumentError) { "\xc0\xc0".unpack("U") }
- assert_raise(ArgumentError) { "\xe0\x80\x80".unpack("U") }
- end
-
- def test_pack_unpack_u
- assert_equal("", [""].pack("u"))
- assert_equal("!80``\n", ["a"].pack("u"))
- assert_equal("#86)C\n", ["abc"].pack("u"))
- assert_equal("$86)C9```\n", ["abcd"].pack("u"))
- assert_equal("M86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A\n", ["a"*45].pack("u"))
- assert_equal("M86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A\n!80``\n", ["a"*46].pack("u"))
- assert_equal("&86)C9&5F\n#9VAI\n", ["abcdefghi"].pack("u6"))
-
- assert_equal("M86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A\n!80``\n", ["a"*46].pack("u0"))
- assert_equal("M86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A\n!80``\n", ["a"*46].pack("u1"))
- assert_equal("M86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A\n!80``\n", ["a"*46].pack("u2"))
-
- assert_equal([""], "".unpack("u"))
- assert_equal(["a"], "!80``\n".unpack("u"))
- assert_equal(["abc"], "#86)C\n".unpack("u"))
- assert_equal(["abcd"], "$86)C9```\n".unpack("u"))
- assert_equal(["a"*45], "M86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A\n".unpack("u"))
- assert_equal(["a"*46], "M86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A\n!80``\n".unpack("u"))
- assert_equal(["abcdefghi"], "&86)C9&5F\n#9VAI\n".unpack("u"))
-
- assert_equal(["\x00"], "\"\n".unpack("u"))
- assert_equal(["\x00"], "! \r \n".unpack("u"))
- end
-
- def test_pack_unpack_m
- assert_equal("", [""].pack("m"))
- assert_equal("AA==\n", ["\0"].pack("m"))
- assert_equal("AAA=\n", ["\0\0"].pack("m"))
- assert_equal("AAAA\n", ["\0\0\0"].pack("m"))
- assert_equal("/w==\n", ["\377"].pack("m"))
- assert_equal("//8=\n", ["\377\377"].pack("m"))
- assert_equal("////\n", ["\377\377\377"].pack("m"))
-
- assert_equal([""], "".unpack("m"))
- assert_equal(["\0"], "AA==\n".unpack("m"))
- assert_equal(["\0\0"], "AAA=\n".unpack("m"))
- assert_equal(["\0\0\0"], "AAAA\n".unpack("m"))
- assert_equal(["\377"], "/w==\n".unpack("m"))
- assert_equal(["\377\377"], "//8=\n".unpack("m"))
- assert_equal(["\377\377\377"], "////\n".unpack("m"))
- end
-
- def test_pack_unpack_m0
- assert_equal("", [""].pack("m0"))
- assert_equal("AA==", ["\0"].pack("m0"))
- assert_equal("AAA=", ["\0\0"].pack("m0"))
- assert_equal("AAAA", ["\0\0\0"].pack("m0"))
- assert_equal("/w==", ["\377"].pack("m0"))
- assert_equal("//8=", ["\377\377"].pack("m0"))
- assert_equal("////", ["\377\377\377"].pack("m0"))
-
- assert_equal([""], "".unpack("m0"))
- assert_equal(["\0"], "AA==".unpack("m0"))
- assert_equal(["\0\0"], "AAA=".unpack("m0"))
- assert_equal(["\0\0\0"], "AAAA".unpack("m0"))
- assert_equal(["\377"], "/w==".unpack("m0"))
- assert_equal(["\377\377"], "//8=".unpack("m0"))
- assert_equal(["\377\377\377"], "////".unpack("m0"))
-
- assert_raise(ArgumentError) { "^".unpack("m0") }
- assert_raise(ArgumentError) { "A".unpack("m0") }
- assert_raise(ArgumentError) { "A^".unpack("m0") }
- assert_raise(ArgumentError) { "AA".unpack("m0") }
- assert_raise(ArgumentError) { "AA=".unpack("m0") }
- assert_raise(ArgumentError) { "AA===".unpack("m0") }
- assert_raise(ArgumentError) { "AA=x".unpack("m0") }
- assert_raise(ArgumentError) { "AAA".unpack("m0") }
- assert_raise(ArgumentError) { "AAA^".unpack("m0") }
- assert_raise(ArgumentError) { "AB==".unpack("m0") }
- assert_raise(ArgumentError) { "AAB=".unpack("m0") }
- end
-
- def test_pack_unpack_M
- assert_equal("a b c\td =\n\ne=\n", ["a b c\td \ne"].pack("M"))
- assert_equal(["a b c\td \ne"], "a b c\td =\n\ne=\n".unpack("M"))
- assert_equal("=00=\n", ["\0"].pack("M"))
- assert_equal("a"*73+"=\na=\n", ["a"*74].pack("M"))
- assert_equal(("a"*73+"=\n")*14+"a=\n", ["a"*1023].pack("M"))
- assert_equal(["\0"], "=00=\n".unpack("M"))
- assert_equal(["a"*74], ("a"*73+"=\na=\n").unpack("M"))
- assert_equal(["a"*1023], (("a"*73+"=\n")*14+"a=\n").unpack("M"))
- assert_equal(["\x0a"], "=0a=\n".unpack("M"))
- assert_equal(["\x0a"], "=0A=\n".unpack("M"))
- assert_equal([""], "=0Z=\n".unpack("M"))
- assert_equal([""], "=\r\n".unpack("M"))
- end
-
- def test_pack_unpack_P2
- assert_raise(ArgumentError) { ["abc"].pack("P4") }
- assert_raise(ArgumentError) { [""].pack("P") }
-
- assert_equal([], ".".unpack("P"))
- assert_equal([], ".".unpack("p"))
- assert_equal([nil], ("\0" * 1024).unpack("P"))
- end
-
- def test_pack_p2
- assert([nil].pack("p") =~ /\A\0*\Z/)
- end
-
- def test_pack_unpack_w
- assert_equal("\000", [0].pack("w"))
- assert_equal("\001", [1].pack("w"))
- assert_equal("\177", [127].pack("w"))
- assert_equal("\201\000", [128].pack("w"))
- assert_equal("\377\177", [0x3fff].pack("w"))
- assert_equal("\201\200\000", [0x4000].pack("w"))
- assert_equal("\203\377\377\377\177", [0x3fffffff].pack("w"))
- assert_equal("\204\200\200\200\000", [0x40000000].pack("w"))
- assert_equal("\217\377\377\377\177", [0xffffffff].pack("w"))
- assert_equal("\220\200\200\200\000", [0x100000000].pack("w"))
- assert_raise(ArgumentError) { [-1].pack("w") }
-
- assert_equal([0], "\000".unpack("w"))
- assert_equal([1], "\001".unpack("w"), [1])
- assert_equal([127], "\177".unpack("w"), [127])
- assert_equal([128], "\201\000".unpack("w"), [128])
- assert_equal([0x3fff], "\377\177".unpack("w"), [0x3fff])
- assert_equal([0x4000], "\201\200\000".unpack("w"), [0x4000])
- assert_equal([0x3fffffff], "\203\377\377\377\177".unpack("w"), [0x3fffffff])
- assert_equal([0x40000000], "\204\200\200\200\000".unpack("w"), [0x40000000])
- assert_equal([0xffffffff], "\217\377\377\377\177".unpack("w"), [0xffffffff])
- assert_equal([0x100000000], "\220\200\200\200\000".unpack("w"), [0x100000000])
- end
-
- def test_modify_under_safe4
- s = "foo"
- assert_raise(SecurityError) do
- Thread.new do
- $SAFE = 4
- s.clear
- end.join
- end
- end
-
- def test_length_too_big
- assert_raise(RangeError) { [].pack("C100000000000000000000") }
- end
end
diff --git a/test/ruby/test_parse.rb b/test/ruby/test_parse.rb
deleted file mode 100644
index 5dc3caf561..0000000000
--- a/test/ruby/test_parse.rb
+++ /dev/null
@@ -1,826 +0,0 @@
-require 'test/unit'
-require 'stringio'
-
-class TestParse < Test::Unit::TestCase
- def setup
- @verbose = $VERBOSE
- $VERBOSE = nil
- end
-
- def teardown
- $VERBOSE = @verbose
- end
-
- def test_else_without_rescue
- x = eval <<-END
- begin
- else
- 42
- end
- END
- assert_equal(42, x)
- end
-
- def test_alias_backref
- assert_raise(SyntaxError) do
- eval <<-END
- alias $foo $1
- END
- end
- end
-
- def test_command_call
- t = Object.new
- def t.foo(x); x; end
-
- a = false
- b = c = d = true
- assert_nothing_raised do
- eval <<-END
- a &&= t.foo 42
- b &&= t.foo 42
- c &&= t.foo nil
- d &&= t.foo false
- END
- end
- assert_equal([false, 42, nil, false], [a, b, c, d])
-
- a = 3
- assert_nothing_raised { eval("a &= t.foo 5") }
- assert_equal(1, a)
-
- a = [nil, nil, true, true]
- assert_nothing_raised do
- eval <<-END
- a[0] ||= t.foo 42
- a[1] &&= t.foo 42
- a[2] ||= t.foo 42
- a[3] &&= t.foo 42
- END
- end
- assert_equal([42, nil, true, 42], a)
-
- o = Object.new
- class << o
- attr_accessor :foo, :bar, :Foo, :Bar, :baz, :qux
- end
- o.foo = o.Foo = o::baz = nil
- o.bar = o.Bar = o::qux = 1
- assert_nothing_raised do
- eval <<-END
- o.foo ||= t.foo 42
- o.bar &&= t.foo 42
- o.Foo ||= t.foo 42
- o.Bar &&= t.foo 42
- o::baz ||= t.foo 42
- o::qux &&= t.foo 42
- END
- end
- assert_equal([42, 42], [o.foo, o.bar])
- assert_equal([42, 42], [o.Foo, o.Bar])
- assert_equal([42, 42], [o::baz, o::qux])
-
- assert_raise(SyntaxError) do
- eval <<-END
- $1 ||= t.foo 42
- END
- end
-
- def t.bar(x); x + yield; end
-
- a = b = nil
- assert_nothing_raised do
- eval <<-END
- a = t.bar "foo" do
- "bar"
- end.gsub "ob", "OB"
- b = t.bar "foo" do
- "bar"
- end::gsub "ob", "OB"
- END
- end
- assert_equal("foOBar", a)
- assert_equal("foOBar", b)
-
- a = nil
- assert_nothing_raised do
- t.instance_eval <<-END
- a = bar "foo" do "bar" end
- END
- end
- assert_equal("foobar", a)
-
- a = nil
- assert_nothing_raised do
- eval <<-END
- a = t::bar "foo" do "bar" end
- END
- end
- assert_equal("foobar", a)
-
- def t.baz(*r)
- @baz = r + (block_given? ? [yield] : [])
- end
-
- assert_nothing_raised do
- t.instance_eval "baz (1), 2"
- end
- assert_equal([1, 2], t.instance_eval { @baz })
- end
-
- def test_mlhs_node
- c = Class.new
- class << c
- attr_accessor :foo, :bar, :Foo, :Bar
- FOO = BAR = nil
- end
-
- assert_nothing_raised do
- eval <<-END
- c::foo, c::bar = 1, 2
- c.Foo, c.Bar = 1, 2
- c::FOO, c::BAR = 1, 2
- END
- end
- assert_equal([1, 2], [c::foo, c::bar])
- assert_equal([1, 2], [c.Foo, c.Bar])
- assert_equal([1, 2], [c::FOO, c::BAR])
- end
-
- def test_dynamic_constant_assignment
- assert_raise(SyntaxError) do
- Object.new.instance_eval <<-END
- def foo
- self::FOO, self::BAR = 1, 2
- ::FOO, ::BAR = 1, 2
- end
- END
- end
-
- assert_raise(SyntaxError) do
- eval <<-END
- $1, $2 = 1, 2
- END
- end
-
- assert_raise(SyntaxError) do
- Object.new.instance_eval <<-END
- def foo
- ::FOO = 1
- end
- END
- end
-
- c = Class.new
- assert_raise(SyntaxError) do
- eval <<-END
- c::FOO &= 1
- ::FOO &= 1
- END
- end
-
- c = Class.new
- assert_raise(SyntaxError) do
- eval <<-END
- $1 &= 1
- END
- end
- end
-
- def test_class_module
- assert_raise(SyntaxError) do
- eval <<-END
- class foo; end
- END
- end
-
- assert_raise(SyntaxError) do
- eval <<-END
- def foo
- class Foo; end
- module Bar; end
- end
- END
- end
-
- assert_raise(SyntaxError) do
- eval <<-END
- class Foo Bar; end
- END
- end
- end
-
- def test_op_name
- o = Object.new
- def o.>(x); x; end
- def o./(x); x; end
-
- a = nil
- assert_nothing_raised do
- o.instance_eval <<-END
- undef >, /
- END
- end
- end
-
- def test_arg
- o = Object.new
- class << o
- attr_accessor :foo, :bar, :Foo, :Bar, :baz, :qux
- end
- o.foo = o.Foo = o::baz = nil
- o.bar = o.Bar = o::qux = 1
- assert_nothing_raised do
- eval <<-END
- o.foo ||= 42
- o.bar &&= 42
- o.Foo ||= 42
- o.Bar &&= 42
- o::baz ||= 42
- o::qux &&= 42
- END
- end
- assert_equal([42, 42], [o.foo, o.bar])
- assert_equal([42, 42], [o.Foo, o.Bar])
- assert_equal([42, 42], [o::baz, o::qux])
-
- a = nil
- assert_nothing_raised do
- eval <<-END
- a = -2.0 ** 2
- END
- end
- assert_equal(-4.0, a)
- end
-
- def test_block_variable
- o = Object.new
- def o.foo(*r); yield(*r); end
-
- a = nil
- assert_nothing_raised do
- eval <<-END
- o.foo 1 do|; a| a = 42 end
- END
- end
- assert_nil(a)
- end
-
- def test_bad_arg
- assert_raise(SyntaxError) do
- eval <<-END
- def foo(FOO); end
- END
- end
-
- assert_raise(SyntaxError) do
- eval <<-END
- def foo(@foo); end
- END
- end
-
- assert_raise(SyntaxError) do
- eval <<-END
- def foo($foo); end
- END
- end
-
- assert_raise(SyntaxError) do
- eval <<-END
- def foo(@@foo); end
- END
- end
-
- o = Object.new
- def o.foo(*r); yield(*r); end
-
- assert_raise(SyntaxError) do
- eval <<-END
- o.foo 1 {|; @a| @a = 42 }
- END
- end
- end
-
- def test_do_lambda
- a = b = nil
- assert_nothing_raised do
- eval <<-END
- a = -> do
- b = 42
- end
- END
- end
- a.call
- assert_equal(42, b)
- end
-
- def test_block_call_colon2
- o = Object.new
- def o.foo(x); x + yield; end
-
- a = b = nil
- assert_nothing_raised do
- o.instance_eval <<-END
- a = foo 1 do 42 end.to_s
- b = foo 1 do 42 end::to_s
- END
- end
- assert_equal("43", a)
- assert_equal("43", b)
- end
-
- def test_call_method
- a = b = nil
- assert_nothing_raised do
- eval <<-END
- a = proc {|x| x + "bar" }.("foo")
- b = proc {|x| x + "bar" }::("foo")
- END
- end
- assert_equal("foobar", a)
- assert_equal("foobar", b)
- end
-
- def test_xstring
- assert_raise(Errno::ENOENT) do
- eval("``")
- end
- end
-
- def test_words
- assert_equal([], %W( ))
- end
-
- def test_dstr
- @@foo = 1
- assert_equal("foo 1 bar", "foo #@@foo bar")
- "1" =~ /(.)/
- assert_equal("foo 1 bar", "foo #$1 bar")
- end
-
- def test_dsym
- assert_nothing_raised { eval(':""') }
- end
-
- def test_arg2
- o = Object.new
-
- assert_nothing_raised do
- eval <<-END
- def o.foo(a=42,*r,z,&b); b.call(r.inject(a*1000+z*100, :+)); end
- END
- end
- assert_equal(-1405, o.foo(1,2,3,4) {|x| -x })
- assert_equal(-1302, o.foo(1,2,3) {|x| -x })
- assert_equal(-1200, o.foo(1,2) {|x| -x })
- assert_equal(-42100, o.foo(1) {|x| -x })
- assert_raise(ArgumentError) { o.foo() }
-
- assert_nothing_raised do
- eval <<-END
- def o.foo(a=42,z,&b); b.call(a*1000+z*100); end
- END
- end
- assert_equal(-1200, o.foo(1,2) {|x| -x } )
- assert_equal(-42100, o.foo(1) {|x| -x } )
- assert_raise(ArgumentError) { o.foo() }
-
- assert_nothing_raised do
- eval <<-END
- def o.foo(*r,z,&b); b.call(r.inject(z*100, :+)); end
- END
- end
- assert_equal(-303, o.foo(1,2,3) {|x| -x } )
- assert_equal(-201, o.foo(1,2) {|x| -x } )
- assert_equal(-100, o.foo(1) {|x| -x } )
- assert_raise(ArgumentError) { o.foo() }
- end
-
- def test_duplicate_argument
- assert_raise(SyntaxError) do
- eval <<-END
- 1.times {|&b?| }
- END
- end
-
- assert_raise(SyntaxError) do
- eval <<-END
- 1.times {|a, a|}
- END
- end
-
- assert_raise(SyntaxError) do
- eval <<-END
- def foo(a, a); end
- END
- end
- end
-
- def test_define_singleton_error
- assert_raise(SyntaxError) do
- eval <<-END
- def ("foo").foo; end
- END
- end
- end
-
- def test_backquote
- t = Object.new
-
- assert_nothing_raised do
- eval <<-END
- def t.`(x); "foo" + x + "bar"; end
- END
- end
- a = b = nil
- assert_nothing_raised do
- eval <<-END
- a = t.` "zzz"
- 1.times {|;z| t.` ("zzz") }
- END
- t.instance_eval <<-END
- b = `zzz`
- END
- end
- assert_equal("foozzzbar", a)
- assert_equal("foozzzbar", b)
- end
-
- def test_carrige_return
- assert_equal(2, eval("1 +\r\n1"))
- end
-
- def test_string
- assert_raise(SyntaxError) do
- eval '"\xg1"'
- end
-
- assert_raise(SyntaxError) do
- eval '"\u{1234"'
- end
-
- assert_raise(SyntaxError) do
- eval '"\M1"'
- end
-
- assert_raise(SyntaxError) do
- eval '"\C1"'
- end
-
- assert_equal("\x81", eval('"\C-\M-a"'))
- assert_equal("\177", eval('"\c?"'))
- end
-
- def test_question
- assert_raise(SyntaxError) { eval('?') }
- assert_raise(SyntaxError) { eval('? ') }
- assert_raise(SyntaxError) { eval("?\n") }
- assert_raise(SyntaxError) { eval("?\t") }
- assert_raise(SyntaxError) { eval("?\v") }
- assert_raise(SyntaxError) { eval("?\r") }
- assert_raise(SyntaxError) { eval("?\f") }
- assert_equal("\u{1234}", eval("?\u{1234}"))
- assert_equal("\u{1234}", eval('?\u{1234}'))
- end
-
- def test_percent
- assert_equal(:foo, eval('%s(foo)'))
- assert_raise(SyntaxError) { eval('%s') }
- assert_raise(SyntaxError) { eval('%ss') }
- assert_raise(SyntaxError) { eval('%z()') }
- end
-
- def test_symbol
- assert_raise(SyntaxError) do
- eval ":'foo\0bar'"
- end
- assert_raise(SyntaxError) do
- eval ':"foo\u0000bar"'
- end
- assert_raise(SyntaxError) do
- eval ':"foo\u{0}bar"'
- end
- assert_raise(SyntaxError) do
- eval ':"foo\u{}bar"'
- end
- end
-
- def test_parse_string
- assert_raise(SyntaxError) do
- eval <<-END
-/
- END
- end
- end
-
- def test_here_document
- x = nil
-
- assert_raise(SyntaxError) do
- eval %q(
-<<FOO
- )
- end
-
- assert_raise(SyntaxError) do
- eval %q(
-<<FOO
-#$
-FOO
- )
- end
-
- assert_raise(SyntaxError) do
- eval %q(
-<<"
- )
- end
-
- assert_raise(SyntaxError) do
- eval %q(
-<<``
- )
- end
-
- assert_raise(SyntaxError) do
- eval %q(
-<<--
- )
- end
-
- assert_raise(SyntaxError) do
- eval %q(
-<<FOO
-#$
-foo
-FOO
- )
- end
-
- assert_nothing_raised do
- eval "x = <<FOO\r\n1\r\nFOO"
- end
- assert_equal("1\n", x)
- end
-
- def test_magic_comment
- x = nil
- assert_nothing_raised do
- eval <<-END
-# coding = utf-8
-x = __ENCODING__
- END
- end
- assert_equal(Encoding.find("UTF-8"), x)
-
- assert_raise(ArgumentError) do
- eval <<-END
-# coding = foobarbazquxquux_dummy_enconding
-x = __ENCODING__
- END
- end
- end
-
- def test_utf8_bom
- x = nil
- assert_nothing_raised do
- eval "\xef\xbb\xbf x = __ENCODING__"
- end
- assert_equal(Encoding.find("UTF-8"), x)
- assert_raise(NameError) { eval "\xef" }
- end
-
- def test_dot_in_next_line
- x = nil
- assert_nothing_raised do
- eval <<-END
- x = 1
- .to_s
- END
- end
- assert_equal("1", x)
- end
-
- def test_pow_asgn
- x = 3
- assert_nothing_raised { eval("x **= 2") }
- assert_equal(9, x)
- end
-
- def test_embedded_rd
- assert_raise(SyntaxError) do
- eval <<-END
-=begin
- END
- end
- end
-
- def test_float
- assert_equal(1.0/0, eval("1e10000"))
- assert_raise(SyntaxError) { eval('1_E') }
- assert_raise(SyntaxError) { eval('1E1E1') }
- end
-
- def test_global_variable
- assert_equal(nil, eval('$-x'))
- assert_equal(nil, eval('alias $preserve_last_match $&'))
- assert_equal(nil, eval('alias $& $test_parse_foobarbazqux'))
- $test_parse_foobarbazqux = nil
- assert_equal(nil, $&)
- assert_equal(nil, eval('alias $& $preserve_last_match'))
- assert_raise(SyntaxError) { eval('$#') }
- end
-
- def test_invalid_instance_variable
- assert_raise(SyntaxError) { eval('@#') }
- end
-
- def test_invalid_class_variable
- assert_raise(SyntaxError) { eval('@@1') }
- end
-
- def test_invalid_char
- x = 1
- assert_equal(1, eval("\x01x"))
- assert_equal(nil, eval("\x04x"))
- end
-
- def test_literal_concat
- x = "baz"
- assert_equal("foobarbaz", eval('"foo" "bar#{x}"'))
- end
-
- def test_unassignable
- assert_raise(SyntaxError) do
- eval %q(self = 1)
- end
- assert_raise(SyntaxError) do
- eval %q(nil = 1)
- end
- assert_raise(SyntaxError) do
- eval %q(true = 1)
- end
- assert_raise(SyntaxError) do
- eval %q(false = 1)
- end
- assert_raise(SyntaxError) do
- eval %q(__FILE__ = 1)
- end
- assert_raise(SyntaxError) do
- eval %q(__LINE__ = 1)
- end
- assert_raise(SyntaxError) do
- eval %q(__ENCODING__ = 1)
- end
- assert_raise(SyntaxError) do
- eval <<-END
- def foo
- FOO = 1
- end
- END
- end
- end
-
- def test_block_dup
- assert_raise(SyntaxError) do
- eval <<-END
- foo(&proc{}) {}
- END
- end
- end
-
- def test_set_backref
- assert_raise(SyntaxError) do
- eval <<-END
- $& = 1
- END
- end
- end
-
- def test_arg_concat
- o = Object.new
- class << o; self; end.instance_eval do
- define_method(:[]=) {|*r, &b| b.call(r) }
- end
- r = nil
- assert_nothing_raised do
- eval <<-END
- o[&proc{|x| r = x }] = 1
- END
- end
- assert_equal([1], r)
- end
-
- def test_void_expr_stmts_value
- # This test checks if void contexts are warned correctly.
- # Thus, warnings MUST NOT be suppressed.
- $VERBOSE = true
- stderr = $stderr
- $stderr = StringIO.new("")
- x = 1
- assert_nil eval("x; nil")
- assert_nil eval("1+1; nil")
- assert_nil eval("TestParse; nil")
- assert_nil eval("::TestParse; nil")
- assert_nil eval("x..x; nil")
- assert_nil eval("x...x; nil")
- assert_nil eval("self; nil")
- assert_nil eval("nil; nil")
- assert_nil eval("true; nil")
- assert_nil eval("false; nil")
- assert_nil eval("defined?(1); nil")
-
- assert_raise(SyntaxError) do
- eval %q(1; next; 2)
- end
-
- o = Object.new
- assert_nothing_raised do
- eval <<-END
- x = def o.foo; end
- END
- end
- assert_equal($stderr.string.lines.to_a.size, 14)
- $stderr = stderr
- end
-
- def test_assign_in_conditional
- assert_raise(SyntaxError) do
- eval <<-END
- (x, y = 1, 2) ? 1 : 2
- END
- end
-
- assert_nothing_raised do
- eval <<-END
- if @x = true
- 1
- else
- 2
- end
- END
- end
- end
-
- def test_literal_in_conditional
- assert_nothing_raised do
- eval <<-END
- "foo" ? 1 : 2
- END
- end
-
- assert_nothing_raised do
- x = "bar"
- eval <<-END
- /foo#{x}baz/ ? 1 : 2
- END
- end
-
- assert_nothing_raised do
- eval <<-END
- (true..false) ? 1 : 2
- END
- end
-
- assert_nothing_raised do
- eval <<-END
- ("foo".."bar") ? 1 : 2
- END
- end
-
- assert_nothing_raised do
- x = "bar"
- eval <<-END
- :"foo#{"x"}baz" ? 1 : 2
- END
- end
- end
-
- def test_no_blockarg
- assert_raise(SyntaxError) do
- eval <<-END
- yield(&:+)
- END
- end
- end
-
- def test_intern
- assert_equal(':""', ''.intern.inspect)
- assert_equal(':$foo', '$foo'.intern.inspect)
- assert_equal(':"!foo"', '!foo'.intern.inspect)
- assert_equal(':"foo=="', "foo==".intern.inspect)
- end
-
- def test_all_symbols
- x = Symbol.all_symbols
- assert_kind_of(Array, x)
- assert(x.all? {|s| s.is_a?(Symbol) })
- end
-
- def test_is_class_id
- c = Class.new
- assert_raise(NameError) do
- c.instance_eval { remove_class_variable(:@var) }
- end
- end
-end
diff --git a/test/ruby/test_path.rb b/test/ruby/test_path.rb
index 24fc3a9d25..63dbd07346 100644
--- a/test/ruby/test_path.rb
+++ b/test/ruby/test_path.rb
@@ -44,13 +44,13 @@ class TestPath < Test::Unit::TestCase
assert_equal("//sub", File.expand_path("sub", "//"))
end
- def test_dirname
- if /(bcc|ms)win\d|mingw|cygwin|emx/ =~ RUBY_PLATFORM
+ def test_dirname # [ruby-dev:27738]
+ if /(bcc|ms)win\d|mingw|cygwin|djgpp|human|emx/ =~ RUBY_PLATFORM
# DOSISH_DRIVE_LETTER
assert_equal('C:.', File.dirname('C:'))
assert_equal('C:.', File.dirname('C:a'))
assert_equal('C:.', File.dirname('C:a/'))
- assert_equal('C:a', File.dirname('C:a/b'), "[ruby-dev:27738]")
+ assert_equal('C:a', File.dirname('C:a/b'))
assert_equal('C:/', File.dirname('C:/'))
assert_equal('C:/', File.dirname('C:/a'))
@@ -62,7 +62,7 @@ class TestPath < Test::Unit::TestCase
assert_equal('C:/', File.dirname('C://a/'))
assert_equal('C:/a', File.dirname('C://a/b'))
- assert_equal('C:/', File.dirname('C:///'), "[ruby-dev:27738]")
+ assert_equal('C:/', File.dirname('C:///'))
assert_equal('C:/', File.dirname('C:///a'))
assert_equal('C:/', File.dirname('C:///a/'))
assert_equal('C:/a', File.dirname('C:///a/b'))
@@ -101,7 +101,7 @@ class TestPath < Test::Unit::TestCase
assert_equal('/', File.dirname('/a/'))
assert_equal('/a', File.dirname('/a/b'))
- if /(bcc|ms|cyg)win|mingw|emx/ =~ RUBY_PLATFORM
+ if /(bcc|ms|cyg)win|mingw|djgpp|human|emx/ =~ RUBY_PLATFORM
# DOSISH_UNC
assert_equal('//', File.dirname('//'))
assert_equal('//a', File.dirname('//a'))
@@ -134,8 +134,8 @@ class TestPath < Test::Unit::TestCase
end
end
- def test_basename
- if /(bcc|ms)win\d|mingw|cygwin|emx/ =~ RUBY_PLATFORM
+ def test_basename # [ruby-dev:27766]
+ if /(bcc|ms)win\d|mingw|cygwin|djgpp|human|emx/ =~ RUBY_PLATFORM
# DOSISH_DRIVE_LETTER
assert_equal('', File.basename('C:'))
assert_equal('a', File.basename('C:a'))
@@ -189,14 +189,12 @@ class TestPath < Test::Unit::TestCase
assert_equal('a', File.basename('/a/'))
assert_equal('b', File.basename('/a/b'))
- assert_equal("..", File.basename("..", ".*"))
-
- if /(bcc|ms|cyg)win|mingw|emx/ =~ RUBY_PLATFORM
+ if /(bcc|ms|cyg)win|mingw|djgpp|human|emx/ =~ RUBY_PLATFORM
# DOSISH_UNC
assert_equal('/', File.basename('//'))
assert_equal('/', File.basename('//a'))
assert_equal('/', File.basename('//a/'))
- assert_equal('/', File.basename('//a/b'), "[ruby-dev:27776]")
+ assert_equal('/', File.basename('//a/b'))
assert_equal('/', File.basename('//a/b/'))
assert_equal('c', File.basename('//a/b/c'))
@@ -223,13 +221,4 @@ class TestPath < Test::Unit::TestCase
assert_equal('c', File.basename('///a/b/c'))
end
end
-
- def test_extname
- assert_equal('', File.extname('a'))
- assert_equal('.rb', File.extname('a.rb'))
- assert_equal('', File.extname('a.rb.'))
- assert_equal('', File.extname('a.'))
- assert_equal('', File.extname('.x'))
- assert_equal('', File.extname('..x'))
- end
end
diff --git a/test/ruby/test_pipe.rb b/test/ruby/test_pipe.rb
index 34f231ad8c..c3b4d29c0a 100644
--- a/test/ruby/test_pipe.rb
+++ b/test/ruby/test_pipe.rb
@@ -1,5 +1,7 @@
require 'test/unit'
-require_relative 'ut_eof'
+$:.replace([File.dirname(File.expand_path(__FILE__))] | $:)
+require 'ut_eof'
+require 'envutil'
class TestPipe < Test::Unit::TestCase
include TestEOF
diff --git a/test/ruby/test_primitive.rb b/test/ruby/test_primitive.rb
deleted file mode 100644
index 46133eff8c..0000000000
--- a/test/ruby/test_primitive.rb
+++ /dev/null
@@ -1,397 +0,0 @@
-require 'test/unit'
-
-class TestRubyPrimitive < Test::Unit::TestCase
-
- def test_not
- assert_equal false, !true
- assert_equal true, !false
- assert_equal true, !nil
- assert_equal false, !(1+1)
- assert_equal false, !!nil
- assert_equal true, !!1
- end
-
- def test_lvar
- a = 1
- assert_equal 1, a
- b = 2
- assert_equal 1, a
- a = b = 3
- assert_equal 3, a
- assert_equal 3, b
- a = b = c = 4
- assert_equal 4, a
- assert_equal 4, b
- assert_equal 4, c
- end
-
- C = 1
- class A
- Const = 1
- class B
- Const = 2
- class C
- Const = 3
- def const
- Const
- end
- end
- end
- end
- (1..2).map {
- A::B::C::Const
- }
-
- def test_constant
- assert_equal 1, C
- assert_equal 1, C
- assert_equal 1, A::Const
- assert_equal 2, A::B::Const
- assert_equal 3, A::B::C::Const
- assert_equal 3, A::B::C.new.const
- assert_equal 1, ::TestRubyPrimitive::A::Const
- A::B::C.send(:remove_const, :Const)
- assert_equal 2, A::B::C.new.const
- assert_raise(TypeError) {
- C::CONST
- }
- end
-
- class A2
- class B2
- class C2
- C = 7
- end
- end
- end
-
- def test_constant_cache
- i = 0
- while i < 3
- r = A2::B2::C2::C
- i += 1
- end
- assert_equal 7, r
- end
-
- class A3
- class B3
- C = 99
- end
- end
- i = 0
- while i < 3
- r = A3::B3::C # cache
- class A3::B3
- remove_const :C
- end
- A3::B3::C = i ** i
- i += 1
- end
-
- def test_constant_cache2
- assert_equal 4, A3::B3::C
- end
-
- class A4
- Const = 7
- (1..3).map {
- $test_ruby_primitive_constant_cache3 = self::Const
- }
- end
-
- def test_constant_cache3
- assert_equal 7, $test_ruby_primitive_constant_cache3
- end
-
- class A5
- Const = 8
- (1..3).map {
- $test_ruby_primitive_constant_cache4 = eval('self')::Const
- }
- end
-
- def test_constatant_cache4
- assert_equal 8, $test_ruby_primitive_constant_cache4
- end
-
- class A6
- Const = 0
- def self.foo
- self::Const
- end
- end
- class B6 < A6
- Const = 1
- end
- class C6 < B6
- Const = 2
- end
- $test_ruby_primitive_constant_cache5 = [A6.foo, B6.foo, C6.foo]
-
- def test_constant_cache5
- assert_equal [0, 1, 2], $test_ruby_primitive_constant_cache5
- end
-
- def test_gvar
- $test_ruby_primitive_gvar = 7
- assert_equal 7, $test_ruby_primitive_gvar
- assert_equal 7, $test_ruby_primitive_gvar
- $test_ruby_primitive_gvar = 88
- assert_equal 88, $test_ruby_primitive_gvar
- assert_equal 88, $test_ruby_primitive_gvar
- assert_equal 7, ($test_ruby_primitive_gvar = 7)
- assert_equal 7, ($test_ruby_primitive_gvar = 7)
- end
-
- class A7
- @@c = 1
- def m
- @@c += 1
- end
- end
-
- def test_cvar_from_instance_method
- assert_equal 2, A7.new.m
- assert_equal 3, A7.new.m
- assert_equal 4, A7.new.m
- end
-
- class A8
- @@c = 1
- class << self
- def m
- @@c += 1
- end
- end
- end
-
- def test_cvar_from_singleton_method
- assert_equal 2, A8.m
- assert_equal 3, A8.m
- assert_equal 4, A8.m
- end
-
- class A9
- @@c = 1
- def self.m
- @@c += 1
- end
- end
-
- def test_cvar_from_singleton_method2
- assert_equal 2, A9.m
- assert_equal 3, A9.m
- assert_equal 4, A9.m
- end
-
- class A10
- attr_accessor :a
- end
-
- def test_opassign
- i = 0
- i += 1
- assert_equal 1, i
-
- @iv = 2
- @iv += 2
- assert_equal 4, @iv
-
- @@cv ||= 1
- assert_equal 1, @@cv
- @@cv &&= 2
- assert_equal 2, @@cv
- @@cv ||= 99
- assert_equal 2, @@cv
-
- $gv = 3
- $gv += 4
- assert_equal 7, $gv
-
- obj = A10.new
- obj.a = 9
- obj.a &&= 7
- assert_equal 7, obj.a
-
- obj.a = nil
- obj.a ||= 2
- assert_equal 2, obj.a
-
- obj.a &&= 3
- assert_equal 3, obj.a
-
- a = []
- a[0] ||= 3
- assert_equal 3, a[0]
- a[0] &&= 7
- assert_equal 7, a[0]
- a[0] ||= 3
- assert_equal 7, a[0]
- end
-
- def test_opassign_and_or
- a = 1
- a ||= 2
- assert_equal 1, a
- a = nil
- a ||= 2
- assert_equal 2, a
- a = 1
- a &&= 3
- assert_equal 3, a
- a = nil
- a &&= 4
- assert_nil a
-
- h = {}
- h[0] ||= 1
- assert_equal 1, h[0]
- h = {}
- h[0] &&= 1
- assert_nil h[0]
- h = {0 => 7}
- h[0] ||= 1
- assert_equal 7, h[0]
- h = {0 => 7}
- h[0] &&= 1
- assert_equal 1, h[0]
- end
-
- def test_backref
- /a(b)(c)d/ =~ 'xyzabcdefgabcdefg'
- assert_equal 'b', $1
- assert_equal 'c', $2
- assert_nil $3
- assert_instance_of MatchData, $~
- assert_equal 'abcd', $&
- assert_equal 'xyz', $`
- assert_equal 'efgabcdefg', $'
- assert_equal 'c', $+
-
- /(?!)/ =~ 'xyzabcdefgabcdefg'
- assert_nil $1
- assert_nil $2
- assert_nil $3
- assert_nil $~
- assert_nil $&
- assert_nil $`
- assert_nil $'
- assert_nil $+
- end
-
- def test_fact
- assert_equal 306057512216440636035370461297268629388588804173576999416776741259476533176716867465515291422477573349939147888701726368864263907759003154226842927906974559841225476930271954604008012215776252176854255965356903506788725264321896264299365204576448830388909753943489625436053225980776521270822437639449120128678675368305712293681943649956460498166450227716500185176546469340112226034729724066333258583506870150169794168850353752137554910289126407157154830282284937952636580145235233156936482233436799254594095276820608062232812387383880817049600000000000000000000000000000000000000000000000000000000000000000000000000, fact(300)
- end
-
- def fact(n)
- if n > 1
- n * fact(n - 1)
- else
- 1
- end
- end
-
- def test_mul
- assert_equal 0, 2 * 0
- assert_equal 0, 0 * 2
- assert_equal 4, 2 * 2
- end
-
- class MyNum
- def /(a)
- a * 100
- end
- end
-
- def test_div
- assert_equal 1, 3 / 2
- assert_equal 1.5, 3.0 / 2.0
- assert_equal 300, MyNum.new / 3
- end
-
- class MyArr
- def length
- 'string'
- end
- end
-
- def test_length
- assert_equal 0, [].length
- assert_equal 1, [1].length
- assert_equal 2, [1,2].length
- assert_equal 0, {}.length
- assert_equal 1, {1=>1}.length
- assert_equal 2, {1=>1, 2=>2}.length
- assert_equal 'string', MyArr.new.length
- end
-
- class MyNum2
- def %(a)
- a * 100
- end
- end
-
- def test_mod
- assert_equal 2, 5 % 3
- assert_equal 1.0, 3.0 % 2.0
- assert_equal 300, MyNum2.new % 3
- end
-
- class MyObj
- def [](*args)
- args
- end
-
- def []=(*args)
- args
- end
- end
-
- def test_aref
- a = [0,1]
- assert_equal 0, a[0]
- assert_equal 1, a[1]
- assert_nil a[2]
- h = {0=>0, 1=>1}
- obj = MyObj.new
- assert_equal 0, h[0]
- assert_equal 1, h[1]
- assert_nil h[2]
- assert_equal [0], obj[0]
- assert_equal [0,1], obj[0,1]
- assert_equal [0,1,2], obj[0,1,2]
- end
-
- def test_aset
- obj = MyObj.new
- assert_equal 7, (obj[0] = 7)
- assert_equal 7, (obj[0,1] = 7)
- assert_equal 7, (obj[0,1,2] = 7)
- end
-
- class MyObj2
- def attr=(*args)
- args
- end
- end
-
- def test_attr_setter
- obj = MyObj2.new
- assert_equal 1, (obj.attr = 1)
- end
-
- def test_list_expand
- a = []
- assert_equal [0], [0, *a]
- a = [1]
- assert_equal [0,1], [0, *a]
- a = [1,2]
- assert_equal [0,1,2], [0, *a]
- a = [1,2,3]
- assert_equal [0,1,2,3], [0, *a]
- #a = [1,2,3]
- #assert_equal [0,1,2,3,4], [0, *a, 4]
- end
-
-end
diff --git a/test/ruby/test_proc.rb b/test/ruby/test_proc.rb
index 5a00fdb123..0ddc76a804 100644
--- a/test/ruby/test_proc.rb
+++ b/test/ruby/test_proc.rb
@@ -1,15 +1,6 @@
require 'test/unit'
class TestProc < Test::Unit::TestCase
- def setup
- @verbose = $VERBOSE
- $VERBOSE = nil
- end
-
- def teardown
- $VERBOSE = @verbose
- end
-
def test_proc
p1 = proc{|i| i}
assert_equal(2, p1.call(2))
@@ -59,706 +50,45 @@ class TestProc < Test::Unit::TestCase
end
def test_arity
- assert_equal(0, proc{}.arity)
+ assert_equal(-1, proc{}.arity)
assert_equal(0, proc{||}.arity)
assert_equal(1, proc{|x|}.arity)
assert_equal(2, proc{|x, y|}.arity)
assert_equal(-2, proc{|x, *y|}.arity)
assert_equal(-1, proc{|*x|}.arity)
assert_equal(-1, proc{|*|}.arity)
- assert_equal(-3, proc{|x, *y, z|}.arity)
- assert_equal(-4, proc{|x, *y, z, a|}.arity)
- assert_arity(0) {}
+ assert_arity(-1) {}
assert_arity(0) {||}
assert_arity(1) {|x|}
assert_arity(2) {|x, y|}
assert_arity(-2) {|x, *y|}
- assert_arity(-3) {|x, *y, z|}
assert_arity(-1) {|*x|}
assert_arity(-1) {|*|}
end
+ # [ruby-dev:22592]
def m(x)
lambda { x }
end
-
def test_eq
+ # [ruby-dev:22592]
a = m(1)
b = m(2)
- assert_not_equal(a, b, "[ruby-dev:22592]")
- assert_not_equal(a.call, b.call, "[ruby-dev:22592]")
+ assert_not_equal(a, b)
+ assert_not_equal(a.call, b.call)
- assert_not_equal(proc {||}, proc {|x,y|}, "[ruby-dev:22599]")
+ # [ruby-dev:22599]
+ assert_not_equal(proc {||}, proc {|x,y|})
+ # [ruby-dev:22601]
a = lambda {|x| lambda {} }.call(1)
b = lambda {}
- assert_not_equal(a, b, "[ruby-dev:22601]")
+ assert_not_equal(a, b)
end
def test_block_par
assert_equal(10, Proc.new{|&b| b.call(10)}.call {|x| x})
assert_equal(12, Proc.new{|a,&b| b.call(a)}.call(12) {|x| x})
end
-
- def test_safe
- safe = $SAFE
- c = Class.new
- x = c.new
-
- p = proc {
- $SAFE += 1
- proc {$SAFE}
- }.call
- assert_equal(safe, $SAFE)
- assert_equal(safe + 1, p.call)
- assert_equal(safe, $SAFE)
-
- c.class_eval {define_method(:safe, p)}
- assert_equal(safe, x.safe)
- assert_equal(safe, x.method(:safe).call)
- assert_equal(safe, x.method(:safe).to_proc.call)
-
- p = proc {$SAFE += 1}
- assert_equal(safe + 1, p.call)
- assert_equal(safe, $SAFE)
-
- c.class_eval {define_method(:inc, p)}
- assert_equal(safe + 1, proc {x.inc; $SAFE}.call)
- assert_equal(safe, $SAFE)
- assert_equal(safe + 1, proc {x.method(:inc).call; $SAFE}.call)
- assert_equal(safe, $SAFE)
- assert_equal(safe + 1, proc {x.method(:inc).to_proc.call; $SAFE}.call)
- assert_equal(safe, $SAFE)
- end
-
- def m2
- "OK"
- end
-
- def block
- method(:m2).to_proc
- end
-
- # [yarv-dev:777] block made by Method#to_proc
- def test_method_to_proc
- b = block()
- assert_equal "OK", b.call
- end
-
- def test_curry
- b = proc {|x, y, z| (x||0) + (y||0) + (z||0) }
- assert_equal(6, b.curry[1][2][3])
- assert_equal(6, b.curry[1, 2][3, 4])
- assert_equal(6, b.curry(5)[1][2][3][4][5])
- assert_equal(6, b.curry(5)[1, 2][3, 4][5])
- assert_equal(1, b.curry(1)[1])
-
- b = proc {|x, y, z, *w| (x||0) + (y||0) + (z||0) + w.inject(0, &:+) }
- assert_equal(6, b.curry[1][2][3])
- assert_equal(10, b.curry[1, 2][3, 4])
- assert_equal(15, b.curry(5)[1][2][3][4][5])
- assert_equal(15, b.curry(5)[1, 2][3, 4][5])
- assert_equal(1, b.curry(1)[1])
-
- b = lambda {|x, y, z| (x||0) + (y||0) + (z||0) }
- assert_equal(6, b.curry[1][2][3])
- assert_raise(ArgumentError) { b.curry[1, 2][3, 4] }
- assert_raise(ArgumentError) { b.curry(5) }
- assert_raise(ArgumentError) { b.curry(1) }
-
- b = lambda {|x, y, z, *w| (x||0) + (y||0) + (z||0) + w.inject(0, &:+) }
- assert_equal(6, b.curry[1][2][3])
- assert_equal(10, b.curry[1, 2][3, 4])
- assert_equal(15, b.curry(5)[1][2][3][4][5])
- assert_equal(15, b.curry(5)[1, 2][3, 4][5])
- assert_raise(ArgumentError) { b.curry(1) }
-
- b = proc { :foo }
- assert_equal(:foo, b.curry[])
-
- b = lambda {|x, y, &b| b.call(x + y) }.curry
- b = b.call(2) { raise }
- b = b.call(3) {|x| x + 4 }
- assert_equal(9, b)
-
- l = proc {}
- assert_equal(false, l.lambda?)
- assert_equal(false, l.curry.lambda?, '[ruby-core:24127]')
- l = lambda {}
- assert_equal(true, l.lambda?)
- assert_equal(true, l.curry.lambda?, '[ruby-core:24127]')
- end
-
- def test_curry_ski_fib
- s = proc {|f, g, x| f[x][g[x]] }.curry
- k = proc {|x, y| x }.curry
- i = proc {|x| x }.curry
-
- fib = []
- inc = proc {|x| fib[-1] += 1; x }.curry
- ret = proc {|x| throw :end if fib.size > 10; fib << 0; x }.curry
-
- catch(:end) do
- s[
- s[s[i][i]][k[i]]
- ][
- k[inc]
- ][
- s[
- s[
- k[s]
- ][
- s[k[s[k[s]]]
- ][
- s[s[k[s]][s[k[s[k[ret]]]][s[k[s[i]]][k]]]][k]]
- ]
- ][
- k[s[k[s]][k]]
- ]
- ]
- end
-
- assert_equal(fib, [1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89])
- end
-
- def test_curry_from_knownbug
- a = lambda {|x, y, &b| b }
- b = a.curry[1]
-
- assert_equal(:ok,
- if b.call(2){} == nil
- :ng
- else
- :ok
- end, 'moved from btest/knownbug, [ruby-core:15551]')
- end
-
- def test_dup_clone
- b = proc {|x| x + "bar" }
- class << b; attr_accessor :foo; end
-
- bd = b.dup
- assert_equal("foobar", bd.call("foo"))
- assert_raise(NoMethodError) { bd.foo = :foo }
- assert_raise(NoMethodError) { bd.foo }
-
- bc = b.clone
- assert_equal("foobar", bc.call("foo"))
- bc.foo = :foo
- assert_equal(:foo, bc.foo)
- end
-
- def test_binding
- b = proc {|x, y, z| proc {}.binding }.call(1, 2, 3)
- class << b; attr_accessor :foo; end
-
- bd = b.dup
- assert_equal([1, 2, 3], bd.eval("[x, y, z]"))
- assert_raise(NoMethodError) { bd.foo = :foo }
- assert_raise(NoMethodError) { bd.foo }
-
- bc = b.clone
- assert_equal([1, 2, 3], bc.eval("[x, y, z]"))
- bc.foo = :foo
- assert_equal(:foo, bc.foo)
-
- b = nil
- 1.times { x, y, z = 1, 2, 3; b = binding }
- assert_equal([1, 2, 3], b.eval("[x, y, z]"))
- end
-
- def test_proc_lambda
- assert_raise(ArgumentError) { proc }
- assert_raise(ArgumentError) { lambda }
-
- o = Object.new
- def o.foo
- b = nil
- 1.times { b = lambda }
- b
- end
- assert_equal(:foo, o.foo { :foo }.call)
-
- def o.foo(&b)
- b = nil
- 1.times { b = lambda }
- b
- end
- assert_equal(:foo, o.foo { :foo }.call)
- end
-
- def test_arity2
- assert_equal(0, method(:proc).to_proc.arity)
- assert_equal(-1, proc {}.curry.arity)
-
- c = Class.new
- c.class_eval { attr_accessor :foo }
- assert_equal(1, c.new.method(:foo=).to_proc.arity)
- end
-
- def test_proc_location
- t = Thread.new { sleep }
- assert_raise(ThreadError) { t.instance_eval { initialize { } } }
- t.kill
- end
-
- def test_eq2
- b1 = proc { }
- b2 = b1.dup
- assert(b1 == b2)
- end
-
- def test_to_proc
- b = proc { :foo }
- assert_equal(:foo, b.to_proc.call)
- end
-
- def test_localjump_error
- o = Object.new
- def foo; yield; end
- exc = foo rescue $!
- assert_nil(exc.exit_value)
- assert_equal(:noreason, exc.reason)
- end
-
- def test_binding2
- assert_raise(ArgumentError) { proc {}.curry.binding }
- end
-
- def test_proc_args_plain
- pr = proc {|a,b,c,d,e|
- [a,b,c,d,e]
- }
- assert_equal [nil,nil,nil,nil,nil], pr.call()
- assert_equal [1,nil,nil,nil,nil], pr.call(1)
- assert_equal [1,2,nil,nil,nil], pr.call(1,2)
- assert_equal [1,2,3,nil,nil], pr.call(1,2,3)
- assert_equal [1,2,3,4,nil], pr.call(1,2,3,4)
- assert_equal [1,2,3,4,5], pr.call(1,2,3,4,5)
- assert_equal [1,2,3,4,5], pr.call(1,2,3,4,5,6)
-
- assert_equal [nil,nil,nil,nil,nil], pr.call([])
- assert_equal [1,nil,nil,nil,nil], pr.call([1])
- assert_equal [1,2,nil,nil,nil], pr.call([1,2])
- assert_equal [1,2,3,nil,nil], pr.call([1,2,3])
- assert_equal [1,2,3,4,nil], pr.call([1,2,3,4])
- assert_equal [1,2,3,4,5], pr.call([1,2,3,4,5])
- assert_equal [1,2,3,4,5], pr.call([1,2,3,4,5,6])
-
- r = proc{|a| a}.call([1,2,3])
- assert_equal [1,2,3], r
-
- r = proc{|a,| a}.call([1,2,3])
- assert_equal 1, r
-
- r = proc{|a,| a}.call([])
- assert_equal nil, r
- end
-
-
- def test_proc_args_rest
- pr = proc {|a,b,c,*d|
- [a,b,c,d]
- }
- assert_equal [nil,nil,nil,[]], pr.call()
- assert_equal [1,nil,nil,[]], pr.call(1)
- assert_equal [1,2,nil,[]], pr.call(1,2)
- assert_equal [1,2,3,[]], pr.call(1,2,3)
- assert_equal [1,2,3,[4]], pr.call(1,2,3,4)
- assert_equal [1,2,3,[4,5]], pr.call(1,2,3,4,5)
- assert_equal [1,2,3,[4,5,6]], pr.call(1,2,3,4,5,6)
-
- assert_equal [nil,nil,nil,[]], pr.call([])
- assert_equal [1,nil,nil,[]], pr.call([1])
- assert_equal [1,2,nil,[]], pr.call([1,2])
- assert_equal [1,2,3,[]], pr.call([1,2,3])
- assert_equal [1,2,3,[4]], pr.call([1,2,3,4])
- assert_equal [1,2,3,[4,5]], pr.call([1,2,3,4,5])
- assert_equal [1,2,3,[4,5,6]], pr.call([1,2,3,4,5,6])
-
- r = proc{|*a| a}.call([1,2,3])
- assert [1,2,3], r
- end
-
- def test_proc_args_rest_and_post
- pr = proc {|a,b,*c,d,e|
- [a,b,c,d,e]
- }
- assert_equal [nil, nil, [], nil, nil], pr.call()
- assert_equal [1, nil, [], nil, nil], pr.call(1)
- assert_equal [1, 2, [], nil, nil], pr.call(1,2)
- assert_equal [1, 2, [], 3, nil], pr.call(1,2,3)
- assert_equal [1, 2, [], 3, 4], pr.call(1,2,3,4)
- assert_equal [1, 2, [3], 4, 5], pr.call(1,2,3,4,5)
- assert_equal [1, 2, [3, 4], 5, 6], pr.call(1,2,3,4,5,6)
- assert_equal [1, 2, [3, 4, 5], 6,7], pr.call(1,2,3,4,5,6,7)
-
- assert_equal [nil, nil, [], nil, nil], pr.call([])
- assert_equal [1, nil, [], nil, nil], pr.call([1])
- assert_equal [1, 2, [], nil, nil], pr.call([1,2])
- assert_equal [1, 2, [], 3, nil], pr.call([1,2,3])
- assert_equal [1, 2, [], 3, 4], pr.call([1,2,3,4])
- assert_equal [1, 2, [3], 4, 5], pr.call([1,2,3,4,5])
- assert_equal [1, 2, [3, 4], 5, 6], pr.call([1,2,3,4,5,6])
- assert_equal [1, 2, [3, 4, 5], 6,7], pr.call([1,2,3,4,5,6,7])
- end
-
- def test_proc_args_opt
- pr = proc {|a,b,c=:c|
- [a,b,c]
- }
- assert_equal [nil, nil, :c], pr.call()
- assert_equal [1, nil, :c], pr.call(1)
- assert_equal [1, 2, :c], pr.call(1,2)
- assert_equal [1, 2, 3], pr.call(1,2,3)
- assert_equal [1, 2, 3], pr.call(1,2,3,4)
- assert_equal [1, 2, 3], pr.call(1,2,3,4,5)
- assert_equal [1, 2, 3], pr.call(1,2,3,4,5,6)
-
- assert_equal [nil, nil, :c], pr.call([])
- assert_equal [1, nil, :c], pr.call([1])
- assert_equal [1, 2, :c], pr.call([1,2])
- assert_equal [1, 2, 3], pr.call([1,2,3])
- assert_equal [1, 2, 3], pr.call([1,2,3,4])
- assert_equal [1, 2, 3], pr.call([1,2,3,4,5])
- assert_equal [1, 2, 3], pr.call([1,2,3,4,5,6])
- end
-
- def test_proc_args_opt_and_post
- pr = proc {|a,b,c=:c,d,e|
- [a,b,c,d,e]
- }
- assert_equal [nil, nil, :c, nil, nil], pr.call()
- assert_equal [1, nil, :c, nil, nil], pr.call(1)
- assert_equal [1, 2, :c, nil, nil], pr.call(1,2)
- assert_equal [1, 2, :c, 3, nil], pr.call(1,2,3)
- assert_equal [1, 2, :c, 3, 4], pr.call(1,2,3,4)
- assert_equal [1, 2, 3, 4, 5], pr.call(1,2,3,4,5)
- assert_equal [1, 2, 3, 4, 5], pr.call(1,2,3,4,5,6)
-
- assert_equal [nil, nil, :c, nil, nil], pr.call([])
- assert_equal [1, nil, :c, nil, nil], pr.call([1])
- assert_equal [1, 2, :c, nil, nil], pr.call([1,2])
- assert_equal [1, 2, :c, 3, nil], pr.call([1,2,3])
- assert_equal [1, 2, :c, 3, 4], pr.call([1,2,3,4])
- assert_equal [1, 2, 3, 4, 5], pr.call([1,2,3,4,5])
- assert_equal [1, 2, 3, 4, 5], pr.call([1,2,3,4,5,6])
- end
-
- def test_proc_args_opt_and_rest
- pr = proc {|a,b,c=:c,*d|
- [a,b,c,d]
- }
- assert_equal [nil, nil, :c, []], pr.call()
- assert_equal [1, nil, :c, []], pr.call(1)
- assert_equal [1, 2, :c, []], pr.call(1,2)
- assert_equal [1, 2, 3, []], pr.call(1,2,3)
- assert_equal [1, 2, 3, [4]], pr.call(1,2,3,4)
- assert_equal [1, 2, 3, [4, 5]], pr.call(1,2,3,4,5)
-
- assert_equal [nil, nil, :c, []], pr.call([])
- assert_equal [1, nil, :c, []], pr.call([1])
- assert_equal [1, 2, :c, []], pr.call([1,2])
- assert_equal [1, 2, 3, []], pr.call([1,2,3])
- assert_equal [1, 2, 3, [4]], pr.call([1,2,3,4])
- assert_equal [1, 2, 3, [4, 5]], pr.call([1,2,3,4,5])
- end
-
- def test_proc_args_opt_and_rest_and_post
- pr = proc {|a,b,c=:c,*d,e|
- [a,b,c,d,e]
- }
- assert_equal [nil, nil, :c, [], nil], pr.call()
- assert_equal [1, nil, :c, [], nil], pr.call(1)
- assert_equal [1, 2, :c, [], nil], pr.call(1,2)
- assert_equal [1, 2, :c, [], 3], pr.call(1,2,3)
- assert_equal [1, 2, 3, [], 4], pr.call(1,2,3,4)
- assert_equal [1, 2, 3, [4], 5], pr.call(1,2,3,4,5)
- assert_equal [1, 2, 3, [4,5], 6], pr.call(1,2,3,4,5,6)
-
- assert_equal [nil, nil, :c, [], nil], pr.call([])
- assert_equal [1, nil, :c, [], nil], pr.call([1])
- assert_equal [1, 2, :c, [], nil], pr.call([1,2])
- assert_equal [1, 2, :c, [], 3], pr.call([1,2,3])
- assert_equal [1, 2, 3, [], 4], pr.call([1,2,3,4])
- assert_equal [1, 2, 3, [4], 5], pr.call([1,2,3,4,5])
- assert_equal [1, 2, 3, [4,5], 6], pr.call([1,2,3,4,5,6])
- end
-
- def test_proc_args_block
- pr = proc {|a,b,&c|
- [a, b, c.class, c&&c.call(:x)]
- }
- assert_equal [nil, nil, NilClass, nil], pr.call()
- assert_equal [1, nil, NilClass, nil], pr.call(1)
- assert_equal [1, 2, NilClass, nil], pr.call(1,2)
- assert_equal [1, 2, NilClass, nil], pr.call(1,2,3)
- assert_equal [1, 2, NilClass, nil], pr.call(1,2,3,4)
-
- assert_equal [nil, nil, Proc, :proc], (pr.call(){ :proc })
- assert_equal [1, nil, Proc, :proc], (pr.call(1){ :proc })
- assert_equal [1, 2, Proc, :proc], (pr.call(1, 2){ :proc })
- assert_equal [1, 2, Proc, :proc], (pr.call(1, 2, 3){ :proc })
- assert_equal [1, 2, Proc, :proc], (pr.call(1, 2, 3, 4){ :proc })
-
- assert_equal [nil, nil, Proc, :x], (pr.call(){|x| x})
- assert_equal [1, nil, Proc, :x], (pr.call(1){|x| x})
- assert_equal [1, 2, Proc, :x], (pr.call(1, 2){|x| x})
- assert_equal [1, 2, Proc, :x], (pr.call(1, 2, 3){|x| x})
- assert_equal [1, 2, Proc, :x], (pr.call(1, 2, 3, 4){|x| x})
- end
-
- def test_proc_args_rest_and_block
- pr = proc {|a,b,*c,&d|
- [a, b, c, d.class, d&&d.call(:x)]
- }
- assert_equal [nil, nil, [], NilClass, nil], pr.call()
- assert_equal [1, nil, [], NilClass, nil], pr.call(1)
- assert_equal [1, 2, [], NilClass, nil], pr.call(1,2)
- assert_equal [1, 2, [3], NilClass, nil], pr.call(1,2,3)
- assert_equal [1, 2, [3,4], NilClass, nil], pr.call(1,2,3,4)
-
- assert_equal [nil, nil, [], Proc, :proc], (pr.call(){ :proc })
- assert_equal [1, nil, [], Proc, :proc], (pr.call(1){ :proc })
- assert_equal [1, 2, [], Proc, :proc], (pr.call(1, 2){ :proc })
- assert_equal [1, 2, [3], Proc, :proc], (pr.call(1, 2, 3){ :proc })
- assert_equal [1, 2, [3,4], Proc, :proc], (pr.call(1, 2, 3, 4){ :proc })
-
- assert_equal [nil, nil, [], Proc, :x], (pr.call(){|x| x})
- assert_equal [1, nil, [], Proc, :x], (pr.call(1){|x| x})
- assert_equal [1, 2, [], Proc, :x], (pr.call(1, 2){|x| x})
- assert_equal [1, 2, [3], Proc, :x], (pr.call(1, 2, 3){|x| x})
- assert_equal [1, 2, [3,4], Proc, :x], (pr.call(1, 2, 3, 4){|x| x})
- end
-
- def test_proc_args_rest_and_post_and_block
- pr = proc {|a,b,*c,d,e,&f|
- [a, b, c, d, e, f.class, f&&f.call(:x)]
- }
- assert_equal [nil, nil, [], nil, nil, NilClass, nil], pr.call()
- assert_equal [1, nil, [], nil, nil, NilClass, nil], pr.call(1)
- assert_equal [1, 2, [], nil, nil, NilClass, nil], pr.call(1,2)
- assert_equal [1, 2, [], 3, nil, NilClass, nil], pr.call(1,2,3)
- assert_equal [1, 2, [], 3, 4, NilClass, nil], pr.call(1,2,3,4)
- assert_equal [1, 2, [3], 4, 5, NilClass, nil], pr.call(1,2,3,4,5)
- assert_equal [1, 2, [3,4], 5, 6, NilClass, nil], pr.call(1,2,3,4,5,6)
-
- assert_equal [nil, nil, [], nil, nil, Proc, :proc], (pr.call(){ :proc })
- assert_equal [1, nil, [], nil, nil, Proc, :proc], (pr.call(1){ :proc })
- assert_equal [1, 2, [], nil, nil, Proc, :proc], (pr.call(1, 2){ :proc })
- assert_equal [1, 2, [], 3, nil, Proc, :proc], (pr.call(1, 2, 3){ :proc })
- assert_equal [1, 2, [], 3, 4, Proc, :proc], (pr.call(1, 2, 3, 4){ :proc })
- assert_equal [1, 2, [3], 4, 5, Proc, :proc], (pr.call(1, 2, 3, 4, 5){ :proc })
- assert_equal [1, 2, [3,4], 5, 6, Proc, :proc], (pr.call(1, 2, 3, 4, 5, 6){ :proc })
-
- assert_equal [nil, nil, [], nil, nil, Proc, :x], (pr.call(){|x| x})
- assert_equal [1, nil, [], nil, nil, Proc, :x], (pr.call(1){|x| x})
- assert_equal [1, 2, [], nil, nil, Proc, :x], (pr.call(1, 2){|x| x})
- assert_equal [1, 2, [], 3, nil, Proc, :x], (pr.call(1, 2, 3){|x| x})
- assert_equal [1, 2, [], 3, 4, Proc, :x], (pr.call(1, 2, 3, 4){|x| x})
- assert_equal [1, 2, [3], 4, 5, Proc, :x], (pr.call(1, 2, 3, 4, 5){|x| x})
- assert_equal [1, 2, [3,4], 5, 6, Proc, :x], (pr.call(1, 2, 3, 4, 5, 6){|x| x})
- end
-
- def test_proc_args_opt_and_block
- pr = proc {|a,b,c=:c,d=:d,&e|
- [a, b, c, d, e.class, e&&e.call(:x)]
- }
- assert_equal [nil, nil, :c, :d, NilClass, nil], pr.call()
- assert_equal [1, nil, :c, :d, NilClass, nil], pr.call(1)
- assert_equal [1, 2, :c, :d, NilClass, nil], pr.call(1,2)
- assert_equal [1, 2, 3, :d, NilClass, nil], pr.call(1,2,3)
- assert_equal [1, 2, 3, 4, NilClass, nil], pr.call(1,2,3,4)
- assert_equal [1, 2, 3, 4, NilClass, nil], pr.call(1,2,3,4,5)
-
- assert_equal [nil, nil, :c, :d, Proc, :proc], (pr.call(){ :proc })
- assert_equal [1, nil, :c, :d, Proc, :proc], (pr.call(1){ :proc })
- assert_equal [1, 2, :c, :d, Proc, :proc], (pr.call(1, 2){ :proc })
- assert_equal [1, 2, 3, :d, Proc, :proc], (pr.call(1, 2, 3){ :proc })
- assert_equal [1, 2, 3, 4, Proc, :proc], (pr.call(1, 2, 3, 4){ :proc })
- assert_equal [1, 2, 3, 4, Proc, :proc], (pr.call(1, 2, 3, 4, 5){ :proc })
-
- assert_equal [nil, nil, :c, :d, Proc, :x], (pr.call(){|x| x})
- assert_equal [1, nil, :c, :d, Proc, :x], (pr.call(1){|x| x})
- assert_equal [1, 2, :c, :d, Proc, :x], (pr.call(1, 2){|x| x})
- assert_equal [1, 2, 3, :d, Proc, :x], (pr.call(1, 2, 3){|x| x})
- assert_equal [1, 2, 3, 4, Proc, :x], (pr.call(1, 2, 3, 4){|x| x})
- assert_equal [1, 2, 3, 4, Proc, :x], (pr.call(1, 2, 3, 4, 5){|x| x})
- end
-
- def test_proc_args_opt_and_post_and_block
- pr = proc {|a,b,c=:c,d=:d,e,f,&g|
- [a, b, c, d, e, f, g.class, g&&g.call(:x)]
- }
- assert_equal [nil, nil, :c, :d, nil, nil, NilClass, nil], pr.call()
- assert_equal [1, nil, :c, :d, nil, nil, NilClass, nil], pr.call(1)
- assert_equal [1, 2, :c, :d, nil, nil, NilClass, nil], pr.call(1,2)
- assert_equal [1, 2, :c, :d, 3, nil, NilClass, nil], pr.call(1,2,3)
- assert_equal [1, 2, :c, :d, 3, 4, NilClass, nil], pr.call(1,2,3,4)
- assert_equal [1, 2, 3, :d, 4, 5, NilClass, nil], pr.call(1,2,3,4,5)
- assert_equal [1, 2, 3, 4, 5, 6, NilClass, nil], pr.call(1,2,3,4,5,6)
- assert_equal [1, 2, 3, 4, 5, 6, NilClass, nil], pr.call(1,2,3,4,5,6,7)
-
- assert_equal [nil, nil, :c, :d, nil, nil, Proc, :proc], (pr.call(){ :proc })
- assert_equal [1, nil, :c, :d, nil, nil, Proc, :proc], (pr.call(1){ :proc })
- assert_equal [1, 2, :c, :d, nil, nil, Proc, :proc], (pr.call(1, 2){ :proc })
- assert_equal [1, 2, :c, :d, 3, nil, Proc, :proc], (pr.call(1, 2, 3){ :proc })
- assert_equal [1, 2, :c, :d, 3, 4, Proc, :proc], (pr.call(1, 2, 3, 4){ :proc })
- assert_equal [1, 2, 3, :d, 4, 5, Proc, :proc], (pr.call(1, 2, 3, 4, 5){ :proc })
- assert_equal [1, 2, 3, 4, 5, 6, Proc, :proc], (pr.call(1, 2, 3, 4, 5, 6){ :proc })
- assert_equal [1, 2, 3, 4, 5, 6, Proc, :proc], (pr.call(1, 2, 3, 4, 5, 6, 7){ :proc })
-
- assert_equal [nil, nil, :c, :d, nil, nil, Proc, :x], (pr.call(){|x| x})
- assert_equal [1, nil, :c, :d, nil, nil, Proc, :x], (pr.call(1){|x| x})
- assert_equal [1, 2, :c, :d, nil, nil, Proc, :x], (pr.call(1, 2){|x| x})
- assert_equal [1, 2, :c, :d, 3, nil, Proc, :x], (pr.call(1, 2, 3){|x| x})
- assert_equal [1, 2, :c, :d, 3, 4, Proc, :x], (pr.call(1, 2, 3, 4){|x| x})
- assert_equal [1, 2, 3, :d, 4, 5, Proc, :x], (pr.call(1, 2, 3, 4, 5){|x| x})
- assert_equal [1, 2, 3, 4, 5, 6, Proc, :x], (pr.call(1, 2, 3, 4, 5, 6){|x| x})
- assert_equal [1, 2, 3, 4, 5, 6, Proc, :x], (pr.call(1, 2, 3, 4, 5, 6, 7){|x| x})
- end
-
- def test_proc_args_opt_and_block
- pr = proc {|a,b,c=:c,d=:d,*e,&f|
- [a, b, c, d, e, f.class, f&&f.call(:x)]
- }
- assert_equal [nil, nil, :c, :d, [], NilClass, nil], pr.call()
- assert_equal [1, nil, :c, :d, [], NilClass, nil], pr.call(1)
- assert_equal [1, 2, :c, :d, [], NilClass, nil], pr.call(1,2)
- assert_equal [1, 2, 3, :d, [], NilClass, nil], pr.call(1,2,3)
- assert_equal [1, 2, 3, 4, [], NilClass, nil], pr.call(1,2,3,4)
- assert_equal [1, 2, 3, 4, [5], NilClass, nil], pr.call(1,2,3,4,5)
- assert_equal [1, 2, 3, 4, [5,6], NilClass, nil], pr.call(1,2,3,4,5,6)
-
- assert_equal [nil, nil, :c, :d, [], Proc, :proc], (pr.call(){ :proc })
- assert_equal [1, nil, :c, :d, [], Proc, :proc], (pr.call(1){ :proc })
- assert_equal [1, 2, :c, :d, [], Proc, :proc], (pr.call(1, 2){ :proc })
- assert_equal [1, 2, 3, :d, [], Proc, :proc], (pr.call(1, 2, 3){ :proc })
- assert_equal [1, 2, 3, 4, [], Proc, :proc], (pr.call(1, 2, 3, 4){ :proc })
- assert_equal [1, 2, 3, 4, [5], Proc, :proc], (pr.call(1, 2, 3, 4, 5){ :proc })
- assert_equal [1, 2, 3, 4, [5,6], Proc, :proc], (pr.call(1, 2, 3, 4, 5, 6){ :proc })
-
- assert_equal [nil, nil, :c, :d, [], Proc, :x], (pr.call(){|x| x})
- assert_equal [1, nil, :c, :d, [], Proc, :x], (pr.call(1){|x| x})
- assert_equal [1, 2, :c, :d, [], Proc, :x], (pr.call(1, 2){|x| x})
- assert_equal [1, 2, 3, :d, [], Proc, :x], (pr.call(1, 2, 3){|x| x})
- assert_equal [1, 2, 3, 4, [], Proc, :x], (pr.call(1, 2, 3, 4){|x| x})
- assert_equal [1, 2, 3, 4, [5], Proc, :x], (pr.call(1, 2, 3, 4, 5){|x| x})
- assert_equal [1, 2, 3, 4, [5,6], Proc, :x], (pr.call(1, 2, 3, 4, 5, 6){|x| x})
- end
-
- def test_proc_args_opt_and_rest_and_post_and_block
- pr = proc {|a,b,c=:c,d=:d,*e,f,g,&h|
- [a, b, c, d, e, f, g, h.class, h&&h.call(:x)]
- }
- assert_equal [nil, nil, :c, :d, [], nil, nil, NilClass, nil], pr.call()
- assert_equal [1, nil, :c, :d, [], nil, nil, NilClass, nil], pr.call(1)
- assert_equal [1, 2, :c, :d, [], nil, nil, NilClass, nil], pr.call(1,2)
- assert_equal [1, 2, :c, :d, [], 3, nil, NilClass, nil], pr.call(1,2,3)
- assert_equal [1, 2, :c, :d, [], 3, 4, NilClass, nil], pr.call(1,2,3,4)
- assert_equal [1, 2, 3, :d, [], 4, 5, NilClass, nil], pr.call(1,2,3,4,5)
- assert_equal [1, 2, 3, 4, [], 5, 6, NilClass, nil], pr.call(1,2,3,4,5,6)
- assert_equal [1, 2, 3, 4, [5], 6, 7, NilClass, nil], pr.call(1,2,3,4,5,6,7)
- assert_equal [1, 2, 3, 4, [5,6], 7, 8, NilClass, nil], pr.call(1,2,3,4,5,6,7,8)
-
- assert_equal [nil, nil, :c, :d, [], nil, nil, Proc, :proc], (pr.call(){ :proc })
- assert_equal [1, nil, :c, :d, [], nil, nil, Proc, :proc], (pr.call(1){ :proc })
- assert_equal [1, 2, :c, :d, [], nil, nil, Proc, :proc], (pr.call(1, 2){ :proc })
- assert_equal [1, 2, :c, :d, [], 3, nil, Proc, :proc], (pr.call(1, 2, 3){ :proc })
- assert_equal [1, 2, :c, :d, [], 3, 4, Proc, :proc], (pr.call(1, 2, 3, 4){ :proc })
- assert_equal [1, 2, 3, :d, [], 4, 5, Proc, :proc], (pr.call(1, 2, 3, 4, 5){ :proc })
- assert_equal [1, 2, 3, 4, [], 5, 6, Proc, :proc], (pr.call(1, 2, 3, 4, 5, 6){ :proc })
- assert_equal [1, 2, 3, 4, [5], 6, 7, Proc, :proc], (pr.call(1, 2, 3, 4, 5, 6, 7){ :proc })
- assert_equal [1, 2, 3, 4, [5,6], 7, 8, Proc, :proc], (pr.call(1, 2, 3, 4, 5, 6, 7, 8){ :proc })
-
- assert_equal [nil, nil, :c, :d, [], nil, nil, Proc, :x], (pr.call(){|x| x})
- assert_equal [1, nil, :c, :d, [], nil, nil, Proc, :x], (pr.call(1){|x| x})
- assert_equal [1, 2, :c, :d, [], nil, nil, Proc, :x], (pr.call(1, 2){|x| x})
- assert_equal [1, 2, :c, :d, [], 3, nil, Proc, :x], (pr.call(1, 2, 3){|x| x})
- assert_equal [1, 2, :c, :d, [], 3, 4, Proc, :x], (pr.call(1, 2, 3, 4){|x| x})
- assert_equal [1, 2, 3, :d, [], 4, 5, Proc, :x], (pr.call(1, 2, 3, 4, 5){|x| x})
- assert_equal [1, 2, 3, 4, [], 5, 6, Proc, :x], (pr.call(1, 2, 3, 4, 5, 6){|x| x})
- assert_equal [1, 2, 3, 4, [5], 6, 7, Proc, :x], (pr.call(1, 2, 3, 4, 5, 6, 7){|x| x})
- assert_equal [1, 2, 3, 4, [5,6], 7, 8, Proc, :x], (pr.call(1, 2, 3, 4, 5, 6, 7, 8){|x| x})
- end
-
- def test_proc_args_unleashed
- r = proc {|a,b=1,*c,d,e|
- [a,b,c,d,e]
- }.call(1,2,3,4,5)
- assert_equal([1,2,[3],4,5], r, "[ruby-core:19485]")
- end
-
- def test_parameters
- assert_equal([], proc {}.parameters)
- assert_equal([], proc {||}.parameters)
- assert_equal([[:opt, :a]], proc {|a|}.parameters)
- assert_equal([[:opt, :a], [:opt, :b]], proc {|a, b|}.parameters)
- assert_equal([[:opt, :a], [:block, :b]], proc {|a=:a, &b|}.parameters)
- assert_equal([[:opt, :a], [:opt, :b]], proc {|a, b=:b|}.parameters)
- assert_equal([[:rest, :a]], proc {|*a|}.parameters)
- assert_equal([[:opt, :a], [:rest, :b], [:block, :c]], proc {|a, *b, &c|}.parameters)
- assert_equal([[:opt, :a], [:rest, :b], [:opt, :c]], proc {|a, *b, c|}.parameters)
- assert_equal([[:opt, :a], [:rest, :b], [:opt, :c], [:block, :d]], proc {|a, *b, c, &d|}.parameters)
- assert_equal([[:opt, :a], [:opt, :b], [:rest, :c], [:opt, :d], [:block, :e]], proc {|a, b=:b, *c, d, &e|}.parameters)
- assert_equal([[:opt, nil], [:block, :b]], proc {|(a), &b|}.parameters)
- assert_equal([[:opt, :a], [:opt, :b], [:opt, :c], [:opt, :d], [:rest, :e], [:opt, :f], [:opt, :g], [:block, :h]], proc {|a,b,c=:c,d=:d,*e,f,g,&h|}.parameters)
-
- assert_equal([[:req]], method(:require).parameters)
- assert_equal([[:rest]], method(:p).parameters)
- end
-
- def pm0() end
- def pm1(a) end
- def pm2(a, b) end
- def pmo1(a = :a, &b) end
- def pmo2(a, b = :b) end
- def pmo3(*a) end
- def pmo4(a, *b, &c) end
- def pmo5(a, *b, c) end
- def pmo6(a, *b, c, &d) end
- def pmo7(a, b = :b, *c, d, &e) end
- def pma1((a), &b) end
-
-
- def test_bound_parameters
- assert_equal([], method(:pm0).to_proc.parameters)
- assert_equal([[:req, :a]], method(:pm1).to_proc.parameters)
- assert_equal([[:req, :a], [:req, :b]], method(:pm2).to_proc.parameters)
- assert_equal([[:opt, :a], [:block, :b]], method(:pmo1).to_proc.parameters)
- assert_equal([[:req, :a], [:opt, :b]], method(:pmo2).to_proc.parameters)
- assert_equal([[:rest, :a]], method(:pmo3).to_proc.parameters)
- assert_equal([[:req, :a], [:rest, :b], [:block, :c]], method(:pmo4).to_proc.parameters)
- assert_equal([[:req, :a], [:rest, :b], [:req, :c]], method(:pmo5).to_proc.parameters)
- assert_equal([[:req, :a], [:rest, :b], [:req, :c], [:block, :d]], method(:pmo6).to_proc.parameters)
- assert_equal([[:req, :a], [:opt, :b], [:rest, :c], [:req, :d], [:block, :e]], method(:pmo7).to_proc.parameters)
- assert_equal([[:req], [:block, :b]], method(:pma1).to_proc.parameters)
- end
-
- def test_to_s
- assert_match(/^#<Proc:0x\h+@#{ Regexp.quote(__FILE__) }:\d+>$/, proc {}.to_s)
- assert_match(/^#<Proc:0x\h+@#{ Regexp.quote(__FILE__) }:\d+ \(lambda\)>$/, lambda {}.to_s)
- assert_match(/^#<Proc:0x\h+ \(lambda\)>$/, method(:p).to_proc.to_s)
- x = proc {}
- x.taint
- assert(x.to_s.tainted?)
- end
-
- def source_location_test
- __LINE__
- end
-
- def test_source_location
- file, lineno = method(:source_location_test).source_location
- assert_match(/^#{ Regexp.quote(__FILE__) }$/, file)
- assert_equal(source_location_test - 1, lineno)
- end
-
- def test_splat_without_respond_to
- def (obj = Object.new).respond_to?(m); false end
- [obj].each do |a, b|
- assert_equal([obj, nil], [a, b], '[ruby-core:24139]')
- end
- end
end
diff --git a/test/ruby/test_process.rb b/test/ruby/test_process.rb
index 4e6097bbc1..93eb871edc 100644
--- a/test/ruby/test_process.rb
+++ b/test/ruby/test_process.rb
@@ -1,41 +1,6 @@
require 'test/unit'
-require 'tmpdir'
-require 'pathname'
-require_relative 'envutil'
-require 'rbconfig'
class TestProcess < Test::Unit::TestCase
- RUBY = EnvUtil.rubybin
-
- def setup
- Process.waitall
- end
-
- def teardown
- Process.waitall
- end
-
- def write_file(filename, content)
- File.open(filename, "w") {|f|
- f << content
- }
- end
-
- def with_tmpchdir
- Dir.mktmpdir {|d|
- d = Pathname.new(d).realpath.to_s
- Dir.chdir(d) {
- yield d
- }
- }
- end
-
- def run_in_child(str) # should be called in a temporary directory
- write_file("test-script", str)
- Process.wait spawn(RUBY, "test-script")
- $?
- end
-
def test_rlimit_availability
begin
Process.getrlimit(nil)
@@ -56,1093 +21,21 @@ class TestProcess < Test::Unit::TestCase
def test_rlimit_nofile
return unless rlimit_exist?
- with_tmpchdir {
- write_file 's', <<-"End"
- result = 1
- begin
- Process.setrlimit(Process::RLIMIT_NOFILE, 0)
- rescue Errno::EINVAL
- result = 0
- end
- if result == 1
- begin
- IO.pipe
- rescue Errno::EMFILE
- result = 0
- end
- end
- exit result
- End
- pid = spawn RUBY, "s"
- Process.wait pid
- assert_equal(0, $?.to_i, "#{$?}")
- }
- end
-
- def test_rlimit_name
- return unless rlimit_exist?
- [
- :AS, "AS",
- :CORE, "CORE",
- :CPU, "CPU",
- :DATA, "DATA",
- :FSIZE, "FSIZE",
- :MEMLOCK, "MEMLOCK",
- :NOFILE, "NOFILE",
- :NPROC, "NPROC",
- :RSS, "RSS",
- :STACK, "STACK",
- :SBSIZE, "SBSIZE",
- ].each {|name|
- if Process.const_defined? "RLIMIT_#{name}"
- assert_nothing_raised { Process.getrlimit(name) }
- else
- assert_raise(ArgumentError) { Process.getrlimit(name) }
- end
- }
- assert_raise(ArgumentError) { Process.getrlimit(:FOO) }
- assert_raise(ArgumentError) { Process.getrlimit("FOO") }
- end
-
- def test_rlimit_value
- return unless rlimit_exist?
- assert_raise(ArgumentError) { Process.setrlimit(:CORE, :FOO) }
- with_tmpchdir do
- s = run_in_child(<<-'End')
- cur, max = Process.getrlimit(:NOFILE)
- Process.setrlimit(:NOFILE, max-10)
- begin
- Process.setrlimit(:NOFILE, :INFINITY)
- rescue Errno::EPERM
- exit 1
- end
- End
- assert_not_equal(0, s.exitstatus)
- s = run_in_child(<<-'End')
- cur, max = Process.getrlimit(:NOFILE)
- Process.setrlimit(:NOFILE, max-10)
- begin
- Process.setrlimit(:NOFILE, "INFINITY")
- rescue Errno::EPERM
- exit 1
- end
- End
- assert_not_equal(0, s.exitstatus)
- end
- end
-
- TRUECOMMAND = [RUBY, '-e', '']
-
- def test_execopts_opts
- assert_nothing_raised {
- Process.wait Process.spawn(*TRUECOMMAND, {})
- }
- assert_raise(ArgumentError) {
- Process.wait Process.spawn(*TRUECOMMAND, :foo => 100)
- }
- assert_raise(ArgumentError) {
- Process.wait Process.spawn(*TRUECOMMAND, Process => 100)
- }
- end
-
- def test_execopts_pgroup
- skip "system(:pgroup) is not supported" if /mswin|bccwin|mingw/ =~ RUBY_PLATFORM
- assert_nothing_raised { system(*TRUECOMMAND, :pgroup=>false) }
-
- io = IO.popen([RUBY, "-e", "print Process.getpgrp"])
- assert_equal(Process.getpgrp.to_s, io.read)
- io.close
-
- io = IO.popen([RUBY, "-e", "print Process.getpgrp", :pgroup=>true])
- assert_equal(io.pid.to_s, io.read)
- io.close
-
- assert_raise(ArgumentError) { system(*TRUECOMMAND, :pgroup=>-1) }
- assert_raise(Errno::EPERM) { Process.wait spawn(*TRUECOMMAND, :pgroup=>2) }
-
- io1 = IO.popen([RUBY, "-e", "print Process.getpgrp", :pgroup=>true])
- io2 = IO.popen([RUBY, "-e", "print Process.getpgrp", :pgroup=>io1.pid])
- assert_equal(io1.pid.to_s, io1.read)
- assert_equal(io1.pid.to_s, io2.read)
- Process.wait io1.pid
- Process.wait io2.pid
- io1.close
- io2.close
- end
-
- def test_execopts_rlimit
- return unless rlimit_exist?
- assert_raise(ArgumentError) { system(*TRUECOMMAND, :rlimit_foo=>0) }
- assert_raise(ArgumentError) { system(*TRUECOMMAND, :rlimit_NOFILE=>0) }
- assert_raise(ArgumentError) { system(*TRUECOMMAND, :rlimit_nofile=>[]) }
- assert_raise(ArgumentError) { system(*TRUECOMMAND, :rlimit_nofile=>[1,2,3]) }
-
- max = Process.getrlimit(:CORE).last
-
- n = max
- IO.popen([RUBY, "-e",
- "p Process.getrlimit(:CORE)", :rlimit_core=>n]) {|io|
- assert_equal("[#{n}, #{n}]\n", io.read)
- }
-
- n = 0
- IO.popen([RUBY, "-e",
- "p Process.getrlimit(:CORE)", :rlimit_core=>n]) {|io|
- assert_equal("[#{n}, #{n}]\n", io.read)
- }
-
- n = max
- IO.popen([RUBY, "-e",
- "p Process.getrlimit(:CORE)", :rlimit_core=>[n]]) {|io|
- assert_equal("[#{n}, #{n}]", io.read.chomp)
- }
-
- m, n = 0, max
- IO.popen([RUBY, "-e",
- "p Process.getrlimit(:CORE)", :rlimit_core=>[m,n]]) {|io|
- assert_equal("[#{m}, #{n}]", io.read.chomp)
- }
-
- m, n = 0, 0
- IO.popen([RUBY, "-e",
- "p Process.getrlimit(:CORE)", :rlimit_core=>[m,n]]) {|io|
- assert_equal("[#{m}, #{n}]", io.read.chomp)
- }
-
- n = max
- IO.popen([RUBY, "-e",
- "p Process.getrlimit(:CORE), Process.getrlimit(:CPU)",
- :rlimit_core=>n, :rlimit_cpu=>3600]) {|io|
- assert_equal("[#{n}, #{n}]\n[3600, 3600]", io.read.chomp)
- }
- end
-
- MANDATORY_ENVS = %w[RUBYLIB]
- case RbConfig::CONFIG['target_os']
- when /linux/
- MANDATORY_ENVS << 'LD_PRELOAD'
- when /mswin|mingw/
- MANDATORY_ENVS.concat(%w[HOME USER TMPDIR])
- end
- if e = RbConfig::CONFIG['LIBPATHENV']
- MANDATORY_ENVS << e
- end
- PREENVARG = ['-e', "%w[#{MANDATORY_ENVS.join(' ')}].each{|e|ENV.delete(e)}"]
- ENVARG = ['-e', 'ENV.each {|k,v| puts "#{k}=#{v}" }']
- ENVCOMMAND = [RUBY].concat(PREENVARG).concat(ENVARG)
-
- def test_execopts_env
- assert_raise(ArgumentError) {
- system({"F=O"=>"BAR"}, *TRUECOMMAND)
- }
-
- h = {}
- cmd = [h, RUBY]
- ENV.each do |k,v|
- case k
- when /\APATH\z/i
- when *MANDATORY_ENVS
- cmd << '-e' << "ENV.delete('#{k}')"
- else
- h[k] = nil
- end
- end
- cmd << '-e' << 'puts ENV.keys.map{|e|e.upcase}'
- IO.popen(cmd) {|io|
- assert_equal("PATH\n", io.read)
- }
-
- IO.popen([{"FOO"=>"BAR"}, *ENVCOMMAND]) {|io|
- assert_match(/^FOO=BAR$/, io.read)
- }
-
- with_tmpchdir {|d|
- system({"fofo"=>"haha"}, *ENVCOMMAND, STDOUT=>"out")
- assert_match(/^fofo=haha$/, File.read("out").chomp)
- }
- end
-
- def test_execopts_unsetenv_others
- h = {}
- MANDATORY_ENVS.each {|k| e = ENV[k] and h[k] = e}
- IO.popen([h, *ENVCOMMAND, :unsetenv_others=>true]) {|io|
- assert_equal("", io.read)
- }
- IO.popen([h.merge("A"=>"B"), *ENVCOMMAND, :unsetenv_others=>true]) {|io|
- assert_equal("A=B\n", io.read)
- }
- end
-
- PWD = [RUBY, '-e', 'puts Dir.pwd']
-
- def test_execopts_chdir
- with_tmpchdir {|d|
- IO.popen([*PWD, :chdir => d]) {|io|
- assert_equal(d, io.read.chomp)
- }
- assert_raise(Errno::ENOENT) {
- Process.wait Process.spawn(*PWD, :chdir => "d/notexist")
- }
- }
- end
-
- UMASK = [RUBY, '-e', 'printf "%04o\n", File.umask']
-
- def test_execopts_umask
- skip "umask is not supported" if /mswin|bccwin|mingw/ =~ RUBY_PLATFORM
- IO.popen([*UMASK, :umask => 0]) {|io|
- assert_equal("0000", io.read.chomp)
- }
- IO.popen([*UMASK, :umask => 0777]) {|io|
- assert_equal("0777", io.read.chomp)
- }
- end
-
- def with_pipe
- begin
- r, w = IO.pipe
- yield r, w
- ensure
- r.close unless r.closed?
- w.close unless w.closed?
- end
- end
-
- def with_pipes(n)
- ary = []
- begin
- n.times {
- ary << IO.pipe
- }
- yield ary
- ensure
- ary.each {|r, w|
- r.close unless r.closed?
- w.close unless w.closed?
- }
- end
- end
-
- ECHO = lambda {|arg| [RUBY, '-e', "puts #{arg.dump}; STDOUT.flush"] }
- SORT = [RUBY, '-e', "puts ARGF.readlines.sort"]
- CAT = [RUBY, '-e', "IO.copy_stream STDIN, STDOUT"]
-
- def test_execopts_redirect
- with_tmpchdir {|d|
- Process.wait Process.spawn(*ECHO["a"], STDOUT=>["out", File::WRONLY|File::CREAT|File::TRUNC, 0644])
- assert_equal("a", File.read("out").chomp)
- Process.wait Process.spawn(*ECHO["0"], STDOUT=>["out", File::WRONLY|File::CREAT|File::APPEND, 0644])
- assert_equal("a\n0\n", File.read("out"))
- Process.wait Process.spawn(*SORT, STDIN=>["out", File::RDONLY, 0644],
- STDOUT=>["out2", File::WRONLY|File::CREAT|File::TRUNC, 0644])
- assert_equal("0\na\n", File.read("out2"))
- Process.wait Process.spawn(*ECHO["b"], [STDOUT, STDERR]=>["out", File::WRONLY|File::CREAT|File::TRUNC, 0644])
- assert_equal("b", File.read("out").chomp)
- # problem occur with valgrind
- #Process.wait Process.spawn(*ECHO["a"], STDOUT=>:close, STDERR=>["out", File::WRONLY|File::CREAT|File::TRUNC, 0644])
- #p File.read("out")
- #assert(!File.read("out").empty?) # error message such as "-e:1:in `flush': Bad file descriptor (Errno::EBADF)"
- Process.wait Process.spawn(*ECHO["c"], STDERR=>STDOUT, STDOUT=>["out", File::WRONLY|File::CREAT|File::TRUNC, 0644])
- assert_equal("c", File.read("out").chomp)
- File.open("out", "w") {|f|
- Process.wait Process.spawn(*ECHO["d"], f=>STDOUT, STDOUT=>f)
- assert_equal("d", File.read("out").chomp)
- }
- Process.wait Process.spawn(*ECHO["e"], STDOUT=>["out", File::WRONLY|File::CREAT|File::TRUNC, 0644],
- 3=>STDOUT, 4=>STDOUT, 5=>STDOUT, 6=>STDOUT, 7=>STDOUT)
- assert_equal("e", File.read("out").chomp)
- Process.wait Process.spawn(*ECHO["ee"], STDOUT=>["out", File::WRONLY|File::CREAT|File::TRUNC, 0644],
- 3=>0, 4=>:in, 5=>STDIN,
- 6=>1, 7=>:out, 8=>STDOUT,
- 9=>2, 10=>:err, 11=>STDERR)
- assert_equal("ee", File.read("out").chomp)
- File.open("out", "w") {|f|
- h = {STDOUT=>f, f=>STDOUT}
- 3.upto(30) {|i| h[i] = STDOUT if f.fileno != i }
- Process.wait Process.spawn(*ECHO["f"], h)
- assert_equal("f", File.read("out").chomp)
- }
- assert_raise(ArgumentError) {
- Process.wait Process.spawn(*ECHO["f"], 1=>Process)
- }
- assert_raise(ArgumentError) {
- Process.wait Process.spawn(*ECHO["f"], [Process]=>1)
- }
- assert_raise(ArgumentError) {
- Process.wait Process.spawn(*ECHO["f"], [1, STDOUT]=>2)
- }
- assert_raise(ArgumentError) {
- Process.wait Process.spawn(*ECHO["f"], -1=>2)
- }
- Process.wait Process.spawn(*ECHO["hhh\nggg\n"], STDOUT=>"out")
- assert_equal("hhh\nggg\n", File.read("out"))
- Process.wait Process.spawn(*SORT, STDIN=>"out", STDOUT=>"out2")
- assert_equal("ggg\nhhh\n", File.read("out2"))
-
- assert_raise(Errno::ENOENT) {
- Process.wait Process.spawn("non-existing-command", (3..60).to_a=>["err", File::WRONLY|File::CREAT])
- }
- assert_equal("", File.read("err"))
-
- system(*ECHO["bb\naa\n"], STDOUT=>["out", "w"])
- assert_equal("bb\naa\n", File.read("out"))
- system(*SORT, STDIN=>["out"], STDOUT=>"out2")
- assert_equal("aa\nbb\n", File.read("out2"))
-
- with_pipe {|r1, w1|
- with_pipe {|r2, w2|
- pid = spawn(*SORT, STDIN=>r1, STDOUT=>w2, w1=>:close, r2=>:close)
- r1.close
- w2.close
- w1.puts "c"
- w1.puts "a"
- w1.puts "b"
- w1.close
- assert_equal("a\nb\nc\n", r2.read)
- Process.wait(pid)
- }
- }
-
- with_pipes(5) {|pipes|
- ios = pipes.flatten
- h = {}
- ios.length.times {|i| h[ios[i]] = ios[(i-1)%ios.length] }
- h2 = h.invert
- rios = pipes.map {|r, w| r }
- wios = pipes.map {|r, w| w }
- child_wfds = wios.map {|w| h2[w].fileno }
- pid = spawn(RUBY, "-e",
- "[#{child_wfds.join(',')}].each {|fd| IO.new(fd, 'w').puts fd }", h)
- pipes.each {|r, w|
- assert_equal("#{h2[w].fileno}\n", r.gets)
- }
- Process.wait pid;
- }
-
- with_pipes(5) {|pipes|
- ios = pipes.flatten
- h = {}
- ios.length.times {|i| h[ios[i]] = ios[(i+1)%ios.length] }
- h2 = h.invert
- rios = pipes.map {|r, w| r }
- wios = pipes.map {|r, w| w }
- child_wfds = wios.map {|w| h2[w].fileno }
- pid = spawn(RUBY, "-e",
- "[#{child_wfds.join(',')}].each {|fd| IO.new(fd, 'w').puts fd }", h)
- pipes.each {|r, w|
- assert_equal("#{h2[w].fileno}\n", r.gets)
- }
- Process.wait pid;
- }
-
- closed_fd = nil
- with_pipes(5) {|pipes|
- io = pipes.last.last
- closed_fd = io.fileno
- }
- assert_raise(Errno::EBADF) { Process.wait spawn(*TRUECOMMAND, closed_fd=>closed_fd) }
-
- with_pipe {|r, w|
- w.close_on_exec = true
- pid = spawn(RUBY, "-e", "IO.new(#{w.fileno}, 'w').print 'a'", w=>w)
- w.close
- assert_equal("a", r.read)
- Process.wait pid
- }
-
- system(*ECHO["funya"], :out=>"out")
- assert_equal("funya\n", File.read("out"))
- system(RUBY, '-e', 'STDOUT.reopen(STDERR); puts "henya"', :err=>"out")
- assert_equal("henya\n", File.read("out"))
- IO.popen([*CAT, :in=>"out"]) {|io|
- assert_equal("henya\n", io.read)
- }
- }
- end
-
- def test_execopts_redirect_dup2_child
- with_tmpchdir {|d|
- Process.wait spawn(RUBY, "-e", "STDERR.print 'err'; STDOUT.print 'out'",
- STDOUT=>"out", STDERR=>[:child, STDOUT])
- assert_equal("errout", File.read("out"))
-
- Process.wait spawn(RUBY, "-e", "STDERR.print 'err'; STDOUT.print 'out'",
- STDERR=>"out", STDOUT=>[:child, STDERR])
- assert_equal("errout", File.read("out"))
-
- if /mswin|bccwin|mingw/ =~ RUBY_PLATFORM
- skip "inheritance of fd other than stdin,stdout and stderr is not supported"
- end
- Process.wait spawn(RUBY, "-e", "STDERR.print 'err'; STDOUT.print 'out'",
- STDOUT=>"out",
- STDERR=>[:child, 3],
- 3=>[:child, 4],
- 4=>[:child, STDOUT]
- )
- assert_equal("errout", File.read("out"))
-
- IO.popen([RUBY, "-e", "STDERR.print 'err'; STDOUT.print 'out'", STDERR=>[:child, STDOUT]]) {|io|
- assert_equal("errout", io.read)
- }
-
- assert_raise(ArgumentError) { Process.wait spawn(*TRUECOMMAND, STDOUT=>[:child, STDOUT]) }
- assert_raise(ArgumentError) { Process.wait spawn(*TRUECOMMAND, 3=>[:child, 4], 4=>[:child, 3]) }
- assert_raise(ArgumentError) { Process.wait spawn(*TRUECOMMAND, 3=>[:child, 4], 4=>[:child, 5], 5=>[:child, 3]) }
- assert_raise(ArgumentError) { Process.wait spawn(*TRUECOMMAND, STDOUT=>[:child, 3]) }
- }
- end
-
- def test_execopts_exec
- with_tmpchdir {|d|
- write_file("s", 'exec "echo aaa", STDOUT=>"foo"')
- pid = spawn RUBY, 's'
- Process.wait pid
- assert_equal("aaa\n", File.read("foo"))
- }
- end
-
- def test_execopts_popen
- with_tmpchdir {|d|
- IO.popen("#{RUBY} -e 'puts :foo'") {|io| assert_equal("foo\n", io.read) }
- assert_raise(Errno::ENOENT) { IO.popen(["echo bar"]) {} } # assuming "echo bar" command not exist.
- IO.popen(ECHO["baz"]) {|io| assert_equal("baz\n", io.read) }
- assert_raise(ArgumentError) {
- IO.popen([*ECHO["qux"], STDOUT=>STDOUT]) {|io| }
- }
- IO.popen([*ECHO["hoge"], STDERR=>STDOUT]) {|io|
- assert_equal("hoge\n", io.read)
- }
- assert_raise(ArgumentError) {
- IO.popen([*ECHO["fuga"], STDOUT=>"out"]) {|io| }
- }
- if /mswin|bccwin|mingw/ =~ RUBY_PLATFORM
- skip "inheritance of fd other than stdin,stdout and stderr is not supported"
- end
- with_pipe {|r, w|
- IO.popen([RUBY, '-e', 'IO.new(3, "w").puts("a"); puts "b"', 3=>w]) {|io|
- assert_equal("b\n", io.read)
- }
- w.close
- assert_equal("a\n", r.read)
- }
- IO.popen([RUBY, '-e', "IO.new(9, 'w').puts(:b)",
- 9=>["out2", File::WRONLY|File::CREAT|File::TRUNC]]) {|io|
- assert_equal("", io.read)
- }
- assert_equal("b\n", File.read("out2"))
- }
- end
-
- def test_popen_fork
- return if /freebsd/ =~ RUBY_PLATFORM # this test freeze in FreeBSD
- IO.popen("-") {|io|
- if !io
- puts "fooo"
- else
- assert_equal("fooo\n", io.read)
- end
- }
- rescue NotImplementedError
- end
-
- def test_fd_inheritance
- if /mswin|bccwin|mingw/ =~ RUBY_PLATFORM
- skip "inheritance of fd other than stdin,stdout and stderr is not supported"
- end
- with_pipe {|r, w|
- system(RUBY, '-e', 'IO.new(ARGV[0].to_i, "w").puts(:ba)', w.fileno.to_s)
- w.close
- assert_equal("ba\n", r.read)
- }
- with_pipe {|r, w|
- Process.wait spawn(RUBY, '-e',
- 'IO.new(ARGV[0].to_i, "w").puts("bi") rescue nil',
- w.fileno.to_s)
- w.close
- assert_equal("", r.read)
- }
- with_pipe {|r, w|
- with_tmpchdir {|d|
- write_file("s", <<-"End")
- exec(#{RUBY.dump}, '-e',
- 'IO.new(ARGV[0].to_i, "w").puts("bu") rescue nil',
- #{w.fileno.to_s.dump})
- End
- Process.wait spawn(RUBY, "s", :close_others=>false)
- w.close
- assert_equal("bu\n", r.read)
- }
- }
- with_pipe {|r, w|
- io = IO.popen([RUBY, "-e", "STDERR.reopen(STDOUT); IO.new(#{w.fileno}, 'w').puts('me')"])
- w.close
- errmsg = io.read
- assert_equal("", r.read)
- assert_not_equal("", errmsg)
- Process.wait
- }
- with_pipe {|r, w|
- errmsg = `#{RUBY} -e "STDERR.reopen(STDOUT); IO.new(#{w.fileno}, 'w').puts(123)"`
- w.close
- assert_equal("", r.read)
- assert_not_equal("", errmsg)
- }
- end
-
- def test_execopts_close_others
- if /mswin|bccwin|mingw/ =~ RUBY_PLATFORM
- skip "inheritance of fd other than stdin,stdout and stderr is not supported"
- end
- with_tmpchdir {|d|
- with_pipe {|r, w|
- system(RUBY, '-e', 'STDERR.reopen("err", "w"); IO.new(ARGV[0].to_i, "w").puts("ma")', w.fileno.to_s, :close_others=>true)
- w.close
- assert_equal("", r.read)
- assert_not_equal("", File.read("err"))
- File.unlink("err")
- }
- with_pipe {|r, w|
- Process.wait spawn(RUBY, '-e', 'STDERR.reopen("err", "w"); IO.new(ARGV[0].to_i, "w").puts("mi")', w.fileno.to_s, :close_others=>true)
- w.close
- assert_equal("", r.read)
- assert_not_equal("", File.read("err"))
- File.unlink("err")
- }
- with_pipe {|r, w|
- Process.wait spawn(RUBY, '-e', 'IO.new(ARGV[0].to_i, "w").puts("bi")', w.fileno.to_s, :close_others=>false)
- w.close
- assert_equal("bi\n", r.read)
- }
- with_pipe {|r, w|
- write_file("s", <<-"End")
- exec(#{RUBY.dump}, '-e',
- 'STDERR.reopen("err", "w"); IO.new(ARGV[0].to_i, "w").puts("mu")',
- #{w.fileno.to_s.dump},
- :close_others=>true)
- End
- Process.wait spawn(RUBY, "s", :close_others=>false)
- w.close
- assert_equal("", r.read)
- assert_not_equal("", File.read("err"))
- File.unlink("err")
- }
- with_pipe {|r, w|
- io = IO.popen([RUBY, "-e", "STDERR.reopen(STDOUT); IO.new(#{w.fileno}, 'w').puts('me')", :close_others=>true])
- w.close
- errmsg = io.read
- assert_equal("", r.read)
- assert_not_equal("", errmsg)
- Process.wait
- }
- with_pipe {|r, w|
- io = IO.popen([RUBY, "-e", "STDERR.reopen(STDOUT); IO.new(#{w.fileno}, 'w').puts('mo')", :close_others=>false])
- w.close
- errmsg = io.read
- assert_equal("mo\n", r.read)
- assert_equal("", errmsg)
- Process.wait
- }
- with_pipe {|r, w|
- io = IO.popen([RUBY, "-e", "STDERR.reopen(STDOUT); IO.new(#{w.fileno}, 'w').puts('mo')", :close_others=>nil])
- w.close
- errmsg = io.read
- assert_equal("mo\n", r.read)
- assert_equal("", errmsg)
- Process.wait
- }
-
- }
- end
-
- def test_execopts_redirect_self
- begin
- with_pipe {|r, w|
- w << "haha\n"
- w.close
- r.close_on_exec = true
- IO.popen([RUBY, "-e", "print IO.new(#{r.fileno}, 'r').read", r.fileno=>r.fileno, :close_others=>false]) {|io|
- assert_equal("haha\n", io.read)
- }
- }
- rescue NotImplementedError
- skip "IO#close_on_exec= is not supported"
- end
- end
-
- def test_execopts_duplex_io
- IO.popen("#{RUBY} -e ''", "r+") {|duplex|
- assert_raise(ArgumentError) { system("#{RUBY} -e ''", duplex=>STDOUT) }
- assert_raise(ArgumentError) { system("#{RUBY} -e ''", STDOUT=>duplex) }
- }
- end
-
- def test_execopts_modification
- h = {}
- Process.wait spawn(*TRUECOMMAND, h)
- assert_equal({}, h)
-
- h = {}
- system(*TRUECOMMAND, h)
- assert_equal({}, h)
-
- h = {}
- io = IO.popen([*TRUECOMMAND, h])
- io.close
- assert_equal({}, h)
- end
-
- def test_system_noshell
- str = "echo non existing command name which contains spaces"
- assert_nil(system([str, str]))
- end
-
- def test_spawn_noshell
- str = "echo non existing command name which contains spaces"
- assert_raise(Errno::ENOENT) { spawn([str, str]) }
- end
-
- def test_popen_noshell
- str = "echo non existing command name which contains spaces"
- assert_raise(Errno::ENOENT) { IO.popen([str, str]) }
- end
-
- def test_exec_noshell
- with_tmpchdir {|d|
- write_file("s", <<-"End")
- str = "echo non existing command name which contains spaces"
- STDERR.reopen(STDOUT)
- begin
- exec [str, str]
- rescue Errno::ENOENT
- print "Errno::ENOENT success"
- end
- End
- r = IO.popen([RUBY, "s", :close_others=>false], "r") {|f| f.read}
- assert_equal("Errno::ENOENT success", r)
- }
- end
-
- def test_system_wordsplit
- with_tmpchdir {|d|
- write_file("script", <<-'End')
- File.open("result", "w") {|t| t << "haha pid=#{$$} ppid=#{Process.ppid}" }
- exit 5
- End
- str = "#{RUBY} script"
- ret = system(str)
- status = $?
- assert_equal(false, ret)
- assert(status.exited?)
- assert_equal(5, status.exitstatus)
- assert_equal("haha pid=#{status.pid} ppid=#{$$}", File.read("result"))
- }
- end
-
- def test_spawn_wordsplit
- with_tmpchdir {|d|
- write_file("script", <<-'End')
- File.open("result", "w") {|t| t << "hihi pid=#{$$} ppid=#{Process.ppid}" }
- exit 6
- End
- str = "#{RUBY} script"
- pid = spawn(str)
- Process.wait pid
- status = $?
- assert_equal(pid, status.pid)
- assert(status.exited?)
- assert_equal(6, status.exitstatus)
- assert_equal("hihi pid=#{status.pid} ppid=#{$$}", File.read("result"))
- }
- end
-
- def test_popen_wordsplit
- with_tmpchdir {|d|
- write_file("script", <<-'End')
- print "fufu pid=#{$$} ppid=#{Process.ppid}"
- exit 7
- End
- str = "#{RUBY} script"
- io = IO.popen(str)
- pid = io.pid
- result = io.read
- io.close
- status = $?
- assert_equal(pid, status.pid)
- assert(status.exited?)
- assert_equal(7, status.exitstatus)
- assert_equal("fufu pid=#{status.pid} ppid=#{$$}", result)
- }
- end
-
- def test_exec_wordsplit
- with_tmpchdir {|d|
- write_file("script", <<-'End')
- File.open("result", "w") {|t|
- if /mswin|bccwin|mingw/ =~ RUBY_PLATFORM
- t << "hehe ppid=#{Process.ppid}"
- else
- t << "hehe pid=#{$$} ppid=#{Process.ppid}"
- end
- }
- exit 6
- End
- write_file("s", <<-"End")
- ruby = #{RUBY.dump}
- exec "\#{ruby} script"
- End
- pid = spawn(RUBY, "s")
- Process.wait pid
- status = $?
- assert_equal(pid, status.pid)
- assert(status.exited?)
- assert_equal(6, status.exitstatus)
- if /mswin|bccwin|mingw/ =~ RUBY_PLATFORM
- expected = "hehe ppid=#{status.pid}"
- else
- expected = "hehe pid=#{status.pid} ppid=#{$$}"
- end
- assert_equal(expected, File.read("result"))
- }
- end
-
- def test_system_shell
- with_tmpchdir {|d|
- write_file("script1", <<-'End')
- File.open("result1", "w") {|t| t << "taka pid=#{$$} ppid=#{Process.ppid}" }
- exit 7
- End
- write_file("script2", <<-'End')
- File.open("result2", "w") {|t| t << "taki pid=#{$$} ppid=#{Process.ppid}" }
- exit 8
- End
- ret = system("#{RUBY} script1 || #{RUBY} script2")
- status = $?
- assert_equal(false, ret)
- assert(status.exited?)
- result1 = File.read("result1")
- result2 = File.read("result2")
- assert_match(/\Ataka pid=\d+ ppid=\d+\z/, result1)
- assert_match(/\Ataki pid=\d+ ppid=\d+\z/, result2)
- assert_not_equal(result1[/\d+/].to_i, status.pid)
-
- if /mswin|bccwin|mingw/ =~ RUBY_PLATFORM
- Dir.mkdir(path = "path with space")
- write_file(bat = path + "/bat test.bat", "@echo %1>out")
- system(bat, "foo 'bar'")
- assert_equal(%["foo 'bar'"\n], File.read("out"), '[ruby-core:22960]')
- system(%[#{bat.dump} "foo 'bar'"])
- assert_equal(%["foo 'bar'"\n], File.read("out"), '[ruby-core:22960]')
- end
- }
- end
-
- def test_spawn_shell
- with_tmpchdir {|d|
- write_file("script1", <<-'End')
- File.open("result1", "w") {|t| t << "taku pid=#{$$} ppid=#{Process.ppid}" }
- exit 7
- End
- write_file("script2", <<-'End')
- File.open("result2", "w") {|t| t << "take pid=#{$$} ppid=#{Process.ppid}" }
- exit 8
- End
- pid = spawn("#{RUBY} script1 || #{RUBY} script2")
- Process.wait pid
- status = $?
- assert(status.exited?)
- assert(!status.success?)
- result1 = File.read("result1")
- result2 = File.read("result2")
- assert_match(/\Ataku pid=\d+ ppid=\d+\z/, result1)
- assert_match(/\Atake pid=\d+ ppid=\d+\z/, result2)
- assert_not_equal(result1[/\d+/].to_i, status.pid)
-
- if /mswin|bccwin|mingw/ =~ RUBY_PLATFORM
- Dir.mkdir(path = "path with space")
- write_file(bat = path + "/bat test.bat", "@echo %1>out")
- pid = spawn(bat, "foo 'bar'")
- Process.wait pid
- status = $?
- assert(status.exited?)
- assert(status.success?)
- assert_equal(%["foo 'bar'"\n], File.read("out"), '[ruby-core:22960]')
- pid = spawn(%[#{bat.dump} "foo 'bar'"])
- Process.wait pid
- status = $?
- assert(status.exited?)
- assert(status.success?)
- assert_equal(%["foo 'bar'"\n], File.read("out"), '[ruby-core:22960]')
- end
- }
- end
-
- def test_popen_shell
- with_tmpchdir {|d|
- write_file("script1", <<-'End')
- puts "tako pid=#{$$} ppid=#{Process.ppid}"
- exit 7
- End
- write_file("script2", <<-'End')
- puts "tika pid=#{$$} ppid=#{Process.ppid}"
- exit 8
- End
- io = IO.popen("#{RUBY} script1 || #{RUBY} script2")
- result = io.read
- io.close
- status = $?
- assert(status.exited?)
- assert(!status.success?)
- assert_match(/\Atako pid=\d+ ppid=\d+\ntika pid=\d+ ppid=\d+\n\z/, result)
- assert_not_equal(result[/\d+/].to_i, status.pid)
-
- if /mswin|bccwin|mingw/ =~ RUBY_PLATFORM
- Dir.mkdir(path = "path with space")
- write_file(bat = path + "/bat test.bat", "@echo %1")
- r = IO.popen([bat, "foo 'bar'"]) {|f| f.read}
- assert_equal(%["foo 'bar'"\n], r, '[ruby-core:22960]')
- r = IO.popen(%[#{bat.dump} "foo 'bar'"]) {|f| f.read}
- assert_equal(%["foo 'bar'"\n], r, '[ruby-core:22960]')
+ pid = fork {
+ cur_nofile, max_nofile = Process.getrlimit(Process::RLIMIT_NOFILE)
+ begin
+ Process.setrlimit(Process::RLIMIT_NOFILE, 0, max_nofile)
+ rescue Errno::EINVAL
+ exit 0
end
- }
- end
-
- def test_exec_shell
- with_tmpchdir {|d|
- write_file("script1", <<-'End')
- File.open("result1", "w") {|t| t << "tiki pid=#{$$} ppid=#{Process.ppid}" }
- exit 7
- End
- write_file("script2", <<-'End')
- File.open("result2", "w") {|t| t << "tiku pid=#{$$} ppid=#{Process.ppid}" }
- exit 8
- End
- write_file("s", <<-"End")
- ruby = #{RUBY.dump}
- exec("\#{ruby} script1 || \#{ruby} script2")
- End
- pid = spawn RUBY, "s"
- Process.wait pid
- status = $?
- assert(status.exited?)
- assert(!status.success?)
- result1 = File.read("result1")
- result2 = File.read("result2")
- assert_match(/\Atiki pid=\d+ ppid=\d+\z/, result1)
- assert_match(/\Atiku pid=\d+ ppid=\d+\z/, result2)
- assert_not_equal(result1[/\d+/].to_i, status.pid)
- }
- end
-
- def test_argv0
- with_tmpchdir {|d|
- assert_equal(false, system([RUBY, "asdfg"], "-e", "exit false"))
- assert_equal(true, system([RUBY, "zxcvb"], "-e", "exit true"))
-
- Process.wait spawn([RUBY, "poiu"], "-e", "exit 4")
- assert_equal(4, $?.exitstatus)
-
- assert_equal("1", IO.popen([[RUBY, "qwerty"], "-e", "print 1"]).read)
- Process.wait
-
- write_file("s", <<-"End")
- exec([#{RUBY.dump}, "lkjh"], "-e", "exit 5")
- End
- pid = spawn RUBY, "s"
- Process.wait pid
- assert_equal(5, $?.exitstatus)
- }
- end
-
- def with_stdin(filename)
- open(filename) {|f|
begin
- old = STDIN.dup
- begin
- STDIN.reopen(filename)
- yield
- ensure
- STDIN.reopen(old)
- end
- ensure
- old.close
+ IO.pipe
+ rescue Errno::EMFILE
+ exit 0
end
+ exit 1
}
- end
-
- def test_argv0_noarg
- with_tmpchdir {|d|
- open("t", "w") {|f| f.print "exit true" }
- open("f", "w") {|f| f.print "exit false" }
-
- with_stdin("t") { assert_equal(true, system([RUBY, "qaz"])) }
- with_stdin("f") { assert_equal(false, system([RUBY, "wsx"])) }
-
- with_stdin("t") { Process.wait spawn([RUBY, "edc"]) }
- assert($?.success?)
- with_stdin("f") { Process.wait spawn([RUBY, "rfv"]) }
- assert(!$?.success?)
-
- with_stdin("t") { IO.popen([[RUBY, "tgb"]]) {|io| assert_equal("", io.read) } }
- assert($?.success?)
- with_stdin("f") { IO.popen([[RUBY, "yhn"]]) {|io| assert_equal("", io.read) } }
- assert(!$?.success?)
-
- status = run_in_child "STDIN.reopen('t'); exec([#{RUBY.dump}, 'ujm'])"
- assert(status.success?)
- status = run_in_child "STDIN.reopen('f'); exec([#{RUBY.dump}, 'ik,'])"
- assert(!status.success?)
- }
- end
-
- def test_status
- with_tmpchdir do
- s = run_in_child("exit 1")
- assert_equal("#<Process::Status: pid #{ s.pid } exit #{ s.exitstatus }>", s.inspect)
-
- assert_equal(s, s)
- assert_equal(s, s.to_i)
-
- assert_equal(s.to_i & 0x55555555, s & 0x55555555)
- assert_equal(s.to_i >> 1, s >> 1)
- assert_equal(false, s.stopped?)
- assert_equal(nil, s.stopsig)
- end
- end
-
- def test_status_kill
- return unless Process.respond_to?(:kill)
- return unless Signal.list.include?("QUIT")
-
- with_tmpchdir do
- write_file("foo", "sleep 30")
- pid = spawn(RUBY, "foo")
- Thread.new { sleep 1; Process.kill(:SIGQUIT, pid) }
- Process.wait(pid)
- s = $?
- assert_send(
- [["#<Process::Status: pid #{ s.pid } SIGQUIT (signal #{ s.termsig })>",
- "#<Process::Status: pid #{ s.pid } SIGQUIT (signal #{ s.termsig }) (core dumped)>"],
- :include?,
- s.inspect])
- assert_equal(false, s.exited?)
- assert_equal(nil, s.success?)
- end
- end
-
- def test_wait_without_arg
- with_tmpchdir do
- write_file("foo", "sleep 0.1")
- pid = spawn(RUBY, "foo")
- assert_equal(pid, Process.wait)
- end
- end
-
- def test_wait2
- with_tmpchdir do
- write_file("foo", "sleep 0.1")
- pid = spawn(RUBY, "foo")
- assert_equal([pid, 0], Process.wait2)
- end
- end
-
- def test_waitall
- with_tmpchdir do
- write_file("foo", "sleep 0.1")
- ps = (0...3).map { spawn(RUBY, "foo") }.sort
- ss = Process.waitall.sort
- ps.zip(ss) do |p1, (p2, s)|
- assert_equal(p1, p2)
- assert_equal(p1, s.pid)
- end
- end
- end
-
- def test_abort
- with_tmpchdir do
- s = run_in_child("abort")
- assert_not_equal(0, s.exitstatus)
- end
- end
-
- def test_sleep
- assert_raise(ArgumentError) { sleep(1, 1) }
- end
-
- def test_getpgid
- assert_kind_of(Integer, Process.getpgid(Process.ppid))
- rescue NotImplementedError
- end
-
- def test_getpriority
- assert_kind_of(Integer, Process.getpriority(Process::PRIO_PROCESS, $$))
- rescue NameError, NotImplementedError
- end
-
- def test_setpriority
- if defined? Process::PRIO_USER
- assert_nothing_raised do
- pr = Process.getpriority(Process::PRIO_PROCESS, $$)
- Process.setpriority(Process::PRIO_PROCESS, $$, pr)
- end
- end
- end
-
- def test_getuid
- assert_kind_of(Integer, Process.uid)
- end
-
- def test_groups
- gs = Process.groups
- assert_instance_of(Array, gs)
- gs.each {|g| assert_kind_of(Integer, g) }
- rescue NotImplementedError
- end
-
- def test_maxgroups
- assert_kind_of(Integer, Process.maxgroups)
- end
-
- def test_geteuid
- assert_kind_of(Integer, Process.egid)
- end
-
- def test_uid_re_exchangeable_p
- r = Process::UID.re_exchangeable?
- assert(true == r || false == r)
- end
-
- def test_gid_re_exchangeable_p
- r = Process::GID.re_exchangeable?
- assert(true == r || false == r)
- end
-
- def test_uid_sid_available?
- r = Process::UID.sid_available?
- assert(true == r || false == r)
- end
-
- def test_gid_sid_available?
- r = Process::GID.sid_available?
- assert(true == r || false == r)
- end
-
- def test_pst_inspect
- assert_nothing_raised { Process::Status.allocate.inspect }
- end
-
- def test_wait_and_sigchild
- signal_received = []
- Signal.trap(:CHLD) { signal_received << true }
- pid = fork { sleep 1; exit }
- Thread.start { raise }
Process.wait pid
- sleep 2
- assert_equal [true], signal_received, " [ruby-core:19744]"
- rescue NotImplementedError, ArgumentError
- ensure
- begin
- Signal.trap(:CHLD, 'DEFAULT')
- rescue ArgumentError
- end
+ assert_equal(0, $?.to_i)
end
end
diff --git a/test/ruby/test_rand.rb b/test/ruby/test_rand.rb
index 7bfd96f355..e2fd127f9c 100644
--- a/test/ruby/test_rand.rb
+++ b/test/ruby/test_rand.rb
@@ -1,167 +1,131 @@
require 'test/unit'
class TestRand < Test::Unit::TestCase
- def assert_random_int(ws, m, init = 0)
- srand(init)
- rnds = [Random.new(init)]
- ws.each do |w|
- w = w.to_i
- assert_equal(w, rand(m))
- rnds.each do |rnd|
- assert_equal(w, rnd.int(m))
- end
- rnds << Marshal.load(Marshal.dump(rnds[-1]))
- end
- end
-
def test_mt
- assert_random_int(%w(1067595299 955945823 477289528 4107218783 4228976476),
- 0x100000000, 0x00000456_00000345_00000234_00000123)
+ srand(0x00000456_00000345_00000234_00000123)
+ %w(1067595299 955945823 477289528 4107218783 4228976476).each {|w|
+ assert_equal(w.to_i, rand(0x100000000))
+ }
end
def test_0x3fffffff
- assert_random_int(%w(209652396 398764591 924231285 404868288 441365315),
- 0x3fffffff)
+ srand(0)
+ %w(209652396 398764591 924231285 404868288 441365315).each {|w|
+ assert_equal(w.to_i, rand(0x3fffffff))
+ }
end
def test_0x40000000
- assert_random_int(%w(209652396 398764591 924231285 404868288 441365315),
- 0x40000000)
+ srand(0)
+ %w(209652396 398764591 924231285 404868288 441365315).each {|w|
+ assert_equal(w.to_i, rand(0x40000000))
+ }
end
def test_0x40000001
- assert_random_int(%w(209652396 398764591 924231285 441365315 192771779),
- 0x40000001)
+ srand(0)
+ %w(209652396 398764591 924231285 441365315 192771779).each {|w|
+ assert_equal(w.to_i, rand(0x40000001))
+ }
end
def test_0xffffffff
- assert_random_int(%w(2357136044 2546248239 3071714933 3626093760 2588848963),
- 0xffffffff)
+ srand(0)
+ %w(2357136044 2546248239 3071714933 3626093760 2588848963).each {|w|
+ assert_equal(w.to_i, rand(0xffffffff))
+ }
end
def test_0x100000000
- assert_random_int(%w(2357136044 2546248239 3071714933 3626093760 2588848963),
- 0x100000000)
+ srand(0)
+ %w(2357136044 2546248239 3071714933 3626093760 2588848963).each {|w|
+ assert_equal(w.to_i, rand(0x100000000))
+ }
end
def test_0x100000001
- assert_random_int(%w(2546248239 1277901399 243580376 1171049868 2051556033),
- 0x100000001)
+ srand(0)
+ %w(2546248239 1277901399 243580376 1171049868 2051556033).each {|w|
+ assert_equal(w.to_i, rand(0x100000001))
+ }
end
def test_rand_0x100000000
- assert_random_int(%w(4119812344 3870378946 80324654 4294967296 410016213),
- 0x100000001, 311702798)
+ srand(311702798)
+ %w(4119812344 3870378946 80324654 4294967296 410016213).each {|w|
+ assert_equal(w.to_i, rand(0x100000001))
+ }
end
def test_0x1000000000000
- assert_random_int(%w(11736396900911
- 183025067478208
- 197104029029115
- 130583529618791
- 180361239846611),
- 0x1000000000000)
+ srand(0)
+ %w(11736396900911
+ 183025067478208
+ 197104029029115
+ 130583529618791
+ 180361239846611).each {|w|
+ assert_equal(w.to_i, rand(0x1000000000000))
+ }
end
def test_0x1000000000001
- assert_random_int(%w(187121911899765
- 197104029029115
- 180361239846611
- 236336749852452
- 208739549485656),
- 0x1000000000001)
+ srand(0)
+ %w(187121911899765
+ 197104029029115
+ 180361239846611
+ 236336749852452
+ 208739549485656).each {|w|
+ assert_equal(w.to_i, rand(0x1000000000001))
+ }
end
def test_0x3fffffffffffffff
- assert_random_int(%w(900450186894289455
- 3969543146641149120
- 1895649597198586619
- 827948490035658087
- 3203365596207111891),
- 0x3fffffffffffffff)
+ srand(0)
+ %w(900450186894289455
+ 3969543146641149120
+ 1895649597198586619
+ 827948490035658087
+ 3203365596207111891).each {|w|
+ assert_equal(w.to_i, rand(0x3fffffffffffffff))
+ }
end
def test_0x4000000000000000
- assert_random_int(%w(900450186894289455
- 3969543146641149120
- 1895649597198586619
- 827948490035658087
- 3203365596207111891),
- 0x4000000000000000)
+ srand(0)
+ %w(900450186894289455
+ 3969543146641149120
+ 1895649597198586619
+ 827948490035658087
+ 3203365596207111891).each {|w|
+ assert_equal(w.to_i, rand(0x4000000000000000))
+ }
end
def test_0x4000000000000001
- assert_random_int(%w(900450186894289455
- 3969543146641149120
- 1895649597198586619
- 827948490035658087
- 2279347887019741461),
- 0x4000000000000001)
+ srand(0)
+ %w(900450186894289455
+ 3969543146641149120
+ 1895649597198586619
+ 827948490035658087
+ 2279347887019741461).each {|w|
+ assert_equal(w.to_i, rand(0x4000000000000001))
+ }
end
def test_neg_0x10000000000
ws = %w(455570294424 1073054410371 790795084744 2445173525 1088503892627)
- assert_random_int(ws, 0x10000000000, 3)
- assert_random_int(ws, -0x10000000000, 3)
+ srand(3)
+ ws.each {|w| assert_equal(w.to_i, rand(0x10000000000)) }
+ srand(3)
+ ws.each {|w| assert_equal(w.to_i, rand(-0x10000000000)) }
end
def test_neg_0x10000
ws = %w(2732 43567 42613 52416 45891)
- assert_random_int(ws, 0x10000)
- assert_random_int(ws, -0x10000)
- end
-
- def test_types
- srand(0)
- rnd = Random.new(0)
- assert_equal(44, rand(100.0))
- assert_equal(44, rnd.int(100.0))
- assert_equal(1245085576965981900420779258691, rand((2**100).to_f))
- assert_equal(1245085576965981900420779258691, rnd.int((2**100).to_f))
- assert_equal(914679880601515615685077935113, rand(-(2**100).to_f))
- assert_equal(914679880601515615685077935113, rnd.int(-(2**100).to_f))
-
- srand(0)
- rnd = Random.new(0)
- assert_equal(997707939797331598305742933184, rand(2**100))
- assert_equal(997707939797331598305742933184, rnd.int(2**100))
- assert_in_delta(0.602763376071644, rand((2**100).coerce(0).first),
- 0.000000000000001)
- assert_equal(0, rnd.int((2**100).coerce(0).first))
-
srand(0)
- rnd = Random.new(0)
- assert_in_delta(0.548813503927325, rand(nil),
- 0.000000000000001)
- assert_in_delta(0.548813503927325, rnd.float(),
- 0.000000000000001)
+ ws.each {|w| assert_equal(w.to_i, rand(0x10000)) }
srand(0)
- rnd = Random.new(0)
- o = Object.new
- def o.to_int; 100; end
- assert_equal(44, rand(o))
- assert_equal(44, rnd.int(o))
- assert_equal(47, rand(o))
- assert_equal(47, rnd.int(o))
- assert_equal(64, rand(o))
- assert_equal(64, rnd.int(o))
- end
-
- def test_srand
- srand
- assert_kind_of(Integer, rand(2))
- assert_kind_of(Integer, Random.new.int(2))
-
- srand(2**100)
- rnd = Random.new(2**100)
- %w(3258412053).each {|w|
- assert_equal(w.to_i, rand(0x100000000))
- assert_equal(w.to_i, rnd.int(0x100000000))
- }
+ ws.each {|w| assert_equal(w.to_i, rand(-0x10000)) }
end
- def test_shuffle
- srand(0)
- assert_equal([1,4,2,5,3], [1,2,3,4,5].shuffle)
- end
end
diff --git a/test/ruby/test_range.rb b/test/ruby/test_range.rb
index b4c078915d..455175087d 100644
--- a/test/ruby/test_range.rb
+++ b/test/ruby/test_range.rb
@@ -14,266 +14,4 @@ class TestRange < Test::Unit::TestCase
r = (arr.shift)..(arr.shift)
assert_equal(1..2, r, "[ruby-dev:26383]")
end
-
- class DuckRange
- def initialize(b,e,excl=false)
- @begin = b
- @end = e
- @excl = excl
- end
- attr_reader :begin, :end
-
- def exclude_end?
- @excl
- end
- end
-
- def test_duckrange
- assert_equal("bc", "abcd"[DuckRange.new(1,2)])
- end
-
- def test_min
- assert_equal(1, (1..2).min)
- assert_equal(nil, (2..1).min)
- assert_equal(1, (1...2).min)
-
- assert_equal(1.0, (1.0..2.0).min)
- assert_equal(nil, (2.0..1.0).min)
- assert_equal(1, (1.0...2.0).min)
-
- assert_equal(0, (0..0).min)
- assert_equal(nil, (0...0).min)
- end
-
- def test_max
- assert_equal(2, (1..2).max)
- assert_equal(nil, (2..1).max)
- assert_equal(1, (1...2).max)
-
- assert_equal(2.0, (1.0..2.0).max)
- assert_equal(nil, (2.0..1.0).max)
- assert_raise(TypeError) { (1.0...2.0).max }
-
- assert_equal(-0x80000002, ((-0x80000002)...(-0x80000001)).max)
-
- assert_equal(0, (0..0).max)
- assert_equal(nil, (0...0).max)
- end
-
- def test_initialize_twice
- r = eval("1..2")
- assert_raise(NameError) { r.instance_eval { initialize 3, 4 } }
- end
-
- def test_uninitialized_range
- r = Range.allocate
- s = Marshal.dump(r)
- r = Marshal.load(s)
- assert_nothing_raised { r.instance_eval { initialize 5, 6} }
- end
-
- def test_bad_value
- assert_raise(ArgumentError) { (1 .. :a) }
- end
-
- def test_exclude_end
- assert(!((0..1).exclude_end?))
- assert((0...1).exclude_end?)
- end
-
- def test_eq
- r = (0..1)
- assert(r == r)
- assert(r == (0..1))
- assert(r != 0)
- assert(r != (1..2))
- assert(r != (0..2))
- assert(r != (0...1))
- end
-
- def test_eql
- r = (0..1)
- assert(r.eql?(r))
- assert(r.eql?(0..1))
- assert(!r.eql?(0))
- assert(!r.eql?(1..2))
- assert(!r.eql?(0..2))
- assert(!r.eql?(0...1))
- end
-
- def test_hash
- assert((0..1).hash.is_a?(Fixnum))
- end
-
- def test_step
- a = []
- (0..10).step {|x| a << x }
- assert_equal([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10], a)
-
- a = []
- (0..10).step(2) {|x| a << x }
- assert_equal([0, 2, 4, 6, 8, 10], a)
-
- assert_raise(ArgumentError) { (0..10).step(-1) { } }
- assert_raise(ArgumentError) { (0..10).step(0) { } }
-
- a = []
- ("a" .. "z").step(2) {|x| a << x }
- assert_equal(%w(a c e g i k m o q s u w y), a)
-
- a = []
- ("a" .. "z").step(2**32) {|x| a << x }
- assert_equal(["a"], a)
-
- a = []
- (2**32-1 .. 2**32+1).step(2) {|x| a << x }
- assert_equal([4294967295, 4294967297], a)
- zero = (2**32).coerce(0).first
- assert_raise(ArgumentError) { (2**32-1 .. 2**32+1).step(zero) { } }
-
- o1 = Object.new
- o2 = Object.new
- def o1.<=>(x); -1; end
- def o2.<=>(x); 0; end
- assert_raise(TypeError) { (o1..o2).step(1) { } }
-
- class << o1; self; end.class_eval do
- define_method(:succ) { o2 }
- end
- a = []
- (o1..o2).step(1) {|x| a << x }
- assert_equal([o1, o2], a)
-
- a = []
- (o1...o2).step(1) {|x| a << x }
- assert_equal([o1], a)
-
- assert_nothing_raised("[ruby-dev:34557]") { (0..2).step(0.5) {|x| } }
-
- a = []
- (0..2).step(0.5) {|x| a << x }
- assert_equal([0, 0.5, 1.0, 1.5, 2.0], a)
-
- a = []
- (0x40000000..0x40000002).step(0.5) {|x| a << x }
- assert_equal([1073741824, 1073741824.5, 1073741825.0, 1073741825.5, 1073741826], a)
-
- o = Object.new
- def o.to_int() 1 end
- assert_nothing_raised("[ruby-dev:34558]") { (0..2).step(o) {|x| } }
- end
-
- def test_each
- a = []
- (0..10).each {|x| a << x }
- assert_equal([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10], a)
-
- o1 = Object.new
- o2 = Object.new
- def o1.<=>(x); -1; end
- def o2.<=>(x); 0; end
- class << o1; self; end.class_eval do
- define_method(:succ) { o2 }
- end
-
- r1 = (o1..o2)
- r2 = (o1...o2)
-
- a = []
- r1.each {|x| a << x }
- assert_equal([o1, o2], a)
-
- a = []
- r2.each {|x| a << x }
- assert_equal([o1], a)
-
- def o2.<=>(x); 1; end
-
- a = []
- r1.each {|x| a << x }
- assert_equal([o1], a)
-
- def o2.<=>(x); nil; end
-
- a = []
- r1.each {|x| a << x }
- assert_equal([o1], a)
-
- def o1.<=>(x); nil; end
-
- a = []
- r2.each {|x| a << x }
- assert_equal([], a)
- end
-
- def test_begin_end
- assert_equal(0, (0..1).begin)
- assert_equal(1, (0..1).end)
- end
-
- def test_first_last
- assert_equal([0, 1, 2], (0..10).first(3))
- assert_equal([8, 9, 10], (0..10).last(3))
- end
-
- def test_to_s
- assert_equal("0..1", (0..1).to_s)
- assert_equal("0...1", (0...1).to_s)
- end
-
- def test_inspect
- assert_equal("0..1", (0..1).inspect)
- assert_equal("0...1", (0...1).inspect)
- end
-
- def test_eqq
- assert((0..10) === 5)
- assert(!((0..10) === 11))
- end
-
- def test_include
- assert(("a".."z").include?("c"))
- assert(!(("a".."z").include?("5")))
- assert(("a"..."z").include?("y"))
- assert(!(("a"..."z").include?("z")))
- assert(!(("a".."z").include?("cc")))
- assert((0...10).include?(5))
- end
-
- def test_cover
- assert(("a".."z").cover?("c"))
- assert(!(("a".."z").cover?("5")))
- assert(("a"..."z").cover?("y"))
- assert(!(("a"..."z").cover?("z")))
- assert(("a".."z").cover?("cc"))
- end
-
- def test_beg_len
- o = Object.new
- assert_raise(TypeError) { [][o] }
- def o.begin; -10; end
- assert_raise(TypeError) { [][o] }
- def o.end; 0; end
- assert_raise(NoMethodError) { [][o] }
- def o.exclude_end?; false; end
- assert_nil([0][o])
- assert_raise(RangeError) { [0][o] = 1 }
- def o.begin; 10; end
- def o.end; 10; end
- assert_nil([0][o])
- def o.begin; 0; end
- assert_equal([0], [0][o])
- def o.begin; 2; end
- def o.end; 0; end
- assert_equal([], [0, 1, 2][o])
- end
-
- class CyclicRange < Range
- def <=>(other); true; end
- end
- def test_cyclic_range_inspect
- o = CyclicRange.allocate
- o.instance_eval { initialize(o, 1) }
- assert_equal("(... .. ...)..1", o.inspect)
- end
end
diff --git a/test/ruby/test_rational.rb b/test/ruby/test_rational.rb
deleted file mode 100644
index 85545fea6b..0000000000
--- a/test/ruby/test_rational.rb
+++ /dev/null
@@ -1,1029 +0,0 @@
-require 'test/unit'
-
-class RationalSub < Rational; end
-
-class Rational_Test < Test::Unit::TestCase
-
- def setup
- @complex = defined?(Complex)
- if @complex
- @keiju = Complex.instance_variable_get('@RCS_ID')
- end
- @unify = $".grep(/mathn/).size != 0
- end
-
- def test_ratsub
- c = RationalSub.__send__(:convert, 1)
-
- assert_kind_of(Numeric, c)
-
- if @unify
- assert_instance_of(Fixnum, c)
- else
- assert_instance_of(RationalSub, c)
-
- c2 = c + 1
- assert_instance_of(RationalSub, c2)
- c2 = c - 1
- assert_instance_of(RationalSub, c2)
-
- c3 = c - c2
- assert_instance_of(RationalSub, c3)
-
- s = Marshal.dump(c)
- c5 = Marshal.load(s)
- assert_equal(c, c5)
- assert_instance_of(RationalSub, c5)
- end
- end
-
- def test_eql_p
- c = Rational(0)
- c2 = Rational(0)
- c3 = Rational(1)
-
- assert_equal(true, c.eql?(c2))
- assert_equal(false, c.eql?(c3))
-
- if @unify
- assert_equal(true, c.eql?(0))
- else
- assert_equal(false, c.eql?(0))
- end
- end
-
- def test_hash
- assert_instance_of(Fixnum, Rational(1,2).hash)
-
- h = {}
- h[Rational(0)] = 0
- h[Rational(1,1)] = 1
- h[Rational(2,1)] = 2
- h[Rational(3,1)] = 3
-
- assert_equal(4, h.size)
- assert_equal(2, h[Rational(2,1)])
-
- h[Rational(0,1)] = 9
- assert_equal(4, h.size)
- end
-
- def test_freeze
- c = Rational(1)
- c.freeze
- unless @unify
- assert_equal(true, c.frozen?)
- end
- assert_instance_of(String, c.to_s)
- end
-
- def test_conv
- c = Rational(0,1)
- assert_equal(Rational(0,1), c)
-
- c = Rational(2**32, 2**32)
- assert_equal(Rational(2**32,2**32), c)
- assert_equal([1,1], [c.numerator,c.denominator])
-
- c = Rational(-2**32, 2**32)
- assert_equal(Rational(-2**32,2**32), c)
- assert_equal([-1,1], [c.numerator,c.denominator])
-
- c = Rational(2**32, -2**32)
- assert_equal(Rational(2**32,-2**32), c)
- assert_equal([-1,1], [c.numerator,c.denominator])
-
- c = Rational(-2**32, -2**32)
- assert_equal(Rational(-2**32,-2**32), c)
- assert_equal([1,1], [c.numerator,c.denominator])
-
- c = Rational(Rational(1,2),2)
- assert_equal(Rational(1,4), c)
-
- c = Rational(2,Rational(1,2))
- assert_equal(Rational(4), c)
-
- c = Rational(Rational(1,2),Rational(1,2))
- assert_equal(Rational(1), c)
-
- if @complex && !@keiju
- c = Rational(Complex(1,2),2)
- assert_equal(Complex(Rational(1,2),1), c)
-
- c = Rational(2,Complex(1,2))
- assert_equal(Complex(Rational(2,5),Rational(-4,5)), c)
-
- c = Rational(Complex(1,2),Complex(1,2))
- assert_equal(Rational(1), c)
- end
-
- assert_equal(Rational(3),Rational(3))
- assert_equal(Rational(1),Rational(3,3))
- assert_equal(3.3.to_r,Rational(3.3))
- assert_equal(1,Rational(3.3,3.3))
- assert_equal(Rational(3),Rational('3'))
- assert_equal(Rational(1),Rational('3.0','3.0'))
- assert_equal(Rational(1),Rational('3/3','3/3'))
- assert_raise(TypeError){Rational(nil)}
- assert_raise(ArgumentError){Rational('')}
- assert_raise(TypeError){Rational(Object.new)}
- assert_raise(ArgumentError){Rational()}
- assert_raise(ArgumentError){Rational(1,2,3)}
-
- if (0.0/0).nan?
- assert_raise(FloatDomainError){Rational(0.0/0)}
- end
- if (1.0/0).infinite?
- assert_raise(FloatDomainError){Rational(1.0/0)}
- end
- end
-
- def test_attr
- c = Rational(4)
-
- assert_equal(4, c.numerator)
- assert_equal(1, c.denominator)
-
- c = Rational(4,5)
-
- assert_equal(4, c.numerator)
- assert_equal(5, c.denominator)
-
- c = Rational(4)
-
- assert_equal(4, c.numerator)
- assert_equal(1, c.denominator)
-
- c = Rational(4,5)
-
- assert_equal(4, c.numerator)
- assert_equal(5, c.denominator)
-
- c = Rational(4)
-
- assert_equal(4, c.numerator)
- assert_equal(1, c.denominator)
-
- c = Rational(4,5)
-
- assert_equal(4, c.numerator)
- assert_equal(5, c.denominator)
- end
-
- def test_attr2
- c = Rational(1)
-
- if @unify
-=begin
- assert_equal(true, c.finite?)
- assert_equal(false, c.infinite?)
- assert_equal(false, c.nan?)
- assert_equal(true, c.integer?)
- assert_equal(false, c.float?)
- assert_equal(true, c.rational?)
-=end
- assert_equal(true, c.real?)
-=begin
- assert_equal(false, c.complex?)
- assert_equal(true, c.exact?)
- assert_equal(false, c.inexact?)
-=end
- else
-=begin
- assert_equal(true, c.finite?)
- assert_equal(false, c.infinite?)
- assert_equal(false, c.nan?)
- assert_equal(false, c.integer?)
- assert_equal(false, c.float?)
- assert_equal(true, c.rational?)
-=end
- assert_equal(true, c.real?)
-=begin
- assert_equal(false, c.complex?)
- assert_equal(true, c.exact?)
- assert_equal(false, c.inexact?)
-=end
- end
-
-=begin
- assert_equal(true, Rational(0).positive?)
- assert_equal(true, Rational(1).positive?)
- assert_equal(false, Rational(-1).positive?)
- assert_equal(false, Rational(0).negative?)
- assert_equal(false, Rational(1).negative?)
- assert_equal(true, Rational(-1).negative?)
-
- assert_equal(0, Rational(0).sign)
- assert_equal(1, Rational(2).sign)
- assert_equal(-1, Rational(-2).sign)
-=end
-
- assert_equal(true, Rational(0).zero?)
- assert_equal(true, Rational(0,1).zero?)
- assert_equal(false, Rational(1,1).zero?)
-
- assert_equal(nil, Rational(0).nonzero?)
- assert_equal(nil, Rational(0,1).nonzero?)
- assert_equal(Rational(1,1), Rational(1,1).nonzero?)
- end
-
- def test_uplus
- assert_equal(Rational(1), +Rational(1))
- assert_equal(Rational(-1), +Rational(-1))
- assert_equal(Rational(1,1), +Rational(1,1))
- assert_equal(Rational(-1,1), +Rational(-1,1))
- assert_equal(Rational(-1,1), +Rational(1,-1))
- assert_equal(Rational(1,1), +Rational(-1,-1))
- end
-
- def test_negate
- assert_equal(Rational(-1), -Rational(1))
- assert_equal(Rational(1), -Rational(-1))
- assert_equal(Rational(-1,1), -Rational(1,1))
- assert_equal(Rational(1,1), -Rational(-1,1))
- assert_equal(Rational(1,1), -Rational(1,-1))
- assert_equal(Rational(-1,1), -Rational(-1,-1))
-
-=begin
- assert_equal(0, Rational(0).negate)
- assert_equal(-2, Rational(2).negate)
- assert_equal(2, Rational(-2).negate)
-=end
- end
-
- def test_add
- c = Rational(1,2)
- c2 = Rational(2,3)
-
- assert_equal(Rational(7,6), c + c2)
-
- assert_equal(Rational(5,2), c + 2)
- assert_equal(2.5, c + 2.0)
- end
-
- def test_sub
- c = Rational(1,2)
- c2 = Rational(2,3)
-
- assert_equal(Rational(-1,6), c - c2)
-
- assert_equal(Rational(-3,2), c - 2)
- assert_equal(-1.5, c - 2.0)
- end
-
- def test_mul
- c = Rational(1,2)
- c2 = Rational(2,3)
-
- assert_equal(Rational(1,3), c * c2)
-
- assert_equal(Rational(1,1), c * 2)
- assert_equal(1.0, c * 2.0)
- end
-
- def test_div
- c = Rational(1,2)
- c2 = Rational(2,3)
-
- assert_equal(Rational(3,4), c / c2)
-
- assert_equal(Rational(1,4), c / 2)
- assert_equal(0.25, c / 2.0)
-
- assert_raise(ZeroDivisionError){Rational(1, 3) / 0}
- assert_raise(ZeroDivisionError){Rational(1, 3) / Rational(0)}
- end
-
- def assert_eql(exp, act, *args)
- unless Array === exp
- exp = [exp]
- end
- unless Array === act
- act = [act]
- end
- exp.zip(act).each do |e, a|
- na = [e, a] + args
- assert_equal(*na)
- na = [e.class, a] + args
- assert_instance_of(*na)
- end
- end
-
- def test_idiv
- c = Rational(1,2)
- c2 = Rational(2,3)
-
- assert_eql(0, c.div(c2))
- assert_eql(0, c.div(2))
- assert_eql(0, c.div(2.0))
-
- c = Rational(301,100)
- c2 = Rational(7,5)
-
- assert_equal(2, c.div(c2))
- assert_equal(-3, c.div(-c2))
- assert_equal(-3, (-c).div(c2))
- assert_equal(2, (-c).div(-c2))
-
- c = Rational(301,100)
- c2 = Rational(2)
-
- assert_equal(1, c.div(c2))
- assert_equal(-2, c.div(-c2))
- assert_equal(-2, (-c).div(c2))
- assert_equal(1, (-c).div(-c2))
-
- unless @unify
- c = Rational(11)
- c2 = Rational(3)
-
- assert_equal(3, c.div(c2))
- assert_equal(-4, c.div(-c2))
- assert_equal(-4, (-c).div(c2))
- assert_equal(3, (-c).div(-c2))
- end
- end
-
- def test_modulo
- c = Rational(1,2)
- c2 = Rational(2,3)
-
- assert_eql(Rational(1,2), c.modulo(c2))
- assert_eql(Rational(1,2), c.modulo(2))
- assert_eql(0.5, c.modulo(2.0))
-
- c = Rational(301,100)
- c2 = Rational(7,5)
-
- assert_equal(Rational(21,100), c.modulo(c2))
- assert_equal(Rational(-119,100), c.modulo(-c2))
- assert_equal(Rational(119,100), (-c).modulo(c2))
- assert_equal(Rational(-21,100), (-c).modulo(-c2))
-
- c = Rational(301,100)
- c2 = Rational(2)
-
- assert_equal(Rational(101,100), c.modulo(c2))
- assert_equal(Rational(-99,100), c.modulo(-c2))
- assert_equal(Rational(99,100), (-c).modulo(c2))
- assert_equal(Rational(-101,100), (-c).modulo(-c2))
-
- unless @unify
- c = Rational(11)
- c2 = Rational(3)
-
- assert_equal(2, c.modulo(c2))
- assert_equal(-1, c.modulo(-c2))
- assert_equal(1, (-c).modulo(c2))
- assert_equal(-2, (-c).modulo(-c2))
- end
- end
-
- def test_divmod
- c = Rational(1,2)
- c2 = Rational(2,3)
-
- assert_eql([0, Rational(1,2)], c.divmod(c2))
- assert_eql([0, Rational(1,2)], c.divmod(2))
- assert_eql([0, 0.5], c.divmod(2.0))
-
- c = Rational(301,100)
- c2 = Rational(7,5)
-
- assert_equal([2, Rational(21,100)], c.divmod(c2))
- assert_equal([-3, Rational(-119,100)], c.divmod(-c2))
- assert_equal([-3, Rational(119,100)], (-c).divmod(c2))
- assert_equal([2, Rational(-21,100)], (-c).divmod(-c2))
-
- c = Rational(301,100)
- c2 = Rational(2)
-
- assert_equal([1, Rational(101,100)], c.divmod(c2))
- assert_equal([-2, Rational(-99,100)], c.divmod(-c2))
- assert_equal([-2, Rational(99,100)], (-c).divmod(c2))
- assert_equal([1, Rational(-101,100)], (-c).divmod(-c2))
-
- unless @unify
- c = Rational(11)
- c2 = Rational(3)
-
- assert_equal([3,2], c.divmod(c2))
- assert_equal([-4,-1], c.divmod(-c2))
- assert_equal([-4,1], (-c).divmod(c2))
- assert_equal([3,-2], (-c).divmod(-c2))
- end
- end
-
-=begin
- def test_quot
- c = Rational(1,2)
- c2 = Rational(2,3)
-
- assert_eql(0, c.quot(c2))
- assert_eql(0, c.quot(2))
- assert_eql(0, c.quot(2.0))
-
- c = Rational(301,100)
- c2 = Rational(7,5)
-
- assert_equal(2, c.quot(c2))
- assert_equal(-2, c.quot(-c2))
- assert_equal(-2, (-c).quot(c2))
- assert_equal(2, (-c).quot(-c2))
-
- c = Rational(301,100)
- c2 = Rational(2)
-
- assert_equal(1, c.quot(c2))
- assert_equal(-1, c.quot(-c2))
- assert_equal(-1, (-c).quot(c2))
- assert_equal(1, (-c).quot(-c2))
-
- unless @unify
- c = Rational(11)
- c2 = Rational(3)
-
- assert_equal(3, c.quot(c2))
- assert_equal(-3, c.quot(-c2))
- assert_equal(-3, (-c).quot(c2))
- assert_equal(3, (-c).quot(-c2))
- end
- end
-=end
-
- def test_remainder
- c = Rational(1,2)
- c2 = Rational(2,3)
-
- assert_eql(Rational(1,2), c.remainder(c2))
- assert_eql(Rational(1,2), c.remainder(2))
- assert_eql(0.5, c.remainder(2.0))
-
- c = Rational(301,100)
- c2 = Rational(7,5)
-
- assert_equal(Rational(21,100), c.remainder(c2))
- assert_equal(Rational(21,100), c.remainder(-c2))
- assert_equal(Rational(-21,100), (-c).remainder(c2))
- assert_equal(Rational(-21,100), (-c).remainder(-c2))
-
- c = Rational(301,100)
- c2 = Rational(2)
-
- assert_equal(Rational(101,100), c.remainder(c2))
- assert_equal(Rational(101,100), c.remainder(-c2))
- assert_equal(Rational(-101,100), (-c).remainder(c2))
- assert_equal(Rational(-101,100), (-c).remainder(-c2))
-
- unless @unify
- c = Rational(11)
- c2 = Rational(3)
-
- assert_equal(2, c.remainder(c2))
- assert_equal(2, c.remainder(-c2))
- assert_equal(-2, (-c).remainder(c2))
- assert_equal(-2, (-c).remainder(-c2))
- end
- end
-
-=begin
- def test_quotrem
- c = Rational(1,2)
- c2 = Rational(2,3)
-
- assert_eql([0, Rational(1,2)], c.quotrem(c2))
- assert_eql([0, Rational(1,2)], c.quotrem(2))
- assert_eql([0, 0.5], c.quotrem(2.0))
-
- c = Rational(301,100)
- c2 = Rational(7,5)
-
- assert_equal([2, Rational(21,100)], c.quotrem(c2))
- assert_equal([-2, Rational(21,100)], c.quotrem(-c2))
- assert_equal([-2, Rational(-21,100)], (-c).quotrem(c2))
- assert_equal([2, Rational(-21,100)], (-c).quotrem(-c2))
-
- c = Rational(301,100)
- c2 = Rational(2)
-
- assert_equal([1, Rational(101,100)], c.quotrem(c2))
- assert_equal([-1, Rational(101,100)], c.quotrem(-c2))
- assert_equal([-1, Rational(-101,100)], (-c).quotrem(c2))
- assert_equal([1, Rational(-101,100)], (-c).quotrem(-c2))
-
- unless @unify
- c = Rational(11)
- c2 = Rational(3)
-
- assert_equal([3,2], c.quotrem(c2))
- assert_equal([-3,2], c.quotrem(-c2))
- assert_equal([-3,-2], (-c).quotrem(c2))
- assert_equal([3,-2], (-c).quotrem(-c2))
- end
- end
-=end
-
- def test_quo
- c = Rational(1,2)
- c2 = Rational(2,3)
-
- assert_equal(Rational(3,4), c.quo(c2))
-
- assert_equal(Rational(1,4), c.quo(2))
- assert_equal(0.25, c.quo(2.0))
- end
-
- def test_fdiv
- c = Rational(1,2)
- c2 = Rational(2,3)
-
- assert_equal(0.75, c.fdiv(c2))
-
- assert_equal(0.25, c.fdiv(2))
- assert_equal(0.25, c.fdiv(2.0))
- end
-
- def test_expt
- c = Rational(1,2)
- c2 = Rational(2,3)
-
- r = c ** c2
- assert_in_delta(0.6299, r, 0.001)
-
- assert_equal(Rational(1,4), c ** 2)
- assert_equal(Rational(4), c ** -2)
- assert_equal(Rational(1,4), (-c) ** 2)
- assert_equal(Rational(4), (-c) ** -2)
-
- assert_equal(0.25, c ** 2.0)
- assert_equal(4.0, c ** -2.0)
-
- assert_equal(Rational(1,4), c ** Rational(2))
- assert_equal(Rational(4), c ** Rational(-2))
-
- assert_equal(Rational(1), 0 ** Rational(0))
- assert_equal(Rational(1), Rational(0) ** 0)
- assert_equal(Rational(1), Rational(0) ** Rational(0))
-
- # p ** p
- x = 2 ** Rational(2)
- assert_equal(Rational(4), x)
- unless @unify
- assert_instance_of(Rational, x)
- end
- assert_equal(4, x.numerator)
- assert_equal(1, x.denominator)
-
- x = Rational(2) ** 2
- assert_equal(Rational(4), x)
- unless @unify
- assert_instance_of(Rational, x)
- end
- assert_equal(4, x.numerator)
- assert_equal(1, x.denominator)
-
- x = Rational(2) ** Rational(2)
- assert_equal(Rational(4), x)
- unless @unify
- assert_instance_of(Rational, x)
- end
- assert_equal(4, x.numerator)
- assert_equal(1, x.denominator)
-
- # -p ** p
- x = (-2) ** Rational(2)
- assert_equal(Rational(4), x)
- unless @unify
- assert_instance_of(Rational, x)
- end
- assert_equal(4, x.numerator)
- assert_equal(1, x.denominator)
-
- x = Rational(-2) ** 2
- assert_equal(Rational(4), x)
- unless @unify
- assert_instance_of(Rational, x)
- end
- assert_equal(4, x.numerator)
- assert_equal(1, x.denominator)
-
- x = Rational(-2) ** Rational(2)
- assert_equal(Rational(4), x)
- unless @unify
- assert_instance_of(Rational, x)
- end
- assert_equal(4, x.numerator)
- assert_equal(1, x.denominator)
-
- # p ** -p
- x = 2 ** Rational(-2)
- assert_equal(Rational(1,4), x)
- assert_instance_of(Rational, x)
- assert_equal(1, x.numerator)
- assert_equal(4, x.denominator)
-
- x = Rational(2) ** -2
- assert_equal(Rational(1,4), x)
- assert_instance_of(Rational, x)
- assert_equal(1, x.numerator)
- assert_equal(4, x.denominator)
-
- x = Rational(2) ** Rational(-2)
- assert_equal(Rational(1,4), x)
- assert_instance_of(Rational, x)
- assert_equal(1, x.numerator)
- assert_equal(4, x.denominator)
-
- # -p ** -p
- x = (-2) ** Rational(-2)
- assert_equal(Rational(1,4), x)
- assert_instance_of(Rational, x)
- assert_equal(1, x.numerator)
- assert_equal(4, x.denominator)
-
- x = Rational(-2) ** -2
- assert_equal(Rational(1,4), x)
- assert_instance_of(Rational, x)
- assert_equal(1, x.numerator)
- assert_equal(4, x.denominator)
-
- x = Rational(-2) ** Rational(-2)
- assert_equal(Rational(1,4), x)
- assert_instance_of(Rational, x)
- assert_equal(1, x.numerator)
- assert_equal(4, x.denominator)
-
- unless @unify # maybe bug mathn
- assert_raise(ZeroDivisionError){0 ** -1}
- end
- end
-
- def test_cmp
- assert_equal(-1, Rational(-1) <=> Rational(0))
- assert_equal(0, Rational(0) <=> Rational(0))
- assert_equal(+1, Rational(+1) <=> Rational(0))
-
- assert_equal(-1, Rational(-1) <=> 0)
- assert_equal(0, Rational(0) <=> 0)
- assert_equal(+1, Rational(+1) <=> 0)
-
- assert_equal(-1, Rational(-1) <=> 0.0)
- assert_equal(0, Rational(0) <=> 0.0)
- assert_equal(+1, Rational(+1) <=> 0.0)
-
- assert_equal(-1, Rational(1,2) <=> Rational(2,3))
- assert_equal(0, Rational(2,3) <=> Rational(2,3))
- assert_equal(+1, Rational(2,3) <=> Rational(1,2))
-
- f = 2**30-1
- b = 2**30
-
- assert_equal(0, Rational(f) <=> Rational(f))
- assert_equal(-1, Rational(f) <=> Rational(b))
- assert_equal(+1, Rational(b) <=> Rational(f))
- assert_equal(0, Rational(b) <=> Rational(b))
-
- assert_equal(-1, Rational(f-1) <=> Rational(f))
- assert_equal(+1, Rational(f) <=> Rational(f-1))
- assert_equal(-1, Rational(b-1) <=> Rational(b))
- assert_equal(+1, Rational(b) <=> Rational(b-1))
-
- assert_equal(false, Rational(0) < Rational(0))
- assert_equal(true, Rational(0) <= Rational(0))
- assert_equal(true, Rational(0) >= Rational(0))
- assert_equal(false, Rational(0) > Rational(0))
-
- assert_equal(nil, Rational(0) <=> nil)
- assert_equal(nil, Rational(0) <=> 'foo')
- end
-
- def test_eqeq
- assert(Rational(1,1) == Rational(1))
- assert(Rational(-1,1) == Rational(-1))
-
- assert_equal(false, Rational(2,1) == Rational(1))
- assert_equal(true, Rational(2,1) != Rational(1))
- assert_equal(false, Rational(1) == nil)
- assert_equal(false, Rational(1) == '')
- end
-
- def test_coerce
- assert_equal([Rational(2),Rational(1)], Rational(1).coerce(2))
- assert_equal([Rational(2.2),Rational(1)], Rational(1).coerce(2.2))
- assert_equal([Rational(2),Rational(1)], Rational(1).coerce(Rational(2)))
- end
-
- def test_unify
- if @unify
- assert_instance_of(Fixnum, Rational(1,2) + Rational(1,2))
- assert_instance_of(Fixnum, Rational(1,2) - Rational(1,2))
- assert_instance_of(Fixnum, Rational(1,2) * 2)
- assert_instance_of(Fixnum, Rational(1,2) / Rational(1,2))
- assert_instance_of(Fixnum, Rational(1,2).div(Rational(1,2)))
- assert_instance_of(Fixnum, Rational(1,2).quo(Rational(1,2)))
- assert_instance_of(Fixnum, Rational(1,2) ** -2)
- end
- end
-
- def test_math
- assert_equal(Rational(1,2), Rational(1,2).abs)
- assert_equal(Rational(1,2), Rational(-1,2).abs)
- if @complex && !@keiju
- assert_equal(Rational(1,2), Rational(1,2).magnitude)
- assert_equal(Rational(1,2), Rational(-1,2).magnitude)
- end
-
- assert_equal(1, Rational(1,2).numerator)
- assert_equal(2, Rational(1,2).denominator)
- end
-
- def test_trunc
- [[Rational(13, 5), [ 2, 3, 2, 3]], # 2.6
- [Rational(5, 2), [ 2, 3, 2, 3]], # 2.5
- [Rational(12, 5), [ 2, 3, 2, 2]], # 2.4
- [Rational(-12,5), [-3, -2, -2, -2]], # -2.4
- [Rational(-5, 2), [-3, -2, -2, -3]], # -2.5
- [Rational(-13, 5), [-3, -2, -2, -3]], # -2.6
- ].each do |i, a|
- assert_equal(a[0], i.floor)
- assert_equal(a[1], i.ceil)
- assert_equal(a[2], i.truncate)
- assert_equal(a[3], i.round)
- end
- end
-
- def test_to_s
- c = Rational(1,2)
-
- assert_instance_of(String, c.to_s)
- assert_equal('1/2', c.to_s)
-
- if @unify
- assert_equal('0', Rational(0,2).to_s)
- assert_equal('0', Rational(0,-2).to_s)
- else
- assert_equal('0/1', Rational(0,2).to_s)
- assert_equal('0/1', Rational(0,-2).to_s)
- end
- assert_equal('1/2', Rational(1,2).to_s)
- assert_equal('-1/2', Rational(-1,2).to_s)
- assert_equal('1/2', Rational(-1,-2).to_s)
- assert_equal('-1/2', Rational(1,-2).to_s)
- assert_equal('1/2', Rational(-1,-2).to_s)
- end
-
- def test_inspect
- c = Rational(1,2)
-
- assert_instance_of(String, c.inspect)
- assert_equal('(1/2)', c.inspect)
- end
-
- def test_marshal
- c = Rational(1,2)
- c.instance_eval{@ivar = 9}
-
- s = Marshal.dump(c)
- c2 = Marshal.load(s)
- assert_equal(c, c2)
- assert_equal(9, c2.instance_variable_get(:@ivar))
- assert_instance_of(Rational, c2)
-
- assert_raise(ZeroDivisionError){
- Marshal.load("\x04\bU:\rRational[\ai\x06i\x05")
- }
- end
-
- def test_parse
- assert_equal(Rational(5), '5'.to_r)
- assert_equal(Rational(-5), '-5'.to_r)
- assert_equal(Rational(5,3), '5/3'.to_r)
- assert_equal(Rational(-5,3), '-5/3'.to_r)
-# assert_equal(Rational(5,-3), '5/-3'.to_r)
-# assert_equal(Rational(-5,-3), '-5/-3'.to_r)
-
- assert_equal(Rational(5), '5.0'.to_r)
- assert_equal(Rational(-5), '-5.0'.to_r)
- assert_equal(Rational(5,3), '5.0/3'.to_r)
- assert_equal(Rational(-5,3), '-5.0/3'.to_r)
-# assert_equal(Rational(5,-3), '5.0/-3'.to_r)
-# assert_equal(Rational(-5,-3), '-5.0/-3'.to_r)
-
- assert_equal(Rational(5), '5e0'.to_r)
- assert_equal(Rational(-5), '-5e0'.to_r)
- assert_equal(Rational(5,3), '5e0/3'.to_r)
- assert_equal(Rational(-5,3), '-5e0/3'.to_r)
-# assert_equal(Rational(5,-3), '5e0/-3'.to_r)
-# assert_equal(Rational(-5,-3), '-5e0/-3'.to_r)
-
- assert_equal(Rational(33,100), '.33'.to_r)
- assert_equal(Rational(33,100), '0.33'.to_r)
- assert_equal(Rational(-33,100), '-.33'.to_r)
- assert_equal(Rational(-33,100), '-0.33'.to_r)
- assert_equal(Rational(-33,100), '-0.3_3'.to_r)
-
- assert_equal(Rational(1,2), '5e-1'.to_r)
- assert_equal(Rational(50), '5e+1'.to_r)
- assert_equal(Rational(1,2), '5.0e-1'.to_r)
- assert_equal(Rational(50), '5.0e+1'.to_r)
- assert_equal(Rational(50), '5e1'.to_r)
- assert_equal(Rational(50), '5E1'.to_r)
- assert_equal(Rational(500), '5e2'.to_r)
- assert_equal(Rational(5000), '5e3'.to_r)
- assert_equal(Rational(500000000000), '5e1_1'.to_r)
-
- assert_equal(Rational(5), Rational('5'))
- assert_equal(Rational(-5), Rational('-5'))
- assert_equal(Rational(5,3), Rational('5/3'))
- assert_equal(Rational(-5,3), Rational('-5/3'))
-# assert_equal(Rational(5,-3), Rational('5/-3'))
-# assert_equal(Rational(-5,-3), Rational('-5/-3'))
-
- assert_equal(Rational(5), Rational('5.0'))
- assert_equal(Rational(-5), Rational('-5.0'))
- assert_equal(Rational(5,3), Rational('5.0/3'))
- assert_equal(Rational(-5,3), Rational('-5.0/3'))
-# assert_equal(Rational(5,-3), Rational('5.0/-3'))
-# assert_equal(Rational(-5,-3), Rational('-5.0/-3'))
-
- assert_equal(Rational(5), Rational('5e0'))
- assert_equal(Rational(-5), Rational('-5e0'))
- assert_equal(Rational(5,3), Rational('5e0/3'))
- assert_equal(Rational(-5,3), Rational('-5e0/3'))
-# assert_equal(Rational(5,-3), Rational('5e0/-3'))
-# assert_equal(Rational(-5,-3), Rational('-5e0/-3'))
-
- assert_equal(Rational(33,100), Rational('.33'))
- assert_equal(Rational(33,100), Rational('0.33'))
- assert_equal(Rational(-33,100), Rational('-.33'))
- assert_equal(Rational(-33,100), Rational('-0.33'))
- assert_equal(Rational(-33,100), Rational('-0.3_3'))
-
- assert_equal(Rational(1,2), Rational('5e-1'))
- assert_equal(Rational(50), Rational('5e+1'))
- assert_equal(Rational(1,2), Rational('5.0e-1'))
- assert_equal(Rational(50), Rational('5.0e+1'))
- assert_equal(Rational(50), Rational('5e1'))
- assert_equal(Rational(50), Rational('5E1'))
- assert_equal(Rational(500), Rational('5e2'))
- assert_equal(Rational(5000), Rational('5e3'))
- assert_equal(Rational(500000000000), Rational('5e1_1'))
-
- assert_equal(Rational(0), ''.to_r)
- assert_equal(Rational(0), ' '.to_r)
- assert_equal(Rational(5), "\f\n\r\t\v5\0".to_r)
- assert_equal(Rational(0), '_'.to_r)
- assert_equal(Rational(0), '_5'.to_r)
- assert_equal(Rational(5), '5_'.to_r)
- assert_equal(Rational(5), '5x'.to_r)
- assert_equal(Rational(5), '5/_3'.to_r)
- assert_equal(Rational(5,3), '5/3_'.to_r)
- assert_equal(Rational(5,3), '5/3.3'.to_r)
- assert_equal(Rational(5,3), '5/3x'.to_r)
- assert_raise(ArgumentError){ Rational('')}
- assert_raise(ArgumentError){ Rational('_')}
- assert_raise(ArgumentError){ Rational("\f\n\r\t\v5\0")}
- assert_raise(ArgumentError){ Rational('_5')}
- assert_raise(ArgumentError){ Rational('5_')}
- assert_raise(ArgumentError){ Rational('5x')}
- assert_raise(ArgumentError){ Rational('5/_3')}
- assert_raise(ArgumentError){ Rational('5/3_')}
- assert_raise(ArgumentError){ Rational('5/3.3')}
- assert_raise(ArgumentError){ Rational('5/3x')}
- end
-
-=begin
- def test_reciprocal
- assert_equal(Rational(1,9), Rational(9,1).reciprocal)
- assert_equal(Rational(9,1), Rational(1,9).reciprocal)
- assert_equal(Rational(-1,9), Rational(-9,1).reciprocal)
- assert_equal(Rational(-9,1), Rational(-1,9).reciprocal)
- assert_equal(Rational(1,9), Rational(9,1).inverse)
- assert_equal(Rational(9,1), Rational(1,9).inverse)
- assert_equal(Rational(-1,9), Rational(-9,1).inverse)
- assert_equal(Rational(-9,1), Rational(-1,9).inverse)
- end
-=end
-
- def test_to_i
- assert_equal(1, Rational(3,2).to_i)
- assert_equal(1, Integer(Rational(3,2)))
- end
-
- def test_to_f
- assert_equal(1.5, Rational(3,2).to_f)
- assert_equal(1.5, Float(Rational(3,2)))
- end
-
- def test_to_c
- if @complex && !@keiju
- if @unify
- assert_equal(Rational(3,2), Rational(3,2).to_c)
- assert_equal(Rational(3,2), Complex(Rational(3,2)))
- else
- assert_equal(Complex(Rational(3,2)), Rational(3,2).to_c)
- assert_equal(Complex(Rational(3,2)), Complex(Rational(3,2)))
- end
- end
- end
-
- def test_to_r
- c = nil.to_r
- assert_equal([0,1], [c.numerator, c.denominator])
-
- c = 0.to_r
- assert_equal([0,1], [c.numerator, c.denominator])
-
- c = 1.to_r
- assert_equal([1,1], [c.numerator, c.denominator])
-
- c = 1.1.to_r
- assert_equal([2476979795053773, 2251799813685248],
- [c.numerator, c.denominator])
-
- c = Rational(1,2).to_r
- assert_equal([1,2], [c.numerator, c.denominator])
-
- if @complex
- if @keiju
- assert_raise(NoMethodError){Complex(1,2).to_r}
- else
- assert_raise(RangeError){Complex(1,2).to_r}
- end
- end
-
- if (0.0/0).nan?
- assert_raise(FloatDomainError){(0.0/0).to_r}
- end
- if (1.0/0).infinite?
- assert_raise(FloatDomainError){(1.0/0).to_r}
- end
- end
-
- def test_gcdlcm
- assert_equal(7, 91.gcd(-49))
- assert_equal(5, 5.gcd(0))
- assert_equal(5, 0.gcd(5))
- assert_equal(70, 14.lcm(35))
- assert_equal(0, 5.lcm(0))
- assert_equal(0, 0.lcm(5))
- assert_equal([5,0], 0.gcdlcm(5))
- assert_equal([5,0], 5.gcdlcm(0))
-
- assert_equal(1, 1073741827.gcd(1073741789))
- assert_equal(1152921470247108503, 1073741827.lcm(1073741789))
-
- assert_equal(1, 1073741789.gcd(1073741827))
- assert_equal(1152921470247108503, 1073741789.lcm(1073741827))
- end
-
- def test_supp
- assert_equal(true, 1.real?)
- assert_equal(true, 1.1.real?)
-
- assert_equal(1, 1.numerator)
- assert_equal(9, 9.numerator)
- assert_equal(1, 1.denominator)
- assert_equal(1, 9.denominator)
-
- assert_equal(1.0, 1.0.numerator)
- assert_equal(9.0, 9.0.numerator)
- assert_equal(1.0, 1.0.denominator)
- assert_equal(1.0, 9.0.denominator)
-
-=begin
- assert_equal(Rational(1,9), 9.reciprocal)
- assert_in_delta(0.1111, 9.0.reciprocal, 0.001)
- assert_equal(Rational(1,9), 9.inverse)
- assert_in_delta(0.1111, 9.0.inverse, 0.001)
-=end
-
- assert_equal(Rational(1,2), 1.quo(2))
- assert_equal(Rational(5000000000), 10000000000.quo(2))
- assert_equal(0.5, 1.0.quo(2))
- assert_equal(Rational(1,4), Rational(1,2).quo(2))
-
- assert_equal(0.5, 1.fdiv(2))
- assert_equal(5000000000.0, 10000000000.fdiv(2))
- assert_equal(0.5, 1.0.fdiv(2))
- assert_equal(0.25, Rational(1,2).fdiv(2))
- end
-
- def test_ruby19
- assert_raise(NoMethodError){ Rational.new(1) }
- assert_raise(NoMethodError){ Rational.new!(1) }
- end
-
- def test_fixed_bug
- if @unify
- assert_instance_of(Fixnum, Rational(1,2) ** 0) # mathn's bug
- end
-
- n = Float::MAX.to_i * 2
- assert_equal(1.0, Rational(n + 2, n + 1).to_f, '[ruby-dev:33852]')
- end
-
- def test_known_bug
- end
-
-end
diff --git a/test/ruby/test_rational2.rb b/test/ruby/test_rational2.rb
deleted file mode 100644
index 3b6a985bc6..0000000000
--- a/test/ruby/test_rational2.rb
+++ /dev/null
@@ -1,1386 +0,0 @@
-require 'test/unit'
-
-class Rational_Test2 < Test::Unit::TestCase
-
- def test_kumi
- assert_equal(Rational(1, 1), +Rational(1, 1))
- assert_equal(Rational(-1, 1), -Rational(1, 1))
- assert_equal(Rational(2, 1),
- Rational(1, 1) + Rational(1, 1))
- assert_equal(Rational(0, 1),
- Rational(1, 1) - Rational(1, 1))
- assert_equal(Rational(1, 1),
- Rational(1, 1) * Rational(1, 1))
- assert_equal(Rational(1, 1),
- Rational(1, 1) / Rational(1, 1))
- assert_equal(Rational(3, 1),
- Rational(1, 1) + Rational(2, 1))
- assert_equal(Rational(-1, 1),
- Rational(1, 1) - Rational(2, 1))
- assert_equal(Rational(2, 1),
- Rational(1, 1) * Rational(2, 1))
- assert_equal(Rational(1, 2),
- Rational(1, 1) / Rational(2, 1))
- assert_equal(Rational(4, 1),
- Rational(1, 1) + Rational(3, 1))
- assert_equal(Rational(-2, 1),
- Rational(1, 1) - Rational(3, 1))
- assert_equal(Rational(3, 1),
- Rational(1, 1) * Rational(3, 1))
- assert_equal(Rational(1, 3),
- Rational(1, 1) / Rational(3, 1))
- assert_equal(Rational(1073741790, 1),
- Rational(1, 1) + Rational(1073741789, 1))
- assert_equal(Rational(-1073741788, 1),
- Rational(1, 1) - Rational(1073741789, 1))
- assert_equal(Rational(1073741789, 1),
- Rational(1, 1) * Rational(1073741789, 1))
- assert_equal(Rational(1, 1073741789),
- Rational(1, 1) / Rational(1073741789, 1))
- assert_equal(Rational(1073741828, 1),
- Rational(1, 1) + Rational(1073741827, 1))
- assert_equal(Rational(-1073741826, 1),
- Rational(1, 1) - Rational(1073741827, 1))
- assert_equal(Rational(1073741827, 1),
- Rational(1, 1) * Rational(1073741827, 1))
- assert_equal(Rational(1, 1073741827),
- Rational(1, 1) / Rational(1073741827, 1))
- assert_equal(Rational(5, 3),
- Rational(1, 1) + Rational(2, 3))
- assert_equal(Rational(1, 3),
- Rational(1, 1) - Rational(2, 3))
- assert_equal(Rational(2, 3),
- Rational(1, 1) * Rational(2, 3))
- assert_equal(Rational(3, 2),
- Rational(1, 1) / Rational(2, 3))
- assert_equal(Rational(5, 2),
- Rational(1, 1) + Rational(3, 2))
- assert_equal(Rational(-1, 2),
- Rational(1, 1) - Rational(3, 2))
- assert_equal(Rational(3, 2),
- Rational(1, 1) * Rational(3, 2))
- assert_equal(Rational(2, 3),
- Rational(1, 1) / Rational(3, 2))
- assert_equal(Rational(1073741792, 1073741789),
- Rational(1, 1) + Rational(3, 1073741789))
- assert_equal(Rational(1073741786, 1073741789),
- Rational(1, 1) - Rational(3, 1073741789))
- assert_equal(Rational(3, 1073741789),
- Rational(1, 1) * Rational(3, 1073741789))
- assert_equal(Rational(1073741789, 3),
- Rational(1, 1) / Rational(3, 1073741789))
- assert_equal(Rational(1073741792, 3),
- Rational(1, 1) + Rational(1073741789, 3))
- assert_equal(Rational(-1073741786, 3),
- Rational(1, 1) - Rational(1073741789, 3))
- assert_equal(Rational(1073741789, 3),
- Rational(1, 1) * Rational(1073741789, 3))
- assert_equal(Rational(3, 1073741789),
- Rational(1, 1) / Rational(1073741789, 3))
- assert_equal(Rational(1073741830, 1073741827),
- Rational(1, 1) + Rational(3, 1073741827))
- assert_equal(Rational(1073741824, 1073741827),
- Rational(1, 1) - Rational(3, 1073741827))
- assert_equal(Rational(3, 1073741827),
- Rational(1, 1) * Rational(3, 1073741827))
- assert_equal(Rational(1073741827, 3),
- Rational(1, 1) / Rational(3, 1073741827))
- assert_equal(Rational(1073741830, 3),
- Rational(1, 1) + Rational(1073741827, 3))
- assert_equal(Rational(-1073741824, 3),
- Rational(1, 1) - Rational(1073741827, 3))
- assert_equal(Rational(1073741827, 3),
- Rational(1, 1) * Rational(1073741827, 3))
- assert_equal(Rational(3, 1073741827),
- Rational(1, 1) / Rational(1073741827, 3))
- assert_equal(Rational(2147483616, 1073741827),
- Rational(1, 1) + Rational(1073741789, 1073741827))
- assert_equal(Rational(38, 1073741827),
- Rational(1, 1) - Rational(1073741789, 1073741827))
- assert_equal(Rational(1073741789, 1073741827),
- Rational(1, 1) * Rational(1073741789, 1073741827))
- assert_equal(Rational(1073741827, 1073741789),
- Rational(1, 1) / Rational(1073741789, 1073741827))
- assert_equal(Rational(2147483616, 1073741789),
- Rational(1, 1) + Rational(1073741827, 1073741789))
- assert_equal(Rational(-38, 1073741789),
- Rational(1, 1) - Rational(1073741827, 1073741789))
- assert_equal(Rational(1073741827, 1073741789),
- Rational(1, 1) * Rational(1073741827, 1073741789))
- assert_equal(Rational(1073741789, 1073741827),
- Rational(1, 1) / Rational(1073741827, 1073741789))
- assert_equal(Rational(2, 1), +Rational(2, 1))
- assert_equal(Rational(-2, 1), -Rational(2, 1))
- assert_equal(Rational(3, 1),
- Rational(2, 1) + Rational(1, 1))
- assert_equal(Rational(1, 1),
- Rational(2, 1) - Rational(1, 1))
- assert_equal(Rational(2, 1),
- Rational(2, 1) * Rational(1, 1))
- assert_equal(Rational(2, 1),
- Rational(2, 1) / Rational(1, 1))
- assert_equal(Rational(4, 1),
- Rational(2, 1) + Rational(2, 1))
- assert_equal(Rational(0, 1),
- Rational(2, 1) - Rational(2, 1))
- assert_equal(Rational(4, 1),
- Rational(2, 1) * Rational(2, 1))
- assert_equal(Rational(1, 1),
- Rational(2, 1) / Rational(2, 1))
- assert_equal(Rational(5, 1),
- Rational(2, 1) + Rational(3, 1))
- assert_equal(Rational(-1, 1),
- Rational(2, 1) - Rational(3, 1))
- assert_equal(Rational(6, 1),
- Rational(2, 1) * Rational(3, 1))
- assert_equal(Rational(2, 3),
- Rational(2, 1) / Rational(3, 1))
- assert_equal(Rational(1073741791, 1),
- Rational(2, 1) + Rational(1073741789, 1))
- assert_equal(Rational(-1073741787, 1),
- Rational(2, 1) - Rational(1073741789, 1))
- assert_equal(Rational(2147483578, 1),
- Rational(2, 1) * Rational(1073741789, 1))
- assert_equal(Rational(2, 1073741789),
- Rational(2, 1) / Rational(1073741789, 1))
- assert_equal(Rational(1073741829, 1),
- Rational(2, 1) + Rational(1073741827, 1))
- assert_equal(Rational(-1073741825, 1),
- Rational(2, 1) - Rational(1073741827, 1))
- assert_equal(Rational(2147483654, 1),
- Rational(2, 1) * Rational(1073741827, 1))
- assert_equal(Rational(2, 1073741827),
- Rational(2, 1) / Rational(1073741827, 1))
- assert_equal(Rational(8, 3),
- Rational(2, 1) + Rational(2, 3))
- assert_equal(Rational(4, 3),
- Rational(2, 1) - Rational(2, 3))
- assert_equal(Rational(4, 3),
- Rational(2, 1) * Rational(2, 3))
- assert_equal(Rational(3, 1),
- Rational(2, 1) / Rational(2, 3))
- assert_equal(Rational(7, 2),
- Rational(2, 1) + Rational(3, 2))
- assert_equal(Rational(1, 2),
- Rational(2, 1) - Rational(3, 2))
- assert_equal(Rational(3, 1),
- Rational(2, 1) * Rational(3, 2))
- assert_equal(Rational(4, 3),
- Rational(2, 1) / Rational(3, 2))
- assert_equal(Rational(2147483581, 1073741789),
- Rational(2, 1) + Rational(3, 1073741789))
- assert_equal(Rational(2147483575, 1073741789),
- Rational(2, 1) - Rational(3, 1073741789))
- assert_equal(Rational(6, 1073741789),
- Rational(2, 1) * Rational(3, 1073741789))
- assert_equal(Rational(2147483578, 3),
- Rational(2, 1) / Rational(3, 1073741789))
- assert_equal(Rational(1073741795, 3),
- Rational(2, 1) + Rational(1073741789, 3))
- assert_equal(Rational(-1073741783, 3),
- Rational(2, 1) - Rational(1073741789, 3))
- assert_equal(Rational(2147483578, 3),
- Rational(2, 1) * Rational(1073741789, 3))
- assert_equal(Rational(6, 1073741789),
- Rational(2, 1) / Rational(1073741789, 3))
- assert_equal(Rational(2147483657, 1073741827),
- Rational(2, 1) + Rational(3, 1073741827))
- assert_equal(Rational(2147483651, 1073741827),
- Rational(2, 1) - Rational(3, 1073741827))
- assert_equal(Rational(6, 1073741827),
- Rational(2, 1) * Rational(3, 1073741827))
- assert_equal(Rational(2147483654, 3),
- Rational(2, 1) / Rational(3, 1073741827))
- assert_equal(Rational(1073741833, 3),
- Rational(2, 1) + Rational(1073741827, 3))
- assert_equal(Rational(-1073741821, 3),
- Rational(2, 1) - Rational(1073741827, 3))
- assert_equal(Rational(2147483654, 3),
- Rational(2, 1) * Rational(1073741827, 3))
- assert_equal(Rational(6, 1073741827),
- Rational(2, 1) / Rational(1073741827, 3))
- assert_equal(Rational(3221225443, 1073741827),
- Rational(2, 1) + Rational(1073741789, 1073741827))
- assert_equal(Rational(1073741865, 1073741827),
- Rational(2, 1) - Rational(1073741789, 1073741827))
- assert_equal(Rational(2147483578, 1073741827),
- Rational(2, 1) * Rational(1073741789, 1073741827))
- assert_equal(Rational(2147483654, 1073741789),
- Rational(2, 1) / Rational(1073741789, 1073741827))
- assert_equal(Rational(3221225405, 1073741789),
- Rational(2, 1) + Rational(1073741827, 1073741789))
- assert_equal(Rational(1073741751, 1073741789),
- Rational(2, 1) - Rational(1073741827, 1073741789))
- assert_equal(Rational(2147483654, 1073741789),
- Rational(2, 1) * Rational(1073741827, 1073741789))
- assert_equal(Rational(2147483578, 1073741827),
- Rational(2, 1) / Rational(1073741827, 1073741789))
- assert_equal(Rational(3, 1), +Rational(3, 1))
- assert_equal(Rational(-3, 1), -Rational(3, 1))
- assert_equal(Rational(4, 1),
- Rational(3, 1) + Rational(1, 1))
- assert_equal(Rational(2, 1),
- Rational(3, 1) - Rational(1, 1))
- assert_equal(Rational(3, 1),
- Rational(3, 1) * Rational(1, 1))
- assert_equal(Rational(3, 1),
- Rational(3, 1) / Rational(1, 1))
- assert_equal(Rational(5, 1),
- Rational(3, 1) + Rational(2, 1))
- assert_equal(Rational(1, 1),
- Rational(3, 1) - Rational(2, 1))
- assert_equal(Rational(6, 1),
- Rational(3, 1) * Rational(2, 1))
- assert_equal(Rational(3, 2),
- Rational(3, 1) / Rational(2, 1))
- assert_equal(Rational(6, 1),
- Rational(3, 1) + Rational(3, 1))
- assert_equal(Rational(0, 1),
- Rational(3, 1) - Rational(3, 1))
- assert_equal(Rational(9, 1),
- Rational(3, 1) * Rational(3, 1))
- assert_equal(Rational(1, 1),
- Rational(3, 1) / Rational(3, 1))
- assert_equal(Rational(1073741792, 1),
- Rational(3, 1) + Rational(1073741789, 1))
- assert_equal(Rational(-1073741786, 1),
- Rational(3, 1) - Rational(1073741789, 1))
- assert_equal(Rational(3221225367, 1),
- Rational(3, 1) * Rational(1073741789, 1))
- assert_equal(Rational(3, 1073741789),
- Rational(3, 1) / Rational(1073741789, 1))
- assert_equal(Rational(1073741830, 1),
- Rational(3, 1) + Rational(1073741827, 1))
- assert_equal(Rational(-1073741824, 1),
- Rational(3, 1) - Rational(1073741827, 1))
- assert_equal(Rational(3221225481, 1),
- Rational(3, 1) * Rational(1073741827, 1))
- assert_equal(Rational(3, 1073741827),
- Rational(3, 1) / Rational(1073741827, 1))
- assert_equal(Rational(11, 3),
- Rational(3, 1) + Rational(2, 3))
- assert_equal(Rational(7, 3),
- Rational(3, 1) - Rational(2, 3))
- assert_equal(Rational(2, 1),
- Rational(3, 1) * Rational(2, 3))
- assert_equal(Rational(9, 2),
- Rational(3, 1) / Rational(2, 3))
- assert_equal(Rational(9, 2),
- Rational(3, 1) + Rational(3, 2))
- assert_equal(Rational(3, 2),
- Rational(3, 1) - Rational(3, 2))
- assert_equal(Rational(9, 2),
- Rational(3, 1) * Rational(3, 2))
- assert_equal(Rational(2, 1),
- Rational(3, 1) / Rational(3, 2))
- assert_equal(Rational(3221225370, 1073741789),
- Rational(3, 1) + Rational(3, 1073741789))
- assert_equal(Rational(3221225364, 1073741789),
- Rational(3, 1) - Rational(3, 1073741789))
- assert_equal(Rational(9, 1073741789),
- Rational(3, 1) * Rational(3, 1073741789))
- assert_equal(Rational(1073741789, 1),
- Rational(3, 1) / Rational(3, 1073741789))
- assert_equal(Rational(1073741798, 3),
- Rational(3, 1) + Rational(1073741789, 3))
- assert_equal(Rational(-1073741780, 3),
- Rational(3, 1) - Rational(1073741789, 3))
- assert_equal(Rational(1073741789, 1),
- Rational(3, 1) * Rational(1073741789, 3))
- assert_equal(Rational(9, 1073741789),
- Rational(3, 1) / Rational(1073741789, 3))
- assert_equal(Rational(3221225484, 1073741827),
- Rational(3, 1) + Rational(3, 1073741827))
- assert_equal(Rational(3221225478, 1073741827),
- Rational(3, 1) - Rational(3, 1073741827))
- assert_equal(Rational(9, 1073741827),
- Rational(3, 1) * Rational(3, 1073741827))
- assert_equal(Rational(1073741827, 1),
- Rational(3, 1) / Rational(3, 1073741827))
- assert_equal(Rational(1073741836, 3),
- Rational(3, 1) + Rational(1073741827, 3))
- assert_equal(Rational(-1073741818, 3),
- Rational(3, 1) - Rational(1073741827, 3))
- assert_equal(Rational(1073741827, 1),
- Rational(3, 1) * Rational(1073741827, 3))
- assert_equal(Rational(9, 1073741827),
- Rational(3, 1) / Rational(1073741827, 3))
- assert_equal(Rational(4294967270, 1073741827),
- Rational(3, 1) + Rational(1073741789, 1073741827))
- assert_equal(Rational(2147483692, 1073741827),
- Rational(3, 1) - Rational(1073741789, 1073741827))
- assert_equal(Rational(3221225367, 1073741827),
- Rational(3, 1) * Rational(1073741789, 1073741827))
- assert_equal(Rational(3221225481, 1073741789),
- Rational(3, 1) / Rational(1073741789, 1073741827))
- assert_equal(Rational(4294967194, 1073741789),
- Rational(3, 1) + Rational(1073741827, 1073741789))
- assert_equal(Rational(2147483540, 1073741789),
- Rational(3, 1) - Rational(1073741827, 1073741789))
- assert_equal(Rational(3221225481, 1073741789),
- Rational(3, 1) * Rational(1073741827, 1073741789))
- assert_equal(Rational(3221225367, 1073741827),
- Rational(3, 1) / Rational(1073741827, 1073741789))
- assert_equal(Rational(1073741789, 1), +Rational(1073741789, 1))
- assert_equal(Rational(-1073741789, 1), -Rational(1073741789, 1))
- assert_equal(Rational(1073741790, 1),
- Rational(1073741789, 1) + Rational(1, 1))
- assert_equal(Rational(1073741788, 1),
- Rational(1073741789, 1) - Rational(1, 1))
- assert_equal(Rational(1073741789, 1),
- Rational(1073741789, 1) * Rational(1, 1))
- assert_equal(Rational(1073741789, 1),
- Rational(1073741789, 1) / Rational(1, 1))
- assert_equal(Rational(1073741791, 1),
- Rational(1073741789, 1) + Rational(2, 1))
- assert_equal(Rational(1073741787, 1),
- Rational(1073741789, 1) - Rational(2, 1))
- assert_equal(Rational(2147483578, 1),
- Rational(1073741789, 1) * Rational(2, 1))
- assert_equal(Rational(1073741789, 2),
- Rational(1073741789, 1) / Rational(2, 1))
- assert_equal(Rational(1073741792, 1),
- Rational(1073741789, 1) + Rational(3, 1))
- assert_equal(Rational(1073741786, 1),
- Rational(1073741789, 1) - Rational(3, 1))
- assert_equal(Rational(3221225367, 1),
- Rational(1073741789, 1) * Rational(3, 1))
- assert_equal(Rational(1073741789, 3),
- Rational(1073741789, 1) / Rational(3, 1))
- assert_equal(Rational(2147483578, 1),
- Rational(1073741789, 1) + Rational(1073741789, 1))
- assert_equal(Rational(0, 1),
- Rational(1073741789, 1) - Rational(1073741789, 1))
- assert_equal(Rational(1152921429444920521, 1),
- Rational(1073741789, 1) * Rational(1073741789, 1))
- assert_equal(Rational(1, 1),
- Rational(1073741789, 1) / Rational(1073741789, 1))
- assert_equal(Rational(2147483616, 1),
- Rational(1073741789, 1) + Rational(1073741827, 1))
- assert_equal(Rational(-38, 1),
- Rational(1073741789, 1) - Rational(1073741827, 1))
- assert_equal(Rational(1152921470247108503, 1),
- Rational(1073741789, 1) * Rational(1073741827, 1))
- assert_equal(Rational(1073741789, 1073741827),
- Rational(1073741789, 1) / Rational(1073741827, 1))
- assert_equal(Rational(3221225369, 3),
- Rational(1073741789, 1) + Rational(2, 3))
- assert_equal(Rational(3221225365, 3),
- Rational(1073741789, 1) - Rational(2, 3))
- assert_equal(Rational(2147483578, 3),
- Rational(1073741789, 1) * Rational(2, 3))
- assert_equal(Rational(3221225367, 2),
- Rational(1073741789, 1) / Rational(2, 3))
- assert_equal(Rational(2147483581, 2),
- Rational(1073741789, 1) + Rational(3, 2))
- assert_equal(Rational(2147483575, 2),
- Rational(1073741789, 1) - Rational(3, 2))
- assert_equal(Rational(3221225367, 2),
- Rational(1073741789, 1) * Rational(3, 2))
- assert_equal(Rational(2147483578, 3),
- Rational(1073741789, 1) / Rational(3, 2))
- assert_equal(Rational(1152921429444920524, 1073741789),
- Rational(1073741789, 1) + Rational(3, 1073741789))
- assert_equal(Rational(1152921429444920518, 1073741789),
- Rational(1073741789, 1) - Rational(3, 1073741789))
- assert_equal(Rational(3, 1),
- Rational(1073741789, 1) * Rational(3, 1073741789))
- assert_equal(Rational(1152921429444920521, 3),
- Rational(1073741789, 1) / Rational(3, 1073741789))
- assert_equal(Rational(4294967156, 3),
- Rational(1073741789, 1) + Rational(1073741789, 3))
- assert_equal(Rational(2147483578, 3),
- Rational(1073741789, 1) - Rational(1073741789, 3))
- assert_equal(Rational(1152921429444920521, 3),
- Rational(1073741789, 1) * Rational(1073741789, 3))
- assert_equal(Rational(3, 1),
- Rational(1073741789, 1) / Rational(1073741789, 3))
- assert_equal(Rational(1152921470247108506, 1073741827),
- Rational(1073741789, 1) + Rational(3, 1073741827))
- assert_equal(Rational(1152921470247108500, 1073741827),
- Rational(1073741789, 1) - Rational(3, 1073741827))
- assert_equal(Rational(3221225367, 1073741827),
- Rational(1073741789, 1) * Rational(3, 1073741827))
- assert_equal(Rational(1152921470247108503, 3),
- Rational(1073741789, 1) / Rational(3, 1073741827))
- assert_equal(Rational(4294967194, 3),
- Rational(1073741789, 1) + Rational(1073741827, 3))
- assert_equal(Rational(2147483540, 3),
- Rational(1073741789, 1) - Rational(1073741827, 3))
- assert_equal(Rational(1152921470247108503, 3),
- Rational(1073741789, 1) * Rational(1073741827, 3))
- assert_equal(Rational(3221225367, 1073741827),
- Rational(1073741789, 1) / Rational(1073741827, 3))
- assert_equal(Rational(1152921471320850292, 1073741827),
- Rational(1073741789, 1) + Rational(1073741789, 1073741827))
- assert_equal(Rational(1152921469173366714, 1073741827),
- Rational(1073741789, 1) - Rational(1073741789, 1073741827))
- assert_equal(Rational(1152921429444920521, 1073741827),
- Rational(1073741789, 1) * Rational(1073741789, 1073741827))
- assert_equal(Rational(1073741827, 1),
- Rational(1073741789, 1) / Rational(1073741789, 1073741827))
- assert_equal(Rational(1152921430518662348, 1073741789),
- Rational(1073741789, 1) + Rational(1073741827, 1073741789))
- assert_equal(Rational(1152921428371178694, 1073741789),
- Rational(1073741789, 1) - Rational(1073741827, 1073741789))
- assert_equal(Rational(1073741827, 1),
- Rational(1073741789, 1) * Rational(1073741827, 1073741789))
- assert_equal(Rational(1152921429444920521, 1073741827),
- Rational(1073741789, 1) / Rational(1073741827, 1073741789))
- assert_equal(Rational(1073741827, 1), +Rational(1073741827, 1))
- assert_equal(Rational(-1073741827, 1), -Rational(1073741827, 1))
- assert_equal(Rational(1073741828, 1),
- Rational(1073741827, 1) + Rational(1, 1))
- assert_equal(Rational(1073741826, 1),
- Rational(1073741827, 1) - Rational(1, 1))
- assert_equal(Rational(1073741827, 1),
- Rational(1073741827, 1) * Rational(1, 1))
- assert_equal(Rational(1073741827, 1),
- Rational(1073741827, 1) / Rational(1, 1))
- assert_equal(Rational(1073741829, 1),
- Rational(1073741827, 1) + Rational(2, 1))
- assert_equal(Rational(1073741825, 1),
- Rational(1073741827, 1) - Rational(2, 1))
- assert_equal(Rational(2147483654, 1),
- Rational(1073741827, 1) * Rational(2, 1))
- assert_equal(Rational(1073741827, 2),
- Rational(1073741827, 1) / Rational(2, 1))
- assert_equal(Rational(1073741830, 1),
- Rational(1073741827, 1) + Rational(3, 1))
- assert_equal(Rational(1073741824, 1),
- Rational(1073741827, 1) - Rational(3, 1))
- assert_equal(Rational(3221225481, 1),
- Rational(1073741827, 1) * Rational(3, 1))
- assert_equal(Rational(1073741827, 3),
- Rational(1073741827, 1) / Rational(3, 1))
- assert_equal(Rational(2147483616, 1),
- Rational(1073741827, 1) + Rational(1073741789, 1))
- assert_equal(Rational(38, 1),
- Rational(1073741827, 1) - Rational(1073741789, 1))
- assert_equal(Rational(1152921470247108503, 1),
- Rational(1073741827, 1) * Rational(1073741789, 1))
- assert_equal(Rational(1073741827, 1073741789),
- Rational(1073741827, 1) / Rational(1073741789, 1))
- assert_equal(Rational(2147483654, 1),
- Rational(1073741827, 1) + Rational(1073741827, 1))
- assert_equal(Rational(0, 1),
- Rational(1073741827, 1) - Rational(1073741827, 1))
- assert_equal(Rational(1152921511049297929, 1),
- Rational(1073741827, 1) * Rational(1073741827, 1))
- assert_equal(Rational(1, 1),
- Rational(1073741827, 1) / Rational(1073741827, 1))
- assert_equal(Rational(3221225483, 3),
- Rational(1073741827, 1) + Rational(2, 3))
- assert_equal(Rational(3221225479, 3),
- Rational(1073741827, 1) - Rational(2, 3))
- assert_equal(Rational(2147483654, 3),
- Rational(1073741827, 1) * Rational(2, 3))
- assert_equal(Rational(3221225481, 2),
- Rational(1073741827, 1) / Rational(2, 3))
- assert_equal(Rational(2147483657, 2),
- Rational(1073741827, 1) + Rational(3, 2))
- assert_equal(Rational(2147483651, 2),
- Rational(1073741827, 1) - Rational(3, 2))
- assert_equal(Rational(3221225481, 2),
- Rational(1073741827, 1) * Rational(3, 2))
- assert_equal(Rational(2147483654, 3),
- Rational(1073741827, 1) / Rational(3, 2))
- assert_equal(Rational(1152921470247108506, 1073741789),
- Rational(1073741827, 1) + Rational(3, 1073741789))
- assert_equal(Rational(1152921470247108500, 1073741789),
- Rational(1073741827, 1) - Rational(3, 1073741789))
- assert_equal(Rational(3221225481, 1073741789),
- Rational(1073741827, 1) * Rational(3, 1073741789))
- assert_equal(Rational(1152921470247108503, 3),
- Rational(1073741827, 1) / Rational(3, 1073741789))
- assert_equal(Rational(4294967270, 3),
- Rational(1073741827, 1) + Rational(1073741789, 3))
- assert_equal(Rational(2147483692, 3),
- Rational(1073741827, 1) - Rational(1073741789, 3))
- assert_equal(Rational(1152921470247108503, 3),
- Rational(1073741827, 1) * Rational(1073741789, 3))
- assert_equal(Rational(3221225481, 1073741789),
- Rational(1073741827, 1) / Rational(1073741789, 3))
- assert_equal(Rational(1152921511049297932, 1073741827),
- Rational(1073741827, 1) + Rational(3, 1073741827))
- assert_equal(Rational(1152921511049297926, 1073741827),
- Rational(1073741827, 1) - Rational(3, 1073741827))
- assert_equal(Rational(3, 1),
- Rational(1073741827, 1) * Rational(3, 1073741827))
- assert_equal(Rational(1152921511049297929, 3),
- Rational(1073741827, 1) / Rational(3, 1073741827))
- assert_equal(Rational(4294967308, 3),
- Rational(1073741827, 1) + Rational(1073741827, 3))
- assert_equal(Rational(2147483654, 3),
- Rational(1073741827, 1) - Rational(1073741827, 3))
- assert_equal(Rational(1152921511049297929, 3),
- Rational(1073741827, 1) * Rational(1073741827, 3))
- assert_equal(Rational(3, 1),
- Rational(1073741827, 1) / Rational(1073741827, 3))
- assert_equal(Rational(1152921512123039718, 1073741827),
- Rational(1073741827, 1) + Rational(1073741789, 1073741827))
- assert_equal(Rational(1152921509975556140, 1073741827),
- Rational(1073741827, 1) - Rational(1073741789, 1073741827))
- assert_equal(Rational(1073741789, 1),
- Rational(1073741827, 1) * Rational(1073741789, 1073741827))
- assert_equal(Rational(1152921511049297929, 1073741789),
- Rational(1073741827, 1) / Rational(1073741789, 1073741827))
- assert_equal(Rational(1152921471320850330, 1073741789),
- Rational(1073741827, 1) + Rational(1073741827, 1073741789))
- assert_equal(Rational(1152921469173366676, 1073741789),
- Rational(1073741827, 1) - Rational(1073741827, 1073741789))
- assert_equal(Rational(1152921511049297929, 1073741789),
- Rational(1073741827, 1) * Rational(1073741827, 1073741789))
- assert_equal(Rational(1073741789, 1),
- Rational(1073741827, 1) / Rational(1073741827, 1073741789))
- assert_equal(Rational(2, 3), +Rational(2, 3))
- assert_equal(Rational(-2, 3), -Rational(2, 3))
- assert_equal(Rational(5, 3),
- Rational(2, 3) + Rational(1, 1))
- assert_equal(Rational(-1, 3),
- Rational(2, 3) - Rational(1, 1))
- assert_equal(Rational(2, 3),
- Rational(2, 3) * Rational(1, 1))
- assert_equal(Rational(2, 3),
- Rational(2, 3) / Rational(1, 1))
- assert_equal(Rational(8, 3),
- Rational(2, 3) + Rational(2, 1))
- assert_equal(Rational(-4, 3),
- Rational(2, 3) - Rational(2, 1))
- assert_equal(Rational(4, 3),
- Rational(2, 3) * Rational(2, 1))
- assert_equal(Rational(1, 3),
- Rational(2, 3) / Rational(2, 1))
- assert_equal(Rational(11, 3),
- Rational(2, 3) + Rational(3, 1))
- assert_equal(Rational(-7, 3),
- Rational(2, 3) - Rational(3, 1))
- assert_equal(Rational(2, 1),
- Rational(2, 3) * Rational(3, 1))
- assert_equal(Rational(2, 9),
- Rational(2, 3) / Rational(3, 1))
- assert_equal(Rational(3221225369, 3),
- Rational(2, 3) + Rational(1073741789, 1))
- assert_equal(Rational(-3221225365, 3),
- Rational(2, 3) - Rational(1073741789, 1))
- assert_equal(Rational(2147483578, 3),
- Rational(2, 3) * Rational(1073741789, 1))
- assert_equal(Rational(2, 3221225367),
- Rational(2, 3) / Rational(1073741789, 1))
- assert_equal(Rational(3221225483, 3),
- Rational(2, 3) + Rational(1073741827, 1))
- assert_equal(Rational(-3221225479, 3),
- Rational(2, 3) - Rational(1073741827, 1))
- assert_equal(Rational(2147483654, 3),
- Rational(2, 3) * Rational(1073741827, 1))
- assert_equal(Rational(2, 3221225481),
- Rational(2, 3) / Rational(1073741827, 1))
- assert_equal(Rational(4, 3),
- Rational(2, 3) + Rational(2, 3))
- assert_equal(Rational(0, 1),
- Rational(2, 3) - Rational(2, 3))
- assert_equal(Rational(4, 9),
- Rational(2, 3) * Rational(2, 3))
- assert_equal(Rational(1, 1),
- Rational(2, 3) / Rational(2, 3))
- assert_equal(Rational(13, 6),
- Rational(2, 3) + Rational(3, 2))
- assert_equal(Rational(-5, 6),
- Rational(2, 3) - Rational(3, 2))
- assert_equal(Rational(1, 1),
- Rational(2, 3) * Rational(3, 2))
- assert_equal(Rational(4, 9),
- Rational(2, 3) / Rational(3, 2))
- assert_equal(Rational(2147483587, 3221225367),
- Rational(2, 3) + Rational(3, 1073741789))
- assert_equal(Rational(2147483569, 3221225367),
- Rational(2, 3) - Rational(3, 1073741789))
- assert_equal(Rational(2, 1073741789),
- Rational(2, 3) * Rational(3, 1073741789))
- assert_equal(Rational(2147483578, 9),
- Rational(2, 3) / Rational(3, 1073741789))
- assert_equal(Rational(1073741791, 3),
- Rational(2, 3) + Rational(1073741789, 3))
- assert_equal(Rational(-357913929, 1),
- Rational(2, 3) - Rational(1073741789, 3))
- assert_equal(Rational(2147483578, 9),
- Rational(2, 3) * Rational(1073741789, 3))
- assert_equal(Rational(2, 1073741789),
- Rational(2, 3) / Rational(1073741789, 3))
- assert_equal(Rational(2147483663, 3221225481),
- Rational(2, 3) + Rational(3, 1073741827))
- assert_equal(Rational(2147483645, 3221225481),
- Rational(2, 3) - Rational(3, 1073741827))
- assert_equal(Rational(2, 1073741827),
- Rational(2, 3) * Rational(3, 1073741827))
- assert_equal(Rational(2147483654, 9),
- Rational(2, 3) / Rational(3, 1073741827))
- assert_equal(Rational(357913943, 1),
- Rational(2, 3) + Rational(1073741827, 3))
- assert_equal(Rational(-1073741825, 3),
- Rational(2, 3) - Rational(1073741827, 3))
- assert_equal(Rational(2147483654, 9),
- Rational(2, 3) * Rational(1073741827, 3))
- assert_equal(Rational(2, 1073741827),
- Rational(2, 3) / Rational(1073741827, 3))
- assert_equal(Rational(5368709021, 3221225481),
- Rational(2, 3) + Rational(1073741789, 1073741827))
- assert_equal(Rational(-1073741713, 3221225481),
- Rational(2, 3) - Rational(1073741789, 1073741827))
- assert_equal(Rational(2147483578, 3221225481),
- Rational(2, 3) * Rational(1073741789, 1073741827))
- assert_equal(Rational(2147483654, 3221225367),
- Rational(2, 3) / Rational(1073741789, 1073741827))
- assert_equal(Rational(5368709059, 3221225367),
- Rational(2, 3) + Rational(1073741827, 1073741789))
- assert_equal(Rational(-1073741903, 3221225367),
- Rational(2, 3) - Rational(1073741827, 1073741789))
- assert_equal(Rational(2147483654, 3221225367),
- Rational(2, 3) * Rational(1073741827, 1073741789))
- assert_equal(Rational(2147483578, 3221225481),
- Rational(2, 3) / Rational(1073741827, 1073741789))
- assert_equal(Rational(3, 2), +Rational(3, 2))
- assert_equal(Rational(-3, 2), -Rational(3, 2))
- assert_equal(Rational(5, 2),
- Rational(3, 2) + Rational(1, 1))
- assert_equal(Rational(1, 2),
- Rational(3, 2) - Rational(1, 1))
- assert_equal(Rational(3, 2),
- Rational(3, 2) * Rational(1, 1))
- assert_equal(Rational(3, 2),
- Rational(3, 2) / Rational(1, 1))
- assert_equal(Rational(7, 2),
- Rational(3, 2) + Rational(2, 1))
- assert_equal(Rational(-1, 2),
- Rational(3, 2) - Rational(2, 1))
- assert_equal(Rational(3, 1),
- Rational(3, 2) * Rational(2, 1))
- assert_equal(Rational(3, 4),
- Rational(3, 2) / Rational(2, 1))
- assert_equal(Rational(9, 2),
- Rational(3, 2) + Rational(3, 1))
- assert_equal(Rational(-3, 2),
- Rational(3, 2) - Rational(3, 1))
- assert_equal(Rational(9, 2),
- Rational(3, 2) * Rational(3, 1))
- assert_equal(Rational(1, 2),
- Rational(3, 2) / Rational(3, 1))
- assert_equal(Rational(2147483581, 2),
- Rational(3, 2) + Rational(1073741789, 1))
- assert_equal(Rational(-2147483575, 2),
- Rational(3, 2) - Rational(1073741789, 1))
- assert_equal(Rational(3221225367, 2),
- Rational(3, 2) * Rational(1073741789, 1))
- assert_equal(Rational(3, 2147483578),
- Rational(3, 2) / Rational(1073741789, 1))
- assert_equal(Rational(2147483657, 2),
- Rational(3, 2) + Rational(1073741827, 1))
- assert_equal(Rational(-2147483651, 2),
- Rational(3, 2) - Rational(1073741827, 1))
- assert_equal(Rational(3221225481, 2),
- Rational(3, 2) * Rational(1073741827, 1))
- assert_equal(Rational(3, 2147483654),
- Rational(3, 2) / Rational(1073741827, 1))
- assert_equal(Rational(13, 6),
- Rational(3, 2) + Rational(2, 3))
- assert_equal(Rational(5, 6),
- Rational(3, 2) - Rational(2, 3))
- assert_equal(Rational(1, 1),
- Rational(3, 2) * Rational(2, 3))
- assert_equal(Rational(9, 4),
- Rational(3, 2) / Rational(2, 3))
- assert_equal(Rational(3, 1),
- Rational(3, 2) + Rational(3, 2))
- assert_equal(Rational(0, 1),
- Rational(3, 2) - Rational(3, 2))
- assert_equal(Rational(9, 4),
- Rational(3, 2) * Rational(3, 2))
- assert_equal(Rational(1, 1),
- Rational(3, 2) / Rational(3, 2))
- assert_equal(Rational(3221225373, 2147483578),
- Rational(3, 2) + Rational(3, 1073741789))
- assert_equal(Rational(3221225361, 2147483578),
- Rational(3, 2) - Rational(3, 1073741789))
- assert_equal(Rational(9, 2147483578),
- Rational(3, 2) * Rational(3, 1073741789))
- assert_equal(Rational(1073741789, 2),
- Rational(3, 2) / Rational(3, 1073741789))
- assert_equal(Rational(2147483587, 6),
- Rational(3, 2) + Rational(1073741789, 3))
- assert_equal(Rational(-2147483569, 6),
- Rational(3, 2) - Rational(1073741789, 3))
- assert_equal(Rational(1073741789, 2),
- Rational(3, 2) * Rational(1073741789, 3))
- assert_equal(Rational(9, 2147483578),
- Rational(3, 2) / Rational(1073741789, 3))
- assert_equal(Rational(3221225487, 2147483654),
- Rational(3, 2) + Rational(3, 1073741827))
- assert_equal(Rational(3221225475, 2147483654),
- Rational(3, 2) - Rational(3, 1073741827))
- assert_equal(Rational(9, 2147483654),
- Rational(3, 2) * Rational(3, 1073741827))
- assert_equal(Rational(1073741827, 2),
- Rational(3, 2) / Rational(3, 1073741827))
- assert_equal(Rational(2147483663, 6),
- Rational(3, 2) + Rational(1073741827, 3))
- assert_equal(Rational(-2147483645, 6),
- Rational(3, 2) - Rational(1073741827, 3))
- assert_equal(Rational(1073741827, 2),
- Rational(3, 2) * Rational(1073741827, 3))
- assert_equal(Rational(9, 2147483654),
- Rational(3, 2) / Rational(1073741827, 3))
- assert_equal(Rational(5368709059, 2147483654),
- Rational(3, 2) + Rational(1073741789, 1073741827))
- assert_equal(Rational(1073741903, 2147483654),
- Rational(3, 2) - Rational(1073741789, 1073741827))
- assert_equal(Rational(3221225367, 2147483654),
- Rational(3, 2) * Rational(1073741789, 1073741827))
- assert_equal(Rational(3221225481, 2147483578),
- Rational(3, 2) / Rational(1073741789, 1073741827))
- assert_equal(Rational(5368709021, 2147483578),
- Rational(3, 2) + Rational(1073741827, 1073741789))
- assert_equal(Rational(1073741713, 2147483578),
- Rational(3, 2) - Rational(1073741827, 1073741789))
- assert_equal(Rational(3221225481, 2147483578),
- Rational(3, 2) * Rational(1073741827, 1073741789))
- assert_equal(Rational(3221225367, 2147483654),
- Rational(3, 2) / Rational(1073741827, 1073741789))
- assert_equal(Rational(3, 1073741789), +Rational(3, 1073741789))
- assert_equal(Rational(-3, 1073741789), -Rational(3, 1073741789))
- assert_equal(Rational(1073741792, 1073741789),
- Rational(3, 1073741789) + Rational(1, 1))
- assert_equal(Rational(-1073741786, 1073741789),
- Rational(3, 1073741789) - Rational(1, 1))
- assert_equal(Rational(3, 1073741789),
- Rational(3, 1073741789) * Rational(1, 1))
- assert_equal(Rational(3, 1073741789),
- Rational(3, 1073741789) / Rational(1, 1))
- assert_equal(Rational(2147483581, 1073741789),
- Rational(3, 1073741789) + Rational(2, 1))
- assert_equal(Rational(-2147483575, 1073741789),
- Rational(3, 1073741789) - Rational(2, 1))
- assert_equal(Rational(6, 1073741789),
- Rational(3, 1073741789) * Rational(2, 1))
- assert_equal(Rational(3, 2147483578),
- Rational(3, 1073741789) / Rational(2, 1))
- assert_equal(Rational(3221225370, 1073741789),
- Rational(3, 1073741789) + Rational(3, 1))
- assert_equal(Rational(-3221225364, 1073741789),
- Rational(3, 1073741789) - Rational(3, 1))
- assert_equal(Rational(9, 1073741789),
- Rational(3, 1073741789) * Rational(3, 1))
- assert_equal(Rational(1, 1073741789),
- Rational(3, 1073741789) / Rational(3, 1))
- assert_equal(Rational(1152921429444920524, 1073741789),
- Rational(3, 1073741789) + Rational(1073741789, 1))
- assert_equal(Rational(-1152921429444920518, 1073741789),
- Rational(3, 1073741789) - Rational(1073741789, 1))
- assert_equal(Rational(3, 1),
- Rational(3, 1073741789) * Rational(1073741789, 1))
- assert_equal(Rational(3, 1152921429444920521),
- Rational(3, 1073741789) / Rational(1073741789, 1))
- assert_equal(Rational(1152921470247108506, 1073741789),
- Rational(3, 1073741789) + Rational(1073741827, 1))
- assert_equal(Rational(-1152921470247108500, 1073741789),
- Rational(3, 1073741789) - Rational(1073741827, 1))
- assert_equal(Rational(3221225481, 1073741789),
- Rational(3, 1073741789) * Rational(1073741827, 1))
- assert_equal(Rational(3, 1152921470247108503),
- Rational(3, 1073741789) / Rational(1073741827, 1))
- assert_equal(Rational(2147483587, 3221225367),
- Rational(3, 1073741789) + Rational(2, 3))
- assert_equal(Rational(-2147483569, 3221225367),
- Rational(3, 1073741789) - Rational(2, 3))
- assert_equal(Rational(2, 1073741789),
- Rational(3, 1073741789) * Rational(2, 3))
- assert_equal(Rational(9, 2147483578),
- Rational(3, 1073741789) / Rational(2, 3))
- assert_equal(Rational(3221225373, 2147483578),
- Rational(3, 1073741789) + Rational(3, 2))
- assert_equal(Rational(-3221225361, 2147483578),
- Rational(3, 1073741789) - Rational(3, 2))
- assert_equal(Rational(9, 2147483578),
- Rational(3, 1073741789) * Rational(3, 2))
- assert_equal(Rational(2, 1073741789),
- Rational(3, 1073741789) / Rational(3, 2))
- assert_equal(Rational(6, 1073741789),
- Rational(3, 1073741789) + Rational(3, 1073741789))
- assert_equal(Rational(0, 1),
- Rational(3, 1073741789) - Rational(3, 1073741789))
- assert_equal(Rational(9, 1152921429444920521),
- Rational(3, 1073741789) * Rational(3, 1073741789))
- assert_equal(Rational(1, 1),
- Rational(3, 1073741789) / Rational(3, 1073741789))
- assert_equal(Rational(1152921429444920530, 3221225367),
- Rational(3, 1073741789) + Rational(1073741789, 3))
- assert_equal(Rational(-1152921429444920512, 3221225367),
- Rational(3, 1073741789) - Rational(1073741789, 3))
- assert_equal(Rational(1, 1),
- Rational(3, 1073741789) * Rational(1073741789, 3))
- assert_equal(Rational(9, 1152921429444920521),
- Rational(3, 1073741789) / Rational(1073741789, 3))
- assert_equal(Rational(6442450848, 1152921470247108503),
- Rational(3, 1073741789) + Rational(3, 1073741827))
- assert_equal(Rational(114, 1152921470247108503),
- Rational(3, 1073741789) - Rational(3, 1073741827))
- assert_equal(Rational(9, 1152921470247108503),
- Rational(3, 1073741789) * Rational(3, 1073741827))
- assert_equal(Rational(1073741827, 1073741789),
- Rational(3, 1073741789) / Rational(3, 1073741827))
- assert_equal(Rational(1152921470247108512, 3221225367),
- Rational(3, 1073741789) + Rational(1073741827, 3))
- assert_equal(Rational(-1152921470247108494, 3221225367),
- Rational(3, 1073741789) - Rational(1073741827, 3))
- assert_equal(Rational(1073741827, 1073741789),
- Rational(3, 1073741789) * Rational(1073741827, 3))
- assert_equal(Rational(9, 1152921470247108503),
- Rational(3, 1073741789) / Rational(1073741827, 3))
- assert_equal(Rational(1152921432666146002, 1152921470247108503),
- Rational(3, 1073741789) + Rational(1073741789, 1073741827))
- assert_equal(Rational(-1152921426223695040, 1152921470247108503),
- Rational(3, 1073741789) - Rational(1073741789, 1073741827))
- assert_equal(Rational(3, 1073741827),
- Rational(3, 1073741789) * Rational(1073741789, 1073741827))
- assert_equal(Rational(3221225481, 1152921429444920521),
- Rational(3, 1073741789) / Rational(1073741789, 1073741827))
- assert_equal(Rational(1073741830, 1073741789),
- Rational(3, 1073741789) + Rational(1073741827, 1073741789))
- assert_equal(Rational(-1073741824, 1073741789),
- Rational(3, 1073741789) - Rational(1073741827, 1073741789))
- assert_equal(Rational(3221225481, 1152921429444920521),
- Rational(3, 1073741789) * Rational(1073741827, 1073741789))
- assert_equal(Rational(3, 1073741827),
- Rational(3, 1073741789) / Rational(1073741827, 1073741789))
- assert_equal(Rational(1073741789, 3), +Rational(1073741789, 3))
- assert_equal(Rational(-1073741789, 3), -Rational(1073741789, 3))
- assert_equal(Rational(1073741792, 3),
- Rational(1073741789, 3) + Rational(1, 1))
- assert_equal(Rational(1073741786, 3),
- Rational(1073741789, 3) - Rational(1, 1))
- assert_equal(Rational(1073741789, 3),
- Rational(1073741789, 3) * Rational(1, 1))
- assert_equal(Rational(1073741789, 3),
- Rational(1073741789, 3) / Rational(1, 1))
- assert_equal(Rational(1073741795, 3),
- Rational(1073741789, 3) + Rational(2, 1))
- assert_equal(Rational(1073741783, 3),
- Rational(1073741789, 3) - Rational(2, 1))
- assert_equal(Rational(2147483578, 3),
- Rational(1073741789, 3) * Rational(2, 1))
- assert_equal(Rational(1073741789, 6),
- Rational(1073741789, 3) / Rational(2, 1))
- assert_equal(Rational(1073741798, 3),
- Rational(1073741789, 3) + Rational(3, 1))
- assert_equal(Rational(1073741780, 3),
- Rational(1073741789, 3) - Rational(3, 1))
- assert_equal(Rational(1073741789, 1),
- Rational(1073741789, 3) * Rational(3, 1))
- assert_equal(Rational(1073741789, 9),
- Rational(1073741789, 3) / Rational(3, 1))
- assert_equal(Rational(4294967156, 3),
- Rational(1073741789, 3) + Rational(1073741789, 1))
- assert_equal(Rational(-2147483578, 3),
- Rational(1073741789, 3) - Rational(1073741789, 1))
- assert_equal(Rational(1152921429444920521, 3),
- Rational(1073741789, 3) * Rational(1073741789, 1))
- assert_equal(Rational(1, 3),
- Rational(1073741789, 3) / Rational(1073741789, 1))
- assert_equal(Rational(4294967270, 3),
- Rational(1073741789, 3) + Rational(1073741827, 1))
- assert_equal(Rational(-2147483692, 3),
- Rational(1073741789, 3) - Rational(1073741827, 1))
- assert_equal(Rational(1152921470247108503, 3),
- Rational(1073741789, 3) * Rational(1073741827, 1))
- assert_equal(Rational(1073741789, 3221225481),
- Rational(1073741789, 3) / Rational(1073741827, 1))
- assert_equal(Rational(1073741791, 3),
- Rational(1073741789, 3) + Rational(2, 3))
- assert_equal(Rational(357913929, 1),
- Rational(1073741789, 3) - Rational(2, 3))
- assert_equal(Rational(2147483578, 9),
- Rational(1073741789, 3) * Rational(2, 3))
- assert_equal(Rational(1073741789, 2),
- Rational(1073741789, 3) / Rational(2, 3))
- assert_equal(Rational(2147483587, 6),
- Rational(1073741789, 3) + Rational(3, 2))
- assert_equal(Rational(2147483569, 6),
- Rational(1073741789, 3) - Rational(3, 2))
- assert_equal(Rational(1073741789, 2),
- Rational(1073741789, 3) * Rational(3, 2))
- assert_equal(Rational(2147483578, 9),
- Rational(1073741789, 3) / Rational(3, 2))
- assert_equal(Rational(1152921429444920530, 3221225367),
- Rational(1073741789, 3) + Rational(3, 1073741789))
- assert_equal(Rational(1152921429444920512, 3221225367),
- Rational(1073741789, 3) - Rational(3, 1073741789))
- assert_equal(Rational(1, 1),
- Rational(1073741789, 3) * Rational(3, 1073741789))
- assert_equal(Rational(1152921429444920521, 9),
- Rational(1073741789, 3) / Rational(3, 1073741789))
- assert_equal(Rational(2147483578, 3),
- Rational(1073741789, 3) + Rational(1073741789, 3))
- assert_equal(Rational(0, 1),
- Rational(1073741789, 3) - Rational(1073741789, 3))
- assert_equal(Rational(1152921429444920521, 9),
- Rational(1073741789, 3) * Rational(1073741789, 3))
- assert_equal(Rational(1, 1),
- Rational(1073741789, 3) / Rational(1073741789, 3))
- assert_equal(Rational(1152921470247108512, 3221225481),
- Rational(1073741789, 3) + Rational(3, 1073741827))
- assert_equal(Rational(1152921470247108494, 3221225481),
- Rational(1073741789, 3) - Rational(3, 1073741827))
- assert_equal(Rational(1073741789, 1073741827),
- Rational(1073741789, 3) * Rational(3, 1073741827))
- assert_equal(Rational(1152921470247108503, 9),
- Rational(1073741789, 3) / Rational(3, 1073741827))
- assert_equal(Rational(715827872, 1),
- Rational(1073741789, 3) + Rational(1073741827, 3))
- assert_equal(Rational(-38, 3),
- Rational(1073741789, 3) - Rational(1073741827, 3))
- assert_equal(Rational(1152921470247108503, 9),
- Rational(1073741789, 3) * Rational(1073741827, 3))
- assert_equal(Rational(1073741789, 1073741827),
- Rational(1073741789, 3) / Rational(1073741827, 3))
- assert_equal(Rational(1152921473468333870, 3221225481),
- Rational(1073741789, 3) + Rational(1073741789, 1073741827))
- assert_equal(Rational(1152921467025883136, 3221225481),
- Rational(1073741789, 3) - Rational(1073741789, 1073741827))
- assert_equal(Rational(1152921429444920521, 3221225481),
- Rational(1073741789, 3) * Rational(1073741789, 1073741827))
- assert_equal(Rational(1073741827, 3),
- Rational(1073741789, 3) / Rational(1073741789, 1073741827))
- assert_equal(Rational(1152921432666146002, 3221225367),
- Rational(1073741789, 3) + Rational(1073741827, 1073741789))
- assert_equal(Rational(1152921426223695040, 3221225367),
- Rational(1073741789, 3) - Rational(1073741827, 1073741789))
- assert_equal(Rational(1073741827, 3),
- Rational(1073741789, 3) * Rational(1073741827, 1073741789))
- assert_equal(Rational(1152921429444920521, 3221225481),
- Rational(1073741789, 3) / Rational(1073741827, 1073741789))
- assert_equal(Rational(3, 1073741827), +Rational(3, 1073741827))
- assert_equal(Rational(-3, 1073741827), -Rational(3, 1073741827))
- assert_equal(Rational(1073741830, 1073741827),
- Rational(3, 1073741827) + Rational(1, 1))
- assert_equal(Rational(-1073741824, 1073741827),
- Rational(3, 1073741827) - Rational(1, 1))
- assert_equal(Rational(3, 1073741827),
- Rational(3, 1073741827) * Rational(1, 1))
- assert_equal(Rational(3, 1073741827),
- Rational(3, 1073741827) / Rational(1, 1))
- assert_equal(Rational(2147483657, 1073741827),
- Rational(3, 1073741827) + Rational(2, 1))
- assert_equal(Rational(-2147483651, 1073741827),
- Rational(3, 1073741827) - Rational(2, 1))
- assert_equal(Rational(6, 1073741827),
- Rational(3, 1073741827) * Rational(2, 1))
- assert_equal(Rational(3, 2147483654),
- Rational(3, 1073741827) / Rational(2, 1))
- assert_equal(Rational(3221225484, 1073741827),
- Rational(3, 1073741827) + Rational(3, 1))
- assert_equal(Rational(-3221225478, 1073741827),
- Rational(3, 1073741827) - Rational(3, 1))
- assert_equal(Rational(9, 1073741827),
- Rational(3, 1073741827) * Rational(3, 1))
- assert_equal(Rational(1, 1073741827),
- Rational(3, 1073741827) / Rational(3, 1))
- assert_equal(Rational(1152921470247108506, 1073741827),
- Rational(3, 1073741827) + Rational(1073741789, 1))
- assert_equal(Rational(-1152921470247108500, 1073741827),
- Rational(3, 1073741827) - Rational(1073741789, 1))
- assert_equal(Rational(3221225367, 1073741827),
- Rational(3, 1073741827) * Rational(1073741789, 1))
- assert_equal(Rational(3, 1152921470247108503),
- Rational(3, 1073741827) / Rational(1073741789, 1))
- assert_equal(Rational(1152921511049297932, 1073741827),
- Rational(3, 1073741827) + Rational(1073741827, 1))
- assert_equal(Rational(-1152921511049297926, 1073741827),
- Rational(3, 1073741827) - Rational(1073741827, 1))
- assert_equal(Rational(3, 1),
- Rational(3, 1073741827) * Rational(1073741827, 1))
- assert_equal(Rational(3, 1152921511049297929),
- Rational(3, 1073741827) / Rational(1073741827, 1))
- assert_equal(Rational(2147483663, 3221225481),
- Rational(3, 1073741827) + Rational(2, 3))
- assert_equal(Rational(-2147483645, 3221225481),
- Rational(3, 1073741827) - Rational(2, 3))
- assert_equal(Rational(2, 1073741827),
- Rational(3, 1073741827) * Rational(2, 3))
- assert_equal(Rational(9, 2147483654),
- Rational(3, 1073741827) / Rational(2, 3))
- assert_equal(Rational(3221225487, 2147483654),
- Rational(3, 1073741827) + Rational(3, 2))
- assert_equal(Rational(-3221225475, 2147483654),
- Rational(3, 1073741827) - Rational(3, 2))
- assert_equal(Rational(9, 2147483654),
- Rational(3, 1073741827) * Rational(3, 2))
- assert_equal(Rational(2, 1073741827),
- Rational(3, 1073741827) / Rational(3, 2))
- assert_equal(Rational(6442450848, 1152921470247108503),
- Rational(3, 1073741827) + Rational(3, 1073741789))
- assert_equal(Rational(-114, 1152921470247108503),
- Rational(3, 1073741827) - Rational(3, 1073741789))
- assert_equal(Rational(9, 1152921470247108503),
- Rational(3, 1073741827) * Rational(3, 1073741789))
- assert_equal(Rational(1073741789, 1073741827),
- Rational(3, 1073741827) / Rational(3, 1073741789))
- assert_equal(Rational(1152921470247108512, 3221225481),
- Rational(3, 1073741827) + Rational(1073741789, 3))
- assert_equal(Rational(-1152921470247108494, 3221225481),
- Rational(3, 1073741827) - Rational(1073741789, 3))
- assert_equal(Rational(1073741789, 1073741827),
- Rational(3, 1073741827) * Rational(1073741789, 3))
- assert_equal(Rational(9, 1152921470247108503),
- Rational(3, 1073741827) / Rational(1073741789, 3))
- assert_equal(Rational(6, 1073741827),
- Rational(3, 1073741827) + Rational(3, 1073741827))
- assert_equal(Rational(0, 1),
- Rational(3, 1073741827) - Rational(3, 1073741827))
- assert_equal(Rational(9, 1152921511049297929),
- Rational(3, 1073741827) * Rational(3, 1073741827))
- assert_equal(Rational(1, 1),
- Rational(3, 1073741827) / Rational(3, 1073741827))
- assert_equal(Rational(1152921511049297938, 3221225481),
- Rational(3, 1073741827) + Rational(1073741827, 3))
- assert_equal(Rational(-1152921511049297920, 3221225481),
- Rational(3, 1073741827) - Rational(1073741827, 3))
- assert_equal(Rational(1, 1),
- Rational(3, 1073741827) * Rational(1073741827, 3))
- assert_equal(Rational(9, 1152921511049297929),
- Rational(3, 1073741827) / Rational(1073741827, 3))
- assert_equal(Rational(1073741792, 1073741827),
- Rational(3, 1073741827) + Rational(1073741789, 1073741827))
- assert_equal(Rational(-1073741786, 1073741827),
- Rational(3, 1073741827) - Rational(1073741789, 1073741827))
- assert_equal(Rational(3221225367, 1152921511049297929),
- Rational(3, 1073741827) * Rational(1073741789, 1073741827))
- assert_equal(Rational(3, 1073741789),
- Rational(3, 1073741827) / Rational(1073741789, 1073741827))
- assert_equal(Rational(1152921514270523296, 1152921470247108503),
- Rational(3, 1073741827) + Rational(1073741827, 1073741789))
- assert_equal(Rational(-1152921507828072562, 1152921470247108503),
- Rational(3, 1073741827) - Rational(1073741827, 1073741789))
- assert_equal(Rational(3, 1073741789),
- Rational(3, 1073741827) * Rational(1073741827, 1073741789))
- assert_equal(Rational(3221225367, 1152921511049297929),
- Rational(3, 1073741827) / Rational(1073741827, 1073741789))
- assert_equal(Rational(1073741827, 3), +Rational(1073741827, 3))
- assert_equal(Rational(-1073741827, 3), -Rational(1073741827, 3))
- assert_equal(Rational(1073741830, 3),
- Rational(1073741827, 3) + Rational(1, 1))
- assert_equal(Rational(1073741824, 3),
- Rational(1073741827, 3) - Rational(1, 1))
- assert_equal(Rational(1073741827, 3),
- Rational(1073741827, 3) * Rational(1, 1))
- assert_equal(Rational(1073741827, 3),
- Rational(1073741827, 3) / Rational(1, 1))
- assert_equal(Rational(1073741833, 3),
- Rational(1073741827, 3) + Rational(2, 1))
- assert_equal(Rational(1073741821, 3),
- Rational(1073741827, 3) - Rational(2, 1))
- assert_equal(Rational(2147483654, 3),
- Rational(1073741827, 3) * Rational(2, 1))
- assert_equal(Rational(1073741827, 6),
- Rational(1073741827, 3) / Rational(2, 1))
- assert_equal(Rational(1073741836, 3),
- Rational(1073741827, 3) + Rational(3, 1))
- assert_equal(Rational(1073741818, 3),
- Rational(1073741827, 3) - Rational(3, 1))
- assert_equal(Rational(1073741827, 1),
- Rational(1073741827, 3) * Rational(3, 1))
- assert_equal(Rational(1073741827, 9),
- Rational(1073741827, 3) / Rational(3, 1))
- assert_equal(Rational(4294967194, 3),
- Rational(1073741827, 3) + Rational(1073741789, 1))
- assert_equal(Rational(-2147483540, 3),
- Rational(1073741827, 3) - Rational(1073741789, 1))
- assert_equal(Rational(1152921470247108503, 3),
- Rational(1073741827, 3) * Rational(1073741789, 1))
- assert_equal(Rational(1073741827, 3221225367),
- Rational(1073741827, 3) / Rational(1073741789, 1))
- assert_equal(Rational(4294967308, 3),
- Rational(1073741827, 3) + Rational(1073741827, 1))
- assert_equal(Rational(-2147483654, 3),
- Rational(1073741827, 3) - Rational(1073741827, 1))
- assert_equal(Rational(1152921511049297929, 3),
- Rational(1073741827, 3) * Rational(1073741827, 1))
- assert_equal(Rational(1, 3),
- Rational(1073741827, 3) / Rational(1073741827, 1))
- assert_equal(Rational(357913943, 1),
- Rational(1073741827, 3) + Rational(2, 3))
- assert_equal(Rational(1073741825, 3),
- Rational(1073741827, 3) - Rational(2, 3))
- assert_equal(Rational(2147483654, 9),
- Rational(1073741827, 3) * Rational(2, 3))
- assert_equal(Rational(1073741827, 2),
- Rational(1073741827, 3) / Rational(2, 3))
- assert_equal(Rational(2147483663, 6),
- Rational(1073741827, 3) + Rational(3, 2))
- assert_equal(Rational(2147483645, 6),
- Rational(1073741827, 3) - Rational(3, 2))
- assert_equal(Rational(1073741827, 2),
- Rational(1073741827, 3) * Rational(3, 2))
- assert_equal(Rational(2147483654, 9),
- Rational(1073741827, 3) / Rational(3, 2))
- assert_equal(Rational(1152921470247108512, 3221225367),
- Rational(1073741827, 3) + Rational(3, 1073741789))
- assert_equal(Rational(1152921470247108494, 3221225367),
- Rational(1073741827, 3) - Rational(3, 1073741789))
- assert_equal(Rational(1073741827, 1073741789),
- Rational(1073741827, 3) * Rational(3, 1073741789))
- assert_equal(Rational(1152921470247108503, 9),
- Rational(1073741827, 3) / Rational(3, 1073741789))
- assert_equal(Rational(715827872, 1),
- Rational(1073741827, 3) + Rational(1073741789, 3))
- assert_equal(Rational(38, 3),
- Rational(1073741827, 3) - Rational(1073741789, 3))
- assert_equal(Rational(1152921470247108503, 9),
- Rational(1073741827, 3) * Rational(1073741789, 3))
- assert_equal(Rational(1073741827, 1073741789),
- Rational(1073741827, 3) / Rational(1073741789, 3))
- assert_equal(Rational(1152921511049297938, 3221225481),
- Rational(1073741827, 3) + Rational(3, 1073741827))
- assert_equal(Rational(1152921511049297920, 3221225481),
- Rational(1073741827, 3) - Rational(3, 1073741827))
- assert_equal(Rational(1, 1),
- Rational(1073741827, 3) * Rational(3, 1073741827))
- assert_equal(Rational(1152921511049297929, 9),
- Rational(1073741827, 3) / Rational(3, 1073741827))
- assert_equal(Rational(2147483654, 3),
- Rational(1073741827, 3) + Rational(1073741827, 3))
- assert_equal(Rational(0, 1),
- Rational(1073741827, 3) - Rational(1073741827, 3))
- assert_equal(Rational(1152921511049297929, 9),
- Rational(1073741827, 3) * Rational(1073741827, 3))
- assert_equal(Rational(1, 1),
- Rational(1073741827, 3) / Rational(1073741827, 3))
- assert_equal(Rational(1152921514270523296, 3221225481),
- Rational(1073741827, 3) + Rational(1073741789, 1073741827))
- assert_equal(Rational(1152921507828072562, 3221225481),
- Rational(1073741827, 3) - Rational(1073741789, 1073741827))
- assert_equal(Rational(1073741789, 3),
- Rational(1073741827, 3) * Rational(1073741789, 1073741827))
- assert_equal(Rational(1152921511049297929, 3221225367),
- Rational(1073741827, 3) / Rational(1073741789, 1073741827))
- assert_equal(Rational(1152921473468333984, 3221225367),
- Rational(1073741827, 3) + Rational(1073741827, 1073741789))
- assert_equal(Rational(1152921467025883022, 3221225367),
- Rational(1073741827, 3) - Rational(1073741827, 1073741789))
- assert_equal(Rational(1152921511049297929, 3221225367),
- Rational(1073741827, 3) * Rational(1073741827, 1073741789))
- assert_equal(Rational(1073741789, 3),
- Rational(1073741827, 3) / Rational(1073741827, 1073741789))
- assert_equal(Rational(1073741789, 1073741827), +Rational(1073741789, 1073741827))
- assert_equal(Rational(-1073741789, 1073741827), -Rational(1073741789, 1073741827))
- assert_equal(Rational(2147483616, 1073741827),
- Rational(1073741789, 1073741827) + Rational(1, 1))
- assert_equal(Rational(-38, 1073741827),
- Rational(1073741789, 1073741827) - Rational(1, 1))
- assert_equal(Rational(1073741789, 1073741827),
- Rational(1073741789, 1073741827) * Rational(1, 1))
- assert_equal(Rational(1073741789, 1073741827),
- Rational(1073741789, 1073741827) / Rational(1, 1))
- assert_equal(Rational(3221225443, 1073741827),
- Rational(1073741789, 1073741827) + Rational(2, 1))
- assert_equal(Rational(-1073741865, 1073741827),
- Rational(1073741789, 1073741827) - Rational(2, 1))
- assert_equal(Rational(2147483578, 1073741827),
- Rational(1073741789, 1073741827) * Rational(2, 1))
- assert_equal(Rational(1073741789, 2147483654),
- Rational(1073741789, 1073741827) / Rational(2, 1))
- assert_equal(Rational(4294967270, 1073741827),
- Rational(1073741789, 1073741827) + Rational(3, 1))
- assert_equal(Rational(-2147483692, 1073741827),
- Rational(1073741789, 1073741827) - Rational(3, 1))
- assert_equal(Rational(3221225367, 1073741827),
- Rational(1073741789, 1073741827) * Rational(3, 1))
- assert_equal(Rational(1073741789, 3221225481),
- Rational(1073741789, 1073741827) / Rational(3, 1))
- assert_equal(Rational(1152921471320850292, 1073741827),
- Rational(1073741789, 1073741827) + Rational(1073741789, 1))
- assert_equal(Rational(-1152921469173366714, 1073741827),
- Rational(1073741789, 1073741827) - Rational(1073741789, 1))
- assert_equal(Rational(1152921429444920521, 1073741827),
- Rational(1073741789, 1073741827) * Rational(1073741789, 1))
- assert_equal(Rational(1, 1073741827),
- Rational(1073741789, 1073741827) / Rational(1073741789, 1))
- assert_equal(Rational(1152921512123039718, 1073741827),
- Rational(1073741789, 1073741827) + Rational(1073741827, 1))
- assert_equal(Rational(-1152921509975556140, 1073741827),
- Rational(1073741789, 1073741827) - Rational(1073741827, 1))
- assert_equal(Rational(1073741789, 1),
- Rational(1073741789, 1073741827) * Rational(1073741827, 1))
- assert_equal(Rational(1073741789, 1152921511049297929),
- Rational(1073741789, 1073741827) / Rational(1073741827, 1))
- assert_equal(Rational(5368709021, 3221225481),
- Rational(1073741789, 1073741827) + Rational(2, 3))
- assert_equal(Rational(1073741713, 3221225481),
- Rational(1073741789, 1073741827) - Rational(2, 3))
- assert_equal(Rational(2147483578, 3221225481),
- Rational(1073741789, 1073741827) * Rational(2, 3))
- assert_equal(Rational(3221225367, 2147483654),
- Rational(1073741789, 1073741827) / Rational(2, 3))
- assert_equal(Rational(5368709059, 2147483654),
- Rational(1073741789, 1073741827) + Rational(3, 2))
- assert_equal(Rational(-1073741903, 2147483654),
- Rational(1073741789, 1073741827) - Rational(3, 2))
- assert_equal(Rational(3221225367, 2147483654),
- Rational(1073741789, 1073741827) * Rational(3, 2))
- assert_equal(Rational(2147483578, 3221225481),
- Rational(1073741789, 1073741827) / Rational(3, 2))
- assert_equal(Rational(1152921432666146002, 1152921470247108503),
- Rational(1073741789, 1073741827) + Rational(3, 1073741789))
- assert_equal(Rational(1152921426223695040, 1152921470247108503),
- Rational(1073741789, 1073741827) - Rational(3, 1073741789))
- assert_equal(Rational(3, 1073741827),
- Rational(1073741789, 1073741827) * Rational(3, 1073741789))
- assert_equal(Rational(1152921429444920521, 3221225481),
- Rational(1073741789, 1073741827) / Rational(3, 1073741789))
- assert_equal(Rational(1152921473468333870, 3221225481),
- Rational(1073741789, 1073741827) + Rational(1073741789, 3))
- assert_equal(Rational(-1152921467025883136, 3221225481),
- Rational(1073741789, 1073741827) - Rational(1073741789, 3))
- assert_equal(Rational(1152921429444920521, 3221225481),
- Rational(1073741789, 1073741827) * Rational(1073741789, 3))
- assert_equal(Rational(3, 1073741827),
- Rational(1073741789, 1073741827) / Rational(1073741789, 3))
- assert_equal(Rational(1073741792, 1073741827),
- Rational(1073741789, 1073741827) + Rational(3, 1073741827))
- assert_equal(Rational(1073741786, 1073741827),
- Rational(1073741789, 1073741827) - Rational(3, 1073741827))
- assert_equal(Rational(3221225367, 1152921511049297929),
- Rational(1073741789, 1073741827) * Rational(3, 1073741827))
- assert_equal(Rational(1073741789, 3),
- Rational(1073741789, 1073741827) / Rational(3, 1073741827))
- assert_equal(Rational(1152921514270523296, 3221225481),
- Rational(1073741789, 1073741827) + Rational(1073741827, 3))
- assert_equal(Rational(-1152921507828072562, 3221225481),
- Rational(1073741789, 1073741827) - Rational(1073741827, 3))
- assert_equal(Rational(1073741789, 3),
- Rational(1073741789, 1073741827) * Rational(1073741827, 3))
- assert_equal(Rational(3221225367, 1152921511049297929),
- Rational(1073741789, 1073741827) / Rational(1073741827, 3))
- assert_equal(Rational(2147483578, 1073741827),
- Rational(1073741789, 1073741827) + Rational(1073741789, 1073741827))
- assert_equal(Rational(0, 1),
- Rational(1073741789, 1073741827) - Rational(1073741789, 1073741827))
- assert_equal(Rational(1152921429444920521, 1152921511049297929),
- Rational(1073741789, 1073741827) * Rational(1073741789, 1073741827))
- assert_equal(Rational(1, 1),
- Rational(1073741789, 1073741827) / Rational(1073741789, 1073741827))
- assert_equal(Rational(2305842940494218450, 1152921470247108503),
- Rational(1073741789, 1073741827) + Rational(1073741827, 1073741789))
- assert_equal(Rational(-81604377408, 1152921470247108503),
- Rational(1073741789, 1073741827) - Rational(1073741827, 1073741789))
- assert_equal(Rational(1, 1),
- Rational(1073741789, 1073741827) * Rational(1073741827, 1073741789))
- assert_equal(Rational(1152921429444920521, 1152921511049297929),
- Rational(1073741789, 1073741827) / Rational(1073741827, 1073741789))
- assert_equal(Rational(1073741827, 1073741789), +Rational(1073741827, 1073741789))
- assert_equal(Rational(-1073741827, 1073741789), -Rational(1073741827, 1073741789))
- assert_equal(Rational(2147483616, 1073741789),
- Rational(1073741827, 1073741789) + Rational(1, 1))
- assert_equal(Rational(38, 1073741789),
- Rational(1073741827, 1073741789) - Rational(1, 1))
- assert_equal(Rational(1073741827, 1073741789),
- Rational(1073741827, 1073741789) * Rational(1, 1))
- assert_equal(Rational(1073741827, 1073741789),
- Rational(1073741827, 1073741789) / Rational(1, 1))
- assert_equal(Rational(3221225405, 1073741789),
- Rational(1073741827, 1073741789) + Rational(2, 1))
- assert_equal(Rational(-1073741751, 1073741789),
- Rational(1073741827, 1073741789) - Rational(2, 1))
- assert_equal(Rational(2147483654, 1073741789),
- Rational(1073741827, 1073741789) * Rational(2, 1))
- assert_equal(Rational(1073741827, 2147483578),
- Rational(1073741827, 1073741789) / Rational(2, 1))
- assert_equal(Rational(4294967194, 1073741789),
- Rational(1073741827, 1073741789) + Rational(3, 1))
- assert_equal(Rational(-2147483540, 1073741789),
- Rational(1073741827, 1073741789) - Rational(3, 1))
- assert_equal(Rational(3221225481, 1073741789),
- Rational(1073741827, 1073741789) * Rational(3, 1))
- assert_equal(Rational(1073741827, 3221225367),
- Rational(1073741827, 1073741789) / Rational(3, 1))
- assert_equal(Rational(1152921430518662348, 1073741789),
- Rational(1073741827, 1073741789) + Rational(1073741789, 1))
- assert_equal(Rational(-1152921428371178694, 1073741789),
- Rational(1073741827, 1073741789) - Rational(1073741789, 1))
- assert_equal(Rational(1073741827, 1),
- Rational(1073741827, 1073741789) * Rational(1073741789, 1))
- assert_equal(Rational(1073741827, 1152921429444920521),
- Rational(1073741827, 1073741789) / Rational(1073741789, 1))
- assert_equal(Rational(1152921471320850330, 1073741789),
- Rational(1073741827, 1073741789) + Rational(1073741827, 1))
- assert_equal(Rational(-1152921469173366676, 1073741789),
- Rational(1073741827, 1073741789) - Rational(1073741827, 1))
- assert_equal(Rational(1152921511049297929, 1073741789),
- Rational(1073741827, 1073741789) * Rational(1073741827, 1))
- assert_equal(Rational(1, 1073741789),
- Rational(1073741827, 1073741789) / Rational(1073741827, 1))
- assert_equal(Rational(5368709059, 3221225367),
- Rational(1073741827, 1073741789) + Rational(2, 3))
- assert_equal(Rational(1073741903, 3221225367),
- Rational(1073741827, 1073741789) - Rational(2, 3))
- assert_equal(Rational(2147483654, 3221225367),
- Rational(1073741827, 1073741789) * Rational(2, 3))
- assert_equal(Rational(3221225481, 2147483578),
- Rational(1073741827, 1073741789) / Rational(2, 3))
- assert_equal(Rational(5368709021, 2147483578),
- Rational(1073741827, 1073741789) + Rational(3, 2))
- assert_equal(Rational(-1073741713, 2147483578),
- Rational(1073741827, 1073741789) - Rational(3, 2))
- assert_equal(Rational(3221225481, 2147483578),
- Rational(1073741827, 1073741789) * Rational(3, 2))
- assert_equal(Rational(2147483654, 3221225367),
- Rational(1073741827, 1073741789) / Rational(3, 2))
- assert_equal(Rational(1073741830, 1073741789),
- Rational(1073741827, 1073741789) + Rational(3, 1073741789))
- assert_equal(Rational(1073741824, 1073741789),
- Rational(1073741827, 1073741789) - Rational(3, 1073741789))
- assert_equal(Rational(3221225481, 1152921429444920521),
- Rational(1073741827, 1073741789) * Rational(3, 1073741789))
- assert_equal(Rational(1073741827, 3),
- Rational(1073741827, 1073741789) / Rational(3, 1073741789))
- assert_equal(Rational(1152921432666146002, 3221225367),
- Rational(1073741827, 1073741789) + Rational(1073741789, 3))
- assert_equal(Rational(-1152921426223695040, 3221225367),
- Rational(1073741827, 1073741789) - Rational(1073741789, 3))
- assert_equal(Rational(1073741827, 3),
- Rational(1073741827, 1073741789) * Rational(1073741789, 3))
- assert_equal(Rational(3221225481, 1152921429444920521),
- Rational(1073741827, 1073741789) / Rational(1073741789, 3))
- assert_equal(Rational(1152921514270523296, 1152921470247108503),
- Rational(1073741827, 1073741789) + Rational(3, 1073741827))
- assert_equal(Rational(1152921507828072562, 1152921470247108503),
- Rational(1073741827, 1073741789) - Rational(3, 1073741827))
- assert_equal(Rational(3, 1073741789),
- Rational(1073741827, 1073741789) * Rational(3, 1073741827))
- assert_equal(Rational(1152921511049297929, 3221225367),
- Rational(1073741827, 1073741789) / Rational(3, 1073741827))
- assert_equal(Rational(1152921473468333984, 3221225367),
- Rational(1073741827, 1073741789) + Rational(1073741827, 3))
- assert_equal(Rational(-1152921467025883022, 3221225367),
- Rational(1073741827, 1073741789) - Rational(1073741827, 3))
- assert_equal(Rational(1152921511049297929, 3221225367),
- Rational(1073741827, 1073741789) * Rational(1073741827, 3))
- assert_equal(Rational(3, 1073741789),
- Rational(1073741827, 1073741789) / Rational(1073741827, 3))
- assert_equal(Rational(2305842940494218450, 1152921470247108503),
- Rational(1073741827, 1073741789) + Rational(1073741789, 1073741827))
- assert_equal(Rational(81604377408, 1152921470247108503),
- Rational(1073741827, 1073741789) - Rational(1073741789, 1073741827))
- assert_equal(Rational(1, 1),
- Rational(1073741827, 1073741789) * Rational(1073741789, 1073741827))
- assert_equal(Rational(1152921511049297929, 1152921429444920521),
- Rational(1073741827, 1073741789) / Rational(1073741789, 1073741827))
- assert_equal(Rational(2147483654, 1073741789),
- Rational(1073741827, 1073741789) + Rational(1073741827, 1073741789))
- assert_equal(Rational(0, 1),
- Rational(1073741827, 1073741789) - Rational(1073741827, 1073741789))
- assert_equal(Rational(1152921511049297929, 1152921429444920521),
- Rational(1073741827, 1073741789) * Rational(1073741827, 1073741789))
- assert_equal(Rational(1, 1),
- Rational(1073741827, 1073741789) / Rational(1073741827, 1073741789))
- end
-
-end
diff --git a/test/ruby/test_readpartial.rb b/test/ruby/test_readpartial.rb
index b969c38692..3877e21f85 100644
--- a/test/ruby/test_readpartial.rb
+++ b/test/ruby/test_readpartial.rb
@@ -5,8 +5,6 @@ require 'fcntl'
class TestReadPartial < Test::Unit::TestCase
def make_pipe
r, w = IO.pipe
- r.binmode
- w.binmode
begin
yield r, w
ensure
@@ -40,17 +38,18 @@ class TestReadPartial < Test::Unit::TestCase
w.close
assert_equal('ab', r.readpartial(2))
assert_equal('c', r.readpartial(2))
- assert_raise(EOFError) { r.readpartial(2) }
- assert_raise(EOFError) { r.readpartial(2) }
+ assert_raises(EOFError) { r.readpartial(2) }
+ assert_raises(EOFError) { r.readpartial(2) }
}
end
+ if !File::ALT_SEPARATOR # read on pipe cannot timeout on Windows.
def test_open_pipe
pipe {|r, w|
w << 'abc'
assert_equal('ab', r.readpartial(2))
assert_equal('c', r.readpartial(2))
- assert_raise(TimeoutError) {
+ assert_raises(TimeoutError) {
timeout(0.1) { r.readpartial(2) }
}
}
@@ -64,9 +63,12 @@ class TestReadPartial < Test::Unit::TestCase
assert_equal("de", r.readpartial(2))
assert_equal("f\n", r.readpartial(4096))
assert_equal("ghi\n", r.readpartial(4096))
- assert_raise(TimeoutError) {
+ assert_raises(TimeoutError) {
timeout(0.1) { r.readpartial(2) }
}
}
end
+ end
+
end
+
diff --git a/test/ruby/test_regexp.rb b/test/ruby/test_regexp.rb
deleted file mode 100644
index 8b7b6c053e..0000000000
--- a/test/ruby/test_regexp.rb
+++ /dev/null
@@ -1,767 +0,0 @@
-require 'test/unit'
-
-class TestRegexp < Test::Unit::TestCase
- def setup
- @verbose = $VERBOSE
- $VERBOSE = nil
- end
-
- def teardown
- $VERBOSE = @verbose
- end
-
- def test_ruby_dev_24643
- assert_nothing_raised("[ruby-dev:24643]") {
- /(?:(?:[a]*[a])?b)*a*$/ =~ "aabaaca"
- }
- end
-
- def test_ruby_talk_116455
- assert_match(/^(\w{2,}).* ([A-Za-z\xa2\xc0-\xff]{2,}?)$/n, "Hallo Welt")
- end
-
- def test_ruby_dev_24887
- assert_equal("a".gsub(/a\Z/, ""), "")
- end
-
- def test_yoshidam_net_20041111_1
- s = "[\xC2\xA0-\xC3\xBE]"
- assert_match(Regexp.new(s, nil, "u"), "\xC3\xBE")
- end
-
- def test_yoshidam_net_20041111_2
- assert_raise(RegexpError) do
- s = "[\xFF-\xFF]".force_encoding("utf-8")
- Regexp.new(s, nil, "u")
- end
- end
-
- def test_ruby_dev_31309
- assert_equal('Ruby', 'Ruby'.sub(/[^a-z]/i, '-'))
- end
-
- def test_assert_normal_exit
- # moved from knownbug. It caused core.
- Regexp.union("a", "a")
- end
-
- def test_to_s
- assert_equal '(?-mix:\x00)', Regexp.new("\0").to_s
- end
-
- def test_union
- assert_equal :ok, begin
- Regexp.union(
- "a",
- Regexp.new("\xc2\xa1".force_encoding("euc-jp")),
- Regexp.new("\xc2\xa1".force_encoding("utf-8")))
- :ng
- rescue ArgumentError
- :ok
- end
- end
-
- def test_named_capture
- m = /&(?<foo>.*?);/.match("aaa &amp; yyy")
- assert_equal("amp", m["foo"])
- assert_equal("amp", m[:foo])
- assert_equal(5, m.begin(:foo))
- assert_equal(8, m.end(:foo))
- assert_equal([5,8], m.offset(:foo))
-
- assert_equal("aaa [amp] yyy",
- "aaa &amp; yyy".sub(/&(?<foo>.*?);/, '[\k<foo>]'))
-
- assert_equal('#<MatchData "&amp; y" foo:"amp">',
- /&(?<foo>.*?); (y)/.match("aaa &amp; yyy").inspect)
- assert_equal('#<MatchData "&amp; y" 1:"amp" 2:"y">',
- /&(.*?); (y)/.match("aaa &amp; yyy").inspect)
- assert_equal('#<MatchData "&amp; y" foo:"amp" bar:"y">',
- /&(?<foo>.*?); (?<bar>y)/.match("aaa &amp; yyy").inspect)
- assert_equal('#<MatchData "&amp; y" foo:"amp" foo:"y">',
- /&(?<foo>.*?); (?<foo>y)/.match("aaa &amp; yyy").inspect)
-
- /(?<id>[A-Za-z_]+)/ =~ "!abc"
- assert_equal("abc", Regexp.last_match(:id))
-
- /a/ =~ "b" # doesn't match.
- assert_equal(nil, Regexp.last_match)
- assert_equal(nil, Regexp.last_match(1))
- assert_equal(nil, Regexp.last_match(:foo))
-
- assert_equal(["foo", "bar"], /(?<foo>.)(?<bar>.)/.names)
- assert_equal(["foo"], /(?<foo>.)(?<foo>.)/.names)
- assert_equal([], /(.)(.)/.names)
-
- assert_equal(["foo", "bar"], /(?<foo>.)(?<bar>.)/.match("ab").names)
- assert_equal(["foo"], /(?<foo>.)(?<foo>.)/.match("ab").names)
- assert_equal([], /(.)(.)/.match("ab").names)
-
- assert_equal({"foo"=>[1], "bar"=>[2]},
- /(?<foo>.)(?<bar>.)/.named_captures)
- assert_equal({"foo"=>[1, 2]},
- /(?<foo>.)(?<foo>.)/.named_captures)
- assert_equal({}, /(.)(.)/.named_captures)
-
- assert_equal("a[b]c", "abc".sub(/(?<x>[bc])/, "[\\k<x>]"))
-
- assert_equal("o", "foo"[/(?<bar>o)/, "bar"])
-
- s = "foo"
- s[/(?<bar>o)/, "bar"] = "baz"
- assert_equal("fbazo", s)
- end
-
- def test_assign_named_capture
- assert_equal("a", eval('/(?<foo>.)/ =~ "a"; foo'))
- assert_equal("a", eval('foo = 1; /(?<foo>.)/ =~ "a"; foo'))
- assert_equal("a", eval('1.times {|foo| /(?<foo>.)/ =~ "a"; break foo }'))
- assert_nothing_raised { eval('/(?<Foo>.)/ =~ "a"') }
- assert_nil(eval('/(?<Foo>.)/ =~ "a"; defined? Foo'))
- end
-
- def test_assign_named_capture_to_reserved_word
- /(?<nil>.)/ =~ "a"
- assert(!local_variables.include?(:nil), "[ruby-dev:32675]")
- end
-
- def test_match_regexp
- r = /./
- m = r.match("a")
- assert_equal(r, m.regexp)
- re = /foo/
- assert_equal(re, re.match("foo").regexp)
- end
-
- def test_source
- assert_equal('', //.source)
- end
-
- def test_inspect
- assert_equal('//', //.inspect)
- assert_equal('//i', //i.inspect)
- assert_equal('/\//i', /\//i.inspect)
- assert_equal('/\//i', /#{'/'}/i.inspect)
- assert_equal('/\/x/i', /\/x/i.inspect)
- assert_equal('/\x00/i', /#{"\0"}/i.inspect)
- assert_equal("/\n/i", /#{"\n"}/i.inspect)
- s = [0xff].pack("C")
- assert_equal('/\/'+s+'/i', /\/#{s}/i.inspect)
- end
-
- def test_char_to_option
- assert_equal("BAR", "FOOBARBAZ"[/b../i])
- assert_equal("bar", "foobarbaz"[/ b . . /x])
- assert_equal("bar\n", "foo\nbar\nbaz"[/b.../m])
- assert_raise(SyntaxError) { eval('//z') }
- end
-
- def test_char_to_option_kcode
- assert_equal("bar", "foobarbaz"[/b../s])
- assert_equal("bar", "foobarbaz"[/b../e])
- assert_equal("bar", "foobarbaz"[/b../u])
- end
-
- def test_to_s2
- assert_equal('(?-mix:foo)', /(?:foo)/.to_s)
- assert_equal('(?m-ix:foo)', /(?:foo)/m.to_s)
- assert_equal('(?mi-x:foo)', /(?:foo)/mi.to_s)
- assert_equal('(?mix:foo)', /(?:foo)/mix.to_s)
- assert_equal('(?m-ix:foo)', /(?m-ix:foo)/.to_s)
- assert_equal('(?mi-x:foo)', /(?mi-x:foo)/.to_s)
- assert_equal('(?mix:foo)', /(?mix:foo)/.to_s)
- assert_equal('(?mix:)', /(?mix)/.to_s)
- assert_equal('(?-mix:(?mix:foo) )', /(?mix:foo) /.to_s)
- end
-
- def test_casefold_p
- assert_equal(false, /a/.casefold?)
- assert_equal(true, /a/i.casefold?)
- assert_equal(false, /(?i:a)/.casefold?)
- end
-
- def test_options
- assert_equal(Regexp::IGNORECASE, /a/i.options)
- assert_equal(Regexp::EXTENDED, /a/x.options)
- assert_equal(Regexp::MULTILINE, /a/m.options)
- end
-
- def test_match_init_copy
- m = /foo/.match("foo")
- assert_equal(/foo/, m.dup.regexp)
- assert_raise(TypeError) do
- m.instance_eval { initialize_copy(nil) }
- end
- assert_equal([0, 3], m.offset(0))
- assert_equal(/foo/, m.dup.regexp)
- end
-
- def test_match_size
- m = /(.)(.)(\d+)(\d)/.match("THX1138.")
- assert_equal(5, m.size)
- end
-
- def test_match_offset_begin_end
- m = /(?<x>b..)/.match("foobarbaz")
- assert_equal([3, 6], m.offset("x"))
- assert_equal(3, m.begin("x"))
- assert_equal(6, m.end("x"))
- assert_raise(IndexError) { m.offset("y") }
- assert_raise(IndexError) { m.offset(2) }
- assert_raise(IndexError) { m.begin(2) }
- assert_raise(IndexError) { m.end(2) }
-
- m = /(?<x>q..)?/.match("foobarbaz")
- assert_equal([nil, nil], m.offset("x"))
- assert_equal(nil, m.begin("x"))
- assert_equal(nil, m.end("x"))
-
- m = /\A\u3042(.)(.)?(.)\z/.match("\u3042\u3043\u3044")
- assert_equal([1, 2], m.offset(1))
- assert_equal([nil, nil], m.offset(2))
- assert_equal([2, 3], m.offset(3))
- end
-
- def test_match_to_s
- m = /(?<x>b..)/.match("foobarbaz")
- assert_equal("bar", m.to_s)
- end
-
- def test_match_pre_post
- m = /(?<x>b..)/.match("foobarbaz")
- assert_equal("foo", m.pre_match)
- assert_equal("baz", m.post_match)
- end
-
- def test_match_array
- m = /(...)(...)(...)(...)?/.match("foobarbaz")
- assert_equal(["foobarbaz", "foo", "bar", "baz", nil], m.to_a)
- end
-
- def test_match_captures
- m = /(...)(...)(...)(...)?/.match("foobarbaz")
- assert_equal(["foo", "bar", "baz", nil], m.captures)
- end
-
- def test_match_aref
- m = /(...)(...)(...)(...)?/.match("foobarbaz")
- assert_equal("foo", m[1])
- assert_equal(["foo", "bar", "baz"], m[1..3])
- assert_nil(m[5])
- assert_raise(IndexError) { m[:foo] }
- end
-
- def test_match_values_at
- m = /(...)(...)(...)(...)?/.match("foobarbaz")
- assert_equal(["foo", "bar", "baz"], m.values_at(1, 2, 3))
- end
-
- def test_match_string
- m = /(?<x>b..)/.match("foobarbaz")
- assert_equal("foobarbaz", m.string)
- end
-
- def test_match_inspect
- m = /(...)(...)(...)(...)?/.match("foobarbaz")
- assert_equal('#<MatchData "foobarbaz" 1:"foo" 2:"bar" 3:"baz" 4:nil>', m.inspect)
- end
-
- def test_initialize
- assert_raise(ArgumentError) { Regexp.new }
- assert_equal(/foo/, Regexp.new(/foo/, Regexp::IGNORECASE))
- re = /foo/
- assert_raise(SecurityError) do
- Thread.new { $SAFE = 4; re.instance_eval { initialize(re) } }.join
- end
- re.taint
- assert_raise(SecurityError) do
- Thread.new { $SAFE = 4; re.instance_eval { initialize(re) } }.join
- end
-
- assert_equal(Encoding.find("US-ASCII"), Regexp.new("b..", nil, "n").encoding)
- assert_equal("bar", "foobarbaz"[Regexp.new("b..", nil, "n")])
- assert_equal(//n, Regexp.new("", nil, "n"))
-
- assert_raise(RegexpError) { Regexp.new(")(") }
- end
-
- def test_unescape
- assert_raise(ArgumentError) { s = '\\'; /#{ s }/ }
- assert_equal(/\177/, (s = '\177'; /#{ s }/))
- assert_raise(ArgumentError) { s = '\u'; /#{ s }/ }
- assert_raise(ArgumentError) { s = '\u{ ffffffff }'; /#{ s }/ }
- assert_raise(ArgumentError) { s = '\u{ ffffff }'; /#{ s }/ }
- assert_raise(ArgumentError) { s = '\u{ ffff X }'; /#{ s }/ }
- assert_raise(ArgumentError) { s = '\u{ }'; /#{ s }/ }
- assert_equal("b", "abc"[(s = '\u{0062}'; /#{ s }/)])
- assert_equal("b", "abc"[(s = '\u0062'; /#{ s }/)])
- assert_raise(ArgumentError) { s = '\u0'; /#{ s }/ }
- assert_raise(ArgumentError) { s = '\u000X'; /#{ s }/ }
- assert_raise(ArgumentError) { s = "\xff" + '\u3042'; /#{ s }/ }
- assert_raise(ArgumentError) { s = '\u3042' + [0xff].pack("C"); /#{ s }/ }
- assert_raise(SyntaxError) { s = ''; eval(%q(/\u#{ s }/)) }
-
- assert_equal(/a/, eval(%q(s="\u0061";/#{s}/n)))
- assert_raise(RegexpError) { s = "\u3042"; eval(%q(/#{s}/n)) }
- assert_raise(RegexpError) { s = "\u0061"; eval(%q(/\u3042#{s}/n)) }
- assert_raise(ArgumentError) { s1=[0xff].pack("C"); s2="\u3042"; eval(%q(/#{s1}#{s2}/)) }
-
- assert_raise(ArgumentError) { s = '\x'; /#{ s }/ }
-
- assert_equal("\xe1", [0x00, 0xe1, 0xff].pack("C*")[/\M-a/])
- assert_equal("\xdc", [0x00, 0xdc, 0xff].pack("C*")[/\M-\\/])
- assert_equal("\x8a", [0x00, 0x8a, 0xff].pack("C*")[/\M-\n/])
- assert_equal("\x89", [0x00, 0x89, 0xff].pack("C*")[/\M-\t/])
- assert_equal("\x8d", [0x00, 0x8d, 0xff].pack("C*")[/\M-\r/])
- assert_equal("\x8c", [0x00, 0x8c, 0xff].pack("C*")[/\M-\f/])
- assert_equal("\x8b", [0x00, 0x8b, 0xff].pack("C*")[/\M-\v/])
- assert_equal("\x87", [0x00, 0x87, 0xff].pack("C*")[/\M-\a/])
- assert_equal("\x9b", [0x00, 0x9b, 0xff].pack("C*")[/\M-\e/])
- assert_equal("\x01", [0x00, 0x01, 0xff].pack("C*")[/\C-a/])
-
- assert_raise(ArgumentError) { s = '\M'; /#{ s }/ }
- assert_raise(ArgumentError) { s = '\M-\M-a'; /#{ s }/ }
- assert_raise(ArgumentError) { s = '\M-\\'; /#{ s }/ }
-
- assert_raise(ArgumentError) { s = '\C'; /#{ s }/ }
- assert_raise(ArgumentError) { s = '\c'; /#{ s }/ }
- assert_raise(ArgumentError) { s = '\C-\C-a'; /#{ s }/ }
-
- assert_raise(ArgumentError) { s = '\M-\z'; /#{ s }/ }
- assert_raise(ArgumentError) { s = '\M-\777'; /#{ s }/ }
-
- assert_equal("\u3042\u3042", "\u3042\u3042"[(s = "\u3042" + %q(\xe3\x81\x82); /#{s}/)])
- assert_raise(ArgumentError) { s = "\u3042" + %q(\xe3); /#{s}/ }
- assert_raise(ArgumentError) { s = "\u3042" + %q(\xe3\xe3); /#{s}/ }
- assert_raise(ArgumentError) { s = '\u3042' + [0xff].pack("C"); /#{s}/ }
-
- assert_raise(SyntaxError) { eval("/\u3042/n") }
-
- s = ".........."
- 5.times { s.sub!(".", "") }
- assert_equal(".....", s)
- end
-
- def test_equal
- assert_equal(true, /abc/ == /abc/)
- assert_equal(false, /abc/ == /abc/m)
- assert_equal(false, /abc/ == /abd/)
- end
-
- def test_match
- assert_nil(//.match(nil))
- assert_equal("abc", /.../.match(:abc)[0])
- assert_raise(TypeError) { /.../.match(Object.new)[0] }
- assert_equal("bc", /../.match('abc', 1)[0])
- assert_equal("bc", /../.match('abc', -2)[0])
- assert_nil(/../.match("abc", -4))
- assert_nil(/../.match("abc", 4))
- assert_equal('\x', /../n.match("\u3042" + '\x', 1)[0])
-
- r = nil
- /.../.match("abc") {|m| r = m[0] }
- assert_equal("abc", r)
-
- $_ = "abc"; assert_equal(1, ~/bc/)
- $_ = "abc"; assert_nil(~/d/)
- $_ = nil; assert_nil(~/./)
- end
-
- def test_eqq
- assert_equal(false, /../ === nil)
- end
-
- def test_quote
- assert_equal("\xff", Regexp.quote([0xff].pack("C")))
- assert_equal("\\ ", Regexp.quote("\ "))
- assert_equal("\\t", Regexp.quote("\t"))
- assert_equal("\\n", Regexp.quote("\n"))
- assert_equal("\\r", Regexp.quote("\r"))
- assert_equal("\\f", Regexp.quote("\f"))
- assert_equal("\\v", Regexp.quote("\v"))
- assert_equal("\u3042\\t", Regexp.quote("\u3042\t"))
- assert_equal("\\t\xff", Regexp.quote("\t" + [0xff].pack("C")))
- end
-
- def test_try_convert
- assert_equal(/re/, Regexp.try_convert(/re/))
- assert_nil(Regexp.try_convert("re"))
-
- o = Object.new
- assert_nil(Regexp.try_convert(o))
- def o.to_regexp() /foo/ end
- assert_equal(/foo/, Regexp.try_convert(o))
- end
-
- def test_union2
- assert_equal(/(?!)/, Regexp.union)
- assert_equal(/foo/, Regexp.union(/foo/))
- assert_equal(/foo/, Regexp.union([/foo/]))
- assert_equal(/\t/, Regexp.union("\t"))
- assert_equal(/(?-mix:\u3042)|(?-mix:\u3042)/, Regexp.union(/\u3042/, /\u3042/))
- assert_equal("\u3041", "\u3041"[Regexp.union(/\u3042/, "\u3041")])
- end
-
- def test_dup
- assert_equal(//, //.dup)
- assert_raise(TypeError) { //.instance_eval { initialize_copy(nil) } }
- end
-
- def test_regsub
- assert_equal("fooXXXbaz", "foobarbaz".sub!(/bar/, "XXX"))
- s = [0xff].pack("C")
- assert_equal(s, "X".sub!(/./, s))
- assert_equal('\\' + s, "X".sub!(/./, '\\' + s))
- assert_equal('\k', "foo".sub!(/.../, '\k'))
- assert_raise(RuntimeError) { "foo".sub!(/(?<x>o)/, '\k<x') }
- assert_equal('foo[bar]baz', "foobarbaz".sub!(/(b..)/, '[\0]'))
- assert_equal('foo[foo]baz', "foobarbaz".sub!(/(b..)/, '[\`]'))
- assert_equal('foo[baz]baz', "foobarbaz".sub!(/(b..)/, '[\\\']'))
- assert_equal('foo[r]baz', "foobarbaz".sub!(/(b)(.)(.)/, '[\+]'))
- assert_equal('foo[\\]baz', "foobarbaz".sub!(/(b..)/, '[\\\\]'))
- assert_equal('foo[\z]baz', "foobarbaz".sub!(/(b..)/, '[\z]'))
- end
-
- def test_KCODE
- assert_nil($KCODE)
- assert_nothing_raised { $KCODE = nil }
- assert_equal(false, $=)
- assert_nothing_raised { $= = nil }
- end
-
- def test_match_setter
- /foo/ =~ "foo"
- m = $~
- /bar/ =~ "bar"
- $~ = m
- assert_equal("foo", $&)
- end
-
- def test_last_match
- /(...)(...)(...)(...)?/.match("foobarbaz")
- assert_equal("foobarbaz", Regexp.last_match(0))
- assert_equal("foo", Regexp.last_match(1))
- assert_nil(Regexp.last_match(5))
- assert_nil(Regexp.last_match(-1))
- end
-
- def test_getter
- alias $__REGEXP_TEST_LASTMATCH__ $&
- alias $__REGEXP_TEST_PREMATCH__ $`
- alias $__REGEXP_TEST_POSTMATCH__ $'
- alias $__REGEXP_TEST_LASTPARENMATCH__ $+
- /(b)(.)(.)/.match("foobarbaz")
- assert_equal("bar", $__REGEXP_TEST_LASTMATCH__)
- assert_equal("foo", $__REGEXP_TEST_PREMATCH__)
- assert_equal("baz", $__REGEXP_TEST_POSTMATCH__)
- assert_equal("r", $__REGEXP_TEST_LASTPARENMATCH__)
-
- /(...)(...)(...)/.match("foobarbaz")
- assert_equal("baz", $+)
- end
-
- def test_rindex_regexp
- assert_equal(3, "foobarbaz\u3042".rindex(/b../n, 5))
- end
-
- def test_taint
- m = Thread.new do
- "foo"[/foo/]
- $SAFE = 4
- /foo/.match("foo")
- end.value
- assert(m.tainted?)
- end
-
- def check(re, ss, fs = [])
- re = Regexp.new(re) unless re.is_a?(Regexp)
- ss = [ss] unless ss.is_a?(Array)
- ss.each do |e, s|
- s ||= e
- assert_match(re, s)
- m = re.match(s)
- assert_equal(e, m[0])
- end
- fs = [fs] unless fs.is_a?(Array)
- fs.each {|s| assert_no_match(re, s) }
- end
-
- def failcheck(re)
- assert_raise(RegexpError) { /#{ re }/ }
- end
-
- def test_parse
- check(/\*\+\?\{\}\|\(\)\<\>\`\'/, "*+?{}|()<>`'")
- check(/\A\w\W\z/, %w(a. b!), %w(.. ab))
- check(/\A.\b.\b.\B.\B.\z/, %w(a.aaa .a...), %w(aaaaa .....))
- check(/\A\s\S\z/, [' a', "\n."], [' ', "\n\n", 'a '])
- check(/\A\d\D\z/, '0a', %w(00 aa))
- check(/\A\h\H\z/, %w(0g ag BH), %w(a0 af GG))
- check(/\Afoo\Z\s\z/, "foo\n", ["foo", "foo\nbar"])
- assert_equal(%w(a b c), "abc def".scan(/\G\w/))
- check(/\A\u3042\z/, "\u3042", ["", "\u3043", "a"])
- check(/\A(..)\1\z/, %w(abab ....), %w(abba aba))
- failcheck('\1')
- check(/\A\80\z/, "80", ["\100", ""])
- check(/\A\77\z/, "?")
- check(/\A\78\z/, "\7" + '8', ["\100", ""])
- check(/\A\Qfoo\E\z/, "QfooE")
- check(/\Aa++\z/, "aaa")
- check('\Ax]\z', "x]")
- check(/x#foo/x, "x", "#foo")
- check(/\Ax#foo#{ "\n" }x\z/x, "xx", ["x", "x#foo\nx"])
- check(/\A\p{Alpha}\z/, ["a", "z"], [".", "", ".."])
- check(/\A\p{^Alpha}\z/, [".", "!"], ["!a", ""])
- check(/\A\n\z/, "\n")
- check(/\A\t\z/, "\t")
- check(/\A\r\z/, "\r")
- check(/\A\f\z/, "\f")
- check(/\A\a\z/, "\007")
- check(/\A\e\z/, "\033")
- check(/\A\v\z/, "\v")
- failcheck('(')
- failcheck('(?foo)')
- failcheck('/\p{foobarbazqux}/')
- failcheck('/\p{foobarbazqux' + 'a' * 1000 + '}/')
- failcheck('/[1-\w]/')
- end
-
- def test_exec
- check(/A*B/, %w(B AB AAB AAAB), %w(A))
- check(/\w*!/, %w(! a! ab! abc!), %w(abc))
- check(/\w*\W/, %w(! a" ab# abc$), %w(abc))
- check(/\w*\w/, %w(z az abz abcz), %w(!))
- check(/[a-z]*\w/, %w(z az abz abcz), %w(!))
- check(/[a-z]*\W/, %w(! a" ab# abc$), %w(A))
- check(/((a|bb|ccc|dddd)(1|22|333|4444))/i, %w(a1 bb1 a22), %w(a2 b1))
- check(/\u0080/, (1..4).map {|i| ["\u0080", "\u0080" * i] }, ["\u0081"])
- check(/\u0080\u0080/, (2..4).map {|i| ["\u0080" * 2, "\u0080" * i] }, ["\u0081"])
- check(/\u0080\u0080\u0080/, (3..4).map {|i| ["\u0080" * 3, "\u0080" * i] }, ["\u0081"])
- check(/\u0080\u0080\u0080\u0080/, (4..4).map {|i| ["\u0080" * 4, "\u0080" * i] }, ["\u0081"])
- check(/[^\u3042\u3043\u3044]/, %W(a b \u0080 \u3041 \u3045), %W(\u3042 \u3043 \u3044))
- check(/a.+/m, %W(a\u0080 a\u0080\u0080 a\u0080\u0080\u0080), %W(a))
- check(/a.+z/m, %W(a\u0080z a\u0080\u0080z a\u0080\u0080\u0080z), %W(az))
- check(/abc\B.\Bxyz/, %w(abcXxyz abc0xyz), %w(abc|xyz abc-xyz))
- check(/\Bxyz/, [%w(xyz abcXxyz), %w(xyz abc0xyz)], %w(abc xyz abc-xyz))
- check(/abc\B/, [%w(abc abcXxyz), %w(abc abc0xyz)], %w(abc xyz abc-xyz))
- failcheck('(?<foo>abc)\1')
- check(/^(A+|B+)(?>\g<1>)*[BC]$/, %w(AC BC ABC BAC AABBC), %w(AABB))
- check(/^(A+|B(?>\g<1>)*)[AC]$/, %w(AAAC BBBAAAAC), %w(BBBAAA))
- check(/^()(?>\g<1>)*$/, "", "a")
- check(/^(?>(?=a)(#{ "a" * 1000 }|))++$/, ["a" * 1000, "a" * 2000, "a" * 3000], ["", "a" * 500, "b" * 1000])
- check(eval('/^(?:a?)?$/'), ["", "a"], ["aa"])
- check(eval('/^(?:a+)?$/'), ["", "a", "aa"], ["ab"])
- check(/^(?:a?)+?$/, ["", "a", "aa"], ["ab"])
- check(/^a??[ab]/, [["a", "a"], ["a", "aa"], ["b", "b"], ["a", "ab"]], ["c"])
- check(/^(?:a*){3,5}$/, ["", "a", "aa", "aaa", "aaaa", "aaaaa", "aaaaaa"], ["b"])
- check(/^(?:a+){3,5}$/, ["aaa", "aaaa", "aaaaa", "aaaaaa"], ["", "a", "aa", "b"])
- end
-
- def test_parse_look_behind
- check(/(?<=A)B(?=C)/, [%w(B ABC)], %w(aBC ABc aBc))
- check(/(?<!A)B(?!C)/, [%w(B aBc)], %w(ABC aBC ABc))
- failcheck('(?<=.*)')
- failcheck('(?<!.*)')
- check(/(?<=A|B.)C/, [%w(C AC), %w(C BXC)], %w(C BC))
- check(/(?<!A|B.)C/, [%w(C C), %w(C BC)], %w(AC BXC))
- end
-
- def test_parse_kg
- check(/\A(.)(.)\k<1>(.)\z/, %w(abac abab ....), %w(abcd aaba xxx))
- check(/\A(.)(.)\k<-1>(.)\z/, %w(abbc abba ....), %w(abcd aaba xxx))
- check(/\A(?<n>.)(?<x>\g<n>){0}(?<y>\k<n+0>){0}\g<x>\g<y>\z/, "aba", "abb")
- check(/\A(?<n>.)(?<x>\g<n>){0}(?<y>\k<n+1>){0}\g<x>\g<y>\z/, "abb", "aba")
- check(/\A(?<x>..)\k<x>\z/, %w(abab ....), %w(abac abba xxx))
- check(/\A(.)(..)\g<-1>\z/, "abcde", %w(.... ......))
- failcheck('\k<x>')
- failcheck('\k<')
- failcheck('\k<>')
- failcheck('\k<.>')
- failcheck('\k<x.>')
- failcheck('\k<1.>')
- failcheck('\k<x')
- failcheck('\k<x+')
- failcheck('()\k<-2>')
- failcheck('()\g<-2>')
- check(/\A(?<x>.)(?<x>.)\k<x>\z/, %w(aba abb), %w(abc .. ....))
- check(/\A(?<x>.)(?<x>.)\k<x>\z/i, %w(aba ABa abb ABb), %w(abc .. ....))
- check(/\k\g/, "kg")
- failcheck('(.\g<1>)')
- failcheck('(.\g<2>)')
- failcheck('(?=\g<1>)')
- failcheck('((?=\g<1>))')
- failcheck('(\g<1>|.)')
- failcheck('(.|\g<1>)')
- check(/(!)(?<=(a)|\g<1>)/, ["!"], %w(a))
- check(/^(a|b\g<1>c)$/, %w(a bac bbacc bbbaccc), %w(bbac bacc))
- check(/^(a|b\g<2>c)(B\g<1>C){0}$/, %w(a bBaCc bBbBaCcCc bBbBbBaCcCcCc), %w(bBbBaCcC BbBaCcCc))
- check(/\A(?<n>.|X\g<n>)(?<x>\g<n>){0}(?<y>\k<n+0>){0}\g<x>\g<y>\z/, "XXaXbXXa", %w(XXabXa abb))
- check(/\A(?<n>.|X\g<n>)(?<x>\g<n>){0}(?<y>\k<n+1>){0}\g<x>\g<y>\z/, "XaXXbXXb", %w(aXXbXb aba))
- failcheck('(?<x>)(?<x>)(\g<x>)')
- check(/^(?<x>foo)(bar)\k<x>/, %w(foobarfoo), %w(foobar barfoo))
- check(/^(?<a>f)(?<a>o)(?<a>o)(?<a>b)(?<a>a)(?<a>r)(?<a>b)(?<a>a)(?<a>z)\k<a>{9}$/, %w(foobarbazfoobarbaz foobarbazbazbarfoo foobarbazzabraboof), %w(foobar barfoo))
- end
-
- def test_parse_curly_brace
- check(/\A{/, ["{", ["{", "{x"]])
- check(/\A{ /, ["{ ", ["{ ", "{ x"]])
- check(/\A{,}\z/, "{,}")
- check(/\A{}\z/, "{}")
- check(/\Aa{0}+\z/, "", %w(a aa aab))
- check(/\Aa{1}+\z/, %w(a aa), ["", "aab"])
- check(/\Aa{1,2}b{1,2}\z/, %w(ab aab abb aabb), ["", "aaabb", "abbb"])
- check(/(?!x){0,1}/, [ ['', 'ab'], ['', ''] ])
- check(/c\z{0,1}/, [ ['c', 'abc'], ['c', 'cab']], ['abd'])
- check(/\A{0,1}a/, [ ['a', 'abc'], ['a', '____abc']], ['bcd'])
- failcheck('.{100001}')
- failcheck('.{0,100001}')
- failcheck('.{1,0}')
- failcheck('{0}')
- end
-
- def test_parse_comment
- check(/\A(?#foo\)bar)\z/, "", "a")
- failcheck('(?#')
- end
-
- def test_char_type
- check(/\u3042\d/, ["\u30421", "\u30422"])
-
- # CClassTable cache test
- assert(/\u3042\d/.match("\u30421"))
- assert(/\u3042\d/.match("\u30422"))
- end
-
- def test_char_class
- failcheck('[]')
- failcheck('[x')
- check('\A[]]\z', "]", "")
- check('\A[]\.]+\z', %w(] . ]..]), ["", "["])
- check(/\A[\u3042]\z/, "\u3042", "\u3042aa")
- check(/\A[\u3042\x61]+\z/, ["aa\u3042aa", "\u3042\u3042", "a"], ["", "b"])
- check(/\A[\u3042\x61\x62]+\z/, "abab\u3042abab\u3042")
- check(/\A[abc]+\z/, "abcba", ["", "ada"])
- check(/\A[\w][\W]\z/, %w(a. b!), %w(.. ab))
- check(/\A[\s][\S]\z/, [' a', "\n."], [' ', "\n\n", 'a '])
- check(/\A[\d][\D]\z/, '0a', %w(00 aa))
- check(/\A[\h][\H]\z/, %w(0g ag BH), %w(a0 af GG))
- check(/\A[\p{Alpha}]\z/, ["a", "z"], [".", "", ".."])
- check(/\A[\p{^Alpha}]\z/, [".", "!"], ["!a", ""])
- check(/\A[\xff]\z/, "\xff", ["", "\xfe"])
- check(/\A[\80]+\z/, "8008", ["\\80", "\100", "\1000"])
- check(/\A[\77]+\z/, "???")
- check(/\A[\78]+\z/, "\788\7")
- check(/\A[\0]\z/, "\0")
- check(/\A[[:0]]\z/, [":", "0"], ["", ":0"])
- check(/\A[0-]\z/, ["0", "-"], "0-")
- check('\A[a-&&\w]\z', "a", "-")
- check('\A[--0]\z', ["-", "/", "0"], ["", "1"])
- check('\A[\'--0]\z', %w(* + \( \) 0 ,), ["", ".", "1"])
- check(/\A[a-b-]\z/, %w(a b -), ["", "c"])
- check('\A[a-b-&&\w]\z', %w(a b), ["", "-"])
- check('\A[a-b-&&\W]\z', "-", ["", "a", "b"])
- check('\A[a-c-e]\z', %w(a b c e), %w(- d)) # is it OK?
- check(/\A[a-f&&[^b-c]&&[^e]]\z/, %w(a d f), %w(b c e g 0))
- check(/\A[[^b-c]&&[^e]&&a-f]\z/, %w(a d f), %w(b c e g 0))
- check(/\A[\n\r\t]\z/, ["\n", "\r", "\t"])
- failcheck('[9-1]')
- end
-
- def test_posix_bracket
- check(/\A[[:alpha:]0]\z/, %w(0 a), %w(1 .))
- check(/\A[[:^alpha:]0]\z/, %w(0 1 .), "a")
- check(/\A[[:alpha\:]]\z/, %w(a l p h a :), %w(b 0 1 .))
- check(/\A[[:alpha:foo]0]\z/, %w(0 a), %w(1 .))
- check(/\A[[:xdigit:]&&[:alpha:]]\z/, "a", %w(g 0))
- check('\A[[:abcdefghijklmnopqrstu:]]+\z', "[]")
- failcheck('[[:alpha')
- failcheck('[[:alpha:')
- failcheck('[[:alp:]]')
- end
-
- def test_backward
- assert_equal(3, "foobar".rindex(/b.r/i))
- assert_equal(nil, "foovar".rindex(/b.r/i))
- assert_equal(3, ("foo" + "bar" * 1000).rindex(/#{"bar"*1000}/))
- assert_equal(4, ("foo\nbar\nbaz\n").rindex(/bar/i))
- end
-
- def test_uninitialized
- assert_raise(TypeError) { Regexp.allocate.hash }
- assert_raise(TypeError) { Regexp.allocate.eql? Regexp.allocate }
- assert_raise(TypeError) { Regexp.allocate == Regexp.allocate }
- assert_raise(TypeError) { Regexp.allocate =~ "" }
- assert_equal(false, Regexp.allocate === Regexp.allocate)
- assert_nil(~Regexp.allocate)
- assert_raise(TypeError) { Regexp.allocate.match("") }
- assert_raise(TypeError) { Regexp.allocate.to_s }
- assert_match(/^#<Regexp:.*>$/, Regexp.allocate.inspect)
- assert_raise(TypeError) { Regexp.allocate.source }
- assert_raise(TypeError) { Regexp.allocate.casefold? }
- assert_raise(TypeError) { Regexp.allocate.options }
- assert_equal(Encoding.find("ASCII-8BIT"), Regexp.allocate.encoding)
- assert_equal(false, Regexp.allocate.fixed_encoding?)
- assert_raise(TypeError) { Regexp.allocate.names }
- assert_raise(TypeError) { Regexp.allocate.named_captures }
-
- assert_raise(TypeError) { MatchData.allocate.regexp }
- assert_raise(TypeError) { MatchData.allocate.names }
- assert_raise(TypeError) { MatchData.allocate.size }
- assert_raise(TypeError) { MatchData.allocate.length }
- assert_raise(TypeError) { MatchData.allocate.offset(0) }
- assert_raise(TypeError) { MatchData.allocate.begin(0) }
- assert_raise(TypeError) { MatchData.allocate.end(0) }
- assert_raise(TypeError) { MatchData.allocate.to_a }
- assert_raise(TypeError) { MatchData.allocate[:foo] }
- assert_raise(TypeError) { MatchData.allocate.captures }
- assert_raise(TypeError) { MatchData.allocate.values_at }
- assert_raise(TypeError) { MatchData.allocate.pre_match }
- assert_raise(TypeError) { MatchData.allocate.post_match }
- assert_raise(TypeError) { MatchData.allocate.to_s }
- assert_match(/^#<MatchData:.*>$/, MatchData.allocate.inspect)
- assert_raise(TypeError) { MatchData.allocate.string }
- $~ = MatchData.allocate
- assert_raise(TypeError) { $& }
- assert_raise(TypeError) { $` }
- assert_raise(TypeError) { $' }
- assert_raise(TypeError) { $+ }
- end
-
- def test_unicode
- assert_match(/^\u3042{0}\p{Any}$/, "a")
- assert_match(/^\u3042{0}\p{Any}$/, "\u3041")
- assert_match(/^\u3042{0}\p{Any}$/, "\0")
- assert_no_match(/^\u3042{0}\p{Any}$/, "\0\0")
- assert_no_match(/^\u3042{0}\p{Any}$/, "")
- assert_raise(SyntaxError) { eval('/^\u3042{0}\p{' + "\u3042" + '}$/') }
- assert_raise(SyntaxError) { eval('/^\u3042{0}\p{' + 'a' * 1000 + '}$/') }
- assert_raise(SyntaxError) { eval('/^\u3042{0}\p{foobarbazqux}$/') }
- assert_match(/^(\uff21)(a)\1\2$/i, "\uff21A\uff41a")
- assert_no_match(/^(\uff21)\1$/i, "\uff21A")
- assert_no_match(/^(\uff41)\1$/i, "\uff41a")
- assert_match(/^\u00df$/i, "\u00df")
- assert_match(/^\u00df$/i, "ss")
- #assert_match(/^(\u00df)\1$/i, "\u00dfss") # this must be bug...
- assert_match(/^\u00df{2}$/i, "\u00dfss")
- assert_match(/^\u00c5$/i, "\u00c5")
- assert_match(/^\u00c5$/i, "\u00e5")
- assert_match(/^\u00c5$/i, "\u212b")
- assert_match(/^(\u00c5)\1\1$/i, "\u00c5\u00e5\u212b")
- assert_match(/^\u0149$/i, "\u0149")
- assert_match(/^\u0149$/i, "\u02bcn")
- #assert_match(/^(\u0149)\1$/i, "\u0149\u02bcn") # this must be bug...
- assert_match(/^\u0149{2}$/i, "\u0149\u02bcn")
- assert_match(/^\u0390$/i, "\u0390")
- assert_match(/^\u0390$/i, "\u03b9\u0308\u0301")
- #assert_match(/^(\u0390)\1$/i, "\u0390\u03b9\u0308\u0301") # this must be bug...
- assert_match(/^\u0390{2}$/i, "\u0390\u03b9\u0308\u0301")
- assert_match(/^\ufb05$/i, "\ufb05")
- assert_match(/^\ufb05$/i, "\ufb06")
- assert_match(/^\ufb05$/i, "st")
- #assert_match(/^(\ufb05)\1\1$/i, "\ufb05\ufb06st") # this must be bug...
- assert_match(/^\ufb05{3}$/i, "\ufb05\ufb06st")
- assert_match(/^\u03b9\u0308\u0301$/i, "\u0390")
- assert_nothing_raised { 0x03ffffff.chr("utf-8").size }
- assert_nothing_raised { 0x7fffffff.chr("utf-8").size }
- end
-end
diff --git a/test/ruby/test_require.rb b/test/ruby/test_require.rb
deleted file mode 100644
index a1726bf63b..0000000000
--- a/test/ruby/test_require.rb
+++ /dev/null
@@ -1,247 +0,0 @@
-require 'test/unit'
-
-require 'tempfile'
-require_relative 'envutil'
-
-class TestRequire < Test::Unit::TestCase
- def test_require_invalid_shared_object
- t = Tempfile.new(["test_ruby_test_require", ".so"])
- t.puts "dummy"
- t.close
-
- assert_in_out_err([], <<-INPUT, %w(:ok), [])
- begin
- require \"#{ t.path }\"
- rescue LoadError
- p :ok
- end
- INPUT
- end
-
- def test_require_too_long_filename
- assert_in_out_err([], <<-INPUT, %w(:ok), [])
- begin
- require '#{ "foo/" * 10000 }foo'
- rescue LoadError
- p :ok
- end
- INPUT
-
- begin
- assert_in_out_err(["-S", "foo/" * 10000 + "foo"], "") do |r, e|
- assert_equal([], r)
- assert_operator(2, :<=, e.size)
- assert_equal("openpath: pathname too long (ignored)", e.first)
- assert_match(/\(LoadError\)/, e.last)
- end
- rescue Errno::EINVAL
- # too long commandline may be blocked by OS.
- end
- end
-
- def test_require_path_home
- env_rubypath, env_home = ENV["RUBYPATH"], ENV["HOME"]
-
- ENV["RUBYPATH"] = "~"
- ENV["HOME"] = "/foo" * 10000
- assert_in_out_err(%w(-S test_ruby_test_require), "", [], /^.+$/)
-
- ENV["RUBYPATH"] = "~" + "/foo" * 10000
- ENV["HOME"] = "/foo"
- assert_in_out_err(%w(-S test_ruby_test_require), "", [], /^.+$/)
-
- t = Tempfile.new(["test_ruby_test_require", ".rb"])
- t.puts "p :ok"
- t.close
- ENV["RUBYPATH"] = "~"
- ENV["HOME"], name = File.split(t.path)
- assert_in_out_err(["-S", name], "", %w(:ok), [])
-
- ensure
- env_rubypath ? ENV["RUBYPATH"] = env_rubypath : ENV.delete("RUBYPATH")
- env_home ? ENV["HOME"] = env_home : ENV.delete("HOME")
- end
-
- def test_define_class
- begin
- require "socket"
- rescue LoadError
- return
- end
-
- assert_in_out_err([], <<-INPUT, %w(:ok), [])
- BasicSocket = 1
- begin
- require 'socket'
- p :ng
- rescue TypeError
- p :ok
- end
- INPUT
-
- assert_in_out_err([], <<-INPUT, %w(:ok), [])
- class BasicSocket; end
- begin
- require 'socket'
- p :ng
- rescue NameError
- p :ok
- end
- INPUT
-
- assert_in_out_err([], <<-INPUT, %w(:ok), [])
- class BasicSocket < IO; end
- begin
- require 'socket'
- p :ok
- rescue Exception
- p :ng
- end
- INPUT
- end
-
- def test_define_class_under
- begin
- require "zlib"
- rescue LoadError
- return
- end
-
- assert_in_out_err([], <<-INPUT, %w(:ok), [])
- module Zlib; end
- Zlib::Error = 1
- begin
- require 'zlib'
- p :ng
- rescue TypeError
- p :ok
- end
- INPUT
-
- assert_in_out_err([], <<-INPUT, %w(:ok), [])
- module Zlib; end
- class Zlib::Error; end
- begin
- require 'zlib'
- p :ng
- rescue NameError
- p :ok
- end
- INPUT
-
- assert_in_out_err([], <<-INPUT, %w(:ok), [])
- module Zlib; end
- class Zlib::Error < StandardError; end
- begin
- require 'zlib'
- p :ok
- rescue Exception
- p :ng
- end
- INPUT
- end
-
- def test_define_module
- begin
- require "zlib"
- rescue LoadError
- return
- end
-
- assert_in_out_err([], <<-INPUT, %w(:ok), [])
- Zlib = 1
- begin
- require 'zlib'
- p :ng
- rescue TypeError
- p :ok
- end
- INPUT
- end
-
- def test_define_module_under
- begin
- require "socket"
- rescue LoadError
- return
- end
-
- assert_in_out_err([], <<-INPUT, %w(:ok), [])
- class BasicSocket < IO; end
- class Socket < BasicSocket; end
- Socket::Constants = 1
- begin
- require 'socket'
- p :ng
- rescue TypeError
- p :ok
- end
- INPUT
- end
-
- def test_load
- t = Tempfile.new(["test_ruby_test_require", ".rb"])
- t.puts "module Foo; end"
- t.puts "at_exit { p :wrap_end }"
- t.puts "at_exit { raise 'error in at_exit test' }"
- t.puts "p :ok"
- t.close
-
- assert_in_out_err([], <<-INPUT, %w(:ok :end :wrap_end), /error in at_exit test/)
- load(#{ t.path.dump }, true)
- GC.start
- p :end
- INPUT
-
- assert_raise(ArgumentError) { at_exit }
- end
-
- def test_tainted_loadpath
- t = Tempfile.new(["test_ruby_test_require", ".rb"])
- abs_dir, file = File.dirname(t.path), File.basename(t.path)
- abs_dir = File.expand_path(abs_dir).untaint
-
- assert_in_out_err([], <<-INPUT, %w(:ok), [])
- abs_dir = "#{ abs_dir }"
- $: << abs_dir
- require "#{ file }"
- p :ok
- INPUT
-
- assert_in_out_err([], <<-INPUT, %w(:ok), [])
- abs_dir = "#{ abs_dir }"
- $: << abs_dir.taint
- require "#{ file }"
- p :ok
- INPUT
-
- assert_in_out_err([], <<-INPUT, %w(:ok), [])
- abs_dir = "#{ abs_dir }"
- $: << abs_dir.taint
- $SAFE = 1
- begin
- require "#{ file }"
- rescue SecurityError
- p :ok
- end
- INPUT
-
- assert_in_out_err([], <<-INPUT, %w(:ok), [])
- abs_dir = "#{ abs_dir }"
- $: << abs_dir.taint
- $SAFE = 1
- begin
- require "#{ file }"
- rescue SecurityError
- p :ok
- end
- INPUT
-
- assert_in_out_err([], <<-INPUT, %w(:ok), [])
- abs_dir = "#{ abs_dir }"
- $: << abs_dir << 'elsewhere'.taint
- require "#{ file }"
- p :ok
- INPUT
- end
-end
diff --git a/test/ruby/test_rubyoptions.rb b/test/ruby/test_rubyoptions.rb
deleted file mode 100644
index 59be99164a..0000000000
--- a/test/ruby/test_rubyoptions.rb
+++ /dev/null
@@ -1,294 +0,0 @@
-require 'test/unit'
-
-require 'tmpdir'
-require 'tempfile'
-require_relative 'envutil'
-
-class TestRubyOptions < Test::Unit::TestCase
- def test_source_file
- assert_in_out_err([], "", [], [])
- end
-
- def test_usage
- assert_in_out_err(%w(-h)) do |r, e|
- assert_operator(r.size, :<=, 24)
- assert_equal([], e)
- end
-
- assert_in_out_err(%w(--help)) do |r, e|
- assert_operator(r.size, :<=, 24)
- assert_equal([], e)
- end
- end
-
- def test_option_variables
- assert_in_out_err(["-e", 'p [$-p, $-l, $-a]']) do |r, e|
- assert_equal(["[false, false, false]"], r)
- assert_equal([], e)
- end
-
- assert_in_out_err(%w(-p -l -a -e) + ['p [$-p, $-l, $-a]'],
- "foo\nbar\nbaz\n") do |r, e|
- assert_equal(
- [ '[true, true, true]', 'foo',
- '[true, true, true]', 'bar',
- '[true, true, true]', 'baz' ], r)
- assert_equal([], e)
- end
- end
-
- def test_warning
- assert_in_out_err(%w(-W0 -e) + ['p $-W'], "", %w(0), [])
- assert_in_out_err(%w(-W1 -e) + ['p $-W'], "", %w(1), [])
- assert_in_out_err(%w(-Wx -e) + ['p $-W'], "", %w(1), [])
- assert_in_out_err(%w(-W -e) + ['p $-W'], "", %w(2), [])
- end
-
- def test_safe_level
- assert_in_out_err(%w(-T -e) + [""], "", [],
- /no -e allowed in tainted mode \(SecurityError\)/)
-
- assert_in_out_err(%w(-T4 -S foo.rb), "", [],
- /no -S allowed in tainted mode \(SecurityError\)/)
- end
-
- def test_debug
- assert_in_out_err(%w(-de) + ["p $DEBUG"], "", %w(true), [])
-
- assert_in_out_err(%w(--debug -e) + ["p $DEBUG"], "", %w(true), [])
- end
-
- def test_verbose
- assert_in_out_err(%w(-vve) + [""]) do |r, e|
- assert_match(/^ruby #{RUBY_VERSION}(?:[p ]|dev).*? \[#{RUBY_PLATFORM}\]$/, r.join)
- assert_equal RUBY_DESCRIPTION, r.join.chomp
- assert_equal([], e)
- end
-
- assert_in_out_err(%w(--verbose -e) + ["p $VERBOSE"], "", %w(true), [])
-
- assert_in_out_err(%w(--verbose), "", [], [])
- end
-
- def test_copyright
- assert_in_out_err(%w(--copyright), "",
- /^ruby - Copyright \(C\) 1993-\d+ Yukihiro Matsumoto$/, [])
-
- assert_in_out_err(%w(--verbose -e) + ["p $VERBOSE"], "", %w(true), [])
- end
-
- def test_enable
- assert_in_out_err(%w(--enable all -e) + [""], "", [], [])
- assert_in_out_err(%w(--enable-all -e) + [""], "", [], [])
- assert_in_out_err(%w(--enable=all -e) + [""], "", [], [])
- assert_in_out_err(%w(--enable foobarbazqux -e) + [""], "", [],
- /unknown argument for --enable: `foobarbazqux'/)
- assert_in_out_err(%w(--enable), "", [], /missing argument for --enable/)
- end
-
- def test_disable
- assert_in_out_err(%w(--disable all -e) + [""], "", [], [])
- assert_in_out_err(%w(--disable-all -e) + [""], "", [], [])
- assert_in_out_err(%w(--disable=all -e) + [""], "", [], [])
- assert_in_out_err(%w(--disable foobarbazqux -e) + [""], "", [],
- /unknown argument for --disable: `foobarbazqux'/)
- assert_in_out_err(%w(--disable), "", [], /missing argument for --disable/)
- end
-
- def test_kanji
- assert_in_out_err(%w(-KU), "p '\u3042'") do |r, e|
- assert_equal("\"\u3042\"", r.join.force_encoding(Encoding::UTF_8))
- end
- assert_in_out_err(%w(-KE -e) + [""], "", [], [])
- assert_in_out_err(%w(-KS -e) + [""], "", [], [])
- assert_in_out_err(%w(-KN -e) + [""], "", [], [])
- end
-
- def test_version
- assert_in_out_err(%w(--version)) do |r, e|
- assert_match(/^ruby #{RUBY_VERSION}(?:[p ]|dev).*? \[#{RUBY_PLATFORM}\]$/, r.join)
- assert_equal RUBY_DESCRIPTION, r.join.chomp
- assert_equal([], e)
- end
- end
-
- def test_eval
- assert_in_out_err(%w(-e), "", [], /no code specified for -e \(RuntimeError\)/)
- end
-
- def test_require
- require "pp"
- assert_in_out_err(%w(-r pp -e) + ["pp 1"], "", %w(1), [])
- assert_in_out_err(%w(-rpp -e) + ["pp 1"], "", %w(1), [])
- rescue LoadError
- end
-
- def test_include
- d = Dir.tmpdir
- assert_in_out_err(["-I" + d, "-e", ""], "", [], [])
- assert_in_out_err(["-I", d, "-e", ""], "", [], [])
- end
-
- def test_separator
- assert_in_out_err(%w(-000 -e) + ["print gets"], "foo\nbar\0baz", %W(foo bar\0baz), [])
-
- assert_in_out_err(%w(-0141 -e) + ["print gets"], "foo\nbar\0baz", %w(foo ba), [])
-
- assert_in_out_err(%w(-0e) + ["print gets"], "foo\nbar\0baz", %W(foo bar\0), [])
- end
-
- def test_autosplit
- assert_in_out_err(%w(-an -F: -e) + ["p $F"], "foo:bar:baz\nqux:quux:quuux\n",
- ['["foo", "bar", "baz\n"]', '["qux", "quux", "quuux\n"]'], [])
- end
-
- def test_chdir
- assert_in_out_err(%w(-C), "", [], /Can't chdir/)
-
- assert_in_out_err(%w(-C test_ruby_test_rubyoptions_foobarbazqux), "", [], /Can't chdir/)
-
- d = Dir.tmpdir
- assert_in_out_err(["-C", d, "-e", "puts Dir.pwd"]) do |r, e|
- assert(File.identical?(r.join, d))
- assert_equal([], e)
- end
- end
-
- def test_yydebug
- assert_in_out_err(["-ye", ""]) do |r, e|
- assert_equal([], r)
- assert_not_equal([], e)
- end
-
- assert_in_out_err(%w(--yydebug -e) + [""]) do |r, e|
- assert_equal([], r)
- assert_not_equal([], e)
- end
- end
-
- def test_encoding
- assert_in_out_err(%w(-Eutf-8), "p '\u3042'", [], /invalid multibyte char/)
-
- assert_in_out_err(%w(--encoding), "", [], /missing argument for --encoding/)
-
- assert_in_out_err(%w(--encoding test_ruby_test_rubyoptions_foobarbazqux), "", [],
- /unknown encoding name - test_ruby_test_rubyoptions_foobarbazqux \(RuntimeError\)/)
-
- assert_in_out_err(%w(--encoding utf-8), "p '\u3042'", [], /invalid multibyte char/)
- end
-
- def test_syntax_check
- assert_in_out_err(%w(-c -e 1+1), "", ["Syntax OK"], [])
- end
-
- def test_invalid_option
- assert_in_out_err(%w(--foobarbazqux), "", [], /invalid option --foobarbazqux/)
-
- assert_in_out_err(%W(-\r -e) + [""], "", [], [])
-
- assert_in_out_err(%W(-\rx), "", [], /invalid option -\\x0D \(-h will show valid options\) \(RuntimeError\)/)
-
- assert_in_out_err(%W(-\x01), "", [], /invalid option -\\x01 \(-h will show valid options\) \(RuntimeError\)/)
-
- assert_in_out_err(%w(-Z), "", [], /invalid option -Z \(-h will show valid options\) \(RuntimeError\)/)
- end
-
- def test_rubyopt
- rubyopt_orig = ENV['RUBYOPT']
-
- ENV['RUBYOPT'] = ' - -'
- assert_in_out_err([], "", [], [])
-
- ENV['RUBYOPT'] = '-e "p 1"'
- assert_in_out_err([], "", [], /invalid switch in RUBYOPT: -e \(RuntimeError\)/)
-
- ENV['RUBYOPT'] = '-T1'
- assert_in_out_err([], "", [], /no program input from stdin allowed in tainted mode \(SecurityError\)/)
-
- ENV['RUBYOPT'] = '-T4'
- assert_in_out_err([], "", [], /no program input from stdin allowed in tainted mode \(SecurityError\)/)
-
- ENV['RUBYOPT'] = '-Eus-ascii -KN'
- assert_in_out_err(%w(-Eutf-8 -KU), "p '\u3042'") do |r, e|
- assert_equal("\"\u3042\"", r.join.force_encoding(Encoding::UTF_8))
- assert_equal([], e)
- end
-
- ensure
- if rubyopt_orig
- ENV['RUBYOPT'] = rubyopt_orig
- else
- ENV.delete('RUBYOPT')
- end
- end
-
- def test_search
- rubypath_orig = ENV['RUBYPATH']
- path_orig = ENV['PATH']
-
- t = Tempfile.new(["test_ruby_test_rubyoption", ".rb"])
- t.puts "p 1"
- t.close
-
- @verbose = $VERBOSE
- $VERBOSE = nil
-
- ENV['PATH'] = File.dirname(t.path)
-
- assert_in_out_err(%w(-S) + [File.basename(t.path)], "", %w(1), [])
-
- ENV['RUBYPATH'] = File.dirname(t.path)
-
- assert_in_out_err(%w(-S) + [File.basename(t.path)], "", %w(1), [])
-
- ensure
- if rubypath_orig
- ENV['RUBYPATH'] = rubypath_orig
- else
- ENV.delete('RUBYPATH')
- end
- if path_orig
- ENV['PATH'] = path_orig
- else
- ENV.delete('PATH')
- end
- t.close(true) if t
- $VERBOSE = @verbose
- end
-
- def test_shebang
- assert_in_out_err([], "#! /test_r_u_b_y_test_r_u_b_y_options_foobarbazqux\r\np 1\r\n",
- [], /Can't exec [\/\\]test_r_u_b_y_test_r_u_b_y_options_foobarbazqux \(fatal\)/)
-
- assert_in_out_err([], "#! /test_r_u_b_y_test_r_u_b_y_options_foobarbazqux -foo -bar\r\np 1\r\n",
- [], /Can't exec [\/\\]test_r_u_b_y_test_r_u_b_y_options_foobarbazqux \(fatal\)/)
-
- assert_in_out_err([], "#!ruby -KU -Eutf-8\r\np \"\u3042\"\r\n") do |r, e|
- assert_equal("\"\u3042\"", r.join.force_encoding(Encoding::UTF_8))
- assert_equal([], e)
- end
- end
-
- def test_sflag
- assert_in_out_err(%w(- -abc -def=foo -ghi-jkl -- -xyz),
- "#!ruby -s\np [$abc, $def, $ghi_jkl, $xyz]\n",
- ['[true, "foo", true, nil]'], [])
-
- assert_in_out_err(%w(- -#), "#!ruby -s\n", [],
- /invalid name for global variable - -# \(NameError\)/)
-
- assert_in_out_err(%w(- -#=foo), "#!ruby -s\n", [],
- /invalid name for global variable - -# \(NameError\)/)
- end
-
- def test_indentation_check
- t = Tempfile.new(["test_ruby_test_rubyoption", ".rb"])
- t.puts "begin"
- t.puts " end"
- t.close
- assert_in_out_err(["-w", t.path], "", [], /:2: warning: mismatched indentations at 'end' with 'begin' at 1/)
- assert_in_out_err(["-wr", t.path, "-e", ""], "", [], /:2: warning: mismatched indentations at 'end' with 'begin' at 1/)
- ensure
- t.close(true) if t
- end
-end
diff --git a/test/ruby/test_settracefunc.rb b/test/ruby/test_settracefunc.rb
index 5898ce488d..14d6679407 100644
--- a/test/ruby/test_settracefunc.rb
+++ b/test/ruby/test_settracefunc.rb
@@ -1,189 +1,138 @@
require 'test/unit'
class TestSetTraceFunc < Test::Unit::TestCase
- def setup
- @original_compile_option = RubyVM::InstructionSequence.compile_option
- RubyVM::InstructionSequence.compile_option = {
- :trace_instruction => true,
- :specialized_instruction => false
- }
- end
-
- def teardown
- set_trace_func(nil)
- RubyVM::InstructionSequence.compile_option = @original_compile_option
- end
+ def foo; end;
- def test_c_call
+ def bar
events = []
- eval <<-EOF.gsub(/^.*?: /, "")
- 1: set_trace_func(Proc.new { |event, file, lineno, mid, binding, klass|
- 2: events << [event, lineno, mid, klass]
- 3: })
- 4: x = 1 + 1
- 5: set_trace_func(nil)
- EOF
- assert_equal(["c-return", 3, :set_trace_func, Kernel],
- events.shift)
- assert_equal(["line", 4, __method__, self.class],
- events.shift)
- assert_equal(["c-call", 4, :+, Fixnum],
- events.shift)
- assert_equal(["c-return", 4, :+, Fixnum],
- events.shift)
- assert_equal(["line", 5, __method__, self.class],
- events.shift)
- assert_equal(["c-call", 5, :set_trace_func, Kernel],
- events.shift)
- assert_equal([], events)
+ set_trace_func(Proc.new { |event, file, lineno, mid, bidning, klass|
+ events << [event, lineno, mid, klass]
+ })
+ return events
end
- def test_call
+ def test_event
events = []
- eval <<-EOF.gsub(/^.*?: /, "")
- 1: set_trace_func(Proc.new { |event, file, lineno, mid, binding, klass|
- 2: events << [event, lineno, mid, klass]
- 3: })
- 4: def add(x, y)
- 5: x + y
- 6: end
- 7: x = add(1, 1)
- 8: set_trace_func(nil)
- EOF
- assert_equal(["c-return", 3, :set_trace_func, Kernel],
- events.shift)
- assert_equal(["line", 4, __method__, self.class],
- events.shift)
- assert_equal(["c-call", 4, :method_added, Module],
- events.shift)
- assert_equal(["c-return", 4, :method_added, Module],
- events.shift)
- assert_equal(["line", 7, __method__, self.class],
- events.shift)
- assert_equal(["call", 4, :add, self.class],
- events.shift)
- assert_equal(["line", 5, :add, self.class],
- events.shift)
- assert_equal(["c-call", 5, :+, Fixnum],
- events.shift)
- assert_equal(["c-return", 5, :+, Fixnum],
- events.shift)
- assert_equal(["return", 4, :add, self.class],
- events.shift)
- assert_equal(["line", 8, __method__, self.class],
- events.shift)
- assert_equal(["c-call", 8, :set_trace_func, Kernel],
- events.shift)
- assert_equal([], events)
- end
+ set_trace_func(Proc.new { |event, file, lineno, mid, bidning, klass|
+ events << [event, lineno, mid, klass]
+ })
+ a = 1
+ foo
+ a
+ b = 1 + 2
+ if b == 3
+ case b
+ when 2
+ c = "b == 2"
+ when 3
+ c = "b == 3"
+ end
+ end
+ begin
+ raise "error"
+ rescue
+ end
+ eval("class Foo; end")
+ set_trace_func nil
- def test_class
- events = []
- eval <<-EOF.gsub(/^.*?: /, "")
- 1: set_trace_func(Proc.new { |event, file, lineno, mid, binding, klass|
- 2: events << [event, lineno, mid, klass]
- 3: })
- 4: class Foo
- 5: def bar
- 6: end
- 7: end
- 8: x = Foo.new.bar
- 9: set_trace_func(nil)
- EOF
- assert_equal(["c-return", 3, :set_trace_func, Kernel],
- events.shift)
- assert_equal(["line", 4, __method__, self.class],
- events.shift)
- assert_equal(["c-call", 4, :inherited, Class],
- events.shift)
- assert_equal(["c-return", 4, :inherited, Class],
- events.shift)
- assert_equal(["class", 7, nil, nil],
- events.shift)
- assert_equal(["line", 5, nil, nil],
- events.shift)
- assert_equal(["c-call", 5, :method_added, Module],
- events.shift)
- assert_equal(["c-return", 5, :method_added, Module],
- events.shift)
- assert_equal(["end", 7, nil, nil],
- events.shift)
- assert_equal(["line", 8, __method__, self.class],
- events.shift)
- assert_equal(["c-call", 8, :new, Class],
- events.shift)
- assert_equal(["c-call", 8, :initialize, BasicObject],
- events.shift)
- assert_equal(["c-return", 8, :initialize, BasicObject],
- events.shift)
- assert_equal(["c-return", 8, :new, Class],
- events.shift)
- assert_equal(["call", 5, :bar, Foo],
- events.shift)
- assert_equal(["return", 5, :bar, Foo],
- events.shift)
- assert_equal(["line", 9, __method__, self.class],
- events.shift)
- assert_equal(["c-call", 9, :set_trace_func, Kernel],
- events.shift)
+ assert_equal(["line", 19, :test_event, TestSetTraceFunc],
+ events.shift) # a = 1
+ assert_equal(["line", 20, :test_event, TestSetTraceFunc],
+ events.shift) # foo
+ assert_equal(["call", 4, :foo, TestSetTraceFunc],
+ events.shift) # foo
+ assert_equal(["return", 4, :foo, TestSetTraceFunc],
+ events.shift) # foo
+ assert_equal(["line", 21, :test_event, TestSetTraceFunc],
+ events.shift) # a
+ assert_equal(["line", 22, :test_event, TestSetTraceFunc],
+ events.shift) # b = 1 + 2
+ assert_equal(["c-call", 22, :+, Fixnum],
+ events.shift) # 1 + 2
+ assert_equal(["c-return", 22, :+, Fixnum],
+ events.shift) # 1 + 2
+ assert_equal(["line", 23, :test_event, TestSetTraceFunc],
+ events.shift) # if b == 3
+ assert_equal(["c-call", 23, :==, Fixnum],
+ events.shift) # b == 3
+ assert_equal(["c-return", 23, :==, Fixnum],
+ events.shift) # b == 3
+ assert_equal(["line", 23, :test_event, TestSetTraceFunc],
+ events.shift) # if b == 3
+ assert_equal(["line", 24, :test_event, TestSetTraceFunc],
+ events.shift) # case b
+ assert_equal(["line", 25, :test_event, TestSetTraceFunc],
+ events.shift) # when 2
+ assert_equal(["c-call", 25, :===, Kernel],
+ events.shift) # when 2
+ assert_equal(["c-call", 25, :==, Fixnum],
+ events.shift) # when 2
+ assert_equal(["c-return", 25, :==, Fixnum],
+ events.shift) # when 2
+ assert_equal(["c-return", 25, :===, Kernel],
+ events.shift) # when 2
+ assert_equal(["line", 27, :test_event, TestSetTraceFunc],
+ events.shift) # when 3
+ assert_equal(["c-call", 27, :===, Kernel],
+ events.shift) # when 3
+ assert_equal(["c-return", 27, :===, Kernel],
+ events.shift) # when 3
+ assert_equal(["line", 28, :test_event, TestSetTraceFunc],
+ events.shift) # c = "b == 3"
+ assert_equal(["line", 31, :test_event, TestSetTraceFunc],
+ events.shift) # begin
+ assert_equal(["line", 32, :test_event, TestSetTraceFunc],
+ events.shift) # raise "error"
+ assert_equal(["c-call", 32, :raise, Kernel],
+ events.shift) # raise "error"
+ assert_equal(["c-call", 32, :new, Class],
+ events.shift) # raise "error"
+ assert_equal(["c-call", 32, :initialize, Exception],
+ events.shift) # raise "error"
+ assert_equal(["c-return", 32, :initialize, Exception],
+ events.shift) # raise "error"
+ assert_equal(["c-return", 32, :new, Class],
+ events.shift) # raise "error"
+ assert_equal(["c-call", 32, :backtrace, Exception],
+ events.shift) # raise "error"
+ assert_equal(["c-return", 32, :backtrace, Exception],
+ events.shift) # raise "error"
+ assert_equal(["c-call", 32, :set_backtrace, Exception],
+ events.shift) # raise "error"
+ assert_equal(["c-return", 32, :set_backtrace, Exception],
+ events.shift) # raise "error"
+ assert_equal(["raise", 32, :test_event, TestSetTraceFunc],
+ events.shift) # raise "error"
+ assert_equal(["c-return", 32, :raise, Kernel],
+ events.shift) # raise "error"
+ assert_equal(["line", 35, :test_event, TestSetTraceFunc],
+ events.shift) # eval(<<EOF)
+ assert_equal(["c-call", 35, :eval, Kernel],
+ events.shift) # eval(<<EOF)
+ assert_equal(["line", 1, :test_event, TestSetTraceFunc],
+ events.shift) # class Foo
+ assert_equal(["c-call", 1, :inherited, Class],
+ events.shift) # class Foo
+ assert_equal(["c-return", 1, :inherited, Class],
+ events.shift) # class Foo
+ assert_equal(["class", 1, :test_event, TestSetTraceFunc],
+ events.shift) # class Foo
+ assert_equal(["end", 1, :test_event, TestSetTraceFunc],
+ events.shift) # class Foo
+ assert_equal(["c-return", 35, :eval, Kernel],
+ events.shift) # eval(<<EOF)
+ assert_equal(["line", 36, :test_event, TestSetTraceFunc],
+ events.shift) # set_trace_func nil
+ assert_equal(["c-call", 36, :set_trace_func, Kernel],
+ events.shift) # set_trace_func nil
assert_equal([], events)
- end
- def test_raise
- events = []
- eval <<-EOF.gsub(/^.*?: /, "")
- 1: set_trace_func(Proc.new { |event, file, lineno, mid, binding, klass|
- 2: events << [event, lineno, mid, klass]
- 3: })
- 4: begin
- 5: raise TypeError, "error"
- 6: rescue TypeError
- 7: end
- 8: set_trace_func(nil)
- EOF
- assert_equal(["c-return", 3, :set_trace_func, Kernel],
- events.shift)
- assert_equal(["line", 4, __method__, self.class],
- events.shift)
- assert_equal(["line", 5, __method__, self.class],
- events.shift)
- assert_equal(["c-call", 5, :raise, Kernel],
- events.shift)
- assert_equal(["c-call", 5, :exception, Exception],
- events.shift)
- assert_equal(["c-call", 5, :initialize, Exception],
- events.shift)
- assert_equal(["c-return", 5, :initialize, Exception],
- events.shift)
- assert_equal(["c-return", 5, :exception, Exception],
- events.shift)
- assert_equal(["c-call", 5, :backtrace, Exception],
- events.shift)
- assert_equal(["c-return", 5, :backtrace, Exception],
- events.shift)
- assert_equal(["c-call", 5, :set_backtrace, Exception],
- events.shift)
- assert_equal(["c-return", 5, :set_backtrace, Exception],
- events.shift)
- assert_equal(["raise", 5, :test_raise, TestSetTraceFunc],
- events.shift)
- assert_equal(["c-call", 6, :===, Module],
- events.shift)
- assert_equal(["c-return", 6, :===, Module],
- events.shift)
- assert_equal(["line", 8, __method__, self.class],
- events.shift)
- assert_equal(["c-call", 8, :set_trace_func, Kernel],
- events.shift)
+ events = bar
+ set_trace_func(nil)
+ assert_equal(["line", 11, :bar, TestSetTraceFunc], events.shift)
+ assert_equal(["return", 11, :bar, TestSetTraceFunc], events.shift)
+ assert_equal(["line", 131, :test_event, TestSetTraceFunc], events.shift)
+ assert_equal(["c-call", 131, :set_trace_func, Kernel], events.shift)
assert_equal([], events)
end
-
- def test_invalid_proc
- assert_raise(TypeError) { set_trace_func(1) }
- end
-
- def test_raise_in_trace
- set_trace_func proc {raise rescue nil}
- assert_equal(42, (raise rescue 42), '[ruby-core:24118]')
- end
end
diff --git a/test/ruby/test_signal.rb b/test/ruby/test_signal.rb
index 9414b6539e..43e16b8c79 100644
--- a/test/ruby/test_signal.rb
+++ b/test/ruby/test_signal.rb
@@ -4,31 +4,32 @@ require 'timeout'
class TestSignal < Test::Unit::TestCase
def have_fork?
begin
- Process.fork {}
- return true
+ fork{}
+ true
rescue NotImplementedError
- return false
+ false
end
end
def test_signal
- return unless Process.respond_to?(:kill)
+ defined?(Process.kill) or return
begin
- x = 0
- oldtrap = Signal.trap(:INT) {|sig| x = 2 }
- Process.kill :INT, Process.pid
+ $x = 0
+ oldtrap = trap "SIGINT", proc{|sig| $x = 2}
+ Process.kill "SIGINT", $$
sleep 0.1
- assert_equal 2, x
+ assert_equal(2, $x)
- Signal.trap(:INT) { raise "Interrupt" }
- ex = assert_raise(RuntimeError) {
- Process.kill :INT, Process.pid
+ trap "SIGINT", proc{raise "Interrupt"}
+
+ x = assert_raises(RuntimeError) do
+ Process.kill "SIGINT", $$
sleep 0.1
- }
- assert_kind_of Exception, ex
- assert_match(/Interrupt/, ex.message)
+ end
+ assert(x)
+ assert_match(/Interrupt/, x.message)
ensure
- Signal.trap :INT, oldtrap if oldtrap
+ trap "SIGINT", oldtrap
end
end
@@ -37,11 +38,11 @@ class TestSignal < Test::Unit::TestCase
begin
r, w = IO.pipe
r0, w0 = IO.pipe
- pid = Process.fork {
- Signal.trap(:USR1, "EXIT")
+ pid = fork {
+ trap(:USR1, "EXIT")
w0.close
w.syswrite("a")
- Thread.start { sleep(2) }
+ Thread.start { Thread.pass }
r0.sysread(4096)
}
r.sysread(1)
@@ -49,7 +50,7 @@ class TestSignal < Test::Unit::TestCase
assert_nothing_raised("[ruby-dev:26128]") {
Process.kill(:USR1, pid)
begin
- Timeout.timeout(3) {
+ Timeout.timeout(10) {
Process.waitpid pid
}
rescue Timeout::Error
@@ -64,103 +65,4 @@ class TestSignal < Test::Unit::TestCase
w0.close
end
end
-
- def test_invalid_signal_name
- return unless Process.respond_to?(:kill)
-
- assert_raise(ArgumentError) { Process.kill(:XXXXXXXXXX, $$) }
- end
-
- def test_signal_exception
- assert_raise(ArgumentError) { SignalException.new }
- assert_raise(ArgumentError) { SignalException.new(-1) }
- assert_raise(ArgumentError) { SignalException.new(:XXXXXXXXXX) }
- Signal.list.each do |signm, signo|
- next if signm == "EXIT"
- assert_equal(SignalException.new(signm).signo, signo)
- assert_equal(SignalException.new(signm.to_sym).signo, signo)
- assert_equal(SignalException.new(signo).signo, signo)
- end
- end
-
- def test_interrupt
- assert_raise(Interrupt) { raise Interrupt.new }
- end
-
- def test_signal2
- return unless Process.respond_to?(:kill)
- begin
- x = false
- oldtrap = Signal.trap(:INT) {|sig| x = true }
- GC.start
-
- assert_raise(ArgumentError) { Process.kill }
-
- Timeout.timeout(10) do
- x = false
- Process.kill(SignalException.new(:INT).signo, $$)
- nil until x
-
- x = false
- Process.kill("INT", $$)
- nil until x
-
- x = false
- Process.kill("SIGINT", $$)
- nil until x
-
- x = false
- o = Object.new
- def o.to_str; "SIGINT"; end
- Process.kill(o, $$)
- nil until x
- end
-
- assert_raise(ArgumentError) { Process.kill(Object.new, $$) }
-
- ensure
- Signal.trap(:INT, oldtrap) if oldtrap
- end
- end
-
- def test_trap
- return unless Process.respond_to?(:kill)
- begin
- oldtrap = Signal.trap(:INT) {|sig| }
-
- assert_raise(ArgumentError) { Signal.trap }
-
- assert_raise(SecurityError) do
- s = proc {}.taint
- Signal.trap(:INT, s)
- end
-
- # FIXME!
- Signal.trap(:INT, nil)
- Signal.trap(:INT, "")
- Signal.trap(:INT, "SIG_IGN")
- Signal.trap(:INT, "IGNORE")
-
- Signal.trap(:INT, "SIG_DFL")
- Signal.trap(:INT, "SYSTEM_DEFAULT")
-
- Signal.trap(:INT, "EXIT")
-
- Signal.trap(:INT, "xxxxxx")
- Signal.trap(:INT, "xxxx")
-
- Signal.trap(SignalException.new(:INT).signo, "SIG_DFL")
-
- assert_raise(ArgumentError) { Signal.trap(-1, "xxxx") }
-
- o = Object.new
- def o.to_str; "SIGINT"; end
- Signal.trap(o, "SIG_DFL")
-
- assert_raise(ArgumentError) { Signal.trap("XXXXXXXXXX", "SIG_DFL") }
-
- ensure
- Signal.trap(:INT, oldtrap) if oldtrap
- end
- end
end
diff --git a/test/ruby/test_sleep.rb b/test/ruby/test_sleep.rb
index adc4876216..675fdc9747 100644
--- a/test/ruby/test_sleep.rb
+++ b/test/ruby/test_sleep.rb
@@ -2,12 +2,9 @@ require 'test/unit'
class TestSleep < Test::Unit::TestCase
def test_sleep_5sec
- GC.disable
start = Time.now
sleep 5
slept = Time.now-start
assert_in_delta(5.0, slept, 0.1, "[ruby-core:18015]: longer than expected")
- ensure
- GC.enable
end
end
diff --git a/test/ruby/test_sprintf.rb b/test/ruby/test_sprintf.rb
deleted file mode 100644
index 15424d98ac..0000000000
--- a/test/ruby/test_sprintf.rb
+++ /dev/null
@@ -1,282 +0,0 @@
-require 'test/unit'
-
-class TestSprintf < Test::Unit::TestCase
- def test_positional
- assert_equal(" 00001", sprintf("%*1$.*2$3$d", 10, 5, 1))
- end
-
- def test_binary
- assert_equal("0", sprintf("%b", 0))
- assert_equal("1", sprintf("%b", 1))
- assert_equal("10", sprintf("%b", 2))
- assert_equal("..1", sprintf("%b", -1))
-
- assert_equal(" 0", sprintf("%4b", 0))
- assert_equal(" 1", sprintf("%4b", 1))
- assert_equal(" 10", sprintf("%4b", 2))
- assert_equal(" ..1", sprintf("%4b", -1))
-
- assert_equal("0000", sprintf("%04b", 0))
- assert_equal("0001", sprintf("%04b", 1))
- assert_equal("0010", sprintf("%04b", 2))
- assert_equal("..11", sprintf("%04b", -1))
-
- assert_equal("0000", sprintf("%.4b", 0))
- assert_equal("0001", sprintf("%.4b", 1))
- assert_equal("0010", sprintf("%.4b", 2))
- assert_equal("..11", sprintf("%.4b", -1))
-
- assert_equal(" 0000", sprintf("%6.4b", 0))
- assert_equal(" 0001", sprintf("%6.4b", 1))
- assert_equal(" 0010", sprintf("%6.4b", 2))
- assert_equal(" ..11", sprintf("%6.4b", -1))
-
- assert_equal(" 0", sprintf("%#4b", 0))
- assert_equal(" 0b1", sprintf("%#4b", 1))
- assert_equal("0b10", sprintf("%#4b", 2))
- assert_equal("0b..1", sprintf("%#4b", -1))
-
- assert_equal("0000", sprintf("%#04b", 0))
- assert_equal("0b01", sprintf("%#04b", 1))
- assert_equal("0b10", sprintf("%#04b", 2))
- assert_equal("0b..1", sprintf("%#04b", -1))
-
- assert_equal("0000", sprintf("%#.4b", 0))
- assert_equal("0b0001", sprintf("%#.4b", 1))
- assert_equal("0b0010", sprintf("%#.4b", 2))
- assert_equal("0b..11", sprintf("%#.4b", -1))
-
- assert_equal(" 0000", sprintf("%#6.4b", 0))
- assert_equal("0b0001", sprintf("%#6.4b", 1))
- assert_equal("0b0010", sprintf("%#6.4b", 2))
- assert_equal("0b..11", sprintf("%#6.4b", -1))
-
- assert_equal("+0", sprintf("%+b", 0))
- assert_equal("+1", sprintf("%+b", 1))
- assert_equal("+10", sprintf("%+b", 2))
- assert_equal("-1", sprintf("%+b", -1))
-
- assert_equal(" +0", sprintf("%+4b", 0))
- assert_equal(" +1", sprintf("%+4b", 1))
- assert_equal(" +10", sprintf("%+4b", 2))
- assert_equal(" -1", sprintf("%+4b", -1))
-
- assert_equal("+000", sprintf("%+04b", 0))
- assert_equal("+001", sprintf("%+04b", 1))
- assert_equal("+010", sprintf("%+04b", 2))
- assert_equal("-001", sprintf("%+04b", -1))
-
- assert_equal("+0000", sprintf("%+.4b", 0))
- assert_equal("+0001", sprintf("%+.4b", 1))
- assert_equal("+0010", sprintf("%+.4b", 2))
- assert_equal("-0001", sprintf("%+.4b", -1))
-
- assert_equal(" +0000", sprintf("%+6.4b", 0))
- assert_equal(" +0001", sprintf("%+6.4b", 1))
- assert_equal(" +0010", sprintf("%+6.4b", 2))
- assert_equal(" -0001", sprintf("%+6.4b", -1))
- end
-
- def test_nan
- nan = 0.0 / 0.0
- assert_equal("NaN", sprintf("%f", nan))
- assert_equal("NaN", sprintf("%-f", nan))
- assert_equal("+NaN", sprintf("%+f", nan))
-
- assert_equal(" NaN", sprintf("%8f", nan))
- assert_equal("NaN ", sprintf("%-8f", nan))
- assert_equal(" +NaN", sprintf("%+8f", nan))
-
- assert_equal(" NaN", sprintf("%08f", nan))
- assert_equal("NaN ", sprintf("%-08f", nan))
- assert_equal(" +NaN", sprintf("%+08f", nan))
-
- assert_equal(" NaN", sprintf("% 8f", nan))
- assert_equal(" NaN ", sprintf("%- 8f", nan))
- assert_equal(" +NaN", sprintf("%+ 8f", nan))
-
- assert_equal(" NaN", sprintf("% 08f", nan))
- assert_equal(" NaN ", sprintf("%- 08f", nan))
- assert_equal(" +NaN", sprintf("%+ 08f", nan))
- end
-
- def test_inf
- inf = 1.0 / 0.0
- assert_equal("Inf", sprintf("%f", inf))
- assert_equal("Inf", sprintf("%-f", inf))
- assert_equal("+Inf", sprintf("%+f", inf))
-
- assert_equal(" Inf", sprintf("%8f", inf))
- assert_equal("Inf ", sprintf("%-8f", inf))
- assert_equal(" +Inf", sprintf("%+8f", inf))
-
- assert_equal(" Inf", sprintf("%08f", inf))
- assert_equal("Inf ", sprintf("%-08f", inf))
- assert_equal(" +Inf", sprintf("%+08f", inf))
-
- assert_equal(" Inf", sprintf("% 8f", inf))
- assert_equal(" Inf ", sprintf("%- 8f", inf))
- assert_equal(" +Inf", sprintf("%+ 8f", inf))
-
- assert_equal(" Inf", sprintf("% 08f", inf))
- assert_equal(" Inf ", sprintf("%- 08f", inf))
- assert_equal(" +Inf", sprintf("%+ 08f", inf))
-
- assert_equal("-Inf", sprintf("%f", -inf))
- assert_equal("-Inf", sprintf("%-f", -inf))
- assert_equal("-Inf", sprintf("%+f", -inf))
-
- assert_equal(" -Inf", sprintf("%8f", -inf))
- assert_equal("-Inf ", sprintf("%-8f", -inf))
- assert_equal(" -Inf", sprintf("%+8f", -inf))
-
- assert_equal(" -Inf", sprintf("%08f", -inf))
- assert_equal("-Inf ", sprintf("%-08f", -inf))
- assert_equal(" -Inf", sprintf("%+08f", -inf))
-
- assert_equal(" -Inf", sprintf("% 8f", -inf))
- assert_equal("-Inf ", sprintf("%- 8f", -inf))
- assert_equal(" -Inf", sprintf("%+ 8f", -inf))
-
- assert_equal(" -Inf", sprintf("% 08f", -inf))
- assert_equal("-Inf ", sprintf("%- 08f", -inf))
- assert_equal(" -Inf", sprintf("%+ 08f", -inf))
- assert_equal('..f00000000',
- sprintf("%x", -2**32), '[ruby-dev:32351]')
- assert_equal("..101111111111111111111111111111111",
- sprintf("%b", -2147483649), '[ruby-dev:32365]')
- assert_equal(" Inf", sprintf("% e", inf), '[ruby-dev:34002]')
- end
-
- def test_invalid
- # Star precision before star width:
- assert_raise(ArgumentError, "[ruby-core:11569]") {sprintf("%.**d", 5, 10, 1)}
-
- # Precision before flags and width:
- assert_raise(ArgumentError, "[ruby-core:11569]") {sprintf("%.5+05d", 5)}
- assert_raise(ArgumentError, "[ruby-core:11569]") {sprintf("%.5 5d", 5)}
-
- # Overriding a star width with a numeric one:
- assert_raise(ArgumentError, "[ruby-core:11569]") {sprintf("%*1s", 5, 1)}
-
- # Width before flags:
- assert_raise(ArgumentError, "[ruby-core:11569]") {sprintf("%5+0d", 1)}
- assert_raise(ArgumentError, "[ruby-core:11569]") {sprintf("%5 0d", 1)}
-
- # Specifying width multiple times:
- assert_raise(ArgumentError, "[ruby-core:11569]") {sprintf("%50+30+20+10+5d", 5)}
- assert_raise(ArgumentError, "[ruby-core:11569]") {sprintf("%50 30 20 10 5d", 5)}
-
- # Specifying the precision multiple times with negative star arguments:
- assert_raise(ArgumentError, "[ruby-core:11570]") {sprintf("%.*.*.*.*f", -1, -1, -1, 5, 1)}
-
- # Null bytes after percent signs are removed:
- assert_equal("%\0x hello", sprintf("%\0x hello"), "[ruby-core:11571]")
-
- assert_raise(ArgumentError, "[ruby-core:11573]") {sprintf("%.25555555555555555555555555555555555555s", "hello")}
-
- assert_raise(ArgumentError) { sprintf("%\1", 1) }
- assert_raise(ArgumentError) { sprintf("%!", 1) }
- assert_raise(ArgumentError) { sprintf("%1$1$d", 1) }
- assert_raise(ArgumentError) { sprintf("%0%") }
- verbose, $VERBOSE = $VERBOSE, nil
- assert_nothing_raised { sprintf("", 1) }
- ensure
- $VERBOSE = verbose
- end
-
- def test_float
- assert_equal("36893488147419111424",
- sprintf("%20.0f", 36893488147419107329.0))
- assert_equal(" Inf", sprintf("% 0e", 1.0/0.0), "moved from btest/knownbug")
- end
-
- BSIZ = 120
-
- def test_skip
- assert_equal(" " * BSIZ + "1", sprintf(" " * BSIZ + "%d", 1))
- end
-
- def test_char
- assert_equal("a", sprintf("%c", 97))
- assert_equal("a", sprintf("%c", ?a))
- assert_raise(ArgumentError) { sprintf("%c", sprintf("%c%c", ?a, ?a)) }
- assert_equal(" " * (BSIZ - 1) + "a", sprintf(" " * (BSIZ - 1) + "%c", ?a))
- assert_equal(" " * (BSIZ - 1) + "a", sprintf(" " * (BSIZ - 1) + "%-1c", ?a))
- assert_equal(" " * BSIZ + "a", sprintf("%#{ BSIZ + 1 }c", ?a))
- assert_equal("a" + " " * BSIZ, sprintf("%-#{ BSIZ + 1 }c", ?a))
- end
-
- def test_string
- assert_equal("foo", sprintf("%s", "foo"))
- assert_equal("fo", sprintf("%.2s", "foo"))
- assert_equal(" " * BSIZ, sprintf("%s", " " * BSIZ))
- assert_equal(" " * (BSIZ - 1) + "foo", sprintf("%#{ BSIZ - 1 + 3 }s", "foo"))
- assert_equal(" " * BSIZ + "foo", sprintf("%#{ BSIZ + 3 }s", "foo"))
- assert_equal("foo" + " " * BSIZ, sprintf("%-#{ BSIZ + 3 }s", "foo"))
- end
-
- def test_integer
- assert_equal("01", sprintf("%#o", 1))
- assert_equal("0x1", sprintf("%#x", 1))
- assert_equal("0X1", sprintf("%#X", 1))
- assert_equal("0b1", sprintf("%#b", 1))
- assert_equal("0B1", sprintf("%#B", 1))
- assert_equal("1", sprintf("%d", 1.0))
- assert_equal("4294967296", sprintf("%d", (2**32).to_f))
- assert_equal("-2147483648", sprintf("%d", -(2**31).to_f))
- assert_equal("18446744073709551616", sprintf("%d", (2**64).to_f))
- assert_equal("-9223372036854775808", sprintf("%d", -(2**63).to_f))
- assert_equal("1", sprintf("%d", "1"))
- o = Object.new; def o.to_int; 1; end
- assert_equal("1", sprintf("%d", o))
- assert_equal("+1", sprintf("%+d", 1))
- assert_equal(" 1", sprintf("% d", 1))
- assert_equal("..f", sprintf("%x", -1))
- assert_equal("..7", sprintf("%o", -1))
- one = (2**32).coerce(1).first
- mone = (2**32).coerce(-1).first
- assert_equal("+1", sprintf("%+d", one))
- assert_equal(" 1", sprintf("% d", one))
- assert_equal("..f", sprintf("%x", mone))
- assert_equal("..7", sprintf("%o", mone))
- assert_equal(" " * BSIZ + "1", sprintf("%#{ BSIZ + 1 }d", one))
- assert_equal(" " * (BSIZ - 1) + "1", sprintf(" " * (BSIZ - 1) + "%d", 1))
- end
-
- def test_float2
- inf = 1.0 / 0.0
- assert_equal(" " * BSIZ + "Inf", sprintf("%#{ BSIZ + 3 }.1f", inf))
- assert_equal("+Inf", sprintf("%+-f", inf))
- assert_equal(" " * BSIZ + "1.0", sprintf("%#{ BSIZ + 3 }.1f", 1.0))
- end
-
- class T012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
- end
-
- def test_star
- assert_equal("-1 ", sprintf("%*d", -3, -1))
- end
-
- def test_escape
- assert_equal("%" * BSIZ, sprintf("%%" * BSIZ))
- end
-
- def test_rb_sprintf
- assert(T012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789.new.inspect =~ /^#<TestSprintf::T012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789:0x[0-9a-f]+>$/)
- end
-
- def test_negative_hex
- s1 = sprintf("%0x", -0x40000000)
- s2 = sprintf("%0x", -0x40000001)
- b1 = (/\.\./ =~ s1) != nil
- b2 = (/\.\./ =~ s2) != nil
- assert(b1 == b2, "[ruby-dev:33224]")
- end
-
- def test_named
- assert_equal("value", sprintf("%<key>s", :key => "value"))
- assert_raise(ArgumentError) {sprintf("%1$<key2>s", :key => "value")}
- assert_raise(ArgumentError) {sprintf("%<key><key2>s", :key => "value")}
- end
-end
diff --git a/test/ruby/test_sprintf_comb.rb b/test/ruby/test_sprintf_comb.rb
deleted file mode 100644
index 5dee7305fb..0000000000
--- a/test/ruby/test_sprintf_comb.rb
+++ /dev/null
@@ -1,553 +0,0 @@
-require 'test/unit'
-require_relative 'allpairs'
-
-class TestSprintfComb < Test::Unit::TestCase
- VS = [
- #-0x1000000000000000000000000000000000000000000000002,
- #-0x1000000000000000000000000000000000000000000000001,
- #-0x1000000000000000000000000000000000000000000000000,
- #-0xffffffffffffffffffffffffffffffffffffffffffffffff,
- #-0x1000000000000000000000002,
- #-0x1000000000000000000000001,
- #-0x1000000000000000000000000,
- #-0xffffffffffffffffffffffff,
- -0x10000000000000002,
- -0x10000000000000001,
- -0x10000000000000000,
- -0xffffffffffffffff,
- -0x4000000000000002,
- -0x4000000000000001,
- -0x4000000000000000,
- -0x3fffffffffffffff,
- -0x100000002,
- -0x100000001,
- -0x100000000,
- -0xffffffff,
- #-0xc717a08d, # 0xc717a08d * 0x524b2245 = 0x4000000000000001
- -0x80000002,
- -0x80000001,
- -0x80000000,
- -0x7fffffff,
- #-0x524b2245,
- -0x40000002,
- -0x40000001,
- -0x40000000,
- -0x3fffffff,
- #-0x10002,
- #-0x10001,
- #-0x10000,
- #-0xffff,
- #-0x8101, # 0x8101 * 0x7f01 = 0x40000001
- #-0x8002,
- #-0x8001,
- #-0x8000,
- #-0x7fff,
- #-0x7f01,
- #-65,
- #-64,
- #-63,
- #-62,
- #-33,
- #-32,
- #-31,
- #-30,
- -3,
- -2,
- -1,
- 0,
- 1,
- 2,
- 3,
- #30,
- #31,
- #32,
- #33,
- #62,
- #63,
- #64,
- #65,
- #0x7f01,
- #0x7ffe,
- #0x7fff,
- #0x8000,
- #0x8001,
- #0x8101,
- #0xfffe,
- #0xffff,
- #0x10000,
- #0x10001,
- 0x3ffffffe,
- 0x3fffffff,
- 0x40000000,
- 0x40000001,
- #0x524b2245,
- 0x7ffffffe,
- 0x7fffffff,
- 0x80000000,
- 0x80000001,
- #0xc717a08d,
- 0xfffffffe,
- 0xffffffff,
- 0x100000000,
- 0x100000001,
- 0x3ffffffffffffffe,
- 0x3fffffffffffffff,
- 0x4000000000000000,
- 0x4000000000000001,
- 0xfffffffffffffffe,
- 0xffffffffffffffff,
- 0x10000000000000000,
- 0x10000000000000001,
- #0xffffffffffffffffffffffff,
- #0x1000000000000000000000000,
- #0x1000000000000000000000001,
- #0xffffffffffffffffffffffffffffffffffffffffffffffff,
- #0x1000000000000000000000000000000000000000000000000,
- #0x1000000000000000000000000000000000000000000000001
- ]
- VS.reverse!
-
- def combination(*args, &b)
- #AllPairs.exhaustive_each(*args, &b)
- AllPairs.each(*args, &b)
- end
-
- def emu_int(format, v)
- /\A%( )?(\#)?(\+)?(-)?(0)?(\d+)?(?:\.(\d*))?(.)\z/ =~ format
- sp = $1
- hs = $2
- pl = $3
- mi = $4
- zr = $5
- width = $6
- precision = $7
- type = $8
- width = width.to_i if width
- precision = precision.to_i if precision
- prefix = ''
-
- zr = nil if precision
-
- zr = nil if mi && zr
-
- case type
- when 'B'
- radix = 2
- digitmap = {0 => '0', 1 => '1'}
- complement = !pl && !sp
- prefix = '0B' if hs && v != 0
- when 'b'
- radix = 2
- digitmap = {0 => '0', 1 => '1'}
- complement = !pl && !sp
- prefix = '0b' if hs && v != 0
- when 'd'
- radix = 10
- digitmap = {}
- 10.times {|i| digitmap[i] = i.to_s }
- complement = false
- when 'o'
- radix = 8
- digitmap = {}
- 8.times {|i| digitmap[i] = i.to_s }
- complement = !pl && !sp
- when 'X'
- radix = 16
- digitmap = {}
- 16.times {|i| digitmap[i] = i.to_s(16).upcase }
- complement = !pl && !sp
- prefix = '0X' if hs && v != 0
- when 'x'
- radix = 16
- digitmap = {}
- 16.times {|i| digitmap[i] = i.to_s(16) }
- complement = !pl && !sp
- prefix = '0x' if hs && v != 0
- else
- raise "unexpected type: #{type.inspect}"
- end
-
- digits = []
- abs = v.abs
- sign = ''
- while 0 < abs
- digits << (abs % radix)
- abs /= radix
- end
-
- if v < 0
- if complement
- digits.map! {|d| radix-1 - d }
- carry = 1
- digits.each_index {|i|
- digits[i] += carry
- carry = 0
- if radix <= digits[i]
- digits[i] -= radix
- carry = 1
- end
- }
- if digits.last != radix-1
- digits << (radix-1)
- end
- sign = '..'
- else
- sign = '-'
- end
- else
- if pl
- sign = '+'
- elsif sp
- sign = ' '
- end
- end
-
- dlen = digits.length
- dlen += 2 if sign == '..'
-
- if v < 0 && complement
- d = radix - 1
- else
- d = 0
- end
- if precision
- if dlen < precision
- (precision - dlen).times {
- digits << d
- }
- end
- else
- if dlen == 0
- digits << d
- end
- end
- if type == 'o' && hs
- if digits.empty? || digits.last != d
- digits << d
- end
- end
-
- digits.reverse!
-
- str = digits.map {|d| digitmap[d] }.join
-
- pad = ''
- nlen = prefix.length + sign.length + str.length
- if width && nlen < width
- len = width - nlen
- if zr
- if complement && v < 0
- pad = digitmap[radix-1] * len
- else
- pad = '0' * len
- end
- else
- pad = ' ' * len
- end
- end
-
- if / / =~ pad
- if sign == '..'
- str = prefix + sign + str
- else
- str = sign + prefix + str
- end
- if mi
- str = str + pad
- else
- str = pad + str
- end
- else
- if sign == '..'
- str = prefix + sign + pad + str
- else
- str = sign + prefix + pad + str
- end
- end
-
- str
- end
-
- def test_format_integer
- combination(
- %w[B b d o X x],
- [nil, 0, 5, 20],
- ["", ".", ".0", ".8", ".20"],
- ['', ' '],
- ['', '#'],
- ['', '+'],
- ['', '-'],
- ['', '0']) {|type, width, precision, sp, hs, pl, mi, zr|
- format = "%#{sp}#{hs}#{pl}#{mi}#{zr}#{width}#{precision}#{type}"
- VS.each {|v|
- r = sprintf format, v
- e = emu_int format, v
- if true
- assert_equal(e, r, "sprintf(#{format.dump}, #{v})")
- else
- if e != r
- puts "#{e.dump}\t#{r.dump}\tsprintf(#{format.dump}, #{v})"
- end
- end
- }
- }
- end
-
- FLOAT_VALUES = [
- -1e100,
- -123456789.0,
- -1.0,
- -0.0,
- 0.0,
- 0.01,
- 1/3.0,
- 2/3.0,
- 1.0,
- 2.0,
- 9.99999999,
- 123456789.0,
- 1e100,
- Float::MAX,
- Float::MIN,
- Float::EPSILON,
- 1+Float::EPSILON,
- #1-Float::EPSILON/2,
- 10 + Float::EPSILON*10,
- 10 - Float::EPSILON*5,
- 1.0/0.0,
- -1.0/0.0,
- 0.0/0.0,
- ]
-
- def split_float10(v)
- if v == 0
- if 1/v < 0
- sign = -1
- v = -v
- else
- sign = 1
- end
- else
- if v < 0
- sign = -1
- v = -v
- else
- sign = 1
- end
- end
- exp = 0
- int = v.floor
- v -= int
- while v != 0
- v *= 2
- int *= 2
- i = v.floor
- v -= i
- int += i
- exp -= 1
- end
- int *= 5 ** (-exp)
- [sign, int, exp]
- end
-
- def emu_e(sp, hs, pl, mi, zr, width, precision, type, v, sign, int, exp)
- precision = 6 unless precision
- if int == 0
- if precision == 0 && !hs
- result = "0#{type}+00"
- else
- result = "0." + "0" * precision + "#{type}+00"
- end
- else
- if int < 10**precision
- int *= 10**precision
- exp -= precision
- end
- digits = int.to_s.length
- discard = digits - (precision+1)
- if discard != 0
- q, r = int.divmod(10**discard)
- if r < 10**discard / 2
- int = q
- exp += discard
- elsif (q+1).to_s.length == q.to_s.length
- int = q+1
- exp += discard
- else
- discard += 1
- q, r = int.divmod(10**discard)
- int = q+1
- exp += discard
- end
- end
- ints = int.to_s
- frac = ints[1..-1]
- result = ints[0,1]
- e = exp + frac.length
- if precision != 0 || hs
- result << "."
- if precision != 0
- result << frac
- end
- end
- result << type
- if e == 0
- if v.abs < 1
- result << '-00' # glibc 2.7 causes '+00'
- else
- result << '+00'
- end
- else
- result << sprintf("%+03d", e)
- end
- result
- end
- result
- end
-
- def emu_f(sp, hs, pl, mi, zr, width, precision, type, sign, int, exp)
- precision = 6 unless precision
- if int == 0
- if precision == 0 && !hs
- result = '0'
- else
- result = '0.' + '0' * precision
- end
- else
- if -precision < exp
- int *= 10 ** (precision+exp)
- exp = -precision
- end
- if exp < -precision
- discard = -exp - precision
- q, r = int.divmod(10**discard)
- if 10**discard / 2 <= r
- q += 1
- end
- int = q
- exp += discard
- end
- result = int.to_s
- if result.length <= precision
- result = '0' * (precision+1 - result.length) + result
- end
- if precision != 0 || hs
- if precision == 0
- result << '.'
- else
- result[-precision,0] = '.'
- end
- end
- end
- result
- end
-
- def emu_float(format, v)
- /\A%( )?(\#)?(\+)?(-)?(0)?(\d+)?(?:\.(\d*))?(.)\z/ =~ format
- sp = $1
- hs = $2
- pl = $3
- mi = $4
- zr = $5
- width = $6
- precision = $7
- type = $8
- width = width.to_i if width
- precision = precision.to_i if precision
-
- zr = nil if mi && zr
-
- if v.infinite?
- sign = v < 0 ? -1 : 1
- int = :inf
- hs = zr = nil
- elsif v.nan?
- sign = 1
- int = :nan
- hs = zr = nil
- else
- sign, int, exp = split_float10(v)
- end
-
- if sign < 0
- sign = '-'
- elsif sign == 0
- sign = ''
- elsif pl
- sign = '+'
- elsif sp
- sign = ' '
- else
- sign = ''
- end
-
- if v.nan?
- result = 'NaN'
- elsif v.infinite?
- result = 'Inf'
- else
- case type
- when /[eE]/
- result = emu_e(sp, hs, pl, mi, zr, width, precision, type, v, sign, int, exp)
- when /f/
- result = emu_f(sp, hs, pl, mi, zr, width, precision, type, sign, int, exp)
- when /[gG]/
- precision = 6 unless precision
- precision = 1 if precision == 0
- r = emu_e(sp, hs, pl, mi, zr, width, precision-1, type.tr('gG', 'eE'), v, sign, int, exp)
- /[eE]([+-]\d+)/ =~ r
- e = $1.to_i
- if e < -4 || precision <= e
- result = r
- else
- result = emu_f(sp, hs, pl, mi, zr, width, precision-1-e, type, sign, int, exp)
- end
- result.sub!(/\.[0-9]*/) { $&.sub(/\.?0*\z/, '') } if !hs
- else
- raise "unexpected type: #{type}"
- end
- end
-
- pad = ''
- if width && sign.length + result.length < width
- if zr
- pad = '0' * (width - sign.length - result.length)
- else
- pad = ' ' * (width - sign.length - result.length)
- end
- end
- if mi
- sign + result + pad
- elsif zr
- sign + pad + result
- else
- pad + sign + result
- end
-
- end
-
- def test_format_float
- combination(
- %w[e E f g G],
- [nil, 0, 5, 20],
- ["", ".", ".0", ".8", ".20", ".200"],
- ['', ' '],
- ['', '#'],
- ['', '+'],
- ['', '-'],
- ['', '0']) {|type, width, precision, sp, hs, pl, mi, zr|
- format = "%#{sp}#{hs}#{pl}#{mi}#{zr}#{width}#{precision}#{type}"
- FLOAT_VALUES.each {|v|
- r = sprintf format, v
- e = emu_float format, v
- if true
- assert_equal(e, r, "sprintf(#{format.dump}, #{'%.20g' % v})")
- else
- if e != r
- puts "#{e.dump}\t#{r.dump}\tsprintf(#{format.dump}, #{'%.20g' % v})"
- end
- end
- }
- }
- end
-end
diff --git a/test/ruby/test_string.rb b/test/ruby/test_string.rb
index 1d65c84c1c..f8938cad84 100644
--- a/test/ruby/test_string.rb
+++ b/test/ruby/test_string.rb
@@ -1,1337 +1,13 @@
require 'test/unit'
-require_relative 'envutil'
-
-# use of $= is deprecated after 1.7.1
-def pre_1_7_1
-end
class TestString < Test::Unit::TestCase
-
- def initialize(*args)
- @cls = String
- @aref_re_nth = true
- @aref_re_silent = false
- @aref_slicebang_silent = true
- super
- end
-
- def S(str)
- @cls.new(str)
- end
-
- def test_s_new
- assert_equal("RUBY", S("RUBY"))
- end
-
- def test_AREF # '[]'
- assert_equal("A", S("AooBar")[0])
- assert_equal("B", S("FooBaB")[-1])
- assert_equal(nil, S("FooBar")[6])
- assert_equal(nil, S("FooBar")[-7])
-
- assert_equal(S("Foo"), S("FooBar")[0,3])
- assert_equal(S("Bar"), S("FooBar")[-3,3])
- assert_equal(S(""), S("FooBar")[6,2])
- assert_equal(nil, S("FooBar")[-7,10])
-
- assert_equal(S("Foo"), S("FooBar")[0..2])
- assert_equal(S("Foo"), S("FooBar")[0...3])
- assert_equal(S("Bar"), S("FooBar")[-3..-1])
- assert_equal(S(""), S("FooBar")[6..2])
- assert_equal(nil, S("FooBar")[-10..-7])
-
- assert_equal(S("Foo"), S("FooBar")[/^F../])
- assert_equal(S("Bar"), S("FooBar")[/..r$/])
- assert_equal(nil, S("FooBar")[/xyzzy/])
- assert_equal(nil, S("FooBar")[/plugh/])
-
- assert_equal(S("Foo"), S("FooBar")[S("Foo")])
- assert_equal(S("Bar"), S("FooBar")[S("Bar")])
- assert_equal(nil, S("FooBar")[S("xyzzy")])
- assert_equal(nil, S("FooBar")[S("plugh")])
-
- if @aref_re_nth
- assert_equal(S("Foo"), S("FooBar")[/([A-Z]..)([A-Z]..)/, 1])
- assert_equal(S("Bar"), S("FooBar")[/([A-Z]..)([A-Z]..)/, 2])
- assert_equal(nil, S("FooBar")[/([A-Z]..)([A-Z]..)/, 3])
- assert_equal(S("Bar"), S("FooBar")[/([A-Z]..)([A-Z]..)/, -1])
- assert_equal(S("Foo"), S("FooBar")[/([A-Z]..)([A-Z]..)/, -2])
- assert_equal(nil, S("FooBar")[/([A-Z]..)([A-Z]..)/, -3])
- end
-
- o = Object.new
- def o.to_int; 2; end
- assert_equal("o", "foo"[o])
-
- assert_raise(ArgumentError) { "foo"[] }
- end
-
- def test_ASET # '[]='
- s = S("FooBar")
- s[0] = S('A')
- assert_equal(S("AooBar"), s)
-
- s[-1]= S('B')
- assert_equal(S("AooBaB"), s)
- assert_raise(IndexError) { s[-7] = S("xyz") }
- assert_equal(S("AooBaB"), s)
- s[0] = S("ABC")
- assert_equal(S("ABCooBaB"), s)
-
- s = S("FooBar")
- s[0,3] = S("A")
- assert_equal(S("ABar"),s)
- s[0] = S("Foo")
- assert_equal(S("FooBar"), s)
- s[-3,3] = S("Foo")
- assert_equal(S("FooFoo"), s)
- assert_raise(IndexError) { s[7,3] = S("Bar") }
- assert_raise(IndexError) { s[-7,3] = S("Bar") }
-
- s = S("FooBar")
- s[0..2] = S("A")
- assert_equal(S("ABar"), s)
- s[1..3] = S("Foo")
- assert_equal(S("AFoo"), s)
- s[-4..-4] = S("Foo")
- assert_equal(S("FooFoo"), s)
- assert_raise(RangeError) { s[7..10] = S("Bar") }
- assert_raise(RangeError) { s[-7..-10] = S("Bar") }
-
- s = S("FooBar")
- s[/^F../]= S("Bar")
- assert_equal(S("BarBar"), s)
- s[/..r$/] = S("Foo")
- assert_equal(S("BarFoo"), s)
- if @aref_re_silent
- s[/xyzzy/] = S("None")
- assert_equal(S("BarFoo"), s)
- else
- assert_raise(IndexError) { s[/xyzzy/] = S("None") }
- end
- if @aref_re_nth
- s[/([A-Z]..)([A-Z]..)/, 1] = S("Foo")
- assert_equal(S("FooFoo"), s)
- s[/([A-Z]..)([A-Z]..)/, 2] = S("Bar")
- assert_equal(S("FooBar"), s)
- assert_raise(IndexError) { s[/([A-Z]..)([A-Z]..)/, 3] = "None" }
- s[/([A-Z]..)([A-Z]..)/, -1] = S("Foo")
- assert_equal(S("FooFoo"), s)
- s[/([A-Z]..)([A-Z]..)/, -2] = S("Bar")
- assert_equal(S("BarFoo"), s)
- assert_raise(IndexError) { s[/([A-Z]..)([A-Z]..)/, -3] = "None" }
- end
-
- s = S("FooBar")
- s[S("Foo")] = S("Bar")
- assert_equal(S("BarBar"), s)
-
- pre_1_7_1 do
- s = S("FooBar")
- s[S("Foo")] = S("xyz")
- assert_equal(S("xyzBar"), s)
-
- $= = true
- s = S("FooBar")
- s[S("FOO")] = S("Bar")
- assert_equal(S("BarBar"), s)
- s[S("FOO")] = S("xyz")
- assert_equal(S("BarBar"), s)
- $= = false
- end
-
- s = S("a string")
- s[0..s.size] = S("another string")
- assert_equal(S("another string"), s)
-
- o = Object.new
- def o.to_int; 2; end
- s = "foo"
- s[o] = "bar"
- assert_equal("fobar", s)
-
- assert_raise(ArgumentError) { "foo"[1, 2, 3] = "" }
- end
-
- def test_CMP # '<=>'
- assert_equal(1, S("abcdef") <=> S("abcde"))
- assert_equal(0, S("abcdef") <=> S("abcdef"))
- assert_equal(-1, S("abcde") <=> S("abcdef"))
-
- assert_equal(-1, S("ABCDEF") <=> S("abcdef"))
-
- pre_1_7_1 do
- $= = true
- assert_equal(0, S("ABCDEF") <=> S("abcdef"))
- $= = false
- end
-
- assert_nil("foo" <=> Object.new)
-
- o = Object.new
- def o.to_str; "bar"; end
- assert_nil("foo" <=> o)
-
- def o.<=>(x); nil; end
- assert_nil("foo" <=> o)
-
- def o.<=>(x); 1; end
- assert_equal(-1, "foo" <=> o)
-
- def o.<=>(x); 2**100; end
- assert_equal(-(2**100), "foo" <=> o)
- end
-
- def test_EQUAL # '=='
- assert_equal(false, S("foo") == :foo)
- assert(S("abcdef") == S("abcdef"))
-
- pre_1_7_1 do
- $= = true
- assert(S("CAT") == S('cat'))
- assert(S("CaT") == S('cAt'))
- $= = false
- end
-
- assert(S("CAT") != S('cat'))
- assert(S("CaT") != S('cAt'))
-
- o = Object.new
- def o.to_str; end
- def o.==(x); false; end
- assert_equal(false, "foo" == o)
- def o.==(x); true; end
- assert_equal(true, "foo" == o)
- end
-
- def test_LSHIFT # '<<'
- assert_equal(S("world!"), S("world") << 33)
- assert_equal(S("world!"), S("world") << S('!'))
-
- s = "a"
- 10.times {|i|
- s << s
- assert_equal("a" * (2 << i), s)
- }
-
- s = ["foo"].pack("p")
- l = s.size
- s << "bar"
- assert_equal(l + 3, s.size)
- end
-
- def test_MATCH # '=~'
- assert_equal(10, S("FeeFieFoo-Fum") =~ /Fum$/)
- assert_equal(nil, S("FeeFieFoo-Fum") =~ /FUM$/)
-
- pre_1_7_1 do
- $= = true
- assert_equal(10, S("FeeFieFoo-Fum") =~ /FUM$/)
- $= = false
- end
-
- o = Object.new
- def o.=~(x); x + "bar"; end
- assert_equal("foobar", S("foo") =~ o)
-
- assert_raise(TypeError) { S("foo") =~ "foo" }
- end
-
- def test_MOD # '%'
- assert_equal(S("00123"), S("%05d") % 123)
- assert_equal(S("123 |00000001"), S("%-5s|%08x") % [123, 1])
- x = S("%3s %-4s%%foo %.0s%5d %#x%c%3.1f %b %x %X %#b %#x %#X") %
- [S("hi"),
- 123,
- S("never seen"),
- 456,
- 0,
- ?A,
- 3.0999,
- 11,
- 171,
- 171,
- 11,
- 171,
- 171]
-
- assert_equal(S(' hi 123 %foo 456 0A3.1 1011 ab AB 0b1011 0xab 0XAB'), x)
- end
-
- def test_MUL # '*'
- assert_equal(S("XXX"), S("X") * 3)
- assert_equal(S("HOHO"), S("HO") * 2)
- end
-
- def test_PLUS # '+'
- assert_equal(S("Yodel"), S("Yo") + S("del"))
- end
-
- def casetest(a, b, rev=false)
- case a
- when b
- assert(!rev)
- else
- assert(rev)
- end
- end
-
- def test_VERY_EQUAL # '==='
- # assert_equal(true, S("foo") === :foo)
- casetest(S("abcdef"), S("abcdef"))
-
- pre_1_7_1 do
- $= = true
- casetest(S("CAT"), S('cat'))
- casetest(S("CaT"), S('cAt'))
- $= = false
- end
-
- casetest(S("CAT"), S('cat'), true) # Reverse the test - we don't want to
- casetest(S("CaT"), S('cAt'), true) # find these in the case.
- end
-
- def test_capitalize
- assert_equal(S("Hello"), S("hello").capitalize)
- assert_equal(S("Hello"), S("hELLO").capitalize)
- assert_equal(S("123abc"), S("123ABC").capitalize)
- end
-
- def test_capitalize!
- a = S("hello"); a.capitalize!
- assert_equal(S("Hello"), a)
-
- a = S("hELLO"); a.capitalize!
- assert_equal(S("Hello"), a)
-
- a = S("123ABC"); a.capitalize!
- assert_equal(S("123abc"), a)
-
- assert_equal(nil, S("123abc").capitalize!)
- assert_equal(S("123abc"), S("123ABC").capitalize!)
- assert_equal(S("Abc"), S("ABC").capitalize!)
- assert_equal(S("Abc"), S("abc").capitalize!)
- assert_equal(nil, S("Abc").capitalize!)
-
- a = S("hello")
- b = a.dup
- assert_equal(S("Hello"), a.capitalize!)
- assert_equal(S("hello"), b)
-
- end
-
- def test_center
- assert_equal(S("hello"), S("hello").center(4))
- assert_equal(S(" hello "), S("hello").center(11))
- end
-
- def test_chomp
- assert_equal(S("hello"), S("hello").chomp("\n"))
- assert_equal(S("hello"), S("hello\n").chomp("\n"))
- save = $/
-
- $/ = "\n"
-
- assert_equal(S("hello"), S("hello").chomp)
- assert_equal(S("hello"), S("hello\n").chomp)
-
- $/ = "!"
- assert_equal(S("hello"), S("hello").chomp)
- assert_equal(S("hello"), S("hello!").chomp)
- $/ = save
-
- assert_equal(S("a").hash, S("a\u0101").chomp(S("\u0101")).hash, '[ruby-core:22414]')
- end
-
- def test_chomp!
- a = S("hello")
- a.chomp!(S("\n"))
-
- assert_equal(S("hello"), a)
- assert_equal(nil, a.chomp!(S("\n")))
-
- a = S("hello\n")
- a.chomp!(S("\n"))
- assert_equal(S("hello"), a)
- save = $/
-
- $/ = "\n"
- a = S("hello")
- a.chomp!
- assert_equal(S("hello"), a)
-
- a = S("hello\n")
- a.chomp!
- assert_equal(S("hello"), a)
-
- $/ = "!"
- a = S("hello")
- a.chomp!
- assert_equal(S("hello"), a)
-
- a="hello!"
- a.chomp!
- assert_equal(S("hello"), a)
-
- $/ = save
-
- a = S("hello\n")
- b = a.dup
- assert_equal(S("hello"), a.chomp!)
- assert_equal(S("hello\n"), b)
-
- s = "foo\r\n"
- s.chomp!
- assert_equal("foo", s)
-
- s = "foo\r"
- s.chomp!
- assert_equal("foo", s)
-
- s = "foo\r\n"
- s.chomp!("")
- assert_equal("foo", s)
-
- s = "foo\r"
- s.chomp!("")
- assert_equal("foo\r", s)
-
- assert_equal(S("a").hash, S("a\u0101").chomp!(S("\u0101")).hash, '[ruby-core:22414]')
- end
-
- def test_chop
- assert_equal(S("hell"), S("hello").chop)
- assert_equal(S("hello"), S("hello\r\n").chop)
- assert_equal(S("hello\n"), S("hello\n\r").chop)
- assert_equal(S(""), S("\r\n").chop)
- assert_equal(S(""), S("").chop)
- assert_equal(S("a").hash, S("a\u00d8").chop.hash)
- end
-
- def test_chop!
- a = S("hello").chop!
- assert_equal(S("hell"), a)
-
- a = S("hello\r\n").chop!
- assert_equal(S("hello"), a)
-
- a = S("hello\n\r").chop!
- assert_equal(S("hello\n"), a)
-
- a = S("\r\n").chop!
- assert_equal(S(""), a)
-
- a = S("").chop!
- assert_nil(a)
-
- a = S("a\u00d8")
- a.chop!
- assert_equal(S("a").hash, a.hash)
-
- a = S("hello\n")
- b = a.dup
- assert_equal(S("hello"), a.chop!)
- assert_equal(S("hello\n"), b)
- end
-
- def test_clone
- for taint in [ false, true ]
- for untrust in [ false, true ]
- for frozen in [ false, true ]
- a = S("Cool")
- a.taint if taint
- a.untrust if untrust
- a.freeze if frozen
- b = a.clone
-
- assert_equal(a, b)
- assert(a.__id__ != b.__id__)
- assert_equal(a.frozen?, b.frozen?)
- assert_equal(a.untrusted?, b.untrusted?)
- assert_equal(a.tainted?, b.tainted?)
- end
- end
- end
-
- null = File.exist?("/dev/null") ? "/dev/null" : "NUL" # maybe DOSISH
- assert_equal("", File.read(null).clone, '[ruby-dev:32819] reported by Kazuhiro NISHIYAMA')
- end
-
- def test_concat
- assert_equal(S("world!"), S("world").concat(33))
- assert_equal(S("world!"), S("world").concat(S('!')))
- end
-
- def test_count
- a = S("hello world")
- assert_equal(5, a.count(S("lo")))
- assert_equal(2, a.count(S("lo"), S("o")))
- assert_equal(4, a.count(S("hello"), S("^l")))
- assert_equal(4, a.count(S("ej-m")))
- assert_equal(0, S("y").count(S("a\\-z")))
-
- assert_raise(ArgumentError) { "foo".count }
- end
-
- def test_crypt
- assert_equal(S('aaGUC/JkO9/Sc'), S("mypassword").crypt(S("aa")))
- assert(S('aaGUC/JkO9/Sc') != S("mypassword").crypt(S("ab")))
- end
-
- def test_delete
- assert_equal(S("heo"), S("hello").delete(S("l"), S("lo")))
- assert_equal(S("he"), S("hello").delete(S("lo")))
- assert_equal(S("hell"), S("hello").delete(S("aeiou"), S("^e")))
- assert_equal(S("ho"), S("hello").delete(S("ej-m")))
-
- assert_equal("a".hash, "a\u0101".delete("\u0101").hash, '[ruby-talk:329267]')
- assert_equal(true, "a\u0101".delete("\u0101").ascii_only?)
- assert_equal(true, "a\u3041".delete("\u3041").ascii_only?)
- assert_equal(false, "a\u3041\u3042".tr("\u3041", "a").ascii_only?)
- end
-
- def test_delete!
- a = S("hello")
- a.delete!(S("l"), S("lo"))
- assert_equal(S("heo"), a)
-
- a = S("hello")
- a.delete!(S("lo"))
- assert_equal(S("he"), a)
-
- a = S("hello")
- a.delete!(S("aeiou"), S("^e"))
- assert_equal(S("hell"), a)
-
- a = S("hello")
- a.delete!(S("ej-m"))
- assert_equal(S("ho"), a)
-
- a = S("hello")
- assert_nil(a.delete!(S("z")))
-
- a = S("hello")
- b = a.dup
- a.delete!(S("lo"))
- assert_equal(S("he"), a)
- assert_equal(S("hello"), b)
-
- a = S("hello")
- a.delete!(S("^el"))
- assert_equal(S("ell"), a)
-
- assert_raise(ArgumentError) { S("foo").delete! }
- end
-
-
- def test_downcase
- assert_equal(S("hello"), S("helLO").downcase)
- assert_equal(S("hello"), S("hello").downcase)
- assert_equal(S("hello"), S("HELLO").downcase)
- assert_equal(S("abc hello 123"), S("abc HELLO 123").downcase)
- end
-
- def test_downcase!
- a = S("helLO")
- b = a.dup
- assert_equal(S("hello"), a.downcase!)
- assert_equal(S("hello"), a)
- assert_equal(S("helLO"), b)
-
- a=S("hello")
- assert_nil(a.downcase!)
- assert_equal(S("hello"), a)
- end
-
- def test_dump
- a= S("Test") << 1 << 2 << 3 << 9 << 13 << 10
- assert_equal(S('"Test\\x01\\x02\\x03\\t\\r\\n"'), a.dump)
- end
-
- def test_dup
- for taint in [ false, true ]
- for untrust in [ false, true ]
- for frozen in [ false, true ]
- a = S("hello")
- a.taint if taint
- a.untrust if untrust
- a.freeze if frozen
- b = a.dup
-
- assert_equal(a, b)
- assert(a.__id__ != b.__id__)
- assert(!b.frozen?)
- assert_equal(a.tainted?, b.tainted?)
- assert_equal(a.untrusted?, b.untrusted?)
- end
- end
- end
- end
-
- def test_each
- save = $/
- $/ = "\n"
- res=[]
- S("hello\nworld").lines.each {|x| res << x}
- assert_equal(S("hello\n"), res[0])
- assert_equal(S("world"), res[1])
-
- res=[]
- S("hello\n\n\nworld").lines(S('')).each {|x| res << x}
- assert_equal(S("hello\n\n\n"), res[0])
- assert_equal(S("world"), res[1])
-
- $/ = "!"
- res=[]
- S("hello!world").lines.each {|x| res << x}
- assert_equal(S("hello!"), res[0])
- assert_equal(S("world"), res[1])
- $/ = save
- end
-
- def test_each_byte
- res = []
- S("ABC").each_byte {|x| res << x }
- assert_equal(65, res[0])
- assert_equal(66, res[1])
- assert_equal(67, res[2])
- end
-
- def test_each_line
- save = $/
- $/ = "\n"
- res=[]
- S("hello\nworld").lines.each {|x| res << x}
- assert_equal(S("hello\n"), res[0])
- assert_equal(S("world"), res[1])
-
- res=[]
- S("hello\n\n\nworld").lines(S('')).each {|x| res << x}
- assert_equal(S("hello\n\n\n"), res[0])
- assert_equal(S("world"), res[1])
-
- $/ = "!"
-
- res=[]
- S("hello!world").lines.each {|x| res << x}
- assert_equal(S("hello!"), res[0])
- assert_equal(S("world"), res[1])
-
- $/ = save
-
- s = nil
- "foo\nbar".each_line(nil) {|s2| s = s2 }
- assert_equal("foo\nbar", s)
- end
-
- def test_empty?
- assert(S("").empty?)
- assert(!S("not").empty?)
- end
-
- def test_eql?
- a = S("hello")
- assert(a.eql?(S("hello")))
- assert(a.eql?(a))
- end
-
- def test_gsub
- assert_equal(S("h*ll*"), S("hello").gsub(/[aeiou]/, S('*')))
- assert_equal(S("h<e>ll<o>"), S("hello").gsub(/([aeiou])/, S('<\1>')))
- assert_equal(S("h e l l o "),
- S("hello").gsub(/./) { |s| s[0].to_s + S(' ')})
- assert_equal(S("HELL-o"),
- S("hello").gsub(/(hell)(.)/) { |s| $1.upcase + S('-') + $2 })
-
- a = S("hello")
- a.taint
- a.untrust
- assert(a.gsub(/./, S('X')).tainted?)
- assert(a.gsub(/./, S('X')).untrusted?)
-
- assert_equal("z", "abc".gsub(/./, "a" => "z"), "moved from btest/knownbug")
-
- assert_raise(ArgumentError) { "foo".gsub }
- end
-
- def test_gsub!
- a = S("hello")
- b = a.dup
- a.gsub!(/[aeiou]/, S('*'))
- assert_equal(S("h*ll*"), a)
- assert_equal(S("hello"), b)
-
- a = S("hello")
- a.gsub!(/([aeiou])/, S('<\1>'))
- assert_equal(S("h<e>ll<o>"), a)
-
- a = S("hello")
- a.gsub!(/./) { |s| s[0].to_s + S(' ')}
- assert_equal(S("h e l l o "), a)
-
- a = S("hello")
- a.gsub!(/(hell)(.)/) { |s| $1.upcase + S('-') + $2 }
- assert_equal(S("HELL-o"), a)
-
- r = S('X')
- r.taint
- r.untrust
- a.gsub!(/./, r)
- assert(a.tainted?)
- assert(a.untrusted?)
-
- a = S("hello")
- assert_nil(a.sub!(S('X'), S('Y')))
- end
-
- def test_sub_hash
- assert_equal('azc', 'abc'.sub(/b/, "b" => "z"))
- assert_equal('ac', 'abc'.sub(/b/, {}))
- assert_equal('a1c', 'abc'.sub(/b/, "b" => 1))
- assert_equal('aBc', 'abc'.sub(/b/, Hash.new {|h, k| k.upcase }))
- assert_equal('a[\&]c', 'abc'.sub(/b/, "b" => '[\&]'))
- assert_equal('aBcabc', 'abcabc'.sub(/b/, Hash.new {|h, k| h[k] = k.upcase }))
- assert_equal('aBcdef', 'abcdef'.sub(/de|b/, "b" => "B", "de" => "DE"))
- end
-
- def test_gsub_hash
- assert_equal('azc', 'abc'.gsub(/b/, "b" => "z"))
- assert_equal('ac', 'abc'.gsub(/b/, {}))
- assert_equal('a1c', 'abc'.gsub(/b/, "b" => 1))
- assert_equal('aBc', 'abc'.gsub(/b/, Hash.new {|h, k| k.upcase }))
- assert_equal('a[\&]c', 'abc'.gsub(/b/, "b" => '[\&]'))
- assert_equal('aBcaBc', 'abcabc'.gsub(/b/, Hash.new {|h, k| h[k] = k.upcase }))
- assert_equal('aBcDEf', 'abcdef'.gsub(/de|b/, "b" => "B", "de" => "DE"))
- end
-
- def test_hash
- assert_equal(S("hello").hash, S("hello").hash)
- assert(S("hello").hash != S("helLO").hash)
- end
-
- def test_hash_random
- str = 'abc'
- a = [str.hash.to_s]
- 3.times {
- assert_in_out_err(["-e", "print #{str.dump}.hash"], "") do |r, e|
- a += r
- assert_equal([], e)
- end
- }
- assert_not_equal([str.hash.to_s], a.uniq)
- end
-
- def test_hex
- assert_equal(255, S("0xff").hex)
- assert_equal(-255, S("-0xff").hex)
- assert_equal(255, S("ff").hex)
- assert_equal(-255, S("-ff").hex)
- assert_equal(0, S("-ralph").hex)
- assert_equal(-15, S("-fred").hex)
- assert_equal(15, S("fred").hex)
- end
-
- def test_include?
- assert( S("foobar").include?(?f))
- assert( S("foobar").include?(S("foo")))
- assert(!S("foobar").include?(S("baz")))
- assert(!S("foobar").include?(?z))
- end
-
- def test_index
- assert_equal(0, S("hello").index(?h))
- assert_equal(1, S("hello").index(S("ell")))
- assert_equal(2, S("hello").index(/ll./))
-
- assert_equal(3, S("hello").index(?l, 3))
- assert_equal(3, S("hello").index(S("l"), 3))
- assert_equal(3, S("hello").index(/l./, 3))
-
- assert_nil(S("hello").index(?z, 3))
- assert_nil(S("hello").index(S("z"), 3))
- assert_nil(S("hello").index(/z./, 3))
-
- assert_nil(S("hello").index(?z))
- assert_nil(S("hello").index(S("z")))
- assert_nil(S("hello").index(/z./))
-
- o = Object.new
- def o.to_str; "bar"; end
- assert_equal(3, "foobarbarbaz".index(o))
- assert_raise(TypeError) { "foo".index(Object.new) }
-
- assert_nil("foo".index(//, -100))
- assert_nil($~)
- end
-
- def test_intern
- assert_equal(:koala, S("koala").intern)
- assert(:koala != S("Koala").intern)
- end
-
- def test_length
- assert_equal(0, S("").length)
- assert_equal(4, S("1234").length)
- assert_equal(6, S("1234\r\n").length)
- assert_equal(7, S("\0011234\r\n").length)
- end
-
- def test_ljust
- assert_equal(S("hello"), S("hello").ljust(4))
- assert_equal(S("hello "), S("hello").ljust(11))
- end
-
- def test_next
- assert_equal(S("abd"), S("abc").next)
- assert_equal(S("z"), S("y").next)
- assert_equal(S("aaa"), S("zz").next)
-
- assert_equal(S("124"), S("123").next)
- assert_equal(S("1000"), S("999").next)
-
- assert_equal(S("2000aaa"), S("1999zzz").next)
- assert_equal(S("AAAAA000"), S("ZZZZ999").next)
-
- assert_equal(S("*+"), S("**").next)
- end
-
- def test_next!
- a = S("abc")
- b = a.dup
- assert_equal(S("abd"), a.next!)
- assert_equal(S("abd"), a)
- assert_equal(S("abc"), b)
-
- a = S("y")
- assert_equal(S("z"), a.next!)
- assert_equal(S("z"), a)
-
- a = S("zz")
- assert_equal(S("aaa"), a.next!)
- assert_equal(S("aaa"), a)
-
- a = S("123")
- assert_equal(S("124"), a.next!)
- assert_equal(S("124"), a)
-
- a = S("999")
- assert_equal(S("1000"), a.next!)
- assert_equal(S("1000"), a)
-
- a = S("1999zzz")
- assert_equal(S("2000aaa"), a.next!)
- assert_equal(S("2000aaa"), a)
-
- a = S("ZZZZ999")
- assert_equal(S("AAAAA000"), a.next!)
- assert_equal(S("AAAAA000"), a)
-
- a = S("**")
- assert_equal(S("*+"), a.next!)
- assert_equal(S("*+"), a)
- end
-
- def test_oct
- assert_equal(255, S("0377").oct)
- assert_equal(255, S("377").oct)
- assert_equal(-255, S("-0377").oct)
- assert_equal(-255, S("-377").oct)
- assert_equal(0, S("OO").oct)
- assert_equal(24, S("030OO").oct)
- end
-
- def test_replace
- a = S("foo")
- assert_equal(S("f"), a.replace(S("f")))
-
- a = S("foo")
- assert_equal(S("foobar"), a.replace(S("foobar")))
-
- a = S("foo")
- a.taint
- a.untrust
- b = a.replace(S("xyz"))
- assert_equal(S("xyz"), b)
- assert(b.tainted?)
- assert(b.untrusted?)
-
- s = "foo" * 100
- s2 = ("bar" * 100).dup
- s.replace(s2)
- assert_equal(s2, s)
-
- s2 = ["foo"].pack("p")
- s.replace(s2)
- assert_equal(s2, s)
- end
-
- def test_reverse
- assert_equal(S("beta"), S("ateb").reverse)
- assert_equal(S("madamImadam"), S("madamImadam").reverse)
-
- a=S("beta")
- assert_equal(S("ateb"), a.reverse)
- assert_equal(S("beta"), a)
- end
-
- def test_reverse!
- a = S("beta")
- b = a.dup
- assert_equal(S("ateb"), a.reverse!)
- assert_equal(S("ateb"), a)
- assert_equal(S("beta"), b)
-
- assert_equal(S("madamImadam"), S("madamImadam").reverse!)
-
- a = S("madamImadam")
- assert_equal(S("madamImadam"), a.reverse!) # ??
- assert_equal(S("madamImadam"), a)
- end
-
- def test_rindex
- assert_equal(3, S("hello").rindex(?l))
- assert_equal(6, S("ell, hello").rindex(S("ell")))
- assert_equal(7, S("ell, hello").rindex(/ll./))
-
- assert_equal(3, S("hello,lo").rindex(?l, 3))
- assert_equal(3, S("hello,lo").rindex(S("l"), 3))
- assert_equal(3, S("hello,lo").rindex(/l./, 3))
-
- assert_nil(S("hello").rindex(?z, 3))
- assert_nil(S("hello").rindex(S("z"), 3))
- assert_nil(S("hello").rindex(/z./, 3))
-
- assert_nil(S("hello").rindex(?z))
- assert_nil(S("hello").rindex(S("z")))
- assert_nil(S("hello").rindex(/z./))
-
- o = Object.new
- def o.to_str; "bar"; end
- assert_equal(6, "foobarbarbaz".rindex(o))
- assert_raise(TypeError) { "foo".rindex(Object.new) }
-
- assert_nil("foo".rindex(//, -100))
- assert_nil($~)
- end
-
- def test_rjust
- assert_equal(S("hello"), S("hello").rjust(4))
- assert_equal(S(" hello"), S("hello").rjust(11))
- end
-
- def test_scan
- a = S("cruel world")
- assert_equal([S("cruel"), S("world")],a.scan(/\w+/))
- assert_equal([S("cru"), S("el "), S("wor")],a.scan(/.../))
- assert_equal([[S("cru")], [S("el ")], [S("wor")]],a.scan(/(...)/))
-
- res = []
- a.scan(/\w+/) { |w| res << w }
- assert_equal([S("cruel"), S("world") ],res)
-
- res = []
- a.scan(/.../) { |w| res << w }
- assert_equal([S("cru"), S("el "), S("wor")],res)
-
- res = []
- a.scan(/(...)/) { |w| res << w }
- assert_equal([[S("cru")], [S("el ")], [S("wor")]],res)
- end
-
- def test_size
- assert_equal(0, S("").size)
- assert_equal(4, S("1234").size)
- assert_equal(6, S("1234\r\n").size)
- assert_equal(7, S("\0011234\r\n").size)
- end
-
- def test_slice
- assert_equal(?A, S("AooBar").slice(0))
- assert_equal(?B, S("FooBaB").slice(-1))
- assert_nil(S("FooBar").slice(6))
- assert_nil(S("FooBar").slice(-7))
-
- assert_equal(S("Foo"), S("FooBar").slice(0,3))
- assert_equal(S(S("Bar")), S("FooBar").slice(-3,3))
- assert_nil(S("FooBar").slice(7,2)) # Maybe should be six?
- assert_nil(S("FooBar").slice(-7,10))
-
- assert_equal(S("Foo"), S("FooBar").slice(0..2))
- assert_equal(S("Bar"), S("FooBar").slice(-3..-1))
- assert_equal(S(""), S("FooBar").slice(6..2))
- assert_nil(S("FooBar").slice(-10..-7))
-
- assert_equal(S("Foo"), S("FooBar").slice(/^F../))
- assert_equal(S("Bar"), S("FooBar").slice(/..r$/))
- assert_nil(S("FooBar").slice(/xyzzy/))
- assert_nil(S("FooBar").slice(/plugh/))
-
- assert_equal(S("Foo"), S("FooBar").slice(S("Foo")))
- assert_equal(S("Bar"), S("FooBar").slice(S("Bar")))
- assert_nil(S("FooBar").slice(S("xyzzy")))
- assert_nil(S("FooBar").slice(S("plugh")))
- end
-
- def test_slice!
- a = S("AooBar")
- b = a.dup
- assert_equal(?A, a.slice!(0))
- assert_equal(S("ooBar"), a)
- assert_equal(S("AooBar"), b)
-
- a = S("FooBar")
- assert_equal(?r,a.slice!(-1))
- assert_equal(S("FooBa"), a)
-
- a = S("FooBar")
- if @aref_slicebang_silent
- assert_nil( a.slice!(6) )
- else
- assert_raise(IndexError) { a.slice!(6) }
- end
- assert_equal(S("FooBar"), a)
-
- if @aref_slicebang_silent
- assert_nil( a.slice!(-7) )
- else
- assert_raise(IndexError) { a.slice!(-7) }
- end
- assert_equal(S("FooBar"), a)
-
- a = S("FooBar")
- assert_equal(S("Foo"), a.slice!(0,3))
- assert_equal(S("Bar"), a)
-
- a = S("FooBar")
- assert_equal(S("Bar"), a.slice!(-3,3))
- assert_equal(S("Foo"), a)
-
- a=S("FooBar")
- if @aref_slicebang_silent
- assert_nil(a.slice!(7,2)) # Maybe should be six?
- else
- assert_raise(IndexError) {a.slice!(7,2)} # Maybe should be six?
- end
- assert_equal(S("FooBar"), a)
- if @aref_slicebang_silent
- assert_nil(a.slice!(-7,10))
- else
- assert_raise(IndexError) {a.slice!(-7,10)}
- end
- assert_equal(S("FooBar"), a)
-
- a=S("FooBar")
- assert_equal(S("Foo"), a.slice!(0..2))
- assert_equal(S("Bar"), a)
-
- a=S("FooBar")
- assert_equal(S("Bar"), a.slice!(-3..-1))
- assert_equal(S("Foo"), a)
-
- a=S("FooBar")
- if @aref_slicebang_silent
- assert_equal(S(""), a.slice!(6..2))
- else
- assert_raise(RangeError) {a.slice!(6..2)}
- end
- assert_equal(S("FooBar"), a)
- if @aref_slicebang_silent
- assert_nil(a.slice!(-10..-7))
- else
- assert_raise(RangeError) {a.slice!(-10..-7)}
- end
- assert_equal(S("FooBar"), a)
-
- a=S("FooBar")
- assert_equal(S("Foo"), a.slice!(/^F../))
- assert_equal(S("Bar"), a)
-
- a=S("FooBar")
- assert_equal(S("Bar"), a.slice!(/..r$/))
- assert_equal(S("Foo"), a)
-
- a=S("FooBar")
- if @aref_slicebang_silent
- assert_nil(a.slice!(/xyzzy/))
- else
- assert_raise(IndexError) {a.slice!(/xyzzy/)}
- end
- assert_equal(S("FooBar"), a)
- if @aref_slicebang_silent
- assert_nil(a.slice!(/plugh/))
- else
- assert_raise(IndexError) {a.slice!(/plugh/)}
- end
- assert_equal(S("FooBar"), a)
-
- a=S("FooBar")
- assert_equal(S("Foo"), a.slice!(S("Foo")))
- assert_equal(S("Bar"), a)
-
- a=S("FooBar")
- assert_equal(S("Bar"), a.slice!(S("Bar")))
- assert_equal(S("Foo"), a)
-
- pre_1_7_1 do
- a=S("FooBar")
- assert_nil(a.slice!(S("xyzzy")))
- assert_equal(S("FooBar"), a)
- assert_nil(a.slice!(S("plugh")))
- assert_equal(S("FooBar"), a)
- end
-
- assert_raise(ArgumentError) { "foo".slice! }
- end
-
- def test_split
- assert_nil($;)
- assert_equal([S("a"), S("b"), S("c")], S(" a b\t c ").split)
- assert_equal([S("a"), S("b"), S("c")], S(" a b\t c ").split(S(" ")))
-
- assert_equal([S(" a "), S(" b "), S(" c ")], S(" a | b | c ").split(S("|")))
-
- assert_equal([S("a"), S("b"), S("c")], S("aXXbXXcXX").split(/X./))
-
- assert_equal([S("a"), S("b"), S("c")], S("abc").split(//))
-
- assert_equal([S("a|b|c")], S("a|b|c").split(S('|'), 1))
-
- assert_equal([S("a"), S("b|c")], S("a|b|c").split(S('|'), 2))
- assert_equal([S("a"), S("b"), S("c")], S("a|b|c").split(S('|'), 3))
-
- assert_equal([S("a"), S("b"), S("c"), S("")], S("a|b|c|").split(S('|'), -1))
- assert_equal([S("a"), S("b"), S("c"), S(""), S("")], S("a|b|c||").split(S('|'), -1))
-
- assert_equal([S("a"), S(""), S("b"), S("c")], S("a||b|c|").split(S('|')))
- assert_equal([S("a"), S(""), S("b"), S("c"), S("")], S("a||b|c|").split(S('|'), -1))
-
- assert_equal([], "".split(//, 1))
-
- assert_equal("[2, 3]", [1,2,3].slice!(1,10000).inspect, "moved from btest/knownbug")
-
- end
-
- def test_squeeze
- assert_equal(S("abc"), S("aaabbbbccc").squeeze)
- assert_equal(S("aa bb cc"), S("aa bb cc").squeeze(S(" ")))
- assert_equal(S("BxTyWz"), S("BxxxTyyyWzzzzz").squeeze(S("a-z")))
- end
-
- def test_squeeze!
- a = S("aaabbbbccc")
- b = a.dup
- assert_equal(S("abc"), a.squeeze!)
- assert_equal(S("abc"), a)
- assert_equal(S("aaabbbbccc"), b)
-
- a = S("aa bb cc")
- assert_equal(S("aa bb cc"), a.squeeze!(S(" ")))
- assert_equal(S("aa bb cc"), a)
-
- a = S("BxxxTyyyWzzzzz")
- assert_equal(S("BxTyWz"), a.squeeze!(S("a-z")))
- assert_equal(S("BxTyWz"), a)
-
- a=S("The quick brown fox")
- assert_nil(a.squeeze!)
- end
-
- def test_strip
- assert_equal(S("x"), S(" x ").strip)
- assert_equal(S("x"), S(" \n\r\t x \t\r\n\n ").strip)
- assert_equal(S(""), S("\xa0".force_encoding("iso-8859-1")).strip)
- assert_equal(S("a"), S("a\xa0".force_encoding("iso-8859-1")).strip)
- end
-
- def test_strip!
- a = S(" x ")
- b = a.dup
- assert_equal(S("x") ,a.strip!)
- assert_equal(S("x") ,a)
- assert_equal(S(" x "), b)
-
- a = S(" \n\r\t x \t\r\n\n ")
- assert_equal(S("x"), a.strip!)
- assert_equal(S("x"), a)
-
- a = S("x")
- assert_nil(a.strip!)
- assert_equal(S("x") ,a)
- end
-
- def test_sub
- assert_equal(S("h*llo"), S("hello").sub(/[aeiou]/, S('*')))
- assert_equal(S("h<e>llo"), S("hello").sub(/([aeiou])/, S('<\1>')))
- assert_equal(S("h ello"), S("hello").sub(/./) {
- |s| s[0].to_s + S(' ')})
- assert_equal(S("HELL-o"), S("hello").sub(/(hell)(.)/) {
- |s| $1.upcase + S('-') + $2
- })
-
- assert_equal(S("a\\aba"), S("ababa").sub(/b/, '\\'))
- assert_equal(S("ab\\aba"), S("ababa").sub(/(b)/, '\1\\'))
- assert_equal(S("ababa"), S("ababa").sub(/(b)/, '\1'))
- assert_equal(S("ababa"), S("ababa").sub(/(b)/, '\\1'))
- assert_equal(S("a\\1aba"), S("ababa").sub(/(b)/, '\\\1'))
- assert_equal(S("a\\1aba"), S("ababa").sub(/(b)/, '\\\\1'))
- assert_equal(S("a\\baba"), S("ababa").sub(/(b)/, '\\\\\1'))
-
- assert_equal(S("a--ababababababababab"),
- S("abababababababababab").sub(/(b)/, '-\9-'))
- assert_equal(S("1-b-0"),
- S("1b2b3b4b5b6b7b8b9b0").
- sub(/(b).(b).(b).(b).(b).(b).(b).(b).(b)/, '-\9-'))
- assert_equal(S("1-b-0"),
- S("1b2b3b4b5b6b7b8b9b0").
- sub(/(b).(b).(b).(b).(b).(b).(b).(b).(b)/, '-\\9-'))
- assert_equal(S("1-\\9-0"),
- S("1b2b3b4b5b6b7b8b9b0").
- sub(/(b).(b).(b).(b).(b).(b).(b).(b).(b)/, '-\\\9-'))
- assert_equal(S("k"),
- S("1a2b3c4d5e6f7g8h9iAjBk").
- sub(/.(.).(.).(.).(.).(.).(.).(.).(.).(.).(.).(.)/, '\+'))
-
- assert_equal(S("ab\\aba"), S("ababa").sub(/b/, '\&\\'))
- assert_equal(S("ababa"), S("ababa").sub(/b/, '\&'))
- assert_equal(S("ababa"), S("ababa").sub(/b/, '\\&'))
- assert_equal(S("a\\&aba"), S("ababa").sub(/b/, '\\\&'))
- assert_equal(S("a\\&aba"), S("ababa").sub(/b/, '\\\\&'))
- assert_equal(S("a\\baba"), S("ababa").sub(/b/, '\\\\\&'))
-
- a = S("hello")
- a.taint
- a.untrust
- x = a.sub(/./, S('X'))
- assert(x.tainted?)
- assert(x.untrusted?)
-
- o = Object.new
- def o.to_str; "bar"; end
- assert_equal("fooBARbaz", "foobarbaz".sub(o, "BAR"))
-
- assert_raise(TypeError) { "foo".sub(Object.new, "") }
-
- assert_raise(ArgumentError) { "foo".sub }
-
- assert_raise(IndexError) { "foo"[/(?:(o$)|(x))/, 2] = 'bar' }
-
- o = Object.new
- def o.to_s; self; end
- assert_match(/^foo#<Object:0x.*>baz$/, "foobarbaz".sub("bar") { o })
- end
-
- def test_sub!
- a = S("hello")
- b = a.dup
- a.sub!(/[aeiou]/, S('*'))
- assert_equal(S("h*llo"), a)
- assert_equal(S("hello"), b)
-
- a = S("hello")
- a.sub!(/([aeiou])/, S('<\1>'))
- assert_equal(S("h<e>llo"), a)
-
- a = S("hello")
- a.sub!(/./) { |s| s[0].to_s + S(' ')}
- assert_equal(S("h ello"), a)
-
- a = S("hello")
- a.sub!(/(hell)(.)/) { |s| $1.upcase + S('-') + $2 }
- assert_equal(S("HELL-o"), a)
-
- a=S("hello")
- assert_nil(a.sub!(/X/, S('Y')))
-
- r = S('X')
- r.taint
- r.untrust
- a.sub!(/./, r)
- assert(a.tainted?)
- assert(a.untrusted?)
- end
-
- def test_succ
- assert_equal(S("abd"), S("abc").succ)
- assert_equal(S("z"), S("y").succ)
- assert_equal(S("aaa"), S("zz").succ)
-
- assert_equal(S("124"), S("123").succ)
- assert_equal(S("1000"), S("999").succ)
- assert_equal(S("2.000"), S("1.999").succ)
-
- assert_equal(S("No.10"), S("No.9").succ)
- assert_equal(S("2000aaa"), S("1999zzz").succ)
- assert_equal(S("AAAAA000"), S("ZZZZ999").succ)
- assert_equal(S("*+"), S("**").succ)
-
- assert_equal("abce", "abcd".succ)
- assert_equal("THX1139", "THX1138".succ)
- assert_equal("<<koalb>>", "<<koala>>".succ)
- assert_equal("2000aaa", "1999zzz".succ)
- assert_equal("AAAA0000", "ZZZ9999".succ)
- assert_equal("**+", "***".succ)
- end
-
- def test_succ!
- a = S("abc")
- b = a.dup
- assert_equal(S("abd"), a.succ!)
- assert_equal(S("abd"), a)
- assert_equal(S("abc"), b)
-
- a = S("y")
- assert_equal(S("z"), a.succ!)
- assert_equal(S("z"), a)
-
- a = S("zz")
- assert_equal(S("aaa"), a.succ!)
- assert_equal(S("aaa"), a)
-
- a = S("123")
- assert_equal(S("124"), a.succ!)
- assert_equal(S("124"), a)
-
- a = S("999")
- assert_equal(S("1000"), a.succ!)
- assert_equal(S("1000"), a)
-
- a = S("1999zzz")
- assert_equal(S("2000aaa"), a.succ!)
- assert_equal(S("2000aaa"), a)
-
- a = S("ZZZZ999")
- assert_equal(S("AAAAA000"), a.succ!)
- assert_equal(S("AAAAA000"), a)
-
- a = S("**")
- assert_equal(S("*+"), a.succ!)
- assert_equal(S("*+"), a)
-
- a = S("No.9")
- assert_equal(S("No.10"), a.succ!)
- assert_equal(S("No.10"), a)
-
- assert_equal("aaaaaaaaaaaa", "zzzzzzzzzzz".succ!)
- assert_equal("aaaaaaaaaaaaaaaaaaaaaaaa", "zzzzzzzzzzzzzzzzzzzzzzz".succ!)
- end
-
- def test_sum
- n = S("\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001")
- assert_equal(15, n.sum)
- n += S("\001")
- assert_equal(16, n.sum(17))
- n[0] = 2.chr
- assert(15 != n.sum)
- end
-
def check_sum(str, bits=16)
sum = 0
str.each_byte {|c| sum += c}
sum = sum & ((1 << bits) - 1) if bits != 0
assert_equal(sum, str.sum(bits))
end
-
- def test_sum_2
+ def test_sum
assert_equal(0, "".sum)
assert_equal(294, "abc".sum)
check_sum("abc")
@@ -1340,455 +16,4 @@ class TestString < Test::Unit::TestCase
check_sum("xyz", bits)
}
end
-
- def test_swapcase
- assert_equal(S("hi&LOW"), S("HI&low").swapcase)
- end
-
- def test_swapcase!
- a = S("hi&LOW")
- b = a.dup
- assert_equal(S("HI&low"), a.swapcase!)
- assert_equal(S("HI&low"), a)
- assert_equal(S("hi&LOW"), b)
-
- a = S("$^#^%$#!!")
- assert_nil(a.swapcase!)
- assert_equal(S("$^#^%$#!!"), a)
- end
-
- def test_to_f
- assert_equal(344.3, S("344.3").to_f)
- assert_equal(5.9742e24, S("5.9742e24").to_f)
- assert_equal(98.6, S("98.6 degrees").to_f)
- assert_equal(0.0, S("degrees 100.0").to_f)
- end
-
- def test_to_i
- assert_equal(1480, S("1480ft/sec").to_i)
- assert_equal(0, S("speed of sound in water @20C = 1480ft/sec)").to_i)
- assert_equal(0, " 0".to_i)
- assert_equal(0, "+0".to_i)
- assert_equal(0, "-0".to_i)
- assert_equal(0, "--0".to_i)
- assert_equal(16, "0x10".to_i(0))
- assert_equal(16, "0X10".to_i(0))
- assert_equal(2, "0b10".to_i(0))
- assert_equal(2, "0B10".to_i(0))
- assert_equal(8, "0o10".to_i(0))
- assert_equal(8, "0O10".to_i(0))
- assert_equal(10, "0d10".to_i(0))
- assert_equal(10, "0D10".to_i(0))
- assert_equal(8, "010".to_i(0))
- assert_raise(ArgumentError) { "010".to_i(-10) }
- 2.upto(36) {|radix|
- assert_equal(radix, "10".to_i(radix))
- assert_equal(radix**2, "100".to_i(radix))
- }
- assert_raise(ArgumentError) { "0".to_i(1) }
- assert_raise(ArgumentError) { "0".to_i(37) }
- assert_equal(0, "z".to_i(10))
- assert_equal(12, "1_2".to_i(10))
- assert_equal(0x40000000, "1073741824".to_i(10))
- assert_equal(0x4000000000000000, "4611686018427387904".to_i(10))
- assert_equal(1, "1__2".to_i(10))
- assert_equal(1, "1_z".to_i(10))
- end
-
- def test_to_s
- a = S("me")
- assert_equal("me", a.to_s)
- assert_equal(a.__id__, a.to_s.__id__) if @cls == String
- end
-
- def test_to_str
- a = S("me")
- assert_equal("me", a.to_s)
- assert_equal(a.__id__, a.to_s.__id__) if @cls == String
- end
-
- def test_tr
- assert_equal(S("hippo"), S("hello").tr(S("el"), S("ip")))
- assert_equal(S("*e**o"), S("hello").tr(S("^aeiou"), S("*")))
- assert_equal(S("hal"), S("ibm").tr(S("b-z"), S("a-z")))
-
- a = "abc".force_encoding(Encoding::US_ASCII)
- assert_equal(Encoding::US_ASCII, a.tr(S("z"), S("\u0101")).encoding, '[ruby-core:22326]')
-
- assert_equal("a".hash, "a".tr("a", "\u0101").tr("\u0101", "a").hash, '[ruby-core:22328]')
- assert_equal(true, "\u0101".tr("\u0101", "a").ascii_only?)
- assert_equal(true, "\u3041".tr("\u3041", "a").ascii_only?)
- assert_equal(false, "\u3041\u3042".tr("\u3041", "a").ascii_only?)
- end
-
- def test_tr!
- a = S("hello")
- b = a.dup
- assert_equal(S("hippo"), a.tr!(S("el"), S("ip")))
- assert_equal(S("hippo"), a)
- assert_equal(S("hello"),b)
-
- a = S("hello")
- assert_equal(S("*e**o"), a.tr!(S("^aeiou"), S("*")))
- assert_equal(S("*e**o"), a)
-
- a = S("IBM")
- assert_equal(S("HAL"), a.tr!(S("B-Z"), S("A-Z")))
- assert_equal(S("HAL"), a)
-
- a = S("ibm")
- assert_nil(a.tr!(S("B-Z"), S("A-Z")))
- assert_equal(S("ibm"), a)
-
- a = "abc".force_encoding(Encoding::US_ASCII)
- assert_nil(a.tr!(S("z"), S("\u0101")), '[ruby-core:22326]')
- assert_equal(Encoding::US_ASCII, a.encoding, '[ruby-core:22326]')
- end
-
- def test_tr_s
- assert_equal(S("hypo"), S("hello").tr_s(S("el"), S("yp")))
- assert_equal(S("h*o"), S("hello").tr_s(S("el"), S("*")))
- assert_equal("a".hash, "\u0101\u0101".tr_s("\u0101", "a").hash)
- assert_equal(true, "\u3041\u3041".tr("\u3041", "a").ascii_only?)
- end
-
- def test_tr_s!
- a = S("hello")
- b = a.dup
- assert_equal(S("hypo"), a.tr_s!(S("el"), S("yp")))
- assert_equal(S("hypo"), a)
- assert_equal(S("hello"), b)
-
- a = S("hello")
- assert_equal(S("h*o"), a.tr_s!(S("el"), S("*")))
- assert_equal(S("h*o"), a)
- end
-
- def test_unpack
- a = [S("cat"), S("wom"), S("x"), S("yy")]
- assert_equal(a, S("catwomx yy ").unpack(S("A3A3A3A3")))
-
- assert_equal([S("cat")], S("cat \000\000").unpack(S("A*")))
- assert_equal([S("cwx"), S("wx"), S("x"), S("yy")],
- S("cwx yy ").unpack(S("A3@1A3@2A3A3")))
- assert_equal([S("cat"), S("wom"), S("x\000\000"), S("yy\000")],
- S("catwomx\000\000yy\000").unpack(S("a3a3a3a3")))
- assert_equal([S("cat \000\000")], S("cat \000\000").unpack(S("a*")))
- assert_equal([S("ca")], S("catdog").unpack(S("a2")))
-
- assert_equal([S("cat\000\000")],
- S("cat\000\000\000\000\000dog").unpack(S("a5")))
-
- assert_equal([S("01100001")], S("\x61").unpack(S("B8")))
- assert_equal([S("01100001")], S("\x61").unpack(S("B*")))
- assert_equal([S("0110000100110111")], S("\x61\x37").unpack(S("B16")))
- assert_equal([S("01100001"), S("00110111")], S("\x61\x37").unpack(S("B8B8")))
- assert_equal([S("0110")], S("\x60").unpack(S("B4")))
-
- assert_equal([S("01")], S("\x40").unpack(S("B2")))
-
- assert_equal([S("01100001")], S("\x86").unpack(S("b8")))
- assert_equal([S("01100001")], S("\x86").unpack(S("b*")))
-
- assert_equal([S("0110000100110111")], S("\x86\xec").unpack(S("b16")))
- assert_equal([S("01100001"), S("00110111")], S("\x86\xec").unpack(S("b8b8")))
-
- assert_equal([S("0110")], S("\x06").unpack(S("b4")))
- assert_equal([S("01")], S("\x02").unpack(S("b2")))
-
- assert_equal([ 65, 66, 67 ], S("ABC").unpack(S("C3")))
- assert_equal([ 255, 66, 67 ], S("\377BC").unpack("C*"))
- assert_equal([ 65, 66, 67 ], S("ABC").unpack("c3"))
- assert_equal([ -1, 66, 67 ], S("\377BC").unpack("c*"))
-
-
- assert_equal([S("4142"), S("0a"), S("1")], S("AB\n\x10").unpack(S("H4H2H1")))
- assert_equal([S("1424"), S("a0"), S("2")], S("AB\n\x02").unpack(S("h4h2h1")))
-
- assert_equal([S("abc\002defcat\001"), S(""), S("")],
- S("abc=02def=\ncat=\n=01=\n").unpack(S("M9M3M4")))
-
- assert_equal([S("hello\n")], S("aGVsbG8K\n").unpack(S("m")))
-
- assert_equal([S("hello\nhello\n")], S(",:&5L;&\\*:&5L;&\\*\n").unpack(S("u")))
-
- assert_equal([0xa9, 0x42, 0x2260], S("\xc2\xa9B\xe2\x89\xa0").unpack(S("U*")))
-
-=begin
- skipping "Not tested:
- D,d & double-precision float, native format\\
- E & double-precision float, little-endian byte order\\
- e & single-precision float, little-endian byte order\\
- F,f & single-precision float, native format\\
- G & double-precision float, network (big-endian) byte order\\
- g & single-precision float, network (big-endian) byte order\\
- I & unsigned integer\\
- i & integer\\
- L & unsigned long\\
- l & long\\
-
- m & string encoded in base64 (uuencoded)\\
- N & long, network (big-endian) byte order\\
- n & short, network (big-endian) byte-order\\
- P & pointer to a structure (fixed-length string)\\
- p & pointer to a null-terminated string\\
- S & unsigned short\\
- s & short\\
- V & long, little-endian byte order\\
- v & short, little-endian byte order\\
- X & back up a byte\\
- x & null byte\\
- Z & ASCII string (null padded, count is width)\\
-"
-=end
- end
-
- def test_upcase
- assert_equal(S("HELLO"), S("hello").upcase)
- assert_equal(S("HELLO"), S("hello").upcase)
- assert_equal(S("HELLO"), S("HELLO").upcase)
- assert_equal(S("ABC HELLO 123"), S("abc HELLO 123").upcase)
- end
-
- def test_upcase!
- a = S("hello")
- b = a.dup
- assert_equal(S("HELLO"), a.upcase!)
- assert_equal(S("HELLO"), a)
- assert_equal(S("hello"), b)
-
- a = S("HELLO")
- assert_nil(a.upcase!)
- assert_equal(S("HELLO"), a)
- end
-
- def test_upto
- a = S("aa")
- start = S("aa")
- count = 0
- assert_equal(S("aa"), a.upto(S("zz")) {|s|
- assert_equal(start, s)
- start.succ!
- count += 1
- })
- assert_equal(676, count)
- end
-
- def test_mod_check
- assert_raise(RuntimeError) {
- s = ""
- s.sub!(/\A/) { s.replace "z" * 2000; "zzz" }
- }
- end
-
- def test_frozen_check
- assert_raise(RuntimeError) {
- s = ""
- s.sub!(/\A/) { s.freeze; "zzz" }
- }
- end
-
- def test_tainted_str_new
- a = []
- a << a
- s = a.inspect
- assert(s.tainted?)
- assert_equal("[[...]]", s)
- end
-
- class S2 < String
- end
- def test_str_new4
- s = (0..54).to_a.join # length = 100
- s2 = S2.new(s[10,90])
- s3 = s2[10,80]
- assert_equal((10..54).to_a.to_a.join, s2)
- assert_equal((15..54).to_a.to_a.join, s3)
- end
-
- def test_rb_str_new4
- s = "a" * 100
- s2 = s[10,90]
- assert_equal("a" * 90, s2)
- s3 = s2[10,80]
- assert_equal("a" * 80, s3)
- end
-
- class StringLike
- def initialize(str)
- @str = str
- end
-
- def to_str
- @str
- end
- end
-
- def test_rb_str_to_str
- assert_equal("ab", "a" + StringLike.new("b"))
- end
-
- def test_rb_str_shared_replace
- s = "a" * 100
- s.succ!
- assert_equal("a" * 99 + "b", s)
- s = ""
- s.succ!
- assert_equal("", s)
- end
-
- def test_times
- assert_raise(ArgumentError) { "a" * (-1) }
- end
-
- def test_splice!
- l = S("1234\n234\n34\n4\n")
- assert_equal(S("1234\n"), l.slice!(/\A.*\n/), "[ruby-dev:31665]")
- assert_equal(S("234\n"), l.slice!(/\A.*\n/), "[ruby-dev:31665]")
- assert_equal(S("34\n"), l.slice!(/\A.*\n/), "[ruby-dev:31665]")
- assert_equal(S("4\n"), l.slice!(/\A.*\n/), "[ruby-dev:31665]")
- assert_nil(l.slice!(/\A.*\n/), "[ruby-dev:31665]")
- end
-
- def test_end_with?
- assert("abc".end_with?("c"))
- end
-
- def test_times2
- s1 = ''
- 100.times {|n|
- s2 = "a" * n
- assert_equal(s1, s2)
- s1 << 'a'
- }
-
- assert_raise(ArgumentError) { "foo" * (-1) }
- end
-
- def test_respond_to
- o = Object.new
- def o.respond_to?(arg) [:to_str].include?(arg) ? nil : super end
- def o.to_str() "" end
- def o.==(other) "" == other end
- assert_equal(false, "" == o)
- end
-
- def test_match_method
- assert_equal("bar", "foobarbaz".match(/bar/).to_s)
-
- o = /foo/
- def o.match(x, y, z); x + y + z; end
- assert_equal("foobarbaz", "foo".match(o, "bar", "baz"))
- x = nil
- "foo".match(o, "bar", "baz") {|y| x = y }
- assert_equal("foobarbaz", x)
-
- assert_raise(ArgumentError) { "foo".match }
- end
-
- def test_clear
- s = "foo" * 100
- s.clear
- assert_equal("", s)
- end
-
- def test_to_s_2
- c = Class.new(String)
- s = c.new
- s.replace("foo")
- assert_equal("foo", s.to_s)
- assert_instance_of(String, s.to_s)
- end
-
- def test_partition
- assert_equal(%w(he l lo), "hello".partition(/l/))
- assert_equal(%w(he l lo), "hello".partition("l"))
- assert_raise(TypeError) { "hello".partition(1) }
- def (hyphen = Object.new).to_str; "-"; end
- assert_equal(%w(foo - bar), "foo-bar".partition(hyphen), '[ruby-core:23540]')
- end
-
- def test_rpartition
- assert_equal(%w(hel l o), "hello".rpartition(/l/))
- assert_equal(%w(hel l o), "hello".rpartition("l"))
- assert_raise(TypeError) { "hello".rpartition(1) }
- def (hyphen = Object.new).to_str; "-"; end
- assert_equal(%w(foo - bar), "foo-bar".rpartition(hyphen), '[ruby-core:23540]')
- end
-
- def test_setter
- assert_raise(TypeError) { $/ = 1 }
- end
-
- def test_to_id
- c = Class.new
- c.class_eval do
- def initialize
- @foo = :foo
- end
- end
-
- assert_raise(TypeError) do
- c.class_eval { attr 1 }
- end
-
- o = Object.new
- def o.to_str; :foo; end
- assert_raise(TypeError) do
- c.class_eval { attr 1 }
- end
-
- def o.to_str; "foo"; end
- assert_nothing_raised do
- c.class_eval { attr o }
- end
- assert_equal(:foo, c.new.foo)
- end
-
- def test_gsub_enumerator
- assert_normal_exit %q{"abc".gsub(/./).next}, "[ruby-dev:34828]"
- end
-
- def test_clear_nonasciicompat
- assert_equal("", "\u3042".encode("ISO-2022-JP").clear)
- end
-
- def test_try_convert
- assert_equal(nil, String.try_convert(1))
- assert_equal("foo", String.try_convert("foo"))
- end
-
- def test_substr_negative_begin
- assert_equal("\u3042", ("\u3042" * 100)[-1])
- end
-
- def test_compare_different_encoding_string
- s1 = "\xff".force_encoding("UTF-8")
- s2 = "\xff".force_encoding("ISO-2022-JP")
- #assert_equal([-1, 1], [s1 <=> s2, s2 <=> s1].sort)
- end
-
- def test_casecmp
- assert_equal(1, "\u3042B".casecmp("\u3042a"))
- end
-
- def test_upcase2
- assert_equal("\u3042AB", "\u3042aB".upcase)
- end
-
- def test_downcase2
- assert_equal("\u3042ab", "\u3042aB".downcase)
- end
-
- def test_rstrip
- assert_equal("\u3042", "\u3042 ".rstrip)
- assert_raise(Encoding::CompatibilityError) { "\u3042".encode("ISO-2022-JP").rstrip }
- end
-
- def test_symbol_table_overflow
- return
- assert_in_out_err([], <<-INPUT, [], /symbol table overflow \(symbol [a-z]{8}\) \(RuntimeError\)/)
- ("aaaaaaaa".."zzzzzzzz").each {|s| s.to_sym }
- INPUT
- end
end
diff --git a/test/ruby/test_stringchar.rb b/test/ruby/test_stringchar.rb
index 184e221211..34934e87bd 100644
--- a/test/ruby/test_stringchar.rb
+++ b/test/ruby/test_stringchar.rb
@@ -34,7 +34,7 @@ class TestStringchar < Test::Unit::TestCase
ABCD
ABCD
END
- $x.gsub!(/((.|\n)*?)B((.|\n)*?)D/m ,'\1\3')
+ $x.gsub!(/((.|\n)*?)B((.|\n)*?)D/){$1+$3}
assert_equal("AC\nAC\n", $x)
assert("foobar" =~ /foo(?=(bar)|(baz))/)
@@ -68,9 +68,9 @@ END
# character constants(assumes ASCII)
assert_equal(?a, "a"[0])
assert_equal(?a, ?a)
- assert_equal("\1", ?\C-a)
- assert_equal("\341", ?\M-a)
- assert_equal("\201", ?\M-\C-a)
+ assert_equal(1, ?\C-a)
+ assert_equal(225, ?\M-a)
+ assert_equal(129, ?\M-\C-a)
assert_equal(?A, "a".upcase![0])
assert_equal(?a, "A".downcase![0])
assert_equal("ABC", "abc".tr!("a-z", "A-Z"))
@@ -82,7 +82,7 @@ END
$y = [ ?a, ?b, ?c, ?d, ?e, ?f ]
$bad = false
$x.each_byte {|i|
- if i.chr != $y.shift
+ if i != $y.shift
$bad = true
break
end
diff --git a/test/ruby/test_struct.rb b/test/ruby/test_struct.rb
index 6c0e1f4fb2..fa1bb1549a 100644
--- a/test/ruby/test_struct.rb
+++ b/test/ruby/test_struct.rb
@@ -21,195 +21,4 @@ class TestStruct < Test::Unit::TestCase
test.bar = 47
assert_equal(47, test.bar)
end
-
- # [ruby-dev:26247] more than 10 struct members causes segmentation fault
- def test_morethan10members
- list = %w( a b c d e f g h i j k l m n o p )
- until list.empty?
- c = Struct.new(* list.map {|ch| ch.intern }).new
- list.each do |ch|
- c.__send__(ch)
- end
- list.pop
- end
- end
-
- def test_small_structs
- names = [:a, :b, :c, :d]
- 1.upto(4) {|n|
- fields = names[0, n]
- klass = Struct.new(*fields)
- o = klass.new(*(0...n).to_a)
- fields.each_with_index {|name, i|
- assert_equal(i, o[name])
- }
- o = klass.new(*(0...n).to_a.reverse)
- fields.each_with_index {|name, i|
- assert_equal(n-i-1, o[name])
- }
- }
- end
-
- def test_inherit
- klass = Struct.new(:a)
- klass2 = Class.new(klass)
- o = klass2.new(1)
- assert_equal(1, o.a)
- end
-
- def test_members
- klass = Struct.new(:a)
- o = klass.new(1)
- assert_equal([:a], klass.members)
- assert_equal([:a], o.members)
- end
-
- def test_ref
- klass = Struct.new(:a)
- o = klass.new(1)
- assert_equal(1, o[:a])
- assert_raise(NameError) { o[:b] }
- end
-
- def test_modify
- klass = Struct.new(:a)
- o = klass.new(1)
- assert_raise(SecurityError) do
- Thread.new do
- $SAFE = 4
- o.a = 2
- end.value
- end
- end
-
- def test_set
- klass = Struct.new(:a)
- o = klass.new(1)
- o[:a] = 2
- assert_equal(2, o[:a])
- assert_raise(NameError) { o[:b] = 3 }
- end
-
- def test_struct_new
- assert_raise(NameError) { Struct.new("foo") }
- assert_nothing_raised { Struct.new("Foo") }
- Struct.instance_eval { remove_const(:Foo) }
- assert_nothing_raised { Struct.new(:a) { } }
- assert_raise(RuntimeError) { Struct.new(:a) { raise } }
-
- assert_equal([:utime, :stime, :cutime, :cstime], Process.times.members)
- end
-
- def test_initialize
- klass = Struct.new(:a)
- assert_raise(ArgumentError) { klass.new(1, 2) }
- end
-
- def test_each
- klass = Struct.new(:a, :b)
- o = klass.new(1, 2)
- assert_equal([1, 2], o.each.to_a)
- end
-
- def test_each_pair
- klass = Struct.new(:a, :b)
- o = klass.new(1, 2)
- assert_equal([[:a, 1], [:b, 2]], o.each_pair.to_a)
- end
-
- def test_inspect
- klass = Struct.new(:a)
- o = klass.new(1)
- assert_equal("#<struct a=1>", o.inspect)
- o.a = o
- assert(o.inspect =~ /^#<struct a=#<struct #<.*?>:...>>$/)
-
- Struct.new("Foo", :a)
- o = Struct::Foo.new(1)
- assert_equal("#<struct Struct::Foo a=1>", o.inspect)
- Struct.instance_eval { remove_const(:Foo) }
-
- klass = Struct.new(:a, :b)
- o = klass.new(1, 2)
- assert_equal("#<struct a=1, b=2>", o.inspect)
-
- klass = Struct.new(:@a)
- o = klass.new(1)
- assert_equal("#<struct :@a=1>", o.inspect)
- end
-
- def test_init_copy
- klass = Struct.new(:a)
- o = klass.new(1)
- assert_equal(o, o.dup)
- end
-
- def test_aref
- klass = Struct.new(:a)
- o = klass.new(1)
- assert_equal(1, o[0])
- assert_raise(IndexError) { o[-2] }
- assert_raise(IndexError) { o[1] }
- end
-
- def test_aset
- klass = Struct.new(:a)
- o = klass.new(1)
- o[0] = 2
- assert_equal(2, o[:a])
- assert_raise(IndexError) { o[-2] = 3 }
- assert_raise(IndexError) { o[1] = 3 }
- end
-
- def test_values_at
- klass = Struct.new(:a, :b, :c, :d, :e, :f)
- o = klass.new(1, 2, 3, 4, 5, 6)
- assert_equal([2, 4, 6], o.values_at(1, 3, 5))
- assert_equal([2, 3, 4, 3, 4, 5], o.values_at(1..3, 2...5))
- end
-
- def test_select
- klass = Struct.new(:a, :b, :c, :d, :e, :f)
- o = klass.new(1, 2, 3, 4, 5, 6)
- assert_equal([1, 3, 5], o.select {|v| v % 2 != 0 })
- assert_raise(ArgumentError) { o.select(1) }
- end
-
- def test_equal
- klass1 = Struct.new(:a)
- klass2 = Struct.new(:a, :b)
- o1 = klass1.new(1)
- o2 = klass1.new(1)
- o3 = klass2.new(1)
- assert(o1.==(o2))
- assert(o1 != o3)
- end
-
- def test_hash
- klass = Struct.new(:a)
- o = klass.new(1)
- assert(o.hash.is_a?(Fixnum))
- end
-
- def test_eql
- klass1 = Struct.new(:a)
- klass2 = Struct.new(:a, :b)
- o1 = klass1.new(1)
- o2 = klass1.new(1)
- o3 = klass2.new(1)
- assert(o1.eql?(o2))
- assert(!(o1.eql?(o3)))
- end
-
- def test_size
- klass = Struct.new(:a)
- o = klass.new(1)
- assert_equal(1, o.size)
- end
-
- def test_error
- assert_raise(TypeError){
- Struct.new(0)
- }
- end
end
diff --git a/test/ruby/test_super.rb b/test/ruby/test_super.rb
index 8de1e2fa7e..900fe997e6 100644
--- a/test/ruby/test_super.rb
+++ b/test/ruby/test_super.rb
@@ -120,23 +120,15 @@ class TestSuper < Test::Unit::TestCase
def uu(a)
class << self
define_method(:tt) do |sym|
- super(sym)
+ super
end
end
end
end
- def test_define_method
+ def test_define_method # [ruby-core:03856]
a = A.new
a.uu(12)
- assert_equal("A#tt", a.tt(12), "[ruby-core:3856]")
- e = assert_raise(RuntimeError, "[ruby-core:24244]") {
- lambda {
- Class.new do
- define_method(:a) {super}.call
- end
- }.call
- }
- assert_match(/implicit argument passing of super from method defined by define_method/, e.message)
+ assert_equal("A#tt", a.tt(12))
end
end
diff --git a/test/ruby/test_symbol.rb b/test/ruby/test_symbol.rb
index f402da3907..42350ba6e7 100644
--- a/test/ruby/test_symbol.rb
+++ b/test/ruby/test_symbol.rb
@@ -69,7 +69,7 @@ class TestSymbol < Test::Unit::TestCase
end
def test_inspect_number
- # 5) Inconsistency between :$0 and :$1? The first one is valid, but the
+ # 5) Inconsistency between :$0 and :$1? The first one is valid, but the
# latter isn't.
assert_inspect_evaled(':$0')
assert_inspect_evaled(':$1')
@@ -89,47 +89,4 @@ class TestSymbol < Test::Unit::TestCase
assert_equal ary_ids, ary.collect(&:object_id)
end
end
-
- def test_call
- o = Object.new
- def o.foo(x, y); x + y; end
-
- assert_equal(3, :foo.to_proc.call(o, 1, 2))
- assert_raise(ArgumentError) { :foo.to_proc.call }
- end
-
- def test_succ
- assert_equal(:fop, :foo.succ)
- end
-
- def test_cmp
- assert_equal(0, :FoO <=> :FoO)
- assert_equal(-1, :FoO <=> :fOO)
- assert_equal(1, :fOO <=> :FoO)
- assert_nil(:foo <=> "foo")
- end
-
- def test_casecmp
- assert_equal(0, :FoO.casecmp(:fOO))
- assert_equal(1, :FoO.casecmp(:BaR))
- assert_equal(-1, :baR.casecmp(:FoO))
- assert_nil(:foo.casecmp("foo"))
- end
-
- def test_length
- assert_equal(3, :FoO.length)
- assert_equal(3, :FoO.size)
- end
-
- def test_empty
- assert_equal(false, :FoO.empty?)
- assert_equal(true, :"".empty?)
- end
-
- def test_case
- assert_equal(:FOO, :FoO.upcase)
- assert_equal(:foo, :FoO.downcase)
- assert_equal(:Foo, :foo.capitalize)
- assert_equal(:fOo, :FoO.swapcase)
- end
end
diff --git a/test/ruby/test_system.rb b/test/ruby/test_system.rb
index 903918812d..3513577ec5 100644
--- a/test/ruby/test_system.rb
+++ b/test/ruby/test_system.rb
@@ -1,15 +1,13 @@
require 'test/unit'
-require 'tmpdir'
-require_relative 'envutil'
+$:.replace([File.dirname(File.expand_path(__FILE__))] | $:)
+require 'envutil'
class TestSystem < Test::Unit::TestCase
def valid_syntax?(code, fname)
- code = code.dup.force_encoding("ascii-8bit")
- code.sub!(/\A(?:\xef\xbb\xbf)?(\s*\#.*$)*(\n)?/n) {
- "#$&#{"\n" if $1 && !$2}BEGIN{throw tag, :ok}\n"
+ code = code.sub(/\A(?:\s*\#.*$)*(\n)?/n) {
+ "#$&#{"\n" if $1 && !$2}BEGIN{return true}\n"
}
- code.force_encoding("us-ascii")
- catch {|tag| eval(code, binding, fname, 0)}
+ eval(code, nil, fname, 0)
end
def test_system
@@ -17,72 +15,46 @@ class TestSystem < Test::Unit::TestCase
assert_equal("foobar\n", `echo foobar`)
assert_equal('foobar', `#{ruby} -e 'print "foobar"'`)
- Dir.mktmpdir("ruby_script_tmp") {|tmpdir|
- tmpfilename = "#{tmpdir}/ruby_script_tmp.#{$$}"
+ tmp = open("script_tmp", "w")
+ tmp.print "print $zzz\n";
+ tmp.close
- tmp = open(tmpfilename, "w")
- tmp.print "print $zzz\n";
- tmp.close
+ assert_equal('true', `#{ruby} -s script_tmp -zzz`)
+ assert_equal('555', `#{ruby} -s script_tmp -zzz=555`)
- assert_equal('true', `#{ruby} -s #{tmpfilename} -zzz`)
- assert_equal('555', `#{ruby} -s #{tmpfilename} -zzz=555`)
+ tmp = open("script_tmp", "w")
+ tmp.print "#! /usr/local/bin/ruby -s\n";
+ tmp.print "print $zzz\n";
+ tmp.close
- tmp = open(tmpfilename, "w")
- tmp.print "#! /usr/local/bin/ruby -s\n";
- tmp.print "print $zzz\n";
- tmp.close
+ assert_equal('678', `#{ruby} script_tmp -zzz=678`)
- assert_equal('678', `#{ruby} #{tmpfilename} -zzz=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
- tmp = open(tmpfilename, "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
+ assert_equal('nil', `#{ruby} -x script_tmp`)
+ assert_equal('555', `#{ruby} -x script_tmp -zzz=555`)
- assert_equal('', `#{ruby} -x #{tmpfilename}`)
- assert_equal('555', `#{ruby} -x #{tmpfilename} -zzz=555`)
-
- tmp = open(tmpfilename, "w")
- for i in 1..5
- tmp.print i, "\n"
- end
- tmp.close
-
- `#{ruby} -i.bak -pe '$_.sub!(/^[0-9]+$/){$&.to_i * 5}' #{tmpfilename}`
- tmp = open(tmpfilename, "r")
- while tmp.gets
- assert_equal(0, $_.to_i % 5)
- end
- tmp.close
+ tmp = open("script_tmp", "w")
+ for i in 1..5
+ tmp.print i, "\n"
+ end
+ tmp.close
- File.unlink tmpfilename or `/bin/rm -f "#{tmpfilename}"`
- File.unlink "#{tmpfilename}.bak" or `/bin/rm -f "#{tmpfilename}.bak"`
+ `#{ruby} -i.bak -pe 'sub(/^[0-9]+$/){$&.to_i * 5}' script_tmp`
+ tmp = open("script_tmp", "r")
+ while tmp.gets
+ assert_equal(0, $_.to_i % 5)
+ end
+ tmp.close
- if /mswin|mingw/ =~ RUBY_PLATFORM
- testname = '[ruby-dev:38588]'
- batch = "batch_tmp.#{$$}"
- tmpfilename = "#{tmpdir}/#{batch}.bat"
- open(tmpfilename, "wb") {|f| f.print "\r\n"}
- assert(system(tmpfilename), testname)
- assert(system("#{tmpdir}/#{batch}"), testname)
- assert(system(tmpfilename, "1"), testname)
- assert(system("#{tmpdir}/#{batch}", "1"), testname)
- begin
- path = ENV["PATH"]
- ENV["PATH"] = "#{tmpdir.tr(File::SEPARATOR, File::ALT_SEPARATOR)}#{File::PATH_SEPARATOR + path if path}"
- assert(system("#{batch}.bat"), testname)
- assert(system(batch), testname)
- assert(system("#{batch}.bat", "1"), testname)
- assert(system(batch, "1"), testname)
- ensure
- ENV["PATH"] = path
- end
- File.unlink tmpfilename
- end
- }
+ File.unlink "script_tmp" or `/bin/rm -f "script_tmp"`
+ File.unlink "script_tmp.bak" or `/bin/rm -f "script_tmp.bak"`
end
def test_syntax
@@ -92,8 +64,4 @@ class TestSystem < Test::Unit::TestCase
end
end
end
-
- def test_empty_evstr
- assert_equal("", eval('"#{}"', nil, __FILE__, __LINE__), "[ruby-dev:25113]")
- end
end
diff --git a/test/ruby/test_thread.rb b/test/ruby/test_thread.rb
deleted file mode 100644
index d0c35d8273..0000000000
--- a/test/ruby/test_thread.rb
+++ /dev/null
@@ -1,529 +0,0 @@
-require 'test/unit'
-require 'thread'
-require_relative 'envutil'
-
-class TestThread < Test::Unit::TestCase
- class Thread < ::Thread
- Threads = []
- def self.new(*)
- th = super
- th.abort_on_exception = true
- Threads << th
- th
- end
- end
-
- def setup
- Thread::Threads.clear
- end
-
- def teardown
- Thread::Threads.each do |t|
- t.kill if t.alive?
- begin
- t.join
- rescue Exception
- end
- end
- end
-
- def test_mutex_synchronize
- m = Mutex.new
- r = 0
- max = 100
- (1..max).map{
- Thread.new{
- i=0
- while i<max*max
- i+=1
- m.synchronize{
- r += 1
- }
- end
- }
- }.each{|e|
- e.join
- }
- assert_equal(max * max * max, r)
- end
-
- def test_condvar
- mutex = Mutex.new
- condvar = ConditionVariable.new
- result = []
- mutex.synchronize do
- t = Thread.new do
- mutex.synchronize do
- result << 1
- condvar.signal
- end
- end
-
- result << 0
- condvar.wait(mutex)
- result << 2
- t.join
- end
- assert_equal([0, 1, 2], result)
- end
-
- def test_condvar_wait_not_owner
- mutex = Mutex.new
- condvar = ConditionVariable.new
-
- assert_raise(ThreadError) { condvar.wait(mutex) }
- end
-
- def test_condvar_wait_exception_handling
- # Calling wait in the only thread running should raise a ThreadError of
- # 'stopping only thread'
- mutex = Mutex.new
- condvar = ConditionVariable.new
-
- locked = false
- thread = Thread.new do
- Thread.current.abort_on_exception = false
- mutex.synchronize do
- begin
- condvar.wait(mutex)
- rescue Exception
- locked = mutex.locked?
- raise
- end
- end
- end
-
- until thread.stop?
- sleep(0.1)
- end
-
- thread.raise Interrupt, "interrupt a dead condition variable"
- assert_raise(Interrupt) { thread.value }
- assert(locked)
- end
-
- def test_local_barrier
- dir = File.dirname(__FILE__)
- lbtest = File.join(dir, "lbtest.rb")
- $:.unshift File.join(File.dirname(dir), 'ruby')
- require 'envutil'
- $:.shift
- 10.times {
- result = `#{EnvUtil.rubybin} #{lbtest}`
- assert(!$?.coredump?, '[ruby-dev:30653]')
- assert_equal("exit.", result[/.*\Z/], '[ruby-dev:30653]')
- }
- end
-
- def test_priority
- c1 = c2 = 0
- t1 = Thread.new { loop { c1 += 1 } }
- t1.priority = -1
- t2 = Thread.new { loop { c2 += 1 } }
- t2.priority = -3
- assert_equal(-1, t1.priority)
- assert_equal(-3, t2.priority)
- sleep 0.5
- t1.kill
- t2.kill
- assert(c1 > c2, "[ruby-dev:33124]")
- end
-
- def test_new
- assert_raise(ThreadError) do
- Thread.new
- end
-
- t1 = Thread.new { sleep }
- assert_raise(ThreadError) do
- t1.instance_eval { initialize { } }
- end
-
- t2 = Thread.new(&method(:sleep).to_proc)
- assert_raise(ThreadError) do
- t2.instance_eval { initialize { } }
- end
-
- ensure
- t1.kill if t1
- t2.kill if t2
- end
-
- def test_join
- t = Thread.new { sleep }
- assert_nil(t.join(0.5))
-
- ensure
- t.kill if t
- end
-
- def test_join2
- t1 = Thread.new { sleep(1.5) }
- t2 = Thread.new do
- t1.join(1)
- end
- t3 = Thread.new do
- sleep 0.5
- t1.join
- end
- assert_nil(t2.value)
- assert_equal(t1, t3.value)
-
- ensure
- t1.kill if t1
- t2.kill if t2
- t3.kill if t3
- end
-
- def test_kill_main_thread
- assert_in_out_err([], <<-INPUT, %w(1), [])
- p 1
- Thread.kill Thread.current
- p 2
- INPUT
- end
-
- def test_exit
- s = 0
- Thread.new do
- s += 1
- Thread.exit
- s += 2
- end.join
- assert_equal(1, s)
- end
-
- def test_wakeup
- s = 0
- t = Thread.new do
- s += 1
- Thread.stop
- s += 1
- end
- sleep 0.5
- assert_equal(1, s)
- t.wakeup
- sleep 0.5
- assert_equal(2, s)
- assert_raise(ThreadError) { t.wakeup }
-
- ensure
- t.kill if t
- end
-
- def test_stop
- assert_in_out_err([], <<-INPUT, %w(2), [])
- begin
- Thread.stop
- p 1
- rescue ThreadError
- p 2
- end
- INPUT
- end
-
- def test_list
- assert_in_out_err([], <<-INPUT) do |r, e|
- t1 = Thread.new { sleep }
- Thread.pass
- t2 = Thread.new { loop { } }
- t3 = Thread.new { }.join
- p [Thread.current, t1, t2].sort_by {|t| t.object_id }
- p Thread.list.sort_by {|t| t.object_id }
- INPUT
- assert_equal(r.first, r.last)
- assert_equal([], e)
- end
- end
-
- def test_main
- assert_in_out_err([], <<-INPUT, %w(true false), [])
- p Thread.main == Thread.current
- Thread.new { p Thread.main == Thread.current }.join
- INPUT
- end
-
- def test_abort_on_exception
- assert_in_out_err([], <<-INPUT, %w(false 1), [])
- p Thread.abort_on_exception
- begin
- Thread.new { raise }
- sleep 0.5
- p 1
- rescue
- p 2
- end
- INPUT
-
- assert_in_out_err([], <<-INPUT, %w(true 2), [])
- Thread.abort_on_exception = true
- p Thread.abort_on_exception
- begin
- Thread.new { raise }
- sleep 0.5
- p 1
- rescue
- p 2
- end
- INPUT
-
- assert_in_out_err(%w(-d), <<-INPUT, %w(false 2), /.+/)
- p Thread.abort_on_exception
- begin
- Thread.new { raise }
- sleep 0.5
- p 1
- rescue
- p 2
- end
- INPUT
-
- assert_in_out_err([], <<-INPUT, %w(false true 2), [])
- p Thread.abort_on_exception
- begin
- t = Thread.new { sleep 0.5; raise }
- t.abort_on_exception = true
- p t.abort_on_exception
- sleep 1
- p 1
- rescue
- p 2
- end
- INPUT
- end
-
- def test_status_and_stop_p
- a = ::Thread.new { raise("die now") }
- b = Thread.new { Thread.stop }
- c = Thread.new { Thread.exit }
- d = Thread.new { sleep }
- e = Thread.current
- sleep 0.5
-
- assert_equal(nil, a.status)
- assert(a.stop?)
-
- assert_equal("sleep", b.status)
- assert(b.stop?)
-
- assert_equal(false, c.status)
- assert_match(/^#<TestThread::Thread:.* dead>$/, c.inspect)
- assert(c.stop?)
-
- d.kill
- assert_equal("aborting", d.status)
- assert(!d.stop?)
-
- assert_equal("run", e.status)
- assert(!e.stop?)
-
- ensure
- a.kill if a
- b.kill if b
- c.kill if c
- d.kill if d
- end
-
- def test_safe_level
- t = Thread.new { $SAFE = 3; sleep }
- sleep 0.5
- assert_equal(0, Thread.current.safe_level)
- assert_equal(3, t.safe_level)
-
- ensure
- t.kill if t
- end
-
- def test_thread_local
- t = Thread.new { sleep }
-
- assert_equal(false, t.key?(:foo))
-
- t["foo"] = "foo"
- t["bar"] = "bar"
- t["baz"] = "baz"
-
- assert_equal(true, t.key?(:foo))
- assert_equal(true, t.key?("foo"))
- assert_equal(false, t.key?(:qux))
- assert_equal(false, t.key?("qux"))
-
- assert_equal([:foo, :bar, :baz], t.keys)
-
- ensure
- t.kill if t
- end
-
- def test_thread_local_security
- t = Thread.new { sleep }
-
- assert_raise(SecurityError) do
- Thread.new { $SAFE = 4; t[:foo] }.join
- end
-
- assert_raise(SecurityError) do
- Thread.new { $SAFE = 4; t[:foo] = :baz }.join
- end
-
- assert_raise(RuntimeError) do
- Thread.new do
- Thread.current[:foo] = :bar
- Thread.current.freeze
- Thread.current[:foo] = :baz
- end.join
- end
- end
-
- def test_select_wait
- assert_nil(IO.select(nil, nil, nil, 1))
- t = Thread.new do
- IO.select(nil, nil, nil, nil)
- end
- sleep 0.5
- t.kill
- end
-
- def test_mutex_deadlock
- m = Mutex.new
- m.synchronize do
- assert_raise(ThreadError) do
- m.synchronize do
- assert(false)
- end
- end
- end
- end
-
- def test_mutex_interrupt
- m = Mutex.new
- m.lock
- t = Thread.new do
- m.lock
- :foo
- end
- sleep 0.5
- t.kill
- assert_nil(t.value)
- end
-
- def test_mutex_illegal_unlock
- m = Mutex.new
- m.lock
- assert_raise(ThreadError) do
- Thread.new do
- m.unlock
- end.join
- end
- end
-
- def test_mutex_fifo_like_lock
- m1 = Mutex.new
- m2 = Mutex.new
- m1.lock
- m2.lock
- m1.unlock
- m2.unlock
- assert_equal(false, m1.locked?)
- assert_equal(false, m2.locked?)
-
- m3 = Mutex.new
- m1.lock
- m2.lock
- m3.lock
- m1.unlock
- m2.unlock
- m3.unlock
- assert_equal(false, m1.locked?)
- assert_equal(false, m2.locked?)
- assert_equal(false, m3.locked?)
- end
-
- def test_mutex_trylock
- m = Mutex.new
- assert_equal(true, m.try_lock)
- assert_equal(false, m.try_lock, '[ruby-core:20943]')
-
- Thread.new{
- assert_equal(false, m.try_lock)
- }.join
-
- m.unlock
- end
-
- def test_recursive_error
- o = Object.new
- def o.inspect
- Thread.current[:__recursive_key__][:inspect] = nil
- super
- end
- assert_raise(TypeError) { [o].inspect }
- end
-end
-
-class TestThreadGroup < Test::Unit::TestCase
- def test_thread_init
- thgrp = ThreadGroup.new
- Thread.new{
- thgrp.add(Thread.current)
- assert_equal(thgrp, Thread.new{sleep 1}.group)
- }.join
- end
-
- def test_frozen_thgroup
- thgrp = ThreadGroup.new
-
- t = Thread.new{1}
- Thread.new{
- thgrp.add(Thread.current)
- thgrp.freeze
- assert_raise(ThreadError) do
- Thread.new{1}.join
- end
- assert_raise(ThreadError) do
- thgrp.add(t)
- end
- assert_raise(ThreadError) do
- ThreadGroup.new.add Thread.current
- end
- }.join
- t.join
- end
-
- def test_enclosed_thgroup
- thgrp = ThreadGroup.new
- assert_equal(false, thgrp.enclosed?)
-
- t = Thread.new{1}
- Thread.new{
- thgrp.add(Thread.current)
- thgrp.enclose
- assert_equal(true, thgrp.enclosed?)
- assert_nothing_raised do
- Thread.new{1}.join
- end
- assert_raise(ThreadError) do
- thgrp.add t
- end
- assert_raise(ThreadError) do
- ThreadGroup.new.add Thread.current
- end
- }.join
- t.join
- end
-
- def test_uninitialized
- c = Class.new(Thread)
- c.class_eval { def initialize; end }
- assert_raise(ThreadError) { c.new.start }
- end
-
- def test_backtrace
- Thread.new{
- assert_equal(Array, Thread.main.backtrace.class)
- }.join
-
- t = Thread.new{}
- t.join
- assert_equal(nil, t.backtrace)
- end
-end
diff --git a/test/ruby/test_time.rb b/test/ruby/test_time.rb
index d7e736de3a..ae1a35ffad 100644
--- a/test/ruby/test_time.rb
+++ b/test/ruby/test_time.rb
@@ -1,26 +1,6 @@
require 'test/unit'
-require 'rational'
-require 'delegate'
-require 'timeout'
-require 'delegate'
class TestTime < Test::Unit::TestCase
- def setup
- @verbose = $VERBOSE
- $VERBOSE = nil
- end
-
- def teardown
- $VERBOSE = @verbose
- end
-
- def test_new
- assert_equal(Time.utc(2000,2,10), Time.new(2000,2,10, 11,0,0, 3600*11))
- assert_equal(Time.utc(2000,2,10), Time.new(2000,2,9, 13,0,0, -3600*11))
- assert_equal(Time.utc(2000,2,10), Time.new(2000,2,10, 11,0,0, "+11:00"))
- assert_equal(Rational(1,2), Time.new(2000,2,10, 11,0,5.5, "+11:00").subsec)
- end
-
def test_time_add()
assert_equal(Time.utc(2000, 3, 21, 3, 30) + 3 * 3600,
Time.utc(2000, 3, 21, 6, 30))
@@ -83,436 +63,33 @@ class TestTime < Test::Unit::TestCase
end
end
- def test_strtime
- t = nil
- assert_nothing_raised { t = Time.utc("2000", "1", "2" , "3", "4", "5") }
- assert_equal(Time.utc(2000,1,2,3,4,5), t)
- end
-
- def test_huge_difference
+ def test_huge_difference # [ruby-dev:22619]
if negative_time_t?
- assert_equal(Time.at(-0x80000000), Time.at(0x7fffffff) - 0xffffffff, "[ruby-dev:22619]")
+ assert_equal(Time.at(-0x80000000), Time.at(0x7fffffff) - 0xffffffff)
assert_equal(Time.at(-0x80000000), Time.at(0x7fffffff) + (-0xffffffff))
- assert_equal(Time.at(0x7fffffff), Time.at(-0x80000000) + 0xffffffff, "[ruby-dev:22619]")
+ assert_equal(Time.at(0x7fffffff), Time.at(-0x80000000) + 0xffffffff)
assert_equal(Time.at(0x7fffffff), Time.at(-0x80000000) - (-0xffffffff))
end
end
- def test_big_minus
- begin
- bigtime0 = Time.at(2**60)
- bigtime1 = Time.at(2**60+1)
- rescue RangeError
- return
- end
- assert_equal(1.0, bigtime1 - bigtime0)
- end
-
def test_at
- assert_equal(100000, Time.at("0.1".to_r).usec)
- assert_equal(10000, Time.at("0.01".to_r).usec)
- assert_equal(1000, Time.at("0.001".to_r).usec)
- assert_equal(100, Time.at("0.0001".to_r).usec)
- assert_equal(10, Time.at("0.00001".to_r).usec)
- assert_equal(1, Time.at("0.000001".to_r).usec)
- assert_equal(100000000, Time.at("0.1".to_r).nsec)
- assert_equal(10000000, Time.at("0.01".to_r).nsec)
- assert_equal(1000000, Time.at("0.001".to_r).nsec)
- assert_equal(100000, Time.at("0.0001".to_r).nsec)
- assert_equal(10000, Time.at("0.00001".to_r).nsec)
- assert_equal(1000, Time.at("0.000001".to_r).nsec)
- assert_equal(100, Time.at("0.0000001".to_r).nsec)
- assert_equal(10, Time.at("0.00000001".to_r).nsec)
- assert_equal(1, Time.at("0.000000001".to_r).nsec)
assert_equal(100000, Time.at(0.1).usec)
assert_equal(10000, Time.at(0.01).usec)
assert_equal(1000, Time.at(0.001).usec)
assert_equal(100, Time.at(0.0001).usec)
assert_equal(10, Time.at(0.00001).usec)
- assert_equal(3, Time.at(0.000003).usec)
- assert_equal(100000000, Time.at(0.1).nsec)
- assert_equal(10000000, Time.at(0.01).nsec)
- assert_equal(1000000, Time.at(0.001).nsec)
- assert_equal(100000, Time.at(0.0001).nsec)
- assert_equal(10000, Time.at(0.00001).nsec)
- assert_equal(3000, Time.at(0.000003).nsec)
- assert_equal(199, Time.at(0.0000002).nsec)
- assert_equal(10, Time.at(0.00000001).nsec)
- assert_equal(1, Time.at(0.000000001).nsec)
-
- assert_equal(0, Time.at(1e-10).nsec)
- assert_equal(0, Time.at(4e-10).nsec)
- assert_equal(0, Time.at(6e-10).nsec)
- assert_equal(1, Time.at(14e-10).nsec)
- assert_equal(1, Time.at(16e-10).nsec)
+ assert_equal(1, Time.at(0.000001).usec)
+ assert_equal(0, Time.at(1e-7).usec)
+ assert_equal(0, Time.at(4e-7).usec)
+ assert_equal(1, Time.at(6e-7).usec)
+ assert_equal(1, Time.at(14e-7).usec)
+ assert_equal(2, Time.at(16e-7).usec)
if negative_time_t?
- assert_equal(999999999, Time.at(-1e-10).nsec)
- assert_equal(999999999, Time.at(-4e-10).nsec)
- assert_equal(999999999, Time.at(-6e-10).nsec)
- assert_equal(999999998, Time.at(-14e-10).nsec)
- assert_equal(999999998, Time.at(-16e-10).nsec)
- end
- end
-
- def test_at2
- assert_equal(100, Time.at(0, 0.1).nsec)
- assert_equal(10, Time.at(0, 0.01).nsec)
- assert_equal(1, Time.at(0, 0.001).nsec)
- end
-
- def test_at_rational
- assert_equal(1, Time.at(Rational(1,1) / 1000000000).nsec)
- assert_equal(1, Time.at(1167609600 + Rational(1,1) / 1000000000).nsec)
- end
-
- def test_utc_subsecond
- assert_equal(500000, Time.utc(2007,1,1,0,0,1.5).usec)
- assert_equal(100000, Time.utc(2007,1,1,0,0,Rational(11,10)).usec)
- end
-
- def test_eq_nsec
- assert_equal(Time.at(0, 0.123), Time.at(0, 0.123))
- assert_not_equal(Time.at(0, 0.123), Time.at(0, 0.124))
- end
-
- def assert_marshal_roundtrip(t)
- iv_names = t.instance_variables
- iv_vals1 = iv_names.map {|n| t.instance_variable_get n }
- m = Marshal.dump(t)
- t2 = Marshal.load(m)
- iv_vals2 = iv_names.map {|n| t2.instance_variable_get n }
- assert_equal(t, t2)
- assert_equal(iv_vals1, iv_vals2)
- t2
- end
-
- def test_marshal_nsec
- assert_marshal_roundtrip(Time.at(0, 0.123))
- assert_marshal_roundtrip(Time.at(0, 0.120))
- end
-
- def test_marshal_ivar
- t = Time.at(123456789, 987654.321)
- t.instance_eval { @var = 135 }
- assert_marshal_roundtrip(t)
- assert_marshal_roundtrip(Marshal.load(Marshal.dump(t)))
- end
-
- # Sat Jan 01 00:00:00 UTC 2000
- T2000 = Time.at(946684800).gmtime
-
- def test_security_error
- assert_raise(SecurityError) do
- Thread.new do
- t = Time.gm(2000)
- $SAFE = 4
- t.localtime
- end.join
- end
- end
-
- def test_at3
- assert_equal(T2000, Time.at(T2000))
-# assert_raise(RangeError) do
-# Time.at(2**31-1, 1_000_000)
-# Time.at(2**63-1, 1_000_000)
-# end
-# assert_raise(RangeError) do
-# Time.at(-2**31, -1_000_000)
-# Time.at(-2**63, -1_000_000)
-# end
- end
-
- def test_utc_or_local
- assert_equal(T2000, Time.gm(2000))
- assert_equal(T2000, Time.gm(0, 0, 0, 1, 1, 2000, :foo, :bar, false, :baz))
- assert_equal(T2000, Time.gm(2000, "jan"))
- assert_equal(T2000, Time.gm(2000, "1"))
- assert_equal(T2000, Time.gm(2000, 1, 1, 0, 0, 0, 0))
- assert_equal(T2000, Time.gm(2000, 1, 1, 0, 0, 0, "0"))
- assert_equal(T2000, Time.gm(2000, 1, 1, 0, 0, "0", :foo, :foo))
- assert_raise(ArgumentError) { Time.gm(2000, 1, 1, 0, 0, -1, :foo, :foo) }
- assert_raise(ArgumentError) { Time.gm(2000, 1, 1, 0, 0, -1.0, :foo, :foo) }
- assert_raise(RangeError) do
- Time.gm(2000, 1, 1, 0, 0, 10_000_000_000_000_000_001.0, :foo, :foo)
- end
- assert_raise(ArgumentError) { Time.gm(2000, 1, 1, 0, 0, -(2**31), :foo, :foo) }
- o = Object.new
- def o.to_r; nil; end
- assert_raise(TypeError) { Time.gm(2000, 1, 1, 0, 0, o, :foo, :foo) }
- def o.to_r; ""; end
- assert_raise(TypeError) { Time.gm(2000, 1, 1, 0, 0, o, :foo, :foo) }
- def o.to_r; Rational(11); end
- assert_equal(11, Time.gm(2000, 1, 1, 0, 0, o).sec)
- o = Object.new
- def o.to_int; 10; end
- assert_equal(10, Time.gm(2000, 1, 1, 0, 0, o).sec)
- assert_raise(ArgumentError) { Time.gm(2000, 13) }
-
- t = Time.local(2000)
- assert_equal(t.gmt_offset, T2000 - t)
- end
-
- def test_time_interval
- m = Mutex.new.lock
- assert_nothing_raised {
- Timeout.timeout(10) {
- m.sleep(0)
- }
- }
- assert_raise(ArgumentError) { m.sleep(-1) }
- end
-
- def test_to_f
- assert_equal(946684800.0, T2000.to_f)
- end
-
- def test_cmp
- assert_equal(-1, T2000 <=> Time.gm(2001))
- assert_equal(1, T2000 <=> Time.gm(1999))
- assert_nil(T2000 <=> 0)
- end
-
- def test_eql
- assert(T2000.eql?(T2000))
- assert(!T2000.eql?(Time.gm(2001)))
- end
-
- def test_utc_p
- assert(Time.gm(2000).gmt?)
- assert(!Time.local(2000).gmt?)
- assert(!Time.at(0).gmt?)
- end
-
- def test_hash
- assert_kind_of(Integer, T2000.hash)
- end
-
- def test_init_copy
- assert_equal(T2000, T2000.dup)
- assert_raise(TypeError) do
- T2000.instance_eval { initialize_copy(nil) }
- end
- end
-
- def test_localtime_gmtime
- assert_nothing_raised do
- t = Time.gm(2000)
- assert(t.gmt?)
- t.localtime
- assert(!t.gmt?)
- t.localtime
- assert(!t.gmt?)
- t.gmtime
- assert(t.gmt?)
- t.gmtime
- assert(t.gmt?)
+ assert_equal(0, Time.at(-1e-7).usec)
+ assert_equal(0, Time.at(-4e-7).usec)
+ assert_equal(999999, Time.at(-6e-7).usec)
+ assert_equal(999999, Time.at(-14e-7).usec)
+ assert_equal(999998, Time.at(-16e-7).usec)
end
-
- t1 = Time.gm(2000)
- t2 = t1.getlocal
- assert_equal(t1, t2)
- t3 = t1.getlocal("-02:00")
- assert_equal(t1, t3)
- assert_equal(-7200, t3.utc_offset)
- t1.localtime
- assert_equal(t1, t2)
- assert_equal(t1.gmt?, t2.gmt?)
- assert_equal(t1, t3)
-
- t1 = Time.local(2000)
- t2 = t1.getgm
- assert_equal(t1, t2)
- t3 = t1.getlocal("-02:00")
- assert_equal(t1, t3)
- assert_equal(-7200, t3.utc_offset)
- t1.gmtime
- assert_equal(t1, t2)
- assert_equal(t1.gmt?, t2.gmt?)
- assert_equal(t1, t3)
- end
-
- def test_asctime
- assert_equal("Sat Jan 1 00:00:00 2000", T2000.asctime)
- assert_kind_of(String, Time.at(0).asctime)
- end
-
- def test_to_s
- assert_equal("2000-01-01 00:00:00 UTC", T2000.to_s)
- assert_kind_of(String, Time.at(946684800).getlocal.to_s)
- assert_equal(Time.at(946684800).getlocal.to_s, Time.at(946684800).to_s)
- end
-
- def test_plus_minus_succ
- # assert_raise(RangeError) { T2000 + 10000000000 }
- # assert_raise(RangeError) T2000 - 3094168449 }
- # assert_raise(RangeError) { T2000 + 1200798848 }
- assert_raise(TypeError) { T2000 + Time.now }
- assert_equal(T2000 + 1, T2000.succ)
- end
-
- def test_readers
- assert_equal(0, T2000.sec)
- assert_equal(0, T2000.min)
- assert_equal(0, T2000.hour)
- assert_equal(1, T2000.mday)
- assert_equal(1, T2000.mon)
- assert_equal(2000, T2000.year)
- assert_equal(6, T2000.wday)
- assert_equal(1, T2000.yday)
- assert_equal(false, T2000.isdst)
- assert_equal("UTC", T2000.zone)
- assert_equal(0, T2000.gmt_offset)
- assert(!T2000.sunday?)
- assert(!T2000.monday?)
- assert(!T2000.tuesday?)
- assert(!T2000.wednesday?)
- assert(!T2000.thursday?)
- assert(!T2000.friday?)
- assert(T2000.saturday?)
- assert_equal([0, 0, 0, 1, 1, 2000, 6, 1, false, "UTC"], T2000.to_a)
-
- t = Time.at(946684800).getlocal
- assert_equal(t.sec, Time.at(946684800).sec)
- assert_equal(t.min, Time.at(946684800).min)
- assert_equal(t.hour, Time.at(946684800).hour)
- assert_equal(t.mday, Time.at(946684800).mday)
- assert_equal(t.mon, Time.at(946684800).mon)
- assert_equal(t.year, Time.at(946684800).year)
- assert_equal(t.wday, Time.at(946684800).wday)
- assert_equal(t.yday, Time.at(946684800).yday)
- assert_equal(t.isdst, Time.at(946684800).isdst)
- assert_equal(t.zone, Time.at(946684800).zone)
- assert_equal(t.gmt_offset, Time.at(946684800).gmt_offset)
- assert_equal(t.sunday?, Time.at(946684800).sunday?)
- assert_equal(t.monday?, Time.at(946684800).monday?)
- assert_equal(t.tuesday?, Time.at(946684800).tuesday?)
- assert_equal(t.wednesday?, Time.at(946684800).wednesday?)
- assert_equal(t.thursday?, Time.at(946684800).thursday?)
- assert_equal(t.friday?, Time.at(946684800).friday?)
- assert_equal(t.saturday?, Time.at(946684800).saturday?)
- assert_equal(t.to_a, Time.at(946684800).to_a)
- end
-
- def test_strftime
- t = Time.at(946684800).getlocal
- assert_equal("Sat", T2000.strftime("%a"))
- assert_equal("Saturday", T2000.strftime("%A"))
- assert_equal("Jan", T2000.strftime("%b"))
- assert_equal("January", T2000.strftime("%B"))
- assert_kind_of(String, T2000.strftime("%c"))
- assert_equal("01", T2000.strftime("%d"))
- assert_equal("00", T2000.strftime("%H"))
- assert_equal("12", T2000.strftime("%I"))
- assert_equal("001", T2000.strftime("%j"))
- assert_equal("01", T2000.strftime("%m"))
- assert_equal("00", T2000.strftime("%M"))
- assert_equal("AM", T2000.strftime("%p"))
- assert_equal("00", T2000.strftime("%S"))
- assert_equal("00", T2000.strftime("%U"))
- assert_equal("00", T2000.strftime("%W"))
- assert_equal("6", T2000.strftime("%w"))
- assert_equal("01/01/00", T2000.strftime("%x"))
- assert_equal("00:00:00", T2000.strftime("%X"))
- assert_equal("00", T2000.strftime("%y"))
- assert_equal("2000", T2000.strftime("%Y"))
- assert_equal("UTC", T2000.strftime("%Z"))
- assert_equal("%", T2000.strftime("%%"))
- assert_equal("0", T2000.strftime("%-S"))
-
- assert_equal("", T2000.strftime(""))
- assert_equal("foo\0bar\x0000\x0000\x0000", T2000.strftime("foo\0bar\0%H\0%M\0%S"))
- assert_equal("foo" * 1000, T2000.strftime("foo" * 1000))
-
- t = Time.mktime(2000, 1, 1)
- assert_equal("Sat", t.strftime("%a"))
-
- t = Time.at(946684800, 123456.789)
- assert_equal("123", t.strftime("%3N"))
- assert_equal("123456", t.strftime("%6N"))
- assert_equal("123456789", t.strftime("%9N"))
- assert_equal("1234567890", t.strftime("%10N"))
- assert_equal("123456789", t.strftime("%0N"))
- assert_equal("000", t.strftime("%3S"))
- assert_equal("946684800", t.strftime("%s"))
- assert_equal("946684800", t.utc.strftime("%s"))
-
- t = Time.mktime(2001, 10, 1)
- assert_equal("2001-10-01", t.strftime("%F"))
-
- t = Time.mktime(2001, 10, 1, 2, 0, 0)
- assert_equal("01", t.strftime("%d"))
- assert_equal("01", t.strftime("%0d"))
- assert_equal(" 1", t.strftime("%_d"))
- assert_equal(" 1", t.strftime("%e"))
- assert_equal("01", t.strftime("%0e"))
- assert_equal(" 1", t.strftime("%_e"))
- assert_equal("AM", t.strftime("%p"))
- assert_equal("am", t.strftime("%#p"))
- assert_equal("am", t.strftime("%P"))
- assert_equal("AM", t.strftime("%#P"))
- assert_equal("02", t.strftime("%H"))
- assert_equal("02", t.strftime("%0H"))
- assert_equal(" 2", t.strftime("%_H"))
- assert_equal("02", t.strftime("%I"))
- assert_equal("02", t.strftime("%0I"))
- assert_equal(" 2", t.strftime("%_I"))
- assert_equal(" 2", t.strftime("%k"))
- assert_equal("02", t.strftime("%0k"))
- assert_equal(" 2", t.strftime("%_k"))
- assert_equal(" 2", t.strftime("%l"))
- assert_equal("02", t.strftime("%0l"))
- assert_equal(" 2", t.strftime("%_l"))
- t = Time.mktime(2001, 10, 1, 14, 0, 0)
- assert_equal("PM", t.strftime("%p"))
- assert_equal("pm", t.strftime("%#p"))
- assert_equal("pm", t.strftime("%P"))
- assert_equal("PM", t.strftime("%#P"))
- assert_equal("14", t.strftime("%H"))
- assert_equal("14", t.strftime("%0H"))
- assert_equal("14", t.strftime("%_H"))
- assert_equal("02", t.strftime("%I"))
- assert_equal("02", t.strftime("%0I"))
- assert_equal(" 2", t.strftime("%_I"))
- assert_equal("14", t.strftime("%k"))
- assert_equal("14", t.strftime("%0k"))
- assert_equal("14", t.strftime("%_k"))
- assert_equal(" 2", t.strftime("%l"))
- assert_equal("02", t.strftime("%0l"))
- assert_equal(" 2", t.strftime("%_l"))
-
- # [ruby-dev:37155]
- t = Time.mktime(1970, 1, 18)
- assert_equal("0", t.strftime("%w"))
- assert_equal("7", t.strftime("%u"))
-
- # [ruby-dev:37160]
- assert_equal("\t", T2000.strftime("%t"))
- assert_equal("\t", T2000.strftime("%0t"))
- assert_equal("\t", T2000.strftime("%1t"))
- assert_equal(" \t", T2000.strftime("%3t"))
- assert_equal("00\t", T2000.strftime("%03t"))
- assert_equal("\n", T2000.strftime("%n"))
- assert_equal("\n", T2000.strftime("%0n"))
- assert_equal("\n", T2000.strftime("%1n"))
- assert_equal(" \n", T2000.strftime("%3n"))
- assert_equal("00\n", T2000.strftime("%03n"))
-
- # [ruby-dev:37162]
- assert_equal("SAT", T2000.strftime("%#a"))
- assert_equal("SATURDAY", T2000.strftime("%#A"))
- assert_equal("JAN", T2000.strftime("%#b"))
- assert_equal("JANUARY", T2000.strftime("%#B"))
- assert_equal("JAN", T2000.strftime("%#h"))
- assert_equal("FRIDAY", Time.local(2008,1,4).strftime("%#A"))
- end
-
- def test_delegate
- d1 = SimpleDelegator.new(t1 = Time.utc(2000))
- d2 = SimpleDelegator.new(t2 = Time.utc(2001))
- assert_equal(-1, t1 <=> t2)
- assert_equal(1, t2 <=> t1)
- assert_equal(-1, d1 <=> d2)
- assert_equal(1, d2 <=> d1)
end
end
diff --git a/test/ruby/test_trace.rb b/test/ruby/test_trace.rb
index 45bc599314..6adfe0bf64 100644
--- a/test/ruby/test_trace.rb
+++ b/test/ruby/test_trace.rb
@@ -7,43 +7,15 @@ class TestTrace < Test::Unit::TestCase
trace_var :$x, proc{$y = $x}
$x = 40414
assert_equal($x, $y)
-
+
untrace_var :$x
$x = 19660208
assert_not_equal($x, $y)
-
+
trace_var :$x, proc{$x *= 2}
$x = 5
assert_equal(10, $x)
-
- untrace_var :$x
- end
-
- def test_trace_tainted_proc
- $x = 1234
- s = proc { $y = :foo }
- trace_var :$x, s
- s.taint
- $x = 42
- assert_equal(:foo, $y)
- ensure
- untrace_var :$x
- end
-
- def test_trace_proc_that_raises_exception
- $x = 1234
- trace_var :$x, proc { raise }
- assert_raise(RuntimeError) { $x = 42 }
- ensure
- untrace_var :$x
- end
-
- def test_trace_string
- $x = 1234
- trace_var :$x, "$y = :bar"
- $x = 42
- assert_equal(:bar, $y)
- ensure
+
untrace_var :$x
end
end
diff --git a/test/ruby/test_transcode.rb b/test/ruby/test_transcode.rb
deleted file mode 100644
index 0a4db06160..0000000000
--- a/test/ruby/test_transcode.rb
+++ /dev/null
@@ -1,1807 +0,0 @@
-# -*- encoding: ASCII-8BIT -*- # make sure this runs in binary mode
-# some of the comments are in UTF-8
-
-require 'test/unit'
-class TestTranscode < Test::Unit::TestCase
- def test_errors
- assert_raise(Encoding::ConverterNotFoundError) { 'abc'.encode('foo', 'bar') }
- assert_raise(Encoding::ConverterNotFoundError) { 'abc'.encode!('foo', 'bar') }
- assert_raise(Encoding::ConverterNotFoundError) { 'abc'.force_encoding('utf-8').encode('foo') }
- assert_raise(Encoding::ConverterNotFoundError) { 'abc'.force_encoding('utf-8').encode!('foo') }
- assert_raise(Encoding::UndefinedConversionError) { "\x80".encode('utf-8','ASCII-8BIT') }
- assert_raise(Encoding::InvalidByteSequenceError) { "\x80".encode('utf-8','US-ASCII') }
- assert_raise(Encoding::UndefinedConversionError) { "\xA5".encode('utf-8','iso-8859-3') }
- end
-
- def test_arguments
- assert_equal('abc', 'abc'.force_encoding('utf-8').encode('iso-8859-1'))
- # check that encoding is kept when no conversion is done
- assert_equal('abc'.force_encoding('Shift_JIS'), 'abc'.force_encoding('Shift_JIS').encode('Shift_JIS'))
- assert_equal('abc'.force_encoding('Shift_JIS'), 'abc'.force_encoding('Shift_JIS').encode!('Shift_JIS'))
- # assert that encoding is correctly set
- assert_equal("D\u00FCrst".encoding, "D\xFCrst".force_encoding('iso-8859-1').encode('utf-8').encoding)
- # check that Encoding can be used as parameter
- assert_equal("D\u00FCrst", "D\xFCrst".encode('utf-8', Encoding.find('ISO-8859-1')))
- assert_equal("D\u00FCrst", "D\xFCrst".encode(Encoding.find('utf-8'), 'ISO-8859-1'))
- assert_equal("D\u00FCrst", "D\xFCrst".encode(Encoding.find('utf-8'), Encoding.find('ISO-8859-1')))
- end
-
- def test_noargument
- default_default_internal = Encoding.default_internal
- Encoding.default_internal = nil
- assert_equal("\u3042".encode, "\u3042")
- assert_equal("\xE3\x81\x82\x81".force_encoding("utf-8").encode,
- "\xE3\x81\x82\x81".force_encoding("utf-8"))
- Encoding.default_internal = 'EUC-JP'
- assert_equal("\u3042".encode, "\xA4\xA2".force_encoding('EUC-JP'))
- assert_equal("\xE3\x81\x82\x81".force_encoding("utf-8").encode,
- "\xA4\xA2?".force_encoding('EUC-JP'))
- Encoding.default_internal = default_default_internal
- end
-
- def test_length
- assert_equal("\u20AC"*20, ("\xA4"*20).encode('utf-8', 'iso-8859-15'))
- assert_equal("\u20AC"*20, ("\xA4"*20).encode!('utf-8', 'iso-8859-15'))
- assert_equal("\u20AC"*2000, ("\xA4"*2000).encode('utf-8', 'iso-8859-15'))
- assert_equal("\u20AC"*2000, ("\xA4"*2000).encode!('utf-8', 'iso-8859-15'))
- assert_equal("\u20AC"*200000, ("\xA4"*200000).encode('utf-8', 'iso-8859-15'))
- assert_equal("\u20AC"*200000, ("\xA4"*200000).encode!('utf-8', 'iso-8859-15'))
- end
-
- def check_both_ways(utf8, raw, encoding)
- assert_equal(utf8.force_encoding('utf-8'), raw.encode('utf-8', encoding))
- assert_equal(raw.force_encoding(encoding), utf8.encode(encoding, 'utf-8'))
- end
-
- def check_both_ways2(str1, enc1, str2, enc2)
- assert_equal(str1.force_encoding(enc1), str2.encode(enc1, enc2))
- assert_equal(str2.force_encoding(enc2), str1.encode(enc2, enc1))
- end
-
- def test_encodings
- check_both_ways("\u307E\u3064\u3082\u3068 \u3086\u304D\u3072\u308D",
- "\x82\xdc\x82\xc2\x82\xe0\x82\xc6 \x82\xe4\x82\xab\x82\xd0\x82\xeb", 'shift_jis') # まつもと ゆきひろ
- check_both_ways("\u307E\u3064\u3082\u3068 \u3086\u304D\u3072\u308D",
- "\xa4\xde\xa4\xc4\xa4\xe2\xa4\xc8 \xa4\xe6\xa4\xad\xa4\xd2\xa4\xed", 'euc-jp')
- check_both_ways("\u677E\u672C\u884C\u5F18", "\x8f\xbc\x96\x7b\x8d\x73\x8d\x4f", 'shift_jis') # 松本行弘
- check_both_ways("\u677E\u672C\u884C\u5F18", "\xbe\xbe\xcb\xdc\xb9\xd4\xb9\xb0", 'euc-jp')
- check_both_ways("D\u00FCrst", "D\xFCrst", 'iso-8859-1') # Dürst
- check_both_ways("D\u00FCrst", "D\xFCrst", 'iso-8859-2')
- check_both_ways("D\u00FCrst", "D\xFCrst", 'iso-8859-3')
- check_both_ways("D\u00FCrst", "D\xFCrst", 'iso-8859-4')
- check_both_ways("D\u00FCrst", "D\xFCrst", 'iso-8859-9')
- check_both_ways("D\u00FCrst", "D\xFCrst", 'iso-8859-10')
- check_both_ways("D\u00FCrst", "D\xFCrst", 'iso-8859-13')
- check_both_ways("D\u00FCrst", "D\xFCrst", 'iso-8859-14')
- check_both_ways("D\u00FCrst", "D\xFCrst", 'iso-8859-15')
- check_both_ways("r\u00E9sum\u00E9", "r\xE9sum\xE9", 'iso-8859-1') # résumé
- check_both_ways("\u0065\u006C\u0151\u00ED\u0072\u00E1\u0073", "el\xF5\xEDr\xE1s", 'iso-8859-2') # előírás
- check_both_ways("\u043F\u0435\u0440\u0435\u0432\u043E\u0434",
- "\xDF\xD5\xE0\xD5\xD2\xDE\xD4", 'iso-8859-5') # перевод
- check_both_ways("\u0643\u062A\u0628", "\xE3\xCA\xC8", 'iso-8859-6') # كتب
- check_both_ways("\u65E5\u8A18", "\x93\xFA\x8BL", 'shift_jis') # 日記
- check_both_ways("\u65E5\u8A18", "\xC6\xFC\xB5\xAD", 'euc-jp')
- check_both_ways("\uC560\uC778\uAD6C\uD568\u0020\u6734\uC9C0\uC778",
- "\xBE\xD6\xC0\xCE\xB1\xB8\xC7\xD4\x20\xDA\xD3\xC1\xF6\xC0\xCE", 'euc-kr') # 애인구함 朴지인
- check_both_ways("\uC544\uD58F\uD58F\u0020\uB620\uBC29\uD6BD\uB2D8\u0020\uC0AC\uB791\uD716",
- "\xBE\xC6\xC1\x64\xC1\x64\x20\x8C\x63\xB9\xE6\xC4\x4F\xB4\xD4\x20\xBB\xE7\xB6\xFB\xC5\x42", 'cp949') # 아햏햏 똠방횽님 사랑휖
- assert_equal(Encoding::ISO_8859_1, "D\xFCrst".force_encoding('iso-8859-2').encode('iso-8859-1', 'iso-8859-1').encoding)
- end
-
- def test_twostep
- assert_equal("D\xFCrst".force_encoding('iso-8859-2'), "D\xFCrst".encode('iso-8859-2', 'iso-8859-1'))
- end
-
- def test_ascii_range
- encodings = [
- 'US-ASCII', 'ASCII-8BIT',
- 'ISO-8859-1', 'ISO-8859-2', 'ISO-8859-3',
- 'ISO-8859-4', 'ISO-8859-5', 'ISO-8859-6',
- 'ISO-8859-7', 'ISO-8859-8', 'ISO-8859-9',
- 'ISO-8859-10', 'ISO-8859-11', 'ISO-8859-13',
- 'ISO-8859-14', 'ISO-8859-15',
- 'EUC-JP', 'SHIFT_JIS', 'EUC-KR'
- ]
- all_ascii = (0..127).to_a.pack 'C*'
- encodings.each do |enc|
- test_start = all_ascii
- assert_equal(test_start, test_start.encode('UTF-8',enc).encode(enc).force_encoding('ASCII-8BIT'))
- end
- end
-
- def test_all_bytes
- encodings_8859 = [
- 'ISO-8859-1', 'ISO-8859-2',
- #'ISO-8859-3', # not all bytes used
- 'ISO-8859-4', 'ISO-8859-5',
- #'ISO-8859-6', # not all bytes used
- #'ISO-8859-7', # not all bytes used
- #'ISO-8859-8', # not all bytes used
- 'ISO-8859-9', 'ISO-8859-10',
- #'ISO-8859-11', # not all bytes used
- #'ISO-8859-12', # not available
- 'ISO-8859-13','ISO-8859-14','ISO-8859-15',
- #'ISO-8859-16', # not available
- ]
- all_bytes = (0..255).to_a.pack 'C*'
- encodings_8859.each do |enc|
- test_start = all_bytes
- assert_equal(test_start, test_start.encode('UTF-8',enc).encode(enc).force_encoding('ASCII-8BIT'))
- end
- end
-
- def test_windows_874
- check_both_ways("\u20AC", "\x80", 'windows-874') # €
- assert_raise(Encoding::UndefinedConversionError) { "\x81".encode("utf-8", 'windows-874') }
- assert_raise(Encoding::UndefinedConversionError) { "\x84".encode("utf-8", 'windows-874') }
- check_both_ways("\u2026", "\x85", 'windows-874') # …
- assert_raise(Encoding::UndefinedConversionError) { "\x86".encode("utf-8", 'windows-874') }
- assert_raise(Encoding::UndefinedConversionError) { "\x8F".encode("utf-8", 'windows-874') }
- assert_raise(Encoding::UndefinedConversionError) { "\x90".encode("utf-8", 'windows-874') }
- check_both_ways("\u2018", "\x91", 'windows-874') # ‘
- check_both_ways("\u2014", "\x97", 'windows-874') # —
- assert_raise(Encoding::UndefinedConversionError) { "\x98".encode("utf-8", 'windows-874') }
- assert_raise(Encoding::UndefinedConversionError) { "\x9F".encode("utf-8", 'windows-874') }
- check_both_ways("\u00A0", "\xA0", 'windows-874') # non-breaking space
- check_both_ways("\u0E0F", "\xAF", 'windows-874') # ฏ
- check_both_ways("\u0E10", "\xB0", 'windows-874') # ฐ
- check_both_ways("\u0E1F", "\xBF", 'windows-874') # ฟ
- check_both_ways("\u0E20", "\xC0", 'windows-874') # ภ
- check_both_ways("\u0E2F", "\xCF", 'windows-874') # ฯ
- check_both_ways("\u0E30", "\xD0", 'windows-874') # ะ
- check_both_ways("\u0E3A", "\xDA", 'windows-874') # ฺ
- assert_raise(Encoding::UndefinedConversionError) { "\xDB".encode("utf-8", 'windows-874') }
- assert_raise(Encoding::UndefinedConversionError) { "\xDE".encode("utf-8", 'windows-874') }
- check_both_ways("\u0E3F", "\xDF", 'windows-874') # ฿
- check_both_ways("\u0E40", "\xE0", 'windows-874') # เ
- check_both_ways("\u0E4F", "\xEF", 'windows-874') # ๏
- check_both_ways("\u0E50", "\xF0", 'windows-874') # ๐
- check_both_ways("\u0E5B", "\xFB", 'windows-874') # ๛
- assert_raise(Encoding::UndefinedConversionError) { "\xFC".encode("utf-8", 'windows-874') }
- assert_raise(Encoding::UndefinedConversionError) { "\xFF".encode("utf-8", 'windows-874') }
- end
-
- def test_windows_1250
- check_both_ways("\u20AC", "\x80", 'windows-1250') # €
- assert_raise(Encoding::UndefinedConversionError) { "\x81".encode("utf-8", 'windows-1250') }
- check_both_ways("\u201A", "\x82", 'windows-1250') # ‚
- assert_raise(Encoding::UndefinedConversionError) { "\x83".encode("utf-8", 'windows-1250') }
- check_both_ways("\u201E", "\x84", 'windows-1250') # „
- check_both_ways("\u2021", "\x87", 'windows-1250') # ‡
- assert_raise(Encoding::UndefinedConversionError) { "\x88".encode("utf-8", 'windows-1250') }
- check_both_ways("\u2030", "\x89", 'windows-1250') # ‰
- check_both_ways("\u0179", "\x8F", 'windows-1250') # Ź
- assert_raise(Encoding::UndefinedConversionError) { "\x90".encode("utf-8", 'windows-1250') }
- check_both_ways("\u2018", "\x91", 'windows-1250') # ‘
- check_both_ways("\u2014", "\x97", 'windows-1250') # —
- assert_raise(Encoding::UndefinedConversionError) { "\x98".encode("utf-8", 'windows-1250') }
- check_both_ways("\u2122", "\x99", 'windows-1250') # ™
- check_both_ways("\u00A0", "\xA0", 'windows-1250') # non-breaking space
- check_both_ways("\u017B", "\xAF", 'windows-1250') # Ż
- check_both_ways("\u00B0", "\xB0", 'windows-1250') # °
- check_both_ways("\u017C", "\xBF", 'windows-1250') # ż
- check_both_ways("\u0154", "\xC0", 'windows-1250') # Ŕ
- check_both_ways("\u010E", "\xCF", 'windows-1250') # Ď
- check_both_ways("\u0110", "\xD0", 'windows-1250') # Đ
- check_both_ways("\u00DF", "\xDF", 'windows-1250') # ß
- check_both_ways("\u0155", "\xE0", 'windows-1250') # ŕ
- check_both_ways("\u010F", "\xEF", 'windows-1250') # ď
- check_both_ways("\u0111", "\xF0", 'windows-1250') # đ
- check_both_ways("\u02D9", "\xFF", 'windows-1250') # ˙
- end
-
- def test_windows_1251
- check_both_ways("\u0402", "\x80", 'windows-1251') # Ђ
- check_both_ways("\u20AC", "\x88", 'windows-1251') # €
- check_both_ways("\u040F", "\x8F", 'windows-1251') # Џ
- check_both_ways("\u0452", "\x90", 'windows-1251') # ђ
- assert_raise(Encoding::UndefinedConversionError) { "\x98".encode("utf-8", 'windows-1251') }
- check_both_ways("\u045F", "\x9F", 'windows-1251') # џ
- check_both_ways("\u00A0", "\xA0", 'windows-1251') # non-breaking space
- check_both_ways("\u0407", "\xAF", 'windows-1251') # Ї
- check_both_ways("\u00B0", "\xB0", 'windows-1251') # °
- check_both_ways("\u0457", "\xBF", 'windows-1251') # ї
- check_both_ways("\u0410", "\xC0", 'windows-1251') # А
- check_both_ways("\u041F", "\xCF", 'windows-1251') # П
- check_both_ways("\u0420", "\xD0", 'windows-1251') # Р
- check_both_ways("\u042F", "\xDF", 'windows-1251') # Я
- check_both_ways("\u0430", "\xE0", 'windows-1251') # а
- check_both_ways("\u043F", "\xEF", 'windows-1251') # п
- check_both_ways("\u0440", "\xF0", 'windows-1251') # р
- check_both_ways("\u044F", "\xFF", 'windows-1251') # я
- end
-
- def test_windows_1252
- check_both_ways("\u20AC", "\x80", 'windows-1252') # €
- assert_raise(Encoding::UndefinedConversionError) { "\x81".encode("utf-8", 'windows-1252') }
- check_both_ways("\u201A", "\x82", 'windows-1252') # ‚
- check_both_ways("\u0152", "\x8C", 'windows-1252') # >Œ
- assert_raise(Encoding::UndefinedConversionError) { "\x8D".encode("utf-8", 'windows-1252') }
- check_both_ways("\u017D", "\x8E", 'windows-1252') # Ž
- assert_raise(Encoding::UndefinedConversionError) { "\x8F".encode("utf-8", 'windows-1252') }
- assert_raise(Encoding::UndefinedConversionError) { "\x90".encode("utf-8", 'windows-1252') }
- check_both_ways("\u2018", "\x91", 'windows-1252') #‘
- check_both_ways("\u0153", "\x9C", 'windows-1252') # œ
- assert_raise(Encoding::UndefinedConversionError) { "\x9D".encode("utf-8", 'windows-1252') }
- check_both_ways("\u017E", "\x9E", 'windows-1252') # ž
- check_both_ways("\u00A0", "\xA0", 'windows-1252') # non-breaking space
- check_both_ways("\u00AF", "\xAF", 'windows-1252') # ¯
- check_both_ways("\u00B0", "\xB0", 'windows-1252') # °
- check_both_ways("\u00BF", "\xBF", 'windows-1252') # ¿
- check_both_ways("\u00C0", "\xC0", 'windows-1252') # À
- check_both_ways("\u00CF", "\xCF", 'windows-1252') # Ï
- check_both_ways("\u00D0", "\xD0", 'windows-1252') # Ð
- check_both_ways("\u00DF", "\xDF", 'windows-1252') # ß
- check_both_ways("\u00E0", "\xE0", 'windows-1252') # à
- check_both_ways("\u00EF", "\xEF", 'windows-1252') # ï
- check_both_ways("\u00F0", "\xF0", 'windows-1252') # ð
- check_both_ways("\u00FF", "\xFF", 'windows-1252') # ÿ
- end
-
- def test_windows_1253
- check_both_ways("\u20AC", "\x80", 'windows-1253') # €
- assert_raise(Encoding::UndefinedConversionError) { "\x81".encode("utf-8", 'windows-1253') }
- check_both_ways("\u201A", "\x82", 'windows-1253') # ‚
- check_both_ways("\u2021", "\x87", 'windows-1253') # ‡
- assert_raise(Encoding::UndefinedConversionError) { "\x88".encode("utf-8", 'windows-1253') }
- check_both_ways("\u2030", "\x89", 'windows-1253') # ‰
- assert_raise(Encoding::UndefinedConversionError) { "\x8A".encode("utf-8", 'windows-1253') }
- check_both_ways("\u2039", "\x8B", 'windows-1253') # ‹
- assert_raise(Encoding::UndefinedConversionError) { "\x8C".encode("utf-8", 'windows-1253') }
- assert_raise(Encoding::UndefinedConversionError) { "\x8F".encode("utf-8", 'windows-1253') }
- assert_raise(Encoding::UndefinedConversionError) { "\x90".encode("utf-8", 'windows-1253') }
- check_both_ways("\u2018", "\x91", 'windows-1253') # ‘
- check_both_ways("\u2014", "\x97", 'windows-1253') # —
- assert_raise(Encoding::UndefinedConversionError) { "\x98".encode("utf-8", 'windows-1253') }
- check_both_ways("\u2122", "\x99", 'windows-1253') # ™
- assert_raise(Encoding::UndefinedConversionError) { "\x9A".encode("utf-8", 'windows-1253') }
- check_both_ways("\u203A", "\x9B", 'windows-1253') # ›
- assert_raise(Encoding::UndefinedConversionError) { "\x9C".encode("utf-8", 'windows-1253') }
- assert_raise(Encoding::UndefinedConversionError) { "\x9F".encode("utf-8", 'windows-1253') }
- check_both_ways("\u00A0", "\xA0", 'windows-1253') # non-breaking space
- check_both_ways("\u2015", "\xAF", 'windows-1253') # ―
- check_both_ways("\u00B0", "\xB0", 'windows-1253') # °
- check_both_ways("\u038F", "\xBF", 'windows-1253') # Ώ
- check_both_ways("\u0390", "\xC0", 'windows-1253') # ΐ
- check_both_ways("\u039F", "\xCF", 'windows-1253') # Ο
- check_both_ways("\u03A0", "\xD0", 'windows-1253') # Π
- check_both_ways("\u03A1", "\xD1", 'windows-1253') # Ρ
- assert_raise(Encoding::UndefinedConversionError) { "\xD2".encode("utf-8", 'windows-1253') }
- check_both_ways("\u03A3", "\xD3", 'windows-1253') # Σ
- check_both_ways("\u03AF", "\xDF", 'windows-1253') # ί
- check_both_ways("\u03B0", "\xE0", 'windows-1253') # ΰ
- check_both_ways("\u03BF", "\xEF", 'windows-1253') # ο
- check_both_ways("\u03C0", "\xF0", 'windows-1253') # π
- check_both_ways("\u03CE", "\xFE", 'windows-1253') # ώ
- assert_raise(Encoding::UndefinedConversionError) { "\xFF".encode("utf-8", 'windows-1253') }
- end
-
- def test_windows_1254
- check_both_ways("\u20AC", "\x80", 'windows-1254') # €
- assert_raise(Encoding::UndefinedConversionError) { "\x81".encode("utf-8", 'windows-1254') }
- check_both_ways("\u201A", "\x82", 'windows-1254') # ‚
- check_both_ways("\u0152", "\x8C", 'windows-1254') # Œ
- assert_raise(Encoding::UndefinedConversionError) { "\x8D".encode("utf-8", 'windows-1254') }
- assert_raise(Encoding::UndefinedConversionError) { "\x8F".encode("utf-8", 'windows-1254') }
- assert_raise(Encoding::UndefinedConversionError) { "\x90".encode("utf-8", 'windows-1254') }
- check_both_ways("\u2018", "\x91", 'windows-1254') # ‘
- check_both_ways("\u0153", "\x9C", 'windows-1254') # œ
- assert_raise(Encoding::UndefinedConversionError) { "\x9D".encode("utf-8", 'windows-1254') }
- assert_raise(Encoding::UndefinedConversionError) { "\x9E".encode("utf-8", 'windows-1254') }
- check_both_ways("\u0178", "\x9F", 'windows-1254') # Ÿ
- check_both_ways("\u00A0", "\xA0", 'windows-1254') # non-breaking space
- check_both_ways("\u00AF", "\xAF", 'windows-1254') # ¯
- check_both_ways("\u00B0", "\xB0", 'windows-1254') # °
- check_both_ways("\u00BF", "\xBF", 'windows-1254') # ¿
- check_both_ways("\u00C0", "\xC0", 'windows-1254') # À
- check_both_ways("\u00CF", "\xCF", 'windows-1254') # Ï
- check_both_ways("\u011E", "\xD0", 'windows-1254') # Ğ
- check_both_ways("\u00DF", "\xDF", 'windows-1254') # ß
- check_both_ways("\u00E0", "\xE0", 'windows-1254') # à
- check_both_ways("\u00EF", "\xEF", 'windows-1254') # ï
- check_both_ways("\u011F", "\xF0", 'windows-1254') # ğ
- check_both_ways("\u00FF", "\xFF", 'windows-1254') # ÿ
- end
-
- def test_windows_1255
- check_both_ways("\u20AC", "\x80", 'windows-1255') # €
- assert_raise(Encoding::UndefinedConversionError) { "\x81".encode("utf-8", 'windows-1255') }
- check_both_ways("\u201A", "\x82", 'windows-1255') # ‚
- check_both_ways("\u2030", "\x89", 'windows-1255') # ‰
- assert_raise(Encoding::UndefinedConversionError) { "\x8A".encode("utf-8", 'windows-1255') }
- check_both_ways("\u2039", "\x8B", 'windows-1255') # ‹
- assert_raise(Encoding::UndefinedConversionError) { "\x8C".encode("utf-8", 'windows-1255') }
- assert_raise(Encoding::UndefinedConversionError) { "\x8F".encode("utf-8", 'windows-1255') }
- assert_raise(Encoding::UndefinedConversionError) { "\x90".encode("utf-8", 'windows-1255') }
- check_both_ways("\u2018", "\x91", 'windows-1255') # ‘
- check_both_ways("\u2122", "\x99", 'windows-1255') # ™
- assert_raise(Encoding::UndefinedConversionError) { "\x9A".encode("utf-8", 'windows-1255') }
- check_both_ways("\u203A", "\x9B", 'windows-1255') # ›
- assert_raise(Encoding::UndefinedConversionError) { "\x9C".encode("utf-8", 'windows-1255') }
- assert_raise(Encoding::UndefinedConversionError) { "\x9F".encode("utf-8", 'windows-1255') }
- check_both_ways("\u00A0", "\xA0", 'windows-1255') # non-breaking space
- check_both_ways("\u00A1", "\xA1", 'windows-1255') # ¡
- check_both_ways("\u00D7", "\xAA", 'windows-1255') # ×
- check_both_ways("\u00AF", "\xAF", 'windows-1255') # ¯
- check_both_ways("\u00B0", "\xB0", 'windows-1255') # °
- check_both_ways("\u00B8", "\xB8", 'windows-1255') # ¸
- check_both_ways("\u00F7", "\xBA", 'windows-1255') # ÷
- check_both_ways("\u00BF", "\xBF", 'windows-1255') # ¿
- check_both_ways("\u05B0", "\xC0", 'windows-1255') # ְ
- check_both_ways("\u05B9", "\xC9", 'windows-1255') # ֹ
- assert_raise(Encoding::UndefinedConversionError) { "\xCA".encode("utf-8", 'windows-1255') }
- check_both_ways("\u05BB", "\xCB", 'windows-1255') # ֻ
- check_both_ways("\u05BF", "\xCF", 'windows-1255') # ֿ
- check_both_ways("\u05C0", "\xD0", 'windows-1255') # ׀
- check_both_ways("\u05F3", "\xD7", 'windows-1255') # ׳
- check_both_ways("\u05F4", "\xD8", 'windows-1255') # ״
- assert_raise(Encoding::UndefinedConversionError) { "\xD9".encode("utf-8", 'windows-1255') }
- assert_raise(Encoding::UndefinedConversionError) { "\xDF".encode("utf-8", 'windows-1255') }
- check_both_ways("\u05D0", "\xE0", 'windows-1255') # א
- check_both_ways("\u05DF", "\xEF", 'windows-1255') # ן
- check_both_ways("\u05E0", "\xF0", 'windows-1255') # נ
- check_both_ways("\u05EA", "\xFA", 'windows-1255') # ת
- assert_raise(Encoding::UndefinedConversionError) { "\xFB".encode("utf-8", 'windows-1255') }
- assert_raise(Encoding::UndefinedConversionError) { "\xFC".encode("utf-8", 'windows-1255') }
- check_both_ways("\u200E", "\xFD", 'windows-1255') # left-to-right mark
- check_both_ways("\u200F", "\xFE", 'windows-1255') # right-to-left mark
- assert_raise(Encoding::UndefinedConversionError) { "\xFF".encode("utf-8", 'windows-1255') }
- end
-
- def test_windows_1256
- check_both_ways("\u20AC", "\x80", 'windows-1256') # €
- check_both_ways("\u0679", "\x8A", 'windows-1256') # ٹ
- check_both_ways("\u0688", "\x8F", 'windows-1256') # ڈ
- check_both_ways("\u06AF", "\x90", 'windows-1256') # گ
- check_both_ways("\u06A9", "\x98", 'windows-1256') # ک
- check_both_ways("\u0691", "\x9A", 'windows-1256') # ڑ
- check_both_ways("\u06BA", "\x9F", 'windows-1256') # ں
- check_both_ways("\u00A0", "\xA0", 'windows-1256') # non-breaking space
- check_both_ways("\u06BE", "\xAA", 'windows-1256') # ھ
- check_both_ways("\u00AF", "\xAF", 'windows-1256') # ¯
- check_both_ways("\u00B0", "\xB0", 'windows-1256') # °
- check_both_ways("\u061F", "\xBF", 'windows-1256') # ؟
- check_both_ways("\u06C1", "\xC0", 'windows-1256') # ہ
- check_both_ways("\u062F", "\xCF", 'windows-1256') # د
- check_both_ways("\u0630", "\xD0", 'windows-1256') # ذ
- check_both_ways("\u0643", "\xDF", 'windows-1256') # ك
- check_both_ways("\u00E0", "\xE0", 'windows-1256') # à
- check_both_ways("\u00EF", "\xEF", 'windows-1256') # ï
- check_both_ways("\u064B", "\xF0", 'windows-1256') # ًً
- check_both_ways("\u06D2", "\xFF", 'windows-1256') # ے
- end
-
- def test_windows_1257
- check_both_ways("\u20AC", "\x80", 'windows-1257') # €
- assert_raise(Encoding::UndefinedConversionError) { "\x81".encode("utf-8", 'windows-1257') }
- check_both_ways("\u201A", "\x82", 'windows-1257') # ‚
- assert_raise(Encoding::UndefinedConversionError) { "\x83".encode("utf-8", 'windows-1257') }
- check_both_ways("\u201E", "\x84", 'windows-1257') # „
- check_both_ways("\u2021", "\x87", 'windows-1257') # ‡
- assert_raise(Encoding::UndefinedConversionError) { "\x88".encode("utf-8", 'windows-1257') }
- check_both_ways("\u2030", "\x89", 'windows-1257') # ‰
- assert_raise(Encoding::UndefinedConversionError) { "\x8A".encode("utf-8", 'windows-1257') }
- check_both_ways("\u2039", "\x8B", 'windows-1257') # ‹
- assert_raise(Encoding::UndefinedConversionError) { "\x8C".encode("utf-8", 'windows-1257') }
- check_both_ways("\u00A8", "\x8D", 'windows-1257') # ¨
- check_both_ways("\u02C7", "\x8E", 'windows-1257') # ˇ
- check_both_ways("\u00B8", "\x8F", 'windows-1257') # ¸
- assert_raise(Encoding::UndefinedConversionError) { "\x90".encode("utf-8", 'windows-1257') }
- check_both_ways("\u2018", "\x91", 'windows-1257') # ‘
- check_both_ways("\u2014", "\x97", 'windows-1257') # —
- assert_raise(Encoding::UndefinedConversionError) { "\x98".encode("utf-8", 'windows-1257') }
- check_both_ways("\u2122", "\x99", 'windows-1257') # ™
- assert_raise(Encoding::UndefinedConversionError) { "\x9A".encode("utf-8", 'windows-1257') }
- check_both_ways("\u203A", "\x9B", 'windows-1257') # ›
- assert_raise(Encoding::UndefinedConversionError) { "\x9C".encode("utf-8", 'windows-1257') }
- check_both_ways("\u00AF", "\x9D", 'windows-1257') # ¯
- check_both_ways("\u02DB", "\x9E", 'windows-1257') # ˛
- assert_raise(Encoding::UndefinedConversionError) { "\x9F".encode("utf-8", 'windows-1257') }
- check_both_ways("\u00A0", "\xA0", 'windows-1257') # non-breaking space
- assert_raise(Encoding::UndefinedConversionError) { "\xA1".encode("utf-8", 'windows-1257') }
- check_both_ways("\u00A2", "\xA2", 'windows-1257') # ¢
- check_both_ways("\u00A4", "\xA4", 'windows-1257') # ¤
- assert_raise(Encoding::UndefinedConversionError) { "\xA5".encode("utf-8", 'windows-1257') }
- check_both_ways("\u00A6", "\xA6", 'windows-1257') # ¦
- check_both_ways("\u00C6", "\xAF", 'windows-1257') # Æ
- check_both_ways("\u00B0", "\xB0", 'windows-1257') # °
- check_both_ways("\u00E6", "\xBF", 'windows-1257') # æ
- check_both_ways("\u0104", "\xC0", 'windows-1257') # Ą
- check_both_ways("\u013B", "\xCF", 'windows-1257') # Ļ
- check_both_ways("\u0160", "\xD0", 'windows-1257') # Š
- check_both_ways("\u00DF", "\xDF", 'windows-1257') # ß
- check_both_ways("\u0105", "\xE0", 'windows-1257') # ą
- check_both_ways("\u013C", "\xEF", 'windows-1257') # ļ
- check_both_ways("\u0161", "\xF0", 'windows-1257') # š
- check_both_ways("\u02D9", "\xFF", 'windows-1257') # ˙
- end
-
- def test_IBM437
- check_both_ways("\u00C7", "\x80", 'IBM437') # Ç
- check_both_ways("\u00C5", "\x8F", 'IBM437') # Å
- check_both_ways("\u00C9", "\x90", 'IBM437') # É
- check_both_ways("\u0192", "\x9F", 'IBM437') # ƒ
- check_both_ways("\u00E1", "\xA0", 'IBM437') # á
- check_both_ways("\u00BB", "\xAF", 'IBM437') # »
- check_both_ways("\u2591", "\xB0", 'IBM437') # ░
- check_both_ways("\u2510", "\xBF", 'IBM437') # ┐
- check_both_ways("\u2514", "\xC0", 'IBM437') # └
- check_both_ways("\u2567", "\xCF", 'IBM437') # ╧
- check_both_ways("\u2568", "\xD0", 'IBM437') # ╨
- check_both_ways("\u2580", "\xDF", 'IBM437') # ▀
- check_both_ways("\u03B1", "\xE0", 'IBM437') # α
- check_both_ways("\u2229", "\xEF", 'IBM437') # ∩
- check_both_ways("\u2261", "\xF0", 'IBM437') # ≡
- check_both_ways("\u00A0", "\xFF", 'IBM437') # non-breaking space
- end
-
- def test_IBM775
- check_both_ways("\u0106", "\x80", 'IBM775') # Ć
- check_both_ways("\u00C5", "\x8F", 'IBM775') # Å
- check_both_ways("\u00C9", "\x90", 'IBM775') # É
- check_both_ways("\u00A4", "\x9F", 'IBM775') # ¤
- check_both_ways("\u0100", "\xA0", 'IBM775') # Ā
- check_both_ways("\u00BB", "\xAF", 'IBM775') # »
- check_both_ways("\u2591", "\xB0", 'IBM775') # ░
- check_both_ways("\u2510", "\xBF", 'IBM775') # ┐
- check_both_ways("\u2514", "\xC0", 'IBM775') # └
- check_both_ways("\u017D", "\xCF", 'IBM775') # Ž
- check_both_ways("\u0105", "\xD0", 'IBM775') # ą
- check_both_ways("\u2580", "\xDF", 'IBM775') # ▀
- check_both_ways("\u00D3", "\xE0", 'IBM775') # Ó
- check_both_ways("\u2019", "\xEF", 'IBM775') # ’
- check_both_ways("\u00AD", "\xF0", 'IBM775') # osft hyphen
- check_both_ways("\u00A0", "\xFF", 'IBM775') # non-breaking space
- end
-
- def test_IBM852
- check_both_ways("\u00C7", "\x80", 'IBM852') # Ç
- check_both_ways("\u0106", "\x8F", 'IBM852') # Ć
- check_both_ways("\u00C9", "\x90", 'IBM852') # É
- check_both_ways("\u010D", "\x9F", 'IBM852') # č
- check_both_ways("\u00E1", "\xA0", 'IBM852') # á
- check_both_ways("\u00BB", "\xAF", 'IBM852') # »
- check_both_ways("\u2591", "\xB0", 'IBM852') # ░
- check_both_ways("\u2510", "\xBF", 'IBM852') # ┐
- check_both_ways("\u2514", "\xC0", 'IBM852') # └
- check_both_ways("\u00A4", "\xCF", 'IBM852') # ¤
- check_both_ways("\u0111", "\xD0", 'IBM852') # đ
- check_both_ways("\u2580", "\xDF", 'IBM852') # ▀
- check_both_ways("\u00D3", "\xE0", 'IBM852') # Ó
- check_both_ways("\u00B4", "\xEF", 'IBM852') # ´
- check_both_ways("\u00AD", "\xF0", 'IBM852') # osft hyphen
- check_both_ways("\u00A0", "\xFF", 'IBM852') # non-breaking space
- end
-
- def test_IBM855
- check_both_ways("\u0452", "\x80", 'IBM855') # ђ
- check_both_ways("\u0408", "\x8F", 'IBM855') # Ј
- check_both_ways("\u0459", "\x90", 'IBM855') # љ
- check_both_ways("\u042A", "\x9F", 'IBM855') # Ъ
- check_both_ways("\u0430", "\xA0", 'IBM855') # а
- check_both_ways("\u00BB", "\xAF", 'IBM855') # »
- check_both_ways("\u2591", "\xB0", 'IBM855') # ░
- check_both_ways("\u2510", "\xBF", 'IBM855') # ┐
- check_both_ways("\u2514", "\xC0", 'IBM855') # └
- check_both_ways("\u00A4", "\xCF", 'IBM855') # ¤
- check_both_ways("\u043B", "\xD0", 'IBM855') # л
- check_both_ways("\u2580", "\xDF", 'IBM855') # ▀
- check_both_ways("\u042F", "\xE0", 'IBM855') # Я
- check_both_ways("\u2116", "\xEF", 'IBM855') # №
- check_both_ways("\u00AD", "\xF0", 'IBM855') # osft hyphen
- check_both_ways("\u00A0", "\xFF", 'IBM855') # non-breaking space
- end
-
- def test_IBM857
- check_both_ways("\u00C7", "\x80", 'IBM857') # Ç
- check_both_ways("\u00C5", "\x8F", 'IBM857') # Å
- check_both_ways("\u00C9", "\x90", 'IBM857') # É
- check_both_ways("\u015F", "\x9F", 'IBM857') # ş
- check_both_ways("\u00E1", "\xA0", 'IBM857') # á
- check_both_ways("\u00BB", "\xAF", 'IBM857') # »
- check_both_ways("\u2591", "\xB0", 'IBM857') # ░
- check_both_ways("\u2510", "\xBF", 'IBM857') # ┐
- check_both_ways("\u2514", "\xC0", 'IBM857') # └
- check_both_ways("\u00A4", "\xCF", 'IBM857') # ¤
- check_both_ways("\u00BA", "\xD0", 'IBM857') # º
- check_both_ways("\u00C8", "\xD4", 'IBM857') # È
- assert_raise(Encoding::UndefinedConversionError) { "\xD5".encode("utf-8", 'IBM857') }
- check_both_ways("\u00CD", "\xD6", 'IBM857') # Í
- check_both_ways("\u2580", "\xDF", 'IBM857') # ▀
- check_both_ways("\u00D3", "\xE0", 'IBM857') # Ó
- check_both_ways("\u00B5", "\xE6", 'IBM857') # µ
- assert_raise(Encoding::UndefinedConversionError) { "\xE7".encode("utf-8", 'IBM857') }
- check_both_ways("\u00D7", "\xE8", 'IBM857') # ×
- check_both_ways("\u00B4", "\xEF", 'IBM857') # ´
- check_both_ways("\u00AD", "\xF0", 'IBM857') # soft hyphen
- check_both_ways("\u00B1", "\xF1", 'IBM857') # ±
- assert_raise(Encoding::UndefinedConversionError) { "\xF2".encode("utf-8", 'IBM857') }
- check_both_ways("\u00BE", "\xF3", 'IBM857') # ¾
- check_both_ways("\u00A0", "\xFF", 'IBM857') # non-breaking space
- end
-
- def test_IBM860
- check_both_ways("\u00C7", "\x80", 'IBM860') # Ç
- check_both_ways("\u00C2", "\x8F", 'IBM860') # Â
- check_both_ways("\u00C9", "\x90", 'IBM860') # É
- check_both_ways("\u00D3", "\x9F", 'IBM860') # Ó
- check_both_ways("\u00E1", "\xA0", 'IBM860') # á
- check_both_ways("\u00BB", "\xAF", 'IBM860') # »
- check_both_ways("\u2591", "\xB0", 'IBM860') # ░
- check_both_ways("\u2510", "\xBF", 'IBM860') # ┐
- check_both_ways("\u2514", "\xC0", 'IBM860') # └
- check_both_ways("\u2567", "\xCF", 'IBM860') # ╧
- check_both_ways("\u2568", "\xD0", 'IBM860') # ╨
- check_both_ways("\u2580", "\xDF", 'IBM860') # ▀
- check_both_ways("\u03B1", "\xE0", 'IBM860') # α
- check_both_ways("\u2229", "\xEF", 'IBM860') # ∩
- check_both_ways("\u2261", "\xF0", 'IBM860') # ≡
- check_both_ways("\u00A0", "\xFF", 'IBM860') # non-breaking space
- end
-
- def test_IBM861
- check_both_ways("\u00C7", "\x80", 'IBM861') # Ç
- check_both_ways("\u00C5", "\x8F", 'IBM861') # Å
- check_both_ways("\u00C9", "\x90", 'IBM861') # É
- check_both_ways("\u0192", "\x9F", 'IBM861') # ƒ
- check_both_ways("\u00E1", "\xA0", 'IBM861') # á
- check_both_ways("\u00BB", "\xAF", 'IBM861') # »
- check_both_ways("\u2591", "\xB0", 'IBM861') # ░
- check_both_ways("\u2510", "\xBF", 'IBM861') # ┐
- check_both_ways("\u2514", "\xC0", 'IBM861') # └
- check_both_ways("\u2567", "\xCF", 'IBM861') # ╧
- check_both_ways("\u2568", "\xD0", 'IBM861') # ╨
- check_both_ways("\u2580", "\xDF", 'IBM861') # ▀
- check_both_ways("\u03B1", "\xE0", 'IBM861') # α
- check_both_ways("\u2229", "\xEF", 'IBM861') # ∩
- check_both_ways("\u2261", "\xF0", 'IBM861') # ≡
- check_both_ways("\u00A0", "\xFF", 'IBM861') # non-breaking space
- end
-
- def test_IBM862
- check_both_ways("\u05D0", "\x80", 'IBM862') # א
- check_both_ways("\u05DF", "\x8F", 'IBM862') # ן
- check_both_ways("\u05E0", "\x90", 'IBM862') # נ
- check_both_ways("\u0192", "\x9F", 'IBM862') # ƒ
- check_both_ways("\u00E1", "\xA0", 'IBM862') # á
- check_both_ways("\u00BB", "\xAF", 'IBM862') # »
- check_both_ways("\u2591", "\xB0", 'IBM862') # ░
- check_both_ways("\u2510", "\xBF", 'IBM862') # ┐
- check_both_ways("\u2514", "\xC0", 'IBM862') # └
- check_both_ways("\u2567", "\xCF", 'IBM862') # ╧
- check_both_ways("\u2568", "\xD0", 'IBM862') # ╨
- check_both_ways("\u2580", "\xDF", 'IBM862') # ▀
- check_both_ways("\u03B1", "\xE0", 'IBM862') # α
- check_both_ways("\u2229", "\xEF", 'IBM862') # ∩
- check_both_ways("\u2261", "\xF0", 'IBM862') # ≡
- check_both_ways("\u00A0", "\xFF", 'IBM862') # non-breaking space
- end
-
- def test_IBM863
- check_both_ways("\u00C7", "\x80", 'IBM863') # Ç
- check_both_ways("\u00A7", "\x8F", 'IBM863') # §
- check_both_ways("\u00C9", "\x90", 'IBM863') # É
- check_both_ways("\u0192", "\x9F", 'IBM863') # ƒ
- check_both_ways("\u00A6", "\xA0", 'IBM863') # ¦
- check_both_ways("\u00BB", "\xAF", 'IBM863') # »
- check_both_ways("\u2591", "\xB0", 'IBM863') # ░
- check_both_ways("\u2510", "\xBF", 'IBM863') # ┐
- check_both_ways("\u2514", "\xC0", 'IBM863') # └
- check_both_ways("\u2567", "\xCF", 'IBM863') # ╧
- check_both_ways("\u2568", "\xD0", 'IBM863') # ╨
- check_both_ways("\u2580", "\xDF", 'IBM863') # ▀
- check_both_ways("\u03B1", "\xE0", 'IBM863') # α
- check_both_ways("\u2229", "\xEF", 'IBM863') # ∩
- check_both_ways("\u2261", "\xF0", 'IBM863') # ≡
- check_both_ways("\u00A0", "\xFF", 'IBM863') # non-breaking space
- end
-
- def test_IBM865
- check_both_ways("\u00C7", "\x80", 'IBM865') # Ç
- check_both_ways("\u00C5", "\x8F", 'IBM865') # Å
- check_both_ways("\u00C9", "\x90", 'IBM865') # É
- check_both_ways("\u0192", "\x9F", 'IBM865') # ƒ
- check_both_ways("\u00E1", "\xA0", 'IBM865') # á
- check_both_ways("\u00A4", "\xAF", 'IBM865') # ¤
- check_both_ways("\u2591", "\xB0", 'IBM865') # ░
- check_both_ways("\u2510", "\xBF", 'IBM865') # ┐
- check_both_ways("\u2514", "\xC0", 'IBM865') # └
- check_both_ways("\u2567", "\xCF", 'IBM865') # ╧
- check_both_ways("\u2568", "\xD0", 'IBM865') # ╨
- check_both_ways("\u2580", "\xDF", 'IBM865') # ▀
- check_both_ways("\u03B1", "\xE0", 'IBM865') # α
- check_both_ways("\u2229", "\xEF", 'IBM865') # ∩
- check_both_ways("\u2261", "\xF0", 'IBM865') # ≡
- check_both_ways("\u00A0", "\xFF", 'IBM865') # non-breaking space
- end
-
- def test_IBM866
- check_both_ways("\u0410", "\x80", 'IBM866') # А
- check_both_ways("\u041F", "\x8F", 'IBM866') # П
- check_both_ways("\u0420", "\x90", 'IBM866') # Р
- check_both_ways("\u042F", "\x9F", 'IBM866') # Я
- check_both_ways("\u0430", "\xA0", 'IBM866') # а
- check_both_ways("\u043F", "\xAF", 'IBM866') # п
- check_both_ways("\u2591", "\xB0", 'IBM866') # ░
- check_both_ways("\u2510", "\xBF", 'IBM866') # ┐
- check_both_ways("\u2514", "\xC0", 'IBM866') # └
- check_both_ways("\u2567", "\xCF", 'IBM866') # ╧
- check_both_ways("\u2568", "\xD0", 'IBM866') # ╨
- check_both_ways("\u2580", "\xDF", 'IBM866') # ▀
- check_both_ways("\u0440", "\xE0", 'IBM866') # р
- check_both_ways("\u044F", "\xEF", 'IBM866') # я
- check_both_ways("\u0401", "\xF0", 'IBM866') # Ё
- check_both_ways("\u00A0", "\xFF", 'IBM866') # non-breaking space
- end
-
- def test_IBM869
- assert_raise(Encoding::UndefinedConversionError) { "\x80".encode("utf-8", 'IBM869') }
- assert_raise(Encoding::UndefinedConversionError) { "\x85".encode("utf-8", 'IBM869') }
- check_both_ways("\u0386", "\x86", 'IBM869') # Ά
- assert_raise(Encoding::UndefinedConversionError) { "\x87".encode("utf-8", 'IBM869') }
- check_both_ways("\u00B7", "\x88", 'IBM869') # ·
- check_both_ways("\u0389", "\x8F", 'IBM869') # Ή
- check_both_ways("\u038A", "\x90", 'IBM869') # Ί
- check_both_ways("\u038C", "\x92", 'IBM869') # Ό
- assert_raise(Encoding::UndefinedConversionError) { "\x93".encode("utf-8", 'IBM869') }
- assert_raise(Encoding::UndefinedConversionError) { "\x94".encode("utf-8", 'IBM869') }
- check_both_ways("\u038E", "\x95", 'IBM869') # Ύ
- check_both_ways("\u03AF", "\x9F", 'IBM869') # ί
- check_both_ways("\u03CA", "\xA0", 'IBM869') # ϊ
- check_both_ways("\u00BB", "\xAF", 'IBM869') # »
- check_both_ways("\u2591", "\xB0", 'IBM869') # ░
- check_both_ways("\u2510", "\xBF", 'IBM869') # ┐
- check_both_ways("\u2514", "\xC0", 'IBM869') # └
- check_both_ways("\u03A3", "\xCF", 'IBM869') # Σ
- check_both_ways("\u03A4", "\xD0", 'IBM869') # Τ
- check_both_ways("\u2580", "\xDF", 'IBM869') # ▀
- check_both_ways("\u03B6", "\xE0", 'IBM869') # ζ
- check_both_ways("\u0384", "\xEF", 'IBM869') # ΄
- check_both_ways("\u00AD", "\xF0", 'IBM869') # soft hyphen
- check_both_ways("\u00A0", "\xFF", 'IBM869') # non-breaking space
- end
-
- def test_macCroatian
- check_both_ways("\u00C4", "\x80", 'macCroatian') # Ä
- check_both_ways("\u00E8", "\x8F", 'macCroatian') # è
- check_both_ways("\u00EA", "\x90", 'macCroatian') # ê
- check_both_ways("\u00FC", "\x9F", 'macCroatian') # ü
- check_both_ways("\u2020", "\xA0", 'macCroatian') # †
- check_both_ways("\u00D8", "\xAF", 'macCroatian') # Ø
- check_both_ways("\u221E", "\xB0", 'macCroatian') # ∞
- check_both_ways("\u00F8", "\xBF", 'macCroatian') # ø
- check_both_ways("\u00BF", "\xC0", 'macCroatian') # ¿
- check_both_ways("\u0153", "\xCF", 'macCroatian') # œ
- check_both_ways("\u0110", "\xD0", 'macCroatian') # Đ
- check_both_ways("\u00A9", "\xD9", 'macCroatian') # ©
- check_both_ways("\u2044", "\xDA", 'macCroatian') # ⁄
- check_both_ways("\u203A", "\xDD", 'macCroatian') # ›
- check_both_ways("\u00C6", "\xDE", 'macCroatian') # Æ
- check_both_ways("\u00BB", "\xDF", 'macCroatian') # »
- check_both_ways("\u2013", "\xE0", 'macCroatian') # –
- check_both_ways("\u00B7", "\xE1", 'macCroatian') # ·
- check_both_ways("\u00C2", "\xE5", 'macCroatian') # Â
- check_both_ways("\u0107", "\xE6", 'macCroatian') # ć
- check_both_ways("\u00C1", "\xE7", 'macCroatian') # Á
- check_both_ways("\u010D", "\xE8", 'macCroatian') # č
- check_both_ways("\u00C8", "\xE9", 'macCroatian') # È
- check_both_ways("\u00D4", "\xEF", 'macCroatian') # Ô
- check_both_ways("\u0111", "\xF0", 'macCroatian') # đ
- check_both_ways("\u00D2", "\xF1", 'macCroatian') # Ò
- check_both_ways("\u00AF", "\xF8", 'macCroatian') # ¯
- check_both_ways("\u03C0", "\xF9", 'macCroatian') # π
- check_both_ways("\u00CB", "\xFA", 'macCroatian') # Ë
- check_both_ways("\u00CA", "\xFD", 'macCroatian') # Ê
- check_both_ways("\u00E6", "\xFE", 'macCroatian') # æ
- check_both_ways("\u02C7", "\xFF", 'macCroatian') # ˇ
- end
-
- def test_macCyrillic
- check_both_ways("\u0410", "\x80", 'macCyrillic') # А
- check_both_ways("\u041F", "\x8F", 'macCyrillic') # П
- check_both_ways("\u0420", "\x90", 'macCyrillic') # Р
- check_both_ways("\u042F", "\x9F", 'macCyrillic') # Я
- check_both_ways("\u2020", "\xA0", 'macCyrillic') # †
- check_both_ways("\u0453", "\xAF", 'macCyrillic') # ѓ
- check_both_ways("\u221E", "\xB0", 'macCyrillic') # ∞
- check_both_ways("\u045A", "\xBF", 'macCyrillic') # њ
- check_both_ways("\u0458", "\xC0", 'macCyrillic') # ј
- check_both_ways("\u0455", "\xCF", 'macCyrillic') # ѕ
- check_both_ways("\u2013", "\xD0", 'macCyrillic') # –
- check_both_ways("\u044F", "\xDF", 'macCyrillic') # я
- check_both_ways("\u0430", "\xE0", 'macCyrillic') # а
- check_both_ways("\u043F", "\xEF", 'macCyrillic') # п
- check_both_ways("\u0440", "\xF0", 'macCyrillic') # р
- check_both_ways("\u00A4", "\xFF", 'macCyrillic') # ¤
- end
-
- def test_macGreek
- check_both_ways("\u00C4", "\x80", 'macGreek') # Ä
- check_both_ways("\u00E8", "\x8F", 'macGreek') # è
- check_both_ways("\u00EA", "\x90", 'macGreek') # ê
- check_both_ways("\u00FC", "\x9F", 'macGreek') # ü
- check_both_ways("\u2020", "\xA0", 'macGreek') # †
- check_both_ways("\u0393", "\xA1", 'macGreek') # Γ
- check_both_ways("\u0387", "\xAF", 'macGreek') # ·
- check_both_ways("\u0391", "\xB0", 'macGreek') # Α
- check_both_ways("\u03A9", "\xBF", 'macGreek') # Ω
- check_both_ways("\u03AC", "\xC0", 'macGreek') # ά
- check_both_ways("\u0153", "\xCF", 'macGreek') # œ
- check_both_ways("\u2013", "\xD0", 'macGreek') # –
- check_both_ways("\u038F", "\xDF", 'macGreek') # Ώ
- check_both_ways("\u03CD", "\xE0", 'macGreek') # ύ
- check_both_ways("\u03BF", "\xEF", 'macGreek') # ο
- check_both_ways("\u03C0", "\xF0", 'macGreek') # π
- check_both_ways("\u03B0", "\xFE", 'macGreek') # ΰ
- assert_raise(Encoding::UndefinedConversionError) { "\xFF".encode("utf-8", 'macGreek') }
- end
-
- def test_macIceland
- check_both_ways("\u00C4", "\x80", 'macIceland') # Ä
- check_both_ways("\u00E8", "\x8F", 'macIceland') # è
- check_both_ways("\u00EA", "\x90", 'macIceland') # ê
- check_both_ways("\u00FC", "\x9F", 'macIceland') # ü
- check_both_ways("\u00DD", "\xA0", 'macIceland') # Ý
- check_both_ways("\u00D8", "\xAF", 'macIceland') # Ø
- check_both_ways("\u221E", "\xB0", 'macIceland') # ∞
- check_both_ways("\u00F8", "\xBF", 'macIceland') # ø
- check_both_ways("\u00BF", "\xC0", 'macIceland') # ¿
- check_both_ways("\u0153", "\xCF", 'macIceland') # œ
- check_both_ways("\u2013", "\xD0", 'macIceland') # –
- check_both_ways("\u00FE", "\xDF", 'macIceland') # þ
- check_both_ways("\u00FD", "\xE0", 'macIceland') # ý
- check_both_ways("\u00D4", "\xEF", 'macIceland') # Ô
- #check_both_ways("\uF8FF", "\xF0", 'macIceland') # Apple logo
- check_both_ways("\u02C7", "\xFF", 'macIceland') # ˇ
- end
-
- def test_macRoman
- check_both_ways("\u00C4", "\x80", 'macRoman') # Ä
- check_both_ways("\u00E8", "\x8F", 'macRoman') # è
- check_both_ways("\u00EA", "\x90", 'macRoman') # ê
- check_both_ways("\u00FC", "\x9F", 'macRoman') # ü
- check_both_ways("\u2020", "\xA0", 'macRoman') # †
- #check_both_ways("\u00DB", "\xAF", 'macRoman') # Ø
- check_both_ways("\u221E", "\xB0", 'macRoman') # ∞
- check_both_ways("\u00F8", "\xBF", 'macRoman') # ø
- check_both_ways("\u00BF", "\xC0", 'macRoman') # ¿
- check_both_ways("\u0153", "\xCF", 'macRoman') # œ
- check_both_ways("\u2013", "\xD0", 'macRoman') # –
- check_both_ways("\u00A4", "\xDB", 'macRoman') # ¤
- check_both_ways("\uFB02", "\xDF", 'macRoman') # fl
- check_both_ways("\u2021", "\xE0", 'macRoman') # ‡
- check_both_ways("\u00D4", "\xEF", 'macRoman') # Ô
- #check_both_ways("\uF8FF", "\xF0", 'macRoman') # Apple logo
- check_both_ways("\u02C7", "\xFF", 'macRoman') # ˇ
- end
-
- def test_macRomania
- check_both_ways("\u00C4", "\x80", 'macRomania') # Ä
- check_both_ways("\u00E8", "\x8F", 'macRomania') # è
- check_both_ways("\u00EA", "\x90", 'macRomania') # ê
- check_both_ways("\u00FC", "\x9F", 'macRomania') # ü
- check_both_ways("\u2020", "\xA0", 'macRomania') # †
- check_both_ways("\u015E", "\xAF", 'macRomania') # Ş
- check_both_ways("\u221E", "\xB0", 'macRomania') # ∞
- check_both_ways("\u015F", "\xBF", 'macRomania') # ş
- check_both_ways("\u00BF", "\xC0", 'macRomania') # ¿
- check_both_ways("\u0153", "\xCF", 'macRomania') # œ
- check_both_ways("\u2013", "\xD0", 'macRomania') # –
- check_both_ways("\u00A4", "\xDB", 'macRomania') # €
- check_both_ways("\u0163", "\xDF", 'macRomania') # ţ
- check_both_ways("\u2021", "\xE0", 'macRomania') # ‡
- check_both_ways("\u00D4", "\xEF", 'macRomania') # Ô
- #check_both_ways("\uF8FF", "\xF0", 'macRomania') # Apple logo
- check_both_ways("\u02C7", "\xFF", 'macRomania') # ˇ
- end
-
- def test_macTurkish
- check_both_ways("\u00C4", "\x80", 'macTurkish') # Ä
- check_both_ways("\u00E8", "\x8F", 'macTurkish') # è
- check_both_ways("\u00EA", "\x90", 'macTurkish') # ê
- check_both_ways("\u00FC", "\x9F", 'macTurkish') # ü
- check_both_ways("\u2020", "\xA0", 'macTurkish') # †
- check_both_ways("\u00D8", "\xAF", 'macTurkish') # Ø
- check_both_ways("\u221E", "\xB0", 'macTurkish') # ∞
- check_both_ways("\u00F8", "\xBF", 'macTurkish') # ø
- check_both_ways("\u00BF", "\xC0", 'macTurkish') # ¿
- check_both_ways("\u0153", "\xCF", 'macTurkish') # œ
- check_both_ways("\u2013", "\xD0", 'macTurkish') # –
- check_both_ways("\u015F", "\xDF", 'macTurkish') # ş
- check_both_ways("\u2021", "\xE0", 'macTurkish') # ‡
- check_both_ways("\u00D4", "\xEF", 'macTurkish') # Ô
- #check_both_ways("\uF8FF", "\xF0", 'macTurkish') # Apple logo
- check_both_ways("\u00D9", "\xF4", 'macTurkish') # Ù
- assert_raise(Encoding::UndefinedConversionError) { "\xF5".encode("utf-8", 'macTurkish') }
- check_both_ways("\u02C6", "\xF6", 'macTurkish') # ˆ
- check_both_ways("\u02C7", "\xFF", 'macTurkish') # ˇ
- end
-
- def test_macUkraine
- check_both_ways("\u0410", "\x80", 'macUkraine') # А
- check_both_ways("\u041F", "\x8F", 'macUkraine') # П
- check_both_ways("\u0420", "\x90", 'macUkraine') # Р
- check_both_ways("\u042F", "\x9F", 'macUkraine') # Я
- check_both_ways("\u2020", "\xA0", 'macUkraine') # †
- check_both_ways("\u0453", "\xAF", 'macUkraine') # ѓ
- check_both_ways("\u221E", "\xB0", 'macUkraine') # ∞
- check_both_ways("\u045A", "\xBF", 'macUkraine') # њ
- check_both_ways("\u0458", "\xC0", 'macUkraine') # ј
- check_both_ways("\u0455", "\xCF", 'macUkraine') # ѕ
- check_both_ways("\u2013", "\xD0", 'macUkraine') # –
- check_both_ways("\u044F", "\xDF", 'macUkraine') # я
- check_both_ways("\u0430", "\xE0", 'macUkraine') # а
- check_both_ways("\u043F", "\xEF", 'macUkraine') # п
- check_both_ways("\u0440", "\xF0", 'macUkraine') # р
- check_both_ways("\u00A4", "\xFF", 'macUkraine') # ¤
- end
-
- def test_koi8_u
- check_both_ways("\u2500", "\x80", 'KOI8-U') # ─
- check_both_ways("\u2590", "\x8F", 'KOI8-U') # ▐
- check_both_ways("\u2591", "\x90", 'KOI8-U') # ░
- check_both_ways("\u00F7", "\x9F", 'KOI8-U') # ÷
- check_both_ways("\u2550", "\xA0", 'KOI8-U') # ═
- check_both_ways("\u0454", "\xA4", 'KOI8-U') # є
- check_both_ways("\u0456", "\xA6", 'KOI8-U') # і
- check_both_ways("\u0457", "\xA7", 'KOI8-U') # ї
- check_both_ways("\u0491", "\xAD", 'KOI8-U') # ґ
- check_both_ways("\u255E", "\xAF", 'KOI8-U') # ╞
- check_both_ways("\u255F", "\xB0", 'KOI8-U') # ╟
- check_both_ways("\u0404", "\xB4", 'KOI8-U') # Є
- check_both_ways("\u0406", "\xB6", 'KOI8-U') # І
- check_both_ways("\u0407", "\xB7", 'KOI8-U') # Ї
- check_both_ways("\u0490", "\xBD", 'KOI8-U') # Ґ
- check_both_ways("\u00A9", "\xBF", 'KOI8-U') # ©
- check_both_ways("\u044E", "\xC0", 'KOI8-U') # ю
- check_both_ways("\u043E", "\xCF", 'KOI8-U') # о
- check_both_ways("\u043F", "\xD0", 'KOI8-U') # п
- check_both_ways("\u044A", "\xDF", 'KOI8-U') # ъ
- check_both_ways("\u042E", "\xE0", 'KOI8-U') # Ю
- check_both_ways("\u041E", "\xEF", 'KOI8-U') # О
- check_both_ways("\u041F", "\xF0", 'KOI8-U') # П
- check_both_ways("\u042A", "\xFF", 'KOI8-U') # Ъ
- end
-
- def test_koi8_r
- check_both_ways("\u2500", "\x80", 'KOI8-R') # ─
- check_both_ways("\u2590", "\x8F", 'KOI8-R') # ▐
- check_both_ways("\u2591", "\x90", 'KOI8-R') # ░
- check_both_ways("\u00F7", "\x9F", 'KOI8-R') # ÷
- check_both_ways("\u2550", "\xA0", 'KOI8-R') # ═
- check_both_ways("\u255E", "\xAF", 'KOI8-R') # ╞
- check_both_ways("\u255F", "\xB0", 'KOI8-R') # ╟
- check_both_ways("\u00A9", "\xBF", 'KOI8-R') # ©
- check_both_ways("\u044E", "\xC0", 'KOI8-R') # ю
- check_both_ways("\u043E", "\xCF", 'KOI8-R') # о
- check_both_ways("\u043F", "\xD0", 'KOI8-R') # п
- check_both_ways("\u044A", "\xDF", 'KOI8-R') # ъ
- check_both_ways("\u042E", "\xE0", 'KOI8-R') # Ю
- check_both_ways("\u041E", "\xEF", 'KOI8-R') # О
- check_both_ways("\u041F", "\xF0", 'KOI8-R') # П
- check_both_ways("\u042A", "\xFF", 'KOI8-R') # Ъ
- end
-
- def test_TIS_620
- assert_raise(Encoding::UndefinedConversionError) { "\x80".encode("utf-8", 'TIS-620') }
- assert_raise(Encoding::UndefinedConversionError) { "\x8F".encode("utf-8", 'TIS-620') }
- assert_raise(Encoding::UndefinedConversionError) { "\x90".encode("utf-8", 'TIS-620') }
- assert_raise(Encoding::UndefinedConversionError) { "\x9F".encode("utf-8", 'TIS-620') }
- assert_raise(Encoding::UndefinedConversionError) { "\xA0".encode("utf-8", 'TIS-620') }
- check_both_ways("\u0E01", "\xA1", 'TIS-620') # ก
- check_both_ways("\u0E0F", "\xAF", 'TIS-620') # ฏ
- check_both_ways("\u0E10", "\xB0", 'TIS-620') # ฐ
- check_both_ways("\u0E1F", "\xBF", 'TIS-620') # ฟ
- check_both_ways("\u0E20", "\xC0", 'TIS-620') # ภ
- check_both_ways("\u0E2F", "\xCF", 'TIS-620') # ฯ
- check_both_ways("\u0E30", "\xD0", 'TIS-620') # ะ
- check_both_ways("\u0E3A", "\xDA", 'TIS-620') # ฺ
- assert_raise(Encoding::UndefinedConversionError) { "\xDB".encode("utf-8", 'TIS-620') }
- assert_raise(Encoding::UndefinedConversionError) { "\xDE".encode("utf-8", 'TIS-620') }
- check_both_ways("\u0E3F", "\xDF", 'TIS-620') # ฿
- check_both_ways("\u0E40", "\xE0", 'TIS-620') # เ
- check_both_ways("\u0E4F", "\xEF", 'TIS-620') # ๏
- check_both_ways("\u0E50", "\xF0", 'TIS-620') # ๐
- check_both_ways("\u0E5B", "\xFB", 'TIS-620') # ๛
- assert_raise(Encoding::UndefinedConversionError) { "\xFC".encode("utf-8", 'TIS-620') }
- assert_raise(Encoding::UndefinedConversionError) { "\xFF".encode("utf-8", 'TIS-620') }
- end
-
- def test_CP850
- check_both_ways("\u00C7", "\x80", 'CP850') # Ç
- check_both_ways("\u00C5", "\x8F", 'CP850') # Å
- check_both_ways("\u00C9", "\x90", 'CP850') # É
- check_both_ways("\u0192", "\x9F", 'CP850') # ƒ
- check_both_ways("\u00E1", "\xA0", 'CP850') # á
- check_both_ways("\u00BB", "\xAF", 'CP850') # »
- check_both_ways("\u2591", "\xB0", 'CP850') # ░
- check_both_ways("\u2510", "\xBF", 'CP850') # ┐
- check_both_ways("\u2514", "\xC0", 'CP850') # └
- check_both_ways("\u00A4", "\xCF", 'CP850') # ¤
- check_both_ways("\u00F0", "\xD0", 'CP850') # ð
- check_both_ways("\u2580", "\xDF", 'CP850') # ▀
- check_both_ways("\u00D3", "\xE0", 'CP850') # Ó
- check_both_ways("\u00B4", "\xEF", 'CP850') # ´
- check_both_ways("\u00AD", "\xF0", 'CP850') # soft hyphen
- check_both_ways("\u00A0", "\xFF", 'CP850') # non-breaking space
- end
-
- def test_CP852
- check_both_ways("\u00C7", "\x80", 'CP852') # Ç
- check_both_ways("\u0106", "\x8F", 'CP852') # Ć
- check_both_ways("\u00C9", "\x90", 'CP852') # É
- check_both_ways("\u010D", "\x9F", 'CP852') # č
- check_both_ways("\u00E1", "\xA0", 'CP852') # á
- check_both_ways("\u00BB", "\xAF", 'CP852') # »
- check_both_ways("\u2591", "\xB0", 'CP852') # ░
- check_both_ways("\u2510", "\xBF", 'CP852') # ┐
- check_both_ways("\u2514", "\xC0", 'CP852') # └
- check_both_ways("\u00A4", "\xCF", 'CP852') # ¤
- check_both_ways("\u0111", "\xD0", 'CP852') # đ
- check_both_ways("\u2580", "\xDF", 'CP852') # ▀
- check_both_ways("\u00D3", "\xE0", 'CP852') # Ó
- check_both_ways("\u00B4", "\xEF", 'CP852') # ´
- check_both_ways("\u00AD", "\xF0", 'CP852') # soft hyphen
- check_both_ways("\u00A0", "\xFF", 'CP852') # non-breaking space
- end
-
- def test_CP855
- check_both_ways("\u0452", "\x80", 'CP855') # ђ
- check_both_ways("\u0408", "\x8F", 'CP855') # Ј
- check_both_ways("\u0459", "\x90", 'CP855') # љ
- check_both_ways("\u042A", "\x9F", 'CP855') # Ъ
- check_both_ways("\u0430", "\xA0", 'CP855') # а
- check_both_ways("\u00BB", "\xAF", 'CP855') # »
- check_both_ways("\u2591", "\xB0", 'CP855') # ░
- check_both_ways("\u2510", "\xBF", 'CP855') # ┐
- check_both_ways("\u2514", "\xC0", 'CP855') # └
- check_both_ways("\u00A4", "\xCF", 'CP855') # ¤
- check_both_ways("\u043B", "\xD0", 'CP855') # л
- check_both_ways("\u2580", "\xDF", 'CP855') # ▀
- check_both_ways("\u042F", "\xE0", 'CP855') # Я
- check_both_ways("\u2116", "\xEF", 'CP855') # №
- check_both_ways("\u00AD", "\xF0", 'CP855') # soft hyphen
- check_both_ways("\u00A0", "\xFF", 'CP855') # non-breaking space
- end
-
- def check_utf_16_both_ways(utf8, raw)
- copy = raw.dup
- 0.step(copy.length-1, 2) { |i| copy[i+1], copy[i] = copy[i], copy[i+1] }
- check_both_ways(utf8, raw, 'utf-16be')
- check_both_ways(utf8, copy, 'utf-16le')
- end
-
- def test_utf_16
- check_utf_16_both_ways("abc", "\x00a\x00b\x00c")
- check_utf_16_both_ways("\u00E9", "\x00\xE9");
- check_utf_16_both_ways("\u00E9\u0070\u00E9\u0065", "\x00\xE9\x00\x70\x00\xE9\x00\x65") # épée
- check_utf_16_both_ways("\u677E\u672C\u884C\u5F18", "\x67\x7E\x67\x2C\x88\x4C\x5F\x18") # 松本行弘
- check_utf_16_both_ways("\u9752\u5C71\u5B66\u9662\u5927\u5B66", "\x97\x52\x5C\x71\x5B\x66\x96\x62\x59\x27\x5B\x66") # 青山学院大学
- check_utf_16_both_ways("Martin D\u00FCrst", "\x00M\x00a\x00r\x00t\x00i\x00n\x00 \x00D\x00\xFC\x00r\x00s\x00t") # Martin Dürst
- # BMP
- check_utf_16_both_ways("\u0000", "\x00\x00")
- check_utf_16_both_ways("\u007F", "\x00\x7F")
- check_utf_16_both_ways("\u0080", "\x00\x80")
- check_utf_16_both_ways("\u0555", "\x05\x55")
- check_utf_16_both_ways("\u04AA", "\x04\xAA")
- check_utf_16_both_ways("\u0333", "\x03\x33")
- check_utf_16_both_ways("\u04CC", "\x04\xCC")
- check_utf_16_both_ways("\u00F0", "\x00\xF0")
- check_utf_16_both_ways("\u070F", "\x07\x0F")
- check_utf_16_both_ways("\u07FF", "\x07\xFF")
- check_utf_16_both_ways("\u0800", "\x08\x00")
- check_utf_16_both_ways("\uD7FF", "\xD7\xFF")
- check_utf_16_both_ways("\uE000", "\xE0\x00")
- check_utf_16_both_ways("\uFFFF", "\xFF\xFF")
- check_utf_16_both_ways("\u5555", "\x55\x55")
- check_utf_16_both_ways("\uAAAA", "\xAA\xAA")
- check_utf_16_both_ways("\u3333", "\x33\x33")
- check_utf_16_both_ways("\uCCCC", "\xCC\xCC")
- check_utf_16_both_ways("\uF0F0", "\xF0\xF0")
- check_utf_16_both_ways("\u0F0F", "\x0F\x0F")
- check_utf_16_both_ways("\uFF00", "\xFF\x00")
- check_utf_16_both_ways("\u00FF", "\x00\xFF")
- # outer planes
- check_utf_16_both_ways("\u{10000}", "\xD8\x00\xDC\x00")
- check_utf_16_both_ways("\u{FFFFF}", "\xDB\xBF\xDF\xFF")
- check_utf_16_both_ways("\u{100000}", "\xDB\xC0\xDC\x00")
- check_utf_16_both_ways("\u{10FFFF}", "\xDB\xFF\xDF\xFF")
- check_utf_16_both_ways("\u{105555}", "\xDB\xD5\xDD\x55")
- check_utf_16_both_ways("\u{55555}", "\xD9\x15\xDD\x55")
- check_utf_16_both_ways("\u{AAAAA}", "\xDA\x6A\xDE\xAA")
- check_utf_16_both_ways("\u{33333}", "\xD8\x8C\xDF\x33")
- check_utf_16_both_ways("\u{CCCCC}", "\xDA\xF3\xDC\xCC")
- check_utf_16_both_ways("\u{8F0F0}", "\xD9\xFC\xDC\xF0")
- check_utf_16_both_ways("\u{F0F0F}", "\xDB\x83\xDF\x0F")
- check_utf_16_both_ways("\u{8FF00}", "\xD9\xFF\xDF\x00")
- check_utf_16_both_ways("\u{F00FF}", "\xDB\x80\xDC\xFF")
- end
-
- def check_utf_32_both_ways(utf8, raw)
- copy = raw.dup
- 0.step(copy.length-1, 4) do |i|
- copy[i+3], copy[i+2], copy[i+1], copy[i] = copy[i], copy[i+1], copy[i+2], copy[i+3]
- end
- check_both_ways(utf8, raw, 'utf-32be')
- #check_both_ways(utf8, copy, 'utf-32le')
- end
-
- def test_utf_32
- check_utf_32_both_ways("abc", "\x00\x00\x00a\x00\x00\x00b\x00\x00\x00c")
- check_utf_32_both_ways("\u00E9", "\x00\x00\x00\xE9");
- check_utf_32_both_ways("\u00E9\u0070\u00E9\u0065",
- "\x00\x00\x00\xE9\x00\x00\x00\x70\x00\x00\x00\xE9\x00\x00\x00\x65") # épée
- check_utf_32_both_ways("\u677E\u672C\u884C\u5F18",
- "\x00\x00\x67\x7E\x00\x00\x67\x2C\x00\x00\x88\x4C\x00\x00\x5F\x18") # 松本行弘
- check_utf_32_both_ways("\u9752\u5C71\u5B66\u9662\u5927\u5B66",
- "\x00\x00\x97\x52\x00\x00\x5C\x71\x00\x00\x5B\x66\x00\x00\x96\x62\x00\x00\x59\x27\x00\x00\x5B\x66") # 青山学院大学
- check_utf_32_both_ways("Martin D\u00FCrst",
- "\x00\x00\x00M\x00\x00\x00a\x00\x00\x00r\x00\x00\x00t\x00\x00\x00i\x00\x00\x00n\x00\x00\x00 \x00\x00\x00D\x00\x00\x00\xFC\x00\x00\x00r\x00\x00\x00s\x00\x00\x00t") # Martin Dürst
- # BMP
- check_utf_32_both_ways("\u0000", "\x00\x00\x00\x00")
- check_utf_32_both_ways("\u007F", "\x00\x00\x00\x7F")
- check_utf_32_both_ways("\u0080", "\x00\x00\x00\x80")
- check_utf_32_both_ways("\u0555", "\x00\x00\x05\x55")
- check_utf_32_both_ways("\u04AA", "\x00\x00\x04\xAA")
- check_utf_32_both_ways("\u0333", "\x00\x00\x03\x33")
- check_utf_32_both_ways("\u04CC", "\x00\x00\x04\xCC")
- check_utf_32_both_ways("\u00F0", "\x00\x00\x00\xF0")
- check_utf_32_both_ways("\u070F", "\x00\x00\x07\x0F")
- check_utf_32_both_ways("\u07FF", "\x00\x00\x07\xFF")
- check_utf_32_both_ways("\u0800", "\x00\x00\x08\x00")
- check_utf_32_both_ways("\uD7FF", "\x00\x00\xD7\xFF")
- check_utf_32_both_ways("\uE000", "\x00\x00\xE0\x00")
- check_utf_32_both_ways("\uFFFF", "\x00\x00\xFF\xFF")
- check_utf_32_both_ways("\u5555", "\x00\x00\x55\x55")
- check_utf_32_both_ways("\uAAAA", "\x00\x00\xAA\xAA")
- check_utf_32_both_ways("\u3333", "\x00\x00\x33\x33")
- check_utf_32_both_ways("\uCCCC", "\x00\x00\xCC\xCC")
- check_utf_32_both_ways("\uF0F0", "\x00\x00\xF0\xF0")
- check_utf_32_both_ways("\u0F0F", "\x00\x00\x0F\x0F")
- check_utf_32_both_ways("\uFF00", "\x00\x00\xFF\x00")
- check_utf_32_both_ways("\u00FF", "\x00\x00\x00\xFF")
- # outer planes
- check_utf_32_both_ways("\u{10000}", "\x00\x01\x00\x00")
- check_utf_32_both_ways("\u{FFFFF}", "\x00\x0F\xFF\xFF")
- check_utf_32_both_ways("\u{100000}","\x00\x10\x00\x00")
- check_utf_32_both_ways("\u{10FFFF}","\x00\x10\xFF\xFF")
- check_utf_32_both_ways("\u{105555}","\x00\x10\x55\x55")
- check_utf_32_both_ways("\u{55555}", "\x00\x05\x55\x55")
- check_utf_32_both_ways("\u{AAAAA}", "\x00\x0A\xAA\xAA")
- check_utf_32_both_ways("\u{33333}", "\x00\x03\x33\x33")
- check_utf_32_both_ways("\u{CCCCC}", "\x00\x0C\xCC\xCC")
- check_utf_32_both_ways("\u{8F0F0}", "\x00\x08\xF0\xF0")
- check_utf_32_both_ways("\u{F0F0F}", "\x00\x0F\x0F\x0F")
- check_utf_32_both_ways("\u{8FF00}", "\x00\x08\xFF\x00")
- check_utf_32_both_ways("\u{F00FF}", "\x00\x0F\x00\xFF")
- end
-
- def test_invalid_ignore
- # arguments only
- assert_nothing_raised { 'abc'.encode('utf-8', invalid: :replace, replace: "") }
- # check handling of UTF-8 ill-formed subsequences
- assert_equal("\x00\x41\x00\x3E\x00\x42".force_encoding('UTF-16BE'),
- "\x41\xC2\x3E\x42".encode('UTF-16BE', 'UTF-8', invalid: :replace, replace: ""))
- assert_equal("\x00\x41\x00\xF1\x00\x42".force_encoding('UTF-16BE'),
- "\x41\xC2\xC3\xB1\x42".encode('UTF-16BE', 'UTF-8', invalid: :replace, replace: ""))
- assert_equal("\x00\x42".force_encoding('UTF-16BE'),
- "\xF0\x80\x80\x42".encode('UTF-16BE', 'UTF-8', invalid: :replace, replace: ""))
- assert_equal(''.force_encoding('UTF-16BE'),
- "\x82\xAB".encode('UTF-16BE', 'UTF-8', invalid: :replace, replace: ""))
-
- assert_equal("\e$B!!\e(B".force_encoding("ISO-2022-JP"),
- "\xA1\xA1\xFF".encode("ISO-2022-JP", "EUC-JP", invalid: :replace, replace: ""))
- assert_equal("\e$B\x24\x22\x24\x24\e(B".force_encoding("ISO-2022-JP"),
- "\xA4\xA2\xFF\xA4\xA4".encode("ISO-2022-JP", "EUC-JP", invalid: :replace, replace: ""))
- assert_equal("\e$B\x24\x22\x24\x24\e(B".force_encoding("ISO-2022-JP"),
- "\xA4\xA2\xFF\xFF\xA4\xA4".encode("ISO-2022-JP", "EUC-JP", invalid: :replace, replace: ""))
- end
-
- def test_invalid_replace
- # arguments only
- assert_nothing_raised { 'abc'.encode('UTF-8', invalid: :replace) }
- assert_equal("\xEF\xBF\xBD".force_encoding("UTF-8"),
- "\x80".encode("UTF-8", "UTF-16BE", invalid: :replace))
- assert_equal("\xFF\xFD".force_encoding("UTF-16BE"),
- "\x80".encode("UTF-16BE", "UTF-8", invalid: :replace))
- assert_equal("\xFD\xFF".force_encoding("UTF-16LE"),
- "\x80".encode("UTF-16LE", "UTF-8", invalid: :replace))
- assert_equal("\x00\x00\xFF\xFD".force_encoding("UTF-32BE"),
- "\x80".encode("UTF-32BE", "UTF-8", invalid: :replace))
- assert_equal("\xFD\xFF\x00\x00".force_encoding("UTF-32LE"),
- "\x80".encode("UTF-32LE", "UTF-8", invalid: :replace))
-
- assert_equal("\uFFFD!",
- "\xdc\x00\x00!".encode("utf-8", "utf-16be", :invalid=>:replace))
- assert_equal("\uFFFD!",
- "\xd8\x00\x00!".encode("utf-8", "utf-16be", :invalid=>:replace))
-
- assert_equal("\uFFFD!",
- "\x00\xdc!\x00".encode("utf-8", "utf-16le", :invalid=>:replace))
- assert_equal("\uFFFD!",
- "\x00\xd8!\x00".encode("utf-8", "utf-16le", :invalid=>:replace))
-
- assert_equal("\uFFFD!",
- "\x01\x00\x00\x00\x00\x00\x00!".encode("utf-8", "utf-32be", :invalid=>:replace), "[ruby-dev:35726]")
- assert_equal("\uFFFD!",
- "\x00\xff\x00\x00\x00\x00\x00!".encode("utf-8", "utf-32be", :invalid=>:replace))
- assert_equal("\uFFFD!",
- "\x00\x00\xd8\x00\x00\x00\x00!".encode("utf-8", "utf-32be", :invalid=>:replace))
-
- assert_equal("\uFFFD!",
- "\x00\x00\x00\xff!\x00\x00\x00".encode("utf-8", "utf-32le", :invalid=>:replace))
- assert_equal("\uFFFD!",
- "\x00\x00\xff\x00!\x00\x00\x00".encode("utf-8", "utf-32le", :invalid=>:replace))
- assert_equal("\uFFFD!",
- "\x00\xd8\x00\x00!\x00\x00\x00".encode("utf-8", "utf-32le", :invalid=>:replace))
-
- assert_equal("\uFFFD!",
- "\xff!".encode("utf-8", "euc-jp", :invalid=>:replace))
- assert_equal("\uFFFD!",
- "\xa1!".encode("utf-8", "euc-jp", :invalid=>:replace))
- assert_equal("\uFFFD!",
- "\x8f\xa1!".encode("utf-8", "euc-jp", :invalid=>:replace))
-
- assert_equal("?",
- "\xdc\x00".encode("EUC-JP", "UTF-16BE", :invalid=>:replace), "[ruby-dev:35776]")
- assert_equal("ab?cd?ef",
- "\0a\0b\xdc\x00\0c\0d\xdf\x00\0e\0f".encode("EUC-JP", "UTF-16BE", :invalid=>:replace))
-
- assert_equal("\e$B!!\e(B?".force_encoding("ISO-2022-JP"),
- "\xA1\xA1\xFF".encode("ISO-2022-JP", "EUC-JP", invalid: :replace))
- assert_equal("\e$B\x24\x22\e(B?\e$B\x24\x24\e(B".force_encoding("ISO-2022-JP"),
- "\xA4\xA2\xFF\xA4\xA4".encode("ISO-2022-JP", "EUC-JP", invalid: :replace))
- assert_equal("\e$B\x24\x22\e(B??\e$B\x24\x24\e(B".force_encoding("ISO-2022-JP"),
- "\xA4\xA2\xFF\xFF\xA4\xA4".encode("ISO-2022-JP", "EUC-JP", invalid: :replace))
- end
-
- def test_invalid_replace_string
- assert_equal("a<x>A", "a\x80A".encode("us-ascii", "euc-jp", :invalid=>:replace, :replace=>"<x>"))
- end
-
- def test_undef_replace
- assert_equal("?", "\u20AC".encode("EUC-JP", :undef=>:replace), "[ruby-dev:35709]")
- end
-
- def test_undef_replace_string
- assert_equal("a<x>A", "a\u3042A".encode("us-ascii", :undef=>:replace, :replace=>"<x>"))
- end
-
- def test_shift_jis
- check_both_ways("\u3000", "\x81\x40", 'shift_jis') # full-width space
- check_both_ways("\u00D7", "\x81\x7E", 'shift_jis') # ×
- check_both_ways("\u00F7", "\x81\x80", 'shift_jis') # ÷
- check_both_ways("\u25C7", "\x81\x9E", 'shift_jis') # ◇
- check_both_ways("\u25C6", "\x81\x9F", 'shift_jis') # ◆
- check_both_ways("\u25EF", "\x81\xFC", 'shift_jis') # ◯
- check_both_ways("\u6A97", "\x9F\x40", 'shift_jis') # 檗
- check_both_ways("\u6BEF", "\x9F\x7E", 'shift_jis') # 毯
- check_both_ways("\u9EBE", "\x9F\x80", 'shift_jis') # 麾
- check_both_ways("\u6CBE", "\x9F\x9E", 'shift_jis') # 沾
- check_both_ways("\u6CBA", "\x9F\x9F", 'shift_jis') # 沺
- check_both_ways("\u6ECC", "\x9F\xFC", 'shift_jis') # 滌
- check_both_ways("\u6F3E", "\xE0\x40", 'shift_jis') # 漾
- check_both_ways("\u70DD", "\xE0\x7E", 'shift_jis') # 烝
- check_both_ways("\u70D9", "\xE0\x80", 'shift_jis') # 烙
- check_both_ways("\u71FC", "\xE0\x9E", 'shift_jis') # 燼
- check_both_ways("\u71F9", "\xE0\x9F", 'shift_jis') # 燹
- check_both_ways("\u73F1", "\xE0\xFC", 'shift_jis') # 珱
- assert_raise(Encoding::UndefinedConversionError) { "\xEF\x40".encode("utf-8", 'shift_jis') }
- assert_raise(Encoding::UndefinedConversionError) { "\xEF\x7E".encode("utf-8", 'shift_jis') }
- assert_raise(Encoding::UndefinedConversionError) { "\xEF\x80".encode("utf-8", 'shift_jis') }
- assert_raise(Encoding::UndefinedConversionError) { "\xEF\x9E".encode("utf-8", 'shift_jis') }
- assert_raise(Encoding::UndefinedConversionError) { "\xEF\x9F".encode("utf-8", 'shift_jis') }
- assert_raise(Encoding::UndefinedConversionError) { "\xEF\xFC".encode("utf-8", 'shift_jis') }
- assert_raise(Encoding::UndefinedConversionError) { "\xF0\x40".encode("utf-8", 'shift_jis') }
- assert_raise(Encoding::UndefinedConversionError) { "\xF0\x7E".encode("utf-8", 'shift_jis') }
- assert_raise(Encoding::UndefinedConversionError) { "\xF0\x80".encode("utf-8", 'shift_jis') }
- assert_raise(Encoding::UndefinedConversionError) { "\xF0\x9E".encode("utf-8", 'shift_jis') }
- assert_raise(Encoding::UndefinedConversionError) { "\xF0\x9F".encode("utf-8", 'shift_jis') }
- assert_raise(Encoding::UndefinedConversionError) { "\xF0\xFC".encode("utf-8", 'shift_jis') }
- #check_both_ways("\u9ADC", "\xFC\x40", 'shift_jis') # 髜 (IBM extended)
- assert_raise(Encoding::UndefinedConversionError) { "\xFC\x7E".encode("utf-8", 'shift_jis') }
- assert_raise(Encoding::UndefinedConversionError) { "\xFC\x80".encode("utf-8", 'shift_jis') }
- assert_raise(Encoding::UndefinedConversionError) { "\xFC\x9E".encode("utf-8", 'shift_jis') }
- assert_raise(Encoding::UndefinedConversionError) { "\xFC\x9F".encode("utf-8", 'shift_jis') }
- assert_raise(Encoding::UndefinedConversionError) { "\xFC\xFC".encode("utf-8", 'shift_jis') }
- check_both_ways("\u677E\u672C\u884C\u5F18", "\x8f\xbc\x96\x7b\x8d\x73\x8d\x4f", 'shift_jis') # 松本行弘
- check_both_ways("\u9752\u5C71\u5B66\u9662\u5927\u5B66", "\x90\xC2\x8E\x52\x8A\x77\x89\x40\x91\xE5\x8A\x77", 'shift_jis') # 青山学院大学
- check_both_ways("\u795E\u6797\u7FA9\u535A", "\x90\x5F\x97\xD1\x8B\x60\x94\x8E", 'shift_jis') # 神林義博
- end
-
- def test_windows_31j
- check_both_ways("\u222A", "\x81\xBE", 'Windows-31J') # Union
- check_both_ways("\uFFE2", "\x81\xCA", 'Windows-31J') # Fullwidth Not Sign
- check_both_ways("\u2235", "\x81\xE6", 'Windows-31J') # Because
- check_both_ways("\u2160", "\x87\x54", 'Windows-31J') # Roman Numeral One
- check_both_ways("\u2170", "\xFA\x40", 'Windows-31J') # Small Roman Numeral One
- end
-
- def test_euc_jp
- check_both_ways("\u3000", "\xA1\xA1", 'euc-jp') # full-width space
- check_both_ways("\u00D7", "\xA1\xDF", 'euc-jp') # ×
- check_both_ways("\u00F7", "\xA1\xE0", 'euc-jp') # ÷
- check_both_ways("\u25C7", "\xA1\xFE", 'euc-jp') # ◇
- check_both_ways("\u25C6", "\xA2\xA1", 'euc-jp') # ◆
- assert_raise(Encoding::UndefinedConversionError) { "\xA2\xAF".encode("utf-8", 'euc-jp') }
- assert_raise(Encoding::UndefinedConversionError) { "\xA2\xB9".encode("utf-8", 'euc-jp') }
- assert_raise(Encoding::UndefinedConversionError) { "\xA2\xC2".encode("utf-8", 'euc-jp') }
- assert_raise(Encoding::UndefinedConversionError) { "\xA2\xC9".encode("utf-8", 'euc-jp') }
- assert_raise(Encoding::UndefinedConversionError) { "\xA2\xD1".encode("utf-8", 'euc-jp') }
- assert_raise(Encoding::UndefinedConversionError) { "\xA2\xDB".encode("utf-8", 'euc-jp') }
- assert_raise(Encoding::UndefinedConversionError) { "\xA2\xEB".encode("utf-8", 'euc-jp') }
- assert_raise(Encoding::UndefinedConversionError) { "\xA2\xF1".encode("utf-8", 'euc-jp') }
- assert_raise(Encoding::UndefinedConversionError) { "\xA2\xFA".encode("utf-8", 'euc-jp') }
- assert_raise(Encoding::UndefinedConversionError) { "\xA2\xFD".encode("utf-8", 'euc-jp') }
- check_both_ways("\u25EF", "\xA2\xFE", 'euc-jp') # ◯
- assert_raise(Encoding::UndefinedConversionError) { "\xA3\xAF".encode("utf-8", 'euc-jp') }
- assert_raise(Encoding::UndefinedConversionError) { "\xA3\xBA".encode("utf-8", 'euc-jp') }
- assert_raise(Encoding::UndefinedConversionError) { "\xA3\xC0".encode("utf-8", 'euc-jp') }
- assert_raise(Encoding::UndefinedConversionError) { "\xA3\xDB".encode("utf-8", 'euc-jp') }
- assert_raise(Encoding::UndefinedConversionError) { "\xA3\xE0".encode("utf-8", 'euc-jp') }
- assert_raise(Encoding::UndefinedConversionError) { "\xA3\xFB".encode("utf-8", 'euc-jp') }
- assert_raise(Encoding::UndefinedConversionError) { "\xA4\xF4".encode("utf-8", 'euc-jp') }
- assert_raise(Encoding::UndefinedConversionError) { "\xA5\xF7".encode("utf-8", 'euc-jp') }
- assert_raise(Encoding::UndefinedConversionError) { "\xA6\xB9".encode("utf-8", 'euc-jp') }
- assert_raise(Encoding::UndefinedConversionError) { "\xA6\xC0".encode("utf-8", 'euc-jp') }
- assert_raise(Encoding::UndefinedConversionError) { "\xA6\xD9".encode("utf-8", 'euc-jp') }
- assert_raise(Encoding::UndefinedConversionError) { "\xA7\xC2".encode("utf-8", 'euc-jp') }
- assert_raise(Encoding::UndefinedConversionError) { "\xA7\xD0".encode("utf-8", 'euc-jp') }
- assert_raise(Encoding::UndefinedConversionError) { "\xA7\xF2".encode("utf-8", 'euc-jp') }
- assert_raise(Encoding::UndefinedConversionError) { "\xA8\xC1".encode("utf-8", 'euc-jp') }
- assert_raise(Encoding::UndefinedConversionError) { "\xCF\xD4".encode("utf-8", 'euc-jp') }
- assert_raise(Encoding::UndefinedConversionError) { "\xCF\xFE".encode("utf-8", 'euc-jp') }
- check_both_ways("\u6A97", "\xDD\xA1", 'euc-jp') # 檗
- check_both_ways("\u6BEF", "\xDD\xDF", 'euc-jp') # 毯
- check_both_ways("\u9EBE", "\xDD\xE0", 'euc-jp') # 麾
- check_both_ways("\u6CBE", "\xDD\xFE", 'euc-jp') # 沾
- check_both_ways("\u6CBA", "\xDE\xA1", 'euc-jp') # 沺
- check_both_ways("\u6ECC", "\xDE\xFE", 'euc-jp') # 滌
- check_both_ways("\u6F3E", "\xDF\xA1", 'euc-jp') # 漾
- check_both_ways("\u70DD", "\xDF\xDF", 'euc-jp') # 烝
- check_both_ways("\u70D9", "\xDF\xE0", 'euc-jp') # 烙
- check_both_ways("\u71FC", "\xDF\xFE", 'euc-jp') # 燼
- check_both_ways("\u71F9", "\xE0\xA1", 'euc-jp') # 燹
- check_both_ways("\u73F1", "\xE0\xFE", 'euc-jp') # 珱
- assert_raise(Encoding::UndefinedConversionError) { "\xF4\xA7".encode("utf-8", 'euc-jp') }
- #check_both_ways("\u9ADC", "\xFC\xE3", 'euc-jp') # 髜 (IBM extended)
-
- check_both_ways("\u677E\u672C\u884C\u5F18", "\xBE\xBE\xCB\xDC\xB9\xD4\xB9\xB0", 'euc-jp') # 松本行弘
- check_both_ways("\u9752\u5C71\u5B66\u9662\u5927\u5B66", "\xC0\xC4\xBB\xB3\xB3\xD8\xB1\xA1\xC2\xE7\xB3\xD8", 'euc-jp') # 青山学院大学
- check_both_ways("\u795E\u6797\u7FA9\u535A", "\xBF\xC0\xCE\xD3\xB5\xC1\xC7\xEE", 'euc-jp') # 神林義博
- end
-
- def test_eucjp_ms
- check_both_ways("\u2116", "\xAD\xE2", 'eucJP-ms') # NUMERO SIGN
- check_both_ways("\u221A", "\xA2\xE5", 'eucJP-ms') # SQUARE ROOT
- check_both_ways("\u3231", "\xAD\xEA", 'eucJP-ms') # PARENTHESIZED IDEOGRAPH STOCK
- check_both_ways("\uFF5E", "\xA1\xC1", 'eucJP-ms') # WAVE DASH
- end
-
- def test_eucjp_sjis
- check_both_ways2("\xa1\xa1", "EUC-JP", "\x81\x40", "Shift_JIS")
- check_both_ways2("\xa1\xdf", "EUC-JP", "\x81\x7e", "Shift_JIS")
- check_both_ways2("\xa1\xe0", "EUC-JP", "\x81\x80", "Shift_JIS")
- check_both_ways2("\xa1\xfe", "EUC-JP", "\x81\x9e", "Shift_JIS")
- check_both_ways2("\xa2\xa1", "EUC-JP", "\x81\x9f", "Shift_JIS")
- check_both_ways2("\xa2\xfe", "EUC-JP", "\x81\xfc", "Shift_JIS")
-
- check_both_ways2("\xdd\xa1", "EUC-JP", "\x9f\x40", "Shift_JIS")
- check_both_ways2("\xdd\xdf", "EUC-JP", "\x9f\x7e", "Shift_JIS")
- check_both_ways2("\xdd\xe0", "EUC-JP", "\x9f\x80", "Shift_JIS")
- check_both_ways2("\xdd\xfe", "EUC-JP", "\x9f\x9e", "Shift_JIS")
- check_both_ways2("\xde\xa1", "EUC-JP", "\x9f\x9f", "Shift_JIS")
- check_both_ways2("\xde\xfe", "EUC-JP", "\x9f\xfc", "Shift_JIS")
-
- check_both_ways2("\xdf\xa1", "EUC-JP", "\xe0\x40", "Shift_JIS")
- check_both_ways2("\xdf\xdf", "EUC-JP", "\xe0\x7e", "Shift_JIS")
- check_both_ways2("\xdf\xe0", "EUC-JP", "\xe0\x80", "Shift_JIS")
- check_both_ways2("\xdf\xfe", "EUC-JP", "\xe0\x9e", "Shift_JIS")
- check_both_ways2("\xe0\xa1", "EUC-JP", "\xe0\x9f", "Shift_JIS")
- check_both_ways2("\xe0\xfe", "EUC-JP", "\xe0\xfc", "Shift_JIS")
-
- check_both_ways2("\xf4\xa1", "EUC-JP", "\xea\x9f", "Shift_JIS")
- check_both_ways2("\xf4\xa2", "EUC-JP", "\xea\xa0", "Shift_JIS")
- check_both_ways2("\xf4\xa3", "EUC-JP", "\xea\xa1", "Shift_JIS")
- check_both_ways2("\xf4\xa4", "EUC-JP", "\xea\xa2", "Shift_JIS") # end of JIS X 0208 1983
- check_both_ways2("\xf4\xa5", "EUC-JP", "\xea\xa3", "Shift_JIS")
- check_both_ways2("\xf4\xa6", "EUC-JP", "\xea\xa4", "Shift_JIS") # end of JIS X 0208 1990
-
- check_both_ways2("\x8e\xa1", "EUC-JP", "\xa1", "Shift_JIS")
- check_both_ways2("\x8e\xdf", "EUC-JP", "\xdf", "Shift_JIS")
- end
-
- def test_eucjp_sjis_unassigned
- check_both_ways2("\xfd\xa1", "EUC-JP", "\xef\x40", "Shift_JIS")
- check_both_ways2("\xfd\xa1", "EUC-JP", "\xef\x40", "Shift_JIS")
- check_both_ways2("\xfd\xdf", "EUC-JP", "\xef\x7e", "Shift_JIS")
- check_both_ways2("\xfd\xe0", "EUC-JP", "\xef\x80", "Shift_JIS")
- check_both_ways2("\xfd\xfe", "EUC-JP", "\xef\x9e", "Shift_JIS")
- check_both_ways2("\xfe\xa1", "EUC-JP", "\xef\x9f", "Shift_JIS")
- check_both_ways2("\xfe\xfe", "EUC-JP", "\xef\xfc", "Shift_JIS")
- end
-
- def test_eucjp_sjis_undef
- assert_raise(Encoding::UndefinedConversionError) { "\x8e\xe0".encode("Shift_JIS", "EUC-JP") }
- assert_raise(Encoding::UndefinedConversionError) { "\x8e\xfe".encode("Shift_JIS", "EUC-JP") }
- assert_raise(Encoding::UndefinedConversionError) { "\x8f\xa1\xa1".encode("Shift_JIS", "EUC-JP") }
- assert_raise(Encoding::UndefinedConversionError) { "\x8f\xa1\xfe".encode("Shift_JIS", "EUC-JP") }
- assert_raise(Encoding::UndefinedConversionError) { "\x8f\xfe\xa1".encode("Shift_JIS", "EUC-JP") }
- assert_raise(Encoding::UndefinedConversionError) { "\x8f\xfe\xfe".encode("Shift_JIS", "EUC-JP") }
-
- assert_raise(Encoding::UndefinedConversionError) { "\xf0\x40".encode("EUC-JP", "Shift_JIS") }
- assert_raise(Encoding::UndefinedConversionError) { "\xf0\x7e".encode("EUC-JP", "Shift_JIS") }
- assert_raise(Encoding::UndefinedConversionError) { "\xf0\x80".encode("EUC-JP", "Shift_JIS") }
- assert_raise(Encoding::UndefinedConversionError) { "\xf0\xfc".encode("EUC-JP", "Shift_JIS") }
- assert_raise(Encoding::UndefinedConversionError) { "\xfc\x40".encode("EUC-JP", "Shift_JIS") }
- assert_raise(Encoding::UndefinedConversionError) { "\xfc\x7e".encode("EUC-JP", "Shift_JIS") }
- assert_raise(Encoding::UndefinedConversionError) { "\xfc\x80".encode("EUC-JP", "Shift_JIS") }
- assert_raise(Encoding::UndefinedConversionError) { "\xfc\xfc".encode("EUC-JP", "Shift_JIS") }
- end
-
- def test_iso_2022_jp
- assert_raise(Encoding::InvalidByteSequenceError) { "\x1b(A".encode("utf-8", "iso-2022-jp") }
- assert_raise(Encoding::InvalidByteSequenceError) { "\x1b$(A".encode("utf-8", "iso-2022-jp") }
- assert_raise(Encoding::InvalidByteSequenceError) { "\x1b$C".encode("utf-8", "iso-2022-jp") }
- assert_raise(Encoding::InvalidByteSequenceError) { "\x0e".encode("utf-8", "iso-2022-jp") }
- assert_raise(Encoding::InvalidByteSequenceError) { "\x80".encode("utf-8", "iso-2022-jp") }
- assert_raise(Encoding::InvalidByteSequenceError) { "\x1b$(Dd!\x1b(B".encode("utf-8", "iso-2022-jp") }
- assert_raise(Encoding::UndefinedConversionError) { "\u9299".encode("iso-2022-jp") }
- assert_raise(Encoding::UndefinedConversionError) { "\uff71\uff72\uff73\uff74\uff75".encode("iso-2022-jp") }
- assert_raise(Encoding::InvalidByteSequenceError) { "\x1b(I12345\x1b(B".encode("utf-8", "iso-2022-jp") }
- assert_equal("\xA1\xA1".force_encoding("euc-jp"),
- "\e$B!!\e(B".encode("EUC-JP", "ISO-2022-JP"))
- assert_equal("\e$B!!\e(B".force_encoding("ISO-2022-JP"),
- "\xA1\xA1".encode("ISO-2022-JP", "EUC-JP"))
- end
-
- def test_iso_2022_jp_1
- # check_both_ways("\u9299", "\x1b$(Dd!\x1b(B", "iso-2022-jp-1") # JIS X 0212 区68 点01 銙
- end
-
- def test_unicode_public_review_issue_121 # see http://www.unicode.org/review/pr-121.html
- # assert_equal("\x00\x61\xFF\xFD\x00\x62".force_encoding('UTF-16BE'),
- # "\x61\xF1\x80\x80\xE1\x80\xC2\x62".encode('UTF-16BE', 'UTF-8', invalid: :replace)) # option 1
- assert_equal("\x00\x61\xFF\xFD\xFF\xFD\xFF\xFD\x00\x62".force_encoding('UTF-16BE'),
- "\x61\xF1\x80\x80\xE1\x80\xC2\x62".encode('UTF-16BE', 'UTF-8', invalid: :replace)) # option 2
- assert_equal("\x61\x00\xFD\xFF\xFD\xFF\xFD\xFF\x62\x00".force_encoding('UTF-16LE'),
- "\x61\xF1\x80\x80\xE1\x80\xC2\x62".encode('UTF-16LE', 'UTF-8', invalid: :replace)) # option 2
- # assert_equal("\x00\x61\xFF\xFD\xFF\xFD\xFF\xFD\xFF\xFD\xFF\xFD\xFF\xFD\x00\x62".force_encoding('UTF-16BE'),
- # "\x61\xF1\x80\x80\xE1\x80\xC2\x62".encode('UTF-16BE', 'UTF-8', invalid: :replace)) # option 3
- end
-
- def test_yen_sign
- check_both_ways("\u005C", "\x5C", "Shift_JIS")
- check_both_ways("\u005C", "\x5C", "Windows-31J")
- check_both_ways("\u005C", "\x5C", "EUC-JP")
- check_both_ways("\u005C", "\x5C", "eucJP-ms")
- check_both_ways("\u005C", "\x5C", "CP51932")
- check_both_ways("\u005C", "\x5C", "ISO-2022-JP")
- assert_equal("\u005C", "\e(B\x5C\e(B".encode("UTF-8", "ISO-2022-JP"))
- assert_equal("\u005C", "\e(J\x5C\e(B".encode("UTF-8", "ISO-2022-JP"))
- assert_equal("\u005C", "\x5C".encode("stateless-ISO-2022-JP", "ISO-2022-JP"))
- assert_equal("\u005C", "\e(J\x5C\e(B".encode("stateless-ISO-2022-JP", "ISO-2022-JP"))
- assert_raise(Encoding::UndefinedConversionError) { "\u00A5".encode("Shift_JIS") }
- assert_raise(Encoding::UndefinedConversionError) { "\u00A5".encode("Windows-31J") }
- assert_raise(Encoding::UndefinedConversionError) { "\u00A5".encode("EUC-JP") }
- assert_raise(Encoding::UndefinedConversionError) { "\u00A5".encode("eucJP-ms") }
- assert_raise(Encoding::UndefinedConversionError) { "\u00A5".encode("CP51932") }
-
- # FULLWIDTH REVERSE SOLIDUS
- check_both_ways("\uFF3C", "\x81\x5F", "Shift_JIS")
- check_both_ways("\uFF3C", "\x81\x5F", "Windows-31J")
- check_both_ways("\uFF3C", "\xA1\xC0", "EUC-JP")
- check_both_ways("\uFF3C", "\xA1\xC0", "eucJP-ms")
- check_both_ways("\uFF3C", "\xA1\xC0", "CP51932")
- end
-
- def test_tilde_overline
- check_both_ways("\u007E", "\x7E", "Shift_JIS")
- check_both_ways("\u007E", "\x7E", "Windows-31J")
- check_both_ways("\u007E", "\x7E", "EUC-JP")
- check_both_ways("\u007E", "\x7E", "eucJP-ms")
- check_both_ways("\u007E", "\x7E", "CP51932")
- check_both_ways("\u007E", "\x7E", "ISO-2022-JP")
- assert_equal("\u007E", "\e(B\x7E\e(B".encode("UTF-8", "ISO-2022-JP"))
- assert_equal("\u007E", "\e(J\x7E\e(B".encode("UTF-8", "ISO-2022-JP"))
- assert_equal("\u007E", "\x7E".encode("stateless-ISO-2022-JP", "ISO-2022-JP"))
- assert_equal("\u007E", "\e(J\x7E\e(B".encode("stateless-ISO-2022-JP", "ISO-2022-JP"))
- assert_raise(Encoding::UndefinedConversionError) { "\u203E".encode("Shift_JIS") }
- assert_raise(Encoding::UndefinedConversionError) { "\u203E".encode("Windows-31J") }
- assert_raise(Encoding::UndefinedConversionError) { "\u203E".encode("EUC-JP") }
- assert_raise(Encoding::UndefinedConversionError) { "\u203E".encode("eucJP-ms") }
- assert_raise(Encoding::UndefinedConversionError) { "\u203E".encode("CP51932") }
- end
-
- def test_gb2312
- check_both_ways("\u3000", "\xA1\xA1", 'GB2312') # full-width space
- check_both_ways("\u3013", "\xA1\xFE", 'GB2312') # 〓
- assert_raise(Encoding::UndefinedConversionError) { "\xA2\xB0".encode("utf-8", 'GB2312') }
- check_both_ways("\u2488", "\xA2\xB1", 'GB2312') # ⒈
- assert_raise(Encoding::UndefinedConversionError) { "\xA2\xE4".encode("utf-8", 'GB2312') }
- check_both_ways("\u3220", "\xA2\xE5", 'GB2312') # ㈠
- assert_raise(Encoding::UndefinedConversionError) { "\xA2\xF0".encode("utf-8", 'GB2312') }
- check_both_ways("\u2160", "\xA2\xF1", 'GB2312') # Ⅰ
- check_both_ways("\uFF01", "\xA3\xA1", 'GB2312') # !
- check_both_ways("\uFFE3", "\xA3\xFE", 'GB2312') #  ̄
- check_both_ways("\u3041", "\xA4\xA1", 'GB2312') # ぁ
- check_both_ways("\u30A1", "\xA5\xA1", 'GB2312') # ァ
- check_both_ways("\u0391", "\xA6\xA1", 'GB2312') # Α
- check_both_ways("\u03B1", "\xA6\xC1", 'GB2312') # α
- check_both_ways("\u0410", "\xA7\xA1", 'GB2312') # А
- check_both_ways("\u0430", "\xA7\xD1", 'GB2312') # а
- check_both_ways("\u0101", "\xA8\xA1", 'GB2312') # ā
- assert_raise(Encoding::UndefinedConversionError) { "\xA8\xC4".encode("utf-8", 'GB2312') }
- check_both_ways("\u3105", "\xA8\xC5", 'GB2312') # ㄅ
- assert_raise(Encoding::UndefinedConversionError) { "\xA9\xA3".encode("utf-8", 'GB2312') }
- check_both_ways("\u2500", "\xA9\xA4", 'GB2312') # ─
- check_both_ways("\u554A", "\xB0\xA1", 'GB2312') # 啊
- check_both_ways("\u5265", "\xB0\xFE", 'GB2312') # 剥
- check_both_ways("\u4FCA", "\xBF\xA1", 'GB2312') # 俊
- check_both_ways("\u5080", "\xBF\xFE", 'GB2312') # 傀
- check_both_ways("\u9988", "\xC0\xA1", 'GB2312') # 馈
- check_both_ways("\u4FD0", "\xC0\xFE", 'GB2312') # 俐
- check_both_ways("\u7A00", "\xCF\xA1", 'GB2312') # 稀
- check_both_ways("\u6653", "\xCF\xFE", 'GB2312') # 晓
- check_both_ways("\u5C0F", "\xD0\xA1", 'GB2312') # 小
- check_both_ways("\u7384", "\xD0\xFE", 'GB2312') # 玄
- check_both_ways("\u4F4F", "\xD7\xA1", 'GB2312') # 住
- check_both_ways("\u5EA7", "\xD7\xF9", 'GB2312') # 座
- assert_raise(Encoding::UndefinedConversionError) { "\xD7\xFA".encode("utf-8", 'GB2312') }
- check_both_ways("\u647A", "\xDF\xA1", 'GB2312') # 摺
- check_both_ways("\u553C", "\xDF\xFE", 'GB2312') # 唼
- check_both_ways("\u5537", "\xE0\xA1", 'GB2312') # 唷
- check_both_ways("\u5E3C", "\xE0\xFE", 'GB2312') # 帼
- check_both_ways("\u94E9", "\xEF\xA1", 'GB2312') # 铩
- check_both_ways("\u7A14", "\xEF\xFE", 'GB2312') # 稔
- check_both_ways("\u7A39", "\xF0\xA1", 'GB2312') # 稹
- check_both_ways("\u7619", "\xF0\xFE", 'GB2312') # 瘙
- check_both_ways("\u9CCC", "\xF7\xA1", 'GB2312') # 鳌
- check_both_ways("\u9F44", "\xF7\xFE", 'GB2312') # 齄
- check_both_ways("\u9752\u5C71\u5B66\u9662\u5927\u5B66", "\xC7\xE0\xC9\xBD\xD1\xA7\xD4\xBA\xB4\xF3\xD1\xA7", 'GB2312') # 青山学院大学
- end
-
- def test_gbk
- check_both_ways("\u4E02", "\x81\x40", 'GBK') # 丂
- check_both_ways("\u4E8A", "\x81\x7E", 'GBK') # 亊
- check_both_ways("\u4E90", "\x81\x80", 'GBK') # 亐
- check_both_ways("\u4FA2", "\x81\xFE", 'GBK') # 侢
- check_both_ways("\u5EC6", "\x8F\x40", 'GBK') # 廆
- check_both_ways("\u5F24", "\x8F\x7E", 'GBK') # 弤
- check_both_ways("\u5F28", "\x8F\x80", 'GBK') # 弨
- check_both_ways("\u6007", "\x8F\xFE", 'GBK') # 怇
- check_both_ways("\u6008", "\x90\x40", 'GBK') # 怈
- check_both_ways("\u6080", "\x90\x7E", 'GBK') # 悀
- check_both_ways("\u6081", "\x90\x80", 'GBK') # 悁
- check_both_ways("\u6146", "\x90\xFE", 'GBK') # 慆
- check_both_ways("\u70DC", "\x9F\x40", 'GBK') # 烜
- check_both_ways("\u7134", "\x9F\x7E", 'GBK') # 焴
- check_both_ways("\u7135", "\x9F\x80", 'GBK') # 焵
- check_both_ways("\u71D3", "\x9F\xFE", 'GBK') # 燓
- check_both_ways("\u71D6", "\xA0\x40", 'GBK') # 燖
- check_both_ways("\u721A", "\xA0\x7E", 'GBK') # 爚
- check_both_ways("\u721B", "\xA0\x80", 'GBK') # 爛
- check_both_ways("\u72DB", "\xA0\xFE", 'GBK') # 狛
- check_both_ways("\u3000", "\xA1\xA1", 'GBK') # full-width space
- check_both_ways("\u3001", "\xA1\xA2", 'GBK') # 、
- check_both_ways("\u3013", "\xA1\xFE", 'GBK') # 〓
- assert_raise(Encoding::UndefinedConversionError) { "\xA2\xA0".encode("utf-8", 'GBK') }
- check_both_ways("\u2170", "\xA2\xA1", 'GBK') # ⅰ
- assert_raise(Encoding::UndefinedConversionError) { "\xA2\xB0".encode("utf-8", 'GBK') }
- check_both_ways("\u2488", "\xA2\xB1", 'GBK') # ⒈
- assert_raise(Encoding::UndefinedConversionError) { "\xA2\xE4".encode("utf-8", 'GBK') }
- check_both_ways("\u3220", "\xA2\xE5", 'GBK') # ㈠
- assert_raise(Encoding::UndefinedConversionError) { "\xA2\xF0".encode("utf-8", 'GBK') }
- check_both_ways("\u2160", "\xA2\xF1", 'GBK') # Ⅰ
- assert_raise(Encoding::UndefinedConversionError) { "\xA3\xA0".encode("utf-8", 'GBK') }
- check_both_ways("\uFF01", "\xA3\xA1", 'GBK') # !
- check_both_ways("\uFFE3", "\xA3\xFE", 'GBK') #  ̄
- assert_raise(Encoding::UndefinedConversionError) { "\xA4\xA0".encode("utf-8", 'GBK') }
- check_both_ways("\u3041", "\xA4\xA1", 'GBK') # ぁ
- assert_raise(Encoding::UndefinedConversionError) { "\xA5\xA0".encode("utf-8", 'GBK') }
- check_both_ways("\u30A1", "\xA5\xA1", 'GBK') # ァ
- check_both_ways("\u0391", "\xA6\xA1", 'GBK') # Α
- check_both_ways("\u03B1", "\xA6\xC1", 'GBK') # α
- assert_raise(Encoding::UndefinedConversionError) { "\xA6\xED".encode("utf-8", 'GBK') }
- check_both_ways("\uFE3B", "\xA6\xEE", 'GBK') # ︻
- check_both_ways("\u0410", "\xA7\xA1", 'GBK') # А
- check_both_ways("\u0430", "\xA7\xD1", 'GBK') # а
- check_both_ways("\u02CA", "\xA8\x40", 'GBK') # ˊ
- check_both_ways("\u2587", "\xA8\x7E", 'GBK') # ▇
- assert_raise(Encoding::UndefinedConversionError) { "\xA8\x96".encode("utf-8", 'GBK') }
- check_both_ways("\u0101", "\xA8\xA1", 'GBK') # ā
- assert_raise(Encoding::UndefinedConversionError) { "\xA8\xBC".encode("utf-8", 'GBK') }
- assert_raise(Encoding::UndefinedConversionError) { "\xA8\xBF".encode("utf-8", 'GBK') }
- assert_raise(Encoding::UndefinedConversionError) { "\xA8\xC4".encode("utf-8", 'GBK') }
- check_both_ways("\u3105", "\xA8\xC5", 'GBK') # ㄅ
- check_both_ways("\u3021", "\xA9\x40", 'GBK') # 〡
- assert_raise(Encoding::UndefinedConversionError) { "\xA9\x58".encode("utf-8", 'GBK') }
- assert_raise(Encoding::UndefinedConversionError) { "\xA9\x5B".encode("utf-8", 'GBK') }
- assert_raise(Encoding::UndefinedConversionError) { "\xA9\x5D".encode("utf-8", 'GBK') }
- check_both_ways("\u3007", "\xA9\x96", 'GBK') # 〇
- assert_raise(Encoding::UndefinedConversionError) { "\xA9\xA3".encode("utf-8", 'GBK') }
- check_both_ways("\u2500", "\xA9\xA4", 'GBK') # ─
- assert_raise(Encoding::UndefinedConversionError) { "\xA9\xF0".encode("utf-8", 'GBK') }
- check_both_ways("\u7588", "\xAF\x40", 'GBK') # 疈
- check_both_ways("\u7607", "\xAF\x7E", 'GBK') # 瘇
- check_both_ways("\u7608", "\xAF\x80", 'GBK') # 瘈
- check_both_ways("\u7644", "\xAF\xA0", 'GBK') # 癄
- assert_raise(Encoding::UndefinedConversionError) { "\xAF\xA1".encode("utf-8", 'GBK') }
- check_both_ways("\u7645", "\xB0\x40", 'GBK') # 癅
- check_both_ways("\u769B", "\xB0\x7E", 'GBK') # 皛
- check_both_ways("\u769C", "\xB0\x80", 'GBK') # 皜
- check_both_ways("\u5265", "\xB0\xFE", 'GBK') # 剥
- check_both_ways("\u7DFB", "\xBF\x40", 'GBK') # 緻
- check_both_ways("\u7E39", "\xBF\x7E", 'GBK') # 縹
- check_both_ways("\u7E3A", "\xBF\x80", 'GBK') # 縺
- check_both_ways("\u5080", "\xBF\xFE", 'GBK') # 傀
- check_both_ways("\u7E5E", "\xC0\x40", 'GBK') # 繞
- check_both_ways("\u7E9E", "\xC0\x7E", 'GBK') # 纞
- check_both_ways("\u7EAE", "\xC0\x80", 'GBK') # 纮
- check_both_ways("\u4FD0", "\xC0\xFE", 'GBK') # 俐
- check_both_ways("\u87A5", "\xCF\x40", 'GBK') # 螥
- check_both_ways("\u87F8", "\xCF\x7E", 'GBK') # 蟸
- check_both_ways("\u87FA", "\xCF\x80", 'GBK') # 蟺
- check_both_ways("\u6653", "\xCF\xFE", 'GBK') # 晓
- check_both_ways("\u8824", "\xD0\x40", 'GBK') # 蠤
- check_both_ways("\u887A", "\xD0\x7E", 'GBK') # 衺
- check_both_ways("\u887B", "\xD0\x80", 'GBK') # 衻
- check_both_ways("\u7384", "\xD0\xFE", 'GBK') # 玄
- check_both_ways("\u9019", "\xDF\x40", 'GBK') # 這
- check_both_ways("\u9081", "\xDF\x7E", 'GBK') # 邁
- check_both_ways("\u9084", "\xDF\x80", 'GBK') # 還
- check_both_ways("\u553C", "\xDF\xFE", 'GBK') # 唼
- check_both_ways("\u90C2", "\xE0\x40", 'GBK') # 郂
- check_both_ways("\u911C", "\xE0\x7E", 'GBK') # 鄜
- check_both_ways("\u911D", "\xE0\x80", 'GBK') # 鄝
- check_both_ways("\u5E3C", "\xE0\xFE", 'GBK') # 帼
- check_both_ways("\u986F", "\xEF\x40", 'GBK') # 顯
- check_both_ways("\u98E4", "\xEF\x7E", 'GBK') # 飤
- check_both_ways("\u98E5", "\xEF\x80", 'GBK') # 飥
- check_both_ways("\u7A14", "\xEF\xFE", 'GBK') # 稔
- check_both_ways("\u9908", "\xF0\x40", 'GBK') # 餈
- check_both_ways("\u9949", "\xF0\x7E", 'GBK') # 饉
- check_both_ways("\u994A", "\xF0\x80", 'GBK') # 饊
- check_both_ways("\u7619", "\xF0\xFE", 'GBK') # 瘙
- check_both_ways("\u9F32", "\xFD\x40", 'GBK') # 鼲
- check_both_ways("\u9F78", "\xFD\x7E", 'GBK') # 齸
- check_both_ways("\u9F79", "\xFD\x80", 'GBK') # 齹
- check_both_ways("\uF9F1", "\xFD\xA0", 'GBK') # 隣
- assert_raise(Encoding::UndefinedConversionError) { "\xFD\xA1".encode("utf-8", 'GBK') }
- check_both_ways("\uFA0C", "\xFE\x40", 'GBK') # 兀
- check_both_ways("\uFA29", "\xFE\x4F", 'GBK') # 﨩
- assert_raise(Encoding::UndefinedConversionError) { "\xFE\x50".encode("utf-8", 'GBK') }
- check_both_ways("\u9752\u5C71\u5B66\u9662\u5927\u5B66", "\xC7\xE0\xC9\xBD\xD1\xA7\xD4\xBA\xB4\xF3\xD1\xA7", 'GBK') # 青山学院大学
- check_both_ways("\u795E\u6797\u7FA9\u535A", "\xC9\xF1\xC1\xD6\xC1\x78\xB2\xA9", 'GBK') # 神林義博
- end
-
- def test_gb18030
- # test from GBK
- check_both_ways("\u4E02", "\x81\x40", 'GB18030') #
- check_both_ways("\u4E8A", "\x81\x7E", 'GB18030') #
- check_both_ways("\u4E90", "\x81\x80", 'GB18030') #
- check_both_ways("\u4FA2", "\x81\xFE", 'GB18030') # 侢
- check_both_ways("\u5EC6", "\x8F\x40", 'GB18030') #
- check_both_ways("\u5F24", "\x8F\x7E", 'GB18030') # 弤
- check_both_ways("\u5F28", "\x8F\x80", 'GB18030') # 弨
- check_both_ways("\u6007", "\x8F\xFE", 'GB18030') #
- check_both_ways("\u6008", "\x90\x40", 'GB18030') #
- check_both_ways("\u6080", "\x90\x7E", 'GB18030') # 悀
- check_both_ways("\u6081", "\x90\x80", 'GB18030') #
- check_both_ways("\u6146", "\x90\xFE", 'GB18030') #
- check_both_ways("\u70DC", "\x9F\x40", 'GB18030') #
- check_both_ways("\u7134", "\x9F\x7E", 'GB18030') # 焴
- check_both_ways("\u7135", "\x9F\x80", 'GB18030') # 焵
- check_both_ways("\u71D3", "\x9F\xFE", 'GB18030') #
- check_both_ways("\u71D6", "\xA0\x40", 'GB18030') #
- check_both_ways("\u721A", "\xA0\x7E", 'GB18030') #
- check_both_ways("\u721B", "\xA0\x80", 'GB18030') #
- check_both_ways("\u72DB", "\xA0\xFE", 'GB18030') #
- check_both_ways("\u3000", "\xA1\xA1", 'GB18030') # full-width space
- check_both_ways("\u3001", "\xA1\xA2", 'GB18030') #
- check_both_ways("\u3013", "\xA1\xFE", 'GB18030') #
- #assert_raise(Encoding::UndefinedConversionError) { "\xA2\xA0".encode("utf-8", 'GB18030') }
- check_both_ways("\u2170", "\xA2\xA1", 'GB18030') # ⅰ
- #assert_raise(Encoding::UndefinedConversionError) { "\xA2\xB0".encode("utf-8", 'GB18030') }
- check_both_ways("\u2488", "\xA2\xB1", 'GB18030') #
- #assert_raise(Encoding::UndefinedConversionError) { "\xA2\xE4".encode("utf-8", 'GB18030') }
- check_both_ways("\u3220", "\xA2\xE5", 'GB18030') # ㈠
- #assert_raise(Encoding::UndefinedConversionError) { "\xA2\xF0".encode("utf-8", 'GB18030') }
- check_both_ways("\u2160", "\xA2\xF1", 'GB18030') # Ⅰ
- #assert_raise(Encoding::UndefinedConversionError) { "\xA3\xA0".encode("utf-8", 'GB18030') }
- check_both_ways("\uFF01", "\xA3\xA1", 'GB18030') # E
- check_both_ways("\uFFE3", "\xA3\xFE", 'GB18030') # E
- #assert_raise(Encoding::UndefinedConversionError) { "\xA4\xA0".encode("utf-8", 'GB18030') }
- check_both_ways("\u3041", "\xA4\xA1", 'GB18030') #
- #assert_raise(Encoding::UndefinedConversionError) { "\xA5\xA0".encode("utf-8", 'GB18030') }
- check_both_ways("\u30A1", "\xA5\xA1", 'GB18030') # ァ
- check_both_ways("\u0391", "\xA6\xA1", 'GB18030') #
- check_both_ways("\u03B1", "\xA6\xC1", 'GB18030') # α
- #assert_raise(Encoding::UndefinedConversionError) { "\xA6\xED".encode("utf-8", 'GB18030') }
- check_both_ways("\uFE3B", "\xA6\xEE", 'GB18030') # E
- check_both_ways("\u0410", "\xA7\xA1", 'GB18030') #
- check_both_ways("\u0430", "\xA7\xD1", 'GB18030') # а
- check_both_ways("\u02CA", "\xA8\x40", 'GB18030') #
- check_both_ways("\u2587", "\xA8\x7E", 'GB18030') #
- #assert_raise(Encoding::UndefinedConversionError) { "\xA8\x96".encode("utf-8", 'GB18030') }
- check_both_ways("\u0101", "\xA8\xA1", 'GB18030') #
- #assert_raise(Encoding::UndefinedConversionError) { "\xA8\xBC".encode("utf-8", 'GB18030') }
- #assert_raise(Encoding::UndefinedConversionError) { "\xA8\xBF".encode("utf-8", 'GB18030') }
- #assert_raise(Encoding::UndefinedConversionError) { "\xA8\xC4".encode("utf-8", 'GB18030') }
- check_both_ways("\u3105", "\xA8\xC5", 'GB18030') #
- check_both_ways("\u3021", "\xA9\x40", 'GB18030') # 〡
- #assert_raise(Encoding::UndefinedConversionError) { "\xA9\x58".encode("utf-8", 'GB18030') }
- #assert_raise(Encoding::UndefinedConversionError) { "\xA9\x5B".encode("utf-8", 'GB18030') }
- #assert_raise(Encoding::UndefinedConversionError) { "\xA9\x5D".encode("utf-8", 'GB18030') }
- check_both_ways("\u3007", "\xA9\x96", 'GB18030') #
- #assert_raise(Encoding::UndefinedConversionError) { "\xA9\xA3".encode("utf-8", 'GB18030') }
- check_both_ways("\u2500", "\xA9\xA4", 'GB18030') # ─
- #assert_raise(Encoding::UndefinedConversionError) { "\xA9\xF0".encode("utf-8", 'GB18030') }
- check_both_ways("\u7588", "\xAF\x40", 'GB18030') #
- check_both_ways("\u7607", "\xAF\x7E", 'GB18030') #
- check_both_ways("\u7608", "\xAF\x80", 'GB18030') #
- check_both_ways("\u7644", "\xAF\xA0", 'GB18030') #
- #assert_raise(Encoding::UndefinedConversionError) { "\xAF\xA1".encode("utf-8", 'GB18030') }
- check_both_ways("\u7645", "\xB0\x40", 'GB18030') #
- check_both_ways("\u769B", "\xB0\x7E", 'GB18030') #
- check_both_ways("\u769C", "\xB0\x80", 'GB18030') #
- check_both_ways("\u5265", "\xB0\xFE", 'GB18030') # 剥
- check_both_ways("\u7DFB", "\xBF\x40", 'GB18030') # 緻
- check_both_ways("\u7E39", "\xBF\x7E", 'GB18030') # 縹
- check_both_ways("\u7E3A", "\xBF\x80", 'GB18030') # 縺
- check_both_ways("\u5080", "\xBF\xFE", 'GB18030') # 傀
- check_both_ways("\u7E5E", "\xC0\x40", 'GB18030') #
- check_both_ways("\u7E9E", "\xC0\x7E", 'GB18030') #
- check_both_ways("\u7EAE", "\xC0\x80", 'GB18030') # 纮
- check_both_ways("\u4FD0", "\xC0\xFE", 'GB18030') #
- check_both_ways("\u87A5", "\xCF\x40", 'GB18030') # 螥
- check_both_ways("\u87F8", "\xCF\x7E", 'GB18030') # 蟸
- check_both_ways("\u87FA", "\xCF\x80", 'GB18030') # 蟺
- check_both_ways("\u6653", "\xCF\xFE", 'GB18030') #
- check_both_ways("\u8824", "\xD0\x40", 'GB18030') # 蠤
- check_both_ways("\u887A", "\xD0\x7E", 'GB18030') # 衺
- check_both_ways("\u887B", "\xD0\x80", 'GB18030') # 衻
- check_both_ways("\u7384", "\xD0\xFE", 'GB18030') #
- check_both_ways("\u9019", "\xDF\x40", 'GB18030') #
- check_both_ways("\u9081", "\xDF\x7E", 'GB18030') #
- check_both_ways("\u9084", "\xDF\x80", 'GB18030') #
- check_both_ways("\u553C", "\xDF\xFE", 'GB18030') # 唼
- check_both_ways("\u90C2", "\xE0\x40", 'GB18030') #
- check_both_ways("\u911C", "\xE0\x7E", 'GB18030') #
- check_both_ways("\u911D", "\xE0\x80", 'GB18030') #
- check_both_ways("\u5E3C", "\xE0\xFE", 'GB18030') # 帼
- check_both_ways("\u986F", "\xEF\x40", 'GB18030') # 顯
- check_both_ways("\u98E4", "\xEF\x7E", 'GB18030') # 飤
- check_both_ways("\u98E5", "\xEF\x80", 'GB18030') # 飥
- check_both_ways("\u7A14", "\xEF\xFE", 'GB18030') #
- check_both_ways("\u9908", "\xF0\x40", 'GB18030') #
- check_both_ways("\u9949", "\xF0\x7E", 'GB18030') #
- check_both_ways("\u994A", "\xF0\x80", 'GB18030') #
- check_both_ways("\u7619", "\xF0\xFE", 'GB18030') #
- check_both_ways("\u9F32", "\xFD\x40", 'GB18030') # 鼲
- check_both_ways("\u9F78", "\xFD\x7E", 'GB18030') # 齸
- check_both_ways("\u9F79", "\xFD\x80", 'GB18030') # 齹
- check_both_ways("\uF9F1", "\xFD\xA0", 'GB18030') # E
- #assert_raise(Encoding::UndefinedConversionError) { "\xFD\xA1".encode("utf-8", 'GB18030') }
- check_both_ways("\uFA0C", "\xFE\x40", 'GB18030') # E
- check_both_ways("\uFA29", "\xFE\x4F", 'GB18030') # E
- #assert_raise(Encoding::UndefinedConversionError) { "\xFE\x50".encode("utf-8", 'GB18030') }
- check_both_ways("\u9752\u5C71\u5B66\u9662\u5927\u5B66", "\xC7\xE0\xC9\xBD\xD1\xA7\xD4\xBA\xB4\xF3\xD1\xA7", 'GB18030') # 青山学院大学
- check_both_ways("\u795E\u6797\u7FA9\u535A", "\xC9\xF1\xC1\xD6\xC1\x78\xB2\xA9", 'GB18030') # 神林義
-
- # new tests for GB18030
- check_both_ways("\u9FA6", "\x82\x35\x8F\x33", 'GB18030') # 龦
- check_both_ways("\uD7FF", "\x83\x36\xC7\x38", 'GB18030') # No name ()
-
- check_both_ways("\u0452", "\x81\x30\xD3\x30", 'GB18030') #
- check_both_ways("\u200F", "\x81\x36\xA5\x31", 'GB18030') # RIGHT-TO-LEFT MARK
-
- check_both_ways("\uE865", "\x83\x36\xD0\x30", 'GB18030') # No name (Private Use Area)
- check_both_ways("\uF92B", "\x84\x30\x85\x34", 'GB18030') # E
-
- check_both_ways("\u2643", "\x81\x37\xA8\x39", 'GB18030') #
- check_both_ways("\u2E80", "\x81\x38\xFD\x38", 'GB18030') # ⺀
-
- check_both_ways("\uFA2A", "\x84\x30\x9C\x38", 'GB18030') # E
- check_both_ways("\uFE2F", "\x84\x31\x85\x37", 'GB18030') # No name (Combining Half Marks)
-
- check_both_ways("\u3CE1", "\x82\x31\xD4\x38", 'GB18030') # 㳡
- check_both_ways("\u4055", "\x82\x32\xAF\x32", 'GB18030') #
-
- check_both_ways("\u361B", "\x82\x30\xA6\x33", 'GB18030') #
- check_both_ways("\u3917", "\x82\x30\xF2\x37", 'GB18030') #
-
- check_both_ways("\u49B8", "\x82\x34\xA1\x31", 'GB18030') # 䦸
- check_both_ways("\u4C76", "\x82\x34\xE7\x33", 'GB18030') # 䱶
-
- check_both_ways("\u4160", "\x82\x32\xC9\x37", 'GB18030') # 䅠
- check_both_ways("\u4336", "\x82\x32\xF8\x37", 'GB18030') # 䌶
-
- check_both_ways("\u478E", "\x82\x33\xE8\x38", 'GB18030') #
- check_both_ways("\u4946", "\x82\x34\x96\x38", 'GB18030') #
-
- check_both_ways("\u44D7", "\x82\x33\xA3\x39", 'GB18030') #
- check_both_ways("\u464B", "\x82\x33\xC9\x31", 'GB18030') #
-
- check_both_ways("\uFFE6", "\x84\x31\xA2\x34", 'GB18030') # E
- check_both_ways("\uFFFF", "\x84\x31\xA4\x39", 'GB18030') # not a character
-
- check_both_ways("\u{10000}", "\x90\x30\x81\x30", 'GB18030') # 𐀀
- check_both_ways("\u{10FFFE}", "\xE3\x32\x9A\x34", 'GB18030') # No name (Not a character)
- check_both_ways("\u{10FFFF}", "\xE3\x32\x9A\x35", 'GB18030') # No name (Not a character)
- end
-
- def test_Big5
- check_both_ways("\u3000", "\xA1\x40", 'Big5') # full-width space
- check_both_ways("\uFE5A", "\xA1\x7E", 'Big5') # ﹚
- check_both_ways("\uFE5B", "\xA1\xA1", 'Big5') # ﹛
- #check_both_ways("\uFF0F", "\xA1\xFE", 'Big5') # /
- check_both_ways("\uFF57", "\xA3\x40", 'Big5') # w
- check_both_ways("\u310F", "\xA3\x7E", 'Big5') # ㄏ
- check_both_ways("\u3110", "\xA3\xA1", 'Big5') # ㄐ
- check_both_ways("\u02CB", "\xA3\xBF", 'Big5') # ˋ
- assert_raise(Encoding::UndefinedConversionError) { "\xA3\xC0".encode("utf-8", 'Big5') }
- check_both_ways("\u6D6C", "\xAF\x40", 'Big5') # 浬
- check_both_ways("\u7837", "\xAF\x7E", 'Big5') # 砷
- check_both_ways("\u7825", "\xAF\xA1", 'Big5') # 砥
- check_both_ways("\u8343", "\xAF\xFE", 'Big5') # 荃
- check_both_ways("\u8654", "\xB0\x40", 'Big5') # 虔
- check_both_ways("\u9661", "\xB0\x7E", 'Big5') # 陡
- check_both_ways("\u965B", "\xB0\xA1", 'Big5') # 陛
- check_both_ways("\u5A40", "\xB0\xFE", 'Big5') # 婀
- check_both_ways("\u6FC3", "\xBF\x40", 'Big5') # 濃
- check_both_ways("\u7E0A", "\xBF\x7E", 'Big5') # 縊
- check_both_ways("\u7E11", "\xBF\xA1", 'Big5') # 縑
- check_both_ways("\u931A", "\xBF\xFE", 'Big5') # 錚
- check_both_ways("\u9310", "\xC0\x40", 'Big5') # 錐
- check_both_ways("\u5687", "\xC0\x7E", 'Big5') # 嚇
- check_both_ways("\u568F", "\xC0\xA1", 'Big5') # 嚏
- check_both_ways("\u77AC", "\xC0\xFE", 'Big5') # 瞬
- check_both_ways("\u8B96", "\xC6\x40", 'Big5') # 讖
- check_both_ways("\u7C72", "\xC6\x7E", 'Big5') # 籲
- #assert_raise(Encoding::UndefinedConversionError) { "\xC6\xA1".encode("utf-8", 'Big5') }
- #assert_raise(Encoding::UndefinedConversionError) { "\xC7\x40".encode("utf-8", 'Big5') }
- assert_raise(Encoding::UndefinedConversionError) { "\xC8\x40".encode("utf-8", 'Big5') }
- check_both_ways("\u4E42", "\xC9\x40", 'Big5') # 乂
- check_both_ways("\u6C15", "\xC9\x7E", 'Big5') # 氕
- check_both_ways("\u6C36", "\xC9\xA1", 'Big5') # 氶
- check_both_ways("\u6C4B", "\xC9\xFE", 'Big5') # 汋
- check_both_ways("\u67DC", "\xCF\x40", 'Big5') # 柜
- check_both_ways("\u6D42", "\xCF\x7E", 'Big5') # 浂
- check_both_ways("\u6D01", "\xCF\xA1", 'Big5') # 洁
- check_both_ways("\u7A80", "\xCF\xFE", 'Big5') # 窀
- check_both_ways("\u7A7E", "\xD0\x40", 'Big5') # 穾
- check_both_ways("\u82EA", "\xD0\x7E", 'Big5') # 苪
- check_both_ways("\u82E4", "\xD0\xA1", 'Big5') # 苤
- check_both_ways("\u54F1", "\xD0\xFE", 'Big5') # 哱
- check_both_ways("\u7A1B", "\xDF\x40", 'Big5') # 稛
- check_both_ways("\u816F", "\xDF\x7E", 'Big5') # 腯
- check_both_ways("\u8144", "\xDF\xA1", 'Big5') # 腄
- check_both_ways("\u89E4", "\xDF\xFE", 'Big5') # 觤
- check_both_ways("\u89E1", "\xE0\x40", 'Big5') # 觡
- check_both_ways("\u903F", "\xE0\x7E", 'Big5') # 逿
- check_both_ways("\u9044", "\xE0\xA1", 'Big5') # 遄
- check_both_ways("\u50E0", "\xE0\xFE", 'Big5') # 僠
- check_both_ways("\u979E", "\xEF\x40", 'Big5') # 鞞
- check_both_ways("\u9D30", "\xEF\x7E", 'Big5') # 鴰
- check_both_ways("\u9D45", "\xEF\xA1", 'Big5') # 鵅
- check_both_ways("\u7376", "\xEF\xFE", 'Big5') # 獶
- check_both_ways("\u74B8", "\xF0\x40", 'Big5') # 璸
- check_both_ways("\u81D2", "\xF0\x7E", 'Big5') # 臒
- check_both_ways("\u81D0", "\xF0\xA1", 'Big5') # 臐
- check_both_ways("\u8E67", "\xF0\xFE", 'Big5') # 蹧
- check_both_ways("\u7E98", "\xF9\x40", 'Big5') # 纘
- check_both_ways("\u9F0A", "\xF9\x7E", 'Big5') # 鼊
- check_both_ways("\u9FA4", "\xF9\xA1", 'Big5') # 龤
- check_both_ways("\u9F98", "\xF9\xD5", 'Big5') # 龘
- assert_raise(Encoding::UndefinedConversionError) { "\xF9\xD6".encode("utf-8", 'Big5') }
- check_both_ways("\u795E\u6797\u7FA9\u535A", "\xAF\xAB\xAA\x4C\xB8\x71\xB3\xD5", 'Big5') # 神林義博
- end
-
- def test_nothing_changed
- a = "James".force_encoding("US-ASCII")
- b = a.encode("Shift_JIS")
- assert_equal(Encoding::US_ASCII, a.encoding)
- assert_equal(Encoding::Shift_JIS, b.encoding)
- end
-end
diff --git a/test/ruby/test_unicode_escape.rb b/test/ruby/test_unicode_escape.rb
deleted file mode 100644
index 5887dbc3dc..0000000000
--- a/test/ruby/test_unicode_escape.rb
+++ /dev/null
@@ -1,267 +0,0 @@
-# -*- coding: utf-8 -*-
-
-require 'test/unit'
-
-class TestUnicodeEscape < Test::Unit::TestCase
- def test_basic
- assert_equal('Matz - 松本行弘',
- "Matz - \u677E\u672C\u884C\u5F18")
- assert_equal('Matz - まつもと ゆきひろ',
- "Matz - \u307E\u3064\u3082\u3068 \u3086\u304D\u3072\u308D")
- assert_equal('Matz - まつもと ゆきひろ',
- "Matz - \u{307E}\u{3064}\u{3082}\u{3068} \u{3086}\u{304D}\u{3072}\u{308D}")
- assert_equal('Matz - まつもと ゆきひろ',
- "Matz - \u{307E 3064 3082 3068 20 3086 304D 3072 308D}")
- assert_equal("Aoyama Gakuin University - \xE9\x9D\x92\xE5\xB1\xB1\xE5\xAD\xA6\xE9\x99\xA2\xE5\xA4\xA7\xE5\xAD\xA6",
- "Aoyama Gakuin University - \u9752\u5C71\u5B66\u9662\u5927\u5B66")
- assert_equal('Aoyama Gakuin University - 青山学院大学',
- "Aoyama Gakuin University - \u9752\u5C71\u5B66\u9662\u5927\u5B66")
- assert_equal('青山学院大学', "\u9752\u5C71\u5B66\u9662\u5927\u5B66")
- assert_equal("Martin D\xC3\xBCrst", "Martin D\u00FCrst")
- assert_equal('Martin Dürst', "Martin D\u00FCrst")
- assert_equal('ü', "\u00FC")
- assert_equal("Martin D\xC3\xBCrst", "Martin D\u{FC}rst")
- assert_equal('Martin Dürst', "Martin D\u{FC}rst")
- assert_equal('ü', "\u{FC}")
- assert_equal('ü', %Q|\u{FC}|)
- assert_equal('ü', %W{\u{FC}}[0])
-
- # \u escapes in here documents
- assert_equal('Matz - まつもと ゆきひろ', <<EOS.chop)
-Matz - \u307E\u3064\u3082\u3068 \u3086\u304D\u3072\u308D
-EOS
-
- assert_equal('Matz - まつもと ゆきひろ', <<"EOS".chop)
-Matz - \u{307E 3064 3082 3068} \u{3086 304D 3072 308D}
-EOS
- assert_not_equal('Matz - まつもと ゆきひろ', <<'EOS'.chop)
-Matz - \u{307E 3064 3082 3068} \u{3086 304D 3072 308D}
-EOS
-
- # single-quoted things don't expand \u
- assert_not_equal('ü', '\u{FC}')
- assert_not_equal('ü', %q|\u{FC}|)
- assert_not_equal('ü', %w{\u{FC}}[0])
- assert_equal('\u00fc', "\\" + "u00fc")
-
- # \u in %x strings
- assert_match(/^("?)A\1$/, `echo "\u0041"`) #"
- assert_match(/^("?)A\1$/, %x{echo "\u0041"}) #"
- assert_match(/^("?)ü\1$/, `echo "\u{FC}"`.force_encoding("utf-8")) #"
-
- # \u in quoted symbols
- assert_equal(:A, :"\u0041")
- assert_equal(:a, :"\u0061")
- assert_equal(:ま, :ま)
- assert_equal(:ü, :ü)
- assert_equal(:"\u{41}", :"\u0041")
- assert_equal(:ü, :"\u{fc}")
-
- # the NUL character is not allowed in symbols
- assert_raise(SyntaxError) { eval %q(:"\u{0}")}
- assert_raise(SyntaxError) { eval %q(:"\u0000")}
- assert_raise(SyntaxError) { eval %q(:"\u{fc 0 0041}")}
- assert_raise(SyntaxError) { eval %q(:"\x00")}
- assert_raise(SyntaxError) { eval %q(:"\0")}
- end
-
- def test_regexp
-
- # Compare regexps to regexps
- assert_not_equal(/Yukihiro Matsumoto - 松本行弘/,
- /Yukihiro Matsumoto - \u677E\u672C\u884C\u5F18/)
- assert_not_equal(/Yukihiro Matsumoto - 松本行弘/,
- /Yukihiro Matsumoto - \u{677E 672C 884C 5F18}/)
- assert_not_equal(/Matz - まつもと ゆきひろ/,
- /Matz - \u307E\u3064\u3082\u3068 \u3086\u304D\u3072\u308D/)
- assert_not_equal(/Aoyama Gakuin University - 青山学院大学/,
- /Aoyama Gakuin University - \u9752\u5C71\u5B66\u9662\u5927\u5B66/)
- assert_not_equal(/青山学院大学/, /\u9752\u5C71\u5B66\u9662\u5927\u5B66/)
- assert_not_equal(/Martin Dürst/, /Martin D\u00FCrst/)
- assert_not_equal(/ü/, /\u00FC/)
- assert_not_equal(/Martin Dürst/, /Martin D\u{FC}rst/)
- assert_not_equal(/ü/, /\u{FC}/)
- assert_not_equal(/ü/, %r{\u{FC}})
- assert_not_equal(/ü/i, %r{\u00FC}i)
-
- assert_equal('Yukihiro Matsumoto - \u677E\u672C\u884C\u5F18',
- /Yukihiro Matsumoto - \u677E\u672C\u884C\u5F18/.source)
- assert_equal('Yukihiro Matsumoto - \u{677E 672C 884C 5F18}',
- /Yukihiro Matsumoto - \u{677E 672C 884C 5F18}/.source)
- assert_equal('Matz - \u307E\u3064\u3082\u3068 \u3086\u304D\u3072\u308D',
- /Matz - \u307E\u3064\u3082\u3068 \u3086\u304D\u3072\u308D/.source)
- assert_equal('Aoyama Gakuin University - \u9752\u5C71\u5B66\u9662\u5927\u5B66',
- /Aoyama Gakuin University - \u9752\u5C71\u5B66\u9662\u5927\u5B66/.source)
- assert_equal('\u9752\u5C71\u5B66\u9662\u5927\u5B66',
- /\u9752\u5C71\u5B66\u9662\u5927\u5B66/.source)
- assert_equal('Martin D\u00FCrst', /Martin D\u00FCrst/.source)
- assert_equal('\u00FC', /\u00FC/.source)
- assert_equal('Martin D\u{FC}rst', /Martin D\u{FC}rst/.source)
- assert_equal('\u{FC}', /\u{FC}/.source)
- assert_equal('\u{FC}', %r{\u{FC}}.source)
- assert_equal('\u00FC', %r{\u00FC}i.source)
-
- # match strings to regexps
- assert_equal(0, "Yukihiro Matsumoto - 松本行弘" =~ /Yukihiro Matsumoto - \u677E\u672C\u884C\u5F18/)
- assert_equal(0, "Yukihiro Matsumoto - \u677E\u672C\u884C\u5F18" =~ /Yukihiro Matsumoto - \u677E\u672C\u884C/)
- assert_equal(0, "Yukihiro Matsumoto - 松本行弘" =~ /Yukihiro Matsumoto - \u{677E 672C 884C 5F18}/)
- assert_equal(0, %Q{Yukihiro Matsumoto - \u{677E 672C 884C 5F18}} =~ /Yukihiro Matsumoto - \u{677E 672C 884C 5F18}/)
- assert_equal(0, "Matz - まつもと ゆきひろ" =~ /Matz - \u307E\u3064\u3082\u3068 \u3086\u304D\u3072\u308D/)
- assert_equal(0, "Aoyama Gakuin University - 青山学院大学" =~ /Aoyama Gakuin University - \u9752\u5C71\u5B66\u9662\u5927\u5B66/)
- assert_equal(0, "青山学院大学" =~ /\u9752\u5C71\u5B66\u9662\u5927\u5B66/)
- assert_equal(0, "Martin Dürst" =~ /Martin D\u00FCrst/)
- assert_equal(0, "ü" =~ /\u00FC/)
- assert_equal(0, "Martin Dürst" =~ /Martin D\u{FC}rst/)
- assert_equal(0, "ü" =~ %r{\u{FC}})
- assert_equal(0, "ü" =~ %r{\u00FC}i)
-
- # Flip order of the two operands
- assert_equal(0, /Martin D\u00FCrst/ =~ "Martin Dürst")
- assert_equal(4, /\u00FC/ =~ "testü")
- assert_equal(3, /Martin D\u{FC}rst/ =~ "fooMartin Dürstbar")
- assert_equal(3, %r{\u{FC}} =~ "fooübar")
-
- # Put \u in strings, literal character in regexp
- assert_equal(0, "Martin D\u00FCrst" =~ /Martin Dürst/)
- assert_equal(4, "test\u00FC" =~ /ü/)
- assert_equal(3, "fooMartin D\u{FC}rstbar" =~ /Martin Dürst/)
- assert_equal(3, %Q{foo\u{FC}bar} =~ %r<ü>)
-
- assert_match(eval('/\u{2a}/'), "*")
- assert_raise(SyntaxError) { eval('/\u{6666}/n') }
- assert_raise(SyntaxError) { eval('/\u{6666}/e') }
- assert_raise(SyntaxError) { eval('/\u{6666}/s') }
- assert_nothing_raised { eval('/\u{6666}/u') }
- end
-
- def test_dynamic_regexp
- assert_match(Regexp.new("Martin D\\u{FC}rst"), "Martin Dürst")
- end
-
- def test_syntax_variants
- # all hex digits
- assert_equal("\xC4\xA3\xE4\x95\xA7\xE8\xA6\xAB\xEC\xB7\xAF", "\u0123\u4567\u89AB\uCDEF")
- assert_equal("\xC4\xA3\xE4\x95\xA7\xE8\xA6\xAB\xEC\xB7\xAF", "\u0123\u4567\u89AB\uCDEF")
- assert_equal("\xC4\xA3\xE4\x95\xA7\xE8\xA6\xAB\xEC\xB7\xAF", "\u0123\u4567\u89ab\ucdef")
- assert_equal("\xC4\xA3\xE4\x95\xA7\xE8\xA6\xAB\xEC\xB7\xAF", "\u0123\u4567\u89ab\ucdef")
- assert_equal("\xC4\xA3\xE4\x95\xA7\xE8\xA6\xAB\xEC\xB7\xAF", "\u0123\u4567\u89aB\uCdEf")
- assert_equal("\xC4\xA3\xE4\x95\xA7\xE8\xA6\xAB\xEC\xB7\xAF", "\u0123\u4567\u89aB\ucDEF")
- end
-
- def test_fulton
- # examples from Hal Fulton's book (second edition), chapter 4
- # precomposed e'pe'e
- assert_equal('épée', "\u00E9\u0070\u00E9\u0065")
- assert_equal('épée', "\u00E9p\u00E9e")
- assert_equal("\xC3\xA9\x70\xC3\xA9\x65", "\u00E9\u0070\u00E9\u0065")
- assert_equal("\xC3\xA9\x70\xC3\xA9\x65", "\u00E9p\u00E9e")
- # decomposed e'pe'e
- assert_equal('épée', "\u0065\u0301\u0070\u0065\u0301\u0065")
- assert_equal('épée', "e\u0301pe\u0301e")
- assert_equal("\x65\xCC\x81\x70\x65\xCC\x81\x65", "\u0065\u0301\u0070\u0065\u0301\u0065")
- assert_equal("\x65\xCC\x81\x70\x65\xCC\x81\x65", "e\u0301pe\u0301e")
- # combinations of NFC/D, NFKC/D
- assert_equal('öffnen', "\u00F6\u0066\u0066\u006E\u0065\u006E")
- assert_equal("\xC3\xB6ffnen", "\u00F6\u0066\u0066\u006E\u0065\u006E")
- assert_equal('öffnen', "\u00F6ffnen")
- assert_equal("\xC3\xB6ffnen", "\u00F6ffnen")
- assert_equal('öffnen', "\u006F\u0308\u0066\u0066\u006E\u0065\u006E")
- assert_equal("\x6F\xCC\x88ffnen", "\u006F\u0308\u0066\u0066\u006E\u0065\u006E")
- assert_equal('öffnen', "o\u0308ffnen")
- assert_equal("\x6F\xCC\x88ffnen", "o\u0308ffnen")
- assert_equal('öffnen', "\u00F6\uFB00\u006E\u0065\u006E")
- assert_equal("\xC3\xB6\xEF\xAC\x80nen", "\u00F6\uFB00\u006E\u0065\u006E")
- assert_equal('öffnen', "\u00F6\uFB00nen")
- assert_equal("\xC3\xB6\xEF\xAC\x80nen", "\u00F6\uFB00nen")
- assert_equal('öffnen', "\u006F\u0308\uFB00\u006E\u0065\u006E")
- assert_equal("\x6F\xCC\x88\xEF\xAC\x80nen", "\u006F\u0308\uFB00\u006E\u0065\u006E")
- assert_equal('öffnen', "o\u0308\uFB00nen")
- assert_equal("\x6F\xCC\x88\xEF\xAC\x80nen", "o\u0308\uFB00nen")
- # German sharp s (sz)
- assert_equal('Straße', "\u0053\u0074\u0072\u0061\u00DF\u0065")
- assert_equal("\x53\x74\x72\x61\xC3\x9F\x65", "\u0053\u0074\u0072\u0061\u00DF\u0065")
- assert_equal('Straße', "Stra\u00DFe")
- assert_equal("\x53\x74\x72\x61\xC3\x9F\x65", "Stra\u00DFe")
- assert_equal('Straße', "\u{53}\u{74}\u{72}\u{61}\u{DF}\u{65}")
- assert_equal("\x53\x74\x72\x61\xC3\x9F\x65", "\u{53}\u{74}\u{72}\u{61}\u{DF}\u{65}")
- assert_equal("\x53\x74\x72\x61\xC3\x9F\x65", "\u{53 74 72 61 DF 65}")
- assert_equal('Straße', "Stra\u{DF}e")
- assert_equal("\x53\x74\x72\x61\xC3\x9F\x65", "Stra\u{DF}e")
- end
-
- def test_edge_cases
- # start and end of each outer plane
- assert_equal("\xF4\x8F\xBF\xBF", "\u{10FFFF}")
- assert_equal("\xF4\x80\x80\x80", "\u{100000}")
- assert_equal("\xF3\xBF\xBF\xBF", "\u{FFFFF}")
- assert_equal("\xF3\xB0\x80\x80", "\u{F0000}")
- assert_equal("\xF3\xAF\xBF\xBF", "\u{EFFFF}")
- assert_equal("\xF3\xA0\x80\x80", "\u{E0000}")
- assert_equal("\xF3\x9F\xBF\xBF", "\u{DFFFF}")
- assert_equal("\xF3\x90\x80\x80", "\u{D0000}")
- assert_equal("\xF3\x8F\xBF\xBF", "\u{CFFFF}")
- assert_equal("\xF3\x80\x80\x80", "\u{C0000}")
- assert_equal("\xF2\xBF\xBF\xBF", "\u{BFFFF}")
- assert_equal("\xF2\xB0\x80\x80", "\u{B0000}")
- assert_equal("\xF2\xAF\xBF\xBF", "\u{AFFFF}")
- assert_equal("\xF2\xA0\x80\x80", "\u{A0000}")
- assert_equal("\xF2\x9F\xBF\xBF", "\u{9FFFF}")
- assert_equal("\xF2\x90\x80\x80", "\u{90000}")
- assert_equal("\xF2\x8F\xBF\xBF", "\u{8FFFF}")
- assert_equal("\xF2\x80\x80\x80", "\u{80000}")
- assert_equal("\xF1\xBF\xBF\xBF", "\u{7FFFF}")
- assert_equal("\xF1\xB0\x80\x80", "\u{70000}")
- assert_equal("\xF1\xAF\xBF\xBF", "\u{6FFFF}")
- assert_equal("\xF1\xA0\x80\x80", "\u{60000}")
- assert_equal("\xF1\x9F\xBF\xBF", "\u{5FFFF}")
- assert_equal("\xF1\x90\x80\x80", "\u{50000}")
- assert_equal("\xF1\x8F\xBF\xBF", "\u{4FFFF}")
- assert_equal("\xF1\x80\x80\x80", "\u{40000}")
- assert_equal("\xF0\xBF\xBF\xBF", "\u{3FFFF}")
- assert_equal("\xF0\xB0\x80\x80", "\u{30000}")
- assert_equal("\xF0\xAF\xBF\xBF", "\u{2FFFF}")
- assert_equal("\xF0\xA0\x80\x80", "\u{20000}")
- assert_equal("\xF0\x9F\xBF\xBF", "\u{1FFFF}")
- assert_equal("\xF0\x90\x80\x80", "\u{10000}")
- # BMP
- assert_equal("\xEF\xBF\xBF", "\uFFFF")
- assert_equal("\xEE\x80\x80", "\uE000")
- assert_equal("\xED\x9F\xBF", "\uD7FF")
- assert_equal("\xE0\xA0\x80", "\u0800")
- assert_equal("\xDF\xBF", "\u07FF")
- assert_equal("\xC2\x80", "\u0080")
- assert_equal("\x7F", "\u007F")
- assert_equal("\x00", "\u0000")
- end
-
- def test_chars
- assert_equal(?\u0041, ?A)
- assert_equal(?\u{79}, ?\x79)
- assert_equal(?\u{0}, ?\000)
- assert_equal(?\u0000, ?\000)
- end
-
- # Tests to make sure that disallowed cases fail
- def test_fail
- assert_raise(SyntaxError) { eval %q("\uabc") } # too short
- assert_raise(SyntaxError) { eval %q("\uab") } # too short
- assert_raise(SyntaxError) { eval %q("\ua") } # too short
- assert_raise(SyntaxError) { eval %q("\u") } # too short
- assert_raise(SyntaxError) { eval %q("\u{110000}") } # too high
- assert_raise(SyntaxError) { eval %q("\u{abcdeff}") } # too long
- assert_raise(SyntaxError) { eval %q("\ughij") } # bad hex digits
- assert_raise(SyntaxError) { eval %q("\u{ghij}") } # bad hex digits
-
- assert_raise(SyntaxError) { eval %q("\u{123 456 }")} # extra space
- assert_raise(SyntaxError) { eval %q("\u{ 123 456}")} # extra space
- assert_raise(SyntaxError) { eval %q("\u{123 456}")} # extra space
-
-# The utf-8 encoding object currently does not object to codepoints
-# in the surrogate blocks, so these do not raise an error.
-# assert_raise(SyntaxError) { "\uD800" } # surrogate block
-# assert_raise(SyntaxError) { "\uDCBA" } # surrogate block
-# assert_raise(SyntaxError) { "\uDFFF" } # surrogate block
-# assert_raise(SyntaxError) { "\uD847\uDD9A" } # surrogate pair
-
- end
-end
diff --git a/test/ruby/test_variable.rb b/test/ruby/test_variable.rb
index a842c31c3f..8726160826 100644
--- a/test/ruby/test_variable.rb
+++ b/test/ruby/test_variable.rb
@@ -1,5 +1,4 @@
require 'test/unit'
-require_relative 'envutil'
class TestVariable < Test::Unit::TestCase
class Gods
@@ -26,21 +25,17 @@ class TestVariable < Test::Unit::TestCase
end
class Titans < Gods
- @@rule = "Cronus" # modifies @@rule in Gods
- include Olympians
- def ruler4
- @@rule
- end
+ @@rule = "Cronus"
+ include Olympians # OK to cause warning (intentional)
end
def test_variable
assert_instance_of(Fixnum, $$)
-
+
# read-only variable
- assert_raise(NameError) do
+ assert_raises(NameError) do
$$ = 5
end
- assert_normal_exit("$*=0; $*", "[ruby-dev:36698]")
foobar = "foobar"
$_ = foobar
@@ -54,31 +49,5 @@ class TestVariable < Test::Unit::TestCase
atlas = Titans.new
assert_equal("Cronus", atlas.ruler0)
assert_equal("Zeus", atlas.ruler3)
- assert_equal("Cronus", atlas.ruler4)
- end
-
- def test_local_variables
- lvar = 1
- assert_instance_of(Symbol, local_variables[0], "[ruby-dev:34008]")
- end
-
- def test_local_variables2
- x = 1
- proc do |y|
- assert_equal([:x, :y], local_variables.sort)
- end.call
- end
-
- def test_local_variables3
- x = 1
- proc do |y|
- 1.times do |z|
- assert_equal([:x, :y, :z], local_variables.sort)
- end
- end.call
- end
-
- def test_global_variable_0
- assert_in_out_err(["-e", "$0='t'*1000;print $0"], "", /\At+\z/, [])
end
end
diff --git a/test/ruby/test_whileuntil.rb b/test/ruby/test_whileuntil.rb
index 5628317cb8..6faed31160 100644
--- a/test/ruby/test_whileuntil.rb
+++ b/test/ruby/test_whileuntil.rb
@@ -1,75 +1,70 @@
require 'test/unit'
-require 'tmpdir'
class TestWhileuntil < Test::Unit::TestCase
def test_while
- Dir.mktmpdir("ruby_while_tmp") {|tmpdir|
- tmpfilename = "#{tmpdir}/ruby_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
- tmp = open(tmpfilename, "w")
- tmp.print "tvi925\n";
- tmp.print "tvi920\n";
- tmp.print "vt100\n";
- tmp.print "Amiga\n";
- tmp.print "paper\n";
- tmp.close
-
- tmp = open(tmpfilename, "r")
- assert_instance_of(File, tmp)
-
- while line = tmp.gets()
- break if /vt100/ =~ line
- end
+ tmp = open("while_tmp", "r")
+ assert_instance_of(File, tmp)
+
+ while line = tmp.gets()
+ break if /vt100/ =~ line
+ end
- assert(!tmp.eof?)
- assert_match(/vt100/, line)
- tmp.close
+ assert(!tmp.eof?)
+ assert_match(/vt100/, line)
+ tmp.close
- tmp = open(tmpfilename, "r")
- while line = tmp.gets()
- next if /vt100/ =~ line
- assert_no_match(/vt100/, line)
- end
- assert(tmp.eof?)
+ tmp = open("while_tmp", "r")
+ while line = tmp.gets()
+ next if /vt100/ =~ line
assert_no_match(/vt100/, line)
- tmp.close
+ end
+ assert(tmp.eof?)
+ assert_no_match(/vt100/, line)
+ tmp.close
- tmp = open(tmpfilename, "r")
- while line = tmp.gets()
- lastline = line
- line = line.gsub(/vt100/, 'VT100')
- if lastline != line
- line.gsub!('VT100', 'Vt100')
- redo
- end
- assert_no_match(/vt100/, line)
- assert_no_match(/VT100/, line)
+ tmp = open("while_tmp", "r")
+ while tmp.gets()
+ line = $_
+ gsub(/vt100/, 'VT100')
+ if $_ != line
+ $_.gsub!('VT100', 'Vt100')
+ redo
end
- assert(tmp.eof?)
- tmp.close
+ assert_no_match(/vt100/, $_)
+ assert_no_match(/VT100/, $_)
+ end
+ assert(tmp.eof?)
+ tmp.close
- sum=0
- for i in 1..10
- sum += i
- i -= 1
- if i > 0
- redo
- end
+ sum=0
+ for i in 1..10
+ sum += i
+ i -= 1
+ if i > 0
+ redo
end
- assert_equal(220, sum)
+ end
+ assert_equal(220, sum)
- tmp = open(tmpfilename, "r")
- while line = tmp.gets()
- break if 3
- assert_no_match(/vt100/, line)
- assert_no_match(/Amiga/, line)
- assert_no_match(/paper/, line)
- end
- tmp.close
+ tmp = open("while_tmp", "r")
+ while line = tmp.gets()
+ break if 3
+ assert_no_match(/vt100/, line)
+ assert_no_match(/Amiga/, line)
+ assert_no_match(/paper/, line)
+ end
+ tmp.close
- File.unlink tmpfilename or `/bin/rm -f "#{tmpfilename}"`
- assert(!File.exist?(tmpfilename))
- }
+ File.unlink "while_tmp" or `/bin/rm -f "while_tmp"`
+ assert(!File.exist?("while_tmp"))
end
def test_until
diff --git a/test/ruby/test_yield.rb b/test/ruby/test_yield.rb
deleted file mode 100644
index 2a2c6ae80f..0000000000
--- a/test/ruby/test_yield.rb
+++ /dev/null
@@ -1,366 +0,0 @@
-require 'test/unit'
-
-class TestRubyYield < Test::Unit::TestCase
-
- def test_ary_each
- ary = [1]
- ary.each {|a, b, c, d| assert_equal [1,nil,nil,nil], [a,b,c,d] }
- ary.each {|a, b, c| assert_equal [1,nil,nil], [a,b,c] }
- ary.each {|a, b| assert_equal [1,nil], [a,b] }
- ary.each {|a| assert_equal 1, a }
- end
-
- def test_hash_each
- h = {:a => 1}
- h.each do |k, v|
- assert_equal :a, k
- assert_equal 1, v
- end
- h.each do |kv|
- assert_equal [:a, 1], kv
- end
- end
-
- def test_yield_0
- assert_equal 1, iter0 { 1 }
- assert_equal 2, iter0 { 2 }
- end
-
- def iter0
- yield
- end
-
- def test_yield_1
- iter1([]) {|a, b| assert_equal [nil,nil], [a, b] }
- iter1([1]) {|a, b| assert_equal [1,nil], [a, b] }
- iter1([1, 2]) {|a, b| assert_equal [1,2], [a,b] }
- iter1([1, 2, 3]) {|a, b| assert_equal [1,2], [a,b] }
-
- iter1([]) {|a| assert_equal [], a }
- iter1([1]) {|a| assert_equal [1], a }
- iter1([1, 2]) {|a| assert_equal [1,2], a }
- iter1([1, 2, 3]) {|a| assert_equal [1,2,3], a }
- end
-
- def iter1(args)
- yield args
- end
-
- def test_yield2
- def iter2_1() yield 1, *[2, 3] end
- iter2_1 {|a, b, c| assert_equal [1,2,3], [a,b,c] }
- def iter2_2() yield 1, *[] end
- iter2_2 {|a, b, c| assert_equal [1,nil,nil], [a,b,c] }
- def iter2_3() yield 1, *[2] end
- iter2_3 {|a, b, c| assert_equal [1,2,nil], [a,b,c] }
- end
-
- def test_yield_nested
- [[1, [2, 3]]].each {|a, (b, c)|
- assert_equal [1,2,3], [a,b,c]
- }
- [[1, [2, 3]]].map {|a, (b, c)|
- assert_equal [1,2,3], [a,b,c]
- }
- end
-
- def test_with_enum
- obj = Object
- def obj.each
- yield(*[])
- end
- obj.each{|*v| assert_equal([], [], '[ruby-dev:32392]')}
- obj.to_enum.each{|*v| assert_equal([], [], '[ruby-dev:32392]')}
- end
-
- def block_args_unleashed
- yield(1,2,3,4,5)
- end
-
- def test_block_args_unleashed
- r = block_args_unleashed {|a,b=1,*c,d,e|
- [a,b,c,d,e]
- }
- assert_equal([1,2,[3],4,5], r, "[ruby-core:19485]")
- end
-end
-
-require_relative 'sentence'
-class TestRubyYieldGen < Test::Unit::TestCase
- Syntax = {
- :exp => [["0"],
- ["nil"],
- ["false"],
- ["[]"],
- ["[",:exps,"]"]],
- :exps => [[:exp],
- [:exp,",",:exps]],
- :opt_block_param => [[],
- [:block_param_def]],
- :block_param_def => [['|', '|'],
- ['|', :block_param, '|']],
- :block_param => [[:f_arg, ",", :f_rest_arg, :opt_f_block_arg],
- [:f_arg, ","],
- [:f_arg, ',', :f_rest_arg, ",", :f_arg, :opt_f_block_arg],
- [:f_arg, :opt_f_block_arg],
- [:f_rest_arg, :opt_f_block_arg],
- [:f_rest_arg, ',', :f_arg, :opt_f_block_arg],
- [:f_block_arg]],
- :f_arg => [[:f_arg_item],
- [:f_arg, ',', :f_arg_item]],
- :f_rest_arg => [['*', "var"],
- ['*']],
- :opt_f_block_arg => [[',', :f_block_arg],
- []],
- :f_block_arg => [['&', 'var']],
- :f_arg_item => [[:f_norm_arg],
- ['(', :f_margs, ')']],
- :f_margs => [[:f_marg_list],
- [:f_marg_list, ',', '*', :f_norm_arg],
- [:f_marg_list, ',', '*', :f_norm_arg, ',', :f_marg_list],
- [:f_marg_list, ',', '*'],
- [:f_marg_list, ',', '*', ',', :f_marg_list],
- [ '*', :f_norm_arg],
- [ '*', :f_norm_arg, ',', :f_marg_list],
- [ '*'],
- [ '*', ',', :f_marg_list]],
- :f_marg_list => [[:f_marg],
- [:f_marg_list, ',', :f_marg]],
- :f_marg => [[:f_norm_arg],
- ['(', :f_margs, ')']],
- :f_norm_arg => [['var']],
-
- :command_args => [[:open_args]],
- :open_args => [[' ',:call_args],
- ['(', ')'],
- ['(', :call_args2, ')']],
- :call_args => [[:command],
- [ :args, :opt_block_arg],
- [ :assocs, :opt_block_arg],
- [ :args, ',', :assocs, :opt_block_arg],
- [ :block_arg]],
- :call_args2 => [[:arg, ',', :args, :opt_block_arg],
- [:arg, ',', :block_arg],
- [ :assocs, :opt_block_arg],
- [:arg, ',', :assocs, :opt_block_arg],
- [:arg, ',', :args, ',', :assocs, :opt_block_arg],
- [ :block_arg]],
-
- :command_args_noblock => [[:open_args_noblock]],
- :open_args_noblock => [[' ',:call_args_noblock],
- ['(', ')'],
- ['(', :call_args2_noblock, ')']],
- :call_args_noblock => [[:command],
- [ :args],
- [ :assocs],
- [ :args, ',', :assocs]],
- :call_args2_noblock => [[:arg, ',', :args],
- [ :assocs],
- [:arg, ',', :assocs],
- [:arg, ',', :args, ',', :assocs]],
-
- :command => [],
- :args => [[:arg],
- ["*",:arg],
- [:args,",",:arg],
- [:args,",","*",:arg]],
- :arg => [[:exp]],
- :assocs => [[:assoc],
- [:assocs, ',', :assoc]],
- :assoc => [[:arg, '=>', :arg],
- ['label', ':', :arg]],
- :opt_block_arg => [[',', :block_arg],
- []],
- :block_arg => [['&', :arg]],
- #:test => [['def m() yield', :command_args_noblock, ' end; r = m {', :block_param_def, 'vars', '}; undef m; r']]
- :test_proc => [['def m() yield', :command_args_noblock, ' end; r = m {', :block_param_def, 'vars', '}; undef m; r']],
- :test_lambda => [['def m() yield', :command_args_noblock, ' end; r = m(&lambda {', :block_param_def, 'vars', '}); undef m; r']],
- :test_enum => [['o = Object.new; def o.each() yield', :command_args_noblock, ' end; r1 = r2 = nil; o.each {|*x| r1 = x }; o.to_enum.each {|*x| r2 = x }; [r1, r2]']]
- }
-
- def rename_var(obj)
- vars = []
- r = obj.subst('var') {
- var = "v#{vars.length}"
- vars << var
- var
- }
- return r, vars
- end
-
- def split_by_comma(ary)
- return [] if ary.empty?
- result = [[]]
- ary.each {|e|
- if e == ','
- result << []
- else
- result.last << e
- end
- }
- result
- end
-
- def emu_return_args(*vs)
- vs
- end
-
- def emu_eval_args(args)
- if args.last == []
- args = args[0...-1]
- end
- code = "emu_return_args #{args.map {|a| a.join('') }.join(",")}"
- eval code
- end
-
- def emu_bind_single(arg, param, result_binding)
- #p [:emu_bind_single, arg, param]
- if param.length == 1 && String === param[0] && /\A[a-z0-9]+\z/ =~ param[0]
- result_binding[param[0]] = arg
- elsif param.length == 1 && Array === param[0] && param[0][0] == '(' && param[0][-1] == ')'
- arg = [arg] unless Array === arg
- emu_bind_params(arg, split_by_comma(param[0][1...-1]), false, result_binding)
- else
- raise "unexpected param: #{param.inspect}"
- end
- result_binding
- end
-
- def emu_bind_params(args, params, islambda, result_binding={})
- #p [:emu_bind_params, args, params]
- if params.last == [] # extra comma
- params.pop
- end
-
- star_index = nil
- params.each_with_index {|par, i|
- star_index = i if par[0] == '*'
- }
-
- if islambda
- if star_index
- if args.length < params.length - 1
- throw :emuerror, ArgumentError
- end
- else
- if args.length != params.length
- throw :emuerror, ArgumentError
- end
- end
- end
-
- # TRICK #2 : adjust mismatch on number of arguments
- if star_index
- pre_params = params[0...star_index]
- rest_param = params[star_index]
- post_params = params[(star_index+1)..-1]
- pre_params.each {|par| emu_bind_single(args.shift, par, result_binding) }
- if post_params.length <= args.length
- post_params.reverse_each {|par| emu_bind_single(args.pop, par, result_binding) }
- else
- post_params.each {|par| emu_bind_single(args.shift, par, result_binding) }
- end
- if rest_param != ['*']
- emu_bind_single(args, rest_param[1..-1], result_binding)
- end
- else
- params.each_with_index {|par, i|
- emu_bind_single(args[i], par, result_binding)
- }
- end
-
- #p [args, params, result_binding]
-
- result_binding
- end
-
- def emu_bind(t, islambda)
- #puts
- #p t
- command_args_noblock = t[1]
- block_param_def = t[3]
- command_args_noblock = command_args_noblock.expand {|a| !(a[0] == '[' && a[-1] == ']') }
- block_param_def = block_param_def.expand {|a| !(a[0] == '(' && a[-1] == ')') }
-
- if command_args_noblock.to_a[0] == ' '
- args = command_args_noblock.to_a[1..-1]
- elsif command_args_noblock.to_a[0] == '(' && command_args_noblock.to_a[-1] == ')'
- args = command_args_noblock.to_a[1...-1]
- else
- raise "unexpected command_args_noblock: #{command_args_noblock.inspect}"
- end
- args = emu_eval_args(split_by_comma(args))
-
- params = block_param_def.to_a[1...-1]
- params = split_by_comma(params)
-
- #p [:emu0, args, params]
-
- result_binding = {}
-
- if params.last && params.last[0] == '&'
- result_binding[params.last[1]] = nil
- params.pop
- end
-
- if !islambda
- # TRICK #1 : single array argument is expanded if there are two or more params.
- # * block parameter is not counted.
- # * extra comma after single param forces the expansion.
- if args.length == 1 && Array === args[0] && 1 < params.length
- args = args[0]
- end
- end
-
- emu_bind_params(args, params, islambda, result_binding)
- #p result_binding
- result_binding
- end
-
- def emu(t, vars, islambda)
- catch(:emuerror) {
- emu_binding = emu_bind(t, islambda)
- vars.map {|var| emu_binding.fetch(var, "NOVAL") }
- }
- end
-
- def check_nofork(t, islambda=false)
- t, vars = rename_var(t)
- t = t.subst('vars') { " [#{vars.join(",")}]" }
- emu_values = emu(t, vars, islambda)
- s = t.to_s
- #print "#{s}\t\t"
- #STDOUT.flush
- begin
- eval_values = eval(s)
- rescue ArgumentError
- eval_values = ArgumentError
- end
- #success = emu_values == eval_values ? 'succ' : 'fail'
- #puts "eval:#{vs_ev.inspect[1...-1].delete(' ')}\temu:#{vs_emu.inspect[1...-1].delete(' ')}\t#{success}"
- assert_equal(emu_values, eval_values, s)
- end
-
- def test_yield
- syntax = Sentence.expand_syntax(Syntax)
- Sentence.each(syntax, :test_proc, 4) {|t|
- check_nofork(t)
- }
- end
-
- def test_yield_lambda
- syntax = Sentence.expand_syntax(Syntax)
- Sentence.each(syntax, :test_lambda, 4) {|t|
- check_nofork(t, true)
- }
- end
-
- def test_yield_enum
- syntax = Sentence.expand_syntax(Syntax)
- Sentence.each(syntax, :test_enum, 4) {|t|
- r1, r2 = eval(t.to_s)
- assert_equal(r1, r2, "#{t}")
- }
- end
-
-end
diff --git a/test/ruby/ut_eof.rb b/test/ruby/ut_eof.rb
index b7219ddb51..e6f6eddd6f 100644
--- a/test/ruby/ut_eof.rb
+++ b/test/ruby/ut_eof.rb
@@ -6,8 +6,8 @@ module TestEOF
assert_equal("", f.read(0))
assert_equal("", f.read(0))
assert_equal("", f.read)
- assert_equal("", f.read(0))
- assert_equal("", f.read(0))
+ assert_nil(f.read(0))
+ assert_nil(f.read(0))
}
open_file("") {|f|
assert_nil(f.read(1))
@@ -43,8 +43,8 @@ module TestEOF
assert_equal("" , f.read(0))
assert_equal("" , f.read(0))
assert_equal("", f.read)
- assert_equal("", f.read(0))
- assert_equal("", f.read(0))
+ assert_nil(f.read(0))
+ assert_nil(f.read(0))
}
open_file("a") {|f|
assert_equal("a", f.read(1))
@@ -69,7 +69,7 @@ module TestEOF
}
open_file("a") {|f|
assert_equal("a", f.read)
- assert_equal("", f.read(0))
+ assert_nil(f.read(0))
}
open_file("a") {|f|
s = "x"
@@ -109,7 +109,7 @@ module TestEOF
assert_equal(10, f.pos)
assert_equal("", f.read(0))
assert_equal("", f.read)
- assert_equal("", f.read(0))
+ assert_nil(f.read(0))
assert_equal("", f.read)
}
end
diff --git a/test/rubygems/bogussources.rb b/test/rubygems/bogussources.rb
deleted file mode 100644
index 008e3a1de5..0000000000
--- a/test/rubygems/bogussources.rb
+++ /dev/null
@@ -1,8 +0,0 @@
-#--
-# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
-# All rights reserved.
-# See LICENSE.txt for permissions.
-#++
-
-require 'rubygems'
-Gem.use_paths("test/mock/gems")
diff --git a/test/rubygems/data/gem-private_key.pem b/test/rubygems/data/gem-private_key.pem
deleted file mode 100644
index 3e4be4cd9a..0000000000
--- a/test/rubygems/data/gem-private_key.pem
+++ /dev/null
@@ -1,27 +0,0 @@
------BEGIN RSA PRIVATE KEY-----
-MIIEpQIBAAKCAQEAz0tTOtsJuHDKAEXrQx0f6DUEzBEUTSLR1fk0iEHsY9rDCQxm
-sw5Bf2UnVhdD03B4/XzIK+pat2CMQc37/vLIBuVgS7g/fzatGiM0m5rAHtycr0XU
-8Ek6zjx4iSv70OLjybY+/utHCEc838awGDMCFR21jYxgATPVwqAIyasvwbKh/Vhw
-uErFPqT9G8BKTHsaX+H+ADIRH001OmWkjB6EyjF05114kNMa0+2C7daV9hoBL3md
-hCt6zOGcapl/9LkGxhcNEUB/So16V1ZQldg9macGyWktyNTSfctlF+f8okAmicG3
-XIwaW8UTmjFCmvDs/h1R/uKpe2IOHz87n29d2QIDAQABAoIBAQCR6n/nyg+JmTtX
-/d+hGns/RTLfQpZ7xarXZ9gmoeD4WSE42VXhbIOGXXnXDAFecKl6Jb/xycGZm4if
-OZPM3rEWyZeDNWrc7WvkHiwF7GSYVMqmRg2iJqoSSla+mAtl+pBFiNfHMW6K0Tp0
-erOyFRW+L2+A9/MMZaRun6AP9URkn0jz2kwmMFf+6szmzVn6fPFzZDRI+hEeaDmi
-LBzSrfrddrIBX+xGEoBj6RmfnKBCSUVSSxOauYjd4mVjVYxvMH4SV1hXDUS5GPl5
-MbCiBb7bpNIg/8ljMoRrQiqk0XwwS7MaCqPtMhUtpSmC/zSjAfmoN7AOc/Xh69cQ
-OCMNZH9BAoGBAPBlsuuU6fg0gVTKDdR12jHx03uRRt8/nPxHnpJkZCIh9XKh1LtY
-bkumi9HZpp3mzDiaGg/rwfCwNckKx8NLhICLgkric6ClrKftxTu6C8tBAb5YDi6u
-74KYnV8lMY/unzBtIloPgM3uluS292POmrWZpKwhvHLD71MewzMor5HFAoGBANy/
-mwsBs8i3Gzk8Twjq8effhPpE7kpxhC7bhwmjX3q41EjQWDT8M6xb1P9dRSsCIebi
-kqP1yhl27dJpA8r5WqE/z89xhBvObAGRv41eXxOI0LaH2k5lJQrUeSC+51dy+BEB
-T3GXD4C5ezZHQ8Wz/oL73uikrfhD+AqOZT2YbMEFAoGBAJvWEWpOGm3f+4bvhI+Z
-5lxCG4oa3wqRvj58XvsfQRovUWGCLtlTtgwsZq8enLf3iaOXohV4Czzvva4Z4u1i
-4v5BcbEBo1scixRBOn5BWKvl9C9j/a2dkX3jWQD4p2xaj69gz8f6DNFyPTb+tNhq
-cjgO5YUASZ1MDrSfWIKteULRAoGAZkZv8x2KyofrmQ0UITGZerDYz4t4TA1kDMGx
-QwnqhtVzpXjCJWpkFotFmDsCfPaz9mErR8PtKvcrIL1/AF+fWe5Sve3+I1P0PpXk
-hf8fVdGhwbAXuRKrouTmagGI9b9Sp65PvHUcvasyJufFwqeuV8mScX87CzeSiHGI
-/ozMdnECgYEAq4+losrhe0DEmiC9zVPvwRXjbSixDsSJxHfOcqIsZqhUgBiZ4TJD
-SrkuukrMZib6BAD+PtCJS1TBbJyyvL3QecizhHSIh3ZnT0HnaRPatLEYmU65+3kE
-kTqL4ik92bJnnWowy677sydl1lzBJDVa9ZlTs7BFSd8y/0DZaUxGg2I=
------END RSA PRIVATE KEY-----
diff --git a/test/rubygems/data/gem-public_cert.pem b/test/rubygems/data/gem-public_cert.pem
deleted file mode 100644
index 885bf7f369..0000000000
--- a/test/rubygems/data/gem-public_cert.pem
+++ /dev/null
@@ -1,20 +0,0 @@
------BEGIN CERTIFICATE-----
-MIIDNjCCAh6gAwIBAgIBADANBgkqhkiG9w0BAQUFADBBMREwDwYDVQQDDAhydWJ5
-Z2VtczEXMBUGCgmSJomT8ixkARkWB2V4YW1wbGUxEzARBgoJkiaJk/IsZAEZFgNj
-b20wHhcNMDcwODAyMDMyNTQyWhcNMDgwODAxMDMyNTQyWjBBMREwDwYDVQQDDAhy
-dWJ5Z2VtczEXMBUGCgmSJomT8ixkARkWB2V4YW1wbGUxEzARBgoJkiaJk/IsZAEZ
-FgNjb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDPS1M62wm4cMoA
-RetDHR/oNQTMERRNItHV+TSIQexj2sMJDGazDkF/ZSdWF0PTcHj9fMgr6lq3YIxB
-zfv+8sgG5WBLuD9/Nq0aIzSbmsAe3JyvRdTwSTrOPHiJK/vQ4uPJtj7+60cIRzzf
-xrAYMwIVHbWNjGABM9XCoAjJqy/BsqH9WHC4SsU+pP0bwEpMexpf4f4AMhEfTTU6
-ZaSMHoTKMXTnXXiQ0xrT7YLt1pX2GgEveZ2EK3rM4ZxqmX/0uQbGFw0RQH9KjXpX
-VlCV2D2ZpwbJaS3I1NJ9y2UX5/yiQCaJwbdcjBpbxROaMUKa8Oz+HVH+4ql7Yg4f
-Pzufb13ZAgMBAAGjOTA3MAkGA1UdEwQCMAAwCwYDVR0PBAQDAgSwMB0GA1UdDgQW
-BBRYTAoj4cn8CWZMHFnHGQgoO5jyFTANBgkqhkiG9w0BAQUFAAOCAQEATRrJC05l
-dOmx67Sy3bU+AVXkOr7B9nn2Myqo9uSIAncPoElN6aHr/Q8wOOjtok4r0JcHPe1e
-eotDCZUE1Jkl13Tpv26rOfOOUHtGlyAIAtpsUGOraaJkSut4WKLr1/KckyAAEtgP
-c13A0s0mEiWFRuYxIdEi54561pTT2qQBE/DUPGoYD5rUg9XYAlSovMMwG99Oca7L
-cI6vCymr1bzzddExoywBNOy0fbBT62I3ICBGbH5yOVVKVmlxeo2Zp10FCj0kDrnq
-OuMJSDr5I2XPYqoC+W4YSbwn55o2jGIUX1lOq2Hvj4tFgSxlnJZn0tUhBfR3gSOn
-IFnrqu8PlZsLFw==
------END CERTIFICATE-----
diff --git a/test/rubygems/fake_certlib/openssl.rb b/test/rubygems/fake_certlib/openssl.rb
deleted file mode 100644
index 948110f078..0000000000
--- a/test/rubygems/fake_certlib/openssl.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-#--
-# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
-# All rights reserved.
-# See LICENSE.txt for permissions.
-#++
-
-fail LoadError, "no such file to load -- openssl"
diff --git a/test/rubygems/functional.rb b/test/rubygems/functional.rb
deleted file mode 100644
index 98e7cf6661..0000000000
--- a/test/rubygems/functional.rb
+++ /dev/null
@@ -1,99 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
-# All rights reserved.
-# See LICENSE.txt for permissions.
-#++
-
-require 'rubygems'
-require 'minitest/unit'
-require 'test/insure_session'
-require 'rubygems/format'
-require 'rubygems/command_manager'
-
-class FunctionalTest < MiniTest::Unit::TestCase
-
- def setup
- @gem_path = File.expand_path("bin/gem")
- lib_path = File.expand_path("lib")
- @ruby_options = "-I#{lib_path} -I."
- @verbose = false
- end
-
- def test_gem_help_options
- gem_nossl 'help options'
- assert_match(/Usage:/, @out, @err)
- assert_status
- end
-
- def test_gem_help_commands
- gem_nossl 'help commands'
- assert_match(/gem install/, @out)
- assert_status
- end
-
- def test_gem_no_args_shows_help
- gem_nossl
- assert_match(/Usage:/, @out)
- assert_status 1
- end
-
- # This test is disabled because of the insanely long time it takes
- # to time out.
- def xtest_bogus_source_hoses_up_remote_install_but_gem_command_gives_decent_error_message
- @ruby_options << " -rtest/bogussources"
- gem_nossl "install asdf --remote"
- assert_match(/error/im, @err)
- assert_status 1
- end
-
- def test_all_command_helps
- mgr = Gem::CommandManager.new
- mgr.command_names.each do |cmdname|
- gem_nossl "help #{cmdname}"
- assert_match(/Usage: gem #{cmdname}/, @out,
- "should see help for #{cmdname}")
- end
- end
-
- # :section: Help Methods
-
- # Run a gem command without the SSL library.
- def gem_nossl(options="")
- old_options = @ruby_options.dup
- @ruby_options << " -Itest/fake_certlib"
- gem(options)
- ensure
- @ruby_options = old_options
- end
-
- # Run a gem command with the SSL library.
- def gem_withssl(options="")
- gem(options)
- end
-
- # Run a gem command for the functional test.
- def gem(options="")
- shell = Session::Shell.new
- options = options + " --config-file missing_file" if options !~ /--config-file/
- command = "#{Gem.ruby} #{@ruby_options} #{@gem_path} #{options}"
- puts "\n\nCOMMAND: [#{command}]" if @verbose
- @out, @err = shell.execute command
- @status = shell.exit_status
- puts "STATUS: [#{@status}]" if @verbose
- puts "OUTPUT: [#{@out}]" if @verbose
- puts "ERROR: [#{@err}]" if @verbose
- puts "PWD: [#{Dir.pwd}]" if @verbose
- shell.close
- end
-
- private
-
- def assert_status(expected_status=0)
- assert_equal expected_status, @status
- end
-
-end
-
-MiniTest::Unit.autorun
-
diff --git a/test/rubygems/gem_installer_test_case.rb b/test/rubygems/gem_installer_test_case.rb
deleted file mode 100644
index 0f1a1e2e6a..0000000000
--- a/test/rubygems/gem_installer_test_case.rb
+++ /dev/null
@@ -1,97 +0,0 @@
-require File.join(File.expand_path(File.dirname(__FILE__)), 'gemutilities')
-require 'rubygems/installer'
-
-class Gem::Installer
- attr_accessor :gem_dir
-
- attr_writer :format
- attr_writer :gem_home
- attr_writer :env_shebang
- attr_writer :ignore_dependencies
- attr_writer :format_executable
- attr_writer :security_policy
- attr_writer :spec
- attr_writer :wrappers
-end
-
-class GemInstallerTestCase < RubyGemTestCase
-
- def setup
- super
-
- @spec = quick_gem 'a'
- @gem = File.join @tempdir, "#{@spec.full_name}.gem"
-
- @installer = util_installer @spec, @gem, @gemhome
-
- @user_spec = quick_gem 'b'
- @user_gem = File.join @tempdir, "#{@user_spec.full_name}.gem"
-
- @user_installer = util_installer @user_spec, @user_gem, Gem.user_dir
- @user_installer.gem_dir = File.join(Gem.user_dir, 'gems',
- @user_spec.full_name)
- end
-
- def util_gem_bindir(version = '2')
- File.join util_gem_dir(version), "bin"
- end
-
- def util_gem_dir(version = '2')
- File.join @gemhome, "gems", "a-#{version}" # HACK
- end
-
- def util_inst_bindir
- File.join @gemhome, "bin"
- end
-
- def util_make_exec(version = '2', shebang = "#!/usr/bin/ruby")
- @spec.executables = ["my_exec"]
-
- FileUtils.mkdir_p util_gem_bindir(version)
- exec_path = File.join util_gem_bindir(version), "my_exec"
- File.open exec_path, 'w' do |f|
- f.puts shebang
- end
- end
-
- def util_setup_gem(ui = @ui) # HACK fix use_ui to make this automatic
- @spec.files = File.join('lib', 'code.rb')
- @spec.executables << 'executable'
- @spec.extensions << File.join('ext', 'a', 'mkrf_conf.rb')
-
- Dir.chdir @tempdir do
- FileUtils.mkdir_p 'bin'
- FileUtils.mkdir_p 'lib'
- FileUtils.mkdir_p File.join('ext', 'a')
- File.open File.join('bin', 'executable'), 'w' do |f| f.puts '1' end
- File.open File.join('lib', 'code.rb'), 'w' do |f| f.puts '1' end
- File.open File.join('ext', 'a', 'mkrf_conf.rb'), 'w' do |f|
- f << <<-EOF
- File.open 'Rakefile', 'w' do |rf| rf.puts "task :default" end
- EOF
- end
-
- use_ui ui do
- FileUtils.rm @gem
- Gem::Builder.new(@spec).build
- end
- end
-
- @installer = Gem::Installer.new @gem
- end
-
- def util_installer(spec, gem_path, gem_home)
- util_build_gem spec
- FileUtils.mv File.join(@gemhome, 'cache', "#{spec.full_name}.gem"),
- @tempdir
-
- installer = Gem::Installer.new gem_path
- installer.gem_dir = util_gem_dir
- installer.gem_home = gem_home
- installer.spec = spec
-
- installer
- end
-
-end
-
diff --git a/test/rubygems/gem_package_tar_test_case.rb b/test/rubygems/gem_package_tar_test_case.rb
deleted file mode 100644
index 8a21df6de2..0000000000
--- a/test/rubygems/gem_package_tar_test_case.rb
+++ /dev/null
@@ -1,132 +0,0 @@
-require File.join(File.expand_path(File.dirname(__FILE__)), 'gemutilities')
-require 'rubygems/package'
-
-class TarTestCase < RubyGemTestCase
-
- def ASCIIZ(str, length)
- str + "\0" * (length - str.length)
- end
-
- def SP(s)
- s + " "
- end
-
- def SP_Z(s)
- s + " \0"
- end
-
- def Z(s)
- s + "\0"
- end
-
- def assert_headers_equal(expected, actual)
- expected = expected.to_s unless String === expected
- actual = actual.to_s unless String === actual
-
- fields = %w[
- name 100
- mode 8
- uid 8
- gid 8
- size 12
- mtime 12
- checksum 8
- typeflag 1
- linkname 100
- magic 6
- version 2
- uname 32
- gname 32
- devmajor 8
- devminor 8
- prefix 155
- ]
-
- offset = 0
-
- until fields.empty? do
- name = fields.shift
- length = fields.shift.to_i
-
- if name == "checksum" then
- chksum_off = offset
- offset += length
- next
- end
-
- assert_equal expected[offset, length], actual[offset, length],
- "Field #{name} of the tar header differs."
-
- offset += length
- end
-
- assert_equal expected[chksum_off, 8], actual[chksum_off, 8]
- end
-
- def calc_checksum(header)
- sum = header.unpack("C*").inject{|s,a| s + a}
- SP(Z(to_oct(sum, 6)))
- end
-
- def header(type, fname, dname, length, mode, checksum = nil)
- checksum ||= " " * 8
-
- arr = [ # struct tarfile_entry_posix
- ASCIIZ(fname, 100), # char name[100]; ASCII + (Z unless filled)
- Z(to_oct(mode, 7)), # char mode[8]; 0 padded, octal null
- Z(to_oct(0, 7)), # char uid[8]; ditto
- Z(to_oct(0, 7)), # char gid[8]; ditto
- Z(to_oct(length, 11)), # char size[12]; 0 padded, octal, null
- Z(to_oct(0, 11)), # char mtime[12]; 0 padded, octal, null
- checksum, # char checksum[8]; 0 padded, octal, null, space
- type, # char typeflag[1]; file: "0" dir: "5"
- "\0" * 100, # char linkname[100]; ASCII + (Z unless filled)
- "ustar\0", # char magic[6]; "ustar\0"
- "00", # char version[2]; "00"
- ASCIIZ("wheel", 32), # char uname[32]; ASCIIZ
- ASCIIZ("wheel", 32), # char gname[32]; ASCIIZ
- Z(to_oct(0, 7)), # char devmajor[8]; 0 padded, octal, null
- Z(to_oct(0, 7)), # char devminor[8]; 0 padded, octal, null
- ASCIIZ(dname, 155) # char prefix[155]; ASCII + (Z unless filled)
- ]
-
- format = "C100C8C8C8C12C12C8CC100C6C2C32C32C8C8C155"
- h = if RUBY_VERSION >= "1.9" then
- arr.join
- else
- arr = arr.join("").split(//).map{|x| x[0]}
- arr.pack format
- end
- ret = h + "\0" * (512 - h.size)
- assert_equal(512, ret.size)
- ret
- end
-
- def tar_dir_header(name, prefix, mode)
- h = header("5", name, prefix, 0, mode)
- checksum = calc_checksum(h)
- header("5", name, prefix, 0, mode, checksum)
- end
-
- def tar_file_header(fname, dname, mode, length)
- h = header("0", fname, dname, length, mode)
- checksum = calc_checksum(h)
- header("0", fname, dname, length, mode, checksum)
- end
-
- def to_oct(n, pad_size)
- "%0#{pad_size}o" % n
- end
-
- def util_entry(tar)
- io = TempIO.new tar
- header = Gem::Package::TarHeader.from io
- entry = Gem::Package::TarReader::Entry.new header, io
- end
-
- def util_dir_entry
- util_entry tar_dir_header("foo", "bar", 0)
- end
-
-end
-
diff --git a/test/rubygems/gemutilities.rb b/test/rubygems/gemutilities.rb
deleted file mode 100644
index 365b9d21f9..0000000000
--- a/test/rubygems/gemutilities.rb
+++ /dev/null
@@ -1,580 +0,0 @@
-#--
-# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
-# All rights reserved.
-# See LICENSE.txt for permissions.
-#++
-
-at_exit { $SAFE = 1 }
-
-$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
-
-if RUBY_VERSION > '1.9' then
- Gem::QuickLoader.load_full_rubygems_library
-else
- require 'rubygems'
-end
-require 'fileutils'
-begin
- gem 'minitest', '>= 1.3.1'
- require 'minitest/unit'
-rescue Gem::LoadError
- warn "Install minitest gem >= 1.3.1"
- raise
-end
-require 'tmpdir'
-require 'uri'
-require 'rubygems/package'
-require 'rubygems/test_utilities'
-require 'pp'
-
-begin
- gem 'rdoc'
-rescue Gem::LoadError
-end
-
-require 'rdoc/rdoc'
-
-require File.join(File.expand_path(File.dirname(__FILE__)), 'mockgemui')
-
-module Gem
- def self.searcher=(searcher)
- MUTEX.synchronize do @searcher = searcher end
- end
-
- def self.source_index=(si)
- @@source_index = si
- end
-
- def self.win_platform=(val)
- @@win_platform = val
- end
-
- module DefaultUserInteraction
- @ui = MockGemUi.new
- end
-end
-
-class RubyGemTestCase < MiniTest::Unit::TestCase
-
- include Gem::DefaultUserInteraction
-
- undef_method :default_test if instance_methods.include? 'default_test' or
- instance_methods.include? :default_test
-
- def setup
- super
-
- @ui = MockGemUi.new
- tmpdir = nil
- Dir.chdir Dir.tmpdir do tmpdir = Dir.pwd end # HACK OSX /private/tmp
- @tempdir = File.join tmpdir, "test_rubygems_#{$$}"
- @tempdir.untaint
- @gemhome = File.join @tempdir, "gemhome"
- @gemcache = File.join(@gemhome, "source_cache")
- @usrcache = File.join(@gemhome, ".gem", "user_cache")
- @latest_usrcache = File.join(@gemhome, ".gem", "latest_user_cache")
- @userhome = File.join @tempdir, 'userhome'
-
- Gem.ensure_gem_subdirectories @gemhome
-
- @orig_ENV_HOME = ENV['HOME']
- ENV['HOME'] = @userhome
- Gem.instance_variable_set :@user_home, nil
-
- FileUtils.mkdir_p @gemhome
- FileUtils.mkdir_p @userhome
-
- ENV['GEMCACHE'] = @usrcache
- Gem.use_paths(@gemhome)
- Gem.loaded_specs.clear
-
- Gem.configuration.verbose = true
- Gem.configuration.update_sources = true
-
- @gem_repo = "http://gems.example.com/"
- @uri = URI.parse @gem_repo
- Gem.sources.replace [@gem_repo]
-
- Gem::SpecFetcher.fetcher = nil
-
- @orig_BASERUBY = Gem::ConfigMap[:BASERUBY]
- Gem::ConfigMap[:BASERUBY] = Gem::ConfigMap[:ruby_install_name]
-
- @orig_arch = Gem::ConfigMap[:arch]
-
- if win_platform?
- util_set_arch 'i386-mswin32'
- else
- util_set_arch 'i686-darwin8.10.1'
- end
-
- @marshal_version = "#{Marshal::MAJOR_VERSION}.#{Marshal::MINOR_VERSION}"
-
- @private_key = File.expand_path File.join(File.dirname(__FILE__),
- 'private_key.pem')
- @public_cert = File.expand_path File.join(File.dirname(__FILE__),
- 'public_cert.pem')
-
- Gem.post_install_hooks.clear
- Gem.post_uninstall_hooks.clear
- Gem.pre_install_hooks.clear
- Gem.pre_uninstall_hooks.clear
-
- Gem.post_install do |installer|
- @post_install_hook_arg = installer
- end
-
- Gem.post_uninstall do |uninstaller|
- @post_uninstall_hook_arg = uninstaller
- end
-
- Gem.pre_install do |installer|
- @pre_install_hook_arg = installer
- end
-
- Gem.pre_uninstall do |uninstaller|
- @pre_uninstall_hook_arg = uninstaller
- end
- end
-
- def teardown
- Gem::ConfigMap[:BASERUBY] = @orig_BASERUBY
- Gem::ConfigMap[:arch] = @orig_arch
-
- if defined? Gem::RemoteFetcher then
- Gem::RemoteFetcher.fetcher = nil
- end
-
- FileUtils.rm_rf @tempdir
-
- ENV.delete 'GEMCACHE'
- ENV.delete 'GEM_HOME'
- ENV.delete 'GEM_PATH'
-
- Gem.clear_paths
-
- if @orig_ENV_HOME then
- ENV['HOME'] = @orig_ENV_HOME
- else
- ENV.delete 'HOME'
- end
- end
-
- def install_gem gem
- require 'rubygems/installer'
-
- use_ui MockGemUi.new do
- Dir.chdir @tempdir do
- Gem::Builder.new(gem).build
- end
- end
-
- gem = File.join(@tempdir, "#{gem.full_name}.gem").untaint
- Gem::Installer.new(gem, :wrappers => true).install
- end
-
- def mu_pp(obj)
- s = ''
- s = PP.pp obj, s
- s = s.force_encoding(Encoding.default_external) if defined? Encoding
- s.chomp
- end
-
- def prep_cache_files(lc)
- @usr_si ||= Gem::SourceIndex.new
- @usr_sice ||= Gem::SourceInfoCacheEntry.new @usr_si, 0
-
- @sys_si ||= Gem::SourceIndex.new
- @sys_sice ||= Gem::SourceInfoCacheEntry.new @sys_si, 0
-
- latest_si = Gem::SourceIndex.new
- latest_si.add_specs(*@sys_si.latest_specs)
- latest_sys_sice = Gem::SourceInfoCacheEntry.new latest_si, 0
-
- latest_si = Gem::SourceIndex.new
- latest_si.add_specs(*@usr_si.latest_specs)
- latest_usr_sice = Gem::SourceInfoCacheEntry.new latest_si, 0
-
- [ [lc.system_cache_file, @sys_sice],
- [lc.latest_system_cache_file, latest_sys_sice],
- [lc.user_cache_file, @usr_sice],
- [lc.latest_user_cache_file, latest_usr_sice],
- ].each do |filename, data|
- FileUtils.mkdir_p File.dirname(filename).untaint
-
- open filename.dup.untaint, 'wb' do |f|
- f.write Marshal.dump({ @gem_repo => data })
- end
- end
- end
-
- def read_cache(path)
- open path.dup.untaint, 'rb' do |io|
- Marshal.load io.read
- end
- end
-
- def read_binary(path)
- Gem.read_binary path
- end
-
- def write_file(path)
- path = File.join(@gemhome, path)
- dir = File.dirname path
- FileUtils.mkdir_p dir
-
- open path, 'wb' do |io|
- yield io
- end
-
- path
- end
-
- def quick_gem(gemname, version='2')
- require 'rubygems/specification'
-
- spec = Gem::Specification.new do |s|
- s.platform = Gem::Platform::RUBY
- s.name = gemname
- s.version = version
- s.author = 'A User'
- s.email = 'example@example.com'
- s.homepage = 'http://example.com'
- s.has_rdoc = true
- s.summary = "this is a summary"
- s.description = "This is a test description"
-
- yield(s) if block_given?
- end
-
- path = File.join "specifications", "#{spec.full_name}.gemspec"
- written_path = write_file path do |io|
- io.write(spec.to_ruby)
- end
-
- spec.loaded_from = written_path
-
- Gem.source_index.add_spec spec
-
- return spec
- end
-
- def util_build_gem(spec)
- dir = File.join(@gemhome, 'gems', spec.full_name)
- FileUtils.mkdir_p dir
-
- Dir.chdir dir do
- spec.files.each do |file|
- next if File.exist? file
- FileUtils.mkdir_p File.dirname(file)
- File.open file, 'w' do |fp| fp.puts "# #{file}" end
- end
-
- use_ui MockGemUi.new do
- Gem::Builder.new(spec).build
- end
-
- FileUtils.mv "#{spec.full_name}.gem",
- File.join(@gemhome, 'cache', "#{spec.original_name}.gem")
- end
- end
-
- def util_clear_gems
- FileUtils.rm_r File.join(@gemhome, 'gems')
- FileUtils.rm_r File.join(@gemhome, 'specifications')
- Gem.source_index.refresh!
- end
-
- def util_gem(name, version, &block)
- spec = quick_gem(name, version, &block)
-
- util_build_gem spec
-
- cache_file = File.join @tempdir, 'gems', "#{spec.original_name}.gem"
- FileUtils.mv File.join(@gemhome, 'cache', "#{spec.original_name}.gem"),
- cache_file
- FileUtils.rm File.join(@gemhome, 'specifications',
- "#{spec.full_name}.gemspec")
-
- spec.loaded_from = nil
- spec.loaded = false
-
- [spec, cache_file]
- end
-
- def util_gzip(data)
- out = StringIO.new
-
- Zlib::GzipWriter.wrap out do |io|
- io.write data
- end
-
- out.string
- end
-
- def util_make_gems(prerelease = false)
- @a1 = quick_gem 'a', '1' do |s|
- s.files = %w[lib/code.rb]
- s.require_paths = %w[lib]
- s.date = Gem::Specification::TODAY - 86400
- s.homepage = 'http://a.example.com'
- s.email = %w[example@example.com example2@example.com]
- s.authors = %w[Example Example2]
- s.description = <<-DESC
-This line is really, really long. So long, in fact, that it is more than eighty characters long! The purpose of this line is for testing wrapping behavior because sometimes people don't wrap their text to eighty characters. Without the wrapping, the text might not look good in the RSS feed.
-
-Also, a list:
- * An entry that's actually kind of sort
- * an entry that's really long, which will probably get wrapped funny. That's ok, somebody wasn't thinking straight when they made it more than eighty characters.
- DESC
- end
-
- init = proc do |s|
- s.files = %w[lib/code.rb]
- s.require_paths = %w[lib]
- end
-
- @a2 = quick_gem('a', '2', &init)
- @a3a = quick_gem('a', '3.a', &init)
- @a_evil9 = quick_gem('a_evil', '9', &init)
- @b2 = quick_gem('b', '2', &init)
- @c1_2 = quick_gem('c', '1.2', &init)
- @pl1 = quick_gem 'pl', '1' do |s| # l for legacy
- s.files = %w[lib/code.rb]
- s.require_paths = %w[lib]
- s.platform = Gem::Platform.new 'i386-linux'
- s.instance_variable_set :@original_platform, 'i386-linux'
- end
-
- if prerelease
- @a2_pre = quick_gem('a', '2.a', &init)
- write_file File.join(*%W[gems #{@a2_pre.original_name} lib code.rb]) do
- end
- util_build_gem @a2_pre
- end
-
- write_file File.join(*%W[gems #{@a1.original_name} lib code.rb]) do end
- write_file File.join(*%W[gems #{@a2.original_name} lib code.rb]) do end
- write_file File.join(*%W[gems #{@a3a.original_name} lib code.rb]) do end
- write_file File.join(*%W[gems #{@b2.original_name} lib code.rb]) do end
- write_file File.join(*%W[gems #{@c1_2.original_name} lib code.rb]) do end
- write_file File.join(*%W[gems #{@pl1.original_name} lib code.rb]) do end
-
- [@a1, @a2, @a3a, @a_evil9, @b2, @c1_2, @pl1].each do |spec|
- util_build_gem spec
- end
-
- FileUtils.rm_r File.join(@gemhome, 'gems', @pl1.original_name)
-
- Gem.source_index = nil
- end
-
- ##
- # Set the platform to +arch+
-
- def util_set_arch(arch)
- Gem::ConfigMap[:arch] = arch
- platform = Gem::Platform.new arch
-
- Gem.instance_variable_set :@platforms, nil
- Gem::Platform.instance_variable_set :@local, nil
-
- platform
- end
-
- def util_setup_fake_fetcher(prerelease = false)
- require 'zlib'
- require 'socket'
- require 'rubygems/remote_fetcher'
-
- @fetcher = Gem::FakeFetcher.new
-
- util_make_gems(prerelease)
-
- @all_gems = [@a1, @a2, @a3a, @a_evil9, @b2, @c1_2].sort
- @all_gem_names = @all_gems.map { |gem| gem.full_name }
-
- gem_names = [@a1.full_name, @a2.full_name, @a3a.full_name, @b2.full_name]
- @gem_names = gem_names.sort.join("\n")
-
- @source_index = Gem::SourceIndex.new
- @source_index.add_spec @a1
- @source_index.add_spec @a2
- @source_index.add_spec @a3a
- @source_index.add_spec @a_evil9
- @source_index.add_spec @c1_2
- @source_index.add_spec @a2_pre if prerelease
-
- Gem::RemoteFetcher.fetcher = @fetcher
- end
-
- def util_setup_source_info_cache(*specs)
- require 'rubygems/source_info_cache'
- require 'rubygems/source_info_cache_entry'
-
- specs = Hash[*specs.map { |spec| [spec.full_name, spec] }.flatten]
- si = Gem::SourceIndex.new specs
-
- sice = Gem::SourceInfoCacheEntry.new si, 0
- sic = Gem::SourceInfoCache.new
-
- sic.set_cache_data( { @gem_repo => sice } )
- sic.update
- sic.write_cache
- sic.reset_cache_data
-
- Gem::SourceInfoCache.instance_variable_set :@cache, sic
-
- si
- end
-
- def util_setup_spec_fetcher(*specs)
- specs = Hash[*specs.map { |spec| [spec.full_name, spec] }.flatten]
- si = Gem::SourceIndex.new specs
-
- spec_fetcher = Gem::SpecFetcher.fetcher
-
- spec_fetcher.specs[@uri] = []
- si.gems.sort_by { |_, spec| spec }.each do |_, spec|
- spec_tuple = [spec.name, spec.version, spec.original_platform]
- spec_fetcher.specs[@uri] << spec_tuple
- end
-
- spec_fetcher.latest_specs[@uri] = []
- si.latest_specs.sort.each do |spec|
- spec_tuple = [spec.name, spec.version, spec.original_platform]
- spec_fetcher.latest_specs[@uri] << spec_tuple
- end
-
- spec_fetcher.prerelease_specs[@uri] = []
- si.prerelease_specs.sort.each do |spec|
- spec_tuple = [spec.name, spec.version, spec.original_platform]
- spec_fetcher.prerelease_specs[@uri] << spec_tuple
- end
-
- (si.gems.merge si.prerelease_gems).sort_by { |_,spec| spec }.each do |_, spec|
- path = "#{@gem_repo}quick/Marshal.#{Gem.marshal_version}/#{spec.original_name}.gemspec.rz"
- data = Marshal.dump spec
- data_deflate = Zlib::Deflate.deflate data
- @fetcher.data[path] = data_deflate
- end
-
- si
- end
-
- def util_zip(data)
- Zlib::Deflate.deflate data
- end
-
- def self.win_platform?
- Gem.win_platform?
- end
-
- def win_platform?
- Gem.win_platform?
- end
-
- # Returns whether or not we're on a version of Ruby built with VC++ (or
- # Borland) versus Cygwin, Mingw, etc.
- #
- def self.vc_windows?
- RUBY_PLATFORM.match('mswin')
- end
-
- # Returns whether or not we're on a version of Ruby built with VC++ (or
- # Borland) versus Cygwin, Mingw, etc.
- #
- def vc_windows?
- RUBY_PLATFORM.match('mswin')
- end
-
- # Returns the make command for the current platform. For versions of Ruby
- # built on MS Windows with VC++ or Borland it will return 'nmake'. On all
- # other platforms, including Cygwin, it will return 'make'.
- #
- def self.make_command
- vc_windows? ? 'nmake' : 'make'
- end
-
- # Returns the make command for the current platform. For versions of Ruby
- # built on MS Windows with VC++ or Borland it will return 'nmake'. On all
- # other platforms, including Cygwin, it will return 'make'.
- #
- def make_command
- vc_windows? ? 'nmake' : 'make'
- end
-
- # Returns whether or not the nmake command could be found.
- #
- def nmake_found?
- system('nmake /? 1>NUL 2>&1')
- end
-
- # NOTE Allow tests to use a random (but controlled) port number instead of
- # a hardcoded one. This helps CI tools when running parallels builds on
- # the same builder slave.
- def self.process_based_port
- @@process_based_port ||= 8000 + $$ % 1000
- end
-
- def process_based_port
- self.class.process_based_port
- end
-
- def build_rake_in
- gem_ruby = Gem.ruby
- ruby = @@ruby
- Gem.module_eval {@ruby = ruby}
- env_rake = ENV["rake"]
- ENV["rake"] = @@rake
- yield @@rake
- ensure
- Gem.module_eval {@ruby = gem_ruby}
- if env_rake
- ENV["rake"] = env_rake
- else
- ENV.delete("rake")
- end
- end
-
- def self.rubybin
- if ruby = ENV["RUBY"]
- return ruby
- end
- ruby = "ruby"
- rubyexe = ruby+".exe"
- 3.times do
- if File.exist? ruby and File.executable? ruby and !File.directory? ruby
- return File.expand_path(ruby)
- end
- if File.exist? rubyexe and File.executable? rubyexe
- return File.expand_path(rubyexe)
- end
- ruby = File.join("..", ruby)
- end
- begin
- require "rbconfig"
- File.join(
- RbConfig::CONFIG["bindir"],
- RbConfig::CONFIG["ruby_install_name"] + RbConfig::CONFIG["EXEEXT"]
- )
- rescue LoadError
- "ruby"
- end
- end
-
- @@ruby = rubybin
- env_rake = ENV['rake']
- ruby19_rake = File.expand_path("../../../bin/rake", __FILE__)
- @@rake = if env_rake then
- ENV["rake"]
- elsif File.exist? ruby19_rake then
- @@ruby + " " + ruby19_rake
- else
- 'rake'
- end
-
-end
-
-MiniTest::Unit.autorun
-
diff --git a/test/rubygems/insure_session.rb b/test/rubygems/insure_session.rb
deleted file mode 100644
index e56f9abcb8..0000000000
--- a/test/rubygems/insure_session.rb
+++ /dev/null
@@ -1,51 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
-# All rights reserved.
-# See LICENSE.txt for permissions.
-#++
-
-
-require 'rubygems'
-
-def install_session
- path_to_gem = File.join("redist", "session.gem")
- begin
- Gem::Installer.new(path_to_gem).install
- rescue Errno::EACCES => ex
- puts
- puts "*****************************************************************"
- puts "Unable to install Gem 'Session'."
- puts "Reason: #{ex.message}"
- puts "Try running:"
- puts
- puts " gem -Li #{path_to_gem}"
- puts
- puts "with the appropriate admin privileges."
- puts "*****************************************************************"
- puts
- exit
- end
- gem 'session'
-end
-
-begin
- require 'session'
-rescue LoadError => e
- puts
- puts "Required Gem 'Session' missing."
- puts "We can attempt to install from the RubyGems Distribution,"
- puts "but installation may require admin privileges on your system."
- puts
- print "Install now from RubyGems distribution? [Yn]"
- answer = gets
- if(answer =~ /^y/i || answer =~ /^[^a-zA-Z0-9]$/) then
- install_session
- puts
- puts "Retry running the functional tests."
- exit(0)
- else
- puts "Test cancelled...quitting"
- exit(1)
- end
-end
diff --git a/test/rubygems/mockgemui.rb b/test/rubygems/mockgemui.rb
deleted file mode 100644
index d5624960df..0000000000
--- a/test/rubygems/mockgemui.rb
+++ /dev/null
@@ -1,64 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
-# All rights reserved.
-# See LICENSE.txt for permissions.
-#++
-
-
-require 'stringio'
-require 'rubygems/user_interaction'
-
-class MockGemUi < Gem::StreamUI
- class TermError < RuntimeError; end
-
- module TTY
-
- attr_accessor :tty
-
- def tty?()
- @tty = true unless defined?(@tty)
- @tty
- end
-
- end
-
- def initialize(input = "")
- ins = StringIO.new input
- outs = StringIO.new
- errs = StringIO.new
-
- ins.extend TTY
- outs.extend TTY
- errs.extend TTY
-
- super ins, outs, errs
-
- @terminated = false
- end
-
- def input
- @ins.string
- end
-
- def output
- @outs.string
- end
-
- def error
- @errs.string
- end
-
- def terminated?
- @terminated
- end
-
- def terminate_interaction(status=0)
- @terminated = true
-
- raise TermError unless status == 0
- raise Gem::SystemExitException, status
- end
-
-end
-
diff --git a/test/rubygems/private_key.pem b/test/rubygems/private_key.pem
deleted file mode 100644
index 95b3dc76d8..0000000000
--- a/test/rubygems/private_key.pem
+++ /dev/null
@@ -1,27 +0,0 @@
------BEGIN RSA PRIVATE KEY-----
-MIIEpAIBAAKCAQEAm24C6xixiAxO+i1f3L8XRMwrmLkt6BvT60mZ7g8HsklH3af7
-KNHA6vo/G6sujs2UsNO4HY8BTEneiVOXXWQlcsJ+Z5wEPlIu4zFueAmLefx+n9lE
-ulNIUDoyUenKX4spoMRnX8k4lXL05ho/6JFq0JdDY2DmAaQ4vvTz5mh9kZiybtHQ
-fzcpbA51uY+sjdQRCPDHyUUfh0SmWJlLYMwcBdVeCiGUPBLi+iP5x1btO4uiJK6Q
-IMaV1H3SUCYtKGQKl7qwFd8k8ZBcHYOtmK61tupg3vqWQc0em6SxPj5lws8+1MVK
-twBNIDx24jF4ntxBRNKMZ7FN5SHbobAgDYkPAQIDAQABAoIBAGQilgK8X/PUajVH
-clEXU3hhSV0VQHwfIYKeYms6h6zXBVPKW0dLC0zXeDztJgueasMZQ67XaPCrTpGO
-px/l2zJ6F1HM8/bqn4aDXDY9f/xRLYryQRMBgL8fHzgitNylHWaT4j2Vt7yg2SI9
-mxrMRNKqASJPVR+Nm3l6+n9gpjVb99wEucWplPPHI6KhXLYPZOqSwt+zaH5roz3k
-UQmMs0Bs4hF1SzVl0n+KNoXHOwswVrmBWXgWvm2OhnwY2e26jfejc8toJc/ShAJ7
-C9exnrdimcgEKbd22Sum4G00CDYhcrG5LHHqkgwifcAEVctrvBZBZHGgpxlO8a8U
-eF2Vr7kCgYEAykdrBlzp7Fn9xzUInBQ3NXTTYAq51lpuJdmHQmPuTSY0buoHkd9f
-xbUCZ2qR9QAesrx4hI0qGLetc8IOKDoWx2rPepCCvO3Kx61o1SB5fAvBue03qVoq
-HqACX3Uk24Em8zAz9xuP13ETH/wU7sUbUxRHMCre6ZDmlxn4g5l+Nl8CgYEAxLVl
-22yBx0dfRr3UsHY9rxll2gIlnfnYfiJzq8wetzt/TfztRV5ILz7FyWqL5d7IoqkA
-fT2V4HAasRJASnKohwJe7z5M/H2ExwkGNFvY+jefb2CoUl5WouK9AlhbqBk3zmHi
-sY5GqQkAp/kHMntEin+sErJw6mkgAGdser3a9p8CgYEAqi31w++tunRnxw4+RRnY
-7Pdx0k6T1NxV6TAe1ONAHNY0rM/mOHqml65W7GzDiU1lhlh8SIB/VzZJDqfHw15D
-xdh94A7uf0bMILwrA4wDyTIW9Xa3Kpq57vQNqwPiU25QN69pOM+Ob+IpBfLOJafc
-+kOINOUMj5Kh/aQS6Zzci58CgYEAk24dlFKEBjbRCvU2FrfYTYcsljPru7ZJc2gg
-588J6m0WYf5CWy5pzbcviGFpzvSlzXv7GOLylQ+QgcxbETFUbDPzsT4xd0AgJwj1
-dIKuYgMUZOa94VZBer2TydEtiRS1heJJhKhM/1329u4nXceTvHYqIq1JAfeee48I
-eAoZtaMCgYBz1FjWFQnMTD5nmyPEEZneoBPAR5+9jwOps+IYOoHtazoMFszzd0qo
-JZW3Ihn9KRrVSxfFApKS/ZwjiZ+tJUk7DE/v/0l0sszefY7s8b0pL1lpeZSoL71e
-QoG1WLXUiDV3BRlmyOAF1h3p12KRTLgwubN51ajECwcs3QwE+ZT8Gg==
------END RSA PRIVATE KEY-----
diff --git a/test/rubygems/public_cert.pem b/test/rubygems/public_cert.pem
deleted file mode 100644
index 9b7c3d8e98..0000000000
--- a/test/rubygems/public_cert.pem
+++ /dev/null
@@ -1,20 +0,0 @@
------BEGIN CERTIFICATE-----
-MIIDNjCCAh6gAwIBAgIBADANBgkqhkiG9w0BAQUFADBBMRAwDgYDVQQDDAdkcmJy
-YWluMRgwFgYKCZImiZPyLGQBGRYIc2VnbWVudDcxEzARBgoJkiaJk/IsZAEZFgNu
-ZXQwHhcNMDcxMjIxMDIwNDE0WhcNMDgxMjIwMDIwNDE0WjBBMRAwDgYDVQQDDAdk
-cmJyYWluMRgwFgYKCZImiZPyLGQBGRYIc2VnbWVudDcxEzARBgoJkiaJk/IsZAEZ
-FgNuZXQwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCbbgLrGLGIDE76
-LV/cvxdEzCuYuS3oG9PrSZnuDweySUfdp/so0cDq+j8bqy6OzZSw07gdjwFMSd6J
-U5ddZCVywn5nnAQ+Ui7jMW54CYt5/H6f2US6U0hQOjJR6cpfiymgxGdfyTiVcvTm
-Gj/okWrQl0NjYOYBpDi+9PPmaH2RmLJu0dB/NylsDnW5j6yN1BEI8MfJRR+HRKZY
-mUtgzBwF1V4KIZQ8EuL6I/nHVu07i6IkrpAgxpXUfdJQJi0oZAqXurAV3yTxkFwd
-g62YrrW26mDe+pZBzR6bpLE+PmXCzz7UxUq3AE0gPHbiMXie3EFE0oxnsU3lIduh
-sCANiQ8BAgMBAAGjOTA3MAkGA1UdEwQCMAAwCwYDVR0PBAQDAgSwMB0GA1UdDgQW
-BBS5k4Z75VSpdM0AclG2UvzFA/VW5DANBgkqhkiG9w0BAQUFAAOCAQEAHagT4lfX
-kP/hDaiwGct7XPuVGbrOsKRVD59FF5kETBxEc9UQ1clKWngf8JoVuEoKD774dW19
-bU0GOVWO+J6FMmT/Cp7nuFJ79egMf/gy4gfUfQMuvfcr6DvZUPIs9P/TlK59iMYF
-DIOQ3DxdF3rMzztNUCizN4taVscEsjCcgW6WkUJnGdqlu3OHWpQxZBJkBTjPCoc6
-UW6on70SFPmAy/5Cq0OJNGEWBfgD9q7rrs/X8GGwUWqXb85RXnUVi/P8Up75E0ag
-14jEc90kN+C7oI/AGCBN0j6JnEtYIEJZibjjDJTSMWlUKKkj30kq7hlUC2CepJ4v
-x52qPcexcYZR7w==
------END CERTIFICATE-----
diff --git a/test/rubygems/rubygems_plugin.rb b/test/rubygems/rubygems_plugin.rb
deleted file mode 100644
index 269c3f10db..0000000000
--- a/test/rubygems/rubygems_plugin.rb
+++ /dev/null
@@ -1,16 +0,0 @@
-require 'rubygems/command_manager'
-
-class Gem::Commands::InterruptCommand < Gem::Command
-
- def initialize
- super('interrupt', 'Raises an Interrupt Exception', {})
- end
-
- def execute
- raise Interrupt, "Interrupt exception"
- end
-
-end
-
-Gem::CommandManager.instance.register_command :interrupt
-
diff --git a/test/rubygems/simple_gem.rb b/test/rubygems/simple_gem.rb
deleted file mode 100644
index a6f14bc3c7..0000000000
--- a/test/rubygems/simple_gem.rb
+++ /dev/null
@@ -1,72 +0,0 @@
-#--
-# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
-# All rights reserved.
-# See LICENSE.txt for permissions.
-#++
-
- SIMPLE_GEM = <<-GEMDATA
- MD5SUM = "e3701f9db765a2358aef94c40ded71c8"
- if $0 == __FILE__
- require 'optparse'
-
- options = {}
- ARGV.options do |opts|
- opts.on_tail("--help", "show this message") {puts opts; exit}
- opts.on('--dir=DIRNAME', "Installation directory for the Gem") {|options[:directory]|}
- opts.on('--force', "Force Gem to intall, bypassing dependency checks") {|options[:force]|}
- opts.on('--gen-rdoc', "Generate RDoc documentation for the Gem") {|options[:gen_rdoc]|}
- opts.parse!
- end
-
- require 'rubygems'
- @directory = options[:directory] || Gem.dir
- @force = options[:force]
-
- gem = Gem::Installer.new(__FILE__).install(@force, @directory)
- if options[:gen_rdoc]
- Gem::DocManager.new(gem).generate_rdoc
- end
-end
-
-__END__
---- !ruby/object:Gem::Specification
-rubygems_version: "1.0"
-name: testing
-version: !ruby/object:Gem::Version
- version: 1.2.3
-date: 2004-03-18 22:01:52.859121 -05:00
-platform:
-summary: This exercise the gem testing stuff.
-require_paths:
- - lib
-files:
- - lib/foo.rb
- - lib/test
- - lib/test.rb
- - lib/test/wow.rb
-autorequire: test
-test_suite_file: foo
-requirements:
- - a computer processor
----
--
- size: 109
- mode: 420
- path: lib/foo.rb
--
- size: 0
- mode: 420
- path: lib/test.rb
--
- size: 15
- mode: 420
- path: lib/test/wow.rb
----
-eJwVjDEKgDAUQ/eeIpsKguhY3ARPoHMp9quF0mL7e39/h5DwQpLpqz4TOqbC
-U42eO6WuYEvBntIhECuaaX1KqXXLmy2kAEc32szExK+PjyBAlpTZyK0N/Twu
-g1CKTjX9BGAj1w==
----
-eJwDAAAAAAE=
----
-eJwrKC0pVlAvzy9XyE3MU+cCACwiBP4=
- GEMDATA
diff --git a/test/rubygems/test_config.rb b/test/rubygems/test_config.rb
deleted file mode 100644
index d57bbe7353..0000000000
--- a/test/rubygems/test_config.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-#--
-# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
-# All rights reserved.
-# See LICENSE.txt for permissions.
-#++
-
-require File.join(File.expand_path(File.dirname(__FILE__)), 'gemutilities')
-require 'rbconfig'
-require 'rubygems'
-
-class TestConfig < RubyGemTestCase
-
- def test_datadir
- datadir = RbConfig::CONFIG['datadir']
- assert_equal "#{datadir}/xyz", RbConfig.datadir('xyz')
- end
-
-end
-
diff --git a/test/rubygems/test_gem.rb b/test/rubygems/test_gem.rb
deleted file mode 100644
index 3c5eed3a04..0000000000
--- a/test/rubygems/test_gem.rb
+++ /dev/null
@@ -1,673 +0,0 @@
-require File.join(File.expand_path(File.dirname(__FILE__)), 'gemutilities')
-require 'rubygems'
-require 'rubygems/gem_openssl'
-require 'rubygems/installer'
-require 'pathname'
-require 'tmpdir'
-
-class TestGem < RubyGemTestCase
-
- def setup
- super
-
- @additional = %w[a b].map { |d| File.join @tempdir, d }
- @default_dir_re = if RUBY_VERSION > '1.9' then
- %r|/.*?[Rr]uby.*?/[Gg]ems/[0-9.]+|
- else
- %r|/[Rr]uby/[Gg]ems/[0-9.]+|
- end
- end
-
- def test_self_all_load_paths
- util_make_gems
-
- expected = [
- File.join(@gemhome, *%W[gems #{@a1.full_name} lib]),
- File.join(@gemhome, *%W[gems #{@a2.full_name} lib]),
- File.join(@gemhome, *%W[gems #{@a3a.full_name} lib]),
- File.join(@gemhome, *%W[gems #{@a_evil9.full_name} lib]),
- File.join(@gemhome, *%W[gems #{@b2.full_name} lib]),
- File.join(@gemhome, *%W[gems #{@c1_2.full_name} lib]),
- File.join(@gemhome, *%W[gems #{@pl1.full_name} lib]),
- ]
-
- assert_equal expected, Gem.all_load_paths.sort
- end
-
- def test_self_available?
- util_make_gems
- assert(Gem.available?("a"))
- assert(Gem.available?("a", "1"))
- assert(Gem.available?("a", ">1"))
- assert(!Gem.available?("monkeys"))
- end
-
- def test_self_bin_path_bin_name
- util_exec_gem
- assert_equal @abin_path, Gem.bin_path('a', 'abin')
- end
-
- def test_self_bin_path_bin_name_version
- util_exec_gem
- assert_equal @abin_path, Gem.bin_path('a', 'abin', '4')
- end
-
- def test_self_bin_path_name
- util_exec_gem
- assert_equal @exec_path, Gem.bin_path('a')
- end
-
- def test_self_bin_path_name_version
- util_exec_gem
- assert_equal @exec_path, Gem.bin_path('a', nil, '4')
- end
-
- def test_self_bin_path_no_default_bin
- quick_gem 'a', '2' do |s|
- s.executables = ['exec']
- end
- assert_raises(Gem::Exception) do
- Gem.bin_path('a', '2')
- end
- end
-
- def test_self_bin_path_no_bin_file
- quick_gem 'a', '1'
- assert_raises(Gem::Exception) do
- Gem.bin_path('a', '1')
- end
- end
-
- def test_self_bin_path_with_spaces
- quick_gem 'sp ace', '3' do |s|
- s.executables = ['exec']
- end
- path = Gem.bin_path('sp ace', 'exec')
- assert_equal %w(" "), [path[0,1], path[-1,1]], "Path should be escaped"
- end
-
- def test_self_bin_path_not_found
- assert_raises(Gem::GemNotFoundException) do
- Gem.bin_path('non-existent')
- end
- end
-
- def test_self_bindir
- assert_equal File.join(@gemhome, 'bin'), Gem.bindir
- assert_equal File.join(@gemhome, 'bin'), Gem.bindir(Gem.dir)
- assert_equal File.join(@gemhome, 'bin'), Gem.bindir(Pathname.new(Gem.dir))
- end
-
- def test_self_bindir_default_dir
- default = Gem.default_dir
- bindir = if defined?(RUBY_FRAMEWORK_VERSION) then
- '/usr/bin'
- else
- RbConfig::CONFIG['bindir']
- end
-
- assert_equal bindir, Gem.bindir(default)
- assert_equal bindir, Gem.bindir(Pathname.new(default))
- end
-
- def test_self_clear_paths
- Gem.dir
- Gem.path
- searcher = Gem.searcher
- source_index = Gem.source_index
-
- Gem.clear_paths
-
- assert_equal nil, Gem.instance_variable_get(:@gem_home)
- assert_equal nil, Gem.instance_variable_get(:@gem_path)
- refute_equal searcher, Gem.searcher
- refute_equal source_index.object_id, Gem.source_index.object_id
- end
-
- def test_self_configuration
- expected = Gem::ConfigFile.new []
- Gem.configuration = nil
-
- assert_equal expected, Gem.configuration
- end
-
- def test_self_datadir
- foo = nil
-
- Dir.chdir @tempdir do
- FileUtils.mkdir_p 'data'
- File.open File.join('data', 'foo.txt'), 'w' do |fp|
- fp.puts 'blah'
- end
-
- foo = quick_gem 'foo' do |s| s.files = %w[data/foo.txt] end
- install_gem foo
- end
-
- Gem.source_index = nil
-
- gem 'foo'
-
- expected = File.join @gemhome, 'gems', foo.full_name, 'data', 'foo'
-
- assert_equal expected, Gem.datadir('foo')
- end
-
- def test_self_datadir_nonexistent_package
- assert_nil Gem.datadir('xyzzy')
- end
-
- def test_self_default_dir
- assert_match @default_dir_re, Gem.default_dir
- end
-
- def test_self_default_exec_format
- orig_RUBY_INSTALL_NAME = Gem::ConfigMap[:ruby_install_name]
- Gem::ConfigMap[:ruby_install_name] = 'ruby'
-
- assert_equal '%s', Gem.default_exec_format
- ensure
- Gem::ConfigMap[:ruby_install_name] = orig_RUBY_INSTALL_NAME
- end
-
- def test_self_default_exec_format_18
- orig_RUBY_INSTALL_NAME = Gem::ConfigMap[:ruby_install_name]
- Gem::ConfigMap[:ruby_install_name] = 'ruby18'
-
- assert_equal '%s18', Gem.default_exec_format
- ensure
- Gem::ConfigMap[:ruby_install_name] = orig_RUBY_INSTALL_NAME
- end
-
- def test_self_default_exec_format_jruby
- orig_RUBY_INSTALL_NAME = Gem::ConfigMap[:ruby_install_name]
- Gem::ConfigMap[:ruby_install_name] = 'jruby'
-
- assert_equal 'j%s', Gem.default_exec_format
- ensure
- Gem::ConfigMap[:ruby_install_name] = orig_RUBY_INSTALL_NAME
- end
-
- def test_self_default_sources
- assert_equal %w[http://gems.rubyforge.org/], Gem.default_sources
- end
-
- def test_self_dir
- assert_equal @gemhome, Gem.dir
- end
-
- def test_self_ensure_gem_directories
- FileUtils.rm_r @gemhome
- Gem.use_paths @gemhome
-
- Gem.ensure_gem_subdirectories @gemhome
-
- assert File.directory?(File.join(@gemhome, "cache"))
- end
-
- def test_self_ensure_gem_directories_missing_parents
- gemdir = File.join @tempdir, 'a/b/c/gemdir'
- FileUtils.rm_rf File.join(@tempdir, 'a') rescue nil
- refute File.exist?(File.join(@tempdir, 'a')),
- "manually remove #{File.join @tempdir, 'a'}, tests are broken"
- Gem.use_paths gemdir
-
- Gem.ensure_gem_subdirectories gemdir
-
- assert File.directory?("#{gemdir}/cache")
- end
-
- unless win_platform? then # only for FS that support write protection
- def test_self_ensure_gem_directories_write_protected
- gemdir = File.join @tempdir, "egd"
- FileUtils.rm_r gemdir rescue nil
- refute File.exist?(gemdir), "manually remove #{gemdir}, tests are broken"
- FileUtils.mkdir_p gemdir
- FileUtils.chmod 0400, gemdir
- Gem.use_paths gemdir
-
- Gem.ensure_gem_subdirectories gemdir
-
- refute File.exist?("#{gemdir}/cache")
- ensure
- FileUtils.chmod 0600, gemdir
- end
-
- def test_self_ensure_gem_directories_write_protected_parents
- parent = File.join(@tempdir, "egd")
- gemdir = "#{parent}/a/b/c"
-
- FileUtils.rm_r parent rescue nil
- refute File.exist?(parent), "manually remove #{parent}, tests are broken"
- FileUtils.mkdir_p parent
- FileUtils.chmod 0400, parent
- Gem.use_paths(gemdir)
-
- Gem.ensure_gem_subdirectories gemdir
-
- refute File.exist?("#{gemdir}/cache")
- ensure
- FileUtils.chmod 0600, parent
- end
- end
-
- def test_ensure_ssl_available
- orig_Gem_ssl_available = Gem.ssl_available?
-
- Gem.ssl_available = true
- Gem.ensure_ssl_available
-
- Gem.ssl_available = false
- e = assert_raises Gem::Exception do Gem.ensure_ssl_available end
- assert_equal 'SSL is not installed on this system', e.message
- ensure
- Gem.ssl_available = orig_Gem_ssl_available
- end
-
- def test_self_find_files
- discover_path = File.join 'lib', 'foo', 'discover.rb'
-
- foo1 = quick_gem 'foo', '1' do |s|
- s.files << discover_path
- end
-
- foo2 = quick_gem 'foo', '2' do |s|
- s.files << discover_path
- end
-
- path = File.join 'gems', foo1.full_name, discover_path
- write_file(path) { |fp| fp.puts "# #{path}" }
-
- path = File.join 'gems', foo2.full_name, discover_path
- write_file(path) { |fp| fp.puts "# #{path}" }
-
- @fetcher = Gem::FakeFetcher.new
- Gem::RemoteFetcher.fetcher = @fetcher
-
- Gem.source_index = util_setup_spec_fetcher foo1, foo2
-
- Gem.searcher = nil
-
- expected = [
- File.expand_path('foo/discover.rb', File.dirname(__FILE__)),
- File.join(foo2.full_gem_path, discover_path),
- File.join(foo1.full_gem_path, discover_path),
- ]
-
- assert_equal expected, Gem.find_files('foo/discover')
- end
-
- def test_self_latest_load_paths
- util_make_gems
-
- expected = [
- File.join(@gemhome, *%W[gems #{@a3a.full_name} lib]),
- File.join(@gemhome, *%W[gems #{@a_evil9.full_name} lib]),
- File.join(@gemhome, *%W[gems #{@b2.full_name} lib]),
- File.join(@gemhome, *%W[gems #{@c1_2.full_name} lib]),
- File.join(@gemhome, *%W[gems #{@pl1.full_name} lib]),
- ]
-
- assert_equal expected, Gem.latest_load_paths.sort
- end
-
- def test_self_loaded_specs
- foo = quick_gem 'foo'
- install_gem foo
- Gem.source_index = nil
-
- Gem.activate 'foo'
-
- assert_equal true, Gem.loaded_specs.keys.include?('foo')
- end
-
- def test_self_path
- assert_equal [Gem.dir], Gem.path
- end
-
- def test_self_path_default
- if defined? APPLE_GEM_HOME
- orig_APPLE_GEM_HOME = APPLE_GEM_HOME
- Object.send :remove_const, :APPLE_GEM_HOME
- end
- Gem.instance_variable_set :@gem_path, nil
-
- assert_equal [Gem.default_path, Gem.dir].flatten, Gem.path
- ensure
- Object.const_set :APPLE_GEM_HOME, orig_APPLE_GEM_HOME
- end
-
- unless win_platform?
- def test_self_path_APPLE_GEM_HOME
- Gem.clear_paths
- apple_gem_home = File.join @tempdir, 'apple_gem_home'
- Gem.const_set :APPLE_GEM_HOME, apple_gem_home
-
- assert_includes Gem.path, apple_gem_home
- ensure
- Gem.send :remove_const, :APPLE_GEM_HOME
- end
-
- def test_self_path_APPLE_GEM_HOME_GEM_PATH
- Gem.clear_paths
- ENV['GEM_PATH'] = @gemhome
- apple_gem_home = File.join @tempdir, 'apple_gem_home'
- Gem.const_set :APPLE_GEM_HOME, apple_gem_home
-
- refute Gem.path.include?(apple_gem_home)
- ensure
- Gem.send :remove_const, :APPLE_GEM_HOME
- end
- end
-
- def test_self_path_ENV_PATH
- Gem.send :set_paths, nil
- path_count = Gem.path.size
- Gem.clear_paths
-
- ENV['GEM_PATH'] = @additional.join(File::PATH_SEPARATOR)
-
- assert_equal @additional, Gem.path[0,2]
-
- assert_equal path_count + @additional.size, Gem.path.size,
- "extra path components: #{Gem.path[2..-1].inspect}"
- assert_equal Gem.dir, Gem.path.last
- end
-
- def test_self_path_duplicate
- Gem.clear_paths
- util_ensure_gem_dirs
- dirs = @additional + [@gemhome] + [File.join(@tempdir, 'a')]
-
- ENV['GEM_HOME'] = @gemhome
- ENV['GEM_PATH'] = dirs.join File::PATH_SEPARATOR
-
- assert_equal @gemhome, Gem.dir
-
- paths = [Gem.dir]
- assert_equal @additional + paths, Gem.path
- end
-
- def test_self_path_overlap
- Gem.clear_paths
-
- util_ensure_gem_dirs
- ENV['GEM_HOME'] = @gemhome
- ENV['GEM_PATH'] = @additional.join(File::PATH_SEPARATOR)
-
- assert_equal @gemhome, Gem.dir
-
- paths = [Gem.dir]
- assert_equal @additional + paths, Gem.path
- end
-
- def test_self_platforms
- assert_equal [Gem::Platform::RUBY, Gem::Platform.local], Gem.platforms
- end
-
- def test_self_prefix
- file_name = File.expand_path __FILE__
-
- prefix = File.dirname File.dirname(file_name)
- prefix = File.dirname prefix if File.basename(prefix) == 'test'
-
- assert_equal prefix, Gem.prefix
- end
-
- def test_self_prefix_libdir
- orig_libdir = Gem::ConfigMap[:libdir]
-
- file_name = File.expand_path __FILE__
- prefix = File.dirname File.dirname(file_name)
- prefix = File.dirname prefix if File.basename(prefix) == 'test'
-
- Gem::ConfigMap[:libdir] = prefix
-
- assert_nil Gem.prefix
- ensure
- Gem::ConfigMap[:libdir] = orig_libdir
- end
-
- def test_self_prefix_sitelibdir
- orig_sitelibdir = Gem::ConfigMap[:sitelibdir]
-
- file_name = File.expand_path __FILE__
- prefix = File.dirname File.dirname(file_name)
- prefix = File.dirname prefix if File.basename(prefix) == 'test'
-
- Gem::ConfigMap[:sitelibdir] = prefix
-
- assert_nil Gem.prefix
- ensure
- Gem::ConfigMap[:sitelibdir] = orig_sitelibdir
- end
-
- def test_self_refresh
- util_make_gems
-
- a1_spec = File.join @gemhome, "specifications", "#{@a1.full_name}.gemspec"
-
- FileUtils.mv a1_spec, @tempdir
-
- refute Gem.source_index.gems.include?(@a1.full_name)
-
- FileUtils.mv File.join(@tempdir, "#{@a1.full_name}.gemspec"), a1_spec
-
- Gem.refresh
-
- assert_includes Gem.source_index.gems, @a1.full_name
- assert_equal nil, Gem.instance_variable_get(:@searcher)
- end
-
- def test_self_required_location
- util_make_gems
-
- assert_equal File.join(@tempdir, *%w[gemhome gems c-1.2 lib code.rb]),
- Gem.required_location("c", "code.rb")
- assert_equal File.join(@tempdir, *%w[gemhome gems a-1 lib code.rb]),
- Gem.required_location("a", "code.rb", "< 2")
- assert_equal File.join(@tempdir, *%w[gemhome gems a-2 lib code.rb]),
- Gem.required_location("a", "code.rb", "= 2")
- end
-
- def test_self_ruby_escaping_spaces_in_path
- orig_ruby = Gem.ruby
- orig_bindir = Gem::ConfigMap[:bindir]
- orig_ruby_install_name = Gem::ConfigMap[:ruby_install_name]
- orig_exe_ext = Gem::ConfigMap[:EXEEXT]
-
- Gem::ConfigMap[:bindir] = "C:/Ruby 1.8/bin"
- Gem::ConfigMap[:ruby_install_name] = "ruby"
- Gem::ConfigMap[:EXEEXT] = ".exe"
- Gem.instance_variable_set("@ruby", nil)
-
- assert_equal "\"C:/Ruby 1.8/bin/ruby.exe\"", Gem.ruby
- ensure
- Gem.instance_variable_set("@ruby", orig_ruby)
- Gem::ConfigMap[:bindir] = orig_bindir
- Gem::ConfigMap[:ruby_install_name] = orig_ruby_install_name
- Gem::ConfigMap[:EXEEXT] = orig_exe_ext
- end
-
- def test_self_ruby_path_without_spaces
- orig_ruby = Gem.ruby
- orig_bindir = Gem::ConfigMap[:bindir]
- orig_ruby_install_name = Gem::ConfigMap[:ruby_install_name]
- orig_exe_ext = Gem::ConfigMap[:EXEEXT]
-
- Gem::ConfigMap[:bindir] = "C:/Ruby18/bin"
- Gem::ConfigMap[:ruby_install_name] = "ruby"
- Gem::ConfigMap[:EXEEXT] = ".exe"
- Gem.instance_variable_set("@ruby", nil)
-
- assert_equal "C:/Ruby18/bin/ruby.exe", Gem.ruby
- ensure
- Gem.instance_variable_set("@ruby", orig_ruby)
- Gem::ConfigMap[:bindir] = orig_bindir
- Gem::ConfigMap[:ruby_install_name] = orig_ruby_install_name
- Gem::ConfigMap[:EXEEXT] = orig_exe_ext
- end
-
- def test_self_ruby_version_1_8_5
- util_set_RUBY_VERSION '1.8.5'
-
- assert_equal Gem::Version.new('1.8.5'), Gem.ruby_version
- ensure
- util_restore_RUBY_VERSION
- end
-
- def test_self_ruby_version_1_8_6p287
- util_set_RUBY_VERSION '1.8.6', 287
-
- assert_equal Gem::Version.new('1.8.6.287'), Gem.ruby_version
- ensure
- util_restore_RUBY_VERSION
- end
-
- def test_self_ruby_version_1_9_2dev_r23493
- util_set_RUBY_VERSION '1.9.2', -1, 23493
-
- assert_equal Gem::Version.new('1.9.2.dev.23493'), Gem.ruby_version
- ensure
- util_restore_RUBY_VERSION
- end
-
- def test_self_searcher
- assert_kind_of Gem::GemPathSearcher, Gem.searcher
- end
-
- def test_self_set_paths
- other = File.join @tempdir, 'other'
- path = [@userhome, other].join File::PATH_SEPARATOR
- Gem.send :set_paths, path
-
- assert_equal [@userhome, other, @gemhome], Gem.path
- end
-
- def test_self_set_paths_nonexistent_home
- ENV['GEM_HOME'] = @gemhome
- Gem.clear_paths
-
- other = File.join @tempdir, 'other'
-
- ENV['HOME'] = other
-
- Gem.send :set_paths, other
-
- assert_equal [other, @gemhome], Gem.path
- end
-
- def test_self_source_index
- assert_kind_of Gem::SourceIndex, Gem.source_index
- end
-
- def test_self_sources
- assert_equal %w[http://gems.example.com/], Gem.sources
- end
-
- def test_ssl_available_eh
- orig_Gem_ssl_available = Gem.ssl_available?
-
- Gem.ssl_available = true
- assert_equal true, Gem.ssl_available?
-
- Gem.ssl_available = false
- assert_equal false, Gem.ssl_available?
- ensure
- Gem.ssl_available = orig_Gem_ssl_available
- end
-
- def test_self_use_paths
- util_ensure_gem_dirs
-
- Gem.use_paths @gemhome, @additional
-
- assert_equal @gemhome, Gem.dir
- assert_equal @additional + [Gem.dir], Gem.path
- end
-
- def test_self_user_dir
- assert_equal File.join(@userhome, '.gem', Gem.ruby_engine,
- Gem::ConfigMap[:ruby_version]), Gem.user_dir
- end
-
- def test_self_user_home
- if ENV['HOME'] then
- assert_equal ENV['HOME'], Gem.user_home
- else
- assert true, 'count this test'
- end
- end
-
- def test_self_user_home_user_drive_and_path
- Gem.clear_paths
-
- # safe-keep env variables
- orig_home, orig_user_profile = ENV['HOME'], ENV['USERPROFILE']
- orig_user_drive, orig_user_path = ENV['HOMEDRIVE'], ENV['HOMEPATH']
-
- # prepare the environment
- ENV.delete('HOME')
- ENV.delete('USERPROFILE')
- ENV['HOMEDRIVE'] = 'Z:'
- ENV['HOMEPATH'] = '\\Users\\RubyUser'
-
- assert_equal "Z:\\Users\\RubyUser", Gem.user_home
-
- ensure
- ENV['HOME'] = orig_home
- ENV['USERPROFILE'] = orig_user_profile
- ENV['USERDRIVE'] = orig_user_drive
- ENV['USERPATH'] = orig_user_path
- end if '1.9' > RUBY_VERSION
-
- def util_ensure_gem_dirs
- Gem.ensure_gem_subdirectories @gemhome
- @additional.each do |dir|
- Gem.ensure_gem_subdirectories @gemhome
- end
- end
-
- def util_exec_gem
- spec, _ = quick_gem 'a', '4' do |s|
- s.default_executable = 'exec'
- s.executables = ['exec', 'abin']
- end
-
- @exec_path = File.join spec.full_gem_path, spec.bindir, 'exec'
- @abin_path = File.join spec.full_gem_path, spec.bindir, 'abin'
- end
-
- def util_set_RUBY_VERSION(version, patchlevel = nil, revision = nil)
- if Gem.instance_variables.include? :@ruby_version or
- Gem.instance_variables.include? '@ruby_version' then
- Gem.send :remove_instance_variable, :@ruby_version
- end
-
- @RUBY_VERSION = RUBY_VERSION
- @RUBY_PATCHLEVEL = RUBY_PATCHLEVEL if defined?(RUBY_PATCHLEVEL)
- @RUBY_REVISION = RUBY_REVISION if defined?(RUBY_REVISION)
-
- Object.send :remove_const, :RUBY_VERSION
- Object.send :remove_const, :RUBY_PATCHLEVEL if defined?(RUBY_PATCHLEVEL)
- Object.send :remove_const, :RUBY_REVISION if defined?(RUBY_REVISION)
-
- Object.const_set :RUBY_VERSION, version
- Object.const_set :RUBY_PATCHLEVEL, patchlevel if patchlevel
- Object.const_set :RUBY_REVISION, revision if revision
- end
-
- def util_restore_RUBY_VERSION
- Object.send :remove_const, :RUBY_VERSION
- Object.send :remove_const, :RUBY_PATCHLEVEL if defined?(RUBY_PATCHLEVEL)
- Object.send :remove_const, :RUBY_REVISION if defined?(RUBY_REVISION)
-
- Object.const_set :RUBY_VERSION, @RUBY_VERSION
- Object.const_set :RUBY_PATCHLEVEL, @RUBY_PATCHLEVEL if
- defined?(@RUBY_PATCHLEVEL)
- Object.const_set :RUBY_REVISION, @RUBY_REVISION if
- defined?(@RUBY_REVISION)
- end
-
-end
-
diff --git a/test/rubygems/test_gem_builder.rb b/test/rubygems/test_gem_builder.rb
deleted file mode 100644
index acddeddad1..0000000000
--- a/test/rubygems/test_gem_builder.rb
+++ /dev/null
@@ -1,33 +0,0 @@
-#--
-# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
-# All rights reserved.
-# See LICENSE.txt for permissions.
-#++
-
-require File.join(File.expand_path(File.dirname(__FILE__)), 'gemutilities')
-require 'rubygems/builder'
-
-class TestGemBuilder < RubyGemTestCase
-
- def test_build
- builder = Gem::Builder.new quick_gem('a')
-
- use_ui @ui do
- Dir.chdir @tempdir do
- builder.build
- end
- end
-
- assert_match %r|Successfully built RubyGem\n Name: a|, @ui.output
- end
-
- def test_build_validates
- builder = Gem::Builder.new Gem::Specification.new
-
- assert_raises Gem::InvalidSpecificationException do
- builder.build
- end
- end
-
-end
-
diff --git a/test/rubygems/test_gem_command.rb b/test/rubygems/test_gem_command.rb
deleted file mode 100644
index 7a48c842b8..0000000000
--- a/test/rubygems/test_gem_command.rb
+++ /dev/null
@@ -1,185 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
-# All rights reserved.
-# See LICENSE.txt for permissions.
-#++
-
-require File.join(File.expand_path(File.dirname(__FILE__)), 'gemutilities')
-require 'rubygems/command'
-
-class Gem::Command
- public :parser
-end
-
-class TestGemCommand < RubyGemTestCase
-
- def setup
- super
-
- @xopt = nil
-
- Gem::Command.common_options.clear
- Gem::Command.common_options << [
- ['-x', '--exe', 'Execute'], lambda do |*a|
- @xopt = true
- end
- ]
-
- @cmd_name = 'doit'
- @cmd = Gem::Command.new @cmd_name, 'summary'
- end
-
- def test_self_add_specific_extra_args
- added_args = %w[--all]
- @cmd.add_option '--all' do |v,o| end
-
- Gem::Command.add_specific_extra_args @cmd_name, added_args
-
- assert_equal added_args, Gem::Command.specific_extra_args(@cmd_name)
-
- h = @cmd.add_extra_args []
-
- assert_equal added_args, h
- end
-
- def test_self_add_specific_extra_args_unknown
- added_args = %w[--definitely_not_there]
-
- Gem::Command.add_specific_extra_args @cmd_name, added_args
-
- assert_equal added_args, Gem::Command.specific_extra_args(@cmd_name)
-
- h = @cmd.add_extra_args []
-
- assert_equal [], h
- end
-
- def test_basic_accessors
- assert_equal "doit", @cmd.command
- assert_equal "gem doit", @cmd.program_name
- assert_equal "summary", @cmd.summary
- end
-
- def test_common_option_in_class
- assert Array === Gem::Command.common_options
- end
-
- def test_defaults
- @cmd.add_option('-h', '--help [COMMAND]', 'Get help on COMMAND') do |value, options|
- options[:help] = value
- end
-
- @cmd.defaults = { :help => true }
-
- @cmd.when_invoked do |options|
- assert options[:help], "Help options should default true"
- end
-
- use_ui @ui do
- @cmd.invoke
- end
-
- assert_match %r|Usage: gem doit|, @ui.output
- end
-
- def test_invoke
- done = false
- @cmd.when_invoked { done = true }
-
- use_ui @ui do
- @cmd.invoke
- end
-
- assert done
- end
-
- def test_invode_with_bad_options
- use_ui @ui do
- @cmd.when_invoked do true end
-
- ex = assert_raises OptionParser::InvalidOption do
- @cmd.invoke('-zzz')
- end
-
- assert_match(/invalid option:/, ex.message)
- end
- end
-
- def test_invoke_with_common_options
- @cmd.when_invoked do true end
-
- use_ui @ui do
- @cmd.invoke "-x"
- end
-
- assert @xopt, "Should have done xopt"
- end
-
- # Returning false from the command handler invokes the usage output.
- def test_invoke_with_help
- done = false
-
- use_ui @ui do
- @cmd.add_option('-h', '--help [COMMAND]', 'Get help on COMMAND') do |value, options|
- options[:help] = true
- done = true
- end
-
- @cmd.invoke('--help')
-
- assert done
- end
-
- assert_match(/Usage/, @ui.output)
- assert_match(/gem doit/, @ui.output)
- assert_match(/\[options\]/, @ui.output)
- assert_match(/-h/, @ui.output)
- assert_match(/--help \[COMMAND\]/, @ui.output)
- assert_match(/Get help on COMMAND/, @ui.output)
- assert_match(/-x/, @ui.output)
- assert_match(/--exe/, @ui.output)
- assert_match(/Execute/, @ui.output)
- assert_match(/Common Options:/, @ui.output)
- end
-
- def test_invoke_with_options
- @cmd.add_option('-h', '--help [COMMAND]', 'Get help on COMMAND') do |value, options|
- options[:help] = true
- end
-
- @cmd.when_invoked do |opts|
- assert opts[:help]
- end
-
- use_ui @ui do
- @cmd.invoke '-h'
- end
-
- assert_match %r|Usage: gem doit|, @ui.output
- end
-
- def test_option_recognition
- @cmd.add_option('-h', '--help [COMMAND]', 'Get help on COMMAND') do |value, options|
- options[:help] = true
- end
- @cmd.add_option('-f', '--file FILE', 'File option') do |value, options|
- options[:help] = true
- end
- assert @cmd.handles?(['-x'])
- assert @cmd.handles?(['-h'])
- assert @cmd.handles?(['-h', 'command'])
- assert @cmd.handles?(['--help', 'command'])
- assert @cmd.handles?(['-f', 'filename'])
- assert @cmd.handles?(['--file=filename'])
- refute @cmd.handles?(['-z'])
- refute @cmd.handles?(['-f'])
- refute @cmd.handles?(['--toothpaste'])
-
- args = ['-h', 'command']
- @cmd.handles?(args)
- assert_equal ['-h', 'command'], args
- end
-
-end
-
diff --git a/test/rubygems/test_gem_command_manager.rb b/test/rubygems/test_gem_command_manager.rb
deleted file mode 100644
index 40ca857353..0000000000
--- a/test/rubygems/test_gem_command_manager.rb
+++ /dev/null
@@ -1,199 +0,0 @@
-#--
-# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
-# All rights reserved.
-# See LICENSE.txt for permissions.
-#++
-
-require File.join(File.expand_path(File.dirname(__FILE__)), 'gemutilities')
-require 'rubygems/command_manager'
-
-class TestGemCommandManager < RubyGemTestCase
-
- def setup
- super
-
- @command_manager = Gem::CommandManager.instance
- end
-
- def test_run_interrupt
- use_ui @ui do
- assert_raises MockGemUi::TermError do
- @command_manager.run 'interrupt'
- end
- assert_equal '', ui.output
- assert_equal "ERROR: Interrupted\n", ui.error
- end
- end
-
- def test_process_args_bad_arg
- use_ui @ui do
- assert_raises(MockGemUi::TermError) {
- @command_manager.process_args("--bad-arg")
- }
- end
-
- assert_match(/invalid option: --bad-arg/i, @ui.error)
- end
-
- def test_process_args_install
- #capture all install options
- use_ui @ui do
- check_options = nil
- @command_manager['install'].when_invoked do |options|
- check_options = options
- true
- end
-
- #check defaults
- @command_manager.process_args("install")
- assert_equal false, check_options[:test]
- assert_equal true, check_options[:generate_rdoc]
- assert_equal false, check_options[:force]
- assert_equal :both, check_options[:domain]
- assert_equal true, check_options[:wrappers]
- assert_equal Gem::Requirement.default, check_options[:version]
- assert_equal nil, check_options[:install_dir]
- assert_equal nil, check_options[:bin_dir]
-
- #check settings
- check_options = nil
- @command_manager.process_args(
- "install --force --test --local --rdoc --install-dir . --version 3.0 --no-wrapper --bindir . ")
- assert_equal true, check_options[:test]
- assert_equal true, check_options[:generate_rdoc]
- assert_equal true, check_options[:force]
- assert_equal :local, check_options[:domain]
- assert_equal false, check_options[:wrappers]
- assert_equal Gem::Requirement.new('3.0'), check_options[:version]
- assert_equal Dir.pwd, check_options[:install_dir]
- assert_equal Dir.pwd, check_options[:bin_dir]
-
- #check remote domain
- check_options = nil
- @command_manager.process_args("install --remote")
- assert_equal :remote, check_options[:domain]
-
- #check both domain
- check_options = nil
- @command_manager.process_args("install --both")
- assert_equal :both, check_options[:domain]
-
- #check both domain
- check_options = nil
- @command_manager.process_args("install --both")
- assert_equal :both, check_options[:domain]
- end
- end
-
- def test_process_args_uninstall
- #capture all uninstall options
- check_options = nil
- @command_manager['uninstall'].when_invoked do |options|
- check_options = options
- true
- end
-
- #check defaults
- @command_manager.process_args("uninstall")
- assert_equal Gem::Requirement.default, check_options[:version]
-
- #check settings
- check_options = nil
- @command_manager.process_args("uninstall foobar --version 3.0")
- assert_equal "foobar", check_options[:args].first
- assert_equal Gem::Requirement.new('3.0'), check_options[:version]
- end
-
- def test_process_args_check
- #capture all check options
- check_options = nil
- @command_manager['check'].when_invoked do |options|
- check_options = options
- true
- end
-
- #check defaults
- @command_manager.process_args("check")
- assert_equal false, check_options[:verify]
- assert_equal false, check_options[:alien]
-
- #check settings
- check_options = nil
- @command_manager.process_args("check --verify foobar --alien")
- assert_equal "foobar", check_options[:verify]
- assert_equal true, check_options[:alien]
- end
-
- def test_process_args_build
- #capture all build options
- check_options = nil
- @command_manager['build'].when_invoked do |options|
- check_options = options
- true
- end
-
- #check defaults
- @command_manager.process_args("build")
- #NOTE: Currently no defaults
-
- #check settings
- check_options = nil
- @command_manager.process_args("build foobar.rb")
- assert_equal 'foobar.rb', check_options[:args].first
- end
-
- def test_process_args_query
- #capture all query options
- check_options = nil
- @command_manager['query'].when_invoked do |options|
- check_options = options
- true
- end
-
- #check defaults
- @command_manager.process_args("query")
- assert_equal(//, check_options[:name])
- assert_equal :local, check_options[:domain]
- assert_equal false, check_options[:details]
-
- #check settings
- check_options = nil
- @command_manager.process_args("query --name foobar --local --details")
- assert_equal(/foobar/i, check_options[:name])
- assert_equal :local, check_options[:domain]
- assert_equal true, check_options[:details]
-
- #remote domain
- check_options = nil
- @command_manager.process_args("query --remote")
- assert_equal :remote, check_options[:domain]
-
- #both (local/remote) domains
- check_options = nil
- @command_manager.process_args("query --both")
- assert_equal :both, check_options[:domain]
- end
-
- def test_process_args_update
- #capture all update options
- check_options = nil
- @command_manager['update'].when_invoked do |options|
- check_options = options
- true
- end
-
- #check defaults
- @command_manager.process_args("update")
- assert_equal true, check_options[:generate_rdoc]
-
- #check settings
- check_options = nil
- @command_manager.process_args("update --force --test --rdoc --install-dir .")
- assert_equal true, check_options[:test]
- assert_equal true, check_options[:generate_rdoc]
- assert_equal true, check_options[:force]
- assert_equal Dir.pwd, check_options[:install_dir]
- end
-
-end
-
diff --git a/test/rubygems/test_gem_commands_build_command.rb b/test/rubygems/test_gem_commands_build_command.rb
deleted file mode 100644
index b9e02ce76e..0000000000
--- a/test/rubygems/test_gem_commands_build_command.rb
+++ /dev/null
@@ -1,74 +0,0 @@
-require File.join(File.expand_path(File.dirname(__FILE__)), 'gemutilities')
-require 'rubygems/commands/build_command'
-require 'rubygems/format'
-
-class TestGemCommandsBuildCommand < RubyGemTestCase
-
- def setup
- super
-
- @gem = quick_gem 'some_gem' do |s|
- s.rubyforge_project = 'example'
- end
-
- @cmd = Gem::Commands::BuildCommand.new
- end
-
- def test_execute
- gemspec_file = File.join(@tempdir, "#{@gem.full_name}.gemspec")
-
- File.open gemspec_file, 'w' do |gs|
- gs.write @gem.to_ruby
- end
-
- util_test_build_gem @gem, gemspec_file
- end
-
- def test_execute_yaml
- gemspec_file = File.join(@tempdir, "#{@gem.full_name}.gemspec")
-
- File.open gemspec_file, 'w' do |gs|
- gs.write @gem.to_yaml
- end
-
- util_test_build_gem @gem, gemspec_file
- end
-
- def test_execute_bad_gem
- @cmd.options[:args] = %w[some_gem]
- use_ui @ui do
- @cmd.execute
- end
-
- assert_equal '', @ui.output
- assert_equal "ERROR: Gemspec file not found: some_gem\n", @ui.error
- end
-
- def util_test_build_gem(gem, gemspec_file)
- @cmd.options[:args] = [gemspec_file]
-
- use_ui @ui do
- Dir.chdir @tempdir do
- @cmd.execute
- end
- end
-
- output = @ui.output.split "\n"
- assert_equal " Successfully built RubyGem", output.shift
- assert_equal " Name: some_gem", output.shift
- assert_equal " Version: 2", output.shift
- assert_equal " File: some_gem-2.gem", output.shift
- assert_equal [], output
- assert_equal '', @ui.error
-
- gem_file = File.join @tempdir, "#{gem.full_name}.gem"
- assert File.exist?(gem_file)
-
- spec = Gem::Format.from_file_by_path(gem_file).spec
-
- assert_equal "some_gem", spec.name
- assert_equal "this is a summary", spec.summary
- end
-
-end
-
diff --git a/test/rubygems/test_gem_commands_cert_command.rb b/test/rubygems/test_gem_commands_cert_command.rb
deleted file mode 100644
index 43124f2c40..0000000000
--- a/test/rubygems/test_gem_commands_cert_command.rb
+++ /dev/null
@@ -1,125 +0,0 @@
-require File.join(File.expand_path(File.dirname(__FILE__)), 'gemutilities')
-
-require 'rubygems/commands/cert_command'
-
-unless defined? OpenSSL then
- warn "`gem cert` tests are being skipped, module OpenSSL not found"
-end
-
-class TestGemCommandsCertCommand < RubyGemTestCase
-
- def setup
- super
-
- @orig_security_trust_dir = Gem::Security::OPT[:trust_dir]
- Gem::Security::OPT[:trust_dir] = @tempdir
-
- @cmd = Gem::Commands::CertCommand.new
-
- root = File.expand_path(File.dirname(__FILE__))
-
- FileUtils.cp File.join(root, 'data', 'gem-private_key.pem'), @tempdir
- FileUtils.cp File.join(root, 'data', 'gem-public_cert.pem'), @tempdir
-
- @cert_file_name = File.join @tempdir, 'gem-public_cert.pem'
- @pkey_file_name = File.join @tempdir, 'gem-private_key.pem'
- end
-
- def teardown
- Gem::Security::OPT[:trust_dir] = @orig_security_trust_dir
-
- super
- end
-
- def test_execute_add
- use_ui @ui do
- @cmd.send :handle_options, %W[--add #{@cert_file_name}]
- end
-
- assert_equal "Added '/CN=rubygems/DC=example/DC=com'\n", @ui.output
- assert_equal '', @ui.error
- end
-
- def test_execute_build
- FileUtils.rm @cert_file_name
- FileUtils.rm @pkey_file_name
-
- use_ui @ui do
- Dir.chdir @tempdir do
- @cmd.send :handle_options, %W[--build nobody@example.com]
- end
- end
-
- output = @ui.output.split "\n"
-
- assert_equal 'Public Cert: gem-public_cert.pem', output.shift
- assert_equal 'Private Key: gem-private_key.pem', output.shift
- assert_equal 'Don\'t forget to move the key file to somewhere private...',
- output.shift
- assert_equal [], output
-
- assert_equal '', @ui.error
-
- assert File.exist?(File.join(@tempdir, 'gem-private_key.pem'))
- assert File.exist?(File.join(@tempdir, 'gem-public_cert.pem'))
- end
-
- def test_execute_certificate
- use_ui @ui do
- @cmd.send :handle_options, %W[--certificate #{@cert_file_name}]
- end
-
- assert_equal '', @ui.output
- assert_equal '', @ui.error
-
- assert_equal File.read(@cert_file_name),
- Gem::Security::OPT[:issuer_cert].to_s
- end
-
- def test_execute_list
- use_ui @ui do
- @cmd.send :handle_options, %W[--list]
- end
-
- assert_equal "/CN=rubygems/DC=example/DC=com\n", @ui.output
- assert_equal '', @ui.error
- end
-
- def test_execute_private_key
- use_ui @ui do
- @cmd.send :handle_options, %W[--private-key #{@pkey_file_name}]
- end
-
- assert_equal '', @ui.output
- assert_equal '', @ui.error
-
- assert_equal File.read(@pkey_file_name),
- Gem::Security::OPT[:issuer_key].to_s
- end
-
- def test_execute_remove
- use_ui @ui do
- @cmd.send :handle_options, %W[--remove rubygems]
- end
-
- assert_equal "Removed '/CN=rubygems/DC=example/DC=com'\n", @ui.output
- assert_equal '', @ui.error
-
- refute File.exist?(@cert_file_name)
- end
-
- def test_execute_sign
- use_ui @ui do
- @cmd.send :handle_options, %W[
- -K #{@pkey_file_name} -C #{@cert_file_name} --sign #{@cert_file_name}
- ]
- end
-
- assert_equal '', @ui.output
- assert_equal '', @ui.error
-
- # HACK this test sucks
- end
-
-end if defined? OpenSSL
-
diff --git a/test/rubygems/test_gem_commands_check_command.rb b/test/rubygems/test_gem_commands_check_command.rb
deleted file mode 100644
index 3199ac71ac..0000000000
--- a/test/rubygems/test_gem_commands_check_command.rb
+++ /dev/null
@@ -1,24 +0,0 @@
-#--
-# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
-# All rights reserved.
-# See LICENSE.txt for permissions.
-#++
-
-require File.join(File.expand_path(File.dirname(__FILE__)), 'gemutilities')
-require 'rubygems/commands/check_command'
-
-class TestGemCommandsCheckCommand < RubyGemTestCase
-
- def setup
- super
-
- @cmd = Gem::Commands::CheckCommand.new
- end
-
- def test_initialize
- assert_equal "check", @cmd.command
- assert_equal "gem check", @cmd.program_name
- assert_match(/Check/, @cmd.summary)
- end
-
-end
diff --git a/test/rubygems/test_gem_commands_contents_command.rb b/test/rubygems/test_gem_commands_contents_command.rb
deleted file mode 100644
index a40be4e3fb..0000000000
--- a/test/rubygems/test_gem_commands_contents_command.rb
+++ /dev/null
@@ -1,154 +0,0 @@
-require File.join(File.expand_path(File.dirname(__FILE__)), 'gemutilities')
-require 'rubygems/commands/contents_command'
-
-class TestGemCommandsContentsCommand < RubyGemTestCase
-
- def setup
- super
-
- @cmd = Gem::Commands::ContentsCommand.new
- end
-
- def test_execute
- @cmd.options[:args] = %w[foo]
- quick_gem 'foo' do |gem|
- gem.files = %w[lib/foo.rb Rakefile]
- end
-
- use_ui @ui do
- @cmd.execute
- end
-
- assert_match %r|lib/foo\.rb|, @ui.output
- assert_match %r|Rakefile|, @ui.output
- assert_equal "", @ui.error
- end
-
- def test_execute_all
- @cmd.options[:all] = true
-
- quick_gem 'foo' do |gem|
- gem.files = %w[lib/foo.rb Rakefile]
- end
-
- quick_gem 'bar' do |gem|
- gem.files = %w[lib/bar.rb Rakefile]
- end
-
- use_ui @ui do
- @cmd.execute
- end
-
- assert_match %r|lib/foo\.rb|, @ui.output
- assert_match %r|lib/bar\.rb|, @ui.output
- assert_match %r|Rakefile|, @ui.output
- assert_equal "", @ui.error
- end
-
- def test_execute_bad_gem
- @cmd.options[:args] = %w[foo]
-
- assert_raises MockGemUi::TermError do
- use_ui @ui do
- @cmd.execute
- end
- end
-
- assert_match %r|Unable to find gem 'foo' in default gem paths|, @ui.output
- assert_match %r|Directories searched:|, @ui.output
- assert_equal "", @ui.error
- end
-
- def test_execute_exact_match
- @cmd.options[:args] = %w[foo]
- quick_gem 'foo' do |gem|
- gem.files = %w[lib/foo.rb Rakefile]
- end
-
- quick_gem 'foo_bar' do |gem|
- gem.files = %w[lib/foo_bar.rb Rakefile]
- end
-
- use_ui @ui do
- @cmd.execute
- end
-
- assert_match %r|lib/foo\.rb|, @ui.output
- assert_match %r|Rakefile|, @ui.output
- assert_equal "", @ui.error
- end
-
- def test_execute_lib_only
- @cmd.options[:args] = %w[foo]
- @cmd.options[:lib_only] = true
-
- quick_gem 'foo' do |gem|
- gem.files = %w[lib/foo.rb Rakefile]
- end
-
- use_ui @ui do
- @cmd.execute
- end
-
- assert_match %r|lib/foo\.rb|, @ui.output
- refute_match %r|Rakefile|, @ui.output
-
- assert_equal "", @ui.error
- end
-
- def test_execute_multiple
- @cmd.options[:args] = %w[foo bar]
- quick_gem 'foo' do |gem|
- gem.files = %w[lib/foo.rb Rakefile]
- end
-
- quick_gem 'bar' do |gem|
- gem.files = %w[lib/bar.rb Rakefile]
- end
-
- use_ui @ui do
- @cmd.execute
- end
-
- assert_match %r|lib/foo\.rb|, @ui.output
- assert_match %r|lib/bar\.rb|, @ui.output
- assert_match %r|Rakefile|, @ui.output
- assert_equal "", @ui.error
- end
-
- def test_execute_no_prefix
- @cmd.options[:args] = %w[foo]
- @cmd.options[:prefix] = false
-
- quick_gem 'foo' do |gem|
- gem.files = %w[lib/foo.rb Rakefile]
- end
-
- use_ui @ui do
- @cmd.execute
- end
-
- expected = <<-EOF
-lib/foo.rb
-Rakefile
- EOF
-
- assert_equal expected, @ui.output
-
- assert_equal "", @ui.error
- end
-
- def test_handle_options
- assert_equal false, @cmd.options[:lib_only]
- assert_equal [], @cmd.options[:specdirs]
- assert_equal nil, @cmd.options[:version]
-
- @cmd.send :handle_options, %w[-l -s foo --version 0.0.2]
-
- assert_equal true, @cmd.options[:lib_only]
- assert_equal %w[foo], @cmd.options[:specdirs]
- assert_equal Gem::Requirement.new('0.0.2'), @cmd.options[:version]
- end
-
-end
-
diff --git a/test/rubygems/test_gem_commands_dependency_command.rb b/test/rubygems/test_gem_commands_dependency_command.rb
deleted file mode 100644
index ebf713c36e..0000000000
--- a/test/rubygems/test_gem_commands_dependency_command.rb
+++ /dev/null
@@ -1,226 +0,0 @@
-require File.join(File.expand_path(File.dirname(__FILE__)), 'gemutilities')
-require 'rubygems/commands/dependency_command'
-
-class TestGemCommandsDependencyCommand < RubyGemTestCase
-
- def setup
- super
-
- @cmd = Gem::Commands::DependencyCommand.new
- @cmd.options[:domain] = :local
-
- util_setup_fake_fetcher
- end
-
- def test_execute
- quick_gem 'foo' do |gem|
- gem.add_dependency 'bar', '> 1'
- end
-
- Gem.source_index = nil
-
- @cmd.options[:args] = %w[foo]
-
- use_ui @ui do
- @cmd.execute
- end
-
- assert_equal "Gem foo-2\n bar (> 1, runtime)\n\n", @ui.output
- assert_equal '', @ui.error
- end
-
- def test_execute_no_args
- Gem.source_index = nil
-
- @cmd.options[:args] = []
-
- use_ui @ui do
- @cmd.execute
- end
-
- expected = <<-EOF
-Gem a-1
-
-Gem a-2
-
-Gem a_evil-9
-
-Gem b-2
-
-Gem c-1.2
-
-Gem pl-1-x86-linux
-
- EOF
-
- assert_equal expected, @ui.output
- assert_equal '', @ui.error
- end
-
- def test_execute_no_match
- @cmd.options[:args] = %w[foo]
-
- assert_raises MockGemUi::TermError do
- use_ui @ui do
- @cmd.execute
- end
- end
-
- assert_equal "No gems found matching foo (>= 0)\n", @ui.output
- assert_equal '', @ui.error
- end
-
- def test_execute_pipe_format
- quick_gem 'foo' do |gem|
- gem.add_dependency 'bar', '> 1'
- end
-
- @cmd.options[:args] = %w[foo]
- @cmd.options[:pipe_format] = true
-
- use_ui @ui do
- @cmd.execute
- end
-
- assert_equal "bar --version '> 1'\n", @ui.output
- assert_equal '', @ui.error
- end
-
- def test_execute_regexp
- Gem.source_index = nil
-
- @cmd.options[:args] = %w[/[ab]/]
-
- use_ui @ui do
- @cmd.execute
- end
-
- expected = <<-EOF
-Gem a-1
-
-Gem a-2
-
-Gem a_evil-9
-
-Gem b-2
-
- EOF
-
- assert_equal expected, @ui.output
- assert_equal '', @ui.error
- end
-
- def test_execute_reverse
- quick_gem 'foo' do |gem|
- gem.add_dependency 'bar', '> 1'
- end
-
- quick_gem 'baz' do |gem|
- gem.add_dependency 'foo'
- end
-
- Gem.source_index = nil
-
- @cmd.options[:args] = %w[foo]
- @cmd.options[:reverse_dependencies] = true
-
- use_ui @ui do
- @cmd.execute
- end
-
- expected = <<-EOF
-Gem foo-2
- bar (> 1, runtime)
- Used by
- baz-2 (foo (>= 0, runtime))
-
- EOF
-
- assert_equal expected, @ui.output
- assert_equal '', @ui.error
- end
-
- def test_execute_reverse_remote
- @cmd.options[:args] = %w[foo]
- @cmd.options[:reverse_dependencies] = true
- @cmd.options[:domain] = :remote
-
- assert_raises MockGemUi::TermError do
- use_ui @ui do
- @cmd.execute
- end
- end
-
- expected = <<-EOF
-ERROR: Only reverse dependencies for local gems are supported.
- EOF
-
- assert_equal '', @ui.output
- assert_equal expected, @ui.error
- end
-
- def test_execute_remote
- foo = quick_gem 'foo' do |gem|
- gem.add_dependency 'bar', '> 1'
- end
-
- @fetcher = Gem::FakeFetcher.new
- Gem::RemoteFetcher.fetcher = @fetcher
-
- util_setup_spec_fetcher foo
-
- FileUtils.rm File.join(@gemhome, 'specifications',
- "#{foo.full_name}.gemspec")
-
- @cmd.options[:args] = %w[foo]
- @cmd.options[:domain] = :remote
-
- use_ui @ui do
- @cmd.execute
- end
-
- assert_equal "Gem foo-2\n bar (> 1, runtime)\n\n", @ui.output
- assert_equal '', @ui.error
- end
-
- def test_execute_remote_legacy
- foo = quick_gem 'foo' do |gem|
- gem.add_dependency 'bar', '> 1'
- end
-
- @fetcher = Gem::FakeFetcher.new
- Gem::RemoteFetcher.fetcher = @fetcher
-
- Gem::SpecFetcher.fetcher = nil
- si = util_setup_source_info_cache foo
-
- @fetcher.data["#{@gem_repo}yaml"] = YAML.dump si
- @fetcher.data["#{@gem_repo}Marshal.#{Gem.marshal_version}"] =
- si.dump
-
- @fetcher.data.delete "#{@gem_repo}latest_specs.#{Gem.marshal_version}.gz"
-
- FileUtils.rm File.join(@gemhome, 'specifications',
- "#{foo.full_name}.gemspec")
-
- @cmd.options[:args] = %w[foo]
- @cmd.options[:domain] = :remote
-
- use_ui @ui do
- @cmd.execute
- end
-
- assert_equal "Gem foo-2\n bar (> 1, runtime)\n\n", @ui.output
-
- expected = <<-EOF
-WARNING: RubyGems 1.2+ index not found for:
-\t#{@gem_repo}
-
-RubyGems will revert to legacy indexes degrading performance.
- EOF
-
- assert_equal expected, @ui.error
- end
-
-end
-
diff --git a/test/rubygems/test_gem_commands_environment_command.rb b/test/rubygems/test_gem_commands_environment_command.rb
deleted file mode 100644
index 0640543f52..0000000000
--- a/test/rubygems/test_gem_commands_environment_command.rb
+++ /dev/null
@@ -1,133 +0,0 @@
-require File.join(File.expand_path(File.dirname(__FILE__)), 'gemutilities')
-require 'rubygems/commands/environment_command'
-
-class TestGemCommandsEnvironmentCommand < RubyGemTestCase
-
- def setup
- super
-
- @cmd = Gem::Commands::EnvironmentCommand.new
- end
-
- def test_execute
- orig_sources = Gem.sources.dup
- Gem.sources.replace %w[http://gems.example.com]
-
- @cmd.send :handle_options, %w[]
-
- use_ui @ui do
- @cmd.execute
- end
-
- assert_match %r|RUBYGEMS VERSION: (\d\.)+\d|, @ui.output
- assert_match %r|RUBY VERSION: \d\.\d\.\d \(.*\) \[.*\]|, @ui.output
- assert_match %r|INSTALLATION DIRECTORY: #{Regexp.escape @gemhome}|,
- @ui.output
- assert_match %r|RUBYGEMS PREFIX: |, @ui.output
- assert_match %r|RUBY EXECUTABLE:.*#{Gem::ConfigMap[:ruby_install_name]}|,
- @ui.output
- assert_match %r|EXECUTABLE DIRECTORY:|, @ui.output
- assert_match %r|RUBYGEMS PLATFORMS:|, @ui.output
- assert_match %r|- #{Gem::Platform.local}|, @ui.output
- assert_match %r|GEM PATHS:|, @ui.output
- assert_match %r|- #{Regexp.escape @gemhome}|, @ui.output
- assert_match %r|GEM CONFIGURATION:|, @ui.output
- assert_match %r|:verbose => |, @ui.output
- assert_match %r|REMOTE SOURCES:|, @ui.output
- assert_equal '', @ui.error
-
- ensure
- Gem.sources.replace orig_sources
- end
-
- def test_execute_gemdir
- @cmd.send :handle_options, %w[gemdir]
-
- use_ui @ui do
- @cmd.execute
- end
-
- assert_equal "#{@gemhome}\n", @ui.output
- assert_equal '', @ui.error
- end
-
- def test_execute_gempath
- @cmd.send :handle_options, %w[gempath]
-
- use_ui @ui do
- @cmd.execute
- end
-
- assert_equal "#{@gemhome}\n", @ui.output
- assert_equal '', @ui.error
- end
-
- def test_execute_gempath_multiple
- Gem.clear_paths
- path = [@gemhome, "#{@gemhome}2"].join File::PATH_SEPARATOR
- ENV['GEM_PATH'] = path
-
- @cmd.send :handle_options, %w[gempath]
-
- use_ui @ui do
- @cmd.execute
- end
-
- assert_equal "#{Gem.path.join File::PATH_SEPARATOR}\n", @ui.output
- assert_equal '', @ui.error
- end
-
- def test_execute_packageversion
- @cmd.send :handle_options, %w[packageversion]
-
- use_ui @ui do
- @cmd.execute
- end
-
- assert_equal "#{Gem::RubyGemsPackageVersion}\n", @ui.output
- assert_equal '', @ui.error
- end
-
- def test_execute_remotesources
- orig_sources = Gem.sources.dup
- Gem.sources.replace %w[http://gems.example.com]
-
- @cmd.send :handle_options, %w[remotesources]
-
- use_ui @ui do
- @cmd.execute
- end
-
- assert_equal "http://gems.example.com\n", @ui.output
- assert_equal '', @ui.error
-
- ensure
- Gem.sources.replace orig_sources
- end
-
- def test_execute_unknown
- @cmd.send :handle_options, %w[unknown]
-
- assert_raises Gem::CommandLineError do
- use_ui @ui do
- @cmd.execute
- end
- end
-
- assert_equal '', @ui.output
- assert_equal '', @ui.error
- end
-
- def test_execute_version
- @cmd.send :handle_options, %w[version]
-
- use_ui @ui do
- @cmd.execute
- end
-
- assert_equal "#{Gem::RubyGemsVersion}\n", @ui.output
- assert_equal '', @ui.error
- end
-
-end
-
diff --git a/test/rubygems/test_gem_commands_fetch_command.rb b/test/rubygems/test_gem_commands_fetch_command.rb
deleted file mode 100644
index 08cca0970f..0000000000
--- a/test/rubygems/test_gem_commands_fetch_command.rb
+++ /dev/null
@@ -1,54 +0,0 @@
-require File.join(File.expand_path(File.dirname(__FILE__)), 'gemutilities')
-require 'rubygems/package'
-require 'rubygems/security'
-require 'rubygems/commands/fetch_command'
-
-class TestGemCommandsFetchCommand < RubyGemTestCase
-
- def setup
- super
-
- @cmd = Gem::Commands::FetchCommand.new
- end
-
- def test_execute
- util_setup_fake_fetcher
- util_setup_spec_fetcher @a2
-
- @fetcher.data["#{@gem_repo}gems/#{@a2.full_name}.gem"] =
- File.read(File.join(@gemhome, 'cache', "#{@a2.full_name}.gem"))
-
- @cmd.options[:args] = [@a2.name]
-
- use_ui @ui do
- Dir.chdir @tempdir do
- @cmd.execute
- end
- end
-
- assert File.exist?(File.join(@tempdir, "#{@a2.full_name}.gem")),
- "#{@a2.full_name} fetched"
- end
-
- def test_execute_legacy
- util_setup_fake_fetcher
- util_setup_source_info_cache @a2
-
- @fetcher.data["#{@gem_repo}yaml"] = ''
- @fetcher.data["#{@gem_repo}gems/#{@a2.full_name}.gem"] =
- File.read(File.join(@gemhome, 'cache', "#{@a2.full_name}.gem"))
-
- @cmd.options[:args] = [@a2.name]
-
- use_ui @ui do
- Dir.chdir @tempdir do
- @cmd.execute
- end
- end
-
- assert File.exist?(File.join(@tempdir, "#{@a2.full_name}.gem")),
- "#{@a2.full_name} fetched"
- end
-
-end
-
diff --git a/test/rubygems/test_gem_commands_generate_index_command.rb b/test/rubygems/test_gem_commands_generate_index_command.rb
deleted file mode 100644
index d038bd6d5e..0000000000
--- a/test/rubygems/test_gem_commands_generate_index_command.rb
+++ /dev/null
@@ -1,135 +0,0 @@
-require File.join(File.expand_path(File.dirname(__FILE__)), 'gemutilities')
-require 'rubygems/indexer'
-require 'rubygems/commands/generate_index_command'
-
-class TestGemCommandsGenerateIndexCommand < RubyGemTestCase
-
- def setup
- super
-
- @cmd = Gem::Commands::GenerateIndexCommand.new
- @cmd.options[:directory] = @gemhome
- end
-
- def test_execute
- use_ui @ui do
- @cmd.execute
- end
-
- yaml = File.join @gemhome, 'yaml'
- yaml_z = File.join @gemhome, 'yaml.Z'
- quick_index = File.join @gemhome, 'quick', 'index'
- quick_index_rz = File.join @gemhome, 'quick', 'index.rz'
-
- assert File.exist?(yaml), yaml
- assert File.exist?(yaml_z), yaml_z
- assert File.exist?(quick_index), quick_index
- assert File.exist?(quick_index_rz), quick_index_rz
- end
-
- def test_execute_rss_update
- @cmd.options[:update] = true
- @cmd.options[:rss_host] = 'example.com'
- @cmd.options[:rss_gems_host] = 'gems.example.com'
-
- use_ui @ui do
- assert_raises MockGemUi::TermError do
- @cmd.execute
- end
- end
-
- assert_equal "ERROR: --update not compatible with RSS generation\n",
- @ui.error
- assert_empty @ui.output
- end
-
- def test_handle_options_directory
- return if win_platform?
- refute_equal '/nonexistent', @cmd.options[:directory]
-
- @cmd.handle_options %w[--directory /nonexistent]
-
- assert_equal '/nonexistent', @cmd.options[:directory]
- end
-
- def test_handle_options_directory_windows
- return unless win_platform?
-
- refute_equal '/nonexistent', @cmd.options[:directory]
-
- @cmd.handle_options %w[--directory C:/nonexistent]
-
- assert_equal 'C:/nonexistent', @cmd.options[:directory]
- end
-
- def test_handle_options_invalid
- e = assert_raises OptionParser::InvalidOption do
- @cmd.handle_options %w[--no-modern --no-legacy]
- end
-
- assert_equal 'invalid option: --no-legacy no indicies will be built',
- e.message
-
- @cmd = Gem::Commands::GenerateIndexCommand.new
- e = assert_raises OptionParser::InvalidOption do
- @cmd.handle_options %w[--no-legacy --no-modern]
- end
-
- assert_equal 'invalid option: --no-modern no indicies will be built',
- e.message
- end
-
- def test_handle_options_legacy
- @cmd.handle_options %w[--legacy]
-
- assert @cmd.options[:build_legacy]
- assert @cmd.options[:build_modern], ':build_modern not set'
- end
-
- def test_handle_options_modern
- @cmd.handle_options %w[--modern]
-
- assert @cmd.options[:build_legacy]
- assert @cmd.options[:build_modern], ':build_modern not set'
- end
-
- def test_handle_options_no_legacy
- @cmd.handle_options %w[--no-legacy]
-
- refute @cmd.options[:build_legacy]
- assert @cmd.options[:build_modern]
- end
-
- def test_handle_options_no_modern
- @cmd.handle_options %w[--no-modern]
-
- assert @cmd.options[:build_legacy]
- refute @cmd.options[:build_modern]
- end
-
- def test_handle_options_rss_gems_host
- @cmd.handle_options %w[--rss-gems-host gems.example.com]
-
- assert_equal 'gems.example.com', @cmd.options[:rss_gems_host]
- end
-
- def test_handle_options_rss_host
- @cmd.handle_options %w[--rss-host example.com]
-
- assert_equal 'example.com', @cmd.options[:rss_host]
- end
-
- def test_handle_options_rss_title
- @cmd.handle_options %w[--rss-title Example\ Gems]
-
- assert_equal 'Example Gems', @cmd.options[:rss_title]
- end
-
- def test_handle_options_update
- @cmd.handle_options %w[--update]
-
- assert @cmd.options[:update]
- end
-
-end if ''.respond_to? :to_xs
-
diff --git a/test/rubygems/test_gem_commands_install_command.rb b/test/rubygems/test_gem_commands_install_command.rb
deleted file mode 100644
index d9ee8098a5..0000000000
--- a/test/rubygems/test_gem_commands_install_command.rb
+++ /dev/null
@@ -1,264 +0,0 @@
-require File.join(File.expand_path(File.dirname(__FILE__)), 'gemutilities')
-require 'rubygems/commands/install_command'
-
-class TestGemCommandsInstallCommand < RubyGemTestCase
-
- def setup
- super
-
- @cmd = Gem::Commands::InstallCommand.new
- @cmd.options[:generate_rdoc] = false
- @cmd.options[:generate_ri] = false
- end
-
- def test_execute_exclude_prerelease
- util_setup_fake_fetcher(:prerelease)
- util_setup_spec_fetcher @a2, @a2_pre
-
- @fetcher.data["#{@gem_repo}gems/#{@a2.full_name}.gem"] =
- read_binary(File.join(@gemhome, 'cache', "#{@a2.full_name}.gem"))
- @fetcher.data["#{@gem_repo}gems/#{@a2_pre.full_name}.gem"] =
- read_binary(File.join(@gemhome, 'cache', "#{@a2_pre.full_name}.gem"))
-
- @cmd.options[:args] = [@a2.name]
-
- use_ui @ui do
- e = assert_raises Gem::SystemExitException do
- @cmd.execute
- end
- assert_equal 0, e.exit_code, @ui.error
- end
-
- assert_match(/Successfully installed #{@a2.full_name}$/, @ui.output)
- refute_match(/Successfully installed #{@a2_pre.full_name}$/, @ui.output)
- end
-
- def test_execute_explicit_version_includes_prerelease
- util_setup_fake_fetcher(:prerelease)
- util_setup_spec_fetcher @a2, @a2_pre
-
- @fetcher.data["#{@gem_repo}gems/#{@a2.full_name}.gem"] =
- read_binary(File.join(@gemhome, 'cache', "#{@a2.full_name}.gem"))
- @fetcher.data["#{@gem_repo}gems/#{@a2_pre.full_name}.gem"] =
- read_binary(File.join(@gemhome, 'cache', "#{@a2_pre.full_name}.gem"))
-
- @cmd.handle_options [@a2_pre.name, '--version', @a2_pre.version.to_s]
- assert @cmd.options[:prerelease]
- assert @cmd.options[:version].satisfied_by?(@a2_pre.version)
-
- use_ui @ui do
- e = assert_raises Gem::SystemExitException do
- @cmd.execute
- end
- assert_equal 0, e.exit_code, @ui.error
- end
-
- refute_match(/Successfully installed #{@a2.full_name}$/, @ui.output)
- assert_match(/Successfully installed #{@a2_pre.full_name}$/, @ui.output)
- end
-
- def test_execute_include_dependencies
- @cmd.options[:include_dependencies] = true
- @cmd.options[:args] = []
-
- assert_raises Gem::CommandLineError do
- use_ui @ui do
- @cmd.execute
- end
- end
-
- output = @ui.output.split "\n"
- assert_equal "INFO: `gem install -y` is now default and will be removed",
- output.shift
- assert_equal "INFO: use --ignore-dependencies to install only the gems you list",
- output.shift
- assert output.empty?, output.inspect
- end
-
- def test_execute_local
- util_setup_fake_fetcher
- @cmd.options[:domain] = :local
-
- FileUtils.mv File.join(@gemhome, 'cache', "#{@a2.full_name}.gem"),
- File.join(@tempdir)
-
- @cmd.options[:args] = [@a2.name]
-
- use_ui @ui do
- orig_dir = Dir.pwd
- begin
- Dir.chdir @tempdir
- e = assert_raises Gem::SystemExitException do
- @cmd.execute
- end
- assert_equal 0, e.exit_code
- ensure
- Dir.chdir orig_dir
- end
- end
-
- out = @ui.output.split "\n"
- assert_equal "Successfully installed #{@a2.full_name}", out.shift
- assert_equal "1 gem installed", out.shift
- assert out.empty?, out.inspect
- end
-
- def test_no_user_install
- skip 'skipped on MS Windows (chmod has no effect)' if win_platform?
-
- util_setup_fake_fetcher
- @cmd.options[:user_install] = false
-
- FileUtils.mv File.join(@gemhome, 'cache', "#{@a2.full_name}.gem"),
- File.join(@tempdir)
-
- @cmd.options[:args] = [@a2.name]
-
- use_ui @ui do
- orig_dir = Dir.pwd
- begin
- File.chmod 0755, @userhome
- File.chmod 0555, @gemhome
-
- Dir.chdir @tempdir
- assert_raises Gem::FilePermissionError do
- @cmd.execute
- end
- ensure
- Dir.chdir orig_dir
- File.chmod 0755, @gemhome
- end
- end
- end
-
- def test_execute_local_missing
- util_setup_fake_fetcher
- @cmd.options[:domain] = :local
-
- @cmd.options[:args] = %w[no_such_gem]
-
- use_ui @ui do
- e = assert_raises Gem::SystemExitException do
- @cmd.execute
- end
- assert_equal 2, e.exit_code
- end
-
- # HACK no repository was checked
- assert_equal "ERROR: could not find gem no_such_gem locally or in a repository\n",
- @ui.error
- end
-
- def test_execute_no_gem
- @cmd.options[:args] = %w[]
-
- assert_raises Gem::CommandLineError do
- @cmd.execute
- end
- end
-
- def test_execute_nonexistent
- util_setup_fake_fetcher
- util_setup_spec_fetcher
-
- @cmd.options[:args] = %w[nonexistent]
-
- use_ui @ui do
- e = assert_raises Gem::SystemExitException do
- @cmd.execute
- end
- assert_equal 2, e.exit_code
- end
-
- assert_equal "ERROR: could not find gem nonexistent locally or in a repository\n",
- @ui.error
- end
-
- def test_execute_prerelease
- util_setup_fake_fetcher(:prerelease)
- util_setup_spec_fetcher @a2, @a2_pre
-
- @fetcher.data["#{@gem_repo}gems/#{@a2.full_name}.gem"] =
- read_binary(File.join(@gemhome, 'cache', "#{@a2.full_name}.gem"))
- @fetcher.data["#{@gem_repo}gems/#{@a2_pre.full_name}.gem"] =
- read_binary(File.join(@gemhome, 'cache', "#{@a2_pre.full_name}.gem"))
-
- @cmd.options[:prerelease] = true
- @cmd.options[:args] = [@a2_pre.name]
-
- use_ui @ui do
- e = assert_raises Gem::SystemExitException do
- @cmd.execute
- end
- assert_equal 0, e.exit_code, @ui.error
- end
-
- refute_match(/Successfully installed #{@a2.full_name}$/, @ui.output)
- assert_match(/Successfully installed #{@a2_pre.full_name}$/, @ui.output)
- end
-
- def test_execute_remote
- @cmd.options[:generate_rdoc] = true
- @cmd.options[:generate_ri] = true
-
- util_setup_fake_fetcher
- util_setup_spec_fetcher @a2
-
- @fetcher.data["#{@gem_repo}gems/#{@a2.full_name}.gem"] =
- read_binary(File.join(@gemhome, 'cache', "#{@a2.full_name}.gem"))
-
- @cmd.options[:args] = [@a2.name]
-
- use_ui @ui do
- e = assert_raises Gem::SystemExitException do
- capture_io do
- @cmd.execute
- end
- end
- assert_equal 0, e.exit_code
- end
-
- out = @ui.output.split "\n"
- assert_equal "Successfully installed #{@a2.full_name}", out.shift
- assert_equal "1 gem installed", out.shift
- assert_equal "Installing ri documentation for #{@a2.full_name}...",
- out.shift
- assert_equal "Installing RDoc documentation for #{@a2.full_name}...",
- out.shift
- assert out.empty?, out.inspect
- end
-
- def test_execute_two
- util_setup_fake_fetcher
- @cmd.options[:domain] = :local
-
- FileUtils.mv File.join(@gemhome, 'cache', "#{@a2.full_name}.gem"),
- File.join(@tempdir)
-
- FileUtils.mv File.join(@gemhome, 'cache', "#{@b2.full_name}.gem"),
- File.join(@tempdir)
-
- @cmd.options[:args] = [@a2.name, @b2.name]
-
- use_ui @ui do
- orig_dir = Dir.pwd
- begin
- Dir.chdir @tempdir
- e = assert_raises Gem::SystemExitException do
- @cmd.execute
- end
- assert_equal 0, e.exit_code
- ensure
- Dir.chdir orig_dir
- end
- end
-
- out = @ui.output.split "\n"
- assert_equal "Successfully installed #{@a2.full_name}", out.shift
- assert_equal "Successfully installed #{@b2.full_name}", out.shift
- assert_equal "2 gems installed", out.shift
- assert out.empty?, out.inspect
- end
-
-end
-
diff --git a/test/rubygems/test_gem_commands_list_command.rb b/test/rubygems/test_gem_commands_list_command.rb
deleted file mode 100644
index db3fe90baf..0000000000
--- a/test/rubygems/test_gem_commands_list_command.rb
+++ /dev/null
@@ -1,36 +0,0 @@
-require File.join(File.expand_path(File.dirname(__FILE__)), 'gemutilities')
-require 'rubygems/commands/list_command'
-
-class TestGemCommandsListCommand < RubyGemTestCase
-
- def setup
- super
-
- @cmd = Gem::Commands::ListCommand.new
-
- util_setup_fake_fetcher
-
- @si = util_setup_spec_fetcher @a1, @a2, @pl1
-
- @fetcher.data["#{@gem_repo}Marshal.#{Gem.marshal_version}"] = proc do
- raise Gem::RemoteFetcher::FetchError
- end
- end
-
- def test_execute_installed
- @cmd.handle_options %w[c --installed]
-
- e = assert_raises Gem::SystemExitException do
- use_ui @ui do
- @cmd.execute
- end
- end
-
- assert_equal 0, e.exit_code
-
- assert_equal "true\n", @ui.output
-
- assert_equal '', @ui.error
- end
-
-end
diff --git a/test/rubygems/test_gem_commands_lock_command.rb b/test/rubygems/test_gem_commands_lock_command.rb
deleted file mode 100644
index e5d8dbe7b0..0000000000
--- a/test/rubygems/test_gem_commands_lock_command.rb
+++ /dev/null
@@ -1,68 +0,0 @@
-require File.join(File.expand_path(File.dirname(__FILE__)), 'gemutilities')
-require 'rubygems/commands/lock_command'
-
-class TestGemCommandsLockCommand < RubyGemTestCase
-
- def setup
- super
-
- @a1 = quick_gem 'a', '1'
- @b1 = quick_gem 'b', '1' do |s|
- s.add_runtime_dependency 'a'
- end
-
- @d1 = quick_gem 'd', '1' do |s|
- s.add_runtime_dependency 'z'
- end
-
- @cmd = Gem::Commands::LockCommand.new
- end
-
- def test_execute
- @cmd.handle_options %w[b-1]
-
- use_ui @ui do
- @cmd.execute
- end
-
- expected = <<-EXPECTED
-require 'rubygems'
-gem 'b', '= 1'
-gem 'a', '= 1'
- EXPECTED
-
- assert_equal expected, @ui.output
- assert_equal '', @ui.error
- end
-
- def test_execute_missing_dependency
- @cmd.handle_options %w[d-1]
-
- use_ui @ui do
- @cmd.execute
- end
-
- expected = <<-EXPECTED
-require 'rubygems'
-gem 'd', '= 1'
-# Unable to satisfy 'z (>= 0, runtime)' from currently installed gems
- EXPECTED
-
- assert_equal expected, @ui.output
- assert_equal '', @ui.error
- end
-
- def test_execute_strict
- @cmd.handle_options %w[c-1 --strict]
-
- e = assert_raises Gem::Exception do
- use_ui @ui do
- @cmd.execute
- end
- end
-
- assert_equal 'Could not find gem c-1, try using the full name', e.message
- end
-
-end
-
diff --git a/test/rubygems/test_gem_commands_mirror_command.rb b/test/rubygems/test_gem_commands_mirror_command.rb
deleted file mode 100644
index f9a3b22545..0000000000
--- a/test/rubygems/test_gem_commands_mirror_command.rb
+++ /dev/null
@@ -1,60 +0,0 @@
-require File.join(File.expand_path(File.dirname(__FILE__)), 'gemutilities')
-require 'rubygems/indexer'
-require 'rubygems/commands/mirror_command'
-
-class TestGemCommandsMirrorCommand < RubyGemTestCase
-
- def setup
- super
-
- @cmd = Gem::Commands::MirrorCommand.new
- end
-
- def test_execute
- util_make_gems
-
- gems_dir = File.join @tempdir, 'gems'
- mirror = File.join @tempdir, 'mirror'
-
- FileUtils.mkdir_p gems_dir
- FileUtils.mkdir_p mirror
-
- Dir[File.join(@gemhome, 'cache', '*.gem')].each do |gem|
- FileUtils.mv gem, gems_dir
- end
-
- use_ui @ui do
- Gem::Indexer.new(@tempdir).generate_index
- end
-
- orig_HOME = ENV['HOME']
- ENV['HOME'] = @tempdir
- Gem.instance_variable_set :@user_home, nil
-
- File.open File.join(Gem.user_home, '.gemmirrorrc'), 'w' do |fp|
- fp.puts "---"
- # tempdir could be a drive+path (under windows)
- if @tempdir.match(/[a-z]:/i)
- fp.puts "- from: file:///#{@tempdir}"
- else
- fp.puts "- from: file://#{@tempdir}"
- end
- fp.puts " to: #{mirror}"
- end
-
- use_ui @ui do
- @cmd.execute
- end
-
- assert File.exist?(File.join(mirror, 'gems', "#{@a1.full_name}.gem"))
- assert File.exist?(File.join(mirror, 'gems', "#{@a2.full_name}.gem"))
- assert File.exist?(File.join(mirror, 'gems', "#{@b2.full_name}.gem"))
- assert File.exist?(File.join(mirror, 'gems', "#{@c1_2.full_name}.gem"))
- assert File.exist?(File.join(mirror, "Marshal.#{@marshal_version}"))
- ensure
- orig_HOME.nil? ? ENV.delete('HOME') : ENV['HOME'] = orig_HOME
- Gem.instance_variable_set :@user_home, nil
- end
-
-end if ''.respond_to? :to_xs
-
diff --git a/test/rubygems/test_gem_commands_outdated_command.rb b/test/rubygems/test_gem_commands_outdated_command.rb
deleted file mode 100644
index 7ea3d8d2be..0000000000
--- a/test/rubygems/test_gem_commands_outdated_command.rb
+++ /dev/null
@@ -1,42 +0,0 @@
-require File.join(File.expand_path(File.dirname(__FILE__)), 'gemutilities')
-require 'rubygems/commands/outdated_command'
-
-class TestGemCommandsOutdatedCommand < RubyGemTestCase
-
- def setup
- super
-
- @cmd = Gem::Commands::OutdatedCommand.new
- end
-
- def test_initialize
- assert @cmd.handles?(%W[--platform #{Gem::Platform.local}])
- end
-
- def test_execute
- local_01 = quick_gem 'foo', '0.1'
- local_02 = quick_gem 'foo', '0.2'
- remote_10 = quick_gem 'foo', '1.0'
- remote_20 = quick_gem 'foo', '2.0'
-
- remote_spec_file = File.join @gemhome, 'specifications',
- remote_10.full_name + ".gemspec"
- FileUtils.rm remote_spec_file
-
- remote_spec_file = File.join @gemhome, 'specifications',
- remote_20.full_name + ".gemspec"
- FileUtils.rm remote_spec_file
-
- @fetcher = Gem::FakeFetcher.new
- Gem::RemoteFetcher.fetcher = @fetcher
-
- util_setup_spec_fetcher remote_10, remote_20
-
- use_ui @ui do @cmd.execute end
-
- assert_equal "foo (0.2 < 2.0)\n", @ui.output
- assert_equal "", @ui.error
- end
-
-end
-
diff --git a/test/rubygems/test_gem_commands_pristine_command.rb b/test/rubygems/test_gem_commands_pristine_command.rb
deleted file mode 100644
index 54b3d77594..0000000000
--- a/test/rubygems/test_gem_commands_pristine_command.rb
+++ /dev/null
@@ -1,108 +0,0 @@
-require File.join(File.expand_path(File.dirname(__FILE__)), 'gemutilities')
-require 'rubygems/commands/pristine_command'
-
-class TestGemCommandsPristineCommand < RubyGemTestCase
-
- def setup
- super
- @cmd = Gem::Commands::PristineCommand.new
- end
-
- def test_execute
- a = quick_gem 'a' do |s| s.executables = %w[foo] end
- FileUtils.mkdir_p File.join(@tempdir, 'bin')
- File.open File.join(@tempdir, 'bin', 'foo'), 'w' do |fp|
- fp.puts "#!/usr/bin/ruby"
- end
-
- install_gem a
-
- foo_path = File.join @gemhome, 'gems', a.full_name, 'bin', 'foo'
-
- File.open foo_path, 'w' do |io|
- io.puts 'I changed it!'
- end
-
- @cmd.options[:args] = %w[a]
-
- use_ui @ui do
- @cmd.execute
- end
-
- assert_equal "#!/usr/bin/ruby\n", File.read(foo_path), foo_path
-
- out = @ui.output.split "\n"
-
- assert_equal "Restoring gem(s) to pristine condition...", out.shift
- assert_equal "Restored #{a.full_name}", out.shift
- assert_empty out, out.inspect
- end
-
- def test_execute_all
- a = quick_gem 'a' do |s| s.executables = %w[foo] end
- FileUtils.mkdir_p File.join(@tempdir, 'bin')
- File.open File.join(@tempdir, 'bin', 'foo'), 'w' do |fp|
- fp.puts "#!/usr/bin/ruby"
- end
-
- install_gem a
-
- gem_bin = File.join @gemhome, 'gems', a.full_name, 'bin', 'foo'
-
- FileUtils.rm gem_bin
-
- @cmd.handle_options %w[--all]
-
- use_ui @ui do
- @cmd.execute
- end
-
- assert File.exist?(gem_bin)
-
- out = @ui.output.split "\n"
-
- assert_equal "Restoring gem(s) to pristine condition...", out.shift
- assert_equal "Restored #{a.full_name}", out.shift
- assert_empty out, out.inspect
- end
-
- def test_execute_missing_cache_gem
- a = quick_gem 'a' do |s| s.executables = %w[foo] end
- FileUtils.mkdir_p File.join(@tempdir, 'bin')
- File.open File.join(@tempdir, 'bin', 'foo'), 'w' do |fp|
- fp.puts "#!/usr/bin/ruby"
- end
-
- install_gem a
-
- FileUtils.rm File.join(@gemhome, 'cache', "#{a.full_name}.gem")
-
- @cmd.options[:args] = %w[a]
-
- use_ui @ui do
- @cmd.execute
- end
-
- out = @ui.output.split "\n"
-
- assert_equal "Restoring gem\(s\) to pristine condition...", out.shift
- assert_empty out, out.inspect
-
- assert_equal "ERROR: Cached gem for #{a.full_name} not found, use `gem install` to restore\n",
- @ui.error
- end
-
- def test_execute_no_gem
- @cmd.options[:args] = %w[]
-
- e = assert_raises Gem::CommandLineError do
- use_ui @ui do
- @cmd.execute
- end
- end
-
- assert_match %r|specify a gem name|, e.message
- end
-
-end
-
diff --git a/test/rubygems/test_gem_commands_query_command.rb b/test/rubygems/test_gem_commands_query_command.rb
deleted file mode 100644
index 228d0b3946..0000000000
--- a/test/rubygems/test_gem_commands_query_command.rb
+++ /dev/null
@@ -1,432 +0,0 @@
-require File.join(File.expand_path(File.dirname(__FILE__)), 'gemutilities')
-require 'rubygems/commands/query_command'
-
-class TestGemCommandsQueryCommand < RubyGemTestCase
-
- def setup
- super
-
- @cmd = Gem::Commands::QueryCommand.new
-
- util_setup_fake_fetcher
-
- @si = util_setup_spec_fetcher @a1, @a2, @pl1, @a3a
-
- @fetcher.data["#{@gem_repo}Marshal.#{Gem.marshal_version}"] = proc do
- raise Gem::RemoteFetcher::FetchError
- end
- end
-
- def test_execute
- @cmd.handle_options %w[-r]
-
- use_ui @ui do
- @cmd.execute
- end
-
- expected = <<-EOF
-
-*** REMOTE GEMS ***
-
-a (2)
-pl (1)
- EOF
-
- assert_equal expected, @ui.output
- assert_equal '', @ui.error
- end
-
- def test_execute_all
- a1_name = @a1.full_name
- a2_name = @a2.full_name
-
- @cmd.handle_options %w[-r --all]
-
- use_ui @ui do
- @cmd.execute
- end
-
- expected = <<-EOF
-
-*** REMOTE GEMS ***
-
-a (2, 1)
-pl (1)
- EOF
-
- assert_equal expected, @ui.output
- assert_equal '', @ui.error
- end
-
- def test_execute_details
- @a2.summary = 'This is a lot of text. ' * 4
- @a2.authors = ['Abraham Lincoln', 'Hirohito']
- @a2.homepage = 'http://a.example.com/'
- @a2.rubyforge_project = 'rubygems'
-
- @si = util_setup_spec_fetcher @a1, @a2, @pl1
-
- @cmd.handle_options %w[-r -d]
-
- use_ui @ui do
- @cmd.execute
- end
-
- expected = <<-EOF
-
-*** REMOTE GEMS ***
-
-a (2)
- Authors: Abraham Lincoln, Hirohito
- Rubyforge: http://rubyforge.org/projects/rubygems
- Homepage: http://a.example.com/
-
- This is a lot of text. This is a lot of text. This is a lot of text.
- This is a lot of text.
-
-pl (1)
- Platform: i386-linux
- Author: A User
- Homepage: http://example.com
-
- this is a summary
- EOF
-
- assert_equal expected, @ui.output
- assert_equal '', @ui.error
- end
-
- def test_execute_details_platform
- @a1.platform = 'x86-linux'
-
- @a2.summary = 'This is a lot of text. ' * 4
- @a2.authors = ['Abraham Lincoln', 'Hirohito']
- @a2.homepage = 'http://a.example.com/'
- @a2.rubyforge_project = 'rubygems'
- @a2.platform = 'universal-darwin'
-
- @si = util_setup_spec_fetcher @a1, @a2, @pl1
-
- @cmd.handle_options %w[-r -d]
-
- use_ui @ui do
- @cmd.execute
- end
-
- expected = <<-EOF
-
-*** REMOTE GEMS ***
-
-a (2, 1)
- Platforms:
- 1: x86-linux
- 2: universal-darwin
- Authors: Abraham Lincoln, Hirohito
- Rubyforge: http://rubyforge.org/projects/rubygems
- Homepage: http://a.example.com/
-
- This is a lot of text. This is a lot of text. This is a lot of text.
- This is a lot of text.
-
-pl (1)
- Platform: i386-linux
- Author: A User
- Homepage: http://example.com
-
- this is a summary
- EOF
-
- assert_equal expected, @ui.output
- assert_equal '', @ui.error
- end
-
- def test_execute_installed
- @cmd.handle_options %w[-n c --installed]
-
- e = assert_raises Gem::SystemExitException do
- use_ui @ui do
- @cmd.execute
- end
- end
-
- assert_equal 0, e.exit_code
-
- assert_equal "true\n", @ui.output
-
- assert_equal '', @ui.error
- end
-
- def test_execute_installed_no_name
- @cmd.handle_options %w[--installed]
-
- e = assert_raises Gem::SystemExitException do
- use_ui @ui do
- @cmd.execute
- end
- end
-
- assert_equal '', @ui.output
- assert_equal "ERROR: You must specify a gem name\n", @ui.error
-
- assert_equal 4, e.exit_code
- end
-
- def test_execute_installed_not_installed
- @cmd.handle_options %w[-n not_installed --installed]
-
- e = assert_raises Gem::SystemExitException do
- use_ui @ui do
- @cmd.execute
- end
- end
-
- assert_equal "false\n", @ui.output
- assert_equal '', @ui.error
-
- assert_equal 1, e.exit_code
- end
-
- def test_execute_installed_version
- @cmd.handle_options %w[-n c --installed --version 1.2]
-
- e = assert_raises Gem::SystemExitException do
- use_ui @ui do
- @cmd.execute
- end
- end
-
- assert_equal "true\n", @ui.output
- assert_equal '', @ui.error
-
- assert_equal 0, e.exit_code
- end
-
- def test_execute_installed_version_not_installed
- @cmd.handle_options %w[-n c --installed --version 2]
-
- e = assert_raises Gem::SystemExitException do
- use_ui @ui do
- @cmd.execute
- end
- end
-
- assert_equal "false\n", @ui.output
- assert_equal '', @ui.error
-
- assert_equal 1, e.exit_code
- end
-
- def test_execute_legacy
- Gem::SpecFetcher.fetcher = nil
- si = util_setup_source_info_cache @a1, @a2, @pl1
-
- @fetcher.data["#{@gem_repo}yaml"] = YAML.dump si
- @fetcher.data["#{@gem_repo}Marshal.#{Gem.marshal_version}"] =
- si.dump
-
- @fetcher.data.delete "#{@gem_repo}latest_specs.#{Gem.marshal_version}.gz"
-
- @cmd.handle_options %w[-r]
-
- use_ui @ui do
- @cmd.execute
- end
-
- expected = <<-EOF
-
-*** REMOTE GEMS ***
-
-a (2)
-pl (1)
- EOF
-
- assert_equal expected, @ui.output
-
- expected = <<-EOF
-WARNING: RubyGems 1.2+ index not found for:
-\t#{@gem_repo}
-
-RubyGems will revert to legacy indexes degrading performance.
- EOF
-
- assert_equal expected, @ui.error
- end
-
- def test_execute_legacy_prerelease
- Gem::SpecFetcher.fetcher = nil
- si = util_setup_source_info_cache @a1, @a2, @pl1
-
- @fetcher.data["#{@gem_repo}yaml"] = YAML.dump si
- @fetcher.data["#{@gem_repo}Marshal.#{Gem.marshal_version}"] =
- si.dump
-
- @fetcher.data.delete "#{@gem_repo}latest_specs.#{Gem.marshal_version}.gz"
-
- @cmd.handle_options %w[-r --prerelease]
-
- e = assert_raises Gem::OperationNotSupportedError do
- @cmd.execute
- end
-
- assert_equal 'Prereleases not supported on legacy repositories', e.message
- end
-
- def test_execute_local_details
- @a3a.summary = 'This is a lot of text. ' * 4
- @a3a.authors = ['Abraham Lincoln', 'Hirohito']
- @a3a.homepage = 'http://a.example.com/'
- @a3a.rubyforge_project = 'rubygems'
-
- @cmd.handle_options %w[--local --details]
-
- use_ui @ui do
- @cmd.execute
- end
-
- expected = <<-EOF
-
-*** LOCAL GEMS ***
-
-a (3.a, 2, 1)
- Author: A User
- Homepage: http://example.com
- Installed at (3.a): #{@gemhome}
- (2): #{@gemhome}
- (1): #{@gemhome}
-
- this is a summary
-
-a_evil (9)
- Author: A User
- Homepage: http://example.com
- Installed at: #{@gemhome}
-
- this is a summary
-
-b (2)
- Author: A User
- Homepage: http://example.com
- Installed at: #{@gemhome}
-
- this is a summary
-
-c (1.2)
- Author: A User
- Homepage: http://example.com
- Installed at: #{@gemhome}
-
- this is a summary
-
-pl (1)
- Platform: i386-linux
- Author: A User
- Homepage: http://example.com
- Installed at: #{@gemhome}
-
- this is a summary
- EOF
-
- assert_equal expected, @ui.output
- assert_equal '', @ui.error
- end
-
- def test_execute_local_notty
- @cmd.handle_options %w[]
-
- @ui.outs.tty = false
-
- use_ui @ui do
- @cmd.execute
- end
-
- expected = <<-EOF
-a (3.a, 2, 1)
-a_evil (9)
-b (2)
-c (1.2)
-pl (1)
- EOF
-
- assert_equal expected, @ui.output
- assert_equal '', @ui.error
- end
-
- def test_execute_no_versions
- @cmd.handle_options %w[-r --no-versions]
-
- use_ui @ui do
- @cmd.execute
- end
-
- expected = <<-EOF
-
-*** REMOTE GEMS ***
-
-a
-pl
- EOF
-
- assert_equal expected, @ui.output
- assert_equal '', @ui.error
- end
-
- def test_execute_notty
- @cmd.handle_options %w[-r]
-
- @ui.outs.tty = false
-
- use_ui @ui do
- @cmd.execute
- end
-
- expected = <<-EOF
-a (2)
-pl (1)
- EOF
-
- assert_equal expected, @ui.output
- assert_equal '', @ui.error
- end
-
- def test_execute_prerelease
- @cmd.handle_options %w[-r --prerelease]
-
- use_ui @ui do
- @cmd.execute
- end
-
- expected = <<-EOF
-
-*** REMOTE GEMS ***
-
-a (3.a)
- EOF
-
- assert_equal expected, @ui.output
- assert_equal '', @ui.error
- end
-
- def test_execute_prerelease_local
- @cmd.handle_options %w[-l --prerelease]
-
- use_ui @ui do
- @cmd.execute
- end
-
- expected = <<-EOF
-
-*** LOCAL GEMS ***
-
-a (3.a, 2, 1)
-a_evil (9)
-b (2)
-c (1.2)
-pl (1)
- EOF
-
- assert_equal expected, @ui.output
- assert_equal "WARNING: prereleases are always shown locally\n", @ui.error
- end
-
-end
-
diff --git a/test/rubygems/test_gem_commands_server_command.rb b/test/rubygems/test_gem_commands_server_command.rb
deleted file mode 100644
index 64ecbeb1f0..0000000000
--- a/test/rubygems/test_gem_commands_server_command.rb
+++ /dev/null
@@ -1,52 +0,0 @@
-require File.join(File.expand_path(File.dirname(__FILE__)), 'gemutilities')
-require 'rubygems/commands/server_command'
-
-class TestGemCommandsServerCommand < RubyGemTestCase
-
- def setup
- super
-
- @cmd = Gem::Commands::ServerCommand.new
- end
-
- def test_handle_options
- @cmd.send :handle_options, %w[-p 8808 --no-daemon]
-
- assert_equal false, @cmd.options[:daemon]
- assert_equal @gemhome, @cmd.options[:gemdir]
- assert_equal 8808, @cmd.options[:port]
-
- @cmd.send :handle_options, %w[-p 9999 -d /nonexistent --daemon]
-
- assert_equal true, @cmd.options[:daemon]
- assert_equal File.expand_path('/nonexistent'), @cmd.options[:gemdir]
- assert_equal 9999, @cmd.options[:port]
- end
-
- def test_handle_options_port
- @cmd.send :handle_options, %w[-p 0]
- assert_equal 0, @cmd.options[:port]
-
- @cmd.send :handle_options, %w[-p 65535]
- assert_equal 65535, @cmd.options[:port]
-
- @cmd.send :handle_options, %w[-p http]
- assert_equal 80, @cmd.options[:port]
-
- e = assert_raises OptionParser::InvalidArgument do
- @cmd.send :handle_options, %w[-p nonexistent]
- end
-
- assert_equal 'invalid argument: -p nonexistent: no such named service',
- e.message
-
- e = assert_raises OptionParser::InvalidArgument do
- @cmd.send :handle_options, %w[-p 65536]
- end
-
- assert_equal 'invalid argument: -p 65536: not a port number',
- e.message
- end
-
-end
-
diff --git a/test/rubygems/test_gem_commands_sources_command.rb b/test/rubygems/test_gem_commands_sources_command.rb
deleted file mode 100644
index d58b35e740..0000000000
--- a/test/rubygems/test_gem_commands_sources_command.rb
+++ /dev/null
@@ -1,278 +0,0 @@
-require File.join(File.expand_path(File.dirname(__FILE__)), 'gemutilities')
-require 'rubygems/commands/sources_command'
-
-class TestGemCommandsSourcesCommand < RubyGemTestCase
-
- def setup
- super
-
- @cmd = Gem::Commands::SourcesCommand.new
-
- @new_repo = "http://beta-gems.example.com"
- end
-
- def test_initialize_proxy
- assert @cmd.handles?(['--http-proxy', 'http://proxy.example.com'])
- end
-
- def test_execute
- util_setup_spec_fetcher
- @cmd.handle_options []
-
- use_ui @ui do
- @cmd.execute
- end
-
- expected = <<-EOF
-*** CURRENT SOURCES ***
-
-#{@gem_repo}
- EOF
-
- assert_equal expected, @ui.output
- assert_equal '', @ui.error
- end
-
- def test_execute_add
- util_setup_fake_fetcher
-
- si = Gem::SourceIndex.new
- si.add_spec @a1
-
- specs = si.map do |_, spec|
- [spec.name, spec.version, spec.original_platform]
- end
-
- specs_dump_gz = StringIO.new
- Zlib::GzipWriter.wrap specs_dump_gz do |io|
- Marshal.dump specs, io
- end
-
- @fetcher.data["#{@new_repo}/specs.#{@marshal_version}.gz"] =
- specs_dump_gz.string
-
- @cmd.handle_options %W[--add #{@new_repo}]
-
- util_setup_spec_fetcher
-
- use_ui @ui do
- @cmd.execute
- end
-
- assert_equal [@gem_repo, @new_repo], Gem.sources
-
- expected = <<-EOF
-#{@new_repo} added to sources
- EOF
-
- assert_equal expected, @ui.output
- assert_equal '', @ui.error
- end
-
- def test_execute_add_nonexistent_source
- util_setup_fake_fetcher
-
- uri = "http://beta-gems.example.com/specs.#{@marshal_version}.gz"
- @fetcher.data[uri] = proc do
- raise Gem::RemoteFetcher::FetchError.new('it died', uri)
- end
-
- Gem::RemoteFetcher.fetcher = @fetcher
-
- @cmd.handle_options %w[--add http://beta-gems.example.com]
-
- util_setup_spec_fetcher
-
- use_ui @ui do
- @cmd.execute
- end
-
- expected = <<-EOF
-Error fetching http://beta-gems.example.com:
-\tit died (#{uri})
- EOF
-
- assert_equal expected, @ui.output
- assert_equal '', @ui.error
- end
-
- def test_execute_add_bad_uri
- @cmd.handle_options %w[--add beta-gems.example.com]
-
- util_setup_spec_fetcher
-
- use_ui @ui do
- @cmd.execute
- end
-
- assert_equal [@gem_repo], Gem.sources
-
- expected = <<-EOF
-beta-gems.example.com is not a URI
- EOF
-
- assert_equal expected, @ui.output
- assert_equal '', @ui.error
- end
-
- def test_execute_add_legacy
- util_setup_fake_fetcher
- util_setup_source_info_cache
-
- si = Gem::SourceIndex.new
- si.add_spec @a1
-
- @fetcher.data["#{@new_repo}/yaml"] = ''
-
- @cmd.handle_options %W[--add #{@new_repo}]
-
- use_ui @ui do
- @cmd.execute
- end
-
- assert_equal [@gem_repo], Gem.sources
-
- expected = <<-EOF
-WARNING: RubyGems 1.2+ index not found for:
-\t#{@new_repo}
-
-Will cause RubyGems to revert to legacy indexes, degrading performance.
- EOF
-
- assert_equal "#{@new_repo} added to sources\n", @ui.output
- assert_equal expected, @ui.error
- end
-
- def test_execute_clear_all
- @cmd.handle_options %w[--clear-all]
-
- util_setup_source_info_cache
-
- cache = Gem::SourceInfoCache.cache
- cache.update
- cache.write_cache
-
- assert File.exist?(cache.system_cache_file),
- 'system cache file'
- assert File.exist?(cache.latest_system_cache_file),
- 'latest system cache file'
-
- util_setup_spec_fetcher
-
- fetcher = Gem::SpecFetcher.fetcher
-
- # HACK figure out how to force directory creation via fetcher
- #assert File.directory?(fetcher.dir), 'cache dir exists'
-
- use_ui @ui do
- @cmd.execute
- end
-
- expected = <<-EOF
-*** Removed specs cache ***
-*** Removed user source cache ***
-*** Removed latest user source cache ***
-*** Removed system source cache ***
-*** Removed latest system source cache ***
- EOF
-
- assert_equal expected, @ui.output
- assert_equal '', @ui.error
-
- refute File.exist?(cache.system_cache_file),
- 'system cache file'
- refute File.exist?(cache.latest_system_cache_file),
- 'latest system cache file'
-
- refute File.exist?(fetcher.dir), 'cache dir removed'
- end
-
- def test_execute_remove
- @cmd.handle_options %W[--remove #{@gem_repo}]
-
- util_setup_spec_fetcher
-
- use_ui @ui do
- @cmd.execute
- end
-
- expected = "#{@gem_repo} removed from sources\n"
-
- assert_equal expected, @ui.output
- assert_equal '', @ui.error
- end
-
- def test_execute_remove_no_network
- @cmd.handle_options %W[--remove #{@gem_repo}]
-
- util_setup_fake_fetcher
-
- @fetcher.data["#{@gem_repo}Marshal.#{Gem.marshal_version}"] = proc do
- raise Gem::RemoteFetcher::FetchError
- end
-
- use_ui @ui do
- @cmd.execute
- end
-
- expected = "#{@gem_repo} removed from sources\n"
-
- assert_equal expected, @ui.output
- assert_equal '', @ui.error
- end
-
- def test_execute_update
- @cmd.handle_options %w[--update]
-
- util_setup_fake_fetcher
- source_index = util_setup_spec_fetcher @a1
-
- specs = source_index.map do |name, spec|
- [spec.name, spec.version, spec.original_platform]
- end
-
- @fetcher.data["#{@gem_repo}specs.#{Gem.marshal_version}.gz"] =
- util_gzip Marshal.dump(specs)
-
- latest_specs = source_index.latest_specs.map do |spec|
- [spec.name, spec.version, spec.original_platform]
- end
-
- @fetcher.data["#{@gem_repo}latest_specs.#{Gem.marshal_version}.gz"] =
- util_gzip Marshal.dump(latest_specs)
-
- use_ui @ui do
- @cmd.execute
- end
-
- assert_equal "source cache successfully updated\n", @ui.output
- assert_equal '', @ui.error
- end
-
- def test_execute_update_legacy
- @cmd.handle_options %w[--update]
-
- util_setup_fake_fetcher
- util_setup_source_info_cache
- Gem::SourceInfoCache.reset
-
- si = Gem::SourceIndex.new
- si.add_spec @a1
- @fetcher.data["#{@gem_repo}yaml"] = YAML.dump si
- @fetcher.data["#{@gem_repo}Marshal.#{@marshal_version}"] = si.dump
-
- use_ui @ui do
- @cmd.execute
- end
-
- expected = <<-EOF
-Bulk updating Gem source index for: #{@gem_repo}
-source cache successfully updated
- EOF
-
- assert_equal expected, @ui.output
- assert_equal '', @ui.error
- end
-
-end
-
diff --git a/test/rubygems/test_gem_commands_specification_command.rb b/test/rubygems/test_gem_commands_specification_command.rb
deleted file mode 100644
index 3f936a64ea..0000000000
--- a/test/rubygems/test_gem_commands_specification_command.rb
+++ /dev/null
@@ -1,140 +0,0 @@
-require File.join(File.expand_path(File.dirname(__FILE__)), 'gemutilities')
-require 'rubygems/commands/specification_command'
-
-class TestGemCommandsSpecificationCommand < RubyGemTestCase
-
- def setup
- super
-
- @cmd = Gem::Commands::SpecificationCommand.new
- end
-
- def test_execute
- foo = quick_gem 'foo'
- Gem.source_index.add_spec foo
-
- @cmd.options[:args] = %w[foo]
-
- use_ui @ui do
- @cmd.execute
- end
-
- assert_match %r|Gem::Specification|, @ui.output
- assert_match %r|name: foo|, @ui.output
- assert_equal '', @ui.error
- end
-
- def test_execute_all
- foo1 = quick_gem 'foo', '0.0.1'
- foo2 = quick_gem 'foo', '0.0.2'
-
- @cmd.options[:args] = %w[foo]
- @cmd.options[:all] = true
-
- use_ui @ui do
- @cmd.execute
- end
-
- assert_match %r|Gem::Specification|, @ui.output
- assert_match %r|name: foo|, @ui.output
- assert_match %r|version: 0.0.1|, @ui.output
- assert_match %r|version: 0.0.2|, @ui.output
- assert_equal '', @ui.error
- end
-
- def test_execute_bad_name
- @cmd.options[:args] = %w[foo]
-
- assert_raises MockGemUi::TermError do
- use_ui @ui do
- @cmd.execute
- end
- end
-
- assert_equal '', @ui.output
- assert_equal "ERROR: Unknown gem 'foo'\n", @ui.error
- end
-
- def test_execute_exact_match
- foo = quick_gem 'foo'
- foo_bar = quick_gem 'foo_bar'
-
- @cmd.options[:args] = %w[foo]
-
- use_ui @ui do
- @cmd.execute
- end
-
- assert_match %r|Gem::Specification|, @ui.output
- assert_match %r|name: foo|, @ui.output
- assert_equal '', @ui.error
- end
-
- def test_execute_field
- foo = quick_gem 'foo'
- Gem.source_index.add_spec foo
-
- @cmd.options[:args] = %w[foo name]
-
- use_ui @ui do
- @cmd.execute
- end
-
- assert_equal "--- foo\n\n", @ui.output
- end
-
- def test_execute_marshal
- foo = quick_gem 'foo'
- Gem.source_index.add_spec foo
-
- @cmd.options[:args] = %w[foo]
- @cmd.options[:format] = :marshal
-
- use_ui @ui do
- @cmd.execute
- end
-
- assert_equal foo, Marshal.load(@ui.output)
- assert_equal '', @ui.error
- end
-
- def test_execute_remote
- foo = quick_gem 'foo'
-
- @fetcher = Gem::FakeFetcher.new
- Gem::RemoteFetcher.fetcher = @fetcher
-
- util_setup_spec_fetcher foo
-
- FileUtils.rm File.join(@gemhome, 'specifications',
- "#{foo.full_name}.gemspec")
-
- @cmd.options[:args] = %w[foo]
- @cmd.options[:domain] = :remote
-
- use_ui @ui do
- @cmd.execute
- end
-
- assert_match %r|\A--- !ruby/object:Gem::Specification|, @ui.output
- assert_match %r|name: foo|, @ui.output
- end
-
- def test_execute_ruby
- foo = quick_gem 'foo'
- Gem.source_index.add_spec foo
-
- @cmd.options[:args] = %w[foo]
- @cmd.options[:format] = :ruby
-
- use_ui @ui do
- @cmd.execute
- end
-
- assert_match %r|Gem::Specification.new|, @ui.output
- assert_match %r|s.name = %q\{foo\}|, @ui.output
- assert_equal '', @ui.error
- end
-
-end
-
diff --git a/test/rubygems/test_gem_commands_stale_command.rb b/test/rubygems/test_gem_commands_stale_command.rb
deleted file mode 100644
index d38e54179a..0000000000
--- a/test/rubygems/test_gem_commands_stale_command.rb
+++ /dev/null
@@ -1,38 +0,0 @@
-require File.join(File.expand_path(File.dirname(__FILE__)), 'gemutilities')
-require 'rubygems/commands/stale_command'
-
-class TestGemCommandsStaleCommand < RubyGemTestCase
-
- def setup
- super
- @cmd = Gem::Commands::StaleCommand.new
- end
-
- def test_execute_sorts
- files = %w[lib/foo_bar.rb Rakefile]
- foo_bar = quick_gem 'foo_bar' do |gem|
- gem.files = files
- end
- bar_baz = quick_gem 'bar_baz' do |gem|
- gem.files = files
- end
-
- files.each do |file|
- filename = bar_baz.full_gem_path + "/#{file}"
- FileUtils.mkdir_p(File.dirname(filename))
- FileUtils.touch(filename, :mtime => Time.now)
-
- filename = foo_bar.full_gem_path + "/#{file}"
- FileUtils.mkdir_p(File.dirname(filename))
- FileUtils.touch(filename, :mtime => Time.now - 86400)
- end
-
- use_ui @ui do
- @cmd.execute
- end
- lines = @ui.output.split("\n")
- assert_equal("#{foo_bar.name}-#{foo_bar.version}", lines[0].split.first)
- assert_equal("#{bar_baz.name}-#{bar_baz.version}", lines[1].split.first)
- end
-
-end
diff --git a/test/rubygems/test_gem_commands_uninstall_command.rb b/test/rubygems/test_gem_commands_uninstall_command.rb
deleted file mode 100644
index b1b7a56868..0000000000
--- a/test/rubygems/test_gem_commands_uninstall_command.rb
+++ /dev/null
@@ -1,62 +0,0 @@
-require File.join(File.expand_path(File.dirname(__FILE__)), 'gemutilities')
-require File.join(File.expand_path(File.dirname(__FILE__)),
- 'gem_installer_test_case')
-require 'rubygems/commands/uninstall_command'
-
-class TestGemCommandsUninstallCommand < GemInstallerTestCase
-
- def setup
- super
-
- ui = MockGemUi.new
- util_setup_gem ui
-
- build_rake_in do
- use_ui ui do
- @installer.install
- end
- end
-
- @cmd = Gem::Commands::UninstallCommand.new
- @cmd.options[:executables] = true
- @executable = File.join(@gemhome, 'bin', 'executable')
- end
-
- def test_execute_removes_executable
- if win_platform?
- assert_equal true, File.exist?(@executable)
- else
- assert_equal true, File.symlink?(@executable)
- end
-
- # Evil hack to prevent false removal success
- FileUtils.rm_f @executable
- File.open(@executable, "wb+") {|f| f.puts "binary"}
-
- @cmd.options[:args] = Array(@spec.name)
- use_ui @ui do
- @cmd.execute
- end
-
- output = @ui.output.split "\n"
- assert_match(/Removing executable/, output.shift)
- assert_match(/Successfully uninstalled/, output.shift)
- assert_equal false, File.exist?(@executable)
- assert_nil output.shift, "UI output should have contained only two lines"
- end
-
- def test_execute_not_installed
- @cmd.options[:args] = ["foo"]
- e = assert_raises Gem::InstallError do
- use_ui @ui do
- @cmd.execute
- end
- end
-
- assert_match(/\Acannot uninstall, check `gem list -d foo`$/, e.message)
- output = @ui.output.split "\n"
- assert_empty output, "UI output should be empty after an uninstall error"
- end
-
-end
-
diff --git a/test/rubygems/test_gem_commands_unpack_command.rb b/test/rubygems/test_gem_commands_unpack_command.rb
deleted file mode 100644
index 6e53acbc54..0000000000
--- a/test/rubygems/test_gem_commands_unpack_command.rb
+++ /dev/null
@@ -1,115 +0,0 @@
-require File.join(File.expand_path(File.dirname(__FILE__)), 'gemutilities')
-require 'rubygems/commands/unpack_command'
-
-class TestGemCommandsUnpackCommand < RubyGemTestCase
-
- def setup
- super
-
- Dir.chdir @tempdir do
- @cmd = Gem::Commands::UnpackCommand.new
- end
- end
-
- def test_execute
- util_make_gems
-
- @cmd.options[:args] = %w[a b]
-
- use_ui @ui do
- Dir.chdir @tempdir do
- @cmd.execute
- end
- end
-
- assert File.exist?(File.join(@tempdir, 'a-3.a')), 'a should be installed'
- assert File.exist?(File.join(@tempdir, 'b-2')), 'b should be installed'
- end
-
- def test_execute_gem_path
- util_make_gems
-
- Gem.clear_paths
-
- gemhome2 = File.join @tempdir, 'gemhome2'
-
- Gem.send :set_paths, [gemhome2, @gemhome].join(File::PATH_SEPARATOR)
- Gem.send :set_home, gemhome2
-
- @cmd.options[:args] = %w[a]
-
- use_ui @ui do
- Dir.chdir @tempdir do
- @cmd.execute
- end
- end
-
- assert File.exist?(File.join(@tempdir, 'a-3.a'))
- end
-
- def test_execute_gem_path_missing
- util_make_gems
-
- Gem.clear_paths
-
- gemhome2 = File.join @tempdir, 'gemhome2'
-
- Gem.send :set_paths, [gemhome2, @gemhome].join(File::PATH_SEPARATOR)
- Gem.send :set_home, gemhome2
-
- @cmd.options[:args] = %w[z]
-
- use_ui @ui do
- Dir.chdir @tempdir do
- @cmd.execute
- end
- end
-
- assert_equal '', @ui.output
- end
-
- def test_execute_with_target_option
- util_make_gems
-
- target = 'with_target'
- @cmd.options[:args] = %w[a]
- @cmd.options[:target] = target
-
- use_ui @ui do
- Dir.chdir @tempdir do
- @cmd.execute
- end
- end
-
- assert File.exist?(File.join(@tempdir, target, 'a-3.a'))
- end
-
- def test_execute_exact_match
- foo_spec = quick_gem 'foo'
- foo_bar_spec = quick_gem 'foo_bar'
-
- use_ui @ui do
- Dir.chdir @tempdir do
- Gem::Builder.new(foo_spec).build
- Gem::Builder.new(foo_bar_spec).build
- end
- end
-
- foo_path = File.join(@tempdir, "#{foo_spec.full_name}.gem")
- foo_bar_path = File.join(@tempdir, "#{foo_bar_spec.full_name}.gem")
- Gem::Installer.new(foo_path).install
- Gem::Installer.new(foo_bar_path).install
-
- @cmd.options[:args] = %w[foo]
-
- use_ui @ui do
- Dir.chdir @tempdir do
- @cmd.execute
- end
- end
-
- assert File.exist?(File.join(@tempdir, foo_spec.full_name))
- end
-
-end
-
diff --git a/test/rubygems/test_gem_commands_update_command.rb b/test/rubygems/test_gem_commands_update_command.rb
deleted file mode 100644
index 4d7592a4c0..0000000000
--- a/test/rubygems/test_gem_commands_update_command.rb
+++ /dev/null
@@ -1,169 +0,0 @@
-require File.join(File.expand_path(File.dirname(__FILE__)), 'gemutilities')
-require 'rubygems/commands/update_command'
-
-class TestGemCommandsUpdateCommand < RubyGemTestCase
-
- def setup
- super
-
- @cmd = Gem::Commands::UpdateCommand.new
-
- @cmd.options[:generate_rdoc] = false
- @cmd.options[:generate_ri] = false
-
- util_setup_fake_fetcher
-
- @a1_path = File.join @gemhome, 'cache', "#{@a1.full_name}.gem"
- @a2_path = File.join @gemhome, 'cache', "#{@a2.full_name}.gem"
-
- util_setup_spec_fetcher @a1, @a2
-
- @fetcher.data["#{@gem_repo}gems/#{@a1.full_name}.gem"] =
- read_binary @a1_path
- @fetcher.data["#{@gem_repo}gems/#{@a2.full_name}.gem"] =
- read_binary @a2_path
- end
-
- def test_execute
- util_clear_gems
-
- Gem::Installer.new(@a1_path).install
-
- @cmd.options[:args] = []
- @cmd.options[:generate_rdoc] = true
- @cmd.options[:generate_ri] = true
-
- use_ui @ui do
- @cmd.execute
- end
-
- out = @ui.output.split "\n"
- assert_equal "Updating installed gems", out.shift
- assert_equal "Updating #{@a2.name}", out.shift
- assert_equal "Successfully installed #{@a2.full_name}", out.shift
- assert_equal "Gems updated: #{@a2.name}", out.shift
- assert_equal "Installing ri documentation for a-2...", out.shift
- assert_equal "Installing RDoc documentation for a-2...", out.shift
-
- assert_empty out
- end
-
- # before:
- # a1 -> c1.2
- # after:
- # a2 -> b2 # new dependency
- # a2 -> c2
-
- def test_execute_dependencies
- @a1.add_dependency 'c', '1.2'
-
- @c2 = quick_gem 'c', '2' do |s|
- s.files = %w[lib/code.rb]
- s.require_paths = %w[lib]
- end
-
- @a2.add_dependency 'c', '2'
- @a2.add_dependency 'b', '2'
-
- @b2_path = File.join @gemhome, 'cache', "#{@b2.full_name}.gem"
- @c1_2_path = File.join @gemhome, 'cache', "#{@c1_2.full_name}.gem"
- @c2_path = File.join @gemhome, 'cache', "#{@c2.full_name}.gem"
-
- @source_index = Gem::SourceIndex.new
- @source_index.add_spec @a1
- @source_index.add_spec @a2
- @source_index.add_spec @b2
- @source_index.add_spec @c1_2
- @source_index.add_spec @c2
-
- util_build_gem @a1
- util_build_gem @a2
- util_build_gem @c2
-
- @fetcher.data["#{@gem_repo}gems/#{@a1.full_name}.gem"] = read_binary @a1_path
- @fetcher.data["#{@gem_repo}gems/#{@a2.full_name}.gem"] = read_binary @a2_path
- @fetcher.data["#{@gem_repo}gems/#{@b2.full_name}.gem"] = read_binary @b2_path
- @fetcher.data["#{@gem_repo}gems/#{@c1_2.full_name}.gem"] =
- read_binary @c1_2_path
- @fetcher.data["#{@gem_repo}gems/#{@c2.full_name}.gem"] = read_binary @c2_path
-
- util_setup_spec_fetcher @a1, @a2, @b2, @c1_2, @c2
- util_clear_gems
-
- Gem::Installer.new(@c1_2_path).install
- Gem::Installer.new(@a1_path).install
-
- @cmd.options[:args] = []
-
- use_ui @ui do
- @cmd.execute
- end
-
- out = @ui.output.split "\n"
- assert_equal "Updating installed gems", out.shift
- assert_equal "Updating #{@a2.name}", out.shift
- assert_equal "Successfully installed #{@c2.full_name}", out.shift
- assert_equal "Successfully installed #{@b2.full_name}", out.shift
- assert_equal "Successfully installed #{@a2.full_name}", out.shift
- assert_equal "Gems updated: #{@c2.name}, #{@b2.name}, #{@a2.name}",
- out.shift
-
- assert_empty out
- end
-
- def test_execute_named
- util_clear_gems
-
- Gem::Installer.new(@a1_path).install
-
- @cmd.options[:args] = [@a1.name]
-
- use_ui @ui do
- @cmd.execute
- end
-
- out = @ui.output.split "\n"
- assert_equal "Updating installed gems", out.shift
- assert_equal "Updating #{@a2.name}", out.shift
- assert_equal "Successfully installed #{@a2.full_name}", out.shift
- assert_equal "Gems updated: #{@a2.name}", out.shift
-
- assert_empty out
- end
-
- def test_execute_named_up_to_date
- util_clear_gems
-
- Gem::Installer.new(@a2_path).install
-
- @cmd.options[:args] = [@a2.name]
-
- use_ui @ui do
- @cmd.execute
- end
-
- out = @ui.output.split "\n"
- assert_equal "Updating installed gems", out.shift
- assert_equal "Nothing to update", out.shift
-
- assert_empty out
- end
-
- def test_execute_up_to_date
- util_clear_gems
-
- Gem::Installer.new(@a2_path).install
-
- @cmd.options[:args] = []
-
- use_ui @ui do
- @cmd.execute
- end
-
- out = @ui.output.split "\n"
- assert_equal "Updating installed gems", out.shift
- assert_equal "Nothing to update", out.shift
-
- assert_empty out
- end
-end
diff --git a/test/rubygems/test_gem_config_file.rb b/test/rubygems/test_gem_config_file.rb
deleted file mode 100644
index fdae7faa32..0000000000
--- a/test/rubygems/test_gem_config_file.rb
+++ /dev/null
@@ -1,279 +0,0 @@
-#--
-# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
-# All rights reserved.
-# See LICENSE.txt for permissions.
-#++
-
-require File.join(File.expand_path(File.dirname(__FILE__)), 'gemutilities')
-require 'rubygems/config_file'
-
-class TestGemConfigFile < RubyGemTestCase
-
- def setup
- super
-
- @temp_conf = File.join @tempdir, '.gemrc'
-
- @cfg_args = %W[--config-file #{@temp_conf}]
-
- @orig_SYSTEM_WIDE_CONFIG_FILE = Gem::ConfigFile::SYSTEM_WIDE_CONFIG_FILE
- Gem::ConfigFile.send :remove_const, :SYSTEM_WIDE_CONFIG_FILE
- Gem::ConfigFile.send :const_set, :SYSTEM_WIDE_CONFIG_FILE,
- File.join(@tempdir, 'system-gemrc')
- Gem::ConfigFile::OPERATING_SYSTEM_DEFAULTS.clear
- Gem::ConfigFile::PLATFORM_DEFAULTS.clear
-
- util_config_file
- end
-
- def teardown
- Gem::ConfigFile::OPERATING_SYSTEM_DEFAULTS.clear
- Gem::ConfigFile::PLATFORM_DEFAULTS.clear
- Gem::ConfigFile.send :remove_const, :SYSTEM_WIDE_CONFIG_FILE
- Gem::ConfigFile.send :const_set, :SYSTEM_WIDE_CONFIG_FILE,
- @orig_SYSTEM_WIDE_CONFIG_FILE
-
- super
- end
-
- def test_initialize
- assert_equal @temp_conf, @cfg.config_file_name
-
- assert_equal false, @cfg.backtrace
- assert_equal true, @cfg.update_sources
- assert_equal false, @cfg.benchmark
- assert_equal Gem::ConfigFile::DEFAULT_BULK_THRESHOLD, @cfg.bulk_threshold
- assert_equal true, @cfg.verbose
- assert_equal [@gem_repo], Gem.sources
-
- File.open @temp_conf, 'w' do |fp|
- fp.puts ":backtrace: true"
- fp.puts ":update_sources: false"
- fp.puts ":benchmark: true"
- fp.puts ":bulk_threshold: 10"
- fp.puts ":verbose: false"
- fp.puts ":sources:"
- fp.puts " - http://more-gems.example.com"
- fp.puts "install: --wrappers"
- fp.puts ":gempath:"
- fp.puts "- /usr/ruby/1.8/lib/ruby/gems/1.8"
- fp.puts "- /var/ruby/1.8/gem_home"
- end
-
- util_config_file
-
- assert_equal true, @cfg.backtrace
- assert_equal true, @cfg.benchmark
- assert_equal 10, @cfg.bulk_threshold
- assert_equal false, @cfg.verbose
- assert_equal false, @cfg.update_sources
- assert_equal %w[http://more-gems.example.com], Gem.sources
- assert_equal '--wrappers', @cfg[:install]
- assert_equal(['/usr/ruby/1.8/lib/ruby/gems/1.8', '/var/ruby/1.8/gem_home'],
- @cfg.path)
- end
-
- def test_initialize_handle_arguments_config_file
- util_config_file %W[--config-file #{@temp_conf}]
-
- assert_equal @temp_conf, @cfg.config_file_name
- end
-
- def test_initialize_handle_arguments_config_file_with_other_params
- util_config_file %W[--config-file #{@temp_conf} --backtrace]
-
- assert_equal @temp_conf, @cfg.config_file_name
- end
-
- def test_initialize_handle_arguments_config_file_equals
- util_config_file %W[--config-file=#{@temp_conf}]
-
- assert_equal @temp_conf, @cfg.config_file_name
- end
-
- def test_initialize_operating_system_override
- Gem::ConfigFile::OPERATING_SYSTEM_DEFAULTS[:bulk_threshold] = 1
- Gem::ConfigFile::OPERATING_SYSTEM_DEFAULTS['install'] = '--no-env-shebang'
-
- Gem::ConfigFile::PLATFORM_DEFAULTS[:bulk_threshold] = 2
-
- util_config_file
-
- assert_equal 2, @cfg.bulk_threshold
- assert_equal '--no-env-shebang', @cfg[:install]
- end
-
- def test_initialize_platform_override
- Gem::ConfigFile::PLATFORM_DEFAULTS[:bulk_threshold] = 2
- Gem::ConfigFile::PLATFORM_DEFAULTS['install'] = '--no-env-shebang'
-
- File.open Gem::ConfigFile::SYSTEM_WIDE_CONFIG_FILE, 'w' do |fp|
- fp.puts ":bulk_threshold: 3"
- end
-
- util_config_file
-
- assert_equal 3, @cfg.bulk_threshold
- assert_equal '--no-env-shebang', @cfg[:install]
- end
-
- def test_initialize_system_wide_override
- File.open Gem::ConfigFile::SYSTEM_WIDE_CONFIG_FILE, 'w' do |fp|
- fp.puts ":backtrace: false"
- fp.puts ":bulk_threshold: 2048"
- end
-
- File.open @temp_conf, 'w' do |fp|
- fp.puts ":backtrace: true"
- end
-
- util_config_file
-
- assert_equal 2048, @cfg.bulk_threshold
- assert_equal true, @cfg.backtrace
- end
-
- def test_handle_arguments
- args = %w[--backtrace --bunch --of --args here]
-
- @cfg.handle_arguments args
-
- assert_equal %w[--bunch --of --args here], @cfg.args
- end
-
- def test_handle_arguments_backtrace
- assert_equal false, @cfg.backtrace
-
- args = %w[--backtrace]
-
- @cfg.handle_arguments args
-
- assert_equal true, @cfg.backtrace
- end
-
- def test_handle_arguments_benchmark
- assert_equal false, @cfg.benchmark
-
- args = %w[--benchmark]
-
- @cfg.handle_arguments args
-
- assert_equal true, @cfg.benchmark
- end
-
- def test_handle_arguments_debug
- old_dollar_DEBUG = $DEBUG
- assert_equal false, $DEBUG
-
- args = %w[--debug]
-
- @cfg.handle_arguments args
-
- assert_equal true, $DEBUG
- ensure
- $DEBUG = old_dollar_DEBUG
- end
-
- def test_handle_arguments_override
- File.open @temp_conf, 'w' do |fp|
- fp.puts ":benchmark: false"
- end
-
- util_config_file %W[--benchmark --config-file=#{@temp_conf}]
-
- assert_equal true, @cfg.benchmark
- end
-
- def test_handle_arguments_traceback
- assert_equal false, @cfg.backtrace
-
- args = %w[--traceback]
-
- @cfg.handle_arguments args
-
- assert_equal true, @cfg.backtrace
- end
-
- def test_really_verbose
- assert_equal false, @cfg.really_verbose
-
- @cfg.verbose = true
-
- assert_equal false, @cfg.really_verbose
-
- @cfg.verbose = 1
-
- assert_equal true, @cfg.really_verbose
- end
-
- def test_write
- @cfg.backtrace = true
- @cfg.benchmark = true
- @cfg.update_sources = false
- @cfg.bulk_threshold = 10
- @cfg.verbose = false
- Gem.sources.replace %w[http://more-gems.example.com]
- @cfg[:install] = '--wrappers'
-
- @cfg.write
-
- util_config_file
-
- # These should not be written out to the config file.
- assert_equal false, @cfg.backtrace, 'backtrace'
- assert_equal false, @cfg.benchmark, 'benchmark'
- assert_equal Gem::ConfigFile::DEFAULT_BULK_THRESHOLD, @cfg.bulk_threshold,
- 'bulk_threshold'
- assert_equal true, @cfg.update_sources, 'update_sources'
- assert_equal true, @cfg.verbose, 'verbose'
-
- assert_equal '--wrappers', @cfg[:install], 'install'
-
- # this should be written out to the config file.
- assert_equal %w[http://more-gems.example.com], Gem.sources
- end
-
- def test_write_from_hash
- File.open @temp_conf, 'w' do |fp|
- fp.puts ":backtrace: true"
- fp.puts ":benchmark: true"
- fp.puts ":bulk_threshold: 10"
- fp.puts ":update_sources: false"
- fp.puts ":verbose: false"
- fp.puts ":sources:"
- fp.puts " - http://more-gems.example.com"
- fp.puts "install: --wrappers"
- end
-
- util_config_file
-
- @cfg.backtrace = :junk
- @cfg.benchmark = :junk
- @cfg.update_sources = :junk
- @cfg.bulk_threshold = 20
- @cfg.verbose = :junk
- Gem.sources.replace %w[http://even-more-gems.example.com]
- @cfg[:install] = '--wrappers --no-rdoc'
-
- @cfg.write
-
- util_config_file
-
- # These should not be written out to the config file
- assert_equal true, @cfg.backtrace, 'backtrace'
- assert_equal true, @cfg.benchmark, 'benchmark'
- assert_equal 10, @cfg.bulk_threshold, 'bulk_threshold'
- assert_equal false, @cfg.update_sources, 'update_sources'
- assert_equal false, @cfg.verbose, 'verbose'
-
- assert_equal '--wrappers --no-rdoc', @cfg[:install], 'install'
-
- assert_equal %w[http://even-more-gems.example.com], Gem.sources
- end
-
- def util_config_file(args = @cfg_args)
- @cfg = Gem::ConfigFile.new args
- end
-
-end
-
diff --git a/test/rubygems/test_gem_dependency.rb b/test/rubygems/test_gem_dependency.rb
deleted file mode 100644
index 7b8c7bb45d..0000000000
--- a/test/rubygems/test_gem_dependency.rb
+++ /dev/null
@@ -1,190 +0,0 @@
-#--
-# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
-# All rights reserved.
-# See LICENSE.txt for permissions.
-#++
-
-require File.join(File.expand_path(File.dirname(__FILE__)), 'gemutilities')
-require 'rubygems/version'
-
-class TestGemDependency < RubyGemTestCase
-
- def setup
- super
-
- @pkg1_0 = Gem::Dependency.new 'pkg', ['> 1.0']
- @pkg1_1 = Gem::Dependency.new 'pkg', ['> 1.1']
-
- @oth1_0 = Gem::Dependency.new 'other', ['> 1.0']
-
- @r1_0 = Gem::Requirement.new ['> 1.0']
- end
-
- def dep(name, version)
- Gem::Dependency.new name, version
- end
-
- def test_initialize
- assert_equal "pkg", @pkg1_0.name
- assert_equal @r1_0, @pkg1_0.version_requirements
- end
-
- def test_initialize_double
- dep = Gem::Dependency.new("pkg", ["> 1.0", "< 2.0"])
-
- assert_equal Gem::Requirement.new(["> 1.0", "< 2.0"]),
- dep.version_requirements
- end
-
- def test_initialize_empty
- dep = Gem::Dependency.new("pkg", [])
- req = @r1_0
-
- req.instance_eval do
- @version = ">= 1.0"
- @op = ">="
- @nums = [1,0]
- @requirements = nil
- end
-
- dep.instance_eval do
- @version_requirement = req
- @version_requirements = nil
- end
-
- assert_equal Gem::Requirement.new([">= 1.0"]), dep.version_requirements
- end
-
- def test_initialize_version
- dep = Gem::Dependency.new 'pkg', Gem::Version.new('2')
-
- assert_equal 'pkg', dep.name
-
- assert_equal Gem::Requirement.new('= 2'), dep.version_requirements
- end
-
- def test_initialize_with_type
- dep = Gem::Dependency.new("pkg", [], :development)
- assert_equal(:development, dep.type)
- end
-
- def test_type_is_runtime_by_default
- assert_equal(:runtime, Gem::Dependency.new("pkg", []).type)
- end
-
- def test_type_is_restricted
- assert_raises ArgumentError do
- Gem::Dependency.new("pkg", [:sometimes])
- end
- end
-
- def test_equals2
- assert_equal @pkg1_0, @pkg1_0.dup
- assert_equal @pkg1_0.dup, @pkg1_0
-
- refute_equal @pkg1_0, @pkg1_1, "requirements different"
- refute_equal @pkg1_1, @pkg1_0, "requirements different"
-
- refute_equal @pkg1_0, @oth1_0, "names different"
- refute_equal @oth1_0, @pkg1_0, "names different"
-
- refute_equal @pkg1_0, Object.new
- refute_equal Object.new, @pkg1_0
- end
-
- def test_equals2_type
- runtime = Gem::Dependency.new("pkg", [])
- development = Gem::Dependency.new("pkg", [], :development)
-
- refute_equal(runtime, development)
- end
-
- def test_equals_tilde
- a0 = dep 'a', '0'
- a1 = dep 'a', '1'
- b0 = dep 'b', '0'
-
- pa0 = dep 'a', '>= 0'
- pa0r = dep(/a/, '>= 0')
- pab0r = dep(/a|b/, '>= 0')
-
- assert_match a0, a0, 'match self'
- assert_match pa0, a0, 'match version exact'
- assert_match pa0, a1, 'match version'
- assert_match pa0r, a0, 'match regex simple'
- assert_match pab0r, a0, 'match regex complex'
-
- refute_match pa0r, b0, 'fail match regex'
- refute_match pa0r, Object.new, 'fail match Object'
- end
-
- def test_equals_tilde_escape
- a1 = Gem::Dependency.new 'a', '1'
-
- pab1 = Gem::Dependency.new 'a|b', '>= 1'
- pab1r = Gem::Dependency.new(/a|b/, '>= 1')
-
- refute_match pab1, a1, 'escaped'
- assert_match pab1r, a1, 'exact regexp'
- end
-
- def test_equals_tilde_object
- a0 = Object.new
-
- def a0.name() 'a' end
- def a0.version() '0' end
-
- pa0 = Gem::Dependency.new 'a', '>= 0'
-
- assert_match pa0, a0, 'match version exact'
- end
-
- def test_equals_tilde_spec
- def spec(name, version)
- Gem::Specification.new do |spec|
- spec.name = name
- spec.version = version
- end
- end
-
- a0 = spec 'a', '0'
- a1 = spec 'a', '1'
- b0 = spec 'b', '0'
-
- pa0 = dep 'a', '>= 0'
- pa0r = dep(/a/, '>= 0')
- pab0r = dep(/a|b/, '>= 0')
-
- assert_match pa0, a0, 'match version exact'
- assert_match pa0, a1, 'match version'
-
- assert_match pa0r, a0, 'match regex simple'
- assert_match pa0r, a1, 'match regex simple'
-
- assert_match pab0r, a0, 'match regex complex'
- assert_match pab0r, b0, 'match regex complex'
-
- refute_match pa0r, b0, 'fail match regex'
- refute_match pa0r, Object.new, 'fail match Object'
- end
-
- def test_hash
- assert_equal @pkg1_0.hash, @pkg1_0.dup.hash
- assert_equal @pkg1_0.dup.hash, @pkg1_0.hash
-
- refute_equal @pkg1_0.hash, @pkg1_1.hash, "requirements different"
- refute_equal @pkg1_1.hash, @pkg1_0.hash, "requirements different"
-
- refute_equal @pkg1_0.hash, @oth1_0.hash, "names different"
- refute_equal @oth1_0.hash, @pkg1_0.hash, "names different"
- end
-
- def test_hash_type
- runtime = Gem::Dependency.new("pkg", [])
- development = Gem::Dependency.new("pkg", [], :development)
-
- refute_equal(runtime.hash, development.hash)
- end
-
-end
-
diff --git a/test/rubygems/test_gem_dependency_installer.rb b/test/rubygems/test_gem_dependency_installer.rb
deleted file mode 100644
index 2fea37adcc..0000000000
--- a/test/rubygems/test_gem_dependency_installer.rb
+++ /dev/null
@@ -1,651 +0,0 @@
-require File.join(File.expand_path(File.dirname(__FILE__)), 'gemutilities')
-require 'rubygems/dependency_installer'
-
-class TestGemDependencyInstaller < RubyGemTestCase
-
- def setup
- super
-
- @gems_dir = File.join @tempdir, 'gems'
- @cache_dir = File.join @gemhome, 'cache'
- FileUtils.mkdir @gems_dir
-
- write_file File.join('gems', 'a-1', 'bin', 'a_bin') do |fp|
- fp.puts "#!/usr/bin/ruby"
- end
-
- @a1, @a1_gem = util_gem 'a', '1' do |s| s.executables << 'a_bin' end
- @aa1, @aa1_gem = util_gem 'aa', '1'
- @a1_pre, @a1_pre_gem = util_gem 'a', '1.a'
-
- @b1, @b1_gem = util_gem 'b', '1' do |s|
- s.add_dependency 'a'
- s.add_development_dependency 'aa'
- end
-
- @d1, @d1_gem = util_gem 'd', '1'
- @d2, @d2_gem = util_gem 'd', '2'
-
- @x1_m, @x1_m_gem = util_gem 'x', '1' do |s|
- s.platform = Gem::Platform.new %w[cpu my_platform 1]
- end
-
- @x1_o, @x1_o_gem = util_gem 'x', '1' do |s|
- s.platform = Gem::Platform.new %w[cpu other_platform 1]
- end
-
- @w1, @w1_gem = util_gem 'w', '1' do |s| s.add_dependency 'x' end
-
- @y1, @y1_gem = util_gem 'y', '1'
- @y1_1_p, @y1_1_p_gem = util_gem 'y', '1.1' do |s|
- s.platform = Gem::Platform.new %w[cpu my_platform 1]
- end
-
- @z1, @z1_gem = util_gem 'z', '1' do |s| s.add_dependency 'y' end
-
- @fetcher = Gem::FakeFetcher.new
- Gem::RemoteFetcher.fetcher = @fetcher
-
- si = util_setup_spec_fetcher(@a1, @a1_pre, @b1, @d1, @d2, @x1_m, @x1_o, @w1, @y1,
- @y1_1_p, @z1)
-
- util_clear_gems
- end
-
- def test_install
- FileUtils.mv @a1_gem, @tempdir
- inst = nil
-
- Dir.chdir @tempdir do
- inst = Gem::DependencyInstaller.new
- inst.install 'a'
- end
-
- assert_equal Gem::SourceIndex.new(@a1.full_name => @a1),
- Gem::SourceIndex.from_installed_gems
-
- assert_equal [@a1], inst.installed_gems
- end
-
- def test_install_all_dependencies
- e1, e1_gem = util_gem 'e', '1' do |s|
- s.add_dependency 'b'
- end
-
- util_clear_gems
-
- FileUtils.mv @a1_gem, @tempdir
- FileUtils.mv @b1_gem, @tempdir
- FileUtils.mv e1_gem, @tempdir
- inst = nil
-
- Dir.chdir @tempdir do
- inst = Gem::DependencyInstaller.new :ignore_dependencies => true
- inst.install 'b'
- end
-
- Dir.chdir @tempdir do
- inst = Gem::DependencyInstaller.new
- inst.install 'e'
- end
-
- assert_equal %w[e-1 a-1], inst.installed_gems.map { |s| s.full_name }
- end
-
- def test_install_cache_dir
- FileUtils.mv @a1_gem, @tempdir
- FileUtils.mv @b1_gem, @tempdir
- inst = nil
-
- Dir.chdir @tempdir do
- inst = Gem::DependencyInstaller.new :cache_dir => @tempdir
- inst.install 'b'
- end
-
- assert_equal %w[a-1 b-1], inst.installed_gems.map { |s| s.full_name }
-
- assert File.exist?(File.join(@tempdir, 'cache', "#{@a1.full_name}.gem"))
- assert File.exist?(File.join(@tempdir, 'cache', "#{@b1.full_name}.gem"))
- end
-
- def test_install_dependencies_satisfied
- a2, a2_gem = util_gem 'a', '2'
-
- FileUtils.rm_rf File.join(@gemhome, 'gems')
- Gem.source_index.refresh!
-
- FileUtils.mv @a1_gem, @tempdir
- FileUtils.mv a2_gem, @tempdir # not in index
- FileUtils.mv @b1_gem, @tempdir
- inst = nil
-
- Dir.chdir @tempdir do
- inst = Gem::DependencyInstaller.new
- inst.install 'a-2'
- end
-
- FileUtils.rm File.join(@tempdir, "#{a2.full_name}.gem")
-
- Dir.chdir @tempdir do
- inst = Gem::DependencyInstaller.new
- inst.install 'b'
- end
-
- installed = Gem::SourceIndex.from_installed_gems.map { |n,s| s.full_name }
-
- assert_equal %w[a-2 b-1], installed.sort
-
- assert_equal %w[b-1], inst.installed_gems.map { |s| s.full_name }
- end
-
- def test_install_dependency
- FileUtils.mv @a1_gem, @tempdir
- FileUtils.mv @b1_gem, @tempdir
- inst = nil
-
- Dir.chdir @tempdir do
- inst = Gem::DependencyInstaller.new
- inst.install 'b'
- end
-
- assert_equal %w[a-1 b-1], inst.installed_gems.map { |s| s.full_name }
- end
-
- def test_install_dependency_development
- FileUtils.mv @a1_gem, @tempdir
- FileUtils.mv @aa1_gem, @tempdir
- FileUtils.mv @b1_gem, @tempdir
- inst = nil
-
- Dir.chdir @tempdir do
- inst = Gem::DependencyInstaller.new(:development => true)
- inst.install 'b'
- end
-
- assert_equal %w[a-1 aa-1 b-1], inst.installed_gems.map { |s| s.full_name }
- end
-
- def test_install_dependency_existing
- Gem::Installer.new(@a1_gem).install
- FileUtils.mv @a1_gem, @tempdir
- FileUtils.mv @b1_gem, @tempdir
- inst = nil
-
- Dir.chdir @tempdir do
- inst = Gem::DependencyInstaller.new
- inst.install 'b'
- end
-
- assert_equal %w[b-1], inst.installed_gems.map { |s| s.full_name }
- end
-
- def test_install_dependency_old
- e1, e1_gem = util_gem 'e', '1'
- f1, f1_gem = util_gem 'f', '1' do |s| s.add_dependency 'e' end
- f2, f2_gem = util_gem 'f', '2'
-
- FileUtils.mv e1_gem, @tempdir
- FileUtils.mv f1_gem, @tempdir
- FileUtils.mv f2_gem, @tempdir
- inst = nil
-
- Dir.chdir @tempdir do
- inst = Gem::DependencyInstaller.new
- inst.install 'f'
- end
-
- assert_equal %w[f-2], inst.installed_gems.map { |s| s.full_name }
- end
-
- def test_install_local
- FileUtils.mv @a1_gem, @tempdir
- inst = nil
-
- Dir.chdir @tempdir do
- inst = Gem::DependencyInstaller.new :domain => :local
- inst.install 'a-1.gem'
- end
-
- assert_equal %w[a-1], inst.installed_gems.map { |s| s.full_name }
- end
-
- def test_install_local_dependency
- FileUtils.mv @a1_gem, @tempdir
- FileUtils.mv @b1_gem, @tempdir
-
- inst = nil
-
- Dir.chdir @tempdir do
- inst = Gem::DependencyInstaller.new :domain => :local
- inst.install 'b-1.gem'
- end
-
- assert_equal %w[a-1 b-1], inst.installed_gems.map { |s| s.full_name }
- end
-
- def test_install_local_dependency_installed
- FileUtils.mv @a1_gem, @tempdir
- FileUtils.mv @b1_gem, @tempdir
-
- inst = nil
-
- Dir.chdir @tempdir do
- Gem::Installer.new('a-1.gem').install
-
- inst = Gem::DependencyInstaller.new :domain => :local
- inst.install 'b-1.gem'
- end
-
- assert_equal %w[b-1], inst.installed_gems.map { |s| s.full_name }
- end
-
- def test_install_local_subdir
- inst = nil
-
- Dir.chdir @tempdir do
- inst = Gem::DependencyInstaller.new :domain => :local
- inst.install 'gems/a-1.gem'
- end
-
- assert_equal %w[a-1], inst.installed_gems.map { |s| s.full_name }
- end
-
- def test_install_env_shebang
- FileUtils.mv @a1_gem, @tempdir
- inst = nil
-
- Dir.chdir @tempdir do
- inst = Gem::DependencyInstaller.new :env_shebang => true, :wrappers => true
- inst.install 'a'
- end
-
- assert_match %r|\A#!/\S+/env #{Gem::ConfigMap[:ruby_install_name]}\n|,
- File.read(File.join(@gemhome, 'bin', 'a_bin'))
- end
-
- def test_install_force
- FileUtils.mv @b1_gem, @tempdir
- si = util_setup_spec_fetcher @b1
- @fetcher.data['http://gems.example.com/gems/yaml'] = si.to_yaml
- inst = nil
-
- Dir.chdir @tempdir do
- inst = Gem::DependencyInstaller.new :force => true
- inst.install 'b'
- end
-
- assert_equal %w[b-1], inst.installed_gems.map { |s| s.full_name }
- end
-
- def test_install_ignore_dependencies
- FileUtils.mv @b1_gem, @tempdir
- inst = nil
-
- Dir.chdir @tempdir do
- inst = Gem::DependencyInstaller.new :ignore_dependencies => true
- inst.install 'b'
- end
-
- assert_equal %w[b-1], inst.installed_gems.map { |s| s.full_name }
- end
-
- def test_install_install_dir
- FileUtils.mv @a1_gem, @tempdir
- gemhome2 = File.join @tempdir, 'gemhome2'
- Dir.mkdir gemhome2
- inst = nil
-
- Dir.chdir @tempdir do
- inst = Gem::DependencyInstaller.new :install_dir => gemhome2
- inst.install 'a'
- end
-
- assert_equal %w[a-1], inst.installed_gems.map { |s| s.full_name }
-
- assert File.exist?(File.join(gemhome2, 'specifications',
- "#{@a1.full_name}.gemspec"))
- assert File.exist?(File.join(gemhome2, 'cache',
- "#{@a1.full_name}.gem"))
- end
-
- def test_install_domain_both
- a1_data = nil
- File.open @a1_gem, 'rb' do |fp|
- a1_data = fp.read
- end
-
- @fetcher.data['http://gems.example.com/gems/a-1.gem'] = a1_data
-
- FileUtils.mv @b1_gem, @tempdir
- inst = nil
-
- Dir.chdir @tempdir do
- inst = Gem::DependencyInstaller.new :domain => :both
- inst.install 'b'
- end
-
- assert_equal %w[a-1 b-1], inst.installed_gems.map { |s| s.full_name }
- a1, b1 = inst.installed_gems
-
- a1_expected = File.join(@gemhome, 'specifications',
- "#{a1.full_name}.gemspec")
- b1_expected = File.join(@gemhome, 'specifications',
- "#{b1.full_name}.gemspec")
-
- assert_equal a1_expected, a1.loaded_from
- assert_equal b1_expected, b1.loaded_from
- end
-
- def test_install_domain_both_no_network
- @fetcher.data["http://gems.example.com/gems/Marshal.#{@marshal_version}"] =
- proc do
- raise Gem::RemoteFetcher::FetchError
- end
-
- FileUtils.mv @a1_gem, @tempdir
- FileUtils.mv @b1_gem, @tempdir
- inst = nil
-
- Dir.chdir @tempdir do
- inst = Gem::DependencyInstaller.new :domain => :both
- inst.install 'b'
- end
-
- assert_equal %w[a-1 b-1], inst.installed_gems.map { |s| s.full_name }
- end
-
- def test_install_domain_local
- FileUtils.mv @b1_gem, @tempdir
- inst = nil
-
- Gem.source_index.remove_spec @a1.full_name
- Gem.source_index.remove_spec @a1_pre.full_name
-
- Dir.chdir @tempdir do
- e = assert_raises Gem::InstallError do
- inst = Gem::DependencyInstaller.new :domain => :local
- inst.install 'b'
- end
-
- assert_equal 'b requires a (>= 0, runtime)', e.message
- end
-
- assert_equal [], inst.installed_gems.map { |s| s.full_name }
- end
-
- def test_install_domain_remote
- a1_data = nil
- File.open @a1_gem, 'rb' do |fp|
- a1_data = fp.read
- end
-
- @fetcher.data['http://gems.example.com/gems/a-1.gem'] = a1_data
-
- inst = Gem::DependencyInstaller.new :domain => :remote
- inst.install 'a'
-
- assert_equal %w[a-1], inst.installed_gems.map { |s| s.full_name }
- end
-
- def test_install_dual_repository
- FileUtils.mv @a1_gem, @tempdir
- FileUtils.mv @b1_gem, @tempdir
- inst = nil
-
- gemhome2 = "#{@gemhome}2"
-
- Dir.chdir @tempdir do
- inst = Gem::DependencyInstaller.new :install_dir => gemhome2
- inst.install 'a'
- end
-
- ENV['GEM_HOME'] = @gemhome
- ENV['GEM_PATH'] = [@gemhome, gemhome2].join File::PATH_SEPARATOR
- Gem.clear_paths
-
- Dir.chdir @tempdir do
- inst = Gem::DependencyInstaller.new
- inst.install 'b'
- end
-
- assert_equal %w[b-1], inst.installed_gems.map { |s| s.full_name }
- end
-
- def test_install_remote
- a1_data = nil
- File.open @a1_gem, 'rb' do |fp|
- a1_data = fp.read
- end
-
- @fetcher.data['http://gems.example.com/gems/a-1.gem'] = a1_data
-
- inst = Gem::DependencyInstaller.new
-
- Dir.chdir @tempdir do
- inst.install 'a'
- end
-
- assert_equal %w[a-1], inst.installed_gems.map { |s| s.full_name }
- end
-
- def test_install_remote_dep
- a1_data = nil
- File.open @a1_gem, 'rb' do |fp|
- a1_data = fp.read
- end
-
- @fetcher.data['http://gems.example.com/gems/a-1.gem'] = a1_data
-
- inst = Gem::DependencyInstaller.new
-
- Dir.chdir @tempdir do
- dep = Gem::Dependency.new @a1.name, @a1.version
- inst.install dep
- end
-
- assert_equal %w[a-1], inst.installed_gems.map { |s| s.full_name }
- end
-
- def test_install_domain_remote_platform_newer
- a2_o, a2_o_gem = util_gem 'a', '2' do |s|
- s.platform = Gem::Platform.new %w[cpu other_platform 1]
- end
-
- util_clear_gems
-
- si = util_setup_spec_fetcher @a1, a2_o
-
- @fetcher.data['http://gems.example.com/gems/yaml'] = si.to_yaml
-
- a1_data = nil
- a2_o_data = nil
-
- File.open @a1_gem, 'rb' do |fp| a1_data = fp.read end
- File.open a2_o_gem, 'rb' do |fp| a2_o_data = fp.read end
-
- @fetcher.data["http://gems.example.com/gems/#{@a1.full_name}.gem"] =
- a1_data
- @fetcher.data["http://gems.example.com/gems/#{a2_o.full_name}.gem"] =
- a2_o_data
-
- inst = Gem::DependencyInstaller.new :domain => :remote
- inst.install 'a'
-
- assert_equal %w[a-1], inst.installed_gems.map { |s| s.full_name }
- end
-
- def test_install_reinstall
- Gem::Installer.new(@a1_gem).install
- FileUtils.mv @a1_gem, @tempdir
- inst = nil
-
- Dir.chdir @tempdir do
- inst = Gem::DependencyInstaller.new
- inst.install 'a'
- end
-
- assert_equal Gem::SourceIndex.new(@a1.full_name => @a1),
- Gem::SourceIndex.from_installed_gems
-
- assert_equal %w[a-1], inst.installed_gems.map { |s| s.full_name }
- end
-
- if defined? OpenSSL then
- def test_install_security_policy
- data = File.open(@a1_gem, 'rb') { |f| f.read }
- @fetcher.data['http://gems.example.com/gems/a-1.gem'] = data
-
- data = File.open(@b1_gem, 'rb') { |f| f.read }
- @fetcher.data['http://gems.example.com/gems/b-1.gem'] = data
-
- policy = Gem::Security::HighSecurity
- inst = Gem::DependencyInstaller.new :security_policy => policy
-
- e = assert_raises Gem::Exception do
- inst.install 'b'
- end
-
- assert_equal 'Unsigned gem', e.message
-
- assert_equal %w[], inst.installed_gems.map { |s| s.full_name }
- end
- end
-
- # Wrappers don't work on mswin
- unless win_platform? then
- def test_install_no_wrappers
- @fetcher.data['http://gems.example.com/gems/a-1.gem'] = read_binary(@a1_gem)
-
- inst = Gem::DependencyInstaller.new :wrappers => false
- inst.install 'a'
-
- refute_match(%r|This file was generated by RubyGems.|,
- File.read(File.join(@gemhome, 'bin', 'a_bin')))
- end
- end
-
- def test_install_version
- data = File.open(@d2_gem, 'rb') { |f| f.read }
- @fetcher.data['http://gems.example.com/gems/d-2.gem'] = data
-
- data = File.open(@d1_gem, 'rb') { |f| f.read }
- @fetcher.data['http://gems.example.com/gems/d-1.gem'] = data
-
- inst = Gem::DependencyInstaller.new
-
- inst.install 'd', '= 1'
-
- assert_equal %w[d-1], inst.installed_gems.map { |s| s.full_name }
- end
-
- def test_install_version_default
- data = File.open(@d2_gem, 'rb') { |f| f.read }
- @fetcher.data['http://gems.example.com/gems/d-2.gem'] = data
-
- data = File.open(@d1_gem, 'rb') { |f| f.read }
- @fetcher.data['http://gems.example.com/gems/d-1.gem'] = data
-
- inst = Gem::DependencyInstaller.new
- inst.install 'd'
-
- assert_equal %w[d-2], inst.installed_gems.map { |s| s.full_name }
- end
-
- def test_find_gems_gems_with_sources
- inst = Gem::DependencyInstaller.new
- dep = Gem::Dependency.new 'b', '>= 0'
-
- assert_equal [[@b1, @gem_repo]],
- inst.find_gems_with_sources(dep)
- end
-
- def test_find_gems_with_sources_local
- FileUtils.mv @a1_gem, @tempdir
- inst = Gem::DependencyInstaller.new
- dep = Gem::Dependency.new 'a', '>= 0'
- gems = nil
-
- Dir.chdir @tempdir do
- gems = inst.find_gems_with_sources dep
- end
-
- assert_equal 2, gems.length
- remote = gems.first
- assert_equal 'a-1', remote.first.full_name, 'remote spec'
- assert_equal @gem_repo, remote.last, 'remote path'
-
- local = gems.last
- assert_equal 'a-1', local.first.full_name, 'local spec'
- assert_equal File.join(@tempdir, "#{@a1.full_name}.gem"),
- local.last, 'local path'
- end
-
- def test_gather_dependencies
- inst = Gem::DependencyInstaller.new
- inst.find_spec_by_name_and_version 'b'
- inst.gather_dependencies
-
- assert_equal %w[a-1 b-1], inst.gems_to_install.map { |s| s.full_name }
- end
-
- def test_gather_dependencies_dropped
- b2, = util_gem 'b', '2'
- c1, = util_gem 'c', '1' do |s| s.add_dependency 'b' end
-
- util_clear_gems
-
- si = util_setup_spec_fetcher @a1, @b1, b2, c1
-
- inst = Gem::DependencyInstaller.new
- inst.find_spec_by_name_and_version 'c'
- inst.gather_dependencies
-
- assert_equal %w[b-2 c-1], inst.gems_to_install.map { |s| s.full_name }
- end
-
- def test_gather_dependencies_platform_alternate
- util_set_arch 'cpu-my_platform1'
-
- inst = Gem::DependencyInstaller.new
- inst.find_spec_by_name_and_version 'w'
- inst.gather_dependencies
-
- assert_equal %w[x-1-cpu-my_platform-1 w-1],
- inst.gems_to_install.map { |s| s.full_name }
- end
-
- def test_gather_dependencies_platform_bump
- inst = Gem::DependencyInstaller.new
- inst.find_spec_by_name_and_version 'z'
- inst.gather_dependencies
-
- assert_equal %w[y-1 z-1], inst.gems_to_install.map { |s| s.full_name }
- end
-
- def test_gather_dependencies_old_required
- e1, = util_gem 'e', '1' do |s| s.add_dependency 'd', '= 1' end
-
- util_clear_gems
-
- si = util_setup_spec_fetcher @d1, @d2, e1
-
- inst = Gem::DependencyInstaller.new
- inst.find_spec_by_name_and_version 'e'
- inst.gather_dependencies
-
- assert_equal %w[d-1 e-1], inst.gems_to_install.map { |s| s.full_name }
- end
-
- def test_prerelease_uses_pre_index
- installer = Gem::DependencyInstaller.new
- pre_installer = Gem::DependencyInstaller.new(:prerelease => true)
- dependency = Gem::Dependency.new('a', Gem::Requirement.default)
-
- releases = installer.find_gems_with_sources(dependency).map{ |gems, *| gems }
- prereleases = pre_installer.find_gems_with_sources(dependency).map{ |gems, *| gems }
-
- assert releases.select{ |s| s.name == 'a' and s.version.to_s == '1' }.first
- assert releases.select{ |s| s.name == 'a' and s.version.to_s == '1.a' }.empty?
- assert_equal [@a1_pre], prereleases
- end
-end
diff --git a/test/rubygems/test_gem_dependency_list.rb b/test/rubygems/test_gem_dependency_list.rb
deleted file mode 100644
index ddceb35256..0000000000
--- a/test/rubygems/test_gem_dependency_list.rb
+++ /dev/null
@@ -1,209 +0,0 @@
-#--
-# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
-# All rights reserved.
-# See LICENSE.txt for permissions.
-#++
-
-require File.join(File.expand_path(File.dirname(__FILE__)), 'gemutilities')
-require 'rubygems/dependency_list'
-
-class TestGemDependencyList < RubyGemTestCase
-
- def setup
- super
-
- @deplist = Gem::DependencyList.new
-
- @a1 = quick_gem 'a', '1'
- @a2 = quick_gem 'a', '2'
- @a3 = quick_gem 'a', '3'
-
- @b1 = quick_gem 'b', '1' do |s| s.add_dependency 'a', '>= 1' end
- @b2 = quick_gem 'b', '2' do |s| s.add_dependency 'a', '>= 1' end
-
- @c1 = quick_gem 'c', '1' do |s| s.add_dependency 'b', '>= 1' end
- @c2 = quick_gem 'c', '2'
-
- @d1 = quick_gem 'd', '1' do |s| s.add_dependency 'c', '>= 1' end
- end
-
- def test_self_from_source_index
- hash = {
- 'a-1' => @a1,
- 'b-2' => @b2,
- }
-
- si = Gem::SourceIndex.new hash
- deps = Gem::DependencyList.from_source_index si
-
- assert_equal %w[b-2 a-1], deps.dependency_order.map { |s| s.full_name }
- end
-
- def test_active_count
- assert_equal 0, @deplist.send(:active_count, [], {})
- assert_equal 1, @deplist.send(:active_count, [@a1], {})
- assert_equal 0, @deplist.send(:active_count, [@a1],
- { @a1.full_name => true })
- end
-
- def test_add
- assert_equal [], @deplist.dependency_order
-
- @deplist.add @a1, @b2
-
- assert_equal [@b2, @a1], @deplist.dependency_order
- end
-
- def test_dependency_order
- @deplist.add @a1, @b1, @c1, @d1
-
- order = @deplist.dependency_order
-
- assert_equal %w[d-1 c-1 b-1 a-1], order.map { |s| s.full_name }
- end
-
- def test_dependency_order_circle
- @a1.add_dependency 'c', '>= 1'
- @deplist.add @a1, @b1, @c1
-
- order = @deplist.dependency_order
-
- assert_equal %w[b-1 c-1 a-1], order.map { |s| s.full_name }
- end
-
- def test_dependency_order_diamond
- util_diamond
- e1 = quick_gem 'e', '1'
- @deplist.add e1
- @a1.add_dependency 'e', '>= 1'
-
- order = @deplist.dependency_order
-
- assert_equal %w[d-1 c-2 b-1 a-2 e-1], order.map { |s| s.full_name },
- 'deps of trimmed specs not included'
- end
-
- def test_dependency_order_no_dependendencies
- @deplist.add @a1, @c2
-
- order = @deplist.dependency_order
-
- assert_equal %w[c-2 a-1], order.map { |s| s.full_name }
- end
-
- def test_find_name
- @deplist.add @a1, @b2
-
- assert_equal "a-1", @deplist.find_name("a-1").full_name
- assert_equal "b-2", @deplist.find_name("b-2").full_name
-
- assert_nil @deplist.find_name("c-2")
- end
-
- def test_ok_eh
- assert @deplist.ok?, 'no dependencies'
-
- @deplist.add @b2
-
- refute @deplist.ok?, 'unsatisfied dependency'
-
- @deplist.add @a1
-
- assert @deplist.ok?, 'satisfied dependency'
- end
-
- def test_ok_eh_mismatch
- a1 = quick_gem 'a', '1'
- a2 = quick_gem 'a', '2'
-
- b = quick_gem 'b', '1' do |s| s.add_dependency 'a', '= 1' end
- c = quick_gem 'c', '1' do |s| s.add_dependency 'a', '= 2' end
-
- d = quick_gem 'd', '1' do |s|
- s.add_dependency 'b'
- s.add_dependency 'c'
- end
-
- @deplist.add a1, a2, b, c, d
-
- assert @deplist.ok?, 'this will break on require'
- end
-
- def test_ok_eh_redundant
- @deplist.add @a1, @a3, @b2
-
- @deplist.remove_by_name("a-1")
-
- assert @deplist.ok?
- end
-
- def test_ok_to_remove_eh
- @deplist.add @a1
-
- assert @deplist.ok_to_remove?("a-1")
-
- @deplist.add @b2
-
- refute @deplist.ok_to_remove?("a-1")
-
- @deplist.add @a2
-
- assert @deplist.ok_to_remove?("a-1")
- assert @deplist.ok_to_remove?("a-2")
- assert @deplist.ok_to_remove?("b-2")
- end
-
- def test_ok_to_remove_eh_after_sibling_removed
- @deplist.add @a1, @a2, @b2
-
- assert @deplist.ok_to_remove?("a-1")
- assert @deplist.ok_to_remove?("a-2")
-
- @deplist.remove_by_name("a-1")
-
- refute @deplist.ok_to_remove?("a-2")
- end
-
- def test_remove_by_name
- @deplist.add @a1, @b2
-
- @deplist.remove_by_name "a-1"
-
- refute @deplist.ok?
- end
-
- def test_tsort_each_node
- util_diamond
-
- order = %w[a-1 a-2 b-1 c-2 d-1]
-
- @deplist.tsort_each_node do |node|
- assert_equal order.shift, node.full_name
- end
-
- assert_empty order
- end
-
- def test_tsort_each_child
- util_diamond
-
- order = %w[a-2]
-
- @deplist.tsort_each_child(@b1) do |node|
- assert_equal order.shift, node.full_name
- end
-
- assert_empty order
- end
-
- # d1 -> b1 -> a1
- # d1 -> c2 -> a2
- def util_diamond
- @c2.add_dependency 'a', '>= 2'
- @d1.add_dependency 'b'
-
- @deplist.add @a1, @a2, @b1, @c2, @d1
- end
-
-end
-
diff --git a/test/rubygems/test_gem_digest.rb b/test/rubygems/test_gem_digest.rb
deleted file mode 100755
index 13613c96a8..0000000000
--- a/test/rubygems/test_gem_digest.rb
+++ /dev/null
@@ -1,46 +0,0 @@
-#--
-# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
-# All rights reserved.
-# See LICENSE.txt for permissions.
-#++
-
-require File.join(File.expand_path(File.dirname(__FILE__)), 'gemutilities')
-require "rubygems/digest/md5"
-require "rubygems/digest/sha1"
-require "rubygems/digest/sha2"
-
-class TestRubygemsGemDigest < RubyGemTestCase
-
- def test_sha256_hex_digest_works
- digester = Gem::SHA256.new
- assert_equal "b5d4045c3f466fa91fe2cc6abe79232a1a57cdf104f7a26e716e0a1e2789df78", digester.hexdigest("ABC")
- end
-
- def test_sha256_digest_works
- digester = Gem::SHA256.new
- assert_equal "\265\324\004\\?Fo\251\037\342\314j\276y#*\032W\315\361\004\367\242nqn\n\036'\211\337x",
- digester.digest("ABC")
- end
-
- def test_sha1_hex_digest_works
- digester = Gem::SHA1.new
- assert_equal "3c01bdbb26f358bab27f267924aa2c9a03fcfdb8", digester.hexdigest("ABC")
- end
-
- def test_sha1_digest_works
- digester = Gem::SHA1.new
- assert_equal "<\001\275\273&\363X\272\262\177&y$\252,\232\003\374\375\270", digester.digest("ABC")
- end
-
- def test_md5_hex_digest_works
- digester = Gem::MD5.new
- assert_equal "902fbdd2b1df0c4f70b4a5d23525e932", digester.hexdigest("ABC")
- end
-
- def test_md5_digest_works
- digester = Gem::MD5.new
- assert_equal "\220/\275\322\261\337\fOp\264\245\3225%\3512", digester.digest("ABC")
- end
-
-end
-
diff --git a/test/rubygems/test_gem_doc_manager.rb b/test/rubygems/test_gem_doc_manager.rb
deleted file mode 100644
index bcedb87b56..0000000000
--- a/test/rubygems/test_gem_doc_manager.rb
+++ /dev/null
@@ -1,37 +0,0 @@
-#--
-# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
-# All rights reserved.
-# See LICENSE.txt for permissions.
-#++
-
-require File.join(File.expand_path(File.dirname(__FILE__)), 'gemutilities')
-require 'rubygems/doc_manager'
-
-class TestGemDocManager < RubyGemTestCase
-
- def setup
- super
-
- @spec = quick_gem 'a'
- @manager = Gem::DocManager.new(@spec)
- end
-
- def test_uninstall_doc_unwritable
- orig_mode = File.stat(@spec.installation_path).mode
-
- # File.chmod has no effect on MS Windows directories (it needs ACL).
- if win_platform?
- skip("test_uninstall_doc_unwritable skipped on MS Windows")
- else
- File.chmod(0, @spec.installation_path)
- end
-
- assert_raises Gem::FilePermissionError do
- @manager.uninstall_doc
- end
- ensure
- File.chmod orig_mode, @spec.installation_path
- end
-
-end
-
diff --git a/test/rubygems/test_gem_ext_configure_builder.rb b/test/rubygems/test_gem_ext_configure_builder.rb
deleted file mode 100644
index 8f8525f5fd..0000000000
--- a/test/rubygems/test_gem_ext_configure_builder.rb
+++ /dev/null
@@ -1,84 +0,0 @@
-require File.join(File.expand_path(File.dirname(__FILE__)), 'gemutilities')
-require 'rubygems/ext'
-
-class TestGemExtConfigureBuilder < RubyGemTestCase
-
- def setup
- super
-
- @makefile_body = "all:\n\t@echo ok\ninstall:\n\t@echo ok"
-
- @ext = File.join @tempdir, 'ext'
- @dest_path = File.join @tempdir, 'prefix'
-
- FileUtils.mkdir_p @ext
- FileUtils.mkdir_p @dest_path
- end
-
- def test_self_build
- skip("test_self_build skipped on MS Windows (VC++)") if vc_windows?
-
- File.open File.join(@ext, './configure'), 'w' do |configure|
- configure.puts "#!/bin/sh\necho \"#{@makefile_body}\" > Makefile"
- end
-
- output = []
-
- Dir.chdir @ext do
- Gem::Ext::ConfigureBuilder.build nil, nil, @dest_path, output
- end
-
- assert_equal "sh ./configure --prefix=#{@dest_path}", output.shift
- assert_equal "", output.shift
- assert_equal "make", output.shift
- assert_match(/^ok$/m, output.shift)
- assert_equal "make install", output.shift
- assert_match(/^ok$/m, output.shift)
- end
-
- def test_self_build_fail
- skip("test_self_build_fail skipped on MS Windows (VC++)") if vc_windows?
- output = []
-
- error = assert_raises Gem::InstallError do
- Dir.chdir @ext do
- Gem::Ext::ConfigureBuilder.build nil, nil, @dest_path, output
- end
- end
-
- shell_error_msg = %r{(\./configure: .*)|(Can't open \./configure(?:: No such file or directory)?)}
- sh_prefix_configure = "sh ./configure --prefix="
-
- expected = %r(configure failed:
-
-#{Regexp.escape sh_prefix_configure}#{Regexp.escape @dest_path}
-.*?: #{shell_error_msg}
-)
-
- assert_match expected, error.message
-
- assert_equal "#{sh_prefix_configure}#{@dest_path}", output.shift
- assert_match %r(#{shell_error_msg}), output.shift
- assert_equal true, output.empty?
- end
-
- def test_self_build_has_makefile
- if vc_windows? && !nmake_found?
- skip("test_self_build_has_makefile skipped - nmake not found")
- end
-
- File.open File.join(@ext, 'Makefile'), 'w' do |makefile|
- makefile.puts @makefile_body
- end
-
- output = []
- Dir.chdir @ext do
- Gem::Ext::ConfigureBuilder.build nil, nil, @dest_path, output
- end
-
- assert_equal make_command, output[0]
- assert_equal "#{make_command} install", output[2]
- end
-
-end
-
diff --git a/test/rubygems/test_gem_ext_ext_conf_builder.rb b/test/rubygems/test_gem_ext_ext_conf_builder.rb
deleted file mode 100644
index e815a6555f..0000000000
--- a/test/rubygems/test_gem_ext_ext_conf_builder.rb
+++ /dev/null
@@ -1,127 +0,0 @@
-require File.join(File.expand_path(File.dirname(__FILE__)), 'gemutilities')
-require 'rubygems/ext'
-
-class TestGemExtExtConfBuilder < RubyGemTestCase
-
- def setup
- super
-
- @ext = File.join @tempdir, 'ext'
- @dest_path = File.join @tempdir, 'prefix'
-
- FileUtils.mkdir_p @ext
- FileUtils.mkdir_p @dest_path
- end
-
- def test_class_build
- if vc_windows? && !nmake_found?
- skip("test_class_build skipped - nmake not found")
- end
-
- File.open File.join(@ext, 'extconf.rb'), 'w' do |extconf|
- extconf.puts "require 'mkmf'\ncreate_makefile 'foo'"
- end
-
- output = []
-
- Dir.chdir @ext do
- Gem::Ext::ExtConfBuilder.build 'extconf.rb', nil, @dest_path, output
- end
-
- expected = [
- "ruby extconf.rb",
- "creating Makefile\n",
- "make",
- "make: Nothing to be done for `all'.\n",
- "make install",
- "make: Nothing to be done for `install'.\n"
- ]
-
- assert_match(/^#{Gem.ruby} extconf.rb/, output[0])
- assert_equal "creating Makefile\n", output[1]
- case RUBY_PLATFORM
- when /mswin/ then
- assert_equal "nmake", output[2]
- assert_equal "nmake install", output[4]
- else
- assert_equal "make", output[2]
- assert_equal "make install", output[4]
- end
- end
-
- def test_class_build_extconf_fail
- if vc_windows? && !nmake_found?
- skip("test_class_build_extconf_fail skipped - nmake not found")
- end
-
- File.open File.join(@ext, 'extconf.rb'), 'w' do |extconf|
- extconf.puts "require 'mkmf'"
- extconf.puts "have_library 'nonexistent' or abort 'need libnonexistent'"
- extconf.puts "create_makefile 'foo'"
- end
-
- output = []
-
- error = assert_raises Gem::InstallError do
- Dir.chdir @ext do
- Gem::Ext::ExtConfBuilder.build 'extconf.rb', nil, @dest_path, output
- end
- end
-
- assert_match(/\Aextconf failed:
-
-#{Gem.ruby} extconf.rb.*
-checking for main\(\) in .*?nonexistent/m, error.message)
-
- assert_match(/^#{Gem.ruby} extconf.rb/, output[0])
- end
-
- def test_class_make
- if vc_windows? && !nmake_found?
- skip("test_class_make skipped - nmake not found")
- end
-
- output = []
- makefile_path = File.join(@ext, 'Makefile')
- File.open makefile_path, 'w' do |makefile|
- makefile.puts "RUBYARCHDIR = $(foo)$(target_prefix)"
- makefile.puts "RUBYLIBDIR = $(bar)$(target_prefix)"
- makefile.puts "all:"
- makefile.puts "install:"
- end
-
- Dir.chdir @ext do
- Gem::Ext::ExtConfBuilder.make @ext, output
- end
-
- assert_equal make_command, output[0]
- assert_equal "#{make_command} install", output[2]
-
- edited_makefile = <<-EOF
-RUBYARCHDIR = #{@ext}$(target_prefix)
-RUBYLIBDIR = #{@ext}$(target_prefix)
-all:
-install:
- EOF
-
- assert_equal edited_makefile, File.read(makefile_path)
- end
-
- def test_class_make_no_Makefile
- error = assert_raises Gem::InstallError do
- Dir.chdir @ext do
- Gem::Ext::ExtConfBuilder.make @ext, ['output']
- end
- end
-
- expected = <<-EOF.strip
-Makefile not found:
-
-output
- EOF
-
- assert_equal expected, error.message
- end
-
-end
-
diff --git a/test/rubygems/test_gem_ext_rake_builder.rb b/test/rubygems/test_gem_ext_rake_builder.rb
deleted file mode 100644
index 18d74c382a..0000000000
--- a/test/rubygems/test_gem_ext_rake_builder.rb
+++ /dev/null
@@ -1,81 +0,0 @@
-require File.join(File.expand_path(File.dirname(__FILE__)), 'gemutilities')
-require 'rubygems/ext'
-
-class TestGemExtRakeBuilder < RubyGemTestCase
- def setup
- super
-
- @ext = File.join @tempdir, 'ext'
- @dest_path = File.join @tempdir, 'prefix'
-
- FileUtils.mkdir_p @ext
- FileUtils.mkdir_p @dest_path
- end
-
- def test_class_build
- File.open File.join(@ext, 'mkrf_conf.rb'), 'w' do |mkrf_conf|
- mkrf_conf.puts <<-EO_MKRF
- File.open("Rakefile","w") do |f|
- f.puts "task :default"
- end
- EO_MKRF
- end
-
- output = []
- realdir = nil # HACK /tmp vs. /private/tmp
-
- build_rake_in do
- Dir.chdir @ext do
- realdir = Dir.pwd
- Gem::Ext::RakeBuilder.build 'mkrf_conf.rb', nil, @dest_path, output
- end
- end
-
- output = output.join "\n"
-
- expected = [
- "#{@@ruby} mkrf_conf.rb",
- "",
- "#{@@rake} RUBYARCHDIR=#{@dest_path} RUBYLIBDIR=#{@dest_path}",
- "(in #{realdir})\n"
- ]
-
- refute_match %r%^rake failed:%, output
- assert_match %r%^#{Regexp.escape @@ruby} mkrf_conf\.rb%, output
- assert_match %r%^#{Regexp.escape @@rake} RUBYARCHDIR=#{Regexp.escape @dest_path} RUBYLIBDIR=#{Regexp.escape @dest_path}%, output
- end
-
- def test_class_build_fail
- File.open File.join(@ext, 'mkrf_conf.rb'), 'w' do |mkrf_conf|
- mkrf_conf.puts <<-EO_MKRF
- File.open("Rakefile","w") do |f|
- f.puts "task :default do abort 'fail' end"
- end
- EO_MKRF
- end
-
- output = []
-
- error = assert_raises Gem::InstallError do
- build_rake_in do
- Dir.chdir @ext do
- Gem::Ext::RakeBuilder.build "mkrf_conf.rb", nil, @dest_path, output
- end
- end
- end
-
- expected = <<-EOF.strip
-rake failed:
-
-#{@@ruby} mkrf_conf.rb
-
-#{@@rake} RUBYARCHDIR=#{@dest_path} RUBYLIBDIR=#{@dest_path}
- EOF
-
- assert_match %r%^rake failed:%, error.message
- assert_match %r%^#{Regexp.escape @@ruby} mkrf_conf\.rb%, error.message
- assert_match %r%^#{Regexp.escape @@rake} RUBYARCHDIR=#{Regexp.escape @dest_path} RUBYLIBDIR=#{Regexp.escape @dest_path}%, error.message
- end
-
-end
-
diff --git a/test/rubygems/test_gem_format.rb b/test/rubygems/test_gem_format.rb
deleted file mode 100644
index d09ab6ce19..0000000000
--- a/test/rubygems/test_gem_format.rb
+++ /dev/null
@@ -1,67 +0,0 @@
-#--
-# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
-# All rights reserved.
-# See LICENSE.txt for permissions.
-#++
-
-require File.join(File.expand_path(File.dirname(__FILE__)), 'gemutilities')
-require File.join(File.expand_path(File.dirname(__FILE__)), 'simple_gem')
-require 'rubygems/format'
-
-class TestGemFormat < RubyGemTestCase
-
- def setup
- super
-
- @simple_gem = SIMPLE_GEM
- end
-
- def test_from_file_by_path
- util_make_gems
-
- gems = Dir[File.join(@gemhome, 'cache', '*.gem')]
-
- names = [@a1, @a2, @a3a, @a_evil9, @b2, @c1_2, @pl1].map do |spec|
- spec.original_name
- end
-
- gems_n_names = gems.sort.zip names
-
- gems_n_names.each do |gemfile, name|
- spec = Gem::Format.from_file_by_path(gemfile).spec
-
- assert_equal name, spec.original_name
- end
- end
-
- def test_from_file_by_path_nonexistent
- assert_raises Gem::Exception do
- Gem::Format.from_file_by_path '/nonexistent'
- end
- end
-
- def test_from_io_garbled
- e = assert_raises Gem::Package::FormatError do
- # subtly bogus input
- Gem::Format.from_io(StringIO.new(@simple_gem.upcase))
- end
-
- assert_equal 'No metadata found!', e.message
-
- e = assert_raises Gem::Package::FormatError do
- # Totally bogus input
- Gem::Format.from_io(StringIO.new(@simple_gem.reverse))
- end
-
- assert_equal 'No metadata found!', e.message
-
- e = assert_raises Gem::Package::FormatError do
- # This was intentionally screws up YAML parsing.
- Gem::Format.from_io(StringIO.new(@simple_gem.gsub(/:/, "boom")))
- end
-
- assert_equal 'No metadata found!', e.message
- end
-
-end
-
diff --git a/test/rubygems/test_gem_gem_path_searcher.rb b/test/rubygems/test_gem_gem_path_searcher.rb
deleted file mode 100644
index 5737c0b226..0000000000
--- a/test/rubygems/test_gem_gem_path_searcher.rb
+++ /dev/null
@@ -1,67 +0,0 @@
-require File.join(File.expand_path(File.dirname(__FILE__)), 'gemutilities')
-require 'rubygems/gem_path_searcher'
-
-class Gem::GemPathSearcher
- attr_accessor :gemspecs
- attr_accessor :lib_dirs
-end
-
-class TestGemGemPathSearcher < RubyGemTestCase
-
- def setup
- super
-
- @foo1 = quick_gem 'foo', '0.1' do |s|
- s.require_paths << 'lib2'
- s.files << 'lib/foo.rb'
- end
-
- path = File.join 'gems', @foo1.full_name, 'lib', 'foo.rb'
- write_file(path) { |fp| fp.puts "# #{path}" }
-
- @foo2 = quick_gem 'foo', '0.2'
- @bar1 = quick_gem 'bar', '0.1'
- @bar2 = quick_gem 'bar', '0.2'
-
- @fetcher = Gem::FakeFetcher.new
- Gem::RemoteFetcher.fetcher = @fetcher
-
- Gem.source_index = util_setup_spec_fetcher @foo1, @foo2, @bar1, @bar2
-
- @gps = Gem::GemPathSearcher.new
- end
-
- def test_find
- assert_equal @foo1, @gps.find('foo')
- end
-
- def test_find_all
- assert_equal [@foo1], @gps.find_all('foo')
- end
-
- def test_init_gemspecs
- assert_equal [@bar2, @bar1, @foo2, @foo1], @gps.init_gemspecs
- end
-
- def test_lib_dirs_for
- lib_dirs = @gps.lib_dirs_for(@foo1)
- expected = File.join @gemhome, 'gems', @foo1.full_name, '{lib,lib2}'
-
- assert_equal expected, lib_dirs
- end
-
- def test_matching_file_eh
- refute @gps.matching_file?(@foo1, 'bar')
- assert @gps.matching_file?(@foo1, 'foo')
- end
-
- def test_matching_files
- assert_equal [], @gps.matching_files(@foo1, 'bar')
-
- expected = File.join @foo1.full_gem_path, 'lib', 'foo.rb'
-
- assert_equal [expected], @gps.matching_files(@foo1, 'foo')
- end
-
-end
-
diff --git a/test/rubygems/test_gem_gem_runner.rb b/test/rubygems/test_gem_gem_runner.rb
deleted file mode 100644
index 24a45e4281..0000000000
--- a/test/rubygems/test_gem_gem_runner.rb
+++ /dev/null
@@ -1,45 +0,0 @@
-require File.join(File.expand_path(File.dirname(__FILE__)), 'gemutilities')
-require 'rubygems/gem_runner'
-
-class TestGemGemRunner < RubyGemTestCase
-
- def test_do_configuration
- Gem.clear_paths
-
- temp_conf = File.join @tempdir, '.gemrc'
-
- other_gem_path = File.join @tempdir, 'other_gem_path'
- other_gem_home = File.join @tempdir, 'other_gem_home'
-
- Gem.ensure_gem_subdirectories other_gem_path
- Gem.ensure_gem_subdirectories other_gem_home
-
- File.open temp_conf, 'w' do |fp|
- fp.puts "gem: --commands"
- fp.puts "gemhome: #{other_gem_home}"
- fp.puts "gempath:"
- fp.puts " - #{other_gem_path}"
- fp.puts "rdoc: --all"
- end
-
- gr = Gem::GemRunner.new
- gr.send :do_configuration, %W[--config-file #{temp_conf}]
-
- assert_equal [other_gem_path, other_gem_home], Gem.path
- assert_equal %w[--commands], Gem::Command.extra_args
- assert_equal %w[--all], Gem::DocManager.configured_args
- end
-
- def test_build_args__are_handled
- Gem.clear_paths
-
- gr = Gem::GemRunner.new
- assert_raises(Gem::SystemExitException) do
- gr.run(%W[--help -- --build_arg1 --build_arg2])
- end
-
- assert_equal %w[--build_arg1 --build_arg2], Gem::Command.build_args
- end
-
-end
-
diff --git a/test/rubygems/test_gem_indexer.rb b/test/rubygems/test_gem_indexer.rb
deleted file mode 100644
index a48acbbfe6..0000000000
--- a/test/rubygems/test_gem_indexer.rb
+++ /dev/null
@@ -1,641 +0,0 @@
-#--
-# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
-# All rights reserved.
-# See LICENSE.txt for permissions.
-#++
-
-require File.join(File.expand_path(File.dirname(__FILE__)), 'gemutilities')
-
-require 'rubygems/indexer'
-
-unless ''.respond_to? :to_xs then
- warn "Gem::Indexer tests are being skipped. Install builder gem."
-end
-
-class TestGemIndexer < RubyGemTestCase
-
- def setup
- super
-
- util_make_gems
-
- @d2_0 = quick_gem 'd', '2.0' do |s|
- s.date = Gem::Specification::TODAY - 86400 * 3
- end
- util_build_gem @d2_0
-
- @d2_0_a = quick_gem 'd', '2.0.a'
- util_build_gem @d2_0_a
-
- @d2_0_b = quick_gem 'd', '2.0.b'
- util_build_gem @d2_0_b
-
- gems = File.join(@tempdir, 'gems')
- FileUtils.mkdir_p gems
- cache_gems = File.join @gemhome, 'cache', '*.gem'
- FileUtils.mv Dir[cache_gems], gems
-
- @indexer = Gem::Indexer.new @tempdir, :rss_title => 'ExampleForge gems',
- :rss_host => 'example.com',
- :rss_gems_host => 'gems.example.com'
- end
-
- def test_initialize
- assert_equal @tempdir, @indexer.dest_directory
- assert_equal File.join(Dir.tmpdir, "gem_generate_index_#{$$}"),
- @indexer.directory
-
- indexer = Gem::Indexer.new @tempdir
- assert indexer.build_legacy
- assert indexer.build_modern
-
- indexer = Gem::Indexer.new @tempdir, :build_legacy => false,
- :build_modern => true
- refute indexer.build_legacy
- assert indexer.build_modern
-
- indexer = Gem::Indexer.new @tempdir, :build_legacy => true,
- :build_modern => false
- assert indexer.build_legacy
- refute indexer.build_modern
- end
-
- def test_build_indicies
- spec = quick_gem 'd', '2.0'
- spec.instance_variable_set :@original_platform, ''
-
- @indexer.make_temp_directories
-
- index = Gem::SourceIndex.new
- index.add_spec spec
-
- use_ui @ui do
- @indexer.build_indicies index
- end
-
- specs_path = File.join @indexer.directory, "specs.#{@marshal_version}"
- specs_dump = Gem.read_binary specs_path
- specs = Marshal.load specs_dump
-
- expected = [
- ['d', Gem::Version.new('2.0'), 'ruby'],
- ]
-
- assert_equal expected, specs, 'specs'
-
- latest_specs_path = File.join @indexer.directory,
- "latest_specs.#{@marshal_version}"
- latest_specs_dump = Gem.read_binary latest_specs_path
- latest_specs = Marshal.load latest_specs_dump
-
- expected = [
- ['d', Gem::Version.new('2.0'), 'ruby'],
- ]
-
- assert_equal expected, latest_specs, 'latest_specs'
- end
-
- def test_generate_index
- use_ui @ui do
- @indexer.generate_index
- end
-
- assert_indexed @tempdir, 'yaml'
- assert_indexed @tempdir, 'yaml.Z'
- assert_indexed @tempdir, "Marshal.#{@marshal_version}"
- assert_indexed @tempdir, "Marshal.#{@marshal_version}.Z"
-
- quickdir = File.join @tempdir, 'quick'
- marshal_quickdir = File.join quickdir, "Marshal.#{@marshal_version}"
-
- assert File.directory?(quickdir)
- assert File.directory?(marshal_quickdir)
-
- assert_indexed quickdir, "index"
- assert_indexed quickdir, "index.rz"
-
- quick_index = File.read File.join(quickdir, 'index')
- expected = <<-EOF
-a-1
-a-2
-a_evil-9
-b-2
-c-1.2
-d-2.0
-pl-1-i386-linux
- EOF
-
- assert_equal expected, quick_index
-
- assert_indexed quickdir, "latest_index"
- assert_indexed quickdir, "latest_index.rz"
-
- latest_quick_index = File.read File.join(quickdir, 'latest_index')
- expected = <<-EOF
-a-2
-a_evil-9
-b-2
-c-1.2
-d-2.0
-pl-1-i386-linux
- EOF
-
- assert_equal expected, latest_quick_index
-
- assert_indexed quickdir, "#{@a1.full_name}.gemspec.rz"
- assert_indexed quickdir, "#{@a2.full_name}.gemspec.rz"
- assert_indexed quickdir, "#{@b2.full_name}.gemspec.rz"
- assert_indexed quickdir, "#{@c1_2.full_name}.gemspec.rz"
-
- assert_indexed quickdir, "#{@pl1.original_name}.gemspec.rz"
- refute_indexed quickdir, "#{@pl1.full_name}.gemspec.rz"
-
- assert_indexed marshal_quickdir, "#{@a1.full_name}.gemspec.rz"
- assert_indexed marshal_quickdir, "#{@a2.full_name}.gemspec.rz"
-
- refute_indexed quickdir, "#{@c1_2.full_name}.gemspec"
- refute_indexed marshal_quickdir, "#{@c1_2.full_name}.gemspec"
-
- assert_indexed @tempdir, "specs.#{@marshal_version}"
- assert_indexed @tempdir, "specs.#{@marshal_version}.gz"
-
- assert_indexed @tempdir, "latest_specs.#{@marshal_version}"
- assert_indexed @tempdir, "latest_specs.#{@marshal_version}.gz"
-
- expected = <<-EOF
-<?xml version="1.0"?>
-<rss version="2.0">
- <channel>
- <title>ExampleForge gems</title>
- <link>http://example.com</link>
- <description>Recently released gems from http://example.com</description>
- <generator>RubyGems v#{Gem::RubyGemsVersion}</generator>
- <docs>http://cyber.law.harvard.edu/rss/rss.html</docs>
- <item>
- <title>a-2</title>
- <description>
-&lt;pre&gt;This is a test description&lt;/pre&gt;
- </description>
- <author>example@example.com (A User)</author>
- <guid>a-2</guid>
- <enclosure url="http://gems.example.com/gems/a-2.gem"
- length="3072" type="application/octet-stream" />
- <pubDate>#{Gem::Specification::TODAY.rfc2822}</pubDate>
- <link>http://example.com</link>
- </item>
- <item>
- <title>a_evil-9</title>
- <description>
-&lt;pre&gt;This is a test description&lt;/pre&gt;
- </description>
- <author>example@example.com (A User)</author>
- <guid>a_evil-9</guid>
- <enclosure url="http://gems.example.com/gems/a_evil-9.gem"
- length="3072" type="application/octet-stream" />
- <pubDate>#{Gem::Specification::TODAY.rfc2822}</pubDate>
- <link>http://example.com</link>
- </item>
- <item>
- <title>b-2</title>
- <description>
-&lt;pre&gt;This is a test description&lt;/pre&gt;
- </description>
- <author>example@example.com (A User)</author>
- <guid>b-2</guid>
- <enclosure url="http://gems.example.com/gems/b-2.gem"
- length="3072" type="application/octet-stream" />
- <pubDate>#{Gem::Specification::TODAY.rfc2822}</pubDate>
- <link>http://example.com</link>
- </item>
- <item>
- <title>c-1.2</title>
- <description>
-&lt;pre&gt;This is a test description&lt;/pre&gt;
- </description>
- <author>example@example.com (A User)</author>
- <guid>c-1.2</guid>
- <enclosure url="http://gems.example.com/gems/c-1.2.gem"
- length="3072" type="application/octet-stream" />
- <pubDate>#{Gem::Specification::TODAY.rfc2822}</pubDate>
- <link>http://example.com</link>
- </item>
- <item>
- <title>pl-1-x86-linux</title>
- <description>
-&lt;pre&gt;This is a test description&lt;/pre&gt;
- </description>
- <author>example@example.com (A User)</author>
- <guid>pl-1-x86-linux</guid>
- <enclosure url="http://gems.example.com/gems/pl-1-x86-linux.gem"
- length="3072" type="application/octet-stream" />
- <pubDate>#{Gem::Specification::TODAY.rfc2822}</pubDate>
- <link>http://example.com</link>
- </item>
- <item>
- <title>a-1</title>
- <description>
-&lt;pre&gt;This line is really, really long. So long, in fact, that it is more than
-eighty characters long! The purpose of this line is for testing wrapping
-behavior because sometimes people don't wrap their text to eighty characters.
-Without the wrapping, the text might not look good in the RSS feed.
-
-Also, a list:
- * An entry that's actually kind of sort
- * an entry that's really long, which will probably get wrapped funny.
-That's ok, somebody wasn't thinking straight when they made it more than
-eighty characters.&lt;/pre&gt;
- </description>
- <author>example@example.com (Example), example2@example.com (Example2)</author>
- <guid>a-1</guid>
- <enclosure url="http://gems.example.com/gems/a-1.gem"
- length="3584" type="application/octet-stream" />
- <pubDate>#{(Gem::Specification::TODAY - 86400).rfc2822}</pubDate>
- <link>http://a.example.com</link>
- </item>
- </channel>
-</rss>
- EOF
-
- gems_rss = File.read File.join(@tempdir, 'index.rss')
-
- assert_equal expected, gems_rss
- end
-
- def test_generate_index_legacy
- @indexer.build_modern = false
- @indexer.build_legacy = true
-
- use_ui @ui do
- @indexer.generate_index
- end
-
- assert_indexed @tempdir, 'yaml'
- assert_indexed @tempdir, 'yaml.Z'
- assert_indexed @tempdir, "Marshal.#{@marshal_version}"
- assert_indexed @tempdir, "Marshal.#{@marshal_version}.Z"
-
- quickdir = File.join @tempdir, 'quick'
- marshal_quickdir = File.join quickdir, "Marshal.#{@marshal_version}"
-
- assert File.directory?(quickdir)
- assert File.directory?(marshal_quickdir)
-
- assert_indexed quickdir, "index"
- assert_indexed quickdir, "index.rz"
-
- assert_indexed quickdir, "latest_index"
- assert_indexed quickdir, "latest_index.rz"
-
- assert_indexed quickdir, "#{@a1.full_name}.gemspec.rz"
- assert_indexed quickdir, "#{@a2.full_name}.gemspec.rz"
- assert_indexed quickdir, "#{@b2.full_name}.gemspec.rz"
- assert_indexed quickdir, "#{@c1_2.full_name}.gemspec.rz"
-
- assert_indexed quickdir, "#{@pl1.original_name}.gemspec.rz"
- refute_indexed quickdir, "#{@pl1.full_name}.gemspec.rz"
-
- assert_indexed marshal_quickdir, "#{@a1.full_name}.gemspec.rz"
- assert_indexed marshal_quickdir, "#{@a2.full_name}.gemspec.rz"
-
- refute_indexed quickdir, "#{@c1_2.full_name}.gemspec"
- refute_indexed marshal_quickdir, "#{@c1_2.full_name}.gemspec"
-
- refute_indexed @tempdir, "specs.#{@marshal_version}"
- refute_indexed @tempdir, "specs.#{@marshal_version}.gz"
-
- refute_indexed @tempdir, "latest_specs.#{@marshal_version}"
- refute_indexed @tempdir, "latest_specs.#{@marshal_version}.gz"
- end
-
- def test_generate_index_legacy_back_to_back
- @indexer.build_modern = true
- @indexer.build_legacy = true
-
- use_ui @ui do
- @indexer.generate_index
- end
-
- @indexer = Gem::Indexer.new @tempdir
- @indexer.build_modern = false
- @indexer.build_legacy = true
-
- use_ui @ui do
- @indexer.generate_index
- end
-
- assert_indexed @tempdir, 'yaml'
- assert_indexed @tempdir, 'yaml.Z'
- assert_indexed @tempdir, "Marshal.#{@marshal_version}"
- assert_indexed @tempdir, "Marshal.#{@marshal_version}.Z"
-
- quickdir = File.join @tempdir, 'quick'
- marshal_quickdir = File.join quickdir, "Marshal.#{@marshal_version}"
-
- assert File.directory?(quickdir)
- assert File.directory?(marshal_quickdir)
-
- assert_indexed quickdir, "index"
- assert_indexed quickdir, "index.rz"
-
- assert_indexed quickdir, "latest_index"
- assert_indexed quickdir, "latest_index.rz"
-
- assert_indexed quickdir, "#{@a1.full_name}.gemspec.rz"
- assert_indexed quickdir, "#{@a2.full_name}.gemspec.rz"
- assert_indexed quickdir, "#{@b2.full_name}.gemspec.rz"
- assert_indexed quickdir, "#{@c1_2.full_name}.gemspec.rz"
-
- assert_indexed quickdir, "#{@pl1.original_name}.gemspec.rz"
-
- assert_indexed marshal_quickdir, "#{@a1.full_name}.gemspec.rz"
- assert_indexed marshal_quickdir, "#{@a2.full_name}.gemspec.rz"
-
- assert_indexed @tempdir, "specs.#{@marshal_version}"
- assert_indexed @tempdir, "specs.#{@marshal_version}.gz"
-
- assert_indexed @tempdir, "latest_specs.#{@marshal_version}"
- assert_indexed @tempdir, "latest_specs.#{@marshal_version}.gz"
- end
-
- def test_generate_index_modern
- @indexer.build_modern = true
- @indexer.build_legacy = false
-
- use_ui @ui do
- @indexer.generate_index
- end
-
- refute_indexed @tempdir, 'yaml'
- refute_indexed @tempdir, 'yaml.Z'
- refute_indexed @tempdir, "Marshal.#{@marshal_version}"
- refute_indexed @tempdir, "Marshal.#{@marshal_version}.Z"
-
- quickdir = File.join @tempdir, 'quick'
- marshal_quickdir = File.join quickdir, "Marshal.#{@marshal_version}"
-
- assert File.directory?(quickdir), 'quickdir should be directory'
- assert File.directory?(marshal_quickdir)
-
- refute_indexed quickdir, "index"
- refute_indexed quickdir, "index.rz"
-
- refute_indexed quickdir, "latest_index"
- refute_indexed quickdir, "latest_index.rz"
-
- refute_indexed quickdir, "#{@a1.full_name}.gemspec.rz"
- refute_indexed quickdir, "#{@a2.full_name}.gemspec.rz"
- refute_indexed quickdir, "#{@b2.full_name}.gemspec.rz"
- refute_indexed quickdir, "#{@c1_2.full_name}.gemspec.rz"
-
- refute_indexed quickdir, "#{@pl1.original_name}.gemspec.rz"
- refute_indexed quickdir, "#{@pl1.full_name}.gemspec.rz"
-
- assert_indexed marshal_quickdir, "#{@a1.full_name}.gemspec.rz"
- assert_indexed marshal_quickdir, "#{@a2.full_name}.gemspec.rz"
-
- refute_indexed quickdir, "#{@c1_2.full_name}.gemspec"
- refute_indexed marshal_quickdir, "#{@c1_2.full_name}.gemspec"
-
- assert_indexed @tempdir, "specs.#{@marshal_version}"
- assert_indexed @tempdir, "specs.#{@marshal_version}.gz"
-
- assert_indexed @tempdir, "latest_specs.#{@marshal_version}"
- assert_indexed @tempdir, "latest_specs.#{@marshal_version}.gz"
- end
-
- def test_generate_index_modern_back_to_back
- @indexer.build_modern = true
- @indexer.build_legacy = true
-
- use_ui @ui do
- @indexer.generate_index
- end
-
- @indexer = Gem::Indexer.new @tempdir
- @indexer.build_modern = true
- @indexer.build_legacy = false
-
- use_ui @ui do
- @indexer.generate_index
- end
-
- assert_indexed @tempdir, 'yaml'
- assert_indexed @tempdir, 'yaml.Z'
- assert_indexed @tempdir, "Marshal.#{@marshal_version}"
- assert_indexed @tempdir, "Marshal.#{@marshal_version}.Z"
-
- quickdir = File.join @tempdir, 'quick'
- marshal_quickdir = File.join quickdir, "Marshal.#{@marshal_version}"
-
- assert File.directory?(quickdir)
- assert File.directory?(marshal_quickdir)
-
- assert_indexed quickdir, "index"
- assert_indexed quickdir, "index.rz"
-
- assert_indexed quickdir, "latest_index"
- assert_indexed quickdir, "latest_index.rz"
-
- assert_indexed quickdir, "#{@a1.full_name}.gemspec.rz"
- assert_indexed quickdir, "#{@a2.full_name}.gemspec.rz"
- assert_indexed quickdir, "#{@b2.full_name}.gemspec.rz"
- assert_indexed quickdir, "#{@c1_2.full_name}.gemspec.rz"
-
- assert_indexed quickdir, "#{@pl1.original_name}.gemspec.rz"
-
- assert_indexed marshal_quickdir, "#{@a1.full_name}.gemspec.rz"
- assert_indexed marshal_quickdir, "#{@a2.full_name}.gemspec.rz"
-
- assert_indexed @tempdir, "specs.#{@marshal_version}"
- assert_indexed @tempdir, "specs.#{@marshal_version}.gz"
-
- assert_indexed @tempdir, "latest_specs.#{@marshal_version}"
- assert_indexed @tempdir, "latest_specs.#{@marshal_version}.gz"
- end
-
- def test_generate_index_ui
- use_ui @ui do
- @indexer.generate_index
- end
-
- assert_match %r%^Loading 10 gems from #{Regexp.escape @tempdir}$%,
- @ui.output
- assert_match %r%^\.\.\.\.\.\.\.\.\.\.$%, @ui.output
- assert_match %r%^Loaded all gems$%, @ui.output
- assert_match %r%^Generating Marshal quick index gemspecs for 7 gems$%,
- @ui.output
- assert_match %r%^Generating YAML quick index gemspecs for 7 gems$%,
- @ui.output
- assert_match %r%^Complete$%, @ui.output
- assert_match %r%^Generating specs index$%, @ui.output
- assert_match %r%^Generating latest specs index$%, @ui.output
- assert_match %r%^Generating quick index$%, @ui.output
- assert_match %r%^Generating latest index$%, @ui.output
- assert_match %r%^Generating prerelease specs index$%, @ui.output
- assert_match %r%^Generating Marshal master index$%, @ui.output
- assert_match %r%^Generating YAML master index for 7 gems \(this may take a while\)$%, @ui.output
- assert_match %r%^Complete$%, @ui.output
- assert_match %r%^Compressing indicies$%, @ui.output
-
- assert_equal '', @ui.error
- end
-
- def test_generate_index_master
- use_ui @ui do
- @indexer.generate_index
- end
-
- yaml_path = File.join @tempdir, 'yaml'
- dump_path = File.join @tempdir, "Marshal.#{@marshal_version}"
-
- yaml_index = YAML.load_file yaml_path
- dump_index = Marshal.load Gem.read_binary(dump_path)
-
- dump_index.each do |_,gem|
- gem.send :remove_instance_variable, :@loaded
- end
-
- assert_equal yaml_index, dump_index,
- "expected YAML and Marshal to produce identical results"
- end
-
- def test_generate_index_specs
- use_ui @ui do
- @indexer.generate_index
- end
-
- specs_path = File.join @tempdir, "specs.#{@marshal_version}"
-
- specs_dump = Gem.read_binary specs_path
- specs = Marshal.load specs_dump
-
- expected = [
- ['a', Gem::Version.new(1), 'ruby'],
- ['a', Gem::Version.new(2), 'ruby'],
- ['a_evil', Gem::Version.new(9), 'ruby'],
- ['b', Gem::Version.new(2), 'ruby'],
- ['c', Gem::Version.new('1.2'), 'ruby'],
- ['d', Gem::Version.new('2.0'), 'ruby'],
- ['pl', Gem::Version.new(1), 'i386-linux'],
- ]
-
- assert_equal expected, specs
-
- assert_same specs[0].first, specs[1].first,
- 'identical names not identical'
-
- assert_same specs[0][1], specs[-1][1],
- 'identical versions not identical'
-
- assert_same specs[0].last, specs[1].last,
- 'identical platforms not identical'
-
- refute_same specs[1][1], specs[5][1],
- 'different versions not different'
- end
-
- def test_generate_index_latest_specs
- use_ui @ui do
- @indexer.generate_index
- end
-
- latest_specs_path = File.join @tempdir, "latest_specs.#{@marshal_version}"
-
- latest_specs_dump = Gem.read_binary latest_specs_path
- latest_specs = Marshal.load latest_specs_dump
-
- expected = [
- ['a', Gem::Version.new(2), 'ruby'],
- ['a_evil', Gem::Version.new(9), 'ruby'],
- ['b', Gem::Version.new(2), 'ruby'],
- ['c', Gem::Version.new('1.2'), 'ruby'],
- ['d', Gem::Version.new('2.0'), 'ruby'],
- ['pl', Gem::Version.new(1), 'i386-linux'],
- ]
-
- assert_equal expected, latest_specs
-
- assert_same latest_specs[0][1], latest_specs[2][1],
- 'identical versions not identical'
-
- assert_same latest_specs[0].last, latest_specs[1].last,
- 'identical platforms not identical'
- end
-
- def test_generate_index_prerelease_specs
- use_ui @ui do
- @indexer.generate_index
- end
-
- prerelease_specs_path = File.join @tempdir, "prerelease_specs.#{@marshal_version}"
-
- prerelease_specs_dump = Gem.read_binary prerelease_specs_path
- prerelease_specs = Marshal.load prerelease_specs_dump
-
- assert_equal [['a', Gem::Version.new('3.a'), 'ruby'],
- ['d', Gem::Version.new('2.0.a'), 'ruby'],
- ['d', Gem::Version.new('2.0.b'), 'ruby']],
- prerelease_specs
- end
-
- def test_update_index
- use_ui @ui do
- @indexer.generate_index
- end
-
- quickdir = File.join @tempdir, 'quick'
- marshal_quickdir = File.join quickdir, "Marshal.#{@marshal_version}"
-
- assert File.directory?(quickdir)
- assert File.directory?(marshal_quickdir)
-
- @d2_1 = quick_gem 'd', '2.1'
- util_build_gem @d2_1
- @d2_1_tuple = [@d2_1.name, @d2_1.version, @d2_1.original_platform]
-
- @d2_1_a = quick_gem 'd', '2.2.a'
- util_build_gem @d2_1_a
- @d2_1_a_tuple = [@d2_1_a.name, @d2_1_a.version, @d2_1_a.original_platform]
-
- gems = File.join @tempdir, 'gems'
- FileUtils.mv File.join(@gemhome, 'cache', "#{@d2_1.full_name}.gem"), gems
- FileUtils.mv File.join(@gemhome, 'cache', "#{@d2_1_a.full_name}.gem"), gems
-
- use_ui @ui do
- @indexer.update_index
- end
-
- assert_indexed marshal_quickdir, "#{@d2_1.full_name}.gemspec.rz"
-
- specs_index = Marshal.load Gem.read_binary(@indexer.dest_specs_index)
-
- assert_includes specs_index, @d2_1_tuple
- refute_includes specs_index, @d2_1_a_tuple
-
- latest_specs_index = Marshal.load \
- Gem.read_binary(@indexer.dest_latest_specs_index)
-
- assert_includes latest_specs_index, @d2_1_tuple
- assert_includes latest_specs_index,
- [@d2_0.name, @d2_0.version, @d2_0.original_platform]
- refute_includes latest_specs_index, @d2_1_a_tuple
-
- pre_specs_index = Marshal.load \
- Gem.read_binary(@indexer.dest_prerelease_specs_index)
-
- assert_includes pre_specs_index, @d2_1_a_tuple
- refute_includes pre_specs_index, @d2_1_tuple
- end
-
- def assert_indexed(dir, name)
- file = File.join dir, name
- assert File.exist?(file), "#{file} does not exist"
- end
-
- def refute_indexed(dir, name)
- file = File.join dir, name
- refute File.exist?(file), "#{file} exists"
- end
-
-end if ''.respond_to? :to_xs
-
diff --git a/test/rubygems/test_gem_install_update_options.rb b/test/rubygems/test_gem_install_update_options.rb
deleted file mode 100644
index fb77678d0d..0000000000
--- a/test/rubygems/test_gem_install_update_options.rb
+++ /dev/null
@@ -1,74 +0,0 @@
-require File.join(File.expand_path(File.dirname(__FILE__)),
- 'gem_installer_test_case')
-require 'rubygems/install_update_options'
-require 'rubygems/command'
-
-class TestGemInstallUpdateOptions < GemInstallerTestCase
-
- def setup
- super
-
- @cmd = Gem::Command.new 'dummy', 'dummy'
- @cmd.extend Gem::InstallUpdateOptions
- @cmd.add_install_update_options
- end
-
- def test_add_install_update_options
- args = %w[-i /install_to --rdoc --ri -E -f -t -w -P HighSecurity
- --ignore-dependencies --format-exec --include-dependencies]
-
- assert @cmd.handles?(args)
- end
-
- def test_prerelease
- @cmd.handle_options %w[--prerelease]
- assert_equal true, @cmd.options[:prerelease]
- end
-
- def test_security_policy
- @cmd.handle_options %w[-P HighSecurity]
-
- assert_equal Gem::Security::HighSecurity, @cmd.options[:security_policy]
- end
-
- def test_security_policy_unknown
- @cmd.add_install_update_options
-
- assert_raises OptionParser::InvalidArgument do
- @cmd.handle_options %w[-P UnknownSecurity]
- end
- end
-
- def test_user_install_enabled
- @cmd.handle_options %w[--user-install]
-
- assert @cmd.options[:user_install]
-
- @installer = Gem::Installer.new @gem, @cmd.options
- @installer.install
- assert File.exist?(File.join(Gem.user_dir, 'gems'))
- assert File.exist?(File.join(Gem.user_dir, 'gems',
- @spec.full_name))
- end
-
- def test_user_install_disabled_read_only
- if win_platform?
- skip('test_user_install_disabled_read_only test skipped on MS Windows')
- else
- @cmd.handle_options %w[--no-user-install]
-
- refute @cmd.options[:user_install]
-
- File.chmod 0755, @userhome
- FileUtils.chmod 0000, @gemhome
-
- assert_raises(Gem::FilePermissionError) do
- @installer = Gem::Installer.new @gem, @cmd.options
- end
- end
- ensure
- FileUtils.chmod 0755, @gemhome
- end
-
-end
-
diff --git a/test/rubygems/test_gem_installer.rb b/test/rubygems/test_gem_installer.rb
deleted file mode 100644
index 00f22e403d..0000000000
--- a/test/rubygems/test_gem_installer.rb
+++ /dev/null
@@ -1,917 +0,0 @@
-#--
-# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
-# All rights reserved.
-# See LICENSE.txt for permissions.
-#++
-
-require File.join(File.expand_path(File.dirname(__FILE__)),
- 'gem_installer_test_case')
-
-class TestGemInstaller < GemInstallerTestCase
-
- def test_app_script_text
- util_make_exec '2', ''
-
- expected = <<-EOF
-#!#{Gem.ruby}
-#
-# This file was generated by RubyGems.
-#
-# The application 'a' is installed as part of a gem, and
-# this file is here to facilitate running it.
-#
-
-require 'rubygems'
-
-version = \">= 0\"
-
-if ARGV.first =~ /^_(.*)_$/ and Gem::Version.correct? $1 then
- version = $1
- ARGV.shift
-end
-
-gem 'a', version
-load Gem.bin_path('a', 'my_exec', version)
- EOF
-
- wrapper = @installer.app_script_text 'my_exec'
- assert_equal expected, wrapper
- end
-
- def test_build_extensions_none
- use_ui @ui do
- @installer.build_extensions
- end
-
- assert_equal '', @ui.output
- assert_equal '', @ui.error
-
- refute File.exist?('gem_make.out')
- end
-
- def test_build_extensions_extconf_bad
- @spec.extensions << 'extconf.rb'
-
- e = assert_raises Gem::Installer::ExtensionBuildError do
- use_ui @ui do
- @installer.build_extensions
- end
- end
-
- assert_match(/\AERROR: Failed to build gem native extension.$/, e.message)
-
- assert_equal "Building native extensions. This could take a while...\n",
- @ui.output
- assert_equal '', @ui.error
-
- gem_make_out = File.join @gemhome, 'gems', @spec.full_name, 'gem_make.out'
- expected = <<-EOF
-#{Gem.ruby} extconf.rb
-#{Gem.ruby}: No such file or directory -- extconf.rb (LoadError)
- EOF
-
- assert_match %r%#{Regexp.escape Gem.ruby} extconf.rb%,
- File.read(gem_make_out)
- assert_match %r%#{Regexp.escape Gem.ruby}: No such file%,
- File.read(gem_make_out)
- end
-
- def test_build_extensions_unsupported
- @spec.extensions << nil
-
- e = assert_raises Gem::Installer::ExtensionBuildError do
- use_ui @ui do
- @installer.build_extensions
- end
- end
-
- assert_match(/^No builder for extension ''$/, e.message)
-
- assert_equal "Building native extensions. This could take a while...\n",
- @ui.output
- assert_equal '', @ui.error
-
- assert_equal "No builder for extension ''\n", File.read('gem_make.out')
- ensure
- FileUtils.rm_f 'gem_make.out'
- end
-
- def test_ensure_dependency
- dep = Gem::Dependency.new 'a', '>= 2'
- assert @installer.ensure_dependency(@spec, dep)
-
- dep = Gem::Dependency.new 'b', '> 2'
- e = assert_raises Gem::InstallError do
- @installer.ensure_dependency @spec, dep
- end
-
- assert_equal 'a requires b (> 2, runtime)', e.message
- end
-
- def test_expand_and_validate_gem_dir
- @installer.gem_dir = '/nonexistent'
- expanded_gem_dir = @installer.send(:expand_and_validate_gem_dir)
- if win_platform?
- expected = File.expand_path('/nonexistent').downcase
- expanded_gem_dir = expanded_gem_dir.downcase
- else
- expected = '/nonexistent'
- end
-
- assert_equal expected, expanded_gem_dir
- end
-
- def test_extract_files
- format = Object.new
- def format.file_entries
- [[{'size' => 7, 'mode' => 0400, 'path' => 'thefile'}, 'thefile']]
- end
-
- @installer.format = format
-
- @installer.extract_files
-
- thefile_path = File.join(util_gem_dir, 'thefile')
- assert_equal 'thefile', File.read(thefile_path)
-
- unless Gem.win_platform? then
- assert_equal 0400, File.stat(thefile_path).mode & 0777
- end
- end
-
- def test_extract_files_bad_dest
- @installer.gem_dir = 'somedir'
- @installer.format = nil
- e = assert_raises ArgumentError do
- @installer.extract_files
- end
-
- assert_equal 'format required to extract from', e.message
- end
-
- def test_extract_files_relative
- format = Object.new
- def format.file_entries
- [[{'size' => 10, 'mode' => 0644, 'path' => '../thefile'}, '../thefile']]
- end
-
- @installer.format = format
-
- e = assert_raises Gem::InstallError do
- @installer.extract_files
- end
-
- assert_equal "attempt to install file into \"../thefile\" under #{util_gem_dir.inspect}",
- e.message
- assert_equal false, File.file?(File.join(@tempdir, '../thefile')),
- "You may need to remove this file if you broke the test once"
- end
-
- def test_extract_files_absolute
- format = Object.new
- def format.file_entries
- [[{'size' => 8, 'mode' => 0644, 'path' => '/thefile'}, '/thefile']]
- end
-
- @installer.format = format
-
- e = assert_raises Gem::InstallError do
- @installer.extract_files
- end
-
- assert_equal 'attempt to install file into "/thefile"', e.message
- assert_equal false, File.file?(File.join('/thefile')),
- "You may need to remove this file if you broke the test once"
- end
-
- def test_generate_bin_bindir
- @installer.wrappers = true
-
- @spec.executables = ["my_exec"]
- @spec.bindir = '.'
-
- exec_file = @installer.formatted_program_filename "my_exec"
- exec_path = File.join util_gem_dir(@spec.version), exec_file
- File.open exec_path, 'w' do |f|
- f.puts '#!/usr/bin/ruby'
- end
-
- @installer.gem_dir = util_gem_dir
-
- @installer.generate_bin
-
- assert_equal true, File.directory?(util_inst_bindir)
- installed_exec = File.join(util_inst_bindir, "my_exec")
- assert_equal true, File.exist?(installed_exec)
- assert_equal(0100755, File.stat(installed_exec).mode) unless win_platform?
-
- wrapper = File.read installed_exec
- assert_match %r|generated by RubyGems|, wrapper
- end
-
- def test_generate_bin_script
- @installer.wrappers = true
- util_make_exec
- @installer.gem_dir = util_gem_dir
-
- @installer.generate_bin
- assert_equal true, File.directory?(util_inst_bindir)
- installed_exec = File.join(util_inst_bindir, "my_exec")
- assert_equal true, File.exist?(installed_exec)
- assert_equal(0100755, File.stat(installed_exec).mode) unless win_platform?
-
- wrapper = File.read installed_exec
- assert_match %r|generated by RubyGems|, wrapper
- end
-
- def test_generate_bin_script_format
- @installer.format_executable = true
- @installer.wrappers = true
- util_make_exec
- @installer.gem_dir = util_gem_dir
-
- Gem::Installer.exec_format = 'foo-%s-bar'
- @installer.generate_bin
- assert_equal true, File.directory?(util_inst_bindir)
- installed_exec = File.join util_inst_bindir, 'foo-my_exec-bar'
- assert_equal true, File.exist?(installed_exec)
- ensure
- Gem::Installer.exec_format = nil
- end
-
- def test_generate_bin_script_format_disabled
- @installer.wrappers = true
- util_make_exec
- @installer.gem_dir = util_gem_dir
-
- Gem::Installer.exec_format = 'foo-%s-bar'
- @installer.generate_bin
- assert_equal true, File.directory?(util_inst_bindir)
- installed_exec = File.join util_inst_bindir, 'my_exec'
- assert_equal true, File.exist?(installed_exec)
- ensure
- Gem::Installer.exec_format = nil
- end
-
- def test_generate_bin_script_install_dir
- @installer.wrappers = true
- @spec.executables = ["my_exec"]
-
- gem_dir = File.join "#{@gemhome}2", 'gems', @spec.full_name
- gem_bindir = File.join gem_dir, 'bin'
- FileUtils.mkdir_p gem_bindir
- File.open File.join(gem_bindir, "my_exec"), 'w' do |f|
- f.puts "#!/bin/ruby"
- end
-
- @installer.gem_home = "#{@gemhome}2"
- @installer.gem_dir = gem_dir
-
- @installer.generate_bin
-
- installed_exec = File.join("#{@gemhome}2", 'bin', 'my_exec')
- assert_equal true, File.exist?(installed_exec)
- assert_equal(0100755, File.stat(installed_exec).mode) unless win_platform?
-
- wrapper = File.read installed_exec
- assert_match %r|generated by RubyGems|, wrapper
- end
-
- def test_generate_bin_script_no_execs
- @installer.wrappers = true
- @installer.generate_bin
- assert_equal false, File.exist?(util_inst_bindir)
- end
-
- def test_generate_bin_script_no_perms
- @installer.wrappers = true
- util_make_exec
-
- Dir.mkdir util_inst_bindir
-
- if win_platform?
- skip('test_generate_bin_script_no_perms skipped on MS Windows')
- else
- File.chmod 0000, util_inst_bindir
-
- assert_raises Gem::FilePermissionError do
- @installer.generate_bin
- end
- end
- ensure
- File.chmod 0700, util_inst_bindir unless $DEBUG
- end
-
- def test_generate_bin_script_no_shebang
- @installer.wrappers = true
- @spec.executables = ["my_exec"]
-
- gem_dir = File.join @gemhome, 'gems', @spec.full_name
- gem_bindir = File.join gem_dir, 'bin'
- FileUtils.mkdir_p gem_bindir
- File.open File.join(gem_bindir, "my_exec"), 'w' do |f|
- f.puts "blah blah blah"
- end
-
- @installer.generate_bin
-
- installed_exec = File.join @gemhome, 'bin', 'my_exec'
- assert_equal true, File.exist?(installed_exec)
- assert_equal 0100755, File.stat(installed_exec).mode unless win_platform?
-
- wrapper = File.read installed_exec
- assert_match %r|generated by RubyGems|, wrapper
- # HACK some gems don't have #! in their executables, restore 2008/06
- #assert_no_match %r|generated by RubyGems|, wrapper
- end
-
- def test_generate_bin_script_wrappers
- @installer.wrappers = true
- util_make_exec
- @installer.gem_dir = util_gem_dir
- installed_exec = File.join(util_inst_bindir, "my_exec")
-
- real_exec = File.join util_gem_dir, 'bin', 'my_exec'
-
- # fake --no-wrappers for previous install
- unless Gem.win_platform? then
- FileUtils.mkdir_p File.dirname(installed_exec)
- FileUtils.ln_s real_exec, installed_exec
- end
-
- @installer.generate_bin
- assert_equal true, File.directory?(util_inst_bindir)
- assert_equal true, File.exist?(installed_exec)
- assert_equal(0100755, File.stat(installed_exec).mode) unless win_platform?
-
- assert_match %r|generated by RubyGems|, File.read(installed_exec)
-
- refute_match %r|generated by RubyGems|, File.read(real_exec),
- 'real executable overwritten'
- end
-
- def test_generate_bin_symlink
- return if win_platform? #Windows FS do not support symlinks
-
- @installer.wrappers = false
- util_make_exec
- @installer.gem_dir = util_gem_dir
-
- @installer.generate_bin
- assert_equal true, File.directory?(util_inst_bindir)
- installed_exec = File.join(util_inst_bindir, "my_exec")
- assert_equal true, File.symlink?(installed_exec)
- assert_equal(File.join(util_gem_dir, "bin", "my_exec"),
- File.readlink(installed_exec))
- end
-
- def test_generate_bin_symlink_no_execs
- @installer.wrappers = false
- @installer.generate_bin
- assert_equal false, File.exist?(util_inst_bindir)
- end
-
- def test_generate_bin_symlink_no_perms
- @installer.wrappers = false
- util_make_exec
- @installer.gem_dir = util_gem_dir
-
- Dir.mkdir util_inst_bindir
-
- if win_platform?
- skip('test_generate_bin_symlink_no_perms skipped on MS Windows')
- else
- File.chmod 0000, util_inst_bindir
-
- assert_raises Gem::FilePermissionError do
- @installer.generate_bin
- end
- end
- ensure
- File.chmod 0700, util_inst_bindir unless $DEBUG
- end
-
- def test_generate_bin_symlink_update_newer
- return if win_platform? #Windows FS do not support symlinks
-
- @installer.wrappers = false
- util_make_exec
- @installer.gem_dir = util_gem_dir
-
- @installer.generate_bin
- installed_exec = File.join(util_inst_bindir, "my_exec")
- assert_equal(File.join(util_gem_dir, "bin", "my_exec"),
- File.readlink(installed_exec))
-
- @spec = Gem::Specification.new do |s|
- s.files = ['lib/code.rb']
- s.name = "a"
- s.version = "3"
- s.summary = "summary"
- s.description = "desc"
- s.require_path = 'lib'
- end
-
- util_make_exec '3'
- @installer.gem_dir = File.join util_gem_dir('3')
- @installer.generate_bin
- installed_exec = File.join(util_inst_bindir, "my_exec")
- assert_equal(File.join(util_gem_bindir('3'), "my_exec"),
- File.readlink(installed_exec),
- "Ensure symlink moved to latest version")
- end
-
- def test_generate_bin_symlink_update_older
- return if win_platform? #Windows FS do not support symlinks
-
- @installer.wrappers = false
- util_make_exec
- @installer.gem_dir = util_gem_dir
-
- @installer.generate_bin
- installed_exec = File.join(util_inst_bindir, "my_exec")
- assert_equal(File.join(util_gem_dir, "bin", "my_exec"),
- File.readlink(installed_exec))
-
- spec = Gem::Specification.new do |s|
- s.files = ['lib/code.rb']
- s.name = "a"
- s.version = "1"
- s.summary = "summary"
- s.description = "desc"
- s.require_path = 'lib'
- end
-
- util_make_exec '1'
- @installer.gem_dir = util_gem_dir('1')
- @installer.spec = spec
-
- @installer.generate_bin
-
- installed_exec = File.join(util_inst_bindir, "my_exec")
- assert_equal(File.join(util_gem_dir('2'), "bin", "my_exec"),
- File.readlink(installed_exec),
- "Ensure symlink not moved")
- end
-
- def test_generate_bin_symlink_update_remove_wrapper
- return if win_platform? #Windows FS do not support symlinks
-
- @installer.wrappers = true
- util_make_exec
- @installer.gem_dir = util_gem_dir
-
- @installer.generate_bin
- installed_exec = File.join(util_inst_bindir, "my_exec")
- assert_equal true, File.exist?(installed_exec)
-
- @spec = Gem::Specification.new do |s|
- s.files = ['lib/code.rb']
- s.name = "a"
- s.version = "3"
- s.summary = "summary"
- s.description = "desc"
- s.require_path = 'lib'
- end
-
- @installer.wrappers = false
- util_make_exec '3'
- @installer.gem_dir = util_gem_dir '3'
- @installer.generate_bin
- installed_exec = File.join(util_inst_bindir, "my_exec")
- assert_equal(File.join(util_gem_dir('3'), "bin", "my_exec"),
- File.readlink(installed_exec),
- "Ensure symlink moved to latest version")
- end
-
- def test_generate_bin_symlink_win32
- old_win_platform = Gem.win_platform?
- Gem.win_platform = true
- @installer.wrappers = false
- util_make_exec
- @installer.gem_dir = util_gem_dir
-
- use_ui @ui do
- @installer.generate_bin
- end
-
- assert_equal true, File.directory?(util_inst_bindir)
- installed_exec = File.join(util_inst_bindir, "my_exec")
- assert_equal true, File.exist?(installed_exec)
-
- assert_match(/Unable to use symlinks on Windows, installing wrapper/i,
- @ui.error)
-
- wrapper = File.read installed_exec
- assert_match(/generated by RubyGems/, wrapper)
- ensure
- Gem.win_platform = old_win_platform
- end
-
- def test_generate_bin_uses_default_shebang
- return if win_platform? #Windows FS do not support symlinks
-
- @installer.wrappers = true
- util_make_exec
-
- @installer.generate_bin
-
- default_shebang = Gem.ruby
- shebang_line = open("#{@gemhome}/bin/my_exec") { |f| f.readlines.first }
- assert_match(/\A#!/, shebang_line)
- assert_match(/#{default_shebang}/, shebang_line)
- end
-
- def test_initialize
- spec = quick_gem 'a' do |s| s.platform = Gem::Platform.new 'mswin32' end
- gem = File.join @tempdir, "#{spec.full_name}.gem"
-
- Dir.mkdir util_inst_bindir
- util_build_gem spec
- FileUtils.mv File.join(@gemhome, 'cache', "#{spec.full_name}.gem"),
- @tempdir
-
- installer = Gem::Installer.new gem
-
- assert_equal File.join(@gemhome, 'gems', spec.full_name), installer.gem_dir
- end
-
- def test_install
- Dir.mkdir util_inst_bindir
- util_setup_gem
-
- cache_file = File.join @gemhome, 'cache', "#{@spec.full_name}.gem"
-
- Gem.pre_install do |installer|
- refute File.exist?(cache_file), 'cache file should not exist yet'
- end
-
- Gem.post_install do |installer|
- assert File.exist?(cache_file), 'cache file should exist'
- end
-
- build_rake_in do
- use_ui @ui do
- assert_equal @spec, @installer.install
- end
- end
-
- gemdir = File.join @gemhome, 'gems', @spec.full_name
- assert File.exist?(gemdir)
-
- exe = File.join(gemdir, 'bin', 'executable')
- assert File.exist?(exe)
- exe_mode = File.stat(exe).mode & 0111
- assert_equal 0111, exe_mode, "0%o" % exe_mode unless win_platform?
-
- assert File.exist?(File.join(gemdir, 'lib', 'code.rb'))
-
- assert File.exist?(File.join(gemdir, 'ext', 'a', 'Rakefile'))
-
- spec_file = File.join(@gemhome, 'specifications',
- "#{@spec.full_name}.gemspec")
-
- assert_equal spec_file, @spec.loaded_from
- assert File.exist?(spec_file)
-
- assert_same @installer, @pre_install_hook_arg
- assert_same @installer, @post_install_hook_arg
- end
-
- def test_install_bad_gem
- gem = nil
-
- use_ui @ui do
- Dir.chdir @tempdir do Gem::Builder.new(@spec).build end
- gem = File.join @tempdir, "#{@spec.full_name}.gem"
- end
-
- gem_data = File.open gem, 'rb' do |fp| fp.read 1024 end
- File.open gem, 'wb' do |fp| fp.write gem_data end
-
- e = assert_raises Gem::InstallError do
- use_ui @ui do
- @installer = Gem::Installer.new gem
- @installer.install
- end
- end
-
- assert_equal "invalid gem format for #{gem}", e.message
- end
-
- def test_install_check_dependencies
- @spec.add_dependency 'b', '> 5'
- util_setup_gem
-
- use_ui @ui do
- assert_raises Gem::InstallError do
- @installer.install
- end
- end
- end
-
- def test_install_check_dependencies_install_dir
- gemhome2 = "#{@gemhome}2"
- @spec.add_dependency 'b'
-
- b2 = quick_gem 'b', 2
-
- FileUtils.mv @gemhome, gemhome2
- Gem.source_index.gems.delete b2.full_name
- source_index = Gem::SourceIndex.from_gems_in File.join(gemhome2,
- 'specifications')
-
- util_setup_gem
-
- @installer = Gem::Installer.new @gem, :install_dir => gemhome2,
- :source_index => source_index
-
- build_rake_in do
- use_ui @ui do
- @installer.install
- end
- end
-
- assert File.exist?(File.join(gemhome2, 'gems', @spec.full_name))
- end
-
- def test_install_force
- use_ui @ui do
- installer = Gem::Installer.new old_ruby_required, :force => true
- installer.install
- end
-
- gem_dir = File.join(@gemhome, 'gems', 'old_ruby_required-1')
- assert File.exist?(gem_dir)
- end
-
- def test_install_ignore_dependencies
- Dir.mkdir util_inst_bindir
- @spec.add_dependency 'b', '> 5'
- util_setup_gem
- @installer.ignore_dependencies = true
-
- build_rake_in do
- use_ui @ui do
- assert_equal @spec, @installer.install
- end
- end
-
- gemdir = File.join @gemhome, 'gems', @spec.full_name
- assert File.exist?(gemdir)
-
- exe = File.join(gemdir, 'bin', 'executable')
- assert File.exist?(exe)
- exe_mode = File.stat(exe).mode & 0111
- assert_equal 0111, exe_mode, "0%o" % exe_mode unless win_platform?
- assert File.exist?(File.join(gemdir, 'lib', 'code.rb'))
-
- assert File.exist?(File.join(@gemhome, 'specifications',
- "#{@spec.full_name}.gemspec"))
- end
-
- def test_install_missing_dirs
- FileUtils.rm_f File.join(Gem.dir, 'cache')
- FileUtils.rm_f File.join(Gem.dir, 'docs')
- FileUtils.rm_f File.join(Gem.dir, 'specifications')
-
- use_ui @ui do
- Dir.chdir @tempdir do Gem::Builder.new(@spec).build end
- gem = File.join @tempdir, "#{@spec.full_name}.gem"
-
- @installer.install
- end
-
- File.directory? File.join(Gem.dir, 'cache')
- File.directory? File.join(Gem.dir, 'docs')
- File.directory? File.join(Gem.dir, 'specifications')
-
- assert File.exist?(File.join(@gemhome, 'cache', "#{@spec.full_name}.gem"))
- assert File.exist?(File.join(@gemhome, 'specifications',
- "#{@spec.full_name}.gemspec"))
- end
-
- unless win_platform? # File.chmod doesn't work
- def test_install_user_local_fallback
- Dir.mkdir util_inst_bindir
- File.chmod 0755, @userhome
- File.chmod 0000, util_inst_bindir
- File.chmod 0000, Gem.dir
- @spec.executables = ["executable"]
-
- build_rake_in do
- use_ui @ui do
- util_setup_gem
- @installer.install
- end
- end
-
- assert File.exist?(File.join(Gem.user_dir, 'gems',
- @spec.full_name, 'lib', 'code.rb'))
- assert File.exist?(File.join(Gem.user_dir, 'bin', 'executable'))
- ensure
- File.chmod 0755, Gem.dir
- File.chmod 0755, util_inst_bindir
- end
-
- def test_install_bindir_read_only
- Dir.mkdir util_inst_bindir
- File.chmod 0755, @userhome
- File.chmod 0000, util_inst_bindir
-
- build_rake_in do
- use_ui @ui do
- util_setup_gem
- @installer.install
- end
- end
-
- assert File.exist?(File.join(Gem.user_dir, 'bin', 'executable'))
- ensure
- File.chmod 0755, util_inst_bindir
- end
- end
-
- def test_install_with_message
- @spec.post_install_message = 'I am a shiny gem!'
-
- use_ui @ui do
- Dir.chdir @tempdir do Gem::Builder.new(@spec).build end
-
- @installer.install
- end
-
- assert_match %r|I am a shiny gem!|, @ui.output
- end
-
- def test_install_wrong_ruby_version
- use_ui @ui do
- installer = Gem::Installer.new old_ruby_required
- e = assert_raises Gem::InstallError do
- installer.install
- end
- assert_equal 'old_ruby_required requires Ruby version = 1.4.6',
- e.message
- end
- end
-
- def test_install_wrong_rubygems_version
- spec = quick_gem 'old_rubygems_required', '1' do |s|
- s.required_rubygems_version = '< 0'
- end
-
- util_build_gem spec
-
- gem = File.join @gemhome, 'cache', "#{spec.full_name}.gem"
-
- use_ui @ui do
- @installer = Gem::Installer.new gem
- e = assert_raises Gem::InstallError do
- @installer.install
- end
- assert_equal 'old_rubygems_required requires RubyGems version < 0',
- e.message
- end
- end
-
- def test_installation_satisfies_dependency_eh
- dep = Gem::Dependency.new 'a', '>= 2'
- assert @installer.installation_satisfies_dependency?(dep)
-
- dep = Gem::Dependency.new 'a', '> 2'
- refute @installer.installation_satisfies_dependency?(dep)
- end
-
- def test_shebang
- util_make_exec '2', "#!/usr/bin/ruby"
-
- shebang = @installer.shebang 'my_exec'
-
- assert_equal "#!#{Gem.ruby}", shebang
- end
-
- def test_shebang_arguments
- util_make_exec '2', "#!/usr/bin/ruby -ws"
-
- shebang = @installer.shebang 'my_exec'
-
- assert_equal "#!#{Gem.ruby} -ws", shebang
- end
-
- def test_shebang_empty
- util_make_exec '2', ''
-
- shebang = @installer.shebang 'my_exec'
- assert_equal "#!#{Gem.ruby}", shebang
- end
-
- def test_shebang_env
- util_make_exec '2', "#!/usr/bin/env ruby"
-
- shebang = @installer.shebang 'my_exec'
-
- assert_equal "#!#{Gem.ruby}", shebang
- end
-
- def test_shebang_env_arguments
- util_make_exec '2', "#!/usr/bin/env ruby -ws"
-
- shebang = @installer.shebang 'my_exec'
-
- assert_equal "#!#{Gem.ruby} -ws", shebang
- end
-
- def test_shebang_env_shebang
- util_make_exec '2', ''
- @installer.env_shebang = true
-
- shebang = @installer.shebang 'my_exec'
- assert_equal "#!/usr/bin/env #{Gem::ConfigMap[:ruby_install_name]}", shebang
- end
-
- def test_shebang_nested
- util_make_exec '2', "#!/opt/local/ruby/bin/ruby"
-
- shebang = @installer.shebang 'my_exec'
-
- assert_equal "#!#{Gem.ruby}", shebang
- end
-
- def test_shebang_nested_arguments
- util_make_exec '2', "#!/opt/local/ruby/bin/ruby -ws"
-
- shebang = @installer.shebang 'my_exec'
-
- assert_equal "#!#{Gem.ruby} -ws", shebang
- end
-
- def test_shebang_version
- util_make_exec '2', "#!/usr/bin/ruby18"
-
- shebang = @installer.shebang 'my_exec'
-
- assert_equal "#!#{Gem.ruby}", shebang
- end
-
- def test_shebang_version_arguments
- util_make_exec '2', "#!/usr/bin/ruby18 -ws"
-
- shebang = @installer.shebang 'my_exec'
-
- assert_equal "#!#{Gem.ruby} -ws", shebang
- end
-
- def test_shebang_version_env
- util_make_exec '2', "#!/usr/bin/env ruby18"
-
- shebang = @installer.shebang 'my_exec'
-
- assert_equal "#!#{Gem.ruby}", shebang
- end
-
- def test_shebang_version_env_arguments
- util_make_exec '2', "#!/usr/bin/env ruby18 -ws"
-
- shebang = @installer.shebang 'my_exec'
-
- assert_equal "#!#{Gem.ruby} -ws", shebang
- end
-
- def test_unpack
- util_setup_gem
-
- dest = File.join @gemhome, 'gems', @spec.full_name
-
- @installer.unpack dest
-
- assert File.exist?(File.join(dest, 'lib', 'code.rb'))
- assert File.exist?(File.join(dest, 'bin', 'executable'))
- end
-
- def test_write_spec
- spec_dir = File.join @gemhome, 'specifications'
- spec_file = File.join spec_dir, "#{@spec.full_name}.gemspec"
- FileUtils.rm spec_file
- refute File.exist?(spec_file)
-
- @installer.spec = @spec
- @installer.gem_home = @gemhome
-
- @installer.write_spec
-
- assert File.exist?(spec_file)
- assert_equal @spec, eval(File.read(spec_file))
- end
-
- def old_ruby_required
- spec = quick_gem 'old_ruby_required', '1' do |s|
- s.required_ruby_version = '= 1.4.6'
- end
-
- util_build_gem spec
-
- File.join @gemhome, 'cache', "#{spec.full_name}.gem"
- end
-
-end
-
diff --git a/test/rubygems/test_gem_local_remote_options.rb b/test/rubygems/test_gem_local_remote_options.rb
deleted file mode 100644
index 3dd390ecfd..0000000000
--- a/test/rubygems/test_gem_local_remote_options.rb
+++ /dev/null
@@ -1,97 +0,0 @@
-require File.join(File.expand_path(File.dirname(__FILE__)), 'gemutilities')
-require 'rubygems/local_remote_options'
-require 'rubygems/command'
-
-class TestGemLocalRemoteOptions < RubyGemTestCase
-
- def setup
- super
-
- @cmd = Gem::Command.new 'dummy', 'dummy'
- @cmd.extend Gem::LocalRemoteOptions
- end
-
- def test_add_local_remote_options
- @cmd.add_local_remote_options
-
- args = %w[-l -r -b -B 10 --source http://gems.example.com -p --update-sources]
- assert @cmd.handles?(args)
- end
-
- def test_both_eh
- assert_equal false, @cmd.both?
-
- @cmd.options[:domain] = :local
-
- assert_equal false, @cmd.both?
-
- @cmd.options[:domain] = :both
-
- assert_equal true, @cmd.both?
- end
-
- def test_local_eh
- assert_equal false, @cmd.local?
-
- @cmd.options[:domain] = :local
-
- assert_equal true, @cmd.local?
-
- @cmd.options[:domain] = :both
-
- assert_equal true, @cmd.local?
- end
-
- def test_remote_eh
- assert_equal false, @cmd.remote?
-
- @cmd.options[:domain] = :remote
-
- assert_equal true, @cmd.remote?
-
- @cmd.options[:domain] = :both
-
- assert_equal true, @cmd.remote?
- end
-
- def test_source_option
- @cmd.add_source_option
-
- s1 = URI.parse 'http://more-gems.example.com/'
- s2 = URI.parse 'http://even-more-gems.example.com/'
- s3 = URI.parse 'http://other-gems.example.com/some_subdir'
- s4 = URI.parse 'http://more-gems.example.com/' # Intentional duplicate
-
- @cmd.handle_options %W[--source #{s1} --source #{s2} --source #{s3} --source #{s4}]
-
- assert_equal [s1.to_s, s2.to_s, "#{s3}/"], Gem.sources
- end
-
- def test_update_sources_option
- @cmd.add_update_sources_option
-
- Gem.configuration.update_sources = false
-
- @cmd.handle_options %W[--update-sources]
-
- assert_equal true, Gem.configuration.update_sources
-
- @cmd.handle_options %W[--no-update-sources]
-
- assert_equal false, Gem.configuration.update_sources
- end
-
- def test_source_option_bad
- @cmd.add_source_option
-
- s1 = 'htp://more-gems.example.com'
-
- assert_raises OptionParser::InvalidArgument do
- @cmd.handle_options %W[--source #{s1}]
- end
-
- assert_equal [@gem_repo], Gem.sources
- end
-
-end
-
diff --git a/test/rubygems/test_gem_package_tar_header.rb b/test/rubygems/test_gem_package_tar_header.rb
deleted file mode 100644
index 5ad1a793b5..0000000000
--- a/test/rubygems/test_gem_package_tar_header.rb
+++ /dev/null
@@ -1,137 +0,0 @@
-#--
-# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
-# All rights reserved.
-# See LICENSE.txt for permissions.
-#++
-
-require File.join(File.expand_path(File.dirname(__FILE__)),
- 'gem_package_tar_test_case')
-require 'rubygems/package'
-
-class TestGemPackageTarHeader < TarTestCase
-
- def setup
- super
-
- header = {
- :name => 'x',
- :mode => 0644,
- :uid => 1000,
- :gid => 10000,
- :size => 100,
- :mtime => 12345,
- :typeflag => '0',
- :linkname => 'link',
- :uname => 'user',
- :gname => 'group',
- :devmajor => 1,
- :devminor => 2,
- :prefix => 'y',
- }
-
- @tar_header = Gem::Package::TarHeader.new header
- end
-
- def test_self_from
- io = TempIO.new @tar_header.to_s
-
- new_header = Gem::Package::TarHeader.from io
-
- assert_headers_equal @tar_header, new_header
- end
-
- def test_initialize
- assert_equal '', @tar_header.checksum, 'checksum'
- assert_equal 1, @tar_header.devmajor, 'devmajor'
- assert_equal 2, @tar_header.devminor, 'devminor'
- assert_equal 10000, @tar_header.gid, 'gid'
- assert_equal 'group', @tar_header.gname, 'gname'
- assert_equal 'link', @tar_header.linkname, 'linkname'
- assert_equal 'ustar', @tar_header.magic, 'magic'
- assert_equal 0644, @tar_header.mode, 'mode'
- assert_equal 12345, @tar_header.mtime, 'mtime'
- assert_equal 'x', @tar_header.name, 'name'
- assert_equal 'y', @tar_header.prefix, 'prefix'
- assert_equal 100, @tar_header.size, 'size'
- assert_equal '0', @tar_header.typeflag, 'typeflag'
- assert_equal 1000, @tar_header.uid, 'uid'
- assert_equal 'user', @tar_header.uname, 'uname'
- assert_equal '00', @tar_header.version, 'version'
-
- refute_empty @tar_header, 'empty'
- end
-
- def test_initialize_bad
- assert_raises ArgumentError do
- Gem::Package::TarHeader.new :name => '', :size => '', :mode => ''
- end
-
- assert_raises ArgumentError do
- Gem::Package::TarHeader.new :name => '', :size => '', :prefix => ''
- end
-
- assert_raises ArgumentError do
- Gem::Package::TarHeader.new :name => '', :prefix => '', :mode => ''
- end
-
- assert_raises ArgumentError do
- Gem::Package::TarHeader.new :prefix => '', :size => '', :mode => ''
- end
- end
-
- def test_empty_eh
- refute_empty @tar_header
-
- @tar_header = Gem::Package::TarHeader.new :name => 'x', :prefix => '',
- :mode => 0, :size => 0,
- :empty => true
-
- assert_empty @tar_header
- end
-
- def test_equals2
- assert_equal @tar_header, @tar_header
- assert_equal @tar_header, @tar_header.dup
- end
-
- def test_to_s
- expected = <<-EOF.split("\n").join
-x\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000
-\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000
-\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000
-\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000
-\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000
-\000\000\000\0000000644\0000001750\0000023420\00000000000144\00000000030071
-\000012467\000 0link\000\000\000\000\000\000\000\000\000\000\000\000\000\000
-\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000
-\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000
-\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000
-\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000
-\000\000\000\000\000\000ustar\00000user\000\000\000\000\000\000\000\000\000
-\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000
-group\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000
-\000\000\000\000\000\000\000\000\0000000001\0000000002\000y\000\000\000\000
-\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000
-\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000
-\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000
-\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000
-\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000
-\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000
-\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000
-\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000
-\000\000\000\000\000\000\000\000\000\000
- EOF
-
- assert_headers_equal expected, @tar_header
- end
-
- def test_update_checksum
- assert_equal '', @tar_header.checksum
-
- @tar_header.update_checksum
-
- assert_equal '012467', @tar_header.checksum
- end
-
-end
-
diff --git a/test/rubygems/test_gem_package_tar_input.rb b/test/rubygems/test_gem_package_tar_input.rb
deleted file mode 100644
index 8f8a193876..0000000000
--- a/test/rubygems/test_gem_package_tar_input.rb
+++ /dev/null
@@ -1,119 +0,0 @@
-#--
-# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
-# All rights reserved.
-# See LICENSE.txt for permissions.
-#++
-
-require File.join(File.expand_path(File.dirname(__FILE__)),
- 'gem_package_tar_test_case')
-require 'rubygems/package/tar_input'
-
-class TestGemPackageTarInput < TarTestCase
-
- # Sometimes the setgid bit doesn't take. Don't know if this is a problem on
- # all systems, or just some. But for now, we will ignore it in the tests.
- SETGID_BIT = 02000
-
- def setup
- super
-
- inner_tar = tar_file_header("bla", "", 0612, 10)
- inner_tar += "0123456789" + "\0" * 502
- inner_tar += tar_file_header("foo", "", 0636, 5)
- inner_tar += "01234" + "\0" * 507
- inner_tar += tar_dir_header("__dir__", "", 0600)
- inner_tar += "\0" * 1024
- str = TempIO.new
-
- begin
- os = Zlib::GzipWriter.new str
- os.write inner_tar
- ensure
- os.finish
- end
-
- str.rewind
-
- @file = File.join @tempdir, 'bla.tar'
-
- File.open @file, 'wb' do |f|
- f.write tar_file_header("data.tar.gz", "", 0644, str.string.size)
- f.write str.string
- f.write "\0" * ((512 - (str.string.size % 512)) % 512 )
-
- @spec = Gem::Specification.new do |spec|
- spec.author = "Mauricio :)"
- end
-
- meta = @spec.to_yaml
-
- f.write tar_file_header("metadata", "", 0644, meta.size)
- f.write meta + "\0" * (1024 - meta.size)
- f.write "\0" * 1024
- end
-
- @entry_names = %w{bla foo __dir__}
- @entry_sizes = [10, 5, 0]
- #FIXME: are these modes system dependent?
- @entry_modes = [0100612, 0100636, 040600]
- @entry_files = %W[#{@tempdir}/bla #{@tempdir}/foo]
- @entry_contents = %w[0123456789 01234]
- end
-
- def test_each_works
- open @file, 'rb' do |io|
- Gem::Package::TarInput.open io do |tar_input|
- count = 0
-
- tar_input.each_with_index do |entry, i|
- count = i
-
- assert_kind_of Gem::Package::TarReader::Entry, entry
- assert_equal @entry_names[i], entry.header.name
- assert_equal @entry_sizes[i], entry.header.size
- end
-
- assert_equal 2, count
-
- assert_equal @spec, tar_input.metadata
- end
- end
- end
-
- def test_extract_entry_works
- open @file, 'rb' do |io|
- Gem::Package::TarInput.open io do |tar_input|
- assert_equal @spec, tar_input.metadata
-
- count = 0
-
- tar_input.each_with_index do |entry, i|
- count = i
- tar_input.extract_entry @tempdir, entry
- name = File.join @tempdir, entry.header.name
-
- if entry.directory? then
- assert File.directory?(name)
- else
- assert File.file?(name)
- assert_equal @entry_sizes[i], File.stat(name).size
- #FIXME: win32? !!
- end
-
- unless Gem.win_platform? then
- assert_equal @entry_modes[i], File.stat(name).mode & (~SETGID_BIT)
- end
- end
-
- assert_equal 2, count
- end
- end
-
- @entry_files.each_with_index do |x, i|
- assert File.file?(x)
- assert_equal @entry_contents[i], Gem.read_binary(x)
- end
- end
-
-end
-
diff --git a/test/rubygems/test_gem_package_tar_output.rb b/test/rubygems/test_gem_package_tar_output.rb
deleted file mode 100644
index 31f02c67a6..0000000000
--- a/test/rubygems/test_gem_package_tar_output.rb
+++ /dev/null
@@ -1,104 +0,0 @@
-#--
-# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
-# All rights reserved.
-# See LICENSE.txt for permissions.
-#++
-
-require File.join(File.expand_path(File.dirname(__FILE__)),
- 'gem_package_tar_test_case')
-require 'rubygems/package/tar_output'
-
-class TestGemPackageTarOutput < TarTestCase
-
- def setup
- super
-
- @file = File.join @tempdir, 'bla2.tar'
- end
-
- def test_self_open
- open @file, 'wb' do |tar_io|
- Gem::Package::TarOutput.open tar_io do |tar_writer|
- tar_writer.add_file_simple 'README', 0, 17 do |io|
- io.write "This is a README\n"
- end
-
- tar_writer.metadata = "This is some metadata\n"
- end
- end
-
- files = util_extract
-
- name, data = files.shift
- assert_equal 'data.tar.gz', name
-
- gz = Zlib::GzipReader.new StringIO.new(data)
-
- Gem::Package::TarReader.new gz do |tar_reader|
- tar_reader.each do |entry|
- assert_equal 'README', entry.full_name
- assert_equal "This is a README\n", entry.read
- end
- end
-
- gz.close
-
- name, data = files.shift
- assert_equal 'metadata.gz', name
-
- gz = Zlib::GzipReader.new StringIO.new(data)
- assert_equal "This is some metadata\n", gz.read
-
- assert_empty files
- ensure
- gz.close if gz
- end
-
- if defined? OpenSSL then
- def test_self_open_signed
- signer = Gem::Security::Signer.new @private_key, [@public_cert]
-
- open @file, 'wb' do |tar_io|
- Gem::Package::TarOutput.open tar_io, signer do |tar_writer|
- tar_writer.add_file_simple 'README', 0, 17 do |io|
- io.write "This is a README\n"
- end
-
- tar_writer.metadata = "This is some metadata\n"
- end
- end
-
- files = util_extract
-
- name, data = files.shift
- assert_equal 'data.tar.gz', name
-
- name, data = files.shift
- assert_equal 'metadata.gz', name
-
- name, data = files.shift
- assert_equal 'data.tar.gz.sig', name
-
- name, data = files.shift
- assert_equal 'metadata.gz.sig', name
-
- assert_empty files
- end
- end
-
- def util_extract
- files = []
-
- open @file, 'rb' do |io|
- Gem::Package::TarReader.new io do |tar_reader|
- tar_reader.each do |entry|
- files << [entry.full_name, entry.read]
- end
- end
- end
-
- files
- end
-
-end
-
diff --git a/test/rubygems/test_gem_package_tar_reader.rb b/test/rubygems/test_gem_package_tar_reader.rb
deleted file mode 100644
index 6962088878..0000000000
--- a/test/rubygems/test_gem_package_tar_reader.rb
+++ /dev/null
@@ -1,53 +0,0 @@
-#--
-# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
-# All rights reserved.
-# See LICENSE.txt for permissions.
-#++
-
-require File.join(File.expand_path(File.dirname(__FILE__)),
- 'gem_package_tar_test_case')
-require 'rubygems/package'
-
-class TestGemPackageTarReader < TarTestCase
-
- def test_each_entry
- tar = tar_dir_header "foo", "bar", 0
- tar << tar_file_header("bar", "baz", 0, 0)
-
- io = TempIO.new tar
-
- entries = 0
-
- Gem::Package::TarReader.new io do |tar_reader|
- tar_reader.each_entry do |entry|
- assert_kind_of Gem::Package::TarReader::Entry, entry
-
- entries += 1
- end
- end
-
- assert_equal 2, entries
- end
-
- def test_rewind
- content = ('a'..'z').to_a.join(" ")
-
- str = tar_file_header("lib/foo", "", 010644, content.size) + content +
- "\0" * (512 - content.size)
- str << "\0" * 1024
-
- Gem::Package::TarReader.new(TempIO.new(str)) do |tar_reader|
- 3.times do
- tar_reader.rewind
- i = 0
- tar_reader.each_entry do |entry|
- assert_equal(content, entry.read)
- i += 1
- end
- assert_equal(1, i)
- end
- end
- end
-
-end
-
diff --git a/test/rubygems/test_gem_package_tar_reader_entry.rb b/test/rubygems/test_gem_package_tar_reader_entry.rb
deleted file mode 100644
index 66f885b250..0000000000
--- a/test/rubygems/test_gem_package_tar_reader_entry.rb
+++ /dev/null
@@ -1,116 +0,0 @@
-#--
-# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
-# All rights reserved.
-# See LICENSE.txt for permissions.
-#++
-
-require File.join(File.expand_path(File.dirname(__FILE__)),
- 'gem_package_tar_test_case')
-require 'rubygems/package'
-
-class TestGemPackageTarReaderEntry < TarTestCase
-
- def setup
- super
-
- @contents = ('a'..'z').to_a.join * 100
-
- @tar = ''
- @tar << tar_file_header("lib/foo", "", 0, @contents.size)
- @tar << @contents
- @tar << "\0" * (512 - (@tar.size % 512))
-
- @entry = util_entry @tar
- end
-
- def test_bytes_read
- assert_equal 0, @entry.bytes_read
-
- @entry.getc
-
- assert_equal 1, @entry.bytes_read
- end
-
- def test_close
- @entry.close
-
- assert @entry.bytes_read
-
- e = assert_raises IOError do @entry.eof? end
- assert_equal 'closed Gem::Package::TarReader::Entry', e.message
-
- e = assert_raises IOError do @entry.getc end
- assert_equal 'closed Gem::Package::TarReader::Entry', e.message
-
- e = assert_raises IOError do @entry.pos end
- assert_equal 'closed Gem::Package::TarReader::Entry', e.message
-
- e = assert_raises IOError do @entry.read end
- assert_equal 'closed Gem::Package::TarReader::Entry', e.message
-
- e = assert_raises IOError do @entry.rewind end
- assert_equal 'closed Gem::Package::TarReader::Entry', e.message
- end
-
- def test_closed_eh
- @entry.close
-
- assert @entry.closed?
- end
-
- def test_eof_eh
- @entry.read
-
- assert @entry.eof?
- end
-
- def test_full_name
- assert_equal 'lib/foo', @entry.full_name
- end
-
- def test_getc
- assert_equal ?a, @entry.getc
- end
-
- def test_directory_eh
- assert_equal false, @entry.directory?
- assert_equal true, util_dir_entry.directory?
- end
-
- def test_file_eh
- assert_equal true, @entry.file?
- assert_equal false, util_dir_entry.file?
- end
-
- def test_pos
- assert_equal 0, @entry.pos
-
- @entry.getc
-
- assert_equal 1, @entry.pos
- end
-
- def test_read
- assert_equal @contents, @entry.read
- end
-
- def test_read_big
- assert_equal @contents, @entry.read(@contents.size * 2)
- end
-
- def test_read_small
- assert_equal @contents[0...100], @entry.read(100)
- end
-
- def test_rewind
- char = @entry.getc
-
- @entry.rewind
-
- assert_equal 0, @entry.pos
-
- assert_equal char, @entry.getc
- end
-
-end
-
diff --git a/test/rubygems/test_gem_package_tar_writer.rb b/test/rubygems/test_gem_package_tar_writer.rb
deleted file mode 100644
index 4c2b475bf1..0000000000
--- a/test/rubygems/test_gem_package_tar_writer.rb
+++ /dev/null
@@ -1,151 +0,0 @@
-#--
-# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
-# All rights reserved.
-# See LICENSE.txt for permissions.
-#++
-
-require File.join(File.expand_path(File.dirname(__FILE__)),
- 'gem_package_tar_test_case')
-require 'rubygems/package/tar_writer'
-
-class TestTarWriter < TarTestCase
-
- def setup
- super
-
- @data = 'abcde12345'
- @io = TempIO.new
- @tar_writer = Gem::Package::TarWriter.new @io
- end
-
- def teardown
- @tar_writer.close unless @tar_writer.closed?
-
- super
- end
-
- def test_add_file
- @tar_writer.add_file 'x', 0644 do |f| f.write 'a' * 10 end
-
- assert_headers_equal(tar_file_header('x', '', 0644, 10),
- @io.string[0, 512])
- assert_equal "aaaaaaaaaa#{"\0" * 502}", @io.string[512, 512]
- assert_equal 1024, @io.pos
- end
-
- def test_add_file_simple
- @tar_writer.add_file_simple 'x', 0644, 10 do |io| io.write "a" * 10 end
-
- assert_headers_equal(tar_file_header('x', '', 0644, 10),
- @io.string[0, 512])
-
- assert_equal "aaaaaaaaaa#{"\0" * 502}", @io.string[512, 512]
- assert_equal 1024, @io.pos
- end
-
- def test_add_file_simple_padding
- @tar_writer.add_file_simple 'x', 0, 100
-
- assert_headers_equal tar_file_header('x', '', 0, 100),
- @io.string[0, 512]
-
- assert_equal "\0" * 512, @io.string[512, 512]
- end
-
- def test_add_file_simple_data
- @tar_writer.add_file_simple("lib/foo/bar", 0, 10) { |f| f.write @data }
- @tar_writer.flush
-
- assert_equal @data + ("\0" * (512-@data.size)),
- @io.string[512, 512]
- end
-
- def test_add_file_simple_size
- assert_raises Gem::Package::TarWriter::FileOverflow do
- @tar_writer.add_file_simple("lib/foo/bar", 0, 10) do |io|
- io.write "1" * 11
- end
- end
- end
-
- def test_add_file_unseekable
- assert_raises Gem::Package::NonSeekableIO do
- Gem::Package::TarWriter.new(Object.new).add_file 'x', 0
- end
- end
-
- def test_close
- @tar_writer.close
-
- assert_equal "\0" * 1024, @io.string
-
- e = assert_raises IOError do
- @tar_writer.close
- end
- assert_equal 'closed Gem::Package::TarWriter', e.message
-
- e = assert_raises IOError do
- @tar_writer.flush
- end
- assert_equal 'closed Gem::Package::TarWriter', e.message
-
- e = assert_raises IOError do
- @tar_writer.add_file 'x', 0
- end
- assert_equal 'closed Gem::Package::TarWriter', e.message
-
- e = assert_raises IOError do
- @tar_writer.add_file_simple 'x', 0, 0
- end
- assert_equal 'closed Gem::Package::TarWriter', e.message
-
- e = assert_raises IOError do
- @tar_writer.mkdir 'x', 0
- end
- assert_equal 'closed Gem::Package::TarWriter', e.message
- end
-
- def test_mkdir
- @tar_writer.mkdir 'foo', 0644
-
- assert_headers_equal tar_dir_header('foo', '', 0644),
- @io.string[0, 512]
- assert_equal 512, @io.pos
- end
-
- def test_split_name
- assert_equal ['b' * 100, 'a' * 155],
- @tar_writer.split_name("#{'a' * 155}/#{'b' * 100}")
-
- assert_equal ["#{'qwer/' * 19}bla", 'a' * 151],
- @tar_writer.split_name("#{'a' * 151}/#{'qwer/' * 19}bla")
- end
-
- def test_split_name_too_long_name
- name = File.join 'a', 'b' * 100
- assert_equal ['b' * 100, 'a'], @tar_writer.split_name(name)
-
- assert_raises Gem::Package::TooLongFileName do
- name = File.join 'a', 'b' * 101
- @tar_writer.split_name name
- end
- end
-
- def test_split_name_too_long_prefix
- name = File.join 'a' * 155, 'b'
- assert_equal ['b', 'a' * 155], @tar_writer.split_name(name)
-
- assert_raises Gem::Package::TooLongFileName do
- name = File.join 'a' * 156, 'b'
- @tar_writer.split_name name
- end
- end
-
- def test_split_name_too_long_total
- assert_raises Gem::Package::TooLongFileName do
- @tar_writer.split_name 'a' * 257
- end
- end
-
-end
-
diff --git a/test/rubygems/test_gem_package_task.rb b/test/rubygems/test_gem_package_task.rb
deleted file mode 100644
index aed4f05b83..0000000000
--- a/test/rubygems/test_gem_package_task.rb
+++ /dev/null
@@ -1,70 +0,0 @@
-# Copyright (c) 2003, 2004 Jim Weirich, 2009 Eric Hodel
-#
-# 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 File.join(File.expand_path(File.dirname(__FILE__)), 'gemutilities')
-require 'rubygems'
-require 'rubygems/package_task'
-
-class TestGemPackageTask < MiniTest::Unit::TestCase
-
- def test_gem_package
- gem = Gem::Specification.new do |g|
- g.name = "pkgr"
- g.version = "1.2.3"
- g.files = Rake::FileList["x"].resolve
- end
- pkg = Gem::PackageTask.new(gem) do |p|
- p.package_files << "y"
- end
- assert_equal ["x", "y"], pkg.package_files
- assert_equal "pkgr-1.2.3.gem", pkg.gem_file
- end
-
- def test_gem_package_with_current_platform
- gem = Gem::Specification.new do |g|
- g.name = "pkgr"
- g.version = "1.2.3"
- g.files = Rake::FileList["x"].resolve
- g.platform = Gem::Platform::CURRENT
- end
- pkg = Gem::PackageTask.new(gem) do |p|
- p.package_files << "y"
- end
- assert_equal ["x", "y"], pkg.package_files
- assert_match(/^pkgr-1\.2\.3-(\S+)\.gem$/, pkg.gem_file)
- end
-
- def test_gem_package_with_ruby_platform
- gem = Gem::Specification.new do |g|
- g.name = "pkgr"
- g.version = "1.2.3"
- g.files = Rake::FileList["x"].resolve
- g.platform = Gem::Platform::RUBY
- end
- pkg = Gem::PackageTask.new(gem) do |p|
- p.package_files << "y"
- end
- assert_equal ["x", "y"], pkg.package_files
- assert_equal "pkgr-1.2.3.gem", pkg.gem_file
- end
-
-end
-
diff --git a/test/rubygems/test_gem_platform.rb b/test/rubygems/test_gem_platform.rb
deleted file mode 100644
index aa23533a39..0000000000
--- a/test/rubygems/test_gem_platform.rb
+++ /dev/null
@@ -1,245 +0,0 @@
-require File.join(File.expand_path(File.dirname(__FILE__)), 'gemutilities')
-require 'rubygems/platform'
-require 'rbconfig'
-
-class TestGemPlatform < RubyGemTestCase
-
- def test_self_local
- util_set_arch 'i686-darwin8.10.1'
-
- assert_equal Gem::Platform.new(%w[x86 darwin 8]), Gem::Platform.local
- end
-
- def test_self_match
- assert Gem::Platform.match(nil), 'nil == ruby'
- assert Gem::Platform.match(Gem::Platform.local), 'exact match'
- assert Gem::Platform.match(Gem::Platform.local.to_s), '=~ match'
- assert Gem::Platform.match(Gem::Platform::RUBY), 'ruby'
- end
-
- def test_self_new
- assert_equal Gem::Platform.local, Gem::Platform.new(Gem::Platform::CURRENT)
- assert_equal Gem::Platform::RUBY, Gem::Platform.new(Gem::Platform::RUBY)
- assert_equal Gem::Platform::RUBY, Gem::Platform.new(nil)
- assert_equal Gem::Platform::RUBY, Gem::Platform.new('')
- end
-
- def test_initialize
- test_cases = {
- 'amd64-freebsd6' => ['amd64', 'freebsd', '6'],
- 'hppa2.0w-hpux11.31' => ['hppa2.0w', 'hpux', '11'],
- 'java' => [nil, 'java', nil],
- 'jruby' => [nil, 'java', nil],
- 'powerpc-aix5.3.0.0' => ['powerpc', 'aix', '5'],
- 'powerpc-darwin7' => ['powerpc', 'darwin', '7'],
- 'powerpc-darwin8' => ['powerpc', 'darwin', '8'],
- 'powerpc-linux' => ['powerpc', 'linux', nil],
- 'powerpc64-linux' => ['powerpc64', 'linux', nil],
- 'sparc-solaris2.10' => ['sparc', 'solaris', '2.10'],
- 'sparc-solaris2.8' => ['sparc', 'solaris', '2.8'],
- 'sparc-solaris2.9' => ['sparc', 'solaris', '2.9'],
- 'universal-darwin8' => ['universal', 'darwin', '8'],
- 'universal-darwin9' => ['universal', 'darwin', '9'],
- 'i386-cygwin' => ['x86', 'cygwin', nil],
- 'i686-darwin' => ['x86', 'darwin', nil],
- 'i686-darwin8.4.1' => ['x86', 'darwin', '8'],
- 'i386-freebsd4.11' => ['x86', 'freebsd', '4'],
- 'i386-freebsd5' => ['x86', 'freebsd', '5'],
- 'i386-freebsd6' => ['x86', 'freebsd', '6'],
- 'i386-freebsd7' => ['x86', 'freebsd', '7'],
- 'i386-java1.5' => ['x86', 'java', '1.5'],
- 'x86-java1.6' => ['x86', 'java', '1.6'],
- 'i386-java1.6' => ['x86', 'java', '1.6'],
- 'i686-linux' => ['x86', 'linux', nil],
- 'i586-linux' => ['x86', 'linux', nil],
- 'i486-linux' => ['x86', 'linux', nil],
- 'i386-linux' => ['x86', 'linux', nil],
- 'i586-linux-gnu' => ['x86', 'linux', nil],
- 'i386-linux-gnu' => ['x86', 'linux', nil],
- 'i386-mingw32' => ['x86', 'mingw32', nil],
- 'i386-mswin32' => ['x86', 'mswin32', nil],
- 'i386-mswin32_80' => ['x86', 'mswin32', '80'],
- 'i386-mswin32-80' => ['x86', 'mswin32', '80'],
- 'x86-mswin32' => ['x86', 'mswin32', nil],
- 'x86-mswin32_60' => ['x86', 'mswin32', '60'],
- 'x86-mswin32-60' => ['x86', 'mswin32', '60'],
- 'i386-netbsdelf' => ['x86', 'netbsdelf', nil],
- 'i386-openbsd4.0' => ['x86', 'openbsd', '4.0'],
- 'i386-solaris2.10' => ['x86', 'solaris', '2.10'],
- 'i386-solaris2.8' => ['x86', 'solaris', '2.8'],
- 'mswin32' => ['x86', 'mswin32', nil],
- 'x86_64-linux' => ['x86_64', 'linux', nil],
- 'x86_64-openbsd3.9' => ['x86_64', 'openbsd', '3.9'],
- 'x86_64-openbsd4.0' => ['x86_64', 'openbsd', '4.0'],
- }
-
- test_cases.each do |arch, expected|
- platform = Gem::Platform.new arch
- assert_equal expected, platform.to_a, arch.inspect
- end
- end
-
- def test_initialize_command_line
- expected = ['x86', 'mswin32', nil]
-
- platform = Gem::Platform.new 'i386-mswin32'
-
- assert_equal expected, platform.to_a, 'i386-mswin32'
-
- expected = ['x86', 'mswin32', '80']
-
- platform = Gem::Platform.new 'i386-mswin32-80'
-
- assert_equal expected, platform.to_a, 'i386-mswin32-80'
-
- expected = ['x86', 'solaris', '2.10']
-
- platform = Gem::Platform.new 'i386-solaris-2.10'
-
- assert_equal expected, platform.to_a, 'i386-solaris-2.10'
- end
-
- def test_initialize_mswin32_vc6
- orig_RUBY_SO_NAME = RbConfig::CONFIG['RUBY_SO_NAME']
- RbConfig::CONFIG['RUBY_SO_NAME'] = 'msvcrt-ruby18'
-
- expected = ['x86', 'mswin32', nil]
-
- platform = Gem::Platform.new 'i386-mswin32'
-
- assert_equal expected, platform.to_a, 'i386-mswin32 VC6'
- ensure
- RbConfig::CONFIG['RUBY_SO_NAME'] = orig_RUBY_SO_NAME
- end
-
- def test_initialize_platform
- platform = Gem::Platform.new 'cpu-my_platform1'
- expected = Gem::Platform.new platform
-
- assert_equal 'cpu', platform.cpu
- assert_equal 'my_platform', platform.os
- assert_equal '1', platform.version
- end
-
- def test_initialize_test
- platform = Gem::Platform.new 'cpu-my_platform1'
- assert_equal 'cpu', platform.cpu
- assert_equal 'my_platform', platform.os
- assert_equal '1', platform.version
-
- platform = Gem::Platform.new 'cpu-other_platform1'
- assert_equal 'cpu', platform.cpu
- assert_equal 'other_platform', platform.os
- assert_equal '1', platform.version
- end
-
- def test_empty
- platform = Gem::Platform.new 'cpu-other_platform1'
- assert_respond_to platform, :empty?
- assert_equal false, platform.empty?
- end
-
- def test_to_s
- if win_platform? then
- assert_equal 'x86-mswin32-60', Gem::Platform.local.to_s
- else
- assert_equal 'x86-darwin-8', Gem::Platform.local.to_s
- end
- end
-
- def test_equals2
- my = Gem::Platform.new %w[cpu my_platform 1]
- other = Gem::Platform.new %w[cpu other_platform 1]
-
- assert_equal my, my
- refute_equal my, other
- refute_equal other, my
- end
-
- def test_equals3
- my = Gem::Platform.new %w[cpu my_platform 1]
- other = Gem::Platform.new %w[cpu other_platform 1]
-
- assert(my === my)
- refute(other === my)
- refute(my === other)
- end
-
- def test_equals3_cpu
- ppc_darwin8 = Gem::Platform.new 'powerpc-darwin8.0'
- uni_darwin8 = Gem::Platform.new 'universal-darwin8.0'
- x86_darwin8 = Gem::Platform.new 'i686-darwin8.0'
-
- util_set_arch 'powerpc-darwin8'
- assert((ppc_darwin8 === Gem::Platform.local), 'powerpc =~ universal')
- assert((uni_darwin8 === Gem::Platform.local), 'powerpc =~ universal')
- refute((x86_darwin8 === Gem::Platform.local), 'powerpc =~ universal')
-
- util_set_arch 'i686-darwin8'
- refute((ppc_darwin8 === Gem::Platform.local), 'powerpc =~ universal')
- assert((uni_darwin8 === Gem::Platform.local), 'x86 =~ universal')
- assert((x86_darwin8 === Gem::Platform.local), 'powerpc =~ universal')
-
- util_set_arch 'universal-darwin8'
- assert((ppc_darwin8 === Gem::Platform.local), 'universal =~ ppc')
- assert((uni_darwin8 === Gem::Platform.local), 'universal =~ universal')
- assert((x86_darwin8 === Gem::Platform.local), 'universal =~ x86')
- end
-
- def test_equals3_version
- util_set_arch 'i686-darwin8'
-
- x86_darwin = Gem::Platform.new ['x86', 'darwin', nil]
- x86_darwin7 = Gem::Platform.new ['x86', 'darwin', '7']
- x86_darwin8 = Gem::Platform.new ['x86', 'darwin', '8']
- x86_darwin9 = Gem::Platform.new ['x86', 'darwin', '9']
-
- assert((x86_darwin === Gem::Platform.local), 'x86_darwin === x86_darwin8')
- assert((x86_darwin8 === Gem::Platform.local), 'x86_darwin8 === x86_darwin8')
-
- refute((x86_darwin7 === Gem::Platform.local), 'x86_darwin7 === x86_darwin8')
- refute((x86_darwin9 === Gem::Platform.local), 'x86_darwin9 === x86_darwin8')
- end
-
- def test_equals_tilde
- util_set_arch 'i386-mswin32'
-
- assert_match 'mswin32', Gem::Platform.local
- assert_match 'i386-mswin32', Gem::Platform.local
-
- # oddballs
- assert_match 'i386-mswin32-mq5.3', Gem::Platform.local
- assert_match 'i386-mswin32-mq6', Gem::Platform.local
- refute_match 'win32-1.8.2-VC7', Gem::Platform.local
- refute_match 'win32-1.8.4-VC6', Gem::Platform.local
- refute_match 'win32-source', Gem::Platform.local
- refute_match 'windows', Gem::Platform.local
-
- util_set_arch 'i686-linux'
- assert_match 'i486-linux', Gem::Platform.local
- assert_match 'i586-linux', Gem::Platform.local
- assert_match 'i686-linux', Gem::Platform.local
-
- util_set_arch 'i686-darwin8'
- assert_match 'i686-darwin8.4.1', Gem::Platform.local
- assert_match 'i686-darwin8.8.2', Gem::Platform.local
-
- util_set_arch 'java'
- assert_match 'java', Gem::Platform.local
- assert_match 'jruby', Gem::Platform.local
-
- util_set_arch 'powerpc-darwin'
- assert_match 'powerpc-darwin', Gem::Platform.local
-
- util_set_arch 'powerpc-darwin7'
- assert_match 'powerpc-darwin7.9.0', Gem::Platform.local
-
- util_set_arch 'powerpc-darwin8'
- assert_match 'powerpc-darwin8.10.0', Gem::Platform.local
-
- util_set_arch 'sparc-solaris2.8'
- assert_match 'sparc-solaris2.8-mq5.3', Gem::Platform.local
- end
-
-end
-
diff --git a/test/rubygems/test_gem_remote_fetcher.rb b/test/rubygems/test_gem_remote_fetcher.rb
deleted file mode 100644
index 465443c901..0000000000
--- a/test/rubygems/test_gem_remote_fetcher.rb
+++ /dev/null
@@ -1,730 +0,0 @@
-#--
-# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
-# All rights reserved.
-# See LICENSE.txt for permissions.
-#++
-
-require File.join(File.expand_path(File.dirname(__FILE__)), 'gemutilities')
-require 'webrick'
-require 'zlib'
-require 'rubygems/remote_fetcher'
-require 'ostruct'
-
-# = Testing Proxy Settings
-#
-# These tests check the proper proxy server settings by running two
-# web servers. The web server at http://localhost:#{SERVER_PORT}
-# represents the normal gem server and returns a gemspec with a rake
-# version of 0.4.11. The web server at http://localhost:#{PROXY_PORT}
-# represents the proxy server and returns a different dataset where
-# rake has version 0.4.2. This allows us to detect which server is
-# returning the data.
-#
-# Note that the proxy server is not a *real* proxy server. But our
-# software doesn't really care, as long as we hit the proxy URL when a
-# proxy is configured.
-
-class TestGemRemoteFetcher < RubyGemTestCase
-
- include Gem::DefaultUserInteraction
-
- SERVER_DATA = <<-EOY
---- !ruby/object:Gem::Cache
-gems:
- rake-0.4.11: !ruby/object:Gem::Specification
- rubygems_version: "0.7"
- specification_version: 1
- name: rake
- version: !ruby/object:Gem::Version
- version: 0.4.11
- date: 2004-11-12
- summary: Ruby based make-like utility.
- require_paths:
- - lib
- author: Jim Weirich
- email: jim@weirichhouse.org
- homepage: http://rake.rubyforge.org
- rubyforge_project: rake
- description: Rake is a Make-like program implemented in Ruby. Tasks and dependencies are specified in standard Ruby syntax.
- autorequire:
- default_executable: rake
- bindir: bin
- has_rdoc: true
- required_ruby_version: !ruby/object:Gem::Version::Requirement
- requirements:
- -
- - ">"
- - !ruby/object:Gem::Version
- version: 0.0.0
- version:
- platform: ruby
- files:
- - README
- test_files: []
- library_stubs:
- rdoc_options:
- extra_rdoc_files:
- executables:
- - rake
- extensions: []
- requirements: []
- dependencies: []
- EOY
-
- PROXY_DATA = SERVER_DATA.gsub(/0.4.11/, '0.4.2')
-
- # don't let 1.8 and 1.9 autotest collide
- RUBY_VERSION =~ /(\d+)\.(\d+)\.(\d+)/
- # don't let parallel runners collide
- PROXY_PORT = process_based_port + 100 + $1.to_i * 100 + $2.to_i * 10 + $3.to_i
- SERVER_PORT = process_based_port + 200 + $1.to_i * 100 + $2.to_i * 10 + $3.to_i
-
- def setup
- super
- self.class.start_servers
- self.class.enable_yaml = true
- self.class.enable_zip = false
- ENV.delete 'http_proxy'
- ENV.delete 'HTTP_PROXY'
- ENV.delete 'http_proxy_user'
- ENV.delete 'HTTP_PROXY_USER'
- ENV.delete 'http_proxy_pass'
- ENV.delete 'HTTP_PROXY_PASS'
-
- base_server_uri = "http://localhost:#{SERVER_PORT}"
- @proxy_uri = "http://localhost:#{PROXY_PORT}"
-
- @server_uri = base_server_uri + "/yaml"
- @server_z_uri = base_server_uri + "/yaml.Z"
-
- # REFACTOR: copied from test_gem_dependency_installer.rb
- @gems_dir = File.join @tempdir, 'gems'
- @cache_dir = File.join @gemhome, 'cache'
- FileUtils.mkdir @gems_dir
-
- @a1, @a1_gem = util_gem 'a', '1' do |s| s.executables << 'a_bin' end
-
- Gem::RemoteFetcher.fetcher = nil
-
- @fetcher = Gem::RemoteFetcher.fetcher
- end
-
- def teardown
- super
- Gem.configuration[:http_proxy] = nil
- end
-
- def test_self_fetcher
- fetcher = Gem::RemoteFetcher.fetcher
- refute_nil fetcher
- assert_kind_of Gem::RemoteFetcher, fetcher
- end
-
- def test_self_fetcher_with_proxy
- proxy_uri = 'http://proxy.example.com'
- Gem.configuration[:http_proxy] = proxy_uri
- Gem::RemoteFetcher.fetcher = nil
-
- fetcher = Gem::RemoteFetcher.fetcher
-
- refute_nil fetcher
- assert_kind_of Gem::RemoteFetcher, fetcher
- assert_equal proxy_uri, fetcher.instance_variable_get(:@proxy_uri).to_s
- end
-
- def test_self_fetcher_with_proxy_URI
- proxy_uri = URI.parse 'http://proxy.example.com'
- Gem.configuration[:http_proxy] = proxy_uri
- Gem::RemoteFetcher.fetcher = nil
-
- fetcher = Gem::RemoteFetcher.fetcher
- refute_nil fetcher
-
- assert_kind_of Gem::RemoteFetcher, fetcher
- assert_equal proxy_uri, fetcher.instance_variable_get(:@proxy_uri)
- end
-
- def test_fetch_size_bad_uri
- fetcher = Gem::RemoteFetcher.new nil
-
- e = assert_raises ArgumentError do
- fetcher.fetch_size 'gems.example.com/yaml'
- end
-
- assert_equal 'uri scheme is invalid', e.message
- end
-
- def test_fetch_size_socket_error
- fetcher = Gem::RemoteFetcher.new nil
- def fetcher.connection_for(uri)
- raise SocketError, "tarded"
- end
-
- uri = 'http://gems.example.com/yaml'
- e = assert_raises Gem::RemoteFetcher::FetchError do
- fetcher.fetch_size uri
- end
-
- assert_equal "SocketError: tarded (#{uri})", e.message
- end
-
- def test_no_proxy
- use_ui @ui do
- assert_data_from_server @fetcher.fetch_path(@server_uri)
- assert_equal SERVER_DATA.size, @fetcher.fetch_size(@server_uri)
- end
- end
-
- def util_fuck_with_fetcher data, blow = false
- fetcher = Gem::RemoteFetcher.fetcher
- fetcher.instance_variable_set :@test_data, data
-
- unless blow then
- def fetcher.fetch_path arg
- @test_arg = arg
- @test_data
- end
- else
- def fetcher.fetch_path arg
- # OMG I'm such an ass
- class << self; remove_method :fetch_path; end
- def self.fetch_path arg
- @test_arg = arg
- @test_data
- end
-
- raise Gem::RemoteFetcher::FetchError.new("haha!", nil)
- end
- end
-
- fetcher
- end
-
- def test_download
- a1_data = nil
- File.open @a1_gem, 'rb' do |fp|
- a1_data = fp.read
- end
-
- fetcher = util_fuck_with_fetcher a1_data
-
- a1_cache_gem = File.join(@gemhome, 'cache', "#{@a1.full_name}.gem")
- assert_equal a1_cache_gem, fetcher.download(@a1, 'http://gems.example.com')
- assert_equal("http://gems.example.com/gems/a-1.gem",
- fetcher.instance_variable_get(:@test_arg).to_s)
- assert File.exist?(a1_cache_gem)
- end
-
- def test_download_cached
- FileUtils.mv @a1_gem, @cache_dir
-
- inst = Gem::RemoteFetcher.fetcher
-
- assert_equal File.join(@gemhome, 'cache', "#{@a1.full_name}.gem"),
- inst.download(@a1, 'http://gems.example.com')
- end
-
- def test_download_local
- FileUtils.mv @a1_gem, @tempdir
- local_path = File.join @tempdir, "#{@a1.full_name}.gem"
- inst = nil
-
- Dir.chdir @tempdir do
- inst = Gem::RemoteFetcher.fetcher
- end
-
- assert_equal File.join(@gemhome, 'cache', "#{@a1.full_name}.gem"),
- inst.download(@a1, local_path)
- end
-
- def test_download_local_space
- space_path = File.join @tempdir, 'space path'
- FileUtils.mkdir space_path
- FileUtils.mv @a1_gem, space_path
- local_path = File.join space_path, "#{@a1.full_name}.gem"
- inst = nil
-
- Dir.chdir @tempdir do
- inst = Gem::RemoteFetcher.fetcher
- end
-
- assert_equal File.join(@gemhome, 'cache', "#{@a1.full_name}.gem"),
- inst.download(@a1, local_path)
- end
-
- def test_download_install_dir
- a1_data = nil
- File.open @a1_gem, 'rb' do |fp|
- a1_data = fp.read
- end
-
- fetcher = util_fuck_with_fetcher a1_data
-
- install_dir = File.join @tempdir, 'more_gems'
-
- a1_cache_gem = File.join install_dir, 'cache', "#{@a1.full_name}.gem"
- FileUtils.mkdir_p(File.dirname(a1_cache_gem))
- actual = fetcher.download(@a1, 'http://gems.example.com', install_dir)
-
- assert_equal a1_cache_gem, actual
- assert_equal("http://gems.example.com/gems/a-1.gem",
- fetcher.instance_variable_get(:@test_arg).to_s)
-
- assert File.exist?(a1_cache_gem)
- end
-
- unless win_platform? # File.chmod doesn't work
- def test_download_local_read_only
- FileUtils.mv @a1_gem, @tempdir
- local_path = File.join @tempdir, "#{@a1.full_name}.gem"
- inst = nil
- File.chmod 0555, File.join(@gemhome, 'cache')
-
- Dir.chdir @tempdir do
- inst = Gem::RemoteFetcher.fetcher
- end
-
- assert_equal File.join(@tempdir, "#{@a1.full_name}.gem"),
- inst.download(@a1, local_path)
- ensure
- File.chmod 0755, File.join(@gemhome, 'cache')
- end
-
- def test_download_read_only
- File.chmod 0555, File.join(@gemhome, 'cache')
- File.chmod 0555, File.join(@gemhome)
-
- fetcher = util_fuck_with_fetcher File.read(@a1_gem)
- fetcher.download(@a1, 'http://gems.example.com')
- assert File.exist?(File.join(Gem.user_dir, 'cache',
- "#{@a1.full_name}.gem"))
- ensure
- File.chmod 0755, File.join(@gemhome)
- File.chmod 0755, File.join(@gemhome, 'cache')
- end
- end
-
- def test_download_platform_legacy
- original_platform = 'old-platform'
-
- e1, e1_gem = util_gem 'e', '1' do |s|
- s.platform = Gem::Platform::CURRENT
- s.instance_variable_set :@original_platform, original_platform
- end
-
- e1_data = nil
- File.open e1_gem, 'rb' do |fp|
- e1_data = fp.read
- end
-
- fetcher = util_fuck_with_fetcher e1_data, :blow_chunks
-
- e1_cache_gem = File.join(@gemhome, 'cache', "#{e1.full_name}.gem")
-
- assert_equal e1_cache_gem, fetcher.download(e1, 'http://gems.example.com')
-
- assert_equal("http://gems.example.com/gems/#{e1.original_name}.gem",
- fetcher.instance_variable_get(:@test_arg).to_s)
- assert File.exist?(e1_cache_gem)
- end
-
- def test_download_unsupported
- inst = Gem::RemoteFetcher.fetcher
-
- e = assert_raises Gem::InstallError do
- inst.download @a1, 'ftp://gems.rubyforge.org'
- end
-
- assert_equal 'unsupported URI scheme ftp', e.message
- end
-
- def test_explicit_proxy
- use_ui @ui do
- fetcher = Gem::RemoteFetcher.new @proxy_uri
- assert_equal PROXY_DATA.size, fetcher.fetch_size(@server_uri)
- assert_data_from_proxy fetcher.fetch_path(@server_uri)
- end
- end
-
- def test_explicit_proxy_with_user_auth
- use_ui @ui do
- uri = URI.parse @proxy_uri
- uri.user, uri.password = 'foo', 'bar'
- fetcher = Gem::RemoteFetcher.new uri.to_s
- proxy = fetcher.instance_variable_get("@proxy_uri")
- assert_equal 'foo', proxy.user
- assert_equal 'bar', proxy.password
- assert_data_from_proxy fetcher.fetch_path(@server_uri)
- end
-
- use_ui @ui do
- uri = URI.parse @proxy_uri
- uri.user, uri.password = 'domain%5Cuser', 'bar'
- fetcher = Gem::RemoteFetcher.new uri.to_s
- proxy = fetcher.instance_variable_get("@proxy_uri")
- assert_equal 'domain\user', URI.unescape(proxy.user)
- assert_equal 'bar', proxy.password
- assert_data_from_proxy fetcher.fetch_path(@server_uri)
- end
-
- use_ui @ui do
- uri = URI.parse @proxy_uri
- uri.user, uri.password = 'user', 'my%20pass'
- fetcher = Gem::RemoteFetcher.new uri.to_s
- proxy = fetcher.instance_variable_get("@proxy_uri")
- assert_equal 'user', proxy.user
- assert_equal 'my pass', URI.unescape(proxy.password)
- assert_data_from_proxy fetcher.fetch_path(@server_uri)
- end
- end
-
- def test_explicit_proxy_with_user_auth_in_env
- use_ui @ui do
- ENV['http_proxy'] = @proxy_uri
- ENV['http_proxy_user'] = 'foo'
- ENV['http_proxy_pass'] = 'bar'
- fetcher = Gem::RemoteFetcher.new nil
- proxy = fetcher.instance_variable_get("@proxy_uri")
- assert_equal 'foo', proxy.user
- assert_equal 'bar', proxy.password
- assert_data_from_proxy fetcher.fetch_path(@server_uri)
- end
-
- use_ui @ui do
- ENV['http_proxy'] = @proxy_uri
- ENV['http_proxy_user'] = 'foo\user'
- ENV['http_proxy_pass'] = 'my bar'
- fetcher = Gem::RemoteFetcher.new nil
- proxy = fetcher.instance_variable_get("@proxy_uri")
- assert_equal 'foo\user', URI.unescape(proxy.user)
- assert_equal 'my bar', URI.unescape(proxy.password)
- assert_data_from_proxy fetcher.fetch_path(@server_uri)
- end
- end
-
- def test_fetch_path_gzip
- fetcher = Gem::RemoteFetcher.new nil
-
- def fetcher.open_uri_or_path(uri, mtime, head = nil)
- Gem.gzip 'foo'
- end
-
- assert_equal 'foo', fetcher.fetch_path(@uri + 'foo.gz')
- end
-
- def test_fetch_path_gzip_unmodified
- fetcher = Gem::RemoteFetcher.new nil
-
- def fetcher.open_uri_or_path(uri, mtime, head = nil)
- nil
- end
-
- assert_equal nil, fetcher.fetch_path(@uri + 'foo.gz', Time.at(0))
- end
-
- def test_fetch_path_io_error
- fetcher = Gem::RemoteFetcher.new nil
-
- def fetcher.open_uri_or_path(uri, mtime, head = nil)
- raise EOFError
- end
-
- e = assert_raises Gem::RemoteFetcher::FetchError do
- fetcher.fetch_path 'uri'
- end
-
- assert_equal 'EOFError: EOFError (uri)', e.message
- assert_equal 'uri', e.uri
- end
-
- def test_fetch_path_socket_error
- fetcher = Gem::RemoteFetcher.new nil
-
- def fetcher.open_uri_or_path(uri, mtime, head = nil)
- raise SocketError
- end
-
- e = assert_raises Gem::RemoteFetcher::FetchError do
- fetcher.fetch_path 'uri'
- end
-
- assert_equal 'SocketError: SocketError (uri)', e.message
- assert_equal 'uri', e.uri
- end
-
- def test_fetch_path_system_call_error
- fetcher = Gem::RemoteFetcher.new nil
-
- def fetcher.open_uri_or_path(uri, mtime = nil, head = nil)
- raise Errno::ECONNREFUSED, 'connect(2)'
- end
-
- e = assert_raises Gem::RemoteFetcher::FetchError do
- fetcher.fetch_path 'uri'
- end
-
- assert_match %r|ECONNREFUSED:.*connect\(2\) \(uri\)\z|,
- e.message
- assert_equal 'uri', e.uri
- end
-
- def test_fetch_path_unmodified
- fetcher = Gem::RemoteFetcher.new nil
-
- def fetcher.open_uri_or_path(uri, mtime, head = nil)
- nil
- end
-
- assert_equal nil, fetcher.fetch_path(URI.parse(@gem_repo), Time.at(0))
- end
-
- def test_get_proxy_from_env_auto_normalizes
- fetcher = Gem::RemoteFetcher.new(nil)
- ENV['HTTP_PROXY'] = 'fakeurl:12345'
-
- assert_equal('http://fakeurl:12345', fetcher.get_proxy_from_env.to_s)
- end
-
- def test_get_proxy_from_env_empty
- orig_env_HTTP_PROXY = ENV['HTTP_PROXY']
- orig_env_http_proxy = ENV['http_proxy']
-
- ENV['HTTP_PROXY'] = ''
- ENV.delete 'http_proxy'
-
- fetcher = Gem::RemoteFetcher.new nil
-
- assert_equal nil, fetcher.send(:get_proxy_from_env)
-
- ensure
- orig_env_HTTP_PROXY.nil? ? ENV.delete('HTTP_PROXY') :
- ENV['HTTP_PROXY'] = orig_env_HTTP_PROXY
- orig_env_http_proxy.nil? ? ENV.delete('http_proxy') :
- ENV['http_proxy'] = orig_env_http_proxy
- end
-
- def test_implicit_no_proxy
- use_ui @ui do
- ENV['http_proxy'] = 'http://fakeurl:12345'
- fetcher = Gem::RemoteFetcher.new :no_proxy
- assert_data_from_server fetcher.fetch_path(@server_uri)
- end
- end
-
- def test_implicit_proxy
- use_ui @ui do
- ENV['http_proxy'] = @proxy_uri
- fetcher = Gem::RemoteFetcher.new nil
- assert_data_from_proxy fetcher.fetch_path(@server_uri)
- end
- end
-
- def test_implicit_upper_case_proxy
- use_ui @ui do
- ENV['HTTP_PROXY'] = @proxy_uri
- fetcher = Gem::RemoteFetcher.new nil
- assert_data_from_proxy fetcher.fetch_path(@server_uri)
- end
- end
-
- def test_implicit_proxy_no_env
- use_ui @ui do
- fetcher = Gem::RemoteFetcher.new nil
- assert_data_from_server fetcher.fetch_path(@server_uri)
- end
- end
-
- def test_open_uri_or_path
- fetcher = Gem::RemoteFetcher.new nil
-
- conn = Object.new
- def conn.started?() true end
- def conn.request(req)
- unless defined? @requested then
- @requested = true
- res = Net::HTTPMovedPermanently.new nil, 301, nil
- res.add_field 'Location', 'http://gems.example.com/real_path'
- res
- else
- res = Net::HTTPOK.new nil, 200, nil
- def res.body() 'real_path' end
- res
- end
- end
-
- conn = { 'gems.example.com:80' => conn }
- fetcher.instance_variable_set :@connections, conn
-
- data = fetcher.open_uri_or_path 'http://gems.example.com/redirect'
-
- assert_equal 'real_path', data
- end
-
- def test_open_uri_or_path_limited_redirects
- fetcher = Gem::RemoteFetcher.new nil
-
- conn = Object.new
- def conn.started?() true end
- def conn.request(req)
- res = Net::HTTPMovedPermanently.new nil, 301, nil
- res.add_field 'Location', 'http://gems.example.com/redirect'
- res
- end
-
- conn = { 'gems.example.com:80' => conn }
- fetcher.instance_variable_set :@connections, conn
-
- e = assert_raises Gem::RemoteFetcher::FetchError do
- fetcher.open_uri_or_path 'http://gems.example.com/redirect'
- end
-
- assert_equal 'too many redirects (http://gems.example.com/redirect)',
- e.message
- end
-
- def test_request
- uri = URI.parse "#{@gem_repo}/specs.#{Gem.marshal_version}"
- util_stub_connection_for :body => :junk, :code => 200
-
- response = @fetcher.request uri, Net::HTTP::Get
-
- assert_equal 200, response.code
- assert_equal :junk, response.body
- end
-
- def test_request_head
- uri = URI.parse "#{@gem_repo}/specs.#{Gem.marshal_version}"
- util_stub_connection_for :body => '', :code => 200
- response = @fetcher.request uri, Net::HTTP::Head
-
- assert_equal 200, response.code
- assert_equal '', response.body
- end
-
- def test_request_unmodifed
- uri = URI.parse "#{@gem_repo}/specs.#{Gem.marshal_version}"
- conn = util_stub_connection_for :body => '', :code => 304
-
- t = Time.now
- response = @fetcher.request uri, Net::HTTP::Head, t
-
- assert_equal 304, response.code
- assert_equal '', response.body
-
- assert_equal t.rfc2822, conn.payload['if-modified-since']
- end
-
- def test_yaml_error_on_size
- use_ui @ui do
- self.class.enable_yaml = false
- fetcher = Gem::RemoteFetcher.new nil
- assert_error { fetcher.size }
- end
- end
-
- def util_stub_connection_for hash
- def @fetcher.connection= conn
- @conn = conn
- end
-
- def @fetcher.connection_for uri
- @conn
- end
-
- @fetcher.connection = Conn.new OpenStruct.new(hash)
- end
-
- def assert_error(exception_class=Exception)
- got_exception = false
- begin
- yield
- rescue exception_class => ex
- got_exception = true
- end
- assert got_exception, "Expected exception conforming to #{exception_class}"
- end
-
- def assert_data_from_server(data)
- assert_block("Data is not from server") { data =~ /0\.4\.11/ }
- end
-
- def assert_data_from_proxy(data)
- assert_block("Data is not from proxy") { data =~ /0\.4\.2/ }
- end
-
- class Conn
- attr_accessor :payload
-
- def initialize(response)
- @response = response
- self.payload = nil
- end
-
- def request(req)
- self.payload = req
- @response
- end
- end
-
- class NilLog < WEBrick::Log
- def log(level, data) #Do nothing
- end
- end
-
- class << self
- attr_reader :normal_server, :proxy_server
- attr_accessor :enable_zip, :enable_yaml
-
- def start_servers
- @normal_server ||= start_server(SERVER_PORT, SERVER_DATA)
- @proxy_server ||= start_server(PROXY_PORT, PROXY_DATA)
- @enable_yaml = true
- @enable_zip = false
- end
-
- private
-
- def start_server(port, data)
- Thread.new do
- begin
- null_logger = NilLog.new
- s = WEBrick::HTTPServer.new(
- :Port => port,
- :DocumentRoot => nil,
- :Logger => null_logger,
- :AccessLog => null_logger
- )
- s.mount_proc("/kill") { |req, res| s.shutdown }
- s.mount_proc("/yaml") { |req, res|
- if @enable_yaml
- res.body = data
- res['Content-Type'] = 'text/plain'
- res['content-length'] = data.size
- else
- res.status = "404"
- res.body = "<h1>NOT FOUND</h1>"
- res['Content-Type'] = 'text/html'
- end
- }
- s.mount_proc("/yaml.Z") { |req, res|
- if @enable_zip
- res.body = Zlib::Deflate.deflate(data)
- res['Content-Type'] = 'text/plain'
- else
- res.status = "404"
- res.body = "<h1>NOT FOUND</h1>"
- res['Content-Type'] = 'text/html'
- end
- }
- s.start
- rescue Exception => ex
- abort ex.message
- puts "ERROR during server thread: #{ex.message}"
- end
- end
- sleep 0.2 # Give the servers time to startup
- end
- end
-
-end
-
diff --git a/test/rubygems/test_gem_requirement.rb b/test/rubygems/test_gem_requirement.rb
deleted file mode 100644
index e1399bdaff..0000000000
--- a/test/rubygems/test_gem_requirement.rb
+++ /dev/null
@@ -1,222 +0,0 @@
-#--
-# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
-# All rights reserved.
-# See LICENSE.txt for permissions.
-#++
-
-require File.join(File.expand_path(File.dirname(__FILE__)), 'gemutilities')
-require 'rubygems/version'
-
-class TestGemRequirement < RubyGemTestCase
-
- def setup
- super
-
- @r1_2 = Gem::Requirement.new '= 1.2'
- @r1_3 = Gem::Requirement.new '= 1.3'
- end
-
- def test_initialize
- r = Gem::Requirement.new '2'
- assert_equal '= 2', r.to_s, 'String'
-
- r = Gem::Requirement.new %w[2]
- assert_equal '= 2', r.to_s, 'Array of Strings'
-
- r = Gem::Requirement.new Gem::Version.new('2')
- assert_equal '= 2', r.to_s, 'Gem::Version'
- end
-
- def test_equals2
- assert_equal @r1_2, @r1_2.dup
- assert_equal @r1_2.dup, @r1_2
-
- refute_equal @r1_3, @r1_2
- refute_equal @r1_2, @r1_3
-
- refute_equal Object.new, @r1_2
- refute_equal @r1_2, Object.new
- end
-
- def test_hash
- assert_equal @r1_2.hash, @r1_2.dup.hash
- assert_equal @r1_2.dup.hash, @r1_2.hash
-
- refute_equal @r1_2.hash, @r1_3.hash
- refute_equal @r1_3.hash, @r1_2.hash
- end
-
- # We may get some old gems that have requirements in old formats.
- # We need to be able to handle those old requirements by normalizing
- # them to the latest format.
- def test_normalization
- require 'yaml'
- yamldep = %{--- !ruby/object:Gem::Requirement
- nums:
- - 1
- - 0
- - 4
- op: ">="
- version: ">= 1.0.4"}
- dep = YAML.load(yamldep)
- dep.normalize
- assert_equal ">= 1.0.4", dep.to_s
- end
-
- def test_parse
- assert_equal ['=', Gem::Version.new(1)], @r1_2.parse(' 1')
-
- assert_equal ['=', Gem::Version.new(1)], @r1_2.parse('= 1')
- assert_equal ['>', Gem::Version.new(1)], @r1_2.parse('> 1')
-
- assert_equal ['=', Gem::Version.new(0)], @r1_2.parse('=')
- assert_equal ['>', Gem::Version.new(0)], @r1_2.parse('>')
-
- assert_equal ['=', Gem::Version.new(1)], @r1_2.parse("=\n1")
- assert_equal ['=', Gem::Version.new(0)], @r1_2.parse("=\njunk")
-
- assert_equal ['=', Gem::Version.new(2)], @r1_2.parse(Gem::Version.new('2'))
- end
-
- def test_parse_illformed
- e = assert_raises ArgumentError do
- @r1_2.parse(nil)
- end
-
- assert_equal 'Illformed requirement [nil]', e.message
-
- e = assert_raises ArgumentError do
- @r1_2.parse('')
- end
-
- assert_equal 'Illformed requirement [""]', e.message
- end
-
- def test_satisfied_by_eh_bang_equal
- r1_2 = Gem::Requirement.new '!= 1.2'
- v1_1 = Gem::Version.new '1.1'
- v1_2 = Gem::Version.new '1.2'
- v1_3 = Gem::Version.new '1.3'
-
- assert_equal true, r1_2.satisfied_by?(nil)
- assert_equal true, r1_2.satisfied_by?(v1_1)
- assert_equal false, r1_2.satisfied_by?(v1_2)
- assert_equal true, r1_2.satisfied_by?(v1_3)
- end
-
- def test_satisfied_by_eh_blank
- r1_2 = Gem::Requirement.new '1.2'
- v1_1 = Gem::Version.new '1.1'
- v1_2 = Gem::Version.new '1.2'
- v1_3 = Gem::Version.new '1.3'
-
- assert_equal false, r1_2.satisfied_by?(nil)
- assert_equal false, r1_2.satisfied_by?(v1_1)
- assert_equal true, r1_2.satisfied_by?(v1_2)
- assert_equal false, r1_2.satisfied_by?(v1_3)
- end
-
- def test_satisfied_by_eh_equal
- r1_2 = @r1_2
- v1_1 = Gem::Version.new '1.1'
- v1_2 = Gem::Version.new '1.2'
- v1_3 = Gem::Version.new '1.3'
-
- assert_equal false, r1_2.satisfied_by?(nil)
- assert_equal false, r1_2.satisfied_by?(v1_1)
- assert_equal true, r1_2.satisfied_by?(v1_2)
- assert_equal false, r1_2.satisfied_by?(v1_3)
- end
-
- def test_satisfied_by_eh_gt
- r1_2 = Gem::Requirement.new '> 1.2'
- v1_1 = Gem::Version.new '1.1'
- v1_2 = Gem::Version.new '1.2'
- v1_3 = Gem::Version.new '1.3'
-
- assert_equal false, r1_2.satisfied_by?(v1_1)
- assert_equal false, r1_2.satisfied_by?(v1_2)
- assert_equal true, r1_2.satisfied_by?(v1_3)
-
- assert_raises NoMethodError do
- assert_equal true, r1_2.satisfied_by?(nil)
- end
- end
-
- def test_satisfied_by_eh_gte
- r1_2 = Gem::Requirement.new '>= 1.2'
- v1_1 = Gem::Version.new '1.1'
- v1_2 = Gem::Version.new '1.2'
- v1_3 = Gem::Version.new '1.3'
-
- assert_equal false, r1_2.satisfied_by?(v1_1)
- assert_equal true, r1_2.satisfied_by?(v1_2)
- assert_equal true, r1_2.satisfied_by?(v1_3)
-
- assert_raises NoMethodError do
- assert_equal true, r1_2.satisfied_by?(nil)
- end
- end
-
- def test_satisfied_by_eh_list
- r = Gem::Requirement.create(['> 1.1', '< 1.3'])
- v1_1 = Gem::Version.new '1.1'
- v1_2 = Gem::Version.new '1.2'
- v1_3 = Gem::Version.new '1.3'
-
- assert_equal false, r.satisfied_by?(v1_1)
- assert_equal true, r.satisfied_by?(v1_2)
- assert_equal false, r.satisfied_by?(v1_3)
-
- assert_raises NoMethodError do
- assert_equal true, r.satisfied_by?(nil)
- end
- end
-
- def test_satisfied_by_eh_lt
- r1_2 = Gem::Requirement.new '< 1.2'
- v1_1 = Gem::Version.new '1.1'
- v1_2 = Gem::Version.new '1.2'
- v1_3 = Gem::Version.new '1.3'
-
- assert_equal true, r1_2.satisfied_by?(v1_1)
- assert_equal false, r1_2.satisfied_by?(v1_2)
- assert_equal false, r1_2.satisfied_by?(v1_3)
-
- assert_raises NoMethodError do
- assert_equal true, r1_2.satisfied_by?(nil)
- end
- end
-
- def test_satisfied_by_eh_lte
- r1_2 = Gem::Requirement.new '<= 1.2'
- v1_1 = Gem::Version.new '1.1'
- v1_2 = Gem::Version.new '1.2'
- v1_3 = Gem::Version.new '1.3'
-
- assert_equal true, r1_2.satisfied_by?(v1_1)
- assert_equal true, r1_2.satisfied_by?(v1_2)
- assert_equal false, r1_2.satisfied_by?(v1_3)
-
- assert_raises NoMethodError do
- assert_equal true, r1_2.satisfied_by?(nil)
- end
- end
-
- def test_satisfied_by_eh_tilde_gt
- r1_2 = Gem::Requirement.new '~> 1.2'
- v1_1 = Gem::Version.new '1.1'
- v1_2 = Gem::Version.new '1.2'
- v1_3 = Gem::Version.new '1.3'
-
- assert_equal false, r1_2.satisfied_by?(v1_1)
- assert_equal true, r1_2.satisfied_by?(v1_2)
- assert_equal true, r1_2.satisfied_by?(v1_3)
-
- assert_raises NoMethodError do
- assert_equal true, r1_2.satisfied_by?(nil)
- end
- end
-
-end
-
diff --git a/test/rubygems/test_gem_server.rb b/test/rubygems/test_gem_server.rb
deleted file mode 100644
index d929c04c07..0000000000
--- a/test/rubygems/test_gem_server.rb
+++ /dev/null
@@ -1,310 +0,0 @@
-require File.join(File.expand_path(File.dirname(__FILE__)), 'gemutilities')
-require 'rubygems/server'
-require 'stringio'
-
-class Gem::Server
- attr_accessor :source_index
- attr_reader :server
-end
-
-class TestGemServer < RubyGemTestCase
-
- def setup
- super
-
- @a1 = quick_gem 'a', '1'
- @a2 = quick_gem 'a', '2'
-
- @server = Gem::Server.new Gem.dir, process_based_port, false
- @req = WEBrick::HTTPRequest.new :Logger => nil
- @res = WEBrick::HTTPResponse.new :HTTPVersion => '1.0'
- end
-
- def test_Marshal
- data = StringIO.new "GET /Marshal.#{Gem.marshal_version} HTTP/1.0\r\n\r\n"
- @req.parse data
-
- @server.Marshal @req, @res
-
- assert_equal 200, @res.status, @res.body
- assert_match %r| \d\d:\d\d:\d\d |, @res['date']
- assert_equal 'application/octet-stream', @res['content-type']
-
- si = Gem::SourceIndex.new
- si.add_specs @a1, @a2
-
- assert_equal si, Marshal.load(@res.body)
- end
-
- def test_Marshal_Z
- data = StringIO.new "GET /Marshal.#{Gem.marshal_version}.Z HTTP/1.0\r\n\r\n"
- @req.parse data
-
- @server.Marshal @req, @res
-
- assert_equal 200, @res.status, @res.body
- assert_match %r| \d\d:\d\d:\d\d |, @res['date']
- assert_equal 'application/x-deflate', @res['content-type']
-
- si = Gem::SourceIndex.new
- si.add_specs @a1, @a2
-
- assert_equal si, Marshal.load(Gem.inflate(@res.body))
- end
-
- def test_latest_specs
- data = StringIO.new "GET /latest_specs.#{Gem.marshal_version} HTTP/1.0\r\n\r\n"
- @req.parse data
-
- @server.latest_specs @req, @res
-
- assert_equal 200, @res.status, @res.body
- assert_match %r| \d\d:\d\d:\d\d |, @res['date']
- assert_equal 'application/octet-stream', @res['content-type']
- assert_equal [['a', Gem::Version.new(2), Gem::Platform::RUBY]],
- Marshal.load(@res.body)
- end
-
- def test_latest_specs_gz
- data = StringIO.new "GET /latest_specs.#{Gem.marshal_version}.gz HTTP/1.0\r\n\r\n"
- @req.parse data
-
- @server.latest_specs @req, @res
-
- assert_equal 200, @res.status, @res.body
- assert_match %r| \d\d:\d\d:\d\d |, @res['date']
- assert_equal 'application/x-gzip', @res['content-type']
- assert_equal [['a', Gem::Version.new(2), Gem::Platform::RUBY]],
- Marshal.load(Gem.gunzip(@res.body))
- end
-
- def test_quick_a_1_gemspec_rz
- data = StringIO.new "GET /quick/a-1.gemspec.rz HTTP/1.0\r\n\r\n"
- @req.parse data
-
- @server.quick @req, @res
-
- assert_equal 200, @res.status, @res.body
- assert @res['date']
- assert_equal 'application/x-deflate', @res['content-type']
-
- spec = YAML.load Gem.inflate(@res.body)
- assert_equal 'a', spec.name
- assert_equal Gem::Version.new(1), spec.version
- end
-
- def test_quick_a_1_mswin32_gemspec_rz
- a1_p = quick_gem 'a', '1' do |s| s.platform = Gem::Platform.local end
-
- data = StringIO.new "GET /quick/a-1-#{Gem::Platform.local}.gemspec.rz HTTP/1.0\r\n\r\n"
- @req.parse data
-
- @server.quick @req, @res
-
- assert_equal 200, @res.status, @res.body
- assert @res['date']
- assert_equal 'application/x-deflate', @res['content-type']
-
- spec = YAML.load Gem.inflate(@res.body)
- assert_equal 'a', spec.name
- assert_equal Gem::Version.new(1), spec.version
- assert_equal Gem::Platform.local, spec.platform
- end
-
- def test_quick_common_substrings
- ab1 = quick_gem 'ab', '1'
-
- data = StringIO.new "GET /quick/a-1.gemspec.rz HTTP/1.0\r\n\r\n"
- @req.parse data
-
- @server.quick @req, @res
-
- assert_equal 200, @res.status, @res.body
- assert @res['date']
- assert_equal 'application/x-deflate', @res['content-type']
-
- spec = YAML.load Gem.inflate(@res.body)
- assert_equal 'a', spec.name
- assert_equal Gem::Version.new(1), spec.version
- end
-
- def test_quick_index
- data = StringIO.new "GET /quick/index HTTP/1.0\r\n\r\n"
- @req.parse data
-
- @server.quick @req, @res
-
- assert_equal 200, @res.status, @res.body
- assert_match %r| \d\d:\d\d:\d\d |, @res['date']
- assert_equal 'text/plain', @res['content-type']
- assert_equal "a-1\na-2", @res.body
- end
-
- def test_quick_index_rz
- data = StringIO.new "GET /quick/index.rz HTTP/1.0\r\n\r\n"
- @req.parse data
-
- @server.quick @req, @res
-
- assert_equal 200, @res.status, @res.body
- assert_match %r| \d\d:\d\d:\d\d |, @res['date']
- assert_equal 'application/x-deflate', @res['content-type']
- assert_equal "a-1\na-2", Gem.inflate(@res.body)
- end
-
- def test_quick_latest_index
- data = StringIO.new "GET /quick/latest_index HTTP/1.0\r\n\r\n"
- @req.parse data
-
- @server.quick @req, @res
-
- assert_equal 200, @res.status, @res.body
- assert_match %r| \d\d:\d\d:\d\d |, @res['date']
- assert_equal 'text/plain', @res['content-type']
- assert_equal 'a-2', @res.body
- end
-
- def test_quick_latest_index_rz
- data = StringIO.new "GET /quick/latest_index.rz HTTP/1.0\r\n\r\n"
- @req.parse data
-
- @server.quick @req, @res
-
- assert_equal 200, @res.status, @res.body
- assert_match %r| \d\d:\d\d:\d\d |, @res['date']
- assert_equal 'application/x-deflate', @res['content-type']
- assert_equal 'a-2', Gem.inflate(@res.body)
- end
-
- def test_quick_missing
- data = StringIO.new "GET /quick/z-9.gemspec.rz HTTP/1.0\r\n\r\n"
- @req.parse data
-
- @server.quick @req, @res
-
- assert_equal 404, @res.status, @res.body
- assert_match %r| \d\d:\d\d:\d\d |, @res['date']
- assert_equal 'text/plain', @res['content-type']
- assert_equal 'No gems found matching "z" "9" nil', @res.body
- assert_equal 404, @res.status
- end
-
- def test_quick_marshal_a_1_gemspec_rz
- data = StringIO.new "GET /quick/Marshal.#{Gem.marshal_version}/a-1.gemspec.rz HTTP/1.0\r\n\r\n"
- @req.parse data
-
- @server.quick @req, @res
-
- assert_equal 200, @res.status, @res.body
- assert @res['date']
- assert_equal 'application/x-deflate', @res['content-type']
-
- spec = Marshal.load Gem.inflate(@res.body)
- assert_equal 'a', spec.name
- assert_equal Gem::Version.new(1), spec.version
- end
-
- def test_quick_marshal_a_1_mswin32_gemspec_rz
- a1_p = quick_gem 'a', '1' do |s| s.platform = Gem::Platform.local end
-
- data = StringIO.new "GET /quick/Marshal.#{Gem.marshal_version}/a-1-#{Gem::Platform.local}.gemspec.rz HTTP/1.0\r\n\r\n"
- @req.parse data
-
- @server.quick @req, @res
-
- assert_equal 200, @res.status, @res.body
- assert @res['date']
- assert_equal 'application/x-deflate', @res['content-type']
-
- spec = Marshal.load Gem.inflate(@res.body)
- assert_equal 'a', spec.name
- assert_equal Gem::Version.new(1), spec.version
- assert_equal Gem::Platform.local, spec.platform
- end
-
- def test_rdoc
- data = StringIO.new "GET /rdoc?q=a HTTP/1.0\r\n\r\n"
- @req.parse data
-
- @server.rdoc @req, @res
-
- assert_equal 200, @res.status, @res.body
- assert_match %r|No documentation found|, @res.body
- assert_equal 'text/html', @res['content-type']
- end
-
- def test_root
- data = StringIO.new "GET / HTTP/1.0\r\n\r\n"
- @req.parse data
-
- @server.root @req, @res
-
- assert_equal 200, @res.status, @res.body
- assert_match %r| \d\d:\d\d:\d\d |, @res['date']
- assert_equal 'text/html', @res['content-type']
- end
-
- def test_specs
- data = StringIO.new "GET /specs.#{Gem.marshal_version} HTTP/1.0\r\n\r\n"
- @req.parse data
-
- @server.specs @req, @res
-
- assert_equal 200, @res.status, @res.body
- assert_match %r| \d\d:\d\d:\d\d |, @res['date']
- assert_equal 'application/octet-stream', @res['content-type']
-
- assert_equal [['a', Gem::Version.new(1), Gem::Platform::RUBY],
- ['a', Gem::Version.new(2), Gem::Platform::RUBY]],
- Marshal.load(@res.body)
- end
-
- def test_specs_gz
- data = StringIO.new "GET /specs.#{Gem.marshal_version}.gz HTTP/1.0\r\n\r\n"
- @req.parse data
-
- @server.specs @req, @res
-
- assert_equal 200, @res.status, @res.body
- assert_match %r| \d\d:\d\d:\d\d |, @res['date']
- assert_equal 'application/x-gzip', @res['content-type']
-
- assert_equal [['a', Gem::Version.new(1), Gem::Platform::RUBY],
- ['a', Gem::Version.new(2), Gem::Platform::RUBY]],
- Marshal.load(Gem.gunzip(@res.body))
- end
-
- def test_yaml
- data = StringIO.new "GET /yaml.#{Gem.marshal_version} HTTP/1.0\r\n\r\n"
- @req.parse data
-
- @server.yaml @req, @res
-
- assert_equal 200, @res.status, @res.body
- assert_match %r| \d\d:\d\d:\d\d |, @res['date']
- assert_equal 'text/plain', @res['content-type']
-
- si = Gem::SourceIndex.new
- si.add_specs @a1, @a2
-
- assert_equal si, YAML.load(@res.body)
- end
-
- def test_yaml_Z
- data = StringIO.new "GET /yaml.#{Gem.marshal_version}.Z HTTP/1.0\r\n\r\n"
- @req.parse data
-
- @server.yaml @req, @res
-
- assert_equal 200, @res.status, @res.body
- assert_match %r| \d\d:\d\d:\d\d |, @res['date']
- assert_equal 'application/x-deflate', @res['content-type']
-
- si = Gem::SourceIndex.new
- si.add_specs @a1, @a2
-
- assert_equal si, YAML.load(Gem.inflate(@res.body))
- end
-
-end
-
diff --git a/test/rubygems/test_gem_source_index.rb b/test/rubygems/test_gem_source_index.rb
deleted file mode 100644
index 0983089cd9..0000000000
--- a/test/rubygems/test_gem_source_index.rb
+++ /dev/null
@@ -1,469 +0,0 @@
-#--
-# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
-# All rights reserved.
-# See LICENSE.txt for permissions.
-#++
-
-require File.join(File.expand_path(File.dirname(__FILE__)), 'gemutilities')
-require 'rubygems/source_index'
-require 'rubygems/config_file'
-
-class Gem::SourceIndex
- public :fetcher, :fetch_bulk_index, :fetch_quick_index,
- :find_missing, :gems, :remove_extra,
- :update_with_missing, :unzip
-end
-
-class TestGemSourceIndex < RubyGemTestCase
-
- def setup
- super
-
- util_setup_fake_fetcher
- end
-
- def test_self_from_gems_in
- spec_dir = File.join @gemhome, 'specifications'
-
- FileUtils.rm_r spec_dir
-
- FileUtils.mkdir_p spec_dir
-
- a1 = quick_gem 'a', '1' do |spec| spec.author = 'author 1' end
-
- spec_file = File.join spec_dir, "#{a1.full_name}.gemspec"
-
- File.open spec_file, 'w' do |fp|
- fp.write a1.to_ruby
- end
-
- si = Gem::SourceIndex.from_gems_in spec_dir
-
- assert_equal [spec_dir], si.spec_dirs
- assert_equal [a1.full_name], si.gems.keys
- end
-
- def test_self_load_specification
- spec_dir = File.join @gemhome, 'specifications'
-
- FileUtils.rm_r spec_dir
-
- FileUtils.mkdir_p spec_dir
-
- a1 = quick_gem 'a', '1' do |spec| spec.author = 'author 1' end
-
- spec_file = File.join spec_dir, "#{a1.full_name}.gemspec"
-
- File.open spec_file, 'w' do |fp|
- fp.write a1.to_ruby
- end
-
- spec = Gem::SourceIndex.load_specification spec_file
-
- assert_equal a1.author, spec.author
- end
-
- def test_self_load_specification_utf_8
- spec_dir = File.join @gemhome, 'specifications'
-
- FileUtils.rm_r spec_dir
-
- FileUtils.mkdir_p spec_dir
-
- spec_file = File.join spec_dir, "utf-8.gemspec"
- spec_data = <<-SPEC
-Gem::Specification.new do |s|
- s.name = %q{utf}
- s.version = "8"
-
- s.required_rubygems_version = Gem::Requirement.new(">= 0")
- s.authors = ["\317\200"]
- s.date = %q{2008-09-10}
- s.description = %q{This is a test description}
- s.email = %q{example@example.com}
- s.has_rdoc = true
- s.homepage = %q{http://example.com}
- s.require_paths = ["lib"]
- s.rubygems_version = %q{1.2.0}
- s.summary = %q{this is a summary}
-
- if s.respond_to? :specification_version then
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
- s.specification_version = 2
-
- if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
- else
- end
- else
- end
-end
- SPEC
-
- spec_data.force_encoding 'UTF-8'
-
- File.open spec_file, 'w' do |io| io.write spec_data end
-
- spec = Gem::SourceIndex.load_specification spec_file
-
- pi = "\317\200"
- pi.force_encoding 'UTF-8' if pi.respond_to? :force_encoding
-
- assert_equal pi, spec.author
- end if Gem.ruby_version > Gem::Version.new('1.9')
-
- def test_self_load_specification_exception
- spec_dir = File.join @gemhome, 'specifications'
-
- FileUtils.mkdir_p spec_dir
-
- spec_file = File.join spec_dir, 'a-1.gemspec'
-
- File.open spec_file, 'w' do |fp|
- fp.write 'raise Exception, "epic fail"'
- end
-
- use_ui @ui do
- assert_equal nil, Gem::SourceIndex.load_specification(spec_file)
- end
-
- assert_equal '', @ui.output
-
- expected = <<-EOF
-WARNING: #<Exception: epic fail>
-raise Exception, "epic fail"
-WARNING: Invalid .gemspec format in '#{spec_file}'
- EOF
-
- assert_equal expected, @ui.error
- end
-
- def test_self_load_specification_interrupt
- spec_dir = File.join @gemhome, 'specifications'
-
- FileUtils.mkdir_p spec_dir
-
- spec_file = File.join spec_dir, 'a-1.gemspec'
-
- File.open spec_file, 'w' do |fp|
- fp.write 'raise Interrupt, "^C"'
- end
-
- use_ui @ui do
- assert_raises Interrupt do
- Gem::SourceIndex.load_specification(spec_file)
- end
- end
-
- assert_equal '', @ui.output
- assert_equal '', @ui.error
- end
-
- def test_self_load_specification_syntax_error
- spec_dir = File.join @gemhome, 'specifications'
-
- FileUtils.mkdir_p spec_dir
-
- spec_file = File.join spec_dir, 'a-1.gemspec'
-
- File.open spec_file, 'w' do |fp|
- fp.write '1 +'
- end
-
- use_ui @ui do
- assert_equal nil, Gem::SourceIndex.load_specification(spec_file)
- end
-
- assert_equal '', @ui.output
-
- assert_match(/syntax error/, @ui.error)
- assert_match(/1 \+/, @ui.error)
- end
-
- def test_self_load_specification_system_exit
- spec_dir = File.join @gemhome, 'specifications'
-
- FileUtils.mkdir_p spec_dir
-
- spec_file = File.join spec_dir, 'a-1.gemspec'
-
- File.open spec_file, 'w' do |fp|
- fp.write 'raise SystemExit, "bye-bye"'
- end
-
- use_ui @ui do
- assert_raises SystemExit do
- Gem::SourceIndex.load_specification(spec_file)
- end
- end
-
- assert_equal '', @ui.output
- assert_equal '', @ui.error
- end
-
- def test_create_from_directory
- # TODO
- end
-
- def test_fetcher
- assert_equal @fetcher, @source_index.fetcher
- end
-
- def test_find_missing
- missing = @source_index.find_missing [@b2.full_name]
- assert_equal [@b2.full_name], missing
- end
-
- def test_find_missing_none_missing
- missing = @source_index.find_missing [
- @a1.full_name, @a2.full_name, @c1_2.full_name
- ]
-
- assert_equal [], missing
- end
-
- def test_find_name
- assert_equal [@a1, @a2, @a3a], @source_index.find_name('a')
- assert_equal [@a2], @source_index.find_name('a', '= 2')
- assert_equal [], @source_index.find_name('bogusstring')
- assert_equal [], @source_index.find_name('a', '= 3')
-
- source_index = Gem::SourceIndex.new
- source_index.add_spec @a1
- source_index.add_spec @a2
-
- assert_equal [@a1], source_index.find_name(@a1.name, '= 1')
-
- r1 = Gem::Requirement.create '= 1'
- assert_equal [@a1], source_index.find_name(@a1.name, r1)
- end
-
- def test_find_name_empty_cache
- empty_source_index = Gem::SourceIndex.new({})
- assert_equal [], empty_source_index.find_name("foo")
- end
-
- def test_latest_specs
- p1_ruby = quick_gem 'p', '1'
- p1_platform = quick_gem 'p', '1' do |spec|
- spec.platform = Gem::Platform::CURRENT
- end
-
- a1_platform = quick_gem @a1.name, (@a1.version) do |s|
- s.platform = Gem::Platform.new 'x86-my_platform1'
- end
-
- a2_platform = quick_gem @a2.name, (@a2.version) do |s|
- s.platform = Gem::Platform.new 'x86-my_platform1'
- end
-
- a2_platform_other = quick_gem @a2.name, (@a2.version) do |s|
- s.platform = Gem::Platform.new 'x86-other_platform1'
- end
-
- a3_platform_other = quick_gem @a2.name, (@a2.version.bump) do |s|
- s.platform = Gem::Platform.new 'x86-other_platform1'
- end
-
- @source_index.add_spec p1_ruby
- @source_index.add_spec p1_platform
- @source_index.add_spec a1_platform
- @source_index.add_spec a2_platform
- @source_index.add_spec a2_platform_other
- @source_index.add_spec a3_platform_other
-
- expected = [
- @a2.full_name,
- a2_platform.full_name,
- a3_platform_other.full_name,
- @c1_2.full_name,
- @a_evil9.full_name,
- p1_ruby.full_name,
- p1_platform.full_name,
- ].sort
-
- latest_specs = @source_index.latest_specs.map { |s| s.full_name }.sort
-
- assert_equal expected, latest_specs
- end
-
- def test_load_gems_in
- spec_dir1 = File.join @gemhome, 'specifications'
- spec_dir2 = File.join @tempdir, 'gemhome2', 'specifications'
-
- FileUtils.rm_r spec_dir1
-
- FileUtils.mkdir_p spec_dir1
- FileUtils.mkdir_p spec_dir2
-
- a1 = quick_gem 'a', '1' do |spec| spec.author = 'author 1' end
- a2 = quick_gem 'a', '1' do |spec| spec.author = 'author 2' end
-
- File.open File.join(spec_dir1, "#{a1.full_name}.gemspec"), 'w' do |fp|
- fp.write a1.to_ruby
- end
-
- File.open File.join(spec_dir2, "#{a2.full_name}.gemspec"), 'w' do |fp|
- fp.write a2.to_ruby
- end
-
- @source_index.load_gems_in spec_dir1, spec_dir2
-
- assert_equal a1.author, @source_index.specification(a1.full_name).author
- end
-
- def test_outdated
- util_setup_spec_fetcher
-
- assert_equal [], @source_index.outdated
-
- updated = quick_gem @a2.name, (@a2.version.bump)
- util_setup_spec_fetcher updated
-
- assert_equal [updated.name], @source_index.outdated
-
- updated_platform = quick_gem @a2.name, (updated.version.bump) do |s|
- s.platform = Gem::Platform.new 'x86-other_platform1'
- end
-
- util_setup_spec_fetcher updated, updated_platform
-
- assert_equal [updated_platform.name], @source_index.outdated
- end
-
- def test_prerelease_specs_kept_in_right_place
- gem_a1_alpha = quick_gem 'abba', '1.a'
- @source_index.add_spec gem_a1_alpha
-
- refute @source_index.latest_specs.include?(gem_a1_alpha)
- assert_nil @source_index.specification(gem_a1_alpha.full_name)
- assert @source_index.prerelease_specs.include?(gem_a1_alpha)
-
- # TODO: don't think this tests writing prerelease index to disk
- end
-
- def test_refresh_bang
- a1_spec = File.join @gemhome, "specifications", "#{@a1.full_name}.gemspec"
-
- FileUtils.mv a1_spec, @tempdir
-
- source_index = Gem::SourceIndex.from_installed_gems
-
- refute source_index.gems.include?(@a1.full_name)
-
- FileUtils.mv File.join(@tempdir, "#{@a1.full_name}.gemspec"), a1_spec
-
- source_index.refresh!
-
- assert source_index.gems.include?(@a1.full_name)
- end
-
- def test_refresh_bang_not_from_dir
- source_index = Gem::SourceIndex.new
-
- e = assert_raises RuntimeError do
- source_index.refresh!
- end
-
- assert_equal 'source index not created from disk', e.message
- end
-
- def test_remove_extra
- @source_index.add_spec @a1
- @source_index.add_spec @a2
- @source_index.add_spec @pl1
-
- @source_index.remove_extra [@a1.full_name, @pl1.full_name]
-
- assert_equal [@a1.full_name],
- @source_index.gems.map { |n,s| n }.sort
- end
-
- def test_remove_extra_no_changes
- gems = [@a1.full_name, @a2.full_name]
- @source_index.add_spec @a1
- @source_index.add_spec @a2
-
- @source_index.remove_extra gems
-
- assert_equal gems, @source_index.gems.map { |n,s| n }.sort
- end
-
- def test_remove_spec
- deleted = @source_index.remove_spec 'a-1'
-
- assert_equal %w[a-2 a-3.a a_evil-9 c-1.2],
- @source_index.all_gems.values.map { |s| s.full_name }.sort
-
- deleted = @source_index.remove_spec 'a-3.a'
-
- assert_equal %w[a-2 a_evil-9 c-1.2],
- @source_index.all_gems.values.map { |s| s.full_name }.sort
- end
-
- def test_search
- requirement = Gem::Requirement.create '= 9'
- with_version = Gem::Dependency.new(/^a/, requirement)
- assert_equal [@a_evil9], @source_index.search(with_version)
-
- with_default = Gem::Dependency.new(/^a/, Gem::Requirement.default)
- assert_equal [@a1, @a2, @a3a, @a_evil9], @source_index.search(with_default)
-
- c1_1_dep = Gem::Dependency.new 'c', '~> 1.1'
- assert_equal [@c1_2], @source_index.search(c1_1_dep)
- end
-
- def test_search_platform
- util_set_arch 'x86-my_platform1'
-
- a1 = quick_gem 'a', '1'
- a1_mine = quick_gem 'a', '1' do |s|
- s.platform = Gem::Platform.new 'x86-my_platform1'
- end
- a1_other = quick_gem 'a', '1' do |s|
- s.platform = Gem::Platform.new 'x86-other_platform1'
- end
-
- si = Gem::SourceIndex.new(a1.full_name => a1, a1_mine.full_name => a1_mine,
- a1_other.full_name => a1_other)
-
- dep = Gem::Dependency.new 'a', Gem::Requirement.new('1')
-
- gems = si.search dep, true
-
- assert_equal [a1, a1_mine], gems.sort
- end
-
- def test_signature
- sig = @source_index.gem_signature('foo-1.2.3')
- assert_equal 64, sig.length
- assert_match(/^[a-f0-9]{64}$/, sig)
- end
-
- def test_specification
- assert_equal @a1, @source_index.specification(@a1.full_name)
-
- assert_nil @source_index.specification("foo-1.2.4")
- end
-
- def test_index_signature
- sig = @source_index.index_signature
- assert_match(/^[a-f0-9]{64}$/, sig)
- end
-
- def test_unzip
- input = "x\234+\316\317MU(I\255(\001\000\021\350\003\232"
- assert_equal 'some text', @source_index.unzip(input)
- end
-
- def util_setup_bulk_fetch(compressed)
- source_index = @source_index.dump
-
- if compressed then
- @fetcher.data["#{@gem_repo}Marshal.#{@marshal_version}.Z"] = util_zip source_index
- else
- @fetcher.data["#{@gem_repo}Marshal.#{@marshal_version}"] = source_index
- end
- end
-
-end
-
diff --git a/test/rubygems/test_gem_source_info_cache.rb b/test/rubygems/test_gem_source_info_cache.rb
deleted file mode 100644
index 237c1efea8..0000000000
--- a/test/rubygems/test_gem_source_info_cache.rb
+++ /dev/null
@@ -1,447 +0,0 @@
-#--
-# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
-# All rights reserved.
-# See LICENSE.txt for permissions.
-#++
-
-require File.join(File.expand_path(File.dirname(__FILE__)), 'gemutilities')
-require 'rubygems/source_info_cache'
-
-class Gem::SourceIndex
- public :gems
-end
-
-class TestGemSourceInfoCache < RubyGemTestCase
-
- def setup
- @original_sources = Gem.sources
-
- super
-
- util_setup_fake_fetcher
-
- @sic = Gem::SourceInfoCache.new
- @sic.instance_variable_set :@fetcher, @fetcher
-
- @si_new = Gem::SourceIndex.new
- @sice_new = Gem::SourceInfoCacheEntry.new @si_new, 0
-
- prep_cache_files @sic
-
- @sic.reset_cache_data
- end
-
- def teardown
- super
- Gem.sources.replace @original_sources
- Gem::SourceInfoCache.instance_variable_set :@cache, nil
- end
-
- def test_self_cache_refreshes
- Gem.configuration.update_sources = true #true by default
- si = Gem::SourceIndex.new
- si.add_spec @a1
-
- @fetcher.data["#{@gem_repo}Marshal.#{@marshal_version}"] = si.dump
-
- Gem.sources.replace %W[#{@gem_repo}]
-
- use_ui @ui do
- refute_nil Gem::SourceInfoCache.cache
- assert_kind_of Gem::SourceInfoCache, Gem::SourceInfoCache.cache
- assert_equal Gem::SourceInfoCache.cache.object_id,
- Gem::SourceInfoCache.cache.object_id
- end
-
- assert_match %r|Bulk updating|, @ui.output
- end
-
- def test_self_cache_skips_refresh_based_on_configuration
- Gem.configuration.update_sources = false
- si = Gem::SourceIndex.new
- si.add_spec @a1
-
- @fetcher.data["#{@gem_repo}Marshal.#{@marshal_version}"] = si.dump
-
- Gem.sources.replace %w[#{@gem_repo}]
-
- use_ui @ui do
- refute_nil Gem::SourceInfoCache.cache
- assert_kind_of Gem::SourceInfoCache, Gem::SourceInfoCache.cache
- assert_equal Gem::SourceInfoCache.cache.object_id,
- Gem::SourceInfoCache.cache.object_id
- refute_match %r|Bulk updating|, @ui.output
- end
- end
-
- def test_self_cache_data
- si = Gem::SourceIndex.new
- si.add_spec @a1
-
- @fetcher.data["#{@gem_repo}Marshal.#{@marshal_version}"] = si.dump
-
- Gem::SourceInfoCache.instance_variable_set :@cache, nil
- sice = Gem::SourceInfoCacheEntry.new si, 0
-
- use_ui @ui do
- gems = Gem::SourceInfoCache.cache_data[@gem_repo].source_index.gems
- gem_names = gems.map { |_, spec| spec.full_name }
-
- assert_equal si.gems.map { |_,spec| spec.full_name }, gem_names
- end
- end
-
- def test_cache_data
- assert_equal [[@gem_repo, @usr_sice]], @sic.cache_data.to_a.sort
- end
-
- def test_cache_data_dirty
- def @sic.dirty() @dirty; end
- assert_equal false, @sic.dirty, 'clean on init'
- @sic.cache_data
- assert_equal false, @sic.dirty, 'clean on fetch'
- @sic.update
- @sic.cache_data
- assert_equal true, @sic.dirty, 'still dirty'
- end
-
- def test_cache_data_irreparable
- @fetcher.data["#{@gem_repo}Marshal.#{@marshal_version}"] = @source_index.dump
-
- data = { @gem_repo => { 'totally' => 'borked' } }
-
- cache_files = [
- @sic.system_cache_file,
- @sic.latest_system_cache_file,
- @sic.user_cache_file,
- @sic.latest_user_cache_file
- ]
-
- cache_files.each do |fn|
- FileUtils.mkdir_p File.dirname(fn)
- open(fn, "wb") { |f| f.write Marshal.dump(data) }
- end
-
- @sic.instance_eval { @cache_data = nil }
-
- fetched = use_ui @ui do @sic.cache_data end
-
- fetched_si = fetched["#{@gem_repo}"].source_index
-
- assert_equal @source_index.index_signature, fetched_si.index_signature
- end
-
- def test_cache_data_none_readable
- FileUtils.chmod 0222, @sic.system_cache_file
- FileUtils.chmod 0222, @sic.latest_system_cache_file
- FileUtils.chmod 0222, @sic.user_cache_file
- FileUtils.chmod 0222, @sic.latest_user_cache_file
- return if (File.stat(@sic.system_cache_file).mode & 0222) != 0222
- return if (File.stat(@sic.user_cache_file).mode & 0222) != 0222
- # HACK for systems that don't support chmod
- assert_equal({}, @sic.cache_data)
- end
-
- def test_cache_data_none_writable
- FileUtils.chmod 0444, @sic.system_cache_file
- FileUtils.chmod 0444, @sic.user_cache_file
- e = assert_raises RuntimeError do
- @sic.cache_data
- end
- assert_equal 'unable to locate a writable cache file', e.message
- end
-
- def test_cache_data_nonexistent
- FileUtils.rm @sic.system_cache_file
- FileUtils.rm @sic.latest_system_cache_file
- FileUtils.rm @sic.user_cache_file
- FileUtils.rm @sic.latest_user_cache_file
-
- # TODO test verbose output
- assert_equal [], @sic.cache_data.to_a.sort
- end
-
- def test_cache_data_repair
- data = {
- @gem_repo => {
- 'cache' => Gem::SourceIndex.new,
- 'size' => 0,
- }
- }
- [@sic.system_cache_file, @sic.user_cache_file].each do |fn|
- FileUtils.mkdir_p File.dirname(fn)
- open(fn, "wb") { |f| f.write Marshal.dump(data) }
- end
-
- @sic.instance_eval { @cache_data = nil }
-
- expected = {
- @gem_repo =>
- Gem::SourceInfoCacheEntry.new(Gem::SourceIndex.new, 0)
- }
- assert_equal expected, @sic.cache_data
- end
-
- def test_cache_data_user_fallback
- FileUtils.chmod 0444, @sic.system_cache_file
-
- assert_equal [[@gem_repo, @usr_sice]], @sic.cache_data.to_a.sort
- end
-
- def test_cache_file
- assert_equal @gemcache, @sic.cache_file
- end
-
- def test_cache_file_user_fallback
- FileUtils.chmod 0444, @sic.system_cache_file
- assert_equal @usrcache, @sic.cache_file
- end
-
- def test_cache_file_none_writable
- FileUtils.chmod 0444, @sic.system_cache_file
- FileUtils.chmod 0444, @sic.user_cache_file
- e = assert_raises RuntimeError do
- @sic.cache_file
- end
- assert_equal 'unable to locate a writable cache file', e.message
- end
-
- def test_flush
- @sic.cache_data[@gem_repo] = @sice_new
- @sic.update
- @sic.flush
-
- assert_equal [[@gem_repo, @sice_new]],
- read_cache(@sic.system_cache_file).to_a.sort
- end
-
- def test_latest_cache_data
- util_make_gems
-
- sice = Gem::SourceInfoCacheEntry.new @source_index, 0
-
- @sic.set_cache_data @gem_repo => sice
- latest = @sic.latest_cache_data
- beginning_with_a = Gem::Dependency.new(/^a/, Gem::Requirement.default)
- gems = latest[@gem_repo].source_index.search(beginning_with_a).map { |s| s.full_name }
-
- assert_equal %w[a-2 a_evil-9], gems
- end
-
- def test_latest_cache_file
- latest_cache_file = File.join File.dirname(@gemcache),
- "latest_#{File.basename @gemcache}"
- assert_equal latest_cache_file, @sic.latest_cache_file
- end
-
- def test_latest_system_cache_file
- assert_equal File.join(Gem.dir, "latest_source_cache"),
- @sic.latest_system_cache_file
- end
-
- def test_latest_user_cache_file
- assert_equal @latest_usrcache, @sic.latest_user_cache_file
- end
-
- def test_read_system_cache
- assert_equal [[@gem_repo, @sys_sice]], @sic.cache_data.to_a.sort
- end
-
- def test_read_user_cache
- FileUtils.chmod 0444, @sic.user_cache_file
- FileUtils.chmod 0444, @sic.latest_user_cache_file
-
- @si = Gem::SourceIndex.new
- @si.add_specs @a1, @a2
-
- @sice = Gem::SourceInfoCacheEntry.new @si, 0
-
- @sic.set_cache_data({ @gem_repo => @sice })
- @sic.update
- @sic.write_cache
- @sic.reset_cache_data
-
- user_cache_data = @sic.cache_data.to_a.sort
-
- assert_equal 1, user_cache_data.length
- user_cache_data = user_cache_data.first
-
- assert_equal @gem_repo, user_cache_data.first
-
- gems = user_cache_data.last.source_index.map { |_,spec| spec.full_name }
- assert_equal [@a2.full_name], gems
- end
-
- def test_search
- si = Gem::SourceIndex.new
- si.add_spec @a1
- cache_data = { @gem_repo => Gem::SourceInfoCacheEntry.new(si, nil) }
- @sic.instance_variable_set :@cache_data, cache_data
-
- assert_equal [@a1], @sic.search(//)
- end
-
- def test_search_all
- util_make_gems
-
- sice = Gem::SourceInfoCacheEntry.new @source_index, 0
-
- @sic.set_cache_data @gem_repo => sice
- @sic.update
- @sic.instance_variable_set :@only_latest, false
- @sic.write_cache
- @sic.reset_cache_data
-
- gem_names = @sic.search(//, false, true).map { |spec| spec.full_name }
-
- assert_equal %w[a-1 a-2 a-3.a a_evil-9 c-1.2], gem_names
- end
-
- def test_search_dependency
- si = Gem::SourceIndex.new
- si.add_spec @a1
- cache_data = { @gem_repo => Gem::SourceInfoCacheEntry.new(si, nil) }
- @sic.instance_variable_set :@cache_data, cache_data
-
- dep = Gem::Dependency.new @a1.name, @a1.version
-
- assert_equal [@a1], @sic.search(dep)
- end
-
- def test_search_no_matches
- si = Gem::SourceIndex.new
- si.add_spec @a1
- cache_data = { @gem_repo => Gem::SourceInfoCacheEntry.new(si, nil) }
- @sic.instance_variable_set :@cache_data, cache_data
-
- assert_equal [], @sic.search(/nonexistent/)
- end
-
- def test_search_no_matches_in_source
- si = Gem::SourceIndex.new
- si.add_spec @a1
- cache_data = { @gem_repo => Gem::SourceInfoCacheEntry.new(si, nil) }
- @sic.instance_variable_set :@cache_data, cache_data
- Gem.sources.replace %w[more-gems.example.com]
-
- assert_equal [], @sic.search(/nonexistent/)
- end
-
- def test_search_with_source
- si = Gem::SourceIndex.new
- si.add_spec @a1
- cache_data = { @gem_repo => Gem::SourceInfoCacheEntry.new(si, nil) }
- @sic.instance_variable_set :@cache_data, cache_data
-
- assert_equal [[@a1, @gem_repo]],
- @sic.search_with_source(//)
- end
-
- def test_system_cache_file
- assert_equal File.join(Gem.dir, "source_cache"), @sic.system_cache_file
- end
-
- def test_user_cache_file
- assert_equal @usrcache, @sic.user_cache_file
- end
-
- def test_write_cache
- @sic.cache_data[@gem_repo] = @sice_new
- @sic.write_cache
-
- assert_equal [[@gem_repo, @sice_new]],
- read_cache(@sic.system_cache_file).to_a.sort
- assert_equal [[@gem_repo, @usr_sice]],
- read_cache(@sic.user_cache_file).to_a.sort
- end
-
- def test_write_cache_user
- FileUtils.chmod 0444, @sic.system_cache_file
- @sic.set_cache_data({@gem_repo => @sice_new})
- @sic.update
- @sic.write_cache
- @sic.instance_variable_set :@only_latest, false
-
- assert File.exist?(@sic.user_cache_file), 'user_cache_file'
- assert File.exist?(@sic.latest_user_cache_file),
- 'latest_user_cache_file exists'
-
- assert_equal [[@gem_repo, @sys_sice]],
- read_cache(@sic.system_cache_file).to_a.sort
- assert_equal [[@gem_repo, @sice_new]],
- read_cache(@sic.user_cache_file).to_a.sort
- end
-
- def test_write_cache_user_from_scratch
- FileUtils.rm_rf @sic.user_cache_file
- FileUtils.rm_rf @sic.latest_user_cache_file
-
- FileUtils.chmod 0444, @sic.system_cache_file
- FileUtils.chmod 0444, @sic.latest_system_cache_file
-
- @si = Gem::SourceIndex.new
- @si.add_specs @a1, @a2
-
- @sice = Gem::SourceInfoCacheEntry.new @si, 0
-
- @sic.set_cache_data({ @gem_repo => @sice })
- @sic.update
-
- @sic.write_cache
-
- assert File.exist?(@sic.user_cache_file), 'system_cache_file'
- assert File.exist?(@sic.latest_user_cache_file),
- 'latest_system_cache_file'
-
- user_cache_data = read_cache(@sic.user_cache_file).to_a.sort
- assert_equal 1, user_cache_data.length, 'user_cache_data length'
- user_cache_data = user_cache_data.first
-
- assert_equal @gem_repo, user_cache_data.first
-
- gems = user_cache_data.last.source_index.map { |_,spec| spec.full_name }
- assert_equal [@a1.full_name, @a2.full_name], gems.sort
-
- user_cache_data = read_cache(@sic.latest_user_cache_file).to_a.sort
- assert_equal 1, user_cache_data.length
- user_cache_data = user_cache_data.first
-
- assert_equal @gem_repo, user_cache_data.first
-
- gems = user_cache_data.last.source_index.map { |_,spec| spec.full_name }
- assert_equal [@a2.full_name], gems
- end
-
- def test_write_cache_user_no_directory
- FileUtils.rm_rf File.dirname(@sic.user_cache_file)
- FileUtils.chmod 0444, @sic.system_cache_file
- @sic.set_cache_data({ @gem_repo => @sice_new })
- @sic.update
- @sic.write_cache
-
- assert_equal [[@gem_repo, @sys_sice]],
- read_cache(@sic.system_cache_file).to_a.sort
- assert_equal [[@gem_repo, @sys_sice]],
- read_cache(@sic.user_cache_file).to_a.sort
- assert_equal [[@gem_repo, @sice_new]],
- read_cache(@sic.latest_user_cache_file).to_a.sort
- end
-
- def test_write_cache_user_only_latest
- FileUtils.chmod 0444, @sic.system_cache_file
- @sic.set_cache_data({@gem_repo => @sice_new})
- @sic.update
- @sic.write_cache
-
- assert File.exist?(@sic.user_cache_file), 'user_cache_file'
- assert File.exist?(@sic.latest_user_cache_file),
- 'latest_user_cache_file exists'
-
- assert_equal [[@gem_repo, @sys_sice]],
- read_cache(@sic.system_cache_file).to_a.sort
- assert_equal [[@gem_repo, @sice_new]],
- read_cache(@sic.user_cache_file).to_a.sort
- end
-
-end
-
diff --git a/test/rubygems/test_gem_source_info_cache_entry.rb b/test/rubygems/test_gem_source_info_cache_entry.rb
deleted file mode 100644
index e1d61b8f6f..0000000000
--- a/test/rubygems/test_gem_source_info_cache_entry.rb
+++ /dev/null
@@ -1,78 +0,0 @@
-require File.join(File.expand_path(File.dirname(__FILE__)), 'gemutilities')
-require 'rubygems/source_info_cache_entry'
-
-class TestGemSourceInfoCacheEntry < RubyGemTestCase
-
- def setup
- super
-
- util_setup_fake_fetcher
-
- @si = Gem::SourceIndex.new
- @si.add_spec @a1
- @sic_e = Gem::SourceInfoCacheEntry.new @si, @si.dump.size
- end
-
- def test_refresh
- @fetcher.data["#{@gem_repo}Marshal.#{@marshal_version}.Z"] =
- proc { raise }
- @fetcher.data["#{@gem_repo}Marshal.#{@marshal_version}"] = @si.dump
-
- use_ui @ui do
- @sic_e.refresh @gem_repo, true
- end
- end
-
- def test_refresh_all
- @si.add_spec @a2
-
- a1_name = @a1.full_name
- a2_name = @a2.full_name
-
- @fetcher.data["#{@gem_repo}quick/index.rz"] =
- util_zip [a1_name, a2_name].join("\n")
- @fetcher.data["#{@gem_repo}quick/latest_index.rz"] = util_zip a2_name
- @fetcher.data["#{@gem_repo}quick/Marshal.#{Gem.marshal_version}/#{a1_name}.gemspec.rz"] = util_zip Marshal.dump(@a1)
- @fetcher.data["#{@gem_repo}quick/Marshal.#{Gem.marshal_version}/#{a2_name}.gemspec.rz"] = util_zip Marshal.dump(@a2)
- @fetcher.data["#{@gem_repo}Marshal.#{Gem.marshal_version}"] =
- Marshal.dump @si
-
- sic_e = Gem::SourceInfoCacheEntry.new Gem::SourceIndex.new, 0
-
- assert_equal [], sic_e.source_index.map { |n,| n }
-
- use_ui @ui do
- assert sic_e.refresh(@gem_repo, false)
- end
-
- assert_equal [a2_name], sic_e.source_index.map { |n,| n }.sort
-
- use_ui @ui do
- sic_e.refresh @gem_repo, true
- end
-
- assert_equal [a1_name, a2_name], sic_e.source_index.map { |n,| n }.sort
- end
-
- def test_refresh_bad_uri
- assert_raises URI::BadURIError do
- @sic_e.refresh 'gems.example.com', true
- end
- end
-
- def test_refresh_update
- si = Gem::SourceIndex.new
- si.add_spec @a1
- si.add_spec @b2
- @fetcher.data["#{@gem_repo}Marshal.#{@marshal_version}"] = si.dump
-
- use_ui @ui do
- @sic_e.refresh @gem_repo, true
- end
-
- new_gem = @sic_e.source_index.specification(@b2.full_name)
- assert_equal @b2.full_name, new_gem.full_name
- end
-
-end
-
diff --git a/test/rubygems/test_gem_spec_fetcher.rb b/test/rubygems/test_gem_spec_fetcher.rb
deleted file mode 100644
index 972289f233..0000000000
--- a/test/rubygems/test_gem_spec_fetcher.rb
+++ /dev/null
@@ -1,384 +0,0 @@
-require File.join(File.expand_path(File.dirname(__FILE__)), 'gemutilities')
-require 'rubygems/spec_fetcher'
-
-class TestGemSpecFetcher < RubyGemTestCase
-
- def setup
- super
-
- @uri = URI.parse @gem_repo
-
- util_setup_fake_fetcher
-
- @a_pre = quick_gem 'a', '1.a'
- @source_index.add_spec @pl1
- @source_index.add_spec @a_pre
-
- @specs = @source_index.gems.sort.map do |name, spec|
- [spec.name, spec.version, spec.original_platform]
- end.sort
-
- @latest_specs = @source_index.latest_specs.sort.map do |spec|
- [spec.name, spec.version, spec.original_platform]
- end
-
- @prerelease_specs = @source_index.prerelease_gems.sort.map do |name, spec|
- [spec.name, spec.version, spec.original_platform]
- end.sort
-
- @fetcher.data["#{@gem_repo}specs.#{Gem.marshal_version}.gz"] =
- util_gzip(Marshal.dump(@specs))
-
- @fetcher.data["#{@gem_repo}latest_specs.#{Gem.marshal_version}.gz"] =
- util_gzip(Marshal.dump(@latest_specs))
-
- @fetcher.data["#{@gem_repo}prerelease_specs.#{Gem.marshal_version}.gz"] =
- util_gzip(Marshal.dump(@prerelease_specs))
-
- @sf = Gem::SpecFetcher.new
- end
-
- def test_fetch_all
- @fetcher.data["#{@gem_repo}#{Gem::MARSHAL_SPEC_DIR}#{@a1.full_name}.gemspec.rz"] =
- util_zip(Marshal.dump(@a1))
- @fetcher.data["#{@gem_repo}#{Gem::MARSHAL_SPEC_DIR}#{@a2.full_name}.gemspec.rz"] =
- util_zip(Marshal.dump(@a2))
- @fetcher.data["#{@gem_repo}#{Gem::MARSHAL_SPEC_DIR}#{@a_pre.full_name}.gemspec.rz"] =
- util_zip(Marshal.dump(@a_pre))
-
- dep = Gem::Dependency.new 'a', 1
- specs_and_sources = @sf.fetch dep, true
-
- spec_names = specs_and_sources.map do |spec, source_uri|
- [spec.full_name, source_uri]
- end
-
- expected = [[@a1.full_name, @gem_repo], [@a2.full_name, @gem_repo]]
-
- assert_equal expected, spec_names
-
- assert_same specs_and_sources.first.last, specs_and_sources.last.last
- end
-
- def test_fetch_latest
- @fetcher.data["#{@gem_repo}#{Gem::MARSHAL_SPEC_DIR}#{@a1.full_name}.gemspec.rz"] =
- util_zip(Marshal.dump(@a1))
- @fetcher.data["#{@gem_repo}#{Gem::MARSHAL_SPEC_DIR}#{@a2.full_name}.gemspec.rz"] =
- util_zip(Marshal.dump(@a2))
- @fetcher.data["#{@gem_repo}#{Gem::MARSHAL_SPEC_DIR}#{@a_pre.full_name}.gemspec.rz"] =
- util_zip(Marshal.dump(@a_pre))
-
- dep = Gem::Dependency.new 'a', 1
- specs_and_sources = @sf.fetch dep
-
- spec_names = specs_and_sources.map do |spec, source_uri|
- [spec.full_name, source_uri]
- end
-
- assert_equal [[@a2.full_name, @gem_repo]], spec_names
- end
-
- def test_fetch_prerelease
- @fetcher.data["#{@gem_repo}#{Gem::MARSHAL_SPEC_DIR}#{@a1.full_name}.gemspec.rz"] =
- util_zip(Marshal.dump(@a1))
- @fetcher.data["#{@gem_repo}#{Gem::MARSHAL_SPEC_DIR}#{@a2.full_name}.gemspec.rz"] =
- util_zip(Marshal.dump(@a2))
- @fetcher.data["#{@gem_repo}#{Gem::MARSHAL_SPEC_DIR}#{@a_pre.full_name}.gemspec.rz"] =
- util_zip(Marshal.dump(@a_pre))
-
- dep = Gem::Dependency.new 'a', '1.a'
- specs_and_sources = @sf.fetch dep, false, true, true
-
- spec_names = specs_and_sources.map do |spec, source_uri|
- [spec.full_name, source_uri]
- end
-
- assert_equal [[@a_pre.full_name, @gem_repo]], spec_names
- end
-
- def test_fetch_legacy_repo
- @fetcher.data.delete "#{@gem_repo}specs.#{Gem.marshal_version}.gz"
- @fetcher.data["#{@gem_repo}yaml"] = ''
- util_setup_source_info_cache @a1, @a2
-
- dep = Gem::Dependency.new 'a', 1
- specs = nil
-
- use_ui @ui do
- specs = @sf.fetch dep, true
- end
-
- expected = <<-EOF
-WARNING: RubyGems 1.2+ index not found for:
-\thttp://gems.example.com/
-
-RubyGems will revert to legacy indexes degrading performance.
- EOF
-
- assert_equal expected, @ui.error
-
- specs = specs.map { |spec, source_uri| [spec.full_name, source_uri] }
-
- expected = [
- [@a1.full_name, @gem_repo],
- [@a2.full_name, @gem_repo],
- ]
-
- assert_equal expected, specs
- end
-
- def test_fetch_platform
- util_set_arch 'i386-linux'
-
- @fetcher.data["#{@gem_repo}#{Gem::MARSHAL_SPEC_DIR}#{@pl1.original_name}.gemspec.rz"] =
- util_zip(Marshal.dump(@pl1))
-
- dep = Gem::Dependency.new 'pl', 1
- specs_and_sources = @sf.fetch dep
-
- spec_names = specs_and_sources.map do |spec, source_uri|
- [spec.full_name, source_uri]
- end
-
- assert_equal [[@pl1.full_name, @gem_repo]], spec_names
- end
-
- def test_fetch_spec
- spec_uri = "#{@gem_repo}#{Gem::MARSHAL_SPEC_DIR}#{@a1.full_name}.gemspec"
- @fetcher.data["#{spec_uri}.rz"] = util_zip(Marshal.dump(@a1))
-
- spec = @sf.fetch_spec ['a', Gem::Version.new(1), 'ruby'], @uri
- assert_equal @a1.full_name, spec.full_name
-
- cache_dir = @sf.cache_dir URI.parse(spec_uri)
-
- cache_file = File.join cache_dir, "#{@a1.full_name}.gemspec"
-
- assert File.exist?(cache_file)
- end
-
- def test_fetch_spec_cached
- spec_uri = "#{@gem_repo}/#{Gem::MARSHAL_SPEC_DIR}#{@a1.full_name}.gemspec"
- @fetcher.data["#{spec_uri}.rz"] = nil
-
- cache_dir = @sf.cache_dir URI.parse(spec_uri)
- FileUtils.mkdir_p cache_dir
-
- cache_file = File.join cache_dir, "#{@a1.full_name}.gemspec"
-
- open cache_file, 'wb' do |io|
- Marshal.dump @a1, io
- end
-
- spec = @sf.fetch_spec ['a', Gem::Version.new(1), 'ruby'], @uri
- assert_equal @a1.full_name, spec.full_name
- end
-
- def test_fetch_spec_platform
- @fetcher.data["#{@gem_repo}#{Gem::MARSHAL_SPEC_DIR}#{@pl1.original_name}.gemspec.rz"] =
- util_zip(Marshal.dump(@pl1))
-
- spec = @sf.fetch_spec ['pl', Gem::Version.new(1), 'i386-linux'], @uri
-
- assert_equal @pl1.full_name, spec.full_name
- end
-
- def test_fetch_spec_platform_ruby
- @fetcher.data["#{@gem_repo}#{Gem::MARSHAL_SPEC_DIR}#{@a1.full_name}.gemspec.rz"] =
- util_zip(Marshal.dump(@a1))
-
- spec = @sf.fetch_spec ['a', Gem::Version.new(1), nil], @uri
- assert_equal @a1.full_name, spec.full_name
-
- spec = @sf.fetch_spec ['a', Gem::Version.new(1), ''], @uri
- assert_equal @a1.full_name, spec.full_name
- end
-
- def test_find_matching_all
- dep = Gem::Dependency.new 'a', 1
- specs = @sf.find_matching dep, true
-
- expected = [
- [['a', Gem::Version.new(1), Gem::Platform::RUBY], @gem_repo],
- [['a', Gem::Version.new(2), Gem::Platform::RUBY], @gem_repo],
- ]
-
- assert_equal expected, specs
- end
-
- def test_find_matching_latest
- dep = Gem::Dependency.new 'a', 1
- specs = @sf.find_matching dep
-
- expected = [
- [['a', Gem::Version.new(2), Gem::Platform::RUBY], @gem_repo],
- ]
-
- assert_equal expected, specs
- end
-
- def test_find_matching_prerelease
- dep = Gem::Dependency.new 'a', '1.a'
- specs = @sf.find_matching dep, false, true, true
-
- expected = [
- [['a', Gem::Version.new('1.a'), Gem::Platform::RUBY], @gem_repo],
- ]
-
- assert_equal expected, specs
- end
-
- def test_find_matching_platform
- util_set_arch 'i386-linux'
-
- dep = Gem::Dependency.new 'pl', 1
- specs = @sf.find_matching dep
-
- expected = [
- [['pl', Gem::Version.new(1), 'i386-linux'], @gem_repo],
- ]
-
- assert_equal expected, specs
-
- util_set_arch 'i386-freebsd6'
-
- dep = Gem::Dependency.new 'pl', 1
- specs = @sf.find_matching dep
-
- assert_equal [], specs
- end
-
- def test_find_all_platforms
- util_set_arch 'i386-freebsd6'
-
- dep = Gem::Dependency.new 'pl', 1
- specs = @sf.find_matching dep, false, false
-
- expected = [
- [['pl', Gem::Version.new(1), 'i386-linux'], @gem_repo],
- ]
-
- assert_equal expected, specs
- end
-
- def test_list
- specs = @sf.list
-
- assert_equal [@uri], specs.keys
- assert_equal @latest_specs, specs[@uri].sort
- end
-
- def test_list_all
- specs = @sf.list true
-
- assert_equal [@uri], specs.keys
-
- assert_equal @specs, specs[@uri].sort
- end
-
- def test_list_cache
- specs = @sf.list
-
- refute specs[@uri].empty?
-
- @fetcher.data["#{@gem_repo}/latest_specs.#{Gem.marshal_version}.gz"] = nil
-
- cached_specs = @sf.list
-
- assert_equal specs, cached_specs
- end
-
- def test_list_cache_all
- specs = @sf.list true
-
- refute specs[@uri].empty?
-
- @fetcher.data["#{@gem_repo}/specs.#{Gem.marshal_version}.gz"] = nil
-
- cached_specs = @sf.list true
-
- assert_equal specs, cached_specs
- end
-
- def test_list_latest_all
- specs = @sf.list false
-
- assert_equal [@latest_specs], specs.values
-
- specs = @sf.list true
-
- assert_equal [@specs], specs.values, 'specs file not loaded'
- end
-
- def test_list_prerelease
- specs = @sf.list false, true
-
- assert_equal @prerelease_specs, specs[@uri].sort
- end
-
- def test_load_specs
- specs = @sf.load_specs @uri, 'specs'
-
- expected = [
- ['a', Gem::Version.new(1), Gem::Platform::RUBY],
- ['a', Gem::Version.new(2), Gem::Platform::RUBY],
- ['a_evil', Gem::Version.new(9), Gem::Platform::RUBY],
- ['c', Gem::Version.new('1.2'), Gem::Platform::RUBY],
- ['pl', Gem::Version.new(1), 'i386-linux'],
- ]
-
- assert_equal expected, specs
-
- cache_dir = File.join Gem.user_home, '.gem', 'specs', 'gems.example.com%80'
- assert File.exist?(cache_dir), "#{cache_dir} does not exist"
-
- cache_file = File.join cache_dir, "specs.#{Gem.marshal_version}"
- assert File.exist?(cache_file)
- end
-
- def test_load_specs_cached
- @fetcher.data["#{@gem_repo}latest_specs.#{Gem.marshal_version}.gz"] = nil
- @fetcher.data["#{@gem_repo}latest_specs.#{Gem.marshal_version}"] =
- ' ' * Marshal.dump(@latest_specs).length
-
- cache_dir = File.join Gem.user_home, '.gem', 'specs', 'gems.example.com%80'
-
- FileUtils.mkdir_p cache_dir
-
- cache_file = File.join cache_dir, "latest_specs.#{Gem.marshal_version}"
-
- open cache_file, 'wb' do |io|
- Marshal.dump @latest_specs, io
- end
-
- latest_specs = @sf.load_specs @uri, 'latest_specs'
-
- assert_equal @latest_specs, latest_specs
- end
-
- def test_load_specs_cached_empty
- @fetcher.data["#{@gem_repo}latest_specs.#{Gem.marshal_version}.gz"] =
- proc do
- @fetcher.data["#{@gem_repo}latest_specs.#{Gem.marshal_version}.gz"] =
- util_gzip(Marshal.dump(@latest_specs))
-
- nil
- end
-
- cache_dir = File.join Gem.user_home, '.gem', 'specs', 'gems.example.com%80'
-
- FileUtils.mkdir_p cache_dir
-
- cache_file = File.join cache_dir, "latest_specs.#{Gem.marshal_version}"
-
- open cache_file, 'wb' do |io|
- io.write Marshal.dump(@latest_specs)[0, 10]
- end
-
- latest_specs = @sf.load_specs @uri, 'latest_specs'
-
- assert_equal @latest_specs, latest_specs
- end
-
-end
-
diff --git a/test/rubygems/test_gem_specification.rb b/test/rubygems/test_gem_specification.rb
deleted file mode 100644
index e18b0f73ef..0000000000
--- a/test/rubygems/test_gem_specification.rb
+++ /dev/null
@@ -1,1257 +0,0 @@
-#--
-# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
-# All rights reserved.
-# See LICENSE.txt for permissions.
-#++
-
-require 'stringio'
-require File.join(File.expand_path(File.dirname(__FILE__)), 'gemutilities')
-require 'rubygems/specification'
-
-class TestGemSpecification < RubyGemTestCase
-
- LEGACY_YAML_SPEC = <<-EOF
---- !ruby/object:Gem::Specification
-rubygems_version: "1.0"
-name: keyedlist
-version: !ruby/object:Gem::Version
- version: 0.4.0
-date: 2004-03-28 15:37:49.828000 +02:00
-platform:
-summary: A Hash which automatically computes keys.
-require_paths:
- - lib
-files:
- - lib/keyedlist.rb
-autorequire: keyedlist
-author: Florian Gross
-email: flgr@ccan.de
-has_rdoc: true
- EOF
-
- LEGACY_RUBY_SPEC = <<-EOF
-Gem::Specification.new do |s|
- s.name = %q{keyedlist}
- s.version = %q{0.4.0}
- s.has_rdoc = true
- s.summary = %q{A Hash which automatically computes keys.}
- s.files = ["lib/keyedlist.rb"]
- s.require_paths = ["lib"]
- s.autorequire = %q{keyedlist}
- s.author = %q{Florian Gross}
- s.email = %q{flgr@ccan.de}
-end
- EOF
-
- def setup
- super
-
- @a1 = quick_gem 'a', '1' do |s|
- s.executable = 'exec'
- s.extensions << 'ext/a/extconf.rb'
- s.has_rdoc = 'true'
- s.test_file = 'test/suite.rb'
- s.requirements << 'A working computer'
- s.rubyforge_project = 'example'
- s.license = 'MIT'
-
- s.add_dependency 'rake', '> 0.4'
- s.add_dependency 'jabber4r', '> 0.0.0'
- s.add_dependency 'pqa', ['> 0.4', '<= 0.6']
-
- s.mark_version
- s.files = %w[lib/code.rb]
- end
-
- @a2 = quick_gem 'a', '2' do |s|
- s.files = %w[lib/code.rb]
- end
-
- FileUtils.mkdir_p File.join(@tempdir, 'bin')
- File.open File.join(@tempdir, 'bin', 'exec'), 'w' do |fp|
- fp.puts "#!#{Gem.ruby}"
- end
-
- @current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
- end
-
- def test_self_attribute_names
- expected_value = %w[
- authors
- autorequire
- bindir
- cert_chain
- date
- default_executable
- dependencies
- description
- email
- executables
- extensions
- extra_rdoc_files
- files
- has_rdoc
- homepage
- licenses
- name
- platform
- post_install_message
- rdoc_options
- require_paths
- required_ruby_version
- required_rubygems_version
- requirements
- rubyforge_project
- rubygems_version
- signing_key
- specification_version
- summary
- test_files
- version
- ]
-
- actual_value = Gem::Specification.attribute_names.map { |a| a.to_s }.sort
-
- assert_equal expected_value, actual_value
- end
-
- def test_self__load_future
- spec = Gem::Specification.new
- spec.name = 'a'
- spec.version = '1'
- spec.specification_version = @current_version + 1
-
- new_spec = Marshal.load Marshal.dump(spec)
-
- assert_equal 'a', new_spec.name
- assert_equal Gem::Version.new(1), new_spec.version
- assert_equal @current_version, new_spec.specification_version
- end
-
- def test_self_load
- spec = File.join @gemhome, 'specifications', "#{@a2.full_name}.gemspec"
- gs = Gem::Specification.load spec
-
- assert_equal @a2, gs
- end
-
- def test_self_load_legacy_ruby
- spec = eval LEGACY_RUBY_SPEC
- assert_equal 'keyedlist', spec.name
- assert_equal '0.4.0', spec.version.to_s
- assert_equal true, spec.has_rdoc?
- assert_equal Gem::Specification::TODAY, spec.date
- assert spec.required_ruby_version.satisfied_by?(Gem::Version.new('1'))
- assert_equal false, spec.has_unit_tests?
- end
-
- def test_self_load_legacy_yaml
- s = YAML.load StringIO.new(LEGACY_YAML_SPEC)
- assert_equal 'keyedlist', s.name
- assert_equal '0.4.0', s.version.to_s
- assert_equal true, s.has_rdoc?
- #assert_equal Date.today, s.date
- #assert s.required_ruby_version.satisfied_by?(Gem::Version.new('1'))
- assert_equal false, s.has_unit_tests?
- end
-
- def test_self_normalize_yaml_input_with_183_yaml
- input = "!ruby/object:Gem::Specification "
- assert_equal "--- #{input}", Gem::Specification.normalize_yaml_input(input)
- end
-
- def test_self_normalize_yaml_input_with_non_183_yaml
- input = "--- !ruby/object:Gem::Specification "
- assert_equal input, Gem::Specification.normalize_yaml_input(input)
- end
-
- def test_self_normalize_yaml_input_with_183_io
- input = "!ruby/object:Gem::Specification "
- assert_equal "--- #{input}",
- Gem::Specification.normalize_yaml_input(StringIO.new(input))
- end
-
- def test_self_normalize_yaml_input_with_non_183_io
- input = "--- !ruby/object:Gem::Specification "
- assert_equal input,
- Gem::Specification.normalize_yaml_input(StringIO.new(input))
- end
-
- def test_initialize
- spec = Gem::Specification.new do |s|
- s.name = "blah"
- s.version = "1.3.5"
- end
-
- assert_equal "blah", spec.name
- assert_equal "1.3.5", spec.version.to_s
- assert_equal Gem::Platform::RUBY, spec.platform
- assert_equal nil, spec.summary
- assert_equal [], spec.files
-
- assert_equal [], spec.test_files
- assert_equal [], spec.rdoc_options
- assert_equal [], spec.extra_rdoc_files
- assert_equal [], spec.executables
- assert_equal [], spec.extensions
- assert_equal [], spec.requirements
- assert_equal [], spec.dependencies
- assert_equal 'bin', spec.bindir
- assert_equal true, spec.has_rdoc
- assert_equal true, spec.has_rdoc?
- assert_equal '>= 0', spec.required_ruby_version.to_s
- assert_equal '>= 0', spec.required_rubygems_version.to_s
- end
-
- def test_initialize_future
- version = Gem::Specification::CURRENT_SPECIFICATION_VERSION + 1
- spec = Gem::Specification.new do |s|
- s.name = "blah"
- s.version = "1.3.5"
-
- s.specification_version = version
-
- s.new_unknown_attribute = "a value"
- end
-
- assert_equal "blah", spec.name
- assert_equal "1.3.5", spec.version.to_s
- end
-
- def test_initialize_copy
- spec = Gem::Specification.new do |s|
- s.name = "blah"
- s.version = "1.3.5"
- s.summary = 'summary'
- s.description = 'description'
- s.authors = 'author a', 'author b'
- s.licenses = 'BSD'
- s.files = 'lib/file.rb'
- s.test_files = 'test/file.rb'
- s.rdoc_options = '--foo'
- s.extra_rdoc_files = 'README.txt'
- s.executables = 'exec'
- s.extensions = 'ext/extconf.rb'
- s.requirements = 'requirement'
- s.add_dependency 'some_gem'
- end
-
- new_spec = spec.dup
-
- assert_equal "blah", spec.name
- assert_same spec.name, new_spec.name
-
- assert_equal "1.3.5", spec.version.to_s
- assert_same spec.version, new_spec.version
-
- assert_equal Gem::Platform::RUBY, spec.platform
- assert_same spec.platform, new_spec.platform
-
- assert_equal 'summary', spec.summary
- assert_same spec.summary, new_spec.summary
-
- assert_equal %w[lib/file.rb test/file.rb bin/exec README.txt
- ext/extconf.rb],
- spec.files
- refute_same spec.files, new_spec.files, 'files'
-
- assert_equal %w[test/file.rb], spec.test_files
- refute_same spec.test_files, new_spec.test_files, 'test_files'
-
- assert_equal %w[--foo], spec.rdoc_options
- refute_same spec.rdoc_options, new_spec.rdoc_options, 'rdoc_options'
-
- assert_equal %w[README.txt], spec.extra_rdoc_files
- refute_same spec.extra_rdoc_files, new_spec.extra_rdoc_files,
- 'extra_rdoc_files'
-
- assert_equal %w[exec], spec.executables
- refute_same spec.executables, new_spec.executables, 'executables'
-
- assert_equal %w[ext/extconf.rb], spec.extensions
- refute_same spec.extensions, new_spec.extensions, 'extensions'
-
- assert_equal %w[requirement], spec.requirements
- refute_same spec.requirements, new_spec.requirements, 'requirements'
-
- assert_equal [Gem::Dependency.new('some_gem', Gem::Requirement.default)],
- spec.dependencies
- refute_same spec.dependencies, new_spec.dependencies, 'dependencies'
-
- assert_equal 'bin', spec.bindir
- assert_same spec.bindir, new_spec.bindir
-
- assert_equal true, spec.has_rdoc
- assert_same spec.has_rdoc, new_spec.has_rdoc
-
- assert_equal '>= 0', spec.required_ruby_version.to_s
- assert_same spec.required_ruby_version, new_spec.required_ruby_version
-
- assert_equal '>= 0', spec.required_rubygems_version.to_s
- assert_same spec.required_rubygems_version,
- new_spec.required_rubygems_version
- end
-
- def test__dump
- @a2.platform = Gem::Platform.local
- @a2.instance_variable_set :@original_platform, 'old_platform'
-
- data = Marshal.dump @a2
-
- same_spec = Marshal.load data
-
- assert_equal 'old_platform', same_spec.original_platform
- end
-
- def test_add_dependency_with_explicit_type
- gem = quick_gem "awesome", "1.0" do |awesome|
- awesome.add_development_dependency "monkey"
- end
-
- monkey = gem.dependencies.detect { |d| d.name == "monkey" }
- assert_equal(:development, monkey.type)
- end
-
- def test_author
- assert_equal 'A User', @a1.author
- end
-
- def test_authors
- assert_equal ['A User'], @a1.authors
- end
-
- def test_bindir_equals
- @a1.bindir = 'apps'
-
- assert_equal 'apps', @a1.bindir
- end
-
- def test_bindir_equals_nil
- @a2.bindir = nil
- @a2.executable = 'app'
-
- assert_equal nil, @a2.bindir
- assert_equal %w[lib/code.rb app], @a2.files
- end
-
- def test_date
- assert_equal Gem::Specification::TODAY, @a1.date
- end
-
- def test_date_equals_date
- @a1.date = Date.new(2003, 9, 17)
- assert_equal Time.local(2003, 9, 17, 0,0,0), @a1.date
- end
-
- def test_date_equals_string
- @a1.date = '2003-09-17'
- assert_equal Time.local(2003, 9, 17, 0,0,0), @a1.date
- end
-
- def test_date_equals_time
- @a1.date = Time.local(2003, 9, 17, 0,0,0)
- assert_equal Time.local(2003, 9, 17, 0,0,0), @a1.date
- end
-
- def test_date_equals_time_local
- # HACK PDT
- @a1.date = Time.local(2003, 9, 17, 19,50,0)
- assert_equal Time.local(2003, 9, 17, 0,0,0), @a1.date
- end
-
- def test_date_equals_time_utc
- # HACK PDT
- @a1.date = Time.local(2003, 9, 17, 19,50,0)
- assert_equal Time.local(2003, 9, 17, 0,0,0), @a1.date
- end
-
- def test_default_executable
- assert_equal 'exec', @a1.default_executable
-
- @a1.default_executable = nil
- @a1.instance_variable_set :@executables, nil
- assert_equal nil, @a1.default_executable
- end
-
- def test_dependencies
- rake = Gem::Dependency.new 'rake', '> 0.4'
- jabber = Gem::Dependency.new 'jabber4r', '> 0.0.0'
- pqa = Gem::Dependency.new 'pqa', ['> 0.4', '<= 0.6']
-
- assert_equal [rake, jabber, pqa], @a1.dependencies
- end
-
- def test_dependencies_scoped_by_type
- gem = quick_gem "awesome", "1.0" do |awesome|
- awesome.add_runtime_dependency "bonobo", []
- awesome.add_development_dependency "monkey", []
- end
-
- bonobo = Gem::Dependency.new("bonobo", [])
- monkey = Gem::Dependency.new("monkey", [], :development)
-
- assert_equal([bonobo, monkey], gem.dependencies)
- assert_equal([bonobo], gem.runtime_dependencies)
- assert_equal([monkey], gem.development_dependencies)
- end
-
- def test_description
- assert_equal 'This is a test description', @a1.description
- end
-
- def test_eql_eh
- g1 = quick_gem 'gem'
- g2 = quick_gem 'gem'
-
- assert_equal g1, g2
- assert_equal g1.hash, g2.hash
- assert_equal true, g1.eql?(g2)
- end
-
- def test_equals2
- assert_equal @a1, @a1
- assert_equal @a1, @a1.dup
- refute_equal @a1, @a2
- refute_equal @a1, Object.new
- end
-
- # The cgikit specification was reported to be causing trouble in at least
- # one version of RubyGems, so we test explicitly for it.
- def test_equals2_cgikit
- cgikit = Gem::Specification.new do |s|
- s.name = %q{cgikit}
- s.version = "1.1.0"
- s.date = %q{2004-03-13}
- s.summary = %q{CGIKit is a componented-oriented web application } +
- %q{framework like Apple Computers WebObjects. } +
- %{This framework services Model-View-Controller architecture } +
- %q{programming by components based on a HTML file, a definition } +
- %q{file and a Ruby source. }
- s.email = %q{info@spice-of-life.net}
- s.homepage = %q{http://www.spice-of-life.net/download/cgikit/}
- s.autorequire = %q{cgikit}
- s.bindir = nil
- s.has_rdoc = true
- s.required_ruby_version = nil
- s.platform = nil
- s.files = ["lib/cgikit", "lib/cgikit.rb", "lib/cgikit/components", "..."]
- end
-
- assert_equal cgikit, cgikit
- end
-
- def test_equals2_default_executable
- spec = @a1.dup
- spec.default_executable = 'xx'
-
- refute_equal @a1, spec
- refute_equal spec, @a1
- end
-
- def test_equals2_extensions
- spec = @a1.dup
- spec.extensions = 'xx'
-
- refute_equal @a1, spec
- refute_equal spec, @a1
- end
-
- def test_executables
- @a1.executable = 'app'
- assert_equal %w[app], @a1.executables
- end
-
- def test_executable_equals
- @a2.executable = 'app'
- assert_equal 'app', @a2.executable
- assert_equal %w[lib/code.rb bin/app], @a2.files
- end
-
- def test_extensions
- assert_equal ['ext/a/extconf.rb'], @a1.extensions
- end
-
- def test_files
- @a1.files = %w(files bin/common)
- @a1.test_files = %w(test_files bin/common)
- @a1.executables = %w(executables common)
- @a1.extra_rdoc_files = %w(extra_rdoc_files bin/common)
- @a1.extensions = %w(extensions bin/common)
-
- expected = %w[
- bin/common
- bin/executables
- extensions
- extra_rdoc_files
- files
- test_files
- ]
- assert_equal expected, @a1.files.sort
- end
-
- def test_files_duplicate
- @a2.files = %w[a b c d b]
- @a2.extra_rdoc_files = %w[x y z x]
- @a2.normalize
-
- assert_equal %w[a b c d x y z], @a2.files
- assert_equal %w[x y z], @a2.extra_rdoc_files
- end
-
- def test_files_extra_rdoc_files
- @a2.files = %w[a b c d]
- @a2.extra_rdoc_files = %w[x y z]
- @a2.normalize
- assert_equal %w[a b c d x y z], @a2.files
- end
-
- def test_files_non_array
- @a1.files = "F"
- @a1.test_files = "TF"
- @a1.executables = "X"
- @a1.extra_rdoc_files = "ERF"
- @a1.extensions = "E"
-
- assert_equal %w[E ERF F TF bin/X], @a1.files.sort
- end
-
- def test_files_non_array_pathological
- @a1.instance_variable_set :@files, "F"
- @a1.instance_variable_set :@test_files, "TF"
- @a1.instance_variable_set :@extra_rdoc_files, "ERF"
- @a1.instance_variable_set :@extensions, "E"
- @a1.instance_variable_set :@executables, "X"
-
- assert_equal %w[E ERF F TF bin/X], @a1.files.sort
- assert_kind_of Integer, @a1.hash
- end
-
- def test_full_gem_path
- assert_equal File.join(@gemhome, 'gems', @a1.full_name),
- @a1.full_gem_path
-
- @a1.original_platform = 'mswin32'
-
- assert_equal File.join(@gemhome, 'gems', @a1.original_name),
- @a1.full_gem_path
- end
-
- def test_full_gem_path_double_slash
- gemhome = @gemhome.sub(/\w\//, '\&/')
- @a1.loaded_from = File.join gemhome, 'specifications',
- "#{@a1.full_name}.gemspec"
-
- assert_equal File.join(@gemhome, 'gems', @a1.full_name),
- @a1.full_gem_path
- end
-
- def test_full_name
- assert_equal 'a-1', @a1.full_name
-
- @a1.platform = Gem::Platform.new ['universal', 'darwin', nil]
- assert_equal 'a-1-universal-darwin', @a1.full_name
-
- @a1.instance_variable_set :@new_platform, 'mswin32'
- assert_equal 'a-1-mswin32', @a1.full_name, 'legacy'
-
- return if win_platform?
-
- @a1.platform = 'current'
- assert_equal 'a-1-x86-darwin-8', @a1.full_name
- end
-
- def test_full_name_windows
- test_cases = {
- 'i386-mswin32' => 'a-1-x86-mswin32-60',
- 'i386-mswin32_80' => 'a-1-x86-mswin32-80',
- 'i386-mingw32' => 'a-1-x86-mingw32'
- }
-
- test_cases.each do |arch, expected|
- util_set_arch arch
- @a1.platform = 'current'
- assert_equal expected, @a1.full_name
- end
- end
-
- def test_has_rdoc_eh
- assert @a1.has_rdoc?
- end
-
- def test_has_rdoc_equals
-
- use_ui @ui do
- @a1.has_rdoc = false
- end
-
- assert_equal '', @ui.output
-
- assert_equal true, @a1.has_rdoc
- end
-
- def test_hash
- assert_equal @a1.hash, @a1.hash
- assert_equal @a1.hash, @a1.dup.hash
- refute_equal @a1.hash, @a2.hash
- end
-
- def test_installation_path
- assert_equal @gemhome, @a1.installation_path
-
- @a1.instance_variable_set :@loaded_from, nil
-
- e = assert_raises Gem::Exception do
- @a1.installation_path
- end
-
- assert_equal 'spec a-1 is not from an installed gem', e.message
- end
-
- def test_lib_files
- @a1.files = %w[lib/foo.rb Rakefile]
-
- assert_equal %w[lib/foo.rb], @a1.lib_files
- end
-
- def test_license
- assert_equal 'MIT', @a1.license
- end
-
- def test_licenses
- assert_equal ['MIT'], @a1.licenses
- end
-
- def test_name
- assert_equal 'a', @a1.name
- end
-
- def test_original_name
- assert_equal 'a-1', @a1.full_name
-
- @a1.platform = 'i386-linux'
- @a1.instance_variable_set :@original_platform, 'i386-linux'
- assert_equal 'a-1-i386-linux', @a1.original_name
- end
-
- def test_platform
- assert_equal Gem::Platform::RUBY, @a1.platform
- end
-
- def test_platform_equals
- @a1.platform = nil
- assert_equal Gem::Platform::RUBY, @a1.platform
-
- @a1.platform = Gem::Platform::RUBY
- assert_equal Gem::Platform::RUBY, @a1.platform
-
- test_cases = {
- 'i386-mswin32' => ['x86', 'mswin32', '60'],
- 'i386-mswin32_80' => ['x86', 'mswin32', '80'],
- 'i386-mingw32' => ['x86', 'mingw32', nil ],
- 'x86-darwin8' => ['x86', 'darwin', '8' ],
- }
-
- test_cases.each do |arch, expected|
- util_set_arch arch
- @a1.platform = Gem::Platform::CURRENT
- assert_equal Gem::Platform.new(expected), @a1.platform
- end
- end
-
- def test_platform_equals_current
- @a1.platform = Gem::Platform::CURRENT
- assert_equal Gem::Platform.local, @a1.platform
- assert_equal Gem::Platform.local.to_s, @a1.original_platform
- end
-
- def test_platform_equals_legacy
- @a1.platform = 'mswin32'
- assert_equal Gem::Platform.new('x86-mswin32'), @a1.platform
-
- @a1.platform = 'i586-linux'
- assert_equal Gem::Platform.new('x86-linux'), @a1.platform
-
- @a1.platform = 'powerpc-darwin'
- assert_equal Gem::Platform.new('ppc-darwin'), @a1.platform
- end
-
- def test_prerelease_spec_adds_required_rubygems_version
- @prerelease = quick_gem('tardis', '2.2.0.a')
- refute @prerelease.required_rubygems_version.satisfied_by?(Gem::Version.new('1.3.1'))
- assert @prerelease.required_rubygems_version.satisfied_by?(Gem::Version.new('1.4.0'))
- end
-
- def test_require_paths
- @a1.require_path = 'lib'
- assert_equal %w[lib], @a1.require_paths
- end
-
- def test_requirements
- assert_equal ['A working computer'], @a1.requirements
- end
-
- def test_runtime_dependencies_legacy
- # legacy gems don't have a type
- @a1.runtime_dependencies.each do |dep|
- dep.instance_variable_set :@type, nil
- end
-
- expected = %w[rake jabber4r pqa]
-
- assert_equal expected, @a1.runtime_dependencies.map { |d| d.name }
- end
-
- def test_spaceship_name
- s1 = quick_gem 'a', '1'
- s2 = quick_gem 'b', '1'
-
- assert_equal(-1, (s1 <=> s2))
- assert_equal( 0, (s1 <=> s1))
- assert_equal( 1, (s2 <=> s1))
- end
-
- def test_spaceship_platform
- s1 = quick_gem 'a', '1'
- s2 = quick_gem 'a', '1' do |s|
- s.platform = Gem::Platform.new 'x86-my_platform1'
- end
-
- assert_equal( -1, (s1 <=> s2))
- assert_equal( 0, (s1 <=> s1))
- assert_equal( 1, (s2 <=> s1))
- end
-
- def test_spaceship_version
- s1 = quick_gem 'a', '1'
- s2 = quick_gem 'a', '2'
-
- assert_equal( -1, (s1 <=> s2))
- assert_equal( 0, (s1 <=> s1))
- assert_equal( 1, (s2 <=> s1))
- end
-
- def test_summary
- assert_equal 'this is a summary', @a1.summary
- end
-
- def test_test_files
- @a1.test_file = 'test/suite.rb'
- assert_equal ['test/suite.rb'], @a1.test_files
- end
-
- def test_to_ruby
- @a2.add_runtime_dependency 'b', '1'
- @a2.dependencies.first.instance_variable_set :@type, nil
- @a2.required_rubygems_version = Gem::Requirement.new '> 0'
-
- ruby_code = @a2.to_ruby
-
- expected = <<-SPEC
-# -*- encoding: utf-8 -*-
-
-Gem::Specification.new do |s|
- s.name = %q{a}
- s.version = \"2\"
-
- s.required_rubygems_version = Gem::Requirement.new(\"> 0\") if s.respond_to? :required_rubygems_version=
- s.authors = [\"A User\"]
- s.date = %q{#{Gem::Specification::TODAY.strftime "%Y-%m-%d"}}
- s.description = %q{This is a test description}
- s.email = %q{example@example.com}
- s.files = [\"lib/code.rb\"]
- s.homepage = %q{http://example.com}
- s.require_paths = [\"lib\"]
- s.rubygems_version = %q{#{Gem::RubyGemsVersion}}
- s.summary = %q{this is a summary}
-
- if s.respond_to? :specification_version then
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
- s.specification_version = #{Gem::Specification::CURRENT_SPECIFICATION_VERSION}
-
- if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
- s.add_runtime_dependency(%q<b>, [\"= 1\"])
- else
- s.add_dependency(%q<b>, [\"= 1\"])
- end
- else
- s.add_dependency(%q<b>, [\"= 1\"])
- end
-end
- SPEC
-
- assert_equal expected, ruby_code
-
- same_spec = eval ruby_code
-
- assert_equal @a2, same_spec
- end
-
- def test_to_ruby_fancy
- @a1.platform = Gem::Platform.local
- ruby_code = @a1.to_ruby
-
- local = Gem::Platform.local
- expected_platform = "[#{local.cpu.inspect}, #{local.os.inspect}, #{local.version.inspect}]"
-
- expected = <<-SPEC
-# -*- encoding: utf-8 -*-
-
-Gem::Specification.new do |s|
- s.name = %q{a}
- s.version = \"1\"
- s.platform = Gem::Platform.new(#{expected_platform})
-
- s.required_rubygems_version = Gem::Requirement.new(\">= 0\") if s.respond_to? :required_rubygems_version=
- s.authors = [\"A User\"]
- s.date = %q{#{Gem::Specification::TODAY.strftime "%Y-%m-%d"}}
- s.default_executable = %q{exec}
- s.description = %q{This is a test description}
- s.email = %q{example@example.com}
- s.executables = [\"exec\"]
- s.extensions = [\"ext/a/extconf.rb\"]
- s.files = [\"lib/code.rb\", \"test/suite.rb\", \"bin/exec\", \"ext/a/extconf.rb\"]
- s.homepage = %q{http://example.com}
- s.licenses = [\"MIT\"]
- s.require_paths = [\"lib\"]
- s.requirements = [\"A working computer\"]
- s.rubyforge_project = %q{example}
- s.rubygems_version = %q{#{Gem::RubyGemsVersion}}
- s.summary = %q{this is a summary}
- s.test_files = [\"test/suite.rb\"]
-
- if s.respond_to? :specification_version then
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
- s.specification_version = 3
-
- if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
- s.add_runtime_dependency(%q<rake>, [\"> 0.4\"])
- s.add_runtime_dependency(%q<jabber4r>, [\"> 0.0.0\"])
- s.add_runtime_dependency(%q<pqa>, [\"> 0.4\", \"<= 0.6\"])
- else
- s.add_dependency(%q<rake>, [\"> 0.4\"])
- s.add_dependency(%q<jabber4r>, [\"> 0.0.0\"])
- s.add_dependency(%q<pqa>, [\"> 0.4\", \"<= 0.6\"])
- end
- else
- s.add_dependency(%q<rake>, [\"> 0.4\"])
- s.add_dependency(%q<jabber4r>, [\"> 0.0.0\"])
- s.add_dependency(%q<pqa>, [\"> 0.4\", \"<= 0.6\"])
- end
-end
- SPEC
-
- assert_equal expected, ruby_code
-
- same_spec = eval ruby_code
-
- assert_equal @a1, same_spec
- end
-
- def test_to_ruby_legacy
- gemspec1 = eval LEGACY_RUBY_SPEC
- ruby_code = gemspec1.to_ruby
- gemspec2 = eval ruby_code
-
- assert_equal gemspec1, gemspec2
- end
-
- def test_to_ruby_platform
- @a2.platform = Gem::Platform.local
- @a2.instance_variable_set :@original_platform, 'old_platform'
-
- ruby_code = @a2.to_ruby
-
- same_spec = eval ruby_code
-
- assert_equal 'old_platform', same_spec.original_platform
- end
-
- def test_to_yaml
- yaml_str = @a1.to_yaml
- same_spec = YAML.load(yaml_str)
-
- assert_equal @a1, same_spec
- end
-
- def test_to_yaml_fancy
- @a1.platform = Gem::Platform.local
- yaml_str = @a1.to_yaml
-
- same_spec = YAML.load(yaml_str)
-
- assert_equal Gem::Platform.local, same_spec.platform
-
- assert_equal @a1, same_spec
- end
-
- def test_to_yaml_platform_empty_string
- @a1.instance_variable_set :@original_platform, ''
-
- assert_match %r|^platform: ruby$|, @a1.to_yaml
- end
-
- def test_to_yaml_platform_legacy
- @a1.platform = 'powerpc-darwin7.9.0'
- @a1.instance_variable_set :@original_platform, 'powerpc-darwin7.9.0'
-
- yaml_str = @a1.to_yaml
-
- same_spec = YAML.load(yaml_str)
-
- assert_equal Gem::Platform.new('powerpc-darwin7'), same_spec.platform
- assert_equal 'powerpc-darwin7.9.0', same_spec.original_platform
- end
-
- def test_to_yaml_platform_nil
- @a1.instance_variable_set :@original_platform, nil
-
- assert_match %r|^platform: ruby$|, @a1.to_yaml
- end
-
- def test_validate
- util_setup_validate
-
- Dir.chdir @tempdir do
- assert @a1.validate
- end
- end
-
- def test_validate_authors
- util_setup_validate
-
- Dir.chdir @tempdir do
- @a1.authors = []
-
- use_ui @ui do
- @a1.validate
- end
-
- assert_equal "WARNING: no author specified\n", @ui.error, 'error'
-
- @a1.authors = [Object.new]
-
- e = assert_raises Gem::InvalidSpecificationException do
- @a1.validate
- end
-
- assert_equal 'authors must be Array of Strings', e.message
-
- @a1.authors = ['FIXME (who is writing this software)']
-
- e = assert_raises Gem::InvalidSpecificationException do
- @a1.validate
- end
-
- assert_equal '"FIXME" or "TODO" is not an author', e.message
-
- @a1.authors = ['TODO (who is writing this software)']
-
- e = assert_raises Gem::InvalidSpecificationException do
- @a1.validate
- end
-
- assert_equal '"FIXME" or "TODO" is not an author', e.message
- end
- end
-
- def test_validate_autorequire
- util_setup_validate
-
- Dir.chdir @tempdir do
- @a1.autorequire = 'code'
-
- use_ui @ui do
- @a1.validate
- end
-
- assert_equal "WARNING: deprecated autorequire specified\n",
- @ui.error, 'error'
- end
- end
-
- def test_validate_description
- util_setup_validate
-
- Dir.chdir @tempdir do
- @a1.description = ''
-
- use_ui @ui do
- @a1.validate
- end
-
- assert_equal "WARNING: no description specified\n", @ui.error, 'error'
-
- @ui = MockGemUi.new
- @a1.summary = 'this is my summary'
- @a1.description = @a1.summary
-
- use_ui @ui do
- @a1.validate
- end
-
- assert_equal "WARNING: description and summary are identical\n",
- @ui.error, 'error'
-
- @a1.description = 'FIXME (describe your package)'
-
- e = assert_raises Gem::InvalidSpecificationException do
- @a1.validate
- end
-
- assert_equal '"FIXME" or "TODO" is not a description', e.message
-
- @a1.description = 'TODO (describe your package)'
-
- e = assert_raises Gem::InvalidSpecificationException do
- @a1.validate
- end
-
- assert_equal '"FIXME" or "TODO" is not a description', e.message
- end
- end
-
- def test_validate_email
- util_setup_validate
-
- Dir.chdir @tempdir do
- @a1.email = ''
-
- use_ui @ui do
- @a1.validate
- end
-
- assert_equal "WARNING: no email specified\n", @ui.error, 'error'
-
- @a1.email = 'FIXME (your e-mail)'
-
- e = assert_raises Gem::InvalidSpecificationException do
- @a1.validate
- end
-
- assert_equal '"FIXME" or "TODO" is not an email address', e.message
-
- @a1.email = 'TODO (your e-mail)'
-
- e = assert_raises Gem::InvalidSpecificationException do
- @a1.validate
- end
-
- assert_equal '"FIXME" or "TODO" is not an email address', e.message
- end
- end
-
- def test_validate_empty
- util_setup_validate
-
- e = assert_raises Gem::InvalidSpecificationException do
- Gem::Specification.new.validate
- end
-
- assert_equal 'missing value for attribute name', e.message
- end
-
- def test_validate_executables
- util_setup_validate
-
- FileUtils.mkdir_p File.join(@tempdir, 'bin')
- File.open File.join(@tempdir, 'bin', 'exec'), 'w' do end
- FileUtils.mkdir_p File.join(@tempdir, 'exec')
-
- use_ui @ui do
- Dir.chdir @tempdir do
- assert @a1.validate
- end
- end
-
- assert_equal %w[exec], @a1.executables
-
- assert_equal '', @ui.output, 'output'
- assert_equal "WARNING: bin/exec is missing #! line\n", @ui.error, 'error'
- end
-
- def test_validate_empty_require_paths
- if win_platform? then
- skip 'test_validate_empty_require_paths skipped on MS Windows (symlink)'
- else
- util_setup_validate
-
- @a1.require_paths = []
- e = assert_raises Gem::InvalidSpecificationException do
- @a1.validate
- end
-
- assert_equal 'specification must have at least one require_path',
- e.message
- end
- end
-
- def test_validate_files
- skip 'test_validate_files skipped on MS Windows (symlink)' if win_platform?
- util_setup_validate
-
- @a1.files += ['lib', 'lib2']
-
- Dir.chdir @tempdir do
- FileUtils.ln_s '/root/path', 'lib2' unless vc_windows?
-
- e = assert_raises Gem::InvalidSpecificationException do
- @a1.validate
- end
-
- assert_equal '["lib2"] are not files', e.message
- end
-
- assert_equal %w[lib/code.rb test/suite.rb bin/exec ext/a/extconf.rb lib2],
- @a1.files
- end
-
- def test_validate_homepage
- util_setup_validate
-
- Dir.chdir @tempdir do
- @a1.homepage = nil
-
- use_ui @ui do
- @a1.validate
- end
-
- assert_equal "WARNING: no homepage specified\n", @ui.error, 'error'
-
- @ui = MockGemUi.new
-
- @a1.homepage = ''
-
- use_ui @ui do
- @a1.validate
- end
-
- assert_equal "WARNING: no homepage specified\n", @ui.error, 'error'
-
- @a1.homepage = 'over at my cool site'
-
- e = assert_raises Gem::InvalidSpecificationException do
- @a1.validate
- end
-
- assert_equal '"over at my cool site" is not a URI', e.message
- end
- end
-
- def test_validate_name
- util_setup_validate
-
- e = assert_raises Gem::InvalidSpecificationException do
- @a1.name = :json
- @a1.validate
- end
-
- assert_equal 'invalid value for attribute name: ":json"', e.message
- end
-
- def test_validate_platform_legacy
- util_setup_validate
-
- Dir.chdir @tempdir do
- @a1.platform = 'mswin32'
- assert @a1.validate
-
- @a1.platform = 'i586-linux'
- assert @a1.validate
-
- @a1.platform = 'powerpc-darwin'
- assert @a1.validate
- end
- end
-
- def test_validate_rubyforge_project
- util_setup_validate
-
- Dir.chdir @tempdir do
- @a1.rubyforge_project = ''
-
- use_ui @ui do
- @a1.validate
- end
-
- assert_equal "WARNING: no rubyforge_project specified\n",
- @ui.error, 'error'
- end
- end
-
- def test_validate_rubygems_version
- util_setup_validate
-
- @a1.rubygems_version = "3"
- e = assert_raises Gem::InvalidSpecificationException do
- @a1.validate
- end
-
- assert_equal "expected RubyGems version #{Gem::RubyGemsVersion}, was 3",
- e.message
- end
-
- def test_validate_specification_version
- util_setup_validate
-
- Dir.chdir @tempdir do
- @a1.specification_version = '1.0'
-
- e = assert_raises Gem::InvalidSpecificationException do
- use_ui @ui do
- @a1.validate
- end
- end
-
- err = 'specification_version must be a Fixnum (did you mean version?)'
- assert_equal err, e.message
- end
- end
-
- def test_validate_summary
- util_setup_validate
-
- Dir.chdir @tempdir do
- @a1.summary = ''
-
- use_ui @ui do
- @a1.validate
- end
-
- assert_equal "WARNING: no summary specified\n", @ui.error, 'error'
-
- @a1.summary = 'FIXME (describe your package)'
-
- e = assert_raises Gem::InvalidSpecificationException do
- @a1.validate
- end
-
- assert_equal '"FIXME" or "TODO" is not a summary', e.message
-
- @a1.summary = 'TODO (describe your package)'
-
- e = assert_raises Gem::InvalidSpecificationException do
- @a1.validate
- end
-
- assert_equal '"FIXME" or "TODO" is not a summary', e.message
- end
- end
-
- def test_version
- assert_equal Gem::Version.new('1'), @a1.version
- end
-
- def util_setup_validate
- Dir.chdir @tempdir do
- FileUtils.mkdir_p File.join('ext', 'a')
- FileUtils.mkdir_p 'lib'
- FileUtils.mkdir_p 'test'
-
- FileUtils.touch File.join('ext', 'a', 'extconf.rb')
- FileUtils.touch File.join('lib', 'code.rb')
- FileUtils.touch File.join('test', 'suite.rb')
- end
- end
-
-end
-
diff --git a/test/rubygems/test_gem_stream_ui.rb b/test/rubygems/test_gem_stream_ui.rb
deleted file mode 100644
index ffab8844cf..0000000000
--- a/test/rubygems/test_gem_stream_ui.rb
+++ /dev/null
@@ -1,116 +0,0 @@
-require File.join(File.expand_path(File.dirname(__FILE__)), 'gemutilities')
-require 'rubygems/user_interaction'
-
-class TestGemStreamUI < RubyGemTestCase
-
- module IsTty
- attr_accessor :tty
-
- def tty?
- @tty = true unless defined? @tty
- return @tty
- end
-
- alias_method :isatty, :tty?
- end
-
- def setup
- super
-
- @cfg = Gem.configuration
-
- @in = StringIO.new
- @out = StringIO.new
- @err = StringIO.new
-
- @in.extend IsTty
-
- @sui = Gem::StreamUI.new @in, @out, @err
- end
-
- def test_ask
- timeout(1) do
- expected_answer = "Arthur, King of the Britons"
- @in.string = "#{expected_answer}\n"
- actual_answer = @sui.ask("What is your name?")
- assert_equal expected_answer, actual_answer
- end
- end
-
- def test_ask_no_tty
- @in.tty = false
-
- timeout(0.1) do
- answer = @sui.ask("what is your favorite color?")
- assert_equal nil, answer
- end
- end
-
- def test_ask_yes_no_no_tty_with_default
- @in.tty = false
-
- timeout(0.1) do
- answer = @sui.ask_yes_no("do coconuts migrate?", false)
- assert_equal false, answer
-
- answer = @sui.ask_yes_no("do coconuts migrate?", true)
- assert_equal true, answer
- end
- end
-
- def test_ask_yes_no_no_tty_without_default
- @in.tty = false
-
- timeout(0.1) do
- assert_raises(Gem::OperationNotSupportedError) do
- @sui.ask_yes_no("do coconuts migrate?")
- end
- end
- end
-
- def test_choose_from_list
- @in.puts "1"
- @in.rewind
-
- result = @sui.choose_from_list 'which one?', %w[foo bar]
-
- assert_equal ['foo', 0], result
- assert_equal "which one?\n 1. foo\n 2. bar\n> ", @out.string
- end
-
- def test_choose_from_list_EOF
- result = @sui.choose_from_list 'which one?', %w[foo bar]
-
- assert_equal [nil, nil], result
- assert_equal "which one?\n 1. foo\n 2. bar\n> ", @out.string
- end
-
- def test_proress_reporter_silent_nil
- @cfg.verbose = nil
- reporter = @sui.progress_reporter 10, 'hi'
- assert_kind_of Gem::StreamUI::SilentProgressReporter, reporter
- end
-
- def test_proress_reporter_silent_false
- @cfg.verbose = false
- reporter = @sui.progress_reporter 10, 'hi'
- assert_kind_of Gem::StreamUI::SilentProgressReporter, reporter
- assert_equal "", @out.string
- end
-
- def test_proress_reporter_simple
- @cfg.verbose = true
- reporter = @sui.progress_reporter 10, 'hi'
- assert_kind_of Gem::StreamUI::SimpleProgressReporter, reporter
- assert_equal "hi\n", @out.string
- end
-
- def test_proress_reporter_verbose
- @cfg.verbose = 0
- reporter = @sui.progress_reporter 10, 'hi'
- assert_kind_of Gem::StreamUI::VerboseProgressReporter, reporter
- assert_equal "hi\n", @out.string
- end
-
-end
-
diff --git a/test/rubygems/test_gem_uninstaller.rb b/test/rubygems/test_gem_uninstaller.rb
deleted file mode 100644
index 2b026e9c4c..0000000000
--- a/test/rubygems/test_gem_uninstaller.rb
+++ /dev/null
@@ -1,147 +0,0 @@
-require File.join(File.expand_path(File.dirname(__FILE__)),
- 'gem_installer_test_case')
-require 'rubygems/uninstaller'
-
-class TestGemUninstaller < GemInstallerTestCase
-
- def setup
- super
-
- ui = MockGemUi.new
- util_setup_gem ui
-
- @user_spec.executables = ["my_exec"]
-
- # HACK util_make_exec
- user_bin_dir = File.join Gem.user_dir, 'gems', @user_spec.full_name, 'bin'
- FileUtils.mkdir_p user_bin_dir
- exec_path = File.join user_bin_dir, "my_exec"
- File.open exec_path, 'w' do |f|
- f.puts "#!/usr/bin/ruby"
- end
-
- user_bin_dir = File.join Gem.user_dir, 'bin'
- FileUtils.mkdir_p user_bin_dir
- exec_path = File.join user_bin_dir, "my_exec"
- File.open exec_path, 'w' do |f|
- f.puts "#!/usr/bin/ruby"
- end
-
- build_rake_in do
- use_ui ui do
- @installer.install
- @user_installer.install
- Gem::Uninstaller.new(@user_spec.name, :executables => false).uninstall
- end
- end
- end
-
- def test_initialize_expand_path
- uninstaller = Gem::Uninstaller.new nil, :install_dir => '/foo//bar'
-
- assert_match %r|/foo/bar$|, uninstaller.instance_variable_get(:@gem_home)
- end
-
- def test_remove_executables_force_keep
- uninstaller = Gem::Uninstaller.new nil, :executables => false
-
- use_ui @ui do
- uninstaller.remove_executables @spec
- end
-
- assert_equal true, File.exist?(File.join(@gemhome, 'bin', 'executable'))
-
- assert_equal "Executables and scripts will remain installed.\n", @ui.output
- end
-
- def test_remove_executables_force_remove
- uninstaller = Gem::Uninstaller.new nil, :executables => true
-
- use_ui @ui do
- uninstaller.remove_executables @spec
- end
-
- assert_equal "Removing executable\n", @ui.output
-
- assert_equal false, File.exist?(File.join(@gemhome, 'bin', 'executable'))
- end
-
- def test_remove_executables_user
- uninstaller = Gem::Uninstaller.new nil, :executables => true
-
- use_ui @ui do
- uninstaller.remove_executables @user_spec
- end
-
- exec_path = File.join Gem.user_dir, 'bin', 'my_exec'
- assert_equal false, File.exist?(exec_path), 'removed exec from bin dir'
-
- assert_equal "Removing my_exec\n", @ui.output
- end
-
- def test_path_ok_eh
- uninstaller = Gem::Uninstaller.new nil
-
- assert_equal true, uninstaller.path_ok?(@gemhome, @spec)
- end
-
- def test_path_ok_eh_legacy
- uninstaller = Gem::Uninstaller.new nil
-
- @spec.loaded_from.gsub! @spec.full_name, '\&-legacy'
- @spec.platform = 'legacy'
-
- assert_equal true, uninstaller.path_ok?(@gemhome, @spec)
- end
-
- def test_path_ok_eh_user
- uninstaller = Gem::Uninstaller.new nil
-
- assert_equal true, uninstaller.path_ok?(Gem.user_dir, @user_spec)
- end
-
- def test_uninstall
- uninstaller = Gem::Uninstaller.new @spec.name, :executables => true
-
- gem_dir = File.join @gemhome, 'gems', @spec.full_name
-
- Gem.pre_uninstall do
- assert File.exist?(gem_dir), 'gem_dir should exist'
- end
-
- Gem.post_uninstall do
- refute File.exist?(gem_dir), 'gem_dir should not exist'
- end
-
- uninstaller.uninstall
-
- refute File.exist?(gem_dir)
-
- assert_same uninstaller, @pre_uninstall_hook_arg
- assert_same uninstaller, @post_uninstall_hook_arg
- end
-
- def test_uninstall_user
- uninstaller = Gem::Uninstaller.new @user_spec.name, :executables => true,
- :user_install => true
-
- gem_dir = File.join Gem.user_dir, 'gems', @user_spec.full_name
-
- Gem.pre_uninstall do
- assert File.exist?(gem_dir), 'gem_dir should exist'
- end
-
- Gem.post_uninstall do
- refute File.exist?(gem_dir), 'gem_dir should not exist'
- end
-
- uninstaller.uninstall
-
- refute File.exist?(gem_dir)
-
- assert_same uninstaller, @pre_uninstall_hook_arg
- assert_same uninstaller, @post_uninstall_hook_arg
- end
-
-end
-
diff --git a/test/rubygems/test_gem_validator.rb b/test/rubygems/test_gem_validator.rb
deleted file mode 100644
index 77fdf2181a..0000000000
--- a/test/rubygems/test_gem_validator.rb
+++ /dev/null
@@ -1,69 +0,0 @@
-#--
-# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
-# All rights reserved.
-# See LICENSE.txt for permissions.
-#++
-
-require File.join(File.expand_path(File.dirname(__FILE__)), 'gemutilities')
-require File.join(File.expand_path(File.dirname(__FILE__)), 'simple_gem')
-require 'rubygems/validator'
-
-class TestGemValidator < RubyGemTestCase
-
- def setup
- super
-
- @simple_gem = SIMPLE_GEM
- @validator = Gem::Validator.new
- end
-
- def test_verify_gem_file
- gem_file = File.join @tempdir, 'simple_gem.gem'
- File.open gem_file, 'wb' do |fp| fp.write @simple_gem end
-
- assert_equal nil, @validator.verify_gem_file(gem_file)
- end
-
- def test_verify_gem_file_empty
- e = assert_raises Gem::VerificationError do
- @validator.verify_gem_file ''
- end
-
- assert_equal 'missing gem file ', e.message
- end
-
- def test_verify_gem_file_nonexistent
- file = '/nonexistent/nonexistent.gem'
- e = assert_raises Gem::VerificationError do
- @validator.verify_gem_file file
- end
-
- assert_equal "missing gem file #{file}", e.message
- end
-
- def test_verify_gem
- assert_equal nil, @validator.verify_gem(@simple_gem)
- end
-
- def test_verify_gem_empty
- e = assert_raises Gem::VerificationError do
- @validator.verify_gem ''
- end
-
- assert_equal 'empty gem file', e.message
- end
-
- def test_verify_gem_invalid_checksum
- e = assert_raises Gem::VerificationError do
- @validator.verify_gem @simple_gem.upcase
- end
-
- assert_equal 'invalid checksum for gem file', e.message
- end
-
- def test_verify_gem_no_sum
- assert_equal nil, @validator.verify_gem('words')
- end
-
-end
-
diff --git a/test/rubygems/test_gem_version.rb b/test/rubygems/test_gem_version.rb
deleted file mode 100644
index d87245f92b..0000000000
--- a/test/rubygems/test_gem_version.rb
+++ /dev/null
@@ -1,316 +0,0 @@
-#--
-# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
-# All rights reserved.
-# See LICENSE.txt for permissions.
-#++
-
-require File.join(File.expand_path(File.dirname(__FILE__)), 'gemutilities')
-require 'rubygems/version'
-
-class TestGemVersion < RubyGemTestCase
-
- def setup
- super
-
- version = Object.new
- def version.to_s() '1.4.0' end
-
- @v1_0 = Gem::Version.new '1.0'
- @v1_2 = Gem::Version.new '1.2'
- @v1_3 = Gem::Version.new '1.3'
- @v1_4_0 = Gem::Version.new version
- end
-
- def test_class_create
- assert_version Gem::Version.create('1.0')
- assert_version Gem::Version.create("1.0 ")
- assert_version Gem::Version.create(" 1.0 ")
- assert_version Gem::Version.create("1.0\n")
- assert_version Gem::Version.create("\n1.0\n")
-
- assert_equal Gem::Version.create('1'), Gem::Version.create(1)
- end
-
- def test_class_create_malformed
- e = assert_raises ArgumentError do Gem::Version.create("junk") end
- assert_equal "Malformed version number string junk", e.message
-
- e = assert_raises ArgumentError do Gem::Version.create("1.0\n2.0") end
- assert_equal "Malformed version number string 1.0\n2.0", e.message
- end
-
- def test_bad
- assert_inadequate( "", "> 0.1")
- assert_inadequate( "1.2.3", "!= 1.2.3")
- assert_inadequate( "1.2.003.0.0", "!= 1.02.3")
- assert_inadequate( "4.5.6", "< 1.2.3")
- assert_inadequate( "1.0", "> 1.1")
- assert_inadequate( "0", ">")
- assert_inadequate( "0", "<")
- assert_inadequate( "", "= 0.1")
- assert_inadequate( "1.1.1", "> 1.1.1")
- assert_inadequate( "1.2", "= 1.1")
- assert_inadequate( "1.40", "= 1.1")
- assert_inadequate( "1.3", "= 1.40")
- assert_inadequate( "9.3.3", "<= 9.3.2")
- assert_inadequate( "9.3.1", ">= 9.3.2")
- assert_inadequate( "9.3.03", "<= 9.3.2")
- assert_inadequate( "1.0.0.1", "= 1.0")
- end
-
- def test_bump_trailing_zeros
- v = Gem::Version.new("5.0.0")
- assert_equal "5.1", v.bump.to_s
- end
-
- def test_bump
- v = Gem::Version.new("5.2.4")
- assert_equal "5.3", v.bump.to_s
- end
-
- def test_bump_alpha
- v = Gem::Version.new("5.2.4.a")
- assert_equal "5.3", v.bump.to_s
- end
-
- def test_bump_one_level
- v = Gem::Version.new("5")
- assert_equal "6", v.bump.to_s
- end
-
- def test_eql_eh
- v1_2 = Gem::Version.new '1.2'
- v1_2_0 = Gem::Version.new '1.2.0'
-
- assert_equal true, v1_2.eql?(@v1_2)
- assert_equal true, @v1_2.eql?(v1_2)
-
- assert_equal false, v1_2_0.eql?(@v1_2)
- assert_equal false, @v1_2.eql?(v1_2_0)
-
- assert_equal false, @v1_2.eql?(@v1_3)
- assert_equal false, @v1_3.eql?(@v1_2)
- end
-
- def test_eql_eh4
- v1_4 = Gem::Version.new '1.4'
- v1_4_0 = Gem::Version.new "1.4.0"
-
- assert_equal true, v1_4_0.eql?(@v1_4_0)
- assert_equal true, @v1_4_0.eql?(v1_4_0)
-
- assert_equal false, v1_4.eql?(@v1_4_0)
- assert_equal false, @v1_4_0.eql?(v1_4)
-
- assert_equal false, @v1_4_0.eql?(@v1_3)
- assert_equal false, @v1_3.eql?(@v1_4_0)
- end
-
- def test_equals2
- v = Gem::Version.new("1.2")
-
- assert_equal v, @v1_2
- assert_equal @v1_2, v
-
- refute_equal @v1_2, @v1_3
- refute_equal @v1_3, @v1_2
- end
-
- def test_hash
- v1_2 = Gem::Version.new "1.2"
- v1_2_0 = Gem::Version.new "1.2.0"
- v1_4_0 = Gem::Version.new "1.4.0"
-
- assert_equal v1_2.hash, @v1_2.hash
-
- refute_equal v1_2_0.hash, @v1_2.hash
-
- assert_equal v1_4_0.hash, @v1_4_0.hash
-
- refute_equal @v1_2.hash, @v1_3.hash
-
- refute_equal @v1_2.hash, @v1_4_0.hash
- end
-
- def test_illformed_requirements
- [ ">>> 1.3.5", "> blah" ].each do |rq|
- assert_raises ArgumentError, "req [#{rq}] should fail" do
- Gem::Version::Requirement.new rq
- end
- end
- end
-
- def test_normalize
- assert_equal [0], Gem::Version.new("").normalize.map { |part| part.value }
- assert_equal [0], Gem::Version.new("0").normalize.map { |part| part.value }
- assert_equal [1], Gem::Version.new("1").normalize.map { |part| part.value }
- assert_equal [1], Gem::Version.new("1.0").normalize.map { |part| part.value }
- assert_equal [1, 1], Gem::Version.new("1.1").normalize.map { |part| part.value }
- assert_equal [1, 1, "a"], Gem::Version.new("1.1.a").normalize.map { |part| part.value }
- end
-
- def test_ok
- assert_adequate( "0.2.33", "= 0.2.33")
- assert_adequate( "0.2.34", "> 0.2.33")
- assert_adequate( "1.0", "= 1.0")
- assert_adequate( "1.0", "1.0")
- assert_adequate( "1.8.2", "> 1.8.0")
- assert_adequate( "1.112", "> 1.111")
- assert_adequate( "0.2", "> 0.0.0")
- assert_adequate( "0.0.0.0.0.2", "> 0.0.0")
- assert_adequate( "0.0.1.0", "> 0.0.0.1")
- assert_adequate( "10.3.2", "> 9.3.2")
- assert_adequate( "1.0.0.0", "= 1.0")
- assert_adequate( "10.3.2", "!= 9.3.4")
- assert_adequate( "10.3.2", "> 9.3.2")
- assert_adequate( "10.3.2", "> 9.3.2")
- assert_adequate( " 9.3.2", ">= 9.3.2")
- assert_adequate( "9.3.2 ", ">= 9.3.2")
- assert_adequate( "", "= 0")
- assert_adequate( "", "< 0.1")
- assert_adequate( " ", "< 0.1 ")
- assert_adequate( "", " < 0.1")
- assert_adequate( " ", "> 0.a ")
- assert_adequate( "", " > 0.a")
- assert_adequate( "0", "=")
- assert_adequate( "0", ">=")
- assert_adequate( "0", "<=")
- assert_adequate( "3.1", "< 3.2.rc1")
- assert_adequate( "3.2.0", "> 3.2.0.rc1")
- assert_adequate( "3.2.0.rc2", "> 3.2.0.rc1")
- assert_adequate( "3.0.rc2", "< 3.0")
- assert_adequate( "3.0.rc2", "< 3.0.0")
- assert_adequate( "3.0.rc2", "< 3.0.1")
- end
-
- def test_parse_parts_from_version_string
- assert_equal [], part_values(Gem::Version.new("").parse_parts_from_version_string)
- assert_equal [1], part_values(Gem::Version.new("1").parse_parts_from_version_string)
- assert_equal [1, 0], part_values(Gem::Version.new("1.0").parse_parts_from_version_string)
- assert_equal [1, 0, "a"], part_values(Gem::Version.new("1.0.a").parse_parts_from_version_string)
- end
-
- def test_prerelease
- assert Gem::Version.new('1.2.0.a').prerelease?
- assert Gem::Version.new('2.9.b').prerelease?
- assert Gem::Version.new('22.1.50.0.d').prerelease?
-
- refute Gem::Version.new('1.2.0').prerelease?
- refute Gem::Version.new('2.9').prerelease?
- refute Gem::Version.new('22.1.50.0').prerelease?
- end
-
- def test_release
- assert_equal Gem::Version.new('1.2.0'), Gem::Version.new('1.2.0.a').release
- assert_equal Gem::Version.new('1.1'), Gem::Version.new('1.1.rc10').release
- assert_equal Gem::Version.new('1.9.3'), Gem::Version.new('1.9.3.alpha.5').release
- assert_equal Gem::Version.new('1.9.3'), Gem::Version.new('1.9.3').release
- end
-
- def test_satisfied_by_eh_boxed
- assert_inadequate("1.3", "~> 1.4")
- assert_adequate( "1.4", "~> 1.4")
- assert_adequate( "1.5", "~> 1.4")
- assert_inadequate("2.0", "~> 1.4")
-
- assert_inadequate("1.3", "~> 1.4.4")
- assert_inadequate("1.4", "~> 1.4.4")
- assert_adequate( "1.4.4", "~> 1.4.4")
- assert_adequate( "1.4.5", "~> 1.4.4")
- assert_inadequate("1.5", "~> 1.4.4")
- assert_inadequate("2.0", "~> 1.4.4")
-
- assert_inadequate("1.1.pre", "~> 1.0.0")
- assert_adequate( "1.1.pre", "~> 1.1")
- assert_inadequate("2.0.a", "~> 1.0")
- assert_adequate( "2.0.a", "~> 2.0")
- end
-
- def test_satisfied_by_eh_multiple
- req = [">= 1.4", "<= 1.6", "!= 1.5"]
- assert_inadequate("1.3", req)
- assert_adequate( "1.4", req)
- assert_inadequate("1.5", req)
- assert_adequate( "1.6", req)
- assert_inadequate("1.7", req)
- assert_inadequate("2.0", req)
- end
-
- def test_spaceship
- assert_equal 0, Gem::Version.new('1.0') <=> Gem::Version.new('1.0.0')
- assert_equal 1, Gem::Version.new('1.0') <=> Gem::Version.new('1.0.a')
- assert_equal 1, Gem::Version.new('1.8.2') <=> Gem::Version.new('0.0.0')
- assert_equal 1, Gem::Version.new('1.8.2') <=> Gem::Version.new('1.8.2.a')
- assert_equal 1, Gem::Version.new('1.8.2.b') <=> Gem::Version.new('1.8.2.a')
- assert_equal 0, Gem::Version.new('') <=> Gem::Version.new('0')
- end
-
- def test_boxed
- assert_inadequate("1.3", "~> 1.4")
- assert_adequate( "1.4", "~> 1.4")
- assert_adequate( "1.5", "~> 1.4")
- assert_inadequate("2.0", "~> 1.4")
-
- assert_inadequate("1.3", "~> 1.4.4")
- assert_inadequate("1.4", "~> 1.4.4")
- assert_adequate( "1.4.4", "~> 1.4.4")
- assert_adequate( "1.4.5", "~> 1.4.4")
- assert_inadequate("1.5", "~> 1.4.4")
- assert_inadequate("2.0", "~> 1.4.4")
- end
-
- def test_to_s
- v = Gem::Version.new("5.2.4")
- assert_equal "5.2.4", v.to_s
- end
-
- def assert_adequate(version, requirement)
- ver = Gem::Version.new(version)
- req = Gem::Requirement.new(requirement)
- assert req.satisfied_by?(ver),
- "Version #{version} should be adequate for Requirement #{requirement}"
- end
-
- def assert_inadequate(version, requirement)
- ver = Gem::Version.new(version)
- req = Gem::Version::Requirement.new(requirement)
- refute req.satisfied_by?(ver),
- "Version #{version} should not be adequate for Requirement #{requirement}"
- end
-
- def assert_version(actual)
- assert_equal @v1_0, actual
- assert_equal @v1_0.version, actual.version
- end
-
- def part_values(*parts)
- parts.flatten.map { |part| part.value }
- end
-end
-
-class TestGemVersionPart < RubyGemTestCase
- def test_initialize
- assert_equal 1, Gem::Version::Part.new(1).value
- assert_equal 1, Gem::Version::Part.new("1").value
- assert_equal "a", Gem::Version::Part.new("a").value
- end
-
- def test_spaceship
- assert_equal(-1, Gem::Version::Part.new(1) <=> Gem::Version::Part.new(2))
- assert_equal( 0, Gem::Version::Part.new(2) <=> Gem::Version::Part.new(2))
- assert_equal( 1, Gem::Version::Part.new(2) <=> Gem::Version::Part.new(1))
-
- assert_equal(-1, Gem::Version::Part.new("a") <=> Gem::Version::Part.new("b"))
- assert_equal( 0, Gem::Version::Part.new("b") <=> Gem::Version::Part.new("b"))
- assert_equal( 1, Gem::Version::Part.new("b") <=> Gem::Version::Part.new("a"))
-
- assert_equal(-1, Gem::Version::Part.new("a") <=> Gem::Version::Part.new(1))
- assert_equal( 1, Gem::Version::Part.new(1) <=> Gem::Version::Part.new("a"))
- end
-
- def test_succ
- assert_equal 2, Gem::Version::Part.new(1).succ.value
- assert_equal "b", Gem::Version::Part.new("a").succ.value
- end
-end
-
diff --git a/test/rubygems/test_gem_version_option.rb b/test/rubygems/test_gem_version_option.rb
deleted file mode 100644
index 1a47e9ce15..0000000000
--- a/test/rubygems/test_gem_version_option.rb
+++ /dev/null
@@ -1,89 +0,0 @@
-require File.join(File.expand_path(File.dirname(__FILE__)), 'gemutilities')
-require 'rubygems/command'
-require 'rubygems/version_option'
-
-class TestGemVersionOption < RubyGemTestCase
-
- def setup
- super
-
- @cmd = Gem::Command.new 'dummy', 'dummy'
- @cmd.extend Gem::VersionOption
- end
-
- def test_add_platform_option
- @cmd.add_platform_option
-
- assert @cmd.handles?(%w[--platform x86-darwin])
- end
-
- def test_add_version_option
- @cmd.add_version_option
-
- assert @cmd.handles?(%w[--version >1])
- end
-
- def test_enables_prerelease
- @cmd.add_version_option
-
- @cmd.handle_options %w[mygem -v 0.2.0.a]
- assert @cmd.options[:prerelease]
-
- @cmd.handle_options %w[mygem -v 0.2.0]
- refute @cmd.options[:prerelease]
-
- @cmd.handle_options %w[mygem]
- refute @cmd.options[:prerelease]
- end
-
- def test_platform_option
- @cmd.add_platform_option
-
- @cmd.handle_options %w[--platform x86-freebsd6 --platform x86-freebsd7]
-
- expected = [
- Gem::Platform::RUBY,
- Gem::Platform.new('x86-freebsd6'),
- Gem::Platform.new('x86-freebsd7'),
- ]
-
- assert_equal expected, Gem.platforms
- end
-
- def test_platform_option_ruby
- @cmd.add_platform_option
-
- @cmd.handle_options %w[--platform ruby]
-
- expected = [
- Gem::Platform::RUBY
- ]
-
- assert_equal expected, Gem.platforms
- end
-
- def test_platform_option_twice
- @cmd.add_platform_option
-
- @cmd.handle_options %w[--platform x86-freebsd6 --platform x86-freebsd-6]
-
- expected = [
- Gem::Platform::RUBY,
- Gem::Platform.new('x86-freebsd6'),
- ]
-
- assert_equal expected, Gem.platforms
- end
-
- def test_version_option
- @cmd.add_version_option
-
- @cmd.handle_options %w[--version >1]
-
- expected = { :version => Gem::Requirement.new('> 1'), :args => [] }
-
- assert_equal expected, @cmd.options
- end
-
-end
-
diff --git a/test/rubygems/test_kernel.rb b/test/rubygems/test_kernel.rb
deleted file mode 100644
index 9dd63b85d7..0000000000
--- a/test/rubygems/test_kernel.rb
+++ /dev/null
@@ -1,65 +0,0 @@
-#--
-# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
-# All rights reserved.
-# See LICENSE.txt for permissions.
-#++
-
-require File.join(File.expand_path(File.dirname(__FILE__)), 'gemutilities')
-require 'rubygems/package'
-
-class TestKernel < RubyGemTestCase
-
- def setup
- super
-
- @old_path = $:.dup
-
- util_make_gems
- end
-
- def teardown
- super
-
- $:.replace @old_path
- end
-
- def test_gem
- assert gem('a', '= 1'), "Should load"
- assert $:.any? { |p| %r{a-1/lib} =~ p }
- assert $:.any? { |p| %r{a-1/bin} =~ p }
- end
-
- def test_gem_redundent
- assert gem('a', '= 1'), "Should load"
- refute gem('a', '= 1'), "Should not load"
- assert_equal 1, $:.select { |p| %r{a-1/lib} =~ p }.size
- assert_equal 1, $:.select { |p| %r{a-1/bin} =~ p }.size
- end
-
- def test_gem_overlapping
- assert gem('a', '= 1'), "Should load"
- refute gem('a', '>= 1'), "Should not load"
- assert_equal 1, $:.select { |p| %r{a-1/lib} =~ p }.size
- assert_equal 1, $:.select { |p| %r{a-1/bin} =~ p }.size
- end
-
- def test_gem_conflicting
- assert gem('a', '= 1'), "Should load"
-
- ex = assert_raises Gem::LoadError do
- gem 'a', '= 2'
- end
-
- assert_match(/activate a \(= 2, runtime\)/, ex.message)
- assert_match(/activated a-1/, ex.message)
- assert_equal 'a', ex.name
- assert_equal Gem::Requirement.new('= 2'), ex.version_requirement
-
- assert $:.any? { |p| %r{a-1/lib} =~ p }
- assert $:.any? { |p| %r{a-1/bin} =~ p }
- refute $:.any? { |p| %r{a-2/lib} =~ p }
- refute $:.any? { |p| %r{a-2/bin} =~ p }
- end
-
-end
-
diff --git a/test/runner.rb b/test/runner.rb
index 3f1c8abc19..d274bc8929 100644
--- a/test/runner.rb
+++ b/test/runner.rb
@@ -1,25 +1,7 @@
-require 'rbconfig'
-exit if CROSS_COMPILING
-
require 'test/unit'
-src_testdir = File.dirname(File.expand_path(__FILE__))
-srcdir = File.dirname(src_testdir)
+rcsid = %w$Id$
+Version = rcsid[2].scan(/\d+/).collect!(&method(:Integer)).freeze
+Release = rcsid[3].freeze
-Test::Unit.setup_argv {|files|
- if files.empty?
- [src_testdir]
- else
- files.map {|f|
- if File.exist? "#{src_testdir}/#{f}"
- "#{src_testdir}/#{f}"
- elsif File.exist? "#{srcdir}/#{f}"
- "#{srcdir}/#{f}"
- elsif File.exist? f
- f
- else
- raise ArgumentError, "not found: #{f}"
- end
- }
- end
-}
+exit Test::Unit::AutoRunner.run(true, File.dirname($0))
diff --git a/test/scanf/data.txt b/test/scanf/data.txt
deleted file mode 100644
index 302cfd0089..0000000000
--- a/test/scanf/data.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-this is 33 a fun
-little input file
-
-with
-
-characters
diff --git a/test/scanf/test_scanf.rb b/test/scanf/test_scanf.rb
deleted file mode 100644
index 893b51e736..0000000000
--- a/test/scanf/test_scanf.rb
+++ /dev/null
@@ -1,320 +0,0 @@
-# $Id$
-#
-# scanf for Ruby
-#
-# Unit tests
-#
-
-require 'scanf.rb'
-require 'test/unit'
-require 'tmpdir'
-
-# Comment out either of these lines to skip those tests.
-
-class TestStringScanf < Test::Unit::TestCase;end
-class TestIOScanf < Test::Unit::TestCase;end
-
-module ScanfTests
-
- def tests
- [
-
-# Scratchpad
- [ "%2[a]", "nbc", []],
- [ "%*d %*3d %*s", "123 +456 abc", [] ],
- [ "%d%c", "123 x", [ 123, " " ] ],
- [ "%d%c", "123x", [ 123, "x" ] ],
- [ "%d %c", "123x", [ 123, "x" ] ],
- [ "%d %c", "123 x", [ 123, "x" ] ],
-
-# Testing failures
- [ "%x", "x", [] ],
- [ "%2x", "x", [] ],
- [ "%i", "x", [] ],
-# ]; end; def nothing; [
- [ "%2i", "x", [] ],
- [ "%2o", "x", [] ],
- [ "%d", "x", [] ],
- [ "%2d", "x", [] ],
- [ "%3d", "+x3", [] ],
- [ "%d%[abc]", "eabc", [] ],
- [ "%d\n%[abc]", "\neabc", [] ],
- [ "%d%[^abc]", "ghiabc", [ ] ],
- [ "%d%[abc]", "abc", [] ],
- [ "%*d %*3d %*s", "123 +456 abc", [] ],
- [ "%d%s", "", [] ],
- [ "%d%s", "blah 123 string", [] ],
- [ "%[\n]", "abc\n", [] ],
- [ "%[\n]", "abc\n", [] ],
- [ "%[\n]", "abc\n", [] ],
- [ "%f", "x", [] ],
- [ "%f", "z", [] ],
- [ "%f", "z3.2534", [] ],
- [ "", "", [] ],
- [ "", "abc 123", [] ],
- [ '%[^\\w]%c', "a...1", [] ],
-
-# Testing 'x'
- [ "%3x", "0xz", [0] ],
-
-# Testing 'i'
- [ "%3i", "097", [0] ],
- [ "%3i", "0xz", [0] ],
- [ "%1i", "3", [ 3 ] ],
- [ "%2i", "07", [ 7 ] ],
- [ "%2i", "0a", [ 0 ] ],
-
-# Testing 'c'
- [ "%3c", "abc", [ "abc" ] ],
- [ "%3c", "a\nb", [ "a\nb" ] ],
- [ "%3c", "a\nbcd", [ "a\nb" ] ],
- [ "%c\n\n", "x\n\n", [ "x" ] ],
- [ "%c\n\n", "x\n\n", [ "x" ] ],
- [ "%c", "\n", [ "\n" ] ],
- [ "%c", "x\n", [ "x" ] ],
- [ "%2c", " 123", [" 1"] ],
- [ " %c", " x", ["x"] ],
- [ "%c", " x", [" "] ],
- [ "%c", "123", ["1"] ],
- [ "%2c", "123", ["12"] ],
- [ "%5c", "a\nb\n\n", [ "a\nb\n\n" ] ],
- [ "%6c", "a\nb\n\nx", [ "a\nb\n\nx" ] ],
- [ "%5c", "ab\ncd", [ "ab\ncd" ] ],
- [ "%5c", "a\nb\n\n", [ "a\nb\n\n" ] ],
-
-# Testing 'o'
- [ "%3o", "0xz", [0] ],
-
-# Testing 'd'
- [ "%d", "\n123", [ 123 ] ],
- [ "%d", "\n\n123", [ 123 ] ],
- [ "%d", "\n123", [ 123 ] ],
- [ "%1d", "2", [2] ],
-
-# Mixed tests
-# Includes:
-# whitespace/newline
-# mixed integer bases
-# various mixed specifiers
-
- [ "%[^\\w]%c", "...1", [ "...", "1"] ],
- [ '%[^\\w]%c', "...1", [ "...", "1"] ],
- [ "%[abc\n]%d", "a\n\nb\n\nc 123", [ "a\n\nb\n\nc", 123 ] ],
- [ "%[abc\n]%d", "a\n\nb\n\nc \t 123", [ "a\n\nb\n\nc", 123 ] ],
- [ "%[abc\t]%d", "a\t\tb\t\tc 123", [ "a\t\tb\t\tc", 123 ] ],
- [ "%d%3[abc\n]", "123a\nbeaab", [ 123, "a\nb" ] ],
- [ "%d%20c", "42 is the key", [ 42, " is the key" ] ],
- [ "%d %20c", "42 is the key", [ 42, "is the key" ] ],
- [ "%d%3[^abc\n]%d", "123de\nf123", [ 123, "de" ] ],
- [ "%d %4c", "3abc", [ 3, "abc" ] ],
- [ "%f%d\n%[abc]", "1\neabc", [1.0] ],
- [ "%d%3[abc]", "123aaab", [ 123, "aaa" ] ],
- [ "%d%3[abc]", "123 aaab", [ 123 ] ],
- [ "%d%3[abc]", "123aeaab", [ 123, "a" ] ],
- [ "%d%[^abc]", "123defabc", [123, "def" ] ],
- [ "%d%3[^abc]", "123defdef", [ 123, "def" ] ],
- [ "%d%3[^abc] ", "123defdef ", [ 123, "def" ] ],
- [ "%d%3[^abc]ghi", "123defghi", [ 123, "def" ] ],
- [ "%d%3[^abc]", "123defdef", [ 123, "def" ] ],
- [ "%d%3[^abc]", "123adefdef", [ 123 ] ],
- [ "%d%3[^abc]", "123deafdef", [ 123, "de" ] ],
- [ "%d%3[^abc\n]", "123de\nf", [ 123, "de" ] ],
- [ "%s%c%c%s", "abc\n\ndef", ["abc", "\n","\n", "def" ] ],
- [ "%c%d", "\n\n123", [ "\n",123 ] ],
- [ "%s%c%d", "abc\n123", [ "abc", "\n", 123 ] ],
- [ "%s%c%d", "abc\n\n123", [ "abc", "\n", 123 ] ],
- [ "%c%d", "\t\n123", [ "\t",123 ] ],
- [ "%s%c%d", "abc\t\n123", [ "abc", "\t", 123 ] ],
- [ "%3c%d", "abc123", [ "abc", 123 ] ],
- [ "%3c\n%d", "abc123", [ "abc", 123 ] ],
- [ "%3c\n%d", "abc 123", [ "abc", 123 ] ],
- [ "%3c %d", "abc123", [ "abc", 123 ] ],
- [ "%3c\t%d", "abc \n 123", [ "abc", 123 ] ],
- [ "%3c\t%d", "abc \n 123 ", [ "abc", 123 ] ],
- [ "%3c%d", "a\nb123", [ "a\nb", 123 ] ],
- [ "%f%3c", "1.2x\ny", [ 1.2, "x\ny"] ],
- [ "%d\n%d\n%d", "123 456 789", [ 123,456,789 ] ],
- [ "%d\n%i%2d%x\n%d", "123 0718932", [ 123, 071, 89, 0x32] ],
- [ "%c\n%c", "x y", [ "x", "y" ] ],
- [ "%c\t%c", "x y", [ "x", "y" ] ],
- [ "%s\n%s", "x y", [ "x", "y" ] ],
- [ "%s%s\n", "x y", [ "x", "y" ] ],
- [ "%c\n\n%c", "x\n\ny", [ "x", "y" ] ],
- [ "%s%d%d", "abc\n123\n456", [ "abc", 123, 456 ] ],
- [ "%3s%c%3c%d", "1.2x\n\ny123", [ "1.2", "x", "\n\ny", 123 ] ],
- [ "%f%3c", "1.2x\ny", [ 1.2, "x\ny"] ],
- [ "%c\n%c", "x\n\ny", [ "x", "y" ] ],
- [ "%c\n\n%c", "x\n\ny", [ "x", "y" ] ],
- [ "%c %c", "x\n\ny", [ "x", "y" ] ],
- [ "%s\n\n%c", "x\n\ny", [ "x", "y" ] ],
- [ "%s\n\n%s", "x\n\ny", [ "x", "y" ] ],
- [ "%d\n\n%d", "23\n\n45", [ 23, 45 ] ],
- [ "%d\n%d", "23\n\n45", [ 23, 45 ] ],
- [ "%c\n\n%c", "x y", [ "x", "y" ] ],
- [ "%c%c", "x\n\ny", [ "x", "\n" ] ],
- [ "%c\n%c", "x y", [ "x", "y" ] ],
- [ "%c\t%c", "x y", [ "x", "y" ] ],
- [ "%s\n%s", "x y", [ "x", "y" ] ],
- [ "%s%s\n", "x y", [ "x", "y" ] ],
- [ "%c%c", "x\n", [ "x", "\n" ] ],
- [ "%d%c%c%d", "345 678", [ 345, " ", " ", 678] ],
- [ "%d %c%s", "123 x hello", [123, "x", "hello"] ],
- [ "%d%2c", "654 123", [654," 1"] ],
- [ "%5c%s", "a\nb\n\nxyz", [ "a\nb\n\n","xyz" ] ],
- [ "%s%[ xyz]%d", "hello x 32", ["hello", " x ", 32] ],
- [ "%5s%8[a-z]%d", "helloblahblah 32", ["hello", "blahblah", 32] ],
- [ '%s%[abcde\\s]%d', "hello badea 32", ["hello", " badea ", 32] ],
- [ '%d%[\\s]%c', "123 \n\t X", [ 123," \n\t ", "X"] ],
- [ "%4s%2c%c", "1.2x\n\ny", [ "1.2x", "\n\n","y"] ],
- [ "%f%c %3c%d", "1.2x\n\ny123", [ 1.2, "x", "y12", 3 ] ],
- [ "%s%5c", "abc ab\ncd", [ "abc", " ab\nc" ] ],
- [ "%5c%f", "ab\ncd1.2", [ "ab\ncd",1.2 ] ],
- [ "%5c%c", "ab\ncd1", [ "ab\ncd","1" ] ],
- [ "%f%c%2c%d", "1.2x\ny123", [ 1.2, "x", "\ny", 123 ] ],
- [ "%f%c%3c", "1.2x\ny123", [ 1.2, "x", "\ny1"] ],
- [ "%s\n%s", "blah\n\nand\nmore stuff", [ "blah", "and" ] ],
- [ "%o%d%x", "21912a3", [ "21".oct, 912, "a3".hex ] ],
- [ "%3o%4d%3x", "21912a3", [ "21".oct, 912, "a3".hex ] ],
- [ "%3o%4d%5x", "2191240xa3", [ "21".oct, 9124, "a3".hex ] ],
- [ "%3d%3x", "12abc", [12, "abc".hex] ],
- [ "%s%i%d", "hello +0xdef 123", [ "hello", "def".hex, 123] ],
- [ "%s%i%d", "hello -0xdef 123", [ "hello", -"def".hex, 123] ],
- [ "%s%i%i%i%i", "hello 012 -012 100 1", [ "hello", 10, -10, 100, 1 ] ],
- [ "%s%i%i%i%i", "hello 012 0x12 100 1", [ "hello", 10, 18, 100, 1 ] ],
- [ "%s%5i%3i%4i", "hello 0x123 123 0123", [ "hello", "0x123".hex, 123,"0123".oct] ],
- [ "%s%3i%4i", "hello 1230123", [ "hello", 123,"0123".oct] ],
- [ "%s%3i", "hello 1230", [ "hello", 123] ],
- [ "%s%5x%d", "hello 0xdef 123", [ "hello", "def".hex, 123] ],
- [ "%s%6x%d", "hello +0xdef 123", [ "hello", "def".hex, 123] ],
- [ "%s%6x%d", "hello -0xdef 123", [ "hello", -"def".hex, 123] ],
- [ "%s%6x%d", "hello -0xdef 123", [ "hello", -"def".hex, 123] ],
- [ "%s%4x%d", "hello -def 123", [ "hello", -"def".hex, 123] ],
- [ "%s%3x%d", "hello def 123", [ "hello", "def".hex, 123] ],
- [ "%s%x%d", "hello -def 123", [ "hello", -"def".hex, 123] ],
- [ "%s%x%d", "hello -0xdef 123", [ "hello", -"def".hex, 123] ],
- [ "%s%x%d", "hello 0xdef 123", [ "hello", "def".hex, 123] ],
- [ "%s%d%x%s", "hello 123 abc def", [ "hello", 123, "abc".hex, "def"] ],
- [ "%s%d%o%d", "hello 012 012 100", [ "hello", 12, 10, 100 ] ],
- [ "%s%d%o%d", "hello 012 -012 100", [ "hello", 12, -10, 100 ] ],
- [ "%s%o%x%d", "hello 012 0x12 100", [ "hello", 10, 18, 100 ] ],
- [ "%s%d%o%d", "hello 012 +01288", [ "hello", 12, 10, 88 ] ],
- [ "%f %d %s", "12.3e23 45 string", ["12.3e23".to_f, 45, "string"] ],
- [ "%f %d %s", "12.3e+23 45 string", ["12.3e23".to_f, 45, "string"] ],
- [ "%f %d %s", "12.3e-23 45 string", ["12.3e-23".to_f, 45, "string"] ],
- [ "%f %d %s", "12.3e23 45 string", ["12.3e23".to_f, 45, "string"] ],
- [ "%f %d %s", "-12.3e-23 45 string", ["-12.3e-23".to_f, 45, "string"] ],
- [ "%f %d %s", "12.e23 45 string", ["12.e23".to_f, 45, "string"] ],
- [ "%5f %d %s", "1.2e23 string", ["1.2e2".to_f, 3, "string"] ],
- [ "%5f%d %s", "1.2e23 string", ["1.2e2".to_f, 3, "string"] ],
- [ "%5f%d %d %s", "1.2e23 45 string", ["1.2e2".to_f, 3, 45, "string"] ],
- [ "%6f %d %d %s", "+1.2e23 45 string", ["1.2e2".to_f, 3, 45, "string"] ],
- [ "%d %d", "123 \n 345", [123, 345] ],
- [ "%d %*d", "123 \n 345", [123] ],
- [ "%d %3d789", "123 +45789", [123, 45] ],
- [ "%d %3d%d", "123 +456789", [123, 45, 6789] ],
- [ "%d %3dabc", "123 456abc", [123, 456] ],
- [ "%d %s", "123abc", [123, "abc"] ],
- [ "%d%s %s", "123 abc def", [123, "abc", "def"] ],
- [ "%s%s", "abc123 def", ["abc123", "def"] ],
- [ "%s%s %s", "123 abc def", ["123", "abc", "def"] ],
- [ "%s%%%s", "abc % def", ["abc", "def"] ],
- [ "%d %3d %s", "+123 456abc", [123, 456, "abc"] ],
- [ "%d %3d %s", "123 456abc", [123, 456, "abc"] ],
- [ "%d %3d %s", "123 +456 abc", [123, 45, "6"] ],
- [ "%d %3d %s", "-123-456abc", [-123, -45, "6abc"] ],
- [ "%dabc%d", "123abc345", [123, 345] ],
- [ "%d%5s%d", "123 abcde12", [123, "abcde", 12] ],
- [ "%5d%5s%5d", "12345abcde67890", [12345, "abcde", 67890] ],
- [ "%5d%*5s%5d", "12345abcde67890", [12345, 67890] ],
- [ " 12345%5s%5d", "12345abcde67890", [ "abcde", 67890] ],
- [ "%5dabcde%5d", "12345abcde67890", [ 12345, 67890] ],
- [ "%s%%%*s", "abc % def", ["abc"] ],
- [ "%*6s %d", "string 123", [123] ],
- [ "%d %*3d %s", "-123-456abc", [-123, "6abc"] ],
- [ "%d%s", "123", [123] ],
- [ "%s%d", "abc", ["abc"] ],
- [ "%f%x", "3.2e45x", ["3.2e45x".to_f] ],
- [ "%s%d", "abc", ["abc"] ],
- [ "%*5f%d %d %s", "1.2e23 45 string", [3, 45, "string"] ],
- [ "%5f%*d %d %s", "1.2e23 45 string", ["1.2e2".to_f, 45, "string"] ],
- [ "%*5f%*d %*d %s", "1.2e23 45 string", ["string"] ],
- [ "%f %*d %s", "12.e23 45 string", ["12.e23".to_f, "string"] ],
- [ "%5f %d %s", "1.2e23 string", ["1.2e2".to_f, 3, "string"] ],
- [ "%s %f %s %d %x%c%c%c%c",
- "float: 1.2e23 dec/hex: 135a23 abc",
- ["float:", "1.2e23".to_f, "dec/hex:", 135, "a23".hex, " ", "a", "b", "c" ] ],
-
-# Testing 's'
- [ "%s\n", "blah\n\n\n", [ "blah" ] ],
-
-# Testing '['
- [ "%[a\nb]", "a\nb", [ "a\nb" ] ],
- [ "%[abc]", "acb", [ "acb" ] ],
- [ "%[abc\n]", "a\nb", [ "a\nb" ] ],
- [ "%[^abc]", "defabc", [ "def" ] ],
- [ "%[-abc]", "abc-cba", [ "abc-cba" ] ],
- [ "%[\n]", "\n", [ "\n" ] ],
- [ "%[\n]", "\nabc", [ "\n" ] ],
- [ "%[\n\t]", "\t\n", [ "\t\n" ] ],
- [ "%[a-f]", "abczef", [ "abc" ] ],
- [ "%d%3[abc]", "123 aaab", [ 123 ] ],
- [ "%d%3[^abc]", "123adefdef", [ 123 ] ],
- [ "%d%3[[:lower:]] %f", "123ade1.2", [ 123,"ade",1.2 ] ],
- [ "%d%3[[:lower:]] %f", "123ad1.2", [ 123,"ad",1.2 ] ],
- [ "%d%3[[:lower:]] %f", "123 ad1.2", [ 123 ] ],
- [ "%d%[[:lower:]]", "123abcdef1.2", [ 123, "abcdef" ] ],
- [ "%[[:lower:]]%d", "abcdef123", [ "abcdef", 123 ] ],
- [ "%[[:digit:]]%[[:alpha:]]", "123abcdef", [ "123", "abcdef" ] ],
- [ "%[[:digit:]]%d", "123 123", [ "123", 123 ] ],
- [ "%[[:upper:]]", "ABCdefGHI", [ "ABC" ] ],
-
-# Testing 'f'
- [ "%2f", "x", [0.0] ], # width-floats match anything (by design)
- [ "%f", "1.23e45", [1.23e+45] ],
- [ "%f", "3.25ee", [3.25] ],
- [ "%f", "3..25", [3.0] ],
- [ "%f", "+3.25", [3.25] ],
- [ "%f", "+3.25e2", [325.0] ],
- [ "%f", "3.z", [3.0] ],
-
-# Testing embedded matches including literal '[' behavior
- [",%d,%f", ",10,1.1", [10,1.1] ],
- [" ,%d,%f", " ,10,1.1", [10,1.1] ],
- ["[%d,%f", "[10,1.1", [10,1.1] ],
- [" [%d,%f", " [10,1.1", [10,1.1] ],
-
- ]
- end
-end
-
-class TestStringScanf
- include Scanf
- extend ScanfTests
-
- i = 1
- self.tests.each do |test|
- define_method("test_#{i}") do ||
- assert_equal(test[2], test[1].scanf(test[0]))
- end
- i += 1
- end
-end
-
-class TestIOScanf
- include Scanf
- extend ScanfTests
-
- tmpfilename = "#{Dir.tmpdir}/iotest.dat.#{$$}"
-
- i = 1
- self.tests.each do |test|
- define_method("test_#{i}") do ||
- File.open(tmpfilename, "w") {|fh| fh.print test[1]}
- File.open(tmpfilename, "r") { |fh|
- assert_equal(test[2], fh.scanf(test[0]))
- }
- File.delete(tmpfilename)
- end
- i += 1
- end
-end
diff --git a/test/scanf/test_scanfblocks.rb b/test/scanf/test_scanfblocks.rb
deleted file mode 100644
index aea5033a54..0000000000
--- a/test/scanf/test_scanfblocks.rb
+++ /dev/null
@@ -1,81 +0,0 @@
-# $Id$
-#
-# scanf for Ruby
-#
-# Some not very comprehensive tests of block behavior.
-
-
-require 'test/unit'
-require 'scanf'
-require 'tmpdir'
-
-class TestScanfBlock < Test::Unit::TestCase
-
- def setup
- @str = <<-EOS
- Beethoven 1770
- Bach 1685
- Handel 1685
- Scarlatti 1685
- Brahms 1833
- EOS
- end
-
-alias set_up setup
- def test_str1
- res = @str.scanf("%s%d") { |name, year| "#{name} was born in #{year}." }
- assert_equal(res,
- [ "Beethoven was born in 1770.",
- "Bach was born in 1685.",
- "Handel was born in 1685.",
- "Scarlatti was born in 1685.",
- "Brahms was born in 1833." ])
- end
-
- def test_str2
- names = @str.scanf("%s%d") { |name, year| name.upcase }
- assert_equal(names, ["BEETHOVEN", "BACH", "HANDEL", "SCARLATTI", "BRAHMS"])
- end
-
- def test_str3
- assert_equal("".scanf("%d%f%s") {}, [])
- end
-
- def test_str4
- assert_equal("abc".scanf("%d%f%s") {}, [])
- end
-
- def test_str5
- assert_equal("abc".scanf("") {}, [])
- end
-
- def test_io1
- fn = "#{Dir.tmpdir}/iotest.dat.#{$$}"
- File.open(fn, "w") { |fh| fh.puts(@str) }
- fh = File.open(fn, "rb")
- res = fh.scanf("%s%d") { |name, year| "#{name} was born in #{year}." }
-
- assert_equal(
- [ "Beethoven was born in 1770.",
- "Bach was born in 1685.",
- "Handel was born in 1685.",
- "Scarlatti was born in 1685.",
- "Brahms was born in 1833." ],res)
- fh.close
- ensure
- File.delete(fn)
- end
-
- def test_io2
- fn = "#{Dir.tmpdir}/iotest.dat.#{$$}"
- File.open(fn, "w").close
- fh = File.open(fn,"rb")
- assert_equal(fh.scanf("") {}, [])
- fh.seek(0)
- assert_equal(fh.scanf("%d%f%s") {}, [])
- fh.close
- ensure
- File.delete(fn)
- end
-
-end
diff --git a/test/scanf/test_scanfio.rb b/test/scanf/test_scanfio.rb
deleted file mode 100644
index c8740aed43..0000000000
--- a/test/scanf/test_scanfio.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-# $Id$
-#
-# scanf for Ruby
-#
-# Ad hoc tests of IO#scanf (needs to be expanded)
-
-
-require "scanf"
-
-class TestScanfIO
- def test_io
- fh = File.new(File.join(File.dirname(__FILE__), "data.txt"), "r")
- assert_equal(0, fh.pos)
- assert_equal(["this", "is"], fh.scanf("%s%s"))
- assert_equal([33, "littel"], fh.scanf("%da fun%s"))
- #p fh.pos
- end
-end
-
diff --git a/test/sdbm/test_sdbm.rb b/test/sdbm/test_sdbm.rb
index b94e198e95..8789d719dd 100644
--- a/test/sdbm/test_sdbm.rb
+++ b/test/sdbm/test_sdbm.rb
@@ -1,5 +1,4 @@
require 'test/unit'
-require 'tmpdir'
begin
require 'sdbm'
@@ -8,9 +7,7 @@ end
class TestSDBM < Test::Unit::TestCase
def setup
- @tmpdir = Dir.mktmpdir("tmptest_sdbm")
- @prefix = "tmptest_sdbm_#{$$}"
- @path = "#{@tmpdir}/#{@prefix}_"
+ @path = "tmptest_sdbm_"
assert_instance_of(SDBM, @sdbm = SDBM.new(@path))
end
def teardown
@@ -18,7 +15,8 @@ class TestSDBM < Test::Unit::TestCase
ObjectSpace.each_object(SDBM) do |obj|
obj.close unless obj.closed?
end
- FileUtils.remove_entry_secure @tmpdir
+ File.delete *Dir.glob("tmptest_sdbm*").to_a
+ p Dir.glob("tmptest_sdbm*") if $DEBUG
end
def check_size(expect, sdbm=@sdbm)
@@ -49,26 +47,26 @@ class TestSDBM < Test::Unit::TestCase
def test_s_new_has_no_block
# SDBM.new ignore the block
foo = true
- assert_instance_of(SDBM, sdbm = SDBM.new("#{@tmpdir}/#{@prefix}") { foo = false })
+ assert_instance_of(SDBM, sdbm = SDBM.new("tmptest_sdbm") { foo = false })
assert_equal(foo, true)
assert_nil(sdbm.close)
end
def test_s_open_no_create
- assert_nil(sdbm = SDBM.open("#{@tmpdir}/#{@prefix}", nil))
+ assert_nil(sdbm = SDBM.open("tmptest_sdbm", nil))
ensure
sdbm.close if sdbm
end
def test_s_open_with_block
- assert_equal(SDBM.open("#{@tmpdir}/#{@prefix}") { :foo }, :foo)
+ assert_equal(SDBM.open("tmptest_sdbm") { :foo }, :foo)
end
=begin
# Is it guaranteed on many OS?
def test_s_open_lock_one_process
# locking on one process
- assert_instance_of(SDBM, sdbm = SDBM.open("#{@tmpdir}/#{@prefix}", 0644))
+ assert_instance_of(SDBM, sdbm = SDBM.open("tmptest_sdbm", 0644))
assert_raise(Errno::EWOULDBLOCK) {
begin
- SDBM.open("#{@tmpdir}/#{@prefix}", 0644)
+ SDBM.open("tmptest_sdbm", 0644)
rescue Errno::EAGAIN
raise Errno::EWOULDBLOCK
end
@@ -83,8 +81,8 @@ class TestSDBM < Test::Unit::TestCase
end
return unless have_fork? # snip this test
- pid = fork() {
- assert_instance_of(SDBM, sdbm = SDBM.open("#{@tmpdir}/#{@prefix}", 0644,
+ fork() {
+ assert_instance_of(SDBM, sdbm = SDBM.open("tmptest_sdbm", 0644,
SDBM::NOLOCK))
sleep 2
}
@@ -92,17 +90,17 @@ class TestSDBM < Test::Unit::TestCase
begin
sdbm2 = nil
assert_no_exception(Errno::EWOULDBLOCK, Errno::EAGAIN, Errno::EACCES) {
- assert_instance_of(SDBM, sdbm2 = SDBM.open("#{@tmpdir}/#{@prefix}", 0644))
+ assert_instance_of(SDBM, sdbm2 = SDBM.open("tmptest_sdbm", 0644))
}
ensure
- Process.wait pid
+ Process.wait
sdbm2.close if sdbm2
end
- p Dir.glob("#{@tmpdir}/#{@prefix}*") if $DEBUG
+ p Dir.glob("tmptest_sdbm*") if $DEBUG
- pid = fork() {
- assert_instance_of(SDBM, sdbm = SDBM.open("#{@tmpdir}/#{@prefix}", 0644))
+ fork() {
+ assert_instance_of(SDBM, sdbm = SDBM.open("tmptest_sdbm", 0644))
sleep 2
}
begin
@@ -110,25 +108,26 @@ class TestSDBM < Test::Unit::TestCase
sdbm2 = nil
assert_no_exception(Errno::EWOULDBLOCK, Errno::EAGAIN, Errno::EACCES) {
# this test is failed on Cygwin98 (???)
- assert_instance_of(SDBM, sdbm2 = SDBM.open("#{@tmpdir}/#{@prefix}", 0644,
+ assert_instance_of(SDBM, sdbm2 = SDBM.open("tmptest_sdbm", 0644,
SDBM::NOLOCK))
}
ensure
- Process.wait pid
+ Process.wait
sdbm2.close if sdbm2
end
end
def test_s_open_error
- assert_instance_of(SDBM, sdbm = SDBM.open("#{@tmpdir}/#{@prefix}", 0))
+ return if /(ms|bcc)win|mingw|djgpp/ =~ RUBY_PLATFORM
+ assert_instance_of(SDBM, sdbm = SDBM.open("tmptest_sdbm", 0))
assert_raise(Errno::EACCES) {
- SDBM.open("#{@tmpdir}/#{@prefix}", 0)
+ SDBM.open("tmptest_sdbm", 0)
}
sdbm.close
end
def test_close
- assert_instance_of(SDBM, sdbm = SDBM.open("#{@tmpdir}/#{@prefix}"))
+ assert_instance_of(SDBM, sdbm = SDBM.open("tmptest_sdbm"))
assert_nil(sdbm.close)
# closed SDBM file
@@ -199,12 +198,19 @@ class TestSDBM < Test::Unit::TestCase
}
end
- def test_key
+ def test_index
assert_equal('bar', @sdbm['foo'] = 'bar')
- assert_equal('foo', @sdbm.key('bar'))
+ assert_equal('foo', @sdbm.index('bar'))
assert_nil(@sdbm['bar'])
end
+ def test_indexes
+ keys = %w(foo bar baz)
+ values = %w(FOO BAR BAZ)
+ @sdbm[keys[0]], @sdbm[keys[1]], @sdbm[keys[2]] = values
+ assert_equal(values.reverse, @sdbm.indexes(*keys.reverse))
+ end
+
def test_values_at
keys = %w(foo bar baz)
values = %w(FOO BAR BAZ)
@@ -277,7 +283,7 @@ class TestSDBM < Test::Unit::TestCase
n = 0
ret = @sdbm.each_value {|val|
- assert_not_nil(key = @sdbm.key(val))
+ assert_not_nil(key = @sdbm.index(val))
assert_not_nil(i = keys.index(key))
assert_equal(val, values[i])
@@ -365,11 +371,14 @@ class TestSDBM < Test::Unit::TestCase
def test_delete_with_block
key = 'no called block'
@sdbm[key] = 'foo'
- assert_equal('foo', @sdbm.delete(key) {|k| k.replace 'called block'; :blockval})
+ assert_equal('foo', @sdbm.delete(key) {|k| k.replace 'called block'})
+ assert_equal('no called block', key)
assert_equal(0, @sdbm.size)
key = 'no called block'
- assert_equal(:blockval, @sdbm.delete(key) {|k| k.replace 'called block'; :blockval})
+ assert_equal(:blockval,
+ @sdbm.delete(key) {|k| k.replace 'called block'; :blockval})
+ assert_equal('called block', key)
assert_equal(0, @sdbm.size)
end
@@ -522,33 +531,4 @@ class TestSDBM < Test::Unit::TestCase
assert_equal(key.to_i, val.to_i)
}
end
-
- def test_closed
- assert_equal(false, @sdbm.closed?)
- @sdbm.close
- assert_equal(true, @sdbm.closed?)
- @sdbm = SDBM.new(@path)
- end
-
- def test_readonly
- @sdbm["bar"] = "baz"
- @sdbm.close
- File.chmod(0444, @path + ".dir")
- File.chmod(0444, @path + ".pag")
- @sdbm = SDBM.new(@path)
- assert_raise(SDBMError) { @sdbm["bar"] = "foo" }
- assert_raise(SDBMError) { @sdbm.delete("bar") }
- assert_raise(SDBMError) { @sdbm.delete_if { true } }
- assert_raise(SDBMError) { @sdbm.clear }
- assert_nil(@sdbm.store("bar", nil))
- end
-
- def test_update2
- obj = Object.new
- def obj.each_pair
- yield []
- end
- assert_raise(ArgumentError) { @sdbm.update(obj) }
- end
end
-
diff --git a/test/soap/asp.net/hello.wsdl b/test/soap/asp.net/hello.wsdl
new file mode 100644
index 0000000000..b94129c152
--- /dev/null
+++ b/test/soap/asp.net/hello.wsdl
@@ -0,0 +1,96 @@
+<?xml version="1.0" encoding="utf-8"?>
+<wsdl:definitions xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
+xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+xmlns:s="http://www.w3.org/2001/XMLSchema"
+xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
+xmlns:tns="http://localhost/WebService/"
+xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/"
+xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
+targetNamespace="http://localhost/WebService/"
+xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
+ <wsdl:types>
+ <s:schema elementFormDefault="qualified"
+targetNamespace="http://localhost/WebService/">
+ <s:element name="HelloWorld">
+ <s:complexType />
+ </s:element>
+ <s:element name="HelloWorldResponse">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1"
+name="HelloWorldResult" type="s:string" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="SayHello">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1" name="name"
+type="s:string" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="SayHelloResponse">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1"
+name="SayHelloResult" type="s:string" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ </s:schema>
+ </wsdl:types>
+ <wsdl:message name="HelloWorldSoapIn">
+ <wsdl:part name="parameters" element="tns:HelloWorld" />
+ </wsdl:message>
+ <wsdl:message name="HelloWorldSoapOut">
+ <wsdl:part name="parameters" element="tns:HelloWorldResponse" />
+ </wsdl:message>
+ <wsdl:message name="SayHelloSoapIn">
+ <wsdl:part name="parameters" element="tns:SayHello" />
+ </wsdl:message>
+ <wsdl:message name="SayHelloSoapOut">
+ <wsdl:part name="parameters" element="tns:SayHelloResponse" />
+ </wsdl:message>
+ <wsdl:portType name="Service1Soap">
+ <wsdl:operation name="HelloWorld">
+ <wsdl:input message="tns:HelloWorldSoapIn" />
+ <wsdl:output message="tns:HelloWorldSoapOut" />
+ </wsdl:operation>
+ <wsdl:operation name="SayHello">
+ <wsdl:input message="tns:SayHelloSoapIn" />
+ <wsdl:output message="tns:SayHelloSoapOut" />
+ </wsdl:operation>
+ </wsdl:portType>
+ <wsdl:binding name="Service1Soap" type="tns:Service1Soap">
+ <soap:binding transport="http://schemas.xmlsoap.org/soap/http"
+style="document" />
+ <wsdl:operation name="HelloWorld">
+ <soap:operation
+soapAction="http://localhost/WebService/HelloWorld" style="document" />
+ <wsdl:input>
+ <soap:body use="literal" />
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal" />
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="SayHello">
+ <soap:operation soapAction="http://localhost/WebService/SayHello"
+style="document" />
+ <wsdl:input>
+ <soap:body use="literal" />
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal" />
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:service name="Service1">
+ <documentation xmlns="http://schemas.xmlsoap.org/wsdl/" />
+ <wsdl:port name="Service1Soap" binding="tns:Service1Soap">
+ <soap:address
+location="http://localhost/WebService/Service1.asmx" />
+ </wsdl:port>
+ </wsdl:service>
+</wsdl:definitions>
diff --git a/test/soap/asp.net/test_aspdotnet.rb b/test/soap/asp.net/test_aspdotnet.rb
new file mode 100644
index 0000000000..7d5f3fd288
--- /dev/null
+++ b/test/soap/asp.net/test_aspdotnet.rb
@@ -0,0 +1,111 @@
+require 'test/unit'
+require 'soap/rpc/standaloneServer'
+require 'soap/rpc/driver'
+
+
+module SOAP; module ASPDotNet
+
+
+class TestASPDotNet < Test::Unit::TestCase
+ class Server < ::SOAP::RPC::StandaloneServer
+ Namespace = "http://localhost/WebService/"
+
+ def on_init
+ add_document_method(
+ self,
+ Namespace + 'SayHello',
+ 'sayHello',
+ XSD::QName.new(Namespace, 'SayHello'),
+ XSD::QName.new(Namespace, 'SayHelloResponse')
+ )
+ end
+
+ def sayHello(arg)
+ name = arg['name']
+ "Hello #{name}"
+ end
+ end
+
+ Port = 17171
+ Endpoint = "http://localhost:#{Port}/"
+
+ def setup
+ setup_server
+ @client = nil
+ end
+
+ def teardown
+ teardown_server
+ @client.reset_stream if @client
+ end
+
+ def setup_server
+ @server = Server.new('Test', Server::Namespace, '0.0.0.0', Port)
+ @server.level = Logger::Severity::ERROR
+ @server_thread = start_server_thread(@server)
+ end
+
+ def teardown_server
+ @server.shutdown
+ @server_thread.kill
+ @server_thread.join
+ end
+
+ def start_server_thread(server)
+ t = Thread.new {
+ Thread.current.abort_on_exception = true
+ server.start
+ }
+ t
+ end
+
+ def test_document_method
+ @client = SOAP::RPC::Driver.new(Endpoint, Server::Namespace)
+ @client.wiredump_dev = STDOUT if $DEBUG
+ @client.add_document_method('sayHello', Server::Namespace + 'SayHello',
+ XSD::QName.new(Server::Namespace, 'SayHello'),
+ XSD::QName.new(Server::Namespace, 'SayHelloResponse'))
+ assert_equal("Hello Mike", @client.sayHello(:name => "Mike"))
+ end
+
+ def test_aspdotnethandler
+ @client = SOAP::RPC::Driver.new(Endpoint, Server::Namespace)
+ @client.wiredump_dev = STDOUT if $DEBUG
+ @client.add_method_with_soapaction('sayHello', Server::Namespace + 'SayHello', 'name')
+ @client.default_encodingstyle = SOAP::EncodingStyle::ASPDotNetHandler::Namespace
+ assert_equal("Hello Mike", @client.sayHello("Mike"))
+ end
+
+ if defined?(HTTPAccess2)
+
+ # qualified!
+ REQUEST_ASPDOTNETHANDLER =
+%q[<?xml version="1.0" encoding="utf-8" ?>
+<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <env:Body>
+ <n1:sayHello xmlns:n1="http://localhost/WebService/">
+ <n1:name>Mike</n1:name>
+ </n1:sayHello>
+ </env:Body>
+</env:Envelope>]
+
+ def test_aspdotnethandler_envelope
+ @client = SOAP::RPC::Driver.new(Endpoint, Server::Namespace)
+ @client.wiredump_dev = str = ''
+ @client.add_method_with_soapaction('sayHello', Server::Namespace + 'SayHello', 'name')
+ @client.default_encodingstyle = SOAP::EncodingStyle::ASPDotNetHandler::Namespace
+ assert_equal("Hello Mike", @client.sayHello("Mike"))
+ assert_equal(REQUEST_ASPDOTNETHANDLER, parse_requestxml(str))
+ end
+
+ def parse_requestxml(str)
+ str.split(/\r?\n\r?\n/)[3]
+ end
+
+ end
+end
+
+
+end; end
diff --git a/test/soap/calc/calc.rb b/test/soap/calc/calc.rb
new file mode 100644
index 0000000000..6bc78803b3
--- /dev/null
+++ b/test/soap/calc/calc.rb
@@ -0,0 +1,17 @@
+module CalcService
+ def self.add(lhs, rhs)
+ lhs + rhs
+ end
+
+ def self.sub(lhs, rhs)
+ lhs - rhs
+ end
+
+ def self.multi(lhs, rhs)
+ lhs * rhs
+ end
+
+ def self.div(lhs, rhs)
+ lhs / rhs
+ end
+end
diff --git a/test/soap/calc/calc2.rb b/test/soap/calc/calc2.rb
new file mode 100644
index 0000000000..69495730e7
--- /dev/null
+++ b/test/soap/calc/calc2.rb
@@ -0,0 +1,29 @@
+class CalcService2
+ def initialize(value = 0)
+ @value = value
+ end
+
+ def set_value(value)
+ @value = value
+ end
+
+ def get_value
+ @value
+ end
+
+ def +(rhs)
+ @value + rhs
+ end
+
+ def -(rhs)
+ @value - rhs
+ end
+
+ def *(rhs)
+ @value * rhs
+ end
+
+ def /(rhs)
+ @value / rhs
+ end
+end
diff --git a/test/soap/calc/server.cgi b/test/soap/calc/server.cgi
new file mode 100644
index 0000000000..1eb0d1d864
--- /dev/null
+++ b/test/soap/calc/server.cgi
@@ -0,0 +1,13 @@
+require 'soap/rpc/cgistub'
+
+class CalcServer < SOAP::RPC::CGIStub
+ def initialize(*arg)
+ super
+
+ require 'calc'
+ servant = CalcService
+ add_servant(servant, 'http://tempuri.org/calcService')
+ end
+end
+
+status = CalcServer.new('CalcServer', nil).start
diff --git a/test/soap/calc/server.rb b/test/soap/calc/server.rb
new file mode 100644
index 0000000000..a93774d909
--- /dev/null
+++ b/test/soap/calc/server.rb
@@ -0,0 +1,17 @@
+#!/usr/bin/env ruby
+
+require 'soap/rpc/standaloneServer'
+require 'calc'
+
+class CalcServer < SOAP::RPC::StandaloneServer
+ def initialize(*arg)
+ super
+
+ servant = CalcService
+ add_servant(servant, 'http://tempuri.org/calcService')
+ end
+end
+
+if $0 == __FILE__
+ status = CalcServer.new('CalcServer', nil, '0.0.0.0', 17171).start
+end
diff --git a/test/soap/calc/server2.rb b/test/soap/calc/server2.rb
new file mode 100644
index 0000000000..01c6d75289
--- /dev/null
+++ b/test/soap/calc/server2.rb
@@ -0,0 +1,20 @@
+#!/usr/bin/env ruby
+
+require 'soap/rpc/standaloneServer'
+require 'calc2'
+
+class CalcServer2 < SOAP::RPC::StandaloneServer
+ def on_init
+ servant = CalcService2.new
+ add_method(servant, 'set_value', 'newValue')
+ add_method(servant, 'get_value')
+ add_method_as(servant, '+', 'add', 'lhs')
+ add_method_as(servant, '-', 'sub', 'lhs')
+ add_method_as(servant, '*', 'multi', 'lhs')
+ add_method_as(servant, '/', 'div', 'lhs')
+ end
+end
+
+if $0 == __FILE__
+ status = CalcServer2.new('CalcServer', 'http://tempuri.org/calcService', '0.0.0.0', 17171).start
+end
diff --git a/test/soap/calc/test_calc.rb b/test/soap/calc/test_calc.rb
new file mode 100644
index 0000000000..88738716a6
--- /dev/null
+++ b/test/soap/calc/test_calc.rb
@@ -0,0 +1,49 @@
+require 'test/unit'
+require 'soap/rpc/driver'
+require 'server.rb'
+
+
+module SOAP
+module Calc
+
+
+class TestCalc < Test::Unit::TestCase
+ Port = 17171
+
+ def setup
+ @server = CalcServer.new(self.class.name, nil, '0.0.0.0', Port)
+ @server.level = Logger::Severity::ERROR
+ @t = Thread.new {
+ @server.start
+ }
+ @endpoint = "http://localhost:#{Port}/"
+ @calc = SOAP::RPC::Driver.new(@endpoint, 'http://tempuri.org/calcService')
+ @calc.add_method('add', 'lhs', 'rhs')
+ @calc.add_method('sub', 'lhs', 'rhs')
+ @calc.add_method('multi', 'lhs', 'rhs')
+ @calc.add_method('div', 'lhs', 'rhs')
+ end
+
+ def teardown
+ @server.shutdown
+ @t.kill
+ @t.join
+ @calc.reset_stream
+ end
+
+ def test_calc
+ assert_equal(3, @calc.add(1, 2))
+ assert_equal(-1.1, @calc.sub(1.1, 2.2))
+ assert_equal(2.42, @calc.multi(1.1, 2.2))
+ assert_equal(2, @calc.div(5, 2))
+ assert_equal(2.5, @calc.div(5.0, 2))
+ assert_equal(1.0/0.0, @calc.div(1.1, 0))
+ assert_raises(ZeroDivisionError) do
+ @calc.div(1, 0)
+ end
+ end
+end
+
+
+end
+end
diff --git a/test/soap/calc/test_calc2.rb b/test/soap/calc/test_calc2.rb
new file mode 100644
index 0000000000..f334b29bdb
--- /dev/null
+++ b/test/soap/calc/test_calc2.rb
@@ -0,0 +1,53 @@
+require 'test/unit'
+require 'soap/rpc/driver'
+require 'server2.rb'
+
+
+module SOAP
+module Calc
+
+
+class TestCalc2 < Test::Unit::TestCase
+ Port = 17171
+
+ def setup
+ @server = CalcServer2.new('CalcServer', 'http://tempuri.org/calcService', '0.0.0.0', Port)
+ @server.level = Logger::Severity::ERROR
+ @t = Thread.new {
+ Thread.current.abort_on_exception = true
+ @server.start
+ }
+ @endpoint = "http://localhost:#{Port}/"
+ @var = SOAP::RPC::Driver.new(@endpoint, 'http://tempuri.org/calcService')
+ @var.wiredump_dev = STDERR if $DEBUG
+ @var.add_method('set_value', 'newValue')
+ @var.add_method('get_value')
+ @var.add_method_as('+', 'add', 'rhs')
+ @var.add_method_as('-', 'sub', 'rhs')
+ @var.add_method_as('*', 'multi', 'rhs')
+ @var.add_method_as('/', 'div', 'rhs')
+ end
+
+ def teardown
+ @server.shutdown
+ @t.kill
+ @t.join
+ @var.reset_stream
+ end
+
+ def test_calc2
+ assert_equal(1, @var.set_value(1))
+ assert_equal(3, @var + 2)
+ assert_equal(-1.2, @var - 2.2)
+ assert_equal(2.2, @var * 2.2)
+ assert_equal(0, @var / 2)
+ assert_equal(0.5, @var / 2.0)
+ assert_raises(ZeroDivisionError) do
+ @var / 0
+ end
+ end
+end
+
+
+end
+end
diff --git a/test/soap/calc/test_calc_cgi.rb b/test/soap/calc/test_calc_cgi.rb
new file mode 100644
index 0000000000..d28830629f
--- /dev/null
+++ b/test/soap/calc/test_calc_cgi.rb
@@ -0,0 +1,69 @@
+require 'test/unit'
+require 'soap/rpc/driver'
+require 'logger'
+require 'webrick'
+require 'rbconfig'
+
+
+module SOAP
+module Calc
+
+
+class TestCalcCGI < Test::Unit::TestCase
+ # This test shuld be run after installing ruby.
+ RUBYBIN = File.join(
+ Config::CONFIG["bindir"],
+ Config::CONFIG["ruby_install_name"] + Config::CONFIG["EXEEXT"]
+ )
+ RUBYBIN << " -d" if $DEBUG
+
+ Port = 17171
+
+ def setup
+ logger = Logger.new(STDERR)
+ logger.level = Logger::Severity::ERROR
+ @server = WEBrick::HTTPServer.new(
+ :BindAddress => "0.0.0.0",
+ :Logger => logger,
+ :Port => Port,
+ :AccessLog => [],
+ :DocumentRoot => File.dirname(File.expand_path(__FILE__)),
+ :CGIPathEnv => ENV['PATH'],
+ :CGIInterpreter => RUBYBIN
+ )
+ @t = Thread.new {
+ Thread.current.abort_on_exception = true
+ @server.start
+ }
+ @endpoint = "http://localhost:#{Port}/server.cgi"
+ @calc = SOAP::RPC::Driver.new(@endpoint, 'http://tempuri.org/calcService')
+ @calc.wiredump_dev = STDERR if $DEBUG
+ @calc.add_method('add', 'lhs', 'rhs')
+ @calc.add_method('sub', 'lhs', 'rhs')
+ @calc.add_method('multi', 'lhs', 'rhs')
+ @calc.add_method('div', 'lhs', 'rhs')
+ end
+
+ def teardown
+ @server.shutdown
+ @t.kill
+ @t.join
+ @calc.reset_stream
+ end
+
+ def test_calc_cgi
+ assert_equal(3, @calc.add(1, 2))
+ assert_equal(-1.1, @calc.sub(1.1, 2.2))
+ assert_equal(2.42, @calc.multi(1.1, 2.2))
+ assert_equal(2, @calc.div(5, 2))
+ assert_equal(2.5, @calc.div(5.0, 2))
+ assert_equal(1.0/0.0, @calc.div(1.1, 0))
+ assert_raises(ZeroDivisionError) do
+ @calc.div(1, 0)
+ end
+ end
+end
+
+
+end
+end
diff --git a/test/soap/fault/test_customfault.rb b/test/soap/fault/test_customfault.rb
new file mode 100644
index 0000000000..2f7bc2be6e
--- /dev/null
+++ b/test/soap/fault/test_customfault.rb
@@ -0,0 +1,58 @@
+require 'test/unit'
+require 'soap/rpc/driver'
+require 'soap/rpc/standaloneServer'
+
+
+module SOAP
+module Fault
+
+
+class TestCustomFault < Test::Unit::TestCase
+ Port = 17171
+
+ class CustomFaultServer < SOAP::RPC::StandaloneServer
+ def on_init
+ add_method(self, 'fault', 'msg')
+ end
+
+ def fault(msg)
+ SOAPFault.new(SOAPString.new("mycustom"),
+ SOAPString.new("error: #{msg}"),
+ SOAPString.new(self.class.name))
+ end
+ end
+
+ def setup
+ @server = CustomFaultServer.new('customfault', 'urn:customfault', '0.0.0.0', Port)
+ @server.level = Logger::Severity::ERROR
+ @t = Thread.new {
+ Thread.current.abort_on_exception = true
+ @server.start
+ }
+ @endpoint = "http://localhost:#{Port}/"
+ @client = SOAP::RPC::Driver.new(@endpoint, 'urn:customfault')
+ @client.wiredump_dev = STDERR if $DEBUG
+ @client.add_method("fault", "msg")
+ end
+
+ def teardown
+ @server.shutdown
+ @t.kill
+ @t.join
+ @client.reset_stream
+ end
+
+ def test_custom_fault
+ begin
+ @client.fault("message")
+ assert(false, 'exception not raised')
+ rescue SOAP::FaultError => e
+ assert(true, 'exception raised')
+ assert_equal('error: message', e.message)
+ end
+ end
+end
+
+
+end
+end
diff --git a/test/soap/header/server.cgi b/test/soap/header/server.cgi
new file mode 100644
index 0000000000..2a188538d9
--- /dev/null
+++ b/test/soap/header/server.cgi
@@ -0,0 +1,119 @@
+require 'pstore'
+require 'soap/rpc/cgistub'
+require 'soap/header/simplehandler'
+
+
+class AuthHeaderPortServer < SOAP::RPC::CGIStub
+ PortName = 'http://tempuri.org/authHeaderPort'
+ SupportPortName = 'http://tempuri.org/authHeaderSupportPort'
+ MyHeaderName = XSD::QName.new("http://tempuri.org/authHeader", "auth")
+ SessionDB = File.join(File.expand_path(File.dirname(__FILE__)), 'session.pstoredb')
+
+ class AuthHeaderService
+ def self.create
+ new
+ end
+
+ def deposit(amt)
+ "deposit #{amt} OK"
+ end
+
+ def withdrawal(amt)
+ "withdrawal #{amt} OK"
+ end
+ end
+
+ class AuthHeaderSupportService
+ def delete_sessiondb
+ File.unlink(SessionDB) if File.file?(SessionDB)
+ backup = SessionDB + "~"
+ File.unlink(backup) if File.file?(backup)
+ end
+ end
+
+ def initialize(*arg)
+ super
+ add_rpc_servant(AuthHeaderService.new, PortName)
+ add_rpc_servant(AuthHeaderSupportService.new, SupportPortName)
+ add_rpc_headerhandler(ServerAuthHeaderHandler.new)
+ end
+
+ class ServerAuthHeaderHandler < SOAP::Header::SimpleHandler
+ Users = {
+ 'NaHi' => 'passwd',
+ 'HiNa' => 'wspass'
+ }
+
+ def initialize
+ super(MyHeaderName)
+ @db = PStore.new(SessionDB)
+ @db.transaction do
+ @db["root"] = {} unless @db.root?("root")
+ end
+ @userid = @sessionid = nil
+ end
+
+ def login(userid, passwd)
+ userid and passwd and Users[userid] == passwd
+ end
+
+ def auth(sessionid)
+ in_sessiondb do |root|
+ root[sessionid][0]
+ end
+ end
+
+ def create_session(userid)
+ in_sessiondb do |root|
+ while true
+ key = create_sessionkey
+ break unless root[key]
+ end
+ root[key] = [userid]
+ key
+ end
+ end
+
+ def destroy_session(sessionkey)
+ in_sessiondb do |root|
+ root.delete(sessionkey)
+ end
+ end
+
+ def on_simple_outbound
+ { "sessionid" => @sessionid }
+ end
+
+ def on_simple_inbound(my_header, mu)
+ succeeded = false
+ userid = my_header["userid"]
+ passwd = my_header["passwd"]
+ if login(userid, passwd)
+ succeeded = true
+ elsif sessionid = my_header["sessionid"]
+ if userid = auth(sessionid)
+ destroy_session(sessionid)
+ succeeded = true
+ end
+ end
+ raise RuntimeError.new("authentication failed") unless succeeded
+ @userid = userid
+ @sessionid = create_session(userid)
+ end
+
+ private
+
+ def create_sessionkey
+ Time.now.usec.to_s
+ end
+
+ def in_sessiondb
+ @db.transaction do
+ yield(@db["root"])
+ end
+ end
+ end
+end
+
+
+status = AuthHeaderPortServer.new('AuthHeaderPortServer', nil).start
diff --git a/test/soap/header/test_authheader.rb b/test/soap/header/test_authheader.rb
new file mode 100644
index 0000000000..47e1e76b82
--- /dev/null
+++ b/test/soap/header/test_authheader.rb
@@ -0,0 +1,240 @@
+require 'test/unit'
+require 'soap/rpc/driver'
+require 'soap/rpc/standaloneServer'
+require 'soap/header/simplehandler'
+
+
+module SOAP
+module Header
+
+
+class TestAuthHeader < Test::Unit::TestCase
+ Port = 17171
+ PortName = 'http://tempuri.org/authHeaderPort'
+ MyHeaderName = XSD::QName.new("http://tempuri.org/authHeader", "auth")
+ DummyHeaderName = XSD::QName.new("http://tempuri.org/authHeader", "dummy")
+
+ class AuthHeaderPortServer < SOAP::RPC::StandaloneServer
+ class AuthHeaderService
+ def self.create
+ new
+ end
+
+ def deposit(amt)
+ "deposit #{amt} OK"
+ end
+
+ def withdrawal(amt)
+ "withdrawal #{amt} OK"
+ end
+ end
+
+ def initialize(*arg)
+ super
+ add_rpc_servant(AuthHeaderService.new, PortName)
+ ServerAuthHeaderHandler.init
+ add_request_headerhandler(ServerAuthHeaderHandler)
+ end
+
+ class ServerAuthHeaderHandler < SOAP::Header::SimpleHandler
+ class << self
+ def create
+ new
+ end
+
+ def init
+ @users = {
+ 'NaHi' => 'passwd',
+ 'HiNa' => 'wspass'
+ }
+ @sessions = {}
+ end
+
+ def login(userid, passwd)
+ userid and passwd and @users[userid] == passwd
+ end
+
+ def auth(sessionid)
+ @sessions[sessionid][0]
+ end
+
+ def create_session(userid)
+ while true
+ key = create_sessionkey
+ break unless @sessions[key]
+ end
+ @sessions[key] = [userid]
+ key
+ end
+
+ def destroy_session(sessionkey)
+ @sessions.delete(sessionkey)
+ end
+
+ def sessions
+ @sessions
+ end
+
+ private
+
+ def create_sessionkey
+ Time.now.usec.to_s
+ end
+ end
+
+ def initialize
+ super(MyHeaderName)
+ @userid = @sessionid = nil
+ end
+
+ def on_simple_outbound
+ { "sessionid" => @sessionid }
+ end
+
+ def on_simple_inbound(my_header, mu)
+ auth = false
+ userid = my_header["userid"]
+ passwd = my_header["passwd"]
+ if self.class.login(userid, passwd)
+ auth = true
+ elsif sessionid = my_header["sessionid"]
+ if userid = self.class.auth(sessionid)
+ self.class.destroy_session(sessionid)
+ auth = true
+ end
+ end
+ raise RuntimeError.new("authentication failed") unless auth
+ @userid = userid
+ @sessionid = self.class.create_session(userid)
+ end
+ end
+ end
+
+ class ClientAuthHeaderHandler < SOAP::Header::SimpleHandler
+ def initialize(userid, passwd, mustunderstand)
+ super(MyHeaderName)
+ @sessionid = nil
+ @userid = userid
+ @passwd = passwd
+ @mustunderstand = mustunderstand
+ end
+
+ def on_simple_outbound
+ if @sessionid
+ { "sessionid" => @sessionid }
+ else
+ { "userid" => @userid, "passwd" => @passwd }
+ end
+ end
+
+ def on_simple_inbound(my_header, mustunderstand)
+ @sessionid = my_header["sessionid"]
+ end
+
+ def sessionid
+ @sessionid
+ end
+ end
+
+ class DummyHeaderHandler < SOAP::Header::SimpleHandler
+ def initialize(mustunderstand)
+ super(DummyHeaderName)
+ @mustunderstand = mustunderstand
+ end
+
+ def on_simple_outbound
+ { XSD::QName.new("foo", "bar") => nil }
+ end
+
+ def on_simple_inbound(my_header, mustunderstand)
+ end
+ end
+
+ def setup
+ @endpoint = "http://localhost:#{Port}/"
+ setup_server
+ setup_client
+ end
+
+ def setup_server
+ @server = AuthHeaderPortServer.new(self.class.name, nil, '0.0.0.0', Port)
+ @server.level = Logger::Severity::ERROR
+ @t = Thread.new {
+ @server.start
+ }
+ end
+
+ def setup_client
+ @client = SOAP::RPC::Driver.new(@endpoint, PortName)
+ @client.wiredump_dev = STDERR if $DEBUG
+ @client.add_method('deposit', 'amt')
+ @client.add_method('withdrawal', 'amt')
+ end
+
+ def teardown
+ teardown_server
+ teardown_client
+ end
+
+ def teardown_server
+ @server.shutdown
+ @t.kill
+ @t.join
+ end
+
+ def teardown_client
+ @client.reset_stream
+ end
+
+ def test_success_no_mu
+ h = ClientAuthHeaderHandler.new('NaHi', 'passwd', false)
+ @client.headerhandler << h
+ do_transaction_check(h)
+ end
+
+ def test_success_mu
+ h = ClientAuthHeaderHandler.new('NaHi', 'passwd', true)
+ @client.headerhandler << h
+ do_transaction_check(h)
+ end
+
+ def test_no_mu
+ h = ClientAuthHeaderHandler.new('NaHi', 'passwd', true)
+ @client.headerhandler << h
+ @client.headerhandler << DummyHeaderHandler.new(false)
+ do_transaction_check(h)
+ end
+
+ def test_mu
+ h = ClientAuthHeaderHandler.new('NaHi', 'passwd', true)
+ @client.headerhandler << h
+ @client.headerhandler << (h2 = DummyHeaderHandler.new(true))
+ assert_raise(SOAP::UnhandledMustUnderstandHeaderError) do
+ assert_equal("deposit 150 OK", @client.deposit(150))
+ end
+ @client.headerhandler.delete(h2)
+ @client.headerhandler << (h2 = DummyHeaderHandler.new(false))
+ do_transaction_check(h)
+ end
+
+ def do_transaction_check(h)
+ assert_equal("deposit 150 OK", @client.deposit(150))
+ serversess = AuthHeaderPortServer::ServerAuthHeaderHandler.sessions[h.sessionid]
+ assert_equal("NaHi", serversess[0])
+ assert_equal("withdrawal 120 OK", @client.withdrawal(120))
+ serversess = AuthHeaderPortServer::ServerAuthHeaderHandler.sessions[h.sessionid]
+ assert_equal("NaHi", serversess[0])
+ end
+
+ def test_authfailure
+ h = ClientAuthHeaderHandler.new('NaHi', 'pa', false)
+ @client.headerhandler << h
+ assert_raises(RuntimeError) do
+ @client.deposit(150)
+ end
+ end
+end
+
+
+end
+end
diff --git a/test/soap/header/test_authheader_cgi.rb b/test/soap/header/test_authheader_cgi.rb
new file mode 100644
index 0000000000..d70b022ad8
--- /dev/null
+++ b/test/soap/header/test_authheader_cgi.rb
@@ -0,0 +1,121 @@
+require 'test/unit'
+require 'soap/rpc/driver'
+require 'soap/rpc/standaloneServer'
+require 'soap/header/simplehandler'
+require 'logger'
+require 'webrick'
+require 'rbconfig'
+
+
+module SOAP
+module Header
+
+
+class TestAuthHeaderCGI < Test::Unit::TestCase
+ # This test shuld be run after installing ruby.
+ RUBYBIN = File.join(
+ Config::CONFIG["bindir"],
+ Config::CONFIG["ruby_install_name"] + Config::CONFIG["EXEEXT"]
+ )
+ RUBYBIN << " -d" if $DEBUG
+
+ Port = 17171
+ PortName = 'http://tempuri.org/authHeaderPort'
+ SupportPortName = 'http://tempuri.org/authHeaderSupportPort'
+ MyHeaderName = XSD::QName.new("http://tempuri.org/authHeader", "auth")
+
+ class ClientAuthHeaderHandler < SOAP::Header::SimpleHandler
+ def initialize(userid, passwd)
+ super(MyHeaderName)
+ @sessionid = nil
+ @userid = userid
+ @passwd = passwd
+ end
+
+ def on_simple_outbound
+ if @sessionid
+ { "sessionid" => @sessionid }
+ else
+ { "userid" => @userid, "passwd" => @passwd }
+ end
+ end
+
+ def on_simple_inbound(my_header, mustunderstand)
+ @sessionid = my_header["sessionid"]
+ end
+
+ def sessionid
+ @sessionid
+ end
+ end
+
+ def setup
+ @endpoint = "http://localhost:#{Port}/"
+ setup_server
+ setup_client
+ end
+
+ def setup_server
+ @endpoint = "http://localhost:#{Port}/server.cgi"
+ logger = Logger.new(STDERR)
+ logger.level = Logger::Severity::ERROR
+ @server = WEBrick::HTTPServer.new(
+ :BindAddress => "0.0.0.0",
+ :Logger => logger,
+ :Port => Port,
+ :AccessLog => [],
+ :DocumentRoot => File.dirname(File.expand_path(__FILE__)),
+ :CGIPathEnv => ENV['PATH'],
+ :CGIInterpreter => RUBYBIN
+ )
+ @t = Thread.new {
+ Thread.current.abort_on_exception = true
+ @server.start
+ }
+ end
+
+ def setup_client
+ @client = SOAP::RPC::Driver.new(@endpoint, PortName)
+ @client.wiredump_dev = STDERR if $DEBUG
+ @client.add_method('deposit', 'amt')
+ @client.add_method('withdrawal', 'amt')
+ @supportclient = SOAP::RPC::Driver.new(@endpoint, SupportPortName)
+ @supportclient.add_method('delete_sessiondb')
+ end
+
+ def teardown
+ @supportclient.delete_sessiondb
+ teardown_server
+ teardown_client
+ end
+
+ def teardown_server
+ @server.shutdown
+ @t.kill
+ @t.join
+ end
+
+ def teardown_client
+ @client.reset_stream
+ @supportclient.reset_stream
+ end
+
+ def test_success
+ h = ClientAuthHeaderHandler.new('NaHi', 'passwd')
+ @client.headerhandler << h
+ assert_equal("deposit 150 OK", @client.deposit(150))
+ assert_equal("withdrawal 120 OK", @client.withdrawal(120))
+ end
+
+ def test_authfailure
+ h = ClientAuthHeaderHandler.new('NaHi', 'pa')
+ @client.headerhandler << h
+ assert_raises(RuntimeError) do
+ @client.deposit(150)
+ end
+ end
+end
+
+
+end
+end
diff --git a/test/soap/header/test_simplehandler.rb b/test/soap/header/test_simplehandler.rb
new file mode 100644
index 0000000000..75dbd4a550
--- /dev/null
+++ b/test/soap/header/test_simplehandler.rb
@@ -0,0 +1,116 @@
+require 'test/unit'
+require 'soap/rpc/driver'
+require 'soap/rpc/standaloneServer'
+require 'soap/header/simplehandler'
+
+
+module SOAP
+module Header
+
+
+class TestSimpleHandler < Test::Unit::TestCase
+ Port = 17171
+ PortName = 'http://tempuri.org/authHeaderPort'
+
+ class PingPortServer < SOAP::RPC::StandaloneServer
+ class PingService
+ def self.create
+ new
+ end
+
+ def ping
+ Thread.current[:pingheader]
+ end
+ end
+
+ def initialize(*arg)
+ super
+ add_rpc_servant(PingService.new, PortName)
+ add_request_headerhandler(PingServerHeaderHandler)
+ end
+
+ class PingServerHeaderHandler < SOAP::Header::SimpleHandler
+ MyHeaderName = XSD::QName.new("http://xmlsoap.org/Ping", "PingHeader")
+
+ def self.create
+ new
+ end
+
+ def initialize()
+ super(MyHeaderName)
+ end
+
+ def on_simple_outbound
+ "dummy"
+ end
+
+ def on_simple_inbound(my_header, mu)
+ Thread.current[:pingheader] = my_header
+ end
+ end
+ end
+
+ class PingClientHeaderHandler < SOAP::Header::SimpleHandler
+ MyHeaderName = XSD::QName.new("http://xmlsoap.org/Ping", "PingHeader")
+
+ def initialize(pingHeader)
+ super(MyHeaderName)
+ @pingHeader = pingHeader
+ @mustunderstand = false
+ end
+
+ def on_simple_outbound
+ @pingHeader # --- note, not a Hash
+ end
+
+ def on_simple_inbound(my_header, mustunderstand)
+ Thread.current[:pingheader] = my_header
+ end
+ end
+
+ def setup
+ @endpoint = "http://localhost:#{Port}/"
+ setup_server
+ setup_client
+ end
+
+ def setup_server
+ @server = PingPortServer.new(self.class.name, nil, '0.0.0.0', Port)
+ @server.level = Logger::Severity::ERROR
+ @t = Thread.new {
+ @server.start
+ }
+ end
+
+ def setup_client
+ @client = SOAP::RPC::Driver.new(@endpoint, PortName)
+ @client.wiredump_dev = STDERR if $DEBUG
+ @client.add_method('ping')
+ end
+
+ def teardown
+ teardown_server
+ teardown_client
+ end
+
+ def teardown_server
+ @server.shutdown
+ @t.kill
+ @t.join
+ end
+
+ def teardown_client
+ @client.reset_stream
+ end
+
+ def test_string
+ h = PingClientHeaderHandler.new('pingheader')
+ @client.headerhandler << h
+ assert_equal("pingheader", @client.ping)
+ assert_equal("dummy", Thread.current[:pingheader])
+ end
+end
+
+
+end
+end
diff --git a/test/soap/helloworld/hw_s.rb b/test/soap/helloworld/hw_s.rb
new file mode 100644
index 0000000000..1a54adb924
--- /dev/null
+++ b/test/soap/helloworld/hw_s.rb
@@ -0,0 +1,16 @@
+require 'soap/rpc/standaloneServer'
+
+class HelloWorldServer < SOAP::RPC::StandaloneServer
+ def on_init
+ add_method(self, 'hello_world', 'from')
+ end
+
+ def hello_world(from)
+ "Hello World, from #{ from }"
+ end
+end
+
+if $0 == __FILE__
+ server = HelloWorldServer.new('hws', 'urn:hws', '0.0.0.0', 17171)
+ server.start
+end
diff --git a/test/soap/helloworld/test_helloworld.rb b/test/soap/helloworld/test_helloworld.rb
new file mode 100644
index 0000000000..40c35b57fb
--- /dev/null
+++ b/test/soap/helloworld/test_helloworld.rb
@@ -0,0 +1,40 @@
+require 'test/unit'
+require 'soap/rpc/driver'
+require 'hw_s.rb'
+
+
+module SOAP
+module HelloWorld
+
+
+class TestHelloWorld < Test::Unit::TestCase
+ Port = 17171
+
+ def setup
+ @server = HelloWorldServer.new('hws', 'urn:hws', '0.0.0.0', Port)
+ @server.level = Logger::Severity::ERROR
+ @t = Thread.new {
+ Thread.current.abort_on_exception = true
+ @server.start
+ }
+ @endpoint = "http://localhost:#{Port}/"
+ @client = SOAP::RPC::Driver.new(@endpoint, 'urn:hws')
+ @client.add_method("hello_world", "from")
+ end
+
+ def teardown
+ @server.shutdown
+ @t.kill
+ @t.join
+ @client.reset_stream
+ end
+
+ def test_hello_world
+ assert_equal("Hello World, from NaHi", @client.hello_world("NaHi"))
+ assert_equal("Hello World, from <&>", @client.hello_world("<&>"))
+ end
+end
+
+
+end
+end
diff --git a/test/soap/marshal/test_digraph.rb b/test/soap/marshal/test_digraph.rb
new file mode 100644
index 0000000000..d7f30654f8
--- /dev/null
+++ b/test/soap/marshal/test_digraph.rb
@@ -0,0 +1,56 @@
+require 'test/unit'
+require 'soap/marshal'
+
+
+module SOAP
+module Marshal
+
+
+class Node; include SOAP::Marshallable
+ attr_reader :first, :second, :str
+
+ def initialize(*init_next)
+ @first = init_next[0]
+ @second = init_next[1]
+ end
+end
+
+class TestDigraph < Test::Unit::TestCase
+ def setup
+ @n9 = Node.new
+ @n81 = Node.new(@n9)
+ @n82 = Node.new(@n9)
+ @n7 = Node.new(@n81, @n82)
+ @n61 = Node.new(@n7)
+ @n62 = Node.new(@n7)
+ @n5 = Node.new(@n61, @n62)
+ @n41 = Node.new(@n5)
+ @n42 = Node.new(@n5)
+ @n3 = Node.new(@n41, @n42)
+ @n21 = Node.new(@n3)
+ @n22 = Node.new(@n3)
+ @n1 = Node.new(@n21, @n22)
+ end
+
+ def test_marshal
+ f = File.open("digraph_marshalled_string.soap", "wb")
+ SOAP::Marshal.dump(@n1, f)
+ f.close
+ f = File.open("digraph_marshalled_string.soap")
+ str = f.read
+ f.close
+ newnode = SOAP::Marshal.unmarshal(str)
+ assert_equal(newnode.first.first.__id__, newnode.second.first.__id__)
+ assert_equal(newnode.first.first.first.first.__id__, newnode.second.first.second.first.__id__)
+ end
+
+ def teardown
+ if File.exist?("digraph_marshalled_string.soap")
+ File.unlink("digraph_marshalled_string.soap")
+ end
+ end
+end
+
+
+end
+end
diff --git a/test/soap/marshal/test_marshal.rb b/test/soap/marshal/test_marshal.rb
new file mode 100644
index 0000000000..5cc30a2b5d
--- /dev/null
+++ b/test/soap/marshal/test_marshal.rb
@@ -0,0 +1,26 @@
+require 'test/unit'
+require 'soap/marshal'
+dir = File.join(File.dirname(File.expand_path(__FILE__)), '../../ruby')
+orgpath = $:.dup
+begin
+ $:.push(dir)
+ require 'marshaltestlib'
+ensure
+ $:.replace(orgpath)
+end
+
+module SOAP
+module Marshal
+class TestMarshal < Test::Unit::TestCase
+ include MarshalTestLib
+
+ def encode(o)
+ SOAPMarshal.dump(o)
+ end
+
+ def decode(s)
+ SOAPMarshal.load(s)
+ end
+end
+end
+end
diff --git a/test/soap/marshal/test_struct.rb b/test/soap/marshal/test_struct.rb
new file mode 100644
index 0000000000..33975c31b0
--- /dev/null
+++ b/test/soap/marshal/test_struct.rb
@@ -0,0 +1,47 @@
+require 'test/unit'
+require 'soap/marshal'
+
+
+module SOAP
+module Marshal
+
+
+Foo1 = ::Struct.new("Foo1", :m)
+Foo2 = ::Struct.new(:m)
+class Foo3
+ attr_accessor :m
+end
+
+class TestStruct < Test::Unit::TestCase
+ def test_foo1
+ org = Foo1.new
+ org.m = org
+ obj = convert(org)
+ assert_equal(Foo1, obj.class)
+ assert_equal(obj.m, obj)
+ end
+
+ def test_foo2
+ org = Foo2.new
+ org.m = org
+ obj = convert(org)
+ assert_equal(Foo2, obj.class)
+ assert_equal(obj.m, obj)
+ end
+
+ def test_foo3
+ org = Foo3.new
+ org.m = org
+ obj = convert(org)
+ assert_equal(Foo3, obj.class)
+ assert_equal(obj.m, obj)
+ end
+
+ def convert(obj)
+ SOAP::Marshal.unmarshal(SOAP::Marshal.marshal(obj))
+ end
+end
+
+
+end
+end
diff --git a/test/soap/ssl/README b/test/soap/ssl/README
new file mode 100644
index 0000000000..98ebcf7c23
--- /dev/null
+++ b/test/soap/ssl/README
@@ -0,0 +1 @@
+* certificates and keys in this directory is copied from http-access2 test.
diff --git a/test/soap/ssl/ca.cert b/test/soap/ssl/ca.cert
new file mode 100644
index 0000000000..bcabbee4ad
--- /dev/null
+++ b/test/soap/ssl/ca.cert
@@ -0,0 +1,23 @@
+-----BEGIN CERTIFICATE-----
+MIID0DCCArigAwIBAgIBADANBgkqhkiG9w0BAQUFADA8MQswCQYDVQQGDAJKUDES
+MBAGA1UECgwJSklOLkdSLkpQMQwwCgYDVQQLDANSUlIxCzAJBgNVBAMMAkNBMB4X
+DTA0MDEzMDAwNDIzMloXDTM2MDEyMjAwNDIzMlowPDELMAkGA1UEBgwCSlAxEjAQ
+BgNVBAoMCUpJTi5HUi5KUDEMMAoGA1UECwwDUlJSMQswCQYDVQQDDAJDQTCCASIw
+DQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANbv0x42BTKFEQOE+KJ2XmiSdZpR
+wjzQLAkPLRnLB98tlzs4xo+y4RyY/rd5TT9UzBJTIhP8CJi5GbS1oXEerQXB3P0d
+L5oSSMwGGyuIzgZe5+vZ1kgzQxMEKMMKlzA73rbMd4Jx3u5+jdbP0EDrPYfXSvLY
+bS04n2aX7zrN3x5KdDrNBfwBio2/qeaaj4+9OxnwRvYP3WOvqdW0h329eMfHw0pi
+JI0drIVdsEqClUV4pebT/F+CPUPkEh/weySgo9wANockkYu5ujw2GbLFcO5LXxxm
+dEfcVr3r6t6zOA4bJwL0W/e6LBcrwiG/qPDFErhwtgTLYf6Er67SzLyA66UCAwEA
+AaOB3DCB2TAPBgNVHRMBAf8EBTADAQH/MDEGCWCGSAGG+EIBDQQkFiJSdWJ5L09w
+ZW5TU0wgR2VuZXJhdGVkIENlcnRpZmljYXRlMB0GA1UdDgQWBBRJ7Xd380KzBV7f
+USKIQ+O/vKbhDzAOBgNVHQ8BAf8EBAMCAQYwZAYDVR0jBF0wW4AUSe13d/NCswVe
+31EiiEPjv7ym4Q+hQKQ+MDwxCzAJBgNVBAYMAkpQMRIwEAYDVQQKDAlKSU4uR1Iu
+SlAxDDAKBgNVBAsMA1JSUjELMAkGA1UEAwwCQ0GCAQAwDQYJKoZIhvcNAQEFBQAD
+ggEBAIu/mfiez5XN5tn2jScgShPgHEFJBR0BTJBZF6xCk0jyqNx/g9HMj2ELCuK+
+r/Y7KFW5c5M3AQ+xWW0ZSc4kvzyTcV7yTVIwj2jZ9ddYMN3nupZFgBK1GB4Y05GY
+MJJFRkSu6d/Ph5ypzBVw2YMT/nsOo5VwMUGLgS7YVjU+u/HNWz80J3oO17mNZllj
+PvORJcnjwlroDnS58KoJ7GDgejv3ESWADvX1OHLE4cRkiQGeLoEU4pxdCxXRqX0U
+PbwIkZN9mXVcrmPHq8MWi4eC/V7hnbZETMHuWhUoiNdOEfsAXr3iP4KjyyRdwc7a
+d/xgcK06UVQRL/HbEYGiQL056mc=
+-----END CERTIFICATE-----
diff --git a/test/soap/ssl/client.cert b/test/soap/ssl/client.cert
new file mode 100644
index 0000000000..ad13c4b735
--- /dev/null
+++ b/test/soap/ssl/client.cert
@@ -0,0 +1,19 @@
+-----BEGIN CERTIFICATE-----
+MIIDKDCCAhCgAwIBAgIBAjANBgkqhkiG9w0BAQUFADA8MQswCQYDVQQGDAJKUDES
+MBAGA1UECgwJSklOLkdSLkpQMQwwCgYDVQQLDANSUlIxCzAJBgNVBAMMAkNBMB4X
+DTA0MDEzMTAzMTQ1OFoXDTM1MDEyMzAzMTQ1OFowZTELMAkGA1UEBgwCSlAxEjAQ
+BgNVBAoMCUpJTi5HUi5KUDEMMAoGA1UECwwDUlJSMRAwDgYDVQQDDAdleGFtcGxl
+MSIwIAYJKoZIhvcNAQkBDBNleGFtcGxlQGV4YW1wbGUub3JnMIGfMA0GCSqGSIb3
+DQEBAQUAA4GNADCBiQKBgQDRWssrK8Gyr+500hpLjCGR3+AHL8/hEJM5zKi/MgLW
+jTkvsgOwbYwXOiNtAbR9y4/ucDq7EY+cMUMHES4uFaPTcOaAV0aZRmk8AgslN1tQ
+gNS6ew7/Luq3DcVeWkX8PYgR9VG0mD1MPfJ6+IFA5d3vKpdBkBgN4l46jjO0/2Xf
+ewIDAQABo4GPMIGMMAwGA1UdEwEB/wQCMAAwMQYJYIZIAYb4QgENBCQWIlJ1Ynkv
+T3BlblNTTCBHZW5lcmF0ZWQgQ2VydGlmaWNhdGUwHQYDVR0OBBYEFOFvay0H7lr2
+xUx6waYEV2bVDYQhMAsGA1UdDwQEAwIF4DAdBgNVHSUEFjAUBggrBgEFBQcDAgYI
+KwYBBQUHAwQwDQYJKoZIhvcNAQEFBQADggEBABd2dYWqbDIWf5sWFvslezxJv8gI
+w64KCJBuyJAiDuf+oazr3016kMzAlt97KecLZDusGNagPrq02UX7YMoQFsWJBans
+cDtHrkM0al5r6/WGexNMgtYbNTYzt/IwodISGBgZ6dsOuhznwms+IBsTNDAvWeLP
+lt2tOqD8kEmjwMgn0GDRuKjs4EoboA3kMULb1p9akDV9ZESU3eOtpS5/G5J5msLI
+9WXbYBjcjvkLuJH9VsJhb+R58Vl0ViemvAHhPilSl1SPWVunGhv6FcIkdBEi1k9F
+e8BNMmsEjFiANiIRvpdLRbiGBt0KrKTndVfsmoKCvY48oCOvnzxtahFxfs8=
+-----END CERTIFICATE-----
diff --git a/test/soap/ssl/client.key b/test/soap/ssl/client.key
new file mode 100644
index 0000000000..37bc62f259
--- /dev/null
+++ b/test/soap/ssl/client.key
@@ -0,0 +1,15 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIICWwIBAAKBgQDRWssrK8Gyr+500hpLjCGR3+AHL8/hEJM5zKi/MgLWjTkvsgOw
+bYwXOiNtAbR9y4/ucDq7EY+cMUMHES4uFaPTcOaAV0aZRmk8AgslN1tQgNS6ew7/
+Luq3DcVeWkX8PYgR9VG0mD1MPfJ6+IFA5d3vKpdBkBgN4l46jjO0/2XfewIDAQAB
+AoGAZcz8llWErtsV3QB9gNb3S/PNADGjqBFjReva8n3jG2k4sZSibpwWTwUaTNtT
+ZQgjSRKRvH1hk9XwffNAvXAQZNNkuj/16gO2oO45nyLj4dO365ujLptWnVIWDHOE
+uN0GeiZO+VzcCisT0WCq4tvtLeH8svrxzA8cbXIEyOK7NiECQQDwo2zPFyKAZ/Cu
+lDJ6zKT+RjfWwW7DgWzirAlTrt4ViMaW+IaDH29TmQpb4V4NuR3Xi+2Xl4oicu6S
+36TW9+/FAkEA3rgfOQJuLlWSnw1RTGwvnC816a/W7iYYY7B+0U4cDbfWl7IoXT4y
+M8nV/HESooviZLqBwzAYSoj3fFKYBKpGPwJAUO8GN5iWWA2dW3ooiDiv/X1sZmRk
+dojfMFWgRW747tEzya8Ivq0h6kH8w+5GjeMG8Gn1nRiwsulo6Ckj7dEx6QJACyui
+7UIQ8qP6GZ4aYMHgVW4Mvy7Bkeo5OO7GPYs0Xv/EdJFL8vlGnVBXOjUVoS9w6Gpu
+TbLg1QQvnX2rADjmEwJANxZO2GUkaWGsEif8aGW0x5g/IdaMGG27pTWk5zqix7P3
+1UDrdo/JOXhptovhRi06EppIxAxYmbh9vd9VN8Itlw==
+-----END RSA PRIVATE KEY-----
diff --git a/test/soap/ssl/server.cert b/test/soap/ssl/server.cert
new file mode 100644
index 0000000000..998ccc5892
--- /dev/null
+++ b/test/soap/ssl/server.cert
@@ -0,0 +1,19 @@
+-----BEGIN CERTIFICATE-----
+MIIC/zCCAeegAwIBAgIBATANBgkqhkiG9w0BAQUFADA/MQswCQYDVQQGDAJKUDES
+MBAGA1UECgwJSklOLkdSLkpQMQwwCgYDVQQLDANSUlIxDjAMBgNVBAMMBVN1YkNB
+MB4XDTA0MDEzMTAzMTMxNloXDTMzMDEyMzAzMTMxNlowQzELMAkGA1UEBgwCSlAx
+EjAQBgNVBAoMCUpJTi5HUi5KUDEMMAoGA1UECwwDUlJSMRIwEAYDVQQDDAlsb2Nh
+bGhvc3QwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBANFJTxWqup3nV9dsJAku
+p+WaXnPNIzcpAA3qMGZDJTJsfa8Du7ZxTP0XJK5mETttBrn711cJxAuP3KjqnW9S
+vtZ9lY2sXJ6Zj62sN5LwG3VVe25dI28yR1EsbHjJ5Zjf9tmggMC6am52dxuHbt5/
+vHo4ngJuKE/U+eeGRivMn6gFAgMBAAGjgYUwgYIwDAYDVR0TAQH/BAIwADAxBglg
+hkgBhvhCAQ0EJBYiUnVieS9PcGVuU1NMIEdlbmVyYXRlZCBDZXJ0aWZpY2F0ZTAd
+BgNVHQ4EFgQUpZIyygD9JxFYHHOTEuWOLbCKfckwCwYDVR0PBAQDAgWgMBMGA1Ud
+JQQMMAoGCCsGAQUFBwMBMA0GCSqGSIb3DQEBBQUAA4IBAQBwAIj5SaBHaA5X31IP
+CFCJiep96awfp7RANO0cuUj+ZpGoFn9d6FXY0g+Eg5wAkCNIzZU5NHN9xsdOpnUo
+zIBbyTfQEPrge1CMWMvL6uGaoEXytq84VTitF/xBTky4KtTn6+es4/e7jrrzeUXQ
+RC46gkHObmDT91RkOEGjHLyld2328jo3DIN/VTHIryDeVHDWjY5dENwpwdkhhm60
+DR9IrNBbXWEe9emtguNXeN0iu1ux0lG1Hc6pWGQxMlRKNvGh0yZB9u5EVe38tOV0
+jQaoNyL7qzcQoXD3Dmbi1p0iRmg/+HngISsz8K7k7MBNVsSclztwgCzTZOBiVtkM
+rRlQ
+-----END CERTIFICATE-----
diff --git a/test/soap/ssl/server.key b/test/soap/ssl/server.key
new file mode 100644
index 0000000000..9ba2218a03
--- /dev/null
+++ b/test/soap/ssl/server.key
@@ -0,0 +1,15 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIICXQIBAAKBgQDRSU8Vqrqd51fXbCQJLqflml5zzSM3KQAN6jBmQyUybH2vA7u2
+cUz9FySuZhE7bQa5+9dXCcQLj9yo6p1vUr7WfZWNrFyemY+trDeS8Bt1VXtuXSNv
+MkdRLGx4yeWY3/bZoIDAumpudncbh27ef7x6OJ4CbihP1PnnhkYrzJ+oBQIDAQAB
+AoGBAIf4CstW2ltQO7+XYGoex7Hh8s9lTSW/G2vu5Hbr1LTHy3fzAvdq8MvVR12O
+rk9fa+lU9vhzPc0NMB0GIDZ9GcHuhW5hD1Wg9OSCbTOkZDoH3CAFqonjh4Qfwv5W
+IPAFn9KHukdqGXkwEMdErsUaPTy9A1V/aROVEaAY+HJgq/eZAkEA/BP1QMV04WEZ
+Oynzz7/lLizJGGxp2AOvEVtqMoycA/Qk+zdKP8ufE0wbmCE3Qd6GoynavsHb6aGK
+gQobb8zDZwJBANSK6MrXlrZTtEaeZuyOB4mAmRzGzOUVkUyULUjEx2GDT93ujAma
+qm/2d3E+wXAkNSeRpjUmlQXy/2oSqnGvYbMCQQDRM+cYyEcGPUVpWpnj0shrF/QU
+9vSot/X1G775EMTyaw6+BtbyNxVgOIu2J+rqGbn3c+b85XqTXOPL0A2RLYkFAkAm
+syhSDtE9X55aoWsCNZY/vi+i4rvaFoQ/WleogVQAeGVpdo7/DK9t9YWoFBIqth0L
+mGSYFu9ZhvZkvQNV8eYrAkBJ+rOIaLDsmbrgkeDruH+B/9yrm4McDtQ/rgnOGYnH
+LjLpLLOrgUxqpzLWe++EwSLwK2//dHO+SPsQJ4xsyQJy
+-----END RSA PRIVATE KEY-----
diff --git a/test/soap/ssl/sslsvr.rb b/test/soap/ssl/sslsvr.rb
new file mode 100644
index 0000000000..4f67eb9485
--- /dev/null
+++ b/test/soap/ssl/sslsvr.rb
@@ -0,0 +1,57 @@
+require 'webrick/https'
+require 'logger'
+require 'rbconfig'
+
+require 'soap/rpc/httpserver'
+
+class HelloWorldServer < SOAP::RPC::HTTPServer
+private
+
+ def on_init
+ self.level = Logger::Severity::FATAL
+ @default_namespace = 'urn:ssltst'
+ add_method(self, 'hello_world', 'from')
+ end
+
+ def hello_world(from)
+ "Hello World, from #{ from }"
+ end
+end
+
+
+if $0 == __FILE__
+ PORT = 17171
+ DIR = File.dirname(File.expand_path(__FILE__))
+
+ def cert(filename)
+ OpenSSL::X509::Certificate.new(File.open(File.join(DIR, filename)) { |f|
+ f.read
+ })
+ end
+
+ def key(filename)
+ OpenSSL::PKey::RSA.new(File.open(File.join(DIR, filename)) { |f|
+ f.read
+ })
+ end
+
+ $server = HelloWorldServer.new(
+ :BindAddress => "0.0.0.0",
+ :Port => PORT,
+ :AccessLog => [],
+ :SSLEnable => true,
+ :SSLCACertificateFile => File.join(DIR, 'ca.cert'),
+ :SSLCertificate => cert('server.cert'),
+ :SSLPrivateKey => key('server.key'),
+ :SSLVerifyClient => nil, #OpenSSL::SSL::VERIFY_FAIL_IF_NO_PEER_CERT|OpenSSL::SSL::VERIFY_PEER,
+ :SSLClientCA => cert('ca.cert'),
+ :SSLCertName => nil
+ )
+ t = Thread.new {
+ Thread.current.abort_on_exception = true
+ $server.start
+ }
+ STDOUT.sync = true
+ puts $$
+ t.join
+end
diff --git a/test/soap/ssl/subca.cert b/test/soap/ssl/subca.cert
new file mode 100644
index 0000000000..1e471851b8
--- /dev/null
+++ b/test/soap/ssl/subca.cert
@@ -0,0 +1,21 @@
+-----BEGIN CERTIFICATE-----
+MIIDaDCCAlCgAwIBAgIBATANBgkqhkiG9w0BAQUFADA8MQswCQYDVQQGDAJKUDES
+MBAGA1UECgwJSklOLkdSLkpQMQwwCgYDVQQLDANSUlIxCzAJBgNVBAMMAkNBMB4X
+DTA0MDEzMDAwNDMyN1oXDTM1MDEyMjAwNDMyN1owPzELMAkGA1UEBgwCSlAxEjAQ
+BgNVBAoMCUpJTi5HUi5KUDEMMAoGA1UECwwDUlJSMQ4wDAYDVQQDDAVTdWJDQTCC
+ASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAJ0Ou7AyRcRXnB/kVHv/6kwe
+ANzgg/DyJfsAUqW90m7Lu1nqyug8gK0RBd77yU0w5HOAMHTVSdpjZK0g2sgx4Mb1
+d/213eL9TTl5MRVEChTvQr8q5DVG/8fxPPE7fMI8eOAzd98/NOAChk+80r4Sx7fC
+kGVEE1bKwY1MrUsUNjOY2d6t3M4HHV3HX1V8ShuKfsHxgCmLzdI8U+5CnQedFgkm
+3e+8tr8IX5RR1wA1Ifw9VadF7OdI/bGMzog/Q8XCLf+WPFjnK7Gcx6JFtzF6Gi4x
+4dp1Xl45JYiVvi9zQ132wu8A1pDHhiNgQviyzbP+UjcB/tsOpzBQF8abYzgEkWEC
+AwEAAaNyMHAwDwYDVR0TAQH/BAUwAwEB/zAxBglghkgBhvhCAQ0EJBYiUnVieS9P
+cGVuU1NMIEdlbmVyYXRlZCBDZXJ0aWZpY2F0ZTAdBgNVHQ4EFgQUlCjXWLsReYzH
+LzsxwVnCXmKoB/owCwYDVR0PBAQDAgEGMA0GCSqGSIb3DQEBBQUAA4IBAQCJ/OyN
+rT8Cq2Y+G2yA/L1EMRvvxwFBqxavqaqHl/6rwsIBFlB3zbqGA/0oec6MAVnYynq4
+c4AcHTjx3bQ/S4r2sNTZq0DH4SYbQzIobx/YW8PjQUJt8KQdKMcwwi7arHP7A/Ha
+LKu8eIC2nsUBnP4NhkYSGhbmpJK+PFD0FVtD0ZIRlY/wsnaZNjWWcnWF1/FNuQ4H
+ySjIblqVQkPuzebv3Ror6ZnVDukn96Mg7kP4u6zgxOeqlJGRe1M949SS9Vudjl8X
+SF4aZUUB9pQGhsqQJVqaz2OlhGOp9D0q54xko/rekjAIcuDjl1mdX4F2WRrzpUmZ
+uY/bPeOBYiVsOYVe
+-----END CERTIFICATE-----
diff --git a/test/soap/ssl/test_ssl.rb b/test/soap/ssl/test_ssl.rb
new file mode 100644
index 0000000000..f0a1e18971
--- /dev/null
+++ b/test/soap/ssl/test_ssl.rb
@@ -0,0 +1,204 @@
+require 'test/unit'
+begin
+ require 'http-access2'
+rescue LoadError
+end
+require 'soap/rpc/driver'
+
+if defined?(HTTPAccess2) and defined?(OpenSSL)
+
+module SOAP; module SSL
+
+
+class TestSSL < Test::Unit::TestCase
+ PORT = 17171
+
+ DIR = File.dirname(File.expand_path(__FILE__))
+ require 'rbconfig'
+ RUBY = File.join(
+ Config::CONFIG["bindir"],
+ Config::CONFIG["ruby_install_name"] + Config::CONFIG["EXEEXT"]
+ )
+
+ def setup
+ @url = "https://localhost:#{PORT}/hello"
+ @serverpid = @client = nil
+ @verify_callback_called = false
+ setup_server
+ setup_client
+ end
+
+ def teardown
+ teardown_client
+ teardown_server
+ end
+
+ def test_options
+ cfg = @client.streamhandler.client.ssl_config
+ assert_nil(cfg.client_cert)
+ assert_nil(cfg.client_key)
+ assert_nil(cfg.client_ca)
+ assert_equal(OpenSSL::SSL::VERIFY_PEER | OpenSSL::SSL::VERIFY_FAIL_IF_NO_PEER_CERT, cfg.verify_mode)
+ assert_nil(cfg.verify_callback)
+ assert_nil(cfg.timeout)
+ assert_equal(OpenSSL::SSL::OP_ALL | OpenSSL::SSL::OP_NO_SSLv2, cfg.options)
+ assert_equal("ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH", cfg.ciphers)
+ assert_instance_of(OpenSSL::X509::Store, cfg.cert_store)
+ # dummy call to ensure sslsvr initialization finished.
+ assert_raise(OpenSSL::SSL::SSLError) do
+ @client.hello_world("ssl client")
+ end
+ end
+
+ def test_verification
+ cfg = @client.options
+ cfg["protocol.http.ssl_config.verify_callback"] = method(:verify_callback).to_proc
+ @verify_callback_called = false
+ ssle = assert_raise(OpenSSL::SSL::SSLError) {@client.hello_world("ssl client")}
+ assert_equal("certificate verify failed", ssle.message)
+ assert(@verify_callback_called)
+ #
+ cfg["protocol.http.ssl_config.client_cert"] = File.join(DIR, "client.cert")
+ cfg["protocol.http.ssl_config.client_key"] = File.join(DIR, "client.key")
+ @verify_callback_called = false
+ ssle = assert_raise(OpenSSL::SSL::SSLError) {@client.hello_world("ssl client")}
+ assert_equal("certificate verify failed", ssle.message)
+ assert(@verify_callback_called)
+ #
+ cfg["protocol.http.ssl_config.ca_file"] = File.join(DIR, "ca.cert")
+ @verify_callback_called = false
+ ssle = assert_raise(OpenSSL::SSL::SSLError) {@client.hello_world("ssl client")}
+ assert_equal("certificate verify failed", ssle.message)
+ assert(@verify_callback_called)
+ #
+ cfg["protocol.http.ssl_config.ca_file"] = File.join(DIR, "subca.cert")
+ @verify_callback_called = false
+ assert_equal("Hello World, from ssl client", @client.hello_world("ssl client"))
+ assert(@verify_callback_called)
+ #
+ cfg["protocol.http.ssl_config.verify_depth"] = "1"
+ @verify_callback_called = false
+ ssle = assert_raise(OpenSSL::SSL::SSLError) {@client.hello_world("ssl client")}
+ assert_equal("certificate verify failed", ssle.message)
+ assert(@verify_callback_called)
+ #
+ cfg["protocol.http.ssl_config.verify_depth"] = ""
+ cfg["protocol.http.ssl_config.cert_store"] = OpenSSL::X509::Store.new
+ cfg["protocol.http.ssl_config.verify_mode"] = OpenSSL::SSL::VERIFY_PEER.to_s
+ ssle = assert_raise(OpenSSL::SSL::SSLError) {@client.hello_world("ssl client")}
+ assert_equal("certificate verify failed", ssle.message)
+ #
+ cfg["protocol.http.ssl_config.verify_mode"] = ""
+ assert_equal("Hello World, from ssl client", @client.hello_world("ssl client"))
+ end
+
+ def test_property
+ testpropertyname = File.join(DIR, 'soapclient.properties')
+ File.open(testpropertyname, "w") do |f|
+ f <<<<__EOP__
+protocol.http.ssl_config.verify_mode = OpenSSL::SSL::VERIFY_PEER
+# depth: 1 causes an error (intentional)
+protocol.http.ssl_config.verify_depth = 1
+protocol.http.ssl_config.client_cert = #{File.join(DIR, 'client.cert')}
+protocol.http.ssl_config.client_key = #{File.join(DIR, 'client.key')}
+protocol.http.ssl_config.ca_file = #{File.join(DIR, 'ca.cert')}
+protocol.http.ssl_config.ca_file = #{File.join(DIR, 'subca.cert')}
+protocol.http.ssl_config.ciphers = ALL
+__EOP__
+ end
+ begin
+ @client.loadproperty(testpropertyname)
+ @client.options["protocol.http.ssl_config.verify_callback"] = method(:verify_callback).to_proc
+ @verify_callback_called = false
+ # NG with String
+ ssle = assert_raise(OpenSSL::SSL::SSLError) {@client.hello_world("ssl client")}
+ assert_equal("certificate verify failed", ssle.message)
+ assert(@verify_callback_called)
+ # NG with Integer
+ @client.options["protocol.http.ssl_config.verify_depth"] = 0
+ ssle = assert_raise(OpenSSL::SSL::SSLError) {@client.hello_world("ssl client")}
+ assert_equal("certificate verify failed", ssle.message)
+ assert(@verify_callback_called)
+ # OK with empty
+ @client.options["protocol.http.ssl_config.verify_depth"] = ""
+ @verify_callback_called = false
+ assert_equal("Hello World, from ssl client", @client.hello_world("ssl client"))
+ assert(@verify_callback_called)
+ # OK with nil
+ @client.options["protocol.http.ssl_config.verify_depth"] = nil
+ @verify_callback_called = false
+ assert_equal("Hello World, from ssl client", @client.hello_world("ssl client"))
+ assert(@verify_callback_called)
+ # OK with String
+ @client.options["protocol.http.ssl_config.verify_depth"] = "3"
+ @verify_callback_called = false
+ assert_equal("Hello World, from ssl client", @client.hello_world("ssl client"))
+ assert(@verify_callback_called)
+ # OK with Integer
+ @client.options["protocol.http.ssl_config.verify_depth"] = 3
+ @verify_callback_called = false
+ assert_equal("Hello World, from ssl client", @client.hello_world("ssl client"))
+ assert(@verify_callback_called)
+ ensure
+ File.unlink(testpropertyname)
+ end
+ end
+
+ def test_ciphers
+ cfg = @client.options
+ cfg["protocol.http.ssl_config.client_cert"] = File.join(DIR, 'client.cert')
+ cfg["protocol.http.ssl_config.client_key"] = File.join(DIR, 'client.key')
+ cfg["protocol.http.ssl_config.ca_file"] = File.join(DIR, "ca.cert")
+ cfg["protocol.http.ssl_config.ca_file"] = File.join(DIR, "subca.cert")
+ #cfg.timeout = 123
+ cfg["protocol.http.ssl_config.ciphers"] = "!ALL"
+ #
+ ssle = assert_raise(OpenSSL::SSL::SSLError) {@client.hello_world("ssl client")}
+ # depends on OpenSSL version. (?:0.9.8|0.9.7)
+ assert_match(/\A(?:SSL_CTX_set_cipher_list:: no cipher match|no ciphers available)\z/, ssle.message)
+ #
+ cfg["protocol.http.ssl_config.ciphers"] = "ALL"
+ assert_equal("Hello World, from ssl client", @client.hello_world("ssl client"))
+ end
+
+private
+
+ def q(str)
+ %Q["#{str}"]
+ end
+
+ def setup_server
+ svrcmd = "#{q(RUBY)} "
+ #svrcmd << "-d " if $DEBUG
+ svrcmd << File.join(DIR, "sslsvr.rb")
+ svrout = IO.popen(svrcmd)
+ @serverpid = Integer(svrout.gets.chomp)
+ end
+
+ def setup_client
+ @client = SOAP::RPC::Driver.new(@url, 'urn:ssltst')
+ @client.add_method("hello_world", "from")
+ end
+
+ def teardown_server
+ if @serverpid
+ Process.kill('KILL', @serverpid)
+ Process.waitpid(@serverpid)
+ end
+ end
+
+ def teardown_client
+ @client.reset_stream if @client
+ end
+
+ def verify_callback(ok, cert)
+ @verify_callback_called = true
+ p ["client", ok, cert] if $DEBUG
+ ok
+ end
+end
+
+
+end; end
+
+end
diff --git a/test/soap/struct/test_struct.rb b/test/soap/struct/test_struct.rb
new file mode 100644
index 0000000000..d92f4bc18a
--- /dev/null
+++ b/test/soap/struct/test_struct.rb
@@ -0,0 +1,77 @@
+require 'test/unit'
+require 'soap/rpc/httpserver'
+require 'soap/rpc/driver'
+
+
+module SOAP; module Struct
+
+
+class TestStruct < Test::Unit::TestCase
+ Namespace = "urn:example.com:simpletype-rpc"
+ class Server < ::SOAP::RPC::HTTPServer
+ @@test_struct = ::Struct.new(:one, :two)
+
+ def on_init
+ add_method(self, 'a_method')
+ end
+
+ def a_method
+ @@test_struct.new("string", 1)
+ end
+ end
+
+ Port = 17171
+
+ def setup
+ setup_server
+ setup_client
+ end
+
+ def setup_server
+ @server = Server.new(
+ :Port => Port,
+ :BindAddress => "0.0.0.0",
+ :AccessLog => [],
+ :SOAPDefaultNamespace => Namespace
+ )
+ @server.level = Logger::Severity::ERROR
+ @server_thread = start_server_thread(@server)
+ end
+
+ def setup_client
+ @client = ::SOAP::RPC::Driver.new("http://localhost:#{Port}/", Namespace)
+ @client.wiredump_dev = STDERR if $DEBUG
+ @client.add_method('a_method')
+ end
+
+ def teardown
+ teardown_server
+ teardown_client
+ end
+
+ def teardown_server
+ @server.shutdown
+ @server_thread.kill
+ @server_thread.join
+ end
+
+ def teardown_client
+ @client.reset_stream
+ end
+
+ def start_server_thread(server)
+ t = Thread.new {
+ Thread.current.abort_on_exception = true
+ server.start
+ }
+ t
+ end
+
+ def test_struct
+ assert_equal("string", @client.a_method.one)
+ assert_equal(1, @client.a_method.two)
+ end
+end
+
+
+end; end
diff --git a/test/soap/swa/test_file.rb b/test/soap/swa/test_file.rb
new file mode 100644
index 0000000000..1ec7aa92a7
--- /dev/null
+++ b/test/soap/swa/test_file.rb
@@ -0,0 +1,73 @@
+require 'test/unit'
+require 'soap/rpc/driver'
+require 'soap/rpc/standaloneServer'
+require 'soap/attachment'
+
+
+module SOAP
+module SWA
+
+
+class TestFile < Test::Unit::TestCase
+ Port = 17171
+ THIS_FILE = File.expand_path(__FILE__)
+
+ class SwAService
+ def get_file
+ return {
+ 'name' => $0,
+ 'file' => SOAP::Attachment.new(File.open(THIS_FILE)) # closed when GCed.
+ }
+ end
+
+ def put_file(name, file)
+ "File '#{name}' was received ok."
+ end
+ end
+
+ def setup
+ @server = SOAP::RPC::StandaloneServer.new('SwAServer',
+ 'http://www.acmetron.com/soap', '0.0.0.0', Port)
+ @server.add_servant(SwAService.new)
+ @server.level = Logger::Severity::ERROR
+ @t = Thread.new {
+ @server.start
+ }
+ @endpoint = "http://localhost:#{Port}/"
+ @client = SOAP::RPC::Driver.new(@endpoint, 'http://www.acmetron.com/soap')
+ @client.add_method('get_file')
+ @client.add_method('put_file', 'name', 'file')
+ @client.wiredump_dev = STDERR if $DEBUG
+ end
+
+ def teardown
+ @server.shutdown
+ @t.kill
+ @t.join
+ @client.reset_stream
+ end
+
+ def test_get_file
+ assert_equal(
+ File.open(THIS_FILE) { |f| f.read },
+ @client.get_file['file'].content
+ )
+ end
+
+ def test_put_file
+ assert_equal(
+ "File 'foo' was received ok.",
+ @client.put_file('foo',
+ SOAP::Attachment.new(File.open(THIS_FILE)))
+ )
+ assert_equal(
+ "File 'bar' was received ok.",
+ @client.put_file('bar',
+ SOAP::Attachment.new(File.open(THIS_FILE) { |f| f.read }))
+ )
+ end
+end
+
+
+end
+end
diff --git a/test/soap/test_basetype.rb b/test/soap/test_basetype.rb
new file mode 100644
index 0000000000..3785873560
--- /dev/null
+++ b/test/soap/test_basetype.rb
@@ -0,0 +1,970 @@
+require 'test/unit'
+require 'soap/baseData'
+
+
+module SOAP
+
+
+class TestSOAP < Test::Unit::TestCase
+ NegativeZero = (-1.0 / (1.0 / 0.0))
+
+ def setup
+ # Nothing to do.
+ end
+
+ def teardown
+ # Nothing to do.
+ end
+
+ def assert_parsed_result(klass, str)
+ o = klass.new(str)
+ assert_equal(str, o.to_s)
+ end
+
+ def test_SOAPNil
+ o = SOAP::SOAPNil.new
+ assert_equal(XSD::Namespace, o.type.namespace)
+ assert_equal(XSD::NilLiteral, o.type.name)
+ assert_equal(nil, o.data)
+ assert_equal(true, o.is_nil)
+
+ o = SOAP::SOAPNil.new(nil)
+ assert_equal(true, o.is_nil)
+ assert_equal(nil, o.data)
+ assert_equal("", o.to_s)
+ o = SOAP::SOAPNil.new('var')
+ assert_equal(false, o.is_nil)
+ assert_equal('var', o.data)
+ assert_equal('var', o.to_s)
+ end
+
+ def test_SOAPString
+ o = SOAP::SOAPString.new
+ assert_equal(XSD::Namespace, o.type.namespace)
+ assert_equal(XSD::StringLiteral, o.type.name)
+ assert_equal(nil, o.data)
+ assert_equal(true, o.is_nil)
+
+ str = "abc"
+ assert_equal(str, SOAP::SOAPString.new(str).data)
+ assert_equal(str, SOAP::SOAPString.new(str).to_s)
+ assert_raises(XSD::ValueSpaceError) do
+ SOAP::SOAPString.new("\0")
+ end
+ assert_raises(XSD::ValueSpaceError) do
+ p SOAP::SOAPString.new("\xC0\xC0").to_s
+ end
+ end
+
+ def test_SOAPBoolean
+ o = SOAP::SOAPBoolean.new
+ assert_equal(XSD::Namespace, o.type.namespace)
+ assert_equal(XSD::BooleanLiteral, o.type.name)
+ assert_equal(nil, o.data)
+ assert_equal(true, o.is_nil)
+
+ targets = [
+ ["true", true],
+ ["1", true],
+ ["false", false],
+ ["0", false],
+ ]
+ targets.each do |data, expected|
+ assert_equal(expected, SOAP::SOAPBoolean.new(data).data)
+ assert_equal(expected.to_s, SOAP::SOAPBoolean.new(data).to_s)
+ end
+
+ assert_raises(XSD::ValueSpaceError) do
+ SOAP::SOAPBoolean.new("nil").to_s
+ end
+ end
+
+ def test_SOAPDecimal
+ o = SOAP::SOAPDecimal.new
+ assert_equal(XSD::Namespace, o.type.namespace)
+ assert_equal(XSD::DecimalLiteral, o.type.name)
+ assert_equal(nil, o.data)
+ assert_equal(true, o.is_nil)
+
+ targets = [
+ 0,
+ 1000000000,
+ -9999999999,
+ 12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890,
+ 12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890,
+ -1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789,
+ ]
+ targets.each do |dec|
+ assert_equal(dec.to_s, SOAP::SOAPDecimal.new(dec).data)
+ end
+
+ targets = [
+ "0",
+ "0.00000001",
+ "1000000000",
+ "12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890",
+ "-12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123.45678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789",
+ ]
+ targets.each do |str|
+ assert_equal(str, SOAP::SOAPDecimal.new(str).to_s)
+ end
+
+ targets = [
+ ["-0", "0"],
+ ["+0", "0"],
+ ["0.0", "0"],
+ ["-0.0", "0"],
+ ["+0.0", "0"],
+ ["0.", "0"],
+ [".0", "0"],
+ [
+ "+0.12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890",
+ "0.1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789"
+ ],
+ [
+ ".0000012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890",
+ "0.000001234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789"
+ ],
+ [
+ "-12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890.",
+ "-12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890"
+ ],
+ ]
+ targets.each do |data, expected|
+ assert_equal(expected, SOAP::SOAPDecimal.new(data).to_s)
+ end
+
+ targets = [
+ "0.000000000000a",
+ "00a.0000000000001",
+ "+-5",
+ ]
+ targets.each do |d|
+ assert_raises(XSD::ValueSpaceError) do
+ SOAP::SOAPDecimal.new(d)
+ end
+ end
+ end
+
+ def test_SOAPFloat
+ o = SOAP::SOAPFloat.new
+ assert_equal(XSD::Namespace, o.type.namespace)
+ assert_equal(XSD::FloatLiteral, o.type.name)
+ assert_equal(nil, o.data)
+ assert_equal(true, o.is_nil)
+
+ targets = [
+ 3.14159265358979,
+ 12.34e36,
+ 1.402e-45,
+ -1.402e-45,
+ ]
+ targets.each do |f|
+ assert_equal(f, SOAP::SOAPFloat.new(f).data)
+ end
+
+ targets = [
+ "+3.141592654",
+ "+1.234e+37",
+ "+1.402e-45",
+ "-1.402e-45",
+ ]
+ targets.each do |f|
+ assert_equal(f, SOAP::SOAPFloat.new(f).to_s)
+ end
+
+ targets = [
+ [3, "+3"], # should be 3.0?
+ [-2, "-2"], # ditto
+ [3.14159265358979, "+3.141592654"],
+ [12.34e36, "+1.234e+37"],
+ [1.402e-45, "+1.402e-45"],
+ [-1.402e-45, "-1.402e-45"],
+ ["1.402e", "+1.402"],
+ ["12.34E36", "+1.234e+37"],
+ ["1.402E-45", "+1.402e-45"],
+ ["-1.402E-45", "-1.402e-45"],
+ ["1.402E", "+1.402"],
+ ]
+ targets.each do |f, str|
+ assert_equal(str, SOAP::SOAPFloat.new(f).to_s)
+ end
+
+ assert_equal("+0", SOAP::SOAPFloat.new(+0.0).to_s)
+ assert_equal("-0", SOAP::SOAPFloat.new(NegativeZero).to_s)
+ assert(SOAP::SOAPFloat.new(0.0/0.0).data.nan?)
+ assert_equal("INF", SOAP::SOAPFloat.new(1.0/0.0).to_s)
+ assert_equal(1, SOAP::SOAPFloat.new(1.0/0.0).data.infinite?)
+ assert_equal("-INF", SOAP::SOAPFloat.new(-1.0/0.0).to_s)
+ assert_equal(-1, SOAP::SOAPFloat.new(-1.0/0.0).data.infinite?)
+
+ targets = [
+ "0.000000000000a",
+ "00a.0000000000001",
+ "+-5",
+ "5_0",
+ ]
+ targets.each do |d|
+ assert_raises(XSD::ValueSpaceError) do
+ SOAP::SOAPFloat.new(d)
+ end
+ end
+ end
+
+ def test_SOAPDouble
+ o = SOAP::SOAPDouble.new
+ assert_equal(XSD::Namespace, o.type.namespace)
+ assert_equal(XSD::DoubleLiteral, o.type.name)
+ assert_equal(nil, o.data)
+ assert_equal(true, o.is_nil)
+
+ targets = [
+ 3.14159265358979,
+ 12.34e36,
+ 1.402e-45,
+ -1.402e-45,
+ ]
+ targets.each do |f|
+ assert_equal(f, SOAP::SOAPDouble.new(f).data)
+ end
+
+ targets = [
+ "+3.14159265358979",
+ "+1.234e+37",
+ "+1.402e-45",
+ "-1.402e-45",
+ ]
+ targets.each do |f|
+ assert_equal(f, SOAP::SOAPDouble.new(f).to_s)
+ end
+
+ targets = [
+ [3, "+3"], # should be 3.0?
+ [-2, "-2"], # ditto.
+ [3.14159265358979, "+3.14159265358979"],
+ [12.34e36, "+1.234e+37"],
+ [1.402e-45, "+1.402e-45"],
+ [-1.402e-45, "-1.402e-45"],
+ ["1.402e", "+1.402"],
+ ["12.34E36", "+1.234e+37"],
+ ["1.402E-45", "+1.402e-45"],
+ ["-1.402E-45", "-1.402e-45"],
+ ["1.402E", "+1.402"],
+ ]
+ targets.each do |f, str|
+ assert_equal(str, SOAP::SOAPDouble.new(f).to_s)
+ end
+
+ assert_equal("+0", SOAP::SOAPFloat.new(+0.0).to_s)
+ assert_equal("-0", SOAP::SOAPFloat.new(NegativeZero).to_s)
+ assert_equal("NaN", SOAP::SOAPDouble.new(0.0/0.0).to_s)
+ assert(SOAP::SOAPDouble.new(0.0/0.0).data.nan?)
+ assert_equal("INF", SOAP::SOAPDouble.new(1.0/0.0).to_s)
+ assert_equal(1, SOAP::SOAPDouble.new(1.0/0.0).data.infinite?)
+ assert_equal("-INF", SOAP::SOAPDouble.new(-1.0/0.0).to_s)
+ assert_equal(-1, SOAP::SOAPDouble.new(-1.0/0.0).data.infinite?)
+
+ targets = [
+ "0.000000000000a",
+ "00a.0000000000001",
+ "+-5",
+ ]
+ targets.each do |d|
+ assert_raises(XSD::ValueSpaceError) do
+ SOAP::SOAPDouble.new(d)
+ end
+ end
+ end
+
+ def test_SOAPDuration
+ o = SOAP::SOAPDuration.new
+ assert_equal(XSD::Namespace, o.type.namespace)
+ assert_equal(XSD::DurationLiteral, o.type.name)
+ assert_equal(nil, o.data)
+ assert_equal(true, o.is_nil)
+
+ targets = [
+ "P1Y2M3DT4H5M6S",
+ "P1234Y5678M9012DT3456H7890M1234.5678S",
+ "P0DT3456H7890M1234.5678S",
+ "P1234Y5678M9012D",
+ "-P1234Y5678M9012DT3456H7890M1234.5678S",
+ "P5678M9012DT3456H7890M1234.5678S",
+ "-P1234Y9012DT3456H7890M1234.5678S",
+ "+P1234Y5678MT3456H7890M1234.5678S",
+ "P1234Y5678M9012DT7890M1234.5678S",
+ "-P1234Y5678M9012DT3456H1234.5678S",
+ "+P1234Y5678M9012DT3456H7890M",
+ "P123400000000000Y",
+ "-P567800000000000M",
+ "+P901200000000000D",
+ "P0DT345600000000000H",
+ "-P0DT789000000000000M",
+ "+P0DT123400000000000.000000000005678S",
+ "P1234YT1234.5678S",
+ "-P5678MT7890M",
+ "+P9012DT3456H",
+ ]
+ targets.each do |str|
+ assert_parsed_result(SOAP::SOAPDuration, str)
+ end
+
+ targets = [
+ ["P0Y0M0DT0H0M0S",
+ "P0D"],
+ ["-P0DT0S",
+ "-P0D"],
+ ["P01234Y5678M9012DT3456H7890M1234.5678S",
+ "P1234Y5678M9012DT3456H7890M1234.5678S"],
+ ["P1234Y005678M9012DT3456H7890M1234.5678S",
+ "P1234Y5678M9012DT3456H7890M1234.5678S"],
+ ["P1234Y5678M0009012DT3456H7890M1234.5678S",
+ "P1234Y5678M9012DT3456H7890M1234.5678S"],
+ ["P1234Y5678M9012DT00003456H7890M1234.5678S",
+ "P1234Y5678M9012DT3456H7890M1234.5678S"],
+ ["P1234Y5678M9012DT3456H000007890M1234.5678S",
+ "P1234Y5678M9012DT3456H7890M1234.5678S"],
+ ["P1234Y5678M9012DT3456H7890M0000001234.5678S",
+ "P1234Y5678M9012DT3456H7890M1234.5678S"],
+ ]
+ targets.each do |data, expected|
+ assert_equal(expected, SOAP::SOAPDuration.new(data).to_s)
+ end
+ end
+
+ def test_SOAPDateTime
+ o = SOAP::SOAPDateTime.new
+ assert_equal(XSD::Namespace, o.type.namespace)
+ assert_equal(XSD::DateTimeLiteral, o.type.name)
+ assert_equal(nil, o.data)
+ assert_equal(true, o.is_nil)
+
+ targets = [
+ "2002-05-18T16:52:20Z",
+ "0001-01-01T00:00:00Z",
+ "9999-12-31T23:59:59Z",
+ "19999-12-31T23:59:59Z",
+ "2002-12-31T23:59:59.999Z",
+ "2002-12-31T23:59:59.001Z",
+ "2002-12-31T23:59:59.99999999999999999999Z",
+ "2002-12-31T23:59:59.00000000000000000001Z",
+ "2002-12-31T23:59:59+09:00",
+ "2002-12-31T23:59:59+00:01",
+ "2002-12-31T23:59:59-00:01",
+ "2002-12-31T23:59:59-23:59",
+ "2002-12-31T23:59:59.00000000000000000001+13:30",
+ "2002-12-31T23:59:59.51375Z",
+ "2002-12-31T23:59:59.51345+12:34",
+ "-2002-05-18T16:52:20Z",
+ "-4711-12-31T23:59:59Z",
+ "-4713-01-01T12:00:00Z",
+ "-19999-12-31T23:59:59Z",
+ "-2002-12-31T23:59:59+00:01",
+ "-0001-12-31T23:59:59.00000000000000000001+13:30",
+ ]
+ targets.each do |str|
+ assert_parsed_result(SOAP::SOAPDateTime, str)
+ end
+
+ targets = [
+ ["2002-12-31T23:59:59.00",
+ "2002-12-31T23:59:59Z"],
+ ["2002-12-31T23:59:59+00:00",
+ "2002-12-31T23:59:59Z"],
+ ["2002-12-31T23:59:59-00:00",
+ "2002-12-31T23:59:59Z"],
+ ["-2002-12-31T23:59:59.00",
+ "-2002-12-31T23:59:59Z"],
+ ["-2002-12-31T23:59:59+00:00",
+ "-2002-12-31T23:59:59Z"],
+ ["-2002-12-31T23:59:59-00:00",
+ "-2002-12-31T23:59:59Z"],
+ ]
+ targets.each do |data, expected|
+ assert_equal(expected, SOAP::SOAPDateTime.new(data).to_s)
+ d = DateTime.parse(data)
+ d >>= 12 if d.year < 0 # XSDDateTime.year(-1) == DateTime.year(0)
+ assert_equal(expected, SOAP::SOAPDateTime.new(d).to_s)
+ end
+
+ targets = [
+ "1-05-18T16:52:20Z",
+ "05-18T16:52:20Z",
+ "2002-05T16:52:20Z",
+ "2002-05-18T16:52Z",
+ "",
+ ]
+ targets.each do |d|
+ assert_raises(XSD::ValueSpaceError, d.to_s) do
+ SOAP::SOAPDateTime.new(d)
+ end
+ end
+ end
+
+ def test_SOAPTime
+ o = SOAP::SOAPTime.new
+ assert_equal(XSD::Namespace, o.type.namespace)
+ assert_equal(XSD::TimeLiteral, o.type.name)
+ assert_equal(nil, o.data)
+ assert_equal(true, o.is_nil)
+
+ targets = [
+ "16:52:20Z",
+ "00:00:00Z",
+ "23:59:59Z",
+ "23:59:59.999Z",
+ "23:59:59.001Z",
+ "23:59:59.99999999999999999999Z",
+ "23:59:59.00000000000000000001Z",
+ "23:59:59+09:00",
+ "23:59:59+00:01",
+ "23:59:59-00:01",
+ "23:59:59-23:59",
+ "23:59:59.00000000000000000001+13:30",
+ "23:59:59.51375Z",
+ "23:59:59.51375+12:34",
+ "23:59:59+00:01",
+ ]
+ targets.each do |str|
+ assert_parsed_result(SOAP::SOAPTime, str)
+ end
+
+ targets = [
+ ["23:59:59.00",
+ "23:59:59Z"],
+ ["23:59:59+00:00",
+ "23:59:59Z"],
+ ["23:59:59-00:00",
+ "23:59:59Z"],
+ ]
+ targets.each do |data, expected|
+ assert_equal(expected, SOAP::SOAPTime.new(data).to_s)
+ end
+ end
+
+ def test_SOAPDate
+ o = SOAP::SOAPDate.new
+ assert_equal(XSD::Namespace, o.type.namespace)
+ assert_equal(XSD::DateLiteral, o.type.name)
+ assert_equal(nil, o.data)
+ assert_equal(true, o.is_nil)
+
+ targets = [
+ "2002-05-18Z",
+ "0001-01-01Z",
+ "9999-12-31Z",
+ "19999-12-31Z",
+ "2002-12-31+09:00",
+ "2002-12-31+00:01",
+ "2002-12-31-00:01",
+ "2002-12-31-23:59",
+ "2002-12-31+13:30",
+ "-2002-05-18Z",
+ "-19999-12-31Z",
+ "-2002-12-31+00:01",
+ "-0001-12-31+13:30",
+ ]
+ targets.each do |str|
+ assert_parsed_result(SOAP::SOAPDate, str)
+ end
+
+ targets = [
+ ["2002-12-31",
+ "2002-12-31Z"],
+ ["2002-12-31+00:00",
+ "2002-12-31Z"],
+ ["2002-12-31-00:00",
+ "2002-12-31Z"],
+ ["-2002-12-31",
+ "-2002-12-31Z"],
+ ["-2002-12-31+00:00",
+ "-2002-12-31Z"],
+ ["-2002-12-31-00:00",
+ "-2002-12-31Z"],
+ ]
+ targets.each do |data, expected|
+ assert_equal(expected, SOAP::SOAPDate.new(data).to_s)
+ d = Date.parse(data)
+ d >>= 12 if d.year < 0 # XSDDate.year(-1) == Date.year(0)
+ assert_equal(expected, SOAP::SOAPDate.new(d).to_s)
+ end
+ end
+
+ def test_SOAPGYearMonth
+ o = SOAP::SOAPGYearMonth.new
+ assert_equal(XSD::Namespace, o.type.namespace)
+ assert_equal(XSD::GYearMonthLiteral, o.type.name)
+ assert_equal(nil, o.data)
+ assert_equal(true, o.is_nil)
+
+ targets = [
+ "2002-05Z",
+ "0001-01Z",
+ "9999-12Z",
+ "19999-12Z",
+ "2002-12+09:00",
+ "2002-12+00:01",
+ "2002-12-00:01",
+ "2002-12-23:59",
+ "2002-12+13:30",
+ "-2002-05Z",
+ "-19999-12Z",
+ "-2002-12+00:01",
+ "-0001-12+13:30",
+ ]
+ targets.each do |str|
+ assert_parsed_result(SOAP::SOAPGYearMonth, str)
+ end
+
+ targets = [
+ ["2002-12",
+ "2002-12Z"],
+ ["2002-12+00:00",
+ "2002-12Z"],
+ ["2002-12-00:00",
+ "2002-12Z"],
+ ["-2002-12",
+ "-2002-12Z"],
+ ["-2002-12+00:00",
+ "-2002-12Z"],
+ ["-2002-12-00:00",
+ "-2002-12Z"],
+ ]
+ targets.each do |data, expected|
+ assert_equal(expected, SOAP::SOAPGYearMonth.new(data).to_s)
+ end
+ end
+
+ def test_SOAPGYear
+ o = SOAP::SOAPGYear.new
+ assert_equal(XSD::Namespace, o.type.namespace)
+ assert_equal(XSD::GYearLiteral, o.type.name)
+ assert_equal(nil, o.data)
+ assert_equal(true, o.is_nil)
+
+ targets = [
+ "2002Z",
+ "0001Z",
+ "9999Z",
+ "19999Z",
+ "2002+09:00",
+ "2002+00:01",
+ "2002-00:01",
+ "2002-23:59",
+ "2002+13:30",
+ "-2002Z",
+ "-19999Z",
+ "-2002+00:01",
+ "-0001+13:30",
+ ]
+ targets.each do |str|
+ assert_parsed_result(SOAP::SOAPGYear, str)
+ end
+
+ targets = [
+ ["2002",
+ "2002Z"],
+ ["2002+00:00",
+ "2002Z"],
+ ["2002-00:00",
+ "2002Z"],
+ ["-2002",
+ "-2002Z"],
+ ["-2002+00:00",
+ "-2002Z"],
+ ["-2002-00:00",
+ "-2002Z"],
+ ]
+ targets.each do |data, expected|
+ assert_equal(expected, SOAP::SOAPGYear.new(data).to_s)
+ end
+ end
+
+ def test_SOAPGMonthDay
+ o = SOAP::SOAPGMonthDay.new
+ assert_equal(XSD::Namespace, o.type.namespace)
+ assert_equal(XSD::GMonthDayLiteral, o.type.name)
+ assert_equal(nil, o.data)
+ assert_equal(true, o.is_nil)
+
+ targets = [
+ "05-18Z",
+ "01-01Z",
+ "12-31Z",
+ "12-31+09:00",
+ "12-31+00:01",
+ "12-31-00:01",
+ "12-31-23:59",
+ "12-31+13:30",
+ ]
+ targets.each do |str|
+ assert_parsed_result(SOAP::SOAPGMonthDay, str)
+ end
+
+ targets = [
+ ["12-31",
+ "12-31Z"],
+ ["12-31+00:00",
+ "12-31Z"],
+ ["12-31-00:00",
+ "12-31Z"],
+ ]
+ targets.each do |data, expected|
+ assert_equal(expected, SOAP::SOAPGMonthDay.new(data).to_s)
+ end
+ end
+
+ def test_SOAPGDay
+ o = SOAP::SOAPGDay.new
+ assert_equal(XSD::Namespace, o.type.namespace)
+ assert_equal(XSD::GDayLiteral, o.type.name)
+ assert_equal(nil, o.data)
+ assert_equal(true, o.is_nil)
+
+ targets = [
+ "18Z",
+ "01Z",
+ "31Z",
+ "31+09:00",
+ "31+00:01",
+ "31-00:01",
+ "31-23:59",
+ "31+13:30",
+ ]
+ targets.each do |str|
+ assert_parsed_result(SOAP::SOAPGDay, str)
+ end
+
+ targets = [
+ ["31",
+ "31Z"],
+ ["31+00:00",
+ "31Z"],
+ ["31-00:00",
+ "31Z"],
+ ]
+ targets.each do |data, expected|
+ assert_equal(expected, SOAP::SOAPGDay.new(data).to_s)
+ end
+ end
+
+ def test_SOAPGMonth
+ o = SOAP::SOAPGMonth.new
+ assert_equal(XSD::Namespace, o.type.namespace)
+ assert_equal(XSD::GMonthLiteral, o.type.name)
+ assert_equal(nil, o.data)
+ assert_equal(true, o.is_nil)
+
+ targets = [
+ "05Z",
+ "01Z",
+ "12Z",
+ "12+09:00",
+ "12+00:01",
+ "12-00:01",
+ "12-23:59",
+ "12+13:30",
+ ]
+ targets.each do |str|
+ assert_parsed_result(SOAP::SOAPGMonth, str)
+ end
+
+ targets = [
+ ["12",
+ "12Z"],
+ ["12+00:00",
+ "12Z"],
+ ["12-00:00",
+ "12Z"],
+ ]
+ targets.each do |data, expected|
+ assert_equal(expected, SOAP::SOAPGMonth.new(data).to_s)
+ end
+ end
+
+ def test_SOAPHexBinary
+ o = SOAP::SOAPHexBinary.new
+ assert_equal(XSD::Namespace, o.type.namespace)
+ assert_equal(XSD::HexBinaryLiteral, o.type.name)
+ assert_equal(nil, o.data)
+ assert_equal(true, o.is_nil)
+
+ targets = [
+ "abcdef",
+ "\xe3\x81\xaa\xe3\x81\xb2",
+ "\0",
+ "",
+ ]
+ targets.each do |str|
+ assert_equal(str, SOAP::SOAPHexBinary.new(str).string)
+ assert_equal(str.unpack("H*")[0].tr('a-f', 'A-F'),
+ SOAP::SOAPHexBinary.new(str).data)
+ o = SOAP::SOAPHexBinary.new
+ o.set_encoded(str.unpack("H*")[0].tr('a-f', 'A-F'))
+ assert_equal(str, o.string)
+ o.set_encoded(str.unpack("H*")[0].tr('A-F', 'a-f'))
+ assert_equal(str, o.string)
+ end
+
+ targets = [
+ "0FG7",
+ "0fg7",
+ ]
+ targets.each do |d|
+ assert_raises(XSD::ValueSpaceError, d.to_s) do
+ o = SOAP::SOAPHexBinary.new
+ o.set_encoded(d)
+ p o.string
+ end
+ end
+ end
+
+ def test_SOAPBase64Binary
+ o = SOAP::SOAPBase64.new
+ assert_equal(SOAP::EncodingNamespace, o.type.namespace)
+ assert_equal(SOAP::Base64Literal, o.type.name)
+ assert_equal(nil, o.data)
+ assert_equal(true, o.is_nil)
+
+ targets = [
+ "abcdef",
+ "\xe3\x81\xaa\xe3\x81\xb2",
+ "\0",
+ "",
+ ]
+ targets.each do |str|
+ assert_equal(str, SOAP::SOAPBase64.new(str).string)
+ assert_equal([str].pack("m").chomp, SOAP::SOAPBase64.new(str).data)
+ o = SOAP::SOAPBase64.new
+ o.set_encoded([str].pack("m").chomp)
+ assert_equal(str, o.string)
+ end
+
+ targets = [
+ "-",
+ "*",
+ ]
+ targets.each do |d|
+ assert_raises(XSD::ValueSpaceError, d.to_s) do
+ o = SOAP::SOAPBase64.new
+ o.set_encoded(d)
+ p o.string
+ end
+ end
+ end
+
+ def test_SOAPAnyURI
+ o = SOAP::SOAPAnyURI.new
+ assert_equal(XSD::Namespace, o.type.namespace)
+ assert_equal(XSD::AnyURILiteral, o.type.name)
+ assert_equal(nil, o.data)
+ assert_equal(true, o.is_nil)
+
+ # Too few tests here I know. Believe uri module. :)
+ targets = [
+ "foo",
+ "http://foo",
+ "http://foo/bar/baz",
+ "http://foo/bar#baz",
+ "http://foo/bar%20%20?a+b",
+ "HTTP://FOO/BAR%20%20?A+B",
+ ]
+ targets.each do |str|
+ assert_parsed_result(SOAP::SOAPAnyURI, str)
+ end
+ end
+
+ def test_SOAPQName
+ o = SOAP::SOAPQName.new
+ assert_equal(XSD::Namespace, o.type.namespace)
+ assert_equal(XSD::QNameLiteral, o.type.name)
+ assert_equal(nil, o.data)
+ assert_equal(true, o.is_nil)
+
+ # More strict test is needed but current implementation allows all non-':'
+ # chars like ' ', C0 or C1...
+ targets = [
+ "foo",
+ "foo:bar",
+ "a:b",
+ ]
+ targets.each do |str|
+ assert_parsed_result(SOAP::SOAPQName, str)
+ end
+ end
+
+
+ ###
+ ## Derived types
+ #
+
+ def test_SOAPInteger
+ o = SOAP::SOAPInteger.new
+ assert_equal(XSD::Namespace, o.type.namespace)
+ assert_equal(XSD::IntegerLiteral, o.type.name)
+ assert_equal(nil, o.data)
+ assert_equal(true, o.is_nil)
+
+ targets = [
+ 0,
+ 1000000000,
+ -9999999999,
+ 12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890,
+ 12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890,
+ -1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789,
+ ]
+ targets.each do |int|
+ assert_equal(int, SOAP::SOAPInteger.new(int).data)
+ end
+
+ targets = [
+ "0",
+ "1000000000",
+ "-9999999999",
+ "12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890",
+ "12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890",
+ "-1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789",
+ ]
+ targets.each do |str|
+ assert_equal(str, SOAP::SOAPInteger.new(str).to_s)
+ end
+
+ targets = [
+ ["-0", "0"],
+ ["+0", "0"],
+ ["000123", "123"],
+ ["-000123", "-123"],
+ [
+ "+12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890",
+ "12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890"
+ ],
+ ]
+ targets.each do |data, expected|
+ assert_equal(expected, SOAP::SOAPInteger.new(data).to_s)
+ end
+
+ targets = [
+ "0.0",
+ "-5.2",
+ "0.000000000000a",
+ "+-5",
+ "12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890."
+ ]
+ targets.each do |d|
+ assert_raises(XSD::ValueSpaceError) do
+ SOAP::SOAPInteger.new(d)
+ end
+ end
+ end
+
+ def test_SOAPLong
+ o = SOAP::SOAPLong.new
+ assert_equal(XSD::Namespace, o.type.namespace)
+ assert_equal(XSD::LongLiteral, o.type.name)
+ assert_equal(nil, o.data)
+ assert_equal(true, o.is_nil)
+
+ targets = [
+ 0,
+ 123,
+ -123,
+ 9223372036854775807,
+ -9223372036854775808,
+ ]
+ targets.each do |lng|
+ assert_equal(lng, SOAP::SOAPLong.new(lng).data)
+ end
+
+ targets = [
+ "0",
+ "123",
+ "-123",
+ "9223372036854775807",
+ "-9223372036854775808",
+ ]
+ targets.each do |str|
+ assert_equal(str, SOAP::SOAPLong.new(str).to_s)
+ end
+
+ targets = [
+ ["-0", "0"],
+ ["+0", "0"],
+ ["000123", "123"],
+ ["-000123", "-123"],
+ ]
+ targets.each do |data, expected|
+ assert_equal(expected, SOAP::SOAPLong.new(data).to_s)
+ end
+
+ targets = [
+ 9223372036854775808,
+ -9223372036854775809,
+ "0.0",
+ "-5.2",
+ "0.000000000000a",
+ "+-5",
+ ]
+ targets.each do |d|
+ assert_raises(XSD::ValueSpaceError) do
+ SOAP::SOAPLong.new(d)
+ end
+ end
+ end
+
+ def test_SOAPInt
+ o = SOAP::SOAPInt.new
+ assert_equal(XSD::Namespace, o.type.namespace)
+ assert_equal(XSD::IntLiteral, o.type.name)
+ assert_equal(nil, o.data)
+ assert_equal(true, o.is_nil)
+
+ targets = [
+ 0,
+ 123,
+ -123,
+ 2147483647,
+ -2147483648,
+ ]
+ targets.each do |lng|
+ assert_equal(lng, SOAP::SOAPInt.new(lng).data)
+ end
+
+ targets = [
+ "0",
+ "123",
+ "-123",
+ "2147483647",
+ "-2147483648",
+ ]
+ targets.each do |str|
+ assert_equal(str, SOAP::SOAPInt.new(str).to_s)
+ end
+
+ targets = [
+ ["-0", "0"],
+ ["+0", "0"],
+ ["000123", "123"],
+ ["-000123", "-123"],
+ ]
+ targets.each do |data, expected|
+ assert_equal(expected, SOAP::SOAPInt.new(data).to_s)
+ end
+
+ targets = [
+ 2147483648,
+ -2147483649,
+ "0.0",
+ "-5.2",
+ "0.000000000000a",
+ "+-5",
+ ]
+ targets.each do |d|
+ assert_raises(XSD::ValueSpaceError) do
+ SOAP::SOAPInt.new(d)
+ end
+ end
+ end
+end
+
+
+end
diff --git a/test/soap/test_envelopenamespace.rb b/test/soap/test_envelopenamespace.rb
new file mode 100644
index 0000000000..5b7d281341
--- /dev/null
+++ b/test/soap/test_envelopenamespace.rb
@@ -0,0 +1,92 @@
+require 'test/unit'
+require 'soap/rpc/driver'
+require 'webrick'
+require 'logger'
+
+
+module SOAP
+
+
+class TestEnvelopeNamespace < Test::Unit::TestCase
+ Port = 17171
+ TemporaryNamespace = 'urn:foo'
+
+ def setup
+ @logger = Logger.new(STDERR)
+ @logger.level = Logger::Severity::ERROR
+ @url = "http://localhost:#{Port}/"
+ @server = @client = nil
+ @server_thread = nil
+ setup_server
+ setup_client
+ end
+
+ def teardown
+ teardown_client
+ teardown_server
+ end
+
+ def setup_server
+ @server = WEBrick::HTTPServer.new(
+ :BindAddress => "0.0.0.0",
+ :Logger => @logger,
+ :Port => Port,
+ :AccessLog => [],
+ :DocumentRoot => File.dirname(File.expand_path(__FILE__))
+ )
+ @server.mount(
+ '/',
+ WEBrick::HTTPServlet::ProcHandler.new(method(:do_server_proc).to_proc)
+ )
+ @server_thread = start_server_thread(@server)
+ end
+
+ def setup_client
+ @client = SOAP::RPC::Driver.new(@url, '')
+ @client.add_method("do_server_proc")
+ end
+
+ def teardown_server
+ @server.shutdown
+ @server_thread.kill
+ @server_thread.join
+ end
+
+ def teardown_client
+ @client.reset_stream
+ end
+
+ def start_server_thread(server)
+ t = Thread.new {
+ Thread.current.abort_on_exception = true
+ server.start
+ }
+ t
+ end
+
+ def do_server_proc(req, res)
+ res['content-type'] = 'text/xml'
+ res.body = <<__EOX__
+<?xml version="1.0" encoding="utf-8" ?>
+<env:Envelope xmlns:env="#{TemporaryNamespace}">
+ <env:Body>
+ <n1:do_server_proc xmlns:n1="urn:foo" env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
+ <return>hello world</return>
+ </n1:do_server_proc>
+ </env:Body>
+</env:Envelope>
+__EOX__
+ end
+
+ def test_normal
+ assert_raise(SOAP::ResponseFormatError) do
+ @client.do_server_proc
+ end
+ @client.options["soap.envelope.requestnamespace"] = TemporaryNamespace
+ @client.options["soap.envelope.responsenamespace"] = TemporaryNamespace
+ assert_equal('hello world', @client.do_server_proc)
+ end
+end
+
+
+end
diff --git a/test/soap/test_httpconfigloader.rb b/test/soap/test_httpconfigloader.rb
new file mode 100644
index 0000000000..b06243f661
--- /dev/null
+++ b/test/soap/test_httpconfigloader.rb
@@ -0,0 +1,39 @@
+require 'test/unit'
+require 'soap/httpconfigloader'
+require 'soap/rpc/driver'
+
+if defined?(HTTPAccess2)
+
+module SOAP
+
+
+class TestHTTPConfigLoader < Test::Unit::TestCase
+ DIR = File.dirname(File.expand_path(__FILE__))
+
+ def setup
+ @client = SOAP::RPC::Driver.new(nil, nil)
+ end
+
+ def test_property
+ testpropertyname = File.join(DIR, 'soapclient.properties')
+ File.open(testpropertyname, "w") do |f|
+ f <<<<__EOP__
+protocol.http.ssl_config.verify_mode = OpenSSL::SSL::VERIFY_PEER
+# depth: 1 causes an error (intentional)
+protocol.http.ssl_config.verify_depth = 1
+protocol.http.ssl_config.ciphers = ALL
+__EOP__
+ end
+ begin
+ @client.loadproperty(testpropertyname)
+ assert_equal('ALL', @client.options['protocol.http.ssl_config.ciphers'])
+ ensure
+ File.unlink(testpropertyname)
+ end
+ end
+end
+
+
+end
+
+end
diff --git a/test/soap/test_mapping.rb b/test/soap/test_mapping.rb
new file mode 100644
index 0000000000..26222e6719
--- /dev/null
+++ b/test/soap/test_mapping.rb
@@ -0,0 +1,59 @@
+require 'test/unit'
+require 'soap/mapping'
+
+
+module SOAP
+
+
+class TestMapping < Test::Unit::TestCase
+ def test_date
+ targets = [
+ ["2002-12-31",
+ "2002-12-31Z"],
+ ["2002-12-31+00:00",
+ "2002-12-31Z"],
+ ["2002-12-31-00:00",
+ "2002-12-31Z"],
+ ["-2002-12-31",
+ "-2002-12-31Z"],
+ ["-2002-12-31+00:00",
+ "-2002-12-31Z"],
+ ["-2002-12-31-00:00",
+ "-2002-12-31Z"],
+ ]
+ targets.each do |str, expectec|
+ d = Date.parse(str)
+ assert_equal(d.class, convert(d).class)
+ assert_equal(d, convert(d))
+ end
+ end
+
+ def test_datetime
+ targets = [
+ ["2002-12-31T23:59:59.00",
+ "2002-12-31T23:59:59Z"],
+ ["2002-12-31T23:59:59+00:00",
+ "2002-12-31T23:59:59Z"],
+ ["2002-12-31T23:59:59-00:00",
+ "2002-12-31T23:59:59Z"],
+ ["-2002-12-31T23:59:59.00",
+ "-2002-12-31T23:59:59Z"],
+ ["-2002-12-31T23:59:59+00:00",
+ "-2002-12-31T23:59:59Z"],
+ ["-2002-12-31T23:59:59-00:00",
+ "-2002-12-31T23:59:59Z"],
+ ]
+ targets.each do |str, expectec|
+ d = DateTime.parse(str)
+ assert_equal(d.class, convert(d).class)
+ assert_equal(d, convert(d))
+ end
+ end
+
+ def convert(obj)
+ SOAP::Mapping.soap2obj(SOAP::Mapping.obj2soap(obj))
+ end
+end
+
+
+end
diff --git a/test/soap/test_no_indent.rb b/test/soap/test_no_indent.rb
new file mode 100644
index 0000000000..f49fb7389f
--- /dev/null
+++ b/test/soap/test_no_indent.rb
@@ -0,0 +1,86 @@
+require 'test/unit'
+require 'soap/rpc/standaloneServer'
+require 'soap/rpc/driver'
+
+if defined?(HTTPAccess2)
+
+module SOAP
+
+
+class TestNoIndent < Test::Unit::TestCase
+ Port = 17171
+
+ class NopServer < SOAP::RPC::StandaloneServer
+ def initialize(*arg)
+ super
+ add_rpc_method(self, 'nop')
+ end
+
+ def nop
+ SOAP::RPC::SOAPVoid.new
+ end
+ end
+
+ def setup
+ @server = NopServer.new(self.class.name, nil, '0.0.0.0', Port)
+ @server.level = Logger::Severity::ERROR
+ @t = Thread.new {
+ @server.start
+ }
+ @endpoint = "http://localhost:#{Port}/"
+ @client = SOAP::RPC::Driver.new(@endpoint)
+ @client.add_rpc_method('nop')
+ end
+
+ def teardown
+ @server.shutdown
+ @t.kill
+ @t.join
+ @client.reset_stream
+ end
+
+ INDENT_XML =
+%q[<?xml version="1.0" encoding="utf-8" ?>
+<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <env:Body>
+ <nop env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
+ </nop>
+ </env:Body>
+</env:Envelope>]
+
+ NO_INDENT_XML =
+%q[<?xml version="1.0" encoding="utf-8" ?>
+<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
+xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+<env:Body>
+<nop env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
+</nop>
+</env:Body>
+</env:Envelope>]
+
+ def test_indent
+ @client.wiredump_dev = str = ''
+ @client.options["soap.envelope.no_indent"] = false
+ @client.nop
+ assert_equal(INDENT_XML, parse_requestxml(str))
+ end
+
+ def test_no_indent
+ @client.wiredump_dev = str = ''
+ @client.options["soap.envelope.no_indent"] = true
+ @client.nop
+ assert_equal(NO_INDENT_XML, parse_requestxml(str))
+ end
+
+ def parse_requestxml(str)
+ str.split(/\r?\n\r?\n/)[3]
+ end
+end
+
+
+end
+
+end
diff --git a/test/soap/test_property.rb b/test/soap/test_property.rb
new file mode 100644
index 0000000000..7acd2c8437
--- /dev/null
+++ b/test/soap/test_property.rb
@@ -0,0 +1,424 @@
+require 'test/unit'
+require 'soap/property'
+
+
+module SOAP
+
+
+class TestProperty < Test::Unit::TestCase
+ FrozenError = (RUBY_VERSION >= "1.9.0") ? RuntimeError : TypeError
+
+ def setup
+ @prop = ::SOAP::Property.new
+ end
+
+ def teardown
+ # Nothing to do.
+ end
+
+ def test_s_load
+ propstr = <<__EOP__
+
+# comment1
+
+# comment2\r
+# comment2
+
+\r
+a.b.0 = 1
+a.b.1 = 2
+a.b.2 = 3
+client.protocol.http.proxy=http://myproxy:8080 \r
+client.protocol.http.no_proxy: intranet.example.com,local.example.com\r
+client.protocol.http.protocol_version = 1.0
+foo\\:bar\\=baz = qux
+foo\\\\.bar.baz=\tq\\\\ux\ttab
+ a\\ b = 1
+[ppp.qqq.rrr]
+sss = 3
+ttt.uuu = 4
+
+[ sss.ttt.uuu ]
+vvv.www = 5
+[ ]
+xxx.yyy.zzz = 6
+__EOP__
+ prop = Property.load(propstr)
+ assert_equal(["1", "2", "3"], prop["a.b"].values.sort)
+ assert_equal("intranet.example.com,local.example.com",
+ prop["client.protocol.http.no_proxy"])
+ assert_equal("http://myproxy:8080", prop["client.protocol.http.proxy"])
+ assert_equal("1.0", prop["client.protocol.http.protocol_version"])
+ assert_equal("q\\ux\ttab", prop['foo\.bar.baz'])
+ assert_equal("1", prop['a b'])
+ assert_equal("3", prop['ppp.qqq.rrr.sss'])
+ assert_equal("4", prop['ppp.qqq.rrr.ttt.uuu'])
+ assert_equal("5", prop['sss.ttt.uuu.vvv.www'])
+ assert_equal("6", prop['xxx.yyy.zzz'])
+ end
+
+ def test_load
+ prop = Property.new
+ hooked = false
+ prop.add_hook("foo.bar.baz") do |name, value|
+ assert_equal(["foo", "bar", "baz"], name)
+ assert_equal("123", value)
+ hooked = true
+ end
+ prop.lock
+ prop["foo.bar"].lock
+ prop.load("foo.bar.baz = 123")
+ assert(hooked)
+ assert_raises(FrozenError) do
+ prop.load("foo.bar.qux = 123")
+ end
+ prop.load("foo.baz = 456")
+ assert_equal("456", prop["foo.baz"])
+ end
+
+ def test_initialize
+ prop = ::SOAP::Property.new
+ # store is empty
+ assert_nil(prop["a"])
+ # does hook work?
+ assert_equal(1, prop["a"] = 1)
+ end
+
+ def test_aref
+ # name_to_a
+ assert_nil(@prop[:foo])
+ assert_nil(@prop["foo"])
+ assert_nil(@prop[[:foo]])
+ assert_nil(@prop[["foo"]])
+ assert_raises(ArgumentError) do
+ @prop[1]
+ end
+ @prop[:foo] = :foo
+ assert_equal(:foo, @prop[:foo])
+ assert_equal(:foo, @prop["foo"])
+ assert_equal(:foo, @prop[[:foo]])
+ assert_equal(:foo, @prop[["foo"]])
+ end
+
+ def test_referent
+ # referent(1)
+ assert_nil(@prop["foo.foo"])
+ assert_nil(@prop[["foo", "foo"]])
+ assert_nil(@prop[["foo", :foo]])
+ @prop["foo.foo"] = :foo
+ assert_equal(:foo, @prop["foo.foo"])
+ assert_equal(:foo, @prop[["foo", "foo"]])
+ assert_equal(:foo, @prop[[:foo, "foo"]])
+ # referent(2)
+ @prop["bar.bar.bar"] = :bar
+ assert_equal(:bar, @prop["bar.bar.bar"])
+ assert_equal(:bar, @prop[["bar", "bar", "bar"]])
+ assert_equal(:bar, @prop[[:bar, "bar", :bar]])
+ end
+
+ def test_to_key_and_deref
+ @prop["foo.foo"] = :foo
+ assert_equal(:foo, @prop["fOo.FoO"])
+ assert_equal(:foo, @prop[[:fOO, :FOO]])
+ assert_equal(:foo, @prop[["FoO", :Foo]])
+ # deref_key negative test
+ assert_raises(ArgumentError) do
+ @prop["baz"] = 1
+ @prop["baz.qux"] = 2
+ end
+ end
+
+ def test_hook_name
+ tag = Object.new
+ tested = false
+ @prop.add_hook("foo.bar") do |key, value|
+ assert_raise(FrozenError) do
+ key << "baz"
+ end
+ tested = true
+ end
+ @prop["foo.bar"] = tag
+ assert(tested)
+ end
+
+ def test_value_hook
+ tag = Object.new
+ tested = false
+ @prop.add_hook("FOO.BAR.BAZ") do |key, value|
+ assert_equal(["Foo", "baR", "baZ"], key)
+ assert_equal(tag, value)
+ tested = true
+ end
+ @prop["Foo.baR.baZ"] = tag
+ assert_equal(tag, @prop["foo.bar.baz"])
+ assert(tested)
+ @prop["foo.bar"] = 1 # unhook the above block
+ assert_equal(1, @prop["foo.bar"])
+ end
+
+ def test_key_hook_no_cascade
+ tag = Object.new
+ tested = 0
+ @prop.add_hook do |key, value|
+ assert(false)
+ end
+ @prop.add_hook(false) do |key, value|
+ assert(false)
+ end
+ @prop.add_hook("foo") do |key, value|
+ assert(false)
+ end
+ @prop.add_hook("foo.bar", false) do |key, value|
+ assert(false)
+ end
+ @prop.add_hook("foo.bar.baz") do |key, value|
+ assert(false)
+ end
+ @prop.add_hook("foo.bar.baz.qux", false) do |key, value|
+ assert_equal(["foo", "bar", "baz", "qux"], key)
+ assert_equal(tag, value)
+ tested += 1
+ end
+ @prop["foo.bar.baz.qux"] = tag
+ assert_equal(tag, @prop["foo.bar.baz.qux"])
+ assert_equal(1, tested)
+ end
+
+ def test_key_hook_cascade
+ tag = Object.new
+ tested = 0
+ @prop.add_hook(true) do |key, value|
+ assert_equal(["foo", "bar", "baz", "qux"], key)
+ assert_equal(tag, value)
+ tested += 1
+ end
+ @prop.add_hook("foo", true) do |key, value|
+ assert_equal(["foo", "bar", "baz", "qux"], key)
+ assert_equal(tag, value)
+ tested += 1
+ end
+ @prop.add_hook("foo.bar", true) do |key, value|
+ assert_equal(["foo", "bar", "baz", "qux"], key)
+ assert_equal(tag, value)
+ tested += 1
+ end
+ @prop.add_hook("foo.bar.baz", true) do |key, value|
+ assert_equal(["foo", "bar", "baz", "qux"], key)
+ assert_equal(tag, value)
+ tested += 1
+ end
+ @prop.add_hook("foo.bar.baz.qux", true) do |key, value|
+ assert_equal(["foo", "bar", "baz", "qux"], key)
+ assert_equal(tag, value)
+ tested += 1
+ end
+ @prop["foo.bar.baz.qux"] = tag
+ assert_equal(tag, @prop["foo.bar.baz.qux"])
+ assert_equal(5, tested)
+ end
+
+ def test_keys
+ assert(@prop.keys.empty?)
+ @prop["foo"] = 1
+ @prop["bar"]
+ @prop["BAz"] = 2
+ assert_equal(2, @prop.keys.size)
+ assert(@prop.keys.member?("foo"))
+ assert(@prop.keys.member?("baz"))
+ #
+ assert_nil(@prop["a"])
+ @prop["a.a"] = 1
+ assert_instance_of(::SOAP::Property, @prop["a"])
+ @prop["a.b"] = 1
+ @prop["a.c"] = 1
+ assert_equal(3, @prop["a"].keys.size)
+ assert(@prop["a"].keys.member?("a"))
+ assert(@prop["a"].keys.member?("b"))
+ assert(@prop["a"].keys.member?("c"))
+ end
+
+ def test_lshift
+ assert(@prop.empty?)
+ @prop << 1
+ assert_equal([1], @prop.values)
+ assert_equal(1, @prop["0"])
+ @prop << 1
+ assert_equal([1, 1], @prop.values)
+ assert_equal(1, @prop["1"])
+ @prop << 1
+ assert_equal([1, 1, 1], @prop.values)
+ assert_equal(1, @prop["2"])
+ #
+ @prop["abc.def"] = o = SOAP::Property.new
+ tested = 0
+ o.add_hook do |k, v|
+ tested += 1
+ end
+ @prop["abc.def"] << 1
+ @prop["abc.def"] << 2
+ @prop["abc.def"] << 3
+ @prop["abc.def"] << 4
+ assert_equal(4, tested)
+ end
+
+ def test_lock_each
+ @prop["a.b.c.d.e"] = 1
+ @prop["a.b.d"] = branch = ::SOAP::Property.new
+ @prop["a.b.d.e.f"] = 2
+ @prop.lock
+ assert(@prop.locked?)
+ assert_instance_of(::SOAP::Property, @prop["a"])
+ assert_raises(FrozenError) do
+ @prop["b"]
+ end
+ #
+ @prop["a"].lock
+ assert_raises(FrozenError) do
+ @prop["a"]
+ end
+ assert_instance_of(::SOAP::Property, @prop["a.b"])
+ #
+ @prop["a.b"].lock
+ assert_raises(FrozenError) do
+ @prop["a.b"]
+ end
+ assert_raises(FrozenError) do
+ @prop["a"]
+ end
+ #
+ @prop["a.b.c.d"].lock
+ assert_instance_of(::SOAP::Property, @prop["a.b.c"])
+ assert_raises(FrozenError) do
+ @prop["a.b.c.d"]
+ end
+ assert_instance_of(::SOAP::Property, @prop["a.b.d"])
+ #
+ branch["e"].lock
+ assert_instance_of(::SOAP::Property, @prop["a.b.d"])
+ assert_raises(FrozenError) do
+ @prop["a.b.d.e"]
+ end
+ assert_raises(FrozenError) do
+ branch["e"]
+ end
+ end
+
+ def test_lock_cascade
+ @prop["a.a"] = nil
+ @prop["a.b.c"] = 1
+ @prop["b"] = false
+ @prop.lock(true)
+ assert(@prop.locked?)
+ assert_equal(nil, @prop["a.a"])
+ assert_equal(1, @prop["a.b.c"])
+ assert_equal(false, @prop["b"])
+ assert_raises(FrozenError) do
+ @prop["c"]
+ end
+ assert_raises(FrozenError) do
+ @prop["c"] = 2
+ end
+ assert_raises(FrozenError) do
+ @prop["a.b.R"]
+ end
+ assert_raises(FrozenError) do
+ @prop.add_hook do
+ assert(false)
+ end
+ end
+ assert_raises(FrozenError) do
+ @prop.add_hook("c") do
+ assert(false)
+ end
+ end
+ assert_raises(FrozenError) do
+ @prop.add_hook("a.c") do
+ assert(false)
+ end
+ end
+ assert_nil(@prop["a.a"])
+ @prop["a.a"] = 2
+ assert_equal(2, @prop["a.a"])
+ #
+ @prop.unlock(true)
+ assert_nil(@prop["c"])
+ @prop["c"] = 2
+ assert_equal(2, @prop["c"])
+ @prop["a.d.a.a"] = :foo
+ assert_equal(:foo, @prop["a.d.a.a"])
+ tested = false
+ @prop.add_hook("a.c") do |name, value|
+ assert(true)
+ tested = true
+ end
+ @prop["a.c"] = 3
+ assert(tested)
+ end
+
+ def test_hook_then_lock
+ tested = false
+ @prop.add_hook("a.b.c") do |name, value|
+ assert_equal(["a", "b", "c"], name)
+ tested = true
+ end
+ @prop["a.b"].lock
+ assert(!tested)
+ @prop["a.b.c"] = 5
+ assert(tested)
+ assert_equal(5, @prop["a.b.c"])
+ assert_raises(FrozenError) do
+ @prop["a.b.d"] = 5
+ end
+ end
+
+ def test_lock_unlock_return
+ assert_equal(@prop, @prop.lock)
+ assert_equal(@prop, @prop.unlock)
+ end
+
+ def test_lock_split
+ @prop["a.b.c"] = 1
+ assert_instance_of(::SOAP::Property, @prop["a.b"])
+ @prop["a.b.d"] = branch = ::SOAP::Property.new
+ @prop["a.b.d.e"] = 2
+ assert_equal(branch, @prop["a.b.d"])
+ assert_equal(branch, @prop[:a][:b][:d])
+ @prop.lock(true)
+ # split error 1
+ assert_raises(FrozenError) do
+ @prop["a.b"]
+ end
+ # split error 2
+ assert_raises(FrozenError) do
+ @prop["a"]
+ end
+ @prop["a.b.c"] = 2
+ assert_equal(2, @prop["a.b.c"])
+ # replace error
+ assert_raises(FrozenError) do
+ @prop["a.b.c"] = ::SOAP::Property.new
+ end
+ # override error
+ assert_raises(FrozenError) do
+ @prop["a.b"] = 1
+ end
+ #
+ assert_raises(FrozenError) do
+ @prop["a.b.d"] << 1
+ end
+ assert_raises(FrozenError) do
+ branch << 1
+ end
+ branch.unlock(true)
+ branch << 1
+ branch << 2
+ branch << 3
+ assert_equal(2, @prop["a.b.d.e"])
+ assert_equal(1, @prop["a.b.d.1"])
+ assert_equal(2, @prop["a.b.d.2"])
+ assert_equal(3, @prop["a.b.d.3"])
+ end
+end
+
+
+end
diff --git a/test/soap/test_soapelement.rb b/test/soap/test_soapelement.rb
new file mode 100644
index 0000000000..66e2a836a4
--- /dev/null
+++ b/test/soap/test_soapelement.rb
@@ -0,0 +1,122 @@
+require 'test/unit'
+require 'soap/baseData'
+require 'soap/mapping'
+
+
+module SOAP
+
+
+class TestSOAPElement < Test::Unit::TestCase
+ include SOAP
+
+ def setup
+ # Nothing to do.
+ end
+
+ def teardown
+ # Nothing to do.
+ end
+
+ def d(elename = nil, text = nil)
+ elename ||= n(nil, nil)
+ if text
+ SOAPElement.new(elename, text)
+ else
+ SOAPElement.new(elename) # do not merge.
+ end
+ end
+
+ def n(namespace, name)
+ XSD::QName.new(namespace, name)
+ end
+
+ def test_initialize
+ elename = n(nil, nil)
+ obj = d(elename)
+ assert_equal(elename, obj.elename)
+ assert_equal(LiteralNamespace, obj.encodingstyle)
+ assert_equal({}, obj.extraattr)
+ assert_equal([], obj.precedents)
+ assert_equal(nil, obj.qualified)
+ assert_equal(nil, obj.text)
+ assert(obj.members.empty?)
+
+ obj = d("foo", "text")
+ assert_equal(n(nil, "foo"), obj.elename)
+ assert_equal("text", obj.text)
+ end
+
+ def test_add
+ obj = d()
+ child = d("abc")
+ obj.add(child)
+ assert(obj.key?("abc"))
+ assert_same(child, obj["abc"])
+ assert_same(child, obj.abc)
+ def obj.foo; 1; end
+ child = d("foo")
+ obj.add(child)
+ assert_equal(1, obj.foo)
+ assert_equal(child, obj.var_foo)
+ child = d("_?a?b_")
+ obj.add(child)
+ assert_equal(child, obj.__send__('_?a?b_'))
+ end
+
+ def test_member
+ obj = d()
+ c1 = d("c1")
+ obj.add(c1)
+ c2 = d("c2")
+ obj.add(c2)
+ assert(obj.key?("c1"))
+ assert(obj.key?("c2"))
+ assert_equal(c1, obj["c1"])
+ assert_equal(c2, obj["c2"])
+ c22 = d("c22")
+ obj["c2"] = c22
+ assert(obj.key?("c2"))
+ assert_equal(c22, obj["c2"])
+ assert_equal(["c1", "c2"], obj.members.sort)
+ #
+ k_expect = ["c1", "c2"]
+ v_expect = [c1, c22]
+ obj.each do |k, v|
+ assert(k_expect.include?(k))
+ assert(v_expect.include?(v))
+ k_expect.delete(k)
+ v_expect.delete(v)
+ end
+ assert(k_expect.empty?)
+ assert(v_expect.empty?)
+ end
+
+ def test_to_obj
+ obj = d("root")
+ ct1 = d("ct1", "t1")
+ obj.add(ct1)
+ c2 = d("c2")
+ ct2 = d("ct2", "t2")
+ c2.add(ct2)
+ obj.add(c2)
+ assert_equal({ "ct1" => "t1", "c2" => { "ct2" => "t2" }}, obj.to_obj)
+ #
+ assert_equal(nil, d().to_obj)
+ assert_equal("abc", d(nil, "abc").to_obj)
+ assert_equal(nil, d("abc", nil).to_obj)
+ end
+
+ def test_from_obj
+ source = { "ct1" => "t1", "c2" => { "ct2" => "t2" }}
+ assert_equal(source, SOAPElement.from_obj(source).to_obj)
+ source = { "1" => nil }
+ assert_equal(source, SOAPElement.from_obj(source).to_obj)
+ source = {}
+ assert_equal(nil, SOAPElement.from_obj(source).to_obj) # not {}
+ source = nil
+ assert_equal(nil, SOAPElement.from_obj(source).to_obj)
+ end
+end
+
+
+end
diff --git a/test/soap/test_streamhandler.rb b/test/soap/test_streamhandler.rb
new file mode 100644
index 0000000000..c31254513f
--- /dev/null
+++ b/test/soap/test_streamhandler.rb
@@ -0,0 +1,209 @@
+require 'test/unit'
+require 'soap/rpc/driver'
+require 'webrick'
+require 'webrick/httpproxy'
+require 'logger'
+
+
+module SOAP
+
+
+class TestStreamHandler < Test::Unit::TestCase
+ Port = 17171
+ ProxyPort = 17172
+
+ def setup
+ @logger = Logger.new(STDERR)
+ @logger.level = Logger::Severity::ERROR
+ @url = "http://localhost:#{Port}/"
+ @proxyurl = "http://localhost:#{ProxyPort}/"
+ @server = @proxyserver = @client = nil
+ @server_thread = @proxyserver_thread = nil
+ setup_server
+ setup_client
+ end
+
+ def teardown
+ teardown_client
+ teardown_proxyserver if @proxyserver
+ teardown_server
+ end
+
+ def setup_server
+ @server = WEBrick::HTTPServer.new(
+ :BindAddress => "0.0.0.0",
+ :Logger => @logger,
+ :Port => Port,
+ :AccessLog => [],
+ :DocumentRoot => File.dirname(File.expand_path(__FILE__))
+ )
+ @server.mount(
+ '/',
+ WEBrick::HTTPServlet::ProcHandler.new(method(:do_server_proc).to_proc)
+ )
+ @server_thread = start_server_thread(@server)
+ end
+
+ def setup_proxyserver
+ @proxyserver = WEBrick::HTTPProxyServer.new(
+ :BindAddress => "0.0.0.0",
+ :Logger => @logger,
+ :Port => ProxyPort,
+ :AccessLog => []
+ )
+ @proxyserver_thread = start_server_thread(@proxyserver)
+ end
+
+ def setup_client
+ @client = SOAP::RPC::Driver.new(@url, '')
+ @client.add_method("do_server_proc")
+ end
+
+ def teardown_server
+ @server.shutdown
+ @server_thread.kill
+ @server_thread.join
+ end
+
+ def teardown_proxyserver
+ @proxyserver.shutdown
+ @proxyserver_thread.kill
+ @proxyserver_thread.join
+ end
+
+ def teardown_client
+ @client.reset_stream
+ end
+
+ def start_server_thread(server)
+ t = Thread.new {
+ Thread.current.abort_on_exception = true
+ server.start
+ }
+ t
+ end
+
+ def do_server_proc(req, res)
+ res['content-type'] = 'text/xml'
+ res.body = <<__EOX__
+<?xml version="1.0" encoding="utf-8" ?>
+<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <env:Body>
+ <n1:do_server_proc xmlns:n1="urn:foo" env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
+ <return xsi:nil="true"/>
+ </n1:do_server_proc>
+ </env:Body>
+</env:Envelope>
+__EOX__
+ end
+
+ def parse_req_header(str)
+ if ::SOAP::HTTPStreamHandler::Client.to_s == 'SOAP::NetHttpClient'
+ str = eval(str.split(/\r?\n/)[4][3..-1])
+ end
+ parse_req_header_http_access2(str)
+ end
+
+ def parse_req_header_http_access2(str)
+ headerp = false
+ headers = {}
+ req = nil
+ str.split(/(?:\r?\n)/).each do |line|
+ if headerp and /^$/ =~line
+ headerp = false
+ break
+ end
+ if headerp
+ k, v = line.scan(/^([^:]+):\s*(.*)$/)[0]
+ headers[k.downcase] = v
+ end
+ if /^POST/ =~ line
+ req = line
+ headerp = true
+ end
+ end
+ return req, headers
+ end
+
+ def test_normal
+ str = ""
+ @client.wiredump_dev = str
+ assert_nil(@client.do_server_proc)
+ r, h = parse_req_header(str)
+ assert_match(%r"POST / HTTP/1.", r)
+ assert(/^text\/xml;/ =~ h["content-type"])
+ end
+
+ def test_uri
+ # initialize client with URI object
+ @client = SOAP::RPC::Driver.new(URI.parse(@url), '')
+ @client.add_method("do_server_proc")
+ # same as test_normal
+ str = ""
+ @client.wiredump_dev = str
+ assert_nil(@client.do_server_proc)
+ r, h = parse_req_header(str)
+ assert_match(%r"POST / HTTP/1.", r)
+ assert(/^text\/xml;/ =~ h["content-type"])
+ end
+
+ def test_basic_auth
+ unless Object.const_defined?('HTTPAccess2')
+ # soap4r + net/http + basic_auth is not supported.
+ # use http-access2 instead.
+ assert(true)
+ return
+ end
+ str = ""
+ @client.wiredump_dev = str
+ @client.options["protocol.http.basic_auth"] << [@url, "foo", "bar"]
+ assert_nil(@client.do_server_proc)
+ r, h = parse_req_header(str)
+ assert_equal("Basic Zm9vOmJhcg==", h["authorization"])
+ end
+
+ def test_proxy
+ if Object.const_defined?('HTTPAccess2')
+ backup = HTTPAccess2::Client::NO_PROXY_HOSTS.dup
+ HTTPAccess2::Client::NO_PROXY_HOSTS.clear
+ else
+ backup = SOAP::NetHttpClient::NO_PROXY_HOSTS.dup
+ SOAP::NetHttpClient::NO_PROXY_HOSTS.clear
+ end
+ setup_proxyserver
+ str = ""
+ @client.wiredump_dev = str
+ @client.options["protocol.http.proxy"] = @proxyurl
+ assert_nil(@client.do_server_proc)
+ r, h = parse_req_header(str)
+ assert_match(%r"POST http://localhost:17171/ HTTP/1.", r)
+ # illegal proxy uri
+ assert_raise(ArgumentError) do
+ @client.options["protocol.http.proxy"] = 'ftp://foo:8080'
+ end
+ ensure
+ if Object.const_defined?('HTTPAccess2')
+ HTTPAccess2::Client::NO_PROXY_HOSTS.replace(backup)
+ else
+ SOAP::NetHttpClient::NO_PROXY_HOSTS.replace(backup)
+ end
+ end
+
+ def test_charset
+ str = ""
+ @client.wiredump_dev = str
+ @client.options["protocol.http.charset"] = "iso-8859-8"
+ assert_nil(@client.do_server_proc)
+ r, h = parse_req_header(str)
+ assert_equal("text/xml; charset=iso-8859-8", h["content-type"])
+ #
+ str.replace("")
+ @client.options["protocol.http.charset"] = "iso-8859-3"
+ assert_nil(@client.do_server_proc)
+ r, h = parse_req_header(str)
+ assert_equal("text/xml; charset=iso-8859-3", h["content-type"])
+ end
+end
+
+
+end
diff --git a/test/soap/test_styleuse.rb b/test/soap/test_styleuse.rb
new file mode 100644
index 0000000000..4ea321848d
--- /dev/null
+++ b/test/soap/test_styleuse.rb
@@ -0,0 +1,333 @@
+require 'test/unit'
+require 'soap/rpc/httpserver'
+require 'soap/rpc/driver'
+
+
+module SOAP
+
+
+class TestStyleUse < Test::Unit::TestCase
+ # rpc driver: obj in(Hash allowed for literal), obj out
+ #
+ # style: not visible from user
+ # rpc: wrapped element
+ # document: unwrappted element
+ #
+ # use:
+ # encoding: a graph (SOAP Data Model)
+ # literal: not a graph (SOAPElement)
+ #
+ # rpc stub: obj in, obj out(Hash is allowed for literal)
+ #
+ # style: not visible from user
+ # rpc: wrapped element
+ # document: unwrappted element
+ #
+ # use:
+ # encoding: a graph (SOAP Data Model)
+ # literal: not a graph (SOAPElement)
+ #
+ # document driver: SOAPElement in, SOAPElement out? [not implemented]
+ #
+ # style: ditto
+ # use: ditto
+ #
+ #
+ # document stub: SOAPElement in, SOAPElement out? [not implemented]
+ #
+ # style: ditto
+ # use: ditto
+ #
+ class GenericServant
+ # method name style: requeststyle_requestuse_responsestyle_responseuse
+
+ # 2 params -> array
+ def rpc_enc_rpc_enc(obj1, obj2)
+ [obj1, [obj1, obj2]]
+ end
+
+ # 2 objs -> array
+ def rpc_lit_rpc_enc(obj1, obj2)
+ [obj2, obj1]
+ end
+
+ # 2 params -> 2 params
+ def rpc_enc_rpc_lit(obj1, obj2)
+ klass = [obj1.class.name, obj2.class.name]
+ [obj2, obj1]
+ end
+
+ # 2 objs -> 2 objs
+ def rpc_lit_rpc_lit(obj1, obj2)
+ [obj1, obj2]
+ end
+
+ # 2 params -> array
+ def doc_enc_doc_enc(obj1, obj2)
+ [obj1, [obj1, obj2]]
+ end
+
+ # 2 objs -> array
+ def doc_lit_doc_enc(obj1, obj2)
+ [obj2, obj1]
+ end
+
+ # 2 params -> 2 hashes
+ def doc_enc_doc_lit(obj1, obj2)
+ klass = [obj1.class.name, obj2.class.name]
+ return {'obj1' => {'klass' => klass}, 'misc' => 'hash does not have an order'},
+ {'obj2' => {'klass' => klass}}
+ end
+
+ # 2 objs -> 2 objs
+ def doc_lit_doc_lit(obj1, obj2)
+ return obj1, obj2
+ end
+ end
+
+ Namespace = "urn:styleuse"
+
+ module Op
+ def self.opt(request_style, request_use, response_style, response_use)
+ {
+ :request_style => request_style,
+ :request_use => request_use,
+ :response_style => response_style,
+ :response_use => response_use
+ }
+ end
+
+ Op_rpc_enc_rpc_enc = [
+ XSD::QName.new(Namespace, 'rpc_enc_rpc_enc'),
+ nil,
+ 'rpc_enc_rpc_enc', [
+ ['in', 'obj1', nil],
+ ['in', 'obj2', nil],
+ ['retval', 'return', nil]],
+ opt(:rpc, :encoded, :rpc, :encoded)
+ ]
+
+ Op_rpc_lit_rpc_enc = [
+ XSD::QName.new(Namespace, 'rpc_lit_rpc_enc'),
+ nil,
+ 'rpc_lit_rpc_enc', [
+ ['in', 'obj1', nil],
+ ['in', 'obj2', nil],
+ ['retval', 'return', nil]],
+ opt(:rpc, :literal, :rpc, :encoded)
+ ]
+
+ Op_rpc_enc_rpc_lit = [
+ XSD::QName.new(Namespace, 'rpc_enc_rpc_lit'),
+ nil,
+ 'rpc_enc_rpc_lit', [
+ ['in', 'obj1', nil],
+ ['in', 'obj2', nil],
+ ['retval', 'ret1', nil],
+ ['out', 'ret2', nil]],
+ opt(:rpc, :encoded, :rpc, :literal)
+ ]
+
+ Op_rpc_lit_rpc_lit = [
+ XSD::QName.new(Namespace, 'rpc_lit_rpc_lit'),
+ nil,
+ 'rpc_lit_rpc_lit', [
+ ['in', 'obj1', nil],
+ ['in', 'obj2', nil],
+ ['retval', 'ret1', nil],
+ ['out', 'ret2', nil]],
+ opt(:rpc, :literal, :rpc, :literal)
+ ]
+
+ Op_doc_enc_doc_enc = [
+ Namespace + 'doc_enc_doc_enc',
+ 'doc_enc_doc_enc', [
+ ['in', 'obj1', [nil, Namespace, 'obj1']],
+ ['in', 'obj2', [nil, Namespace, 'obj2']],
+ ['out', 'ret1', [nil, Namespace, 'ret1']],
+ ['out', 'ret2', [nil, Namespace, 'ret2']]],
+ opt(:document, :encoded, :document, :encoded)
+ ]
+
+ Op_doc_lit_doc_enc = [
+ Namespace + 'doc_lit_doc_enc',
+ 'doc_lit_doc_enc', [
+ ['in', 'obj1', [nil, Namespace, 'obj1']],
+ ['in', 'obj2', [nil, Namespace, 'obj2']],
+ ['out', 'ret1', [nil, Namespace, 'ret1']],
+ ['out', 'ret2', [nil, Namespace, 'ret2']]],
+ opt(:document, :literal, :document, :encoded)
+ ]
+
+ Op_doc_enc_doc_lit = [
+ Namespace + 'doc_enc_doc_lit',
+ 'doc_enc_doc_lit', [
+ ['in', 'obj1', [nil, Namespace, 'obj1']],
+ ['in', 'obj2', [nil, Namespace, 'obj2']],
+ ['out', 'ret1', [nil, Namespace, 'ret1']],
+ ['out', 'ret2', [nil, Namespace, 'ret2']]],
+ opt(:document, :encoded, :document, :literal)
+ ]
+
+ Op_doc_lit_doc_lit = [
+ Namespace + 'doc_lit_doc_lit',
+ 'doc_lit_doc_lit', [
+ ['in', 'obj1', [nil, Namespace, 'obj1']],
+ ['in', 'obj2', [nil, Namespace, 'obj2']],
+ ['out', 'ret1', [nil, Namespace, 'ret1']],
+ ['out', 'ret2', [nil, Namespace, 'ret2']]],
+ opt(:document, :literal, :document, :literal)
+ ]
+ end
+
+ include Op
+
+ class Server < ::SOAP::RPC::HTTPServer
+ include Op
+
+ def on_init
+ @servant = GenericServant.new
+ add_rpc_operation(@servant, *Op_rpc_enc_rpc_enc)
+ add_rpc_operation(@servant, *Op_rpc_lit_rpc_enc)
+ add_rpc_operation(@servant, *Op_rpc_enc_rpc_lit)
+ add_rpc_operation(@servant, *Op_rpc_lit_rpc_lit)
+ add_document_operation(@servant, *Op_doc_enc_doc_enc)
+ add_document_operation(@servant, *Op_doc_lit_doc_enc)
+ add_document_operation(@servant, *Op_doc_enc_doc_lit)
+ add_document_operation(@servant, *Op_doc_lit_doc_lit)
+ end
+ end
+
+ Port = 17171
+
+ def setup
+ setup_server
+ setup_client
+ end
+
+ def setup_server
+ @server = Server.new(
+ :BindAddress => "0.0.0.0",
+ :Port => Port,
+ :AccessLog => [],
+ :SOAPDefaultNamespace => Namespace
+ )
+ @server.level = Logger::Severity::ERROR
+ @server_thread = start_server_thread(@server)
+ end
+
+ def setup_client
+ @client = ::SOAP::RPC::Driver.new("http://localhost:#{Port}/", Namespace)
+ @client.wiredump_dev = STDERR if $DEBUG
+ @client.add_rpc_operation(*Op_rpc_enc_rpc_enc)
+ @client.add_rpc_operation(*Op_rpc_lit_rpc_enc)
+ @client.add_rpc_operation(*Op_rpc_enc_rpc_lit)
+ @client.add_rpc_operation(*Op_rpc_lit_rpc_lit)
+ @client.add_document_operation(*Op_doc_enc_doc_enc)
+ @client.add_document_operation(*Op_doc_lit_doc_enc)
+ @client.add_document_operation(*Op_doc_enc_doc_lit)
+ @client.add_document_operation(*Op_doc_lit_doc_lit)
+ end
+
+ def teardown
+ teardown_server
+ teardown_client
+ end
+
+ def teardown_server
+ @server.shutdown
+ @server_thread.kill
+ @server_thread.join
+ end
+
+ def teardown_client
+ @client.reset_stream
+ end
+
+ def start_server_thread(server)
+ t = Thread.new {
+ Thread.current.abort_on_exception = true
+ server.start
+ }
+ t
+ end
+
+ def test_rpc_enc_rpc_enc
+ o = "hello"
+ obj1 = o
+ obj2 = [1]
+ ret = @client.rpc_enc_rpc_enc(obj1, obj2)
+ # server returns [obj1, [obj1, obj2]]
+ assert_equal([obj1, [obj1, obj2]], ret)
+ assert_same(ret[0], ret[1][0])
+ end
+
+ S1 = ::Struct.new(:a)
+ S2 = ::Struct.new(:c)
+ def test_rpc_lit_rpc_enc
+ ret1, ret2 = @client.rpc_lit_rpc_enc(S1.new('b'), S2.new('d'))
+ assert_equal('d', ret1.c)
+ assert_equal('b', ret2.a)
+ # Hash is allowed for literal
+ ret1, ret2 = @client.rpc_lit_rpc_enc({'a' => 'b'}, {'c' => 'd'})
+ assert_equal('d', ret1.c)
+ assert_equal('b', ret2.a)
+ # simple value
+ assert_equal(
+ ['1', 'a'],
+ @client.rpc_lit_rpc_enc('a', 1)
+ )
+ end
+
+ def test_rpc_enc_rpc_lit
+ assert_equal(
+ ['1', 'a'],
+ @client.rpc_enc_rpc_lit('a', '1')
+ )
+ end
+
+ def test_rpc_lit_rpc_lit
+ ret1, ret2 = @client.rpc_lit_rpc_lit({'a' => 'b'}, {'c' => 'd'})
+ assert_equal('b', ret1["a"])
+ assert_equal('d', ret2["c"])
+ end
+
+ def test_doc_enc_doc_enc
+ o = "hello"
+ obj1 = o
+ obj2 = [1]
+ ret = @client.rpc_enc_rpc_enc(obj1, obj2)
+ # server returns [obj1, [obj1, obj2]]
+ assert_equal([obj1, [obj1, obj2]], ret)
+ assert_same(ret[0], ret[1][0])
+ end
+
+ def test_doc_lit_doc_enc
+ ret1, ret2 = @client.doc_lit_doc_enc({'a' => 'b'}, {'c' => 'd'})
+ assert_equal('d', ret1.c)
+ assert_equal('b', ret2.a)
+ assert_equal(
+ ['a', '1'],
+ @client.doc_lit_doc_enc(1, 'a')
+ )
+ end
+
+ def test_doc_enc_doc_lit
+ ret1, ret2 = @client.doc_enc_doc_lit('a', 1)
+ # literal Array
+ assert_equal(['String', 'Fixnum'], ret1['obj1']['klass'])
+ # same value
+ assert_equal(ret1['obj1']['klass'], ret2['obj2']['klass'])
+ # not the same object (not encoded)
+ assert_not_same(ret1['obj1']['klass'], ret2['obj2']['klass'])
+ end
+
+ def test_doc_lit_doc_lit
+ ret1, ret2 = @client.doc_lit_doc_lit({'a' => 'b'}, {'c' => 'd'})
+ assert_equal('b', ret1["a"])
+ assert_equal('d', ret2["c"])
+ end
+end
+
+
+end
diff --git a/test/soap/wsdlDriver/README.txt b/test/soap/wsdlDriver/README.txt
new file mode 100644
index 0000000000..b4d45a0486
--- /dev/null
+++ b/test/soap/wsdlDriver/README.txt
@@ -0,0 +1,2 @@
+echo_version.rb is generated by wsdl2ruby.rb;
+% wsdl2ruby.rb --wsdl simpletype.wsdl --classdef --force
diff --git a/test/soap/wsdlDriver/calc.wsdl b/test/soap/wsdlDriver/calc.wsdl
new file mode 100644
index 0000000000..694a01e87e
--- /dev/null
+++ b/test/soap/wsdlDriver/calc.wsdl
@@ -0,0 +1,126 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!--generated by GLUE Standard 4.0.1 on Wed Mar 09 10:20:07 GMT-08:00
+2005-->
+<wsdl:definitions name='Calculator'
+targetNamespace='http://www.themindelectric.com/wsdl/Calculator/'
+ xmlns:tns='http://www.themindelectric.com/wsdl/Calculator/'
+ xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/'
+ xmlns:http='http://schemas.xmlsoap.org/wsdl/http/'
+ xmlns:mime='http://schemas.xmlsoap.org/wsdl/mime/'
+ xmlns:xsd='http://www.w3.org/2001/XMLSchema'
+ xmlns:soapenc='http://schemas.xmlsoap.org/soap/encoding/'
+ xmlns:wsdl='http://schemas.xmlsoap.org/wsdl/'
+ xmlns:tme='http://www.themindelectric.com/'>
+ <wsdl:message name='add0In'>
+ <wsdl:part name='x' type='xsd:float'/>
+ <wsdl:part name='y' type='xsd:float'/>
+ </wsdl:message>
+ <wsdl:message name='add0Out'>
+ <wsdl:part name='Result' type='xsd:float'/>
+ </wsdl:message>
+ <wsdl:message name='divide1In'>
+ <wsdl:part name='numerator' type='xsd:float'/>
+ <wsdl:part name='denominator' type='xsd:float'/>
+ </wsdl:message>
+ <wsdl:message name='divide1Out'>
+ <wsdl:part name='Result' type='xsd:float'/>
+ </wsdl:message>
+ <wsdl:message name='multiply2In'>
+ <wsdl:part name='x' type='xsd:float'/>
+ <wsdl:part name='y' type='xsd:float'/>
+ </wsdl:message>
+ <wsdl:message name='multiply2Out'>
+ <wsdl:part name='Result' type='xsd:float'/>
+ </wsdl:message>
+ <wsdl:message name='subtract3In'>
+ <wsdl:part name='x' type='xsd:float'/>
+ <wsdl:part name='y' type='xsd:float'/>
+ </wsdl:message>
+ <wsdl:message name='subtract3Out'>
+ <wsdl:part name='Result' type='xsd:float'/>
+ </wsdl:message>
+ <wsdl:portType name='ICalculator'>
+ <wsdl:operation name='add' parameterOrder='x y'>
+ <wsdl:input name='add0In' message='tns:add0In'/>
+ <wsdl:output name='add0Out' message='tns:add0Out'/>
+ </wsdl:operation>
+ <wsdl:operation name='divide' parameterOrder='numerator
+denominator'>
+ <wsdl:input name='divide1In' message='tns:divide1In'/>
+ <wsdl:output name='divide1Out' message='tns:divide1Out'/>
+ </wsdl:operation>
+ <wsdl:operation name='multiply' parameterOrder='x y'>
+ <wsdl:input name='multiply2In' message='tns:multiply2In'/>
+ <wsdl:output name='multiply2Out'
+message='tns:multiply2Out'/>
+ </wsdl:operation>
+ <wsdl:operation name='subtract' parameterOrder='x y'>
+ <wsdl:input name='subtract3In' message='tns:subtract3In'/>
+ <wsdl:output name='subtract3Out'
+message='tns:subtract3Out'/>
+ </wsdl:operation>
+ </wsdl:portType>
+ <wsdl:binding name='ICalculator' type='tns:ICalculator'>
+ <soap:binding style='rpc'
+transport='http://schemas.xmlsoap.org/soap/http'/>
+ <wsdl:operation name='add'>
+ <soap:operation soapAction='add' style='rpc'/>
+ <wsdl:input name='add0In'>
+ <soap:body use='encoded'
+namespace='http://www.fred.com'
+encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'/>
+ </wsdl:input>
+ <wsdl:output name='add0Out'>
+ <soap:body use='encoded'
+namespace='http://www.fred.com'
+encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'/>
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name='divide'>
+ <soap:operation soapAction='divide' style='rpc'/>
+ <wsdl:input name='divide1In'>
+ <soap:body use='encoded'
+namespace='http://www.fred.com'
+encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'/>
+ </wsdl:input>
+ <wsdl:output name='divide1Out'>
+ <soap:body use='encoded'
+namespace='http://www.fred.com'
+encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'/>
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name='multiply'>
+ <soap:operation soapAction='multiply' style='rpc'/>
+ <wsdl:input name='multiply2In'>
+ <soap:body use='encoded'
+namespace='http://www.fred.com'
+encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'/>
+ </wsdl:input>
+ <wsdl:output name='multiply2Out'>
+ <soap:body use='encoded'
+namespace='http://www.fred.com'
+encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'/>
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name='subtract'>
+ <soap:operation soapAction='subtract' style='rpc'/>
+ <wsdl:input name='subtract3In'>
+ <soap:body use='encoded'
+namespace='http://www.fred.com'
+encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'/>
+ </wsdl:input>
+ <wsdl:output name='subtract3Out'>
+ <soap:body use='encoded'
+namespace='http://www.fred.com'
+encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'/>
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:service name='Calculator'>
+ <wsdl:documentation>calculator service</wsdl:documentation>
+ <wsdl:port name='ICalculator' binding='tns:ICalculator'>
+ <soap:address
+location='http://ukulele:8080/calcapp/services/calculator'/>
+ </wsdl:port>
+ </wsdl:service>
+</wsdl:definitions>
diff --git a/test/soap/wsdlDriver/document.wsdl b/test/soap/wsdlDriver/document.wsdl
new file mode 100644
index 0000000000..5e9e74b9df
--- /dev/null
+++ b/test/soap/wsdlDriver/document.wsdl
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="utf-8"?>
+<definitions name="submit_service"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:tns="urn:example.com:document"
+ targetNamespace="urn:example.com:document"
+ xmlns="http://schemas.xmlsoap.org/wsdl/">
+ <types>
+ <xsd:schema targetNamespace="urn:example.com:document">
+ <xsd:element name="ruby">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element minOccurs="1" maxOccurs="1" name="myversion" type="tns:myversion"/>
+ <xsd:element minOccurs="0" maxOccurs="1" name="date" type="xsd:dateTime"/>
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+
+ <xsd:simpleType name="myversion">
+ <xsd:restriction base="xsd:string">
+ <xsd:enumeration value="1.6"/>
+ <xsd:enumeration value="1.8"/>
+ <xsd:enumeration value="1.9"/>
+ </xsd:restriction>
+ </xsd:simpleType>
+ </xsd:schema>
+ </types>
+
+ <message name="submit_msg">
+ <part name="parameters" element="tns:ruby"/>
+ </message>
+
+ <portType name="submit_port_type">
+ <operation name="submit">
+ <input message="tns:submit_msg"/>
+ <output message="tns:submit_msg"/>
+ </operation>
+ </portType>
+
+ <binding name="submit_binding" type="tns:submit_port_type">
+ <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
+ <operation name="submit">
+ <soap:operation soapAction="urn:example.com:document#submit" style="document"/>
+ <input><soap:body use="literal"/></input>
+ <output><soap:body use="literal"/></output>
+ </operation>
+ </binding>
+
+ <service name="submit_service">
+ <port name="submit_port" binding="tns:submit_binding">
+ <soap:address location="http://localhost:10080"/>
+ </port>
+ </service>
+</definitions>
diff --git a/test/soap/wsdlDriver/echo_version.rb b/test/soap/wsdlDriver/echo_version.rb
new file mode 100644
index 0000000000..7d76fb7587
--- /dev/null
+++ b/test/soap/wsdlDriver/echo_version.rb
@@ -0,0 +1,20 @@
+# urn:example.com:simpletype-rpc-type
+class Version_struct
+ @@schema_type = "version_struct"
+ @@schema_ns = "urn:example.com:simpletype-rpc-type"
+
+ attr_accessor :version
+ attr_accessor :msg
+
+ def initialize(version = nil, msg = nil)
+ @version = version
+ @msg = msg
+ end
+end
+
+# urn:example.com:simpletype-rpc-type
+module Versions
+ C_16 = "1.6"
+ C_18 = "1.8"
+ C_19 = "1.9"
+end
diff --git a/test/soap/wsdlDriver/simpletype.wsdl b/test/soap/wsdlDriver/simpletype.wsdl
new file mode 100644
index 0000000000..6781dda552
--- /dev/null
+++ b/test/soap/wsdlDriver/simpletype.wsdl
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="utf-8"?>
+<definitions name="echo_version"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:tns="urn:example.com:simpletype-rpc"
+ xmlns:txd="urn:example.com:simpletype-rpc-type"
+ targetNamespace="urn:example.com:simpletype-rpc"
+ xmlns="http://schemas.xmlsoap.org/wsdl/">
+ <types>
+ <xsd:schema targetNamespace="urn:example.com:simpletype-rpc-type">
+ <xsd:complexType name="version_struct">
+ <xsd:all>
+ <xsd:element name="myversion" type="txd:myversions" />
+ <xsd:element name="msg" type="xsd:string" />
+ </xsd:all>
+ </xsd:complexType>
+
+ <xsd:simpleType name="myversions">
+ <xsd:restriction base="xsd:string">
+ <xsd:enumeration value="1.6"/>
+ <xsd:enumeration value="1.8"/>
+ <xsd:enumeration value="1.9"/>
+ </xsd:restriction>
+ </xsd:simpleType>
+ </xsd:schema>
+ </types>
+
+ <message name="msg_version">
+ <part name="myversion" type="txd:myversions"/>
+ </message>
+
+ <message name="msg_version_struct">
+ <part name="return" type="txd:version_struct"/>
+ </message>
+
+ <portType name="echo_version_port_type">
+ <operation name="echo_version">
+ <input message="tns:msg_version"/>
+ <output message="tns:msg_version_struct"/>
+ </operation>
+ </portType>
+
+ <binding name="echo_version_binding" type="tns:echo_version_port_type">
+ <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="rpc"/>
+ <operation name="echo_version">
+ <soap:operation soapAction="urn:example.com:simpletype-rpc"/>
+ <input>
+ <soap:body use="encoded" namespace="urn:example.com:simpletype-rpc"
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <soap:body use="encoded" namespace="urn:example.com:simpletype-rpc"
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
+ </binding>
+
+ <service name="echo_version_service">
+ <port name="echo_version_port" binding="tns:echo_version_binding">
+ <soap:address location="http://localhost:10080"/>
+ </port>
+ </service>
+</definitions>
diff --git a/test/soap/wsdlDriver/test_calc.rb b/test/soap/wsdlDriver/test_calc.rb
new file mode 100644
index 0000000000..d031f663a3
--- /dev/null
+++ b/test/soap/wsdlDriver/test_calc.rb
@@ -0,0 +1,100 @@
+require 'test/unit'
+require 'soap/rpc/httpserver'
+require 'soap/wsdlDriver'
+
+
+module SOAP
+
+
+class TestCalc < Test::Unit::TestCase
+ class Server < ::SOAP::RPC::HTTPServer
+ def on_init
+ add_method(self, 'add', 'x', 'y')
+ end
+
+ def add(x, y)
+ x.to_f + y.to_f
+ end
+ end
+
+ DIR = File.dirname(File.expand_path(__FILE__))
+ Port = 17171
+
+ def setup
+ setup_server
+ setup_client
+ end
+
+ def setup_server
+ @server = Server.new(
+ :BindAddress => "0.0.0.0",
+ :Port => Port,
+ :AccessLog => [],
+ :SOAPDefaultNamespace => 'http://www.fred.com'
+ )
+ @server.level = Logger::Severity::ERROR
+ @server_thread = start_server_thread(@server)
+ end
+
+ def setup_client
+ @wsdl = File.join(DIR, 'calc.wsdl')
+ end
+
+ def teardown
+ teardown_server
+ teardown_client
+ end
+
+ def teardown_server
+ @server.shutdown
+ @server_thread.kill
+ @server_thread.join
+ end
+
+ def teardown_client
+ @client.reset_stream if @client
+ end
+
+ def start_server_thread(server)
+ t = Thread.new {
+ Thread.current.abort_on_exception = true
+ server.start
+ }
+ t
+ end
+
+ def test_rpc_driver
+ @client = ::SOAP::WSDLDriverFactory.new(@wsdl).create_rpc_driver
+ @client.wiredump_dev = STDOUT if $DEBUG
+ @client.endpoint_url = "http://localhost:#{Port}/"
+ @client.generate_explicit_type = true
+ assert_equal(0.3, @client.add(0.1, 0.2))
+ @client.generate_explicit_type = false
+ assert_equal(0.3, @client.add(0.1, 0.2))
+ end
+
+ def test_old_driver
+ silent do
+ @client = ::SOAP::WSDLDriverFactory.new(@wsdl).create_driver
+ end
+ @client.wiredump_dev = STDOUT if $DEBUG
+ @client.endpoint_url = "http://localhost:#{Port}/"
+ @client.generate_explicit_type = true
+ assert_equal(0.3, @client.add(0.1, 0.2))
+ @client.generate_explicit_type = false
+ assert_equal(0.3, @client.add(0.1, 0.2))
+ end
+
+ def silent
+ back = $VERBOSE
+ $VERBOSE = nil
+ begin
+ yield
+ ensure
+ $VERBOSE = back
+ end
+ end
+end
+
+
+end
diff --git a/test/soap/wsdlDriver/test_document.rb b/test/soap/wsdlDriver/test_document.rb
new file mode 100644
index 0000000000..634b827aae
--- /dev/null
+++ b/test/soap/wsdlDriver/test_document.rb
@@ -0,0 +1,78 @@
+require 'test/unit'
+require 'soap/rpc/standaloneServer'
+require 'soap/wsdlDriver'
+
+
+module SOAP
+
+
+class TestDocument < Test::Unit::TestCase
+ Namespace = 'urn:example.com:document'
+
+ class Server < ::SOAP::RPC::StandaloneServer
+ def on_init
+ add_document_method(self, 'urn:example.com:document#submit', 'submit', XSD::QName.new(Namespace, 'ruby'), XSD::QName.new(Namespace, 'ruby'))
+ end
+
+ def submit(ruby)
+ ruby
+ end
+ end
+
+ DIR = File.dirname(File.expand_path(__FILE__))
+
+ Port = 17171
+
+ def setup
+ setup_server
+ setup_client
+ end
+
+ def setup_server
+ @server = Server.new('Test', Namespace, '0.0.0.0', Port)
+ @server.level = Logger::Severity::ERROR
+ @server_thread = start_server_thread(@server)
+ end
+
+ def setup_client
+ wsdl = File.join(DIR, 'document.wsdl')
+ @client = ::SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver
+ @client.endpoint_url = "http://localhost:#{Port}/"
+ @client.wiredump_dev = STDOUT if $DEBUG
+ end
+
+ def teardown
+ teardown_server
+ teardown_client
+ end
+
+ def teardown_server
+ @server.shutdown
+ @server_thread.kill
+ @server_thread.join
+ end
+
+ def teardown_client
+ @client.reset_stream
+ end
+
+ def start_server_thread(server)
+ t = Thread.new {
+ Thread.current.abort_on_exception = true
+ server.start
+ }
+ t
+ end
+
+ def test_document
+ msg = {'myversion' => "1.9", 'date' => "2004-01-01T00:00:00Z"}
+ reply_msg = @client.submit(msg)
+ assert_equal('1.9', reply_msg.myversion)
+ assert_equal('1.9', reply_msg['myversion'])
+ assert_equal('2004-01-01T00:00:00Z', reply_msg.date)
+ assert_equal('2004-01-01T00:00:00Z', reply_msg['date'])
+ end
+end
+
+
+end
diff --git a/test/soap/wsdlDriver/test_simpletype.rb b/test/soap/wsdlDriver/test_simpletype.rb
new file mode 100644
index 0000000000..76b3a32df7
--- /dev/null
+++ b/test/soap/wsdlDriver/test_simpletype.rb
@@ -0,0 +1,87 @@
+require 'test/unit'
+require 'soap/rpc/httpserver'
+require 'soap/wsdlDriver'
+
+
+module SOAP
+
+
+class TestSimpleType < Test::Unit::TestCase
+ class Server < ::SOAP::RPC::HTTPServer
+ def on_init
+ add_method(self, 'echo_version', 'version')
+ end
+
+ def echo_version(version)
+ # "2.0" is out of range.
+ Version_struct.new(version || "2.0", 'checked')
+ end
+ end
+
+ DIR = File.dirname(File.expand_path(__FILE__))
+ require File.join(DIR, 'echo_version')
+
+ Port = 17171
+
+ def setup
+ setup_server
+ setup_client
+ end
+
+ def setup_server
+ @server = Server.new(
+ :BindAddress => "0.0.0.0",
+ :Port => Port,
+ :AccessLog => [],
+ :SOAPDefaultNamespace => "urn:example.com:simpletype-rpc"
+ )
+ @server.level = Logger::Severity::ERROR
+ @server_thread = start_server_thread(@server)
+ end
+
+ def setup_client
+ wsdl = File.join(DIR, 'simpletype.wsdl')
+ @client = ::SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver
+ @client.wiredump_dev = STDOUT if $DEBUG
+ @client.endpoint_url = "http://localhost:#{Port}/"
+ @client.generate_explicit_type = false
+ end
+
+ def teardown
+ teardown_server
+ teardown_client
+ end
+
+ def teardown_server
+ @server.shutdown
+ @server_thread.kill
+ @server_thread.join
+ end
+
+ def teardown_client
+ @client.reset_stream
+ end
+
+ def start_server_thread(server)
+ t = Thread.new {
+ Thread.current.abort_on_exception = true
+ server.start
+ }
+ t
+ end
+
+ def test_ping
+ result = @client.echo_version("1.9")
+ assert_equal("1.9", result.version)
+ assert_equal("checked", result.msg)
+ assert_raise(XSD::ValueSpaceError) do
+ @client.echo_version("2.0")
+ end
+ assert_raise(XSD::ValueSpaceError) do
+ @client.echo_version(nil) # nil => "2.0" => out of range
+ end
+ end
+end
+
+
+end
diff --git a/test/socket/test_addrinfo.rb b/test/socket/test_addrinfo.rb
deleted file mode 100644
index 4c3babdfa8..0000000000
--- a/test/socket/test_addrinfo.rb
+++ /dev/null
@@ -1,615 +0,0 @@
-begin
- require "socket"
-rescue LoadError
-end
-
-require "test/unit"
-
-class TestSocketAddrinfo < Test::Unit::TestCase
- HAS_UNIXSOCKET = defined?(UNIXSocket) && /cygwin/ !~ RUBY_PLATFORM
-
- def tcp_unspecified_to_loopback(addrinfo)
- if addrinfo.ipv4? && addrinfo.ip_address == "0.0.0.0"
- Addrinfo.tcp("127.0.0.1", addrinfo.ip_port)
- elsif addrinfo.ipv6? && addrinfo.ipv6_unspecified?
- Addrinfo.tcp("::1", addrinfo.ip_port)
- elsif addrinfo.ipv6? && (ai = addrinfo.ipv6_to_ipv4) && ai.ip_address == "0.0.0.0"
- Addrinfo.tcp("127.0.0.1", addrinfo.ip_port)
- else
- addrinfo
- end
- end
-
- def test_addrinfo_ip
- ai = Addrinfo.ip("127.0.0.1")
- assert_equal([0, "127.0.0.1"], Socket.unpack_sockaddr_in(ai))
- assert_equal(Socket::AF_INET, ai.afamily)
- assert_equal(Socket::PF_INET, ai.pfamily)
- assert_equal(0, ai.socktype)
- assert_equal(0, ai.protocol)
- end
-
- def test_addrinfo_tcp
- ai = Addrinfo.tcp("127.0.0.1", 80)
- assert_equal([80, "127.0.0.1"], Socket.unpack_sockaddr_in(ai))
- assert_equal(Socket::AF_INET, ai.afamily)
- assert_equal(Socket::PF_INET, ai.pfamily)
- assert_equal(Socket::SOCK_STREAM, ai.socktype)
- assert_includes([0, Socket::IPPROTO_TCP], ai.protocol)
- end
-
- def test_addrinfo_udp
- ai = Addrinfo.udp("127.0.0.1", 80)
- assert_equal([80, "127.0.0.1"], Socket.unpack_sockaddr_in(ai))
- assert_equal(Socket::AF_INET, ai.afamily)
- assert_equal(Socket::PF_INET, ai.pfamily)
- assert_equal(Socket::SOCK_DGRAM, ai.socktype)
- assert_includes([0, Socket::IPPROTO_UDP], ai.protocol)
- end
-
- def test_addrinfo_ip_unpack
- ai = Addrinfo.tcp("127.0.0.1", 80)
- assert_equal(["127.0.0.1", 80], ai.ip_unpack)
- assert_equal("127.0.0.1", ai.ip_address)
- assert_equal(80, ai.ip_port)
- end
-
- def test_addrinfo_inspect_sockaddr
- ai = Addrinfo.tcp("127.0.0.1", 80)
- assert_equal("127.0.0.1:80", ai.inspect_sockaddr)
- end
-
- def test_addrinfo_new_inet
- ai = Addrinfo.new(["AF_INET", 46102, "localhost.localdomain", "127.0.0.2"])
- assert_equal([46102, "127.0.0.2"], Socket.unpack_sockaddr_in(ai))
- assert_equal(Socket::AF_INET, ai.afamily)
- assert_equal(Socket::PF_INET, ai.pfamily)
- assert_equal(0, ai.socktype)
- assert_equal(0, ai.protocol)
- end
-
- def test_addrinfo_predicates
- ipv4_ai = Addrinfo.new(Socket.sockaddr_in(80, "192.168.0.1"))
- assert(ipv4_ai.ip?)
- assert(ipv4_ai.ipv4?)
- assert(!ipv4_ai.ipv6?)
- assert(!ipv4_ai.unix?)
- end
-
- def test_ipv4_address_predicates
- list = [
- [:ipv4_private?, "10.0.0.0", "10.255.255.255",
- "172.16.0.0", "172.31.255.255",
- "192.168.0.0", "192.168.255.255"],
- [:ipv4_loopback?, "127.0.0.1", "127.0.0.0", "127.255.255.255"],
- [:ipv4_multicast?, "224.0.0.0", "224.255.255.255"]
- ]
- list.each {|meth, *addrs|
- addrs.each {|addr|
- assert(Addrinfo.ip(addr).send(meth), "Addrinfo.ip(#{addr.inspect}).#{meth}")
- list.each {|meth2,|
- next if meth == meth2
- assert(!Addrinfo.ip(addr).send(meth2), "!Addrinfo.ip(#{addr.inspect}).#{meth2}")
- }
- }
- }
- end
-
- def test_basicsocket_send
- s1 = Socket.new(:INET, :DGRAM, 0)
- s1.bind(Socket.sockaddr_in(0, "127.0.0.1"))
- sa = s1.getsockname
- ai = Addrinfo.new(sa)
- s2 = Socket.new(:INET, :DGRAM, 0)
- s2.send("test-basicsocket-send", 0, ai)
- assert_equal("test-basicsocket-send", s1.recv(100))
- ensure
- s1.close if s1 && !s1.closed?
- s2.close if s2 && !s2.closed?
- end
-
- def test_udpsocket_send
- s1 = UDPSocket.new
- s1.bind("127.0.0.1", 0)
- ai = Addrinfo.new(s1.getsockname)
- s2 = UDPSocket.new
- s2.send("test-udp-send", 0, ai)
- assert_equal("test-udp-send", s1.recv(100))
- ensure
- s1.close if s1 && !s1.closed?
- s2.close if s2 && !s2.closed?
- end
-
- def test_socket_bind
- s1 = Socket.new(:INET, :DGRAM, 0)
- sa = Socket.sockaddr_in(0, "127.0.0.1")
- ai = Addrinfo.new(sa)
- s1.bind(ai)
- s2 = UDPSocket.new
- s2.send("test-socket-bind", 0, s1.getsockname)
- assert_equal("test-socket-bind", s1.recv(100))
- ensure
- s1.close if s1 && !s1.closed?
- s2.close if s2 && !s2.closed?
- end
-
- def test_socket_connect
- s1 = Socket.new(:INET, :STREAM, 0)
- s1.bind(Socket.sockaddr_in(0, "127.0.0.1"))
- s1.listen(5)
- ai = Addrinfo.new(s1.getsockname)
- s2 = Socket.new(:INET, :STREAM, 0)
- s2.connect(ai)
- s3, sender_addr = s1.accept
- s2.send("test-socket-connect", 0)
- assert_equal("test-socket-connect", s3.recv(100))
- ensure
- s1.close if s1 && !s1.closed?
- s2.close if s2 && !s2.closed?
- s3.close if s3 && !s3.closed?
- end
-
- def test_socket_connect_nonblock
- s1 = Socket.new(:INET, :STREAM, 0)
- s1.bind(Socket.sockaddr_in(0, "127.0.0.1"))
- s1.listen(5)
- ai = Addrinfo.new(s1.getsockname)
- s2 = Socket.new(:INET, :STREAM, 0)
- begin
- s2.connect_nonblock(ai)
- rescue IO::WaitWritable
- IO.select(nil, [s2])
- begin
- s2.connect_nonblock(ai)
- rescue Errno::EISCONN
- end
- end
- s3, sender_addr = s1.accept
- s2.send("test-socket-connect-nonblock", 0)
- assert_equal("test-socket-connect-nonblock", s3.recv(100))
- ensure
- s1.close if s1 && !s1.closed?
- s2.close if s2 && !s2.closed?
- s3.close if s3 && !s3.closed?
- end
-
- def test_socket_getnameinfo
- ai = Addrinfo.udp("127.0.0.1", 8888)
- assert_equal(["127.0.0.1", "8888"], Socket.getnameinfo(ai, Socket::NI_NUMERICHOST|Socket::NI_NUMERICSERV))
- end
-
- def test_basicsocket_local_address
- s1 = Socket.new(:INET, :DGRAM, 0)
- s1.bind(Socket.sockaddr_in(0, "127.0.0.1"))
- e = Socket.unpack_sockaddr_in(s1.getsockname)
- a = Socket.unpack_sockaddr_in(s1.local_address.to_sockaddr)
- assert_equal(e, a)
- assert_equal(Socket::AF_INET, s1.local_address.afamily)
- assert_equal(Socket::PF_INET, s1.local_address.pfamily)
- assert_equal(Socket::SOCK_DGRAM, s1.local_address.socktype)
- ensure
- s1.close if s1 && !s1.closed?
- end
-
- def test_basicsocket_remote_address
- s1 = TCPServer.new("127.0.0.1", 0)
- s2 = Socket.new(:INET, :STREAM, 0)
- s2.connect(s1.getsockname)
- s3, _ = s1.accept
- e = Socket.unpack_sockaddr_in(s2.getsockname)
- a = Socket.unpack_sockaddr_in(s3.remote_address.to_sockaddr)
- assert_equal(e, a)
- assert_equal(Socket::AF_INET, s3.remote_address.afamily)
- assert_equal(Socket::PF_INET, s3.remote_address.pfamily)
- assert_equal(Socket::SOCK_STREAM, s3.remote_address.socktype)
- ensure
- s1.close if s1 && !s1.closed?
- s2.close if s2 && !s2.closed?
- s3.close if s3 && !s3.closed?
- end
-
- def test_socket_accept
- serv = Socket.new(:INET, :STREAM, 0)
- serv.bind(Socket.sockaddr_in(0, "127.0.0.1"))
- serv.listen(5)
- c = Socket.new(:INET, :STREAM, 0)
- c.connect(serv.local_address)
- ret = serv.accept
- s, ai = ret
- assert_kind_of(Array, ret)
- assert_equal(2, ret.length)
- assert_kind_of(Addrinfo, ai)
- e = Socket.unpack_sockaddr_in(c.getsockname)
- a = Socket.unpack_sockaddr_in(ai.to_sockaddr)
- assert_equal(e, a)
- ensure
- serv.close if serv && !serv.closed?
- s.close if s && !s.closed?
- c.close if c && !c.closed?
- end
-
- def test_socket_accept_nonblock
- serv = Socket.new(:INET, :STREAM, 0)
- serv.bind(Socket.sockaddr_in(0, "127.0.0.1"))
- serv.listen(5)
- c = Socket.new(:INET, :STREAM, 0)
- c.connect(serv.local_address)
- begin
- ret = serv.accept_nonblock
- rescue IO::WaitReadable, Errno::EINTR
- IO.select([serv])
- retry
- end
- s, ai = ret
- assert_kind_of(Array, ret)
- assert_equal(2, ret.length)
- assert_kind_of(Addrinfo, ai)
- e = Socket.unpack_sockaddr_in(c.getsockname)
- a = Socket.unpack_sockaddr_in(ai.to_sockaddr)
- assert_equal(e, a)
- ensure
- serv.close if serv && !serv.closed?
- s.close if s && !s.closed?
- c.close if c && !c.closed?
- end
-
- def test_socket_sysaccept
- serv = Socket.new(:INET, :STREAM, 0)
- serv.bind(Socket.sockaddr_in(0, "127.0.0.1"))
- serv.listen(5)
- c = Socket.new(:INET, :STREAM, 0)
- c.connect(serv.local_address)
- ret = serv.sysaccept
- fd, ai = ret
- s = IO.new(fd)
- assert_kind_of(Array, ret)
- assert_equal(2, ret.length)
- assert_kind_of(Addrinfo, ai)
- e = Socket.unpack_sockaddr_in(c.getsockname)
- a = Socket.unpack_sockaddr_in(ai.to_sockaddr)
- assert_equal(e, a)
- ensure
- serv.close if serv && !serv.closed?
- s.close if s && !s.closed?
- c.close if c && !c.closed?
- end
-
- def test_socket_recvfrom
- s1 = Socket.new(:INET, :DGRAM, 0)
- s1.bind(Socket.sockaddr_in(0, "127.0.0.1"))
- s2 = Socket.new(:INET, :DGRAM, 0)
- s2.bind(Socket.sockaddr_in(0, "127.0.0.1"))
- s2.send("test-socket-recvfrom", 0, s1.getsockname)
- data, ai = s1.recvfrom(100)
- assert_equal("test-socket-recvfrom", data)
- assert_kind_of(Addrinfo, ai)
- e = Socket.unpack_sockaddr_in(s2.getsockname)
- a = Socket.unpack_sockaddr_in(ai.to_sockaddr)
- assert_equal(e, a)
- ensure
- s1.close if s1 && !s1.closed?
- s2.close if s2 && !s2.closed?
- end
-
- def test_socket_recvfrom_nonblock
- s1 = Socket.new(:INET, :DGRAM, 0)
- s1.bind(Socket.sockaddr_in(0, "127.0.0.1"))
- s2 = Socket.new(:INET, :DGRAM, 0)
- s2.bind(Socket.sockaddr_in(0, "127.0.0.1"))
- s2.send("test-socket-recvfrom", 0, s1.getsockname)
- begin
- data, ai = s1.recvfrom_nonblock(100)
- rescue IO::WaitReadable
- IO.select([s1])
- retry
- end
- assert_equal("test-socket-recvfrom", data)
- assert_kind_of(Addrinfo, ai)
- e = Socket.unpack_sockaddr_in(s2.getsockname)
- a = Socket.unpack_sockaddr_in(ai.to_sockaddr)
- assert_equal(e, a)
- ensure
- s1.close if s1 && !s1.closed?
- s2.close if s2 && !s2.closed?
- end
-
- def test_family_addrinfo
- ai = Addrinfo.tcp("0.0.0.0", 4649).family_addrinfo("127.0.0.1", 80)
- assert_equal(["127.0.0.1", 80], ai.ip_unpack)
- assert_equal(Socket::SOCK_STREAM, ai.socktype)
- return unless Addrinfo.respond_to?(:unix)
- ai = Addrinfo.unix("/testdir/sock").family_addrinfo("/testdir/sock2")
- assert_equal("/testdir/sock2", ai.unix_path)
- assert_equal(Socket::SOCK_STREAM, ai.socktype)
- assert_raise(SocketError) { Addrinfo.tcp("0.0.0.0", 4649).family_addrinfo("::1", 80) }
- end
-
- def random_port
- # IANA suggests dynamic port for 49152 to 65535
- # http://www.iana.org/assignments/port-numbers
- 49152 + rand(65535-49152+1)
- end
-
- def test_connect_from
- TCPServer.open("0.0.0.0", 0) {|serv|
- serv_ai = Addrinfo.new(serv.getsockname, :INET, :STREAM)
- serv_ai = tcp_unspecified_to_loopback(serv_ai)
- port = random_port
- begin
- serv_ai.connect_from("0.0.0.0", port) {|s1|
- s2 = serv.accept
- begin
- assert_equal(port, s2.remote_address.ip_port)
- ensure
- s2.close
- end
- }
- rescue Errno::EADDRINUSE
- # not test failure
- end
- }
- end
-
- def test_connect_to
- TCPServer.open("0.0.0.0", 0) {|serv|
- serv_ai = Addrinfo.new(serv.getsockname, :INET, :STREAM)
- serv_ai = tcp_unspecified_to_loopback(serv_ai)
- port = random_port
- client_ai = Addrinfo.tcp("0.0.0.0", port)
- begin
- client_ai.connect_to(*serv_ai.ip_unpack) {|s1|
- s2 = serv.accept
- begin
- assert_equal(port, s2.remote_address.ip_port)
- ensure
- s2.close
- end
- }
- rescue Errno::EADDRINUSE
- # not test failure
- end
- }
- end
-
- def test_connect
- TCPServer.open("0.0.0.0", 0) {|serv|
- serv_ai = Addrinfo.new(serv.getsockname, :INET, :STREAM)
- serv_ai = tcp_unspecified_to_loopback(serv_ai)
- begin
- serv_ai.connect {|s1|
- s2 = serv.accept
- begin
- assert_equal(s1.local_address.ip_unpack, s2.remote_address.ip_unpack)
- assert_equal(s2.local_address.ip_unpack, s1.remote_address.ip_unpack)
- ensure
- s2.close
- end
- }
- rescue Errno::EADDRINUSE
- # not test failure
- end
- }
- end
-
- def test_bind
- port = random_port
- client_ai = Addrinfo.tcp("0.0.0.0", port)
- begin
- client_ai.bind {|s|
- assert_equal(port, s.local_address.ip_port)
- }
- rescue Errno::EADDRINUSE
- # not test failure
- end
- end
-
- def test_listen
- port = random_port
- client_ai = Addrinfo.tcp("0.0.0.0", port)
- begin
- client_ai.listen {|serv|
- assert_equal(port, serv.local_address.ip_port)
- serv_addr, serv_port = serv.local_address.ip_unpack
- case serv_addr
- when "0.0.0.0" then serv_addr = "127.0.0.1"
- end
- TCPSocket.open(serv_addr, serv_port) {|s1|
- s2, addr = serv.accept
- begin
- assert_equal(s1.local_address.ip_unpack, addr.ip_unpack)
- ensure
- s2.close
- end
- }
- }
- rescue Errno::EADDRINUSE
- # not test failure
- end
- end
-
- def test_s_foreach
- Addrinfo.foreach(nil, 80, nil, :STREAM) {|ai|
- assert_kind_of(Addrinfo, ai)
- }
- end
-
- def test_marshal
- ai1 = Addrinfo.tcp("127.0.0.1", 80)
- ai2 = Marshal.load(Marshal.dump(ai1))
- assert_equal(ai1.afamily, ai2.afamily)
- assert_equal(ai1.ip_unpack, ai2.ip_unpack)
- assert_equal(ai1.pfamily, ai2.pfamily)
- assert_equal(ai1.socktype, ai2.socktype)
- assert_equal(ai1.protocol, ai2.protocol)
- assert_equal(ai1.canonname, ai2.canonname)
- end
-
- if Socket.const_defined?("AF_INET6")
-
- def test_addrinfo_new_inet6
- ai = Addrinfo.new(["AF_INET6", 42304, "ip6-localhost", "::1"])
- assert_equal([42304, "::1"], Socket.unpack_sockaddr_in(ai))
- assert_equal(Socket::AF_INET6, ai.afamily)
- assert_equal(Socket::PF_INET6, ai.pfamily)
- assert_equal(0, ai.socktype)
- assert_equal(0, ai.protocol)
- end
-
- def test_addrinfo_ip_unpack_inet6
- ai = Addrinfo.tcp("::1", 80)
- assert_equal(["::1", 80], ai.ip_unpack)
- assert_equal("::1", ai.ip_address)
- assert_equal(80, ai.ip_port)
- end
-
- def test_addrinfo_inspect_sockaddr_inet6
- ai = Addrinfo.tcp("::1", 80)
- assert_equal("[::1]:80", ai.inspect_sockaddr)
- end
-
- def test_marshal_inet6
- ai1 = Addrinfo.tcp("::1", 80)
- ai2 = Marshal.load(Marshal.dump(ai1))
- assert_equal(ai1.afamily, ai2.afamily)
- assert_equal(ai1.ip_unpack, ai2.ip_unpack)
- assert_equal(ai1.pfamily, ai2.pfamily)
- assert_equal(ai1.socktype, ai2.socktype)
- assert_equal(ai1.protocol, ai2.protocol)
- assert_equal(ai1.canonname, ai2.canonname)
- end
-
- def ipv6(str)
- Addrinfo.getaddrinfo(str, nil, :INET6, :DGRAM).fetch(0)
- end
-
- def test_ipv6_address_predicates
- list = [
- [:ipv6_unspecified?, "::"],
- [:ipv6_loopback?, "::1"],
- [:ipv6_v4compat?, "::0.0.0.2", "::255.255.255.255"],
- [:ipv6_v4mapped?, "::ffff:0.0.0.0", "::ffff:255.255.255.255"],
- [:ipv6_linklocal?, "fe80::", "febf::"],
- [:ipv6_sitelocal?, "fec0::", "feef::"],
- [:ipv6_multicast?, "ff00::", "ffff::"]
- ]
- mlist = [
- [:ipv6_mc_nodelocal?, "ff01::", "ff11::"],
- [:ipv6_mc_linklocal?, "ff02::", "ff12::"],
- [:ipv6_mc_sitelocal?, "ff05::", "ff15::"],
- [:ipv6_mc_orglocal?, "ff08::", "ff18::"],
- [:ipv6_mc_global?, "ff0e::", "ff1e::"]
- ]
- list.each {|meth, *addrs|
- addrs.each {|addr|
- addr_exp = "Addrinfo.getaddrinfo(#{addr.inspect}, nil, :INET6, :DGRAM).fetch(0)"
- if meth == :ipv6_v4compat? || meth == :ipv6_v4mapped?
- # MacOS X returns IPv4 address for ::ffff:1.2.3.4 and ::1.2.3.4.
- # Solaris returns IPv4 address for ::ffff:1.2.3.4.
- ai = ipv6(addr)
- assert(ai.ipv4? || ai.send(meth), "ai=#{addr_exp}; ai.ipv4? || .#{meth}")
- else
- assert(ipv6(addr).send(meth), "#{addr_exp}.#{meth}")
- assert_equal(addr, ipv6(addr).ip_address)
- end
- list.each {|meth2,|
- next if meth == meth2
- assert(!ipv6(addr).send(meth2), "!#{addr_exp}.#{meth2}")
- }
- }
- }
- mlist.each {|meth, *addrs|
- addrs.each {|addr|
- addr_exp = "Addrinfo.getaddrinfo(#{addr.inspect}, nil, :INET6, :DGRAM).fetch(0)"
- assert(ipv6(addr).send(meth), "#{addr_exp}.#{meth}")
- assert(ipv6(addr).ipv6_multicast?, "#{addr_exp}.ipv6_multicast?")
- mlist.each {|meth2,|
- next if meth == meth2
- assert(!ipv6(addr).send(meth2), "!#{addr_exp}.#{meth2}")
- }
- list.each {|meth2,|
- next if :ipv6_multicast? == meth2
- assert(!ipv6(addr).send(meth2), "!#{addr_exp}.#{meth2}")
- }
- }
- }
- end
-
- def test_ipv6_to_ipv4
- ai = Addrinfo.ip("::192.0.2.3")
- ai = ai.ipv6_to_ipv4 if !ai.ipv4?
- assert(ai.ipv4?)
- assert_equal("192.0.2.3", ai.ip_address)
-
- ai = Addrinfo.ip("::ffff:192.0.2.3")
- ai = ai.ipv6_to_ipv4 if !ai.ipv4?
- assert(ai.ipv4?)
- assert_equal("192.0.2.3", ai.ip_address)
-
- assert_nil(Addrinfo.ip("::1").ipv6_to_ipv4)
- assert_nil(Addrinfo.ip("192.0.2.3").ipv6_to_ipv4)
- if HAS_UNIXSOCKET
- assert_nil(Addrinfo.unix("/testdir/sock").ipv6_to_ipv4)
- end
- end
- end
-
- if HAS_UNIXSOCKET
-
- def test_addrinfo_unix
- ai = Addrinfo.unix("/testdir/sock")
- assert_equal("/testdir/sock", Socket.unpack_sockaddr_un(ai))
- assert_equal(Socket::AF_UNIX, ai.afamily)
- assert_equal(Socket::PF_UNIX, ai.pfamily)
- assert_equal(Socket::SOCK_STREAM, ai.socktype)
- assert_equal(0, ai.protocol)
- end
-
- def test_addrinfo_unix_dgram
- ai = Addrinfo.unix("/testdir/sock", :DGRAM)
- assert_equal("/testdir/sock", Socket.unpack_sockaddr_un(ai))
- assert_equal(Socket::AF_UNIX, ai.afamily)
- assert_equal(Socket::PF_UNIX, ai.pfamily)
- assert_equal(Socket::SOCK_DGRAM, ai.socktype)
- assert_equal(0, ai.protocol)
- end
-
- def test_addrinfo_unix_path
- ai = Addrinfo.unix("/testdir/sock1")
- assert_equal("/testdir/sock1", ai.unix_path)
- end
-
- def test_addrinfo_inspect_sockaddr_unix
- ai = Addrinfo.unix("/testdir/test_addrinfo_inspect_sockaddr_unix")
- assert_equal("/testdir/test_addrinfo_inspect_sockaddr_unix", ai.inspect_sockaddr)
- end
-
- def test_addrinfo_new_unix
- ai = Addrinfo.new(["AF_UNIX", "/testdir/sock"])
- assert_equal("/testdir/sock", Socket.unpack_sockaddr_un(ai))
- assert_equal(Socket::AF_UNIX, ai.afamily)
- assert_equal(Socket::PF_UNIX, ai.pfamily)
- assert_equal(Socket::SOCK_STREAM, ai.socktype) # UNIXSocket/UNIXServer is SOCK_STREAM only.
- assert_equal(0, ai.protocol)
- end
-
- def test_addrinfo_predicates_unix
- unix_ai = Addrinfo.new(Socket.sockaddr_un("/testdir/sososo"))
- assert(!unix_ai.ip?)
- assert(!unix_ai.ipv4?)
- assert(!unix_ai.ipv6?)
- assert(unix_ai.unix?)
- end
-
- def test_marshal_unix
- ai1 = Addrinfo.unix("/testdir/sock")
- ai2 = Marshal.load(Marshal.dump(ai1))
- assert_equal(ai1.afamily, ai2.afamily)
- assert_equal(ai1.unix_path, ai2.unix_path)
- assert_equal(ai1.pfamily, ai2.pfamily)
- assert_equal(ai1.socktype, ai2.socktype)
- assert_equal(ai1.protocol, ai2.protocol)
- assert_equal(ai1.canonname, ai2.canonname)
- end
-
- end
-end
diff --git a/test/socket/test_ancdata.rb b/test/socket/test_ancdata.rb
deleted file mode 100644
index 112b0c9e58..0000000000
--- a/test/socket/test_ancdata.rb
+++ /dev/null
@@ -1,66 +0,0 @@
-require 'test/unit'
-require 'socket'
-
-class TestSocketAncData < Test::Unit::TestCase
- def test_int
- ancdata = Socket::AncillaryData.int(0, 0, 0, 123)
- assert_equal(123, ancdata.int)
- assert_equal([123].pack("i"), ancdata.data)
- end
-
- def test_ip_pktinfo
- addr = Addrinfo.ip("127.0.0.1")
- ifindex = 0
- spec_dst = Addrinfo.ip("127.0.0.2")
- begin
- ancdata = Socket::AncillaryData.ip_pktinfo(addr, ifindex, spec_dst)
- rescue NotImplementedError
- return
- end
- assert_equal(Socket::AF_INET, ancdata.family)
- assert_equal(Socket::IPPROTO_IP, ancdata.level)
- assert_equal(Socket::IP_PKTINFO, ancdata.type)
- assert_equal(addr.ip_address, ancdata.ip_pktinfo[0].ip_address)
- assert_equal(ifindex, ancdata.ip_pktinfo[1])
- assert_equal(spec_dst.ip_address, ancdata.ip_pktinfo[2].ip_address)
- assert(ancdata.cmsg_is?(:IP, :PKTINFO))
- assert(ancdata.cmsg_is?("IP", "PKTINFO"))
- assert(ancdata.cmsg_is?(Socket::IPPROTO_IP, Socket::IP_PKTINFO))
- if defined? Socket::IPV6_PKTINFO
- assert(!ancdata.cmsg_is?(:IPV6, :PKTINFO))
- end
- ancdata2 = Socket::AncillaryData.ip_pktinfo(addr, ifindex)
- assert_equal(addr.ip_address, ancdata2.ip_pktinfo[2].ip_address)
- end
-
- def test_ipv6_pktinfo
- addr = Addrinfo.ip("::1")
- ifindex = 0
- begin
- ancdata = Socket::AncillaryData.ipv6_pktinfo(addr, ifindex)
- rescue NotImplementedError
- return
- end
- assert_equal(Socket::AF_INET6, ancdata.family)
- assert_equal(Socket::IPPROTO_IPV6, ancdata.level)
- assert_equal(Socket::IPV6_PKTINFO, ancdata.type)
- assert_equal(addr.ip_address, ancdata.ipv6_pktinfo[0].ip_address)
- assert_equal(ifindex, ancdata.ipv6_pktinfo[1])
- assert_equal(addr.ip_address, ancdata.ipv6_pktinfo_addr.ip_address)
- assert_equal(ifindex, ancdata.ipv6_pktinfo_ifindex)
- assert(ancdata.cmsg_is?(:IPV6, :PKTINFO))
- assert(ancdata.cmsg_is?("IPV6", "PKTINFO"))
- assert(ancdata.cmsg_is?(Socket::IPPROTO_IPV6, Socket::IPV6_PKTINFO))
- if defined? Socket::IP_PKTINFO
- assert(!ancdata.cmsg_is?(:IP, :PKTINFO))
- end
- end
-
- if defined?(Socket::SCM_RIGHTS) && defined?(Socket::SCM_TIMESTAMP)
- def test_unix_rights
- assert_raise(TypeError) {
- Socket::AncillaryData.int(:UNIX, :SOL_SOCKET, :TIMESTAMP, 1).unix_rights
- }
- end
- end
-end if defined? Socket::AncillaryData
diff --git a/test/socket/test_basicsocket.rb b/test/socket/test_basicsocket.rb
deleted file mode 100644
index 59b739e813..0000000000
--- a/test/socket/test_basicsocket.rb
+++ /dev/null
@@ -1,88 +0,0 @@
-begin
- require "socket"
- require "test/unit"
-rescue LoadError
-end
-
-class TestSocket_BasicSocket < Test::Unit::TestCase
- def inet_stream
- sock = Socket.new(Socket::AF_INET, Socket::SOCK_STREAM, 0)
- yield sock
- ensure
- assert_raise(IOError) {sock.close}
- end
-
- def test_getsockopt
- inet_stream do |s|
- n = s.getsockopt(Socket::SOL_SOCKET, Socket::SO_TYPE)
- assert_equal([Socket::SOCK_STREAM].pack("i"), n.data)
-
- n = s.getsockopt("SOL_SOCKET", "SO_TYPE")
- assert_equal([Socket::SOCK_STREAM].pack("i"), n.data)
-
- n = s.getsockopt(:SOL_SOCKET, :SO_TYPE)
- assert_equal([Socket::SOCK_STREAM].pack("i"), n.data)
-
- n = s.getsockopt(:SOCKET, :TYPE)
- assert_equal([Socket::SOCK_STREAM].pack("i"), n.data)
-
- n = s.getsockopt(Socket::SOL_SOCKET, Socket::SO_ERROR)
- assert_equal([0].pack("i"), n.data)
-
- val = Object.new
- class << val; self end.send(:define_method, :to_int) {
- s.close
- Socket::SO_TYPE
- }
- assert_raise(IOError) {
- n = s.getsockopt(Socket::SOL_SOCKET, val)
- }
- end
- end
-
- def test_setsockopt
- s = nil
- linger = [0, 0].pack("ii")
-
- val = Object.new
- class << val; self end.send(:define_method, :to_str) {
- s.close
- linger
- }
- inet_stream do |sock|
- s = sock
- assert_equal(0, s.setsockopt(Socket::SOL_SOCKET, Socket::SO_LINGER, linger))
-
- assert_raise(IOError, "[ruby-dev:25039]") {
- s.setsockopt(Socket::SOL_SOCKET, Socket::SO_LINGER, val)
- }
- end
-
- val = Object.new
- class << val; self end.send(:define_method, :to_int) {
- s.close
- Socket::SO_LINGER
- }
- inet_stream do |sock|
- s = sock
- assert_raise(IOError) {
- s.setsockopt(Socket::SOL_SOCKET, val, linger)
- }
- end
- end
-
- def test_listen
- s = nil
- log = Object.new
- class << log; self end.send(:define_method, :to_int) {
- s.close
- 2
- }
- inet_stream do |sock|
- s = sock
- assert_raise(IOError) {
- s.listen(log)
- }
- end
- end
-end if defined?(BasicSocket)
diff --git a/test/socket/test_nonblock.rb b/test/socket/test_nonblock.rb
index f29766886f..ed6487b49f 100644
--- a/test/socket/test_nonblock.rb
+++ b/test/socket/test_nonblock.rb
@@ -7,20 +7,15 @@ require "test/unit"
require "tempfile"
require "timeout"
-class TestSocketNonblock < Test::Unit::TestCase
+class TestNonblockSocket < Test::Unit::TestCase
def test_accept_nonblock
serv = Socket.new(Socket::AF_INET, Socket::SOCK_STREAM, 0)
serv.bind(Socket.sockaddr_in(0, "127.0.0.1"))
serv.listen(5)
- assert_raise(IO::WaitReadable) { serv.accept_nonblock }
+ assert_raise(Errno::EAGAIN, Errno::EWOULDBLOCK) { serv.accept_nonblock }
c = Socket.new(Socket::AF_INET, Socket::SOCK_STREAM, 0)
c.connect(serv.getsockname)
- begin
- s, sockaddr = serv.accept_nonblock
- rescue IO::WaitReadable
- IO.select [serv]
- s, sockaddr = serv.accept_nonblock
- end
+ s, sockaddr = serv.accept_nonblock
assert_equal(Socket.unpack_sockaddr_in(c.getsockname), Socket.unpack_sockaddr_in(sockaddr))
ensure
serv.close if serv
@@ -36,7 +31,7 @@ class TestSocketNonblock < Test::Unit::TestCase
servaddr = serv.getsockname
begin
c.connect_nonblock(servaddr)
- rescue IO::WaitWritable
+ rescue Errno::EINPROGRESS
IO.select nil, [c]
assert_nothing_raised {
begin
@@ -57,8 +52,8 @@ class TestSocketNonblock < Test::Unit::TestCase
u1 = UDPSocket.new
u2 = UDPSocket.new
u1.bind("127.0.0.1", 0)
- assert_raise(IO::WaitReadable) { u1.recvfrom_nonblock(100) }
- assert_raise(IO::WaitReadable, Errno::EINVAL) { u2.recvfrom_nonblock(100) }
+ assert_raise(Errno::EAGAIN, Errno::EWOULDBLOCK) { u1.recvfrom_nonblock(100) }
+ assert_raise(Errno::EAGAIN, Errno::EWOULDBLOCK, Errno::EINVAL) { u2.recvfrom_nonblock(100) }
u2.send("aaa", 0, u1.getsockname)
IO.select [u1]
mesg, inet_addr = u1.recvfrom_nonblock(100)
@@ -67,7 +62,7 @@ class TestSocketNonblock < Test::Unit::TestCase
af, port, host, addr = inet_addr
u2_port, u2_addr = Socket.unpack_sockaddr_in(u2.getsockname)
assert_equal(u2_port, port)
- assert_raise(IO::WaitReadable) { u1.recvfrom_nonblock(100) }
+ assert_raise(Errno::EAGAIN, Errno::EWOULDBLOCK) { u1.recvfrom_nonblock(100) }
u2.send("", 0, u1.getsockname)
assert_nothing_raised("cygwin 1.5.19 has a problem to send an empty UDP packet. [ruby-dev:28915]") {
timeout(1) { IO.select [u1] }
@@ -83,13 +78,13 @@ class TestSocketNonblock < Test::Unit::TestCase
u1 = UDPSocket.new
u2 = UDPSocket.new
u1.bind("127.0.0.1", 0)
- assert_raise(IO::WaitReadable) { u1.recv_nonblock(100) }
- assert_raise(IO::WaitReadable, Errno::EINVAL) { u2.recv_nonblock(100) }
+ assert_raise(Errno::EAGAIN, Errno::EWOULDBLOCK) { u1.recv_nonblock(100) }
+ assert_raise(Errno::EAGAIN, Errno::EWOULDBLOCK, Errno::EINVAL) { u2.recv_nonblock(100) }
u2.send("aaa", 0, u1.getsockname)
IO.select [u1]
mesg = u1.recv_nonblock(100)
assert_equal("aaa", mesg)
- assert_raise(IO::WaitReadable) { u1.recv_nonblock(100) }
+ assert_raise(Errno::EAGAIN, Errno::EWOULDBLOCK) { u1.recv_nonblock(100) }
u2.send("", 0, u1.getsockname)
assert_nothing_raised("cygwin 1.5.19 has a problem to send an empty UDP packet. [ruby-dev:28915]") {
timeout(1) { IO.select [u1] }
@@ -105,11 +100,11 @@ class TestSocketNonblock < Test::Unit::TestCase
s1 = Socket.new(Socket::AF_INET, Socket::SOCK_DGRAM, 0)
s1.bind(Socket.sockaddr_in(0, "127.0.0.1"))
s2 = Socket.new(Socket::AF_INET, Socket::SOCK_DGRAM, 0)
- assert_raise(IO::WaitReadable) { s1.recvfrom_nonblock(100) }
- assert_raise(IO::WaitReadable, Errno::EINVAL) { s2.recvfrom_nonblock(100) }
+ assert_raise(Errno::EAGAIN, Errno::EWOULDBLOCK) { s1.recvfrom_nonblock(100) }
+ assert_raise(Errno::EAGAIN, Errno::EWOULDBLOCK, Errno::EINVAL) { s2.recvfrom_nonblock(100) }
s2.send("aaa", 0, s1.getsockname)
IO.select [s1]
- mesg, sockaddr = s1.recvfrom_nonblock(100)
+ mesg, sockaddr = s1.recvfrom_nonblock(100)
assert_equal("aaa", mesg)
port, addr = Socket.unpack_sockaddr_in(sockaddr)
s2_port, s2_addr = Socket.unpack_sockaddr_in(s2.getsockname)
@@ -124,29 +119,20 @@ class TestSocketNonblock < Test::Unit::TestCase
af, port, host, addr = serv.addr
c = TCPSocket.new(addr, port)
s = serv.accept
- if block_given?
- begin
- yield c, s
- ensure
- c.close if !c.closed?
- s.close if !s.closed?
- end
- else
- return c, s
- end
+ return c, s
ensure
- serv.close if serv && !serv.closed?
+ serv.close if serv
end
def test_tcp_recv_nonblock
c, s = tcp_pair
- assert_raise(IO::WaitReadable) { c.recv_nonblock(100) }
- assert_raise(IO::WaitReadable) { s.recv_nonblock(100) }
+ assert_raise(Errno::EAGAIN, Errno::EWOULDBLOCK) { c.recv_nonblock(100) }
+ assert_raise(Errno::EAGAIN, Errno::EWOULDBLOCK) { s.recv_nonblock(100) }
c.write("abc")
IO.select [s]
assert_equal("a", s.recv_nonblock(1))
assert_equal("bc", s.recv_nonblock(100))
- assert_raise(IO::WaitReadable) { s.recv_nonblock(100) }
+ assert_raise(Errno::EAGAIN, Errno::EWOULDBLOCK) { s.recv_nonblock(100) }
ensure
c.close if c
s.close if s
@@ -154,13 +140,13 @@ class TestSocketNonblock < Test::Unit::TestCase
def test_read_nonblock
c, s = tcp_pair
- assert_raise(IO::WaitReadable) { c.read_nonblock(100) }
- assert_raise(IO::WaitReadable) { s.read_nonblock(100) }
+ assert_raise(Errno::EAGAIN, Errno::EWOULDBLOCK) { c.read_nonblock(100) }
+ assert_raise(Errno::EAGAIN, Errno::EWOULDBLOCK) { s.read_nonblock(100) }
c.write("abc")
IO.select [s]
assert_equal("a", s.read_nonblock(1))
assert_equal("bc", s.read_nonblock(100))
- assert_raise(IO::WaitReadable) { s.read_nonblock(100) }
+ assert_raise(Errno::EAGAIN, Errno::EWOULDBLOCK) { s.read_nonblock(100) }
ensure
c.close if c
s.close if s
@@ -175,7 +161,7 @@ class TestSocketNonblock < Test::Unit::TestCase
ret = c.write_nonblock(str)
assert_operator(ret, :>, 0)
loop {
- assert_raise(IO::WaitWritable) {
+ assert_raise(Errno::EAGAIN, Errno::EWOULDBLOCK) {
loop {
ret = c.write_nonblock(str)
assert_operator(ret, :>, 0)
@@ -190,69 +176,4 @@ class TestSocketNonblock < Test::Unit::TestCase
end
=end
- def test_sendmsg_nonblock_error
- tcp_pair {|c, s|
- begin
- loop {
- c.sendmsg_nonblock("a" * 100000)
- }
- rescue NotImplementedError
- skip "sendmsg not implemented on this platform."
- rescue Errno::EWOULDBLOCK
- assert_kind_of(IO::WaitWritable, $!)
- end
- }
- end
-
- def test_recvmsg_nonblock_error
- tcp_pair {|c, s|
- begin
- c.recvmsg_nonblock(4096)
- rescue NotImplementedError
- skip "sendmsg not implemented on this platform."
- rescue Errno::EWOULDBLOCK
- assert_kind_of(IO::WaitReadable, $!)
- end
- }
- end
-
- def test_recv_nonblock_error
- tcp_pair {|c, s|
- begin
- c.recv_nonblock(4096)
- rescue Errno::EWOULDBLOCK
- assert_kind_of(IO::WaitReadable, $!)
- end
- }
- end
-
- def test_connect_nonblock_error
- serv = TCPServer.new("127.0.0.1", 0)
- af, port, host, addr = serv.addr
- c = Socket.new(:INET, :STREAM)
- begin
- c.connect_nonblock(Socket.sockaddr_in(port, "127.0.0.1"))
- rescue Errno::EINPROGRESS
- assert_kind_of(IO::WaitWritable, $!)
- end
- ensure
- serv.close if serv && !serv.closed?
- c.close if c && !c.closed?
- end
-
- def test_accept_nonblock_error
- serv = Socket.new(:INET, :STREAM)
- serv.bind(Socket.sockaddr_in(0, "127.0.0.1"))
- serv.listen(5)
- port = serv.local_address.ip_port
- begin
- s, _ = serv.accept_nonblock
- rescue Errno::EWOULDBLOCK
- assert_kind_of(IO::WaitReadable, $!)
- end
- ensure
- serv.close if serv && !serv.closed?
- s.close if s && !s.closed?
- end
-
end if defined?(Socket)
diff --git a/test/socket/test_socket.rb b/test/socket/test_socket.rb
index 17455a421d..fc01467f16 100644
--- a/test/socket/test_socket.rb
+++ b/test/socket/test_socket.rb
@@ -1,393 +1,83 @@
begin
require "socket"
- require "tmpdir"
require "test/unit"
rescue LoadError
end
-class TestSocket < Test::Unit::TestCase
- def test_socket_new
- s = Socket.new(:INET, :STREAM)
- assert_kind_of(Socket, s)
- end
-
- def test_unpack_sockaddr
- sockaddr_in = Socket.sockaddr_in(80, "")
- assert_raise(ArgumentError) { Socket.unpack_sockaddr_un(sockaddr_in) }
- sockaddr_un = Socket.sockaddr_un("/testdir/s")
- assert_raise(ArgumentError) { Socket.unpack_sockaddr_in(sockaddr_un) }
- assert_raise(ArgumentError) { Socket.unpack_sockaddr_in("") }
- assert_raise(ArgumentError) { Socket.unpack_sockaddr_un("") }
- end if Socket.respond_to?(:sockaddr_un)
-
- def test_sysaccept
- serv = Socket.new(Socket::AF_INET, Socket::SOCK_STREAM, 0)
- serv.bind(Socket.sockaddr_in(0, "127.0.0.1"))
- serv.listen 5
- c = Socket.new(Socket::AF_INET, Socket::SOCK_STREAM, 0)
- c.connect(serv.getsockname)
- fd, peeraddr = serv.sysaccept
- assert_equal(c.getsockname, peeraddr.to_sockaddr)
+class TestBasicSocket < Test::Unit::TestCase
+ def inet_stream
+ sock = Socket.new(Socket::AF_INET, Socket::SOCK_STREAM, 0)
+ yield sock
ensure
- serv.close if serv
- c.close if c
- IO.for_fd(fd).close if fd
+ assert_raise(IOError) {sock.close}
end
- def test_initialize
- Socket.open(Socket::AF_INET, Socket::SOCK_STREAM, 0) {|s|
- s.bind(Socket.sockaddr_in(0, "127.0.0.1"))
- addr = s.getsockname
- assert_nothing_raised { Socket.unpack_sockaddr_in(addr) }
- assert_raise(ArgumentError, NoMethodError) { Socket.unpack_sockaddr_un(addr) }
- }
- Socket.open("AF_INET", "SOCK_STREAM", 0) {|s|
- s.bind(Socket.sockaddr_in(0, "127.0.0.1"))
- addr = s.getsockname
- assert_nothing_raised { Socket.unpack_sockaddr_in(addr) }
- assert_raise(ArgumentError, NoMethodError) { Socket.unpack_sockaddr_un(addr) }
- }
- Socket.open(:AF_INET, :SOCK_STREAM, 0) {|s|
- s.bind(Socket.sockaddr_in(0, "127.0.0.1"))
- addr = s.getsockname
- assert_nothing_raised { Socket.unpack_sockaddr_in(addr) }
- assert_raise(ArgumentError, NoMethodError) { Socket.unpack_sockaddr_un(addr) }
- }
- end
-
- def test_getaddrinfo
- # This should not send a DNS query because AF_UNIX.
- assert_raise(SocketError) { Socket.getaddrinfo("www.kame.net", 80, "AF_UNIX") }
- end
-
- def test_getnameinfo
- assert_raise(SocketError) { Socket.getnameinfo(["AF_UNIX", 80, "0.0.0.0"]) }
- end
-
- def test_ip_address_list
- begin
- list = Socket.ip_address_list
- rescue NotImplementedError
- return
- end
- list.each {|ai|
- assert_instance_of(Addrinfo, ai)
- assert(ai.ip?)
- }
- end
-
- def test_tcp
- TCPServer.open(0) {|serv|
- addr = serv.connect_address
- addr.connect {|s1|
- s2 = serv.accept
- begin
- assert_equal(s2.remote_address.ip_unpack, s1.local_address.ip_unpack)
- ensure
- s2.close
- end
- }
- }
- end
-
- def random_port
- # IANA suggests dynamic port for 49152 to 65535
- # http://www.iana.org/assignments/port-numbers
- 49152 + rand(65535-49152+1)
- end
-
- def test_tcp_server_sockets
- port = random_port
- begin
- sockets = Socket.tcp_server_sockets(port)
- rescue Errno::EADDRINUSE
- return # not test failure
- end
- begin
- sockets.each {|s|
- assert_equal(port, s.local_address.ip_port)
- }
- ensure
- sockets.each {|s|
+ def test_getsockopt
+ inet_stream do |s|
+ n = s.getsockopt(Socket::SOL_SOCKET, Socket::SO_TYPE)
+ assert_equal([Socket::SOCK_STREAM].pack("i"), n)
+ n = s.getsockopt(Socket::SOL_SOCKET, Socket::SO_ERROR)
+ assert_equal([0].pack("i"), n)
+ val = Object.new
+ class << val; self end.__send__(:define_method, :to_int) {
s.close
+ Socket::SO_TYPE
}
- end
- end
-
- def test_tcp_server_sockets_port0
- sockets = Socket.tcp_server_sockets(0)
- ports = sockets.map {|s| s.local_address.ip_port }
- the_port = ports.first
- ports.each {|port|
- assert_equal(the_port, port)
- }
- ensure
- if sockets
- sockets.each {|s|
- s.close
- }
- end
- end
-
- if defined? UNIXSocket
- def test_unix
- Dir.mktmpdir {|tmpdir|
- path = "#{tmpdir}/sock"
- UNIXServer.open(path) {|serv|
- Socket.unix(path) {|s1|
- s2 = serv.accept
- begin
- s2raddr = s2.remote_address
- s1laddr = s1.local_address
- assert(s2raddr.to_sockaddr.empty? ||
- s1laddr.to_sockaddr.empty? ||
- s2raddr.unix_path == s1laddr.unix_path)
- ensure
- s2.close
- end
- }
- }
- }
- end
-
- def test_unix_server_socket
- Dir.mktmpdir {|tmpdir|
- path = "#{tmpdir}/sock"
- 2.times {
- serv = Socket.unix_server_socket(path)
- begin
- assert_kind_of(Socket, serv)
- assert(File.socket?(path))
- assert_equal(path, serv.local_address.unix_path)
- ensure
- serv.close
- end
- }
- }
- end
-
- def test_accept_loop_with_unix
- Dir.mktmpdir {|tmpdir|
- tcp_servers = []
- clients = []
- accepted = []
- begin
- tcp_servers = Socket.tcp_server_sockets(0)
- unix_server = Socket.unix_server_socket("#{tmpdir}/sock")
- tcp_servers.each {|s|
- addr = s.connect_address
- assert_nothing_raised("connect to #{addr.inspect}") {
- clients << addr.connect
- }
- }
- addr = unix_server.connect_address
- assert_nothing_raised("connect to #{addr.inspect}") {
- clients << addr.connect
- }
- Socket.accept_loop(tcp_servers, unix_server) {|s|
- accepted << s
- break if clients.length == accepted.length
- }
- assert_equal(clients.length, accepted.length)
- ensure
- tcp_servers.each {|s| s.close if !s.closed? }
- unix_server.close if !unix_server.closed?
- clients.each {|s| s.close if !s.closed? }
- accepted.each {|s| s.close if !s.closed? }
- end
+ assert_raise(IOError) {
+ n = s.getsockopt(Socket::SOL_SOCKET, val)
}
end
end
- def test_accept_loop
- servers = []
- begin
- servers = Socket.tcp_server_sockets(0)
- port = servers[0].local_address.ip_port
- Socket.tcp("localhost", port) {|s1|
- Socket.accept_loop(servers) {|s2, client_ai|
- begin
- assert_equal(s1.local_address.ip_unpack, client_ai.ip_unpack)
- ensure
- s2.close
- end
- break
- }
- }
- ensure
- servers.each {|s| s.close if !s.closed? }
- end
- end
+ def test_setsockopt # [ruby-dev:25039]
+ s = nil
+ linger = [0, 0].pack("ii")
- def test_accept_loop_multi_port
- servers = []
- begin
- servers = Socket.tcp_server_sockets(0)
- port = servers[0].local_address.ip_port
- servers2 = Socket.tcp_server_sockets(0)
- servers.concat servers2
- port2 = servers2[0].local_address.ip_port
+ val = Object.new
+ class << val; self end.__send__(:define_method, :to_str) {
+ s.close
+ linger
+ }
+ inet_stream do |s|
+ assert_equal(0, s.setsockopt(Socket::SOL_SOCKET, Socket::SO_LINGER, linger))
- Socket.tcp("localhost", port) {|s1|
- Socket.accept_loop(servers) {|s2, client_ai|
- begin
- assert_equal(s1.local_address.ip_unpack, client_ai.ip_unpack)
- ensure
- s2.close
- end
- break
- }
- }
- Socket.tcp("localhost", port2) {|s1|
- Socket.accept_loop(servers) {|s2, client_ai|
- begin
- assert_equal(s1.local_address.ip_unpack, client_ai.ip_unpack)
- ensure
- s2.close
- end
- break
- }
+ assert_raise(IOError) {
+ s.setsockopt(Socket::SOL_SOCKET, Socket::SO_LINGER, val)
}
- ensure
- servers.each {|s| s.close if !s.closed? }
end
- end
- def test_udp_server
- begin
- ip_addrs = Socket.ip_address_list
- rescue NotImplementedError
- skip "Socket.ip_address_list not implemented"
- end
-
- Socket.udp_server_sockets(0) {|sockets|
- skip "need sendmsg and recvmsg" unless sockets[0].respond_to?(:sendmsg)
- famlies = {}
- sockets.each {|s| famlies[s.local_address.afamily] = true }
- ip_addrs.reject! {|ai| !famlies[ai.afamily] }
- begin
- port = sockets.first.local_address.ip_port
-
- th = Thread.new {
- Socket.udp_server_loop_on(sockets) {|msg, msg_src|
- break if msg == "exit"
- rmsg = Marshal.dump([msg, msg_src.remote_address, msg_src.local_address])
- msg_src.reply rmsg
- }
- }
-
- ip_addrs.each {|ai|
- Addrinfo.udp(ai.ip_address, port).connect {|s|
- msg1 = "<<<#{ai.inspect}>>>"
- s.sendmsg msg1
- unless IO.select([s], nil, nil, 10)
- raise "no response"
- end
- msg2, addr = s.recvmsg
- msg2, remote_address, local_address = Marshal.load(msg2)
- assert_equal(msg1, msg2)
- assert_equal(ai.ip_address, addr.ip_address)
- }
- }
- ensure
- if th
- Addrinfo.udp("127.0.0.1", port).connect {|s| s.sendmsg "exit" }
- unless th.join(10)
- Thread.kill th
- th.join(10)
- raise "thread killed"
- end
- end
- end
+ val = Object.new
+ class << val; self end.__send__(:define_method, :to_int) {
+ s.close
+ Socket::SO_LINGER
}
- end
-
- def test_linger
- opt = Socket::Option.linger(true, 0)
- assert_equal([true, 0], opt.linger)
- Addrinfo.tcp("127.0.0.1", 0).listen {|serv|
- serv.local_address.connect {|s1|
- s2, _ = serv.accept
- begin
- s1.setsockopt(opt)
- s1.close
- assert_raise(Errno::ECONNRESET) { s2.read }
- ensure
- s2.close
- end
+ inet_stream do |s|
+ assert_raise(IOError) {
+ s.setsockopt(Socket::SOL_SOCKET, val, linger)
}
- }
+ end
end
- def test_timestamp
- return if /linux|freebsd|netbsd|openbsd|solaris|darwin/ !~ RUBY_PLATFORM
- return if !defined?(Socket::AncillaryData)
- t1 = Time.now.strftime("%Y-%m-%d")
- stamp = nil
- Addrinfo.udp("127.0.0.1", 0).bind {|s1|
- Addrinfo.udp("127.0.0.1", 0).bind {|s2|
- s1.setsockopt(:SOCKET, :TIMESTAMP, true)
- s2.send "a", 0, s1.local_address
- msg, addr, rflags, stamp = s1.recvmsg
- assert_equal("a", msg)
- assert(stamp.cmsg_is?(:SOCKET, :TIMESTAMP))
- }
+ def test_listen
+ s = nil
+ log = Object.new
+ class << log; self end.__send__(:define_method, :to_int) {
+ s.close
+ 2
}
- t2 = Time.now.strftime("%Y-%m-%d")
- pat = Regexp.union([t1, t2].uniq)
- assert_match(pat, stamp.inspect)
- t = stamp.timestamp
- assert_match(pat, t.strftime("%Y-%m-%d"))
- pat = /\.#{"%06d" % t.usec}/
- assert_match(pat, stamp.inspect)
- end
-
- def test_timestampns
- return if /linux/ !~ RUBY_PLATFORM || !defined?(Socket::SO_TIMESTAMPNS)
- t1 = Time.now.strftime("%Y-%m-%d")
- stamp = nil
- Addrinfo.udp("127.0.0.1", 0).bind {|s1|
- Addrinfo.udp("127.0.0.1", 0).bind {|s2|
- begin
- s1.setsockopt(:SOCKET, :TIMESTAMPNS, true)
- rescue Errno::ENOPROTOOPT
- # SO_TIMESTAMPNS is available since Linux 2.6.22
- return
- end
- s2.send "a", 0, s1.local_address
- msg, addr, rflags, stamp = s1.recvmsg
- assert_equal("a", msg)
- assert(stamp.cmsg_is?(:SOCKET, :TIMESTAMPNS))
+ inet_stream do |s|
+ assert_raise(IOError) {
+ s.listen(log)
}
- }
- t2 = Time.now.strftime("%Y-%m-%d")
- pat = Regexp.union([t1, t2].uniq)
- assert_match(pat, stamp.inspect)
- t = stamp.timestamp
- assert_match(pat, t.strftime("%Y-%m-%d"))
- pat = /\.#{"%09d" % t.nsec}/
- assert_match(pat, stamp.inspect)
+ end
end
+end if defined?(Socket)
- def test_bintime
- return if /freebsd/ !~ RUBY_PLATFORM
- t1 = Time.now.strftime("%Y-%m-%d")
- stamp = nil
- Addrinfo.udp("127.0.0.1", 0).bind {|s1|
- Addrinfo.udp("127.0.0.1", 0).bind {|s2|
- s1.setsockopt(:SOCKET, :BINTIME, true)
- s2.send "a", 0, s1.local_address
- msg, addr, rflags, stamp = s1.recvmsg
- assert_equal("a", msg)
- assert(stamp.cmsg_is?(:SOCKET, :BINTIME))
- }
- }
- t2 = Time.now.strftime("%Y-%m-%d")
- pat = Regexp.union([t1, t2].uniq)
- assert_match(pat, stamp.inspect)
- t = stamp.timestamp
- assert_match(pat, t.strftime("%Y-%m-%d"))
- assert_equal(stamp.data[-8,8].unpack("Q")[0], t.subsec * 2**64)
+class TestSocket < Test::Unit::TestCase
+ def test_unpack_sockaddr
+ sockaddr_in = Socket.sockaddr_in(80, "")
+ assert_raise(ArgumentError) { Socket.unpack_sockaddr_un(sockaddr_in) }
+ sockaddr_un = Socket.sockaddr_un("/tmp/s")
+ assert_raise(ArgumentError) { Socket.unpack_sockaddr_in(sockaddr_un) }
end
-
-end if defined?(Socket)
+end if defined?(Socket) && Socket.respond_to?(:sockaddr_un)
diff --git a/test/socket/test_sockopt.rb b/test/socket/test_sockopt.rb
deleted file mode 100644
index d3c831ed79..0000000000
--- a/test/socket/test_sockopt.rb
+++ /dev/null
@@ -1,33 +0,0 @@
-require 'test/unit'
-require 'socket'
-
-class TestSocketOption < Test::Unit::TestCase
- def test_new
- data = [1].pack("i")
- sockopt = Socket::Option.new(:INET, :SOCKET, :KEEPALIVE, data)
- assert_equal(Socket::AF_INET, sockopt.family)
- assert_equal(Socket::SOL_SOCKET, sockopt.level)
- assert_equal(Socket::SO_KEEPALIVE, sockopt.optname)
- assert_equal(Socket::SO_KEEPALIVE, sockopt.optname)
- assert_equal(data, sockopt.data)
- end
-
- def test_bool
- opt = Socket::Option.bool(:INET, :SOCKET, :KEEPALIVE, true)
- assert_equal(1, opt.int)
- opt = Socket::Option.bool(:INET, :SOCKET, :KEEPALIVE, false)
- assert_equal(0, opt.int)
- opt = Socket::Option.int(:INET, :SOCKET, :KEEPALIVE, 0)
- assert_equal(false, opt.bool)
- opt = Socket::Option.int(:INET, :SOCKET, :KEEPALIVE, 1)
- assert_equal(true, opt.bool)
- opt = Socket::Option.int(:INET, :SOCKET, :KEEPALIVE, 2)
- assert_equal(true, opt.bool)
- end
-
- def test_unpack
- sockopt = Socket::Option.new(:INET, :SOCKET, :KEEPALIVE, [1].pack("i"))
- assert_equal([1], sockopt.unpack("i"))
- assert_equal([1], sockopt.data.unpack("i"))
- end
-end
diff --git a/test/socket/test_tcp.rb b/test/socket/test_tcp.rb
deleted file mode 100644
index 2634e20651..0000000000
--- a/test/socket/test_tcp.rb
+++ /dev/null
@@ -1,42 +0,0 @@
-begin
- require "socket"
- require "test/unit"
-rescue LoadError
-end
-
-
-class TestSocket_TCPSocket < Test::Unit::TestCase
- def test_recvfrom
- svr = TCPServer.new("localhost", 0)
- th = Thread.new {
- c = svr.accept
- c.write "foo"
- c.close
- }
- addr = svr.addr
- sock = TCPSocket.open(addr[3], addr[1])
- assert_equal(["foo", nil], sock.recvfrom(0x10000))
- ensure
- th.kill if th
- th.join if th
- end
-
- def test_encoding
- svr = TCPServer.new("localhost", 0)
- th = Thread.new {
- c = svr.accept
- c.write "foo\r\n"
- c.close
- }
- addr = svr.addr
- sock = TCPSocket.open(addr[3], addr[1])
- assert_equal(true, sock.binmode?)
- s = sock.gets
- assert_equal("foo\r\n", s)
- assert_equal(Encoding.find("ASCII-8BIT"), s.encoding)
- ensure
- th.kill if th
- th.join if th
- sock.close if sock
- end
-end if defined?(TCPSocket)
diff --git a/test/socket/test_udp.rb b/test/socket/test_udp.rb
deleted file mode 100644
index fe329c8c16..0000000000
--- a/test/socket/test_udp.rb
+++ /dev/null
@@ -1,39 +0,0 @@
-begin
- require "socket"
- require "test/unit"
-rescue LoadError
-end
-
-
-class TestSocket_UDPSocket < Test::Unit::TestCase
- def test_open
- assert_nothing_raised { UDPSocket.open {} }
- assert_nothing_raised { UDPSocket.open(Socket::AF_INET) {} }
- assert_nothing_raised { UDPSocket.open("AF_INET") {} }
- assert_nothing_raised { UDPSocket.open(:AF_INET) {} }
- end
-
- def test_connect
- s = UDPSocket.new
- host = Object.new
- class << host; self end.send(:define_method, :to_str) {
- s.close
- "127.0.0.1"
- }
- assert_raise(IOError, "[ruby-dev:25045]") {
- s.connect(host, 1)
- }
- end
-
- def test_bind
- s = UDPSocket.new
- host = Object.new
- class << host; self end.send(:define_method, :to_str) {
- s.close
- "127.0.0.1"
- }
- assert_raise(IOError, "[ruby-dev:25057]") {
- s.bind(host, 2000)
- }
- end
-end if defined?(UDPSocket)
diff --git a/test/socket/test_unix.rb b/test/socket/test_unix.rb
index e18f5d6e95..14ddd6a4b6 100644
--- a/test/socket/test_unix.rb
+++ b/test/socket/test_unix.rb
@@ -5,9 +5,8 @@ end
require "test/unit"
require "tempfile"
-require "tmpdir"
-class TestSocket_UNIXSocket < Test::Unit::TestCase
+class TestUNIXSocket < Test::Unit::TestCase
def test_fd_passing
r1, w = IO.pipe
s1, s2 = UNIXSocket.pair
@@ -31,177 +30,6 @@ class TestSocket_UNIXSocket < Test::Unit::TestCase
end
end
- def test_fd_passing_n
- io_ary = []
- return if !defined?(Socket::SCM_RIGHTS)
- io_ary.concat IO.pipe
- io_ary.concat IO.pipe
- io_ary.concat IO.pipe
- send_io_ary = []
- io_ary.each {|io|
- send_io_ary << io
- UNIXSocket.pair {|s1, s2|
- begin
- ret = s1.sendmsg("\0", 0, nil, [Socket::SOL_SOCKET, Socket::SCM_RIGHTS,
- send_io_ary.map {|io| io.fileno }.pack("i!*")])
- rescue NotImplementedError
- return
- end
- assert_equal(1, ret)
- ret = s2.recvmsg(:scm_rights=>true)
- data, srcaddr, flags, *ctls = ret
- recv_io_ary = []
- ctls.each {|ctl|
- next if ctl.level != Socket::SOL_SOCKET || ctl.type != Socket::SCM_RIGHTS
- recv_io_ary.concat ctl.unix_rights
- }
- assert_equal(send_io_ary.length, recv_io_ary.length)
- send_io_ary.length.times {|i|
- assert_not_equal(send_io_ary[i].fileno, recv_io_ary[i].fileno)
- assert(File.identical?(send_io_ary[i], recv_io_ary[i]))
- }
- }
- }
- ensure
- io_ary.each {|io| io.close if !io.closed? }
- end
-
- def test_fd_passing_n2
- io_ary = []
- return if !defined?(Socket::SCM_RIGHTS)
- return if !defined?(Socket::AncillaryData)
- io_ary.concat IO.pipe
- io_ary.concat IO.pipe
- io_ary.concat IO.pipe
- send_io_ary = []
- io_ary.each {|io|
- send_io_ary << io
- UNIXSocket.pair {|s1, s2|
- begin
- ancdata = Socket::AncillaryData.unix_rights(*send_io_ary)
- ret = s1.sendmsg("\0", 0, nil, ancdata)
- rescue NotImplementedError
- return
- end
- assert_equal(1, ret)
- ret = s2.recvmsg(:scm_rights=>true)
- data, srcaddr, flags, *ctls = ret
- recv_io_ary = []
- ctls.each {|ctl|
- next if ctl.level != Socket::SOL_SOCKET || ctl.type != Socket::SCM_RIGHTS
- recv_io_ary.concat ctl.unix_rights
- }
- assert_equal(send_io_ary.length, recv_io_ary.length)
- send_io_ary.length.times {|i|
- assert_not_equal(send_io_ary[i].fileno, recv_io_ary[i].fileno)
- assert(File.identical?(send_io_ary[i], recv_io_ary[i]))
- }
- }
- }
- ensure
- io_ary.each {|io| io.close if !io.closed? }
- end
-
- def test_sendmsg
- return if !defined?(Socket::SCM_RIGHTS)
- IO.pipe {|r1, w|
- UNIXSocket.pair {|s1, s2|
- begin
- ret = s1.sendmsg("\0", 0, nil, [Socket::SOL_SOCKET, Socket::SCM_RIGHTS, [r1.fileno].pack("i!")])
- rescue NotImplementedError
- return
- end
- assert_equal(1, ret)
- r2 = s2.recv_io
- begin
- assert(File.identical?(r1, r2))
- ensure
- r2.close
- end
- }
- }
- end
-
- def test_sendmsg_ancillarydata_int
- return if !defined?(Socket::SCM_RIGHTS)
- return if !defined?(Socket::AncillaryData)
- IO.pipe {|r1, w|
- UNIXSocket.pair {|s1, s2|
- begin
- ad = Socket::AncillaryData.int(:UNIX, :SOCKET, :RIGHTS, r1.fileno)
- ret = s1.sendmsg("\0", 0, nil, ad)
- rescue NotImplementedError
- return
- end
- assert_equal(1, ret)
- r2 = s2.recv_io
- begin
- assert(File.identical?(r1, r2))
- ensure
- r2.close
- end
- }
- }
- end
-
- def test_sendmsg_ancillarydata_unix_rights
- return if !defined?(Socket::SCM_RIGHTS)
- return if !defined?(Socket::AncillaryData)
- IO.pipe {|r1, w|
- UNIXSocket.pair {|s1, s2|
- begin
- ad = Socket::AncillaryData.unix_rights(r1)
- ret = s1.sendmsg("\0", 0, nil, ad)
- rescue NotImplementedError
- return
- end
- assert_equal(1, ret)
- r2 = s2.recv_io
- begin
- assert(File.identical?(r1, r2))
- ensure
- r2.close
- end
- }
- }
- end
-
- def test_recvmsg
- return if !defined?(Socket::SCM_RIGHTS)
- IO.pipe {|r1, w|
- UNIXSocket.pair {|s1, s2|
- s1.send_io(r1)
- ret = s2.recvmsg(:scm_rights=>true)
- data, srcaddr, flags, *ctls = ret
- assert_equal("\0", data)
- if flags == nil
- # struct msghdr is 4.3BSD style (msg_accrights field).
- assert_instance_of(Array, ctls)
- assert_equal(0, ctls.length)
- else
- # struct msghdr is POSIX/4.4BSD style (msg_control field).
- assert_equal(0, flags & (Socket::MSG_TRUNC|Socket::MSG_CTRUNC))
- assert_instance_of(Addrinfo, srcaddr)
- assert_instance_of(Array, ctls)
- assert_equal(1, ctls.length)
- ctl = ctls[0]
- assert_instance_of(Socket::AncillaryData, ctl)
- assert_equal(Socket::SOL_SOCKET, ctl.level)
- assert_equal(Socket::SCM_RIGHTS, ctl.type)
- assert_instance_of(String, ctl.data)
- ios = ctl.unix_rights
- assert_equal(1, ios.length)
- r2 = ios[0]
- begin
- assert(File.identical?(r1, r2))
- ensure
- r2.close
- end
- end
- }
- }
- end
-
def bound_unix_socket(klass)
tmpfile = Tempfile.new("testrubysock")
path = tmpfile.path
@@ -290,6 +118,7 @@ class TestSocket_UNIXSocket < Test::Unit::TestCase
def test_nul
assert_raise(ArgumentError) { Socket.sockaddr_un("a\0b") }
+ assert_raise(ArgumentError) { UNIXServer.new("a\0b") }
end
def test_dgram_pair
@@ -309,166 +138,4 @@ class TestSocket_UNIXSocket < Test::Unit::TestCase
s2.close if s2
end
- def test_epipe # [ruby-dev:34619]
- s1, s2 = UNIXSocket.pair
- s1.shutdown(Socket::SHUT_WR)
- assert_raise(Errno::EPIPE) { s1.write "a" }
- assert_equal(nil, s2.read(1))
- s2.write "a"
- assert_equal("a", s1.read(1))
- end
-
- def test_socket_pair_with_block
- pair = nil
- ret = Socket.pair(Socket::AF_UNIX, Socket::SOCK_STREAM, 0) {|s1, s2|
- pair = [s1, s2]
- :return_value
- }
- assert_equal(:return_value, ret)
- assert_kind_of(Socket, pair[0])
- assert_kind_of(Socket, pair[1])
- end
-
- def test_unix_socket_pair_with_block
- pair = nil
- UNIXSocket.pair {|s1, s2|
- pair = [s1, s2]
- }
- assert_kind_of(UNIXSocket, pair[0])
- assert_kind_of(UNIXSocket, pair[1])
- end
-
- def test_initialize
- Dir.mktmpdir {|d|
- Socket.open(Socket::AF_UNIX, Socket::SOCK_STREAM, 0) {|s|
- s.bind(Socket.pack_sockaddr_un("#{d}/s1"))
- addr = s.getsockname
- assert_nothing_raised { Socket.unpack_sockaddr_un(addr) }
- assert_raise(ArgumentError) { Socket.unpack_sockaddr_in(addr) }
- }
- Socket.open("AF_UNIX", "SOCK_STREAM", 0) {|s|
- s.bind(Socket.pack_sockaddr_un("#{d}/s2"))
- addr = s.getsockname
- assert_nothing_raised { Socket.unpack_sockaddr_un(addr) }
- assert_raise(ArgumentError) { Socket.unpack_sockaddr_in(addr) }
- }
- }
- end
-
- def test_unix_server_socket
- Dir.mktmpdir {|d|
- path = "#{d}/sock"
- s0 = nil
- Socket.unix_server_socket(path) {|s|
- assert_equal(path, s.local_address.unix_path)
- assert(File.socket?(path))
- s0 = s
- }
- assert(s0.closed?)
- assert_raise(Errno::ENOENT) { File.stat path }
- }
- end
-
- def test_getcred_ucred
- return if /linux/ !~ RUBY_PLATFORM
- Dir.mktmpdir {|d|
- sockpath = "#{d}/sock"
- serv = Socket.unix_server_socket(sockpath)
- c = Socket.unix(sockpath)
- s, = serv.accept
- cred = s.getsockopt(:SOCKET, :PEERCRED)
- inspect = cred.inspect
- assert_match(/ pid=#{$$} /, inspect)
- assert_match(/ euid=#{Process.euid} /, inspect)
- assert_match(/ egid=#{Process.egid} /, inspect)
- assert_match(/ \(ucred\)/, inspect)
- }
- end
-
- def test_getcred_xucred
- return if /freebsd|darwin/ !~ RUBY_PLATFORM
- Dir.mktmpdir {|d|
- sockpath = "#{d}/sock"
- serv = Socket.unix_server_socket(sockpath)
- c = Socket.unix(sockpath)
- s, = serv.accept
- cred = s.getsockopt(0, Socket::LOCAL_PEERCRED)
- inspect = cred.inspect
- assert_match(/ euid=#{Process.euid} /, inspect)
- assert_match(/ \(xucred\)/, inspect)
- }
- end
-
- def test_sendcred_ucred
- return if /linux/ !~ RUBY_PLATFORM
- Dir.mktmpdir {|d|
- sockpath = "#{d}/sock"
- serv = Socket.unix_server_socket(sockpath)
- c = Socket.unix(sockpath)
- s, = serv.accept
- s.setsockopt(:SOCKET, :PASSCRED, 1)
- c.print "a"
- msg, cliend_ai, rflags, cred = s.recvmsg
- inspect = cred.inspect
- assert_equal("a", msg)
- assert_match(/ pid=#{$$} /, inspect)
- assert_match(/ uid=#{Process.uid} /, inspect)
- assert_match(/ gid=#{Process.gid} /, inspect)
- assert_match(/ \(ucred\)/, inspect)
- }
- end
-
- def test_sendcred_sockcred
- return if /netbsd|freebsd/ !~ RUBY_PLATFORM
- Dir.mktmpdir {|d|
- sockpath = "#{d}/sock"
- serv = Socket.unix_server_socket(sockpath)
- c = Socket.unix(sockpath)
- s, = serv.accept
- s.setsockopt(0, Socket::LOCAL_CREDS, 1)
- c.print "a"
- msg, cliend_ai, rflags, cred = s.recvmsg
- assert_equal("a", msg)
- inspect = cred.inspect
- assert_match(/ uid=#{Process.uid} /, inspect)
- assert_match(/ euid=#{Process.euid} /, inspect)
- assert_match(/ gid=#{Process.gid} /, inspect)
- assert_match(/ egid=#{Process.egid} /, inspect)
- assert_match(/ \(sockcred\)/, inspect)
- }
- end
-
- def test_sendcred_cmsgcred
- return if /freebsd/ !~ RUBY_PLATFORM
- Dir.mktmpdir {|d|
- sockpath = "#{d}/sock"
- serv = Socket.unix_server_socket(sockpath)
- c = Socket.unix(sockpath)
- s, = serv.accept
- c.sendmsg("a", 0, nil, [:SOCKET, Socket::SCM_CREDS, ""])
- msg, cliend_ai, rflags, cred = s.recvmsg
- assert_equal("a", msg)
- inspect = cred.inspect
- assert_match(/ pid=#{$$} /, inspect)
- assert_match(/ uid=#{Process.uid} /, inspect)
- assert_match(/ euid=#{Process.euid} /, inspect)
- assert_match(/ gid=#{Process.gid} /, inspect)
- assert_match(/ \(cmsgcred\)/, inspect)
- }
- end
-
- def test_getpeereid
- Dir.mktmpdir {|d|
- path = "#{d}/sock"
- serv = Socket.unix_server_socket(path)
- c = Socket.unix(path)
- s, = serv.accept
- begin
- assert_equal([Process.euid, Process.egid], c.getpeereid)
- assert_equal([Process.euid, Process.egid], s.getpeereid)
- rescue NotImplementedError
- end
- }
- end
-
end if defined?(UNIXSocket) && /cygwin/ !~ RUBY_PLATFORM
diff --git a/test/stringio/test_stringio.rb b/test/stringio/test_stringio.rb
index 570f180fc7..de15ab5508 100644
--- a/test/stringio/test_stringio.rb
+++ b/test/stringio/test_stringio.rb
@@ -15,414 +15,29 @@ class TestStringIO < Test::Unit::TestCase
include TestEOF::Seek
- def test_truncate
+ def test_truncate # [ruby-dev:24190]
io = StringIO.new("")
io.puts "abc"
io.truncate(0)
io.puts "def"
- assert_equal("\0\0\0\0def\n", io.string, "[ruby-dev:24190]")
- assert_raise(Errno::EINVAL) { io.truncate(-1) }
- io.truncate(10)
- assert_equal("\0\0\0\0def\n\0\0", io.string)
+ assert_equal("\0\0\0\0def\n", io.string)
end
- def test_seek_beyond_eof
+ def test_seek_beyond_eof # [ruby-dev:24194]
io = StringIO.new
n = 100
io.seek(n)
io.print "last"
- assert_equal("\0" * n + "last", io.string, "[ruby-dev:24194]")
+ assert_equal("\0" * n + "last", io.string)
end
- def test_overwrite
+ def test_overwrite # [ruby-core:03836]
stringio = StringIO.new
responses = ['', 'just another ruby', 'hacker']
responses.each do |resp|
stringio.puts(resp)
stringio.rewind
end
- assert_equal("hacker\nother ruby\n", stringio.string, "[ruby-core:3836]")
- end
-
- def test_gets
- assert_equal(nil, StringIO.new("").gets)
- assert_equal("\n", StringIO.new("\n").gets)
- assert_equal("a\n", StringIO.new("a\n").gets)
- assert_equal("a\n", StringIO.new("a\nb\n").gets)
- assert_equal("a", StringIO.new("a").gets)
- assert_equal("a\n", StringIO.new("a\nb").gets)
- assert_equal("abc\n", StringIO.new("abc\n\ndef\n").gets)
- assert_equal("abc\n\ndef\n", StringIO.new("abc\n\ndef\n").gets(nil))
- assert_equal("abc\n\n", StringIO.new("abc\n\ndef\n").gets(""))
- end
-
- def test_readlines
- assert_equal([], StringIO.new("").readlines)
- assert_equal(["\n"], StringIO.new("\n").readlines)
- assert_equal(["a\n"], StringIO.new("a\n").readlines)
- assert_equal(["a\n", "b\n"], StringIO.new("a\nb\n").readlines)
- assert_equal(["a"], StringIO.new("a").readlines)
- assert_equal(["a\n", "b"], StringIO.new("a\nb").readlines)
- assert_equal(["abc\n", "\n", "def\n"], StringIO.new("abc\n\ndef\n").readlines)
- assert_equal(["abc\n\ndef\n"], StringIO.new("abc\n\ndef\n").readlines(nil), "[ruby-dev:34591]")
- assert_equal(["abc\n\n", "def\n"], StringIO.new("abc\n\ndef\n").readlines(""))
- end
-
- def test_write
- s = ""
- f = StringIO.new(s, "w")
- f.print("foo")
- f.close
- assert_equal("foo", s)
-
- f = StringIO.new(s, File::WRONLY)
- f.print("bar")
- f.close
- assert_equal("bar", s)
-
- f = StringIO.new(s, "a")
- o = Object.new
- def o.to_s; "baz"; end
- f.print(o)
- f.close
- assert_equal("barbaz", s)
- ensure
- f.close unless f.closed?
- end
-
- def test_mode_error
- f = StringIO.new("", "r")
- assert_raise(IOError) { f.write("foo") }
-
- f = StringIO.new("", "w")
- assert_raise(IOError) { f.read }
-
- assert_raise(Errno::EACCES) { StringIO.new("".freeze, "w") }
- s = ""
- f = StringIO.new(s, "w")
- s.freeze
- assert_raise(IOError) { f.write("foo") }
-
- assert_raise(IOError) { StringIO.allocate.read }
- ensure
- f.close unless f.closed?
- end
-
- def test_open
- s = ""
- StringIO.open("foo") {|f| s = f.read }
- assert_equal("foo", s)
- end
-
- def test_isatty
- assert_equal(false, StringIO.new("").isatty)
- end
-
- def test_fsync
- assert_equal(0, StringIO.new("").fsync)
- end
-
- def test_sync
- assert_equal(true, StringIO.new("").sync)
- assert_equal(false, StringIO.new("").sync = false)
- end
-
- def test_set_fcntl
- assert_raise(NotImplementedError) { StringIO.new("").fcntl }
- end
-
- def test_close
- f = StringIO.new("")
- f.close
- assert_raise(IOError) { f.close }
-
- f = StringIO.new("")
- f.close_read
- f.close_write
- assert_raise(IOError) { f.close }
- ensure
- f.close unless f.closed?
- end
-
- def test_close_read
- f = StringIO.new("")
- f.close_read
- assert_raise(IOError) { f.read }
- assert_raise(IOError) { f.close_read }
- f.close
-
- f = StringIO.new("", "w")
- assert_raise(IOError) { f.close_read }
- f.close
- ensure
- f.close unless f.closed?
- end
-
- def test_close_write
- f = StringIO.new("")
- f.close_write
- assert_raise(IOError) { f.write("foo") }
- assert_raise(IOError) { f.close_write }
- f.close
-
- f = StringIO.new("", "r")
- assert_raise(IOError) { f.close_write }
- f.close
- ensure
- f.close unless f.closed?
- end
-
- def test_closed
- f = StringIO.new("")
- assert_equal(false, f.closed?)
- f.close
- assert_equal(true, f.closed?)
- ensure
- f.close unless f.closed?
- end
-
- def test_closed_read
- f = StringIO.new("")
- assert_equal(false, f.closed_read?)
- f.close_write
- assert_equal(false, f.closed_read?)
- f.close_read
- assert_equal(true, f.closed_read?)
- ensure
- f.close unless f.closed?
- end
-
- def test_closed_write
- f = StringIO.new("")
- assert_equal(false, f.closed_write?)
- f.close_read
- assert_equal(false, f.closed_write?)
- f.close_write
- assert_equal(true, f.closed_write?)
- ensure
- f.close unless f.closed?
- end
-
- def test_dup
- f1 = StringIO.new("1234")
- assert_equal("1", f1.getc)
- f2 = f1.dup
- assert_equal("2", f2.getc)
- assert_equal("3", f1.getc)
- assert_equal("4", f2.getc)
- assert_equal(nil, f1.getc)
- assert_equal(true, f2.eof?)
- f1.close
- assert_equal(true, f2.closed?)
- ensure
- f1.close unless f1.closed?
- f2.close unless f2.closed?
- end
-
- def test_lineno
- f = StringIO.new("foo\nbar\nbaz\n")
- assert_equal([0, "foo\n"], [f.lineno, f.gets])
- assert_equal([1, "bar\n"], [f.lineno, f.gets])
- f.lineno = 1000
- assert_equal([1000, "baz\n"], [f.lineno, f.gets])
- assert_equal([1001, nil], [f.lineno, f.gets])
- ensure
- f.close unless f.closed?
- end
-
- def test_pos
- f = StringIO.new("foo\nbar\nbaz\n")
- assert_equal([0, "foo\n"], [f.pos, f.gets])
- assert_equal([4, "bar\n"], [f.pos, f.gets])
- assert_raise(Errno::EINVAL) { f.pos = -1 }
- f.pos = 1
- assert_equal([1, "oo\n"], [f.pos, f.gets])
- assert_equal([4, "bar\n"], [f.pos, f.gets])
- assert_equal([8, "baz\n"], [f.pos, f.gets])
- assert_equal([12, nil], [f.pos, f.gets])
- ensure
- f.close unless f.closed?
- end
-
- def test_reopen
- f = StringIO.new("foo\nbar\nbaz\n")
- assert_equal("foo\n", f.gets)
- f.reopen("qux\nquux\nquuux\n")
- assert_equal("qux\n", f.gets)
-
- f2 = StringIO.new("")
- f2.reopen(f)
- assert_equal("quux\n", f2.gets)
- ensure
- f.close unless f.closed?
- end
-
- def test_seek
- f = StringIO.new("1234")
- assert_raise(Errno::EINVAL) { f.seek(-1) }
- f.seek(-1, 2)
- assert_equal("4", f.getc)
- assert_raise(Errno::EINVAL) { f.seek(1, 3) }
- f.close
- assert_raise(IOError) { f.seek(0) }
- ensure
- f.close unless f.closed?
- end
-
- def test_each_byte
- f = StringIO.new("1234")
- a = []
- f.each_byte {|c| a << c }
- assert_equal(%w(1 2 3 4).map {|c| c.ord }, a)
- ensure
- f.close unless f.closed?
- end
-
- def test_getbyte
- f = StringIO.new("1234")
- assert_equal("1".ord, f.getbyte)
- assert_equal("2".ord, f.getbyte)
- assert_equal("3".ord, f.getbyte)
- assert_equal("4".ord, f.getbyte)
- assert_equal(nil, f.getbyte)
- ensure
- f.close unless f.closed?
- end
-
- def test_ungetbyte
- s = "foo\nbar\n"
- t = StringIO.new(s, "r")
- t.ungetbyte(0x41)
- assert_equal(0x41, t.getbyte)
- t.ungetbyte("qux")
- assert_equal("quxfoo\n", t.gets)
- t.set_encoding("utf-8")
- t.ungetbyte(0x89)
- t.ungetbyte(0x8e)
- t.ungetbyte("\xe7")
- t.ungetbyte("\xe7\xb4\x85")
- assert_equal("\u7d05\u7389bar\n", t.gets)
- end
-
- def test_ungetc
- s = "1234"
- f = StringIO.new(s, "r")
- assert_nothing_raised { f.ungetc("x") }
- assert_equal("x", f.getc) # bug?
- assert_equal("1", f.getc)
-
- s = "1234"
- f = StringIO.new(s, "r")
- assert_equal("1", f.getc)
- f.ungetc("y".ord)
- assert_equal("y", f.getc)
- assert_equal("2", f.getc)
- ensure
- f.close unless f.closed?
- end
-
- def test_readchar
- f = StringIO.new("1234")
- a = ""
- assert_raise(EOFError) { loop { a << f.readchar } }
- assert_equal("1234", a)
- end
-
- def test_readbyte
- f = StringIO.new("1234")
- a = []
- assert_raise(EOFError) { loop { a << f.readbyte } }
- assert_equal("1234".unpack("C*"), a)
- end
-
- def test_each_char
- f = StringIO.new("1234")
- assert_equal(%w(1 2 3 4), f.each_char.to_a)
- end
-
- def test_each_codepoint
- f = StringIO.new("1234")
- assert_equal([49, 50, 51, 52], f.each_codepoint.to_a)
- end
-
- def test_gets2
- f = StringIO.new("foo\nbar\nbaz\n")
- assert_equal("fo", f.gets(2))
-
- o = Object.new
- def o.to_str; "z"; end
- assert_equal("o\nbar\nbaz", f.gets(o))
-
- f = StringIO.new("foo\nbar\nbaz\n")
- assert_equal("foo\nbar\nbaz", f.gets("az"))
- f = StringIO.new("a" * 10000 + "zz!")
- assert_equal("a" * 10000 + "zz", f.gets("zz"))
- f = StringIO.new("a" * 10000 + "zz!")
- assert_equal("a" * 10000 + "zz!", f.gets("zzz"))
- end
-
- def test_each
- f = StringIO.new("foo\nbar\nbaz\n")
- assert_equal(["foo\n", "bar\n", "baz\n"], f.each.to_a)
- end
-
- def test_putc
- s = ""
- f = StringIO.new(s, "w")
- f.putc("1")
- f.putc("2")
- f.putc("3")
- f.close
- assert_equal("123", s)
-
- s = "foo"
- f = StringIO.new(s, "a")
- f.putc("1")
- f.putc("2")
- f.putc("3")
- f.close
- assert_equal("foo123", s)
- end
-
- def test_read
- f = StringIO.new("1234")
- assert_raise(ArgumentError) { f.read(-1) }
- assert_raise(ArgumentError) { f.read(1, 2, 3) }
- end
-
- def test_size
- f = StringIO.new("1234")
- assert_equal(4, f.size)
- end
-
- # This test is should in ruby/test_method.rb
- # However this test depends on stringio library,
- # we write it here.
- class C < StringIO
- alias old_init initialize
- attr_reader :foo
- def initialize
- @foo = :ok
- old_init
- end
- end
-
- def test_method
- assert_equal(:ok, C.new.foo, 'Bug #632 [ruby-core:19282]')
- end
-
- def test_ungetc_pos
- b = '\\b00010001 \\B00010001 \\b1 \\B1 \\b000100011'
- s = StringIO.new( b )
- expected_pos = 0
- while n = s.getc
- assert_equal( expected_pos + 1, s.pos )
-
- s.ungetc( n )
- assert_equal( expected_pos, s.pos )
- assert_equal( n, s.getc )
-
- expected_pos += 1
- end
+ assert_equal("hacker\nother ruby\n", stringio.string)
end
end
diff --git a/test/strscan/test_stringscanner.rb b/test/strscan/test_stringscanner.rb
index f2feb6d9ae..75e96c0293 100644
--- a/test/strscan/test_stringscanner.rb
+++ b/test/strscan/test_stringscanner.rb
@@ -31,8 +31,8 @@ class TestStringScanner < Test::Unit::TestCase
def test_s_allocate
s = StringScanner.allocate
assert_equal '#<StringScanner (uninitialized)>', s.inspect.sub(/StringScanner_C/, 'StringScanner')
- assert_raise(UNINIT_ERROR) { s.eos? }
- assert_raise(UNINIT_ERROR) { s.scan(/a/) }
+ assert_raises(UNINIT_ERROR) { s.eos? }
+ assert_raises(UNINIT_ERROR) { s.scan(/a/) }
s.string = 'test'
assert_equal '#<StringScanner 0/4 @ "test">', s.inspect.sub(/StringScanner_C/, 'StringScanner')
assert_nothing_raised(UNINIT_ERROR) { s.eos? }
@@ -247,6 +247,19 @@ class TestStringScanner < Test::Unit::TestCase
s = StringScanner.new("")
assert_equal "", s.scan(//)
assert_equal "", s.scan(//)
+
+ # [ruby-dev:29914]
+ %w( NONE EUC SJIS UTF8 ).each do |kcode|
+ begin
+ $KCODE = kcode
+ assert_equal "a", StringScanner.new("a:b").scan(/[^\x01\:]+/n)
+ assert_equal "a", StringScanner.new("a:b").scan(/[^\x01\:]+/e)
+ assert_equal "a", StringScanner.new("a:b").scan(/[^\x01\:]+/s)
+ assert_equal "a", StringScanner.new("a:b").scan(/[^\x01\:]+/u)
+ ensure
+ $KCODE = 'NONE'
+ end
+ end
end
def test_skip
@@ -288,9 +301,15 @@ class TestStringScanner < Test::Unit::TestCase
assert_equal true, s.getch.tainted?
assert_nil s.getch
- s = StringScanner.new("\244\242".force_encoding("euc-jp"))
- assert_equal "\244\242".force_encoding("euc-jp"), s.getch
- assert_nil s.getch
+ kc_backup = $KCODE
+ begin
+ $KCODE = 'EUC'
+ s = StringScanner.new("\244\242")
+ assert_equal "\244\242", s.getch
+ assert_nil s.getch
+ ensure
+ $KCODE = kc_backup
+ end
s = StringScanner.new('test')
s.scan(/te/)
@@ -316,10 +335,16 @@ class TestStringScanner < Test::Unit::TestCase
assert_equal true, s.get_byte.tainted?
assert_nil s.get_byte
- s = StringScanner.new("\244\242".force_encoding("euc-jp"))
- assert_equal "\244".force_encoding("euc-jp"), s.get_byte
- assert_equal "\242".force_encoding("euc-jp"), s.get_byte
- assert_nil s.get_byte
+ kc_backup = $KCODE
+ begin
+ $KCODE = 'EUC'
+ s = StringScanner.new("\244\242")
+ assert_equal "\244", s.get_byte
+ assert_equal "\242", s.get_byte
+ assert_nil s.get_byte
+ ensure
+ $KCODE = kc_backup
+ end
s = StringScanner.new('test')
s.scan(/te/)
@@ -412,9 +437,16 @@ class TestStringScanner < Test::Unit::TestCase
assert_nil s[0]
- s = StringScanner.new("\244\242".force_encoding("euc-jp"))
- s.getch
- assert_equal "\244\242".force_encoding("euc-jp"), s[0]
+ kc_backup = $KCODE
+ begin
+ $KCODE = 'EUC'
+ s = StringScanner.new("\244\242")
+ s.getch
+ assert_equal "\244\242", s[0]
+ ensure
+ $KCODE = kc_backup
+ end
+
str = 'test'
str.taint
@@ -528,146 +560,12 @@ class TestStringScanner < Test::Unit::TestCase
s.terminate
assert_nil s.matched_size
+ # obsolete
s = StringScanner.new('test string')
- assert_nil s.matched_size
+ assert_nil s.matchedsize
s.scan(/test/)
assert_equal 4, s.matched_size
s.terminate
assert_nil s.matched_size
end
-
- def test_encoding
- ss = StringScanner.new("\xA1\xA2".force_encoding("euc-jp"))
- assert_equal(Encoding::EUC_JP, ss.scan(/./e).encoding)
- end
-
- def test_generic_regexp
- ss = StringScanner.new("\xA1\xA2".force_encoding("euc-jp"))
- t = ss.scan(/./)
- assert_equal("\xa1\xa2".force_encoding("euc-jp"), t)
- end
-
- def test_set_pos
- s = StringScanner.new("test string")
- s.pos = 7
- assert_equal("ring", s.rest)
- end
-
- def test_match_p
- s = StringScanner.new("test string")
- assert_equal(4, s.match?(/\w+/))
- assert_equal(4, s.match?(/\w+/))
- assert_equal(nil, s.match?(/\s+/))
- end
-
- def test_check
- s = StringScanner.new("Foo Bar Baz")
- assert_equal("Foo", s.check(/Foo/))
- assert_equal(0, s.pos)
- assert_equal("Foo", s.matched)
- assert_equal(nil, s.check(/Bar/))
- assert_equal(nil, s.matched)
- end
-
- def test_scan_full
- s = StringScanner.new("Foo Bar Baz")
- assert_equal(4, s.scan_full(/Foo /, false, false))
- assert_equal(0, s.pos)
- assert_equal(nil, s.scan_full(/Baz/, false, false))
- assert_equal("Foo ", s.scan_full(/Foo /, false, true))
- assert_equal(0, s.pos)
- assert_equal(nil, s.scan_full(/Baz/, false, false))
- assert_equal(4, s.scan_full(/Foo /, true, false))
- assert_equal(4, s.pos)
- assert_equal(nil, s.scan_full(/Baz /, false, false))
- assert_equal("Bar ", s.scan_full(/Bar /, true, true))
- assert_equal(8, s.pos)
- assert_equal(nil, s.scan_full(/az/, false, false))
- end
-
- def test_exist_p
- s = StringScanner.new("test string")
- assert_equal(3, s.exist?(/s/))
- assert_equal(0, s.pos)
- s.scan(/test/)
- assert_equal(2, s.exist?(/s/))
- assert_equal(4, s.pos)
- assert_equal(nil, s.exist?(/e/))
- end
-
- def test_skip_until
- s = StringScanner.new("Foo Bar Baz")
- assert_equal(3, s.skip_until(/Foo/))
- assert_equal(3, s.pos)
- assert_equal(4, s.skip_until(/Bar/))
- assert_equal(7, s.pos)
- assert_equal(nil, s.skip_until(/Qux/))
- end
-
- def test_check_until
- s = StringScanner.new("Foo Bar Baz")
- assert_equal("Foo", s.check_until(/Foo/))
- assert_equal(0, s.pos)
- assert_equal("Foo Bar", s.check_until(/Bar/))
- assert_equal(0, s.pos)
- assert_equal(nil, s.check_until(/Qux/))
- end
-
- def test_search_full
- s = StringScanner.new("Foo Bar Baz")
- assert_equal(8, s.search_full(/Bar /, false, false))
- assert_equal(0, s.pos)
- assert_equal("Foo Bar ", s.search_full(/Bar /, false, true))
- assert_equal(0, s.pos)
- assert_equal(8, s.search_full(/Bar /, true, false))
- assert_equal(8, s.pos)
- assert_equal("Baz", s.search_full(/az/, true, true))
- assert_equal(11, s.pos)
- end
-
- def test_peek
- s = StringScanner.new("test string")
- assert_equal("test st", s.peek(7))
- assert_equal("test st", s.peek(7))
- s.scan(/test/)
- assert_equal(" stri", s.peek(5))
- assert_equal(" string", s.peek(10))
- s.scan(/ string/)
- assert_equal("", s.peek(10))
- end
-
- def test_unscan
- s = StringScanner.new('test string')
- assert_equal("test", s.scan(/\w+/))
- s.unscan
- assert_equal("te", s.scan(/../))
- assert_equal(nil, s.scan(/\d/))
- assert_raise(ScanError) { s.unscan }
- end
-
- def test_rest
- s = StringScanner.new('test string')
- assert_equal("test string", s.rest)
- s.scan(/test/)
- assert_equal(" string", s.rest)
- s.scan(/ string/)
- assert_equal("", s.rest)
- s.scan(/ string/)
- end
-
- def test_rest_size
- s = StringScanner.new('test string')
- assert_equal(11, s.rest_size)
- s.scan(/test/)
- assert_equal(7, s.rest_size)
- s.scan(/ string/)
- assert_equal(0, s.rest_size)
- s.scan(/ string/)
- end
-
- def test_inspect
- s = StringScanner.new('test string test')
- s.scan(/test strin/)
- assert_equal('#<StringScanner 10/16 "...strin" @ "g tes...">', s.inspect)
- end
end
diff --git a/test/test_delegate.rb b/test/test_delegate.rb
deleted file mode 100644
index 0b4c117ebd..0000000000
--- a/test/test_delegate.rb
+++ /dev/null
@@ -1,32 +0,0 @@
-require 'test/unit'
-require 'delegate'
-
-class TestDelegateClass < Test::Unit::TestCase
- module M
- attr_reader :m
- end
-
- def test_extend
- obj = DelegateClass(Array).new([])
- obj.instance_eval { @m = :m }
- obj.extend M
- assert_equal(:m, obj.m, "[ruby-dev:33116]")
- end
-
- def test_systemcallerror_eq
- e = SystemCallError.new(0)
- assert((SimpleDelegator.new(e) == e) == (e == SimpleDelegator.new(e)), "[ruby-dev:34808]")
- end
-
- class Myclass < DelegateClass(Array);end
-
- def test_delegateclass_class
- myclass=Myclass.new([])
- assert_equal(Myclass,myclass.class)
- end
-
- def test_simpledelegator_class
- simple=SimpleDelegator.new([])
- assert_equal(SimpleDelegator,simple.class)
- end
-end
diff --git a/test/test_ipaddr.rb b/test/test_ipaddr.rb
deleted file mode 100644
index 604ce93caa..0000000000
--- a/test/test_ipaddr.rb
+++ /dev/null
@@ -1,4 +0,0 @@
-require 'pathname'
-require Pathname.new(__FILE__).dirname.join('inlinetest.rb')
-target = __FILE__[/test_(.*\.rb)$/, 1]
-InlineTest.loadtest__END__part(target)
diff --git a/test/test_open3.rb b/test/test_open3.rb
deleted file mode 100644
index 8f355ccb76..0000000000
--- a/test/test_open3.rb
+++ /dev/null
@@ -1,243 +0,0 @@
-require 'test/unit'
-require 'open3'
-require 'shellwords'
-require_relative 'ruby/envutil'
-
-class TestOpen3 < Test::Unit::TestCase
- RUBY = EnvUtil.rubybin
-
- def test_exit_status
- Open3.popen3(RUBY, '-e', 'exit true') {|i,o,e,t|
- assert_equal(true, t.value.success?)
- }
- Open3.popen3(RUBY, '-e', 'exit false') {|i,o,e,t|
- assert_equal(false, t.value.success?)
- }
- end
-
- def test_stdin
- Open3.popen3(RUBY, '-e', 'exit STDIN.gets.chomp == "t"') {|i,o,e,t|
- i.puts 't'
- assert_equal(true, t.value.success?)
- }
- Open3.popen3(RUBY, '-e', 'exit STDIN.gets.chomp == "t"') {|i,o,e,t|
- i.puts 'f'
- assert_equal(false, t.value.success?)
- }
- end
-
- def test_stdout
- Open3.popen3(RUBY, '-e', 'STDOUT.print "foo"') {|i,o,e,t|
- assert_equal("foo", o.read)
- }
- end
-
- def test_stderr
- Open3.popen3(RUBY, '-e', 'STDERR.print "bar"') {|i,o,e,t|
- assert_equal("bar", e.read)
- }
- end
-
- def test_block
- r = Open3.popen3(RUBY, '-e', 'STDOUT.print STDIN.read') {|i,o,e,t|
- i.print "baz"
- i.close
- assert_equal("baz", o.read)
- "qux"
- }
- assert_equal("qux", r)
- end
-
- def test_noblock
- i,o,e,t = Open3.popen3(RUBY, '-e', 'STDOUT.print STDIN.read')
- i.print "baz"
- i.close
- assert_equal("baz", o.read)
- ensure
- i.close if !i.closed?
- o.close if !o.closed?
- e.close if !e.closed?
- end
-
- def test_commandline
- commandline = Shellwords.join([RUBY, '-e', 'print "quux"'])
- Open3.popen3(commandline) {|i,o,e,t|
- assert_equal("quux", o.read)
- }
- end
-
- def test_pid
- Open3.popen3(RUBY, '-e', 'print $$') {|i,o,e,t|
- pid = o.read.to_i
- assert_equal(pid, t[:pid])
- assert_equal(pid, t.pid)
- }
- end
-
- def with_pipe
- r, w = IO.pipe
- yield r, w
- ensure
- r.close if !r.closed?
- w.close if !w.closed?
- end
-
- def with_reopen(io, arg)
- old = io.dup
- io.reopen(arg)
- yield old
- ensure
- io.reopen(old)
- old.close if old && !old.closed?
- end
-
- def test_popen2
- with_pipe {|r, w|
- with_reopen(STDERR, w) {|old|
- w.close
- Open3.popen2(RUBY, '-e', 's=STDIN.read; STDOUT.print s+"o"; STDERR.print s+"e"') {|i,o,t|
- assert_kind_of(Thread, t)
- i.print "z"
- i.close
- STDERR.reopen(old)
- assert_equal("zo", o.read)
- assert_equal("ze", r.read)
- }
- }
- }
- end
-
- def test_popen2e
- with_pipe {|r, w|
- with_reopen(STDERR, w) {|old|
- w.close
- Open3.popen2e(RUBY, '-e', 's=STDIN.read; STDOUT.print s+"o"; STDOUT.flush; STDERR.print s+"e"') {|i,o,t|
- assert_kind_of(Thread, t)
- i.print "y"
- i.close
- STDERR.reopen(old)
- assert_equal("yoye", o.read)
- assert_equal("", r.read)
- }
- }
- }
- end
-
- def test_capture3
- o, e, s = Open3.capture3(RUBY, '-e', 'i=STDIN.read; print i+"o"; STDOUT.flush; STDERR.print i+"e"', :stdin_data=>"i")
- assert_equal("io", o)
- assert_equal("ie", e)
- assert(s.success?)
- end
-
- def test_capture3_flip
- o, e, s = Open3.capture3(RUBY, '-e', 'STDOUT.sync=true; 1000.times { print "o"*1000; STDERR.print "e"*1000 }')
- assert_equal("o"*1000000, o)
- assert_equal("e"*1000000, e)
- assert(s.success?)
- end
-
- def test_capture2
- o, s = Open3.capture2(RUBY, '-e', 'i=STDIN.read; print i+"o"', :stdin_data=>"i")
- assert_equal("io", o)
- assert(s.success?)
- end
-
- def test_capture2e
- oe, s = Open3.capture2e(RUBY, '-e', 'i=STDIN.read; print i+"o"; STDOUT.flush; STDERR.print i+"e"', :stdin_data=>"i")
- assert_equal("ioie", oe)
- assert(s.success?)
- end
-
- def test_pipeline_rw
- Open3.pipeline_rw([RUBY, '-e', 'print STDIN.read + "1"'],
- [RUBY, '-e', 'print STDIN.read + "2"']) {|i,o,ts|
- assert_kind_of(IO, i)
- assert_kind_of(IO, o)
- assert_kind_of(Array, ts)
- assert_equal(2, ts.length)
- ts.each {|t| assert_kind_of(Thread, t) }
- i.print "0"
- i.close
- assert_equal("012", o.read)
- ts.each {|t|
- assert(t.value.success?)
- }
- }
- end
-
- def test_pipeline_r
- Open3.pipeline_r([RUBY, '-e', 'print "1"'],
- [RUBY, '-e', 'print STDIN.read + "2"']) {|o,ts|
- assert_kind_of(IO, o)
- assert_kind_of(Array, ts)
- assert_equal(2, ts.length)
- ts.each {|t| assert_kind_of(Thread, t) }
- assert_equal("12", o.read)
- ts.each {|t|
- assert(t.value.success?)
- }
- }
- end
-
- def test_pipeline_w
- command = [RUBY, '-e', 's=STDIN.read; print s[1..-1]; exit s[0] == ?t']
- str = 'ttftff'
- Open3.pipeline_w(*[command]*str.length) {|i,ts|
- assert_kind_of(IO, i)
- assert_kind_of(Array, ts)
- assert_equal(str.length, ts.length)
- ts.each {|t| assert_kind_of(Thread, t) }
- i.print str
- i.close
- ts.each_with_index {|t, i|
- assert_equal(str[i] == ?t, t.value.success?)
- }
- }
- end
-
- def test_pipeline_start
- command = [RUBY, '-e', 's=STDIN.read; print s[1..-1]; exit s[0] == ?t']
- str = 'ttftff'
- Open3.pipeline_start([RUBY, '-e', 'print ARGV[0]', str],
- *([command]*str.length)) {|ts|
- assert_kind_of(Array, ts)
- assert_equal(str.length+1, ts.length)
- ts.each {|t| assert_kind_of(Thread, t) }
- ts.each_with_index {|t, i|
- if i == 0
- assert(t.value.success?)
- else
- assert_equal(str[i-1] == ?t, t.value.success?)
- end
- }
- }
- end
-
- def test_pipeline_start_noblock
- ts = Open3.pipeline_start([RUBY, '-e', ''])
- assert_kind_of(Array, ts)
- assert_equal(1, ts.length)
- ts.each {|t| assert_kind_of(Thread, t) }
- t = ts[0]
- assert(t.value.success?)
- end
-
- def test_pipeline
- command = [RUBY, '-e', 's=STDIN.read; print s[1..-1]; exit s[0] == ?t']
- str = 'ttftff'
- ss = Open3.pipeline([RUBY, '-e', 'print ARGV[0]', str],
- *([command]*str.length))
- assert_kind_of(Array, ss)
- assert_equal(str.length+1, ss.length)
- ss.each {|s| assert_kind_of(Process::Status, s) }
- ss.each_with_index {|s, i|
- if i == 0
- assert(s.success?)
- else
- assert_equal(str[i-1] == ?t, s.success?)
- end
- }
- end
-
-end
diff --git a/test/test_pp.rb b/test/test_pp.rb
deleted file mode 100644
index 1809770049..0000000000
--- a/test/test_pp.rb
+++ /dev/null
@@ -1,180 +0,0 @@
-require 'pp'
-require 'test/unit'
-
-class PPTest < Test::Unit::TestCase
- def test_list0123_12
- assert_equal("[0, 1, 2, 3]\n", PP.pp([0,1,2,3], '', 12))
- end
-
- def test_list0123_11
- assert_equal("[0,\n 1,\n 2,\n 3]\n", PP.pp([0,1,2,3], '', 11))
- end
-
- OverriddenStruct = Struct.new("OverriddenStruct", :members, :class)
- def test_struct_override_members # [ruby-core:7865]
- a = OverriddenStruct.new(1,2)
- assert_equal("#<struct Struct::OverriddenStruct members=1, class=2>\n", PP.pp(a, ''))
- end
-
- def test_redefined_method
- o = ""
- def o.method
- end
- assert_equal(%(""\n), PP.pp(o, ""))
- end
-end
-
-class HasInspect
- def initialize(a)
- @a = a
- end
-
- def inspect
- return "<inspect:#{@a.inspect}>"
- end
-end
-
-class HasPrettyPrint
- def initialize(a)
- @a = a
- end
-
- def pretty_print(q)
- q.text "<pretty_print:"
- q.pp @a
- q.text ">"
- end
-end
-
-class HasBoth
- def initialize(a)
- @a = a
- end
-
- def inspect
- return "<inspect:#{@a.inspect}>"
- end
-
- def pretty_print(q)
- q.text "<pretty_print:"
- q.pp @a
- q.text ">"
- end
-end
-
-class PrettyPrintInspect < HasPrettyPrint
- alias inspect pretty_print_inspect
-end
-
-class PrettyPrintInspectWithoutPrettyPrint
- alias inspect pretty_print_inspect
-end
-
-class PPInspectTest < Test::Unit::TestCase
- def test_hasinspect
- a = HasInspect.new(1)
- assert_equal("<inspect:1>\n", PP.pp(a, ''))
- end
-
- def test_hasprettyprint
- a = HasPrettyPrint.new(1)
- assert_equal("<pretty_print:1>\n", PP.pp(a, ''))
- end
-
- def test_hasboth
- a = HasBoth.new(1)
- assert_equal("<pretty_print:1>\n", PP.pp(a, ''))
- end
-
- def test_pretty_print_inspect
- a = PrettyPrintInspect.new(1)
- assert_equal("<pretty_print:1>", a.inspect)
- a = PrettyPrintInspectWithoutPrettyPrint.new
- assert_raise(RuntimeError) { a.inspect }
- end
-
- def test_proc
- a = proc {1}
- assert_equal("#{a.inspect}\n", PP.pp(a, ''))
- end
-
- def test_to_s_with_iv
- a = Object.new
- def a.to_s() "aaa" end
- a.instance_eval { @a = nil }
- result = PP.pp(a, '')
- assert_equal("#{a.inspect}\n", result)
- assert_match(/\A#<Object.*>\n\z/m, result)
- a = 1.0
- a.instance_eval { @a = nil }
- result = PP.pp(a, '')
- assert_equal("#{a.inspect}\n", result)
- end
-
- def test_to_s_without_iv
- a = Object.new
- def a.to_s() "aaa" end
- result = PP.pp(a, '')
- assert_equal("#{a.inspect}\n", result)
- assert_equal("aaa\n", result)
- end
-end
-
-class PPCycleTest < Test::Unit::TestCase
- def test_array
- a = []
- a << a
- assert_equal("[[...]]\n", PP.pp(a, ''))
- assert_equal("#{a.inspect}\n", PP.pp(a, ''))
- end
-
- def test_hash
- a = {}
- a[0] = a
- assert_equal("{0=>{...}}\n", PP.pp(a, ''))
- assert_equal("#{a.inspect}\n", PP.pp(a, ''))
- end
-
- S = Struct.new("S", :a, :b)
- def test_struct
- a = S.new(1,2)
- a.b = a
- assert_equal("#<struct Struct::S a=1, b=#<struct Struct::S:...>>\n", PP.pp(a, ''))
- assert_equal("#{a.inspect}\n", PP.pp(a, ''))
- end
-
- def test_object
- a = Object.new
- a.instance_eval {@a = a}
- assert_equal(a.inspect + "\n", PP.pp(a, ''))
- end
-
- def test_anonymous
- a = Class.new.new
- assert_equal(a.inspect + "\n", PP.pp(a, ''))
- end
-
- def test_withinspect
- a = []
- a << HasInspect.new(a)
- assert_equal("[<inspect:[...]>]\n", PP.pp(a, ''))
- assert_equal("#{a.inspect}\n", PP.pp(a, ''))
- end
-
- def test_share_nil
- begin
- PP.sharing_detection = true
- a = [nil, nil]
- assert_equal("[nil, nil]\n", PP.pp(a, ''))
- ensure
- PP.sharing_detection = false
- end
- end
-end
-
-class PPSingleLineTest < Test::Unit::TestCase
- def test_hash
- assert_equal("{1=>1}", PP.singleline_pp({ 1 => 1}, '')) # [ruby-core:02699]
- assert_equal("[1#{', 1'*99}]", PP.singleline_pp([1]*100, ''))
- end
-end
diff --git a/test/test_prettyprint.rb b/test/test_prettyprint.rb
deleted file mode 100644
index 42178e7d03..0000000000
--- a/test/test_prettyprint.rb
+++ /dev/null
@@ -1,515 +0,0 @@
-require 'prettyprint'
-require 'test/unit'
-
-class WadlerExample < Test::Unit::TestCase # :nodoc:
- def setup
- @tree = Tree.new("aaaa", Tree.new("bbbbb", Tree.new("ccc"),
- Tree.new("dd")),
- Tree.new("eee"),
- Tree.new("ffff", Tree.new("gg"),
- Tree.new("hhh"),
- Tree.new("ii")))
- end
-
- def hello(width)
- PrettyPrint.format('', width) {|hello|
- hello.group {
- hello.group {
- hello.group {
- hello.group {
- hello.text 'hello'
- hello.breakable; hello.text 'a'
- }
- hello.breakable; hello.text 'b'
- }
- hello.breakable; hello.text 'c'
- }
- hello.breakable; hello.text 'd'
- }
- }
- end
-
- def test_hello_00_06
- expected = <<'End'.chomp
-hello
-a
-b
-c
-d
-End
- assert_equal(expected, hello(0))
- assert_equal(expected, hello(6))
- end
-
- def test_hello_07_08
- expected = <<'End'.chomp
-hello a
-b
-c
-d
-End
- assert_equal(expected, hello(7))
- assert_equal(expected, hello(8))
- end
-
- def test_hello_09_10
- expected = <<'End'.chomp
-hello a b
-c
-d
-End
- out = hello(9); assert_equal(expected, out)
- out = hello(10); assert_equal(expected, out)
- end
-
- def test_hello_11_12
- expected = <<'End'.chomp
-hello a b c
-d
-End
- assert_equal(expected, hello(11))
- assert_equal(expected, hello(12))
- end
-
- def test_hello_13
- expected = <<'End'.chomp
-hello a b c d
-End
- assert_equal(expected, hello(13))
- end
-
- def tree(width)
- PrettyPrint.format('', width) {|q| @tree.show(q)}
- end
-
- def test_tree_00_19
- expected = <<'End'.chomp
-aaaa[bbbbb[ccc,
- dd],
- eee,
- ffff[gg,
- hhh,
- ii]]
-End
- assert_equal(expected, tree(0))
- assert_equal(expected, tree(19))
- end
-
- def test_tree_20_22
- expected = <<'End'.chomp
-aaaa[bbbbb[ccc, dd],
- eee,
- ffff[gg,
- hhh,
- ii]]
-End
- assert_equal(expected, tree(20))
- assert_equal(expected, tree(22))
- end
-
- def test_tree_23_43
- expected = <<'End'.chomp
-aaaa[bbbbb[ccc, dd],
- eee,
- ffff[gg, hhh, ii]]
-End
- assert_equal(expected, tree(23))
- assert_equal(expected, tree(43))
- end
-
- def test_tree_44
- assert_equal(<<'End'.chomp, tree(44))
-aaaa[bbbbb[ccc, dd], eee, ffff[gg, hhh, ii]]
-End
- end
-
- def tree_alt(width)
- PrettyPrint.format('', width) {|q| @tree.altshow(q)}
- end
-
- def test_tree_alt_00_18
- expected = <<'End'.chomp
-aaaa[
- bbbbb[
- ccc,
- dd
- ],
- eee,
- ffff[
- gg,
- hhh,
- ii
- ]
-]
-End
- assert_equal(expected, tree_alt(0))
- assert_equal(expected, tree_alt(18))
- end
-
- def test_tree_alt_19_20
- expected = <<'End'.chomp
-aaaa[
- bbbbb[ ccc, dd ],
- eee,
- ffff[
- gg,
- hhh,
- ii
- ]
-]
-End
- assert_equal(expected, tree_alt(19))
- assert_equal(expected, tree_alt(20))
- end
-
- def test_tree_alt_20_49
- expected = <<'End'.chomp
-aaaa[
- bbbbb[ ccc, dd ],
- eee,
- ffff[ gg, hhh, ii ]
-]
-End
- assert_equal(expected, tree_alt(21))
- assert_equal(expected, tree_alt(49))
- end
-
- def test_tree_alt_50
- expected = <<'End'.chomp
-aaaa[ bbbbb[ ccc, dd ], eee, ffff[ gg, hhh, ii ] ]
-End
- assert_equal(expected, tree_alt(50))
- end
-
- class Tree # :nodoc:
- def initialize(string, *children)
- @string = string
- @children = children
- end
-
- def show(q)
- q.group {
- q.text @string
- q.nest(@string.length) {
- unless @children.empty?
- q.text '['
- q.nest(1) {
- first = true
- @children.each {|t|
- if first
- first = false
- else
- q.text ','
- q.breakable
- end
- t.show(q)
- }
- }
- q.text ']'
- end
- }
- }
- end
-
- def altshow(q)
- q.group {
- q.text @string
- unless @children.empty?
- q.text '['
- q.nest(2) {
- q.breakable
- first = true
- @children.each {|t|
- if first
- first = false
- else
- q.text ','
- q.breakable
- end
- t.altshow(q)
- }
- }
- q.breakable
- q.text ']'
- end
- }
- end
-
- end
-end
-
-class StrictPrettyExample < Test::Unit::TestCase # :nodoc:
- def prog(width)
- PrettyPrint.format('', width) {|q|
- q.group {
- q.group {q.nest(2) {
- q.text "if"; q.breakable;
- q.group {
- q.nest(2) {
- q.group {q.text "a"; q.breakable; q.text "=="}
- q.breakable; q.text "b"}}}}
- q.breakable
- q.group {q.nest(2) {
- q.text "then"; q.breakable;
- q.group {
- q.nest(2) {
- q.group {q.text "a"; q.breakable; q.text "<<"}
- q.breakable; q.text "2"}}}}
- q.breakable
- q.group {q.nest(2) {
- q.text "else"; q.breakable;
- q.group {
- q.nest(2) {
- q.group {q.text "a"; q.breakable; q.text "+"}
- q.breakable; q.text "b"}}}}}
- }
- end
-
- def test_00_04
- expected = <<'End'.chomp
-if
- a
- ==
- b
-then
- a
- <<
- 2
-else
- a
- +
- b
-End
- assert_equal(expected, prog(0))
- assert_equal(expected, prog(4))
- end
-
- def test_05
- expected = <<'End'.chomp
-if
- a
- ==
- b
-then
- a
- <<
- 2
-else
- a +
- b
-End
- assert_equal(expected, prog(5))
- end
-
- def test_06
- expected = <<'End'.chomp
-if
- a ==
- b
-then
- a <<
- 2
-else
- a +
- b
-End
- assert_equal(expected, prog(6))
- end
-
- def test_07
- expected = <<'End'.chomp
-if
- a ==
- b
-then
- a <<
- 2
-else
- a + b
-End
- assert_equal(expected, prog(7))
- end
-
- def test_08
- expected = <<'End'.chomp
-if
- a == b
-then
- a << 2
-else
- a + b
-End
- assert_equal(expected, prog(8))
- end
-
- def test_09
- expected = <<'End'.chomp
-if a == b
-then
- a << 2
-else
- a + b
-End
- assert_equal(expected, prog(9))
- end
-
- def test_10
- expected = <<'End'.chomp
-if a == b
-then
- a << 2
-else a + b
-End
- assert_equal(expected, prog(10))
- end
-
- def test_11_31
- expected = <<'End'.chomp
-if a == b
-then a << 2
-else a + b
-End
- assert_equal(expected, prog(11))
- assert_equal(expected, prog(15))
- assert_equal(expected, prog(31))
- end
-
- def test_32
- expected = <<'End'.chomp
-if a == b then a << 2 else a + b
-End
- assert_equal(expected, prog(32))
- end
-
-end
-
-class TailGroup < Test::Unit::TestCase # :nodoc:
- def test_1
- out = PrettyPrint.format('', 10) {|q|
- q.group {
- q.group {
- q.text "abc"
- q.breakable
- q.text "def"
- }
- q.group {
- q.text "ghi"
- q.breakable
- q.text "jkl"
- }
- }
- }
- assert_equal("abc defghi\njkl", out)
- end
-end
-
-class NonString < Test::Unit::TestCase # :nodoc:
- def format(width)
- PrettyPrint.format([], width, 'newline', lambda {|n| "#{n} spaces"}) {|q|
- q.text(3, 3)
- q.breakable(1, 1)
- q.text(3, 3)
- }
- end
-
- def test_6
- assert_equal([3, "newline", "0 spaces", 3], format(6))
- end
-
- def test_7
- assert_equal([3, 1, 3], format(7))
- end
-
-end
-
-class Fill < Test::Unit::TestCase # :nodoc:
- def format(width)
- PrettyPrint.format('', width) {|q|
- q.group {
- q.text 'abc'
- q.fill_breakable
- q.text 'def'
- q.fill_breakable
- q.text 'ghi'
- q.fill_breakable
- q.text 'jkl'
- q.fill_breakable
- q.text 'mno'
- q.fill_breakable
- q.text 'pqr'
- q.fill_breakable
- q.text 'stu'
- }
- }
- end
-
- def test_00_06
- expected = <<'End'.chomp
-abc
-def
-ghi
-jkl
-mno
-pqr
-stu
-End
- assert_equal(expected, format(0))
- assert_equal(expected, format(6))
- end
-
- def test_07_10
- expected = <<'End'.chomp
-abc def
-ghi jkl
-mno pqr
-stu
-End
- assert_equal(expected, format(7))
- assert_equal(expected, format(10))
- end
-
- def test_11_14
- expected = <<'End'.chomp
-abc def ghi
-jkl mno pqr
-stu
-End
- assert_equal(expected, format(11))
- assert_equal(expected, format(14))
- end
-
- def test_15_18
- expected = <<'End'.chomp
-abc def ghi jkl
-mno pqr stu
-End
- assert_equal(expected, format(15))
- assert_equal(expected, format(18))
- end
-
- def test_19_22
- expected = <<'End'.chomp
-abc def ghi jkl mno
-pqr stu
-End
- assert_equal(expected, format(19))
- assert_equal(expected, format(22))
- end
-
- def test_23_26
- expected = <<'End'.chomp
-abc def ghi jkl mno pqr
-stu
-End
- assert_equal(expected, format(23))
- assert_equal(expected, format(26))
- end
-
- def test_27
- expected = <<'End'.chomp
-abc def ghi jkl mno pqr stu
-End
- assert_equal(expected, format(27))
- end
-
-end
diff --git a/test/test_prime.rb b/test/test_prime.rb
deleted file mode 100644
index 307d53afb3..0000000000
--- a/test/test_prime.rb
+++ /dev/null
@@ -1,146 +0,0 @@
-require 'test/unit'
-require 'prime'
-require 'stringio'
-
-class TestPrime < Test::Unit::TestCase
- # The first 100 prime numbers
- PRIMES = [
- 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37,
- 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83,
- 89, 97, 101, 103, 107, 109, 113, 127, 131,
- 137, 139, 149, 151, 157, 163, 167, 173, 179,
- 181, 191, 193, 197, 199, 211, 223, 227, 229,
- 233, 239, 241, 251, 257, 263, 269, 271, 277,
- 281, 283, 293, 307, 311, 313, 317, 331, 337,
- 347, 349, 353, 359, 367, 373, 379, 383, 389,
- 397, 401, 409, 419, 421, 431, 433, 439, 443,
- 449, 457, 461, 463, 467, 479, 487, 491, 499,
- 503, 509, 521, 523, 541,
- ]
- def test_each
- primes = []
- Prime.each do |p|
- break if p > 541
- primes << p
- end
- assert_equal PRIMES, primes
- end
-
- def test_each_by_prime_number_theorem
- 3.upto(15) do |i|
- max = 2**i
- primes = []
- Prime.each do |p|
- break if p >= max
- primes << p
- end
-
- # Prime number theorem
- assert primes.length >= max/Math.log(max)
- delta = 0.05
- li = (2..max).step(delta).inject(0){|sum,x| sum + delta/Math.log(x)}
- assert primes.length <= li
- end
- end
-
- def test_each_without_block
- enum = Prime.each
- assert enum.respond_to?(:each)
- assert enum.kind_of?(Enumerable)
- assert enum.respond_to?(:with_index)
- assert enum.respond_to?(:next)
- assert enum.respond_to?(:succ)
- assert enum.respond_to?(:rewind)
- end
-
- def test_new
- buf = StringIO.new('', 'w')
- orig, $stderr = $stderr, buf
-
- enum = Prime.new
- assert !buf.string.empty?
- $stderr = orig
-
- assert enum.respond_to?(:each)
- assert enum.kind_of?(Enumerable)
- assert enum.respond_to?(:succ)
-
- assert Prime === enum
- ensure
- $stderr = orig
- end
-
- def test_enumerator_succ
- enum = Prime.each
- assert_equal PRIMES[0, 50], 50.times.map{ enum.succ }
- assert_equal PRIMES[50, 50], 50.times.map{ enum.succ }
- enum.rewind
- assert_equal PRIMES[0, 100], 100.times.map{ enum.succ }
- end
-
- def test_enumerator_with_index
- enum = Prime.each
- last = -1
- enum.with_index do |p,i|
- break if i >= 100
- assert_equal last+1, i
- assert_equal PRIMES[i], p
- last = i
- end
- end
-
- def test_default_instance_does_not_have_compatibility_methods
- assert !Prime.instance.respond_to?(:succ)
- assert !Prime.instance.respond_to?(:next)
- end
-
- class TestInteger < Test::Unit::TestCase
- def test_prime_division
- pd = PRIMES.inject(&:*).prime_division
- assert_equal PRIMES.map{|p| [p, 1]}, pd
-
- pd = (-PRIMES.inject(&:*)).prime_division
- assert_equal [-1, *PRIMES].map{|p| [p, 1]}, pd
- end
-
- def test_from_prime_division
- assert_equal PRIMES.inject(&:*), Integer.from_prime_division(PRIMES.map{|p| [p,1]})
-
- assert_equal -PRIMES.inject(&:*), Integer.from_prime_division([[-1, 1]] + PRIMES.map{|p| [p,1]})
- end
-
- def test_prime?
- # zero and unit
- assert !0.prime?
- assert !1.prime?
-
- # small primes
- assert 2.prime?
- assert 3.prime?
-
- # squared prime
- assert !4.prime?
- assert !9.prime?
-
- # mersenne numbers
- assert (2**31-1).prime?
- assert !(2**32-1).prime?
-
- # fermat numbers
- assert (2**(2**4)+1).prime?
- assert !(2**(2**5)+1).prime? # Euler!
-
- # large composite
- assert !((2**13-1) * (2**17-1)).prime?
-
- # factorial
- assert !(2...100).inject(&:*).prime?
-
- # negative
- assert !-1.prime?
- assert -2.prime?
- assert -3.prime?
- assert !-4.prime?
- end
- end
-end
diff --git a/test/test_pstore.rb b/test/test_pstore.rb
deleted file mode 100644
index e10ce906cb..0000000000
--- a/test/test_pstore.rb
+++ /dev/null
@@ -1,74 +0,0 @@
-require 'test/unit'
-require 'pstore'
-
-class PStoreTest < Test::Unit::TestCase
- def setup
- @pstore_file = "pstore.tmp.#{Process.pid}"
- @pstore = PStore.new(@pstore_file)
- end
-
- def teardown
- File.unlink(@pstore_file) rescue nil
- end
-
- def test_opening_new_file_in_readonly_mode_should_result_in_empty_values
- @pstore.transaction(true) do
- assert_nil @pstore[:foo]
- assert_nil @pstore[:bar]
- end
- end
-
- def test_opening_new_file_in_readwrite_mode_should_result_in_empty_values
- @pstore.transaction do
- assert_nil @pstore[:foo]
- assert_nil @pstore[:bar]
- end
- end
-
- def test_data_should_be_loaded_correctly_when_in_readonly_mode
- @pstore.transaction do
- @pstore[:foo] = "bar"
- end
- @pstore.transaction(true) do
- assert_equal "bar", @pstore[:foo]
- end
- end
-
- def test_data_should_be_loaded_correctly_when_in_readwrite_mode
- @pstore.transaction do
- @pstore[:foo] = "bar"
- end
- @pstore.transaction do
- assert_equal "bar", @pstore[:foo]
- end
- end
-
- def test_changes_after_commit_are_discarded
- @pstore.transaction do
- @pstore[:foo] = "bar"
- @pstore.commit
- @pstore[:foo] = "baz"
- end
- @pstore.transaction(true) do
- assert_equal "bar", @pstore[:foo]
- end
- end
-
- def test_changes_are_not_written_on_abort
- @pstore.transaction do
- @pstore[:foo] = "bar"
- @pstore.abort
- end
- @pstore.transaction(true) do
- assert_nil @pstore[:foo]
- end
- end
-
- def test_writing_inside_readonly_transaction_raises_error
- assert_raise(PStore::Error) do
- @pstore.transaction(true) do
- @pstore[:foo] = "bar"
- end
- end
- end
-end
diff --git a/test/test_pty.rb b/test/test_pty.rb
deleted file mode 100644
index 76986764cd..0000000000
--- a/test/test_pty.rb
+++ /dev/null
@@ -1,109 +0,0 @@
-require 'test/unit'
-require_relative 'ruby/envutil'
-require 'shellwords'
-
-begin
- require 'pty'
-rescue LoadError
-end
-
-class TestPTY < Test::Unit::TestCase
- RUBY = EnvUtil.rubybin
-
- def test_spawn_without_block
- r, w, pid = PTY.spawn(RUBY, '-e', 'puts "a"')
- assert_equal("a\r\n", r.gets)
- ensure
- Process.wait pid if pid
- end
-
- def test_spawn_with_block
- PTY.spawn(RUBY, '-e', 'puts "b"') {|r,w,pid|
- assert_equal("b\r\n", r.gets)
- Process.wait(pid)
- }
- end
-
- def test_commandline
- commandline = Shellwords.join([RUBY, '-e', 'puts "foo"'])
- PTY.spawn(commandline) {|r,w,pid|
- assert_equal("foo\r\n", r.gets)
- Process.wait(pid)
- }
- end
-
- def test_argv0
- PTY.spawn([RUBY, "argv0"], '-e', 'puts "bar"') {|r,w,pid|
- assert_equal("bar\r\n", r.gets)
- Process.wait(pid)
- }
- end
-
- def test_open_without_block
- ret = PTY.open
- assert_kind_of(Array, ret)
- assert_equal(2, ret.length)
- assert_equal(IO, ret[0].class)
- assert_equal(File, ret[1].class)
- master, slave = ret
- assert(slave.tty?)
- assert(File.chardev?(slave.path))
- ensure
- if ret
- ret[0].close
- ret[1].close
- end
- end
-
- def test_open_with_block
- r = nil
- x = Object.new
- y = PTY.open {|ret|
- r = ret;
- assert_kind_of(Array, ret)
- assert_equal(2, ret.length)
- assert_equal(IO, ret[0].class)
- assert_equal(File, ret[1].class)
- master, slave = ret
- assert(slave.tty?)
- assert(File.chardev?(slave.path))
- x
- }
- assert(r[0].closed?)
- assert(r[1].closed?)
- assert_equal(y, x)
- end
-
- def test_close_in_block
- PTY.open {|master, slave|
- slave.close
- master.close
- assert(slave.closed?)
- assert(master.closed?)
- }
- assert_nothing_raised {
- PTY.open {|master, slave|
- slave.close
- master.close
- }
- }
- end
-
- def test_open
- PTY.open {|master, slave|
- slave.puts "foo"
- assert_equal("foo", master.gets.chomp)
- master.puts "bar"
- assert_equal("bar", slave.gets.chomp)
- }
- end
-
- def test_stat_slave
- PTY.open {|master, slave|
- s = File.stat(slave.path)
- assert_equal(Process.uid, s.uid)
- assert_equal(0600, s.mode & 0777)
- }
- end
-end if defined? PTY
-
diff --git a/test/test_set.rb b/test/test_set.rb
deleted file mode 100644
index 604ce93caa..0000000000
--- a/test/test_set.rb
+++ /dev/null
@@ -1,4 +0,0 @@
-require 'pathname'
-require Pathname.new(__FILE__).dirname.join('inlinetest.rb')
-target = __FILE__[/test_(.*\.rb)$/, 1]
-InlineTest.loadtest__END__part(target)
diff --git a/test/test_shellwords.rb b/test/test_shellwords.rb
deleted file mode 100644
index d48a8882c8..0000000000
--- a/test/test_shellwords.rb
+++ /dev/null
@@ -1,39 +0,0 @@
-require 'test/unit'
-require 'shellwords'
-
-class TestShellwords < Test::Unit::TestCase
-
- include Shellwords
-
- def setup
- @not_string = Class.new
- @cmd = "ruby my_prog.rb | less"
- end
-
-
- def test_string
- assert_instance_of(Array, shellwords(@cmd))
- assert_equal(4, shellwords(@cmd).length)
- end
-
- def test_unmatched_double_quote
- bad_cmd = 'one two "three'
- assert_raise ArgumentError do
- shellwords(bad_cmd)
- end
- end
-
- def test_unmatched_single_quote
- bad_cmd = "one two 'three"
- assert_raise ArgumentError do
- shellwords(bad_cmd)
- end
- end
-
- def test_unmatched_quotes
- bad_cmd = "one '"'"''""'""
- assert_raise ArgumentError do
- shellwords(bad_cmd)
- end
- end
-end
diff --git a/test/test_singleton.rb b/test/test_singleton.rb
deleted file mode 100644
index bd11095cf2..0000000000
--- a/test/test_singleton.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-require 'test/unit'
-require 'singleton'
-
-class TestSingleton < Test::Unit::TestCase
- class C
- include Singleton
- end
-
- def test_marshal
- o1 = C.instance
- m = Marshal.dump(o1)
- o2 = Marshal.load(m)
- assert_same(o1, o2)
- end
-end
diff --git a/test/test_syslog.rb b/test/test_syslog.rb
deleted file mode 100644
index 7b3efb85aa..0000000000
--- a/test/test_syslog.rb
+++ /dev/null
@@ -1,166 +0,0 @@
-#!/usr/bin/env ruby
-# $RoughId: test.rb,v 1.9 2002/02/25 08:20:14 knu Exp $
-# $Id$
-
-# Please only run this test on machines reasonable for testing.
-# If in doubt, ask your admin.
-
-require 'test/unit'
-
-# Prepend current directory to load path for testing.
-$:.unshift('.')
-
-require 'syslog'
-
-class TestSyslog < Test::Unit::TestCase
- def test_new
- assert_raises(NoMethodError) {
- Syslog.new
- }
- end
-
- def test_instance
- sl1 = Syslog.instance
- sl2 = Syslog.open
- sl3 = Syslog.instance
-
- assert_equal(Syslog, sl1)
- assert_equal(Syslog, sl2)
- assert_equal(Syslog, sl3)
- ensure
- Syslog.close if Syslog.opened?
- end
-
- def test_open
- # default parameters
- Syslog.open
-
- assert_equal($0, Syslog.ident)
- assert_equal(Syslog::LOG_PID | Syslog::LOG_CONS, Syslog.options)
- assert_equal(Syslog::LOG_USER, Syslog.facility)
-
- # open without close
- assert_raises(RuntimeError) {
- Syslog.open
- }
-
- Syslog.close
-
- # given parameters
- Syslog.open("foo", Syslog::LOG_NDELAY | Syslog::LOG_PERROR, Syslog::LOG_DAEMON)
-
- assert_equal('foo', Syslog.ident)
- assert_equal(Syslog::LOG_NDELAY | Syslog::LOG_PERROR, Syslog.options)
- assert_equal(Syslog::LOG_DAEMON, Syslog.facility)
-
- Syslog.close
-
- # default parameters again (after close)
- Syslog.open
- Syslog.close
-
- assert_equal(nil, Syslog.ident)
- assert_equal(nil, Syslog.options)
- assert_equal(nil, Syslog.facility)
-
- # block
- param = nil
- Syslog.open { |syslog|
- param = syslog
- }
- assert_equal(Syslog, param)
- ensure
- Syslog.close if Syslog.opened?
- end
-
- def test_opened?
- assert_equal(false, Syslog.opened?)
-
- Syslog.open
- assert_equal(true, Syslog.opened?)
-
- Syslog.close
- assert_equal(false, Syslog.opened?)
-
- Syslog.open {
- assert_equal(true, Syslog.opened?)
- }
-
- assert_equal(false, Syslog.opened?)
- end
-
- def test_close
- assert_raises(RuntimeError) {
- Syslog.close
- }
- end
-
- def test_mask
- assert_equal(nil, Syslog.mask)
-
- Syslog.open
-
- orig = Syslog.mask
-
- Syslog.mask = Syslog.LOG_UPTO(Syslog::LOG_ERR)
- assert_equal(Syslog.LOG_UPTO(Syslog::LOG_ERR), Syslog.mask)
-
- Syslog.mask = Syslog.LOG_MASK(Syslog::LOG_CRIT)
- assert_equal(Syslog.LOG_MASK(Syslog::LOG_CRIT), Syslog.mask)
-
- Syslog.mask = orig
- ensure
- Syslog.close if Syslog.opened?
- end
-
- def test_log
- stderr = IO::pipe
-
- pid = fork {
- stderr[0].close
- STDERR.reopen(stderr[1])
- stderr[1].close
-
- options = Syslog::LOG_PERROR | Syslog::LOG_NDELAY
-
- Syslog.open("syslog_test", options) { |sl|
- sl.log(Syslog::LOG_NOTICE, "test1 - hello, %s!", "world")
- sl.notice("test1 - hello, %s!", "world")
- }
-
- Syslog.open("syslog_test", options | Syslog::LOG_PID) { |sl|
- sl.log(Syslog::LOG_CRIT, "test2 - pid")
- sl.crit("test2 - pid")
- }
- exit!
- }
-
- stderr[1].close
- Process.waitpid(pid)
-
- # LOG_PERROR is not yet implemented on Cygwin.
- return if RUBY_PLATFORM =~ /cygwin/
-
- 2.times {
- assert_equal("syslog_test: test1 - hello, world!\n", stderr[0].gets)
- }
-
- 2.times {
- assert_equal(format("syslog_test[%d]: test2 - pid\n", pid), stderr[0].gets)
- }
- end
-
- def test_inspect
- Syslog.open { |sl|
- assert_equal(format('<#%s: opened=true, ident="%s", options=%d, facility=%d, mask=%d>',
- Syslog,
- sl.ident,
- sl.options,
- sl.facility,
- sl.mask),
- sl.inspect)
- }
-
- assert_equal(format('<#%s: opened=false>', Syslog), Syslog.inspect)
- end
-end
diff --git a/test/test_tempfile.rb b/test/test_tempfile.rb
deleted file mode 100644
index e7e6413f9b..0000000000
--- a/test/test_tempfile.rb
+++ /dev/null
@@ -1,35 +0,0 @@
-require 'test/unit'
-require 'tempfile'
-
-class TestTempfile < Test::Unit::TestCase
- module M
- end
-
- def test_extend
- o = Tempfile.new("foo")
- o.extend M
- assert(M === o, "[ruby-dev:32932]")
- end
- def test_tempfile_encoding_nooption
- default_external=Encoding.default_external
- t=Tempfile.new("TEST")
- t.write("\xE6\x9D\xBE\xE6\xB1\x9F")
- t.rewind
- assert_equal(default_external,t.read.encoding)
- end
- def test_tempfile_encoding_ascii8bit
- default_external=Encoding.default_external
- t=Tempfile.new("TEST",:encoding=>"ascii-8bit")
- t.write("\xE6\x9D\xBE\xE6\xB1\x9F")
- t.rewind
- assert_equal(Encoding::ASCII_8BIT,t.read.encoding)
- end
- def test_tempfile_encoding_ascii8bit2
- default_external=Encoding.default_external
- t=Tempfile.new("TEST",Dir::tmpdir,:encoding=>"ascii-8bit")
- t.write("\xE6\x9D\xBE\xE6\xB1\x9F")
- t.rewind
- assert_equal(Encoding::ASCII_8BIT,t.read.encoding)
- end
-end
-
diff --git a/test/test_time.rb b/test/test_time.rb
deleted file mode 100644
index 2a22c6069f..0000000000
--- a/test/test_time.rb
+++ /dev/null
@@ -1,389 +0,0 @@
-require 'time'
-require 'test/unit'
-
-class TestTimeExtension < Test::Unit::TestCase # :nodoc:
- def test_rfc822
- assert_equal(Time.utc(1976, 8, 26, 14, 30) + 4 * 3600,
- Time.rfc2822("26 Aug 76 14:30 EDT"))
- assert_equal(Time.utc(1976, 8, 27, 9, 32) + 7 * 3600,
- Time.rfc2822("27 Aug 76 09:32 PDT"))
- end
-
- def test_rfc2822
- assert_equal(Time.utc(1997, 11, 21, 9, 55, 6) + 6 * 3600,
- Time.rfc2822("Fri, 21 Nov 1997 09:55:06 -0600"))
- assert_equal(Time.utc(2003, 7, 1, 10, 52, 37) - 2 * 3600,
- Time.rfc2822("Tue, 1 Jul 2003 10:52:37 +0200"))
- assert_equal(Time.utc(1997, 11, 21, 10, 1, 10) + 6 * 3600,
- Time.rfc2822("Fri, 21 Nov 1997 10:01:10 -0600"))
- assert_equal(Time.utc(1997, 11, 21, 11, 0, 0) + 6 * 3600,
- Time.rfc2822("Fri, 21 Nov 1997 11:00:00 -0600"))
- assert_equal(Time.utc(1997, 11, 24, 14, 22, 1) + 8 * 3600,
- Time.rfc2822("Mon, 24 Nov 1997 14:22:01 -0800"))
- begin
- Time.at(-1)
- rescue ArgumentError
- # ignore
- else
- assert_equal(Time.utc(1969, 2, 13, 23, 32, 54) + 3 * 3600 + 30 * 60,
- Time.rfc2822("Thu, 13 Feb 1969 23:32:54 -0330"))
- assert_equal(Time.utc(1969, 2, 13, 23, 32, 0) + 3 * 3600 + 30 * 60,
- Time.rfc2822(" Thu,
- 13
- Feb
- 1969
- 23:32
- -0330 (Newfoundland Time)"))
- end
- assert_equal(Time.utc(1997, 11, 21, 9, 55, 6),
- Time.rfc2822("21 Nov 97 09:55:06 GMT"))
- assert_equal(Time.utc(1997, 11, 21, 9, 55, 6) + 6 * 3600,
- Time.rfc2822("Fri, 21 Nov 1997 09 : 55 : 06 -0600"))
- assert_raise(ArgumentError) {
- # inner comment is not supported.
- Time.rfc2822("Fri, 21 Nov 1997 09(comment): 55 : 06 -0600")
- }
- end
-
- def test_encode_rfc2822
- t = Time.utc(1)
- assert_equal("Mon, 01 Jan 0001 00:00:00 -0000", t.rfc2822)
- end
-
- def test_rfc2616
- t = Time.utc(1994, 11, 6, 8, 49, 37)
- assert_equal(t, Time.httpdate("Sun, 06 Nov 1994 08:49:37 GMT"))
- assert_equal(t, Time.httpdate("Sunday, 06-Nov-94 08:49:37 GMT"))
- assert_equal(t, Time.httpdate("Sun Nov 6 08:49:37 1994"))
- assert_equal(Time.utc(1995, 11, 15, 6, 25, 24),
- Time.httpdate("Wed, 15 Nov 1995 06:25:24 GMT"))
- assert_equal(Time.utc(1995, 11, 15, 4, 58, 8),
- Time.httpdate("Wed, 15 Nov 1995 04:58:08 GMT"))
- assert_equal(Time.utc(1994, 11, 15, 8, 12, 31),
- Time.httpdate("Tue, 15 Nov 1994 08:12:31 GMT"))
- assert_equal(Time.utc(1994, 12, 1, 16, 0, 0),
- Time.httpdate("Thu, 01 Dec 1994 16:00:00 GMT"))
- assert_equal(Time.utc(1994, 10, 29, 19, 43, 31),
- Time.httpdate("Sat, 29 Oct 1994 19:43:31 GMT"))
- assert_equal(Time.utc(1994, 11, 15, 12, 45, 26),
- Time.httpdate("Tue, 15 Nov 1994 12:45:26 GMT"))
- assert_equal(Time.utc(1999, 12, 31, 23, 59, 59),
- Time.httpdate("Fri, 31 Dec 1999 23:59:59 GMT"))
-
- assert_equal(Time.utc(2007, 12, 23, 11, 22, 33),
- Time.httpdate('Sunday, 23-Dec-07 11:22:33 GMT'))
- end
-
- def test_encode_httpdate
- t = Time.utc(1)
- assert_equal("Mon, 01 Jan 0001 00:00:00 GMT", t.httpdate)
- end
-
- def test_rfc3339
- t = Time.utc(1985, 4, 12, 23, 20, 50, 520000)
- s = "1985-04-12T23:20:50.52Z"
- assert_equal(t, Time.iso8601(s))
- assert_equal(s, t.iso8601(2))
-
- t = Time.utc(1996, 12, 20, 0, 39, 57)
- s = "1996-12-19T16:39:57-08:00"
- assert_equal(t, Time.iso8601(s))
- # There is no way to generate time string with arbitrary timezone.
- s = "1996-12-20T00:39:57Z"
- assert_equal(t, Time.iso8601(s))
- assert_equal(s, t.iso8601)
-
- t = Time.utc(1990, 12, 31, 23, 59, 60)
- s = "1990-12-31T23:59:60Z"
- assert_equal(t, Time.iso8601(s))
- # leap second is representable only if timezone file has it.
- s = "1990-12-31T15:59:60-08:00"
- assert_equal(t, Time.iso8601(s))
-
- begin
- Time.at(-1)
- rescue ArgumentError
- # ignore
- else
- t = Time.utc(1937, 1, 1, 11, 40, 27, 870000)
- s = "1937-01-01T12:00:27.87+00:20"
- assert_equal(t, Time.iso8601(s))
- end
- end
-
- # http://www.w3.org/TR/xmlschema-2/
- def test_xmlschema
- assert_equal(Time.utc(1999, 5, 31, 13, 20, 0) + 5 * 3600,
- Time.xmlschema("1999-05-31T13:20:00-05:00"))
- assert_equal(Time.local(2000, 1, 20, 12, 0, 0),
- Time.xmlschema("2000-01-20T12:00:00"))
- assert_equal(Time.utc(2000, 1, 20, 12, 0, 0),
- Time.xmlschema("2000-01-20T12:00:00Z"))
- assert_equal(Time.utc(2000, 1, 20, 12, 0, 0) - 12 * 3600,
- Time.xmlschema("2000-01-20T12:00:00+12:00"))
- assert_equal(Time.utc(2000, 1, 20, 12, 0, 0) + 13 * 3600,
- Time.xmlschema("2000-01-20T12:00:00-13:00"))
- assert_equal(Time.utc(2000, 3, 4, 23, 0, 0) - 3 * 3600,
- Time.xmlschema("2000-03-04T23:00:00+03:00"))
- assert_equal(Time.utc(2000, 3, 4, 20, 0, 0),
- Time.xmlschema("2000-03-04T20:00:00Z"))
- assert_equal(Time.local(2000, 1, 15, 0, 0, 0),
- Time.xmlschema("2000-01-15T00:00:00"))
- assert_equal(Time.local(2000, 2, 15, 0, 0, 0),
- Time.xmlschema("2000-02-15T00:00:00"))
- assert_equal(Time.local(2000, 1, 15, 12, 0, 0),
- Time.xmlschema("2000-01-15T12:00:00"))
- assert_equal(Time.utc(2000, 1, 16, 12, 0, 0),
- Time.xmlschema("2000-01-16T12:00:00Z"))
- assert_equal(Time.local(2000, 1, 1, 12, 0, 0),
- Time.xmlschema("2000-01-01T12:00:00"))
- assert_equal(Time.utc(1999, 12, 31, 23, 0, 0),
- Time.xmlschema("1999-12-31T23:00:00Z"))
- assert_equal(Time.local(2000, 1, 16, 12, 0, 0),
- Time.xmlschema("2000-01-16T12:00:00"))
- assert_equal(Time.local(2000, 1, 16, 0, 0, 0),
- Time.xmlschema("2000-01-16T00:00:00"))
- assert_equal(Time.utc(2000, 1, 12, 12, 13, 14),
- Time.xmlschema("2000-01-12T12:13:14Z"))
- assert_equal(Time.utc(2001, 4, 17, 19, 23, 17, 300000),
- Time.xmlschema("2001-04-17T19:23:17.3Z"))
- assert_raise(ArgumentError) { Time.xmlschema("2000-01-01T00:00:00.+00:00") }
- end
-
- def test_encode_xmlschema
- t = Time.utc(2001, 4, 17, 19, 23, 17, 300000)
- assert_equal("2001-04-17T19:23:17Z", t.xmlschema)
- assert_equal("2001-04-17T19:23:17.3Z", t.xmlschema(1))
- assert_equal("2001-04-17T19:23:17.300000Z", t.xmlschema(6))
- assert_equal("2001-04-17T19:23:17.3000000Z", t.xmlschema(7))
-
- t = Time.utc(2001, 4, 17, 19, 23, 17, 123456)
- assert_equal("2001-04-17T19:23:17.1234560Z", t.xmlschema(7))
- assert_equal("2001-04-17T19:23:17.123456Z", t.xmlschema(6))
- assert_equal("2001-04-17T19:23:17.12345Z", t.xmlschema(5))
- assert_equal("2001-04-17T19:23:17.1Z", t.xmlschema(1))
-
- t = Time.at(2.quo(3)).getlocal("+09:00")
- assert_equal("1970-01-01T09:00:00.666+09:00", t.xmlschema(3))
- assert_equal("1970-01-01T09:00:00.6666666666+09:00", t.xmlschema(10))
- assert_equal("1970-01-01T09:00:00.66666666666666666666+09:00", t.xmlschema(20))
-
- t = Time.at(123456789.quo(9999999999)).getlocal("+09:00")
- assert_equal("1970-01-01T09:00:00.012+09:00", t.xmlschema(3))
- assert_equal("1970-01-01T09:00:00.012345678+09:00", t.xmlschema(9))
- assert_equal("1970-01-01T09:00:00.0123456789+09:00", t.xmlschema(10))
- assert_equal("1970-01-01T09:00:00.0123456789012345678+09:00", t.xmlschema(19))
- assert_equal("1970-01-01T09:00:00.01234567890123456789+09:00", t.xmlschema(20))
-
- t = Time.utc(1)
- assert_equal("0001-01-01T00:00:00Z", t.xmlschema)
-
- begin
- Time.at(-1)
- rescue ArgumentError
- # ignore
- else
- t = Time.utc(1960, 12, 31, 23, 0, 0, 123456)
- assert_equal("1960-12-31T23:00:00.123456Z", t.xmlschema(6))
- end
-
- assert_equal(249, Time.xmlschema("2008-06-05T23:49:23.000249+09:00").usec)
- end
-
- def test_completion
- now = Time.local(2001,11,29,21,26,35)
- assert_equal(Time.local( 2001,11,29,21,12),
- Time.parse("2001/11/29 21:12", now))
- assert_equal(Time.local( 2001,11,29),
- Time.parse("2001/11/29", now))
- assert_equal(Time.local( 2001,11,29),
- Time.parse( "11/29", now))
- #assert_equal(Time.local(2001,11,1), Time.parse("Nov", now))
- assert_equal(Time.local( 2001,11,29,10,22),
- Time.parse( "10:22", now))
- assert_raise(ArgumentError) { Time.parse("foo", now) }
- end
-
- def test_invalid
- # They were actually used in some web sites.
- assert_raise(ArgumentError) { Time.httpdate("1 Dec 2001 10:23:57 GMT") }
- assert_raise(ArgumentError) { Time.httpdate("Sat, 1 Dec 2001 10:25:42 GMT") }
- assert_raise(ArgumentError) { Time.httpdate("Sat, 1-Dec-2001 10:53:55 GMT") }
- assert_raise(ArgumentError) { Time.httpdate("Saturday, 01-Dec-2001 10:15:34 GMT") }
- assert_raise(ArgumentError) { Time.httpdate("Saturday, 01-Dec-101 11:10:07 GMT") }
- assert_raise(ArgumentError) { Time.httpdate("Fri, 30 Nov 2001 21:30:00 JST") }
-
- # They were actually used in some mails.
- assert_raise(ArgumentError) { Time.rfc2822("01-5-20") }
- assert_raise(ArgumentError) { Time.rfc2822("7/21/00") }
- assert_raise(ArgumentError) { Time.rfc2822("2001-8-28") }
- assert_raise(ArgumentError) { Time.rfc2822("00-5-6 1:13:06") }
- assert_raise(ArgumentError) { Time.rfc2822("2001-9-27 9:36:49") }
- assert_raise(ArgumentError) { Time.rfc2822("2000-12-13 11:01:11") }
- assert_raise(ArgumentError) { Time.rfc2822("2001/10/17 04:29:55") }
- assert_raise(ArgumentError) { Time.rfc2822("9/4/2001 9:23:19 PM") }
- assert_raise(ArgumentError) { Time.rfc2822("01 Nov 2001 09:04:31") }
- assert_raise(ArgumentError) { Time.rfc2822("13 Feb 2001 16:4 GMT") }
- assert_raise(ArgumentError) { Time.rfc2822("01 Oct 00 5:41:19 PM") }
- assert_raise(ArgumentError) { Time.rfc2822("2 Jul 00 00:51:37 JST") }
- assert_raise(ArgumentError) { Time.rfc2822("01 11 2001 06:55:57 -0500") }
- assert_raise(ArgumentError) { Time.rfc2822("18 \343\366\356\341\370 2000") }
- assert_raise(ArgumentError) { Time.rfc2822("Fri, Oct 2001 18:53:32") }
- assert_raise(ArgumentError) { Time.rfc2822("Fri, 2 Nov 2001 03:47:54") }
- assert_raise(ArgumentError) { Time.rfc2822("Fri, 27 Jul 2001 11.14.14 +0200") }
- assert_raise(ArgumentError) { Time.rfc2822("Thu, 2 Nov 2000 04:13:53 -600") }
- assert_raise(ArgumentError) { Time.rfc2822("Wed, 5 Apr 2000 22:57:09 JST") }
- assert_raise(ArgumentError) { Time.rfc2822("Mon, 11 Sep 2000 19:47:33 00000") }
- assert_raise(ArgumentError) { Time.rfc2822("Fri, 28 Apr 2000 20:40:47 +-900") }
- assert_raise(ArgumentError) { Time.rfc2822("Fri, 19 Jan 2001 8:15:36 AM -0500") }
- assert_raise(ArgumentError) { Time.rfc2822("Thursday, Sep 27 2001 7:42:35 AM EST") }
- assert_raise(ArgumentError) { Time.rfc2822("3/11/2001 1:31:57 PM Pacific Daylight Time") }
- assert_raise(ArgumentError) { Time.rfc2822("Mi, 28 Mrz 2001 11:51:36") }
- assert_raise(ArgumentError) { Time.rfc2822("P, 30 sept 2001 23:03:14") }
- assert_raise(ArgumentError) { Time.rfc2822("fr, 11 aug 2000 18:39:22") }
- assert_raise(ArgumentError) { Time.rfc2822("Fr, 21 Sep 2001 17:44:03 -1000") }
- assert_raise(ArgumentError) { Time.rfc2822("Mo, 18 Jun 2001 19:21:40 -1000") }
- assert_raise(ArgumentError) { Time.rfc2822("l\366, 12 aug 2000 18:53:20") }
- assert_raise(ArgumentError) { Time.rfc2822("l\366, 26 maj 2001 00:15:58") }
- assert_raise(ArgumentError) { Time.rfc2822("Dom, 30 Sep 2001 17:36:30") }
- assert_raise(ArgumentError) { Time.rfc2822("%&, 31 %2/ 2000 15:44:47 -0500") }
- assert_raise(ArgumentError) { Time.rfc2822("dom, 26 ago 2001 03:57:07 -0300") }
- assert_raise(ArgumentError) { Time.rfc2822("ter, 04 set 2001 16:27:58 -0300") }
- assert_raise(ArgumentError) { Time.rfc2822("Wen, 3 oct 2001 23:17:49 -0400") }
- assert_raise(ArgumentError) { Time.rfc2822("Wen, 3 oct 2001 23:17:49 -0400") }
- assert_raise(ArgumentError) { Time.rfc2822("ele, 11 h: 2000 12:42:15 -0500") }
- assert_raise(ArgumentError) { Time.rfc2822("Tue, 14 Aug 2001 3:55:3 +0200") }
- assert_raise(ArgumentError) { Time.rfc2822("Fri, 25 Aug 2000 9:3:48 +0800") }
- assert_raise(ArgumentError) { Time.rfc2822("Fri, 1 Dec 2000 0:57:50 EST") }
- assert_raise(ArgumentError) { Time.rfc2822("Mon, 7 May 2001 9:39:51 +0200") }
- assert_raise(ArgumentError) { Time.rfc2822("Wed, 1 Aug 2001 16:9:15 +0200") }
- assert_raise(ArgumentError) { Time.rfc2822("Wed, 23 Aug 2000 9:17:36 +0800") }
- assert_raise(ArgumentError) { Time.rfc2822("Fri, 11 Aug 2000 10:4:42 +0800") }
- assert_raise(ArgumentError) { Time.rfc2822("Sat, 15 Sep 2001 13:22:2 +0300") }
- assert_raise(ArgumentError) { Time.rfc2822("Wed,16 \276\305\324\302 2001 20:06:25 +0800") }
- assert_raise(ArgumentError) { Time.rfc2822("Wed,7 \312\256\322\273\324\302 2001 23:47:22 +0800") }
- assert_raise(ArgumentError) { Time.rfc2822("=?iso-8859-1?Q?(=C5=DA),?= 10 2 2001 23:32:26 +0900 (JST)") }
- assert_raise(ArgumentError) { Time.rfc2822("\307\341\314\343\332\311, 30 \344\346\335\343\310\321 2001 10:01:06") }
- assert_raise(ArgumentError) { Time.rfc2822("=?iso-8859-1?Q?(=BF=E5),?= 12 =?iso-8859-1?Q?9=B7=EE?= 2001 14:52:41\n+0900 (JST)") }
- end
-
- def test_zone_0000
- assert_equal(true, Time.parse("2000-01-01T00:00:00Z").utc?)
- assert_equal(true, Time.parse("2000-01-01T00:00:00-00:00").utc?)
- assert_equal(false, Time.parse("2000-01-01T00:00:00+00:00").utc?)
- assert_equal(false, Time.parse("Sat, 01 Jan 2000 00:00:00 GMT").utc?)
- assert_equal(true, Time.parse("Sat, 01 Jan 2000 00:00:00 -0000").utc?)
- assert_equal(false, Time.parse("Sat, 01 Jan 2000 00:00:00 +0000").utc?)
- assert_equal(false, Time.rfc2822("Sat, 01 Jan 2000 00:00:00 GMT").utc?)
- assert_equal(true, Time.rfc2822("Sat, 01 Jan 2000 00:00:00 -0000").utc?)
- assert_equal(false, Time.rfc2822("Sat, 01 Jan 2000 00:00:00 +0000").utc?)
- assert_equal(true, Time.rfc2822("Sat, 01 Jan 2000 00:00:00 UTC").utc?)
- end
-
- def test_rfc2822_utc_roundtrip_winter
- t1 = Time.local(2008,12,1)
- t2 = Time.rfc2822(t1.rfc2822)
- assert_equal(t1.utc?, t2.utc?, "[ruby-dev:37126]")
- end
-
- def test_rfc2822_utc_roundtrip_summer
- t1 = Time.local(2008,8,1)
- t2 = Time.rfc2822(t1.rfc2822)
- assert_equal(t1.utc?, t2.utc?)
- end
-
- def test_parse_leap_second
- t = Time.utc(1998,12,31,23,59,59)
- assert_equal(t, Time.parse("Thu Dec 31 23:59:59 UTC 1998"))
- assert_equal(t, Time.parse("Fri Dec 31 23:59:59 -0000 1998"));t.localtime
- assert_equal(t, Time.parse("Fri Jan 1 08:59:59 +0900 1999"))
- assert_equal(t, Time.parse("Fri Jan 1 00:59:59 +0100 1999"))
- assert_equal(t, Time.parse("Fri Dec 31 23:59:59 +0000 1998"))
- assert_equal(t, Time.parse("Fri Dec 31 22:59:59 -0100 1998"));t.utc
- t += 1
- assert_equal(t, Time.parse("Thu Dec 31 23:59:60 UTC 1998"))
- assert_equal(t, Time.parse("Fri Dec 31 23:59:60 -0000 1998"));t.localtime
- assert_equal(t, Time.parse("Fri Jan 1 08:59:60 +0900 1999"))
- assert_equal(t, Time.parse("Fri Jan 1 00:59:60 +0100 1999"))
- assert_equal(t, Time.parse("Fri Dec 31 23:59:60 +0000 1998"))
- assert_equal(t, Time.parse("Fri Dec 31 22:59:60 -0100 1998"));t.utc
- t += 1 if t.sec == 60
- assert_equal(t, Time.parse("Thu Jan 1 00:00:00 UTC 1999"))
- assert_equal(t, Time.parse("Fri Jan 1 00:00:00 -0000 1999"));t.localtime
- assert_equal(t, Time.parse("Fri Jan 1 09:00:00 +0900 1999"))
- assert_equal(t, Time.parse("Fri Jan 1 01:00:00 +0100 1999"))
- assert_equal(t, Time.parse("Fri Jan 1 00:00:00 +0000 1999"))
- assert_equal(t, Time.parse("Fri Dec 31 23:00:00 -0100 1998"))
- end
-
- def test_rfc2822_leap_second
- t = Time.utc(1998,12,31,23,59,59)
- assert_equal(t, Time.rfc2822("Thu, 31 Dec 1998 23:59:59 UTC"))
- assert_equal(t, Time.rfc2822("Fri, 31 Dec 1998 23:59:59 -0000"));t.localtime
- assert_equal(t, Time.rfc2822("Fri, 1 Jan 1999 08:59:59 +0900"))
- assert_equal(t, Time.rfc2822("Fri, 1 Jan 1999 00:59:59 +0100"))
- assert_equal(t, Time.rfc2822("Fri, 31 Dec 1998 23:59:59 +0000"))
- assert_equal(t, Time.rfc2822("Fri, 31 Dec 1998 22:59:59 -0100"));t.utc
- t += 1
- assert_equal(t, Time.rfc2822("Thu, 31 Dec 1998 23:59:60 UTC"))
- assert_equal(t, Time.rfc2822("Fri, 31 Dec 1998 23:59:60 -0000"));t.localtime
- assert_equal(t, Time.rfc2822("Fri, 1 Jan 1999 08:59:60 +0900"))
- assert_equal(t, Time.rfc2822("Fri, 1 Jan 1999 00:59:60 +0100"))
- assert_equal(t, Time.rfc2822("Fri, 31 Dec 1998 23:59:60 +0000"))
- assert_equal(t, Time.rfc2822("Fri, 31 Dec 1998 22:59:60 -0100"));t.utc
- t += 1 if t.sec == 60
- assert_equal(t, Time.rfc2822("Thu, 1 Jan 1999 00:00:00 UTC"))
- assert_equal(t, Time.rfc2822("Fri, 1 Jan 1999 00:00:00 -0000"));t.localtime
- assert_equal(t, Time.rfc2822("Fri, 1 Jan 1999 09:00:00 +0900"))
- assert_equal(t, Time.rfc2822("Fri, 1 Jan 1999 01:00:00 +0100"))
- assert_equal(t, Time.rfc2822("Fri, 1 Jan 1999 00:00:00 +0000"))
- assert_equal(t, Time.rfc2822("Fri, 31 Dec 1998 23:00:00 -0100"))
- end
-
- def test_xmlschema_leap_second
- t = Time.utc(1998,12,31,23,59,59)
- assert_equal(t, Time.xmlschema("1998-12-31T23:59:59Z"))
- assert_equal(t, Time.xmlschema("1998-12-31T23:59:59-00:00"));t.localtime
- assert_equal(t, Time.xmlschema("1999-01-01T08:59:59+09:00"))
- assert_equal(t, Time.xmlschema("1999-01-01T00:59:59+01:00"))
- assert_equal(t, Time.xmlschema("1998-12-31T23:59:59+00:00"))
- assert_equal(t, Time.xmlschema("1998-12-31T22:59:59-01:00"));t.utc
- t += 1
- assert_equal(t, Time.xmlschema("1998-12-31T23:59:60Z"))
- assert_equal(t, Time.xmlschema("1998-12-31T23:59:60-00:00"));t.localtime
- assert_equal(t, Time.xmlschema("1999-01-01T08:59:60+09:00"))
- assert_equal(t, Time.xmlschema("1999-01-01T00:59:60+01:00"))
- assert_equal(t, Time.xmlschema("1998-12-31T23:59:60+00:00"))
- assert_equal(t, Time.xmlschema("1998-12-31T22:59:60-01:00"));t.utc
- t += 1 if t.sec == 60
- assert_equal(t, Time.xmlschema("1999-01-01T00:00:00Z"))
- assert_equal(t, Time.xmlschema("1999-01-01T00:00:00-00:00"));t.localtime
- assert_equal(t, Time.xmlschema("1999-01-01T09:00:00+09:00"))
- assert_equal(t, Time.xmlschema("1999-01-01T01:00:00+01:00"))
- assert_equal(t, Time.xmlschema("1999-01-01T00:00:00+00:00"))
- assert_equal(t, Time.xmlschema("1998-12-31T23:00:00-01:00"))
- end
-
- def test_xmlschema_fraction
- assert_equal(500000, Time.xmlschema("2000-01-01T00:00:00.5+00:00").tv_usec)
- end
-
- def test_ruby_talk_152866
- t = Time::xmlschema('2005-08-30T22:48:00-07:00')
- assert_equal(31, t.day)
- assert_equal(8, t.mon)
- end
-
- def test_parse_fraction
- assert_equal(500000, Time.parse("2000-01-01T00:00:00.5+00:00").tv_usec)
- end
-
- def test_strptime
- assert_equal(Time.utc(2005, 8, 28, 06, 54, 20), Time.strptime("28/Aug/2005:06:54:20 +0000", "%d/%b/%Y:%T %z"))
- end
-
- def test_nsec
- assert_equal(123456789, Time.xmlschema("2000-01-01T00:00:00.123456789+00:00").tv_nsec)
- assert_equal(123456789, Time.parse("2000-01-01T00:00:00.123456789+00:00").tv_nsec)
- end
-end
diff --git a/test/test_timeout.rb b/test/test_timeout.rb
deleted file mode 100644
index 9ec9c02a93..0000000000
--- a/test/test_timeout.rb
+++ /dev/null
@@ -1,26 +0,0 @@
-require 'test/unit'
-require 'timeout'
-require 'thread'
-
-class TestTimeout < Test::Unit::TestCase
- def test_queue
- q = Queue.new
- assert_raise(Timeout::Error, "[ruby-dev:32935]") {
- timeout(0.1) { q.pop }
- }
- end
-
- def test_timeout
- @flag = true
- Thread.start {
- sleep 0.1
- @flag = false
- }
- assert_nothing_raised("[ruby-dev:38319]") do
- Timeout.timeout(1) {
- nil while @flag
- }
- end
- assert !@flag, "[ruby-dev:38319]"
- end
-end
diff --git a/test/test_tsort.rb b/test/test_tsort.rb
deleted file mode 100644
index 38018c49c0..0000000000
--- a/test/test_tsort.rb
+++ /dev/null
@@ -1,44 +0,0 @@
-require 'tsort'
-require 'test/unit'
-
-class TSortHash < Hash # :nodoc:
- include TSort
- alias tsort_each_node each_key
- def tsort_each_child(node, &block)
- fetch(node).each(&block)
- end
-end
-
-class TSortArray < Array # :nodoc:
- include TSort
- alias tsort_each_node each_index
- def tsort_each_child(node, &block)
- fetch(node).each(&block)
- end
-end
-
-class TSortTest < Test::Unit::TestCase # :nodoc:
- def test_dag
- h = TSortHash[{1=>[2, 3], 2=>[3], 3=>[]}]
- assert_equal([3, 2, 1], h.tsort)
- assert_equal([[3], [2], [1]], h.strongly_connected_components)
- end
-
- def test_cycle
- h = TSortHash[{1=>[2], 2=>[3, 4], 3=>[2], 4=>[]}]
- assert_equal([[4], [2, 3], [1]],
- h.strongly_connected_components.map {|nodes| nodes.sort})
- assert_raise(TSort::Cyclic) { h.tsort }
- end
-
- def test_array
- a = TSortArray[[1], [0], [0], [2]]
- assert_equal([[0, 1], [2], [3]],
- a.strongly_connected_components.map {|nodes| nodes.sort})
-
- a = TSortArray[[], [0]]
- assert_equal([[0], [1]],
- a.strongly_connected_components.map {|nodes| nodes.sort})
- end
-end
-
diff --git a/test/testunit/collector/test_dir.rb b/test/testunit/collector/test_dir.rb
new file mode 100644
index 0000000000..2de802c5e3
--- /dev/null
+++ b/test/testunit/collector/test_dir.rb
@@ -0,0 +1,406 @@
+require 'test/unit'
+require 'test/unit/collector/dir'
+require 'pp'
+
+module Test
+ module Unit
+ module Collector
+ class TestDir < TestCase
+ class FileSystem
+ class Directory
+ def initialize(name, fs, parent=self, &block)
+ @name = name
+ @fs = fs
+ @parent = parent
+ @contents = {'.' => self, '..' => parent}
+ instance_eval(&block) if(block)
+ end
+
+ def file(name, contents)
+ @contents[name] = contents
+ end
+
+ def dir(name, &block)
+ @contents[name] = self.class.new(name, @fs, self, &block)
+ end
+
+ def entries
+ @contents.keys
+ end
+
+ def directory?(name)
+ return true if(name.nil? || name.empty?)
+ return false unless(@contents.include?(name))
+ @contents[name].kind_of?(self.class)
+ end
+
+ def file?(name)
+ return false unless(@contents.include?(name))
+ !directory?(name)
+ end
+
+ def exist?(name)
+ @contents.include?(name)
+ end
+
+ def [](name)
+ raise Errno::ENOENT, name unless(@contents.include?(name))
+ @contents[name]
+ end
+
+ def path_to(name=nil)
+ if(!name)
+ @parent.path_to(@name)
+ elsif(@parent == self)
+ @fs.join('/', name)
+ else
+ @fs.join(@parent.path_to(@name), name)
+ end
+ end
+ end
+
+ class ObjectSpace
+ def initialize
+ @objects = []
+ end
+
+ def each_object(klass, &block)
+ @objects.find_all{|o| o.kind_of?(klass)}.each(&block)
+ end
+
+ def <<(object)
+ @objects << object
+ end
+ end
+
+ attr_reader :object_space
+
+ def initialize(&block)
+ @root = Directory.new('/', self, &block)
+ @pwd = @root
+ @object_space = ObjectSpace.new
+ @required = []
+ end
+
+ def entries(dir)
+ e = find(dir)
+ require_directory(dir)
+ e.entries
+ end
+
+ def directory?(name)
+ return true if (base = basename(name)) == '/'
+ e = find(dirname(name))
+ return false unless(e)
+ e.directory?(base)
+ end
+
+ def find(path)
+ if(/\A\// =~ path)
+ thing = @root
+ else
+ thing = @pwd
+ end
+ path.scan(/[^\/]+/) do |e|
+ break thing = false unless(thing.kind_of?(Directory))
+ thing = thing[e]
+ end
+ thing
+ end
+
+ def dirname(name)
+ if (name = name.tr_s('/', '/')) == '/'
+ name
+ else
+ name[%r"\A.+(?=/[^/]+/?\z)|\A/"] || "."
+ end
+ end
+
+ def basename(name)
+ name[%r"(\A/|[^/]+)/*\z", 1]
+ end
+
+ def split(name)
+ [dirname(name), basename(name)]
+ end
+
+ def join(*parts)
+ parts.join('/').gsub(%r{/+}, '/')
+ end
+
+ def file?(name)
+ e = find(dirname(name))
+ return false unless(e)
+ e.file?(basename(name))
+ end
+
+ def pwd
+ @pwd.path_to
+ end
+
+ def chdir(to)
+ e = find(to)
+ require_directory(to)
+ @pwd = e
+ end
+
+ def expand_path(path, base = nil)
+ until /\A\// =~ path
+ base ||= pwd
+ path = join(base, path)
+ base = nil
+ end
+ path.gsub!(%r"(?:/\.)+(?=/)", '')
+ nil while path.sub!(%r"/(?!\.\./)[^/]+/\.\.(?=/)", '')
+ path.sub!(%r"\A(?:/\.\.)+(?=/)", '')
+ path.sub!(%r"(?:\A(/)|/)\.\.?\z", '\1')
+ path
+ end
+
+ def require_directory(path)
+ raise Errno::ENOTDIR, path unless(directory?(path))
+ end
+
+ def require(file)
+ return false if(@required.include?(file))
+ begin
+ e = find(file)
+ rescue Errno::ENOENT => e
+ if(/\.rb\Z/ =~ file)
+ raise LoadError, file
+ end
+ e = find(file + '.rb')
+ end
+ @required << file
+ @object_space << e
+ true
+ rescue Errno::ENOENT
+ raise LoadError, file
+ end
+ end
+
+ def test_dir
+ inner_dir = nil
+ dirs = FileSystem::Directory.new('/', nil) do
+ file 'a', nil
+ inner_dir = dir 'b'
+ end
+ assert_equal(inner_dir, dirs['b'])
+ end
+
+ def test_fs
+ fs = FileSystem.new do
+ file 'a', nil
+ dir 'b'
+ end
+ assert_equal(['.', '..', 'a', 'b'].sort, fs.entries('/').sort)
+ assert(fs.directory?('/'))
+ assert(!fs.directory?('/a'))
+ assert(!fs.directory?('/bogus'))
+ assert(fs.file?('/a'))
+ assert(!fs.file?('/'))
+ assert(!fs.file?('/bogus'))
+ assert(fs.directory?('/b'))
+ assert(fs.file?('a'))
+ assert(fs.directory?('b'))
+ end
+
+ def test_fs_sub
+ fs = FileSystem.new do
+ dir 'a' do
+ file 'b', nil
+ dir 'c' do
+ file 'd', nil
+ end
+ end
+ end
+ assert(fs.file?('/a/b'))
+ assert(!fs.file?('/a/b/c/d'))
+ assert(fs.file?('/a/c/d'))
+ end
+
+ def test_fs_pwd
+ fs = FileSystem.new do
+ file 'a', nil
+ dir 'b' do
+ file 'c', nil
+ dir 'd' do
+ file 'e', nil
+ end
+ end
+ end
+ assert_equal('/', fs.pwd)
+ assert_raises(Errno::ENOENT) do
+ fs.chdir('bogus')
+ end
+ assert_raises(Errno::ENOTDIR) do
+ fs.chdir('a')
+ end
+ fs.chdir('b')
+ assert_equal('/b', fs.pwd)
+ fs.chdir('d')
+ assert_equal('/b/d', fs.pwd)
+ fs.chdir('..')
+ assert_equal('/b', fs.pwd)
+ fs.chdir('..')
+ assert_equal('/', fs.pwd)
+ end
+
+ def test_fs_entries
+ fs = FileSystem.new do
+ file 'a', nil
+ dir 'b' do
+ file 'c', nil
+ file 'd', nil
+ end
+ file 'e', nil
+ dir 'f' do
+ file 'g', nil
+ dir 'h' do
+ file 'i', nil
+ end
+ end
+ end
+ assert_equal(['.', '..', 'a', 'b', 'e', 'f'], fs.entries('/').sort)
+ assert_equal(['.', '..', 'a', 'b', 'e', 'f'], fs.entries('.').sort)
+ assert_equal(['.', '..', 'a', 'b', 'e', 'f'], fs.entries('b/..').sort)
+ assert_equal(['.', '..', 'c', 'd'], fs.entries('b').sort)
+ assert_raises(Errno::ENOENT) do
+ fs.entries('z')
+ end
+ assert_raises(Errno::ENOTDIR) do
+ fs.entries('a')
+ end
+ fs.chdir('f')
+ assert_equal(['.', '..', 'i'], fs.entries('h').sort)
+ end
+
+ class TestClass1
+ end
+ class TestClass2
+ end
+ def test_fs_require
+ fs = FileSystem.new do
+ file 'test_class1.rb', TestClass1
+ dir 'dir' do
+ file 'test_class2.rb', TestClass2
+ end
+ end
+ c = []
+ fs.object_space.each_object(Class) do |o|
+ c << o
+ end
+ assert_equal([], c)
+
+ assert_raises(LoadError) do
+ fs.require('bogus')
+ end
+
+ assert(fs.require('test_class1.rb'))
+ assert(!fs.require('test_class1.rb'))
+ c = []
+ fs.object_space.each_object(Class) do |o|
+ c << o
+ end
+ assert_equal([TestClass1], c)
+
+ fs.require('dir/test_class2')
+ c = []
+ fs.object_space.each_object(Class) do |o|
+ c << o
+ end
+ assert_equal([TestClass1, TestClass2], c)
+
+ c = []
+ fs.object_space.each_object(Time) do |o|
+ c << o
+ end
+ assert_equal([], c)
+ end
+
+ def setup
+ @t1 = t1 = create_test(1)
+ @t2 = t2 = create_test(2)
+ @t3 = t3 = create_test(3)
+ @t4 = t4 = create_test(4)
+ @t5 = t5 = create_test(5)
+ @t6 = t6 = create_test(6)
+ fs = FileSystem.new do
+ file 'test_1.rb', t1
+ file 'test_2.rb', t2
+ dir 'd1' do
+ file 'test_3.rb', t3
+ end
+ file 't4.rb', t4
+ dir 'd2' do
+ file 'test_5', t5
+ file 'test_6.rb', Time
+ end
+ file 't6.rb', t6
+ end
+ fs.require('t6')
+ @c = Dir.new(fs, fs, fs.object_space, fs)
+ end
+
+ def create_test(name)
+ t = Class.new(TestCase)
+ t.class_eval <<-EOC
+ def self.name
+ "T\#{#{name}}"
+ end
+ def test_#{name}a
+ end
+ def test_#{name}b
+ end
+ EOC
+ t
+ end
+
+ def test_simple_collect
+ expected = TestSuite.new('d1')
+ expected << (@t3.suite)
+ assert_equal(expected, @c.collect('d1'))
+ end
+
+ def test_multilevel_collect
+ expected = TestSuite.new('.')
+ expected << @t1.suite << @t2.suite
+ expected << (TestSuite.new('d1') << @t3.suite)
+ assert_equal(expected, @c.collect)
+ end
+
+ def test_collect_file
+ expected = TestSuite.new('test_1.rb')
+ expected << @t1.suite
+ assert_equal(expected, @c.collect('test_1.rb'))
+
+ expected = TestSuite.new('t4.rb')
+ expected << @t4.suite
+ assert_equal(expected, @c.collect('t4.rb'))
+ end
+
+ def test_nil_pattern
+ expected = TestSuite.new('d2')
+ expected << @t5.suite
+ @c.pattern.clear
+ assert_equal(expected, @c.collect('d2'))
+ end
+
+ def test_filtering
+ expected = TestSuite.new('.')
+ expected << @t1.suite
+ @c.filter = proc{|t| t.method_name == 'test_1a' || t.method_name == 'test_1b'}
+ assert_equal(expected, @c.collect)
+ end
+
+ def test_collect_multi
+ expected = TestSuite.new('[d1, d2]')
+ expected << (TestSuite.new('d1') << @t3.suite)
+ expected << (TestSuite.new('d2') << @t5.suite)
+ @c.pattern.replace([/\btest_/])
+ assert_equal(expected, @c.collect('d1', 'd2'))
+ end
+ end
+ end
+ end
+end
diff --git a/test/testunit/collector/test_objectspace.rb b/test/testunit/collector/test_objectspace.rb
new file mode 100644
index 0000000000..a1532ff3e6
--- /dev/null
+++ b/test/testunit/collector/test_objectspace.rb
@@ -0,0 +1,98 @@
+# Author:: Nathaniel Talbott.
+# Copyright:: Copyright (c) 2000-2003 Nathaniel Talbott. All rights reserved.
+# License:: Ruby license.
+
+require 'test/unit'
+require 'test/unit/collector/objectspace'
+
+module Test
+ module Unit
+ module Collector
+ class TC_ObjectSpace < TestCase
+ def setup
+ @tc1 = Class.new(TestCase) do
+ def self.name
+ "tc_1"
+ end
+ def test_1
+ end
+ def test_2
+ end
+ end
+
+ @tc2 = Class.new(TestCase) do
+ def self.name
+ "tc_2"
+ end
+ def test_0
+ end
+ end
+
+ @no_tc = Class.new do
+ def test_4
+ end
+ end
+
+ @object_space = {Class => [@tc1, @tc2, @no_tc], String => ['']}
+ def @object_space.each_object(type)
+ self[type].each{|item| yield(item) }
+ end
+
+ @c = ObjectSpace.new(@object_space)
+ end
+
+ def full_suite(name=ObjectSpace::NAME)
+ expected = TestSuite.new(name)
+ expected << (TestSuite.new(@tc1.name) << @tc1.new('test_1') << @tc1.new('test_2'))
+ expected << (TestSuite.new(@tc2.name) << @tc2.new('test_0'))
+ end
+
+ def empty_suite
+ TestSuite.new(ObjectSpace::NAME)
+ end
+
+ def test_basic_collection
+ assert_equal(full_suite("name"), @c.collect("name"))
+
+ @c.filter = []
+ assert_equal(full_suite("name"), @c.collect("name"))
+ end
+
+ def test_filtered_collection
+ @c.filter = proc{false}
+ assert_equal(empty_suite, @c.collect)
+
+ @c.filter = proc{true}
+ assert_equal(full_suite, @c.collect)
+
+ @c.filter = proc{nil}
+ assert_equal(full_suite, @c.collect)
+
+ @c.filter = [proc{false}, proc{true}]
+ assert_equal(empty_suite, @c.collect)
+
+ @c.filter = [proc{true}, proc{false}]
+ assert_equal(full_suite, @c.collect)
+
+ @c.filter = [proc{nil}, proc{false}]
+ assert_equal(empty_suite, @c.collect)
+
+ @c.filter = [proc{nil}, proc{true}]
+ assert_equal(full_suite, @c.collect)
+
+ expected = TestSuite.new(ObjectSpace::NAME)
+ expected << (TestSuite.new(@tc1.name) << @tc1.new('test_1'))
+ expected << (TestSuite.new(@tc2.name) << @tc2.new('test_0'))
+ @c.filter = proc{|test| ['test_1', 'test_0'].include?(test.method_name)}
+ assert_equal(expected, @c.collect)
+
+ expected = TestSuite.new(ObjectSpace::NAME)
+ expected << (TestSuite.new(@tc1.name) << @tc1.new('test_1'))
+ expected << (TestSuite.new(@tc2.name) << @tc2.new('test_0'))
+ @c.filter = [proc{|t| t.method_name == 'test_1' ? true : nil}, proc{|t| t.method_name == 'test_0' ? true : nil}, proc{false}]
+ assert_equal(expected, @c.collect)
+ end
+ end
+ end
+ end
+end
diff --git a/test/testunit/runit/test_assert.rb b/test/testunit/runit/test_assert.rb
new file mode 100644
index 0000000000..a3e62b2b2d
--- /dev/null
+++ b/test/testunit/runit/test_assert.rb
@@ -0,0 +1,402 @@
+# Author:: Masaki Suketa.
+# Adapted by:: Nathaniel Talbott.
+# Copyright:: Copyright (c) Masaki Suketa. All rights reserved.
+# Copyright:: Copyright (c) 2002 Nathaniel Talbott. All rights reserved.
+# License:: Ruby license.
+
+require 'rubyunit'
+
+module RUNIT
+ class TargetAssert
+ include RUNIT::Assert
+ end
+
+ class TestAssert < RUNIT::TestCase
+ def setup
+ @assert = TargetAssert.new
+ @e = nil
+ end
+
+ def test_assert
+ sub_test_assert_pass(true)
+ sub_test_assert_pass(TRUE)
+ sub_test_assert_failure(false)
+ sub_test_assert_failure(FALSE)
+ sub_test_assert_failure(nil)
+ sub_test_assert_pass("")
+ sub_test_assert_pass("ok")
+ sub_test_assert_pass(0)
+ sub_test_assert_pass(1)
+ end
+
+ def test_assert_with_2_argument
+ assert_no_exception {
+ assert(true, "3")
+ }
+ assert_no_exception {
+ assert(true)
+ }
+ end
+
+ def test_assert_equal_float_0_1
+ assert_proc = Proc.new {
+ @assert.assert_equal_float(1.4, 1.35, 0.1)
+ }
+ sub_assert_pass(assert_proc)
+ end
+
+ def test_assert_equal_float_0_5
+ assert_proc = Proc.new {
+ @assert.assert_equal_float(1.4, 1.34, 0.5)
+ }
+ sub_assert_pass(assert_proc)
+ end
+
+ def test_assert_equal_float_0
+ assert_proc = Proc.new {
+ @assert.assert_equal_float(1.4, 1.4, 0)
+ }
+ sub_assert_pass(assert_proc)
+ end
+
+ def test_assert_equal_float_0_raise
+ assert_proc = Proc.new {
+ @assert.assert_equal_float(1.4, 1.34, 0)
+ }
+ sub_assert_raise_fail(assert_proc)
+ end
+
+ def test_assert_equal_float_0_01
+ assert_proc = Proc.new {
+ @assert.assert_equal_float(1.4, 1.35, 0.01)
+ }
+ sub_assert_raise_fail(assert_proc)
+ end
+
+ def test_assert_equal_float_0_001
+ assert_proc = Proc.new {
+ @assert.assert_equal_float(Math.sqrt(2), 1.414, 0.001)
+ }
+ sub_assert_pass(assert_proc)
+ end
+
+ def test_assert_equal_float_minus_1_0
+ assert_proc = Proc.new {
+ @assert.assert_equal_float(1.4, 1.35, -1.0)
+ }
+ sub_assert_raise_fail(assert_proc)
+ end
+
+ def test_assert_fail
+ except = nil
+ begin
+ @assert.assert_fail("failure")
+ rescue Exception
+ except = $!
+ end
+ assert_not_nil(except)
+ end
+
+ def sub_test_assert_pass(obj)
+ assert_proc = Proc.new {
+ @assert.assert(obj)
+ }
+ sub_assert_pass(assert_proc)
+ end
+
+ def sub_test_assert_failure(obj)
+ assert_proc = Proc.new {
+ @assert.assert(obj)
+ }
+ sub_assert_raise_fail(assert_proc)
+ end
+
+ def test_assert_equal
+ assert_proc = Proc.new {
+ @assert.assert_equal(2, 2)
+ }
+ sub_assert_pass(assert_proc)
+ assert_proc = Proc.new {
+ @assert.assert_equal(2, 3)
+ }
+ sub_assert_raise_fail(assert_proc)
+ end
+
+ def test_assert_nil
+ obj = nil
+ assert_proc = Proc.new {
+ @assert.assert_nil(obj)
+ }
+ sub_assert_pass(assert_proc)
+ obj = 'string'
+ sub_assert_raise_fail(assert_proc)
+ end
+
+ def test_assert_not_nil
+ obj = 'string'
+ assert_proc = Proc.new {
+ @assert.assert_not_nil(obj)
+ }
+ sub_assert_pass(assert_proc)
+
+ obj = nil
+ sub_assert_raise_fail(assert_proc)
+ end
+
+ def test_assert_operator
+ assert_proc = Proc.new {
+ @assert.assert_operator(2, :<, 3)
+ }
+ sub_assert_pass(assert_proc)
+ assert_proc = Proc.new {
+ @assert.assert_operator(2, :>, 3)
+ }
+ sub_assert_raise_fail(assert_proc)
+ end
+
+ def test_assert_respond_to
+ sub_test_assert_respond_to('string', 'sub', 'foo')
+ sub_test_assert_respond_to('string', :sub, :foo)
+ end
+
+ def sub_test_assert_respond_to(obj, msg, dummy_msg)
+ assert_proc = Proc.new {
+ @assert.assert_respond_to(msg, obj)
+ }
+ sub_assert_pass(assert_proc)
+ assert_proc = Proc.new {
+ @assert.assert_respond_to(dummy_msg, obj)
+ }
+ sub_assert_raise_fail(assert_proc)
+ end
+
+ def test_assert_send
+ assert_proc = Proc.new {
+ ary = []
+ @assert.assert_send ary, :empty?
+ }
+ sub_assert_pass(assert_proc)
+ assert_proc = Proc.new {
+ ary = [2,3]
+ @assert.assert_send ary, :empty?
+ }
+ sub_assert_raise_fail(assert_proc)
+ assert_proc = Proc.new {
+ str = "abc"
+ @assert.assert_send str, :sub!, "z", "y"
+ }
+ sub_assert_raise_fail(assert_proc)
+ end
+
+ def test_assert_kind_of
+ assert_proc = Proc.new {
+ @assert.assert_kind_of(String, "string")
+ }
+ sub_assert_pass(assert_proc)
+ assert_proc = Proc.new {
+ @assert.assert_kind_of(Regexp, "string")
+ }
+ sub_assert_raise_fail(assert_proc)
+ end
+
+ def test_assert_instance_of
+ assert_proc = Proc.new {
+ @assert.assert_instance_of(String, "string")
+ }
+ sub_assert_pass(assert_proc)
+ assert_proc = Proc.new {
+ @assert.assert_instance_of(Object, "string")
+ }
+ sub_assert_raise_fail(assert_proc)
+ end
+
+ def test_assert_match
+ assert_proc = Proc.new{
+ @assert.assert_match('foostring', /foo/)
+ }
+ sub_assert_pass(assert_proc)
+ assert_proc = Proc.new {
+ @assert.assert_match('barstring', /foo/)
+ }
+ sub_assert_raise_fail(assert_proc)
+ match = @assert.assert_match('foostring', /foo/)
+ assert_instance_of(MatchData, match)
+ assert_equal('foo', match[0])
+ end
+
+ def test_assert_matches
+ assert_proc = Proc.new{
+ @assert.assert_matches('foostring', /foo/)
+ }
+ sub_assert_pass(assert_proc)
+ assert_proc = Proc.new {
+ @assert.assert_matches('barstring', /foo/)
+ }
+ sub_assert_raise_fail(assert_proc)
+ end
+
+ def test_assert_not_match
+ assert_proc = Proc.new{
+ @assert.assert_not_match('barstring', /foo/)
+ }
+ sub_assert_pass(assert_proc)
+ assert_proc = Proc.new {
+ @assert.assert_not_match('foostring', /foo/)
+ }
+ sub_assert_raise_fail(assert_proc)
+ assert_proc = Proc.new {
+ @assert.assert_not_match('foobarbaz', /ba.+/)
+ }
+ sub_assert_raise_fail(assert_proc)
+ end
+
+ def test_assert_same
+ flag = false
+ e = "foo"
+ a = e
+ assert_proc = Proc.new {@assert.assert_same(e, a)}
+ sub_assert_pass(assert_proc)
+
+ a = "foo"
+ sub_assert_raise_fail(assert_proc)
+ end
+
+ def test_assert_exception
+ assert_proc = Proc.new{
+ @assert.assert_exception(IOError) {
+ raise IOError
+ }
+ }
+ sub_assert_pass(assert_proc)
+
+ assert_proc = Proc.new{
+ @assert.assert_exception(StandardError) {
+ raise IOError
+ }
+ }
+ sub_assert_raise_fail(assert_proc)
+
+ assert_proc = Proc.new{
+ @assert.assert_exception(IOError, "Exception") {
+ raise StandardError
+ }
+ }
+ sub_assert_raise_fail(assert_proc)
+
+ assert_proc = Proc.new {
+ @assert.assert_exception(StandardError) {
+ "No Exception raised in this block"
+ }
+ }
+ sub_assert_raise_fail(assert_proc)
+
+ assert_proc = Proc.new {
+ @assert.assert_exception(StandardError) {
+ exit(33)
+ }
+ }
+ sub_assert_raise_fail(assert_proc)
+
+ t = @assert.assert_exception(IOError) {
+ raise IOError
+ }
+ assert_instance_of(IOError, t)
+ t = @assert.assert_exception(NameError) {
+ non_existent_method
+ }
+ assert_instance_of(NameError, t)
+ t = @assert.assert_exception(SystemExit) {
+ exit(33)
+ }
+ assert_instance_of(SystemExit, t)
+ end
+
+ def test_assert_no_exception
+ assert_proc = Proc.new{
+ @assert.assert_no_exception(IOError, ArgumentError) {
+ "No Exception raised in this block"
+ }
+ }
+ sub_assert_pass(assert_proc)
+
+ assert_proc = Proc.new{
+ @assert.assert_no_exception(IOError, ArgumentError) {
+ raise StandardError, "Standard Error raised"
+ }
+ }
+ sub_assert_raise_error(assert_proc)
+
+ assert_proc = Proc.new{
+ @assert.assert_no_exception(IOError, ArgumentError) {
+ raise ArgumentError, "Bad Argument"
+ }
+ }
+ sub_assert_raise_fail(assert_proc)
+
+ assert_proc = Proc.new{
+ @assert.assert_no_exception {
+ raise ArgumentError, "Bad Argument"
+ }
+ }
+ sub_assert_raise_fail(assert_proc)
+
+ assert_proc = Proc.new{
+ @assert.assert_no_exception {
+ raise NameError, "Bad Name"
+ }
+ }
+ sub_assert_raise_fail(assert_proc)
+ assert_proc = Proc.new {
+ @assert.assert_no_exception {
+ raise NoMemoryError
+ }
+ }
+ sub_assert_raise_fail(assert_proc)
+ end
+
+ def sub_assert_pass(p)
+ flag = false
+ err = nil
+ begin
+ p.call
+ flag = true
+ rescue
+ err = $!
+ flag = false
+ end
+ assert(flag, err.to_s)
+ end
+
+ def sub_assert_raise_fail(p)
+ flag = false
+ err = nil
+ begin
+ p.call
+ flag = false
+ rescue RUNIT::AssertionFailedError
+ flag = true
+ err = $!
+ rescue Exception
+ flag = false
+ err = $!
+ end
+ assert(flag, err.to_s)
+ end
+
+ def sub_assert_raise_error(p)
+ flag = false
+ err = nil
+ begin
+ p.call
+ flag = false
+ rescue RUNIT::AssertionFailedError
+ flag = false
+ err = $!
+ rescue Exception
+ flag = true
+ err = $!
+ end
+ assert(flag, err.to_s)
+ end
+ end
+end
diff --git a/test/testunit/runit/test_testcase.rb b/test/testunit/runit/test_testcase.rb
new file mode 100644
index 0000000000..f57e0386e3
--- /dev/null
+++ b/test/testunit/runit/test_testcase.rb
@@ -0,0 +1,91 @@
+# Author:: Masaki Suketa.
+# Adapted by:: Nathaniel Talbott.
+# Copyright:: Copyright (c) Masaki Suketa. All rights reserved.
+# Copyright:: Copyright (c) 2002 Nathaniel Talbott. All rights reserved.
+# License:: Ruby license.
+
+require 'rubyunit'
+
+module RUNIT
+ class DummyError < StandardError
+ end
+
+ class TestTestCase < RUNIT::TestCase
+ def setup
+ @dummy_testcase = Class.new(RUNIT::TestCase) do
+ def self.name
+ "DummyTestCase"
+ end
+
+ attr_reader :status, :dummy_called, :dummy2_called
+
+ def initialize(*arg)
+ super(*arg)
+ @status = 0
+ @dummy_called = false
+ @dummy2_called = false
+ end
+
+ def setup
+ @status = 1 if @status == 0
+ end
+
+ def test_dummy
+ @status = 2 if @status == 1
+ @dummy_called = true
+ end
+
+ def test_dummy2
+ @status = 2 if @status == 1
+ @dummy2_called = true
+ raise DummyError
+ end
+
+ def teardown
+ @status = 3 if @status == 2
+ end
+ end
+
+ @test1 = @dummy_testcase.new('test_dummy')
+ @test2 = @dummy_testcase.new('test_dummy2', 'TestCase')
+ end
+
+ def test_name
+ assert_equal('DummyTestCase#test_dummy', @test1.name) # The second parameter to #initialize is ignored in emulation
+ assert_equal('DummyTestCase#test_dummy2', @test2.name)
+ end
+
+ def test_run
+ result = RUNIT::TestResult.new
+ @test1.run(result)
+ assert_equal(1, result.run_count)
+ end
+
+ def test_s_suite
+ suite = @dummy_testcase.suite
+ assert_instance_of(RUNIT::TestSuite, suite)
+ assert_equal(2, suite.count_test_cases)
+ end
+
+ def test_teardown_err
+ suite = Class.new(RUNIT::TestCase) do
+ def test_foo
+ assert(false)
+ end
+
+ def test_bar
+ assert(true)
+ end
+
+ def teardown
+ raise StandardError
+ end
+ end.suite
+
+ result = RUNIT::TestResult.new
+ suite.run(result)
+ assert_equal(2, result.error_size)
+ assert_equal(1, result.failure_size)
+ end
+ end
+end
diff --git a/test/testunit/runit/test_testresult.rb b/test/testunit/runit/test_testresult.rb
new file mode 100644
index 0000000000..702b88d0c0
--- /dev/null
+++ b/test/testunit/runit/test_testresult.rb
@@ -0,0 +1,144 @@
+# Author:: Masaki Suketa.
+# Adapted by:: Nathaniel Talbott.
+# Copyright:: Copyright (c) Masaki Suketa. All rights reserved.
+# Copyright:: Copyright (c) 2002 Nathaniel Talbott. All rights reserved.
+# License:: Ruby license.
+
+require 'rubyunit'
+
+module RUNIT
+ class TestTestResult < RUNIT::TestCase
+ def setup
+ @result = RUNIT::TestResult.new
+
+ @normal_suite = Class::new(RUNIT::TestCase) do
+ def test_1
+ assert(true)
+ assert(true)
+ end
+ end.suite
+
+ @failure_suite = Class::new(RUNIT::TestCase) do
+ def test_1
+ assert(true)
+ assert(false)
+ end
+ end.suite
+
+ @error_suite = Class::new(RUNIT::TestCase) do
+ def setup
+ raise ScriptError
+ end
+ def test_1
+ assert(true)
+ end
+ end.suite
+
+ @multi_failure_suite = Class::new(RUNIT::TestCase) do
+ def test1
+ assert(false)
+ end
+ def test2
+ assert(false)
+ end
+ def test3
+ assert(false)
+ end
+ end.suite
+
+ @with_error_suite = Class::new(RUNIT::TestCase) do
+ def test1
+ raise StandardError
+ end
+ end.suite
+
+ @multi_error_suite = Class::new(RUNIT::TestCase) do
+ def test1
+ raise StandardError
+ end
+ def test2
+ raise StandardError
+ end
+ def test3
+ raise StandardError
+ end
+ end.suite
+
+ @multi_suite = Class::new(RUNIT::TestCase) do
+ def test_1
+ assert(true)
+ assert(true)
+ end
+ def test_2
+ assert(true)
+ end
+ def test_3
+ assert(true)
+ assert(false)
+ assert(true)
+ end
+ end.suite
+ end
+
+ def test_error_size
+ @normal_suite.run(@result)
+ assert_equal(0, @result.error_size)
+ @with_error_suite.run(@result)
+ assert_equal(1, @result.error_size)
+ @multi_error_suite.run(@result)
+ assert_equal(4, @result.error_size)
+ end
+
+ def test_errors
+ @normal_suite.run(@result)
+ assert_equal(0, @result.errors.size)
+ end
+
+ def test_failure_size
+ @normal_suite.run(@result)
+ assert_equal(0, @result.failure_size)
+ @failure_suite.run(@result)
+ assert_equal(1, @result.failure_size)
+ @multi_failure_suite.run(@result)
+ assert_equal(4, @result.failure_size)
+ end
+
+ def test_failures
+ @normal_suite.run(@result)
+ assert_equal(0, @result.failures.size)
+ @failure_suite.run(@result)
+ assert_equal(1, @result.failures.size)
+ @multi_failure_suite.run(@result)
+ assert_equal(4, @result.failures.size)
+ end
+
+ def test_run_no_exception
+ assert_no_exception {
+ @error_suite.run(@result)
+ }
+ end
+
+ def test_run_asserts
+ @normal_suite.run(@result)
+ assert_equal(2, @result.run_asserts)
+ end
+
+ def test_run_asserts2
+ @failure_suite.run(@result)
+ assert_equal(2, @result.run_asserts)
+ end
+
+ def test_run_tests
+ assert_equal(0, @result.run_tests)
+ @normal_suite.run(@result)
+ assert_equal(1, @result.run_tests)
+ @multi_suite.run(@result)
+ assert_equal(4, @result.run_tests)
+ end
+
+ def test_succeed?
+ @normal_suite.run(@result)
+ assert(@result.succeed?)
+ end
+ end
+end
diff --git a/test/testunit/runit/test_testsuite.rb b/test/testunit/runit/test_testsuite.rb
new file mode 100644
index 0000000000..58702d3efe
--- /dev/null
+++ b/test/testunit/runit/test_testsuite.rb
@@ -0,0 +1,49 @@
+# Author:: Masaki Suketa.
+# Adapted by:: Nathaniel Talbott.
+# Copyright:: Copyright (c) Masaki Suketa. All rights reserved.
+# Copyright:: Copyright (c) 2002 Nathaniel Talbott. All rights reserved.
+# License:: Ruby license.
+
+require 'rubyunit'
+
+module RUNIT
+ class TestTestSuite < RUNIT::TestCase
+ def setup
+ @testsuite = RUNIT::TestSuite.new
+ @dummy_test = Class.new(RUNIT::TestCase) do
+ def test_foo
+ end
+ def test_bar
+ end
+ end
+ @dummy_empty_test = Class.new(RUNIT::TestCase){}
+ end
+
+ def test_count_test_cases
+ assert_equal(0, @testsuite.count_test_cases)
+
+ @testsuite.add(@dummy_empty_test.suite)
+ assert_equal(0, @testsuite.count_test_cases)
+
+ @testsuite.add(@dummy_test.suite)
+ assert_equal(2, @testsuite.count_test_cases)
+
+ @testsuite.add(@dummy_test.suite)
+ assert_equal(4, @testsuite.count_test_cases)
+
+ dummytest_foo = @dummy_test.new('test_foo')
+ @testsuite.add(dummytest_foo)
+ assert_equal(5, @testsuite.count_test_cases)
+ end
+
+ def test_add
+ @testsuite.add(@dummy_empty_test.suite)
+ assert_equal(0, @testsuite.size)
+ assert_equal(0, @testsuite.count_test_cases)
+
+ @testsuite.add(@dummy_test.suite)
+ assert_equal(2, @testsuite.size)
+ assert_equal(2, @testsuite.count_test_cases)
+ end
+ end
+end
diff --git a/test/testunit/test_assertions.rb b/test/testunit/test_assertions.rb
new file mode 100644
index 0000000000..8ccd2a81bd
--- /dev/null
+++ b/test/testunit/test_assertions.rb
@@ -0,0 +1,528 @@
+# Author:: Nathaniel Talbott.
+# Copyright:: Copyright (c) 2000-2002 Nathaniel Talbott. All rights reserved.
+# License:: Ruby license.
+
+require 'test/unit'
+
+module Test
+ module Unit
+ class TC_Assertions < TestCase
+ def check(value, message="")
+ add_assertion
+ if (!value)
+ raise AssertionFailedError.new(message)
+ end
+ end
+
+ def check_assertions(expect_fail, expected_message="", return_value_expected=false)
+ @actual_assertion_count = 0
+ failed = true
+ actual_message = nil
+ @catch_assertions = true
+ return_value = nil
+ begin
+ return_value = yield
+ failed = false
+ rescue AssertionFailedError => error
+ actual_message = error.message
+ end
+ @catch_assertions = false
+ check(expect_fail == failed, (expect_fail ? "Should have failed, but didn't" : "Should not have failed, but did with message\n<#{actual_message}>"))
+ check(1 == @actual_assertion_count, "Should have made one assertion but made <#{@actual_assertion_count}>")
+ if (expect_fail)
+ case expected_message
+ when String
+ check(actual_message == expected_message, "Should have the correct message.\n<#{expected_message.inspect}> expected but was\n<#{actual_message.inspect}>")
+ when Regexp
+ check(actual_message =~ expected_message, "The message should match correctly.\n</#{expected_message.source}/> expected to match\n<#{actual_message.inspect}>")
+ else
+ check(false, "Incorrect expected message type in assert_nothing_failed")
+ end
+ else
+ if (!return_value_expected)
+ check(return_value.nil?, "Should not return a value but returned <#{return_value}>")
+ else
+ check(!return_value.nil?, "Should return a value")
+ end
+ end
+ return return_value
+ end
+
+ def check_nothing_fails(return_value_expected=false, &proc)
+ check_assertions(false, "", return_value_expected, &proc)
+ end
+
+ def check_fails(expected_message="", &proc)
+ check_assertions(true, expected_message, &proc)
+ end
+
+ def test_assert_block
+ check_nothing_fails {
+ assert_block {true}
+ }
+ check_nothing_fails {
+ assert_block("successful assert_block") {true}
+ }
+ check_nothing_fails {
+ assert_block("successful assert_block") {true}
+ }
+ check_fails("assert_block failed.") {
+ assert_block {false}
+ }
+ check_fails("failed assert_block") {
+ assert_block("failed assert_block") {false}
+ }
+ end
+
+ def test_assert
+ check_nothing_fails{assert("a")}
+ check_nothing_fails{assert(true)}
+ check_nothing_fails{assert(true, "successful assert")}
+ check_fails("<nil> is not true."){assert(nil)}
+ check_fails("<false> is not true."){assert(false)}
+ check_fails("failed assert.\n<false> is not true."){assert(false, "failed assert")}
+ end
+
+ def test_assert_equal
+ check_nothing_fails {
+ assert_equal("string1", "string1")
+ }
+ check_nothing_fails {
+ assert_equal( "string1", "string1", "successful assert_equal")
+ }
+ check_nothing_fails {
+ assert_equal("string1", "string1", "successful assert_equal")
+ }
+ check_fails(%Q{<"string1"> expected but was\n<"string2">.}) {
+ assert_equal("string1", "string2")
+ }
+ check_fails(%Q{failed assert_equal.\n<"string1"> expected but was\n<"string2">.}) {
+ assert_equal("string1", "string2", "failed assert_equal")
+ }
+ check_fails(%Q{<"1"> expected but was\n<1>.}) do
+ assert_equal("1", 1)
+ end
+ end
+
+ def test_assert_raise
+ return_value = nil
+ check_nothing_fails(true) {
+ return_value = assert_raise(RuntimeError) {
+ raise "Error"
+ }
+ }
+ check(return_value.kind_of?(Exception), "Should have returned the exception from a successful assert_raise")
+ check(return_value.message == "Error", "Should have returned the correct exception from a successful assert_raise")
+ check_nothing_fails(true) {
+ assert_raise(ArgumentError, "successful assert_raise") {
+ raise ArgumentError.new("Error")
+ }
+ }
+ check_nothing_fails(true) {
+ assert_raise(RuntimeError) {
+ raise "Error"
+ }
+ }
+ check_nothing_fails(true) {
+ assert_raise(RuntimeError, "successful assert_raise") {
+ raise "Error"
+ }
+ }
+ check_fails("<RuntimeError> exception expected but none was thrown.") {
+ assert_raise(RuntimeError) {
+ 1 + 1
+ }
+ }
+ check_fails(%r{\Afailed assert_raise.\n<ArgumentError> exception expected but was\nClass: <RuntimeError>\nMessage: <"Error">\n---Backtrace---\n.+\n---------------\Z}m) {
+ assert_raise(ArgumentError, "failed assert_raise") {
+ raise "Error"
+ }
+ }
+ check_fails("Should expect a class of exception, Object.\n<false> is not true.") {
+ assert_nothing_raised(Object) {
+ 1 + 1
+ }
+ }
+
+ exceptions = [ArgumentError, TypeError]
+ modules = [Math, Comparable]
+ rescues = exceptions + modules
+ exceptions.each do |exc|
+ check_nothing_fails(true) {
+ return_value = assert_raise(*rescues) {
+ raise exc, "Error"
+ }
+ }
+ check(return_value.instance_of?(exc), "Should have returned #{exc} but was #{return_value.class}")
+ check(return_value.message == "Error", "Should have returned the correct exception from a successful assert_raise")
+ end
+ modules.each do |mod|
+ check_nothing_fails(true) {
+ return_value = assert_raise(*rescues) {
+ raise Exception.new("Error").extend(mod)
+ }
+ }
+ check(mod === return_value, "Should have returned #{mod}")
+ check(return_value.message == "Error", "Should have returned the correct exception from a successful assert_raise")
+ end
+ check_fails("<[ArgumentError, TypeError, Math, Comparable]> exception expected but none was thrown.") {
+ assert_raise(*rescues) {
+ 1 + 1
+ }
+ }
+ check_fails(%r{\Afailed assert_raise.
+<\[ArgumentError, TypeError\]> exception expected but was
+Class: <RuntimeError>
+Message: <"Error">
+---Backtrace---
+.+
+---------------\Z}m) {
+ assert_raise(ArgumentError, TypeError, "failed assert_raise") {
+ raise "Error"
+ }
+ }
+ end
+
+ def test_assert_instance_of
+ check_nothing_fails {
+ assert_instance_of(String, "string")
+ }
+ check_nothing_fails {
+ assert_instance_of(String, "string", "successful assert_instance_of")
+ }
+ check_nothing_fails {
+ assert_instance_of(String, "string", "successful assert_instance_of")
+ }
+ check_fails(%Q{<"string"> expected to be an instance of\n<Hash> but was\n<String>.}) {
+ assert_instance_of(Hash, "string")
+ }
+ check_fails(%Q{failed assert_instance_of.\n<"string"> expected to be an instance of\n<Hash> but was\n<String>.}) {
+ assert_instance_of(Hash, "string", "failed assert_instance_of")
+ }
+ end
+
+ def test_assert_nil
+ check_nothing_fails {
+ assert_nil(nil)
+ }
+ check_nothing_fails {
+ assert_nil(nil, "successful assert_nil")
+ }
+ check_nothing_fails {
+ assert_nil(nil, "successful assert_nil")
+ }
+ check_fails(%Q{<nil> expected but was\n<"string">.}) {
+ assert_nil("string")
+ }
+ check_fails(%Q{failed assert_nil.\n<nil> expected but was\n<"string">.}) {
+ assert_nil("string", "failed assert_nil")
+ }
+ end
+
+ def test_assert_not_nil
+ check_nothing_fails{assert_not_nil(false)}
+ check_nothing_fails{assert_not_nil(false, "message")}
+ check_fails("<nil> expected to not be nil."){assert_not_nil(nil)}
+ check_fails("message.\n<nil> expected to not be nil.") {assert_not_nil(nil, "message")}
+ end
+
+ def test_assert_kind_of
+ check_nothing_fails {
+ assert_kind_of(Module, Array)
+ }
+ check_nothing_fails {
+ assert_kind_of(Object, "string", "successful assert_kind_of")
+ }
+ check_nothing_fails {
+ assert_kind_of(Object, "string", "successful assert_kind_of")
+ }
+ check_nothing_fails {
+ assert_kind_of(Comparable, 1)
+ }
+ check_fails(%Q{<"string">\nexpected to be kind_of?\n<Class> but was\n<String>.}) {
+ assert_kind_of(Class, "string")
+ }
+ check_fails(%Q{failed assert_kind_of.\n<"string">\nexpected to be kind_of?\n<Class> but was\n<String>.}) {
+ assert_kind_of(Class, "string", "failed assert_kind_of")
+ }
+ end
+
+ def test_assert_match
+ check_nothing_fails {
+ assert_match(/strin./, "string")
+ }
+ check_nothing_fails {
+ assert_match("strin", "string")
+ }
+ check_nothing_fails {
+ assert_match(/strin./, "string", "successful assert_match")
+ }
+ check_nothing_fails {
+ assert_match(/strin./, "string", "successful assert_match")
+ }
+ check_fails(%Q{<"string"> expected to be =~\n</slin./>.}) {
+ assert_match(/slin./, "string")
+ }
+ check_fails(%Q{<"string"> expected to be =~\n</strin\\./>.}) {
+ assert_match("strin.", "string")
+ }
+ check_fails(%Q{failed assert_match.\n<"string"> expected to be =~\n</slin./>.}) {
+ assert_match(/slin./, "string", "failed assert_match")
+ }
+ end
+
+ def test_assert_same
+ thing = "thing"
+ check_nothing_fails {
+ assert_same(thing, thing)
+ }
+ check_nothing_fails {
+ assert_same(thing, thing, "successful assert_same")
+ }
+ check_nothing_fails {
+ assert_same(thing, thing, "successful assert_same")
+ }
+ thing2 = "thing"
+ check_fails(%Q{<"thing">\nwith id <#{thing.__id__}> expected to be equal? to\n<"thing">\nwith id <#{thing2.__id__}>.}) {
+ assert_same(thing, thing2)
+ }
+ check_fails(%Q{failed assert_same.\n<"thing">\nwith id <#{thing.__id__}> expected to be equal? to\n<"thing">\nwith id <#{thing2.__id__}>.}) {
+ assert_same(thing, thing2, "failed assert_same")
+ }
+ end
+
+ def test_assert_nothing_raised
+ check_nothing_fails {
+ assert_nothing_raised {
+ 1 + 1
+ }
+ }
+ check_nothing_fails {
+ assert_nothing_raised("successful assert_nothing_raised") {
+ 1 + 1
+ }
+ }
+ check_nothing_fails {
+ assert_nothing_raised("successful assert_nothing_raised") {
+ 1 + 1
+ }
+ }
+ check_nothing_fails {
+ begin
+ assert_nothing_raised(RuntimeError, StandardError, Comparable, "successful assert_nothing_raised") {
+ raise ZeroDivisionError.new("ArgumentError")
+ }
+ rescue ZeroDivisionError
+ end
+ }
+ check_fails("Should expect a class of exception, Object.\n<false> is not true.") {
+ assert_nothing_raised(Object) {
+ 1 + 1
+ }
+ }
+ check_fails(%r{\AException raised:\nClass: <RuntimeError>\nMessage: <"Error">\n---Backtrace---\n.+\n---------------\Z}m) {
+ assert_nothing_raised {
+ raise "Error"
+ }
+ }
+ check_fails(%r{\Afailed assert_nothing_raised\.\nException raised:\nClass: <RuntimeError>\nMessage: <"Error">\n---Backtrace---\n.+\n---------------\Z}m) {
+ assert_nothing_raised("failed assert_nothing_raised") {
+ raise "Error"
+ }
+ }
+ check_fails(%r{\AException raised:\nClass: <RuntimeError>\nMessage: <"Error">\n---Backtrace---\n.+\n---------------\Z}m) {
+ assert_nothing_raised(StandardError, RuntimeError) {
+ raise "Error"
+ }
+ }
+ check_fails("Failure.") do
+ assert_nothing_raised do
+ flunk("Failure")
+ end
+ end
+ end
+
+ def test_flunk
+ check_fails("Flunked.") {
+ flunk
+ }
+ check_fails("flunk message.") {
+ flunk("flunk message")
+ }
+ end
+
+ def test_assert_not_same
+ thing = "thing"
+ thing2 = "thing"
+ check_nothing_fails {
+ assert_not_same(thing, thing2)
+ }
+ check_nothing_fails {
+ assert_not_same(thing, thing2, "message")
+ }
+ check_fails(%Q{<"thing">\nwith id <#{thing.__id__}> expected to not be equal? to\n<"thing">\nwith id <#{thing.__id__}>.}) {
+ assert_not_same(thing, thing)
+ }
+ check_fails(%Q{message.\n<"thing">\nwith id <#{thing.__id__}> expected to not be equal? to\n<"thing">\nwith id <#{thing.__id__}>.}) {
+ assert_not_same(thing, thing, "message")
+ }
+ end
+
+ def test_assert_not_equal
+ check_nothing_fails {
+ assert_not_equal("string1", "string2")
+ }
+ check_nothing_fails {
+ assert_not_equal("string1", "string2", "message")
+ }
+ check_fails(%Q{<"string"> expected to be != to\n<"string">.}) {
+ assert_not_equal("string", "string")
+ }
+ check_fails(%Q{message.\n<"string"> expected to be != to\n<"string">.}) {
+ assert_not_equal("string", "string", "message")
+ }
+ end
+
+ def test_assert_no_match
+ check_nothing_fails{assert_no_match(/sling/, "string")}
+ check_nothing_fails{assert_no_match(/sling/, "string", "message")}
+ check_fails(%Q{The first argument to assert_no_match should be a Regexp.\n<"asdf"> expected to be an instance of\n<Regexp> but was\n<String>.}) do
+ assert_no_match("asdf", "asdf")
+ end
+ check_fails(%Q{</string/> expected to not match\n<"string">.}) do
+ assert_no_match(/string/, "string")
+ end
+ check_fails(%Q{message.\n</string/> expected to not match\n<"string">.}) do
+ assert_no_match(/string/, "string", "message")
+ end
+ end
+
+ def test_assert_throws
+ check_nothing_fails {
+ assert_throws(:thing, "message") {
+ throw :thing
+ }
+ }
+ check_fails("message.\n<:thing> expected to be thrown but\n<:thing2> was thrown.") {
+ assert_throws(:thing, "message") {
+ throw :thing2
+ }
+ }
+ check_fails("message.\n<:thing> should have been thrown.") {
+ assert_throws(:thing, "message") {
+ 1 + 1
+ }
+ }
+ end
+
+ def test_assert_nothing_thrown
+ check_nothing_fails {
+ assert_nothing_thrown("message") {
+ 1 + 1
+ }
+ }
+ check_fails("message.\n<:thing> was thrown when nothing was expected.") {
+ assert_nothing_thrown("message") {
+ throw :thing
+ }
+ }
+ end
+
+ def test_assert_operator
+ check_nothing_fails {
+ assert_operator("thing", :==, "thing", "message")
+ }
+ check_fails(%Q{<0.15>\ngiven as the operator for #assert_operator must be a Symbol or #respond_to?(:to_str).}) do
+ assert_operator("thing", 0.15, "thing")
+ end
+ check_fails(%Q{message.\n<"thing1"> expected to be\n==\n<"thing2">.}) {
+ assert_operator("thing1", :==, "thing2", "message")
+ }
+ end
+
+ def test_assert_respond_to
+ check_nothing_fails {
+ assert_respond_to("thing", :to_s, "message")
+ }
+ check_nothing_fails {
+ assert_respond_to("thing", "to_s", "message")
+ }
+ check_fails("<0.15>\ngiven as the method name argument to #assert_respond_to must be a Symbol or #respond_to?(:to_str).") {
+ assert_respond_to("thing", 0.15)
+ }
+ check_fails("message.\n<:symbol>\nof type <Symbol>\nexpected to respond_to?<:non_existent>.") {
+ assert_respond_to(:symbol, :non_existent, "message")
+ }
+ end
+
+ def test_assert_in_delta
+ check_nothing_fails {
+ assert_in_delta(1.4, 1.4, 0)
+ }
+ check_nothing_fails {
+ assert_in_delta(0.5, 0.4, 0.1, "message")
+ }
+ check_nothing_fails {
+ float_thing = Object.new
+ def float_thing.to_f
+ 0.2
+ end
+ assert_in_delta(0.1, float_thing, 0.1)
+ }
+ check_fails("message.\n<0.5> and\n<0.4> expected to be within\n<0.05> of each other.") {
+ assert_in_delta(0.5, 0.4, 0.05, "message")
+ }
+ check_fails(%r{The arguments must respond to to_f; the first float did not\.\n<.+>\nof type <Object>\nexpected to respond_to\?<:to_f>.}) {
+ assert_in_delta(Object.new, 0.4, 0.1)
+ }
+ check_fails("The delta should not be negative.\n<-0.1> expected to be\n>=\n<0.0>.") {
+ assert_in_delta(0.5, 0.4, -0.1, "message")
+ }
+ end
+
+ def test_assert_send
+ object = Object.new
+ class << object
+ private
+ def return_argument(argument, bogus)
+ return argument
+ end
+ end
+ check_nothing_fails {
+ assert_send([object, :return_argument, true, "bogus"], "message")
+ }
+ check_fails(%r{\Amessage\.\n<.+> expected to respond to\n<return_argument\(\[false, "bogus"\]\)> with a true value.\Z}) {
+ assert_send([object, :return_argument, false, "bogus"], "message")
+ }
+ end
+
+ def test_condition_invariant
+ object = Object.new
+ def object.inspect
+ @changed = true
+ end
+ def object.==(other)
+ @changed ||= false
+ return (!@changed)
+ end
+ check_nothing_fails {
+ assert_equal(object, object, "message")
+ }
+ end
+
+ def add_failure(message, location=caller)
+ if (!@catch_assertions)
+ super
+ end
+ end
+
+ def add_assertion
+ if (!@catch_assertions)
+ super
+ else
+ @actual_assertion_count += 1
+ end
+ end
+ end
+ end
+end
diff --git a/test/testunit/test_error.rb b/test/testunit/test_error.rb
new file mode 100644
index 0000000000..56b275b362
--- /dev/null
+++ b/test/testunit/test_error.rb
@@ -0,0 +1,26 @@
+# Author:: Nathaniel Talbott.
+# Copyright:: Copyright (c) 2000-2002 Nathaniel Talbott. All rights reserved.
+# License:: Ruby license.
+
+require 'test/unit'
+
+module Test
+ module Unit
+ class TC_Error < TestCase
+ TF_Exception = Struct.new('TF_Exception', :message, :backtrace)
+ def test_display
+ ex = TF_Exception.new("message1\nmessage2", ['line1', 'line2'])
+ e = Error.new("name", ex)
+ assert_equal("name: #{TF_Exception.name}: message1", e.short_display)
+ assert_equal(<<EOM.strip, e.long_display)
+Error:
+name:
+Struct::TF_Exception: message1
+message2
+ line1
+ line2
+EOM
+ end
+ end
+ end
+end
diff --git a/test/testunit/test_failure.rb b/test/testunit/test_failure.rb
new file mode 100644
index 0000000000..164f942476
--- /dev/null
+++ b/test/testunit/test_failure.rb
@@ -0,0 +1,33 @@
+# Author:: Nathaniel Talbott.
+# Copyright:: Copyright (c) 2003 Nathaniel Talbott. All rights reserved.
+# License:: Ruby license.
+
+require 'test/unit'
+require 'test/unit/failure'
+
+module Test::Unit
+ class TestFailure < TestCase
+ def test_display
+ f = Failure.new("name", [%q{location:1 in 'l'}], "message1\nmessage2")
+ assert_equal("name: message1", f.short_display)
+ assert_equal(<<EOM.strip, f.long_display)
+Failure:
+name [location:1]:
+message1
+message2
+EOM
+
+ f = Failure.new("name", [%q{location1:2 in 'l1'}, 'location2:1', %q{location3:3 in 'l3'}], "message1\nmessage2")
+ assert_equal("name: message1", f.short_display)
+ assert_equal(<<EOM.strip, f.long_display)
+Failure:
+name
+ [location1:2 in 'l1'
+ location2:1
+ location3:3 in 'l3']:
+message1
+message2
+EOM
+ end
+ end
+end
diff --git a/test/testunit/test_testcase.rb b/test/testunit/test_testcase.rb
new file mode 100644
index 0000000000..2934a92fef
--- /dev/null
+++ b/test/testunit/test_testcase.rb
@@ -0,0 +1,275 @@
+# Author:: Nathaniel Talbott.
+# Copyright:: Copyright (c) 2000-2002 Nathaniel Talbott. All rights reserved.
+# License:: Ruby license.
+
+require 'test/unit'
+
+module Test
+ module Unit
+ class TC_TestCase < TestCase
+ def test_creation
+ tc = Class.new(TestCase) do
+ def test_with_arguments(arg1, arg2)
+ end
+ end
+
+ caught = true
+ catch(:invalid_test) do
+ tc.new(:test_with_arguments)
+ caught = false
+ end
+ check("Should have caught an invalid test when there are arguments", caught)
+
+ caught = true
+ catch(:invalid_test) do
+ tc.new(:non_existent_test)
+ caught = false
+ end
+ check("Should have caught an invalid test when the method does not exist", caught)
+ end
+
+ def setup
+ @tc_failure_error = Class.new(TestCase) do
+ def test_failure
+ assert_block("failure") { false }
+ end
+ def test_error
+ 1 / 0
+ end
+ def test_nested_failure
+ nested
+ end
+ def nested
+ assert_block("nested"){false}
+ end
+ def return_passed?
+ return passed?
+ end
+ end
+
+ def @tc_failure_error.name
+ "TC_FailureError"
+ end
+ end
+
+ def test_add_failed_assertion
+ test_case = @tc_failure_error.new(:test_failure)
+ check("passed? should start out true", test_case.return_passed?)
+ result = TestResult.new
+ called = false
+ result.add_listener(TestResult::FAULT) {
+ | fault |
+ check("Should have a Failure", fault.instance_of?(Failure))
+ check("The Failure should have the correct message", "failure" == fault.message)
+ check("The Failure should have the correct test_name (was <#{fault.test_name}>)", fault.test_name == "test_failure(TC_FailureError)")
+ r = /\A.*#{Regexp.escape(File.basename(__FILE__))}:\d+:in `test_failure'\Z/
+
+ location = fault.location
+ check("The location should be an array", location.kind_of?(Array))
+ check("The location should have two lines (was: <#{location.inspect}>)", location.size == 2)
+ check("The Failure should have the correct location (was <#{location[0].inspect}>, expected <#{r.inspect}>)", r =~ location[0])
+ called = true
+ }
+ progress = []
+ test_case.run(result) { |*arguments| progress << arguments }
+ check("The failure should have triggered the listener", called)
+ check("The failure should have set passed?", !test_case.return_passed?)
+ check("The progress block should have been updated correctly", [[TestCase::STARTED, test_case.name], [TestCase::FINISHED, test_case.name]] == progress)
+ end
+
+ def test_add_failure_nested
+ test_case = @tc_failure_error.new(:test_nested_failure)
+ check("passed? should start out true", test_case.return_passed?)
+
+ result = TestResult.new
+ called = false
+ result.add_listener(TestResult::FAULT) {
+ | fault |
+ check("Should have a Failure", fault.instance_of?(Failure))
+ check("The Failure should have the correct message", "nested" == fault.message)
+ check("The Failure should have the correct test_name (was <#{fault.test_name}>)", fault.test_name == "test_nested_failure(TC_FailureError)")
+ r =
+
+ location = fault.location
+ check("The location should be an array", location.kind_of?(Array))
+ check("The location should have the correct number of lines (was: <#{location.inspect}>)", location.size == 3)
+ check("The Failure should have the correct location (was <#{location[0].inspect}>)", /\A.*#{Regexp.escape(File.basename(__FILE__))}:\d+:in `nested'\Z/ =~ location[0])
+ check("The Failure should have the correct location (was <#{location[1].inspect}>)", /\A.*#{Regexp.escape(File.basename(__FILE__))}:\d+:in `test_nested_failure'\Z/ =~ location[1])
+ called = true
+ }
+ test_case.run(result){}
+ check("The failure should have triggered the listener", called)
+ end
+
+ def test_add_error
+ test_case = @tc_failure_error.new(:test_error)
+ check("passed? should start out true", test_case.return_passed?)
+ result = TestResult.new
+ called = false
+ result.add_listener(TestResult::FAULT) {
+ | fault |
+ check("Should have a TestError", fault.instance_of?(Error))
+ check("The Error should have the correct message", "ZeroDivisionError: divided by 0" == fault.message)
+ check("The Error should have the correct test_name", "test_error(TC_FailureError)" == fault.test_name)
+ check("The Error should have the correct exception", fault.exception.instance_of?(ZeroDivisionError))
+ called = true
+ }
+ test_case.run(result) {}
+ check("The error should have triggered the listener", called)
+ check("The error should have set passed?", !test_case.return_passed?)
+ end
+
+ def test_no_tests
+ suite = TestCase.suite
+ check("Should have a test suite", suite.instance_of?(TestSuite))
+ check("Should have one test", suite.size == 1)
+ check("Should have the default test", suite.tests.first.name == "default_test(Test::Unit::TestCase)")
+
+ result = TestResult.new
+ suite.run(result) {}
+ check("Should have had one test run", result.run_count == 1)
+ check("Should have had one test failure", result.failure_count == 1)
+ check("Should have had no errors", result.error_count == 0)
+ end
+
+ def test_suite
+ tc = Class.new(TestCase) do
+ def test_succeed
+ assert_block {true}
+ end
+ def test_fail
+ assert_block {false}
+ end
+ def test_error
+ 1/0
+ end
+ def dont_run
+ assert_block {true}
+ end
+ def test_dont_run(argument)
+ assert_block {true}
+ end
+ def test
+ assert_block {true}
+ end
+ end
+
+ suite = tc.suite
+ check("Should have a test suite", suite.instance_of?(TestSuite))
+ check("Should have three tests", suite.size == 3)
+
+ result = TestResult.new
+ suite.run(result) {}
+ check("Should have had three test runs", result.run_count == 3)
+ check("Should have had one test failure", result.failure_count == 1)
+ check("Should have had one test error", result.error_count == 1)
+ end
+
+
+ def test_setup_teardown
+ tc = Class.new(TestCase) do
+ attr_reader(:setup_called, :teardown_called)
+ def initialize(test)
+ super(test)
+ @setup_called = false
+ @teardown_called = false
+ end
+ def setup
+ @setup_called = true
+ end
+ def teardown
+ @teardown_called = true
+ end
+ def test_succeed
+ assert_block {true}
+ end
+ def test_fail
+ assert_block {false}
+ end
+ def test_error
+ raise "Error!"
+ end
+ end
+ result = TestResult.new
+
+ test = tc.new(:test_succeed)
+ test.run(result) {}
+ check("Should have called setup the correct number of times", test.setup_called)
+ check("Should have called teardown the correct number of times", test.teardown_called)
+
+ test = tc.new(:test_fail)
+ test.run(result) {}
+ check("Should have called setup the correct number of times", test.setup_called)
+ check("Should have called teardown the correct number of times", test.teardown_called)
+
+ test = tc.new(:test_error)
+ test.run(result) {}
+ check("Should have called setup the correct number of times", test.setup_called)
+ check("Should have called teardown the correct number of times", test.teardown_called)
+
+ check("Should have had two test runs", result.run_count == 3)
+ check("Should have had a test failure", result.failure_count == 1)
+ check("Should have had a test error", result.error_count == 1)
+ end
+
+ def test_assertion_failed_not_called
+ tc = Class.new(TestCase) do
+ def test_thing
+ raise AssertionFailedError.new
+ end
+ end
+
+ suite = tc.suite
+ check("Should have one test", suite.size == 1)
+ result = TestResult.new
+ suite.run(result) {}
+ check("Should have had one test run", result.run_count == 1)
+ check("Should have had one assertion failure", result.failure_count == 1)
+ check("Should not have any assertion errors but had #{result.error_count}", result.error_count == 0)
+ end
+
+ def test_equality
+ tc1 = Class.new(TestCase) do
+ def test_1
+ end
+ def test_2
+ end
+ end
+
+ tc2 = Class.new(TestCase) do
+ def test_1
+ end
+ end
+
+ test1 = tc1.new('test_1')
+ test2 = tc1.new('test_1')
+ check("Should be equal", test1 == test2)
+ check("Should be equal", test2 == test1)
+
+ test1 = tc1.new('test_2')
+ check("Should not be equal", test1 != test2)
+ check("Should not be equal", test2 != test1)
+
+ test2 = tc1.new('test_2')
+ check("Should be equal", test1 == test2)
+ check("Should be equal", test2 == test1)
+
+ test1 = tc1.new('test_1')
+ test2 = tc2.new('test_1')
+ check("Should not be equal", test1 != test2)
+ check("Should not be equal", test2 != test1)
+
+
+ check("Should not be equal", test1 != Object.new)
+ check("Should not be equal", Object.new != test1)
+ end
+
+ def check(message, passed)
+ @_result.add_assertion
+ if ! passed
+ raise AssertionFailedError.new(message)
+ end
+ end
+ end
+ end
+end
diff --git a/test/testunit/test_testresult.rb b/test/testunit/test_testresult.rb
new file mode 100644
index 0000000000..95d631a082
--- /dev/null
+++ b/test/testunit/test_testresult.rb
@@ -0,0 +1,104 @@
+# Author:: Nathaniel Talbott.
+# Copyright:: Copyright (c) 2000-2002 Nathaniel Talbott. All rights reserved.
+# License:: Ruby license.
+
+require 'test/unit/testcase'
+require 'test/unit/testresult'
+
+module Test
+ module Unit
+ class TC_TestResult < TestCase
+ def setup
+ @my_result = TestResult.new
+ @my_result.add_assertion()
+ @my_result.add_failure("")
+ @my_result.add_error("")
+ end
+ def test_result_changed_notification
+ called1 = false
+ @my_result.add_listener( TestResult::CHANGED) {
+ |result|
+ assert_block("The result should be correct") { result == @my_result }
+ called1 = true
+ }
+ @my_result.add_assertion
+ assert_block("Should have been notified when the assertion happened") { called1 }
+
+ called1, called2 = false, false
+ @my_result.add_listener( TestResult::CHANGED) {
+ |result|
+ assert_block("The result should be correct") { result == @my_result }
+ called2 = true
+ }
+ @my_result.add_assertion
+ assert_block("Both listeners should have been notified for a success") { called1 && called2 }
+
+ called1, called2 = false, false
+ @my_result.add_failure("")
+ assert_block("Both listeners should have been notified for a failure") { called1 && called2 }
+
+ called1, called2 = false, false
+ @my_result.add_error("")
+ assert_block("Both listeners should have been notified for an error") { called1 && called2 }
+
+ called1, called2 = false, false
+ @my_result.add_run
+ assert_block("Both listeners should have been notified for a run") { called1 && called2 }
+ end
+ def test_fault_notification
+ called1 = false
+ fault = "fault"
+ @my_result.add_listener(TestResult::FAULT) {
+ | passed_fault |
+ assert_block("The fault should be correct") { passed_fault == fault }
+ called1 = true
+ }
+
+ @my_result.add_assertion
+ assert_block("Should not have been notified when the assertion happened") { !called1 }
+
+ @my_result.add_failure(fault)
+ assert_block("Should have been notified when the failure happened") { called1 }
+
+ called1, called2 = false, false
+ @my_result.add_listener(TestResult::FAULT) {
+ | passed_fault |
+ assert_block("The fault should be correct") { passed_fault == fault }
+ called2 = true
+ }
+
+ @my_result.add_assertion
+ assert_block("Neither listener should have been notified for a success") { !(called1 || called2) }
+
+ called1, called2 = false, false
+ @my_result.add_failure(fault)
+ assert_block("Both listeners should have been notified for a failure") { called1 && called2 }
+
+ called1, called2 = false, false
+ @my_result.add_error(fault)
+ assert_block("Both listeners should have been notified for an error") { called1 && called2 }
+
+ called1, called2 = false, false
+ @my_result.add_run
+ assert_block("Neither listener should have been notified for a run") { !(called1 || called2) }
+ end
+ def test_passed?
+ result = TestResult.new
+ assert(result.passed?, "An empty result should have passed")
+
+ result.add_assertion
+ assert(result.passed?, "Adding an assertion should not cause the result to not pass")
+
+ result.add_run
+ assert(result.passed?, "Adding a run should not cause the result to not pass")
+
+ result.add_failure("")
+ assert(!result.passed?, "Adding a failed assertion should cause the result to not pass")
+
+ result = TestResult.new
+ result.add_error("")
+ assert(!result.passed?, "Adding an error should cause the result to not pass")
+ end
+ end
+ end
+end
diff --git a/test/testunit/test_testsuite.rb b/test/testunit/test_testsuite.rb
new file mode 100644
index 0000000000..5f6631d3eb
--- /dev/null
+++ b/test/testunit/test_testsuite.rb
@@ -0,0 +1,129 @@
+# Author:: Nathaniel Talbott.
+# Copyright:: Copyright (c) 2000-2003 Nathaniel Talbott. All rights reserved.
+# License:: Ruby license.
+
+require 'test/unit'
+
+module Test
+ module Unit
+ class TC_TestSuite < TestCase
+ def setup
+ @testcase1 = Class.new(TestCase) do
+ def test_succeed1
+ assert_block { true }
+ end
+ def test_fail
+ assert_block { false }
+ end
+ end
+
+ @testcase2 = Class.new(TestCase) do
+ def test_succeed2
+ assert_block { true }
+ end
+ def test_error
+ raise
+ end
+ end
+ end
+
+ def test_add
+ s = TestSuite.new
+ assert_equal(s, s << self.class.new("test_add"))
+ end
+
+ def test_delete
+ s = TestSuite.new
+ t1 = self.class.new("test_delete")
+ s << t1
+ t2 = self.class.new("test_add")
+ s << t2
+ assert_equal(t1, s.delete(t1))
+ assert_nil(s.delete(t1))
+ assert_equal(TestSuite.new << t2, s)
+ end
+
+ def test_size
+ suite = TestSuite.new
+ suite2 = TestSuite.new
+ suite2 << self.class.new("test_size")
+ suite << suite2
+ suite << self.class.new("test_size")
+ assert_equal(2, suite.size, "The count should be correct")
+ end
+
+ def test_run
+ progress = []
+ suite = @testcase1.suite
+ result = TestResult.new
+ suite.run(result) { |*values| progress << values }
+
+ assert_equal(2, result.run_count, "Should have had four test runs")
+ assert_equal(1, result.failure_count, "Should have had one test failure")
+ assert_equal(0, result.error_count, "Should have had one test error")
+ assert_equal([[TestSuite::STARTED, suite.name],
+ [TestCase::STARTED, "test_fail(#{suite.name})"],
+ [TestCase::FINISHED, "test_fail(#{suite.name})"],
+ [TestCase::STARTED, "test_succeed1(#{suite.name})"],
+ [TestCase::FINISHED, "test_succeed1(#{suite.name})"],
+ [TestSuite::FINISHED, suite.name]],
+ progress, "Should have had the correct progress")
+
+ suite = TestSuite.new
+ suite << @testcase1.suite
+ suite << @testcase2.suite
+ result = TestResult.new
+ progress = []
+ suite.run(result) { |*values| progress << values }
+
+ assert_equal(4, result.run_count, "Should have had four test runs")
+ assert_equal(1, result.failure_count, "Should have had one test failure")
+ assert_equal(1, result.error_count, "Should have had one test error")
+ assert_equal(14, progress.size, "Should have had the correct number of progress calls")
+ end
+
+ def test_empty?
+ assert(TestSuite.new.empty?, "A new test suite should be empty?")
+ assert(!@testcase2.suite.empty?, "A test suite with tests should not be empty")
+ end
+
+ def test_equality
+ suite1 = TestSuite.new
+ suite2 = TestSuite.new
+ assert_equal(suite1, suite2)
+ assert_equal(suite2, suite1)
+
+ suite1 = TestSuite.new('name')
+ assert_not_equal(suite1, suite2)
+ assert_not_equal(suite2, suite1)
+
+ suite2 = TestSuite.new('name')
+ assert_equal(suite1, suite2)
+ assert_equal(suite2, suite1)
+
+ suite1 << 'test'
+ assert_not_equal(suite1, suite2)
+ assert_not_equal(suite2, suite1)
+
+ suite2 << 'test'
+ assert_equal(suite1, suite2)
+ assert_equal(suite2, suite1)
+
+ suite2 = Object.new
+ class << suite2
+ def name
+ 'name'
+ end
+ def tests
+ ['test']
+ end
+ end
+ assert_not_equal(suite1, suite2)
+ assert_not_equal(suite2, suite1)
+
+ assert_not_equal(suite1, Object.new)
+ assert_not_equal(Object.new, suite1)
+ end
+ end
+ end
+end
diff --git a/test/testunit/util/test_backtracefilter.rb b/test/testunit/util/test_backtracefilter.rb
new file mode 100644
index 0000000000..d4e40ea6ab
--- /dev/null
+++ b/test/testunit/util/test_backtracefilter.rb
@@ -0,0 +1,41 @@
+require 'test/unit'
+
+require 'test/unit/util/backtracefilter'
+
+module Test::Unit::Util
+ class TestBacktraceFilter < Test::Unit::TestCase
+ include BacktraceFilter
+
+ def test_filter_backtrace
+ backtrace = [%q{C:\some\old\path/test/unit/assertions.rb:44:in 'assert'},
+ %q{tc_thing.rb:4:in 'a'},
+ %q{tc_thing.rb:4:in 'test_stuff'},
+ %q{C:\some\old\path/test/unit/testcase.rb:44:in 'send'},
+ %q{C:\some\old\path\test\unit\testcase.rb:44:in 'run'},
+ %q{C:\some\old\path\test\unit.rb:44:in 'run'},
+ %q{tc_thing.rb:3}]
+ assert_equal(backtrace[1..2], filter_backtrace(backtrace, %q{C:\some\old\path\test\unit}), "Should filter out all TestUnit-specific lines")
+
+backtrace = [%q{tc_thing.rb:4:in 'a'},
+ %q{tc_thing.rb:4:in 'test_stuff'},
+ %q{tc_thing.rb:3}]
+ assert_equal(backtrace, filter_backtrace(backtrace, %q{C:\some\old\path\test\unit}), "Shouldn't filter too much")
+
+ backtrace = [%q{C:\some\old\path/test/unit/assertions.rb:44:in 'assert'},
+ %q{tc_thing.rb:4:in 'a'},
+ %q{tc_thing.rb:4:in 'test_stuff'},
+ %q{tc_thing.rb:3}]
+ assert_equal(backtrace[1..3], filter_backtrace(backtrace, %q{C:\some\old\path\test\unit}), "Should filter out all TestUnit-specific lines")
+
+ backtrace = [%q{C:\some\old\path/test/unit/assertions.rb:44:in 'assert'},
+ %q{C:\some\old\path/test/unit/testcase.rb:44:in 'send'},
+ %q{C:\some\old\path\test\unit\testcase.rb:44:in 'run'},
+ %q{C:\some\old\path\test\unit.rb:44:in 'run'}]
+ assert_equal(backtrace, filter_backtrace(backtrace, %q{C:\some\old\path\test\unit}), "Should filter out all TestUnit-specific lines")
+ end
+
+ def test_nil_backtrace
+ assert_equal(["No backtrace"], filter_backtrace(nil))
+ end
+ end
+end
diff --git a/test/testunit/util/test_observable.rb b/test/testunit/util/test_observable.rb
new file mode 100644
index 0000000000..6cd10184f1
--- /dev/null
+++ b/test/testunit/util/test_observable.rb
@@ -0,0 +1,102 @@
+# Author:: Nathaniel Talbott.
+# Copyright:: Copyright (c) 2000-2002 Nathaniel Talbott. All rights reserved.
+# License:: Ruby license.
+
+require 'test/unit/util/observable'
+
+module Test
+ module Unit
+ module Util
+ class TC_Observable < TestCase
+
+ class TF_Observable
+ include Observable
+ end
+
+ def setup
+ @observable = TF_Observable.new
+ end
+
+ def test_simple_observation
+ assert_raises(ArgumentError, "add_listener should throw an exception if no callback is supplied") do
+ @observable.add_listener(:property, "a")
+ end
+
+ heard = false
+ callback = proc { heard = true }
+ assert_equal("a", @observable.add_listener(:property, "a", &callback), "add_listener should return the listener that was added")
+
+ count = 0
+ @observable.instance_eval do
+ count = notify_listeners(:property)
+ end
+ assert_equal(1, count, "notify_listeners should have returned the number of listeners that were notified")
+ assert(heard, "Should have heard the property changed")
+
+ heard = false
+ assert_equal(callback, @observable.remove_listener(:property, "a"), "remove_listener should return the callback")
+
+ count = 1
+ @observable.instance_eval do
+ count = notify_listeners(:property)
+ end
+ assert_equal(0, count, "notify_listeners should have returned the number of listeners that were notified")
+ assert(!heard, "Should not have heard the property change")
+ end
+
+ def test_value_observation
+ value = nil
+ @observable.add_listener(:property, "a") do |passed_value|
+ value = passed_value
+ end
+ count = 0
+ @observable.instance_eval do
+ count = notify_listeners(:property, "stuff")
+ end
+ assert_equal(1, count, "Should have update the correct number of listeners")
+ assert_equal("stuff", value, "Should have received the value as an argument to the listener")
+ end
+
+ def test_multiple_value_observation
+ values = []
+ @observable.add_listener(:property, "a") do |first_value, second_value|
+ values = [first_value, second_value]
+ end
+ count = 0
+ @observable.instance_eval do
+ count = notify_listeners(:property, "stuff", "more stuff")
+ end
+ assert_equal(1, count, "Should have update the correct number of listeners")
+ assert_equal(["stuff", "more stuff"], values, "Should have received the value as an argument to the listener")
+ end
+
+ def test_add_remove_with_default_listener
+ assert_raises(ArgumentError, "add_listener should throw an exception if no callback is supplied") do
+ @observable.add_listener(:property)
+ end
+
+ heard = false
+ callback = proc { heard = true }
+ assert_equal(callback, @observable.add_listener(:property, &callback), "add_listener should return the listener that was added")
+
+ count = 0
+ @observable.instance_eval do
+ count = notify_listeners(:property)
+ end
+ assert_equal(1, count, "notify_listeners should have returned the number of listeners that were notified")
+ assert(heard, "Should have heard the property changed")
+
+ heard = false
+ assert_equal(callback, @observable.remove_listener(:property, callback), "remove_listener should return the callback")
+
+ count = 1
+ @observable.instance_eval do
+ count = notify_listeners(:property)
+ end
+ assert_equal(0, count, "notify_listeners should have returned the number of listeners that were notified")
+ assert(!heard, "Should not have heard the property change")
+ end
+ end
+ end
+ end
+end
diff --git a/test/testunit/util/test_procwrapper.rb b/test/testunit/util/test_procwrapper.rb
new file mode 100644
index 0000000000..3e552c7711
--- /dev/null
+++ b/test/testunit/util/test_procwrapper.rb
@@ -0,0 +1,36 @@
+# Author:: Nathaniel Talbott.
+# Copyright:: Copyright (c) 2000-2002 Nathaniel Talbott. All rights reserved.
+# License:: Ruby license.
+
+require 'test/unit'
+require 'test/unit/util/procwrapper'
+
+module Test
+ module Unit
+ module Util
+ class TC_ProcWrapper < TestCase
+ def munge_proc(&a_proc)
+ return a_proc
+ end
+ def setup
+ @original = proc {}
+ @munged = munge_proc(&@original)
+ @wrapped_original = ProcWrapper.new(@original)
+ @wrapped_munged = ProcWrapper.new(@munged)
+ end
+ def test_wrapping
+ assert_same(@original, @wrapped_original.to_proc, "The wrapper should return what was wrapped")
+ end
+ def test_hashing
+
+ assert_equal(@wrapped_original.hash, @wrapped_munged.hash, "The original and munged should have the same hash when wrapped")
+ assert_equal(@wrapped_original, @wrapped_munged, "The wrappers should be equivalent")
+
+ a_hash = {@wrapped_original => @original}
+ assert(a_hash[@wrapped_original], "Should be able to access the wrapper in the hash")
+ assert_equal(a_hash[@wrapped_original], @original, "Should be able to access the wrapper in the hash")
+ end
+ end
+ end
+ end
+end
diff --git a/test/thread/lbtest.rb b/test/thread/lbtest.rb
new file mode 100755
index 0000000000..10bb90185f
--- /dev/null
+++ b/test/thread/lbtest.rb
@@ -0,0 +1,51 @@
+#! /usr/bin/ruby
+require 'thread'
+
+class LocalBarrier
+ def initialize(n)
+ @wait = Queue.new
+ @done = Queue.new
+ @keeper = begin_keeper(n)
+ end
+
+ def sync
+ @done.push(true)
+ @wait.pop
+ end
+
+ def join
+ @keeper.join
+ end
+
+ private
+ def begin_keeper(n)
+ Thread.start do
+ n.times do
+ @done.pop
+ end
+ n.times do
+ @wait.push(true)
+ end
+ end
+ end
+end
+
+n = 10
+
+lb = LocalBarrier.new(n)
+
+(n - 1).times do |i|
+ Thread.start do
+ sleep((rand(n) + 1) / 10.0)
+ puts "#{i}: done"
+ lb.sync
+ puts "#{i}: cont"
+ end
+end
+
+lb.sync
+puts "#{n-1}: done"
+
+# lb.join # leaving waiting threads.
+
+puts "exit."
diff --git a/test/thread/test_thread.rb b/test/thread/test_thread.rb
new file mode 100644
index 0000000000..44ae3b338d
--- /dev/null
+++ b/test/thread/test_thread.rb
@@ -0,0 +1,81 @@
+# -*- ruby-indent-level: 4 -*-
+require 'thread'
+require 'test/unit'
+
+class TC_Thread < Test::Unit::TestCase
+ def setup
+ Thread.abort_on_exception = true
+ end
+ def teardown
+ Thread.abort_on_exception = false
+ end
+ def test_condvar
+ mutex = Mutex.new
+ condvar = ConditionVariable.new
+ result = []
+ mutex.synchronize do
+ t = Thread.new do
+ mutex.synchronize do
+ result << 1
+ condvar.signal
+ end
+ end
+
+ result << 0
+ condvar.wait(mutex)
+ result << 2
+ t.join
+ end
+ assert_equal([0, 1, 2], result)
+ end
+
+ def test_condvar_wait_not_owner
+ mutex = Mutex.new
+ condvar = ConditionVariable.new
+
+ assert_raises(ThreadError) { condvar.wait(mutex) }
+ end
+
+ def test_condvar_wait_exception_handling
+ # Calling wait in the only thread running should raise a ThreadError of
+ # 'stopping only thread'
+ mutex = Mutex.new
+ condvar = ConditionVariable.new
+
+ Thread.abort_on_exception = false
+
+ locked = false
+ thread = Thread.new do
+ mutex.synchronize do
+ begin
+ condvar.wait(mutex)
+ rescue Exception
+ locked = mutex.locked?
+ raise
+ end
+ end
+ end
+
+ while !thread.stop?
+ sleep(0.1)
+ end
+
+ thread.raise Interrupt, "interrupt a dead condition variable"
+ assert_raises(Interrupt) { thread.value }
+ assert(locked)
+ end
+
+ def test_local_barrier
+ dir = File.dirname(__FILE__)
+ lbtest = File.join(dir, "lbtest.rb")
+ $:.unshift File.join(File.dirname(dir), 'ruby')
+ require 'envutil'
+ $:.shift
+ 10.times {
+ result = `#{EnvUtil.rubybin} #{lbtest}`
+ assert(!$?.coredump?, '[ruby-dev:30653]')
+ assert_equal("exit.", result[/.*\Z/], '[ruby-dev:30653]')
+ }
+ end
+end
+
diff --git a/test/uri/test_common.rb b/test/uri/test_common.rb
index dfc4acd8d3..0fe031bdee 100644
--- a/test/uri/test_common.rb
+++ b/test/uri/test_common.rb
@@ -12,20 +12,20 @@ class TestCommon < Test::Unit::TestCase
end
def test_extract
- assert_equal(['http://example.com'],
+ assert_equal(['http://example.com'],
URI.extract('http://example.com'))
- assert_equal(['http://example.com'],
+ assert_equal(['http://example.com'],
URI.extract('(http://example.com)'))
- assert_equal(['http://example.com/foo)'],
+ assert_equal(['http://example.com/foo)'],
URI.extract('(http://example.com/foo)'))
- assert_equal(['http://example.jphttp://example.jp'],
+ assert_equal(['http://example.jphttp://example.jp'],
URI.extract('http://example.jphttp://example.jp'), "[ruby-list:36086]")
- assert_equal(['http://example.jphttp://example.jp'],
+ assert_equal(['http://example.jphttp://example.jp'],
URI.extract('http://example.jphttp://example.jp', ['http']), "[ruby-list:36086]")
- assert_equal(['http://', 'mailto:'].sort,
+ assert_equal(['http://', 'mailto:'].sort,
URI.extract('ftp:// http:// mailto: https://', ['http', 'mailto']).sort)
# reported by Doug Kearns <djkea2@mugca.its.monash.edu.au>
- assert_equal(['From:', 'mailto:xxx@xxx.xxx.xxx]'].sort,
+ assert_equal(['From:', 'mailto:xxx@xxx.xxx.xxx]'].sort,
URI.extract('From: XXX [mailto:xxx@xxx.xxx.xxx]').sort)
end
diff --git a/test/uri/test_ftp.rb b/test/uri/test_ftp.rb
index 0d76c4497b..10abd29502 100644
--- a/test/uri/test_ftp.rb
+++ b/test/uri/test_ftp.rb
@@ -14,7 +14,7 @@ class TestFTP < Test::Unit::TestCase
exp = [
'ftp',
- 'user:pass', 'host.com', URI::FTP.default_port,
+ 'user:pass', 'host.com', URI::FTP.default_port,
'abc/def', nil,
]
ary = [
@@ -28,22 +28,22 @@ class TestFTP < Test::Unit::TestCase
end
def test_paths
- # If you think what's below is wrong, please read RubyForge bug 2055,
+ # If you think what's below is wrong, please read RubyForge bug 2055,
# RFC 1738 section 3.2.2, and RFC 2396.
u = URI.parse('ftp://ftp.example.com/foo/bar/file.ext')
- assert(u.path == 'foo/bar/file.ext')
+ assert_equal(u.path, 'foo/bar/file.ext')
u = URI.parse('ftp://ftp.example.com//foo/bar/file.ext')
- assert(u.path == '/foo/bar/file.ext')
+ assert_equal(u.path, '/foo/bar/file.ext')
u = URI.parse('ftp://ftp.example.com/%2Ffoo/bar/file.ext')
- assert(u.path == '/foo/bar/file.ext')
+ assert_equal(u.path, '/foo/bar/file.ext')
end
def test_assemble
# uri/ftp is conservative and uses the older RFC 1738 rules, rather than
# assuming everyone else has implemented RFC 2396.
- uri = URI::FTP.build(['user:password', 'ftp.example.com', nil,
+ uri = URI::FTP.build(['user:password', 'ftp.example.com', nil,
'/path/file.zip', 'i'])
- assert(uri.to_s ==
+ assert_equal(uri.to_s,
'ftp://user:password@ftp.example.com/%2Fpath/file.zip;type=i')
end
@@ -52,7 +52,7 @@ class TestFTP < Test::Unit::TestCase
u = URI.parse('ftp://a.b.c/')
ary = u.component.collect {|c| u.send(c)}
assert_equal(ary, u.select(*u.component))
- assert_raise(ArgumentError) do
+ assert_raises(ArgumentError) do
u.select(:scheme, :host, :not_exist, :port)
end
end
diff --git a/test/uri/test_generic.rb b/test/uri/test_generic.rb
index fcaa599724..5cd4c7f7ae 100644
--- a/test/uri/test_generic.rb
+++ b/test/uri/test_generic.rb
@@ -1,7 +1,10 @@
require 'test/unit'
require 'uri'
-class URI::TestGeneric < Test::Unit::TestCase
+module URI
+
+
+class TestGeneric < Test::Unit::TestCase
def setup
@url = 'http://a/b/c/d;p?q'
@base_url = URI.parse(@url)
@@ -19,9 +22,9 @@ class URI::TestGeneric < Test::Unit::TestCase
assert_kind_of(URI::HTTP, @base_url)
exp = [
- 'http',
- nil, 'a', URI::HTTP.default_port,
- '/b/c/d;p',
+ 'http',
+ nil, 'a', URI::HTTP.default_port,
+ '/b/c/d;p',
'q',
nil
]
@@ -33,8 +36,8 @@ class URI::TestGeneric < Test::Unit::TestCase
assert_kind_of(URI::FTP, url)
exp = [
- 'ftp',
- nil, 'ftp.is.co.za', URI::FTP.default_port,
+ 'ftp',
+ nil, 'ftp.is.co.za', URI::FTP.default_port,
'rfc/rfc1808.txt', nil,
]
ary = uri_to_ary(url)
@@ -44,8 +47,8 @@ class URI::TestGeneric < Test::Unit::TestCase
assert_kind_of(URI::FTP, url)
exp = [
- 'ftp',
- nil, 'ftp.is.co.za', URI::FTP.default_port,
+ 'ftp',
+ nil, 'ftp.is.co.za', URI::FTP.default_port,
'/rfc/rfc1808.txt', nil,
]
ary = uri_to_ary(url)
@@ -56,7 +59,7 @@ class URI::TestGeneric < Test::Unit::TestCase
assert_kind_of(URI::Generic, url)
exp = [
- 'gopher',
+ 'gopher',
nil, 'spinaltap.micro.umn.edu', nil, nil,
'/00/Weather/California/Los%20Angeles', nil,
nil,
@@ -70,9 +73,9 @@ class URI::TestGeneric < Test::Unit::TestCase
assert_kind_of(URI::HTTP, url)
exp = [
- 'http',
- nil, 'www.math.uio.no', URI::HTTP.default_port,
- '/faq/compression-faq/part1.html',
+ 'http',
+ nil, 'www.math.uio.no', URI::HTTP.default_port,
+ '/faq/compression-faq/part1.html',
nil,
nil
]
@@ -84,7 +87,7 @@ class URI::TestGeneric < Test::Unit::TestCase
assert_kind_of(URI::Generic, url)
exp = [
- 'mailto',
+ 'mailto',
'mduerst@ifi.unizh.ch',
[]
]
@@ -96,8 +99,8 @@ class URI::TestGeneric < Test::Unit::TestCase
assert_kind_of(URI::Generic, url)
exp = [
- 'news',
- nil, nil, nil, nil,
+ 'news',
+ nil, nil, nil, nil,
nil, 'comp.infosystems.www.servers.unix',
nil,
nil
@@ -110,8 +113,8 @@ class URI::TestGeneric < Test::Unit::TestCase
assert_kind_of(URI::Generic, url)
exp = [
- 'telnet',
- nil, 'melvyl.ucop.edu', nil, nil,
+ 'telnet',
+ nil, 'melvyl.ucop.edu', nil, nil,
'/', nil,
nil,
nil
@@ -121,8 +124,8 @@ class URI::TestGeneric < Test::Unit::TestCase
# 7
# reported by Mr. Kubota <em6t-kbt@asahi-net.or.jp>
- assert_raise(URI::InvalidURIError) { URI.parse('http://a_b:80/') }
- assert_raise(URI::InvalidURIError) { URI.parse('http://a_b/') }
+ assert_raises(URI::InvalidURIError) { URI.parse('http://a_b:80/') }
+ assert_raises(URI::InvalidURIError) { URI.parse('http://a_b/') }
# 8
# reported by m_seki
@@ -680,19 +683,22 @@ class URI::TestGeneric < Test::Unit::TestCase
assert_equal('http://foo:bar@zab:8080/?a=1#b123', uri.to_s)
uri = URI.parse('http://example.com')
- assert_raise(URI::InvalidURIError) { uri.password = 'bar' }
+ assert_raises(URI::InvalidURIError) { uri.password = 'bar' }
uri.userinfo = 'foo:bar'
assert_equal('http://foo:bar@example.com', uri.to_s)
- assert_raise(URI::InvalidURIError) { uri.registry = 'bar' }
- assert_raise(URI::InvalidURIError) { uri.opaque = 'bar' }
+ assert_raises(URI::InvalidURIError) { uri.registry = 'bar' }
+ assert_raises(URI::InvalidURIError) { uri.opaque = 'bar' }
uri = URI.parse('mailto:foo@example.com')
- assert_raise(URI::InvalidURIError) { uri.user = 'bar' }
- assert_raise(URI::InvalidURIError) { uri.password = 'bar' }
- assert_raise(URI::InvalidURIError) { uri.userinfo = ['bar', 'baz'] }
- assert_raise(URI::InvalidURIError) { uri.host = 'bar' }
- assert_raise(URI::InvalidURIError) { uri.port = 'bar' }
- assert_raise(URI::InvalidURIError) { uri.path = 'bar' }
- assert_raise(URI::InvalidURIError) { uri.query = 'bar' }
+ assert_raises(URI::InvalidURIError) { uri.user = 'bar' }
+ assert_raises(URI::InvalidURIError) { uri.password = 'bar' }
+ assert_raises(URI::InvalidURIError) { uri.userinfo = ['bar', 'baz'] }
+ assert_raises(URI::InvalidURIError) { uri.host = 'bar' }
+ assert_raises(URI::InvalidURIError) { uri.port = 'bar' }
+ assert_raises(URI::InvalidURIError) { uri.path = 'bar' }
+ assert_raises(URI::InvalidURIError) { uri.query = 'bar' }
end
end
+
+
+end
diff --git a/test/uri/test_http.rb b/test/uri/test_http.rb
index a323d43a79..a6846141df 100644
--- a/test/uri/test_http.rb
+++ b/test/uri/test_http.rb
@@ -18,7 +18,7 @@ class TestHTTP < Test::Unit::TestCase
def test_parse
u = URI.parse('http://a')
assert_kind_of(URI::HTTP, u)
- assert_equal(['http',
+ assert_equal(['http',
nil, 'a', URI::HTTP.default_port,
'', nil, nil], uri_to_ary(u))
end
@@ -53,7 +53,7 @@ class TestHTTP < Test::Unit::TestCase
assert_equal(['http', 'a.b.c', 80], URI.parse('http://a.b.c/').select(:scheme, :host, :port))
u = URI.parse('http://a.b.c/')
assert_equal(uri_to_ary(u), u.select(*u.component))
- assert_raise(ArgumentError) do
+ assert_raises(ArgumentError) do
u.select(:scheme, :host, :not_exist, :port)
end
end
diff --git a/test/uri/test_ldap.rb b/test/uri/test_ldap.rb
index 14ef39242e..866b7d8066 100644
--- a/test/uri/test_ldap.rb
+++ b/test/uri/test_ldap.rb
@@ -38,47 +38,47 @@ class TestLDAP < Test::Unit::TestCase
# from RFC2255, section 6.
urls = {
'ldap:///o=University%20of%20Michigan,c=US' =>
- ['ldap', nil, URI::LDAP::DEFAULT_PORT,
- 'o=University%20of%20Michigan,c=US',
+ ['ldap', nil, URI::LDAP::DEFAULT_PORT,
+ 'o=University%20of%20Michigan,c=US',
nil, nil, nil, nil],
'ldap://ldap.itd.umich.edu/o=University%20of%20Michigan,c=US' =>
- ['ldap', 'ldap.itd.umich.edu', URI::LDAP::DEFAULT_PORT,
- 'o=University%20of%20Michigan,c=US',
+ ['ldap', 'ldap.itd.umich.edu', URI::LDAP::DEFAULT_PORT,
+ 'o=University%20of%20Michigan,c=US',
nil, nil, nil, nil],
'ldap://ldap.itd.umich.edu/o=University%20of%20Michigan,c=US?postalAddress' =>
- ['ldap', 'ldap.itd.umich.edu', URI::LDAP::DEFAULT_PORT,
+ ['ldap', 'ldap.itd.umich.edu', URI::LDAP::DEFAULT_PORT,
'o=University%20of%20Michigan,c=US',
'postalAddress', nil, nil, nil],
'ldap://host.com:6666/o=University%20of%20Michigan,c=US??sub?(cn=Babs%20Jensen)' =>
- ['ldap', 'host.com', 6666,
+ ['ldap', 'host.com', 6666,
'o=University%20of%20Michigan,c=US',
nil, 'sub', '(cn=Babs%20Jensen)', nil],
'ldap://ldap.itd.umich.edu/c=GB?objectClass?one' =>
- ['ldap', 'ldap.itd.umich.edu', URI::LDAP::DEFAULT_PORT,
- 'c=GB',
+ ['ldap', 'ldap.itd.umich.edu', URI::LDAP::DEFAULT_PORT,
+ 'c=GB',
'objectClass', 'one', nil, nil],
'ldap://ldap.question.com/o=Question%3f,c=US?mail' =>
- ['ldap', 'ldap.question.com', URI::LDAP::DEFAULT_PORT,
+ ['ldap', 'ldap.question.com', URI::LDAP::DEFAULT_PORT,
'o=Question%3f,c=US',
'mail', nil, nil, nil],
'ldap://ldap.netscape.com/o=Babsco,c=US??(int=%5c00%5c00%5c00%5c04)' =>
- ['ldap', 'ldap.netscape.com', URI::LDAP::DEFAULT_PORT,
+ ['ldap', 'ldap.netscape.com', URI::LDAP::DEFAULT_PORT,
'o=Babsco,c=US',
nil, '(int=%5c00%5c00%5c00%5c04)', nil, nil],
'ldap:///??sub??bindname=cn=Manager%2co=Foo' =>
- ['ldap', nil, URI::LDAP::DEFAULT_PORT,
+ ['ldap', nil, URI::LDAP::DEFAULT_PORT,
'',
nil, 'sub', nil, 'bindname=cn=Manager%2co=Foo'],
'ldap:///??sub??!bindname=cn=Manager%2co=Foo' =>
- ['ldap', nil, URI::LDAP::DEFAULT_PORT,
+ ['ldap', nil, URI::LDAP::DEFAULT_PORT,
'',
nil, 'sub', nil, '!bindname=cn=Manager%2co=Foo'],
}.each do |url, ary|
@@ -90,7 +90,7 @@ class TestLDAP < Test::Unit::TestCase
def test_select
u = URI.parse('ldap:///??sub??!bindname=cn=Manager%2co=Foo')
assert_equal(uri_to_ary(u), u.select(*u.component))
- assert_raise(ArgumentError) do
+ assert_raises(ArgumentError) do
u.select(:scheme, :host, :not_exist, :port)
end
end
diff --git a/test/uri/test_mailto.rb b/test/uri/test_mailto.rb
index 04fb6fdadc..ba437904f8 100644
--- a/test/uri/test_mailto.rb
+++ b/test/uri/test_mailto.rb
@@ -29,46 +29,46 @@ class TestMailTo < Test::Unit::TestCase
# mailto:infobot@example.com?subject=current-issue
ok << ["mailto:infobot@example.com?subject=current-issue"]
ok[-1] << ["infobot@example.com", ["subject=current-issue"]]
- ok[-1] << {:to => "infobot@example.com",
+ ok[-1] << {:to => "infobot@example.com",
:headers => ["subject=current-issue"]}
# mailto:infobot@example.com?body=send%20current-issue
ok << ["mailto:infobot@example.com?body=send%20current-issue"]
ok[-1] << ["infobot@example.com", ["body=send%20current-issue"]]
- ok[-1] << {:to => "infobot@example.com",
+ ok[-1] << {:to => "infobot@example.com",
:headers => ["body=send%20current-issue"]}
# mailto:infobot@example.com?body=send%20current-issue%0D%0Asend%20index
ok << ["mailto:infobot@example.com?body=send%20current-issue%0D%0Asend%20index"]
- ok[-1] << ["infobot@example.com",
+ ok[-1] << ["infobot@example.com",
["body=send%20current-issue%0D%0Asend%20index"]]
- ok[-1] << {:to => "infobot@example.com",
+ ok[-1] << {:to => "infobot@example.com",
:headers => ["body=send%20current-issue%0D%0Asend%20index"]}
# mailto:foobar@example.com?In-Reply-To=%3c3469A91.D10AF4C@example.com
ok << ["mailto:foobar@example.com?In-Reply-To=%3c3469A91.D10AF4C@example.com"]
- ok[-1] << ["foobar@example.com",
+ ok[-1] << ["foobar@example.com",
["In-Reply-To=%3c3469A91.D10AF4C@example.com"]]
- ok[-1] << {:to => "foobar@example.com",
+ ok[-1] << {:to => "foobar@example.com",
:headers => ["In-Reply-To=%3c3469A91.D10AF4C@example.com"]}
# mailto:majordomo@example.com?body=subscribe%20bamboo-l
ok << ["mailto:majordomo@example.com?body=subscribe%20bamboo-l"]
ok[-1] << ["majordomo@example.com", ["body=subscribe%20bamboo-l"]]
- ok[-1] << {:to => "majordomo@example.com",
+ ok[-1] << {:to => "majordomo@example.com",
:headers => ["body=subscribe%20bamboo-l"]}
# mailto:joe@example.com?cc=bob@example.com&body=hello
ok << ["mailto:joe@example.com?cc=bob@example.com&body=hello"]
ok[-1] << ["joe@example.com", ["cc=bob@example.com", "body=hello"]]
- ok[-1] << {:to => "joe@example.com",
+ ok[-1] << {:to => "joe@example.com",
:headers => ["cc=bob@example.com", "body=hello"]}
# mailto:?to=joe@example.com&cc=bob@example.com&body=hello
ok << ["mailto:?to=joe@example.com&cc=bob@example.com&body=hello"]
- ok[-1] << [nil,
+ ok[-1] << [nil,
["to=joe@example.com", "cc=bob@example.com", "body=hello"]]
- ok[-1] << {:headers => ["to=joe@example.com",
+ ok[-1] << {:headers => ["to=joe@example.com",
"cc=bob@example.com", "body=hello"]}
# mailto:gorby%25kremvax@example.com
@@ -79,7 +79,7 @@ class TestMailTo < Test::Unit::TestCase
# mailto:unlikely%3Faddress@example.com?blat=foop
ok << ["mailto:unlikely%3Faddress@example.com?blat=foop"]
ok[-1] << ["unlikely%3Faddress@example.com", ["blat=foop"]]
- ok[-1] << {:to => "unlikely%3Faddress@example.com",
+ ok[-1] << {:to => "unlikely%3Faddress@example.com",
:headers => ["blat=foop"]}
ok_all = ok.flatten.join("\0")
@@ -101,7 +101,7 @@ class TestMailTo < Test::Unit::TestCase
end
bad.each do |x|
- assert_raise(URI::InvalidComponentError) {
+ assert_raises(URI::InvalidComponentError) {
@u.build(x)
}
end
@@ -112,7 +112,7 @@ class TestMailTo < Test::Unit::TestCase
def test_select
u = URI.parse('mailto:joe@example.com?cc=bob@example.com&body=hello')
assert_equal(uri_to_ary(u), u.select(*u.component))
- assert_raise(ArgumentError) do
+ assert_raises(ArgumentError) do
u.select(:scheme, :host, :not_exist, :port)
end
end
diff --git a/test/uri/test_parser.rb b/test/uri/test_parser.rb
deleted file mode 100644
index adf8a1292c..0000000000
--- a/test/uri/test_parser.rb
+++ /dev/null
@@ -1,41 +0,0 @@
-require 'test/unit'
-require 'uri'
-
-class URI::TestParser < Test::Unit::TestCase
- def uri_to_ary(uri)
- uri.class.component.collect {|c| uri.send(c)}
- end
-
- def test_compare
- url = 'http://a/b/c/d;p?q'
- u0 = URI.parse(url)
- u1 = URI.parse(url)
- p = URI::Parser.new
- u2 = p.parse(url)
- u3 = p.parse(url)
-
- assert(u0 == u1)
- assert(u0.eql?(u1))
- assert(!u0.equal?(u1))
-
- assert(u1 == u2)
- assert(!u1.eql?(u2))
- assert(!u1.equal?(u2))
-
- assert(u2 == u3)
- assert(u2.eql?(u3))
- assert(!u2.equal?(u3))
- end
-
- def test_parse
- escaped = URI::REGEXP::PATTERN::ESCAPED
- hex = URI::REGEXP::PATTERN::HEX
- p1 = URI::Parser.new(:ESCAPED => "(?:#{escaped}|%u[#{hex}]{4})")
- u1 = p1.parse('http://a/b/%uABCD')
- assert_equal(['http', nil, 'a', URI::HTTP.default_port, '/b/%uABCD', nil, nil],
- uri_to_ary(u1))
- u1.path = '/%uDCBA'
- assert_equal(['http', nil, 'a', URI::HTTP.default_port, '/%uDCBA', nil, nil],
- uri_to_ary(u1))
- end
-end
diff --git a/test/webrick/test_cgi.rb b/test/webrick/test_cgi.rb
index ff83919902..b39fe2661c 100644
--- a/test/webrick/test_cgi.rb
+++ b/test/webrick/test_cgi.rb
@@ -3,59 +3,46 @@ require File.join(File.dirname(__FILE__), "utils.rb")
require "test/unit"
class TestWEBrickCGI < Test::Unit::TestCase
- CRLF = "\r\n"
-
- def start_cgi_server(&block)
+ def test_cgi
+ accepted = started = stopped = 0
+ requested0 = requested1 = 0
config = {
:CGIInterpreter => TestWEBrick::RubyBin,
:DocumentRoot => File.dirname(__FILE__),
:DirectoryIndex => ["webrick.cgi"],
- :RequestHandler => Proc.new{|req, res|
- def req.meta_vars
- meta = super
- meta["RUBYLIB"] = $:.join(File::PATH_SEPARATOR)
- return meta
- end
- },
}
if RUBY_PLATFORM =~ /mswin32|mingw|cygwin|bccwin32/
config[:CGIPathEnv] = ENV['PATH'] # runtime dll may not be in system dir.
end
- TestWEBrick.start_httpserver(config){|server, addr, port, log|
- block.call(server, addr, port, log)
- }
- end
-
- def test_cgi
- start_cgi_server{|server, addr, port, log|
+ TestWEBrick.start_httpserver(config){|server, addr, port|
http = Net::HTTP.new(addr, port)
req = Net::HTTP::Get.new("/webrick.cgi")
- http.request(req){|res| assert_equal("/webrick.cgi", res.body, log.call)}
+ http.request(req){|res| assert_equal("/webrick.cgi", res.body)}
req = Net::HTTP::Get.new("/webrick.cgi/path/info")
- http.request(req){|res| assert_equal("/path/info", res.body, log.call)}
+ http.request(req){|res| assert_equal("/path/info", res.body)}
req = Net::HTTP::Get.new("/webrick.cgi/%3F%3F%3F?foo=bar")
- http.request(req){|res| assert_equal("/???", res.body, log.call)}
+ http.request(req){|res| assert_equal("/???", res.body)}
req = Net::HTTP::Get.new("/webrick.cgi/%A4%DB%A4%B2/%A4%DB%A4%B2")
http.request(req){|res|
- assert_equal("/\xA4\xDB\xA4\xB2/\xA4\xDB\xA4\xB2", res.body, log.call)}
+ assert_equal("/\xA4\xDB\xA4\xB2/\xA4\xDB\xA4\xB2", res.body)}
req = Net::HTTP::Get.new("/webrick.cgi?a=1;a=2;b=x")
- http.request(req){|res| assert_equal("a=1, a=2, b=x", res.body, log.call)}
+ http.request(req){|res| assert_equal("a=1, a=2, b=x", res.body)}
req = Net::HTTP::Get.new("/webrick.cgi?a=1&a=2&b=x")
- http.request(req){|res| assert_equal("a=1, a=2, b=x", res.body, log.call)}
+ http.request(req){|res| assert_equal("a=1, a=2, b=x", res.body)}
req = Net::HTTP::Post.new("/webrick.cgi?a=x;a=y;b=1")
req["Content-Type"] = "application/x-www-form-urlencoded"
http.request(req, "a=1;a=2;b=x"){|res|
- assert_equal("a=1, a=2, b=x", res.body, log.call)}
+ assert_equal("a=1, a=2, b=x", res.body)}
req = Net::HTTP::Post.new("/webrick.cgi?a=x&a=y&b=1")
req["Content-Type"] = "application/x-www-form-urlencoded"
http.request(req, "a=1&a=2&b=x"){|res|
- assert_equal("a=1, a=2, b=x", res.body, log.call)}
+ assert_equal("a=1, a=2, b=x", res.body)}
req = Net::HTTP::Get.new("/")
http.request(req){|res|
- ary = res.body.lines.to_a
- assert_match(%r{/$}, ary[0], log.call)
- assert_match(%r{/webrick.cgi$}, ary[1], log.call)
+ ary = res.body.to_a
+ assert_match(%r{/$}, ary[0])
+ assert_match(%r{/webrick.cgi$}, ary[1])
}
req = Net::HTTP::Get.new("/webrick.cgi")
@@ -63,7 +50,7 @@ class TestWEBrickCGI < Test::Unit::TestCase
http.request(req){|res|
assert_equal(
"CUSTOMER=WILE_E_COYOTE\nPART_NUMBER=ROCKET_LAUNCHER_0001\n",
- res.body, log.call)
+ res.body)
}
req = Net::HTTP::Get.new("/webrick.cgi")
@@ -74,28 +61,11 @@ class TestWEBrickCGI < Test::Unit::TestCase
req["Cookie"] = cookie
http.request(req){|res|
assert_equal("Customer=WILE_E_COYOTE, Shipping=FedEx",
- res["Set-Cookie"], log.call)
+ res["Set-Cookie"])
assert_equal("Customer=WILE_E_COYOTE\n" +
"Part_Number=Rocket_Launcher_0001\n" +
- "Shipping=FedEx\n", res.body, log.call)
+ "Shipping=FedEx\n", res.body)
}
}
end
-
- def test_bad_request
- start_cgi_server{|server, addr, port, log|
- sock = TCPSocket.new(addr, port)
- begin
- sock << "POST /webrick.cgi HTTP/1.0" << CRLF
- sock << "Content-Type: application/x-www-form-urlencoded" << CRLF
- sock << "Content-Length: 1024" << CRLF
- sock << CRLF
- sock << "a=1&a=2&b=x"
- sock.close_write
- assert_match(%r{\AHTTP/\d.\d 400 Bad Request}, sock.read, log.call)
- ensure
- sock.close
- end
- }
- end
end
diff --git a/test/webrick/test_filehandler.rb b/test/webrick/test_filehandler.rb
index 712ff7b1cd..2c7d97fa70 100644
--- a/test/webrick/test_filehandler.rb
+++ b/test/webrick/test_filehandler.rb
@@ -14,11 +14,7 @@ class WEBrick::TestFileHandler < Test::Unit::TestCase
end
def get_res_body(res)
- if defined? res.body.read
- res.body.read
- else
- res.body
- end
+ return res.body.read rescue res.body
end
def make_range_request(range_spec)
@@ -75,19 +71,19 @@ class WEBrick::TestFileHandler < Test::Unit::TestCase
def test_filehandler
config = { :DocumentRoot => File.dirname(__FILE__), }
this_file = File.basename(__FILE__)
- TestWEBrick.start_httpserver(config) do |server, addr, port, log|
+ TestWEBrick.start_httpserver(config) do |server, addr, port|
http = Net::HTTP.new(addr, port)
req = Net::HTTP::Get.new("/")
http.request(req){|res|
- assert_equal("200", res.code, log.call)
- assert_equal("text/html", res.content_type, log.call)
- assert_match(/HREF="#{this_file}"/, res.body, log.call)
+ assert_equal("200", res.code)
+ assert_equal("text/html", res.content_type)
+ assert_match(/HREF="#{this_file}"/, res.body)
}
req = Net::HTTP::Get.new("/#{this_file}")
http.request(req){|res|
- assert_equal("200", res.code, log.call)
- assert_equal("text/plain", res.content_type, log.call)
- assert_equal(File.read(__FILE__), res.body, log.call)
+ assert_equal("200", res.code)
+ assert_equal("text/plain", res.content_type)
+ assert_equal(File.read(__FILE__), res.body)
}
end
end
@@ -95,23 +91,23 @@ class WEBrick::TestFileHandler < Test::Unit::TestCase
def test_non_disclosure_name
config = { :DocumentRoot => File.dirname(__FILE__), }
this_file = File.basename(__FILE__)
- TestWEBrick.start_httpserver(config) do |server, addr, port, log|
+ TestWEBrick.start_httpserver(config) do |server, addr, port|
http = Net::HTTP.new(addr, port)
doc_root_opts = server[:DocumentRootOptions]
doc_root_opts[:NondisclosureName] = %w(.ht* *~ test_*)
req = Net::HTTP::Get.new("/")
http.request(req){|res|
- assert_equal("200", res.code, log.call)
- assert_equal("text/html", res.content_type, log.call)
+ assert_equal("200", res.code)
+ assert_equal("text/html", res.content_type)
assert_no_match(/HREF="#{File.basename(__FILE__)}"/, res.body)
}
req = Net::HTTP::Get.new("/#{this_file}")
http.request(req){|res|
- assert_equal("404", res.code, log.call)
+ assert_equal("404", res.code)
}
doc_root_opts[:NondisclosureName] = %w(.ht* *~ TEST_*)
http.request(req){|res|
- assert_equal("404", res.code, log.call)
+ assert_equal("404", res.code)
}
end
end
@@ -119,14 +115,14 @@ class WEBrick::TestFileHandler < Test::Unit::TestCase
def test_directory_traversal
config = { :DocumentRoot => File.dirname(__FILE__), }
this_file = File.basename(__FILE__)
- TestWEBrick.start_httpserver(config) do |server, addr, port, log|
+ TestWEBrick.start_httpserver(config) do |server, addr, port|
http = Net::HTTP.new(addr, port)
req = Net::HTTP::Get.new("/../../")
- http.request(req){|res| assert_equal("400", res.code, log.call) }
+ http.request(req){|res| assert_equal("400", res.code) }
req = Net::HTTP::Get.new("/..%5c../#{File.basename(__FILE__)}")
- http.request(req){|res| assert_equal(windows? ? "200" : "404", res.code, log.call) }
+ http.request(req){|res| assert_equal(windows? ? "200" : "404", res.code) }
req = Net::HTTP::Get.new("/..%5c..%5cruby.c")
- http.request(req){|res| assert_equal("404", res.code, log.call) }
+ http.request(req){|res| assert_equal("404", res.code) }
end
end
@@ -134,10 +130,10 @@ class WEBrick::TestFileHandler < Test::Unit::TestCase
if windows?
config = { :DocumentRoot => File.dirname(__FILE__), }
this_file = File.basename(__FILE__)
- TestWEBrick.start_httpserver(config) do |server, addr, port, log|
+ TestWEBrick.start_httpserver(config) do |server, addr, port|
http = Net::HTTP.new(addr, port)
req = Net::HTTP::Get.new("/..%5c..")
- http.request(req){|res| assert_equal("301", res.code, log.call) }
+ http.request(req){|res| assert_equal("301", res.code) }
end
end
end
@@ -148,25 +144,25 @@ class WEBrick::TestFileHandler < Test::Unit::TestCase
:DocumentRoot => File.dirname(__FILE__),
:CGIPathEnv => ENV['PATH'],
}
- TestWEBrick.start_httpserver(config) do |server, addr, port, log|
+ TestWEBrick.start_httpserver(config) do |server, addr, port|
http = Net::HTTP.new(addr, port)
req = Net::HTTP::Get.new("/webric~1.cgi/test")
http.request(req) do |res|
if windows?
- assert_equal("200", res.code, log.call)
- assert_equal("/test", res.body, log.call)
+ assert_equal("200", res.code)
+ assert_equal("/test", res.body)
else
- assert_equal("404", res.code, log.call)
+ assert_equal("404", res.code)
end
end
req = Net::HTTP::Get.new("/.htaccess")
- http.request(req) {|res| assert_equal("404", res.code, log.call) }
+ http.request(req) {|res| assert_equal("404", res.code) }
req = Net::HTTP::Get.new("/htacce~1")
- http.request(req) {|res| assert_equal("404", res.code, log.call) }
+ http.request(req) {|res| assert_equal("404", res.code) }
req = Net::HTTP::Get.new("/HTACCE~1")
- http.request(req) {|res| assert_equal("404", res.code, log.call) }
+ http.request(req) {|res| assert_equal("404", res.code) }
end
end
@@ -176,21 +172,21 @@ class WEBrick::TestFileHandler < Test::Unit::TestCase
:DocumentRoot => File.dirname(__FILE__),
:CGIPathEnv => ENV['PATH'],
}
- TestWEBrick.start_httpserver(config) do |server, addr, port, log|
+ TestWEBrick.start_httpserver(config) do |server, addr, port|
http = Net::HTTP.new(addr, port)
req = Net::HTTP::Get.new("/webrick.cgi/test")
http.request(req) do |res|
- assert_equal("200", res.code, log.call)
- assert_equal("/test", res.body, log.call)
+ assert_equal("200", res.code)
+ assert_equal("/test", res.body)
end
response_assertion = Proc.new do |res|
if windows?
- assert_equal("200", res.code, log.call)
- assert_equal("/test", res.body, log.call)
+ assert_equal("200", res.code)
+ assert_equal("/test", res.body)
else
- assert_equal("404", res.code, log.call)
+ assert_equal("404", res.code)
end
end
req = Net::HTTP::Get.new("/webrick.cgi%20/test")
diff --git a/test/webrick/test_httpauth.rb b/test/webrick/test_httpauth.rb
index 56f96235f1..75926b1624 100644
--- a/test/webrick/test_httpauth.rb
+++ b/test/webrick/test_httpauth.rb
@@ -7,27 +7,27 @@ require File.join(File.dirname(__FILE__), "utils.rb")
class TestWEBrickHTTPAuth < Test::Unit::TestCase
def test_basic_auth
- TestWEBrick.start_httpserver{|server, addr, port, log|
+ TestWEBrick.start_httpserver{|server, addr, port|
realm = "WEBrick's realm"
path = "/basic_auth"
server.mount_proc(path){|req, res|
WEBrick::HTTPAuth.basic_auth(req, res, realm){|user, pass|
user == "webrick" && pass == "supersecretpassword"
- }
+ }
res.body = "hoge"
}
http = Net::HTTP.new(addr, port)
g = Net::HTTP::Get.new(path)
g.basic_auth("webrick", "supersecretpassword")
- http.request(g){|res| assert_equal("hoge", res.body, log.call)}
+ http.request(g){|res| assert_equal("hoge", res.body)}
g.basic_auth("webrick", "not super")
- http.request(g){|res| assert_not_equal("hoge", res.body, log.call)}
+ http.request(g){|res| assert_not_equal("hoge", res.body)}
}
end
def test_basic_auth2
- TestWEBrick.start_httpserver{|server, addr, port, log|
+ TestWEBrick.start_httpserver{|server, addr, port|
realm = "WEBrick's realm"
path = "/basic_auth2"
@@ -41,9 +41,9 @@ class TestWEBrickHTTPAuth < Test::Unit::TestCase
htpasswd = WEBrick::HTTPAuth::Htpasswd.new(tmpfile.path)
users = []
htpasswd.each{|user, pass| users << user }
- assert_equal(2, users.size, log.call)
- assert(users.member?("webrick"), log.call)
- assert(users.member?("foo"), log.call)
+ assert_equal(2, users.size)
+ assert(users.member?("webrick"))
+ assert(users.member?("foo"))
server.mount_proc(path){|req, res|
auth = WEBrick::HTTPAuth::BasicAuth.new(
@@ -56,9 +56,9 @@ class TestWEBrickHTTPAuth < Test::Unit::TestCase
http = Net::HTTP.new(addr, port)
g = Net::HTTP::Get.new(path)
g.basic_auth("webrick", "supersecretpassword")
- http.request(g){|res| assert_equal("hoge", res.body, log.call)}
+ http.request(g){|res| assert_equal("hoge", res.body)}
g.basic_auth("webrick", "not super")
- http.request(g){|res| assert_not_equal("hoge", res.body, log.call)}
+ http.request(g){|res| assert_not_equal("hoge", res.body)}
}
end
@@ -66,7 +66,7 @@ class TestWEBrickHTTPAuth < Test::Unit::TestCase
tmpfile = Tempfile.new("test_webrick_auth")
tmpfile.puts("webrick:{SHA}GJYFRpBbdchp595jlh3Bhfmgp8k=")
tmpfile.flush
- assert_raise(NotImplementedError){
+ assert_raises(NotImplementedError){
WEBrick::HTTPAuth::Htpasswd.new(tmpfile.path)
}
tmpfile.close(true)
@@ -74,7 +74,7 @@ class TestWEBrickHTTPAuth < Test::Unit::TestCase
tmpfile = Tempfile.new("test_webrick_auth")
tmpfile.puts("webrick:$apr1$IOVMD/..$rmnOSPXr0.wwrLPZHBQZy0")
tmpfile.flush
- assert_raise(NotImplementedError){
+ assert_raises(NotImplementedError){
WEBrick::HTTPAuth::Htpasswd.new(tmpfile.path)
}
tmpfile.close(true)
diff --git a/test/webrick/test_httpproxy.rb b/test/webrick/test_httpproxy.rb
deleted file mode 100644
index ab82ed8cd7..0000000000
--- a/test/webrick/test_httpproxy.rb
+++ /dev/null
@@ -1,281 +0,0 @@
-require "test/unit"
-require "net/http"
-require "webrick"
-require "webrick/httpproxy"
-begin
- require "webrick/ssl"
- require "net/https"
- require File.expand_path("../openssl/utils.rb", File.dirname(__FILE__))
-rescue LoadError
- # test_connect will be skipped
-end
-require File.expand_path("utils.rb", File.dirname(__FILE__))
-
-class TestWEBrickHTTPProxy < Test::Unit::TestCase
- def test_fake_proxy
- assert_nil(WEBrick::FakeProxyURI.scheme)
- assert_nil(WEBrick::FakeProxyURI.host)
- assert_nil(WEBrick::FakeProxyURI.port)
- assert_nil(WEBrick::FakeProxyURI.path)
- assert_nil(WEBrick::FakeProxyURI.userinfo)
- assert_raise(NoMethodError){ WEBrick::FakeProxyURI.foo }
- end
-
- def test_proxy
- # Testing GET or POST to the proxy server
- # Note that the proxy server works as the origin server.
- # +------+
- # V |
- # client -------> proxy ---+
- # GET / POST GET / POST
- #
- proxy_handler_called = request_handler_called = 0
- config = {
- :ServerName => "localhost.localdomain",
- :ProxyContentHandler => Proc.new{|req, res| proxy_handler_called += 1 },
- :RequestHandler => Proc.new{|req, res| request_handler_called += 1 }
- }
- TestWEBrick.start_httpproxy(config){|server, addr, port, log|
- server.mount_proc("/"){|req, res|
- res.body = "#{req.request_method} #{req.path} #{req.body}"
- }
- http = Net::HTTP.new(addr, port, addr, port)
-
- req = Net::HTTP::Get.new("/")
- http.request(req){|res|
- assert_equal("1.1 localhost.localdomain:#{port}", res["via"], log.call)
- assert_equal("GET / ", res.body, log.call)
- }
- assert_equal(1, proxy_handler_called, log.call)
- assert_equal(2, request_handler_called, log.call)
-
- req = Net::HTTP::Head.new("/")
- http.request(req){|res|
- assert_equal("1.1 localhost.localdomain:#{port}", res["via"], log.call)
- assert_nil(res.body, log.call)
- }
- assert_equal(2, proxy_handler_called, log.call)
- assert_equal(4, request_handler_called, log.call)
-
- req = Net::HTTP::Post.new("/")
- req.body = "post-data"
- http.request(req){|res|
- assert_equal("1.1 localhost.localdomain:#{port}", res["via"], log.call)
- assert_equal("POST / post-data", res.body, log.call)
- }
- assert_equal(3, proxy_handler_called, log.call)
- assert_equal(6, request_handler_called, log.call)
- }
- end
-
- def test_no_proxy
- # Testing GET or POST to the proxy server without proxy request.
- #
- # client -------> proxy
- # GET / POST
- #
- proxy_handler_called = request_handler_called = 0
- config = {
- :ServerName => "localhost.localdomain",
- :ProxyContentHandler => Proc.new{|req, res| proxy_handler_called += 1 },
- :RequestHandler => Proc.new{|req, res| request_handler_called += 1 }
- }
- TestWEBrick.start_httpproxy(config){|server, addr, port, log|
- server.mount_proc("/"){|req, res|
- res.body = "#{req.request_method} #{req.path} #{req.body}"
- }
- http = Net::HTTP.new(addr, port)
-
- req = Net::HTTP::Get.new("/")
- http.request(req){|res|
- assert_nil(res["via"], log.call)
- assert_equal("GET / ", res.body, log.call)
- }
- assert_equal(0, proxy_handler_called, log.call)
- assert_equal(1, request_handler_called, log.call)
-
- req = Net::HTTP::Head.new("/")
- http.request(req){|res|
- assert_nil(res["via"], log.call)
- assert_nil(res.body, log.call)
- }
- assert_equal(0, proxy_handler_called, log.call)
- assert_equal(2, request_handler_called, log.call)
-
- req = Net::HTTP::Post.new("/")
- req.body = "post-data"
- http.request(req){|res|
- assert_nil(res["via"], log.call)
- assert_equal("POST / post-data", res.body, log.call)
- }
- assert_equal(0, proxy_handler_called, log.call)
- assert_equal(3, request_handler_called, log.call)
- }
- end
-
- def make_certificate(key, cn)
- subject = OpenSSL::X509::Name.parse("/DC=org/DC=ruby-lang/CN=#{cn}")
- exts = [
- ["keyUsage", "keyEncipherment,digitalSignature", true],
- ]
- cert = OpenSSL::TestUtils.issue_cert(
- subject, key, 1, Time.now, Time.now + 3600, exts,
- nil, nil, OpenSSL::Digest::SHA1.new
- )
- return cert
- end
-
- def test_connect
- # Testing CONNECT to proxy server
- #
- # client -----------> proxy -----------> https
- # 1. CONNECT establish TCP
- # 2. ---- establish SSL session --->
- # 3. ------- GET or POST ---------->
- #
- key = OpenSSL::TestUtils::TEST_KEY_RSA1024
- cert = make_certificate(key, "127.0.0.1")
- s_config = {
- :SSLEnable =>true,
- :ServerName => "localhost",
- :SSLCertificate => cert,
- :SSLPrivateKey => key,
- }
- config = {
- :ServerName => "localhost.localdomain",
- :RequestHandler => Proc.new{|req, res|
- assert_equal("CONNECT", req.request_method)
- },
- }
- TestWEBrick.start_httpserver(s_config){|s_server, s_addr, s_port, s_log|
- s_server.mount_proc("/"){|req, res|
- res.body = "SSL #{req.request_method} #{req.path} #{req.body}"
- }
- TestWEBrick.start_httpproxy(config){|server, addr, port, log|
- http = Net::HTTP.new("127.0.0.1", s_port, addr, port)
- http.use_ssl = true
- http.verify_callback = Proc.new do |preverify_ok, store_ctx|
- store_ctx.current_cert.to_der == cert.to_der
- end
-
- req = Net::HTTP::Get.new("/")
- http.request(req){|res|
- assert_equal("SSL GET / ", res.body, s_log.call + log.call)
- }
-
- req = Net::HTTP::Post.new("/")
- req.body = "post-data"
- http.request(req){|res|
- assert_equal("SSL POST / post-data", res.body, s_log.call + log.call)
- }
- }
- }
- end if defined?(OpenSSL)
-
- def test_upstream_proxy
- # Testing GET or POST through the upstream proxy server
- # Note that the upstream proxy server works as the origin server.
- # +------+
- # V |
- # client -------> proxy -------> proxy ---+
- # GET / POST GET / POST GET / POST
- #
- up_proxy_handler_called = up_request_handler_called = 0
- proxy_handler_called = request_handler_called = 0
- up_config = {
- :ServerName => "localhost.localdomain",
- :ProxyContentHandler => Proc.new{|req, res| up_proxy_handler_called += 1},
- :RequestHandler => Proc.new{|req, res| up_request_handler_called += 1}
- }
- TestWEBrick.start_httpproxy(up_config){|up_server, up_addr, up_port, up_log|
- up_server.mount_proc("/"){|req, res|
- res.body = "#{req.request_method} #{req.path} #{req.body}"
- }
- config = {
- :ServerName => "localhost.localdomain",
- :ProxyURI => URI.parse("http://localhost:#{up_port}"),
- :ProxyContentHandler => Proc.new{|req, res| proxy_handler_called += 1},
- :RequestHandler => Proc.new{|req, res| request_handler_called += 1},
- }
- TestWEBrick.start_httpproxy(config){|server, addr, port, log|
- http = Net::HTTP.new(up_addr, up_port, addr, port)
-
- req = Net::HTTP::Get.new("/")
- http.request(req){|res|
- via = res["via"].split(/,\s+/)
- assert(via.include?("1.1 localhost.localdomain:#{up_port}"), up_log.call + log.call)
- assert(via.include?("1.1 localhost.localdomain:#{port}"), up_log.call + log.call)
- assert_equal("GET / ", res.body)
- }
- assert_equal(1, up_proxy_handler_called, up_log.call + log.call)
- assert_equal(2, up_request_handler_called, up_log.call + log.call)
- assert_equal(1, proxy_handler_called, up_log.call + log.call)
- assert_equal(1, request_handler_called, up_log.call + log.call)
-
- req = Net::HTTP::Head.new("/")
- http.request(req){|res|
- via = res["via"].split(/,\s+/)
- assert(via.include?("1.1 localhost.localdomain:#{up_port}"), up_log.call + log.call)
- assert(via.include?("1.1 localhost.localdomain:#{port}"), up_log.call + log.call)
- assert_nil(res.body, up_log.call + log.call)
- }
- assert_equal(2, up_proxy_handler_called, up_log.call + log.call)
- assert_equal(4, up_request_handler_called, up_log.call + log.call)
- assert_equal(2, proxy_handler_called, up_log.call + log.call)
- assert_equal(2, request_handler_called, up_log.call + log.call)
-
- req = Net::HTTP::Post.new("/")
- req.body = "post-data"
- http.request(req){|res|
- via = res["via"].split(/,\s+/)
- assert(via.include?("1.1 localhost.localdomain:#{up_port}"), up_log.call + log.call)
- assert(via.include?("1.1 localhost.localdomain:#{port}"), up_log.call + log.call)
- assert_equal("POST / post-data", res.body, up_log.call + log.call)
- }
- assert_equal(3, up_proxy_handler_called, up_log.call + log.call)
- assert_equal(6, up_request_handler_called, up_log.call + log.call)
- assert_equal(3, proxy_handler_called, up_log.call + log.call)
- assert_equal(3, request_handler_called, up_log.call + log.call)
-
- if defined?(OpenSSL)
- # Testing CONNECT to the upstream proxy server
- #
- # client -------> proxy -------> proxy -------> https
- # 1. CONNECT CONNECT establish TCP
- # 2. -------- establish SSL session ------>
- # 3. ---------- GET or POST -------------->
- #
- key = OpenSSL::TestUtils::TEST_KEY_RSA1024
- cert = make_certificate(key, "127.0.0.1")
- s_config = {
- :SSLEnable =>true,
- :ServerName => "localhost",
- :SSLCertificate => cert,
- :SSLPrivateKey => key,
- }
- TestWEBrick.start_httpserver(s_config){|s_server, s_addr, s_port, s_log|
- s_server.mount_proc("/"){|req, res|
- res.body = "SSL #{req.request_method} #{req.path} #{req.body}"
- }
- http = Net::HTTP.new("127.0.0.1", s_port, addr, port, up_log.call + log.call + s_log.call)
- http.use_ssl = true
- http.verify_callback = Proc.new do |preverify_ok, store_ctx|
- store_ctx.current_cert.to_der == cert.to_der
- end
-
- req = Net::HTTP::Get.new("/")
- http.request(req){|res|
- assert_equal("SSL GET / ", res.body, up_log.call + log.call + s_log.call)
- }
-
- req = Net::HTTP::Post.new("/")
- req.body = "post-data"
- http.request(req){|res|
- assert_equal("SSL POST / post-data", res.body, up_log.call + log.call + s_log.call)
- }
- }
- end
- }
- }
- end
-end
diff --git a/test/webrick/test_httprequest.rb b/test/webrick/test_httprequest.rb
index 4a1db38bca..f0cd1a092a 100644
--- a/test/webrick/test_httprequest.rb
+++ b/test/webrick/test_httprequest.rb
@@ -56,16 +56,6 @@ class TestWEBrickHTTPRequest < Test::Unit::TestCase
assert(req.query.empty?)
end
- def test_request_uri_too_large
- msg = <<-_end_of_message_
- GET /#{"a"*1024} HTTP/1.1
- _end_of_message_
- req = WEBrick::HTTPRequest.new(WEBrick::Config::HTTP)
- assert_raise(WEBrick::HTTPStatus::RequestURITooLarge){
- req.parse(StringIO.new(msg.gsub(/^ {6}/, "")))
- }
- end
-
def test_parse_headers
msg = <<-_end_of_message_
GET /path HTTP/1.1
@@ -79,7 +69,6 @@ class TestWEBrickHTTPRequest < Test::Unit::TestCase
Accept-Language: ja
Content-Type: text/plain
Content-Length: 7
- X-Empty-Header:
foobar
_end_of_message_
@@ -98,8 +87,6 @@ class TestWEBrickHTTPRequest < Test::Unit::TestCase
assert_equal(7, req.content_length)
assert_equal("text/plain", req.content_type)
assert_equal("foobar\n", req.body)
- assert_equal("", req["x-empty-header"])
- assert_equal(nil, req["x-no-header"])
assert(req.query.empty?)
end
@@ -241,70 +228,6 @@ class TestWEBrickHTTPRequest < Test::Unit::TestCase
assert_equal(File.read(__FILE__), req.body)
end
- def test_forwarded
- msg = <<-_end_of_message_
- GET /foo HTTP/1.1
- Host: localhost:10080
- User-Agent: w3m/0.5.2
- X-Forwarded-For: 123.123.123.123
- X-Forwarded-Host: forward.example.com
- X-Forwarded-Server: server.example.com
- Connection: Keep-Alive
-
- _end_of_message_
- msg.gsub!(/^ {6}/, "")
- req = WEBrick::HTTPRequest.new(WEBrick::Config::HTTP)
- req.parse(StringIO.new(msg))
- assert_equal("server.example.com", req.server_name)
- assert_equal("http://forward.example.com/foo", req.request_uri.to_s)
- assert_equal("forward.example.com", req.host)
- assert_equal(80, req.port)
- assert_equal("123.123.123.123", req.remote_ip)
- assert(!req.ssl?)
-
- msg = <<-_end_of_message_
- GET /foo HTTP/1.1
- Host: localhost:10080
- User-Agent: w3m/0.5.2
- X-Forwarded-For: 192.168.1.10, 172.16.1.1, 123.123.123.123
- X-Forwarded-Host: forward.example.com:8080
- X-Forwarded-Server: server.example.com
- Connection: Keep-Alive
-
- _end_of_message_
- msg.gsub!(/^ {6}/, "")
- req = WEBrick::HTTPRequest.new(WEBrick::Config::HTTP)
- req.parse(StringIO.new(msg))
- assert_equal("server.example.com", req.server_name)
- assert_equal("http://forward.example.com:8080/foo", req.request_uri.to_s)
- assert_equal("forward.example.com", req.host)
- assert_equal(8080, req.port)
- assert_equal("123.123.123.123", req.remote_ip)
- assert(!req.ssl?)
-
- msg = <<-_end_of_message_
- GET /foo HTTP/1.1
- Host: localhost:10080
- Client-IP: 234.234.234.234
- X-Forwarded-Proto: https
- X-Forwarded-For: 192.168.1.10, 10.0.0.1, 123.123.123.123
- X-Forwarded-Host: forward.example.com
- X-Forwarded-Server: server.example.com
- X-Requested-With: XMLHttpRequest
- Connection: Keep-Alive
-
- _end_of_message_
- msg.gsub!(/^ {6}/, "")
- req = WEBrick::HTTPRequest.new(WEBrick::Config::HTTP)
- req.parse(StringIO.new(msg))
- assert_equal("server.example.com", req.server_name)
- assert_equal("https://forward.example.com/foo", req.request_uri.to_s)
- assert_equal("forward.example.com", req.host)
- assert_equal(443, req.port)
- assert_equal("234.234.234.234", req.remote_ip)
- assert(req.ssl?)
- end
-
def test_bad_messages
param = "foo=1;foo=2;foo=3;bar=x"
msg = <<-_end_of_message_
@@ -314,7 +237,7 @@ class TestWEBrickHTTPRequest < Test::Unit::TestCase
#{param}
_end_of_message_
- assert_raise(WEBrick::HTTPStatus::LengthRequired){
+ assert_raises(WEBrick::HTTPStatus::LengthRequired){
req = WEBrick::HTTPRequest.new(WEBrick::Config::HTTP)
req.parse(StringIO.new(msg.gsub(/^ {6}/, "")))
req.body
@@ -327,7 +250,7 @@ class TestWEBrickHTTPRequest < Test::Unit::TestCase
body is too short.
_end_of_message_
- assert_raise(WEBrick::HTTPStatus::BadRequest){
+ assert_raises(WEBrick::HTTPStatus::BadRequest){
req = WEBrick::HTTPRequest.new(WEBrick::Config::HTTP)
req.parse(StringIO.new(msg.gsub(/^ {6}/, "")))
req.body
@@ -340,7 +263,7 @@ class TestWEBrickHTTPRequest < Test::Unit::TestCase
body is too short.
_end_of_message_
- assert_raise(WEBrick::HTTPStatus::NotImplemented){
+ assert_raises(WEBrick::HTTPStatus::NotImplemented){
req = WEBrick::HTTPRequest.new(WEBrick::Config::HTTP)
req.parse(StringIO.new(msg.gsub(/^ {6}/, "")))
req.body
diff --git a/test/webrick/test_httpserver.rb b/test/webrick/test_httpserver.rb
index 6b0c419ad7..eb685f916d 100644
--- a/test/webrick/test_httpserver.rb
+++ b/test/webrick/test_httpserver.rb
@@ -223,7 +223,7 @@ class TestWEBrickHTTPServer < Test::Unit::TestCase
:StopCallback => Proc.new{ stopped += 1 },
:RequestCallback => Proc.new{|req, res| requested0 += 1 },
}
- TestWEBrick.start_httpserver(config){|server, addr, port, log|
+ TestWEBrick.start_httpserver(config){|server, addr, port|
vhost_config = {
:ServerName => "myhostname",
:BindAddress => addr,
@@ -236,23 +236,23 @@ class TestWEBrickHTTPServer < Test::Unit::TestCase
server.virtual_host(WEBrick::HTTPServer.new(vhost_config))
true while server.status != :Running
- assert_equal(started, 1, log.call)
- assert_equal(stopped, 0, log.call)
- assert_equal(accepted, 0, log.call)
+ assert_equal(started, 1)
+ assert_equal(stopped, 0)
+ assert_equal(accepted, 0)
http = Net::HTTP.new(addr, port)
req = Net::HTTP::Get.new("/")
req["Host"] = "myhostname:#{port}"
- http.request(req){|res| assert_equal("404", res.code, log.call)}
- http.request(req){|res| assert_equal("404", res.code, log.call)}
- http.request(req){|res| assert_equal("404", res.code, log.call)}
+ http.request(req){|res| assert_equal("404", res.code)}
+ http.request(req){|res| assert_equal("404", res.code)}
+ http.request(req){|res| assert_equal("404", res.code)}
req["Host"] = "localhost:#{port}"
- http.request(req){|res| assert_equal("404", res.code, log.call)}
- http.request(req){|res| assert_equal("404", res.code, log.call)}
- http.request(req){|res| assert_equal("404", res.code, log.call)}
- assert_equal(6, accepted, log.call)
- assert_equal(3, requested0, log.call)
- assert_equal(3, requested1, log.call)
+ http.request(req){|res| assert_equal("404", res.code)}
+ http.request(req){|res| assert_equal("404", res.code)}
+ http.request(req){|res| assert_equal("404", res.code)}
+ assert_equal(6, accepted)
+ assert_equal(3, requested0)
+ assert_equal(3, requested1)
}
assert_equal(started, 1)
assert_equal(stopped, 1)
diff --git a/test/webrick/test_httputils.rb b/test/webrick/test_httputils.rb
index ebe8a2b8a5..9d39ff53ab 100644
--- a/test/webrick/test_httputils.rb
+++ b/test/webrick/test_httputils.rb
@@ -30,24 +30,24 @@ class TestWEBrickHTTPUtils < Test::Unit::TestCase
assert_equal("/foo/bar/", normalize_path("//foo///.//bar/.///.//"))
assert_equal("/", normalize_path("//foo///..///bar/.///..//.//"))
- assert_raise(RuntimeError){ normalize_path("foo/bar") }
- assert_raise(RuntimeError){ normalize_path("..") }
- assert_raise(RuntimeError){ normalize_path("/..") }
- assert_raise(RuntimeError){ normalize_path("/./..") }
- assert_raise(RuntimeError){ normalize_path("/./../") }
- assert_raise(RuntimeError){ normalize_path("/./../..") }
- assert_raise(RuntimeError){ normalize_path("/./../../") }
- assert_raise(RuntimeError){ normalize_path("/./../") }
- assert_raise(RuntimeError){ normalize_path("/../..") }
- assert_raise(RuntimeError){ normalize_path("/../../") }
- assert_raise(RuntimeError){ normalize_path("/../../..") }
- assert_raise(RuntimeError){ normalize_path("/../../../") }
- assert_raise(RuntimeError){ normalize_path("/../foo/../") }
- assert_raise(RuntimeError){ normalize_path("/../foo/../../") }
- assert_raise(RuntimeError){ normalize_path("/foo/bar/../../../../") }
- assert_raise(RuntimeError){ normalize_path("/foo/../bar/../../") }
- assert_raise(RuntimeError){ normalize_path("/./../bar/") }
- assert_raise(RuntimeError){ normalize_path("/./../") }
+ assert_raises(RuntimeError){ normalize_path("foo/bar") }
+ assert_raises(RuntimeError){ normalize_path("..") }
+ assert_raises(RuntimeError){ normalize_path("/..") }
+ assert_raises(RuntimeError){ normalize_path("/./..") }
+ assert_raises(RuntimeError){ normalize_path("/./../") }
+ assert_raises(RuntimeError){ normalize_path("/./../..") }
+ assert_raises(RuntimeError){ normalize_path("/./../../") }
+ assert_raises(RuntimeError){ normalize_path("/./../") }
+ assert_raises(RuntimeError){ normalize_path("/../..") }
+ assert_raises(RuntimeError){ normalize_path("/../../") }
+ assert_raises(RuntimeError){ normalize_path("/../../..") }
+ assert_raises(RuntimeError){ normalize_path("/../../../") }
+ assert_raises(RuntimeError){ normalize_path("/../foo/../") }
+ assert_raises(RuntimeError){ normalize_path("/../foo/../../") }
+ assert_raises(RuntimeError){ normalize_path("/foo/bar/../../../../") }
+ assert_raises(RuntimeError){ normalize_path("/foo/../bar/../../") }
+ assert_raises(RuntimeError){ normalize_path("/./../bar/") }
+ assert_raises(RuntimeError){ normalize_path("/./../") }
end
def test_split_header_value
diff --git a/test/webrick/test_server.rb b/test/webrick/test_server.rb
index 4c064fdb4b..ce5ee85c6c 100644
--- a/test/webrick/test_server.rb
+++ b/test/webrick/test_server.rb
@@ -13,12 +13,12 @@ class TestWEBrickServer < Test::Unit::TestCase
end
def test_server
- TestWEBrick.start_server(Echo){|server, addr, port, log|
+ TestWEBrick.start_server(Echo){|server, addr, port|
TCPSocket.open(addr, port){|sock|
- sock.puts("foo"); assert_equal("foo\n", sock.gets, log.call)
- sock.puts("bar"); assert_equal("bar\n", sock.gets, log.call)
- sock.puts("baz"); assert_equal("baz\n", sock.gets, log.call)
- sock.puts("qux"); assert_equal("qux\n", sock.gets, log.call)
+ sock.puts("foo"); assert_equal("foo\n", sock.gets)
+ sock.puts("bar"); assert_equal("bar\n", sock.gets)
+ sock.puts("baz"); assert_equal("baz\n", sock.gets)
+ sock.puts("qux"); assert_equal("qux\n", sock.gets)
}
}
end
@@ -30,15 +30,15 @@ class TestWEBrickServer < Test::Unit::TestCase
:StartCallback => Proc.new{ started += 1 },
:StopCallback => Proc.new{ stopped += 1 },
}
- TestWEBrick.start_server(Echo, config){|server, addr, port, log|
+ TestWEBrick.start_server(Echo, config){|server, addr, port|
true while server.status != :Running
- assert_equal(started, 1, log.call)
- assert_equal(stopped, 0, log.call)
- assert_equal(accepted, 0, log.call)
+ assert_equal(started, 1)
+ assert_equal(stopped, 0)
+ assert_equal(accepted, 0)
TCPSocket.open(addr, port){|sock| (sock << "foo\n").gets }
TCPSocket.open(addr, port){|sock| (sock << "foo\n").gets }
TCPSocket.open(addr, port){|sock| (sock << "foo\n").gets }
- assert_equal(accepted, 3, log.call)
+ assert_equal(accepted, 3)
}
assert_equal(started, 1)
assert_equal(stopped, 1)
diff --git a/test/webrick/test_utils.rb b/test/webrick/test_utils.rb
deleted file mode 100644
index e63e0ebbfd..0000000000
--- a/test/webrick/test_utils.rb
+++ /dev/null
@@ -1,64 +0,0 @@
-require "test/unit"
-require "webrick/utils"
-
-class TestWEBrickUtils < Test::Unit::TestCase
- def assert_expired(flag, m)
- if m == WEBrick::Utils
- handler = WEBrick::Utils::TimeoutHandler.instance
- assert_equal(flag, handler.instance_eval{ @timeout_info.empty? })
- end
- end
-
- def do_test_timeout(m)
- ex = Class.new(StandardError)
-
- assert_equal(:foo, m.timeout(10){ :foo })
- assert_expired(true, m)
-
- i = 0
- assert_raise(Timeout::Error){
- m.timeout(2){
- assert_raise(Timeout::Error){ m.timeout(1){ i += 1; sleep } }
- assert_expired(false, m)
- i += 1
- sleep
- }
- }
- assert_equal(2, i)
- assert_expired(true, m)
-
- assert_raise(Timeout::Error){ m.timeout(0.1){ sleep } }
- assert_expired(true, m)
-
- assert_raise(ex){ m.timeout(0.1, ex){ sleep } }
- assert_expired(true, m)
-
- i = 0
- assert_raise(ex){
- m.timeout(10){
- m.timeout(1, ex){ i += 1; sleep }
- }
- sleep
- }
- assert_equal(1, i)
- assert_expired(true, m)
-
- i = 0
- assert_raise(Timeout::Error){
- m.timeout(1){
- m.timeout(10, ex){ i += 1; sleep }
- }
- sleep
- }
- assert_equal(1, i)
- assert_expired(true, m)
- end
-
- def test_webrick_timeout
- do_test_timeout(WEBrick::Utils)
- end
-
- #def test_timeout
- # do_test_timeout(Timeout)
- #end
-end
diff --git a/test/webrick/utils.rb b/test/webrick/utils.rb
index 82df9cde69..5db94e6cd5 100644
--- a/test/webrick/utils.rb
+++ b/test/webrick/utils.rb
@@ -27,30 +27,19 @@ module TestWEBrick
module_function
def start_server(klass, config={}, &block)
- log_string = ""
- logger = Object.new
- logger.instance_eval do
- define_singleton_method(:<<) {|msg| log_string << msg }
- end
- log = proc { "webrick log start:\n" + log_string.gsub(/^/, " ").chomp + "\nwebrick log end" }
server = klass.new({
:BindAddress => "127.0.0.1", :Port => 0,
- :ShutdownSocketWithoutClose =>true,
- :ServerType => Thread,
- :Logger => WEBrick::Log.new(logger),
- :AccessLog => [[logger, ""]]
+ :Logger => WEBrick::Log.new(NullWriter),
+ :AccessLog => [[NullWriter, ""]]
}.update(config))
begin
- server.start
+ thread = Thread.start{ server.start }
addr = server.listeners[0].addr
- block.yield([server, addr[3], addr[1], log])
+ block.call([server, addr[3], addr[1]])
ensure
- server.shutdown
- until server.status == :Stop
- sleep 0.1
- end
+ server.stop
+ thread.join
end
- log_string
end
def start_httpserver(config={}, &block)
diff --git a/test/win32ole/err_in_callback.rb b/test/win32ole/err_in_callback.rb
deleted file mode 100644
index fabb7bef0e..0000000000
--- a/test/win32ole/err_in_callback.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-require 'win32ole'
-db = WIN32OLE.new('ADODB.Connection')
-db.connectionString = "Driver={Microsoft Text Driver (*.txt; *.csv)};DefaultDir=.;"
-ev = WIN32OLE_EVENT.new(db)
-ev.on_event('WillConnect') {|*args|
- foo
-}
-db.open
-WIN32OLE_EVENT.message_loop
diff --git a/test/win32ole/orig_data.csv b/test/win32ole/orig_data.csv
deleted file mode 100644
index 3931c6ad1b..0000000000
--- a/test/win32ole/orig_data.csv
+++ /dev/null
@@ -1,5 +0,0 @@
-ID,VALUE
-1,"A"
-2,"B"
-3,"C"
-4,"B"
diff --git a/test/win32ole/test_err_in_callback.rb b/test/win32ole/test_err_in_callback.rb
deleted file mode 100644
index bbbab719d6..0000000000
--- a/test/win32ole/test_err_in_callback.rb
+++ /dev/null
@@ -1,44 +0,0 @@
-#
-# test Win32OLE avoids cfp consistency error when the exception raised
-# in WIN32OLE_EVENT handler block. [ruby-dev:35450]
-#
-
-begin
- require 'win32ole'
-rescue LoadError
-end
-require 'rbconfig'
-if defined?(WIN32OLE)
- require 'mkmf'
- require 'test/unit'
- class TestErrInCallBack < Test::Unit::TestCase
- def setup
- @ruby = nil
- if File.exist?("./" + CONFIG["RUBY_INSTALL_NAME"] + CONFIG["EXEEXT"])
- sep = File::ALT_SEPARATOR || "/"
- @ruby = "." + sep + CONFIG["RUBY_INSTALL_NAME"]
- @iopt = $:.map {|e|
- " -I " + e
- }.join("")
- @script = File.dirname(__FILE__) + "/err_in_callback.rb"
- end
- end
-
- def test_err_in_callback
- if @ruby
- cmd = "#{@ruby} -v #{@iopt} #{@script} > test_err_in_callback.log 2>&1"
- system(cmd)
- str = ""
- open("test_err_in_callback.log") {|ifs|
- str = ifs.read
- }
- assert_match(/NameError/, str)
- end
- end
-
- def teardown
- File.unlink("test_err_in_callback.log")
- end
-
- end
-end
diff --git a/test/win32ole/test_folderitem2_invokeverb.rb b/test/win32ole/test_folderitem2_invokeverb.rb
deleted file mode 100644
index 5a5d475059..0000000000
--- a/test/win32ole/test_folderitem2_invokeverb.rb
+++ /dev/null
@@ -1,89 +0,0 @@
-#
-# This script check that Win32OLE can execute InvokeVerb method of FolderItem2.
-#
-
-begin
- require 'win32ole'
-rescue LoadError
-end
-require 'test/unit'
-
-if defined?(WIN32OLE)
- class TestInvokeVerb < Test::Unit::TestCase
- def setup
- #
- # make dummy.txt file for InvokeVerb test.
- #
-
- @fso = WIN32OLE.new('Scripting.FileSystemObject')
- @dummy_file = @fso.GetTempName
- @cfolder = @fso.getFolder(".")
- f = @cfolder.CreateTextFile(@dummy_file)
- f.close
- @dummy_path = @cfolder.path + "\\" + @dummy_file
-
- @shell=WIN32OLE.new('Shell.Application')
- @nsp = @shell.NameSpace(@cfolder.path)
- @fi2 = @nsp.parseName(@dummy_file)
-
- @shortcut = nil
-
- #
- # Search the 'Create Shortcut (&S)' string in Japanese.
- # Yes, I know the string in the Windows 2000 Japanese Edition.
- # But I do not know about the string in any other Windows.
- #
- verbs = @fi2.verbs
- verbs.extend(Enumerable)
- @cp = WIN32OLE.codepage
- begin
- WIN32OLE.codepage = 932
- rescue
- end
- @shortcut = verbs.collect{|verb|
- verb.name
- }.find {|name|
- name.unpack("C*") == [131, 86, 131, 135, 129, 91, 131, 103, 131, 74, 131, 98, 131, 103, 130, 204, 141, 236, 144, 172, 40, 38, 83, 41]
- # /.*\(\&S\)$/ =~ name
- }
- end
-
- def find_link(path)
- arlink = []
- @cfolder.files.each do |f|
- if /\.lnk$/ =~ f.path
- linkinfo = @nsp.parseName(f.name).getLink
- arlink.push f if linkinfo.path == path
- end
- end
- arlink
- end
-
- def test_invokeverb
- links = find_link(@dummy_path)
- assert(0, links.size)
-
- assert(@shortcut)
-
- # Now create shortcut to @dummy_path
- arg = WIN32OLE_VARIANT.new(@shortcut)
- @fi2.InvokeVerb(arg)
-
- # Now search shortcut to @dummy_path
- links = find_link(@dummy_path)
- assert(1, links.size)
- @lpath = links[0].path
- end
-
- def teardown
- if @lpath
- @fso.deleteFile(@lpath)
- end
- if @dummy_path
- @fso.deleteFile(@dummy_path)
- end
- WIN32OLE.codepage = @cp
- end
-
- end
-end
diff --git a/test/win32ole/test_nil2vtempty.rb b/test/win32ole/test_nil2vtempty.rb
deleted file mode 100644
index 8508ecdf97..0000000000
--- a/test/win32ole/test_nil2vtempty.rb
+++ /dev/null
@@ -1,36 +0,0 @@
-# This is test script to check that WIN32OLE should convert nil to VT_EMPTY in second try.
-# [ruby-talk:137054]
-begin
- require 'win32ole'
-rescue LoadError
-end
-require 'test/unit'
-
-if defined?(WIN32OLE)
- class TestNIL2VT_EMPTY < Test::Unit::TestCase
- def setup
- fs = WIN32OLE.new('Scripting.FileSystemObject')
- @path = fs.GetFolder(".").path
- end
- def test_openSchema
- con = nil
- begin
- con = WIN32OLE.new('ADODB.Connection')
- con.connectionString = "Provider=MSDASQL;Extended Properties="
- con.connectionString +="\"DRIVER={Microsoft Text Driver (*.txt; *.csv)};DBQ=#{@path}\""
- con.open
- rescue
- con = nil
- end
- if con
- rs = con.openSchema(4, [nil,nil,"DUMMY", "TABLE"])
- assert(rs)
- assert_equal("_Recordset", rs.ole_type.name)
-
- rs = con.openSchema(4, [WIN32OLE_VARIANT::Empty, WIN32OLE_VARIANT::Empty, "DUMMY", "TABLE"])
- assert(rs)
- assert_equal("_Recordset", rs.ole_type.name)
- end
- end
- end
-end
diff --git a/test/win32ole/test_ole_methods.rb b/test/win32ole/test_ole_methods.rb
deleted file mode 100644
index 869828d22f..0000000000
--- a/test/win32ole/test_ole_methods.rb
+++ /dev/null
@@ -1,36 +0,0 @@
-#
-# This is test for [ruby-talk:196897]
-#
-begin
- require 'win32ole'
-rescue LoadError
-end
-require "test/unit"
-
-if defined?(WIN32OLE)
- class TestWIN32OLE_FOR_PROPERTYPUTREF < Test::Unit::TestCase
-
- def setup
- @obj = WIN32OLE.new('Scripting.Dictionary')
- end
-
- def test_ole_methods
- x = @obj.ole_methods.select {|m|
- m.invoke_kind == 'PROPERTYPUTREF'
- }
- assert(x.size > 0)
- assert_equal(1, x.size)
- assert_equal('Item', x[0].name)
- end
-
- def test_ole_put_methods
- x = @obj.ole_put_methods.select {|m|
- m.invoke_kind == 'PROPERTYPUTREF'
- }
- assert(x.size > 0)
- assert_equal(1, x.size)
- assert_equal('Item', x[0].name)
- end
-
- end
-end
diff --git a/test/win32ole/test_propertyputref.rb b/test/win32ole/test_propertyputref.rb
deleted file mode 100644
index 24459afe9b..0000000000
--- a/test/win32ole/test_propertyputref.rb
+++ /dev/null
@@ -1,30 +0,0 @@
-require 'test/unit'
-begin
- require 'win32ole'
-rescue LoadError
-end
-
-if defined?(WIN32OLE)
- class TestWIN32OLE_PROPERTYPUTREF < Test::Unit::TestCase
- def setup
- begin
- @sapi = WIN32OLE.new('SAPI.SpVoice')
- @sv = @sapi.voice
- rescue WIN32OLERuntimeError
- @sapi = nil
- end
- end
- def test_sapi
- if @sapi
- new_id = @sapi.getvoices.item(0).Id
- @sapi.voice = @sapi.getvoices.item(0)
- assert_equal(new_id, @sapi.voice.Id)
- end
- end
- def teardown
- if @sapi
- @sapi.voice = @sv
- end
- end
- end
-end
diff --git a/test/win32ole/test_win32ole.rb b/test/win32ole/test_win32ole.rb
deleted file mode 100644
index 8c8528fde3..0000000000
--- a/test/win32ole/test_win32ole.rb
+++ /dev/null
@@ -1,509 +0,0 @@
-#
-
-begin
- require 'win32ole'
-rescue LoadError
-end
-require 'test/unit'
-
-if defined?(WIN32OLE)
- module CONST1
- end
- module CONST2
- end
-
- module TestCaseForDict
- def test_convert_bignum
- @dict1.add("a", 9999999999)
- @dict1.add("b", 999999999)
- @dict1.add("c", @dict1.item("b") * 10 + 9)
- assert_equal(9999999999, @dict1.item("a"))
- assert_equal(9999999999, @dict1.item("c"))
- end
- def test_add
- @dict1.add("a", 1000)
- assert_equal(1000, @dict1.item("a"))
- end
- def test_setproperty_equal_ended
- @dict1.compareMode = 1
- @dict1.add("one", 1)
- assert_equal(1, @dict1.item("ONE"))
- @dict2.add("one", 1)
- assert_nil(@dict2.item("ONE"))
- assert_equal(1, @dict2.item("one"))
- end
- def test_non_exist_property
- assert_raise(WIN32OLERuntimeError) {
- @dict1.unknown_property = 1
- }
- end
-
- def test_raise_message
- exc = assert_raise(WIN32OLERuntimeError) {
- @dict1.add
- }
- assert_match(/^\(in OLE method `add': \)/, exc.message) #`
-
- exc = assert_raise(WIN32OLERuntimeError) {
- @dict1._invoke(1, [], [])
- }
- assert_match(/^\(in OLE method `<dispatch id:1>': \)/, exc.message) #`
-
- exc = assert_raise(WIN32OLERuntimeError) {
- @dict1.compareMode = -1
- }
- assert_match(/^\(in setting property `compareMode': \)/, exc.message) #`
- end
-
- def test_ole_methods
- methods = @dict1.ole_methods
- mnames = methods.collect {|m|
- m.name
- }
- assert(mnames.include?("Add"))
- end
-
- def test_ole_func_methods
- methods = @dict1.ole_func_methods
- mnames = methods.collect {|m|
- m.name
- }
- assert(mnames.include?("Add"))
- end
-
- def test_ole_put_methods
- methods = @dict1.ole_put_methods
- mnames = methods.collect {|m|
- m.name
- }
- assert(mnames.include?("CompareMode"))
- end
-
- def test_ole_get_methods
- methods = @dict1.ole_get_methods
- mnames = methods.collect {|m|
- m.name
- }
- assert(mnames.include?("Count"))
- end
-
- def test_ole_mehtod_help
- minfo = @dict1.ole_method_help("Add")
- assert_equal(2, minfo.size_params)
- end
-
- def test_ole_typelib
- tlib = @dict1.ole_typelib
- assert_equal("Microsoft Scripting Runtime", tlib.name);
- end
-
- def test_each
- @dict1.add("one", 1)
- @dict1.add("two", 2)
- i = 0
- @dict1.keys.each do |item|
- i += 1
- end
- assert_equal(2, i)
- end
-
- def test_bracket
- @dict1.add("foo", "FOO")
- assert_equal("FOO", @dict1.item("foo"))
- assert_equal("FOO", @dict1["foo"])
- end
-
- def test_bracket_equal
- @dict1.add("foo", "FOO")
- @dict1["foo"] = "BAR"
- assert_equal("BAR", @dict1["foo"])
- end
-
- def test_bracket_with_numkey
- @dict1.add(1, "ONE")
- @dict1.add(2, "two")
- assert_equal("ONE", @dict1[1])
- @dict1[2] = "TWO"
- assert_equal("TWO", @dict1[2])
- end
-
- def test_invoke_with_array
- @dict1.add("ary1", [1,2,3])
- assert_equal([1,2,3], @dict1["ary1"])
-
- @dict1.add("ary2", [[1,2,"a"], [3,4,"b"]])
- assert_equal([[1,2,"a"], [3,4,"b"]], @dict1["ary2"])
-
- @dict1.add("ary3", [[[1]]])
- assert_equal([[[1]]], @dict1["ary3"])
-
- @dict1.add("ary4", [[[1], [2], [3]], [[4], [5], [6]]])
- assert_equal([[[1],[2], [3]], [[4], [5], [6]]], @dict1["ary4"])
- end
- end
-
- class TestWin32OLE < Test::Unit::TestCase
- include TestCaseForDict
- def setup
- @dict1 = WIN32OLE.new('Scripting.Dictionary')
- @dict2 = WIN32OLE.new('Scripting.Dictionary')
- end
- def test_s_new
- assert_instance_of(WIN32OLE, @dict1)
- assert_instance_of(WIN32OLE, @dict2)
- end
-
- def test_s_new_exc
- assert_raise(TypeError) {
- WIN32OLE.new(1)
- }
- assert_raise(TypeError) {
- WIN32OLE.new("Scripting.Dictionary", 1)
- }
- end
-
- def test_s_new_DCOM
- rshell = WIN32OLE.new("Shell.Application")
- assert_instance_of(WIN32OLE, rshell)
- end
-
- def test_s_new_from_clsid
- shell = WIN32OLE.new("{13709620-C279-11CE-A49E-444553540000}")
- assert_instance_of(WIN32OLE, shell)
- exc = assert_raise(WIN32OLERuntimeError) {
- WIN32OLE.new("{000}")
- }
- assert_match(/unknown OLE server: `\{000\}'/, exc.message) #`
- end
-
- def test_s_connect
- obj = WIN32OLE.connect("winmgmts:")
- assert_instance_of(WIN32OLE, obj)
- end
-
- def test_s_connect_exc
- assert_raise(TypeError) {
- WIN32OLE.connect(1)
- }
- end
-
- def test_invoke_accept_symbol_hash_key
- fso = WIN32OLE.new('Scripting.FileSystemObject')
- afolder = fso.getFolder(".")
- bfolder = fso.getFolder({"FolderPath" => "."})
- cfolder = fso.getFolder({:FolderPath => "."})
- assert_equal(afolder.path, bfolder.path)
- assert_equal(afolder.path, cfolder.path)
- fso = nil
- end
-
- def test_setproperty
- installer = WIN32OLE.new("WindowsInstaller.Installer")
- record = installer.CreateRecord(2)
- # this is the way to set property with argument in Win32OLE.
- record.setproperty( "StringData", 1, 'dddd')
- assert_equal('dddd', record.StringData(1))
- end
-
- def test_ole_type
- fso = WIN32OLE.new('Scripting.FileSystemObject')
- tobj = fso.ole_type
- assert_match(/^IFileSystem/, tobj.name)
- end
-
- def test_ole_obj_help
- fso = WIN32OLE.new('Scripting.FileSystemObject')
- tobj = fso.ole_obj_help
- assert_match(/^IFileSystem/, tobj.name)
- end
-
-
- def test_invoke_hash_key_non_str_sym
- fso = WIN32OLE.new('Scripting.FileSystemObject')
- begin
- bfolder = fso.getFolder({1 => "."})
- assert(false)
- rescue TypeError
- assert(true)
- end
- fso = nil
- end
-
- def test_get_win32ole_object
- shell = WIN32OLE.new('Shell.Application')
- folder = shell.nameSpace(0)
- assert_instance_of(WIN32OLE, folder)
- end
-
- def test_invoke_accept_multi_hash_key
- shell = WIN32OLE.new('Shell.Application')
- folder = shell.nameSpace(0)
- item = folder.items.item(0)
- name = folder.getDetailsOf(item, 0)
- assert_equal(item.name, name)
- name = folder.getDetailsOf({:vItem => item, :iColumn => 0})
- assert_equal(item.name, name)
- name = folder.getDetailsOf({"vItem" => item, :iColumn => 0})
- assert_equal(item.name, name)
- end
-
- def test_ole_invoke_with_named_arg_last
- shell = WIN32OLE.new('Shell.Application')
- folder = shell.nameSpace(0)
- item = folder.items.item(0)
- name = folder.getDetailsOf(item, {:iColumn => 0})
- assert_equal(item.name, name)
- end
-
- def test__invoke
- shell=WIN32OLE.new('Shell.Application')
- assert_equal(shell.NameSpace(0).title, shell._invoke(0x60020002, [0], [WIN32OLE::VARIANT::VT_VARIANT]).title)
- end
-
- def test_ole_query_interface
- shell=WIN32OLE.new('Shell.Application')
- assert_raise(ArgumentError) {
- shell2 = shell.ole_query_interface
- }
- shell2 = shell.ole_query_interface('{A4C6892C-3BA9-11D2-9DEA-00C04FB16162}')
- assert_instance_of(WIN32OLE, shell2)
- end
-
- def test_ole_respond_to
- fso = WIN32OLE.new('Scripting.FileSystemObject')
- assert(fso.ole_respond_to?('getFolder'))
- assert(fso.ole_respond_to?('GETFOLDER'))
- assert(fso.ole_respond_to?(:getFolder))
- assert(!fso.ole_respond_to?('XXXXX'))
- assert_raise(TypeError) {
- assert_raise(fso.ole_respond_to?(1))
- }
- end
-
- def test_invoke
- fso = WIN32OLE.new('Scripting.FileSystemObject')
- assert(fso.invoke(:getFolder, "."))
- assert(fso.invoke('getFolder', "."))
- end
-
- def test_s_const_load
- assert(!defined?(CONST1::SsfWINDOWS))
- shell=WIN32OLE.new('Shell.Application')
- WIN32OLE.const_load(shell, CONST1)
- assert_equal(36, CONST1::SsfWINDOWS)
-
- assert(!defined?(CONST2::SsfWINDOWS))
- WIN32OLE.const_load("Microsoft Shell Controls And Automation", CONST2)
- assert_equal(36, CONST2::SsfWINDOWS)
- end
-
- def test_s_create_guid
- guid = WIN32OLE.create_guid
- assert_match(/^\{[A-Z0-9]{8}\-[A-Z0-9]{4}\-[A-Z0-9]{4}\-[A-Z0-9]{4}\-[A-Z0-9]{12}/,
- guid)
- end
-
- #
- # WIN32OLE.codepage is initialized according to Encoding.default_external.
- #
- # def test_s_codepage
- # assert_equal(WIN32OLE::CP_ACP, WIN32OLE.codepage)
- # end
-
- def test_s_codepage_set
- cp = WIN32OLE.codepage
- WIN32OLE.codepage = WIN32OLE::CP_UTF8
- assert_equal(WIN32OLE::CP_UTF8, WIN32OLE.codepage)
- WIN32OLE.codepage = cp
- end
-
- def test_s_codepage_changed
- cp = WIN32OLE.codepage
- fso = WIN32OLE.new("Scripting.FileSystemObject")
- fname = fso.getTempName
- begin
- obj = WIN32OLE_VARIANT.new([0x3042].pack("U*").force_encoding("UTF-8"))
- WIN32OLE.codepage = WIN32OLE::CP_UTF8
- assert_equal("\xE3\x81\x82".force_encoding("CP65001"), obj.value)
-
- begin
- WIN32OLE.codepage = 932 # Windows-31J
- rescue WIN32OLERuntimeError
- end
- if (WIN32OLE.codepage == 932)
- assert_equal("\x82\xA0".force_encoding("CP932"), obj.value)
- end
-
- begin
- WIN32OLE.codepage = 20932 # MS EUC-JP
- rescue WIN32OLERuntimeError
- end
- if (WIN32OLE.codepage == 20932)
- assert_equal("\xA4\xA2".force_encoding("CP20932"), obj.value)
- end
-
- WIN32OLE.codepage = cp
- file = fso.opentextfile(fname, 2, true)
- begin
- file.write [0x3042].pack("U*").force_encoding("UTF-8")
- ensure
- file.close
- end
- str = ""
- open(fname, "r:ascii-8bit") {|ifs|
- str = ifs.read
- }
- assert_equal("\202\240", str)
-
- # This test fail if codepage 20932 (euc) is not installed.
- begin
- WIN32OLE.codepage = 20932
- rescue WIN32OLERuntimeError
- end
- if (WIN32OLE.codepage == 20932)
- WIN32OLE.codepage = cp
- file = fso.opentextfile(fname, 2, true)
- begin
- file.write [164, 162].pack("c*").force_encoding("EUC-JP")
- ensure
- file.close
- end
- open(fname, "r:ascii-8bit") {|ifs|
- str = ifs.read
- }
- assert_equal("\202\240", str)
- end
-
- ensure
- WIN32OLE.codepage = cp
- if (File.exist?(fname))
- File.unlink(fname)
- end
- end
- end
-
- def test_cp51932
- cp = WIN32OLE.codepage
- begin
- obj = WIN32OLE_VARIANT.new([0x3042].pack("U*").force_encoding("UTF-8"))
- begin
- WIN32OLE.codepage = 51932
- rescue
- end
- if WIN32OLE.codepage == 51932
- assert_equal("\xA4\xA2".force_encoding("CP51932"), obj.value)
- end
- ensure
- WIN32OLE.codepage = cp
- end
- end
-
- def test_s_locale
- assert_equal(WIN32OLE::LOCALE_SYSTEM_DEFAULT, WIN32OLE.locale)
- end
-
- def test_s_locale_set
- begin
- begin
- WIN32OLE.locale = 1041
- rescue WIN32OLERuntimeError
- STDERR.puts("\n#{__FILE__}:#{__LINE__}:#{self.class.name}.test_s_locale_set is skipped(Japanese locale is not installed)")
- return
- end
- assert_equal(1041, WIN32OLE.locale)
- WIN32OLE.locale = WIN32OLE::LOCALE_SYSTEM_DEFAULT
- assert_raise(WIN32OLERuntimeError) {
- WIN32OLE.locale = 111
- }
- assert_equal(WIN32OLE::LOCALE_SYSTEM_DEFAULT, WIN32OLE.locale)
- ensure
- WIN32OLE.locale = WIN32OLE::LOCALE_SYSTEM_DEFAULT
- end
- end
-
- def test_s_locale_change
- begin
- begin
- WIN32OLE.locale = 0x0411
- rescue WIN32OLERuntimeError
- end
- if WIN32OLE.locale == 0x0411
- obj = WIN32OLE_VARIANT.new("\\100,000", WIN32OLE::VARIANT::VT_CY)
- assert_equal("100000", obj.value)
- assert_raise(WIN32OLERuntimeError) {
- obj = WIN32OLE_VARIANT.new("$100.000", WIN32OLE::VARIANT::VT_CY)
- }
- else
- STDERR.puts("\n#{__FILE__}:#{__LINE__}:#{self.class.name}.test_s_locale_change is skipped(Japanese locale is not installed)")
- end
-
- begin
- WIN32OLE.locale = 1033
- rescue WIN32OLERuntimeError
- end
- if WIN32OLE.locale == 1033
- obj = WIN32OLE_VARIANT.new("$100,000", WIN32OLE::VARIANT::VT_CY)
- assert_equal("100000", obj.value)
- else
- STDERR.puts("\n#{__FILE__}:#{__LINE__}:#{self.class.name}.test_s_locale_change is skipped(US English locale is not installed)")
- end
- ensure
- WIN32OLE.locale = WIN32OLE::LOCALE_SYSTEM_DEFAULT
- end
- end
-
- def test_const_CP_ACP
- assert_equal(0, WIN32OLE::CP_ACP)
- end
-
- def test_const_CP_OEMCP
- assert_equal(1, WIN32OLE::CP_OEMCP)
- end
-
- def test_const_CP_MACCP
- assert_equal(2, WIN32OLE::CP_MACCP)
- end
-
- def test_const_CP_THREAD_ACP
- assert_equal(3, WIN32OLE::CP_THREAD_ACP)
- end
-
- def test_const_CP_SYMBOL
- assert_equal(42, WIN32OLE::CP_SYMBOL)
- end
-
- def test_const_CP_UTF7
- assert_equal(65000, WIN32OLE::CP_UTF7)
- end
-
- def test_const_CP_UTF8
- assert_equal(65001, WIN32OLE::CP_UTF8)
- end
-
- def test_const_LOCALE_SYSTEM_DEFAULT
- assert_equal(0x0800, WIN32OLE::LOCALE_SYSTEM_DEFAULT);
- end
-
- def test_const_LOCALE_USER_DEFAULT
- assert_equal(0x0400, WIN32OLE::LOCALE_USER_DEFAULT);
- end
- end
-
- # test of subclass of WIN32OLE
- class MyDict < WIN32OLE
- def MyDict.new
- super('Scripting.Dictionary')
- end
- end
- class TestMyDict < Test::Unit::TestCase
- include TestCaseForDict
- def setup
- @dict1 = MyDict.new
- @dict2 = MyDict.new
- end
- def test_s_new
- assert_instance_of(MyDict, @dict1)
- assert_instance_of(MyDict, @dict2)
- end
- end
-end
diff --git a/test/win32ole/test_win32ole_event.rb b/test/win32ole/test_win32ole_event.rb
deleted file mode 100644
index 7e7ee10222..0000000000
--- a/test/win32ole/test_win32ole_event.rb
+++ /dev/null
@@ -1,334 +0,0 @@
-begin
- require 'win32ole'
-rescue LoadError
-end
-require 'test/unit'
-
-def ado_installed?
- installed = false
- if defined?(WIN32OLE)
- db = nil
- begin
- db = WIN32OLE.new('ADODB.Connection')
- db.connectionString = "Driver={Microsoft Text Driver (*.txt; *.csv)};DefaultDir=.;"
- db.open
- db.close
- db = nil
- installed = true
- rescue
- end
- end
- installed
-end
-
-if defined?(WIN32OLE_EVENT)
- dotest = ado_installed?
- if !dotest
- STDERR.puts("\n#{__FILE__} skipped(ActiveX Data Object Library not found.)")
- end
- if dotest
- class TestWIN32OLE_EVENT < Test::Unit::TestCase
- CONNSTR="Driver={Microsoft Text Driver (*.txt; *.csv)};DefaultDir=.;"
- module ADO
- end
- def message_loop
- WIN32OLE_EVENT.message_loop
- end
-
- def default_handler(event, *args)
- @event += event
- end
-
- def setup
- @db = WIN32OLE.new('ADODB.Connection')
- if !defined?(ADO::AdStateOpen)
- WIN32OLE.const_load(@db, ADO)
- end
- @db.connectionString = CONNSTR
- @event = ""
- @event2 = ""
- @event3 = ""
- end
-
- def test_s_new
- assert_raise(TypeError) {
- ev = WIN32OLE_EVENT.new("A")
- }
- end
-
- def test_s_new_without_itf
- ev = WIN32OLE_EVENT.new(@db)
- ev.on_event {|*args| default_handler(*args)}
- @db.open
- @db.close
- 10.times do |i|
- WIN32OLE_EVENT.new(@db)
- GC.start
- message_loop
- @db.open
- message_loop
- @db.close
- end
- assert_match(/WillConnect/, @event)
- end
-
- def test_on_event
- ev = WIN32OLE_EVENT.new(@db, 'ConnectionEvents')
- ev.on_event {|*args| default_handler(*args)}
- @db.open
- message_loop
- assert_match(/WillConnect/, @event)
- end
-
- def test_on_event_symbol
- ev = WIN32OLE_EVENT.new(@db)
- ev.on_event(:WillConnect) {|*args|
- handler1
- }
- @db.open
- message_loop
- assert_equal("handler1", @event2)
- end
-
- def test_on_event2
- ev = WIN32OLE_EVENT.new(@db, 'ConnectionEvents')
- ev.on_event('WillConnect') {|*args| handler1}
- ev.on_event('WillConnect') {|*args| handler2}
- @db.open
- message_loop
- assert_equal("handler2", @event2)
- end
-
- def test_on_event3
- ev = WIN32OLE_EVENT.new(@db, 'ConnectionEvents')
- ev.on_event('WillConnect') {|*args| handler1}
- ev.on_event('WillConnect') {|*args| handler2}
- @db.open
- message_loop
- assert_equal("handler2", @event2)
- end
-
- def test_on_event4
- ev = WIN32OLE_EVENT.new(@db, 'ConnectionEvents')
- ev.on_event{|*args| handler1}
- ev.on_event{|*args| handler2}
- ev.on_event('WillConnect'){|*args| handler3(*args)}
- @db.open
- message_loop
- assert_equal(CONNSTR, @event3)
- assert("handler2", @event2)
- end
-
- def test_on_event5
- ev = WIN32OLE_EVENT.new(@db, 'ConnectionEvents')
- ev.on_event {|*args| default_handler(*args)}
- ev.on_event('WillConnect'){|*args| handler3(*args)}
- @db.open
- message_loop
- assert_match(/ConnectComplete/, @event)
- assert(/WillConnect/ !~ @event)
- assert_equal(CONNSTR, @event3)
- end
-
- def test_unadvise
- ev = WIN32OLE_EVENT.new(@db, 'ConnectionEvents')
- ev.on_event {|*args| default_handler(*args)}
- @db.open
- message_loop
- assert_match(/WillConnect/, @event)
- ev.unadvise
- @event = ""
- @db.close
- @db.open
- message_loop
- assert_equal("", @event);
- assert_raise(WIN32OLERuntimeError) {
- ev.on_event {|*args| default_handler(*args)}
- }
- end
-
- def test_non_exist_event
- assert_raise(RuntimeError) {
- ev = WIN32OLE_EVENT.new(@db, 'XXXX')
- }
- dict = WIN32OLE.new('Scripting.Dictionary')
- assert_raise(RuntimeError) {
- ev = WIN32OLE_EVENT.new(dict)
- }
- end
-
- def test_on_event_with_outargs
- ev = WIN32OLE_EVENT.new(@db)
- @db.connectionString = 'XXX' # set illegal connection string
- assert_raise(WIN32OLERuntimeError) {
- @db.open
- }
- ev.on_event_with_outargs('WillConnect'){|*args|
- args.last[0] = CONNSTR # ConnectionString = CONNSTR
- }
- @db.open
- message_loop
- assert(true)
- end
-
- def test_on_event_hash_return
- ev = WIN32OLE_EVENT.new(@db)
- ev.on_event('WillConnect'){|*args|
- {:return => 1, :ConnectionString => CONNSTR}
- }
- @db.connectionString = 'XXX'
- @db.open
- assert(true)
- end
-
- def test_on_event_hash_return2
- ev = WIN32OLE_EVENT.new(@db)
- ev.on_event('WillConnect'){|*args|
- {:ConnectionString => CONNSTR}
- }
- @db.connectionString = 'XXX'
- @db.open
- assert(true)
- end
-
- def test_on_event_hash_return3
- ev = WIN32OLE_EVENT.new(@db)
- ev.on_event('WillConnect'){|*args|
- {'ConnectionString' => CONNSTR}
- }
- @db.connectionString = 'XXX'
- @db.open
- assert(true)
- end
-
- def test_on_event_hash_return4
- ev = WIN32OLE_EVENT.new(@db)
- ev.on_event('WillConnect'){|*args|
- {'return' => 1, 'ConnectionString' => CONNSTR}
- }
- @db.connectionString = 'XXX'
- @db.open
- assert(true)
- end
-
- def test_on_event_hash_return5
- ev = WIN32OLE_EVENT.new(@db)
- ev.on_event('WillConnect'){|*args|
- {0 => CONNSTR}
- }
- @db.connectionString = 'XXX'
- @db.open
- assert(true)
- end
-
- def test_off_event
- ev = WIN32OLE_EVENT.new(@db)
- ev.on_event{handler1}
- ev.off_event
- @db.open
- message_loop
- assert_equal("", @event2)
- end
-
- def test_off_event_arg
- ev = WIN32OLE_EVENT.new(@db)
- ev.on_event('WillConnect'){handler1}
- ev.off_event('WillConnect')
- @db.open
- message_loop
- assert_equal("", @event2)
- end
-
- def test_off_event_arg2
- ev = WIN32OLE_EVENT.new(@db)
- ev.on_event('WillConnect'){handler1}
- ev.on_event('ConnectComplete'){handler1}
- ev.off_event('WillConnect')
- @db.open
- message_loop
- assert_equal("handler1", @event2)
- end
-
- def test_off_event_sym_arg
- ev = WIN32OLE_EVENT.new(@db)
- ev.on_event('WillConnect'){handler1}
- ev.off_event(:WillConnect)
- @db.open
- message_loop
- assert_equal("", @event2)
- end
-
- def handler1
- @event2 = "handler1"
- end
-
- def handler2
- @event2 = "handler2"
- end
-
- def handler3(*arg)
- @event3 += arg[0]
- end
-
- def teardown
- if @db && @db.state == ADO::AdStateOpen
- @db.close
- end
- message_loop
- @db = nil
- end
-
- class Handler1
- attr_reader :val1, :val2, :val3, :val4
- def initialize
- @val1 = nil
- @val2 = nil
- @val3 = nil
- @val4 = nil
- end
- def onWillConnect(conn, uid, pwd, opts, stat, pconn)
- @val1 = conn
- end
- def onConnectComplete(err, stat, pconn)
- @val2 = err
- @val3 = stat
- end
- def onInfoMessage(err, stat, pconn)
- @val4 = stat
- end
- end
-
- class Handler2
- attr_reader :ev
- def initialize
- @ev = ""
- end
- def method_missing(ev, *arg)
- @ev += ev
- end
- end
-
- def test_handler1
- ev = WIN32OLE_EVENT.new(@db)
- h1 = Handler1.new
- ev.handler = h1
- @db.open
- message_loop
- assert_equal(CONNSTR, h1.val1)
- assert_equal(h1.val1, ev.handler.val1)
- assert_equal(nil, h1.val2)
- assert_equal(ADO::AdStateOpen, h1.val3)
- assert_equal(ADO::AdStateOpen, h1.val4)
- end
-
- def test_handler2
- ev = WIN32OLE_EVENT.new(@db)
- h2 = Handler2.new
- ev.handler = h2
- @db.open
- message_loop
- assert(h2.ev != "")
- end
- end
- end
-end
diff --git a/test/win32ole/test_win32ole_method.rb b/test/win32ole/test_win32ole_method.rb
deleted file mode 100644
index 762ef1d795..0000000000
--- a/test/win32ole/test_win32ole_method.rb
+++ /dev/null
@@ -1,141 +0,0 @@
-begin
- require 'win32ole'
-rescue LoadError
-end
-require "test/unit"
-
-if defined?(WIN32OLE_METHOD)
- class TestWIN32OLE_METHOD < Test::Unit::TestCase
-
- def setup
- ole_type = WIN32OLE_TYPE.new("Microsoft Shell Controls And Automation", "Shell")
- @m_open = WIN32OLE_METHOD.new(ole_type, "open")
- @m_namespace = WIN32OLE_METHOD.new(ole_type, "namespace")
- @m_parent = WIN32OLE_METHOD.new(ole_type, "parent")
- @m_invoke = WIN32OLE_METHOD.new(ole_type, "invoke")
- @m_browse_for_folder = WIN32OLE_METHOD.new(ole_type, "BrowseForFolder")
-
- ole_type = WIN32OLE_TYPE.new("Microsoft Scripting Runtime", "File")
- @m_file_name = WIN32OLE_METHOD.new(ole_type, "name")
-
- ole_type = WIN32OLE_TYPE.new("Microsoft Internet Controls", "WebBrowser")
- @m_navigate_complete = WIN32OLE_METHOD.new(ole_type, "NavigateComplete")
- end
-
- def test_initialize
- ole_type = WIN32OLE_TYPE.new("Microsoft Shell Controls And Automation", "Shell")
- assert_raise(TypeError) {
- WIN32OLE_METHOD.new(1, 2)
- }
- assert_raise(ArgumentError) {
- method = WIN32OLE_METHOD.new("foo")
- }
- assert_raise(ArgumentError) {
- method = WIN32OLE_METHOD.new(ole_type)
- }
- assert_raise(WIN32OLERuntimeError) {
- method = WIN32OLE_METHOD.new(ole_type, "NonExistMethod")
- }
- assert_raise(TypeError) {
- method = WIN32OLE_METHOD.new(ole_type, 1)
- }
- method = WIN32OLE_METHOD.new(ole_type, "Open")
- assert_instance_of(WIN32OLE_METHOD, method)
- method = WIN32OLE_METHOD.new(ole_type, "open")
- assert_instance_of(WIN32OLE_METHOD, method)
- end
-
- def test_name
- assert_equal("Open", @m_open.name)
- end
-
- def test_return_type
- assert_equal("VOID", @m_open.return_type)
- assert_equal("Folder", @m_namespace.return_type)
- end
-
- def test_return_vtype
- assert_equal(24, @m_open.return_vtype)
- assert_equal(26, @m_namespace.return_vtype)
- end
-
- def test_return_type_detail
- assert_equal(['VOID'], @m_open.return_type_detail)
- assert_equal(['PTR', 'USERDEFINED', 'Folder'], @m_namespace.return_type_detail)
- end
-
- def test_invoke_kind
- assert_equal('FUNC', @m_open.invoke_kind)
- assert_equal('FUNC', @m_namespace.invoke_kind)
- assert_equal('PROPERTYGET', @m_parent.invoke_kind)
- end
-
- def test_invkind
- assert_equal(1, @m_namespace.invkind)
- assert_equal(2, @m_parent.invkind)
- end
-
- def test_visible?
- assert(@m_namespace.visible?)
- assert(!@m_invoke.visible?)
- end
-
- def test_event?
- assert(@m_navigate_complete.event?)
- assert(!@m_namespace.event?)
- end
-
- def test_event_interface
- assert_equal("DWebBrowserEvents", @m_navigate_complete.event_interface)
- assert_equal(nil, @m_namespace.event_interface)
- end
-
- def test_helpstring
- assert_equal("Get special folder from ShellSpecialFolderConstants", @m_namespace.helpstring)
- end
-
- def test_helpfile
- assert_equal("", @m_namespace.helpfile)
- assert_match(/VBENLR.*\.CHM$/i, @m_file_name.helpfile)
- end
-
- def test_helpcontext
- assert_equal(0, @m_namespace.helpcontext)
- assert_equal(2181996, @m_file_name.helpcontext)
- end
-
- def test_dispid
- assert_equal(1610743810, @m_namespace.dispid)
- end
-
- def test_offset_vtbl
- assert_equal(24, @m_invoke.offset_vtbl)
- end
-
- def test_size_params
- assert_equal(1, @m_open.size_params)
- assert_equal(4, @m_browse_for_folder.size_params)
- end
-
- def test_size_opt_params
- assert_equal(0, @m_open.size_opt_params)
- assert_equal(1, @m_browse_for_folder.size_opt_params)
- end
-
- def test_params
- params = @m_browse_for_folder.params
- assert_instance_of(Array, params)
- assert_equal(4, params.size)
- assert_instance_of(WIN32OLE_PARAM, params[0])
- end
-
- def test_to_s
- assert_equal(@m_namespace.name, @m_namespace.to_s)
- end
-
- def test_inspect
- assert_equal("#<WIN32OLE_METHOD:NameSpace>", @m_namespace.inspect)
- end
-
- end
-end
diff --git a/test/win32ole/test_win32ole_param.rb b/test/win32ole/test_win32ole_param.rb
deleted file mode 100644
index 3b831c3937..0000000000
--- a/test/win32ole/test_win32ole_param.rb
+++ /dev/null
@@ -1,91 +0,0 @@
-begin
- require 'win32ole'
-rescue LoadError
-end
-require "test/unit"
-
-if defined?(WIN32OLE_PARAM)
- class TestWIN32OLE_PARAM < Test::Unit::TestCase
-
- def setup
- ole_type = WIN32OLE_TYPE.new("Microsoft Internet Controls", "WebBrowser")
- m_navigate = WIN32OLE_METHOD.new(ole_type, "Navigate")
- m_before_navigate = WIN32OLE_METHOD.new(ole_type, "BeforeNavigate")
- params = m_navigate.params
- @param_url = params[0]
- @param_flags = params[1]
- @param_cancel = m_before_navigate.params[5]
-
- ole_type = WIN32OLE_TYPE.new("Microsoft Shell Controls And Automation", "ShellLinkObject")
- m_geticonlocation = WIN32OLE_METHOD.new(ole_type, "GetIconLocation")
- @param_pbs = m_geticonlocation.params[0]
-
- ole_type = WIN32OLE_TYPE.new("Microsoft HTML Object Library", "FontNames")
- m_count = WIN32OLE_METHOD.new(ole_type, "Count")
- @param_p = m_count.params[0]
-
- ole_type = WIN32OLE_TYPE.new("Microsoft Scripting Runtime", "FileSystemObject")
- m_copyfile = WIN32OLE_METHOD.new(ole_type, "CopyFile")
- @param_overwritefiles = m_copyfile.params[2]
- end
-
- def test_s_new
- assert_raise(ArgumentError) {
- WIN32OLE_PARAM.new("hoge")
- }
- end
-
-
- def test_name
- assert_equal('URL', @param_url.name)
- assert_equal('Flags', @param_flags.name)
- assert_equal('Cancel', @param_cancel.name)
- end
-
- def test_ole_type
- assert_equal('BSTR', @param_url.ole_type)
- assert_equal('VARIANT', @param_flags.ole_type)
- end
-
- def test_ole_type_detail
- assert_equal(['BSTR'], @param_url.ole_type_detail)
- assert_equal(['PTR', 'VARIANT'], @param_flags.ole_type_detail)
- end
-
- def test_input?
- assert(@param_url.input?)
- assert(@param_cancel.input?)
- assert(!@param_pbs.input?)
- end
-
- def test_output?
- assert(!@param_url.output?)
- assert(@param_cancel.output?)
- assert(@param_pbs.output?)
- end
-
- def test_optional?
- assert(!@param_url.optional?)
- assert(@param_flags.optional?)
- end
-
- def test_retval?
- assert(!@param_url.retval?)
- assert(@param_p.retval?)
- end
-
- def test_default
- assert_equal(nil, @param_url.default)
- assert_equal(true, @param_overwritefiles.default)
- end
-
- def test_to_s
- assert_equal(@param_url.name, @param_url.to_s)
- end
-
- def test_inspect
- assert_equal("#<WIN32OLE_PARAM:URL>", @param_url.inspect)
- assert_equal("#<WIN32OLE_PARAM:OverWriteFiles=true>", @param_overwritefiles.inspect)
- end
- end
-end
diff --git a/test/win32ole/test_win32ole_type.rb b/test/win32ole/test_win32ole_type.rb
deleted file mode 100644
index 8ecf2b2c27..0000000000
--- a/test/win32ole/test_win32ole_type.rb
+++ /dev/null
@@ -1,249 +0,0 @@
-begin
- require 'win32ole'
-rescue LoadError
-end
-require "test/unit"
-
-if defined?(WIN32OLE_TYPE)
- class TestWIN32OLE_TYPE < Test::Unit::TestCase
-
- def test_s_progids
- progids = WIN32OLE_TYPE.progids
- assert_instance_of(Array, progids)
- assert(progids.size > 0)
- assert_instance_of(String, progids[0])
- assert(progids.include?("Shell.Application.1"))
- end
-
- def test_initialize
- assert_raise(ArgumentError) {
- WIN32OLE_TYPE.new
- }
- assert_raise(ArgumentError) {
- WIN32OLE_TYPE.new("foo")
- }
- assert_raise(TypeError) {
- WIN32OLE_TYPE.new(1, 2)
- }
- assert_raise(TypeError) {
- WIN32OLE_TYPE.new("Microsoft Shell Controls And Automation", 1)
- }
- assert_raise(WIN32OLERuntimeError) {
- WIN32OLE_TYPE.new("Microsoft Shell Controls And Automation", "foo")
- }
- assert_raise(WIN32OLERuntimeError) {
- WIN32OLE_TYPE.new("Microsoft Shell Controls And Automation", "Application")
- }
- ole_type = WIN32OLE_TYPE.new("Microsoft Shell Controls And Automation", "Shell")
- assert_instance_of(WIN32OLE_TYPE, ole_type)
- assert_equal("Shell", ole_type.name)
- assert_equal("Class", ole_type.ole_type)
- assert_equal("{13709620-C279-11CE-A49E-444553540000}", ole_type.guid)
- assert_equal("Shell.Application.1", ole_type.progid)
- assert_equal(true, ole_type.visible?)
- assert_equal("Shell", ole_type.to_s)
- assert_equal(0, ole_type.major_version)
- assert_equal(0, ole_type.minor_version)
- assert_equal(5, ole_type.typekind)
- assert_equal("Shell Object Type Information", ole_type.helpstring)
- assert_equal(nil, ole_type.src_type)
- assert_equal("", ole_type.helpfile)
- assert_equal(0, ole_type.helpcontext)
- assert_equal([], ole_type.variables)
- assert(ole_type.ole_methods.select{|m|/NameSpace/i =~ m.name}.size > 0)
-
- ole_type2 = WIN32OLE_TYPE.new("{13709620-C279-11CE-A49E-444553540000}", "Shell")
- assert_instance_of(WIN32OLE_TYPE, ole_type)
- assert_equal(ole_type.name, ole_type2.name)
- assert_equal(ole_type.ole_type, ole_type2.ole_type)
- assert_equal(ole_type.guid, ole_type2.guid)
- assert_equal(ole_type.progid, ole_type2.progid)
- assert_equal(ole_type.visible?, ole_type2.visible?)
- assert_equal(ole_type.to_s, ole_type2.to_s)
- assert_equal(ole_type.major_version, ole_type2.major_version)
- assert_equal(ole_type.minor_version, ole_type2.minor_version)
- assert_equal(ole_type.typekind, ole_type2.typekind)
- assert_equal(ole_type.helpstring, ole_type2.helpstring)
- assert_equal(ole_type.src_type, ole_type2.src_type)
- assert_equal(ole_type.helpfile, ole_type2.helpfile)
- assert_equal(ole_type.helpcontext, ole_type2.helpcontext)
- assert_equal(ole_type.variables.size, ole_type2.variables.size)
- assert_equal(ole_type.ole_methods[0].name, ole_type2.ole_methods[0].name)
- assert_equal(ole_type.ole_typelib.name, ole_type2.ole_typelib.name)
- assert_equal(ole_type.implemented_ole_types.size, ole_type2.implemented_ole_types.size)
- assert_equal(ole_type.inspect, ole_type2.inspect)
- end
-
- def setup
- @ole_type = WIN32OLE_TYPE.new("Microsoft Shell Controls And Automation", "Shell")
- end
-
- def test_name
- assert_equal("Shell", @ole_type.name)
- end
-
- def test_ole_type
- assert_equal("Class", @ole_type.ole_type)
- end
-
- def test_guid
- assert_equal("{13709620-C279-11CE-A49E-444553540000}", @ole_type.guid)
- end
-
- def test_progid
- assert_equal("Shell.Application.1", @ole_type.progid)
- end
-
- def test_visible?
- assert(@ole_type.visible?)
- ole_type = WIN32OLE_TYPE.new("Microsoft Shell Controls And Automation", "IShellDispatch")
- assert(!ole_type.visible?)
- end
-
- def test_to_s
- assert_equal(@ole_type.to_s, @ole_type.name)
- end
-
- def test_major_version
- assert_equal(0, @ole_type.major_version)
- # ole_type = WIN32OLE_TYPE.new("Microsoft Word 11.0 Object Library", "Documents")
- # assert_equal(8, ole_type.major_version)
- end
-
- def test_minor_version
- assert_equal(0, @ole_type.minor_version)
- # ole_type = WIN32OLE_TYPE.new("Microsoft Word 11.0 Object Library", "Documents")
- # assert_equal(3, ole_type.minor_version)
- end
-
- def test_typekind
- assert_equal(5, @ole_type.typekind)
- end
-
- def test_helpstring
- assert_equal("Shell Object Type Information", @ole_type.helpstring)
- end
-
- def test_src_type
- ole_type = WIN32OLE_TYPE.new("Microsoft Scripting Runtime", "DriveTypeConst")
- assert_match(/__MIDL___MIDL_itf_scrrun_/, ole_type.src_type)
- assert_equal(nil, @ole_type.src_type)
- end
-
- def test_helpfile
- assert_equal("", @ole_type.helpfile)
- ole_type = WIN32OLE_TYPE.new("Microsoft Scripting Runtime", "Folders")
- assert_match(/VBENLR98\.CHM$/i, ole_type.helpfile)
- end
-
- def test_helpcontext
- assert_equal(0, @ole_type.helpcontext)
- ole_type = WIN32OLE_TYPE.new("Microsoft Scripting Runtime", "Folders")
- assert_equal(2181929, ole_type.helpcontext)
- end
-
- def test_variables
- variables = @ole_type.variables
- assert_instance_of(Array, variables)
- assert(variables.size == 0)
-
- ole_type = WIN32OLE_TYPE.new("Microsoft Shell Controls And Automation", "ShellSpecialFolderConstants")
- variables = ole_type.variables
- assert_instance_of(Array, variables)
- assert(variables.size > 0)
-
- assert_instance_of(WIN32OLE_VARIABLE, variables[0])
- end
-
- def test_ole_methods
- methods = @ole_type.ole_methods
- assert_instance_of(Array, methods)
- assert(methods.size > 0)
- assert_instance_of(WIN32OLE_METHOD, methods[0]);
- assert(methods.collect{|m| m.name}.include?("Application"))
- end
-
- def test_ole_typelib
- tlib = @ole_type.ole_typelib
- assert_instance_of(WIN32OLE_TYPELIB, tlib)
- assert_equal("Microsoft Shell Controls And Automation", tlib.name)
- end
-
- def test_implemented_ole_types
- ole_types = @ole_type.implemented_ole_types
- assert_instance_of(Array, ole_types)
- assert_equal(1, ole_types.size)
- assert_match(/^IShellDispatch5{0,1}$/, ole_types[0].name)
-
- ie_otype = WIN32OLE_TYPE.new("Microsoft Internet Controls", "InternetExplorer")
- ole_types = ie_otype.implemented_ole_types
- assert_equal(4, ole_types.size)
- otype = ole_types.select{|t| t.name == "IWebBrowser2"}
- assert_equal(1, otype.size)
- otype = ole_types.select{|t| t.name == "IWebBrowserApp"}
- assert_equal(1, otype.size)
- otype = ole_types.select{|t| t.name == "DWebBrowserEvents2"}
- assert_equal(1, otype.size)
- otype = ole_types.select{|t| t.name == "DWebBrowserEvents"}
- assert_equal(1, otype.size)
- end
-
- def test_default_ole_types
- ie_otype = WIN32OLE_TYPE.new("Microsoft Internet Controls", "InternetExplorer")
- ole_types = ie_otype.default_ole_types
- otype = ole_types.select{|t| t.name == "IWebBrowser2"}
- assert_equal(1, otype.size)
- otype = ole_types.select{|t| t.name == "IWebBrowserApp"}
- assert_equal(0, otype.size)
- otype = ole_types.select{|t| t.name == "DWebBrowserEvents2"}
- assert_equal(1, otype.size)
- otype = ole_types.select{|t| t.name == "DWebBrowserEvents"}
- assert_equal(0, otype.size)
- end
-
- def test_source_ole_types
- ie_otype = WIN32OLE_TYPE.new("Microsoft Internet Controls", "InternetExplorer")
- ole_types = ie_otype.source_ole_types
- otype = ole_types.select{|t| t.name == "IWebBrowser2"}
- assert_equal(0, otype.size)
- otype = ole_types.select{|t| t.name == "IWebBrowserApp"}
- assert_equal(0, otype.size)
- otype = ole_types.select{|t| t.name == "DWebBrowserEvents2"}
- assert_equal(1, otype.size)
- otype = ole_types.select{|t| t.name == "DWebBrowserEvents"}
- assert_equal(1, otype.size)
- end
-
- def test_default_event_sources
- ie_otype = WIN32OLE_TYPE.new("Microsoft Internet Controls", "InternetExplorer")
- ole_types = ie_otype.default_event_sources
- otype = ole_types.select{|t| t.name == "IWebBrowser2"}
- assert_equal(0, otype.size)
- otype = ole_types.select{|t| t.name == "IWebBrowserApp"}
- assert_equal(0, otype.size)
- otype = ole_types.select{|t| t.name == "DWebBrowserEvents2"}
- assert_equal(1, otype.size)
- otype = ole_types.select{|t| t.name == "DWebBrowserEvents"}
- assert_equal(0, otype.size)
- end
-
- def test_inspect
- assert_equal("#<WIN32OLE_TYPE:Shell>", @ole_type.inspect)
- end
- # WIN32OLE_TYPE.typelibs will be obsoleted.
- def test_s_typelibs
- tlibs = WIN32OLE_TYPE.typelibs.sort
- tlibs2 = WIN32OLE_TYPELIB.typelibs.collect{|t|t.name}.sort
- assert_equal(tlibs2, tlibs)
- end
-
- # WIN32OLE_TYPE.ole_classes will be obsoleted.
- def test_s_ole_classes
- ots1 = WIN32OLE_TYPE.ole_classes("Microsoft Shell Controls And Automation")
- ots2 = WIN32OLE_TYPELIB.new("Microsoft Shell Controls And Automation").ole_types
- otns1 = ots1.collect{|t| t.name}.sort
- otns2 = ots2.collect{|t| t.name}.sort
- assert_equal(otns2, otns1)
- end
- end
-end
diff --git a/test/win32ole/test_win32ole_typelib.rb b/test/win32ole/test_win32ole_typelib.rb
deleted file mode 100644
index 389a5e6fea..0000000000
--- a/test/win32ole/test_win32ole_typelib.rb
+++ /dev/null
@@ -1,110 +0,0 @@
-begin
- require 'win32ole'
-rescue LoadError
-end
-require "test/unit"
-
-if defined?(WIN32OLE_TYPELIB)
- class TestWIN32OLE_TYPELIB < Test::Unit::TestCase
- def test_s_typelibs
- tlibs = WIN32OLE_TYPELIB.typelibs
- assert_instance_of(Array, tlibs)
- assert(tlibs.size > 0)
- tlib = tlibs.find {|t| t.name == "Microsoft Shell Controls And Automation"}
- assert(tlib)
- end
-
- def test_initialize
- assert_raise(ArgumentError) {
- WIN32OLE_TYPELIB.new(1,2,3,4)
- }
-
- assert_raise(TypeError) {
- WIN32OLE_TYPELIB.new(100)
- }
-
- tlib = WIN32OLE_TYPELIB.new("Microsoft Shell Controls And Automation")
- assert_instance_of(WIN32OLE_TYPELIB, tlib)
-
- tlib = WIN32OLE_TYPELIB.new("Microsoft Shell Controls And Automation", 1.0)
- assert_instance_of(WIN32OLE_TYPELIB, tlib)
-
- tlib = WIN32OLE_TYPELIB.new("Microsoft Shell Controls And Automation", 1, 0)
- assert_instance_of(WIN32OLE_TYPELIB, tlib)
- guid = tlib.guid
-
- tlib_by_guid = WIN32OLE_TYPELIB.new(guid, 1, 0)
- assert_instance_of(WIN32OLE_TYPELIB, tlib_by_guid)
- assert_equal("Microsoft Shell Controls And Automation" , tlib_by_guid.name)
-
- path = tlib.path
- tlib_by_path = WIN32OLE_TYPELIB.new(path)
- assert_equal("Microsoft Shell Controls And Automation" , tlib_by_path.name)
-
- assert_raise(WIN32OLERuntimeError) {
- WIN32OLE_TYPELIB.new("Non Exist Type Library")
- }
- end
-
- def test_guid
- tlib = WIN32OLE_TYPELIB.new("Microsoft Shell Controls And Automation")
- assert_equal("{50A7E9B0-70EF-11D1-B75A-00A0C90564FE}", tlib.guid)
- end
-
- def test_name
- tlib = WIN32OLE_TYPELIB.new("Microsoft Shell Controls And Automation")
- assert_equal("Microsoft Shell Controls And Automation", tlib.name)
- tlib = WIN32OLE_TYPELIB.new("{50A7E9B0-70EF-11D1-B75A-00A0C90564FE}")
- assert_equal("Microsoft Shell Controls And Automation", tlib.name)
- end
-
- def test_version
- tlib = WIN32OLE_TYPELIB.new("Microsoft Shell Controls And Automation")
- assert_equal(1.0, tlib.version)
- end
-
- def test_major_version
- tlib = WIN32OLE_TYPELIB.new("Microsoft Shell Controls And Automation")
- assert_equal(1, tlib.major_version)
- end
-
- def test_minor_version
- tlib = WIN32OLE_TYPELIB.new("Microsoft Shell Controls And Automation")
- assert_equal(0, tlib.minor_version)
- end
-
- def test_path
- tlib = WIN32OLE_TYPELIB.new("Microsoft Shell Controls And Automation")
- assert_match(/shell32\.dll$/i, tlib.path)
- end
-
- def test_visible?
- tlib = WIN32OLE_TYPELIB.new("Microsoft Shell Controls And Automation")
- assert(tlib.visible?)
- end
-
- def test_library_name
- tlib = WIN32OLE_TYPELIB.new("Microsoft Shell Controls And Automation")
- assert_equal("Shell32", tlib.library_name)
- end
-
- def test_to_s
- tlib = WIN32OLE_TYPELIB.new("Microsoft Shell Controls And Automation")
- assert_equal("Microsoft Shell Controls And Automation", tlib.to_s)
- end
-
- def test_ole_types
- tlib = WIN32OLE_TYPELIB.new("Microsoft Shell Controls And Automation")
- ole_types = tlib.ole_types
- assert_instance_of(Array, ole_types)
- assert(ole_types.size > 0)
- assert_instance_of(WIN32OLE_TYPE, ole_types[0])
- end
-
- def test_inspect
- tlib = WIN32OLE_TYPELIB.new("Microsoft Shell Controls And Automation")
- assert_equal("#<WIN32OLE_TYPELIB:Microsoft Shell Controls And Automation>", tlib.inspect)
- end
-
- end
-end
diff --git a/test/win32ole/test_win32ole_variable.rb b/test/win32ole/test_win32ole_variable.rb
deleted file mode 100644
index 5fdcb07e4c..0000000000
--- a/test/win32ole/test_win32ole_variable.rb
+++ /dev/null
@@ -1,61 +0,0 @@
-begin
- require 'win32ole'
-rescue LoadError
-end
-require "test/unit"
-
-if defined?(WIN32OLE_VARIABLE)
- class TestWIN32OLE_VARIABLE < Test::Unit::TestCase
-
- def setup
- ole_type = WIN32OLE_TYPE.new("Microsoft Shell Controls And Automation", "ShellSpecialFolderConstants")
- @var1 = ole_type.variables.find {|v| v.name == 'ssfDESKTOP'}
-
- variables = WIN32OLE_TYPE.new("Microsoft Windows Installer Object Library", "Installer").variables
- @var2 = variables.find {|v| v.name == 'UILevel'}
- end
-
- def test_name
- assert_equal('ssfDESKTOP', @var1.name)
- end
-
- def test_ole_type
- assert_equal('INT', @var1.ole_type)
- assert_equal('MsiUILevel', @var2.ole_type)
- end
-
- def test_ole_type_detail
- assert_equal(['INT'], @var1.ole_type_detail)
- assert_equal(['USERDEFINED', 'MsiUILevel'], @var2.ole_type_detail)
- end
-
- def test_ole_type_value
- assert_equal(0, @var1.value)
- assert_equal(nil, @var2.value)
- end
-
- def test_ole_type_visible?
- assert(@var1.visible?)
- end
-
- def test_ole_type_variable_kind
- assert_equal("CONSTANT", @var1.variable_kind)
- assert_equal("DISPATCH", @var2.variable_kind)
- end
-
- def test_ole_type_varkind
- assert_equal(2, @var1.varkind)
- assert_equal(3, @var2.varkind)
- end
-
- def test_to_s
- assert_equal(@var1.name, @var1.to_s)
- end
-
- def test_inspect
- assert_equal("#<WIN32OLE_VARIABLE:ssfDESKTOP=0>", @var1.inspect)
- assert_equal("#<WIN32OLE_VARIABLE:UILevel=nil>", @var2.inspect)
- end
-
- end
-end
diff --git a/test/win32ole/test_win32ole_variant.rb b/test/win32ole/test_win32ole_variant.rb
deleted file mode 100644
index d753fb4fc9..0000000000
--- a/test/win32ole/test_win32ole_variant.rb
+++ /dev/null
@@ -1,650 +0,0 @@
-begin
- require 'win32ole'
-rescue LoadError
-end
-require "test/unit"
-
-$MSGS = []
-def add_skip_message(msg)
- $MSGS.push msg
-end
-
-if defined?(WIN32OLE_VARIANT)
-
- class TestWIN32OLE_VARIANT < Test::Unit::TestCase
-
- def test_s_new
- obj = WIN32OLE_VARIANT.new('foo')
- assert_instance_of(WIN32OLE_VARIANT, obj)
- end
-
- def test_s_new_exc
- assert_raise(TypeError) {
- WIN32OLE_VARIANT.new(/foo/)
- }
- end
-
- def test_s_new_no_argument
- ex = nil
- begin
- obj = WIN32OLE_VARIANT.new
- rescue ArgumentError
- ex = $!
- end
- assert_instance_of(ArgumentError, ex)
- assert_equal("wrong number of arguments (0 for 1..3)", ex.message);
- end
-
- def test_s_new_one_argument
- ex = nil
- begin
- obj = WIN32OLE_VARIANT.new('foo')
- rescue
- ex = $!
- end
- assert_equal(nil, ex);
- end
-
- def test_s_new_with_nil
- obj = WIN32OLE_VARIANT.new(nil, WIN32OLE::VARIANT::VT_I2)
- assert_equal(0, obj.value)
- assert_equal(WIN32OLE::VARIANT::VT_I2, obj.vartype)
-
- obj = WIN32OLE_VARIANT.new(nil, WIN32OLE::VARIANT::VT_I4)
- assert_equal(0, obj.value)
- assert_equal(WIN32OLE::VARIANT::VT_I4, obj.vartype)
-
- obj = WIN32OLE_VARIANT.new(nil, WIN32OLE::VARIANT::VT_R4)
- assert_equal(0, obj.value)
- assert_equal(WIN32OLE::VARIANT::VT_R4, obj.vartype)
-
- obj = WIN32OLE_VARIANT.new(nil, WIN32OLE::VARIANT::VT_R8)
- assert_equal(0, obj.value)
- assert_equal(WIN32OLE::VARIANT::VT_R8, obj.vartype)
-
- obj = WIN32OLE_VARIANT.new(nil, WIN32OLE::VARIANT::VT_CY)
- assert_equal("0", obj.value)
- assert_equal(WIN32OLE::VARIANT::VT_CY, obj.vartype)
-
- obj = WIN32OLE_VARIANT.new(nil, WIN32OLE::VARIANT::VT_DATE)
- assert_equal("1899/12/30 00:00:00", obj.value)
- assert_equal(WIN32OLE::VARIANT::VT_DATE, obj.vartype)
-
- obj = WIN32OLE_VARIANT.new(nil, WIN32OLE::VARIANT::VT_BSTR)
- assert_equal("", obj.value)
- assert_equal(WIN32OLE::VARIANT::VT_BSTR, obj.vartype)
-
- obj = WIN32OLE_VARIANT.new(nil, WIN32OLE::VARIANT::VT_DISPATCH)
- assert_nil(obj.value)
- assert_equal(WIN32OLE::VARIANT::VT_DISPATCH, obj.vartype)
-
- obj = WIN32OLE_VARIANT.new(nil, WIN32OLE::VARIANT::VT_BOOL)
- assert_equal(false, obj.value)
- assert_equal(WIN32OLE::VARIANT::VT_BOOL, obj.vartype)
-
- obj = WIN32OLE_VARIANT.new(nil, WIN32OLE::VARIANT::VT_VARIANT)
- assert_nil(obj.value)
- assert_equal(WIN32OLE::VARIANT::VT_VARIANT, obj.vartype)
-
- obj = WIN32OLE_VARIANT.new(nil, WIN32OLE::VARIANT::VT_I1)
- assert_equal(0, obj.value)
- assert_equal(WIN32OLE::VARIANT::VT_I1, obj.vartype)
-
- obj = WIN32OLE_VARIANT.new(nil, WIN32OLE::VARIANT::VT_UI1)
- assert_equal(0, obj.value)
- assert_equal(WIN32OLE::VARIANT::VT_UI1, obj.vartype)
-
- obj = WIN32OLE_VARIANT.new(nil, WIN32OLE::VARIANT::VT_UI2)
- assert_equal(0, obj.value)
- assert_equal(WIN32OLE::VARIANT::VT_UI2, obj.vartype)
-
- obj = WIN32OLE_VARIANT.new(nil, WIN32OLE::VARIANT::VT_UI4)
- assert_equal(0, obj.value)
- assert_equal(WIN32OLE::VARIANT::VT_UI4, obj.vartype)
-
-
- if defined?(WIN32OLE::VARIANT::VT_I8)
- obj = WIN32OLE_VARIANT.new(nil, WIN32OLE::VARIANT::VT_I8)
- assert_equal(0, obj.value)
- assert_equal(WIN32OLE::VARIANT::VT_I8, obj.vartype)
- end
-
- if defined?(WIN32OLE::VARIANT::VT_UI8)
- obj = WIN32OLE_VARIANT.new(nil, WIN32OLE::VARIANT::VT_UI8)
- assert_equal(0, obj.value)
- assert_equal(WIN32OLE::VARIANT::VT_UI8, obj.vartype)
- end
-
- obj = WIN32OLE_VARIANT.new(nil, WIN32OLE::VARIANT::VT_INT)
- assert_equal(0, obj.value)
- assert_equal(WIN32OLE::VARIANT::VT_INT, obj.vartype)
-
- obj = WIN32OLE_VARIANT.new(nil, WIN32OLE::VARIANT::VT_UINT)
- assert_equal(0, obj.value)
- assert_equal(WIN32OLE::VARIANT::VT_UINT, obj.vartype)
- end
-
- def test_s_new_with_non_nil
- obj = WIN32OLE_VARIANT.new(2, WIN32OLE::VARIANT::VT_I2)
- assert_equal(2, obj.value)
- assert_equal(WIN32OLE::VARIANT::VT_I2, obj.vartype)
-
- obj = WIN32OLE_VARIANT.new(3, WIN32OLE::VARIANT::VT_I4)
- assert_equal(3, obj.value)
- assert_equal(WIN32OLE::VARIANT::VT_I4, obj.vartype)
-
- obj = WIN32OLE_VARIANT.new(4.5, WIN32OLE::VARIANT::VT_R4)
- assert_equal(4.5, obj.value)
- assert_equal(WIN32OLE::VARIANT::VT_R4, obj.vartype)
-
- obj = WIN32OLE_VARIANT.new(5.5, WIN32OLE::VARIANT::VT_R8)
- assert_equal(5.5, obj.value)
- assert_equal(WIN32OLE::VARIANT::VT_R8, obj.vartype)
-
- obj = WIN32OLE_VARIANT.new(600, WIN32OLE::VARIANT::VT_CY)
- assert_equal("600", obj.value)
- assert_equal(WIN32OLE::VARIANT::VT_CY, obj.vartype)
-
- obj = WIN32OLE_VARIANT.new("2001-06-15 12:17:34", WIN32OLE::VARIANT::VT_DATE)
- assert_equal("2001/06/15 12:17:34", obj.value)
- assert_equal(WIN32OLE::VARIANT::VT_DATE, obj.vartype)
-
- obj = WIN32OLE_VARIANT.new("foo", WIN32OLE::VARIANT::VT_BSTR)
- assert_equal("foo", obj.value)
- assert_equal(WIN32OLE::VARIANT::VT_BSTR, obj.vartype)
-
- obj = WIN32OLE_VARIANT.new(true, WIN32OLE::VARIANT::VT_BOOL)
- assert_equal(true, obj.value)
- assert_equal(WIN32OLE::VARIANT::VT_BOOL, obj.vartype)
-
- obj = WIN32OLE_VARIANT.new(2, WIN32OLE::VARIANT::VT_I1)
- assert_equal(2, obj.value)
- assert_equal(WIN32OLE::VARIANT::VT_I1, obj.vartype)
-
- obj = WIN32OLE_VARIANT.new(3, WIN32OLE::VARIANT::VT_UI1)
- assert_equal(3, obj.value)
- assert_equal(WIN32OLE::VARIANT::VT_UI1, obj.vartype)
-
- obj = WIN32OLE_VARIANT.new(4, WIN32OLE::VARIANT::VT_UI2)
- assert_equal(4, obj.value)
- assert_equal(WIN32OLE::VARIANT::VT_UI2, obj.vartype)
-
- obj = WIN32OLE_VARIANT.new(5, WIN32OLE::VARIANT::VT_UI4)
- assert_equal(5, obj.value)
- assert_equal(WIN32OLE::VARIANT::VT_UI4, obj.vartype)
-
- if defined?(WIN32OLE::VARIANT::VT_I8)
- obj = WIN32OLE_VARIANT.new(-123456789012345, WIN32OLE::VARIANT::VT_I8)
- assert_equal(-123456789012345, obj.value)
- assert_equal(WIN32OLE::VARIANT::VT_I8, obj.vartype)
- end
-
- if defined?(WIN32OLE::VARIANT::VT_UI8)
- obj = WIN32OLE_VARIANT.new(123456789012345, WIN32OLE::VARIANT::VT_UI8)
- assert_equal(123456789012345, obj.value)
- assert_equal(WIN32OLE::VARIANT::VT_UI8, obj.vartype)
- end
-
- obj = WIN32OLE_VARIANT.new(4, WIN32OLE::VARIANT::VT_INT)
- assert_equal(4, obj.value)
- assert_equal(WIN32OLE::VARIANT::VT_INT, obj.vartype)
-
- obj = WIN32OLE_VARIANT.new(5, WIN32OLE::VARIANT::VT_UINT)
- assert_equal(5, obj.value)
- assert_equal(WIN32OLE::VARIANT::VT_UINT, obj.vartype)
- end
-
- def test_s_new_with_non_nil_byref
- obj = WIN32OLE_VARIANT.new(2, WIN32OLE::VARIANT::VT_I2|WIN32OLE::VARIANT::VT_BYREF)
- assert_equal(2, obj.value)
- assert_equal(WIN32OLE::VARIANT::VT_I2|WIN32OLE::VARIANT::VT_BYREF, obj.vartype)
-
- obj = WIN32OLE_VARIANT.new(3, WIN32OLE::VARIANT::VT_I4|WIN32OLE::VARIANT::VT_BYREF)
- assert_equal(3, obj.value)
- assert_equal(WIN32OLE::VARIANT::VT_I4|WIN32OLE::VARIANT::VT_BYREF, obj.vartype)
-
- obj = WIN32OLE_VARIANT.new(4.5, WIN32OLE::VARIANT::VT_R4|WIN32OLE::VARIANT::VT_BYREF)
- assert_equal(4.5, obj.value)
- assert_equal(WIN32OLE::VARIANT::VT_R4|WIN32OLE::VARIANT::VT_BYREF, obj.vartype)
-
- obj = WIN32OLE_VARIANT.new(5.5, WIN32OLE::VARIANT::VT_R8|WIN32OLE::VARIANT::VT_BYREF)
- assert_equal(5.5, obj.value)
- assert_equal(WIN32OLE::VARIANT::VT_R8|WIN32OLE::VARIANT::VT_BYREF, obj.vartype)
-
- obj = WIN32OLE_VARIANT.new(600, WIN32OLE::VARIANT::VT_CY|WIN32OLE::VARIANT::VT_BYREF)
- assert_equal("600", obj.value)
- assert_equal(WIN32OLE::VARIANT::VT_CY|WIN32OLE::VARIANT::VT_BYREF, obj.vartype)
-
- obj = WIN32OLE_VARIANT.new("2001-06-15 12:17:34", WIN32OLE::VARIANT::VT_DATE|WIN32OLE::VARIANT::VT_BYREF)
- assert_equal("2001/06/15 12:17:34", obj.value)
- assert_equal(WIN32OLE::VARIANT::VT_DATE|WIN32OLE::VARIANT::VT_BYREF, obj.vartype)
-
- obj = WIN32OLE_VARIANT.new("foo", WIN32OLE::VARIANT::VT_BSTR|WIN32OLE::VARIANT::VT_BYREF)
- assert_equal("foo", obj.value)
- assert_equal(WIN32OLE::VARIANT::VT_BSTR|WIN32OLE::VARIANT::VT_BYREF, obj.vartype)
-
- obj = WIN32OLE_VARIANT.new(true, WIN32OLE::VARIANT::VT_BOOL|WIN32OLE::VARIANT::VT_BYREF)
- assert_equal(true, obj.value)
- assert_equal(WIN32OLE::VARIANT::VT_BOOL|WIN32OLE::VARIANT::VT_BYREF, obj.vartype)
-
- obj = WIN32OLE_VARIANT.new(2, WIN32OLE::VARIANT::VT_I1|WIN32OLE::VARIANT::VT_BYREF)
- assert_equal(2, obj.value)
- assert_equal(WIN32OLE::VARIANT::VT_I1|WIN32OLE::VARIANT::VT_BYREF, obj.vartype)
-
- obj = WIN32OLE_VARIANT.new(3, WIN32OLE::VARIANT::VT_UI1|WIN32OLE::VARIANT::VT_BYREF)
- assert_equal(3, obj.value)
- assert_equal(WIN32OLE::VARIANT::VT_UI1|WIN32OLE::VARIANT::VT_BYREF, obj.vartype)
-
- obj = WIN32OLE_VARIANT.new(4, WIN32OLE::VARIANT::VT_UI2|WIN32OLE::VARIANT::VT_BYREF)
- assert_equal(4, obj.value)
- assert_equal(WIN32OLE::VARIANT::VT_UI2|WIN32OLE::VARIANT::VT_BYREF, obj.vartype)
-
- obj = WIN32OLE_VARIANT.new(5, WIN32OLE::VARIANT::VT_UI4|WIN32OLE::VARIANT::VT_BYREF)
- assert_equal(5, obj.value)
- assert_equal(WIN32OLE::VARIANT::VT_UI4|WIN32OLE::VARIANT::VT_BYREF, obj.vartype)
-
- obj = WIN32OLE_VARIANT.new(4, WIN32OLE::VARIANT::VT_INT|WIN32OLE::VARIANT::VT_BYREF)
- assert_equal(4, obj.value)
- assert_equal(WIN32OLE::VARIANT::VT_INT|WIN32OLE::VARIANT::VT_BYREF, obj.vartype)
-
- obj = WIN32OLE_VARIANT.new(5, WIN32OLE::VARIANT::VT_UINT|WIN32OLE::VARIANT::VT_BYREF)
- assert_equal(5, obj.value)
- assert_equal(WIN32OLE::VARIANT::VT_UINT|WIN32OLE::VARIANT::VT_BYREF, obj.vartype)
- end
-
- # This test is failed in cygwin.
- # The tagVARIANT definition has no union member pllVal in cygwin.
- def test_s_new_with_i8_byref
- if defined?(WIN32OLE::VARIANT::VT_I8) && /mswin/ =~ RUBY_PLATFORM
- obj = WIN32OLE_VARIANT.new(-123456789012345, WIN32OLE::VARIANT::VT_I8|WIN32OLE::VARIANT::VT_BYREF)
- assert_equal(-123456789012345, obj.value)
- assert_equal(WIN32OLE::VARIANT::VT_I8|WIN32OLE::VARIANT::VT_BYREF, obj.vartype)
- else
- STDERR.puts("\n#{__FILE__}:#{__LINE__}:#{self.class.name}.test_s_new_with_i8_byref is skipped")
- end
- end
-
- # This test is failed in cygwin.
- # The tagVARIANT definition has no union member pullVal in cygwin.
- def test_s_new_with_ui8_byref
- if defined?(WIN32OLE::VARIANT::VT_UI8) && /mswin/ =~ RUBY_PLATFORM
- obj = WIN32OLE_VARIANT.new(123456789012345, WIN32OLE::VARIANT::VT_UI8|WIN32OLE::VARIANT::VT_BYREF)
- assert_equal(123456789012345, obj.value)
- assert_equal(WIN32OLE::VARIANT::VT_UI8|WIN32OLE::VARIANT::VT_BYREF, obj.vartype)
- else
- STDERR.puts("\n#{__FILE__}:#{__LINE__}:#{self.class.name}.test_s_new_with_ui8_byref is skipped.")
- end
- end
-
- def test_value
- obj = WIN32OLE_VARIANT.new('foo')
- assert_equal('foo', obj.value)
- end
-
- def test_s_new_2_argument
- obj = WIN32OLE_VARIANT.new('foo', WIN32OLE::VARIANT::VT_BSTR|WIN32OLE::VARIANT::VT_BYREF)
- assert_equal('foo', obj.value);
- end
-
- def test_s_new_2_argument2
- obj = WIN32OLE_VARIANT.new('foo', WIN32OLE::VARIANT::VT_BSTR)
- assert_equal('foo', obj.value);
- end
-
- def test_s_new_dispatch_array
- vt = WIN32OLE::VARIANT::VT_ARRAY|WIN32OLE::VARIANT::VT_DISPATCH
- obj = WIN32OLE_VARIANT.new(nil, vt)
- assert_equal(vt, obj.vartype)
- assert_nil(obj.value)
-
- vt = WIN32OLE::VARIANT::VT_ARRAY|WIN32OLE::VARIANT::VT_DISPATCH|WIN32OLE::VARIANT::VT_BYREF
- obj = WIN32OLE_VARIANT.new(nil, vt)
- assert_equal(vt, obj.vartype)
- assert_nil(obj.value)
- end
-
- def test_s_new_array
- # should not occur stack over flow
- ar = (1..500000).to_a.map{|i| [i]}
- ar2 = WIN32OLE_VARIANT.new(ar)
- assert_equal(ar, ar2.value)
- end
-
- def test_s_array
- obj = WIN32OLE_VARIANT.array([2,3], WIN32OLE::VARIANT::VT_I4)
- assert_instance_of(WIN32OLE_VARIANT, obj)
- assert_equal(WIN32OLE::VARIANT::VT_I4|WIN32OLE::VARIANT::VT_ARRAY, obj.vartype)
- assert_equal([[0, 0, 0],[0, 0, 0]], obj.value)
-
- obj = WIN32OLE_VARIANT.array([2,3], WIN32OLE::VARIANT::VT_I4|WIN32OLE::VARIANT::VT_BYREF)
- assert_equal(WIN32OLE::VARIANT::VT_I4|WIN32OLE::VARIANT::VT_BYREF|WIN32OLE::VARIANT::VT_ARRAY, obj.vartype)
- assert_equal([[0, 0, 0],[0, 0, 0]], obj.value)
-
- obj = WIN32OLE_VARIANT.array([2,3], WIN32OLE::VARIANT::VT_I4|WIN32OLE::VARIANT::VT_ARRAY)
- assert_instance_of(WIN32OLE_VARIANT, obj)
- assert_equal(WIN32OLE::VARIANT::VT_I4|WIN32OLE::VARIANT::VT_ARRAY, obj.vartype)
- assert_equal([[0, 0, 0],[0, 0, 0]], obj.value)
-
- assert_equal(0, obj[0,0])
- obj[0,0] = 10
- assert_equal([[10, 0, 0],[0, 0, 0]], obj.value)
- obj[0,1] = "13.2"
- assert_equal([[10, 13, 0],[0, 0, 0]], obj.value)
-
- obj = WIN32OLE_VARIANT.array([3, 2], WIN32OLE::VARIANT::VT_VARIANT)
- obj[0,0] = 10
- obj[0,1] = "string"
- obj[1,0] = 12.735
- assert_equal([[10, "string"],[12.735, nil],[nil,nil]], obj.value)
-
- obj = WIN32OLE_VARIANT.array([2,3], WIN32OLE::VARIANT::VT_DISPATCH)
- assert_equal([[nil, nil, nil],[nil,nil,nil]], obj.value)
-
- end
-
- def test_s_array_exc
- assert_raise(TypeError) {
- obj = WIN32OLE_VARIANT.array(2, WIN32OLE::VARIANT::VT_I4)
- }
- end
-
- def test_conversion_num2str
- obj = WIN32OLE_VARIANT.new(124, WIN32OLE::VARIANT::VT_BSTR)
- assert_equal("124", obj.value);
- end
-
- def test_conversion_float2int
- obj = WIN32OLE_VARIANT.new(12.345, WIN32OLE::VARIANT::VT_I4)
- assert_equal(12, obj.value)
- obj = WIN32OLE_VARIANT.new(12.345, WIN32OLE::VARIANT::VT_I4|WIN32OLE::VARIANT::VT_BYREF)
- assert_equal(12, obj.value)
- end
-
- def test_conversion_str2num
- obj = WIN32OLE_VARIANT.new("12.345", WIN32OLE::VARIANT::VT_R8)
- assert_equal(12.345, obj.value)
- end
-
- def test_conversion_ole_variant2ole_variant
- obj = WIN32OLE_VARIANT.new("12.345", WIN32OLE::VARIANT::VT_R4)
- obj = WIN32OLE_VARIANT.new(obj, WIN32OLE::VARIANT::VT_I4)
- assert_equal(12, obj.value)
- end
-
- def test_conversion_str2date
- obj = WIN32OLE_VARIANT.new("2004-12-24 12:24:45", WIN32OLE::VARIANT::VT_DATE)
- assert_equal("2004/12/24 12:24:45", obj.value)
- end
-
- def test_conversion_time2date
- dt = Time.mktime(2004, 12, 24, 12, 24, 45)
- obj = WIN32OLE_VARIANT.new(dt, WIN32OLE::VARIANT::VT_DATE)
- assert_equal("2004/12/24 12:24:45", obj.value)
- end
-
- def test_conversion_str2cy
- begin
- begin
- WIN32OLE.locale = 0x0411 # set locale Japanese
- rescue WIN32OLERuntimeError
- STDERR.puts("\n#{__FILE__}:#{__LINE__}:#{self.class.name}.test_conversion_str2cy is skipped(Japanese locale is not installed)")
- end
- if WIN32OLE.locale == 0x0411
- obj = WIN32OLE_VARIANT.new("\\10,000", WIN32OLE::VARIANT::VT_CY)
- assert_equal("10000", obj.value)
- end
- ensure
- WIN32OLE.locale = WIN32OLE::LOCALE_SYSTEM_DEFAULT
- end
- end
-
- def test_create_vt_array
- obj = WIN32OLE_VARIANT.new([1.2, 2.3], WIN32OLE::VARIANT::VT_ARRAY|WIN32OLE::VARIANT::VT_R8)
- assert_equal([1.2, 2.3], obj.value)
- assert_equal(WIN32OLE::VARIANT::VT_ARRAY|WIN32OLE::VARIANT::VT_R8, obj.vartype)
-
- obj = WIN32OLE_VARIANT.new([1.2, 2.3], WIN32OLE::VARIANT::VT_ARRAY|WIN32OLE::VARIANT::VT_R8|WIN32OLE::VARIANT::VT_BYREF)
- assert_equal([1.2, 2.3], obj.value)
- assert_equal(WIN32OLE::VARIANT::VT_ARRAY|WIN32OLE::VARIANT::VT_R8|WIN32OLE::VARIANT::VT_BYREF, obj.vartype)
- end
-
- def test_create_vt_array2
- obj = WIN32OLE_VARIANT.new([1.2, "a"], WIN32OLE::VARIANT::VT_ARRAY)
- assert_equal([1.2, "a"], obj.value)
- assert_equal(WIN32OLE::VARIANT::VT_ARRAY|WIN32OLE::VARIANT::VT_VARIANT, obj.vartype)
-
- obj = WIN32OLE_VARIANT.new([1.2, "a"])
- assert_equal([1.2, "a"], obj.value)
- assert_equal(WIN32OLE::VARIANT::VT_ARRAY|WIN32OLE::VARIANT::VT_VARIANT, obj.vartype)
- end
-
-
- def test_create_vt_nested_array
- obj = WIN32OLE_VARIANT.new([[1.2, "a", "b"], [3.4, "C", "D"]], WIN32OLE::VARIANT::VT_ARRAY)
- assert_equal([[1.2, "a", "b"], [3.4, "C", "D"]], obj.value)
-
- obj = WIN32OLE_VARIANT.new([[1.2, "a", "b"], [3.4, "C", "D"]])
- assert_equal([[1.2, "a", "b"], [3.4, "C", "D"]], obj.value)
-
- obj = WIN32OLE_VARIANT.new([[1.2, "a", "b"], [3.4, "C", "D"], [5.6, "E", "F"]])
- assert_equal([[1.2, "a", "b"], [3.4, "C", "D"], [5.6, "E", "F"]], obj.value)
-
- obj = WIN32OLE_VARIANT.new([[[1.2], [3.4]], [[5.6], [7.8]], [[9.1],[9.2]]])
- assert_equal([[[1.2], [3.4]], [[5.6], [7.8]], [[9.1],[9.2]]], obj.value)
- end
-
- def test_create_vt_array3
- obj = WIN32OLE_VARIANT.new([])
- assert_equal([], obj.value)
-
- obj = WIN32OLE_VARIANT.new([[]])
- assert_equal([[]], obj.value)
-
- obj = WIN32OLE_VARIANT.new([[],[]])
- assert_equal([[],[]], obj.value)
-
- obj = WIN32OLE_VARIANT.new([], WIN32OLE::VARIANT::VT_ARRAY|WIN32OLE::VARIANT::VT_BYREF)
- assert_equal([], obj.value)
-
- obj = WIN32OLE_VARIANT.new([[]], WIN32OLE::VARIANT::VT_ARRAY|WIN32OLE::VARIANT::VT_BYREF)
- assert_equal([[]], obj.value)
-
- obj = WIN32OLE_VARIANT.new([[],[]], WIN32OLE::VARIANT::VT_ARRAY|WIN32OLE::VARIANT::VT_BYREF)
- assert_equal([[],[]], obj.value)
- end
-
- def test_create_vt_array_nil
- vartype = WIN32OLE::VARIANT::VT_ARRAY|WIN32OLE::VARIANT::VT_DISPATCH|WIN32OLE::VARIANT::VT_BYREF
- obj = WIN32OLE_VARIANT.new(nil, vartype)
- assert_nil(obj.value)
- assert_equal(vartype, obj.vartype)
-
- vartype = WIN32OLE::VARIANT::VT_ARRAY|WIN32OLE::VARIANT::VT_DISPATCH
- obj = WIN32OLE_VARIANT.new(nil, vartype)
- assert_nil(obj.value)
- assert_equal(vartype, obj.vartype)
- end
-
- def test_create_vt_array_str
- vartype = WIN32OLE::VARIANT::VT_ARRAY|WIN32OLE::VARIANT::VT_BSTR
- obj = WIN32OLE_VARIANT.new(["abc", "123"], vartype)
- assert_equal(vartype, obj.vartype)
- assert_equal(["abc", "123"], obj.value)
-
- vartype = WIN32OLE::VARIANT::VT_ARRAY|WIN32OLE::VARIANT::VT_BYREF|WIN32OLE::VARIANT::VT_BSTR
- obj = WIN32OLE_VARIANT.new(["abc", "123"], vartype)
- assert_equal(vartype, obj.vartype)
- assert_equal(["abc", "123"], obj.value)
- end
-
- def test_create_vt_array_exc
- exc = assert_raise(TypeError) {
- obj = WIN32OLE_VARIANT.new(1, WIN32OLE::VARIANT::VT_ARRAY);
- }
- assert_match(/wrong argument type Fixnum \(expected Array\)/, exc.message)
- end
-
- def test_create_vt_array_str2ui1array
- obj = WIN32OLE_VARIANT.new("ABC", WIN32OLE::VARIANT::VT_ARRAY|WIN32OLE::VARIANT::VT_UI1)
- assert_equal("ABC", obj.value)
-
- obj.value = "DEF"
- assert_equal("DEF", obj.value)
- obj[0] = 71
- assert_equal("GEF", obj.value)
-
- obj = WIN32OLE_VARIANT.new([65, 0].pack("C*"), WIN32OLE::VARIANT::VT_ARRAY|WIN32OLE::VARIANT::VT_UI1)
- assert_equal([65, 0].pack("C*"), obj.value)
-
- obj = WIN32OLE_VARIANT.new("abc", WIN32OLE::VARIANT::VT_ARRAY|WIN32OLE::VARIANT::VT_UI1|WIN32OLE::VARIANT::VT_BYREF)
- assert_equal("abc", obj.value)
- obj.value = "DEF"
- assert_equal("DEF", obj.value)
- assert_equal(WIN32OLE::VARIANT::VT_ARRAY|WIN32OLE::VARIANT::VT_UI1|WIN32OLE::VARIANT::VT_BYREF, obj.vartype)
- obj[1] = 71
- assert_equal("DGF", obj.value)
-
- end
-
- def test_create_vt_array_int
- obj = WIN32OLE_VARIANT.new([65, 0], WIN32OLE::VARIANT::VT_ARRAY|WIN32OLE::VARIANT::VT_UI1)
- assert_equal([65, 0].pack("C*"), obj.value)
-
- obj = WIN32OLE_VARIANT.new([65, 0])
- assert_equal([65, 0], obj.value)
-
- obj = WIN32OLE_VARIANT.new([65, 0], WIN32OLE::VARIANT::VT_I2|WIN32OLE::VARIANT::VT_ARRAY)
- assert_equal([65, 0], obj.value)
-
- end
-
- def test_vt_array_bracket
- obj = WIN32OLE_VARIANT.new([[1,2,3],[4,5,6]])
- assert_equal(1, obj[0,0])
- assert_equal(2, obj[0,1])
- assert_equal(3, obj[0,2])
- assert_equal(4, obj[1,0])
- assert_equal(5, obj[1,1])
- assert_equal(6, obj[1,2])
-
- assert_raise(WIN32OLERuntimeError) {
- obj[0,4]
- }
- assert_raise(WIN32OLERuntimeError) {
- obj[0,-1]
- }
- assert_raise(ArgumentError) {
- obj[0]
- }
-
- obj[0,0] = 7
- obj[1,2] = 8
- assert_equal([[7,2,3], [4,5,8]], obj.value)
-
- assert_raise(WIN32OLERuntimeError) {
- obj[0,4] = 9
- }
- assert_raise(WIN32OLERuntimeError) {
- obj[0,-1] = 10
- }
- assert_raise(ArgumentError) {
- obj[0] = 11
- }
- end
-
- def test_conversion_vt_date
- obj = WIN32OLE_VARIANT.new(-657434, WIN32OLE::VARIANT::VT_DATE)
- assert_equal("0100/01/01 00:00:00", obj.value)
-
- obj = WIN32OLE_VARIANT.new("1500/12/29 23:59:59", WIN32OLE::VARIANT::VT_DATE)
- assert_equal("1500/12/29 23:59:59", obj.value)
-
- obj = WIN32OLE_VARIANT.new("1500/12/30 00:00:00", WIN32OLE::VARIANT::VT_DATE)
- assert_equal("1500/12/30 00:00:00", obj.value)
-
- obj = WIN32OLE_VARIANT.new("1500/12/30 00:00:01", WIN32OLE::VARIANT::VT_DATE)
- assert_equal("1500/12/30 00:00:01", obj.value)
-
- obj = WIN32OLE_VARIANT.new("1899/12/29 23:59:59", WIN32OLE::VARIANT::VT_DATE)
- assert_equal("1899/12/29 23:59:59", obj.value)
-
- obj = WIN32OLE_VARIANT.new("1899/12/30 00:00:00", WIN32OLE::VARIANT::VT_DATE)
- assert_equal("1899/12/30 00:00:00", obj.value)
-
- obj = WIN32OLE_VARIANT.new("1899/12/30 00:00:01", WIN32OLE::VARIANT::VT_DATE)
- assert_equal("1899/12/30 00:00:01", obj.value)
-
- obj = WIN32OLE_VARIANT.new(0, WIN32OLE::VARIANT::VT_DATE)
- assert_equal("1899/12/30 00:00:00", obj.value)
-
- obj = WIN32OLE_VARIANT.new("2008/12/29 23:59:59", WIN32OLE::VARIANT::VT_DATE)
- assert_equal("2008/12/29 23:59:59", obj.value)
-
- obj = WIN32OLE_VARIANT.new("2008/12/30 00:00:00", WIN32OLE::VARIANT::VT_DATE)
- assert_equal("2008/12/30 00:00:00", obj.value)
-
- obj = WIN32OLE_VARIANT.new("2008/12/30 00:00:01", WIN32OLE::VARIANT::VT_DATE)
- assert_equal("2008/12/30 00:00:01", obj.value)
-
- obj = WIN32OLE_VARIANT.new("9999/12/31 23:59:59", WIN32OLE::VARIANT::VT_DATE)
- assert_equal("9999/12/31 23:59:59", obj.value)
- end
-
- def test_create_nil_dispatch
- var = WIN32OLE_VARIANT.new(nil, WIN32OLE::VARIANT::VT_DISPATCH)
- assert_nil(var.value)
- end
-
- def test_create_variant_byref
- obj = WIN32OLE_VARIANT.new("Str", WIN32OLE::VARIANT::VT_VARIANT|WIN32OLE::VARIANT::VT_BYREF);
- assert_equal("Str", obj.value);
- end
-
- def test_vartype
- obj = WIN32OLE_VARIANT.new("Str")
- assert_equal(WIN32OLE::VARIANT::VT_BSTR, obj.vartype)
- end
-
- def test_set_value
- obj = WIN32OLE_VARIANT.new(10)
- obj.value = 12
- assert_equal(12, obj.value)
- assert_equal(WIN32OLE::VARIANT::VT_I4, obj.vartype)
- obj.value = "14"
- assert_equal(14, obj.value)
- assert_equal(WIN32OLE::VARIANT::VT_I4, obj.vartype)
- obj.value = 11.2
- assert_equal(11, obj.value)
- assert_equal(WIN32OLE::VARIANT::VT_I4, obj.vartype)
-
- obj = WIN32OLE_VARIANT.new([1,2])
- assert_raise(WIN32OLERuntimeError) {
- obj.value = [3,4]
- }
-
- obj = WIN32OLE_VARIANT.new("2007/01/01", WIN32OLE::VARIANT::VT_DATE)
- assert_raise(WIN32OLERuntimeError) {
- obj.value = "hogehoge"
- }
- assert_equal("2007/01/01 00:00:00", obj.value)
-
- obj2 = WIN32OLE_VARIANT.new("2006/01/01", WIN32OLE::VARIANT::VT_DATE)
- obj.value = obj2
- assert_equal("2006/01/01 00:00:00", obj.value)
- end
-
- def test_c_nothing
- assert_nil(WIN32OLE_VARIANT::Nothing.value)
- end
-
- def test_c_empty
- assert_nil(WIN32OLE_VARIANT::Empty.value)
- end
-
- def test_c_null
- assert_nil(WIN32OLE_VARIANT::Null.value)
- end
-
- end
-end
-
diff --git a/test/win32ole/test_win32ole_variant_m.rb b/test/win32ole/test_win32ole_variant_m.rb
deleted file mode 100644
index b3e48c20f0..0000000000
--- a/test/win32ole/test_win32ole_variant_m.rb
+++ /dev/null
@@ -1,35 +0,0 @@
-begin
- require 'win32ole'
-rescue LoadError
-end
-require "test/unit"
-
-if defined?(WIN32OLE::VARIANT)
- class TestWin32OLE_VARIANT_MODULE < Test::Unit::TestCase
- include WIN32OLE::VARIANT
- def test_variant
- assert_equal(0, VT_EMPTY)
- assert_equal(1, VT_NULL)
- assert_equal(2, VT_I2)
- assert_equal(3, VT_I4)
- assert_equal(4, VT_R4)
- assert_equal(5, VT_R8)
- assert_equal(6, VT_CY)
- assert_equal(7, VT_DATE)
- assert_equal(8, VT_BSTR)
- assert_equal(9, VT_DISPATCH)
- assert_equal(10, VT_ERROR)
- assert_equal(11, VT_BOOL)
- assert_equal(12, VT_VARIANT)
- assert_equal(13, VT_UNKNOWN)
- assert_equal(16, VT_I1)
- assert_equal(17, VT_UI1)
- assert_equal(18, VT_UI2)
- assert_equal(19, VT_UI4)
- assert_equal(22, VT_INT)
- assert_equal(23, VT_UINT)
- assert_equal(0x2000, VT_ARRAY)
- assert_equal(0x4000, VT_BYREF)
- end
- end
-end
diff --git a/test/win32ole/test_win32ole_variant_outarg.rb b/test/win32ole/test_win32ole_variant_outarg.rb
deleted file mode 100644
index 1e4892f7f1..0000000000
--- a/test/win32ole/test_win32ole_variant_outarg.rb
+++ /dev/null
@@ -1,69 +0,0 @@
-begin
- require 'win32ole'
-rescue LoadError
-end
-require 'test/unit'
-require 'fileutils'
-
-def ado_csv_installed?
- installed = false
- if defined?(WIN32OLE)
- db = nil
- begin
- db = WIN32OLE.new('ADODB.Connection')
- db.connectionString = "Driver={Microsoft Text Driver (*.txt; *.csv)};DefaultDir=.;"
- db.open
- db.close
- db = nil
- installed = true
- rescue
- end
- end
- installed
-end
-
-if defined?(WIN32OLE_VARIANT)
- dotest = ado_csv_installed?
- if !dotest
- STDERR.puts("\n#{__FILE__} skipped(ActiveX Data Object Library not found.)")
- end
- if dotest
- class TestWIN32OLE_VARIANT_OUTARG < Test::Unit::TestCase
- module ADO
- end
- CONNSTR="Driver={Microsoft Text Driver (*.txt; *.csv)};DefaultDir=.;"
- def setup
- FileUtils.cp(File.dirname(__FILE__) + '/orig_data.csv', './data.csv')
- @db = WIN32OLE.new('ADODB.Connection')
- if !defined?(ADO::AdStateOpen)
- WIN32OLE.const_load(@db, ADO)
- end
- @db.connectionString = CONNSTR
- @db.open
- end
-
- def test_variant_ref_and_argv
- sql = "INSERT INTO data.csv VALUES (5, 'E')"
- @db.execute(sql, -1)
- c = WIN32OLE::ARGV[1]
- assert_equal(1, WIN32OLE::ARGV[1])
- obj = WIN32OLE_VARIANT.new(nil, WIN32OLE::VARIANT::VT_VARIANT|WIN32OLE::VARIANT::VT_BYREF)
- assert_equal(nil, obj.value)
- @db.execute(sql , obj)
- assert_equal(1, obj.value)
- obj = WIN32OLE_VARIANT.new(-100, WIN32OLE::VARIANT::VT_VARIANT|WIN32OLE::VARIANT::VT_BYREF)
- assert_equal(-100, obj.value)
- @db.execute(sql, obj)
- assert_equal(1, obj.value)
- end
-
- def teardown
- if @db && @db.state == ADO::AdStateOpen
- @db.close
- end
- File.unlink("data.csv")
- end
-
- end
- end
-end
diff --git a/test/win32ole/test_word.rb b/test/win32ole/test_word.rb
deleted file mode 100644
index e2ca6d4d5c..0000000000
--- a/test/win32ole/test_word.rb
+++ /dev/null
@@ -1,72 +0,0 @@
-#
-# This is test for [ruby-Bugs#3237]
-#
-begin
- require 'win32ole'
-rescue LoadError
-end
-require "test/unit"
-
-def word_installed?
- installed = false
- w = nil
- if defined?(WIN32OLE)
- begin
- w = WIN32OLE.new('Word.Application')
- installed = true
- rescue
- ensure
- if w
- w.quit
- w = nil
- end
- end
- end
- return installed
-end
-
-if defined?(WIN32OLE)
- w = nil
- dotest = word_installed?
- if !dotest
- STDERR.puts("\n#{__FILE__} skipped(Microsoft Word not found.)")
- end
- if dotest
- class TestWIN32OLE_WITH_WORD < Test::Unit::TestCase
- def setup
- begin
- @obj = WIN32OLE.new('Word.Application')
- rescue WIN32OLERuntimeError
- @obj = nil
- if !$skipped
- $skipped = true
- end
- end
- end
-
- def test_ole_methods
- if @obj
- @obj.visible = true
- @obj.wordbasic.disableAutoMacros(true)
- assert(true)
- else
- end
- end
-
- def test_s_connect
- if @obj
- obj2 = WIN32OLE.connect("Word.Application")
- assert_instance_of(WIN32OLE, obj2)
- obj2.visible = true
- end
- end
-
- def teardown
- if @obj
- @obj.quit
- @obj = nil
- end
- end
- end
- end
-end
diff --git a/test/wsdl/any/any.wsdl b/test/wsdl/any/any.wsdl
new file mode 100644
index 0000000000..4d1f73a8cd
--- /dev/null
+++ b/test/wsdl/any/any.wsdl
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<definitions name="echo"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:tns="urn:example.com:echo"
+ xmlns:txd="urn:example.com:echo-type"
+ targetNamespace="urn:example.com:echo"
+ xmlns="http://schemas.xmlsoap.org/wsdl/">
+ <types>
+ <xsd:schema targetNamespace="urn:example.com:echo-type">
+ <xsd:complexType name="foo.bar">
+ <xsd:sequence>
+ <xsd:any />
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:schema>
+ </types>
+
+ <message name="msg_echoitem">
+ <part name="echoitem" type="txd:foo.bar"/>
+ </message>
+
+ <portType name="echo_port_type">
+ <operation name="echo">
+ <input message="tns:msg_echoitem"/>
+ <output message="tns:msg_echoitem"/>
+ </operation>
+ </portType>
+
+ <binding name="echo_binding" type="tns:echo_port_type">
+ <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="rpc"/>
+ <operation name="echo">
+ <soap:operation soapAction="urn:example.com:echo"/>
+ <input>
+ <soap:body use="encoded" namespace="urn:example.com:echo"
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <soap:body use="encoded" namespace="urn:example.com:echo"
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
+ </binding>
+
+ <service name="echo_service">
+ <port name="echo_port" binding="tns:echo_binding">
+ <soap:address location="http://localhost:10080"/>
+ </port>
+ </service>
+</definitions>
diff --git a/test/wsdl/any/expectedDriver.rb b/test/wsdl/any/expectedDriver.rb
new file mode 100644
index 0000000000..6d1827fb94
--- /dev/null
+++ b/test/wsdl/any/expectedDriver.rb
@@ -0,0 +1,54 @@
+require 'echo.rb'
+
+require 'soap/rpc/driver'
+
+class Echo_port_type < ::SOAP::RPC::Driver
+ DefaultEndpointUrl = "http://localhost:10080"
+ MappingRegistry = ::SOAP::Mapping::Registry.new
+
+ MappingRegistry.set(
+ FooBar,
+ ::SOAP::SOAPStruct,
+ ::SOAP::Mapping::Registry::TypedStructFactory,
+ { :type => XSD::QName.new("urn:example.com:echo-type", "foo.bar") }
+ )
+
+ Methods = [
+ [ XSD::QName.new("urn:example.com:echo", "echo"),
+ "urn:example.com:echo",
+ "echo",
+ [ ["in", "echoitem", ["FooBar", "urn:example.com:echo-type", "foo.bar"]],
+ ["retval", "echoitem", ["FooBar", "urn:example.com:echo-type", "foo.bar"]] ],
+ { :request_style => :rpc, :request_use => :encoded,
+ :response_style => :rpc, :response_use => :encoded }
+ ]
+ ]
+
+ def initialize(endpoint_url = nil)
+ endpoint_url ||= DefaultEndpointUrl
+ super(endpoint_url, nil)
+ self.mapping_registry = MappingRegistry
+ init_methods
+ end
+
+private
+
+ def init_methods
+ Methods.each do |definitions|
+ opt = definitions.last
+ if opt[:request_style] == :document
+ add_document_operation(*definitions)
+ else
+ add_rpc_operation(*definitions)
+ qname = definitions[0]
+ name = definitions[2]
+ if qname.name != name and qname.name.capitalize == name.capitalize
+ ::SOAP::Mapping.define_singleton_method(self, qname.name) do |*arg|
+ __send__(name, *arg)
+ end
+ end
+ end
+ end
+ end
+end
+
diff --git a/test/wsdl/any/expectedEcho.rb b/test/wsdl/any/expectedEcho.rb
new file mode 100644
index 0000000000..456950dfef
--- /dev/null
+++ b/test/wsdl/any/expectedEcho.rb
@@ -0,0 +1,14 @@
+require 'xsd/qname'
+
+# {urn:example.com:echo-type}foo.bar
+class FooBar
+ @@schema_type = "foo.bar"
+ @@schema_ns = "urn:example.com:echo-type"
+ @@schema_element = [["any", [nil, XSD::QName.new(nil, "any")]]]
+
+ attr_accessor :any
+
+ def initialize(any = nil)
+ @any = any
+ end
+end
diff --git a/test/wsdl/any/expectedService.rb b/test/wsdl/any/expectedService.rb
new file mode 100644
index 0000000000..e3885e7c6c
--- /dev/null
+++ b/test/wsdl/any/expectedService.rb
@@ -0,0 +1,52 @@
+#!/usr/bin/env ruby
+require 'echoServant.rb'
+
+require 'soap/rpc/standaloneServer'
+require 'soap/mapping/registry'
+
+class Echo_port_type
+ MappingRegistry = ::SOAP::Mapping::Registry.new
+
+ MappingRegistry.set(
+ FooBar,
+ ::SOAP::SOAPStruct,
+ ::SOAP::Mapping::Registry::TypedStructFactory,
+ { :type => XSD::QName.new("urn:example.com:echo-type", "foo.bar") }
+ )
+
+ Methods = [
+ [ XSD::QName.new("urn:example.com:echo", "echo"),
+ "urn:example.com:echo",
+ "echo",
+ [ ["in", "echoitem", ["FooBar", "urn:example.com:echo-type", "foo.bar"]],
+ ["retval", "echoitem", ["FooBar", "urn:example.com:echo-type", "foo.bar"]] ],
+ { :request_style => :rpc, :request_use => :encoded,
+ :response_style => :rpc, :response_use => :encoded }
+ ]
+ ]
+end
+
+class Echo_port_typeApp < ::SOAP::RPC::StandaloneServer
+ def initialize(*arg)
+ super(*arg)
+ servant = Echo_port_type.new
+ Echo_port_type::Methods.each do |definitions|
+ opt = definitions.last
+ if opt[:request_style] == :document
+ @router.add_document_operation(servant, *definitions)
+ else
+ @router.add_rpc_operation(servant, *definitions)
+ end
+ end
+ self.mapping_registry = Echo_port_type::MappingRegistry
+ end
+end
+
+if $0 == __FILE__
+ # Change listen port.
+ server = Echo_port_typeApp.new('app', nil, '0.0.0.0', 10080)
+ trap(:INT) do
+ server.shutdown
+ end
+ server.start
+end
diff --git a/test/wsdl/any/test_any.rb b/test/wsdl/any/test_any.rb
new file mode 100644
index 0000000000..aab5eb631f
--- /dev/null
+++ b/test/wsdl/any/test_any.rb
@@ -0,0 +1,58 @@
+require 'test/unit'
+require 'wsdl/parser'
+require 'wsdl/soap/wsdl2ruby'
+module WSDL; module Any
+
+
+class TestAny < Test::Unit::TestCase
+ DIR = File.dirname(File.expand_path(__FILE__))
+ def pathname(filename)
+ File.join(DIR, filename)
+ end
+
+ def test_any
+ gen = WSDL::SOAP::WSDL2Ruby.new
+ gen.location = pathname("any.wsdl")
+ gen.basedir = DIR
+ gen.logger.level = Logger::FATAL
+ gen.opt['classdef'] = nil
+ gen.opt['driver'] = nil
+ gen.opt['client_skelton'] = nil
+ gen.opt['servant_skelton'] = nil
+ gen.opt['standalone_server_stub'] = nil
+ gen.opt['force'] = true
+ suppress_warning do
+ gen.run
+ end
+ compare("expectedDriver.rb", "echoDriver.rb")
+ compare("expectedEcho.rb", "echo.rb")
+ compare("expectedService.rb", "echo_service.rb")
+
+ File.unlink(pathname("echo_service.rb"))
+ File.unlink(pathname("echo.rb"))
+ File.unlink(pathname("echo_serviceClient.rb"))
+ File.unlink(pathname("echoDriver.rb"))
+ File.unlink(pathname("echoServant.rb"))
+ end
+
+ def compare(expected, actual)
+ assert_equal(loadfile(expected), loadfile(actual), actual)
+ end
+
+ def loadfile(file)
+ File.open(pathname(file)) { |f| f.read }
+ end
+
+ def suppress_warning
+ back = $VERBOSE
+ $VERBOSE = nil
+ begin
+ yield
+ ensure
+ $VERBOSE = back
+ end
+ end
+end
+
+
+end; end
diff --git a/test/wsdl/axisArray/axisArray.wsdl b/test/wsdl/axisArray/axisArray.wsdl
new file mode 100644
index 0000000000..3602edb748
--- /dev/null
+++ b/test/wsdl/axisArray/axisArray.wsdl
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<wsdl:definitions name = "itemList"
+ targetNamespace="urn:jp.gr.jin.rrr.example.itemList"
+ xmlns:tns="urn:jp.gr.jin.rrr.example.itemList"
+ xmlns:typens="urn:jp.gr.jin.rrr.example.itemListType"
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+ <wsdl:types>
+ <schema targetNamespace="urn:jp.gr.jin.rrr.example.itemListType"
+ xmlns="http://www.w3.org/2001/XMLSchema">
+ <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
+ <complexType name="Item">
+ <sequence>
+ <element name="name" type="xsd:string"/>
+ </sequence>
+ </complexType>
+ <complexType name="ItemList">
+ <sequence>
+ <element maxOccurs="unbounded" minOccurs="0" name="Item" type="typens:Item"/>
+ </sequence>
+ </complexType>
+ </schema>
+ </wsdl:types>
+
+ <wsdl:message name="listItemRequest"/>
+
+ <wsdl:message name="listItemResponse">
+ <wsdl:part name="list" type="typens:ItemList"/>
+ </wsdl:message>
+
+ <wsdl:portType name="ItemListPortType">
+ <wsdl:operation name="listItem">
+ <wsdl:input message="tns:listItemRequest" name="listItemRequest"/>
+ <wsdl:output message="tns:listItemResponse" name="listItemResponse"/>
+ </wsdl:operation>
+ </wsdl:portType>
+
+ <wsdl:binding name="ItemListBinding" type="tns:ItemListPortType">
+ <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <wsdl:operation name="listItem">
+ <soap:operation soapAction=""/>
+ <wsdl:input name="listItemRequest">
+ <soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ namespace="urn:jp.gr.jin.rrr.example.itemList" use="encoded"/>
+ </wsdl:input>
+ <wsdl:output name="listItemResponse">
+ <soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ namespace="urn:jp.gr.jin.rrr.example.itemList" use="encoded"/>
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+
+ <wsdl:service name="ItemListService">
+ <wsdl:port binding="tns:ItemListBinding" name="ItemListPort">
+ <soap:address location="http://localhost:10080/"/>
+ </wsdl:port>
+ </wsdl:service>
+</wsdl:definitions>
diff --git a/test/wsdl/axisArray/itemList.rb b/test/wsdl/axisArray/itemList.rb
new file mode 100644
index 0000000000..b81297ed37
--- /dev/null
+++ b/test/wsdl/axisArray/itemList.rb
@@ -0,0 +1,27 @@
+# Generated by wsdl2ruby.rb with axisArray.wsdl.
+
+# urn:jp.gr.jin.rrr.example.itemListType
+class Item
+ @@schema_type = "Item"
+ @@schema_ns = "urn:jp.gr.jin.rrr.example.itemListType"
+
+ def name
+ @name
+ end
+
+ def name=(value)
+ @name = value
+ end
+
+ def initialize(name = nil)
+ @name = name
+ end
+end
+
+# urn:jp.gr.jin.rrr.example.itemListType
+class ItemList < Array
+ # Contents type should be dumped here...
+ @@schema_type = "ItemList"
+ @@schema_ns = "urn:jp.gr.jin.rrr.example.itemListType"
+end
+
diff --git a/test/wsdl/axisArray/test_axisarray.rb b/test/wsdl/axisArray/test_axisarray.rb
new file mode 100644
index 0000000000..9f220bb48a
--- /dev/null
+++ b/test/wsdl/axisArray/test_axisarray.rb
@@ -0,0 +1,69 @@
+require 'test/unit'
+require 'soap/processor'
+require 'soap/mapping'
+require 'soap/rpc/element'
+require 'wsdl/importer'
+require 'itemList.rb'
+
+
+module WSDL
+
+
+class TestAxisArray < Test::Unit::TestCase
+ def setup
+ @xml =<<__EOX__
+<?xml version="1.0" encoding="UTF-8"?>
+<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <soapenv:Body>
+ <ns1:listItemResponse soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="urn:jp.gr.jin.rrr.example.itemList">
+ <list href="#id0"/>
+ </ns1:listItemResponse>
+ <multiRef id="id0" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns2:ItemList" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns2="urn:jp.gr.jin.rrr.example.itemListType">
+ <Item href="#id1"/>
+ <Item href="#id2"/>
+ <Item href="#id3"/>
+ </multiRef>
+ <multiRef id="id3" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns3:Item" xmlns:ns3="urn:jp.gr.jin.rrr.example.itemListType" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
+ <name xsi:type="xsd:string">name3</name>
+ </multiRef>
+ <multiRef id="id1" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns4:Item" xmlns:ns4="urn:jp.gr.jin.rrr.example.itemListType" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
+ <name xsi:type="xsd:string">name1</name>
+ </multiRef>
+ <multiRef id="id2" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns5:Item" xmlns:ns5="urn:jp.gr.jin.rrr.example.itemListType" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
+ <name xsi:type="xsd:string">name2</name>
+ </multiRef>
+ </soapenv:Body>
+</soapenv:Envelope>
+__EOX__
+ end
+
+ def test_by_stub
+ header, body = ::SOAP::Processor.unmarshal(@xml)
+ ary = ::SOAP::Mapping.soap2obj(body.response)
+ assert_equal(3, ary.size)
+ assert_equal("name1", ary[0].name)
+ assert_equal("name2", ary[1].name)
+ assert_equal("name3", ary[2].name)
+ end
+
+ def test_by_wsdl
+ wsdlfile = File.join(File.dirname(File.expand_path(__FILE__)), 'axisArray.wsdl')
+ wsdl = WSDL::Importer.import(wsdlfile)
+ service = wsdl.services[0]
+ port = service.ports[0]
+ wsdl_types = wsdl.collect_complextypes
+ rpc_decode_typemap = wsdl_types + wsdl.soap_rpc_complextypes(port.find_binding)
+ opt = {}
+ opt[:default_encodingstyle] = ::SOAP::EncodingNamespace
+ opt[:decode_typemap] = rpc_decode_typemap
+ header, body = ::SOAP::Processor.unmarshal(@xml, opt)
+ ary = ::SOAP::Mapping.soap2obj(body.response)
+ assert_equal(3, ary.size)
+ assert_equal("name1", ary[0].name)
+ assert_equal("name2", ary[1].name)
+ assert_equal("name3", ary[2].name)
+ end
+end
+
+
+end
diff --git a/test/wsdl/datetime/DatetimeService.rb b/test/wsdl/datetime/DatetimeService.rb
new file mode 100644
index 0000000000..800e06d66f
--- /dev/null
+++ b/test/wsdl/datetime/DatetimeService.rb
@@ -0,0 +1,44 @@
+#!/usr/bin/env ruby
+require 'datetimeServant.rb'
+
+require 'soap/rpc/standaloneServer'
+require 'soap/mapping/registry'
+
+class DatetimePortType
+ MappingRegistry = ::SOAP::Mapping::Registry.new
+
+ Methods = [
+ ["now", "now",
+ [
+ ["in", "now", [::SOAP::SOAPDateTime]],
+ ["retval", "now", [::SOAP::SOAPDateTime]]
+ ],
+ "", "urn:jp.gr.jin.rrr.example.datetime", :rpc
+ ]
+ ]
+end
+
+class DatetimePortTypeApp < ::SOAP::RPC::StandaloneServer
+ def initialize(*arg)
+ super(*arg)
+ servant = DatetimePortType.new
+ DatetimePortType::Methods.each do |name_as, name, param_def, soapaction, namespace, style|
+ if style == :document
+ @router.add_document_operation(servant, soapaction, name, param_def)
+ else
+ qname = XSD::QName.new(namespace, name_as)
+ @router.add_rpc_operation(servant, qname, soapaction, name, param_def)
+ end
+ end
+ self.mapping_registry = DatetimePortType::MappingRegistry
+ end
+end
+
+if $0 == __FILE__
+ # Change listen port.
+ server = DatetimePortTypeApp.new('app', nil, '0.0.0.0', 10080)
+ trap(:INT) do
+ server.shutdown
+ end
+ server.start
+end
diff --git a/test/rubygems/foo/discover.rb b/test/wsdl/datetime/datetime.rb
index e69de29bb2..e69de29bb2 100644
--- a/test/rubygems/foo/discover.rb
+++ b/test/wsdl/datetime/datetime.rb
diff --git a/test/wsdl/datetime/datetime.wsdl b/test/wsdl/datetime/datetime.wsdl
new file mode 100644
index 0000000000..4998dc48d6
--- /dev/null
+++ b/test/wsdl/datetime/datetime.wsdl
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<wsdl:definitions name = "datetime"
+ targetNamespace="urn:jp.gr.jin.rrr.example.datetime"
+ xmlns:tns="urn:jp.gr.jin.rrr.example.datetime"
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+
+ <wsdl:message name="nowRequest">
+ <wsdl:part name="now" type="xsd:dateTime"/>
+ </wsdl:message>
+
+ <wsdl:message name="nowResponse">
+ <wsdl:part name="now" type="xsd:dateTime"/>
+ </wsdl:message>
+
+ <wsdl:portType name="DatetimePortType">
+ <wsdl:operation name="now">
+ <wsdl:input message="tns:nowRequest" name="nowRequest"/>
+ <wsdl:output message="tns:nowResponse" name="nowResponse"/>
+ </wsdl:operation>
+ </wsdl:portType>
+
+ <wsdl:binding name="DatetimeBinding" type="tns:DatetimePortType">
+ <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <wsdl:operation name="now">
+ <soap:operation soapAction=""/>
+ <wsdl:input name="nowRequest">
+ <soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ namespace="urn:jp.gr.jin.rrr.example.datetime" use="encoded"/>
+ </wsdl:input>
+ <wsdl:output name="nowResponse">
+ <soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ namespace="urn:jp.gr.jin.rrr.example.datetime" use="encoded"/>
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+
+ <wsdl:service name="DatetimeService">
+ <wsdl:port binding="tns:DatetimeBinding" name="DatetimePort">
+ <soap:address location="http://localhost:10080/"/>
+ </wsdl:port>
+ </wsdl:service>
+</wsdl:definitions>
diff --git a/test/wsdl/datetime/datetimeServant.rb b/test/wsdl/datetime/datetimeServant.rb
new file mode 100644
index 0000000000..14145c42e5
--- /dev/null
+++ b/test/wsdl/datetime/datetimeServant.rb
@@ -0,0 +1,21 @@
+require 'datetime.rb'
+
+class DatetimePortType
+ # SYNOPSIS
+ # now(now)
+ #
+ # ARGS
+ # now - {http://www.w3.org/2001/XMLSchema}dateTime
+ #
+ # RETURNS
+ # now - {http://www.w3.org/2001/XMLSchema}dateTime
+ #
+ # RAISES
+ # (undefined)
+ #
+ def now(now)
+ #raise NotImplementedError.new
+ now + 1
+ end
+end
+
diff --git a/test/wsdl/datetime/test_datetime.rb b/test/wsdl/datetime/test_datetime.rb
new file mode 100644
index 0000000000..7652318205
--- /dev/null
+++ b/test/wsdl/datetime/test_datetime.rb
@@ -0,0 +1,82 @@
+require 'test/unit'
+require 'soap/wsdlDriver'
+require 'DatetimeService.rb'
+
+
+module WSDL
+module Datetime
+
+
+class TestDatetime < Test::Unit::TestCase
+ DIR = File.dirname(File.expand_path(__FILE__))
+
+ Port = 17171
+
+ def setup
+ setup_server
+ setup_client
+ end
+
+ def setup_server
+ @server = DatetimePortTypeApp.new('Datetime server', nil, '0.0.0.0', Port)
+ @server.level = Logger::Severity::ERROR
+ @t = Thread.new {
+ Thread.current.abort_on_exception = true
+ @server.start
+ }
+ end
+
+ def setup_client
+ wsdl = File.join(DIR, 'datetime.wsdl')
+ @client = ::SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver
+ @client.endpoint_url = "http://localhost:#{Port}/"
+ @client.generate_explicit_type = true
+ @client.wiredump_dev = STDOUT if $DEBUG
+ end
+
+ def teardown
+ teardown_server
+ teardown_client
+ end
+
+ def teardown_server
+ @server.shutdown
+ @t.kill
+ @t.join
+ end
+
+ def teardown_client
+ @client.reset_stream
+ end
+
+ def test_datetime
+ d = DateTime.now
+ d1 = d + 1
+ d2 = @client.now(d)
+ assert_equal(d1.year, d2.year)
+ assert_equal(d1.month, d2.month)
+ assert_equal(d1.day, d2.day)
+ assert_equal(d1.hour, d2.hour)
+ assert_equal(d1.min, d2.min)
+ assert_equal(d1.sec, d2.sec)
+ assert_equal(d1.sec, d2.sec)
+ end
+
+ def test_time
+ d = DateTime.now
+ t = Time.gm(d.year, d.month, d.day, d.hour, d.min, d.sec)
+ d1 = d + 1
+ d2 = @client.now(t)
+ assert_equal(d1.year, d2.year)
+ assert_equal(d1.month, d2.month)
+ assert_equal(d1.day, d2.day)
+ assert_equal(d1.hour, d2.hour)
+ assert_equal(d1.min, d2.min)
+ assert_equal(d1.sec, d2.sec)
+ assert_equal(d1.sec, d2.sec)
+ end
+end
+
+
+end
+end
diff --git a/test/wsdl/document/document.wsdl b/test/wsdl/document/document.wsdl
new file mode 100644
index 0000000000..fbf03fae8b
--- /dev/null
+++ b/test/wsdl/document/document.wsdl
@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="utf-8"?>
+<definitions
+ name="echo"
+ targetNamespace="urn:docrpc"
+ xmlns:tns="urn:docrpc"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns="http://schemas.xmlsoap.org/wsdl/">
+ <types>
+ <xsd:schema elementFormDefault="unqualified" targetNamespace="urn:docrpc">
+ <xsd:complexType name="echo_struct">
+ <xsd:sequence>
+ <xsd:element minOccurs="0" maxOccurs="1" name="m_string" type="xsd:string" />
+ <xsd:element minOccurs="0" maxOccurs="1" name="m_datetime" type="xsd:dateTime" />
+ </xsd:sequence>
+ <xsd:attribute name="m_attr" type="xsd:string" />
+ </xsd:complexType>
+
+ <xsd:element name="echoele">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element minOccurs="0" maxOccurs="1" name="struct1" type="tns:echo_struct" />
+ <xsd:element minOccurs="0" maxOccurs="1" name="struct-2" type="tns:echo_struct" />
+ </xsd:sequence>
+ <xsd:attribute name="attr_string" type="xsd:string" />
+ <xsd:attribute name="attr-int" type="xsd:int" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="echo_response">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element minOccurs="0" maxOccurs="1" name="struct1" type="tns:echo_struct" />
+ <xsd:element minOccurs="0" maxOccurs="1" name="struct-2" type="tns:echo_struct" />
+ </xsd:sequence>
+ <xsd:attribute name="attr_string" type="xsd:string" />
+ <xsd:attribute name="attr-int" type="xsd:int" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ </types>
+
+ <message name="echo_in">
+ <part name="parameters" element="tns:echoele" />
+ </message>
+ <message name="echo_out">
+ <part name="parameters" element="tns:echo_response" />
+ </message>
+
+ <portType name="docrpc_porttype">
+ <operation name="echo">
+ <input message="tns:echo_in" />
+ <output message="tns:echo_out" />
+ </operation>
+ </portType>
+
+ <binding name="docrpc_binding" type="tns:docrpc_porttype">
+ <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
+ <operation name="echo">
+ <soap:operation soapAction="urn:docrpc:echo" style="document" />
+ <input>
+ <soap:body use="literal" />
+ </input>
+ <output>
+ <soap:body use="literal" />
+ </output>
+ </operation>
+ </binding>
+
+ <service name="docrpc_service">
+ <port name="docprc_service_port" binding="tns:docrpc_binding">
+ <soap:address location="http://localhost:17171/" />
+ </port>
+ </service>
+</definitions>
diff --git a/test/wsdl/document/echo.rb b/test/wsdl/document/echo.rb
new file mode 100644
index 0000000000..c6df75aca0
--- /dev/null
+++ b/test/wsdl/document/echo.rb
@@ -0,0 +1,92 @@
+require 'xsd/qname'
+
+# {urn:docrpc}echoele
+class Echoele
+ @@schema_type = "echoele"
+ @@schema_ns = "urn:docrpc"
+ @@schema_attribute = {XSD::QName.new(nil, "attr_string") => "SOAP::SOAPString", XSD::QName.new(nil, "attr-int") => "SOAP::SOAPInt"}
+ @@schema_element = [["struct1", ["Echo_struct", XSD::QName.new(nil, "struct1")]], ["struct_2", ["Echo_struct", XSD::QName.new(nil, "struct-2")]]]
+
+ attr_accessor :struct1
+ attr_accessor :struct_2
+
+ def xmlattr_attr_string
+ (@__xmlattr ||= {})[XSD::QName.new(nil, "attr_string")]
+ end
+
+ def xmlattr_attr_string=(value)
+ (@__xmlattr ||= {})[XSD::QName.new(nil, "attr_string")] = value
+ end
+
+ def xmlattr_attr_int
+ (@__xmlattr ||= {})[XSD::QName.new(nil, "attr-int")]
+ end
+
+ def xmlattr_attr_int=(value)
+ (@__xmlattr ||= {})[XSD::QName.new(nil, "attr-int")] = value
+ end
+
+ def initialize(struct1 = nil, struct_2 = nil)
+ @struct1 = struct1
+ @struct_2 = struct_2
+ @__xmlattr = {}
+ end
+end
+
+# {urn:docrpc}echo_response
+class Echo_response
+ @@schema_type = "echo_response"
+ @@schema_ns = "urn:docrpc"
+ @@schema_attribute = {XSD::QName.new(nil, "attr_string") => "SOAP::SOAPString", XSD::QName.new(nil, "attr-int") => "SOAP::SOAPInt"}
+ @@schema_element = [["struct1", ["Echo_struct", XSD::QName.new(nil, "struct1")]], ["struct_2", ["Echo_struct", XSD::QName.new(nil, "struct-2")]]]
+
+ attr_accessor :struct1
+ attr_accessor :struct_2
+
+ def xmlattr_attr_string
+ (@__xmlattr ||= {})[XSD::QName.new(nil, "attr_string")]
+ end
+
+ def xmlattr_attr_string=(value)
+ (@__xmlattr ||= {})[XSD::QName.new(nil, "attr_string")] = value
+ end
+
+ def xmlattr_attr_int
+ (@__xmlattr ||= {})[XSD::QName.new(nil, "attr-int")]
+ end
+
+ def xmlattr_attr_int=(value)
+ (@__xmlattr ||= {})[XSD::QName.new(nil, "attr-int")] = value
+ end
+
+ def initialize(struct1 = nil, struct_2 = nil)
+ @struct1 = struct1
+ @struct_2 = struct_2
+ @__xmlattr = {}
+ end
+end
+
+# {urn:docrpc}echo_struct
+class Echo_struct
+ @@schema_type = "echo_struct"
+ @@schema_ns = "urn:docrpc"
+ @@schema_attribute = {XSD::QName.new(nil, "m_attr") => "SOAP::SOAPString"}
+ @@schema_element = [["m_string", ["SOAP::SOAPString", XSD::QName.new(nil, "m_string")]], ["m_datetime", ["SOAP::SOAPDateTime", XSD::QName.new(nil, "m_datetime")]]]
+
+ attr_accessor :m_string
+ attr_accessor :m_datetime
+
+ def xmlattr_m_attr
+ (@__xmlattr ||= {})[XSD::QName.new(nil, "m_attr")]
+ end
+
+ def xmlattr_m_attr=(value)
+ (@__xmlattr ||= {})[XSD::QName.new(nil, "m_attr")] = value
+ end
+
+ def initialize(m_string = nil, m_datetime = nil)
+ @m_string = m_string
+ @m_datetime = m_datetime
+ @__xmlattr = {}
+ end
+end
diff --git a/test/wsdl/document/number.wsdl b/test/wsdl/document/number.wsdl
new file mode 100644
index 0000000000..cc3dd8e9f0
--- /dev/null
+++ b/test/wsdl/document/number.wsdl
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="utf-8"?>
+<definitions
+ name="foo"
+ targetNamespace="urn:foo"
+ xmlns:tns="urn:foo"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns="http://schemas.xmlsoap.org/wsdl/">
+ <types>
+ <xsd:schema elementFormDefault="unqualified" targetNamespace="urn:foo">
+ <xsd:element name="get_foo">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element minOccurs="0" maxOccurs="1" name="number" type="xsd:string" />
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ </types>
+
+ <message name="get_foo_in">
+ <part name="parameters" element="tns:get_foo" />
+ </message>
+ <message name="get_foo_out">
+ <part name="parameters" type="xsd:string" />
+ </message>
+
+ <portType name="foo_porttype">
+ <operation name="get_foo">
+ <input message="tns:get_foo_in" />
+ <output message="tns:get_foo_out" />
+ </operation>
+ </portType>
+
+ <binding name="foo_binding" type="tns:foo_porttype">
+ <soap:binding transport="http://schemas.xmlsoap.org/soap/http"
+ style="document" />
+ <operation name="get_foo">
+ <soap:operation soapAction="urn:foo:get_foo" style="document" />
+ <input>
+ <soap:body use="literal" />
+ </input>
+ <output>
+ <soap:body use="literal" />
+ </output>
+ </operation>
+ </binding>
+
+ <service name="foo_service">
+ <port name="foo_service_port" binding="tns:foo_binding">
+ <soap:address location="http://localhost:17171/" />
+ </port>
+ </service>
+</definitions>
diff --git a/test/wsdl/document/ping_nosoapaction.wsdl b/test/wsdl/document/ping_nosoapaction.wsdl
new file mode 100644
index 0000000000..ab9529e456
--- /dev/null
+++ b/test/wsdl/document/ping_nosoapaction.wsdl
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="utf-8"?>
+<definitions xmlns:tns="http://xmlsoap.org/Ping"
+xmlns="http://schemas.xmlsoap.org/wsdl/"
+xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+targetNamespace="http://xmlsoap.org/Ping" name="Ping">
+ <types>
+ <schema targetNamespace="http://xmlsoap.org/Ping"
+ xmlns="http://www.w3.org/2001/XMLSchema"
+ elementFormDefault="qualified">
+ <complexType name="ping">
+ <sequence>
+ <element name="scenario" type="xsd:string"
+ nillable="true"/>
+ <element name="origin" type="xsd:string"
+ nillable="true"/>
+ <element name="text" type="xsd:string"
+ nillable="true"/>
+ </sequence>
+ </complexType>
+ <complexType name="pingResponse">
+ <sequence>
+ <element name="scenario" type="xsd:string"
+ nillable="true"/>
+ <element name="origin" type="xsd:string"
+ nillable="true"/>
+ <element name="text" type="xsd:string"
+ nillable="true"/>
+ </sequence>
+ </complexType>
+ <element name="Ping" type="tns:ping"/>
+ <element name="PingResponse" type="tns:pingResponse"/>
+ </schema>
+ </types>
+ <message name="PingRequest">
+ <part name="ping" element="tns:Ping"/>
+ </message>
+ <message name="PingResponse">
+ <part name="pingResponse" element="tns:PingResponse"/>
+ </message>
+ <portType name="PingPort">
+ <operation name="Ping">
+ <input message="tns:PingRequest"/>
+ <output message="tns:PingResponse"/>
+ </operation>
+ </portType>
+ <binding name="PingBinding" type="tns:PingPort">
+ <soap:binding style="document"
+ transport="http://schemas.xmlsoap.org/soap/http"/>
+ <operation name="Ping">
+ <soap:operation/>
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ </operation>
+ </binding>
+ <service name="PingService">
+ <port name="PingPort" binding="tns:PingBinding">
+ <soap:address
+ location="http://127.0.0.1:8080/axis/services/PingPort"/>
+ </port>
+ </service>
+</definitions>
diff --git a/test/wsdl/document/test_nosoapaction.rb b/test/wsdl/document/test_nosoapaction.rb
new file mode 100644
index 0000000000..77f642fe1b
--- /dev/null
+++ b/test/wsdl/document/test_nosoapaction.rb
@@ -0,0 +1,109 @@
+require 'test/unit'
+require 'wsdl/parser'
+require 'wsdl/soap/wsdl2ruby'
+require 'soap/rpc/standaloneServer'
+require 'soap/wsdlDriver'
+require 'soap/rpc/driver'
+
+
+module WSDL; module Document
+
+
+class TestNoSOAPAction < Test::Unit::TestCase
+ class Server < ::SOAP::RPC::StandaloneServer
+ Namespace = 'http://xmlsoap.org/Ping'
+
+ def on_init
+ add_document_method(
+ self,
+ Namespace + '/ping',
+ 'ping_with_soapaction',
+ XSD::QName.new(Namespace, 'Ping'),
+ XSD::QName.new(Namespace, 'PingResponse')
+ )
+
+ add_document_method(
+ self,
+ nil,
+ 'ping',
+ XSD::QName.new(Namespace, 'Ping'),
+ XSD::QName.new(Namespace, 'PingResponse')
+ )
+
+ # When no SOAPAction given, latter method(ping) is called.
+ end
+
+ def ping(arg)
+ arg.text = 'ping'
+ arg
+ end
+
+ def ping_with_soapaction(arg)
+ arg.text = 'ping_with_soapaction'
+ arg
+ end
+ end
+
+ DIR = File.dirname(File.expand_path(__FILE__))
+
+ Port = 17171
+
+ def setup
+ setup_server
+ @client = nil
+ end
+
+ def teardown
+ teardown_server
+ @client.reset_stream if @client
+ end
+
+ def setup_server
+ @server = Server.new('Test', Server::Namespace, '0.0.0.0', Port)
+ @server.level = Logger::Severity::ERROR
+ @server_thread = start_server_thread(@server)
+ end
+
+ def teardown_server
+ @server.shutdown
+ @server_thread.kill
+ @server_thread.join
+ end
+
+ def start_server_thread(server)
+ t = Thread.new {
+ Thread.current.abort_on_exception = true
+ server.start
+ }
+ t
+ end
+
+ def test_with_soapaction
+ wsdl = File.join(DIR, 'ping_nosoapaction.wsdl')
+ @client = ::SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver
+ @client.endpoint_url = "http://localhost:#{Port}/"
+ @client.wiredump_dev = STDOUT if $DEBUG
+ rv = @client.ping(:scenario => 'scenario', :origin => 'origin',
+ :text => 'text')
+ assert_equal('scenario', rv.scenario)
+ assert_equal('origin', rv.origin)
+ assert_equal('ping', rv.text)
+ end
+
+ def test_without_soapaction
+ @client = ::SOAP::RPC::Driver.new("http://localhost:#{Port}/",
+ Server::Namespace)
+ @client.add_document_method('ping', Server::Namespace + '/ping',
+ XSD::QName.new(Server::Namespace, 'Ping'),
+ XSD::QName.new(Server::Namespace, 'PingResponse'))
+ @client.wiredump_dev = STDOUT if $DEBUG
+ rv = @client.ping(:scenario => 'scenario', :origin => 'origin',
+ :text => 'text')
+ assert_equal('scenario', rv.scenario)
+ assert_equal('origin', rv.origin)
+ assert_equal('ping_with_soapaction', rv.text)
+ end
+end
+
+
+end; end
diff --git a/test/wsdl/document/test_number.rb b/test/wsdl/document/test_number.rb
new file mode 100644
index 0000000000..a640ef2a25
--- /dev/null
+++ b/test/wsdl/document/test_number.rb
@@ -0,0 +1,99 @@
+require 'test/unit'
+require 'wsdl/parser'
+require 'wsdl/soap/wsdl2ruby'
+require 'soap/rpc/standaloneServer'
+require 'soap/wsdlDriver'
+
+
+module WSDL; module Document
+
+
+class TestNumber < Test::Unit::TestCase
+ class Server < ::SOAP::RPC::StandaloneServer
+ Namespace = 'urn:foo'
+
+ def on_init
+ add_document_method(
+ self,
+ Namespace + ':get_foo',
+ 'get_foo',
+ XSD::QName.new(Namespace, 'get_foo'),
+ XSD::QName.new(Namespace, 'get_foo_response')
+ )
+ end
+
+ def get_foo(arg)
+ arg.number
+ end
+ end
+
+ DIR = File.dirname(File.expand_path(__FILE__))
+ Port = 17171
+
+ def setup
+ setup_server
+ setup_classdef
+ @client = nil
+ end
+
+ def teardown
+ teardown_server
+ File.unlink(pathname('foo.rb'))
+ @client.reset_stream if @client
+ end
+
+ def setup_server
+ @server = Server.new('Test', "urn:rpc", '0.0.0.0', Port)
+ @server.level = Logger::Severity::ERROR
+ @server_thread = start_server_thread(@server)
+ end
+
+ def setup_classdef
+ gen = WSDL::SOAP::WSDL2Ruby.new
+ gen.location = pathname("number.wsdl")
+ gen.basedir = DIR
+ gen.logger.level = Logger::FATAL
+ gen.opt['classdef'] = nil
+ gen.opt['force'] = true
+ gen.run
+ require pathname('foo')
+ end
+
+ def teardown_server
+ @server.shutdown
+ @server_thread.kill
+ @server_thread.join
+ end
+
+ def start_server_thread(server)
+ t = Thread.new {
+ Thread.current.abort_on_exception = true
+ server.start
+ }
+ t
+ end
+
+ def pathname(filename)
+ File.join(DIR, filename)
+ end
+
+ def test_wsdl
+ wsdl = File.join(DIR, 'number.wsdl')
+ @client = ::SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver
+ @client.endpoint_url = "http://localhost:#{Port}/"
+ @client.wiredump_dev = STDOUT if $DEBUG
+
+ # with the Struct defined in foo.rb, which is generated from WSDL
+ assert_equal("12345", @client.get_foo(Get_foo.new("12345")))
+
+ # with Hash
+ assert_equal("12345", @client.get_foo({:number => "12345"}))
+
+ # with Original struct
+ get_foo_struct = Struct.new(:number)
+ assert_equal("12345", @client.get_foo(get_foo_struct.new("12345")))
+ end
+end
+
+
+end; end
diff --git a/test/wsdl/document/test_rpc.rb b/test/wsdl/document/test_rpc.rb
new file mode 100644
index 0000000000..56cd0677ad
--- /dev/null
+++ b/test/wsdl/document/test_rpc.rb
@@ -0,0 +1,177 @@
+require 'test/unit'
+require 'wsdl/parser'
+require 'wsdl/soap/wsdl2ruby'
+require 'soap/rpc/standaloneServer'
+require 'soap/wsdlDriver'
+
+
+module WSDL; module Document
+
+
+class TestRPC < Test::Unit::TestCase
+ class Server < ::SOAP::RPC::StandaloneServer
+ Namespace = 'urn:docrpc'
+
+ def on_init
+ add_document_method(
+ self,
+ Namespace + ':echo',
+ 'echo',
+ XSD::QName.new(Namespace, 'echo'),
+ XSD::QName.new(Namespace, 'echo_response')
+ )
+ end
+
+ def echo(arg)
+ if arg.is_a?(Echoele)
+ # swap args
+ tmp = arg.struct1
+ arg.struct1 = arg.struct_2
+ arg.struct_2 = tmp
+ arg
+ else
+ # swap args
+ tmp = arg["struct1"]
+ arg["struct1"] = arg["struct-2"]
+ arg["struct-2"] = tmp
+ arg
+ end
+ end
+ end
+
+ DIR = File.dirname(File.expand_path(__FILE__))
+
+ Port = 17171
+
+ def setup
+ setup_server
+ setup_classdef
+ @client = nil
+ end
+
+ def teardown
+ teardown_server
+ #File.unlink(pathname('echo.rb'))
+ @client.reset_stream if @client
+ end
+
+ def setup_server
+ @server = Server.new('Test', "urn:rpc", '0.0.0.0', Port)
+ @server.level = Logger::Severity::ERROR
+ @server_thread = start_server_thread(@server)
+ end
+
+ def setup_classdef
+ gen = WSDL::SOAP::WSDL2Ruby.new
+ gen.location = pathname("document.wsdl")
+ gen.basedir = DIR
+ gen.logger.level = Logger::FATAL
+ gen.opt['classdef'] = nil
+ gen.opt['force'] = true
+ gen.run
+ require pathname('echo')
+ end
+
+ def teardown_server
+ @server.shutdown
+ @server_thread.kill
+ @server_thread.join
+ end
+
+ def start_server_thread(server)
+ t = Thread.new {
+ Thread.current.abort_on_exception = true
+ server.start
+ }
+ t
+ end
+
+ def pathname(filename)
+ File.join(DIR, filename)
+ end
+
+ def test_wsdl
+ wsdl = File.join(DIR, 'document.wsdl')
+ @client = ::SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver
+ @client.endpoint_url = "http://localhost:#{Port}/"
+ @client.wiredump_dev = STDOUT if $DEBUG
+
+ struct1 = Echo_struct.new("mystring1", now1 = Time.now)
+ struct1.xmlattr_m_attr = 'myattr1'
+ struct2 = Echo_struct.new("mystring2", now2 = Time.now)
+ struct2.xmlattr_m_attr = 'myattr2'
+ echo = Echoele.new(struct1, struct2)
+ echo.xmlattr_attr_string = 'attr_string'
+ echo.xmlattr_attr_int = 5
+ ret = @client.echo(echo)
+
+ # struct#m_datetime in a response is a DateTime even though
+ # struct#m_datetime in a request is a Time.
+ timeformat = "%Y-%m-%dT%H:%M:%S"
+ assert_equal("mystring2", ret.struct1.m_string)
+ assert_equal(now2.strftime(timeformat),
+ date2time(ret.struct1.m_datetime).strftime(timeformat))
+ assert_equal("mystring1", ret.struct_2.m_string)
+ assert_equal(now1.strftime(timeformat),
+ date2time(ret.struct_2.m_datetime).strftime(timeformat))
+ assert_equal("attr_string", ret.xmlattr_attr_string)
+ assert_equal(5, ret.xmlattr_attr_int)
+ end
+
+ def date2time(date)
+ if date.respond_to?(:to_time)
+ date.to_time
+ else
+ d = date.new_offset(0)
+ d.instance_eval {
+ Time.utc(year, mon, mday, hour, min, sec,
+ (sec_fraction * 86400000000).to_i)
+ }.getlocal
+ end
+ end
+
+ include ::SOAP
+ def test_naive
+ @client = ::SOAP::RPC::Driver.new("http://localhost:#{Port}/")
+ @client.add_document_method('echo', 'urn:docrpc:echo',
+ XSD::QName.new('urn:docrpc', 'echoele'),
+ XSD::QName.new('urn:docrpc', 'echo_response'))
+ @client.wiredump_dev = STDOUT if $DEBUG
+
+ echo = SOAPElement.new('foo')
+ echo.extraattr['attr_string'] = 'attr_string'
+ echo.extraattr['attr-int'] = 5
+ echo.add(struct1 = SOAPElement.new('struct1'))
+ struct1.add(SOAPElement.new('m_string', 'mystring1'))
+ struct1.add(SOAPElement.new('m_datetime', '2005-03-17T19:47:31+01:00'))
+ struct1.extraattr['m_attr'] = 'myattr1'
+ echo.add(struct2 = SOAPElement.new('struct-2'))
+ struct2.add(SOAPElement.new('m_string', 'mystring2'))
+ struct2.add(SOAPElement.new('m_datetime', '2005-03-17T19:47:32+02:00'))
+ struct2.extraattr['m_attr'] = 'myattr2'
+ ret = @client.echo(echo)
+ timeformat = "%Y-%m-%dT%H:%M:%S"
+ assert_equal('mystring2', ret.struct1.m_string)
+ assert_equal('2005-03-17T19:47:32',
+ ret.struct1.m_datetime.strftime(timeformat))
+ assert_equal("mystring1", ret.struct_2.m_string)
+ assert_equal('2005-03-17T19:47:31',
+ ret.struct_2.m_datetime.strftime(timeformat))
+ assert_equal('attr_string', ret.xmlattr_attr_string)
+ assert_equal(5, ret.xmlattr_attr_int)
+
+ echo = {'struct1' => {'m_string' => 'mystring1', 'm_datetime' => '2005-03-17T19:47:31+01:00'},
+ 'struct-2' => {'m_string' => 'mystring2', 'm_datetime' => '2005-03-17T19:47:32+02:00'}}
+ ret = @client.echo(echo)
+ timeformat = "%Y-%m-%dT%H:%M:%S"
+ assert_equal('mystring2', ret.struct1.m_string)
+ assert_equal('2005-03-17T19:47:32',
+ ret.struct1.m_datetime.strftime(timeformat))
+ assert_equal("mystring1", ret.struct_2.m_string)
+ assert_equal('2005-03-17T19:47:31',
+ ret.struct_2.m_datetime.strftime(timeformat))
+ end
+end
+
+
+end; end
diff --git a/test/wsdl/emptycomplextype.wsdl b/test/wsdl/emptycomplextype.wsdl
new file mode 100644
index 0000000000..4f8dc4849c
--- /dev/null
+++ b/test/wsdl/emptycomplextype.wsdl
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="utf-8"?>
+<definitions name = "emptycomplextype"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="urn:jp.gr.jin.rrr.example.emptycomplextype"
+ xmlns="http://schemas.xmlsoap.org/wsdl/">
+
+ <types>
+ <xsd:schema elementFormDefault="qualified"
+ targetNamespace="urn:jp.gr.jin.rrr.example.emptycomplextype">
+ <xsd:element name="typeIn">
+ <xsd:complexType />
+ </xsd:element>
+
+ <xsd:element name="typeOut">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element minOccurs="0" maxOccurs="1" name="str1" type="xsd:string" />
+ <xsd:element minOccurs="0" maxOccurs="1" name="str2" type="xsd:string" />
+ <xsd:element minOccurs="0" maxOccurs="1" name="seq">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:any />
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ </types>
+</definitions>
diff --git a/test/wsdl/map/map.wsdl b/test/wsdl/map/map.wsdl
new file mode 100644
index 0000000000..e418a4cbbd
--- /dev/null
+++ b/test/wsdl/map/map.wsdl
@@ -0,0 +1,92 @@
+<?xml version="1.0"?>
+<definitions
+ name="map"
+ targetNamespace="urn:map"
+ xmlns:tns="urn:map"
+ xmlns:txd="urn:map"
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:apachesoap="http://xml.apache.org/xml-soap">
+
+ <types>
+ <schema
+ xmlns="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="http://xml.apache.org/xml-soap">
+ <complexType name="Map">
+ <sequence>
+ <element name="item" minOccurs="0" maxOccurs="unbounded">
+ <complexType>
+ <sequence>
+ <element name="key" type="xsd:anyType" />
+ <element name="value" type="xsd:anyType" />
+ </sequence>
+ </complexType>
+ </element>
+ </sequence>
+ </complexType>
+ </schema>
+ </types>
+
+ <message name="mapRequest"/>
+ <message name="mapResponse">
+ <part name="return" type="apachesoap:Map"/>
+ </message>
+
+ <message name="map2Request">
+ <part name="arg" type="apachesoap:Map"/>
+ </message>
+ <message name="map2Response">
+ <part name="return" type="apachesoap:Map"/>
+ </message>
+
+ <portType name="MapServicePortType">
+ <operation name="map" parameterOrder="">
+ <input message="tns:mapRequest"/>
+ <output message="tns:mapResponse"/>
+ </operation>
+
+ <operation name="map2" parameterOrder="">
+ <input message="tns:map2Request"/>
+ <output message="tns:map2Response"/>
+ </operation>
+ </portType>
+
+ <binding name="MapServicePortBinding" type="tns:MapServicePortType">
+ <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <operation name="map">
+ <soap:operation soapAction=""/>
+ <input>
+ <soap:body use="encoded"
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ namespace="urn:map"/>
+ </input>
+ <output>
+ <soap:body use="encoded"
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ namespace="urn:map"/>
+ </output>
+ </operation>
+
+ <operation name="map2">
+ <soap:operation soapAction=""/>
+ <input>
+ <soap:body use="encoded"
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ namespace="urn:map"/>
+ </input>
+ <output>
+ <soap:body use="encoded"
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ namespace="urn:map"/>
+ </output>
+ </operation>
+ </binding>
+
+ <service name="MapService">
+ <port name="MapServicePort" binding="tns:MapServicePortBinding">
+ <soap:address location="http://raa.ruby-lang.org/soap/1.0.2/"/>
+ </port>
+ </service>
+</definitions>
diff --git a/test/wsdl/map/map.xml b/test/wsdl/map/map.xml
new file mode 100644
index 0000000000..7106735ffc
--- /dev/null
+++ b/test/wsdl/map/map.xml
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <env:Body>
+ <n2:mapResponse xmlns:n1="http://schemas.xmlsoap.org/soap/encoding/" xmlns:n2="http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/" env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
+ <return xmlns:n3="http://xml.apache.org/xml-soap" xsi:type="n3:Map">
+ <item>
+ <key xsi:type="xsd:string">a</key>
+ <value xsi:type="n3:Map">
+ <item>
+ <key xsi:type="xsd:string">a1</key>
+ <value xsi:type="n1:Array" n1:arrayType="xsd:anyType[1]">
+ <item xsi:type="xsd:string">a1</item>
+ </value>
+ </item>
+ <item>
+ <key xsi:type="xsd:string">a2</key>
+ <value xsi:type="n1:Array" n1:arrayType="xsd:anyType[1]">
+ <item xsi:type="xsd:string">a2</item>
+ </value>
+ </item>
+ </value>
+ </item>
+ <item>
+ <key xsi:type="xsd:string">b</key>
+ <value xsi:type="n3:Map">
+ <item>
+ <key xsi:type="xsd:string">b1</key>
+ <value xsi:type="n1:Array" n1:arrayType="xsd:anyType[1]">
+ <item xsi:type="xsd:string">b1</item>
+ </value>
+ </item>
+ <item>
+ <key xsi:type="xsd:string">b2</key>
+ <value xsi:type="n1:Array" n1:arrayType="xsd:anyType[1]">
+ <item xsi:type="xsd:string">b2</item>
+ </value>
+ </item>
+ </value>
+ </item>
+ </return>
+ </n2:mapResponse>
+ </env:Body>
+</env:Envelope>
diff --git a/test/wsdl/map/test_map.rb b/test/wsdl/map/test_map.rb
new file mode 100644
index 0000000000..68f7d76e05
--- /dev/null
+++ b/test/wsdl/map/test_map.rb
@@ -0,0 +1,99 @@
+require 'test/unit'
+require 'soap/rpc/httpserver'
+require 'soap/wsdlDriver'
+
+
+module WSDL
+
+
+class TestMap < Test::Unit::TestCase
+ Port = 17171
+ DIR = File.dirname(File.expand_path(__FILE__))
+
+ class Server < ::SOAP::RPC::HTTPServer
+ def on_init
+ add_method(self, 'map')
+ add_method(self, 'map2', 'arg')
+ end
+
+ def map
+ {1 => "a", 2 => "b"}
+ end
+
+ def map2(arg)
+ arg
+ end
+ end
+
+ def setup
+ setup_server
+ setup_client
+ end
+
+ def setup_server
+ @server = Server.new(
+ :BindAddress => "0.0.0.0",
+ :Port => Port,
+ :AccessLog => [],
+ :SOAPDefaultNamespace => "urn:map"
+ )
+ @server.level = Logger::Severity::ERROR
+ @t = Thread.new {
+ Thread.current.abort_on_exception = true
+ @server.start
+ }
+ end
+
+ def setup_client
+ wsdl = File.join(DIR, 'map.wsdl')
+ @client = ::SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver
+ @client.endpoint_url = "http://localhost:#{Port}/"
+ @client.generate_explicit_type = true
+ @client.wiredump_dev = STDOUT if $DEBUG
+ end
+
+ def teardown
+ teardown_server
+ teardown_client
+ end
+
+ def teardown_server
+ @server.shutdown
+ @t.kill
+ @t.join
+ end
+
+ def teardown_client
+ @client.reset_stream
+ end
+
+ def test_by_wsdl
+ dir = File.dirname(File.expand_path(__FILE__))
+ wsdlfile = File.join(dir, 'map.wsdl')
+ xml = File.open(File.join(dir, 'map.xml')) { |f| f.read }
+ wsdl = WSDL::Importer.import(wsdlfile)
+ service = wsdl.services[0]
+ port = service.ports[0]
+ wsdl_types = wsdl.collect_complextypes
+ rpc_decode_typemap = wsdl_types + wsdl.soap_rpc_complextypes(port.find_binding)
+ opt = {}
+ opt[:default_encodingstyle] = ::SOAP::EncodingNamespace
+ opt[:decode_typemap] = rpc_decode_typemap
+ header, body = ::SOAP::Processor.unmarshal(xml, opt)
+ map = ::SOAP::Mapping.soap2obj(body.response)
+ assert_equal(["a1"], map["a"]["a1"])
+ assert_equal(["a2"], map["a"]["a2"])
+ assert_equal(["b1"], map["b"]["b1"])
+ assert_equal(["b2"], map["b"]["b2"])
+ end
+
+ def test_wsdldriver
+ assert_equal({1 => "a", 2 => "b"}, @client.map)
+ assert_equal({1 => 2}, @client.map2({1 => 2}))
+ assert_equal({1 => {2 => 3}}, @client.map2({1 => {2 => 3}}))
+ assert_equal({["a", 2] => {2 => 3}}, @client.map2({["a", 2] => {2 => 3}}))
+ end
+end
+
+
+end
diff --git a/test/wsdl/marshal/person.wsdl b/test/wsdl/marshal/person.wsdl
new file mode 100644
index 0000000000..6ea8a04825
--- /dev/null
+++ b/test/wsdl/marshal/person.wsdl
@@ -0,0 +1,21 @@
+<?xml version="1.0"?>
+<definitions name="Person"
+ targetNamespace="http://www.jin.gr.jp/~nahi/xmlns/sample/Person"
+ xmlns:tns="http://www.jin.gr.jp/~nahi/xmlns/sample/Person"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns="http://schemas.xmlsoap.org/wsdl/">
+ <types>
+ <xsd:schema xmlns="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="http://www.jin.gr.jp/~nahi/xmlns/sample/Person">
+ <complexType name="Person">
+ <all>
+ <element name="familyname" type="xsd:string"/>
+ <element name="givenname" type="xsd:string"/>
+ <element name="var1" type="xsd:int"/>
+ <element name="var2" type="xsd:double"/>
+ <element name="var3" type="xsd:string"/>
+ </all>
+ </complexType>
+ </xsd:schema>
+ </types>
+</definitions>
diff --git a/test/wsdl/marshal/person_org.rb b/test/wsdl/marshal/person_org.rb
new file mode 100644
index 0000000000..f8c0e0db76
--- /dev/null
+++ b/test/wsdl/marshal/person_org.rb
@@ -0,0 +1,22 @@
+require 'xsd/qname'
+
+# {http://www.jin.gr.jp/~nahi/xmlns/sample/Person}Person
+class Person
+ @@schema_type = "Person"
+ @@schema_ns = "http://www.jin.gr.jp/~nahi/xmlns/sample/Person"
+ @@schema_element = [["familyname", ["SOAP::SOAPString", XSD::QName.new(nil, "familyname")]], ["givenname", ["SOAP::SOAPString", XSD::QName.new(nil, "givenname")]], ["var1", ["SOAP::SOAPInt", XSD::QName.new(nil, "var1")]], ["var2", ["SOAP::SOAPDouble", XSD::QName.new(nil, "var2")]], ["var3", ["SOAP::SOAPString", XSD::QName.new(nil, "var3")]]]
+
+ attr_accessor :familyname
+ attr_accessor :givenname
+ attr_accessor :var1
+ attr_accessor :var2
+ attr_accessor :var3
+
+ def initialize(familyname = nil, givenname = nil, var1 = nil, var2 = nil, var3 = nil)
+ @familyname = familyname
+ @givenname = givenname
+ @var1 = var1
+ @var2 = var2
+ @var3 = var3
+ end
+end
diff --git a/test/wsdl/marshal/test_wsdlmarshal.rb b/test/wsdl/marshal/test_wsdlmarshal.rb
new file mode 100644
index 0000000000..cd2bdb198a
--- /dev/null
+++ b/test/wsdl/marshal/test_wsdlmarshal.rb
@@ -0,0 +1,80 @@
+require 'test/unit'
+require 'wsdl/parser'
+require 'soap/mapping/wsdlencodedregistry'
+require 'soap/marshal'
+require 'wsdl/soap/wsdl2ruby'
+
+class WSDLMarshaller
+ include SOAP
+
+ def initialize(wsdlfile)
+ wsdl = WSDL::Parser.new.parse(File.open(wsdlfile) { |f| f.read })
+ types = wsdl.collect_complextypes
+ @opt = {
+ :decode_typemap => types,
+ :generate_explicit_type => false,
+ :pretty => true
+ }
+ @mapping_registry = Mapping::WSDLEncodedRegistry.new(types)
+ end
+
+ def dump(obj, io = nil)
+ type = Mapping.class2element(obj.class)
+ ele = Mapping.obj2soap(obj, @mapping_registry, type)
+ ele.elename = ele.type
+ Processor.marshal(SOAPEnvelope.new(nil, SOAPBody.new(ele)), @opt, io)
+ end
+
+ def load(io)
+ header, body = Processor.unmarshal(io, @opt)
+ Mapping.soap2obj(body.root_node)
+ end
+end
+
+
+require File.join(File.dirname(__FILE__), 'person_org')
+
+class Person
+ def ==(rhs)
+ @familyname == rhs.familyname and @givenname == rhs.givenname and
+ @var1 == rhs.var1 and @var2 == rhs.var2 and @var3 == rhs.var3
+ end
+end
+
+
+class TestWSDLMarshal < Test::Unit::TestCase
+ DIR = File.dirname(File.expand_path(__FILE__))
+
+ def test_marshal
+ marshaller = WSDLMarshaller.new(pathname('person.wsdl'))
+ obj = Person.new("NAKAMURA", "Hiroshi", 1, 1.0, "1")
+ str = marshaller.dump(obj)
+ obj2 = marshaller.load(str)
+ assert_equal(obj, obj2)
+ assert_equal(str, marshaller.dump(obj2))
+ end
+
+ def test_classdef
+ gen = WSDL::SOAP::WSDL2Ruby.new
+ gen.location = pathname("person.wsdl")
+ gen.basedir = DIR
+ gen.logger.level = Logger::FATAL
+ gen.opt['classdef'] = nil
+ gen.opt['force'] = true
+ gen.run
+ compare("person_org.rb", "Person.rb")
+ File.unlink(pathname('Person.rb'))
+ end
+
+ def compare(expected, actual)
+ assert_equal(loadfile(expected), loadfile(actual), actual)
+ end
+
+ def loadfile(file)
+ File.open(pathname(file)) { |f| f.read }
+ end
+
+ def pathname(filename)
+ File.join(DIR, filename)
+ end
+end
diff --git a/test/wsdl/multiplefault.wsdl b/test/wsdl/multiplefault.wsdl
new file mode 100644
index 0000000000..2d928b60b0
--- /dev/null
+++ b/test/wsdl/multiplefault.wsdl
@@ -0,0 +1,68 @@
+<?xml version="1.0"?>
+<definitions name="MultipleFaultTest"
+ targetNamespace="urn:jp.gr.jin.rrr.example.ele"
+ xmlns:tns="urn:jp.gr.jin.rrr.example.ele"
+ xmlns:typens="urn:jp.gr.jin.rrr.example.datatypes"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ xmlns="http://schemas.xmlsoap.org/wsdl/">
+
+ <types>
+ <xsd:schema xmlns="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="urn:jp.gr.jin.rrr.example.datatypes">
+ <xsd:complexType name="AuthenticationError">
+ <all>
+ <element name="message" type="xsd:string" />
+ <element name="backtrace" type="xoapenc:Array" />
+ </all>
+ </xsd:complexType>
+ <xsd:complexType name="AuthorizationError">
+ <all>
+ <element name="message" type="xsd:string" />
+ <element name="backtrace" type="xoapenc:Array" />
+ </all>
+ </xsd:complexType>
+ </xsd:schema>
+ </types>
+
+ <message name="inputmsg"/>
+ <message name="outputmsg"/>
+ <message name="faultmsg1" >
+ <part name="exception" type="typens:AuthenticationError" />
+ </message>
+ <message name="faultmsg2" >
+ <part name="exception" type="typens:AuthorizationError" />
+ </message>
+
+ <portType name="MultipleFaultPortType">
+ <operation name="myoperation">
+ <input message="tns:inputmsg"/>
+ <output message="tns:outputmsg"/>
+ <fault message="tns:faultmsg1"/>
+ <fault message="tns:faultmsg2"/>
+ </operation>
+ </portType>
+
+ <binding name="MultipleFaultBinding" type="tns:MultipleFaultPortType">
+ <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <operation name="myoperation">
+ <soap:operation soapAction="urn:jp.gr.jin.rrr.example.ele"/>
+ <input>
+ <soap:body use="encoded" namespace="urn:jp.gr.jin.rrr.example.ele"
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <soap:body use="encoded" namespace="urn:jp.gr.jin.rrr.example.ele"
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
+ </binding>
+
+ <service name="MultipleFaultService">
+ <port name="MultipleFaultPortType" binding="tns:MultipleFaultBinding">
+ <soap:address location="http://localhost:17171/"/>
+ </port>
+ </service>
+</definitions>
diff --git a/test/wsdl/qualified/lp.rb b/test/wsdl/qualified/lp.rb
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/test/wsdl/qualified/lp.rb
diff --git a/test/wsdl/qualified/lp.wsdl b/test/wsdl/qualified/lp.wsdl
new file mode 100644
index 0000000000..b107b7b392
--- /dev/null
+++ b/test/wsdl/qualified/lp.wsdl
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="utf-8"?>
+<definitions
+ name="lp"
+ targetNamespace="urn:lp"
+ xmlns:tns="urn:lp"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns="http://schemas.xmlsoap.org/wsdl/">
+ <types>
+ <schema xmlns="http://www.w3.org/2001/XMLSchema">
+ <import namespace="urn:lp" schemaLocation="lp.xsd"/>
+ </schema>
+ </types>
+
+ <message name="login_in">
+ <part name="parameters" element="tns:login" />
+ </message>
+ <message name="login_out">
+ <part name="parameters" element="tns:loginResponse" />
+ </message>
+
+ <portType name="lp_porttype">
+ <operation name="login">
+ <input message="tns:login_in" />
+ <output message="tns:login_out" />
+ </operation>
+ </portType>
+
+ <binding name="lp_binding" type="tns:lp_porttype">
+ <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
+ <operation name="login">
+ <soap:operation soapAction="urn:lp:login" style="document" />
+ <input>
+ <soap:body use="literal" />
+ </input>
+ <output>
+ <soap:body use="literal" />
+ </output>
+ </operation>
+ </binding>
+
+ <service name="lp_service">
+ <port name="lp_service_port" binding="tns:lp_binding">
+ <soap:address location="http://localhost:17171/" />
+ </port>
+ </service>
+</definitions>
diff --git a/test/wsdl/qualified/lp.xsd b/test/wsdl/qualified/lp.xsd
new file mode 100644
index 0000000000..12bcbd8cef
--- /dev/null
+++ b/test/wsdl/qualified/lp.xsd
@@ -0,0 +1,26 @@
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:lp="urn:lp" targetNamespace="urn:lp" elementFormDefault="unqualified">
+
+ <xs:complexType name="login">
+ <xs:sequence>
+ <xs:element name="username" type="xs:string"/>
+ <xs:element name="password" type="xs:string"/>
+ <xs:element name="timezone" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:element name="login" type="lp:login"/>
+
+ <xs:complexType name="loginResponse">
+ <xs:sequence>
+ <xs:element name="loginResult">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="sessionID" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:element name="loginResponse" type="lp:loginResponse"/>
+</xs:schema>
diff --git a/test/wsdl/qualified/np.wsdl b/test/wsdl/qualified/np.wsdl
new file mode 100644
index 0000000000..e2b7253d0e
--- /dev/null
+++ b/test/wsdl/qualified/np.wsdl
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<wsdl:definitions xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://www50.brinkster.com/vbfacileinpt/np" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" targetNamespace="http://www50.brinkster.com/vbfacileinpt/np" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
+ <wsdl:types>
+ <s:schema elementFormDefault="qualified" targetNamespace="http://www50.brinkster.com/vbfacileinpt/np">
+ <s:element name="GetPrimeNumbers">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1" name="Max" type="s:string" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="GetPrimeNumbersResponse">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1" name="GetPrimeNumbersResult" type="s:string" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ </s:schema>
+ </wsdl:types>
+ <wsdl:message name="GetPrimeNumbersSoapIn">
+ <wsdl:part name="parameters" element="tns:GetPrimeNumbers" />
+ </wsdl:message>
+ <wsdl:message name="GetPrimeNumbersSoapOut">
+ <wsdl:part name="parameters" element="tns:GetPrimeNumbersResponse" />
+ </wsdl:message>
+ <wsdl:portType name="pnumSoap">
+ <wsdl:operation name="GetPrimeNumbers">
+ <wsdl:input message="tns:GetPrimeNumbersSoapIn" />
+ <wsdl:output message="tns:GetPrimeNumbersSoapOut" />
+ </wsdl:operation>
+ </wsdl:portType>
+ <wsdl:binding name="pnumSoap" type="tns:pnumSoap">
+ <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
+ <wsdl:operation name="GetPrimeNumbers">
+ <soap:operation soapAction="http://www50.brinkster.com/vbfacileinpt/np/GetPrimeNumbers" style="document" />
+ <wsdl:input>
+ <soap:body use="literal" />
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal" />
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:service name="pnum">
+ <wsdl:port name="pnumSoap" binding="tns:pnumSoap">
+ <soap:address location="http://www50.brinkster.com/vbfacileinpt/np.asmx" />
+ </wsdl:port>
+ </wsdl:service>
+</wsdl:definitions> \ No newline at end of file
diff --git a/test/wsdl/qualified/test_qualified.rb b/test/wsdl/qualified/test_qualified.rb
new file mode 100644
index 0000000000..d6c1159a87
--- /dev/null
+++ b/test/wsdl/qualified/test_qualified.rb
@@ -0,0 +1,154 @@
+require 'test/unit'
+require 'wsdl/soap/wsdl2ruby'
+require 'soap/rpc/standaloneServer'
+require 'soap/wsdlDriver'
+
+if defined?(HTTPAccess2)
+
+module WSDL
+
+
+class TestQualified < Test::Unit::TestCase
+ class Server < ::SOAP::RPC::StandaloneServer
+ Namespace = 'http://www50.brinkster.com/vbfacileinpt/np'
+
+ def on_init
+ add_document_method(
+ self,
+ Namespace + '/GetPrimeNumbers',
+ 'GetPrimeNumbers',
+ XSD::QName.new(Namespace, 'GetPrimeNumbers'),
+ XSD::QName.new(Namespace, 'GetPrimeNumbersResponse')
+ )
+ end
+
+ def GetPrimeNumbers(arg)
+ nil
+ end
+ end
+
+ DIR = File.dirname(File.expand_path(__FILE__))
+ Port = 17171
+
+ def setup
+ setup_server
+ setup_clientdef
+ @client = nil
+ end
+
+ def teardown
+ teardown_server
+ unless $DEBUG
+ File.unlink(pathname('default.rb'))
+ File.unlink(pathname('defaultDriver.rb'))
+ end
+ @client.reset_stream if @client
+ end
+
+ def setup_server
+ @server = Server.new('Test', "urn:lp", '0.0.0.0', Port)
+ @server.level = Logger::Severity::ERROR
+ @server_thread = start_server_thread(@server)
+ end
+
+ def setup_clientdef
+ backupdir = Dir.pwd
+ begin
+ Dir.chdir(DIR)
+ gen = WSDL::SOAP::WSDL2Ruby.new
+ gen.location = pathname("np.wsdl")
+ gen.basedir = DIR
+ gen.logger.level = Logger::FATAL
+ gen.opt['classdef'] = nil
+ gen.opt['driver'] = nil
+ gen.opt['force'] = true
+ gen.run
+ require pathname('default.rb')
+ ensure
+ Dir.chdir(backupdir)
+ end
+ end
+
+ def teardown_server
+ @server.shutdown
+ @server_thread.kill
+ @server_thread.join
+ end
+
+ def start_server_thread(server)
+ t = Thread.new {
+ Thread.current.abort_on_exception = true
+ server.start
+ }
+ t
+ end
+
+ def pathname(filename)
+ File.join(DIR, filename)
+ end
+
+ LOGIN_REQUEST_QUALIFIED_NS =
+%q[<?xml version="1.0" encoding="utf-8" ?>
+<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <env:Body>
+ <n1:GetPrimeNumbers xmlns:n1="http://www50.brinkster.com/vbfacileinpt/np">
+ <n1:Max>10</n1:Max>
+ </n1:GetPrimeNumbers>
+ </env:Body>
+</env:Envelope>]
+
+ LOGIN_REQUEST_QUALIFIED =
+%q[<?xml version="1.0" encoding="utf-8" ?>
+<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <env:Body>
+ <GetPrimeNumbers xmlns="http://www50.brinkster.com/vbfacileinpt/np">
+ <Max>10</Max>
+ </GetPrimeNumbers>
+ </env:Body>
+</env:Envelope>]
+
+ def test_wsdl
+ wsdl = File.join(DIR, 'np.wsdl')
+ @client = nil
+ backupdir = Dir.pwd
+ begin
+ Dir.chdir(DIR)
+ @client = ::SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver
+ ensure
+ Dir.chdir(backupdir)
+ end
+ @client.endpoint_url = "http://localhost:#{Port}/"
+ @client.wiredump_dev = str = ''
+ @client.GetPrimeNumbers(:Max => 10)
+ assert_equal(LOGIN_REQUEST_QUALIFIED_NS, parse_requestxml(str))
+ end
+
+ include ::SOAP
+ def test_naive
+ backupdir = Dir.pwd
+ begin
+ Dir.chdir(DIR)
+ require pathname('defaultDriver')
+ ensure
+ Dir.chdir(backupdir)
+ end
+ @client = PnumSoap.new("http://localhost:#{Port}/")
+
+ @client.wiredump_dev = str = ''
+ @client.getPrimeNumbers(GetPrimeNumbers.new(10))
+ assert_equal(LOGIN_REQUEST_QUALIFIED, parse_requestxml(str))
+ end
+
+ def parse_requestxml(str)
+ str.split(/\r?\n\r?\n/)[3]
+ end
+end
+
+
+end
+
+end
diff --git a/test/wsdl/qualified/test_unqualified.rb b/test/wsdl/qualified/test_unqualified.rb
new file mode 100644
index 0000000000..bcfed73e58
--- /dev/null
+++ b/test/wsdl/qualified/test_unqualified.rb
@@ -0,0 +1,143 @@
+require 'test/unit'
+require 'wsdl/soap/wsdl2ruby'
+require 'soap/rpc/standaloneServer'
+require 'soap/wsdlDriver'
+
+if defined?(HTTPAccess2)
+
+module WSDL
+
+
+class TestUnqualified < Test::Unit::TestCase
+ class Server < ::SOAP::RPC::StandaloneServer
+ Namespace = 'urn:lp'
+
+ def on_init
+ add_document_method(
+ self,
+ Namespace + ':login',
+ 'login',
+ XSD::QName.new(Namespace, 'login'),
+ XSD::QName.new(Namespace, 'loginResponse')
+ )
+ end
+
+ def login(arg)
+ nil
+ end
+ end
+
+ DIR = File.dirname(File.expand_path(__FILE__))
+ Port = 17171
+
+ def setup
+ setup_server
+ setup_clientdef
+ @client = nil
+ end
+
+ def teardown
+ teardown_server
+ File.unlink(pathname('lp.rb'))
+ File.unlink(pathname('lpDriver.rb'))
+ @client.reset_stream if @client
+ end
+
+ def setup_server
+ @server = Server.new('Test', "urn:lp", '0.0.0.0', Port)
+ @server.level = Logger::Severity::ERROR
+ @server_thread = start_server_thread(@server)
+ end
+
+ def setup_clientdef
+ backupdir = Dir.pwd
+ begin
+ Dir.chdir(DIR)
+ gen = WSDL::SOAP::WSDL2Ruby.new
+ gen.location = pathname("lp.wsdl")
+ gen.basedir = DIR
+ gen.logger.level = Logger::FATAL
+ gen.opt['classdef'] = nil
+ gen.opt['driver'] = nil
+ gen.opt['force'] = true
+ gen.run
+ require pathname('lp')
+ ensure
+ Dir.chdir(backupdir)
+ end
+ end
+
+ def teardown_server
+ @server.shutdown
+ @server_thread.kill
+ @server_thread.join
+ end
+
+ def start_server_thread(server)
+ t = Thread.new {
+ Thread.current.abort_on_exception = true
+ server.start
+ }
+ t
+ end
+
+ def pathname(filename)
+ File.join(DIR, filename)
+ end
+
+ LOGIN_REQUEST_QUALIFIED =
+%q[<?xml version="1.0" encoding="utf-8" ?>
+<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <env:Body>
+ <n1:login xmlns:n1="urn:lp">
+ <username>NaHi</username>
+ <password>passwd</password>
+ <timezone>JST</timezone>
+ </n1:login>
+ </env:Body>
+</env:Envelope>]
+
+ def test_wsdl
+ wsdl = File.join(DIR, 'lp.wsdl')
+ @client = nil
+ backupdir = Dir.pwd
+ begin
+ Dir.chdir(DIR)
+ @client = ::SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver
+ ensure
+ Dir.chdir(backupdir)
+ end
+ @client.endpoint_url = "http://localhost:#{Port}/"
+ @client.wiredump_dev = str = ''
+ @client.login(:timezone => 'JST', :password => 'passwd',
+ :username => 'NaHi')
+ assert_equal(LOGIN_REQUEST_QUALIFIED, parse_requestxml(str))
+ end
+
+ include ::SOAP
+ def test_naive
+ backupdir = Dir.pwd
+ begin
+ Dir.chdir(DIR)
+ require pathname('lpDriver')
+ ensure
+ Dir.chdir(backupdir)
+ end
+ @client = Lp_porttype.new("http://localhost:#{Port}/")
+
+ @client.wiredump_dev = str = ''
+ @client.login(Login.new('NaHi', 'passwd', 'JST'))
+ assert_equal(LOGIN_REQUEST_QUALIFIED, parse_requestxml(str))
+ end
+
+ def parse_requestxml(str)
+ str.split(/\r?\n\r?\n/)[3]
+ end
+end
+
+
+end
+
+end
diff --git a/test/wsdl/raa/RAA.rb b/test/wsdl/raa/RAA.rb
new file mode 100644
index 0000000000..aff0525480
--- /dev/null
+++ b/test/wsdl/raa/RAA.rb
@@ -0,0 +1,243 @@
+# http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/
+class Category
+ @@schema_type = "Category"
+ @@schema_ns = "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/"
+
+ def major
+ @major
+ end
+
+ def major=(value)
+ @major = value
+ end
+
+ def minor
+ @minor
+ end
+
+ def minor=(value)
+ @minor = value
+ end
+
+ def initialize(major = nil,
+ minor = nil)
+ @major = major
+ @minor = minor
+ end
+end
+
+# http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/
+class Product
+ @@schema_type = "Product"
+ @@schema_ns = "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/"
+
+ def id
+ @id
+ end
+
+ def id=(value)
+ @id = value
+ end
+
+ def name
+ @name
+ end
+
+ def name=(value)
+ @name = value
+ end
+
+ def short_description
+ @short_description
+ end
+
+ def short_description=(value)
+ @short_description = value
+ end
+
+ def version
+ @version
+ end
+
+ def version=(value)
+ @version = value
+ end
+
+ def status
+ @status
+ end
+
+ def status=(value)
+ @status = value
+ end
+
+ def homepage
+ @homepage
+ end
+
+ def homepage=(value)
+ @homepage = value
+ end
+
+ def download
+ @download
+ end
+
+ def download=(value)
+ @download = value
+ end
+
+ def license
+ @license
+ end
+
+ def license=(value)
+ @license = value
+ end
+
+ def description
+ @description
+ end
+
+ def description=(value)
+ @description = value
+ end
+
+ def initialize(id = nil,
+ name = nil,
+ short_description = nil,
+ version = nil,
+ status = nil,
+ homepage = nil,
+ download = nil,
+ license = nil,
+ description = nil)
+ @id = id
+ @name = name
+ @short_description = short_description
+ @version = version
+ @status = status
+ @homepage = homepage
+ @download = download
+ @license = license
+ @description = description
+ end
+end
+
+# http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/
+class Owner
+ @@schema_type = "Owner"
+ @@schema_ns = "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/"
+
+ def id
+ @id
+ end
+
+ def id=(value)
+ @id = value
+ end
+
+ def email
+ @email
+ end
+
+ def email=(value)
+ @email = value
+ end
+
+ def name
+ @name
+ end
+
+ def name=(value)
+ @name = value
+ end
+
+ def initialize(id = nil,
+ email = nil,
+ name = nil)
+ @id = id
+ @email = email
+ @name = name
+ end
+end
+
+# http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/
+class Info
+ @@schema_type = "Info"
+ @@schema_ns = "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/"
+
+ def category
+ @category
+ end
+
+ def category=(value)
+ @category = value
+ end
+
+ def product
+ @product
+ end
+
+ def product=(value)
+ @product = value
+ end
+
+ def owner
+ @owner
+ end
+
+ def owner=(value)
+ @owner = value
+ end
+
+ def created
+ @created
+ end
+
+ def created=(value)
+ @created = value
+ end
+
+ def updated
+ @updated
+ end
+
+ def updated=(value)
+ @updated = value
+ end
+
+ def initialize(category = nil,
+ product = nil,
+ owner = nil,
+ created = nil,
+ updated = nil)
+ @category = category
+ @product = product
+ @owner = owner
+ @created = created
+ @updated = updated
+ end
+end
+
+# http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/
+class InfoArray < Array
+ # Contents type should be dumped here...
+ @@schema_type = "InfoArray"
+ @@schema_ns = "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/"
+end
+
+# http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/
+class StringArray < Array
+ # Contents type should be dumped here...
+ @@schema_type = "StringArray"
+ @@schema_ns = "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/"
+end
+
+# http://xml.apache.org/xml-soap
+class Map < Array
+ # Contents type should be dumped here...
+ @@schema_type = "Map"
+ @@schema_ns = "http://xml.apache.org/xml-soap"
+end
+
diff --git a/test/wsdl/raa/RAAServant.rb b/test/wsdl/raa/RAAServant.rb
new file mode 100644
index 0000000000..68380f8e48
--- /dev/null
+++ b/test/wsdl/raa/RAAServant.rb
@@ -0,0 +1,99 @@
+class RAABaseServicePortType
+ # SYNOPSIS
+ # getAllListings
+ #
+ # ARGS
+ # N/A
+ #
+ # RETURNS
+ # return StringArray - {http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/}StringArray
+ #
+ # RAISES
+ # (undefined)
+ #
+ def getAllListings
+ #raise NotImplementedError.new
+ ["ruby", "soap4r"]
+ end
+
+ # SYNOPSIS
+ # getProductTree
+ #
+ # ARGS
+ # N/A
+ #
+ # RETURNS
+ # return Map - {http://xml.apache.org/xml-soap}Map
+ #
+ # RAISES
+ # (undefined)
+ #
+ def getProductTree
+ raise NotImplementedError.new
+ end
+
+ # SYNOPSIS
+ # getInfoFromCategory(category)
+ #
+ # ARGS
+ # category Category - {http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/}Category
+ #
+ # RETURNS
+ # return InfoArray - {http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/}InfoArray
+ #
+ # RAISES
+ # (undefined)
+ #
+ def getInfoFromCategory(category)
+ raise NotImplementedError.new
+ end
+
+ # SYNOPSIS
+ # getModifiedInfoSince(timeInstant)
+ #
+ # ARGS
+ # timeInstant - {http://www.w3.org/2001/XMLSchema}dateTime
+ #
+ # RETURNS
+ # return InfoArray - {http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/}InfoArray
+ #
+ # RAISES
+ # (undefined)
+ #
+ def getModifiedInfoSince(timeInstant)
+ raise NotImplementedError.new
+ end
+
+ # SYNOPSIS
+ # getInfoFromName(productName)
+ #
+ # ARGS
+ # productName - {http://www.w3.org/2001/XMLSchema}string
+ #
+ # RETURNS
+ # return Info - {http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/}Info
+ #
+ # RAISES
+ # (undefined)
+ #
+ def getInfoFromName(productName)
+ raise NotImplementedError.new
+ end
+
+ # SYNOPSIS
+ # getInfoFromOwnerId(ownerId)
+ #
+ # ARGS
+ # ownerId - {http://www.w3.org/2001/XMLSchema}int
+ #
+ # RETURNS
+ # return InfoArray - {http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/}InfoArray
+ #
+ # RAISES
+ # (undefined)
+ #
+ def getInfoFromOwnerId(ownerId)
+ raise NotImplementedError.new
+ end
+end
+
diff --git a/test/wsdl/raa/RAAService.rb b/test/wsdl/raa/RAAService.rb
new file mode 100644
index 0000000000..9d0813304c
--- /dev/null
+++ b/test/wsdl/raa/RAAService.rb
@@ -0,0 +1,100 @@
+#!/usr/bin/env ruby
+require 'RAAServant.rb'
+
+require 'soap/rpc/standaloneServer'
+
+class RAABaseServicePortType
+ MappingRegistry = SOAP::Mapping::Registry.new
+
+ MappingRegistry.set(
+ StringArray,
+ ::SOAP::SOAPArray,
+ ::SOAP::Mapping::Registry::TypedArrayFactory,
+ { :type => XSD::QName.new("http://www.w3.org/2001/XMLSchema", "string") }
+ )
+ MappingRegistry.set(
+ Map,
+ ::SOAP::SOAPArray,
+ ::SOAP::Mapping::Registry::TypedArrayFactory,
+ { :type => XSD::QName.new("http://www.w3.org/2001/XMLSchema", "anyType") }
+ )
+ MappingRegistry.set(
+ Category,
+ ::SOAP::SOAPStruct,
+ ::SOAP::Mapping::Registry::TypedStructFactory,
+ { :type => XSD::QName.new("http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/", "Category") }
+ )
+ MappingRegistry.set(
+ InfoArray,
+ ::SOAP::SOAPArray,
+ ::SOAP::Mapping::Registry::TypedArrayFactory,
+ { :type => XSD::QName.new("http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/", "Info") }
+ )
+ MappingRegistry.set(
+ Info,
+ ::SOAP::SOAPStruct,
+ ::SOAP::Mapping::Registry::TypedStructFactory,
+ { :type => XSD::QName.new("http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/", "Info") }
+ )
+ MappingRegistry.set(
+ Product,
+ ::SOAP::SOAPStruct,
+ ::SOAP::Mapping::Registry::TypedStructFactory,
+ { :type => XSD::QName.new("http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/", "Product") }
+ )
+ MappingRegistry.set(
+ Owner,
+ ::SOAP::SOAPStruct,
+ ::SOAP::Mapping::Registry::TypedStructFactory,
+ { :type => XSD::QName.new("http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/", "Owner") }
+ )
+
+
+ Methods = [
+ ["getAllListings", "getAllListings", [
+ ["retval", "return",
+ [::SOAP::SOAPArray, "http://www.w3.org/2001/XMLSchema", "string"]]], "", "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/"],
+ ["getProductTree", "getProductTree", [
+ ["retval", "return",
+ [::SOAP::SOAPArray, "http://www.w3.org/2001/XMLSchema", "anyType"]]], "", "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/"],
+ ["getInfoFromCategory", "getInfoFromCategory", [
+ ["in", "category",
+ [::SOAP::SOAPStruct, "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/", "Category"]],
+ ["retval", "return",
+ [::SOAP::SOAPArray, "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/", "Info"]]], "", "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/"],
+ ["getModifiedInfoSince", "getModifiedInfoSince", [
+ ["in", "timeInstant",
+ [SOAP::SOAPDateTime]],
+ ["retval", "return",
+ [::SOAP::SOAPArray, "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/", "Info"]]], "", "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/"],
+ ["getInfoFromName", "getInfoFromName", [
+ ["in", "productName",
+ [SOAP::SOAPString]],
+ ["retval", "return",
+ [::SOAP::SOAPStruct, "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/", "Info"]]], "", "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/"],
+ ["getInfoFromOwnerId", "getInfoFromOwnerId", [
+ ["in", "ownerId",
+ [SOAP::SOAPInt]],
+ ["retval", "return",
+ [::SOAP::SOAPArray, "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/", "Info"]]], "", "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/"]
+ ]
+end
+
+class App < SOAP::RPC::StandaloneServer
+ def initialize(*arg)
+ super
+
+ servant = RAABaseServicePortType.new
+ RAABaseServicePortType::Methods.each do |name_as, name, params, soapaction, namespace|
+ qname = XSD::QName.new(namespace, name_as)
+ @router.add_method(servant, qname, soapaction, name, params)
+ end
+
+ self.mapping_registry = RAABaseServicePortType::MappingRegistry
+ end
+end
+
+# Change listen port.
+if $0 == __FILE__
+ App.new('app', nil, '0.0.0.0', 10080).start
+end
diff --git a/test/wsdl/raa/README.txt b/test/wsdl/raa/README.txt
new file mode 100644
index 0000000000..efbaf9d87c
--- /dev/null
+++ b/test/wsdl/raa/README.txt
@@ -0,0 +1,8 @@
+RAAServant.rb: based on the file which is generated with the following command;
+ bin/wsdl2ruby.rb --wsdl raa.wsdl --servant_skelton --force
+
+RAAService.rb: generated with the following command;
+ bin/wsdl2ruby.rb --wsdl raa.wsdl --standalone_server_stub --force
+
+RAA.rb: generated with the following command;
+ bin/wsdl2ruby.rb --wsdl raa.wsdl --classdef --force
diff --git a/test/wsdl/raa/raa.wsdl b/test/wsdl/raa/raa.wsdl
new file mode 100644
index 0000000000..78376893dd
--- /dev/null
+++ b/test/wsdl/raa/raa.wsdl
@@ -0,0 +1,264 @@
+<?xml version="1.0"?>
+<definitions
+ name="RAA"
+ targetNamespace="http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/"
+ xmlns:tns="http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/"
+ xmlns:txd="http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/"
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
+ xmlns:apachesoap="http://xml.apache.org/xml-soap">
+
+ <types>
+ <schema
+ xmlns="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/">
+
+ <complexType name="Category">
+ <all>
+ <element name="major" type="string"/>
+ <element name="minor" type="string"/>
+ </all>
+ </complexType>
+
+ <complexType name="Product">
+ <all>
+ <element name="id" type="int"/>
+ <element name="name" type="string"/>
+ <element name="short_description" type="string"/>
+ <element name="version" type="string"/>
+ <element name="status" type="string"/>
+ <element name="homepage" type="anyURI"/>
+ <element name="download" type="anyURI"/>
+ <element name="license" type="string"/>
+ <element name="description" type="string"/>
+ </all>
+ </complexType>
+
+ <complexType name="Owner">
+ <all>
+ <element name="id" type="int"/>
+ <element name="email" type="anyURI"/>
+ <element name="name" type="string"/>
+ </all>
+ </complexType>
+
+ <complexType name="Info">
+ <all>
+ <element name="category" type="txd:Category"/>
+ <element name="product" type="txd:Product"/>
+ <element name="owner" type="txd:Owner"/>
+ <element name="created" type="xsd:dateTime"/>
+ <element name="updated" type="xsd:dateTime"/>
+ </all>
+ </complexType>
+
+ <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
+ <complexType name="InfoArray">
+ <complexContent>
+ <restriction base="soapenc:Array">
+ <attribute ref="soapenc:arrayType" wsdl:arrayType="txd:Info[]"/>
+ </restriction>
+ </complexContent>
+ </complexType>
+
+ <complexType name="StringArray">
+ <complexContent>
+ <restriction base="soapenc:Array">
+ <attribute ref="soapenc:arrayType" wsdl:arrayType="xsd:string[]"/>
+ </restriction>
+ </complexContent>
+ </complexType>
+ </schema>
+
+ <!-- type definition for ApacheSOAP's Map -->
+ <schema
+ xmlns="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="http://xml.apache.org/xml-soap">
+ <complexType name="Map">
+ <sequence>
+ <element name="item" minOccurs="0" maxOccurs="unbounded">
+ <complexType>
+ <sequence>
+ <element name="key" type="anyType" />
+ <element name="value" type="anyType" />
+ </sequence>
+ </complexType>
+ </element>
+ </sequence>
+ </complexType>
+ </schema>
+ </types>
+
+ <message name="getAllListingsRequest"/>
+ <message name="getAllListingsResponse">
+ <part name="return" type="txd:StringArray"/>
+ </message>
+
+ <message name="getProductTreeRequest"/>
+ <message name="getProductTreeResponse">
+ <part name="return" type="apachesoap:Map"/>
+ </message>
+
+ <message name="getInfoFromCategoryRequest">
+ <part name="category" type="txd:Category"/>
+ </message>
+ <message name="getInfoFromCategoryResponse">
+ <part name="return" type="txd:InfoArray"/>
+ </message>
+
+ <message name="getModifiedInfoSinceRequest">
+ <part name="timeInstant" type="xsd:dateTime"/>
+ </message>
+ <message name="getModifiedInfoSinceResponse">
+ <part name="return" type="txd:InfoArray"/>
+ </message>
+
+ <message name="getInfoFromNameRequest">
+ <part name="productName" type="xsd:string"/>
+ </message>
+ <message name="getInfoFromNameResponse">
+ <part name="return" type="txd:Info"/>
+ </message>
+
+ <message name="getInfoFromOwnerIdRequest">
+ <part name="ownerId" type="xsd:int"/>
+ </message>
+ <message name="getInfoFromOwnerIdResponse">
+ <part name="return" type="txd:InfoArray"/>
+ </message>
+
+ <portType name="RAABaseServicePortType">
+ <operation name="getAllListings"
+ parameterOrder="">
+ <input message="tns:getAllListingsRequest"/>
+ <output message="tns:getAllListingsResponse"/>
+ </operation>
+
+ <operation name="getProductTree"
+ parameterOrder="">
+ <input message="tns:getProductTreeRequest"/>
+ <output message="tns:getProductTreeResponse"/>
+ </operation>
+
+ <operation name="getInfoFromCategory"
+ parameterOrder="category">
+ <input message="tns:getInfoFromCategoryRequest"/>
+ <output message="tns:getInfoFromCategoryResponse"/>
+ </operation>
+
+ <operation name="getModifiedInfoSince"
+ parameterOrder="timeInstant">
+ <input message="tns:getModifiedInfoSinceRequest"/>
+ <output message="tns:getModifiedInfoSinceResponse"/>
+ </operation>
+
+ <operation name="getInfoFromName"
+ parameterOrder="productName">
+ <input message="tns:getInfoFromNameRequest"/>
+ <output message="tns:getInfoFromNameResponse"/>
+ </operation>
+
+ <operation name="getInfoFromOwnerId"
+ parameterOrder="ownerId">
+ <input message="tns:getInfoFromOwnerIdRequest"/>
+ <output message="tns:getInfoFromOwnerIdResponse"/>
+ </operation>
+ </portType>
+
+ <binding name="RAABaseServicePortBinding" type="tns:RAABaseServicePortType">
+ <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
+
+ <operation name="getAllListings">
+ <soap:operation soapAction=""/>
+ <input>
+ <soap:body use="encoded"
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ namespace="http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/"/>
+ </input>
+ <output>
+ <soap:body use="encoded"
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ namespace="http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/"/>
+ </output>
+ </operation>
+
+ <operation name="getProductTree">
+ <soap:operation soapAction=""/>
+ <input>
+ <soap:body use="encoded"
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ namespace="http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/"/>
+ </input>
+ <output>
+ <soap:body use="encoded"
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ namespace="http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/"/>
+ </output>
+ </operation>
+
+ <operation name="getInfoFromCategory">
+ <soap:operation soapAction=""/>
+ <input>
+ <soap:body use="encoded"
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ namespace="http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/"/>
+ </input>
+ <output>
+ <soap:body use="encoded"
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ namespace="http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/"/>
+ </output>
+ </operation>
+
+ <operation name="getModifiedInfoSince">
+ <soap:operation soapAction=""/>
+ <input>
+ <soap:body use="encoded"
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ namespace="http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/"/>
+ </input>
+ <output>
+ <soap:body use="encoded"
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ namespace="http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/"/>
+ </output>
+ </operation>
+
+ <operation name="getInfoFromName">
+ <soap:operation soapAction=""/>
+ <input>
+ <soap:body use="encoded"
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ namespace="http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/"/>
+ </input>
+ <output>
+ <soap:body use="encoded"
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ namespace="http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/"/>
+ </output>
+ </operation>
+
+ <operation name="getInfoFromOwnerId">
+ <soap:operation soapAction=""/>
+ <input>
+ <soap:body use="encoded"
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ namespace="http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/"/>
+ </input>
+ <output>
+ <soap:body use="encoded"
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ namespace="http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/"/>
+ </output>
+ </operation>
+ </binding>
+
+ <service name="RAAService">
+ <port name="RAABaseServicePort" binding="tns:RAABaseServicePortBinding">
+ <soap:address location="http://raa.ruby-lang.org/soap/1.0.2/"/>
+ </port>
+ </service>
+</definitions>
diff --git a/test/wsdl/raa/server.rb b/test/wsdl/raa/server.rb
new file mode 100644
index 0000000000..87bbc6f569
--- /dev/null
+++ b/test/wsdl/raa/server.rb
@@ -0,0 +1,103 @@
+#!/usr/bin/env ruby
+require 'soap/rpc/standaloneServer'
+require 'RAA.rb'
+
+class RAABaseServicePortType
+ MappingRegistry = SOAP::Mapping::Registry.new
+
+ MappingRegistry.set(
+ StringArray,
+ ::SOAP::SOAPArray,
+ ::SOAP::Mapping::Registry::TypedArrayFactory,
+ { :type => XSD::QName.new("http://www.w3.org/2001/XMLSchema", "string") }
+ )
+ MappingRegistry.set(
+ Map,
+ ::SOAP::SOAPStruct,
+ ::SOAP::Mapping::Registry::TypedStructFactory,
+ { :type => XSD::QName.new("http://xml.apache.org/xml-soap", "Map") }
+ )
+ MappingRegistry.set(
+ Category,
+ ::SOAP::SOAPStruct,
+ ::SOAP::Mapping::Registry::TypedStructFactory,
+ { :type => XSD::QName.new("http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/", "Category") }
+ )
+ MappingRegistry.set(
+ InfoArray,
+ ::SOAP::SOAPArray,
+ ::SOAP::Mapping::Registry::TypedArrayFactory,
+ { :type => XSD::QName.new("http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/", "Info") }
+ )
+ MappingRegistry.set(
+ Info,
+ ::SOAP::SOAPStruct,
+ ::SOAP::Mapping::Registry::TypedStructFactory,
+ { :type => XSD::QName.new("http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/", "Info") }
+ )
+ MappingRegistry.set(
+ Product,
+ ::SOAP::SOAPStruct,
+ ::SOAP::Mapping::Registry::TypedStructFactory,
+ { :type => XSD::QName.new("http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/", "Product") }
+ )
+ MappingRegistry.set(
+ Owner,
+ ::SOAP::SOAPStruct,
+ ::SOAP::Mapping::Registry::TypedStructFactory,
+ { :type => XSD::QName.new("http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/", "Owner") }
+ )
+
+ Methods = [
+ ["getAllListings", "getAllListings", [
+ ["retval", "return",
+ [::SOAP::SOAPArray, "http://www.w3.org/2001/XMLSchema", "string"]]],
+ "", "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/"],
+ ["getProductTree", "getProductTree", [
+ ["retval", "return",
+ [::SOAP::SOAPStruct, "http://xml.apache.org/xml-soap", "Map"]]],
+ "", "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/"],
+ ["getInfoFromCategory", "getInfoFromCategory", [
+ ["in", "category",
+ [::SOAP::SOAPStruct, "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/", "Category"]],
+ ["retval", "return",
+ [::SOAP::SOAPArray, "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/", "Info"]]],
+ "", "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/"],
+ ["getModifiedInfoSince", "getModifiedInfoSince", [
+ ["in", "timeInstant",
+ [SOAP::SOAPDateTime]],
+ ["retval", "return",
+ [::SOAP::SOAPArray, "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/", "Info"]]],
+ "", "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/"],
+ ["getInfoFromName", "getInfoFromName", [
+ ["in", "productName",
+ [SOAP::SOAPString]],
+ ["retval", "return",
+ [::SOAP::SOAPStruct, "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/", "Info"]]],
+ "", "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/"],
+ ["getInfoFromOwnerId", "getInfoFromOwnerId", [
+ ["in", "ownerId",
+ [SOAP::SOAPInt]],
+ ["retval", "return",
+ [::SOAP::SOAPArray, "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/", "Info"]]],
+ "", "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/"]
+ ]
+
+ def getAllListings
+ ["ruby", "soap4r"]
+ end
+end
+
+class RAABaseServiceServer < SOAP::RPC::StandaloneServer
+ def initialize(*arg)
+ super
+
+ servant = RAABaseServicePortType.new
+ RAABaseServicePortType::Methods.each do |name_as, name, params, soapaction, namespace|
+ qname = XSD::QName.new(namespace, name_as)
+ @router.add_method(servant, qname, soapaction, name, params)
+ end
+
+ self.mapping_registry = RAABaseServicePortType::MappingRegistry
+ end
+end
diff --git a/test/wsdl/raa/test_raa.rb b/test/wsdl/raa/test_raa.rb
new file mode 100644
index 0000000000..0b00042ffb
--- /dev/null
+++ b/test/wsdl/raa/test_raa.rb
@@ -0,0 +1,71 @@
+require 'test/unit'
+require 'soap/wsdlDriver'
+require 'RAA.rb'
+require 'RAAServant.rb'
+require 'RAAService.rb'
+
+
+module WSDL
+module RAA
+
+
+class TestRAA < Test::Unit::TestCase
+ DIR = File.dirname(File.expand_path(__FILE__))
+
+ Port = 17171
+
+ def setup
+ setup_server
+ setup_client
+ end
+
+ def setup_server
+ @server = App.new('RAA server', nil, '0.0.0.0', Port)
+ @server.level = Logger::Severity::ERROR
+ @t = Thread.new {
+ Thread.current.abort_on_exception = true
+ @server.start
+ }
+ end
+
+ def setup_client
+ wsdl = File.join(DIR, 'raa.wsdl')
+ @raa = ::SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver
+ @raa.endpoint_url = "http://localhost:#{Port}/"
+ end
+
+ def teardown
+ teardown_server
+ teardown_client
+ end
+
+ def teardown_server
+ @server.shutdown
+ @t.kill
+ @t.join
+ end
+
+ def teardown_client
+ @raa.reset_stream
+ end
+
+ def test_raa
+ assert_equal(["ruby", "soap4r"], @raa.getAllListings)
+ end
+
+ def foo
+ p @raa.getProductTree()
+ p @raa.getInfoFromCategory(Category.new("Library", "XML"))
+ t = Time.at(Time.now.to_i - 24 * 3600)
+ p @raa.getModifiedInfoSince(t)
+ p @raa.getModifiedInfoSince(DateTime.new(t.year, t.mon, t.mday, t.hour, t.min, t.sec))
+ o = @raa.getInfoFromName("SOAP4R")
+ p o.type
+ p o.owner.name
+ p o
+ end
+end
+
+
+end
+end
diff --git a/test/wsdl/ref/expectedProduct.rb b/test/wsdl/ref/expectedProduct.rb
new file mode 100644
index 0000000000..91c6e4c566
--- /dev/null
+++ b/test/wsdl/ref/expectedProduct.rb
@@ -0,0 +1,90 @@
+require 'xsd/qname'
+
+# {urn:product}Rating
+module Rating
+ C_0 = "0"
+ C_1 = "+1"
+ C_1_2 = "-1"
+end
+
+# {urn:product}Product-Bag
+class ProductBag
+ @@schema_type = "Product-Bag"
+ @@schema_ns = "urn:product"
+ @@schema_attribute = {XSD::QName.new("urn:product", "version") => "SOAP::SOAPString", XSD::QName.new("urn:product", "yesno") => "SOAP::SOAPString"}
+ @@schema_element = [["bag", ["Product[]", XSD::QName.new(nil, "bag")]], ["rating", ["SOAP::SOAPString[]", XSD::QName.new("urn:product", "Rating")]], ["product_Bag", [nil, XSD::QName.new("urn:product", "Product-Bag")]], ["comment_1", [nil, XSD::QName.new(nil, "comment_1")]], ["comment_2", ["Comment[]", XSD::QName.new(nil, "comment-2")]]]
+
+ attr_accessor :bag
+ attr_accessor :product_Bag
+ attr_accessor :comment_1
+ attr_accessor :comment_2
+
+ def Rating
+ @rating
+ end
+
+ def Rating=(value)
+ @rating = value
+ end
+
+ def xmlattr_version
+ (@__xmlattr ||= {})[XSD::QName.new("urn:product", "version")]
+ end
+
+ def xmlattr_version=(value)
+ (@__xmlattr ||= {})[XSD::QName.new("urn:product", "version")] = value
+ end
+
+ def xmlattr_yesno
+ (@__xmlattr ||= {})[XSD::QName.new("urn:product", "yesno")]
+ end
+
+ def xmlattr_yesno=(value)
+ (@__xmlattr ||= {})[XSD::QName.new("urn:product", "yesno")] = value
+ end
+
+ def initialize(bag = [], rating = [], product_Bag = nil, comment_1 = [], comment_2 = [])
+ @bag = bag
+ @rating = rating
+ @product_Bag = product_Bag
+ @comment_1 = comment_1
+ @comment_2 = comment_2
+ @__xmlattr = {}
+ end
+end
+
+# {urn:product}Creator
+class Creator
+ @@schema_type = "Creator"
+ @@schema_ns = "urn:product"
+ @@schema_element = []
+
+ def initialize
+ end
+end
+
+# {urn:product}Product
+class Product
+ @@schema_type = "Product"
+ @@schema_ns = "urn:product"
+ @@schema_element = [["name", ["SOAP::SOAPString", XSD::QName.new(nil, "name")]], ["rating", ["SOAP::SOAPString", XSD::QName.new("urn:product", "Rating")]]]
+
+ attr_accessor :name
+
+ def Rating
+ @rating
+ end
+
+ def Rating=(value)
+ @rating = value
+ end
+
+ def initialize(name = nil, rating = nil)
+ @name = name
+ @rating = rating
+ end
+end
+
+# {urn:product}Comment
+class Comment < String
+end
diff --git a/test/wsdl/ref/product.wsdl b/test/wsdl/ref/product.wsdl
new file mode 100644
index 0000000000..993fe217aa
--- /dev/null
+++ b/test/wsdl/ref/product.wsdl
@@ -0,0 +1,86 @@
+<?xml version="1.0"?>
+<definitions name="product"
+ targetNamespace="urn:product"
+ xmlns:tns="urn:product"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns="http://schemas.xmlsoap.org/wsdl/">
+ <types>
+ <xsd:schema xmlns="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="urn:product">
+ <simpleType name="non-empty-string">
+ <restriction base="xsd:string">
+ <minLength value="1"/>
+ </restriction>
+ </simpleType>
+
+ <complexType name="Product">
+ <all>
+ <element name="name" type="xsd:string"/>
+ <element ref="tns:Rating"/>
+ </all>
+ </complexType>
+
+ <complexType name="Comment">
+ <simpleContent>
+ <extension base="xsd:string">
+ <attribute name="msgid" type="xsd:string" use="required"/>
+ </extension>
+ </simpleContent>
+ </complexType>
+
+ <attribute name="version" type="tns:non-empty-string"/>
+
+ <attribute default="Y" name="yesno">
+ <simpleType>
+ <restriction base="xsd:string">
+ <enumeration value="Y"/>
+ <enumeration value="N"/>
+ </restriction>
+ </simpleType>
+ </attribute>
+
+ <element name="Rating">
+ <simpleType>
+ <restriction base="xsd:string">
+ <enumeration value="+1"/>
+ <enumeration value="0"/>
+ <enumeration value="-1"/>
+ </restriction>
+ </simpleType>
+ </element>
+
+ <element name="Product-Bag">
+ <complexType>
+ <sequence>
+ <element name="bag" type="tns:Product" minOccurs="0" maxOccurs="unbounded"/>
+ <element ref="tns:Rating" minOccurs="0" maxOccurs="unbounded"/>
+ <element ref="tns:Product-Bag"/>
+ <element name="comment_1" minOccurs="0" maxOccurs="unbounded">
+ <complexType>
+ <simpleContent>
+ <extension base="xsd:string">
+ <attribute name="msgid" type="xsd:string" use="required"/>
+ </extension>
+ </simpleContent>
+ </complexType>
+ </element>
+ <element name="comment-2" type="tns:Comment" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ <attribute ref="tns:version"/>
+ <attribute ref="tns:yesno"/>
+ </complexType>
+ </element>
+
+ <element name="Creator" minOccurs="0" maxOccurs="unbounded">
+ <complexType>
+ <simpleContent>
+ <extension base="xsd:string">
+ <attribute name="Role" type="xs:string" use="required"/>
+ </extension>
+ </simpleContent>
+ </complexType>
+ </element>
+ </xsd:schema>
+ </types>
+</definitions>
diff --git a/test/wsdl/ref/test_ref.rb b/test/wsdl/ref/test_ref.rb
new file mode 100644
index 0000000000..9e29fa31e0
--- /dev/null
+++ b/test/wsdl/ref/test_ref.rb
@@ -0,0 +1,54 @@
+require 'test/unit'
+require 'soap/rpc/standaloneServer'
+require 'soap/wsdlDriver'
+require 'wsdl/soap/wsdl2ruby'
+
+
+module WSDL
+module Ref
+
+
+class TestRef < Test::Unit::TestCase
+ DIR = File.dirname(File.expand_path(__FILE__))
+ Port = 17171
+
+ def test_classdef
+ gen = WSDL::SOAP::WSDL2Ruby.new
+ gen.location = pathname("product.wsdl")
+ gen.basedir = DIR
+ gen.logger.level = Logger::FATAL
+ gen.opt['classdef'] = nil
+ gen.opt['force'] = true
+ suppress_warning do
+ gen.run
+ end
+ compare("expectedProduct.rb", "product.rb")
+ File.unlink(pathname('product.rb'))
+ end
+
+ def compare(expected, actual)
+ assert_equal(loadfile(expected), loadfile(actual), actual)
+ end
+
+ def loadfile(file)
+ File.open(pathname(file)) { |f| f.read }
+ end
+
+ def pathname(filename)
+ File.join(DIR, filename)
+ end
+
+ def suppress_warning
+ back = $VERBOSE
+ $VERBOSE = nil
+ begin
+ yield
+ ensure
+ $VERBOSE = back
+ end
+ end
+end
+
+
+end
+end
diff --git a/test/wsdl/rpc/echoDriver.rb b/test/wsdl/rpc/echoDriver.rb
new file mode 100644
index 0000000000..51e82076e7
--- /dev/null
+++ b/test/wsdl/rpc/echoDriver.rb
@@ -0,0 +1,55 @@
+require 'echo.rb'
+
+require 'soap/rpc/driver'
+
+class Echo_port_type < ::SOAP::RPC::Driver
+ DefaultEndpointUrl = "http://localhost:10080"
+ MappingRegistry = ::SOAP::Mapping::Registry.new
+
+ MappingRegistry.set(
+ Person,
+ ::SOAP::SOAPStruct,
+ ::SOAP::Mapping::Registry::TypedStructFactory,
+ { :type => XSD::QName.new("urn:rpc-type", "person") }
+ )
+
+ Methods = [
+ ["echo", "echo",
+ [
+ ["in", "arg1", [::SOAP::SOAPStruct, "urn:rpc-type", "person"]],
+ ["in", "arg2", [::SOAP::SOAPStruct, "urn:rpc-type", "person"]],
+ ["retval", "return", [::SOAP::SOAPStruct, "urn:rpc-type", "person"]]
+ ],
+ "", "urn:rpc", :rpc
+ ]
+ ]
+
+ def initialize(endpoint_url = nil)
+ endpoint_url ||= DefaultEndpointUrl
+ super(endpoint_url, nil)
+ self.mapping_registry = MappingRegistry
+ init_methods
+ end
+
+private
+
+ def init_methods
+ Methods.each do |name_as, name, params, soapaction, namespace, style|
+ qname = XSD::QName.new(namespace, name_as)
+ if style == :document
+ @proxy.add_document_method(soapaction, name, params)
+ add_document_method_interface(name, params)
+ else
+ @proxy.add_rpc_method(qname, soapaction, name, params)
+ add_rpc_method_interface(name, params)
+ end
+ if name_as != name and name_as.capitalize == name.capitalize
+ sclass = class << self; self; end
+ sclass.__send__(:define_method, name_as, proc { |*arg|
+ __send__(name, *arg)
+ })
+ end
+ end
+ end
+end
+
diff --git a/test/wsdl/rpc/echo_serviceClient.rb b/test/wsdl/rpc/echo_serviceClient.rb
new file mode 100644
index 0000000000..40264834e9
--- /dev/null
+++ b/test/wsdl/rpc/echo_serviceClient.rb
@@ -0,0 +1,23 @@
+#!/usr/bin/env ruby
+require 'echoDriver.rb'
+
+endpoint_url = ARGV.shift
+obj = Echo_port_type.new(endpoint_url)
+
+# Uncomment the below line to see SOAP wiredumps.
+# obj.wiredump_dev = STDERR
+
+# SYNOPSIS
+# echo(arg1, arg2)
+#
+# ARGS
+# arg1 Person - {urn:rpc-type}person
+# arg2 Person - {urn:rpc-type}person
+#
+# RETURNS
+# v_return Person - {urn:rpc-type}person
+#
+arg1 = arg2 = nil
+puts obj.echo(arg1, arg2)
+
+
diff --git a/test/wsdl/rpc/rpc.wsdl b/test/wsdl/rpc/rpc.wsdl
new file mode 100644
index 0000000000..b0ee5c5e56
--- /dev/null
+++ b/test/wsdl/rpc/rpc.wsdl
@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="utf-8"?>
+<definitions name="echo"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:tns="urn:rpc"
+ xmlns:txd="urn:rpc-type"
+ targetNamespace="urn:rpc"
+ xmlns="http://schemas.xmlsoap.org/wsdl/">
+ <types>
+ <xsd:schema targetNamespace="urn:rpc-type">
+ <xsd:complexType name="person">
+ <xsd:all>
+ <xsd:element name="family-name" type="xsd:string" />
+ <xsd:element name="given_name" type="xsd:string" />
+ <xsd:element name="age" type="xsd:int" />
+ <xsd:element name="link" type="txd:person" />
+ </xsd:all>
+ </xsd:complexType>
+ </xsd:schema>
+ </types>
+
+ <message name="echo_in">
+ <part name="arg1" type="txd:person"/>
+ <part name="arg2" type="txd:person"/>
+ </message>
+
+ <message name="echo_out">
+ <part name="return" type="txd:person"/>
+ </message>
+
+ <portType name="echo_port_type">
+ <operation name="echo">
+ <input message="tns:echo_in"/>
+ <output message="tns:echo_out"/>
+ </operation>
+
+ <operation name="echo_err">
+ <input message="tns:echo_in"/>
+ <output message="tns:echo_out"/>
+ </operation>
+ </portType>
+
+ <binding name="echo_binding" type="tns:echo_port_type">
+ <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="rpc"/>
+ <operation name="echo">
+ <soap:operation soapAction=""/>
+ <input>
+ <soap:body use="encoded" namespace="urn:rpc"
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <soap:body use="encoded" namespace="urn:rpc"
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
+
+ <operation name="echo_err">
+ <soap:operation soapAction=""/>
+ <input>
+ <soap:body use="encoded" namespace="urn:rpc"
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <soap:body use="encoded" namespace="urn:rpc"
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
+ </binding>
+
+ <service name="echo_service">
+ <port name="echo_port" binding="tns:echo_binding">
+ <soap:address location="http://localhost:10080"/>
+ </port>
+ </service>
+</definitions>
diff --git a/test/wsdl/rpc/test-rpc-lit.wsdl b/test/wsdl/rpc/test-rpc-lit.wsdl
new file mode 100644
index 0000000000..72de747e36
--- /dev/null
+++ b/test/wsdl/rpc/test-rpc-lit.wsdl
@@ -0,0 +1,364 @@
+<?xml version="1.0"?>
+
+<definitions name="RPC-Literal-TestDefinitions"
+ targetNamespace="http://whitemesa.net/wsdl/rpc-lit-test"
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:soap11="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:tns="http://whitemesa.net/wsdl/rpc-lit-test"
+ xmlns:types="http://soapbuilders.org/rpc-lit-test/types"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
+ <types>
+ <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://soapbuilders.org/rpc-lit-test/types">
+
+ <element name="stringItem" type="xsd:string" />
+ <complexType name="ArrayOfstring">
+ <sequence>
+ <element ref="types:stringItem" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ </complexType>
+
+ <complexType name="ArrayOfstringInline">
+ <sequence>
+ <element name="stringItem" type="xsd:string" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ </complexType>
+
+ <complexType name="ArrayOfint">
+ <sequence>
+ <element name="integer" type="xsd:int" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ </complexType>
+
+ <element name="structItem" type="types:SOAPStruct" />
+ <complexType name="SOAPStruct">
+ <all>
+ <element name="varString" type="xsd:string"/>
+ <element name="varInt" type="xsd:int"/>
+ <element name="varFloat" type="xsd:float"/>
+ </all>
+ </complexType>
+
+ <complexType name="ArrayOfSOAPStruct">
+ <sequence>
+ <element ref="types:structItem" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ </complexType>
+
+ <complexType name="SOAPStructStruct">
+ <all>
+ <element name="varString" type="xsd:string"/>
+ <element name="varInt" type="xsd:int"/>
+ <element name="varFloat" type="xsd:float"/>
+ <element ref="types:structItem" />
+ </all>
+ </complexType>
+
+ <complexType name="SOAPArrayStruct">
+ <all>
+ <element name="varString" type="xsd:string"/>
+ <element name="varInt" type="xsd:int"/>
+ <element name="varFloat" type="xsd:float"/>
+ <element name="varArray" type="types:ArrayOfstring"/>
+ </all>
+ </complexType>
+
+ </schema>
+
+ </types>
+
+ <!-- echoStruct rpc operation -->
+ <message name="echoStructRequest">
+ <part name="inputStruct" type="types:SOAPStruct"/>
+ </message>
+ <message name="echoStructResponse">
+ <part name="return" type="types:SOAPStruct"/>
+ </message>
+
+ <!-- echoStructArray rpc operation -->
+ <message name="echoStructArrayRequest">
+ <part name="inputStructArray" type="types:ArrayOfSOAPStruct"/>
+ </message>
+ <message name="echoStructArrayResponse">
+ <part name="return" type="types:ArrayOfSOAPStruct"/>
+ </message>
+
+ <!-- echoStructAsSimpleTypes rpc operation -->
+ <message name="echoStructAsSimpleTypesRequest">
+ <part name="inputStruct" type="types:SOAPStruct"/>
+ </message>
+ <message name="echoStructAsSimpleTypesResponse">
+ <part name="outputString" type="xsd:string"/>
+ <part name="outputInteger" type="xsd:int"/>
+ <part name="outputFloat" type="xsd:float"/>
+ </message>
+
+ <!-- echoSimpleTypesAsStruct rpc operation -->
+ <message name="echoSimpleTypesAsStructRequest">
+ <part name="inputString" type="xsd:string"/>
+ <part name="inputInteger" type="xsd:int"/>
+ <part name="inputFloat" type="xsd:float"/>
+ </message>
+ <message name="echoSimpleTypesAsStructResponse">
+ <part name="return" type="types:SOAPStruct"/>
+ </message>
+
+ <!-- echoNestedStruct rpc operation -->
+ <message name="echoNestedStructRequest">
+ <part name="inputStruct" type="types:SOAPStructStruct"/>
+ </message>
+ <message name="echoNestedStructResponse">
+ <part name="return" type="types:SOAPStructStruct"/>
+ </message>
+
+ <!-- echoNestedArray rpc operation -->
+ <message name="echoNestedArrayRequest">
+ <part name="inputStruct" type="types:SOAPArrayStruct"/>
+ </message>
+ <message name="echoNestedArrayResponse">
+ <part name="return" type="types:SOAPArrayStruct"/>
+ </message>
+
+ <!-- echoStringArray rpc operation -->
+ <message name="echoStringArrayRequest">
+ <part name="inputStringArray" type="types:ArrayOfstring"/>
+ </message>
+ <message name="echoStringArrayResponse">
+ <part name="return" type="types:ArrayOfstring"/>
+ </message>
+
+ <message name="echoStringArrayInlineRequest">
+ <part name="inputStringArray" type="types:ArrayOfstringInline"/>
+ </message>
+ <message name="echoStringArrayInlineResponse">
+ <part name="return" type="types:ArrayOfstringInline"/>
+ </message>
+
+ <!-- echoIntegerArray rpc operation -->
+ <message name="echoIntegerArrayRequest">
+ <part name="inputIntegerArray" type="types:ArrayOfint"/>
+ </message>
+ <message name="echoIntegerArrayResponse">
+ <part name="return" type="types:ArrayOfint"/>
+ </message>
+
+ <!-- echoBoolean rpc operation -->
+ <message name="echoBooleanRequest">
+ <part name="inputBoolean" type="xsd:boolean"/>
+ </message>
+ <message name="echoBooleanResponse">
+ <part name="return" type="xsd:boolean"/>
+ </message>
+
+ <!-- echoString rpc operation -->
+ <message name="echoStringRequest">
+ <part name="inputString" type="xsd:string"/>
+ </message>
+ <message name="echoStringResponse">
+ <part name="return" type="xsd:string"/>
+ </message>
+
+
+ <portType name="SoapTestPortTypeRpc">
+
+ <!-- echoStruct rpc operation -->
+ <operation name="echoStruct" parameterOrder="inputStruct">
+ <input message="tns:echoStructRequest"/>
+ <output message="tns:echoStructResponse"/>
+ </operation>
+
+ <!-- echoStructArray rpc operation -->
+ <operation name="echoStructArray" parameterOrder="inputStructArray">
+ <input message="tns:echoStructArrayRequest"/>
+ <output message="tns:echoStructArrayResponse"/>
+ </operation>
+
+ <!-- echoStructAsSimpleTypes rpc operation -->
+ <operation name="echoStructAsSimpleTypes" parameterOrder="inputStruct outputString outputInteger outputFloat">
+ <input message="tns:echoStructAsSimpleTypesRequest"/>
+ <output message="tns:echoStructAsSimpleTypesResponse"/>
+ </operation>
+
+ <!-- echoSimpleTypesAsStruct rpc operation -->
+ <operation name="echoSimpleTypesAsStruct" parameterOrder="inputString inputInteger inputFloat">
+ <input message="tns:echoSimpleTypesAsStructRequest"/>
+ <output message="tns:echoSimpleTypesAsStructResponse"/>
+ </operation>
+
+ <!-- echoNestedStruct rpc operation -->
+ <operation name="echoNestedStruct" parameterOrder="inputStruct">
+ <input message="tns:echoNestedStructRequest"/>
+ <output message="tns:echoNestedStructResponse"/>
+ </operation>
+
+ <!-- echoNestedArray rpc operation -->
+ <operation name="echoNestedArray" parameterOrder="inputStruct">
+ <input message="tns:echoNestedArrayRequest"/>
+ <output message="tns:echoNestedArrayResponse"/>
+ </operation>
+
+ <!-- echoStringArray rpc operation -->
+ <operation name="echoStringArray" parameterOrder="inputStringArray">
+ <input message="tns:echoStringArrayRequest"/>
+ <output message="tns:echoStringArrayResponse"/>
+ </operation>
+
+ <operation name="echoStringArrayInline" parameterOrder="inputStringArray">
+ <input message="tns:echoStringArrayInlineRequest"/>
+ <output message="tns:echoStringArrayInlineResponse"/>
+ </operation>
+
+ <!-- echoIntegerArray rpc operation -->
+ <operation name="echoIntegerArray" parameterOrder="inputIntegerArray">
+ <input message="tns:echoIntegerArrayRequest"/>
+ <output message="tns:echoIntegerArrayResponse"/>
+ </operation>
+
+ <!-- echoBoolean rpc operation -->
+ <operation name="echoBoolean" parameterOrder="inputBoolean">
+ <input message="tns:echoBooleanRequest"/>
+ <output message="tns:echoBooleanResponse"/>
+ </operation>
+
+ <!-- echoString rpc operation -->
+ <operation name="echoString" parameterOrder="inputString">
+ <input message="tns:echoStringRequest"/>
+ <output message="tns:echoStringResponse"/>
+ </operation>
+
+ </portType>
+
+ <binding name="Soap11TestRpcLitBinding" type="tns:SoapTestPortTypeRpc">
+ <soap11:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
+
+ <!-- echoStruct rpc operation -->
+ <operation name="echoStruct">
+ <soap11:operation soapAction="http://soapinterop.org/"/>
+ <input>
+ <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
+ </input>
+ <output>
+ <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
+ </output>
+ </operation>
+
+ <!-- echoStructArray rpc operation -->
+ <operation name="echoStructArray">
+ <soap11:operation soapAction="http://soapinterop.org/"/>
+ <input>
+ <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
+ </input>
+ <output>
+ <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
+ </output>
+ </operation>
+
+ <!-- echoStructAsSimpleTypes rpc operation -->
+ <operation name="echoStructAsSimpleTypes">
+ <soap11:operation soapAction="http://soapinterop.org/"/>
+ <input>
+ <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
+ </input>
+ <output>
+ <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
+ </output>
+ </operation>
+
+ <!-- echoSimpleTypesAsStruct rpc operation -->
+ <operation name="echoSimpleTypesAsStruct">
+ <soap11:operation soapAction="http://soapinterop.org/"/>
+ <input>
+ <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
+ </input>
+ <output>
+ <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
+ </output>
+ </operation>
+
+ <!-- echoNestedStruct rpc operation -->
+ <operation name="echoNestedStruct">
+ <soap11:operation soapAction="http://soapinterop.org/"/>
+ <input>
+ <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
+ </input>
+ <output>
+ <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
+ </output>
+ </operation>
+
+ <!-- echoNestedArray rpc operation -->
+ <operation name="echoNestedArray">
+ <soap11:operation soapAction="http://soapinterop.org/"/>
+ <input>
+ <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
+ </input>
+ <output>
+ <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
+ </output>
+ </operation>
+
+ <!-- echoStringArray rpc operation -->
+ <operation name="echoStringArray">
+ <soap11:operation soapAction="http://soapinterop.org/"/>
+ <input>
+ <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
+ </input>
+ <output>
+ <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
+ </output>
+ </operation>
+
+ <operation name="echoStringArrayInline">
+ <soap11:operation soapAction="http://soapinterop.org/"/>
+ <input>
+ <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
+ </input>
+ <output>
+ <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
+ </output>
+ </operation>
+
+ <!-- echoIntegerArray rpc operation -->
+ <operation name="echoIntegerArray">
+ <soap11:operation soapAction="http://soapinterop.org/"/>
+ <input>
+ <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
+ </input>
+ <output>
+ <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
+ </output>
+ </operation>
+
+ <!-- echoBoolean rpc operation -->
+ <operation name="echoBoolean">
+ <soap11:operation soapAction="http://soapinterop.org/"/>
+ <input>
+ <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
+ </input>
+ <output>
+ <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
+ </output>
+ </operation>
+
+ <!-- echoString rpc operation -->
+ <operation name="echoString">
+ <soap11:operation soapAction="http://soapinterop.org/"/>
+ <input>
+ <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
+ </input>
+ <output>
+ <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
+ </output>
+ </operation>
+
+ </binding>
+
+ <service name="WhiteMesaSoapRpcLitTestSvc">
+
+ <port name="Soap11TestRpcLitPort" binding="tns:Soap11TestRpcLitBinding">
+ <soap11:address location="http://www.whitemesa.net/test-rpc-lit"/>
+ </port>
+
+ </service>
+
+</definitions>
diff --git a/test/wsdl/rpc/test-rpc-lit12.wsdl b/test/wsdl/rpc/test-rpc-lit12.wsdl
new file mode 100644
index 0000000000..901cde6f9c
--- /dev/null
+++ b/test/wsdl/rpc/test-rpc-lit12.wsdl
@@ -0,0 +1,455 @@
+<?xml version="1.0"?>
+
+<definitions name="RPC-Literal-TestDefinitions"
+ targetNamespace="http://whitemesa.net/wsdl/rpc-lit-test"
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
+ xmlns:soap11="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:tns="http://whitemesa.net/wsdl/rpc-lit-test"
+ xmlns:types="http://soapbuilders.org/rpc-lit-test/types"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
+ <types>
+ <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://soapbuilders.org/rpc-lit-test/types">
+
+ <element name="stringItem" type="xsd:string" />
+ <complexType name="ArrayOfstring">
+ <sequence>
+ <element ref="types:stringItem" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ </complexType>
+
+ <complexType name="ArrayOfint">
+ <sequence>
+ <element name="integer" type="xsd:int" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ </complexType>
+
+ <element name="structItem" type="types:SOAPStruct" />
+ <complexType name="SOAPStruct">
+ <all>
+ <element name="varString" type="xsd:string"/>
+ <element name="varInt" type="xsd:int"/>
+ <element name="varFloat" type="xsd:float"/>
+ </all>
+ </complexType>
+
+ <complexType name="ArrayOfSOAPStruct">
+ <sequence>
+ <element ref="types:structItem" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ </complexType>
+
+ <complexType name="SOAPStructStruct">
+ <all>
+ <element name="varString" type="xsd:string"/>
+ <element name="varInt" type="xsd:int"/>
+ <element name="varFloat" type="xsd:float"/>
+ <element ref="types:structItem" />
+ </all>
+ </complexType>
+
+ <complexType name="SOAPArrayStruct">
+ <all>
+ <element name="varString" type="xsd:string"/>
+ <element name="varInt" type="xsd:int"/>
+ <element name="varFloat" type="xsd:float"/>
+ <element name="varArray" type="types:ArrayOfstring"/>
+ </all>
+ </complexType>
+
+ </schema>
+
+ </types>
+
+ <!-- echoStruct rpc operation -->
+ <message name="echoStructRequest">
+ <part name="inputStruct" type="types:SOAPStruct"/>
+ </message>
+ <message name="echoStructResponse">
+ <part name="return" type="types:SOAPStruct"/>
+ </message>
+
+ <!-- echoStructArray rpc operation -->
+ <message name="echoStructArrayRequest">
+ <part name="inputStructArray" type="types:ArrayOfSOAPStruct"/>
+ </message>
+ <message name="echoStructArrayResponse">
+ <part name="return" type="types:ArrayOfSOAPStruct"/>
+ </message>
+
+ <!-- echoStructAsSimpleTypes rpc operation -->
+ <message name="echoStructAsSimpleTypesRequest">
+ <part name="inputStruct" type="types:SOAPStruct"/>
+ </message>
+ <message name="echoStructAsSimpleTypesResponse">
+ <part name="outputString" type="xsd:string"/>
+ <part name="outputInteger" type="xsd:int"/>
+ <part name="outputFloat" type="xsd:float"/>
+ </message>
+
+ <!-- echoSimpleTypesAsStruct rpc operation -->
+ <message name="echoSimpleTypesAsStructRequest">
+ <part name="inputString" type="xsd:string"/>
+ <part name="inputInteger" type="xsd:int"/>
+ <part name="inputFloat" type="xsd:float"/>
+ </message>
+ <message name="echoSimpleTypesAsStructResponse">
+ <part name="return" type="types:SOAPStruct"/>
+ </message>
+
+ <!-- echoNestedStruct rpc operation -->
+ <message name="echoNestedStructRequest">
+ <part name="inputStruct" type="types:SOAPStructStruct"/>
+ </message>
+ <message name="echoNestedStructResponse">
+ <part name="return" type="types:SOAPStructStruct"/>
+ </message>
+
+ <!-- echoNestedArray rpc operation -->
+ <message name="echoNestedArrayRequest">
+ <part name="inputStruct" type="types:SOAPArrayStruct"/>
+ </message>
+ <message name="echoNestedArrayResponse">
+ <part name="return" type="types:SOAPArrayStruct"/>
+ </message>
+
+ <!-- echoStringArray rpc operation -->
+ <message name="echoStringArrayRequest">
+ <part name="inputStringArray" type="types:ArrayOfstring"/>
+ </message>
+ <message name="echoStringArrayResponse">
+ <part name="return" type="types:ArrayOfstring"/>
+ </message>
+
+ <!-- echoIntegerArray rpc operation -->
+ <message name="echoIntegerArrayRequest">
+ <part name="inputIntegerArray" type="types:ArrayOfint"/>
+ </message>
+ <message name="echoIntegerArrayResponse">
+ <part name="return" type="types:ArrayOfint"/>
+ </message>
+
+ <!-- echoBoolean rpc operation -->
+ <message name="echoBooleanRequest">
+ <part name="inputBoolean" type="xsd:boolean"/>
+ </message>
+ <message name="echoBooleanResponse">
+ <part name="return" type="xsd:boolean"/>
+ </message>
+
+ <!-- echoString rpc operation -->
+ <message name="echoStringRequest">
+ <part name="inputString" type="xsd:string"/>
+ </message>
+ <message name="echoStringResponse">
+ <part name="return" type="xsd:string"/>
+ </message>
+
+
+ <portType name="SoapTestPortTypeRpc">
+
+ <!-- echoStruct rpc operation -->
+ <operation name="echoStruct" parameterOrder="inputStruct">
+ <input message="tns:echoStructRequest"/>
+ <output message="tns:echoStructResponse"/>
+ </operation>
+
+ <!-- echoStructArray rpc operation -->
+ <operation name="echoStructArray" parameterOrder="inputStructArray">
+ <input message="tns:echoStructArrayRequest"/>
+ <output message="tns:echoStructArrayResponse"/>
+ </operation>
+
+ <!-- echoStructAsSimpleTypes rpc operation -->
+ <operation name="echoStructAsSimpleTypes" parameterOrder="inputStruct outputString outputInteger outputFloat">
+ <input message="tns:echoStructAsSimpleTypesRequest"/>
+ <output message="tns:echoStructAsSimpleTypesResponse"/>
+ </operation>
+
+ <!-- echoSimpleTypesAsStruct rpc operation -->
+ <operation name="echoSimpleTypesAsStruct" parameterOrder="inputString inputInteger inputFloat">
+ <input message="tns:echoSimpleTypesAsStructRequest"/>
+ <output message="tns:echoSimpleTypesAsStructResponse"/>
+ </operation>
+
+ <!-- echoNestedStruct rpc operation -->
+ <operation name="echoNestedStruct" parameterOrder="inputStruct">
+ <input message="tns:echoNestedStructRequest"/>
+ <output message="tns:echoNestedStructResponse"/>
+ </operation>
+
+ <!-- echoNestedArray rpc operation -->
+ <operation name="echoNestedArray" parameterOrder="inputStruct">
+ <input message="tns:echoNestedArrayRequest"/>
+ <output message="tns:echoNestedArrayResponse"/>
+ </operation>
+
+ <!-- echoStringArray rpc operation -->
+ <operation name="echoStringArray" parameterOrder="inputStringArray">
+ <input message="tns:echoStringArrayRequest"/>
+ <output message="tns:echoStringArrayResponse"/>
+ </operation>
+
+ <!-- echoIntegerArray rpc operation -->
+ <operation name="echoIntegerArray" parameterOrder="inputIntegerArray">
+ <input message="tns:echoIntegerArrayRequest"/>
+ <output message="tns:echoIntegerArrayResponse"/>
+ </operation>
+
+ <!-- echoBoolean rpc operation -->
+ <operation name="echoBoolean" parameterOrder="inputBoolean">
+ <input message="tns:echoBooleanRequest"/>
+ <output message="tns:echoBooleanResponse"/>
+ </operation>
+
+ <!-- echoString rpc operation -->
+ <operation name="echoString" parameterOrder="inputString">
+ <input message="tns:echoStringRequest"/>
+ <output message="tns:echoStringResponse"/>
+ </operation>
+
+ </portType>
+
+ <binding name="Soap11TestRpcLitBinding" type="tns:SoapTestPortTypeRpc">
+ <soap11:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
+
+ <!-- echoStruct rpc operation -->
+ <operation name="echoStruct">
+ <soap11:operation soapAction="http://soapinterop.org/"/>
+ <input>
+ <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
+ </input>
+ <output>
+ <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
+ </output>
+ </operation>
+
+ <!-- echoStructArray rpc operation -->
+ <operation name="echoStructArray">
+ <soap11:operation soapAction="http://soapinterop.org/"/>
+ <input>
+ <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
+ </input>
+ <output>
+ <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
+ </output>
+ </operation>
+
+ <!-- echoStructAsSimpleTypes rpc operation -->
+ <operation name="echoStructAsSimpleTypes">
+ <soap11:operation soapAction="http://soapinterop.org/"/>
+ <input>
+ <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
+ </input>
+ <output>
+ <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
+ </output>
+ </operation>
+
+ <!-- echoSimpleTypesAsStruct rpc operation -->
+ <operation name="echoSimpleTypesAsStruct">
+ <soap11:operation soapAction="http://soapinterop.org/"/>
+ <input>
+ <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
+ </input>
+ <output>
+ <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
+ </output>
+ </operation>
+
+ <!-- echoNestedStruct rpc operation -->
+ <operation name="echoNestedStruct">
+ <soap11:operation soapAction="http://soapinterop.org/"/>
+ <input>
+ <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
+ </input>
+ <output>
+ <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
+ </output>
+ </operation>
+
+ <!-- echoNestedArray rpc operation -->
+ <operation name="echoNestedArray">
+ <soap11:operation soapAction="http://soapinterop.org/"/>
+ <input>
+ <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
+ </input>
+ <output>
+ <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
+ </output>
+ </operation>
+
+ <!-- echoStringArray rpc operation -->
+ <operation name="echoStringArray">
+ <soap11:operation soapAction="http://soapinterop.org/"/>
+ <input>
+ <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
+ </input>
+ <output>
+ <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
+ </output>
+ </operation>
+
+ <!-- echoIntegerArray rpc operation -->
+ <operation name="echoIntegerArray">
+ <soap11:operation soapAction="http://soapinterop.org/"/>
+ <input>
+ <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
+ </input>
+ <output>
+ <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
+ </output>
+ </operation>
+
+ <!-- echoBoolean rpc operation -->
+ <operation name="echoBoolean">
+ <soap11:operation soapAction="http://soapinterop.org/"/>
+ <input>
+ <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
+ </input>
+ <output>
+ <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
+ </output>
+ </operation>
+
+ <!-- echoString rpc operation -->
+ <operation name="echoString">
+ <soap11:operation soapAction="http://soapinterop.org/"/>
+ <input>
+ <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
+ </input>
+ <output>
+ <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
+ </output>
+ </operation>
+
+ </binding>
+
+ <binding name="Soap12TestRpcLitBinding" type="tns:SoapTestPortTypeRpc">
+ <soap12:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
+
+ <!-- echoStruct rpc operation -->
+ <operation name="echoStruct">
+ <soap12:operation/>
+ <input>
+ <soap12:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
+ </input>
+ <output>
+ <soap12:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
+ </output>
+ </operation>
+
+ <!-- echoStructArray rpc operation -->
+ <operation name="echoStructArray">
+ <soap12:operation/>
+ <input>
+ <soap12:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
+ </input>
+ <output>
+ <soap12:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
+ </output>
+ </operation>
+
+ <!-- echoStructAsSimpleTypes rpc operation -->
+ <operation name="echoStructAsSimpleTypes">
+ <soap12:operation/>
+ <input>
+ <soap12:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
+ </input>
+ <output>
+ <soap12:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
+ </output>
+ </operation>
+
+ <!-- echoSimpleTypesAsStruct rpc operation -->
+ <operation name="echoSimpleTypesAsStruct">
+ <soap12:operation/>
+ <input>
+ <soap12:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
+ </input>
+ <output>
+ <soap12:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
+ </output>
+ </operation>
+
+ <!-- echoNestedStruct rpc operation -->
+ <operation name="echoNestedStruct">
+ <soap12:operation/>
+ <input>
+ <soap12:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
+ </input>
+ <output>
+ <soap12:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
+ </output>
+ </operation>
+
+ <!-- echoNestedArray rpc operation -->
+ <operation name="echoNestedArray">
+ <soap12:operation/>
+ <input>
+ <soap12:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
+ </input>
+ <output>
+ <soap12:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
+ </output>
+ </operation>
+
+ <!-- echoStringArray rpc operation -->
+ <operation name="echoStringArray">
+ <soap12:operation/>
+ <input>
+ <soap12:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
+ </input>
+ <output>
+ <soap12:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
+ </output>
+ </operation>
+
+ <!-- echoIntegerArray rpc operation -->
+ <operation name="echoIntegerArray">
+ <soap12:operation/>
+ <input>
+ <soap12:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
+ </input>
+ <output>
+ <soap12:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
+ </output>
+ </operation>
+
+ <!-- echoBoolean rpc operation -->
+ <operation name="echoBoolean">
+ <soap12:operation/>
+ <input>
+ <soap12:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
+ </input>
+ <output>
+ <soap12:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
+ </output>
+ </operation>
+
+ <!-- echoString rpc operation -->
+ <operation name="echoString">
+ <soap12:operation/>
+ <input>
+ <soap12:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
+ </input>
+ <output>
+ <soap12:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
+ </output>
+ </operation>
+
+ </binding>
+
+ <service name="WhiteMesaSoapRpcLitTestSvc">
+
+ <port name="Soap12TestRpcLitPort" binding="tns:Soap12TestRpcLitBinding">
+ <soap12:address location="http://www.whitemesa.net/soap12/test-rpc-lit"/>
+ </port>
+ <port name="Soap11TestRpcLitPort" binding="tns:Soap11TestRpcLitBinding">
+ <soap11:address location="http://www.whitemesa.net/test-rpc-lit"/>
+ </port>
+
+ </service>
+
+</definitions>
diff --git a/test/wsdl/rpc/test_rpc.rb b/test/wsdl/rpc/test_rpc.rb
new file mode 100644
index 0000000000..7c4c3a7ad6
--- /dev/null
+++ b/test/wsdl/rpc/test_rpc.rb
@@ -0,0 +1,118 @@
+require 'test/unit'
+require 'wsdl/parser'
+require 'wsdl/soap/wsdl2ruby'
+require 'soap/rpc/standaloneServer'
+require 'soap/wsdlDriver'
+
+
+module WSDL; module RPC
+
+
+class TestRPC < Test::Unit::TestCase
+ class Server < ::SOAP::RPC::StandaloneServer
+ def on_init
+ self.generate_explicit_type = false
+ add_rpc_method(self, 'echo', 'arg1', 'arg2')
+ add_rpc_method(self, 'echo_err', 'arg1', 'arg2')
+ end
+
+ DummyPerson = Struct.new("family-name".intern, :given_name)
+ def echo(arg1, arg2)
+ case arg1.family_name
+ when 'normal'
+ arg1.family_name = arg2.family_name
+ arg1.given_name = arg2.given_name
+ arg1.age = arg2.age
+ arg1
+ when 'dummy'
+ DummyPerson.new("family-name", "given_name")
+ else
+ raise
+ end
+ end
+
+ ErrPerson = Struct.new(:given_name, :no_such_element)
+ def echo_err(arg1, arg2)
+ ErrPerson.new(58, Time.now)
+ end
+ end
+
+ DIR = File.dirname(File.expand_path(__FILE__))
+
+ Port = 17171
+
+ def setup
+ setup_server
+ setup_classdef
+ @client = nil
+ end
+
+ def teardown
+ teardown_server
+ File.unlink(pathname('echo.rb'))
+ @client.reset_stream if @client
+ end
+
+ def setup_server
+ @server = Server.new('Test', "urn:rpc", '0.0.0.0', Port)
+ @server.level = Logger::Severity::ERROR
+ @server_thread = start_server_thread(@server)
+ end
+
+ def setup_classdef
+ gen = WSDL::SOAP::WSDL2Ruby.new
+ gen.location = pathname("rpc.wsdl")
+ gen.basedir = DIR
+ gen.logger.level = Logger::FATAL
+ gen.opt['classdef'] = nil
+ gen.opt['force'] = true
+ gen.run
+ require pathname('echo')
+ end
+
+ def teardown_server
+ @server.shutdown
+ @server_thread.kill
+ @server_thread.join
+ end
+
+ def start_server_thread(server)
+ t = Thread.new {
+ Thread.current.abort_on_exception = true
+ server.start
+ }
+ t
+ end
+
+ def pathname(filename)
+ File.join(DIR, filename)
+ end
+
+ def test_wsdl
+ wsdl = File.join(DIR, 'rpc.wsdl')
+ @client = ::SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver
+ @client.endpoint_url = "http://localhost:#{Port}/"
+ @client.wiredump_dev = STDOUT if $DEBUG
+
+ ret = @client.echo(Person.new("normal", "", 12), Person.new("Hi", "Na", 21))
+ assert_equal(Person, ret.class)
+ assert_equal("Hi", ret.family_name)
+ assert_equal("Na", ret.given_name)
+ assert_equal(21, ret.age)
+
+ ret = @client.echo(Person.new("dummy", "", 12), Person.new("Hi", "Na", 21))
+ assert_equal(Person, ret.class)
+ assert_equal("family-name", ret.family_name)
+ assert_equal("given_name", ret.given_name)
+ assert_equal(nil, ret.age)
+
+ ret = @client.echo_err(Person.new("Na", "Hi"), Person.new("Hi", "Na"))
+ assert_equal(Person, ret.class)
+ assert_equal("58", ret.given_name)
+ assert_equal(nil, ret.family_name)
+ assert_equal(nil, ret.age)
+ end
+end
+
+
+end; end
diff --git a/test/wsdl/rpc/test_rpc_lit.rb b/test/wsdl/rpc/test_rpc_lit.rb
new file mode 100644
index 0000000000..080dbb82cf
--- /dev/null
+++ b/test/wsdl/rpc/test_rpc_lit.rb
@@ -0,0 +1,399 @@
+require 'test/unit'
+require 'wsdl/soap/wsdl2ruby'
+require 'soap/rpc/standaloneServer'
+require 'soap/wsdlDriver'
+
+if defined?(HTTPAccess2) and defined?(OpenSSL)
+
+module WSDL; module RPC
+
+
+class TestRPCLIT < Test::Unit::TestCase
+ class Server < ::SOAP::RPC::StandaloneServer
+ Namespace = "http://soapbuilders.org/rpc-lit-test"
+
+ def on_init
+ self.generate_explicit_type = false
+ add_rpc_operation(self,
+ XSD::QName.new(Namespace, 'echoStringArray'),
+ nil,
+ 'echoStringArray', [
+ ['in', 'inputStringArray', nil],
+ ['retval', 'return', nil]
+ ],
+ {
+ :request_style => :rpc,
+ :request_use => :literal,
+ :response_style => :rpc,
+ :response_use => :literal
+ }
+ )
+ add_rpc_operation(self,
+ XSD::QName.new(Namespace, 'echoStringArrayInline'),
+ nil,
+ 'echoStringArrayInline', [
+ ['in', 'inputStringArray', nil],
+ ['retval', 'return', nil]
+ ],
+ {
+ :request_style => :rpc,
+ :request_use => :literal,
+ :response_style => :rpc,
+ :response_use => :literal
+ }
+ )
+ add_rpc_operation(self,
+ XSD::QName.new(Namespace, 'echoNestedStruct'),
+ nil,
+ 'echoNestedStruct', [
+ ['in', 'inputNestedStruct', nil],
+ ['retval', 'return', nil]
+ ],
+ {
+ :request_style => :rpc,
+ :request_use => :literal,
+ :response_style => :rpc,
+ :response_use => :literal
+ }
+ )
+ add_rpc_operation(self,
+ XSD::QName.new(Namespace, 'echoStructArray'),
+ nil,
+ 'echoStructArray', [
+ ['in', 'inputStructArray', nil],
+ ['retval', 'return', nil]
+ ],
+ {
+ :request_style => :rpc,
+ :request_use => :literal,
+ :response_style => :rpc,
+ :response_use => :literal
+ }
+ )
+ end
+
+ def echoStringArray(strings)
+ # strings.stringItem => Array
+ ArrayOfstring[*strings.stringItem]
+ end
+
+ def echoStringArrayInline(strings)
+ ArrayOfstringInline[*strings.stringItem]
+ end
+
+ def echoNestedStruct(struct)
+ struct
+ end
+
+ def echoStructArray(ary)
+ ary
+ end
+ end
+
+ DIR = File.dirname(File.expand_path(__FILE__))
+
+ Port = 17171
+
+ def setup
+ setup_server
+ setup_classdef
+ @client = nil
+ end
+
+ def teardown
+ teardown_server
+ unless $DEBUG
+ File.unlink(pathname('RPC-Literal-TestDefinitions.rb'))
+ File.unlink(pathname('RPC-Literal-TestDefinitionsDriver.rb'))
+ end
+ @client.reset_stream if @client
+ end
+
+ def setup_server
+ @server = Server.new('Test', Server::Namespace, '0.0.0.0', Port)
+ @server.level = Logger::Severity::ERROR
+ @server_thread = start_server_thread(@server)
+ end
+
+ def setup_classdef
+ gen = WSDL::SOAP::WSDL2Ruby.new
+ gen.location = pathname("test-rpc-lit.wsdl")
+ gen.basedir = DIR
+ gen.logger.level = Logger::FATAL
+ gen.opt['classdef'] = nil
+ gen.opt['driver'] = nil
+ gen.opt['force'] = true
+ gen.run
+ backupdir = Dir.pwd
+ begin
+ Dir.chdir(DIR)
+ require pathname('RPC-Literal-TestDefinitions.rb')
+ require pathname('RPC-Literal-TestDefinitionsDriver.rb')
+ ensure
+ Dir.chdir(backupdir)
+ end
+ end
+
+ def teardown_server
+ @server.shutdown
+ @server_thread.kill
+ @server_thread.join
+ end
+
+ def start_server_thread(server)
+ t = Thread.new {
+ Thread.current.abort_on_exception = true
+ server.start
+ }
+ t
+ end
+
+ def pathname(filename)
+ File.join(DIR, filename)
+ end
+
+ def test_wsdl_echoStringArray
+ wsdl = pathname('test-rpc-lit.wsdl')
+ @client = ::SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver
+ @client.endpoint_url = "http://localhost:#{Port}/"
+ @client.wiredump_dev = STDOUT if $DEBUG
+ # response contains only 1 part.
+ result = @client.echoStringArray(ArrayOfstring["a", "b", "c"])[0]
+ assert_equal(["a", "b", "c"], result.stringItem)
+ end
+
+ ECHO_STRING_ARRAY_REQUEST =
+%q[<?xml version="1.0" encoding="utf-8" ?>
+<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <env:Body>
+ <n1:echoStringArray xmlns:n1="http://soapbuilders.org/rpc-lit-test">
+ <inputStringArray xmlns:n2="http://soapbuilders.org/rpc-lit-test/types">
+ <n2:stringItem>a</n2:stringItem>
+ <n2:stringItem>b</n2:stringItem>
+ <n2:stringItem>c</n2:stringItem>
+ </inputStringArray>
+ </n1:echoStringArray>
+ </env:Body>
+</env:Envelope>]
+
+ ECHO_STRING_ARRAY_RESPONSE =
+%q[<?xml version="1.0" encoding="utf-8" ?>
+<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <env:Body>
+ <n1:echoStringArrayResponse xmlns:n1="http://soapbuilders.org/rpc-lit-test">
+ <return xmlns:n2="http://soapbuilders.org/rpc-lit-test/types">
+ <n2:stringItem>a</n2:stringItem>
+ <n2:stringItem>b</n2:stringItem>
+ <n2:stringItem>c</n2:stringItem>
+ </return>
+ </n1:echoStringArrayResponse>
+ </env:Body>
+</env:Envelope>]
+
+ def test_stub_echoStringArray
+ drv = SoapTestPortTypeRpc.new("http://localhost:#{Port}/")
+ drv.wiredump_dev = str = ''
+ # response contains only 1 part.
+ result = drv.echoStringArray(ArrayOfstring["a", "b", "c"])[0]
+ assert_equal(["a", "b", "c"], result.stringItem)
+ assert_equal(ECHO_STRING_ARRAY_REQUEST, parse_requestxml(str))
+ assert_equal(ECHO_STRING_ARRAY_RESPONSE, parse_responsexml(str))
+ end
+
+ ECHO_STRING_ARRAY_INLINE_REQUEST =
+%q[<?xml version="1.0" encoding="utf-8" ?>
+<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <env:Body>
+ <n1:echoStringArrayInline xmlns:n1="http://soapbuilders.org/rpc-lit-test">
+ <inputStringArray>
+ <stringItem>a</stringItem>
+ <stringItem>b</stringItem>
+ <stringItem>c</stringItem>
+ </inputStringArray>
+ </n1:echoStringArrayInline>
+ </env:Body>
+</env:Envelope>]
+
+ ECHO_STRING_ARRAY_INLINE_RESPONSE =
+%q[<?xml version="1.0" encoding="utf-8" ?>
+<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <env:Body>
+ <n1:echoStringArrayInlineResponse xmlns:n1="http://soapbuilders.org/rpc-lit-test">
+ <return>
+ <stringItem>a</stringItem>
+ <stringItem>b</stringItem>
+ <stringItem>c</stringItem>
+ </return>
+ </n1:echoStringArrayInlineResponse>
+ </env:Body>
+</env:Envelope>]
+
+ def test_stub_echoStringArrayInline
+ drv = SoapTestPortTypeRpc.new("http://localhost:#{Port}/")
+ drv.wiredump_dev = str = ''
+ # response contains only 1 part.
+ result = drv.echoStringArrayInline(ArrayOfstringInline["a", "b", "c"])[0]
+ assert_equal(["a", "b", "c"], result.stringItem)
+ assert_equal(ECHO_STRING_ARRAY_INLINE_REQUEST, parse_requestxml(str))
+ assert_equal(ECHO_STRING_ARRAY_INLINE_RESPONSE, parse_responsexml(str))
+ end
+
+ ECHO_NESTED_STRUCT_REQUEST =
+%q[<?xml version="1.0" encoding="utf-8" ?>
+<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <env:Body>
+ <n1:echoNestedStruct xmlns:n1="http://soapbuilders.org/rpc-lit-test">
+ <inputStruct xmlns:n2="http://soapbuilders.org/rpc-lit-test/types">
+ <varString>str</varString>
+ <varInt>1</varInt>
+ <varFloat>+1</varFloat>
+ <n2:structItem>
+ <varString>str</varString>
+ <varInt>1</varInt>
+ <varFloat>+1</varFloat>
+ </n2:structItem>
+ </inputStruct>
+ </n1:echoNestedStruct>
+ </env:Body>
+</env:Envelope>]
+
+ ECHO_NESTED_STRUCT_RESPONSE =
+%q[<?xml version="1.0" encoding="utf-8" ?>
+<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <env:Body>
+ <n1:echoNestedStructResponse xmlns:n1="http://soapbuilders.org/rpc-lit-test">
+ <return xmlns:n2="http://soapbuilders.org/rpc-lit-test/types">
+ <varString>str</varString>
+ <varInt>1</varInt>
+ <varFloat>+1</varFloat>
+ <n2:structItem>
+ <varString>str</varString>
+ <varInt>1</varInt>
+ <varFloat>+1</varFloat>
+ </n2:structItem>
+ </return>
+ </n1:echoNestedStructResponse>
+ </env:Body>
+</env:Envelope>]
+
+ def test_wsdl_echoNestedStruct
+ wsdl = pathname('test-rpc-lit.wsdl')
+ @client = ::SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver
+ @client.endpoint_url = "http://localhost:#{Port}/"
+ @client.wiredump_dev = str = ''
+ # response contains only 1 part.
+ result = @client.echoNestedStruct(SOAPStructStruct.new("str", 1, 1.0, SOAPStruct.new("str", 1, 1.0)))[0]
+ assert_equal('str', result.varString)
+ assert_equal('1', result.varInt)
+ assert_equal('+1', result.varFloat)
+ assert_equal('str', result.structItem.varString)
+ assert_equal('1', result.structItem.varInt)
+ assert_equal('+1', result.structItem.varFloat)
+ assert_equal(ECHO_NESTED_STRUCT_REQUEST, parse_requestxml(str))
+ assert_equal(ECHO_NESTED_STRUCT_RESPONSE, parse_responsexml(str))
+ end
+
+ def test_stub_echoNestedStruct
+ drv = SoapTestPortTypeRpc.new("http://localhost:#{Port}/")
+ drv.wiredump_dev = str = ''
+ # response contains only 1 part.
+ result = drv.echoNestedStruct(SOAPStructStruct.new("str", 1, 1.0, SOAPStruct.new("str", 1, 1.0)))[0]
+ assert_equal('str', result.varString)
+ assert_equal('1', result.varInt)
+ assert_equal('+1', result.varFloat)
+ assert_equal('str', result.structItem.varString)
+ assert_equal('1', result.structItem.varInt)
+ assert_equal('+1', result.structItem.varFloat)
+ assert_equal(ECHO_NESTED_STRUCT_REQUEST, parse_requestxml(str))
+ assert_equal(ECHO_NESTED_STRUCT_RESPONSE, parse_responsexml(str))
+ end
+
+ ECHO_STRUCT_ARRAY_REQUEST =
+%q[<?xml version="1.0" encoding="utf-8" ?>
+<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <env:Body>
+ <n1:echoStructArray xmlns:n1="http://soapbuilders.org/rpc-lit-test">
+ <inputStructArray xmlns:n2="http://soapbuilders.org/rpc-lit-test/types">
+ <n2:structItem>
+ <varString>str</varString>
+ <varInt>2</varInt>
+ <varFloat>+2.1</varFloat>
+ </n2:structItem>
+ <n2:structItem>
+ <varString>str</varString>
+ <varInt>2</varInt>
+ <varFloat>+2.1</varFloat>
+ </n2:structItem>
+ </inputStructArray>
+ </n1:echoStructArray>
+ </env:Body>
+</env:Envelope>]
+
+ ECHO_STRUCT_ARRAY_RESPONSE =
+%q[<?xml version="1.0" encoding="utf-8" ?>
+<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <env:Body>
+ <n1:echoStructArrayResponse xmlns:n1="http://soapbuilders.org/rpc-lit-test">
+ <return xmlns:n2="http://soapbuilders.org/rpc-lit-test/types">
+ <n2:structItem>
+ <varString>str</varString>
+ <varInt>2</varInt>
+ <varFloat>+2.1</varFloat>
+ </n2:structItem>
+ <n2:structItem>
+ <varString>str</varString>
+ <varInt>2</varInt>
+ <varFloat>+2.1</varFloat>
+ </n2:structItem>
+ </return>
+ </n1:echoStructArrayResponse>
+ </env:Body>
+</env:Envelope>]
+
+ def test_wsdl_echoStructArray
+ wsdl = pathname('test-rpc-lit.wsdl')
+ @client = ::SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver
+ @client.endpoint_url = "http://localhost:#{Port}/"
+ @client.wiredump_dev = str = ''
+ # response contains only 1 part.
+ e = SOAPStruct.new("str", 2, 2.1)
+ result = @client.echoStructArray(ArrayOfSOAPStruct[e, e])
+ assert_equal(ECHO_STRUCT_ARRAY_REQUEST, parse_requestxml(str))
+ assert_equal(ECHO_STRUCT_ARRAY_RESPONSE, parse_responsexml(str))
+ end
+
+ def test_stub_echoStructArray
+ drv = SoapTestPortTypeRpc.new("http://localhost:#{Port}/")
+ drv.wiredump_dev = str = ''
+ # response contains only 1 part.
+ e = SOAPStruct.new("str", 2, 2.1)
+ result = drv.echoStructArray(ArrayOfSOAPStruct[e, e])
+ assert_equal(ECHO_STRUCT_ARRAY_REQUEST, parse_requestxml(str))
+ assert_equal(ECHO_STRUCT_ARRAY_RESPONSE, parse_responsexml(str))
+ end
+
+ def parse_requestxml(str)
+ str.split(/\r?\n\r?\n/)[3]
+ end
+
+ def parse_responsexml(str)
+ str.split(/\r?\n\r?\n/)[6]
+ end
+end
+
+
+end; end
+
+end
diff --git a/test/wsdl/simpletype/rpc/expectedClient.rb b/test/wsdl/simpletype/rpc/expectedClient.rb
new file mode 100644
index 0000000000..55eb58c3dd
--- /dev/null
+++ b/test/wsdl/simpletype/rpc/expectedClient.rb
@@ -0,0 +1,34 @@
+#!/usr/bin/env ruby
+require 'echo_versionDriver.rb'
+
+endpoint_url = ARGV.shift
+obj = Echo_version_port_type.new(endpoint_url)
+
+# run ruby with -d to see SOAP wiredumps.
+obj.wiredump_dev = STDERR if $DEBUG
+
+# SYNOPSIS
+# echo_version(version)
+#
+# ARGS
+# version Version - {urn:example.com:simpletype-rpc-type}version
+#
+# RETURNS
+# version_struct Version_struct - {urn:example.com:simpletype-rpc-type}version_struct
+#
+version = nil
+puts obj.echo_version(version)
+
+# SYNOPSIS
+# echo_version_r(version_struct)
+#
+# ARGS
+# version_struct Version_struct - {urn:example.com:simpletype-rpc-type}version_struct
+#
+# RETURNS
+# version Version - {urn:example.com:simpletype-rpc-type}version
+#
+version_struct = nil
+puts obj.echo_version_r(version_struct)
+
+
diff --git a/test/wsdl/simpletype/rpc/expectedDriver.rb b/test/wsdl/simpletype/rpc/expectedDriver.rb
new file mode 100644
index 0000000000..81c72d1acf
--- /dev/null
+++ b/test/wsdl/simpletype/rpc/expectedDriver.rb
@@ -0,0 +1,62 @@
+require 'echo_version.rb'
+
+require 'soap/rpc/driver'
+
+class Echo_version_port_type < ::SOAP::RPC::Driver
+ DefaultEndpointUrl = "http://localhost:10080"
+ MappingRegistry = ::SOAP::Mapping::Registry.new
+
+ MappingRegistry.set(
+ Version_struct,
+ ::SOAP::SOAPStruct,
+ ::SOAP::Mapping::Registry::TypedStructFactory,
+ { :type => XSD::QName.new("urn:example.com:simpletype-rpc-type", "version_struct") }
+ )
+
+ Methods = [
+ [ XSD::QName.new("urn:example.com:simpletype-rpc", "echo_version"),
+ "urn:example.com:simpletype-rpc",
+ "echo_version",
+ [ ["in", "version", ["::SOAP::SOAPString"]],
+ ["retval", "version_struct", ["Version_struct", "urn:example.com:simpletype-rpc-type", "version_struct"]] ],
+ { :request_style => :rpc, :request_use => :encoded,
+ :response_style => :rpc, :response_use => :encoded }
+ ],
+ [ XSD::QName.new("urn:example.com:simpletype-rpc", "echo_version_r"),
+ "urn:example.com:simpletype-rpc",
+ "echo_version_r",
+ [ ["in", "version_struct", ["Version_struct", "urn:example.com:simpletype-rpc-type", "version_struct"]],
+ ["retval", "version", ["::SOAP::SOAPString"]] ],
+ { :request_style => :rpc, :request_use => :encoded,
+ :response_style => :rpc, :response_use => :encoded }
+ ]
+ ]
+
+ def initialize(endpoint_url = nil)
+ endpoint_url ||= DefaultEndpointUrl
+ super(endpoint_url, nil)
+ self.mapping_registry = MappingRegistry
+ init_methods
+ end
+
+private
+
+ def init_methods
+ Methods.each do |definitions|
+ opt = definitions.last
+ if opt[:request_style] == :document
+ add_document_operation(*definitions)
+ else
+ add_rpc_operation(*definitions)
+ qname = definitions[0]
+ name = definitions[2]
+ if qname.name != name and qname.name.capitalize == name.capitalize
+ ::SOAP::Mapping.define_singleton_method(self, qname.name) do |*arg|
+ __send__(name, *arg)
+ end
+ end
+ end
+ end
+ end
+end
+
diff --git a/test/wsdl/simpletype/rpc/expectedEchoVersion.rb b/test/wsdl/simpletype/rpc/expectedEchoVersion.rb
new file mode 100644
index 0000000000..806ece1626
--- /dev/null
+++ b/test/wsdl/simpletype/rpc/expectedEchoVersion.rb
@@ -0,0 +1,23 @@
+require 'xsd/qname'
+
+# {urn:example.com:simpletype-rpc-type}version_struct
+class Version_struct
+ @@schema_type = "version_struct"
+ @@schema_ns = "urn:example.com:simpletype-rpc-type"
+ @@schema_element = [["version", ["SOAP::SOAPString", XSD::QName.new(nil, "version")]], ["msg", ["SOAP::SOAPString", XSD::QName.new(nil, "msg")]]]
+
+ attr_accessor :version
+ attr_accessor :msg
+
+ def initialize(version = nil, msg = nil)
+ @version = version
+ @msg = msg
+ end
+end
+
+# {urn:example.com:simpletype-rpc-type}version
+module Version
+ C_16 = "1.6"
+ C_18 = "1.8"
+ C_19 = "1.9"
+end
diff --git a/test/wsdl/simpletype/rpc/expectedServant.rb b/test/wsdl/simpletype/rpc/expectedServant.rb
new file mode 100644
index 0000000000..81cf50218e
--- /dev/null
+++ b/test/wsdl/simpletype/rpc/expectedServant.rb
@@ -0,0 +1,32 @@
+require 'echo_version.rb'
+
+class Echo_version_port_type
+ # SYNOPSIS
+ # echo_version(version)
+ #
+ # ARGS
+ # version Version - {urn:example.com:simpletype-rpc-type}version
+ #
+ # RETURNS
+ # version_struct Version_struct - {urn:example.com:simpletype-rpc-type}version_struct
+ #
+ def echo_version(version)
+ p [version]
+ raise NotImplementedError.new
+ end
+
+ # SYNOPSIS
+ # echo_version_r(version_struct)
+ #
+ # ARGS
+ # version_struct Version_struct - {urn:example.com:simpletype-rpc-type}version_struct
+ #
+ # RETURNS
+ # version Version - {urn:example.com:simpletype-rpc-type}version
+ #
+ def echo_version_r(version_struct)
+ p [version_struct]
+ raise NotImplementedError.new
+ end
+end
+
diff --git a/test/wsdl/simpletype/rpc/expectedService.rb b/test/wsdl/simpletype/rpc/expectedService.rb
new file mode 100644
index 0000000000..be6f996562
--- /dev/null
+++ b/test/wsdl/simpletype/rpc/expectedService.rb
@@ -0,0 +1,60 @@
+#!/usr/bin/env ruby
+require 'echo_versionServant.rb'
+
+require 'soap/rpc/standaloneServer'
+require 'soap/mapping/registry'
+
+class Echo_version_port_type
+ MappingRegistry = ::SOAP::Mapping::Registry.new
+
+ MappingRegistry.set(
+ Version_struct,
+ ::SOAP::SOAPStruct,
+ ::SOAP::Mapping::Registry::TypedStructFactory,
+ { :type => XSD::QName.new("urn:example.com:simpletype-rpc-type", "version_struct") }
+ )
+
+ Methods = [
+ [ XSD::QName.new("urn:example.com:simpletype-rpc", "echo_version"),
+ "urn:example.com:simpletype-rpc",
+ "echo_version",
+ [ ["in", "version", ["::SOAP::SOAPString"]],
+ ["retval", "version_struct", ["Version_struct", "urn:example.com:simpletype-rpc-type", "version_struct"]] ],
+ { :request_style => :rpc, :request_use => :encoded,
+ :response_style => :rpc, :response_use => :encoded }
+ ],
+ [ XSD::QName.new("urn:example.com:simpletype-rpc", "echo_version_r"),
+ "urn:example.com:simpletype-rpc",
+ "echo_version_r",
+ [ ["in", "version_struct", ["Version_struct", "urn:example.com:simpletype-rpc-type", "version_struct"]],
+ ["retval", "version", ["::SOAP::SOAPString"]] ],
+ { :request_style => :rpc, :request_use => :encoded,
+ :response_style => :rpc, :response_use => :encoded }
+ ]
+ ]
+end
+
+class Echo_version_port_typeApp < ::SOAP::RPC::StandaloneServer
+ def initialize(*arg)
+ super(*arg)
+ servant = Echo_version_port_type.new
+ Echo_version_port_type::Methods.each do |definitions|
+ opt = definitions.last
+ if opt[:request_style] == :document
+ @router.add_document_operation(servant, *definitions)
+ else
+ @router.add_rpc_operation(servant, *definitions)
+ end
+ end
+ self.mapping_registry = Echo_version_port_type::MappingRegistry
+ end
+end
+
+if $0 == __FILE__
+ # Change listen port.
+ server = Echo_version_port_typeApp.new('app', nil, '0.0.0.0', 10080)
+ trap(:INT) do
+ server.shutdown
+ end
+ server.start
+end
diff --git a/test/wsdl/simpletype/rpc/rpc.wsdl b/test/wsdl/simpletype/rpc/rpc.wsdl
new file mode 100644
index 0000000000..91f71a8831
--- /dev/null
+++ b/test/wsdl/simpletype/rpc/rpc.wsdl
@@ -0,0 +1,80 @@
+<?xml version="1.0" encoding="utf-8"?>
+<definitions name="echo_version"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:tns="urn:example.com:simpletype-rpc"
+ xmlns:txd="urn:example.com:simpletype-rpc-type"
+ targetNamespace="urn:example.com:simpletype-rpc"
+ xmlns="http://schemas.xmlsoap.org/wsdl/">
+ <types>
+ <xsd:schema targetNamespace="urn:example.com:simpletype-rpc-type">
+ <xsd:complexType name="version_struct">
+ <xsd:all>
+ <xsd:element name="version" type="txd:version" />
+ <xsd:element name="msg" type="xsd:string" />
+ </xsd:all>
+ </xsd:complexType>
+
+ <xsd:simpleType name="version">
+ <xsd:restriction base="xsd:string">
+ <xsd:enumeration value="1.6"/>
+ <xsd:enumeration value="1.8"/>
+ <xsd:enumeration value="1.9"/>
+ </xsd:restriction>
+ </xsd:simpleType>
+ </xsd:schema>
+ </types>
+
+ <message name="msg_version">
+ <part name="version" type="txd:version"/>
+ </message>
+
+ <message name="msg_version_struct">
+ <part name="version_struct" type="txd:version_struct"/>
+ </message>
+
+ <portType name="echo_version_port_type">
+ <operation name="echo_version">
+ <input message="tns:msg_version"/>
+ <output message="tns:msg_version_struct"/>
+ </operation>
+
+ <operation name="echo_version_r">
+ <input message="tns:msg_version_struct"/>
+ <output message="tns:msg_version"/>
+ </operation>
+ </portType>
+
+ <binding name="echo_version_binding" type="tns:echo_version_port_type">
+ <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="rpc"/>
+ <operation name="echo_version">
+ <soap:operation soapAction="urn:example.com:simpletype-rpc"/>
+ <input>
+ <soap:body use="encoded" namespace="urn:example.com:simpletype-rpc"
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <soap:body use="encoded" namespace="urn:example.com:simpletype-rpc"
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
+
+ <operation name="echo_version_r">
+ <soap:operation soapAction="urn:example.com:simpletype-rpc"/>
+ <input>
+ <soap:body use="encoded" namespace="urn:example.com:simpletype-rpc"
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <soap:body use="encoded" namespace="urn:example.com:simpletype-rpc"
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
+ </binding>
+
+ <service name="echo_version_service">
+ <port name="echo_version_port" binding="tns:echo_version_binding">
+ <soap:address location="http://localhost:10080"/>
+ </port>
+ </service>
+</definitions>
diff --git a/test/wsdl/simpletype/rpc/test_rpc.rb b/test/wsdl/simpletype/rpc/test_rpc.rb
new file mode 100644
index 0000000000..fdd55552d0
--- /dev/null
+++ b/test/wsdl/simpletype/rpc/test_rpc.rb
@@ -0,0 +1,62 @@
+require 'test/unit'
+require 'wsdl/parser'
+require 'wsdl/soap/wsdl2ruby'
+
+
+module WSDL; module SimpleType
+
+
+class TestRPC < Test::Unit::TestCase
+ DIR = File.dirname(File.expand_path(__FILE__))
+ def pathname(filename)
+ File.join(DIR, filename)
+ end
+
+ def test_rpc
+ gen = WSDL::SOAP::WSDL2Ruby.new
+ gen.location = pathname("rpc.wsdl")
+ gen.basedir = DIR
+ gen.logger.level = Logger::FATAL
+ gen.opt['classdef'] = nil
+ gen.opt['driver'] = nil
+ gen.opt['client_skelton'] = nil
+ gen.opt['servant_skelton'] = nil
+ gen.opt['standalone_server_stub'] = nil
+ gen.opt['force'] = true
+ suppress_warning do
+ gen.run
+ end
+ compare("expectedEchoVersion.rb", "echo_version.rb")
+ compare("expectedDriver.rb", "echo_versionDriver.rb")
+ compare("expectedService.rb", "echo_version_service.rb")
+ compare("expectedClient.rb", "echo_version_serviceClient.rb")
+ compare("expectedServant.rb", "echo_versionServant.rb")
+
+ File.unlink(pathname("echo_version.rb"))
+ File.unlink(pathname("echo_versionDriver.rb"))
+ File.unlink(pathname("echo_version_service.rb"))
+ File.unlink(pathname("echo_version_serviceClient.rb"))
+ File.unlink(pathname("echo_versionServant.rb"))
+ end
+
+ def compare(expected, actual)
+ assert_equal(loadfile(expected), loadfile(actual), actual)
+ end
+
+ def loadfile(file)
+ File.open(pathname(file)) { |f| f.read }
+ end
+
+ def suppress_warning
+ back = $VERBOSE
+ $VERBOSE = nil
+ begin
+ yield
+ ensure
+ $VERBOSE = back
+ end
+ end
+end
+
+
+end; end
diff --git a/test/wsdl/simpletype/simpletype.wsdl b/test/wsdl/simpletype/simpletype.wsdl
new file mode 100644
index 0000000000..623969c794
--- /dev/null
+++ b/test/wsdl/simpletype/simpletype.wsdl
@@ -0,0 +1,95 @@
+<?xml version="1.0" encoding="utf-8"?>
+<definitions name="ping_service"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:tns="urn:example.com:simpletype"
+ targetNamespace="urn:example.com:simpletype"
+ xmlns="http://schemas.xmlsoap.org/wsdl/">
+ <types>
+ <xsd:schema targetNamespace="urn:example.com:simpletype">
+ <xsd:element name="ruby">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element minOccurs="1" maxOccurs="1" name="myversion" type="tns:myversion"/>
+ <xsd:element minOccurs="0" maxOccurs="1" name="date" type="xsd:dateTime"/>
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+
+ <xsd:simpleType name="myversion">
+ <xsd:restriction base="xsd:string">
+ <xsd:enumeration value="1.6"/>
+ <xsd:enumeration value="1.8"/>
+ <xsd:enumeration value="1.9"/>
+ </xsd:restriction>
+ </xsd:simpleType>
+
+ <xsd:element name="myid" type="tns:ID"/>
+
+ <xsd:simpleType name="ID">
+ <xsd:restriction base="xsd:string">
+ <xsd:length value="18"/>
+ <xsd:pattern value='[a-zA-Z0-9]{18}'/>
+ </xsd:restriction>
+ </xsd:simpleType>
+ </xsd:schema>
+ </types>
+
+ <message name="ping_in">
+ <part name="parameters" element="tns:ruby"/>
+ </message>
+
+ <message name="ping_out">
+ <part name="parameters" type="xsd:string"/>
+ </message>
+
+ <message name="ping_id_in">
+ <part name="parameters" element="tns:myid"/>
+ </message>
+
+ <message name="ping_id_out">
+ <part name="parameters" element="tns:myid"/>
+ </message>
+
+ <message name="versionmsg">
+ <part name="myversion" element="tns:myversion"/>
+ </message>
+
+ <portType name="ping_port_type">
+ <operation name="ping">
+ <input message="tns:ping_in"/>
+ <output message="tns:ping_out"/>
+ </operation>
+
+ <operation name="ping_id">
+ <input message="tns:ping_id_in"/>
+ <output message="tns:ping_id_out"/>
+ </operation>
+
+ <operation name="echo_version">
+ <input message="tns:versionmsg"/>
+ <output message="tns:versionmsg"/>
+ </operation>
+ </portType>
+
+ <binding name="ping_binding" type="tns:ping_port_type">
+ <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
+ <operation name="ping">
+ <soap:operation soapAction="urn:example.com:simpletype:ping" style="document"/>
+ <input><soap:body use="literal"/></input>
+ <output><soap:body use="literal"/></output>
+ </operation>
+
+ <operation name="ping_id">
+ <soap:operation soapAction="urn:example.com:simpletype:ping_id" style="document"/>
+ <input><soap:body use="literal"/></input>
+ <output><soap:body use="literal"/></output>
+ </operation>
+ </binding>
+
+ <service name="ping_service">
+ <port name="ping_port" binding="tns:ping_binding">
+ <soap:address location="http://localhost:10080"/>
+ </port>
+ </service>
+</definitions>
diff --git a/test/wsdl/simpletype/test_simpletype.rb b/test/wsdl/simpletype/test_simpletype.rb
new file mode 100644
index 0000000000..7e644c3042
--- /dev/null
+++ b/test/wsdl/simpletype/test_simpletype.rb
@@ -0,0 +1,99 @@
+require 'test/unit'
+require 'soap/rpc/standaloneServer'
+require 'soap/wsdlDriver'
+
+
+module WSDL
+module SimpleType
+
+
+class TestSimpleType < Test::Unit::TestCase
+ class Server < ::SOAP::RPC::StandaloneServer
+ def on_init
+ add_document_method(self, 'urn:example.com:simpletype:ping', 'ping',
+ XSD::QName.new('urn:example.com:simpletype', 'ruby'),
+ XSD::QName.new('http://www.w3.org/2001/XMLSchema', 'string'))
+ add_document_method(self, 'urn:example.com:simpletype:ping_id', 'ping_id',
+ XSD::QName.new('urn:example.com:simpletype', 'myid'),
+ XSD::QName.new('urn:example.com:simpletype', 'myid'))
+ end
+
+ def ping(ruby)
+ version = ruby["myversion"]
+ date = ruby["date"]
+ "#{version} (#{date})"
+ end
+
+ def ping_id(id)
+ id
+ end
+ end
+
+ DIR = File.dirname(File.expand_path(__FILE__))
+
+ Port = 17171
+
+ def setup
+ setup_server
+ setup_client
+ end
+
+ def setup_server
+ @server = Server.new('Test', "urn:example.com:simpletype", '0.0.0.0', Port)
+ @server.level = Logger::Severity::ERROR
+ @server_thread = start_server_thread(@server)
+ end
+
+ def setup_client
+ wsdl = File.join(DIR, 'simpletype.wsdl')
+ @client = ::SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver
+ @client.endpoint_url = "http://localhost:#{Port}/"
+ @client.generate_explicit_type = false
+ @client.wiredump_dev = STDOUT if $DEBUG
+ end
+
+ def teardown
+ teardown_server
+ teardown_client
+ end
+
+ def teardown_server
+ @server.shutdown
+ @server_thread.kill
+ @server_thread.join
+ end
+
+ def teardown_client
+ @client.reset_stream
+ end
+
+ def start_server_thread(server)
+ t = Thread.new {
+ Thread.current.abort_on_exception = true
+ server.start
+ }
+ t
+ end
+
+ def test_ping
+ ret = @client.ping({:myversion => "1.9", :date => "2004-01-01T00:00:00Z"})
+ assert_equal("1.9 (2004-01-01T00:00:00Z)", ret)
+ end
+
+ def test_ping_id
+ ret = @client.ping_id("012345678901234567")
+ assert_equal("012345678901234567", ret)
+ # length
+ assert_raise(XSD::ValueSpaceError) do
+ @client.ping_id("0123456789012345678")
+ end
+ # pattern
+ assert_raise(XSD::ValueSpaceError) do
+ @client.ping_id("01234567890123456;")
+ end
+ end
+end
+
+
+end
+end
diff --git a/test/wsdl/soap/soapbodyparts.wsdl b/test/wsdl/soap/soapbodyparts.wsdl
new file mode 100644
index 0000000000..0e6da0ebee
--- /dev/null
+++ b/test/wsdl/soap/soapbodyparts.wsdl
@@ -0,0 +1,103 @@
+<?xml version="1.0"?>
+<definitions
+ name="soapbodyparts"
+ targetNamespace="urn:www.example.com:soapbodyparts:v1"
+ xmlns:tns="urn:www.example.com:soapbodyparts:v1"
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
+
+ <types>
+ <schema xmlns="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="urn:www.example.com:soapbodyparts:v1">
+ <import namespace = "http://schemas.xmlsoap.org/soap/encoding/"/>
+ <complexType name="StringArray">
+ <complexContent>
+ <restriction base="soapenc:Array">
+ <attribute ref="soapenc:arrayType" wsdl:arrayType="string[]"/>
+ </restriction>
+ </complexContent>
+ </complexType>
+ </schema>
+ </types>
+
+ <message name="fooRequest">
+ <part name="param1" type="xsd:string"/>
+ <part name="param2" type="xsd:string"/>
+ <part name="param3" type="xsd:string"/>
+ </message>
+
+ <message name="fooResponse">
+ <part name="return" type="tns:StringArray"/>
+ </message>
+
+ <portType name="FooServicePortType">
+ <operation name="foo"
+ parameterOrder="param3 param2 param1">
+ <input message="tns:fooRequest"/>
+ <output message="tns:fooResponse"/>
+ </operation>
+ <operation name="bar"
+ parameterOrder="param1 param2 param3">
+ <input message="tns:fooRequest"/>
+ <output message="tns:fooResponse"/>
+ </operation>
+ <operation name="baz">
+ <input message="tns:fooRequest"/>
+ <output message="tns:fooResponse"/>
+ </operation>
+ </portType>
+
+ <binding name="FooServicePortBinding" type="tns:FooServicePortType">
+ <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <operation name="foo">
+ <soap:operation soapAction=""/>
+ <input>
+ <soap:body use="encoded"
+ parts="param1 param3"
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ namespace="urn:www.example.com:soapbodyparts:v1"/>
+ </input>
+ <output>
+ <soap:body use="encoded"
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ namespace="urn:www.example.com:soapbodyparts:v1"/>
+ </output>
+ </operation>
+ <operation name="bar">
+ <soap:operation soapAction=""/>
+ <input>
+ <soap:body use="encoded"
+ parts="param3 param2"
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ namespace="urn:www.example.com:soapbodyparts:v1"/>
+ </input>
+ <output>
+ <soap:body use="encoded"
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ namespace="urn:www.example.com:soapbodyparts:v1"/>
+ </output>
+ </operation>
+ <operation name="baz">
+ <soap:operation soapAction=""/>
+ <input>
+ <soap:body use="encoded"
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ namespace="urn:www.example.com:soapbodyparts:v1"/>
+ </input>
+ <output>
+ <soap:body use="encoded"
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ namespace="urn:www.example.com:soapbodyparts:v1"/>
+ </output>
+ </operation>
+ </binding>
+
+ <service name="FooService">
+ <port name="FooServicePort" binding="tns:FooServicePortBinding">
+ <soap:address location="http://raa.ruby-lang.org/soap/1.0.2/"/>
+ </port>
+ </service>
+</definitions>
diff --git a/test/wsdl/soap/test_soapbodyparts.rb b/test/wsdl/soap/test_soapbodyparts.rb
new file mode 100644
index 0000000000..291319aedf
--- /dev/null
+++ b/test/wsdl/soap/test_soapbodyparts.rb
@@ -0,0 +1,79 @@
+require 'test/unit'
+require 'soap/rpc/standaloneServer'
+require 'soap/wsdlDriver'
+
+
+module WSDL
+module SOAP
+
+
+class TestSOAPBodyParts < Test::Unit::TestCase
+ class Server < ::SOAP::RPC::StandaloneServer
+ def on_init
+ add_method(self, 'foo', 'p1', 'p2', 'p3')
+ add_method(self, 'bar', 'p1', 'p2', 'p3')
+ add_method(self, 'baz', 'p1', 'p2', 'p3')
+ end
+
+ def foo(p1, p2, p3)
+ [p1, p2, p3]
+ end
+
+ alias bar foo
+
+ def baz(p1, p2, p3)
+ [p3, p2, p1]
+ end
+ end
+
+ DIR = File.dirname(File.expand_path(__FILE__))
+
+ Port = 17171
+
+ def setup
+ setup_server
+ setup_client
+ end
+
+ def setup_server
+ @server = Server.new('Test', "urn:www.example.com:soapbodyparts:v1", '0.0.0.0', Port)
+ @server.level = Logger::Severity::ERROR
+ @t = Thread.new {
+ Thread.current.abort_on_exception = true
+ @server.start
+ }
+ end
+
+ def setup_client
+ wsdl = File.join(DIR, 'soapbodyparts.wsdl')
+ @client = ::SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver
+ @client.endpoint_url = "http://localhost:#{Port}/"
+ @client.wiredump_dev = STDERR if $DEBUG
+ end
+
+ def teardown
+ teardown_server
+ teardown_client
+ end
+
+ def teardown_server
+ @server.shutdown
+ @t.kill
+ @t.join
+ end
+
+ def teardown_client
+ @client.reset_stream
+ end
+
+ def test_soapbodyparts
+ assert_equal(["1", "2", "3"], @client.foo("1", "2", "3"))
+ assert_equal(["3", "2", "1"], @client.foo("3", "2", "1"))
+ assert_equal(["1", "2", "3"], @client.bar("1", "2", "3"))
+ assert_equal(["3", "2", "1"], @client.baz("1", "2", "3"))
+ end
+end
+
+
+end
+end
diff --git a/test/wsdl/test_emptycomplextype.rb b/test/wsdl/test_emptycomplextype.rb
new file mode 100644
index 0000000000..71d1b8641d
--- /dev/null
+++ b/test/wsdl/test_emptycomplextype.rb
@@ -0,0 +1,21 @@
+require 'test/unit'
+require 'wsdl/parser'
+
+
+module WSDL
+
+
+class TestWSDL < Test::Unit::TestCase
+ def setup
+ @file = File.join(File.dirname(File.expand_path(__FILE__)), 'emptycomplextype.wsdl')
+ end
+
+ def test_wsdl
+ @wsdl = WSDL::Parser.new.parse(File.open(@file) { |f| f.read })
+ assert(/\{urn:jp.gr.jin.rrr.example.emptycomplextype\}emptycomplextype/ =~ @wsdl.inspect)
+ end
+end
+
+
+
+end
diff --git a/test/wsdl/test_fault.rb b/test/wsdl/test_fault.rb
new file mode 100644
index 0000000000..ec414528ee
--- /dev/null
+++ b/test/wsdl/test_fault.rb
@@ -0,0 +1,51 @@
+require 'test/unit'
+require 'soap/processor'
+require 'soap/mapping'
+require 'soap/rpc/element'
+require 'wsdl/parser'
+
+
+module WSDL
+
+
+class TestFault < Test::Unit::TestCase
+ def setup
+ @xml =<<__EOX__
+<?xml version="1.0" encoding="utf-8" ?>
+<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <env:Body>
+ <env:Fault xmlns:n1="http://schemas.xmlsoap.org/soap/encoding/"
+ env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
+ <faultcode xsi:type="xsd:string">Server</faultcode>
+ <faultstring xsi:type="xsd:string">faultstring</faultstring>
+ <faultactor xsi:type="xsd:string">faultactor</faultactor>
+ <detail xmlns:n2="http://www.ruby-lang.org/xmlns/ruby/type/custom"
+ xsi:type="n2:SOAPException">
+ <excn_type_name xsi:type="xsd:string">type</excn_type_name>
+ <cause href="#id123"/>
+ </detail>
+ </env:Fault>
+ <cause id="id123" xsi:type="xsd:int">5</cause>
+ </env:Body>
+</env:Envelope>
+__EOX__
+ end
+
+ def test_by_wsdl
+ rpc_decode_typemap = WSDL::Definitions.soap_rpc_complextypes
+ opt = {}
+ opt[:default_encodingstyle] = ::SOAP::EncodingNamespace
+ opt[:decode_typemap] = rpc_decode_typemap
+ header, body = ::SOAP::Processor.unmarshal(@xml, opt)
+ fault = ::SOAP::Mapping.soap2obj(body.response)
+ assert_equal("Server", fault.faultcode)
+ assert_equal("faultstring", fault.faultstring)
+ assert_equal(URI.parse("faultactor"), fault.faultactor)
+ assert_equal(5, fault.detail.cause)
+ end
+end
+
+
+end
diff --git a/test/wsdl/test_multiplefault.rb b/test/wsdl/test_multiplefault.rb
new file mode 100644
index 0000000000..7004297dc9
--- /dev/null
+++ b/test/wsdl/test_multiplefault.rb
@@ -0,0 +1,39 @@
+require 'test/unit'
+require 'wsdl/parser'
+require 'wsdl/soap/classDefCreator'
+
+
+module WSDL
+
+
+class TestMultipleFault < Test::Unit::TestCase
+ def self.setup(filename)
+ @@filename = filename
+ end
+
+ def test_multiplefault
+ @wsdl = WSDL::Parser.new.parse(File.open(@@filename) { |f| f.read })
+ classdefstr = WSDL::SOAP::ClassDefCreator.new(@wsdl).dump
+ yield_eval_binding(classdefstr) do |b|
+ assert_equal(
+ WSDL::TestMultipleFault::AuthenticationError,
+ eval("AuthenticationError", b)
+ )
+ assert_equal(
+ WSDL::TestMultipleFault::AuthorizationError,
+ eval("AuthorizationError", b)
+ )
+ end
+ end
+
+ def yield_eval_binding(evaled)
+ b = binding
+ eval(evaled, b)
+ yield(b)
+ end
+end
+
+TestMultipleFault.setup(File.join(File.dirname(__FILE__), 'multiplefault.wsdl'))
+
+
+end
diff --git a/test/xmlrpc/test_datetime.rb b/test/xmlrpc/test_datetime.rb
index 0a84904f65..e38cea6f74 100644
--- a/test/xmlrpc/test_datetime.rb
+++ b/test/xmlrpc/test_datetime.rb
@@ -10,18 +10,18 @@ class Test_DateTime < Test::Unit::TestCase
end
def test_new_exception
- assert_raise(ArgumentError) { XMLRPC::DateTime.new(4.5, 13, 32, 25, 60, 60) }
- assert_raise(ArgumentError) { XMLRPC::DateTime.new(2001, 12, 32, 25, 60, 60) }
- assert_raise(ArgumentError) { XMLRPC::DateTime.new(2001, 12, 31, 25, 60, 60) }
- assert_raise(ArgumentError) { XMLRPC::DateTime.new(2001, 12, 31, 24, 60, 60) }
- assert_raise(ArgumentError) { XMLRPC::DateTime.new(2001, 12, 31, 24, 59, 60) }
+ assert_raises(ArgumentError) { XMLRPC::DateTime.new(4.5, 13, 32, 25, 60, 60) }
+ assert_raises(ArgumentError) { XMLRPC::DateTime.new(2001, 12, 32, 25, 60, 60) }
+ assert_raises(ArgumentError) { XMLRPC::DateTime.new(2001, 12, 31, 25, 60, 60) }
+ assert_raises(ArgumentError) { XMLRPC::DateTime.new(2001, 12, 31, 24, 60, 60) }
+ assert_raises(ArgumentError) { XMLRPC::DateTime.new(2001, 12, 31, 24, 59, 60) }
assert_nothing_raised(ArgumentError) { XMLRPC::DateTime.new(2001, 12, 31, 24, 59, 59) }
- assert_raise(ArgumentError) { XMLRPC::DateTime.new(2001, 0, 0, -1, -1, -1) }
- assert_raise(ArgumentError) { XMLRPC::DateTime.new(2001, 1, 0, -1, -1, -1) }
- assert_raise(ArgumentError) { XMLRPC::DateTime.new(2001, 1, 1, -1, -1, -1) }
- assert_raise(ArgumentError) { XMLRPC::DateTime.new(2001, 1, 1, 0, -1, -1) }
- assert_raise(ArgumentError) { XMLRPC::DateTime.new(2001, 1, 1, 0, 0, -1) }
+ assert_raises(ArgumentError) { XMLRPC::DateTime.new(2001, 0, 0, -1, -1, -1) }
+ assert_raises(ArgumentError) { XMLRPC::DateTime.new(2001, 1, 0, -1, -1, -1) }
+ assert_raises(ArgumentError) { XMLRPC::DateTime.new(2001, 1, 1, -1, -1, -1) }
+ assert_raises(ArgumentError) { XMLRPC::DateTime.new(2001, 1, 1, 0, -1, -1) }
+ assert_raises(ArgumentError) { XMLRPC::DateTime.new(2001, 1, 1, 0, 0, -1) }
assert_nothing_raised(ArgumentError) { XMLRPC::DateTime.new(2001, 1, 1, 0, 0, 0) }
end
@@ -67,39 +67,39 @@ class Test_DateTime < Test::Unit::TestCase
def test_set_exception
dt = createDateTime()
-
- assert_raise(ArgumentError) { dt.year = 4.5 }
+
+ assert_raises(ArgumentError) { dt.year = 4.5 }
assert_nothing_raised(ArgumentError) { dt.year = -2000 }
-
- assert_raise(ArgumentError) { dt.month = 0 }
- assert_raise(ArgumentError) { dt.month = 13 }
+
+ assert_raises(ArgumentError) { dt.month = 0 }
+ assert_raises(ArgumentError) { dt.month = 13 }
assert_nothing_raised(ArgumentError) { dt.month = 7 }
- assert_raise(ArgumentError) { dt.mon = 0 }
- assert_raise(ArgumentError) { dt.mon = 13 }
+ assert_raises(ArgumentError) { dt.mon = 0 }
+ assert_raises(ArgumentError) { dt.mon = 13 }
assert_nothing_raised(ArgumentError) { dt.mon = 7 }
- assert_raise(ArgumentError) { dt.day = 0 }
- assert_raise(ArgumentError) { dt.day = 32 }
+ assert_raises(ArgumentError) { dt.day = 0 }
+ assert_raises(ArgumentError) { dt.day = 32 }
assert_nothing_raised(ArgumentError) { dt.day = 16 }
- assert_raise(ArgumentError) { dt.hour = -1 }
- assert_raise(ArgumentError) { dt.hour = 25 }
+ assert_raises(ArgumentError) { dt.hour = -1 }
+ assert_raises(ArgumentError) { dt.hour = 25 }
assert_nothing_raised(ArgumentError) { dt.hour = 12 }
- assert_raise(ArgumentError) { dt.min = -1 }
- assert_raise(ArgumentError) { dt.min = 60 }
+ assert_raises(ArgumentError) { dt.min = -1 }
+ assert_raises(ArgumentError) { dt.min = 60 }
assert_nothing_raised(ArgumentError) { dt.min = 30 }
- assert_raise(ArgumentError) { dt.sec = -1 }
- assert_raise(ArgumentError) { dt.sec = 60 }
+ assert_raises(ArgumentError) { dt.sec = -1 }
+ assert_raises(ArgumentError) { dt.sec = 60 }
assert_nothing_raised(ArgumentError) { dt.sec = 30 }
end
def test_to_a
y, m, d, h, mi, s = 1970, 3, 24, 12, 0, 5
dt = XMLRPC::DateTime.new(y, m, d, h, mi, s)
- a = dt.to_a
+ a = dt.to_a
assert_instance_of(Array, a)
assert_equal(6, a.size, "Returned array has wrong size")
@@ -115,8 +115,8 @@ class Test_DateTime < Test::Unit::TestCase
def test_to_time1
y, m, d, h, mi, s = 1970, 3, 24, 12, 0, 5
dt = XMLRPC::DateTime.new(y, m, d, h, mi, s)
- time = dt.to_time
-
+ time = dt.to_time
+
assert_not_nil(time)
assert_equal(y, time.year)
@@ -130,15 +130,15 @@ class Test_DateTime < Test::Unit::TestCase
def test_to_time2
dt = createDateTime()
dt.year = 1969
-
+
assert_nil(dt.to_time)
end
def test_to_date1
y, m, d, h, mi, s = 1970, 3, 24, 12, 0, 5
dt = XMLRPC::DateTime.new(y, m, d, h, mi, s)
- date = dt.to_date
-
+ date = dt.to_date
+
assert_equal(y, date.year)
assert_equal(m, date.month)
assert_equal(d, date.day)
@@ -147,7 +147,7 @@ class Test_DateTime < Test::Unit::TestCase
def test_to_date2
dt = createDateTime()
dt.year = 666
-
+
assert_equal(666, dt.to_date.year)
end
diff --git a/test/xmlrpc/test_features.rb b/test/xmlrpc/test_features.rb
index 0f867068ef..96a6313202 100644
--- a/test/xmlrpc/test_features.rb
+++ b/test/xmlrpc/test_features.rb
@@ -15,7 +15,7 @@ class Test_Features < Test::Unit::TestCase
XMLRPC::Config.module_eval {remove_const(:ENABLE_NIL_CREATE)}
XMLRPC::Config.const_set(:ENABLE_NIL_CREATE, false)
- assert_raise(RuntimeError) { str = c.methodCall("test", *@params) }
+ assert_raises(RuntimeError) { str = c.methodCall("test", *@params) }
XMLRPC::Config.module_eval {remove_const(:ENABLE_NIL_CREATE)}
XMLRPC::Config.const_set(:ENABLE_NIL_CREATE, true)
@@ -29,13 +29,13 @@ class Test_Features < Test::Unit::TestCase
XMLRPC::XMLWriter.each_installed_writer do |writer|
c = XMLRPC::Create.new(writer)
- str = c.methodCall("test", *@params)
+ str = c.methodCall("test", *@params)
XMLRPC::XMLParser.each_installed_parser do |parser|
para = nil
XMLRPC::Config.module_eval {remove_const(:ENABLE_NIL_PARSER)}
XMLRPC::Config.const_set(:ENABLE_NIL_PARSER, false)
- assert_raise(RuntimeError) { para = parser.parseMethodCall(str) }
+ assert_raises(RuntimeError) { para = parser.parseMethodCall(str) }
XMLRPC::Config.module_eval {remove_const(:ENABLE_NIL_PARSER)}
XMLRPC::Config.const_set(:ENABLE_NIL_PARSER, true)
diff --git a/test/xmlrpc/test_marshal.rb b/test/xmlrpc/test_marshal.rb
index 267b43e2e2..38bc8c646f 100644
--- a/test/xmlrpc/test_marshal.rb
+++ b/test/xmlrpc/test_marshal.rb
@@ -42,7 +42,7 @@ class Test_Marshal < Test::Unit::TestCase
end
def test_parser_values
- v1 = [
+ v1 = [
1, -7778, # integers
1.0, 0.0, -333.0, 2343434343.0, # floats
false, true, true, false, # booleans
@@ -72,9 +72,9 @@ class Test_Marshal < Test::Unit::TestCase
assert_equal( v3_exp, m.load_response(m.dump_response(v3)) )
pers = m.load_response(m.dump_response(person))
-
+
assert( pers.is_a?(Person) )
- assert( person.name == pers.name )
+ assert( person.name == pers.name )
end
# missing, Date, Time, DateTime
diff --git a/test/xmlrpc/test_parser.rb b/test/xmlrpc/test_parser.rb
index 1c50eaed46..44ca1f88b7 100644
--- a/test/xmlrpc/test_parser.rb
+++ b/test/xmlrpc/test_parser.rb
@@ -7,16 +7,16 @@ module GenericParserTest
def datafile(base)
File.join(File.dirname(__FILE__), "data", base)
end
-
+
def load_data(name)
[File.read(datafile(name) + ".xml"), YAML.load(File.read(datafile(name) + ".expected"))]
end
def setup
@xml1, @expected1 = load_data('xml1')
- @xml2, @expected2 = load_data('bug_covert')
- @xml3, @expected3 = load_data('bug_bool')
- @xml4, @expected4 = load_data('value')
+ @xml2, @expected2 = load_data('bug_covert')
+ @xml3, @expected3 = load_data('bug_bool')
+ @xml4, @expected4 = load_data('value')
@cdata_xml, @cdata_expected = load_data('bug_cdata')
@@ -27,7 +27,7 @@ module GenericParserTest
end
# test parseMethodResponse --------------------------------------------------
-
+
def test_parseMethodResponse1
assert_equal(@expected1, @p.parseMethodResponse(@xml1))
end
@@ -67,7 +67,7 @@ module GenericParserTest
end
end
-# create test class for each installed parser
+# create test class for each installed parser
XMLRPC::XMLParser.each_installed_parser do |parser|
klass = parser.class
name = klass.to_s.split("::").last
diff --git a/test/xmlrpc/test_webrick_server.rb b/test/xmlrpc/test_webrick_server.rb
index 47fa5487c3..4cd63cfa74 100644
--- a/test/xmlrpc/test_webrick_server.rb
+++ b/test/xmlrpc/test_webrick_server.rb
@@ -18,9 +18,9 @@ class Test_Webrick < Test::Unit::TestCase
if b == 0
raise XMLRPC::FaultException.new(1, "division by zero")
else
- a / b
+ a / b
end
- end
+ end
s.set_default_handler do |name, *args|
raise XMLRPC::FaultException.new(-99, "Method #{name} missing" +
@@ -34,13 +34,13 @@ class Test_Webrick < Test::Unit::TestCase
def setup_http_server(port, use_ssl)
option = {
- :Port => port,
+ :Port => port,
:SSLEnable => use_ssl,
}
if use_ssl
require 'webrick/https'
option.update(
- :SSLVerifyClient => ::OpenSSL::SSL::VERIFY_NONE,
+ :SSLVerifyClient => ::OpenSSL::SSL::VERIFY_NONE,
:SSLCertName => []
)
end
@@ -68,7 +68,7 @@ class Test_Webrick < Test::Unit::TestCase
assert_equal 9, @s.call('test.add', 4, 5)
# fault exception
- assert_raise(XMLRPC::FaultException) { @s.call('test.div', 1, 0) }
+ assert_raises(XMLRPC::FaultException) { @s.call('test.div', 1, 0) }
# fault exception via call2
ok, param = @s.call2('test.div', 1, 0)
diff --git a/test/xmlrpc/webrick_testing.rb b/test/xmlrpc/webrick_testing.rb
index 05c334045e..a6830cece1 100644
--- a/test/xmlrpc/webrick_testing.rb
+++ b/test/xmlrpc/webrick_testing.rb
@@ -5,34 +5,33 @@ module WEBrick_Testing
def initialize() super(self) end
def <<(*args) end
end
-
+
def start_server(config={})
raise "already started" if @__server
@__started = false
- @__server_thread = Thread.new {
+ Thread.new {
@__server = WEBrick::HTTPServer.new(
- {
+ {
:Logger => DummyLog.new,
:AccessLog => [],
:StartCallback => proc { @__started = true }
}.update(config))
- yield @__server
+ yield @__server
@__server.start
@__started = false
}
Timeout.timeout(5) {
- Thread.pass until @__started # wait until the server is ready
+ nil until @__started # wait until the server is ready
}
end
def stop_server
Timeout.timeout(5) {
@__server.shutdown
- Thread.pass while @__started # wait until the server is down
+ nil while @__started # wait until the server is down
}
- @__server_thread.join
@__server = nil
end
end
diff --git a/test/xsd/codegen/test_classdef.rb b/test/xsd/codegen/test_classdef.rb
new file mode 100644
index 0000000000..64c4771918
--- /dev/null
+++ b/test/xsd/codegen/test_classdef.rb
@@ -0,0 +1,214 @@
+require 'test/unit'
+require 'xsd/codegen/classdef'
+
+
+module XSD; module CodeGen
+
+
+class TestClassDefCreator < Test::Unit::TestCase
+ include XSD::CodeGen
+ include GenSupport
+
+ def test_classdef_simple
+ c = ClassDef.new("Foo")
+ assert_equal(format(<<-EOD), c.dump)
+ class Foo
+ end
+ EOD
+ end
+
+ def test_classdef_complex
+ c = ClassDef.new("Foo::Bar::Baz", String)
+ assert_equal(format(<<-EOD), c.dump)
+ module Foo; module Bar
+
+ class Baz < String
+ end
+
+ end; end
+ EOD
+ end
+
+ def test_require
+ c = ClassDef.new("Foo")
+ c.def_require("foo/bar")
+ assert_equal(format(<<-EOD), c.dump)
+ require 'foo/bar'
+
+ class Foo
+ end
+ EOD
+ end
+
+ def test_comment
+ c = ClassDef.new("Foo")
+ c.def_require("foo/bar")
+ c.comment = <<-EOD
+ foo
+ EOD
+ assert_equal(format(<<-EOD), c.dump)
+ require 'foo/bar'
+
+ # foo
+ class Foo
+ end
+ EOD
+ c.comment = <<-EOD
+ foo
+
+ bar
+ baz
+
+ EOD
+ assert_equal(format(<<-EOD), c.dump)
+ require 'foo/bar'
+
+ # foo
+ #
+ # bar
+ # baz
+ #
+ class Foo
+ end
+ EOD
+ end
+
+ def test_emptymethod
+ c = ClassDef.new("Foo")
+ c.def_method('foo') do
+ end
+ c.def_method('bar') do
+ ''
+ end
+ assert_equal(format(<<-EOD), c.dump)
+ class Foo
+ def foo
+ end
+
+ def bar
+ end
+ end
+ EOD
+ end
+
+ def test_full
+ c = ClassDef.new("Foo::Bar::HobbitName", String)
+ c.def_require("foo/bar")
+ c.comment = <<-EOD
+ foo
+ bar
+ baz
+ EOD
+ c.def_const("FOO", 1)
+ c.def_classvar("@@foo", "var".dump)
+ c.def_classvar("baz", "1".dump)
+ c.def_attr("Foo", true, "foo")
+ c.def_attr("bar")
+ c.def_attr("baz", true)
+ c.def_attr("Foo2", true, "foo2")
+ c.def_attr("foo3", false, "foo3")
+ c.def_method("foo") do
+ <<-EOD
+ foo.bar = 1
+\tbaz.each do |ele|
+\t ele
+ end
+ EOD
+ end
+ c.def_method("baz", "qux") do
+ <<-EOD
+ [1, 2, 3].each do |i|
+ p i
+ end
+ EOD
+ end
+
+ m = MethodDef.new("qux", "quxx", "quxxx") do
+ <<-EOD
+ p quxx + quxxx
+ EOD
+ end
+ m.comment = "hello world\n123"
+ c.add_method(m)
+ c.def_code <<-EOD
+ Foo.new
+ Bar.z
+ EOD
+ c.def_code <<-EOD
+ Foo.new
+ Bar.z
+ EOD
+ c.def_privatemethod("foo", "baz", "*arg", "&block")
+
+ assert_equal(format(<<-EOD), c.dump)
+ require 'foo/bar'
+
+ module Foo; module Bar
+
+ # foo
+ # bar
+ # baz
+ class HobbitName < String
+ @@foo = "var"
+ @@baz = "1"
+
+ FOO = 1
+
+ Foo.new
+ Bar.z
+
+ Foo.new
+ Bar.z
+
+ attr_accessor :bar
+ attr_accessor :baz
+ attr_reader :foo3
+
+ def Foo
+ @foo
+ end
+
+ def Foo=(value)
+ @foo = value
+ end
+
+ def Foo2
+ @foo2
+ end
+
+ def Foo2=(value)
+ @foo2 = value
+ end
+
+ def foo
+ foo.bar = 1
+ baz.each do |ele|
+ ele
+ end
+ end
+
+ def baz(qux)
+ [1, 2, 3].each do |i|
+ p i
+ end
+ end
+
+ # hello world
+ # 123
+ def qux(quxx, quxxx)
+ p quxx + quxxx
+ end
+
+ private
+
+ def foo(baz, *arg, &block)
+ end
+ end
+
+ end; end
+ EOD
+ end
+end
+
+
+end; end
diff --git a/test/xsd/noencoding.xml b/test/xsd/noencoding.xml
new file mode 100644
index 0000000000..614ffa34ad
--- /dev/null
+++ b/test/xsd/noencoding.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="euc-jp"?>
+<schema xmlns="http://www.w3.org/2001/XMLSchema">
+ <!-- -->
+</schema>
diff --git a/test/xsd/test_noencoding.rb b/test/xsd/test_noencoding.rb
new file mode 100644
index 0000000000..48119ec1f7
--- /dev/null
+++ b/test/xsd/test_noencoding.rb
@@ -0,0 +1,32 @@
+require 'test/unit'
+require 'wsdl/xmlSchema/parser'
+
+
+module XSD
+
+
+class TestEmptyCharset < Test::Unit::TestCase
+ def setup
+ @file = File.join(File.dirname(File.expand_path(__FILE__)), 'noencoding.xml')
+ end
+
+ def test_wsdl
+ begin
+ xml = WSDL::XMLSchema::Parser.new.parse(File.open(@file) { |f| f.read })
+ rescue RuntimeError
+ if XSD::XMLParser.const_defined?("REXMLParser")
+ STDERR.puts("rexml cannot handle euc-jp without iconv/uconv.")
+ return
+ end
+ raise
+ rescue Errno::EINVAL
+ # unsupported encoding
+ return
+ end
+ assert_equal(WSDL::XMLSchema::Schema, xml.class)
+ assert_equal(0, xml.collect_elements.size)
+ end
+end
+
+
+end
diff --git a/test/xsd/test_xmlschemaparser.rb b/test/xsd/test_xmlschemaparser.rb
new file mode 100644
index 0000000000..10dff43e61
--- /dev/null
+++ b/test/xsd/test_xmlschemaparser.rb
@@ -0,0 +1,22 @@
+require 'test/unit'
+require 'wsdl/xmlSchema/parser'
+
+
+module XSD
+
+
+class TestXMLSchemaParser < Test::Unit::TestCase
+ def setup
+ @file = File.join(File.dirname(File.expand_path(__FILE__)), 'xmlschema.xml')
+ end
+
+ def test_wsdl
+ @wsdl = WSDL::XMLSchema::Parser.new.parse(File.open(@file) { |f| f.read })
+ assert_equal(WSDL::XMLSchema::Schema, @wsdl.class)
+ assert_equal(1, @wsdl.collect_elements.size)
+ end
+end
+
+
+
+end
diff --git a/test/xsd/test_xsd.rb b/test/xsd/test_xsd.rb
new file mode 100644
index 0000000000..6302f3128b
--- /dev/null
+++ b/test/xsd/test_xsd.rb
@@ -0,0 +1,1511 @@
+require 'test/unit'
+require 'xsd/datatypes'
+
+
+module XSD
+
+
+class TestXSD < Test::Unit::TestCase
+ NegativeZero = (-1.0 / (1.0 / 0.0))
+
+ def setup
+ end
+
+ def teardown
+ end
+
+ def assert_parsed_result(klass, str)
+ o = klass.new(str)
+ assert_equal(str, o.to_s)
+ end
+
+ def test_NSDBase
+ o = XSD::NSDBase.new
+ assert_equal(nil, o.type)
+ end
+
+ def test_XSDBase
+ o = XSD::XSDAnySimpleType.new
+ assert_equal(nil, o.data)
+ assert_equal(true, o.is_nil)
+ assert_equal('', o.to_s)
+ end
+
+ def test_XSDNil
+ o = XSD::XSDNil.new
+ assert_equal(XSD::Namespace, o.type.namespace)
+ assert_equal(XSD::NilLiteral, o.type.name)
+ assert_equal(nil, o.data)
+ assert_equal(true, o.is_nil)
+
+ o = XSD::XSDNil.new(nil)
+ assert_equal(true, o.is_nil)
+ assert_equal(nil, o.data)
+ assert_equal("", o.to_s)
+ o = XSD::XSDNil.new('var')
+ assert_equal(false, o.is_nil)
+ assert_equal('var', o.data)
+ assert_equal('var', o.to_s)
+ end
+
+ def test_XSDString_UTF8
+ o = XSD::XSDString.new
+ assert_equal(XSD::Namespace, o.type.namespace)
+ assert_equal(XSD::StringLiteral, o.type.name)
+ assert_equal(nil, o.data)
+ assert_equal(true, o.is_nil)
+
+ str = "abc"
+ assert_equal(str, XSD::XSDString.new(str).data)
+ assert_equal(str, XSD::XSDString.new(str).to_s)
+ assert_raises(XSD::ValueSpaceError) do
+ XSD::XSDString.new("\0")
+ end
+ assert_raises(XSD::ValueSpaceError) do
+ p XSD::XSDString.new("\xC0\xC0").to_s
+ end
+ end
+
+ def test_XSDString_NONE
+ XSD::Charset.module_eval { @encoding_backup = @encoding; @encoding = "NONE" }
+ begin
+ o = XSD::XSDString.new
+ assert_equal(XSD::Namespace, o.type.namespace)
+ assert_equal(XSD::StringLiteral, o.type.name)
+ assert_equal(nil, o.data)
+ assert_equal(true, o.is_nil)
+
+ str = "abc"
+ assert_equal(str, XSD::XSDString.new(str).data)
+ assert_equal(str, XSD::XSDString.new(str).to_s)
+ assert_raises(XSD::ValueSpaceError) do
+ XSD::XSDString.new("\0")
+ end
+ assert_raises(XSD::ValueSpaceError) do
+ p XSD::XSDString.new("\xC0\xC0").to_s
+ end
+ ensure
+ XSD::Charset.module_eval { @encoding = @encoding_backup }
+ end
+ end
+
+ def test_XSDBoolean
+ o = XSD::XSDBoolean.new
+ assert_equal(XSD::Namespace, o.type.namespace)
+ assert_equal(XSD::BooleanLiteral, o.type.name)
+ assert_equal(nil, o.data)
+ assert_equal(true, o.is_nil)
+
+ targets = [
+ ["true", true],
+ ["1", true],
+ ["false", false],
+ ["0", false],
+ ]
+ targets.each do |data, expected|
+ assert_equal(expected, XSD::XSDBoolean.new(data).data)
+ assert_equal(expected.to_s, XSD::XSDBoolean.new(data).to_s)
+ end
+
+ assert_raises(XSD::ValueSpaceError) do
+ XSD::XSDBoolean.new("nil").to_s
+ end
+ end
+
+ def test_XSDDecimal
+ o = XSD::XSDDecimal.new
+ assert_equal(XSD::Namespace, o.type.namespace)
+ assert_equal(XSD::DecimalLiteral, o.type.name)
+ assert_equal(nil, o.data)
+ assert_equal(true, o.is_nil)
+
+ targets = [
+ 0,
+ 1000000000,
+ -9999999999,
+ 12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890,
+ 12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890,
+ -1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789,
+ ]
+ targets.each do |dec|
+ assert_equal(dec.to_s, XSD::XSDDecimal.new(dec).data)
+ end
+
+ targets = [
+ "0",
+ "0.00000001",
+ "1000000000",
+ "12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890",
+ "-12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123.45678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789",
+ ]
+ targets.each do |str|
+ assert_equal(str, XSD::XSDDecimal.new(str).to_s)
+ end
+
+ targets = [
+ ["-0", "0"],
+ ["+0", "0"],
+ ["0.0", "0"],
+ ["-0.0", "0"],
+ ["+0.0", "0"],
+ ["0.", "0"],
+ [".0", "0"],
+ [
+ "+0.12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890",
+ "0.1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789"
+ ],
+ [
+ ".0000012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890",
+ "0.000001234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789"
+ ],
+ [
+ "-12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890.",
+ "-12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890"
+ ],
+ ]
+ targets.each do |data, expected|
+ assert_equal(expected, XSD::XSDDecimal.new(data).to_s)
+ end
+
+ targets = [
+ "0.000000000000a",
+ "00a.0000000000001",
+ "+-5",
+ ]
+ targets.each do |d|
+ assert_raises(XSD::ValueSpaceError) do
+ XSD::XSDDecimal.new(d)
+ end
+ end
+ end
+
+ def test_XSDFloat
+ o = XSD::XSDFloat.new
+ assert_equal(XSD::Namespace, o.type.namespace)
+ assert_equal(XSD::FloatLiteral, o.type.name)
+ assert_equal(nil, o.data)
+ assert_equal(true, o.is_nil)
+
+ targets = [
+ 3.14159265358979,
+ 12.34e36,
+ 1.402e-45,
+ -1.402e-45,
+ ]
+ targets.each do |f|
+ assert_equal(f, XSD::XSDFloat.new(f).data)
+ end
+
+ targets = [
+ "+3.141592654",
+ "+1.234e+37",
+ "+1.402e-45",
+ "-1.402e-45",
+ ]
+ targets.each do |f|
+ assert_equal(f, XSD::XSDFloat.new(f).to_s)
+ end
+
+ targets = [
+ [3, "+3"], # should be 3.0?
+ [-2, "-2"], # ditto
+ [3.14159265358979, "+3.141592654"],
+ [12.34e36, "+1.234e+37"],
+ [1.402e-45, "+1.402e-45"],
+ [-1.402e-45, "-1.402e-45"],
+ ["1.402e", "+1.402"],
+ ["12.34E36", "+1.234e+37"],
+ ["1.402E-45", "+1.402e-45"],
+ ["-1.402E-45", "-1.402e-45"],
+ ["1.402E", "+1.402"],
+ ]
+ targets.each do |f, str|
+ assert_equal(str, XSD::XSDFloat.new(f).to_s)
+ end
+
+ assert_equal("+0", XSD::XSDFloat.new(+0.0).to_s)
+ assert_equal("-0", XSD::XSDFloat.new(NegativeZero).to_s)
+ assert(XSD::XSDFloat.new(0.0/0.0).data.nan?)
+ assert_equal("INF", XSD::XSDFloat.new(1.0/0.0).to_s)
+ assert_equal(1, XSD::XSDFloat.new(1.0/0.0).data.infinite?)
+ assert_equal("-INF", XSD::XSDFloat.new(-1.0/0.0).to_s)
+ assert_equal(-1, XSD::XSDFloat.new(-1.0/0.0).data.infinite?)
+
+ targets = [
+ "0.000000000000a",
+ "00a.0000000000001",
+ "+-5",
+ "5_0",
+ ]
+ targets.each do |d|
+ assert_raises(XSD::ValueSpaceError) do
+ XSD::XSDFloat.new(d)
+ end
+ end
+ end
+
+ def test_XSDDouble
+ o = XSD::XSDDouble.new
+ assert_equal(XSD::Namespace, o.type.namespace)
+ assert_equal(XSD::DoubleLiteral, o.type.name)
+ assert_equal(nil, o.data)
+ assert_equal(true, o.is_nil)
+
+ targets = [
+ 3.14159265358979,
+ 12.34e36,
+ 1.402e-45,
+ -1.402e-45,
+ ]
+ targets.each do |f|
+ assert_equal(f, XSD::XSDDouble.new(f).data)
+ end
+
+ targets = [
+ "+3.14159265358979",
+ "+1.234e+37",
+ "+1.402e-45",
+ "-1.402e-45",
+ ]
+ targets.each do |f|
+ assert_equal(f, XSD::XSDDouble.new(f).to_s)
+ end
+
+ targets = [
+ [3, "+3"], # should be 3.0?
+ [-2, "-2"], # ditto.
+ [3.14159265358979, "+3.14159265358979"],
+ [12.34e36, "+1.234e+37"],
+ [1.402e-45, "+1.402e-45"],
+ [-1.402e-45, "-1.402e-45"],
+ ["1.402e", "+1.402"],
+ ["12.34E36", "+1.234e+37"],
+ ["1.402E-45", "+1.402e-45"],
+ ["-1.402E-45", "-1.402e-45"],
+ ["1.402E", "+1.402"],
+ ]
+ targets.each do |f, str|
+ assert_equal(str, XSD::XSDDouble.new(f).to_s)
+ end
+
+ assert_equal("+0", XSD::XSDFloat.new(+0.0).to_s)
+ assert_equal("-0", XSD::XSDFloat.new(NegativeZero).to_s)
+ assert_equal("NaN", XSD::XSDDouble.new(0.0/0.0).to_s)
+ assert(XSD::XSDDouble.new(0.0/0.0).data.nan?)
+ assert_equal("INF", XSD::XSDDouble.new(1.0/0.0).to_s)
+ assert_equal(1, XSD::XSDDouble.new(1.0/0.0).data.infinite?)
+ assert_equal("-INF", XSD::XSDDouble.new(-1.0/0.0).to_s)
+ assert_equal(-1, XSD::XSDDouble.new(-1.0/0.0).data.infinite?)
+
+ targets = [
+ "0.000000000000a",
+ "00a.0000000000001",
+ "+-5",
+ ]
+ targets.each do |d|
+ assert_raises(XSD::ValueSpaceError) do
+ XSD::XSDDouble.new(d)
+ end
+ end
+ end
+
+ def test_XSDDuration
+ o = XSD::XSDDuration.new
+ assert_equal(XSD::Namespace, o.type.namespace)
+ assert_equal(XSD::DurationLiteral, o.type.name)
+ assert_equal(nil, o.data)
+ assert_equal(true, o.is_nil)
+
+ targets = [
+ "P1Y2M3DT4H5M6S",
+ "P1234Y5678M9012DT3456H7890M1234.5678S",
+ "P0DT3456H7890M1234.5678S",
+ "P1234Y5678M9012D",
+ "-P1234Y5678M9012DT3456H7890M1234.5678S",
+ "P5678M9012DT3456H7890M1234.5678S",
+ "-P1234Y9012DT3456H7890M1234.5678S",
+ "+P1234Y5678MT3456H7890M1234.5678S",
+ "P1234Y5678M9012DT7890M1234.5678S",
+ "-P1234Y5678M9012DT3456H1234.5678S",
+ "+P1234Y5678M9012DT3456H7890M",
+ "P123400000000000Y",
+ "-P567800000000000M",
+ "+P901200000000000D",
+ "P0DT345600000000000H",
+ "-P0DT789000000000000M",
+ "+P0DT123400000000000.000000000005678S",
+ "P1234YT1234.5678S",
+ "-P5678MT7890M",
+ "+P9012DT3456H",
+ ]
+ targets.each do |str|
+ assert_parsed_result(XSD::XSDDuration, str)
+ end
+
+ targets = [
+ ["P0Y0M0DT0H0M0S",
+ "P0D"],
+ ["-P0DT0S",
+ "-P0D"],
+ ["P01234Y5678M9012DT3456H7890M1234.5678S",
+ "P1234Y5678M9012DT3456H7890M1234.5678S"],
+ ["P1234Y005678M9012DT3456H7890M1234.5678S",
+ "P1234Y5678M9012DT3456H7890M1234.5678S"],
+ ["P1234Y5678M0009012DT3456H7890M1234.5678S",
+ "P1234Y5678M9012DT3456H7890M1234.5678S"],
+ ["P1234Y5678M9012DT00003456H7890M1234.5678S",
+ "P1234Y5678M9012DT3456H7890M1234.5678S"],
+ ["P1234Y5678M9012DT3456H000007890M1234.5678S",
+ "P1234Y5678M9012DT3456H7890M1234.5678S"],
+ ["P1234Y5678M9012DT3456H7890M0000001234.5678S",
+ "P1234Y5678M9012DT3456H7890M1234.5678S"],
+ ]
+ targets.each do |data, expected|
+ assert_equal(expected, XSD::XSDDuration.new(data).to_s)
+ end
+ end
+
+ def test_XSDDateTime
+ o = XSD::XSDDateTime.new
+ assert_equal(XSD::Namespace, o.type.namespace)
+ assert_equal(XSD::DateTimeLiteral, o.type.name)
+ assert_equal(nil, o.data)
+ assert_equal(true, o.is_nil)
+
+ targets = [
+ "2002-05-18T16:52:20Z",
+ "0001-01-01T00:00:00Z",
+ "9999-12-31T23:59:59Z",
+ "19999-12-31T23:59:59Z",
+ "2002-12-31T23:59:59.999Z",
+ "2002-12-31T23:59:59.001Z",
+ "2002-12-31T23:59:59.99999999999999999999Z",
+ "2002-12-31T23:59:59.00000000000000000001Z",
+ "2002-12-31T23:59:59+09:00",
+ "2002-12-31T23:59:59+00:01",
+ "2002-12-31T23:59:59-00:01",
+ "2002-12-31T23:59:59-23:59",
+ "2002-12-31T23:59:59.00000000000000000001+13:30",
+ "2002-12-31T23:59:59.5137Z",
+ "2002-12-31T23:59:59.51375Z", # 411/800
+ "2002-12-31T23:59:59.51375+12:34",
+ "-2002-05-18T16:52:20Z",
+ "-4713-01-01T12:00:00Z",
+ "-2002-12-31T23:59:59+00:01",
+ "-0001-12-31T23:59:59.00000000000000000001+13:30",
+ ]
+ targets.each do |str|
+ assert_parsed_result(XSD::XSDDateTime, str)
+ end
+
+ targets = [
+ ["2002-12-31T23:59:59.00",
+ "2002-12-31T23:59:59Z"],
+ ["2002-12-31T23:59:59+00:00",
+ "2002-12-31T23:59:59Z"],
+ ["2002-12-31T23:59:59-00:00",
+ "2002-12-31T23:59:59Z"],
+ ["-2002-12-31T23:59:59.00",
+ "-2002-12-31T23:59:59Z"],
+ ["-2002-12-31T23:59:59+00:00",
+ "-2002-12-31T23:59:59Z"],
+ ["-2002-12-31T23:59:59-00:00",
+ "-2002-12-31T23:59:59Z"],
+ ]
+ targets.each do |data, expected|
+ assert_equal(expected, XSD::XSDDateTime.new(data).to_s)
+ d = DateTime.parse(data)
+ d >>= 12 if d.year < 0 # XSDDateTime.year(-1) == DateTime.year(0)
+ assert_equal(expected, XSD::XSDDateTime.new(d).to_s)
+ end
+
+ targets = [
+ "0000-05-18T16:52:20Z",
+ "05-18T16:52:20Z",
+ "2002-05T16:52:20Z",
+ "2002-05-18T16:52Z",
+ "",
+ ]
+ targets.each do |d|
+ assert_raises(XSD::ValueSpaceError, d.to_s) do
+ XSD::XSDDateTime.new(d)
+ end
+ end
+ end
+
+ def test_XSDTime
+ o = XSD::XSDTime.new
+ assert_equal(XSD::Namespace, o.type.namespace)
+ assert_equal(XSD::TimeLiteral, o.type.name)
+ assert_equal(nil, o.data)
+ assert_equal(true, o.is_nil)
+
+ targets = [
+ "16:52:20Z",
+ "00:00:00Z",
+ "23:59:59Z",
+ "23:59:59.999Z",
+ "23:59:59.001Z",
+ "23:59:59.99999999999999999999Z",
+ "23:59:59.00000000000000000001Z",
+ "23:59:59+09:00",
+ "23:59:59+00:01",
+ "23:59:59-00:01",
+ "23:59:59-23:59",
+ "23:59:59.00000000000000000001+13:30",
+ "23:59:59.51345Z",
+ "23:59:59.51345+12:34",
+ "23:59:59+00:01",
+ ]
+ targets.each do |str|
+ assert_parsed_result(XSD::XSDTime, str)
+ end
+
+ targets = [
+ ["23:59:59.00",
+ "23:59:59Z"],
+ ["23:59:59+00:00",
+ "23:59:59Z"],
+ ["23:59:59-00:00",
+ "23:59:59Z"],
+ ]
+ targets.each do |data, expected|
+ assert_equal(expected, XSD::XSDTime.new(data).to_s)
+ end
+ end
+
+ def test_XSDDate
+ o = XSD::XSDDate.new
+ assert_equal(XSD::Namespace, o.type.namespace)
+ assert_equal(XSD::DateLiteral, o.type.name)
+ assert_equal(nil, o.data)
+ assert_equal(true, o.is_nil)
+
+ targets = [
+ "2002-05-18Z",
+ "0001-01-01Z",
+ "9999-12-31Z",
+ "19999-12-31Z",
+ "2002-12-31+09:00",
+ "2002-12-31+00:01",
+ "2002-12-31-00:01",
+ "2002-12-31-23:59",
+ "2002-12-31+13:30",
+ "-2002-05-18Z",
+ "-19999-12-31Z",
+ "-2002-12-31+00:01",
+ "-0001-12-31+13:30",
+ ]
+ targets.each do |str|
+ assert_parsed_result(XSD::XSDDate, str)
+ end
+
+ targets = [
+ ["2002-12-31",
+ "2002-12-31Z"],
+ ["2002-12-31+00:00",
+ "2002-12-31Z"],
+ ["2002-12-31-00:00",
+ "2002-12-31Z"],
+ ["-2002-12-31",
+ "-2002-12-31Z"],
+ ["-2002-12-31+00:00",
+ "-2002-12-31Z"],
+ ["-2002-12-31-00:00",
+ "-2002-12-31Z"],
+ ]
+ targets.each do |data, expected|
+ assert_equal(expected, XSD::XSDDate.new(data).to_s)
+ d = Date.parse(data)
+ d >>= 12 if d.year < 0 # XSDDate.year(-1) == Date.year(0)
+ assert_equal(expected, XSD::XSDDate.new(d).to_s)
+ end
+ end
+end
+
+class TestXSD2 < Test::Unit::TestCase
+ def setup
+ # Nothing to do.
+ end
+
+ def teardown
+ # Nothing to do.
+ end
+
+ def assert_parsed_result(klass, str)
+ o = klass.new(str)
+ assert_equal(str, o.to_s)
+ end
+
+ def test_XSDGYearMonth
+ o = XSD::XSDGYearMonth.new
+ assert_equal(XSD::Namespace, o.type.namespace)
+ assert_equal(XSD::GYearMonthLiteral, o.type.name)
+ assert_equal(nil, o.data)
+ assert_equal(true, o.is_nil)
+
+ targets = [
+ "2002-05Z",
+ "0001-01Z",
+ "9999-12Z",
+ "19999-12Z",
+ "2002-12+09:00",
+ "2002-12+00:01",
+ "2002-12-00:01",
+ "2002-12-23:59",
+ "2002-12+13:30",
+ "-2002-05Z",
+ "-19999-12Z",
+ "-2002-12+00:01",
+ "-0001-12+13:30",
+ ]
+ targets.each do |str|
+ assert_parsed_result(XSD::XSDGYearMonth, str)
+ end
+
+ targets = [
+ ["2002-12",
+ "2002-12Z"],
+ ["2002-12+00:00",
+ "2002-12Z"],
+ ["2002-12-00:00",
+ "2002-12Z"],
+ ["-2002-12",
+ "-2002-12Z"],
+ ["-2002-12+00:00",
+ "-2002-12Z"],
+ ["-2002-12-00:00",
+ "-2002-12Z"],
+ ]
+ targets.each do |data, expected|
+ assert_equal(expected, XSD::XSDGYearMonth.new(data).to_s)
+ end
+ end
+
+ def test_XSDGYear
+ o = XSD::XSDGYear.new
+ assert_equal(XSD::Namespace, o.type.namespace)
+ assert_equal(XSD::GYearLiteral, o.type.name)
+ assert_equal(nil, o.data)
+ assert_equal(true, o.is_nil)
+
+ targets = [
+ "2002Z",
+ "0001Z",
+ "9999Z",
+ "19999Z",
+ "2002+09:00",
+ "2002+00:01",
+ "2002-00:01",
+ "2002-23:59",
+ "2002+13:30",
+ "-2002Z",
+ "-19999Z",
+ "-2002+00:01",
+ "-0001+13:30",
+ ]
+ targets.each do |str|
+ assert_parsed_result(XSD::XSDGYear, str)
+ end
+
+ targets = [
+ ["2002",
+ "2002Z"],
+ ["2002+00:00",
+ "2002Z"],
+ ["2002-00:00",
+ "2002Z"],
+ ["-2002",
+ "-2002Z"],
+ ["-2002+00:00",
+ "-2002Z"],
+ ["-2002-00:00",
+ "-2002Z"],
+ ]
+ targets.each do |data, expected|
+ assert_equal(expected, XSD::XSDGYear.new(data).to_s)
+ end
+ end
+
+ def test_XSDGMonthDay
+ o = XSD::XSDGMonthDay.new
+ assert_equal(XSD::Namespace, o.type.namespace)
+ assert_equal(XSD::GMonthDayLiteral, o.type.name)
+ assert_equal(nil, o.data)
+ assert_equal(true, o.is_nil)
+
+ targets = [
+ "05-18Z",
+ "01-01Z",
+ "12-31Z",
+ "12-31+09:00",
+ "12-31+00:01",
+ "12-31-00:01",
+ "12-31-23:59",
+ "12-31+13:30",
+ ]
+ targets.each do |str|
+ assert_parsed_result(XSD::XSDGMonthDay, str)
+ end
+
+ targets = [
+ ["12-31",
+ "12-31Z"],
+ ["12-31+00:00",
+ "12-31Z"],
+ ["12-31-00:00",
+ "12-31Z"],
+ ]
+ targets.each do |data, expected|
+ assert_equal(expected, XSD::XSDGMonthDay.new(data).to_s)
+ end
+ end
+
+ def test_XSDGDay
+ o = XSD::XSDGDay.new
+ assert_equal(XSD::Namespace, o.type.namespace)
+ assert_equal(XSD::GDayLiteral, o.type.name)
+ assert_equal(nil, o.data)
+ assert_equal(true, o.is_nil)
+
+ targets = [
+ "18Z",
+ "01Z",
+ "31Z",
+ "31+09:00",
+ "31+00:01",
+ "31-00:01",
+ "31-23:59",
+ "31+13:30",
+ ]
+ targets.each do |str|
+ assert_parsed_result(XSD::XSDGDay, str)
+ end
+
+ targets = [
+ ["31",
+ "31Z"],
+ ["31+00:00",
+ "31Z"],
+ ["31-00:00",
+ "31Z"],
+ ]
+ targets.each do |data, expected|
+ assert_equal(expected, XSD::XSDGDay.new(data).to_s)
+ end
+ end
+
+ def test_XSDGMonth
+ o = XSD::XSDGMonth.new
+ assert_equal(XSD::Namespace, o.type.namespace)
+ assert_equal(XSD::GMonthLiteral, o.type.name)
+ assert_equal(nil, o.data)
+ assert_equal(true, o.is_nil)
+
+ targets = [
+ "05Z",
+ "01Z",
+ "12Z",
+ "12+09:00",
+ "12+00:01",
+ "12-00:01",
+ "12-23:59",
+ "12+13:30",
+ ]
+ targets.each do |str|
+ assert_parsed_result(XSD::XSDGMonth, str)
+ end
+
+ targets = [
+ ["12",
+ "12Z"],
+ ["12+00:00",
+ "12Z"],
+ ["12-00:00",
+ "12Z"],
+ ]
+ targets.each do |data, expected|
+ assert_equal(expected, XSD::XSDGMonth.new(data).to_s)
+ end
+ end
+
+ def test_XSDHexBinary
+ o = XSD::XSDHexBinary.new
+ assert_equal(XSD::Namespace, o.type.namespace)
+ assert_equal(XSD::HexBinaryLiteral, o.type.name)
+ assert_equal(nil, o.data)
+ assert_equal(true, o.is_nil)
+
+ targets = [
+ "abcdef",
+ "\xe3\x81\xaa\xe3\x81\xb2",
+ %Q(\0),
+ "",
+ ]
+ targets.each do |str|
+ assert_equal(str, XSD::XSDHexBinary.new(str).string)
+ assert_equal(str.unpack("H*")[0 ].tr('a-f', 'A-F'),
+ XSD::XSDHexBinary.new(str).data)
+ o = XSD::XSDHexBinary.new
+ o.set_encoded(str.unpack("H*")[0 ].tr('a-f', 'A-F'))
+ assert_equal(str, o.string)
+ o.set_encoded(str.unpack("H*")[0 ].tr('A-F', 'a-f'))
+ assert_equal(str, o.string)
+ end
+
+ targets = [
+ "0FG7",
+ "0fg7",
+ ]
+ targets.each do |d|
+ assert_raises(XSD::ValueSpaceError, d.to_s) do
+ o = XSD::XSDHexBinary.new
+ o.set_encoded(d)
+ p o.string
+ end
+ end
+ end
+
+ def test_XSDBase64Binary
+ o = XSD::XSDBase64Binary.new
+ assert_equal(XSD::Namespace, o.type.namespace)
+ assert_equal(XSD::Base64BinaryLiteral, o.type.name)
+ assert_equal(nil, o.data)
+ assert_equal(true, o.is_nil)
+
+ targets = [
+ "abcdef",
+ "\xe3\x81\xaa\xe3\x81\xb2",
+ %Q(\0),
+ "",
+ ]
+ targets.each do |str|
+ assert_equal(str, XSD::XSDBase64Binary.new(str).string)
+ assert_equal([str ].pack("m").chomp, XSD::XSDBase64Binary.new(str).data)
+ o = XSD::XSDBase64Binary.new
+ o.set_encoded([str ].pack("m").chomp)
+ assert_equal(str, o.string)
+ end
+
+ targets = [
+ "-",
+ "*",
+ ]
+ targets.each do |d|
+ assert_raises(XSD::ValueSpaceError, d.to_s) do
+ o = XSD::XSDBase64Binary.new
+ o.set_encoded(d)
+ p o.string
+ end
+ end
+ end
+
+ def test_XSDAnyURI
+ o = XSD::XSDAnyURI.new
+ assert_equal(XSD::Namespace, o.type.namespace)
+ assert_equal(XSD::AnyURILiteral, o.type.name)
+ assert_equal(nil, o.data)
+ assert_equal(true, o.is_nil)
+
+ # Too few tests here I know. Believe uri module. :)
+ targets = [
+ "foo",
+ "http://foo",
+ "http://foo/bar/baz",
+ "http://foo/bar#baz",
+ "http://foo/bar%20%20?a+b",
+ "HTTP://FOO/BAR%20%20?A+B",
+ ]
+ targets.each do |str|
+ assert_parsed_result(XSD::XSDAnyURI, str)
+ end
+ end
+
+ def test_XSDQName
+ o = XSD::XSDQName.new
+ assert_equal(XSD::Namespace, o.type.namespace)
+ assert_equal(XSD::QNameLiteral, o.type.name)
+ assert_equal(nil, o.data)
+ assert_equal(true, o.is_nil)
+
+ # More strict test is needed but current implementation allows all non-':'
+ # chars like ' ', C0 or C1...
+ targets = [
+ "foo",
+ "foo:bar",
+ "a:b",
+ ]
+ targets.each do |str|
+ assert_parsed_result(XSD::XSDQName, str)
+ end
+ end
+
+
+ ###
+ ## Derived types
+ #
+
+ def test_XSDInteger
+ o = XSD::XSDInteger.new
+ assert_equal(XSD::Namespace, o.type.namespace)
+ assert_equal(XSD::IntegerLiteral, o.type.name)
+ assert_equal(nil, o.data)
+ assert_equal(true, o.is_nil)
+
+ targets = [
+ 0,
+ 1000000000,
+ -9999999999,
+ 12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890,
+ 12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890,
+ -1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789,
+ ]
+ targets.each do |int|
+ assert_equal(int, XSD::XSDInteger.new(int).data)
+ end
+
+ targets = [
+ "0",
+ "1000000000",
+ "-9999999999",
+ "12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890",
+ "12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890",
+ "-1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789",
+ ]
+ targets.each do |str|
+ assert_equal(str, XSD::XSDInteger.new(str).to_s)
+ end
+
+ targets = [
+ ["-0", "0"],
+ ["+0", "0"],
+ ["000123", "123"],
+ ["-000123", "-123"],
+ [
+ "+12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890",
+ "12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890"
+ ],
+ ]
+ targets.each do |data, expected|
+ assert_equal(expected, XSD::XSDInteger.new(data).to_s)
+ end
+
+ targets = [
+ "0.0",
+ "-5.2",
+ "0.000000000000a",
+ "+-5",
+ "12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890."
+ ]
+ targets.each do |d|
+ assert_raises(XSD::ValueSpaceError) do
+ XSD::XSDInteger.new(d)
+ end
+ end
+ end
+
+ def test_XSDNonPositiveInteger
+ o = XSD::XSDNonPositiveInteger.new
+ assert_equal(XSD::Namespace, o.type.namespace)
+ assert_equal(XSD::NonPositiveIntegerLiteral, o.type.name)
+ assert_equal(nil, o.data)
+ assert_equal(true, o.is_nil)
+
+ targets = [
+ 0,
+ -9999999999,
+ -1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789,
+ ]
+ targets.each do |int|
+ assert_equal(int, XSD::XSDNonPositiveInteger.new(int).data)
+ end
+
+ targets = [
+ "0",
+ "-9999999999",
+ "-1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789",
+ ]
+ targets.each do |str|
+ assert_equal(str, XSD::XSDNonPositiveInteger.new(str).to_s)
+ end
+
+ targets = [
+ ["-0", "0"],
+ ["-000123", "-123"],
+ ]
+ targets.each do |data, expected|
+ assert_equal(expected, XSD::XSDNonPositiveInteger.new(data).to_s)
+ end
+
+ targets = [
+ "0.0",
+ "-5.2",
+ "0.000000000000a",
+ "+-5",
+ "-12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890."
+ ]
+ targets.each do |d|
+ assert_raises(XSD::ValueSpaceError) do
+ XSD::XSDNonPositiveInteger.new(d)
+ end
+ end
+ end
+
+ def test_XSDNegativeInteger
+ o = XSD::XSDNegativeInteger.new
+ assert_equal(XSD::Namespace, o.type.namespace)
+ assert_equal(XSD::NegativeIntegerLiteral, o.type.name)
+ assert_equal(nil, o.data)
+ assert_equal(true, o.is_nil)
+
+ targets = [
+ -1,
+ -9999999999,
+ -1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789,
+ ]
+ targets.each do |int|
+ assert_equal(int, XSD::XSDNegativeInteger.new(int).data)
+ end
+
+ targets = [
+ "-1",
+ "-9999999999",
+ "-1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789",
+ ]
+ targets.each do |str|
+ assert_equal(str, XSD::XSDNegativeInteger.new(str).to_s)
+ end
+
+ targets = [
+ ["-000123", "-123"],
+ ]
+ targets.each do |data, expected|
+ assert_equal(expected, XSD::XSDNegativeInteger.new(data).to_s)
+ end
+
+ targets = [
+ "-0.0",
+ "-5.2",
+ "-0.000000000000a",
+ "+-5",
+ "-12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890."
+ ]
+ targets.each do |d|
+ assert_raises(XSD::ValueSpaceError) do
+ XSD::XSDNegativeInteger.new(d)
+ end
+ end
+ end
+
+ def test_XSDLong
+ o = XSD::XSDLong.new
+ assert_equal(XSD::Namespace, o.type.namespace)
+ assert_equal(XSD::LongLiteral, o.type.name)
+ assert_equal(nil, o.data)
+ assert_equal(true, o.is_nil)
+
+ targets = [
+ 0,
+ 123,
+ -123,
+ 9223372036854775807,
+ -9223372036854775808,
+ ]
+ targets.each do |lng|
+ assert_equal(lng, XSD::XSDLong.new(lng).data)
+ end
+
+ targets = [
+ "0",
+ "123",
+ "-123",
+ "9223372036854775807",
+ "-9223372036854775808",
+ ]
+ targets.each do |str|
+ assert_equal(str, XSD::XSDLong.new(str).to_s)
+ end
+
+ targets = [
+ ["-0", "0"],
+ ["+0", "0"],
+ ["000123", "123"],
+ ["-000123", "-123"],
+ ]
+ targets.each do |data, expected|
+ assert_equal(expected, XSD::XSDLong.new(data).to_s)
+ end
+
+ targets = [
+ 9223372036854775808,
+ -9223372036854775809,
+ "0.0",
+ "-5.2",
+ "0.000000000000a",
+ "+-5",
+ ]
+ targets.each do |d|
+ assert_raises(XSD::ValueSpaceError) do
+ XSD::XSDLong.new(d)
+ end
+ end
+ end
+
+ def test_XSDInt
+ o = XSD::XSDInt.new
+ assert_equal(XSD::Namespace, o.type.namespace)
+ assert_equal(XSD::IntLiteral, o.type.name)
+ assert_equal(nil, o.data)
+ assert_equal(true, o.is_nil)
+
+ targets = [
+ 0,
+ 123,
+ -123,
+ 2147483647,
+ -2147483648,
+ ]
+ targets.each do |lng|
+ assert_equal(lng, XSD::XSDInt.new(lng).data)
+ end
+
+ targets = [
+ "0",
+ "123",
+ "-123",
+ "2147483647",
+ "-2147483648",
+ ]
+ targets.each do |str|
+ assert_equal(str, XSD::XSDInt.new(str).to_s)
+ end
+
+ targets = [
+ ["-0", "0"],
+ ["+0", "0"],
+ ["000123", "123"],
+ ["-000123", "-123"],
+ ]
+ targets.each do |data, expected|
+ assert_equal(expected, XSD::XSDInt.new(data).to_s)
+ end
+
+ targets = [
+ 2147483648,
+ -2147483649,
+ "0.0",
+ "-5.2",
+ "0.000000000000a",
+ "+-5",
+ ]
+ targets.each do |d|
+ assert_raises(XSD::ValueSpaceError) do
+ XSD::XSDInt.new(d)
+ end
+ end
+ end
+
+ def test_XSDShort
+ o = XSD::XSDShort.new
+ assert_equal(XSD::Namespace, o.type.namespace)
+ assert_equal(XSD::ShortLiteral, o.type.name)
+ assert_equal(nil, o.data)
+ assert_equal(true, o.is_nil)
+
+ targets = [
+ 0,
+ 123,
+ -123,
+ 32767,
+ -32768,
+ ]
+ targets.each do |lng|
+ assert_equal(lng, XSD::XSDShort.new(lng).data)
+ end
+
+ targets = [
+ "0",
+ "123",
+ "-123",
+ "32767",
+ "-32768",
+ ]
+ targets.each do |str|
+ assert_equal(str, XSD::XSDShort.new(str).to_s)
+ end
+
+ targets = [
+ ["-0", "0"],
+ ["+0", "0"],
+ ["000123", "123"],
+ ["-000123", "-123"],
+ ]
+ targets.each do |data, expected|
+ assert_equal(expected, XSD::XSDShort.new(data).to_s)
+ end
+
+ targets = [
+ 32768,
+ -32769,
+ "0.0",
+ "-5.2",
+ "0.000000000000a",
+ "+-5",
+ ]
+ targets.each do |d|
+ assert_raises(XSD::ValueSpaceError) do
+ XSD::XSDShort.new(d)
+ end
+ end
+ end
+
+ def test_XSDByte
+ o = XSD::XSDByte.new
+ assert_equal(XSD::Namespace, o.type.namespace)
+ assert_equal(XSD::ByteLiteral, o.type.name)
+ assert_equal(nil, o.data)
+ assert_equal(true, o.is_nil)
+
+ targets = [
+ 0,
+ 123,
+ -123,
+ 127,
+ -128,
+ ]
+ targets.each do |lng|
+ assert_equal(lng, XSD::XSDByte.new(lng).data)
+ end
+
+ targets = [
+ "0",
+ "123",
+ "-123",
+ "127",
+ "-128",
+ ]
+ targets.each do |str|
+ assert_equal(str, XSD::XSDByte.new(str).to_s)
+ end
+
+ targets = [
+ ["-0", "0"],
+ ["+0", "0"],
+ ["000123", "123"],
+ ["-000123", "-123"],
+ ]
+ targets.each do |data, expected|
+ assert_equal(expected, XSD::XSDByte.new(data).to_s)
+ end
+
+ targets = [
+ 128,
+ -129,
+ "0.0",
+ "-5.2",
+ "0.000000000000a",
+ "+-5",
+ ]
+ targets.each do |d|
+ assert_raises(XSD::ValueSpaceError) do
+ XSD::XSDByte.new(d)
+ end
+ end
+ end
+
+ def test_XSDNonNegativeInteger
+ o = XSD::XSDNonNegativeInteger.new
+ assert_equal(XSD::Namespace, o.type.namespace)
+ assert_equal(XSD::NonNegativeIntegerLiteral, o.type.name)
+ assert_equal(nil, o.data)
+ assert_equal(true, o.is_nil)
+
+ targets = [
+ 0,
+ 1000000000,
+ 12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890,
+ ]
+ targets.each do |int|
+ assert_equal(int, XSD::XSDNonNegativeInteger.new(int).data)
+ end
+
+ targets = [
+ "0",
+ "1000000000",
+ "12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890",
+ ]
+ targets.each do |str|
+ assert_equal(str, XSD::XSDNonNegativeInteger.new(str).to_s)
+ end
+
+ targets = [
+ ["-0", "0"],
+ ["+0", "0"],
+ ["000123", "123"],
+ [
+ "+12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890",
+ "12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890"
+ ],
+ ]
+ targets.each do |data, expected|
+ assert_equal(expected, XSD::XSDNonNegativeInteger.new(data).to_s)
+ end
+
+ targets = [
+ "0.0",
+ "0.000000000000a",
+ "+-5",
+ "12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890."
+ ]
+ targets.each do |d|
+ assert_raises(XSD::ValueSpaceError) do
+ XSD::XSDNonNegativeInteger.new(d)
+ end
+ end
+ end
+
+ def test_XSDUnsignedLong
+ o = XSD::XSDUnsignedLong.new
+ assert_equal(XSD::Namespace, o.type.namespace)
+ assert_equal(XSD::UnsignedLongLiteral, o.type.name)
+ assert_equal(nil, o.data)
+ assert_equal(true, o.is_nil)
+
+ targets = [
+ 0,
+ 1000000000,
+ 18446744073709551615,
+ ]
+ targets.each do |int|
+ assert_equal(int, XSD::XSDUnsignedLong.new(int).data)
+ end
+
+ targets = [
+ "0",
+ "1000000000",
+ "18446744073709551615",
+ ]
+ targets.each do |str|
+ assert_equal(str, XSD::XSDUnsignedLong.new(str).to_s)
+ end
+
+ targets = [
+ ["-0", "0"],
+ ["+0", "0"],
+ ["000123", "123"],
+ ["+18446744073709551615", "18446744073709551615"],
+ ]
+ targets.each do |data, expected|
+ assert_equal(expected, XSD::XSDUnsignedLong.new(data).to_s)
+ end
+
+ targets = [
+ "0.0",
+ "0.000000000000a",
+ "+-5",
+ "18446744073709551615."
+ ]
+ targets.each do |d|
+ assert_raises(XSD::ValueSpaceError) do
+ XSD::XSDUnsignedLong.new(d)
+ end
+ end
+ end
+
+ def test_XSDUnsignedInt
+ o = XSD::XSDUnsignedInt.new
+ assert_equal(XSD::Namespace, o.type.namespace)
+ assert_equal(XSD::UnsignedIntLiteral, o.type.name)
+ assert_equal(nil, o.data)
+ assert_equal(true, o.is_nil)
+
+ targets = [
+ 0,
+ 1000000000,
+ 4294967295,
+ ]
+ targets.each do |int|
+ assert_equal(int, XSD::XSDUnsignedInt.new(int).data)
+ end
+
+ targets = [
+ "0",
+ "1000000000",
+ "4294967295",
+ ]
+ targets.each do |str|
+ assert_equal(str, XSD::XSDUnsignedInt.new(str).to_s)
+ end
+
+ targets = [
+ ["-0", "0"],
+ ["+0", "0"],
+ ["000123", "123"],
+ ["+4294967295", "4294967295"],
+ ]
+ targets.each do |data, expected|
+ assert_equal(expected, XSD::XSDUnsignedInt.new(data).to_s)
+ end
+
+ targets = [
+ "0.0",
+ "0.000000000000a",
+ "+-5",
+ "4294967295."
+ ]
+ targets.each do |d|
+ assert_raises(XSD::ValueSpaceError) do
+ XSD::XSDUnsignedInt.new(d)
+ end
+ end
+ end
+
+ def test_XSDUnsignedShort
+ o = XSD::XSDUnsignedShort.new
+ assert_equal(XSD::Namespace, o.type.namespace)
+ assert_equal(XSD::UnsignedShortLiteral, o.type.name)
+ assert_equal(nil, o.data)
+ assert_equal(true, o.is_nil)
+
+ targets = [
+ 0,
+ 10000,
+ 65535,
+ ]
+ targets.each do |int|
+ assert_equal(int, XSD::XSDUnsignedShort.new(int).data)
+ end
+
+ targets = [
+ "0",
+ "1000",
+ "65535",
+ ]
+ targets.each do |str|
+ assert_equal(str, XSD::XSDUnsignedShort.new(str).to_s)
+ end
+
+ targets = [
+ ["-0", "0"],
+ ["+0", "0"],
+ ["000123", "123"],
+ ["+65535", "65535"],
+ ]
+ targets.each do |data, expected|
+ assert_equal(expected, XSD::XSDUnsignedShort.new(data).to_s)
+ end
+
+ targets = [
+ "0.0",
+ "0.000000000000a",
+ "+-5",
+ "65535."
+ ]
+ targets.each do |d|
+ assert_raises(XSD::ValueSpaceError) do
+ XSD::XSDUnsignedShort.new(d)
+ end
+ end
+ end
+
+ def test_XSDUnsignedByte
+ o = XSD::XSDUnsignedByte.new
+ assert_equal(XSD::Namespace, o.type.namespace)
+ assert_equal(XSD::UnsignedByteLiteral, o.type.name)
+ assert_equal(nil, o.data)
+ assert_equal(true, o.is_nil)
+
+ targets = [
+ 0,
+ 10,
+ 255,
+ ]
+ targets.each do |int|
+ assert_equal(int, XSD::XSDUnsignedByte.new(int).data)
+ end
+
+ targets = [
+ "0",
+ "10",
+ "255",
+ ]
+ targets.each do |str|
+ assert_equal(str, XSD::XSDUnsignedByte.new(str).to_s)
+ end
+
+ targets = [
+ ["-0", "0"],
+ ["+0", "0"],
+ ["000123", "123"],
+ ["+255", "255"],
+ ]
+ targets.each do |data, expected|
+ assert_equal(expected, XSD::XSDUnsignedByte.new(data).to_s)
+ end
+
+ targets = [
+ "0.0",
+ "0.000000000000a",
+ "+-5",
+ "255."
+ ]
+ targets.each do |d|
+ assert_raises(XSD::ValueSpaceError) do
+ XSD::XSDUnsignedByte.new(d)
+ end
+ end
+ end
+
+ def test_XSDPositiveInteger
+ o = XSD::XSDPositiveInteger.new
+ assert_equal(XSD::Namespace, o.type.namespace)
+ assert_equal(XSD::PositiveIntegerLiteral, o.type.name)
+ assert_equal(nil, o.data)
+ assert_equal(true, o.is_nil)
+
+ targets = [
+ 1,
+ 1000000000,
+ 12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890,
+ ]
+ targets.each do |int|
+ assert_equal(int, XSD::XSDPositiveInteger.new(int).data)
+ end
+
+ targets = [
+ "1",
+ "1000000000",
+ "12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890",
+ ]
+ targets.each do |str|
+ assert_equal(str, XSD::XSDPositiveInteger.new(str).to_s)
+ end
+
+ targets = [
+ ["+1", "1"],
+ ["000123", "123"],
+ [
+ "+12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890",
+ "12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890"
+ ],
+ ]
+ targets.each do |data, expected|
+ assert_equal(expected, XSD::XSDPositiveInteger.new(data).to_s)
+ end
+
+ targets = [
+ "1.0",
+ "1.000000000000a",
+ "+-5",
+ "12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890."
+ ]
+ targets.each do |d|
+ assert_raises(XSD::ValueSpaceError) do
+ XSD::XSDPositiveInteger.new(d)
+ end
+ end
+ end
+end
+
+
+end
diff --git a/test/xsd/xmlschema.xml b/test/xsd/xmlschema.xml
new file mode 100644
index 0000000000..018bd0cc67
--- /dev/null
+++ b/test/xsd/xmlschema.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8"?>
+<xs:schema
+ attributeFormDefault="qualified"
+ elementFormDefault="qualified"
+ targetNamespace="urn:jp.gr.jin.rrr.example.fakeschema"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema">
+ <xs:element name="MessageDataSet">
+ <xs:complexType>
+ <xs:choice maxOccurs="unbounded" />
+ </xs:complexType>
+ </xs:element>
+</xs:schema>
diff --git a/test/yaml/test_yaml.rb b/test/yaml/test_yaml.rb
index 8c7aef3dcd..023a8b96f5 100644
--- a/test/yaml/test_yaml.rb
+++ b/test/yaml/test_yaml.rb
@@ -21,7 +21,7 @@ class YAML_Unit_Tests < Test::Unit::TestCase
assert_equal( obj, YAML::load( obj.to_yaml ) )
assert_equal( obj, YAML::parse( obj.to_yaml ).transform )
assert_equal( obj, YAML::load(
- obj.to_yaml( :UseVersion => true, :UseHeader => true, :SortKeys => true )
+ obj.to_yaml( :UseVersion => true, :UseHeader => true, :SortKeys => true )
) )
end
@@ -48,13 +48,13 @@ class YAML_Unit_Tests < Test::Unit::TestCase
# Make a time with the time zone
#
def mktime( year, mon, day, hour, min, sec, usec, zone = "Z" )
- usec = Rational(usec.to_s) * 1000000
+ usec = usec.to_s.to_f * 1000000
val = Time::utc( year.to_i, mon.to_i, day.to_i, hour.to_i, min.to_i, sec.to_i, usec )
if zone != "Z"
hour = zone[0,3].to_i * 3600
min = zone[3,2].to_i * 60
ofs = (hour + min)
- val = Time.at( val.tv_sec - ofs, val.tv_nsec / 1000.0 )
+ val = Time.at( val.to_f - ofs )
end
return val
end
@@ -133,7 +133,7 @@ EOY
def test_spec_simple_map_with_nested_sequences
# Simple mapping with nested sequences
assert_to_yaml(
- { 'american' =>
+ { 'american' =>
[ 'Boston Red Sox', 'Detroit Tigers', 'New York Yankees' ],
'national' =>
[ 'New York Mets', 'Chicago Cubs', 'Atlanta Braves' ] }, <<EOY
@@ -171,7 +171,7 @@ EOY
def test_spec_sequence_of_sequences
# Simple sequence with inline sequences
assert_parse_only(
- [
+ [
[ 'name', 'hr', 'avg' ],
[ 'Mark McGwire', 65, 0.278 ],
[ 'Sammy Sosa', 63, 0.288 ]
@@ -241,11 +241,11 @@ EOY
assert_to_yaml(
[{"arrival"=>"EDI", "departure"=>"LAX", "fareref"=>"DOGMA", "currency"=>"GBP"}, {"arrival"=>"MEL", "departure"=>"SYD", "fareref"=>"MADF", "currency"=>"AUD"}, {"arrival"=>"MCO", "departure"=>"JFK", "fareref"=>"DFSF", "currency"=>"USD"}], <<EOY
- -
+ -
&F fareref: DOGMA
&C currency: GBP
&D departure: LAX
- &A arrival: EDI
+ &A arrival: EDI
- { *F: MADF, *C: AUD, *D: SYD, *A: MEL }
- { *F: DFSF, *C: USD, *D: JFK, *A: MCO }
EOY
@@ -285,12 +285,12 @@ EOY
? # PLAY SCHEDULE
- Detroit Tigers
- Chicago Cubs
-:
+:
- 2001-07-23
? [ New York Yankees,
Atlanta Braves ]
-: [ 2001-07-02, 2001-08-12,
+: [ 2001-07-02, 2001-08-12,
2001-08-14 ]
EOY
)
@@ -352,9 +352,9 @@ EOY
def test_spec_sequence_shortcuts
# Sequence shortcuts combined
- assert_parse_only(
+ assert_parse_only(
[
- [
+ [
[ [ 'one' ] ],
[ 'two', 'three' ],
{ 'four' => nil },
@@ -440,7 +440,7 @@ quoted: "\\
scalar.\\n"
EOY
)
- end
+ end
def test_spec_type_int
assert_parse_only(
@@ -678,7 +678,7 @@ EOY
def test_spec_force_implicit
# Force implicit
- assert_parse_only(
+ assert_parse_only(
{ 'integer' => 12, 'also int' => 12, 'string' => '12' }, <<EOY
integer: 12
also int: ! "12"
@@ -705,7 +705,7 @@ EOY
assert_equal( doc['pool'].type_id, 'x-private:ball' )
assert_equal( doc['pool'].transform.value, { 'number' => 8, 'color' => 'black' } )
when 1
- assert_equal( doc['bearing'].type_id, 'x-private:ball' )
+ assert_equal( doc['bearing'].type_id, 'x-private:ball' )
assert_equal( doc['bearing'].transform.value, { 'material' => 'steel' } )
end
doc_ct += 1
@@ -734,7 +734,7 @@ EOY
def test_spec_override_anchor
# Override anchor
a001 = "The alias node below is a repeated use of this value.\n"
- assert_parse_only(
+ assert_parse_only(
{ 'anchor' => 'This scalar has an anchor.', 'override' => a001, 'alias' => a001 }, <<EOY
anchor : &A001 This scalar has an anchor.
override : &A001 >
@@ -758,7 +758,7 @@ picture: !binary |
Pz7Y6OjuDg4J+fn5OTk6enp
56enmleECcgggoBADs=
-hmm: !somewhere.com,2002/type |
+hmm: !somewhere.com,2002/type |
family above is short for
http://somewhere.com/type
EOY
@@ -843,7 +843,7 @@ EOY
def test_spec_builtin_map
# Assortment of mappings
- assert_parse_only(
+ assert_parse_only(
{ 'empty' => {}, 'in-line' => { 'one' => 1, 'two' => 2 },
'spanning' => { 'one' => 1, 'two' => 2 },
'nested' => { 'first' => 'First entry', 'second' =>
@@ -945,9 +945,9 @@ EOY
str1 = "This has one newline.\n"
str2 = "This has no newline."
str3 = "This has two newlines.\n\n"
- assert_parse_only(
- { 'clipped' => str1, 'same as "clipped" above' => str1,
- 'stripped' => str2, 'same as "stripped" above' => str2,
+ assert_parse_only(
+ { 'clipped' => str1, 'same as "clipped" above' => str1,
+ 'stripped' => str2, 'same as "stripped" above' => str2,
'kept' => str3, 'same as "kept" above' => str3 }, <<EOY
clipped: |
This has one newline.
@@ -967,7 +967,7 @@ same as "kept" above: "This has two newlines.\\n\\n"
EOY
)
end
-
+
def test_spec_span_single_quote
assert_parse_only( {"third"=>"a single quote ' must be escaped.", "second"=>"! : \\ etc. can be used freely.", "is same as"=>"this contains six spaces\nand one line break", "empty"=>"", "span"=>"this contains six spaces\nand one line break"}, <<EOY
empty: ''
@@ -975,7 +975,7 @@ second: '! : \\ etc. can be used freely.'
third: 'a single quote '' must be escaped.'
span: 'this contains
six spaces
-
+
and one
line break'
is same as: "this contains six spaces\\nand one line break"
@@ -1000,9 +1000,9 @@ EOY
def test_spec_builtin_time
# Time
assert_parse_only(
- { "space separated" => mktime( 2001, 12, 14, 21, 59, 43, ".10", "-05:00" ),
- "canonical" => mktime( 2001, 12, 15, 2, 59, 43, ".10" ),
- "date (noon UTC)" => Date.new( 2002, 12, 14),
+ { "space separated" => mktime( 2001, 12, 14, 21, 59, 43, ".10", "-05:00" ),
+ "canonical" => mktime( 2001, 12, 15, 2, 59, 43, ".10" ),
+ "date (noon UTC)" => Date.new( 2002, 12, 14),
"valid iso8601" => mktime( 2001, 12, 14, 21, 59, 43, ".10", "-05:00" ) }, <<EOY
canonical: 2001-12-15T02:59:43.1Z
valid iso8601: 2001-12-14t21:59:43.10-05:00
@@ -1015,7 +1015,7 @@ EOY
def test_spec_builtin_binary
arrow_gif = "GIF89a\f\000\f\000\204\000\000\377\377\367\365\365\356\351\351\345fff\000\000\000\347\347\347^^^\363\363\355\216\216\216\340\340\340\237\237\237\223\223\223\247\247\247\236\236\236iiiccc\243\243\243\204\204\204\377\376\371\377\376\371\377\376\371\377\376\371\377\376\371\377\376\371\377\376\371\377\376\371\377\376\371\377\376\371\377\376\371\377\376\371\377\376\371\377\376\371!\376\016Made with GIMP\000,\000\000\000\000\f\000\f\000\000\005, \216\2010\236\343@\024\350i\020\304\321\212\010\034\317\200M$z\357\3770\205p\270\2601f\r\e\316\001\303\001\036\020' \202\n\001\000;"
assert_parse_only(
- { 'canonical' => arrow_gif, 'base64' => arrow_gif,
+ { 'canonical' => arrow_gif, 'base64' => arrow_gif,
'description' => "The binary value above is a tiny arrow encoded as a gif image.\n" }, <<EOY
canonical: !binary "\\
R0lGODlhDAAMAIQAAP//9/X17unp5WZmZgAAAOf\\
@@ -1041,7 +1041,7 @@ EOY
end
def test_ruby_regexp
# Test Ruby regular expressions
- assert_to_yaml(
+ assert_to_yaml(
{ 'simple' => /a.b/, 'complex' => %r'\A"((?:[^"]|\")+)"',
'case-insensitive' => /George McFly/i }, <<EOY
case-insensitive: !ruby/regexp "/George McFly/i"
@@ -1078,59 +1078,35 @@ EOY
book_struct = Struct::new( "BookStruct", :author, :title, :year, :isbn )
assert_to_yaml(
[ book_struct.new( "Yukihiro Matsumoto", "Ruby in a Nutshell", 2002, "0-596-00214-9" ),
- book_struct.new( [ 'Dave Thomas', 'Andy Hunt' ], "The Pickaxe", 2002,
- book_struct.new( "This should be the ISBN", "but I have another struct here", 2002, "None" )
+ book_struct.new( [ 'Dave Thomas', 'Andy Hunt' ], "The Pickaxe", 2002,
+ book_struct.new( "This should be the ISBN", "but I have another struct here", 2002, "None" )
) ], <<EOY
- !ruby/struct:BookStruct
- :author: Yukihiro Matsumoto
- :title: Ruby in a Nutshell
- :year: 2002
- :isbn: 0-596-00214-9
+ author: Yukihiro Matsumoto
+ title: Ruby in a Nutshell
+ year: 2002
+ isbn: 0-596-00214-9
- !ruby/struct:BookStruct
- :author:
+ author:
- Dave Thomas
- Andy Hunt
- :title: The Pickaxe
- :year: 2002
- :isbn: !ruby/struct:BookStruct
- :author: This should be the ISBN
- :title: but I have another struct here
- :year: 2002
- :isbn: None
+ title: The Pickaxe
+ year: 2002
+ isbn: !ruby/struct:BookStruct
+ author: This should be the ISBN
+ title: but I have another struct here
+ year: 2002
+ isbn: None
EOY
)
assert_to_yaml( YAML_Tests::StructTest.new( 123 ), <<EOY )
--- !ruby/struct:YAML_Tests::StructTest
-:c: 123
+c: 123
EOY
end
- def test_ruby_rational
- assert_to_yaml( Rational(1, 2), <<EOY )
---- !ruby/object:Rational
-numerator: 1
-denominator: 2
-EOY
-
- # Read YAML dumped by the ruby 1.8.3.
- assert_to_yaml( Rational(1, 2), "!ruby/object:Rational 1/2\n" )
- assert_raise( ArgumentError ) { YAML.load("!ruby/object:Rational INVALID/RATIONAL\n") }
- end
-
- def test_ruby_complex
- assert_to_yaml( Complex(3, 4), <<EOY )
---- !ruby/object:Complex
-image: 4
-real: 3
-EOY
-
- # Read YAML dumped by the ruby 1.8.3.
- assert_to_yaml( Complex(3, 4), "!ruby/object:Complex 3+4i\n" )
- assert_raise( ArgumentError ) { YAML.load("!ruby/object:Complex INVALID+COMPLEXi\n") }
- end
-
def test_emitting_indicators
assert_to_yaml( "Hi, from Object 1. You passed: please, pretty please", <<EOY
--- "Hi, from Object 1. You passed: please, pretty please"
@@ -1143,7 +1119,7 @@ EOY
#
def test_document
y = YAML::Stream.new( :Indent => 2, :UseVersion => 0 )
- y.add(
+ y.add(
{ 'hi' => 'hello', 'map' =>
{ 'good' => 'two' },
'time' => Time.now,
@@ -1214,7 +1190,6 @@ EOY
#
require 'yaml'
t = Time.now
- t = Time.at(t.tv_sec, t.tv_usec)
5.times do
assert_cycle(t)
end
@@ -1305,15 +1280,6 @@ EOY
1000.times { |i| omap["key_#{i}"] = { "value" => i } }
raise "id collision in ordered map" if omap.to_yaml =~ /id\d+/
end
-
- def test_date_out_of_range
- assert_nothing_raised{YAML::load('1900-01-01T00:00:00+00:00')}
- end
-
- def test_normal_exit
- YAML.load("2000-01-01 00:00:00.#{"0"*1000} +00:00\n")
- # '[ruby-core:13735]'
- end
end
if $0 == __FILE__
diff --git a/test/yaml/test_yamlstore.rb b/test/yaml/test_yamlstore.rb
index 69302095e5..7a3d90469e 100644
--- a/test/yaml/test_yamlstore.rb
+++ b/test/yaml/test_yamlstore.rb
@@ -17,14 +17,14 @@ class YAMLStoreTest < Test::Unit::TestCase
assert_nil @yamlstore[:bar]
end
end
-
+
def test_opening_new_file_in_readwrite_mode_should_result_in_empty_values
@yamlstore.transaction do
assert_nil @yamlstore[:foo]
assert_nil @yamlstore[:bar]
end
end
-
+
def test_data_should_be_loaded_correctly_when_in_readonly_mode
@yamlstore.transaction do
@yamlstore[:foo] = "bar"
@@ -33,7 +33,7 @@ class YAMLStoreTest < Test::Unit::TestCase
assert_equal "bar", @yamlstore[:foo]
end
end
-
+
def test_data_should_be_loaded_correctly_when_in_readwrite_mode
@yamlstore.transaction do
@yamlstore[:foo] = "bar"
@@ -42,7 +42,7 @@ class YAMLStoreTest < Test::Unit::TestCase
assert_equal "bar", @yamlstore[:foo]
end
end
-
+
def test_changes_after_commit_are_discarded
@yamlstore.transaction do
@yamlstore[:foo] = "bar"
@@ -53,7 +53,7 @@ class YAMLStoreTest < Test::Unit::TestCase
assert_equal "bar", @yamlstore[:foo]
end
end
-
+
def test_changes_are_not_written_on_abort
@yamlstore.transaction do
@yamlstore[:foo] = "bar"
@@ -63,7 +63,7 @@ class YAMLStoreTest < Test::Unit::TestCase
assert_nil @yamlstore[:foo]
end
end
-
+
def test_writing_inside_readonly_transaction_raises_error
assert_raise(PStore::Error) do
@yamlstore.transaction(true) do
diff --git a/test/zlib/test_zlib.rb b/test/zlib/test_zlib.rb
index aa3059d5b1..54706099d9 100644
--- a/test/zlib/test_zlib.rb
+++ b/test/zlib/test_zlib.rb
@@ -1,6 +1,6 @@
-require 'test/unit'
+require 'test/unit/testsuite'
+require 'test/unit/testcase'
require 'stringio'
-require 'tempfile'
begin
require 'zlib'
@@ -8,398 +8,13 @@ rescue LoadError
end
if defined? Zlib
- class TestZlibDeflate < Test::Unit::TestCase
- def test_initialize
- z = Zlib::Deflate.new
- s = z.deflate("foo", Zlib::FINISH)
- assert_equal("foo", Zlib::Inflate.inflate(s))
-
- z = Zlib::Deflate.new
- s = z.deflate("foo")
- s << z.deflate(nil, Zlib::FINISH)
- assert_equal("foo", Zlib::Inflate.inflate(s))
-
- assert_raise(Zlib::StreamError) { Zlib::Deflate.new(10000) }
- end
-
- def test_dup
- z1 = Zlib::Deflate.new
- s = z1.deflate("foo")
- z2 = z1.dup
- s1 = s + z1.deflate("bar", Zlib::FINISH)
- s2 = s + z2.deflate("baz", Zlib::FINISH)
- assert_equal("foobar", Zlib::Inflate.inflate(s1))
- assert_equal("foobaz", Zlib::Inflate.inflate(s2))
- end
-
- def test_deflate
- s = Zlib::Deflate.deflate("foo")
- assert_equal("foo", Zlib::Inflate.inflate(s))
-
- assert_raise(Zlib::StreamError) { Zlib::Deflate.deflate("foo", 10000) }
- end
-
- def test_addstr
- z = Zlib::Deflate.new
- z << "foo"
- s = z.deflate(nil, Zlib::FINISH)
- assert_equal("foo", Zlib::Inflate.inflate(s))
- end
-
- def test_flush
- z = Zlib::Deflate.new
- z << "foo"
- s = z.flush
- z << "bar"
- s << z.flush_next_in
- z << "baz"
- s << z.flush_next_out
- s << z.deflate("qux", Zlib::FINISH)
- assert_equal("foobarbazqux", Zlib::Inflate.inflate(s))
- end
-
- def test_avail
- z = Zlib::Deflate.new
- assert_equal(0, z.avail_in)
- assert_equal(0, z.avail_out)
- z << "foo"
- z.avail_out += 100
- z << "bar"
- s = z.finish
- assert_equal("foobar", Zlib::Inflate.inflate(s))
- end
-
- def test_total
- z = Zlib::Deflate.new
- 1000.times { z << "foo" }
- s = z.finish
- assert_equal(3000, z.total_in)
- assert_operator(3000, :>, z.total_out)
- assert_equal("foo" * 1000, Zlib::Inflate.inflate(s))
- end
-
- def test_data_type
- z = Zlib::Deflate.new
- assert([Zlib::ASCII, Zlib::BINARY, Zlib::UNKNOWN].include?(z.data_type))
- end
-
- def test_adler
- z = Zlib::Deflate.new
- z << "foo"
- s = z.finish
- assert_equal(0x02820145, z.adler)
- end
-
- def test_finished_p
- z = Zlib::Deflate.new
- assert_equal(false, z.finished?)
- z << "foo"
- assert_equal(false, z.finished?)
- s = z.finish
- assert_equal(true, z.finished?)
- z.close
- assert_raise(Zlib::Error) { z.finished? }
- end
-
- def test_closed_p
- z = Zlib::Deflate.new
- assert_equal(false, z.closed?)
- z << "foo"
- assert_equal(false, z.closed?)
- s = z.finish
- assert_equal(false, z.closed?)
- z.close
- assert_equal(true, z.closed?)
- end
-
- def test_params
- z = Zlib::Deflate.new
- z << "foo"
- z.params(Zlib::DEFAULT_COMPRESSION, Zlib::DEFAULT_STRATEGY)
- z << "bar"
- s = z.finish
- assert_equal("foobar", Zlib::Inflate.inflate(s))
-
- data = ('a'..'z').to_a.join
- z = Zlib::Deflate.new(Zlib::NO_COMPRESSION, Zlib::MAX_WBITS,
- Zlib::DEF_MEM_LEVEL, Zlib::DEFAULT_STRATEGY)
- z << data[0, 10]
- z.params(Zlib::BEST_COMPRESSION, Zlib::DEFAULT_STRATEGY)
- z << data[10 .. -1]
- assert_equal(data, Zlib::Inflate.inflate(z.finish))
-
- z = Zlib::Deflate.new
- s = z.deflate("foo", Zlib::FULL_FLUSH)
- z.avail_out = 0
- z.params(Zlib::NO_COMPRESSION, Zlib::FILTERED)
- s << z.deflate("bar", Zlib::FULL_FLUSH)
- z.avail_out = 0
- z.params(Zlib::BEST_COMPRESSION, Zlib::HUFFMAN_ONLY)
- s << z.deflate("baz", Zlib::FINISH)
- assert_equal("foobarbaz", Zlib::Inflate.inflate(s))
-
- z = Zlib::Deflate.new
- assert_raise(Zlib::StreamError) { z.params(10000, 10000) }
- z.close # without this, outputs `zlib(finalizer): the stream was freed prematurely.'
- end
-
- def test_set_dictionary
- z = Zlib::Deflate.new
- z.set_dictionary("foo")
- s = z.deflate("foo" * 100, Zlib::FINISH)
- z = Zlib::Inflate.new
- assert_raise(Zlib::NeedDict) { z.inflate(s) }
- z.set_dictionary("foo")
- assert_equal("foo" * 100, z.inflate(s)) # ???
-
- z = Zlib::Deflate.new
- z << "foo"
- assert_raise(Zlib::StreamError) { z.set_dictionary("foo") }
- z.close # without this, outputs `zlib(finalizer): the stream was freed prematurely.'
- end
-
- def test_reset
- z = Zlib::Deflate.new
- z << "foo"
- z.reset
- z << "bar"
- s = z.finish
- assert_equal("bar", Zlib::Inflate.inflate(s))
- end
-
- def test_close
- z = Zlib::Deflate.new
- z.close
- assert_raise(Zlib::Error) { z << "foo" }
- assert_raise(Zlib::Error) { z.reset }
- end
- end
-
- class TestZlibInflate < Test::Unit::TestCase
- def test_initialize
- assert_raise(Zlib::StreamError) { Zlib::Inflate.new(-1) }
-
- s = Zlib::Deflate.deflate("foo")
- z = Zlib::Inflate.new
- z << s << nil
- assert_equal("foo", z.finish)
- end
-
- def test_inflate
- s = Zlib::Deflate.deflate("foo")
- z = Zlib::Inflate.new
- s = z.inflate(s)
- s << z.inflate(nil)
- assert_equal("foo", s)
- z.inflate("foo") # ???
- z << "foo" # ???
- end
-
- def test_sync
- z = Zlib::Deflate.new
- s = z.deflate("foo" * 1000, Zlib::FULL_FLUSH)
- z.avail_out = 0
- z.params(Zlib::NO_COMPRESSION, Zlib::FILTERED)
- s << z.deflate("bar" * 1000, Zlib::FULL_FLUSH)
- z.avail_out = 0
- z.params(Zlib::BEST_COMPRESSION, Zlib::HUFFMAN_ONLY)
- s << z.deflate("baz" * 1000, Zlib::FINISH)
-
- z = Zlib::Inflate.new
- assert_raise(Zlib::DataError) { z << "\0" * 100 }
- assert_equal(false, z.sync(""))
- assert_equal(false, z.sync_point?)
-
- z = Zlib::Inflate.new
- assert_raise(Zlib::DataError) { z << "\0" * 100 + s }
- assert_equal(true, z.sync(""))
- #assert_equal(true, z.sync_point?)
-
- z = Zlib::Inflate.new
- assert_equal(false, z.sync("\0" * 100))
- assert_equal(false, z.sync_point?)
-
- z = Zlib::Inflate.new
- assert_equal(true, z.sync("\0" * 100 + s))
- #assert_equal(true, z.sync_point?)
- end
-
- def test_set_dictionary
- z = Zlib::Inflate.new
- assert_raise(Zlib::StreamError) { z.set_dictionary("foo") }
- z.close
- end
- end
-
- class TestZlibGzipFile < Test::Unit::TestCase
- def test_to_io
- t = Tempfile.new("test_zlib_gzip_file")
- t.close
- Zlib::GzipWriter.open(t.path) {|gz| gz.print("foo") }
-
- f = Zlib::GzipReader.open(t.path)
- assert_kind_of(IO, f.to_io)
- end
-
- def test_crc
- t = Tempfile.new("test_zlib_gzip_file")
- t.close
- Zlib::GzipWriter.open(t.path) {|gz| gz.print("foo") }
-
- f = Zlib::GzipReader.open(t.path)
- f.read
- assert_equal(0x8c736521, f.crc)
- end
-
- def test_mtime
- tim = Time.now
-
- t = Tempfile.new("test_zlib_gzip_file")
- t.close
- Zlib::GzipWriter.open(t.path) do |gz|
- gz.mtime = -1
- gz.mtime = tim
- gz.print("foo")
- gz.flush
- assert_raise(Zlib::GzipFile::Error) { gz.mtime = Time.now }
- end
-
- f = Zlib::GzipReader.open(t.path)
- assert_equal(tim.to_i, f.mtime.to_i)
- end
-
- def test_level
- t = Tempfile.new("test_zlib_gzip_file")
- t.close
- Zlib::GzipWriter.open(t.path) {|gz| gz.print("foo") }
-
- f = Zlib::GzipReader.open(t.path)
- assert_equal(Zlib::DEFAULT_COMPRESSION, f.level)
- end
-
- def test_os_code
- t = Tempfile.new("test_zlib_gzip_file")
- t.close
- Zlib::GzipWriter.open(t.path) {|gz| gz.print("foo") }
-
- f = Zlib::GzipReader.open(t.path)
- assert_equal(Zlib::OS_CODE, f.os_code)
- end
-
- def test_orig_name
- t = Tempfile.new("test_zlib_gzip_file")
- t.close
- Zlib::GzipWriter.open(t.path) do |gz|
- gz.orig_name = "foobarbazqux\0quux"
- gz.print("foo")
- gz.flush
- assert_raise(Zlib::GzipFile::Error) { gz.orig_name = "quux" }
- end
-
- f = Zlib::GzipReader.open(t.path)
- assert_equal("foobarbazqux", f.orig_name)
- end
-
- def test_comment
- t = Tempfile.new("test_zlib_gzip_file")
- t.close
- Zlib::GzipWriter.open(t.path) do |gz|
- gz.comment = "foobarbazqux\0quux"
- gz.print("foo")
- gz.flush
- assert_raise(Zlib::GzipFile::Error) { gz.comment = "quux" }
- end
-
- f = Zlib::GzipReader.open(t.path)
- assert_equal("foobarbazqux", f.comment)
- end
-
- def test_lineno
- t = Tempfile.new("test_zlib_gzip_file")
- t.close
- Zlib::GzipWriter.open(t.path) {|gz| gz.print("foo\nbar\nbaz\nqux\n") }
-
- f = Zlib::GzipReader.open(t.path)
- assert_equal([0, "foo\n"], [f.lineno, f.gets])
- assert_equal([1, "bar\n"], [f.lineno, f.gets])
- f.lineno = 1000
- assert_equal([1000, "baz\n"], [f.lineno, f.gets])
- assert_equal([1001, "qux\n"], [f.lineno, f.gets])
- end
-
- def test_closed_p
- t = Tempfile.new("test_zlib_gzip_file")
- t.close
- Zlib::GzipWriter.open(t.path) {|gz| gz.print("foo") }
-
- f = Zlib::GzipReader.open(t.path)
- assert_equal(false, f.closed?)
- f.read
- assert_equal(false, f.closed?)
- f.close
- assert_equal(true, f.closed?)
- end
-
- def test_sync
- t = Tempfile.new("test_zlib_gzip_file")
- t.close
- Zlib::GzipWriter.open(t.path) {|gz| gz.print("foo") }
-
- f = Zlib::GzipReader.open(t.path)
- f.sync = true
- assert_equal(true, f.sync)
- f.read
- f.sync = false
- assert_equal(false, f.sync)
- f.close
- end
-
- def test_pos
- t = Tempfile.new("test_zlib_gzip_file")
- t.close
- Zlib::GzipWriter.open(t.path) do |gz|
- gz.print("foo")
- gz.flush
- assert_equal(3, gz.tell)
- end
- end
-
- def test_path
- t = Tempfile.new("test_zlib_gzip_file")
- t.close
-
- gz = Zlib::GzipWriter.open(t.path)
- gz.print("foo")
- assert_equal(t.path, gz.path)
- gz.close
- assert_equal(t.path, gz.path)
-
- f = Zlib::GzipReader.open(t.path)
- assert_equal(t.path, f.path)
- f.close
- assert_equal(t.path, f.path)
-
- s = ""
- sio = StringIO.new(s)
- gz = Zlib::GzipWriter.new(sio)
- gz.print("foo")
- assert_raise(NoMethodError) { gz.path }
- gz.close
-
- sio = StringIO.new(s)
- f = Zlib::GzipReader.new(sio)
- assert_raise(NoMethodError) { f.path }
- f.close
- end
- end
-
class TestZlibGzipReader < Test::Unit::TestCase
D0 = "\037\213\010\000S`\017A\000\003\003\000\000\000\000\000\000\000\000\000"
def test_read0
assert_equal("", Zlib::GzipReader.new(StringIO.new(D0)).read(0))
end
- def test_ungetc
+ def test_ungetc # [ruby-dev:24060]
s = ""
w = Zlib::GzipWriter.new(StringIO.new(s))
w << (1...1000).to_a.inspect
@@ -407,14 +22,14 @@ if defined? Zlib
r = Zlib::GzipReader.new(StringIO.new(s))
r.read(100)
r.ungetc ?a
- assert_nothing_raised("[ruby-dev:24060]") {
+ assert_nothing_raised {
r.read(100)
r.read
r.close
}
end
- def test_ungetc_paragraph
+ def test_ungetc_paragraph # [ruby-dev:24065]
s = ""
w = Zlib::GzipWriter.new(StringIO.new(s))
w << "abc"
@@ -422,255 +37,21 @@ if defined? Zlib
r = Zlib::GzipReader.new(StringIO.new(s))
r.ungetc ?\n
assert_equal("abc", r.gets(""))
- assert_nothing_raised("[ruby-dev:24065]") {
+ assert_nothing_raised {
r.read
r.close
}
end
-
- def test_open
- t = Tempfile.new("test_zlib_gzip_reader")
- t.close
- Zlib::GzipWriter.open(t.path) {|gz| gz.print("foo") }
-
- assert_raise(ArgumentError) { Zlib::GzipReader.open }
-
- assert_equal("foo", Zlib::GzipReader.open(t.path) {|gz| gz.read })
-
- f = Zlib::GzipReader.open(t.path)
- assert_equal("foo", f.read)
- f.close
- end
-
- def test_rewind
- t = Tempfile.new("test_zlib_gzip_reader")
- t.close
- Zlib::GzipWriter.open(t.path) {|gz| gz.print("foo") }
-
- f = Zlib::GzipReader.open(t.path)
- assert_equal("foo", f.read)
- f.rewind
- assert_equal("foo", f.read)
- f.close
- end
-
- def test_unused
- t = Tempfile.new("test_zlib_gzip_reader")
- t.close
- Zlib::GzipWriter.open(t.path) {|gz| gz.print("foobar") }
-
- f = Zlib::GzipReader.open(t.path)
- assert_equal("foo", f.read(3))
- f.unused
- assert_equal("bar", f.read)
- f.unused
- f.close
- end
-
- def test_read
- t = Tempfile.new("test_zlib_gzip_reader")
- t.close
- Zlib::GzipWriter.open(t.path) {|gz| gz.print("foobar") }
-
- f = Zlib::GzipReader.open(t.path)
- assert_raise(ArgumentError) { f.read(-1) }
- end
-
- def test_readpartial
- t = Tempfile.new("test_zlib_gzip_reader")
- t.close
- Zlib::GzipWriter.open(t.path) {|gz| gz.print("foobar") }
-
- f = Zlib::GzipReader.open(t.path)
- assert("foo".start_with?(f.readpartial(3)))
-
- f = Zlib::GzipReader.open(t.path)
- s = ""
- f.readpartial(3, s)
- assert("foo".start_with?(s))
-
- assert_raise(ArgumentError) { f.readpartial(-1) }
- end
-
- def test_getc
- t = Tempfile.new("test_zlib_gzip_reader")
- t.close
- Zlib::GzipWriter.open(t.path) {|gz| gz.print("foobar") }
-
- f = Zlib::GzipReader.open(t.path)
- "foobar".each_char {|c| assert_equal(c, f.getc) }
- assert_nil(f.getc)
- end
-
- def test_getbyte
- t = Tempfile.new("test_zlib_gzip_reader")
- t.close
- Zlib::GzipWriter.open(t.path) {|gz| gz.print("foobar") }
-
- f = Zlib::GzipReader.open(t.path)
- "foobar".each_byte {|c| assert_equal(c, f.getbyte) }
- assert_nil(f.getbyte)
- end
-
- def test_readchar
- t = Tempfile.new("test_zlib_gzip_reader")
- t.close
- Zlib::GzipWriter.open(t.path) {|gz| gz.print("foobar") }
-
- f = Zlib::GzipReader.open(t.path)
- "foobar".each_byte {|c| assert_equal(c, f.readchar.ord) }
- assert_raise(EOFError) { f.readchar }
- end
-
- def test_each_byte
- t = Tempfile.new("test_zlib_gzip_reader")
- t.close
- Zlib::GzipWriter.open(t.path) {|gz| gz.print("foobar") }
-
- f = Zlib::GzipReader.open(t.path)
- a = []
- f.each_byte {|c| a << c }
- assert_equal("foobar".each_byte.to_a, a)
- end
-
- def test_gets
- t = Tempfile.new("test_zlib_gzip_reader")
- t.close
- Zlib::GzipWriter.open(t.path) {|gz| gz.print("foo\nbar\nbaz\n") }
-
- f = Zlib::GzipReader.open(t.path)
- assert_equal("foo\n", f.gets)
- assert_equal("bar\n", f.gets)
- assert_equal("baz\n", f.gets)
- assert_nil(f.gets)
- f.close
-
- f = Zlib::GzipReader.open(t.path)
- assert_equal("foo\nbar\nbaz\n", f.gets(nil))
- f.close
- end
-
- def test_gets
- t = Tempfile.new("test_zlib_gzip_reader")
- t.close
- Zlib::GzipWriter.open(t.path) {|gz| gz.print("foo\nbar\nbaz\n") }
-
- f = Zlib::GzipReader.open(t.path)
- assert_equal("foo\n", f.readline)
- assert_equal("bar\n", f.readline)
- assert_equal("baz\n", f.readline)
- assert_raise(EOFError) { f.readline }
- f.close
- end
-
- def test_each
- t = Tempfile.new("test_zlib_gzip_reader")
- t.close
- Zlib::GzipWriter.open(t.path) {|gz| gz.print("foo\nbar\nbaz\n") }
-
- f = Zlib::GzipReader.open(t.path)
- a = ["foo\n", "bar\n", "baz\n"]
- f.each {|l| assert_equal(a.shift, l) }
- f.close
- end
-
- def test_readlines
- t = Tempfile.new("test_zlib_gzip_reader")
- t.close
- Zlib::GzipWriter.open(t.path) {|gz| gz.print("foo\nbar\nbaz\n") }
-
- f = Zlib::GzipReader.open(t.path)
- assert_equal(["foo\n", "bar\n", "baz\n"], f.readlines)
- f.close
- end
-
- def test_reader_wrap
- t = Tempfile.new("test_zlib_gzip_reader")
- t.close
- Zlib::GzipWriter.open(t.path) {|gz| gz.print("foo") }
- f = open(t.path)
- assert_equal("foo", Zlib::GzipReader.wrap(f) {|gz| gz.read })
- assert_raise(IOError) { f.close }
- end
end
class TestZlibGzipWriter < Test::Unit::TestCase
def test_invalid_new
- assert_raise(NoMethodError, "[ruby-dev:23228]") { Zlib::GzipWriter.new(nil).close }
- assert_raise(NoMethodError, "[ruby-dev:23344]") { Zlib::GzipWriter.new(true).close }
- assert_raise(NoMethodError, "[ruby-dev:23344]") { Zlib::GzipWriter.new(0).close }
- assert_raise(NoMethodError, "[ruby-dev:23344]") { Zlib::GzipWriter.new(:hoge).close }
- end
-
- def test_open
- assert_raise(ArgumentError) { Zlib::GzipWriter.open }
-
- t = Tempfile.new("test_zlib_gzip_writer")
- t.close
- Zlib::GzipWriter.open(t.path) {|gz| gz.print("foo") }
- assert_equal("foo", Zlib::GzipReader.open(t.path) {|gz| gz.read })
-
- f = Zlib::GzipWriter.open(t.path)
- f.print("bar")
- f.close
- assert_equal("bar", Zlib::GzipReader.open(t.path) {|gz| gz.read })
-
- assert_raise(Zlib::StreamError) { Zlib::GzipWriter.open(t.path, 10000) }
- end
-
- def test_write
- t = Tempfile.new("test_zlib_gzip_writer")
- t.close
- Zlib::GzipWriter.open(t.path) {|gz| gz.print("foo") }
- assert_equal("foo", Zlib::GzipReader.open(t.path) {|gz| gz.read })
-
- o = Object.new
- def o.to_s; "bar"; end
- Zlib::GzipWriter.open(t.path) {|gz| gz.print(o) }
- assert_equal("bar", Zlib::GzipReader.open(t.path) {|gz| gz.read })
- end
-
- def test_putc
- t = Tempfile.new("test_zlib_gzip_writer")
- t.close
- Zlib::GzipWriter.open(t.path) {|gz| gz.putc(?x) }
- assert_equal("x", Zlib::GzipReader.open(t.path) {|gz| gz.read })
-
- # todo: multibyte char
- end
-
- def test_writer_wrap
- t = Tempfile.new("test_zlib_gzip_writer")
- Zlib::GzipWriter.wrap(t) {|gz| gz.print("foo") }
- t.close
- assert_equal("foo", Zlib::GzipReader.open(t.path) {|gz| gz.read })
- end
- end
-
- class TestZlib < Test::Unit::TestCase
- def test_version
- assert_instance_of(String, Zlib.zlib_version)
- assert(Zlib.zlib_version.tainted?)
- end
-
- def test_adler32
- assert_equal(0x00000001, Zlib.adler32)
- assert_equal(0x02820145, Zlib.adler32("foo"))
- assert_equal(0x02820145, Zlib.adler32("o", Zlib.adler32("fo")))
- assert_equal(0x8a62c964, Zlib.adler32("abc\x01\x02\x03" * 10000))
- end
-
- def test_crc32
- assert_equal(0x00000000, Zlib.crc32)
- assert_equal(0x8c736521, Zlib.crc32("foo"))
- assert_equal(0x8c736521, Zlib.crc32("o", Zlib.crc32("fo")))
- assert_equal(0x07f0d68f, Zlib.crc32("abc\x01\x02\x03" * 10000))
- end
-
- def test_crc_table
- t = Zlib.crc_table
- assert_instance_of(Array, t)
- t.each {|x| assert_kind_of(Integer, x) }
+ # [ruby-dev:23228]
+ assert_raise(NoMethodError) { Zlib::GzipWriter.new(nil).close }
+ # [ruby-dev:23344]
+ assert_raise(NoMethodError) { Zlib::GzipWriter.new(true).close }
+ assert_raise(NoMethodError) { Zlib::GzipWriter.new(0).close }
+ assert_raise(NoMethodError) { Zlib::GzipWriter.new(:hoge).close }
end
end
end
diff --git a/thread.c b/thread.c
deleted file mode 100644
index c6f9cea24f..0000000000
--- a/thread.c
+++ /dev/null
@@ -1,4084 +0,0 @@
-/**********************************************************************
-
- thread.c -
-
- $Author$
-
- Copyright (C) 2004-2007 Koichi Sasada
-
-**********************************************************************/
-
-/*
- YARV Thread Desgin
-
- model 1: Userlevel Thread
- Same as traditional ruby thread.
-
- model 2: Native Thread with Global VM lock
- Using pthread (or Windows thread) and Ruby threads run concurrent.
-
- model 3: Native Thread with fine grain lock
- Using pthread and Ruby threads run concurrent or parallel.
-
-------------------------------------------------------------------------
-
- model 2:
- A thread has mutex (GVL: Global VM Lock or Giant VM Lock) can run.
- When thread scheduling, running thread release GVL. If running thread
- try blocking operation, this thread must release GVL and another
- thread can continue this flow. After blocking operation, thread
- must check interrupt (RUBY_VM_CHECK_INTS).
-
- Every VM can run parallel.
-
- Ruby threads are scheduled by OS thread scheduler.
-
-------------------------------------------------------------------------
-
- model 3:
- Every threads run concurrent or parallel and to access shared object
- exclusive access control is needed. For example, to access String
- object or Array object, fine grain lock must be locked every time.
- */
-
-
-/* for model 2 */
-
-#include "eval_intern.h"
-#include "gc.h"
-
-#ifndef USE_NATIVE_THREAD_PRIORITY
-#define USE_NATIVE_THREAD_PRIORITY 0
-#define RUBY_THREAD_PRIORITY_MAX 3
-#define RUBY_THREAD_PRIORITY_MIN -3
-#endif
-
-#ifndef THREAD_DEBUG
-#define THREAD_DEBUG 0
-#endif
-
-VALUE rb_cMutex;
-VALUE rb_cBarrier;
-
-static void sleep_timeval(rb_thread_t *th, struct timeval time);
-static void sleep_wait_for_interrupt(rb_thread_t *th, double sleepsec);
-static void sleep_forever(rb_thread_t *th, int nodeadlock);
-static double timeofday(void);
-struct timeval rb_time_interval(VALUE);
-static int rb_threadptr_dead(rb_thread_t *th);
-
-static void rb_check_deadlock(rb_vm_t *vm);
-
-int rb_signal_buff_size(void);
-void rb_signal_exec(rb_thread_t *th, int sig);
-void rb_disable_interrupt(void);
-void rb_thread_stop_timer_thread(void);
-
-static const VALUE eKillSignal = INT2FIX(0);
-static const VALUE eTerminateSignal = INT2FIX(1);
-static volatile int system_working = 1;
-
-inline static void
-st_delete_wrap(st_table *table, st_data_t key)
-{
- st_delete(table, &key, 0);
-}
-
-/********************************************************************************/
-
-#define THREAD_SYSTEM_DEPENDENT_IMPLEMENTATION
-
-struct rb_blocking_region_buffer {
- enum rb_thread_status prev_status;
- struct rb_unblock_callback oldubf;
-};
-
-static void set_unblock_function(rb_thread_t *th, rb_unblock_function_t *func, void *arg,
- struct rb_unblock_callback *old);
-static void reset_unblock_function(rb_thread_t *th, const struct rb_unblock_callback *old);
-
-static inline void blocking_region_begin(rb_thread_t *th, struct rb_blocking_region_buffer *region,
- rb_unblock_function_t *func, void *arg);
-static inline void blocking_region_end(rb_thread_t *th, struct rb_blocking_region_buffer *region);
-
-#define GVL_UNLOCK_BEGIN() do { \
- rb_thread_t *_th_stored = GET_THREAD(); \
- rb_gc_save_machine_context(_th_stored); \
- native_mutex_unlock(&_th_stored->vm->global_vm_lock)
-
-#define GVL_UNLOCK_END() \
- native_mutex_lock(&_th_stored->vm->global_vm_lock); \
- rb_thread_set_current(_th_stored); \
-} while(0)
-
-#define BLOCKING_REGION_CORE(exec) do { \
- GVL_UNLOCK_BEGIN(); {\
- exec; \
- } \
- GVL_UNLOCK_END(); \
-} while(0);
-
-#define BLOCKING_REGION(exec, ubf, ubfarg) do { \
- rb_thread_t *__th = GET_THREAD(); \
- struct rb_blocking_region_buffer __region; \
- blocking_region_begin(__th, &__region, ubf, ubfarg); \
- exec; \
- blocking_region_end(__th, &__region); \
- RUBY_VM_CHECK_INTS(); \
-} while(0)
-
-#if THREAD_DEBUG
-#ifdef HAVE_VA_ARGS_MACRO
-void rb_thread_debug(const char *file, int line, const char *fmt, ...);
-#define thread_debug(fmt, ...) rb_thread_debug(__FILE__, __LINE__, fmt, ##__VA_ARGS__)
-#define POSITION_FORMAT "%s:%d:"
-#define POSITION_ARGS ,file, line
-#else
-void rb_thread_debug(const char *fmt, ...);
-#define thread_debug rb_thread_debug
-#define POSITION_FORMAT
-#define POSITION_ARGS
-#endif
-
-# if THREAD_DEBUG < 0
-static int rb_thread_debug_enabled;
-
-static VALUE
-rb_thread_s_debug(void)
-{
- return INT2NUM(rb_thread_debug_enabled);
-}
-
-static VALUE
-rb_thread_s_debug_set(VALUE self, VALUE val)
-{
- rb_thread_debug_enabled = RTEST(val);
- return val;
-}
-# else
-# define rb_thread_debug_enabled THREAD_DEBUG
-# endif
-#else
-#define thread_debug if(0)printf
-#endif
-
-#ifndef __ia64
-#define thread_start_func_2(th, st, rst) thread_start_func_2(th, st)
-#endif
-NOINLINE(static int thread_start_func_2(rb_thread_t *th, VALUE *stack_start,
- VALUE *register_stack_start));
-static void timer_thread_function(void *);
-
-#if defined(_WIN32)
-#include "thread_win32.c"
-
-#define DEBUG_OUT() \
- WaitForSingleObject(&debug_mutex, INFINITE); \
- printf(POSITION_FORMAT"%p - %s" POSITION_ARGS, GetCurrentThreadId(), buf); \
- fflush(stdout); \
- ReleaseMutex(&debug_mutex);
-
-#elif defined(HAVE_PTHREAD_H)
-#include "thread_pthread.c"
-
-#define DEBUG_OUT() \
- pthread_mutex_lock(&debug_mutex); \
- printf(POSITION_FORMAT"%#"PRIxVALUE" - %s" POSITION_ARGS, (VALUE)pthread_self(), buf); \
- fflush(stdout); \
- pthread_mutex_unlock(&debug_mutex);
-
-#else
-#error "unsupported thread type"
-#endif
-
-#if THREAD_DEBUG
-static int debug_mutex_initialized = 1;
-static rb_thread_lock_t debug_mutex;
-
-void
-rb_thread_debug(
-#ifdef HAVE_VA_ARGS_MACRO
- const char *file, int line,
-#endif
- const char *fmt, ...)
-{
- va_list args;
- char buf[BUFSIZ];
-
- if (!rb_thread_debug_enabled) return;
-
- if (debug_mutex_initialized == 1) {
- debug_mutex_initialized = 0;
- native_mutex_initialize(&debug_mutex);
- }
-
- va_start(args, fmt);
- vsnprintf(buf, BUFSIZ, fmt, args);
- va_end(args);
-
- DEBUG_OUT();
-}
-#endif
-
-
-static void
-set_unblock_function(rb_thread_t *th, rb_unblock_function_t *func, void *arg,
- struct rb_unblock_callback *old)
-{
- check_ints:
- RUBY_VM_CHECK_INTS(); /* check signal or so */
- native_mutex_lock(&th->interrupt_lock);
- if (th->interrupt_flag) {
- native_mutex_unlock(&th->interrupt_lock);
- goto check_ints;
- }
- else {
- if (old) *old = th->unblock;
- th->unblock.func = func;
- th->unblock.arg = arg;
- }
- native_mutex_unlock(&th->interrupt_lock);
-}
-
-static void
-reset_unblock_function(rb_thread_t *th, const struct rb_unblock_callback *old)
-{
- native_mutex_lock(&th->interrupt_lock);
- th->unblock = *old;
- native_mutex_unlock(&th->interrupt_lock);
-}
-
-static void
-rb_threadptr_interrupt(rb_thread_t *th)
-{
- native_mutex_lock(&th->interrupt_lock);
- RUBY_VM_SET_INTERRUPT(th);
- if (th->unblock.func) {
- (th->unblock.func)(th->unblock.arg);
- }
- else {
- /* none */
- }
- native_mutex_unlock(&th->interrupt_lock);
-}
-
-
-static int
-terminate_i(st_data_t key, st_data_t val, rb_thread_t *main_thread)
-{
- VALUE thval = key;
- rb_thread_t *th;
- GetThreadPtr(thval, th);
-
- if (th != main_thread) {
- thread_debug("terminate_i: %p\n", (void *)th);
- rb_threadptr_interrupt(th);
- th->thrown_errinfo = eTerminateSignal;
- th->status = THREAD_TO_KILL;
- }
- else {
- thread_debug("terminate_i: main thread (%p)\n", (void *)th);
- }
- return ST_CONTINUE;
-}
-
-typedef struct rb_mutex_struct
-{
- rb_thread_lock_t lock;
- rb_thread_cond_t cond;
- struct rb_thread_struct volatile *th;
- volatile int cond_waiting, cond_notified;
- struct rb_mutex_struct *next_mutex;
-} mutex_t;
-
-static void rb_mutex_unlock_all(mutex_t *mutex, rb_thread_t *th);
-
-void
-rb_thread_terminate_all(void)
-{
- rb_thread_t *th = GET_THREAD(); /* main thread */
- rb_vm_t *vm = th->vm;
- if (vm->main_thread != th) {
- rb_bug("rb_thread_terminate_all: called by child thread (%p, %p)",
- (void *)vm->main_thread, (void *)th);
- }
-
- /* unlock all locking mutexes */
- if (th->keeping_mutexes) {
- rb_mutex_unlock_all(th->keeping_mutexes, GET_THREAD());
- }
-
- thread_debug("rb_thread_terminate_all (main thread: %p)\n", (void *)th);
- st_foreach(vm->living_threads, terminate_i, (st_data_t)th);
-
- while (!rb_thread_alone()) {
- PUSH_TAG();
- if (EXEC_TAG() == 0) {
- rb_thread_schedule();
- }
- else {
- /* ignore exception */
- }
- POP_TAG();
- }
- rb_thread_stop_timer_thread();
-}
-
-static void
-thread_cleanup_func_before_exec(void *th_ptr)
-{
- rb_thread_t *th = th_ptr;
- th->status = THREAD_KILLED;
- th->machine_stack_start = th->machine_stack_end = 0;
-#ifdef __ia64
- th->machine_register_stack_start = th->machine_register_stack_end = 0;
-#endif
-}
-
-static void
-thread_cleanup_func(void *th_ptr)
-{
- rb_thread_t *th = th_ptr;
-
- /* unlock all locking mutexes */
- if (th->keeping_mutexes) {
- rb_mutex_unlock_all(th->keeping_mutexes, th);
- th->keeping_mutexes = NULL;
- }
- thread_cleanup_func_before_exec(th_ptr);
- native_thread_destroy(th);
-}
-
-extern void ruby_error_print(void);
-static VALUE rb_threadptr_raise(rb_thread_t *, int, VALUE *);
-void rb_thread_recycle_stack_release(VALUE *);
-
-void
-ruby_thread_init_stack(rb_thread_t *th)
-{
- native_thread_init_stack(th);
-}
-
-static int
-thread_start_func_2(rb_thread_t *th, VALUE *stack_start, VALUE *register_stack_start)
-{
- int state;
- VALUE args = th->first_args;
- rb_proc_t *proc;
- rb_thread_t *join_th;
- rb_thread_t *main_th;
- VALUE errinfo = Qnil;
-
- ruby_thread_set_native(th);
-
- th->machine_stack_start = stack_start;
-#ifdef __ia64
- th->machine_register_stack_start = register_stack_start;
-#endif
- thread_debug("thread start: %p\n", (void *)th);
-
- native_mutex_lock(&th->vm->global_vm_lock);
- {
- thread_debug("thread start (get lock): %p\n", (void *)th);
- rb_thread_set_current(th);
-
- TH_PUSH_TAG(th);
- if ((state = EXEC_TAG()) == 0) {
- SAVE_ROOT_JMPBUF(th, {
- if (th->first_proc) {
- GetProcPtr(th->first_proc, proc);
- th->errinfo = Qnil;
- th->local_lfp = proc->block.lfp;
- th->local_svar = Qnil;
- th->value = rb_vm_invoke_proc(th, proc, proc->block.self,
- (int)RARRAY_LEN(args), RARRAY_PTR(args), 0);
- }
- else {
- th->value = (*th->first_func)((void *)th->first_args);
- }
- });
- }
- else {
- errinfo = th->errinfo;
- if (NIL_P(errinfo)) errinfo = rb_errinfo();
- if (state == TAG_FATAL) {
- /* fatal error within this thread, need to stop whole script */
- }
- else if (rb_obj_is_kind_of(errinfo, rb_eSystemExit)) {
- if (th->safe_level >= 4) {
- th->errinfo = rb_exc_new3(rb_eSecurityError,
- rb_sprintf("Insecure exit at level %d", th->safe_level));
- errinfo = Qnil;
- }
- }
- else if (th->safe_level < 4 &&
- (th->vm->thread_abort_on_exception ||
- th->abort_on_exception || RTEST(ruby_debug))) {
- /* exit on main_thread */
- }
- else {
- errinfo = Qnil;
- }
- th->value = Qnil;
- }
-
- th->status = THREAD_KILLED;
- thread_debug("thread end: %p\n", (void *)th);
-
- main_th = th->vm->main_thread;
- if (th != main_th) {
- if (TYPE(errinfo) == T_OBJECT) {
- /* treat with normal error object */
- rb_threadptr_raise(main_th, 1, &errinfo);
- }
- }
- TH_POP_TAG();
-
- /* locking_mutex must be Qfalse */
- if (th->locking_mutex != Qfalse) {
- rb_bug("thread_start_func_2: locking_mutex must not be set (%p:%"PRIxVALUE")",
- (void *)th, th->locking_mutex);
- }
-
- /* delete self other than main thread from living_threads */
- if (th != main_th) {
- st_delete_wrap(th->vm->living_threads, th->self);
- }
-
- /* wake up joinning threads */
- join_th = th->join_list_head;
- while (join_th) {
- if (join_th == main_th) errinfo = Qnil;
- rb_threadptr_interrupt(join_th);
- switch (join_th->status) {
- case THREAD_STOPPED: case THREAD_STOPPED_FOREVER:
- join_th->status = THREAD_RUNNABLE;
- default: break;
- }
- join_th = join_th->join_list_next;
- }
-
- if (!th->root_fiber) {
- rb_thread_recycle_stack_release(th->stack);
- th->stack = 0;
- }
- }
- thread_cleanup_func(th);
- if (th != main_th) rb_check_deadlock(th->vm);
- if (th->vm->main_thread == th) {
- ruby_cleanup(state);
- }
- native_mutex_unlock(&th->vm->global_vm_lock);
-
- return 0;
-}
-
-static VALUE
-thread_create_core(VALUE thval, VALUE args, VALUE (*fn)(ANYARGS))
-{
- rb_thread_t *th;
-
- if (OBJ_FROZEN(GET_THREAD()->thgroup)) {
- rb_raise(rb_eThreadError,
- "can't start a new thread (frozen ThreadGroup)");
- }
- GetThreadPtr(thval, th);
-
- /* setup thread environment */
- th->first_func = fn;
- th->first_proc = fn ? Qfalse : rb_block_proc();
- th->first_args = args; /* GC: shouldn't put before above line */
-
- th->priority = GET_THREAD()->priority;
- th->thgroup = GET_THREAD()->thgroup;
-
- native_mutex_initialize(&th->interrupt_lock);
- /* kick thread */
- st_insert(th->vm->living_threads, thval, (st_data_t) th->thread_id);
- native_thread_create(th);
- return thval;
-}
-
-static VALUE
-thread_s_new(int argc, VALUE *argv, VALUE klass)
-{
- rb_thread_t *th;
- VALUE thread = rb_thread_alloc(klass);
- rb_obj_call_init(thread, argc, argv);
- GetThreadPtr(thread, th);
- if (!th->first_args) {
- rb_raise(rb_eThreadError, "uninitialized thread - check `%s#initialize'",
- rb_class2name(klass));
- }
- return thread;
-}
-
-/*
- * call-seq:
- * Thread.start([args]*) {|args| block } => thread
- * Thread.fork([args]*) {|args| block } => thread
- *
- * Basically the same as <code>Thread::new</code>. However, if class
- * <code>Thread</code> is subclassed, then calling <code>start</code> in that
- * subclass will not invoke the subclass's <code>initialize</code> method.
- */
-
-static VALUE
-thread_start(VALUE klass, VALUE args)
-{
- return thread_create_core(rb_thread_alloc(klass), args, 0);
-}
-
-static VALUE
-thread_initialize(VALUE thread, VALUE args)
-{
- rb_thread_t *th;
- if (!rb_block_given_p()) {
- rb_raise(rb_eThreadError, "must be called with a block");
- }
- GetThreadPtr(thread, th);
- if (th->first_args) {
- VALUE rb_proc_location(VALUE self);
- VALUE proc = th->first_proc, line, loc;
- const char *file;
- if (!proc || !RTEST(loc = rb_proc_location(proc))) {
- rb_raise(rb_eThreadError, "already initialized thread");
- }
- file = RSTRING_PTR(RARRAY_PTR(loc)[0]);
- if (NIL_P(line = RARRAY_PTR(loc)[1])) {
- rb_raise(rb_eThreadError, "already initialized thread - %s",
- file);
- }
- rb_raise(rb_eThreadError, "already initialized thread - %s:%d",
- file, NUM2INT(line));
- }
- return thread_create_core(thread, args, 0);
-}
-
-VALUE
-rb_thread_create(VALUE (*fn)(ANYARGS), void *arg)
-{
- return thread_create_core(rb_thread_alloc(rb_cThread), (VALUE)arg, fn);
-}
-
-
-/* +infty, for this purpose */
-#define DELAY_INFTY 1E30
-
-struct join_arg {
- rb_thread_t *target, *waiting;
- double limit;
- int forever;
-};
-
-static VALUE
-remove_from_join_list(VALUE arg)
-{
- struct join_arg *p = (struct join_arg *)arg;
- rb_thread_t *target_th = p->target, *th = p->waiting;
-
- if (target_th->status != THREAD_KILLED) {
- rb_thread_t **pth = &target_th->join_list_head;
-
- while (*pth) {
- if (*pth == th) {
- *pth = th->join_list_next;
- break;
- }
- pth = &(*pth)->join_list_next;
- }
- }
-
- return Qnil;
-}
-
-static VALUE
-thread_join_sleep(VALUE arg)
-{
- struct join_arg *p = (struct join_arg *)arg;
- rb_thread_t *target_th = p->target, *th = p->waiting;
- double now, limit = p->limit;
-
- while (target_th->status != THREAD_KILLED) {
- if (p->forever) {
- sleep_forever(th, 1);
- }
- else {
- now = timeofday();
- if (now > limit) {
- thread_debug("thread_join: timeout (thid: %p)\n",
- (void *)target_th->thread_id);
- return Qfalse;
- }
- sleep_wait_for_interrupt(th, limit - now);
- }
- thread_debug("thread_join: interrupted (thid: %p)\n",
- (void *)target_th->thread_id);
- }
- return Qtrue;
-}
-
-static VALUE
-thread_join(rb_thread_t *target_th, double delay)
-{
- rb_thread_t *th = GET_THREAD();
- struct join_arg arg;
-
- arg.target = target_th;
- arg.waiting = th;
- arg.limit = timeofday() + delay;
- arg.forever = delay == DELAY_INFTY;
-
- thread_debug("thread_join (thid: %p)\n", (void *)target_th->thread_id);
-
- if (target_th->status != THREAD_KILLED) {
- th->join_list_next = target_th->join_list_head;
- target_th->join_list_head = th;
- if (!rb_ensure(thread_join_sleep, (VALUE)&arg,
- remove_from_join_list, (VALUE)&arg)) {
- return Qnil;
- }
- }
-
- thread_debug("thread_join: success (thid: %p)\n",
- (void *)target_th->thread_id);
-
- if (target_th->errinfo != Qnil) {
- VALUE err = target_th->errinfo;
-
- if (FIXNUM_P(err)) {
- /* */
- }
- else if (TYPE(target_th->errinfo) == T_NODE) {
- rb_exc_raise(rb_vm_make_jump_tag_but_local_jump(
- GET_THROWOBJ_STATE(err), GET_THROWOBJ_VAL(err)));
- }
- else {
- /* normal exception */
- rb_exc_raise(err);
- }
- }
- return target_th->self;
-}
-
-/*
- * call-seq:
- * thr.join => thr
- * thr.join(limit) => thr
- *
- * The calling thread will suspend execution and run <i>thr</i>. Does not
- * return until <i>thr</i> exits or until <i>limit</i> seconds have passed. If
- * the time limit expires, <code>nil</code> will be returned, otherwise
- * <i>thr</i> is returned.
- *
- * Any threads not joined will be killed when the main program exits. If
- * <i>thr</i> had previously raised an exception and the
- * <code>abort_on_exception</code> and <code>$DEBUG</code> flags are not set
- * (so the exception has not yet been processed) it will be processed at this
- * time.
- *
- * a = Thread.new { print "a"; sleep(10); print "b"; print "c" }
- * x = Thread.new { print "x"; Thread.pass; print "y"; print "z" }
- * x.join # Let x thread finish, a will be killed on exit.
- *
- * <em>produces:</em>
- *
- * axyz
- *
- * The following example illustrates the <i>limit</i> parameter.
- *
- * y = Thread.new { 4.times { sleep 0.1; puts 'tick... ' }}
- * puts "Waiting" until y.join(0.15)
- *
- * <em>produces:</em>
- *
- * tick...
- * Waiting
- * tick...
- * Waitingtick...
- *
- *
- * tick...
- */
-
-static VALUE
-thread_join_m(int argc, VALUE *argv, VALUE self)
-{
- rb_thread_t *target_th;
- double delay = DELAY_INFTY;
- VALUE limit;
-
- GetThreadPtr(self, target_th);
-
- rb_scan_args(argc, argv, "01", &limit);
- if (!NIL_P(limit)) {
- delay = rb_num2dbl(limit);
- }
-
- return thread_join(target_th, delay);
-}
-
-/*
- * call-seq:
- * thr.value => obj
- *
- * Waits for <i>thr</i> to complete (via <code>Thread#join</code>) and returns
- * its value.
- *
- * a = Thread.new { 2 + 2 }
- * a.value #=> 4
- */
-
-static VALUE
-thread_value(VALUE self)
-{
- rb_thread_t *th;
- GetThreadPtr(self, th);
- thread_join(th, DELAY_INFTY);
- return th->value;
-}
-
-/*
- * Thread Scheduling
- */
-
-static struct timeval
-double2timeval(double d)
-{
- struct timeval time;
-
- time.tv_sec = (int)d;
- time.tv_usec = (int)((d - (int)d) * 1e6);
- if (time.tv_usec < 0) {
- time.tv_usec += (int)1e6;
- time.tv_sec -= 1;
- }
- return time;
-}
-
-static void
-sleep_forever(rb_thread_t *th, int deadlockable)
-{
- enum rb_thread_status prev_status = th->status;
-
- th->status = deadlockable ? THREAD_STOPPED_FOREVER : THREAD_STOPPED;
- do {
- if (deadlockable) {
- th->vm->sleeper++;
- rb_check_deadlock(th->vm);
- }
- native_sleep(th, 0);
- if (deadlockable) {
- th->vm->sleeper--;
- }
- RUBY_VM_CHECK_INTS();
- } while (th->status == THREAD_STOPPED_FOREVER);
- th->status = prev_status;
-}
-
-static void
-getclockofday(struct timeval *tp)
-{
-#if defined(HAVE_CLOCK_GETTIME) && defined(CLOCK_MONOTONIC)
- struct timespec ts;
-
- if (clock_gettime(CLOCK_MONOTONIC, &ts) == 0) {
- tp->tv_sec = ts.tv_sec;
- tp->tv_usec = ts.tv_nsec / 1000;
- } else
-#endif
- {
- gettimeofday(tp, NULL);
- }
-}
-
-static void
-sleep_timeval(rb_thread_t *th, struct timeval tv)
-{
- struct timeval to, tvn;
- enum rb_thread_status prev_status = th->status;
-
- getclockofday(&to);
- to.tv_sec += tv.tv_sec;
- if ((to.tv_usec += tv.tv_usec) >= 1000000) {
- to.tv_sec++;
- to.tv_usec -= 1000000;
- }
-
- th->status = THREAD_STOPPED;
- do {
- native_sleep(th, &tv);
- RUBY_VM_CHECK_INTS();
- getclockofday(&tvn);
- if (to.tv_sec < tvn.tv_sec) break;
- if (to.tv_sec == tvn.tv_sec && to.tv_usec <= tvn.tv_usec) break;
- thread_debug("sleep_timeval: %ld.%.6ld > %ld.%.6ld\n",
- (long)to.tv_sec, (long)to.tv_usec,
- (long)tvn.tv_sec, (long)tvn.tv_usec);
- tv.tv_sec = to.tv_sec - tvn.tv_sec;
- if ((tv.tv_usec = to.tv_usec - tvn.tv_usec) < 0) {
- --tv.tv_sec;
- tv.tv_usec += 1000000;
- }
- } while (th->status == THREAD_STOPPED);
- th->status = prev_status;
-}
-
-void
-rb_thread_sleep_forever(void)
-{
- thread_debug("rb_thread_sleep_forever\n");
- sleep_forever(GET_THREAD(), 0);
-}
-
-static void
-rb_thread_sleep_deadly(void)
-{
- thread_debug("rb_thread_sleep_deadly\n");
- sleep_forever(GET_THREAD(), 1);
-}
-
-static double
-timeofday(void)
-{
-#if defined(HAVE_CLOCK_GETTIME) && defined(CLOCK_MONOTONIC)
- struct timespec tp;
-
- if (clock_gettime(CLOCK_MONOTONIC, &tp) == 0) {
- return (double)tp.tv_sec + (double)tp.tv_nsec * 1e-9;
- } else
-#endif
- {
- struct timeval tv;
- gettimeofday(&tv, NULL);
- return (double)tv.tv_sec + (double)tv.tv_usec * 1e-6;
- }
-}
-
-static void
-sleep_wait_for_interrupt(rb_thread_t *th, double sleepsec)
-{
- sleep_timeval(th, double2timeval(sleepsec));
-}
-
-static void
-sleep_for_polling(rb_thread_t *th)
-{
- struct timeval time;
- time.tv_sec = 0;
- time.tv_usec = 100 * 1000; /* 0.1 sec */
- sleep_timeval(th, time);
-}
-
-void
-rb_thread_wait_for(struct timeval time)
-{
- rb_thread_t *th = GET_THREAD();
- sleep_timeval(th, time);
-}
-
-void
-rb_thread_polling(void)
-{
- RUBY_VM_CHECK_INTS();
- if (!rb_thread_alone()) {
- rb_thread_t *th = GET_THREAD();
- sleep_for_polling(th);
- }
-}
-
-/*
- * CAUTION: This function causes thread switching.
- * rb_thread_check_ints() check ruby's interrupts.
- * some interrupt needs thread switching/invoke handlers,
- * and so on.
- */
-
-void
-rb_thread_check_ints(void)
-{
- RUBY_VM_CHECK_INTS();
-}
-
-/*
- * Hidden API for tcl/tk wrapper.
- * There is no guarantee to perpetuate it.
- */
-int
-rb_thread_check_trap_pending(void)
-{
- return GET_THREAD()->exec_signal != 0;
-}
-
-/* This function can be called in blocking region. */
-int
-rb_thread_interrupted(VALUE thval)
-{
- rb_thread_t *th;
- GetThreadPtr(thval, th);
- return RUBY_VM_INTERRUPTED(th);
-}
-
-struct timeval rb_time_timeval(VALUE);
-
-void
-rb_thread_sleep(int sec)
-{
- rb_thread_wait_for(rb_time_timeval(INT2FIX(sec)));
-}
-
-void
-rb_thread_schedule(void)
-{
- thread_debug("rb_thread_schedule\n");
- if (!rb_thread_alone()) {
- rb_thread_t *th = GET_THREAD();
-
- thread_debug("rb_thread_schedule/switch start\n");
-
- rb_gc_save_machine_context(th);
- native_mutex_unlock(&th->vm->global_vm_lock);
- {
- native_thread_yield();
- }
- native_mutex_lock(&th->vm->global_vm_lock);
-
- rb_thread_set_current(th);
- thread_debug("rb_thread_schedule/switch done\n");
-
- RUBY_VM_CHECK_INTS();
- }
-}
-
-/* blocking region */
-static inline void
-blocking_region_begin(rb_thread_t *th, struct rb_blocking_region_buffer *region,
- rb_unblock_function_t *func, void *arg)
-{
- region->prev_status = th->status;
- th->blocking_region_buffer = region;
- set_unblock_function(th, func, arg, &region->oldubf);
- th->status = THREAD_STOPPED;
- thread_debug("enter blocking region (%p)\n", (void *)th);
- rb_gc_save_machine_context(th);
- native_mutex_unlock(&th->vm->global_vm_lock);
-}
-
-static inline void
-blocking_region_end(rb_thread_t *th, struct rb_blocking_region_buffer *region)
-{
- native_mutex_lock(&th->vm->global_vm_lock);
- rb_thread_set_current(th);
- thread_debug("leave blocking region (%p)\n", (void *)th);
- remove_signal_thread_list(th);
- th->blocking_region_buffer = 0;
- reset_unblock_function(th, &region->oldubf);
- if (th->status == THREAD_STOPPED) {
- th->status = region->prev_status;
- }
-}
-
-struct rb_blocking_region_buffer *
-rb_thread_blocking_region_begin(void)
-{
- rb_thread_t *th = GET_THREAD();
- struct rb_blocking_region_buffer *region = ALLOC(struct rb_blocking_region_buffer);
- blocking_region_begin(th, region, ubf_select, th);
- return region;
-}
-
-void
-rb_thread_blocking_region_end(struct rb_blocking_region_buffer *region)
-{
- rb_thread_t *th = GET_THREAD();
- blocking_region_end(th, region);
- xfree(region);
- RUBY_VM_CHECK_INTS();
-}
-
-/*
- * rb_thread_blocking_region - permit concurrent/parallel execution.
- *
- * This function does:
- * (1) release GVL.
- * Other Ruby threads may run in parallel.
- * (2) call func with data1.
- * (3) aquire GVL.
- * Other Ruby threads can not run in parallel any more.
- *
- * If another thread interrupts this thread (Thread#kill, signal deliverly,
- * VM-shutdown request, and so on), `ubf()' is called (`ubf()' means
- * "un-blocking function"). `ubf()' should interrupt `func()' execution.
- *
- * There are built-in ubfs and you can specify these ubfs.
- * However, we can not guarantee our built-in ubfs interrupt
- * your `func()' correctly. Be careful to use rb_thread_blocking_region().
- *
- * * RUBY_UBF_IO: ubf for IO operation
- * * RUBY_UBF_PROCESS: ubf for process operation
- *
- * NOTE: You can not execute most of Ruby C API and touch Ruby objects
- * in `func()' and `ubf()' because current thread doesn't acquire
- * GVL (cause synchronization problem). If you need to do it,
- * read source code of C APIs and confirm by yourself.
- *
- * NOTE: In short, this API is difficult to use safely. I recommend you
- * use other ways if you have. We lack experiences to use this API.
- * Please report your problem related on it.
- *
- * Safe C API:
- * * rb_thread_interrupted() - check interrupt flag
- * * ruby_xalloc(), ruby_xrealloc(), ruby_xfree() -
- * if they called without GVL, acquire GVL automatically.
- */
-VALUE
-rb_thread_blocking_region(
- rb_blocking_function_t *func, void *data1,
- rb_unblock_function_t *ubf, void *data2)
-{
- VALUE val;
- rb_thread_t *th = GET_THREAD();
-
- if (ubf == RUBY_UBF_IO || ubf == RUBY_UBF_PROCESS) {
- ubf = ubf_select;
- data2 = th;
- }
-
- BLOCKING_REGION({
- val = func(data1);
- }, ubf, data2);
-
- return val;
-}
-
-/* alias of rb_thread_blocking_region() */
-
-VALUE
-rb_thread_call_without_gvl(
- rb_blocking_function_t *func, void *data1,
- rb_unblock_function_t *ubf, void *data2)
-{
- return rb_thread_blocking_region(func, data1, ubf, data2);
-}
-
-/*
- * rb_thread_call_with_gvl - re-enter into Ruby world while releasing GVL.
- *
- ***
- *** This API is EXPERIMENTAL!
- *** We do not guarantee that this API remains in ruby 1.9.2 or later.
- ***
- *
- * While releasing GVL using rb_thread_blocking_region() or
- * rb_thread_call_without_gvl(), you can not access Ruby values or invoke methods.
- * If you need to access it, you must use this function rb_thread_call_with_gvl().
- *
- * This function rb_thread_call_with_gvl() does:
- * (1) acquire GVL.
- * (2) call passed function `func'.
- * (3) release GVL.
- * (4) return a value which is returned at (2).
- *
- * NOTE: You should not return Ruby object at (2) because such Object
- * will not marked.
- *
- * NOTE: If an exception is raised in `func', this function "DOES NOT"
- * protect (catch) the exception. If you have any resources
- * which should free before throwing exception, you need use
- * rb_protect() in `func' and return a value which represents
- * exception is raised.
- *
- * NOTE: This functions should not be called by a thread which
- * is not created as Ruby thread (created by Thread.new or so).
- * In other words, this function *DOES NOT* associate
- * NON-Ruby thread to Ruby thread.
- */
-void *
-rb_thread_call_with_gvl(void *(*func)(void *), void *data1)
-{
- rb_thread_t *th = ruby_thread_from_native();
- struct rb_blocking_region_buffer *brb;
- struct rb_unblock_callback prev_unblock;
- void *r;
-
- if (th == 0) {
- /* Error is occurred, but we can't use rb_bug()
- * because this thread is not Ruby's thread.
- * What should we do?
- */
-
- fprintf(stderr, "[BUG] rb_thread_call_with_gvl() is called by non-ruby thread\n");
- exit(1);
- }
-
- brb = (struct rb_blocking_region_buffer *)th->blocking_region_buffer;
- prev_unblock = th->unblock;
-
- if (brb == 0) {
- rb_bug("rb_thread_call_with_gvl: called by a thread which has GVL.");
- }
-
- blocking_region_end(th, brb);
- /* enter to Ruby world: You can access Ruby values, methods and so on. */
- r = (*func)(data1);
- /* levae from Ruby world: You can not access Ruby values, etc. */
- blocking_region_begin(th, brb, prev_unblock.func, prev_unblock.arg);
- return r;
-}
-
-/*
- * ruby_thread_has_gvl_p - check if current native thread has GVL.
- *
- ***
- *** This API is EXPERIMENTAL!
- *** We do not guarantee that this API remains in ruby 1.9.2 or later.
- ***
- */
-
-int
-ruby_thread_has_gvl_p(void)
-{
- rb_thread_t *th = ruby_thread_from_native();
-
- if (th && th->blocking_region_buffer == 0) {
- return 1;
- }
- else {
- return 0;
- }
-}
-
-/*
- * call-seq:
- * Thread.pass => nil
- *
- * Invokes the thread scheduler to pass execution to another thread.
- *
- * a = Thread.new { print "a"; Thread.pass;
- * print "b"; Thread.pass;
- * print "c" }
- * b = Thread.new { print "x"; Thread.pass;
- * print "y"; Thread.pass;
- * print "z" }
- * a.join
- * b.join
- *
- * <em>produces:</em>
- *
- * axbycz
- */
-
-static VALUE
-thread_s_pass(VALUE klass)
-{
- rb_thread_schedule();
- return Qnil;
-}
-
-/*
- *
- */
-
-void
-rb_threadptr_execute_interrupts(rb_thread_t *th)
-{
- if (GET_VM()->main_thread == th) {
- while (rb_signal_buff_size() && !th->exec_signal) native_thread_yield();
- }
-
- if (th->raised_flag) return;
-
- while (th->interrupt_flag) {
- enum rb_thread_status status = th->status;
- int timer_interrupt = th->interrupt_flag & 0x01;
- int finalizer_interrupt = th->interrupt_flag & 0x04;
-
- th->status = THREAD_RUNNABLE;
- th->interrupt_flag = 0;
-
- /* signal handling */
- if (th->exec_signal) {
- int sig = th->exec_signal;
- th->exec_signal = 0;
- rb_signal_exec(th, sig);
- }
-
- /* exception from another thread */
- if (th->thrown_errinfo) {
- VALUE err = th->thrown_errinfo;
- th->thrown_errinfo = 0;
- thread_debug("rb_thread_execute_interrupts: %ld\n", err);
-
- if (err == eKillSignal || err == eTerminateSignal) {
- th->errinfo = INT2FIX(TAG_FATAL);
- TH_JUMP_TAG(th, TAG_FATAL);
- }
- else {
- rb_exc_raise(err);
- }
- }
- th->status = status;
-
- if (finalizer_interrupt) {
- rb_gc_finalize_deferred();
- }
-
- if (timer_interrupt) {
- EXEC_EVENT_HOOK(th, RUBY_EVENT_SWITCH, th->cfp->self, 0, 0);
-
- if (th->slice > 0) {
- th->slice--;
- }
- else {
- reschedule:
- rb_thread_schedule();
- if (th->slice < 0) {
- th->slice++;
- goto reschedule;
- }
- else {
- th->slice = th->priority;
- }
- }
- }
- }
-}
-
-
-void
-rb_gc_mark_threads(void)
-{
- /* TODO: remove */
-}
-
-/*****************************************************/
-
-static void
-rb_threadptr_ready(rb_thread_t *th)
-{
- rb_threadptr_interrupt(th);
-}
-
-static VALUE
-rb_threadptr_raise(rb_thread_t *th, int argc, VALUE *argv)
-{
- VALUE exc;
-
- again:
- if (rb_threadptr_dead(th)) {
- return Qnil;
- }
-
- if (th->thrown_errinfo != 0 || th->raised_flag) {
- rb_thread_schedule();
- goto again;
- }
-
- exc = rb_make_exception(argc, argv);
- th->thrown_errinfo = exc;
- rb_threadptr_ready(th);
- return Qnil;
-}
-
-void
-rb_threadptr_signal_raise(rb_thread_t *th, int sig)
-{
- VALUE argv[2];
-
- argv[0] = rb_eSignal;
- argv[1] = INT2FIX(sig);
- rb_threadptr_raise(th->vm->main_thread, 2, argv);
-}
-
-void
-rb_threadptr_signal_exit(rb_thread_t *th)
-{
- VALUE argv[2];
-
- argv[0] = rb_eSystemExit;
- argv[1] = rb_str_new2("exit");
- rb_threadptr_raise(th->vm->main_thread, 2, argv);
-}
-
-#if defined(POSIX_SIGNAL) && defined(SIGSEGV) && defined(HAVE_SIGALTSTACK)
-#define USE_SIGALTSTACK
-#endif
-
-void
-ruby_thread_stack_overflow(rb_thread_t *th)
-{
- th->raised_flag = 0;
-#ifdef USE_SIGALTSTACK
- th->raised_flag = 0;
- rb_exc_raise(sysstack_error);
-#else
- th->errinfo = sysstack_error;
- TH_JUMP_TAG(th, TAG_RAISE);
-#endif
-}
-
-int
-rb_threadptr_set_raised(rb_thread_t *th)
-{
- if (th->raised_flag & RAISED_EXCEPTION) {
- return 1;
- }
- th->raised_flag |= RAISED_EXCEPTION;
- return 0;
-}
-
-int
-rb_threadptr_reset_raised(rb_thread_t *th)
-{
- if (!(th->raised_flag & RAISED_EXCEPTION)) {
- return 0;
- }
- th->raised_flag &= ~RAISED_EXCEPTION;
- return 1;
-}
-
-void
-rb_thread_fd_close(int fd)
-{
- /* TODO: fix me */
-}
-
-/*
- * call-seq:
- * thr.raise(exception)
- *
- * Raises an exception (see <code>Kernel::raise</code>) from <i>thr</i>. The
- * caller does not have to be <i>thr</i>.
- *
- * Thread.abort_on_exception = true
- * a = Thread.new { sleep(200) }
- * a.raise("Gotcha")
- *
- * <em>produces:</em>
- *
- * prog.rb:3: Gotcha (RuntimeError)
- * from prog.rb:2:in `initialize'
- * from prog.rb:2:in `new'
- * from prog.rb:2
- */
-
-static VALUE
-thread_raise_m(int argc, VALUE *argv, VALUE self)
-{
- rb_thread_t *th;
- GetThreadPtr(self, th);
- rb_threadptr_raise(th, argc, argv);
- return Qnil;
-}
-
-
-/*
- * call-seq:
- * thr.exit => thr or nil
- * thr.kill => thr or nil
- * thr.terminate => thr or nil
- *
- * Terminates <i>thr</i> and schedules another thread to be run. If this thread
- * is already marked to be killed, <code>exit</code> returns the
- * <code>Thread</code>. If this is the main thread, or the last thread, exits
- * the process.
- */
-
-VALUE
-rb_thread_kill(VALUE thread)
-{
- rb_thread_t *th;
-
- GetThreadPtr(thread, th);
-
- if (th != GET_THREAD() && th->safe_level < 4) {
- rb_secure(4);
- }
- if (th->status == THREAD_TO_KILL || th->status == THREAD_KILLED) {
- return thread;
- }
- if (th == th->vm->main_thread) {
- rb_exit(EXIT_SUCCESS);
- }
-
- thread_debug("rb_thread_kill: %p (%p)\n", (void *)th, (void *)th->thread_id);
-
- rb_threadptr_interrupt(th);
- th->thrown_errinfo = eKillSignal;
- th->status = THREAD_TO_KILL;
-
- return thread;
-}
-
-
-/*
- * call-seq:
- * Thread.kill(thread) => thread
- *
- * Causes the given <em>thread</em> to exit (see <code>Thread::exit</code>).
- *
- * count = 0
- * a = Thread.new { loop { count += 1 } }
- * sleep(0.1) #=> 0
- * Thread.kill(a) #=> #<Thread:0x401b3d30 dead>
- * count #=> 93947
- * a.alive? #=> false
- */
-
-static VALUE
-rb_thread_s_kill(VALUE obj, VALUE th)
-{
- return rb_thread_kill(th);
-}
-
-
-/*
- * call-seq:
- * Thread.exit => thread
- *
- * Terminates the currently running thread and schedules another thread to be
- * run. If this thread is already marked to be killed, <code>exit</code>
- * returns the <code>Thread</code>. If this is the main thread, or the last
- * thread, exit the process.
- */
-
-static VALUE
-rb_thread_exit(void)
-{
- return rb_thread_kill(GET_THREAD()->self);
-}
-
-
-/*
- * call-seq:
- * thr.wakeup => thr
- *
- * Marks <i>thr</i> as eligible for scheduling (it may still remain blocked on
- * I/O, however). Does not invoke the scheduler (see <code>Thread#run</code>).
- *
- * c = Thread.new { Thread.stop; puts "hey!" }
- * c.wakeup
- *
- * <em>produces:</em>
- *
- * hey!
- */
-
-VALUE
-rb_thread_wakeup(VALUE thread)
-{
- rb_thread_t *th;
- GetThreadPtr(thread, th);
-
- if (th->status == THREAD_KILLED) {
- rb_raise(rb_eThreadError, "killed thread");
- }
- rb_threadptr_ready(th);
- if (th->status != THREAD_TO_KILL) {
- th->status = THREAD_RUNNABLE;
- }
- return thread;
-}
-
-
-/*
- * call-seq:
- * thr.run => thr
- *
- * Wakes up <i>thr</i>, making it eligible for scheduling.
- *
- * a = Thread.new { puts "a"; Thread.stop; puts "c" }
- * Thread.pass
- * puts "Got here"
- * a.run
- * a.join
- *
- * <em>produces:</em>
- *
- * a
- * Got here
- * c
- */
-
-VALUE
-rb_thread_run(VALUE thread)
-{
- rb_thread_wakeup(thread);
- rb_thread_schedule();
- return thread;
-}
-
-
-/*
- * call-seq:
- * Thread.stop => nil
- *
- * Stops execution of the current thread, putting it into a ``sleep'' state,
- * and schedules execution of another thread.
- *
- * a = Thread.new { print "a"; Thread.stop; print "c" }
- * Thread.pass
- * print "b"
- * a.run
- * a.join
- *
- * <em>produces:</em>
- *
- * abc
- */
-
-VALUE
-rb_thread_stop(void)
-{
- if (rb_thread_alone()) {
- rb_raise(rb_eThreadError,
- "stopping only thread\n\tnote: use sleep to stop forever");
- }
- rb_thread_sleep_deadly();
- return Qnil;
-}
-
-static int
-thread_list_i(st_data_t key, st_data_t val, void *data)
-{
- VALUE ary = (VALUE)data;
- rb_thread_t *th;
- GetThreadPtr((VALUE)key, th);
-
- switch (th->status) {
- case THREAD_RUNNABLE:
- case THREAD_STOPPED:
- case THREAD_STOPPED_FOREVER:
- case THREAD_TO_KILL:
- rb_ary_push(ary, th->self);
- default:
- break;
- }
- return ST_CONTINUE;
-}
-
-/********************************************************************/
-
-/*
- * call-seq:
- * Thread.list => array
- *
- * Returns an array of <code>Thread</code> objects for all threads that are
- * either runnable or stopped.
- *
- * Thread.new { sleep(200) }
- * Thread.new { 1000000.times {|i| i*i } }
- * Thread.new { Thread.stop }
- * Thread.list.each {|t| p t}
- *
- * <em>produces:</em>
- *
- * #<Thread:0x401b3e84 sleep>
- * #<Thread:0x401b3f38 run>
- * #<Thread:0x401b3fb0 sleep>
- * #<Thread:0x401bdf4c run>
- */
-
-VALUE
-rb_thread_list(void)
-{
- VALUE ary = rb_ary_new();
- st_foreach(GET_THREAD()->vm->living_threads, thread_list_i, ary);
- return ary;
-}
-
-VALUE
-rb_thread_current(void)
-{
- return GET_THREAD()->self;
-}
-
-/*
- * call-seq:
- * Thread.current => thread
- *
- * Returns the currently executing thread.
- *
- * Thread.current #=> #<Thread:0x401bdf4c run>
- */
-
-static VALUE
-thread_s_current(VALUE klass)
-{
- return rb_thread_current();
-}
-
-VALUE
-rb_thread_main(void)
-{
- return GET_THREAD()->vm->main_thread->self;
-}
-
-static VALUE
-rb_thread_s_main(VALUE klass)
-{
- return rb_thread_main();
-}
-
-
-/*
- * call-seq:
- * Thread.abort_on_exception => true or false
- *
- * Returns the status of the global ``abort on exception'' condition. The
- * default is <code>false</code>. When set to <code>true</code>, or if the
- * global <code>$DEBUG</code> flag is <code>true</code> (perhaps because the
- * command line option <code>-d</code> was specified) all threads will abort
- * (the process will <code>exit(0)</code>) if an exception is raised in any
- * thread. See also <code>Thread::abort_on_exception=</code>.
- */
-
-static VALUE
-rb_thread_s_abort_exc(void)
-{
- return GET_THREAD()->vm->thread_abort_on_exception ? Qtrue : Qfalse;
-}
-
-
-/*
- * call-seq:
- * Thread.abort_on_exception= boolean => true or false
- *
- * When set to <code>true</code>, all threads will abort if an exception is
- * raised. Returns the new state.
- *
- * Thread.abort_on_exception = true
- * t1 = Thread.new do
- * puts "In new thread"
- * raise "Exception from thread"
- * end
- * sleep(1)
- * puts "not reached"
- *
- * <em>produces:</em>
- *
- * In new thread
- * prog.rb:4: Exception from thread (RuntimeError)
- * from prog.rb:2:in `initialize'
- * from prog.rb:2:in `new'
- * from prog.rb:2
- */
-
-static VALUE
-rb_thread_s_abort_exc_set(VALUE self, VALUE val)
-{
- rb_secure(4);
- GET_THREAD()->vm->thread_abort_on_exception = RTEST(val);
- return val;
-}
-
-
-/*
- * call-seq:
- * thr.abort_on_exception => true or false
- *
- * Returns the status of the thread-local ``abort on exception'' condition for
- * <i>thr</i>. The default is <code>false</code>. See also
- * <code>Thread::abort_on_exception=</code>.
- */
-
-static VALUE
-rb_thread_abort_exc(VALUE thread)
-{
- rb_thread_t *th;
- GetThreadPtr(thread, th);
- return th->abort_on_exception ? Qtrue : Qfalse;
-}
-
-
-/*
- * call-seq:
- * thr.abort_on_exception= boolean => true or false
- *
- * When set to <code>true</code>, causes all threads (including the main
- * program) to abort if an exception is raised in <i>thr</i>. The process will
- * effectively <code>exit(0)</code>.
- */
-
-static VALUE
-rb_thread_abort_exc_set(VALUE thread, VALUE val)
-{
- rb_thread_t *th;
- rb_secure(4);
-
- GetThreadPtr(thread, th);
- th->abort_on_exception = RTEST(val);
- return val;
-}
-
-
-/*
- * call-seq:
- * thr.group => thgrp or nil
- *
- * Returns the <code>ThreadGroup</code> which contains <i>thr</i>, or nil if
- * the thread is not a member of any group.
- *
- * Thread.main.group #=> #<ThreadGroup:0x4029d914>
- */
-
-VALUE
-rb_thread_group(VALUE thread)
-{
- rb_thread_t *th;
- VALUE group;
- GetThreadPtr(thread, th);
- group = th->thgroup;
-
- if (!group) {
- group = Qnil;
- }
- return group;
-}
-
-static const char *
-thread_status_name(enum rb_thread_status status)
-{
- switch (status) {
- case THREAD_RUNNABLE:
- return "run";
- case THREAD_STOPPED:
- case THREAD_STOPPED_FOREVER:
- return "sleep";
- case THREAD_TO_KILL:
- return "aborting";
- case THREAD_KILLED:
- return "dead";
- default:
- return "unknown";
- }
-}
-
-static int
-rb_threadptr_dead(rb_thread_t *th)
-{
- return th->status == THREAD_KILLED;
-}
-
-
-/*
- * call-seq:
- * thr.status => string, false or nil
- *
- * Returns the status of <i>thr</i>: ``<code>sleep</code>'' if <i>thr</i> is
- * sleeping or waiting on I/O, ``<code>run</code>'' if <i>thr</i> is executing,
- * ``<code>aborting</code>'' if <i>thr</i> is aborting, <code>false</code> if
- * <i>thr</i> terminated normally, and <code>nil</code> if <i>thr</i>
- * terminated with an exception.
- *
- * a = Thread.new { raise("die now") }
- * b = Thread.new { Thread.stop }
- * c = Thread.new { Thread.exit }
- * d = Thread.new { sleep }
- * d.kill #=> #<Thread:0x401b3678 aborting>
- * a.status #=> nil
- * b.status #=> "sleep"
- * c.status #=> false
- * d.status #=> "aborting"
- * Thread.current.status #=> "run"
- */
-
-static VALUE
-rb_thread_status(VALUE thread)
-{
- rb_thread_t *th;
- GetThreadPtr(thread, th);
-
- if (rb_threadptr_dead(th)) {
- if (!NIL_P(th->errinfo) && !FIXNUM_P(th->errinfo)
- /* TODO */ ) {
- return Qnil;
- }
- return Qfalse;
- }
- return rb_str_new2(thread_status_name(th->status));
-}
-
-
-/*
- * call-seq:
- * thr.alive? => true or false
- *
- * Returns <code>true</code> if <i>thr</i> is running or sleeping.
- *
- * thr = Thread.new { }
- * thr.join #=> #<Thread:0x401b3fb0 dead>
- * Thread.current.alive? #=> true
- * thr.alive? #=> false
- */
-
-static VALUE
-rb_thread_alive_p(VALUE thread)
-{
- rb_thread_t *th;
- GetThreadPtr(thread, th);
-
- if (rb_threadptr_dead(th))
- return Qfalse;
- return Qtrue;
-}
-
-/*
- * call-seq:
- * thr.stop? => true or false
- *
- * Returns <code>true</code> if <i>thr</i> is dead or sleeping.
- *
- * a = Thread.new { Thread.stop }
- * b = Thread.current
- * a.stop? #=> true
- * b.stop? #=> false
- */
-
-static VALUE
-rb_thread_stop_p(VALUE thread)
-{
- rb_thread_t *th;
- GetThreadPtr(thread, th);
-
- if (rb_threadptr_dead(th))
- return Qtrue;
- if (th->status == THREAD_STOPPED || th->status == THREAD_STOPPED_FOREVER)
- return Qtrue;
- return Qfalse;
-}
-
-/*
- * call-seq:
- * thr.safe_level => integer
- *
- * Returns the safe level in effect for <i>thr</i>. Setting thread-local safe
- * levels can help when implementing sandboxes which run insecure code.
- *
- * thr = Thread.new { $SAFE = 3; sleep }
- * Thread.current.safe_level #=> 0
- * thr.safe_level #=> 3
- */
-
-static VALUE
-rb_thread_safe_level(VALUE thread)
-{
- rb_thread_t *th;
- GetThreadPtr(thread, th);
-
- return INT2NUM(th->safe_level);
-}
-
-/*
- * call-seq:
- * thr.inspect => string
- *
- * Dump the name, id, and status of _thr_ to a string.
- */
-
-static VALUE
-rb_thread_inspect(VALUE thread)
-{
- const char *cname = rb_obj_classname(thread);
- rb_thread_t *th;
- const char *status;
- VALUE str;
-
- GetThreadPtr(thread, th);
- status = thread_status_name(th->status);
- str = rb_sprintf("#<%s:%p %s>", cname, (void *)thread, status);
- OBJ_INFECT(str, thread);
-
- return str;
-}
-
-VALUE
-rb_thread_local_aref(VALUE thread, ID id)
-{
- rb_thread_t *th;
- VALUE val;
-
- GetThreadPtr(thread, th);
- if (rb_safe_level() >= 4 && th != GET_THREAD()) {
- rb_raise(rb_eSecurityError, "Insecure: thread locals");
- }
- if (!th->local_storage) {
- return Qnil;
- }
- if (st_lookup(th->local_storage, id, &val)) {
- return val;
- }
- return Qnil;
-}
-
-/*
- * call-seq:
- * thr[sym] => obj or nil
- *
- * Attribute Reference---Returns the value of a thread-local variable, using
- * either a symbol or a string name. If the specified variable does not exist,
- * returns <code>nil</code>.
- *
- * a = Thread.new { Thread.current["name"] = "A"; Thread.stop }
- * b = Thread.new { Thread.current[:name] = "B"; Thread.stop }
- * c = Thread.new { Thread.current["name"] = "C"; Thread.stop }
- * Thread.list.each {|x| puts "#{x.inspect}: #{x[:name]}" }
- *
- * <em>produces:</em>
- *
- * #<Thread:0x401b3b3c sleep>: C
- * #<Thread:0x401b3bc8 sleep>: B
- * #<Thread:0x401b3c68 sleep>: A
- * #<Thread:0x401bdf4c run>:
- */
-
-static VALUE
-rb_thread_aref(VALUE thread, VALUE id)
-{
- return rb_thread_local_aref(thread, rb_to_id(id));
-}
-
-VALUE
-rb_thread_local_aset(VALUE thread, ID id, VALUE val)
-{
- rb_thread_t *th;
- GetThreadPtr(thread, th);
-
- if (rb_safe_level() >= 4 && th != GET_THREAD()) {
- rb_raise(rb_eSecurityError, "Insecure: can't modify thread locals");
- }
- if (OBJ_FROZEN(thread)) {
- rb_error_frozen("thread locals");
- }
- if (!th->local_storage) {
- th->local_storage = st_init_numtable();
- }
- if (NIL_P(val)) {
- st_delete_wrap(th->local_storage, id);
- return Qnil;
- }
- st_insert(th->local_storage, id, val);
- return val;
-}
-
-/*
- * call-seq:
- * thr[sym] = obj => obj
- *
- * Attribute Assignment---Sets or creates the value of a thread-local variable,
- * using either a symbol or a string. See also <code>Thread#[]</code>.
- */
-
-static VALUE
-rb_thread_aset(VALUE self, ID id, VALUE val)
-{
- return rb_thread_local_aset(self, rb_to_id(id), val);
-}
-
-/*
- * call-seq:
- * thr.key?(sym) => true or false
- *
- * Returns <code>true</code> if the given string (or symbol) exists as a
- * thread-local variable.
- *
- * me = Thread.current
- * me[:oliver] = "a"
- * me.key?(:oliver) #=> true
- * me.key?(:stanley) #=> false
- */
-
-static VALUE
-rb_thread_key_p(VALUE self, VALUE key)
-{
- rb_thread_t *th;
- ID id = rb_to_id(key);
-
- GetThreadPtr(self, th);
-
- if (!th->local_storage) {
- return Qfalse;
- }
- if (st_lookup(th->local_storage, id, 0)) {
- return Qtrue;
- }
- return Qfalse;
-}
-
-static int
-thread_keys_i(ID key, VALUE value, VALUE ary)
-{
- rb_ary_push(ary, ID2SYM(key));
- return ST_CONTINUE;
-}
-
-static int
-vm_living_thread_num(rb_vm_t *vm)
-{
- return vm->living_threads->num_entries;
-}
-
-int
-rb_thread_alone(void)
-{
- int num = 1;
- if (GET_THREAD()->vm->living_threads) {
- num = vm_living_thread_num(GET_THREAD()->vm);
- thread_debug("rb_thread_alone: %d\n", num);
- }
- return num == 1;
-}
-
-/*
- * call-seq:
- * thr.keys => array
- *
- * Returns an an array of the names of the thread-local variables (as Symbols).
- *
- * thr = Thread.new do
- * Thread.current[:cat] = 'meow'
- * Thread.current["dog"] = 'woof'
- * end
- * thr.join #=> #<Thread:0x401b3f10 dead>
- * thr.keys #=> [:dog, :cat]
- */
-
-static VALUE
-rb_thread_keys(VALUE self)
-{
- rb_thread_t *th;
- VALUE ary = rb_ary_new();
- GetThreadPtr(self, th);
-
- if (th->local_storage) {
- st_foreach(th->local_storage, thread_keys_i, ary);
- }
- return ary;
-}
-
-/*
- * call-seq:
- * thr.priority => integer
- *
- * Returns the priority of <i>thr</i>. Default is inherited from the
- * current thread which creating the new thread, or zero for the
- * initial main thread; higher-priority threads will run before
- * lower-priority threads.
- *
- * Thread.current.priority #=> 0
- */
-
-static VALUE
-rb_thread_priority(VALUE thread)
-{
- rb_thread_t *th;
- GetThreadPtr(thread, th);
- return INT2NUM(th->priority);
-}
-
-
-/*
- * call-seq:
- * thr.priority= integer => thr
- *
- * Sets the priority of <i>thr</i> to <i>integer</i>. Higher-priority threads
- * will run before lower-priority threads.
- *
- * count1 = count2 = 0
- * a = Thread.new do
- * loop { count1 += 1 }
- * end
- * a.priority = -1
- *
- * b = Thread.new do
- * loop { count2 += 1 }
- * end
- * b.priority = -2
- * sleep 1 #=> 1
- * count1 #=> 622504
- * count2 #=> 5832
- */
-
-static VALUE
-rb_thread_priority_set(VALUE thread, VALUE prio)
-{
- rb_thread_t *th;
- int priority;
- GetThreadPtr(thread, th);
-
- rb_secure(4);
-
-#if USE_NATIVE_THREAD_PRIORITY
- th->priority = NUM2INT(prio);
- native_thread_apply_priority(th);
-#else
- priority = NUM2INT(prio);
- if (priority > RUBY_THREAD_PRIORITY_MAX) {
- priority = RUBY_THREAD_PRIORITY_MAX;
- }
- else if (priority < RUBY_THREAD_PRIORITY_MIN) {
- priority = RUBY_THREAD_PRIORITY_MIN;
- }
- th->priority = priority;
- th->slice = priority;
-#endif
- return INT2NUM(th->priority);
-}
-
-/* for IO */
-
-#if defined(NFDBITS) && defined(HAVE_RB_FD_INIT)
-
-/*
- * several Unix platforms support file descriptors bigger than FD_SETSIZE
- * in select(2) system call.
- *
- * - Linux 2.2.12 (?)
- * - NetBSD 1.2 (src/sys/kern/sys_generic.c:1.25)
- * select(2) documents how to allocate fd_set dynamically.
- * http://netbsd.gw.com/cgi-bin/man-cgi?select++NetBSD-4.0
- * - FreeBSD 2.2 (src/sys/kern/sys_generic.c:1.19)
- * - OpenBSD 2.0 (src/sys/kern/sys_generic.c:1.4)
- * select(2) documents how to allocate fd_set dynamically.
- * http://www.openbsd.org/cgi-bin/man.cgi?query=select&manpath=OpenBSD+4.4
- * - HP-UX documents how to allocate fd_set dynamically.
- * http://docs.hp.com/en/B2355-60105/select.2.html
- * - Solaris 8 has select_large_fdset
- *
- * When fd_set is not big enough to hold big file descriptors,
- * it should be allocated dynamically.
- * Note that this assumes fd_set is structured as bitmap.
- *
- * rb_fd_init allocates the memory.
- * rb_fd_term free the memory.
- * rb_fd_set may re-allocates bitmap.
- *
- * So rb_fd_set doesn't reject file descriptors bigger than FD_SETSIZE.
- */
-
-void
-rb_fd_init(volatile rb_fdset_t *fds)
-{
- fds->maxfd = 0;
- fds->fdset = ALLOC(fd_set);
- FD_ZERO(fds->fdset);
-}
-
-void
-rb_fd_term(rb_fdset_t *fds)
-{
- if (fds->fdset) xfree(fds->fdset);
- fds->maxfd = 0;
- fds->fdset = 0;
-}
-
-void
-rb_fd_zero(rb_fdset_t *fds)
-{
- if (fds->fdset) {
- MEMZERO(fds->fdset, fd_mask, howmany(fds->maxfd, NFDBITS));
- FD_ZERO(fds->fdset);
- }
-}
-
-static void
-rb_fd_resize(int n, rb_fdset_t *fds)
-{
- size_t m = howmany(n + 1, NFDBITS) * sizeof(fd_mask);
- size_t o = howmany(fds->maxfd, NFDBITS) * sizeof(fd_mask);
-
- if (m < sizeof(fd_set)) m = sizeof(fd_set);
- if (o < sizeof(fd_set)) o = sizeof(fd_set);
-
- if (m > o) {
- fds->fdset = realloc(fds->fdset, m);
- memset((char *)fds->fdset + o, 0, m - o);
- }
- if (n >= fds->maxfd) fds->maxfd = n + 1;
-}
-
-void
-rb_fd_set(int n, rb_fdset_t *fds)
-{
- rb_fd_resize(n, fds);
- FD_SET(n, fds->fdset);
-}
-
-void
-rb_fd_clr(int n, rb_fdset_t *fds)
-{
- if (n >= fds->maxfd) return;
- FD_CLR(n, fds->fdset);
-}
-
-int
-rb_fd_isset(int n, const rb_fdset_t *fds)
-{
- if (n >= fds->maxfd) return 0;
- return FD_ISSET(n, fds->fdset) != 0; /* "!= 0" avoids FreeBSD PR 91421 */
-}
-
-void
-rb_fd_copy(rb_fdset_t *dst, const fd_set *src, int max)
-{
- size_t size = howmany(max, NFDBITS) * sizeof(fd_mask);
-
- if (size < sizeof(fd_set)) size = sizeof(fd_set);
- dst->maxfd = max;
- dst->fdset = realloc(dst->fdset, size);
- memcpy(dst->fdset, src, size);
-}
-
-int
-rb_fd_select(int n, rb_fdset_t *readfds, rb_fdset_t *writefds, rb_fdset_t *exceptfds, struct timeval *timeout)
-{
- fd_set *r = NULL, *w = NULL, *e = NULL;
- if (readfds) {
- rb_fd_resize(n - 1, readfds);
- r = rb_fd_ptr(readfds);
- }
- if (writefds) {
- rb_fd_resize(n - 1, writefds);
- w = rb_fd_ptr(writefds);
- }
- if (exceptfds) {
- rb_fd_resize(n - 1, exceptfds);
- e = rb_fd_ptr(exceptfds);
- }
- return select(n, r, w, e, timeout);
-}
-
-#undef FD_ZERO
-#undef FD_SET
-#undef FD_CLR
-#undef FD_ISSET
-
-#define FD_ZERO(f) rb_fd_zero(f)
-#define FD_SET(i, f) rb_fd_set(i, f)
-#define FD_CLR(i, f) rb_fd_clr(i, f)
-#define FD_ISSET(i, f) rb_fd_isset(i, f)
-
-#elif defined(_WIN32)
-
-void
-rb_fd_init(volatile rb_fdset_t *set)
-{
- set->capa = FD_SETSIZE;
- set->fdset = ALLOC(fd_set);
- FD_ZERO(set->fdset);
-}
-
-void
-rb_fd_term(rb_fdset_t *set)
-{
- xfree(set->fdset);
- set->fdset = NULL;
- set->capa = 0;
-}
-
-void
-rb_fd_set(int fd, rb_fdset_t *set)
-{
- unsigned int i;
- SOCKET s = rb_w32_get_osfhandle(fd);
-
- for (i = 0; i < set->fdset->fd_count; i++) {
- if (set->fdset->fd_array[i] == s) {
- return;
- }
- }
- if (set->fdset->fd_count >= (unsigned)set->capa) {
- set->capa = (set->fdset->fd_count / FD_SETSIZE + 1) * FD_SETSIZE;
- set->fdset = xrealloc(set->fdset, sizeof(unsigned int) + sizeof(SOCKET) * set->capa);
- }
- set->fdset->fd_array[set->fdset->fd_count++] = s;
-}
-
-#undef FD_ZERO
-#undef FD_SET
-#undef FD_CLR
-#undef FD_ISSET
-
-#define FD_ZERO(f) rb_fd_zero(f)
-#define FD_SET(i, f) rb_fd_set(i, f)
-#define FD_CLR(i, f) rb_fd_clr(i, f)
-#define FD_ISSET(i, f) rb_fd_isset(i, f)
-
-#endif
-
-#if defined(__CYGWIN__) || defined(_WIN32)
-static long
-cmp_tv(const struct timeval *a, const struct timeval *b)
-{
- long d = (a->tv_sec - b->tv_sec);
- return (d != 0) ? d : (a->tv_usec - b->tv_usec);
-}
-
-static int
-subtract_tv(struct timeval *rest, const struct timeval *wait)
-{
- while (rest->tv_usec < wait->tv_usec) {
- if (rest->tv_sec <= wait->tv_sec) {
- return 0;
- }
- rest->tv_sec -= 1;
- rest->tv_usec += 1000 * 1000;
- }
- rest->tv_sec -= wait->tv_sec;
- rest->tv_usec -= wait->tv_usec;
- return 1;
-}
-#endif
-
-static int
-do_select(int n, fd_set *read, fd_set *write, fd_set *except,
- struct timeval *timeout)
-{
- int result, lerrno;
- fd_set orig_read, orig_write, orig_except;
-
-#ifndef linux
- double limit = 0;
- struct timeval wait_rest;
-# if defined(__CYGWIN__) || defined(_WIN32)
- struct timeval start_time;
-# endif
-
- if (timeout) {
-# if defined(__CYGWIN__) || defined(_WIN32)
- gettimeofday(&start_time, NULL);
- limit = (double)start_time.tv_sec + (double)start_time.tv_usec*1e-6;
-# else
- limit = timeofday();
-# endif
- limit += (double)timeout->tv_sec+(double)timeout->tv_usec*1e-6;
- wait_rest = *timeout;
- timeout = &wait_rest;
- }
-#endif
-
- if (read) orig_read = *read;
- if (write) orig_write = *write;
- if (except) orig_except = *except;
-
- retry:
- lerrno = 0;
-
-#if defined(__CYGWIN__) || defined(_WIN32)
- {
- int finish = 0;
- /* polling duration: 100ms */
- struct timeval wait_100ms, *wait;
- wait_100ms.tv_sec = 0;
- wait_100ms.tv_usec = 100 * 1000; /* 100 ms */
-
- do {
- wait = (timeout == 0 || cmp_tv(&wait_100ms, timeout) > 0) ? &wait_100ms : timeout;
- BLOCKING_REGION({
- do {
- result = select(n, read, write, except, wait);
- if (result < 0) lerrno = errno;
- if (result != 0) break;
-
- if (read) *read = orig_read;
- if (write) *write = orig_write;
- if (except) *except = orig_except;
- wait = &wait_100ms;
- if (timeout) {
- struct timeval elapsed;
- gettimeofday(&elapsed, NULL);
- subtract_tv(&elapsed, &start_time);
- if (!subtract_tv(timeout, &elapsed)) {
- finish = 1;
- break;
- }
- if (cmp_tv(&wait_100ms, timeout) < 0) wait = timeout;
- }
- } while (__th->interrupt_flag == 0);
- }, 0, 0);
- } while (result == 0 && !finish);
- }
-#else
- BLOCKING_REGION({
- result = select(n, read, write, except, timeout);
- if (result < 0) lerrno = errno;
- }, ubf_select, GET_THREAD());
-#endif
-
- errno = lerrno;
-
- if (result < 0) {
- switch (errno) {
- case EINTR:
-#ifdef ERESTART
- case ERESTART:
-#endif
- if (read) *read = orig_read;
- if (write) *write = orig_write;
- if (except) *except = orig_except;
-#ifndef linux
- if (timeout) {
- double d = limit - timeofday();
-
- wait_rest.tv_sec = (unsigned int)d;
- wait_rest.tv_usec = (int)((d-(double)wait_rest.tv_sec)*1e6);
- if (wait_rest.tv_sec < 0) wait_rest.tv_sec = 0;
- if (wait_rest.tv_usec < 0) wait_rest.tv_usec = 0;
- }
-#endif
- goto retry;
- default:
- break;
- }
- }
- return result;
-}
-
-static void
-rb_thread_wait_fd_rw(int fd, int read)
-{
- int result = 0;
- thread_debug("rb_thread_wait_fd_rw(%d, %s)\n", fd, read ? "read" : "write");
-
- if (fd < 0) {
- rb_raise(rb_eIOError, "closed stream");
- }
- if (rb_thread_alone()) return;
- while (result <= 0) {
- rb_fdset_t set;
- rb_fd_init(&set);
- FD_SET(fd, &set);
-
- if (read) {
- result = do_select(fd + 1, rb_fd_ptr(&set), 0, 0, 0);
- }
- else {
- result = do_select(fd + 1, 0, rb_fd_ptr(&set), 0, 0);
- }
-
- rb_fd_term(&set);
-
- if (result < 0) {
- rb_sys_fail(0);
- }
- }
-
- thread_debug("rb_thread_wait_fd_rw(%d, %s): done\n", fd, read ? "read" : "write");
-}
-
-void
-rb_thread_wait_fd(int fd)
-{
- rb_thread_wait_fd_rw(fd, 1);
-}
-
-int
-rb_thread_fd_writable(int fd)
-{
- rb_thread_wait_fd_rw(fd, 0);
- return Qtrue;
-}
-
-int
-rb_thread_select(int max, fd_set * read, fd_set * write, fd_set * except,
- struct timeval *timeout)
-{
- if (!read && !write && !except) {
- if (!timeout) {
- rb_thread_sleep_forever();
- return 0;
- }
- rb_thread_wait_for(*timeout);
- return 0;
- }
- else {
- return do_select(max, read, write, except, timeout);
- }
-}
-
-
-int
-rb_thread_fd_select(int max, rb_fdset_t * read, rb_fdset_t * write, rb_fdset_t * except,
- struct timeval *timeout)
-{
- fd_set *r = NULL, *w = NULL, *e = NULL;
-
- if (!read && !write && !except) {
- if (!timeout) {
- rb_thread_sleep_forever();
- return 0;
- }
- rb_thread_wait_for(*timeout);
- return 0;
- }
-
- if (read) {
- rb_fd_resize(max - 1, read);
- r = rb_fd_ptr(read);
- }
- if (write) {
- rb_fd_resize(max - 1, write);
- w = rb_fd_ptr(write);
- }
- if (except) {
- rb_fd_resize(max - 1, except);
- e = rb_fd_ptr(except);
- }
- return do_select(max, r, w, e, timeout);
-}
-
-
-/*
- * for GC
- */
-
-#ifdef USE_CONSERVATIVE_STACK_END
-void
-rb_gc_set_stack_end(VALUE **stack_end_p)
-{
- VALUE stack_end;
- *stack_end_p = &stack_end;
-}
-#endif
-
-void
-rb_gc_save_machine_context(rb_thread_t *th)
-{
- SET_MACHINE_STACK_END(&th->machine_stack_end);
- FLUSH_REGISTER_WINDOWS;
-#ifdef __ia64
- th->machine_register_stack_end = rb_ia64_bsp();
-#endif
- setjmp(th->machine_regs);
-}
-
-/*
- *
- */
-
-int rb_get_next_signal(void);
-
-static void
-timer_thread_function(void *arg)
-{
- rb_vm_t *vm = GET_VM(); /* TODO: fix me for Multi-VM */
- int sig;
- rb_thread_t *mth;
-
- /* for time slice */
- RUBY_VM_SET_TIMER_INTERRUPT(vm->running_thread);
-
- /* check signal */
- mth = vm->main_thread;
- if (!mth->exec_signal && (sig = rb_get_next_signal()) > 0) {
- enum rb_thread_status prev_status = mth->status;
- thread_debug("main_thread: %s, sig: %d\n",
- thread_status_name(prev_status), sig);
- mth->exec_signal = sig;
- if (mth->status != THREAD_KILLED) mth->status = THREAD_RUNNABLE;
- rb_threadptr_interrupt(mth);
- mth->status = prev_status;
- }
-
-#if 0
- /* prove profiler */
- if (vm->prove_profile.enable) {
- rb_thread_t *th = vm->running_thread;
-
- if (vm->during_gc) {
- /* GC prove profiling */
- }
- }
-#endif
-}
-
-void
-rb_thread_stop_timer_thread(void)
-{
- if (timer_thread_id && native_stop_timer_thread()) {
- native_thread_join(timer_thread_id);
- timer_thread_id = 0;
- }
-}
-
-void
-rb_thread_reset_timer_thread(void)
-{
- timer_thread_id = 0;
-}
-
-void
-rb_thread_start_timer_thread(void)
-{
- system_working = 1;
- rb_thread_create_timer_thread();
-}
-
-static int
-clear_coverage_i(st_data_t key, st_data_t val, st_data_t dummy)
-{
- int i;
- VALUE lines = (VALUE)val;
-
- for (i = 0; i < RARRAY_LEN(lines); i++) {
- if (RARRAY_PTR(lines)[i] != Qnil) {
- RARRAY_PTR(lines)[i] = INT2FIX(0);
- }
- }
- return ST_CONTINUE;
-}
-
-static void
-clear_coverage(void)
-{
- extern VALUE rb_get_coverages(void);
- VALUE coverages = rb_get_coverages();
- if (RTEST(coverages)) {
- st_foreach(RHASH_TBL(coverages), clear_coverage_i, 0);
- }
-}
-
-static void
-rb_thread_atfork_internal(int (*atfork)(st_data_t, st_data_t, st_data_t))
-{
- rb_thread_t *th = GET_THREAD();
- rb_vm_t *vm = th->vm;
- VALUE thval = th->self;
- vm->main_thread = th;
-
- st_foreach(vm->living_threads, atfork, (st_data_t)th);
- st_clear(vm->living_threads);
- st_insert(vm->living_threads, thval, (st_data_t)th->thread_id);
- vm->sleeper = 0;
- clear_coverage();
-}
-
-static int
-terminate_atfork_i(st_data_t key, st_data_t val, st_data_t current_th)
-{
- VALUE thval = key;
- rb_thread_t *th;
- GetThreadPtr(thval, th);
-
- if (th != (rb_thread_t *)current_th) {
- thread_cleanup_func(th);
- }
- return ST_CONTINUE;
-}
-
-void
-rb_thread_atfork(void)
-{
- rb_thread_atfork_internal(terminate_atfork_i);
- rb_reset_random_seed();
-}
-
-static int
-terminate_atfork_before_exec_i(st_data_t key, st_data_t val, st_data_t current_th)
-{
- VALUE thval = key;
- rb_thread_t *th;
- GetThreadPtr(thval, th);
-
- if (th != (rb_thread_t *)current_th) {
- thread_cleanup_func_before_exec(th);
- }
- return ST_CONTINUE;
-}
-
-void
-rb_thread_atfork_before_exec(void)
-{
- rb_thread_atfork_internal(terminate_atfork_before_exec_i);
-}
-
-struct thgroup {
- int enclosed;
- VALUE group;
-};
-
-/*
- * Document-class: ThreadGroup
- *
- * <code>ThreadGroup</code> provides a means of keeping track of a number of
- * threads as a group. A <code>Thread</code> can belong to only one
- * <code>ThreadGroup</code> at a time; adding a thread to a new group will
- * remove it from any previous group.
- *
- * Newly created threads belong to the same group as the thread from which they
- * were created.
- */
-
-static VALUE thgroup_s_alloc(VALUE);
-static VALUE
-thgroup_s_alloc(VALUE klass)
-{
- VALUE group;
- struct thgroup *data;
-
- group = Data_Make_Struct(klass, struct thgroup, 0, -1, data);
- data->enclosed = 0;
- data->group = group;
-
- return group;
-}
-
-struct thgroup_list_params {
- VALUE ary;
- VALUE group;
-};
-
-static int
-thgroup_list_i(st_data_t key, st_data_t val, st_data_t data)
-{
- VALUE thread = (VALUE)key;
- VALUE ary = ((struct thgroup_list_params *)data)->ary;
- VALUE group = ((struct thgroup_list_params *)data)->group;
- rb_thread_t *th;
- GetThreadPtr(thread, th);
-
- if (th->thgroup == group) {
- rb_ary_push(ary, thread);
- }
- return ST_CONTINUE;
-}
-
-/*
- * call-seq:
- * thgrp.list => array
- *
- * Returns an array of all existing <code>Thread</code> objects that belong to
- * this group.
- *
- * ThreadGroup::Default.list #=> [#<Thread:0x401bdf4c run>]
- */
-
-static VALUE
-thgroup_list(VALUE group)
-{
- VALUE ary = rb_ary_new();
- struct thgroup_list_params param;
-
- param.ary = ary;
- param.group = group;
- st_foreach(GET_THREAD()->vm->living_threads, thgroup_list_i, (st_data_t) & param);
- return ary;
-}
-
-
-/*
- * call-seq:
- * thgrp.enclose => thgrp
- *
- * Prevents threads from being added to or removed from the receiving
- * <code>ThreadGroup</code>. New threads can still be started in an enclosed
- * <code>ThreadGroup</code>.
- *
- * ThreadGroup::Default.enclose #=> #<ThreadGroup:0x4029d914>
- * thr = Thread::new { Thread.stop } #=> #<Thread:0x402a7210 sleep>
- * tg = ThreadGroup::new #=> #<ThreadGroup:0x402752d4>
- * tg.add thr
- *
- * <em>produces:</em>
- *
- * ThreadError: can't move from the enclosed thread group
- */
-
-static VALUE
-thgroup_enclose(VALUE group)
-{
- struct thgroup *data;
-
- Data_Get_Struct(group, struct thgroup, data);
- data->enclosed = 1;
-
- return group;
-}
-
-
-/*
- * call-seq:
- * thgrp.enclosed? => true or false
- *
- * Returns <code>true</code> if <em>thgrp</em> is enclosed. See also
- * ThreadGroup#enclose.
- */
-
-static VALUE
-thgroup_enclosed_p(VALUE group)
-{
- struct thgroup *data;
-
- Data_Get_Struct(group, struct thgroup, data);
- if (data->enclosed)
- return Qtrue;
- return Qfalse;
-}
-
-
-/*
- * call-seq:
- * thgrp.add(thread) => thgrp
- *
- * Adds the given <em>thread</em> to this group, removing it from any other
- * group to which it may have previously belonged.
- *
- * puts "Initial group is #{ThreadGroup::Default.list}"
- * tg = ThreadGroup.new
- * t1 = Thread.new { sleep }
- * t2 = Thread.new { sleep }
- * puts "t1 is #{t1}"
- * puts "t2 is #{t2}"
- * tg.add(t1)
- * puts "Initial group now #{ThreadGroup::Default.list}"
- * puts "tg group now #{tg.list}"
- *
- * <em>produces:</em>
- *
- * Initial group is #<Thread:0x401bdf4c>
- * t1 is #<Thread:0x401b3c90>
- * t2 is #<Thread:0x401b3c18>
- * Initial group now #<Thread:0x401b3c18>#<Thread:0x401bdf4c>
- * tg group now #<Thread:0x401b3c90>
- */
-
-static VALUE
-thgroup_add(VALUE group, VALUE thread)
-{
- rb_thread_t *th;
- struct thgroup *data;
-
- rb_secure(4);
- GetThreadPtr(thread, th);
-
- if (OBJ_FROZEN(group)) {
- rb_raise(rb_eThreadError, "can't move to the frozen thread group");
- }
- Data_Get_Struct(group, struct thgroup, data);
- if (data->enclosed) {
- rb_raise(rb_eThreadError, "can't move to the enclosed thread group");
- }
-
- if (!th->thgroup) {
- return Qnil;
- }
-
- if (OBJ_FROZEN(th->thgroup)) {
- rb_raise(rb_eThreadError, "can't move from the frozen thread group");
- }
- Data_Get_Struct(th->thgroup, struct thgroup, data);
- if (data->enclosed) {
- rb_raise(rb_eThreadError,
- "can't move from the enclosed thread group");
- }
-
- th->thgroup = group;
- return group;
-}
-
-
-/*
- * Document-class: Mutex
- *
- * Mutex implements a simple semaphore that can be used to coordinate access to
- * shared data from multiple concurrent threads.
- *
- * Example:
- *
- * require 'thread'
- * semaphore = Mutex.new
- *
- * a = Thread.new {
- * semaphore.synchronize {
- * # access shared resource
- * }
- * }
- *
- * b = Thread.new {
- * semaphore.synchronize {
- * # access shared resource
- * }
- * }
- *
- */
-
-#define GetMutexPtr(obj, tobj) \
- Data_Get_Struct(obj, mutex_t, tobj)
-
-static const char *mutex_unlock(mutex_t *mutex, rb_thread_t volatile *th);
-
-static void
-mutex_free(void *ptr)
-{
- if (ptr) {
- mutex_t *mutex = ptr;
- if (mutex->th) {
- /* rb_warn("free locked mutex"); */
- const char *err = mutex_unlock(mutex, mutex->th);
- if (err) rb_bug("%s", err);
- }
- native_mutex_destroy(&mutex->lock);
- native_cond_destroy(&mutex->cond);
- }
- ruby_xfree(ptr);
-}
-
-static VALUE
-mutex_alloc(VALUE klass)
-{
- VALUE volatile obj;
- mutex_t *mutex;
-
- obj = Data_Make_Struct(klass, mutex_t, NULL, mutex_free, mutex);
- native_mutex_initialize(&mutex->lock);
- native_cond_initialize(&mutex->cond);
- return obj;
-}
-
-/*
- * call-seq:
- * Mutex.new => mutex
- *
- * Creates a new Mutex
- */
-static VALUE
-mutex_initialize(VALUE self)
-{
- return self;
-}
-
-VALUE
-rb_mutex_new(void)
-{
- return mutex_alloc(rb_cMutex);
-}
-
-/*
- * call-seq:
- * mutex.locked? => true or false
- *
- * Returns +true+ if this lock is currently held by some thread.
- */
-VALUE
-rb_mutex_locked_p(VALUE self)
-{
- mutex_t *mutex;
- GetMutexPtr(self, mutex);
- return mutex->th ? Qtrue : Qfalse;
-}
-
-static void
-mutex_locked(rb_thread_t *th, VALUE self)
-{
- mutex_t *mutex;
- GetMutexPtr(self, mutex);
-
- if (th->keeping_mutexes) {
- mutex->next_mutex = th->keeping_mutexes;
- }
- th->keeping_mutexes = mutex;
-}
-
-/*
- * call-seq:
- * mutex.try_lock => true or false
- *
- * Attempts to obtain the lock and returns immediately. Returns +true+ if the
- * lock was granted.
- */
-VALUE
-rb_mutex_trylock(VALUE self)
-{
- mutex_t *mutex;
- VALUE locked = Qfalse;
- GetMutexPtr(self, mutex);
-
- native_mutex_lock(&mutex->lock);
- if (mutex->th == 0) {
- mutex->th = GET_THREAD();
- locked = Qtrue;
-
- mutex_locked(GET_THREAD(), self);
- }
- native_mutex_unlock(&mutex->lock);
-
- return locked;
-}
-
-static int
-lock_func(rb_thread_t *th, mutex_t *mutex, int last_thread)
-{
- int interrupted = 0;
-#if 0 /* for debug */
- native_thread_yield();
-#endif
-
- native_mutex_lock(&mutex->lock);
- th->transition_for_lock = 0;
- while (mutex->th || (mutex->th = th, 0)) {
- if (last_thread) {
- interrupted = 2;
- break;
- }
-
- mutex->cond_waiting++;
- native_cond_wait(&mutex->cond, &mutex->lock);
- mutex->cond_notified--;
-
- if (RUBY_VM_INTERRUPTED(th)) {
- interrupted = 1;
- break;
- }
- }
- th->transition_for_lock = 1;
- native_mutex_unlock(&mutex->lock);
-
- if (interrupted == 2) native_thread_yield();
-#if 0 /* for debug */
- native_thread_yield();
-#endif
-
- return interrupted;
-}
-
-static void
-lock_interrupt(void *ptr)
-{
- mutex_t *mutex = (mutex_t *)ptr;
- native_mutex_lock(&mutex->lock);
- if (mutex->cond_waiting > 0) {
- native_cond_broadcast(&mutex->cond);
- mutex->cond_notified = mutex->cond_waiting;
- mutex->cond_waiting = 0;
- }
- native_mutex_unlock(&mutex->lock);
-}
-
-/*
- * call-seq:
- * mutex.lock => true or false
- *
- * Attempts to grab the lock and waits if it isn't available.
- * Raises +ThreadError+ if +mutex+ was locked by the current thread.
- */
-VALUE
-rb_mutex_lock(VALUE self)
-{
-
- if (rb_mutex_trylock(self) == Qfalse) {
- mutex_t *mutex;
- rb_thread_t *th = GET_THREAD();
- GetMutexPtr(self, mutex);
-
- if (mutex->th == GET_THREAD()) {
- rb_raise(rb_eThreadError, "deadlock; recursive locking");
- }
-
- while (mutex->th != th) {
- int interrupted;
- enum rb_thread_status prev_status = th->status;
- int last_thread = 0;
- struct rb_unblock_callback oldubf;
-
- set_unblock_function(th, lock_interrupt, mutex, &oldubf);
- th->status = THREAD_STOPPED_FOREVER;
- th->vm->sleeper++;
- th->locking_mutex = self;
- if (vm_living_thread_num(th->vm) == th->vm->sleeper) {
- last_thread = 1;
- }
-
- th->transition_for_lock = 1;
- BLOCKING_REGION_CORE({
- interrupted = lock_func(th, mutex, last_thread);
- });
- th->transition_for_lock = 0;
- remove_signal_thread_list(th);
- reset_unblock_function(th, &oldubf);
-
- th->locking_mutex = Qfalse;
- if (mutex->th && interrupted == 2) {
- rb_check_deadlock(th->vm);
- }
- if (th->status == THREAD_STOPPED_FOREVER) {
- th->status = prev_status;
- }
- th->vm->sleeper--;
-
- if (mutex->th == th) mutex_locked(th, self);
-
- if (interrupted) {
- RUBY_VM_CHECK_INTS();
- }
- }
- }
- return self;
-}
-
-static const char *
-mutex_unlock(mutex_t *mutex, rb_thread_t volatile *th)
-{
- const char *err = NULL;
- mutex_t *th_mutex;
-
- native_mutex_lock(&mutex->lock);
-
- if (mutex->th == 0) {
- err = "Attempt to unlock a mutex which is not locked";
- }
- else if (mutex->th != th) {
- err = "Attempt to unlock a mutex which is locked by another thread";
- }
- else {
- mutex->th = 0;
- if (mutex->cond_waiting > 0) {
- /* waiting thread */
- native_cond_signal(&mutex->cond);
- mutex->cond_waiting--;
- mutex->cond_notified++;
- }
- }
-
- native_mutex_unlock(&mutex->lock);
-
- if (!err) {
- th_mutex = th->keeping_mutexes;
- if (th_mutex == mutex) {
- th->keeping_mutexes = mutex->next_mutex;
- }
- else {
- while (1) {
- mutex_t *tmp_mutex;
- tmp_mutex = th_mutex->next_mutex;
- if (tmp_mutex == mutex) {
- th_mutex->next_mutex = tmp_mutex->next_mutex;
- break;
- }
- th_mutex = tmp_mutex;
- }
- }
- mutex->next_mutex = NULL;
- }
-
- return err;
-}
-
-/*
- * call-seq:
- * mutex.unlock => self
- *
- * Releases the lock.
- * Raises +ThreadError+ if +mutex+ wasn't locked by the current thread.
- */
-VALUE
-rb_mutex_unlock(VALUE self)
-{
- const char *err;
- mutex_t *mutex;
- GetMutexPtr(self, mutex);
-
- err = mutex_unlock(mutex, GET_THREAD());
- if (err) rb_raise(rb_eThreadError, "%s", err);
-
- return self;
-}
-
-static void
-rb_mutex_unlock_all(mutex_t *mutexes, rb_thread_t *th)
-{
- const char *err;
- mutex_t *mutex;
-
- while (mutexes) {
- mutex = mutexes;
- /* rb_warn("mutex #<%p> remains to be locked by terminated thread",
- mutexes); */
- mutexes = mutex->next_mutex;
- err = mutex_unlock(mutex, th);
- if (err) rb_bug("invalid keeping_mutexes: %s", err);
- }
-}
-
-static VALUE
-rb_mutex_sleep_forever(VALUE time)
-{
- rb_thread_sleep_deadly();
- return Qnil;
-}
-
-static VALUE
-rb_mutex_wait_for(VALUE time)
-{
- const struct timeval *t = (struct timeval *)time;
- rb_thread_wait_for(*t);
- return Qnil;
-}
-
-VALUE
-rb_mutex_sleep(VALUE self, VALUE timeout)
-{
- time_t beg, end;
- struct timeval t;
-
- if (!NIL_P(timeout)) {
- t = rb_time_interval(timeout);
- }
- rb_mutex_unlock(self);
- beg = time(0);
- if (NIL_P(timeout)) {
- rb_ensure(rb_mutex_sleep_forever, Qnil, rb_mutex_lock, self);
- }
- else {
- rb_ensure(rb_mutex_wait_for, (VALUE)&t, rb_mutex_lock, self);
- }
- end = time(0) - beg;
- return INT2FIX(end);
-}
-
-/*
- * call-seq:
- * mutex.sleep(timeout = nil) => number
- *
- * Releases the lock and sleeps +timeout+ seconds if it is given and
- * non-nil or forever. Raises +ThreadError+ if +mutex+ wasn't locked by
- * the current thread.
- */
-static VALUE
-mutex_sleep(int argc, VALUE *argv, VALUE self)
-{
- VALUE timeout;
-
- rb_scan_args(argc, argv, "01", &timeout);
- return rb_mutex_sleep(self, timeout);
-}
-
-/*
- * call-seq:
- * mutex.synchronize { ... } => result of the block
- *
- * Obtains a lock, runs the block, and releases the lock when the block
- * completes. See the example under +Mutex+.
- */
-
-VALUE
-rb_mutex_synchronize(VALUE mutex, VALUE (*func)(VALUE arg), VALUE arg)
-{
- rb_mutex_lock(mutex);
- return rb_ensure(func, arg, rb_mutex_unlock, mutex);
-}
-
-/*
- * Document-class: Barrier
- */
-static VALUE
-barrier_alloc(VALUE klass)
-{
- return Data_Wrap_Struct(klass, rb_gc_mark, 0, (void *)mutex_alloc(0));
-}
-
-VALUE
-rb_barrier_new(void)
-{
- VALUE barrier = barrier_alloc(rb_cBarrier);
- rb_mutex_lock((VALUE)DATA_PTR(barrier));
- return barrier;
-}
-
-VALUE
-rb_barrier_wait(VALUE self)
-{
- VALUE mutex = (VALUE)DATA_PTR(self);
- mutex_t *m;
-
- if (!mutex) return Qfalse;
- GetMutexPtr(mutex, m);
- if (m->th == GET_THREAD()) return Qfalse;
- rb_mutex_lock(mutex);
- if (DATA_PTR(self)) return Qtrue;
- rb_mutex_unlock(mutex);
- return Qfalse;
-}
-
-VALUE
-rb_barrier_release(VALUE self)
-{
- return rb_mutex_unlock((VALUE)DATA_PTR(self));
-}
-
-VALUE
-rb_barrier_destroy(VALUE self)
-{
- VALUE mutex = (VALUE)DATA_PTR(self);
- DATA_PTR(self) = 0;
- return rb_mutex_unlock(mutex);
-}
-
-/* variables for recursive traversals */
-static ID recursive_key;
-
-static VALUE
-recursive_check(VALUE hash, VALUE obj, VALUE paired_obj)
-{
- if (NIL_P(hash) || TYPE(hash) != T_HASH) {
- return Qfalse;
- }
- else {
- VALUE sym = ID2SYM(rb_frame_this_func());
- VALUE list = rb_hash_aref(hash, sym);
- VALUE pair_list;
-
- if (NIL_P(list) || TYPE(list) != T_HASH)
- return Qfalse;
- pair_list = rb_hash_lookup2(list, obj, Qundef);
- if (pair_list == Qundef)
- return Qfalse;
- if (paired_obj) {
- if (TYPE(pair_list) != T_HASH) {
- if (pair_list != paired_obj)
- return Qfalse;
- }
- else {
- if (NIL_P(rb_hash_lookup(pair_list, paired_obj)))
- return Qfalse;
- }
- }
- return Qtrue;
- }
-}
-
-static VALUE
-recursive_push(VALUE hash, VALUE obj, VALUE paired_obj)
-{
- VALUE list, sym, pair_list;
-
- sym = ID2SYM(rb_frame_this_func());
- if (NIL_P(hash) || TYPE(hash) != T_HASH) {
- hash = rb_hash_new();
- rb_thread_local_aset(rb_thread_current(), recursive_key, hash);
- list = Qnil;
- }
- else {
- list = rb_hash_aref(hash, sym);
- }
- if (NIL_P(list) || TYPE(list) != T_HASH) {
- list = rb_hash_new();
- rb_hash_aset(hash, sym, list);
- }
- if (!paired_obj) {
- rb_hash_aset(list, obj, Qtrue);
- }
- else if ((pair_list = rb_hash_lookup2(list, obj, Qundef)) == Qundef) {
- rb_hash_aset(list, obj, paired_obj);
- }
- else {
- if (TYPE(pair_list) != T_HASH){
- VALUE other_paired_obj = pair_list;
- pair_list = rb_hash_new();
- rb_hash_aset(pair_list, other_paired_obj, Qtrue);
- rb_hash_aset(list, obj, pair_list);
- }
- rb_hash_aset(pair_list, paired_obj, Qtrue);
- }
- return hash;
-}
-
-static void
-recursive_pop(VALUE hash, VALUE obj, VALUE paired_obj)
-{
- VALUE list, sym, pair_list, symname, thrname;
-
- sym = ID2SYM(rb_frame_this_func());
- if (NIL_P(hash) || TYPE(hash) != T_HASH) {
- symname = rb_inspect(sym);
- thrname = rb_inspect(rb_thread_current());
- rb_raise(rb_eTypeError, "invalid inspect_tbl hash for %s in %s",
- StringValuePtr(symname), StringValuePtr(thrname));
- }
- list = rb_hash_aref(hash, sym);
- if (NIL_P(list) || TYPE(list) != T_HASH) {
- symname = rb_inspect(sym);
- thrname = rb_inspect(rb_thread_current());
- rb_raise(rb_eTypeError, "invalid inspect_tbl list for %s in %s",
- StringValuePtr(symname), StringValuePtr(thrname));
- }
- if (paired_obj) {
- pair_list = rb_hash_lookup2(list, obj, Qundef);
- if (pair_list == Qundef) {
- symname = rb_inspect(sym);
- thrname = rb_inspect(rb_thread_current());
- rb_raise(rb_eTypeError, "invalid inspect_tbl pair_list for %s in %s",
- StringValuePtr(symname), StringValuePtr(thrname));
- }
- if (TYPE(pair_list) == T_HASH) {
- rb_hash_delete(pair_list, paired_obj);
- if (!RHASH_EMPTY_P(pair_list)) {
- return; /* keep hash until is empty */
- }
- }
- }
- rb_hash_delete(list, obj);
-}
-
-static VALUE
-exec_recursive(VALUE (*func) (VALUE, VALUE, int), VALUE obj, VALUE pairid, VALUE arg)
-{
- volatile VALUE hash = rb_thread_local_aref(rb_thread_current(), recursive_key);
- VALUE objid = rb_obj_id(obj);
-
- if (recursive_check(hash, objid, pairid)) {
- return (*func) (obj, arg, Qtrue);
- }
- else {
- VALUE result = Qundef;
- int state;
-
- hash = recursive_push(hash, objid, pairid);
- PUSH_TAG();
- if ((state = EXEC_TAG()) == 0) {
- result = (*func) (obj, arg, Qfalse);
- }
- POP_TAG();
- recursive_pop(hash, objid, pairid);
- if (state)
- JUMP_TAG(state);
- return result;
- }
-}
-
-VALUE
-rb_exec_recursive(VALUE (*func) (VALUE, VALUE, int), VALUE obj, VALUE arg)
-{
- return exec_recursive(func, obj, 0, arg);
-}
-
-VALUE
-rb_exec_recursive_paired(VALUE (*func) (VALUE, VALUE, int), VALUE obj, VALUE paired_obj, VALUE arg)
-{
- return exec_recursive(func, obj, rb_obj_id(paired_obj), arg);
-}
-
-/* tracer */
-
-static rb_event_hook_t *
-alloc_event_hook(rb_event_hook_func_t func, rb_event_flag_t events, VALUE data)
-{
- rb_event_hook_t *hook = ALLOC(rb_event_hook_t);
- hook->func = func;
- hook->flag = events;
- hook->data = data;
- return hook;
-}
-
-static void
-thread_reset_event_flags(rb_thread_t *th)
-{
- rb_event_hook_t *hook = th->event_hooks;
- rb_event_flag_t flag = th->event_flags & RUBY_EVENT_VM;
-
- while (hook) {
- flag |= hook->flag;
- hook = hook->next;
- }
-}
-
-static void
-rb_threadptr_add_event_hook(rb_thread_t *th,
- rb_event_hook_func_t func, rb_event_flag_t events, VALUE data)
-{
- rb_event_hook_t *hook = alloc_event_hook(func, events, data);
- hook->next = th->event_hooks;
- th->event_hooks = hook;
- thread_reset_event_flags(th);
-}
-
-static rb_thread_t *
-thval2thread_t(VALUE thval)
-{
- rb_thread_t *th;
- GetThreadPtr(thval, th);
- return th;
-}
-
-void
-rb_thread_add_event_hook(VALUE thval,
- rb_event_hook_func_t func, rb_event_flag_t events, VALUE data)
-{
- rb_threadptr_add_event_hook(thval2thread_t(thval), func, events, data);
-}
-
-static int
-set_threads_event_flags_i(st_data_t key, st_data_t val, st_data_t flag)
-{
- VALUE thval = key;
- rb_thread_t *th;
- GetThreadPtr(thval, th);
-
- if (flag) {
- th->event_flags |= RUBY_EVENT_VM;
- }
- else {
- th->event_flags &= (~RUBY_EVENT_VM);
- }
- return ST_CONTINUE;
-}
-
-static void
-set_threads_event_flags(int flag)
-{
- st_foreach(GET_VM()->living_threads, set_threads_event_flags_i, (st_data_t) flag);
-}
-
-static inline void
-exec_event_hooks(const rb_event_hook_t *hook, rb_event_flag_t flag, VALUE self, ID id, VALUE klass)
-{
- for (; hook; hook = hook->next) {
- if (flag & hook->flag) {
- (*hook->func)(flag, hook->data, self, id, klass);
- }
- }
-}
-
-void
-rb_threadptr_exec_event_hooks(rb_thread_t *th, rb_event_flag_t flag, VALUE self, ID id, VALUE klass)
-{
- const VALUE errinfo = th->errinfo;
- const rb_event_flag_t wait_event = th->event_flags;
-
- if (self == rb_mRubyVMFrozenCore) return;
- if (wait_event & flag) {
- exec_event_hooks(th->event_hooks, flag, self, id, klass);
- }
- if (wait_event & RUBY_EVENT_VM) {
- exec_event_hooks(th->vm->event_hooks, flag, self, id, klass);
- }
- th->errinfo = errinfo;
-}
-
-void
-rb_add_event_hook(rb_event_hook_func_t func, rb_event_flag_t events, VALUE data)
-{
- rb_event_hook_t *hook = alloc_event_hook(func, events, data);
- rb_vm_t *vm = GET_VM();
-
- hook->next = vm->event_hooks;
- vm->event_hooks = hook;
-
- set_threads_event_flags(1);
-}
-
-static int
-remove_event_hook(rb_event_hook_t **root, rb_event_hook_func_t func)
-{
- rb_event_hook_t *prev = NULL, *hook = *root, *next;
-
- while (hook) {
- next = hook->next;
- if (func == 0 || hook->func == func) {
- if (prev) {
- prev->next = hook->next;
- }
- else {
- *root = hook->next;
- }
- xfree(hook);
- }
- else {
- prev = hook;
- }
- hook = next;
- }
- return -1;
-}
-
-static int
-rb_threadptr_revmove_event_hook(rb_thread_t *th, rb_event_hook_func_t func)
-{
- int ret = remove_event_hook(&th->event_hooks, func);
- thread_reset_event_flags(th);
- return ret;
-}
-
-int
-rb_thread_remove_event_hook(VALUE thval, rb_event_hook_func_t func)
-{
- return rb_threadptr_revmove_event_hook(thval2thread_t(thval), func);
-}
-
-int
-rb_remove_event_hook(rb_event_hook_func_t func)
-{
- rb_vm_t *vm = GET_VM();
- rb_event_hook_t *hook = vm->event_hooks;
- int ret = remove_event_hook(&vm->event_hooks, func);
-
- if (hook != NULL && vm->event_hooks == NULL) {
- set_threads_event_flags(0);
- }
-
- return ret;
-}
-
-static int
-clear_trace_func_i(st_data_t key, st_data_t val, st_data_t flag)
-{
- rb_thread_t *th;
- GetThreadPtr((VALUE)key, th);
- rb_threadptr_revmove_event_hook(th, 0);
- return ST_CONTINUE;
-}
-
-void
-rb_clear_trace_func(void)
-{
- st_foreach(GET_VM()->living_threads, clear_trace_func_i, (st_data_t) 0);
- rb_remove_event_hook(0);
-}
-
-static void call_trace_func(rb_event_flag_t, VALUE data, VALUE self, ID id, VALUE klass);
-
-/*
- * call-seq:
- * set_trace_func(proc) => proc
- * set_trace_func(nil) => nil
- *
- * Establishes _proc_ as the handler for tracing, or disables
- * tracing if the parameter is +nil+. _proc_ takes up
- * to six parameters: an event name, a filename, a line number, an
- * object id, a binding, and the name of a class. _proc_ is
- * invoked whenever an event occurs. Events are: <code>c-call</code>
- * (call a C-language routine), <code>c-return</code> (return from a
- * C-language routine), <code>call</code> (call a Ruby method),
- * <code>class</code> (start a class or module definition),
- * <code>end</code> (finish a class or module definition),
- * <code>line</code> (execute code on a new line), <code>raise</code>
- * (raise an exception), and <code>return</code> (return from a Ruby
- * method). Tracing is disabled within the context of _proc_.
- *
- * class Test
- * def test
- * a = 1
- * b = 2
- * end
- * end
- *
- * set_trace_func proc { |event, file, line, id, binding, classname|
- * printf "%8s %s:%-2d %10s %8s\n", event, file, line, id, classname
- * }
- * t = Test.new
- * t.test
- *
- * line prog.rb:11 false
- * c-call prog.rb:11 new Class
- * c-call prog.rb:11 initialize Object
- * c-return prog.rb:11 initialize Object
- * c-return prog.rb:11 new Class
- * line prog.rb:12 false
- * call prog.rb:2 test Test
- * line prog.rb:3 test Test
- * line prog.rb:4 test Test
- * return prog.rb:4 test Test
- */
-
-static VALUE
-set_trace_func(VALUE obj, VALUE trace)
-{
- rb_remove_event_hook(call_trace_func);
-
- if (NIL_P(trace)) {
- return Qnil;
- }
-
- if (!rb_obj_is_proc(trace)) {
- rb_raise(rb_eTypeError, "trace_func needs to be Proc");
- }
-
- rb_add_event_hook(call_trace_func, RUBY_EVENT_ALL, trace);
- return trace;
-}
-
-static void
-thread_add_trace_func(rb_thread_t *th, VALUE trace)
-{
- if (!rb_obj_is_proc(trace)) {
- rb_raise(rb_eTypeError, "trace_func needs to be Proc");
- }
-
- rb_threadptr_add_event_hook(th, call_trace_func, RUBY_EVENT_ALL, trace);
-}
-
-static VALUE
-thread_add_trace_func_m(VALUE obj, VALUE trace)
-{
- rb_thread_t *th;
- GetThreadPtr(obj, th);
- thread_add_trace_func(th, trace);
- return trace;
-}
-
-static VALUE
-thread_set_trace_func_m(VALUE obj, VALUE trace)
-{
- rb_thread_t *th;
- GetThreadPtr(obj, th);
- rb_threadptr_revmove_event_hook(th, call_trace_func);
-
- if (NIL_P(trace)) {
- return Qnil;
- }
- thread_add_trace_func(th, trace);
- return trace;
-}
-
-static const char *
-get_event_name(rb_event_flag_t event)
-{
- switch (event) {
- case RUBY_EVENT_LINE:
- return "line";
- case RUBY_EVENT_CLASS:
- return "class";
- case RUBY_EVENT_END:
- return "end";
- case RUBY_EVENT_CALL:
- return "call";
- case RUBY_EVENT_RETURN:
- return "return";
- case RUBY_EVENT_C_CALL:
- return "c-call";
- case RUBY_EVENT_C_RETURN:
- return "c-return";
- case RUBY_EVENT_RAISE:
- return "raise";
- default:
- return "unknown";
- }
-}
-
-VALUE ruby_suppress_tracing(VALUE (*func)(VALUE, int), VALUE arg, int always);
-
-struct call_trace_func_args {
- rb_event_flag_t event;
- VALUE proc;
- VALUE self;
- ID id;
- VALUE klass;
-};
-
-static VALUE
-call_trace_proc(VALUE args, int tracing)
-{
- struct call_trace_func_args *p = (struct call_trace_func_args *)args;
- const char *srcfile = rb_sourcefile();
- VALUE eventname = rb_str_new2(get_event_name(p->event));
- VALUE filename = srcfile ? rb_str_new2(srcfile) : Qnil;
- VALUE argv[6];
- int line = rb_sourceline();
- ID id = 0;
- VALUE klass = 0;
-
- if (p->event == RUBY_EVENT_C_CALL ||
- p->event == RUBY_EVENT_C_RETURN) {
- id = p->id;
- klass = p->klass;
- }
- else {
- rb_thread_method_id_and_class(GET_THREAD(), &id, &klass);
- }
- if (id == ID_ALLOCATOR)
- return Qnil;
- if (klass) {
- if (TYPE(klass) == T_ICLASS) {
- klass = RBASIC(klass)->klass;
- }
- else if (FL_TEST(klass, FL_SINGLETON)) {
- klass = rb_iv_get(klass, "__attached__");
- }
- }
-
- argv[0] = eventname;
- argv[1] = filename;
- argv[2] = INT2FIX(line);
- argv[3] = id ? ID2SYM(id) : Qnil;
- argv[4] = (p->self && srcfile) ? rb_binding_new() : Qnil;
- argv[5] = klass ? klass : Qnil;
-
- return rb_proc_call_with_block(p->proc, 6, argv, Qnil);
-}
-
-static void
-call_trace_func(rb_event_flag_t event, VALUE proc, VALUE self, ID id, VALUE klass)
-{
- struct call_trace_func_args args;
-
- args.event = event;
- args.proc = proc;
- args.self = self;
- args.id = id;
- args.klass = klass;
- ruby_suppress_tracing(call_trace_proc, (VALUE)&args, Qfalse);
-}
-
-VALUE
-ruby_suppress_tracing(VALUE (*func)(VALUE, int), VALUE arg, int always)
-{
- rb_thread_t *th = GET_THREAD();
- int state, raised, tracing;
- VALUE result = Qnil;
-
- if ((tracing = th->tracing) != 0 && !always) {
- return Qnil;
- }
- else {
- th->tracing = 1;
- }
-
- raised = rb_threadptr_reset_raised(th);
-
- PUSH_TAG();
- if ((state = EXEC_TAG()) == 0) {
- result = (*func)(arg, tracing);
- }
-
- if (raised) {
- rb_threadptr_set_raised(th);
- }
- POP_TAG();
-
- th->tracing = tracing;
- if (state) {
- JUMP_TAG(state);
- }
-
- return result;
-}
-
-VALUE rb_thread_backtrace(VALUE thval);
-
-static VALUE
-rb_thread_backtrace_m(VALUE thval)
-{
- return rb_thread_backtrace(thval);
-}
-
-/*
- * +Thread+ encapsulates the behavior of a thread of
- * execution, including the main thread of the Ruby script.
- *
- * In the descriptions of the methods in this class, the parameter _sym_
- * refers to a symbol, which is either a quoted string or a
- * +Symbol+ (such as <code>:name</code>).
- */
-
-void
-Init_Thread(void)
-{
-#undef rb_intern
-#define rb_intern(str) rb_intern_const(str)
-
- VALUE cThGroup;
-
- rb_define_singleton_method(rb_cThread, "new", thread_s_new, -1);
- rb_define_singleton_method(rb_cThread, "start", thread_start, -2);
- rb_define_singleton_method(rb_cThread, "fork", thread_start, -2);
- rb_define_singleton_method(rb_cThread, "main", rb_thread_s_main, 0);
- rb_define_singleton_method(rb_cThread, "current", thread_s_current, 0);
- rb_define_singleton_method(rb_cThread, "stop", rb_thread_stop, 0);
- rb_define_singleton_method(rb_cThread, "kill", rb_thread_s_kill, 1);
- rb_define_singleton_method(rb_cThread, "exit", rb_thread_exit, 0);
- rb_define_singleton_method(rb_cThread, "pass", thread_s_pass, 0);
- rb_define_singleton_method(rb_cThread, "list", rb_thread_list, 0);
- rb_define_singleton_method(rb_cThread, "abort_on_exception", rb_thread_s_abort_exc, 0);
- rb_define_singleton_method(rb_cThread, "abort_on_exception=", rb_thread_s_abort_exc_set, 1);
-#if THREAD_DEBUG < 0
- rb_define_singleton_method(rb_cThread, "DEBUG", rb_thread_s_debug, 0);
- rb_define_singleton_method(rb_cThread, "DEBUG=", rb_thread_s_debug_set, 1);
-#endif
-
- rb_define_method(rb_cThread, "initialize", thread_initialize, -2);
- rb_define_method(rb_cThread, "raise", thread_raise_m, -1);
- rb_define_method(rb_cThread, "join", thread_join_m, -1);
- rb_define_method(rb_cThread, "value", thread_value, 0);
- rb_define_method(rb_cThread, "kill", rb_thread_kill, 0);
- rb_define_method(rb_cThread, "terminate", rb_thread_kill, 0);
- rb_define_method(rb_cThread, "exit", rb_thread_kill, 0);
- rb_define_method(rb_cThread, "run", rb_thread_run, 0);
- rb_define_method(rb_cThread, "wakeup", rb_thread_wakeup, 0);
- rb_define_method(rb_cThread, "[]", rb_thread_aref, 1);
- rb_define_method(rb_cThread, "[]=", rb_thread_aset, 2);
- rb_define_method(rb_cThread, "key?", rb_thread_key_p, 1);
- rb_define_method(rb_cThread, "keys", rb_thread_keys, 0);
- rb_define_method(rb_cThread, "priority", rb_thread_priority, 0);
- rb_define_method(rb_cThread, "priority=", rb_thread_priority_set, 1);
- rb_define_method(rb_cThread, "status", rb_thread_status, 0);
- rb_define_method(rb_cThread, "alive?", rb_thread_alive_p, 0);
- rb_define_method(rb_cThread, "stop?", rb_thread_stop_p, 0);
- rb_define_method(rb_cThread, "abort_on_exception", rb_thread_abort_exc, 0);
- rb_define_method(rb_cThread, "abort_on_exception=", rb_thread_abort_exc_set, 1);
- rb_define_method(rb_cThread, "safe_level", rb_thread_safe_level, 0);
- rb_define_method(rb_cThread, "group", rb_thread_group, 0);
- rb_define_method(rb_cThread, "backtrace", rb_thread_backtrace_m, 0);
-
- rb_define_method(rb_cThread, "inspect", rb_thread_inspect, 0);
-
- cThGroup = rb_define_class("ThreadGroup", rb_cObject);
- rb_define_alloc_func(cThGroup, thgroup_s_alloc);
- rb_define_method(cThGroup, "list", thgroup_list, 0);
- rb_define_method(cThGroup, "enclose", thgroup_enclose, 0);
- rb_define_method(cThGroup, "enclosed?", thgroup_enclosed_p, 0);
- rb_define_method(cThGroup, "add", thgroup_add, 1);
-
- {
- rb_thread_t *th = GET_THREAD();
- th->thgroup = th->vm->thgroup_default = rb_obj_alloc(cThGroup);
- rb_define_const(cThGroup, "Default", th->thgroup);
- }
-
- rb_cMutex = rb_define_class("Mutex", rb_cObject);
- rb_define_alloc_func(rb_cMutex, mutex_alloc);
- rb_define_method(rb_cMutex, "initialize", mutex_initialize, 0);
- rb_define_method(rb_cMutex, "locked?", rb_mutex_locked_p, 0);
- rb_define_method(rb_cMutex, "try_lock", rb_mutex_trylock, 0);
- rb_define_method(rb_cMutex, "lock", rb_mutex_lock, 0);
- rb_define_method(rb_cMutex, "unlock", rb_mutex_unlock, 0);
- rb_define_method(rb_cMutex, "sleep", mutex_sleep, -1);
-
- recursive_key = rb_intern("__recursive_key__");
- rb_eThreadError = rb_define_class("ThreadError", rb_eStandardError);
-
- /* trace */
- rb_define_global_function("set_trace_func", set_trace_func, 1);
- rb_define_method(rb_cThread, "set_trace_func", thread_set_trace_func_m, 1);
- rb_define_method(rb_cThread, "add_trace_func", thread_add_trace_func_m, 1);
-
- /* init thread core */
- Init_native_thread();
- {
- /* main thread setting */
- {
- /* acquire global vm lock */
- rb_thread_lock_t *lp = &GET_THREAD()->vm->global_vm_lock;
- native_mutex_initialize(lp);
- native_mutex_lock(lp);
- native_mutex_initialize(&GET_THREAD()->interrupt_lock);
- }
- }
-
- rb_thread_create_timer_thread();
-
- (void)native_mutex_trylock;
- (void)ruby_thread_set_native;
-}
-
-int
-ruby_native_thread_p(void)
-{
- rb_thread_t *th = ruby_thread_from_native();
-
- return th ? Qtrue : Qfalse;
-}
-
-static int
-check_deadlock_i(st_data_t key, st_data_t val, int *found)
-{
- VALUE thval = key;
- rb_thread_t *th;
- GetThreadPtr(thval, th);
-
- if (th->status != THREAD_STOPPED_FOREVER || RUBY_VM_INTERRUPTED(th) || th->transition_for_lock) {
- *found = 1;
- }
- else if (th->locking_mutex) {
- mutex_t *mutex;
- GetMutexPtr(th->locking_mutex, mutex);
-
- native_mutex_lock(&mutex->lock);
- if (mutex->th == th || (!mutex->th && mutex->cond_notified)) {
- *found = 1;
- }
- native_mutex_unlock(&mutex->lock);
- }
-
- return (*found) ? ST_STOP : ST_CONTINUE;
-}
-
-#if 0 /* for debug */
-static int
-debug_i(st_data_t key, st_data_t val, int *found)
-{
- VALUE thval = key;
- rb_thread_t *th;
- GetThreadPtr(thval, th);
-
- printf("th:%p %d %d %d", th, th->status, th->interrupt_flag, th->transition_for_lock);
- if (th->locking_mutex) {
- mutex_t *mutex;
- GetMutexPtr(th->locking_mutex, mutex);
-
- native_mutex_lock(&mutex->lock);
- printf(" %p %d\n", mutex->th, mutex->cond_notified);
- native_mutex_unlock(&mutex->lock);
- }
- else puts("");
-
- return ST_CONTINUE;
-}
-#endif
-
-static void
-rb_check_deadlock(rb_vm_t *vm)
-{
- int found = 0;
-
- if (vm_living_thread_num(vm) > vm->sleeper) return;
- if (vm_living_thread_num(vm) < vm->sleeper) rb_bug("sleeper must not be more than vm_living_thread_num(vm)");
-
- st_foreach(vm->living_threads, check_deadlock_i, (st_data_t)&found);
-
- if (!found) {
- VALUE argv[2];
- argv[0] = rb_eFatal;
- argv[1] = rb_str_new2("deadlock detected");
-#if 0 /* for debug */
- printf("%d %d %p %p\n", vm->living_threads->num_entries, vm->sleeper, GET_THREAD(), vm->main_thread);
- st_foreach(vm->living_threads, debug_i, (st_data_t)0);
-#endif
- rb_threadptr_raise(vm->main_thread, 2, argv);
- }
-}
-
-static void
-update_coverage(rb_event_flag_t event, VALUE proc, VALUE self, ID id, VALUE klass)
-{
- VALUE coverage = GET_THREAD()->cfp->iseq->coverage;
- if (coverage && RBASIC(coverage)->klass == 0) {
- long line = rb_sourceline() - 1;
- long count;
- if (RARRAY_PTR(coverage)[line] == Qnil) {
- rb_bug("bug");
- }
- count = FIX2LONG(RARRAY_PTR(coverage)[line]) + 1;
- if (POSFIXABLE(count)) {
- RARRAY_PTR(coverage)[line] = LONG2FIX(count);
- }
- }
-}
-
-VALUE
-rb_get_coverages(void)
-{
- return GET_VM()->coverages;
-}
-
-void
-rb_set_coverages(VALUE coverages)
-{
- GET_VM()->coverages = coverages;
- rb_add_event_hook(update_coverage, RUBY_EVENT_COVERAGE, Qnil);
-}
-
-void
-rb_reset_coverages(void)
-{
- GET_VM()->coverages = Qfalse;
- rb_remove_event_hook(update_coverage);
-}
diff --git a/thread_pthread.c b/thread_pthread.c
deleted file mode 100644
index a4e7f25d75..0000000000
--- a/thread_pthread.c
+++ /dev/null
@@ -1,857 +0,0 @@
-/* -*-c-*- */
-/**********************************************************************
-
- thread_pthread.c -
-
- $Author$
-
- Copyright (C) 2004-2007 Koichi Sasada
-
-**********************************************************************/
-
-#ifdef THREAD_SYSTEM_DEPENDENT_IMPLEMENTATION
-
-#include "gc.h"
-
-#ifdef HAVE_SYS_RESOURCE_H
-#include <sys/resource.h>
-#endif
-
-static void native_mutex_lock(pthread_mutex_t *lock);
-static void native_mutex_unlock(pthread_mutex_t *lock);
-static int native_mutex_trylock(pthread_mutex_t *lock);
-static void native_mutex_initialize(pthread_mutex_t *lock);
-static void native_mutex_destroy(pthread_mutex_t *lock);
-
-static void native_cond_signal(pthread_cond_t *cond);
-static void native_cond_broadcast(pthread_cond_t *cond);
-static void native_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex);
-static void native_cond_initialize(pthread_cond_t *cond);
-static void native_cond_destroy(pthread_cond_t *cond);
-
-static void
-native_mutex_lock(pthread_mutex_t *lock)
-{
- int r;
- if ((r = pthread_mutex_lock(lock)) != 0) {
- rb_bug("pthread_mutex_lock: %d", r);
- }
-}
-
-static void
-native_mutex_unlock(pthread_mutex_t *lock)
-{
- int r;
- if ((r = pthread_mutex_unlock(lock)) != 0) {
- rb_bug("native_mutex_unlock return non-zero: %d", r);
- }
-}
-
-static inline int
-native_mutex_trylock(pthread_mutex_t *lock)
-{
- int r;
- if ((r = pthread_mutex_trylock(lock)) != 0) {
- if (r == EBUSY) {
- return EBUSY;
- }
- else {
- rb_bug("native_mutex_trylock return non-zero: %d", r);
- }
- }
- return 0;
-}
-
-static void
-native_mutex_initialize(pthread_mutex_t *lock)
-{
- int r = pthread_mutex_init(lock, 0);
- if (r != 0) {
- rb_bug("native_mutex_initialize return non-zero: %d", r);
- }
-}
-
-static void
-native_mutex_destroy(pthread_mutex_t *lock)
-{
- int r = pthread_mutex_destroy(lock);
- if (r != 0) {
- rb_bug("native_mutex_destroy return non-zero: %d", r);
- }
-}
-
-static void
-native_cond_initialize(pthread_cond_t *cond)
-{
- int r = pthread_cond_init(cond, 0);
- if (r != 0) {
- rb_bug("native_cond_initialize return non-zero: %d", r);
- }
-}
-
-static void
-native_cond_destroy(pthread_cond_t *cond)
-{
- int r = pthread_cond_destroy(cond);
- if (r != 0) {
- rb_bug("native_cond_destroy return non-zero: %d", r);
- }
-}
-
-static void
-native_cond_signal(pthread_cond_t *cond)
-{
- pthread_cond_signal(cond);
-}
-
-static void
-native_cond_broadcast(pthread_cond_t *cond)
-{
- pthread_cond_broadcast(cond);
-}
-
-static void
-native_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex)
-{
- pthread_cond_wait(cond, mutex);
-}
-
-static int
-native_cond_timedwait(pthread_cond_t *cond, pthread_mutex_t *mutex, struct timespec *ts)
-{
- return pthread_cond_timedwait(cond, mutex, ts);
-}
-
-
-#define native_cleanup_push pthread_cleanup_push
-#define native_cleanup_pop pthread_cleanup_pop
-#ifdef HAVE_SCHED_YIELD
-#define native_thread_yield() (void)sched_yield()
-#else
-#define native_thread_yield() ((void)0)
-#endif
-
-#ifndef __CYGWIN__
-static void add_signal_thread_list(rb_thread_t *th);
-#endif
-static void remove_signal_thread_list(rb_thread_t *th);
-
-static rb_thread_lock_t signal_thread_list_lock;
-
-static pthread_key_t ruby_native_thread_key;
-
-static void
-null_func(int i)
-{
- /* null */
-}
-
-static rb_thread_t *
-ruby_thread_from_native(void)
-{
- return pthread_getspecific(ruby_native_thread_key);
-}
-
-static int
-ruby_thread_set_native(rb_thread_t *th)
-{
- return pthread_setspecific(ruby_native_thread_key, th) == 0;
-}
-
-static void
-Init_native_thread(void)
-{
- rb_thread_t *th = GET_THREAD();
-
- pthread_key_create(&ruby_native_thread_key, NULL);
- th->thread_id = pthread_self();
- native_cond_initialize(&th->native_thread_data.sleep_cond);
- ruby_thread_set_native(th);
- native_mutex_initialize(&signal_thread_list_lock);
- posix_signal(SIGVTALRM, null_func);
-}
-
-static void
-native_thread_destroy(rb_thread_t *th)
-{
- pthread_mutex_destroy(&th->interrupt_lock);
- pthread_cond_destroy(&th->native_thread_data.sleep_cond);
-}
-
-#define USE_THREAD_CACHE 0
-
-#if STACK_GROW_DIRECTION
-#define STACK_GROW_DIR_DETECTION
-#define STACK_DIR_UPPER(a,b) STACK_UPPER(0, a, b)
-#else
-#define STACK_GROW_DIR_DETECTION VALUE stack_grow_dir_detection
-#define STACK_DIR_UPPER(a,b) STACK_UPPER(&stack_grow_dir_detection, a, b)
-#endif
-
-#if defined HAVE_PTHREAD_GETATTR_NP || defined HAVE_PTHREAD_ATTR_GET_NP
-#define STACKADDR_AVAILABLE 1
-#elif defined HAVE_PTHREAD_GET_STACKADDR_NP && defined HAVE_PTHREAD_GET_STACKSIZE_NP
-#define STACKADDR_AVAILABLE 1
-#elif defined HAVE_THR_STKSEGMENT || defined HAVE_PTHREAD_STACKSEG_NP
-#define STACKADDR_AVAILABLE 1
-#endif
-
-#ifdef STACKADDR_AVAILABLE
-static int
-get_stack(void **addr, size_t *size)
-{
-#define CHECK_ERR(expr) \
- {int err = (expr); if (err) return err;}
-#if defined HAVE_PTHREAD_GETATTR_NP || defined HAVE_PTHREAD_ATTR_GET_NP
- pthread_attr_t attr;
- size_t guard = 0;
-
-# ifdef HAVE_PTHREAD_GETATTR_NP
- CHECK_ERR(pthread_getattr_np(pthread_self(), &attr));
-# ifdef HAVE_PTHREAD_ATTR_GETSTACK
- CHECK_ERR(pthread_attr_getstack(&attr, addr, size));
-# else
- CHECK_ERR(pthread_attr_getstackaddr(&attr, addr));
- CHECK_ERR(pthread_attr_getstacksize(&attr, size));
-# endif
- if (pthread_attr_getguardsize(&attr, &guard) == 0) {
- STACK_GROW_DIR_DETECTION;
- STACK_DIR_UPPER((void)0, *addr = (char *)*addr + guard);
- *size -= guard;
- }
-# else
- CHECK_ERR(pthread_attr_init(&attr));
- CHECK_ERR(pthread_attr_get_np(pthread_self(), &attr));
- CHECK_ERR(pthread_attr_getstackaddr(&attr, addr));
- CHECK_ERR(pthread_attr_getstacksize(&attr, size));
-# endif
- CHECK_ERR(pthread_attr_getguardsize(&attr, &guard));
-# ifndef HAVE_PTHREAD_GETATTR_NP
- pthread_attr_destroy(&attr);
-# endif
- size -= guard;
-#elif defined HAVE_PTHREAD_GET_STACKADDR_NP && defined HAVE_PTHREAD_GET_STACKSIZE_NP
- pthread_t th = pthread_self();
- *addr = pthread_get_stackaddr_np(th);
- *size = pthread_get_stacksize_np(th);
-#elif defined HAVE_THR_STKSEGMENT || defined HAVE_PTHREAD_STACKSEG_NP
- stack_t stk;
-# if defined HAVE_THR_STKSEGMENT
- CHECK_ERR(thr_stksegment(&stk));
-# else
- CHECK_ERR(pthread_stackseg_np(pthread_self(), &stk));
-# endif
- *addr = stk.ss_sp;
- *size = stk.ss_size;
-#endif
- return 0;
-#undef CHECK_ERR
-}
-#endif
-
-static struct {
- rb_thread_id_t id;
- size_t stack_maxsize;
- VALUE *stack_start;
-#ifdef __ia64
- VALUE *register_stack_start;
-#endif
-} native_main_thread;
-
-#ifdef STACK_END_ADDRESS
-extern void *STACK_END_ADDRESS;
-#endif
-
-#undef ruby_init_stack
-void
-ruby_init_stack(volatile VALUE *addr
-#ifdef __ia64
- , void *bsp
-#endif
- )
-{
- native_main_thread.id = pthread_self();
-#ifdef STACK_END_ADDRESS
- native_main_thread.stack_start = STACK_END_ADDRESS;
-#else
- if (!native_main_thread.stack_start ||
- STACK_UPPER((VALUE *)(void *)&addr,
- native_main_thread.stack_start > addr,
- native_main_thread.stack_start < addr)) {
- native_main_thread.stack_start = (VALUE *)addr;
- }
-#endif
-#ifdef __ia64
- if (!native_main_thread.register_stack_start ||
- (VALUE*)bsp < native_main_thread.register_stack_start) {
- native_main_thread.register_stack_start = (VALUE*)bsp;
- }
-#endif
-#ifdef HAVE_GETRLIMIT
- {
- struct rlimit rlim;
-
- if (getrlimit(RLIMIT_STACK, &rlim) == 0) {
- size_t space = (size_t)(rlim.rlim_cur/5);
-
- if (space > 1024*1024) space = 1024*1024;
- native_main_thread.stack_maxsize = (size_t)rlim.rlim_cur - space;
- }
- }
-#endif
-}
-
-#define CHECK_ERR(expr) \
- {int err = (expr); if (err) {rb_bug("err: %d - %s", err, #expr);}}
-
-static int
-native_thread_init_stack(rb_thread_t *th)
-{
- rb_thread_id_t curr = pthread_self();
-
- if (pthread_equal(curr, native_main_thread.id)) {
- th->machine_stack_start = native_main_thread.stack_start;
- th->machine_stack_maxsize = native_main_thread.stack_maxsize;
- }
- else {
-#ifdef HAVE_PTHREAD_GETATTR_NP
- pthread_attr_t attr;
- void *start;
- CHECK_ERR(pthread_getattr_np(curr, &attr));
-# if defined HAVE_PTHREAD_ATTR_GETSTACK
- CHECK_ERR(pthread_attr_getstack(&attr, &start, &th->machine_stack_maxsize));
-# elif defined HAVE_PTHREAD_ATTR_GETSTACKSIZE && defined HAVE_PTHREAD_ATTR_GETSTACKADDR
- CHECK_ERR(pthread_attr_getstackaddr(&attr, &start));
- CHECK_ERR(pthread_attr_getstacksize(&attr, &th->machine_stack_maxsize));
-# endif
- th->machine_stack_start = start;
-#else
- rb_raise(rb_eNotImpError, "ruby engine can initialize only in the main thread");
-#endif
- }
-#ifdef __ia64
- th->machine_register_stack_start = native_main_thread.register_stack_start;
- th->machine_stack_maxsize /= 2;
- th->machine_register_stack_maxsize = th->machine_stack_maxsize;
-#endif
- return 0;
-}
-
-static void *
-thread_start_func_1(void *th_ptr)
-{
-#if USE_THREAD_CACHE
- thread_start:
-#endif
- {
- rb_thread_t *th = th_ptr;
- VALUE stack_start;
-
- /* run */
- thread_start_func_2(th, &stack_start, rb_ia64_bsp());
- }
-#if USE_THREAD_CACHE
- if (1) {
- /* cache thread */
- rb_thread_t *th;
- static rb_thread_t *register_cached_thread_and_wait(void);
- if ((th = register_cached_thread_and_wait()) != 0) {
- th_ptr = (void *)th;
- th->thread_id = pthread_self();
- goto thread_start;
- }
- }
-#endif
- return 0;
-}
-
-void rb_thread_create_control_thread(void);
-
-struct cached_thread_entry {
- volatile rb_thread_t **th_area;
- pthread_cond_t *cond;
- struct cached_thread_entry *next;
-};
-
-
-#if USE_THREAD_CACHE
-static pthread_mutex_t thread_cache_lock = PTHREAD_MUTEX_INITIALIZER;
-struct cached_thread_entry *cached_thread_root;
-
-static rb_thread_t *
-register_cached_thread_and_wait(void)
-{
- pthread_cond_t cond = PTHREAD_COND_INITIALIZER;
- volatile rb_thread_t *th_area = 0;
- struct cached_thread_entry *entry =
- (struct cached_thread_entry *)malloc(sizeof(struct cached_thread_entry));
-
- struct timeval tv;
- struct timespec ts;
- gettimeofday(&tv, 0);
- ts.tv_sec = tv.tv_sec + 60;
- ts.tv_nsec = tv.tv_usec * 1000;
-
- pthread_mutex_lock(&thread_cache_lock);
- {
- entry->th_area = &th_area;
- entry->cond = &cond;
- entry->next = cached_thread_root;
- cached_thread_root = entry;
-
- pthread_cond_timedwait(&cond, &thread_cache_lock, &ts);
-
- {
- struct cached_thread_entry *e = cached_thread_root;
- struct cached_thread_entry *prev = cached_thread_root;
-
- while (e) {
- if (e == entry) {
- if (prev == cached_thread_root) {
- cached_thread_root = e->next;
- }
- else {
- prev->next = e->next;
- }
- break;
- }
- prev = e;
- e = e->next;
- }
- }
-
- free(entry); /* ok */
- pthread_cond_destroy(&cond);
- }
- pthread_mutex_unlock(&thread_cache_lock);
-
- return (rb_thread_t *)th_area;
-}
-#endif
-
-static int
-use_cached_thread(rb_thread_t *th)
-{
- int result = 0;
-#if USE_THREAD_CACHE
- struct cached_thread_entry *entry;
-
- if (cached_thread_root) {
- pthread_mutex_lock(&thread_cache_lock);
- entry = cached_thread_root;
- {
- if (cached_thread_root) {
- cached_thread_root = entry->next;
- *entry->th_area = th;
- result = 1;
- }
- }
- if (result) {
- pthread_cond_signal(entry->cond);
- }
- pthread_mutex_unlock(&thread_cache_lock);
- }
-#endif
- return result;
-}
-
-static int
-native_thread_create(rb_thread_t *th)
-{
- int err = 0;
-
- if (use_cached_thread(th)) {
- thread_debug("create (use cached thread): %p\n", (void *)th);
- }
- else {
- pthread_attr_t attr;
-#ifdef __SYMBIAN32__
- size_t stack_size = 64 * 1024; /* 64KB: Let's be slightly more frugal on mobile platform */
-#else
- size_t stack_size = 512 * 1024; /* 512KB */
-#endif
- size_t space;
-
-#ifdef PTHREAD_STACK_MIN
- if (stack_size < PTHREAD_STACK_MIN) {
- stack_size = PTHREAD_STACK_MIN * 2;
- }
-#endif
- space = stack_size/5;
- if (space > 1024*1024) space = 1024*1024;
- th->machine_stack_maxsize = stack_size - space;
-#ifdef __ia64
- th->machine_stack_maxsize /= 2;
- th->machine_register_stack_maxsize = th->machine_stack_maxsize;
-#endif
-
- CHECK_ERR(pthread_attr_init(&attr));
-
-#ifdef PTHREAD_STACK_MIN
- thread_debug("create - stack size: %lu\n", (unsigned long)stack_size);
- CHECK_ERR(pthread_attr_setstacksize(&attr, stack_size));
-#endif
-
-#ifdef HAVE_PTHREAD_ATTR_SETINHERITSCHED
- CHECK_ERR(pthread_attr_setinheritsched(&attr, PTHREAD_INHERIT_SCHED));
-#endif
- CHECK_ERR(pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED));
-
- err = pthread_create(&th->thread_id, &attr, thread_start_func_1, th);
- thread_debug("create: %p (%d)", (void *)th, err);
- CHECK_ERR(pthread_attr_destroy(&attr));
-
- if (!err) {
- pthread_cond_init(&th->native_thread_data.sleep_cond, 0);
- }
- else {
- st_delete_wrap(th->vm->living_threads, th->self);
- th->status = THREAD_KILLED;
- rb_raise(rb_eThreadError, "can't create Thread (%d)", err);
- }
- }
- return err;
-}
-
-static void
-native_thread_join(pthread_t th)
-{
- int err = pthread_join(th, 0);
- if (err) {
- rb_raise(rb_eThreadError, "native_thread_join() failed (%d)", err);
- }
-}
-
-
-#if USE_NATIVE_THREAD_PRIORITY
-
-static void
-native_thread_apply_priority(rb_thread_t *th)
-{
-#if defined(_POSIX_PRIORITY_SCHEDULING) && (_POSIX_PRIORITY_SCHEDULING > 0)
- struct sched_param sp;
- int policy;
- int priority = 0 - th->priority;
- int max, min;
- pthread_getschedparam(th->thread_id, &policy, &sp);
- max = sched_get_priority_max(policy);
- min = sched_get_priority_min(policy);
-
- if (min > priority) {
- priority = min;
- }
- else if (max < priority) {
- priority = max;
- }
-
- sp.sched_priority = priority;
- pthread_setschedparam(th->thread_id, policy, &sp);
-#else
- /* not touched */
-#endif
-}
-
-#endif /* USE_NATIVE_THREAD_PRIORITY */
-
-static void
-ubf_pthread_cond_signal(void *ptr)
-{
- rb_thread_t *th = (rb_thread_t *)ptr;
- thread_debug("ubf_pthread_cond_signal (%p)\n", (void *)th);
- pthread_cond_signal(&th->native_thread_data.sleep_cond);
-}
-
-#if !defined(__CYGWIN__) && !defined(__SYMBIAN32__)
-static void
-ubf_select_each(rb_thread_t *th)
-{
- thread_debug("ubf_select_each (%p)\n", (void *)th->thread_id);
- if (th) {
- pthread_kill(th->thread_id, SIGVTALRM);
- }
-}
-
-static void
-ubf_select(void *ptr)
-{
- rb_thread_t *th = (rb_thread_t *)ptr;
- add_signal_thread_list(th);
- ubf_select_each(th);
-}
-#else
-#define ubf_select 0
-#endif
-
-#define PER_NANO 1000000000
-
-static void
-native_sleep(rb_thread_t *th, struct timeval *tv)
-{
- struct timespec ts;
- struct timeval tvn;
-
- if (tv) {
- gettimeofday(&tvn, NULL);
- ts.tv_sec = tvn.tv_sec + tv->tv_sec;
- ts.tv_nsec = (tvn.tv_usec + tv->tv_usec) * 1000;
- if (ts.tv_nsec >= PER_NANO){
- ts.tv_sec += 1;
- ts.tv_nsec -= PER_NANO;
- }
- }
-
- thread_debug("native_sleep %ld\n", tv ? tv->tv_sec : -1);
- GVL_UNLOCK_BEGIN();
- {
- pthread_mutex_lock(&th->interrupt_lock);
- th->unblock.func = ubf_pthread_cond_signal;
- th->unblock.arg = th;
-
- if (RUBY_VM_INTERRUPTED(th)) {
- /* interrupted. return immediate */
- thread_debug("native_sleep: interrupted before sleep\n");
- }
- else {
- if (tv == 0 || ts.tv_sec < tvn.tv_sec /* overflow */ ) {
- int r;
- thread_debug("native_sleep: pthread_cond_wait start\n");
- r = pthread_cond_wait(&th->native_thread_data.sleep_cond,
- &th->interrupt_lock);
- if (r) rb_bug("pthread_cond_wait: %d", r);
- thread_debug("native_sleep: pthread_cond_wait end\n");
- }
- else {
- int r;
- thread_debug("native_sleep: pthread_cond_timedwait start (%ld, %ld)\n",
- (unsigned long)ts.tv_sec, ts.tv_nsec);
- r = pthread_cond_timedwait(&th->native_thread_data.sleep_cond,
- &th->interrupt_lock, &ts);
- if (r && r != ETIMEDOUT) rb_bug("pthread_cond_timedwait: %d", r);
-
- thread_debug("native_sleep: pthread_cond_timedwait end (%d)\n", r);
- }
- }
- th->unblock.func = 0;
- th->unblock.arg = 0;
-
- pthread_mutex_unlock(&th->interrupt_lock);
- }
- GVL_UNLOCK_END();
-
- thread_debug("native_sleep done\n");
-}
-
-struct signal_thread_list {
- rb_thread_t *th;
- struct signal_thread_list *prev;
- struct signal_thread_list *next;
-};
-
-#ifndef __CYGWIN__
-static struct signal_thread_list signal_thread_list_anchor = {
- 0, 0, 0,
-};
-#endif
-
-#define FGLOCK(lock, body) do { \
- native_mutex_lock(lock); \
- { \
- body; \
- } \
- native_mutex_unlock(lock); \
-} while (0)
-
-#if 0 /* for debug */
-static void
-print_signal_list(char *str)
-{
- struct signal_thread_list *list =
- signal_thread_list_anchor.next;
- thread_debug("list (%s)> ", str);
- while(list){
- thread_debug("%p (%p), ", list->th, list->th->thread_id);
- list = list->next;
- }
- thread_debug("\n");
-}
-#endif
-
-#ifndef __CYGWIN__
-static void
-add_signal_thread_list(rb_thread_t *th)
-{
- if (!th->native_thread_data.signal_thread_list) {
- FGLOCK(&signal_thread_list_lock, {
- struct signal_thread_list *list =
- malloc(sizeof(struct signal_thread_list));
-
- if (list == 0) {
- fprintf(stderr, "[FATAL] failed to allocate memory\n");
- exit(1);
- }
-
- list->th = th;
-
- list->prev = &signal_thread_list_anchor;
- list->next = signal_thread_list_anchor.next;
- if (list->next) {
- list->next->prev = list;
- }
- signal_thread_list_anchor.next = list;
- th->native_thread_data.signal_thread_list = list;
- });
- }
-}
-#endif
-
-static void
-remove_signal_thread_list(rb_thread_t *th)
-{
- if (th->native_thread_data.signal_thread_list) {
- FGLOCK(&signal_thread_list_lock, {
- struct signal_thread_list *list =
- (struct signal_thread_list *)
- th->native_thread_data.signal_thread_list;
-
- list->prev->next = list->next;
- if (list->next) {
- list->next->prev = list->prev;
- }
- th->native_thread_data.signal_thread_list = 0;
- list->th = 0;
- free(list); /* ok */
- });
- }
- else {
- /* */
- }
-}
-
-static pthread_t timer_thread_id;
-static pthread_cond_t timer_thread_cond = PTHREAD_COND_INITIALIZER;
-static pthread_mutex_t timer_thread_lock = PTHREAD_MUTEX_INITIALIZER;
-
-static struct timespec *
-get_ts(struct timespec *ts, unsigned long nsec)
-{
- struct timeval tv;
- gettimeofday(&tv, 0);
- ts->tv_sec = tv.tv_sec;
- ts->tv_nsec = tv.tv_usec * 1000 + nsec;
- if (ts->tv_nsec >= PER_NANO) {
- ts->tv_sec++;
- ts->tv_nsec -= PER_NANO;
- }
- return ts;
-}
-
-static void *
-thread_timer(void *dummy)
-{
- struct timespec ts;
-
- native_mutex_lock(&timer_thread_lock);
- native_cond_broadcast(&timer_thread_cond);
-#define WAIT_FOR_10MS() native_cond_timedwait(&timer_thread_cond, &timer_thread_lock, get_ts(&ts, PER_NANO/100))
- while (system_working > 0) {
- int err = WAIT_FOR_10MS();
- if (err == ETIMEDOUT);
- else if (err == 0 || err == EINTR) {
- if (rb_signal_buff_size() == 0) break;
- }
- else rb_bug("thread_timer/timedwait: %d", err);
-
-#if !defined(__CYGWIN__) && !defined(__SYMBIAN32__)
- if (signal_thread_list_anchor.next) {
- FGLOCK(&signal_thread_list_lock, {
- struct signal_thread_list *list;
- list = signal_thread_list_anchor.next;
- while (list) {
- ubf_select_each(list->th);
- list = list->next;
- }
- });
- }
-#endif
- timer_thread_function(dummy);
- }
- native_mutex_unlock(&timer_thread_lock);
- return NULL;
-}
-
-static void
-rb_thread_create_timer_thread(void)
-{
- rb_enable_interrupt();
-
- if (!timer_thread_id) {
- pthread_attr_t attr;
- int err;
-
- pthread_attr_init(&attr);
-#ifdef PTHREAD_STACK_MIN
- pthread_attr_setstacksize(&attr,
- PTHREAD_STACK_MIN + (THREAD_DEBUG ? BUFSIZ : 0));
-#endif
- native_mutex_lock(&timer_thread_lock);
- err = pthread_create(&timer_thread_id, &attr, thread_timer, 0);
- if (err != 0) {
- native_mutex_unlock(&timer_thread_lock);
- fprintf(stderr, "[FATAL] Failed to create timer thread (errno: %d)\n", err);
- exit(EXIT_FAILURE);
- }
- native_cond_wait(&timer_thread_cond, &timer_thread_lock);
- native_mutex_unlock(&timer_thread_lock);
- }
- rb_disable_interrupt(); /* only timer thread recieve signal */
-}
-
-static int
-native_stop_timer_thread(void)
-{
- int stopped;
- native_mutex_lock(&timer_thread_lock);
- stopped = --system_working <= 0;
- if (stopped) {
- native_cond_signal(&timer_thread_cond);
- }
- native_mutex_unlock(&timer_thread_lock);
- return stopped;
-}
-
-#ifdef HAVE_SIGALTSTACK
-int
-ruby_stack_overflowed_p(const rb_thread_t *th, const void *addr)
-{
- void *base;
- size_t size;
- const size_t water_mark = 1024 * 1024;
- STACK_GROW_DIR_DETECTION;
-
- if (th) {
- size = th->machine_stack_maxsize;
- base = (char *)th->machine_stack_start - STACK_DIR_UPPER(0, size);
- }
-#ifdef STACKADDR_AVAILABLE
- else if (get_stack(&base, &size) == 0) {
- STACK_DIR_UPPER(base = (char *)base + size, (void)0);
- }
-#endif
- else {
- return 0;
- }
- size /= 5;
- if (size > water_mark) size = water_mark;
- if (STACK_DIR_UPPER(1, 0)) {
- if (size > ~(size_t)base+1) size = ~(size_t)base+1;
- if (addr > base && addr <= (void *)((char *)base + size)) return 1;
- }
- else {
- if (size > (size_t)base) size = (size_t)base;
- if (addr > (void *)((char *)base - size) && addr <= base) return 1;
- }
- return 0;
-}
-#endif
-
-#endif /* THREAD_SYSTEM_DEPENDENT_IMPLEMENTATION */
diff --git a/thread_pthread.h b/thread_pthread.h
deleted file mode 100644
index 04254d7312..0000000000
--- a/thread_pthread.h
+++ /dev/null
@@ -1,24 +0,0 @@
-/**********************************************************************
-
- thread_pthread.h -
-
- $Author$
-
- Copyright (C) 2004-2007 Koichi Sasada
-
-**********************************************************************/
-
-#ifndef RUBY_THREAD_PTHREAD_H
-#define RUBY_THREAD_PTHREAD_H
-
-#include <pthread.h>
-typedef pthread_t rb_thread_id_t;
-typedef pthread_mutex_t rb_thread_lock_t;
-typedef pthread_cond_t rb_thread_cond_t;
-
-typedef struct native_thread_data_struct {
- void *signal_thread_list;
- pthread_cond_t sleep_cond;
-} native_thread_data_t;
-
-#endif /* RUBY_THREAD_PTHREAD_H */
diff --git a/thread_win32.c b/thread_win32.c
deleted file mode 100644
index f404a4f312..0000000000
--- a/thread_win32.c
+++ /dev/null
@@ -1,573 +0,0 @@
-/* -*-c-*- */
-/**********************************************************************
-
- thread_win32.c -
-
- $Author$
-
- Copyright (C) 2004-2007 Koichi Sasada
-
-**********************************************************************/
-
-#ifdef THREAD_SYSTEM_DEPENDENT_IMPLEMENTATION
-
-#include <process.h>
-
-#define WIN32_WAIT_TIMEOUT 10 /* 10 ms */
-#undef Sleep
-
-#define native_thread_yield() Sleep(0)
-#define remove_signal_thread_list(th)
-
-static volatile DWORD ruby_native_thread_key = TLS_OUT_OF_INDEXES;
-
-static int native_mutex_lock(rb_thread_lock_t *);
-static int native_mutex_unlock(rb_thread_lock_t *);
-static int native_mutex_trylock(rb_thread_lock_t *);
-static void native_mutex_initialize(rb_thread_lock_t *);
-
-static void native_cond_signal(rb_thread_cond_t *cond);
-static void native_cond_broadcast(rb_thread_cond_t *cond);
-static void native_cond_wait(rb_thread_cond_t *cond, rb_thread_lock_t *mutex);
-static void native_cond_initialize(rb_thread_cond_t *cond);
-static void native_cond_destroy(rb_thread_cond_t *cond);
-
-static rb_thread_t *
-ruby_thread_from_native(void)
-{
- return TlsGetValue(ruby_native_thread_key);
-}
-
-static int
-ruby_thread_set_native(rb_thread_t *th)
-{
- return TlsSetValue(ruby_native_thread_key, th);
-}
-
-static void
-Init_native_thread(void)
-{
- rb_thread_t *th = GET_THREAD();
-
- ruby_native_thread_key = TlsAlloc();
- ruby_thread_set_native(th);
- DuplicateHandle(GetCurrentProcess(),
- GetCurrentThread(),
- GetCurrentProcess(),
- &th->thread_id, 0, FALSE, DUPLICATE_SAME_ACCESS);
-
- th->native_thread_data.interrupt_event = CreateEvent(0, TRUE, FALSE, 0);
-
- thread_debug("initial thread (th: %p, thid: %p, event: %p)\n",
- th, GET_THREAD()->thread_id,
- th->native_thread_data.interrupt_event);
-}
-
-static void
-w32_error(void)
-{
- LPVOID lpMsgBuf;
- FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |
- FORMAT_MESSAGE_FROM_SYSTEM |
- FORMAT_MESSAGE_IGNORE_INSERTS,
- NULL,
- GetLastError(),
- MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
- (LPTSTR) & lpMsgBuf, 0, NULL);
- rb_bug("%s", (char*)lpMsgBuf);
-}
-
-static void
-w32_set_event(HANDLE handle)
-{
- if (SetEvent(handle) == 0) {
- w32_error();
- }
-}
-
-static void
-w32_reset_event(HANDLE handle)
-{
- if (ResetEvent(handle) == 0) {
- w32_error();
- }
-}
-
-static int
-w32_wait_events(HANDLE *events, int count, DWORD timeout, rb_thread_t *th)
-{
- HANDLE *targets = events;
- HANDLE intr;
- DWORD ret;
-
- thread_debug(" w32_wait_events events:%p, count:%d, timeout:%ld, th:%p\n",
- events, count, timeout, th);
- if (th && (intr = th->native_thread_data.interrupt_event)) {
- w32_reset_event(intr);
- if (RUBY_VM_INTERRUPTED(th)) {
- w32_set_event(intr);
- }
-
- targets = ALLOCA_N(HANDLE, count + 1);
- memcpy(targets, events, sizeof(HANDLE) * count);
-
- targets[count++] = intr;
- thread_debug(" * handle: %p (count: %d, intr)\n", intr, count);
- }
-
- thread_debug(" WaitForMultipleObjects start (count: %d)\n", count);
- ret = WaitForMultipleObjects(count, targets, FALSE, timeout);
- thread_debug(" WaitForMultipleObjects end (ret: %lu)\n", ret);
-
- if (ret == WAIT_OBJECT_0 + count - 1 && th) {
- errno = EINTR;
- }
- if (ret == -1 && THREAD_DEBUG) {
- int i;
- DWORD dmy;
- for (i = 0; i < count; i++) {
- thread_debug(" * error handle %d - %s\n", i,
- GetHandleInformation(targets[i], &dmy) ? "OK" : "NG");
- }
- }
- return ret;
-}
-
-static void ubf_handle(void *ptr);
-#define ubf_select ubf_handle
-
-int
-rb_w32_wait_events_blocking(HANDLE *events, int num, DWORD timeout)
-{
- return w32_wait_events(events, num, timeout, GET_THREAD());
-}
-
-int
-rb_w32_wait_events(HANDLE *events, int num, DWORD timeout)
-{
- int ret;
-
- BLOCKING_REGION(ret = rb_w32_wait_events_blocking(events, num, timeout),
- ubf_handle, GET_THREAD());
- return ret;
-}
-
-static void
-w32_close_handle(HANDLE handle)
-{
- if (CloseHandle(handle) == 0) {
- w32_error();
- }
-}
-
-static void
-w32_resume_thread(HANDLE handle)
-{
- if (ResumeThread(handle) == -1) {
- w32_error();
- }
-}
-
-#ifdef _MSC_VER
-#define HAVE__BEGINTHREADEX 1
-#else
-#undef HAVE__BEGINTHREADEX
-#endif
-
-#ifdef HAVE__BEGINTHREADEX
-#define start_thread (HANDLE)_beginthreadex
-typedef unsigned long (_stdcall *w32_thread_start_func)(void*);
-#else
-#define start_thread CreateThread
-typedef LPTHREAD_START_ROUTINE w32_thread_start_func;
-#endif
-
-static HANDLE
-w32_create_thread(DWORD stack_size, w32_thread_start_func func, void *val)
-{
- return start_thread(0, stack_size, func, val, CREATE_SUSPENDED, 0);
-}
-
-int
-rb_w32_sleep(unsigned long msec)
-{
- return w32_wait_events(0, 0, msec, GET_THREAD());
-}
-
-int WINAPI
-rb_w32_Sleep(unsigned long msec)
-{
- int ret;
-
- BLOCKING_REGION(ret = rb_w32_sleep(msec),
- ubf_handle, GET_THREAD());
- return ret;
-}
-
-static void
-native_sleep(rb_thread_t *th, struct timeval *tv)
-{
- DWORD msec;
-
- if (tv) {
- msec = tv->tv_sec * 1000 + tv->tv_usec / 1000;
- }
- else {
- msec = INFINITE;
- }
-
- GVL_UNLOCK_BEGIN();
- {
- DWORD ret;
-
- native_mutex_lock(&th->interrupt_lock);
- th->unblock.func = ubf_handle;
- th->unblock.arg = th;
- native_mutex_unlock(&th->interrupt_lock);
-
- if (RUBY_VM_INTERRUPTED(th)) {
- /* interrupted. return immediate */
- }
- else {
- thread_debug("native_sleep start (%lu)\n", msec);
- ret = w32_wait_events(0, 0, msec, th);
- thread_debug("native_sleep done (%lu)\n", ret);
- }
-
- native_mutex_lock(&th->interrupt_lock);
- th->unblock.func = 0;
- th->unblock.arg = 0;
- native_mutex_unlock(&th->interrupt_lock);
- }
- GVL_UNLOCK_END();
-}
-
-static int
-native_mutex_lock(rb_thread_lock_t *lock)
-{
-#if USE_WIN32_MUTEX
- DWORD result;
- while (1) {
- thread_debug("native_mutex_lock: %p\n", *lock);
- result = w32_wait_events(&*lock, 1, INFINITE, 0);
- switch (result) {
- case WAIT_OBJECT_0:
- /* get mutex object */
- thread_debug("acquire mutex: %p\n", *lock);
- return 0;
- case WAIT_OBJECT_0 + 1:
- /* interrupt */
- errno = EINTR;
- thread_debug("acquire mutex interrupted: %p\n", *lock);
- return 0;
- case WAIT_TIMEOUT:
- thread_debug("timeout mutex: %p\n", *lock);
- break;
- case WAIT_ABANDONED:
- rb_bug("win32_mutex_lock: WAIT_ABANDONED");
- break;
- default:
- rb_bug("win32_mutex_lock: unknown result (%d)", result);
- break;
- }
- }
- return 0;
-#else
- EnterCriticalSection(lock);
- return 0;
-#endif
-}
-
-static int
-native_mutex_unlock(rb_thread_lock_t *lock)
-{
-#if USE_WIN32_MUTEX
- thread_debug("release mutex: %p\n", *lock);
- return ReleaseMutex(*lock);
-#else
- LeaveCriticalSection(lock);
- return 0;
-#endif
-}
-
-static int
-native_mutex_trylock(rb_thread_lock_t *lock)
-{
-#if USE_WIN32_MUTEX
- int result;
- thread_debug("native_mutex_trylock: %p\n", *lock);
- result = w32_wait_events(&*lock, 1, 1, 0);
- thread_debug("native_mutex_trylock result: %d\n", result);
- switch (result) {
- case WAIT_OBJECT_0:
- return 0;
- case WAIT_TIMEOUT:
- return EBUSY;
- }
- return EINVAL;
-#else
- return TryEnterCriticalSection(lock) == 0;
-#endif
-}
-
-static void
-native_mutex_initialize(rb_thread_lock_t *lock)
-{
-#if USE_WIN32_MUTEX
- *lock = CreateMutex(NULL, FALSE, NULL);
- if (*lock == NULL) {
- w32_error();
- }
- /* thread_debug("initialize mutex: %p\n", *lock); */
-#else
- InitializeCriticalSection(lock);
-#endif
-}
-
-static void
-native_mutex_destroy(rb_thread_lock_t *lock)
-{
-#if USE_WIN32_MUTEX
- w32_close_handle(lock);
-#else
- DeleteCriticalSection(lock);
-#endif
-}
-
-struct cond_event_entry {
- struct cond_event_entry* next;
- HANDLE event;
-};
-
-struct rb_thread_cond_struct {
- struct cond_event_entry *next;
- struct cond_event_entry *last;
-};
-
-static void
-native_cond_signal(rb_thread_cond_t *cond)
-{
- /* cond is guarded by mutex */
- struct cond_event_entry *e = cond->next;
-
- if (e) {
- cond->next = e->next;
- SetEvent(e->event);
- }
- else {
- rb_bug("native_cond_signal: no pending threads");
- }
-}
-
-static void
-native_cond_broadcast(rb_thread_cond_t *cond)
-{
- /* cond is guarded by mutex */
- struct cond_event_entry *e = cond->next;
- cond->next = 0;
-
- while (e) {
- SetEvent(e->event);
- e = e->next;
- }
-}
-
-static void
-native_cond_wait(rb_thread_cond_t *cond, rb_thread_lock_t *mutex)
-{
- DWORD r;
- struct cond_event_entry entry;
-
- entry.next = 0;
- entry.event = CreateEvent(0, FALSE, FALSE, 0);
-
- /* cond is guarded by mutex */
- if (cond->next) {
- cond->last->next = &entry;
- cond->last = &entry;
- }
- else {
- cond->next = &entry;
- cond->last = &entry;
- }
-
- native_mutex_unlock(mutex);
- {
- r = WaitForSingleObject(entry.event, INFINITE);
- if (r != WAIT_OBJECT_0) {
- rb_bug("native_cond_wait: WaitForSingleObject returns %lu", r);
- }
- }
- native_mutex_lock(mutex);
-
- w32_close_handle(entry.event);
-}
-
-static void
-native_cond_initialize(rb_thread_cond_t *cond)
-{
- cond->next = 0;
- cond->last = 0;
-}
-
-static void
-native_cond_destroy(rb_thread_cond_t *cond)
-{
- /* */
-}
-
-void
-ruby_init_stack(volatile VALUE *addr)
-{
-}
-
-#define CHECK_ERR(expr) \
- {if (!(expr)) {rb_bug("err: %lu - %s", GetLastError(), #expr);}}
-
-static void
-native_thread_init_stack(rb_thread_t *th)
-{
- MEMORY_BASIC_INFORMATION mi;
- char *base, *end;
- DWORD size, space;
-
- CHECK_ERR(VirtualQuery(&mi, &mi, sizeof(mi)));
- base = mi.AllocationBase;
- end = mi.BaseAddress;
- end += mi.RegionSize;
- size = end - base;
- space = size / 5;
- if (space > 1024*1024) space = 1024*1024;
- th->machine_stack_start = (VALUE *)end - 1;
- th->machine_stack_maxsize = size - space;
-}
-
-static void
-native_thread_destroy(rb_thread_t *th)
-{
- HANDLE intr = th->native_thread_data.interrupt_event;
- native_mutex_destroy(&th->interrupt_lock);
- thread_debug("close handle - intr: %p, thid: %p\n", intr, th->thread_id);
- th->native_thread_data.interrupt_event = 0;
- w32_close_handle(intr);
-}
-
-static unsigned long _stdcall
-thread_start_func_1(void *th_ptr)
-{
- rb_thread_t *th = th_ptr;
- volatile HANDLE thread_id = th->thread_id;
-
- native_thread_init_stack(th);
- th->native_thread_data.interrupt_event = CreateEvent(0, TRUE, FALSE, 0);
-
- /* run */
- thread_debug("thread created (th: %p, thid: %p, event: %p)\n", th,
- th->thread_id, th->native_thread_data.interrupt_event);
-
- thread_start_func_2(th, th->machine_stack_start, rb_ia64_bsp());
-
- w32_close_handle(thread_id);
- thread_debug("thread deleted (th: %p)\n", th);
- return 0;
-}
-
-static int
-native_thread_create(rb_thread_t *th)
-{
- size_t stack_size = 4 * 1024; /* 4KB */
- th->thread_id = w32_create_thread(stack_size, thread_start_func_1, th);
-
- if ((th->thread_id) == 0) {
- st_delete_wrap(th->vm->living_threads, th->self);
- rb_raise(rb_eThreadError, "can't create Thread (%d)", errno);
- }
-
- w32_resume_thread(th->thread_id);
-
- if (THREAD_DEBUG) {
- Sleep(0);
- thread_debug("create: (th: %p, thid: %p, intr: %p), stack size: %d\n",
- th, th->thread_id,
- th->native_thread_data.interrupt_event, stack_size);
- }
- return 0;
-}
-
-static void
-native_thread_join(HANDLE th)
-{
- w32_wait_events(&th, 1, 0, 0);
-}
-
-#if USE_NATIVE_THREAD_PRIORITY
-
-static void
-native_thread_apply_priority(rb_thread_t *th)
-{
- int priority = th->priority;
- if (th->priority > 0) {
- priority = THREAD_PRIORITY_ABOVE_NORMAL;
- }
- else if (th->priority < 0) {
- priority = THREAD_PRIORITY_BELOW_NORMAL;
- }
- else {
- priority = THREAD_PRIORITY_NORMAL;
- }
-
- SetThreadPriority(th->thread_id, priority);
-}
-
-#endif /* USE_NATIVE_THREAD_PRIORITY */
-
-static void
-ubf_handle(void *ptr)
-{
- typedef BOOL (WINAPI *cancel_io_func_t)(HANDLE);
- rb_thread_t *th = (rb_thread_t *)ptr;
- thread_debug("ubf_handle: %p\n", th);
-
- w32_set_event(th->native_thread_data.interrupt_event);
-}
-
-static HANDLE timer_thread_id = 0;
-static HANDLE timer_thread_lock;
-
-static unsigned long _stdcall
-timer_thread_func(void *dummy)
-{
- thread_debug("timer_thread\n");
- while (WaitForSingleObject(timer_thread_lock, WIN32_WAIT_TIMEOUT) ==
- WAIT_TIMEOUT) {
- timer_thread_function(dummy);
- }
- thread_debug("timer killed\n");
- return 0;
-}
-
-static void
-rb_thread_create_timer_thread(void)
-{
- if (timer_thread_id == 0) {
- if (!timer_thread_lock) {
- timer_thread_lock = CreateEvent(0, TRUE, FALSE, 0);
- }
- timer_thread_id = w32_create_thread(1024 + (THREAD_DEBUG ? BUFSIZ : 0),
- timer_thread_func, 0);
- w32_resume_thread(timer_thread_id);
- }
-}
-
-static int
-native_stop_timer_thread(void)
-{
- int stopped = --system_working <= 0;
- if (stopped) {
- CloseHandle(timer_thread_lock);
- timer_thread_lock = 0;
- }
- return stopped;
-}
-
-#endif /* THREAD_SYSTEM_DEPENDENT_IMPLEMENTATION */
diff --git a/thread_win32.h b/thread_win32.h
deleted file mode 100644
index ec2930df12..0000000000
--- a/thread_win32.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/**********************************************************************
-
- thread_win32.h -
-
- $Author$
-
- Copyright (C) 2004-2007 Koichi Sasada
-
-**********************************************************************/
-
-/* interface */
-#ifndef RUBY_THREAD_WIN32_H
-#define RUBY_THREAD_WIN32_H
-
-#include <windows.h>
-
-# ifdef __CYGWIN__
-# undef _WIN32
-# endif
-
-WINBASEAPI BOOL WINAPI
-TryEnterCriticalSection(IN OUT LPCRITICAL_SECTION lpCriticalSection);
-
-typedef HANDLE rb_thread_id_t;
-typedef CRITICAL_SECTION rb_thread_lock_t;
-typedef struct rb_thread_cond_struct rb_thread_cond_t;
-
-typedef struct native_thread_data_struct {
- HANDLE interrupt_event;
-} native_thread_data_t;
-
-#endif /* RUBY_THREAD_WIN32_H */
-
diff --git a/time.c b/time.c
index 74f1f28555..fb1ab30821 100644
--- a/time.c
+++ b/time.c
@@ -3,977 +3,29 @@
time.c -
$Author$
+ $Date$
created at: Tue Dec 28 14:31:59 JST 1993
- Copyright (C) 1993-2007 Yukihiro Matsumoto
+ Copyright (C) 1993-2003 Yukihiro Matsumoto
**********************************************************************/
-#include "ruby/ruby.h"
+#include "ruby.h"
#include <sys/types.h>
#include <time.h>
#include <errno.h>
-#include "ruby/encoding.h"
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
-#include <float.h>
#include <math.h>
-#include "timev.h"
-
-#ifndef TYPEOF_TIMEVAL_TV_SEC
-# define TYPEOF_TIMEVAL_TV_SEC time_t
-#endif
-#ifndef TYPEOF_TIMEVAL_TV_USEC
-# if INT_MAX >= 1000000
-# define TYPEOF_TIMEVAL_TV_USEC int
-# else
-# define TYPEOF_TIMEVAL_TV_USEC long
-# endif
-#endif
-
-#if SIZEOF_TIME_T == SIZEOF_LONG
-typedef unsigned long unsigned_time_t;
-#elif SIZEOF_TIME_T == SIZEOF_INT
-typedef unsigned int unsigned_time_t;
-#elif SIZEOF_TIME_T == SIZEOF_LONG_LONG
-typedef unsigned LONG_LONG unsigned_time_t;
-#else
-# error cannot find integer type which size is same as time_t.
-#endif
-
VALUE rb_cTime;
-static VALUE time_utc_offset _((VALUE));
-
-static long obj2long(VALUE obj);
-static VALUE obj2vint(VALUE obj);
-static int month_arg(VALUE arg);
-static void validate_utc_offset(VALUE utc_offset);
-static void validate_vtm(struct vtm *vtm);
-
-static VALUE time_gmtime(VALUE);
-static VALUE time_localtime(VALUE);
-static VALUE time_fixoff(VALUE);
-
-static time_t timegm_noleapsecond(struct tm *tm);
-static int tmcmp(struct tm *a, struct tm *b);
-static int vtmcmp(struct vtm *a, struct vtm *b);
-static const char *find_time_t(struct tm *tptr, int utc_p, time_t *tp);
-
-static struct vtm *localtimev(VALUE timev, struct vtm *result);
-
-static int leap_year_p(long y);
-#define leap_year_v_p(y) leap_year_p(NUM2LONG(mod(v, INT2FIX(400))))
-
-#define NDIV(x,y) (-(-((x)+1)/(y))-1)
-#define NMOD(x,y) ((y)-(-((x)+1)%(y))-1)
-#define DIV(n,d) ((n)<0 ? NDIV((n),(d)) : (n)/(d))
-
-#ifdef HAVE_GMTIME_R
-#define IF_HAVE_GMTIME_R(x) x
-#define ASCTIME(tm, buf) asctime_r((tm), (buf))
-#define GMTIME(tm, result) gmtime_r((tm), &(result))
-#define LOCALTIME(tm, result) (tzset(),localtime_r((tm), &(result)))
-#else
-#define IF_HAVE_GMTIME_R(x) /* nothing */
-#define ASCTIME(tm, buf) asctime(tm)
-#define GMTIME(tm, result) rb_gmtime((tm), &(result))
-#define LOCALTIME(tm, result) rb_localtime((tm), &(result))
-
-static inline struct tm *
-rb_gmtime(const time_t *tm, struct tm *result)
-{
- struct tm *t = gmtime(tm);
- if (t) *result = *t;
- return t;
-}
-
-static inline struct tm *
-rb_localtime(const time_t *tm, struct tm *result)
-{
- struct tm *t = localtime(tm);
- if (t) *result = *t;
- return t;
-}
-#endif
-
-static ID id_divmod, id_mul, id_submicro, id_subnano;
-static ID id_eq, id_ne, id_quo, id_div, id_cmp, id_lshift;
-
-#define eq(x,y) (rb_funcall((x), id_eq, 1, (y)))
-#define ne(x,y) (rb_funcall((x), id_ne, 1, (y)))
-#define lt(x,y) (RTEST(rb_funcall((x), '<', 1, (y))))
-#define gt(x,y) (RTEST(rb_funcall((x), '>', 1, (y))))
-#define le(x,y) (!gt(x,y))
-#define ge(x,y) (!lt(x,y))
-#define add(x,y) (rb_funcall((x), '+', 1, (y)))
-#define sub(x,y) (rb_funcall((x), '-', 1, (y)))
-#define mul(x,y) (rb_funcall((x), '*', 1, (y)))
-#define div(x,y) (rb_funcall((x), id_div, 1, (y)))
-#define mod(x,y) (rb_funcall((x), '%', 1, (y)))
-#define neg(x) (sub(INT2FIX(0), (x)))
-#define cmp(x,y) (rb_funcall((x), id_cmp, 1, (y)))
-#define lshift(x,y) (rb_funcall((x), id_lshift, 1, (y)))
-
-static VALUE
-quo(VALUE x, VALUE y)
-{
- VALUE ret;
- ret = rb_funcall((x), id_quo, 1, (y));
- if (TYPE(ret) == T_RATIONAL &&
- ((struct RRational *)ret)->den == INT2FIX(1)) {
- ret = ((struct RRational *)ret)->num;
- }
- return ret;
-}
-
-static void
-divmodv(VALUE n, VALUE d, VALUE *q, VALUE *r)
-{
- VALUE tmp, ary;
- tmp = rb_funcall(n, id_divmod, 1, d);
- ary = rb_check_array_type(tmp);
- if (NIL_P(ary)) {
- rb_raise(rb_eTypeError, "unexpected divmod result: into %s",
- rb_obj_classname(tmp));
- }
- *q = rb_ary_entry(ary, 0);
- *r = rb_ary_entry(ary, 1);
-}
-
-static VALUE
-num_exact(VALUE v)
-{
- switch (TYPE(v)) {
- case T_FIXNUM:
- case T_BIGNUM:
- case T_RATIONAL:
- break;
-
- case T_FLOAT:
- v = rb_convert_type(v, T_RATIONAL, "Rational", "to_r");
- break;
-
- case T_NIL:
- goto typeerror;
-
- default: {
- VALUE tmp;
- if (!NIL_P(tmp = rb_check_convert_type(v, T_RATIONAL, "Rational", "to_r")))
- v = tmp;
- else if (!NIL_P(tmp = rb_check_to_integer(v, "to_int")))
- v = tmp;
- else {
- typeerror:
- rb_raise(rb_eTypeError, "can't convert %s into an exact number",
- rb_obj_classname(v));
- }
- break;
- }
- }
- return v;
-}
-
-static const int common_year_yday_offset[] = {
- -1,
- -1 + 31,
- -1 + 31 + 28,
- -1 + 31 + 28 + 31,
- -1 + 31 + 28 + 31 + 30,
- -1 + 31 + 28 + 31 + 30 + 31,
- -1 + 31 + 28 + 31 + 30 + 31 + 30,
- -1 + 31 + 28 + 31 + 30 + 31 + 30 + 31,
- -1 + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31,
- -1 + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30,
- -1 + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31,
- -1 + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30
- /* 1 2 3 4 5 6 7 8 9 10 11 */
-};
-static const int leap_year_yday_offset[] = {
- -1,
- -1 + 31,
- -1 + 31 + 29,
- -1 + 31 + 29 + 31,
- -1 + 31 + 29 + 31 + 30,
- -1 + 31 + 29 + 31 + 30 + 31,
- -1 + 31 + 29 + 31 + 30 + 31 + 30,
- -1 + 31 + 29 + 31 + 30 + 31 + 30 + 31,
- -1 + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31,
- -1 + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30,
- -1 + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31,
- -1 + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30
- /* 1 2 3 4 5 6 7 8 9 10 11 */
-};
-
-static const int common_year_days_in_month[] = {
- 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31
-};
-static const int leap_year_days_in_month[] = {
- 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31
-};
-
-static VALUE
-timegmv_noleapsecond(struct vtm *vtm)
-{
- VALUE year1900;
- VALUE q400, r400;
- int year_mod400;
- int yday = vtm->mday;
- long days_in400;
- VALUE ret;
-
- year1900 = sub(vtm->year, INT2FIX(1900));
-
- divmodv(year1900, INT2FIX(400), &q400, &r400);
- year_mod400 = NUM2INT(r400);
-
- if (leap_year_p(year_mod400 + 1900))
- yday += leap_year_yday_offset[vtm->mon-1];
- else
- yday += common_year_yday_offset[vtm->mon-1];
-
- /*
- * `Seconds Since the Epoch' in SUSv3:
- * tm_sec + tm_min*60 + tm_hour*3600 + tm_yday*86400 +
- * (tm_year-70)*31536000 + ((tm_year-69)/4)*86400 -
- * ((tm_year-1)/100)*86400 + ((tm_year+299)/400)*86400
- */
- ret = LONG2NUM(vtm->sec
- + vtm->min*60
- + vtm->hour*3600);
- days_in400 = yday
- - 70*365
- + DIV(year_mod400 - 69, 4)
- - DIV(year_mod400 - 1, 100)
- + (year_mod400 + 299) / 400;
- ret = add(ret, mul(LONG2NUM(days_in400), INT2FIX(86400)));
- ret = add(ret, mul(q400, INT2FIX(97*86400)));
- ret = add(ret, mul(year1900, INT2FIX(365*86400)));
- ret = add(ret, vtm->subsec);
-
- return ret;
-}
-
-static st_table *zone_table;
-
-static const char *
-zone_str(const char *s)
-{
- st_data_t k, v;
-
- if (!zone_table)
- zone_table = st_init_strtable();
-
- k = (st_data_t)s;
- if (st_lookup(zone_table, k, &v)) {
- return (const char *)v;
- }
- s = strdup(s);
- k = (st_data_t)s;
- st_add_direct(zone_table, k, k);
-
- return s;
-}
-
-static void
-gmtimev_noleapsecond(VALUE timev, struct vtm *vtm)
-{
- VALUE v;
- int i, n, x, y;
- const int *yday_offset;
- int wday;
-
- vtm->isdst = 0;
-
- divmodv(timev, INT2FIX(1), &timev, &vtm->subsec);
- divmodv(timev, INT2FIX(86400), &timev, &v);
-
- wday = NUM2INT(mod(timev, INT2FIX(7)));
- vtm->wday = (wday + 4) % 7;
-
- n = NUM2INT(v);
- vtm->sec = n % 60; n = n / 60;
- vtm->min = n % 60; n = n / 60;
- vtm->hour = n;
-
- /* 97 leap days in the 400 year cycle */
- divmodv(timev, INT2FIX(400*365 + 97), &timev, &v);
- vtm->year = mul(timev, INT2FIX(400));
-
- /* n is the days in the 400 year cycle.
- * the start of the cycle is 1970-01-01. */
-
- n = NUM2INT(v);
- y = 1970;
-
- /* 30 years including 7 leap days (1972, 1976, ... 1996),
- * 31 days in January 2000 and
- * 29 days in Febrary 2000
- * from 1970-01-01 to 2000-02-29 */
- if (30*365+7+31+29-1 <= n) {
- /* 2000-02-29 or after */
- if (n < 31*365+8) {
- /* 2000-02-29 to 2000-12-31 */
- y += 30;
- n -= 30*365+7;
- goto found;
- }
- else {
- /* 2001-01-01 or after */
- n -= 1;
- }
- }
-
- x = n / (365*100 + 24);
- n = n % (365*100 + 24);
- y += x * 100;
- if (30*365+7+31+29-1 <= n) {
- if (n < 31*365+7) {
- y += 30;
- n -= 30*365+7;
- goto found;
- }
- else
- n += 1;
- }
-
- x = n / (365*4 + 1);
- n = n % (365*4 + 1);
- y += x * 4;
- if (365*2+31+29-1 <= n) {
- if (n < 365*2+366) {
- y += 2;
- n -= 365*2;
- goto found;
- }
- else
- n -= 1;
- }
-
- x = n / 365;
- n = n % 365;
- y += x;
-
- found:
- vtm->yday = n+1;
- vtm->year = add(vtm->year, INT2NUM(y));
-
- if (leap_year_p(y))
- yday_offset = leap_year_yday_offset;
- else
- yday_offset = common_year_yday_offset;
-
- for (i = 0; i < 12; i++) {
- if (yday_offset[i] < n) {
- vtm->mon = i+1;
- vtm->mday = n - yday_offset[i];
- }
- else
- break;
- }
-
- vtm->utc_offset = INT2FIX(0);
- vtm->zone = "UTC";
-}
-
-static struct tm *
-gmtime_with_leapsecond(const time_t *timep, struct tm *result)
-{
-#if defined(HAVE_STRUCT_TM_TM_GMTOFF)
- /* 4.4BSD counts leap seconds only with localtime, not with gmtime. */
- struct tm *t;
- int sign;
- long gmtoff, gmtoff_sec, gmtoff_min, gmtoff_hour, gmtoff_day;
- t = localtime_r(timep, result);
- if (t == NULL)
- return NULL;
-
- /* subtract gmtoff */
- if (t->tm_gmtoff < 0) {
- sign = 1;
- gmtoff = -t->tm_gmtoff;
- }
- else {
- sign = -1;
- gmtoff = t->tm_gmtoff;
- }
- gmtoff_sec = gmtoff % 60;
- gmtoff = gmtoff / 60;
- gmtoff_min = gmtoff % 60;
- gmtoff = gmtoff / 60;
- gmtoff_hour = gmtoff;
-
- gmtoff_sec *= sign;
- gmtoff_min *= sign;
- gmtoff_hour *= sign;
-
- gmtoff_day = 0;
-
- if (gmtoff_sec) {
- /* If gmtoff_sec == 0, don't change result->tm_sec.
- * It may be 60 which is a leap second. */
- result->tm_sec += gmtoff_sec;
- if (result->tm_sec < 0) {
- result->tm_sec += 60;
- gmtoff_min -= 1;
- }
- if (60 <= result->tm_sec) {
- result->tm_sec -= 60;
- gmtoff_min += 1;
- }
- }
- if (gmtoff_min) {
- result->tm_min += gmtoff_min;
- if (result->tm_min < 0) {
- result->tm_min += 60;
- gmtoff_hour -= 1;
- }
- if (60 <= result->tm_min) {
- result->tm_min -= 60;
- gmtoff_hour += 1;
- }
- }
- if (gmtoff_hour) {
- result->tm_hour += gmtoff_hour;
- if (result->tm_hour < 0) {
- result->tm_hour += 24;
- gmtoff_day = -1;
- }
- if (24 <= result->tm_hour) {
- result->tm_hour -= 24;
- gmtoff_day = 1;
- }
- }
-
- if (gmtoff_day) {
- if (gmtoff_day < 0) {
- if (result->tm_yday == 0) {
- result->tm_mday = 31;
- result->tm_mon = 11; /* December */
- result->tm_year--;
- result->tm_yday = leap_year_p(result->tm_year + 1900) ? 365 : 364;
- }
- else if (result->tm_mday == 1) {
- const int *days_in_month = leap_year_p(result->tm_year + 1900) ?
- leap_year_days_in_month :
- common_year_days_in_month;
- result->tm_mon--;
- result->tm_mday = days_in_month[result->tm_mon];
- result->tm_yday--;
- }
- else {
- result->tm_mday--;
- result->tm_yday--;
- }
- result->tm_wday = (result->tm_wday + 6) % 7;
- }
- else {
- int leap = leap_year_p(result->tm_year + 1900);
- if (result->tm_yday == (leap ? 365 : 364)) {
- result->tm_year++;
- result->tm_mon = 0; /* January */
- result->tm_mday = 1;
- result->tm_yday = 0;
- }
- else if (result->tm_mday == (leap ? leap_year_days_in_month :
- common_year_days_in_month)[result->tm_mon]) {
- result->tm_mon++;
- result->tm_mday = 1;
- result->tm_yday++;
- }
- else {
- result->tm_mday++;
- result->tm_yday++;
- }
- result->tm_wday = (result->tm_wday + 1) % 7;
- }
- }
- result->tm_isdst = 0;
- result->tm_gmtoff = 0;
-#if defined(HAVE_TM_ZONE)
- result->tm_zone = (char *)"UTC";
-#endif
- return result;
-#else
- return GMTIME(timep, *result);
-#endif
-}
-
-static long this_year = 0;
-static time_t known_leap_seconds_limit;
-static int number_of_leap_seconds_known;
-
-static void
-init_leap_second_info()
-{
- /*
- * leap seconds are determined by IERS.
- * It is announced 6 months before the leap second.
- * So no one knows leap seconds in the future after the next year.
- */
- if (this_year == 0) {
- time_t now, max;
- struct tm *tm, result;
- struct vtm vtm;
- VALUE timev;
- now = time(NULL);
- gmtime(&now);
- tm = gmtime_with_leapsecond(&now, &result);
- this_year = tm->tm_year;
-
- max = ~(time_t)0;
- if (max <= (time_t)0) {
- /* time_t is signed */
- max = (~(unsigned_time_t)0) >> 1;
- }
- if (max - now < (time_t)(366*86400))
- known_leap_seconds_limit = max;
- else
- known_leap_seconds_limit = now + (time_t)(366*86400);
-
- gmtime_with_leapsecond(&known_leap_seconds_limit, &result);
-
- vtm.year = LONG2NUM(result.tm_year + 1900);
- vtm.mon = result.tm_mon + 1;
- vtm.mday = result.tm_mday;
- vtm.hour = result.tm_hour;
- vtm.min = result.tm_min;
- vtm.sec = result.tm_sec;
- vtm.subsec = INT2FIX(0);
- vtm.utc_offset = INT2FIX(0);
-
- timev = timegmv_noleapsecond(&vtm);
-
- number_of_leap_seconds_known = NUM2INT(sub(TIMET2NUM(known_leap_seconds_limit), timev));
- }
-}
-
-static VALUE
-timegmv(struct vtm *vtm)
-{
- VALUE timev;
- struct tm tm;
- time_t t;
- const char *errmsg;
-
- /* The first leap second is 1972-06-30 23:59:60 UTC.
- * No leap seconds before. */
- if (RTEST(gt(INT2FIX(1972), vtm->year)))
- return timegmv_noleapsecond(vtm);
-
- init_leap_second_info();
-
- timev = timegmv_noleapsecond(vtm);
-
- if (RTEST(lt(TIMET2NUM(known_leap_seconds_limit), timev))) {
- return add(timev, INT2NUM(number_of_leap_seconds_known));
- }
-
- tm.tm_year = NUM2LONG(vtm->year) - 1900;
- tm.tm_mon = vtm->mon - 1;
- tm.tm_mday = vtm->mday;
- tm.tm_hour = vtm->hour;
- tm.tm_min = vtm->min;
- tm.tm_sec = vtm->sec;
- tm.tm_isdst = 0;
-
- errmsg = find_time_t(&tm, 1, &t);
- if (errmsg)
- rb_raise(rb_eArgError, "%s", errmsg);
- return add(TIMET2NUM(t), vtm->subsec);
-}
-
-static struct vtm *
-gmtimev(VALUE timev, struct vtm *result)
-{
- time_t t;
- struct tm tm;
- VALUE subsec;
-
- if (RTEST(lt(timev, INT2FIX(0)))) {
- gmtimev_noleapsecond(timev, result);
- return result;
- }
-
- init_leap_second_info();
-
- if (RTEST(lt(LONG2NUM(known_leap_seconds_limit), timev))) {
- timev = sub(timev, INT2NUM(number_of_leap_seconds_known));
- gmtimev_noleapsecond(timev, result);
- return result;
- }
-
- divmodv(timev, INT2FIX(1), &timev, &subsec);
-
- t = NUM2TIMET(timev);
- if (!gmtime_with_leapsecond(&t, &tm))
- return NULL;
-
- result->year = LONG2NUM((long)tm.tm_year + 1900);
- result->mon = tm.tm_mon + 1;
- result->mday = tm.tm_mday;
- result->hour = tm.tm_hour;
- result->min = tm.tm_min;
- result->sec = tm.tm_sec;
- result->subsec = subsec;
- result->utc_offset = INT2FIX(0);
- result->wday = tm.tm_wday;
- result->yday = tm.tm_yday+1;
- result->isdst = tm.tm_isdst;
- result->zone = "UTC";
-
- return result;
-}
-
-static struct tm *localtime_with_gmtoff(const time_t *t, struct tm *result, long *gmtoff);
-
-/*
- * The idea is come from Perl:
- * http://use.perl.org/articles/08/02/07/197204.shtml
- *
- * compat_common_month_table is generated by following program.
- * This table finds the last month which start the same day of a week.
- * The year 2037 is not used because
- * http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=522949
- *
- * #!/usr/bin/ruby
- *
- * require 'date'
- *
- * h = {}
- * 2036.downto(2010) {|y|
- * 1.upto(12) {|m|
- * next if m == 2 && y % 4 == 0
- * d = Date.new(y,m,1)
- * h[m] ||= {}
- * h[m][d.wday] ||= y
- * }
- * }
- *
- * 1.upto(12) {|m|
- * print "{"
- * 0.upto(6) {|w|
- * y = h[m][w]
- * print " #{y},"
- * }
- * puts "},"
- * }
- *
- */
-static int compat_common_month_table[12][7] = {
- /* Sun Mon Tue Wed Thu Fri Sat */
- { 2034, 2035, 2036, 2031, 2032, 2027, 2033 }, /* January */
- { 2026, 2027, 2033, 2034, 2035, 2030, 2031 }, /* February */
- { 2026, 2032, 2033, 2034, 2035, 2030, 2036 }, /* March */
- { 2035, 2030, 2036, 2026, 2032, 2033, 2034 }, /* April */
- { 2033, 2034, 2035, 2030, 2036, 2026, 2032 }, /* May */
- { 2036, 2026, 2032, 2033, 2034, 2035, 2030 }, /* June */
- { 2035, 2030, 2036, 2026, 2032, 2033, 2034 }, /* July */
- { 2032, 2033, 2034, 2035, 2030, 2036, 2026 }, /* August */
- { 2030, 2036, 2026, 2032, 2033, 2034, 2035 }, /* September */
- { 2034, 2035, 2030, 2036, 2026, 2032, 2033 }, /* October */
- { 2026, 2032, 2033, 2034, 2035, 2030, 2036 }, /* November */
- { 2030, 2036, 2026, 2032, 2033, 2034, 2035 }, /* December */
-};
-
-/*
- * compat_leap_month_table is generated by following program.
- *
- * #!/usr/bin/ruby
- *
- * require 'date'
- *
- * h = {}
- * 2037.downto(2010) {|y|
- * 1.upto(12) {|m|
- * next unless m == 2 && y % 4 == 0
- * d = Date.new(y,m,1)
- * h[m] ||= {}
- * h[m][d.wday] ||= y
- * }
- * }
- *
- * 2.upto(2) {|m|
- * 0.upto(6) {|w|
- * y = h[m][w]
- * print " #{y},"
- * }
- * puts
- * }
- */
-static int compat_leap_month_table[7] = {
-/* Sun Mon Tue Wed Thu Fri Sat */
- 2032, 2016, 2028, 2012, 2024, 2036, 2020, /* February */
-};
-
-static int
-calc_wday(int year, int month, int day)
-{
- int a, y, m;
- int wday;
-
- a = (14 - month) / 12;
- y = year + 4800 - a;
- m = month + 12 * a - 3;
- wday = day + (153*m+2)/5 + 365*y + y/4 - y/100 + y/400 + 2;
- wday = wday % 7;
- return wday;
-}
-
-static VALUE
-guess_local_offset(struct vtm *vtm_utc)
-{
- VALUE off = INT2FIX(0);
- struct tm tm;
- long gmtoff;
- time_t t;
- struct vtm vtm2;
- VALUE timev;
- int y, wday;
-
-# if defined(NEGATIVE_TIME_T)
- /* 1901-12-13 20:45:52 UTC : The oldest time in 32-bit signed time_t. */
- if (localtime_with_gmtoff((t = (time_t)0x80000000, &t), &tm, &gmtoff))
- off = LONG2FIX(gmtoff);
- else
-# endif
- /* 1970-01-01 00:00:00 UTC : The Unix epoch - the oldest time in portable time_t. */
- if (localtime_with_gmtoff((t = 0, &t), &tm, &gmtoff))
- off = LONG2FIX(gmtoff);
-
- /* The first DST is at 1916 in German.
- * So we don't need to care DST before that. */
- if (lt(vtm_utc->year, INT2FIX(1916)))
- return off;
-
- /* It is difficult to guess future. */
-
- vtm2 = *vtm_utc;
-
- /* guess using a year before 2038. */
- y = NUM2INT(mod(vtm_utc->year, INT2FIX(400)));
- wday = calc_wday(y, vtm_utc->mon, 1);
- if (vtm_utc->mon == 2 && leap_year_p(y))
- vtm2.year = INT2FIX(compat_leap_month_table[wday]);
- else
- vtm2.year = INT2FIX(compat_common_month_table[vtm_utc->mon-1][wday]);
-
- timev = timegmv(&vtm2);
- t = NUM2TIMET(timev);
- if (localtime_with_gmtoff(&t, &tm, &gmtoff))
- return LONG2FIX(gmtoff);
-
- {
- /* Use the current time offset as a last resort. */
- static time_t now = 0;
- static long now_gmtoff = 0;
- if (now == 0) {
- now = time(NULL);
- localtime_with_gmtoff(&now, &tm, &now_gmtoff);
- }
- return LONG2FIX(now_gmtoff);
- }
-}
-
-static VALUE
-small_vtm_sub(struct vtm *vtm1, struct vtm *vtm2)
-{
- int off;
-
- off = vtm1->sec - vtm2->sec;
- off += (vtm1->min - vtm2->min) * 60;
- off += (vtm1->hour - vtm2->hour) * 3600;
- if (ne(vtm1->year, vtm2->year))
- off += lt(vtm1->year, vtm2->year) ? -24*3600 : 24*3600;
- else if (vtm1->mon != vtm2->mon)
- off += vtm1->mon < vtm2->mon ? -24*3600 : 24*3600;
- else if (vtm1->mday != vtm2->mday)
- off += vtm1->mday < vtm2->mday ? -24*3600 : 24*3600;
-
- return INT2FIX(off);
-}
-
-static VALUE
-timelocalv(struct vtm *vtm)
-{
- time_t t;
- struct tm tm;
- VALUE v;
- VALUE timev1, timev2;
- struct vtm vtm1, vtm2;
- int n;
-
- if (FIXNUM_P(vtm->year)) {
- long l = FIX2LONG(vtm->year) - 1900;
- if (l < INT_MIN || INT_MAX < l)
- goto no_localtime;
- tm.tm_year = l;
- }
- else {
- v = sub(vtm->year, INT2FIX(1900));
- if (lt(v, INT2NUM(INT_MIN)) || lt(INT2NUM(INT_MAX), v))
- goto no_localtime;
- tm.tm_year = NUM2INT(v);
- }
-
- tm.tm_mon = vtm->mon-1;
- tm.tm_mday = vtm->mday;
- tm.tm_hour = vtm->hour;
- tm.tm_min = vtm->min;
- tm.tm_sec = vtm->sec;
- tm.tm_isdst = vtm->isdst;
-
- if (find_time_t(&tm, 0, &t))
- goto no_localtime;
- return add(TIMET2NUM(t), vtm->subsec);
-
- no_localtime:
- timev1 = timegmv(vtm);
-
- if (!localtimev(timev1, &vtm1))
- rb_raise(rb_eArgError, "localtimev error");
-
- n = vtmcmp(vtm, &vtm1);
- if (n == 0) {
- timev1 = sub(timev1, INT2FIX(12*3600));
- if (!localtimev(timev1, &vtm1))
- rb_raise(rb_eArgError, "localtimev error");
- n = 1;
- }
-
- if (n < 0) {
- timev2 = timev1;
- vtm2 = vtm1;
- timev1 = sub(timev1, INT2FIX(24*3600));
- if (!localtimev(timev1, &vtm1))
- rb_raise(rb_eArgError, "localtimev error");
- }
- else {
- timev2 = add(timev1, INT2FIX(24*3600));
- if (!localtimev(timev2, &vtm2))
- rb_raise(rb_eArgError, "localtimev error");
- }
- timev1 = add(timev1, small_vtm_sub(vtm, &vtm1));
- timev2 = add(timev2, small_vtm_sub(vtm, &vtm2));
-
- if (eq(timev1, timev2))
- return timev1;
-
- if (!localtimev(timev1, &vtm1))
- rb_raise(rb_eArgError, "localtimev error");
- if (vtm->hour != vtm1.hour || vtm->min != vtm1.min || vtm->sec != vtm1.sec)
- return timev2;
-
- if (!localtimev(timev2, &vtm2))
- rb_raise(rb_eArgError, "localtimev error");
- if (vtm->hour != vtm2.hour || vtm->min != vtm2.min || vtm->sec != vtm2.sec)
- return timev1;
-
- if (vtm->isdst)
- return lt(vtm1.utc_offset, vtm2.utc_offset) ? timev2 : timev1;
- else
- return lt(vtm1.utc_offset, vtm2.utc_offset) ? timev1 : timev2;
-}
-
-#define TIMET_MAX (~(time_t)0 <= 0 ? (time_t)((~(unsigned_time_t)0) >> 1) : (~(unsigned_time_t)0))
-#define TIMET_MIN (~(time_t)0 <= 0 ? (time_t)(((unsigned_time_t)1) << (sizeof(time_t) * CHAR_BIT - 1)) : (time_t)0)
-
-static struct tm *
-localtime_with_gmtoff(const time_t *t, struct tm *result, long *gmtoff)
-{
- struct tm tm;
-
- if (LOCALTIME(t, tm)) {
-#if defined(HAVE_STRUCT_TM_TM_GMTOFF)
- *gmtoff = tm.tm_gmtoff;
-#else
- struct tm *u, *l;
- long off;
- struct tm tmbuf;
- l = &tm;
- u = GMTIME(t, tmbuf);
- if (!u)
- return NULL;
- if (l->tm_year != u->tm_year)
- off = l->tm_year < u->tm_year ? -1 : 1;
- else if (l->tm_mon != u->tm_mon)
- off = l->tm_mon < u->tm_mon ? -1 : 1;
- else if (l->tm_mday != u->tm_mday)
- off = l->tm_mday < u->tm_mday ? -1 : 1;
- else
- off = 0;
- off = off * 24 + l->tm_hour - u->tm_hour;
- off = off * 60 + l->tm_min - u->tm_min;
- off = off * 60 + l->tm_sec - u->tm_sec;
- *gmtoff = off;
-#endif
- *result = tm;
- return result;
- }
- return NULL;
-}
-
-static struct vtm *
-localtimev(VALUE timev, struct vtm *result)
-{
- VALUE subsec, offset;
- divmodv(timev, INT2FIX(1), &timev, &subsec);
-
- if (le(TIMET2NUM(TIMET_MIN), timev) &&
- le(timev, TIMET2NUM(TIMET_MAX))) {
- time_t t;
- struct tm tm;
- long gmtoff;
- t = NUM2TIMET(timev);
-
- if (localtime_with_gmtoff(&t, &tm, &gmtoff)) {
- result->year = LONG2NUM((long)tm.tm_year + 1900);
- result->mon = tm.tm_mon + 1;
- result->mday = tm.tm_mday;
- result->hour = tm.tm_hour;
- result->min = tm.tm_min;
- result->sec = tm.tm_sec;
- result->subsec = subsec;
- result->wday = tm.tm_wday;
- result->yday = tm.tm_yday+1;
- result->isdst = tm.tm_isdst;
- result->utc_offset = LONG2NUM(gmtoff);
-#if defined(HAVE_TM_ZONE)
- result->zone = zone_str(tm.tm_zone);
-#elif defined(HAVE_TZNAME) && defined(HAVE_DAYLIGHT)
- /* this needs tzset or localtime, instead of localtime_r */
- result->zone = zone_str(tzname[daylight && tm.tm_isdst]);
-#else
- {
- char buf[64];
- strftime(buf, sizeof(buf), "%Z", &tm);
- result->zone = zone_str(buf);
- }
-#endif
-
- return result;
- }
- }
-
- if (!gmtimev(timev, result))
- return NULL;
-
- offset = guess_local_offset(result);
-
- if (!gmtimev(add(timev, offset), result))
- return NULL;
-
- result->utc_offset = offset;
-
- return result;
-}
struct time_object {
- VALUE timev;
- struct vtm vtm;
+ struct timeval tv;
+ struct tm tm;
int gmt;
int tm_got;
};
@@ -981,678 +33,253 @@ struct time_object {
#define GetTimeval(obj, tobj) \
Data_Get_Struct(obj, struct time_object, tobj)
-#define TIME_UTC_P(tobj) ((tobj)->gmt == 1)
-#define TIME_SET_UTC(tobj) ((tobj)->gmt = 1)
-
-#define TIME_LOCALTIME_P(tobj) ((tobj)->gmt == 0)
-#define TIME_SET_LOCALTIME(tobj) ((tobj)->gmt = 0)
-
-#define TIME_FIXOFF_P(tobj) ((tobj)->gmt == 2)
-#define TIME_SET_FIXOFF(tobj, off) \
- ((tobj)->gmt = 2, \
- (tobj)->vtm.utc_offset = (off), \
- (tobj)->vtm.zone = NULL)
-
-#define TIME_COPY_GMT(tobj1, tobj2) ((tobj1)->gmt = (tobj2)->gmt)
-
-static VALUE time_get_tm(VALUE, struct time_object *);
-#define MAKE_TM(time, tobj) \
- do { \
- if ((tobj)->tm_got == 0) { \
- time_get_tm((time), (tobj)); \
- } \
- } while (0)
-
-static void
-time_mark(void *ptr)
-{
- struct time_object *tobj = ptr;
- if (!tobj) return;
- rb_gc_mark(tobj->timev);
- rb_gc_mark(tobj->vtm.year);
- rb_gc_mark(tobj->vtm.subsec);
- rb_gc_mark(tobj->vtm.utc_offset);
-}
+static void time_free _((void *));
+static VALUE time_utc_offset _((VALUE));
static void
-time_free(void *tobj)
+time_free(tobj)
+ void *tobj;
{
- if (tobj) xfree(tobj);
+ if (tobj) free(tobj);
}
+static VALUE time_s_alloc _((VALUE));
static VALUE
-time_s_alloc(VALUE klass)
+time_s_alloc(klass)
+ VALUE klass;
{
VALUE obj;
struct time_object *tobj;
- obj = Data_Make_Struct(klass, struct time_object, time_mark, time_free, tobj);
+ obj = Data_Make_Struct(klass, struct time_object, 0, time_free, tobj);
tobj->tm_got=0;
- tobj->timev = INT2FIX(0);
+ tobj->tv.tv_sec = 0;
+ tobj->tv.tv_usec = 0;
return obj;
}
static void
-time_modify(VALUE time)
+time_modify(time)
+ VALUE time;
{
rb_check_frozen(time);
- if (!OBJ_UNTRUSTED(time) && rb_safe_level() >= 4)
+ if (!OBJ_TAINTED(time) && rb_safe_level() >= 4)
rb_raise(rb_eSecurityError, "Insecure: can't modify Time");
}
-static VALUE
-timespec2timev(struct timespec *ts)
-{
- VALUE timev;
-
- timev = TIMET2NUM(ts->tv_sec);
- if (ts->tv_nsec)
- timev = add(timev, quo(LONG2NUM(ts->tv_nsec), INT2FIX(1000000000)));
- return timev;
-}
-
-static struct timespec
-timev2timespec(VALUE timev)
-{
- VALUE subsec;
- struct timespec ts;
-
- divmodv(timev, INT2FIX(1), &timev, &subsec);
- if (lt(timev, TIMET2NUM(TIMET_MIN)) || lt(TIMET2NUM(TIMET_MAX), timev))
- rb_raise(rb_eArgError, "time out of system range");
- ts.tv_sec = NUM2TIMET(timev);
- ts.tv_nsec = NUM2LONG(mul(subsec, INT2FIX(1000000000)));
- return ts;
-}
-
/*
* Document-method: now
*
* Synonym for <code>Time.new</code>. Returns a +Time+ object
- * initialized to the current system time.
+ * initialized tot he current system time.
+ *
+ * call-seq:
+ * Time.new -> time
+ *
+ * Returns a <code>Time</code> object initialized to the current system
+ * time. <b>Note:</b> The object created will be created using the
+ * resolution available on your system clock, and so may include
+ * fractional seconds.
+ *
+ * a = Time.new #=> Wed Apr 09 08:56:03 CDT 2003
+ * b = Time.new #=> Wed Apr 09 08:56:03 CDT 2003
+ * a == b #=> false
+ * "%.6f" % a.to_f #=> "1049896563.230740"
+ * "%.6f" % b.to_f #=> "1049896563.231466"
+ *
*/
static VALUE
-time_init_0(VALUE time)
+time_init(time)
+ VALUE time;
{
struct time_object *tobj;
- struct timespec ts;
time_modify(time);
GetTimeval(time, tobj);
tobj->tm_got=0;
- tobj->timev = INT2FIX(0);
-#ifdef HAVE_CLOCK_GETTIME
- if (clock_gettime(CLOCK_REALTIME, &ts) == -1) {
- rb_sys_fail("clock_gettime");
- }
-#else
- {
- struct timeval tv;
- if (gettimeofday(&tv, 0) < 0) {
- rb_sys_fail("gettimeofday");
- }
- ts.tv_sec = tv.tv_sec;
- ts.tv_nsec = tv.tv_usec * 1000;
+ tobj->tv.tv_sec = 0;
+ tobj->tv.tv_usec = 0;
+ if (gettimeofday(&tobj->tv, 0) < 0) {
+ rb_sys_fail("gettimeofday");
}
-#endif
- tobj->timev = timespec2timev(&ts);
return time;
}
-static VALUE
-time_set_utc_offset(VALUE time, VALUE off)
-{
- struct time_object *tobj;
- off = num_exact(off);
-
- time_modify(time);
- GetTimeval(time, tobj);
-
- tobj->tm_got = 0;
- TIME_SET_FIXOFF(tobj, off);
-
- return time;
-}
-
-static void
-vtm_add_offset(struct vtm *vtm, VALUE off)
-{
- int sign;
- VALUE subsec, v;
- int sec, min, hour;
- int day;
-
- vtm->utc_offset = sub(vtm->utc_offset, off);
-
- if (RTEST(lt(off, INT2FIX(0)))) {
- sign = -1;
- off = neg(off);
- }
- else {
- sign = 1;
- }
- divmodv(off, INT2FIX(1), &off, &subsec);
- divmodv(off, INT2FIX(60), &off, &v);
- sec = NUM2INT(v);
- divmodv(off, INT2FIX(60), &off, &v);
- min = NUM2INT(v);
- divmodv(off, INT2FIX(24), &off, &v);
- hour = NUM2INT(v);
-
- if (sign < 0) {
- subsec = neg(subsec);
- sec = -sec;
- min = -min;
- hour = -hour;
- }
-
- day = 0;
-
- if (!rb_equal(subsec, INT2FIX(0))) {
- vtm->subsec = add(vtm->subsec, subsec);
- if (lt(vtm->subsec, INT2FIX(0))) {
- vtm->subsec = add(vtm->subsec, INT2FIX(1));
- sec -= 1;
- }
- if (le(INT2FIX(1), vtm->subsec)) {
- vtm->subsec = sub(vtm->subsec, INT2FIX(1));
- sec += 1;
- }
- goto not_zero_sec;
- }
- if (sec) {
- not_zero_sec:
- /* If sec + subsec == 0, don't change vtm->sec.
- * It may be 60 which is a leap second. */
- vtm->sec += sec;
- if (vtm->sec < 0) {
- vtm->sec += 60;
- min -= 1;
- }
- if (60 <= vtm->sec) {
- vtm->sec -= 60;
- min += 1;
- }
- }
- if (min) {
- vtm->min += min;
- if (vtm->min < 0) {
- vtm->min += 60;
- hour -= 1;
- }
- if (60 <= vtm->min) {
- vtm->min -= 60;
- hour += 1;
- }
- }
- if (hour) {
- vtm->hour += hour;
- if (vtm->hour < 0) {
- vtm->hour += 24;
- day = -1;
- }
- if (24 <= vtm->hour) {
- vtm->hour -= 24;
- day = 1;
- }
- }
-
- if (day) {
- if (day < 0) {
- if (vtm->mon == 1 && vtm->mday == 1) {
- vtm->mday = 31;
- vtm->mon = 12; /* December */
- vtm->year = sub(vtm->year, INT2FIX(1));
- vtm->yday = leap_year_v_p(vtm->year) ? 365 : 364;
- }
- else if (vtm->mday == 1) {
- const int *days_in_month = leap_year_v_p(vtm->year) ?
- leap_year_days_in_month :
- common_year_days_in_month;
- vtm->mon--;
- vtm->mday = days_in_month[vtm->mon-1];
- vtm->yday--;
- }
- else {
- vtm->mday--;
- vtm->yday--;
- }
- vtm->wday = (vtm->wday + 6) % 7;
- }
- else {
- int leap = leap_year_v_p(vtm->year);
- if (vtm->mon == 12 && vtm->mday == 31) {
- vtm->year = add(vtm->year, INT2FIX(1));
- vtm->mon = 1; /* January */
- vtm->mday = 1;
- vtm->yday = 1;
- }
- else if (vtm->mday == (leap ? leap_year_days_in_month :
- common_year_days_in_month)[vtm->mon-1]) {
- vtm->mon++;
- vtm->mday = 1;
- vtm->yday++;
- }
- else {
- vtm->mday++;
- vtm->yday++;
- }
- vtm->wday = (vtm->wday + 1) % 7;
- }
- }
-}
-
-static VALUE
-utc_offset_arg(VALUE arg)
-{
- VALUE tmp;
- if (!NIL_P(tmp = rb_check_string_type(arg))) {
- int n;
- char *s = RSTRING_PTR(tmp);
- if (!rb_enc_str_asciicompat_p(tmp) ||
- RSTRING_LEN(tmp) != 6 ||
- (s[0] != '+' && s[0] != '-') ||
- !ISDIGIT(s[1]) ||
- !ISDIGIT(s[2]) ||
- s[3] != ':' ||
- !ISDIGIT(s[4]) ||
- !ISDIGIT(s[5]))
- rb_raise(rb_eArgError, "\"+HH:MM\" or \"-HH:MM\" expected for utc_offset");
- n = strtol(s+1, NULL, 10) * 3600;
- n += strtol(s+4, NULL, 10) * 60;
- if (s[0] == '-')
- n = -n;
- return INT2FIX(n);
- }
- else {
- return num_exact(arg);
- }
-}
-
-static VALUE
-time_init_1(int argc, VALUE *argv, VALUE time)
-{
- struct vtm vtm;
- VALUE v[7];
- struct time_object *tobj;
-
- vtm.wday = -1;
- vtm.yday = 0;
- vtm.zone = "";
-
- /* year mon mday hour min sec off */
- rb_scan_args(argc, argv, "16", &v[0],&v[1],&v[2],&v[3],&v[4],&v[5],&v[6]);
-
- vtm.year = obj2vint(v[0]);
-
- vtm.mon = NIL_P(v[1]) ? 1 : month_arg(v[1]);
-
- vtm.mday = NIL_P(v[2]) ? 1 : obj2long(v[2]);
-
- vtm.hour = NIL_P(v[3]) ? 0 : obj2long(v[3]);
-
- vtm.min = NIL_P(v[4]) ? 0 : obj2long(v[4]);
-
- vtm.sec = 0;
- vtm.subsec = INT2FIX(0);
- if (!NIL_P(v[5])) {
- VALUE sec = num_exact(v[5]);
- VALUE subsec;
- divmodv(sec, INT2FIX(1), &sec, &subsec);
- vtm.sec = NUM2INT(sec);
- vtm.subsec = subsec;
- }
-
- vtm.isdst = -1;
- vtm.utc_offset = Qnil;
- if (!NIL_P(v[6])) {
- VALUE arg = v[6];
- if (arg == ID2SYM(rb_intern("dst")))
- vtm.isdst = 1;
- else if (arg == ID2SYM(rb_intern("std")))
- vtm.isdst = 0;
- else
- vtm.utc_offset = utc_offset_arg(arg);
- }
-
- validate_vtm(&vtm);
-
- time_modify(time);
- GetTimeval(time, tobj);
- tobj->tm_got=0;
- tobj->timev = INT2FIX(0);
-
- if (!NIL_P(vtm.utc_offset)) {
- VALUE off = vtm.utc_offset;
- vtm_add_offset(&vtm, neg(off));
- vtm.utc_offset = Qnil;
- tobj->timev = timegmv(&vtm);
- return time_set_utc_offset(time, off);
- }
- else {
- tobj->timev = timelocalv(&vtm);
- return time_localtime(time);
- }
-}
-
-
-/*
- * call-seq:
- * Time.new -> time
- * Time.new(year) -> time
- * Time.new(year, month) -> time
- * Time.new(year, month, day) -> time
- * Time.new(year, month, day, hour) -> time
- * Time.new(year, month, day, hour, min) -> time
- * Time.new(year, month, day, hour, min, sec) -> time
- * Time.new(year, month, day, hour, min, sec, utc_offset) -> time
- *
- * Returns a <code>Time</code> object.
- *
- * It is initialized to the current system time if no argument.
- * <b>Note:</b> The object created will be created using the
- * resolution available on your system clock, and so may include
- * fractional seconds.
- *
- * If one or more arguments specified, the time is initialized
- * to the specified time.
- * _sec_ may have fraction if it is a rational.
- *
- * _utc_offset_ is the offset from UTC.
- * It is a string such as "+09:00" or a number of seconds such as 32400.
- *
- * a = Time.new #=> 2007-11-19 07:50:02 -0600
- * b = Time.new #=> 2007-11-19 07:50:02 -0600
- * a == b #=> false
- * "%.6f" % a.to_f #=> "1195480202.282373"
- * "%.6f" % b.to_f #=> "1195480202.283415"
- *
- * Time.new(2008,6,21, 13,30,0, "+09:00") #=> 2008-06-21 13:30:00 +0900
- *
- */
-
-static VALUE
-time_init(int argc, VALUE *argv, VALUE time)
-{
- if (argc == 0)
- return time_init_0(time);
- else
- return time_init_1(argc, argv, time);
-}
+#define NDIV(x,y) (-(-((x)+1)/(y))-1)
+#define NMOD(x,y) ((y)-(-((x)+1)%(y))-1)
static void
-time_overflow_p(time_t *secp, long *nsecp)
+time_overflow_p(secp, usecp)
+ time_t *secp, *usecp;
{
- time_t tmp, sec = *secp;
- long nsec = *nsecp;
+ time_t tmp, sec = *secp, usec = *usecp;
- if (nsec >= 1000000000) { /* nsec positive overflow */
- tmp = sec + nsec / 1000000000;
- nsec %= 1000000000;
+ if (usec >= 1000000) { /* usec positive overflow */
+ tmp = sec + usec / 1000000;
+ usec %= 1000000;
if (sec > 0 && tmp < 0) {
rb_raise(rb_eRangeError, "out of Time range");
}
sec = tmp;
}
- if (nsec < 0) { /* nsec negative overflow */
- tmp = sec + NDIV(nsec,1000000000); /* negative div */
- nsec = NMOD(nsec,1000000000); /* negative mod */
+ if (usec < 0) { /* usec negative overflow */
+ tmp = sec + NDIV(usec,1000000); /* negative div */
+ usec = NMOD(usec,1000000); /* negative mod */
if (sec < 0 && tmp > 0) {
rb_raise(rb_eRangeError, "out of Time range");
}
sec = tmp;
}
#ifndef NEGATIVE_TIME_T
- if (sec < 0)
+ if (sec < 0 || (sec == 0 && usec < 0))
rb_raise(rb_eArgError, "time must be positive");
#endif
*secp = sec;
- *nsecp = nsec;
-}
-
-static VALUE nsec2timev(time_t sec, long nsec)
-{
- struct timespec ts;
- time_overflow_p(&sec, &nsec);
- ts.tv_sec = sec;
- ts.tv_nsec = nsec;
- return timespec2timev(&ts);
+ *usecp = usec;
}
+static VALUE time_new_internal _((VALUE, time_t, time_t));
static VALUE
-time_new_internal(VALUE klass, VALUE timev)
+time_new_internal(klass, sec, usec)
+ VALUE klass;
+ time_t sec, usec;
{
VALUE time = time_s_alloc(klass);
struct time_object *tobj;
GetTimeval(time, tobj);
- tobj->timev = num_exact(timev);
+ time_overflow_p(&sec, &usec);
+ tobj->tv.tv_sec = sec;
+ tobj->tv.tv_usec = usec;
return time;
}
VALUE
-rb_time_new(time_t sec, long usec)
-{
- return time_new_internal(rb_cTime, nsec2timev(sec, usec * 1000));
-}
-
-VALUE
-rb_time_nano_new(time_t sec, long nsec)
-{
- return time_new_internal(rb_cTime, nsec2timev(sec, nsec));
-}
-
-VALUE
-rb_time_num_new(VALUE timev, VALUE off)
-{
- VALUE time = time_new_internal(rb_cTime, timev);
-
- if (!NIL_P(off)) {
- off = utc_offset_arg(off);
- validate_utc_offset(off);
- time_set_utc_offset(time, off);
- return time;
- }
-
- return time;
-}
-
-static VALUE
-time_new_timev(VALUE klass, VALUE timev)
+rb_time_new(sec, usec)
+ time_t sec, usec;
{
- VALUE time = time_s_alloc(klass);
- struct time_object *tobj;
-
- GetTimeval(time, tobj);
- tobj->timev = timev;
-
- return time;
+ return time_new_internal(rb_cTime, sec, usec);
}
-static struct timespec
-time_timespec(VALUE num, int interval)
+static struct timeval
+time_timeval(time, interval)
+ VALUE time;
+ int interval;
{
- struct timespec t;
+ struct timeval t;
const char *tstr = interval ? "time interval" : "time";
- VALUE i, f, ary;
#ifndef NEGATIVE_TIME_T
interval = 1;
#endif
- switch (TYPE(num)) {
+ switch (TYPE(time)) {
case T_FIXNUM:
- t.tv_sec = NUM2TIMET(num);
+ t.tv_sec = FIX2LONG(time);
if (interval && t.tv_sec < 0)
rb_raise(rb_eArgError, "%s must be positive", tstr);
- t.tv_nsec = 0;
+ t.tv_usec = 0;
break;
case T_FLOAT:
- if (interval && RFLOAT_VALUE(num) < 0.0)
+ if (interval && RFLOAT(time)->value < 0.0)
rb_raise(rb_eArgError, "%s must be positive", tstr);
else {
double f, d;
- d = modf(RFLOAT_VALUE(num), &f);
- if (d >= 0) {
- t.tv_nsec = (int)(d*1e9+0.5);
- }
- else if ((t.tv_nsec = (int)(-d*1e9+0.5)) > 0) {
- t.tv_nsec = 1000000000 - t.tv_nsec;
- f -= 1;
- }
+ d = modf(RFLOAT(time)->value, &f);
+ if (d < 0) {
+ d += 1;
+ f -= 1;
+ }
t.tv_sec = (time_t)f;
if (f != t.tv_sec) {
- rb_raise(rb_eRangeError, "%f out of Time range", RFLOAT_VALUE(num));
+ rb_raise(rb_eRangeError, "%f out of Time range", RFLOAT(time)->value);
}
+ t.tv_usec = (time_t)(d*1e6+0.5);
}
break;
case T_BIGNUM:
- t.tv_sec = NUM2TIMET(num);
+ t.tv_sec = NUM2LONG(time);
if (interval && t.tv_sec < 0)
rb_raise(rb_eArgError, "%s must be positive", tstr);
- t.tv_nsec = 0;
+ t.tv_usec = 0;
break;
default:
- if (rb_respond_to(num, id_divmod)) {
- ary = rb_check_array_type(rb_funcall(num, id_divmod, 1, INT2FIX(1)));
- if (NIL_P(ary)) {
- goto typeerror;
- }
- i = rb_ary_entry(ary, 0);
- f = rb_ary_entry(ary, 1);
- t.tv_sec = NUM2TIMET(i);
- if (interval && t.tv_sec < 0)
- rb_raise(rb_eArgError, "%s must be positive", tstr);
- f = rb_funcall(f, id_mul, 1, INT2FIX(1000000000));
- t.tv_nsec = NUM2LONG(f);
- }
- else {
-typeerror:
- rb_raise(rb_eTypeError, "can't convert %s into %s",
- rb_obj_classname(num), tstr);
- }
+ rb_raise(rb_eTypeError, "can't convert %s into %s",
+ rb_obj_classname(time), tstr);
break;
}
return t;
}
-static struct timeval
-time_timeval(VALUE num, int interval)
-{
- struct timespec ts;
- struct timeval tv;
-
- ts = time_timespec(num, interval);
- tv.tv_sec = (TYPEOF_TIMEVAL_TV_SEC)ts.tv_sec;
- tv.tv_usec = (TYPEOF_TIMEVAL_TV_USEC)(ts.tv_nsec / 1000);
-
- return tv;
-}
-
struct timeval
-rb_time_interval(VALUE num)
+rb_time_interval(time)
+ VALUE time;
{
- return time_timeval(num, Qtrue);
+ return time_timeval(time, Qtrue);
}
struct timeval
-rb_time_timeval(VALUE time)
+rb_time_timeval(time)
+ VALUE time;
{
struct time_object *tobj;
struct timeval t;
- struct timespec ts;
if (TYPE(time) == T_DATA && RDATA(time)->dfree == time_free) {
GetTimeval(time, tobj);
- ts = timev2timespec(tobj->timev);
- t.tv_sec = (TYPEOF_TIMEVAL_TV_SEC)ts.tv_sec;
- t.tv_usec = (TYPEOF_TIMEVAL_TV_USEC)(ts.tv_nsec / 1000);
+ t = tobj->tv;
return t;
}
return time_timeval(time, Qfalse);
}
-struct timespec
-rb_time_timespec(VALUE time)
-{
- struct time_object *tobj;
- struct timespec t;
-
- if (TYPE(time) == T_DATA && RDATA(time)->dfree == time_free) {
- GetTimeval(time, tobj);
- t = timev2timespec(tobj->timev);
- return t;
- }
- return time_timespec(time, Qfalse);
-}
-
/*
* call-seq:
- * Time.now => time
- *
- * Creates a new time object for the current time.
- *
- * Time.now #=> 2009-06-24 12:39:54 +0900
+ * Time.at( aTime ) => time
+ * Time.at( seconds [, microseconds] ) => time
+ *
+ * Creates a new time object with the value given by <i>aTime</i>, or
+ * the given number of <i>seconds</i> (and optional
+ * <i>microseconds</i>) from epoch. A non-portable feature allows the
+ * offset to be negative on some systems.
+ *
+ * Time.at(0) #=> Wed Dec 31 18:00:00 CST 1969
+ * Time.at(946702800) #=> Fri Dec 31 23:00:00 CST 1999
+ * Time.at(-284061600) #=> Sat Dec 31 00:00:00 CST 1960
*/
static VALUE
-time_s_now(VALUE klass)
+time_s_at(argc, argv, klass)
+ int argc;
+ VALUE *argv;
+ VALUE klass;
{
- return rb_class_new_instance(0, NULL, klass);
-}
-
-/*
- * call-seq:
- * Time.at(time) => time
- * Time.at(seconds_with_frac) => time
- * Time.at(seconds, microseconds_with_frac) => time
- *
- * Creates a new time object with the value given by <i>time</i>,
- * the given number of <i>seconds_with_frac</i>, or
- * <i>seconds</i> and <i>microseconds_with_frac</i> from the Epoch.
- * <i>seconds_with_frac</i> and <i>microseconds_with_frac</i>
- * can be Integer, Float, Rational, or other Numeric.
- * non-portable feature allows the offset to be negative on some systems.
- *
- * Time.at(0) #=> 1969-12-31 18:00:00 -0600
- * Time.at(Time.at(0)) #=> 1969-12-31 18:00:00 -0600
- * Time.at(946702800) #=> 1999-12-31 23:00:00 -0600
- * Time.at(-284061600) #=> 1960-12-31 00:00:00 -0600
- * Time.at(946684800.2).usec #=> 200000
- * Time.at(946684800, 123456.789).nsec #=> 123456789
- */
-
-static VALUE
-time_s_at(int argc, VALUE *argv, VALUE klass)
-{
- VALUE time, t, timev;
+ struct timeval tv;
+ VALUE time, t;
if (rb_scan_args(argc, argv, "11", &time, &t) == 2) {
- time = num_exact(time);
- t = num_exact(t);
- timev = add(time, quo(t, INT2FIX(1000000)));
- t = time_new_timev(klass, timev);
- }
- else if (TYPE(time) == T_DATA && RDATA(time)->dfree == time_free) {
- struct time_object *tobj, *tobj2;
- GetTimeval(time, tobj);
- t = time_new_timev(klass, tobj->timev);
- GetTimeval(t, tobj2);
- TIME_COPY_GMT(tobj2, tobj);
+ tv.tv_sec = NUM2LONG(time);
+ tv.tv_usec = NUM2LONG(t);
}
else {
- timev = num_exact(time);
- t = time_new_timev(klass, timev);
+ tv = rb_time_timeval(time);
}
+ t = time_new_internal(klass, tv.tv_sec, tv.tv_usec);
+ if (TYPE(time) == T_DATA && RDATA(time)->dfree == time_free) {
+ struct time_object *tobj, *tobj2;
+ GetTimeval(time, tobj);
+ GetTimeval(t, tobj2);
+ tobj2->gmt = tobj->gmt;
+ }
return t;
}
@@ -1662,119 +289,29 @@ static const char months[][4] = {
};
static long
-obj2long(VALUE obj)
-{
- if (TYPE(obj) == T_STRING) {
- obj = rb_str_to_inum(obj, 10, Qfalse);
- }
-
- return NUM2LONG(obj);
-}
-
-static VALUE
-obj2vint(VALUE obj)
-{
- if (TYPE(obj) == T_STRING) {
- obj = rb_str_to_inum(obj, 10, Qfalse);
- }
- else {
- obj = rb_to_int(obj);
- }
-
- return obj;
-}
-
-static long
-obj2subsec(VALUE obj, VALUE *subsec)
+obj2long(obj)
+ VALUE obj;
{
if (TYPE(obj) == T_STRING) {
obj = rb_str_to_inum(obj, 10, Qfalse);
- *subsec = INT2FIX(0);
- return NUM2LONG(obj);
}
- divmodv(num_exact(obj), INT2FIX(1), &obj, subsec);
return NUM2LONG(obj);
}
-static long
-usec2subsec(VALUE obj)
-{
- if (TYPE(obj) == T_STRING) {
- obj = rb_str_to_inum(obj, 10, Qfalse);
- }
-
- return quo(num_exact(obj), INT2FIX(1000000));
-}
-
-static int
-month_arg(VALUE arg)
-{
- int i, mon;
-
- VALUE s = rb_check_string_type(arg);
- if (!NIL_P(s)) {
- mon = 0;
- for (i=0; i<12; i++) {
- if (RSTRING_LEN(s) == 3 &&
- STRCASECMP(months[i], RSTRING_PTR(s)) == 0) {
- mon = i+1;
- break;
- }
- }
- if (mon == 0) {
- char c = RSTRING_PTR(s)[0];
-
- if ('0' <= c && c <= '9') {
- mon = obj2long(s);
- }
- }
- }
- else {
- mon = obj2long(arg);
- }
- return mon;
-}
-
static void
-validate_utc_offset(VALUE utc_offset)
-{
- if (le(utc_offset, INT2FIX(-86400)) || ge(utc_offset, INT2FIX(86400)))
- rb_raise(rb_eArgError, "utc_offset out of range");
-}
-
-static void
-validate_vtm(struct vtm *vtm)
-{
- if ( vtm->mon < 1 || vtm->mon > 12
- || vtm->mday < 1 || vtm->mday > 31
- || vtm->hour < 0 || vtm->hour > 24
- || (vtm->hour == 24 && (vtm->min > 0 || vtm->sec > 0))
- || vtm->min < 0 || vtm->min > 59
- || vtm->sec < 0 || vtm->sec > 60
- || lt(vtm->subsec, INT2FIX(0)) || ge(vtm->subsec, INT2FIX(1))
- || (!NIL_P(vtm->utc_offset) && (validate_utc_offset(vtm->utc_offset), 0)))
- rb_raise(rb_eArgError, "argument out of range");
-}
-
-static void
-time_arg(int argc, VALUE *argv, struct vtm *vtm)
+time_arg(argc, argv, tm, usec)
+ int argc;
+ VALUE *argv;
+ struct tm *tm;
+ time_t *usec;
{
VALUE v[8];
+ int i;
+ long year;
- vtm->year = INT2FIX(0);
- vtm->mon = 0;
- vtm->mday = 0;
- vtm->hour = 0;
- vtm->min = 0;
- vtm->sec = 0;
- vtm->subsec = INT2FIX(0);
- vtm->utc_offset = Qnil;
- vtm->wday = 0;
- vtm->yday = 0;
- vtm->isdst = 0;
- vtm->zone = "";
-
+ MEMZERO(tm, struct tm, 1);
+ *usec = 0;
if (argc == 10) {
v[0] = argv[5];
v[1] = argv[4];
@@ -1783,63 +320,143 @@ time_arg(int argc, VALUE *argv, struct vtm *vtm)
v[4] = argv[1];
v[5] = argv[0];
v[6] = Qnil;
- vtm->isdst = RTEST(argv[8]) ? 1 : 0;
+ tm->tm_isdst = RTEST(argv[8]) ? 1 : 0;
}
else {
rb_scan_args(argc, argv, "17", &v[0],&v[1],&v[2],&v[3],&v[4],&v[5],&v[6],&v[7]);
/* v[6] may be usec or zone (parsedate) */
/* v[7] is wday (parsedate; ignored) */
- vtm->wday = -1;
- vtm->isdst = -1;
+ tm->tm_wday = -1;
+ tm->tm_isdst = -1;
}
- vtm->year = obj2vint(v[0]);
+ year = obj2long(v[0]);
- if (NIL_P(v[1])) {
- vtm->mon = 1;
- }
- else {
- vtm->mon = month_arg(v[1]);
+ if (0 <= year && year < 39) {
+ year += 100;
+ rb_warning("2 digits year is used");
}
-
- if (NIL_P(v[2])) {
- vtm->mday = 1;
+ else if (69 <= year && year < 139) {
+ rb_warning("2 or 3 digits year is used");
}
else {
- vtm->mday = obj2long(v[2]);
+ year -= 1900;
}
- vtm->hour = NIL_P(v[3])?0:obj2long(v[3]);
+ tm->tm_year = year;
- vtm->min = NIL_P(v[4])?0:obj2long(v[4]);
+ if (NIL_P(v[1])) {
+ tm->tm_mon = 0;
+ }
+ else {
+ VALUE s = rb_check_string_type(v[1]);
+ if (!NIL_P(s)) {
+ tm->tm_mon = -1;
+ for (i=0; i<12; i++) {
+ if (RSTRING(s)->len == 3 &&
+ strcasecmp(months[i], RSTRING(s)->ptr) == 0) {
+ tm->tm_mon = i;
+ break;
+ }
+ }
+ if (tm->tm_mon == -1) {
+ char c = RSTRING(s)->ptr[0];
- if (!NIL_P(v[6]) && argc == 7) {
- vtm->sec = NIL_P(v[5])?0:obj2long(v[5]);
- vtm->subsec = usec2subsec(v[6]);
+ if ('0' <= c && c <= '9') {
+ tm->tm_mon = obj2long(s)-1;
+ }
+ }
+ }
+ else {
+ tm->tm_mon = obj2long(v[1])-1;
+ }
+ }
+ if (NIL_P(v[2])) {
+ tm->tm_mday = 1;
}
else {
- /* when argc == 8, v[6] is timezone, but ignored */
- vtm->sec = NIL_P(v[5])?0:obj2subsec(v[5], &vtm->subsec);
+ tm->tm_mday = obj2long(v[2]);
+ }
+ tm->tm_hour = NIL_P(v[3])?0:obj2long(v[3]);
+ tm->tm_min = NIL_P(v[4])?0:obj2long(v[4]);
+ tm->tm_sec = NIL_P(v[5])?0:obj2long(v[5]);
+ if (!NIL_P(v[6])) {
+ if (argc == 8) {
+ /* v[6] is timezone, but ignored */
+ }
+ else if (argc == 7) {
+ *usec = obj2long(v[6]);
+ }
}
- validate_vtm(vtm);
+ /* value validation */
+ if (
+ tm->tm_year != year ||
+#ifndef NEGATIVE_TIME_T
+ tm->tm_year < 69 ||
+#endif
+ tm->tm_mon < 0 || tm->tm_mon > 11
+ || tm->tm_mday < 1 || tm->tm_mday > 31
+ || tm->tm_hour < 0 || tm->tm_hour > 23
+ || tm->tm_min < 0 || tm->tm_min > 59
+ || tm->tm_sec < 0 || tm->tm_sec > 60)
+ rb_raise(rb_eArgError, "argument out of range");
}
+static VALUE time_gmtime _((VALUE));
+static VALUE time_localtime _((VALUE));
+static VALUE time_get_tm _((VALUE, int));
+
static int
-leap_year_p(long y)
+leap_year_p(y)
+ long y;
{
- return ((y % 4 == 0) && (y % 100 != 0)) || (y % 400 == 0);
+ return ((y % 4 == 0) && (y % 100 != 0)) || (y % 400 == 0);
}
+#define DIV(n,d) ((n)<0 ? NDIV((n),(d)) : (n)/(d))
+
static time_t
-timegm_noleapsecond(struct tm *tm)
-{
+timegm_noleapsecond(tm)
+ struct tm *tm;
+{
+ static int common_year_yday_offset[] = {
+ -1,
+ -1 + 31,
+ -1 + 31 + 28,
+ -1 + 31 + 28 + 31,
+ -1 + 31 + 28 + 31 + 30,
+ -1 + 31 + 28 + 31 + 30 + 31,
+ -1 + 31 + 28 + 31 + 30 + 31 + 30,
+ -1 + 31 + 28 + 31 + 30 + 31 + 30 + 31,
+ -1 + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31,
+ -1 + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30,
+ -1 + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31,
+ -1 + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30
+ /* 1 2 3 4 5 6 7 8 9 10 11 */
+ };
+ static int leap_year_yday_offset[] = {
+ -1,
+ -1 + 31,
+ -1 + 31 + 29,
+ -1 + 31 + 29 + 31,
+ -1 + 31 + 29 + 31 + 30,
+ -1 + 31 + 29 + 31 + 30 + 31,
+ -1 + 31 + 29 + 31 + 30 + 31 + 30,
+ -1 + 31 + 29 + 31 + 30 + 31 + 30 + 31,
+ -1 + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31,
+ -1 + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30,
+ -1 + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31,
+ -1 + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30
+ /* 1 2 3 4 5 6 7 8 9 10 11 */
+ };
+
long tm_year = tm->tm_year;
int tm_yday = tm->tm_mday;
if (leap_year_p(tm_year + 1900))
- tm_yday += leap_year_yday_offset[tm->tm_mon];
+ tm_yday += leap_year_yday_offset[tm->tm_mon];
else
- tm_yday += common_year_yday_offset[tm->tm_mon];
+ tm_yday += common_year_yday_offset[tm->tm_mon];
/*
* `Seconds Since the Epoch' in SUSv3:
@@ -1848,360 +465,371 @@ timegm_noleapsecond(struct tm *tm)
* ((tm_year-1)/100)*86400 + ((tm_year+299)/400)*86400
*/
return tm->tm_sec + tm->tm_min*60 + tm->tm_hour*3600 +
- (time_t)(tm_yday +
- (tm_year-70)*365 +
- DIV(tm_year-69,4) -
- DIV(tm_year-1,100) +
- DIV(tm_year+299,400))*86400;
+ (time_t)(tm_yday +
+ (tm_year-70)*365 +
+ DIV(tm_year-69,4) -
+ DIV(tm_year-1,100) +
+ DIV(tm_year+299,400))*86400;
}
-#if 0
-#define DEBUG_FIND_TIME_NUMGUESS
-#define DEBUG_GUESSRANGE
-#endif
-
-#ifdef DEBUG_GUESSRANGE
-#define DEBUG_REPORT_GUESSRANGE fprintf(stderr, "find time guess range: %ld - %ld : %lu\n", guess_lo, guess_hi, (unsigned_time_t)(guess_hi-guess_lo))
-#else
-#define DEBUG_REPORT_GUESSRANGE
-#endif
-
-#ifdef DEBUG_FIND_TIME_NUMGUESS
-#define DEBUG_FIND_TIME_NUMGUESS_INC find_time_numguess++,
-static unsigned long long find_time_numguess;
-
-static VALUE find_time_numguess_getter(void)
+static int
+tmcmp(a, b)
+ struct tm *a;
+ struct tm *b;
{
- return ULL2NUM(find_time_numguess);
+ if (a->tm_year != b->tm_year)
+ return a->tm_year < b->tm_year ? -1 : 1;
+ else if (a->tm_mon != b->tm_mon)
+ return a->tm_mon < b->tm_mon ? -1 : 1;
+ else if (a->tm_mday != b->tm_mday)
+ return a->tm_mday < b->tm_mday ? -1 : 1;
+ else if (a->tm_hour != b->tm_hour)
+ return a->tm_hour < b->tm_hour ? -1 : 1;
+ else if (a->tm_min != b->tm_min)
+ return a->tm_min < b->tm_min ? -1 : 1;
+ else if (a->tm_sec != b->tm_sec)
+ return a->tm_sec < b->tm_sec ? -1 : 1;
+ else
+ return 0;
}
+
+#if SIZEOF_TIME_T == SIZEOF_LONG
+typedef unsigned long unsigned_time_t;
+#elif SIZEOF_TIME_T == SIZEOF_INT
+typedef unsigned int unsigned_time_t;
+#elif SIZEOF_TIME_T == SIZEOF_LONG_LONG
+typedef unsigned LONG_LONG unsigned_time_t;
#else
-#define DEBUG_FIND_TIME_NUMGUESS_INC
+# error cannot find integer type which size is same as time_t.
#endif
-static const char *
-find_time_t(struct tm *tptr, int utc_p, time_t *tp)
+static time_t
+search_time_t(tptr, utc_p)
+ struct tm *tptr;
+ int utc_p;
{
- time_t guess, guess0, guess_lo, guess_hi;
- struct tm *tm, tm0, tm_lo, tm_hi;
- int d;
+ time_t guess, guess_lo, guess_hi;
+ struct tm *tm, tm_lo, tm_hi;
+ int d, have_guess;
int find_dst;
- struct tm result;
- int status;
-
-#define GUESS(p) (DEBUG_FIND_TIME_NUMGUESS_INC (utc_p ? gmtime_with_leapsecond(p, &result) : LOCALTIME(p, result)))
-
- guess_lo = TIMET_MIN;
- guess_hi = TIMET_MAX;
find_dst = 0 < tptr->tm_isdst;
- tm0 = *tptr;
- if (tm0.tm_mon < 0) {
- tm0.tm_mon = 0;
- tm0.tm_mday = 1;
- tm0.tm_hour = 0;
- tm0.tm_min = 0;
- tm0.tm_sec = 0;
- }
- else if (11 < tm0.tm_mon) {
- tm0.tm_mon = 11;
- tm0.tm_mday = 31;
- tm0.tm_hour = 23;
- tm0.tm_min = 59;
- tm0.tm_sec = 60;
- }
- else if (tm0.tm_mday < 1) {
- tm0.tm_mday = 1;
- tm0.tm_hour = 0;
- tm0.tm_min = 0;
- tm0.tm_sec = 0;
- }
- else if ((d = (leap_year_p(1900 + tm0.tm_year) ?
- leap_year_days_in_month :
- common_year_days_in_month)[tm0.tm_mon]) < tm0.tm_mday) {
- tm0.tm_mday = d;
- tm0.tm_hour = 23;
- tm0.tm_min = 59;
- tm0.tm_sec = 60;
- }
- else if (tm0.tm_hour < 0) {
- tm0.tm_hour = 0;
- tm0.tm_min = 0;
- tm0.tm_sec = 0;
- }
- else if (23 < tm0.tm_hour) {
- tm0.tm_hour = 23;
- tm0.tm_min = 59;
- tm0.tm_sec = 60;
- }
- else if (tm0.tm_min < 0) {
- tm0.tm_min = 0;
- tm0.tm_sec = 0;
- }
- else if (59 < tm0.tm_min) {
- tm0.tm_min = 59;
- tm0.tm_sec = 60;
- }
- else if (tm0.tm_sec < 0) {
- tm0.tm_sec = 0;
- }
- else if (60 < tm0.tm_sec) {
- tm0.tm_sec = 60;
- }
-
- DEBUG_REPORT_GUESSRANGE;
- guess0 = guess = timegm_noleapsecond(&tm0);
- tm = GUESS(&guess);
+#ifdef NEGATIVE_TIME_T
+ guess_lo = (time_t)~((unsigned_time_t)~(time_t)0 >> 1);
+#else
+ guess_lo = 0;
+#endif
+ guess_hi = ((time_t)-1) < ((time_t)0) ?
+ (time_t)((unsigned_time_t)~(time_t)0 >> 1) :
+ ~(time_t)0;
+
+ guess = timegm_noleapsecond(tptr);
+ tm = (utc_p ? gmtime : localtime)(&guess);
if (tm) {
- d = tmcmp(tptr, tm);
- if (d == 0) { goto found; }
- if (d < 0) {
- guess_hi = guess;
- guess -= 24 * 60 * 60;
- }
- else {
- guess_lo = guess;
- guess += 24 * 60 * 60;
- }
- DEBUG_REPORT_GUESSRANGE;
- if (guess_lo < guess && guess < guess_hi && (tm = GUESS(&guess)) != NULL) {
- d = tmcmp(tptr, tm);
- if (d == 0) { goto found; }
- if (d < 0)
- guess_hi = guess;
- else
- guess_lo = guess;
- DEBUG_REPORT_GUESSRANGE;
- }
+ d = tmcmp(tptr, tm);
+ if (d == 0) return guess;
+ if (d < 0) {
+ guess_hi = guess;
+ guess -= 24 * 60 * 60;
+ }
+ else {
+ guess_lo = guess;
+ guess += 24 * 60 * 60;
+ }
+ if (guess_lo < guess && guess < guess_hi &&
+ (tm = (utc_p ? gmtime : localtime)(&guess)) != NULL) {
+ d = tmcmp(tptr, tm);
+ if (d == 0) return guess;
+ if (d < 0)
+ guess_hi = guess;
+ else
+ guess_lo = guess;
+ }
}
- tm = GUESS(&guess_lo);
+ tm = (utc_p ? gmtime : localtime)(&guess_lo);
if (!tm) goto error;
d = tmcmp(tptr, tm);
if (d < 0) goto out_of_range;
- if (d == 0) { guess = guess_lo; goto found; }
+ if (d == 0) return guess_lo;
tm_lo = *tm;
- tm = GUESS(&guess_hi);
+ tm = (utc_p ? gmtime : localtime)(&guess_hi);
if (!tm) goto error;
d = tmcmp(tptr, tm);
if (d > 0) goto out_of_range;
- if (d == 0) { guess = guess_hi; goto found; }
+ if (d == 0) return guess_hi;
tm_hi = *tm;
- DEBUG_REPORT_GUESSRANGE;
-
- status = 1;
+ have_guess = 0;
while (guess_lo + 1 < guess_hi) {
- if (status == 0) {
- binsearch:
- guess = guess_lo / 2 + guess_hi / 2;
- if (guess <= guess_lo)
- guess = guess_lo + 1;
- else if (guess >= guess_hi)
- guess = guess_hi - 1;
- status = 1;
- }
- else {
- if (status == 1) {
- time_t guess0_hi = timegm_noleapsecond(&tm_hi);
- guess = guess_hi - (guess0_hi - guess0);
- if (guess == guess_hi) /* hh:mm:60 tends to cause this condition. */
- guess--;
- status = 2;
- }
- else if (status == 2) {
- time_t guess0_lo = timegm_noleapsecond(&tm_lo);
- guess = guess_lo + (guess0 - guess0_lo);
- if (guess == guess_lo)
- guess++;
- status = 0;
- }
- if (guess <= guess_lo || guess_hi <= guess) {
- /* Precious guess is invalid. try binary search. */
-#ifdef DEBUG_GUESSRANGE
- if (guess <= guess_lo) fprintf(stderr, "too small guess: %ld <= %ld\n", guess, guess_lo);
- if (guess_hi <= guess) fprintf(stderr, "too big guess: %ld <= %ld\n", guess_hi, guess);
-#endif
- goto binsearch;
- }
- }
-
- tm = GUESS(&guess);
- if (!tm) goto error;
+ /* there is a gap between guess_lo and guess_hi. */
+ unsigned long range = 0;
+ if (!have_guess) {
+ int a, b;
+ /*
+ Try precious guess by a linear interpolation at first.
+ `a' and `b' is a coefficient of guess_lo and guess_hi as:
+
+ guess = (guess_lo * a + guess_hi * b) / (a + b)
+
+ However this causes overflow in most cases, following assignment
+ is used instead:
+
+ guess = guess_lo / d * a + (guess_lo % d) * a / d
+ + guess_hi / d * b + (guess_hi % d) * b / d
+ where d = a + b
+
+ To avoid overflow in this assignment, `d' is restricted to less than
+ sqrt(2**31). By this restriction and other reasons, the guess is
+ not accurate and some error is expected. `range' approximates
+ the maximum error.
+
+ When these parameters are not suitable, i.e. guess is not within
+ guess_lo and guess_hi, simple guess by binary search is used.
+ */
+ range = 366 * 24 * 60 * 60;
+ a = (tm_hi.tm_year - tptr->tm_year);
+ b = (tptr->tm_year - tm_lo.tm_year);
+ /* 46000 is selected as `some big number less than sqrt(2**31)'. */
+ if (a + b <= 46000 / 12) {
+ range = 31 * 24 * 60 * 60;
+ a *= 12;
+ b *= 12;
+ a += tm_hi.tm_mon - tptr->tm_mon;
+ b += tptr->tm_mon - tm_lo.tm_mon;
+ if (a + b <= 46000 / 31) {
+ range = 24 * 60 * 60;
+ a *= 31;
+ b *= 31;
+ a += tm_hi.tm_mday - tptr->tm_mday;
+ b += tptr->tm_mday - tm_lo.tm_mday;
+ if (a + b <= 46000 / 24) {
+ range = 60 * 60;
+ a *= 24;
+ b *= 24;
+ a += tm_hi.tm_hour - tptr->tm_hour;
+ b += tptr->tm_hour - tm_lo.tm_hour;
+ if (a + b <= 46000 / 60) {
+ range = 60;
+ a *= 60;
+ b *= 60;
+ a += tm_hi.tm_min - tptr->tm_min;
+ b += tptr->tm_min - tm_lo.tm_min;
+ if (a + b <= 46000 / 60) {
+ range = 1;
+ a *= 60;
+ b *= 60;
+ a += tm_hi.tm_sec - tptr->tm_sec;
+ b += tptr->tm_sec - tm_lo.tm_sec;
+ }
+ }
+ }
+ }
+ }
+ if (a <= 0) a = 1;
+ if (b <= 0) b = 1;
+ d = a + b;
+ /*
+ Although `/' and `%' may produce unexpected result with negative
+ argument, it doesn't cause serious problem because there is a
+ fail safe.
+ */
+ guess = guess_lo / d * a + (guess_lo % d) * a / d
+ + guess_hi / d * b + (guess_hi % d) * b / d;
+ have_guess = 1;
+ }
- d = tmcmp(tptr, tm);
+ if (guess <= guess_lo || guess_hi <= guess) {
+ /* Precious guess is invalid. try binary search. */
+ guess = guess_lo / 2 + guess_hi / 2;
+ if (guess <= guess_lo)
+ guess = guess_lo + 1;
+ else if (guess >= guess_hi)
+ guess = guess_hi - 1;
+ range = 0;
+ }
- if (d < 0) {
- guess_hi = guess;
- tm_hi = *tm;
- DEBUG_REPORT_GUESSRANGE;
- }
- else if (d > 0) {
- guess_lo = guess;
- tm_lo = *tm;
- DEBUG_REPORT_GUESSRANGE;
- }
- else {
- found:
- if (!utc_p) {
- /* If localtime is nonmonotonic, another result may exist. */
- time_t guess2;
- if (find_dst) {
- guess2 = guess - 2 * 60 * 60;
- tm = LOCALTIME(&guess2, result);
- if (tm) {
- if (tptr->tm_hour != (tm->tm_hour + 2) % 24 ||
- tptr->tm_min != tm->tm_min ||
- tptr->tm_sec != tm->tm_sec) {
- guess2 -= (tm->tm_hour - tptr->tm_hour) * 60 * 60 +
- (tm->tm_min - tptr->tm_min) * 60 +
- (tm->tm_sec - tptr->tm_sec);
- if (tptr->tm_mday != tm->tm_mday)
- guess2 += 24 * 60 * 60;
- if (guess != guess2) {
- tm = LOCALTIME(&guess2, result);
- if (tmcmp(tptr, tm) == 0) {
- if (guess < guess2)
- *tp = guess;
- else
- *tp = guess2;
- return NULL;
- }
- }
- }
- }
+ tm = (utc_p ? gmtime : localtime)(&guess);
+ if (!tm) goto error;
+ have_guess = 0;
+
+ d = tmcmp(tptr, tm);
+ if (d < 0) {
+ guess_hi = guess;
+ tm_hi = *tm;
+ if (range) {
+ guess = guess - range;
+ range = 0;
+ if (guess_lo < guess && guess < guess_hi)
+ have_guess = 1;
+ }
+ }
+ else if (d > 0) {
+ guess_lo = guess;
+ tm_lo = *tm;
+ if (range) {
+ guess = guess + range;
+ range = 0;
+ if (guess_lo < guess && guess < guess_hi)
+ have_guess = 1;
+ }
+ }
+ else {
+ if (!utc_p) {
+ /* If localtime is nonmonotonic, another result may exist. */
+ time_t guess2;
+ if (find_dst) {
+ guess2 = guess - 2 * 60 * 60;
+ tm = localtime(&guess2);
+ if (tm) {
+ if (tptr->tm_hour != (tm->tm_hour + 2) % 24 ||
+ tptr->tm_min != tm->tm_min ||
+ tptr->tm_sec != tm->tm_sec) {
+ guess2 -= (tm->tm_hour - tptr->tm_hour) * 60 * 60 +
+ (tm->tm_min - tptr->tm_min) * 60 +
+ (tm->tm_sec - tptr->tm_sec);
+ if (tptr->tm_mday != tm->tm_mday)
+ guess2 += 24 * 60 * 60;
+ if (guess != guess2) {
+ tm = localtime(&guess2);
+ if (tmcmp(tptr, tm) == 0) {
+ if (guess < guess2)
+ return guess;
+ else
+ return guess2;
+ }
}
- else {
- guess2 = guess + 2 * 60 * 60;
- tm = LOCALTIME(&guess2, result);
- if (tm) {
- if ((tptr->tm_hour + 2) % 24 != tm->tm_hour ||
- tptr->tm_min != tm->tm_min ||
- tptr->tm_sec != tm->tm_sec) {
- guess2 -= (tm->tm_hour - tptr->tm_hour) * 60 * 60 +
- (tm->tm_min - tptr->tm_min) * 60 +
- (tm->tm_sec - tptr->tm_sec);
- if (tptr->tm_mday != tm->tm_mday)
- guess2 -= 24 * 60 * 60;
- if (guess != guess2) {
- tm = LOCALTIME(&guess2, result);
- if (tmcmp(tptr, tm) == 0) {
- if (guess < guess2)
- *tp = guess2;
- else
- *tp = guess;
- return NULL;
- }
- }
- }
- }
+ }
+ }
+ }
+ else {
+ guess2 = guess + 2 * 60 * 60;
+ tm = localtime(&guess2);
+ if (tm) {
+ if ((tptr->tm_hour + 2) % 24 != tm->tm_hour ||
+ tptr->tm_min != tm->tm_min ||
+ tptr->tm_sec != tm->tm_sec) {
+ guess2 -= (tm->tm_hour - tptr->tm_hour) * 60 * 60 +
+ (tm->tm_min - tptr->tm_min) * 60 +
+ (tm->tm_sec - tptr->tm_sec);
+ if (tptr->tm_mday != tm->tm_mday)
+ guess2 -= 24 * 60 * 60;
+ if (guess != guess2) {
+ tm = localtime(&guess2);
+ if (tmcmp(tptr, tm) == 0) {
+ if (guess < guess2)
+ return guess2;
+ else
+ return guess;
+ }
}
+ }
}
- *tp = guess;
- return NULL;
+ }
}
+ return guess;
+ }
}
/* Given argument has no corresponding time_t. Let's outerpolation. */
if (tm_lo.tm_year == tptr->tm_year && tm_lo.tm_mon == tptr->tm_mon) {
- *tp = guess_lo +
- (tptr->tm_mday - tm_lo.tm_mday) * 24 * 60 * 60 +
- (tptr->tm_hour - tm_lo.tm_hour) * 60 * 60 +
- (tptr->tm_min - tm_lo.tm_min) * 60 +
- (tptr->tm_sec - tm_lo.tm_sec);
- return NULL;
+ return guess_lo +
+ (tptr->tm_mday - tm_lo.tm_mday) * 24 * 60 * 60 +
+ (tptr->tm_hour - tm_lo.tm_hour) * 60 * 60 +
+ (tptr->tm_min - tm_lo.tm_min) * 60 +
+ (tptr->tm_sec - tm_lo.tm_sec);
}
else if (tm_hi.tm_year == tptr->tm_year && tm_hi.tm_mon == tptr->tm_mon) {
- *tp = guess_hi +
- (tptr->tm_mday - tm_hi.tm_mday) * 24 * 60 * 60 +
- (tptr->tm_hour - tm_hi.tm_hour) * 60 * 60 +
- (tptr->tm_min - tm_hi.tm_min) * 60 +
- (tptr->tm_sec - tm_hi.tm_sec);
- return NULL;
+ return guess_hi +
+ (tptr->tm_mday - tm_hi.tm_mday) * 24 * 60 * 60 +
+ (tptr->tm_hour - tm_hi.tm_hour) * 60 * 60 +
+ (tptr->tm_min - tm_hi.tm_min) * 60 +
+ (tptr->tm_sec - tm_hi.tm_sec);
}
out_of_range:
- return "time out of range";
+ rb_raise(rb_eArgError, "time out of range");
error:
- return "gmtime/localtime error";
+ rb_raise(rb_eArgError, "gmtime/localtime error");
+ return 0; /* not reached */
}
-static int
-vtmcmp(struct vtm *a, struct vtm *b)
-{
- if (ne(a->year, b->year))
- return lt(a->year, b->year) ? -1 : 1;
- else if (a->mon != b->mon)
- return a->mon < b->mon ? -1 : 1;
- else if (a->mday != b->mday)
- return a->mday < b->mday ? -1 : 1;
- else if (a->hour != b->hour)
- return a->hour < b->hour ? -1 : 1;
- else if (a->min != b->min)
- return a->min < b->min ? -1 : 1;
- else if (a->sec != b->sec)
- return a->sec < b->sec ? -1 : 1;
- else if (ne(a->subsec, b->subsec))
- return lt(a->subsec, b->subsec) ? -1 : 1;
- else
- return 0;
-}
-
-static int
-tmcmp(struct tm *a, struct tm *b)
+static time_t
+make_time_t(tptr, utc_p)
+ struct tm *tptr;
+ int utc_p;
{
- if (a->tm_year != b->tm_year)
- return a->tm_year < b->tm_year ? -1 : 1;
- else if (a->tm_mon != b->tm_mon)
- return a->tm_mon < b->tm_mon ? -1 : 1;
- else if (a->tm_mday != b->tm_mday)
- return a->tm_mday < b->tm_mday ? -1 : 1;
- else if (a->tm_hour != b->tm_hour)
- return a->tm_hour < b->tm_hour ? -1 : 1;
- else if (a->tm_min != b->tm_min)
- return a->tm_min < b->tm_min ? -1 : 1;
- else if (a->tm_sec != b->tm_sec)
- return a->tm_sec < b->tm_sec ? -1 : 1;
- else
- return 0;
+ time_t t;
+#ifdef NEGATIVE_TIME_T
+ struct tm *tmp;
+#endif
+ struct tm buf;
+ buf = *tptr;
+ if (utc_p) {
+#if defined(HAVE_TIMEGM)
+ if ((t = timegm(&buf)) != -1)
+ return t;
+#ifdef NEGATIVE_TIME_T
+ if ((tmp = gmtime(&t)) &&
+ tptr->tm_year == tmp->tm_year &&
+ tptr->tm_mon == tmp->tm_mon &&
+ tptr->tm_mday == tmp->tm_mday &&
+ tptr->tm_hour == tmp->tm_hour &&
+ tptr->tm_min == tmp->tm_min &&
+ tptr->tm_sec == tmp->tm_sec)
+ return t;
+#endif
+#endif
+ return search_time_t(&buf, utc_p);
+ }
+ else {
+#if defined(HAVE_MKTIME)
+ if ((t = mktime(&buf)) != -1)
+ return t;
+#ifdef NEGATIVE_TIME_T
+ if ((tmp = localtime(&t)) &&
+ tptr->tm_year == tmp->tm_year &&
+ tptr->tm_mon == tmp->tm_mon &&
+ tptr->tm_mday == tmp->tm_mday &&
+ tptr->tm_hour == tmp->tm_hour &&
+ tptr->tm_min == tmp->tm_min &&
+ tptr->tm_sec == tmp->tm_sec)
+ return t;
+#endif
+#endif
+ return search_time_t(&buf, utc_p);
+ }
}
static VALUE
-time_utc_or_local(int argc, VALUE *argv, int utc_p, VALUE klass)
+time_utc_or_local(argc, argv, utc_p, klass)
+ int argc;
+ VALUE *argv;
+ int utc_p;
+ VALUE klass;
{
- struct vtm vtm;
+ struct tm tm;
VALUE time;
+ time_t usec;
- time_arg(argc, argv, &vtm);
- if (utc_p)
- time = time_new_timev(klass, timegmv(&vtm));
- else
- time = time_new_timev(klass, timelocalv(&vtm));
+ time_arg(argc, argv, &tm, &usec);
+ time = time_new_internal(klass, make_time_t(&tm, utc_p), usec);
if (utc_p) return time_gmtime(time);
return time_localtime(time);
}
/*
* call-seq:
- * Time.utc(year) => time
- * Time.utc(year, month) => time
- * Time.utc(year, month, day) => time
- * Time.utc(year, month, day, hour) => time
- * Time.utc(year, month, day, hour, min) => time
- * Time.utc(year, month, day, hour, min, sec_with_frac) => time
- * Time.utc(year, month, day, hour, min, sec, usec_with_frac) => time
- * Time.utc(sec, min, hour, day, month, year, wday, yday, isdst, tz) => time
- * Time.gm(year) => time
- * Time.gm(year, month) => time
- * Time.gm(year, month, day) => time
- * Time.gm(year, month, day, hour) => time
- * Time.gm(year, month, day, hour, min) => time
- * Time.gm(year, month, day, hour, min, sec_with_frac) => time
- * Time.gm(year, month, day, hour, min, sec, usec_with_frac) => time
- * Time.gm(sec, min, hour, day, month, year, wday, yday, isdst, tz) => time
- *
+ * Time.utc( year [, month, day, hour, min, sec, usec] ) => time
+ * Time.utc( sec, min, hour, day, month, year, wday, yday, isdst, tz
+ * ) => time
+ * Time.gm( year [, month, day, hour, min, sec, usec] ) => time
+ * Time.gm( sec, min, hour, day, month, year, wday, yday, isdst, tz
+ * ) => time
+ *
* Creates a time based on given values, interpreted as UTC (GMT). The
* year must be specified. Other values default to the minimum value
* for that field (and may be <code>nil</code> or omitted). Months may
@@ -2210,44 +838,37 @@ time_utc_or_local(int argc, VALUE *argv, int utc_p, VALUE klass)
* an <code>ArgumentError</code> if any values are out of range. Will
* also accept ten arguments in the order output by
* <code>Time#to_a</code>.
- * <i>sec_with_frac</i> and <i>usec_with_frac</i> can have a fractional part.
*
- * Time.utc(2000,"jan",1,20,15,1) #=> 2000-01-01 20:15:01 UTC
- * Time.gm(2000,"jan",1,20,15,1) #=> 2000-01-01 20:15:01 UTC
+ * Time.utc(2000,"jan",1,20,15,1) #=> Sat Jan 01 20:15:01 UTC 2000
+ * Time.gm(2000,"jan",1,20,15,1) #=> Sat Jan 01 20:15:01 UTC 2000
*/
static VALUE
-time_s_mkutc(int argc, VALUE *argv, VALUE klass)
+time_s_mkutc(argc, argv, klass)
+ int argc;
+ VALUE *argv;
+ VALUE klass;
{
return time_utc_or_local(argc, argv, Qtrue, klass);
}
/*
* call-seq:
- * Time.local(year) => time
- * Time.local(year, month) => time
- * Time.local(year, month, day) => time
- * Time.local(year, month, day, hour) => time
- * Time.local(year, month, day, hour, min) => time
- * Time.local(year, month, day, hour, min, sec_with_frac) => time
- * Time.local(year, month, day, hour, min, sec, usec_with_frac) => time
- * Time.local(sec, min, hour, day, month, year, wday, yday, isdst, tz) => time
- * Time.mktime(year) => time
- * Time.mktime(year, month) => time
- * Time.mktime(year, month, day) => time
- * Time.mktime(year, month, day, hour) => time
- * Time.mktime(year, month, day, hour, min) => time
- * Time.mktime(year, month, day, hour, min, sec_with_frac) => time
- * Time.mktime(year, month, day, hour, min, sec, usec_with_frac) => time
- * Time.mktime(sec, min, hour, day, month, year, wday, yday, isdst, tz) => time
- *
+ * Time.local( year [, month, day, hour, min, sec, usec] ) => time
+ * Time.local( sec, min, hour, day, month, year, wday, yday, isdst,
+ * tz ) => time
+ * Time.mktime( year, month, day, hour, min, sec, usec ) => time
+ *
* Same as <code>Time::gm</code>, but interprets the values in the
* local time zone.
- *
- * Time.local(2000,"jan",1,20,15,1) #=> 2000-01-01 20:15:01 -0600
+ *
+ * Time.local(2000,"jan",1,20,15,1) #=> Sat Jan 01 20:15:01 CST 2000
*/
static VALUE
-time_s_mktime(int argc, VALUE *argv, VALUE klass)
+time_s_mktime(argc, argv, klass)
+ int argc;
+ VALUE *argv;
+ VALUE klass;
{
return time_utc_or_local(argc, argv, Qfalse, klass);
}
@@ -2256,188 +877,104 @@ time_s_mktime(int argc, VALUE *argv, VALUE klass)
* call-seq:
* time.to_i => int
* time.tv_sec => int
- *
+ *
* Returns the value of <i>time</i> as an integer number of seconds
- * since the Epoch.
- *
+ * since epoch.
+ *
* t = Time.now
* "%10.5f" % t.to_f #=> "1049896564.17839"
* t.to_i #=> 1049896564
*/
static VALUE
-time_to_i(VALUE time)
+time_to_i(time)
+ VALUE time;
{
struct time_object *tobj;
GetTimeval(time, tobj);
- return div(tobj->timev, INT2FIX(1));
+ return LONG2NUM(tobj->tv.tv_sec);
}
/*
* call-seq:
* time.to_f => float
- *
+ *
* Returns the value of <i>time</i> as a floating point number of
- * seconds since the Epoch.
- *
+ * seconds since epoch.
+ *
* t = Time.now
* "%10.5f" % t.to_f #=> "1049896564.13654"
* t.to_i #=> 1049896564
- *
- * Note that IEEE 754 double is not accurate enough to represent
- * nanoseconds from the Epoch.
- */
-
-static VALUE
-time_to_f(VALUE time)
-{
- struct time_object *tobj;
-
- GetTimeval(time, tobj);
- return rb_Float(tobj->timev);
-}
-
-/*
- * call-seq:
- * time.to_r => Rational
- *
- * Returns the value of <i>time</i> as a rational number of seconds
- * since the Epoch.
- *
- * t = Time.now
- * p t.to_r #=> (8807170717088293/8388608)
- *
- * This methods is intended to be used to get an accurate value
- * representing nanoseconds from the Epoch. You can use this
- * to convert time to another Epoch.
*/
static VALUE
-time_to_r(VALUE time)
+time_to_f(time)
+ VALUE time;
{
struct time_object *tobj;
GetTimeval(time, tobj);
- return tobj->timev;
+ return rb_float_new((double)tobj->tv.tv_sec+(double)tobj->tv.tv_usec/1e6);
}
/*
* call-seq:
* time.usec => int
* time.tv_usec => int
- *
+ *
* Returns just the number of microseconds for <i>time</i>.
- *
- * t = Time.now #=> 2007-11-19 08:03:26 -0600
- * "%10.6f" % t.to_f #=> "1195481006.775195"
- * t.usec #=> 775195
+ *
+ * t = Time.now #=> Wed Apr 09 08:56:04 CDT 2003
+ * "%10.6f" % t.to_f #=> "1049896564.259970"
+ * t.usec #=> 259970
*/
static VALUE
-time_usec(VALUE time)
-{
- struct time_object *tobj;
-
- GetTimeval(time, tobj);
- return rb_to_int(mul(mod(tobj->timev, INT2FIX(1)), INT2FIX(1000000)));
-}
-
-/*
- * call-seq:
- * time.nsec => int
- * time.tv_nsec => int
- *
- * Returns just the number of nanoseconds for <i>time</i>.
- *
- * t = Time.now #=> 2007-11-17 15:18:03 +0900
- * "%10.9f" % t.to_f #=> "1195280283.536151409"
- * t.nsec #=> 536151406
- *
- * The lowest digit of to_f and nsec is different because
- * IEEE 754 double is not accurate enough to represent
- * nanoseconds from the Epoch.
- * The accurate value is returned by nsec.
- */
-
-static VALUE
-time_nsec(VALUE time)
-{
- struct time_object *tobj;
-
- GetTimeval(time, tobj);
- return rb_to_int(mul(mod(tobj->timev, INT2FIX(1)), INT2FIX(1000000000)));
-}
-
-/*
- * call-seq:
- * time.subsec => number
- *
- * Returns just the fraction for <i>time</i>.
- *
- * The result is possibly rational.
- *
- * t = Time.now #=> 2009-03-26 22:33:12 +0900
- * "%10.9f" % t.to_f #=> "1238074392.940563917"
- * t.subsec #=> (94056401/100000000)
- *
- * The lowest digit of to_f and subsec is different because
- * IEEE 754 double is not accurate enough to represent
- * the rational.
- * The accurate value is returned by subsec.
- */
-
-static VALUE
-time_subsec(VALUE time)
+time_usec(time)
+ VALUE time;
{
struct time_object *tobj;
GetTimeval(time, tobj);
- return mod(tobj->timev, INT2FIX(1));
+ return LONG2NUM(tobj->tv.tv_usec);
}
/*
* call-seq:
- * time <=> other_time => -1, 0, +1
- *
- * Comparison---Compares <i>time</i> with <i>other_time</i>.
- *
- * t = Time.now #=> 2007-11-19 08:12:12 -0600
- * t2 = t + 2592000 #=> 2007-12-19 08:12:12 -0600
- * t <=> t2 #=> -1
- * t2 <=> t #=> 1
- *
- * t = Time.now #=> 2007-11-19 08:13:38 -0600
- * t2 = t + 0.1 #=> 2007-11-19 08:13:38 -0600
- * t.nsec #=> 98222999
- * t2.nsec #=> 198222999
+ * time <=> other_time => -1, 0, +1
+ * time <=> numeric => -1, 0, +1
+ *
+ * Comparison---Compares <i>time</i> with <i>other_time</i> or with
+ * <i>numeric</i>, which is the number of seconds (possibly
+ * fractional) since epoch.
+ *
+ * t = Time.now #=> Wed Apr 09 08:56:03 CDT 2003
+ * t2 = t + 2592000 #=> Fri May 09 08:56:03 CDT 2003
* t <=> t2 #=> -1
* t2 <=> t #=> 1
* t <=> t #=> 0
*/
static VALUE
-time_cmp(VALUE time1, VALUE time2)
+time_cmp(time1, time2)
+ VALUE time1, time2;
{
struct time_object *tobj1, *tobj2;
- int n;
GetTimeval(time1, tobj1);
if (TYPE(time2) == T_DATA && RDATA(time2)->dfree == time_free) {
GetTimeval(time2, tobj2);
- n = rb_cmpint(cmp(tobj1->timev, tobj2->timev), tobj1->timev, tobj2->timev);
+ if (tobj1->tv.tv_sec == tobj2->tv.tv_sec) {
+ if (tobj1->tv.tv_usec == tobj2->tv.tv_usec) return INT2FIX(0);
+ if (tobj1->tv.tv_usec > tobj2->tv.tv_usec) return INT2FIX(1);
+ return INT2FIX(-1);
+ }
+ if (tobj1->tv.tv_sec > tobj2->tv.tv_sec) return INT2FIX(1);
+ return INT2FIX(-1);
}
- else {
- VALUE cmp;
-
- cmp = rb_funcall(time2, rb_intern("<=>"), 1, time1);
- if (NIL_P(cmp)) return Qnil;
- n = -rb_cmpint(cmp, time1, time2);
- }
- if (n == 0) return INT2FIX(0);
- if (n > 0) return INT2FIX(1);
- return INT2FIX(-1);
+ return Qnil;
}
/*
@@ -2450,14 +987,17 @@ time_cmp(VALUE time1, VALUE time2)
*/
static VALUE
-time_eql(VALUE time1, VALUE time2)
+time_eql(time1, time2)
+ VALUE time1, time2;
{
struct time_object *tobj1, *tobj2;
GetTimeval(time1, tobj1);
if (TYPE(time2) == T_DATA && RDATA(time2)->dfree == time_free) {
GetTimeval(time2, tobj2);
- return rb_equal(tobj1->timev, tobj2->timev);
+ if (tobj1->tv.tv_sec == tobj2->tv.tv_sec) {
+ if (tobj1->tv.tv_usec == tobj2->tv.tv_usec) return Qtrue;
+ }
}
return Qfalse;
}
@@ -2466,28 +1006,29 @@ time_eql(VALUE time1, VALUE time2)
* call-seq:
* time.utc? => true or false
* time.gmt? => true or false
- *
+ *
* Returns <code>true</code> if <i>time</i> represents a time in UTC
* (GMT).
- *
- * t = Time.now #=> 2007-11-19 08:15:23 -0600
+ *
+ * t = Time.now #=> Wed Apr 09 08:56:04 CDT 2003
* t.utc? #=> false
- * t = Time.gm(2000,"jan",1,20,15,1) #=> 2000-01-01 20:15:01 UTC
+ * t = Time.gm(2000,"jan",1,20,15,1) #=> Sat Jan 01 20:15:01 UTC 2000
* t.utc? #=> true
*
- * t = Time.now #=> 2007-11-19 08:16:03 -0600
+ * t = Time.now #=> Wed Apr 09 08:56:03 CDT 2003
* t.gmt? #=> false
- * t = Time.gm(2000,1,1,20,15,1) #=> 2000-01-01 20:15:01 UTC
+ * t = Time.gm(2000,1,1,20,15,1) #=> Sat Jan 01 20:15:01 UTC 2000
* t.gmt? #=> true
*/
static VALUE
-time_utc_p(VALUE time)
+time_utc_p(time)
+ VALUE time;
{
struct time_object *tobj;
GetTimeval(time, tobj);
- if (TIME_UTC_P(tobj)) return Qtrue;
+ if (tobj->gmt) return Qtrue;
return Qfalse;
}
@@ -2499,17 +1040,21 @@ time_utc_p(VALUE time)
*/
static VALUE
-time_hash(VALUE time)
+time_hash(time)
+ VALUE time;
{
struct time_object *tobj;
+ long hash;
GetTimeval(time, tobj);
- return rb_hash(tobj->timev);
+ hash = tobj->tv.tv_sec ^ tobj->tv.tv_usec;
+ return LONG2FIX(hash);
}
/* :nodoc: */
static VALUE
-time_init_copy(VALUE copy, VALUE time)
+time_init_copy(copy, time)
+ VALUE copy, time;
{
struct time_object *tobj, *tcopy;
@@ -2526,185 +1071,115 @@ time_init_copy(VALUE copy, VALUE time)
}
static VALUE
-time_dup(VALUE time)
+time_dup(time)
+ VALUE time;
{
VALUE dup = time_s_alloc(CLASS_OF(time));
time_init_copy(dup, time);
return dup;
}
+/*
+ * call-seq:
+ * time.localtime => time
+ *
+ * Converts <i>time</i> to local time (using the local time zone in
+ * effect for this process) modifying the receiver.
+ *
+ * t = Time.gm(2000, "jan", 1, 20, 15, 1)
+ * t.gmt? #=> true
+ * t.localtime #=> Sat Jan 01 14:15:01 CST 2000
+ * t.gmt? #=> false
+ */
+
static VALUE
-time_localtime(VALUE time)
+time_localtime(time)
+ VALUE time;
{
struct time_object *tobj;
- struct vtm vtm;
+ struct tm *tm_tmp;
+ time_t t;
GetTimeval(time, tobj);
- if (TIME_LOCALTIME_P(tobj)) {
+ if (!tobj->gmt) {
if (tobj->tm_got)
return time;
}
else {
time_modify(time);
}
-
- if (!localtimev(tobj->timev, &vtm))
+ t = tobj->tv.tv_sec;
+ tm_tmp = localtime(&t);
+ if (!tm_tmp)
rb_raise(rb_eArgError, "localtime error");
- tobj->vtm = vtm;
-
+ tobj->tm = *tm_tmp;
tobj->tm_got = 1;
- TIME_SET_LOCALTIME(tobj);
+ tobj->gmt = 0;
return time;
}
/*
* call-seq:
- * time.localtime => time
- * time.localtime(utc_offset) => time
- *
- * Converts <i>time</i> to local time (using the local time zone in
- * effect for this process) modifying the receiver.
- *
- * If _utc_offset_ is given, it is used instead of the local time.
- *
- * t = Time.utc(2000, "jan", 1, 20, 15, 1) #=> 2000-01-01 20:15:01 UTC
- * t.utc? #=> true
- *
- * t.localtime #=> 2000-01-01 14:15:01 -0600
- * t.utc? #=> false
- *
- * t.localtime("+09:00") #=> 2000-01-02 05:15:01 +0900
- * t.utc? #=> false
- */
-
-static VALUE
-time_localtime_m(int argc, VALUE *argv, VALUE time)
-{
- VALUE off;
- rb_scan_args(argc, argv, "01", &off);
-
- if (!NIL_P(off)) {
- off = utc_offset_arg(off);
- validate_utc_offset(off);
-
- time_set_utc_offset(time, off);
- return time_fixoff(time);
- }
-
- return time_localtime(time);
-}
-
-/*
- * call-seq:
* time.gmtime => time
* time.utc => time
- *
+ *
* Converts <i>time</i> to UTC (GMT), modifying the receiver.
- *
- * t = Time.now #=> 2007-11-19 08:18:31 -0600
+ *
+ * t = Time.now #=> Wed Apr 09 08:56:03 CDT 2003
* t.gmt? #=> false
- * t.gmtime #=> 2007-11-19 14:18:31 UTC
+ * t.gmtime #=> Wed Apr 09 13:56:03 UTC 2003
* t.gmt? #=> true
*
- * t = Time.now #=> 2007-11-19 08:18:51 -0600
+ * t = Time.now #=> Wed Apr 09 08:56:04 CDT 2003
* t.utc? #=> false
- * t.utc #=> 2007-11-19 14:18:51 UTC
+ * t.utc #=> Wed Apr 09 13:56:04 UTC 2003
* t.utc? #=> true
*/
static VALUE
-time_gmtime(VALUE time)
+time_gmtime(time)
+ VALUE time;
{
struct time_object *tobj;
- struct vtm vtm;
+ struct tm *tm_tmp;
+ time_t t;
GetTimeval(time, tobj);
- if (TIME_UTC_P(tobj)) {
+ if (tobj->gmt) {
if (tobj->tm_got)
return time;
}
else {
time_modify(time);
}
-
- if (!gmtimev(tobj->timev, &vtm))
+ t = tobj->tv.tv_sec;
+ tm_tmp = gmtime(&t);
+ if (!tm_tmp)
rb_raise(rb_eArgError, "gmtime error");
- tobj->vtm = vtm;
-
+ tobj->tm = *tm_tmp;
tobj->tm_got = 1;
- TIME_SET_UTC(tobj);
- return time;
-}
-
-static VALUE
-time_fixoff(VALUE time)
-{
- struct time_object *tobj;
- struct vtm vtm;
- VALUE off;
-
- GetTimeval(time, tobj);
- if (TIME_FIXOFF_P(tobj)) {
- if (tobj->tm_got)
- return time;
- }
- else {
- time_modify(time);
- }
-
- if (TIME_FIXOFF_P(tobj))
- off = tobj->vtm.utc_offset;
- else
- off = INT2FIX(0);
-
- if (!gmtimev(tobj->timev, &vtm))
- rb_raise(rb_eArgError, "gmtime error");
-
- tobj->vtm = vtm;
- vtm_add_offset(&tobj->vtm, off);
-
- tobj->tm_got = 1;
- TIME_SET_FIXOFF(tobj, off);
+ tobj->gmt = 1;
return time;
}
/*
* call-seq:
* time.getlocal => new_time
- * time.getlocal(utc_offset) => new_time
- *
+ *
* Returns a new <code>new_time</code> object representing <i>time</i> in
* local time (using the local time zone in effect for this process).
- *
- * If _utc_offset_ is given, it is used instead of the local time.
- *
- * t = Time.utc(2000,1,1,20,15,1) #=> 2000-01-01 20:15:01 UTC
- * t.utc? #=> true
- *
- * l = t.getlocal #=> 2000-01-01 14:15:01 -0600
- * l.utc? #=> false
+ *
+ * t = Time.gm(2000,1,1,20,15,1) #=> Sat Jan 01 20:15:01 UTC 2000
+ * t.gmt? #=> true
+ * l = t.getlocal #=> Sat Jan 01 14:15:01 CST 2000
+ * l.gmt? #=> false
* t == l #=> true
- *
- * j = t.getlocal("+09:00") #=> 2000-01-02 05:15:01 +0900
- * j.utc? #=> false
- * t == j #=> true
*/
static VALUE
-time_getlocaltime(int argc, VALUE *argv, VALUE time)
+time_getlocaltime(time)
+ VALUE time;
{
- VALUE off;
- rb_scan_args(argc, argv, "01", &off);
-
- if (!NIL_P(off)) {
- off = utc_offset_arg(off);
- validate_utc_offset(off);
-
- time = time_dup(time);
- time_set_utc_offset(time, off);
- return time_fixoff(time);
- }
-
return time_localtime(time_dup(time));
}
@@ -2712,92 +1187,148 @@ time_getlocaltime(int argc, VALUE *argv, VALUE time)
* call-seq:
* time.getgm => new_time
* time.getutc => new_time
- *
+ *
* Returns a new <code>new_time</code> object representing <i>time</i> in
* UTC.
- *
- * t = Time.local(2000,1,1,20,15,1) #=> 2000-01-01 20:15:01 -0600
+ *
+ * t = Time.local(2000,1,1,20,15,1) #=> Sat Jan 01 20:15:01 CST 2000
* t.gmt? #=> false
- * y = t.getgm #=> 2000-01-02 02:15:01 UTC
+ * y = t.getgm #=> Sun Jan 02 02:15:01 UTC 2000
* y.gmt? #=> true
* t == y #=> true
*/
static VALUE
-time_getgmtime(VALUE time)
+time_getgmtime(time)
+ VALUE time;
{
return time_gmtime(time_dup(time));
}
static VALUE
-time_get_tm(VALUE time, struct time_object *tobj)
+time_get_tm(time, gmt)
+ VALUE time;
+ int gmt;
{
- if (TIME_UTC_P(tobj)) return time_gmtime(time);
- if (TIME_FIXOFF_P(tobj)) return time_fixoff(time);
+ if (gmt) return time_gmtime(time);
return time_localtime(time);
}
-static VALUE strftimev(const char *fmt, VALUE time);
-
/*
* call-seq:
* time.asctime => string
* time.ctime => string
- *
+ *
* Returns a canonical string representation of <i>time</i>.
- *
+ *
* Time.now.asctime #=> "Wed Apr 9 08:56:03 2003"
*/
static VALUE
-time_asctime(VALUE time)
+time_asctime(time)
+ VALUE time;
{
struct time_object *tobj;
+ char *s;
GetTimeval(time, tobj);
- return strftimev("%a %b %e %T %Y", time);
+ if (tobj->tm_got == 0) {
+ time_get_tm(time, tobj->gmt);
+ }
+ s = asctime(&tobj->tm);
+ if (s[24] == '\n') s[24] = '\0';
+
+ return rb_str_new2(s);
}
/*
* call-seq:
* time.inspect => string
* time.to_s => string
- *
+ *
* Returns a string representing <i>time</i>. Equivalent to calling
- * <code>Time#strftime</code> with a format string of
- * ``<code>%Y-%m-%d</code> <code>%H:%M:%S</code> <code>%z</code>''
- * for a local time and
- * ``<code>%Y-%m-%d</code> <code>%H:%M:%S</code> <code>UTC</code>''
- * for a UTC time.
- *
- * Time.now.to_s #=> "2007-10-05 16:09:51 +0900"
- * Time.now.utc.to_s #=> "2007-10-05 07:09:51 UTC"
+ * <code>Time#strftime</code> with a format string of ``<code>%a</code>
+ * <code>%b</code> <code>%d</code> <code>%H:%M:%S</code>
+ * <code>%Z</code> <code>%Y</code>''.
+ *
+ * Time.now.to_s #=> "Wed Apr 09 08:56:04 CDT 2003"
*/
static VALUE
-time_to_s(VALUE time)
+time_to_s(time)
+ VALUE time;
{
struct time_object *tobj;
+ char buf[128];
+ int len;
GetTimeval(time, tobj);
- if (TIME_UTC_P(tobj))
- return strftimev("%Y-%m-%d %H:%M:%S UTC", time);
- else
- return strftimev("%Y-%m-%d %H:%M:%S %z", time);
+ if (tobj->tm_got == 0) {
+ time_get_tm(time, tobj->gmt);
+ }
+ if (tobj->gmt == 1) {
+ len = strftime(buf, 128, "%a %b %d %H:%M:%S UTC %Y", &tobj->tm);
+ }
+ else {
+ time_t off;
+ char buf2[32];
+ char sign = '+';
+#if defined(HAVE_STRUCT_TM_TM_GMTOFF)
+ off = tobj->tm.tm_gmtoff;
+#else
+ VALUE tmp = time_utc_offset(time);
+ off = NUM2INT(tmp);
+#endif
+ if (off < 0) {
+ sign = '-';
+ off = -off;
+ }
+ sprintf(buf2, "%%a %%b %%d %%H:%%M:%%S %c%02d%02d %%Y",
+ sign, (int)(off/3600), (int)(off%3600/60));
+ len = strftime(buf, 128, buf2, &tobj->tm);
+ }
+ return rb_str_new(buf, len);
}
static VALUE
-time_add(struct time_object *tobj, VALUE offset, int sign)
+time_add(tobj, offset, sign)
+ struct time_object *tobj;
+ VALUE offset;
+ int sign;
{
+ double v = NUM2DBL(offset);
+ double f, d;
+ unsigned_time_t sec_off;
+ time_t usec_off, sec, usec;
VALUE result;
- offset = num_exact(offset);
- if (sign < 0)
- result = time_new_timev(rb_cTime, sub(tobj->timev, offset));
- else
- result = time_new_timev(rb_cTime, add(tobj->timev, offset));
- if (TIME_UTC_P(tobj)) {
+
+ if (v < 0) {
+ v = -v;
+ sign = -sign;
+ }
+ d = modf(v, &f);
+ sec_off = (unsigned_time_t)f;
+ if (f != (double)sec_off)
+ rb_raise(rb_eRangeError, "time %s %f out of Time range",
+ sign < 0 ? "-" : "+", v);
+ usec_off = (time_t)(d*1e6+0.5);
+
+ if (sign < 0) {
+ sec = tobj->tv.tv_sec - sec_off;
+ usec = tobj->tv.tv_usec - usec_off;
+ if (sec > tobj->tv.tv_sec)
+ rb_raise(rb_eRangeError, "time - %f out of Time range", v);
+ }
+ else {
+ sec = tobj->tv.tv_sec + sec_off;
+ usec = tobj->tv.tv_usec + usec_off;
+ if (sec < tobj->tv.tv_sec)
+ rb_raise(rb_eRangeError, "time + %f out of Time range", v);
+ }
+ result = rb_time_new(sec, usec);
+ if (tobj->gmt) {
GetTimeval(result, tobj);
- TIME_SET_UTC(tobj);
+ tobj->gmt = 1;
}
return result;
}
@@ -2805,16 +1336,17 @@ time_add(struct time_object *tobj, VALUE offset, int sign)
/*
* call-seq:
* time + numeric => time
- *
+ *
* Addition---Adds some number of seconds (possibly fractional) to
* <i>time</i> and returns that value as a new time.
- *
- * t = Time.now #=> 2007-11-19 08:22:21 -0600
- * t + (60 * 60 * 24) #=> 2007-11-20 08:22:21 -0600
+ *
+ * t = Time.now #=> Wed Apr 09 08:56:03 CDT 2003
+ * t + (60 * 60 * 24) #=> Thu Apr 10 08:56:03 CDT 2003
*/
static VALUE
-time_plus(VALUE time1, VALUE time2)
+time_plus(time1, time2)
+ VALUE time1, time2;
{
struct time_object *tobj;
GetTimeval(time1, tobj);
@@ -2829,28 +1361,34 @@ time_plus(VALUE time1, VALUE time2)
* call-seq:
* time - other_time => float
* time - numeric => time
- *
+ *
* Difference---Returns a new time that represents the difference
* between two times, or subtracts the given number of seconds in
* <i>numeric</i> from <i>time</i>.
- *
- * t = Time.now #=> 2007-11-19 08:23:10 -0600
- * t2 = t + 2592000 #=> 2007-12-19 08:23:10 -0600
+ *
+ * t = Time.now #=> Wed Apr 09 08:56:03 CDT 2003
+ * t2 = t + 2592000 #=> Fri May 09 08:56:03 CDT 2003
* t2 - t #=> 2592000.0
- * t2 - 2592000 #=> 2007-11-19 08:23:10 -0600
+ * t2 - 2592000 #=> Wed Apr 09 08:56:03 CDT 2003
*/
static VALUE
-time_minus(VALUE time1, VALUE time2)
+time_minus(time1, time2)
+ VALUE time1, time2;
{
struct time_object *tobj;
GetTimeval(time1, tobj);
if (TYPE(time2) == T_DATA && RDATA(time2)->dfree == time_free) {
struct time_object *tobj2;
+ double f;
GetTimeval(time2, tobj2);
- return rb_Float(sub(tobj->timev, tobj2->timev));
+ f = (double)tobj->tv.tv_sec - (double)tobj2->tv.tv_sec;
+ f += ((double)tobj->tv.tv_usec - (double)tobj2->tv.tv_usec)*1e-6;
+ /* XXX: should check float overflow on 64bit time_t platforms */
+
+ return rb_float_new(f);
}
return time_add(tobj, time2, -1);
}
@@ -2860,366 +1398,249 @@ time_minus(VALUE time1, VALUE time2)
* time.succ => new_time
*
* Return a new time object, one second later than <code>time</code>.
- *
- * t = Time.now #=> 2007-11-19 08:23:57 -0600
- * t.succ #=> 2007-11-19 08:23:58 -0600
*/
static VALUE
-time_succ(VALUE time)
+time_succ(time)
+ VALUE time;
{
struct time_object *tobj;
- struct time_object *tobj2;
+ int gmt;
GetTimeval(time, tobj);
- time = time_new_timev(rb_cTime, add(tobj->timev, INT2FIX(1)));
- GetTimeval(time, tobj2);
- TIME_COPY_GMT(tobj2, tobj);
+ gmt = tobj->gmt;
+ time = rb_time_new(tobj->tv.tv_sec + 1, tobj->tv.tv_usec);
+ GetTimeval(time, tobj);
+ tobj->gmt = gmt;
return time;
}
-VALUE
-rb_time_succ(VALUE time)
-{
- return time_succ(time);
-}
-
/*
* call-seq:
* time.sec => fixnum
- *
+ *
* Returns the second of the minute (0..60)<em>[Yes, seconds really can
* range from zero to 60. This allows the system to inject leap seconds
* every now and then to correct for the fact that years are not really
* a convenient number of hours long.]</em> for <i>time</i>.
- *
- * t = Time.now #=> 2007-11-19 08:25:02 -0600
- * t.sec #=> 2
+ *
+ * t = Time.now #=> Wed Apr 09 08:56:04 CDT 2003
+ * t.sec #=> 4
*/
static VALUE
-time_sec(VALUE time)
+time_sec(time)
+ VALUE time;
{
struct time_object *tobj;
GetTimeval(time, tobj);
- MAKE_TM(time, tobj);
- return INT2FIX(tobj->vtm.sec);
+ if (tobj->tm_got == 0) {
+ time_get_tm(time, tobj->gmt);
+ }
+ return INT2FIX(tobj->tm.tm_sec);
}
/*
* call-seq:
* time.min => fixnum
- *
+ *
* Returns the minute of the hour (0..59) for <i>time</i>.
- *
- * t = Time.now #=> 2007-11-19 08:25:51 -0600
- * t.min #=> 25
+ *
+ * t = Time.now #=> Wed Apr 09 08:56:03 CDT 2003
+ * t.min #=> 56
*/
static VALUE
-time_min(VALUE time)
+time_min(time)
+ VALUE time;
{
struct time_object *tobj;
GetTimeval(time, tobj);
- MAKE_TM(time, tobj);
- return INT2FIX(tobj->vtm.min);
+ if (tobj->tm_got == 0) {
+ time_get_tm(time, tobj->gmt);
+ }
+ return INT2FIX(tobj->tm.tm_min);
}
/*
* call-seq:
* time.hour => fixnum
- *
+ *
* Returns the hour of the day (0..23) for <i>time</i>.
- *
- * t = Time.now #=> 2007-11-19 08:26:20 -0600
+ *
+ * t = Time.now #=> Wed Apr 09 08:56:03 CDT 2003
* t.hour #=> 8
*/
static VALUE
-time_hour(VALUE time)
+time_hour(time)
+ VALUE time;
{
struct time_object *tobj;
GetTimeval(time, tobj);
- MAKE_TM(time, tobj);
- return INT2FIX(tobj->vtm.hour);
+ if (tobj->tm_got == 0) {
+ time_get_tm(time, tobj->gmt);
+ }
+ return INT2FIX(tobj->tm.tm_hour);
}
/*
* call-seq:
* time.day => fixnum
* time.mday => fixnum
- *
+ *
* Returns the day of the month (1..n) for <i>time</i>.
- *
- * t = Time.now #=> 2007-11-19 08:27:03 -0600
- * t.day #=> 19
- * t.mday #=> 19
+ *
+ * t = Time.now #=> Wed Apr 09 08:56:03 CDT 2003
+ * t.day #=> 9
+ * t.mday #=> 9
*/
static VALUE
-time_mday(VALUE time)
+time_mday(time)
+ VALUE time;
{
struct time_object *tobj;
GetTimeval(time, tobj);
- MAKE_TM(time, tobj);
- return INT2FIX(tobj->vtm.mday);
+ if (tobj->tm_got == 0) {
+ time_get_tm(time, tobj->gmt);
+ }
+ return INT2FIX(tobj->tm.tm_mday);
}
/*
* call-seq:
* time.mon => fixnum
* time.month => fixnum
- *
+ *
* Returns the month of the year (1..12) for <i>time</i>.
- *
- * t = Time.now #=> 2007-11-19 08:27:30 -0600
- * t.mon #=> 11
- * t.month #=> 11
+ *
+ * t = Time.now #=> Wed Apr 09 08:56:03 CDT 2003
+ * t.mon #=> 4
+ * t.month #=> 4
*/
static VALUE
-time_mon(VALUE time)
+time_mon(time)
+ VALUE time;
{
struct time_object *tobj;
GetTimeval(time, tobj);
- MAKE_TM(time, tobj);
- return INT2FIX(tobj->vtm.mon);
+ if (tobj->tm_got == 0) {
+ time_get_tm(time, tobj->gmt);
+ }
+ return INT2FIX(tobj->tm.tm_mon+1);
}
/*
* call-seq:
* time.year => fixnum
- *
+ *
* Returns the year for <i>time</i> (including the century).
- *
- * t = Time.now #=> 2007-11-19 08:27:51 -0600
- * t.year #=> 2007
+ *
+ * t = Time.now #=> Wed Apr 09 08:56:04 CDT 2003
+ * t.year #=> 2003
*/
static VALUE
-time_year(VALUE time)
+time_year(time)
+ VALUE time;
{
struct time_object *tobj;
GetTimeval(time, tobj);
- MAKE_TM(time, tobj);
- return tobj->vtm.year;
+ if (tobj->tm_got == 0) {
+ time_get_tm(time, tobj->gmt);
+ }
+ return LONG2NUM((long)tobj->tm.tm_year+1900);
}
/*
* call-seq:
* time.wday => fixnum
- *
+ *
* Returns an integer representing the day of the week, 0..6, with
* Sunday == 0.
- *
- * t = Time.now #=> 2007-11-20 02:35:35 -0600
- * t.wday #=> 2
- * t.sunday? #=> false
- * t.monday? #=> false
- * t.tuesday? #=> true
- * t.wednesday? #=> false
- * t.thursday? #=> false
- * t.friday? #=> false
- * t.saturday? #=> false
+ *
+ * t = Time.now #=> Wed Apr 09 08:56:04 CDT 2003
+ * t.wday #=> 3
*/
static VALUE
-time_wday(VALUE time)
+time_wday(time)
+ VALUE time;
{
struct time_object *tobj;
GetTimeval(time, tobj);
- MAKE_TM(time, tobj);
- return INT2FIX(tobj->vtm.wday);
-}
-
-#define wday_p(n) {\
- struct time_object *tobj;\
- GetTimeval(time, tobj);\
- MAKE_TM(time, tobj);\
- return (tobj->vtm.wday == (n)) ? Qtrue : Qfalse;\
-}
-
-/*
- * call-seq:
- * time.sunday? => true or false
- *
- * Returns <code>true</code> if <i>time</i> represents Sunday.
- *
- * t = Time.local(1990, 4, 1) #=> 1990-04-01 00:00:00 -0600
- * t.sunday? #=> true
- */
-
-static VALUE
-time_sunday(VALUE time)
-{
- wday_p(0);
-}
-
-/*
- * call-seq:
- * time.monday? => true or false
- *
- * Returns <code>true</code> if <i>time</i> represents Monday.
- *
- * t = Time.local(2003, 8, 4) #=> 2003-08-04 00:00:00 -0500
- * p t.monday? #=> true
- */
-
-static VALUE
-time_monday(VALUE time)
-{
- wday_p(1);
-}
-
-/*
- * call-seq:
- * time.tuesday? => true or false
- *
- * Returns <code>true</code> if <i>time</i> represents Tuesday.
- *
- * t = Time.local(1991, 2, 19) #=> 1991-02-19 00:00:00 -0600
- * p t.tuesday? #=> true
- */
-
-static VALUE
-time_tuesday(VALUE time)
-{
- wday_p(2);
-}
-
-/*
- * call-seq:
- * time.wednesday? => true or false
- *
- * Returns <code>true</code> if <i>time</i> represents Wednesday.
- *
- * t = Time.local(1993, 2, 24) #=> 1993-02-24 00:00:00 -0600
- * p t.wednesday? #=> true
- */
-
-static VALUE
-time_wednesday(VALUE time)
-{
- wday_p(3);
-}
-
-/*
- * call-seq:
- * time.thursday? => true or false
- *
- * Returns <code>true</code> if <i>time</i> represents Thursday.
- *
- * t = Time.local(1995, 12, 21) #=> 1995-12-21 00:00:00 -0600
- * p t.thursday? #=> true
- */
-
-static VALUE
-time_thursday(VALUE time)
-{
- wday_p(4);
-}
-
-/*
- * call-seq:
- * time.friday? => true or false
- *
- * Returns <code>true</code> if <i>time</i> represents Friday.
- *
- * t = Time.local(1987, 12, 18) #=> 1987-12-18 00:00:00 -0600
- * t.friday? #=> true
- */
-
-static VALUE
-time_friday(VALUE time)
-{
- wday_p(5);
-}
-
-/*
- * call-seq:
- * time.saturday? => true or false
- *
- * Returns <code>true</code> if <i>time</i> represents Saturday.
- *
- * t = Time.local(2006, 6, 10) #=> 2006-06-10 00:00:00 -0500
- * t.saturday? #=> true
- */
-
-static VALUE
-time_saturday(VALUE time)
-{
- wday_p(6);
+ if (tobj->tm_got == 0) {
+ time_get_tm(time, tobj->gmt);
+ }
+ return INT2FIX(tobj->tm.tm_wday);
}
/*
* call-seq:
* time.yday => fixnum
- *
+ *
* Returns an integer representing the day of the year, 1..366.
- *
- * t = Time.now #=> 2007-11-19 08:32:31 -0600
- * t.yday #=> 323
+ *
+ * t = Time.now #=> Wed Apr 09 08:56:04 CDT 2003
+ * t.yday #=> 99
*/
static VALUE
-time_yday(VALUE time)
+time_yday(time)
+ VALUE time;
{
struct time_object *tobj;
GetTimeval(time, tobj);
- MAKE_TM(time, tobj);
- return INT2FIX(tobj->vtm.yday);
+ if (tobj->tm_got == 0) {
+ time_get_tm(time, tobj->gmt);
+ }
+ return INT2FIX(tobj->tm.tm_yday+1);
}
/*
* call-seq:
* time.isdst => true or false
* time.dst? => true or false
- *
+ *
* Returns <code>true</code> if <i>time</i> occurs during Daylight
* Saving Time in its time zone.
- *
- * # CST6CDT:
- * Time.local(2000, 1, 1).zone #=> "CST"
- * Time.local(2000, 1, 1).isdst #=> false
- * Time.local(2000, 1, 1).dst? #=> false
- * Time.local(2000, 7, 1).zone #=> "CDT"
+ *
* Time.local(2000, 7, 1).isdst #=> true
- * Time.local(2000, 7, 1).dst? #=> true
- *
- * # Asia/Tokyo:
- * Time.local(2000, 1, 1).zone #=> "JST"
* Time.local(2000, 1, 1).isdst #=> false
+ * Time.local(2000, 7, 1).dst? #=> true
* Time.local(2000, 1, 1).dst? #=> false
- * Time.local(2000, 7, 1).zone #=> "JST"
- * Time.local(2000, 7, 1).isdst #=> false
- * Time.local(2000, 7, 1).dst? #=> false
*/
static VALUE
-time_isdst(VALUE time)
+time_isdst(time)
+ VALUE time;
{
struct time_object *tobj;
GetTimeval(time, tobj);
- MAKE_TM(time, tobj);
- return tobj->vtm.isdst ? Qtrue : Qfalse;
+ if (tobj->tm_got == 0) {
+ time_get_tm(time, tobj->gmt);
+ }
+ return tobj->tm.tm_isdst?Qtrue:Qfalse;
}
/*
* call-seq:
* time.zone => string
- *
+ *
* Returns the name of the time zone used for <i>time</i>. As of Ruby
* 1.8, returns ``UTC'' rather than ``GMT'' for UTC times.
- *
+ *
* t = Time.gm(2000, "jan", 1, 20, 15, 1)
* t.zone #=> "UTC"
* t = Time.local(2000, "jan", 1, 20, 15, 1)
@@ -3227,19 +1648,31 @@ time_isdst(VALUE time)
*/
static VALUE
-time_zone(VALUE time)
+time_zone(time)
+ VALUE time;
{
struct time_object *tobj;
-
+#if !defined(HAVE_TM_ZONE) && (!defined(HAVE_TZNAME) || !defined(HAVE_DAYLIGHT))
+ char buf[64];
+ int len;
+#endif
+
GetTimeval(time, tobj);
- MAKE_TM(time, tobj);
+ if (tobj->tm_got == 0) {
+ time_get_tm(time, tobj->gmt);
+ }
- if (TIME_UTC_P(tobj)) {
+ if (tobj->gmt == 1) {
return rb_str_new2("UTC");
}
- if (tobj->vtm.zone == NULL)
- return Qnil;
- return rb_str_new2(tobj->vtm.zone);
+#if defined(HAVE_TM_ZONE)
+ return rb_str_new2(tobj->tm.tm_zone);
+#elif defined(HAVE_TZNAME) && defined(HAVE_DAYLIGHT)
+ return rb_str_new2(tzname[daylight && tobj->tm.tm_isdst]);
+#else
+ len = strftime(buf, 64, "%Z", &tobj->tm);
+ return rb_str_new(buf, len);
+#endif
}
/*
@@ -3247,76 +1680,102 @@ time_zone(VALUE time)
* time.gmt_offset => fixnum
* time.gmtoff => fixnum
* time.utc_offset => fixnum
- *
+ *
* Returns the offset in seconds between the timezone of <i>time</i>
* and UTC.
- *
- * t = Time.gm(2000,1,1,20,15,1) #=> 2000-01-01 20:15:01 UTC
+ *
+ * t = Time.gm(2000,1,1,20,15,1) #=> Sat Jan 01 20:15:01 UTC 2000
* t.gmt_offset #=> 0
- * l = t.getlocal #=> 2000-01-01 14:15:01 -0600
+ * l = t.getlocal #=> Sat Jan 01 14:15:01 CST 2000
* l.gmt_offset #=> -21600
*/
static VALUE
-time_utc_offset(VALUE time)
+time_utc_offset(time)
+ VALUE time;
{
struct time_object *tobj;
GetTimeval(time, tobj);
- MAKE_TM(time, tobj);
+ if (tobj->tm_got == 0) {
+ time_get_tm(time, tobj->gmt);
+ }
- if (TIME_UTC_P(tobj)) {
+ if (tobj->gmt == 1) {
return INT2FIX(0);
}
else {
- return tobj->vtm.utc_offset;
+#if defined(HAVE_STRUCT_TM_TM_GMTOFF)
+ return INT2NUM(tobj->tm.tm_gmtoff);
+#else
+ struct tm *u, *l;
+ time_t t;
+ long off;
+ l = &tobj->tm;
+ t = tobj->tv.tv_sec;
+ u = gmtime(&t);
+ if (!u)
+ rb_raise(rb_eArgError, "gmtime error");
+ if (l->tm_year != u->tm_year)
+ off = l->tm_year < u->tm_year ? -1 : 1;
+ else if (l->tm_mon != u->tm_mon)
+ off = l->tm_mon < u->tm_mon ? -1 : 1;
+ else if (l->tm_mday != u->tm_mday)
+ off = l->tm_mday < u->tm_mday ? -1 : 1;
+ else
+ off = 0;
+ off = off * 24 + l->tm_hour - u->tm_hour;
+ off = off * 60 + l->tm_min - u->tm_min;
+ off = off * 60 + l->tm_sec - u->tm_sec;
+ return LONG2FIX(off);
+#endif
}
}
/*
* call-seq:
* time.to_a => array
- *
+ *
* Returns a ten-element <i>array</i> of values for <i>time</i>:
* {<code>[ sec, min, hour, day, month, year, wday, yday, isdst, zone
* ]</code>}. See the individual methods for an explanation of the
* valid ranges of each value. The ten elements can be passed directly
* to <code>Time::utc</code> or <code>Time::local</code> to create a
* new <code>Time</code>.
- *
- * t = Time.now #=> 2007-11-19 08:36:01 -0600
- * now = t.to_a #=> [1, 36, 8, 19, 11, 2007, 1, 323, false, "CST"]
+ *
+ * now = Time.now #=> Wed Apr 09 08:56:04 CDT 2003
+ * t = now.to_a #=> [4, 56, 8, 9, 4, 2003, 3, 99, true, "CDT"]
*/
static VALUE
-time_to_a(VALUE time)
+time_to_a(time)
+ VALUE time;
{
struct time_object *tobj;
GetTimeval(time, tobj);
- MAKE_TM(time, tobj);
+ if (tobj->tm_got == 0) {
+ time_get_tm(time, tobj->gmt);
+ }
return rb_ary_new3(10,
- INT2FIX(tobj->vtm.sec),
- INT2FIX(tobj->vtm.min),
- INT2FIX(tobj->vtm.hour),
- INT2FIX(tobj->vtm.mday),
- INT2FIX(tobj->vtm.mon),
- tobj->vtm.year,
- INT2FIX(tobj->vtm.wday),
- INT2FIX(tobj->vtm.yday),
- tobj->vtm.isdst?Qtrue:Qfalse,
+ INT2FIX(tobj->tm.tm_sec),
+ INT2FIX(tobj->tm.tm_min),
+ INT2FIX(tobj->tm.tm_hour),
+ INT2FIX(tobj->tm.tm_mday),
+ INT2FIX(tobj->tm.tm_mon+1),
+ LONG2NUM((long)tobj->tm.tm_year+1900),
+ INT2FIX(tobj->tm.tm_wday),
+ INT2FIX(tobj->tm.tm_yday+1),
+ tobj->tm.tm_isdst?Qtrue:Qfalse,
time_zone(time));
}
-size_t
-rb_strftime(char *s, size_t maxsize, const char *format,
- const struct vtm *vtm, VALUE timev,
- int gmt);
-
#define SMALLBUF 100
static int
-rb_strftime_alloc(char **buf, const char *format,
- struct vtm *vtm, VALUE timev, int gmt)
+rb_strftime(buf, format, time)
+ char **buf;
+ const char *format;
+ struct tm *time;
{
int size, len, flen;
@@ -3326,12 +1785,12 @@ rb_strftime_alloc(char **buf, const char *format,
return 0;
}
errno = 0;
- len = rb_strftime(*buf, SMALLBUF, format, vtm, timev, gmt);
+ len = strftime(*buf, SMALLBUF, format, time);
if (len != 0 || (**buf == '\0' && errno != ERANGE)) return len;
for (size=1024; ; size*=2) {
*buf = xmalloc(size);
(*buf)[0] = '\0';
- len = rb_strftime(*buf, size, format, vtm, timev, gmt);
+ len = strftime(*buf, size, format, time);
/*
* buflen can be zero EITHER because there's not enough
* room in the string, or because the control command
@@ -3340,31 +1799,15 @@ rb_strftime_alloc(char **buf, const char *format,
* format string, it's not failing for lack of room.
*/
if (len > 0 || size >= 1024 * flen) return len;
- xfree(*buf);
+ free(*buf);
}
/* not reached */
}
-static VALUE
-strftimev(const char *fmt, VALUE time)
-{
- struct time_object *tobj;
- char buffer[SMALLBUF], *buf = buffer;
- long len;
- VALUE str;
-
- GetTimeval(time, tobj);
- MAKE_TM(time, tobj);
- len = rb_strftime_alloc(&buf, fmt, &tobj->vtm, tobj->timev, TIME_UTC_P(tobj));
- str = rb_str_new(buf, len);
- if (buf != buffer) xfree(buf);
- return str;
-}
-
/*
* call-seq:
* time.strftime( string ) => string
- *
+ *
* Formats <i>time</i> according to the directives in the given format
* string. Any text not listed as a directive will be passed through
* to the output string.
@@ -3375,39 +1818,17 @@ strftimev(const char *fmt, VALUE time)
* %b - The abbreviated month name (``Jan'')
* %B - The full month name (``January'')
* %c - The preferred local date and time representation
- * %C - Century (20 in 2009)
* %d - Day of the month (01..31)
- * %D - Date (%m/%d/%y)
- * %e - Day of the month, blank-padded ( 1..31)
- * %F - Equivalent to %Y-%m-%d (the ISO 8601 date format)
- * %h - Equivalent to %b
* %H - Hour of the day, 24-hour clock (00..23)
* %I - Hour of the day, 12-hour clock (01..12)
* %j - Day of the year (001..366)
- * %k - hour, 24-hour clock, blank-padded ( 0..23)
- * %l - hour, 12-hour clock, blank-padded ( 0..12)
- * %L - Millisecond of the second (000..999)
* %m - Month of the year (01..12)
* %M - Minute of the hour (00..59)
- * %n - Newline (\n)
- * %N - Fractional seconds digits, default is 9 digits (nanosecond)
- * %3N millisecond (3 digits)
- * %6N microsecond (6 digits)
- * %9N nanosecond (9 digits)
* %p - Meridian indicator (``AM'' or ``PM'')
- * %P - Meridian indicator (``am'' or ``pm'')
- * %r - time, 12-hour (same as %I:%M:%S %p)
- * %R - time, 24-hour (%H:%M)
- * %s - Number of seconds since 1970-01-01 00:00:00 UTC.
* %S - Second of the minute (00..60)
- * %t - Tab character (\t)
- * %T - time, 24-hour (%H:%M:%S)
- * %u - Day of the week as a decimal, Monday being 1. (1..7)
* %U - Week number of the current year,
* starting with the first Sunday as the first
* day of the first week (00..53)
- * %v - VMS date (%e-%b-%Y)
- * %V - Week number of year according to ISO 8601 (01..53)
* %W - Week number of the current year,
* starting with the first Monday as the first
* day of the first week (00..53)
@@ -3416,19 +1837,18 @@ strftimev(const char *fmt, VALUE time)
* %X - Preferred representation for the time alone, no date
* %y - Year without a century (00..99)
* %Y - Year with century
- * %z - Time zone as hour offset from UTC (e.g. +0900)
* %Z - Time zone name
* %% - Literal ``%'' character
- *
- * t = Time.now #=> 2007-11-19 08:37:48 -0600
- * t.strftime("Printed on %m/%d/%Y") #=> "Printed on 11/19/2007"
- * t.strftime("at %I:%M%p") #=> "at 08:37AM"
+ *
+ * t = Time.now
+ * t.strftime("Printed on %m/%d/%Y") #=> "Printed on 04/09/2003"
+ * t.strftime("at %I:%M%p") #=> "at 08:56AM"
*/
static VALUE
-time_strftime(VALUE time, VALUE format)
+time_strftime(time, format)
+ VALUE time, format;
{
- void rb_enc_copy(VALUE, VALUE);
struct time_object *tobj;
char buffer[SMALLBUF], *buf = buffer;
const char *fmt;
@@ -3436,28 +1856,27 @@ time_strftime(VALUE time, VALUE format)
VALUE str;
GetTimeval(time, tobj);
- MAKE_TM(time, tobj);
- StringValue(format);
- if (!rb_enc_str_asciicompat_p(format)) {
- rb_raise(rb_eArgError, "format should have ASCII compatible encoding");
+ if (tobj->tm_got == 0) {
+ time_get_tm(time, tobj->gmt);
}
+ StringValue(format);
format = rb_str_new4(format);
- fmt = RSTRING_PTR(format);
- len = RSTRING_LEN(format);
+ fmt = RSTRING(format)->ptr;
+ len = RSTRING(format)->len;
if (len == 0) {
rb_warning("strftime called with empty format string");
}
- else if (memchr(fmt, '\0', len)) {
+ else if (strlen(fmt) < len) {
/* Ruby string may contain \0's. */
const char *p = fmt, *pe = fmt + len;
str = rb_str_new(0, 0);
while (p < pe) {
- len = rb_strftime_alloc(&buf, p, &tobj->vtm, tobj->timev, TIME_UTC_P(tobj));
+ len = rb_strftime(&buf, p, &tobj->tm);
rb_str_cat(str, buf, len);
p += strlen(p);
if (buf != buffer) {
- xfree(buf);
+ free(buf);
buf = buffer;
}
for (fmt = p; p < pe && !*p; ++p);
@@ -3466,98 +1885,71 @@ time_strftime(VALUE time, VALUE format)
return str;
}
else {
- len = rb_strftime_alloc(&buf, RSTRING_PTR(format),
- &tobj->vtm, tobj->timev, TIME_UTC_P(tobj));
+ len = rb_strftime(&buf, RSTRING(format)->ptr, &tobj->tm);
}
str = rb_str_new(buf, len);
- if (buf != buffer) xfree(buf);
- rb_enc_copy(str, format);
+ if (buf != buffer) free(buf);
return str;
}
/*
+ * call-seq:
+ * Time.times => struct_tms
+ *
+ * Deprecated in favor of <code>Process::times</code>
+ */
+
+static VALUE
+time_s_times(obj)
+ VALUE obj;
+{
+ rb_warn("obsolete method Time::times; use Process::times");
+ return rb_proc_times(obj);
+}
+
+/*
* undocumented
*/
static VALUE
-time_mdump(VALUE time)
+time_mdump(time)
+ VALUE time;
{
struct time_object *tobj;
+ struct tm *tm;
unsigned long p, s;
char buf[8];
+ time_t t;
int i;
- VALUE str;
-
- struct vtm vtm;
- long year;
- long usec, nsec;
- VALUE subsec, subnano, v;
GetTimeval(time, tobj);
- gmtimev(tobj->timev, &vtm);
+ t = tobj->tv.tv_sec;
+ tm = gmtime(&t);
- if (FIXNUM_P(vtm.year)) {
- year = FIX2LONG(vtm.year);
- if (year < 1900 || 1900+0xffff < year)
- rb_raise(rb_eArgError, "year too big to marshal: %ld", year);
- }
- else {
- rb_raise(rb_eArgError, "year too big to marshal");
- }
+ if ((tm->tm_year & 0xffff) != tm->tm_year)
+ rb_raise(rb_eArgError, "year too big to marshal");
- subsec = vtm.subsec;
-
- subsec = mul(subsec, INT2FIX(1000000000));
- divmodv(subsec, INT2FIX(1), &v, &subnano);
- nsec = FIX2LONG(v);
- usec = nsec / 1000;
- nsec = nsec % 1000;
-
- p = 0x1UL << 31 | /* 1 */
- TIME_UTC_P(tobj) << 30 | /* 1 */
- (year-1900) << 14 | /* 16 */
- (vtm.mon-1) << 10 | /* 4 */
- vtm.mday << 5 | /* 5 */
- vtm.hour; /* 5 */
- s = vtm.min << 26 | /* 6 */
- vtm.sec << 20 | /* 6 */
- usec; /* 20 */
+ p = 0x1UL << 31 | /* 1 */
+ tobj->gmt << 30 | /* 1 */
+ tm->tm_year << 14 | /* 16 */
+ tm->tm_mon << 10 | /* 4 */
+ tm->tm_mday << 5 | /* 5 */
+ tm->tm_hour; /* 5 */
+ s = tm->tm_min << 26 | /* 6 */
+ tm->tm_sec << 20 | /* 6 */
+ tobj->tv.tv_usec; /* 20 */
for (i=0; i<4; i++) {
- buf[i] = (unsigned char)p;
+ buf[i] = p & 0xff;
p = RSHIFT(p, 8);
}
for (i=4; i<8; i++) {
- buf[i] = (unsigned char)s;
+ buf[i] = s & 0xff;
s = RSHIFT(s, 8);
}
- str = rb_str_new(buf, 8);
- rb_copy_generic_ivar(str, time);
- if (nsec) {
- /*
- * submicro is formatted in fixed-point packed BCD (without sign).
- * It represent digits under microsecond.
- * For nanosecond resolution, 3 digits (2 bytes) are used.
- * However it can be longer.
- * Extra digits are ignored for loading.
- */
- unsigned char buf[2];
- int len = sizeof(buf);
- buf[1] = (nsec % 10) << 4;
- nsec /= 10;
- buf[0] = nsec % 10;
- nsec /= 10;
- buf[0] |= (nsec % 10) << 4;
- if (buf[1] == 0)
- len = 1;
- rb_ivar_set(str, id_submicro, rb_str_new((char *)buf, len));
- }
- if (!rb_equal(subnano, INT2FIX(0))) {
- rb_ivar_set(str, id_subnano, subnano);
- }
- return str;
+ return rb_str_new(buf, 8);
}
/*
@@ -3568,12 +1960,19 @@ time_mdump(VALUE time)
*/
static VALUE
-time_dump(int argc, VALUE *argv, VALUE time)
+time_dump(argc, argv, time)
+ int argc;
+ VALUE *argv;
+ VALUE time;
{
VALUE str;
rb_scan_args(argc, argv, "01", 0);
- str = time_mdump(time);
+ str = time_mdump(time);
+ if (FL_TEST(time, FL_EXIVAR)) {
+ rb_copy_generic_ivar(str, time);
+ FL_SET(str, FL_EXIVAR);
+ }
return str;
}
@@ -3583,33 +1982,20 @@ time_dump(int argc, VALUE *argv, VALUE time)
*/
static VALUE
-time_mload(VALUE time, VALUE str)
+time_mload(time, str)
+ VALUE time, str;
{
struct time_object *tobj;
unsigned long p, s;
- time_t sec;
- long usec;
+ time_t sec, usec;
unsigned char *buf;
- struct vtm vtm;
+ struct tm tm;
int i, gmt;
- long nsec;
- VALUE timev, submicro, subnano;
time_modify(time);
-
- submicro = rb_attr_get(str, id_submicro);
- if (submicro != Qnil) {
- st_delete(rb_generic_ivar_table(str), (st_data_t*)&id_submicro, 0);
- }
- subnano = rb_attr_get(str, id_subnano);
- if (subnano != Qnil) {
- st_delete(rb_generic_ivar_table(str), (st_data_t*)&id_subnano, 0);
- }
- rb_copy_generic_ivar(time, str);
-
StringValue(str);
- buf = (unsigned char *)RSTRING_PTR(str);
- if (RSTRING_LEN(str) != 8) {
+ buf = (unsigned char *)RSTRING(str)->ptr;
+ if (RSTRING(str)->len != 8) {
rb_raise(rb_eTypeError, "marshaled time format differ");
}
@@ -3622,62 +2008,30 @@ time_mload(VALUE time, VALUE str)
}
if ((p & (1UL<<31)) == 0) {
- gmt = 0;
sec = p;
usec = s;
- nsec = usec * 1000;
- timev = add(TIMET2NUM(sec), quo(LONG2FIX(usec), LONG2FIX(1000000)));
}
else {
p &= ~(1UL<<31);
gmt = (p >> 30) & 0x1;
+ tm.tm_year = (p >> 14) & 0xffff;
+ tm.tm_mon = (p >> 10) & 0xf;
+ tm.tm_mday = (p >> 5) & 0x1f;
+ tm.tm_hour = p & 0x1f;
+ tm.tm_min = (s >> 26) & 0x3f;
+ tm.tm_sec = (s >> 20) & 0x3f;
+ tm.tm_isdst = 0;
- vtm.year = INT2FIX(((p >> 14) & 0xffff) + 1900);
- vtm.mon = ((p >> 10) & 0xf) + 1;
- vtm.mday = (p >> 5) & 0x1f;
- vtm.hour = p & 0x1f;
- vtm.min = (s >> 26) & 0x3f;
- vtm.sec = (s >> 20) & 0x3f;
- vtm.utc_offset = INT2FIX(0);
- vtm.yday = vtm.wday = 0;
- vtm.isdst = 0;
- vtm.zone = "";
-
- usec = (long)(s & 0xfffff);
- nsec = usec * 1000;
-
- if (submicro != Qnil) {
- unsigned char *ptr;
- long len;
- int digit;
- ptr = (unsigned char*)StringValuePtr(submicro);
- len = RSTRING_LEN(submicro);
- if (0 < len) {
- if (10 <= (digit = ptr[0] >> 4)) goto end_submicro;
- nsec += digit * 100;
- if (10 <= (digit = ptr[0] & 0xf)) goto end_submicro;
- nsec += digit * 10;
- }
- if (1 < len) {
- if (10 <= (digit = ptr[1] >> 4)) goto end_submicro;
- nsec += digit;
- }
-end_submicro: ;
- }
-
- vtm.subsec = quo(LONG2FIX(nsec), LONG2FIX(1000000000));
- if (subnano != Qnil) {
- subnano = num_exact(subnano);
- vtm.subsec = add(vtm.subsec, quo(subnano, LONG2FIX(1000000000)));
- }
- timev = timegmv(&vtm);
+ sec = make_time_t(&tm, Qtrue);
+ usec = (time_t)(s & 0xfffff);
}
+ time_overflow_p(&sec, &usec);
GetTimeval(time, tobj);
tobj->tm_got = 0;
- if (gmt) TIME_SET_UTC(tobj);
- tobj->timev = timev;
-
+ tobj->gmt = gmt;
+ tobj->tv.tv_sec = sec;
+ tobj->tv.tv_usec = usec;
return time;
}
@@ -3689,72 +2043,65 @@ end_submicro: ;
*/
static VALUE
-time_load(VALUE klass, VALUE str)
+time_load(klass, str)
+ VALUE klass, str;
{
VALUE time = time_s_alloc(klass);
+ if (FL_TEST(str, FL_EXIVAR)) {
+ rb_copy_generic_ivar(time, str);
+ FL_SET(time, FL_EXIVAR);
+ }
time_mload(time, str);
return time;
}
/*
* <code>Time</code> is an abstraction of dates and times. Time is
- * stored internally as the number of seconds with fraction since
- * the <em>Epoch</em>, January 1, 1970 00:00 UTC.
- * Also see the library modules <code>Date</code>.
- * The <code>Time</code> class treats GMT (Greenwich Mean Time) and
- * UTC (Coordinated Universal Time)<em>[Yes, UTC really does stand for
+ * stored internally as the number of seconds and microseconds since
+ * the <em>epoch</em>, January 1, 1970 00:00 UTC. On some operating
+ * systems, this offset is allowed to be negative. Also see the
+ * library modules <code>Date</code> and <code>ParseDate</code>. The
+ * <code>Time</code> class treats GMT (Greenwich Mean Time) and UTC
+ * (Coordinated Universal Time)<em>[Yes, UTC really does stand for
* Coordinated Universal Time. There was a committee involved.]</em>
* as equivalent. GMT is the older way of referring to these
- * baseline times but persists in the names of calls on POSIX
+ * baseline times but persists in the names of calls on Posix
* systems.
- *
- * All times may have fraction. Be aware of
+ *
+ * All times are stored with some number of microseconds. Be aware of
* this fact when comparing times with each other---times that are
* apparently equal when displayed may be different when compared.
*/
void
-Init_Time(void)
+Init_Time()
{
-#undef rb_intern
-#define rb_intern(str) rb_intern_const(str)
-
- id_eq = rb_intern("==");
- id_ne = rb_intern("!=");
- id_quo = rb_intern("quo");
- id_div = rb_intern("div");
- id_cmp = rb_intern("<=>");
- id_lshift = rb_intern("<<");
- id_divmod = rb_intern("divmod");
- id_mul = rb_intern("*");
- id_submicro = rb_intern("submicro");
- id_subnano = rb_intern("subnano");
-
rb_cTime = rb_define_class("Time", rb_cObject);
rb_include_module(rb_cTime, rb_mComparable);
rb_define_alloc_func(rb_cTime, time_s_alloc);
- rb_define_singleton_method(rb_cTime, "now", time_s_now, 0);
+ rb_define_singleton_method(rb_cTime, "now", rb_class_new_instance, -1);
rb_define_singleton_method(rb_cTime, "at", time_s_at, -1);
rb_define_singleton_method(rb_cTime, "utc", time_s_mkutc, -1);
rb_define_singleton_method(rb_cTime, "gm", time_s_mkutc, -1);
rb_define_singleton_method(rb_cTime, "local", time_s_mktime, -1);
rb_define_singleton_method(rb_cTime, "mktime", time_s_mktime, -1);
+ rb_define_singleton_method(rb_cTime, "times", time_s_times, 0);
+
rb_define_method(rb_cTime, "to_i", time_to_i, 0);
rb_define_method(rb_cTime, "to_f", time_to_f, 0);
- rb_define_method(rb_cTime, "to_r", time_to_r, 0);
rb_define_method(rb_cTime, "<=>", time_cmp, 1);
rb_define_method(rb_cTime, "eql?", time_eql, 1);
rb_define_method(rb_cTime, "hash", time_hash, 0);
- rb_define_method(rb_cTime, "initialize", time_init, -1);
+ rb_define_method(rb_cTime, "initialize", time_init, 0);
rb_define_method(rb_cTime, "initialize_copy", time_init_copy, 1);
- rb_define_method(rb_cTime, "localtime", time_localtime_m, -1);
+ rb_define_method(rb_cTime, "localtime", time_localtime, 0);
rb_define_method(rb_cTime, "gmtime", time_gmtime, 0);
rb_define_method(rb_cTime, "utc", time_gmtime, 0);
- rb_define_method(rb_cTime, "getlocal", time_getlocaltime, -1);
+ rb_define_method(rb_cTime, "getlocal", time_getlocaltime, 0);
rb_define_method(rb_cTime, "getgm", time_getgmtime, 0);
rb_define_method(rb_cTime, "getutc", time_getgmtime, 0);
@@ -3788,20 +2135,9 @@ Init_Time(void)
rb_define_method(rb_cTime, "utc?", time_utc_p, 0);
rb_define_method(rb_cTime, "gmt?", time_utc_p, 0);
- rb_define_method(rb_cTime, "sunday?", time_sunday, 0);
- rb_define_method(rb_cTime, "monday?", time_monday, 0);
- rb_define_method(rb_cTime, "tuesday?", time_tuesday, 0);
- rb_define_method(rb_cTime, "wednesday?", time_wednesday, 0);
- rb_define_method(rb_cTime, "thursday?", time_thursday, 0);
- rb_define_method(rb_cTime, "friday?", time_friday, 0);
- rb_define_method(rb_cTime, "saturday?", time_saturday, 0);
-
rb_define_method(rb_cTime, "tv_sec", time_to_i, 0);
rb_define_method(rb_cTime, "tv_usec", time_usec, 0);
rb_define_method(rb_cTime, "usec", time_usec, 0);
- rb_define_method(rb_cTime, "tv_nsec", time_nsec, 0);
- rb_define_method(rb_cTime, "nsec", time_nsec, 0);
- rb_define_method(rb_cTime, "subsec", time_subsec, 0);
rb_define_method(rb_cTime, "strftime", time_strftime, 1);
@@ -3813,8 +2149,4 @@ Init_Time(void)
rb_define_method(rb_cTime, "marshal_dump", time_mdump, 0);
rb_define_method(rb_cTime, "marshal_load", time_mload, 1);
#endif
-
-#ifdef DEBUG_FIND_TIME_NUMGUESS
- rb_define_virtual_variable("$find_time_numguess", find_time_numguess_getter, NULL);
-#endif
}
diff --git a/timev.h b/timev.h
deleted file mode 100644
index 6fa4f86415..0000000000
--- a/timev.h
+++ /dev/null
@@ -1,19 +0,0 @@
-#ifndef RUBY_TIMEV_H
-#define RUBY_TIMEV_H
-
-struct vtm {
- VALUE year; /* 2000 for example. Integer. */
- int mon; /* 1..12 */
- int mday; /* 1..31 */
- int hour; /* 0..23 */
- int min; /* 0..59 */
- int sec; /* 0..60 */
- VALUE subsec; /* 0 <= subsec < 1. possibly Rational. */
- VALUE utc_offset; /* -3600 as -01:00 for example. possibly Rational. */
- int wday; /* 0:Sunday, 1:Monday, ..., 6:Saturday */
- int yday; /* 1..366 */
- int isdst; /* 0:StandardTime 1:DayLightSavingTime */
- const char *zone; /* "JST", "EST", "EDT", etc. */
-};
-
-#endif
diff --git a/tool/asm_parse.rb b/tool/asm_parse.rb
deleted file mode 100755
index f3d7f73c99..0000000000
--- a/tool/asm_parse.rb
+++ /dev/null
@@ -1,51 +0,0 @@
-stat = {}
-
-while line = ARGF.gets
- if /\[start\] (\w+)/ =~ line
- name = $1
- puts '--------------------------------------------------------------'
- puts line
- size = 0
- len = 0
-
- while line = ARGF.gets
- if /\[start\] (\w+)/ =~ line
- puts "\t; # length: #{len}, size: #{size}"
- puts "\t; # !!"
- stat[name] = [len, size]
- #
- name = $1
- puts '--------------------------------------------------------------'
- puts line
- size = 0
- len = 0
- next
- end
-
- unless /(\ALM)|(\ALB)|(\A\.)|(\A\/)/ =~ line
- puts line
- if /\[length = (\d+)\]/ =~ line
- len += $1.to_i
- size += 1
- end
- end
-
-
- if /__NEXT_INSN__/ !~ line && /\[end \] (\w+)/ =~ line
- ename = $1
- if name != ename
- puts "!! start with #{name}, but end with #{ename}"
- end
- stat[ename] = [len, size]
- puts "\t; # length: #{len}, size: #{size}"
- break
- end
- end
- end
-end
-
-stat.sort_by{|a, b| -b[0] * 1000 - a[0]}.each{|a, b|
- puts "#{a}\t#{b.join("\t")}"
-}
-puts "total length :\t#{stat.inject(0){|r, e| r+e[1][0]}}"
-puts "total size :\t#{stat.inject(0){|r, e| r+e[1][1]}}"
diff --git a/tool/build-transcode b/tool/build-transcode
deleted file mode 100755
index fa71155530..0000000000
--- a/tool/build-transcode
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/bin/sh
-
-[ "$1" -a -d "$1" ] && { cd "$1" || exit $?; } && shift
-[ "$#" = 0 ] && set enc/trans/*.trans
-for src; do
- case "$src" in
- *.trans)
- c="`dirname $src`/`basename $src .trans`.c"
- ${BASERUBY-ruby} tool/transcode-tblgen.rb -vo "$c" "$src"
- ;;
- *)
- echo "$0: don't know how to deal with $src"
- continue
- ;;
- esac
-done
diff --git a/tool/compile_prelude.rb b/tool/compile_prelude.rb
deleted file mode 100755
index e0a011ce2d..0000000000
--- a/tool/compile_prelude.rb
+++ /dev/null
@@ -1,96 +0,0 @@
-# This file is interpreted by $(BASERUBY) and miniruby.
-# $(BASERUBY) is used for miniprelude.c.
-# miniruby is used for prelude.c.
-# Since $(BASERUBY) may be older than Ruby 1.9,
-# Ruby 1.9 feature should not be used.
-
-$:.unshift(File.expand_path("../..", __FILE__))
-
-preludes = ARGV.dup
-outfile = preludes.pop
-init_name = outfile[/\w+(?=_prelude.c\b)/] || 'prelude'
-
-C_ESC = {
- "\\" => "\\\\",
- '"' => '\"',
- "\n" => '\n',
-}
-
-0x00.upto(0x1f) {|ch| C_ESC[[ch].pack("C")] ||= "\\%03o" % ch }
-0x7f.upto(0xff) {|ch| C_ESC[[ch].pack("C")] = "\\%03o" % ch }
-C_ESC_PAT = Regexp.union(*C_ESC.keys)
-
-def c_esc(str)
- '"' + str.gsub(C_ESC_PAT) { C_ESC[$&] } + '"'
-end
-
-mkconf = nil
-setup_ruby_prefix = nil
-teardown_ruby_prefix = nil
-lines_list = preludes.map {|filename|
- lines = []
- need_ruby_prefix = false
- File.readlines(filename).each {|line|
- line.gsub!(/RbConfig::CONFIG\["(\w+)"\]/) {
- key = $1
- unless mkconf
- require 'rbconfig'
- mkconf = RbConfig::MAKEFILE_CONFIG.merge('prefix'=>'#{TMP_RUBY_PREFIX}')
- setup_ruby_prefix = "TMP_RUBY_PREFIX = $:.reverse.find{|e|e!=\".\"}.sub(%r{(.*)/lib/.*}m, \"\\\\1\")\n"
- teardown_ruby_prefix = 'Object.class_eval { remove_const "TMP_RUBY_PREFIX" }'
- end
- if RbConfig::MAKEFILE_CONFIG.has_key? key
- val = RbConfig.expand("$(#{key})", mkconf)
- need_ruby_prefix = true if /\A\#\{TMP_RUBY_PREFIX\}/ =~ val
- c_esc(val)
- else
- "nil"
- end
- }
- lines << c_esc(line)
- }
- setup_lines = []
- if need_ruby_prefix
- setup_lines << c_esc(setup_ruby_prefix)
- lines << c_esc(teardown_ruby_prefix)
- end
- [setup_lines, lines]
-}
-
-require 'erb'
-
-tmp = ERB.new(<<'EOS', nil, '%').result(binding)
-#include "ruby/ruby.h"
-#include "vm_core.h"
-
-% preludes.zip(lines_list).each_with_index {|(prelude, (setup_lines, lines)), i|
-static const char prelude_name<%=i%>[] = <%=c_esc("<internal:" + File.basename(prelude, ".rb") + ">")%>;
-static const char prelude_code<%=i%>[] =
-% (setup_lines+lines).each {|line|
-<%=line%>
-% }
-;
-% }
-
-void
-Init_<%=init_name%>(void)
-{
-% lines_list.each_with_index {|(setup_lines, lines), i|
- rb_iseq_eval(rb_iseq_compile(
- rb_usascii_str_new(prelude_code<%=i%>, sizeof(prelude_code<%=i%>) - 1),
- rb_usascii_str_new(prelude_name<%=i%>, sizeof(prelude_name<%=i%>) - 1),
- INT2FIX(<%=1-setup_lines.length%>)));
-
-% }
-#if 0
-% preludes.length.times {|i|
- puts(prelude_code<%=i%>);
-% }
-#endif
-}
-EOS
-
-open(outfile, 'w'){|f|
- f << tmp
-}
-
diff --git a/tool/config.guess b/tool/config.guess
deleted file mode 100755
index 5186e37f44..0000000000
--- a/tool/config.guess
+++ /dev/null
@@ -1,1532 +0,0 @@
-#! /bin/sh
-# Attempt to guess a canonical system name.
-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
-# Free Software Foundation, Inc.
-
-timestamp='2008-08-10'
-
-# 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 2 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.
-#
-# 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.
-#
-# 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.
-
-
-# Originally written by Per Bothner <per@bothner.com>.
-# Please send patches to <config-patches@gnu.org>. Submit a context
-# diff and a properly formatted ChangeLog entry.
-#
-# This script attempts to guess a canonical system name similar to
-# config.sub. If it succeeds, it prints the system name on stdout, and
-# exits with 0. Otherwise, it exits with 1.
-#
-# The plan is that this can be called by configure scripts if you
-# don't specify an explicit build system type.
-
-me=`echo "$0" | sed -e 's,.*/,,'`
-
-usage="\
-Usage: $0 [OPTION]
-
-Output the configuration name of the system \`$me' is run on.
-
-Operation modes:
- -h, --help print this help, then exit
- -t, --time-stamp print date of last modification, then exit
- -v, --version print version number, then exit
-
-Report bugs and patches to <config-patches@gnu.org>."
-
-version="\
-GNU config.guess ($timestamp)
-
-Originally written by Per Bothner.
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
-2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
-
-This is free software; see the source for copying conditions. There is NO
-warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
-
-help="
-Try \`$me --help' for more information."
-
-# Parse command line
-while test $# -gt 0 ; do
- case $1 in
- --time-stamp | --time* | -t )
- echo "$timestamp" ; exit ;;
- --version | -v )
- echo "$version" ; exit ;;
- --help | --h* | -h )
- echo "$usage"; exit ;;
- -- ) # Stop option processing
- shift; break ;;
- - ) # Use stdin as input.
- break ;;
- -* )
- echo "$me: invalid option $1$help" >&2
- exit 1 ;;
- * )
- break ;;
- esac
-done
-
-if test $# != 0; then
- echo "$me: too many arguments$help" >&2
- exit 1
-fi
-
-trap 'exit 1' 1 2 15
-
-# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
-# compiler to aid in system detection is discouraged as it requires
-# temporary files to be created and, as you can see below, it is a
-# headache to deal with in a portable fashion.
-
-# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
-# use `HOST_CC' if defined, but it is deprecated.
-
-# Portable tmp directory creation inspired by the Autoconf team.
-
-set_cc_for_build='
-trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
-trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
-: ${TMPDIR=/tmp} ;
- { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
- { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
- { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
- { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
-dummy=$tmp/dummy ;
-tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
-case $CC_FOR_BUILD,$HOST_CC,$CC in
- ,,) echo "int x;" > $dummy.c ;
- for c in cc gcc c89 c99 ; do
- if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
- CC_FOR_BUILD="$c"; break ;
- fi ;
- done ;
- if test x"$CC_FOR_BUILD" = x ; then
- CC_FOR_BUILD=no_compiler_found ;
- fi
- ;;
- ,,*) CC_FOR_BUILD=$CC ;;
- ,*,*) CC_FOR_BUILD=$HOST_CC ;;
-esac ; set_cc_for_build= ;'
-
-# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
-# (ghazi@noc.rutgers.edu 1994-08-24)
-if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
- PATH=$PATH:/.attbin ; export PATH
-fi
-
-UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
-UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
-UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
-UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
-
-# Note: order is significant - the case branches are not exclusive.
-
-case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
- *:NetBSD:*:*)
- # NetBSD (nbsd) targets should (where applicable) match one or
- # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
- # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
- # switched to ELF, *-*-netbsd* would select the old
- # object file format. This provides both forward
- # compatibility and a consistent mechanism for selecting the
- # object file format.
- #
- # Note: NetBSD doesn't particularly care about the vendor
- # portion of the name. We always set it to "unknown".
- sysctl="sysctl -n hw.machine_arch"
- UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
- /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
- case "${UNAME_MACHINE_ARCH}" in
- armeb) machine=armeb-unknown ;;
- arm*) machine=arm-unknown ;;
- sh3el) machine=shl-unknown ;;
- sh3eb) machine=sh-unknown ;;
- sh5el) machine=sh5le-unknown ;;
- *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
- esac
- # The Operating System including object format, if it has switched
- # to ELF recently, or will in the future.
- case "${UNAME_MACHINE_ARCH}" in
- arm*|i386|m68k|ns32k|sh3*|sparc|vax)
- eval $set_cc_for_build
- if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
- | grep __ELF__ >/dev/null
- then
- # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
- # Return netbsd for either. FIX?
- os=netbsd
- else
- os=netbsdelf
- fi
- ;;
- *)
- os=netbsd
- ;;
- esac
- # The OS release
- # Debian GNU/NetBSD machines have a different userland, and
- # thus, need a distinct triplet. However, they do not need
- # kernel version information, so it can be replaced with a
- # suitable tag, in the style of linux-gnu.
- case "${UNAME_VERSION}" in
- Debian*)
- release='-gnu'
- ;;
- *)
- release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
- ;;
- esac
- # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
- # contains redundant information, the shorter form:
- # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
- echo "${machine}-${os}${release}"
- exit ;;
- *:OpenBSD:*:*)
- UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
- echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
- exit ;;
- *:ekkoBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
- exit ;;
- *:SolidBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
- exit ;;
- macppc:MirBSD:*:*)
- echo powerpc-unknown-mirbsd${UNAME_RELEASE}
- exit ;;
- *:MirBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
- exit ;;
- alpha:OSF1:*:*)
- case $UNAME_RELEASE in
- *4.0)
- UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
- ;;
- *5.*)
- UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
- ;;
- esac
- # According to Compaq, /usr/sbin/psrinfo has been available on
- # OSF/1 and Tru64 systems produced since 1995. I hope that
- # covers most systems running today. This code pipes the CPU
- # types through head -n 1, so we only detect the type of CPU 0.
- ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
- case "$ALPHA_CPU_TYPE" in
- "EV4 (21064)")
- UNAME_MACHINE="alpha" ;;
- "EV4.5 (21064)")
- UNAME_MACHINE="alpha" ;;
- "LCA4 (21066/21068)")
- UNAME_MACHINE="alpha" ;;
- "EV5 (21164)")
- UNAME_MACHINE="alphaev5" ;;
- "EV5.6 (21164A)")
- UNAME_MACHINE="alphaev56" ;;
- "EV5.6 (21164PC)")
- UNAME_MACHINE="alphapca56" ;;
- "EV5.7 (21164PC)")
- UNAME_MACHINE="alphapca57" ;;
- "EV6 (21264)")
- UNAME_MACHINE="alphaev6" ;;
- "EV6.7 (21264A)")
- UNAME_MACHINE="alphaev67" ;;
- "EV6.8CB (21264C)")
- UNAME_MACHINE="alphaev68" ;;
- "EV6.8AL (21264B)")
- UNAME_MACHINE="alphaev68" ;;
- "EV6.8CX (21264D)")
- UNAME_MACHINE="alphaev68" ;;
- "EV6.9A (21264/EV69A)")
- UNAME_MACHINE="alphaev69" ;;
- "EV7 (21364)")
- UNAME_MACHINE="alphaev7" ;;
- "EV7.9 (21364A)")
- UNAME_MACHINE="alphaev79" ;;
- esac
- # A Pn.n version is a patched version.
- # A Vn.n version is a released version.
- # A Tn.n version is a released field test version.
- # A Xn.n version is an unreleased experimental baselevel.
- # 1.2 uses "1.2" for uname -r.
- echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
- exit ;;
- Alpha\ *:Windows_NT*:*)
- # How do we know it's Interix rather than the generic POSIX subsystem?
- # Should we change UNAME_MACHINE based on the output of uname instead
- # of the specific Alpha model?
- echo alpha-pc-interix
- exit ;;
- 21064:Windows_NT:50:3)
- echo alpha-dec-winnt3.5
- exit ;;
- Amiga*:UNIX_System_V:4.0:*)
- echo m68k-unknown-sysv4
- exit ;;
- *:[Aa]miga[Oo][Ss]:*:*)
- echo ${UNAME_MACHINE}-unknown-amigaos
- exit ;;
- *:[Mm]orph[Oo][Ss]:*:*)
- echo ${UNAME_MACHINE}-unknown-morphos
- exit ;;
- *:OS/390:*:*)
- echo i370-ibm-openedition
- exit ;;
- *:z/VM:*:*)
- echo s390-ibm-zvmoe
- exit ;;
- *:OS400:*:*)
- echo powerpc-ibm-os400
- exit ;;
- arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
- echo arm-acorn-riscix${UNAME_RELEASE}
- exit ;;
- arm:riscos:*:*|arm:RISCOS:*:*)
- echo arm-unknown-riscos
- exit ;;
- SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
- echo hppa1.1-hitachi-hiuxmpp
- exit ;;
- Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
- # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
- if test "`(/bin/universe) 2>/dev/null`" = att ; then
- echo pyramid-pyramid-sysv3
- else
- echo pyramid-pyramid-bsd
- fi
- exit ;;
- NILE*:*:*:dcosx)
- echo pyramid-pyramid-svr4
- exit ;;
- DRS?6000:unix:4.0:6*)
- echo sparc-icl-nx6
- exit ;;
- DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
- case `/usr/bin/uname -p` in
- sparc) echo sparc-icl-nx7; exit ;;
- esac ;;
- sun4H:SunOS:5.*:*)
- echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit ;;
- sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
- echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit ;;
- i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
- echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit ;;
- sun4*:SunOS:6*:*)
- # According to config.sub, this is the proper way to canonicalize
- # SunOS6. Hard to guess exactly what SunOS6 will be like, but
- # it's likely to be more like Solaris than SunOS4.
- echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit ;;
- sun4*:SunOS:*:*)
- case "`/usr/bin/arch -k`" in
- Series*|S4*)
- UNAME_RELEASE=`uname -v`
- ;;
- esac
- # Japanese Language versions have a version number like `4.1.3-JL'.
- echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
- exit ;;
- sun3*:SunOS:*:*)
- echo m68k-sun-sunos${UNAME_RELEASE}
- exit ;;
- sun*:*:4.2BSD:*)
- UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
- test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
- case "`/bin/arch`" in
- sun3)
- echo m68k-sun-sunos${UNAME_RELEASE}
- ;;
- sun4)
- echo sparc-sun-sunos${UNAME_RELEASE}
- ;;
- esac
- exit ;;
- aushp:SunOS:*:*)
- echo sparc-auspex-sunos${UNAME_RELEASE}
- exit ;;
- # The situation for MiNT is a little confusing. The machine name
- # can be virtually everything (everything which is not
- # "atarist" or "atariste" at least should have a processor
- # > m68000). The system name ranges from "MiNT" over "FreeMiNT"
- # to the lowercase version "mint" (or "freemint"). Finally
- # the system name "TOS" denotes a system which is actually not
- # MiNT. But MiNT is downward compatible to TOS, so this should
- # be no problem.
- atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
- echo m68k-atari-mint${UNAME_RELEASE}
- exit ;;
- atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
- echo m68k-atari-mint${UNAME_RELEASE}
- exit ;;
- *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
- echo m68k-atari-mint${UNAME_RELEASE}
- exit ;;
- milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
- echo m68k-milan-mint${UNAME_RELEASE}
- exit ;;
- hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
- echo m68k-hades-mint${UNAME_RELEASE}
- exit ;;
- *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
- echo m68k-unknown-mint${UNAME_RELEASE}
- exit ;;
- m68k:machten:*:*)
- echo m68k-apple-machten${UNAME_RELEASE}
- exit ;;
- powerpc:machten:*:*)
- echo powerpc-apple-machten${UNAME_RELEASE}
- exit ;;
- RISC*:Mach:*:*)
- echo mips-dec-mach_bsd4.3
- exit ;;
- RISC*:ULTRIX:*:*)
- echo mips-dec-ultrix${UNAME_RELEASE}
- exit ;;
- VAX*:ULTRIX*:*:*)
- echo vax-dec-ultrix${UNAME_RELEASE}
- exit ;;
- 2020:CLIX:*:* | 2430:CLIX:*:*)
- echo clipper-intergraph-clix${UNAME_RELEASE}
- exit ;;
- mips:*:*:UMIPS | mips:*:*:RISCos)
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
-#ifdef __cplusplus
-#include <stdio.h> /* for printf() prototype */
- int main (int argc, char *argv[]) {
-#else
- int main (argc, argv) int argc; char *argv[]; {
-#endif
- #if defined (host_mips) && defined (MIPSEB)
- #if defined (SYSTYPE_SYSV)
- printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
- #endif
- #if defined (SYSTYPE_SVR4)
- printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
- #endif
- #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
- printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
- #endif
- #endif
- exit (-1);
- }
-EOF
- $CC_FOR_BUILD -o $dummy $dummy.c &&
- dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
- SYSTEM_NAME=`$dummy $dummyarg` &&
- { echo "$SYSTEM_NAME"; exit; }
- echo mips-mips-riscos${UNAME_RELEASE}
- exit ;;
- Motorola:PowerMAX_OS:*:*)
- echo powerpc-motorola-powermax
- exit ;;
- Motorola:*:4.3:PL8-*)
- echo powerpc-harris-powermax
- exit ;;
- Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
- echo powerpc-harris-powermax
- exit ;;
- Night_Hawk:Power_UNIX:*:*)
- echo powerpc-harris-powerunix
- exit ;;
- m88k:CX/UX:7*:*)
- echo m88k-harris-cxux7
- exit ;;
- m88k:*:4*:R4*)
- echo m88k-motorola-sysv4
- exit ;;
- m88k:*:3*:R3*)
- echo m88k-motorola-sysv3
- exit ;;
- AViiON:dgux:*:*)
- # DG/UX returns AViiON for all architectures
- UNAME_PROCESSOR=`/usr/bin/uname -p`
- if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
- then
- if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
- [ ${TARGET_BINARY_INTERFACE}x = x ]
- then
- echo m88k-dg-dgux${UNAME_RELEASE}
- else
- echo m88k-dg-dguxbcs${UNAME_RELEASE}
- fi
- else
- echo i586-dg-dgux${UNAME_RELEASE}
- fi
- exit ;;
- M88*:DolphinOS:*:*) # DolphinOS (SVR3)
- echo m88k-dolphin-sysv3
- exit ;;
- M88*:*:R3*:*)
- # Delta 88k system running SVR3
- echo m88k-motorola-sysv3
- exit ;;
- XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
- echo m88k-tektronix-sysv3
- exit ;;
- Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
- echo m68k-tektronix-bsd
- exit ;;
- *:IRIX*:*:*)
- echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
- exit ;;
- ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
- echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
- exit ;; # Note that: echo "'`uname -s`'" gives 'AIX '
- i*86:AIX:*:*)
- echo i386-ibm-aix
- exit ;;
- ia64:AIX:*:*)
- if [ -x /usr/bin/oslevel ] ; then
- IBM_REV=`/usr/bin/oslevel`
- else
- IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
- fi
- echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
- exit ;;
- *:AIX:2:3)
- if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
- #include <sys/systemcfg.h>
-
- main()
- {
- if (!__power_pc())
- exit(1);
- puts("powerpc-ibm-aix3.2.5");
- exit(0);
- }
-EOF
- if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
- then
- echo "$SYSTEM_NAME"
- else
- echo rs6000-ibm-aix3.2.5
- fi
- elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
- echo rs6000-ibm-aix3.2.4
- else
- echo rs6000-ibm-aix3.2
- fi
- exit ;;
- *:AIX:*:[456])
- IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
- if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
- IBM_ARCH=rs6000
- else
- IBM_ARCH=powerpc
- fi
- if [ -x /usr/bin/oslevel ] ; then
- IBM_REV=`/usr/bin/oslevel`
- else
- IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
- fi
- echo ${IBM_ARCH}-ibm-aix${IBM_REV}
- exit ;;
- *:AIX:*:*)
- echo rs6000-ibm-aix
- exit ;;
- ibmrt:4.4BSD:*|romp-ibm:BSD:*)
- echo romp-ibm-bsd4.4
- exit ;;
- ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
- echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
- exit ;; # report: romp-ibm BSD 4.3
- *:BOSX:*:*)
- echo rs6000-bull-bosx
- exit ;;
- DPX/2?00:B.O.S.:*:*)
- echo m68k-bull-sysv3
- exit ;;
- 9000/[34]??:4.3bsd:1.*:*)
- echo m68k-hp-bsd
- exit ;;
- hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
- echo m68k-hp-bsd4.4
- exit ;;
- 9000/[34678]??:HP-UX:*:*)
- HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
- case "${UNAME_MACHINE}" in
- 9000/31? ) HP_ARCH=m68000 ;;
- 9000/[34]?? ) HP_ARCH=m68k ;;
- 9000/[678][0-9][0-9])
- if [ -x /usr/bin/getconf ]; then
- sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
- sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
- case "${sc_cpu_version}" in
- 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
- 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
- 532) # CPU_PA_RISC2_0
- case "${sc_kernel_bits}" in
- 32) HP_ARCH="hppa2.0n" ;;
- 64) HP_ARCH="hppa2.0w" ;;
- '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
- esac ;;
- esac
- fi
- if [ "${HP_ARCH}" = "" ]; then
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
-
- #define _HPUX_SOURCE
- #include <stdlib.h>
- #include <unistd.h>
-
- int main ()
- {
- #if defined(_SC_KERNEL_BITS)
- long bits = sysconf(_SC_KERNEL_BITS);
- #endif
- long cpu = sysconf (_SC_CPU_VERSION);
-
- switch (cpu)
- {
- case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
- case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
- case CPU_PA_RISC2_0:
- #if defined(_SC_KERNEL_BITS)
- switch (bits)
- {
- case 64: puts ("hppa2.0w"); break;
- case 32: puts ("hppa2.0n"); break;
- default: puts ("hppa2.0"); break;
- } break;
- #else /* !defined(_SC_KERNEL_BITS) */
- puts ("hppa2.0"); break;
- #endif
- default: puts ("hppa1.0"); break;
- }
- exit (0);
- }
-EOF
- (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
- test -z "$HP_ARCH" && HP_ARCH=hppa
- fi ;;
- esac
- if [ ${HP_ARCH} = "hppa2.0w" ]
- then
- eval $set_cc_for_build
-
- # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
- # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler
- # generating 64-bit code. GNU and HP use different nomenclature:
- #
- # $ CC_FOR_BUILD=cc ./config.guess
- # => hppa2.0w-hp-hpux11.23
- # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
- # => hppa64-hp-hpux11.23
-
- if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
- grep __LP64__ >/dev/null
- then
- HP_ARCH="hppa2.0w"
- else
- HP_ARCH="hppa64"
- fi
- fi
- echo ${HP_ARCH}-hp-hpux${HPUX_REV}
- exit ;;
- ia64:HP-UX:*:*)
- HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
- echo ia64-hp-hpux${HPUX_REV}
- exit ;;
- 3050*:HI-UX:*:*)
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
- #include <unistd.h>
- int
- main ()
- {
- long cpu = sysconf (_SC_CPU_VERSION);
- /* The order matters, because CPU_IS_HP_MC68K erroneously returns
- true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct
- results, however. */
- if (CPU_IS_PA_RISC (cpu))
- {
- switch (cpu)
- {
- case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
- case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
- case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
- default: puts ("hppa-hitachi-hiuxwe2"); break;
- }
- }
- else if (CPU_IS_HP_MC68K (cpu))
- puts ("m68k-hitachi-hiuxwe2");
- else puts ("unknown-hitachi-hiuxwe2");
- exit (0);
- }
-EOF
- $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
- { echo "$SYSTEM_NAME"; exit; }
- echo unknown-hitachi-hiuxwe2
- exit ;;
- 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
- echo hppa1.1-hp-bsd
- exit ;;
- 9000/8??:4.3bsd:*:*)
- echo hppa1.0-hp-bsd
- exit ;;
- *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
- echo hppa1.0-hp-mpeix
- exit ;;
- hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
- echo hppa1.1-hp-osf
- exit ;;
- hp8??:OSF1:*:*)
- echo hppa1.0-hp-osf
- exit ;;
- i*86:OSF1:*:*)
- if [ -x /usr/sbin/sysversion ] ; then
- echo ${UNAME_MACHINE}-unknown-osf1mk
- else
- echo ${UNAME_MACHINE}-unknown-osf1
- fi
- exit ;;
- parisc*:Lites*:*:*)
- echo hppa1.1-hp-lites
- exit ;;
- C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
- echo c1-convex-bsd
- exit ;;
- C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
- if getsysinfo -f scalar_acc
- then echo c32-convex-bsd
- else echo c2-convex-bsd
- fi
- exit ;;
- C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
- echo c34-convex-bsd
- exit ;;
- C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
- echo c38-convex-bsd
- exit ;;
- C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
- echo c4-convex-bsd
- exit ;;
- CRAY*Y-MP:*:*:*)
- echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit ;;
- CRAY*[A-Z]90:*:*:*)
- echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
- | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
- -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
- -e 's/\.[^.]*$/.X/'
- exit ;;
- CRAY*TS:*:*:*)
- echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit ;;
- CRAY*T3E:*:*:*)
- echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit ;;
- CRAY*SV1:*:*:*)
- echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit ;;
- *:UNICOS/mp:*:*)
- echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit ;;
- F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
- FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
- FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
- FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
- echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
- exit ;;
- 5000:UNIX_System_V:4.*:*)
- FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
- FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
- echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
- exit ;;
- i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
- echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
- exit ;;
- sparc*:BSD/OS:*:*)
- echo sparc-unknown-bsdi${UNAME_RELEASE}
- exit ;;
- *:BSD/OS:*:*)
- echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
- exit ;;
- *:FreeBSD:*:*)
- case ${UNAME_MACHINE} in
- pc98)
- echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
- amd64)
- echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
- *)
- echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
- esac
- exit ;;
- i*:CYGWIN*:*)
- echo ${UNAME_MACHINE}-pc-cygwin
- exit ;;
- *:MINGW*:*)
- echo ${UNAME_MACHINE}-pc-mingw32
- exit ;;
- i*:windows32*:*)
- # uname -m includes "-pc" on this system.
- echo ${UNAME_MACHINE}-mingw32
- exit ;;
- i*:PW*:*)
- echo ${UNAME_MACHINE}-pc-pw32
- exit ;;
- *:Interix*:[3456]*)
- case ${UNAME_MACHINE} in
- x86)
- echo i586-pc-interix${UNAME_RELEASE}
- exit ;;
- EM64T | authenticamd)
- echo x86_64-unknown-interix${UNAME_RELEASE}
- exit ;;
- IA64)
- echo ia64-unknown-interix${UNAME_RELEASE}
- exit ;;
- esac ;;
- [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
- echo i${UNAME_MACHINE}-pc-mks
- exit ;;
- i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
- # How do we know it's Interix rather than the generic POSIX subsystem?
- # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
- # UNAME_MACHINE based on the output of uname instead of i386?
- echo i586-pc-interix
- exit ;;
- i*:UWIN*:*)
- echo ${UNAME_MACHINE}-pc-uwin
- exit ;;
- amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
- echo x86_64-unknown-cygwin
- exit ;;
- p*:CYGWIN*:*)
- echo powerpcle-unknown-cygwin
- exit ;;
- prep*:SunOS:5.*:*)
- echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit ;;
- *:GNU:*:*)
- # the GNU system
- echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
- exit ;;
- *:GNU/*:*:*)
- # other systems with GNU libc and userland
- echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
- exit ;;
- i*86:Minix:*:*)
- echo ${UNAME_MACHINE}-pc-minix
- exit ;;
- arm*:Linux:*:*)
- eval $set_cc_for_build
- if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
- | grep -q __ARM_EABI__
- then
- echo ${UNAME_MACHINE}-unknown-linux-gnu
- else
- echo ${UNAME_MACHINE}-unknown-linux-gnueabi
- fi
- exit ;;
- avr32*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit ;;
- cris:Linux:*:*)
- echo cris-axis-linux-gnu
- exit ;;
- crisv32:Linux:*:*)
- echo crisv32-axis-linux-gnu
- exit ;;
- frv:Linux:*:*)
- echo frv-unknown-linux-gnu
- exit ;;
- ia64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit ;;
- m32r*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit ;;
- m68*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit ;;
- mips:Linux:*:*)
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
- #undef CPU
- #undef mips
- #undef mipsel
- #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
- CPU=mipsel
- #else
- #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
- CPU=mips
- #else
- CPU=
- #endif
- #endif
-EOF
- eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
- /^CPU/{
- s: ::g
- p
- }'`"
- test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
- ;;
- mips64:Linux:*:*)
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
- #undef CPU
- #undef mips64
- #undef mips64el
- #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
- CPU=mips64el
- #else
- #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
- CPU=mips64
- #else
- CPU=
- #endif
- #endif
-EOF
- eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
- /^CPU/{
- s: ::g
- p
- }'`"
- test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
- ;;
- or32:Linux:*:*)
- echo or32-unknown-linux-gnu
- exit ;;
- ppc:Linux:*:*)
- echo powerpc-unknown-linux-gnu
- exit ;;
- ppc64:Linux:*:*)
- echo powerpc64-unknown-linux-gnu
- exit ;;
- alpha:Linux:*:*)
- case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
- EV5) UNAME_MACHINE=alphaev5 ;;
- EV56) UNAME_MACHINE=alphaev56 ;;
- PCA56) UNAME_MACHINE=alphapca56 ;;
- PCA57) UNAME_MACHINE=alphapca56 ;;
- EV6) UNAME_MACHINE=alphaev6 ;;
- EV67) UNAME_MACHINE=alphaev67 ;;
- EV68*) UNAME_MACHINE=alphaev68 ;;
- esac
- objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
- if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
- echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
- exit ;;
- parisc:Linux:*:* | hppa:Linux:*:*)
- # Look for CPU level
- case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
- PA7*) echo hppa1.1-unknown-linux-gnu ;;
- PA8*) echo hppa2.0-unknown-linux-gnu ;;
- *) echo hppa-unknown-linux-gnu ;;
- esac
- exit ;;
- parisc64:Linux:*:* | hppa64:Linux:*:*)
- echo hppa64-unknown-linux-gnu
- exit ;;
- s390:Linux:*:* | s390x:Linux:*:*)
- echo ${UNAME_MACHINE}-ibm-linux
- exit ;;
- sh64*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit ;;
- sh*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit ;;
- sparc:Linux:*:* | sparc64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit ;;
- vax:Linux:*:*)
- echo ${UNAME_MACHINE}-dec-linux-gnu
- exit ;;
- x86_64:Linux:*:*)
- echo x86_64-unknown-linux-gnu
- exit ;;
- xtensa*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit ;;
- i*86:Linux:*:*)
- # The BFD linker knows what the default object file format is, so
- # first see if it will tell us. cd to the root directory to prevent
- # problems with other programs or directories called `ld' in the path.
- # Set LC_ALL=C to ensure ld outputs messages in English.
- ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
- | sed -ne '/supported targets:/!d
- s/[ ][ ]*/ /g
- s/.*supported targets: *//
- s/ .*//
- p'`
- case "$ld_supported_targets" in
- elf32-i386)
- TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
- ;;
- a.out-i386-linux)
- echo "${UNAME_MACHINE}-pc-linux-gnuaout"
- exit ;;
- coff-i386)
- echo "${UNAME_MACHINE}-pc-linux-gnucoff"
- exit ;;
- "")
- # Either a pre-BFD a.out linker (linux-gnuoldld) or
- # one that does not give us useful --help.
- echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
- exit ;;
- esac
- # Determine whether the default compiler is a.out or elf
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
- #include <features.h>
- #ifdef __ELF__
- # ifdef __GLIBC__
- # if __GLIBC__ >= 2
- LIBC=gnu
- # else
- LIBC=gnulibc1
- # endif
- # else
- LIBC=gnulibc1
- # endif
- #else
- #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
- LIBC=gnu
- #else
- LIBC=gnuaout
- #endif
- #endif
- #ifdef __dietlibc__
- LIBC=dietlibc
- #endif
-EOF
- eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
- /^LIBC/{
- s: ::g
- p
- }'`"
- test x"${LIBC}" != x && {
- echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
- exit
- }
- test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; }
- ;;
- i*86:DYNIX/ptx:4*:*)
- # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
- # earlier versions are messed up and put the nodename in both
- # sysname and nodename.
- echo i386-sequent-sysv4
- exit ;;
- i*86:UNIX_SV:4.2MP:2.*)
- # Unixware is an offshoot of SVR4, but it has its own version
- # number series starting with 2...
- # I am not positive that other SVR4 systems won't match this,
- # I just have to hope. -- rms.
- # Use sysv4.2uw... so that sysv4* matches it.
- echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
- exit ;;
- i*86:OS/2:*:*)
- # If we were able to find `uname', then EMX Unix compatibility
- # is probably installed.
- echo ${UNAME_MACHINE}-pc-os2-emx
- exit ;;
- i*86:XTS-300:*:STOP)
- echo ${UNAME_MACHINE}-unknown-stop
- exit ;;
- i*86:atheos:*:*)
- echo ${UNAME_MACHINE}-unknown-atheos
- exit ;;
- i*86:syllable:*:*)
- echo ${UNAME_MACHINE}-pc-syllable
- exit ;;
- i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
- echo i386-unknown-lynxos${UNAME_RELEASE}
- exit ;;
- i*86:*DOS:*:*)
- echo ${UNAME_MACHINE}-pc-msdosdjgpp
- exit ;;
- i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
- UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
- if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
- echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
- else
- echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
- fi
- exit ;;
- i*86:*:5:[678]*)
- # UnixWare 7.x, OpenUNIX and OpenServer 6.
- case `/bin/uname -X | grep "^Machine"` in
- *486*) UNAME_MACHINE=i486 ;;
- *Pentium) UNAME_MACHINE=i586 ;;
- *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
- esac
- echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
- exit ;;
- i*86:*:3.2:*)
- if test -f /usr/options/cb.name; then
- UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
- echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
- elif /bin/uname -X 2>/dev/null >/dev/null ; then
- UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
- (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
- (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
- && UNAME_MACHINE=i586
- (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
- && UNAME_MACHINE=i686
- (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
- && UNAME_MACHINE=i686
- echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
- else
- echo ${UNAME_MACHINE}-pc-sysv32
- fi
- exit ;;
- pc:*:*:*)
- # Left here for compatibility:
- # uname -m prints for DJGPP always 'pc', but it prints nothing about
- # the processor, so we play safe by assuming i386.
- echo i386-pc-msdosdjgpp
- exit ;;
- Intel:Mach:3*:*)
- echo i386-pc-mach3
- exit ;;
- paragon:*:*:*)
- echo i860-intel-osf1
- exit ;;
- i860:*:4.*:*) # i860-SVR4
- if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
- echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
- else # Add other i860-SVR4 vendors below as they are discovered.
- echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
- fi
- exit ;;
- mini*:CTIX:SYS*5:*)
- # "miniframe"
- echo m68010-convergent-sysv
- exit ;;
- mc68k:UNIX:SYSTEM5:3.51m)
- echo m68k-convergent-sysv
- exit ;;
- M680?0:D-NIX:5.3:*)
- echo m68k-diab-dnix
- exit ;;
- M68*:*:R3V[5678]*:*)
- test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
- 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
- OS_REL=''
- test -r /etc/.relid \
- && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
- /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
- && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
- /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
- && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
- 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
- /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
- && { echo i486-ncr-sysv4; exit; } ;;
- m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
- echo m68k-unknown-lynxos${UNAME_RELEASE}
- exit ;;
- mc68030:UNIX_System_V:4.*:*)
- echo m68k-atari-sysv4
- exit ;;
- TSUNAMI:LynxOS:2.*:*)
- echo sparc-unknown-lynxos${UNAME_RELEASE}
- exit ;;
- rs6000:LynxOS:2.*:*)
- echo rs6000-unknown-lynxos${UNAME_RELEASE}
- exit ;;
- PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
- echo powerpc-unknown-lynxos${UNAME_RELEASE}
- exit ;;
- SM[BE]S:UNIX_SV:*:*)
- echo mips-dde-sysv${UNAME_RELEASE}
- exit ;;
- RM*:ReliantUNIX-*:*:*)
- echo mips-sni-sysv4
- exit ;;
- RM*:SINIX-*:*:*)
- echo mips-sni-sysv4
- exit ;;
- *:SINIX-*:*:*)
- if uname -p 2>/dev/null >/dev/null ; then
- UNAME_MACHINE=`(uname -p) 2>/dev/null`
- echo ${UNAME_MACHINE}-sni-sysv4
- else
- echo ns32k-sni-sysv
- fi
- exit ;;
- PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
- # says <Richard.M.Bartel@ccMail.Census.GOV>
- echo i586-unisys-sysv4
- exit ;;
- *:UNIX_System_V:4*:FTX*)
- # From Gerald Hewes <hewes@openmarket.com>.
- # How about differentiating between stratus architectures? -djm
- echo hppa1.1-stratus-sysv4
- exit ;;
- *:*:*:FTX*)
- # From seanf@swdc.stratus.com.
- echo i860-stratus-sysv4
- exit ;;
- i*86:VOS:*:*)
- # From Paul.Green@stratus.com.
- echo ${UNAME_MACHINE}-stratus-vos
- exit ;;
- *:VOS:*:*)
- # From Paul.Green@stratus.com.
- echo hppa1.1-stratus-vos
- exit ;;
- mc68*:A/UX:*:*)
- echo m68k-apple-aux${UNAME_RELEASE}
- exit ;;
- news*:NEWS-OS:6*:*)
- echo mips-sony-newsos6
- exit ;;
- R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
- if [ -d /usr/nec ]; then
- echo mips-nec-sysv${UNAME_RELEASE}
- else
- echo mips-unknown-sysv${UNAME_RELEASE}
- fi
- exit ;;
- BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
- echo powerpc-be-beos
- exit ;;
- BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
- echo powerpc-apple-beos
- exit ;;
- BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
- echo i586-pc-beos
- exit ;;
- BeMac:Haiku:*:*)
- echo powerpc-apple-haiku
- exit ;;
- BePC:Haiku:*:*)
- echo i586-pc-haiku
- exit ;;
- SX-4:SUPER-UX:*:*)
- echo sx4-nec-superux${UNAME_RELEASE}
- exit ;;
- SX-5:SUPER-UX:*:*)
- echo sx5-nec-superux${UNAME_RELEASE}
- exit ;;
- SX-6:SUPER-UX:*:*)
- echo sx6-nec-superux${UNAME_RELEASE}
- exit ;;
- SX-7:SUPER-UX:*:*)
- echo sx7-nec-superux${UNAME_RELEASE}
- exit ;;
- SX-8:SUPER-UX:*:*)
- echo sx8-nec-superux${UNAME_RELEASE}
- exit ;;
- SX-8R:SUPER-UX:*:*)
- echo sx8r-nec-superux${UNAME_RELEASE}
- exit ;;
- Power*:Rhapsody:*:*)
- echo powerpc-apple-rhapsody${UNAME_RELEASE}
- exit ;;
- *:Rhapsody:*:*)
- echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
- exit ;;
- *:Darwin:*:*)
- UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
- case $UNAME_PROCESSOR in
- unknown) UNAME_PROCESSOR=powerpc ;;
- esac
- echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
- exit ;;
- *:procnto*:*:* | *:QNX:[0123456789]*:*)
- UNAME_PROCESSOR=`uname -p`
- if test "$UNAME_PROCESSOR" = "x86"; then
- UNAME_PROCESSOR=i386
- UNAME_MACHINE=pc
- fi
- echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
- exit ;;
- *:QNX:*:4*)
- echo i386-pc-qnx
- exit ;;
- NSE-?:NONSTOP_KERNEL:*:*)
- echo nse-tandem-nsk${UNAME_RELEASE}
- exit ;;
- NSR-?:NONSTOP_KERNEL:*:*)
- echo nsr-tandem-nsk${UNAME_RELEASE}
- exit ;;
- *:NonStop-UX:*:*)
- echo mips-compaq-nonstopux
- exit ;;
- BS2000:POSIX*:*:*)
- echo bs2000-siemens-sysv
- exit ;;
- DS/*:UNIX_System_V:*:*)
- echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
- exit ;;
- *:Plan9:*:*)
- # "uname -m" is not consistent, so use $cputype instead. 386
- # is converted to i386 for consistency with other x86
- # operating systems.
- if test "$cputype" = "386"; then
- UNAME_MACHINE=i386
- else
- UNAME_MACHINE="$cputype"
- fi
- echo ${UNAME_MACHINE}-unknown-plan9
- exit ;;
- *:TOPS-10:*:*)
- echo pdp10-unknown-tops10
- exit ;;
- *:TENEX:*:*)
- echo pdp10-unknown-tenex
- exit ;;
- KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
- echo pdp10-dec-tops20
- exit ;;
- XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
- echo pdp10-xkl-tops20
- exit ;;
- *:TOPS-20:*:*)
- echo pdp10-unknown-tops20
- exit ;;
- *:ITS:*:*)
- echo pdp10-unknown-its
- exit ;;
- SEI:*:*:SEIUX)
- echo mips-sei-seiux${UNAME_RELEASE}
- exit ;;
- *:DragonFly:*:*)
- echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
- exit ;;
- *:*VMS:*:*)
- UNAME_MACHINE=`(uname -p) 2>/dev/null`
- case "${UNAME_MACHINE}" in
- A*) echo alpha-dec-vms ; exit ;;
- I*) echo ia64-dec-vms ; exit ;;
- V*) echo vax-dec-vms ; exit ;;
- esac ;;
- *:XENIX:*:SysV)
- echo i386-pc-xenix
- exit ;;
- i*86:skyos:*:*)
- echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
- exit ;;
- i*86:rdos:*:*)
- echo ${UNAME_MACHINE}-pc-rdos
- exit ;;
-esac
-
-#echo '(No uname command or uname output not recognized.)' 1>&2
-#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
-
-eval $set_cc_for_build
-cat >$dummy.c <<EOF
-#ifdef _SEQUENT_
-# include <sys/types.h>
-# include <sys/utsname.h>
-#endif
-main ()
-{
-#if defined (sony)
-#if defined (MIPSEB)
- /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
- I don't know.... */
- printf ("mips-sony-bsd\n"); exit (0);
-#else
-#include <sys/param.h>
- printf ("m68k-sony-newsos%s\n",
-#ifdef NEWSOS4
- "4"
-#else
- ""
-#endif
- ); exit (0);
-#endif
-#endif
-
-#if defined (__arm) && defined (__acorn) && defined (__unix)
- printf ("arm-acorn-riscix\n"); exit (0);
-#endif
-
-#if defined (hp300) && !defined (hpux)
- printf ("m68k-hp-bsd\n"); exit (0);
-#endif
-
-#if defined (NeXT)
-#if !defined (__ARCHITECTURE__)
-#define __ARCHITECTURE__ "m68k"
-#endif
- int version;
- version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
- if (version < 4)
- printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
- else
- printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
- exit (0);
-#endif
-
-#if defined (MULTIMAX) || defined (n16)
-#if defined (UMAXV)
- printf ("ns32k-encore-sysv\n"); exit (0);
-#else
-#if defined (CMU)
- printf ("ns32k-encore-mach\n"); exit (0);
-#else
- printf ("ns32k-encore-bsd\n"); exit (0);
-#endif
-#endif
-#endif
-
-#if defined (__386BSD__)
- printf ("i386-pc-bsd\n"); exit (0);
-#endif
-
-#if defined (sequent)
-#if defined (i386)
- printf ("i386-sequent-dynix\n"); exit (0);
-#endif
-#if defined (ns32000)
- printf ("ns32k-sequent-dynix\n"); exit (0);
-#endif
-#endif
-
-#if defined (_SEQUENT_)
- struct utsname un;
-
- uname(&un);
-
- if (strncmp(un.version, "V2", 2) == 0) {
- printf ("i386-sequent-ptx2\n"); exit (0);
- }
- if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
- printf ("i386-sequent-ptx1\n"); exit (0);
- }
- printf ("i386-sequent-ptx\n"); exit (0);
-
-#endif
-
-#if defined (vax)
-# if !defined (ultrix)
-# include <sys/param.h>
-# if defined (BSD)
-# if BSD == 43
- printf ("vax-dec-bsd4.3\n"); exit (0);
-# else
-# if BSD == 199006
- printf ("vax-dec-bsd4.3reno\n"); exit (0);
-# else
- printf ("vax-dec-bsd\n"); exit (0);
-# endif
-# endif
-# else
- printf ("vax-dec-bsd\n"); exit (0);
-# endif
-# else
- printf ("vax-dec-ultrix\n"); exit (0);
-# endif
-#endif
-
-#if defined (alliant) && defined (i860)
- printf ("i860-alliant-bsd\n"); exit (0);
-#endif
-
- exit (1);
-}
-EOF
-
-$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
- { echo "$SYSTEM_NAME"; exit; }
-
-# Apollos put the system type in the environment.
-
-test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
-
-# Convex versions that predate uname can use getsysinfo(1)
-
-if [ -x /usr/convex/getsysinfo ]
-then
- case `getsysinfo -f cpu_type` in
- c1*)
- echo c1-convex-bsd
- exit ;;
- c2*)
- if getsysinfo -f scalar_acc
- then echo c32-convex-bsd
- else echo c2-convex-bsd
- fi
- exit ;;
- c34*)
- echo c34-convex-bsd
- exit ;;
- c38*)
- echo c38-convex-bsd
- exit ;;
- c4*)
- echo c4-convex-bsd
- exit ;;
- esac
-fi
-
-cat >&2 <<EOF
-$0: unable to guess system type
-
-This script, last modified $timestamp, has failed to recognize
-the operating system you are using. It is advised that you
-download the most up to date version of the config scripts from
-
- http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess
-and
- http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub
-
-If the version you run ($0) is already up to date, please
-send the following data and any information you think might be
-pertinent to <config-patches@gnu.org> in order to provide the needed
-information to handle your system.
-
-config.guess timestamp = $timestamp
-
-uname -m = `(uname -m) 2>/dev/null || echo unknown`
-uname -r = `(uname -r) 2>/dev/null || echo unknown`
-uname -s = `(uname -s) 2>/dev/null || echo unknown`
-uname -v = `(uname -v) 2>/dev/null || echo unknown`
-
-/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
-/bin/uname -X = `(/bin/uname -X) 2>/dev/null`
-
-hostinfo = `(hostinfo) 2>/dev/null`
-/bin/universe = `(/bin/universe) 2>/dev/null`
-/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null`
-/bin/arch = `(/bin/arch) 2>/dev/null`
-/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
-/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
-
-UNAME_MACHINE = ${UNAME_MACHINE}
-UNAME_RELEASE = ${UNAME_RELEASE}
-UNAME_SYSTEM = ${UNAME_SYSTEM}
-UNAME_VERSION = ${UNAME_VERSION}
-EOF
-
-exit 1
-
-# Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "timestamp='"
-# time-stamp-format: "%:y-%02m-%02d"
-# time-stamp-end: "'"
-# End:
diff --git a/tool/config.sub b/tool/config.sub
deleted file mode 100755
index 6759825a5b..0000000000
--- a/tool/config.sub
+++ /dev/null
@@ -1,1658 +0,0 @@
-#! /bin/sh
-# Configuration validation subroutine script.
-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
-# Free Software Foundation, Inc.
-
-timestamp='2008-01-16'
-
-# This file is (in principle) common to ALL GNU software.
-# The presence of a machine in this file suggests that SOME GNU software
-# can handle that machine. It does not imply ALL GNU software can.
-#
-# 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 2 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.
-#
-# 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.
-#
-# 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.
-
-
-# Please send patches to <config-patches@gnu.org>. Submit a context
-# diff and a properly formatted ChangeLog entry.
-#
-# Configuration subroutine to validate and canonicalize a configuration type.
-# Supply the specified configuration type as an argument.
-# If it is invalid, we print an error message on stderr and exit with code 1.
-# Otherwise, we print the canonical config type on stdout and succeed.
-
-# This file is supposed to be the same for all GNU packages
-# and recognize all the CPU types, system types and aliases
-# that are meaningful with *any* GNU software.
-# Each package is responsible for reporting which valid configurations
-# it does not support. The user should be able to distinguish
-# a failure to support a valid configuration from a meaningless
-# configuration.
-
-# The goal of this file is to map all the various variations of a given
-# machine specification into a single specification in the form:
-# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
-# or in some cases, the newer four-part form:
-# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
-# It is wrong to echo any other type of specification.
-
-me=`echo "$0" | sed -e 's,.*/,,'`
-
-usage="\
-Usage: $0 [OPTION] CPU-MFR-OPSYS
- $0 [OPTION] ALIAS
-
-Canonicalize a configuration name.
-
-Operation modes:
- -h, --help print this help, then exit
- -t, --time-stamp print date of last modification, then exit
- -v, --version print version number, then exit
-
-Report bugs and patches to <config-patches@gnu.org>."
-
-version="\
-GNU config.sub ($timestamp)
-
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
-2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
-
-This is free software; see the source for copying conditions. There is NO
-warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
-
-help="
-Try \`$me --help' for more information."
-
-# Parse command line
-while test $# -gt 0 ; do
- case $1 in
- --time-stamp | --time* | -t )
- echo "$timestamp" ; exit ;;
- --version | -v )
- echo "$version" ; exit ;;
- --help | --h* | -h )
- echo "$usage"; exit ;;
- -- ) # Stop option processing
- shift; break ;;
- - ) # Use stdin as input.
- break ;;
- -* )
- echo "$me: invalid option $1$help"
- exit 1 ;;
-
- *local*)
- # First pass through any local machine types.
- echo $1
- exit ;;
-
- * )
- break ;;
- esac
-done
-
-case $# in
- 0) echo "$me: missing argument$help" >&2
- exit 1;;
- 1) ;;
- *) echo "$me: too many arguments$help" >&2
- exit 1;;
-esac
-
-# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
-# Here we must recognize all the valid KERNEL-OS combinations.
-maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
-case $maybe_os in
- nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
- uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
- storm-chaos* | os2-emx* | rtmk-nova*)
- os=-$maybe_os
- basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
- ;;
- *)
- basic_machine=`echo $1 | sed 's/-[^-]*$//'`
- if [ $basic_machine != $1 ]
- then os=`echo $1 | sed 's/.*-/-/'`
- else os=; fi
- ;;
-esac
-
-### Let's recognize common machines as not being operating systems so
-### that things like config.sub decstation-3100 work. We also
-### recognize some manufacturers as not being operating systems, so we
-### can provide default operating systems below.
-case $os in
- -sun*os*)
- # Prevent following clause from handling this invalid input.
- ;;
- -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
- -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
- -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
- -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
- -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
- -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
- -apple | -axis | -knuth | -cray)
- os=
- basic_machine=$1
- ;;
- -sim | -cisco | -oki | -wec | -winbond)
- os=
- basic_machine=$1
- ;;
- -scout)
- ;;
- -wrs)
- os=-vxworks
- basic_machine=$1
- ;;
- -chorusos*)
- os=-chorusos
- basic_machine=$1
- ;;
- -chorusrdb)
- os=-chorusrdb
- basic_machine=$1
- ;;
- -hiux*)
- os=-hiuxwe2
- ;;
- -sco6)
- os=-sco5v6
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco5)
- os=-sco3.2v5
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco4)
- os=-sco3.2v4
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco3.2.[4-9]*)
- os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco3.2v[4-9]*)
- # Don't forget version if it is 3.2v4 or newer.
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco5v6*)
- # Don't forget version if it is 3.2v4 or newer.
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco*)
- os=-sco3.2v2
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -udk*)
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -isc)
- os=-isc2.2
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -clix*)
- basic_machine=clipper-intergraph
- ;;
- -isc*)
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -lynx*)
- os=-lynxos
- ;;
- -ptx*)
- basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
- ;;
- -windowsnt*)
- os=`echo $os | sed -e 's/windowsnt/winnt/'`
- ;;
- -psos*)
- os=-psos
- ;;
- -mint | -mint[0-9]*)
- basic_machine=m68k-atari
- os=-mint
- ;;
-esac
-
-# Decode aliases for certain CPU-COMPANY combinations.
-case $basic_machine in
- # Recognize the basic CPU types without company name.
- # Some are omitted here because they have special meanings below.
- 1750a | 580 \
- | a29k \
- | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
- | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
- | am33_2.0 \
- | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
- | bfin \
- | c4x | clipper \
- | d10v | d30v | dlx | dsp16xx \
- | fido | fr30 | frv \
- | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
- | i370 | i860 | i960 | ia64 \
- | ip2k | iq2000 \
- | m32c | m32r | m32rle | m68000 | m68k | m88k \
- | maxq | mb | microblaze | mcore | mep \
- | mips | mipsbe | mipseb | mipsel | mipsle \
- | mips16 \
- | mips64 | mips64el \
- | mips64vr | mips64vrel \
- | mips64orion | mips64orionel \
- | mips64vr4100 | mips64vr4100el \
- | mips64vr4300 | mips64vr4300el \
- | mips64vr5000 | mips64vr5000el \
- | mips64vr5900 | mips64vr5900el \
- | mipsisa32 | mipsisa32el \
- | mipsisa32r2 | mipsisa32r2el \
- | mipsisa64 | mipsisa64el \
- | mipsisa64r2 | mipsisa64r2el \
- | mipsisa64sb1 | mipsisa64sb1el \
- | mipsisa64sr71k | mipsisa64sr71kel \
- | mipstx39 | mipstx39el \
- | mn10200 | mn10300 \
- | mt \
- | msp430 \
- | nios | nios2 \
- | ns16k | ns32k \
- | or32 \
- | pdp10 | pdp11 | pj | pjl \
- | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
- | pyramid \
- | score \
- | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
- | sh64 | sh64le \
- | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
- | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
- | spu | strongarm \
- | tahoe | thumb | tic4x | tic80 | tron \
- | v850 | v850e \
- | we32k \
- | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
- | z8k)
- basic_machine=$basic_machine-unknown
- ;;
- m6811 | m68hc11 | m6812 | m68hc12)
- # Motorola 68HC11/12.
- basic_machine=$basic_machine-unknown
- os=-none
- ;;
- m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
- ;;
- ms1)
- basic_machine=mt-unknown
- ;;
-
- # We use `pc' rather than `unknown'
- # because (1) that's what they normally are, and
- # (2) the word "unknown" tends to confuse beginning users.
- i*86 | x86_64)
- basic_machine=$basic_machine-pc
- ;;
- # Object if more than one company name word.
- *-*-*)
- echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
- exit 1
- ;;
- # Recognize the basic CPU types with company name.
- 580-* \
- | a29k-* \
- | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
- | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
- | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
- | arm-* | armbe-* | armle-* | armeb-* | armv*-* \
- | avr-* | avr32-* \
- | bfin-* | bs2000-* \
- | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
- | clipper-* | craynv-* | cydra-* \
- | d10v-* | d30v-* | dlx-* \
- | elxsi-* \
- | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
- | h8300-* | h8500-* \
- | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
- | i*86-* | i860-* | i960-* | ia64-* \
- | ip2k-* | iq2000-* \
- | m32c-* | m32r-* | m32rle-* \
- | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
- | m88110-* | m88k-* | maxq-* | mcore-* \
- | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
- | mips16-* \
- | mips64-* | mips64el-* \
- | mips64vr-* | mips64vrel-* \
- | mips64orion-* | mips64orionel-* \
- | mips64vr4100-* | mips64vr4100el-* \
- | mips64vr4300-* | mips64vr4300el-* \
- | mips64vr5000-* | mips64vr5000el-* \
- | mips64vr5900-* | mips64vr5900el-* \
- | mipsisa32-* | mipsisa32el-* \
- | mipsisa32r2-* | mipsisa32r2el-* \
- | mipsisa64-* | mipsisa64el-* \
- | mipsisa64r2-* | mipsisa64r2el-* \
- | mipsisa64sb1-* | mipsisa64sb1el-* \
- | mipsisa64sr71k-* | mipsisa64sr71kel-* \
- | mipstx39-* | mipstx39el-* \
- | mmix-* \
- | mt-* \
- | msp430-* \
- | nios-* | nios2-* \
- | none-* | np1-* | ns16k-* | ns32k-* \
- | orion-* \
- | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
- | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
- | pyramid-* \
- | romp-* | rs6000-* \
- | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
- | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
- | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
- | sparclite-* \
- | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
- | tahoe-* | thumb-* \
- | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
- | tron-* \
- | v850-* | v850e-* | vax-* \
- | we32k-* \
- | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
- | xstormy16-* | xtensa*-* \
- | ymp-* \
- | z8k-*)
- ;;
- # Recognize the basic CPU types without company name, with glob match.
- xtensa*)
- basic_machine=$basic_machine-unknown
- ;;
- # Recognize the various machine names and aliases which stand
- # for a CPU type and a company and sometimes even an OS.
- 386bsd)
- basic_machine=i386-unknown
- os=-bsd
- ;;
- 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
- basic_machine=m68000-att
- ;;
- 3b*)
- basic_machine=we32k-att
- ;;
- a29khif)
- basic_machine=a29k-amd
- os=-udi
- ;;
- abacus)
- basic_machine=abacus-unknown
- ;;
- adobe68k)
- basic_machine=m68010-adobe
- os=-scout
- ;;
- alliant | fx80)
- basic_machine=fx80-alliant
- ;;
- altos | altos3068)
- basic_machine=m68k-altos
- ;;
- am29k)
- basic_machine=a29k-none
- os=-bsd
- ;;
- amd64)
- basic_machine=x86_64-pc
- ;;
- amd64-*)
- basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- amdahl)
- basic_machine=580-amdahl
- os=-sysv
- ;;
- amiga | amiga-*)
- basic_machine=m68k-unknown
- ;;
- amigaos | amigados)
- basic_machine=m68k-unknown
- os=-amigaos
- ;;
- amigaunix | amix)
- basic_machine=m68k-unknown
- os=-sysv4
- ;;
- apollo68)
- basic_machine=m68k-apollo
- os=-sysv
- ;;
- apollo68bsd)
- basic_machine=m68k-apollo
- os=-bsd
- ;;
- aux)
- basic_machine=m68k-apple
- os=-aux
- ;;
- balance)
- basic_machine=ns32k-sequent
- os=-dynix
- ;;
- blackfin)
- basic_machine=bfin-unknown
- os=-linux
- ;;
- blackfin-*)
- basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
- os=-linux
- ;;
- c90)
- basic_machine=c90-cray
- os=-unicos
- ;;
- convex-c1)
- basic_machine=c1-convex
- os=-bsd
- ;;
- convex-c2)
- basic_machine=c2-convex
- os=-bsd
- ;;
- convex-c32)
- basic_machine=c32-convex
- os=-bsd
- ;;
- convex-c34)
- basic_machine=c34-convex
- os=-bsd
- ;;
- convex-c38)
- basic_machine=c38-convex
- os=-bsd
- ;;
- cray | j90)
- basic_machine=j90-cray
- os=-unicos
- ;;
- craynv)
- basic_machine=craynv-cray
- os=-unicosmp
- ;;
- cr16)
- basic_machine=cr16-unknown
- os=-elf
- ;;
- crds | unos)
- basic_machine=m68k-crds
- ;;
- crisv32 | crisv32-* | etraxfs*)
- basic_machine=crisv32-axis
- ;;
- cris | cris-* | etrax*)
- basic_machine=cris-axis
- ;;
- crx)
- basic_machine=crx-unknown
- os=-elf
- ;;
- da30 | da30-*)
- basic_machine=m68k-da30
- ;;
- decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
- basic_machine=mips-dec
- ;;
- decsystem10* | dec10*)
- basic_machine=pdp10-dec
- os=-tops10
- ;;
- decsystem20* | dec20*)
- basic_machine=pdp10-dec
- os=-tops20
- ;;
- delta | 3300 | motorola-3300 | motorola-delta \
- | 3300-motorola | delta-motorola)
- basic_machine=m68k-motorola
- ;;
- delta88)
- basic_machine=m88k-motorola
- os=-sysv3
- ;;
- djgpp)
- basic_machine=i586-pc
- os=-msdosdjgpp
- ;;
- dpx20 | dpx20-*)
- basic_machine=rs6000-bull
- os=-bosx
- ;;
- dpx2* | dpx2*-bull)
- basic_machine=m68k-bull
- os=-sysv3
- ;;
- ebmon29k)
- basic_machine=a29k-amd
- os=-ebmon
- ;;
- elxsi)
- basic_machine=elxsi-elxsi
- os=-bsd
- ;;
- encore | umax | mmax)
- basic_machine=ns32k-encore
- ;;
- es1800 | OSE68k | ose68k | ose | OSE)
- basic_machine=m68k-ericsson
- os=-ose
- ;;
- fx2800)
- basic_machine=i860-alliant
- ;;
- genix)
- basic_machine=ns32k-ns
- ;;
- gmicro)
- basic_machine=tron-gmicro
- os=-sysv
- ;;
- go32)
- basic_machine=i386-pc
- os=-go32
- ;;
- h3050r* | hiux*)
- basic_machine=hppa1.1-hitachi
- os=-hiuxwe2
- ;;
- h8300hms)
- basic_machine=h8300-hitachi
- os=-hms
- ;;
- h8300xray)
- basic_machine=h8300-hitachi
- os=-xray
- ;;
- h8500hms)
- basic_machine=h8500-hitachi
- os=-hms
- ;;
- harris)
- basic_machine=m88k-harris
- os=-sysv3
- ;;
- hp300-*)
- basic_machine=m68k-hp
- ;;
- hp300bsd)
- basic_machine=m68k-hp
- os=-bsd
- ;;
- hp300hpux)
- basic_machine=m68k-hp
- os=-hpux
- ;;
- hp3k9[0-9][0-9] | hp9[0-9][0-9])
- basic_machine=hppa1.0-hp
- ;;
- hp9k2[0-9][0-9] | hp9k31[0-9])
- basic_machine=m68000-hp
- ;;
- hp9k3[2-9][0-9])
- basic_machine=m68k-hp
- ;;
- hp9k6[0-9][0-9] | hp6[0-9][0-9])
- basic_machine=hppa1.0-hp
- ;;
- hp9k7[0-79][0-9] | hp7[0-79][0-9])
- basic_machine=hppa1.1-hp
- ;;
- hp9k78[0-9] | hp78[0-9])
- # FIXME: really hppa2.0-hp
- basic_machine=hppa1.1-hp
- ;;
- hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
- # FIXME: really hppa2.0-hp
- basic_machine=hppa1.1-hp
- ;;
- hp9k8[0-9][13679] | hp8[0-9][13679])
- basic_machine=hppa1.1-hp
- ;;
- hp9k8[0-9][0-9] | hp8[0-9][0-9])
- basic_machine=hppa1.0-hp
- ;;
- hppa-next)
- os=-nextstep3
- ;;
- hppaosf)
- basic_machine=hppa1.1-hp
- os=-osf
- ;;
- hppro)
- basic_machine=hppa1.1-hp
- os=-proelf
- ;;
- i370-ibm* | ibm*)
- basic_machine=i370-ibm
- ;;
-# I'm not sure what "Sysv32" means. Should this be sysv3.2?
- i*86v32)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-sysv32
- ;;
- i*86v4*)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-sysv4
- ;;
- i*86v)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-sysv
- ;;
- i*86sol2)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-solaris2
- ;;
- i386mach)
- basic_machine=i386-mach
- os=-mach
- ;;
- i386-vsta | vsta)
- basic_machine=i386-unknown
- os=-vsta
- ;;
- iris | iris4d)
- basic_machine=mips-sgi
- case $os in
- -irix*)
- ;;
- *)
- os=-irix4
- ;;
- esac
- ;;
- isi68 | isi)
- basic_machine=m68k-isi
- os=-sysv
- ;;
- m68knommu)
- basic_machine=m68k-unknown
- os=-linux
- ;;
- m68knommu-*)
- basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
- os=-linux
- ;;
- m88k-omron*)
- basic_machine=m88k-omron
- ;;
- magnum | m3230)
- basic_machine=mips-mips
- os=-sysv
- ;;
- merlin)
- basic_machine=ns32k-utek
- os=-sysv
- ;;
- mingw32)
- basic_machine=i386-pc
- os=-mingw32
- ;;
- mingw32ce)
- basic_machine=arm-unknown
- os=-mingw32ce
- ;;
- miniframe)
- basic_machine=m68000-convergent
- ;;
- *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
- basic_machine=m68k-atari
- os=-mint
- ;;
- mips3*-*)
- basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
- ;;
- mips3*)
- basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
- ;;
- monitor)
- basic_machine=m68k-rom68k
- os=-coff
- ;;
- morphos)
- basic_machine=powerpc-unknown
- os=-morphos
- ;;
- msdos)
- basic_machine=i386-pc
- os=-msdos
- ;;
- ms1-*)
- basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
- ;;
- mvs)
- basic_machine=i370-ibm
- os=-mvs
- ;;
- ncr3000)
- basic_machine=i486-ncr
- os=-sysv4
- ;;
- netbsd386)
- basic_machine=i386-unknown
- os=-netbsd
- ;;
- netwinder)
- basic_machine=armv4l-rebel
- os=-linux
- ;;
- news | news700 | news800 | news900)
- basic_machine=m68k-sony
- os=-newsos
- ;;
- news1000)
- basic_machine=m68030-sony
- os=-newsos
- ;;
- news-3600 | risc-news)
- basic_machine=mips-sony
- os=-newsos
- ;;
- necv70)
- basic_machine=v70-nec
- os=-sysv
- ;;
- next | m*-next )
- basic_machine=m68k-next
- case $os in
- -nextstep* )
- ;;
- -ns2*)
- os=-nextstep2
- ;;
- *)
- os=-nextstep3
- ;;
- esac
- ;;
- nh3000)
- basic_machine=m68k-harris
- os=-cxux
- ;;
- nh[45]000)
- basic_machine=m88k-harris
- os=-cxux
- ;;
- nindy960)
- basic_machine=i960-intel
- os=-nindy
- ;;
- mon960)
- basic_machine=i960-intel
- os=-mon960
- ;;
- nonstopux)
- basic_machine=mips-compaq
- os=-nonstopux
- ;;
- np1)
- basic_machine=np1-gould
- ;;
- nsr-tandem)
- basic_machine=nsr-tandem
- ;;
- op50n-* | op60c-*)
- basic_machine=hppa1.1-oki
- os=-proelf
- ;;
- openrisc | openrisc-*)
- basic_machine=or32-unknown
- ;;
- os400)
- basic_machine=powerpc-ibm
- os=-os400
- ;;
- OSE68000 | ose68000)
- basic_machine=m68000-ericsson
- os=-ose
- ;;
- os68k)
- basic_machine=m68k-none
- os=-os68k
- ;;
- pa-hitachi)
- basic_machine=hppa1.1-hitachi
- os=-hiuxwe2
- ;;
- paragon)
- basic_machine=i860-intel
- os=-osf
- ;;
- parisc)
- basic_machine=hppa-unknown
- os=-linux
- ;;
- parisc-*)
- basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
- os=-linux
- ;;
- pbd)
- basic_machine=sparc-tti
- ;;
- pbb)
- basic_machine=m68k-tti
- ;;
- pc532 | pc532-*)
- basic_machine=ns32k-pc532
- ;;
- pc98)
- basic_machine=i386-pc
- ;;
- pc98-*)
- basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- pentium | p5 | k5 | k6 | nexgen | viac3)
- basic_machine=i586-pc
- ;;
- pentiumpro | p6 | 6x86 | athlon | athlon_*)
- basic_machine=i686-pc
- ;;
- pentiumii | pentium2 | pentiumiii | pentium3)
- basic_machine=i686-pc
- ;;
- pentium4)
- basic_machine=i786-pc
- ;;
- pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
- basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- pentiumpro-* | p6-* | 6x86-* | athlon-*)
- basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
- basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- pentium4-*)
- basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- pn)
- basic_machine=pn-gould
- ;;
- power) basic_machine=power-ibm
- ;;
- ppc) basic_machine=powerpc-unknown
- ;;
- ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- ppcle | powerpclittle | ppc-le | powerpc-little)
- basic_machine=powerpcle-unknown
- ;;
- ppcle-* | powerpclittle-*)
- basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- ppc64) basic_machine=powerpc64-unknown
- ;;
- ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- ppc64le | powerpc64little | ppc64-le | powerpc64-little)
- basic_machine=powerpc64le-unknown
- ;;
- ppc64le-* | powerpc64little-*)
- basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- ps2)
- basic_machine=i386-ibm
- ;;
- pw32)
- basic_machine=i586-unknown
- os=-pw32
- ;;
- rdos)
- basic_machine=i386-pc
- os=-rdos
- ;;
- rom68k)
- basic_machine=m68k-rom68k
- os=-coff
- ;;
- rm[46]00)
- basic_machine=mips-siemens
- ;;
- rtpc | rtpc-*)
- basic_machine=romp-ibm
- ;;
- s390 | s390-*)
- basic_machine=s390-ibm
- ;;
- s390x | s390x-*)
- basic_machine=s390x-ibm
- ;;
- sa29200)
- basic_machine=a29k-amd
- os=-udi
- ;;
- sb1)
- basic_machine=mipsisa64sb1-unknown
- ;;
- sb1el)
- basic_machine=mipsisa64sb1el-unknown
- ;;
- sde)
- basic_machine=mipsisa32-sde
- os=-elf
- ;;
- sei)
- basic_machine=mips-sei
- os=-seiux
- ;;
- sequent)
- basic_machine=i386-sequent
- ;;
- sh)
- basic_machine=sh-hitachi
- os=-hms
- ;;
- sh5el)
- basic_machine=sh5le-unknown
- ;;
- sh64)
- basic_machine=sh64-unknown
- ;;
- sparclite-wrs | simso-wrs)
- basic_machine=sparclite-wrs
- os=-vxworks
- ;;
- sps7)
- basic_machine=m68k-bull
- os=-sysv2
- ;;
- spur)
- basic_machine=spur-unknown
- ;;
- st2000)
- basic_machine=m68k-tandem
- ;;
- stratus)
- basic_machine=i860-stratus
- os=-sysv4
- ;;
- sun2)
- basic_machine=m68000-sun
- ;;
- sun2os3)
- basic_machine=m68000-sun
- os=-sunos3
- ;;
- sun2os4)
- basic_machine=m68000-sun
- os=-sunos4
- ;;
- sun3os3)
- basic_machine=m68k-sun
- os=-sunos3
- ;;
- sun3os4)
- basic_machine=m68k-sun
- os=-sunos4
- ;;
- sun4os3)
- basic_machine=sparc-sun
- os=-sunos3
- ;;
- sun4os4)
- basic_machine=sparc-sun
- os=-sunos4
- ;;
- sun4sol2)
- basic_machine=sparc-sun
- os=-solaris2
- ;;
- sun3 | sun3-*)
- basic_machine=m68k-sun
- ;;
- sun4)
- basic_machine=sparc-sun
- ;;
- sun386 | sun386i | roadrunner)
- basic_machine=i386-sun
- ;;
- sv1)
- basic_machine=sv1-cray
- os=-unicos
- ;;
- symmetry)
- basic_machine=i386-sequent
- os=-dynix
- ;;
- t3e)
- basic_machine=alphaev5-cray
- os=-unicos
- ;;
- t90)
- basic_machine=t90-cray
- os=-unicos
- ;;
- tic54x | c54x*)
- basic_machine=tic54x-unknown
- os=-coff
- ;;
- tic55x | c55x*)
- basic_machine=tic55x-unknown
- os=-coff
- ;;
- tic6x | c6x*)
- basic_machine=tic6x-unknown
- os=-coff
- ;;
- tile*)
- basic_machine=tile-unknown
- os=-linux-gnu
- ;;
- tx39)
- basic_machine=mipstx39-unknown
- ;;
- tx39el)
- basic_machine=mipstx39el-unknown
- ;;
- toad1)
- basic_machine=pdp10-xkl
- os=-tops20
- ;;
- tower | tower-32)
- basic_machine=m68k-ncr
- ;;
- tpf)
- basic_machine=s390x-ibm
- os=-tpf
- ;;
- udi29k)
- basic_machine=a29k-amd
- os=-udi
- ;;
- ultra3)
- basic_machine=a29k-nyu
- os=-sym1
- ;;
- v810 | necv810)
- basic_machine=v810-nec
- os=-none
- ;;
- vaxv)
- basic_machine=vax-dec
- os=-sysv
- ;;
- vms)
- basic_machine=vax-dec
- os=-vms
- ;;
- vpp*|vx|vx-*)
- basic_machine=f301-fujitsu
- ;;
- vxworks960)
- basic_machine=i960-wrs
- os=-vxworks
- ;;
- vxworks68)
- basic_machine=m68k-wrs
- os=-vxworks
- ;;
- vxworks29k)
- basic_machine=a29k-wrs
- os=-vxworks
- ;;
- w65*)
- basic_machine=w65-wdc
- os=-none
- ;;
- w89k-*)
- basic_machine=hppa1.1-winbond
- os=-proelf
- ;;
- xbox)
- basic_machine=i686-pc
- os=-mingw32
- ;;
- xps | xps100)
- basic_machine=xps100-honeywell
- ;;
- ymp)
- basic_machine=ymp-cray
- os=-unicos
- ;;
- z8k-*-coff)
- basic_machine=z8k-unknown
- os=-sim
- ;;
- none)
- basic_machine=none-none
- os=-none
- ;;
-
-# Here we handle the default manufacturer of certain CPU types. It is in
-# some cases the only manufacturer, in others, it is the most popular.
- w89k)
- basic_machine=hppa1.1-winbond
- ;;
- op50n)
- basic_machine=hppa1.1-oki
- ;;
- op60c)
- basic_machine=hppa1.1-oki
- ;;
- romp)
- basic_machine=romp-ibm
- ;;
- mmix)
- basic_machine=mmix-knuth
- ;;
- rs6000)
- basic_machine=rs6000-ibm
- ;;
- vax)
- basic_machine=vax-dec
- ;;
- pdp10)
- # there are many clones, so DEC is not a safe bet
- basic_machine=pdp10-unknown
- ;;
- pdp11)
- basic_machine=pdp11-dec
- ;;
- we32k)
- basic_machine=we32k-att
- ;;
- sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele)
- basic_machine=sh-unknown
- ;;
- sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
- basic_machine=sparc-sun
- ;;
- cydra)
- basic_machine=cydra-cydrome
- ;;
- orion)
- basic_machine=orion-highlevel
- ;;
- orion105)
- basic_machine=clipper-highlevel
- ;;
- mac | mpw | mac-mpw)
- basic_machine=m68k-apple
- ;;
- pmac | pmac-mpw)
- basic_machine=powerpc-apple
- ;;
- *-unknown)
- # Make sure to match an already-canonicalized machine name.
- ;;
- *)
- echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
- exit 1
- ;;
-esac
-
-# Here we canonicalize certain aliases for manufacturers.
-case $basic_machine in
- *-digital*)
- basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
- ;;
- *-commodore*)
- basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
- ;;
- *)
- ;;
-esac
-
-# Decode manufacturer-specific aliases for certain operating systems.
-
-if [ x"$os" != x"" ]
-then
-case $os in
- # First match some system type aliases
- # that might get confused with valid system types.
- # -solaris* is a basic system type, with this one exception.
- -solaris1 | -solaris1.*)
- os=`echo $os | sed -e 's|solaris1|sunos4|'`
- ;;
- -solaris)
- os=-solaris2
- ;;
- -svr4*)
- os=-sysv4
- ;;
- -unixware*)
- os=-sysv4.2uw
- ;;
- -gnu/linux*)
- os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
- ;;
- # First accept the basic system types.
- # The portable systems comes first.
- # Each alternative MUST END IN A *, to match a version number.
- # -sysv* is not here because it comes later, after sysvr4.
- -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
- | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
- | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
- | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
- | -aos* \
- | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
- | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
- | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
- | -openbsd* | -solidbsd* \
- | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
- | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
- | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
- | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
- | -chorusos* | -chorusrdb* \
- | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
- | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
- | -uxpv* | -beos* | -mpeix* | -udk* \
- | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
- | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
- | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
- | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
- | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
- | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
- | -skyos* | -haiku* | -rdos* | -toppers* | -drops*)
- # Remember, each alternative MUST END IN *, to match a version number.
- ;;
- -qnx*)
- case $basic_machine in
- x86-* | i*86-*)
- ;;
- *)
- os=-nto$os
- ;;
- esac
- ;;
- -nto-qnx*)
- ;;
- -nto*)
- os=`echo $os | sed -e 's|nto|nto-qnx|'`
- ;;
- -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
- | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
- | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
- ;;
- -mac*)
- os=`echo $os | sed -e 's|mac|macos|'`
- ;;
- -linux-dietlibc)
- os=-linux-dietlibc
- ;;
- -linux*)
- os=`echo $os | sed -e 's|linux|linux-gnu|'`
- ;;
- -sunos5*)
- os=`echo $os | sed -e 's|sunos5|solaris2|'`
- ;;
- -sunos6*)
- os=`echo $os | sed -e 's|sunos6|solaris3|'`
- ;;
- -opened*)
- os=-openedition
- ;;
- -os400*)
- os=-os400
- ;;
- -wince*)
- os=-wince
- ;;
- -osfrose*)
- os=-osfrose
- ;;
- -osf*)
- os=-osf
- ;;
- -utek*)
- os=-bsd
- ;;
- -dynix*)
- os=-bsd
- ;;
- -acis*)
- os=-aos
- ;;
- -atheos*)
- os=-atheos
- ;;
- -syllable*)
- os=-syllable
- ;;
- -386bsd)
- os=-bsd
- ;;
- -ctix* | -uts*)
- os=-sysv
- ;;
- -nova*)
- os=-rtmk-nova
- ;;
- -ns2 )
- os=-nextstep2
- ;;
- -nsk*)
- os=-nsk
- ;;
- # Preserve the version number of sinix5.
- -sinix5.*)
- os=`echo $os | sed -e 's|sinix|sysv|'`
- ;;
- -sinix*)
- os=-sysv4
- ;;
- -tpf*)
- os=-tpf
- ;;
- -triton*)
- os=-sysv3
- ;;
- -oss*)
- os=-sysv3
- ;;
- -svr4)
- os=-sysv4
- ;;
- -svr3)
- os=-sysv3
- ;;
- -sysvr4)
- os=-sysv4
- ;;
- # This must come after -sysvr4.
- -sysv*)
- ;;
- -ose*)
- os=-ose
- ;;
- -es1800*)
- os=-ose
- ;;
- -xenix)
- os=-xenix
- ;;
- -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
- os=-mint
- ;;
- -aros*)
- os=-aros
- ;;
- -kaos*)
- os=-kaos
- ;;
- -zvmoe)
- os=-zvmoe
- ;;
- -none)
- ;;
- *)
- # Get rid of the `-' at the beginning of $os.
- os=`echo $os | sed 's/[^-]*-//'`
- echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
- exit 1
- ;;
-esac
-else
-
-# Here we handle the default operating systems that come with various machines.
-# The value should be what the vendor currently ships out the door with their
-# machine or put another way, the most popular os provided with the machine.
-
-# Note that if you're going to try to match "-MANUFACTURER" here (say,
-# "-sun"), then you have to tell the case statement up towards the top
-# that MANUFACTURER isn't an operating system. Otherwise, code above
-# will signal an error saying that MANUFACTURER isn't an operating
-# system, and we'll never get to this point.
-
-case $basic_machine in
- score-*)
- os=-elf
- ;;
- spu-*)
- os=-elf
- ;;
- *-acorn)
- os=-riscix1.2
- ;;
- arm*-rebel)
- os=-linux
- ;;
- arm*-semi)
- os=-aout
- ;;
- c4x-* | tic4x-*)
- os=-coff
- ;;
- # This must come before the *-dec entry.
- pdp10-*)
- os=-tops20
- ;;
- pdp11-*)
- os=-none
- ;;
- *-dec | vax-*)
- os=-ultrix4.2
- ;;
- m68*-apollo)
- os=-domain
- ;;
- i386-sun)
- os=-sunos4.0.2
- ;;
- m68000-sun)
- os=-sunos3
- # This also exists in the configure program, but was not the
- # default.
- # os=-sunos4
- ;;
- m68*-cisco)
- os=-aout
- ;;
- mep-*)
- os=-elf
- ;;
- mips*-cisco)
- os=-elf
- ;;
- mips*-*)
- os=-elf
- ;;
- or32-*)
- os=-coff
- ;;
- *-tti) # must be before sparc entry or we get the wrong os.
- os=-sysv3
- ;;
- sparc-* | *-sun)
- os=-sunos4.1.1
- ;;
- *-be)
- os=-beos
- ;;
- *-haiku)
- os=-haiku
- ;;
- *-ibm)
- os=-aix
- ;;
- *-knuth)
- os=-mmixware
- ;;
- *-wec)
- os=-proelf
- ;;
- *-winbond)
- os=-proelf
- ;;
- *-oki)
- os=-proelf
- ;;
- *-hp)
- os=-hpux
- ;;
- *-hitachi)
- os=-hiux
- ;;
- i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
- os=-sysv
- ;;
- *-cbm)
- os=-amigaos
- ;;
- *-dg)
- os=-dgux
- ;;
- *-dolphin)
- os=-sysv3
- ;;
- m68k-ccur)
- os=-rtu
- ;;
- m88k-omron*)
- os=-luna
- ;;
- *-next )
- os=-nextstep
- ;;
- *-sequent)
- os=-ptx
- ;;
- *-crds)
- os=-unos
- ;;
- *-ns)
- os=-genix
- ;;
- i370-*)
- os=-mvs
- ;;
- *-next)
- os=-nextstep3
- ;;
- *-gould)
- os=-sysv
- ;;
- *-highlevel)
- os=-bsd
- ;;
- *-encore)
- os=-bsd
- ;;
- *-sgi)
- os=-irix
- ;;
- *-siemens)
- os=-sysv4
- ;;
- *-masscomp)
- os=-rtu
- ;;
- f30[01]-fujitsu | f700-fujitsu)
- os=-uxpv
- ;;
- *-rom68k)
- os=-coff
- ;;
- *-*bug)
- os=-coff
- ;;
- *-apple)
- os=-macos
- ;;
- *-atari*)
- os=-mint
- ;;
- *)
- os=-none
- ;;
-esac
-fi
-
-# Here we handle the case where we know the os, and the CPU type, but not the
-# manufacturer. We pick the logical manufacturer.
-vendor=unknown
-case $basic_machine in
- *-unknown)
- case $os in
- -riscix*)
- vendor=acorn
- ;;
- -sunos*)
- vendor=sun
- ;;
- -aix*)
- vendor=ibm
- ;;
- -beos*)
- vendor=be
- ;;
- -hpux*)
- vendor=hp
- ;;
- -mpeix*)
- vendor=hp
- ;;
- -hiux*)
- vendor=hitachi
- ;;
- -unos*)
- vendor=crds
- ;;
- -dgux*)
- vendor=dg
- ;;
- -luna*)
- vendor=omron
- ;;
- -genix*)
- vendor=ns
- ;;
- -mvs* | -opened*)
- vendor=ibm
- ;;
- -os400*)
- vendor=ibm
- ;;
- -ptx*)
- vendor=sequent
- ;;
- -tpf*)
- vendor=ibm
- ;;
- -vxsim* | -vxworks* | -windiss*)
- vendor=wrs
- ;;
- -aux*)
- vendor=apple
- ;;
- -hms*)
- vendor=hitachi
- ;;
- -mpw* | -macos*)
- vendor=apple
- ;;
- -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
- vendor=atari
- ;;
- -vos*)
- vendor=stratus
- ;;
- esac
- basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
- ;;
-esac
-
-echo $basic_machine$os
-exit
-
-# Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "timestamp='"
-# time-stamp-format: "%:y-%02m-%02d"
-# time-stamp-end: "'"
-# End:
diff --git a/tool/eval.rb b/tool/eval.rb
deleted file mode 100755
index db6d11cddd..0000000000
--- a/tool/eval.rb
+++ /dev/null
@@ -1,161 +0,0 @@
-
-require 'rbconfig'
-require 'fileutils'
-require 'pp'
-
-Ruby = ENV['RUBY'] ||
- File.join(RbConfig::CONFIG["bindir"],
- RbConfig::CONFIG["ruby_install_name"] + RbConfig::CONFIG["EXEEXT"])
-#
-
-OPTIONS = %w{
- opt-direct-threaded-code
- opt-basic-operations
- opt-operands-unification
- opt-instructions-unification
- opt-inline-method-cache
- opt-stack-caching
-}.map{|opt|
- '--disable-' + opt
-}
-
-opts = OPTIONS.dup
-Configs = OPTIONS.map{|opt|
- o = opts.dup
- opts.delete(opt)
- o
-} + [[]]
-
-pp Configs if $DEBUG
-
-
-def exec_cmd(cmd)
- puts cmd
- unless system(cmd)
- p cmd
- raise "error"
- end
-end
-
-def dirname idx
- "ev-#{idx}"
-end
-
-def build
- Configs.each_with_index{|config, idx|
- dir = dirname(idx)
- FileUtils.rm_rf(dir) if FileTest.exist?(dir)
- Dir.mkdir(dir)
- FileUtils.cd(dir){
- exec_cmd("#{Ruby} ../extconf.rb " + config.join(" "))
- exec_cmd("make clean test-all")
- }
- }
-end
-
-def check
- Configs.each_with_index{|c, idx|
- puts "= #{idx}"
- system("#{Ruby} -r ev-#{idx}/yarvcore -e 'puts YARVCore::OPTS'")
- }
-end
-
-def bench_each idx
- puts "= #{idx}"
- 5.times{|count|
- print count
- FileUtils.cd(dirname(idx)){
- exec_cmd("make benchmark OPT=-y ITEMS=#{ENV['ITEMS']} > ../b#{idx}-#{count}")
- }
- }
- puts
-end
-
-def bench
- # return bench_each(6)
- Configs.each_with_index{|c, idx|
- bench_each idx
- }
-end
-
-def parse_result data
- flag = false
- stat = []
- data.each{|line|
- if flag
- if /(\w+)\t([\d\.]+)/ =~ line
- stat << [$1, $2.to_f]
- else
- raise "not a data"
- end
-
- end
- if /benchmark summary/ =~ line
- flag = true
- end
- }
- stat
-end
-
-def calc_each data
- data.sort!
- data.pop # remove max
- data.shift # remove min
-
- data.inject(0.0){|res, e|
- res += e
- } / data.size
-end
-
-def calc_stat stats
- stat = []
- stats[0].each_with_index{|e, idx|
- bm = e[0]
- vals = stats.map{|st|
- st[idx][1]
- }
- [bm, calc_each(vals)]
- }
-end
-
-def stat
- total = []
- Configs.each_with_index{|c, idx|
- stats = []
- 5.times{|count|
- file = "b#{idx}-#{count}"
- # p file
- open(file){|f|
- stats << parse_result(f.read)
- }
- }
- # merge stats
- total << calc_stat(stats)
- total
- }
- # pp total
- total[0].each_with_index{|e, idx|
- bm = e[0]
- # print "#{bm}\t"
- total.each{|st|
- print st[idx][1], "\t"
- }
- puts
- }
-end
-
-ARGV.each{|cmd|
- case cmd
- when 'build'
- build
- when 'check'
- check
- when 'bench'
- bench
- when 'stat'
- stat
- else
- raise
- end
-}
-
diff --git a/tool/file2lastrev.rb b/tool/file2lastrev.rb
deleted file mode 100644
index e913783d71..0000000000
--- a/tool/file2lastrev.rb
+++ /dev/null
@@ -1,92 +0,0 @@
-#!/usr/bin/env ruby
-
-ENV.delete('PWD')
-
-require 'optparse'
-require 'pathname'
-
-SRCDIR = Pathname(File.dirname($0)).parent.freeze
-class VCSNotFoundError < RuntimeError; end
-
-def detect_vcs(path)
- path = SRCDIR
- return :svn, path.relative_path_from(SRCDIR) if File.directory?("#{path}/.svn")
- return :git_svn, path.relative_path_from(SRCDIR) if File.directory?("#{path}/.git/svn")
- return :git, path.relative_path_from(SRCDIR) if File.directory?("#{path}/.git")
- raise VCSNotFoundError, "does not seem to be under a vcs"
-end
-
-# return a pair of strings, the last revision and the last revision in which
-# +path+ was modified.
-def get_revisions(path)
- vcs, path = detect_vcs(path)
-
- info = case vcs
- when :svn
- info_xml = `cd "#{SRCDIR}" && svn info --xml "#{path}"`
- _, last, _, changed, _ = info_xml.split(/revision="(\d+)"/)
- return last, changed
- when :git_svn
- `cd "#{SRCDIR}" && git svn info "#{path}"`
- when :git
- git_log = `cd "#{SRCDIR}" && git log HEAD~1..HEAD "#{path}"`
- git_log =~ /git-svn-id: .*?@(\d+)/
- return $1, $1
- end
-
- if /^Revision: (\d+)/ =~ info
- last = $1
- else
- raise "last revision not found"
- end
- if /^Last Changed Rev: (\d+)/ =~ info
- changed = $1
- else
- raise "changed revision not found"
- end
-
- return last, changed
-end
-
-@output = nil
-def self.output=(output)
- if @output and @output != output
- raise "you can specify only one of --changed, --revision.h and --doxygen"
- end
- @output = output
-end
-@suppress_not_found = false
-
-parser = OptionParser.new {|opts|
- opts.on("--changed", "changed rev") do
- self.output = :changed
- end
- opts.on("--revision.h") do
- self.output = :revision_h
- end
- opts.on("--doxygen") do
- self.output = :doxygen
- end
- opts.on("-q", "--suppress_not_found") do
- @suppress_not_found = true
- end
-}
-parser.parse!
-
-
-begin
- last, changed = get_revisions(ARGV.shift)
-rescue VCSNotFoundError
- raise unless @suppress_not_found
-end
-
-case @output
-when :changed, nil
- puts changed
-when :revision_h
- puts "#define RUBY_REVISION #{changed.to_i}"
-when :doxygen
- puts "r#{changed}/r#{last}"
-else
- raise "unknown output format `#{@output}'"
-end
diff --git a/tool/generic_erb.rb b/tool/generic_erb.rb
deleted file mode 100755
index 8e84a46bfd..0000000000
--- a/tool/generic_erb.rb
+++ /dev/null
@@ -1,34 +0,0 @@
-require 'erb'
-require 'optparse'
-require 'fileutils'
-
-timestamp = nil
-output = nil
-ifchange = nil
-opt = OptionParser.new do |o|
- o.on('-t', '--timestamp[=PATH]') {|v| timestamp = v || true}
- o.on('-o', '--output=PATH') {|v| output = v}
- o.on('-c', '--[no-]if-change') {|v| ifchange = v}
- o.order!(ARGV)
-end
-template = ARGV.shift or abort opt.to_s
-erb = ERB.new(File.read(template), nil, '%')
-erb.filename = template
-result = erb.result
-if output
- if ifchange and (IO.read(output) rescue nil) == result
- puts "#{output} unchanged"
- else
- open(output, "wb") {|f| f.print result}
- puts "#{output} updated"
- end
- if timestamp
- if timestamp == true
- dir, base = File.split(output)
- timestamp = File.join(dir, ".time." + base)
- end
- FileUtils.touch(timestamp)
- end
-else
- print result
-end
diff --git a/tool/ifchange b/tool/ifchange
deleted file mode 100755
index 177ce7340b..0000000000
--- a/tool/ifchange
+++ /dev/null
@@ -1,48 +0,0 @@
-#!/bin/sh
-# usage: ifchange target temporary
-
-timestamp=
-until [ "$0" = 0 ]; do
- case "$1" in
- --timestamp)
- timestamp=.
- ;;
- --timestamp=*)
- timestamp=`expr \( "$1" : '[^=]*=\(.*\)' \)`
- ;;
- *)
- break
- ;;
- esac
- shift
-done
-
-target="$1"
-temp="$2"
-if [ "$temp" = - ]; then
- temp="tmpdata$$.tmp~"
- cat > "$temp" || exit $?
- trap 'rm -f "$temp"' 0
-fi
-
-if cmp "$target" "$temp" >/dev/null 2>&1; then
- echo "$target unchanged"
- rm -f "$temp"
-else
- echo "$target updated"
- mv -f "$temp" "$target"
-fi
-
-if [ -n "${timestamp}" ]; then
- if [ x"${timestamp}" = x. ]; then
- case "$target" in
- */*)
- timestamp=`dirname "$target"`/.time.`basename "$target"`
- ;;
- *)
- timestamp=.time."$target"
- ;;
- esac
- fi
- : > "$timestamp"
-fi
diff --git a/tool/insns2vm.rb b/tool/insns2vm.rb
deleted file mode 100755
index f518707f11..0000000000
--- a/tool/insns2vm.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-#!ruby
-
-require 'optparse'
-
-Version = %w$Revision: 11626 $[1..-1]
-
-require "#{File.join(File.dirname(__FILE__), 'instruction')}"
-
-if $0 == __FILE__
- opts = ARGV.options
- maker = RubyVM::SourceCodeGenerator.def_options(opts)
- files = opts.parse!
- generator = maker.call
- generator.generate(files)
-end
diff --git a/tool/instruction.rb b/tool/instruction.rb
deleted file mode 100644
index 8d55683da3..0000000000
--- a/tool/instruction.rb
+++ /dev/null
@@ -1,1393 +0,0 @@
-#
-#
-#
-
-require 'erb'
-
-class RubyVM
- class Instruction
- def initialize name, opes, pops, rets, comm, body, tvars, sp_inc,
- orig = self, defopes = [], type = nil,
- nsc = [], psc = [[], []]
-
- @name = name
- @opes = opes # [[type, name], ...]
- @pops = pops # [[type, name], ...]
- @rets = rets # [[type, name], ...]
- @comm = comm # {:c => category, :e => en desc, :j => ja desc}
- @body = body # '...'
-
- @orig = orig
- @defopes = defopes
- @type = type
- @tvars = tvars
-
- @nextsc = nsc
- @pushsc = psc
- @sc = []
- @unifs = []
- @optimized = []
- @is_sc = false
- @sp_inc = sp_inc
- end
-
- def add_sc sci
- @sc << sci
- sci.set_sc
- end
-
- attr_reader :name, :opes, :pops, :rets
- attr_reader :body, :comm
- attr_reader :nextsc, :pushsc
- attr_reader :orig, :defopes, :type
- attr_reader :sc
- attr_reader :unifs, :optimized
- attr_reader :is_sc
- attr_reader :tvars
- attr_reader :sp_inc
-
- def set_sc
- @is_sc = true
- end
-
- def add_unif insns
- @unifs << insns
- end
-
- def add_optimized insn
- @optimized << insn
- end
-
- def sp_increase_c_expr
- if(pops.any?{|t, v| v == '...'} ||
- rets.any?{|t, v| v == '...'})
- # user definision
- raise "no sp increase definition" if @sp_inc.nil?
- ret = "rb_num_t inc = 0;\n"
-
- @opes.each_with_index{|(t, v), i|
- if t == 'rb_num_t' && ((re = /\b#{v}\b/n) =~ @sp_inc ||
- @defopes.any?{|t, val| re =~ val})
- ret << " #{t} #{v} = FIX2INT(opes[#{i}]);\n"
- end
- }
- @defopes.each_with_index{|((t, var), val), i|
- if t == 'rb_num_t' && val != '*' && /\b#{var}\b/ =~ @sp_inc
- ret << " #{t} #{var} = #{val};\n"
- end
- }
-
- ret << " #{@sp_inc};\n"
- ret << " return depth + inc;"
- ret
- else
- "return depth + #{rets.size - pops.size};"
- end
- end
-
- def inspect
- "#<Instruction:#{@name}>"
- end
- end
-
- class InstructionsLoader
- def initialize opts = {}
- @insns = []
- @insn_map = {}
-
- @vpath = opts[:VPATH] || File
- @use_const = opts[:use_const]
- @verbose = opts[:verbose]
- @destdir = opts[:destdir]
-
- (@vm_opts = load_vm_opts).each {|k, v|
- @vm_opts[k] = opts[k] if opts.key?(k)
- }
-
- load_insns_def opts[:"insns.def"] || 'insns.def'
-
- load_opt_operand_def opts[:"opope.def"] || 'defs/opt_operand.def'
- load_insn_unification_def opts[:"unif.def"] || 'defs/opt_insn_unif.def'
- make_stackcaching_insns if vm_opt?('STACK_CACHING')
- end
-
- attr_reader :vpath
- attr_reader :destdir
-
- %w[use_const verbose].each do |attr|
- attr_reader attr
- alias_method "#{attr}?", attr
- remove_method attr
- end
-
- def [](s)
- @insn_map[s.to_s]
- end
-
- def each
- @insns.each{|insn|
- yield insn
- }
- end
-
- def size
- @insns.size
- end
-
- ###
- private
-
- def vm_opt? name
- @vm_opts[name]
- end
-
- def load_vm_opts file = nil
- file ||= 'vm_opts.h'
- opts = {}
- vpath.open(file) do |f|
- f.grep(/^\#define\s+OPT_([A-Z_]+)\s+(\d+)/) do
- opts[$1] = !$2.to_i.zero?
- end
- end
- opts
- end
-
- SKIP_COMMENT_PATTERN = Regexp.compile(Regexp.escape('/** ##skip'))
-
- include Enumerable
-
- def add_insn insn
- @insns << insn
- @insn_map[insn.name] = insn
- end
-
- def make_insn name, opes, pops, rets, comm, body, sp_inc
- add_insn Instruction.new(name, opes, pops, rets, comm, body, [], sp_inc)
- end
-
- # str -> [[type, var], ...]
- def parse_vars line
- raise unless /\((.*?)\)/ =~ line
- vars = $1.split(',')
- vars.map!{|v|
- if /\s*(\S+)\s+(\S+)\s*/ =~ v
- type = $1
- var = $2
- elsif /\s*\.\.\.\s*/ =~ v
- type = var = '...'
- else
- raise
- end
- [type, var]
- }
- vars
- end
-
- def parse_comment comm
- c = 'others'
- j = ''
- e = ''
- comm.each_line{|line|
- case line
- when /@c (.+)/
- c = $1
- when /@e (.+)/
- e = $1
- when /@e\s*$/
- e = ''
- when /@j (.+)$/
- j = $1
- when /@j\s*$/
- j = ''
- end
- }
- { :c => c,
- :e => e,
- :j => j,
- }
- end
-
- def load_insns_def file
- body = insn = opes = pops = rets = nil
- comment = ''
-
- vpath.open(file) {|f|
- f.instance_variable_set(:@line_no, 0)
- class << f
- def line_no
- @line_no
- end
- def gets
- @line_no += 1
- super
- end
- end
-
- while line = f.gets
- line.chomp!
- case line
-
- when SKIP_COMMENT_PATTERN
- while line = f.gets.chomp
- if /\s+\*\/$/ =~ line
- break
- end
- end
-
- # collect instruction comment
- when /^\/\*\*$/
- while line = f.gets
- if /\s+\*\/\s*$/ =~ line
- break
- else
- comment << line
- end
- end
-
- # start instruction body
- when /^DEFINE_INSN$/
- insn = f.gets.chomp
- opes = parse_vars(f.gets.chomp)
- pops = parse_vars(f.gets.chomp).reverse
- rets_str = f.gets.chomp
- rets = parse_vars(rets_str).reverse
- comment = parse_comment(comment)
- insn_in = true
- body = ''
-
- sp_inc = rets_str[%r"//\s*(.+)", 1]
-
- raise unless /^\{$/ =~ f.gets.chomp
- line_no = f.line_no
-
- # end instruction body
- when /^\}/
- if insn_in
- body.instance_variable_set(:@line_no, line_no)
- body.instance_variable_set(:@file, f.path)
- insn = make_insn(insn, opes, pops, rets, comment, body, sp_inc)
- insn_in = false
- comment = ''
- end
-
- else
- if insn_in
- body << line + "\n"
- end
- end
- end
- }
- end
-
- ## opt op
- def load_opt_operand_def file
- vpath.foreach(file) {|line|
- line = line.gsub(/\#.*/, '').strip
- next if line.length == 0
- break if /__END__/ =~ line
- /(\S+)\s+(.+)/ =~ line
- insn = $1
- opts = $2
- add_opt_operand insn, opts.split(/,/).map{|e| e.strip}
- } if file
- end
-
- def label_escape label
- label.gsub(/\(/, '_O_').
- gsub(/\)/, '_C_').
- gsub(/\*/, '_WC_')
- end
-
- def add_opt_operand insn_name, opts
- insn = @insn_map[insn_name]
- opes = insn.opes
-
- if opes.size != opts.size
- raise "operand size mismatcvh for #{insn.name} (opes: #{opes.size}, opts: #{opts.size})"
- end
-
- ninsn = insn.name + '_OP_' + opts.map{|e| label_escape(e)}.join('_')
- nopes = []
- defv = []
-
- opts.each_with_index{|e, i|
- if e == '*'
- nopes << opes[i]
- end
- defv << [opes[i], e]
- }
-
- make_insn_operand_optimiized(insn, ninsn, nopes, defv)
- end
-
- def make_insn_operand_optimiized orig_insn, name, opes, defopes
- comm = orig_insn.comm.dup
- comm[:c] = 'optimize'
- add_insn insn = Instruction.new(
- name, opes, orig_insn.pops, orig_insn.rets, comm,
- orig_insn.body, orig_insn.tvars, orig_insn.sp_inc,
- orig_insn, defopes)
- orig_insn.add_optimized insn
- end
-
- ## insn unif
- def load_insn_unification_def file
- vpath.foreach(file) {|line|
- line = line.gsub(/\#.*/, '').strip
- next if line.length == 0
- break if /__END__/ =~ line
- make_unified_insns line.split.map{|e|
- raise "unknown insn: #{e}" unless @insn_map[e]
- @insn_map[e]
- }
- } if file
- end
-
- def all_combination sets
- ret = sets.shift.map{|e| [e]}
-
- sets.each{|set|
- prev = ret
- ret = []
- prev.each{|ary|
- set.each{|e|
- eary = ary.dup
- eary << e
- ret << eary
- }
- }
- }
- ret
- end
-
- def make_unified_insns insns
- if vm_opt?('UNIFY_ALL_COMBINATION')
- insn_sets = insns.map{|insn|
- [insn] + insn.optimized
- }
-
- all_combination(insn_sets).each{|insns_set|
- make_unified_insn_each insns_set
- }
- else
- make_unified_insn_each insns
- end
- end
-
- def mk_private_val vals, i, redef
- vals.dup.map{|v|
- # v[0] : type
- # v[1] : var name
-
- v = v.dup
- if v[0] != '...'
- redef[v[1]] = v[0]
- v[1] = "#{v[1]}_#{i}"
- end
- v
- }
- end
-
- def mk_private_val2 vals, i, redef
- vals.dup.map{|v|
- # v[0][0] : type
- # v[0][1] : var name
- # v[1] : default val
-
- pv = v.dup
- v = pv[0] = pv[0].dup
- if v[0] != '...'
- redef[v[1]] = v[0]
- v[1] = "#{v[1]}_#{i}"
- end
- pv
- }
- end
-
- def make_unified_insn_each insns
- names = []
- opes = []
- pops = []
- rets = []
- comm = {
- :c => 'optimize',
- :e => 'unified insn',
- :j => 'unified insn',
- }
- body = ''
- passed = []
- tvars = []
- defopes = []
- sp_inc = ''
-
- insns.each_with_index{|insn, i|
- names << insn.name
- redef_vars = {}
-
- e_opes = mk_private_val(insn.opes, i, redef_vars)
- e_pops = mk_private_val(insn.pops, i, redef_vars)
- e_rets = mk_private_val(insn.rets, i, redef_vars)
- # ToDo: fix it
- e_defs = mk_private_val2(insn.defopes, i, redef_vars)
-
- passed_vars = []
- while pvar = e_pops.pop
- rvar = rets.pop
- if rvar
- raise "unsupported unif insn: #{insns.inspect}" if rvar[0] == '...'
- passed_vars << [pvar, rvar]
- tvars << rvar
- else
- e_pops.push pvar
- break
- end
- end
-
- opes.concat e_opes
- pops.concat e_pops
- rets.concat e_rets
- defopes.concat e_defs
- sp_inc += "#{insn.sp_inc}"
-
- body += "{ /* unif: #{i} */\n" +
- passed_vars.map{|rpvars|
- pv = rpvars[0]
- rv = rpvars[1]
- "#define #{pv[1]} #{rv[1]}"
- }.join("\n") +
- "\n" +
- redef_vars.map{|v, type|
- "#define #{v} #{v}_#{i}"
- }.join("\n") + "\n" +
- insn.body +
- passed_vars.map{|rpvars|
- "#undef #{rpvars[0][1]}"
- }.join("\n") +
- "\n" +
- redef_vars.keys.map{|v|
- "#undef #{v}"
- }.join("\n") +
- "\n}\n"
- }
-
- tvars_ary = []
- tvars.each{|tvar|
- unless opes.any?{|var|
- var[1] == tvar[1]
- } || defopes.any?{|pvar|
- pvar[0][1] == tvar[1]
- }
- tvars_ary << tvar
- end
- }
- add_insn insn = Instruction.new("UNIFIED_" + names.join('_'),
- opes, pops, rets.reverse, comm, body,
- tvars_ary, sp_inc)
- insn.defopes.replace defopes
- insns[0].add_unif [insn, insns]
- end
-
- ## sc
- SPECIAL_INSN_FOR_SC_AFTER = {
- /\Asend/ => [:a],
- /\Aend/ => [:a],
- /\Ayield/ => [:a],
- /\Aclassdef/ => [:a],
- /\Amoduledef/ => [:a],
- }
- FROM_SC = [[], [:a], [:b], [:a, :b], [:b, :a]]
-
- def make_stackcaching_insns
- pops = rets = nil
-
- @insns.dup.each{|insn|
- opops = insn.pops
- orets = insn.rets
- oopes = insn.opes
- ocomm = insn.comm
-
- after = nil
- SPECIAL_INSN_FOR_SC_AFTER.any?{|k, v|
- if k =~ insn.name
- after = v
- break
- end
- }
-
- insns = []
- FROM_SC.each{|from|
- name, pops, rets, pushs1, pushs2, nextsc =
- *calc_stack(insn, from, after, opops, orets)
-
- make_insn_sc(insn, name, oopes, pops, rets, [pushs1, pushs2], nextsc)
- }
- }
- end
-
- def make_insn_sc orig_insn, name, opes, pops, rets, pushs, nextsc
- comm = orig_insn.comm.dup
- comm[:c] = 'optimize(sc)'
-
- scinsn = Instruction.new(
- name, opes, pops, rets, comm,
- orig_insn.body, orig_insn.tvars, orig_insn.sp_inc,
- orig_insn, orig_insn.defopes, :sc, nextsc, pushs)
-
- add_insn scinsn
- orig_insn.add_sc scinsn
- end
-
- def self.complement_name st
- "#{st[0] ? st[0] : 'x'}#{st[1] ? st[1] : 'x'}"
- end
-
- def add_stack_value st
- len = st.length
- if len == 0
- st[0] = :a
- [nil, :a]
- elsif len == 1
- if st[0] == :a
- st[1] = :b
- else
- st[1] = :a
- end
- [nil, st[1]]
- else
- st[0], st[1] = st[1], st[0]
- [st[1], st[1]]
- end
- end
-
- def calc_stack insn, ofrom, oafter, opops, orets
- from = ofrom.dup
- pops = opops.dup
- rets = orets.dup
- rest_scr = ofrom.dup
-
- pushs_before = []
- pushs= []
-
- pops.each_with_index{|e, i|
- if e[0] == '...'
- pushs_before = from
- from = []
- end
- r = from.pop
- break unless r
- pops[i] = pops[i].dup << r
- }
-
- if oafter
- from = oafter
- from.each_with_index{|r, i|
- rets[i] = rets[i].dup << r if rets[i]
- }
- else
- rets = rets.reverse
- rets.each_with_index{|e, i|
- break if e[0] == '...'
- pushed, r = add_stack_value from
- rets[i] = rets[i].dup << r
- if pushed
- if rest_scr.pop
- pushs << pushed
- end
-
- if i - 2 >= 0
- rets[i-2].pop
- end
- end
- }
- end
-
- if false #|| insn.name =~ /test3/
- p ofrom
- p pops
- p rets
- p pushs_before
- p pushs
- p from
- exit
- end
-
- ret = ["#{insn.name}_SC_#{InstructionsLoader.complement_name(ofrom)}_#{complement_name(from)}",
- pops, rets, pushs_before, pushs, from]
- end
- end
-
- class SourceCodeGenerator
- def initialize insns
- @insns = insns
- end
-
- attr_reader :insns
-
- def generate
- raise "should not reach here"
- end
-
- def vpath
- @insns.vpath
- end
-
- def verbose?
- @insns.verbose?
- end
-
- def use_const?
- @insns.use_const?
- end
-
- def build_string
- @lines = []
- yield
- @lines.join("\n")
- end
-
- EMPTY_STRING = ''.freeze
-
- def commit str = EMPTY_STRING
- @lines << str
- end
-
- def comment str
- @lines << str if verbose?
- end
-
- def output_path(fn)
- d = @insns.destdir
- fn = File.join(d, fn) if d
- fn
- end
- end
-
- ###################################################################
- # vm.inc
- class VmBodyGenerator < SourceCodeGenerator
- # vm.inc
- def generate
- vm_body = ''
- @insns.each{|insn|
- vm_body << "\n"
- vm_body << make_insn_def(insn)
- }
- src = vpath.read('template/vm.inc.tmpl')
- ERB.new(src).result(binding)
- end
-
- def generate_from_insnname insnname
- make_insn_def @insns[insnname.to_s]
- end
-
- #######
- private
-
- def make_header_prepare_stack insn
- comment " /* prepare stack status */"
-
- push_ba = insn.pushsc
- raise "unsupport" if push_ba[0].size > 0 && push_ba[1].size > 0
-
- push_ba.each{|pushs|
- pushs.each{|r|
- commit " PUSH(SCREG(#{r}));"
- }
- }
- end
-
- def make_header_operands insn
- comment " /* declare and get from iseq */"
-
- vars = insn.opes
- n = 0
- ops = []
-
- vars.each_with_index{|(type, var), i|
- if type == '...'
- break
- end
-
- re = /\b#{var}\b/n
- if re =~ insn.body or re =~ insn.sp_inc or insn.rets.any?{|t, v| re =~ v}
- ops << " #{type} #{var} = (#{type})GET_OPERAND(#{i+1});"
- end
- n += 1
- }
- @opn = n
-
- # reverse or not?
- # ops.join
- commit ops.reverse
- end
-
- def make_header_default_operands insn
- vars = insn.defopes
-
- vars.each{|e|
- next if e[1] == '*'
- if use_const?
- commit " const #{e[0][0]} #{e[0][1]} = #{e[1]};"
- else
- commit " #define #{e[0][1]} #{e[1]}"
- end
- }
- end
-
- def make_footer_default_operands insn
- comment " /* declare and initialize default opes */"
- if use_const?
- commit
- else
- vars = insn.defopes
-
- vars.each{|e|
- next if e[1] == '*'
- commit "#undef #{e[0][1]}"
- }
- end
- end
-
- def make_header_stack_pops insn
- comment " /* declare and pop from stack */"
-
- n = 0
- pops = []
- vars = insn.pops
- vars.each_with_index{|iter, i|
- type, var, r = *iter
- if type == '...'
- break
- end
- if r
- pops << " #{type} #{var} = SCREG(#{r});"
- else
- pops << " #{type} #{var} = TOPN(#{n});"
- n += 1
- end
- }
- @popn = n
-
- # reverse or not?
- commit pops.reverse
- end
-
- def make_header_temporary_vars insn
- comment " /* declare temporary vars */"
-
- insn.tvars.each{|var|
- commit " #{var[0]} #{var[1]};"
- }
- end
-
- def make_header_stack_val insn
- comment "/* declare stack push val */"
-
- vars = insn.opes + insn.pops + insn.defopes.map{|e| e[0]}
-
- insn.rets.each{|var|
- if vars.all?{|e| e[1] != var[1]} && var[1] != '...'
- commit " #{var[0]} #{var[1]};"
- end
- }
- end
-
- def make_header_analysis insn
- commit " USAGE_ANALYSIS_INSN(BIN(#{insn.name}));"
- insn.opes.each_with_index{|op, i|
- commit " USAGE_ANALYSIS_OPERAND(BIN(#{insn.name}), #{i}, #{op[1]});"
- }
- end
-
- def make_header_pc insn
- commit " ADD_PC(1+#{@opn});"
- commit " PREFETCH(GET_PC());"
- end
-
- def make_header_popn insn
- comment " /* management */"
- commit " POPN(#{@popn});" if @popn > 0
- end
-
- def make_hader_debug insn
- comment " /* for debug */"
- commit " DEBUG_ENTER_INSN(\"#{insn.name}\");"
- end
-
- def make_header_defines insn
- commit " #define CURRENT_INSN_#{insn.name} 1"
- commit " #define INSN_IS_SC() #{insn.sc ? 0 : 1}"
- commit " #define INSN_LABEL(lab) LABEL_#{insn.name}_##lab"
- commit " #define LABEL_IS_SC(lab) LABEL_##lab##_###{insn.sc.size == 0 ? 't' : 'f'}"
- end
-
- def make_footer_stack_val insn
- comment " /* push stack val */"
-
- insn.rets.reverse_each{|v|
- if v[1] == '...'
- break
- end
- if v[2]
- commit " SCREG(#{v[2]}) = #{v[1]};"
- else
- commit " PUSH(#{v[1]});"
- end
- }
- end
-
- def make_footer_undefs insn
- commit "#undef CURRENT_INSN_#{insn.name}"
- commit "#undef INSN_IS_SC"
- commit "#undef INSN_LABEL"
- commit "#undef LABEL_IS_SC"
- end
-
- def make_header insn
- commit "INSN_ENTRY(#{insn.name}){"
- make_header_prepare_stack insn
- commit "{"
- make_header_stack_val insn
- make_header_default_operands insn
- make_header_operands insn
- make_header_stack_pops insn
- make_header_temporary_vars insn
- #
- make_hader_debug insn
- make_header_pc insn
- make_header_popn insn
- make_header_defines insn
- make_header_analysis insn
- commit "{"
- end
-
- def make_footer insn
- make_footer_stack_val insn
- make_footer_default_operands insn
- make_footer_undefs insn
- commit " END_INSN(#{insn.name});}}}"
- end
-
- def make_insn_def insn
- build_string do
- make_header insn
- if line = insn.body.instance_variable_get(:@line_no)
- file = insn.body.instance_variable_get(:@file)
- commit "#line #{line+1} \"#{file}\""
- commit insn.body
- commit '#line __CURRENT_LINE__ "__CURRENT_FILE__"'
- else
- insn.body
- end
- make_footer(insn)
- end
- end
- end
-
- ###################################################################
- # vmtc.inc
- class VmTCIncGenerator < SourceCodeGenerator
- def generate
-
- insns_table = build_string do
- @insns.each{|insn|
- commit " LABEL_PTR(#{insn.name}),"
- }
- end
-
- insn_end_table = build_string do
- @insns.each{|insn|
- commit " ELABEL_PTR(#{insn.name}),\n"
- }
- end
-
- ERB.new(vpath.read('template/vmtc.inc.tmpl')).result(binding)
- end
- end
-
- ###################################################################
- # insns_info.inc
- class InsnsInfoIncGenerator < SourceCodeGenerator
- def generate
- insns_info_inc
- end
-
- ###
- private
-
- def op2typesig op
- case op
- when /^OFFSET/
- "TS_OFFSET"
- when /^rb_num_t/
- "TS_NUM"
- when /^lindex_t/
- "TS_LINDEX"
- when /^dindex_t/
- "TS_DINDEX"
- when /^VALUE/
- "TS_VALUE"
- when /^ID/
- "TS_ID"
- when /GENTRY/
- "TS_GENTRY"
- when /^IC/
- "TS_IC"
- when /^\.\.\./
- "TS_VARIABLE"
- when /^CDHASH/
- "TS_CDHASH"
- when /^ISEQ/
- "TS_ISEQ"
- when /rb_insn_func_t/
- "TS_FUNCPTR"
- else
- raise "unknown op type: #{op}"
- end
- end
-
- TYPE_CHARS = {
- 'TS_OFFSET' => 'O',
- 'TS_NUM' => 'N',
- 'TS_LINDEX' => 'L',
- 'TS_DINDEX' => 'D',
- 'TS_VALUE' => 'V',
- 'TS_ID' => 'I',
- 'TS_GENTRY' => 'G',
- 'TS_IC' => 'C',
- 'TS_CDHASH' => 'H',
- 'TS_ISEQ' => 'S',
- 'TS_VARIABLE' => '.',
- 'TS_FUNCPTR' => 'F',
- }
-
- # insns_info.inc
- def insns_info_inc
- # insn_type_chars
- insn_type_chars = TYPE_CHARS.map{|t, c|
- "#define #{t} '#{c}'"
- }.join("\n")
-
- # insn_names
- insn_names = ''
- @insns.each{|insn|
- insn_names << " \"#{insn.name}\",\n"
- }
-
- # operands info
- operands_info = ''
- operands_num_info = ''
- icoperands_num_info = ''
-
- @insns.each{|insn|
- opes = insn.opes
- operands_info << ' '
- ot = opes.map{|type, var|
- TYPE_CHARS.fetch(op2typesig(type))
- }
- operands_info << "\"#{ot.join}\"" << ", \n"
-
- num = opes.size + 1
- operands_num_info << " #{num},\n"
-
- icnum = 0
- opes.each{|e|
- icnum += 1 if e[0] == 'IC'
- }
- icoperands_num_info << " #{icnum},\n"
- }
-
- # stack num
- stack_num_info = ''
- @insns.each{|insn|
- num = insn.rets.size
- stack_num_info << " #{num},\n"
- }
-
- # stack increase
- stack_increase = ''
- @insns.each{|insn|
- stack_increase << <<-EOS
- case BIN(#{insn.name}):{
- #{insn.sp_increase_c_expr}
- }
- EOS
- }
- ERB.new(vpath.read('template/insns_info.inc.tmpl')).result(binding)
- end
- end
-
- ###################################################################
- # insns.inc
- class InsnsIncGenerator < SourceCodeGenerator
- def generate
- i=0
- insns = build_string do
- @insns.each{|insn|
- commit " %-30s = %d,\n" % ["BIN(#{insn.name})", i]
- i+=1
- }
- end
-
- ERB.new(vpath.read('template/insns.inc.tmpl')).result(binding)
- end
- end
-
- ###################################################################
- # minsns.inc
- class MInsnsIncGenerator < SourceCodeGenerator
- def generate
- i=0
- defs = build_string do
- @insns.each{|insn|
- commit " rb_define_const(mYarvInsns, %-30s, INT2FIX(%d));\n" %
- ["\"I#{insn.name}\"", i]
- i+=1
- }
- end
- ERB.new(vpath.read('template/minsns.inc.tmpl')).result(binding)
- end
- end
-
- ###################################################################
- # optinsn.inc
- class OptInsnIncGenerator < SourceCodeGenerator
- def generate
- optinsn_inc
- end
-
- ###
- private
-
- def val_as_type op
- type = op[0][0]
- val = op[1]
-
- case type
- when /^long/, /^rb_num_t/, /^lindex_t/, /^dindex_t/
- "INT2FIX(#{val})"
- when /^VALUE/
- val
- when /^ID/
- "INT2FIX(#{val})"
- when /^ISEQ/, /^rb_insn_func_t/
- val
- when /GENTRY/
- raise
- when /^\.\.\./
- raise
- else
- raise "type: #{type}"
- end
- end
-
- # optinsn.inc
- def optinsn_inc
- rule = ''
- opt_insns_map = Hash.new{|h, k| h[k] = []}
-
- @insns.each{|insn|
- next if insn.defopes.size == 0
- next if insn.type == :sc
- next if /^UNIFIED/ =~ insn.name.to_s
-
- originsn = insn.orig
- opt_insns_map[originsn] << insn
- }
-
- rule = build_string do
- opt_insns_map.each{|originsn, optinsns|
- commit "case BIN(#{originsn.name}):"
-
- optinsns.sort_by{|opti|
- opti.defopes.find_all{|e| e[1] == '*'}.size
- }.each{|opti|
- commit " if("
- i = 0
- commit " " + opti.defopes.map{|opinfo|
- i += 1
- next if opinfo[1] == '*'
- "insnobj->operands[#{i-1}] == #{val_as_type(opinfo)}"
- }.compact.join('&& ')
- commit " ){"
- idx = 0
- n = 0
- opti.defopes.each{|opinfo|
- if opinfo[1] == '*'
- if idx != n
- commit " insnobj->operands[#{idx}] = insnobj->operands[#{n}];"
- end
- idx += 1
- else
- # skip
- end
- n += 1
- }
- commit " insnobj->insn_id = BIN(#{opti.name});"
- commit " insnobj->operand_size = #{idx};"
- commit " break;\n }\n"
- }
- commit " break;";
- }
- end
-
- ERB.new(vpath.read('template/optinsn.inc.tmpl')).result(binding)
- end
- end
-
- ###################################################################
- # optunifs.inc
- class OptUnifsIncGenerator < SourceCodeGenerator
- def generate
- unif_insns_each = ''
- unif_insns = ''
- unif_insns_data = []
-
- insns = @insns.find_all{|insn| !insn.is_sc}
- insns.each{|insn|
- size = insn.unifs.size
- if size > 0
- insn.unifs.sort_by{|unif| -unif[1].size}.each_with_index{|unif, i|
-
- uni_insn, uni_insns = *unif
- uni_insns = uni_insns[1..-1]
- unif_insns_each << "static const int UNIFIED_#{insn.name}_#{i}[] = {" +
- " BIN(#{uni_insn.name}), #{uni_insns.size + 2}, \n " +
- uni_insns.map{|e| "BIN(#{e.name})"}.join(", ") + "};\n"
- }
- else
-
- end
- if size > 0
- unif_insns << "static const int *const UNIFIED_#{insn.name}[] = {(int *)#{size+1}, \n"
- unif_insns << (0...size).map{|e| " UNIFIED_#{insn.name}_#{e}"}.join(",\n") + "};\n"
- unif_insns_data << " UNIFIED_#{insn.name}"
- else
- unif_insns_data << " 0"
- end
- }
- unif_insns_data = "static const int *const *const unified_insns_data[] = {\n" +
- unif_insns_data.join(",\n") + "};\n"
- ERB.new(vpath.read('template/optunifs.inc.tmpl')).result(binding)
- end
- end
-
- ###################################################################
- # opt_sc.inc
- class OptSCIncGenerator < SourceCodeGenerator
- def generate
- sc_insn_info = []
- @insns.each{|insn|
- insns = insn.sc
- if insns.size > 0
- insns = ['SC_ERROR'] + insns.map{|e| " BIN(#{e.name})"}
- else
- insns = Array.new(6){'SC_ERROR'}
- end
- sc_insn_info << " {\n#{insns.join(",\n")}}"
- }
- sc_insn_info = sc_insn_info.join(",\n")
-
- sc_insn_next = @insns.map{|insn|
- " SCS_#{InstructionsLoader.complement_name(insn.nextsc).upcase}" +
- (verbose? ? " /* #{insn.name} */" : '')
- }.join(",\n")
- ERB.new(vpath.read('template/opt_sc.inc.tmpl')).result(binding)
- end
- end
-
- ###################################################################
- # yasmdata.rb
- class YASMDataRbGenerator < SourceCodeGenerator
- def generate
- insn_id2no = ''
- @insns.each_with_index{|insn, i|
- insn_id2no << " :#{insn.name} => #{i},\n"
- }
- ERB.new(vpath.read('template/yasmdata.rb.tmpl')).result(binding)
- end
- end
-
- ###################################################################
- # yarvarch.*
- class YARVDocGenerator < SourceCodeGenerator
- def generate
-
- end
-
- def desc lang
- d = ''
- i = 0
- cat = nil
- @insns.each{|insn|
- seq = insn.opes.map{|t,v| v}.join(' ')
- before = insn.pops.reverse.map{|t,v| v}.join(' ')
- after = insn.rets.reverse.map{|t,v| v}.join(' ')
-
- if cat != insn.comm[:c]
- d << "** #{insn.comm[:c]}\n\n"
- cat = insn.comm[:c]
- end
-
- d << "*** #{insn.name}\n"
- d << "\n"
- d << insn.comm[lang] + "\n\n"
- d << ":instruction sequence: 0x%02x #{seq}\n" % i
- d << ":stack: #{before} => #{after}\n\n"
- i+=1
- }
- d
- end
-
- def desc_ja
- d = desc :j
- ERB.new(vpath.read('template/yarvarch.ja')).result(binding)
- end
-
- def desc_en
- d = desc :e
- ERB.new(vpath.read('template/yarvarch.en')).result(binding)
- end
- end
-
- module VPATH
- def search(meth, base, *rest)
- begin
- meth.call(base, *rest)
- rescue Errno::ENOENT => error
- each do |dir|
- return meth.call(File.join(dir, base), *rest) rescue nil
- end
- raise error
- end
- end
-
- def process(*args, &block)
- search(File.method(__callee__), *args, &block)
- end
-
- alias stat process
- alias lstat process
-
- def open(*args)
- f = search(File.method(:open), *args)
- if block_given?
- begin
- yield f
- ensure
- f.close unless f.closed?
- end
- else
- f
- end
- end
-
- def read(*args)
- open(*args) {|f| f.read}
- end
-
- def foreach(file, *args, &block)
- open(file) {|f| f.each(*args, &block)}
- end
-
- def self.def_options(opt)
- vpath = []
- path_sep = ':'
-
- opt.on("-I", "--srcdir=DIR", "add a directory to search path") {|dir|
- vpath |= [dir]
- }
- opt.on("-L", "--vpath=PATH LIST", "add directories to search path") {|dirs|
- vpath |= dirs.split(path_sep)
- }
- opt.on("--path-separator=SEP", /\A\W\z/, "separator for vpath") {|sep|
- path_sep = sep
- }
-
- proc {
- vpath.extend(self) unless vpath.empty?
- }
- end
- end
-
- class SourceCodeGenerator
- Files = { # codes
- 'vm.inc' => VmBodyGenerator,
- 'vmtc.inc' => VmTCIncGenerator,
- 'insns.inc' => InsnsIncGenerator,
- 'insns_info.inc' => InsnsInfoIncGenerator,
- # 'minsns.inc' => MInsnsIncGenerator,
- 'optinsn.inc' => OptInsnIncGenerator,
- 'optunifs.inc' => OptUnifsIncGenerator,
- 'opt_sc.inc' => OptSCIncGenerator,
- 'yasmdata.rb' => YASMDataRbGenerator,
- }
-
- def generate args = []
- args = Files.keys if args.empty?
- args.each{|fn|
- s = Files[fn].new(@insns).generate
- open(output_path(fn), 'w') {|f| f.puts(s)}
- }
- end
-
- def self.def_options(opt)
- opts = {
- :"insns.def" => 'insns.def',
- :"opope.def" => 'defs/opt_operand.def',
- :"unif.def" => 'defs/opt_insn_unif.def',
- }
-
- opt.on("-Dname", /\AOPT_(\w+)\z/, "enable VM option") {|s, v|
- opts[v] = true
- }
- opt.on("--enable=name[,name...]", Array,
- "enable VM options (without OPT_ prefix)") {|*a|
- a.each {|v| opts[v] = true}
- }
- opt.on("-Uname", /\AOPT_(\w+)\z/, "disable VM option") {|s, v|
- opts[v] = false
- }
- opt.on("--disable=name[,name...]", Array,
- "disable VM options (without OPT_ prefix)") {|*a|
- a.each {|v| opts[v] = false}
- }
- opt.on("-i", "--insnsdef=FILE", "--instructions-def",
- "instructions definition file") {|n|
- opts[:insns_def] = n
- }
- opt.on("-o", "--opt-operanddef=FILE", "--opt-operand-def",
- "vm option: operand definition file") {|n|
- opts[:opope_def] = n
- }
- opt.on("-u", "--opt-insnunifdef=FILE", "--opt-insn-unif-def",
- "vm option: instruction unification file") {|n|
- opts[:unif_def] = n
- }
- opt.on("-C", "--[no-]use-const",
- "use consts for default operands instead of macros") {|v|
- opts[:use_const] = v
- }
- opt.on("-d", "--destdir", "--output-directory=DIR",
- "make output file underneath DIR") {|v|
- opts[:destdir] = v
- }
- opt.on("-V", "--[no-]verbose") {|v|
- opts[:verbose] = v
- }
-
- vpath = VPATH.def_options(opt)
-
- proc {
- opts[:VPATH] = vpath.call
- build opts
- }
- end
-
- def self.build opts, vpath = ['./']
- opts[:VPATH] = vpath.extend(VPATH) unless opts[:VPATH]
- self.new InstructionsLoader.new(opts)
- end
- end
-end
-
diff --git a/tool/make-snapshot b/tool/make-snapshot
deleted file mode 100755
index 45b6c51efc..0000000000
--- a/tool/make-snapshot
+++ /dev/null
@@ -1,218 +0,0 @@
-#!/usr/bin/ruby -s
-# -*- coding: us-ascii -*-
-require 'uri'
-require 'digest/md5'
-require 'digest/sha2'
-require 'fileutils'
-require 'tmpdir'
-STDOUT.sync = true
-
-$exported = nil if $exported == ""
-$archname = nil if $archname == ""
-
-ENV["LC_ALL"] = ENV["LANG"] = "C"
-SVNURL = URI.parse("http://svn.ruby-lang.org/repos/ruby/")
-RUBY_VERSION_PATTERN = /^\#define\s+RUBY_VERSION\s+"([\d.]+)"/
-
-ENV["VPATH"] ||= "include/ruby"
-YACC = ENV["YACC"] ||= "bison"
-ENV["BASERUBY"] ||= "ruby"
-ENV["RUBY"] ||= "ruby"
-ENV["MV"] ||= "mv"
-ENV["RM"] ||= "rm -f"
-ENV["MINIRUBY"] ||= "ruby"
-ENV["PROGRAM"] ||= "ruby"
-
-class String
- # for older ruby
- alias bytesize size unless method_defined?(:bytesize)
-end
-
-$patch_file &&= File.expand_path($patch_file)
-path = ENV["PATH"].split(File::PATH_SEPARATOR)
-%w[YACC BASERUBY RUBY MV MINIRUBY].each do |var|
- cmd = ENV[var]
- unless path.any? {|dir|
- file = File.expand_path(cmd, dir)
- File.file?(file) and File.executable?(file)
- }
- abort "#{File.basename $0}: #{var} command not found - #{cmd}"
- end
-end
-
-unless destdir = ARGV.shift
- abort "usage: #{File.basename $0} new-directory-to-save [version ...]"
-end
-revisions = ARGV.empty? ? ["trunk"] : ARGV
-unless tmp = $exported
- FileUtils.mkpath(destdir)
- destdir = File.expand_path(destdir)
- tmp = Dir.mktmpdir("ruby-snapshot")
- FileUtils.mkpath(tmp)
- at_exit {
- Dir.chdir "/"
- FileUtils.rm_rf(tmp)
- } unless $keep_temp
-end
-Dir.chdir tmp
-
-def package(rev, destdir)
- patchlevel = false
- case rev
- when /\Atrunk\z/, /\Abranches\//, /\Atags\//
- url = SVNURL + rev
- when /\Astable\z/
- url = SVNURL + "branches/"
- url = url + `svn ls #{url}`[/.*^(ruby_\d+_\d+)\//m, 1]
- when /\A(.*)\.(.*)\.(.*)-((?!preview)p)?(.*)/
- patchlevel = !!$4
- tag = "#{$4}#{$5}"
- url = SVNURL + "tags/v#{$1}_#{$2}_#{$3}_#{$5}"
- when /\./
- url = SVNURL + "branches/ruby_#{rev.tr('.', '_')}"
- else
- warn "#{$0}: unknown version - #{rev}"
- return
- end
- revision = `svn info #{url} 2>&1`[/Last Changed Rev: (\d+)/, 1]
- version = nil
- unless revision
- url = SVNURL + "trunk"
- version = `svn cat #{url + "version.h"}`[RUBY_VERSION_PATTERN, 1]
- unless rev == version
- warn "#{$0}: #{rev} not found"
- return
- end
- revision = `svn info #{url}`[/Last Changed Rev: (\d+)/, 1]
- end
- v = nil
- if $exported
- if String === $exported
- v = $exported
- end
- else
- v = "ruby"
- puts "Exporting #{rev}@#{revision}"
- IO.popen("svn export #{url} #{v}") do |pipe|
- pipe.each {|line| /^A/ =~ line or print line}
- end
- unless $?.success?
- warn("Export failed")
- return
- end
- end
-
- if !File.directory?(v)
- v = Dir.glob("ruby-*").select(&File.method(:directory?))
- v.size == 1 or abort "not exported"
- v = v[0]
- end
- open("#{v}/revision.h", "wb") {|f| f.puts "#define RUBY_REVISION #{revision}"}
- open("#{v}/.revision.time", "wb") {}
- version ||= (versionhdr = IO.read("#{v}/version.h"))[RUBY_VERSION_PATTERN, 1]
- version or return
- if patchlevel
- versionhdr ||= IO.read("#{v}/version.h")
- patchlevel = versionhdr[/^\#define\s+RUBY_PATCHLEVEL\s+(\d+)/, 1]
- tag = (patchlevel ? "p#{patchlevel}" : "r#{revision}")
- else
- tag ||= "r#{revision}"
- end
- unless v == $exported
- n = "ruby-#{version}-#{tag}"
- File.directory?(n) or File.rename v, n
- v = n
- end
- system("patch -d #{v} -p0 -i #{$patch_file}") if $patch_file
- def (clean = []).add(n) push(n); n end
- Dir.chdir(v) do
- File.open(clean.add("cross.rb"), "w") {|f| f.puts "CROSS_COMPILING=true"}
- unless File.exist?("configure")
- print "creating configure..."
- unless system("autoconf")
- puts " failed"
- return
- end
- puts " done"
- end
- clean.add("autom4te.cache")
- print "creating prerequisites..."
- if File.file?("common.mk") && /^prereq/ =~ commonmk = IO.read("common.mk")
- puts
- extout = clean.add('tmp')
- File.open(clean.add("config.status"), "w") {|f|
- f.puts "s,@configure_args@,|#_!!_#|,g"
- f.puts "s,@EXTOUT@,|#_!!_#|#{extout},g"
- f.puts "s,@bindir@,|#_!!_#|,g"
- f.puts "s,@ruby_install_name@,|#_!!_#|,g"
- f.puts "s,@ARCH_FLAG@,|#_!!_#|,g"
- f.puts "s,@CFLAGS@,|#_!!_#|,g"
- f.puts "s,@CPPFLAGS@,|#_!!_#|,g"
- f.puts "s,@LDFLAGS@,|#_!!_#|,g"
- f.puts "s,@DLDFLAGS@,|#_!!_#|,g"
- f.puts "s,@LIBEXT@,|#_!!_#|a,g"
- f.puts "s,@OBJEXT@,|#_!!_#|o,g"
- f.puts "s,@LIBRUBY@,|#_!!_#|liburyb.a,g"
- f.puts "s,@LIBRUBY_A@,|#_!!_#|liburyb.a,g"
- f.puts "s,@RM@,|#_!!_#|rm -f,g"
- f.puts "s,@CP@,|#_!!_#|cp,g"
- }
- FileUtils.mkpath(hdrdir = "#{extout}/include/ruby")
- File.open("#{hdrdir}/config.h", "w") {}
- miniruby = ENV['MINIRUBY'] + " -rcross"
- IO.popen("make -f - prereq srcdir=. CHDIR=cd IFCHANGE=tool/ifchange 'MINIRUBY=#{miniruby}' 'RUBY=#{ENV["RUBY"]}'", "w") do |f|
- f.puts(IO.read("Makefile.in").gsub(/^@.*\n/, '').gsub(/@([A-Za-z_]\w*)@/) {ENV[$1]})
- f.puts(commonmk.gsub(/\{[^{}]*\}/, ""))
- end
- clean.push("rbconfig.rb", ".rbconfig.time", "enc.mk")
- print "prerequisites"
- else
- system("#{YACC} -o parse.c parse.y")
- end
- FileUtils.rm_rf(clean)
- unless $?.success?
- puts " failed"
- return
- end
- puts " done"
- end
-
- if v == "."
- v = File.basename(Dir.pwd)
- Dir.chdir ".."
- else
- Dir.chdir(File.dirname(v))
- v = File.basename(v)
- end
-
- return [["bzip tarball", ".tar.bz2", %w"tar cjf"],
- ["gzip tarball", ".tar.gz", %w"tar czf"],
- ["zip archive", ".zip", %w"zip -qr"]
- ].collect do |mesg, ext, cmd|
- file = "#{destdir}/#{v||$archname}#{ext}"
- print "creating #{mesg}... #{file}"
- if system(*(cmd + [file, v]))
- puts " done"
- file
- else
- puts " failed"
- nil
- end
- end.compact
-ensure
- FileUtils.rm_rf(v) if v and !$exported and !$keep_temp
-end
-
-revisions.collect {|rev| package(rev, destdir)}.flatten.each do |name|
- name or next
- str = open(name, "rb") {|f| f.read}
- md5 = Digest::MD5.hexdigest str
- sha = Digest::SHA256.hexdigest str
- puts "* #{name}"
- puts " SIZE: #{str.bytesize} bytes"
- puts " MD5: #{md5}"
- puts " SHA256: #{sha}"
- puts
-end
-
-# vim:fileencoding=US-ASCII sw=2 ts=4 noexpandtab ff=unix
diff --git a/tool/mdoc2man.rb b/tool/mdoc2man.rb
deleted file mode 100755
index 0922474b47..0000000000
--- a/tool/mdoc2man.rb
+++ /dev/null
@@ -1,465 +0,0 @@
-#!/usr/bin/env ruby
-###
-### mdoc2man - mdoc to man converter
-###
-### Quick usage: mdoc2man.rb < mdoc_manpage.8 > man_manpage.8
-###
-### Ported from Perl by Akinori MUSHA.
-###
-### Copyright (c) 2001 University of Illinois Board of Trustees
-### Copyright (c) 2001 Mark D. Roth
-### Copyright (c) 2002, 2003 Akinori MUSHA
-### 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. All advertising materials mentioning features or use of this software
-### must display the following acknowledgement:
-### This product includes software developed by the University of
-### Illinois at Urbana, and their contributors.
-### 4. The University nor the names of their
-### contributors may be used to endorse or promote products derived from
-### this software without specific prior written permission.
-###
-### THIS SOFTWARE IS PROVIDED BY THE TRUSTEES 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 TRUSTEES 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.
-###
-### $Id$
-###
-
-class Mdoc2Man
- ANGLE = 1
- OPTION = 2
- PAREN = 3
-
- RE_PUNCT = /^[!"'),\.\/:;>\?\]`]$/
-
- def initialize
- @name = @date = @id = nil
- @refauthors = @reftitle = @refissue = @refdate = @refopt = nil
-
- @optlist = 0 ### 1 = bullet, 2 = enum, 3 = tag, 4 = item
- @oldoptlist = 0
- @nospace = 0 ### 0, 1, 2
- @enum = 0
- @synopsis = true
- @reference = false
- @ext = false
- @extopt = false
- @literal = false
- end
-
- def mdoc2man(i, o)
- i.each { |line|
- if /^\./ !~ line
- o.print line
- o.print ".br\n" if @literal
- next
- end
-
- line.slice!(0, 1)
-
- next if /\\"/ =~ line
-
- line = parse_macro(line) and o.print line
- }
-
- initialize
- end
-
- def parse_macro(line)
- words = line.split
- retval = ''
-
- quote = []
- dl = false
-
- while word = words.shift
- case word
- when RE_PUNCT
- while q = quote.pop
- case q
- when OPTION
- retval << ']'
- when PAREN
- retval << ')'
- when ANGLE
- retval << '>'
- end
- end
- retval << word
- next
- when 'Li', 'Pf'
- @nospace = 1
- next
- when 'Xo'
- @ext = true
- retval << ' ' unless retval.empty? || /[\n ]\z/ =~ retval
- next
- when 'Xc'
- @ext = false
- retval << "\n" unless @extopt
- break
- when 'Bd'
- @literal = true if words[0] == '-literal'
- retval << "\n"
- break
- when 'Ed'
- @literal = false
- break
- when 'Ns'
- @nospace = 1 if @nospace == 0
- retval.chomp!(' ')
- next
- when 'No'
- retval.chomp!(' ')
- retval << words.shift
- next
- when 'Dq'
- retval << '``'
- begin
- retval << words.shift << ' '
- end until words.empty? || RE_PUNCT =~ words[0]
- retval.chomp!(' ')
- retval << '\'\''
- @nospace = 1 if @nospace == 0 && RE_PUNCT =~ words[0]
- next
- when 'Sq', 'Ql'
- retval << '`' << words.shift << '\''
- @nospace = 1 if @nospace == 0 && RE_PUNCT =~ words[0]
- next
- # when 'Ic'
- # retval << '\\fB' << words.shift << '\\fP'
- # next
- when 'Oo'
- #retval << "[\\c\n"
- @extopt = true
- @nospace = 1 if @nospace == 0
- retval << '['
- next
- when 'Oc'
- @extopt = false
- retval << ']'
- next
- when 'Ao'
- @nospace = 1 if @nospace == 0
- retval << '<'
- next
- when 'Ac'
- retval << '>'
- next
- end
-
- retval << ' ' if @nospace == 0 && !(retval.empty? || /[\n ]\z/ =~ retval)
- @nospace = 0 if @nospace == 1
-
- case word
- when 'Dd'
- @date = words.join(' ')
- return nil
- when 'Dt'
- if words.size >= 2 && words[1] == '""' &&
- /^(.*)\(([0-9])\)$/ =~ words[0]
- words[0] = $1
- words[1] = $2
- end
- @id = words.join(' ')
- return nil
- when 'Os'
- retval << '.TH ' << @id << ' "' << @date << '" "' <<
- words.join(' ') << '"'
- break
- when 'Sh'
- retval << '.SH'
- @synopsis = (words[0] == 'SYNOPSIS')
- next
- when 'Xr'
- retval << '\\fB' << words.shift <<
- '\\fP(' << words.shift << ')' << (words.shift||'')
- break
- when 'Rs'
- @refauthors = []
- @reftitle = ''
- @refissue = ''
- @refdate = ''
- @refopt = ''
- @reference = true
- break
- when 'Re'
- retval << "\n"
-
- # authors
- while @refauthors.size > 1
- retval << @refauthors.shift << ', '
- end
- retval << 'and ' unless retval.empty?
- retval << @refauthors.shift
-
- # title
- retval << ', \\fI' << @reftitle << '\\fP'
-
- # issue
- retval << ', ' << @refissue unless @refissue.empty?
-
- # date
- retval << ', ' << @refdate unless @refdate.empty?
-
- # optional info
- retval << ', ' << @refopt unless @refopt.empty?
-
- retval << ".\n"
-
- @reference = false
- break
- when 'An'
- next
- when 'Dl'
- retval << ".nf\n" << '\\& '
- dl = true
- next
- when 'Ux'
- retval << "UNIX"
- next
- end
-
- if @reference
- case word
- when '%A'
- @refauthors.unshift(words.join(' '))
- break
- when '%T'
- @reftitle = words.join(' ')
- @reftitle.sub!(/^"/, '')
- @reftitle.sub!(/"$/, '')
- break
- when '%N'
- @refissue = words.join(' ')
- break
- when '%D'
- @refdate = words.join(' ')
- break
- when '%O'
- @refopt = words.join(' ')
- break
- end
- end
-
- case word
- when 'Nm'
- name = words.empty? ? @name : words.shift
- @name ||= name
- retval << ".br\n" if @synopsis
- retval << "\\fB" << name << "\\fP"
- @nospace = 1 if @nospace == 0 && RE_PUNCT =~ words[0]
- next
- when 'Nd'
- retval << '\\-'
- next
- when 'Fl'
- retval << '\\fB\\-' << words.shift << '\\fP'
- @nospace = 1 if @nospace == 0 && RE_PUNCT =~ words[0]
- next
- when 'Ar'
- retval << '\\fI'
- if words.empty?
- retval << 'file ...\\fP'
- else
- retval << words.shift << '\\fP'
- while words[0] == '|'
- retval << ' ' << words.shift << ' \\fI' << words.shift << '\\fP'
- end
- @nospace = 1 if @nospace == 0 && RE_PUNCT =~ words[0]
- next
- end
- when 'Cm'
- retval << '\\fB' << words.shift << '\\fP'
- while RE_PUNCT =~ words[0]
- retval << words.shift
- end
- next
- when 'Op'
- quote << OPTION
- @nospace = 1 if @nospace == 0
- retval << '['
- # words.push(words.pop + ']')
- next
- when 'Aq'
- quote << ANGLE
- @nospace = 1 if @nospace == 0
- retval << '<'
- # words.push(words.pop + '>')
- next
- when 'Pp'
- retval << "\n"
- next
- when 'Ss'
- retval << '.SS'
- next
- end
-
- if word == 'Pa' && !quote.include?(OPTION)
- retval << '\\fI'
- retval << '\\&' if /^\./ =~ words[0]
- retval << words.shift << '\\fP'
- while RE_PUNCT =~ words[0]
- retval << words.shift
- end
- # @nospace = 1 if @nospace == 0 && RE_PUNCT =~ words[0]
- next
- end
-
- case word
- when 'Dv'
- retval << '.BR'
- next
- when 'Em', 'Ev'
- retval << '.IR'
- next
- when 'Pq'
- retval << '('
- @nospace = 1
- quote << PAREN
- next
- when 'Sx', 'Sy'
- retval << '.B ' << words.join(' ')
- break
- when 'Ic'
- retval << '\\fB'
- until words.empty? || RE_PUNCT =~ words[0]
- case words[0]
- when 'Op'
- words.shift
- retval << '['
- words.push(words.pop + ']')
- next
- when 'Aq'
- words.shift
- retval << '<'
- words.push(words.pop + '>')
- next
- when 'Ar'
- words.shift
- retval << '\\fI' << words.shift << '\\fP'
- else
- retval << words.shift
- end
-
- retval << ' ' if @nospace == 0
- end
-
- retval.chomp!(' ')
- retval << '\\fP'
- retval << words.shift unless words.empty?
- break
- when 'Bl'
- @oldoptlist = @optlist
-
- case words[0]
- when '-bullet'
- @optlist = 1
- when '-enum'
- @optlist = 2
- @enum = 0
- when '-tag'
- @optlist = 3
- when '-item'
- @optlist = 4
- end
-
- break
- when 'El'
- @optlist = @oldoptlist
- next
- end
-
- if @optlist != 0 && word == 'It'
- case @optlist
- when 1
- # bullets
- retval << '.IP \\(bu'
- when 2
- # enum
- @enum += 1
- retval << '.IP ' << @enum << '.'
- when 3
- # tags
- retval << ".TP\n"
- case words[0]
- when 'Pa', 'Ev'
- words.shift
- retval << '.B'
- end
- when 4
- # item
- retval << ".IP\n"
- end
-
- next
- end
-
- case word
- when 'Sm'
- case words[0]
- when 'off'
- @nospace = 2
- when 'on'
- # retval << "\n"
- @nospace = 0
- end
- words.shift
- next
- end
-
- retval << word
- end
-
- return nil if retval == '.'
-
- retval.sub!(/\A\.([^a-zA-Z])/, "\\1")
- # retval.chomp!(' ')
-
- while q = quote.pop
- case q
- when OPTION
- retval << ']'
- when PAREN
- retval << ')'
- when ANGLE
- retval << '>'
- end
- end
-
- # retval << ' ' unless @nospace == 0 || retval.empty? || /\n\z/ =~ retval
-
- retval << ' ' unless !@ext || @extopt || / $/ =~ retval
-
- retval << "\n" unless @ext || @extopt || retval.empty? || /\n\z/ =~ retval
-
- retval << ".fi\n" if dl
-
- return retval
- end
-
- def self.mdoc2man(i, o)
- new.mdoc2man(i, o)
- end
-end
-
-if $0 == __FILE__
- Mdoc2Man.mdoc2man(ARGF, STDOUT)
-end
diff --git a/tool/mkconfig.rb b/tool/mkconfig.rb
deleted file mode 100755
index a66a20f3e8..0000000000
--- a/tool/mkconfig.rb
+++ /dev/null
@@ -1,226 +0,0 @@
-#!./miniruby -s
-
-# avoid warnings with -d.
-$install_name ||= nil
-$so_name ||= nil
-
-srcdir = File.expand_path('../..', __FILE__)
-$:.replace [srcdir+"/lib"] unless defined?(CROSS_COMPILING)
-$:.unshift(".")
-
-require "fileutils"
-mkconfig = File.basename($0)
-
-rbconfig_rb = ARGV[0] || 'rbconfig.rb'
-unless File.directory?(dir = File.dirname(rbconfig_rb))
- FileUtils.makedirs(dir, :verbose => true)
-end
-
-version = RUBY_VERSION
-config = ""
-def config.write(arg)
- concat(arg.to_s)
-end
-$stdout = config
-
-fast = {'prefix'=>TRUE, 'ruby_install_name'=>TRUE, 'INSTALL'=>TRUE, 'EXEEXT'=>TRUE}
-print %[
-# This file was created by #{mkconfig} when ruby was built. Any
-# changes made to this file will be lost the next time ruby is built.
-
-module RbConfig
- RUBY_VERSION == "#{version}" or
- raise "ruby lib version (#{version}) doesn't match executable version (\#{RUBY_VERSION})"
-
-]
-
-arch = RUBY_PLATFORM
-v_fast = []
-v_others = []
-vars = {}
-continued_name = nil
-continued_line = nil
-File.foreach "config.status" do |line|
- next if /^#/ =~ line
- name = nil
- case line
- when /^s([%,])@(\w+)@\1(?:\|\#_!!_\#\|)?(.*)\1/
- name = $2
- val = $3.gsub(/\\(?=,)/, '')
- when /^S\["(\w+)"\]\s*=\s*"(.*)"\s*(\\)?$/
- name = $1
- val = $2
- if $3
- continued_line = []
- continued_line << val
- continued_name = name
- next
- end
- when /^"(.*)"\s*(\\)?$/
- if continued_line
- continued_line << $1
- next if $2
- val = continued_line.join("")
- name = continued_name
- continued_line = nil
- end
- when /^(?:ac_given_)?INSTALL=(.*)/
- v_fast << " CONFIG[\"INSTALL\"] = " + $1 + "\n"
- end
-
- if name
- case name
- when /^(?:ac_.*|configure_input|(?:top_)?srcdir|\w+OBJS)$/; next
- when /^(?:X|(?:MINI|RUN)RUBY$)/; next
- when /^(?:MAJOR|MINOR|TEENY)$/; next
- when /^RUBY_INSTALL_NAME$/; next if $install_name
- when /^RUBY_SO_NAME$/; next if $so_name
- when /^arch$/; if val.empty? then val = arch else arch = val end
- when /^sitearch/; val = '$(arch)' if val.empty?
- end
- case val
- when /^\$\(ac_\w+\)$/; next
- when /^\$\{ac_\w+\}$/; next
- when /^\$ac_\w+$/; next
- end
- if /^program_transform_name$/ =~ name
- val.sub!(/\As(\W)(?:\^|\$\$)\1\1(;|\z)/, '')
- if val.empty?
- $install_name ||= "ruby"
- next
- end
- unless $install_name
- $install_name = "ruby"
- val.gsub!(/\$\$/, '$')
- val.scan(%r[\G[\s;]*(/(?:\\.|[^/])*/)?([sy])(\W)((?:\\.|(?!\3).)*)\3((?:\\.|(?!\3).)*)\3([gi]*)]) do
- |addr, cmd, sep, pat, rep, opt|
- if addr
- Regexp.new(addr[/\A\/(.*)\/\z/, 1]) =~ $install_name or next
- end
- case cmd
- when 's'
- pat = Regexp.new(pat, opt.include?('i'))
- if opt.include?('g')
- $install_name.gsub!(pat, rep)
- else
- $install_name.sub!(pat, rep)
- end
- when 'y'
- $install_name.tr!(Regexp.quote(pat), rep)
- end
- end
- end
- end
- val.gsub!(/ +(?!-)/, "=") if name == "configure_args" && /mswin32/ =~ RUBY_PLATFORM
- val = val.gsub(/\$(?:\$|\{?(\w+)\}?)/) {$1 ? "$(#{$1})" : $&}.dump
- if /^prefix$/ =~ name
- val = "(TOPDIR || DESTDIR + #{val})"
- end
- v = " CONFIG[\"#{name}\"] #{vars[name] ? '<< "\n"' : '='} #{val}\n"
- vars[name] = true
- if fast[name]
- v_fast << v
- else
- v_others << v
- end
- case name
- when "ruby_version"
- version = val[/\A"(.*)"\z/, 1]
- end
- end
-# break if /^CEOF/
-end
-
-drive = File::PATH_SEPARATOR == ';'
-
-prefix = "/lib/ruby/#{version}/#{arch}"
-print " TOPDIR = File.dirname(__FILE__).chomp!(#{prefix.dump})\n"
-print " DESTDIR = ", (drive ? "TOPDIR && TOPDIR[/\\A[a-z]:/i] || " : ""), "'' unless defined? DESTDIR\n"
-print " CONFIG = {}\n"
-print " CONFIG[\"DESTDIR\"] = DESTDIR\n"
-
-versions = {}
-IO.foreach(File.join(srcdir, "version.h")) do |l|
- m = /^\s*#\s*define\s+RUBY_(VERSION_(MAJOR|MINOR|TEENY)|PATCHLEVEL)\s+(-?\d+)/.match(l)
- if m
- versions[m[2]||m[1]] = m[3]
- break if versions.size == 4
- end
-end
-%w[MAJOR MINOR TEENY PATCHLEVEL].each do |v|
- print " CONFIG[#{v.dump}] = #{versions[v].dump}\n"
-end
-
-dest = drive ? /= \"(?!\$[\(\{])(?:[a-z]:)?/i : /= \"(?!\$[\(\{])/
-v_others.collect! do |x|
- if /^\s*CONFIG\["(?!abs_|old)[a-z]+(?:_prefix|dir)"\]/ === x
- x.sub(dest, '= "$(DESTDIR)')
- else
- x
- end
-end
-
-if $install_name
- v_fast << " CONFIG[\"ruby_install_name\"] = \"" + $install_name + "\"\n"
- v_fast << " CONFIG[\"RUBY_INSTALL_NAME\"] = \"" + $install_name + "\"\n"
-end
-if $so_name
- v_fast << " CONFIG[\"RUBY_SO_NAME\"] = \"" + $so_name + "\"\n"
-end
-
-print(*v_fast)
-print(*v_others)
-print <<EOS
- CONFIG["rubylibdir"] = "$(rubylibprefix)/$(ruby_version)"
- CONFIG["archdir"] = "$(rubylibdir)/$(arch)"
- CONFIG["sitelibdir"] = "$(sitedir)/$(ruby_version)"
- CONFIG["sitearchdir"] = "$(sitelibdir)/$(sitearch)"
- CONFIG["vendorlibdir"] = "$(vendordir)/$(ruby_version)"
- CONFIG["vendorarchdir"] = "$(vendorlibdir)/$(sitearch)"
- CONFIG["topdir"] = File.dirname(__FILE__)
- MAKEFILE_CONFIG = {}
- CONFIG.each{|k,v| MAKEFILE_CONFIG[k] = v.dup}
- def RbConfig::expand(val, config = CONFIG)
- newval = val.gsub(/\\$\\$|\\$\\(([^()]+)\\)|\\$\\{([^{}]+)\\}/) {
- var = $&
- if !(v = $1 || $2)
- '$'
- elsif key = config[v = v[/\\A[^:]+(?=(?::(.*?)=(.*))?\\z)/]]
- pat, sub = $1, $2
- config[v] = false
- config[v] = RbConfig::expand(key, config)
- key = key.gsub(/\#{Regexp.quote(pat)}(?=\\s|\\z)/n) {sub} if pat
- key
- else
- var
- end
- }
- val.replace(newval) unless newval == val
- val
- end
- CONFIG.each_value do |val|
- RbConfig::expand(val)
- end
-end
-Config = RbConfig # compatibility for ruby-1.8.4 and older.
-CROSS_COMPILING = nil unless defined? CROSS_COMPILING
-EOS
-
-$stdout = STDOUT
-mode = IO::RDWR|IO::CREAT
-mode |= IO::BINARY if defined?(IO::BINARY)
-open(rbconfig_rb, mode) do |f|
- if $timestamp and f.stat.size == config.size and f.read == config
- puts "#{rbconfig_rb} unchanged"
- else
- puts "#{rbconfig_rb} updated"
- f.rewind
- f.truncate(0)
- f.print(config)
- end
-end
-if String === $timestamp
- FileUtils.touch($timestamp)
-end
-
-# vi:set sw=2:
diff --git a/tool/node_name.rb b/tool/node_name.rb
deleted file mode 100755
index 5d39e9f5cc..0000000000
--- a/tool/node_name.rb
+++ /dev/null
@@ -1,4 +0,0 @@
-#! ./miniruby -n
-if ~/enum node_type \{/..~/^\};/
- ~/(NODE_.+),/ and puts(" case #{$1}:\n\treturn \"#{$1}\";")
-end
diff --git a/tool/parse.rb b/tool/parse.rb
deleted file mode 100755
index 6243d7aa8e..0000000000
--- a/tool/parse.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-$file = ARGV[0]
-$str = ARGF.read.sub(/^__END__.*\z/m, '')
-puts '# ' + '-' * 70
-puts "# target program: "
-puts '# ' + '-' * 70
-puts $str
-puts '# ' + '-' * 70
-
-$parsed = RubyVM::InstructionSequence.compile_file($file)
-puts "# disasm result: "
-puts '# ' + '-' * 70
-puts $parsed.disasm
-puts '# ' + '-' * 70
diff --git a/tool/rbinstall.rb b/tool/rbinstall.rb
deleted file mode 100755
index 621fffc70d..0000000000
--- a/tool/rbinstall.rb
+++ /dev/null
@@ -1,550 +0,0 @@
-#!./miniruby
-
-load "./rbconfig.rb"
-include RbConfig
-$".unshift File.expand_path("./rbconfig.rb")
-
-srcdir = File.expand_path('../..', __FILE__)
-unless defined?(CROSS_COMPILING) and CROSS_COMPILING
- $:.replace([srcdir+"/lib", Dir.pwd])
-end
-require 'fileutils'
-require 'shellwords'
-require 'optparse'
-require 'optparse/shellwords'
-require 'tempfile'
-
-STDOUT.sync = true
-File.umask(0)
-
-def parse_args(argv = ARGV)
- $mantype = 'doc'
- $destdir = nil
- $extout = nil
- $make = 'make'
- $mflags = []
- $install = []
- $installed_list = nil
- $dryrun = false
- $rdocdir = nil
- $data_mode = 0644
- $prog_mode = 0755
- $dir_mode = nil
- $script_mode = nil
- $strip = false
- $cmdtype = ('bat' if File::ALT_SEPARATOR == '\\')
- mflags = []
- opt = OptionParser.new
- opt.on('-n') {$dryrun = true}
- opt.on('--dest-dir=DIR') {|dir| $destdir = dir}
- opt.on('--extout=DIR') {|dir| $extout = (dir unless dir.empty?)}
- opt.on('--make=COMMAND') {|make| $make = make}
- opt.on('--mantype=MAN') {|man| $mantype = man}
- opt.on('--make-flags=FLAGS', '--mflags', Shellwords) do |v|
- if arg = v.first
- arg.insert(0, '-') if /\A[^-][^=]*\Z/ =~ arg
- end
- $mflags.concat(v)
- end
- opt.on('-i', '--install=TYPE',
- [:local, :bin, :"bin-arch", :"bin-comm", :lib, :man, :ext, :"ext-arch", :"ext-comm", :rdoc, :capi]) do |ins|
- $install << ins
- end
- opt.on('--data-mode=OCTAL-MODE', OptionParser::OctalInteger) do |mode|
- $data_mode = mode
- end
- opt.on('--prog-mode=OCTAL-MODE', OptionParser::OctalInteger) do |mode|
- $prog_mode = mode
- end
- opt.on('--dir-mode=OCTAL-MODE', OptionParser::OctalInteger) do |mode|
- $dir_mode = mode
- end
- opt.on('--script-mode=OCTAL-MODE', OptionParser::OctalInteger) do |mode|
- $script_mode = mode
- end
- opt.on('--installed-list [FILENAME]') {|name| $installed_list = name}
- opt.on('--rdoc-output [DIR]') {|dir| $rdocdir = dir}
- opt.on('--cmd-type=TYPE', %w[bat cmd plain]) {|cmd| $cmdtype = (cmd unless cmd == 'plain')}
- opt.on('--[no-]strip') {|strip| $strip = strip}
-
- opt.order!(argv) do |v|
- case v
- when /\AINSTALL[-_]([-\w]+)=(.*)/
- argv.unshift("--#{$1.tr('_', '-')}=#{$2}")
- when /\A\w[-\w+]*=\z/
- mflags << v
- when /\A\w[-\w+]*\z/
- $install << v.intern
- else
- raise OptionParser::InvalidArgument, v
- end
- end rescue abort [$!.message, opt].join("\n")
-
- $make, *rest = Shellwords.shellwords($make)
- $mflags.unshift(*rest) unless rest.empty?
- $mflags.unshift(*mflags)
-
- def $mflags.set?(flag)
- grep(/\A-(?!-).*#{flag.chr}/i) { return true }
- false
- end
- def $mflags.defined?(var)
- grep(/\A#{var}=(.*)/) {return block_given? ? yield($1) : $1}
- false
- end
-
- if $mflags.set?(?n)
- $dryrun = true
- else
- $mflags << '-n' if $dryrun
- end
-
- $destdir ||= $mflags.defined?("DESTDIR")
- if $extout ||= $mflags.defined?("EXTOUT")
- RbConfig.expand($extout)
- end
-
- $continue = $mflags.set?(?k)
-
- if $installed_list ||= $mflags.defined?('INSTALLED_LIST')
- RbConfig.expand($installed_list, RbConfig::CONFIG)
- $installed_list = open($installed_list, "ab")
- $installed_list.sync = true
- end
-
- $rdocdir ||= $mflags.defined?('RDOCOUT')
-
- $dir_mode ||= $prog_mode | 0700
- $script_mode ||= $prog_mode
-end
-
-parse_args()
-
-include FileUtils
-include FileUtils::NoWrite if $dryrun
-@fileutils_output = STDOUT
-@fileutils_label = ''
-
-$install_procs = Hash.new {[]}
-def install?(*types, &block)
- $install_procs[:all] <<= block
- types.each do |type|
- $install_procs[type] <<= block
- end
-end
-
-def strip_file(file)
- if !defined?($strip_command) and (cmd = CONFIG["STRIP"])
- case cmd
- when "", "true", ":" then return
- else $strip_command = Shellwords.shellwords(cmd)
- end
- elsif !$strip_command
- return
- end
- system(*($strip_command + [file]))
-end
-
-def install(src, dest, options = {})
- options = options.clone
- strip = options.delete(:strip)
- options[:preserve] = true
- d = with_destdir(dest)
- super(src, d, options)
- if strip
- d = File.join(d, File.basename(src)) if $made_dirs[dest]
- strip_file(d)
- end
- if $installed_list
- dest = File.join(dest, File.basename(src)) if $made_dirs[dest]
- $installed_list.puts dest
- end
-end
-
-def ln_sf(src, dest)
- super(src, with_destdir(dest))
- $installed_list.puts dest if $installed_list
-end
-
-$made_dirs = {}
-def makedirs(dirs)
- dirs = fu_list(dirs)
- dirs.collect! do |dir|
- realdir = with_destdir(dir)
- realdir unless $made_dirs.fetch(dir) do
- $made_dirs[dir] = true
- $installed_list.puts(File.join(dir, "")) if $installed_list
- File.directory?(realdir)
- end
- end.compact!
- super(dirs, :mode => $dir_mode) unless dirs.empty?
-end
-
-FalseProc = proc {false}
-def path_matcher(pat)
- if pat and !pat.empty?
- proc {|f| pat.any? {|n| File.fnmatch?(n, f)}}
- else
- FalseProc
- end
-end
-
-def install_recursive(srcdir, dest, options = {})
- opts = options.clone
- noinst = opts.delete(:no_install)
- glob = opts.delete(:glob) || "*"
- subpath = (srcdir.size+1)..-1
- prune = skip = FalseProc
- if noinst
- if Array === noinst
- prune = noinst.grep(/#{File::SEPARATOR}/o).map!{|f| f.chomp(File::SEPARATOR)}
- skip = noinst.grep(/\A[^#{File::SEPARATOR}]*\z/o)
- else
- if noinst.index(File::SEPARATOR)
- prune = [noinst]
- else
- skip = [noinst]
- end
- end
- skip |= %w"#*# *~ *.old *.bak *.orig *.rej *.diff *.patch *.core"
- prune = path_matcher(prune)
- skip = path_matcher(skip)
- end
- File.directory?(srcdir) or return rescue return
- paths = [[srcdir, dest, true]]
- found = []
- while file = paths.shift
- found << file
- file, d, dir = *file
- if dir
- files = []
- Dir.foreach(file) do |f|
- src = File.join(file, f)
- d = File.join(dest, dir = src[subpath])
- stat = File.stat(src) rescue next
- if stat.directory?
- files << [src, d, true] if /\A\./ !~ f and !prune[dir]
- else
- files << [src, d, false] if File.fnmatch?(glob, f) and !skip[f]
- end
- end
- paths.insert(0, *files)
- end
- end
- for src, d, dir in found
- if dir
- makedirs(d)
- else
- makedirs(File.dirname(d))
- install src, d, opts
- end
- end
-end
-
-def open_for_install(path, mode)
- data = open(realpath = with_destdir(path), "rb") {|f| f.read} rescue nil
- newdata = yield
- unless $dryrun
- unless newdata == data
- open(realpath, "wb", mode) {|f| f.write newdata}
- end
- File.chmod(mode, realpath)
- end
- $installed_list.puts path if $installed_list
-end
-
-def with_destdir(dir)
- return dir if !$destdir or $destdir.empty?
- dir = dir.sub(/\A\w:/, '') if File::PATH_SEPARATOR == ';'
- $destdir + dir
-end
-
-def prepare(mesg, basedir, subdirs=nil)
- case
- when !subdirs
- dirs = basedir
- when subdirs.size == 0
- subdirs = nil
- when subdirs.size == 1
- dirs = [basedir = File.join(basedir, subdirs)]
- subdirs = nil
- else
- dirs = [basedir, *subdirs.collect {|dir| File.join(basedir, dir)}]
- end
- printf("installing %-18s %s%s\n", "#{mesg}:", basedir,
- (subdirs ? " (#{subdirs.join(', ')})" : ""))
- makedirs(dirs)
-end
-
-exeext = CONFIG["EXEEXT"]
-
-ruby_install_name = CONFIG["ruby_install_name"]
-rubyw_install_name = CONFIG["rubyw_install_name"]
-goruby_install_name = "go" + ruby_install_name
-
-version = CONFIG["ruby_version"]
-bindir = CONFIG["bindir"]
-libdir = CONFIG["libdir"]
-archhdrdir = rubyhdrdir = CONFIG["rubyhdrdir"]
-archhdrdir += "/" + CONFIG["arch"]
-rubylibdir = CONFIG["rubylibdir"]
-archlibdir = CONFIG["archdir"]
-sitelibdir = CONFIG["sitelibdir"]
-sitearchlibdir = CONFIG["sitearchdir"]
-vendorlibdir = CONFIG["vendorlibdir"]
-vendorarchlibdir = CONFIG["vendorarchdir"]
-mandir = CONFIG["mandir"]
-capidir = CONFIG["docdir"]
-configure_args = Shellwords.shellwords(CONFIG["configure_args"])
-enable_shared = CONFIG["ENABLE_SHARED"] == 'yes'
-dll = CONFIG["LIBRUBY_SO"]
-lib = CONFIG["LIBRUBY"]
-arc = CONFIG["LIBRUBY_A"]
-
-install?(:local, :arch, :bin, :'bin-arch') do
- prepare "binary commands", bindir
-
- install ruby_install_name+exeext, bindir, :mode => $prog_mode, :strip => $strip
- if rubyw_install_name and !rubyw_install_name.empty?
- install rubyw_install_name+exeext, bindir, :mode => $prog_mode, :strip => $strip
- end
- if File.exist? goruby_install_name+exeext
- install goruby_install_name+exeext, bindir, :mode => $prog_mode, :strip => $strip
- end
- if enable_shared and dll != lib
- install dll, bindir, :mode => $prog_mode, :strip => $strip
- end
-end
-
-install?(:local, :arch, :lib) do
- prepare "base libraries", libdir
-
- install lib, libdir, :mode => $prog_mode, :strip => $strip unless lib == arc
- install arc, libdir, :mode => $data_mode
- if dll == lib and dll != arc
- for link in CONFIG["LIBRUBY_ALIASES"].split
- ln_sf(dll, File.join(libdir, link))
- end
- end
-
- prepare "arch files", archlibdir
- install "rbconfig.rb", archlibdir, :mode => $data_mode
- if CONFIG["ARCHFILE"]
- for file in CONFIG["ARCHFILE"].split
- install file, archlibdir, :mode => $data_mode
- end
- end
-end
-
-if $extout
- extout = "#$extout"
- install?(:ext, :arch, :'ext-arch') do
- prepare "extension objects", archlibdir
- noinst = %w[-*] | (CONFIG["no_install_files"] || "").split
- install_recursive("#{extout}/#{CONFIG['arch']}", archlibdir, :no_install => noinst, :mode => $prog_mode, :strip => $strip)
- prepare "extension objects", sitearchlibdir
- prepare "extension objects", vendorarchlibdir
- end
- install?(:ext, :arch, :'ext-arch') do
- prepare "extension headers", archhdrdir
- install_recursive("#{extout}/include/#{CONFIG['arch']}", archhdrdir, :glob => "*.h", :mode => $data_mode)
- end
- install?(:ext, :comm, :'ext-comm') do
- prepare "extension scripts", rubylibdir
- install_recursive("#{extout}/common", rubylibdir, :mode => $data_mode)
- prepare "extension scripts", sitelibdir
- prepare "extension scripts", vendorlibdir
- end
- install?(:ext, :comm, :'ext-comm') do
- hdrdir = rubyhdrdir + "/ruby"
- prepare "extension headers", hdrdir
- install_recursive("#{extout}/include/ruby", hdrdir, :glob => "*.h", :mode => $data_mode)
- end
-end
-
-install?(:doc, :rdoc) do
- if $rdocdir
- ridatadir = File.join(CONFIG['ridir'], CONFIG['ruby_version'], "system")
- prepare "rdoc", ridatadir
- install_recursive($rdocdir, ridatadir, :mode => $data_mode)
- end
-end
-install?(:doc, :capi) do
- prepare "capi-docs", capidir
- install_recursive "doc/capi", capidir, :mode => $data_mode
-end
-
-install?(:local, :comm, :bin, :'bin-comm') do
- prepare "command scripts", bindir
-
- ruby_shebang = File.join(bindir, ruby_install_name)
- if File::ALT_SEPARATOR
- ruby_bin = ruby_shebang.tr(File::SEPARATOR, File::ALT_SEPARATOR)
- end
- if trans = CONFIG["program_transform_name"]
- exp = []
- trans.gsub!(/\$\$/, '$')
- trans.scan(%r[\G[\s;]*(/(?:\\.|[^/])*/)?([sy])(\W)((?:\\.|(?!\3).)*)\3((?:\\.|(?!\3).)*)\3([gi]*)]) do
- |addr, cmd, sep, pat, rep, opt|
- addr &&= Regexp.new(addr[/\A\/(.*)\/\z/, 1])
- case cmd
- when 's'
- next if pat == '^' and rep.empty?
- exp << [addr, (opt.include?('g') ? :gsub! : :sub!),
- Regexp.new(pat, opt.include?('i')), rep.gsub(/&/){'\&'}]
- when 'y'
- exp << [addr, :tr!, Regexp.quote(pat), rep]
- end
- end
- trans = proc do |base|
- exp.each {|addr, opt, pat, rep| base.__send__(opt, pat, rep) if !addr or addr =~ base}
- base
- end
- elsif /ruby/ =~ ruby_install_name
- trans = proc {|base| ruby_install_name.sub(/ruby/, base)}
- else
- trans = proc {|base| base}
- end
- for src in Dir[File.join(srcdir, "bin/*")]
- next unless File.file?(src)
- next if /\/[.#]|(\.(old|bak|orig|rej|diff|patch|core)|~|\/core)$/i =~ src
-
- name = trans[File.basename(src)]
-
- shebang = ''
- body = ''
- open(src, "rb") do |f|
- shebang = f.gets
- body = f.read
- end
- shebang.sub!(/^\#!.*?ruby\b/) {"#!" + ruby_shebang}
- shebang.sub!(/\r$/, '')
- body.gsub!(/\r$/, '')
-
- cmd = File.join(bindir, name)
- cmd << ".#{$cmdtype}" if $cmdtype
- open_for_install(cmd, $script_mode) do
- case $cmdtype
- when "bat"
- "#{<<EOH}#{shebang}#{body}#{<<EOF}".gsub(/$/, "\r")
-@echo off
-@if not "%~d0" == "~d0" goto WinNT
-#{ruby_bin} -x "#{cmd}" %1 %2 %3 %4 %5 %6 %7 %8 %9
-@goto endofruby
-:WinNT
-"%~dp0#{ruby_install_name}" -x "%~f0" %*
-@goto endofruby
-EOH
-__END__
-:endofruby
-EOF
- when "cmd"
- "#{<<"/EOH"}#{shebang}#{body}"
-@"%~dp0#{ruby_install_name}" -x "%~f0" %*
-@exit /b %ERRORLEVEL%
-/EOH
- else
- shebang + body
- end
- end
- end
-end
-
-install?(:local, :comm, :lib) do
- prepare "library scripts", rubylibdir
- noinst = %w[README* *.txt *.rdoc]
- install_recursive(File.join(srcdir, "lib"), rubylibdir, :no_install => noinst, :mode => $data_mode)
-end
-
-install?(:local, :arch, :lib) do
- prepare "common headers", rubyhdrdir
-
- noinst = []
- unless RUBY_PLATFORM =~ /mswin|mingw|bccwin/
- noinst << "win32.h"
- end
- noinst = nil if noinst.empty?
- install_recursive(File.join(srcdir, "include"), rubyhdrdir, :no_install => noinst, :glob => "*.h", :mode => $data_mode)
-end
-
-install?(:local, :comm, :man) do
- mdocs = Dir["#{srcdir}/man/*.[1-9]"]
- prepare "manpages", mandir, ([] | mdocs.collect {|mdoc| mdoc[/\d+$/]}).sort.collect {|sec| "man#{sec}"}
-
- mandir = File.join(mandir, "man")
- has_goruby = File.exist?(goruby_install_name+exeext)
- require File.join(srcdir, "tool/mdoc2man.rb") if $mantype != "doc"
- mdocs.each do |mdoc|
- next unless File.file?(mdoc) and open(mdoc){|fh| fh.read(1) == '.'}
- base = File.basename(mdoc)
- if base == "goruby.1"
- next unless has_goruby
- end
-
- destdir = mandir + (section = mdoc[/\d+$/])
- destname = ruby_install_name.sub(/ruby/, base.chomp(".#{section}"))
- destfile = File.join(destdir, "#{destname}.#{section}")
-
- if $mantype == "doc"
- install mdoc, destfile, :mode => $data_mode
- else
- w = nil
- Tempfile.open(base) do |f|
- w = f
- open(mdoc) {|r| Mdoc2Man.mdoc2man(r, w)}
- end
- install w.path, destfile, :mode => $data_mode
- w.close!
- end
- end
-end
-
-install?(:ext, :comm, :gem) do
- directories = []
- IO.foreach(File.join(srcdir, "lib/rubygems.rb")) do |line|
- if /^\s*DIRECTORIES\s*=\s*%w\[(.*?)\]/ =~ line
- directories = $1.split
- break
- end
- end
- gpath = CONFIG["sitelibdir"].sub(%r'/site_ruby/(?=[^/]+)', '/gems/')
- prepare "default gems", gpath, directories
-
- destdir = File.join(gpath, directories.grep(/^spec/)[0])
- default_gems = [
- ['rake', 'rake.rb'],
- ['rdoc', 'rdoc.rb'],
- ['minitest', 'minitest/unit.rb'],
- ]
- default_gems.each do |name, lib|
- lib = File.join(srcdir, "lib", lib)
- version = open(lib) {|f| f.find {|s| /^\s*\w*VERSION\s*=(?!=)/ =~ s}} or next
- version = version.split(%r"=\s*", 2)[1].strip
- open_for_install(File.join(destdir, "#{name}.gemspec"), $data_mode) do |f|
- <<-GEMSPEC
-Gem::Specification.new do |s|
- s.name = #{name.dump}
- s.version = #{version}
- s.summary = "This #{name} is bundled with Ruby"
-end
- GEMSPEC
- end
- end
-end
-
-$install << :local << :ext if $install.empty?
-$install.each do |inst|
- if !(procs = $install_procs[inst]) || procs.empty?
- next warn("unknown install target - #{inst}")
- end
- procs.each do |block|
- dir = Dir.pwd
- begin
- block.call
- ensure
- Dir.chdir(dir)
- end
- end
-end
-
-# vi:set sw=2:
diff --git a/tool/rmdirs b/tool/rmdirs
deleted file mode 100755
index b116898fac..0000000000
--- a/tool/rmdirs
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/bin/sh
-for dir; do
- while rmdir "$dir" >/dev/null 2>&1 &&
- parent=`expr "$dir" : '\(.*\)/[^/][^/]*'`; do
- case "$parent" in
- . | .. | "$dir") break;;
- *) dir="$parent";;
- esac
- done
-done
-true
diff --git a/tool/rubytest.rb b/tool/rubytest.rb
deleted file mode 100755
index e546800279..0000000000
--- a/tool/rubytest.rb
+++ /dev/null
@@ -1,28 +0,0 @@
-#! ./miniruby
-
-exit if defined?(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
-
-$stderr.reopen($stdout)
-error = ''
-
-srcdir = File.expand_path('..', File.dirname(__FILE__))
-`#{ruby} #{srcdir}/sample/test.rb`.each_line do |line|
- if line =~ /^end of test/
- print "\ntest succeeded\n"
- exit true
- end
- error << line if %r:^(sample/test.rb|not): =~ line
-end
-print error
-print "test failed\n"
-exit false
diff --git a/tool/runruby.rb b/tool/runruby.rb
deleted file mode 100755
index d24b748c96..0000000000
--- a/tool/runruby.rb
+++ /dev/null
@@ -1,95 +0,0 @@
-#!./miniruby
-
-pure = true
-show = false
-precommand = []
-while arg = ARGV[0]
- break ARGV.shift if arg == '--'
- /\A--([-\w]+)(?:=(.*))?\z/ =~ arg or break
- arg, value = $1, $2
- re = Regexp.new('\A'+arg.gsub(/\w+\b/, '\&\\w*')+'\z', "i")
- case
- when re =~ "srcdir"
- srcdir = value
- when re =~ "archdir"
- archdir = value
- when re =~ "cpu"
- precommand << "arch" << "-arch" << value
- when re =~ "extout"
- extout = value
- when re =~ "pure"
- pure = (value != "no")
- when re =~ "debugger"
- require 'shellwords'
- precommand.concat(value ? (Shellwords.shellwords(value) unless value == "no") : %w"gdb --args")
- when re =~ "precommand"
- require 'shellwords'
- precommand.concat(Shellwords.shellwords(value))
- when re =~ "show"
- show = true
- else
- break
- end
- ARGV.shift
-end
-
-srcdir ||= File.expand_path('..', File.dirname(__FILE__))
-archdir ||= '.'
-
-abs_archdir = File.expand_path(archdir)
-$:.unshift(abs_archdir)
-
-config = File.read(conffile = File.join(abs_archdir, 'rbconfig.rb'))
-config.sub!(/^(\s*)RUBY_VERSION\s*==.*(\sor\s*)$/, '\1true\2')
-config = Module.new {module_eval(config, conffile)}::RbConfig::CONFIG
-
-ruby = File.join(archdir, config["RUBY_INSTALL_NAME"]+config['EXEEXT'])
-unless File.exist?(ruby)
- abort "#{ruby} is not found.\nTry `make' first, then `make test', please.\n"
-end
-
-libs = [abs_archdir]
-extout ||= config["EXTOUT"]
-if extout
- abs_extout = File.expand_path(extout)
- libs << File.expand_path("common", abs_extout) << File.expand_path(config['arch'], abs_extout)
-end
-libs << File.expand_path("lib", srcdir)
-config["bindir"] = abs_archdir
-
-env = {}
-
-env["RUBY"] = File.expand_path(ruby)
-env["PATH"] = [abs_archdir, ENV["PATH"]].compact.join(File::PATH_SEPARATOR)
-
-if pure
- libs << File.expand_path("ext", srcdir) << "-"
-elsif e = ENV["RUBYLIB"]
- libs |= e.split(File::PATH_SEPARATOR)
-end
-env["RUBYLIB"] = $:.replace(libs).join(File::PATH_SEPARATOR)
-
-libruby_so = File.join(abs_archdir, config['LIBRUBY_SO'])
-if File.file?(libruby_so)
- if e = config['LIBPATHENV'] and !e.empty?
- env[e] = [abs_archdir, ENV[e]].compact.join(File::PATH_SEPARATOR)
- end
- if /linux/ =~ RUBY_PLATFORM
- env["LD_PRELOAD"] = [libruby_so, ENV["LD_PRELOAD"]].compact.join(' ')
- end
-end
-
-ENV.update env
-
-cmd = [ruby]
-cmd << "-rpurelib.rb" if pure
-cmd.concat(ARGV)
-cmd.unshift(*precommand) unless precommand.empty?
-
-if show
- require 'shellwords'
- env.each {|k,v| puts "#{k}=#{v}"}
- puts Shellwords.join(cmd)
-end
-
-exec(*cmd)
diff --git a/tool/strip-rdoc.rb b/tool/strip-rdoc.rb
deleted file mode 100755
index dc4c3dc5dc..0000000000
--- a/tool/strip-rdoc.rb
+++ /dev/null
@@ -1,22 +0,0 @@
-#!ruby
-
-source = ARGF.read
-source = source.gsub(%r{/\*([!*])((?!\*/).+?)\*/}m) do |comment|
- marker, comment = $1, $2
- next "/**#{comment}*/" unless /^\s*\*\s?\-\-\s*$/ =~ comment
- doxybody = nil
- comment.each_line do |line|
- if doxybody
- if /^\s*\*\s?\+\+\s*$/ =~ line
- break
- end
- doxybody << line
- else
- if /^\s*\*\s?--\s*$/ =~ line
- doxybody = "\n"
- end
- end
- end
- "/*#{marker}#{doxybody}*/"
-end
-print source
diff --git a/tool/transcode-tblgen.rb b/tool/transcode-tblgen.rb
deleted file mode 100755
index f7f05c41ef..0000000000
--- a/tool/transcode-tblgen.rb
+++ /dev/null
@@ -1,853 +0,0 @@
-require 'optparse'
-require 'erb'
-require 'fileutils'
-
-NUM_ELEM_BYTELOOKUP = 2
-
-C_ESC = {
- "\\" => "\\\\",
- '"' => '\"',
- "\n" => '\n',
-}
-
-0x00.upto(0x1f) {|ch| C_ESC[[ch].pack("C")] ||= "\\%03o" % ch }
-0x7f.upto(0xff) {|ch| C_ESC[[ch].pack("C")] = "\\%03o" % ch }
-C_ESC_PAT = Regexp.union(*C_ESC.keys)
-
-def c_esc(str)
- '"' + str.gsub(C_ESC_PAT) { C_ESC[$&] } + '"'
-end
-
-class StrSet
- def self.parse(pattern)
- if /\A\s*(([0-9a-f][0-9a-f]|\{([0-9a-f][0-9a-f]|[0-9a-f][0-9a-f]-[0-9a-f][0-9a-f])(,([0-9a-f][0-9a-f]|[0-9a-f][0-9a-f]-[0-9a-f][0-9a-f]))*\})+(\s+|\z))*\z/i !~ pattern
- raise ArgumentError, "invalid pattern: #{pattern.inspect}"
- end
- result = []
- pattern.scan(/\S+/) {|seq|
- seq_result = []
- while !seq.empty?
- if /\A([0-9a-f][0-9a-f])/i =~ seq
- byte = $1.to_i(16)
- seq_result << [byte..byte]
- seq = $'
- elsif /\A\{([^\}]+)\}/ =~ seq
- set = $1
- seq = $'
- set_result = []
- set.scan(/[^,]+/) {|range|
- if /\A([0-9a-f][0-9a-f])-([0-9a-f][0-9a-f])\z/i =~ range
- b = $1.to_i(16)
- e = $2.to_i(16)
- set_result << (b..e)
- elsif /\A([0-9a-f][0-9a-f])\z/i =~ range
- byte = $1.to_i(16)
- set_result << (byte..byte)
- else
- raise "invalid range: #{range.inspect}"
- end
- }
- seq_result << set_result
- else
- raise "invalid sequence: #{seq.inspect}"
- end
- end
- result << seq_result
- }
- self.new(result)
- end
-
- def initialize(pat)
- @pat = pat
- end
-
- def hash
- return @hash if defined? @hash
- @hash = @pat.hash
- end
-
- def eql?(other)
- self.class == other.class &&
- @pat == other.instance_eval { @pat }
- end
-
- alias == eql?
-
- def to_s
- if @pat.empty?
- "(empset)"
- else
- @pat.map {|seq|
- if seq.empty?
- "(empstr)"
- else
- seq.map {|byteset|
- if byteset.length == 1 && byteset[0].begin == byteset[0].end
- "%02x" % byteset[0].begin
- else
- "{" +
- byteset.map {|range|
- if range.begin == range.end
- "%02x" % range.begin
- else
- "%02x-%02x" % [range.begin, range.end]
- end
- }.join(',') +
- "}"
- end
- }.join('')
- end
- }.join(' ')
- end
- end
-
- def inspect
- "\#<#{self.class}: #{self.to_s}>"
- end
-
- def min_length
- if @pat.empty?
- nil
- else
- @pat.map {|seq| seq.length }.min
- end
- end
-
- def max_length
- if @pat.empty?
- nil
- else
- @pat.map {|seq| seq.length }.max
- end
- end
-
- def emptyable?
- @pat.any? {|seq|
- seq.empty?
- }
- end
-
- def first_bytes
- result = {}
- @pat.each {|seq|
- next if seq.empty?
- seq.first.each {|range|
- range.each {|byte|
- result[byte] = true
- }
- }
- }
- result.keys.sort
- end
-
- def each_firstbyte
- h = {}
- @pat.each {|seq|
- next if seq.empty?
- seq.first.each {|range|
- range.each {|byte|
- (h[byte] ||= []) << seq[1..-1]
- }
- }
- }
- h.keys.sort.each {|byte|
- yield byte, StrSet.new(h[byte])
- }
- end
-end
-
-class ArrayCode
- def initialize(type, name)
- @type = type
- @name = name
- @len = 0;
- @content = ''
- end
-
- def length
- @len
- end
-
- def insert_at_last(num, str)
- newnum = self.length + num
- @content << str
- @len += num
- end
-
- def to_s
- <<"End"
-static const #{@type}
-#{@name}[#{@len}] = {
-#{@content}};
-End
- end
-end
-
-class ActionMap
- def self.parse(hash)
- h = {}
- hash.each {|pat, action|
- h[StrSet.parse(pat)] = action
- }
- self.new(h)
- end
-
- def initialize(h)
- @map = h
- end
-
- def hash
- return @hash if defined? @hash
- hash = 0
- @map.each {|k,v|
- hash ^= k.hash ^ v.hash
- }
- @hash = hash
- end
-
- def eql?(other)
- self.class == other.class &&
- @map == other.instance_eval { @map }
- end
-
- alias == eql?
-
- def inspect
- "\#<#{self.class}:" +
- @map.map {|k, v| " [" + k.to_s + "]=>" + v.inspect }.join('') +
- ">"
- end
-
- def max_input_length
- @map.keys.map {|k| k.max_length }.max
- end
-
- def empty_action
- @map.each {|ss, action|
- return action if ss.emptyable?
- }
- nil
- end
-
- def each_firstbyte(valid_encoding=nil)
- h = {}
- @map.each {|ss, action|
- if ss.emptyable?
- raise "emptyable pattern"
- else
- ss.each_firstbyte {|byte, rest|
- h[byte] ||= {}
- if h[byte][rest].nil?
- elsif action == :nomap0
- next
- elsif h[byte][rest] != :nomap0
- raise "ambiguous %s or %s (%02X/%s)" % [h[byte][rest], action, byte, rest]
- end
- h[byte][rest] = action
- }
- end
- }
- if valid_encoding
- valid_encoding.each_firstbyte {|byte, rest|
- if h[byte]
- am = ActionMap.new(h[byte])
- yield byte, am, rest
- else
- am = ActionMap.new(rest => :undef)
- yield byte, am, nil
- end
- }
- else
- h.keys.sort.each {|byte|
- am = ActionMap.new(h[byte])
- yield byte, am, nil
- }
- end
- end
-
- OffsetsMemo = {}
- InfosMemo = {}
-
- def format_offsets(min, max, offsets)
- offsets = offsets[min..max]
- code = "%d, %d,\n" % [min, max]
- 0.step(offsets.length-1,16) {|i|
- code << " "
- code << offsets[i,8].map {|off| "%3d," % off.to_s }.join('')
- if i+8 < offsets.length
- code << " "
- code << offsets[i+8,8].map {|off| "%3d," % off.to_s }.join('')
- end
- code << "\n"
- }
- code
- end
-
- UsedName = {}
-
- StrMemo = {}
-
- def str_name(bytes)
- size = @bytes_code.length
- rawbytes = [bytes].pack("H*")
-
- n = nil
- if !n && !(suf = rawbytes.gsub(/[^A-Za-z0-9_]/, '')).empty? && !UsedName[nn = "str1_" + suf] then n = nn end
- if !n && !UsedName[nn = "str1_" + bytes] then n = nn end
- n ||= "str1s_#{size}"
-
- StrMemo[bytes] = n
- UsedName[n] = true
- n
- end
-
- def gen_str(bytes)
- if n = StrMemo[bytes]
- n
- else
- len = bytes.length/2
- size = @bytes_code.length
- n = str_name(bytes)
- @bytes_code.insert_at_last(1 + len,
- "\#define #{n} makeSTR1(#{size})\n" +
- " makeSTR1LEN(#{len})," + bytes.gsub(/../, ' 0x\&,') + "\n\n")
- n
- end
- end
-
- def generate_info(info)
- case info
- when :nomap, :nomap0
- # :nomap0 is low priority. it never collides.
- "NOMAP"
- when :undef
- "UNDEF"
- when :invalid
- "INVALID"
- when :func_ii
- "FUNii"
- when :func_si
- "FUNsi"
- when :func_io
- "FUNio"
- when :func_so
- "FUNso"
- when /\A([0-9a-f][0-9a-f])\z/i
- "o1(0x#$1)"
- when /\A([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])\z/i
- "o2(0x#$1,0x#$2)"
- when /\A([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])\z/i
- "o3(0x#$1,0x#$2,0x#$3)"
- when /\A([0-9a-f][0-9a-f])(3[0-9])([0-9a-f][0-9a-f])(3[0-9])\z/i
- "g4(0x#$1,0x#$2,0x#$3,0x#$4)"
- when /\A(f[0-7])([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])\z/i
- "o4(0x#$1,0x#$2,0x#$3,0x#$4)"
- when /\A([0-9a-f][0-9a-f]){4,259}\z/i
- gen_str(info.upcase)
- when /\A\/\*BYTE_LOOKUP\*\// # pointer to BYTE_LOOKUP structure
- $'.to_s
- else
- raise "unexpected action: #{info.inspect}"
- end
- end
-
- def format_infos(infos)
- infos = infos.map {|info| generate_info(info) }
- maxlen = infos.map {|info| info.length }.max
- columns = maxlen <= 16 ? 4 : 2
- code = ""
- 0.step(infos.length-1, columns) {|i|
- code << " "
- is = infos[i,columns]
- is.each {|info|
- code << sprintf(" %#{maxlen}s,", info)
- }
- code << "\n"
- }
- code
- end
-
- def generate_lookup_node(bytes_code, words_code, name, table)
- offsets = []
- infos = []
- infomap = {}
- min = max = nil
- table.each_with_index {|action, byte|
- action ||= :invalid
- if action != :invalid
- min = byte if !min
- max = byte
- end
- unless o = infomap[action]
- infomap[action] = o = infos.length
- infos[o] = action
- end
- offsets[byte] = o
- }
- if !min
- min = max = 0
- end
-
- offsets_key = [min, max, offsets[min..max]]
- if n = OffsetsMemo[offsets_key]
- offsets_name = n
- else
- offsets_name = "#{name}_offsets"
- OffsetsMemo[offsets_key] = offsets_name
- size = bytes_code.length
- bytes_code.insert_at_last(2+max-min+1,
- "\#define #{offsets_name} #{size}\n" +
- format_offsets(min,max,offsets) + "\n")
- end
-
- if n = InfosMemo[infos]
- infos_name = n
- else
- infos_name = "#{name}_infos"
- InfosMemo[infos] = infos_name
-
- size = words_code.length
- words_code.insert_at_last(infos.length,
- "\#define #{infos_name} WORDINDEX2INFO(#{size})\n" +
- format_infos(infos) + "\n")
- end
-
- size = words_code.length
- words_code.insert_at_last(NUM_ELEM_BYTELOOKUP,
- "\#define #{name} WORDINDEX2INFO(#{size})\n" +
- <<"End" + "\n")
- #{offsets_name},
- #{infos_name},
-End
- end
-
- PreMemo = {}
- PostMemo = {}
- NextName = "a"
-
- def generate_node(bytes_code, words_code, name_hint=nil, valid_encoding=nil)
- if n = PreMemo[[self,valid_encoding]]
- return n
- end
-
- table = Array.new(0x100, :invalid)
- each_firstbyte(valid_encoding) {|byte, rest, rest_valid_encoding|
- if a = rest.empty_action
- table[byte] = a
- else
- name_hint2 = nil
- name_hint2 = "#{name_hint}_#{'%02X' % byte}" if name_hint
- table[byte] = "/*BYTE_LOOKUP*/" + rest.gennode(bytes_code, words_code, name_hint2, rest_valid_encoding)
- end
- }
-
- if n = PostMemo[table]
- return n
- end
-
- if !name_hint
- name_hint = "fun_" + NextName.dup
- NextName.succ!
- end
-
- PreMemo[[self,valid_encoding]] = PostMemo[table] = name_hint
-
- generate_lookup_node(bytes_code, words_code, name_hint, table)
- name_hint
- end
-
- def gennode(bytes_code, words_code, name_hint=nil, valid_encoding=nil)
- @bytes_code = bytes_code
- @words_code = words_code
- name = generate_node(bytes_code, words_code, name_hint, valid_encoding)
- @bytes_code = nil
- @words_code = nil
- return name
- end
-end
-
-def citrus_mskanji_cstomb(csid, index)
- case csid
- when 0
- index
- when 1
- index + 0x80
- when 2, 3
- row = index >> 8
- raise "invalid byte sequence" if row < 0x21
- if csid == 3
- if row <= 0x2F
- offset = (row == 0x22 || row >= 0x26) ? 0xED : 0xF0
- elsif row >= 0x4D && row <= 0x7E
- offset = 0xCE
- else
- raise "invalid byte sequence"
- end
- else
- raise "invalid byte sequence" if row > 0x97
- offset = (row < 0x5F) ? 0x81 : 0xC1
- end
- col = index & 0xFF
- raise "invalid byte sequence" if (col < 0x21 || col > 0x7E)
-
- row -= 0x21
- col -= 0x21
- if (row & 1) == 0
- col += 0x40
- col += 1 if (col >= 0x7F)
- else
- col += 0x9F;
- end
- row = row / 2 + offset
- (row << 8) | col
- end.to_s(16)
-end
-
-def citrus_euc_cstomb(csid, index)
- case csid
- when 0x0000
- index
- when 0x8080
- index | 0x8080
- when 0x0080
- index | 0x8E80
- when 0x8000
- index | 0x8F8080
- end.to_s(16)
-end
-
-def citrus_cstomb(ces, csid, index)
- case ces
- when 'mskanji'
- citrus_mskanji_cstomb(csid, index)
- when 'euc'
- citrus_euc_cstomb(csid, index)
- end
-end
-
-SUBDIR = %w/APPLE AST BIG5 CNS CP EBCDIC GB GEORGIAN ISO646 ISO-8859 JIS KAZAKH KOI KS MISC TCVN/
-
-
-def citrus_decode_mapsrc(ces, csid, mapsrcs)
- table = []
- mapsrcs.split(',').each do |mapsrc|
- path = [$srcdir]
- mode = nil
- if mapsrc.rindex('UCS', 0)
- mode = :from_ucs
- from = mapsrc[4..-1]
- path << SUBDIR.find{|x| from.rindex(x, 0) }
- else
- mode = :to_ucs
- path << SUBDIR.find{|x| mapsrc.rindex(x, 0) }
- end
- path << mapsrc.gsub(':', '@')
- path = File.join(*path)
- path << ".src"
- path[path.rindex('/')] = '%'
- STDERR.puts 'load mapsrc %s' % path if VERBOSE_MODE
- open(path) do |f|
- f.each_line do |l|
- break if /^BEGIN_MAP/ =~ l
- end
- f.each_line do |l|
- next if /^\s*(?:#|$)/ =~ l
- break if /^END_MAP/ =~ l
- case mode
- when :from_ucs
- case l
- when /0x(\w+)\s*-\s*0x(\w+)\s*=\s*INVALID/
- # Citrus OOB_MODE
- when /(0x\w+)\s*=\s*(0x\w+)/
- table.push << [$1.hex, citrus_cstomb(ces, csid, $2.hex)]
- else
- raise "unknown notation '%s'"% l
- end
- when :to_ucs
- case l
- when /(0x\w+)\s*=\s*(0x\w+)/
- table.push << [citrus_cstomb(ces, csid, $1.hex), $2.hex]
- else
- raise "unknown notation '%s'"% l
- end
- end
- end
- end
- end
- return table
-end
-
-def encode_utf8(map)
- r = []
- map.each {|k, v|
- # integer means UTF-8 encoded sequence.
- k = [k].pack("U").unpack("H*")[0].upcase if Integer === k
- v = [v].pack("U").unpack("H*")[0].upcase if Integer === v
- r << [k,v]
- }
- r
-end
-
-def transcode_compile_tree(name, from, map)
- map = encode_utf8(map)
- h = {}
- map.each {|k, v|
- h[k] = v unless h[k] # use first mapping
- }
- am = ActionMap.parse(h)
-
- max_input = am.max_input_length
-
- if ValidEncoding[from]
- valid_encoding = StrSet.parse(ValidEncoding[from])
- else
- valid_encoding = nil
- end
-
- defined_name = am.gennode(TRANSCODE_GENERATED_BYTES_CODE, TRANSCODE_GENERATED_WORDS_CODE, name, valid_encoding)
- return defined_name, max_input
-end
-
-TRANSCODERS = []
-TRANSCODE_GENERATED_TRANSCODER_CODE = ''
-
-def transcode_tbl_only(from, to, map)
- if VERBOSE_MODE
- if from.empty? || to.empty?
- STDERR.puts "converter for #{from.empty? ? to : from}"
- else
- STDERR.puts "converter from #{from} to #{to}"
- end
- end
- id_from = from.tr('^0-9A-Za-z', '_')
- id_to = to.tr('^0-9A-Za-z', '_')
- if from == "UTF-8"
- tree_name = "to_#{id_to}"
- elsif to == "UTF-8"
- tree_name = "from_#{id_from}"
- else
- tree_name = "from_#{id_from}_to_#{id_to}"
- end
- map = encode_utf8(map)
- real_tree_name, max_input = transcode_compile_tree(tree_name, from, map)
- return map, tree_name, real_tree_name, max_input
-end
-
-def transcode_tblgen(from, to, map)
- map, tree_name, real_tree_name, max_input = transcode_tbl_only(from, to, map)
- transcoder_name = "rb_#{tree_name}"
- TRANSCODERS << transcoder_name
- input_unit_length = UnitLength[from]
- max_output = map.map {|k,v| String === v ? v.length/2 : 1 }.max
- transcoder_code = <<"End"
-static const rb_transcoder
-#{transcoder_name} = {
- #{c_esc from}, #{c_esc to}, #{real_tree_name},
- TRANSCODE_TABLE_INFO,
- #{input_unit_length}, /* input_unit_length */
- #{max_input}, /* max_input */
- #{max_output}, /* max_output */
- asciicompat_converter, /* asciicompat_type */
- 0, NULL, NULL, /* state_size, state_init, state_fini */
- NULL, NULL, NULL, NULL,
- NULL, NULL, NULL
-};
-End
- TRANSCODE_GENERATED_TRANSCODER_CODE << transcoder_code
- ''
-end
-
-def transcode_generate_node(am, name_hint=nil)
- STDERR.puts "converter for #{name_hint}" if VERBOSE_MODE
- name = am.gennode(TRANSCODE_GENERATED_BYTES_CODE, TRANSCODE_GENERATED_WORDS_CODE, name_hint)
- ''
-end
-
-def transcode_generated_code
- TRANSCODE_GENERATED_BYTES_CODE.to_s +
- TRANSCODE_GENERATED_WORDS_CODE.to_s +
- "\#define TRANSCODE_TABLE_INFO " +
- "#{OUTPUT_PREFIX}byte_array, #{TRANSCODE_GENERATED_BYTES_CODE.length}, " +
- "#{OUTPUT_PREFIX}word_array, #{TRANSCODE_GENERATED_WORDS_CODE.length}, " +
- "sizeof(unsigned int)\n" +
- TRANSCODE_GENERATED_TRANSCODER_CODE
-end
-
-def transcode_register_code
- code = ''
- TRANSCODERS.each {|transcoder_name|
- code << " rb_register_transcoder(&#{transcoder_name});\n"
- }
- code
-end
-
-UnitLength = {
- 'UTF-16BE' => 2,
- 'UTF-16LE' => 2,
- 'UTF-32BE' => 4,
- 'UTF-32LE' => 4,
-}
-UnitLength.default = 1
-
-ValidEncoding = {
- '1byte' => '{00-ff}',
- '2byte' => '{00-ff}{00-ff}',
- '4byte' => '{00-ff}{00-ff}{00-ff}{00-ff}',
- 'US-ASCII' => '{00-7f}',
- 'UTF-8' => '{00-7f}
- {c2-df}{80-bf}
- e0{a0-bf}{80-bf}
- {e1-ec}{80-bf}{80-bf}
- ed{80-9f}{80-bf}
- {ee-ef}{80-bf}{80-bf}
- f0{90-bf}{80-bf}{80-bf}
- {f1-f3}{80-bf}{80-bf}{80-bf}
- f4{80-8f}{80-bf}{80-bf}',
- 'UTF-16BE' => '{00-d7,e0-ff}{00-ff}
- {d8-db}{00-ff}{dc-df}{00-ff}',
- 'UTF-16LE' => '{00-ff}{00-d7,e0-ff}
- {00-ff}{d8-db}{00-ff}{dc-df}',
- 'UTF-32BE' => '0000{00-d7,e0-ff}{00-ff}
- 00{01-10}{00-ff}{00-ff}',
- 'UTF-32LE' => '{00-ff}{00-d7,e0-ff}0000
- {00-ff}{00-ff}{01-10}00',
- 'EUC-JP' => '{00-7f}
- {a1-fe}{a1-fe}
- 8e{a1-fe}
- 8f{a1-fe}{a1-fe}',
- 'CP51932' => '{00-7f}
- {a1-fe}{a1-fe}
- 8e{a1-fe}',
- 'Shift_JIS' => '{00-7f}
- {81-9f,e0-fc}{40-7e,80-fc}
- {a1-df}',
- 'EUC-KR' => '{00-7f}
- {a1-fe}{a1-fe}',
- 'CP949' => '{00-7f}
- {81-fe}{41-5a,61-7a,81-fe}',
- 'Big5' => '{00-7f}
- {81-fe}{40-7e,a1-fe}',
- 'EUC-TW' => '{00-7f}
- {a1-fe}{a1-fe}
- 8e{a1-b0}{a1-fe}{a1-fe}',
- 'GBK' => '{00-80}
- {81-fe}{40-7e,80-fe}',
- 'GB18030' => '{00-7f}
- {81-fe}{40-7e,80-fe}
- {81-fe}{30-39}{81-fe}{30-39}',
-}
-
-def set_valid_byte_pattern (encoding, pattern_or_label)
- pattern =
- if ValidEncoding[pattern_or_label]
- ValidEncoding[pattern_or_label]
- else
- pattern_or_label
- end
- if ValidEncoding[encoding] and ValidEncoding[encoding]!=pattern
- raise ArgumentError, "trying to change valid byte pattern for encoding #{encoding} from #{ValidEncoding[encoding]} to #{pattern}"
- end
- ValidEncoding[encoding] = pattern
-end
-
-# the following may be used in different places, so keep them here for the moment
-set_valid_byte_pattern 'ASCII-8BIT', '1byte'
-set_valid_byte_pattern 'Windows-31J', 'Shift_JIS'
-set_valid_byte_pattern 'eucJP-ms', 'EUC-JP'
-
-def make_signature(filename, src)
- "src=#{filename.dump}, len=#{src.length}, checksum=#{src.sum}"
-end
-
-output_filename = nil
-verbose_mode = false
-force_mode = false
-
-op = OptionParser.new
-op.def_option("--help", "show help message") { puts op; exit 0 }
-op.def_option("--verbose", "verbose mode") { verbose_mode = true }
-op.def_option("--force", "force table generation") { force_mode = true }
-op.def_option("--output=FILE", "specify output file") {|arg| output_filename = arg }
-op.parse!
-
-VERBOSE_MODE = verbose_mode
-
-OUTPUT_FILENAME = output_filename
-OUTPUT_PREFIX = output_filename ? File.basename(output_filename)[/\A[A-Za-z0-9_]*/] : ""
-OUTPUT_PREFIX.sub!(/\A_+/, '')
-OUTPUT_PREFIX.sub!(/_*\z/, '_')
-
-TRANSCODE_GENERATED_BYTES_CODE = ArrayCode.new("unsigned char", "#{OUTPUT_PREFIX}byte_array")
-TRANSCODE_GENERATED_WORDS_CODE = ArrayCode.new("unsigned int", "#{OUTPUT_PREFIX}word_array")
-
-arg = ARGV.shift
-$srcdir = File.dirname(arg)
-$:.unshift $srcdir unless $:.include? $srcdir
-src = File.read(arg)
-src.force_encoding("ascii-8bit") if src.respond_to? :force_encoding
-this_script = File.read(__FILE__)
-this_script.force_encoding("ascii-8bit") if this_script.respond_to? :force_encoding
-
-base_signature = "/* autogenerated. */\n"
-base_signature << "/* #{make_signature(File.basename(__FILE__), this_script)} */\n"
-base_signature << "/* #{make_signature(File.basename(arg), src)} */\n"
-
-if !force_mode && output_filename && File.readable?(output_filename)
- old_signature = File.open(output_filename) {|f| f.gets("").chomp }
- chk_signature = base_signature.dup
- old_signature.each_line {|line|
- if %r{/\* src="([0-9a-z_.-]+)",} =~ line
- name = $1
- next if name == File.basename(arg) || name == File.basename(__FILE__)
- path = File.join($srcdir, name)
- if File.readable? path
- chk_signature << "/* #{make_signature(name, File.read(path))} */\n"
- end
- end
- }
- if old_signature == chk_signature
- now = Time.now
- File.utime(now, now, output_filename)
- STDERR.puts "already up-to-date: #{output_filename}" if VERBOSE_MODE
- exit
- end
-end
-
-if VERBOSE_MODE
- if output_filename
- STDERR.puts "generating #{output_filename} ..."
- end
-end
-
-libs1 = $".dup
-erb = ERB.new(src, nil, '%')
-erb.filename = arg
-erb_result = erb.result(binding)
-libs2 = $".dup
-
-libs = libs2 - libs1
-lib_sigs = ''
-libs.each {|lib|
- lib = File.basename(lib)
- path = File.join($srcdir, lib)
- if File.readable? path
- lib_sigs << "/* #{make_signature(lib, File.read(path))} */\n"
- end
-}
-
-result = ''
-result << base_signature
-result << lib_sigs
-result << "\n"
-result << erb_result
-result << "\n"
-
-if output_filename
- new_filename = output_filename + ".new"
- FileUtils.mkdir_p(File.dirname(output_filename))
- File.open(new_filename, "wb") {|f| f << result }
- File.rename(new_filename, output_filename)
- STDERR.puts "done." if VERBOSE_MODE
-else
- print result
-end
diff --git a/tool/vtlh.rb b/tool/vtlh.rb
deleted file mode 100755
index fcd3630821..0000000000
--- a/tool/vtlh.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# ARGF = open('ha')
-cd = `pwd`.chomp + '/'
-ARGF.each{|line|
- if /^0x([a-z0-9]+),/ =~ line
- stat = line.split(',')
- addr = stat[0].hex + 0x00400000
- retired = stat[2].to_i
- ticks = stat[3].to_i
-
- src = `addr2line -e miniruby.exe #{addr.to_s(16)}`.chomp
- src.sub!(cd, '')
- puts '%-40s 0x%08x %8d %8d' % [src, addr, retired, ticks]
- end
-}
-
diff --git a/tool/ytab.sed b/tool/ytab.sed
deleted file mode 100755
index f956c065e2..0000000000
--- a/tool/ytab.sed
+++ /dev/null
@@ -1,31 +0,0 @@
-#!/bin/sed -f
-/^int yydebug;/{
-i\
-#ifndef yydebug
-a\
-#endif
-}
-/^yydestruct.*yymsg/,/#endif/{
- /^yydestruct/{
- /parser/!{
- h
- s/^/ruby_parser_&/
- s/)$/, parser)/
- /\*/s/parser)$/struct parser_params *&/
- }
- }
- /^#endif/{
- x
- /^./{
- i\
- struct parser_params *parser;
- a\
-#define yydestruct(m, t, v) ruby_parser_yydestruct(m, t, v, parser)
- }
- x
- }
-}
-s/^\([ ]*\)\(yyerror[ ]*([ ]*parser,\)/\1parser_\2/
-s!^ *extern char \*getenv();!/* & */!
-s/^\(#.*\)".*\.tab\.c"/\1"parse.c"/
-/^\(#.*\)".*\.y"/s:\\\\:/:g
diff --git a/transcode.c b/transcode.c
deleted file mode 100644
index ee6794d9be..0000000000
--- a/transcode.c
+++ /dev/null
@@ -1,4211 +0,0 @@
-/**********************************************************************
-
- transcode.c -
-
- $Author$
- created at: Tue Oct 30 16:10:22 JST 2007
-
- Copyright (C) 2007 Martin Duerst
-
-**********************************************************************/
-
-#include "ruby/ruby.h"
-#include "ruby/encoding.h"
-#include "transcode_data.h"
-#include <ctype.h>
-
-/* VALUE rb_cEncoding = rb_define_class("Encoding", rb_cObject); */
-VALUE rb_eUndefinedConversionError;
-VALUE rb_eInvalidByteSequenceError;
-VALUE rb_eConverterNotFoundError;
-
-VALUE rb_cEncodingConverter;
-
-static VALUE sym_invalid, sym_undef, sym_replace;
-static VALUE sym_xml, sym_text, sym_attr;
-static VALUE sym_universal_newline;
-static VALUE sym_crlf_newline;
-static VALUE sym_cr_newline;
-static VALUE sym_partial_input;
-
-static VALUE sym_invalid_byte_sequence;
-static VALUE sym_undefined_conversion;
-static VALUE sym_destination_buffer_full;
-static VALUE sym_source_buffer_empty;
-static VALUE sym_finished;
-static VALUE sym_after_output;
-static VALUE sym_incomplete_input;
-
-static unsigned char *
-allocate_converted_string(const char *sname, const char *dname,
- const unsigned char *str, size_t len,
- unsigned char *caller_dst_buf, size_t caller_dst_bufsize,
- size_t *dst_len_ptr);
-
-/* dynamic structure, one per conversion (similar to iconv_t) */
-/* may carry conversion state (e.g. for iso-2022-jp) */
-typedef struct rb_transcoding {
- const rb_transcoder *transcoder;
-
- int flags;
-
- int resume_position;
- unsigned int next_table;
- VALUE next_info;
- unsigned char next_byte;
- unsigned int output_index;
-
- int recognized_len; /* already interpreted */
- int readagain_len; /* not yet interpreted */
- union {
- unsigned char ary[8]; /* max_input <= sizeof(ary) */
- unsigned char *ptr; /* length: max_input */
- } readbuf; /* recognized_len + readagain_len used */
-
- int writebuf_off;
- int writebuf_len;
- union {
- unsigned char ary[8]; /* max_output <= sizeof(ary) */
- unsigned char *ptr; /* length: max_output */
- } writebuf;
-
- union rb_transcoding_state_t { /* opaque data for stateful encoding */
- void *ptr;
- char ary[sizeof(double) > sizeof(void*) ? sizeof(double) : sizeof(void*)];
- double dummy_for_alignment;
- } state;
-} rb_transcoding;
-#define TRANSCODING_READBUF(tc) \
- ((tc)->transcoder->max_input <= sizeof((tc)->readbuf.ary) ? \
- (tc)->readbuf.ary : \
- (tc)->readbuf.ptr)
-#define TRANSCODING_WRITEBUF(tc) \
- ((tc)->transcoder->max_output <= sizeof((tc)->writebuf.ary) ? \
- (tc)->writebuf.ary : \
- (tc)->writebuf.ptr)
-#define TRANSCODING_WRITEBUF_SIZE(tc) \
- ((tc)->transcoder->max_output <= sizeof((tc)->writebuf.ary) ? \
- sizeof((tc)->writebuf.ary) : \
- (size_t)(tc)->transcoder->max_output)
-#define TRANSCODING_STATE_EMBED_MAX sizeof(union rb_transcoding_state_t)
-#define TRANSCODING_STATE(tc) \
- ((tc)->transcoder->state_size <= sizeof((tc)->state) ? \
- (tc)->state.ary : \
- (tc)->state.ptr)
-
-typedef struct {
- struct rb_transcoding *tc;
- unsigned char *out_buf_start;
- unsigned char *out_data_start;
- unsigned char *out_data_end;
- unsigned char *out_buf_end;
- rb_econv_result_t last_result;
-} rb_econv_elem_t;
-
-struct rb_econv_t {
- int flags;
- const char *source_encoding_name;
- const char *destination_encoding_name;
-
- int started;
-
- const unsigned char *replacement_str;
- size_t replacement_len;
- const char *replacement_enc;
- int replacement_allocated;
-
- unsigned char *in_buf_start;
- unsigned char *in_data_start;
- unsigned char *in_data_end;
- unsigned char *in_buf_end;
- rb_econv_elem_t *elems;
- int num_allocated;
- int num_trans;
- int num_finished;
- struct rb_transcoding *last_tc;
-
- /* last error */
- struct {
- rb_econv_result_t result;
- struct rb_transcoding *error_tc;
- const char *source_encoding;
- const char *destination_encoding;
- const unsigned char *error_bytes_start;
- size_t error_bytes_len;
- size_t readagain_len;
- } last_error;
-
- /* The following fields are only for Encoding::Converter.
- * rb_econv_open set them NULL. */
- rb_encoding *source_encoding;
- rb_encoding *destination_encoding;
-};
-
-/*
- * Dispatch data and logic
- */
-
-#define DECORATOR_P(sname, dname) (*(sname) == '\0')
-
-typedef struct {
- const char *sname;
- const char *dname;
- const char *lib; /* null means means no need to load a library */
- const rb_transcoder *transcoder;
-} transcoder_entry_t;
-
-static st_table *transcoder_table;
-
-static transcoder_entry_t *
-make_transcoder_entry(const char *sname, const char *dname)
-{
- st_data_t val;
- st_table *table2;
-
- if (!st_lookup(transcoder_table, (st_data_t)sname, &val)) {
- val = (st_data_t)st_init_strcasetable();
- st_add_direct(transcoder_table, (st_data_t)sname, val);
- }
- table2 = (st_table *)val;
- if (!st_lookup(table2, (st_data_t)dname, &val)) {
- transcoder_entry_t *entry = ALLOC(transcoder_entry_t);
- entry->sname = sname;
- entry->dname = dname;
- entry->lib = NULL;
- entry->transcoder = NULL;
- val = (st_data_t)entry;
- st_add_direct(table2, (st_data_t)dname, val);
- }
- return (transcoder_entry_t *)val;
-}
-
-static transcoder_entry_t *
-get_transcoder_entry(const char *sname, const char *dname)
-{
- st_data_t val;
- st_table *table2;
-
- if (!st_lookup(transcoder_table, (st_data_t)sname, &val)) {
- return NULL;
- }
- table2 = (st_table *)val;
- if (!st_lookup(table2, (st_data_t)dname, &val)) {
- return NULL;
- }
- return (transcoder_entry_t *)val;
-}
-
-void
-rb_register_transcoder(const rb_transcoder *tr)
-{
- const char *const sname = tr->src_encoding;
- const char *const dname = tr->dst_encoding;
-
- transcoder_entry_t *entry;
-
- entry = make_transcoder_entry(sname, dname);
- if (entry->transcoder) {
- rb_raise(rb_eArgError, "transcoder from %s to %s has been already registered",
- sname, dname);
- }
-
- entry->transcoder = tr;
-}
-
-static void
-declare_transcoder(const char *sname, const char *dname, const char *lib)
-{
- transcoder_entry_t *entry;
-
- entry = make_transcoder_entry(sname, dname);
- entry->lib = lib;
-}
-
-#define MAX_TRANSCODER_LIBNAME_LEN 64
-static const char transcoder_lib_prefix[] = "enc/trans/";
-
-void
-rb_declare_transcoder(const char *enc1, const char *enc2, const char *lib)
-{
- if (!lib || strlen(lib) > MAX_TRANSCODER_LIBNAME_LEN) {
- rb_raise(rb_eArgError, "invalid library name - %s",
- lib ? lib : "(null)");
- }
- declare_transcoder(enc1, enc2, lib);
-}
-
-#define encoding_equal(enc1, enc2) (STRCASECMP(enc1, enc2) == 0)
-
-typedef struct search_path_queue_tag {
- struct search_path_queue_tag *next;
- const char *enc;
-} search_path_queue_t;
-
-typedef struct {
- st_table *visited;
- search_path_queue_t *queue;
- search_path_queue_t **queue_last_ptr;
- const char *base_enc;
-} search_path_bfs_t;
-
-static int
-transcode_search_path_i(st_data_t key, st_data_t val, st_data_t arg)
-{
- const char *dname = (const char *)key;
- search_path_bfs_t *bfs = (search_path_bfs_t *)arg;
- search_path_queue_t *q;
-
- if (st_lookup(bfs->visited, (st_data_t)dname, &val)) {
- return ST_CONTINUE;
- }
-
- q = ALLOC(search_path_queue_t);
- q->enc = dname;
- q->next = NULL;
- *bfs->queue_last_ptr = q;
- bfs->queue_last_ptr = &q->next;
-
- st_add_direct(bfs->visited, (st_data_t)dname, (st_data_t)bfs->base_enc);
- return ST_CONTINUE;
-}
-
-static int
-transcode_search_path(const char *sname, const char *dname,
- void (*callback)(const char *sname, const char *dname, int depth, void *arg),
- void *arg)
-{
- search_path_bfs_t bfs;
- search_path_queue_t *q;
- st_data_t val;
- st_table *table2;
- int found;
- int pathlen = -1;
-
- if (encoding_equal(sname, dname))
- return -1;
-
- q = ALLOC(search_path_queue_t);
- q->enc = sname;
- q->next = NULL;
- bfs.queue_last_ptr = &q->next;
- bfs.queue = q;
-
- bfs.visited = st_init_strcasetable();
- st_add_direct(bfs.visited, (st_data_t)sname, (st_data_t)NULL);
-
- while (bfs.queue) {
- q = bfs.queue;
- bfs.queue = q->next;
- if (!bfs.queue)
- bfs.queue_last_ptr = &bfs.queue;
-
- if (!st_lookup(transcoder_table, (st_data_t)q->enc, &val)) {
- xfree(q);
- continue;
- }
- table2 = (st_table *)val;
-
- if (st_lookup(table2, (st_data_t)dname, &val)) {
- st_add_direct(bfs.visited, (st_data_t)dname, (st_data_t)q->enc);
- xfree(q);
- found = 1;
- goto cleanup;
- }
-
- bfs.base_enc = q->enc;
- st_foreach(table2, transcode_search_path_i, (st_data_t)&bfs);
- bfs.base_enc = NULL;
-
- xfree(q);
- }
- found = 0;
-
- cleanup:
- while (bfs.queue) {
- q = bfs.queue;
- bfs.queue = q->next;
- xfree(q);
- }
-
- if (found) {
- const char *enc = dname;
- int depth;
- pathlen = 0;
- while (1) {
- st_lookup(bfs.visited, (st_data_t)enc, &val);
- if (!val)
- break;
- pathlen++;
- enc = (const char *)val;
- }
- depth = pathlen;
- enc = dname;
- while (1) {
- st_lookup(bfs.visited, (st_data_t)enc, &val);
- if (!val)
- break;
- callback((const char *)val, enc, --depth, arg);
- enc = (const char *)val;
- }
- }
-
- st_free_table(bfs.visited);
-
- return pathlen; /* is -1 if not found */
-}
-
-static const rb_transcoder *
-load_transcoder_entry(transcoder_entry_t *entry)
-{
- if (entry->transcoder)
- return entry->transcoder;
-
- if (entry->lib) {
- const char *lib = entry->lib;
- int len = strlen(lib);
- char path[sizeof(transcoder_lib_prefix) + MAX_TRANSCODER_LIBNAME_LEN];
-
- entry->lib = NULL;
-
- if (len > MAX_TRANSCODER_LIBNAME_LEN)
- return NULL;
- memcpy(path, transcoder_lib_prefix, sizeof(transcoder_lib_prefix) - 1);
- memcpy(path + sizeof(transcoder_lib_prefix) - 1, lib, len + 1);
- if (!rb_require(path))
- return NULL;
- }
-
- if (entry->transcoder)
- return entry->transcoder;
-
- return NULL;
-}
-
-static const char*
-get_replacement_character(const char *encname, size_t *len_ret, const char **repl_encname_ptr)
-{
- if (encoding_equal(encname, "UTF-8")) {
- *len_ret = 3;
- *repl_encname_ptr = "UTF-8";
- return "\xEF\xBF\xBD";
- }
- else {
- *len_ret = 1;
- *repl_encname_ptr = "US-ASCII";
- return "?";
- }
-}
-
-/*
- * Transcoding engine logic
- */
-
-static const unsigned char *
-transcode_char_start(rb_transcoding *tc,
- const unsigned char *in_start,
- const unsigned char *inchar_start,
- const unsigned char *in_p,
- size_t *char_len_ptr)
-{
- const unsigned char *ptr;
- if (inchar_start - in_start < tc->recognized_len) {
- MEMCPY(TRANSCODING_READBUF(tc) + tc->recognized_len,
- inchar_start, unsigned char, in_p - inchar_start);
- ptr = TRANSCODING_READBUF(tc);
- }
- else {
- ptr = inchar_start - tc->recognized_len;
- }
- *char_len_ptr = tc->recognized_len + (in_p - inchar_start);
- return ptr;
-}
-
-static rb_econv_result_t
-transcode_restartable0(const unsigned char **in_pos, unsigned char **out_pos,
- const unsigned char *in_stop, unsigned char *out_stop,
- rb_transcoding *tc,
- const int opt)
-{
- const rb_transcoder *tr = tc->transcoder;
- int unitlen = tr->input_unit_length;
- int readagain_len = 0;
-
- const unsigned char *inchar_start;
- const unsigned char *in_p;
-
- unsigned char *out_p;
-
- in_p = inchar_start = *in_pos;
-
- out_p = *out_pos;
-
-#define SUSPEND(ret, num) \
- do { \
- tc->resume_position = (num); \
- if (0 < in_p - inchar_start) \
- MEMMOVE(TRANSCODING_READBUF(tc)+tc->recognized_len, \
- inchar_start, unsigned char, in_p - inchar_start); \
- *in_pos = in_p; \
- *out_pos = out_p; \
- tc->recognized_len += in_p - inchar_start; \
- if (readagain_len) { \
- tc->recognized_len -= readagain_len; \
- tc->readagain_len = readagain_len; \
- } \
- return ret; \
- resume_label ## num:; \
- } while (0)
-#define SUSPEND_OBUF(num) \
- do { \
- while (out_stop - out_p < 1) { SUSPEND(econv_destination_buffer_full, num); } \
- } while (0)
-
-#define SUSPEND_AFTER_OUTPUT(num) \
- if ((opt & ECONV_AFTER_OUTPUT) && *out_pos != out_p) { \
- SUSPEND(econv_after_output, num); \
- }
-
-#define next_table (tc->next_table)
-#define next_info (tc->next_info)
-#define next_byte (tc->next_byte)
-#define writebuf_len (tc->writebuf_len)
-#define writebuf_off (tc->writebuf_off)
-
- switch (tc->resume_position) {
- case 0: break;
- case 1: goto resume_label1;
- case 2: goto resume_label2;
- case 3: goto resume_label3;
- case 4: goto resume_label4;
- case 5: goto resume_label5;
- case 6: goto resume_label6;
- case 7: goto resume_label7;
- case 8: goto resume_label8;
- case 9: goto resume_label9;
- case 10: goto resume_label10;
- case 11: goto resume_label11;
- case 12: goto resume_label12;
- case 13: goto resume_label13;
- case 14: goto resume_label14;
- case 15: goto resume_label15;
- case 16: goto resume_label16;
- case 17: goto resume_label17;
- case 18: goto resume_label18;
- case 19: goto resume_label19;
- case 20: goto resume_label20;
- case 21: goto resume_label21;
- case 22: goto resume_label22;
- case 23: goto resume_label23;
- case 24: goto resume_label24;
- case 25: goto resume_label25;
- case 26: goto resume_label26;
- case 27: goto resume_label27;
- case 28: goto resume_label28;
- case 29: goto resume_label29;
- case 30: goto resume_label30;
- case 31: goto resume_label31;
- case 32: goto resume_label32;
- }
-
- while (1) {
- inchar_start = in_p;
- tc->recognized_len = 0;
- next_table = tr->conv_tree_start;
-
- SUSPEND_AFTER_OUTPUT(24);
-
- if (in_stop <= in_p) {
- if (!(opt & ECONV_PARTIAL_INPUT))
- break;
- SUSPEND(econv_source_buffer_empty, 7);
- continue;
- }
-
-#define BYTE_ADDR(index) (tr->byte_array + (index))
-#define WORD_ADDR(index) (tr->word_array + INFO2WORDINDEX(index))
-#define BL_BASE BYTE_ADDR(BYTE_LOOKUP_BASE(WORD_ADDR(next_table)))
-#define BL_INFO WORD_ADDR(BYTE_LOOKUP_INFO(WORD_ADDR(next_table)))
-#define BL_MIN_BYTE (BL_BASE[0])
-#define BL_MAX_BYTE (BL_BASE[1])
-#define BL_OFFSET(byte) (BL_BASE[2+(byte)-BL_MIN_BYTE])
-#define BL_ACTION(byte) (BL_INFO[BL_OFFSET((byte))])
-
- next_byte = (unsigned char)*in_p++;
- follow_byte:
- if (next_byte < BL_MIN_BYTE || BL_MAX_BYTE < next_byte)
- next_info = INVALID;
- else {
- next_info = (VALUE)BL_ACTION(next_byte);
- }
- follow_info:
- switch (next_info & 0x1F) {
- case NOMAP:
- {
- const unsigned char *p = inchar_start;
- writebuf_off = 0;
- while (p < in_p) {
- TRANSCODING_WRITEBUF(tc)[writebuf_off++] = (unsigned char)*p++;
- }
- writebuf_len = writebuf_off;
- writebuf_off = 0;
- while (writebuf_off < writebuf_len) {
- SUSPEND_OBUF(3);
- *out_p++ = TRANSCODING_WRITEBUF(tc)[writebuf_off++];
- }
- }
- continue;
- case 0x00: case 0x04: case 0x08: case 0x0C:
- case 0x10: case 0x14: case 0x18: case 0x1C:
- SUSPEND_AFTER_OUTPUT(25);
- while (in_p >= in_stop) {
- if (!(opt & ECONV_PARTIAL_INPUT))
- goto incomplete;
- SUSPEND(econv_source_buffer_empty, 5);
- }
- next_byte = (unsigned char)*in_p++;
- next_table = next_info;
- goto follow_byte;
- case ZERObt: /* drop input */
- continue;
- case ONEbt:
- SUSPEND_OBUF(9); *out_p++ = getBT1(next_info);
- continue;
- case TWObt:
- SUSPEND_OBUF(10); *out_p++ = getBT1(next_info);
- SUSPEND_OBUF(21); *out_p++ = getBT2(next_info);
- continue;
- case THREEbt:
- SUSPEND_OBUF(11); *out_p++ = getBT1(next_info);
- SUSPEND_OBUF(15); *out_p++ = getBT2(next_info);
- SUSPEND_OBUF(16); *out_p++ = getBT3(next_info);
- continue;
- case FOURbt:
- SUSPEND_OBUF(12); *out_p++ = getBT0(next_info);
- SUSPEND_OBUF(17); *out_p++ = getBT1(next_info);
- SUSPEND_OBUF(18); *out_p++ = getBT2(next_info);
- SUSPEND_OBUF(19); *out_p++ = getBT3(next_info);
- continue;
- case GB4bt:
- SUSPEND_OBUF(29); *out_p++ = getGB4bt0(next_info);
- SUSPEND_OBUF(30); *out_p++ = getGB4bt1(next_info);
- SUSPEND_OBUF(31); *out_p++ = getGB4bt2(next_info);
- SUSPEND_OBUF(32); *out_p++ = getGB4bt3(next_info);
- continue;
- case STR1:
- tc->output_index = 0;
- while (tc->output_index < STR1_LENGTH(BYTE_ADDR(STR1_BYTEINDEX(next_info)))) {
- SUSPEND_OBUF(28); *out_p++ = BYTE_ADDR(STR1_BYTEINDEX(next_info))[1+tc->output_index];
- tc->output_index++;
- }
- continue;
- case FUNii:
- next_info = (VALUE)(*tr->func_ii)(TRANSCODING_STATE(tc), next_info);
- goto follow_info;
- case FUNsi:
- {
- const unsigned char *char_start;
- size_t char_len;
- char_start = transcode_char_start(tc, *in_pos, inchar_start, in_p, &char_len);
- next_info = (VALUE)(*tr->func_si)(TRANSCODING_STATE(tc), char_start, (size_t)char_len);
- goto follow_info;
- }
- case FUNio:
- SUSPEND_OBUF(13);
- if (tr->max_output <= out_stop - out_p)
- out_p += tr->func_io(TRANSCODING_STATE(tc),
- next_info, out_p, out_stop - out_p);
- else {
- writebuf_len = tr->func_io(TRANSCODING_STATE(tc),
- next_info,
- TRANSCODING_WRITEBUF(tc), TRANSCODING_WRITEBUF_SIZE(tc));
- writebuf_off = 0;
- while (writebuf_off < writebuf_len) {
- SUSPEND_OBUF(20);
- *out_p++ = TRANSCODING_WRITEBUF(tc)[writebuf_off++];
- }
- }
- break;
- case FUNso:
- {
- const unsigned char *char_start;
- size_t char_len;
- SUSPEND_OBUF(14);
- if (tr->max_output <= out_stop - out_p) {
- char_start = transcode_char_start(tc, *in_pos, inchar_start, in_p, &char_len);
- out_p += tr->func_so(TRANSCODING_STATE(tc),
- char_start, (size_t)char_len,
- out_p, out_stop - out_p);
- }
- else {
- char_start = transcode_char_start(tc, *in_pos, inchar_start, in_p, &char_len);
- writebuf_len = tr->func_so(TRANSCODING_STATE(tc),
- char_start, (size_t)char_len,
- TRANSCODING_WRITEBUF(tc), TRANSCODING_WRITEBUF_SIZE(tc));
- writebuf_off = 0;
- while (writebuf_off < writebuf_len) {
- SUSPEND_OBUF(22);
- *out_p++ = TRANSCODING_WRITEBUF(tc)[writebuf_off++];
- }
- }
- break;
- }
- case INVALID:
- if (tc->recognized_len + (in_p - inchar_start) <= unitlen) {
- if (tc->recognized_len + (in_p - inchar_start) < unitlen)
- SUSPEND_AFTER_OUTPUT(26);
- while ((opt & ECONV_PARTIAL_INPUT) && tc->recognized_len + (in_stop - inchar_start) < unitlen) {
- in_p = in_stop;
- SUSPEND(econv_source_buffer_empty, 8);
- }
- if (tc->recognized_len + (in_stop - inchar_start) <= unitlen) {
- in_p = in_stop;
- }
- else {
- in_p = inchar_start + (unitlen - tc->recognized_len);
- }
- }
- else {
- int invalid_len; /* including the last byte which causes invalid */
- int discard_len;
- invalid_len = tc->recognized_len + (in_p - inchar_start);
- discard_len = ((invalid_len - 1) / unitlen) * unitlen;
- readagain_len = invalid_len - discard_len;
- }
- goto invalid;
- case UNDEF:
- goto undef;
- }
- continue;
-
- invalid:
- SUSPEND(econv_invalid_byte_sequence, 1);
- continue;
-
- incomplete:
- SUSPEND(econv_incomplete_input, 27);
- continue;
-
- undef:
- SUSPEND(econv_undefined_conversion, 2);
- continue;
- }
-
- /* cleanup */
- if (tr->finish_func) {
- SUSPEND_OBUF(4);
- if (tr->max_output <= out_stop - out_p) {
- out_p += tr->finish_func(TRANSCODING_STATE(tc),
- out_p, out_stop - out_p);
- }
- else {
- writebuf_len = tr->finish_func(TRANSCODING_STATE(tc),
- TRANSCODING_WRITEBUF(tc), TRANSCODING_WRITEBUF_SIZE(tc));
- writebuf_off = 0;
- while (writebuf_off < writebuf_len) {
- SUSPEND_OBUF(23);
- *out_p++ = TRANSCODING_WRITEBUF(tc)[writebuf_off++];
- }
- }
- }
- while (1)
- SUSPEND(econv_finished, 6);
-#undef SUSPEND
-#undef next_table
-#undef next_info
-#undef next_byte
-#undef writebuf_len
-#undef writebuf_off
-}
-
-static rb_econv_result_t
-transcode_restartable(const unsigned char **in_pos, unsigned char **out_pos,
- const unsigned char *in_stop, unsigned char *out_stop,
- rb_transcoding *tc,
- const int opt)
-{
- if (tc->readagain_len) {
- unsigned char *readagain_buf = ALLOCA_N(unsigned char, tc->readagain_len);
- const unsigned char *readagain_pos = readagain_buf;
- const unsigned char *readagain_stop = readagain_buf + tc->readagain_len;
- rb_econv_result_t res;
-
- MEMCPY(readagain_buf, TRANSCODING_READBUF(tc) + tc->recognized_len,
- unsigned char, tc->readagain_len);
- tc->readagain_len = 0;
- res = transcode_restartable0(&readagain_pos, out_pos, readagain_stop, out_stop, tc, opt|ECONV_PARTIAL_INPUT);
- if (res != econv_source_buffer_empty) {
- MEMCPY(TRANSCODING_READBUF(tc) + tc->recognized_len + tc->readagain_len,
- readagain_pos, unsigned char, readagain_stop - readagain_pos);
- tc->readagain_len += readagain_stop - readagain_pos;
- return res;
- }
- }
- return transcode_restartable0(in_pos, out_pos, in_stop, out_stop, tc, opt);
-}
-
-static rb_transcoding *
-rb_transcoding_open_by_transcoder(const rb_transcoder *tr, int flags)
-{
- rb_transcoding *tc;
-
- tc = ALLOC(rb_transcoding);
- tc->transcoder = tr;
- tc->flags = flags;
- if (TRANSCODING_STATE_EMBED_MAX < tr->state_size)
- tc->state.ptr = xmalloc(tr->state_size);
- if (tr->state_init_func) {
- (tr->state_init_func)(TRANSCODING_STATE(tc)); /* xxx: check return value */
- }
- tc->resume_position = 0;
- tc->recognized_len = 0;
- tc->readagain_len = 0;
- tc->writebuf_len = 0;
- tc->writebuf_off = 0;
- if (sizeof(tc->readbuf.ary) < tr->max_input) {
- tc->readbuf.ptr = xmalloc(tr->max_input);
- }
- if (sizeof(tc->writebuf.ary) < tr->max_output) {
- tc->writebuf.ptr = xmalloc(tr->max_output);
- }
- return tc;
-}
-
-static rb_econv_result_t
-rb_transcoding_convert(rb_transcoding *tc,
- const unsigned char **input_ptr, const unsigned char *input_stop,
- unsigned char **output_ptr, unsigned char *output_stop,
- int flags)
-{
- return transcode_restartable(
- input_ptr, output_ptr,
- input_stop, output_stop,
- tc, flags);
-}
-
-static void
-rb_transcoding_close(rb_transcoding *tc)
-{
- const rb_transcoder *tr = tc->transcoder;
- if (tr->state_fini_func) {
- (tr->state_fini_func)(TRANSCODING_STATE(tc)); /* check return value? */
- }
- if (TRANSCODING_STATE_EMBED_MAX < tr->state_size)
- xfree(tc->state.ptr);
- if (sizeof(tc->readbuf.ary) < tr->max_input)
- xfree(tc->readbuf.ptr);
- if (sizeof(tc->writebuf.ary) < tr->max_output)
- xfree(tc->writebuf.ptr);
- xfree(tc);
-}
-
-static size_t
-rb_transcoding_memsize(rb_transcoding *tc)
-{
- size_t size = sizeof(rb_transcoding);
- const rb_transcoder *tr = tc->transcoder;
-
- if (TRANSCODING_STATE_EMBED_MAX < tr->state_size) {
- size += tr->state_size;
- }
- if (sizeof(tc->readbuf.ary) < tr->max_input) {
- size += tr->max_input;
- }
- if (sizeof(tc->writebuf.ary) < tr->max_output) {
- size += tr->max_output;
- }
- return size;
-}
-
-static rb_econv_t *
-rb_econv_alloc(int n_hint)
-{
- rb_econv_t *ec;
-
- if (n_hint <= 0)
- n_hint = 1;
-
- ec = ALLOC(rb_econv_t);
- ec->flags = 0;
- ec->source_encoding_name = NULL;
- ec->destination_encoding_name = NULL;
- ec->started = 0;
- ec->replacement_str = NULL;
- ec->replacement_len = 0;
- ec->replacement_enc = NULL;
- ec->replacement_allocated = 0;
- ec->in_buf_start = NULL;
- ec->in_data_start = NULL;
- ec->in_data_end = NULL;
- ec->in_buf_end = NULL;
- ec->num_allocated = n_hint;
- ec->num_trans = 0;
- ec->elems = ALLOC_N(rb_econv_elem_t, ec->num_allocated);
- ec->num_finished = 0;
- ec->last_tc = NULL;
- ec->last_error.result = econv_source_buffer_empty;
- ec->last_error.error_tc = NULL;
- ec->last_error.source_encoding = NULL;
- ec->last_error.destination_encoding = NULL;
- ec->last_error.error_bytes_start = NULL;
- ec->last_error.error_bytes_len = 0;
- ec->last_error.readagain_len = 0;
- ec->source_encoding = NULL;
- ec->destination_encoding = NULL;
- return ec;
-}
-
-static int
-rb_econv_add_transcoder_at(rb_econv_t *ec, const rb_transcoder *tr, int i)
-{
- int n, j;
- int bufsize = 4096;
- unsigned char *p;
-
- if (ec->num_trans == ec->num_allocated) {
- n = ec->num_allocated * 2;
- REALLOC_N(ec->elems, rb_econv_elem_t, n);
- ec->num_allocated = n;
- }
-
- p = xmalloc(bufsize);
-
- MEMMOVE(ec->elems+i+1, ec->elems+i, rb_econv_elem_t, ec->num_trans-i);
-
- ec->elems[i].tc = rb_transcoding_open_by_transcoder(tr, 0);
- ec->elems[i].out_buf_start = p;
- ec->elems[i].out_buf_end = p + bufsize;
- ec->elems[i].out_data_start = p;
- ec->elems[i].out_data_end = p;
- ec->elems[i].last_result = econv_source_buffer_empty;
-
- ec->num_trans++;
-
- if (!DECORATOR_P(tr->src_encoding, tr->dst_encoding))
- for (j = ec->num_trans-1; i <= j; j--) {
- rb_transcoding *tc = ec->elems[j].tc;
- const rb_transcoder *tr2 = tc->transcoder;
- if (!DECORATOR_P(tr2->src_encoding, tr2->dst_encoding)) {
- ec->last_tc = tc;
- break;
- }
- }
-
- return 0;
-}
-
-static rb_econv_t *
-rb_econv_open_by_transcoder_entries(int n, transcoder_entry_t **entries)
-{
- rb_econv_t *ec;
- int i, ret;
-
- for (i = 0; i < n; i++) {
- const rb_transcoder *tr;
- tr = load_transcoder_entry(entries[i]);
- if (!tr)
- return NULL;
- }
-
- ec = rb_econv_alloc(n);
-
- for (i = 0; i < n; i++) {
- const rb_transcoder *tr = load_transcoder_entry(entries[i]);
- ret = rb_econv_add_transcoder_at(ec, tr, ec->num_trans);
- if (ret == -1) {
- rb_econv_close(ec);
- return NULL;
- }
- }
-
- return ec;
-}
-
-struct trans_open_t {
- transcoder_entry_t **entries;
- int num_additional;
-};
-
-static void
-trans_open_i(const char *sname, const char *dname, int depth, void *arg)
-{
- struct trans_open_t *toarg = arg;
-
- if (!toarg->entries) {
- toarg->entries = ALLOC_N(transcoder_entry_t *, depth+1+toarg->num_additional);
- }
- toarg->entries[depth] = get_transcoder_entry(sname, dname);
-}
-
-static rb_econv_t *
-rb_econv_open0(const char *sname, const char *dname, int ecflags)
-{
- transcoder_entry_t **entries = NULL;
- int num_trans;
- rb_econv_t *ec;
-
- rb_encoding *senc, *denc;
- int sidx, didx;
-
- senc = NULL;
- if (*sname) {
- sidx = rb_enc_find_index(sname);
- if (0 <= sidx) {
- senc = rb_enc_from_index(sidx);
- }
- }
-
- denc = NULL;
- if (*dname) {
- didx = rb_enc_find_index(dname);
- if (0 <= didx) {
- denc = rb_enc_from_index(didx);
- }
- }
-
- if (*sname == '\0' && *dname == '\0') {
- num_trans = 0;
- entries = NULL;
- }
- else {
- struct trans_open_t toarg;
- toarg.entries = NULL;
- toarg.num_additional = 0;
- num_trans = transcode_search_path(sname, dname, trans_open_i, (void *)&toarg);
- entries = toarg.entries;
- if (num_trans < 0) {
- xfree(entries);
- return NULL;
- }
- }
-
- ec = rb_econv_open_by_transcoder_entries(num_trans, entries);
- xfree(entries);
- if (!ec)
- return NULL;
-
- ec->flags = ecflags;
- ec->source_encoding_name = sname;
- ec->destination_encoding_name = dname;
-
- return ec;
-}
-
-#define MAX_ECFLAGS_DECORATORS 32
-
-static int
-decorator_names(int ecflags, const char **decorators_ret)
-{
- int num_decorators;
-
- if ((ecflags & ECONV_CRLF_NEWLINE_DECORATOR) &&
- (ecflags & ECONV_CR_NEWLINE_DECORATOR))
- return -1;
-
- if ((ecflags & (ECONV_CRLF_NEWLINE_DECORATOR|ECONV_CR_NEWLINE_DECORATOR)) &&
- (ecflags & ECONV_UNIVERSAL_NEWLINE_DECORATOR))
- return -1;
-
- if ((ecflags & ECONV_XML_TEXT_DECORATOR) &&
- (ecflags & ECONV_XML_ATTR_CONTENT_DECORATOR))
- return -1;
-
- num_decorators = 0;
-
- if (ecflags & ECONV_XML_TEXT_DECORATOR)
- decorators_ret[num_decorators++] = "xml_text_escape";
- if (ecflags & ECONV_XML_ATTR_CONTENT_DECORATOR)
- decorators_ret[num_decorators++] = "xml_attr_content_escape";
- if (ecflags & ECONV_XML_ATTR_QUOTE_DECORATOR)
- decorators_ret[num_decorators++] = "xml_attr_quote";
-
- if (ecflags & ECONV_CRLF_NEWLINE_DECORATOR)
- decorators_ret[num_decorators++] = "crlf_newline";
- if (ecflags & ECONV_CR_NEWLINE_DECORATOR)
- decorators_ret[num_decorators++] = "cr_newline";
- if (ecflags & ECONV_UNIVERSAL_NEWLINE_DECORATOR)
- decorators_ret[num_decorators++] = "universal_newline";
-
- return num_decorators;
-}
-
-rb_econv_t *
-rb_econv_open(const char *sname, const char *dname, int ecflags)
-{
- rb_econv_t *ec;
- int num_decorators;
- const char *decorators[MAX_ECFLAGS_DECORATORS];
- int i;
-
- num_decorators = decorator_names(ecflags, decorators);
- if (num_decorators == -1)
- return NULL;
-
- ec = rb_econv_open0(sname, dname, ecflags & ECONV_ERROR_HANDLER_MASK);
- if (!ec)
- return NULL;
-
- for (i = 0; i < num_decorators; i++)
- if (rb_econv_decorate_at_last(ec, decorators[i]) == -1) {
- rb_econv_close(ec);
- return NULL;
- }
-
- ec->flags |= ecflags & ~ECONV_ERROR_HANDLER_MASK;
-
- return ec;
-}
-
-static int
-trans_sweep(rb_econv_t *ec,
- const unsigned char **input_ptr, const unsigned char *input_stop,
- unsigned char **output_ptr, unsigned char *output_stop,
- int flags,
- int start)
-{
- int try;
- int i, f;
-
- const unsigned char **ipp, *is, *iold;
- unsigned char **opp, *os, *oold;
- rb_econv_result_t res;
-
- try = 1;
- while (try) {
- try = 0;
- for (i = start; i < ec->num_trans; i++) {
- rb_econv_elem_t *te = &ec->elems[i];
-
- if (i == 0) {
- ipp = input_ptr;
- is = input_stop;
- }
- else {
- rb_econv_elem_t *prev_te = &ec->elems[i-1];
- ipp = (const unsigned char **)&prev_te->out_data_start;
- is = prev_te->out_data_end;
- }
-
- if (i == ec->num_trans-1) {
- opp = output_ptr;
- os = output_stop;
- }
- else {
- if (te->out_buf_start != te->out_data_start) {
- int len = te->out_data_end - te->out_data_start;
- int off = te->out_data_start - te->out_buf_start;
- MEMMOVE(te->out_buf_start, te->out_data_start, unsigned char, len);
- te->out_data_start = te->out_buf_start;
- te->out_data_end -= off;
- }
- opp = &te->out_data_end;
- os = te->out_buf_end;
- }
-
- f = flags;
- if (ec->num_finished != i)
- f |= ECONV_PARTIAL_INPUT;
- if (i == 0 && (flags & ECONV_AFTER_OUTPUT)) {
- start = 1;
- flags &= ~ECONV_AFTER_OUTPUT;
- }
- if (i != 0)
- f &= ~ECONV_AFTER_OUTPUT;
- iold = *ipp;
- oold = *opp;
- te->last_result = res = rb_transcoding_convert(te->tc, ipp, is, opp, os, f);
- if (iold != *ipp || oold != *opp)
- try = 1;
-
- switch (res) {
- case econv_invalid_byte_sequence:
- case econv_incomplete_input:
- case econv_undefined_conversion:
- case econv_after_output:
- return i;
-
- case econv_destination_buffer_full:
- case econv_source_buffer_empty:
- break;
-
- case econv_finished:
- ec->num_finished = i+1;
- break;
- }
- }
- }
- return -1;
-}
-
-static rb_econv_result_t
-rb_trans_conv(rb_econv_t *ec,
- const unsigned char **input_ptr, const unsigned char *input_stop,
- unsigned char **output_ptr, unsigned char *output_stop,
- int flags,
- int *result_position_ptr)
-{
- int i;
- int needreport_index;
- int sweep_start;
-
- unsigned char empty_buf;
- unsigned char *empty_ptr = &empty_buf;
-
- if (!input_ptr) {
- input_ptr = (const unsigned char **)&empty_ptr;
- input_stop = empty_ptr;
- }
-
- if (!output_ptr) {
- output_ptr = &empty_ptr;
- output_stop = empty_ptr;
- }
-
- if (ec->elems[0].last_result == econv_after_output)
- ec->elems[0].last_result = econv_source_buffer_empty;
-
- needreport_index = -1;
- for (i = ec->num_trans-1; 0 <= i; i--) {
- switch (ec->elems[i].last_result) {
- case econv_invalid_byte_sequence:
- case econv_incomplete_input:
- case econv_undefined_conversion:
- case econv_after_output:
- case econv_finished:
- sweep_start = i+1;
- needreport_index = i;
- goto found_needreport;
-
- case econv_destination_buffer_full:
- case econv_source_buffer_empty:
- break;
-
- default:
- rb_bug("unexpected transcode last result");
- }
- }
-
- /* /^[sd]+$/ is confirmed. but actually /^s*d*$/. */
-
- if (ec->elems[ec->num_trans-1].last_result == econv_destination_buffer_full &&
- (flags & ECONV_AFTER_OUTPUT)) {
- rb_econv_result_t res;
-
- res = rb_trans_conv(ec, NULL, NULL, output_ptr, output_stop,
- (flags & ~ECONV_AFTER_OUTPUT)|ECONV_PARTIAL_INPUT,
- result_position_ptr);
-
- if (res == econv_source_buffer_empty)
- return econv_after_output;
- return res;
- }
-
- sweep_start = 0;
-
- found_needreport:
-
- do {
- needreport_index = trans_sweep(ec, input_ptr, input_stop, output_ptr, output_stop, flags, sweep_start);
- sweep_start = needreport_index + 1;
- } while (needreport_index != -1 && needreport_index != ec->num_trans-1);
-
- for (i = ec->num_trans-1; 0 <= i; i--) {
- if (ec->elems[i].last_result != econv_source_buffer_empty) {
- rb_econv_result_t res = ec->elems[i].last_result;
- if (res == econv_invalid_byte_sequence ||
- res == econv_incomplete_input ||
- res == econv_undefined_conversion ||
- res == econv_after_output) {
- ec->elems[i].last_result = econv_source_buffer_empty;
- }
- if (result_position_ptr)
- *result_position_ptr = i;
- return res;
- }
- }
- if (result_position_ptr)
- *result_position_ptr = -1;
- return econv_source_buffer_empty;
-}
-
-static rb_econv_result_t
-rb_econv_convert0(rb_econv_t *ec,
- const unsigned char **input_ptr, const unsigned char *input_stop,
- unsigned char **output_ptr, unsigned char *output_stop,
- int flags)
-{
- rb_econv_result_t res;
- int result_position;
- int has_output = 0;
-
- memset(&ec->last_error, 0, sizeof(ec->last_error));
-
- if (ec->num_trans == 0) {
- size_t len;
- if (ec->in_buf_start && ec->in_data_start != ec->in_data_end) {
- if (output_stop - *output_ptr < ec->in_data_end - ec->in_data_start) {
- len = output_stop - *output_ptr;
- memcpy(*output_ptr, ec->in_data_start, len);
- *output_ptr = output_stop;
- ec->in_data_start += len;
- res = econv_destination_buffer_full;
- goto gotresult;
- }
- len = ec->in_data_end - ec->in_data_start;
- memcpy(*output_ptr, ec->in_data_start, len);
- *output_ptr += len;
- ec->in_data_start = ec->in_data_end = ec->in_buf_start;
- if (flags & ECONV_AFTER_OUTPUT) {
- res = econv_after_output;
- goto gotresult;
- }
- }
- if (output_stop - *output_ptr < input_stop - *input_ptr) {
- len = output_stop - *output_ptr;
- }
- else {
- len = input_stop - *input_ptr;
- }
- if (0 < len && (flags & ECONV_AFTER_OUTPUT)) {
- *(*output_ptr)++ = *(*input_ptr)++;
- res = econv_after_output;
- goto gotresult;
- }
- memcpy(*output_ptr, *input_ptr, len);
- *output_ptr += len;
- *input_ptr += len;
- if (*input_ptr != input_stop)
- res = econv_destination_buffer_full;
- else if (flags & ECONV_PARTIAL_INPUT)
- res = econv_source_buffer_empty;
- else
- res = econv_finished;
- goto gotresult;
- }
-
- if (ec->elems[ec->num_trans-1].out_data_start) {
- unsigned char *data_start = ec->elems[ec->num_trans-1].out_data_start;
- unsigned char *data_end = ec->elems[ec->num_trans-1].out_data_end;
- if (data_start != data_end) {
- size_t len;
- if (output_stop - *output_ptr < data_end - data_start) {
- len = output_stop - *output_ptr;
- memcpy(*output_ptr, data_start, len);
- *output_ptr = output_stop;
- ec->elems[ec->num_trans-1].out_data_start += len;
- res = econv_destination_buffer_full;
- goto gotresult;
- }
- len = data_end - data_start;
- memcpy(*output_ptr, data_start, len);
- *output_ptr += len;
- ec->elems[ec->num_trans-1].out_data_start =
- ec->elems[ec->num_trans-1].out_data_end =
- ec->elems[ec->num_trans-1].out_buf_start;
- has_output = 1;
- }
- }
-
- if (ec->in_buf_start &&
- ec->in_data_start != ec->in_data_end) {
- res = rb_trans_conv(ec, (const unsigned char **)&ec->in_data_start, ec->in_data_end, output_ptr, output_stop,
- (flags&~ECONV_AFTER_OUTPUT)|ECONV_PARTIAL_INPUT, &result_position);
- if (res != econv_source_buffer_empty)
- goto gotresult;
- }
-
- if (has_output &&
- (flags & ECONV_AFTER_OUTPUT) &&
- *input_ptr != input_stop) {
- input_stop = *input_ptr;
- res = rb_trans_conv(ec, input_ptr, input_stop, output_ptr, output_stop, flags, &result_position);
- if (res == econv_source_buffer_empty)
- res = econv_after_output;
- }
- else if ((flags & ECONV_AFTER_OUTPUT) ||
- ec->num_trans == 1) {
- res = rb_trans_conv(ec, input_ptr, input_stop, output_ptr, output_stop, flags, &result_position);
- }
- else {
- flags |= ECONV_AFTER_OUTPUT;
- do {
- res = rb_trans_conv(ec, input_ptr, input_stop, output_ptr, output_stop, flags, &result_position);
- } while (res == econv_after_output);
- }
-
- gotresult:
- ec->last_error.result = res;
- if (res == econv_invalid_byte_sequence ||
- res == econv_incomplete_input ||
- res == econv_undefined_conversion) {
- rb_transcoding *error_tc = ec->elems[result_position].tc;
- ec->last_error.error_tc = error_tc;
- ec->last_error.source_encoding = error_tc->transcoder->src_encoding;
- ec->last_error.destination_encoding = error_tc->transcoder->dst_encoding;
- ec->last_error.error_bytes_start = TRANSCODING_READBUF(error_tc);
- ec->last_error.error_bytes_len = error_tc->recognized_len;
- ec->last_error.readagain_len = error_tc->readagain_len;
- }
-
- return res;
-}
-
-static int output_replacement_character(rb_econv_t *ec);
-
-static int
-output_hex_charref(rb_econv_t *ec)
-{
- int ret;
- unsigned char utfbuf[1024];
- const unsigned char *utf;
- size_t utf_len;
- int utf_allocated = 0;
- char charef_buf[16];
- const unsigned char *p;
-
- if (encoding_equal(ec->last_error.source_encoding, "UTF-32BE")) {
- utf = ec->last_error.error_bytes_start;
- utf_len = ec->last_error.error_bytes_len;
- }
- else {
- utf = allocate_converted_string(ec->last_error.source_encoding, "UTF-32BE",
- ec->last_error.error_bytes_start, ec->last_error.error_bytes_len,
- utfbuf, sizeof(utfbuf),
- &utf_len);
- if (!utf)
- return -1;
- if (utf != utfbuf && utf != ec->last_error.error_bytes_start)
- utf_allocated = 1;
- }
-
- if (utf_len % 4 != 0)
- goto fail;
-
- p = utf;
- while (4 <= utf_len) {
- unsigned int u = 0;
- u += p[0] << 24;
- u += p[1] << 16;
- u += p[2] << 8;
- u += p[3];
- snprintf(charef_buf, sizeof(charef_buf), "&#x%X;", u);
-
- ret = rb_econv_insert_output(ec, (unsigned char *)charef_buf, strlen(charef_buf), "US-ASCII");
- if (ret == -1)
- goto fail;
-
- p += 4;
- utf_len -= 4;
- }
-
- if (utf_allocated)
- xfree((void *)utf);
- return 0;
-
- fail:
- if (utf_allocated)
- xfree((void *)utf);
- return -1;
-}
-
-rb_econv_result_t
-rb_econv_convert(rb_econv_t *ec,
- const unsigned char **input_ptr, const unsigned char *input_stop,
- unsigned char **output_ptr, unsigned char *output_stop,
- int flags)
-{
- rb_econv_result_t ret;
-
- unsigned char empty_buf;
- unsigned char *empty_ptr = &empty_buf;
-
- ec->started = 1;
-
- if (!input_ptr) {
- input_ptr = (const unsigned char **)&empty_ptr;
- input_stop = empty_ptr;
- }
-
- if (!output_ptr) {
- output_ptr = &empty_ptr;
- output_stop = empty_ptr;
- }
-
- resume:
- ret = rb_econv_convert0(ec, input_ptr, input_stop, output_ptr, output_stop, flags);
-
- if (ret == econv_invalid_byte_sequence ||
- ret == econv_incomplete_input) {
- /* deal with invalid byte sequence */
- /* todo: add more alternative behaviors */
- switch (ec->flags & ECONV_INVALID_MASK) {
- case ECONV_INVALID_REPLACE:
- if (output_replacement_character(ec) == 0)
- goto resume;
- }
- }
-
- if (ret == econv_undefined_conversion) {
- /* valid character in source encoding
- * but no related character(s) in destination encoding */
- /* todo: add more alternative behaviors */
- switch (ec->flags & ECONV_UNDEF_MASK) {
- case ECONV_UNDEF_REPLACE:
- if (output_replacement_character(ec) == 0)
- goto resume;
- break;
-
- case ECONV_UNDEF_HEX_CHARREF:
- if (output_hex_charref(ec) == 0)
- goto resume;
- break;
- }
- }
-
- return ret;
-}
-
-const char *
-rb_econv_encoding_to_insert_output(rb_econv_t *ec)
-{
- rb_transcoding *tc = ec->last_tc;
- const rb_transcoder *tr;
-
- if (tc == NULL)
- return "";
-
- tr = tc->transcoder;
-
- if (tr->asciicompat_type == asciicompat_encoder)
- return tr->src_encoding;
- return tr->dst_encoding;
-}
-
-static unsigned char *
-allocate_converted_string(const char *sname, const char *dname,
- const unsigned char *str, size_t len,
- unsigned char *caller_dst_buf, size_t caller_dst_bufsize,
- size_t *dst_len_ptr)
-{
- unsigned char *dst_str;
- size_t dst_len;
- size_t dst_bufsize;
-
- rb_econv_t *ec;
- rb_econv_result_t res;
-
- const unsigned char *sp;
- unsigned char *dp;
-
- if (caller_dst_buf)
- dst_bufsize = caller_dst_bufsize;
- else if (len == 0)
- dst_bufsize = 1;
- else
- dst_bufsize = len;
-
- ec = rb_econv_open(sname, dname, 0);
- if (ec == NULL)
- return NULL;
- if (caller_dst_buf)
- dst_str = caller_dst_buf;
- else
- dst_str = xmalloc(dst_bufsize);
- dst_len = 0;
- sp = str;
- dp = dst_str+dst_len;
- res = rb_econv_convert(ec, &sp, str+len, &dp, dst_str+dst_bufsize, 0);
- dst_len = dp - dst_str;
- while (res == econv_destination_buffer_full) {
- if (SIZE_MAX/2 < dst_bufsize) {
- goto fail;
- }
- dst_bufsize *= 2;
- if (dst_str == caller_dst_buf) {
- unsigned char *tmp;
- tmp = xmalloc(dst_bufsize);
- memcpy(tmp, dst_str, dst_bufsize/2);
- dst_str = tmp;
- }
- else {
- dst_str = xrealloc(dst_str, dst_bufsize);
- }
- dp = dst_str+dst_len;
- res = rb_econv_convert(ec, &sp, str+len, &dp, dst_str+dst_bufsize, 0);
- dst_len = dp - dst_str;
- }
- if (res != econv_finished) {
- goto fail;
- }
- rb_econv_close(ec);
- *dst_len_ptr = dst_len;
- return dst_str;
-
- fail:
- if (dst_str != caller_dst_buf)
- xfree(dst_str);
- rb_econv_close(ec);
- return NULL;
-}
-
-/* result: 0:success -1:failure */
-int
-rb_econv_insert_output(rb_econv_t *ec,
- const unsigned char *str, size_t len, const char *str_encoding)
-{
- const char *insert_encoding = rb_econv_encoding_to_insert_output(ec);
- unsigned char insert_buf[4096];
- const unsigned char *insert_str = NULL;
- size_t insert_len;
-
- int last_trans_index;
- rb_transcoding *tc;
-
- unsigned char **buf_start_p;
- unsigned char **data_start_p;
- unsigned char **data_end_p;
- unsigned char **buf_end_p;
-
- size_t need;
-
- ec->started = 1;
-
- if (len == 0)
- return 0;
-
- if (encoding_equal(insert_encoding, str_encoding)) {
- insert_str = str;
- insert_len = len;
- }
- else {
- insert_str = allocate_converted_string(str_encoding, insert_encoding,
- str, len, insert_buf, sizeof(insert_buf), &insert_len);
- if (insert_str == NULL)
- return -1;
- }
-
- need = insert_len;
-
- last_trans_index = ec->num_trans-1;
- if (ec->num_trans == 0) {
- tc = NULL;
- buf_start_p = &ec->in_buf_start;
- data_start_p = &ec->in_data_start;
- data_end_p = &ec->in_data_end;
- buf_end_p = &ec->in_buf_end;
- }
- else if (ec->elems[last_trans_index].tc->transcoder->asciicompat_type == asciicompat_encoder) {
- tc = ec->elems[last_trans_index].tc;
- need += tc->readagain_len;
- if (need < insert_len)
- goto fail;
- if (last_trans_index == 0) {
- buf_start_p = &ec->in_buf_start;
- data_start_p = &ec->in_data_start;
- data_end_p = &ec->in_data_end;
- buf_end_p = &ec->in_buf_end;
- }
- else {
- rb_econv_elem_t *ee = &ec->elems[last_trans_index-1];
- buf_start_p = &ee->out_buf_start;
- data_start_p = &ee->out_data_start;
- data_end_p = &ee->out_data_end;
- buf_end_p = &ee->out_buf_end;
- }
- }
- else {
- rb_econv_elem_t *ee = &ec->elems[last_trans_index];
- buf_start_p = &ee->out_buf_start;
- data_start_p = &ee->out_data_start;
- data_end_p = &ee->out_data_end;
- buf_end_p = &ee->out_buf_end;
- tc = ec->elems[last_trans_index].tc;
- }
-
- if (*buf_start_p == NULL) {
- unsigned char *buf = xmalloc(need);
- *buf_start_p = buf;
- *data_start_p = buf;
- *data_end_p = buf;
- *buf_end_p = buf+need;
- }
- else if ((size_t)(*buf_end_p - *data_end_p) < need) {
- MEMMOVE(*buf_start_p, *data_start_p, unsigned char, *data_end_p - *data_start_p);
- *data_end_p = *buf_start_p + (*data_end_p - *data_start_p);
- *data_start_p = *buf_start_p;
- if ((size_t)(*buf_end_p - *data_end_p) < need) {
- unsigned char *buf;
- size_t s = (*data_end_p - *buf_start_p) + need;
- if (s < need)
- goto fail;
- buf = xrealloc(*buf_start_p, s);
- *data_start_p = buf;
- *data_end_p = buf + (*data_end_p - *buf_start_p);
- *buf_start_p = buf;
- *buf_end_p = buf + s;
- }
- }
-
- memcpy(*data_end_p, insert_str, insert_len);
- *data_end_p += insert_len;
- if (tc && tc->transcoder->asciicompat_type == asciicompat_encoder) {
- memcpy(*data_end_p, TRANSCODING_READBUF(tc)+tc->recognized_len, tc->readagain_len);
- *data_end_p += tc->readagain_len;
- tc->readagain_len = 0;
- }
-
- if (insert_str != str && insert_str != insert_buf)
- xfree((void*)insert_str);
- return 0;
-
- fail:
- if (insert_str != str && insert_str != insert_buf)
- xfree((void*)insert_str);
- return -1;
-}
-
-void
-rb_econv_close(rb_econv_t *ec)
-{
- int i;
-
- if (ec->replacement_allocated) {
- xfree((void *)ec->replacement_str);
- }
- for (i = 0; i < ec->num_trans; i++) {
- rb_transcoding_close(ec->elems[i].tc);
- if (ec->elems[i].out_buf_start)
- xfree(ec->elems[i].out_buf_start);
- }
- xfree(ec->in_buf_start);
- xfree(ec->elems);
- xfree(ec);
-}
-
-size_t
-rb_econv_memsize(rb_econv_t *ec)
-{
- size_t size = sizeof(rb_econv_t);
- int i;
-
- if (ec->replacement_allocated) {
- size += ec->replacement_len;
- }
- for (i = 0; i < ec->num_trans; i++) {
- size += rb_transcoding_memsize(ec->elems[i].tc);
-
- if (ec->elems[i].out_buf_start) {
- size += ec->elems[i].out_buf_end - ec->elems[i].out_buf_start;
- }
- }
- size += ec->in_buf_end - ec->in_buf_start;
- size += sizeof(rb_econv_elem_t) * ec->num_allocated;
-
- return size;
-}
-
-int
-rb_econv_putbackable(rb_econv_t *ec)
-{
- if (ec->num_trans == 0)
- return 0;
- return ec->elems[0].tc->readagain_len;
-}
-
-void
-rb_econv_putback(rb_econv_t *ec, unsigned char *p, int n)
-{
- rb_transcoding *tc;
- if (ec->num_trans == 0 || n == 0)
- return;
- tc = ec->elems[0].tc;
- memcpy(p, TRANSCODING_READBUF(tc) + tc->recognized_len + tc->readagain_len - n, n);
- tc->readagain_len -= n;
-}
-
-struct asciicompat_encoding_t {
- const char *ascii_compat_name;
- const char *ascii_incompat_name;
-};
-
-static int
-asciicompat_encoding_i(st_data_t key, st_data_t val, st_data_t arg)
-{
- struct asciicompat_encoding_t *data = (struct asciicompat_encoding_t *)arg;
- transcoder_entry_t *entry = (transcoder_entry_t *)val;
- const rb_transcoder *tr;
-
- if (DECORATOR_P(entry->sname, entry->dname))
- return ST_CONTINUE;
- tr = load_transcoder_entry(entry);
- if (tr && tr->asciicompat_type == asciicompat_decoder) {
- data->ascii_compat_name = tr->dst_encoding;
- return ST_STOP;
- }
- return ST_CONTINUE;
-}
-
-const char *
-rb_econv_asciicompat_encoding(const char *ascii_incompat_name)
-{
- st_data_t v;
- st_table *table2;
- struct asciicompat_encoding_t data;
-
- if (!st_lookup(transcoder_table, (st_data_t)ascii_incompat_name, &v))
- return NULL;
- table2 = (st_table *)v;
-
- /*
- * Assumption:
- * There is at most one transcoder for
- * converting from ASCII incompatible encoding.
- *
- * For ISO-2022-JP, there is ISO-2022-JP -> stateless-ISO-2022-JP and no others.
- */
- if (table2->num_entries != 1)
- return NULL;
-
- data.ascii_incompat_name = ascii_incompat_name;
- data.ascii_compat_name = NULL;
- st_foreach(table2, asciicompat_encoding_i, (st_data_t)&data);
- return data.ascii_compat_name;
-}
-
-VALUE
-rb_econv_substr_append(rb_econv_t *ec, VALUE src, long off, long len, VALUE dst, int flags)
-{
- unsigned const char *ss, *sp, *se;
- unsigned char *ds, *dp, *de;
- rb_econv_result_t res;
- int max_output;
-
- if (NIL_P(dst)) {
- dst = rb_str_buf_new(len);
- if (ec->destination_encoding)
- rb_enc_associate(dst, ec->destination_encoding);
- }
-
- if (ec->last_tc)
- max_output = ec->last_tc->transcoder->max_output;
- else
- max_output = 1;
-
- res = econv_destination_buffer_full;
- while (res == econv_destination_buffer_full) {
- long dlen = RSTRING_LEN(dst);
- if (rb_str_capacity(dst) - dlen < (size_t)len + max_output) {
- unsigned long new_capa = (unsigned long)dlen + len + max_output;
- if (LONG_MAX < new_capa)
- rb_raise(rb_eArgError, "too long string");
- rb_str_resize(dst, new_capa);
- rb_str_set_len(dst, dlen);
- }
- ss = sp = (const unsigned char *)RSTRING_PTR(src) + off;
- se = ss + len;
- ds = (unsigned char *)RSTRING_PTR(dst);
- de = ds + rb_str_capacity(dst);
- dp = ds += dlen;
- res = rb_econv_convert(ec, &sp, se, &dp, de, flags);
- off += sp - ss;
- len -= sp - ss;
- rb_str_set_len(dst, dlen + (dp - ds));
- rb_econv_check_error(ec);
- }
-
- return dst;
-}
-
-VALUE
-rb_econv_str_append(rb_econv_t *ec, VALUE src, VALUE dst, int flags)
-{
- return rb_econv_substr_append(ec, src, 0, RSTRING_LEN(src), dst, flags);
-}
-
-VALUE
-rb_econv_substr_convert(rb_econv_t *ec, VALUE src, long byteoff, long bytesize, int flags)
-{
- return rb_econv_substr_append(ec, src, byteoff, bytesize, Qnil, flags);
-}
-
-VALUE
-rb_econv_str_convert(rb_econv_t *ec, VALUE src, int flags)
-{
- return rb_econv_substr_append(ec, src, 0, RSTRING_LEN(src), Qnil, flags);
-}
-
-static int
-rb_econv_add_converter(rb_econv_t *ec, const char *sname, const char *dname, int n)
-{
- transcoder_entry_t *entry;
- const rb_transcoder *tr;
-
- if (ec->started != 0)
- return -1;
-
- entry = get_transcoder_entry(sname, dname);
- if (!entry)
- return -1;
-
- tr = load_transcoder_entry(entry);
-
- return rb_econv_add_transcoder_at(ec, tr, n);
-}
-
-static int
-rb_econv_decorate_at(rb_econv_t *ec, const char *decorator_name, int n)
-{
- return rb_econv_add_converter(ec, "", decorator_name, n);
-}
-
-int
-rb_econv_decorate_at_first(rb_econv_t *ec, const char *decorator_name)
-{
- const rb_transcoder *tr;
-
- if (ec->num_trans == 0)
- return rb_econv_decorate_at(ec, decorator_name, 0);
-
- tr = ec->elems[0].tc->transcoder;
-
- if (!DECORATOR_P(tr->src_encoding, tr->dst_encoding) &&
- tr->asciicompat_type == asciicompat_decoder)
- return rb_econv_decorate_at(ec, decorator_name, 1);
-
- return rb_econv_decorate_at(ec, decorator_name, 0);
-}
-
-int
-rb_econv_decorate_at_last(rb_econv_t *ec, const char *decorator_name)
-{
- const rb_transcoder *tr;
-
- if (ec->num_trans == 0)
- return rb_econv_decorate_at(ec, decorator_name, 0);
-
- tr = ec->elems[ec->num_trans-1].tc->transcoder;
-
- if (!DECORATOR_P(tr->src_encoding, tr->dst_encoding) &&
- tr->asciicompat_type == asciicompat_encoder)
- return rb_econv_decorate_at(ec, decorator_name, ec->num_trans-1);
-
- return rb_econv_decorate_at(ec, decorator_name, ec->num_trans);
-}
-
-void
-rb_econv_binmode(rb_econv_t *ec)
-{
- const rb_transcoder *trs[3];
- int n, i, j;
- transcoder_entry_t *entry;
- int num_trans;
-
- n = 0;
- if (ec->flags & ECONV_UNIVERSAL_NEWLINE_DECORATOR) {
- entry = get_transcoder_entry("", "universal_newline");
- if (entry->transcoder)
- trs[n++] = entry->transcoder;
- }
- if (ec->flags & ECONV_CRLF_NEWLINE_DECORATOR) {
- entry = get_transcoder_entry("", "crlf_newline");
- if (entry->transcoder)
- trs[n++] = entry->transcoder;
- }
- if (ec->flags & ECONV_CR_NEWLINE_DECORATOR) {
- entry = get_transcoder_entry("", "cr_newline");
- if (entry->transcoder)
- trs[n++] = entry->transcoder;
- }
-
- num_trans = ec->num_trans;
- j = 0;
- for (i = 0; i < num_trans; i++) {
- int k;
- for (k = 0; k < n; k++)
- if (trs[k] == ec->elems[i].tc->transcoder)
- break;
- if (k == n) {
- ec->elems[j] = ec->elems[i];
- j++;
- }
- else {
- rb_transcoding_close(ec->elems[i].tc);
- xfree(ec->elems[i].out_buf_start);
- ec->num_trans--;
- }
- }
-
- ec->flags &= ~(ECONV_UNIVERSAL_NEWLINE_DECORATOR|ECONV_CRLF_NEWLINE_DECORATOR|ECONV_CR_NEWLINE_DECORATOR);
-
-}
-
-static VALUE
-econv_description(const char *sname, const char *dname, int ecflags, VALUE mesg)
-{
- int has_description = 0;
-
- if (NIL_P(mesg))
- mesg = rb_str_new(NULL, 0);
-
- if (*sname != '\0' || *dname != '\0') {
- if (*sname == '\0')
- rb_str_cat2(mesg, dname);
- else if (*dname == '\0')
- rb_str_cat2(mesg, sname);
- else
- rb_str_catf(mesg, "%s to %s", sname, dname);
- has_description = 1;
- }
-
- if (ecflags & (ECONV_UNIVERSAL_NEWLINE_DECORATOR|
- ECONV_CRLF_NEWLINE_DECORATOR|
- ECONV_CR_NEWLINE_DECORATOR|
- ECONV_XML_TEXT_DECORATOR|
- ECONV_XML_ATTR_CONTENT_DECORATOR|
- ECONV_XML_ATTR_QUOTE_DECORATOR)) {
- const char *pre = "";
- if (has_description)
- rb_str_cat2(mesg, " with ");
- if (ecflags & ECONV_UNIVERSAL_NEWLINE_DECORATOR) {
- rb_str_cat2(mesg, pre); pre = ",";
- rb_str_cat2(mesg, "universal_newline");
- }
- if (ecflags & ECONV_CRLF_NEWLINE_DECORATOR) {
- rb_str_cat2(mesg, pre); pre = ",";
- rb_str_cat2(mesg, "crlf_newline");
- }
- if (ecflags & ECONV_CR_NEWLINE_DECORATOR) {
- rb_str_cat2(mesg, pre); pre = ",";
- rb_str_cat2(mesg, "cr_newline");
- }
- if (ecflags & ECONV_XML_TEXT_DECORATOR) {
- rb_str_cat2(mesg, pre); pre = ",";
- rb_str_cat2(mesg, "xml_text");
- }
- if (ecflags & ECONV_XML_ATTR_CONTENT_DECORATOR) {
- rb_str_cat2(mesg, pre); pre = ",";
- rb_str_cat2(mesg, "xml_attr_content");
- }
- if (ecflags & ECONV_XML_ATTR_QUOTE_DECORATOR) {
- rb_str_cat2(mesg, pre); pre = ",";
- rb_str_cat2(mesg, "xml_attr_quote");
- }
- has_description = 1;
- }
- if (!has_description) {
- rb_str_cat2(mesg, "no-conversion");
- }
-
- return mesg;
-}
-
-VALUE
-rb_econv_open_exc(const char *sname, const char *dname, int ecflags)
-{
- VALUE mesg, exc;
- mesg = rb_str_new_cstr("code converter not found (");
- econv_description(sname, dname, ecflags, mesg);
- rb_str_cat2(mesg, ")");
- exc = rb_exc_new3(rb_eConverterNotFoundError, mesg);
- return exc;
-}
-
-static VALUE
-make_econv_exception(rb_econv_t *ec)
-{
- VALUE mesg, exc;
- if (ec->last_error.result == econv_invalid_byte_sequence ||
- ec->last_error.result == econv_incomplete_input) {
- const char *err = (const char *)ec->last_error.error_bytes_start;
- size_t error_len = ec->last_error.error_bytes_len;
- VALUE bytes = rb_str_new(err, error_len);
- VALUE dumped = rb_str_dump(bytes);
- size_t readagain_len = ec->last_error.readagain_len;
- VALUE bytes2 = Qnil;
- VALUE dumped2;
- int idx;
- if (ec->last_error.result == econv_incomplete_input) {
- mesg = rb_sprintf("incomplete %s on %s",
- StringValueCStr(dumped),
- ec->last_error.source_encoding);
- }
- else if (readagain_len) {
- bytes2 = rb_str_new(err+error_len, readagain_len);
- dumped2 = rb_str_dump(bytes2);
- mesg = rb_sprintf("%s followed by %s on %s",
- StringValueCStr(dumped),
- StringValueCStr(dumped2),
- ec->last_error.source_encoding);
- }
- else {
- mesg = rb_sprintf("%s on %s",
- StringValueCStr(dumped),
- ec->last_error.source_encoding);
- }
-
- exc = rb_exc_new3(rb_eInvalidByteSequenceError, mesg);
- rb_ivar_set(exc, rb_intern("error_bytes"), bytes);
- rb_ivar_set(exc, rb_intern("readagain_bytes"), bytes2);
- rb_ivar_set(exc, rb_intern("incomplete_input"), ec->last_error.result == econv_incomplete_input ? Qtrue : Qfalse);
-
- set_encs:
- rb_ivar_set(exc, rb_intern("source_encoding_name"), rb_str_new2(ec->last_error.source_encoding));
- rb_ivar_set(exc, rb_intern("destination_encoding_name"), rb_str_new2(ec->last_error.destination_encoding));
- idx = rb_enc_find_index(ec->last_error.source_encoding);
- if (0 <= idx)
- rb_ivar_set(exc, rb_intern("source_encoding"), rb_enc_from_encoding(rb_enc_from_index(idx)));
- idx = rb_enc_find_index(ec->last_error.destination_encoding);
- if (0 <= idx)
- rb_ivar_set(exc, rb_intern("destination_encoding"), rb_enc_from_encoding(rb_enc_from_index(idx)));
- return exc;
- }
- if (ec->last_error.result == econv_undefined_conversion) {
- VALUE bytes = rb_str_new((const char *)ec->last_error.error_bytes_start,
- ec->last_error.error_bytes_len);
- VALUE dumped = Qnil;
- int idx;
- if (strcmp(ec->last_error.source_encoding, "UTF-8") == 0) {
- rb_encoding *utf8 = rb_utf8_encoding();
- const char *start, *end;
- int n;
- start = (const char *)ec->last_error.error_bytes_start;
- end = start + ec->last_error.error_bytes_len;
- n = rb_enc_precise_mbclen(start, end, utf8);
- if (MBCLEN_CHARFOUND_P(n) &&
- (size_t)MBCLEN_CHARFOUND_LEN(n) == ec->last_error.error_bytes_len) {
- unsigned int cc = rb_enc_mbc_to_codepoint(start, end, utf8);
- dumped = rb_sprintf("U+%04X", cc);
- }
- }
- if (dumped == Qnil)
- dumped = rb_str_dump(bytes);
- if (strcmp(ec->last_error.source_encoding,
- ec->source_encoding_name) == 0 &&
- strcmp(ec->last_error.destination_encoding,
- ec->destination_encoding_name) == 0) {
- mesg = rb_sprintf("%s from %s to %s",
- StringValueCStr(dumped),
- ec->last_error.source_encoding,
- ec->last_error.destination_encoding);
- }
- else {
- int i;
- mesg = rb_sprintf("%s to %s in conversion from %s",
- StringValueCStr(dumped),
- ec->last_error.destination_encoding,
- ec->source_encoding_name);
- for (i = 0; i < ec->num_trans; i++) {
- const rb_transcoder *tr = ec->elems[i].tc->transcoder;
- if (!DECORATOR_P(tr->src_encoding, tr->dst_encoding))
- rb_str_catf(mesg, " to %s",
- ec->elems[i].tc->transcoder->dst_encoding);
- }
- }
- exc = rb_exc_new3(rb_eUndefinedConversionError, mesg);
- idx = rb_enc_find_index(ec->last_error.source_encoding);
- if (0 <= idx)
- rb_enc_associate_index(bytes, idx);
- rb_ivar_set(exc, rb_intern("error_char"), bytes);
- goto set_encs;
- }
- return Qnil;
-}
-
-static void
-more_output_buffer(
- VALUE destination,
- unsigned char *(*resize_destination)(VALUE, int, int),
- int max_output,
- unsigned char **out_start_ptr,
- unsigned char **out_pos,
- unsigned char **out_stop_ptr)
-{
- size_t len = (*out_pos - *out_start_ptr);
- size_t new_len = (len + max_output) * 2;
- *out_start_ptr = resize_destination(destination, len, new_len);
- *out_pos = *out_start_ptr + len;
- *out_stop_ptr = *out_start_ptr + new_len;
-}
-
-static int
-make_replacement(rb_econv_t *ec)
-{
- rb_transcoding *tc;
- const rb_transcoder *tr;
- rb_encoding *enc;
- const unsigned char *replacement;
- const char *repl_enc;
- const char *ins_enc;
- size_t len;
-
- if (ec->replacement_str)
- return 0;
-
- ins_enc = rb_econv_encoding_to_insert_output(ec);
-
- tc = ec->last_tc;
- if (*ins_enc) {
- tr = tc->transcoder;
- enc = rb_enc_find(tr->dst_encoding);
- replacement = (const unsigned char *)get_replacement_character(ins_enc, &len, &repl_enc);
- }
- else {
- replacement = (unsigned char *)"?";
- len = 1;
- repl_enc = "";
- }
-
- ec->replacement_str = replacement;
- ec->replacement_len = len;
- ec->replacement_enc = repl_enc;
- ec->replacement_allocated = 0;
- return 0;
-}
-
-int
-rb_econv_set_replacement(rb_econv_t *ec,
- const unsigned char *str, size_t len, const char *encname)
-{
- unsigned char *str2;
- size_t len2;
- const char *encname2;
-
- encname2 = rb_econv_encoding_to_insert_output(ec);
-
- if (encoding_equal(encname, encname2)) {
- str2 = xmalloc(len);
- MEMCPY(str2, str, unsigned char, len); /* xxx: str may be invalid */
- len2 = len;
- encname2 = encname;
- }
- else {
- str2 = allocate_converted_string(encname, encname2, str, len, NULL, 0, &len2);
- if (!str2)
- return -1;
- }
-
- if (ec->replacement_allocated) {
- xfree((void *)ec->replacement_str);
- }
- ec->replacement_allocated = 1;
- ec->replacement_str = str2;
- ec->replacement_len = len2;
- ec->replacement_enc = encname2;
- return 0;
-}
-
-static int
-output_replacement_character(rb_econv_t *ec)
-{
- int ret;
-
- if (make_replacement(ec) == -1)
- return -1;
-
- ret = rb_econv_insert_output(ec, ec->replacement_str, ec->replacement_len, ec->replacement_enc);
- if (ret == -1)
- return -1;
-
- return 0;
-}
-
-#if 1
-static void
-transcode_loop(const unsigned char **in_pos, unsigned char **out_pos,
- const unsigned char *in_stop, unsigned char *out_stop,
- VALUE destination,
- unsigned char *(*resize_destination)(VALUE, int, int),
- const char *src_encoding,
- const char *dst_encoding,
- int ecflags,
- VALUE ecopts)
-{
- rb_econv_t *ec;
- rb_transcoding *last_tc;
- rb_econv_result_t ret;
- unsigned char *out_start = *out_pos;
- int max_output;
- VALUE exc;
-
- ec = rb_econv_open_opts(src_encoding, dst_encoding, ecflags, ecopts);
- if (!ec)
- rb_exc_raise(rb_econv_open_exc(src_encoding, dst_encoding, ecflags));
-
- last_tc = ec->last_tc;
- max_output = last_tc ? last_tc->transcoder->max_output : 1;
-
- resume:
- ret = rb_econv_convert(ec, in_pos, in_stop, out_pos, out_stop, 0);
-
- if (ret == econv_invalid_byte_sequence ||
- ret == econv_incomplete_input ||
- ret == econv_undefined_conversion) {
- exc = make_econv_exception(ec);
- rb_econv_close(ec);
- rb_exc_raise(exc);
- }
-
- if (ret == econv_destination_buffer_full) {
- more_output_buffer(destination, resize_destination, max_output, &out_start, out_pos, &out_stop);
- goto resume;
- }
-
- rb_econv_close(ec);
- return;
-}
-#else
-/* sample transcode_loop implementation in byte-by-byte stream style */
-static void
-transcode_loop(const unsigned char **in_pos, unsigned char **out_pos,
- const unsigned char *in_stop, unsigned char *out_stop,
- VALUE destination,
- unsigned char *(*resize_destination)(VALUE, int, int),
- const char *src_encoding,
- const char *dst_encoding,
- int ecflags,
- VALUE ecopts)
-{
- rb_econv_t *ec;
- rb_transcoding *last_tc;
- rb_econv_result_t ret;
- unsigned char *out_start = *out_pos;
- const unsigned char *ptr;
- int max_output;
- VALUE exc;
-
- ec = rb_econv_open_opts(src_encoding, dst_encoding, ecflags, ecopts);
- if (!ec)
- rb_exc_raise(rb_econv_open_exc(src_encoding, dst_encoding, ecflags));
-
- last_tc = ec->last_tc;
- max_output = last_tc ? last_tc->transcoder->max_output : 1;
-
- ret = econv_source_buffer_empty;
- ptr = *in_pos;
- while (ret != econv_finished) {
- unsigned char input_byte;
- const unsigned char *p = &input_byte;
-
- if (ret == econv_source_buffer_empty) {
- if (ptr < in_stop) {
- input_byte = *ptr;
- ret = rb_econv_convert(ec, &p, p+1, out_pos, out_stop, ECONV_PARTIAL_INPUT);
- }
- else {
- ret = rb_econv_convert(ec, NULL, NULL, out_pos, out_stop, 0);
- }
- }
- else {
- ret = rb_econv_convert(ec, NULL, NULL, out_pos, out_stop, ECONV_PARTIAL_INPUT);
- }
- if (&input_byte != p)
- ptr += p - &input_byte;
- switch (ret) {
- case econv_invalid_byte_sequence:
- case econv_incomplete_input:
- case econv_undefined_conversion:
- exc = make_econv_exception(ec);
- rb_econv_close(ec);
- rb_exc_raise(exc);
- break;
-
- case econv_destination_buffer_full:
- more_output_buffer(destination, resize_destination, max_output, &out_start, out_pos, &out_stop);
- break;
-
- case econv_source_buffer_empty:
- break;
-
- case econv_finished:
- break;
- }
- }
- rb_econv_close(ec);
- *in_pos = in_stop;
- return;
-}
-#endif
-
-
-/*
- * String-specific code
- */
-
-static unsigned char *
-str_transcoding_resize(VALUE destination, int len, int new_len)
-{
- rb_str_resize(destination, new_len);
- return (unsigned char *)RSTRING_PTR(destination);
-}
-
-static int
-econv_opts(VALUE opt)
-{
- VALUE v;
- int ecflags = 0;
-
- v = rb_hash_aref(opt, sym_invalid);
- if (NIL_P(v)) {
- }
- else if (v==sym_replace) {
- ecflags |= ECONV_INVALID_REPLACE;
- }
- else {
- rb_raise(rb_eArgError, "unknown value for invalid character option");
- }
-
- v = rb_hash_aref(opt, sym_undef);
- if (NIL_P(v)) {
- }
- else if (v==sym_replace) {
- ecflags |= ECONV_UNDEF_REPLACE;
- }
- else {
- rb_raise(rb_eArgError, "unknown value for undefined character option");
- }
-
- v = rb_hash_aref(opt, sym_xml);
- if (!NIL_P(v)) {
- if (v==sym_text) {
- ecflags |= ECONV_XML_TEXT_DECORATOR|ECONV_UNDEF_HEX_CHARREF;
- }
- else if (v==sym_attr) {
- ecflags |= ECONV_XML_ATTR_CONTENT_DECORATOR|ECONV_XML_ATTR_QUOTE_DECORATOR|ECONV_UNDEF_HEX_CHARREF;
- }
- else if (TYPE(v) == T_SYMBOL) {
- rb_raise(rb_eArgError, "unexpected value for xml option: %s", rb_id2name(SYM2ID(v)));
- }
- else {
- rb_raise(rb_eArgError, "unexpected value for xml option");
- }
- }
-
- v = rb_hash_aref(opt, sym_universal_newline);
- if (RTEST(v))
- ecflags |= ECONV_UNIVERSAL_NEWLINE_DECORATOR;
-
- v = rb_hash_aref(opt, sym_crlf_newline);
- if (RTEST(v))
- ecflags |= ECONV_CRLF_NEWLINE_DECORATOR;
-
- v = rb_hash_aref(opt, sym_cr_newline);
- if (RTEST(v))
- ecflags |= ECONV_CR_NEWLINE_DECORATOR;
-
- return ecflags;
-}
-
-int
-rb_econv_prepare_opts(VALUE opthash, VALUE *opts)
-{
- int ecflags;
- VALUE newhash = Qnil;
- VALUE v;
-
- if (NIL_P(opthash)) {
- *opts = Qnil;
- return 0;
- }
- ecflags = econv_opts(opthash);
- v = rb_hash_aref(opthash, sym_replace);
- if (!NIL_P(v)) {
- StringValue(v);
- if (rb_enc_str_coderange(v) == ENC_CODERANGE_BROKEN) {
- VALUE dumped = rb_str_dump(v);
- rb_raise(rb_eArgError, "replacement string is broken: %s as %s",
- StringValueCStr(dumped),
- rb_enc_name(rb_enc_get(v)));
- }
- v = rb_str_new_frozen(v);
- newhash = rb_hash_new();
- rb_hash_aset(newhash, sym_replace, v);
- }
-
- if (!NIL_P(newhash))
- rb_hash_freeze(newhash);
- *opts = newhash;
-
- return ecflags;
-}
-
-rb_econv_t *
-rb_econv_open_opts(const char *source_encoding, const char *destination_encoding, int ecflags, VALUE opthash)
-{
- rb_econv_t *ec;
- VALUE replacement;
-
- if (NIL_P(opthash)) {
- replacement = Qnil;
- }
- else {
- if (TYPE(opthash) != T_HASH || !OBJ_FROZEN(opthash))
- rb_bug("rb_econv_open_opts called with invalid opthash");
- replacement = rb_hash_aref(opthash, sym_replace);
- }
-
- ec = rb_econv_open(source_encoding, destination_encoding, ecflags);
- if (!ec)
- return ec;
-
- if (!NIL_P(replacement)) {
- int ret;
- rb_encoding *enc = rb_enc_get(replacement);
-
- ret = rb_econv_set_replacement(ec,
- (const unsigned char *)RSTRING_PTR(replacement),
- RSTRING_LEN(replacement),
- rb_enc_name(enc));
- if (ret == -1) {
- rb_econv_close(ec);
- return NULL;
- }
- }
- return ec;
-}
-
-static int
-enc_arg(volatile VALUE *arg, const char **name_p, rb_encoding **enc_p)
-{
- rb_encoding *enc;
- const char *n;
- int encidx;
- VALUE encval;
-
- if (((encidx = rb_to_encoding_index(encval = *arg)) < 0) ||
- !(enc = rb_enc_from_index(encidx))) {
- enc = NULL;
- encidx = 0;
- n = StringValueCStr(*arg);
- }
- else {
- n = rb_enc_name(enc);
- }
-
- *name_p = n;
- *enc_p = enc;
-
- return encidx;
-}
-
-static int
-str_transcode_enc_args(VALUE str, volatile VALUE *arg1, volatile VALUE *arg2,
- const char **sname_p, rb_encoding **senc_p,
- const char **dname_p, rb_encoding **denc_p)
-{
- rb_encoding *senc, *denc;
- const char *sname, *dname;
- int sencidx, dencidx;
-
- dencidx = enc_arg(arg1, &dname, &denc);
-
- if (NIL_P(*arg2)) {
- sencidx = rb_enc_get_index(str);
- senc = rb_enc_from_index(sencidx);
- sname = rb_enc_name(senc);
- }
- else {
- sencidx = enc_arg(arg2, &sname, &senc);
- }
-
- *sname_p = sname;
- *senc_p = senc;
- *dname_p = dname;
- *denc_p = denc;
- return dencidx;
-}
-
-static int
-str_transcode0(int argc, VALUE *argv, VALUE *self, int ecflags, VALUE ecopts)
-{
- VALUE dest;
- VALUE str = *self;
- volatile VALUE arg1, arg2;
- long blen, slen;
- unsigned char *buf, *bp, *sp;
- const unsigned char *fromp;
- rb_encoding *senc, *denc;
- const char *sname, *dname;
- int dencidx;
-
- if (argc <0 || argc > 2) {
- rb_raise(rb_eArgError, "wrong number of arguments (%d for 0..2)", argc);
- }
-
- if (argc == 0) {
- arg1 = rb_enc_default_internal();
- if (NIL_P(arg1)) {
- if (!ecflags) return -1;
- arg1 = rb_obj_encoding(str);
- }
- ecflags |= ECONV_INVALID_REPLACE | ECONV_UNDEF_REPLACE;
- }
- else {
- arg1 = argv[0];
- }
- arg2 = argc<=1 ? Qnil : argv[1];
- dencidx = str_transcode_enc_args(str, &arg1, &arg2, &sname, &senc, &dname, &denc);
-
- if ((ecflags & (ECONV_UNIVERSAL_NEWLINE_DECORATOR|
- ECONV_CRLF_NEWLINE_DECORATOR|
- ECONV_CR_NEWLINE_DECORATOR|
- ECONV_XML_TEXT_DECORATOR|
- ECONV_XML_ATTR_CONTENT_DECORATOR|
- ECONV_XML_ATTR_QUOTE_DECORATOR)) == 0) {
- if (senc && senc == denc) {
- return NIL_P(arg2) ? -1 : dencidx;
- }
- if (senc && denc && rb_enc_asciicompat(senc) && rb_enc_asciicompat(denc)) {
- if (ENC_CODERANGE(str) == ENC_CODERANGE_7BIT) {
- return dencidx;
- }
- }
- if (encoding_equal(sname, dname)) {
- return NIL_P(arg2) ? -1 : dencidx;
- }
- }
- else {
- if (encoding_equal(sname, dname)) {
- sname = "";
- dname = "";
- }
- }
-
- fromp = sp = (unsigned char *)RSTRING_PTR(str);
- slen = RSTRING_LEN(str);
- blen = slen + 30; /* len + margin */
- dest = rb_str_tmp_new(blen);
- bp = (unsigned char *)RSTRING_PTR(dest);
-
- transcode_loop(&fromp, &bp, (sp+slen), (bp+blen), dest, str_transcoding_resize, sname, dname, ecflags, ecopts);
- if (fromp != sp+slen) {
- rb_raise(rb_eArgError, "not fully converted, %"PRIdPTRDIFF" bytes left", sp+slen-fromp);
- }
- buf = (unsigned char *)RSTRING_PTR(dest);
- *bp = '\0';
- rb_str_set_len(dest, bp - buf);
-
- /* set encoding */
- if (!denc) {
- dencidx = rb_define_dummy_encoding(dname);
- }
- *self = dest;
-
- return dencidx;
-}
-
-static int
-str_transcode(int argc, VALUE *argv, VALUE *self)
-{
- VALUE opt;
- int ecflags = 0;
- VALUE ecopts = Qnil;
-
- if (0 < argc) {
- opt = rb_check_convert_type(argv[argc-1], T_HASH, "Hash", "to_hash");
- if (!NIL_P(opt)) {
- argc--;
- ecflags = rb_econv_prepare_opts(opt, &ecopts);
- }
- }
- return str_transcode0(argc, argv, self, ecflags, ecopts);
-}
-
-static inline VALUE
-str_encode_associate(VALUE str, int encidx)
-{
- int cr = 0;
-
- rb_enc_associate_index(str, encidx);
-
- /* transcoded string never be broken. */
- if (rb_enc_asciicompat(rb_enc_from_index(encidx))) {
- rb_str_coderange_scan_restartable(RSTRING_PTR(str), RSTRING_END(str), 0, &cr);
- }
- else {
- cr = ENC_CODERANGE_VALID;
- }
- ENC_CODERANGE_SET(str, cr);
- return str;
-}
-
-/*
- * call-seq:
- * str.encode!(encoding [, options] ) => str
- * str.encode!(dst_encoding, src_encoding [, options] ) => str
- *
- * The first form transcodes the contents of <i>str</i> from
- * str.encoding to +encoding+.
- * The second form transcodes the contents of <i>str</i> from
- * src_encoding to dst_encoding.
- * The options Hash gives details for conversion. See String#encode
- * for details.
- * Returns the string even if no changes were made.
- */
-
-static VALUE
-str_encode_bang(int argc, VALUE *argv, VALUE str)
-{
- VALUE newstr = str;
- int encidx = str_transcode(argc, argv, &newstr);
-
- if (encidx < 0) return str;
- rb_str_shared_replace(str, newstr);
- return str_encode_associate(str, encidx);
-}
-
-/*
- * call-seq:
- * str.encode(encoding [, options] ) => str
- * str.encode(dst_encoding, src_encoding [, options] ) => str
- * str.encode([options]) => str
- *
- * The first form returns a copy of <i>str</i> transcoded
- * to encoding +encoding+.
- * The second form returns a copy of <i>str</i> transcoded
- * from src_encoding to dst_encoding.
- * The last form returns a copy of <i>str</i> transcoded to
- * <code>Encoding.default_internal</code>.
- * By default, the first and second form raise
- * Encoding::UndefinedConversionError for characters that are
- * undefined in the destination encoding, and
- * Encoding::InvalidByteSequenceError for invalid byte sequences
- * in the source encoding. The last form by default does not raise
- * exceptions but uses replacement strings.
- * The <code>options</code> Hash gives details for conversion.
- *
- * === options
- * The hash <code>options</code> can have the following keys:
- * :invalid ::
- * If the value is <code>:replace</code>, <code>#encode</code> replaces
- * invalid byte sequences in <code>str</code> with the replacement character.
- * The default is to raise the exception
- * :undef ::
- * If the value is <code>:replace</code>, <code>#encode</code> replaces
- * characters which are undefined in the destination encoding with
- * the replacement character.
- * :replace ::
- * Sets the replacement string to the value. The default replacement
- * string is "\uFFFD" for Unicode encoding forms, and "?" otherwise.
- * :xml ::
- * The value must be <code>:text</code> or <code>:attr</code>.
- * If the value is <code>:text</code> <code>#encode</code> replaces
- * undefined characters with their (upper-case hexadecimal) numeric
- * character references. '&', '<', and '>' are converted to "&amp;",
- * "&lt;", and "&gt;", respectively.
- * If the value is <code>:attr</code>, <code>#encode</code> also quotes
- * the replacement result (using '"'), and replaces '"' with "&quot;".
- * :cr_newline ::
- * Replaces LF ("\n") with CR ("\r") if value is true.
- * :crlf_newline ::
- * Replaces LF ("\n") with CRLF ("\r\n") if value is true.
- * :universal_newline ::
- * Replaces CRLF ("\r\n") and CR ("\r") with LF ("\n") if value is true.
- */
-
-static VALUE
-str_encode(int argc, VALUE *argv, VALUE str)
-{
- VALUE newstr = str;
- int encidx = str_transcode(argc, argv, &newstr);
-
- if (encidx < 0) return rb_str_dup(str);
- if (newstr == str) {
- newstr = rb_str_dup(str);
- }
- else {
- RBASIC(newstr)->klass = rb_obj_class(str);
- }
- return str_encode_associate(newstr, encidx);
-}
-
-VALUE
-rb_str_encode(VALUE str, VALUE to, int ecflags, VALUE ecopts)
-{
- int argc = 1;
- VALUE *argv = &to;
- VALUE newstr = str;
- int encidx = str_transcode0(argc, argv, &newstr, ecflags, ecopts);
-
- if (encidx < 0) return rb_str_dup(str);
- RBASIC(newstr)->klass = rb_obj_class(str);
- return str_encode_associate(newstr, encidx);
-}
-
-static void
-econv_free(rb_econv_t *ec)
-{
- rb_econv_close(ec);
-}
-
-static VALUE
-econv_s_allocate(VALUE klass)
-{
- return Data_Wrap_Struct(klass, NULL, econv_free, NULL);
-}
-
-static rb_encoding *
-make_dummy_encoding(const char *name)
-{
- rb_encoding *enc;
- int idx;
- idx = rb_define_dummy_encoding(name);
- enc = rb_enc_from_index(idx);
- return enc;
-}
-
-static rb_encoding *
-make_encoding(const char *name)
-{
- rb_encoding *enc;
- enc = rb_enc_find(name);
- if (!enc)
- enc = make_dummy_encoding(name);
- return enc;
-}
-
-static VALUE
-make_encobj(const char *name)
-{
- return rb_enc_from_encoding(make_encoding(name));
-}
-
-/*
- * call-seq:
- * Encoding::Converter.asciicompat_encoding(string) => encoding or nil
- * Encoding::Converter.asciicompat_encoding(encoding) => encoding or nil
- *
- * Returns the corresponding ASCII compatible encoding.
- *
- * Returns nil if the argument is an ASCII compatible encoding.
- *
- * "corresponding ASCII compatible encoding" is a ASCII compatible encoding which
- * can represents exactly the same characters as the given ASCII incompatible encoding.
- * So, no conversion undefined error occurs when converting between the two encodings.
- *
- * Encoding::Converter.asciicompat_encoding("ISO-2022-JP") #=> #<Encoding:stateless-ISO-2022-JP>
- * Encoding::Converter.asciicompat_encoding("UTF-16BE") #=> #<Encoding:UTF-8>
- * Encoding::Converter.asciicompat_encoding("UTF-8") #=> nil
- *
- */
-static VALUE
-econv_s_asciicompat_encoding(VALUE klass, VALUE arg)
-{
- const char *arg_name, *result_name;
- rb_encoding *arg_enc, *result_enc;
-
- enc_arg(&arg, &arg_name, &arg_enc);
-
- result_name = rb_econv_asciicompat_encoding(arg_name);
-
- if (result_name == NULL)
- return Qnil;
-
- result_enc = make_encoding(result_name);
-
- return rb_enc_from_encoding(result_enc);
-}
-
-static void
-econv_args(int argc, VALUE *argv,
- volatile VALUE *snamev_p, volatile VALUE *dnamev_p,
- const char **sname_p, const char **dname_p,
- rb_encoding **senc_p, rb_encoding **denc_p,
- int *ecflags_p,
- VALUE *ecopts_p)
-{
- VALUE opt, opthash, flags_v, ecopts;
- int sidx, didx;
- const char *sname, *dname;
- rb_encoding *senc, *denc;
- int ecflags;
-
- rb_scan_args(argc, argv, "21", snamev_p, dnamev_p, &opt);
-
- if (NIL_P(opt)) {
- ecflags = 0;
- ecopts = Qnil;
- }
- else if (!NIL_P(flags_v = rb_check_to_integer(opt, "to_int"))) {
- ecflags = NUM2INT(flags_v);
- ecopts = Qnil;
- }
- else {
- opthash = rb_convert_type(opt, T_HASH, "Hash", "to_hash");
- ecflags = rb_econv_prepare_opts(opthash, &ecopts);
- }
-
- senc = NULL;
- sidx = rb_to_encoding_index(*snamev_p);
- if (0 <= sidx) {
- senc = rb_enc_from_index(sidx);
- }
- else {
- StringValue(*snamev_p);
- }
-
- denc = NULL;
- didx = rb_to_encoding_index(*dnamev_p);
- if (0 <= didx) {
- denc = rb_enc_from_index(didx);
- }
- else {
- StringValue(*dnamev_p);
- }
-
- sname = senc ? rb_enc_name(senc) : StringValueCStr(*snamev_p);
- dname = denc ? rb_enc_name(denc) : StringValueCStr(*dnamev_p);
-
- *sname_p = sname;
- *dname_p = dname;
- *senc_p = senc;
- *denc_p = denc;
- *ecflags_p = ecflags;
- *ecopts_p = ecopts;
-}
-
-static int
-decorate_convpath(VALUE convpath, int ecflags)
-{
- int num_decorators;
- const char *decorators[MAX_ECFLAGS_DECORATORS];
- int i;
- int n, len;
-
- num_decorators = decorator_names(ecflags, decorators);
- if (num_decorators == -1)
- return -1;
-
- len = n = RARRAY_LEN(convpath);
- if (n != 0) {
- VALUE pair = RARRAY_PTR(convpath)[n-1];
- if (TYPE(pair) == T_ARRAY) {
- const char *sname = rb_enc_name(rb_to_encoding(RARRAY_PTR(pair)[0]));
- const char *dname = rb_enc_name(rb_to_encoding(RARRAY_PTR(pair)[1]));
- transcoder_entry_t *entry = get_transcoder_entry(sname, dname);
- const rb_transcoder *tr = load_transcoder_entry(entry);
- if (!tr)
- return -1;
- if (!DECORATOR_P(tr->src_encoding, tr->dst_encoding) &&
- tr->asciicompat_type == asciicompat_encoder) {
- n--;
- rb_ary_store(convpath, len + num_decorators - 1, pair);
- }
- }
- else {
- rb_ary_store(convpath, len + num_decorators - 1, pair);
- }
- }
-
- for (i = 0; i < num_decorators; i++)
- rb_ary_store(convpath, n + i, rb_str_new_cstr(decorators[i]));
-
- return 0;
-}
-
-static void
-search_convpath_i(const char *sname, const char *dname, int depth, void *arg)
-{
- VALUE *ary_p = arg;
- VALUE v;
-
- if (*ary_p == Qnil) {
- *ary_p = rb_ary_new();
- }
-
- if (DECORATOR_P(sname, dname)) {
- v = rb_str_new_cstr(dname);
- }
- else {
- v = rb_assoc_new(make_encobj(sname), make_encobj(dname));
- }
- rb_ary_store(*ary_p, depth, v);
-}
-
-/*
- * call-seq:
- * Encoding::Converter.search_convpath(source_encoding, destination_encoding) -> ary
- * Encoding::Converter.search_convpath(source_encoding, destination_encoding, opt) -> ary
- *
- * Returns a conversion path.
- *
- * p Encoding::Converter.search_convpath("ISO-8859-1", "EUC-JP")
- * #=> [[#<Encoding:ISO-8859-1>, #<Encoding:UTF-8>],
- * # [#<Encoding:UTF-8>, #<Encoding:EUC-JP>]]
- *
- * p Encoding::Converter.search_convpath("ISO-8859-1", "EUC-JP", universal_newline: true)
- * #=> [[#<Encoding:ISO-8859-1>, #<Encoding:UTF-8>],
- * # [#<Encoding:UTF-8>, #<Encoding:EUC-JP>],
- * # "universal_newline"]
- *
- * p Encoding::Converter.search_convpath("ISO-8859-1", "UTF-32BE", universal_newline: true)
- * #=> [[#<Encoding:ISO-8859-1>, #<Encoding:UTF-8>],
- * # "universal_newline",
- * # [#<Encoding:UTF-8>, #<Encoding:UTF-32BE>]]
- */
-static VALUE
-econv_s_search_convpath(int argc, VALUE *argv, VALUE klass)
-{
- volatile VALUE snamev, dnamev;
- const char *sname, *dname;
- rb_encoding *senc, *denc;
- int ecflags;
- VALUE ecopts;
- VALUE convpath;
-
- econv_args(argc, argv, &snamev, &dnamev, &sname, &dname, &senc, &denc, &ecflags, &ecopts);
-
- convpath = Qnil;
- transcode_search_path(sname, dname, search_convpath_i, &convpath);
-
- if (NIL_P(convpath))
- rb_exc_raise(rb_econv_open_exc(sname, dname, ecflags));
-
- if (decorate_convpath(convpath, ecflags) == -1)
- rb_exc_raise(rb_econv_open_exc(sname, dname, ecflags));
-
- return convpath;
-}
-
-/*
- * Check the existence of a conversion path.
- * Returns the number of converters in the conversion path.
- * result: >=0:success -1:failure
- */
-int
-rb_econv_has_convpath_p(const char* from_encoding, const char* to_encoding)
-{
- VALUE convpath = Qnil;
- transcode_search_path(from_encoding, to_encoding, search_convpath_i,
- &convpath);
- return RTEST(convpath);
-}
-
-struct rb_econv_init_by_convpath_t {
- rb_econv_t *ec;
- int index;
- int ret;
-};
-
-static void
-rb_econv_init_by_convpath_i(const char *sname, const char *dname, int depth, void *arg)
-{
- struct rb_econv_init_by_convpath_t *a = (struct rb_econv_init_by_convpath_t *)arg;
- int ret;
-
- if (a->ret == -1)
- return;
-
- ret = rb_econv_add_converter(a->ec, sname, dname, a->index);
-
- a->ret = ret;
- return;
-}
-
-static rb_econv_t *
-rb_econv_init_by_convpath(VALUE self, VALUE convpath,
- const char **sname_p, const char **dname_p,
- rb_encoding **senc_p, rb_encoding**denc_p)
-{
- rb_econv_t *ec;
- long i;
- int ret, first=1;
- VALUE elt;
- rb_encoding *senc = 0, *denc = 0;
- const char *sname, *dname;
-
- ec = rb_econv_alloc(RARRAY_LEN(convpath));
- DATA_PTR(self) = ec;
-
- for (i = 0; i < RARRAY_LEN(convpath); i++) {
- volatile VALUE snamev, dnamev;
- VALUE pair;
- elt = rb_ary_entry(convpath, i);
- if (!NIL_P(pair = rb_check_array_type(elt))) {
- if (RARRAY_LEN(pair) != 2)
- rb_raise(rb_eArgError, "not a 2-element array in convpath");
- snamev = rb_ary_entry(pair, 0);
- enc_arg(&snamev, &sname, &senc);
- dnamev = rb_ary_entry(pair, 1);
- enc_arg(&dnamev, &dname, &denc);
- }
- else {
- sname = "";
- dname = StringValueCStr(elt);
- }
- if (DECORATOR_P(sname, dname)) {
- ret = rb_econv_add_converter(ec, sname, dname, ec->num_trans);
- if (ret == -1)
- rb_raise(rb_eArgError, "decoration failed: %s", dname);
- }
- else {
- int j = ec->num_trans;
- struct rb_econv_init_by_convpath_t arg;
- arg.ec = ec;
- arg.index = ec->num_trans;
- arg.ret = 0;
- ret = transcode_search_path(sname, dname, rb_econv_init_by_convpath_i, &arg);
- if (ret == -1 || arg.ret == -1)
- rb_raise(rb_eArgError, "adding conversion failed: %s to %s", sname, dname);
- if (first) {
- first = 0;
- *senc_p = senc;
- *sname_p = ec->elems[j].tc->transcoder->src_encoding;
- }
- *denc_p = denc;
- *dname_p = ec->elems[ec->num_trans-1].tc->transcoder->dst_encoding;
- }
- }
-
- if (first) {
- *senc_p = NULL;
- *denc_p = NULL;
- *sname_p = "";
- *dname_p = "";
- }
-
- ec->source_encoding_name = *sname_p;
- ec->destination_encoding_name = *dname_p;
-
- return ec;
-}
-
-/*
- * call-seq:
- * Encoding::Converter.new(source_encoding, destination_encoding)
- * Encoding::Converter.new(source_encoding, destination_encoding, opt)
- * Encoding::Converter.new(convpath)
- *
- * possible options elements:
- * hash form:
- * :invalid => nil # raise error on invalid byte sequence (default)
- * :invalid => :replace # replace invalid byte sequence
- * :undef => nil # raise error on undefined conversion (default)
- * :undef => :replace # replace undefined conversion
- * :replace => string # replacement string ("?" or "\uFFFD" if not specified)
- * :universal_newline => true # decorator for converting CRLF and CR to LF
- * :crlf_newline => true # decorator for converting LF to CRLF
- * :cr_newline => true # decorator for converting LF to CR
- * :xml => :text # escape as XML CharData.
- * :xml => :attr # escape as XML AttValue
- * integer form:
- * Encoding::Converter::INVALID_REPLACE
- * Encoding::Converter::UNDEF_REPLACE
- * Encoding::Converter::UNDEF_HEX_CHARREF
- * Encoding::Converter::UNIVERSAL_NEWLINE_DECORATOR
- * Encoding::Converter::CRLF_NEWLINE_DECORATOR
- * Encoding::Converter::CR_NEWLINE_DECORATOR
- * Encoding::Converter::XML_TEXT_DECORATOR
- * Encoding::Converter::XML_ATTR_CONTENT_DECORATOR
- * Encoding::Converter::XML_ATTR_QUOTE_DECORATOR
- *
- * Encoding::Converter.new creates an instance of Encoding::Converter.
- *
- * Source_encoding and destination_encoding should be a string or
- * Encoding object.
- *
- * opt should be nil, a hash or an integer.
- *
- * convpath should be an array.
- * convpath may contain
- * - two-element arrays which contain encodings or encoding names, or
- * - strings representing decorator names.
- *
- * Encoding::Converter.new optionally takes an option.
- * The option should be a hash or an integer.
- * The option hash can contain :invalid => nil, etc.
- * The option integer should be logical-or of constants such as
- * Encoding::Converter::INVALID_REPLACE, etc.
- *
- * [:invalid => nil]
- * Raise error on invalid byte sequence. This is a default behavior.
- * [:invalid => :replace]
- * Replace invalid byte sequence by replacement string.
- * [:undef => nil]
- * Raise an error if a character in source_encoding is not defined in destination_encoding.
- * This is a default behavior.
- * [:undef => :replace]
- * Replace undefined character in destination_encoding with replacement string.
- * [:replace => string]
- * Specify the replacement string.
- * If not specified, "\uFFFD" is used for Unicode encodings and "?" for others.
- * [:universal_newline => true]
- * Convert CRLF and CR to LF.
- * [:crlf_newline => true]
- * Convert LF to CRLF.
- * [:cr_newline => true]
- * Convert LF to CR.
- * [:xml => :text]
- * Escape as XML CharData.
- * This form can be used as a HTML 4.0 #PCDATA.
- * - '&' -> '&amp;'
- * - '<' -> '&lt;'
- * - '>' -> '&gt;'
- * - undefined characters in destination_encoding -> hexadecimal CharRef such as &#xHH;
- * [:xml => :attr]
- * Escape as XML AttValue.
- * The converted result is quoted as "...".
- * This form can be used as a HTML 4.0 attribute value.
- * - '&' -> '&amp;'
- * - '<' -> '&lt;'
- * - '>' -> '&gt;'
- * - '"' -> '&quot;'
- * - undefined characters in destination_encoding -> hexadecimal CharRef such as &#xHH;
- *
- * Examples:
- * # UTF-16BE to UTF-8
- * ec = Encoding::Converter.new("UTF-16BE", "UTF-8")
- *
- * # Usually, decorators such as newline conversion are inserted last.
- * ec = Encoding::Converter.new("UTF-16BE", "UTF-8", :universal_newline => true)
- * p ec.convpath #=> [[#<Encoding:UTF-16BE>, #<Encoding:UTF-8>],
- * # "universal_newline"]
- *
- * # But, if the last encoding is ASCII incompatible,
- * # decorators are inserted before the last conversion.
- * ec = Encoding::Converter.new("UTF-8", "UTF-16BE", :crlf_newline => true)
- * p ec.convpath #=> ["crlf_newline",
- * # [#<Encoding:UTF-8>, #<Encoding:UTF-16BE>]]
- *
- * # Conversion path can be specified directly.
- * ec = Encoding::Converter.new(["universal_newline", ["EUC-JP", "UTF-8"], ["UTF-8", "UTF-16BE"]])
- * p ec.convpath #=> ["universal_newline",
- * # [#<Encoding:EUC-JP>, #<Encoding:UTF-8>],
- * # [#<Encoding:UTF-8>, #<Encoding:UTF-16BE>]]
- */
-static VALUE
-econv_init(int argc, VALUE *argv, VALUE self)
-{
- VALUE ecopts;
- volatile VALUE snamev, dnamev;
- const char *sname, *dname;
- rb_encoding *senc, *denc;
- rb_econv_t *ec;
- int ecflags;
- VALUE convpath;
-
- if (DATA_PTR(self)) {
- rb_raise(rb_eTypeError, "already initialized");
- }
-
- if (argc == 1 && !NIL_P(convpath = rb_check_array_type(argv[0]))) {
- ec = rb_econv_init_by_convpath(self, convpath, &sname, &dname, &senc, &denc);
- ecflags = 0;
- ecopts = Qnil;
- }
- else {
- econv_args(argc, argv, &snamev, &dnamev, &sname, &dname, &senc, &denc, &ecflags, &ecopts);
- ec = rb_econv_open_opts(sname, dname, ecflags, ecopts);
- }
-
- if (!ec) {
- rb_exc_raise(rb_econv_open_exc(sname, dname, ecflags));
- }
-
- if (!DECORATOR_P(sname, dname)) {
- if (!senc)
- senc = make_dummy_encoding(sname);
- if (!denc)
- denc = make_dummy_encoding(dname);
- }
-
- ec->source_encoding = senc;
- ec->destination_encoding = denc;
-
- DATA_PTR(self) = ec;
-
- return self;
-}
-
-/*
- * call-seq:
- * ec.inspect -> string
- *
- * Returns a printable version of <i>ec</i>
- *
- * ec = Encoding::Converter.new("iso-8859-1", "utf-8")
- * puts ec.inspect #=> #<Encoding::Converter: ISO-8859-1 to UTF-8>
- *
- */
-static VALUE
-econv_inspect(VALUE self)
-{
- const char *cname = rb_obj_classname(self);
- rb_econv_t *ec = DATA_PTR(self);
-
- if (!ec)
- return rb_sprintf("#<%s: uninitialized>", cname);
- else {
- const char *sname = ec->source_encoding_name;
- const char *dname = ec->destination_encoding_name;
- VALUE str;
- str = rb_sprintf("#<%s: ", cname);
- econv_description(sname, dname, ec->flags, str);
- rb_str_cat2(str, ">");
- return str;
- }
-}
-
-#define IS_ECONV(obj) (RDATA(obj)->dfree == (RUBY_DATA_FUNC)econv_free)
-
-static rb_econv_t *
-check_econv(VALUE self)
-{
- Check_Type(self, T_DATA);
- if (!IS_ECONV(self)) {
- rb_raise(rb_eTypeError, "wrong argument type %s (expected Encoding::Converter)",
- rb_class2name(CLASS_OF(self)));
- }
- if (!DATA_PTR(self)) {
- rb_raise(rb_eTypeError, "uninitialized encoding converter");
- }
- return DATA_PTR(self);
-}
-
-/*
- * call-seq:
- * ec.source_encoding -> encoding
- *
- * Returns the source encoding as an Encoding object.
- */
-static VALUE
-econv_source_encoding(VALUE self)
-{
- rb_econv_t *ec = check_econv(self);
- if (!ec->source_encoding)
- return Qnil;
- return rb_enc_from_encoding(ec->source_encoding);
-}
-
-/*
- * call-seq:
- * ec.destination_encoding -> encoding
- *
- * Returns the destination encoding as an Encoding object.
- */
-static VALUE
-econv_destination_encoding(VALUE self)
-{
- rb_econv_t *ec = check_econv(self);
- if (!ec->destination_encoding)
- return Qnil;
- return rb_enc_from_encoding(ec->destination_encoding);
-}
-
-/*
- * call-seq:
- * ec.convpath -> ary
- *
- * Returns the conversion path of ec.
- *
- * The result is an array of conversions.
- *
- * ec = Encoding::Converter.new("ISo-8859-1", "EUC-JP", crlf_newline: true)
- * p ec.convpath
- * #=> [[#<Encoding:ISO-8859-1>, #<Encoding:UTF-8>],
- * # [#<Encoding:UTF-8>, #<Encoding:EUC-JP>],
- * # "crlf_newline"]
- *
- * Each element of the array is a pair of encodings or a string.
- * A pair means an encoding conversion.
- * A string means a decorator.
- *
- * In the above example, [#<Encoding:ISO-8859-1>, #<Encoding:UTF-8>] means
- * a converter from ISO-8859-1 to UTF-8.
- * "crlf_newline" means newline converter from LF to CRLF.
- */
-static VALUE
-econv_convpath(VALUE self)
-{
- rb_econv_t *ec = check_econv(self);
- VALUE result;
- int i;
-
- result = rb_ary_new();
- for (i = 0; i < ec->num_trans; i++) {
- const rb_transcoder *tr = ec->elems[i].tc->transcoder;
- VALUE v;
- if (DECORATOR_P(tr->src_encoding, tr->dst_encoding))
- v = rb_str_new_cstr(tr->dst_encoding);
- else
- v = rb_assoc_new(make_encobj(tr->src_encoding), make_encobj(tr->dst_encoding));
- rb_ary_push(result, v);
- }
- return result;
-}
-
-static VALUE
-econv_result_to_symbol(rb_econv_result_t res)
-{
- switch (res) {
- case econv_invalid_byte_sequence: return sym_invalid_byte_sequence;
- case econv_incomplete_input: return sym_incomplete_input;
- case econv_undefined_conversion: return sym_undefined_conversion;
- case econv_destination_buffer_full: return sym_destination_buffer_full;
- case econv_source_buffer_empty: return sym_source_buffer_empty;
- case econv_finished: return sym_finished;
- case econv_after_output: return sym_after_output;
- default: return INT2NUM(res); /* should not be reached */
- }
-}
-
-/*
- * call-seq:
- * ec.primitive_convert(source_buffer, destination_buffer) -> symbol
- * ec.primitive_convert(source_buffer, destination_buffer, destination_byteoffset) -> symbol
- * ec.primitive_convert(source_buffer, destination_buffer, destination_byteoffset, destination_bytesize) -> symbol
- * ec.primitive_convert(source_buffer, destination_buffer, destination_byteoffset, destination_bytesize, opt) -> symbol
- *
- * possible opt elements:
- * hash form:
- * :partial_input => true # source buffer may be part of larger source
- * :after_output => true # stop conversion after output before input
- * integer form:
- * Encoding::Converter::PARTIAL_INPUT
- * Encoding::Converter::AFTER_OUTPUT
- *
- * possible results:
- * :invalid_byte_sequence
- * :incomplete_input
- * :undefined_conversion
- * :after_output
- * :destination_buffer_full
- * :source_buffer_empty
- * :finished
- *
- * primitive_convert converts source_buffer into destination_buffer.
- *
- * source_buffer should be a string or nil.
- * nil means a empty string.
- *
- * destination_buffer should be a string.
- *
- * destination_byteoffset should be an integer or nil.
- * nil means the end of destination_buffer.
- * If it is omitted, nil is assumed.
- *
- * destination_bytesize should be an integer or nil.
- * nil means unlimited.
- * If it is omitted, nil is assumed.
- *
- * opt should be nil, a hash or an integer.
- * nil means no flags.
- * If it is omitted, nil is assumed.
- *
- * primitive_convert converts the content of source_buffer from beginning
- * and store the result into destination_buffer.
- *
- * destination_byteoffset and destination_bytesize specify the region which
- * the converted result is stored.
- * destination_byteoffset specifies the start position in destination_buffer in bytes.
- * If destination_byteoffset is nil,
- * destination_buffer.bytesize is used for appending the result.
- * destination_bytesize specifies maximum number of bytes.
- * If destination_bytesize is nil,
- * destination size is unlimited.
- * After conversion, destination_buffer is resized to
- * destination_byteoffset + actually produced number of bytes.
- * Also destination_buffer's encoding is set to destination_encoding.
- *
- * primitive_convert drops the converted part of source_buffer.
- * the dropped part is converted in destination_buffer or
- * buffered in Encoding::Converter object.
- *
- * primitive_convert stops conversion when one of following condition met.
- * - invalid byte sequence found in source buffer (:invalid_byte_sequence)
- * - unexpected end of source buffer (:incomplete_input)
- * this occur only when :partial_input is not specified.
- * - character not representable in output encoding (:undefined_conversion)
- * - after some output is generated, before input is done (:after_output)
- * this occur only when :after_output is specified.
- * - destination buffer is full (:destination_buffer_full)
- * this occur only when destination_bytesize is non-nil.
- * - source buffer is empty (:source_buffer_empty)
- * this occur only when :partial_input is specified.
- * - conversion is finished (:finished)
- *
- * example:
- * ec = Encoding::Converter.new("UTF-8", "UTF-16BE")
- * ret = ec.primitive_convert(src="pi", dst="", nil, 100)
- * p [ret, src, dst] #=> [:finished, "", "\x00p\x00i"]
- *
- * ec = Encoding::Converter.new("UTF-8", "UTF-16BE")
- * ret = ec.primitive_convert(src="pi", dst="", nil, 1)
- * p [ret, src, dst] #=> [:destination_buffer_full, "i", "\x00"]
- * ret = ec.primitive_convert(src, dst="", nil, 1)
- * p [ret, src, dst] #=> [:destination_buffer_full, "", "p"]
- * ret = ec.primitive_convert(src, dst="", nil, 1)
- * p [ret, src, dst] #=> [:destination_buffer_full, "", "\x00"]
- * ret = ec.primitive_convert(src, dst="", nil, 1)
- * p [ret, src, dst] #=> [:finished, "", "i"]
- *
- */
-static VALUE
-econv_primitive_convert(int argc, VALUE *argv, VALUE self)
-{
- VALUE input, output, output_byteoffset_v, output_bytesize_v, opt, flags_v;
- rb_econv_t *ec = check_econv(self);
- rb_econv_result_t res;
- const unsigned char *ip, *is;
- unsigned char *op, *os;
- long output_byteoffset, output_bytesize;
- unsigned long output_byteend;
- int flags;
-
- rb_scan_args(argc, argv, "23", &input, &output, &output_byteoffset_v, &output_bytesize_v, &opt);
-
- if (NIL_P(output_byteoffset_v))
- output_byteoffset = 0; /* dummy */
- else
- output_byteoffset = NUM2LONG(output_byteoffset_v);
-
- if (NIL_P(output_bytesize_v))
- output_bytesize = 0; /* dummy */
- else
- output_bytesize = NUM2LONG(output_bytesize_v);
-
- if (NIL_P(opt)) {
- flags = 0;
- }
- else if (!NIL_P(flags_v = rb_check_to_integer(opt, "to_int"))) {
- flags = NUM2INT(flags_v);
- }
- else {
- VALUE v;
- opt = rb_convert_type(opt, T_HASH, "Hash", "to_hash");
- flags = 0;
- v = rb_hash_aref(opt, sym_partial_input);
- if (RTEST(v))
- flags |= ECONV_PARTIAL_INPUT;
- v = rb_hash_aref(opt, sym_after_output);
- if (RTEST(v))
- flags |= ECONV_AFTER_OUTPUT;
- }
-
- StringValue(output);
- if (!NIL_P(input))
- StringValue(input);
- rb_str_modify(output);
-
- if (NIL_P(output_bytesize_v)) {
- output_bytesize = RSTRING_EMBED_LEN_MAX;
- if (!NIL_P(input) && output_bytesize < RSTRING_LEN(input))
- output_bytesize = RSTRING_LEN(input);
- }
-
- retry:
-
- if (NIL_P(output_byteoffset_v))
- output_byteoffset = RSTRING_LEN(output);
-
- if (output_byteoffset < 0)
- rb_raise(rb_eArgError, "negative output_byteoffset");
-
- if (RSTRING_LEN(output) < output_byteoffset)
- rb_raise(rb_eArgError, "output_byteoffset too big");
-
- if (output_bytesize < 0)
- rb_raise(rb_eArgError, "negative output_bytesize");
-
- output_byteend = (unsigned long)output_byteoffset +
- (unsigned long)output_bytesize;
-
- if (output_byteend < (unsigned long)output_byteoffset ||
- LONG_MAX < output_byteend)
- rb_raise(rb_eArgError, "output_byteoffset+output_bytesize too big");
-
- if (rb_str_capacity(output) < output_byteend)
- rb_str_resize(output, output_byteend);
-
- if (NIL_P(input)) {
- ip = is = NULL;
- }
- else {
- ip = (const unsigned char *)RSTRING_PTR(input);
- is = ip + RSTRING_LEN(input);
- }
-
- op = (unsigned char *)RSTRING_PTR(output) + output_byteoffset;
- os = op + output_bytesize;
-
- res = rb_econv_convert(ec, &ip, is, &op, os, flags);
- rb_str_set_len(output, op-(unsigned char *)RSTRING_PTR(output));
- if (!NIL_P(input))
- rb_str_drop_bytes(input, ip - (unsigned char *)RSTRING_PTR(input));
-
- if (NIL_P(output_bytesize_v) && res == econv_destination_buffer_full) {
- if (LONG_MAX / 2 < output_bytesize)
- rb_raise(rb_eArgError, "too long conversion result");
- output_bytesize *= 2;
- output_byteoffset_v = Qnil;
- goto retry;
- }
-
- if (ec->destination_encoding) {
- rb_enc_associate(output, ec->destination_encoding);
- }
-
- return econv_result_to_symbol(res);
-}
-
-/*
- * call-seq:
- * ec.convert(source_string) -> destination_string
- *
- * Convert source_string and return destination_string.
- *
- * source_string is assumed as a part of source.
- * i.e. :partial_input=>true is specified internally.
- * finish method should be used last.
- *
- * ec = Encoding::Converter.new("utf-8", "euc-jp")
- * puts ec.convert("\u3042").dump #=> "\xA4\xA2"
- * puts ec.finish.dump #=> ""
- *
- * ec = Encoding::Converter.new("euc-jp", "utf-8")
- * puts ec.convert("\xA4").dump #=> ""
- * puts ec.convert("\xA2").dump #=> "\xE3\x81\x82"
- * puts ec.finish.dump #=> ""
- *
- * ec = Encoding::Converter.new("utf-8", "iso-2022-jp")
- * puts ec.convert("\xE3").dump #=> "".force_encoding("ISO-2022-JP")
- * puts ec.convert("\x81").dump #=> "".force_encoding("ISO-2022-JP")
- * puts ec.convert("\x82").dump #=> "\e$B$\"".force_encoding("ISO-2022-JP")
- * puts ec.finish.dump #=> "\e(B".force_encoding("ISO-2022-JP")
- *
- * If a conversion error occur,
- * Encoding::UndefinedConversionError or
- * Encoding::InvalidByteSequenceError is raised.
- * Encoding::Converter#convert doesn't supply methods to recover or restart
- * from these exceptions.
- * When you want to handle these conversion errors,
- * use Encoding::Converter#primitive_convert.
- *
- */
-static VALUE
-econv_convert(VALUE self, VALUE source_string)
-{
- VALUE ret, dst;
- VALUE av[5];
- int ac;
- rb_econv_t *ec = check_econv(self);
-
- StringValue(source_string);
-
- dst = rb_str_new(NULL, 0);
-
- av[0] = rb_str_dup(source_string);
- av[1] = dst;
- av[2] = Qnil;
- av[3] = Qnil;
- av[4] = INT2NUM(ECONV_PARTIAL_INPUT);
- ac = 5;
-
- ret = econv_primitive_convert(ac, av, self);
-
- if (ret == sym_invalid_byte_sequence ||
- ret == sym_undefined_conversion ||
- ret == sym_incomplete_input) {
- VALUE exc = make_econv_exception(ec);
- rb_exc_raise(exc);
- }
-
- if (ret == sym_finished) {
- rb_raise(rb_eArgError, "converter already finished");
- }
-
- if (ret != sym_source_buffer_empty) {
- rb_bug("unexpected result of econv_primitive_convert");
- }
-
- return dst;
-}
-
-/*
- * call-seq:
- * ec.finish -> string
- *
- * Finishes the converter.
- * It returns the last part of the converted string.
- *
- * ec = Encoding::Converter.new("utf-8", "iso-2022-jp")
- * p ec.convert("\u3042") #=> "\e$B$\""
- * p ec.finish #=> "\e(B"
- */
-static VALUE
-econv_finish(VALUE self)
-{
- VALUE ret, dst;
- VALUE av[5];
- int ac;
- rb_econv_t *ec = check_econv(self);
-
- dst = rb_str_new(NULL, 0);
-
- av[0] = Qnil;
- av[1] = dst;
- av[2] = Qnil;
- av[3] = Qnil;
- av[4] = INT2NUM(0);
- ac = 5;
-
- ret = econv_primitive_convert(ac, av, self);
-
- if (ret == sym_invalid_byte_sequence ||
- ret == sym_undefined_conversion ||
- ret == sym_incomplete_input) {
- VALUE exc = make_econv_exception(ec);
- rb_exc_raise(exc);
- }
-
- if (ret != sym_finished) {
- rb_bug("unexpected result of econv_primitive_convert");
- }
-
- return dst;
-}
-
-/*
- * call-seq:
- * ec.primitive_errinfo -> array
- *
- * primitive_errinfo returns important information regarding the last error
- * as a 5-element array:
- *
- * [result, enc1, enc2, error_bytes, readagain_bytes]
- *
- * result is the last result of primitive_convert.
- *
- * Other elements are only meaningful when result is
- * :invalid_byte_sequence, :incomplete_input or :undefined_conversion.
- *
- * enc1 and enc2 indicate a conversion step as a pair of strings.
- * For example, a converter from EUC-JP to ISO-8859-1 converts
- * a string as follows: EUC-JP -> UTF-8 -> ISO-8859-1.
- * So [enc1, enc2] is either ["EUC-JP", "UTF-8"] or ["UTF-8", "ISO-8859-1"].
- *
- * error_bytes and readagain_bytes indicate the byte sequences which caused the error.
- * error_bytes is discarded portion.
- * readagain_bytes is buffered portion which is read again on next conversion.
- *
- * Example:
- *
- * # \xff is invalid as EUC-JP.
- * ec = Encoding::Converter.new("EUC-JP", "Shift_JIS")
- * ec.primitive_convert(src="\xff", dst="", nil, 10)
- * p ec.primitive_errinfo
- * #=> [:invalid_byte_sequence, "EUC-JP", "UTF-8", "\xFF", ""]
- *
- * # HIRAGANA LETTER A (\xa4\xa2 in EUC-JP) is not representable in ISO-8859-1.
- * # Since this error is occur in UTF-8 to ISO-8859-1 conversion,
- * # error_bytes is HIRAGANA LETTER A in UTF-8 (\xE3\x81\x82).
- * ec = Encoding::Converter.new("EUC-JP", "ISO-8859-1")
- * ec.primitive_convert(src="\xa4\xa2", dst="", nil, 10)
- * p ec.primitive_errinfo
- * #=> [:undefined_conversion, "UTF-8", "ISO-8859-1", "\xE3\x81\x82", ""]
- *
- * # partial character is invalid
- * ec = Encoding::Converter.new("EUC-JP", "ISO-8859-1")
- * ec.primitive_convert(src="\xa4", dst="", nil, 10)
- * p ec.primitive_errinfo
- * #=> [:incomplete_input, "EUC-JP", "UTF-8", "\xA4", ""]
- *
- * # Encoding::Converter::PARTIAL_INPUT prevents invalid errors by
- * # partial characters.
- * ec = Encoding::Converter.new("EUC-JP", "ISO-8859-1")
- * ec.primitive_convert(src="\xa4", dst="", nil, 10, Encoding::Converter::PARTIAL_INPUT)
- * p ec.primitive_errinfo
- * #=> [:source_buffer_empty, nil, nil, nil, nil]
- *
- * # \xd8\x00\x00@ is invalid as UTF-16BE because
- * # no low surrogate after high surrogate (\xd8\x00).
- * # It is detected by 3rd byte (\00) which is part of next character.
- * # So the high surrogate (\xd8\x00) is discarded and
- * # the 3rd byte is read again later.
- * # Since the byte is buffered in ec, it is dropped from src.
- * ec = Encoding::Converter.new("UTF-16BE", "UTF-8")
- * ec.primitive_convert(src="\xd8\x00\x00@", dst="", nil, 10)
- * p ec.primitive_errinfo
- * #=> [:invalid_byte_sequence, "UTF-16BE", "UTF-8", "\xD8\x00", "\x00"]
- * p src
- * #=> "@"
- *
- * # Similar to UTF-16BE, \x00\xd8@\x00 is invalid as UTF-16LE.
- * # The problem is detected by 4th byte.
- * ec = Encoding::Converter.new("UTF-16LE", "UTF-8")
- * ec.primitive_convert(src="\x00\xd8@\x00", dst="", nil, 10)
- * p ec.primitive_errinfo
- * #=> [:invalid_byte_sequence, "UTF-16LE", "UTF-8", "\x00\xD8", "@\x00"]
- * p src
- * #=> ""
- *
- */
-static VALUE
-econv_primitive_errinfo(VALUE self)
-{
- rb_econv_t *ec = check_econv(self);
-
- VALUE ary;
-
- ary = rb_ary_new2(5);
-
- rb_ary_store(ary, 0, econv_result_to_symbol(ec->last_error.result));
- rb_ary_store(ary, 4, Qnil);
-
- if (ec->last_error.source_encoding)
- rb_ary_store(ary, 1, rb_str_new2(ec->last_error.source_encoding));
-
- if (ec->last_error.destination_encoding)
- rb_ary_store(ary, 2, rb_str_new2(ec->last_error.destination_encoding));
-
- if (ec->last_error.error_bytes_start) {
- rb_ary_store(ary, 3, rb_str_new((const char *)ec->last_error.error_bytes_start, ec->last_error.error_bytes_len));
- rb_ary_store(ary, 4, rb_str_new((const char *)ec->last_error.error_bytes_start + ec->last_error.error_bytes_len, ec->last_error.readagain_len));
- }
-
- return ary;
-}
-
-/*
- * call-seq:
- * ec.insert_output(string) -> nil
- *
- * Inserts string into the encoding converter.
- * The string will be converted to the destination encoding and
- * output on later conversions.
- *
- * If the destination encoding is stateful,
- * string is converted according to the state and the state is updated.
- *
- * This method should be used only when a conversion error occurs.
- *
- * ec = Encoding::Converter.new("utf-8", "iso-8859-1")
- * src = "HIRAGANA LETTER A is \u{3042}."
- * dst = ""
- * p ec.primitive_convert(src, dst) #=> :undefined_conversion
- * puts "[#{dst.dump}, #{src.dump}]" #=> ["HIRAGANA LETTER A is ", "."]
- * ec.insert_output("<err>")
- * p ec.primitive_convert(src, dst) #=> :finished
- * puts "[#{dst.dump}, #{src.dump}]" #=> ["HIRAGANA LETTER A is <err>.", ""]
- *
- * ec = Encoding::Converter.new("utf-8", "iso-2022-jp")
- * src = "\u{306F 3041 3068 2661 3002}" # U+2661 is not representable in iso-2022-jp
- * dst = ""
- * p ec.primitive_convert(src, dst) #=> :undefined_conversion
- * puts "[#{dst.dump}, #{src.dump}]" #=> ["\e$B$O$!$H".force_encoding("ISO-2022-JP"), "\xE3\x80\x82"]
- * ec.insert_output "?" # state change required to output "?".
- * p ec.primitive_convert(src, dst) #=> :finished
- * puts "[#{dst.dump}, #{src.dump}]" #=> ["\e$B$O$!$H\e(B?\e$B!#\e(B".force_encoding("ISO-2022-JP"), ""]
- *
- */
-static VALUE
-econv_insert_output(VALUE self, VALUE string)
-{
- const char *insert_enc;
-
- int ret;
-
- rb_econv_t *ec = check_econv(self);
-
- StringValue(string);
- insert_enc = rb_econv_encoding_to_insert_output(ec);
- string = rb_str_encode(string, rb_enc_from_encoding(rb_enc_find(insert_enc)), 0, Qnil);
-
- ret = rb_econv_insert_output(ec, (const unsigned char *)RSTRING_PTR(string), RSTRING_LEN(string), insert_enc);
- if (ret == -1) {
- rb_raise(rb_eArgError, "too big string");
- }
-
- return Qnil;
-}
-
-/*
- * call-seq
- * ec.putback => string
- * ec.putback(max_numbytes) => string
- *
- * Put back the bytes which will be converted.
- *
- * The bytes are caused by invalid_byte_sequence error.
- * When invalid_byte_sequence error, some bytes are discarded and
- * some bytes are buffered to be converted later.
- * The latter bytes can be put back.
- * It can be observed by
- * Encoding::InvalidByteSequenceError#readagain_bytes and
- * Encoding::Converter#primitive_errinfo.
- *
- * ec = Encoding::Converter.new("utf-16le", "iso-8859-1")
- * src = "\x00\xd8\x61\x00"
- * dst = ""
- * p ec.primitive_convert(src, dst) #=> :invalid_byte_sequence
- * p ec.primitive_errinfo #=> [:invalid_byte_sequence, "UTF-16LE", "UTF-8", "\x00\xD8", "a\x00"]
- * p ec.putback #=> "a\x00"
- * p ec.putback #=> "" # no more bytes to put back
- *
- */
-static VALUE
-econv_putback(int argc, VALUE *argv, VALUE self)
-{
- rb_econv_t *ec = check_econv(self);
- int n;
- int putbackable;
- VALUE str, max;
-
- rb_scan_args(argc, argv, "01", &max);
-
- if (NIL_P(max))
- n = rb_econv_putbackable(ec);
- else {
- n = NUM2INT(max);
- putbackable = rb_econv_putbackable(ec);
- if (putbackable < n)
- n = putbackable;
- }
-
- str = rb_str_new(NULL, n);
- rb_econv_putback(ec, (unsigned char *)RSTRING_PTR(str), n);
-
- if (ec->source_encoding) {
- rb_enc_associate(str, ec->source_encoding);
- }
-
- return str;
-}
-
-/*
- * call-seq:
- * ec.last_error -> exception or nil
- *
- * Returns an exception object for the last conversion.
- * Returns nil if the last conversion did not produce an error.
- *
- * "error" means that
- * Encoding::InvalidByteSequenceError and Encoding::UndefinedConversionError for
- * Encoding::Converter#convert and
- * :invalid_byte_sequence, :incomplete_input and :undefined_conversion for
- * Encoding::Converter#primitive_convert.
- *
- * ec = Encoding::Converter.new("utf-8", "iso-8859-1")
- * p ec.primitive_convert(src="\xf1abcd", dst="") #=> :invalid_byte_sequence
- * p ec.last_error #=> #<Encoding::InvalidByteSequenceError: "\xF1" followed by "a" on UTF-8>
- * p ec.primitive_convert(src, dst, nil, 1) #=> :destination_buffer_full
- * p ec.last_error #=> nil
- *
- */
-static VALUE
-econv_last_error(VALUE self)
-{
- rb_econv_t *ec = check_econv(self);
- VALUE exc;
-
- exc = make_econv_exception(ec);
- if (NIL_P(exc))
- return Qnil;
- return exc;
-}
-
-/*
- * call-seq:
- * ec.replacement -> string
- *
- * Returns the replacement string.
- *
- * ec = Encoding::Converter.new("euc-jp", "us-ascii")
- * p ec.replacement #=> "?"
- *
- * ec = Encoding::Converter.new("euc-jp", "utf-8")
- * p ec.replacement #=> "\uFFFD"
- */
-static VALUE
-econv_get_replacement(VALUE self)
-{
- rb_econv_t *ec = check_econv(self);
- int ret;
- rb_encoding *enc;
-
- ret = make_replacement(ec);
- if (ret == -1) {
- rb_raise(rb_eUndefinedConversionError, "replacement character setup failed");
- }
-
- enc = rb_enc_find(ec->replacement_enc);
- return rb_enc_str_new((const char *)ec->replacement_str, (long)ec->replacement_len, enc);
-}
-
-/*
- * call-seq:
- * ec.replacement = string
- *
- * Sets the replacement string.
- *
- * ec = Encoding::Converter.new("utf-8", "us-ascii", :undef => :replace)
- * ec.replacement = "<undef>"
- * p ec.convert("a \u3042 b") #=> "a <undef> b"
- */
-static VALUE
-econv_set_replacement(VALUE self, VALUE arg)
-{
- rb_econv_t *ec = check_econv(self);
- VALUE string = arg;
- int ret;
- rb_encoding *enc;
-
- StringValue(string);
- enc = rb_enc_get(string);
-
- ret = rb_econv_set_replacement(ec,
- (const unsigned char *)RSTRING_PTR(string),
- RSTRING_LEN(string),
- rb_enc_name(enc));
-
- if (ret == -1) {
- /* xxx: rb_eInvalidByteSequenceError? */
- rb_raise(rb_eUndefinedConversionError, "replacement character setup failed");
- }
-
- return arg;
-}
-
-VALUE
-rb_econv_make_exception(rb_econv_t *ec)
-{
- return make_econv_exception(ec);
-}
-
-void
-rb_econv_check_error(rb_econv_t *ec)
-{
- VALUE exc;
-
- exc = make_econv_exception(ec);
- if (NIL_P(exc))
- return;
- rb_exc_raise(exc);
-}
-
-/*
- * call-seq:
- * ecerr.source_encoding_name -> string
- *
- * Returns the source encoding name as a string.
- */
-static VALUE
-ecerr_source_encoding_name(VALUE self)
-{
- return rb_attr_get(self, rb_intern("source_encoding_name"));
-}
-
-/*
- * call-seq:
- * ecerr.source_encoding -> encoding
- *
- * Returns the source encoding as an encoding object.
- *
- * Note that the result may not be equal to the source encoding of
- * the encoding converter if the conversion has multiple steps.
- *
- * ec = Encoding::Converter.new("ISO-8859-1", "EUC-JP") # ISO-8859-1 -> UTF-8 -> EUC-JP
- * begin
- * ec.convert("\xa0") # NO-BREAK SPACE, which is available in UTF-8 but not in EUC-JP.
- * rescue Encoding::UndefinedConversionError
- * p $!.source_encoding #=> #<Encoding:UTF-8>
- * p $!.destination_encoding #=> #<Encoding:EUC-JP>
- * p $!.source_encoding_name #=> "UTF-8"
- * p $!.destination_encoding_name #=> "EUC-JP"
- * end
- *
- */
-static VALUE
-ecerr_source_encoding(VALUE self)
-{
- return rb_attr_get(self, rb_intern("source_encoding"));
-}
-
-/*
- * call-seq:
- * ecerr.destination_encoding_name -> string
- *
- * Returns the destination encoding name as a string.
- */
-static VALUE
-ecerr_destination_encoding_name(VALUE self)
-{
- return rb_attr_get(self, rb_intern("destination_encoding_name"));
-}
-
-/*
- * call-seq:
- * ecerr.destination_encoding -> string
- *
- * Returns the destination encoding as an encoding object.
- */
-static VALUE
-ecerr_destination_encoding(VALUE self)
-{
- return rb_attr_get(self, rb_intern("destination_encoding"));
-}
-
-/*
- * call-seq:
- * ecerr.error_char -> string
- *
- * Returns the one-character string which cause Encoding::UndefinedConversionError.
- *
- * ec = Encoding::Converter.new("ISO-8859-1", "EUC-JP")
- * begin
- * ec.convert("\xa0")
- * rescue Encoding::UndefinedConversionError
- * puts $!.error_char.dump #=> "\xC2\xA0"
- * p $!.error_char.encoding #=> #<Encoding:UTF-8>
- * end
- *
- */
-static VALUE
-ecerr_error_char(VALUE self)
-{
- return rb_attr_get(self, rb_intern("error_char"));
-}
-
-/*
- * call-seq:
- * ecerr.error_bytes -> string
- *
- * Returns the discarded bytes when Encoding::InvalidByteSequenceError occurs.
- *
- * ec = Encoding::Converter.new("EUC-JP", "ISO-8859-1")
- * begin
- * ec.convert("abc\xA1\xFFdef")
- * rescue Encoding::InvalidByteSequenceError
- * p $! #=> #<Encoding::InvalidByteSequenceError: "\xA1" followed by "\xFF" on EUC-JP>
- * puts $!.error_bytes.dump #=> "\xA1"
- * puts $!.readagain_bytes.dump #=> "\xFF"
- * end
- */
-static VALUE
-ecerr_error_bytes(VALUE self)
-{
- return rb_attr_get(self, rb_intern("error_bytes"));
-}
-
-/*
- * call-seq:
- * ecerr.readagain_bytes -> string
- *
- * Returns the bytes to be read again when Encoding::InvalidByteSequenceError occurs.
- */
-static VALUE
-ecerr_readagain_bytes(VALUE self)
-{
- return rb_attr_get(self, rb_intern("readagain_bytes"));
-}
-
-/*
- * call-seq:
- * ecerr.incomplete_input? -> true or false
- *
- * Returns true if the invalid byte sequence error is caused by
- * premature end of string.
- *
- * ec = Encoding::Converter.new("EUC-JP", "ISO-8859-1")
- *
- * begin
- * ec.convert("abc\xA1z")
- * rescue Encoding::InvalidByteSequenceError
- * p $! #=> #<Encoding::InvalidByteSequenceError: "\xA1" followed by "z" on EUC-JP>
- * p $!.incomplete_input? #=> false
- * end
- *
- * begin
- * ec.convert("abc\xA1")
- * ec.finish
- * rescue Encoding::InvalidByteSequenceError
- * p $! #=> #<Encoding::InvalidByteSequenceError: incomplete "\xA1" on EUC-JP>
- * p $!.incomplete_input? #=> true
- * end
- */
-static VALUE
-ecerr_incomplete_input(VALUE self)
-{
- return rb_attr_get(self, rb_intern("incomplete_input"));
-}
-
-extern void Init_newline(void);
-
-void
-Init_transcode(void)
-{
- rb_eUndefinedConversionError = rb_define_class_under(rb_cEncoding, "UndefinedConversionError", rb_eEncodingError);
- rb_eInvalidByteSequenceError = rb_define_class_under(rb_cEncoding, "InvalidByteSequenceError", rb_eEncodingError);
- rb_eConverterNotFoundError = rb_define_class_under(rb_cEncoding, "ConverterNotFoundError", rb_eEncodingError);
-
- transcoder_table = st_init_strcasetable();
-
- sym_invalid = ID2SYM(rb_intern("invalid"));
- sym_undef = ID2SYM(rb_intern("undef"));
- sym_replace = ID2SYM(rb_intern("replace"));
- sym_xml = ID2SYM(rb_intern("xml"));
- sym_text = ID2SYM(rb_intern("text"));
- sym_attr = ID2SYM(rb_intern("attr"));
-
- sym_invalid_byte_sequence = ID2SYM(rb_intern("invalid_byte_sequence"));
- sym_undefined_conversion = ID2SYM(rb_intern("undefined_conversion"));
- sym_destination_buffer_full = ID2SYM(rb_intern("destination_buffer_full"));
- sym_source_buffer_empty = ID2SYM(rb_intern("source_buffer_empty"));
- sym_finished = ID2SYM(rb_intern("finished"));
- sym_after_output = ID2SYM(rb_intern("after_output"));
- sym_incomplete_input = ID2SYM(rb_intern("incomplete_input"));
- sym_universal_newline = ID2SYM(rb_intern("universal_newline"));
- sym_crlf_newline = ID2SYM(rb_intern("crlf_newline"));
- sym_cr_newline = ID2SYM(rb_intern("cr_newline"));
- sym_partial_input = ID2SYM(rb_intern("partial_input"));
-
- rb_define_method(rb_cString, "encode", str_encode, -1);
- rb_define_method(rb_cString, "encode!", str_encode_bang, -1);
-
- rb_cEncodingConverter = rb_define_class_under(rb_cEncoding, "Converter", rb_cData);
- rb_define_alloc_func(rb_cEncodingConverter, econv_s_allocate);
- rb_define_singleton_method(rb_cEncodingConverter, "asciicompat_encoding", econv_s_asciicompat_encoding, 1);
- rb_define_singleton_method(rb_cEncodingConverter, "search_convpath", econv_s_search_convpath, -1);
- rb_define_method(rb_cEncodingConverter, "initialize", econv_init, -1);
- rb_define_method(rb_cEncodingConverter, "inspect", econv_inspect, 0);
- rb_define_method(rb_cEncodingConverter, "convpath", econv_convpath, 0);
- rb_define_method(rb_cEncodingConverter, "source_encoding", econv_source_encoding, 0);
- rb_define_method(rb_cEncodingConverter, "destination_encoding", econv_destination_encoding, 0);
- rb_define_method(rb_cEncodingConverter, "primitive_convert", econv_primitive_convert, -1);
- rb_define_method(rb_cEncodingConverter, "convert", econv_convert, 1);
- rb_define_method(rb_cEncodingConverter, "finish", econv_finish, 0);
- rb_define_method(rb_cEncodingConverter, "primitive_errinfo", econv_primitive_errinfo, 0);
- rb_define_method(rb_cEncodingConverter, "insert_output", econv_insert_output, 1);
- rb_define_method(rb_cEncodingConverter, "putback", econv_putback, -1);
- rb_define_method(rb_cEncodingConverter, "last_error", econv_last_error, 0);
- rb_define_method(rb_cEncodingConverter, "replacement", econv_get_replacement, 0);
- rb_define_method(rb_cEncodingConverter, "replacement=", econv_set_replacement, 1);
-
- rb_define_const(rb_cEncodingConverter, "INVALID_MASK", INT2FIX(ECONV_INVALID_MASK));
- rb_define_const(rb_cEncodingConverter, "INVALID_REPLACE", INT2FIX(ECONV_INVALID_REPLACE));
- rb_define_const(rb_cEncodingConverter, "UNDEF_MASK", INT2FIX(ECONV_UNDEF_MASK));
- rb_define_const(rb_cEncodingConverter, "UNDEF_REPLACE", INT2FIX(ECONV_UNDEF_REPLACE));
- rb_define_const(rb_cEncodingConverter, "UNDEF_HEX_CHARREF", INT2FIX(ECONV_UNDEF_HEX_CHARREF));
- rb_define_const(rb_cEncodingConverter, "PARTIAL_INPUT", INT2FIX(ECONV_PARTIAL_INPUT));
- rb_define_const(rb_cEncodingConverter, "AFTER_OUTPUT", INT2FIX(ECONV_AFTER_OUTPUT));
- rb_define_const(rb_cEncodingConverter, "UNIVERSAL_NEWLINE_DECORATOR", INT2FIX(ECONV_UNIVERSAL_NEWLINE_DECORATOR));
- rb_define_const(rb_cEncodingConverter, "CRLF_NEWLINE_DECORATOR", INT2FIX(ECONV_CRLF_NEWLINE_DECORATOR));
- rb_define_const(rb_cEncodingConverter, "CR_NEWLINE_DECORATOR", INT2FIX(ECONV_CR_NEWLINE_DECORATOR));
- rb_define_const(rb_cEncodingConverter, "XML_TEXT_DECORATOR", INT2FIX(ECONV_XML_TEXT_DECORATOR));
- rb_define_const(rb_cEncodingConverter, "XML_ATTR_CONTENT_DECORATOR", INT2FIX(ECONV_XML_ATTR_CONTENT_DECORATOR));
- rb_define_const(rb_cEncodingConverter, "XML_ATTR_QUOTE_DECORATOR", INT2FIX(ECONV_XML_ATTR_QUOTE_DECORATOR));
-
- rb_define_method(rb_eUndefinedConversionError, "source_encoding_name", ecerr_source_encoding_name, 0);
- rb_define_method(rb_eUndefinedConversionError, "destination_encoding_name", ecerr_destination_encoding_name, 0);
- rb_define_method(rb_eUndefinedConversionError, "source_encoding", ecerr_source_encoding, 0);
- rb_define_method(rb_eUndefinedConversionError, "destination_encoding", ecerr_destination_encoding, 0);
- rb_define_method(rb_eUndefinedConversionError, "error_char", ecerr_error_char, 0);
-
- rb_define_method(rb_eInvalidByteSequenceError, "source_encoding_name", ecerr_source_encoding_name, 0);
- rb_define_method(rb_eInvalidByteSequenceError, "destination_encoding_name", ecerr_destination_encoding_name, 0);
- rb_define_method(rb_eInvalidByteSequenceError, "source_encoding", ecerr_source_encoding, 0);
- rb_define_method(rb_eInvalidByteSequenceError, "destination_encoding", ecerr_destination_encoding, 0);
- rb_define_method(rb_eInvalidByteSequenceError, "error_bytes", ecerr_error_bytes, 0);
- rb_define_method(rb_eInvalidByteSequenceError, "readagain_bytes", ecerr_readagain_bytes, 0);
- rb_define_method(rb_eInvalidByteSequenceError, "incomplete_input?", ecerr_incomplete_input, 0);
-
- Init_newline();
-}
diff --git a/transcode_data.h b/transcode_data.h
deleted file mode 100644
index 8b320c39eb..0000000000
--- a/transcode_data.h
+++ /dev/null
@@ -1,106 +0,0 @@
-/**********************************************************************
-
- transcode_data.h -
-
- $Author$
- created at: Mon 10 Dec 2007 14:01:47 JST 2007
-
- Copyright (C) 2007 Martin Duerst
-
-**********************************************************************/
-
-#include "ruby/ruby.h"
-
-#ifndef RUBY_TRANSCODE_DATA_H
-#define RUBY_TRANSCODE_DATA_H 1
-
-#define WORDINDEX_SHIFT_BITS 2
-#define WORDINDEX2INFO(widx) ((widx) << WORDINDEX_SHIFT_BITS)
-#define INFO2WORDINDEX(info) ((info) >> WORDINDEX_SHIFT_BITS)
-#define BYTE_LOOKUP_BASE(bl) ((bl)[0])
-#define BYTE_LOOKUP_INFO(bl) ((bl)[1])
-
-#define PType (unsigned int)
-
-#define NOMAP (PType 0x01) /* direct map */
-#define ONEbt (0x02) /* one byte payload */
-#define TWObt (0x03) /* two bytes payload */
-#define THREEbt (0x05) /* three bytes payload */
-#define FOURbt (0x06) /* four bytes payload, UTF-8 only, macros start at getBT0 */
-#define INVALID (PType 0x07) /* invalid byte sequence */
-#define UNDEF (PType 0x09) /* legal but undefined */
-#define ZERObt (PType 0x0A) /* zero bytes of payload, i.e. remove */
-#define FUNii (PType 0x0B) /* function from info to info */
-#define FUNsi (PType 0x0D) /* function from start to info */
-#define FUNio (PType 0x0E) /* function from info to output */
-#define FUNso (PType 0x0F) /* function from start to output */
-#define STR1 (PType 0x11) /* string 4 <= len <= 259 bytes: 1byte length + content */
-#define GB4bt (PType 0x12) /* GB18030 four bytes payload */
-
-#define STR1_LENGTH(byte_addr) (unsigned int)(*(byte_addr) + 4)
-#define STR1_BYTEINDEX(w) ((w) >> 6)
-#define makeSTR1(bi) (((bi) << 6) | STR1)
-#define makeSTR1LEN(len) ((len)-4)
-
-#define o1(b1) (PType((((unsigned char)(b1))<<8)|ONEbt))
-#define o2(b1,b2) (PType((((unsigned char)(b1))<<8)|(((unsigned char)(b2))<<16)|TWObt))
-#define o3(b1,b2,b3) (PType(((((unsigned char)(b1))<<8)|(((unsigned char)(b2))<<16)|(((unsigned int)(unsigned char)(b3))<<24)|THREEbt)&0xffffffffU))
-#define o4(b0,b1,b2,b3) (PType(((((unsigned char)(b1))<<8)|(((unsigned char)(b2))<<16)|(((unsigned char)(b3))<<24)|((((unsigned char)(b0))&0x07)<<5)|FOURbt)&0xffffffffU))
-#define g4(b0,b1,b2,b3) (PType(((((unsigned char)(b0))<<8)|(((unsigned char)(b2))<<16)|((((unsigned char)(b1))&0x0f)<<24)|((((unsigned int)(unsigned char)(b3))&0x0f)<<28)|GB4bt)&0xffffffffU))
-
-#define getBT1(a) ((unsigned char)((a)>> 8))
-#define getBT2(a) ((unsigned char)((a)>>16))
-#define getBT3(a) ((unsigned char)((a)>>24))
-#define getBT0(a) (((unsigned char)((a)>> 5)&0x07)|0xF0) /* for UTF-8 only!!! */
-
-#define getGB4bt0(a) ((unsigned char)((a)>> 8))
-#define getGB4bt1(a) ((unsigned char)((a)>>24)&0x0F|0x30)
-#define getGB4bt2(a) ((unsigned char)((a)>>16))
-#define getGB4bt3(a) ((unsigned char)((a)>>28)&0x0F|0x30)
-
-#define o2FUNii(b1,b2) (PType((((unsigned char)(b1))<<8)|(((unsigned char)(b2))<<16)|FUNii))
-
-/* do we need these??? maybe not, can be done with simple tables */
-#define ONETRAIL /* legal but undefined if one more trailing UTF-8 */
-#define TWOTRAIL /* legal but undefined if two more trailing UTF-8 */
-#define THREETRAIL /* legal but undefined if three more trailing UTF-8 */
-
-typedef enum {
- asciicompat_converter, /* ASCII-compatible -> ASCII-compatible */
- asciicompat_decoder, /* ASCII-incompatible -> ASCII-compatible */
- asciicompat_encoder /* ASCII-compatible -> ASCII-incompatible */
- /* ASCII-incompatible -> ASCII-incompatible is intentionally ommitted. */
-} rb_transcoder_asciicompat_type_t;
-
-typedef struct rb_transcoder rb_transcoder;
-
-/* static structure, one per supported encoding pair */
-struct rb_transcoder {
- const char *src_encoding;
- const char *dst_encoding;
- unsigned int conv_tree_start;
- const unsigned char *byte_array;
- unsigned int byte_array_length;
- const unsigned int *word_array;
- unsigned int word_array_length;
- int word_size;
- int input_unit_length;
- int max_input;
- int max_output;
- rb_transcoder_asciicompat_type_t asciicompat_type;
- size_t state_size;
- int (*state_init_func)(void*); /* ret==0:success ret!=0:failure(errno) */
- int (*state_fini_func)(void*); /* ret==0:success ret!=0:failure(errno) */
- VALUE (*func_ii)(void*, VALUE); /* info -> info */
- VALUE (*func_si)(void*, const unsigned char*, size_t); /* start -> info */
- ssize_t (*func_io)(void*, VALUE, const unsigned char*, size_t); /* info -> output */
- ssize_t (*func_so)(void*, const unsigned char*, size_t, unsigned char*, size_t); /* start -> output */
- ssize_t (*finish_func)(void*, unsigned char*, size_t); /* -> output */
- ssize_t (*resetsize_func)(void*); /* -> len */
- ssize_t (*resetstate_func)(void*, unsigned char*, size_t); /* -> output */
-};
-
-void rb_declare_transcoder(const char *enc1, const char *enc2, const char *lib);
-void rb_register_transcoder(const rb_transcoder *);
-
-#endif /* RUBY_TRANSCODE_DATA_H */
diff --git a/util.c b/util.c
index d6b06402d5..de18895cb7 100644
--- a/util.c
+++ b/util.c
@@ -3,13 +3,14 @@
util.c -
$Author$
+ $Date$
created at: Fri Mar 10 17:22:34 JST 1995
Copyright (C) 1993-2008 Yukihiro Matsumoto
**********************************************************************/
-#include "ruby/ruby.h"
+#include "ruby.h"
#include <ctype.h>
#include <stdio.h>
@@ -20,11 +21,20 @@
#ifdef _WIN32
#include "missing/file.h"
#endif
+#if defined(__CYGWIN32__) || defined(_WIN32)
+#include <io.h>
+#endif
-#include "ruby/util.h"
+#include "util.h"
+#ifndef HAVE_STRING_H
+char *strchr _((char*,char));
+#endif
unsigned long
-ruby_scan_oct(const char *start, size_t len, size_t *retlen)
+scan_oct(start, len, retlen)
+ const char *start;
+ int len;
+ int *retlen;
{
register const char *s = start;
register unsigned long retval = 0;
@@ -33,143 +43,30 @@ ruby_scan_oct(const char *start, size_t len, size_t *retlen)
retval <<= 3;
retval |= *s++ - '0';
}
- *retlen = (int)(s - start); /* less than len */
+ *retlen = s - start;
return retval;
}
unsigned long
-ruby_scan_hex(const char *start, size_t len, size_t *retlen)
+scan_hex(start, len, retlen)
+ const char *start;
+ int len;
+ int *retlen;
{
static const char hexdigit[] = "0123456789abcdef0123456789ABCDEF";
register const char *s = start;
register unsigned long retval = 0;
- const char *tmp;
+ char *tmp;
while (len-- && *s && (tmp = strchr(hexdigit, *s))) {
retval <<= 4;
retval |= (tmp - hexdigit) & 15;
s++;
}
- *retlen = (int)(s - start); /* less than len */
+ *retlen = s - start;
return retval;
}
-static unsigned long
-scan_digits(const char *str, int base, size_t *retlen, int *overflow)
-{
- static signed char table[] = {
- /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */
- /*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,
- /*2*/ -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
- /*3*/ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,-1,-1,-1,-1,-1,-1,
- /*4*/ -1,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,
- /*5*/ 25,26,27,28,29,30,31,32,33,34,35,-1,-1,-1,-1,-1,
- /*6*/ -1,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,
- /*7*/ 25,26,27,28,29,30,31,32,33,34,35,-1,-1,-1,-1,-1,
- /*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*/ -1,-1,-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*/ -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,-1,-1,-1,
- };
-
- const char *start = str;
- unsigned long ret = 0, x;
- unsigned long mul_overflow = (~(unsigned long)0) / base;
- int c;
- *overflow = 0;
-
- while ((c = (unsigned char)*str++) != '\0') {
- int d = table[c];
- if (d == -1 || base <= d) {
- *retlen = (str-1) - start;
- return ret;
- }
- if (mul_overflow < ret)
- *overflow = 1;
- ret *= base;
- x = ret;
- ret += d;
- if (ret < x)
- *overflow = 1;
- }
- *retlen = (str-1) - start;
- return ret;
-}
-
-unsigned long
-ruby_strtoul(const char *str, char **endptr, int base)
-{
- int c, b, overflow;
- int sign = 0;
- size_t len;
- unsigned long ret;
- const char *subject_found = str;
-
- if (base == 1 || 36 < base) {
- errno = EINVAL;
- return 0;
- }
-
- while ((c = *str) && ISSPACE(c))
- str++;
-
- if (c == '+') {
- sign = 1;
- str++;
- }
- else if (c == '-') {
- sign = -1;
- str++;
- }
-
- if (str[0] == '0') {
- subject_found = str+1;
- if (base == 0 || base == 16) {
- if (str[1] == 'x' || str[1] == 'X') {
- b = 16;
- str += 2;
- }
- else {
- b = base == 0 ? 8 : 16;
- str++;
- }
- }
- else {
- b = base;
- str++;
- }
- }
- else {
- b = base == 0 ? 10 : base;
- }
-
- ret = scan_digits(str, b, &len, &overflow);
-
- if (0 < len)
- subject_found = str+len;
-
- if (endptr)
- *endptr = (char*)subject_found;
-
- if (overflow) {
- errno = ERANGE;
- return ULONG_MAX;
- }
-
- if (sign < 0) {
- ret = (unsigned long)(-(long)ret);
- return ret;
- }
- else {
- return ret;
- }
-}
-
#include <sys/types.h>
#include <sys/stat.h>
#ifdef HAVE_UNISTD_H
@@ -183,7 +80,7 @@ ruby_strtoul(const char *str, char **endptr, int base)
# define S_ISDIR(m) ((m & S_IFMT) == S_IFDIR)
#endif
-#if defined(__CYGWIN32__) || defined(_WIN32)
+#if defined(MSDOS) || defined(__CYGWIN32__) || defined(_WIN32)
/*
* Copyright (c) 1993, Intergraph Corporation
*
@@ -209,11 +106,11 @@ ruby_strtoul(const char *str, char **endptr, int base)
* Style 1: The suffix begins with a '.'. The extension is replaced.
* If the name matches the original name, use the fallback method.
*
- * Style 2: The suffix is a single character, not a '.'. Try to add the
+ * Style 2: The suffix is a single character, not a '.'. Try to add the
* suffix to the following places, using the first one that works.
- * [1] Append to extension.
- * [2] Append to filename,
- * [3] Replace end of extension,
+ * [1] Append to extension.
+ * [2] Append to filename,
+ * [3] Replace end of extension,
* [4] Replace end of filename.
* If the name matches the original name, use the fallback method.
*
@@ -249,11 +146,11 @@ ruby_strtoul(const char *str, char **endptr, int base)
* longname.fil => longname.fi~
* longname.fi~ => longnam~.fi~
* longnam~.fi~ => longnam~.$$$
- *
+ *
*/
-static int valid_filename(const char *s);
+static int valid_filename(char *s);
static const char suffix1[] = ".$$$";
static const char suffix2[] = ".~~~";
@@ -263,31 +160,36 @@ static const char suffix2[] = ".~~~";
#define strEQ(s1,s2) (strcmp(s1,s2) == 0)
void
-ruby_add_suffix(VALUE str, const char *suffix)
+ruby_add_suffix(str, suffix)
+ VALUE str;
+ char *suffix;
{
int baselen;
int extlen = strlen(suffix);
char *s, *t, *p;
long slen;
char buf[1024];
- char *const bufend = buf + sizeof(buf);
- if (RSTRING_LEN(str) > 1000)
+ if (RSTRING(str)->len > 1000)
rb_fatal("Cannot do inplace edit on long filename (%ld characters)",
- RSTRING_LEN(str));
+ RSTRING(str)->len);
-#if defined(__CYGWIN32__) || defined(_WIN32)
+#if defined(DJGPP) || defined(__CYGWIN32__) || defined(_WIN32)
/* Style 0 */
- slen = RSTRING_LEN(str);
+ slen = RSTRING(str)->len;
rb_str_cat(str, suffix, extlen);
- if (valid_filename(RSTRING_PTR(str))) return;
+#if defined(DJGPP)
+ if (_USE_LFN) return;
+#else
+ if (valid_filename(RSTRING(str)->ptr)) return;
+#endif
/* Fooey, style 0 failed. Fix str before continuing. */
- rb_str_resize(str, slen);
+ RSTRING(str)->ptr[RSTRING(str)->len = slen] = '\0';
#endif
slen = extlen;
- t = buf; baselen = 0; s = RSTRING_PTR(str);
+ t = buf; baselen = 0; s = RSTRING(str)->ptr;
while ((*t = *s) && *s != '.') {
baselen++;
if (*s == '\\' || *s == '/') baselen = 0;
@@ -296,15 +198,15 @@ ruby_add_suffix(VALUE str, const char *suffix)
p = t;
t = ext; extlen = 0;
- while ((*t++ = *s++) != 0) extlen++;
+ while (*t++ = *s++) extlen++;
if (extlen == 0) { ext[0] = '.'; ext[1] = 0; extlen++; }
if (*suffix == '.') { /* Style 1 */
if (strEQ(ext, suffix)) goto fallback;
- strlcpy(p, suffix, bufend - p);
+ strcpy(p, suffix);
}
else if (suffix[1] == '\0') { /* Style 2 */
- if (extlen < 4) {
+ if (extlen < 4) {
ext[extlen] = *suffix;
ext[++extlen] = '\0';
}
@@ -318,19 +220,25 @@ ruby_add_suffix(VALUE str, const char *suffix)
buf[7] = *suffix;
}
else goto fallback;
- strlcpy(p, ext, bufend - p);
+ strcpy(p, ext);
}
else { /* Style 3: Panic */
fallback:
(void)memcpy(p, strEQ(ext, suffix1) ? suffix2 : suffix1, 5);
}
rb_str_resize(str, strlen(buf));
- memcpy(RSTRING_PTR(str), buf, RSTRING_LEN(str));
+ memcpy(RSTRING(str)->ptr, buf, RSTRING(str)->len);
}
#if defined(__CYGWIN32__) || defined(_WIN32)
-static int
-valid_filename(const char *s)
+#if defined __CYGWIN32__ || defined __MINGW32__
+extern int _open(const char *, int, ...);
+extern int _close(int);
+extern int _unlink(const char *);
+#endif
+
+static int
+valid_filename(char *s)
{
int fd;
@@ -338,9 +246,9 @@ valid_filename(const char *s)
// It doesn't exist, so see if we can open it.
*/
- if ((fd = open(s, O_CREAT|O_EXCL, 0666)) >= 0) {
- close(fd);
- unlink(s); /* don't leave it laying around */
+ if ((fd = _open(s, O_CREAT|O_EXCL, 0666)) >= 0) {
+ _close(fd);
+ _unlink(s); /* don't leave it laying around */
return 1;
}
else if (errno == EEXIST) {
@@ -352,6 +260,136 @@ valid_filename(const char *s)
#endif
#endif
+#if defined __DJGPP__
+
+#include <dpmi.h>
+
+static char dbcs_table[256];
+
+int
+make_dbcs_table()
+{
+ __dpmi_regs r;
+ struct {
+ unsigned char start;
+ unsigned char end;
+ } vec;
+ int offset;
+
+ memset(&r, 0, sizeof(r));
+ r.x.ax = 0x6300;
+ __dpmi_int(0x21, &r);
+ offset = r.x.ds * 16 + r.x.si;
+
+ for (;;) {
+ int i;
+ dosmemget(offset, sizeof vec, &vec);
+ if (!vec.start && !vec.end)
+ break;
+ for (i = vec.start; i <= vec.end; i++)
+ dbcs_table[i] = 1;
+ offset += 2;
+ }
+}
+
+int
+mblen(const char *s, size_t n)
+{
+ static int need_init = 1;
+ if (need_init) {
+ make_dbcs_table();
+ need_init = 0;
+ }
+ if (s) {
+ if (n == 0 || *s == 0)
+ return 0;
+ else if (!s[1])
+ return 1;
+ return dbcs_table[(unsigned char)*s] + 1;
+ }
+ else
+ return 1;
+}
+
+struct PathList {
+ struct PathList *next;
+ char *path;
+};
+
+struct PathInfo {
+ struct PathList *head;
+ int count;
+};
+
+static int
+push_element(const char *path, VALUE vinfo)
+{
+ struct PathList *p;
+ struct PathInfo *info = (struct PathInfo *)vinfo;
+
+ p = ALLOC(struct PathList);
+ MEMZERO(p, struct PathList, 1);
+ p->path = ruby_strdup(path);
+ p->next = info->head;
+ info->head = p;
+ info->count++;
+
+ return 0;
+}
+
+#include <dirent.h>
+int __opendir_flags = __OPENDIR_PRESERVE_CASE;
+
+char **
+__crt0_glob_function(char *path)
+{
+ int len = strlen(path);
+ int i;
+ char **rv;
+ char path_buffer[PATH_MAX];
+ char *buf = path_buffer;
+ char *p;
+ struct PathInfo info;
+ struct PathList *plist;
+
+ if (PATH_MAX <= len)
+ buf = ruby_xmalloc(len + 1);
+
+ strncpy(buf, path, len);
+ buf[len] = '\0';
+
+ for (p = buf; *p; p += mblen(p, MB_CUR_MAX))
+ if (*p == '\\')
+ *p = '/';
+
+ info.count = 0;
+ info.head = 0;
+
+ ruby_glob(buf, 0, push_element, (VALUE)&info);
+
+ if (buf != path_buffer)
+ ruby_xfree(buf);
+
+ if (info.count == 0)
+ return 0;
+
+ rv = ruby_xmalloc((info.count + 1) * sizeof (char *));
+
+ plist = info.head;
+ i = 0;
+ while (plist) {
+ struct PathList *cur;
+ rv[i] = plist->path;
+ cur = plist;
+ plist = plist->next;
+ ruby_xfree(cur);
+ i++;
+ }
+ rv[i] = 0;
+ return rv;
+}
+
+#endif
/* mm.c */
@@ -371,7 +409,9 @@ valid_filename(const char *s)
#define mmarg mmkind, size, high, low
-static void mmswap_(register char *a, register char *b, int mmkind, size_t size, size_t high, size_t low)
+static void mmswap_(a, b, mmarg)
+ register char *a, *b;
+ int mmarg;
{
register int s;
if (a == b) return;
@@ -396,7 +436,9 @@ static void mmswap_(register char *a, register char *b, int mmkind, size_t size,
}
#define mmswap(a,b) mmswap_((a),(b),mmarg)
-static void mmrot3_(register char *a, register char *b, register char *c, int mmkind, size_t size, size_t high, size_t low)
+static void mmrot3_(a, b, c, mmarg)
+ register char *a, *b, *c;
+ int mmarg;
{
register int s;
if (mmkind >= 0) {
@@ -437,18 +479,20 @@ typedef struct { char *LL, *RR; } stack_node; /* Stack structure for L,l,R,r */
((*cmp)(b,c,d)<0 ? b : ((*cmp)(a,c,d)<0 ? c : a)) : \
((*cmp)(b,c,d)>0 ? b : ((*cmp)(a,c,d)<0 ? a : c)))
-void
-ruby_qsort(void* base, const size_t nel, const size_t size,
- int (*cmp)(const void*, const void*, void*), void *d)
+void ruby_qsort (base, nel, size, cmp, d)
+ void* base;
+ const int nel;
+ const int size;
+ int (*cmp)();
+ void *d;
{
register char *l, *r, *m; /* l,r:left,right group m:median point */
- register int t, eq_l, eq_r; /* eq_l: all items in left group are equal to S */
+ register int t, eq_l, eq_r; /* eq_l: all items in left group are equal to S */
char *L = base; /* left end of curren region */
char *R = (char*)base + size*(nel-1); /* right end of current region */
- size_t chklim = 63; /* threshold of ordering element check */
+ int chklim = 63; /* threshold of ordering element check */
stack_node stack[32], *top = stack; /* 32 is enough for 32bit CPU */
- int mmkind;
- size_t high, low, n;
+ int mmkind, high, low;
if (nel <= 1) return; /* need not to sort */
mmprepare(base, size);
@@ -465,29 +509,29 @@ ruby_qsort(void* base, const size_t nel, const size_t size,
}
l = L; r = R;
- n = (r - l + size) / size; /* number of elements */
- m = l + size * (n >> 1); /* calculate median value */
+ t = (r - l + size) / size; /* number of elements */
+ m = l + size * (t >> 1); /* calculate median value */
- if (n >= 60) {
+ if (t >= 60) {
register char *m1;
register char *m3;
- if (n >= 200) {
- n = size*(n>>3); /* number of bytes in splitting 8 */
+ if (t >= 200) {
+ t = size*(t>>3); /* number of bytes in splitting 8 */
{
- register char *p1 = l + n;
- register char *p2 = p1 + n;
- register char *p3 = p2 + n;
+ register char *p1 = l + t;
+ register char *p2 = p1 + t;
+ register char *p3 = p2 + t;
m1 = med3(p1, p2, p3);
- p1 = m + n;
- p2 = p1 + n;
- p3 = p2 + n;
+ p1 = m + t;
+ p2 = p1 + t;
+ p3 = p2 + t;
m3 = med3(p1, p2, p3);
}
}
else {
- n = size*(n>>2); /* number of bytes in splitting 4 */
- m1 = l + n;
- m3 = m + n;
+ t = size*(t>>2); /* number of bytes in splitting 4 */
+ m1 = l + t;
+ m3 = m + t;
}
m = med3(m1, m, m3);
}
@@ -588,10 +632,11 @@ ruby_qsort(void* base, const size_t nel, const size_t size,
}
char *
-ruby_strdup(const char *str)
+ruby_strdup(str)
+ const char *str;
{
char *tmp;
- size_t len = strlen(str) + 1;
+ int len = strlen(str) + 1;
tmp = xmalloc(len);
memcpy(tmp, str, len);
@@ -600,7 +645,7 @@ ruby_strdup(const char *str)
}
char *
-ruby_getcwd(void)
+ruby_getcwd()
{
#ifdef HAVE_GETCWD
int size = 200;
@@ -608,7 +653,7 @@ ruby_getcwd(void)
while (!getcwd(buf, size)) {
if (errno != ERANGE) {
- xfree(buf);
+ free(buf);
rb_sys_fail("getcwd");
}
size *= 2;
@@ -621,13 +666,14 @@ ruby_getcwd(void)
char *buf = xmalloc(PATH_MAX+1);
if (!getwd(buf)) {
- xfree(buf);
+ free(buf);
rb_sys_fail("getwd");
}
#endif
return buf;
}
+
/****************************************************************
*
* The author of this software is David M. Gay.
@@ -860,6 +906,8 @@ static double private_mem[PRIVATE_mem], *pmem_next = private_mem;
#define IEEE_Arith
#endif
+#include "errno.h"
+
#ifdef Bad_float_h
#ifdef IEEE_Arith
@@ -899,9 +947,6 @@ static double private_mem[PRIVATE_mem], *pmem_next = private_mem;
#ifdef __cplusplus
extern "C" {
-#if 0
-}
-#endif
#endif
#if defined(IEEE_LITTLE_ENDIAN) + defined(IEEE_BIG_ENDIAN) + defined(VAX) + defined(IBM) != 1
@@ -911,25 +956,23 @@ Exactly one of IEEE_LITTLE_ENDIAN, IEEE_BIG_ENDIAN, VAX, or IBM should be define
typedef union { double d; ULong L[2]; } U;
#ifdef YES_ALIAS
-typedef double double_u;
-# define dval(x) x
-# ifdef IEEE_LITTLE_ENDIAN
-# define word0(x) (((ULong *)&x)[1])
-# define word1(x) (((ULong *)&x)[0])
-# else
-# define word0(x) (((ULong *)&x)[0])
-# define word1(x) (((ULong *)&x)[1])
-# endif
-#else
-typedef U double_u;
-# ifdef IEEE_LITTLE_ENDIAN
-# define word0(x) (x.L[1])
-# define word1(x) (x.L[0])
-# else
-# define word0(x) (x.L[0])
-# define word1(x) (x.L[1])
-# endif
-# define dval(x) (x.d)
+#define dval(x) x
+#ifdef IEEE_LITTLE_ENDIAN
+#define word0(x) ((ULong *)&x)[1]
+#define word1(x) ((ULong *)&x)[0]
+#else
+#define word0(x) ((ULong *)&x)[0]
+#define word1(x) ((ULong *)&x)[1]
+#endif
+#else
+#ifdef IEEE_LITTLE_ENDIAN
+#define word0(x) ((U*)&x)->L[1]
+#define word1(x) ((U*)&x)->L[0]
+#else
+#define word0(x) ((U*)&x)->L[0]
+#define word1(x) ((U*)&x)->L[1]
+#endif
+#define dval(x) ((U*)&x)->d
#endif
/* The following definition of Storeinc is appropriate for MIPS processors.
@@ -1100,14 +1143,9 @@ extern double rnd_prod(double, double), rnd_quot(double, double);
#endif
#endif /* NO_LONG_LONG */
-#define MULTIPLE_THREADS 1
-
#ifndef MULTIPLE_THREADS
#define ACQUIRE_DTOA_LOCK(n) /*nothing*/
#define FREE_DTOA_LOCK(n) /*nothing*/
-#else
-#define ACQUIRE_DTOA_LOCK(n) /*unused right now*/
-#define FREE_DTOA_LOCK(n) /*unused right now*/
#endif
#define Kmax 15
@@ -1128,7 +1166,7 @@ Balloc(int k)
int x;
Bigint *rv;
#ifndef Omit_Private_Memory
- size_t len;
+ unsigned int len;
#endif
ACQUIRE_DTOA_LOCK(0);
@@ -1175,11 +1213,11 @@ static Bigint *
multadd(Bigint *b, int m, int a) /* multiply by m and add a */
{
int i, wds;
- ULong *x;
#ifdef ULLong
+ ULong *x;
ULLong carry, y;
#else
- ULong carry, y;
+ ULong carry, *x, y;
#ifdef Pack_32
ULong xi, z;
#endif
@@ -1194,7 +1232,7 @@ multadd(Bigint *b, int m, int a) /* multiply by m and add a */
#ifdef ULLong
y = *x * (ULLong)m + carry;
carry = y >> 32;
- *x++ = (ULong)(y & FFFFFFFF);
+ *x++ = y & FFFFFFFF;
#else
#ifdef Pack_32
xi = *x;
@@ -1216,7 +1254,7 @@ multadd(Bigint *b, int m, int a) /* multiply by m and add a */
Bfree(b);
b = b1;
}
- b->x[wds++] = (ULong)carry;
+ b->x[wds++] = carry;
b->wds = wds;
}
return b;
@@ -1383,9 +1421,9 @@ mult(Bigint *a, Bigint *b)
do {
z = *x++ * (ULLong)y + *xc + carry;
carry = z >> 32;
- *xc++ = (ULong)(z & FFFFFFFF);
+ *xc++ = z & FFFFFFFF;
} while (x < xae);
- *xc = (ULong)carry;
+ *xc = carry;
}
}
#else
@@ -1402,7 +1440,7 @@ mult(Bigint *a, Bigint *b)
carry = z2 >> 16;
Storeinc(xc, z2, z);
} while (x < xae);
- *xc = (ULong)carry;
+ *xc = carry;
}
if (y = *xb >> 16) {
x = xa;
@@ -1430,7 +1468,7 @@ mult(Bigint *a, Bigint *b)
carry = z >> 16;
*xc++ = z & 0xffff;
} while (x < xae);
- *xc = (ULong)carry;
+ *xc = carry;
}
}
#endif
@@ -1621,12 +1659,12 @@ diff(Bigint *a, Bigint *b)
do {
y = (ULLong)*xa++ - *xb++ - borrow;
borrow = y >> 32 & (ULong)1;
- *xc++ = (ULong)(y & FFFFFFFF);
+ *xc++ = y & FFFFFFFF;
} while (xb < xbe);
while (xa < xae) {
y = *xa++ - borrow;
borrow = y >> 32 & (ULong)1;
- *xc++ = (ULong)(y & FFFFFFFF);
+ *xc++ = y & FFFFFFFF;
}
#else
#ifdef Pack_32
@@ -1664,11 +1702,10 @@ diff(Bigint *a, Bigint *b)
}
static double
-ulp(double x_)
+ulp(double x)
{
register Long L;
- double_u x, a;
- dval(x) = x_;
+ double a;
L = (word0(x) & Exp_mask) - (P-1)*Exp_msk1;
#ifndef Avoid_Underflow
@@ -1706,7 +1743,7 @@ b2d(Bigint *a, int *e)
{
ULong *xa, *xa0, w, y, z;
int k;
- double_u d;
+ double d;
#ifdef VAX
ULong d0, d1;
#else
@@ -1767,9 +1804,8 @@ ret_d:
}
static Bigint *
-d2b(double d_, int *e, int *bits)
+d2b(double d, int *e, int *bits)
{
- double_u d;
Bigint *b;
int de, k;
ULong *x, y, z;
@@ -1778,9 +1814,6 @@ d2b(double d_, int *e, int *bits)
#endif
#ifdef VAX
ULong d0, d1;
-#endif
- dval(d) = d_;
-#ifdef VAX
d0 = word0(d) >> 16 | word0(d) << 16;
d1 = word1(d) >> 16 | word1(d) << 16;
#else
@@ -1906,7 +1939,7 @@ d2b(double d_, int *e, int *bits)
static double
ratio(Bigint *a, Bigint *b)
{
- double_u da, db;
+ double da, db;
int k, ka, kb;
dval(da) = b2d(a, &ka);
@@ -2065,8 +2098,7 @@ ruby_strtod(const char *s00, char **se)
int bb2, bb5, bbe, bd2, bd5, bbbits, bs2, c, dsign,
e, e1, esign, i, j, k, nd, nd0, nf, nz, nz0, sign;
const char *s, *s0, *s1;
- double aadj, adj;
- double_u aadj1, rv, rv0;
+ double aadj, aadj1, adj, rv, rv0;
Long L;
ULong y, z;
Bigint *bb, *bb1, *bd, *bd0, *bs, *delta;
@@ -2765,14 +2797,14 @@ drop_down:
}
if ((aadj = ratio(delta, bs)) <= 2.) {
if (dsign)
- aadj = dval(aadj1) = 1.;
+ aadj = aadj1 = 1.;
else if (word1(rv) || word0(rv) & Bndry_mask) {
#ifndef Sudden_Underflow
if (word1(rv) == Tiny1 && !word0(rv))
goto undfl;
#endif
aadj = 1.;
- dval(aadj1) = -1.;
+ aadj1 = -1.;
}
else {
/* special case -- power of FLT_RADIX to be */
@@ -2782,12 +2814,12 @@ drop_down:
aadj = 1./FLT_RADIX;
else
aadj *= 0.5;
- dval(aadj1) = -aadj;
+ aadj1 = -aadj;
}
}
else {
aadj *= 0.5;
- dval(aadj1) = dsign ? aadj : -aadj;
+ aadj1 = dsign ? aadj : -aadj;
#ifdef Check_FLT_ROUNDS
switch (Rounding) {
case 2: /* towards +infinity */
@@ -2799,7 +2831,7 @@ drop_down:
}
#else
if (Flt_Rounds == 0)
- dval(aadj1) += 0.5;
+ aadj1 += 0.5;
#endif /*Check_FLT_ROUNDS*/
}
y = word0(rv) & Exp_mask;
@@ -2809,7 +2841,7 @@ drop_down:
if (y == Exp_msk1*(DBL_MAX_EXP+Bias-1)) {
dval(rv0) = dval(rv);
word0(rv) -= P*Exp_msk1;
- adj = dval(aadj1) * ulp(dval(rv));
+ adj = aadj1 * ulp(dval(rv));
dval(rv) += adj;
if ((word0(rv) & Exp_mask) >=
Exp_msk1*(DBL_MAX_EXP+Bias-P)) {
@@ -2826,14 +2858,14 @@ drop_down:
#ifdef Avoid_Underflow
if (scale && y <= 2*P*Exp_msk1) {
if (aadj <= 0x7fffffff) {
- if ((z = (int)aadj) <= 0)
+ if ((z = aadj) <= 0)
z = 1;
aadj = z;
- dval(aadj1) = dsign ? aadj : -aadj;
+ aadj1 = dsign ? aadj : -aadj;
}
word0(aadj1) += (2*P+1)*Exp_msk1 - y;
}
- adj = dval(aadj1) * ulp(dval(rv));
+ adj = aadj1 * ulp(dval(rv));
dval(rv) += adj;
#else
#ifdef Sudden_Underflow
@@ -2984,7 +3016,7 @@ quorem(Bigint *b, Bigint *S)
carry = ys >> 32;
y = *bx - (ys & FFFFFFFF) - borrow;
borrow = y >> 32 & (ULong)1;
- *bx++ = (ULong)(y & FFFFFFFF);
+ *bx++ = y & FFFFFFFF;
#else
#ifdef Pack_32
si = *sx++;
@@ -3024,7 +3056,7 @@ quorem(Bigint *b, Bigint *S)
carry = ys >> 32;
y = *bx - (ys & FFFFFFFF) - borrow;
borrow = y >> 32 & (ULong)1;
- *bx++ = (ULong)(y & FFFFFFFF);
+ *bx++ = y & FFFFFFFF;
#else
#ifdef Pack_32
si = *sx++;
@@ -3060,18 +3092,27 @@ quorem(Bigint *b, Bigint *S)
static char *dtoa_result;
#endif
-#ifndef MULTIPLE_THREADS
static char *
rv_alloc(int i)
{
- return dtoa_result = xmalloc(i);
-}
-#else
-#define rv_alloc(i) xmalloc(i)
+ int j, k, *r;
+
+ j = sizeof(ULong);
+ for (k = 0;
+ sizeof(Bigint) - sizeof(ULong) - sizeof(int) + j <= i;
+ j <<= 1)
+ k++;
+ r = (int*)Balloc(k);
+ *r = k;
+ return
+#ifndef MULTIPLE_THREADS
+ dtoa_result =
#endif
+ (char *)(r+1);
+}
static char *
-nrv_alloc(const char *s, char **rve, size_t n)
+nrv_alloc(const char *s, char **rve, int n)
{
char *rv, *t;
@@ -3082,21 +3123,23 @@ nrv_alloc(const char *s, char **rve, size_t n)
return rv;
}
-#define rv_strdup(s, rve) nrv_alloc(s, rve, strlen(s)+1)
-
-#ifndef MULTIPLE_THREADS
/* freedtoa(s) must be used to free values s returned by dtoa
* when MULTIPLE_THREADS is #defined. It should be used in all cases,
* but for consistency with earlier versions of dtoa, it is optional
* when MULTIPLE_THREADS is not defined.
*/
-static void
+void
freedtoa(char *s)
{
- xfree(s);
-}
+ Bigint *b = (Bigint *)((int *)s - 1);
+ b->maxwds = 1 << (b->k = *(int*)b);
+ Bfree(b);
+#ifndef MULTIPLE_THREADS
+ if (s == dtoa_result)
+ dtoa_result = 0;
#endif
+}
/* dtoa for IEEE arithmetic (dmg): convert double to ASCII string.
*
@@ -3133,7 +3176,7 @@ freedtoa(char *s)
*/
char *
-ruby_dtoa(double d_, int mode, int ndigits, int *decpt, int *sign, char **rve)
+dtoa(double d, int mode, int ndigits, int *decpt, int *sign, char **rve)
{
/* Arguments ndigits, decpt, sign are similar to those
of ecvt and fcvt; trailing zeros are suppressed from
@@ -3178,8 +3221,7 @@ ruby_dtoa(double d_, int mode, int ndigits, int *decpt, int *sign, char **rve)
ULong x;
#endif
Bigint *b, *b1, *delta, *mlo = 0, *mhi = 0, *S;
- double ds;
- double_u d, d2, eps;
+ double d2, ds, eps;
char *s, *s0;
#ifdef Honor_FLT_ROUNDS
int rounding;
@@ -3188,8 +3230,6 @@ ruby_dtoa(double d_, int mode, int ndigits, int *decpt, int *sign, char **rve)
int inexact, oldinexact;
#endif
- dval(d) = d_;
-
#ifndef MULTIPLE_THREADS
if (dtoa_result) {
freedtoa(dtoa_result);
@@ -3216,9 +3256,9 @@ ruby_dtoa(double d_, int mode, int ndigits, int *decpt, int *sign, char **rve)
*decpt = 9999;
#ifdef IEEE_Arith
if (!word1(d) && !(word0(d) & 0xfffff))
- return rv_strdup("Infinity", rve);
+ return nrv_alloc("Infinity", rve, 8);
#endif
- return rv_strdup("NaN", rve);
+ return nrv_alloc("NaN", rve, 3);
}
#endif
#ifdef IBM
@@ -3226,7 +3266,7 @@ ruby_dtoa(double d_, int mode, int ndigits, int *decpt, int *sign, char **rve)
#endif
if (!dval(d)) {
*decpt = 1;
- return rv_strdup("0", rve);
+ return nrv_alloc("0", rve, 1);
}
#ifdef SET_INEXACT
@@ -3369,7 +3409,7 @@ ruby_dtoa(double d_, int mode, int ndigits, int *decpt, int *sign, char **rve)
if (i <= 0)
i = 1;
}
- s = s0 = rv_alloc(i+1);
+ s = s0 = rv_alloc(i);
#ifdef Honor_FLT_ROUNDS
if (mode > 1 && rounding != 1)
@@ -3435,7 +3475,7 @@ ruby_dtoa(double d_, int mode, int ndigits, int *decpt, int *sign, char **rve)
*/
dval(eps) = 0.5/tens[ilim-1] - dval(eps);
for (i = 0;;) {
- L = (int)dval(d);
+ L = dval(d);
dval(d) -= L;
*s++ = '0' + (int)L;
if (dval(d) < dval(eps))
@@ -3817,14 +3857,11 @@ ruby_each_words(const char *str, void (*func)(const char*, int, void*), void *ar
if (!*str) break;
end = str;
while (*end && !ISSPACE(*end) && *end != ',') end++;
- len = (int)(end - str); /* assume no string exceeds INT_MAX */
+ len = end - str;
(*func)(str, len, arg);
}
}
#ifdef __cplusplus
-#if 0
-{
-#endif
}
#endif
diff --git a/util.h b/util.h
new file mode 100644
index 0000000000..b00c096dec
--- /dev/null
+++ b/util.h
@@ -0,0 +1,67 @@
+/**********************************************************************
+
+ util.h -
+
+ $Author$
+ $Date$
+ created at: Thu Mar 9 11:55:53 JST 1995
+
+ Copyright (C) 1993-2003 Yukihiro Matsumoto
+
+**********************************************************************/
+
+#ifndef UTIL_H
+#define UTIL_H
+
+#ifndef _
+#ifdef __cplusplus
+# ifndef HAVE_PROTOTYPES
+# define HAVE_PROTOTYPES 1
+# endif
+# ifndef HAVE_STDARG_PROTOTYPES
+# define HAVE_STDARG_PROTOTYPES 1
+# endif
+#endif
+#ifdef HAVE_PROTOTYPES
+# define _(args) args
+#else
+# define _(args) ()
+#endif
+#ifdef HAVE_STDARG_PROTOTYPES
+# define __(args) args
+#else
+# define __(args) ()
+#endif
+#endif
+
+#define scan_oct ruby_scan_oct
+unsigned long scan_oct _((const char*, int, int*));
+#define scan_hex ruby_scan_hex
+unsigned long scan_hex _((const char*, int, int*));
+
+#if defined(MSDOS) || defined(__CYGWIN32__) || defined(_WIN32)
+void ruby_add_suffix();
+#endif
+
+void ruby_qsort _((void*, const int, const int, int (*)(), void*));
+#define qsort(b,n,s,c,d) ruby_qsort(b,n,s,c,d)
+
+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)
+
+#endif /* UTIL_H */
diff --git a/variable.c b/variable.c
index 1d8e4133c2..53143ca190 100644
--- a/variable.c
+++ b/variable.c
@@ -3,34 +3,33 @@
variable.c -
$Author$
+ $Date$
created at: Tue Apr 19 23:55:15 JST 1994
- Copyright (C) 1993-2007 Yukihiro Matsumoto
+ Copyright (C) 1993-2003 Yukihiro Matsumoto
Copyright (C) 2000 Network Applied Communication Laboratory, Inc.
Copyright (C) 2000 Information-technology Promotion Agency, Japan
**********************************************************************/
-#include "ruby/ruby.h"
-#include "ruby/st.h"
-#include "ruby/util.h"
+#include "ruby.h"
+#include "env.h"
#include "node.h"
-
-void rb_vm_change_state(void);
-void rb_vm_inc_const_missing_count(void);
+#include "st.h"
+#include "util.h"
st_table *rb_global_tbl;
st_table *rb_class_tbl;
static ID autoload, classpath, tmp_classpath;
void
-Init_var_tables(void)
+Init_var_tables()
{
rb_global_tbl = st_init_numtable();
rb_class_tbl = st_init_numtable();
- CONST_ID(autoload, "__autoload__");
- CONST_ID(classpath, "__classpath__");
- CONST_ID(tmp_classpath, "__tmp_classpath__");
+ autoload = rb_intern("__autoload__");
+ classpath = rb_intern("__classpath__");
+ tmp_classpath = rb_intern("__tmp_classpath__");
}
struct fc_result {
@@ -42,33 +41,37 @@ struct fc_result {
};
static VALUE
-fc_path(struct fc_result *fc, ID name)
+fc_path(fc, name)
+ struct fc_result *fc;
+ ID name;
{
VALUE path, tmp;
- path = rb_str_dup(rb_id2str(name));
+ path = rb_str_new2(rb_id2name(name));
while (fc) {
if (fc->track == rb_cObject) break;
- if (RCLASS_IV_TBL(fc->track) &&
- st_lookup(RCLASS_IV_TBL(fc->track), classpath, &tmp)) {
+ if (ROBJECT(fc->track)->iv_tbl &&
+ st_lookup(ROBJECT(fc->track)->iv_tbl, classpath, &tmp)) {
tmp = rb_str_dup(tmp);
rb_str_cat2(tmp, "::");
rb_str_append(tmp, path);
- path = tmp;
- break;
+
+ return tmp;
}
- tmp = rb_str_dup(rb_id2str(fc->name));
+ tmp = rb_str_new2(rb_id2name(fc->name));
rb_str_cat2(tmp, "::");
rb_str_append(tmp, path);
path = tmp;
fc = fc->prev;
}
- OBJ_FREEZE(path);
return path;
}
static int
-fc_i(ID key, VALUE value, struct fc_result *res)
+fc_i(key, value, res)
+ ID key;
+ VALUE value;
+ struct fc_result *res;
{
if (!rb_is_const_id(key)) return ST_CONTINUE;
@@ -79,7 +82,7 @@ fc_i(ID key, VALUE value, struct fc_result *res)
switch (TYPE(value)) {
case T_MODULE:
case T_CLASS:
- if (!RCLASS_IV_TBL(value)) return ST_CONTINUE;
+ if (!RCLASS(value)->iv_tbl) return ST_CONTINUE;
else {
struct fc_result arg;
struct fc_result *list;
@@ -95,7 +98,7 @@ fc_i(ID key, VALUE value, struct fc_result *res)
arg.klass = res->klass;
arg.track = value;
arg.prev = res;
- st_foreach(RCLASS_IV_TBL(value), fc_i, (st_data_t)&arg);
+ st_foreach_safe(RCLASS(value)->iv_tbl, fc_i, (st_data_t)&arg);
if (arg.path) {
res->path = arg.path;
return ST_STOP;
@@ -110,7 +113,8 @@ fc_i(ID key, VALUE value, struct fc_result *res)
}
static VALUE
-find_class_path(VALUE klass)
+find_class_path(klass)
+ VALUE klass;
{
struct fc_result arg;
@@ -119,44 +123,40 @@ find_class_path(VALUE klass)
arg.klass = klass;
arg.track = rb_cObject;
arg.prev = 0;
- if (RCLASS_IV_TBL(rb_cObject)) {
- st_foreach_safe(RCLASS_IV_TBL(rb_cObject), fc_i, (st_data_t)&arg);
+ if (RCLASS(rb_cObject)->iv_tbl) {
+ st_foreach_safe(RCLASS(rb_cObject)->iv_tbl, fc_i, (st_data_t)&arg);
}
if (arg.path == 0) {
- st_foreach_safe(rb_class_tbl, fc_i, (st_data_t)&arg);
+ st_foreach(rb_class_tbl, fc_i, (st_data_t)&arg);
}
if (arg.path) {
- if (!RCLASS_IV_TBL(klass)) {
- RCLASS_IV_TBL(klass) = st_init_numtable();
+ if (!ROBJECT(klass)->iv_tbl) {
+ ROBJECT(klass)->iv_tbl = st_init_numtable();
}
- st_insert(RCLASS_IV_TBL(klass), classpath, arg.path);
- st_delete(RCLASS_IV_TBL(klass), &tmp_classpath, 0);
+ st_insert(ROBJECT(klass)->iv_tbl, classpath, arg.path);
+ st_delete(RCLASS(klass)->iv_tbl, &tmp_classpath, 0);
return arg.path;
}
return Qnil;
}
static VALUE
-classname(VALUE klass)
+classname(klass)
+ VALUE klass;
{
VALUE path = Qnil;
if (!klass) klass = rb_cObject;
- if (RCLASS_IV_TBL(klass)) {
- if (!st_lookup(RCLASS_IV_TBL(klass), classpath, &path)) {
- ID classid;
- st_data_t n;
-
- CONST_ID(classid, "__classid__");
+ if (ROBJECT(klass)->iv_tbl) {
+ if (!st_lookup(ROBJECT(klass)->iv_tbl, classpath, &path)) {
+ ID classid = rb_intern("__classid__");
- if (!st_lookup(RCLASS_IV_TBL(klass), classid, &path)) {
+ if (!st_lookup(ROBJECT(klass)->iv_tbl, classid, &path)) {
return find_class_path(klass);
}
- path = rb_str_dup(rb_id2str(SYM2ID(path)));
- OBJ_FREEZE(path);
- st_insert(RCLASS_IV_TBL(klass), classpath, path);
- n = classid;
- st_delete(RCLASS_IV_TBL(klass), &n, 0);
+ path = rb_str_new2(rb_id2name(SYM2ID(path)));
+ st_insert(ROBJECT(klass)->iv_tbl, classpath, path);
+ st_delete(RCLASS(klass)->iv_tbl, (st_data_t*)&classid, 0);
}
if (TYPE(path) != T_STRING) {
rb_bug("class path is not set properly");
@@ -169,31 +169,34 @@ classname(VALUE klass)
/*
* call-seq:
* mod.name => string
- *
- * Returns the name of the module <i>mod</i>. Returns nil for anonymous modules.
+ *
+ * Returns the name of the module <i>mod</i>.
*/
VALUE
-rb_mod_name(VALUE mod)
+rb_mod_name(mod)
+ VALUE mod;
{
VALUE path = classname(mod);
if (!NIL_P(path)) return rb_str_dup(path);
- return path;
+ return rb_str_new(0,0);
}
VALUE
-rb_class_path(VALUE klass)
+rb_class_path(klass)
+ VALUE klass;
{
VALUE path = classname(klass);
if (!NIL_P(path)) return path;
- if (RCLASS_IV_TBL(klass) && st_lookup(RCLASS_IV_TBL(klass),
+ if (RCLASS(klass)->iv_tbl && st_lookup(RCLASS(klass)->iv_tbl,
tmp_classpath, &path)) {
return path;
}
else {
const char *s = "Class";
+ size_t len;
if (TYPE(klass) == T_MODULE) {
if (rb_obj_class(klass) == rb_cModule) {
@@ -203,8 +206,10 @@ rb_class_path(VALUE klass)
s = rb_class2name(RBASIC(klass)->klass);
}
}
- path = rb_sprintf("#<%s:%p>", s, (void*)klass);
- OBJ_FREEZE(path);
+ len = 2 + strlen(s) + 3 + 2 * SIZEOF_LONG + 1;
+ path = rb_str_new(0, len);
+ snprintf(RSTRING(path)->ptr, len+1, "#<%s:0x%lx>", s, klass);
+ RSTRING(path)->len = strlen(RSTRING(path)->ptr);
rb_ivar_set(klass, tmp_classpath, path);
return path;
@@ -212,7 +217,9 @@ rb_class_path(VALUE klass)
}
void
-rb_set_class_path(VALUE klass, VALUE under, const char *name)
+rb_set_class_path(klass, under, name)
+ VALUE klass, under;
+ const char *name;
{
VALUE str;
@@ -224,16 +231,17 @@ rb_set_class_path(VALUE klass, VALUE under, const char *name)
rb_str_cat2(str, "::");
rb_str_cat2(str, name);
}
- OBJ_FREEZE(str);
rb_ivar_set(klass, classpath, str);
}
VALUE
-rb_path2class(const char *path)
+rb_path2class(path)
+ const char *path;
{
const char *pbeg, *p;
ID id;
VALUE c = rb_cObject;
+ VALUE str = 0;
if (path[0] == '#') {
rb_raise(rb_eArgError, "can't retrieve anonymous class %s", path);
@@ -241,7 +249,14 @@ rb_path2class(const char *path)
pbeg = p = path;
while (*p) {
while (*p && *p != ':') p++;
- id = rb_intern2(pbeg, p-pbeg);
+ if (str) {
+ RSTRING(str)->len = 0;
+ rb_str_cat(str, pbeg, p-pbeg);
+ }
+ else {
+ str = rb_str_new(pbeg, p-pbeg);
+ }
+ id = rb_intern(RSTRING(str)->ptr);
if (p[0] == ':') {
if (p[1] != ':') goto undefined_class;
p += 2;
@@ -249,7 +264,7 @@ rb_path2class(const char *path)
}
if (!rb_const_defined(c, id)) {
undefined_class:
- rb_raise(rb_eArgError, "undefined class/module %.*s", (int)(p-path), path);
+ rb_raise(rb_eArgError, "undefined class/module %.*s", p-path, path);
}
c = rb_const_get_at(c, id);
switch (TYPE(c)) {
@@ -257,7 +272,7 @@ rb_path2class(const char *path)
case T_CLASS:
break;
default:
- rb_raise(rb_eTypeError, "%s does not refer to class/module", path);
+ rb_raise(rb_eTypeError, "%s does not refer class/module", path);
}
}
@@ -265,39 +280,37 @@ rb_path2class(const char *path)
}
void
-rb_name_class(VALUE klass, ID id)
+rb_name_class(klass, id)
+ VALUE klass;
+ ID id;
{
rb_iv_set(klass, "__classid__", ID2SYM(id));
}
VALUE
-rb_class_name(VALUE klass)
+rb_class_name(klass)
+ VALUE klass;
{
return rb_class_path(rb_class_real(klass));
}
const char *
-rb_class2name(VALUE klass)
+rb_class2name(klass)
+ VALUE klass;
{
- return RSTRING_PTR(rb_class_name(klass));
+ return RSTRING(rb_class_name(klass))->ptr;
}
const char *
-rb_obj_classname(VALUE obj)
+rb_obj_classname(obj)
+ VALUE obj;
{
return rb_class2name(CLASS_OF(obj));
}
-#define global_variable rb_global_variable
-#define global_entry rb_global_entry
-
-#define gvar_getter_t rb_gvar_getter_t
-#define gvar_setter_t rb_gvar_setter_t
-#define gvar_marker_t rb_gvar_marker_t
-
struct trace_var {
int removed;
- void (*func)(VALUE arg, VALUE val);
+ void (*func)();
VALUE data;
struct trace_var *next;
};
@@ -305,29 +318,33 @@ struct trace_var {
struct global_variable {
int counter;
void *data;
- gvar_getter_t *getter;
- gvar_setter_t *setter;
- gvar_marker_t *marker;
+ VALUE (*getter)();
+ void (*setter)();
+ void (*marker)();
int block_trace;
struct trace_var *trace;
};
-#define undef_getter rb_gvar_undef_getter
-#define undef_setter rb_gvar_undef_setter
-#define undef_marker rb_gvar_undef_marker
+struct global_entry {
+ struct global_variable *var;
+ ID id;
+};
-#define val_getter rb_gvar_val_getter
-#define val_setter rb_gvar_val_setter
-#define val_marker rb_gvar_val_marker
+static VALUE undef_getter();
+static void undef_setter();
+static void undef_marker();
-#define var_getter rb_gvar_var_getter
-#define var_setter rb_gvar_var_setter
-#define var_marker rb_gvar_var_marker
+static VALUE val_getter();
+static void val_setter();
+static void val_marker();
-#define readonly_setter rb_gvar_readonly_setter
+static VALUE var_getter();
+static void var_setter();
+static void var_marker();
struct global_entry*
-rb_global_entry(ID id)
+rb_global_entry(id)
+ ID id;
{
struct global_entry *entry;
st_data_t data;
@@ -354,16 +371,21 @@ rb_global_entry(ID id)
return entry;
}
-VALUE
-undef_getter(ID id, void *data, struct global_variable *var)
+static VALUE
+undef_getter(id)
+ ID id;
{
rb_warning("global variable `%s' not initialized", rb_id2name(id));
return Qnil;
}
-void
-undef_setter(VALUE val, ID id, void *data, struct global_variable *var)
+static void
+undef_setter(val, id, data, var)
+ VALUE val;
+ ID id;
+ void *data;
+ struct global_variable *var;
{
var->getter = val_getter;
var->setter = val_setter;
@@ -372,58 +394,74 @@ undef_setter(VALUE val, ID id, void *data, struct global_variable *var)
var->data = (void*)val;
}
-void
-undef_marker(VALUE *var)
+static void
+undef_marker()
{
}
-VALUE
-val_getter(ID id, void *data, struct global_variable *var)
+static VALUE
+val_getter(id, val)
+ ID id;
+ VALUE val;
{
- return (VALUE)data;
+ return val;
}
-void
-val_setter(VALUE val, ID id, void *data, struct global_variable *var)
+static void
+val_setter(val, id, data, var)
+ VALUE val;
+ ID id;
+ void *data;
+ struct global_variable *var;
{
var->data = (void*)val;
}
-void
-val_marker(VALUE *var)
+static void
+val_marker(data)
+ VALUE data;
{
- VALUE data = (VALUE)var;
if (data) rb_gc_mark_maybe(data);
}
-VALUE
-var_getter(ID id, void *data, struct global_variable *gvar)
+static VALUE
+var_getter(id, var)
+ ID id;
+ VALUE *var;
{
- VALUE *var = data;
if (!var) return Qnil;
return *var;
}
-void
-var_setter(VALUE val, ID id, void *data, struct global_variable *gvar)
+static void
+var_setter(val, id, var)
+ VALUE val;
+ ID id;
+ VALUE *var;
{
- *(VALUE *)data = val;
+ *var = val;
}
-void
-var_marker(VALUE *var)
+static void
+var_marker(var)
+ VALUE *var;
{
if (var) rb_gc_mark_maybe(*var);
}
-void
-readonly_setter(VALUE val, ID id, void *data, struct global_variable *gvar)
+static void
+readonly_setter(val, id, var)
+ VALUE val;
+ ID id;
+ void *var;
{
rb_name_error(id, "%s is a read-only variable", rb_id2name(id));
}
static int
-mark_global_entry(ID key, struct global_entry *entry)
+mark_global_entry(key, entry)
+ ID key;
+ struct global_entry *entry;
{
struct trace_var *trace;
struct global_variable *var = entry->var;
@@ -438,64 +476,67 @@ mark_global_entry(ID key, struct global_entry *entry)
}
void
-rb_gc_mark_global_tbl(void)
+rb_gc_mark_global_tbl()
{
- if (rb_global_tbl)
- st_foreach_safe(rb_global_tbl, mark_global_entry, 0);
+ if (rb_global_tbl) {
+ st_foreach(rb_global_tbl, mark_global_entry, 0);
+ }
}
static ID
-global_id(const char *name)
+global_id(name)
+ const char *name;
{
ID id;
if (name[0] == '$') id = rb_intern(name);
else {
- size_t len = strlen(name);
- char *buf = ALLOCA_N(char, len+1);
+ char *buf = ALLOCA_N(char, strlen(name)+2);
buf[0] = '$';
- memcpy(buf+1, name, len);
- id = rb_intern2(buf, len+1);
+ strcpy(buf+1, name);
+ id = rb_intern(buf);
}
return id;
}
void
-rb_define_hooked_variable(
- const char *name,
- VALUE *var,
- VALUE (*getter)(ANYARGS),
- void (*setter)(ANYARGS))
+rb_define_hooked_variable(name, var, getter, setter)
+ const char *name;
+ VALUE *var;
+ VALUE (*getter)();
+ void (*setter)();
{
- volatile VALUE tmp = var ? *var : Qnil;
+ struct global_variable *gvar;
ID id = global_id(name);
- struct global_variable *gvar = rb_global_entry(id)->var;
+ gvar = rb_global_entry(id)->var;
gvar->data = (void*)var;
- gvar->getter = getter?(gvar_getter_t *)getter:var_getter;
- gvar->setter = setter?(gvar_setter_t *)setter:var_setter;
+ gvar->getter = getter?getter:var_getter;
+ gvar->setter = setter?setter:var_setter;
gvar->marker = var_marker;
-
- RB_GC_GUARD(tmp);
}
void
-rb_define_variable(const char *name, VALUE *var)
+rb_define_variable(name, var)
+ const char *name;
+ VALUE *var;
{
rb_define_hooked_variable(name, var, 0, 0);
}
void
-rb_define_readonly_variable(const char *name, VALUE *var)
+rb_define_readonly_variable(name, var)
+ const char *name;
+ VALUE *var;
{
rb_define_hooked_variable(name, var, 0, readonly_setter);
}
void
-rb_define_virtual_variable(
- const char *name,
- VALUE (*getter)(ANYARGS),
- void (*setter)(ANYARGS))
+rb_define_virtual_variable(name, getter, setter)
+ const char *name;
+ VALUE (*getter)();
+ void (*setter)();
{
if (!getter) getter = val_getter;
if (!setter) setter = readonly_setter;
@@ -503,7 +544,8 @@ rb_define_virtual_variable(
}
static void
-rb_trace_eval(VALUE cmd, VALUE val)
+rb_trace_eval(cmd, val)
+ VALUE cmd, val;
{
rb_eval_cmd(cmd, rb_ary_new3(1, val), 0);
}
@@ -512,7 +554,7 @@ rb_trace_eval(VALUE cmd, VALUE val)
* 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
@@ -520,19 +562,21 @@ rb_trace_eval(VALUE cmd, VALUE val)
* is assigned. The block or +Proc+ object receives the
* variable's new value as a parameter. Also see
* <code>Kernel::untrace_var</code>.
- *
+ *
* trace_var :$_, proc {|v| puts "$_ is now '#{v}'" }
* $_ = "hello"
* $_ = ' there'
- *
+ *
* <em>produces:</em>
- *
+ *
* $_ is now 'hello'
* $_ is now ' there'
*/
VALUE
-rb_f_trace_var(int argc, VALUE *argv)
+rb_f_trace_var(argc, argv)
+ int argc;
+ VALUE *argv;
{
VALUE var, cmd;
struct global_entry *entry;
@@ -560,7 +604,8 @@ rb_f_trace_var(int argc, VALUE *argv)
}
static void
-remove_trace(struct global_variable *var)
+remove_trace(var)
+ struct global_variable *var;
{
struct trace_var *trace = var->trace;
struct trace_var t;
@@ -572,7 +617,7 @@ remove_trace(struct global_variable *var)
next = trace->next;
if (next->removed) {
trace->next = next->next;
- xfree(next);
+ free(next);
}
else {
trace = next;
@@ -584,7 +629,7 @@ remove_trace(struct global_variable *var)
/*
* 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
@@ -592,7 +637,9 @@ remove_trace(struct global_variable *var)
*/
VALUE
-rb_f_untrace_var(int argc, VALUE *argv)
+rb_f_untrace_var(argc, argv)
+ int argc;
+ VALUE *argv;
{
VALUE var, cmd;
ID id;
@@ -635,7 +682,8 @@ rb_f_untrace_var(int argc, VALUE *argv)
}
VALUE
-rb_gvar_get(struct global_entry *entry)
+rb_gvar_get(entry)
+ struct global_entry *entry;
{
struct global_variable *var = entry->var;
return (*var->getter)(entry->id, var->data, var);
@@ -647,7 +695,8 @@ struct trace_data {
};
static VALUE
-trace_ev(struct trace_data *data)
+trace_ev(data)
+ struct trace_data *data;
{
struct trace_var *trace = data->trace;
@@ -659,7 +708,8 @@ trace_ev(struct trace_data *data)
}
static VALUE
-trace_en(struct global_variable *var)
+trace_en(var)
+ struct global_variable *var;
{
var->block_trace = 0;
remove_trace(var);
@@ -667,7 +717,9 @@ trace_en(struct global_variable *var)
}
VALUE
-rb_gvar_set(struct global_entry *entry, VALUE val)
+rb_gvar_set(entry, val)
+ struct global_entry *entry;
+ VALUE val;
{
struct trace_data trace;
struct global_variable *var = entry->var;
@@ -686,7 +738,9 @@ rb_gvar_set(struct global_entry *entry, VALUE val)
}
VALUE
-rb_gv_set(const char *name, VALUE val)
+rb_gv_set(name, val)
+ const char *name;
+ VALUE val;
{
struct global_entry *entry;
@@ -695,7 +749,8 @@ rb_gv_set(const char *name, VALUE val)
}
VALUE
-rb_gv_get(const char *name)
+rb_gv_get(name)
+ const char *name;
{
struct global_entry *entry;
@@ -704,46 +759,53 @@ rb_gv_get(const char *name)
}
VALUE
-rb_gvar_defined(struct global_entry *entry)
+rb_gvar_defined(entry)
+ struct global_entry *entry;
{
if (entry->var->getter == undef_getter) return Qfalse;
return Qtrue;
}
static int
-gvar_i(ID key, struct global_entry *entry, VALUE ary)
+gvar_i(key, entry, ary)
+ ID key;
+ struct global_entry *entry;
+ VALUE ary;
{
- rb_ary_push(ary, ID2SYM(key));
+ rb_ary_push(ary, rb_str_new2(rb_id2name(key)));
return ST_CONTINUE;
}
/*
* call-seq:
* global_variables => array
- *
+ *
* Returns an array of the names of global variables.
- *
- * global_variables.grep /std/ #=> [:$stdin, :$stdout, :$stderr]
+ *
+ * global_variables.grep /std/ #=> ["$stderr", "$stdout", "$stdin"]
*/
VALUE
-rb_f_global_variables(void)
+rb_f_global_variables()
{
VALUE ary = rb_ary_new();
- char buf[2];
- int i;
-
- st_foreach_safe(rb_global_tbl, gvar_i, ary);
- buf[0] = '$';
- for (i = 1; i <= 9; ++i) {
- buf[1] = (char)(i + '0');
- rb_ary_push(ary, ID2SYM(rb_intern2(buf, 2)));
+ char buf[4];
+ const char *s = "&`'+123456789";
+
+ st_foreach(rb_global_tbl, gvar_i, ary);
+ if (!NIL_P(rb_backref_get())) {
+ while (*s) {
+ sprintf(buf, "$%c", *s++);
+ rb_ary_push(ary, rb_str_new2(buf));
+ }
}
return ary;
}
void
-rb_alias_variable(ID name1, ID name2)
+rb_alias_variable(name1, name2)
+ ID name1;
+ ID name2;
{
struct global_entry *entry1, *entry2;
st_data_t data1;
@@ -753,7 +815,7 @@ rb_alias_variable(ID name1, ID name2)
entry2 = rb_global_entry(name2);
if (!st_lookup(rb_global_tbl, name1, &data1)) {
- entry1 = ALLOC(struct global_entry);
+ entry1 = ALLOC(struct global_entry);
entry1->id = name1;
st_add_direct(rb_global_tbl, name1, (st_data_t)entry1);
}
@@ -767,10 +829,10 @@ rb_alias_variable(ID name1, ID name2)
struct trace_var *trace = var->trace;
while (trace) {
struct trace_var *next = trace->next;
- xfree(trace);
+ free(trace);
trace = next;
}
- xfree(var);
+ free(var);
}
}
else {
@@ -784,7 +846,8 @@ static int special_generic_ivar = 0;
static st_table *generic_iv_tbl;
st_table*
-rb_generic_ivar_table(VALUE obj)
+rb_generic_ivar_table(obj)
+ VALUE obj;
{
st_data_t tbl;
@@ -795,7 +858,10 @@ rb_generic_ivar_table(VALUE obj)
}
static VALUE
-generic_ivar_get(VALUE obj, ID id, int warn)
+generic_ivar_get(obj, id, warn)
+ VALUE obj;
+ ID id;
+ int warn;
{
st_data_t tbl;
VALUE val;
@@ -814,18 +880,21 @@ generic_ivar_get(VALUE obj, ID id, int warn)
}
static void
-generic_ivar_set(VALUE obj, ID id, VALUE val)
+generic_ivar_set(obj, id, val)
+ VALUE obj;
+ ID id;
+ VALUE val;
{
st_table *tbl;
st_data_t data;
if (rb_special_const_p(obj)) {
- if (rb_obj_frozen_p(obj)) rb_error_frozen("object");
special_generic_ivar = 1;
}
if (!generic_iv_tbl) {
generic_iv_tbl = st_init_numtable();
}
+
if (!st_lookup(generic_iv_tbl, obj, &data)) {
FL_SET(obj, FL_EXIVAR);
tbl = st_init_numtable();
@@ -837,7 +906,9 @@ generic_ivar_set(VALUE obj, ID id, VALUE val)
}
static VALUE
-generic_ivar_defined(VALUE obj, ID id)
+generic_ivar_defined(obj, id)
+ VALUE obj;
+ ID id;
{
st_table *tbl;
st_data_t data;
@@ -853,7 +924,10 @@ generic_ivar_defined(VALUE obj, ID id)
}
static int
-generic_ivar_remove(VALUE obj, ID id, VALUE *valp)
+generic_ivar_remove(obj, id, valp)
+ VALUE obj;
+ ID id;
+ VALUE *valp;
{
st_table *tbl;
st_data_t data;
@@ -871,7 +945,8 @@ generic_ivar_remove(VALUE obj, ID id, VALUE *valp)
}
void
-rb_mark_generic_ivar(VALUE obj)
+rb_mark_generic_ivar(obj)
+ VALUE obj;
{
st_data_t tbl;
@@ -882,23 +957,27 @@ rb_mark_generic_ivar(VALUE obj)
}
static int
-givar_mark_i(ID key, VALUE value)
+givar_mark_i(key, value)
+ ID key;
+ VALUE value;
{
rb_gc_mark(value);
return ST_CONTINUE;
}
static int
-givar_i(VALUE obj, st_table *tbl)
+givar_i(obj, tbl)
+ VALUE obj;
+ st_table *tbl;
{
if (rb_special_const_p(obj)) {
- st_foreach_safe(tbl, givar_mark_i, 0);
+ st_foreach(tbl, givar_mark_i, 0);
}
return ST_CONTINUE;
}
void
-rb_mark_generic_ivar_tbl(void)
+rb_mark_generic_ivar_tbl()
{
if (!generic_iv_tbl) return;
if (special_generic_ivar == 0) return;
@@ -906,7 +985,8 @@ rb_mark_generic_ivar_tbl(void)
}
void
-rb_free_generic_ivar(VALUE obj)
+rb_free_generic_ivar(obj)
+ VALUE obj;
{
st_data_t tbl;
@@ -915,69 +995,40 @@ rb_free_generic_ivar(VALUE obj)
st_free_table((st_table *)tbl);
}
-size_t
-rb_generic_ivar_memsize(VALUE obj)
-{
- st_data_t tbl;
- if (st_delete(generic_iv_tbl, &obj, &tbl))
- return st_memsize((st_table *)tbl);
- return 0;
-}
-
void
-rb_copy_generic_ivar(VALUE clone, VALUE obj)
+rb_copy_generic_ivar(clone, obj)
+ VALUE clone, obj;
{
st_data_t data;
if (!generic_iv_tbl) return;
- if (!FL_TEST(obj, FL_EXIVAR)) {
-clear:
- if (FL_TEST(clone, FL_EXIVAR)) {
- rb_free_generic_ivar(clone);
- FL_UNSET(clone, FL_EXIVAR);
- }
- return;
- }
+ if (!FL_TEST(obj, FL_EXIVAR)) return;
if (st_lookup(generic_iv_tbl, obj, &data)) {
st_table *tbl = (st_table *)data;
- if (tbl->num_entries == 0)
- goto clear;
-
if (st_lookup(generic_iv_tbl, clone, &data)) {
st_free_table((st_table *)data);
st_insert(generic_iv_tbl, clone, (st_data_t)st_copy(tbl));
}
else {
st_add_direct(generic_iv_tbl, clone, (st_data_t)st_copy(tbl));
- FL_SET(clone, FL_EXIVAR);
}
}
}
static VALUE
-ivar_get(VALUE obj, ID id, int warn)
+ivar_get(obj, id, warn)
+ VALUE obj;
+ ID id;
+ int warn;
{
- VALUE val, *ptr;
- struct st_table *iv_index_tbl;
- long len;
- st_data_t index;
+ VALUE val;
switch (TYPE(obj)) {
case T_OBJECT:
- len = ROBJECT_NUMIV(obj);
- ptr = ROBJECT_IVPTR(obj);
- iv_index_tbl = ROBJECT_IV_INDEX_TBL(obj);
- if (!iv_index_tbl) break;
- if (!st_lookup(iv_index_tbl, id, &index)) break;
- if (len <= (long)index) break;
- val = ptr[index];
- if (val != Qundef)
- return val;
- break;
case T_CLASS:
case T_MODULE:
- if (RCLASS_IV_TBL(obj) && st_lookup(RCLASS_IV_TBL(obj), id, &val))
+ if (ROBJECT(obj)->iv_tbl && st_lookup(ROBJECT(obj)->iv_tbl, id, &val))
return val;
break;
default:
@@ -992,84 +1043,37 @@ ivar_get(VALUE obj, ID id, int warn)
}
VALUE
-rb_ivar_get(VALUE obj, ID id)
+rb_ivar_get(obj, id)
+ VALUE obj;
+ ID id;
{
return ivar_get(obj, id, Qtrue);
}
VALUE
-rb_attr_get(VALUE obj, ID id)
+rb_attr_get(obj, id)
+ VALUE obj;
+ ID id;
{
return ivar_get(obj, id, Qfalse);
}
VALUE
-rb_ivar_set(VALUE obj, ID id, VALUE val)
+rb_ivar_set(obj, id, val)
+ VALUE obj;
+ ID id;
+ VALUE val;
{
- struct st_table *iv_index_tbl;
- st_data_t index;
- long i, len;
- int ivar_extended;
-
- if (!OBJ_UNTRUSTED(obj) && rb_safe_level() >= 4)
+ if (!OBJ_TAINTED(obj) && rb_safe_level() >= 4)
rb_raise(rb_eSecurityError, "Insecure: can't modify instance variable");
if (OBJ_FROZEN(obj)) rb_error_frozen("object");
switch (TYPE(obj)) {
case T_OBJECT:
- iv_index_tbl = ROBJECT_IV_INDEX_TBL(obj);
- if (!iv_index_tbl) {
- VALUE klass = rb_obj_class(obj);
- iv_index_tbl = RCLASS_IV_INDEX_TBL(klass);
- if (!iv_index_tbl) {
- iv_index_tbl = RCLASS_IV_INDEX_TBL(klass) = st_init_numtable();
- }
- }
- ivar_extended = 0;
- if (!st_lookup(iv_index_tbl, id, &index)) {
- index = iv_index_tbl->num_entries;
- st_add_direct(iv_index_tbl, id, index);
- ivar_extended = 1;
- }
- len = ROBJECT_NUMIV(obj);
- if (len <= (long)index) {
- VALUE *ptr = ROBJECT_IVPTR(obj);
- if (index < ROBJECT_EMBED_LEN_MAX) {
- RBASIC(obj)->flags |= ROBJECT_EMBED;
- ptr = ROBJECT(obj)->as.ary;
- for (i = 0; i < ROBJECT_EMBED_LEN_MAX; i++) {
- ptr[i] = Qundef;
- }
- }
- else {
- VALUE *newptr;
- long newsize = (index+1) + (index+1)/4; /* (index+1)*1.25 */
- if (!ivar_extended &&
- iv_index_tbl->num_entries < (st_index_t)newsize) {
- newsize = iv_index_tbl->num_entries;
- }
- if (RBASIC(obj)->flags & ROBJECT_EMBED) {
- newptr = ALLOC_N(VALUE, newsize);
- MEMCPY(newptr, ptr, VALUE, len);
- RBASIC(obj)->flags &= ~ROBJECT_EMBED;
- ROBJECT(obj)->as.heap.ivptr = newptr;
- }
- else {
- REALLOC_N(ROBJECT(obj)->as.heap.ivptr, VALUE, newsize);
- newptr = ROBJECT(obj)->as.heap.ivptr;
- }
- for (; len < newsize; len++)
- newptr[len] = Qundef;
- ROBJECT(obj)->as.heap.numiv = newsize;
- ROBJECT(obj)->as.heap.iv_index_tbl = iv_index_tbl;
- }
- }
- ROBJECT_IVPTR(obj)[index] = val;
- break;
case T_CLASS:
case T_MODULE:
- if (!RCLASS_IV_TBL(obj)) RCLASS_IV_TBL(obj) = st_init_numtable();
- st_insert(RCLASS_IV_TBL(obj), id, val);
- break;
+ if (!ROBJECT(obj)->iv_tbl) ROBJECT(obj)->iv_tbl = st_init_numtable();
+ st_insert(ROBJECT(obj)->iv_tbl, id, val);
+ break;
default:
generic_ivar_set(obj, id, val);
break;
@@ -1078,24 +1082,15 @@ rb_ivar_set(VALUE obj, ID id, VALUE val)
}
VALUE
-rb_ivar_defined(VALUE obj, ID id)
+rb_ivar_defined(obj, id)
+ VALUE obj;
+ ID id;
{
- VALUE val;
- struct st_table *iv_index_tbl;
- st_data_t index;
switch (TYPE(obj)) {
case T_OBJECT:
- iv_index_tbl = ROBJECT_IV_INDEX_TBL(obj);
- if (!iv_index_tbl) break;
- if (!st_lookup(iv_index_tbl, id, &index)) break;
- if (ROBJECT_NUMIV(obj) <= (long)index) break;
- val = ROBJECT_IVPTR(obj)[index];
- if (val != Qundef)
- return Qtrue;
- break;
case T_CLASS:
case T_MODULE:
- if (RCLASS_IV_TBL(obj) && st_lookup(RCLASS_IV_TBL(obj), id, 0))
+ if (ROBJECT(obj)->iv_tbl && st_lookup(ROBJECT(obj)->iv_tbl, id, 0))
return Qtrue;
break;
default:
@@ -1106,71 +1101,14 @@ rb_ivar_defined(VALUE obj, ID id)
return Qfalse;
}
-struct obj_ivar_tag {
- VALUE obj;
- int (*func)(ID key, VALUE val, st_data_t arg);
- st_data_t arg;
-};
-
static int
-obj_ivar_i(ID key, VALUE index, struct obj_ivar_tag *data)
-{
- if ((long)index < ROBJECT_NUMIV(data->obj)) {
- VALUE val = ROBJECT_IVPTR(data->obj)[index];
- if (val != Qundef) {
- return (data->func)(key, val, data->arg);
- }
- }
- return ST_CONTINUE;
-}
-
-static void
-obj_ivar_each(VALUE obj, int (*func)(ANYARGS), st_data_t arg)
-{
- st_table *tbl;
- struct obj_ivar_tag data;
-
- tbl = ROBJECT_IV_INDEX_TBL(obj);
- if (!tbl)
- return;
-
- data.obj = obj;
- data.func = (int (*)(ID key, VALUE val, st_data_t arg))func;
- data.arg = arg;
-
- st_foreach_safe(tbl, obj_ivar_i, (st_data_t)&data);
-}
-
-void rb_ivar_foreach(VALUE obj, int (*func)(ANYARGS), st_data_t arg)
-{
- switch (TYPE(obj)) {
- case T_OBJECT:
- obj_ivar_each(obj, func, arg);
- break;
- case T_CLASS:
- case T_MODULE:
- if (RCLASS_IV_TBL(obj)) {
- st_foreach_safe(RCLASS_IV_TBL(obj), func, arg);
- }
- break;
- default:
- if (!generic_iv_tbl) break;
- if (FL_TEST(obj, FL_EXIVAR) || rb_special_const_p(obj)) {
- st_data_t tbl;
-
- if (st_lookup(generic_iv_tbl, obj, &tbl)) {
- st_foreach_safe((st_table *)tbl, func, arg);
- }
- }
- break;
- }
-}
-
-static int
-ivar_i(ID key, VALUE val, VALUE ary)
+ivar_i(key, entry, ary)
+ ID key;
+ struct global_entry *entry;
+ VALUE ary;
{
if (rb_is_instance_id(key)) {
- rb_ary_push(ary, ID2SYM(key));
+ rb_ary_push(ary, rb_str_new2(rb_id2name(key)));
}
return ST_CONTINUE;
}
@@ -1178,37 +1116,56 @@ ivar_i(ID key, VALUE val, VALUE ary)
/*
* call-seq:
* obj.instance_variables => array
- *
+ *
* Returns an array of instance variable names for the receiver. Note
* that simply defining an accessor does not create the corresponding
* instance variable.
- *
+ *
* class Fred
* attr_accessor :a1
* def initialize
* @iv = 3
* end
* end
- * Fred.new.instance_variables #=> [:@iv]
+ * Fred.new.instance_variables #=> ["@iv"]
*/
VALUE
-rb_obj_instance_variables(VALUE obj)
+rb_obj_instance_variables(obj)
+ VALUE obj;
{
VALUE ary;
ary = rb_ary_new();
- rb_ivar_foreach(obj, ivar_i, ary);
+ switch (TYPE(obj)) {
+ case T_OBJECT:
+ case T_CLASS:
+ case T_MODULE:
+ if (ROBJECT(obj)->iv_tbl) {
+ st_foreach_safe(ROBJECT(obj)->iv_tbl, ivar_i, ary);
+ }
+ break;
+ default:
+ if (!generic_iv_tbl) break;
+ if (FL_TEST(obj, FL_EXIVAR) || rb_special_const_p(obj)) {
+ st_data_t tbl;
+
+ if (st_lookup(generic_iv_tbl, obj, &tbl)) {
+ st_foreach_safe((st_table *)tbl, ivar_i, ary);
+ }
+ }
+ break;
+ }
return ary;
}
/*
* call-seq:
* obj.remove_instance_variable(symbol) => obj
- *
+ *
* Removes the named instance variable from <i>obj</i>, returning that
* variable's value.
- *
+ *
* class Dummy
* attr_reader :var
* def initialize
@@ -1225,15 +1182,13 @@ rb_obj_instance_variables(VALUE obj)
*/
VALUE
-rb_obj_remove_instance_variable(VALUE obj, VALUE name)
+rb_obj_remove_instance_variable(obj, name)
+ VALUE obj, name;
{
VALUE val = Qnil;
- const ID id = rb_to_id(name);
- st_data_t n, v;
- struct st_table *iv_index_tbl;
- st_data_t index;
+ ID id = rb_to_id(name);
- if (!OBJ_UNTRUSTED(obj) && rb_safe_level() >= 4)
+ if (!OBJ_TAINTED(obj) && rb_safe_level() >= 4)
rb_raise(rb_eSecurityError, "Insecure: can't modify instance variable");
if (OBJ_FROZEN(obj)) rb_error_frozen("object");
if (!rb_is_instance_id(id)) {
@@ -1242,21 +1197,10 @@ rb_obj_remove_instance_variable(VALUE obj, VALUE name)
switch (TYPE(obj)) {
case T_OBJECT:
- iv_index_tbl = ROBJECT_IV_INDEX_TBL(obj);
- if (!iv_index_tbl) break;
- if (!st_lookup(iv_index_tbl, id, &index)) break;
- if (ROBJECT_NUMIV(obj) <= (long)index) break;
- val = ROBJECT_IVPTR(obj)[index];
- if (val != Qundef) {
- ROBJECT_IVPTR(obj)[index] = Qundef;
- return val;
- }
- break;
case T_CLASS:
case T_MODULE:
- n = id;
- if (RCLASS_IV_TBL(obj) && st_delete(RCLASS_IV_TBL(obj), &n, &v)) {
- return (VALUE)v;
+ if (ROBJECT(obj)->iv_tbl && st_delete(ROBJECT(obj)->iv_tbl, (st_data_t*)&id, &val)) {
+ return val;
}
break;
default:
@@ -1271,9 +1215,11 @@ rb_obj_remove_instance_variable(VALUE obj, VALUE name)
return Qnil; /* not reached */
}
-NORETURN(static void uninitialized_constant(VALUE, ID));
+NORETURN(static void uninitialized_constant _((VALUE, ID)));
static void
-uninitialized_constant(VALUE klass, ID id)
+uninitialized_constant(klass, id)
+ VALUE klass;
+ ID id;
{
if (klass && klass != rb_cObject)
rb_name_error(id, "uninitialized constant %s::%s",
@@ -1285,7 +1231,9 @@ uninitialized_constant(VALUE klass, ID id)
}
static VALUE
-const_missing(VALUE klass, ID id)
+const_missing(klass, id)
+ VALUE klass;
+ ID id;
{
return rb_funcall(klass, rb_intern("const_missing"), 1, ID2SYM(id));
}
@@ -1304,7 +1252,7 @@ const_missing(VALUE klass, ID id)
* assumed to be in file <code>fred.rb</code>). If found, it returns the
* value of the loaded class. It therefore implements a perverse
* kind of autoload facility.
- *
+ *
* def Object.const_missing(name)
* @looked_for ||= {}
* str_name = name.to_s
@@ -1316,184 +1264,162 @@ const_missing(VALUE klass, ID id)
* return klass if klass
* raise "Class not found: #{name}"
* end
- *
+ *
*/
VALUE
-rb_mod_const_missing(VALUE klass, VALUE name)
+rb_mod_const_missing(klass, name)
+ VALUE klass, name;
{
- rb_frame_pop(); /* pop frame for "const_missing" */
+ ruby_frame = ruby_frame->prev; /* pop frame for "const_missing" */
uninitialized_constant(klass, rb_to_id(name));
return Qnil; /* not reached */
}
static struct st_table *
-check_autoload_table(VALUE av)
+check_autoload_table(av)
+ VALUE av;
{
Check_Type(av, T_DATA);
if (RDATA(av)->dmark != (RUBY_DATA_FUNC)rb_mark_tbl ||
RDATA(av)->dfree != (RUBY_DATA_FUNC)st_free_table) {
- VALUE desc = rb_inspect(av);
- rb_raise(rb_eTypeError, "wrong autoload table: %s", RSTRING_PTR(desc));
+ rb_raise(rb_eTypeError, "wrong autoload table: %s", RSTRING(rb_inspect(av))->ptr);
}
return (struct st_table *)DATA_PTR(av);
}
void
-rb_autoload(VALUE mod, ID id, const char *file)
+rb_autoload(mod, id, file)
+ VALUE mod;
+ ID id;
+ const char *file;
{
VALUE av, fn;
struct st_table *tbl;
if (!rb_is_const_id(id)) {
- rb_raise(rb_eNameError, "autoload must be constant name: %s", rb_id2name(id));
+ rb_raise(rb_eNameError, "autoload must be constant name", rb_id2name(id));
}
if (!file || !*file) {
rb_raise(rb_eArgError, "empty file name");
}
- if ((tbl = RCLASS_IV_TBL(mod)) && st_lookup(tbl, id, &av) && av != Qundef)
+ if ((tbl = RCLASS(mod)->iv_tbl) && st_lookup(tbl, id, &av) && av != Qundef)
return;
rb_const_set(mod, id, Qundef);
- tbl = RCLASS_IV_TBL(mod);
+ tbl = RCLASS(mod)->iv_tbl;
if (st_lookup(tbl, autoload, &av)) {
tbl = check_autoload_table(av);
}
else {
- av = Data_Wrap_Struct(0, rb_mark_tbl, st_free_table, 0);
+ av = Data_Wrap_Struct(0 , rb_mark_tbl, st_free_table, 0);
st_add_direct(tbl, autoload, av);
DATA_PTR(av) = tbl = st_init_numtable();
}
fn = rb_str_new2(file);
FL_UNSET(fn, FL_TAINT);
OBJ_FREEZE(fn);
- st_insert(tbl, id, (st_data_t)rb_node_newnode(NODE_MEMO, fn, rb_safe_level(), 0));
+ st_insert(tbl, id, (st_data_t)rb_node_newnode(NODE_MEMO, fn, ruby_safe_level, 0));
}
static NODE*
-autoload_delete(VALUE mod, ID id)
+autoload_delete(mod, id)
+ VALUE mod;
+ ID id;
{
- st_data_t val, load = 0, n = id;
+ VALUE val;
+ st_data_t load = 0;
- st_delete(RCLASS_IV_TBL(mod), &n, 0);
- if (st_lookup(RCLASS_IV_TBL(mod), autoload, &val)) {
- struct st_table *tbl = check_autoload_table((VALUE)val);
+ st_delete(RCLASS(mod)->iv_tbl, (st_data_t*)&id, 0);
+ if (st_lookup(RCLASS(mod)->iv_tbl, autoload, &val)) {
+ struct st_table *tbl = check_autoload_table(val);
- st_delete(tbl, &n, &load);
+ st_delete(tbl, (st_data_t*)&id, &load);
if (tbl->num_entries == 0) {
- n = autoload;
- st_delete(RCLASS_IV_TBL(mod), &n, &val);
+ id = autoload;
+ st_delete(RCLASS(mod)->iv_tbl, (st_data_t*)&id, &val);
}
}
return (NODE *)load;
}
-static VALUE
-autoload_provided(VALUE arg)
+VALUE
+rb_autoload_load(klass, id)
+ VALUE klass;
+ ID id;
{
- const char **p = (const char **)arg;
- return rb_feature_provided(*p, p);
-}
+ VALUE file;
+ NODE *load = autoload_delete(klass, id);
-static VALUE
-reset_safe(VALUE safe)
-{
- rb_set_safe_level_force((int)safe);
- return safe;
+ if (!load || !(file = load->nd_lit) || rb_provided(RSTRING(file)->ptr)) {
+ return Qfalse;
+ }
+ return rb_require_safe(file, load->nd_nth);
}
-static NODE *
-autoload_node(VALUE mod, ID id, const char **loadingpath)
+static VALUE
+autoload_file(mod, id)
+ VALUE mod;
+ ID id;
{
- VALUE file;
+ VALUE val, file;
struct st_table *tbl;
- st_data_t val;
- NODE *load;
- const char *loading;
- int safe;
+ st_data_t load;
- if (!st_lookup(RCLASS_IV_TBL(mod), autoload, &val) ||
- !(tbl = check_autoload_table((VALUE)val)) || !st_lookup(tbl, (st_data_t)id, &val)) {
- return 0;
+ if (!st_lookup(RCLASS(mod)->iv_tbl, autoload, &val) ||
+ !(tbl = check_autoload_table(val)) || !st_lookup(tbl, id, &load)) {
+ return Qnil;
}
- load = (NODE *)val;
- file = load->nd_lit;
+ file = ((NODE *)load)->nd_lit;
Check_Type(file, T_STRING);
- if (!RSTRING_PTR(file) || !*RSTRING_PTR(file)) {
+ if (!RSTRING(file)->ptr || !*RSTRING(file)->ptr) {
rb_raise(rb_eArgError, "empty file name");
}
- loading = RSTRING_PTR(file);
- safe = rb_safe_level();
- rb_set_safe_level_force(0);
- if (!rb_ensure(autoload_provided, (VALUE)&loading, reset_safe, (VALUE)safe)) {
- return load;
- }
- if (loadingpath && loading) {
- *loadingpath = loading;
- return load;
+ if (!rb_provided(RSTRING(file)->ptr)) {
+ return file;
}
- return 0;
-}
-
-static int
-autoload_node_id(VALUE mod, ID id)
-{
- struct st_table *tbl = RCLASS_IV_TBL(mod);
- st_data_t val;
- if (!tbl || !st_lookup(tbl, id, &val) || val != Qundef) {
- return 0;
+ /* already loaded but not defined */
+ st_delete(tbl, (st_data_t*)&id, 0);
+ if (!tbl->num_entries) {
+ id = autoload;
+ st_delete(RCLASS(mod)->iv_tbl, (st_data_t*)&id, &val);
}
- return 1;
-}
-
-VALUE
-rb_autoload_load(VALUE mod, ID id)
-{
- VALUE file;
- NODE *load;
- const char *loading = 0, *src;
-
- if (!autoload_node_id(mod, id)) return Qfalse;
- load = autoload_node(mod, id, &loading);
- if (!load) return Qfalse;
- src = rb_sourcefile();
- if (src && loading && strcmp(src, loading) == 0) return Qfalse;
- file = load->nd_lit;
- return rb_require_safe(file, (int)load->nd_nth);
+ return Qnil;
}
VALUE
-rb_autoload_p(VALUE mod, ID id)
+rb_autoload_p(mod, id)
+ VALUE mod;
+ ID id;
{
- VALUE file;
- NODE *load;
- const char *loading = 0;
+ struct st_table *tbl = RCLASS(mod)->iv_tbl;
+ VALUE val;
- if (!autoload_node_id(mod, id)) return Qnil;
- load = autoload_node(mod, id, &loading);
- if (!load) return Qnil;
- return load && (file = load->nd_lit) ? file : Qnil;
+ if (!tbl || !st_lookup(tbl, id, &val) || val != Qundef) {
+ return Qnil;
+ }
+ return autoload_file(mod, id);
}
static VALUE
-rb_const_get_0(VALUE klass, ID id, int exclude, int recurse)
+rb_const_get_0(klass, id, exclude, recurse)
+ VALUE klass;
+ ID id;
+ int exclude, recurse;
{
VALUE value, tmp;
int mod_retry = 0;
tmp = klass;
retry:
- while (RTEST(tmp)) {
- VALUE am = 0;
- while (RCLASS_IV_TBL(tmp) && st_lookup(RCLASS_IV_TBL(tmp),id,&value)) {
+ while (tmp) {
+ while (RCLASS(tmp)->iv_tbl && st_lookup(RCLASS(tmp)->iv_tbl,id,&value)) {
if (value == Qundef) {
- if (am == tmp) break;
- am = tmp;
- rb_autoload_load(tmp, id);
+ if (!RTEST(rb_autoload_load(tmp, id))) break;
continue;
}
if (exclude && tmp == rb_cObject && klass != rb_cObject) {
@@ -1503,7 +1429,7 @@ rb_const_get_0(VALUE klass, ID id, int exclude, int recurse)
return value;
}
if (!recurse && klass != rb_cObject) break;
- tmp = RCLASS_SUPER(tmp);
+ tmp = RCLASS(tmp)->super;
}
if (!exclude && !mod_retry && BUILTIN_TYPE(klass) == T_MODULE) {
mod_retry = 1;
@@ -1511,25 +1437,29 @@ rb_const_get_0(VALUE klass, ID id, int exclude, int recurse)
goto retry;
}
- value = const_missing(klass, id);
- rb_vm_inc_const_missing_count();
- return value;
+ return const_missing(klass, id);
}
VALUE
-rb_const_get_from(VALUE klass, ID id)
+rb_const_get_from(klass, id)
+ VALUE klass;
+ ID id;
{
return rb_const_get_0(klass, id, Qtrue, Qtrue);
}
VALUE
-rb_const_get(VALUE klass, ID id)
+rb_const_get(klass, id)
+ VALUE klass;
+ ID id;
{
return rb_const_get_0(klass, id, Qfalse, Qtrue);
}
VALUE
-rb_const_get_at(VALUE klass, ID id)
+rb_const_get_at(klass, id)
+ VALUE klass;
+ ID id;
{
return rb_const_get_0(klass, id, Qtrue, Qfalse);
}
@@ -1537,30 +1467,27 @@ rb_const_get_at(VALUE klass, ID id)
/*
* call-seq:
* remove_const(sym) => obj
- *
+ *
* Removes the definition of the given constant, returning that
* constant's value. Predefined classes and singleton objects (such as
* <i>true</i>) cannot be removed.
*/
VALUE
-rb_mod_remove_const(VALUE mod, VALUE name)
+rb_mod_remove_const(mod, name)
+ VALUE mod, name;
{
- const ID id = rb_to_id(name);
+ ID id = rb_to_id(name);
VALUE val;
- st_data_t v, n = id;
-
- rb_vm_change_state();
if (!rb_is_const_id(id)) {
rb_name_error(id, "`%s' is not allowed as a constant name", rb_id2name(id));
}
- if (!OBJ_UNTRUSTED(mod) && rb_safe_level() >= 4)
+ if (!OBJ_TAINTED(mod) && rb_safe_level() >= 4)
rb_raise(rb_eSecurityError, "Insecure: can't remove constant");
if (OBJ_FROZEN(mod)) rb_error_frozen("class/module");
- if (RCLASS_IV_TBL(mod) && st_delete(RCLASS_IV_TBL(mod), &n, &v)) {
- val = (VALUE)v;
+ if (RCLASS(mod)->iv_tbl && st_delete(ROBJECT(mod)->iv_tbl, (st_data_t*)&id, &val)) {
if (val == Qundef) {
autoload_delete(mod, id);
val = Qnil;
@@ -1577,7 +1504,10 @@ rb_mod_remove_const(VALUE mod, VALUE name)
}
static int
-sv_i(ID key, VALUE value, st_table *tbl)
+sv_i(key, value, tbl)
+ ID key;
+ VALUE value;
+ st_table *tbl;
{
if (rb_is_const_id(key)) {
if (!st_lookup(tbl, key, 0)) {
@@ -1588,25 +1518,29 @@ sv_i(ID key, VALUE value, st_table *tbl)
}
void*
-rb_mod_const_at(VALUE mod, void *data)
+rb_mod_const_at(mod, data)
+ VALUE mod;
+ void *data;
{
st_table *tbl = data;
if (!tbl) {
tbl = st_init_numtable();
}
- if (RCLASS_IV_TBL(mod)) {
- st_foreach_safe(RCLASS_IV_TBL(mod), sv_i, (st_data_t)tbl);
+ if (RCLASS(mod)->iv_tbl) {
+ st_foreach_safe(RCLASS(mod)->iv_tbl, sv_i, (st_data_t)tbl);
}
return tbl;
}
void*
-rb_mod_const_of(VALUE mod, void *data)
+rb_mod_const_of(mod, data)
+ VALUE mod;
+ void *data;
{
VALUE tmp = mod;
for (;;) {
data = rb_mod_const_at(tmp, data);
- tmp = RCLASS_SUPER(tmp);
+ tmp = RCLASS(tmp)->super;
if (!tmp) break;
if (tmp == rb_cObject && mod != rb_cObject) break;
}
@@ -1614,21 +1548,24 @@ rb_mod_const_of(VALUE mod, void *data)
}
static int
-list_i(ID key, ID value, VALUE ary)
+list_i(key, value, ary)
+ ID key, value;
+ VALUE ary;
{
- rb_ary_push(ary, ID2SYM(key));
+ rb_ary_push(ary, rb_str_new2(rb_id2name(key)));
return ST_CONTINUE;
}
VALUE
-rb_const_list(void *data)
+rb_const_list(data)
+ void *data;
{
st_table *tbl = data;
VALUE ary;
if (!tbl) return rb_ary_new2(0);
ary = rb_ary_new2(tbl->num_entries);
- st_foreach_safe(tbl, list_i, ary);
+ st_foreach(tbl, list_i, ary);
st_free_table(tbl);
return ary;
@@ -1636,42 +1573,25 @@ rb_const_list(void *data)
/*
* call-seq:
- * mod.constants(inherit=true) => array
- *
+ * mod.constants => array
+ *
* Returns an array of the names of the constants accessible in
* <i>mod</i>. This includes the names of constants in any included
- * modules (example at start of section), unless the <i>all</i>
- * parameter is set to <code>false</code>.
- *
- * IO.constants.include?(:SYNC) => true
- * IO.constants(false).include?(:SYNC) => false
- *
- * Also see <code>Module::const_defined?</code>.
+ * modules (example at start of section).
*/
VALUE
-rb_mod_constants(int argc, VALUE *argv, VALUE mod)
+rb_mod_constants(mod)
+ VALUE mod;
{
- VALUE inherit;
- st_table *tbl;
-
- if (argc == 0) {
- inherit = Qtrue;
- }
- else {
- rb_scan_args(argc, argv, "01", &inherit);
- }
- if (RTEST(inherit)) {
- tbl = rb_mod_const_of(mod, 0);
- }
- else {
- tbl = rb_mod_const_at(mod, 0);
- }
- return rb_const_list(tbl);
+ return rb_const_list(rb_mod_const_of(mod, 0));
}
static int
-rb_const_defined_0(VALUE klass, ID id, int exclude, int recurse)
+rb_const_defined_0(klass, id, exclude, recurse)
+ VALUE klass;
+ ID id;
+ int exclude, recurse;
{
VALUE value, tmp;
int mod_retry = 0;
@@ -1679,13 +1599,13 @@ rb_const_defined_0(VALUE klass, ID id, int exclude, int recurse)
tmp = klass;
retry:
while (tmp) {
- if (RCLASS_IV_TBL(tmp) && st_lookup(RCLASS_IV_TBL(tmp), id, &value)) {
- if (value == Qundef && !autoload_node(klass, id, 0))
+ if (RCLASS(tmp)->iv_tbl && st_lookup(RCLASS(tmp)->iv_tbl, id, &value)) {
+ if (value == Qundef && NIL_P(autoload_file(klass, id)))
return Qfalse;
return Qtrue;
}
if (!recurse && klass != rb_cObject) break;
- tmp = RCLASS_SUPER(tmp);
+ tmp = RCLASS(tmp)->super;
}
if (!exclude && !mod_retry && BUILTIN_TYPE(klass) == T_MODULE) {
mod_retry = 1;
@@ -1696,29 +1616,39 @@ rb_const_defined_0(VALUE klass, ID id, int exclude, int recurse)
}
int
-rb_const_defined_from(VALUE klass, ID id)
+rb_const_defined_from(klass, id)
+ VALUE klass;
+ ID id;
{
return rb_const_defined_0(klass, id, Qtrue, Qtrue);
}
int
-rb_const_defined(VALUE klass, ID id)
+rb_const_defined(klass, id)
+ VALUE klass;
+ ID id;
{
return rb_const_defined_0(klass, id, Qfalse, Qtrue);
}
int
-rb_const_defined_at(VALUE klass, ID id)
+rb_const_defined_at(klass, id)
+ VALUE klass;
+ ID id;
{
return rb_const_defined_0(klass, id, Qtrue, Qfalse);
}
static void
-mod_av_set(VALUE klass, ID id, VALUE val, int isconst)
+mod_av_set(klass, id, val, isconst)
+ VALUE klass;
+ ID id;
+ VALUE val;
+ int isconst;
{
const char *dest = isconst ? "constant" : "class variable";
- if (!OBJ_UNTRUSTED(klass) && rb_safe_level() >= 4)
+ if (!OBJ_TAINTED(klass) && rb_safe_level() >= 4)
rb_raise(rb_eSecurityError, "Insecure: can't set %s", dest);
if (OBJ_FROZEN(klass)) {
if (BUILTIN_TYPE(klass) == T_MODULE) {
@@ -1728,28 +1658,28 @@ mod_av_set(VALUE klass, ID id, VALUE val, int isconst)
rb_error_frozen("class");
}
}
- if (!RCLASS_IV_TBL(klass)) {
- RCLASS_IV_TBL(klass) = st_init_numtable();
+ if (!RCLASS(klass)->iv_tbl) {
+ RCLASS(klass)->iv_tbl = st_init_numtable();
}
else if (isconst) {
VALUE value = Qfalse;
- if (st_lookup(RCLASS_IV_TBL(klass), id, &value)) {
+ if (st_lookup(RCLASS(klass)->iv_tbl, id, &value)) {
if (value == Qundef)
- autoload_delete(klass, id);
+ autoload_delete(klass, id);
else
- rb_warn("already initialized %s %s", dest, rb_id2name(id));
+ rb_warn("already initialized %s %s", dest, rb_id2name(id));
}
}
- if (isconst){
- rb_vm_change_state();
- }
- st_insert(RCLASS_IV_TBL(klass), id, val);
+ st_insert(RCLASS(klass)->iv_tbl, id, val);
}
void
-rb_const_set(VALUE klass, ID id, VALUE val)
+rb_const_set(klass, id, val)
+ VALUE klass;
+ ID id;
+ VALUE val;
{
if (NIL_P(klass)) {
rb_raise(rb_eTypeError, "no class/module to define constant %s",
@@ -1759,7 +1689,10 @@ rb_const_set(VALUE klass, ID id, VALUE val)
}
void
-rb_define_const(VALUE klass, const char *name, VALUE val)
+rb_define_const(klass, name, val)
+ VALUE klass;
+ const char *name;
+ VALUE val;
{
ID id = rb_intern(name);
@@ -1773,119 +1706,133 @@ rb_define_const(VALUE klass, const char *name, VALUE val)
}
void
-rb_define_global_const(const char *name, VALUE val)
+rb_define_global_const(name, val)
+ const char *name;
+ VALUE val;
{
rb_define_const(rb_cObject, name, val);
}
static VALUE
-original_module(VALUE c)
+original_module(c)
+ VALUE c;
{
if (TYPE(c) == T_ICLASS)
return RBASIC(c)->klass;
return c;
}
-#define CVAR_LOOKUP(v,r) do {\
- if (RCLASS_IV_TBL(klass) && st_lookup(RCLASS_IV_TBL(klass),id,(v))) {\
- r;\
- }\
- if (FL_TEST(klass, FL_SINGLETON) ) {\
- VALUE obj = rb_iv_get(klass, "__attached__");\
- switch (TYPE(obj)) {\
- case T_MODULE:\
- case T_CLASS:\
- klass = obj;\
- break;\
- default:\
- klass = RCLASS_SUPER(klass);\
- break;\
- }\
- }\
- else {\
- klass = RCLASS_SUPER(klass);\
- }\
- while (klass) {\
- if (RCLASS_IV_TBL(klass) && st_lookup(RCLASS_IV_TBL(klass),id,(v))) {\
- r;\
- }\
- klass = RCLASS_SUPER(klass);\
- }\
-} while(0)
+static void
+cvar_override_check(id, a)
+ ID id;
+ VALUE a;
+{
+ VALUE base = original_module(a);
+
+ a = RCLASS(a)->super;
+ while (a) {
+ if (RCLASS(a)->iv_tbl) {
+ if (st_lookup(RCLASS(a)->iv_tbl,id,0)) {
+ rb_warning("class variable %s of %s is overridden by %s",
+ rb_id2name(id), rb_class2name(original_module(a)),
+ rb_class2name(base));
+ }
+ }
+ a = RCLASS(a)->super;
+ }
+}
void
-rb_cvar_set(VALUE klass, ID id, VALUE val)
+rb_cvar_set(klass, id, val, warn)
+ VALUE klass;
+ ID id;
+ VALUE val;
+ int warn;
{
- VALUE tmp, front = 0, target = 0;
+ VALUE tmp;
tmp = klass;
- CVAR_LOOKUP(0, {if (!front) front = klass; target = klass;});
- if (target) {
- if (front && target != front) {
- ID did = id;
-
- if (RTEST(ruby_verbose)) {
- rb_warning("class variable %s of %s is overtaken by %s",
- rb_id2name(id), rb_class2name(original_module(front)),
- rb_class2name(original_module(target)));
+ while (tmp) {
+ if (RCLASS(tmp)->iv_tbl && st_lookup(RCLASS(tmp)->iv_tbl,id,0)) {
+ if (OBJ_FROZEN(tmp)) rb_error_frozen("class/module");
+ if (!OBJ_TAINTED(tmp) && rb_safe_level() >= 4)
+ rb_raise(rb_eSecurityError, "Insecure: can't modify class variable");
+ if (warn && RTEST(ruby_verbose) && klass != tmp) {
+ rb_warning("already initialized class variable %s", rb_id2name(id));
}
- if (BUILTIN_TYPE(front) == T_CLASS) {
- st_delete(RCLASS_IV_TBL(front),&did,0);
+ st_insert(RCLASS(tmp)->iv_tbl,id,val);
+ if (RTEST(ruby_verbose)) {
+ cvar_override_check(id, tmp);
}
+ return;
}
+ tmp = RCLASS(tmp)->super;
}
- else {
- target = tmp;
- }
- mod_av_set(target, id, val, Qfalse);
+
+ mod_av_set(klass, id, val, Qfalse);
}
VALUE
-rb_cvar_get(VALUE klass, ID id)
+rb_cvar_get(klass, id)
+ VALUE klass;
+ ID id;
{
- VALUE value, tmp, front = 0, target = 0;
+ VALUE value;
+ VALUE tmp;
tmp = klass;
- CVAR_LOOKUP(&value, {if (!front) front = klass; target = klass;});
- if (!target) {
- rb_name_error(id,"uninitialized class variable %s in %s",
- rb_id2name(id), rb_class2name(tmp));
- }
- if (front && target != front) {
- ID did = id;
-
- if (RTEST(ruby_verbose)) {
- rb_warning("class variable %s of %s is overtaken by %s",
- rb_id2name(id), rb_class2name(original_module(front)),
- rb_class2name(original_module(target)));
- }
- if (BUILTIN_TYPE(front) == T_CLASS) {
- st_delete(RCLASS_IV_TBL(front),&did,0);
+ while (tmp) {
+ if (RCLASS(tmp)->iv_tbl) {
+ if (st_lookup(RCLASS(tmp)->iv_tbl,id,&value)) {
+ if (RTEST(ruby_verbose)) {
+ cvar_override_check(id, tmp);
+ }
+ return value;
+ }
}
+ tmp = RCLASS(tmp)->super;
}
- return value;
+
+ rb_name_error(id,"uninitialized class variable %s in %s",
+ rb_id2name(id), rb_class2name(klass));
+ return Qnil; /* not reached */
}
VALUE
-rb_cvar_defined(VALUE klass, ID id)
+rb_cvar_defined(klass, id)
+ VALUE klass;
+ ID id;
{
- if (!klass) return Qfalse;
- CVAR_LOOKUP(0,return Qtrue);
+ VALUE tmp;
+
+ tmp = klass;
+ while (tmp) {
+ if (RCLASS(tmp)->iv_tbl && st_lookup(RCLASS(tmp)->iv_tbl,id,0)) {
+ return Qtrue;
+ }
+ tmp = RCLASS(tmp)->super;
+ }
+
return Qfalse;
}
void
-rb_cv_set(VALUE klass, const char *name, VALUE val)
+rb_cv_set(klass, name, val)
+ VALUE klass;
+ const char *name;
+ VALUE val;
{
ID id = rb_intern(name);
if (!rb_is_class_id(id)) {
rb_name_error(id, "wrong class variable name %s", name);
}
- rb_cvar_set(klass, id, val);
+ rb_cvar_set(klass, id, val, Qfalse);
}
VALUE
-rb_cv_get(VALUE klass, const char *name)
+rb_cv_get(klass, name)
+ VALUE klass;
+ const char *name;
{
ID id = rb_intern(name);
if (!rb_is_class_id(id)) {
@@ -1895,21 +1842,27 @@ rb_cv_get(VALUE klass, const char *name)
}
void
-rb_define_class_variable(VALUE klass, const char *name, VALUE val)
+rb_define_class_variable(klass, name, val)
+ VALUE klass;
+ const char *name;
+ VALUE val;
{
ID id = rb_intern(name);
if (!rb_is_class_id(id)) {
rb_name_error(id, "wrong class variable name %s", name);
}
- rb_cvar_set(klass, id, val);
+ rb_cvar_set(klass, id, val, Qtrue);
}
static int
-cv_i(ID key, VALUE value, VALUE ary)
+cv_i(key, value, ary)
+ ID key;
+ VALUE value;
+ VALUE ary;
{
if (rb_is_class_id(key)) {
- VALUE kval = ID2SYM(key);
+ VALUE kval = rb_str_new2(rb_id2name(key));
if (!rb_ary_includes(ary, kval)) {
rb_ary_push(ary, kval);
}
@@ -1920,26 +1873,32 @@ cv_i(ID key, VALUE value, VALUE ary)
/*
* call-seq:
* mod.class_variables => array
- *
- * Returns an array of the names of class variables in <i>mod</i>.
- *
+ *
+ * Returns an array of the names of class variables in <i>mod</i> and
+ * the ancestors of <i>mod</i>.
+ *
* class One
* @@var1 = 1
* end
* class Two < One
* @@var2 = 2
* end
- * One.class_variables #=> [:@@var1]
- * Two.class_variables #=> [:@@var2]
+ * One.class_variables #=> ["@@var1"]
+ * Two.class_variables #=> ["@@var2", "@@var1"]
*/
VALUE
-rb_mod_class_variables(VALUE obj)
+rb_mod_class_variables(obj)
+ VALUE obj;
{
VALUE ary = rb_ary_new();
- if (RCLASS_IV_TBL(obj)) {
- st_foreach_safe(RCLASS_IV_TBL(obj), cv_i, ary);
+ for (;;) {
+ if (RCLASS(obj)->iv_tbl) {
+ st_foreach_safe(RCLASS(obj)->iv_tbl, cv_i, ary);
+ }
+ obj = RCLASS(obj)->super;
+ if (!obj) break;
}
return ary;
}
@@ -1947,38 +1906,39 @@ rb_mod_class_variables(VALUE obj)
/*
* call-seq:
* remove_class_variable(sym) => obj
- *
+ *
* Removes the definition of the <i>sym</i>, returning that
* constant's value.
- *
+ *
* class Dummy
* @@var = 99
* puts @@var
* remove_class_variable(:@@var)
- * p(defined? @@var)
+ * puts(defined? @@var)
* end
- *
+ *
* <em>produces:</em>
- *
+ *
* 99
* nil
*/
VALUE
-rb_mod_remove_cvar(VALUE mod, VALUE name)
+rb_mod_remove_cvar(mod, name)
+ VALUE mod, name;
{
- const ID id = rb_to_id(name);
- st_data_t val, n = id;
+ ID id = rb_to_id(name);
+ VALUE val;
if (!rb_is_class_id(id)) {
rb_name_error(id, "wrong class variable name %s", rb_id2name(id));
}
- if (!OBJ_UNTRUSTED(mod) && rb_safe_level() >= 4)
+ if (!OBJ_TAINTED(mod) && rb_safe_level() >= 4)
rb_raise(rb_eSecurityError, "Insecure: can't remove class variable");
if (OBJ_FROZEN(mod)) rb_error_frozen("class/module");
- if (RCLASS_IV_TBL(mod) && st_delete(RCLASS_IV_TBL(mod), &n, &val)) {
- return (VALUE)val;
+ if (RCLASS(mod)->iv_tbl && st_delete(ROBJECT(mod)->iv_tbl, (st_data_t*)&id, &val)) {
+ return val;
}
if (rb_cvar_defined(mod, id)) {
rb_name_error(id, "cannot remove %s for %s",
@@ -1990,7 +1950,9 @@ rb_mod_remove_cvar(VALUE mod, VALUE name)
}
VALUE
-rb_iv_get(VALUE obj, const char *name)
+rb_iv_get(obj, name)
+ VALUE obj;
+ const char *name;
{
ID id = rb_intern(name);
@@ -1998,7 +1960,10 @@ rb_iv_get(VALUE obj, const char *name)
}
VALUE
-rb_iv_set(VALUE obj, const char *name, VALUE val)
+rb_iv_set(obj, name, val)
+ VALUE obj;
+ const char *name;
+ VALUE val;
{
ID id = rb_intern(name);
diff --git a/version.c b/version.c
index ba2020d9b6..dbc65b08a4 100644
--- a/version.c
+++ b/version.c
@@ -3,80 +3,70 @@
version.c -
$Author$
+ $Date$
created at: Thu Sep 30 20:08:01 JST 1993
- Copyright (C) 1993-2007 Yukihiro Matsumoto
+ Copyright (C) 1993-2003 Yukihiro Matsumoto
**********************************************************************/
-#include "ruby/ruby.h"
+#include "ruby.h"
#include "version.h"
#include <stdio.h>
#define PRINT(type) puts(ruby_##type)
-#define MKSTR(type) rb_obj_freeze(rb_usascii_str_new(ruby_##type, sizeof(ruby_##type)-1))
-
-#ifndef RUBY_ARCH
-#define RUBY_ARCH RUBY_PLATFORM
-#endif
-#ifndef RUBY_SITEARCH
-#define RUBY_SITEARCH RUBY_ARCH
-#endif
+#define MKSTR(type) rb_obj_freeze(rb_str_new(ruby_##type, sizeof(ruby_##type)-1))
const char ruby_version[] = RUBY_VERSION;
const char ruby_release_date[] = RUBY_RELEASE_DATE;
const char ruby_platform[] = RUBY_PLATFORM;
const int ruby_patchlevel = RUBY_PATCHLEVEL;
-const char ruby_description[] = RUBY_DESCRIPTION;
-const char ruby_copyright[] = RUBY_COPYRIGHT;
-const char ruby_engine[] = "ruby";
-
-const char ruby_initial_load_paths[] =
-#ifdef RUBY_SEARCH_PATH
- RUBY_SEARCH_PATH "\0"
-#endif
- RUBY_SITE_LIB2 "\0"
-#ifdef RUBY_SITE_THIN_ARCHLIB
- RUBY_SITE_THIN_ARCHLIB "\0"
-#endif
- RUBY_SITE_ARCHLIB "\0"
- RUBY_SITE_LIB "\0"
-
- RUBY_VENDOR_LIB2 "\0"
-#ifdef RUBY_VENDOR_THIN_ARCHLIB
- RUBY_VENDOR_THIN_ARCHLIB "\0"
-#endif
- RUBY_VENDOR_ARCHLIB "\0"
- RUBY_VENDOR_LIB "\0"
-
- RUBY_LIB "\0"
-#ifdef RUBY_THIN_ARCHLIB
- RUBY_THIN_ARCHLIB "\0"
-#endif
- RUBY_ARCHLIB "\0";
+const char *ruby_description;
+const char *ruby_copyright;
void
-Init_version(void)
+Init_version()
{
- rb_define_global_const("RUBY_VERSION", MKSTR(version));
- rb_define_global_const("RUBY_RELEASE_DATE", MKSTR(release_date));
- rb_define_global_const("RUBY_PLATFORM", MKSTR(platform));
+ static char description[128];
+ static char copyright[128];
+ VALUE v = MKSTR(version);
+ VALUE d = MKSTR(release_date);
+ VALUE p = MKSTR(platform);
+ VALUE tmp;
+
+ rb_define_global_const("RUBY_VERSION", v);
+ rb_define_global_const("RUBY_RELEASE_DATE", d);
+ rb_define_global_const("RUBY_PLATFORM", p);
rb_define_global_const("RUBY_PATCHLEVEL", INT2FIX(RUBY_PATCHLEVEL));
- rb_define_global_const("RUBY_REVISION", INT2FIX(RUBY_REVISION));
- rb_define_global_const("RUBY_DESCRIPTION", MKSTR(description));
- rb_define_global_const("RUBY_COPYRIGHT", MKSTR(copyright));
- rb_define_global_const("RUBY_ENGINE", MKSTR(engine));
+
+ snprintf(description, sizeof(description), "ruby %s (%s %s %d) [%s]",
+ RUBY_VERSION, RUBY_RELEASE_DATE, RUBY_RELEASE_STR,
+ RUBY_RELEASE_NUM, RUBY_PLATFORM);
+ ruby_description = description;
+ tmp = rb_obj_freeze(rb_str_new2(description));
+ rb_define_global_const("RUBY_DESCRIPTION", tmp);
+
+ snprintf(copyright, sizeof(copyright), "ruby - Copyright (C) %d-%d %s",
+ RUBY_BIRTH_YEAR, RUBY_RELEASE_YEAR, RUBY_AUTHOR);
+ ruby_copyright = copyright;
+ tmp = rb_obj_freeze(rb_str_new2(copyright));
+ rb_define_global_const("RUBY_COPYRIGHT", tmp);
+
+ /* obsolete constants */
+ rb_define_global_const("VERSION", v);
+ rb_define_global_const("RELEASE_DATE", d);
+ rb_define_global_const("PLATFORM", p);
}
void
-ruby_show_version(void)
+ruby_show_version()
{
PRINT(description);
fflush(stdout);
}
void
-ruby_show_copyright(void)
+ruby_show_copyright()
{
PRINT(copyright);
exit(0);
diff --git a/version.h b/version.h
index 84beb61d89..5c418d4e74 100644
--- a/version.h
+++ b/version.h
@@ -1,56 +1,35 @@
-#define RUBY_VERSION "1.9.2"
-#define RUBY_RELEASE_DATE "2009-07-18"
-#define RUBY_PATCHLEVEL -1
-#define RUBY_BRANCH_NAME "trunk"
+#define RUBY_VERSION "1.8.7"
+#define RUBY_RELEASE_DATE "2009-03-09"
+#define RUBY_VERSION_CODE 187
+#define RUBY_RELEASE_CODE 20090309
+#define RUBY_PATCHLEVEL 150
#define RUBY_VERSION_MAJOR 1
-#define RUBY_VERSION_MINOR 9
-#define RUBY_VERSION_TEENY 1
+#define RUBY_VERSION_MINOR 8
+#define RUBY_VERSION_TEENY 7
#define RUBY_RELEASE_YEAR 2009
-#define RUBY_RELEASE_MONTH 7
-#define RUBY_RELEASE_DAY 18
+#define RUBY_RELEASE_MONTH 3
+#define RUBY_RELEASE_DAY 9
-#include "ruby/version.h"
-
-#if !defined RUBY_LIB_VERSION && defined RUBY_LIB_VERSION_STYLE
-# if RUBY_LIB_VERSION_STYLE == 3
-# define RUBY_LIB_VERSION STRINGIZE(RUBY_VERSION_MAJOR)"."STRINGIZE(RUBY_VERSION_MINOR)"."STRINGIZE(RUBY_VERSION_TEENY)
-# elif RUBY_LIB_VERSION_STYLE == 2
-# define RUBY_LIB_VERSION STRINGIZE(RUBY_VERSION_MAJOR)"."STRINGIZE(RUBY_VERSION_MINOR)
-# endif
+#ifdef RUBY_EXTERN
+RUBY_EXTERN const char ruby_version[];
+RUBY_EXTERN const char ruby_release_date[];
+RUBY_EXTERN const char ruby_platform[];
+RUBY_EXTERN const int ruby_patchlevel;
+RUBY_EXTERN const char *ruby_description;
+RUBY_EXTERN const char *ruby_copyright;
#endif
-#if RUBY_PATCHLEVEL == -1
-#define RUBY_PATCHLEVEL_STR "dev"
-#else
-#define RUBY_PATCHLEVEL_STR "p"STRINGIZE(RUBY_PATCHLEVEL)
-#endif
+#define RUBY_AUTHOR "Yukihiro Matsumoto"
+#define RUBY_BIRTH_YEAR 1993
+#define RUBY_BIRTH_MONTH 2
+#define RUBY_BIRTH_DAY 24
+
+#define RUBY_RELEASE_STR "patchlevel"
+#define RUBY_RELEASE_NUM RUBY_PATCHLEVEL
+
+
+
-#ifndef RUBY_REVISION
-# include "revision.h"
-#endif
-# ifndef RUBY_REVISION
-# define RUBY_REVISION 0
-#endif
-#if RUBY_REVISION
-# ifdef RUBY_BRANCH_NAME
-# define RUBY_REVISION_STR " "RUBY_BRANCH_NAME" "STRINGIZE(RUBY_REVISION)
-# else
-# define RUBY_REVISION_STR " revision "STRINGIZE(RUBY_REVISION)
-# endif
-#else
-# define RUBY_REVISION_STR ""
-#endif
-# define RUBY_DESCRIPTION \
- "ruby "RUBY_VERSION \
- RUBY_PATCHLEVEL_STR \
- " ("RUBY_RELEASE_DATE \
- RUBY_REVISION_STR") " \
- "["RUBY_PLATFORM"]"
-# define RUBY_COPYRIGHT \
- "ruby - Copyright (C) " \
- STRINGIZE(RUBY_BIRTH_YEAR)"-" \
- STRINGIZE(RUBY_RELEASE_YEAR)" " \
- RUBY_AUTHOR
diff --git a/vm.c b/vm.c
deleted file mode 100644
index 2a1a98198c..0000000000
--- a/vm.c
+++ /dev/null
@@ -1,2088 +0,0 @@
-/**********************************************************************
-
- vm.c -
-
- $Author$
-
- Copyright (C) 2004-2007 Koichi Sasada
-
-**********************************************************************/
-
-#include "ruby/ruby.h"
-#include "ruby/st.h"
-#include "ruby/encoding.h"
-
-#include "gc.h"
-#include "vm_core.h"
-#include "iseq.h"
-#include "eval_intern.h"
-
-#include "vm_insnhelper.h"
-#include "vm_insnhelper.c"
-#include "vm_exec.h"
-#include "vm_exec.c"
-
-#include "vm_method.c"
-#include "vm_eval.c"
-
-#define BUFSIZE 0x100
-#define PROCDEBUG 0
-
-VALUE rb_cRubyVM;
-VALUE rb_cThread;
-VALUE rb_cEnv;
-VALUE rb_mRubyVMFrozenCore;
-
-VALUE ruby_vm_global_state_version = 1;
-VALUE ruby_vm_const_missing_count = 0;
-
-char ruby_vm_redefined_flag[BOP_LAST_];
-
-rb_thread_t *ruby_current_thread = 0;
-rb_vm_t *ruby_current_vm = 0;
-
-VALUE rb_insns_name_array(void);
-
-void vm_analysis_operand(int insn, int n, VALUE op);
-void vm_analysis_register(int reg, int isset);
-void vm_analysis_insn(int insn);
-
-void
-rb_vm_change_state(void)
-{
- INC_VM_STATE_VERSION();
-}
-
-void
-rb_vm_inc_const_missing_count(void)
-{
- ruby_vm_const_missing_count +=1;
-}
-
-/* control stack frame */
-
-static inline VALUE
-rb_vm_set_finish_env(rb_thread_t * th)
-{
- vm_push_frame(th, 0, VM_FRAME_MAGIC_FINISH,
- Qnil, th->cfp->lfp[0], 0,
- th->cfp->sp, 0, 1);
- th->cfp->pc = (VALUE *)&finish_insn_seq[0];
- return Qtrue;
-}
-
-static void
-vm_set_top_stack(rb_thread_t * th, VALUE iseqval)
-{
- rb_iseq_t *iseq;
- GetISeqPtr(iseqval, iseq);
-
- if (iseq->type != ISEQ_TYPE_TOP) {
- rb_raise(rb_eTypeError, "Not a toplevel InstructionSequence");
- }
-
- /* for return */
- rb_vm_set_finish_env(th);
-
- vm_push_frame(th, iseq, VM_FRAME_MAGIC_TOP,
- th->top_self, 0, iseq->iseq_encoded,
- th->cfp->sp, 0, iseq->local_size);
-
- CHECK_STACK_OVERFLOW(th->cfp, iseq->stack_max);
-}
-
-static void
-vm_set_eval_stack(rb_thread_t * th, VALUE iseqval, const NODE *cref)
-{
- rb_iseq_t *iseq;
- rb_block_t * const block = th->base_block;
- GetISeqPtr(iseqval, iseq);
-
- /* for return */
- rb_vm_set_finish_env(th);
- vm_push_frame(th, iseq, VM_FRAME_MAGIC_EVAL, block->self,
- GC_GUARDED_PTR(block->dfp), iseq->iseq_encoded,
- th->cfp->sp, block->lfp, iseq->local_size);
-
- if (cref) {
- th->cfp->dfp[-1] = (VALUE)cref;
- }
-
- CHECK_STACK_OVERFLOW(th->cfp, iseq->stack_max);
-}
-
-static void
-vm_set_main_stack(rb_thread_t *th, VALUE iseqval)
-{
- VALUE toplevel_binding = rb_const_get(rb_cObject, rb_intern("TOPLEVEL_BINDING"));
- rb_binding_t *bind;
- rb_iseq_t *iseq;
- rb_env_t *env;
-
- GetBindingPtr(toplevel_binding, bind);
- GetEnvPtr(bind->env, env);
- th->base_block = &env->block;
- vm_set_eval_stack(th, iseqval, 0);
- th->base_block = 0;
-
- /* save binding */
- GetISeqPtr(iseqval, iseq);
- if (bind && iseq->local_size > 0) {
- bind->env = rb_vm_make_env_object(th, th->cfp);
- }
-
- CHECK_STACK_OVERFLOW(th->cfp, iseq->stack_max);
-}
-
-rb_control_frame_t *
-rb_vm_get_ruby_level_next_cfp(rb_thread_t *th, rb_control_frame_t *cfp)
-{
- while (!RUBY_VM_CONTROL_FRAME_STACK_OVERFLOW_P(th, cfp)) {
- if (RUBY_VM_NORMAL_ISEQ_P(cfp->iseq)) {
- return cfp;
- }
- cfp = RUBY_VM_PREVIOUS_CONTROL_FRAME(cfp);
- }
- return 0;
-}
-
-static rb_control_frame_t *
-vm_get_ruby_level_caller_cfp(rb_thread_t *th, rb_control_frame_t *cfp)
-{
- if (RUBY_VM_NORMAL_ISEQ_P(cfp->iseq)) {
- return cfp;
- }
-
- cfp = RUBY_VM_PREVIOUS_CONTROL_FRAME(cfp);
-
- while (!RUBY_VM_CONTROL_FRAME_STACK_OVERFLOW_P(th, cfp)) {
- if (RUBY_VM_NORMAL_ISEQ_P(cfp->iseq)) {
- return cfp;
- }
-
- if ((cfp->flag & VM_FRAME_FLAG_PASSED) == 0) {
- break;
- }
- cfp = RUBY_VM_PREVIOUS_CONTROL_FRAME(cfp);
- }
- return 0;
-}
-
-/* Env */
-
-/*
- env{
- env[0] // special (block or prev env)
- env[1] // env object
- env[2] // prev env val
- };
- */
-
-#define ENV_IN_HEAP_P(th, env) \
- (!((th)->stack < (env) && (env) < ((th)->stack + (th)->stack_size)))
-#define ENV_VAL(env) ((env)[1])
-
-static void
-env_mark(void * const ptr)
-{
- RUBY_MARK_ENTER("env");
- if (ptr) {
- const rb_env_t * const env = ptr;
-
- if (env->env) {
- /* TODO: should mark more restricted range */
- RUBY_GC_INFO("env->env\n");
- rb_gc_mark_locations(env->env, env->env + env->env_size);
- }
-
- RUBY_GC_INFO("env->prev_envval\n");
- RUBY_MARK_UNLESS_NULL(env->prev_envval);
- RUBY_MARK_UNLESS_NULL(env->block.self);
- RUBY_MARK_UNLESS_NULL(env->block.proc);
-
- if (env->block.iseq) {
- if (BUILTIN_TYPE(env->block.iseq) == T_NODE) {
- RUBY_MARK_UNLESS_NULL((VALUE)env->block.iseq);
- }
- else {
- RUBY_MARK_UNLESS_NULL(env->block.iseq->self);
- }
- }
- }
- RUBY_MARK_LEAVE("env");
-}
-
-static void
-env_free(void * const ptr)
-{
- RUBY_FREE_ENTER("env");
- if (ptr) {
- const rb_env_t * const env = ptr;
- RUBY_FREE_UNLESS_NULL(env->env);
- ruby_xfree(ptr);
- }
- RUBY_FREE_LEAVE("env");
-}
-
-static size_t
-env_memsize(void *ptr)
-{
- if (ptr) {
- const rb_env_t * const env = ptr;
- size_t size = sizeof(rb_env_t);
- if (env->env) {
- size += env->env_size * sizeof(VALUE);
- }
- return size;
- }
- return 0;
-}
-
-static const rb_data_type_t env_data_type = {
- "VM/env",
- env_mark, env_free, env_memsize,
-};
-
-static VALUE
-env_alloc(void)
-{
- VALUE obj;
- rb_env_t *env;
- obj = TypedData_Make_Struct(rb_cEnv, rb_env_t, &env_data_type, env);
- env->env = 0;
- env->prev_envval = 0;
- env->block.iseq = 0;
- return obj;
-}
-
-static VALUE check_env_value(VALUE envval);
-
-static int
-check_env(rb_env_t * const env)
-{
- printf("---\n");
- printf("envptr: %p\n", (void *)&env->block.dfp[0]);
- printf("orphan: %p\n", (void *)env->block.dfp[1]);
- printf("inheap: %p\n", (void *)env->block.dfp[2]);
- printf("envval: %10p ", (void *)env->block.dfp[3]);
- dp(env->block.dfp[3]);
- printf("penvv : %10p ", (void *)env->block.dfp[4]);
- dp(env->block.dfp[4]);
- printf("lfp: %10p\n", (void *)env->block.lfp);
- printf("dfp: %10p\n", (void *)env->block.dfp);
- if (env->block.dfp[4]) {
- printf(">>\n");
- check_env_value(env->block.dfp[4]);
- printf("<<\n");
- }
- return 1;
-}
-
-static VALUE
-check_env_value(VALUE envval)
-{
- rb_env_t *env;
- GetEnvPtr(envval, env);
-
- if (check_env(env)) {
- return envval;
- }
- rb_bug("invalid env");
- return Qnil; /* unreachable */
-}
-
-static VALUE
-vm_make_env_each(rb_thread_t * const th, rb_control_frame_t * const cfp,
- VALUE *envptr, VALUE * const endptr)
-{
- VALUE envval, penvval = 0;
- rb_env_t *env;
- VALUE *nenvptr;
- int i, local_size;
-
- if (ENV_IN_HEAP_P(th, envptr)) {
- return ENV_VAL(envptr);
- }
-
- if (envptr != endptr) {
- VALUE *penvptr = GC_GUARDED_PTR_REF(*envptr);
- rb_control_frame_t *pcfp = cfp;
-
- if (ENV_IN_HEAP_P(th, penvptr)) {
- penvval = ENV_VAL(penvptr);
- }
- else {
- while (pcfp->dfp != penvptr) {
- pcfp++;
- if (pcfp->dfp == 0) {
- SDR();
- rb_bug("invalid dfp");
- }
- }
- penvval = vm_make_env_each(th, pcfp, penvptr, endptr);
- cfp->lfp = pcfp->lfp;
- *envptr = GC_GUARDED_PTR(pcfp->dfp);
- }
- }
-
- /* allocate env */
- envval = env_alloc();
- GetEnvPtr(envval, env);
-
- if (!RUBY_VM_NORMAL_ISEQ_P(cfp->iseq)) {
- local_size = 2;
- }
- else {
- local_size = cfp->iseq->local_size;
- }
-
- env->env_size = local_size + 1 + 2;
- env->local_size = local_size;
- env->env = ALLOC_N(VALUE, env->env_size);
- env->prev_envval = penvval;
-
- for (i = 0; i <= local_size; i++) {
- env->env[i] = envptr[-local_size + i];
-#if 0
- fprintf(stderr, "%2d ", &envptr[-local_size + i] - th->stack); dp(env->env[i]);
- if (RUBY_VM_NORMAL_ISEQ_P(cfp->iseq)) {
- /* clear value stack for GC */
- envptr[-local_size + i] = 0;
- }
-#endif
- }
-
- *envptr = envval; /* GC mark */
- nenvptr = &env->env[i - 1];
- nenvptr[1] = envval; /* frame self */
- nenvptr[2] = penvval; /* frame prev env object */
-
- /* reset lfp/dfp in cfp */
- cfp->dfp = nenvptr;
- if (envptr == endptr) {
- cfp->lfp = nenvptr;
- }
-
- /* as Binding */
- env->block.self = cfp->self;
- env->block.lfp = cfp->lfp;
- env->block.dfp = cfp->dfp;
- env->block.iseq = cfp->iseq;
-
- if (!RUBY_VM_NORMAL_ISEQ_P(cfp->iseq)) {
- /* TODO */
- env->block.iseq = 0;
- }
- return envval;
-}
-
-static int
-collect_local_variables_in_env(rb_env_t * const env, const VALUE ary)
-{
- int i;
- for (i = 0; i < env->block.iseq->local_table_size; i++) {
- ID lid = env->block.iseq->local_table[i];
- if (lid) {
- rb_ary_push(ary, ID2SYM(lid));
- }
- }
- if (env->prev_envval) {
- rb_env_t *prevenv;
- GetEnvPtr(env->prev_envval, prevenv);
- collect_local_variables_in_env(prevenv, ary);
- }
- return 0;
-}
-
-static int
-vm_collect_local_variables_in_heap(rb_thread_t *th, VALUE *dfp, VALUE ary)
-{
- if (ENV_IN_HEAP_P(th, dfp)) {
- rb_env_t *env;
- GetEnvPtr(ENV_VAL(dfp), env);
- collect_local_variables_in_env(env, ary);
- return 1;
- }
- else {
- return 0;
- }
-}
-
-VALUE
-rb_vm_make_env_object(rb_thread_t * th, rb_control_frame_t *cfp)
-{
- VALUE envval;
-
- if (VM_FRAME_TYPE(cfp) == VM_FRAME_MAGIC_FINISH) {
- /* for method_missing */
- cfp = RUBY_VM_PREVIOUS_CONTROL_FRAME(cfp);
- }
-
- envval = vm_make_env_each(th, cfp, cfp->dfp, cfp->lfp);
-
- if (PROCDEBUG) {
- check_env_value(envval);
- }
-
- return envval;
-}
-
-void
-rb_vm_stack_to_heap(rb_thread_t * const th)
-{
- rb_control_frame_t *cfp = th->cfp;
- while ((cfp = rb_vm_get_ruby_level_next_cfp(th, cfp)) != 0) {
- rb_vm_make_env_object(th, cfp);
- cfp = RUBY_VM_PREVIOUS_CONTROL_FRAME(cfp);
- }
-}
-
-/* Proc */
-
-static VALUE
-vm_make_proc_from_block(rb_thread_t *th, rb_block_t *block)
-{
- VALUE proc = block->proc;
-
- if (block->proc) {
- return block->proc;
- }
-
- proc = rb_vm_make_proc(th, block, rb_cProc);
- block->proc = proc;
-
- return proc;
-}
-
-VALUE
-rb_vm_make_proc(rb_thread_t *th, const rb_block_t *block, VALUE klass)
-{
- VALUE procval, envval, blockprocval = 0;
- rb_proc_t *proc;
- rb_control_frame_t *cfp = RUBY_VM_GET_CFP_FROM_BLOCK_PTR(block);
-
- if (block->proc) {
- rb_bug("rb_vm_make_proc: Proc value is already created.");
- }
-
- if (GC_GUARDED_PTR_REF(cfp->lfp[0])) {
- if (!RUBY_VM_CLASS_SPECIAL_P(cfp->lfp[0])) {
- rb_proc_t *p;
-
- blockprocval = vm_make_proc_from_block(
- th, (rb_block_t *)GC_GUARDED_PTR_REF(*cfp->lfp));
-
- GetProcPtr(blockprocval, p);
- *cfp->lfp = GC_GUARDED_PTR(&p->block);
- }
- }
-
- envval = rb_vm_make_env_object(th, cfp);
-
- if (PROCDEBUG) {
- check_env_value(envval);
- }
- procval = rb_proc_alloc(klass);
- GetProcPtr(procval, proc);
- proc->blockprocval = blockprocval;
- proc->block.self = block->self;
- proc->block.lfp = block->lfp;
- proc->block.dfp = block->dfp;
- proc->block.iseq = block->iseq;
- proc->block.proc = procval;
- proc->envval = envval;
- proc->safe_level = th->safe_level;
-
- if (VMDEBUG) {
- if (th->stack < block->dfp && block->dfp < th->stack + th->stack_size) {
- rb_bug("invalid ptr: block->dfp");
- }
- if (th->stack < block->lfp && block->lfp < th->stack + th->stack_size) {
- rb_bug("invalid ptr: block->lfp");
- }
- }
-
- return procval;
-}
-
-/* C -> Ruby: block */
-
-static inline VALUE
-invoke_block_from_c(rb_thread_t *th, const rb_block_t *block,
- VALUE self, int argc, const VALUE *argv,
- const rb_block_t *blockptr, const NODE *cref)
-{
- if (BUILTIN_TYPE(block->iseq) != T_NODE) {
- const rb_iseq_t *iseq = block->iseq;
- const rb_control_frame_t *cfp;
- int i, opt_pc, arg_size = iseq->arg_size;
- int type = block_proc_is_lambda(block->proc) ?
- VM_FRAME_MAGIC_LAMBDA : VM_FRAME_MAGIC_BLOCK;
-
- rb_vm_set_finish_env(th);
-
- cfp = th->cfp;
- CHECK_STACK_OVERFLOW(cfp, argc + iseq->stack_max);
-
- for (i=0; i<argc; i++) {
- cfp->sp[i] = argv[i];
- }
-
- opt_pc = vm_yield_setup_args(th, iseq, argc, cfp->sp, blockptr,
- type == VM_FRAME_MAGIC_LAMBDA);
-
- vm_push_frame(th, iseq, type,
- self, GC_GUARDED_PTR(block->dfp),
- iseq->iseq_encoded + opt_pc, cfp->sp + arg_size, block->lfp,
- iseq->local_size - arg_size);
-
- if (cref) {
- th->cfp->dfp[-1] = (VALUE)cref;
- }
-
- return vm_exec(th);
- }
- else {
- return vm_yield_with_cfunc(th, block, self, argc, argv, blockptr);
- }
-}
-
-static inline const rb_block_t *
-check_block(rb_thread_t *th)
-{
- const rb_block_t *blockptr = GC_GUARDED_PTR_REF(th->cfp->lfp[0]);
-
- if (blockptr == 0) {
- rb_vm_localjump_error("no block given", Qnil, 0);
- }
-
- return blockptr;
-}
-
-static inline VALUE
-vm_yield_with_cref(rb_thread_t *th, int argc, const VALUE *argv, const NODE *cref)
-{
- const rb_block_t *blockptr = check_block(th);
- return invoke_block_from_c(th, blockptr, blockptr->self, argc, argv, 0, cref);
-}
-
-static inline VALUE
-vm_yield(rb_thread_t *th, int argc, const VALUE *argv)
-{
- const rb_block_t *blockptr = check_block(th);
- return invoke_block_from_c(th, blockptr, blockptr->self, argc, argv, 0, 0);
-}
-
-VALUE
-rb_vm_invoke_proc(rb_thread_t *th, rb_proc_t *proc, VALUE self,
- int argc, const VALUE *argv, const rb_block_t * blockptr)
-{
- VALUE val = Qundef;
- int state;
- volatile int stored_safe = th->safe_level;
- rb_control_frame_t * volatile cfp = th->cfp;
-
- TH_PUSH_TAG(th);
- if ((state = EXEC_TAG()) == 0) {
- if (!proc->is_from_method) {
- th->safe_level = proc->safe_level;
- }
- val = invoke_block_from_c(th, &proc->block, self, argc, argv, blockptr, 0);
- }
- TH_POP_TAG();
-
- if (!proc->is_from_method) {
- th->safe_level = stored_safe;
- }
-
- if (state) {
- if (state == TAG_RETURN && proc->is_lambda) {
- VALUE err = th->errinfo;
- VALUE *escape_dfp = GET_THROWOBJ_CATCH_POINT(err);
-
- if (escape_dfp == cfp->dfp) {
- printf("ok\n");
- state = 0;
- th->errinfo = Qnil;
- th->cfp = cfp;
- val = GET_THROWOBJ_VAL(err);
- }
- }
- }
-
- if (state) {
- JUMP_TAG(state);
- }
- return val;
-}
-
-/* special variable */
-
-static rb_control_frame_t *
-vm_normal_frame(rb_thread_t *th, rb_control_frame_t *cfp)
-{
- while (cfp->pc == 0) {
- cfp = RUBY_VM_PREVIOUS_CONTROL_FRAME(cfp);
- if (RUBY_VM_CONTROL_FRAME_STACK_OVERFLOW_P(th, cfp)) {
- return 0;
- }
- }
- return cfp;
-}
-
-static VALUE
-vm_cfp_svar_get(rb_thread_t *th, rb_control_frame_t *cfp, VALUE key)
-{
- cfp = vm_normal_frame(th, cfp);
- return lfp_svar_get(th, cfp ? cfp->lfp : 0, key);
-}
-
-static void
-vm_cfp_svar_set(rb_thread_t *th, rb_control_frame_t *cfp, VALUE key, const VALUE val)
-{
- cfp = vm_normal_frame(th, cfp);
- lfp_svar_set(th, cfp ? cfp->lfp : 0, key, val);
-}
-
-static VALUE
-vm_svar_get(VALUE key)
-{
- rb_thread_t *th = GET_THREAD();
- return vm_cfp_svar_get(th, th->cfp, key);
-}
-
-static void
-vm_svar_set(VALUE key, VALUE val)
-{
- rb_thread_t *th = GET_THREAD();
- vm_cfp_svar_set(th, th->cfp, key, val);
-}
-
-VALUE
-rb_backref_get(void)
-{
- return vm_svar_get(1);
-}
-
-void
-rb_backref_set(VALUE val)
-{
- vm_svar_set(1, val);
-}
-
-VALUE
-rb_lastline_get(void)
-{
- return vm_svar_get(0);
-}
-
-void
-rb_lastline_set(VALUE val)
-{
- vm_svar_set(0, val);
-}
-
-/* backtrace */
-
-int
-rb_vm_get_sourceline(const rb_control_frame_t *cfp)
-{
- int line_no = 0;
- const rb_iseq_t *iseq = cfp->iseq;
-
- if (RUBY_VM_NORMAL_ISEQ_P(iseq) && iseq->insn_info_size > 0) {
- rb_num_t i;
- size_t pos = cfp->pc - cfp->iseq->iseq_encoded;
-
- if (iseq->insn_info_table[0].position == pos) goto found;
- for (i = 1; i < iseq->insn_info_size; i++) {
- if (iseq->insn_info_table[i].position == pos) {
- line_no = iseq->insn_info_table[i - 1].line_no;
- goto found;
- }
- }
- line_no = iseq->insn_info_table[i - 1].line_no;
- }
- found:
- return line_no;
-}
-
-static int
-vm_backtrace_each(rb_thread_t *th, int lev, rb_backtrace_iter_func *iter, void *arg)
-{
- const rb_control_frame_t *limit_cfp = th->cfp;
- const rb_control_frame_t *cfp = (void *)(th->stack + th->stack_size);
- const char *file = "ruby";
- int line_no = 0;
-
- cfp -= 2;
- while (lev-- >= 0) {
- if (++limit_cfp >= cfp) {
- return Qfalse;
- }
- }
- limit_cfp = RUBY_VM_NEXT_CONTROL_FRAME(limit_cfp);
- if (th->vm->progname) file = RSTRING_PTR(th->vm->progname);
- while (cfp > limit_cfp) {
- if (cfp->iseq != 0) {
- if (cfp->pc != 0) {
- rb_iseq_t *iseq = cfp->iseq;
-
- line_no = rb_vm_get_sourceline(cfp);
- file = RSTRING_PTR(iseq->filename);
- if ((*iter)(arg, file, line_no, RSTRING_PTR(iseq->name))) break;
- }
- }
- else if (RUBYVM_CFUNC_FRAME_P(cfp)) {
- if ((*iter)(arg, file, line_no, rb_id2name(cfp->me->original_id))) break;
- }
- cfp = RUBY_VM_NEXT_CONTROL_FRAME(cfp);
- }
- return Qtrue;
-}
-
-static int
-vm_backtrace_push(void *arg, const char *file, int line_no, const char *name)
-{
- VALUE *aryp = arg;
- if (!*aryp) {
- *aryp = rb_ary_new();
- }
- rb_ary_push(*aryp, rb_sprintf("%s:%d:in `%s'", file, line_no, name));
- return 0;
-}
-
-static inline VALUE
-vm_backtrace(rb_thread_t *th, int lev)
-{
- VALUE ary = 0;
-
- if (lev < 0) {
- ary = rb_ary_new();
- }
- vm_backtrace_each(th, lev, vm_backtrace_push, &ary);
- if (!ary) return Qnil;
- return rb_ary_reverse(ary);
-}
-
-const char *
-rb_sourcefile(void)
-{
- rb_thread_t *th = GET_THREAD();
- rb_control_frame_t *cfp = rb_vm_get_ruby_level_next_cfp(th, th->cfp);
-
- if (cfp) {
- return RSTRING_PTR(cfp->iseq->filename);
- }
- else {
- return 0;
- }
-}
-
-int
-rb_sourceline(void)
-{
- rb_thread_t *th = GET_THREAD();
- rb_control_frame_t *cfp = rb_vm_get_ruby_level_next_cfp(th, th->cfp);
-
- if (cfp) {
- return rb_vm_get_sourceline(cfp);
- }
- else {
- return 0;
- }
-}
-
-NODE *
-rb_vm_cref(void)
-{
- rb_thread_t *th = GET_THREAD();
- rb_control_frame_t *cfp = rb_vm_get_ruby_level_next_cfp(th, th->cfp);
- return vm_get_cref(cfp->iseq, cfp->lfp, cfp->dfp);
-}
-
-#if 0
-void
-debug_cref(NODE *cref)
-{
- while (cref) {
- dp(cref->nd_clss);
- printf("%ld\n", cref->nd_visi);
- cref = cref->nd_next;
- }
-}
-#endif
-
-VALUE
-rb_vm_cbase(void)
-{
- rb_thread_t *th = GET_THREAD();
- rb_control_frame_t *cfp = rb_vm_get_ruby_level_next_cfp(th, th->cfp);
-
- return vm_get_cbase(cfp->iseq, cfp->lfp, cfp->dfp);
-}
-
-/* jump */
-
-static VALUE
-make_localjump_error(const char *mesg, VALUE value, int reason)
-{
- extern VALUE rb_eLocalJumpError;
- VALUE exc = rb_exc_new2(rb_eLocalJumpError, mesg);
- ID id;
-
- switch (reason) {
- case TAG_BREAK:
- CONST_ID(id, "break");
- break;
- case TAG_REDO:
- CONST_ID(id, "redo");
- break;
- case TAG_RETRY:
- CONST_ID(id, "retry");
- break;
- case TAG_NEXT:
- CONST_ID(id, "next");
- break;
- case TAG_RETURN:
- CONST_ID(id, "return");
- break;
- default:
- CONST_ID(id, "noreason");
- break;
- }
- rb_iv_set(exc, "@exit_value", value);
- rb_iv_set(exc, "@reason", ID2SYM(id));
- return exc;
-}
-
-void
-rb_vm_localjump_error(const char *mesg, VALUE value, int reason)
-{
- VALUE exc = make_localjump_error(mesg, value, reason);
- rb_exc_raise(exc);
-}
-
-VALUE
-rb_vm_make_jump_tag_but_local_jump(int state, VALUE val)
-{
- VALUE result = Qnil;
-
- if (val == Qundef) {
- val = GET_THREAD()->tag->retval;
- }
- switch (state) {
- case 0:
- break;
- case TAG_RETURN:
- result = make_localjump_error("unexpected return", val, state);
- break;
- case TAG_BREAK:
- result = make_localjump_error("unexpected break", val, state);
- break;
- case TAG_NEXT:
- result = make_localjump_error("unexpected next", val, state);
- break;
- case TAG_REDO:
- result = make_localjump_error("unexpected redo", Qnil, state);
- break;
- case TAG_RETRY:
- result = make_localjump_error("retry outside of rescue clause", Qnil, state);
- break;
- default:
- break;
- }
- return result;
-}
-
-void
-rb_vm_jump_tag_but_local_jump(int state, VALUE val)
-{
- if (val != Qnil) {
- VALUE exc = rb_vm_make_jump_tag_but_local_jump(state, val);
- rb_exc_raise(exc);
- }
- JUMP_TAG(state);
-}
-
-NORETURN(static void vm_iter_break(rb_thread_t *th));
-
-static void
-vm_iter_break(rb_thread_t *th)
-{
- rb_control_frame_t *cfp = th->cfp;
- VALUE *dfp = GC_GUARDED_PTR_REF(*cfp->dfp);
-
- th->state = TAG_BREAK;
- th->errinfo = (VALUE)NEW_THROW_OBJECT(Qnil, (VALUE)dfp, TAG_BREAK);
- TH_JUMP_TAG(th, TAG_BREAK);
-}
-
-void
-rb_iter_break(void)
-{
- vm_iter_break(GET_THREAD());
-}
-
-/* optimization: redefine management */
-
-static st_table *vm_opt_method_table = 0;
-
-static void
-rb_vm_check_redefinition_opt_method(const rb_method_entry_t *me)
-{
- VALUE bop;
- if (me->type == VM_METHOD_TYPE_CFUNC) {
- if (st_lookup(vm_opt_method_table, (st_data_t)me, &bop)) {
- ruby_vm_redefined_flag[bop] = 1;
- }
- }
-}
-
-static void
-add_opt_method(VALUE klass, ID mid, VALUE bop)
-{
- rb_method_entry_t *me;
- if (st_lookup(RCLASS_M_TBL(klass), mid, (void *)&me) &&
- me->type == VM_METHOD_TYPE_CFUNC) {
- st_insert(vm_opt_method_table, (st_data_t)me, (st_data_t)bop);
- }
- else {
- rb_bug("undefined optimized method: %s", rb_id2name(mid));
- }
-}
-
-static void
-vm_init_redefined_flag(void)
-{
- ID mid;
- VALUE bop;
-
- vm_opt_method_table = st_init_numtable();
-
-#define OP(mid_, bop_) (mid = id##mid_, bop = BOP_##bop_, ruby_vm_redefined_flag[bop] = 0)
-#define C(k) add_opt_method(rb_c##k, mid, bop)
- OP(PLUS, PLUS), (C(Fixnum), C(Float), C(String), C(Array));
- OP(MINUS, MINUS), (C(Fixnum));
- OP(MULT, MULT), (C(Fixnum), C(Float));
- OP(DIV, DIV), (C(Fixnum), C(Float));
- OP(MOD, MOD), (C(Fixnum), C(Float));
- OP(Eq, EQ), (C(Fixnum), C(Float), C(String));
- OP(LT, LT), (C(Fixnum));
- OP(LE, LE), (C(Fixnum));
- OP(LTLT, LTLT), (C(String), C(Array));
- OP(AREF, AREF), (C(Array), C(Hash));
- OP(ASET, ASET), (C(Array), C(Hash));
- OP(Length, LENGTH), (C(Array), C(String), C(Hash));
- OP(Succ, SUCC), (C(Fixnum), C(String), C(Time));
- OP(GT, GT), (C(Fixnum));
- OP(GE, GE), (C(Fixnum));
-#undef C
-#undef OP
-}
-
-/* evaluator body */
-
-/* finish
- VMe (h1) finish
- VM finish F1 F2
- cfunc finish F1 F2 C1
- rb_funcall finish F1 F2 C1
- VMe finish F1 F2 C1
- VM finish F1 F2 C1 F3
-
- F1 - F3 : pushed by VM
- C1 : pushed by send insn (CFUNC)
-
- struct CONTROL_FRAME {
- VALUE *pc; // cfp[0], program counter
- VALUE *sp; // cfp[1], stack pointer
- VALUE *bp; // cfp[2], base pointer
- rb_iseq_t *iseq; // cfp[3], iseq
- VALUE flag; // cfp[4], magic
- VALUE self; // cfp[5], self
- VALUE *lfp; // cfp[6], local frame pointer
- VALUE *dfp; // cfp[7], dynamic frame pointer
- rb_iseq_t * block_iseq; // cfp[8], block iseq
- VALUE proc; // cfp[9], always 0
- };
-
- struct BLOCK {
- VALUE self;
- VALUE *lfp;
- VALUE *dfp;
- rb_iseq_t *block_iseq;
- VALUE proc;
- };
-
- struct METHOD_CONTROL_FRAME {
- rb_control_frame_t frame;
- };
-
- struct METHOD_FRAME {
- VALUE arg0;
- ...
- VALUE argM;
- VALUE param0;
- ...
- VALUE paramN;
- VALUE cref;
- VALUE special; // lfp [1]
- struct block_object *block_ptr | 0x01; // lfp [0]
- };
-
- struct BLOCK_CONTROL_FRAME {
- rb_control_frame_t frame;
- };
-
- struct BLOCK_FRAME {
- VALUE arg0;
- ...
- VALUE argM;
- VALUE param0;
- ...
- VALUE paramN;
- VALUE cref;
- VALUE *(prev_ptr | 0x01); // DFP[0]
- };
-
- struct CLASS_CONTROL_FRAME {
- rb_control_frame_t frame;
- };
-
- struct CLASS_FRAME {
- VALUE param0;
- ...
- VALUE paramN;
- VALUE cref;
- VALUE prev_dfp; // for frame jump
- };
-
- struct C_METHOD_CONTROL_FRAME {
- VALUE *pc; // 0
- VALUE *sp; // stack pointer
- VALUE *bp; // base pointer (used in exception)
- rb_iseq_t *iseq; // cmi
- VALUE magic; // C_METHOD_FRAME
- VALUE self; // ?
- VALUE *lfp; // lfp
- VALUE *dfp; // == lfp
- rb_iseq_t * block_iseq; //
- VALUE proc; // always 0
- };
-
- struct C_BLOCK_CONTROL_FRAME {
- VALUE *pc; // point only "finish" insn
- VALUE *sp; // sp
- rb_iseq_t *iseq; // ?
- VALUE magic; // C_METHOD_FRAME
- VALUE self; // needed?
- VALUE *lfp; // lfp
- VALUE *dfp; // lfp
- rb_iseq_t * block_iseq; // 0
- };
- */
-
-
-static VALUE
-vm_exec(rb_thread_t *th)
-{
- int state;
- VALUE result, err;
- VALUE initial = 0;
- VALUE *escape_dfp = NULL;
-
- TH_PUSH_TAG(th);
- _tag.retval = Qnil;
- if ((state = EXEC_TAG()) == 0) {
- vm_loop_start:
- result = vm_exec_core(th, initial);
- if ((state = th->state) != 0) {
- err = result;
- th->state = 0;
- goto exception_handler;
- }
- }
- else {
- int i;
- struct iseq_catch_table_entry *entry;
- unsigned long epc, cont_pc, cont_sp;
- VALUE catch_iseqval;
- rb_control_frame_t *cfp;
- VALUE type;
-
- err = th->errinfo;
-
- exception_handler:
- cont_pc = cont_sp = catch_iseqval = 0;
-
- while (th->cfp->pc == 0 || th->cfp->iseq == 0) {
- th->cfp++;
- }
-
- cfp = th->cfp;
- epc = cfp->pc - cfp->iseq->iseq_encoded;
-
- if (state == TAG_BREAK || state == TAG_RETURN) {
- escape_dfp = GET_THROWOBJ_CATCH_POINT(err);
-
- if (cfp->dfp == escape_dfp) {
- if (state == TAG_RETURN) {
- if ((cfp + 1)->pc != &finish_insn_seq[0]) {
- SET_THROWOBJ_CATCH_POINT(err, (VALUE)(cfp + 1)->dfp);
- SET_THROWOBJ_STATE(err, state = TAG_BREAK);
- }
- else {
- result = GET_THROWOBJ_VAL(err);
- th->errinfo = Qnil;
- th->cfp += 2;
- goto finish_vme;
- }
- /* through */
- }
- else {
- /* TAG_BREAK */
-#if OPT_STACK_CACHING
- initial = (GET_THROWOBJ_VAL(err));
-#else
- *th->cfp->sp++ = (GET_THROWOBJ_VAL(err));
-#endif
- th->errinfo = Qnil;
- goto vm_loop_start;
- }
- }
- }
-
- if (state == TAG_RAISE) {
- for (i = 0; i < cfp->iseq->catch_table_size; i++) {
- entry = &cfp->iseq->catch_table[i];
- if (entry->start < epc && entry->end >= epc) {
-
- if (entry->type == CATCH_TYPE_RESCUE ||
- entry->type == CATCH_TYPE_ENSURE) {
- catch_iseqval = entry->iseq;
- cont_pc = entry->cont;
- cont_sp = entry->sp;
- break;
- }
- }
- }
- }
- else if (state == TAG_RETRY) {
- for (i = 0; i < cfp->iseq->catch_table_size; i++) {
- entry = &cfp->iseq->catch_table[i];
- if (entry->start < epc && entry->end >= epc) {
-
- if (entry->type == CATCH_TYPE_ENSURE) {
- catch_iseqval = entry->iseq;
- cont_pc = entry->cont;
- cont_sp = entry->sp;
- break;
- }
- else if (entry->type == CATCH_TYPE_RETRY) {
- VALUE *escape_dfp;
- escape_dfp = GET_THROWOBJ_CATCH_POINT(err);
- if (cfp->dfp == escape_dfp) {
- cfp->pc = cfp->iseq->iseq_encoded + entry->cont;
- th->errinfo = Qnil;
- goto vm_loop_start;
- }
- }
- }
- }
- }
- else if (state == TAG_BREAK && ((VALUE)escape_dfp & ~0x03) == 0) {
- type = CATCH_TYPE_BREAK;
-
- search_restart_point:
- for (i = 0; i < cfp->iseq->catch_table_size; i++) {
- entry = &cfp->iseq->catch_table[i];
-
- if (entry->start < epc && entry->end >= epc) {
- if (entry->type == CATCH_TYPE_ENSURE) {
- catch_iseqval = entry->iseq;
- cont_pc = entry->cont;
- cont_sp = entry->sp;
- break;
- }
- else if (entry->type == type) {
- cfp->pc = cfp->iseq->iseq_encoded + entry->cont;
- cfp->sp = cfp->bp + entry->sp;
-
- if (state != TAG_REDO) {
-#if OPT_STACK_CACHING
- initial = (GET_THROWOBJ_VAL(err));
-#else
- *th->cfp->sp++ = (GET_THROWOBJ_VAL(err));
-#endif
- }
- th->errinfo = Qnil;
- goto vm_loop_start;
- }
- }
- }
- }
- else if (state == TAG_REDO) {
- type = CATCH_TYPE_REDO;
- goto search_restart_point;
- }
- else if (state == TAG_NEXT) {
- type = CATCH_TYPE_NEXT;
- goto search_restart_point;
- }
- else {
- for (i = 0; i < cfp->iseq->catch_table_size; i++) {
- entry = &cfp->iseq->catch_table[i];
- if (entry->start < epc && entry->end >= epc) {
-
- if (entry->type == CATCH_TYPE_ENSURE) {
- catch_iseqval = entry->iseq;
- cont_pc = entry->cont;
- cont_sp = entry->sp;
- break;
- }
- }
- }
- }
-
- if (catch_iseqval != 0) {
- /* found catch table */
- rb_iseq_t *catch_iseq;
-
- /* enter catch scope */
- GetISeqPtr(catch_iseqval, catch_iseq);
- cfp->sp = cfp->bp + cont_sp;
- cfp->pc = cfp->iseq->iseq_encoded + cont_pc;
-
- /* push block frame */
- cfp->sp[0] = err;
- vm_push_frame(th, catch_iseq, VM_FRAME_MAGIC_BLOCK,
- cfp->self, (VALUE)cfp->dfp, catch_iseq->iseq_encoded,
- cfp->sp + 1 /* push value */, cfp->lfp, catch_iseq->local_size - 1);
-
- state = 0;
- th->errinfo = Qnil;
- goto vm_loop_start;
- }
- else {
- th->cfp++;
- if (th->cfp->pc != &finish_insn_seq[0]) {
- goto exception_handler;
- }
- else {
- vm_pop_frame(th);
- th->errinfo = err;
- TH_POP_TAG2();
- JUMP_TAG(state);
- }
- }
- }
- finish_vme:
- TH_POP_TAG();
- return result;
-}
-
-/* misc */
-
-VALUE
-rb_iseq_eval(VALUE iseqval)
-{
- rb_thread_t *th = GET_THREAD();
- VALUE val;
- volatile VALUE tmp;
-
- vm_set_top_stack(th, iseqval);
-
- val = vm_exec(th);
- tmp = iseqval; /* prohibit tail call optimization */
- return val;
-}
-
-VALUE
-rb_iseq_eval_main(VALUE iseqval)
-{
- rb_thread_t *th = GET_THREAD();
- VALUE val;
- volatile VALUE tmp;
-
- vm_set_main_stack(th, iseqval);
-
- val = vm_exec(th);
- tmp = iseqval; /* prohibit tail call optimization */
- return val;
-}
-
-int
-rb_thread_method_id_and_class(rb_thread_t *th,
- ID *idp, VALUE *klassp)
-{
- rb_control_frame_t *cfp = th->cfp;
- rb_iseq_t *iseq = cfp->iseq;
- if (!iseq) {
- if (idp) *idp = cfp->me->original_id;
- if (klassp) *klassp = cfp->me->klass;
- return 1;
- }
- while (iseq) {
- if (RUBY_VM_IFUNC_P(iseq)) {
- if (idp) CONST_ID(*idp, "<ifunc>");
- if (klassp) *klassp = 0;
- return 1;
- }
- if (iseq->defined_method_id) {
- if (idp) *idp = iseq->defined_method_id;
- if (klassp) *klassp = iseq->klass;
- return 1;
- }
- if (iseq->local_iseq == iseq) {
- break;
- }
- iseq = iseq->parent_iseq;
- }
- return 0;
-}
-
-int
-rb_frame_method_id_and_class(ID *idp, VALUE *klassp)
-{
- return rb_thread_method_id_and_class(GET_THREAD(), idp, klassp);
-}
-
-VALUE
-rb_thread_current_status(const rb_thread_t *th)
-{
- const rb_control_frame_t *cfp = th->cfp;
- VALUE str = Qnil;
-
- if (cfp->iseq != 0) {
- if (cfp->pc != 0) {
- rb_iseq_t *iseq = cfp->iseq;
- int line_no = rb_vm_get_sourceline(cfp);
- char *file = RSTRING_PTR(iseq->filename);
- str = rb_sprintf("%s:%d:in `%s'",
- file, line_no, RSTRING_PTR(iseq->name));
- }
- }
- else if (cfp->me->original_id) {
- str = rb_sprintf("`%s#%s' (cfunc)",
- RSTRING_PTR(rb_class_name(cfp->me->klass)),
- rb_id2name(cfp->me->original_id));
- }
-
- return str;
-}
-
-VALUE
-rb_vm_call_cfunc(VALUE recv, VALUE (*func)(VALUE), VALUE arg,
- const rb_block_t *blockptr, VALUE filename)
-{
- rb_thread_t *th = GET_THREAD();
- const rb_control_frame_t *reg_cfp = th->cfp;
- volatile VALUE iseqval = rb_iseq_new(0, filename, filename, 0, ISEQ_TYPE_TOP);
- VALUE val;
-
- vm_push_frame(th, DATA_PTR(iseqval), VM_FRAME_MAGIC_TOP,
- recv, (VALUE)blockptr, 0, reg_cfp->sp, 0, 1);
-
- val = (*func)(arg);
-
- vm_pop_frame(th);
- return val;
-}
-
-/* vm */
-
-static int
-vm_mark_each_thread_func(st_data_t key, st_data_t value, st_data_t dummy)
-{
- VALUE thval = (VALUE)key;
- rb_gc_mark(thval);
- return ST_CONTINUE;
-}
-
-static void
-mark_event_hooks(rb_event_hook_t *hook)
-{
- while (hook) {
- rb_gc_mark(hook->data);
- hook = hook->next;
- }
-}
-
-void
-rb_vm_mark(void *ptr)
-{
- int i;
-
- RUBY_MARK_ENTER("vm");
- RUBY_GC_INFO("-------------------------------------------------\n");
- if (ptr) {
- rb_vm_t *vm = ptr;
- if (vm->living_threads) {
- st_foreach(vm->living_threads, vm_mark_each_thread_func, 0);
- }
- RUBY_MARK_UNLESS_NULL(vm->thgroup_default);
- RUBY_MARK_UNLESS_NULL(vm->mark_object_ary);
- RUBY_MARK_UNLESS_NULL(vm->load_path);
- RUBY_MARK_UNLESS_NULL(vm->loaded_features);
- RUBY_MARK_UNLESS_NULL(vm->top_self);
- RUBY_MARK_UNLESS_NULL(vm->coverages);
- rb_gc_mark_locations(vm->special_exceptions, vm->special_exceptions + ruby_special_error_count);
-
- if (vm->loading_table) {
- rb_mark_tbl(vm->loading_table);
- }
-
- mark_event_hooks(vm->event_hooks);
-
- for (i = 0; i < RUBY_NSIG; i++) {
- if (vm->trap_list[i].cmd)
- rb_gc_mark(vm->trap_list[i].cmd);
- }
- }
-
- RUBY_MARK_LEAVE("vm");
-}
-
-static void
-vm_free(void *ptr)
-{
- RUBY_FREE_ENTER("vm");
- if (ptr) {
- rb_vm_t *vmobj = ptr;
-
- st_free_table(vmobj->living_threads);
- vmobj->living_threads = 0;
- /* TODO: MultiVM Instance */
- /* VM object should not be cleaned by GC */
- /* ruby_xfree(ptr); */
- /* ruby_current_vm = 0; */
- }
- RUBY_FREE_LEAVE("vm");
-}
-
-static size_t
-vm_memsize(void *ptr)
-{
- if (ptr) {
- rb_vm_t *vmobj = ptr;
- return sizeof(rb_vm_t) + st_memsize(vmobj->living_threads);
- }
- else {
- return 0;
- }
-}
-
-static const rb_data_type_t vm_data_type = {
- "VM",
- rb_vm_mark, vm_free, vm_memsize,
-};
-
-static void
-vm_init2(rb_vm_t *vm)
-{
- MEMZERO(vm, rb_vm_t, 1);
- vm->src_encoding_index = -1;
-}
-
-/* Thread */
-
-#define USE_THREAD_DATA_RECYCLE 1
-
-#if USE_THREAD_DATA_RECYCLE
-#define RECYCLE_MAX 64
-static VALUE *thread_recycle_stack_slot[RECYCLE_MAX];
-static int thread_recycle_stack_count = 0;
-
-static VALUE *
-thread_recycle_stack(size_t size)
-{
- if (thread_recycle_stack_count) {
- return thread_recycle_stack_slot[--thread_recycle_stack_count];
- }
- else {
- return ALLOC_N(VALUE, size);
- }
-}
-
-#else
-#define thread_recycle_stack(size) ALLOC_N(VALUE, (size))
-#endif
-
-void
-rb_thread_recycle_stack_release(VALUE *stack)
-{
-#if USE_THREAD_DATA_RECYCLE
- if (thread_recycle_stack_count < RECYCLE_MAX) {
- thread_recycle_stack_slot[thread_recycle_stack_count++] = stack;
- return;
- }
-#endif
- ruby_xfree(stack);
-}
-
-#ifdef USE_THREAD_RECYCLE
-static rb_thread_t *
-thread_recycle_struct(void)
-{
- void *p = ALLOC_N(rb_thread_t, 1);
- memset(p, 0, sizeof(rb_thread_t));
- return p;
-}
-#endif
-
-void rb_gc_mark_machine_stack(rb_thread_t *th);
-
-void
-rb_thread_mark(void *ptr)
-{
- rb_thread_t *th = NULL;
- RUBY_MARK_ENTER("thread");
- if (ptr) {
- th = ptr;
- if (th->stack) {
- VALUE *p = th->stack;
- VALUE *sp = th->cfp->sp;
- rb_control_frame_t *cfp = th->cfp;
- rb_control_frame_t *limit_cfp = (void *)(th->stack + th->stack_size);
-
- while (p < sp) {
- rb_gc_mark(*p++);
- }
- rb_gc_mark_locations(p, p + th->mark_stack_len);
-
- while (cfp != limit_cfp) {
- rb_gc_mark(cfp->proc);
- cfp = RUBY_VM_PREVIOUS_CONTROL_FRAME(cfp);
- }
- }
-
- /* mark ruby objects */
- RUBY_MARK_UNLESS_NULL(th->first_proc);
- if (th->first_proc) RUBY_MARK_UNLESS_NULL(th->first_args);
-
- RUBY_MARK_UNLESS_NULL(th->thgroup);
- RUBY_MARK_UNLESS_NULL(th->value);
- RUBY_MARK_UNLESS_NULL(th->errinfo);
- RUBY_MARK_UNLESS_NULL(th->thrown_errinfo);
- RUBY_MARK_UNLESS_NULL(th->local_svar);
- RUBY_MARK_UNLESS_NULL(th->top_self);
- RUBY_MARK_UNLESS_NULL(th->top_wrapper);
- RUBY_MARK_UNLESS_NULL(th->fiber);
- RUBY_MARK_UNLESS_NULL(th->root_fiber);
- RUBY_MARK_UNLESS_NULL(th->stat_insn_usage);
- RUBY_MARK_UNLESS_NULL(th->last_status);
-
- RUBY_MARK_UNLESS_NULL(th->locking_mutex);
-
- rb_mark_tbl(th->local_storage);
-
- if (GET_THREAD() != th && th->machine_stack_start && th->machine_stack_end) {
- rb_gc_mark_machine_stack(th);
- rb_gc_mark_locations((VALUE *)&th->machine_regs,
- (VALUE *)(&th->machine_regs) +
- sizeof(th->machine_regs) / sizeof(VALUE));
- }
-
- mark_event_hooks(th->event_hooks);
- }
-
- RUBY_MARK_LEAVE("thread");
-}
-
-static void
-thread_free(void *ptr)
-{
- rb_thread_t *th;
- RUBY_FREE_ENTER("thread");
-
- if (ptr) {
- th = ptr;
-
- if (!th->root_fiber) {
- RUBY_FREE_UNLESS_NULL(th->stack);
- }
-
- if (th->locking_mutex != Qfalse) {
- rb_bug("thread_free: locking_mutex must be NULL (%p:%ld)", (void *)th, th->locking_mutex);
- }
- if (th->keeping_mutexes != NULL) {
- rb_bug("thread_free: keeping_mutexes must be NULL (%p:%ld)", (void *)th, th->locking_mutex);
- }
-
- if (th->local_storage) {
- st_free_table(th->local_storage);
- }
-
-#if USE_VALUE_CACHE
- {
- VALUE *ptr = th->value_cache_ptr;
- while (*ptr) {
- VALUE v = *ptr;
- RBASIC(v)->flags = 0;
- RBASIC(v)->klass = 0;
- ptr++;
- }
- }
-#endif
-
- if (th->vm && th->vm->main_thread == th) {
- RUBY_GC_INFO("main thread\n");
- }
- else {
- ruby_xfree(ptr);
- }
- }
- RUBY_FREE_LEAVE("thread");
-}
-
-static size_t
-thread_memsize(void *ptr)
-{
- RUBY_FREE_ENTER("thread");
-
- if (ptr) {
- rb_thread_t *th = ptr;
- size_t size = sizeof(rb_thread_t);
-
- if (!th->root_fiber) {
- size += th->stack_size * sizeof(VALUE);
- }
- if (th->local_storage) {
- st_memsize(th->local_storage);
- }
- return size;
- }
- else {
- return 0;
- }
-}
-
-static const rb_data_type_t thread_data_type = {
- "VM/thread",
- rb_thread_mark,
- thread_free,
- thread_memsize,
-};
-
-static VALUE
-thread_alloc(VALUE klass)
-{
- VALUE volatile obj;
-#ifdef USE_THREAD_RECYCLE
- rb_thread_t *th = thread_recycle_struct();
- obj = TypedData_Wrap_Struct(klass, &thread_data_type, th);
-#else
- rb_thread_t *th;
- obj = TypedData_Make_Struct(klass, rb_thread_t, &thread_data_type, th);
-#endif
- return obj;
-}
-
-static void
-th_init2(rb_thread_t *th, VALUE self)
-{
- th->self = self;
-
- /* allocate thread stack */
- th->stack_size = RUBY_VM_THREAD_STACK_SIZE;
- th->stack = thread_recycle_stack(th->stack_size);
-
- th->cfp = (void *)(th->stack + th->stack_size);
-
- vm_push_frame(th, 0, VM_FRAME_MAGIC_TOP, Qnil, 0, 0,
- th->stack, 0, 1);
-
- th->status = THREAD_RUNNABLE;
- th->errinfo = Qnil;
- th->last_status = Qnil;
-
-#if USE_VALUE_CACHE
- th->value_cache_ptr = &th->value_cache[0];
-#endif
-}
-
-static void
-th_init(rb_thread_t *th, VALUE self)
-{
- th_init2(th, self);
-}
-
-static VALUE
-ruby_thread_init(VALUE self)
-{
- rb_thread_t *th;
- rb_vm_t *vm = GET_THREAD()->vm;
- GetThreadPtr(self, th);
-
- th_init(th, self);
- th->vm = vm;
-
- th->top_wrapper = 0;
- th->top_self = rb_vm_top_self();
- return self;
-}
-
-VALUE
-rb_thread_alloc(VALUE klass)
-{
- VALUE self = thread_alloc(klass);
- ruby_thread_init(self);
- return self;
-}
-
-static void
-vm_define_method(rb_thread_t *th, VALUE obj, ID id, VALUE iseqval,
- rb_num_t is_singleton, NODE *cref)
-{
- VALUE klass = cref->nd_clss;
- int noex = (int)cref->nd_visi;
- rb_iseq_t *miseq;
- GetISeqPtr(iseqval, miseq);
-
- if (NIL_P(klass)) {
- rb_raise(rb_eTypeError, "no class/module to add method");
- }
-
- if (is_singleton) {
- if (FIXNUM_P(obj) || SYMBOL_P(obj)) {
- rb_raise(rb_eTypeError,
- "can't define singleton method \"%s\" for %s",
- rb_id2name(id), rb_obj_classname(obj));
- }
-
- if (OBJ_FROZEN(obj)) {
- rb_error_frozen("object");
- }
-
- klass = rb_singleton_class(obj);
- noex = NOEX_PUBLIC;
- }
-
- /* dup */
- COPY_CREF(miseq->cref_stack, cref);
- miseq->klass = klass;
- miseq->defined_method_id = id;
- rb_add_method(klass, id, VM_METHOD_TYPE_ISEQ, miseq, noex);
-
- if (!is_singleton && noex == NOEX_MODFUNC) {
- rb_add_method(rb_singleton_class(klass), id, VM_METHOD_TYPE_ISEQ, miseq, NOEX_PUBLIC);
- }
- INC_VM_STATE_VERSION();
-}
-
-#define REWIND_CFP(expr) do { \
- rb_thread_t *th__ = GET_THREAD(); \
- th__->cfp++; expr; th__->cfp--; \
-} while (0)
-
-static VALUE
-m_core_define_method(VALUE self, VALUE cbase, VALUE sym, VALUE iseqval)
-{
- REWIND_CFP({
- vm_define_method(GET_THREAD(), cbase, SYM2ID(sym), iseqval, 0, rb_vm_cref());
- });
- return Qnil;
-}
-
-static VALUE
-m_core_define_singleton_method(VALUE self, VALUE cbase, VALUE sym, VALUE iseqval)
-{
- REWIND_CFP({
- vm_define_method(GET_THREAD(), cbase, SYM2ID(sym), iseqval, 1, rb_vm_cref());
- });
- return Qnil;
-}
-
-static VALUE
-m_core_set_method_alias(VALUE self, VALUE cbase, VALUE sym1, VALUE sym2)
-{
- REWIND_CFP({
- rb_alias(cbase, SYM2ID(sym1), SYM2ID(sym2));
- });
- return Qnil;
-}
-
-static VALUE
-m_core_set_variable_alias(VALUE self, VALUE sym1, VALUE sym2)
-{
- REWIND_CFP({
- rb_alias_variable(SYM2ID(sym1), SYM2ID(sym2));
- });
- return Qnil;
-}
-
-static VALUE
-m_core_undef_method(VALUE self, VALUE cbase, VALUE sym)
-{
- REWIND_CFP({
- rb_undef(cbase, SYM2ID(sym));
- INC_VM_STATE_VERSION();
- });
- return Qnil;
-}
-
-static VALUE
-m_core_set_postexe(VALUE self, VALUE iseqval)
-{
- REWIND_CFP({
- rb_iseq_t *blockiseq;
- rb_block_t *blockptr;
- rb_thread_t *th = GET_THREAD();
- rb_control_frame_t *cfp = rb_vm_get_ruby_level_next_cfp(th, th->cfp);
- VALUE proc;
- extern void rb_call_end_proc(VALUE data);
-
- GetISeqPtr(iseqval, blockiseq);
-
- blockptr = RUBY_VM_GET_BLOCK_PTR_IN_CFP(cfp);
- blockptr->iseq = blockiseq;
- blockptr->proc = 0;
-
- proc = rb_vm_make_proc(th, blockptr, rb_cProc);
- rb_set_end_proc(rb_call_end_proc, proc);
- });
- return Qnil;
-}
-
-extern VALUE *rb_gc_stack_start;
-extern size_t rb_gc_stack_maxsize;
-#ifdef __ia64
-extern VALUE *rb_gc_register_stack_start;
-#endif
-
-/* debug functions */
-
-static VALUE
-sdr(void)
-{
- rb_vm_bugreport();
- return Qnil;
-}
-
-static VALUE
-nsdr(void)
-{
- VALUE ary = rb_ary_new();
-#if HAVE_BACKTRACE
-#include <execinfo.h>
-#define MAX_NATIVE_TRACE 1024
- static void *trace[MAX_NATIVE_TRACE];
- int n = backtrace(trace, MAX_NATIVE_TRACE);
- char **syms = backtrace_symbols(trace, n);
- int i;
-
- if (syms == 0) {
- rb_memerror();
- }
-
- for (i=0; i<n; i++) {
- rb_ary_push(ary, rb_str_new2(syms[i]));
- }
- free(syms); /* OK */
-#endif
- return ary;
-}
-
-void
-Init_VM(void)
-{
- VALUE opts;
- VALUE klass;
- VALUE fcore;
-
- /* ::VM */
- rb_cRubyVM = rb_define_class("RubyVM", rb_cObject);
- rb_undef_alloc_func(rb_cRubyVM);
-
- /* ::VM::FrozenCore */
- fcore = rb_class_new(rb_cBasicObject);
- RBASIC(fcore)->flags = T_ICLASS;
- klass = rb_singleton_class(fcore);
- rb_define_method_id(klass, id_core_set_method_alias, m_core_set_method_alias, 3);
- rb_define_method_id(klass, id_core_set_variable_alias, m_core_set_variable_alias, 2);
- rb_define_method_id(klass, id_core_undef_method, m_core_undef_method, 2);
- rb_define_method_id(klass, id_core_define_method, m_core_define_method, 3);
- rb_define_method_id(klass, id_core_define_singleton_method, m_core_define_singleton_method, 3);
- rb_define_method_id(klass, id_core_set_postexe, m_core_set_postexe, 1);
- rb_obj_freeze(fcore);
- rb_gc_register_mark_object(fcore);
- rb_mRubyVMFrozenCore = fcore;
-
- /* ::VM::Env */
- rb_cEnv = rb_define_class_under(rb_cRubyVM, "Env", rb_cObject);
- rb_undef_alloc_func(rb_cEnv);
-
- /* ::Thread */
- rb_cThread = rb_define_class("Thread", rb_cObject);
- rb_undef_alloc_func(rb_cThread);
-
- /* ::VM::USAGE_ANALYSIS_* */
- rb_define_const(rb_cRubyVM, "USAGE_ANALYSIS_INSN", rb_hash_new());
- rb_define_const(rb_cRubyVM, "USAGE_ANALYSIS_REGS", rb_hash_new());
- rb_define_const(rb_cRubyVM, "USAGE_ANALYSIS_INSN_BIGRAM", rb_hash_new());
- rb_define_const(rb_cRubyVM, "OPTS", opts = rb_ary_new());
-
-#if OPT_DIRECT_THREADED_CODE
- rb_ary_push(opts, rb_str_new2("direct threaded code"));
-#elif OPT_TOKEN_THREADED_CODE
- rb_ary_push(opts, rb_str_new2("token threaded code"));
-#elif OPT_CALL_THREADED_CODE
- rb_ary_push(opts, rb_str_new2("call threaded code"));
-#endif
-
-#if OPT_BASIC_OPERATIONS
- rb_ary_push(opts, rb_str_new2("optimize basic operation"));
-#endif
-
-#if OPT_STACK_CACHING
- rb_ary_push(opts, rb_str_new2("stack caching"));
-#endif
-#if OPT_OPERANDS_UNIFICATION
- rb_ary_push(opts, rb_str_new2("operands unification]"));
-#endif
-#if OPT_INSTRUCTIONS_UNIFICATION
- rb_ary_push(opts, rb_str_new2("instructions unification"));
-#endif
-#if OPT_INLINE_METHOD_CACHE
- rb_ary_push(opts, rb_str_new2("inline method cache"));
-#endif
-#if OPT_BLOCKINLINING
- rb_ary_push(opts, rb_str_new2("block inlining"));
-#endif
-
- /* ::VM::InsnNameArray */
- rb_define_const(rb_cRubyVM, "INSTRUCTION_NAMES", rb_insns_name_array());
-
- /* debug functions ::VM::SDR(), ::VM::NSDR() */
-#if VMDEBUG
- rb_define_singleton_method(rb_cRubyVM, "SDR", sdr, 0);
- rb_define_singleton_method(rb_cRubyVM, "NSDR", nsdr, 0);
-#else
- (void)sdr;
- (void)nsdr;
-#endif
-
- /* VM bootstrap: phase 2 */
- {
- rb_vm_t *vm = ruby_current_vm;
- rb_thread_t *th = GET_THREAD();
- VALUE filename = rb_str_new2("<main>");
- volatile VALUE iseqval = rb_iseq_new(0, filename, filename, 0, ISEQ_TYPE_TOP);
- volatile VALUE th_self;
- rb_iseq_t *iseq;
-
- /* create vm object */
- vm->self = TypedData_Wrap_Struct(rb_cRubyVM, &vm_data_type, vm);
-
- /* create main thread */
- th_self = th->self = TypedData_Wrap_Struct(rb_cThread, &thread_data_type, th);
- vm->main_thread = th;
- vm->running_thread = th;
- th->vm = vm;
- th->top_wrapper = 0;
- th->top_self = rb_vm_top_self();
- rb_thread_set_current(th);
-
- vm->living_threads = st_init_numtable();
- st_insert(vm->living_threads, th_self, (st_data_t) th->thread_id);
-
- rb_gc_register_mark_object(iseqval);
- GetISeqPtr(iseqval, iseq);
- th->cfp->iseq = iseq;
- th->cfp->pc = iseq->iseq_encoded;
- th->cfp->self = th->top_self;
-
- rb_define_global_const("TOPLEVEL_BINDING", rb_binding_new());
- }
- vm_init_redefined_flag();
-}
-
-void
-rb_vm_set_progname(VALUE filename)
-{
- rb_thread_t *th = GET_VM()->main_thread;
- rb_control_frame_t *cfp = (void *)(th->stack + th->stack_size);
- --cfp;
- cfp->iseq->filename = filename;
-}
-
-#if defined(ENABLE_VM_OBJSPACE) && ENABLE_VM_OBJSPACE
-struct rb_objspace *rb_objspace_alloc(void);
-#endif
-void ruby_thread_init_stack(rb_thread_t *th);
-
-void
-Init_BareVM(void)
-{
- /* VM bootstrap: phase 1 */
- rb_vm_t * vm = malloc(sizeof(*vm));
- rb_thread_t * th = malloc(sizeof(*th));
- if (!vm || !th) {
- fprintf(stderr, "[FATAL] failed to allocate memory\n");
- exit(EXIT_FAILURE);
- }
- MEMZERO(th, rb_thread_t, 1);
-
- rb_thread_set_current_raw(th);
-
- vm_init2(vm);
-#if defined(ENABLE_VM_OBJSPACE) && ENABLE_VM_OBJSPACE
- vm->objspace = rb_objspace_alloc();
-#endif
- ruby_current_vm = vm;
-
- th_init2(th, 0);
- th->vm = vm;
- ruby_thread_init_stack(th);
-}
-
-/* top self */
-
-static VALUE
-main_to_s(VALUE obj)
-{
- return rb_str_new2("main");
-}
-
-VALUE
-rb_vm_top_self(void)
-{
- return GET_VM()->top_self;
-}
-
-void
-Init_top_self(void)
-{
- rb_vm_t *vm = GET_VM();
-
- vm->top_self = rb_obj_alloc(rb_cObject);
- rb_define_singleton_method(rb_vm_top_self(), "to_s", main_to_s, 0);
-
- /* initialize mark object array */
- vm->mark_object_ary = rb_ary_tmp_new(1);
-}
-
-VALUE *
-ruby_vm_verbose_ptr(rb_vm_t *vm)
-{
- return &vm->verbose;
-}
-
-VALUE *
-ruby_vm_debug_ptr(rb_vm_t *vm)
-{
- return &vm->debug;
-}
-
-VALUE *
-rb_ruby_verbose_ptr(void)
-{
- return ruby_vm_verbose_ptr(GET_VM());
-}
-
-VALUE *
-rb_ruby_debug_ptr(void)
-{
- return ruby_vm_debug_ptr(GET_VM());
-}
diff --git a/vm_core.h b/vm_core.h
deleted file mode 100644
index e838bba5dd..0000000000
--- a/vm_core.h
+++ /dev/null
@@ -1,649 +0,0 @@
-/**********************************************************************
-
- vm_core.h -
-
- $Author$
- created at: 04/01/01 19:41:38 JST
-
- Copyright (C) 2004-2007 Koichi Sasada
-
-**********************************************************************/
-
-#ifndef RUBY_VM_CORE_H
-#define RUBY_VM_CORE_H
-
-#define RUBY_VM_THREAD_MODEL 2
-
-#include "ruby/ruby.h"
-#include "ruby/st.h"
-
-#include "node.h"
-#include "debug.h"
-#include "vm_opts.h"
-#include "id.h"
-#include "method.h"
-
-#if defined(_WIN32)
-#include "thread_win32.h"
-#elif defined(HAVE_PTHREAD_H)
-#include "thread_pthread.h"
-#else
-#error "unsupported thread type"
-#endif
-
-#include <setjmp.h>
-#include <signal.h>
-
-#ifndef NSIG
-# define NSIG (_SIGMAX + 1) /* For QNX */
-#endif
-
-#define RUBY_NSIG NSIG
-
-#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
-
-/*****************/
-/* configuration */
-/*****************/
-
-/* gcc ver. check */
-#if defined(__GNUC__) && __GNUC__ >= 2
-
-#if OPT_TOKEN_THREADED_CODE
-#if OPT_DIRECT_THREADED_CODE
-#undef OPT_DIRECT_THREADED_CODE
-#endif
-#endif
-
-#else /* defined(__GNUC__) && __GNUC__ >= 2 */
-
-/* disable threaded code options */
-#if OPT_DIRECT_THREADED_CODE
-#undef OPT_DIRECT_THREADED_CODE
-#endif
-#if OPT_TOKEN_THREADED_CODE
-#undef OPT_TOKEN_THREADED_CODE
-#endif
-#endif
-
-/* call threaded code */
-#if OPT_CALL_THREADED_CODE
-#if OPT_DIRECT_THREADED_CODE
-#undef OPT_DIRECT_THREADED_CODE
-#endif /* OPT_DIRECT_THREADED_CODE */
-#if OPT_STACK_CACHING
-#undef OPT_STACK_CACHING
-#endif /* OPT_STACK_CACHING */
-#endif /* OPT_CALL_THREADED_CODE */
-
-/* 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 */
-
-typedef unsigned long rb_num_t;
-
-/* iseq data type */
-
-struct iseq_compile_data_ensure_node_stack;
-
-typedef struct rb_compile_option_struct {
- 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;
-} rb_compile_option_t;
-
-struct iseq_inline_cache_entry {
- long ic_vmstat;
- VALUE ic_class;
- VALUE ic_value;
- rb_method_entry_t *ic_method;
-#define ic_index ic_vmstat
-};
-
-#if 1
-#define GetCoreDataFromValue(obj, type, ptr) do { \
- ptr = (type*)DATA_PTR(obj); \
-} while (0)
-#else
-#define GetCoreDataFromValue(obj, type, ptr) Data_Get_Struct(obj, type, ptr)
-#endif
-
-#define GetISeqPtr(obj, ptr) \
- GetCoreDataFromValue(obj, rb_iseq_t, ptr)
-
-struct rb_iseq_struct;
-
-struct rb_iseq_struct {
- /***************/
- /* static data */
- /***************/
-
- VALUE type; /* instruction sequence type */
- VALUE name; /* String: iseq name */
- VALUE filename; /* file information where this sequence from */
- VALUE *iseq; /* iseq (insn number and openrads) */
- VALUE *iseq_encoded; /* encoded iseq */
- unsigned long iseq_size;
- VALUE mark_ary; /* Array: includes operands which should be GC marked */
- VALUE coverage; /* coverage array */
-
- /* insn info, must be freed */
- struct iseq_insn_info_entry *insn_info_table;
- size_t insn_info_size;
-
- ID *local_table; /* must free */
- int local_table_size;
-
- /* method, class frame: sizeof(vars) + 1, block frame: sizeof(vars) */
- int local_size;
-
- struct iseq_inline_cache_entry *ic_entries;
- int ic_size;
-
- /**
- * argument information
- *
- * def m(a1, a2, ..., aM, # mandatory
- * b1=(...), b2=(...), ..., bN=(...), # optinal
- * *c, # rest
- * d1, d2, ..., dO, # post
- * &e) # block
- * =>
- *
- * argc = M
- * arg_rest = M+N+1 // or -1 if no rest arg
- * arg_opts = N
- * arg_opts_tbl = [ (N entries) ]
- * arg_post_len = O // 0 if no post arguments
- * arg_post_start = M+N+2
- * arg_block = M+N + 1 + O + 1 // -1 if no block arg
- * arg_simple = 0 if not simple arguments.
- * = 1 if no opt, rest, post, block.
- * = 2 if ambiguos block parameter ({|a|}).
- * arg_size = argument size.
- */
-
- int argc;
- int arg_simple;
- int arg_rest;
- int arg_block;
- int arg_opts;
- int arg_post_len;
- int arg_post_start;
- int arg_size;
- VALUE *arg_opt_table;
-
- size_t stack_max; /* for stack overflow check */
-
- /* catch table */
- struct iseq_catch_table_entry *catch_table;
- int catch_table_size;
-
- /* for child iseq */
- struct rb_iseq_struct *parent_iseq;
- struct rb_iseq_struct *local_iseq;
-
- /****************/
- /* dynamic data */
- /****************/
-
- VALUE self;
- VALUE orig; /* non-NULL if its data have origin */
-
- /* block inlining */
- /*
- * NODE *node;
- * void *special_block_builder;
- * void *cached_special_block_builder;
- * VALUE cached_special_block;
- */
-
- /* klass/module nest information stack (cref) */
- NODE *cref_stack;
- VALUE klass;
-
- /* misc */
- ID defined_method_id; /* for define_method */
-
- /* used at compile time */
- struct iseq_compile_data *compile_data;
-};
-
-enum ruby_special_exceptions {
- ruby_error_reenter,
- ruby_error_nomemory,
- ruby_error_sysstack,
- ruby_special_error_count
-};
-
-#define GetVMPtr(obj, ptr) \
- GetCoreDataFromValue(obj, rb_vm_t, ptr)
-
-typedef struct rb_vm_struct {
- VALUE self;
-
- rb_thread_lock_t global_vm_lock;
-
- struct rb_thread_struct *main_thread;
- struct rb_thread_struct *running_thread;
-
- st_table *living_threads;
- VALUE thgroup_default;
-
- int running;
- int thread_abort_on_exception;
- unsigned long trace_flag;
- volatile int sleeper;
-
- /* object management */
- VALUE mark_object_ary;
-
- VALUE special_exceptions[ruby_special_error_count];
-
- /* load */
- VALUE top_self;
- VALUE load_path;
- VALUE loaded_features;
- struct st_table *loading_table;
-
- /* signal */
- struct {
- VALUE cmd;
- int safe;
- } trap_list[RUBY_NSIG];
-
- /* hook */
- rb_event_hook_t *event_hooks;
-
- int src_encoding_index;
-
- VALUE verbose, debug, progname;
- VALUE coverages;
-
-#if defined(ENABLE_VM_OBJSPACE) && ENABLE_VM_OBJSPACE
- struct rb_objspace *objspace;
-#endif
-} rb_vm_t;
-
-typedef struct {
- VALUE *pc; /* cfp[0] */
- VALUE *sp; /* cfp[1] */
- VALUE *bp; /* cfp[2] */
- rb_iseq_t *iseq; /* cfp[3] */
- VALUE flag; /* cfp[4] */
- VALUE self; /* cfp[5] / block[0] */
- VALUE *lfp; /* cfp[6] / block[1] */
- VALUE *dfp; /* cfp[7] / block[2] */
- rb_iseq_t *block_iseq; /* cfp[8] / block[3] */
- VALUE proc; /* cfp[9] / block[4] */
- const rb_method_entry_t *me;/* cfp[10] */
-} rb_control_frame_t;
-
-typedef struct rb_block_struct {
- VALUE self; /* share with method frame if it's only block */
- VALUE *lfp; /* share with method frame if it's only block */
- VALUE *dfp; /* share with method frame if it's only block */
- rb_iseq_t *iseq;
- VALUE proc;
-} rb_block_t;
-
-#define GetThreadPtr(obj, ptr) \
- GetCoreDataFromValue(obj, rb_thread_t, ptr)
-
-enum rb_thread_status {
- THREAD_TO_KILL,
- THREAD_RUNNABLE,
- THREAD_STOPPED,
- THREAD_STOPPED_FOREVER,
- THREAD_KILLED
-};
-
-typedef RUBY_JMP_BUF rb_jmpbuf_t;
-
-struct rb_vm_tag {
- rb_jmpbuf_t buf;
- VALUE tag;
- VALUE retval;
- struct rb_vm_tag *prev;
-};
-
-struct rb_vm_trap_tag {
- struct rb_vm_trap_tag *prev;
-};
-
-#define RUBY_VM_VALUE_CACHE_SIZE 0x1000
-#define USE_VALUE_CACHE 0
-
-struct rb_unblock_callback {
- rb_unblock_function_t *func;
- void *arg;
-};
-
-struct rb_mutex_struct;
-
-typedef struct rb_thread_struct
-{
- VALUE self;
- rb_vm_t *vm;
-
- /* execution information */
- VALUE *stack; /* must free, must mark */
- unsigned long stack_size;
- rb_control_frame_t *cfp;
- int safe_level;
- int raised_flag;
- VALUE last_status; /* $? */
-
- /* passing state */
- int state;
-
- /* for rb_iterate */
- const rb_block_t *passed_block;
-
- /* for load(true) */
- VALUE top_self;
- VALUE top_wrapper;
-
- /* eval env */
- rb_block_t *base_block;
-
- VALUE *local_lfp;
- VALUE local_svar;
-
- /* thread control */
- rb_thread_id_t thread_id;
- enum rb_thread_status status;
- int priority;
- int slice;
-
- native_thread_data_t native_thread_data;
- void *blocking_region_buffer;
-
- VALUE thgroup;
- VALUE value;
-
- VALUE errinfo;
- VALUE thrown_errinfo;
- int exec_signal;
-
- int interrupt_flag;
- rb_thread_lock_t interrupt_lock;
- struct rb_unblock_callback unblock;
- VALUE locking_mutex;
- struct rb_mutex_struct *keeping_mutexes;
- int transition_for_lock;
-
- struct rb_vm_tag *tag;
- struct rb_vm_trap_tag *trap_tag;
-
- int parse_in_eval;
- int mild_compile_error;
-
- /* storage */
- st_table *local_storage;
-#if USE_VALUE_CACHE
- VALUE value_cache[RUBY_VM_VALUE_CACHE_SIZE + 1];
- VALUE *value_cache_ptr;
-#endif
-
- struct rb_thread_struct *join_list_next;
- struct rb_thread_struct *join_list_head;
-
- VALUE first_proc;
- VALUE first_args;
- VALUE (*first_func)(ANYARGS);
-
- /* for GC */
- VALUE *machine_stack_start;
- VALUE *machine_stack_end;
- size_t machine_stack_maxsize;
-#ifdef __ia64
- VALUE *machine_register_stack_start;
- VALUE *machine_register_stack_end;
- size_t machine_register_stack_maxsize;
-#endif
- jmp_buf machine_regs;
- int mark_stack_len;
-
- /* statistics data for profiler */
- VALUE stat_insn_usage;
-
- /* tracer */
- rb_event_hook_t *event_hooks;
- rb_event_flag_t event_flags;
- int tracing;
-
- /* fiber */
- VALUE fiber;
- VALUE root_fiber;
- rb_jmpbuf_t root_jmpbuf;
-
- /* misc */
- int method_missing_reason;
- int abort_on_exception;
-} rb_thread_t;
-
-/* iseq.c */
-VALUE rb_iseq_new(NODE*, VALUE, VALUE, VALUE, VALUE);
-VALUE rb_iseq_new_top(NODE *node, VALUE name, VALUE filename, VALUE parent);
-VALUE rb_iseq_new_main(NODE *node, VALUE filename);
-VALUE rb_iseq_new_with_bopt(NODE*, VALUE, VALUE, VALUE, VALUE, VALUE);
-VALUE rb_iseq_new_with_opt(NODE*, VALUE, VALUE, VALUE, VALUE, const rb_compile_option_t*);
-VALUE rb_iseq_compile(VALUE src, VALUE file, VALUE line);
-VALUE rb_iseq_disasm(VALUE self);
-VALUE rb_iseq_disasm_insn(VALUE str, VALUE *iseqval, int pos, rb_iseq_t *iseq, VALUE child);
-const char *ruby_node_name(int node);
-int rb_iseq_first_lineno(rb_iseq_t *iseq);
-
-RUBY_EXTERN VALUE rb_cISeq;
-RUBY_EXTERN VALUE rb_cRubyVM;
-RUBY_EXTERN VALUE rb_cEnv;
-RUBY_EXTERN VALUE rb_mRubyVMFrozenCore;
-
-/* each thread has this size stack : 128KB */
-#define RUBY_VM_THREAD_STACK_SIZE (128 * 1024)
-
-#define GetProcPtr(obj, ptr) \
- GetCoreDataFromValue(obj, rb_proc_t, ptr)
-
-typedef struct {
- rb_block_t block;
-
- VALUE envval; /* for GC mark */
- VALUE blockprocval;
- int safe_level;
- int is_from_method;
- int is_lambda;
-} rb_proc_t;
-
-#define GetEnvPtr(obj, ptr) \
- GetCoreDataFromValue(obj, rb_env_t, ptr)
-
-typedef struct {
- VALUE *env;
- int env_size;
- int local_size;
- VALUE prev_envval; /* for GC mark */
- rb_block_t block;
-} rb_env_t;
-
-#define GetBindingPtr(obj, ptr) \
- GetCoreDataFromValue(obj, rb_binding_t, ptr)
-
-typedef struct {
- VALUE env;
-} rb_binding_t;
-
-/* used by compile time and send insn */
-#define VM_CALL_ARGS_SPLAT_BIT (0x01 << 1)
-#define VM_CALL_ARGS_BLOCKARG_BIT (0x01 << 2)
-#define VM_CALL_FCALL_BIT (0x01 << 3)
-#define VM_CALL_VCALL_BIT (0x01 << 4)
-#define VM_CALL_TAILCALL_BIT (0x01 << 5)
-#define VM_CALL_TAILRECURSION_BIT (0x01 << 6)
-#define VM_CALL_SUPER_BIT (0x01 << 7)
-
-#define VM_SPECIAL_OBJECT_VMCORE 0x01
-#define VM_SPECIAL_OBJECT_CBASE 0x02
-
-#define VM_FRAME_MAGIC_METHOD 0x11
-#define VM_FRAME_MAGIC_BLOCK 0x21
-#define VM_FRAME_MAGIC_CLASS 0x31
-#define VM_FRAME_MAGIC_TOP 0x41
-#define VM_FRAME_MAGIC_FINISH 0x51
-#define VM_FRAME_MAGIC_CFUNC 0x61
-#define VM_FRAME_MAGIC_PROC 0x71
-#define VM_FRAME_MAGIC_IFUNC 0x81
-#define VM_FRAME_MAGIC_EVAL 0x91
-#define VM_FRAME_MAGIC_LAMBDA 0xa1
-#define VM_FRAME_MAGIC_MASK_BITS 8
-#define VM_FRAME_MAGIC_MASK (~(~0<<VM_FRAME_MAGIC_MASK_BITS))
-
-#define VM_FRAME_TYPE(cfp) ((cfp)->flag & VM_FRAME_MAGIC_MASK)
-
-/* other frame flag */
-#define VM_FRAME_FLAG_PASSED 0x0100
-
-#define RUBYVM_CFUNC_FRAME_P(cfp) \
- (VM_FRAME_TYPE(cfp) == VM_FRAME_MAGIC_CFUNC)
-
-/* inline cache */
-typedef struct iseq_inline_cache_entry *IC;
-
-void rb_vm_change_state(void);
-
-typedef VALUE CDHASH;
-
-#ifndef FUNC_FASTCALL
-#define FUNC_FASTCALL(x) x
-#endif
-
-typedef rb_control_frame_t *
- (FUNC_FASTCALL(*rb_insn_func_t))(rb_thread_t *, rb_control_frame_t *);
-
-#define GC_GUARDED_PTR(p) ((VALUE)((VALUE)(p) | 0x01))
-#define GC_GUARDED_PTR_REF(p) ((void *)(((VALUE)p) & ~0x03))
-#define GC_GUARDED_PTR_P(p) (((VALUE)p) & 0x01)
-
-#define RUBY_VM_PREVIOUS_CONTROL_FRAME(cfp) (cfp+1)
-#define RUBY_VM_NEXT_CONTROL_FRAME(cfp) (cfp-1)
-#define RUBY_VM_END_CONTROL_FRAME(th) \
- ((rb_control_frame_t *)((th)->stack + (th)->stack_size))
-#define RUBY_VM_VALID_CONTROL_FRAME_P(cfp, ecfp) \
- ((void *)(ecfp) > (void *)(cfp))
-#define RUBY_VM_CONTROL_FRAME_STACK_OVERFLOW_P(th, cfp) \
- (!RUBY_VM_VALID_CONTROL_FRAME_P((cfp), RUBY_VM_END_CONTROL_FRAME(th)))
-
-#define RUBY_VM_IFUNC_P(ptr) (BUILTIN_TYPE(ptr) == T_NODE)
-#define RUBY_VM_NORMAL_ISEQ_P(ptr) \
- (ptr && !RUBY_VM_IFUNC_P(ptr))
-
-#define RUBY_VM_CLASS_SPECIAL_P(ptr) (((VALUE)(ptr)) & 0x02)
-
-#define RUBY_VM_GET_BLOCK_PTR_IN_CFP(cfp) ((rb_block_t *)(&(cfp)->self))
-#define RUBY_VM_GET_CFP_FROM_BLOCK_PTR(b) \
- ((rb_control_frame_t *)((VALUE *)(b) - 5))
-
-/* VM related object allocate functions */
-VALUE rb_thread_alloc(VALUE klass);
-VALUE rb_proc_alloc(VALUE klass);
-
-/* for debug */
-extern void rb_vmdebug_stack_dump_raw(rb_thread_t *, rb_control_frame_t *);
-#define SDR() rb_vmdebug_stack_dump_raw(GET_THREAD(), GET_THREAD()->cfp)
-#define SDR2(cfp) rb_vmdebug_stack_dump_raw(GET_THREAD(), (cfp))
-void rb_vm_bugreport(void);
-
-/* functions about thread/vm execution */
-VALUE rb_iseq_eval(VALUE iseqval);
-VALUE rb_iseq_eval_main(VALUE iseqval);
-void rb_enable_interrupt(void);
-void rb_disable_interrupt(void);
-int rb_thread_method_id_and_class(rb_thread_t *th, ID *idp, VALUE *klassp);
-
-VALUE rb_vm_invoke_proc(rb_thread_t *th, rb_proc_t *proc, VALUE self,
- int argc, const VALUE *argv, const rb_block_t *blockptr);
-VALUE rb_vm_make_proc(rb_thread_t *th, const rb_block_t *block, VALUE klass);
-VALUE rb_vm_make_env_object(rb_thread_t *th, rb_control_frame_t *cfp);
-
-void *rb_thread_call_with_gvl(void *(*func)(void *), void *data1);
-int ruby_thread_has_gvl_p(void);
-VALUE rb_make_backtrace(void);
-typedef int rb_backtrace_iter_func(void *, const char *, int, const char *);
-VALUE rb_backtrace_each(rb_backtrace_iter_func *iter, void *arg);
-rb_control_frame_t *rb_vm_get_ruby_level_next_cfp(rb_thread_t *th, rb_control_frame_t *cfp);
-
-NOINLINE(void rb_gc_save_machine_context(rb_thread_t *));
-
-#define sysstack_error GET_VM()->special_exceptions[ruby_error_sysstack]
-
-VALUE rb_str_resurrect(VALUE str);
-VALUE rb_ary_resurrect(VALUE ary);
-
-/* for thread */
-
-#if RUBY_VM_THREAD_MODEL == 2
-RUBY_EXTERN rb_thread_t *ruby_current_thread;
-extern rb_vm_t *ruby_current_vm;
-
-#define GET_VM() ruby_current_vm
-#define GET_THREAD() ruby_current_thread
-#define rb_thread_set_current_raw(th) (void)(ruby_current_thread = (th))
-#define rb_thread_set_current(th) do { \
- rb_thread_set_current_raw(th); \
- th->vm->running_thread = th; \
-} while (0)
-
-#else
-#error "unsupported thread model"
-#endif
-
-#define RUBY_VM_SET_INTERRUPT(th) ((th)->interrupt_flag |= 0x02)
-#define RUBY_VM_SET_TIMER_INTERRUPT(th) ((th)->interrupt_flag |= 0x01)
-#define RUBY_VM_SET_FINALIZER_INTERRUPT(th) ((th)->interrupt_flag |= 0x04)
-#define RUBY_VM_INTERRUPTED(th) ((th)->interrupt_flag & 0x02)
-
-void rb_threadptr_signal_raise(rb_thread_t *th, int sig);
-void rb_threadptr_signal_exit(rb_thread_t *th);
-void rb_threadptr_execute_interrupts(rb_thread_t *);
-
-#define RUBY_VM_CHECK_INTS_TH(th) do { \
- if (UNLIKELY(th->interrupt_flag)) { \
- rb_threadptr_execute_interrupts(th); \
- } \
-} while (0)
-
-#define RUBY_VM_CHECK_INTS() \
- RUBY_VM_CHECK_INTS_TH(GET_THREAD())
-
-/* tracer */
-void
-rb_threadptr_exec_event_hooks(rb_thread_t *th, rb_event_flag_t flag, VALUE self, ID id, VALUE klass);
-
-#define EXEC_EVENT_HOOK(th, flag, self, id, klass) do { \
- rb_event_flag_t wait_event__ = th->event_flags; \
- if (UNLIKELY(wait_event__)) { \
- if (wait_event__ & (flag | RUBY_EVENT_VM)) { \
- rb_threadptr_exec_event_hooks(th, flag, self, id, klass); \
- } \
- } \
-} while (0)
-
-#endif /* RUBY_VM_CORE_H */
diff --git a/vm_dump.c b/vm_dump.c
deleted file mode 100644
index d22c652cf0..0000000000
--- a/vm_dump.c
+++ /dev/null
@@ -1,613 +0,0 @@
-/**********************************************************************
-
- vm_dump.c -
-
- $Author$
-
- Copyright (C) 2004-2007 Koichi Sasada
-
-**********************************************************************/
-
-
-#include "ruby/ruby.h"
-#include "vm_core.h"
-
-#define MAX_POSBUF 128
-
-#define VM_CFP_CNT(th, cfp) \
- ((rb_control_frame_t *)(th->stack + th->stack_size) - (rb_control_frame_t *)(cfp))
-
-static void
-control_frame_dump(rb_thread_t *th, rb_control_frame_t *cfp)
-{
- int pc = -1, bp = -1, line = 0;
- ptrdiff_t lfp = cfp->lfp - th->stack;
- ptrdiff_t dfp = cfp->dfp - th->stack;
- char lfp_in_heap = ' ', dfp_in_heap = ' ';
- char posbuf[MAX_POSBUF+1];
- int nopos = 0;
-
- const char *magic, *iseq_name = "-", *selfstr = "-", *biseq_name = "-";
- VALUE tmp;
-
- if (cfp->block_iseq != 0 && BUILTIN_TYPE(cfp->block_iseq) != T_NODE) {
- biseq_name = ""; /* RSTRING(cfp->block_iseq->name)->ptr; */
- }
-
- if (lfp < 0 || (size_t)lfp > th->stack_size) {
- lfp = (ptrdiff_t)cfp->lfp;
- lfp_in_heap = 'p';
- }
- if (dfp < 0 || (size_t)dfp > th->stack_size) {
- dfp = (ptrdiff_t)cfp->dfp;
- dfp_in_heap = 'p';
- }
- if (cfp->bp) {
- bp = cfp->bp - th->stack;
- }
-
- switch (VM_FRAME_TYPE(cfp)) {
- case VM_FRAME_MAGIC_TOP:
- magic = "TOP";
- break;
- case VM_FRAME_MAGIC_METHOD:
- magic = "METHOD";
- break;
- case VM_FRAME_MAGIC_CLASS:
- magic = "CLASS";
- break;
- case VM_FRAME_MAGIC_BLOCK:
- magic = "BLOCK";
- break;
- case VM_FRAME_MAGIC_FINISH:
- magic = "FINISH";
- nopos = 1;
- break;
- case VM_FRAME_MAGIC_CFUNC:
- magic = "CFUNC";
- break;
- case VM_FRAME_MAGIC_PROC:
- magic = "PROC";
- break;
- case VM_FRAME_MAGIC_LAMBDA:
- magic = "LAMBDA";
- break;
- case VM_FRAME_MAGIC_IFUNC:
- magic = "IFUNC";
- break;
- case VM_FRAME_MAGIC_EVAL:
- magic = "EVAL";
- break;
- case 0:
- magic = "------";
- break;
- default:
- magic = "(none)";
- break;
- }
-
- if (0) {
- tmp = rb_inspect(cfp->self);
- selfstr = StringValueCStr(tmp);
- }
- else {
- selfstr = "";
- }
-
- if (nopos) {
- /* no name */
- }
- else if (cfp->iseq != 0) {
- if (RUBY_VM_IFUNC_P(cfp->iseq)) {
- iseq_name = "<ifunc>";
- }
- else {
- int rb_vm_get_sourceline(rb_control_frame_t *);
-
- pc = cfp->pc - cfp->iseq->iseq_encoded;
- iseq_name = RSTRING_PTR(cfp->iseq->name);
- line = rb_vm_get_sourceline(cfp);
- if (line) {
- snprintf(posbuf, MAX_POSBUF, "%s:%d", RSTRING_PTR(cfp->iseq->filename), line);
- }
- }
- }
- else if (cfp->me) {
- iseq_name = rb_id2name(cfp->me->original_id);
- snprintf(posbuf, MAX_POSBUF, ":%s", rb_id2name(cfp->me->original_id));
- line = -1;
- }
-
- fprintf(stderr, "c:%04"PRIdPTRDIFF" ",
- ((rb_control_frame_t *)(th->stack + th->stack_size) - cfp));
- if (pc == -1) {
- fprintf(stderr, "p:---- ");
- }
- else {
- fprintf(stderr, "p:%04d ", pc);
- }
- fprintf(stderr, "s:%04"PRIdPTRDIFF" b:%04d ", (cfp->sp - th->stack), bp);
- fprintf(stderr, lfp_in_heap == ' ' ? "l:%06"PRIdPTRDIFF" " : "l:%06"PRIxPTRDIFF" ", lfp % 10000);
- fprintf(stderr, dfp_in_heap == ' ' ? "d:%06"PRIdPTRDIFF" " : "d:%06"PRIxPTRDIFF" ", dfp % 10000);
- fprintf(stderr, "%-6s", magic);
- if (line && !nopos) {
- fprintf(stderr, " %s", posbuf);
- }
- if (0) {
- fprintf(stderr, " \t");
- fprintf(stderr, "iseq: %-24s ", iseq_name);
- fprintf(stderr, "self: %-24s ", selfstr);
- fprintf(stderr, "%-1s ", biseq_name);
- }
- fprintf(stderr, "\n");
-}
-
-void
-rb_vmdebug_stack_dump_raw(rb_thread_t *th, rb_control_frame_t *cfp)
-{
-#if 0
- VALUE *sp = cfp->sp, *bp = cfp->bp;
- VALUE *lfp = cfp->lfp;
- VALUE *dfp = cfp->dfp;
- VALUE *p, *st, *t;
-
- fprintf(stderr, "-- stack frame ------------\n");
- for (p = st = th->stack; p < sp; p++) {
- fprintf(stderr, "%04ld (%p): %08"PRIxVALUE, (long)(p - st), p, *p);
-
- t = (VALUE *)*p;
- if (th->stack <= t && t < sp) {
- fprintf(stderr, " (= %ld)", (long)((VALUE *)GC_GUARDED_PTR_REF(t) - th->stack));
- }
-
- if (p == lfp)
- fprintf(stderr, " <- lfp");
- if (p == dfp)
- fprintf(stderr, " <- dfp");
- if (p == bp)
- fprintf(stderr, " <- bp"); /* should not be */
-
- fprintf(stderr, "\n");
- }
-#endif
-
- fprintf(stderr, "-- control frame ----------\n");
- while ((void *)cfp < (void *)(th->stack + th->stack_size)) {
- control_frame_dump(th, cfp);
- cfp++;
- }
- fprintf(stderr, "---------------------------\n");
-}
-
-void
-rb_vmdebug_stack_dump_raw_current(void)
-{
- rb_thread_t *th = GET_THREAD();
- rb_vmdebug_stack_dump_raw(th, th->cfp);
-}
-
-void
-rb_vmdebug_env_dump_raw(rb_env_t *env, VALUE *lfp, VALUE *dfp)
-{
- int i;
- fprintf(stderr, "-- env --------------------\n");
-
- while (env) {
- fprintf(stderr, "--\n");
- for (i = 0; i < env->env_size; i++) {
- fprintf(stderr, "%04d: %08lx (%p)", -env->local_size + i, env->env[i],
- (void *)&env->env[i]);
- if (&env->env[i] == lfp)
- fprintf(stderr, " <- lfp");
- if (&env->env[i] == dfp)
- fprintf(stderr, " <- dfp");
- fprintf(stderr, "\n");
- }
-
- if (env->prev_envval != 0) {
- GetEnvPtr(env->prev_envval, env);
- }
- else {
- env = 0;
- }
- }
- fprintf(stderr, "---------------------------\n");
-}
-
-void
-rb_vmdebug_proc_dump_raw(rb_proc_t *proc)
-{
- rb_env_t *env;
- char *selfstr;
- VALUE val = rb_inspect(proc->block.self);
- selfstr = StringValueCStr(val);
-
- fprintf(stderr, "-- proc -------------------\n");
- fprintf(stderr, "self: %s\n", selfstr);
- GetEnvPtr(proc->envval, env);
- rb_vmdebug_env_dump_raw(env, proc->block.lfp, proc->block.dfp);
-}
-
-void
-rb_vmdebug_stack_dump_th(VALUE thval)
-{
- rb_thread_t *th;
- GetThreadPtr(thval, th);
- rb_vmdebug_stack_dump_raw(th, th->cfp);
-}
-
-#if VMDEBUG > 2
-static void
-vm_stack_dump_each(rb_thread_t *th, rb_control_frame_t *cfp)
-{
- int i;
-
- VALUE rstr;
- VALUE *sp = cfp->sp;
- VALUE *lfp = cfp->lfp;
- VALUE *dfp = cfp->dfp;
-
- int argc = 0, local_size = 0;
- const char *name;
- rb_iseq_t *iseq = cfp->iseq;
-
- if (iseq == 0) {
- if (RUBYVM_CFUNC_FRAME_P(cfp)) {
- name = rb_id2name(cfp->me->original_id);
- }
- else {
- name = "?";
- }
- }
- else if (RUBY_VM_IFUNC_P(iseq)) {
- name = "<ifunc>";
- }
- else {
- argc = iseq->argc;
- local_size = iseq->local_size;
- name = RSTRING_PTR(iseq->name);
- }
-
- /* stack trace header */
-
- if (VM_FRAME_TYPE(cfp) == VM_FRAME_MAGIC_METHOD ||
- VM_FRAME_TYPE(cfp) == VM_FRAME_MAGIC_TOP ||
- VM_FRAME_TYPE(cfp) == VM_FRAME_MAGIC_BLOCK ||
- VM_FRAME_TYPE(cfp) == VM_FRAME_MAGIC_CLASS ||
- VM_FRAME_TYPE(cfp) == VM_FRAME_MAGIC_PROC ||
- VM_FRAME_TYPE(cfp) == VM_FRAME_MAGIC_LAMBDA ||
- VM_FRAME_TYPE(cfp) == VM_FRAME_MAGIC_CFUNC ||
- VM_FRAME_TYPE(cfp) == VM_FRAME_MAGIC_IFUNC ||
- VM_FRAME_TYPE(cfp) == VM_FRAME_MAGIC_EVAL) {
-
- VALUE *ptr = dfp - local_size;
-
- vm_stack_dump_each(th, cfp + 1);
- control_frame_dump(th, cfp);
-
- if (lfp != dfp) {
- local_size++;
- }
- for (i = 0; i < argc; i++) {
- rstr = rb_inspect(*ptr);
- fprintf(stderr, " arg %2d: %8s (%p)\n", i, StringValueCStr(rstr),
- (void *)ptr++);
- }
- for (; i < local_size - 1; i++) {
- rstr = rb_inspect(*ptr);
- fprintf(stderr, " local %2d: %8s (%p)\n", i, StringValueCStr(rstr),
- (void *)ptr++);
- }
-
- ptr = cfp->bp;
- for (; ptr < sp; ptr++, i++) {
- if (*ptr == Qundef) {
- rstr = rb_str_new2("undef");
- }
- else {
- rstr = rb_inspect(*ptr);
- }
- fprintf(stderr, " stack %2d: %8s (%"PRIdPTRDIFF")\n", i, StringValueCStr(rstr),
- (ptr - th->stack));
- }
- }
- else if (VM_FRAME_TYPE(cfp) == VM_FRAME_MAGIC_FINISH) {
- if ((th)->stack + (th)->stack_size > (VALUE *)(cfp + 2)) {
- vm_stack_dump_each(th, cfp + 1);
- }
- else {
- /* SDR(); */
- }
- }
- else {
- rb_bug("unsupport frame type: %08lx", VM_FRAME_TYPE(cfp));
- }
-}
-#endif
-
-void
-rb_vmdebug_debug_print_register(rb_thread_t *th)
-{
- rb_control_frame_t *cfp = th->cfp;
- int pc = -1;
- int lfp = cfp->lfp - th->stack;
- int dfp = cfp->dfp - th->stack;
- int cfpi;
-
- if (RUBY_VM_NORMAL_ISEQ_P(cfp->iseq)) {
- pc = cfp->pc - cfp->iseq->iseq_encoded;
- }
-
- if (lfp < 0 || (size_t)lfp > th->stack_size)
- lfp = -1;
- if (dfp < 0 || (size_t)dfp > th->stack_size)
- dfp = -1;
-
- cfpi = ((rb_control_frame_t *)(th->stack + th->stack_size)) - cfp;
- fprintf(stderr, " [PC] %04d, [SP] %04"PRIdPTRDIFF", [LFP] %04d, [DFP] %04d, [CFP] %04d\n",
- pc, (cfp->sp - th->stack), lfp, dfp, cfpi);
-}
-
-void
-rb_vmdebug_thread_dump_regs(VALUE thval)
-{
- rb_thread_t *th;
- GetThreadPtr(thval, th);
- rb_vmdebug_debug_print_register(th);
-}
-
-void
-rb_vmdebug_debug_print_pre(rb_thread_t *th, rb_control_frame_t *cfp)
-{
- rb_iseq_t *iseq = cfp->iseq;
-
- if (iseq != 0 && VM_FRAME_TYPE(cfp) != VM_FRAME_MAGIC_FINISH) {
- VALUE *seq = iseq->iseq;
- int pc = cfp->pc - iseq->iseq_encoded;
-
- printf("%3"PRIdPTRDIFF" ", VM_CFP_CNT(th, cfp));
- rb_iseq_disasm_insn(0, seq, pc, iseq, 0);
- }
-
-#if VMDEBUG > 3
- fprintf(stderr, " (1)");
- rb_vmdebug_debug_print_register(th);
-#endif
-}
-
-void
-rb_vmdebug_debug_print_post(rb_thread_t *th, rb_control_frame_t *cfp
-#if OPT_STACK_CACHING
- , VALUE reg_a, VALUE reg_b
-#endif
- )
-{
-#if VMDEBUG > 9
- SDR2(cfp);
-#endif
-
-#if VMDEBUG > 3
- fprintf(stderr, " (2)");
- rb_vmdebug_debug_print_register(th);
-#endif
- /* stack_dump_raw(th, cfp); */
-
-#if VMDEBUG > 2
- /* stack_dump_thobj(th); */
- vm_stack_dump_each(th, th->cfp);
-#if OPT_STACK_CACHING
- {
- VALUE rstr;
- rstr = rb_inspect(reg_a);
- fprintf(stderr, " sc reg A: %s\n", StringValueCStr(rstr));
- rstr = rb_inspect(reg_b);
- fprintf(stderr, " sc reg B: %s\n", StringValueCStr(rstr));
- }
-#endif
- printf
- ("--------------------------------------------------------------\n");
-#endif
-}
-
-#ifdef COLLECT_USAGE_ANALYSIS
-/* uh = {
- * insn(Fixnum) => ihash(Hash)
- * }
- * ihash = {
- * -1(Fixnum) => count, # insn usage
- * 0(Fixnum) => ophash, # operand usage
- * }
- * ophash = {
- * val(interned string) => count(Fixnum)
- * }
- */
-void
-vm_analysis_insn(int insn)
-{
- ID usage_hash;
- ID bigram_hash;
- static int prev_insn = -1;
-
- VALUE uh;
- VALUE ihash;
- VALUE cv;
-
- CONST_ID(usage_hash, "USAGE_ANALYSIS_INSN");
- CONST_ID(bigram_hash, "USAGE_ANALYSIS_INSN_BIGRAM");
- uh = rb_const_get(rb_cRubyVM, usage_hash);
- if ((ihash = rb_hash_aref(uh, INT2FIX(insn))) == Qnil) {
- ihash = rb_hash_new();
- rb_hash_aset(uh, INT2FIX(insn), ihash);
- }
- if ((cv = rb_hash_aref(ihash, INT2FIX(-1))) == Qnil) {
- cv = INT2FIX(0);
- }
- rb_hash_aset(ihash, INT2FIX(-1), INT2FIX(FIX2INT(cv) + 1));
-
- /* calc bigram */
- if (prev_insn != -1) {
- VALUE bi;
- VALUE ary[2];
- VALUE cv;
-
- ary[0] = INT2FIX(prev_insn);
- ary[1] = INT2FIX(insn);
- bi = rb_ary_new4(2, &ary[0]);
-
- uh = rb_const_get(rb_cRubyVM, bigram_hash);
- if ((cv = rb_hash_aref(uh, bi)) == Qnil) {
- cv = INT2FIX(0);
- }
- rb_hash_aset(uh, bi, INT2FIX(FIX2INT(cv) + 1));
- }
- prev_insn = insn;
-}
-
-/* from disasm.c */
-extern VALUE insn_operand_intern(int insn, int op_no, VALUE op,
- int len, int pos, VALUE child);
-
-void
-vm_analysis_operand(int insn, int n, VALUE op)
-{
- ID usage_hash;
-
- VALUE uh;
- VALUE ihash;
- VALUE ophash;
- VALUE valstr;
- VALUE cv;
-
- CONST_ID(usage_hash, "USAGE_ANALYSIS_INSN");
-
- uh = rb_const_get(rb_cRubyVM, usage_hash);
- if ((ihash = rb_hash_aref(uh, INT2FIX(insn))) == Qnil) {
- ihash = rb_hash_new();
- rb_hash_aset(uh, INT2FIX(insn), ihash);
- }
- if ((ophash = rb_hash_aref(ihash, INT2FIX(n))) == Qnil) {
- ophash = rb_hash_new();
- rb_hash_aset(ihash, INT2FIX(n), ophash);
- }
- /* intern */
- valstr = insn_operand_intern(insn, n, op, 0, 0, 0);
-
- /* set count */
- if ((cv = rb_hash_aref(ophash, valstr)) == Qnil) {
- cv = INT2FIX(0);
- }
- rb_hash_aset(ophash, valstr, INT2FIX(FIX2INT(cv) + 1));
-}
-
-void
-vm_analysis_register(int reg, int isset)
-{
- ID usage_hash;
- VALUE uh;
- VALUE rhash;
- VALUE valstr;
- static const char regstrs[][5] = {
- "pc", /* 0 */
- "sp", /* 1 */
- "cfp", /* 2 */
- "lfp", /* 3 */
- "dfp", /* 4 */
- "self", /* 5 */
- "iseq", /* 6 */
- };
- static const char getsetstr[][4] = {
- "get",
- "set",
- };
- static VALUE syms[sizeof(regstrs) / sizeof(regstrs[0])][2];
-
- VALUE cv;
-
- CONST_ID(usage_hash, "USAGE_ANALYSIS_REGS");
- if (syms[0] == 0) {
- char buff[0x10];
- int i;
-
- for (i = 0; i < sizeof(regstrs) / sizeof(regstrs[0]); i++) {
- int j;
- for (j = 0; j < 2; j++) {
- snfprintf(stderr, buff, 0x10, "%d %s %-4s", i, getsetstr[j],
- regstrs[i]);
- syms[i][j] = ID2SYM(rb_intern(buff));
- }
- }
- }
- valstr = syms[reg][isset];
-
- uh = rb_const_get(rb_cRubyVM, usage_hash);
- if ((cv = rb_hash_aref(uh, valstr)) == Qnil) {
- cv = INT2FIX(0);
- }
- rb_hash_aset(uh, valstr, INT2FIX(FIX2INT(cv) + 1));
-}
-
-
-#endif
-
-VALUE
-rb_vmdebug_thread_dump_state(VALUE self)
-{
- rb_thread_t *th;
- rb_control_frame_t *cfp;
- GetThreadPtr(self, th);
- cfp = th->cfp;
-
- fprintf(stderr, "Thread state dump:\n");
- fprintf(stderr, "pc : %p, sp : %p\n", (void *)cfp->pc, (void *)cfp->sp);
- fprintf(stderr, "cfp: %p, lfp: %p, dfp: %p\n", (void *)cfp, (void *)cfp->lfp, (void *)cfp->dfp);
-
- return Qnil;
-}
-
-static int
-bugreport_backtrace(void *arg, const char *file, int line, const char *method)
-{
- if (!*(int *)arg) {
- fprintf(stderr, "-- Ruby level backtrace information"
- "-----------------------------------------\n");
- *(int *)arg = 1;
- }
- fprintf(stderr, "%s:%d:in `%s'\n", file, line, method);
- return 0;
-}
-
-#if HAVE_BACKTRACE
-#include <execinfo.h>
-#endif
-void
-rb_vm_bugreport(void)
-{
- if (GET_THREAD()->vm) {
- int i;
- SDR();
-
- if (rb_backtrace_each(bugreport_backtrace, &i)) {
- fputs("\n", stderr);
- }
- }
-
-#if HAVE_BACKTRACE
-#define MAX_NATIVE_TRACE 1024
- {
- static void *trace[MAX_NATIVE_TRACE];
- int n = backtrace(trace, MAX_NATIVE_TRACE);
- char **syms = backtrace_symbols(trace, n);
- int i;
-
- fprintf(stderr, "-- C level backtrace information "
- "-------------------------------------------\n");
- if (syms) {
- for (i=0; i<n; i++) {
- fprintf(stderr, "%s\n", syms[i]);
- }
- free(syms);
- }
- fprintf(stderr, "\n");
- }
-#endif
-}
diff --git a/vm_eval.c b/vm_eval.c
deleted file mode 100644
index 6d7c84f7b9..0000000000
--- a/vm_eval.c
+++ /dev/null
@@ -1,1520 +0,0 @@
-/**********************************************************************
-
- vm_eval.c -
-
- $Author$
- created at: Sat May 24 16:02:32 JST 2008
-
- Copyright (C) 1993-2007 Yukihiro Matsumoto
- Copyright (C) 2000 Network Applied Communication Laboratory, Inc.
- Copyright (C) 2000 Information-technology Promotion Agency, Japan
-
-**********************************************************************/
-
-static inline VALUE method_missing(VALUE obj, ID id, int argc, const VALUE *argv, int call_status);
-static inline VALUE rb_vm_set_finish_env(rb_thread_t * th);
-static inline VALUE vm_yield_with_cref(rb_thread_t *th, int argc, const VALUE *argv, const NODE *cref);
-static inline VALUE vm_yield(rb_thread_t *th, int argc, const VALUE *argv);
-static inline VALUE vm_backtrace(rb_thread_t *th, int lev);
-static int vm_backtrace_each(rb_thread_t *th, int lev, rb_backtrace_iter_func *iter, void *arg);
-static NODE *vm_cref_push(rb_thread_t *th, VALUE klass, int noex);
-static VALUE vm_exec(rb_thread_t *th);
-static void vm_set_eval_stack(rb_thread_t * th, VALUE iseqval, const NODE *cref);
-static int vm_collect_local_variables_in_heap(rb_thread_t *th, VALUE *dfp, VALUE ary);
-static VALUE send_internal(int argc, const VALUE *argv, VALUE recv, int scope);
-
-typedef enum call_type {
- CALL_PUBLIC,
- CALL_FCALL,
- CALL_VCALL,
-} call_type;
-
-static inline VALUE
-vm_call0(rb_thread_t* th, VALUE recv, VALUE id, int argc, const VALUE *argv,
- const rb_method_entry_t *me)
-{
- VALUE val;
- VALUE klass = me->klass;
- const rb_block_t *blockptr = 0;
-
- if (th->passed_block) {
- blockptr = th->passed_block;
- th->passed_block = 0;
- }
-
- again:
- switch (me->type) {
- case VM_METHOD_TYPE_ISEQ: {
- rb_control_frame_t *reg_cfp;
- int i;
-
- rb_vm_set_finish_env(th);
- reg_cfp = th->cfp;
-
- CHECK_STACK_OVERFLOW(reg_cfp, argc + 1);
-
- *reg_cfp->sp++ = recv;
- for (i = 0; i < argc; i++) {
- *reg_cfp->sp++ = argv[i];
- }
-
- vm_setup_method(th, reg_cfp, recv, argc, blockptr, 0 /* flag */, me);
- val = vm_exec(th);
- break;
- }
- case VM_METHOD_TYPE_CFUNC: {
- EXEC_EVENT_HOOK(th, RUBY_EVENT_C_CALL, recv, id, klass);
- {
- rb_control_frame_t *reg_cfp = th->cfp;
- rb_control_frame_t *cfp =
- vm_push_frame(th, 0, VM_FRAME_MAGIC_CFUNC,
- recv, (VALUE)blockptr, 0, reg_cfp->sp, 0, 1);
-
- cfp->me = me;
- val = call_cfunc(me->body.cfunc.func, recv, me->body.cfunc.argc, argc, argv);
-
- if (reg_cfp != th->cfp + 1) {
- rb_bug("cfp consistency error - call0");
- }
- vm_pop_frame(th);
- }
- EXEC_EVENT_HOOK(th, RUBY_EVENT_C_RETURN, recv, id, klass);
- break;
- }
- case VM_METHOD_TYPE_ATTRSET: {
- if (argc != 1) {
- rb_raise(rb_eArgError, "wrong number of arguments (%d for 1)", argc);
- }
- val = rb_ivar_set(recv, me->body.attr_id, argv[0]);
- break;
- }
- case VM_METHOD_TYPE_IVAR: {
- if (argc != 0) {
- rb_raise(rb_eArgError, "wrong number of arguments (%d for 0)", argc);
- }
- val = rb_attr_get(recv, me->body.attr_id);
- break;
- }
- case VM_METHOD_TYPE_BMETHOD: {
- val = vm_call_bmethod(th, recv, argc, argv, blockptr, me);
- break;
- }
- case VM_METHOD_TYPE_ZSUPER: {
- klass = RCLASS_SUPER(klass);
- if (!klass || !(me = rb_method_entry(klass, id))) {
- return method_missing(recv, id, argc, argv, 0);
- }
- RUBY_VM_CHECK_INTS();
- goto again;
- }
- case VM_METHOD_TYPE_OPTIMIZED: {
- switch (me->body.optimize_type) {
- case OPTIMIZED_METHOD_TYPE_SEND:
- val = send_internal(argc, argv, recv, NOEX_NOSUPER | NOEX_PRIVATE);
- break;
- case OPTIMIZED_METHOD_TYPE_CALL: {
- rb_proc_t *proc;
- GetProcPtr(recv, proc);
- val = rb_vm_invoke_proc(th, proc, proc->block.self, argc, argv, blockptr);
- break;
- }
- default:
- rb_bug("vm_call0: unsupported optimized method type (%d)", me->body.optimize_type);
- val = Qundef;
- break;
- }
- break;
- }
- default:
- rb_bug("vm_call0: unsupported method type (%d)", me->type);
- val = Qundef;
- }
- RUBY_VM_CHECK_INTS();
- return val;
-}
-
-VALUE
-rb_vm_call(rb_thread_t *th, VALUE recv, VALUE id, int argc, const VALUE *argv,
- const rb_method_entry_t *me)
-{
- return vm_call0(th, recv, id, argc, argv, me);
-}
-
-static inline VALUE
-vm_call_super(rb_thread_t *th, int argc, const VALUE *argv)
-{
- VALUE recv = th->cfp->self;
- VALUE klass;
- ID id;
- rb_method_entry_t *me;
- rb_control_frame_t *cfp = th->cfp;
-
- if (!cfp->iseq) {
- klass = cfp->me->klass;
- klass = RCLASS_SUPER(klass);
-
- if (klass == 0) {
- klass = vm_search_normal_superclass(cfp->me->klass, recv);
- }
- id = cfp->me->original_id;
- }
- else {
- rb_bug("vm_call_super: should not be reached");
- }
-
- me = rb_method_entry(klass, id);
- if (!me) {
- return method_missing(recv, id, argc, argv, 0);
- }
-
- return vm_call0(th, recv, id, argc, argv, me);
-}
-
-VALUE
-rb_call_super(int argc, const VALUE *argv)
-{
- PASS_PASSED_BLOCK();
- return vm_call_super(GET_THREAD(), argc, argv);
-}
-
-static inline void
-stack_check(void)
-{
- rb_thread_t *th = GET_THREAD();
-
- if (!rb_thread_raised_p(th, RAISED_STACKOVERFLOW) && ruby_stack_check()) {
- rb_thread_raised_set(th, RAISED_STACKOVERFLOW);
- rb_exc_raise(sysstack_error);
- }
-}
-
-static inline VALUE
-rb_call0(VALUE recv, ID mid, int argc, const VALUE *argv,
- call_type scope, VALUE self)
-{
- VALUE klass = CLASS_OF(recv);
- rb_method_entry_t *me;
- struct cache_entry *ent;
- rb_thread_t *th = GET_THREAD();
- ID oid;
- int noex;
-
- if (!klass) {
- const char *adj = "terminated";
- if (!IMMEDIATE_P(recv) && RBASIC(recv)->flags != 0)
- adj = "hidden";
- rb_raise(rb_eNotImpError,
- "method `%s' called on %s object (%p)",
- rb_id2name(mid), adj, (void *)recv);
- }
-
- /* is it in the method cache? */
- ent = cache + EXPR1(klass, mid);
-
- if (ent->mid == mid && ent->klass == klass) {
- if (!ent->me) {
- return method_missing(recv, mid, argc, argv,
- scope == CALL_VCALL ? NOEX_VCALL : 0);
- }
- me = ent->me;
- klass = me->klass;
- }
- else if ((me = rb_method_entry(klass, mid)) != 0) {
- klass = me->klass;
- }
- else {
- if (scope == 3) {
- return method_missing(recv, mid, argc, argv, NOEX_SUPER);
- }
- return method_missing(recv, mid, argc, argv,
- scope == CALL_VCALL ? NOEX_VCALL : 0);
- }
-
- oid = me->original_id;
- noex = me->flag;
-
- if (oid != idMethodMissing) {
- /* receiver specified form for private method */
- if (UNLIKELY(noex)) {
- if (((noex & NOEX_MASK) & NOEX_PRIVATE) && scope == CALL_PUBLIC) {
- return method_missing(recv, mid, argc, argv, NOEX_PRIVATE);
- }
-
- /* self must be kind of a specified form for protected method */
- if (((noex & NOEX_MASK) & NOEX_PROTECTED) && scope == CALL_PUBLIC) {
- VALUE defined_class = klass;
-
- if (TYPE(defined_class) == T_ICLASS) {
- defined_class = RBASIC(defined_class)->klass;
- }
-
- if (self == Qundef) {
- self = th->cfp->self;
- }
- if (!rb_obj_is_kind_of(self, rb_class_real(defined_class))) {
- return method_missing(recv, mid, argc, argv, NOEX_PROTECTED);
- }
- }
-
- if (NOEX_SAFE(noex) > th->safe_level) {
- rb_raise(rb_eSecurityError, "calling insecure method: %s", rb_id2name(mid));
- }
- }
- }
-
- stack_check();
- return vm_call0(th, recv, mid, argc, argv, me);
-}
-
-static inline VALUE
-rb_call(VALUE recv, ID mid, int argc, const VALUE *argv, call_type scope)
-{
- return rb_call0(recv, mid, argc, argv, scope, Qundef);
-}
-
-NORETURN(static void raise_method_missing(rb_thread_t *th, int argc, const VALUE *argv,
- VALUE obj, int call_status));
-
-/*
- * call-seq:
- * obj.method_missing(symbol [, *args] ) => result
- *
- * Invoked by Ruby when <i>obj</i> is sent a message it cannot handle.
- * <i>symbol</i> is the symbol for the method called, and <i>args</i>
- * are any arguments that were passed to it. By default, the interpreter
- * raises an error when this method is called. However, it is possible
- * to override the method to provide more dynamic behavior.
- * If it is decided that a particular method should not be handled, then
- * <i>super</i> should be called, so that ancestors can pick up the
- * missing method.
- * The example below creates
- * a class <code>Roman</code>, which responds to methods with names
- * consisting of roman numerals, returning the corresponding integer
- * values.
- *
- * class Roman
- * def romanToInt(str)
- * # ...
- * end
- * def method_missing(methId)
- * str = methId.id2name
- * romanToInt(str)
- * end
- * end
- *
- * r = Roman.new
- * r.iv #=> 4
- * r.xxiii #=> 23
- * r.mm #=> 2000
- */
-
-static VALUE
-rb_method_missing(int argc, const VALUE *argv, VALUE obj)
-{
- rb_thread_t *th = GET_THREAD();
- raise_method_missing(th, argc, argv, obj, th->method_missing_reason);
- return Qnil; /* not reached */
-}
-
-#define NOEX_MISSING 0x80
-
-static void
-raise_method_missing(rb_thread_t *th, int argc, const VALUE *argv, VALUE obj,
- int last_call_status)
-{
- ID id;
- VALUE exc = rb_eNoMethodError;
- const char *format = 0;
-
- if (argc == 0 || !SYMBOL_P(argv[0])) {
- rb_raise(rb_eArgError, "no id given");
- }
-
- stack_check();
-
- id = SYM2ID(argv[0]);
-
- if (last_call_status & NOEX_PRIVATE) {
- format = "private method `%s' called for %s";
- }
- else if (last_call_status & NOEX_PROTECTED) {
- format = "protected method `%s' called for %s";
- }
- else if (last_call_status & NOEX_VCALL) {
- format = "undefined local variable or method `%s' for %s";
- exc = rb_eNameError;
- }
- else if (last_call_status & NOEX_SUPER) {
- format = "super: no superclass method `%s' for %s";
- }
- if (!format) {
- format = "undefined method `%s' for %s";
- }
-
- {
- int n = 0;
- VALUE args[3];
- args[n++] = rb_funcall(rb_const_get(exc, rb_intern("message")), '!',
- 3, rb_str_new2(format), obj, argv[0]);
- args[n++] = argv[0];
- if (exc == rb_eNoMethodError) {
- args[n++] = rb_ary_new4(argc - 1, argv + 1);
- }
- exc = rb_class_new_instance(n, args, exc);
-
- if (!(last_call_status & NOEX_MISSING)) {
- th->cfp = RUBY_VM_PREVIOUS_CONTROL_FRAME(th->cfp);
- }
- rb_exc_raise(exc);
- }
-}
-
-static inline VALUE
-method_missing(VALUE obj, ID id, int argc, const VALUE *argv, int call_status)
-{
- VALUE *nargv, result, argv_ary = 0;
- rb_thread_t *th = GET_THREAD();
-
- th->method_missing_reason = call_status;
- th->passed_block = 0;
-
- if (id == idMethodMissing) {
- raise_method_missing(th, argc, argv, obj, call_status | NOEX_MISSING);
- }
- else if (id == ID_ALLOCATOR) {
- rb_raise(rb_eTypeError, "allocator undefined for %s",
- rb_class2name(obj));
- }
-
- if (argc < 0x100) {
- nargv = ALLOCA_N(VALUE, argc + 1);
- }
- else {
- argv_ary = rb_ary_tmp_new(argc + 1);
- nargv = RARRAY_PTR(argv_ary);
- }
- nargv[0] = ID2SYM(id);
- MEMCPY(nargv + 1, argv, VALUE, argc);
-
- result = rb_funcall2(obj, idMethodMissing, argc + 1, nargv);
- if (argv_ary) rb_ary_clear(argv_ary);
- return result;
-}
-
-void
-rb_raise_method_missing(rb_thread_t *th, int argc, VALUE *argv,
- VALUE obj, int call_status)
-{
- th->passed_block = 0;
- raise_method_missing(th, argc, argv, obj, call_status | NOEX_MISSING);
-}
-
-VALUE
-rb_apply(VALUE recv, ID mid, VALUE args)
-{
- int argc;
- VALUE *argv;
-
- argc = RARRAY_LENINT(args);
- argv = ALLOCA_N(VALUE, argc);
- MEMCPY(argv, RARRAY_PTR(args), VALUE, argc);
- return rb_call(recv, mid, argc, argv, CALL_FCALL);
-}
-
-VALUE
-rb_funcall(VALUE recv, ID mid, int n, ...)
-{
- VALUE *argv;
- va_list ar;
- va_init_list(ar, n);
-
- if (n > 0) {
- long i;
-
- argv = ALLOCA_N(VALUE, n);
-
- for (i = 0; i < n; i++) {
- argv[i] = va_arg(ar, VALUE);
- }
- va_end(ar);
- }
- else {
- argv = 0;
- }
- return rb_call(recv, mid, n, argv, CALL_FCALL);
-}
-
-VALUE
-rb_funcall2(VALUE recv, ID mid, int argc, const VALUE *argv)
-{
- return rb_call(recv, mid, argc, argv, CALL_FCALL);
-}
-
-VALUE
-rb_funcall3(VALUE recv, ID mid, int argc, const VALUE *argv)
-{
- return rb_call(recv, mid, argc, argv, CALL_PUBLIC);
-}
-
-static VALUE
-send_internal(int argc, const VALUE *argv, VALUE recv, int scope)
-{
- VALUE vid;
- VALUE self = RUBY_VM_PREVIOUS_CONTROL_FRAME(GET_THREAD()->cfp)->self;
- rb_thread_t *th = GET_THREAD();
-
- if (argc == 0) {
- rb_raise(rb_eArgError, "no method name given");
- }
-
- vid = *argv++; argc--;
- PASS_PASSED_BLOCK_TH(th);
-
- return rb_call0(recv, rb_to_id(vid), argc, argv, scope, self);
-}
-
-/*
- * call-seq:
- * obj.send(symbol [, args...]) => obj
- * obj.__send__(symbol [, args...]) => obj
- *
- * Invokes the method identified by _symbol_, passing it any
- * arguments specified. You can use <code>__send__</code> if the name
- * +send+ clashes with an existing method in _obj_.
- *
- * class Klass
- * def hello(*args)
- * "Hello " + args.join(' ')
- * end
- * end
- * k = Klass.new
- * k.send :hello, "gentle", "readers" #=> "Hello gentle readers"
- */
-
-VALUE
-rb_f_send(int argc, VALUE *argv, VALUE recv)
-{
- return send_internal(argc, argv, recv, NOEX_NOSUPER | NOEX_PRIVATE);
-}
-
-/*
- * call-seq:
- * obj.public_send(symbol [, args...]) => obj
- *
- * Invokes the method identified by _symbol_, passing it any
- * arguments specified. Unlike send, public_send calls public
- * methods only.
- *
- * 1.public_send(:puts, "hello") # causes NoMethodError
- */
-
-VALUE
-rb_f_public_send(int argc, VALUE *argv, VALUE recv)
-{
- return send_internal(argc, argv, recv, NOEX_PUBLIC);
-}
-
-/* yield */
-
-static inline VALUE
-rb_yield_0(int argc, const VALUE * argv)
-{
- return vm_yield(GET_THREAD(), argc, argv);
-}
-
-VALUE
-rb_yield(VALUE val)
-{
- if (val == Qundef) {
- return rb_yield_0(0, 0);
- }
- else {
- return rb_yield_0(1, &val);
- }
-}
-
-VALUE
-rb_yield_values(int n, ...)
-{
- if (n == 0) {
- return rb_yield_0(0, 0);
- }
- else {
- int i;
- VALUE *argv;
- va_list args;
- argv = ALLOCA_N(VALUE, n);
-
- va_init_list(args, n);
- for (i=0; i<n; i++) {
- argv[i] = va_arg(args, VALUE);
- }
- va_end(args);
-
- return rb_yield_0(n, argv);
- }
-}
-
-VALUE
-rb_yield_values2(int argc, const VALUE *argv)
-{
- return rb_yield_0(argc, argv);
-}
-
-VALUE
-rb_yield_splat(VALUE values)
-{
- VALUE tmp = rb_check_array_type(values);
- volatile VALUE v;
- if (NIL_P(tmp)) {
- rb_raise(rb_eArgError, "not an array");
- }
- v = rb_yield_0(RARRAY_LENINT(tmp), RARRAY_PTR(tmp));
- return v;
-}
-
-static VALUE
-loop_i(void)
-{
- for (;;) {
- rb_yield_0(0, 0);
- }
- return Qnil;
-}
-
-/*
- * call-seq:
- * loop {|| block }
- *
- * Repeatedly executes the block.
- *
- * loop do
- * print "Input: "
- * line = gets
- * break if !line or line =~ /^qQ/
- * # ...
- * end
- *
- * StopIteration raised in the block breaks the loop.
- */
-
-static VALUE
-rb_f_loop(VALUE self)
-{
- RETURN_ENUMERATOR(self, 0, 0);
- rb_rescue2(loop_i, (VALUE)0, 0, 0, rb_eStopIteration, (VALUE)0);
- return Qnil; /* dummy */
-}
-
-VALUE
-rb_iterate(VALUE (* it_proc) (VALUE), VALUE data1,
- VALUE (* bl_proc) (ANYARGS), VALUE data2)
-{
- int state;
- volatile VALUE retval = Qnil;
- NODE *node = NEW_IFUNC(bl_proc, data2);
- rb_thread_t *th = GET_THREAD();
- rb_control_frame_t *volatile cfp = th->cfp;
-
- TH_PUSH_TAG(th);
- state = TH_EXEC_TAG();
- if (state == 0) {
- iter_retry:
- {
- rb_block_t *blockptr = RUBY_VM_GET_BLOCK_PTR_IN_CFP(th->cfp);
- blockptr->iseq = (void *)node;
- blockptr->proc = 0;
- th->passed_block = blockptr;
- }
- retval = (*it_proc) (data1);
- }
- else {
- VALUE err = th->errinfo;
- if (state == TAG_BREAK) {
- VALUE *escape_dfp = GET_THROWOBJ_CATCH_POINT(err);
- VALUE *cdfp = cfp->dfp;
-
- if (cdfp == escape_dfp) {
- state = 0;
- th->state = 0;
- th->errinfo = Qnil;
- th->cfp = cfp;
- }
- else{
- /* SDR(); printf("%p, %p\n", cdfp, escape_dfp); */
- }
- }
- else if (state == TAG_RETRY) {
- VALUE *escape_dfp = GET_THROWOBJ_CATCH_POINT(err);
- VALUE *cdfp = cfp->dfp;
-
- if (cdfp == escape_dfp) {
- state = 0;
- th->state = 0;
- th->errinfo = Qnil;
- th->cfp = cfp;
- goto iter_retry;
- }
- }
- }
- TH_POP_TAG();
-
- switch (state) {
- case 0:
- break;
- default:
- TH_JUMP_TAG(th, state);
- }
- return retval;
-}
-
-struct iter_method_arg {
- VALUE obj;
- ID mid;
- int argc;
- VALUE *argv;
-};
-
-static VALUE
-iterate_method(VALUE obj)
-{
- const struct iter_method_arg * arg =
- (struct iter_method_arg *) obj;
-
- return rb_call(arg->obj, arg->mid, arg->argc, arg->argv, CALL_FCALL);
-}
-
-VALUE
-rb_block_call(VALUE obj, ID mid, int argc, VALUE * argv,
- VALUE (*bl_proc) (ANYARGS), VALUE data2)
-{
- struct iter_method_arg arg;
-
- arg.obj = obj;
- arg.mid = mid;
- arg.argc = argc;
- arg.argv = argv;
- return rb_iterate(iterate_method, (VALUE)&arg, bl_proc, data2);
-}
-
-VALUE
-rb_each(VALUE obj)
-{
- return rb_call(obj, idEach, 0, 0, CALL_FCALL);
-}
-
-static VALUE
-eval_string_with_cref(VALUE self, VALUE src, VALUE scope, NODE *cref, const char *volatile file, volatile int line)
-{
- int state;
- VALUE result = Qundef;
- VALUE envval;
- rb_binding_t *bind = 0;
- rb_thread_t *th = GET_THREAD();
- rb_env_t *env = NULL;
- rb_block_t block;
- volatile int parse_in_eval;
- volatile int mild_compile_error;
-
- if (file == 0) {
- file = rb_sourcefile();
- line = rb_sourceline();
- }
-
- parse_in_eval = th->parse_in_eval;
- mild_compile_error = th->mild_compile_error;
- PUSH_TAG();
- if ((state = EXEC_TAG()) == 0) {
- rb_iseq_t *iseq;
- volatile VALUE iseqval;
-
- if (scope != Qnil) {
- if (rb_obj_is_kind_of(scope, rb_cBinding)) {
- GetBindingPtr(scope, bind);
- envval = bind->env;
- }
- else {
- rb_raise(rb_eTypeError,
- "wrong argument type %s (expected Binding)",
- rb_obj_classname(scope));
- }
- GetEnvPtr(envval, env);
- th->base_block = &env->block;
- }
- else {
- rb_control_frame_t *cfp = rb_vm_get_ruby_level_next_cfp(th, th->cfp);
-
- if (cfp != 0) {
- block = *RUBY_VM_GET_BLOCK_PTR_IN_CFP(cfp);
- th->base_block = &block;
- th->base_block->self = self;
- th->base_block->iseq = cfp->iseq; /* TODO */
- }
- else {
- rb_raise(rb_eRuntimeError, "Can't eval on top of Fiber or Thread");
- }
- }
-
- /* make eval iseq */
- th->parse_in_eval++;
- th->mild_compile_error++;
- iseqval = rb_iseq_compile(src, rb_str_new2(file), INT2FIX(line));
- th->mild_compile_error--;
- th->parse_in_eval--;
-
- vm_set_eval_stack(th, iseqval, cref);
- th->base_block = 0;
-
- if (0) { /* for debug */
- printf("%s\n", RSTRING_PTR(rb_iseq_disasm(iseqval)));
- }
-
- /* save new env */
- GetISeqPtr(iseqval, iseq);
- if (bind && iseq->local_size > 0) {
- bind->env = rb_vm_make_env_object(th, th->cfp);
- }
-
- /* kick */
- CHECK_STACK_OVERFLOW(th->cfp, iseq->stack_max);
- result = vm_exec(th);
- }
- POP_TAG();
- th->mild_compile_error = mild_compile_error;
- th->parse_in_eval = parse_in_eval;
-
- if (state) {
- if (state == TAG_RAISE) {
- VALUE errinfo = th->errinfo;
- if (strcmp(file, "(eval)") == 0) {
- VALUE mesg, errat, bt2;
- extern VALUE rb_get_backtrace(VALUE info);
- ID id_mesg;
-
- CONST_ID(id_mesg, "mesg");
- errat = rb_get_backtrace(errinfo);
- mesg = rb_attr_get(errinfo, id_mesg);
- if (!NIL_P(errat) && TYPE(errat) == T_ARRAY &&
- (bt2 = vm_backtrace(th, -2), RARRAY_LEN(bt2) > 0)) {
- if (!NIL_P(mesg) && TYPE(mesg) == T_STRING && !RSTRING_LEN(mesg)) {
- if (OBJ_FROZEN(mesg)) {
- VALUE m = rb_str_cat(rb_str_dup(RARRAY_PTR(errat)[0]), ": ", 2);
- rb_ivar_set(errinfo, id_mesg, rb_str_append(m, mesg));
- }
- else {
- rb_str_update(mesg, 0, 0, rb_str_new2(": "));
- rb_str_update(mesg, 0, 0, RARRAY_PTR(errat)[0]);
- }
- }
- RARRAY_PTR(errat)[0] = RARRAY_PTR(bt2)[0];
- }
- }
- rb_exc_raise(errinfo);
- }
- JUMP_TAG(state);
- }
- return result;
-}
-
-static VALUE
-eval_string(VALUE self, VALUE src, VALUE scope, const char *file, int line)
-{
- return eval_string_with_cref(self, src, scope, 0, file, line);
-}
-
-/*
- * call-seq:
- * eval(string [, binding [, filename [,lineno]]]) => obj
- *
- * Evaluates the Ruby expression(s) in <em>string</em>. If
- * <em>binding</em> is given, the evaluation is performed in its
- * context. The binding may be a <code>Binding</code> object or a
- * <code>Proc</code> object. If the optional <em>filename</em> and
- * <em>lineno</em> parameters are present, they will be used when
- * reporting syntax errors.
- *
- * def getBinding(str)
- * return binding
- * end
- * str = "hello"
- * eval "str + ' Fred'" #=> "hello Fred"
- * eval "str + ' Fred'", getBinding("bye") #=> "bye Fred"
- */
-
-VALUE
-rb_f_eval(int argc, VALUE *argv, VALUE self)
-{
- VALUE src, scope, vfile, vline;
- const char *file = "(eval)";
- int line = 1;
-
- rb_scan_args(argc, argv, "13", &src, &scope, &vfile, &vline);
- if (rb_safe_level() >= 4) {
- StringValue(src);
- if (!NIL_P(scope) && !OBJ_TAINTED(scope)) {
- rb_raise(rb_eSecurityError,
- "Insecure: can't modify trusted binding");
- }
- }
- else {
- SafeStringValue(src);
- }
- if (argc >= 3) {
- StringValue(vfile);
- }
- if (argc >= 4) {
- line = NUM2INT(vline);
- }
-
- if (!NIL_P(vfile))
- file = RSTRING_PTR(vfile);
- return eval_string(self, src, scope, file, line);
-}
-
-VALUE
-rb_eval_string(const char *str)
-{
- return eval_string(rb_vm_top_self(), rb_str_new2(str), Qnil, "(eval)", 1);
-}
-
-VALUE
-rb_eval_string_protect(const char *str, int *state)
-{
- return rb_protect((VALUE (*)(VALUE))rb_eval_string, (VALUE)str, state);
-}
-
-VALUE
-rb_eval_string_wrap(const char *str, int *state)
-{
- int status;
- rb_thread_t *th = GET_THREAD();
- VALUE self = th->top_self;
- VALUE wrapper = th->top_wrapper;
- VALUE val;
-
- th->top_wrapper = rb_module_new();
- th->top_self = rb_obj_clone(rb_vm_top_self());
- rb_extend_object(th->top_self, th->top_wrapper);
-
- val = rb_eval_string_protect(str, &status);
-
- th->top_self = self;
- th->top_wrapper = wrapper;
-
- if (state) {
- *state = status;
- }
- else if (status) {
- JUMP_TAG(status);
- }
- return val;
-}
-
-VALUE
-rb_eval_cmd(VALUE cmd, VALUE arg, int level)
-{
- int state;
- VALUE val = Qnil; /* OK */
- volatile int safe = rb_safe_level();
-
- if (OBJ_TAINTED(cmd)) {
- level = 4;
- }
-
- if (TYPE(cmd) != T_STRING) {
- PUSH_TAG();
- rb_set_safe_level_force(level);
- if ((state = EXEC_TAG()) == 0) {
- val = rb_funcall2(cmd, rb_intern("call"), RARRAY_LENINT(arg),
- RARRAY_PTR(arg));
- }
- POP_TAG();
-
- rb_set_safe_level_force(safe);
-
- if (state)
- JUMP_TAG(state);
- return val;
- }
-
- PUSH_TAG();
- if ((state = EXEC_TAG()) == 0) {
- val = eval_string(rb_vm_top_self(), cmd, Qnil, 0, 0);
- }
- POP_TAG();
-
- rb_set_safe_level_force(safe);
- if (state) rb_vm_jump_tag_but_local_jump(state, val);
- return val;
-}
-
-/* block eval under the class/module context */
-
-static VALUE
-yield_under(VALUE under, VALUE self, VALUE values)
-{
- rb_thread_t *th = GET_THREAD();
- rb_block_t block, *blockptr;
- NODE *cref = vm_cref_push(th, under, NOEX_PUBLIC);
-
- if ((blockptr = GC_GUARDED_PTR_REF(th->cfp->lfp[0])) != 0) {
- block = *blockptr;
- block.self = self;
- th->cfp->lfp[0] = GC_GUARDED_PTR(&block);
- }
-
- if (values == Qundef) {
- return vm_yield_with_cref(th, 0, 0, cref);
- }
- else {
- return vm_yield_with_cref(th, RARRAY_LENINT(values), RARRAY_PTR(values), cref);
- }
-}
-
-/* string eval under the class/module context */
-static VALUE
-eval_under(VALUE under, VALUE self, VALUE src, const char *file, int line)
-{
- NODE *cref = vm_cref_push(GET_THREAD(), under, NOEX_PUBLIC);
-
- if (rb_safe_level() >= 4) {
- StringValue(src);
- }
- else {
- SafeStringValue(src);
- }
-
- return eval_string_with_cref(self, src, Qnil, cref, file, line);
-}
-
-static VALUE
-specific_eval(int argc, VALUE *argv, VALUE klass, VALUE self)
-{
- if (rb_block_given_p()) {
- if (argc > 0) {
- rb_raise(rb_eArgError, "wrong number of arguments (%d for 0)", argc);
- }
- return yield_under(klass, self, Qundef);
- }
- else {
- const char *file = "(eval)";
- int line = 1;
-
- if (argc == 0) {
- rb_raise(rb_eArgError, "block not supplied");
- }
- else {
- if (rb_safe_level() >= 4) {
- StringValue(argv[0]);
- }
- else {
- SafeStringValue(argv[0]);
- }
- if (argc > 3) {
- const char *name = rb_id2name(rb_frame_callee());
- rb_raise(rb_eArgError,
- "wrong number of arguments: %s(src) or %s{..}",
- name, name);
- }
- if (argc > 2)
- line = NUM2INT(argv[2]);
- if (argc > 1) {
- file = StringValuePtr(argv[1]);
- }
- }
- return eval_under(klass, self, argv[0], file, line);
- }
-}
-
-/*
- * call-seq:
- * obj.instance_eval(string [, filename [, lineno]] ) => obj
- * obj.instance_eval {| | block } => obj
- *
- * Evaluates a string containing Ruby source code, or the given block,
- * within the context of the receiver (_obj_). In order to set the
- * context, the variable +self+ is set to _obj_ while
- * the code is executing, giving the code access to _obj_'s
- * instance variables. In the version of <code>instance_eval</code>
- * that takes a +String+, the optional second and third
- * parameters supply a filename and starting line number that are used
- * when reporting compilation errors.
- *
- * class KlassWithSecret
- * def initialize
- * @secret = 99
- * end
- * end
- * k = KlassWithSecret.new
- * k.instance_eval { @secret } #=> 99
- */
-
-VALUE
-rb_obj_instance_eval(int argc, VALUE *argv, VALUE self)
-{
- VALUE klass;
-
- if (SPECIAL_CONST_P(self)) {
- klass = Qnil;
- }
- else {
- klass = rb_singleton_class(self);
- }
- return specific_eval(argc, argv, klass, self);
-}
-
-/*
- * call-seq:
- * obj.instance_exec(arg...) {|var...| block } => obj
- *
- * Executes the given block within the context of the receiver
- * (_obj_). In order to set the context, the variable +self+ is set
- * to _obj_ while the code is executing, giving the code access to
- * _obj_'s instance variables. Arguments are passed as block parameters.
- *
- * class KlassWithSecret
- * def initialize
- * @secret = 99
- * end
- * end
- * k = KlassWithSecret.new
- * k.instance_exec(5) {|x| @secret+x } #=> 104
- */
-
-VALUE
-rb_obj_instance_exec(int argc, VALUE *argv, VALUE self)
-{
- VALUE klass;
-
- if (SPECIAL_CONST_P(self)) {
- klass = Qnil;
- }
- else {
- klass = rb_singleton_class(self);
- }
- return yield_under(klass, self, rb_ary_new4(argc, argv));
-}
-
-/*
- * call-seq:
- * mod.class_eval(string [, filename [, lineno]]) => obj
- * mod.module_eval {|| block } => obj
- *
- * Evaluates the string or block in the context of _mod_. This can
- * be used to add methods to a class. <code>module_eval</code> returns
- * the result of evaluating its argument. The optional _filename_
- * and _lineno_ parameters set the text for error messages.
- *
- * class Thing
- * end
- * a = %q{def hello() "Hello there!" end}
- * Thing.module_eval(a)
- * puts Thing.new.hello()
- * Thing.module_eval("invalid code", "dummy", 123)
- *
- * <em>produces:</em>
- *
- * Hello there!
- * dummy:123:in `module_eval': undefined local variable
- * or method `code' for Thing:Class
- */
-
-VALUE
-rb_mod_module_eval(int argc, VALUE *argv, VALUE mod)
-{
- return specific_eval(argc, argv, mod, mod);
-}
-
-/*
- * call-seq:
- * mod.module_exec(arg...) {|var...| block } => obj
- * mod.class_exec(arg...) {|var...| block } => obj
- *
- * Evaluates the given block in the context of the class/module.
- * The method defined in the block will belong to the receiver.
- *
- * class Thing
- * end
- * Thing.class_exec{
- * def hello() "Hello there!" end
- * }
- * puts Thing.new.hello()
- *
- * <em>produces:</em>
- *
- * Hello there!
- */
-
-VALUE
-rb_mod_module_exec(int argc, VALUE *argv, VALUE mod)
-{
- return yield_under(mod, mod, rb_ary_new4(argc, argv));
-}
-
-/*
- * call-seq:
- * throw(tag [, obj])
- *
- * Transfers control to the end of the active +catch+ block
- * waiting for _tag_. Raises +ArgumentError+ if there
- * is no +catch+ block for the _tag_. The optional second
- * parameter supplies a return value for the +catch+ block,
- * which otherwise defaults to +nil+. For examples, see
- * <code>Kernel::catch</code>.
- */
-
-static VALUE
-rb_f_throw(int argc, VALUE *argv)
-{
- VALUE tag, value;
-
- rb_scan_args(argc, argv, "11", &tag, &value);
- rb_throw_obj(tag, value);
- return Qnil; /* not reached */
-}
-
-void
-rb_throw_obj(VALUE tag, VALUE value)
-{
- rb_thread_t *th = GET_THREAD();
- struct rb_vm_tag *tt = th->tag;
-
- while (tt) {
- if (tt->tag == tag) {
- tt->retval = value;
- break;
- }
- tt = tt->prev;
- }
- if (!tt) {
- VALUE desc = rb_inspect(tag);
- rb_raise(rb_eArgError, "uncaught throw %s", RSTRING_PTR(desc));
- }
- rb_trap_restore_mask();
- th->errinfo = NEW_THROW_OBJECT(tag, 0, TAG_THROW);
-
- JUMP_TAG(TAG_THROW);
-}
-
-void
-rb_throw(const char *tag, VALUE val)
-{
- rb_throw_obj(ID2SYM(rb_intern(tag)), val);
-}
-
-/*
- * call-seq:
- * catch([arg]) {|tag| block } => obj
- *
- * +catch+ executes its block. If a +throw+ is
- * executed, Ruby searches up its stack for a +catch+ block
- * with a tag corresponding to the +throw+'s
- * _tag_. If found, that block is terminated, and
- * +catch+ returns the value given to +throw+. If
- * +throw+ is not called, the block terminates normally, and
- * the value of +catch+ is the value of the last expression
- * evaluated. +catch+ expressions may be nested, and the
- * +throw+ call need not be in lexical scope.
- *
- * def routine(n)
- * puts n
- * throw :done if n <= 0
- * routine(n-1)
- * end
- *
- *
- * catch(:done) { routine(3) }
- *
- * <em>produces:</em>
- *
- * 3
- * 2
- * 1
- * 0
- *
- * when _arg_ is given, +catch+ yields it as is, or when no
- * _arg_ is given, +catch+ assigns a new unique object to
- * +throw+. this is usefull for nested +catch+. _arg_ can
- * be an arbitrary object, not only Symbol.
- *
- */
-
-static VALUE
-rb_f_catch(int argc, VALUE *argv)
-{
- VALUE tag;
- int state;
- volatile VALUE val = Qnil; /* OK */
- rb_thread_t *th = GET_THREAD();
- rb_control_frame_t *saved_cfp = th->cfp;
-
- if (argc == 0) {
- tag = rb_obj_alloc(rb_cObject);
- }
- else {
- rb_scan_args(argc, argv, "01", &tag);
- }
- PUSH_TAG();
-
- th->tag->tag = tag;
-
- if ((state = EXEC_TAG()) == 0) {
- val = rb_yield_0(1, &tag);
- }
- else if (state == TAG_THROW && RNODE(th->errinfo)->u1.value == tag) {
- th->cfp = saved_cfp;
- val = th->tag->retval;
- th->errinfo = Qnil;
- state = 0;
- }
- POP_TAG();
- if (state)
- JUMP_TAG(state);
-
- return val;
-}
-
-static VALUE
-catch_null_i(VALUE dmy)
-{
- return rb_funcall(Qnil, rb_intern("catch"), 0, 0);
-}
-
-static VALUE
-catch_i(VALUE tag)
-{
- return rb_funcall(Qnil, rb_intern("catch"), 1, tag);
-}
-
-VALUE
-rb_catch(const char *tag, VALUE (*func)(), VALUE data)
-{
- if (!tag) {
- return rb_iterate(catch_null_i, 0, func, data);
- }
- return rb_iterate(catch_i, ID2SYM(rb_intern(tag)), func, data);
-}
-
-VALUE
-rb_catch_obj(VALUE tag, VALUE (*func)(), VALUE data)
-{
- return rb_iterate((VALUE (*)_((VALUE)))catch_i, tag, func, data);
-}
-
-/*
- * call-seq:
- * caller(start=1) => array
- *
- * Returns the current execution stack---an array containing strings in
- * the form ``<em>file:line</em>'' or ``<em>file:line: in
- * `method'</em>''. The optional _start_ parameter
- * determines the number of initial stack entries to omit from the
- * result.
- *
- * def a(skip)
- * caller(skip)
- * end
- * def b(skip)
- * a(skip)
- * end
- * def c(skip)
- * b(skip)
- * end
- * c(0) #=> ["prog:2:in `a'", "prog:5:in `b'", "prog:8:in `c'", "prog:10"]
- * c(1) #=> ["prog:5:in `b'", "prog:8:in `c'", "prog:11"]
- * c(2) #=> ["prog:8:in `c'", "prog:12"]
- * c(3) #=> ["prog:13"]
- */
-
-static VALUE
-rb_f_caller(int argc, VALUE *argv)
-{
- VALUE level;
- int lev;
-
- rb_scan_args(argc, argv, "01", &level);
-
- if (NIL_P(level))
- lev = 1;
- else
- lev = NUM2INT(level);
- if (lev < 0)
- rb_raise(rb_eArgError, "negative level (%d)", lev);
-
- return vm_backtrace(GET_THREAD(), lev);
-}
-
-static int
-print_backtrace(void *arg, const char *file, int line, const char *method)
-{
- fprintf((FILE *)arg, "\tfrom %s:%d:in `%s'\n", file, line, method);
- return Qfalse;
-}
-
-void
-rb_backtrace(void)
-{
- vm_backtrace_each(GET_THREAD(), -1, print_backtrace, stdout);
-}
-
-VALUE
-rb_make_backtrace(void)
-{
- return vm_backtrace(GET_THREAD(), -1);
-}
-
-VALUE
-rb_thread_backtrace(VALUE thval)
-{
- rb_thread_t *th;
- GetThreadPtr(thval, th);
-
- switch (th->status) {
- case THREAD_RUNNABLE:
- case THREAD_STOPPED:
- case THREAD_STOPPED_FOREVER:
- break;
- case THREAD_TO_KILL:
- case THREAD_KILLED:
- return Qnil;
- }
-
- return vm_backtrace(th, 0);
-}
-
-VALUE
-rb_backtrace_each(rb_backtrace_iter_func *iter, void *arg)
-{
- return vm_backtrace_each(GET_THREAD(), -1, iter, arg);
-}
-
-/*
- * call-seq:
- * local_variables => array
- *
- * Returns the names of the current local variables.
- *
- * fred = 1
- * for i in 1..10
- * # ...
- * end
- * local_variables #=> [:fred, :i]
- */
-
-static VALUE
-rb_f_local_variables(void)
-{
- VALUE ary = rb_ary_new();
- rb_thread_t *th = GET_THREAD();
- rb_control_frame_t *cfp =
- vm_get_ruby_level_caller_cfp(th, RUBY_VM_PREVIOUS_CONTROL_FRAME(th->cfp));
- int i;
-
- while (cfp) {
- if (cfp->iseq) {
- for (i = 0; i < cfp->iseq->local_table_size; i++) {
- ID lid = cfp->iseq->local_table[i];
- if (lid) {
- const char *vname = rb_id2name(lid);
- /* should skip temporary variable */
- if (vname) {
- rb_ary_push(ary, ID2SYM(lid));
- }
- }
- }
- }
- if (cfp->lfp != cfp->dfp) {
- /* block */
- VALUE *dfp = GC_GUARDED_PTR_REF(cfp->dfp[0]);
-
- if (vm_collect_local_variables_in_heap(th, dfp, ary)) {
- break;
- }
- else {
- while (cfp->dfp != dfp) {
- cfp = RUBY_VM_PREVIOUS_CONTROL_FRAME(cfp);
- }
- }
- }
- else {
- break;
- }
- }
- return ary;
-}
-
-/*
- * call-seq:
- * block_given? => true or false
- * iterator? => true or false
- *
- * Returns <code>true</code> if <code>yield</code> would execute a
- * block in the current context. The <code>iterator?</code> form
- * is mildly deprecated.
- *
- * def try
- * if block_given?
- * yield
- * else
- * "no block"
- * end
- * end
- * try #=> "no block"
- * try { "hello" } #=> "hello"
- * try do "hello" end #=> "hello"
- */
-
-
-VALUE
-rb_f_block_given_p(void)
-{
- rb_thread_t *th = GET_THREAD();
- rb_control_frame_t *cfp = th->cfp;
- cfp = vm_get_ruby_level_caller_cfp(th, RUBY_VM_PREVIOUS_CONTROL_FRAME(cfp));
-
- if (cfp != 0 &&
- (cfp->lfp[0] & 0x02) == 0 &&
- GC_GUARDED_PTR_REF(cfp->lfp[0])) {
- return Qtrue;
- }
- else {
- return Qfalse;
- }
-}
-
-void
-Init_vm_eval(void)
-{
- rb_define_global_function("eval", rb_f_eval, -1);
- rb_define_global_function("local_variables", rb_f_local_variables, 0);
- rb_define_global_function("iterator?", rb_f_block_given_p, 0);
- rb_define_global_function("block_given?", rb_f_block_given_p, 0);
-
- rb_define_global_function("catch", rb_f_catch, -1);
- rb_define_global_function("throw", rb_f_throw, -1);
-
- rb_define_global_function("loop", rb_f_loop, 0);
-
- rb_define_method(rb_cBasicObject, "instance_eval", rb_obj_instance_eval, -1);
- rb_define_method(rb_cBasicObject, "instance_exec", rb_obj_instance_exec, -1);
- rb_define_private_method(rb_cBasicObject, "method_missing", rb_method_missing, -1);
-
-#if 1
- rb_add_method(rb_cBasicObject, rb_intern("__send__"),
- VM_METHOD_TYPE_OPTIMIZED, (void *)OPTIMIZED_METHOD_TYPE_SEND, 0);
- rb_add_method(rb_mKernel, rb_intern("send"),
- VM_METHOD_TYPE_OPTIMIZED, (void *)OPTIMIZED_METHOD_TYPE_SEND, 0);
-#else
- rb_define_method(rb_cBasicObject, "__send__", rb_f_send, -1);
- rb_define_method(rb_mKernel, "send", rb_f_send, -1);
-#endif
- rb_define_method(rb_mKernel, "public_send", rb_f_public_send, -1);
-
- rb_define_method(rb_cModule, "module_exec", rb_mod_module_exec, -1);
- rb_define_method(rb_cModule, "class_exec", rb_mod_module_exec, -1);
- rb_define_method(rb_cModule, "module_eval", rb_mod_module_eval, -1);
- rb_define_method(rb_cModule, "class_eval", rb_mod_module_eval, -1);
-
- rb_define_global_function("caller", rb_f_caller, -1);
-}
-
diff --git a/vm_exec.c b/vm_exec.c
deleted file mode 100644
index 51b8a0f142..0000000000
--- a/vm_exec.c
+++ /dev/null